diff --git a/components.d.ts b/components.d.ts index b85df9fba..4eeb64745 100644 --- a/components.d.ts +++ b/components.d.ts @@ -17,6 +17,7 @@ declare module '@vue/runtime-core' { IconSupport: typeof import('./src/components/icons/IconSupport.vue')['default'] IconTooling: typeof import('./src/components/icons/IconTooling.vue')['default'] List: typeof import('./src/components/List/index.vue')['default'] + Loading: typeof import('./src/components/Loading/index.vue')['default'] Message: typeof import('./src/components/Message/index.vue')['default'] Modal: typeof import('./src/components/Modal/index.vue')['default'] Nav: typeof import('./src/components/Nav/index.vue')['default'] diff --git a/index.html b/index.html index 898befb5a..8f39c4d3b 100644 --- a/index.html +++ b/index.html @@ -10,8 +10,8 @@ - - + + diff --git a/package-lock.json b/package-lock.json index 31364ebc4..296a7dcaf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,11 +8,6 @@ "name": "page_customize", "version": "0.0.0", "dependencies": { - "@cesium-extends/drawer": "^1.3.6", - "@cesium-extends/heat": "^1.0.3", - "@cesium-extends/measure": "^1.1.4", - "@cesium-extends/subscriber": "^1.1.0", - "@cesium-extends/tooltip": "^1.2.3", "@turf/turf": "^7.1.0", "@visactor/vtable": "^1.13.2", "@visactor/vtable-gantt": "^1.13.2", @@ -21,6 +16,8 @@ "@wenrenfangge/cesium-draw": "^1.0.4", "axios": "^1.2.1", "cesium": "^1.123.0", + "cesium-extends": "^1.8.23", + "cesium-sensors-es6": "^1.0.0", "chroma-js": "^3.1.2", "dayjs": "^1.11.13", "echarts": "^5.5.1", @@ -1658,6 +1655,18 @@ "cesium": "*" } }, + "node_modules/@cesium-extends/compass": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/@cesium-extends/compass/-/compass-1.2.2.tgz", + "integrity": "sha512-vMt+73kfVYsKuKn2p5dU+VX/EzFpVm54hQUP2HibA+UXmMlVYcqHm2Rt1rUQO4lDIZs0XTUEgr49+7o3oMWCHA==", + "license": "MIT", + "dependencies": { + "@cesium-extends/common": "^1.0.1" + }, + "peerDependencies": { + "cesium": "*" + } + }, "node_modules/@cesium-extends/drawer": { "version": "1.3.7", "resolved": "https://registry.npmmirror.com/@cesium-extends/drawer/-/drawer-1.3.7.tgz", @@ -1672,6 +1681,1705 @@ "cesium": "*" } }, + "node_modules/@cesium-extends/geojson-render": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/@cesium-extends/geojson-render/-/geojson-render-1.0.8.tgz", + "integrity": "sha512-b8fr8iFc4iOt5Ju+QQYF2dY5cXw9L2JaQ3VleJHH5ZfFOhqi7rH/y3ZPPBqwcAr2WUCGK+fngB+P3SGblXA+OA==", + "license": "MIT", + "dependencies": { + "@cesium-extends/primitive-geojson": "^1.0.1", + "@turf/turf": "^6.5.0" + }, + "peerDependencies": { + "cesium": "*" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/along": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/along/-/along-6.5.0.tgz", + "integrity": "sha512-LLyWQ0AARqJCmMcIEAXF4GEu8usmd4Kbz3qk1Oy5HoRNpZX47+i5exQtmIWKdqJ1MMhW26fCTXgpsEs5zgJ5gw==", + "license": "MIT", + "dependencies": { + "@turf/bearing": "^6.5.0", + "@turf/destination": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/angle": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/angle/-/angle-6.5.0.tgz", + "integrity": "sha512-4pXMbWhFofJJAOvTMCns6N4C8CMd5Ih4O2jSAG9b3dDHakj3O4yN1+Zbm+NUei+eVEZ9gFeVp9svE3aMDenIkw==", + "license": "MIT", + "dependencies": { + "@turf/bearing": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/rhumb-bearing": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/area": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/area/-/area-6.5.0.tgz", + "integrity": "sha512-xCZdiuojokLbQ+29qR6qoMD89hv+JAgWjLrwSEWL+3JV8IXKeNFl6XkEJz9HGkVpnXvQKJoRz4/liT+8ZZ5Jyg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/bbox": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/bbox/-/bbox-6.5.0.tgz", + "integrity": "sha512-RBbLaao5hXTYyyg577iuMtDB8ehxMlUqHEJiMs8jT1GHkFhr6sYre3lmLsPeYEi/ZKj5TP5tt7fkzNdJ4GIVyw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/bbox-clip": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/bbox-clip/-/bbox-clip-6.5.0.tgz", + "integrity": "sha512-F6PaIRF8WMp8EmgU/Ke5B1Y6/pia14UAYB5TiBC668w5rVVjy5L8rTm/m2lEkkDMHlzoP9vNY4pxpNthE7rLcQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/bbox-polygon": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/bbox-polygon/-/bbox-polygon-6.5.0.tgz", + "integrity": "sha512-+/r0NyL1lOG3zKZmmf6L8ommU07HliP4dgYToMoTxqzsWzyLjaj/OzgQ8rBmv703WJX+aS6yCmLuIhYqyufyuw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/bearing": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/bearing/-/bearing-6.5.0.tgz", + "integrity": "sha512-dxINYhIEMzgDOztyMZc20I7ssYVNEpSv04VbMo5YPQsqa80KO3TFvbuCahMsCAW5z8Tncc8dwBlEFrmRjJG33A==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/bezier-spline": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/bezier-spline/-/bezier-spline-6.5.0.tgz", + "integrity": "sha512-vokPaurTd4PF96rRgGVm6zYYC5r1u98ZsG+wZEv9y3kJTuJRX/O3xIY2QnTGTdbVmAJN1ouOsD0RoZYaVoXORQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-clockwise": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-clockwise/-/boolean-clockwise-6.5.0.tgz", + "integrity": "sha512-45+C7LC5RMbRWrxh3Z0Eihsc8db1VGBO5d9BLTOAwU4jR6SgsunTfRWR16X7JUwIDYlCVEmnjcXJNi/kIU3VIw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-contains": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-contains/-/boolean-contains-6.5.0.tgz", + "integrity": "sha512-4m8cJpbw+YQcKVGi8y0cHhBUnYT+QRfx6wzM4GI1IdtYH3p4oh/DOBJKrepQyiDzFDaNIjxuWXBh0ai1zVwOQQ==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/boolean-point-on-line": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-crosses": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-crosses/-/boolean-crosses-6.5.0.tgz", + "integrity": "sha512-gvshbTPhAHporTlQwBJqyfW+2yV8q/mOTxG6PzRVl6ARsqNoqYQWkd4MLug7OmAqVyBzLK3201uAeBjxbGw0Ng==", + "license": "MIT", + "dependencies": { + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/line-intersect": "^6.5.0", + "@turf/polygon-to-line": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-disjoint": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-disjoint/-/boolean-disjoint-6.5.0.tgz", + "integrity": "sha512-rZ2ozlrRLIAGo2bjQ/ZUu4oZ/+ZjGvLkN5CKXSKBcu6xFO6k2bgqeM8a1836tAW+Pqp/ZFsTA5fZHsJZvP2D5g==", + "license": "MIT", + "dependencies": { + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/line-intersect": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/polygon-to-line": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-equal": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-equal/-/boolean-equal-6.5.0.tgz", + "integrity": "sha512-cY0M3yoLC26mhAnjv1gyYNQjn7wxIXmL2hBmI/qs8g5uKuC2hRWi13ydufE3k4x0aNRjFGlg41fjoYLwaVF+9Q==", + "license": "MIT", + "dependencies": { + "@turf/clean-coords": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "geojson-equality": "0.1.6" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-intersects": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-intersects/-/boolean-intersects-6.5.0.tgz", + "integrity": "sha512-nIxkizjRdjKCYFQMnml6cjPsDOBCThrt+nkqtSEcxkKMhAQj5OO7o2CecioNTaX8EayqwMGVKcsz27oP4mKPTw==", + "license": "MIT", + "dependencies": { + "@turf/boolean-disjoint": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-overlap": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-overlap/-/boolean-overlap-6.5.0.tgz", + "integrity": "sha512-8btMIdnbXVWUa1M7D4shyaSGxLRw6NjMcqKBcsTXcZdnaixl22k7ar7BvIzkaRYN3SFECk9VGXfLncNS3ckQUw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/line-intersect": "^6.5.0", + "@turf/line-overlap": "^6.5.0", + "@turf/meta": "^6.5.0", + "geojson-equality": "0.1.6" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-parallel": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-parallel/-/boolean-parallel-6.5.0.tgz", + "integrity": "sha512-aSHJsr1nq9e5TthZGZ9CZYeXklJyRgR5kCLm5X4urz7+MotMOp/LsGOsvKvK9NeUl9+8OUmfMn8EFTT8LkcvIQ==", + "license": "MIT", + "dependencies": { + "@turf/clean-coords": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/line-segment": "^6.5.0", + "@turf/rhumb-bearing": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-point-in-polygon": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-point-in-polygon/-/boolean-point-in-polygon-6.5.0.tgz", + "integrity": "sha512-DtSuVFB26SI+hj0SjrvXowGTUCHlgevPAIsukssW6BG5MlNSBQAo70wpICBNJL6RjukXg8d2eXaAWuD/CqL00A==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-point-on-line": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-point-on-line/-/boolean-point-on-line-6.5.0.tgz", + "integrity": "sha512-A1BbuQ0LceLHvq7F/P7w3QvfpmZqbmViIUPHdNLvZimFNLo4e6IQunmzbe+8aSStH9QRZm3VOflyvNeXvvpZEQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/boolean-within": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/boolean-within/-/boolean-within-6.5.0.tgz", + "integrity": "sha512-YQB3oU18Inx35C/LU930D36RAVe7LDXk1kWsQ8mLmuqYn9YdPsDQTMTkLJMhoQ8EbN7QTdy333xRQ4MYgToteQ==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/boolean-point-on-line": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/buffer": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/buffer/-/buffer-6.5.0.tgz", + "integrity": "sha512-qeX4N6+PPWbKqp1AVkBVWFerGjMYMUyencwfnkCesoznU6qvfugFHNAngNqIBVnJjZ5n8IFyOf+akcxnrt9sNg==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/center": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/projection": "^6.5.0", + "d3-geo": "1.7.1", + "turf-jsts": "*" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/center": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/center/-/center-6.5.0.tgz", + "integrity": "sha512-T8KtMTfSATWcAX088rEDKjyvQCBkUsLnK/Txb6/8WUXIeOZyHu42G7MkdkHRoHtwieLdduDdmPLFyTdG5/e7ZQ==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/center-mean": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/center-mean/-/center-mean-6.5.0.tgz", + "integrity": "sha512-AAX6f4bVn12pTVrMUiB9KrnV94BgeBKpyg3YpfnEbBpkN/znfVhL8dG8IxMAxAoSZ61Zt9WLY34HfENveuOZ7Q==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/center-median": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/center-median/-/center-median-6.5.0.tgz", + "integrity": "sha512-dT8Ndu5CiZkPrj15PBvslpuf01ky41DEYEPxS01LOxp5HOUHXp1oJxsPxvc+i/wK4BwccPNzU1vzJ0S4emd1KQ==", + "license": "MIT", + "dependencies": { + "@turf/center-mean": "^6.5.0", + "@turf/centroid": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/center-of-mass": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/center-of-mass/-/center-of-mass-6.5.0.tgz", + "integrity": "sha512-EWrriU6LraOfPN7m1jZi+1NLTKNkuIsGLZc2+Y8zbGruvUW+QV7K0nhf7iZWutlxHXTBqEXHbKue/o79IumAsQ==", + "license": "MIT", + "dependencies": { + "@turf/centroid": "^6.5.0", + "@turf/convex": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/centroid": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/centroid/-/centroid-6.5.0.tgz", + "integrity": "sha512-MwE1oq5E3isewPprEClbfU5pXljIK/GUOMbn22UM3IFPDJX0KeoyLNwghszkdmFp/qMGL/M13MMWvU+GNLXP/A==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/circle": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/circle/-/circle-6.5.0.tgz", + "integrity": "sha512-oU1+Kq9DgRnoSbWFHKnnUdTmtcRUMmHoV9DjTXu9vOLNV5OWtAAh1VZ+mzsioGGzoDNT/V5igbFOkMfBQc0B6A==", + "license": "MIT", + "dependencies": { + "@turf/destination": "^6.5.0", + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/clean-coords": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/clean-coords/-/clean-coords-6.5.0.tgz", + "integrity": "sha512-EMX7gyZz0WTH/ET7xV8MyrExywfm9qUi0/MY89yNffzGIEHuFfqwhcCqZ8O00rZIPZHUTxpmsxQSTfzJJA1CPw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/clone": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/clone/-/clone-6.5.0.tgz", + "integrity": "sha512-mzVtTFj/QycXOn6ig+annKrM6ZlimreKYz6f/GSERytOpgzodbQyOgkfwru100O1KQhhjSudKK4DsQ0oyi9cTw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/clusters": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/clusters/-/clusters-6.5.0.tgz", + "integrity": "sha512-Y6gfnTJzQ1hdLfCsyd5zApNbfLIxYEpmDibHUqR5z03Lpe02pa78JtgrgUNt1seeO/aJ4TG1NLN8V5gOrHk04g==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/clusters-dbscan": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/clusters-dbscan/-/clusters-dbscan-6.5.0.tgz", + "integrity": "sha512-SxZEE4kADU9DqLRiT53QZBBhu8EP9skviSyl+FGj08Y01xfICM/RR9ACUdM0aEQimhpu+ZpRVcUK+2jtiCGrYQ==", + "license": "MIT", + "dependencies": { + "@turf/clone": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0", + "density-clustering": "1.3.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/clusters-kmeans": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/clusters-kmeans/-/clusters-kmeans-6.5.0.tgz", + "integrity": "sha512-DwacD5+YO8kwDPKaXwT9DV46tMBVNsbi1IzdajZu1JDSWoN7yc7N9Qt88oi+p30583O0UPVkAK+A10WAQv4mUw==", + "license": "MIT", + "dependencies": { + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "skmeans": "0.9.7" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/collect": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/collect/-/collect-6.5.0.tgz", + "integrity": "sha512-4dN/T6LNnRg099m97BJeOcTA5fSI8cu87Ydgfibewd2KQwBexO69AnjEFqfPX3Wj+Zvisj1uAVIZbPmSSrZkjg==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/helpers": "^6.5.0", + "rbush": "2.x" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/combine": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/combine/-/combine-6.5.0.tgz", + "integrity": "sha512-Q8EIC4OtAcHiJB3C4R+FpB4LANiT90t17uOd851qkM2/o6m39bfN5Mv0PWqMZIHWrrosZqRqoY9dJnzz/rJxYQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/concave": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/concave/-/concave-6.5.0.tgz", + "integrity": "sha512-I/sUmUC8TC5h/E2vPwxVht+nRt+TnXIPRoztDFvS8/Y0+cBDple9inLSo9nnPXMXidrBlGXZ9vQx/BjZUJgsRQ==", + "license": "MIT", + "dependencies": { + "@turf/clone": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/tin": "^6.5.0", + "topojson-client": "3.x", + "topojson-server": "3.x" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/convex": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/convex/-/convex-6.5.0.tgz", + "integrity": "sha512-x7ZwC5z7PJB0SBwNh7JCeCNx7Iu+QSrH7fYgK0RhhNop13TqUlvHMirMLRgf2db1DqUetrAO2qHJeIuasquUWg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0", + "concaveman": "*" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/destination": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/destination/-/destination-6.5.0.tgz", + "integrity": "sha512-4cnWQlNC8d1tItOz9B4pmJdWpXqS0vEvv65bI/Pj/genJnsL7evI0/Xw42RvEGROS481MPiU80xzvwxEvhQiMQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/difference": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/difference/-/difference-6.5.0.tgz", + "integrity": "sha512-l8iR5uJqvI+5Fs6leNbhPY5t/a3vipUF/3AeVLpwPQcgmedNXyheYuy07PcMGH5Jdpi5gItOiTqwiU/bUH4b3A==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "polygon-clipping": "^0.15.3" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/dissolve": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/dissolve/-/dissolve-6.5.0.tgz", + "integrity": "sha512-WBVbpm9zLTp0Bl9CE35NomTaOL1c4TQCtEoO43YaAhNEWJOOIhZMFJyr8mbvYruKl817KinT3x7aYjjCMjTAsQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "polygon-clipping": "^0.15.3" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/distance": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/distance/-/distance-6.5.0.tgz", + "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/distance-weight": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/distance-weight/-/distance-weight-6.5.0.tgz", + "integrity": "sha512-a8qBKkgVNvPKBfZfEJZnC3DV7dfIsC3UIdpRci/iap/wZLH41EmS90nM+BokAJflUHYy8PqE44wySGWHN1FXrQ==", + "license": "MIT", + "dependencies": { + "@turf/centroid": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/ellipse": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/ellipse/-/ellipse-6.5.0.tgz", + "integrity": "sha512-kuXtwFviw/JqnyJXF1mrR/cb496zDTSbGKtSiolWMNImYzGGkbsAsFTjwJYgD7+4FixHjp0uQPzo70KDf3AIBw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/rhumb-destination": "^6.5.0", + "@turf/transform-rotate": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/envelope": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/envelope/-/envelope-6.5.0.tgz", + "integrity": "sha512-9Z+FnBWvOGOU4X+fMZxYFs1HjFlkKqsddLuMknRaqcJd6t+NIv5DWvPtDL8ATD2GEExYDiFLwMdckfr1yqJgHA==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/bbox-polygon": "^6.5.0", + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/explode": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/explode/-/explode-6.5.0.tgz", + "integrity": "sha512-6cSvMrnHm2qAsace6pw9cDmK2buAlw8+tjeJVXMfMyY+w7ZUi1rprWMsY92J7s2Dar63Bv09n56/1V7+tcj52Q==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/flatten": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/flatten/-/flatten-6.5.0.tgz", + "integrity": "sha512-IBZVwoNLVNT6U/bcUUllubgElzpMsNoCw8tLqBw6dfYg9ObGmpEjf9BIYLr7a2Yn5ZR4l7YIj2T7kD5uJjZADQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/flip": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/flip/-/flip-6.5.0.tgz", + "integrity": "sha512-oyikJFNjt2LmIXQqgOGLvt70RgE2lyzPMloYWM7OR5oIFGRiBvqVD2hA6MNw6JewIm30fWZ8DQJw1NHXJTJPbg==", + "license": "MIT", + "dependencies": { + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/great-circle": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/great-circle/-/great-circle-6.5.0.tgz", + "integrity": "sha512-7ovyi3HaKOXdFyN7yy1yOMa8IyOvV46RC1QOQTT+RYUN8ke10eyqExwBpL9RFUPvlpoTzoYbM/+lWPogQlFncg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/helpers": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/helpers/-/helpers-6.5.0.tgz", + "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "license": "MIT", + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/hex-grid": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/hex-grid/-/hex-grid-6.5.0.tgz", + "integrity": "sha512-Ln3tc2tgZT8etDOldgc6e741Smg1CsMKAz1/Mlel+MEL5Ynv2mhx3m0q4J9IB1F3a4MNjDeVvm8drAaf9SF33g==", + "license": "MIT", + "dependencies": { + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/intersect": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/interpolate": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/interpolate/-/interpolate-6.5.0.tgz", + "integrity": "sha512-LSH5fMeiGyuDZ4WrDJNgh81d2DnNDUVJtuFryJFup8PV8jbs46lQGfI3r1DJ2p1IlEJIz3pmAZYeTfMMoeeohw==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/centroid": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/hex-grid": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/point-grid": "^6.5.0", + "@turf/square-grid": "^6.5.0", + "@turf/triangle-grid": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/intersect": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/intersect/-/intersect-6.5.0.tgz", + "integrity": "sha512-2legGJeKrfFkzntcd4GouPugoqPUjexPZnOvfez+3SfIMrHvulw8qV8u7pfVyn2Yqs53yoVCEjS5sEpvQ5YRQg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "polygon-clipping": "^0.15.3" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/invariant": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/invariant/-/invariant-6.5.0.tgz", + "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/isobands": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/isobands/-/isobands-6.5.0.tgz", + "integrity": "sha512-4h6sjBPhRwMVuFaVBv70YB7eGz+iw0bhPRnp+8JBdX1UPJSXhoi/ZF2rACemRUr0HkdVB/a1r9gC32vn5IAEkw==", + "license": "MIT", + "dependencies": { + "@turf/area": "^6.5.0", + "@turf/bbox": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/explode": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "object-assign": "*" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/isolines": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/isolines/-/isolines-6.5.0.tgz", + "integrity": "sha512-6ElhiLCopxWlv4tPoxiCzASWt/jMRvmp6mRYrpzOm3EUl75OhHKa/Pu6Y9nWtCMmVC/RcWtiiweUocbPLZLm0A==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "object-assign": "*" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/kinks": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/kinks/-/kinks-6.5.0.tgz", + "integrity": "sha512-ViCngdPt1eEL7hYUHR2eHR662GvCgTc35ZJFaNR6kRtr6D8plLaDju0FILeFFWSc+o8e3fwxZEJKmFj9IzPiIQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/length": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/length/-/length-6.5.0.tgz", + "integrity": "sha512-5pL5/pnw52fck3oRsHDcSGrj9HibvtlrZ0QNy2OcW8qBFDNgZ4jtl6U7eATVoyWPKBHszW3dWETW+iLV7UARig==", + "license": "MIT", + "dependencies": { + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/line-arc": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/line-arc/-/line-arc-6.5.0.tgz", + "integrity": "sha512-I6c+V6mIyEwbtg9P9zSFF89T7QPe1DPTG3MJJ6Cm1MrAY0MdejwQKOpsvNl8LDU2ekHOlz2kHpPVR7VJsoMllA==", + "license": "MIT", + "dependencies": { + "@turf/circle": "^6.5.0", + "@turf/destination": "^6.5.0", + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/line-chunk": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/line-chunk/-/line-chunk-6.5.0.tgz", + "integrity": "sha512-i1FGE6YJaaYa+IJesTfyRRQZP31QouS+wh/pa6O3CC0q4T7LtHigyBSYjrbjSLfn2EVPYGlPCMFEqNWCOkC6zg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/length": "^6.5.0", + "@turf/line-slice-along": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/line-intersect": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/line-intersect/-/line-intersect-6.5.0.tgz", + "integrity": "sha512-CS6R1tZvVQD390G9Ea4pmpM6mJGPWoL82jD46y0q1KSor9s6HupMIo1kY4Ny+AEYQl9jd21V3Scz20eldpbTVA==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/line-segment": "^6.5.0", + "@turf/meta": "^6.5.0", + "geojson-rbush": "3.x" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/line-offset": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/line-offset/-/line-offset-6.5.0.tgz", + "integrity": "sha512-CEXZbKgyz8r72qRvPchK0dxqsq8IQBdH275FE6o4MrBkzMcoZsfSjghtXzKaz9vvro+HfIXal0sTk2mqV1lQTw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/line-overlap": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/line-overlap/-/line-overlap-6.5.0.tgz", + "integrity": "sha512-xHOaWLd0hkaC/1OLcStCpfq55lPHpPNadZySDXYiYjEz5HXr1oKmtMYpn0wGizsLwrOixRdEp+j7bL8dPt4ojQ==", + "license": "MIT", + "dependencies": { + "@turf/boolean-point-on-line": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/line-segment": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/nearest-point-on-line": "^6.5.0", + "deep-equal": "1.x", + "geojson-rbush": "3.x" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/line-segment": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/line-segment/-/line-segment-6.5.0.tgz", + "integrity": "sha512-jI625Ho4jSuJESNq66Mmi290ZJ5pPZiQZruPVpmHkUw257Pew0alMmb6YrqYNnLUuiVVONxAAKXUVeeUGtycfw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/line-slice": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/line-slice/-/line-slice-6.5.0.tgz", + "integrity": "sha512-vDqJxve9tBHhOaVVFXqVjF5qDzGtKWviyjbyi2QnSnxyFAmLlLnBfMX8TLQCAf2GxHibB95RO5FBE6I2KVPRuw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/nearest-point-on-line": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/line-slice-along": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/line-slice-along/-/line-slice-along-6.5.0.tgz", + "integrity": "sha512-KHJRU6KpHrAj+BTgTNqby6VCTnDzG6a1sJx/I3hNvqMBLvWVA2IrkR9L9DtsQsVY63IBwVdQDqiwCuZLDQh4Ng==", + "license": "MIT", + "dependencies": { + "@turf/bearing": "^6.5.0", + "@turf/destination": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/line-split": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/line-split/-/line-split-6.5.0.tgz", + "integrity": "sha512-/rwUMVr9OI2ccJjw7/6eTN53URtGThNSD5I0GgxyFXMtxWiloRJ9MTff8jBbtPWrRka/Sh2GkwucVRAEakx9Sw==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/line-intersect": "^6.5.0", + "@turf/line-segment": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/nearest-point-on-line": "^6.5.0", + "@turf/square": "^6.5.0", + "@turf/truncate": "^6.5.0", + "geojson-rbush": "3.x" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/line-to-polygon": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/line-to-polygon/-/line-to-polygon-6.5.0.tgz", + "integrity": "sha512-qYBuRCJJL8Gx27OwCD1TMijM/9XjRgXH/m/TyuND4OXedBpIWlK5VbTIO2gJ8OCfznBBddpjiObLBrkuxTpN4Q==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/mask": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/mask/-/mask-6.5.0.tgz", + "integrity": "sha512-RQha4aU8LpBrmrkH8CPaaoAfk0Egj5OuXtv6HuCQnHeGNOQt3TQVibTA3Sh4iduq4EPxnZfDjgsOeKtrCA19lg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "polygon-clipping": "^0.15.3" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/meta": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/meta/-/meta-6.5.0.tgz", + "integrity": "sha512-RrArvtsV0vdsCBegoBtOalgdSOfkBrTJ07VkpiCnq/491W67hnMWmDu7e6Ztw0C3WldRYTXkg3SumfdzZxLBHA==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/midpoint": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/midpoint/-/midpoint-6.5.0.tgz", + "integrity": "sha512-MyTzV44IwmVI6ec9fB2OgZ53JGNlgOpaYl9ArKoF49rXpL84F9rNATndbe0+MQIhdkw8IlzA6xVP4lZzfMNVCw==", + "license": "MIT", + "dependencies": { + "@turf/bearing": "^6.5.0", + "@turf/destination": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/moran-index": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/moran-index/-/moran-index-6.5.0.tgz", + "integrity": "sha512-ItsnhrU2XYtTtTudrM8so4afBCYWNaB0Mfy28NZwLjB5jWuAsvyV+YW+J88+neK/ougKMTawkmjQqodNJaBeLQ==", + "license": "MIT", + "dependencies": { + "@turf/distance-weight": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/nearest-point": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/nearest-point/-/nearest-point-6.5.0.tgz", + "integrity": "sha512-fguV09QxilZv/p94s8SMsXILIAMiaXI5PATq9d7YWijLxWUj6Q/r43kxyoi78Zmwwh1Zfqz9w+bCYUAxZ5+euA==", + "license": "MIT", + "dependencies": { + "@turf/clone": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/nearest-point-on-line": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/nearest-point-on-line/-/nearest-point-on-line-6.5.0.tgz", + "integrity": "sha512-WthrvddddvmymnC+Vf7BrkHGbDOUu6Z3/6bFYUGv1kxw8tiZ6n83/VG6kHz4poHOfS0RaNflzXSkmCi64fLBlg==", + "license": "MIT", + "dependencies": { + "@turf/bearing": "^6.5.0", + "@turf/destination": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/line-intersect": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/nearest-point-to-line": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/nearest-point-to-line/-/nearest-point-to-line-6.5.0.tgz", + "integrity": "sha512-PXV7cN0BVzUZdjj6oeb/ESnzXSfWmEMrsfZSDRgqyZ9ytdiIj/eRsnOXLR13LkTdXVOJYDBuf7xt1mLhM4p6+Q==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/point-to-line-distance": "^6.5.0", + "object-assign": "*" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/planepoint": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/planepoint/-/planepoint-6.5.0.tgz", + "integrity": "sha512-R3AahA6DUvtFbka1kcJHqZ7DMHmPXDEQpbU5WaglNn7NaCQg9HB0XM0ZfqWcd5u92YXV+Gg8QhC8x5XojfcM4Q==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/point-grid": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/point-grid/-/point-grid-6.5.0.tgz", + "integrity": "sha512-Iq38lFokNNtQJnOj/RBKmyt6dlof0yhaHEDELaWHuECm1lIZLY3ZbVMwbs+nXkwTAHjKfS/OtMheUBkw+ee49w==", + "license": "MIT", + "dependencies": { + "@turf/boolean-within": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/point-on-feature": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/point-on-feature/-/point-on-feature-6.5.0.tgz", + "integrity": "sha512-bDpuIlvugJhfcF/0awAQ+QI6Om1Y1FFYE8Y/YdxGRongivix850dTeXCo0mDylFdWFPGDo7Mmh9Vo4VxNwW/TA==", + "license": "MIT", + "dependencies": { + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/center": "^6.5.0", + "@turf/explode": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/nearest-point": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/point-to-line-distance": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/point-to-line-distance/-/point-to-line-distance-6.5.0.tgz", + "integrity": "sha512-opHVQ4vjUhNBly1bob6RWy+F+hsZDH9SA0UW36pIRzfpu27qipU18xup0XXEePfY6+wvhF6yL/WgCO2IbrLqEA==", + "license": "MIT", + "dependencies": { + "@turf/bearing": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/projection": "^6.5.0", + "@turf/rhumb-bearing": "^6.5.0", + "@turf/rhumb-distance": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/points-within-polygon": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/points-within-polygon/-/points-within-polygon-6.5.0.tgz", + "integrity": "sha512-YyuheKqjliDsBDt3Ho73QVZk1VXX1+zIA2gwWvuz8bR1HXOkcuwk/1J76HuFMOQI3WK78wyAi+xbkx268PkQzQ==", + "license": "MIT", + "dependencies": { + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/polygon-smooth": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/polygon-smooth/-/polygon-smooth-6.5.0.tgz", + "integrity": "sha512-LO/X/5hfh/Rk4EfkDBpLlVwt3i6IXdtQccDT9rMjXEP32tRgy0VMFmdkNaXoGlSSKf/1mGqLl4y4wHd86DqKbg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/polygon-tangents": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/polygon-tangents/-/polygon-tangents-6.5.0.tgz", + "integrity": "sha512-sB4/IUqJMYRQH9jVBwqS/XDitkEfbyqRy+EH/cMRJURTg78eHunvJ708x5r6umXsbiUyQU4eqgPzEylWEQiunw==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/boolean-within": "^6.5.0", + "@turf/explode": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/nearest-point": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/polygon-to-line": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/polygon-to-line/-/polygon-to-line-6.5.0.tgz", + "integrity": "sha512-5p4n/ij97EIttAq+ewSnKt0ruvuM+LIDzuczSzuHTpq4oS7Oq8yqg5TQ4nzMVuK41r/tALCk7nAoBuw3Su4Gcw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/polygonize": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/polygonize/-/polygonize-6.5.0.tgz", + "integrity": "sha512-a/3GzHRaCyzg7tVYHo43QUChCspa99oK4yPqooVIwTC61npFzdrmnywMv0S+WZjHZwK37BrFJGFrZGf6ocmY5w==", + "license": "MIT", + "dependencies": { + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/envelope": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/projection": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/projection/-/projection-6.5.0.tgz", + "integrity": "sha512-/Pgh9mDvQWWu8HRxqpM+tKz8OzgauV+DiOcr3FCjD6ubDnrrmMJlsf6fFJmggw93mtVPrZRL6yyi9aYCQBOIvg==", + "license": "MIT", + "dependencies": { + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/random": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/random/-/random-6.5.0.tgz", + "integrity": "sha512-8Q25gQ/XbA7HJAe+eXp4UhcXM9aOOJFaxZ02+XSNwMvY8gtWSCBLVqRcW4OhqilgZ8PeuQDWgBxeo+BIqqFWFQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/rectangle-grid": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/rectangle-grid/-/rectangle-grid-6.5.0.tgz", + "integrity": "sha512-yQZ/1vbW68O2KsSB3OZYK+72aWz/Adnf7m2CMKcC+aq6TwjxZjAvlbCOsNUnMAuldRUVN1ph6RXMG4e9KEvKvg==", + "license": "MIT", + "dependencies": { + "@turf/boolean-intersects": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/rewind": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/rewind/-/rewind-6.5.0.tgz", + "integrity": "sha512-IoUAMcHWotBWYwSYuYypw/LlqZmO+wcBpn8ysrBNbazkFNkLf3btSDZMkKJO/bvOzl55imr/Xj4fi3DdsLsbzQ==", + "license": "MIT", + "dependencies": { + "@turf/boolean-clockwise": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/rhumb-bearing": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/rhumb-bearing/-/rhumb-bearing-6.5.0.tgz", + "integrity": "sha512-jMyqiMRK4hzREjQmnLXmkJ+VTNTx1ii8vuqRwJPcTlKbNWfjDz/5JqJlb5NaFDcdMpftWovkW5GevfnuzHnOYA==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/rhumb-destination": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/rhumb-destination/-/rhumb-destination-6.5.0.tgz", + "integrity": "sha512-RHNP1Oy+7xTTdRrTt375jOZeHceFbjwohPHlr9Hf68VdHHPMAWgAKqiX2YgSWDcvECVmiGaBKWus1Df+N7eE4Q==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/rhumb-distance": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/rhumb-distance/-/rhumb-distance-6.5.0.tgz", + "integrity": "sha512-oKp8KFE8E4huC2Z1a1KNcFwjVOqa99isxNOwfo4g3SUABQ6NezjKDDrnvC4yI5YZ3/huDjULLBvhed45xdCrzg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/sample": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/sample/-/sample-6.5.0.tgz", + "integrity": "sha512-kSdCwY7el15xQjnXYW520heKUrHwRvnzx8ka4eYxX9NFeOxaFITLW2G7UtXb6LJK8mmPXI8Aexv23F2ERqzGFg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/sector": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/sector/-/sector-6.5.0.tgz", + "integrity": "sha512-cYUOkgCTWqa23SOJBqxoFAc/yGCUsPRdn/ovbRTn1zNTm/Spmk6hVB84LCKOgHqvSF25i0d2kWqpZDzLDdAPbw==", + "license": "MIT", + "dependencies": { + "@turf/circle": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/line-arc": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/shortest-path": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/shortest-path/-/shortest-path-6.5.0.tgz", + "integrity": "sha512-4de5+G7+P4hgSoPwn+SO9QSi9HY5NEV/xRJ+cmoFVRwv2CDsuOPDheHKeuIAhKyeKDvPvPt04XYWbac4insJMg==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/bbox-polygon": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/clean-coords": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/transform-scale": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/simplify": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/simplify/-/simplify-6.5.0.tgz", + "integrity": "sha512-USas3QqffPHUY184dwQdP8qsvcVH/PWBYdXY5am7YTBACaQOMAlf6AKJs9FT8jiO6fQpxfgxuEtwmox+pBtlOg==", + "license": "MIT", + "dependencies": { + "@turf/clean-coords": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/square": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/square/-/square-6.5.0.tgz", + "integrity": "sha512-BM2UyWDmiuHCadVhHXKIx5CQQbNCpOxB6S/aCNOCLbhCeypKX5Q0Aosc5YcmCJgkwO5BERCC6Ee7NMbNB2vHmQ==", + "license": "MIT", + "dependencies": { + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/square-grid": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/square-grid/-/square-grid-6.5.0.tgz", + "integrity": "sha512-mlR0ayUdA+L4c9h7p4k3pX6gPWHNGuZkt2c5II1TJRmhLkW2557d6b/Vjfd1z9OVaajb1HinIs1FMSAPXuuUrA==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/rectangle-grid": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/standard-deviational-ellipse": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/standard-deviational-ellipse/-/standard-deviational-ellipse-6.5.0.tgz", + "integrity": "sha512-02CAlz8POvGPFK2BKK8uHGUk/LXb0MK459JVjKxLC2yJYieOBTqEbjP0qaWhiBhGzIxSMaqe8WxZ0KvqdnstHA==", + "license": "MIT", + "dependencies": { + "@turf/center-mean": "^6.5.0", + "@turf/ellipse": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/points-within-polygon": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/tag": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/tag/-/tag-6.5.0.tgz", + "integrity": "sha512-XwlBvrOV38CQsrNfrxvBaAPBQgXMljeU0DV8ExOyGM7/hvuGHJw3y8kKnQ4lmEQcmcrycjDQhP7JqoRv8vFssg==", + "license": "MIT", + "dependencies": { + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/tesselate": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/tesselate/-/tesselate-6.5.0.tgz", + "integrity": "sha512-M1HXuyZFCfEIIKkglh/r5L9H3c5QTEsnMBoZOFQiRnGPGmJWcaBissGb7mTFX2+DKE7FNWXh4TDnZlaLABB0dQ==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "earcut": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/tin": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/tin/-/tin-6.5.0.tgz", + "integrity": "sha512-YLYikRzKisfwj7+F+Tmyy/LE3d2H7D4kajajIfc9mlik2+esG7IolsX/+oUz1biguDYsG0DUA8kVYXDkobukfg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/transform-rotate": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/transform-rotate/-/transform-rotate-6.5.0.tgz", + "integrity": "sha512-A2Ip1v4246ZmpssxpcL0hhiVBEf4L8lGnSPWTgSv5bWBEoya2fa/0SnFX9xJgP40rMP+ZzRaCN37vLHbv1Guag==", + "license": "MIT", + "dependencies": { + "@turf/centroid": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/rhumb-bearing": "^6.5.0", + "@turf/rhumb-destination": "^6.5.0", + "@turf/rhumb-distance": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/transform-scale": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/transform-scale/-/transform-scale-6.5.0.tgz", + "integrity": "sha512-VsATGXC9rYM8qTjbQJ/P7BswKWXHdnSJ35JlV4OsZyHBMxJQHftvmZJsFbOqVtQnIQIzf2OAly6rfzVV9QLr7g==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/center": "^6.5.0", + "@turf/centroid": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/rhumb-bearing": "^6.5.0", + "@turf/rhumb-destination": "^6.5.0", + "@turf/rhumb-distance": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/transform-translate": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/transform-translate/-/transform-translate-6.5.0.tgz", + "integrity": "sha512-NABLw5VdtJt/9vSstChp93pc6oel4qXEos56RBMsPlYB8hzNTEKYtC146XJvyF4twJeeYS8RVe1u7KhoFwEM5w==", + "license": "MIT", + "dependencies": { + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/rhumb-destination": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/triangle-grid": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/triangle-grid/-/triangle-grid-6.5.0.tgz", + "integrity": "sha512-2jToUSAS1R1htq4TyLQYPTIsoy6wg3e3BQXjm2rANzw4wPQCXGOxrur1Fy9RtzwqwljlC7DF4tg0OnWr8RjmfA==", + "license": "MIT", + "dependencies": { + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/intersect": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/truncate": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/truncate/-/truncate-6.5.0.tgz", + "integrity": "sha512-pFxg71pLk+eJj134Z9yUoRhIi8vqnnKvCYwdT4x/DQl/19RVdq1tV3yqOT3gcTQNfniteylL5qV1uTBDV5sgrg==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/turf": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/turf/-/turf-6.5.0.tgz", + "integrity": "sha512-ipMCPnhu59bh92MNt8+pr1VZQhHVuTMHklciQURo54heoxRzt1neNYZOBR6jdL+hNsbDGAECMuIpAutX+a3Y+w==", + "license": "MIT", + "dependencies": { + "@turf/along": "^6.5.0", + "@turf/angle": "^6.5.0", + "@turf/area": "^6.5.0", + "@turf/bbox": "^6.5.0", + "@turf/bbox-clip": "^6.5.0", + "@turf/bbox-polygon": "^6.5.0", + "@turf/bearing": "^6.5.0", + "@turf/bezier-spline": "^6.5.0", + "@turf/boolean-clockwise": "^6.5.0", + "@turf/boolean-contains": "^6.5.0", + "@turf/boolean-crosses": "^6.5.0", + "@turf/boolean-disjoint": "^6.5.0", + "@turf/boolean-equal": "^6.5.0", + "@turf/boolean-intersects": "^6.5.0", + "@turf/boolean-overlap": "^6.5.0", + "@turf/boolean-parallel": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/boolean-point-on-line": "^6.5.0", + "@turf/boolean-within": "^6.5.0", + "@turf/buffer": "^6.5.0", + "@turf/center": "^6.5.0", + "@turf/center-mean": "^6.5.0", + "@turf/center-median": "^6.5.0", + "@turf/center-of-mass": "^6.5.0", + "@turf/centroid": "^6.5.0", + "@turf/circle": "^6.5.0", + "@turf/clean-coords": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/clusters": "^6.5.0", + "@turf/clusters-dbscan": "^6.5.0", + "@turf/clusters-kmeans": "^6.5.0", + "@turf/collect": "^6.5.0", + "@turf/combine": "^6.5.0", + "@turf/concave": "^6.5.0", + "@turf/convex": "^6.5.0", + "@turf/destination": "^6.5.0", + "@turf/difference": "^6.5.0", + "@turf/dissolve": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/distance-weight": "^6.5.0", + "@turf/ellipse": "^6.5.0", + "@turf/envelope": "^6.5.0", + "@turf/explode": "^6.5.0", + "@turf/flatten": "^6.5.0", + "@turf/flip": "^6.5.0", + "@turf/great-circle": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/hex-grid": "^6.5.0", + "@turf/interpolate": "^6.5.0", + "@turf/intersect": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/isobands": "^6.5.0", + "@turf/isolines": "^6.5.0", + "@turf/kinks": "^6.5.0", + "@turf/length": "^6.5.0", + "@turf/line-arc": "^6.5.0", + "@turf/line-chunk": "^6.5.0", + "@turf/line-intersect": "^6.5.0", + "@turf/line-offset": "^6.5.0", + "@turf/line-overlap": "^6.5.0", + "@turf/line-segment": "^6.5.0", + "@turf/line-slice": "^6.5.0", + "@turf/line-slice-along": "^6.5.0", + "@turf/line-split": "^6.5.0", + "@turf/line-to-polygon": "^6.5.0", + "@turf/mask": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/midpoint": "^6.5.0", + "@turf/moran-index": "^6.5.0", + "@turf/nearest-point": "^6.5.0", + "@turf/nearest-point-on-line": "^6.5.0", + "@turf/nearest-point-to-line": "^6.5.0", + "@turf/planepoint": "^6.5.0", + "@turf/point-grid": "^6.5.0", + "@turf/point-on-feature": "^6.5.0", + "@turf/point-to-line-distance": "^6.5.0", + "@turf/points-within-polygon": "^6.5.0", + "@turf/polygon-smooth": "^6.5.0", + "@turf/polygon-tangents": "^6.5.0", + "@turf/polygon-to-line": "^6.5.0", + "@turf/polygonize": "^6.5.0", + "@turf/projection": "^6.5.0", + "@turf/random": "^6.5.0", + "@turf/rewind": "^6.5.0", + "@turf/rhumb-bearing": "^6.5.0", + "@turf/rhumb-destination": "^6.5.0", + "@turf/rhumb-distance": "^6.5.0", + "@turf/sample": "^6.5.0", + "@turf/sector": "^6.5.0", + "@turf/shortest-path": "^6.5.0", + "@turf/simplify": "^6.5.0", + "@turf/square": "^6.5.0", + "@turf/square-grid": "^6.5.0", + "@turf/standard-deviational-ellipse": "^6.5.0", + "@turf/tag": "^6.5.0", + "@turf/tesselate": "^6.5.0", + "@turf/tin": "^6.5.0", + "@turf/transform-rotate": "^6.5.0", + "@turf/transform-scale": "^6.5.0", + "@turf/transform-translate": "^6.5.0", + "@turf/triangle-grid": "^6.5.0", + "@turf/truncate": "^6.5.0", + "@turf/union": "^6.5.0", + "@turf/unkink-polygon": "^6.5.0", + "@turf/voronoi": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/union": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/union/-/union-6.5.0.tgz", + "integrity": "sha512-igYWCwP/f0RFHIlC2c0SKDuM/ObBaqSljI3IdV/x71805QbIvY/BYGcJdyNcgEA6cylIGl/0VSlIbpJHZ9ldhw==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "polygon-clipping": "^0.15.3" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/unkink-polygon": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/unkink-polygon/-/unkink-polygon-6.5.0.tgz", + "integrity": "sha512-8QswkzC0UqKmN1DT6HpA9upfa1HdAA5n6bbuzHy8NJOX8oVizVAqfEPY0wqqTgboDjmBR4yyImsdPGUl3gZ8JQ==", + "license": "MIT", + "dependencies": { + "@turf/area": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0", + "rbush": "^2.0.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/@turf/voronoi": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/voronoi/-/voronoi-6.5.0.tgz", + "integrity": "sha512-C/xUsywYX+7h1UyNqnydHXiun4UPjK88VDghtoRypR9cLlb7qozkiLRphQxxsCM0KxyxpVPHBVQXdAL3+Yurow==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "d3-voronoi": "1.1.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/geojson-render/node_modules/quickselect": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/quickselect/-/quickselect-1.1.1.tgz", + "integrity": "sha512-qN0Gqdw4c4KGPsBOQafj6yj/PA6c/L63f6CaZ/DCF/xF4Esu3jVmKLUDYxghFx8Kb/O7y9tI7x2RjTSXwdK1iQ==", + "license": "ISC" + }, + "node_modules/@cesium-extends/geojson-render/node_modules/rbush": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/rbush/-/rbush-2.0.2.tgz", + "integrity": "sha512-XBOuALcTm+O/H8G90b6pzu6nX6v2zCKiFG4BJho8a+bY6AER6t8uQUZdi5bomQc0AprCWhEGa7ncAbbRap0bRA==", + "license": "MIT", + "dependencies": { + "quickselect": "^1.0.1" + } + }, "node_modules/@cesium-extends/heat": { "version": "1.0.4", "resolved": "https://registry.npmmirror.com/@cesium-extends/heat/-/heat-1.0.4.tgz", @@ -1789,6 +3497,81 @@ "url": "https://opencollective.com/turf" } }, + "node_modules/@cesium-extends/popup": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/@cesium-extends/popup/-/popup-1.0.2.tgz", + "integrity": "sha512-4RU4IuFpbevBTcfvBrMH6Uc0VsKSaYsA++SefWkjCKaTknXJiJ78lnThj/L2jH4cGIUNa+8LZ+oAn4FCvv/QNQ==", + "license": "MIT", + "peerDependencies": { + "cesium": "*" + } + }, + "node_modules/@cesium-extends/primitive-geojson": { + "version": "1.0.11", + "resolved": "https://registry.npmmirror.com/@cesium-extends/primitive-geojson/-/primitive-geojson-1.0.11.tgz", + "integrity": "sha512-vQDRLtkO2IgOv/itdSVaSiQcuaANMkh6C7KeNL9Jf2d9OB75zhUNrKlpsqcQtVsmXrX3DWO7UHt+owytqcnn0w==", + "license": "MIT", + "dependencies": { + "@turf/centroid": "^6.5.0", + "@turf/helpers": "^6.5.0", + "nanoid": "^4.0.2" + }, + "peerDependencies": { + "cesium": "*" + } + }, + "node_modules/@cesium-extends/primitive-geojson/node_modules/@turf/centroid": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/centroid/-/centroid-6.5.0.tgz", + "integrity": "sha512-MwE1oq5E3isewPprEClbfU5pXljIK/GUOMbn22UM3IFPDJX0KeoyLNwghszkdmFp/qMGL/M13MMWvU+GNLXP/A==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/primitive-geojson/node_modules/@turf/helpers": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/helpers/-/helpers-6.5.0.tgz", + "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "license": "MIT", + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/primitive-geojson/node_modules/@turf/meta": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/meta/-/meta-6.5.0.tgz", + "integrity": "sha512-RrArvtsV0vdsCBegoBtOalgdSOfkBrTJ07VkpiCnq/491W67hnMWmDu7e6Ztw0C3WldRYTXkg3SumfdzZxLBHA==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@cesium-extends/primitive-geojson/node_modules/nanoid": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-4.0.2.tgz", + "integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^14 || ^16 || >=18" + } + }, "node_modules/@cesium-extends/subscriber": { "version": "1.1.1", "resolved": "https://registry.npmmirror.com/@cesium-extends/subscriber/-/subscriber-1.1.1.tgz", @@ -1798,6 +3581,15 @@ "cesium": "*" } }, + "node_modules/@cesium-extends/sync-viewer": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/@cesium-extends/sync-viewer/-/sync-viewer-1.0.1.tgz", + "integrity": "sha512-yPTkQgQltjYIOEOUotPqjIZsiO5ac3xuHBGVBaPNfR0m3lcEsus3KTEMdNcJAMJG/4EPypd5C9vQEq0clbLZFQ==", + "license": "MIT", + "peerDependencies": { + "cesium": "*" + } + }, "node_modules/@cesium-extends/tooltip": { "version": "1.2.3", "resolved": "https://registry.npmmirror.com/@cesium-extends/tooltip/-/tooltip-1.2.3.tgz", @@ -1810,6 +3602,18 @@ "cesium": "*" } }, + "node_modules/@cesium-extends/zoom-control": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/@cesium-extends/zoom-control/-/zoom-control-1.2.2.tgz", + "integrity": "sha512-QwqNfWgTBUj3rIhscvcosEQ+HGdEJ2Rip18wHFP6xqZt/ZSqmaTktDdOrKPBsoRn/sgeX0xqg+i0y6HxmjvGOg==", + "license": "MIT", + "dependencies": { + "@cesium-extends/common": "^1.0.1" + }, + "peerDependencies": { + "cesium": "*" + } + }, "node_modules/@cesium/engine": { "version": "13.0.0", "resolved": "https://registry.npmmirror.com/@cesium/engine/-/engine-13.0.0.tgz", @@ -7149,7 +8953,6 @@ "version": "1.0.8", "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.8.tgz", "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.0", @@ -7168,7 +8971,6 @@ "version": "1.0.1", "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -7182,7 +8984,6 @@ "version": "1.0.3", "resolved": "https://registry.npmmirror.com/call-bound/-/call-bound-1.0.3.tgz", "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -7253,6 +9054,40 @@ "node": ">=18.18.0" } }, + "node_modules/cesium-extends": { + "version": "1.8.23", + "resolved": "https://registry.npmmirror.com/cesium-extends/-/cesium-extends-1.8.23.tgz", + "integrity": "sha512-kkEj7cOHItvX+Qw8VwHAEY0Xz48wIiAE2r3AVL3gTy68IvuDg8Fa/uDtzQXoaK7aK9YLx2y/GEqtEswBaHEYrg==", + "license": "MIT", + "dependencies": { + "@cesium-extends/compass": "1.2.2", + "@cesium-extends/drawer": "1.3.7", + "@cesium-extends/geojson-render": "1.0.8", + "@cesium-extends/heat": "1.0.4", + "@cesium-extends/measure": "1.1.4", + "@cesium-extends/popup": "1.0.2", + "@cesium-extends/primitive-geojson": "1.0.11", + "@cesium-extends/subscriber": "1.1.1", + "@cesium-extends/sync-viewer": "1.0.1", + "@cesium-extends/tooltip": "1.2.3", + "@cesium-extends/zoom-control": "1.2.2" + }, + "peerDependencies": { + "cesium": "*" + } + }, + "node_modules/cesium-sensors-es6": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/cesium-sensors-es6/-/cesium-sensors-es6-1.0.0.tgz", + "integrity": "sha512-KxrVb3XkjMSDAUMG8KGsbXlOlb3iqm86Zyzz7s9TNFfpoy6Rk/GDaHO1oOeeHJXLi3VWEqPWm0qXUzAXihxC0A==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "cesium": "^1.102.0" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", @@ -7637,6 +9472,26 @@ } } }, + "node_modules/deep-equal": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/deep-equal/-/deep-equal-1.1.2.tgz", + "integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==", + "license": "MIT", + "dependencies": { + "is-arguments": "^1.1.1", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.5.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmmirror.com/deep-is/-/deep-is-0.1.4.tgz", @@ -7648,7 +9503,6 @@ "version": "1.1.4", "resolved": "https://registry.npmmirror.com/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", @@ -7666,7 +9520,6 @@ "version": "1.2.1", "resolved": "https://registry.npmmirror.com/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", @@ -7689,6 +9542,12 @@ "node": ">=0.4.0" } }, + "node_modules/density-clustering": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/density-clustering/-/density-clustering-1.3.0.tgz", + "integrity": "sha512-icpmBubVTwLnsaor9qH/4tG5+7+f61VcqMN3V3pm9sxxSCt2Jcs0zWOgwZW9ARJYaKD3FumIgHiMOcIMRRAzFQ==", + "license": "MIT" + }, "node_modules/detect-libc": { "version": "1.0.3", "resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-1.0.3.tgz", @@ -7762,7 +9621,6 @@ "version": "1.0.1", "resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -7932,7 +9790,6 @@ "version": "1.0.1", "resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -7942,7 +9799,6 @@ "version": "1.3.0", "resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -7952,7 +9808,6 @@ "version": "1.0.0", "resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.0.0.tgz", "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -8623,7 +10478,6 @@ "version": "1.1.2", "resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8654,7 +10508,6 @@ "version": "1.2.3", "resolved": "https://registry.npmmirror.com/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8705,6 +10558,15 @@ "integrity": "sha512-OtXqLQuR9hlQ/HkAF/OdzRea7E0eZK1ay8y8CBXkoO2R6v34CsDrWYLMSo0ZzMsaQDpKo76NPP2GGo+PyG1cSg==", "license": "MIT" }, + "node_modules/geojson-equality": { + "version": "0.1.6", + "resolved": "https://registry.npmmirror.com/geojson-equality/-/geojson-equality-0.1.6.tgz", + "integrity": "sha512-TqG8YbqizP3EfwP5Uw4aLu6pKkg6JQK9uq/XZ1lXQntvTHD1BBKJWhNpJ2M0ax6TuWMP3oyx6Oq7FCIfznrgpQ==", + "license": "MIT", + "dependencies": { + "deep-equal": "^1.0.0" + } + }, "node_modules/geojson-equality-ts": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/geojson-equality-ts/-/geojson-equality-ts-1.0.2.tgz", @@ -8757,11 +10619,50 @@ "quickselect": "^1.0.1" } }, + "node_modules/geojson-rbush": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/geojson-rbush/-/geojson-rbush-3.2.0.tgz", + "integrity": "sha512-oVltQTXolxvsz1sZnutlSuLDEcQAKYC/uXt9zDzJJ6bu0W+baTI8LZBaTup5afzibEH4N3jlq2p+a152wlBJ7w==", + "license": "MIT", + "dependencies": { + "@turf/bbox": "*", + "@turf/helpers": "6.x", + "@turf/meta": "6.x", + "@types/geojson": "7946.0.8", + "rbush": "^3.0.1" + } + }, + "node_modules/geojson-rbush/node_modules/@turf/helpers": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/helpers/-/helpers-6.5.0.tgz", + "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "license": "MIT", + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/geojson-rbush/node_modules/@turf/meta": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/@turf/meta/-/meta-6.5.0.tgz", + "integrity": "sha512-RrArvtsV0vdsCBegoBtOalgdSOfkBrTJ07VkpiCnq/491W67hnMWmDu7e6Ztw0C3WldRYTXkg3SumfdzZxLBHA==", + "license": "MIT", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/geojson-rbush/node_modules/@types/geojson": { + "version": "7946.0.8", + "resolved": "https://registry.npmmirror.com/@types/geojson/-/geojson-7946.0.8.tgz", + "integrity": "sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA==", + "license": "MIT" + }, "node_modules/get-intrinsic": { "version": "1.2.6", "resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.2.6.tgz", "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -8905,7 +10806,6 @@ "version": "1.2.0", "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -8961,7 +10861,6 @@ "version": "1.0.2", "resolved": "https://registry.npmmirror.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" @@ -8990,7 +10889,6 @@ "version": "1.1.0", "resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -9003,7 +10901,6 @@ "version": "1.0.2", "resolved": "https://registry.npmmirror.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" @@ -9019,7 +10916,6 @@ "version": "2.0.2", "resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -9177,6 +11073,22 @@ "node": ">= 0.4" } }, + "node_modules/is-arguments": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/is-arguments/-/is-arguments-1.2.0.tgz", + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmmirror.com/is-array-buffer/-/is-array-buffer-3.0.5.tgz", @@ -9315,7 +11227,6 @@ "version": "1.1.0", "resolved": "https://registry.npmmirror.com/is-date-object/-/is-date-object-1.1.0.tgz", "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -9447,7 +11358,6 @@ "version": "1.2.1", "resolved": "https://registry.npmmirror.com/is-regex/-/is-regex-1.2.1.tgz", "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -9911,7 +11821,6 @@ "version": "1.1.0", "resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -10431,7 +12340,6 @@ "version": "4.1.1", "resolved": "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -10460,11 +12368,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object-is": { + "version": "1.1.6", + "resolved": "https://registry.npmmirror.com/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmmirror.com/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -11385,7 +13308,6 @@ "version": "1.5.3", "resolved": "https://registry.npmmirror.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", - "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.7", @@ -11754,7 +13676,6 @@ "version": "1.2.2", "resolved": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", @@ -11772,7 +13693,6 @@ "version": "2.0.2", "resolved": "https://registry.npmmirror.com/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", @@ -12693,6 +14613,12 @@ "dev": true, "license": "0BSD" }, + "node_modules/turf-jsts": { + "version": "1.2.3", + "resolved": "https://registry.npmmirror.com/turf-jsts/-/turf-jsts-1.2.3.tgz", + "integrity": "sha512-Ja03QIJlPuHt4IQ2FfGex4F4JAr8m3jpaHbFbQrgwr7s7L6U8ocrHiF3J1+wf9jzhGKxvDeaCAnGDot8OjGFyA==", + "license": "(EDL-1.0 OR EPL-1.0)" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 65ef5f42a..85b7fc7a6 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,6 @@ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" }, "dependencies": { - "@cesium-extends/drawer": "^1.3.6", - "@cesium-extends/heat": "^1.0.3", - "@cesium-extends/measure": "^1.1.4", - "@cesium-extends/subscriber": "^1.1.0", - "@cesium-extends/tooltip": "^1.2.3", "@turf/turf": "^7.1.0", "@visactor/vtable": "^1.13.2", "@visactor/vtable-gantt": "^1.13.2", @@ -24,6 +19,8 @@ "@wenrenfangge/cesium-draw": "^1.0.4", "axios": "^1.2.1", "cesium": "^1.123.0", + "cesium-extends": "^1.8.23", + "cesium-sensors-es6": "^1.0.0", "chroma-js": "^3.1.2", "dayjs": "^1.11.13", "echarts": "^5.5.1", diff --git a/public/baseConfig.js b/public/baseConfig.js index e5d7e056e..8359a15c7 100644 --- a/public/baseConfig.js +++ b/public/baseConfig.js @@ -1,4 +1,58 @@ window['settings'] = { apis: '/taishiView', textConfigs: [], + + baseMBDict: { + base: { + icon: './images/icons/base/党政首脑机关.png', + color: '#ea7354', + }, + airport: { icon: './images/icons/base/军用机场.png', color: '#80b1d3' }, + port: { icon: './images/icons/base/军用港口.png', color: '#fcee82' }, + station: { icon: './images/icons/base/民用机场.png', color: '#8dd3c7' }, + }, + mbDict: { + 甲: { + icon: './images/icons/飞机.png', + color: '#d00', + model: './models/IDF.glb', + }, + 乙: { + icon: './images/icons/舰船.png', + color: '#dd0', + model: './models/驱逐舰2.glb', + }, + 丙: { + icon: './images/icons/舰船.png', + color: '#dd0', + model: './models/驱逐舰2.glb', + }, + }, + + map: { + 1: { + url: 'https://rt2.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=4&scene=0&version=347', + tilingScheme: 'WebMercatorTilingScheme', + image: './images/map/1.png', + name: '黑色', + }, + 2: { + url: 'https://rt2.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=5&scene=0&version=347', + tilingScheme: 'WebMercatorTilingScheme', + image: './images/map/2.png', + name: '白色', + }, + 3: { + url: './resources/map/{z}/{x}/{y}.jpg', + tilingScheme: 'WebMercatorTilingScheme', + image: './images/map/3.jpg', + name: 'Arcgis', + }, + 4: { + url: 'http://192.168.10.201:2022/api/maptilecache/service/tms/1.0.0/img_globle1to9-PNG-4326@EPSG:4326@png/{z}/{x}/{reverseY}.png', + tilingScheme: 'GeographicTilingScheme', + image: './images/map/4.png', + name: '卫星影像', + }, + }, } diff --git a/public/images/icons/base/airport.png b/public/images/icons/base/airport.png index 3a5db5b0b..e1bd2c392 100644 Binary files a/public/images/icons/base/airport.png and b/public/images/icons/base/airport.png differ diff --git a/public/images/icons/base/base.png b/public/images/icons/base/base.png index 1384a4f8a..49ccd4173 100644 Binary files a/public/images/icons/base/base.png and b/public/images/icons/base/base.png differ diff --git a/public/images/icons/base/port.png b/public/images/icons/base/port.png index a70985f76..8643d94de 100644 Binary files a/public/images/icons/base/port.png and b/public/images/icons/base/port.png differ diff --git a/public/images/icons/base/station.png b/public/images/icons/base/station.png index e16744118..b931bf562 100644 Binary files a/public/images/icons/base/station.png and b/public/images/icons/base/station.png differ diff --git a/public/images/icons/base/weather.png b/public/images/icons/base/weather.png index adc69835f..8c19ecbb6 100644 Binary files a/public/images/icons/base/weather.png and b/public/images/icons/base/weather.png differ diff --git a/public/images/icons/base/党政首脑机关.png b/public/images/icons/base/党政首脑机关.png new file mode 100644 index 000000000..1c7564b10 Binary files /dev/null and b/public/images/icons/base/党政首脑机关.png differ diff --git a/public/images/icons/base/其他.png b/public/images/icons/base/其他.png new file mode 100644 index 000000000..7b82d780c Binary files /dev/null and b/public/images/icons/base/其他.png differ diff --git a/public/images/icons/base/军用机场.png b/public/images/icons/base/军用机场.png new file mode 100644 index 000000000..301d4ac35 Binary files /dev/null and b/public/images/icons/base/军用机场.png differ diff --git a/public/images/icons/base/军用港口.png b/public/images/icons/base/军用港口.png new file mode 100644 index 000000000..c01b4e134 Binary files /dev/null and b/public/images/icons/base/军用港口.png differ diff --git a/public/images/icons/base/民用机场.png b/public/images/icons/base/民用机场.png new file mode 100644 index 000000000..f63891724 Binary files /dev/null and b/public/images/icons/base/民用机场.png differ diff --git a/public/images/icons/base/民用港口.png b/public/images/icons/base/民用港口.png new file mode 100644 index 000000000..84606dec2 Binary files /dev/null and b/public/images/icons/base/民用港口.png differ diff --git a/public/images/icons/base2/airport.png b/public/images/icons/base2/airport.png new file mode 100644 index 000000000..3a5db5b0b Binary files /dev/null and b/public/images/icons/base2/airport.png differ diff --git a/public/images/icons/base/airport1.png b/public/images/icons/base2/airport1.png similarity index 100% rename from public/images/icons/base/airport1.png rename to public/images/icons/base2/airport1.png diff --git a/public/images/icons/base2/base.png b/public/images/icons/base2/base.png new file mode 100644 index 000000000..1384a4f8a Binary files /dev/null and b/public/images/icons/base2/base.png differ diff --git a/public/images/icons/base/base1.png b/public/images/icons/base2/base1.png similarity index 100% rename from public/images/icons/base/base1.png rename to public/images/icons/base2/base1.png diff --git a/public/images/icons/base/pin (1).png b/public/images/icons/base2/pin (1).png similarity index 100% rename from public/images/icons/base/pin (1).png rename to public/images/icons/base2/pin (1).png diff --git a/public/images/icons/base/pin (2).png b/public/images/icons/base2/pin (2).png similarity index 100% rename from public/images/icons/base/pin (2).png rename to public/images/icons/base2/pin (2).png diff --git a/public/images/icons/base/pin (3).png b/public/images/icons/base2/pin (3).png similarity index 100% rename from public/images/icons/base/pin (3).png rename to public/images/icons/base2/pin (3).png diff --git a/public/images/icons/base/pin.png b/public/images/icons/base2/pin.png similarity index 100% rename from public/images/icons/base/pin.png rename to public/images/icons/base2/pin.png diff --git a/public/images/icons/base2/port.png b/public/images/icons/base2/port.png new file mode 100644 index 000000000..a70985f76 Binary files /dev/null and b/public/images/icons/base2/port.png differ diff --git a/public/images/icons/base/port1.png b/public/images/icons/base2/port1.png similarity index 100% rename from public/images/icons/base/port1.png rename to public/images/icons/base2/port1.png diff --git a/public/images/icons/base2/station.png b/public/images/icons/base2/station.png new file mode 100644 index 000000000..e16744118 Binary files /dev/null and b/public/images/icons/base2/station.png differ diff --git a/public/images/icons/base/station1.png b/public/images/icons/base2/station1.png similarity index 100% rename from public/images/icons/base/station1.png rename to public/images/icons/base2/station1.png diff --git a/public/images/icons/base2/weather.png b/public/images/icons/base2/weather.png new file mode 100644 index 000000000..adc69835f Binary files /dev/null and b/public/images/icons/base2/weather.png differ diff --git a/public/images/icons/舰船.png b/public/images/icons/舰船.png new file mode 100644 index 000000000..2a9bfa284 Binary files /dev/null and b/public/images/icons/舰船.png differ diff --git a/public/images/icons/飞机.png b/public/images/icons/飞机.png new file mode 100644 index 000000000..e2b4c03c9 Binary files /dev/null and b/public/images/icons/飞机.png differ diff --git a/public/images/line.png b/public/images/line.png index 399d94430..b32368ece 100644 Binary files a/public/images/line.png and b/public/images/line.png differ diff --git a/public/images/line3.png b/public/images/line3.png new file mode 100644 index 000000000..399d94430 Binary files /dev/null and b/public/images/line3.png differ diff --git a/public/images/line5.png b/public/images/line5.png new file mode 100644 index 000000000..df87376d9 Binary files /dev/null and b/public/images/line5.png differ diff --git a/public/images/line6.png b/public/images/line6.png new file mode 100644 index 000000000..7f73686ac Binary files /dev/null and b/public/images/line6.png differ diff --git a/public/images/map/1.png b/public/images/map/1.png new file mode 100644 index 000000000..7c3a79a28 Binary files /dev/null and b/public/images/map/1.png differ diff --git a/public/images/map/2.png b/public/images/map/2.png new file mode 100644 index 000000000..e2df80821 Binary files /dev/null and b/public/images/map/2.png differ diff --git a/public/images/map/3.jpg b/public/images/map/3.jpg new file mode 100644 index 000000000..0e8fae60d Binary files /dev/null and b/public/images/map/3.jpg differ diff --git a/public/images/map/4.png b/public/images/map/4.png new file mode 100644 index 000000000..b8a416a31 Binary files /dev/null and b/public/images/map/4.png differ diff --git a/public/images/skybox/skyCube2k_mx.jpg b/public/images/skybox/skyCube2k_mx.jpg new file mode 100644 index 000000000..3e5abc522 Binary files /dev/null and b/public/images/skybox/skyCube2k_mx.jpg differ diff --git a/public/images/skybox/skyCube2k_my.jpg b/public/images/skybox/skyCube2k_my.jpg new file mode 100644 index 000000000..57ac6d16f Binary files /dev/null and b/public/images/skybox/skyCube2k_my.jpg differ diff --git a/public/images/skybox/skyCube2k_mz.jpg b/public/images/skybox/skyCube2k_mz.jpg new file mode 100644 index 000000000..6fdbc646f Binary files /dev/null and b/public/images/skybox/skyCube2k_mz.jpg differ diff --git a/public/images/skybox/skyCube2k_px.jpg b/public/images/skybox/skyCube2k_px.jpg new file mode 100644 index 000000000..6c33c7d7c Binary files /dev/null and b/public/images/skybox/skyCube2k_px.jpg differ diff --git a/public/images/skybox/skyCube2k_py.jpg b/public/images/skybox/skyCube2k_py.jpg new file mode 100644 index 000000000..dbd0ff001 Binary files /dev/null and b/public/images/skybox/skyCube2k_py.jpg differ diff --git a/public/images/skybox/skyCube2k_pz.jpg b/public/images/skybox/skyCube2k_pz.jpg new file mode 100644 index 000000000..a9346df4e Binary files /dev/null and b/public/images/skybox/skyCube2k_pz.jpg differ diff --git a/public/js/Cesium2/Cesium.js b/public/js/Cesium2/Cesium.js index af7461bd2..4ec8741c7 100644 --- a/public/js/Cesium2/Cesium.js +++ b/public/js/Cesium2/Cesium.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var Cesium=(()=>{var WCe=Object.create;var MM=Object.defineProperty;var PCe=Object.getOwnPropertyDescriptor;var vCe=Object.getOwnPropertyNames;var wCe=Object.getPrototypeOf,FCe=Object.prototype.hasOwnProperty;var NM=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var od=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ACe=(e,t)=>{for(var n in t)MM(e,n,{get:t[n],enumerable:!0})},nq=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vCe(t))!FCe.call(e,o)&&o!==n&&MM(e,o,{get:()=>t[o],enumerable:!(i=PCe(t,o))||i.enumerable});return e};var T=(e,t,n)=>(n=e!=null?WCe(wCe(e)):{},nq(t||!e||!e.__esModule?MM(n,"default",{value:e,enumerable:!0}):n,e)),MCe=e=>nq(MM({},"__esModule",{value:!0}),e);var S=od(()=>{globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIFdTPU9iamVjdC5jcmVhdGU7dmFyIEZsPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgWFM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjt2YXIgWVM9T2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7dmFyICRTPU9iamVjdC5nZXRQcm90b3R5cGVPZixaUz1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O3ZhciBwcj0od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LG5bMl09dFsyXS1lWzJdLG5bM109dFszXS1lWzNdLG5bNF09dFs0XS1lWzRdLG5bNV09dFs1XS1lWzVdLG5bNl09dFs2XS1lWzZdLG5bN109dFs3XS1lWzddLG5bOF09dFs4XS1lWzhdLG59O1R0Lm11bHRpcGx5QnlWZWN0b3I9ZnVuY3Rpb24odCxlLG4pe3kudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5vYmplY3QoImNhcnRlc2lhbiIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pO2xldCBvPWUueCxyPWUueSxpPWUueixzPXRbMF0qbyt0WzNdKnIrdFs2XSppLGY9dFsxXSpvK3RbNF0qcit0WzddKmksdT10WzJdKm8rdFs1XSpyK3RbOF0qaTtyZXR1cm4gbi54PXMsbi55PWYsbi56PXUsbn07VHQubXVsdGlwbHlCeVNjYWxhcj1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5udW1iZXIoInNjYWxhciIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pLG5bMF09dFswXSplLG5bMV09dFsxXSplLG5bMl09dFsyXSplLG5bM109dFszXSplLG5bNF09dFs0XSplLG5bNV09dFs1XSplLG5bNl09dFs2XSplLG5bN109dFs3XSplLG5bOF09dFs4XSplLG59O1R0Lm11bHRpcGx5QnlTY2FsZT1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5vYmplY3QoInNjYWxlIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksblswXT10WzBdKmUueCxuWzFdPXRbMV0qZS54LG5bMl09dFsyXSplLngsblszXT10WzNdKmUueSxuWzRdPXRbNF0qZS55LG5bNV09dFs1XSplLnksbls2XT10WzZdKmUueixuWzddPXRbN10qZS56LG5bOF09dFs4XSplLnosbn07VHQubXVsd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0x0Lm1pbmltdW1CeUNvbXBvbmVudD1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgiZmlyc3QiLHQpLHkudHlwZU9mLm9iamVjdCgic2Vjb25kIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PU1hdGgubWluKHQueCxlLngpLG4ueT1NYXRoLm1pbih0LnksZS55KSxuLno9TWF0aC5taW4odC56LGUueiksbi53PU1hdGgubWluKHQudyxlLncpLG59O0x0Lm1heGltdW1CeUNvbXBvbmVudD1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgiZmlyc3QiLHQpLHkudHlwZU9mLm9iamVjdCgic2Vjb25kIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PU1hdGgubWF4KHQueCxlLngpLG4ueT1NYXRoLm1heCh0LnksZS55KSxuLno9TWF0aC5tYXgodC56LGUueiksbi53PU1hdGgubWF4KHQudyxlLncpLG59O0x0LmNsYW1wPWZ1bmN0aW9uKHQsZSxuLG8pe3kudHlwZU9mLm9iamVjdCgidmFsdWUiLHQpLHkudHlwZU9mLm9iamVjdCgibWluIixlKSx5LnR5cGVPZi5vYmplY3QoIm1heCIsbikseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG8pO2xldCByPU0uY2xhbXAodC54LGUueCxuLngpLGk9TS5jbGFtcCh0LnksZS55LG4ueSkscz1NLmNsYW1wKHQueixlLnosbi56KSxmPU0uY2xhbXAodC53LGUudyxuLncpO3JldHVybiBvLng9cixvLnk9aSxvLno9cyxvLnc9ZixvfTtMdC5tYWduaXR1ZGVTcXVhcmVkPWZ1bmN0aW9uKHQpe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImNhcnRlc2lhbiIsdCksdC54KnQueCt0LnkqdC55K3Queip0LnordC53KnQud307THQubWFnbml0dWRlPWZ1bmN0aW9uKHQpe3JldHVybiBNYXRoLnNxcnQoTHQubWFnbml0dW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xMLnksTC56KSxULnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChyW2IqM10scltiKjMrMV0scltiKjMrMl0pLFQucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKHJbYiozKzNdLHJbYiozKzRdLHJbYiozKzVdKSxULnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChPLngsTy55LE8ueixPLngsTy55LE8ueiksVC5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLFQubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxULm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksVC5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLGEubmVnYXRlKHYsdiksYS5hZGQoRCx2LEwpLE4ucG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLE4ucG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLE4ucG9zaXRpb24udmFsdWVzLnB1c2goRS54LEUueSxFLnosRS54LEUueSxFLnopLE4ucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxOLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksTi5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLE4ucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxOLm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChFLngsRS55LEUueixFLngsRS55LEUueiksTi5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goaVt3KjNdLGlbdyozKzFdLGlbdyozKzJdKSxOLm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChpW3cqMyszXSxpW3cqMys0XSxpW3cqMys1XSk7bGV0IFU9dHQuZnJvbUFycmF5KHMsYioyLFhiKSxBPU1hdGguYWJzKFUueSk7VC5leHBhbmRBbmRXaWR0aC52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gQXJyYXkoMTIqKHQqKHQrMSkpLTYpLG49MCxvLHIsaSxzLGY7Zm9yKG89MCxpPTEscz0wO3M8MztzKyspZVtuKytdPWkrKyxlW24rK109byxlW24rK109aTtmb3Iocz0yO3M8dCsxOysrcyl7Zm9yKGk9cyoocysxKS0xLG89KHMtMSkqcy0xLGVbbisrXT1pKyssZVtuKytdPW8sZVtuKytdPWkscj0yKnMsZj0wO2Y8ci0xOysrZillW24rK109aSxlW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pKyssZVtuKytdPW8sZVtuKytdPWk7ZVtuKytdPWkrKyxlW24rK109byxlW24rK109aX1mb3Iocj10KjIsKytpLCsrbyxzPTA7czxyLTE7KytzKWVbbisrXT1pLGVbbisrXT1vKyssZVtuKytdPW8sZVtuKytdPWkrKyxlW24rK109byxlW24rK109aTtmb3IoZVtuKytdPWksZVtuKytdPW8rKyxlW24rK109byxlW24rK109aSsrLGVbbisrXT1vKyssZVtuKytdPW8sKytvLHM9dC0xO3M+MTstLXMpe2ZvcihlW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pLHI9MipzLGY9MDtmPHItMTsrK2YpZVtuKytdPWksZVtuKytdPW8rKyxlW24rK109byxlW24rK109aSsrLGVbbisrXT1vLGVbbisrXT1pO2VbbisrXT1vKyssZVtuKytdPW8rKyxlW24rK109aSsrfWZvcihzPTA7czwzO3MrKyllW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pO3JldHVybiBlfWZ1bmN0aW9uIGtNKHQpe2xldCBlPXQuY2VudGVyO2NjPWEubXVsdGlwbHlCeVNjYWxhcih0LmVsbGlwc29pZC5nZW9kZXRpY1N1cmZhY2VOb3JtYWwoZSxjYyksdC5oZWlnaHQsY2MpLGNjPWEuYWRkKGUsY2MsY2MpO2xldCBuPW5ldyBBdChjYyx0LnNlbWlNYWpvckF4aXMpLG89a3IuY29tcHV0ZUVsbGlwc2VQb3NpdGlvbnModCwhMCwhMSkscj1vLnBvc2l0aW9ucyxpPW8ubnVt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ngscFtEKytdPUEueSxwW0QrK109QS56KSxyLnRhbmdlbnQmJihkW3YrK109UC54LGRbdisrXT1QLnksZFt2KytdPVAueixkW3YrK109UC54LGRbdisrXT1QLnksZFt2KytdPVAueiksci5iaXRhbmdlbnQmJihCPWEubm9ybWFsaXplKGEuY3Jvc3MoQSxQLEIpLEIpLG1bTCsrXT1CLngsbVtMKytdPUIueSxtW0wrK109Qi56LG1bTCsrXT1CLngsbVtMKytdPUIueSxtW0wrK109Qi56KSl9Zm9yKF89MDtfPGk7XysrKXIubm9ybWFsJiYocFtEKytdPTAscFtEKytdPTAscFtEKytdPS0xKSxyLnRhbmdlbnQmJihkW3YrK109MSxkW3YrK109MCxkW3YrK109MCksci5iaXRhbmdlbnQmJihtW0wrK109MCxtW0wrK109LTEsbVtMKytdPTApO2ZvcihfPTA7XzxpO18rKylyLm5vcm1hbCYmKHBbRCsrXT0wLHBbRCsrXT0wLHBbRCsrXT0xKSxyLnRhbmdlbnQmJihkW3YrK109MSxkW3YrK109MCxkW3YrK109MCksci5iaXRhbmdlbnQmJihtW0wrK109MCxtW0wrK109MSxtW0wrK109MCl9bGV0IGI9MTIqaS0xMix3PUR0LmNyZWF0ZVR5cGVkQXJyYXkodSxiKSxPPTAsRT0wO2ZvcihfPTA7XzxpLTE7XysrKXdbTysrXT1FLHdbTysrXT1FKzIsd1tPKytdPUUrMyx3W08rK109RSx3W08rK109RSszLHdbTysrXT1FKzEsRSs9Mjtmb3Iod1tPKytdPXMtMix3W08rK109MCx3W08rK109MSx3W08rK109cy0yLHdbTysrXT0xLHdbTysrXT1zLTEsXz0xO188aS0xO18rKyl3W08rK109cytfKzEsd1tPKytdPXMrXyx3W08rK109cztmb3IoXz0xO188aS0xO18rKyl3W08rK109Zix3W08rK109ZitfLHdbTysrXT1mK18rMTtsZXQgVD0wO2lmKHIuc3Qpe2xldCBJPU1hdGgubWF4KG4sbyk7Zm9yKF89MDtfPHU7XysrKXtsZXQgRD1hLmZyb21BcnJheShjLF8qM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lbigoKT0+WWcoKSl9LElWPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+ZTEoKSl9LHZWPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+bjEoKSl9LExWPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+cjEoKSl9O3JldHVybiBRUyhEVik7fSkoKTsK")});var kM=od((lVt,oq)=>{var dVt=T(S()),pp=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};pp.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};pp.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};pp.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^t[e&1];for(;n>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};pp.prototype.random_int31=function(){return this.random_int()>>>1};pp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};pp.prototype.random=function(){return this.random_int()*(1/4294967296)};pp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};pp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};oq.exports=pp});var Eq=od((PS,vS)=>{var JRt=T(S());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof PS=="object"&&PS&&!PS.nodeType&&PS,n=typeof vS=="object"&&vS&&!vS.nodeType&&vS,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,d=38,u=700,h=72,p=128,g="-",f=/^xn--/,x=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=s-a,L=Math.floor,Z=String.fromCharCode,G;function I(U){throw new RangeError(C[U])}function v(U,Y){for(var k=U.length,H=[];k--;)H[k]=Y(U[k]);return H}function P(U,Y){var k=U.split("@"),H="";k.length>1&&(H=k[0]+"@",U=k[1]),U=U.replace(_,".");var J=U.split("."),te=v(J,Y).join(".");return H+te}function w(U){for(var Y=[],k=0,H=U.length,J,te;k=55296&&J<=56319&&k65535&&(Y-=65536,k+=Z(Y>>>10&1023|55296),Y=56320|Y&1023),k+=Z(Y),k}).join("")}function b(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:s}function R(U,Y){return U+22+75*(U<26)-((Y!=0)<<5)}function E(U,Y,k){var H=0;for(U=k?L(U/u):U>>1,U+=L(U/Y);U>V*c>>1;H+=s)U=L(U/V);return L(H+(V+1)*U/(U+d))}function X(U){var Y=[],k=U.length,H,J=0,te=p,z=h,j,ee,fe,_e,de,ye,Te,Ie,Le;for(j=U.lastIndexOf(g),j<0&&(j=0),ee=0;ee=128&&I("not-basic"),Y.push(U.charCodeAt(ee));for(fe=j>0?j+1:0;fe=k&&I("invalid-input"),Te=b(U.charCodeAt(fe++)),(Te>=s||Te>L((r-J)/de))&&I("overflow"),J+=Te*de,Ie=ye<=z?a:ye>=z+c?c:ye-z,!(TeL(r/Le)&&I("overflow"),de*=Le;H=Y.length+1,z=E(J-_e,H,_e==0),L(J/H)>r-te&&I("overflow"),te+=L(J/H),J%=H,Y.splice(J++,0,te)}return F(Y)}function A(U){var Y,k,H,J,te,z,j,ee,fe,_e,de,ye=[],Te,Ie,Le,ke;for(U=w(U),Te=U.length,Y=p,k=0,te=h,z=0;z=Y&&deL((r-k)/Ie)&&I("overflow"),k+=(j-Y)*Ie,Y=j,z=0;zr&&I("overflow"),de==Y){for(ee=k,fe=s;_e=fe<=te?a:fe>=te+c?c:fe-te,!(ee<_e);fe+=s)ke=ee-_e,Le=s-_e,ye.push(Z(R(_e+ke%Le,0))),ee=L(ke/Le);ye.push(Z(R(ee,0))),te=E(k,Ie,H==J),k=0,++H}++k,++Y}return ye.join("")}function N(U){return P(U,function(Y){return f.test(Y)?X(Y.slice(4).toLowerCase()):Y})}function O(U){return P(U,function(Y){return x.test(Y)?"xn--"+A(Y):Y})}if(o={version:"1.3.2",ucs2:{decode:w,encode:F},decode:X,encode:A,toASCII:O,toUnicode:N},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(vS.exports==t)n.exports=o;else for(G in o)o.hasOwnProperty(G)&&(t[G]=o[G]);else e.punycode=o})(PS)});var Xq=od((Iq,sN)=>{var QRt=T(S());/*! +var Cesium=(()=>{var vCe=Object.create;var k9=Object.defineProperty;var wCe=Object.getOwnPropertyDescriptor;var FCe=Object.getOwnPropertyNames;var ACe=Object.getPrototypeOf,MCe=Object.prototype.hasOwnProperty;var U9=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var rd=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),NCe=(e,t)=>{for(var n in t)k9(e,n,{get:t[n],enumerable:!0})},nq=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of FCe(t))!MCe.call(e,o)&&o!==n&&k9(e,o,{get:()=>t[o],enumerable:!(i=wCe(t,o))||i.enumerable});return e};var T=(e,t,n)=>(n=e!=null?vCe(ACe(e)):{},nq(t||!e||!e.__esModule?k9(n,"default",{value:e,enumerable:!0}):n,e)),kCe=e=>nq(k9({},"__esModule",{value:!0}),e);var S=rd(()=>{globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIFhTPU9iamVjdC5jcmVhdGU7dmFyIEJsPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgWVM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjt2YXIgJFM9T2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7dmFyIFpTPU9iamVjdC5nZXRQcm90b3R5cGVPZixRUz1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O3ZhciBwcj0odD0+dHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6dHlwZW9mIFByb3h5PCJ1Ij9uZXcgUHJveHkodCx7Z2V0OihlLG4pPT4odHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6ZSlbbl19KTp0KShmdW5jdGlvbih0KXtpZih0eXBlb2YgcmVxdWlyZTwidSIpcmV0dXJuIHJlcXVpcmUuYXBwbHkodGhpcyxhcmd1bWVudHMpO3Rocm93IEVycm9yKCdEeW5hbWljIHJlcXVpcmUgb2YgIicrdCsnIiBpcyBub3Qgc3VwcG9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vPWUueCxyPWUueSxpPWUueixzPXRbMF0qbyt0WzNdKnIrdFs2XSppLGY9dFsxXSpvK3RbNF0qcit0WzddKmksdT10WzJdKm8rdFs1XSpyK3RbOF0qaTtyZXR1cm4gbi54PXMsbi55PWYsbi56PXUsbn07d3QubXVsdGlwbHlCeVNjYWxhcj1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5udW1iZXIoInNjYWxhciIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pLG5bMF09dFswXSplLG5bMV09dFsxXSplLG5bMl09dFsyXSplLG5bM109dFszXSplLG5bNF09dFs0XSplLG5bNV09dFs1XSplLG5bNl09dFs2XSplLG5bN109dFs3XSplLG5bOF09dFs4XSplLG59O3d0Lm11bHRpcGx5QnlTY2FsZT1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5vYmplY3QoInNjYWxlIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksblswXT10WzBdKmUueCxuWzFdPXRbMV0qZS54LG5bMl09dFsyXSplLngsblszXT10WzNdKmUueSxuWzRdPXRbNF0qZS55LG5bNV09dFs1XSplLnksbls2XT10WzZdKmUueixuWzddPXRbN10qZS56LG5bOF09dFs4XSplLnosbn07d3QubXVsdGlwbHlCeVVuaWZvcm1TY2FsZT1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5udW1iZXIoInNjYWxlIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksblswXT10WzBdKmUsblsxXT10WzFdKmUsblsyXT10WzJdKmUsblszXT10WzNdKmUsbls0XT10WzRdKmUsbls1XT10WzVdKmUsbls2XT10WzZdKmUsbls3XT10WzddKmUsbls4XT10WzhdKmUsbn07d3QubmVnYXRlPW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ZFt2KytdPTEsZFt2KytdPTAsZFt2KytdPTApLHIuYml0YW5nZW50JiYobVtMKytdPTAsbVtMKytdPS0xLG1bTCsrXT0wKTtmb3IoXz0wO188aTtfKyspci5ub3JtYWwmJihwW0QrK109MCxwW0QrK109MCxwW0QrK109MSksci50YW5nZW50JiYoZFt2KytdPTEsZFt2KytdPTAsZFt2KytdPTApLHIuYml0YW5nZW50JiYobVtMKytdPTAsbVtMKytdPTEsbVtMKytdPTApfWxldCBiPTEyKmktMTIsVD1EdC5jcmVhdGVUeXBlZEFycmF5KHUsYiksTz0wLEU9MDtmb3IoXz0wO188aS0xO18rKylUW08rK109RSxUW08rK109RSsyLFRbTysrXT1FKzMsVFtPKytdPUUsVFtPKytdPUUrMyxUW08rK109RSsxLEUrPTI7Zm9yKFRbTysrXT1zLTIsVFtPKytdPTAsVFtPKytdPTEsVFtPKytdPXMtMixUW08rK109MSxUW08rK109cy0xLF89MTtfPGktMTtfKyspVFtPKytdPXMrXysxLFRbTysrXT1zK18sVFtPKytdPXM7Zm9yKF89MTtfPGktMTtfKyspVFtPKytdPWYsVFtPKytdPWYrXyxUW08rK109ZitfKzE7bGV0IHc9MDtpZihyLnN0KXtsZXQgST1NYXRoLm1heChuLG8pO2ZvcihfPTA7Xzx1O18rKyl7bGV0IEQ9YS5mcm9tQXJyYXkoYyxfKjMsbEwpO2xbdysrXT0oRC54K0kpLygyKkkpLGxbdysrXT0oRC55K0kpLygyKkkpfX1sZXQgQz1uZXcgaWU7ci5wb3NpdGlvbiYmKEMucG9zaXRpb249bmV3IGl0KHtjb21wb25lbnREYXRhdHlwZTpudC5ET1VCTEUsY29tcG9uZW50c1BlckF0dHJpYnV0ZTozLHZhbHVlczpjfSkpLHIubm9ybWFsJiYoQy5ub3JtYWw9bmV3IGl0KHtjb21wb25lbnREYXRhdHlwZTpudC5GTE9BVCxjb21wb25lbnRzUGVyQXR0cmlidXRlOjMsdmFsdWVzOnB9KSksci50YW5nZW50JiYoQy50YW5nZW50PW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oVSsxPHAmJihSPWEuZnJvbUFycmF5KGMsayszLGYyKSksTCl7bGV0IGF0PWEuc3VidHJhY3QoUixLLFNVKSxwdD1hLnN1YnRyYWN0KG90LEssaGcpO0k9YS5ub3JtYWxpemUoYS5jcm9zcyhwdCxhdCxJKSxJKSxMPSExfWEuZXF1YWxzRXBzaWxvbihLLFIsTS5FUFNJTE9OMTApP0w9ITA6KEErPVMsci50YW5nZW50JiYoRD1hLm5vcm1hbGl6ZShhLnN1YnRyYWN0KFIsSyxEKSxEKSksci5iaXRhbmdlbnQmJih2PWEubm9ybWFsaXplKGEuY3Jvc3MoSSxELHYpLHYpKSksci5ub3JtYWwmJihfW0UrK109SS54LF9bRSsrXT1JLnksX1tFKytdPUkueixfW0UrK109SS54LF9bRSsrXT1JLnksX1tFKytdPUkueiksci50YW5nZW50JiYoZ1tDKytdPUQueCxnW0MrK109RC55LGdbQysrXT1ELnosZ1tDKytdPUQueCxnW0MrK109RC55LGdbQysrXT1ELnopLHIuYml0YW5nZW50JiYoYlt3KytdPXYueCxiW3crK109di55LGJbdysrXT12LnosYlt3KytdPXYueCxiW3crK109di55LGJbdysrXT12LnopfX1sZXQgUD1uZXcgaWU7ci5wb3NpdGlvbiYmKFAucG9zaXRpb249bmV3IGl0KHtjb21wb25lbnREYXRhdHlwZTpudC5ET1VCTEUsY29tcG9uZW50c1BlckF0dHJpYnV0ZTozLHZhbHVlczptfSkpLHIubm9ybWFsJiYoUC5ub3JtYWw9bmV3IGl0KHtjb21wb25lbnREYXRhdHlwZTpudC5GTE9BVCxjb21wb25lbnRzUGVyQXR0cmlidXRlOjMsdmFsdWVzOl99KSksci50YW5nZW50JiYoUC50YW5nZW50PW5ldyBpdCh7Y29tcG9uZW50RGF0YXR5cGU6bnQuRkxPQVQsY29tcG9uZW50c1BlckF0dHJpYnV0ZTozLHZhbHVlczpnfSkpLHIuYml0YW5nZW50JiYoUC5iaXRhbmdlbnQ9bmV3IGl0KHtjb21wb25lbnREYXRhdHlwZTp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b2x2ZSgpLnRoZW4oKCk9PmRnKCkpfSx4Vj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmdnKCkpfSxQVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PlRnKCkpfSxNVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PkNnKCkpfSxOVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PkhnKCkpfSxJVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PllnKCkpfSx2Vj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmUxKCkpfSxMVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9Pm4xKCkpfSxEVj0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnIxKCkpfTtyZXR1cm4gSlMoRlYpO30pKCk7Cg==")});var D9=rd((hVt,oq)=>{var fVt=T(S()),bp=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};bp.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};bp.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};bp.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^t[e&1];for(;n>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};bp.prototype.random_int31=function(){return this.random_int()>>>1};bp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};bp.prototype.random=function(){return this.random_int()*(1/4294967296)};bp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};bp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};oq.exports=bp});var Eq=rd((wS,FS)=>{var $Rt=T(S());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof wS=="object"&&wS&&!wS.nodeType&&wS,n=typeof FS=="object"&&FS&&!FS.nodeType&&FS,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,d=38,u=700,h=72,p=128,g="-",f=/^xn--/,x=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=s-a,L=Math.floor,Z=String.fromCharCode,G;function I(U){throw new RangeError(C[U])}function v(U,Y){for(var k=U.length,H=[];k--;)H[k]=Y(U[k]);return H}function P(U,Y){var k=U.split("@"),H="";k.length>1&&(H=k[0]+"@",U=k[1]),U=U.replace(_,".");var J=U.split("."),te=v(J,Y).join(".");return H+te}function w(U){for(var Y=[],k=0,H=U.length,J,te;k=55296&&J<=56319&&k65535&&(Y-=65536,k+=Z(Y>>>10&1023|55296),Y=56320|Y&1023),k+=Z(Y),k}).join("")}function b(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:s}function R(U,Y){return U+22+75*(U<26)-((Y!=0)<<5)}function E(U,Y,k){var H=0;for(U=k?L(U/u):U>>1,U+=L(U/Y);U>V*c>>1;H+=s)U=L(U/V);return L(H+(V+1)*U/(U+d))}function X(U){var Y=[],k=U.length,H,J=0,te=p,z=h,j,ee,fe,Te,de,xe,Se,Ie,Le;for(j=U.lastIndexOf(g),j<0&&(j=0),ee=0;ee=128&&I("not-basic"),Y.push(U.charCodeAt(ee));for(fe=j>0?j+1:0;fe=k&&I("invalid-input"),Se=b(U.charCodeAt(fe++)),(Se>=s||Se>L((r-J)/de))&&I("overflow"),J+=Se*de,Ie=xe<=z?a:xe>=z+c?c:xe-z,!(SeL(r/Le)&&I("overflow"),de*=Le;H=Y.length+1,z=E(J-Te,H,Te==0),L(J/H)>r-te&&I("overflow"),te+=L(J/H),J%=H,Y.splice(J++,0,te)}return F(Y)}function A(U){var Y,k,H,J,te,z,j,ee,fe,Te,de,xe=[],Se,Ie,Le,ke;for(U=w(U),Se=U.length,Y=p,k=0,te=h,z=0;z=Y&&deL((r-k)/Ie)&&I("overflow"),k+=(j-Y)*Ie,Y=j,z=0;zr&&I("overflow"),de==Y){for(ee=k,fe=s;Te=fe<=te?a:fe>=te+c?c:fe-te,!(ee{var eZt=T(S());/*! * URI.js - Mutating URLs * IPv6 Support * @@ -35,7 +35,7 @@ var Cesium=(()=>{var WCe=Object.create;var MM=Object.defineProperty;var PCe=Obje * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof sN=="object"&&sN.exports?sN.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Iq,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var d;for(d=0;d1);p++)u.splice(0,1);s[h]=u.join("")}var g=-1,f=0,x=0,_=-1,C=!1;for(h=0;hf&&(g=_,f=x)):s[h]==="0"&&(C=!0,_=h,x=1);x>f&&(g=_,f=x),f>1&&s.splice(g,f,""),a=s.length;var V="";for(s[0]===""&&(V=":"),h=0;h{var jRt=T(S());/*! + */(function(e,t){"use strict";typeof cN=="object"&&cN.exports?cN.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Iq,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var d;for(d=0;d1);p++)u.splice(0,1);s[h]=u.join("")}var g=-1,f=0,x=0,_=-1,C=!1;for(h=0;hf&&(g=_,f=x)):s[h]==="0"&&(C=!0,_=h,x=1);x>f&&(g=_,f=x),f>1&&s.splice(g,f,""),a=s.length;var V="";for(s[0]===""&&(V=":"),h=0;h{var tZt=T(S());/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * @@ -47,7 +47,7 @@ var Cesium=(()=>{var WCe=Object.create;var MM=Object.defineProperty;var PCe=Obje * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof aN=="object"&&aN.exports?aN.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Wq,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var rd=od((vq,cN)=>{var qRt=T(S());/*! + */(function(e,t){"use strict";typeof lN=="object"&&lN.exports?lN.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Wq,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var sd=rd((vq,dN)=>{var nZt=T(S());/*! * URI.js - Mutating URLs * * Version: 1.19.11 @@ -58,26 +58,26 @@ var Cesium=(()=>{var WCe=Object.create;var MM=Object.defineProperty;var PCe=Obje * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof cN=="object"&&cN.exports?cN.exports=t(Eq(),Xq(),Pq()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(vq,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(R,E){var X=arguments.length>=1,A=arguments.length>=2;if(!(this instanceof r))return X?A?new r(R,E):new r(R):new r;if(R===void 0){if(X)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?R=location.href+"":R=""}if(R===null&&X)throw new TypeError("null is not a valid argument for URI");return this.href(R),E!==void 0?this.absoluteTo(E):this}function s(R){return/^[0-9]+$/.test(R)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function d(R){return R.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(R){return R===void 0?"Undefined":String(Object.prototype.toString.call(R)).slice(8,-1)}function h(R){return u(R)==="Array"}function p(R,E){var X={},A,N;if(u(E)==="RegExp")X=null;else if(h(E))for(A=0,N=E.length;A]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(R){if(!(!R||!R.nodeName)){var E=R.nodeName.toLowerCase();if(!(E==="input"&&R.type!=="image"))return r.domAttributes[E]}};function _(R){return escape(R)}function C(R){return encodeURIComponent(R).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(R,E){var X=r.encode(R+"");return E===void 0&&(E=r.escapeQuerySpace),E?X.replace(/%20/g,"+"):X},r.decodeQuery=function(R,E){R+="",E===void 0&&(E=r.escapeQuerySpace);try{return r.decode(E?R.replace(/\+/g,"%20"):R)}catch{return R}};var V={encode:"encode",decode:"decode"},L,Z=function(R,E){return function(X){try{return r[E](X+"").replace(r.characters[R][E].expression,function(A){return r.characters[R][E].map[A]})}catch{return X}}};for(L in V)r[L+"PathSegment"]=Z("pathname",V[L]),r[L+"UrnPathSegment"]=Z("urnpath",V[L]);var G=function(R,E,X){return function(A){var N;X?N=function(k){return r[E](r[X](k))}:N=r[E];for(var O=(A+"").split(R),U=0,Y=O.length;U-1&&(E.fragment=R.substring(X+1)||null,R=R.substring(0,X)),X=R.indexOf("?"),X>-1&&(E.query=R.substring(X+1)||null,R=R.substring(0,X)),R=R.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),R=R.replace(/^[/\\]{2,}/i,"//"),R.substring(0,2)==="//"?(E.protocol=null,R=R.substring(2),R=r.parseAuthority(R,E)):(X=R.indexOf(":"),X>-1&&(E.protocol=R.substring(0,X)||null,E.protocol&&!E.protocol.match(r.protocol_expression)?E.protocol=void 0:R.substring(X+1,X+3).replace(/\\/g,"/")==="//"?(R=R.substring(X+3),R=r.parseAuthority(R,E)):(R=R.substring(X+1),E.urn=!0))),E.path=R,E},r.parseHost=function(R,E){R||(R=""),R=R.replace(/\\/g,"/");var X=R.indexOf("/"),A,N;if(X===-1&&(X=R.length),R.charAt(0)==="[")A=R.indexOf("]"),E.hostname=R.substring(1,A)||null,E.port=R.substring(A+2,X)||null,E.port==="/"&&(E.port=null);else{var O=R.indexOf(":"),U=R.indexOf("/"),Y=R.indexOf(":",O+1);Y!==-1&&(U===-1||Y-1?N:R.length-1),U;return O>-1&&(N===-1||O-1?z=z.slice(0,j)+z.slice(j).replace(O,""):z=z.replace(O,""),!(z.length<=k[0].length)&&!(X.ignore&&X.ignore.test(z))){te=H+z.length;var _e=E(z,H,te,R);if(_e===void 0){A.lastIndex=te;continue}_e=String(_e),R=R.slice(0,H)+_e+R.slice(te),A.lastIndex=H+_e.length}}return A.lastIndex=0,R},r.ensureValidHostname=function(R,E){var X=!!R,A=!!E,N=!1;if(A&&(N=g(r.hostProtocols,E)),N&&!X)throw new TypeError("Hostname cannot be empty, if protocol is "+E);if(R&&R.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(R).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(R){if(R){var E=Number(R);if(!(s(E)&&E>0&&E<65536))throw new TypeError('Port "'+R+'" is not a valid port')}},r.noConflict=function(R){if(R){var E={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(E.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(E.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(E.SecondLevelDomains=i.SecondLevelDomains.noConflict()),E}else i.URI===this&&(i.URI=o);return this},a.build=function(R){return R===!0?this._deferred_build=!0:(R===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function I(R){return function(E,X){return E===void 0?this._parts[R]||"":(this._parts[R]=E||null,this.build(!X),this)}}function v(R,E){return function(X,A){return X===void 0?this._parts[R]||"":(X!==null&&(X=X+"",X.charAt(0)===E&&(X=X.substring(1))),this._parts[R]=X,this.build(!A),this)}}a.protocol=I("protocol"),a.username=I("username"),a.password=I("password"),a.hostname=I("hostname"),a.port=I("port"),a.query=v("query","?"),a.fragment=v("fragment","#"),a.search=function(R,E){var X=this.query(R,E);return typeof X=="string"&&X.length?"?"+X:X},a.hash=function(R,E){var X=this.fragment(R,E);return typeof X=="string"&&X.length?"#"+X:X},a.pathname=function(R,E){if(R===void 0||R===!0){var X=this._parts.path||(this._parts.hostname?"/":"");return R?(this._parts.urn?r.decodeUrnPath:r.decodePath)(X):X}else return this._parts.urn?this._parts.path=R?r.recodeUrnPath(R):"":this._parts.path=R?r.recodePath(R):"/",this.build(!E),this},a.path=a.pathname,a.href=function(R,E){var X;if(R===void 0)return this.toString();this._string="",this._parts=r._parts();var A=R instanceof r,N=typeof R=="object"&&(R.hostname||R.path||R.pathname);if(R.nodeName){var O=r.getDomAttribute(R);R=R[O]||"",N=!1}if(!A&&N&&R.pathname!==void 0&&(R=R.toString()),typeof R=="string"||R instanceof String)this._parts=r.parse(String(R),this._parts);else if(A||N){var U=A?R._parts:R;for(X in U)X!=="query"&&c.call(this._parts,X)&&(this._parts[X]=U[X]);U.query&&this.query(U.query,!1)}else throw new TypeError("invalid input");return this.build(!E),this},a.is=function(R){var E=!1,X=!1,A=!1,N=!1,O=!1,U=!1,Y=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,X=r.ip4_expression.test(this._parts.hostname),A=r.ip6_expression.test(this._parts.hostname),E=X||A,N=!E,O=N&&n&&n.has(this._parts.hostname),U=N&&r.idn_expression.test(this._parts.hostname),Y=N&&r.punycode_expression.test(this._parts.hostname)),R.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return N;case"sld":return O;case"ip":return E;case"ip4":case"ipv4":case"inet4":return X;case"ip6":case"ipv6":case"inet6":return A;case"idn":return U;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return Y}return null};var P=a.protocol,w=a.port,F=a.hostname;a.protocol=function(R,E){if(R&&(R=R.replace(/:(\/\/)?$/,""),!R.match(r.protocol_expression)))throw new TypeError('Protocol "'+R+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,R,E)},a.scheme=a.protocol,a.port=function(R,E){return this._parts.urn?R===void 0?"":this:(R!==void 0&&(R===0&&(R=null),R&&(R+="",R.charAt(0)===":"&&(R=R.substring(1)),r.ensureValidPort(R))),w.call(this,R,E))},a.hostname=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R!==void 0){var X={preventInvalidHostname:this._parts.preventInvalidHostname},A=r.parseHost(R,X);if(A!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');R=X.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(R,this._parts.protocol)}return F.call(this,R,E)},a.origin=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var X=this.protocol(),A=this.authority();return A?(X?X+"://":"")+this.authority():""}else{var N=r(R);return this.protocol(N.protocol()).authority(N.authority()).build(!E),this}},a.host=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var X=r.parseHost(R,this._parts);if(X!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.authority=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var X=r.parseAuthority(R,this._parts);if(X!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.userinfo=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var X=r.buildUserinfo(this._parts);return X&&X.substring(0,X.length-1)}else return R[R.length-1]!=="@"&&(R+="@"),r.parseUserinfo(R,this._parts),this.build(!E),this},a.resource=function(R,E){var X;return R===void 0?this.path()+this.search()+this.hash():(X=r.parse(R),this._parts.path=X.path,this._parts.query=X.query,this._parts.fragment=X.fragment,this.build(!E),this)},a.subdomain=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,X)||""}else{var A=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,A),O=new RegExp("^"+d(N));if(R&&R.charAt(R.length-1)!=="."&&(R+="."),R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return R&&r.ensureValidHostname(R,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(O,R),this.build(!E),this}},a.domain=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(E=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.match(/\./g);if(X&&X.length<2)return this._parts.hostname;var A=this._parts.hostname.length-this.tld(E).length-1;return A=this._parts.hostname.lastIndexOf(".",A-1)+1,this._parts.hostname.substring(A)||""}else{if(!R)throw new TypeError("cannot set domain empty");if(R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(R,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=R;else{var N=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(N,R)}return this.build(!E),this}},a.tld=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(E=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.lastIndexOf("."),A=this._parts.hostname.substring(X+1);return E!==!0&&n&&n.list[A.toLowerCase()]&&n.get(this._parts.hostname)||A}else{var N;if(R)if(R.match(/[^a-zA-Z0-9-]/))if(n&&n.is(R))N=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,R);else throw new TypeError('TLD "'+R+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");N=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,R)}else throw new TypeError("cannot set TLD empty");return this.build(!E),this}},a.directory=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var X=this._parts.path.length-this.filename().length-1,A=this._parts.path.substring(0,X)||(this._parts.hostname?"/":"");return R?r.decodePath(A):A}else{var N=this._parts.path.length-this.filename().length,O=this._parts.path.substring(0,N),U=new RegExp("^"+d(O));return this.is("relative")||(R||(R="/"),R.charAt(0)!=="/"&&(R="/"+R)),R&&R.charAt(R.length-1)!=="/"&&(R+="/"),R=r.recodePath(R),this._parts.path=this._parts.path.replace(U,R),this.build(!E),this}},a.filename=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R!="string"){if(!this._parts.path||this._parts.path==="/")return"";var X=this._parts.path.lastIndexOf("/"),A=this._parts.path.substring(X+1);return R?r.decodePathSegment(A):A}else{var N=!1;R.charAt(0)==="/"&&(R=R.substring(1)),R.match(/\.?\//)&&(N=!0);var O=new RegExp(d(this.filename())+"$");return R=r.recodePath(R),this._parts.path=this._parts.path.replace(O,R),N?this.normalizePath(E):this.build(!E),this}},a.suffix=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path||this._parts.path==="/")return"";var X=this.filename(),A=X.lastIndexOf("."),N,O;return A===-1?"":(N=X.substring(A+1),O=/^[a-z0-9%]+$/i.test(N)?N:"",R?r.decodePathSegment(O):O)}else{R.charAt(0)==="."&&(R=R.substring(1));var U=this.suffix(),Y;if(U)R?Y=new RegExp(d(U)+"$"):Y=new RegExp(d("."+U)+"$");else{if(!R)return this;this._parts.path+="."+r.recodePath(R)}return Y&&(R=r.recodePath(R),this._parts.path=this._parts.path.replace(Y,R)),this.build(!E),this}},a.segment=function(R,E,X){var A=this._parts.urn?":":"/",N=this.path(),O=N.substring(0,1)==="/",U=N.split(A);if(R!==void 0&&typeof R!="number"&&(X=E,E=R,R=void 0),R!==void 0&&typeof R!="number")throw new Error('Bad segment "'+R+'", must be 0-based integer');if(O&&U.shift(),R<0&&(R=Math.max(U.length+R,0)),E===void 0)return R===void 0?U:U[R];if(R===null||U[R]===void 0)if(h(E)){U=[];for(var Y=0,k=E.length;Y{"use strict";var t9n=T(S());kce.exports=Rze;var qP=1e20;function Rze(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,d,u,h,p,g,f,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,s=p.height,g=h.getImageData(0,0,r,s),c=g.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,s=p.height,g=h.getImageData(0,0,r,s),c=g.data,u=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(d=c,c=Array(r*s),f=0,x=Math.floor(d.length/u);f{var T9n=T(S());function Aze(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,d=9,u=10,h=11,p=12,g=13,f=14,x=15,_=16,C=17,V=0,L=1,Z=2,G=3,I=4;function v(b,R){return 55296<=b.charCodeAt(R)&&b.charCodeAt(R)<=56319&&56320<=b.charCodeAt(R+1)&&b.charCodeAt(R+1)<=57343}function P(b,R){R===void 0&&(R=0);var E=b.charCodeAt(R);if(55296<=E&&E<=56319&&R=1){var X=b.charCodeAt(R-1),A=E;return 55296<=X&&X<=56319?(X-55296)*1024+(A-56320)+65536:A}return E}function w(b,R,E){var X=[b].concat(R).concat([E]),A=X[X.length-2],N=E,O=X.lastIndexOf(f);if(O>1&&X.slice(1,O).every(function(k){return k==i})&&[i,g,C].indexOf(b)==-1)return Z;var U=X.lastIndexOf(o);if(U>0&&X.slice(1,U).every(function(k){return k==o})&&[p,o].indexOf(A)==-1)return X.filter(function(k){return k==o}).length%2==1?G:I;if(A==e&&N==t)return V;if(A==n||A==e||A==t)return N==f&&R.every(function(k){return k==i})?Z:L;if(N==n||N==e||N==t)return L;if(A==s&&(N==s||N==a||N==d||N==u))return V;if((A==d||A==a)&&(N==a||N==c))return V;if((A==u||A==c)&&N==c)return V;if(N==i||N==x)return V;if(N==r)return V;if(A==p)return V;var Y=X.indexOf(i)!=-1?X.lastIndexOf(i)-1:X.length-2;return[g,C].indexOf(X[Y])!=-1&&X.slice(Y+1,-1).every(function(k){return k==i})&&N==f||A==x&&[_,C].indexOf(N)!=-1?V:R.indexOf(o)!=-1?Z:A==o&&N==o?V:L}this.nextBreak=function(b,R){if(R===void 0&&(R=0),R<0)return 0;if(R>=b.length-1)return b.length;for(var E=F(P(b,R)),X=[],A=R+1;A{var Cci=T(S());(function(e,t){typeof SJ=="object"&&typeof CJ<"u"?CJ.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(SJ,function(){"use strict";function e(_,C,V,L,Z){(function G(I,v,P,w,F){for(;w>P;){if(w-P>600){var b=w-P+1,R=v-P+1,E=Math.log(b),X=.5*Math.exp(2*E/3),A=.5*Math.sqrt(E*X*(b-X)/b)*(R-b/2<0?-1:1),N=Math.max(P,Math.floor(v-R*X/b+A)),O=Math.min(w,Math.floor(v+(b-R)*X/b+A));G(I,v,N,O,F)}var U=I[v],Y=P,k=w;for(t(I,P,v),F(I[w],U)>0&&t(I,P,w);Y0;)k--}F(I[P],U)===0?t(I,P,k):t(I,++k,w),k<=v&&(P=k+1),v<=k&&(w=k-1)}})(_,C,V||0,L||_.length-1,Z||n)}function t(_,C,V){var L=_[C];_[C]=_[V],_[V]=L}function n(_,C){return _C?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(_,C,V){if(!V)return C.indexOf(_);for(var L=0;L=_.minX&&C.maxY>=_.minY}function f(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(_,C,V,L,Z){for(var G=[C,V];G.length;)if(!((V=G.pop())-(C=G.pop())<=L)){var I=C+Math.ceil((V-C)/L/2)*L;e(_,I,C,V,Z),G.push(C,I,I,V)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var C=this.data,V=[];if(!g(_,C))return V;for(var L=this.toBBox,Z=[];C;){for(var G=0;G=0&&Z[C].children.length>this._maxEntries;)this._split(Z,C),C--;this._adjustParentBBoxes(L,Z,C)},i.prototype._split=function(_,C){var V=_[C],L=V.children.length,Z=this._minEntries;this._chooseSplitAxis(V,Z,L);var G=this._chooseSplitIndex(V,Z,L),I=f(V.children.splice(G,V.children.length-G));I.height=V.height,I.leaf=V.leaf,r(V,this.toBBox),r(I,this.toBBox),C?_[C-1].children.push(I):this._splitRoot(V,I)},i.prototype._splitRoot=function(_,C){this.data=f([_,C]),this.data.height=_.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,C,V){for(var L,Z,G,I,v,P,w,F=1/0,b=1/0,R=C;R<=V-C;R++){var E=s(_,0,R,this.toBBox),X=s(_,R,V,this.toBBox),A=(Z=E,G=X,I=void 0,v=void 0,P=void 0,w=void 0,I=Math.max(Z.minX,G.minX),v=Math.max(Z.minY,G.minY),P=Math.min(Z.maxX,G.maxX),w=Math.min(Z.maxY,G.maxY),Math.max(0,P-I)*Math.max(0,w-v)),N=u(E)+u(X);A=C;F--){var b=_.children[F];a(I,_.leaf?Z(b):b),v+=h(I)}return v},i.prototype._adjustParentBBoxes=function(_,C,V){for(var L=V;L>=0;L--)a(C[L],_)},i.prototype._condense=function(_){for(var C=_.length-1,V=void 0;C>=0;C--)_[C].children.length===0?C>0?(V=_[C-1].children).splice(V.indexOf(_[C]),1):this.clear():r(_[C],this.toBBox)},i})});var e7=od((exports,module)=>{var Y4i=T(S());/*! + */(function(e,t){"use strict";typeof dN=="object"&&dN.exports?dN.exports=t(Eq(),Xq(),Pq()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(vq,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(R,E){var X=arguments.length>=1,A=arguments.length>=2;if(!(this instanceof r))return X?A?new r(R,E):new r(R):new r;if(R===void 0){if(X)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?R=location.href+"":R=""}if(R===null&&X)throw new TypeError("null is not a valid argument for URI");return this.href(R),E!==void 0?this.absoluteTo(E):this}function s(R){return/^[0-9]+$/.test(R)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function d(R){return R.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(R){return R===void 0?"Undefined":String(Object.prototype.toString.call(R)).slice(8,-1)}function h(R){return u(R)==="Array"}function p(R,E){var X={},A,N;if(u(E)==="RegExp")X=null;else if(h(E))for(A=0,N=E.length;A]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(R){if(!(!R||!R.nodeName)){var E=R.nodeName.toLowerCase();if(!(E==="input"&&R.type!=="image"))return r.domAttributes[E]}};function _(R){return escape(R)}function C(R){return encodeURIComponent(R).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(R,E){var X=r.encode(R+"");return E===void 0&&(E=r.escapeQuerySpace),E?X.replace(/%20/g,"+"):X},r.decodeQuery=function(R,E){R+="",E===void 0&&(E=r.escapeQuerySpace);try{return r.decode(E?R.replace(/\+/g,"%20"):R)}catch{return R}};var V={encode:"encode",decode:"decode"},L,Z=function(R,E){return function(X){try{return r[E](X+"").replace(r.characters[R][E].expression,function(A){return r.characters[R][E].map[A]})}catch{return X}}};for(L in V)r[L+"PathSegment"]=Z("pathname",V[L]),r[L+"UrnPathSegment"]=Z("urnpath",V[L]);var G=function(R,E,X){return function(A){var N;X?N=function(k){return r[E](r[X](k))}:N=r[E];for(var O=(A+"").split(R),U=0,Y=O.length;U-1&&(E.fragment=R.substring(X+1)||null,R=R.substring(0,X)),X=R.indexOf("?"),X>-1&&(E.query=R.substring(X+1)||null,R=R.substring(0,X)),R=R.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),R=R.replace(/^[/\\]{2,}/i,"//"),R.substring(0,2)==="//"?(E.protocol=null,R=R.substring(2),R=r.parseAuthority(R,E)):(X=R.indexOf(":"),X>-1&&(E.protocol=R.substring(0,X)||null,E.protocol&&!E.protocol.match(r.protocol_expression)?E.protocol=void 0:R.substring(X+1,X+3).replace(/\\/g,"/")==="//"?(R=R.substring(X+3),R=r.parseAuthority(R,E)):(R=R.substring(X+1),E.urn=!0))),E.path=R,E},r.parseHost=function(R,E){R||(R=""),R=R.replace(/\\/g,"/");var X=R.indexOf("/"),A,N;if(X===-1&&(X=R.length),R.charAt(0)==="[")A=R.indexOf("]"),E.hostname=R.substring(1,A)||null,E.port=R.substring(A+2,X)||null,E.port==="/"&&(E.port=null);else{var O=R.indexOf(":"),U=R.indexOf("/"),Y=R.indexOf(":",O+1);Y!==-1&&(U===-1||Y-1?N:R.length-1),U;return O>-1&&(N===-1||O-1?z=z.slice(0,j)+z.slice(j).replace(O,""):z=z.replace(O,""),!(z.length<=k[0].length)&&!(X.ignore&&X.ignore.test(z))){te=H+z.length;var Te=E(z,H,te,R);if(Te===void 0){A.lastIndex=te;continue}Te=String(Te),R=R.slice(0,H)+Te+R.slice(te),A.lastIndex=H+Te.length}}return A.lastIndex=0,R},r.ensureValidHostname=function(R,E){var X=!!R,A=!!E,N=!1;if(A&&(N=g(r.hostProtocols,E)),N&&!X)throw new TypeError("Hostname cannot be empty, if protocol is "+E);if(R&&R.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(R).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(R){if(R){var E=Number(R);if(!(s(E)&&E>0&&E<65536))throw new TypeError('Port "'+R+'" is not a valid port')}},r.noConflict=function(R){if(R){var E={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(E.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(E.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(E.SecondLevelDomains=i.SecondLevelDomains.noConflict()),E}else i.URI===this&&(i.URI=o);return this},a.build=function(R){return R===!0?this._deferred_build=!0:(R===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function I(R){return function(E,X){return E===void 0?this._parts[R]||"":(this._parts[R]=E||null,this.build(!X),this)}}function v(R,E){return function(X,A){return X===void 0?this._parts[R]||"":(X!==null&&(X=X+"",X.charAt(0)===E&&(X=X.substring(1))),this._parts[R]=X,this.build(!A),this)}}a.protocol=I("protocol"),a.username=I("username"),a.password=I("password"),a.hostname=I("hostname"),a.port=I("port"),a.query=v("query","?"),a.fragment=v("fragment","#"),a.search=function(R,E){var X=this.query(R,E);return typeof X=="string"&&X.length?"?"+X:X},a.hash=function(R,E){var X=this.fragment(R,E);return typeof X=="string"&&X.length?"#"+X:X},a.pathname=function(R,E){if(R===void 0||R===!0){var X=this._parts.path||(this._parts.hostname?"/":"");return R?(this._parts.urn?r.decodeUrnPath:r.decodePath)(X):X}else return this._parts.urn?this._parts.path=R?r.recodeUrnPath(R):"":this._parts.path=R?r.recodePath(R):"/",this.build(!E),this},a.path=a.pathname,a.href=function(R,E){var X;if(R===void 0)return this.toString();this._string="",this._parts=r._parts();var A=R instanceof r,N=typeof R=="object"&&(R.hostname||R.path||R.pathname);if(R.nodeName){var O=r.getDomAttribute(R);R=R[O]||"",N=!1}if(!A&&N&&R.pathname!==void 0&&(R=R.toString()),typeof R=="string"||R instanceof String)this._parts=r.parse(String(R),this._parts);else if(A||N){var U=A?R._parts:R;for(X in U)X!=="query"&&c.call(this._parts,X)&&(this._parts[X]=U[X]);U.query&&this.query(U.query,!1)}else throw new TypeError("invalid input");return this.build(!E),this},a.is=function(R){var E=!1,X=!1,A=!1,N=!1,O=!1,U=!1,Y=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,X=r.ip4_expression.test(this._parts.hostname),A=r.ip6_expression.test(this._parts.hostname),E=X||A,N=!E,O=N&&n&&n.has(this._parts.hostname),U=N&&r.idn_expression.test(this._parts.hostname),Y=N&&r.punycode_expression.test(this._parts.hostname)),R.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return N;case"sld":return O;case"ip":return E;case"ip4":case"ipv4":case"inet4":return X;case"ip6":case"ipv6":case"inet6":return A;case"idn":return U;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return Y}return null};var P=a.protocol,w=a.port,F=a.hostname;a.protocol=function(R,E){if(R&&(R=R.replace(/:(\/\/)?$/,""),!R.match(r.protocol_expression)))throw new TypeError('Protocol "'+R+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,R,E)},a.scheme=a.protocol,a.port=function(R,E){return this._parts.urn?R===void 0?"":this:(R!==void 0&&(R===0&&(R=null),R&&(R+="",R.charAt(0)===":"&&(R=R.substring(1)),r.ensureValidPort(R))),w.call(this,R,E))},a.hostname=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R!==void 0){var X={preventInvalidHostname:this._parts.preventInvalidHostname},A=r.parseHost(R,X);if(A!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');R=X.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(R,this._parts.protocol)}return F.call(this,R,E)},a.origin=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var X=this.protocol(),A=this.authority();return A?(X?X+"://":"")+this.authority():""}else{var N=r(R);return this.protocol(N.protocol()).authority(N.authority()).build(!E),this}},a.host=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var X=r.parseHost(R,this._parts);if(X!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.authority=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var X=r.parseAuthority(R,this._parts);if(X!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.userinfo=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var X=r.buildUserinfo(this._parts);return X&&X.substring(0,X.length-1)}else return R[R.length-1]!=="@"&&(R+="@"),r.parseUserinfo(R,this._parts),this.build(!E),this},a.resource=function(R,E){var X;return R===void 0?this.path()+this.search()+this.hash():(X=r.parse(R),this._parts.path=X.path,this._parts.query=X.query,this._parts.fragment=X.fragment,this.build(!E),this)},a.subdomain=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,X)||""}else{var A=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,A),O=new RegExp("^"+d(N));if(R&&R.charAt(R.length-1)!=="."&&(R+="."),R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return R&&r.ensureValidHostname(R,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(O,R),this.build(!E),this}},a.domain=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(E=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.match(/\./g);if(X&&X.length<2)return this._parts.hostname;var A=this._parts.hostname.length-this.tld(E).length-1;return A=this._parts.hostname.lastIndexOf(".",A-1)+1,this._parts.hostname.substring(A)||""}else{if(!R)throw new TypeError("cannot set domain empty");if(R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(R,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=R;else{var N=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(N,R)}return this.build(!E),this}},a.tld=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(E=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.lastIndexOf("."),A=this._parts.hostname.substring(X+1);return E!==!0&&n&&n.list[A.toLowerCase()]&&n.get(this._parts.hostname)||A}else{var N;if(R)if(R.match(/[^a-zA-Z0-9-]/))if(n&&n.is(R))N=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,R);else throw new TypeError('TLD "'+R+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");N=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,R)}else throw new TypeError("cannot set TLD empty");return this.build(!E),this}},a.directory=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var X=this._parts.path.length-this.filename().length-1,A=this._parts.path.substring(0,X)||(this._parts.hostname?"/":"");return R?r.decodePath(A):A}else{var N=this._parts.path.length-this.filename().length,O=this._parts.path.substring(0,N),U=new RegExp("^"+d(O));return this.is("relative")||(R||(R="/"),R.charAt(0)!=="/"&&(R="/"+R)),R&&R.charAt(R.length-1)!=="/"&&(R+="/"),R=r.recodePath(R),this._parts.path=this._parts.path.replace(U,R),this.build(!E),this}},a.filename=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R!="string"){if(!this._parts.path||this._parts.path==="/")return"";var X=this._parts.path.lastIndexOf("/"),A=this._parts.path.substring(X+1);return R?r.decodePathSegment(A):A}else{var N=!1;R.charAt(0)==="/"&&(R=R.substring(1)),R.match(/\.?\//)&&(N=!0);var O=new RegExp(d(this.filename())+"$");return R=r.recodePath(R),this._parts.path=this._parts.path.replace(O,R),N?this.normalizePath(E):this.build(!E),this}},a.suffix=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path||this._parts.path==="/")return"";var X=this.filename(),A=X.lastIndexOf("."),N,O;return A===-1?"":(N=X.substring(A+1),O=/^[a-z0-9%]+$/i.test(N)?N:"",R?r.decodePathSegment(O):O)}else{R.charAt(0)==="."&&(R=R.substring(1));var U=this.suffix(),Y;if(U)R?Y=new RegExp(d(U)+"$"):Y=new RegExp(d("."+U)+"$");else{if(!R)return this;this._parts.path+="."+r.recodePath(R)}return Y&&(R=r.recodePath(R),this._parts.path=this._parts.path.replace(Y,R)),this.build(!E),this}},a.segment=function(R,E,X){var A=this._parts.urn?":":"/",N=this.path(),O=N.substring(0,1)==="/",U=N.split(A);if(R!==void 0&&typeof R!="number"&&(X=E,E=R,R=void 0),R!==void 0&&typeof R!="number")throw new Error('Bad segment "'+R+'", must be 0-based integer');if(O&&U.shift(),R<0&&(R=Math.max(U.length+R,0)),E===void 0)return R===void 0?U:U[R];if(R===null||U[R]===void 0)if(h(E)){U=[];for(var Y=0,k=E.length;Y{"use strict";var zFn=T(S());Uce.exports=Eze;var E2=1e20;function Eze(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,d,u,h,p,g,f,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,s=p.height,g=h.getImageData(0,0,r,s),c=g.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,s=p.height,g=h.getImageData(0,0,r,s),c=g.data,u=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(d=c,c=Array(r*s),f=0,x=Math.floor(d.length/u);f{var hAn=T(S());function kze(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,d=9,u=10,h=11,p=12,g=13,f=14,x=15,_=16,C=17,V=0,L=1,Z=2,G=3,I=4;function v(b,R){return 55296<=b.charCodeAt(R)&&b.charCodeAt(R)<=56319&&56320<=b.charCodeAt(R+1)&&b.charCodeAt(R+1)<=57343}function P(b,R){R===void 0&&(R=0);var E=b.charCodeAt(R);if(55296<=E&&E<=56319&&R=1){var X=b.charCodeAt(R-1),A=E;return 55296<=X&&X<=56319?(X-55296)*1024+(A-56320)+65536:A}return E}function w(b,R,E){var X=[b].concat(R).concat([E]),A=X[X.length-2],N=E,O=X.lastIndexOf(f);if(O>1&&X.slice(1,O).every(function(k){return k==i})&&[i,g,C].indexOf(b)==-1)return Z;var U=X.lastIndexOf(o);if(U>0&&X.slice(1,U).every(function(k){return k==o})&&[p,o].indexOf(A)==-1)return X.filter(function(k){return k==o}).length%2==1?G:I;if(A==e&&N==t)return V;if(A==n||A==e||A==t)return N==f&&R.every(function(k){return k==i})?Z:L;if(N==n||N==e||N==t)return L;if(A==s&&(N==s||N==a||N==d||N==u))return V;if((A==d||A==a)&&(N==a||N==c))return V;if((A==u||A==c)&&N==c)return V;if(N==i||N==x)return V;if(N==r)return V;if(A==p)return V;var Y=X.indexOf(i)!=-1?X.lastIndexOf(i)-1:X.length-2;return[g,C].indexOf(X[Y])!=-1&&X.slice(Y+1,-1).every(function(k){return k==i})&&N==f||A==x&&[_,C].indexOf(N)!=-1?V:R.indexOf(o)!=-1?Z:A==o&&N==o?V:L}this.nextBreak=function(b,R){if(R===void 0&&(R=0),R<0)return 0;if(R>=b.length-1)return b.length;for(var E=F(P(b,R)),X=[],A=R+1;A{var Zai=T(S());(function(e,t){typeof VJ=="object"&&typeof LJ<"u"?LJ.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(VJ,function(){"use strict";function e(_,C,V,L,Z){(function G(I,v,P,w,F){for(;w>P;){if(w-P>600){var b=w-P+1,R=v-P+1,E=Math.log(b),X=.5*Math.exp(2*E/3),A=.5*Math.sqrt(E*X*(b-X)/b)*(R-b/2<0?-1:1),N=Math.max(P,Math.floor(v-R*X/b+A)),O=Math.min(w,Math.floor(v+(b-R)*X/b+A));G(I,v,N,O,F)}var U=I[v],Y=P,k=w;for(t(I,P,v),F(I[w],U)>0&&t(I,P,w);Y0;)k--}F(I[P],U)===0?t(I,P,k):t(I,++k,w),k<=v&&(P=k+1),v<=k&&(w=k-1)}})(_,C,V||0,L||_.length-1,Z||n)}function t(_,C,V){var L=_[C];_[C]=_[V],_[V]=L}function n(_,C){return _C?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(_,C,V){if(!V)return C.indexOf(_);for(var L=0;L=_.minX&&C.maxY>=_.minY}function f(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(_,C,V,L,Z){for(var G=[C,V];G.length;)if(!((V=G.pop())-(C=G.pop())<=L)){var I=C+Math.ceil((V-C)/L/2)*L;e(_,I,C,V,Z),G.push(C,I,I,V)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var C=this.data,V=[];if(!g(_,C))return V;for(var L=this.toBBox,Z=[];C;){for(var G=0;G=0&&Z[C].children.length>this._maxEntries;)this._split(Z,C),C--;this._adjustParentBBoxes(L,Z,C)},i.prototype._split=function(_,C){var V=_[C],L=V.children.length,Z=this._minEntries;this._chooseSplitAxis(V,Z,L);var G=this._chooseSplitIndex(V,Z,L),I=f(V.children.splice(G,V.children.length-G));I.height=V.height,I.leaf=V.leaf,r(V,this.toBBox),r(I,this.toBBox),C?_[C-1].children.push(I):this._splitRoot(V,I)},i.prototype._splitRoot=function(_,C){this.data=f([_,C]),this.data.height=_.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,C,V){for(var L,Z,G,I,v,P,w,F=1/0,b=1/0,R=C;R<=V-C;R++){var E=s(_,0,R,this.toBBox),X=s(_,R,V,this.toBBox),A=(Z=E,G=X,I=void 0,v=void 0,P=void 0,w=void 0,I=Math.max(Z.minX,G.minX),v=Math.max(Z.minY,G.minY),P=Math.min(Z.maxX,G.maxX),w=Math.min(Z.maxY,G.maxY),Math.max(0,P-I)*Math.max(0,w-v)),N=u(E)+u(X);A=C;F--){var b=_.children[F];a(I,_.leaf?Z(b):b),v+=h(I)}return v},i.prototype._adjustParentBBoxes=function(_,C,V){for(var L=V;L>=0;L--)a(C[L],_)},i.prototype._condense=function(_){for(var C=_.length-1,V=void 0;C>=0;C--)_[C].children.length===0?C>0?(V=_[C-1].children).splice(V.indexOf(_[C]),1):this.clear():r(_[C],this.toBBox)},i})});var t7=rd((exports,module)=>{var Q4i=T(S());/*! * protobuf.js v7.4.0 (c) 2016, daniel wirtz * compiled thu, 22 aug 2024 20:30:39 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details - */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,d=!0;c1&&d.charAt(u)==="=";)++h;return Math.ceil(d.length*3)/4-h};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(d,u,h){for(var p=null,g=[],f=0,x=0,_;u>2],_=(C&3)<<4,x=1;break;case 1:g[f++]=o[_|C>>4],_=(C&15)<<2,x=2;break;case 2:g[f++]=o[_|C>>6],g[f++]=o[C&63],x=0;break}f>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),f=0)}return x&&(g[f++]=o[_],g[f++]=61,x===1&&(g[f++]=61)),p?(f&&p.push(String.fromCharCode.apply(String,g.slice(0,f))),p.join("")):String.fromCharCode.apply(String,g.slice(0,f))};var a="invalid encoding";i.decode=function(d,u,h){for(var p=h,g=0,f,x=0;x1)break;if((_=r[_])===undefined)throw Error(a);switch(g){case 0:f=_,g=1;break;case 1:u[h++]=f<<2|(_&48)>>4,f=_,g=2;break;case 2:u[h++]=(f&15)<<4|(_&60)>>2,f=_,g=3;break;case 3:u[h++]=(f&3)<<6|_,g=0;break}}if(g===1)throw Error(a);return h-p},i.test=function(d){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(d)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c0?0:2147483648,g,f);else if(isNaN(p))h(2143289344,g,f);else if(p>34028234663852886e22)h((x<<31|2139095040)>>>0,g,f);else if(p<11754943508222875e-54)h((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,f);else{var _=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-_)*8388608)&8388607;h((x<<31|_+127<<23|C)>>>0,g,f)}}c.writeFloatLE=d.bind(null,o),c.writeFloatBE=d.bind(null,r);function u(h,p,g){var f=h(p,g),x=(f>>31)*2+1,_=f>>>23&255,C=f&8388607;return _===255?C?NaN:x*(1/0):_===0?x*1401298464324817e-60*C:x*Math.pow(2,_-150)*(C+8388608)}c.readFloatLE=u.bind(null,s),c.readFloatBE=u.bind(null,a)}(),typeof Float64Array<"u"?function(){var d=new Float64Array([-0]),u=new Uint8Array(d.buffer),h=u[7]===128;function p(_,C,V){d[0]=_,C[V]=u[0],C[V+1]=u[1],C[V+2]=u[2],C[V+3]=u[3],C[V+4]=u[4],C[V+5]=u[5],C[V+6]=u[6],C[V+7]=u[7]}function g(_,C,V){d[0]=_,C[V]=u[7],C[V+1]=u[6],C[V+2]=u[5],C[V+3]=u[4],C[V+4]=u[3],C[V+5]=u[2],C[V+6]=u[1],C[V+7]=u[0]}c.writeDoubleLE=h?p:g,c.writeDoubleBE=h?g:p;function f(_,C){return u[0]=_[C],u[1]=_[C+1],u[2]=_[C+2],u[3]=_[C+3],u[4]=_[C+4],u[5]=_[C+5],u[6]=_[C+6],u[7]=_[C+7],d[0]}function x(_,C){return u[7]=_[C],u[6]=_[C+1],u[5]=_[C+2],u[4]=_[C+3],u[3]=_[C+4],u[2]=_[C+5],u[1]=_[C+6],u[0]=_[C+7],d[0]}c.readDoubleLE=h?f:x,c.readDoubleBE=h?x:f}():function(){function d(h,p,g,f,x,_){var C=f<0?1:0;if(C&&(f=-f),f===0)h(0,x,_+p),h(1/f>0?0:2147483648,x,_+g);else if(isNaN(f))h(0,x,_+p),h(2146959360,x,_+g);else if(f>17976931348623157e292)h(0,x,_+p),h((C<<31|2146435072)>>>0,x,_+g);else{var V;if(f<22250738585072014e-324)V=f/5e-324,h(V>>>0,x,_+p),h((C<<31|V/4294967296)>>>0,x,_+g);else{var L=Math.floor(Math.log(f)/Math.LN2);L===1024&&(L=1023),V=f*Math.pow(2,-L),h(V*4503599627370496>>>0,x,_+p),h((C<<31|L+1023<<20|V*1048576&1048575)>>>0,x,_+g)}}}c.writeDoubleLE=d.bind(null,o,0,4),c.writeDoubleBE=d.bind(null,r,4,0);function u(h,p,g,f,x){var _=h(f,x+p),C=h(f,x+g),V=(C>>31)*2+1,L=C>>>20&2047,Z=4294967296*(C&1048575)+_;return L===2047?Z?NaN:V*(1/0):L===0?V*5e-324*Z:V*Math.pow(2,L-1075)*(Z+4503599627370496)}c.readDoubleLE=u.bind(null,s,0,4),c.readDoubleBE=u.bind(null,a,4,0)}(),c}function o(c,d,u){d[u]=c&255,d[u+1]=c>>>8&255,d[u+2]=c>>>16&255,d[u+3]=c>>>24}function r(c,d,u){d[u]=c>>>24,d[u+1]=c>>>16&255,d[u+2]=c>>>8&255,d[u+3]=c&255}function s(c,d){return(c[d]|c[d+1]<<8|c[d+2]<<16|c[d+3]<<24)>>>0}function a(c,d){return(c[d]<<24|c[d+1]<<16|c[d+2]<<8|c[d+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,d=null,u=a;return function(p){if(p<1||p>c)return o(p);u+p>a&&(d=o(a),u=0);var g=r.call(d,u,u+=p);return u&7&&(u=(u|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c191&&p<224?u[h++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,u[h++]=55296+(p>>10),u[h++]=56320+(p&1023)):u[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,u)),h=0);return d?(h&&d.push(String.fromCharCode.apply(String,u.slice(0,h))),d.join("")):String.fromCharCode.apply(String,u.slice(0,h))},i.write=function(r,s,a){for(var c=a,d,u,h=0;h>6|192,s[a++]=d&63|128):(d&64512)===55296&&((u=r.charCodeAt(h+1))&64512)===56320?(d=65536+((d&1023)<<10)+(u&1023),++h,s[a++]=d>>18|240,s[a++]=d>>12&63|128,s[a++]=d>>6&63|128,s[a++]=d&63|128):(s[a++]=d>>12|224,s[a++]=d>>6&63|128,s[a++]=d&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(f,x){return RangeError("index out of range: "+f.pos+" + "+(x||1)+" > "+f.len)}function c(f){this.buf=f,this.pos=0,this.len=f.length}var d=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},u=function(){return i.Buffer?function(_){return(c.create=function(V){return i.Buffer.isBuffer(V)?new o(V):d(V)})(_)}:d};c.create=u(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function h(){var f=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(f.lo=(f.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return f;if(f.lo=(f.lo|(this.buf[this.pos]&127)<<28)>>>0,f.hi=(f.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return f;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(f.lo=(f.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return f}return f.lo=(f.lo|(this.buf[this.pos++]&127)<>>0,f}if(this.len-this.pos>4){for(;x<5;++x)if(f.hi=(f.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return f}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(f.hi=(f.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return f}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(f,x){return(f[x-4]|f[x-3]<<8|f[x-2]<<16|f[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),_=this.pos,C=this.pos+x;if(C>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(_,C);if(_===C){var V=i.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,_,C)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(f){switch(f){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(f=this.uint32()&7)!==4;)this.skipType(f);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+f+" at offset "+this.pos)}return this},c._configure=function(f){o=f,c.create=u(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[x](!1)},uint64:function(){return h.call(this)[x](!0)},sint64:function(){return h.call(this).zzDecode()[x](!1)},fixed64:function(){return g.call(this)[x](!0)},sfixed64:function(){return g.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,d,u){if(!d)throw TypeError("request must be specified");var h=this;if(!u)return i.asPromise(r,h,s,a,c,d);if(!h.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(g,f){if(g)return h.emit("error",g,s),u(g);if(f===null)return h.end(!0),undefined;if(!(f instanceof c))try{f=c[h.responseDelimited?"decodeDelimited":"decode"](f)}catch(x){return h.emit("error",x,s),u(x)}return h.emit("data",f,s),u(null,f)})}catch(p){return h.emit("error",p,s),setTimeout(function(){u(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,d){this.lo=c>>>0,this.hi=d>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(d){if(d===0)return r;var u=d<0;u&&(d=-d);var h=d>>>0,p=(d-h)/4294967296>>>0;return u&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(d){if(typeof d=="number")return o.fromNumber(d);if(i.isString(d))if(i.Long)d=i.Long.fromString(d);else return o.fromNumber(parseInt(d,10));return d.low||d.high?new o(d.low>>>0,d.high>>>0):r},o.prototype.toNumber=function(d){if(!d&&this.hi>>>31){var u=~this.lo+1>>>0,h=~this.hi>>>0;return u||(h=h+1>>>0),-(u+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(d){return i.Long?new i.Long(this.lo|0,this.hi|0,!!d):{low:this.lo|0,high:this.hi|0,unsigned:!!d}};var a=String.prototype.charCodeAt;o.fromHash=function(d){return d===s?r:new o((a.call(d,0)|a.call(d,1)<<8|a.call(d,2)<<16|a.call(d,3)<<24)>>>0,(a.call(d,4)|a.call(d,5)<<8|a.call(d,6)<<16|a.call(d,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var d=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^d)>>>0,this.lo=(this.lo<<1^d)>>>0,this},o.prototype.zzDecode=function(){var d=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^d)>>>0,this.hi=(this.hi>>>1^d)>>>0,this},o.prototype.length=function(){var d=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?u===0?d<16384?d<128?1:2:d<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:h<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var d=a[c];return d!=null&&a.hasOwnProperty(c)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var d=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(d.lo,d.hi,c):d.toNumber(!!c)};function o(s,a,c){for(var d=Object.keys(a),u=0;u-1;--h)if(c[u[h]]===1&&this[u[h]]!==undefined&&this[u[h]]!==null)return u[h]}},i.oneOfSetter=function(a){return function(c){for(var d=0;d127;)Z[G++]=L&127|128,L>>>=7;Z[G]=L}function x(L,Z){this.len=L,this.next=undefined,this.val=Z}x.prototype=Object.create(c.prototype),x.prototype.fn=f,h.prototype.uint32=function(Z){return this.len+=(this.tail=this.tail.next=new x((Z=Z>>>0)<128?1:Z<16384?2:Z<2097152?3:Z<268435456?4:5,Z)).len,this},h.prototype.int32=function(Z){return Z<0?this._push(_,10,r.fromNumber(Z)):this.uint32(Z)},h.prototype.sint32=function(Z){return this.uint32((Z<<1^Z>>31)>>>0)};function _(L,Z,G){for(;L.hi;)Z[G++]=L.lo&127|128,L.lo=(L.lo>>>7|L.hi<<25)>>>0,L.hi>>>=7;for(;L.lo>127;)Z[G++]=L.lo&127|128,L.lo=L.lo>>>7;Z[G++]=L.lo}h.prototype.uint64=function(Z){var G=r.from(Z);return this._push(_,G.length(),G)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(Z){var G=r.from(Z).zzEncode();return this._push(_,G.length(),G)},h.prototype.bool=function(Z){return this._push(g,1,Z?1:0)};function C(L,Z,G){Z[G]=L&255,Z[G+1]=L>>>8&255,Z[G+2]=L>>>16&255,Z[G+3]=L>>>24}h.prototype.fixed32=function(Z){return this._push(C,4,Z>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(Z){var G=r.from(Z);return this._push(C,4,G.lo)._push(C,4,G.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(Z){return this._push(i.float.writeFloatLE,4,Z)},h.prototype.double=function(Z){return this._push(i.float.writeDoubleLE,8,Z)};var V=i.Array.prototype.set?function(Z,G,I){G.set(Z,I)}:function(Z,G,I){for(var v=0;v>>0;if(!G)return this._push(g,1,0);if(i.isString(Z)){var I=h.alloc(G=s.length(Z));s.decode(Z,I,0),Z=I}return this.uint32(G)._push(V,G,Z)},h.prototype.string=function(Z){var G=a.length(Z);return G?this.uint32(G)._push(a.write,G,Z):this._push(g,1,0)},h.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(d,0,0),this.len=0),this},h.prototype.ldelim=function(){var Z=this.head,G=this.tail,I=this.len;return this.reset().uint32(I),I&&(this.tail.next=Z.next,this.tail=G,this.len+=I),this},h.prototype.finish=function(){for(var Z=this.head.next,G=this.constructor.alloc(this.len),I=0;Z;)Z.fn(Z.val,G,I),I+=Z.len,Z=Z.next;return G},h._configure=function(L){o=L,h.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,d,u){d.set(c,u)}:function(c,d,u){if(c.copy)c.copy(d,u,0,c.length);else for(var h=0;h>>0;return this.uint32(d),d&&this._push(r.writeBytesBuffer,d,c),this};function s(a,c,d){a.length<40?o.utf8.write(a,c,d):c.utf8Write?c.utf8Write(a,d):c.write(a,d)}r.prototype.string=function(c){var d=o.Buffer.byteLength(c);return this.uint32(d),d&&this._push(s,d,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var WSe=od((eno,o3)=>{var tno=T(S());/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,g=c(u,h.inputOffset||0,p),f=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,x=r(g,h.pixelType||Float32Array,h.encodedMaskData,f,h.returnMask),_={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:f};return x.resultMask&&(_.maskData=x.resultMask),h.returnEncodedMask&&g.mask&&(_.encodedMaskData=g.mask.bitset?g.mask.bitset:null),h.returnFileInfo&&(_.fileInfo=s(g),h.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(g))),_};var r=function(u,h,p,g,f){var x=0,_=u.pixels.numBlocksX,C=u.pixels.numBlocksY,V=Math.floor(u.width/_),L=Math.floor(u.height/C),Z=2*u.maxZError,G=Number.MAX_VALUE,I;p=p||(u.mask?u.mask.bitset:null);var v,P;v=new h(u.width*u.height),f&&p&&(P=new Uint8Array(u.width*u.height));for(var w=new Float32Array(V*L),F,b,R=0;R<=C;R++){var E=R!==C?L:u.height%C;if(E!==0)for(var X=0;X<=_;X++){var A=X!==_?V:u.width%_;if(A!==0){var N=R*u.width*L+X*V,O=u.width-A,U=u.pixels.blocks[x],Y,k,H;U.encoding<2?(U.encoding===0?Y=U.rawData:(d(U.stuffedData,U.bitsPerPixel,U.numValidPixels,U.offset,Z,w,u.pixels.maxValue),Y=w),k=0):U.encoding===2?H=0:H=U.offset;var J;if(p)for(b=0;b>3],J<<=N&7),F=0;F>3]),J&128?(P&&(P[N]=1),I=U.encoding<2?Y[k++]:H,G=G>I?I:G,v[N++]=I):(P&&(P[N]=0),v[N++]=g),J<<=1;N+=O}else if(U.encoding<2)for(b=0;bI?I:G,v[N++]=I;N+=O}else for(G=G>H?H:G,b=0;b0){var _=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(u,h,g.mask.numBytes);var C=x.getInt16(0,!0),V=2,L=0;do{if(C>0)for(;C--;)_[L++]=x.getUint8(V++);else{var Z=x.getUint8(V++);for(C=-C;C--;)_[L++]=Z}C=x.getInt16(V,!0),V+=2}while(V0?1:0),P=I+(g.height%I>0?1:0);g.pixels.blocks=new Array(v*P);for(var w=0,F=0;F3)throw"Invalid block encoding ("+X.encoding+")";if(X.encoding===2){h++;continue}if(A!==0&&A!==2){if(A>>=6,X.offsetType=A,A===2)X.offset=x.getInt8(1),R++;else if(A===1)X.offset=x.getInt16(1,!0),R+=2;else if(A===0)X.offset=x.getFloat32(1,!0),R+=4;else throw"Invalid block offset type";if(X.encoding===1)if(A=x.getUint8(R),R++,X.bitsPerPixel=A&63,A>>=6,X.numValidPixelsType=A,A===2)X.numValidPixels=x.getUint8(R),R++;else if(A===1)X.numValidPixels=x.getUint16(R,!0),R+=2;else if(A===0)X.numValidPixels=x.getUint32(R,!0),R+=4;else throw"Invalid valid pixel count type"}if(h+=R,X.encoding!==3){var N,O;if(X.encoding===0){var U=(g.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";N=new ArrayBuffer(U*4),O=new Uint8Array(N),O.set(new Uint8Array(u,h,U*4));var Y=new Float32Array(N);X.rawData=Y,h+=U*4}else if(X.encoding===1){var k=Math.ceil(X.numValidPixels*X.bitsPerPixel/8),H=Math.ceil(k/4);N=new ArrayBuffer(H*4),O=new Uint8Array(N),O.set(new Uint8Array(u,h,k)),X.stuffedData=new Uint32Array(N),h+=k}}}return g.eofOffset=h,g},d=function(u,h,p,g,f,x,_){var C=(1<=h)G=I>>>Z-h&C,Z-=h;else{var w=h-Z;G=(I&C)<>>Z}x[L]=G=u?(Z=G>>>L-u&_,L-=u):(I=u-L,Z=(G&_)<>>L),d[V]=p[Z];else for(v=Math.ceil((x-g)/f),V=0;V=u?(Z=G>>>L-u&_,L-=u):(I=u-L,Z=(G&_)<>>L),d[V]=Z=d?(L=Z>>>V-d&f,V-=d):(C=d-V,L=(Z&f)<>>V),G[_]=L=u?(G=I>>>Z&_,L-=u,Z+=u):(v=u-L,G=I>>>Z&_,I=c[C++],L=32-v,G|=(I&(1<=u?(G=I>>>Z&_,L-=u,Z+=u):(v=u-L,G=I>>>Z&_,I=c[C++],L=32-v,G|=(I&(1<=d?(L=G>>>Z&f,V-=d,Z+=d):(C=d-V,L=G>>>Z&f,G=c[x++],V=32-C,L|=(G&(1<=u?(_=C>>>x-u&p,x-=u):(V=u-x,_=(C&p)<>>x),d[f]=_;return d},originalUnstuff2:function(c,d,u,h){var p=(1<=u?(C=V>>>_&p,x-=u,_+=u):(L=u-x,C=V>>>_&p,V=c[g++],x=32-L,C|=(V&(1<=359?359:p;p-=f;do d+=c[g++]<<8,u+=d+=c[g++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return h&1&&(u+=d+=c[g]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(c,d){var u=d.ptr,h=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,h),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var g=new DataView(c,u,8),f=g.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=g.getUint32(4,!0),u+=4),g=new DataView(c,u,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),u+=8,f>=4?(p.numDims=g.getUint32(8,!0),u+=4):p.numDims=1,g=new DataView(c,u,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var x,_;if(f>=3&&(_=f>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,u-_,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,d){var u=d.headerInfo,h=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),g=this.readSubArray(c,d.ptr,h,p),f=this.readSubArray(c,d.ptr+p,h,p);d.ptr+=2*p;var x,_=!0;for(x=0;x0){_=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,x.numBytes);var V=f.getInt16(0,!0),L=2,Z=0,G=0;do{if(V>0)for(;V--;)_[Z++]=f.getUint8(L++);else for(G=f.getUint8(L++),V=-V;V--;)_[Z++]=G;V=f.getInt16(L,!0),L+=2}while(L>3],I<<=v&7):I=_[v>>3],I&128&&(C[v]=1);d.pixels.resultMask=C,x.bitset=_,u+=x.numBytes}return d.ptr=u,d.mask=x,!0},readDataOneSweep:function(c,d,u){var h=d.ptr,p=d.headerInfo,g=p.numDims,f=p.width*p.height,x=p.imageType,_=p.numValidPixel*r.getDataTypeSize(x)*g,C,V=d.pixels.resultMask;if(u===Uint8Array)C=new Uint8Array(c,h,_);else{var L=new ArrayBuffer(_),Z=new Uint8Array(L);Z.set(new Uint8Array(c,h,_)),C=new u(L)}if(C.length===f*g)d.pixels.resultPixels=C;else{d.pixels.resultPixels=new u(f*g);var G=0,I=0,v=0,P=0;if(g>1)for(v=0;v=x)return!1;var _=new Uint32Array(x-f);r.decodeBits(c,d,_);var C=[],V,L,Z,G;for(V=f;V0&&(C[L].second=R<>>32-G,32-b>=G?(b+=G,b===32&&(b=0,E++,R=F[E])):(b+=G-32,E++,R=F[E],C[L].second|=R>>>32-b));var X=0,A=0,N=new s;for(V=0;V=u?A=u:A=X,X>=30&&console.log("WARning, large NUM LUT BITS IS "+X);var O=[],U,Y,k,H,J,te;for(V=f;V0)if(U=[G,L],G<=A)for(Y=C[L].second<=0;H--)J=Y>>>H&1,J?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),H===0&&!te.val&&(te.val=U[1]);return{decodeLut:O,numBitsLUTQick:A,numBitsLUT:X,tree:N,stuffedData:F,srcPtr:E,bitPos:b}},readHuffman:function(c,d,u){var h=d.headerInfo,p=h.numDims,g=d.headerInfo.height,f=d.headerInfo.width,x=f*g,_=this.readHuffmanTree(c,d),C=_.decodeLut,V=_.tree,L=_.stuffedData,Z=_.srcPtr,G=_.bitPos,I=_.numBitsLUTQick,v=_.numBitsLUT,P=d.headerInfo.imageType===0?128:0,w,F,b,R=d.pixels.resultMask,E,X,A,N,O,U,Y,k=0;G>0&&(Z++,G=0);var H=L[Z],J=d.encodeMode===1,te=new u(x*p),z=te,j;for(j=0;j1&&(z=new u(te.buffer,x*j,x),k=0),d.headerInfo.numValidPixel===f*g)for(U=0,N=0;N>>32-I,X=E,32-G>>64-G-I,X=E),C[X])F=C[X][1],G+=C[X][0];else for(E=H<>>32-v,X=E,32-G>>64-G-v,X=E),w=V,Y=0;Y>>v-Y-1&1,w=A?w.right:w.left,!(w.left||w.right)){F=w.val,G=G+Y+1;break}G>=32&&(G-=32,Z++,H=L[Z]),b=F-P,J?(O>0?b+=k:N>0?b+=z[U-f]:b+=k,b&=255,z[U]=b,k=b):z[U]=b}else for(U=0,N=0;N>>32-I,X=E,32-G>>64-G-I,X=E),C[X])F=C[X][1],G+=C[X][0];else for(E=H<>>32-v,X=E,32-G>>64-G-v,X=E),w=V,Y=0;Y>>v-Y-1&1,w=A?w.right:w.left,!(w.left||w.right)){F=w.val,G=G+Y+1;break}G>=32&&(G-=32,Z++,H=L[Z]),b=F-P,J?(O>0&&R[U-1]?b+=k:N>0&&R[U-f]?b+=z[U-f]:b+=k,b&=255,z[U]=b,k=b):z[U]=b}d.ptr=d.ptr+(Z+1)*4+(G>0?4:0)}d.pixels.resultPixels=te},decodeBits:function(c,d,u,h,p){{var g=d.headerInfo,f=g.fileVersion,x=0,_=new DataView(c,d.ptr,5),C=_.getUint8(0);x++;var V=C>>6,L=V===0?4:3-V,Z=(C&32)>0,G=C&31,I=0;if(L===1)I=_.getUint8(x),x++;else if(L===2)I=_.getUint16(x,!0),x+=2;else if(L===4)I=_.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var v=2*g.maxZError,P,w,F,b,R,E,X,A,N,O,U=g.numDims>1?g.maxValues[p]:g.zMax;if(Z){for(d.counter.lut++,A=_.getUint8(x),N=G,x++,b=Math.ceil((A-1)*G/8),R=Math.ceil(b/4),w=new ArrayBuffer(R*4),F=new Uint8Array(w),d.ptr+=x,F.set(new Uint8Array(c,d.ptr,b)),X=new Uint32Array(w),d.ptr+=b,O=0;A-1>>>O;)O++;b=Math.ceil(I*O/8),R=Math.ceil(b/4),w=new ArrayBuffer(R*4),F=new Uint8Array(w),F.set(new Uint8Array(c,d.ptr,b)),P=new Uint32Array(w),d.ptr+=b,f>=3?E=o.unstuffLUT2(X,G,A-1,h,v,U):E=o.unstuffLUT(X,G,A-1,h,v,U),f>=3?o.unstuff2(P,u,O,I,E):o.unstuff(P,u,O,I,E)}else d.counter.bitstuffer++,O=G,d.ptr+=x,O>0&&(b=Math.ceil(I*O/8),R=Math.ceil(b/4),w=new ArrayBuffer(R*4),F=new Uint8Array(w),F.set(new Uint8Array(c,d.ptr,b)),P=new Uint32Array(w),d.ptr+=b,f>=3?h==null?o.originalUnstuff2(P,u,O,I):o.unstuff2(P,u,O,I,!1,h,v,U):h==null?o.originalUnstuff(P,u,O,I):o.unstuff(P,u,O,I,!1,h,v,U))}},readTiles:function(c,d,u){var h=d.headerInfo,p=h.width,g=h.height,f=h.microBlockSize,x=h.imageType,_=r.getDataTypeSize(x),C=Math.ceil(p/f),V=Math.ceil(g/f);d.pixels.numBlocksY=V,d.pixels.numBlocksX=C,d.pixels.ptr=0;var L=0,Z=0,G=0,I=0,v=0,P=0,w=0,F=0,b=0,R=0,E=0,X=0,A=0,N=0,O=0,U=0,Y,k,H,J,te,z,j=new u(f*f),ee=g%f||f,fe=p%f||f,_e,de,ye=h.numDims,Te,Ie=d.pixels.resultMask,Le=d.pixels.resultPixels;for(G=0;G1&&(Le=new u(d.pixels.resultPixels.buffer,p*g*Te*_,p*g)),w=c.byteLength-d.ptr,Y=new DataView(c,d.ptr,Math.min(10,w)),k={},U=0,F=Y.getUint8(0),U++,b=F>>6&255,R=F>>2&15,R!==(I*f>>3&15))throw"integrity issue";if(z=F&3,z>3)throw d.ptr+=U,"Invalid block encoding ("+z+")";if(z===2){d.counter.constant++,d.ptr+=U;continue}else if(z===0){if(d.counter.uncompressed++,d.ptr+=U,A=v*P*_,N=c.byteLength-d.ptr,A=A1)for(g=0;g=-128&&d<=127;break;case 1:u=d>=0&&d<=255;break;case 2:u=d>=-32768&&d<=32767;break;case 3:u=d>=0&&d<=65536;break;case 4:u=d>=-2147483648&&d<=2147483647;break;case 5:u=d>=0&&d<=4294967296;break;case 6:u=d>=-34027999387901484e22&&d<=34027999387901484e22;break;case 7:u=d>=5e-324&&d<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(c){var d=0;switch(c){case 0:case 1:d=1;break;case 2:case 3:d=2;break;case 4:case 5:case 6:d=4;break;case 7:d=8;break;default:d=c}return d},getDataTypeUsed:function(c,d){var u=c;switch(c){case 2:case 4:u=c-d;break;case 3:case 5:u=c-2*d;break;case 6:d===0?u=c:d===1?u=2:u=1;break;case 7:d===0?u=c:u=c-2*d+1;break;default:u=c;break}return u},getOnePixel:function(c,d,u,h){var p=0;switch(u){case 0:p=h.getInt8(d);break;case 1:p=h.getUint8(d);break;case 2:p=h.getInt16(d,!0);break;case 3:p=h.getUint16(d,!0);break;case 4:p=h.getInt32(d,!0);break;case 5:p=h.getUInt32(d,!0);break;case 6:p=h.getFloat32(d,!0);break;case 7:p=h.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,d,u){this.val=c,this.left=d,this.right=u},a={decode:function(c,d){d=d||{};var u=d.noDataValue,h=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,f=g.fileVersion,x=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var _=g.width*g.height;if(p.pixels.resultPixels=new x(_*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),V=C.getUint8(0);if(p.ptr++,V)r.readDataOneSweep(c,p,x);else if(f>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var L=C.getUint8(1);if(p.ptr++,p.encodeMode=L,L>2||f<4&&L>1)throw"Invalid Huffman flag "+L;L?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var Z;d.inputOffset?(Z=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(Z)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(Z=p.headerInfo.blobSize-p.ptr,Math.abs(Z)>=1&&(p.eofOffset=p.headerInfo.blobSize));var G={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,u)){var I=p.pixels.resultMask;for(h=0;h<_;h++)I[h]||(G.pixelData[h]=u);G.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(G.fileInfo=r.formatFileInfo(p)),G}},getBandCount:function(c){var d=0,u=0,h={};for(h.ptr=0,h.pixels={};u1&&V.fileInfo.mask&&V.fileInfo.mask.numBytes>0&&f.push(V.maskData),h++,C.pixels.push(V.pixelData),C.statistics.push({minValue:V.minValue,maxValue:V.maxValue,noDataValue:V.noDataValue,dimStats:V.dimStats})}var L,Z,G;if(u>1&&f.length>1){for(G=C.width*C.height,C.bandMasks=f,_=new Uint8Array(G),_.set(f[0]),L=1;L{var AEo=T(S());_Ce.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJ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WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCK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ACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var CCe=od((MEo,SCe)=>{var NEo=T(S()),{webm:V1t,mp4:L1t}=TCe(),B6=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,O6=()=>"wakeLock"in navigator,Y6=class{constructor(){if(this.enabled=!1,O6()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else B6()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",V1t),this._addSourceToVideo(this.noSleepVideo,"mp4",L1t),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return O6()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):B6()?(this.disable(),console.warn(` + */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,d=!0;c1&&d.charAt(u)==="=";)++h;return Math.ceil(d.length*3)/4-h};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(d,u,h){for(var p=null,g=[],f=0,x=0,_;u>2],_=(C&3)<<4,x=1;break;case 1:g[f++]=o[_|C>>4],_=(C&15)<<2,x=2;break;case 2:g[f++]=o[_|C>>6],g[f++]=o[C&63],x=0;break}f>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),f=0)}return x&&(g[f++]=o[_],g[f++]=61,x===1&&(g[f++]=61)),p?(f&&p.push(String.fromCharCode.apply(String,g.slice(0,f))),p.join("")):String.fromCharCode.apply(String,g.slice(0,f))};var a="invalid encoding";i.decode=function(d,u,h){for(var p=h,g=0,f,x=0;x1)break;if((_=r[_])===undefined)throw Error(a);switch(g){case 0:f=_,g=1;break;case 1:u[h++]=f<<2|(_&48)>>4,f=_,g=2;break;case 2:u[h++]=(f&15)<<4|(_&60)>>2,f=_,g=3;break;case 3:u[h++]=(f&3)<<6|_,g=0;break}}if(g===1)throw Error(a);return h-p},i.test=function(d){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(d)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c0?0:2147483648,g,f);else if(isNaN(p))h(2143289344,g,f);else if(p>34028234663852886e22)h((x<<31|2139095040)>>>0,g,f);else if(p<11754943508222875e-54)h((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,f);else{var _=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-_)*8388608)&8388607;h((x<<31|_+127<<23|C)>>>0,g,f)}}c.writeFloatLE=d.bind(null,o),c.writeFloatBE=d.bind(null,r);function u(h,p,g){var f=h(p,g),x=(f>>31)*2+1,_=f>>>23&255,C=f&8388607;return _===255?C?NaN:x*(1/0):_===0?x*1401298464324817e-60*C:x*Math.pow(2,_-150)*(C+8388608)}c.readFloatLE=u.bind(null,s),c.readFloatBE=u.bind(null,a)}(),typeof Float64Array<"u"?function(){var d=new Float64Array([-0]),u=new Uint8Array(d.buffer),h=u[7]===128;function p(_,C,V){d[0]=_,C[V]=u[0],C[V+1]=u[1],C[V+2]=u[2],C[V+3]=u[3],C[V+4]=u[4],C[V+5]=u[5],C[V+6]=u[6],C[V+7]=u[7]}function g(_,C,V){d[0]=_,C[V]=u[7],C[V+1]=u[6],C[V+2]=u[5],C[V+3]=u[4],C[V+4]=u[3],C[V+5]=u[2],C[V+6]=u[1],C[V+7]=u[0]}c.writeDoubleLE=h?p:g,c.writeDoubleBE=h?g:p;function f(_,C){return u[0]=_[C],u[1]=_[C+1],u[2]=_[C+2],u[3]=_[C+3],u[4]=_[C+4],u[5]=_[C+5],u[6]=_[C+6],u[7]=_[C+7],d[0]}function x(_,C){return u[7]=_[C],u[6]=_[C+1],u[5]=_[C+2],u[4]=_[C+3],u[3]=_[C+4],u[2]=_[C+5],u[1]=_[C+6],u[0]=_[C+7],d[0]}c.readDoubleLE=h?f:x,c.readDoubleBE=h?x:f}():function(){function d(h,p,g,f,x,_){var C=f<0?1:0;if(C&&(f=-f),f===0)h(0,x,_+p),h(1/f>0?0:2147483648,x,_+g);else if(isNaN(f))h(0,x,_+p),h(2146959360,x,_+g);else if(f>17976931348623157e292)h(0,x,_+p),h((C<<31|2146435072)>>>0,x,_+g);else{var V;if(f<22250738585072014e-324)V=f/5e-324,h(V>>>0,x,_+p),h((C<<31|V/4294967296)>>>0,x,_+g);else{var L=Math.floor(Math.log(f)/Math.LN2);L===1024&&(L=1023),V=f*Math.pow(2,-L),h(V*4503599627370496>>>0,x,_+p),h((C<<31|L+1023<<20|V*1048576&1048575)>>>0,x,_+g)}}}c.writeDoubleLE=d.bind(null,o,0,4),c.writeDoubleBE=d.bind(null,r,4,0);function u(h,p,g,f,x){var _=h(f,x+p),C=h(f,x+g),V=(C>>31)*2+1,L=C>>>20&2047,Z=4294967296*(C&1048575)+_;return L===2047?Z?NaN:V*(1/0):L===0?V*5e-324*Z:V*Math.pow(2,L-1075)*(Z+4503599627370496)}c.readDoubleLE=u.bind(null,s,0,4),c.readDoubleBE=u.bind(null,a,4,0)}(),c}function o(c,d,u){d[u]=c&255,d[u+1]=c>>>8&255,d[u+2]=c>>>16&255,d[u+3]=c>>>24}function r(c,d,u){d[u]=c>>>24,d[u+1]=c>>>16&255,d[u+2]=c>>>8&255,d[u+3]=c&255}function s(c,d){return(c[d]|c[d+1]<<8|c[d+2]<<16|c[d+3]<<24)>>>0}function a(c,d){return(c[d]<<24|c[d+1]<<16|c[d+2]<<8|c[d+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,d=null,u=a;return function(p){if(p<1||p>c)return o(p);u+p>a&&(d=o(a),u=0);var g=r.call(d,u,u+=p);return u&7&&(u=(u|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c191&&p<224?u[h++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,u[h++]=55296+(p>>10),u[h++]=56320+(p&1023)):u[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,u)),h=0);return d?(h&&d.push(String.fromCharCode.apply(String,u.slice(0,h))),d.join("")):String.fromCharCode.apply(String,u.slice(0,h))},i.write=function(r,s,a){for(var c=a,d,u,h=0;h>6|192,s[a++]=d&63|128):(d&64512)===55296&&((u=r.charCodeAt(h+1))&64512)===56320?(d=65536+((d&1023)<<10)+(u&1023),++h,s[a++]=d>>18|240,s[a++]=d>>12&63|128,s[a++]=d>>6&63|128,s[a++]=d&63|128):(s[a++]=d>>12|224,s[a++]=d>>6&63|128,s[a++]=d&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(f,x){return RangeError("index out of range: "+f.pos+" + "+(x||1)+" > "+f.len)}function c(f){this.buf=f,this.pos=0,this.len=f.length}var d=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},u=function(){return i.Buffer?function(_){return(c.create=function(V){return i.Buffer.isBuffer(V)?new o(V):d(V)})(_)}:d};c.create=u(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function h(){var f=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(f.lo=(f.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return f;if(f.lo=(f.lo|(this.buf[this.pos]&127)<<28)>>>0,f.hi=(f.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return f;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(f.lo=(f.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return f}return f.lo=(f.lo|(this.buf[this.pos++]&127)<>>0,f}if(this.len-this.pos>4){for(;x<5;++x)if(f.hi=(f.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return f}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(f.hi=(f.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return f}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(f,x){return(f[x-4]|f[x-3]<<8|f[x-2]<<16|f[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),_=this.pos,C=this.pos+x;if(C>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(_,C);if(_===C){var V=i.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,_,C)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(f){switch(f){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(f=this.uint32()&7)!==4;)this.skipType(f);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+f+" at offset "+this.pos)}return this},c._configure=function(f){o=f,c.create=u(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[x](!1)},uint64:function(){return h.call(this)[x](!0)},sint64:function(){return h.call(this).zzDecode()[x](!1)},fixed64:function(){return g.call(this)[x](!0)},sfixed64:function(){return g.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,d,u){if(!d)throw TypeError("request must be specified");var h=this;if(!u)return i.asPromise(r,h,s,a,c,d);if(!h.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(g,f){if(g)return h.emit("error",g,s),u(g);if(f===null)return h.end(!0),undefined;if(!(f instanceof c))try{f=c[h.responseDelimited?"decodeDelimited":"decode"](f)}catch(x){return h.emit("error",x,s),u(x)}return h.emit("data",f,s),u(null,f)})}catch(p){return h.emit("error",p,s),setTimeout(function(){u(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,d){this.lo=c>>>0,this.hi=d>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(d){if(d===0)return r;var u=d<0;u&&(d=-d);var h=d>>>0,p=(d-h)/4294967296>>>0;return u&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(d){if(typeof d=="number")return o.fromNumber(d);if(i.isString(d))if(i.Long)d=i.Long.fromString(d);else return o.fromNumber(parseInt(d,10));return d.low||d.high?new o(d.low>>>0,d.high>>>0):r},o.prototype.toNumber=function(d){if(!d&&this.hi>>>31){var u=~this.lo+1>>>0,h=~this.hi>>>0;return u||(h=h+1>>>0),-(u+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(d){return i.Long?new i.Long(this.lo|0,this.hi|0,!!d):{low:this.lo|0,high:this.hi|0,unsigned:!!d}};var a=String.prototype.charCodeAt;o.fromHash=function(d){return d===s?r:new o((a.call(d,0)|a.call(d,1)<<8|a.call(d,2)<<16|a.call(d,3)<<24)>>>0,(a.call(d,4)|a.call(d,5)<<8|a.call(d,6)<<16|a.call(d,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var d=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^d)>>>0,this.lo=(this.lo<<1^d)>>>0,this},o.prototype.zzDecode=function(){var d=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^d)>>>0,this.hi=(this.hi>>>1^d)>>>0,this},o.prototype.length=function(){var d=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?u===0?d<16384?d<128?1:2:d<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:h<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var d=a[c];return d!=null&&a.hasOwnProperty(c)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var d=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(d.lo,d.hi,c):d.toNumber(!!c)};function o(s,a,c){for(var d=Object.keys(a),u=0;u-1;--h)if(c[u[h]]===1&&this[u[h]]!==undefined&&this[u[h]]!==null)return u[h]}},i.oneOfSetter=function(a){return function(c){for(var d=0;d127;)Z[G++]=L&127|128,L>>>=7;Z[G]=L}function x(L,Z){this.len=L,this.next=undefined,this.val=Z}x.prototype=Object.create(c.prototype),x.prototype.fn=f,h.prototype.uint32=function(Z){return this.len+=(this.tail=this.tail.next=new x((Z=Z>>>0)<128?1:Z<16384?2:Z<2097152?3:Z<268435456?4:5,Z)).len,this},h.prototype.int32=function(Z){return Z<0?this._push(_,10,r.fromNumber(Z)):this.uint32(Z)},h.prototype.sint32=function(Z){return this.uint32((Z<<1^Z>>31)>>>0)};function _(L,Z,G){for(;L.hi;)Z[G++]=L.lo&127|128,L.lo=(L.lo>>>7|L.hi<<25)>>>0,L.hi>>>=7;for(;L.lo>127;)Z[G++]=L.lo&127|128,L.lo=L.lo>>>7;Z[G++]=L.lo}h.prototype.uint64=function(Z){var G=r.from(Z);return this._push(_,G.length(),G)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(Z){var G=r.from(Z).zzEncode();return this._push(_,G.length(),G)},h.prototype.bool=function(Z){return this._push(g,1,Z?1:0)};function C(L,Z,G){Z[G]=L&255,Z[G+1]=L>>>8&255,Z[G+2]=L>>>16&255,Z[G+3]=L>>>24}h.prototype.fixed32=function(Z){return this._push(C,4,Z>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(Z){var G=r.from(Z);return this._push(C,4,G.lo)._push(C,4,G.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(Z){return this._push(i.float.writeFloatLE,4,Z)},h.prototype.double=function(Z){return this._push(i.float.writeDoubleLE,8,Z)};var V=i.Array.prototype.set?function(Z,G,I){G.set(Z,I)}:function(Z,G,I){for(var v=0;v>>0;if(!G)return this._push(g,1,0);if(i.isString(Z)){var I=h.alloc(G=s.length(Z));s.decode(Z,I,0),Z=I}return this.uint32(G)._push(V,G,Z)},h.prototype.string=function(Z){var G=a.length(Z);return G?this.uint32(G)._push(a.write,G,Z):this._push(g,1,0)},h.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(d,0,0),this.len=0),this},h.prototype.ldelim=function(){var Z=this.head,G=this.tail,I=this.len;return this.reset().uint32(I),I&&(this.tail.next=Z.next,this.tail=G,this.len+=I),this},h.prototype.finish=function(){for(var Z=this.head.next,G=this.constructor.alloc(this.len),I=0;Z;)Z.fn(Z.val,G,I),I+=Z.len,Z=Z.next;return G},h._configure=function(L){o=L,h.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,d,u){d.set(c,u)}:function(c,d,u){if(c.copy)c.copy(d,u,0,c.length);else for(var h=0;h>>0;return this.uint32(d),d&&this._push(r.writeBytesBuffer,d,c),this};function s(a,c,d){a.length<40?o.utf8.write(a,c,d):c.utf8Write?c.utf8Write(a,d):c.write(a,d)}r.prototype.string=function(c){var d=o.Buffer.byteLength(c);return this.uint32(d),d&&this._push(s,d,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var vSe=rd((rno,rO)=>{var sno=T(S());/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,g=c(u,h.inputOffset||0,p),f=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,x=r(g,h.pixelType||Float32Array,h.encodedMaskData,f,h.returnMask),_={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:f};return x.resultMask&&(_.maskData=x.resultMask),h.returnEncodedMask&&g.mask&&(_.encodedMaskData=g.mask.bitset?g.mask.bitset:null),h.returnFileInfo&&(_.fileInfo=s(g),h.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(g))),_};var r=function(u,h,p,g,f){var x=0,_=u.pixels.numBlocksX,C=u.pixels.numBlocksY,V=Math.floor(u.width/_),L=Math.floor(u.height/C),Z=2*u.maxZError,G=Number.MAX_VALUE,I;p=p||(u.mask?u.mask.bitset:null);var v,P;v=new h(u.width*u.height),f&&p&&(P=new Uint8Array(u.width*u.height));for(var w=new Float32Array(V*L),F,b,R=0;R<=C;R++){var E=R!==C?L:u.height%C;if(E!==0)for(var X=0;X<=_;X++){var A=X!==_?V:u.width%_;if(A!==0){var N=R*u.width*L+X*V,O=u.width-A,U=u.pixels.blocks[x],Y,k,H;U.encoding<2?(U.encoding===0?Y=U.rawData:(d(U.stuffedData,U.bitsPerPixel,U.numValidPixels,U.offset,Z,w,u.pixels.maxValue),Y=w),k=0):U.encoding===2?H=0:H=U.offset;var J;if(p)for(b=0;b>3],J<<=N&7),F=0;F>3]),J&128?(P&&(P[N]=1),I=U.encoding<2?Y[k++]:H,G=G>I?I:G,v[N++]=I):(P&&(P[N]=0),v[N++]=g),J<<=1;N+=O}else if(U.encoding<2)for(b=0;bI?I:G,v[N++]=I;N+=O}else for(G=G>H?H:G,b=0;b0){var _=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(u,h,g.mask.numBytes);var C=x.getInt16(0,!0),V=2,L=0;do{if(C>0)for(;C--;)_[L++]=x.getUint8(V++);else{var Z=x.getUint8(V++);for(C=-C;C--;)_[L++]=Z}C=x.getInt16(V,!0),V+=2}while(V0?1:0),P=I+(g.height%I>0?1:0);g.pixels.blocks=new Array(v*P);for(var w=0,F=0;F3)throw"Invalid block encoding ("+X.encoding+")";if(X.encoding===2){h++;continue}if(A!==0&&A!==2){if(A>>=6,X.offsetType=A,A===2)X.offset=x.getInt8(1),R++;else if(A===1)X.offset=x.getInt16(1,!0),R+=2;else if(A===0)X.offset=x.getFloat32(1,!0),R+=4;else throw"Invalid block offset type";if(X.encoding===1)if(A=x.getUint8(R),R++,X.bitsPerPixel=A&63,A>>=6,X.numValidPixelsType=A,A===2)X.numValidPixels=x.getUint8(R),R++;else if(A===1)X.numValidPixels=x.getUint16(R,!0),R+=2;else if(A===0)X.numValidPixels=x.getUint32(R,!0),R+=4;else throw"Invalid valid pixel count type"}if(h+=R,X.encoding!==3){var N,O;if(X.encoding===0){var U=(g.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";N=new ArrayBuffer(U*4),O=new Uint8Array(N),O.set(new Uint8Array(u,h,U*4));var Y=new Float32Array(N);X.rawData=Y,h+=U*4}else if(X.encoding===1){var k=Math.ceil(X.numValidPixels*X.bitsPerPixel/8),H=Math.ceil(k/4);N=new ArrayBuffer(H*4),O=new Uint8Array(N),O.set(new Uint8Array(u,h,k)),X.stuffedData=new Uint32Array(N),h+=k}}}return g.eofOffset=h,g},d=function(u,h,p,g,f,x,_){var C=(1<=h)G=I>>>Z-h&C,Z-=h;else{var w=h-Z;G=(I&C)<>>Z}x[L]=G=u?(Z=G>>>L-u&_,L-=u):(I=u-L,Z=(G&_)<>>L),d[V]=p[Z];else for(v=Math.ceil((x-g)/f),V=0;V=u?(Z=G>>>L-u&_,L-=u):(I=u-L,Z=(G&_)<>>L),d[V]=Z=d?(L=Z>>>V-d&f,V-=d):(C=d-V,L=(Z&f)<>>V),G[_]=L=u?(G=I>>>Z&_,L-=u,Z+=u):(v=u-L,G=I>>>Z&_,I=c[C++],L=32-v,G|=(I&(1<=u?(G=I>>>Z&_,L-=u,Z+=u):(v=u-L,G=I>>>Z&_,I=c[C++],L=32-v,G|=(I&(1<=d?(L=G>>>Z&f,V-=d,Z+=d):(C=d-V,L=G>>>Z&f,G=c[x++],V=32-C,L|=(G&(1<=u?(_=C>>>x-u&p,x-=u):(V=u-x,_=(C&p)<>>x),d[f]=_;return d},originalUnstuff2:function(c,d,u,h){var p=(1<=u?(C=V>>>_&p,x-=u,_+=u):(L=u-x,C=V>>>_&p,V=c[g++],x=32-L,C|=(V&(1<=359?359:p;p-=f;do d+=c[g++]<<8,u+=d+=c[g++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return h&1&&(u+=d+=c[g]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(c,d){var u=d.ptr,h=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,h),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var g=new DataView(c,u,8),f=g.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=g.getUint32(4,!0),u+=4),g=new DataView(c,u,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),u+=8,f>=4?(p.numDims=g.getUint32(8,!0),u+=4):p.numDims=1,g=new DataView(c,u,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var x,_;if(f>=3&&(_=f>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,u-_,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,d){var u=d.headerInfo,h=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),g=this.readSubArray(c,d.ptr,h,p),f=this.readSubArray(c,d.ptr+p,h,p);d.ptr+=2*p;var x,_=!0;for(x=0;x0){_=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,x.numBytes);var V=f.getInt16(0,!0),L=2,Z=0,G=0;do{if(V>0)for(;V--;)_[Z++]=f.getUint8(L++);else for(G=f.getUint8(L++),V=-V;V--;)_[Z++]=G;V=f.getInt16(L,!0),L+=2}while(L>3],I<<=v&7):I=_[v>>3],I&128&&(C[v]=1);d.pixels.resultMask=C,x.bitset=_,u+=x.numBytes}return d.ptr=u,d.mask=x,!0},readDataOneSweep:function(c,d,u){var h=d.ptr,p=d.headerInfo,g=p.numDims,f=p.width*p.height,x=p.imageType,_=p.numValidPixel*r.getDataTypeSize(x)*g,C,V=d.pixels.resultMask;if(u===Uint8Array)C=new Uint8Array(c,h,_);else{var L=new ArrayBuffer(_),Z=new Uint8Array(L);Z.set(new Uint8Array(c,h,_)),C=new u(L)}if(C.length===f*g)d.pixels.resultPixels=C;else{d.pixels.resultPixels=new u(f*g);var G=0,I=0,v=0,P=0;if(g>1)for(v=0;v=x)return!1;var _=new Uint32Array(x-f);r.decodeBits(c,d,_);var C=[],V,L,Z,G;for(V=f;V0&&(C[L].second=R<>>32-G,32-b>=G?(b+=G,b===32&&(b=0,E++,R=F[E])):(b+=G-32,E++,R=F[E],C[L].second|=R>>>32-b));var X=0,A=0,N=new s;for(V=0;V=u?A=u:A=X,X>=30&&console.log("WARning, large NUM LUT BITS IS "+X);var O=[],U,Y,k,H,J,te;for(V=f;V0)if(U=[G,L],G<=A)for(Y=C[L].second<=0;H--)J=Y>>>H&1,J?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),H===0&&!te.val&&(te.val=U[1]);return{decodeLut:O,numBitsLUTQick:A,numBitsLUT:X,tree:N,stuffedData:F,srcPtr:E,bitPos:b}},readHuffman:function(c,d,u){var h=d.headerInfo,p=h.numDims,g=d.headerInfo.height,f=d.headerInfo.width,x=f*g,_=this.readHuffmanTree(c,d),C=_.decodeLut,V=_.tree,L=_.stuffedData,Z=_.srcPtr,G=_.bitPos,I=_.numBitsLUTQick,v=_.numBitsLUT,P=d.headerInfo.imageType===0?128:0,w,F,b,R=d.pixels.resultMask,E,X,A,N,O,U,Y,k=0;G>0&&(Z++,G=0);var H=L[Z],J=d.encodeMode===1,te=new u(x*p),z=te,j;for(j=0;j1&&(z=new u(te.buffer,x*j,x),k=0),d.headerInfo.numValidPixel===f*g)for(U=0,N=0;N>>32-I,X=E,32-G>>64-G-I,X=E),C[X])F=C[X][1],G+=C[X][0];else for(E=H<>>32-v,X=E,32-G>>64-G-v,X=E),w=V,Y=0;Y>>v-Y-1&1,w=A?w.right:w.left,!(w.left||w.right)){F=w.val,G=G+Y+1;break}G>=32&&(G-=32,Z++,H=L[Z]),b=F-P,J?(O>0?b+=k:N>0?b+=z[U-f]:b+=k,b&=255,z[U]=b,k=b):z[U]=b}else for(U=0,N=0;N>>32-I,X=E,32-G>>64-G-I,X=E),C[X])F=C[X][1],G+=C[X][0];else for(E=H<>>32-v,X=E,32-G>>64-G-v,X=E),w=V,Y=0;Y>>v-Y-1&1,w=A?w.right:w.left,!(w.left||w.right)){F=w.val,G=G+Y+1;break}G>=32&&(G-=32,Z++,H=L[Z]),b=F-P,J?(O>0&&R[U-1]?b+=k:N>0&&R[U-f]?b+=z[U-f]:b+=k,b&=255,z[U]=b,k=b):z[U]=b}d.ptr=d.ptr+(Z+1)*4+(G>0?4:0)}d.pixels.resultPixels=te},decodeBits:function(c,d,u,h,p){{var g=d.headerInfo,f=g.fileVersion,x=0,_=new DataView(c,d.ptr,5),C=_.getUint8(0);x++;var V=C>>6,L=V===0?4:3-V,Z=(C&32)>0,G=C&31,I=0;if(L===1)I=_.getUint8(x),x++;else if(L===2)I=_.getUint16(x,!0),x+=2;else if(L===4)I=_.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var v=2*g.maxZError,P,w,F,b,R,E,X,A,N,O,U=g.numDims>1?g.maxValues[p]:g.zMax;if(Z){for(d.counter.lut++,A=_.getUint8(x),N=G,x++,b=Math.ceil((A-1)*G/8),R=Math.ceil(b/4),w=new ArrayBuffer(R*4),F=new Uint8Array(w),d.ptr+=x,F.set(new Uint8Array(c,d.ptr,b)),X=new Uint32Array(w),d.ptr+=b,O=0;A-1>>>O;)O++;b=Math.ceil(I*O/8),R=Math.ceil(b/4),w=new ArrayBuffer(R*4),F=new Uint8Array(w),F.set(new Uint8Array(c,d.ptr,b)),P=new Uint32Array(w),d.ptr+=b,f>=3?E=o.unstuffLUT2(X,G,A-1,h,v,U):E=o.unstuffLUT(X,G,A-1,h,v,U),f>=3?o.unstuff2(P,u,O,I,E):o.unstuff(P,u,O,I,E)}else d.counter.bitstuffer++,O=G,d.ptr+=x,O>0&&(b=Math.ceil(I*O/8),R=Math.ceil(b/4),w=new ArrayBuffer(R*4),F=new Uint8Array(w),F.set(new Uint8Array(c,d.ptr,b)),P=new Uint32Array(w),d.ptr+=b,f>=3?h==null?o.originalUnstuff2(P,u,O,I):o.unstuff2(P,u,O,I,!1,h,v,U):h==null?o.originalUnstuff(P,u,O,I):o.unstuff(P,u,O,I,!1,h,v,U))}},readTiles:function(c,d,u){var h=d.headerInfo,p=h.width,g=h.height,f=h.microBlockSize,x=h.imageType,_=r.getDataTypeSize(x),C=Math.ceil(p/f),V=Math.ceil(g/f);d.pixels.numBlocksY=V,d.pixels.numBlocksX=C,d.pixels.ptr=0;var L=0,Z=0,G=0,I=0,v=0,P=0,w=0,F=0,b=0,R=0,E=0,X=0,A=0,N=0,O=0,U=0,Y,k,H,J,te,z,j=new u(f*f),ee=g%f||f,fe=p%f||f,Te,de,xe=h.numDims,Se,Ie=d.pixels.resultMask,Le=d.pixels.resultPixels;for(G=0;G1&&(Le=new u(d.pixels.resultPixels.buffer,p*g*Se*_,p*g)),w=c.byteLength-d.ptr,Y=new DataView(c,d.ptr,Math.min(10,w)),k={},U=0,F=Y.getUint8(0),U++,b=F>>6&255,R=F>>2&15,R!==(I*f>>3&15))throw"integrity issue";if(z=F&3,z>3)throw d.ptr+=U,"Invalid block encoding ("+z+")";if(z===2){d.counter.constant++,d.ptr+=U;continue}else if(z===0){if(d.counter.uncompressed++,d.ptr+=U,A=v*P*_,N=c.byteLength-d.ptr,A=A1)for(g=0;g=-128&&d<=127;break;case 1:u=d>=0&&d<=255;break;case 2:u=d>=-32768&&d<=32767;break;case 3:u=d>=0&&d<=65536;break;case 4:u=d>=-2147483648&&d<=2147483647;break;case 5:u=d>=0&&d<=4294967296;break;case 6:u=d>=-34027999387901484e22&&d<=34027999387901484e22;break;case 7:u=d>=5e-324&&d<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(c){var d=0;switch(c){case 0:case 1:d=1;break;case 2:case 3:d=2;break;case 4:case 5:case 6:d=4;break;case 7:d=8;break;default:d=c}return d},getDataTypeUsed:function(c,d){var u=c;switch(c){case 2:case 4:u=c-d;break;case 3:case 5:u=c-2*d;break;case 6:d===0?u=c:d===1?u=2:u=1;break;case 7:d===0?u=c:u=c-2*d+1;break;default:u=c;break}return u},getOnePixel:function(c,d,u,h){var p=0;switch(u){case 0:p=h.getInt8(d);break;case 1:p=h.getUint8(d);break;case 2:p=h.getInt16(d,!0);break;case 3:p=h.getUint16(d,!0);break;case 4:p=h.getInt32(d,!0);break;case 5:p=h.getUInt32(d,!0);break;case 6:p=h.getFloat32(d,!0);break;case 7:p=h.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,d,u){this.val=c,this.left=d,this.right=u},a={decode:function(c,d){d=d||{};var u=d.noDataValue,h=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,f=g.fileVersion,x=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var _=g.width*g.height;if(p.pixels.resultPixels=new x(_*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),V=C.getUint8(0);if(p.ptr++,V)r.readDataOneSweep(c,p,x);else if(f>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var L=C.getUint8(1);if(p.ptr++,p.encodeMode=L,L>2||f<4&&L>1)throw"Invalid Huffman flag "+L;L?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var Z;d.inputOffset?(Z=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(Z)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(Z=p.headerInfo.blobSize-p.ptr,Math.abs(Z)>=1&&(p.eofOffset=p.headerInfo.blobSize));var G={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,u)){var I=p.pixels.resultMask;for(h=0;h<_;h++)I[h]||(G.pixelData[h]=u);G.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(G.fileInfo=r.formatFileInfo(p)),G}},getBandCount:function(c){var d=0,u=0,h={};for(h.ptr=0,h.pixels={};u1&&V.fileInfo.mask&&V.fileInfo.mask.numBytes>0&&f.push(V.maskData),h++,C.pixels.push(V.pixelData),C.statistics.push({minValue:V.minValue,maxValue:V.maxValue,noDataValue:V.noDataValue,dimStats:V.dimStats})}var L,Z,G;if(u>1&&f.length>1){for(G=C.width*C.height,C.bandMasks=f,_=new Uint8Array(G),_.set(f[0]),L=1;L{var OEo=T(S());SCe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrX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nzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZG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sc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var LCe=rd((YEo,VCe)=>{var HEo=T(S()),{webm:G1t,mp4:E1t}=CCe(),B6=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,O6=()=>"wakeLock"in navigator,Y6=class{constructor(){if(this.enabled=!1,O6()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else B6()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",G1t),this._addSourceToVideo(this.noSleepVideo,"mp4",E1t),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return O6()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):B6()?(this.disable(),console.warn(` NoSleep enabled for older iOS devices. This can interrupt active or long-running network requests from completing successfully. See https://github.com/richtr/NoSleep.js/issues/15 for more details. `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){O6()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):B6()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};SCe.exports=Y6});var K1t={};ACe(K1t,{AlphaMode:()=>gf,AlphaPipelineStage:()=>UW,AnchorPointDirect:()=>YX,AnchorPointIndirect:()=>HX,Animation:()=>q9,AnimationViewModel:()=>$9,Appearance:()=>no,ApproximateTerrainHeights:()=>li,ArcGISTiledElevationTerrainProvider:()=>M8,ArcGisBaseMapType:()=>Ph,ArcGisMapServerImageryProvider:()=>r0,ArcGisMapService:()=>Kd,ArcType:()=>tn,ArticulationStageType:()=>mc,AssociativeArray:()=>Zt,Atmosphere:()=>g_,AtmospherePipelineStage:()=>TW,AttributeCompression:()=>wn,AttributeType:()=>sn,AutoExposure:()=>uA,AutomaticUniforms:()=>bp,Axis:()=>Wo,AxisAlignedBoundingBox:()=>H0,B3dmLoader:()=>rW,B3dmParser:()=>nW,BaseLayerPicker:()=>oM,BaseLayerPickerViewModel:()=>iM,BatchTable:()=>Rx,BatchTableHierarchy:()=>Jx,BatchTexture:()=>Kc,BatchTexturePipelineStage:()=>DW,Billboard:()=>co,BillboardCollection:()=>Rd,BillboardGraphics:()=>ic,BillboardVisualizer:()=>DE,BingMapsGeocoderService:()=>k8,BingMapsImageryProvider:()=>Nw,BingMapsStyle:()=>PV,BlendEquation:()=>Ea,BlendFunction:()=>Co,BlendOption:()=>Lo,BlendingState:()=>mn,BoundingRectangle:()=>ze,BoundingSphere:()=>le,BoundingSphereState:()=>dt,BoundingVolumeSemantics:()=>m_,BoxEmitter:()=>I7,BoxGeometry:()=>Za,BoxGeometryUpdater:()=>KI,BoxGraphics:()=>Px,BoxOutlineGeometry:()=>wm,BrdfLutGenerator:()=>pF,Buffer:()=>xt,BufferLoader:()=>t_,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>HW,CallbackPositionProperty:()=>JI,CallbackProperty:()=>Um,Camera:()=>ro,CameraEventAggregator:()=>yA,CameraEventType:()=>Fi,CameraFlightPath:()=>gF,Cartesian2:()=>D,Cartesian3:()=>m,Cartesian4:()=>se,Cartographic:()=>he,CartographicGeocoderService:()=>D8,CatmullRomSpline:()=>B8,Cesium3DContentGroup:()=>Kx,Cesium3DTile:()=>Ku,Cesium3DTileBatchTable:()=>Op,Cesium3DTileColorBlendMode:()=>El,Cesium3DTileContent:()=>X7,Cesium3DTileContentFactory:()=>X_,Cesium3DTileContentState:()=>Oo,Cesium3DTileContentType:()=>Ls,Cesium3DTileFeature:()=>ks,Cesium3DTileFeatureTable:()=>eh,Cesium3DTileOptimizationHint:()=>Du,Cesium3DTileOptimizations:()=>C2,Cesium3DTilePass:()=>Fo,Cesium3DTilePassState:()=>fm,Cesium3DTilePointFeature:()=>gb,Cesium3DTileRefine:()=>Do,Cesium3DTileStyle:()=>bS,Cesium3DTileStyleEngine:()=>E2,Cesium3DTilesInspector:()=>dM,Cesium3DTilesInspectorViewModel:()=>lM,Cesium3DTilesVoxelProvider:()=>W7,Cesium3DTileset:()=>bs,Cesium3DTilesetBaseTraversal:()=>w2,Cesium3DTilesetCache:()=>R2,Cesium3DTilesetGraphics:()=>kx,Cesium3DTilesetHeatmap:()=>Z2,Cesium3DTilesetMetadata:()=>U_,Cesium3DTilesetMostDetailedTraversal:()=>W2,Cesium3DTilesetSkipTraversal:()=>M2,Cesium3DTilesetStatistics:()=>Ib,Cesium3DTilesetTraversal:()=>Hs,Cesium3DTilesetVisualizer:()=>N2,CesiumInspector:()=>nM,CesiumInspectorViewModel:()=>tM,CesiumTerrainProvider:()=>lS,CesiumWidget:()=>d9,Check:()=>xo,CheckerboardMaterialProperty:()=>_1,CircleEmitter:()=>V9,CircleGeometry:()=>J8,CircleOutlineGeometry:()=>Q8,ClassificationModelDrawCommand:()=>MP,ClassificationPipelineStage:()=>BW,ClassificationPrimitive:()=>cC,ClassificationType:()=>kn,ClearCommand:()=>$n,ClippingPlane:()=>h_,ClippingPlaneCollection:()=>fs,ClippingPolygon:()=>FC,ClippingPolygonCollection:()=>jm,Clock:()=>ph,ClockRange:()=>Or,ClockStep:()=>fo,ClockViewModel:()=>K9,CloudCollection:()=>M7,CloudType:()=>LL,Color:()=>B,ColorBlendMode:()=>uc,ColorGeometryInstanceAttribute:()=>Ht,ColorMaterialProperty:()=>Bt,Command:()=>E6,ComponentDatatype:()=>Q,Composite3DTileContent:()=>oX,CompositeEntityCollection:()=>_K,CompositeMaterialProperty:()=>S1,CompositePositionProperty:()=>ma,CompositeProperty:()=>gc,CompressedTextureBuffer:()=>oR,ComputeCommand:()=>Pc,ComputeEngine:()=>nR,ConditionsExpression:()=>_9,ConeEmitter:()=>k7,ConstantPositionProperty:()=>Uc,ConstantProperty:()=>Jn,ConstantSpline:()=>lW,ContentMetadata:()=>f2,Context:()=>QG,ContextLimits:()=>At,CoplanarPolygonGeometry:()=>Sv,CoplanarPolygonGeometryLibrary:()=>Vb,CoplanarPolygonOutlineGeometry:()=>zu,CornerType:()=>Wi,CorrelationGroup:()=>zX,CorridorGeometry:()=>z_,CorridorGeometryLibrary:()=>Di,CorridorGeometryUpdater:()=>K2,CorridorGraphics:()=>wx,CorridorOutlineGeometry:()=>z2,Credit:()=>Ct,CreditDisplay:()=>TF,CubeMap:()=>xr,CubeMapFace:()=>fR,CubicRealPolynomial:()=>ux,CullFace:()=>yi,CullingVolume:()=>hs,CumulusCloud:()=>au,CustomDataSource:()=>$2,CustomHeightmapTerrainProvider:()=>j8,CustomShader:()=>tS,CustomShaderMode:()=>fb,CustomShaderPipelineStage:()=>$W,CustomShaderTranslucencyMode:()=>Zg,CylinderGeometry:()=>ev,CylinderGeometryLibrary:()=>K_,CylinderGeometryUpdater:()=>nv,CylinderGraphics:()=>Fx,CylinderOutlineGeometry:()=>tv,CzmlDataSource:()=>mv,DataSource:()=>Br,DataSourceClock:()=>bh,DataSourceCollection:()=>hv,DataSourceDisplay:()=>jv,DebugAppearance:()=>U7,DebugCameraPrimitive:()=>$f,DebugInspector:()=>RA,DebugModelMatrixPrimitive:()=>R9,DefaultProxy:()=>q8,DepthFunction:()=>oc,DepthPlane:()=>ZF,DequantizationPipelineStage:()=>tP,DerivedCommand:()=>ep,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>GF,DirectionalLight:()=>D7,DiscardEmptyTileImagePolicy:()=>vV,DiscardMissingTileImagePolicy:()=>Aw,DistanceDisplayCondition:()=>Ft,DistanceDisplayConditionGeometryInstanceAttribute:()=>Nn,DoubleEndedPriorityQueue:()=>$T,DoublyLinkedList:()=>L2,DracoLoader:()=>jp,DrawCommand:()=>qe,DynamicAtmosphereLightingType:()=>nb,DynamicEnvironmentMapManager:()=>ib,DynamicGeometryBatch:()=>tT,DynamicGeometryUpdater:()=>ti,EarthOrientationParameters:()=>KL,EarthOrientationParametersSample:()=>E0,EasingFunction:()=>Hr,EllipseGeometry:()=>ol,EllipseGeometryLibrary:()=>Dl,EllipseGeometryUpdater:()=>pv,EllipseGraphics:()=>Ax,EllipseOutlineGeometry:()=>Ad,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>Pp,EllipsoidGeometry:()=>Ks,EllipsoidGeometryUpdater:()=>gv,EllipsoidGraphics:()=>Mx,EllipsoidOutlineGeometry:()=>Gd,EllipsoidPrimitive:()=>dF,EllipsoidRhumbLine:()=>Ia,EllipsoidSurfaceAppearance:()=>B7,EllipsoidTangentPlane:()=>Qr,EllipsoidTerrainProvider:()=>Jf,EllipsoidalOccluder:()=>Fb,Empty3DTileContent:()=>a1,EncodedCartesian3:()=>On,Entity:()=>$o,EntityCluster:()=>Xd,EntityCollection:()=>zs,EntityView:()=>$v,Event:()=>be,EventHelper:()=>dr,Expression:()=>Eu,ExpressionNodeType:()=>bt,ExtrapolationType:()=>Pd,FeatureDetection:()=>Ot,FeatureIdPipelineStage:()=>Rg,Fog:()=>EF,ForEach:()=>We,FrameRateMonitor:()=>E9,FrameState:()=>IF,Framebuffer:()=>Wr,FramebufferManager:()=>hi,FrustumCommands:()=>wF,FrustumGeometry:()=>WT,FrustumOutlineGeometry:()=>VF,Fullscreen:()=>br,FullscreenButton:()=>mM,FullscreenButtonViewModel:()=>uM,GeoJsonDataSource:()=>nw,GeoJsonLoader:()=>sW,GeocodeType:()=>Ny,Geocoder:()=>fM,GeocoderService:()=>_L,GeocoderViewModel:()=>hM,GeographicProjection:()=>Zi,GeographicTilingScheme:()=>zi,Geometry:()=>lt,Geometry3DTileContent:()=>sX,GeometryAttribute:()=>Ge,GeometryAttributes:()=>hn,GeometryFactory:()=>$8,GeometryInstance:()=>Gt,GeometryInstanceAttribute:()=>rc,GeometryOffsetAttribute:()=>cn,GeometryPipeline:()=>Fn,GeometryPipelineStage:()=>rP,GeometryType:()=>gu,GeometryUpdater:()=>ni,GeometryUpdaterSet:()=>mT,GeometryVisualizer:()=>Nv,GetFeatureInfoFormat:()=>GT,Globe:()=>sF,GlobeDepth:()=>FF,GlobeSurfaceShaderSet:()=>Fw,GlobeSurfaceTile:()=>um,GlobeSurfaceTileProvider:()=>Qw,GlobeTranslucency:()=>jw,GlobeTranslucencyFramebuffer:()=>AF,GlobeTranslucencyState:()=>XF,GltfBufferViewLoader:()=>_C,GltfDracoLoader:()=>TC,GltfGpmLoader:()=>JX,GltfGpmLocal:()=>MC,GltfImageLoader:()=>SC,GltfIndexBufferLoader:()=>CC,GltfJsonLoader:()=>LC,GltfLoader:()=>sb,GltfLoaderUtil:()=>Pl,GltfMeshPrimitiveGpmLoader:()=>$X,GltfStructuralMetadataLoader:()=>BX,GltfTextureLoader:()=>RC,GltfVertexBufferLoader:()=>ZC,GoogleEarthEnterpriseImageryProvider:()=>Y7,GoogleEarthEnterpriseMapsProvider:()=>Dw,GoogleEarthEnterpriseMetadata:()=>C0,GoogleEarthEnterpriseTerrainData:()=>TL,GoogleEarthEnterpriseTerrainProvider:()=>a7,GoogleEarthEnterpriseTileInformation:()=>h9,GoogleGeocoderService:()=>l7,GoogleMaps:()=>uS,GpxDataSource:()=>sw,GregorianDate:()=>yp,GridImageryProvider:()=>H7,GridMaterialProperty:()=>W1,GroundGeometryUpdater:()=>Yn,GroundPolylineGeometry:()=>Ix,GroundPolylinePrimitive:()=>Fm,GroundPrimitive:()=>Nc,GroupMetadata:()=>g1,HeadingPitchRange:()=>rm,HeadingPitchRoll:()=>Va,Heap:()=>OL,HeightReference:()=>Je,HeightmapEncoding:()=>cm,HeightmapTerrainData:()=>Na,HeightmapTessellator:()=>EV,HermitePolynomialApproximation:()=>iv,HermiteSpline:()=>Cg,HilbertOrder:()=>bC,HomeButton:()=>bM,HomeButtonViewModel:()=>pM,HorizontalOrigin:()=>gi,I3SBuildingSceneLayerExplorer:()=>M6,I3SBuildingSceneLayerExplorerViewModel:()=>gM,I3SDataProvider:()=>Hh,I3SDecoder:()=>I9,I3SFeature:()=>X9,I3SField:()=>W9,I3SGeometry:()=>RL,I3SLayer:()=>TS,I3SNode:()=>ZL,I3SStatistics:()=>w9,I3SSublayer:()=>A9,I3SSymbology:()=>v9,I3dmLoader:()=>cW,I3dmParser:()=>aW,ITwinData:()=>j7,ITwinPlatform:()=>su,Iau2000Orientation:()=>cF,Iau2006XysData:()=>JL,Iau2006XysSample:()=>ax,IauOrientationAxes:()=>lF,IauOrientationParameters:()=>aF,ImageBasedLighting:()=>zx,ImageBasedLightingPipelineStage:()=>CW,ImageMaterialProperty:()=>J0,Imagery:()=>kV,ImageryLayer:()=>Ua,ImageryLayerCollection:()=>qw,ImageryLayerFeatureInfo:()=>Wh,ImageryProvider:()=>ll,ImageryState:()=>ai,Implicit3DTileContent:()=>IC,ImplicitAvailabilityBitstream:()=>yC,ImplicitMetadataView:()=>xC,ImplicitSubdivisionScheme:()=>$r,ImplicitSubtree:()=>d_,ImplicitSubtreeCache:()=>S9,ImplicitSubtreeMetadata:()=>aX,ImplicitTileCoordinates:()=>O_,ImplicitTileset:()=>B_,IndexDatatype:()=>Ae,InfoBox:()=>xM,InfoBoxViewModel:()=>yM,InspectorShared:()=>Oa,InstanceAttributeSemantic:()=>ts,InstancingPipelineStage:()=>AW,InterpolationAlgorithm:()=>d7,InterpolationType:()=>qm,Intersect:()=>zt,IntersectionTests:()=>jn,Intersections2D:()=>T0,Interval:()=>Ra,InvertClassification:()=>jV,Ion:()=>Om,IonGeocodeProviderType:()=>V0,IonGeocoderService:()=>mS,IonImageryProvider:()=>s0,IonResource:()=>gd,IonWorldImageryStyle:()=>a0,Iso8601:()=>Oe,JobScheduler:()=>WF,JobType:()=>Pa,JsonMetadataTable:()=>ob,JulianDate:()=>q,KTX2Transcoder:()=>rR,KeyboardEventModifier:()=>ta,KeyframeNode:()=>$i,KmlCamera:()=>aw,KmlDataSource:()=>Pw,KmlLookAt:()=>Rw,KmlTour:()=>Zw,KmlTourFlyTo:()=>Ew,KmlTourWait:()=>Iw,Label:()=>vg,LabelCollection:()=>Cf,LabelGraphics:()=>Mm,LabelStyle:()=>Bo,LabelVisualizer:()=>kv,LagrangePolynomialApproximation:()=>ov,LeapSecond:()=>Yi,Light:()=>q7,LightingModel:()=>_f,LightingPipelineStage:()=>aP,LinearApproximation:()=>Q_,LinearSpline:()=>Sg,ManagedArray:()=>zc,MapMode2D:()=>jl,MapProjection:()=>h7,MapboxImageryProvider:()=>Bw,MapboxStyleImageryProvider:()=>$7,Material:()=>Hi,MaterialAppearance:()=>so,MaterialPipelineStage:()=>lP,MaterialProperty:()=>qo,Math:()=>W,Matrix2:()=>Gi,Matrix3:()=>$,Matrix4:()=>M,Megatexture:()=>iL,MeshPrimitiveGpmLocal:()=>qX,MetadataClass:()=>Km,MetadataClassProperty:()=>ff,MetadataComponentType:()=>Ut,MetadataEntity:()=>Mn,MetadataEnum:()=>ZX,MetadataEnumValue:()=>RX,MetadataPicking:()=>PF,MetadataPickingPipelineStage:()=>Cd,MetadataPipelineStage:()=>Pu,MetadataSchema:()=>Td,MetadataSchemaLoader:()=>GC,MetadataSemantic:()=>u_,MetadataTable:()=>Xl,MetadataTableProperty:()=>lX,MetadataType:()=>ut,MipmapHint:()=>sf,Model:()=>ih,Model3DTileContent:()=>Ld,ModelAlphaOptions:()=>ZP,ModelAnimation:()=>hW,ModelAnimationChannel:()=>mW,ModelAnimationCollection:()=>fW,ModelAnimationLoop:()=>wl,ModelAnimationState:()=>th,ModelArticulation:()=>LW,ModelArticulationStage:()=>VW,ModelClippingPlanesPipelineStage:()=>GW,ModelClippingPolygonsPipelineStage:()=>XW,ModelColorPipelineStage:()=>Lg,ModelComponents:()=>Tn,ModelDrawCommand:()=>NP,ModelDrawCommands:()=>DP,ModelFeature:()=>pW,ModelFeatureTable:()=>gW,ModelGraphics:()=>Mp,ModelLightingOptions:()=>wP,ModelMatrixUpdateStage:()=>MW,ModelNode:()=>WW,ModelRenderResources:()=>GP,ModelRuntimeNode:()=>kW,ModelRuntimePrimitive:()=>LP,ModelSceneGraph:()=>BP,ModelSilhouettePipelineStage:()=>XP,ModelSkin:()=>RP,ModelSplitterPipelineStage:()=>PP,ModelStatistics:()=>OP,ModelType:()=>cr,ModelUtility:()=>jt,ModelVisualizer:()=>Uv,Moon:()=>mF,MorphTargetsPipelineStage:()=>uP,MorphWeightSpline:()=>f7,MortonOrder:()=>kg,Multiple3DTileContent:()=>g2,MultisampleFramebuffer:()=>jG,NavigationHelpButton:()=>TM,NavigationHelpButtonViewModel:()=>_M,NearFarScalar:()=>kt,NeverTileDiscardPolicy:()=>t6,NodeRenderResources:()=>vP,NodeStatisticsPipelineStage:()=>NW,NodeTransformationProperty:()=>Nx,OIT:()=>MF,Occluder:()=>hF,OffsetGeometryInstanceAttribute:()=>qi,OpenCageGeocoderService:()=>b7,OpenStreetMapImageryProvider:()=>R0,OrderedGroundPrimitiveCollection:()=>fv,OrientedBoundingBox:()=>Gn,OrthographicFrustum:()=>an,OrthographicOffCenterFrustum:()=>Pr,Packable:()=>g7,PackableForInterpolation:()=>y7,Particle:()=>IL,ParticleBurst:()=>i6,ParticleEmitter:()=>o6,ParticleSystem:()=>r6,Pass:()=>Ee,PassState:()=>nc,PathGraphics:()=>Np,PathVisualizer:()=>Bv,PeliasGeocoderService:()=>p9,PerInstanceColorAppearance:()=>dn,PerformanceDisplay:()=>u0,PerformanceWatchdog:()=>CM,PerformanceWatchdogViewModel:()=>SM,PerspectiveFrustum:()=>Ri,PerspectiveOffCenterFrustum:()=>ul,PickDepth:()=>vF,PickDepthFramebuffer:()=>kF,PickFramebuffer:()=>DF,PickedMetadataInfo:()=>qA,Picking:()=>HF,PickingPipelineStage:()=>mP,PinBuilder:()=>jb,PixelDatatype:()=>je,PixelFormat:()=>nt,Plane:()=>ln,PlaneGeometry:()=>yv,PlaneGeometryUpdater:()=>_v,PlaneGraphics:()=>UI,PlaneOutlineGeometry:()=>xv,PntsLoader:()=>HP,PntsParser:()=>L_,PointCloud:()=>c9,PointCloudEyeDomeLighting:()=>ab,PointCloudShading:()=>xf,PointCloudStylingPipelineStage:()=>fP,PointGraphics:()=>Ux,PointPrimitive:()=>Zs,PointPrimitiveCollection:()=>Z1,PointVisualizer:()=>Yv,PolygonGeometry:()=>tb,PolygonGeometryLibrary:()=>Dn,PolygonGeometryUpdater:()=>Vv,PolygonGraphics:()=>Nm,PolygonHierarchy:()=>Xa,PolygonOutlineGeometry:()=>Cv,PolygonPipeline:()=>ri,Polyline:()=>Nu,PolylineArrowMaterialProperty:()=>v1,PolylineCollection:()=>sh,PolylineColorAppearance:()=>jr,PolylineDashMaterialProperty:()=>F1,PolylineGeometry:()=>Qb,PolylineGeometryUpdater:()=>Kv,PolylineGlowMaterialProperty:()=>M1,PolylineGraphics:()=>sc,PolylineMaterialAppearance:()=>aa,PolylineOutlineMaterialProperty:()=>zg,PolylinePipeline:()=>Xi,PolylineVisualizer:()=>Qv,PolylineVolumeGeometry:()=>Zv,PolylineVolumeGeometryLibrary:()=>uh,PolylineVolumeGeometryUpdater:()=>Xv,PolylineVolumeGraphics:()=>Dx,PolylineVolumeOutlineGeometry:()=>Iv,PositionProperty:()=>Am,PositionPropertyArray:()=>kb,PostProcessStage:()=>mo,PostProcessStageCollection:()=>fA,PostProcessStageComposite:()=>$l,PostProcessStageLibrary:()=>qd,PostProcessStageSampleMode:()=>jd,PostProcessStageTextureCache:()=>OT,PpeMetadata:()=>jX,PpeSource:()=>L6,PpeTexture:()=>QX,Primitive:()=>In,PrimitiveCollection:()=>Ul,PrimitiveLoadPlan:()=>__,PrimitiveOutlineGenerator:()=>x_,PrimitiveOutlinePipelineStage:()=>gP,PrimitivePipeline:()=>Zx,PrimitiveRenderResources:()=>FP,PrimitiveState:()=>Sr,PrimitiveStatisticsPipelineStage:()=>yP,PrimitiveType:()=>we,ProjectionPicker:()=>LM,ProjectionPickerViewModel:()=>VM,Property:()=>K,PropertyArray:()=>k1,PropertyAttribute:()=>y_,PropertyAttributeProperty:()=>NX,PropertyBag:()=>Zl,PropertyTable:()=>Qc,PropertyTexture:()=>rb,PropertyTextureProperty:()=>MX,ProviderViewModel:()=>as,Proxy:()=>x7,QuadraticRealPolynomial:()=>vc,QuadtreeOccluders:()=>$w,QuadtreePrimitive:()=>rF,QuadtreeTile:()=>eF,QuadtreeTileLoadState:()=>qs,QuadtreeTileProvider:()=>s6,QuantizedMeshTerrainData:()=>cS,QuarticRealPolynomial:()=>cR,Quaternion:()=>ve,QuaternionSpline:()=>uW,Queue:()=>pg,Ray:()=>bn,Rectangle:()=>ce,RectangleCollisionChecker:()=>fT,RectangleGeometry:()=>sT,RectangleGeometryLibrary:()=>Rs,RectangleGeometryUpdater:()=>Wv,RectangleGraphics:()=>km,RectangleOutlineGeometry:()=>v_,ReferenceFrame:()=>Ni,ReferenceProperty:()=>Ub,RenderState:()=>Ue,Renderbuffer:()=>dd,RenderbufferFormat:()=>Fc,Request:()=>Ko,RequestErrorEvent:()=>jh,RequestScheduler:()=>$a,RequestState:()=>Qn,RequestType:()=>ls,Resource:()=>Ze,ResourceCache:()=>Vi,ResourceCacheKey:()=>vl,ResourceCacheStatistics:()=>IX,ResourceLoader:()=>Ki,ResourceLoaderState:()=>gt,Rotation:()=>qu,RuntimeError:()=>ae,S2Cell:()=>zp,SDFSettings:()=>Os,SampledPositionProperty:()=>fa,SampledProperty:()=>wd,Sampler:()=>$t,ScaledPositionProperty:()=>vf,Scene:()=>e9,SceneFramebuffer:()=>AT,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>xP,SceneModePicker:()=>ZM,SceneModePickerViewModel:()=>RM,SceneTransforms:()=>ki,SceneTransitioner:()=>gA,ScreenSpaceCameraController:()=>TA,ScreenSpaceEventHandler:()=>eu,ScreenSpaceEventType:()=>Sn,SelectedFeatureIdPipelineStage:()=>Gg,SelectionIndicator:()=>IM,SelectionIndicatorViewModel:()=>EM,SensorVolumePortionToDisplay:()=>O1,ShaderBuilder:()=>_x,ShaderCache:()=>YG,ShaderDestination:()=>ge,ShaderFunction:()=>eE,ShaderProgram:()=>en,ShaderSource:()=>De,ShaderStruct:()=>$G,ShadowMap:()=>f0,ShadowMapShader:()=>ip,ShadowMode:()=>_n,ShadowVolumeAppearance:()=>fd,ShowGeometryInstanceAttribute:()=>xn,Simon1994PlanetaryPositions:()=>k0,SimplePolylineGeometry:()=>_7,SingleTileImageryProvider:()=>Ow,SkinningPipelineStage:()=>TP,SkyAtmosphere:()=>t9,SkyBox:()=>n9,SpatialNode:()=>zA,Spdcf:()=>KX,SpecularEnvironmentCubeMap:()=>Bm,SphereEmitter:()=>c6,SphereGeometry:()=>T7,SphereOutlineGeometry:()=>Rb,Spherical:()=>rv,Spline:()=>io,SplitDirection:()=>vr,Splitter:()=>dL,StaticGeometryColorBatch:()=>nm,StaticGeometryPerMaterialBatch:()=>im,StaticGroundGeometryColorBatch:()=>cV,StaticGroundGeometryPerMaterialBatch:()=>Mv,StaticGroundPolylinePerMaterialBatch:()=>Jv,StaticOutlineGeometryBatch:()=>uV,StencilConstants:()=>Dt,StencilFunction:()=>Un,StencilOperation:()=>ft,SteppedSpline:()=>dW,Stereographic:()=>dc,StorageType:()=>yg,StripeMaterialProperty:()=>D1,StripeOrientation:()=>gh,StructuralMetadata:()=>Ds,StyleCommandsNeeded:()=>nh,StyleExpression:()=>l6,Sun:()=>r9,SunLight:()=>Zp,SunPostProcess:()=>VA,SupportedImageFormats:()=>OX,SvgPathBindingHandler:()=>H9,TaskProcessor:()=>bi,Terrain:()=>k9,TerrainData:()=>Xh,TerrainEncoding:()=>Sc,TerrainFillMesh:()=>OV,TerrainMesh:()=>dm,TerrainOffsetProperty:()=>Bx,TerrainProvider:()=>is,TerrainQuantization:()=>js,TerrainState:()=>uo,Texture:()=>Wt,TextureAtlas:()=>Pg,TextureCache:()=>HG,TextureMagnificationFilter:()=>mi,TextureManager:()=>JA,TextureMinificationFilter:()=>qt,TextureUniform:()=>C6,TextureWrap:()=>Vn,TileAvailability:()=>Uh,TileBoundingRegion:()=>Hu,TileBoundingS2Cell:()=>T2,TileBoundingSphere:()=>Zb,TileBoundingVolume:()=>d6,TileCoordinatesImageryProvider:()=>D9,TileDiscardPolicy:()=>m6,TileEdge:()=>yn,TileImagery:()=>UV,TileMapServiceImageryProvider:()=>Cy,TileMetadata:()=>p2,TileOrientedBoundingBox:()=>Ed,TileProviderError:()=>Zo,TileReplacementQueue:()=>tF,TileSelectionResult:()=>Kn,TileState:()=>h6,Tileset3DTileContent:()=>JP,TilesetMetadata:()=>S2,TilesetPipelineStage:()=>yW,TilingScheme:()=>S7,TimeConstants:()=>zn,TimeDynamicImagery:()=>ET,TimeDynamicPointCloud:()=>mL,TimeInterval:()=>Ln,TimeIntervalCollection:()=>Dr,TimeIntervalCollectionPositionProperty:()=>Db,TimeIntervalCollectionProperty:()=>Bb,TimeStandard:()=>Hn,Timeline:()=>PM,TimelineHighlightRange:()=>XM,TimelineTrack:()=>WM,Tipsify:()=>lR,ToggleButtonViewModel:()=>Yy,Tonemapper:()=>b0,TrackingReferenceFrame:()=>Wp,Transforms:()=>wt,TranslationRotationScale:()=>Q0,TranslucentTileClassification:()=>BF,TridiagonalSystemSolver:()=>YC,TrustedServers:()=>AS,TweenCollection:()=>KT,UniformState:()=>JG,UniformType:()=>rL,UrlTemplateImageryProvider:()=>ka,VERSION:()=>z1t,VRButton:()=>wM,VRButtonViewModel:()=>vM,VRTheWorldTerrainProvider:()=>C7,VaryingType:()=>V6,Vector3DTileBatch:()=>mf,Vector3DTileClampedPolylines:()=>u2,Vector3DTileContent:()=>h2,Vector3DTileGeometry:()=>Hp,Vector3DTilePoints:()=>a2,Vector3DTilePolygons:()=>c2,Vector3DTilePolylines:()=>I_,Vector3DTilePrimitive:()=>qx,VelocityOrientationProperty:()=>av,VelocityVectorProperty:()=>Ob,VertexArray:()=>ei,VertexArrayFacade:()=>Gp,VertexAttributeSemantic:()=>Lt,VertexFormat:()=>Xe,VerticalExaggeration:()=>Tr,VerticalExaggerationPipelineStage:()=>CP,VerticalOrigin:()=>Pn,VideoSynchronizer:()=>V7,View:()=>kT,Viewer:()=>z6,ViewportQuad:()=>f6,Visibility:()=>hr,Visualizer:()=>T4,VoxelBoxShape:()=>ap,VoxelCell:()=>ZA,VoxelContent:()=>C9,VoxelCylinderShape:()=>cp,VoxelEllipsoidShape:()=>qT,VoxelInspector:()=>AM,VoxelInspectorViewModel:()=>FM,VoxelPrimitive:()=>vy,VoxelProvider:()=>b6,VoxelRenderResources:()=>DA,VoxelShape:()=>g6,VoxelShapeType:()=>Ai,VoxelTraversal:()=>oL,VulkanConstants:()=>L7,WallGeometry:()=>vv,WallGeometryLibrary:()=>aT,WallGeometryUpdater:()=>Av,WallGraphics:()=>kp,WallOutlineGeometry:()=>Fv,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>Hw,WebMapTileServiceImageryProvider:()=>Kw,WebMercatorProjection:()=>Ei,WebMercatorTilingScheme:()=>os,WindingOrder:()=>ds,WireframeIndexGenerator:()=>$C,WireframePipelineStage:()=>VP,_shadersAcesTonemappingStage:()=>zF,_shadersAdditiveBlend:()=>SA,_shadersAdjustTranslucentFS:()=>JS,_shadersAllMaterialAppearanceFS:()=>YE,_shadersAllMaterialAppearanceVS:()=>HE,_shadersAmbientOcclusionGenerate:()=>KF,_shadersAmbientOcclusionModulate:()=>JF,_shadersAspectRampMaterial:()=>jE,_shadersAtmosphereCommon:()=>Pm,_shadersAtmosphereStageFS:()=>xW,_shadersAtmosphereStageVS:()=>_W,_shadersBasicMaterialAppearanceFS:()=>zE,_shadersBasicMaterialAppearanceVS:()=>KE,_shadersBillboardCollectionFS:()=>nE,_shadersBillboardCollectionVS:()=>iE,_shadersBlackAndWhite:()=>QF,_shadersBloomComposite:()=>jF,_shadersBrdfLutGeneratorFS:()=>oE,_shadersBrightPass:()=>CA,_shadersBrightness:()=>qF,_shadersBumpMapMaterial:()=>qE,_shadersCPUStylingStageFS:()=>YW,_shadersCPUStylingStageVS:()=>OW,_shadersCheckerboardMaterial:()=>$E,_shadersCloudCollectionFS:()=>rE,_shadersCloudCollectionVS:()=>sE,_shadersCloudNoiseFS:()=>aE,_shadersCloudNoiseVS:()=>cE,_shadersCompareAndPackTranslucentDepth:()=>lE,_shadersCompositeOITFS:()=>dE,_shadersCompositeTranslucentClassification:()=>NT,_shadersComputeIrradianceFS:()=>uE,_shadersComputeRadianceMapFS:()=>mE,_shadersContrastBias:()=>$F,_shadersConvolveSpecularMapFS:()=>hE,_shadersConvolveSpecularMapVS:()=>fE,_shadersCustomShaderStageFS:()=>KW,_shadersCustomShaderStageVS:()=>zW,_shadersCzmBuiltins:()=>gx,_shadersDepthOfField:()=>eA,_shadersDepthPlaneFS:()=>pE,_shadersDepthPlaneVS:()=>bE,_shadersDepthView:()=>tA,_shadersDepthViewPacked:()=>S6,_shadersDotMaterial:()=>eI,_shadersEdgeDetection:()=>nA,_shadersElevationBandMaterial:()=>tI,_shadersElevationContourMaterial:()=>nI,_shadersElevationRampMaterial:()=>iI,_shadersEllipsoidFS:()=>QS,_shadersEllipsoidSurfaceAppearanceFS:()=>Z9,_shadersEllipsoidSurfaceAppearanceVS:()=>G9,_shadersEllipsoidVS:()=>jS,_shadersFXAA:()=>rA,_shadersFXAA3_11:()=>gE,_shadersFadeMaterial:()=>oI,_shadersFeatureIdStageFS:()=>JW,_shadersFeatureIdStageVS:()=>QW,_shadersFilmicTonemapping:()=>iA,_shadersGaussianBlur1D:()=>Xy,_shadersGeometryStageFS:()=>nP,_shadersGeometryStageVS:()=>iP,_shadersGlobeFS:()=>yE,_shadersGlobeVS:()=>xE,_shadersGridMaterial:()=>rI,_shadersGroundAtmosphere:()=>qS,_shadersHSBToRGB:()=>cZ,_shadersHSLToRGB:()=>lZ,_shadersImageBasedLightingStageFS:()=>SW,_shadersInstancingStageCommon:()=>PW,_shadersInstancingStageVS:()=>vW,_shadersIntersectBox:()=>vA,_shadersIntersectClippingPlanes:()=>PA,_shadersIntersectCylinder:()=>wA,_shadersIntersectDepth:()=>WA,_shadersIntersectEllipsoid:()=>FA,_shadersIntersectLongitude:()=>nL,_shadersIntersection:()=>jT,_shadersIntersectionUtils:()=>XA,_shadersLegacyInstancingStageVS:()=>wW,_shadersLensFlare:()=>sA,_shadersLightingStageFS:()=>sP,_shadersMaterialStageFS:()=>cP,_shadersMegatexture:()=>UA,_shadersMetadataStageFS:()=>jW,_shadersMetadataStageVS:()=>qW,_shadersModelClippingPlanesStageFS:()=>ZW,_shadersModelClippingPolygonsStageFS:()=>IW,_shadersModelClippingPolygonsStageVS:()=>EW,_shadersModelColorStageFS:()=>RW,_shadersModelFS:()=>UP,_shadersModelSilhouetteStageFS:()=>EP,_shadersModelSilhouetteStageVS:()=>IP,_shadersModelSplitterStageFS:()=>WP,_shadersModelVS:()=>kP,_shadersModifiedReinhardTonemapping:()=>aA,_shadersMorphTargetsStageVS:()=>dP,_shadersNightVision:()=>cA,_shadersNormalMapMaterial:()=>sI,_shadersOctree:()=>kA,_shadersPassThrough:()=>ql,_shadersPassThroughDepth:()=>Gy,_shadersPbrNeutralTonemapping:()=>oA,_shadersPerInstanceColorAppearanceFS:()=>gI,_shadersPerInstanceColorAppearanceVS:()=>yI,_shadersPerInstanceFlatColorAppearanceFS:()=>Lx,_shadersPerInstanceFlatColorAppearanceVS:()=>xI,_shadersPointCloudEyeDomeLighting:()=>eW,_shadersPointCloudStylingStageVS:()=>hP,_shadersPointPrimitiveCollectionFS:()=>U0,_shadersPointPrimitiveCollectionVS:()=>_E,_shadersPolygonSignedDistanceFS:()=>TE,_shadersPolylineArrowMaterial:()=>aI,_shadersPolylineColorAppearanceVS:()=>GI,_shadersPolylineCommon:()=>ud,_shadersPolylineDashMaterial:()=>cI,_shadersPolylineFS:()=>Tx,_shadersPolylineGlowMaterial:()=>lI,_shadersPolylineMaterialAppearanceVS:()=>EI,_shadersPolylineOutlineMaterial:()=>dI,_shadersPolylineShadowVolumeFS:()=>SE,_shadersPolylineShadowVolumeMorphFS:()=>CE,_shadersPolylineShadowVolumeMorphVS:()=>VE,_shadersPolylineShadowVolumeVS:()=>LE,_shadersPolylineVS:()=>RE,_shadersPrimitiveOutlineStageFS:()=>bP,_shadersPrimitiveOutlineStageVS:()=>pP,_shadersRGBToHSB:()=>dZ,_shadersRGBToHSL:()=>uZ,_shadersRGBToXYZ:()=>mZ,_shadersReinhardTonemapping:()=>lA,_shadersReprojectWebMercatorFS:()=>ZE,_shadersReprojectWebMercatorVS:()=>GE,_shadersRimLightingMaterial:()=>uI,_shadersSelectedFeatureIdStageCommon:()=>qC,_shadersShadowVolumeAppearanceFS:()=>$S,_shadersShadowVolumeAppearanceVS:()=>EE,_shadersShadowVolumeFS:()=>D0,_shadersSilhouette:()=>dA,_shadersSkinningStageVS:()=>_P,_shadersSkyAtmosphereCommon:()=>eC,_shadersSkyAtmosphereFS:()=>IE,_shadersSkyAtmosphereVS:()=>XE,_shadersSkyBoxFS:()=>WE,_shadersSkyBoxVS:()=>PE,_shadersSlopeRampMaterial:()=>mI,_shadersStripeMaterial:()=>hI,_shadersSunFS:()=>vE,_shadersSunTextureFS:()=>wE,_shadersSunVS:()=>FE,_shadersTexturedMaterialAppearanceFS:()=>JE,_shadersTexturedMaterialAppearanceVS:()=>QE,_shadersVector3DTileClampedPolylinesFS:()=>AE,_shadersVector3DTileClampedPolylinesVS:()=>ME,_shadersVector3DTilePolylinesVS:()=>NE,_shadersVectorTileVS:()=>tC,_shadersVerticalExaggerationStageVS:()=>SP,_shadersViewportQuadFS:()=>kE,_shadersViewportQuadVS:()=>cx,_shadersVoxelFS:()=>EA,_shadersVoxelUtils:()=>GA,_shadersVoxelVS:()=>IA,_shadersWater:()=>pI,_shadersWaterMaskMaterial:()=>fI,_shadersXYZToRGB:()=>hZ,_shadersacesTonemapping:()=>fZ,_shadersalphaWeight:()=>pZ,_shadersantialias:()=>bZ,_shadersapplyHSBShift:()=>gZ,_shadersapproximateSphericalCoordinates:()=>yZ,_shadersapproximateTanh:()=>xZ,_shadersbackFacing:()=>_Z,_shadersbranchFreeTernary:()=>TZ,_shaderscascadeColor:()=>SZ,_shaderscascadeDistance:()=>CZ,_shaderscascadeMatrix:()=>VZ,_shaderscascadeWeights:()=>LZ,_shadersclipPolygons:()=>RZ,_shaderscolumbusViewMorph:()=>ZZ,_shaderscomputeAtmosphereColor:()=>GZ,_shaderscomputeGroundAtmosphereScattering:()=>EZ,_shaderscomputePosition:()=>IZ,_shaderscomputeScattering:()=>XZ,_shadersconvertUvToBox:()=>AA,_shadersconvertUvToCylinder:()=>MA,_shadersconvertUvToEllipsoid:()=>NA,_shaderscosineAndSine:()=>WZ,_shadersdecompressTextureCoordinates:()=>PZ,_shadersdegreesPerRadian:()=>bR,_shadersdepthClamp:()=>vZ,_shadersdepthRange:()=>gR,_shadersdepthRangeStruct:()=>eZ,_shaderseastNorthUpToEyeCoordinates:()=>wZ,_shadersellipsoidContainsPoint:()=>FZ,_shadersellipsoidTextureCoordinates:()=>AZ,_shadersepsilon1:()=>yR,_shadersepsilon2:()=>xR,_shadersepsilon3:()=>_R,_shadersepsilon4:()=>TR,_shadersepsilon5:()=>SR,_shadersepsilon6:()=>CR,_shadersepsilon7:()=>VR,_shadersequalsEpsilon:()=>MZ,_shaderseyeOffset:()=>NZ,_shaderseyeToWindowCoordinates:()=>kZ,_shadersfastApproximateAtan:()=>UZ,_shadersfog:()=>DZ,_shadersgammaCorrect:()=>BZ,_shadersgeodeticSurfaceNormal:()=>OZ,_shadersgetDefaultMaterial:()=>YZ,_shadersgetDynamicAtmosphereLightDirection:()=>HZ,_shadersgetLambertDiffuse:()=>zZ,_shadersgetSpecular:()=>KZ,_shadersgetWaterNoise:()=>JZ,_shadershue:()=>QZ,_shadersinfinity:()=>LR,_shadersinverseGamma:()=>jZ,_shadersisEmpty:()=>qZ,_shadersisFull:()=>$Z,_shaderslatitudeToWebMercatorFraction:()=>eG,_shaderslineDistance:()=>tG,_shaderslinearToSrgb:()=>nG,_shadersluminance:()=>iG,_shadersmaterial:()=>tZ,_shadersmaterialInput:()=>nZ,_shadersmaximumComponent:()=>oG,_shadersmetersPerPixel:()=>rG,_shadersmodelMaterial:()=>iZ,_shadersmodelToWindowCoordinates:()=>sG,_shadersmodelVertexOutput:()=>oZ,_shadersmultiplyWithColorBalance:()=>aG,_shadersnearFarScalar:()=>cG,_shadersoctDecode:()=>lG,_shadersoneOverPi:()=>RR,_shadersoneOverTwoPi:()=>ZR,_shaderspackDepth:()=>dG,_shaderspassCesium3DTile:()=>GR,_shaderspassCesium3DTileClassification:()=>ER,_shaderspassCesium3DTileClassificationIgnoreShow:()=>IR,_shaderspassClassification:()=>XR,_shaderspassCompute:()=>WR,_shaderspassEnvironment:()=>PR,_shaderspassGlobe:()=>vR,_shaderspassOpaque:()=>wR,_shaderspassOverlay:()=>FR,_shaderspassTerrainClassification:()=>AR,_shaderspassTranslucent:()=>MR,_shaderspassVoxels:()=>NR,_shaderspbrLighting:()=>uG,_shaderspbrNeutralTonemapping:()=>mG,_shadersphong:()=>hG,_shaderspi:()=>kR,_shaderspiOverFour:()=>UR,_shaderspiOverSix:()=>DR,_shaderspiOverThree:()=>BR,_shaderspiOverTwo:()=>OR,_shadersplaneDistance:()=>fG,_shaderspointAlongRay:()=>pG,_shadersradiansPerDegree:()=>YR,_shadersray:()=>rZ,_shadersrayEllipsoidIntersectionInterval:()=>bG,_shadersraySegment:()=>sZ,_shadersraySphereIntersectionInterval:()=>gG,_shadersreadDepth:()=>yG,_shadersreadNonPerspective:()=>xG,_shadersreverseLogDepth:()=>_G,_shadersround:()=>TG,_shaderssaturation:()=>SG,_shaderssceneMode2D:()=>HR,_shaderssceneMode3D:()=>zR,_shaderssceneModeColumbusView:()=>KR,_shaderssceneModeMorphing:()=>JR,_shadersshadowDepthCompare:()=>CG,_shadersshadowParameters:()=>aZ,_shadersshadowVisibility:()=>VG,_shaderssignNotZero:()=>LG,_shaderssolarRadius:()=>QR,_shaderssphericalHarmonics:()=>RG,_shaderssrgbToLinear:()=>ZG,_shaderstangentToEyeSpaceMatrix:()=>GG,_shaderstextureCube:()=>EG,_shadersthreePiOver2:()=>jR,_shaderstransformPlane:()=>IG,_shaderstranslateRelativeToEye:()=>XG,_shaderstranslucentPhong:()=>WG,_shaderstranspose:()=>PG,_shaderstwoPi:()=>qR,_shadersunpackClippingExtents:()=>vG,_shadersunpackDepth:()=>wG,_shadersunpackFloat:()=>FG,_shadersunpackUint:()=>AG,_shadersvalueTransform:()=>MG,_shadersvertexLogDepth:()=>NG,_shaderswebMercatorMaxLatitude:()=>$R,_shaderswindowToEyeCoordinates:()=>kG,_shaderswriteDepthClamp:()=>UG,_shaderswriteLogDepth:()=>DG,_shaderswriteNonPerspective:()=>BG,addBuffer:()=>yX,addDefaults:()=>dX,addExtensionsRequired:()=>pX,addExtensionsUsed:()=>Iu,addPipelineExtras:()=>ag,addToArray:()=>Cs,appendForwardSlash:()=>kL,arrayRemoveDuplicates:()=>To,barycentricCoordinates:()=>dx,binarySearch:()=>Io,buildModuleUrl:()=>rn,buildVoxelDrawCommands:()=>OA,clone:()=>Ye,combine:()=>St,computeFlyToLocationForRectangle:()=>LT,createBillboardPointCallback:()=>R_,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>rM,createDefaultTerrainProviderViewModels:()=>sM,createElevationBandMaterial:()=>y6,createGooglePhotorealistic3DTileset:()=>x6,createGuid:()=>Bn,createMaterialPropertyDescriptor:()=>Xo,createOsmBuildingsAsync:()=>_6,createPropertyDescriptor:()=>ue,createRawPropertyDescriptor:()=>Dc,createTangentSpaceDebugPrimitive:()=>T6,createTaskProcessorWorker:()=>R6,createUniform:()=>$L,createUniformArray:()=>eR,createWorldBathymetryAsync:()=>g9,createWorldImageryAsync:()=>c0,createWorldTerrainAsync:()=>fS,decodeGoogleEarthEnterpriseData:()=>y9,decodeVectorPolylinePositions:()=>m2,defaultValue:()=>y,defer:()=>_l,defined:()=>l,demodernizeShader:()=>OG,deprecationWarning:()=>us,destroyObject:()=>me,exportKml:()=>R4,findAccessorMinMax:()=>s_,findContentMetadata:()=>W_,findGroupMetadata:()=>P_,findTileMetadata:()=>b2,forEachTextureInMaterial:()=>VC,formatError:()=>zf,freezeRenderState:()=>CO,getAbsoluteUri:()=>Jh,getAccessorByteStride:()=>Wl,getBaseUri:()=>UL,getBinaryAccessor:()=>yd,getClipAndStyleCode:()=>s9,getClippingFunction:()=>o0,getComponentReader:()=>$p,getElement:()=>Xn,getExtensionFromUri:()=>$y,getFilenameFromUri:()=>Mb,getImageFromTypedArray:()=>KA,getImagePixels:()=>Lm,getJsonFromTypedArray:()=>Po,getMagic:()=>Ym,getMetadataClassProperty:()=>jA,getMetadataProperty:()=>$A,getStringFromTypedArray:()=>Gl,getTimestamp:()=>_i,hasExtension:()=>ii,heightReferenceOnEntityPropertyChanged:()=>Up,isBitSet:()=>Zc,isBlobUri:()=>ex,isCrossOriginUrl:()=>X0,isDataUri:()=>xp,isLeapYear:()=>Vm,knockout:()=>Se,knockout_3_5_1:()=>CS,knockout_es5:()=>Y9,loadAndExecuteScript:()=>tx,loadCubeMap:()=>tE,loadImageFromTypedArray:()=>i_,loadKTX2:()=>Sl,mergeSort:()=>d0,moveTechniqueRenderStates:()=>fX,moveTechniquesToExtension:()=>bX,numberOfComponentsForType:()=>_d,objectToQuery:()=>nx,oneTimeWarning:()=>_t,parseBatchTable:()=>db,parseFeatureMetadataLegacy:()=>DX,parseGlb:()=>mX,parseResponseHeaders:()=>DL,parseStructuralMetadata:()=>UX,pickModel:()=>n1,pointInsideTriangle:()=>Z7,preprocess3DTileContent:()=>Rf,processVoxelProperties:()=>BA,queryToObject:()=>sd,readAccessorPacked:()=>xX,removeExtension:()=>a_,removeExtensionsRequired:()=>uX,removeExtensionsUsed:()=>r_,removePipelineExtras:()=>hX,removeUnusedElements:()=>gX,resizeImageToNextPowerOfTwo:()=>dg,sampleTerrain:()=>ww,sampleTerrainMostDetailed:()=>VT,scaleToGeodeticSurface:()=>qy,srgbToLinear:()=>pS,subdivideArray:()=>SI,subscribeAndEvaluate:()=>_a,updateAccessorComponentTypes:()=>_X,updateVersion:()=>TX,usesExtension:()=>ar,viewerCesium3DTilesInspectorMixin:()=>K6,viewerCesiumInspectorMixin:()=>J6,viewerDragDropMixin:()=>j6,viewerPerformanceWatchdogMixin:()=>q6,viewerVoxelInspectorMixin:()=>$6,webGLConstantToGlslType:()=>G7,wrapFunction:()=>x9,writeTextToCanvas:()=>G_});var $Xo=T(S(),1);var Tro=T(S(),1);var KVt=T(S(),1);var yVt=T(S(),1);var sVt=T(S(),1);var $1t=T(S(),1);function NCe(e){return e!=null}var l=NCe;var nVt=T(S(),1);function Qy(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Qy.prototype=Object.create(Error.prototype),Qy.prototype.constructor=Qy);Qy.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};Qy.throwInstantiationError=function(){throw new Qy("This function defines an interface and should not be called directly.")};var pe=Qy;var Ts={};Ts.typeOf={};function kCe(e){return`${e} is required, actual value was undefined`}function ZS(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Ts.defined=function(e,t){if(!l(t))throw new pe(kCe(e))};Ts.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(ZS(typeof t,"function",e))};Ts.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(ZS(typeof t,"string",e))};Ts.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(ZS(typeof t,"number",e))};Ts.typeOf.number.lessThan=function(e,t,n){if(Ts.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Ts.typeOf.number.lessThanOrEquals=function(e,t,n){if(Ts.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Ts.typeOf.number.greaterThan=function(e,t,n){if(Ts.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Ts.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Ts.typeOf.number(e,t),t0?1:-1});ct.signNotZero=function(e){return e<0?-1:1};ct.toSNorm=function(e,t){return t=y(t,255),Math.round((ct.clamp(e,-1,1)*.5+.5)*t)};ct.fromSNorm=function(e,t){return t=y(t,255),ct.clamp(e,0,t)/t*2-1};ct.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:ct.clamp((e-t)/n,0,1)};ct.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});ct.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});ct.lerp=function(e,t,n){return(1-n)*e+n*t};ct.PI=Math.PI;ct.ONE_OVER_PI=1/Math.PI;ct.PI_OVER_TWO=Math.PI/2;ct.PI_OVER_THREE=Math.PI/3;ct.PI_OVER_FOUR=Math.PI/4;ct.PI_OVER_SIX=Math.PI/6;ct.THREE_PI_OVER_TWO=3*Math.PI/2;ct.TWO_PI=2*Math.PI;ct.ONE_OVER_TWO_PI=1/(2*Math.PI);ct.RADIANS_PER_DEGREE=Math.PI/180;ct.DEGREES_PER_RADIAN=180/Math.PI;ct.RADIANS_PER_ARCSECOND=ct.RADIANS_PER_DEGREE/3600;ct.toRadians=function(e){return e*ct.RADIANS_PER_DEGREE};ct.toDegrees=function(e){return e*ct.DEGREES_PER_RADIAN};ct.convertLongitudeRange=function(e){let t=ct.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};ct.clampToLatitudeRange=function(e){return ct.clamp(e,-1*ct.PI_OVER_TWO,ct.PI_OVER_TWO)};ct.negativePiToPi=function(e){return e>=-ct.PI&&e<=ct.PI?e:ct.zeroToTwoPi(e+ct.PI)-ct.PI};ct.zeroToTwoPi=function(e){if(e>=0&&e<=ct.TWO_PI)return e;let t=ct.mod(e,ct.TWO_PI);return Math.abs(t)ct.EPSILON14?ct.TWO_PI:t};ct.mod=function(e,t){return ct.sign(e)===ct.sign(t)&&Math.abs(e)n};ct.greaterThanOrEquals=function(e,t,n){return e-t>-n};var UM=[1];ct.factorial=function(e){let t=UM.length;if(e>=t){let n=UM[t-1];for(let i=t;i<=e;i++){let o=n*i;UM.push(o),n=o}}return UM[e]};ct.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};ct.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};ct.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};ct.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};ct.clamp=function(e,t,n){return en?n:e};var rq=new v3.default;ct.setRandomNumberSeed=function(e){rq=new v3.default(e)};ct.nextRandomNumber=function(){return rq.random()};ct.randomBetween=function(e,t){return ct.nextRandomNumber()*(t-e)+e};ct.acosClamped=function(e){return Math.acos(ct.clamp(e,-1,1))};ct.asinClamped=function(e){return Math.asin(ct.clamp(e,-1,1))};ct.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};ct.logBase=function(e,t){return Math.log(e)/Math.log(t)};ct.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});ct.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});ct.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};ct.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};ct.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=ct.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?ct.PI_OVER_TWO-i:i,i=e<0?ct.PI-i:i,i=t<0?-i:i,i};var W=ct;function $e(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}$e.fromSpherical=function(e,t){l(t)||(t=new $e);let n=e.clock,i=e.cone,o=y(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};$e.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new $e(e,t,n)};$e.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new $e(e.x,e.y,e.z)};$e.fromCartesian4=$e.clone;$e.packedLength=3;$e.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};$e.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new $e),n.x=e[t++],n.y=e[t++],n.z=e[t],n};$e.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;oi&&(o=d,i=u)}let r=1,s=0,a=M3[o],c=N3[o];if(Math.abs(e[tt.getElementIndex(c,a)])>n){let d=e[tt.getElementIndex(c,c)],u=e[tt.getElementIndex(a,a)],h=e[tt.getElementIndex(c,a)],p=(d-u)/2/h,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(c,c)]=r,t[tt.getElementIndex(c,a)]=s,t[tt.getElementIndex(a,c)]=-s,t}var YM=new tt,dq=new tt;tt.computeEigenDecomposition=function(e,t){let n=W.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),c=n*JCe(a);for(;rc;)jCe(a,YM),tt.transpose(YM,dq),tt.multiply(a,YM,a),tt.multiply(dq,a,a),tt.multiply(s,YM,s),++o>2&&(++r,o=0);return t};tt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};tt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],d=e[8];return t*(r*d-c*s)+o*(c*i-n*d)+a*(n*s-r*i)};tt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],d=e[7],u=e[8],h=tt.determinant(e);t[0]=s*u-d*a,t[1]=d*o-i*u,t[2]=i*a-s*o,t[3]=c*a-r*u,t[4]=n*u-c*o,t[5]=r*o-n*a,t[6]=r*d-c*s,t[7]=c*i-n*d,t[8]=n*s-r*i;let p=1/h;return tt.multiplyByScalar(t,p,t)};var qCe=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,qCe),t)};tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};tt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};VCe.exports=Y6});var q1t={};NCe(q1t,{AlphaMode:()=>gf,AlphaPipelineStage:()=>bW,AnchorPointDirect:()=>_X,AnchorPointIndirect:()=>TX,Animation:()=>e9,AnimationViewModel:()=>t9,Appearance:()=>no,ApproximateTerrainHeights:()=>di,ArcGISTiledElevationTerrainProvider:()=>N8,ArcGisBaseMapType:()=>Ph,ArcGisMapServerImageryProvider:()=>s0,ArcGisMapService:()=>Jd,ArcType:()=>en,ArticulationStageType:()=>hc,AssociativeArray:()=>Rt,Atmosphere:()=>g_,AtmospherePipelineStage:()=>QX,AttributeCompression:()=>wn,AttributeType:()=>on,AutoExposure:()=>tA,AutomaticUniforms:()=>gp,Axis:()=>Po,AxisAlignedBoundingBox:()=>Y0,B3dmLoader:()=>vX,B3dmParser:()=>XX,BaseLayerPicker:()=>i9,BaseLayerPickerViewModel:()=>n9,BatchTable:()=>Lx,BatchTableHierarchy:()=>Jx,BatchTexture:()=>Qc,BatchTexturePipelineStage:()=>gW,Billboard:()=>lo,BillboardCollection:()=>Zd,BillboardGraphics:()=>oc,BillboardVisualizer:()=>sE,BingMapsGeocoderService:()=>U8,BingMapsImageryProvider:()=>Tw,BingMapsStyle:()=>WV,BlendEquation:()=>Xa,BlendFunction:()=>Co,BlendOption:()=>Lo,BlendingState:()=>un,BoundingRectangle:()=>ze,BoundingSphere:()=>le,BoundingSphereState:()=>lt,BoundingVolumeSemantics:()=>m_,BoxEmitter:()=>X7,BoxGeometry:()=>Ea,BoxGeometryUpdater:()=>gI,BoxGraphics:()=>Px,BoxOutlineGeometry:()=>vm,BrdfLutGenerator:()=>eF,Buffer:()=>yt,BufferLoader:()=>t_,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>TW,CallbackPositionProperty:()=>yI,CallbackProperty:()=>km,Camera:()=>ro,CameraEventAggregator:()=>cA,CameraEventType:()=>Ai,CameraFlightPath:()=>nF,Cartesian2:()=>D,Cartesian3:()=>m,Cartesian4:()=>se,Cartographic:()=>he,CartographicGeocoderService:()=>B8,CatmullRomSpline:()=>O8,Cesium3DContentGroup:()=>Kx,Cesium3DTile:()=>Ku,Cesium3DTileBatchTable:()=>Yp,Cesium3DTileColorBlendMode:()=>Il,Cesium3DTileContent:()=>W7,Cesium3DTileContentFactory:()=>X_,Cesium3DTileContentState:()=>Yo,Cesium3DTileContentType:()=>Ls,Cesium3DTileFeature:()=>ks,Cesium3DTileFeatureTable:()=>eh,Cesium3DTileOptimizationHint:()=>Du,Cesium3DTileOptimizations:()=>oP,Cesium3DTilePass:()=>Ao,Cesium3DTilePassState:()=>fm,Cesium3DTilePointFeature:()=>yb,Cesium3DTileRefine:()=>Bo,Cesium3DTileStyle:()=>yS,Cesium3DTileStyleEngine:()=>dP,Cesium3DTilesInspector:()=>m9,Cesium3DTilesInspectorViewModel:()=>u9,Cesium3DTilesVoxelProvider:()=>P7,Cesium3DTileset:()=>bs,Cesium3DTilesetBaseTraversal:()=>bP,Cesium3DTilesetCache:()=>aP,Cesium3DTilesetGraphics:()=>kx,Cesium3DTilesetHeatmap:()=>cP,Cesium3DTilesetMetadata:()=>U_,Cesium3DTilesetMostDetailedTraversal:()=>hP,Cesium3DTilesetSkipTraversal:()=>xP,Cesium3DTilesetStatistics:()=>Xb,Cesium3DTilesetTraversal:()=>Hs,Cesium3DTilesetVisualizer:()=>_P,CesiumInspector:()=>c9,CesiumInspectorViewModel:()=>a9,CesiumTerrainProvider:()=>uS,CesiumWidget:()=>aM,Check:()=>xo,CheckerboardMaterialProperty:()=>g1,CircleEmitter:()=>RM,CircleGeometry:()=>Q8,CircleOutlineGeometry:()=>j8,ClassificationModelDrawCommand:()=>h2,ClassificationPipelineStage:()=>yW,ClassificationPrimitive:()=>oC,ClassificationType:()=>kn,ClearCommand:()=>ti,ClippingPlane:()=>h_,ClippingPlaneCollection:()=>fs,ClippingPolygon:()=>PC,ClippingPolygonCollection:()=>Qm,Clock:()=>ph,ClockRange:()=>Or,ClockStep:()=>po,ClockViewModel:()=>QM,CloudCollection:()=>N7,CloudType:()=>GL,Color:()=>B,ColorBlendMode:()=>mc,ColorGeometryInstanceAttribute:()=>Yt,ColorMaterialProperty:()=>Dt,Command:()=>E6,ComponentDatatype:()=>Q,Composite3DTileContent:()=>ZI,CompositeEntityCollection:()=>SK,CompositeMaterialProperty:()=>x1,CompositePositionProperty:()=>fa,CompositeProperty:()=>yc,CompressedTextureBuffer:()=>aR,ComputeCommand:()=>vc,ComputeEngine:()=>rR,ConditionsExpression:()=>SM,ConeEmitter:()=>U7,ConstantPositionProperty:()=>Dc,ConstantProperty:()=>Qn,ConstantSpline:()=>MX,ContentMetadata:()=>J2,Context:()=>$G,ContextLimits:()=>Ft,CoplanarPolygonGeometry:()=>ov,CoplanarPolygonGeometryLibrary:()=>Lb,CoplanarPolygonOutlineGeometry:()=>zu,CornerType:()=>vi,CorrelationGroup:()=>SX,CorridorGeometry:()=>z_,CorridorGeometryLibrary:()=>Bi,CorridorGeometryUpdater:()=>EP,CorridorGraphics:()=>wx,CorridorOutlineGeometry:()=>GP,Credit:()=>St,CreditDisplay:()=>sF,CubeMap:()=>xr,CubeMapFace:()=>gR,CubicRealPolynomial:()=>ux,CullFace:()=>xi,CullingVolume:()=>hs,CumulusCloud:()=>au,CustomDataSource:()=>wP,CustomHeightmapTerrainProvider:()=>q8,CustomShader:()=>iS,CustomShaderMode:()=>pb,CustomShaderPipelineStage:()=>GW,CustomShaderTranslucencyMode:()=>Zg,CylinderGeometry:()=>FP,CylinderGeometryLibrary:()=>K_,CylinderGeometryUpdater:()=>MP,CylinderGraphics:()=>Fx,CylinderOutlineGeometry:()=>AP,CzmlDataSource:()=>KP,DataSource:()=>Br,DataSourceClock:()=>bh,DataSourceCollection:()=>JP,DataSourceDisplay:()=>Pv,DebugAppearance:()=>D7,DebugCameraPrimitive:()=>ep,DebugInspector:()=>bA,DebugModelMatrixPrimitive:()=>GM,DefaultProxy:()=>$8,DepthFunction:()=>rc,DepthPlane:()=>fF,DequantizationPipelineStage:()=>IW,DerivedCommand:()=>tp,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>pF,DirectionalLight:()=>B7,DiscardEmptyTileImagePolicy:()=>PV,DiscardMissingTileImagePolicy:()=>xw,DistanceDisplayCondition:()=>wt,DistanceDisplayConditionGeometryInstanceAttribute:()=>Nn,DoubleEndedPriorityQueue:()=>tS,DoublyLinkedList:()=>sP,DracoLoader:()=>qp,DrawCommand:()=>qe,DynamicAtmosphereLightingType:()=>ib,DynamicEnvironmentMapManager:()=>ob,DynamicGeometryBatch:()=>tT,DynamicGeometryUpdater:()=>ii,EarthOrientationParameters:()=>jL,EarthOrientationParametersSample:()=>I0,EasingFunction:()=>Hr,EllipseGeometry:()=>sl,EllipseGeometryLibrary:()=>Bl,EllipseGeometryUpdater:()=>jP,EllipseGraphics:()=>Ax,EllipseOutlineGeometry:()=>Md,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>vp,EllipsoidGeometry:()=>Ks,EllipsoidGeometryUpdater:()=>$P,EllipsoidGraphics:()=>Mx,EllipsoidOutlineGeometry:()=>Ed,EllipsoidPrimitive:()=>Kw,EllipsoidRhumbLine:()=>Wa,EllipsoidSurfaceAppearance:()=>O7,EllipsoidTangentPlane:()=>Qr,EllipsoidTerrainProvider:()=>Qf,EllipsoidalOccluder:()=>Ab,Empty3DTileContent:()=>o1,EncodedCartesian3:()=>On,Entity:()=>$o,EntityCluster:()=>Wd,EntityCollection:()=>zs,EntityView:()=>wv,Event:()=>ge,EventHelper:()=>dr,Expression:()=>Eu,ExpressionNodeType:()=>pt,ExtrapolationType:()=>vd,FeatureDetection:()=>Bt,FeatureIdPipelineStage:()=>Rg,Fog:()=>bF,ForEach:()=>We,FrameRateMonitor:()=>XM,FrameState:()=>gF,Framebuffer:()=>Wr,FramebufferManager:()=>fi,FrustumCommands:()=>SF,FrustumGeometry:()=>vT,FrustumOutlineGeometry:()=>lF,Fullscreen:()=>br,FullscreenButton:()=>f9,FullscreenButtonViewModel:()=>h9,GeoJsonDataSource:()=>bT,GeoJsonLoader:()=>wX,GeocodeType:()=>Ny,Geocoder:()=>b9,GeocoderService:()=>CL,GeocoderViewModel:()=>p9,GeographicProjection:()=>Ei,GeographicTilingScheme:()=>zi,Geometry:()=>ct,Geometry3DTileContent:()=>EI,GeometryAttribute:()=>Ge,GeometryAttributes:()=>mn,GeometryFactory:()=>e7,GeometryInstance:()=>Zt,GeometryInstanceAttribute:()=>sc,GeometryOffsetAttribute:()=>sn,GeometryPipeline:()=>Fn,GeometryPipelineStage:()=>vW,GeometryType:()=>gu,GeometryUpdater:()=>oi,GeometryUpdaterSet:()=>mT,GeometryVisualizer:()=>Tv,GetFeatureInfoFormat:()=>IT,Globe:()=>Ow,GlobeDepth:()=>CF,GlobeSurfaceShaderSet:()=>yw,GlobeSurfaceTile:()=>um,GlobeSurfaceTileProvider:()=>vw,GlobeTranslucency:()=>ww,GlobeTranslucencyFramebuffer:()=>VF,GlobeTranslucencyState:()=>yF,GltfBufferViewLoader:()=>gC,GltfDracoLoader:()=>yC,GltfGpmLoader:()=>VX,GltfGpmLocal:()=>wC,GltfImageLoader:()=>xC,GltfIndexBufferLoader:()=>_C,GltfJsonLoader:()=>SC,GltfLoader:()=>ab,GltfLoaderUtil:()=>vl,GltfMeshPrimitiveGpmLoader:()=>GX,GltfStructuralMetadataLoader:()=>yX,GltfTextureLoader:()=>CC,GltfVertexBufferLoader:()=>VC,GoogleEarthEnterpriseImageryProvider:()=>H7,GoogleEarthEnterpriseMapsProvider:()=>Vw,GoogleEarthEnterpriseMetadata:()=>V0,GoogleEarthEnterpriseTerrainData:()=>VL,GoogleEarthEnterpriseTerrainProvider:()=>c7,GoogleEarthEnterpriseTileInformation:()=>pM,GoogleGeocoderService:()=>d7,GoogleMaps:()=>hS,GpxDataSource:()=>Uv,GregorianDate:()=>xp,GridImageryProvider:()=>z7,GridMaterialProperty:()=>E1,GroundGeometryUpdater:()=>Yn,GroundPolylineGeometry:()=>Ex,GroundPolylinePrimitive:()=>wm,GroundPrimitive:()=>kc,GroupMetadata:()=>f1,HeadingPitchRange:()=>rm,HeadingPitchRoll:()=>Ra,Heap:()=>zL,HeightReference:()=>Je,HeightmapEncoding:()=>cm,HeightmapTerrainData:()=>Ua,HeightmapTessellator:()=>ZV,HermitePolynomialApproximation:()=>NP,HermiteSpline:()=>Cg,HilbertOrder:()=>hC,HomeButton:()=>y9,HomeButtonViewModel:()=>g9,HorizontalOrigin:()=>yi,I3SBuildingSceneLayerExplorer:()=>M6,I3SBuildingSceneLayerExplorerViewModel:()=>x9,I3SDataProvider:()=>Hh,I3SDecoder:()=>WM,I3SFeature:()=>PM,I3SField:()=>vM,I3SGeometry:()=>EL,I3SLayer:()=>CS,I3SNode:()=>IL,I3SStatistics:()=>AM,I3SSublayer:()=>NM,I3SSymbology:()=>FM,I3dmLoader:()=>AX,I3dmParser:()=>FX,ITwinData:()=>j7,ITwinPlatform:()=>Sa,Iau2000Orientation:()=>Hw,Iau2006XysData:()=>qL,Iau2006XysSample:()=>ax,IauOrientationAxes:()=>zw,IauOrientationParameters:()=>Yw,ImageBasedLighting:()=>zx,ImageBasedLightingPipelineStage:()=>qX,ImageMaterialProperty:()=>J0,Imagery:()=>NV,ImageryLayer:()=>Ba,ImageryLayerCollection:()=>Fw,ImageryLayerFeatureInfo:()=>Wh,ImageryProvider:()=>ul,ImageryState:()=>ci,Implicit3DTileContent:()=>ZC,ImplicitAvailabilityBitstream:()=>pC,ImplicitMetadataView:()=>bC,ImplicitSubdivisionScheme:()=>$r,ImplicitSubtree:()=>d_,ImplicitSubtreeCache:()=>VM,ImplicitSubtreeMetadata:()=>II,ImplicitTileCoordinates:()=>O_,ImplicitTileset:()=>B_,IndexDatatype:()=>Ae,InfoBox:()=>T9,InfoBoxViewModel:()=>_9,InspectorShared:()=>Ha,InstanceAttributeSemantic:()=>ts,InstancingPipelineStage:()=>mW,InterpolationAlgorithm:()=>u7,InterpolationType:()=>qm,Intersect:()=>Ht,IntersectionTests:()=>qn,Intersections2D:()=>S0,Interval:()=>Ga,InvertClassification:()=>qV,Ion:()=>Bm,IonGeocodeProviderType:()=>L0,IonGeocoderService:()=>fS,IonImageryProvider:()=>a0,IonResource:()=>yd,IonWorldImageryStyle:()=>c0,Iso8601:()=>Oe,JobScheduler:()=>xF,JobType:()=>wa,JsonMetadataTable:()=>rb,JulianDate:()=>q,KTX2Transcoder:()=>cR,KeyboardEventModifier:()=>ta,KeyframeNode:()=>$i,KmlCamera:()=>Dv,KmlDataSource:()=>ST,KmlLookAt:()=>aw,KmlTour:()=>cw,KmlTourFlyTo:()=>dw,KmlTourWait:()=>uw,Label:()=>vg,LabelCollection:()=>Cf,LabelGraphics:()=>Am,LabelStyle:()=>Oo,LabelVisualizer:()=>Sv,LagrangePolynomialApproximation:()=>kP,LeapSecond:()=>Yi,Light:()=>q7,LightingModel:()=>_f,LightingPipelineStage:()=>FW,LinearApproximation:()=>Q_,LinearSpline:()=>Sg,ManagedArray:()=>Jc,MapMode2D:()=>ql,MapProjection:()=>f7,MapboxImageryProvider:()=>Lw,MapboxStyleImageryProvider:()=>$7,Material:()=>Hi,MaterialAppearance:()=>ao,MaterialPipelineStage:()=>MW,MaterialProperty:()=>qo,Math:()=>W,Matrix2:()=>Ii,Matrix3:()=>$,Matrix4:()=>M,Megatexture:()=>rL,MeshPrimitiveGpmLocal:()=>ZX,MetadataClass:()=>zm,MetadataClassProperty:()=>ff,MetadataComponentType:()=>kt,MetadataEntity:()=>Mn,MetadataEnum:()=>QI,MetadataEnumValue:()=>JI,MetadataPicking:()=>_F,MetadataPickingPipelineStage:()=>Vd,MetadataPipelineStage:()=>Pu,MetadataSchema:()=>Sd,MetadataSchemaLoader:()=>LC,MetadataSemantic:()=>u_,MetadataTable:()=>Wl,MetadataTableProperty:()=>WI,MetadataType:()=>dt,MipmapHint:()=>sf,Model:()=>ih,Model3DTileContent:()=>Rd,ModelAlphaOptions:()=>n2,ModelAnimation:()=>DX,ModelAnimationChannel:()=>UX,ModelAnimationCollection:()=>BX,ModelAnimationLoop:()=>Fl,ModelAnimationState:()=>th,ModelArticulation:()=>eW,ModelArticulationStage:()=>$X,ModelClippingPlanesPipelineStage:()=>iW,ModelClippingPolygonsPipelineStage:()=>sW,ModelColorPipelineStage:()=>Lg,ModelComponents:()=>Tn,ModelDrawCommand:()=>f2,ModelDrawCommands:()=>g2,ModelFeature:()=>OX,ModelFeatureTable:()=>HX,ModelGraphics:()=>Np,ModelLightingOptions:()=>d2,ModelMatrixUpdateStage:()=>hW,ModelNode:()=>aW,ModelRenderResources:()=>i2,ModelRuntimeNode:()=>pW,ModelRuntimePrimitive:()=>e2,ModelSceneGraph:()=>y2,ModelSilhouettePipelineStage:()=>s2,ModelSkin:()=>t2,ModelSplitterPipelineStage:()=>c2,ModelStatistics:()=>x2,ModelType:()=>cr,ModelUtility:()=>Qt,ModelVisualizer:()=>Cv,Moon:()=>Qw,MorphTargetsPipelineStage:()=>kW,MorphWeightSpline:()=>p7,MortonOrder:()=>kg,Multiple3DTileContent:()=>q2,MultisampleFramebuffer:()=>eE,NavigationHelpButton:()=>L9,NavigationHelpButtonViewModel:()=>V9,NearFarScalar:()=>Nt,NeverTileDiscardPolicy:()=>t6,NodeRenderResources:()=>l2,NodeStatisticsPipelineStage:()=>fW,NodeTransformationProperty:()=>Nx,OIT:()=>RF,Occluder:()=>jw,OffsetGeometryInstanceAttribute:()=>qi,OpenCageGeocoderService:()=>g7,OpenStreetMapImageryProvider:()=>Z0,OrderedGroundPrimitiveCollection:()=>QP,OrientedBoundingBox:()=>Gn,OrthographicFrustum:()=>rn,OrthographicOffCenterFrustum:()=>Pr,Packable:()=>y7,PackableForInterpolation:()=>x7,Particle:()=>PL,ParticleBurst:()=>i6,ParticleEmitter:()=>o6,ParticleSystem:()=>r6,Pass:()=>Ee,PassState:()=>ic,PathGraphics:()=>kp,PathVisualizer:()=>Lv,PeliasGeocoderService:()=>gM,PerInstanceColorAppearance:()=>ln,PerformanceDisplay:()=>m0,PerformanceWatchdog:()=>C9,PerformanceWatchdogViewModel:()=>S9,PerspectiveFrustum:()=>Gi,PerspectiveOffCenterFrustum:()=>hl,PickDepth:()=>TF,PickDepthFramebuffer:()=>GF,PickFramebuffer:()=>IF,PickedMetadataInfo:()=>DA,Picking:()=>wF,PickingPipelineStage:()=>UW,PinBuilder:()=>qb,PixelDatatype:()=>je,PixelFormat:()=>nt,Plane:()=>an,PlaneGeometry:()=>ev,PlaneGeometryUpdater:()=>nv,PlaneGraphics:()=>dI,PlaneOutlineGeometry:()=>tv,PntsLoader:()=>T2,PntsParser:()=>L_,PointCloud:()=>rM,PointCloudEyeDomeLighting:()=>cb,PointCloudShading:()=>xf,PointCloudStylingPipelineStage:()=>BW,PointGraphics:()=>Ux,PointPrimitive:()=>Zs,PointPrimitiveCollection:()=>V1,PointVisualizer:()=>Zv,PolygonGeometry:()=>nb,PolygonGeometryLibrary:()=>Dn,PolygonGeometryUpdater:()=>sv,PolygonGraphics:()=>Mm,PolygonHierarchy:()=>Pa,PolygonOutlineGeometry:()=>rv,PolygonPipeline:()=>ai,Polyline:()=>Nu,PolylineArrowMaterialProperty:()=>X1,PolylineCollection:()=>sh,PolylineColorAppearance:()=>jr,PolylineDashMaterialProperty:()=>P1,PolylineGeometry:()=>jb,PolylineGeometryUpdater:()=>Iv,PolylineGlowMaterialProperty:()=>w1,PolylineGraphics:()=>ac,PolylineMaterialAppearance:()=>la,PolylineOutlineMaterialProperty:()=>Kg,PolylinePipeline:()=>Pi,PolylineVisualizer:()=>Wv,PolylineVolumeGeometry:()=>lv,PolylineVolumeGeometryLibrary:()=>uh,PolylineVolumeGeometryUpdater:()=>hv,PolylineVolumeGraphics:()=>Dx,PolylineVolumeOutlineGeometry:()=>mv,PositionProperty:()=>Fm,PositionPropertyArray:()=>Ub,PostProcessStage:()=>ho,PostProcessStageCollection:()=>oA,PostProcessStageComposite:()=>ed,PostProcessStageLibrary:()=>$d,PostProcessStageSampleMode:()=>qd,PostProcessStageTextureCache:()=>HT,PpeMetadata:()=>RX,PpeSource:()=>L6,PpeTexture:()=>LX,Primitive:()=>In,PrimitiveCollection:()=>Dl,PrimitiveLoadPlan:()=>__,PrimitiveOutlineGenerator:()=>x_,PrimitiveOutlinePipelineStage:()=>HW,PrimitivePipeline:()=>Rx,PrimitiveRenderResources:()=>u2,PrimitiveState:()=>Sr,PrimitiveStatisticsPipelineStage:()=>zW,PrimitiveType:()=>we,ProjectionPicker:()=>Z9,ProjectionPickerViewModel:()=>R9,Property:()=>K,PropertyArray:()=>A1,PropertyAttribute:()=>y_,PropertyAttributeProperty:()=>fX,PropertyBag:()=>Oc,PropertyTable:()=>qc,PropertyTexture:()=>sb,PropertyTextureProperty:()=>hX,ProviderViewModel:()=>as,Proxy:()=>_7,QuadraticRealPolynomial:()=>wc,QuadtreeOccluders:()=>Aw,QuadtreePrimitive:()=>Bw,QuadtreeTile:()=>Mw,QuadtreeTileLoadState:()=>qs,QuadtreeTileProvider:()=>s6,QuantizedMeshTerrainData:()=>dS,QuarticRealPolynomial:()=>uR,Quaternion:()=>ve,QuaternionSpline:()=>kX,Queue:()=>pg,Ray:()=>pn,Rectangle:()=>ce,RectangleCollisionChecker:()=>fT,RectangleGeometry:()=>sT,RectangleGeometryLibrary:()=>Rs,RectangleGeometryUpdater:()=>fv,RectangleGraphics:()=>Nm,RectangleOutlineGeometry:()=>v_,ReferenceFrame:()=>ki,ReferenceProperty:()=>Db,RenderState:()=>Ue,Renderbuffer:()=>ud,RenderbufferFormat:()=>Ac,Request:()=>Ko,RequestErrorEvent:()=>jh,RequestScheduler:()=>ec,RequestState:()=>jn,RequestType:()=>ls,Resource:()=>Ze,ResourceCache:()=>Li,ResourceCacheKey:()=>wl,ResourceCacheStatistics:()=>$I,ResourceLoader:()=>Ki,ResourceLoaderState:()=>bt,Rotation:()=>qu,RuntimeError:()=>ae,S2Cell:()=>Kp,SDFSettings:()=>Os,SampledPositionProperty:()=>ba,SampledProperty:()=>Fd,Sampler:()=>qt,ScaledPositionProperty:()=>vf,Scene:()=>OA,SceneFramebuffer:()=>NT,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>KW,SceneModePicker:()=>E9,SceneModePickerViewModel:()=>G9,SceneTransforms:()=>Ui,SceneTransitioner:()=>aA,ScreenSpaceCameraController:()=>uA,ScreenSpaceEventHandler:()=>tu,ScreenSpaceEventType:()=>Sn,SelectedFeatureIdPipelineStage:()=>Gg,SelectionIndicator:()=>W9,SelectionIndicatorViewModel:()=>X9,SensorVolumePortionToDisplay:()=>U1,ShaderBuilder:()=>_x,ShaderCache:()=>KG,ShaderDestination:()=>ye,ShaderFunction:()=>iE,ShaderProgram:()=>$t,ShaderSource:()=>De,ShaderStruct:()=>nE,ShadowMap:()=>p0,ShadowMapShader:()=>op,ShadowMode:()=>_n,ShadowVolumeAppearance:()=>fd,ShowGeometryInstanceAttribute:()=>xn,Simon1994PlanetaryPositions:()=>U0,SimplePolylineGeometry:()=>T7,SingleTileImageryProvider:()=>Rw,SkinningPipelineStage:()=>QW,SkyAtmosphere:()=>zA,SkyBox:()=>QA,SpatialNode:()=>AA,Spdcf:()=>CX,SpecularEnvironmentCubeMap:()=>Dm,SphereEmitter:()=>c6,SphereGeometry:()=>S7,SphereOutlineGeometry:()=>Zb,Spherical:()=>UP,Spline:()=>io,SplitDirection:()=>vr,Splitter:()=>hL,StaticGeometryColorBatch:()=>nm,StaticGeometryPerMaterialBatch:()=>im,StaticGroundGeometryColorBatch:()=>rV,StaticGroundGeometryPerMaterialBatch:()=>_v,StaticGroundPolylinePerMaterialBatch:()=>Xv,StaticOutlineGeometryBatch:()=>cV,StencilConstants:()=>Ut,StencilFunction:()=>Un,StencilOperation:()=>mt,SteppedSpline:()=>NX,Stereographic:()=>uc,StorageType:()=>yg,StripeMaterialProperty:()=>N1,StripeOrientation:()=>gh,StructuralMetadata:()=>Ds,StyleCommandsNeeded:()=>nh,StyleExpression:()=>l6,Sun:()=>nM,SunLight:()=>Gp,SunPostProcess:()=>fA,SupportedImageFormats:()=>xX,SvgPathBindingHandler:()=>KM,TaskProcessor:()=>gi,Terrain:()=>DM,TerrainData:()=>Xh,TerrainEncoding:()=>Cc,TerrainFillMesh:()=>BV,TerrainMesh:()=>dm,TerrainOffsetProperty:()=>Bx,TerrainProvider:()=>is,TerrainQuantization:()=>js,TerrainState:()=>mo,Texture:()=>Xt,TextureAtlas:()=>Pg,TextureCache:()=>JG,TextureMagnificationFilter:()=>hi,TextureManager:()=>NA,TextureMinificationFilter:()=>jt,TextureUniform:()=>C6,TextureWrap:()=>Vn,TileAvailability:()=>Uh,TileBoundingRegion:()=>Hu,TileBoundingS2Cell:()=>nP,TileBoundingSphere:()=>Gb,TileBoundingVolume:()=>d6,TileCoordinatesImageryProvider:()=>OM,TileDiscardPolicy:()=>m6,TileEdge:()=>yn,TileImagery:()=>kV,TileMapServiceImageryProvider:()=>Cy,TileMetadata:()=>Q2,TileOrientedBoundingBox:()=>Id,TileProviderError:()=>Zo,TileReplacementQueue:()=>Nw,TileSelectionResult:()=>Jn,TileState:()=>h6,Tileset3DTileContent:()=>V2,TilesetMetadata:()=>iP,TilesetPipelineStage:()=>zX,TilingScheme:()=>C7,TimeConstants:()=>Kn,TimeDynamicImagery:()=>XT,TimeDynamicPointCloud:()=>pL,TimeInterval:()=>Ln,TimeIntervalCollection:()=>Dr,TimeIntervalCollectionPositionProperty:()=>Bb,TimeIntervalCollectionProperty:()=>Ob,TimeStandard:()=>Hn,Timeline:()=>w9,TimelineHighlightRange:()=>P9,TimelineTrack:()=>v9,Tipsify:()=>mR,ToggleButtonViewModel:()=>Yy,Tonemapper:()=>g0,TrackingReferenceFrame:()=>Pp,Transforms:()=>vt,TranslationRotationScale:()=>Q0,TranslucentTileClassification:()=>WF,TridiagonalSystemSolver:()=>DC,TrustedServers:()=>NS,TweenCollection:()=>QT,UniformState:()=>qG,UniformType:()=>aL,UrlTemplateImageryProvider:()=>Da,VERSION:()=>j1t,VRButton:()=>A9,VRButtonViewModel:()=>F9,VRTheWorldTerrainProvider:()=>V7,VaryingType:()=>V6,Vector3DTileBatch:()=>mf,Vector3DTileClampedPolylines:()=>H2,Vector3DTileContent:()=>K2,Vector3DTileGeometry:()=>zp,Vector3DTilePoints:()=>N2,Vector3DTilePolygons:()=>k2,Vector3DTilePolylines:()=>I_,Vector3DTilePrimitive:()=>qx,VelocityOrientationProperty:()=>BP,VelocityVectorProperty:()=>Yb,VertexArray:()=>ni,VertexArrayFacade:()=>Ep,VertexAttributeSemantic:()=>Vt,VertexFormat:()=>Xe,VerticalExaggeration:()=>Tr,VerticalExaggerationPipelineStage:()=>qW,VerticalOrigin:()=>Pn,VideoSynchronizer:()=>L7,View:()=>DT,Viewer:()=>z6,ViewportQuad:()=>f6,Visibility:()=>hr,Visualizer:()=>S4,VoxelBoxShape:()=>cp,VoxelCell:()=>gA,VoxelContent:()=>LM,VoxelCylinderShape:()=>lp,VoxelEllipsoidShape:()=>eS,VoxelInspector:()=>N9,VoxelInspectorViewModel:()=>M9,VoxelPrimitive:()=>vy,VoxelProvider:()=>b6,VoxelRenderResources:()=>WA,VoxelShape:()=>g6,VoxelShapeType:()=>Mi,VoxelTraversal:()=>sL,VulkanConstants:()=>R7,WallGeometry:()=>bv,WallGeometryLibrary:()=>aT,WallGeometryUpdater:()=>xv,WallGraphics:()=>Up,WallOutlineGeometry:()=>yv,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>Gw,WebMapTileServiceImageryProvider:()=>Iw,WebMercatorProjection:()=>Xi,WebMercatorTilingScheme:()=>os,WindingOrder:()=>ds,WireframeIndexGenerator:()=>QC,WireframePipelineStage:()=>$W,_shadersAcesTonemappingStage:()=>FF,_shadersAdditiveBlend:()=>mA,_shadersAdjustTranslucentFS:()=>$V,_shadersAllMaterialAppearanceFS:()=>lE,_shadersAllMaterialAppearanceVS:()=>dE,_shadersAmbientOcclusionGenerate:()=>AF,_shadersAmbientOcclusionModulate:()=>MF,_shadersAspectRampMaterial:()=>pE,_shadersAtmosphereCommon:()=>jm,_shadersAtmosphereStageFS:()=>KX,_shadersAtmosphereStageVS:()=>JX,_shadersBasicMaterialAppearanceFS:()=>uE,_shadersBasicMaterialAppearanceVS:()=>mE,_shadersBillboardCollectionFS:()=>L2,_shadersBillboardCollectionVS:()=>R2,_shadersBlackAndWhite:()=>NF,_shadersBloomComposite:()=>kF,_shadersBrdfLutGeneratorFS:()=>qw,_shadersBrightPass:()=>hA,_shadersBrightness:()=>UF,_shadersBumpMapMaterial:()=>bE,_shadersCPUStylingStageFS:()=>_W,_shadersCPUStylingStageVS:()=>xW,_shadersCheckerboardMaterial:()=>gE,_shadersCloudCollectionFS:()=>cM,_shadersCloudCollectionVS:()=>lM,_shadersCloudNoiseFS:()=>dM,_shadersCloudNoiseVS:()=>uM,_shadersCompareAndPackTranslucentDepth:()=>XF,_shadersCompositeOITFS:()=>LF,_shadersCompositeTranslucentClassification:()=>UT,_shadersComputeIrradianceFS:()=>sX,_shadersComputeRadianceMapFS:()=>aX,_shadersContrastBias:()=>DF,_shadersConvolveSpecularMapFS:()=>cX,_shadersConvolveSpecularMapVS:()=>lX,_shadersCustomShaderStageFS:()=>CW,_shadersCustomShaderStageVS:()=>SW,_shadersCzmBuiltins:()=>gx,_shadersDepthOfField:()=>BF,_shadersDepthPlaneFS:()=>dF,_shadersDepthPlaneVS:()=>uF,_shadersDepthView:()=>OF,_shadersDepthViewPacked:()=>S6,_shadersDotMaterial:()=>yE,_shadersEdgeDetection:()=>YF,_shadersElevationBandMaterial:()=>xE,_shadersElevationContourMaterial:()=>_E,_shadersElevationRampMaterial:()=>TE,_shadersEllipsoidFS:()=>YV,_shadersEllipsoidSurfaceAppearanceFS:()=>EM,_shadersEllipsoidSurfaceAppearanceVS:()=>IM,_shadersEllipsoidVS:()=>HV,_shadersFXAA:()=>KF,_shadersFXAA3_11:()=>eA,_shadersFadeMaterial:()=>SE,_shadersFeatureIdStageFS:()=>VW,_shadersFeatureIdStageVS:()=>LW,_shadersFilmicTonemapping:()=>HF,_shadersGaussianBlur1D:()=>Xy,_shadersGeometryStageFS:()=>XW,_shadersGeometryStageVS:()=>WW,_shadersGlobeFS:()=>bw,_shadersGlobeVS:()=>gw,_shadersGridMaterial:()=>CE,_shadersGroundAtmosphere:()=>EV,_shadersHSBToRGB:()=>uZ,_shadersHSLToRGB:()=>mZ,_shadersImageBasedLightingStageFS:()=>jX,_shadersInstancingStageCommon:()=>cW,_shadersInstancingStageVS:()=>lW,_shadersIntersectBox:()=>VA,_shadersIntersectClippingPlanes:()=>CA,_shadersIntersectCylinder:()=>LA,_shadersIntersectDepth:()=>SA,_shadersIntersectEllipsoid:()=>RA,_shadersIntersectLongitude:()=>oL,_shadersIntersection:()=>$T,_shadersIntersectionUtils:()=>TA,_shadersLegacyInstancingStageVS:()=>dW,_shadersLensFlare:()=>JF,_shadersLightingStageFS:()=>wW,_shadersMaterialStageFS:()=>AW,_shadersMegatexture:()=>XA,_shadersMetadataStageFS:()=>RW,_shadersMetadataStageVS:()=>ZW,_shadersModelClippingPlanesStageFS:()=>nW,_shadersModelClippingPolygonsStageFS:()=>rW,_shadersModelClippingPolygonsStageVS:()=>oW,_shadersModelColorStageFS:()=>tW,_shadersModelFS:()=>b2,_shadersModelSilhouetteStageFS:()=>o2,_shadersModelSilhouetteStageVS:()=>r2,_shadersModelSplitterStageFS:()=>a2,_shadersModelVS:()=>p2,_shadersModifiedReinhardTonemapping:()=>QF,_shadersMorphTargetsStageVS:()=>NW,_shadersNightVision:()=>jF,_shadersNormalMapMaterial:()=>VE,_shadersOctree:()=>IA,_shadersPassThrough:()=>$l,_shadersPassThroughDepth:()=>Gy,_shadersPbrNeutralTonemapping:()=>zF,_shadersPerInstanceColorAppearanceFS:()=>wE,_shadersPerInstanceColorAppearanceVS:()=>FE,_shadersPerInstanceFlatColorAppearanceFS:()=>Vx,_shadersPerInstanceFlatColorAppearanceVS:()=>AE,_shadersPointCloudEyeDomeLighting:()=>EX,_shadersPointCloudStylingStageVS:()=>DW,_shadersPointPrimitiveCollectionFS:()=>zg,_shadersPointPrimitiveCollectionVS:()=>IP,_shadersPolygonSignedDistanceFS:()=>oX,_shadersPolylineArrowMaterial:()=>LE,_shadersPolylineColorAppearanceVS:()=>jE,_shadersPolylineCommon:()=>pd,_shadersPolylineDashMaterial:()=>RE,_shadersPolylineFS:()=>Xx,_shadersPolylineGlowMaterial:()=>ZE,_shadersPolylineMaterialAppearanceVS:()=>qE,_shadersPolylineOutlineMaterial:()=>GE,_shadersPolylineShadowVolumeFS:()=>zE,_shadersPolylineShadowVolumeMorphFS:()=>KE,_shadersPolylineShadowVolumeMorphVS:()=>JE,_shadersPolylineShadowVolumeVS:()=>QE,_shadersPolylineVS:()=>P2,_shadersPrimitiveOutlineStageFS:()=>YW,_shadersPrimitiveOutlineStageVS:()=>OW,_shadersRGBToHSB:()=>hZ,_shadersRGBToHSL:()=>fZ,_shadersRGBToXYZ:()=>pZ,_shadersReinhardTonemapping:()=>qF,_shadersReprojectWebMercatorFS:()=>Xw,_shadersReprojectWebMercatorVS:()=>Ww,_shadersRimLightingMaterial:()=>EE,_shadersSelectedFeatureIdStageCommon:()=>JC,_shadersShadowVolumeAppearanceFS:()=>nC,_shadersShadowVolumeAppearanceVS:()=>kE,_shadersShadowVolumeFS:()=>H0,_shadersSilhouette:()=>$F,_shadersSkinningStageVS:()=>JW,_shadersSkyAtmosphereCommon:()=>lL,_shadersSkyAtmosphereFS:()=>YA,_shadersSkyAtmosphereVS:()=>HA,_shadersSkyBoxFS:()=>KA,_shadersSkyBoxVS:()=>JA,_shadersSlopeRampMaterial:()=>IE,_shadersStripeMaterial:()=>XE,_shadersSunFS:()=>jA,_shadersSunTextureFS:()=>qA,_shadersSunVS:()=>$A,_shadersTexturedMaterialAppearanceFS:()=>hE,_shadersTexturedMaterialAppearanceVS:()=>fE,_shadersVector3DTileClampedPolylinesFS:()=>O2,_shadersVector3DTileClampedPolylinesVS:()=>B2,_shadersVector3DTilePolylinesVS:()=>U2,_shadersVectorTileVS:()=>mC,_shadersVerticalExaggerationStageVS:()=>jW,_shadersViewportQuadFS:()=>mM,_shadersViewportQuadVS:()=>cx,_shadersVoxelFS:()=>xA,_shadersVoxelUtils:()=>yA,_shadersVoxelVS:()=>_A,_shadersWater:()=>PE,_shadersWaterMaskMaterial:()=>WE,_shadersXYZToRGB:()=>bZ,_shadersacesTonemapping:()=>gZ,_shadersalphaWeight:()=>yZ,_shadersantialias:()=>xZ,_shadersapplyHSBShift:()=>_Z,_shadersapproximateSphericalCoordinates:()=>TZ,_shadersapproximateTanh:()=>SZ,_shadersbackFacing:()=>CZ,_shadersbranchFreeTernary:()=>VZ,_shaderscascadeColor:()=>LZ,_shaderscascadeDistance:()=>RZ,_shaderscascadeMatrix:()=>ZZ,_shaderscascadeWeights:()=>GZ,_shadersclipPolygons:()=>EZ,_shaderscolumbusViewMorph:()=>IZ,_shaderscomputeAtmosphereColor:()=>XZ,_shaderscomputeGroundAtmosphereScattering:()=>WZ,_shaderscomputePosition:()=>PZ,_shaderscomputeScattering:()=>vZ,_shadersconvertUvToBox:()=>ZA,_shadersconvertUvToCylinder:()=>GA,_shadersconvertUvToEllipsoid:()=>EA,_shaderscosineAndSine:()=>wZ,_shadersdecompressTextureCoordinates:()=>FZ,_shadersdegreesPerRadian:()=>xR,_shadersdepthClamp:()=>AZ,_shadersdepthRange:()=>_R,_shadersdepthRangeStruct:()=>iZ,_shaderseastNorthUpToEyeCoordinates:()=>MZ,_shadersellipsoidContainsPoint:()=>NZ,_shadersellipsoidTextureCoordinates:()=>kZ,_shadersepsilon1:()=>TR,_shadersepsilon2:()=>SR,_shadersepsilon3:()=>CR,_shadersepsilon4:()=>VR,_shadersepsilon5:()=>LR,_shadersepsilon6:()=>RR,_shadersepsilon7:()=>ZR,_shadersequalsEpsilon:()=>UZ,_shaderseyeOffset:()=>DZ,_shaderseyeToWindowCoordinates:()=>BZ,_shadersfastApproximateAtan:()=>OZ,_shadersfog:()=>YZ,_shadersgammaCorrect:()=>HZ,_shadersgeodeticSurfaceNormal:()=>zZ,_shadersgetDefaultMaterial:()=>KZ,_shadersgetDynamicAtmosphereLightDirection:()=>JZ,_shadersgetLambertDiffuse:()=>QZ,_shadersgetSpecular:()=>jZ,_shadersgetWaterNoise:()=>qZ,_shadershue:()=>$Z,_shadersinfinity:()=>GR,_shadersinverseGamma:()=>eG,_shadersisEmpty:()=>tG,_shadersisFull:()=>nG,_shaderslatitudeToWebMercatorFraction:()=>iG,_shaderslineDistance:()=>oG,_shaderslinearToSrgb:()=>rG,_shadersluminance:()=>sG,_shadersmaterial:()=>oZ,_shadersmaterialInput:()=>rZ,_shadersmaximumComponent:()=>aG,_shadersmetersPerPixel:()=>cG,_shadersmodelMaterial:()=>sZ,_shadersmodelToWindowCoordinates:()=>lG,_shadersmodelVertexOutput:()=>aZ,_shadersmultiplyWithColorBalance:()=>dG,_shadersnearFarScalar:()=>uG,_shadersoctDecode:()=>mG,_shadersoneOverPi:()=>ER,_shadersoneOverTwoPi:()=>IR,_shaderspackDepth:()=>hG,_shaderspassCesium3DTile:()=>XR,_shaderspassCesium3DTileClassification:()=>WR,_shaderspassCesium3DTileClassificationIgnoreShow:()=>PR,_shaderspassClassification:()=>vR,_shaderspassCompute:()=>wR,_shaderspassEnvironment:()=>FR,_shaderspassGlobe:()=>AR,_shaderspassOpaque:()=>MR,_shaderspassOverlay:()=>NR,_shaderspassTerrainClassification:()=>kR,_shaderspassTranslucent:()=>UR,_shaderspassVoxels:()=>DR,_shaderspbrLighting:()=>fG,_shaderspbrNeutralTonemapping:()=>pG,_shadersphong:()=>bG,_shaderspi:()=>BR,_shaderspiOverFour:()=>OR,_shaderspiOverSix:()=>YR,_shaderspiOverThree:()=>HR,_shaderspiOverTwo:()=>zR,_shadersplaneDistance:()=>gG,_shaderspointAlongRay:()=>yG,_shadersradiansPerDegree:()=>KR,_shadersray:()=>cZ,_shadersrayEllipsoidIntersectionInterval:()=>xG,_shadersraySegment:()=>lZ,_shadersraySphereIntersectionInterval:()=>_G,_shadersreadDepth:()=>TG,_shadersreadNonPerspective:()=>SG,_shadersreverseLogDepth:()=>CG,_shadersround:()=>VG,_shaderssaturation:()=>LG,_shaderssceneMode2D:()=>JR,_shaderssceneMode3D:()=>QR,_shaderssceneModeColumbusView:()=>jR,_shaderssceneModeMorphing:()=>qR,_shadersshadowDepthCompare:()=>RG,_shadersshadowParameters:()=>dZ,_shadersshadowVisibility:()=>ZG,_shaderssignNotZero:()=>GG,_shaderssolarRadius:()=>$R,_shaderssphericalHarmonics:()=>EG,_shaderssrgbToLinear:()=>IG,_shaderstangentToEyeSpaceMatrix:()=>XG,_shaderstextureCube:()=>WG,_shadersthreePiOver2:()=>eZ,_shaderstransformPlane:()=>PG,_shaderstranslateRelativeToEye:()=>vG,_shaderstranslucentPhong:()=>wG,_shaderstranspose:()=>FG,_shaderstwoPi:()=>tZ,_shadersunpackClippingExtents:()=>AG,_shadersunpackDepth:()=>MG,_shadersunpackFloat:()=>NG,_shadersunpackUint:()=>kG,_shadersvalueTransform:()=>UG,_shadersvertexLogDepth:()=>DG,_shaderswebMercatorMaxLatitude:()=>nZ,_shaderswindowToEyeCoordinates:()=>BG,_shaderswriteDepthClamp:()=>OG,_shaderswriteLogDepth:()=>YG,_shaderswriteNonPerspective:()=>HG,addBuffer:()=>UI,addDefaults:()=>PI,addExtensionsRequired:()=>MI,addExtensionsUsed:()=>Iu,addPipelineExtras:()=>ag,addToArray:()=>Cs,appendForwardSlash:()=>BL,arrayRemoveDuplicates:()=>To,barycentricCoordinates:()=>dx,binarySearch:()=>Xo,buildModuleUrl:()=>nn,buildVoxelDrawCommands:()=>vA,clone:()=>Ye,combine:()=>Tt,computeFlyToLocationForRectangle:()=>ZT,createBillboardPointCallback:()=>R_,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>o9,createDefaultTerrainProviderViewModels:()=>r9,createElevationBandMaterial:()=>y6,createGooglePhotorealistic3DTileset:()=>x6,createGuid:()=>Bn,createMaterialPropertyDescriptor:()=>Wo,createOsmBuildingsAsync:()=>_6,createPropertyDescriptor:()=>ue,createRawPropertyDescriptor:()=>Bc,createTangentSpaceDebugPrimitive:()=>T6,createTaskProcessorWorker:()=>R6,createUniform:()=>nR,createUniformArray:()=>iR,createWorldBathymetryAsync:()=>xM,createWorldImageryAsync:()=>l0,createWorldTerrainAsync:()=>bS,decodeGoogleEarthEnterpriseData:()=>_M,decodeVectorPolylinePositions:()=>z2,defaultValue:()=>y,defer:()=>Sl,defined:()=>l,demodernizeShader:()=>zG,deprecationWarning:()=>us,destroyObject:()=>me,exportKml:()=>Z4,findAccessorMinMax:()=>s_,findContentMetadata:()=>W_,findGroupMetadata:()=>P_,findTileMetadata:()=>j2,forEachTextureInMaterial:()=>TC,formatError:()=>Kf,freezeRenderState:()=>L3,getAbsoluteUri:()=>Jh,getAccessorByteStride:()=>Pl,getBaseUri:()=>OL,getBinaryAccessor:()=>xd,getClipAndStyleCode:()=>iM,getClippingFunction:()=>r0,getComponentReader:()=>eb,getElement:()=>Xn,getExtensionFromUri:()=>$y,getFilenameFromUri:()=>Nb,getImageFromTypedArray:()=>MA,getImagePixels:()=>Lm,getJsonFromTypedArray:()=>vo,getMagic:()=>Om,getMetadataClassProperty:()=>UA,getMetadataProperty:()=>BA,getStringFromTypedArray:()=>El,getTimestamp:()=>Ti,hasExtension:()=>ri,heightReferenceOnEntityPropertyChanged:()=>Dp,isBitSet:()=>Gc,isBlobUri:()=>ex,isCrossOriginUrl:()=>W0,isDataUri:()=>_p,isLeapYear:()=>Vm,knockout:()=>Ce,knockout_3_5_1:()=>LS,knockout_es5:()=>zM,loadAndExecuteScript:()=>tx,loadCubeMap:()=>oE,loadImageFromTypedArray:()=>i_,loadKTX2:()=>Vl,mergeSort:()=>u0,moveTechniqueRenderStates:()=>AI,moveTechniquesToExtension:()=>NI,numberOfComponentsForType:()=>Td,objectToQuery:()=>nx,oneTimeWarning:()=>xt,parseBatchTable:()=>ub,parseFeatureMetadataLegacy:()=>gX,parseGlb:()=>wI,parseResponseHeaders:()=>YL,parseStructuralMetadata:()=>bX,pickModel:()=>$C,pointInsideTriangle:()=>G7,preprocess3DTileContent:()=>Rf,processVoxelProperties:()=>PA,queryToObject:()=>ad,readAccessorPacked:()=>DI,removeExtension:()=>a_,removeExtensionsRequired:()=>vI,removeExtensionsUsed:()=>r_,removePipelineExtras:()=>FI,removeUnusedElements:()=>kI,resizeImageToNextPowerOfTwo:()=>dg,sampleTerrain:()=>pw,sampleTerrainMostDetailed:()=>RT,scaleToGeodeticSurface:()=>qy,srgbToLinear:()=>gS,subdivideArray:()=>UE,subscribeAndEvaluate:()=>Ca,updateAccessorComponentTypes:()=>BI,updateVersion:()=>OI,usesExtension:()=>ar,viewerCesium3DTilesInspectorMixin:()=>K6,viewerCesiumInspectorMixin:()=>J6,viewerDragDropMixin:()=>j6,viewerPerformanceWatchdogMixin:()=>q6,viewerVoxelInspectorMixin:()=>$6,webGLConstantToGlslType:()=>E7,wrapFunction:()=>TM,writeTextToCanvas:()=>G_});var sWo=T(S(),1);var Gro=T(S(),1);var qVt=T(S(),1);var SVt=T(S(),1);var dVt=T(S(),1);var iVt=T(S(),1);function UCe(e){return e!=null}var l=UCe;var sVt=T(S(),1);function Qy(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Qy.prototype=Object.create(Error.prototype),Qy.prototype.constructor=Qy);Qy.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};Qy.throwInstantiationError=function(){throw new Qy("This function defines an interface and should not be called directly.")};var pe=Qy;var Ts={};Ts.typeOf={};function DCe(e){return`${e} is required, actual value was undefined`}function ES(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Ts.defined=function(e,t){if(!l(t))throw new pe(DCe(e))};Ts.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(ES(typeof t,"function",e))};Ts.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(ES(typeof t,"string",e))};Ts.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(ES(typeof t,"number",e))};Ts.typeOf.number.lessThan=function(e,t,n){if(Ts.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Ts.typeOf.number.lessThanOrEquals=function(e,t,n){if(Ts.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Ts.typeOf.number.greaterThan=function(e,t,n){if(Ts.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Ts.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Ts.typeOf.number(e,t),t0?1:-1});at.signNotZero=function(e){return e<0?-1:1};at.toSNorm=function(e,t){return t=y(t,255),Math.round((at.clamp(e,-1,1)*.5+.5)*t)};at.fromSNorm=function(e,t){return t=y(t,255),at.clamp(e,0,t)/t*2-1};at.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:at.clamp((e-t)/n,0,1)};at.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});at.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});at.lerp=function(e,t,n){return(1-n)*e+n*t};at.PI=Math.PI;at.ONE_OVER_PI=1/Math.PI;at.PI_OVER_TWO=Math.PI/2;at.PI_OVER_THREE=Math.PI/3;at.PI_OVER_FOUR=Math.PI/4;at.PI_OVER_SIX=Math.PI/6;at.THREE_PI_OVER_TWO=3*Math.PI/2;at.TWO_PI=2*Math.PI;at.ONE_OVER_TWO_PI=1/(2*Math.PI);at.RADIANS_PER_DEGREE=Math.PI/180;at.DEGREES_PER_RADIAN=180/Math.PI;at.RADIANS_PER_ARCSECOND=at.RADIANS_PER_DEGREE/3600;at.toRadians=function(e){return e*at.RADIANS_PER_DEGREE};at.toDegrees=function(e){return e*at.DEGREES_PER_RADIAN};at.convertLongitudeRange=function(e){let t=at.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};at.clampToLatitudeRange=function(e){return at.clamp(e,-1*at.PI_OVER_TWO,at.PI_OVER_TWO)};at.negativePiToPi=function(e){return e>=-at.PI&&e<=at.PI?e:at.zeroToTwoPi(e+at.PI)-at.PI};at.zeroToTwoPi=function(e){if(e>=0&&e<=at.TWO_PI)return e;let t=at.mod(e,at.TWO_PI);return Math.abs(t)at.EPSILON14?at.TWO_PI:t};at.mod=function(e,t){return at.sign(e)===at.sign(t)&&Math.abs(e)n};at.greaterThanOrEquals=function(e,t,n){return e-t>-n};var B9=[1];at.factorial=function(e){let t=B9.length;if(e>=t){let n=B9[t-1];for(let i=t;i<=e;i++){let o=n*i;B9.push(o),n=o}}return B9[e]};at.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};at.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};at.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};at.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};at.clamp=function(e,t,n){return en?n:e};var rq=new FO.default;at.setRandomNumberSeed=function(e){rq=new FO.default(e)};at.nextRandomNumber=function(){return rq.random()};at.randomBetween=function(e,t){return at.nextRandomNumber()*(t-e)+e};at.acosClamped=function(e){return Math.acos(at.clamp(e,-1,1))};at.asinClamped=function(e){return Math.asin(at.clamp(e,-1,1))};at.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};at.logBase=function(e,t){return Math.log(e)/Math.log(t)};at.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});at.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});at.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};at.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};at.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=at.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?at.PI_OVER_TWO-i:i,i=e<0?at.PI-i:i,i=t<0?-i:i,i};var W=at;function $e(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}$e.fromSpherical=function(e,t){l(t)||(t=new $e);let n=e.clock,i=e.cone,o=y(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};$e.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new $e(e,t,n)};$e.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new $e(e.x,e.y,e.z)};$e.fromCartesian4=$e.clone;$e.packedLength=3;$e.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};$e.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new $e),n.x=e[t++],n.y=e[t++],n.z=e[t],n};$e.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;oi&&(o=d,i=u)}let r=1,s=0,a=kO[o],c=UO[o];if(Math.abs(e[tt.getElementIndex(c,a)])>n){let d=e[tt.getElementIndex(c,c)],u=e[tt.getElementIndex(a,a)],h=e[tt.getElementIndex(c,a)],p=(d-u)/2/h,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(c,c)]=r,t[tt.getElementIndex(c,a)]=s,t[tt.getElementIndex(a,c)]=-s,t}var z9=new tt,dq=new tt;tt.computeEigenDecomposition=function(e,t){let n=W.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),c=n*jCe(a);for(;rc;)$Ce(a,z9),tt.transpose(z9,dq),tt.multiply(a,z9,a),tt.multiply(dq,a,a),tt.multiply(s,z9,s),++o>2&&(++r,o=0);return t};tt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};tt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],d=e[8];return t*(r*d-c*s)+o*(c*i-n*d)+a*(n*s-r*i)};tt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],d=e[7],u=e[8],h=tt.determinant(e);t[0]=s*u-d*a,t[1]=d*o-i*u,t[2]=i*a-s*o,t[3]=c*a-r*u,t[4]=n*u-c*o,t[5]=r*o-n*a,t[6]=r*d-c*s,t[7]=c*i-n*d,t[8]=n*s-r*i;let p=1/h;return tt.multiplyByScalar(t,p,t)};var e1e=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,e1e),t)};tt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};tt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var $=tt;var WVt=T(S(),1);function AL(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(AL.prototype=Object.create(Error.prototype),AL.prototype.constructor=AL);AL.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var ae=AL;function et(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,x){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(d,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(u,0),this[11]=y(f,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(h,0),this[15]=y(x,0)}et.packedLength=16;et.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};et.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new et),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};et.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ws.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ws.fromTypedArray=function(e){if(e instanceof Uint8Array)return ws.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ws.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ws.UNSIGNED_INT};var Ae=Object.freeze(ws);var aLt=T(S(),1);var HM={STREAM_DRAW:ie.STREAM_DRAW,STATIC_DRAW:ie.STATIC_DRAW,DYNAMIC_DRAW:ie.DYNAMIC_DRAW,validate:function(e){return e===HM.STREAM_DRAW||e===HM.STATIC_DRAW||e===HM.DYNAMIC_DRAW}},Me=Object.freeze(HM);function pu(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Bn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}pu.createVertexBuffer=function(e){return new pu({context:e.context,bufferTarget:ie.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};pu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ae.getSizeInBytes(n),o=new pu({context:t,bufferTarget:ie.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(pu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});pu.prototype._getBuffer=function(){return this._buffer};pu.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};pu.prototype.copyFromBuffer=function(e,t,n,i){let o=ie.COPY_READ_BUFFER,r=ie.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};pu.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=ie.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};pu.prototype.isDestroyed=function(){return!1};pu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),me(this)};var xt=pu;var PLt=T(S(),1);var ELt=T(S(),1);var CLt=T(S(),1);var yLt=T(S(),1);var G0,Ir={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},xl={};Object.defineProperties(xl,{element:{get:function(){if(xl.supportsFullscreen())return document[Ir.fullscreenElement]}},changeEventName:{get:function(){if(xl.supportsFullscreen())return Ir.fullscreenchange}},errorEventName:{get:function(){if(xl.supportsFullscreen())return Ir.fullscreenerror}},enabled:{get:function(){if(xl.supportsFullscreen())return document[Ir.fullscreenEnabled]}},fullscreen:{get:function(){if(xl.supportsFullscreen())return xl.element!==null}}});xl.supportsFullscreen=function(){if(l(G0))return G0;G0=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Ir.requestFullscreen="requestFullscreen",Ir.exitFullscreen="exitFullscreen",Ir.fullscreenEnabled="fullscreenEnabled",Ir.fullscreenElement="fullscreenElement",Ir.fullscreenchange="fullscreenchange",Ir.fullscreenerror="fullscreenerror",G0=!0,G0;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i{let t=new Image;t.onload=function(){Wc._result=t.width>0&&t.height>0,e(Wc._result)},t.onerror=function(){Wc._result=!1,e(Wc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Wc._promise};Object.defineProperties(Wc,{initialized:{get:function(){return l(Wc._result)}}});var XS=[];typeof ArrayBuffer<"u"&&(XS.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&XS.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&XS.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&XS.push(BigInt64Array),typeof BigUint64Array<"u"&&XS.push(BigUint64Array));var bu={isChrome:H3,chromeVersion:f1e,isSafari:fq,safariVersion:p1e,isWebkit:pq,webkitVersion:b1e,isInternetExplorer:bq,internetExplorerVersion:g1e,isEdge:$M,edgeVersion:y1e,isFirefox:eN,firefoxVersion:T1e,isWindows:x1e,isIPadOrIOS:_1e,hardwareConcurrency:y(ja.hardwareConcurrency,3),supportsPointerEvents:S1e,supportsImageRenderingPixelated:xq,supportsWebP:Wc,imageRenderingValue:C1e,typedArrayTypes:XS};bu.supportsBasis=function(e){return bu.supportsWebAssembly()&&e.context.supportsBasis};bu.supportsFullscreen=function(){return br.supportsFullscreen()};bu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};bu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};bu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};bu.supportsBigInt=function(){return typeof BigInt<"u"};bu.supportsWebWorkers=function(){return typeof Worker<"u"};bu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};bu.supportsWebgl2=function(e){return e.context.webgl2};bu.supportsEsmWebWorkers=function(){return!eN()||parseInt(z3)>=114};var Ot=bu;function K3(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function re(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}re.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new re(e.x,e.y,e.z,e.w)};re.fromBytes=function(e,t,n,i,o){return e=re.byteToFloat(y(e,255)),t=re.byteToFloat(y(t,255)),n=re.byteToFloat(y(n,255)),i=re.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new re(e,t,n,i)};re.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new re(e.red,e.green,e.blue,t)};var J3,Q3,gp;Ot.supportsTypedArrays()&&(J3=new ArrayBuffer(4),Q3=new Uint32Array(J3),gp=new Uint8Array(J3));re.fromRgba=function(e,t){return Q3[0]=e,re.fromBytes(gp[0],gp[1],gp[2],gp[3],t)};re.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let d=2*n-c;r=K3(d,c,e+1/3),s=K3(d,c,e),a=K3(d,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new re(r,s,a,i)};re.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+W.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+W.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+W.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+W.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new re(n,i,o,r)};var V1e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,L1e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,R1e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,Z1e=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;re.fromCssColorString=function(e,t){l(t)||(t=new re),e=e.trim();let n=re[e.toUpperCase()];if(l(n))return re.clone(n,t),t;let i=V1e.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=L1e.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=R1e.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=Z1e.exec(e),i!==null?re.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};re.packedLength=4;re.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};re.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new re),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};re.byteToFloat=function(e){return e/255};re.floatToByte=function(e){return e===1?255:e*256|0};re.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new re(e.red,e.green,e.blue,e.alpha)};re.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};re.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};re.prototype.clone=function(e){return re.clone(this,e)};re.prototype.equals=function(e){return re.equals(this,e)};re.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};re.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};re.prototype.toCssColorString=function(){let e=re.floatToByte(this.red),t=re.floatToByte(this.green),n=re.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};re.prototype.toCssHexString=function(){let e=re.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=re.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=re.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=re.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};re.prototype.toBytes=function(e){let t=re.floatToByte(this.red),n=re.floatToByte(this.green),i=re.floatToByte(this.blue),o=re.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};re.prototype.toRgba=function(){return gp[0]=re.floatToByte(this.red),gp[1]=re.floatToByte(this.green),gp[2]=re.floatToByte(this.blue),gp[3]=re.floatToByte(this.alpha),Q3[0]};re.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};re.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};re.prototype.withAlpha=function(e,t){return re.fromAlpha(this,e,t)};re.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};re.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};re.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};re.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};re.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};re.lerp=function(e,t,n,i){return i.red=W.lerp(e.red,t.red,n),i.green=W.lerp(e.green,t.green,n),i.blue=W.lerp(e.blue,t.blue,n),i.alpha=W.lerp(e.alpha,t.alpha,n),i};re.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};re.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};re.ALICEBLUE=Object.freeze(re.fromCssColorString("#F0F8FF"));re.ANTIQUEWHITE=Object.freeze(re.fromCssColorString("#FAEBD7"));re.AQUA=Object.freeze(re.fromCssColorString("#00FFFF"));re.AQUAMARINE=Object.freeze(re.fromCssColorString("#7FFFD4"));re.AZURE=Object.freeze(re.fromCssColorString("#F0FFFF"));re.BEIGE=Object.freeze(re.fromCssColorString("#F5F5DC"));re.BISQUE=Object.freeze(re.fromCssColorString("#FFE4C4"));re.BLACK=Object.freeze(re.fromCssColorString("#000000"));re.BLANCHEDALMOND=Object.freeze(re.fromCssColorString("#FFEBCD"));re.BLUE=Object.freeze(re.fromCssColorString("#0000FF"));re.BLUEVIOLET=Object.freeze(re.fromCssColorString("#8A2BE2"));re.BROWN=Object.freeze(re.fromCssColorString("#A52A2A"));re.BURLYWOOD=Object.freeze(re.fromCssColorString("#DEB887"));re.CADETBLUE=Object.freeze(re.fromCssColorString("#5F9EA0"));re.CHARTREUSE=Object.freeze(re.fromCssColorString("#7FFF00"));re.CHOCOLATE=Object.freeze(re.fromCssColorString("#D2691E"));re.CORAL=Object.freeze(re.fromCssColorString("#FF7F50"));re.CORNFLOWERBLUE=Object.freeze(re.fromCssColorString("#6495ED"));re.CORNSILK=Object.freeze(re.fromCssColorString("#FFF8DC"));re.CRIMSON=Object.freeze(re.fromCssColorString("#DC143C"));re.CYAN=Object.freeze(re.fromCssColorString("#00FFFF"));re.DARKBLUE=Object.freeze(re.fromCssColorString("#00008B"));re.DARKCYAN=Object.freeze(re.fromCssColorString("#008B8B"));re.DARKGOLDENROD=Object.freeze(re.fromCssColorString("#B8860B"));re.DARKGRAY=Object.freeze(re.fromCssColorString("#A9A9A9"));re.DARKGREEN=Object.freeze(re.fromCssColorString("#006400"));re.DARKGREY=re.DARKGRAY;re.DARKKHAKI=Object.freeze(re.fromCssColorString("#BDB76B"));re.DARKMAGENTA=Object.freeze(re.fromCssColorString("#8B008B"));re.DARKOLIVEGREEN=Object.freeze(re.fromCssColorString("#556B2F"));re.DARKORANGE=Object.freeze(re.fromCssColorString("#FF8C00"));re.DARKORCHID=Object.freeze(re.fromCssColorString("#9932CC"));re.DARKRED=Object.freeze(re.fromCssColorString("#8B0000"));re.DARKSALMON=Object.freeze(re.fromCssColorString("#E9967A"));re.DARKSEAGREEN=Object.freeze(re.fromCssColorString("#8FBC8F"));re.DARKSLATEBLUE=Object.freeze(re.fromCssColorString("#483D8B"));re.DARKSLATEGRAY=Object.freeze(re.fromCssColorString("#2F4F4F"));re.DARKSLATEGREY=re.DARKSLATEGRAY;re.DARKTURQUOISE=Object.freeze(re.fromCssColorString("#00CED1"));re.DARKVIOLET=Object.freeze(re.fromCssColorString("#9400D3"));re.DEEPPINK=Object.freeze(re.fromCssColorString("#FF1493"));re.DEEPSKYBLUE=Object.freeze(re.fromCssColorString("#00BFFF"));re.DIMGRAY=Object.freeze(re.fromCssColorString("#696969"));re.DIMGREY=re.DIMGRAY;re.DODGERBLUE=Object.freeze(re.fromCssColorString("#1E90FF"));re.FIREBRICK=Object.freeze(re.fromCssColorString("#B22222"));re.FLORALWHITE=Object.freeze(re.fromCssColorString("#FFFAF0"));re.FORESTGREEN=Object.freeze(re.fromCssColorString("#228B22"));re.FUCHSIA=Object.freeze(re.fromCssColorString("#FF00FF"));re.GAINSBORO=Object.freeze(re.fromCssColorString("#DCDCDC"));re.GHOSTWHITE=Object.freeze(re.fromCssColorString("#F8F8FF"));re.GOLD=Object.freeze(re.fromCssColorString("#FFD700"));re.GOLDENROD=Object.freeze(re.fromCssColorString("#DAA520"));re.GRAY=Object.freeze(re.fromCssColorString("#808080"));re.GREEN=Object.freeze(re.fromCssColorString("#008000"));re.GREENYELLOW=Object.freeze(re.fromCssColorString("#ADFF2F"));re.GREY=re.GRAY;re.HONEYDEW=Object.freeze(re.fromCssColorString("#F0FFF0"));re.HOTPINK=Object.freeze(re.fromCssColorString("#FF69B4"));re.INDIANRED=Object.freeze(re.fromCssColorString("#CD5C5C"));re.INDIGO=Object.freeze(re.fromCssColorString("#4B0082"));re.IVORY=Object.freeze(re.fromCssColorString("#FFFFF0"));re.KHAKI=Object.freeze(re.fromCssColorString("#F0E68C"));re.LAVENDER=Object.freeze(re.fromCssColorString("#E6E6FA"));re.LAVENDAR_BLUSH=Object.freeze(re.fromCssColorString("#FFF0F5"));re.LAWNGREEN=Object.freeze(re.fromCssColorString("#7CFC00"));re.LEMONCHIFFON=Object.freeze(re.fromCssColorString("#FFFACD"));re.LIGHTBLUE=Object.freeze(re.fromCssColorString("#ADD8E6"));re.LIGHTCORAL=Object.freeze(re.fromCssColorString("#F08080"));re.LIGHTCYAN=Object.freeze(re.fromCssColorString("#E0FFFF"));re.LIGHTGOLDENRODYELLOW=Object.freeze(re.fromCssColorString("#FAFAD2"));re.LIGHTGRAY=Object.freeze(re.fromCssColorString("#D3D3D3"));re.LIGHTGREEN=Object.freeze(re.fromCssColorString("#90EE90"));re.LIGHTGREY=re.LIGHTGRAY;re.LIGHTPINK=Object.freeze(re.fromCssColorString("#FFB6C1"));re.LIGHTSEAGREEN=Object.freeze(re.fromCssColorString("#20B2AA"));re.LIGHTSKYBLUE=Object.freeze(re.fromCssColorString("#87CEFA"));re.LIGHTSLATEGRAY=Object.freeze(re.fromCssColorString("#778899"));re.LIGHTSLATEGREY=re.LIGHTSLATEGRAY;re.LIGHTSTEELBLUE=Object.freeze(re.fromCssColorString("#B0C4DE"));re.LIGHTYELLOW=Object.freeze(re.fromCssColorString("#FFFFE0"));re.LIME=Object.freeze(re.fromCssColorString("#00FF00"));re.LIMEGREEN=Object.freeze(re.fromCssColorString("#32CD32"));re.LINEN=Object.freeze(re.fromCssColorString("#FAF0E6"));re.MAGENTA=Object.freeze(re.fromCssColorString("#FF00FF"));re.MAROON=Object.freeze(re.fromCssColorString("#800000"));re.MEDIUMAQUAMARINE=Object.freeze(re.fromCssColorString("#66CDAA"));re.MEDIUMBLUE=Object.freeze(re.fromCssColorString("#0000CD"));re.MEDIUMORCHID=Object.freeze(re.fromCssColorString("#BA55D3"));re.MEDIUMPURPLE=Object.freeze(re.fromCssColorString("#9370DB"));re.MEDIUMSEAGREEN=Object.freeze(re.fromCssColorString("#3CB371"));re.MEDIUMSLATEBLUE=Object.freeze(re.fromCssColorString("#7B68EE"));re.MEDIUMSPRINGGREEN=Object.freeze(re.fromCssColorString("#00FA9A"));re.MEDIUMTURQUOISE=Object.freeze(re.fromCssColorString("#48D1CC"));re.MEDIUMVIOLETRED=Object.freeze(re.fromCssColorString("#C71585"));re.MIDNIGHTBLUE=Object.freeze(re.fromCssColorString("#191970"));re.MINTCREAM=Object.freeze(re.fromCssColorString("#F5FFFA"));re.MISTYROSE=Object.freeze(re.fromCssColorString("#FFE4E1"));re.MOCCASIN=Object.freeze(re.fromCssColorString("#FFE4B5"));re.NAVAJOWHITE=Object.freeze(re.fromCssColorString("#FFDEAD"));re.NAVY=Object.freeze(re.fromCssColorString("#000080"));re.OLDLACE=Object.freeze(re.fromCssColorString("#FDF5E6"));re.OLIVE=Object.freeze(re.fromCssColorString("#808000"));re.OLIVEDRAB=Object.freeze(re.fromCssColorString("#6B8E23"));re.ORANGE=Object.freeze(re.fromCssColorString("#FFA500"));re.ORANGERED=Object.freeze(re.fromCssColorString("#FF4500"));re.ORCHID=Object.freeze(re.fromCssColorString("#DA70D6"));re.PALEGOLDENROD=Object.freeze(re.fromCssColorString("#EEE8AA"));re.PALEGREEN=Object.freeze(re.fromCssColorString("#98FB98"));re.PALETURQUOISE=Object.freeze(re.fromCssColorString("#AFEEEE"));re.PALEVIOLETRED=Object.freeze(re.fromCssColorString("#DB7093"));re.PAPAYAWHIP=Object.freeze(re.fromCssColorString("#FFEFD5"));re.PEACHPUFF=Object.freeze(re.fromCssColorString("#FFDAB9"));re.PERU=Object.freeze(re.fromCssColorString("#CD853F"));re.PINK=Object.freeze(re.fromCssColorString("#FFC0CB"));re.PLUM=Object.freeze(re.fromCssColorString("#DDA0DD"));re.POWDERBLUE=Object.freeze(re.fromCssColorString("#B0E0E6"));re.PURPLE=Object.freeze(re.fromCssColorString("#800080"));re.RED=Object.freeze(re.fromCssColorString("#FF0000"));re.ROSYBROWN=Object.freeze(re.fromCssColorString("#BC8F8F"));re.ROYALBLUE=Object.freeze(re.fromCssColorString("#4169E1"));re.SADDLEBROWN=Object.freeze(re.fromCssColorString("#8B4513"));re.SALMON=Object.freeze(re.fromCssColorString("#FA8072"));re.SANDYBROWN=Object.freeze(re.fromCssColorString("#F4A460"));re.SEAGREEN=Object.freeze(re.fromCssColorString("#2E8B57"));re.SEASHELL=Object.freeze(re.fromCssColorString("#FFF5EE"));re.SIENNA=Object.freeze(re.fromCssColorString("#A0522D"));re.SILVER=Object.freeze(re.fromCssColorString("#C0C0C0"));re.SKYBLUE=Object.freeze(re.fromCssColorString("#87CEEB"));re.SLATEBLUE=Object.freeze(re.fromCssColorString("#6A5ACD"));re.SLATEGRAY=Object.freeze(re.fromCssColorString("#708090"));re.SLATEGREY=re.SLATEGRAY;re.SNOW=Object.freeze(re.fromCssColorString("#FFFAFA"));re.SPRINGGREEN=Object.freeze(re.fromCssColorString("#00FF7F"));re.STEELBLUE=Object.freeze(re.fromCssColorString("#4682B4"));re.TAN=Object.freeze(re.fromCssColorString("#D2B48C"));re.TEAL=Object.freeze(re.fromCssColorString("#008080"));re.THISTLE=Object.freeze(re.fromCssColorString("#D8BFD8"));re.TOMATO=Object.freeze(re.fromCssColorString("#FF6347"));re.TURQUOISE=Object.freeze(re.fromCssColorString("#40E0D0"));re.VIOLET=Object.freeze(re.fromCssColorString("#EE82EE"));re.WHEAT=Object.freeze(re.fromCssColorString("#F5DEB3"));re.WHITE=Object.freeze(re.fromCssColorString("#FFFFFF"));re.WHITESMOKE=Object.freeze(re.fromCssColorString("#F5F5F5"));re.YELLOW=Object.freeze(re.fromCssColorString("#FFFF00"));re.YELLOWGREEN=Object.freeze(re.fromCssColorString("#9ACD32"));re.TRANSPARENT=Object.freeze(new re(0,0,0,0));var B=re;function tN(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}tN.ALL=Object.freeze(new tN({color:new B(0,0,0,0),depth:1,stencil:0}));tN.prototype.execute=function(e,t){e.clear(this,t)};var $n=tN;var NLt=T(S(),1);var wLt=T(S(),1),G1e={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Ee=Object.freeze(G1e);function _q(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=Ee.COMPUTE,this.owner=e.owner}_q.prototype.execute=function(e){e.execute(this)};var Pc=_q;var jXt=T(S(),1);var gIt=T(S(),1);var OLt=T(S(),1);function Nt(e,t){this.x=y(e,0),this.y=y(t,0)}Nt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Nt(e,t)};Nt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Nt(e.x,e.y)};Nt.fromCartesian3=Nt.clone;Nt.fromCartesian4=Nt.clone;Nt.packedLength=2;Nt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Nt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Nt),n.x=e[t++],n.y=e[t],n};Nt.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;oW.EPSILON12);return l(o)?(o.x=r*w,o.y=s*F,o.z=a*b,o):new m(r*w,s*F,a*b)}var qy=W1e;function Mo(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Mo.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Mo(e,t,n)};Mo.fromDegrees=function(e,t,n,i){return e=W.toRadians(e),t=W.toRadians(t),Mo.fromRadians(e,t,n,i)};var P1e=new m,v1e=new m,w1e=new m;Mo._ellipsoidOneOverRadii=new m(1/6378137,1/6378137,1/6356752314245179e-9);Mo._ellipsoidOneOverRadiiSquared=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Mo._ellipsoidCenterToleranceSquared=W.EPSILON1;Mo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:Mo._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:Mo._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:Mo._ellipsoidCenterToleranceSquared,s=qy(e,i,o,r,v1e);if(!l(s))return;let a=m.multiplyComponents(s,o,P1e);a=m.normalize(a,a);let c=m.subtract(e,s,w1e),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),h=W.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=d,n.latitude=u,n.height=h,n):new Mo(d,u,h)};Mo.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Mo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Mo(e.longitude,e.latitude,e.height)};Mo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Mo.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Mo.ZERO=Object.freeze(new Mo(0,0,0));Mo.prototype.clone=function(e){return Mo.clone(this,e)};Mo.prototype.equals=function(e){return Mo.equals(this,e)};Mo.prototype.equalsEpsilon=function(e,t){return Mo.equalsEpsilon(this,e,t)};Mo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=Mo;var uRt=T(S(),1);function Lq(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=W.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function pi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Lq(this,e,t,n)}Object.defineProperties(pi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});pi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new pi(n.x,n.y,n.z)};pi.fromCartesian3=function(e,t){return l(t)||(t=new pi),l(e)&&Lq(t,e.x,e.y,e.z),t};pi.WGS84=Object.freeze(new pi(6378137,6378137,6356752314245179e-9));pi.UNIT_SPHERE=Object.freeze(new pi(1,1,1));pi.MOON=Object.freeze(new pi(W.LUNAR_RADIUS,W.LUNAR_RADIUS,W.LUNAR_RADIUS));pi._default=pi.WGS84;Object.defineProperties(pi,{default:{get:function(){return pi._default},set:function(e){pi._default=e,m._ellipsoidRadiiSquared=e.radiiSquared,he._ellipsoidOneOverRadii=e.oneOverRadii,he._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});pi.prototype.clone=function(e){return pi.clone(this,e)};pi.packedLength=m.packedLength;pi.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),t};pi.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t);return pi.fromCartesian3(i,n)};pi.prototype.geocentricSurfaceNormal=m.normalize;pi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=r,t.y=s,t.z=a,m.normalize(t,t)};pi.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,W.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var F1e=new m,A1e=new m;pi.prototype.cartographicToCartesian=function(e,t){let n=F1e,i=A1e;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,o,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};pi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=this._radii.z-t))return n};var U1e=new m;pi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new D);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,U1e),i=m.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return D.fromElements(1/i,1/r,t)};var D1e=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],B1e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Vq(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*D1e[s];r+=B1e[s]*(n(i+a)+n(i-a))}return r*=o,r}pi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n0){o=r-1;continue}return r}return~(o+1)}var Io=Y1e;var VRt=T(S(),1);function H1e(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var E0=H1e;var KRt=T(S(),1);var WRt=T(S(),1);var RRt=T(S(),1);function z1e(e){return e%4===0&&e%100!==0||e%400===0}var Vm=z1e;var Rq=[31,28,31,30,31,30,31,31,30,31,30,31];function K1e(e,t,n,i,o,r,s,a){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,0),o=y(o,0),r=y(r,0),s=y(s,0),a=y(a,!1),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function x(){xo.typeOf.number.greaterThanOrEquals("Year",e,1),xo.typeOf.number.lessThanOrEquals("Year",e,9999),xo.typeOf.number.greaterThanOrEquals("Month",t,1),xo.typeOf.number.lessThanOrEquals("Month",t,12),xo.typeOf.number.greaterThanOrEquals("Day",n,1),xo.typeOf.number.lessThanOrEquals("Day",n,31),xo.typeOf.number.greaterThanOrEquals("Hour",i,0),xo.typeOf.number.lessThanOrEquals("Hour",i,23),xo.typeOf.number.greaterThanOrEquals("Minute",o,0),xo.typeOf.number.lessThanOrEquals("Minute",o,59),xo.typeOf.bool("IsLeapSecond",a),xo.typeOf.number.greaterThanOrEquals("Second",r,0),xo.typeOf.number.lessThanOrEquals("Second",r,a?60:59),xo.typeOf.number.greaterThanOrEquals("Millisecond",s,0),xo.typeOf.number.lessThan("Millisecond",s,1e3)}function _(){let C=t===2&&Vm(e)?Rq[t-1]+1:Rq[t-1];if(n>C)throw new pe("Month and Day represents invalid date")}}var yp=K1e;var vRt=T(S(),1);function J1e(e,t){this.julianDate=e,this.offset=t}var Yi=J1e;var FRt=T(S(),1),Q1e={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},zn=Object.freeze(Q1e);var MRt=T(S(),1),j1e={UTC:0,TAI:1},Hn=Object.freeze(j1e);var Gq=new yp,j3=[31,28,31,30,31,30,31,31,30,31,30,31],q3=29;function $3(e,t){return vt.compare(e.julianDate,t.julianDate)}var WS=new Yi;function rN(e){WS.julianDate=e;let t=vt.leapSeconds,n=Io(t,WS,$3);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&vt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),vt.addSeconds(e,i,e)}function Zq(e,t){WS.julianDate=e;let n=vt.leapSeconds,i=Io(n,WS,$3);if(i<0&&(i=~i),i===0)return vt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return vt.addSeconds(e,-n[i-1].offset,t);let o=vt.secondsDifference(n[i].julianDate,e);if(o===0)return vt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return vt.addSeconds(e,-n[--i].offset,t)}function I0(e,t,n){let i=t/zn.SECONDS_PER_DAY|0;return e+=i,t-=zn.SECONDS_PER_DAY*i,t<0&&(e--,t+=zn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function eO(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,d=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*zn.SECONDS_PER_HOUR+o*zn.SECONDS_PER_MINUTE+s*zn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var q1e=/^(\d{4})$/,$1e=/^(\d{4})-(\d{2})$/,eVe=/^(\d{4})-?(\d{3})$/,tVe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,nVe=/^(\d{4})-?(\d{2})-?(\d{2})$/,tO=/([Z+\-])?(\d{2})?:?(\d{2})?$/,iVe=/^(\d{2})(\.\d+)?/.source+tO.source,oVe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+tO.source,rVe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+tO.source;function vt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Hn.UTC);let i=e|0;t=t+(e-i)*zn.SECONDS_PER_DAY,I0(i,t,this),n===Hn.UTC&&rN(this)}vt.fromGregorianDate=function(e,t){let n=eO(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(I0(n[0],n[1],t),rN(t),t):new vt(n[0],n[1],Hn.UTC)};vt.fromDate=function(e,t){let n=eO(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(I0(n[0],n[1],t),rN(t),t):new vt(n[0],n[1],Hn.UTC)};vt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,d=0,u=n[0],h=n[1],p,g;if(n=u.match(nVe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=u.match($1e),n!==null)i=+n[1],o=+n[2];else if(n=u.match(q1e),n!==null)i=+n[1];else{let C;if(n=u.match(eVe),n!==null)i=+n[1],C=+n[2],g=Vm(i);else if(n=u.match(tVe),n!==null){i=+n[1];let V=+n[2],L=+n[3]||0,Z=new Date(Date.UTC(i,0,4));C=V*7+L-Z.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=Vm(i);let f;if(l(h)){n=h.match(rVe),n!==null?(s=+n[1],a=+n[2],c=+n[3],d=+(n[4]||0)*1e3,f=5):(n=h.match(oVe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,f=4):(n=h.match(iVe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,f=3)));let C=n[f],V=+n[f+1],L=+(n[f+2]||0);switch(C){case"+":s=s-V,a=a-L;break;case"-":s=s+V,a=a+L;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?q3:j3[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?q3:j3[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?q3:j3[o-1],r+=p;let _=eO(i,o,r,s,a,c,d);return l(t)?(I0(_[0],_[1],t),rN(t)):t=new vt(_[0],_[1],Hn.UTC),x&&vt.addSeconds(t,1,t),t};vt.now=function(e){return vt.fromDate(new Date,e)};var oN=new vt(0,0,Hn.TAI);vt.toGregorianDate=function(e,t){let n=!1,i=Zq(e,oN);l(i)||(vt.addSeconds(e,-1,oN),i=Zq(oN,oN),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;let h=d+2-12*s|0,p=100*(a-49)+c+s|0,g=r/zn.SECONDS_PER_HOUR|0,f=r-g*zn.SECONDS_PER_HOUR,x=f/zn.SECONDS_PER_MINUTE|0;f=f-x*zn.SECONDS_PER_MINUTE;let _=f|0,C=(f-_)/zn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(_+=1),l(t)?(t.year=p,t.month=h,t.day=u,t.hour=g,t.minute=x,t.second=_,t.millisecond=C,t.isLeapSecond=n,t):new yp(p,h,u,g,x,_,C,n)};vt.toDate=function(e){let t=vt.toGregorianDate(e,Gq),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};vt.toIso8601=function(e,t){let n=vt.toGregorianDate(e,Gq),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,d=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&d===0&&(i=9999,o=12,r=31,s=24);let u;return!l(t)&&d!==0?(u=(d*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(u=(d*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`)};vt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new vt(e.dayNumber,e.secondsOfDay,Hn.TAI)};vt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};vt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};vt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(vt.secondsDifference(e,t))<=n};vt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/zn.SECONDS_PER_DAY};vt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*zn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};vt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/zn.SECONDS_PER_DAY;return n+i};vt.computeTaiMinusUtc=function(e){WS.julianDate=e;let t=vt.leapSeconds,n=Io(t,WS,$3);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};vt.addSeconds=function(e,t,n){return I0(e.dayNumber,e.secondsOfDay+t,n)};vt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*zn.SECONDS_PER_MINUTE;return I0(e.dayNumber,i,n)};vt.addHours=function(e,t,n){let i=e.secondsOfDay+t*zn.SECONDS_PER_HOUR;return I0(e.dayNumber,i,n)};vt.addDays=function(e,t,n){let i=e.dayNumber+t;return I0(i,e.secondsOfDay,n)};vt.lessThan=function(e,t){return vt.compare(e,t)<0};vt.lessThanOrEquals=function(e,t){return vt.compare(e,t)<=0};vt.greaterThan=function(e,t){return vt.compare(e,t)>0};vt.greaterThanOrEquals=function(e,t){return vt.compare(e,t)>=0};vt.prototype.clone=function(e){return vt.clone(this,e)};vt.prototype.equals=function(e){return vt.equals(this,e)};vt.prototype.equalsEpsilon=function(e,t){return vt.equalsEpsilon(this,e,t)};vt.prototype.toString=function(){return vt.toIso8601(this)};vt.leapSeconds=[new Yi(new vt(2441317,43210,Hn.TAI),10),new Yi(new vt(2441499,43211,Hn.TAI),11),new Yi(new vt(2441683,43212,Hn.TAI),12),new Yi(new vt(2442048,43213,Hn.TAI),13),new Yi(new vt(2442413,43214,Hn.TAI),14),new Yi(new vt(2442778,43215,Hn.TAI),15),new Yi(new vt(2443144,43216,Hn.TAI),16),new Yi(new vt(2443509,43217,Hn.TAI),17),new Yi(new vt(2443874,43218,Hn.TAI),18),new Yi(new vt(2444239,43219,Hn.TAI),19),new Yi(new vt(2444786,43220,Hn.TAI),20),new Yi(new vt(2445151,43221,Hn.TAI),21),new Yi(new vt(2445516,43222,Hn.TAI),22),new Yi(new vt(2446247,43223,Hn.TAI),23),new Yi(new vt(2447161,43224,Hn.TAI),24),new Yi(new vt(2447892,43225,Hn.TAI),25),new Yi(new vt(2448257,43226,Hn.TAI),26),new Yi(new vt(2448804,43227,Hn.TAI),27),new Yi(new vt(2449169,43228,Hn.TAI),28),new Yi(new vt(2449534,43229,Hn.TAI),29),new Yi(new vt(2450083,43230,Hn.TAI),30),new Yi(new vt(2450630,43231,Hn.TAI),31),new Yi(new vt(2451179,43232,Hn.TAI),32),new Yi(new vt(2453736,43233,Hn.TAI),33),new Yi(new vt(2454832,43234,Hn.TAI),34),new Yi(new vt(2456109,43235,Hn.TAI),35),new Yi(new vt(2457204,43236,Hn.TAI),36),new Yi(new vt(2457754,43237,Hn.TAI),37)];var q=vt;var DGt=T(S(),1),zq=T(rd(),1);var eZt=T(S(),1);function sVe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var kL=sVe;var iZt=T(S(),1);function wq(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=wq(o,t)),n[i]=o}return n}var Ye=wq;var aZt=T(S(),1);function Fq(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=Fq(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var St=Fq;var lZt=T(S(),1);function aVe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var _l=aVe;var hZt=T(S(),1),Aq=T(rd(),1);function nO(e,t){let n;return typeof document<"u"&&(n=document),nO._implementation(e,t,n)}nO._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new Aq.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Jh=nO;var pZt=T(S(),1),Mq=T(rd(),1);function cVe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Mq.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var UL=cVe;var gZt=T(S(),1),Nq=T(rd(),1);function lVe(e){let t=new Nq.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var $y=lVe;var _Zt=T(S(),1);var kq={};function dVe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=kq[t];l(i)||(i={},kq[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var Lm=dVe;var SZt=T(S(),1);var uVe=/^blob:/i;function mVe(e){return uVe.test(e)}var ex=mVe;var LZt=T(S(),1);var Qh;function hVe(e){l(Qh)||(Qh=document.createElement("a")),Qh.href=window.location.href;let t=Qh.host,n=Qh.protocol;return Qh.href=e,Qh.href=Qh.href,n!==Qh.protocol||t!==Qh.host}var X0=hVe;var ZZt=T(S(),1);var fVe=/^data:/i;function pVe(e){return fVe.test(e)}var xp=pVe;var EZt=T(S(),1);function bVe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var tx=bVe;var XZt=T(S(),1);function gVe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var DL=TVe;function Uq(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=DL(this.responseHeaders))}Uq.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var jh=Uq;var hGt=T(S(),1),dN=T(rd(),1);var $Zt=T(S(),1);function BL(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(BL.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});BL.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};BL.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r0){for(o.sort(SVe),e=0;e=0;--t)this.heapify(t)};ix.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(oi&&(r=t[i],this._length=i),r};ix.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return iO(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var OL=ix;function CVe(e,t){return e.priority-t.priority}var eo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},wS=20,qa=new OL({comparator:CVe});qa.maximumLength=wS;qa.reserve(wS);var qh=[],_p={},VVe=typeof document<"u"?new dN.default(document.location.href):new dN.default,uN=new be;function Jo(){}Jo.maximumRequests=50;Jo.maximumRequestsPerServer=18;Jo.requestsByServer={};Jo.throttleRequests=!0;Jo.debugShowStatistics=!1;Jo.requestCompletedEvent=uN;Object.defineProperties(Jo,{statistics:{get:function(){return eo}},priorityHeapLength:{get:function(){return wS},set:function(e){if(ee;){let t=qa.pop();ox(t)}wS=e,qa.maximumLength=e,qa.reserve(e)}}});function Dq(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Jo.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(Jo.requestsByServer[e],Jo.maximumRequestsPerServer);return _p[e]+t<=n};Jo.heapHasOpenSlots=function(e){return qa.length+e<=wS};function Bq(e){return e.state===Qn.UNISSUED&&(e.state=Qn.ISSUED,e.deferred=_l()),e.deferred.promise}function LVe(e){return function(t){if(e.state===Qn.CANCELLED)return;let n=e.deferred;--eo.numberOfActiveRequests,--_p[e.serverKey],uN.raiseEvent(),e.state=Qn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function RVe(e){return function(t){e.state!==Qn.CANCELLED&&(++eo.numberOfFailedRequests,--eo.numberOfActiveRequests,--_p[e.serverKey],uN.raiseEvent(t),e.state=Qn.FAILED,e.deferred.reject(t))}}function Oq(e){let t=Bq(e);return e.state=Qn.ACTIVE,qh.push(e),++eo.numberOfActiveRequests,++eo.numberOfActiveRequestsEver,++_p[e.serverKey],e.requestFunction().then(LVe(e)).catch(RVe(e)),t}function ox(e){let t=e.state===Qn.ACTIVE;if(e.state=Qn.CANCELLED,++eo.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--eo.numberOfActiveRequests,--_p[e.serverKey],++eo.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Jo.update=function(){let e,t,n=0,i=qh.length;for(e=0;e0&&(qh[e-n]=t)}qh.length-=n;let o=qa.internalArray,r=qa.length;for(e=0;e0;){if(t=qa.pop(),t.cancelled){ox(t);continue}if(t.throttleByServer&&!Jo.serverHasOpenSlots(t.serverKey)){ox(t);continue}Oq(t),++a}ZVe()};Jo.getServerKey=function(e){let t=new dN.default(e);t.scheme()===""&&(t=t.absoluteTo(VVe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=_p[n];return l(i)||(_p[n]=0),n};Jo.request=function(e){if(xp(e.url)||ex(e.url))return uN.raiseEvent(),e.state=Qn.RECEIVED,e.requestFunction();if(++eo.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Jo.getServerKey(e.url)),Jo.throttleRequests&&e.throttleByServer&&!Jo.serverHasOpenSlots(e.serverKey))return;if(!Jo.throttleRequests||!e.throttle)return Oq(e);if(qh.length>=Jo.maximumRequests)return;Dq(e);let t=qa.insert(e);if(l(t)){if(t===e)return;ox(t)}return Bq(e)};function ZVe(){Jo.debugShowStatistics&&(eo.numberOfActiveRequests===0&&eo.lastNumberOfActiveRequests>0&&(eo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${eo.numberOfAttemptedRequests}`),eo.numberOfAttemptedRequests=0),eo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${eo.numberOfCancelledRequests}`),eo.numberOfCancelledRequests=0),eo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${eo.numberOfCancelledActiveRequests}`),eo.numberOfCancelledActiveRequests=0),eo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${eo.numberOfFailedRequests}`),eo.numberOfFailedRequests=0)),eo.lastNumberOfActiveRequests=eo.numberOfActiveRequests)}Jo.clearForSpecs=function(){for(;qa.length>0;){let t=qa.pop();ox(t)}let e=qh.length;for(let t=0;t0}},credits:{get:function(){return this._credits}}});Xt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Xt.prototype.parseUrl=function(e,t,n,i){let o=new zq.default(e),r=EVe(o.query());this._queryParameters=t?hN(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Jh(i))),this._url=o.toString()};function EVe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:sd(e)}function hN(e,t,n){if(!n)return St(e,t);let i=Ye(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Xt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${IVe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function IVe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${nx(e)}`}Xt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=hN(this._queryParameters,e,!1):this._queryParameters=hN(e,this._queryParameters,!1)};Xt.prototype.appendQueryParameters=function(e){this._queryParameters=hN(e,this._queryParameters,!0)};Xt.prototype.setTemplateValues=function(e,t){t?this._templateValues=St(this._templateValues,e):this._templateValues=St(e,this._templateValues)};Xt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=St(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=St(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=St(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Xt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Xt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Xt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};Xt.prototype.getBaseUri=function(e){return UL(this.getUrlComponent(e),e)};Xt.prototype.appendForwardSlash=function(){this._url=kL(this._url)};Xt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Xt.fetchArrayBuffer=function(e){return new Xt(e).fetchArrayBuffer()};Xt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Xt.fetchBlob=function(e){return new Xt(e).fetchBlob()};Xt.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(rO(this.request),!Kq||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return oO({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return Xt.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return Xt.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(u);return c=new Xt({url:h}),oO({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(l(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return l(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};function oO(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=_l();return Xt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=$a.request(r);if(l(s))return s.catch(function(a){return r.state!==Qn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=Qn.UNISSUED,r.deferred=void 0,oO({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Xt.fetchImage=function(e){return new Xt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Xt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Xt.fetchText=function(e){return new Xt(e).fetchText()};Xt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Xt.fetchJson=function(e){return new Xt(e).fetchJson()};Xt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Xt.fetchXML=function(e){return new Xt(e).fetchXML()};Xt.prototype.fetchJsonp=function(e){e=y(e,"callback"),rO(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Jq(this,e,t)};function Jq(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=_l();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Xt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=$a.request(o);if(l(s))return s.catch(function(a){return o.state!==Qn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=Qn.UNISSUED,o.deferred=void 0,Jq(e,t,n)):Promise.reject(a)})})}Xt.fetchJsonp=function(e){return new Xt(e).fetchJsonp(e.callbackParameterName)};Xt.prototype._makeRequest=function(e){let t=this;rO(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=St(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=_l(),h=Xt._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(h)&&l(h.abort)&&(n.cancelFunction=function(){h.abort()}),u.promise};let o=$a.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Qn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Qn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function rO(e){if(e.state===Qn.ISSUED||e.state===Qn.ACTIVE)throw new ae("The Resource is already being fetched.");e.state=Qn.UNISSUED,e.deferred=void 0}var XVe=/^data:(.*?)(;base64)?,(.*)$/;function mN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Hq(e,t){let n=mN(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r{if(!a.ok){let c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new jh(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new jh)})}var vVe=typeof XMLHttpRequest>"u";Xt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=XVe.exec(e);if(a!==null){r.resolve(WVe(a,t));return}if(vVe){PVe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(AS.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);l(t)&&(c.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new jh(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,h=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};g.forEach(function(x){let _=x.split(": "),C=_.shift();f[C]=_.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve(void 0);else if(l(u)&&(!l(t)||h===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(h===""||h==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(h===""||h==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new ae("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new jh)},c.send(i),c};Xt._Implementations.loadAndExecuteScript=function(e,t,n){return tx(e,t).catch(function(i){n.reject(i)})};Xt._DefaultImplementations={};Xt._DefaultImplementations.createImage=Xt._Implementations.createImage;Xt._DefaultImplementations.loadWithXhr=Xt._Implementations.loadWithXhr;Xt._DefaultImplementations.loadAndExecuteScript=Xt._Implementations.loadAndExecuteScript;Xt.DEFAULT=Object.freeze(new Xt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ze=Xt;function zL(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?Qq(this,e.data):Qq(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}zL.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ze.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ae(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new zL({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};zL.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new E0(0,0,0,0,0),t}});zL.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new E0(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],d=q.lessThanOrEquals(a,e),u=!l(c),h=u||q.greaterThanOrEquals(c,e);if(d&&h)return o=i,!u&&c.equals(e)&&++o,r=o+1,qq(this,n,this._samples,e,o,r,t),t}let s=Io(n,e,q.compare,this._dateColumn);return s>=0?(st.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],d=t[r];if(c.equals(d)||i.equals(c))return jq(e,n,o,a,s),s;if(i.equals(d))return jq(e,n,r,a,s),s;let u=q.secondsDifference(i,c)/q.secondsDifference(d,c),h=o*a,p=r*a,g=n[h+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],x=f-g;if(x>.5||x<-.5){let _=n[h+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];_!==C&&(d.equals(i)?g=f:f-=C-_)}return s.xPoleWander=HL(u,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=HL(u,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=HL(u,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=HL(u,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=HL(u,g,f),s}var KL=zL;var rEt=T(S(),1);function ec(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}ec.fromQuaternion=function(e,t){l(t)||(t=new ec);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-W.asinClamped(n),t};ec.fromDegrees=function(e,t,n,i){return l(i)||(i=new ec),i.heading=e*W.RADIANS_PER_DEGREE,i.pitch=t*W.RADIANS_PER_DEGREE,i.roll=n*W.RADIANS_PER_DEGREE,i};ec.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new ec(e.heading,e.pitch,e.roll)};ec.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};ec.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.heading,t.heading,n,i)&&W.equalsEpsilon(e.pitch,t.pitch,n,i)&&W.equalsEpsilon(e.roll,t.roll,n,i)};ec.prototype.clone=function(e){return ec.clone(this,e)};ec.prototype.equals=function(e){return ec.equals(this,e)};ec.prototype.equalsEpsilon=function(e,t,n){return ec.equalsEpsilon(this,e,t,n)};ec.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Va=ec;var SEt=T(S(),1);var dEt=T(S(),1);var $q={};var e$=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function FVe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(l(fN)||(fN=document.createElement("a")),fN.href=e,fN.href)}var rx;function n$(){if(l(rx))return rx;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l($q?.url)?e=Jh(".",$q.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(NM.toUrl)?e=Jh("..",sx("Core/buildModuleUrl.js")):e=FVe(),rx=new Ze({url:t$(e)}),rx.appendForwardSlash(),rx}function AVe(e){return t$(NM.toUrl(`../${e}`))}function i$(e){return n$().getDerivedResource({url:e}).url}var pN;function sx(e){return l(pN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(NM.toUrl)?pN=AVe:pN=i$),pN(e)}sx._cesiumScriptRegex=e$;sx._buildModuleUrlFromBaseUrl=i$;sx._clearBaseResource=function(){rx=void 0};sx.setBaseUrl=function(e){rx=Ze.DEFAULT.getDerivedResource({url:e})};sx.getCesiumBaseUrl=n$;var rn=sx;var hEt=T(S(),1);function MVe(e,t,n){this.x=e,this.y=t,this.s=n}var ax=MVe;function cO(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Ze.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new q(this._sampleZeroJulianEphemerisDate,0,Hn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var NVe=new q(0,0,Hn.TAI);function sO(e,t,n){let i=NVe;return i.dayNumber=t,i.secondsOfDay=n,q.daysDifference(i,e._sampleZeroDateTT)}cO.prototype.preload=function(e,t,n,i){let o=sO(this,e,t),r=sO(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let h=c;h<=d;++h)u.push(aO(this,h));return Promise.all(u)};cO.prototype.computeXysRadians=function(e,t,n){let i=sO(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,d=this._samples;if(l(d[s*3])||(aO(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(aO(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new ax(0,0,0);let u=i-s*this._stepSizeDays,h=this._work,p=this._denominators,g=this._coef,f=this._xTable,x,_;for(x=0;x<=r;++x)h[x]=u-f[x];for(x=0;x<=r;++x){for(g[x]=1,_=0;_<=r;++_)_!==x&&(g[x]*=h[_]);g[x]*=p[x];let C=(s+x)*3;n.x+=g[x]*d[C++],n.y+=g[x]*d[C++],n.s+=g[x]*d[C]}return n};function aO(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Ze({url:rn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let d=0,u=a.length;d0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let h=kVe,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let g=h[p],f=h[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(f,f)]+1);let x=UVe;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(f,g)]-e[$.getElementIndex(g,f)])*n,x[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,x[f]=(e[$.getElementIndex(f,p)]+e[$.getElementIndex(p,f)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ot(i,o,r,s)};var o$=new ot,r$=new ot,lO=new ot,s$=new ot;ot.fromHeadingPitchRoll=function(e,t){return s$=ot.fromAxisAngle(m.UNIT_X,e.roll,o$),lO=ot.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=ot.multiply(lO,s$,lO),r$=ot.fromAxisAngle(m.UNIT_Z,-e.heading,o$),ot.multiply(r$,t,t)};var bN=new m,dO=new m,Rm=new ot,a$=new ot,gN=new ot;ot.packedLength=4;ot.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ot.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ot),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ot.packedInterpolationLength=3;ot.convertPackedArrayForInterpolation=function(e,t,n,i){ot.unpack(e,n*4,gN),ot.conjugate(gN,gN);for(let o=0,r=n-t+1;o=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,d=a*a;for(let g=7;g>=0;--g)Tp[g]=(yN[g]*c-xN[g])*s,Sp[g]=(yN[g]*d-xN[g])*s;let u=r*n*(1+Tp[0]*(1+Tp[1]*(1+Tp[2]*(1+Tp[3]*(1+Tp[4]*(1+Tp[5]*(1+Tp[6]*(1+Tp[7])))))))),h=a*(1+Sp[0]*(1+Sp[1]*(1+Sp[2]*(1+Sp[3]*(1+Sp[4]*(1+Sp[5]*(1+Sp[6]*(1+Sp[7])))))))),p=ot.multiplyByScalar(e,h,OVe);return ot.multiplyByScalar(t,u,i),ot.add(p,i,i)};ot.fastSquad=function(e,t,n,i,o,r){let s=ot.fastSlerp(e,t,o,jL),a=ot.fastSlerp(n,i,o,NS);return ot.fastSlerp(s,a,2*o*(1-o),r)};ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};ot.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};ot.ZERO=Object.freeze(new ot(0,0,0,0));ot.IDENTITY=Object.freeze(new ot(0,0,0,1));ot.prototype.clone=function(e){return ot.clone(this,e)};ot.prototype.equals=function(e){return ot.equals(this,e)};ot.prototype.equalsEpsilon=function(e,t){return ot.equalsEpsilon(this,e,t)};ot.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var ve=ot;var di={},fO={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},kS={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},pO={},Tl={east:new m,north:new m,up:new m,west:new m,south:new m,down:new m},W0=new m,P0=new m,v0=new m;di.localFrameToFixedFrameGenerator=function(e,t){if(!fO.hasOwnProperty(e)||!fO[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=fO[e][t],i,o=e+t;return l(pO[o])?i=pO[o]:(i=function(r,s,a){if(l(a)||(a=new M),m.equalsEpsilon(r,m.ZERO,W.EPSILON14))m.unpack(kS[e],0,W0),m.unpack(kS[t],0,P0),m.unpack(kS[n],0,v0);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);m.unpack(kS[e],0,W0),e!=="east"&&e!=="west"&&m.multiplyByScalar(W0,c,W0),m.unpack(kS[t],0,P0),t!=="east"&&t!=="west"&&m.multiplyByScalar(P0,c,P0),m.unpack(kS[n],0,v0),n!=="east"&&n!=="west"&&m.multiplyByScalar(v0,c,v0)}else{s=y(s,ne.default),s.geodeticSurfaceNormal(r,Tl.up);let c=Tl.up,d=Tl.east;d.x=-r.y,d.y=r.x,d.z=0,m.normalize(d,Tl.east),m.cross(c,d,Tl.north),m.multiplyByScalar(Tl.up,-1,Tl.down),m.multiplyByScalar(Tl.east,-1,Tl.west),m.multiplyByScalar(Tl.north,-1,Tl.south),W0=Tl[e],P0=Tl[t],v0=Tl[n]}return a[0]=W0.x,a[1]=W0.y,a[2]=W0.z,a[3]=0,a[4]=P0.x,a[5]=P0.y,a[6]=P0.z,a[7]=0,a[8]=v0.x,a[9]=v0.y,a[10]=v0.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},pO[o]=i),i};di.eastNorthUpToFixedFrame=di.localFrameToFixedFrameGenerator("east","north");di.northEastDownToFixedFrame=di.localFrameToFixedFrameGenerator("north","east");di.northUpEastToFixedFrame=di.localFrameToFixedFrameGenerator("north","up");di.northWestUpToFixedFrame=di.localFrameToFixedFrameGenerator("north","west");var YVe=new ve,HVe=new m(1,1,1),zVe=new M;di.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,di.eastNorthUpToFixedFrame);let r=ve.fromHeadingPitchRoll(t,YVe),s=M.fromTranslationQuaternionRotationScale(m.ZERO,r,HVe,zVe);return o=i(e,n,o),M.multiply(o,s,o)};var KVe=new M,JVe=new $;di.headingPitchRollQuaternion=function(e,t,n,i,o){let r=di.headingPitchRollToFixedFrame(e,t,n,i,KVe),s=M.getMatrix3(r,JVe);return ve.fromRotationMatrix(s,o)};var QVe=new m(1,1,1),jVe=new m,d$=new M,qVe=new M,$Ve=new $,eLe=new ve;di.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,ne.default),n=y(n,di.eastNorthUpToFixedFrame),l(i)||(i=new Va);let o=M.getTranslation(e,jVe);if(m.equals(o,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=M.inverseTransformation(n(o,t,d$),d$),s=M.setScale(e,QVe,qVe);s=M.setTranslation(s,m.ZERO,s),r=M.multiply(r,s,r);let a=ve.fromRotationMatrix(M.getMatrix3(r,$Ve),eLe);return a=ve.normalize(a,a),Va.fromQuaternion(a,i)};var tLe=6*3600+41*60+50.54841,nLe=8640184812866e-6,iLe=.093104,oLe=-62e-7,rLe=11772758384668e-32,sLe=72921158553e-15,aLe=W.TWO_PI/86400,_N=new q;di.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=di.computeIcrfToFixedMatrix(e,t);return l(n)||(n=di.computeTemeToPseudoFixedMatrix(e,t)),n};di.computeTemeToPseudoFixedMatrix=function(e,t){_N=q.addSeconds(e,-q.computeTaiMinusUtc(e),_N);let n=_N.dayNumber,i=_N.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/zn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/zn.DAYS_PER_JULIAN_CENTURY;let a=(tLe+o*(nLe+o*(iLe+o*oLe)))*aLe%W.TWO_PI,c=sLe+rLe*(n-24515455e-1),d=(i+zn.SECONDS_PER_DAY*.5)%zn.SECONDS_PER_DAY,u=a+c*d,h=Math.cos(u),p=Math.sin(u);return l(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(h,p,0,-p,h,0,0,0,1)};di.iau2006XysData=new JL;di.earthOrientationParameters=KL.NONE;var yO=32.184,cLe=2451545;di.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+yO,i=e.stop.dayNumber,o=e.stop.secondsOfDay+yO;return di.iau2006XysData.preload(t,n,i,o)};di.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=di.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var lLe=32.184,dLe=2451545,TN=new Va,uLe=new $,mLe=new q;di.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=q.addSeconds(e,lLe,mLe),i=q.totalDays(n)-dLe,o=W.toRadians(12.112)-W.toRadians(.052992)*i,r=W.toRadians(24.224)-W.toRadians(.105984)*i,s=W.toRadians(227.645)+W.toRadians(13.012)*i,a=W.toRadians(261.105)+W.toRadians(13.340716)*i,c=W.toRadians(358)+W.toRadians(.9856)*i;return TN.pitch=W.toRadians(180)-W.toRadians(3.878)*Math.sin(o)-W.toRadians(.12)*Math.sin(r)+W.toRadians(.07)*Math.sin(s)-W.toRadians(.017)*Math.sin(a),TN.roll=W.toRadians(66.53-90)+W.toRadians(1.543)*Math.cos(o)+W.toRadians(.24)*Math.cos(r)-W.toRadians(.028)*Math.cos(s)+W.toRadians(.007)*Math.cos(a),TN.heading=W.toRadians(244.375-90)+W.toRadians(13.17635831)*i+W.toRadians(3.558)*Math.sin(o)+W.toRadians(.121)*Math.sin(r)-W.toRadians(.064)*Math.sin(s)+W.toRadians(.016)*Math.sin(a)+W.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(TN,uLe)};di.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=di.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var hLe=new ax(0,0,0),fLe=new E0(0,0,0,0,0,0),bO=new $,gO=new $;di.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=di.earthOrientationParameters.compute(e,fLe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+yO,r=di.iau2006XysData.computeXysRadians(i,o,hLe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=bO;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);let u=$.fromRotationZ(-r.s,gO),h=$.multiply(d,u,bO),p=e.dayNumber,g=e.secondsOfDay-q.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,x=g/zn.SECONDS_PER_DAY,_=.779057273264+x+.00273781191135448*(f+x);_=_%1*W.TWO_PI;let C=$.fromRotationZ(_,gO),V=$.multiply(h,C,bO),L=Math.cos(n.xPoleWander),Z=Math.cos(n.yPoleWander),G=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),v=i-cLe+o/zn.SECONDS_PER_DAY;v/=36525;let P=-47e-6*v*W.RADIANS_PER_DEGREE/3600,w=Math.cos(P),F=Math.sin(P),b=gO;return b[0]=L*w,b[1]=L*F,b[2]=G,b[3]=-Z*F+I*G*w,b[4]=Z*w+I*G*F,b[5]=-I*L,b[6]=-I*F-Z*G*w,b[7]=I*w-Z*G*F,b[8]=Z*L,$.multiply(V,b,t)};var pLe=new se;di.pointToWindowCoordinates=function(e,t,n,i){return i=di.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};di.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new D);let o=pLe;return M.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),M.multiplyByVector(t,o,o),D.fromCartesian4(o,i)};var bLe=new m,gLe=new m,yLe=new m;di.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,ne.default).geodeticSurfaceNormal(e,bLe),r=m.cross(t,o,gLe);m.equalsEpsilon(r,m.ZERO,W.EPSILON6)&&(r=m.clone(m.UNIT_X,r));let s=m.cross(r,t,yLe);return m.normalize(s,s),m.cross(t,s,r),m.negate(r,r),m.normalize(r,r),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var u$=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),m$=new he,xO=new m,xLe=new m,_Le=new $,_O=new M,h$=new M;di.basisTo2D=function(e,t,n){let i=M.getTranslation(t,xLe),o=e.ellipsoid,r;if(m.equals(i,m.ZERO))r=m.clone(m.ZERO,xO);else{let u=o.cartesianToCartographic(i,m$);r=e.project(u,xO),m.fromElements(r.z,r.x,r.y,r)}let s=di.eastNorthUpToFixedFrame(i,o,_O),a=M.inverseTransformation(s,h$),c=M.getMatrix3(t,_Le),d=M.multiplyByMatrix3(a,c,n);return M.multiply(u$,d,n),M.setTranslation(n,r,n),n};di.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=di.eastNorthUpToFixedFrame(t,i,_O),r=M.inverseTransformation(o,h$),s=i.cartesianToCartographic(t,m$),a=e.project(s,xO);m.fromElements(a.z,a.x,a.y,a);let c=M.fromTranslation(a,_O);return M.multiply(u$,r,n),M.multiply(c,n,n),n};var wt=di;function En(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(En.prototype,{width:{get:function(){return En.computeWidth(this)}},height:{get:function(){return En.computeHeight(this)}}});En.packedLength=4;En.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};En.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new En),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};En.computeWidth=function(e){let t=e.east,n=e.west;return t=0?u.longitude:u.longitude+W.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>W.PI&&(i=i-W.TWO_PI),n>W.PI&&(n=n-W.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new En(n,s,i,a)};En.fromCartesianArray=function(e,t,n){t=y(t,ne.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let d=0,u=e.length;d=0?h.longitude:h.longitude+W.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>W.PI&&(o=o-W.TWO_PI),i>W.PI&&(i=i-W.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new En(i,a,o,c)};var TLe=new m,SLe=new m,CLe=new m,VLe=new m,LLe=new m,TO=new Array(5);for(let e=0;e0?i+=W.TWO_PI:r0&&(r+=W.TWO_PI),i=u))return l(n)?(n.west=a,n.south=d,n.east=c,n.north=u,n):new En(a,d,c,u)};En.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new En(i,o,r,s)};En.union=function(e,t,n){l(n)||(n=new En);let i=e.east,o=e.west,r=t.east,s=t.west;i0?i+=W.TWO_PI:r0&&(r+=W.TWO_PI),io||W.equalsEpsilon(n,o,W.EPSILON14))&&(n=e.south&&i<=e.north};var RLe=new he;En.subsample=function(e,t,n,i){t=y(t,ne.default),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,d=RLe;d.height=n,d.longitude=c,d.latitude=r,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.latitude=s,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,r<0?d.latitude=r:s>0?d.latitude=s:d.latitude=0;for(let u=1;u<8;++u)d.longitude=-Math.PI+u*W.PI_OVER_TWO,En.contains(e,d)&&(i[o]=t.cartographicToCartesian(d,i[o]),o++);return d.latitude===0&&(d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++),i.length=o,i};En.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new En),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=W.TWO_PI+e.east-e.west;r.west=W.negativePiToPi(e.west+t*a),r.east=W.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};En.MAX_VALUE=Object.freeze(new En(-Math.PI,-W.PI_OVER_TWO,Math.PI,W.PI_OVER_TWO));var ce=En;function Xr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Xr.packedLength=4;Xr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Xr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Xr.fromPoints=function(e,t){if(l(t)||(t=new Xr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;an.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};Xr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.widthr+t.height?zt.OUTSIDE:zt.INTERSECTING};Xr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Xr.prototype.clone=function(e){return Xr.clone(this,e)};Xr.prototype.intersect=function(e){return Xr.intersect(this,e)};Xr.prototype.equals=function(e){return Xr.equals(this,e)};var ze=Xr;var _It=T(S(),1);var La={POINTS:ie.POINTS,LINES:ie.LINES,LINE_LOOP:ie.LINE_LOOP,LINE_STRIP:ie.LINE_STRIP,TRIANGLES:ie.TRIANGLES,TRIANGLE_STRIP:ie.TRIANGLE_STRIP,TRIANGLE_FAN:ie.TRIANGLE_FAN};La.isLines=function(e){return e===La.LINES||e===La.LINE_LOOP||e===La.LINE_STRIP};La.isTriangles=function(e){return e===La.TRIANGLES||e===La.TRIANGLE_STRIP||e===La.TRIANGLE_FAN};La.validate=function(e){return e===La.POINTS||e===La.LINES||e===La.LINE_LOOP||e===La.LINE_STRIP||e===La.TRIANGLES||e===La.TRIANGLE_STRIP||e===La.TRIANGLE_FAN};var we=Object.freeze(La);var SIt=T(S(),1),cx=`in vec4 position; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var M=et;var zVt=T(S(),1),d1e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},ie=Object.freeze(d1e);var u1e=new m;function Et(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var sa={};sa[ie.FLOAT]="float";sa[ie.FLOAT_VEC2]="vec2";sa[ie.FLOAT_VEC3]="vec3";sa[ie.FLOAT_VEC4]="vec4";sa[ie.INT]="int";sa[ie.INT_VEC2]="ivec2";sa[ie.INT_VEC3]="ivec3";sa[ie.INT_VEC4]="ivec4";sa[ie.BOOL]="bool";sa[ie.BOOL_VEC2]="bvec2";sa[ie.BOOL_VEC3]="bvec3";sa[ie.BOOL_VEC4]="bvec4";sa[ie.FLOAT_MAT2]="mat2";sa[ie.FLOAT_MAT3]="mat3";sa[ie.FLOAT_MAT4]="mat4";sa[ie.SAMPLER_2D]="sampler2D";sa[ie.SAMPLER_CUBE]="samplerCube";Et.prototype.getDeclaration=function(e){let t=`uniform ${sa[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var m1e={czm_viewport:new Et({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Et({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Et({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Et({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Et({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Et({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Et({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,u1e)}}),czm_frameNumber:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Et({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Et({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Et({size:1,datatype:ie.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Et({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Et({size:9,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Et({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},gp=m1e;var xLt=T(S(),1);var eLt=T(S(),1);function h1e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Bn=h1e;var iLt=T(S(),1);function f1e(){return!0}function p1e(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=f1e}var me=p1e;var cLt=T(S(),1);var ws={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT};ws.getSizeInBytes=function(e){switch(e){case ws.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ws.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ws.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ws.fromSizeInBytes=function(e){switch(e){case 2:return ws.UNSIGNED_SHORT;case 4:return ws.UNSIGNED_INT;case 1:return ws.UNSIGNED_BYTE}};ws.validate=function(e){return l(e)&&(e===ws.UNSIGNED_BYTE||e===ws.UNSIGNED_SHORT||e===ws.UNSIGNED_INT)};ws.createTypedArray=function(e,t){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ws.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ws.fromTypedArray=function(e){if(e instanceof Uint8Array)return ws.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ws.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ws.UNSIGNED_INT};var Ae=Object.freeze(ws);var uLt=T(S(),1);var K9={STREAM_DRAW:ie.STREAM_DRAW,STATIC_DRAW:ie.STATIC_DRAW,DYNAMIC_DRAW:ie.DYNAMIC_DRAW,validate:function(e){return e===K9.STREAM_DRAW||e===K9.STATIC_DRAW||e===K9.DYNAMIC_DRAW}},Me=Object.freeze(K9);function pu(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Bn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}pu.createVertexBuffer=function(e){return new pu({context:e.context,bufferTarget:ie.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};pu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ae.getSizeInBytes(n),o=new pu({context:t,bufferTarget:ie.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(pu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});pu.prototype._getBuffer=function(){return this._buffer};pu.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};pu.prototype.copyFromBuffer=function(e,t,n,i){let o=ie.COPY_READ_BUFFER,r=ie.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};pu.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=ie.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};pu.prototype.isDestroyed=function(){return!1};pu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),me(this)};var yt=pu;var ALt=T(S(),1);var PLt=T(S(),1);var ZLt=T(S(),1);var SLt=T(S(),1);var E0,Ir={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Tl={};Object.defineProperties(Tl,{element:{get:function(){if(Tl.supportsFullscreen())return document[Ir.fullscreenElement]}},changeEventName:{get:function(){if(Tl.supportsFullscreen())return Ir.fullscreenchange}},errorEventName:{get:function(){if(Tl.supportsFullscreen())return Ir.fullscreenerror}},enabled:{get:function(){if(Tl.supportsFullscreen())return document[Ir.fullscreenEnabled]}},fullscreen:{get:function(){if(Tl.supportsFullscreen())return Tl.element!==null}}});Tl.supportsFullscreen=function(){if(l(E0))return E0;E0=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Ir.requestFullscreen="requestFullscreen",Ir.exitFullscreen="exitFullscreen",Ir.fullscreenEnabled="fullscreenEnabled",Ir.fullscreenElement="fullscreenElement",Ir.fullscreenchange="fullscreenchange",Ir.fullscreenerror="fullscreenerror",E0=!0,E0;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i{let t=new Image;t.onload=function(){Pc._result=t.width>0&&t.height>0,e(Pc._result)},t.onerror=function(){Pc._result=!1,e(Pc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Pc._promise};Object.defineProperties(Pc,{initialized:{get:function(){return l(Pc._result)}}});var PS=[];typeof ArrayBuffer<"u"&&(PS.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&PS.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&PS.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&PS.push(BigInt64Array),typeof BigUint64Array<"u"&&PS.push(BigUint64Array));var bu={isChrome:KO,chromeVersion:b1e,isSafari:fq,safariVersion:g1e,isWebkit:pq,webkitVersion:y1e,isInternetExplorer:bq,internetExplorerVersion:x1e,isEdge:tN,edgeVersion:_1e,isFirefox:nN,firefoxVersion:C1e,isWindows:T1e,isIPadOrIOS:S1e,hardwareConcurrency:y(qa.hardwareConcurrency,3),supportsPointerEvents:V1e,supportsImageRenderingPixelated:xq,supportsWebP:Pc,imageRenderingValue:L1e,typedArrayTypes:PS};bu.supportsBasis=function(e){return bu.supportsWebAssembly()&&e.context.supportsBasis};bu.supportsFullscreen=function(){return br.supportsFullscreen()};bu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};bu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};bu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};bu.supportsBigInt=function(){return typeof BigInt<"u"};bu.supportsWebWorkers=function(){return typeof Worker<"u"};bu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};bu.supportsWebgl2=function(e){return e.context.webgl2};bu.supportsEsmWebWorkers=function(){return!nN()||parseInt(JO)>=114};var Bt=bu;function QO(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function re(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}re.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new re(e.x,e.y,e.z,e.w)};re.fromBytes=function(e,t,n,i,o){return e=re.byteToFloat(y(e,255)),t=re.byteToFloat(y(t,255)),n=re.byteToFloat(y(n,255)),i=re.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new re(e,t,n,i)};re.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new re(e.red,e.green,e.blue,t)};var jO,qO,yp;Bt.supportsTypedArrays()&&(jO=new ArrayBuffer(4),qO=new Uint32Array(jO),yp=new Uint8Array(jO));re.fromRgba=function(e,t){return qO[0]=e,re.fromBytes(yp[0],yp[1],yp[2],yp[3],t)};re.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let d=2*n-c;r=QO(d,c,e+1/3),s=QO(d,c,e),a=QO(d,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new re(r,s,a,i)};re.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+W.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+W.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+W.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+W.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new re(n,i,o,r)};var R1e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,Z1e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,G1e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,E1e=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;re.fromCssColorString=function(e,t){l(t)||(t=new re),e=e.trim();let n=re[e.toUpperCase()];if(l(n))return re.clone(n,t),t;let i=R1e.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=Z1e.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=G1e.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=E1e.exec(e),i!==null?re.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};re.packedLength=4;re.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};re.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new re),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};re.byteToFloat=function(e){return e/255};re.floatToByte=function(e){return e===1?255:e*256|0};re.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new re(e.red,e.green,e.blue,e.alpha)};re.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};re.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};re.prototype.clone=function(e){return re.clone(this,e)};re.prototype.equals=function(e){return re.equals(this,e)};re.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};re.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};re.prototype.toCssColorString=function(){let e=re.floatToByte(this.red),t=re.floatToByte(this.green),n=re.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};re.prototype.toCssHexString=function(){let e=re.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=re.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=re.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=re.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};re.prototype.toBytes=function(e){let t=re.floatToByte(this.red),n=re.floatToByte(this.green),i=re.floatToByte(this.blue),o=re.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};re.prototype.toRgba=function(){return yp[0]=re.floatToByte(this.red),yp[1]=re.floatToByte(this.green),yp[2]=re.floatToByte(this.blue),yp[3]=re.floatToByte(this.alpha),qO[0]};re.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};re.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};re.prototype.withAlpha=function(e,t){return re.fromAlpha(this,e,t)};re.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};re.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};re.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};re.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};re.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};re.lerp=function(e,t,n,i){return i.red=W.lerp(e.red,t.red,n),i.green=W.lerp(e.green,t.green,n),i.blue=W.lerp(e.blue,t.blue,n),i.alpha=W.lerp(e.alpha,t.alpha,n),i};re.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};re.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};re.ALICEBLUE=Object.freeze(re.fromCssColorString("#F0F8FF"));re.ANTIQUEWHITE=Object.freeze(re.fromCssColorString("#FAEBD7"));re.AQUA=Object.freeze(re.fromCssColorString("#00FFFF"));re.AQUAMARINE=Object.freeze(re.fromCssColorString("#7FFFD4"));re.AZURE=Object.freeze(re.fromCssColorString("#F0FFFF"));re.BEIGE=Object.freeze(re.fromCssColorString("#F5F5DC"));re.BISQUE=Object.freeze(re.fromCssColorString("#FFE4C4"));re.BLACK=Object.freeze(re.fromCssColorString("#000000"));re.BLANCHEDALMOND=Object.freeze(re.fromCssColorString("#FFEBCD"));re.BLUE=Object.freeze(re.fromCssColorString("#0000FF"));re.BLUEVIOLET=Object.freeze(re.fromCssColorString("#8A2BE2"));re.BROWN=Object.freeze(re.fromCssColorString("#A52A2A"));re.BURLYWOOD=Object.freeze(re.fromCssColorString("#DEB887"));re.CADETBLUE=Object.freeze(re.fromCssColorString("#5F9EA0"));re.CHARTREUSE=Object.freeze(re.fromCssColorString("#7FFF00"));re.CHOCOLATE=Object.freeze(re.fromCssColorString("#D2691E"));re.CORAL=Object.freeze(re.fromCssColorString("#FF7F50"));re.CORNFLOWERBLUE=Object.freeze(re.fromCssColorString("#6495ED"));re.CORNSILK=Object.freeze(re.fromCssColorString("#FFF8DC"));re.CRIMSON=Object.freeze(re.fromCssColorString("#DC143C"));re.CYAN=Object.freeze(re.fromCssColorString("#00FFFF"));re.DARKBLUE=Object.freeze(re.fromCssColorString("#00008B"));re.DARKCYAN=Object.freeze(re.fromCssColorString("#008B8B"));re.DARKGOLDENROD=Object.freeze(re.fromCssColorString("#B8860B"));re.DARKGRAY=Object.freeze(re.fromCssColorString("#A9A9A9"));re.DARKGREEN=Object.freeze(re.fromCssColorString("#006400"));re.DARKGREY=re.DARKGRAY;re.DARKKHAKI=Object.freeze(re.fromCssColorString("#BDB76B"));re.DARKMAGENTA=Object.freeze(re.fromCssColorString("#8B008B"));re.DARKOLIVEGREEN=Object.freeze(re.fromCssColorString("#556B2F"));re.DARKORANGE=Object.freeze(re.fromCssColorString("#FF8C00"));re.DARKORCHID=Object.freeze(re.fromCssColorString("#9932CC"));re.DARKRED=Object.freeze(re.fromCssColorString("#8B0000"));re.DARKSALMON=Object.freeze(re.fromCssColorString("#E9967A"));re.DARKSEAGREEN=Object.freeze(re.fromCssColorString("#8FBC8F"));re.DARKSLATEBLUE=Object.freeze(re.fromCssColorString("#483D8B"));re.DARKSLATEGRAY=Object.freeze(re.fromCssColorString("#2F4F4F"));re.DARKSLATEGREY=re.DARKSLATEGRAY;re.DARKTURQUOISE=Object.freeze(re.fromCssColorString("#00CED1"));re.DARKVIOLET=Object.freeze(re.fromCssColorString("#9400D3"));re.DEEPPINK=Object.freeze(re.fromCssColorString("#FF1493"));re.DEEPSKYBLUE=Object.freeze(re.fromCssColorString("#00BFFF"));re.DIMGRAY=Object.freeze(re.fromCssColorString("#696969"));re.DIMGREY=re.DIMGRAY;re.DODGERBLUE=Object.freeze(re.fromCssColorString("#1E90FF"));re.FIREBRICK=Object.freeze(re.fromCssColorString("#B22222"));re.FLORALWHITE=Object.freeze(re.fromCssColorString("#FFFAF0"));re.FORESTGREEN=Object.freeze(re.fromCssColorString("#228B22"));re.FUCHSIA=Object.freeze(re.fromCssColorString("#FF00FF"));re.GAINSBORO=Object.freeze(re.fromCssColorString("#DCDCDC"));re.GHOSTWHITE=Object.freeze(re.fromCssColorString("#F8F8FF"));re.GOLD=Object.freeze(re.fromCssColorString("#FFD700"));re.GOLDENROD=Object.freeze(re.fromCssColorString("#DAA520"));re.GRAY=Object.freeze(re.fromCssColorString("#808080"));re.GREEN=Object.freeze(re.fromCssColorString("#008000"));re.GREENYELLOW=Object.freeze(re.fromCssColorString("#ADFF2F"));re.GREY=re.GRAY;re.HONEYDEW=Object.freeze(re.fromCssColorString("#F0FFF0"));re.HOTPINK=Object.freeze(re.fromCssColorString("#FF69B4"));re.INDIANRED=Object.freeze(re.fromCssColorString("#CD5C5C"));re.INDIGO=Object.freeze(re.fromCssColorString("#4B0082"));re.IVORY=Object.freeze(re.fromCssColorString("#FFFFF0"));re.KHAKI=Object.freeze(re.fromCssColorString("#F0E68C"));re.LAVENDER=Object.freeze(re.fromCssColorString("#E6E6FA"));re.LAVENDAR_BLUSH=Object.freeze(re.fromCssColorString("#FFF0F5"));re.LAWNGREEN=Object.freeze(re.fromCssColorString("#7CFC00"));re.LEMONCHIFFON=Object.freeze(re.fromCssColorString("#FFFACD"));re.LIGHTBLUE=Object.freeze(re.fromCssColorString("#ADD8E6"));re.LIGHTCORAL=Object.freeze(re.fromCssColorString("#F08080"));re.LIGHTCYAN=Object.freeze(re.fromCssColorString("#E0FFFF"));re.LIGHTGOLDENRODYELLOW=Object.freeze(re.fromCssColorString("#FAFAD2"));re.LIGHTGRAY=Object.freeze(re.fromCssColorString("#D3D3D3"));re.LIGHTGREEN=Object.freeze(re.fromCssColorString("#90EE90"));re.LIGHTGREY=re.LIGHTGRAY;re.LIGHTPINK=Object.freeze(re.fromCssColorString("#FFB6C1"));re.LIGHTSEAGREEN=Object.freeze(re.fromCssColorString("#20B2AA"));re.LIGHTSKYBLUE=Object.freeze(re.fromCssColorString("#87CEFA"));re.LIGHTSLATEGRAY=Object.freeze(re.fromCssColorString("#778899"));re.LIGHTSLATEGREY=re.LIGHTSLATEGRAY;re.LIGHTSTEELBLUE=Object.freeze(re.fromCssColorString("#B0C4DE"));re.LIGHTYELLOW=Object.freeze(re.fromCssColorString("#FFFFE0"));re.LIME=Object.freeze(re.fromCssColorString("#00FF00"));re.LIMEGREEN=Object.freeze(re.fromCssColorString("#32CD32"));re.LINEN=Object.freeze(re.fromCssColorString("#FAF0E6"));re.MAGENTA=Object.freeze(re.fromCssColorString("#FF00FF"));re.MAROON=Object.freeze(re.fromCssColorString("#800000"));re.MEDIUMAQUAMARINE=Object.freeze(re.fromCssColorString("#66CDAA"));re.MEDIUMBLUE=Object.freeze(re.fromCssColorString("#0000CD"));re.MEDIUMORCHID=Object.freeze(re.fromCssColorString("#BA55D3"));re.MEDIUMPURPLE=Object.freeze(re.fromCssColorString("#9370DB"));re.MEDIUMSEAGREEN=Object.freeze(re.fromCssColorString("#3CB371"));re.MEDIUMSLATEBLUE=Object.freeze(re.fromCssColorString("#7B68EE"));re.MEDIUMSPRINGGREEN=Object.freeze(re.fromCssColorString("#00FA9A"));re.MEDIUMTURQUOISE=Object.freeze(re.fromCssColorString("#48D1CC"));re.MEDIUMVIOLETRED=Object.freeze(re.fromCssColorString("#C71585"));re.MIDNIGHTBLUE=Object.freeze(re.fromCssColorString("#191970"));re.MINTCREAM=Object.freeze(re.fromCssColorString("#F5FFFA"));re.MISTYROSE=Object.freeze(re.fromCssColorString("#FFE4E1"));re.MOCCASIN=Object.freeze(re.fromCssColorString("#FFE4B5"));re.NAVAJOWHITE=Object.freeze(re.fromCssColorString("#FFDEAD"));re.NAVY=Object.freeze(re.fromCssColorString("#000080"));re.OLDLACE=Object.freeze(re.fromCssColorString("#FDF5E6"));re.OLIVE=Object.freeze(re.fromCssColorString("#808000"));re.OLIVEDRAB=Object.freeze(re.fromCssColorString("#6B8E23"));re.ORANGE=Object.freeze(re.fromCssColorString("#FFA500"));re.ORANGERED=Object.freeze(re.fromCssColorString("#FF4500"));re.ORCHID=Object.freeze(re.fromCssColorString("#DA70D6"));re.PALEGOLDENROD=Object.freeze(re.fromCssColorString("#EEE8AA"));re.PALEGREEN=Object.freeze(re.fromCssColorString("#98FB98"));re.PALETURQUOISE=Object.freeze(re.fromCssColorString("#AFEEEE"));re.PALEVIOLETRED=Object.freeze(re.fromCssColorString("#DB7093"));re.PAPAYAWHIP=Object.freeze(re.fromCssColorString("#FFEFD5"));re.PEACHPUFF=Object.freeze(re.fromCssColorString("#FFDAB9"));re.PERU=Object.freeze(re.fromCssColorString("#CD853F"));re.PINK=Object.freeze(re.fromCssColorString("#FFC0CB"));re.PLUM=Object.freeze(re.fromCssColorString("#DDA0DD"));re.POWDERBLUE=Object.freeze(re.fromCssColorString("#B0E0E6"));re.PURPLE=Object.freeze(re.fromCssColorString("#800080"));re.RED=Object.freeze(re.fromCssColorString("#FF0000"));re.ROSYBROWN=Object.freeze(re.fromCssColorString("#BC8F8F"));re.ROYALBLUE=Object.freeze(re.fromCssColorString("#4169E1"));re.SADDLEBROWN=Object.freeze(re.fromCssColorString("#8B4513"));re.SALMON=Object.freeze(re.fromCssColorString("#FA8072"));re.SANDYBROWN=Object.freeze(re.fromCssColorString("#F4A460"));re.SEAGREEN=Object.freeze(re.fromCssColorString("#2E8B57"));re.SEASHELL=Object.freeze(re.fromCssColorString("#FFF5EE"));re.SIENNA=Object.freeze(re.fromCssColorString("#A0522D"));re.SILVER=Object.freeze(re.fromCssColorString("#C0C0C0"));re.SKYBLUE=Object.freeze(re.fromCssColorString("#87CEEB"));re.SLATEBLUE=Object.freeze(re.fromCssColorString("#6A5ACD"));re.SLATEGRAY=Object.freeze(re.fromCssColorString("#708090"));re.SLATEGREY=re.SLATEGRAY;re.SNOW=Object.freeze(re.fromCssColorString("#FFFAFA"));re.SPRINGGREEN=Object.freeze(re.fromCssColorString("#00FF7F"));re.STEELBLUE=Object.freeze(re.fromCssColorString("#4682B4"));re.TAN=Object.freeze(re.fromCssColorString("#D2B48C"));re.TEAL=Object.freeze(re.fromCssColorString("#008080"));re.THISTLE=Object.freeze(re.fromCssColorString("#D8BFD8"));re.TOMATO=Object.freeze(re.fromCssColorString("#FF6347"));re.TURQUOISE=Object.freeze(re.fromCssColorString("#40E0D0"));re.VIOLET=Object.freeze(re.fromCssColorString("#EE82EE"));re.WHEAT=Object.freeze(re.fromCssColorString("#F5DEB3"));re.WHITE=Object.freeze(re.fromCssColorString("#FFFFFF"));re.WHITESMOKE=Object.freeze(re.fromCssColorString("#F5F5F5"));re.YELLOW=Object.freeze(re.fromCssColorString("#FFFF00"));re.YELLOWGREEN=Object.freeze(re.fromCssColorString("#9ACD32"));re.TRANSPARENT=Object.freeze(new re(0,0,0,0));var B=re;function iN(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}iN.ALL=Object.freeze(new iN({color:new B(0,0,0,0),depth:1,stencil:0}));iN.prototype.execute=function(e,t){e.clear(this,t)};var ti=iN;var BLt=T(S(),1);var NLt=T(S(),1),I1e={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Ee=Object.freeze(I1e);function _q(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=Ee.COMPUTE,this.owner=e.owner}_q.prototype.execute=function(e){e.execute(this)};var vc=_q;var tWt=T(S(),1);var TIt=T(S(),1);var KLt=T(S(),1);function Mt(e,t){this.x=y(e,0),this.y=y(t,0)}Mt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Mt(e,t)};Mt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Mt(e.x,e.y)};Mt.fromCartesian3=Mt.clone;Mt.fromCartesian4=Mt.clone;Mt.packedLength=2;Mt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Mt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Mt),n.x=e[t++],n.y=e[t],n};Mt.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;oW.EPSILON12);return l(o)?(o.x=r*w,o.y=s*F,o.z=a*b,o):new m(r*w,s*F,a*b)}var qy=v1e;function No(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}No.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new No(e,t,n)};No.fromDegrees=function(e,t,n,i){return e=W.toRadians(e),t=W.toRadians(t),No.fromRadians(e,t,n,i)};var w1e=new m,F1e=new m,A1e=new m;No._ellipsoidOneOverRadii=new m(1/6378137,1/6378137,1/6356752314245179e-9);No._ellipsoidOneOverRadiiSquared=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));No._ellipsoidCenterToleranceSquared=W.EPSILON1;No.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:No._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:No._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:No._ellipsoidCenterToleranceSquared,s=qy(e,i,o,r,F1e);if(!l(s))return;let a=m.multiplyComponents(s,o,w1e);a=m.normalize(a,a);let c=m.subtract(e,s,A1e),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),h=W.sign(m.dot(c,e))*m.magnitude(c);return l(n)?(n.longitude=d,n.latitude=u,n.height=h,n):new No(d,u,h)};No.toCartesian=function(e,t,n){return m.fromRadians(e.longitude,e.latitude,e.height,t,n)};No.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new No(e.longitude,e.latitude,e.height)};No.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};No.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};No.ZERO=Object.freeze(new No(0,0,0));No.prototype.clone=function(e){return No.clone(this,e)};No.prototype.equals=function(e){return No.equals(this,e)};No.prototype.equalsEpsilon=function(e,t){return No.equalsEpsilon(this,e,t)};No.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=No;var pRt=T(S(),1);function Lq(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=W.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function bi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Lq(this,e,t,n)}Object.defineProperties(bi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});bi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new bi(n.x,n.y,n.z)};bi.fromCartesian3=function(e,t){return l(t)||(t=new bi),l(e)&&Lq(t,e.x,e.y,e.z),t};bi.WGS84=Object.freeze(new bi(6378137,6378137,6356752314245179e-9));bi.UNIT_SPHERE=Object.freeze(new bi(1,1,1));bi.MOON=Object.freeze(new bi(W.LUNAR_RADIUS,W.LUNAR_RADIUS,W.LUNAR_RADIUS));bi._default=bi.WGS84;Object.defineProperties(bi,{default:{get:function(){return bi._default},set:function(e){bi._default=e,m._ellipsoidRadiiSquared=e.radiiSquared,he._ellipsoidOneOverRadii=e.oneOverRadii,he._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});bi.prototype.clone=function(e){return bi.clone(this,e)};bi.packedLength=m.packedLength;bi.pack=function(e,t,n){return n=y(n,0),m.pack(e._radii,t,n),t};bi.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t);return bi.fromCartesian3(i,n)};bi.prototype.geocentricSurfaceNormal=m.normalize;bi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new m),t.x=r,t.y=s,t.z=a,m.normalize(t,t)};bi.prototype.geodeticSurfaceNormal=function(e,t){if(!m.equalsEpsilon(e,m.ZERO,W.EPSILON14))return l(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var M1e=new m,N1e=new m;bi.prototype.cartographicToCartesian=function(e,t){let n=M1e,i=N1e;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,o,i),m.multiplyByScalar(n,e.height,n),l(t)||(t=new m),m.add(i,n,t)};bi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=this._radii.z-t))return n};var B1e=new m;bi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new D);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,B1e),i=m.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return D.fromElements(1/i,1/r,t)};var O1e=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],Y1e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Vq(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*O1e[s];r+=Y1e[s]*(n(i+a)+n(i-a))}return r*=o,r}bi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n0){o=r-1;continue}return r}return~(o+1)}var Xo=z1e;var GRt=T(S(),1);function K1e(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var I0=K1e;var qRt=T(S(),1);var FRt=T(S(),1);var IRt=T(S(),1);function J1e(e){return e%4===0&&e%100!==0||e%400===0}var Vm=J1e;var Rq=[31,28,31,30,31,30,31,31,30,31,30,31];function Q1e(e,t,n,i,o,r,s,a){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,0),o=y(o,0),r=y(r,0),s=y(s,0),a=y(a,!1),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function x(){xo.typeOf.number.greaterThanOrEquals("Year",e,1),xo.typeOf.number.lessThanOrEquals("Year",e,9999),xo.typeOf.number.greaterThanOrEquals("Month",t,1),xo.typeOf.number.lessThanOrEquals("Month",t,12),xo.typeOf.number.greaterThanOrEquals("Day",n,1),xo.typeOf.number.lessThanOrEquals("Day",n,31),xo.typeOf.number.greaterThanOrEquals("Hour",i,0),xo.typeOf.number.lessThanOrEquals("Hour",i,23),xo.typeOf.number.greaterThanOrEquals("Minute",o,0),xo.typeOf.number.lessThanOrEquals("Minute",o,59),xo.typeOf.bool("IsLeapSecond",a),xo.typeOf.number.greaterThanOrEquals("Second",r,0),xo.typeOf.number.lessThanOrEquals("Second",r,a?60:59),xo.typeOf.number.greaterThanOrEquals("Millisecond",s,0),xo.typeOf.number.lessThan("Millisecond",s,1e3)}function _(){let C=t===2&&Vm(e)?Rq[t-1]+1:Rq[t-1];if(n>C)throw new pe("Month and Day represents invalid date")}}var xp=Q1e;var MRt=T(S(),1);function j1e(e,t){this.julianDate=e,this.offset=t}var Yi=j1e;var kRt=T(S(),1),q1e={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},Kn=Object.freeze(q1e);var DRt=T(S(),1),$1e={UTC:0,TAI:1},Hn=Object.freeze($1e);var Gq=new xp,$O=[31,28,31,30,31,30,31,31,30,31,30,31],e3=29;function t3(e,t){return Pt.compare(e.julianDate,t.julianDate)}var vS=new Yi;function aN(e){vS.julianDate=e;let t=Pt.leapSeconds,n=Xo(t,vS,t3);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Pt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Pt.addSeconds(e,i,e)}function Zq(e,t){vS.julianDate=e;let n=Pt.leapSeconds,i=Xo(n,vS,t3);if(i<0&&(i=~i),i===0)return Pt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Pt.addSeconds(e,-n[i-1].offset,t);let o=Pt.secondsDifference(n[i].julianDate,e);if(o===0)return Pt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Pt.addSeconds(e,-n[--i].offset,t)}function X0(e,t,n){let i=t/Kn.SECONDS_PER_DAY|0;return e+=i,t-=Kn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Kn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function n3(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,d=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*Kn.SECONDS_PER_HOUR+o*Kn.SECONDS_PER_MINUTE+s*Kn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var eVe=/^(\d{4})$/,tVe=/^(\d{4})-(\d{2})$/,nVe=/^(\d{4})-?(\d{3})$/,iVe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,oVe=/^(\d{4})-?(\d{2})-?(\d{2})$/,i3=/([Z+\-])?(\d{2})?:?(\d{2})?$/,rVe=/^(\d{2})(\.\d+)?/.source+i3.source,sVe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+i3.source,aVe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+i3.source;function Pt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Hn.UTC);let i=e|0;t=t+(e-i)*Kn.SECONDS_PER_DAY,X0(i,t,this),n===Hn.UTC&&aN(this)}Pt.fromGregorianDate=function(e,t){let n=n3(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(X0(n[0],n[1],t),aN(t),t):new Pt(n[0],n[1],Hn.UTC)};Pt.fromDate=function(e,t){let n=n3(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(X0(n[0],n[1],t),aN(t),t):new Pt(n[0],n[1],Hn.UTC)};Pt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,d=0,u=n[0],h=n[1],p,g;if(n=u.match(oVe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=u.match(tVe),n!==null)i=+n[1],o=+n[2];else if(n=u.match(eVe),n!==null)i=+n[1];else{let C;if(n=u.match(nVe),n!==null)i=+n[1],C=+n[2],g=Vm(i);else if(n=u.match(iVe),n!==null){i=+n[1];let V=+n[2],L=+n[3]||0,Z=new Date(Date.UTC(i,0,4));C=V*7+L-Z.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=Vm(i);let f;if(l(h)){n=h.match(aVe),n!==null?(s=+n[1],a=+n[2],c=+n[3],d=+(n[4]||0)*1e3,f=5):(n=h.match(sVe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,f=4):(n=h.match(rVe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,f=3)));let C=n[f],V=+n[f+1],L=+(n[f+2]||0);switch(C){case"+":s=s-V,a=a-L;break;case"-":s=s+V,a=a+L;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?e3:$O[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?e3:$O[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?e3:$O[o-1],r+=p;let _=n3(i,o,r,s,a,c,d);return l(t)?(X0(_[0],_[1],t),aN(t)):t=new Pt(_[0],_[1],Hn.UTC),x&&Pt.addSeconds(t,1,t),t};Pt.now=function(e){return Pt.fromDate(new Date,e)};var sN=new Pt(0,0,Hn.TAI);Pt.toGregorianDate=function(e,t){let n=!1,i=Zq(e,sN);l(i)||(Pt.addSeconds(e,-1,sN),i=Zq(sN,sN),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;let h=d+2-12*s|0,p=100*(a-49)+c+s|0,g=r/Kn.SECONDS_PER_HOUR|0,f=r-g*Kn.SECONDS_PER_HOUR,x=f/Kn.SECONDS_PER_MINUTE|0;f=f-x*Kn.SECONDS_PER_MINUTE;let _=f|0,C=(f-_)/Kn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(_+=1),l(t)?(t.year=p,t.month=h,t.day=u,t.hour=g,t.minute=x,t.second=_,t.millisecond=C,t.isLeapSecond=n,t):new xp(p,h,u,g,x,_,C,n)};Pt.toDate=function(e){let t=Pt.toGregorianDate(e,Gq),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Pt.toIso8601=function(e,t){let n=Pt.toGregorianDate(e,Gq),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,d=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&d===0&&(i=9999,o=12,r=31,s=24);let u;if(!l(t)&&d!==0){let h=d*.01;return u=h<1e-6?h.toFixed(20).replace(".","").replace(/0+$/,""):h.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`}return!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(u=(d*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`)};Pt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Pt(e.dayNumber,e.secondsOfDay,Hn.TAI)};Pt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Pt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Pt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(Pt.secondsDifference(e,t))<=n};Pt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Kn.SECONDS_PER_DAY};Pt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Kn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Pt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Kn.SECONDS_PER_DAY;return n+i};Pt.computeTaiMinusUtc=function(e){vS.julianDate=e;let t=Pt.leapSeconds,n=Xo(t,vS,t3);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Pt.addSeconds=function(e,t,n){return X0(e.dayNumber,e.secondsOfDay+t,n)};Pt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*Kn.SECONDS_PER_MINUTE;return X0(e.dayNumber,i,n)};Pt.addHours=function(e,t,n){let i=e.secondsOfDay+t*Kn.SECONDS_PER_HOUR;return X0(e.dayNumber,i,n)};Pt.addDays=function(e,t,n){let i=e.dayNumber+t;return X0(i,e.secondsOfDay,n)};Pt.lessThan=function(e,t){return Pt.compare(e,t)<0};Pt.lessThanOrEquals=function(e,t){return Pt.compare(e,t)<=0};Pt.greaterThan=function(e,t){return Pt.compare(e,t)>0};Pt.greaterThanOrEquals=function(e,t){return Pt.compare(e,t)>=0};Pt.prototype.clone=function(e){return Pt.clone(this,e)};Pt.prototype.equals=function(e){return Pt.equals(this,e)};Pt.prototype.equalsEpsilon=function(e,t){return Pt.equalsEpsilon(this,e,t)};Pt.prototype.toString=function(){return Pt.toIso8601(this)};Pt.leapSeconds=[new Yi(new Pt(2441317,43210,Hn.TAI),10),new Yi(new Pt(2441499,43211,Hn.TAI),11),new Yi(new Pt(2441683,43212,Hn.TAI),12),new Yi(new Pt(2442048,43213,Hn.TAI),13),new Yi(new Pt(2442413,43214,Hn.TAI),14),new Yi(new Pt(2442778,43215,Hn.TAI),15),new Yi(new Pt(2443144,43216,Hn.TAI),16),new Yi(new Pt(2443509,43217,Hn.TAI),17),new Yi(new Pt(2443874,43218,Hn.TAI),18),new Yi(new Pt(2444239,43219,Hn.TAI),19),new Yi(new Pt(2444786,43220,Hn.TAI),20),new Yi(new Pt(2445151,43221,Hn.TAI),21),new Yi(new Pt(2445516,43222,Hn.TAI),22),new Yi(new Pt(2446247,43223,Hn.TAI),23),new Yi(new Pt(2447161,43224,Hn.TAI),24),new Yi(new Pt(2447892,43225,Hn.TAI),25),new Yi(new Pt(2448257,43226,Hn.TAI),26),new Yi(new Pt(2448804,43227,Hn.TAI),27),new Yi(new Pt(2449169,43228,Hn.TAI),28),new Yi(new Pt(2449534,43229,Hn.TAI),29),new Yi(new Pt(2450083,43230,Hn.TAI),30),new Yi(new Pt(2450630,43231,Hn.TAI),31),new Yi(new Pt(2451179,43232,Hn.TAI),32),new Yi(new Pt(2453736,43233,Hn.TAI),33),new Yi(new Pt(2454832,43234,Hn.TAI),34),new Yi(new Pt(2456109,43235,Hn.TAI),35),new Yi(new Pt(2457204,43236,Hn.TAI),36),new Yi(new Pt(2457754,43237,Hn.TAI),37)];var q=Pt;var HGt=T(S(),1),zq=T(sd(),1);var oZt=T(S(),1);function cVe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var BL=cVe;var aZt=T(S(),1);function wq(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=wq(o,t)),n[i]=o}return n}var Ye=wq;var uZt=T(S(),1);function Fq(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=Fq(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Tt=Fq;var hZt=T(S(),1);function lVe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Sl=lVe;var gZt=T(S(),1),Aq=T(sd(),1);function o3(e,t){let n;return typeof document<"u"&&(n=document),o3._implementation(e,t,n)}o3._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new Aq.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Jh=o3;var xZt=T(S(),1),Mq=T(sd(),1);function dVe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Mq.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var OL=dVe;var TZt=T(S(),1),Nq=T(sd(),1);function uVe(e){let t=new Nq.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var $y=uVe;var VZt=T(S(),1);var kq={};function mVe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=kq[t];l(i)||(i={},kq[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var Lm=mVe;var RZt=T(S(),1);var hVe=/^blob:/i;function fVe(e){return hVe.test(e)}var ex=fVe;var EZt=T(S(),1);var Qh;function pVe(e){l(Qh)||(Qh=document.createElement("a")),Qh.href=window.location.href;let t=Qh.host,n=Qh.protocol;return Qh.href=e,Qh.href=Qh.href,n!==Qh.protocol||t!==Qh.host}var W0=pVe;var XZt=T(S(),1);var bVe=/^data:/i;function gVe(e){return bVe.test(e)}var _p=gVe;var PZt=T(S(),1);function yVe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var tx=yVe;var wZt=T(S(),1);function xVe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var YL=CVe;function Uq(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=YL(this.responseHeaders))}Uq.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var jh=Uq;var gGt=T(S(),1),mN=T(sd(),1);var iGt=T(S(),1);function HL(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(HL.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});HL.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};HL.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r0){for(o.sort(VVe),e=0;e=0;--t)this.heapify(t)};ix.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(oi&&(r=t[i],this._length=i),r};ix.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return r3(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var zL=ix;function LVe(e,t){return e.priority-t.priority}var eo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},AS=20,$a=new zL({comparator:LVe});$a.maximumLength=AS;$a.reserve(AS);var qh=[],Tp={},RVe=typeof document<"u"?new mN.default(document.location.href):new mN.default,hN=new ge;function Jo(){}Jo.maximumRequests=50;Jo.maximumRequestsPerServer=18;Jo.requestsByServer={};Jo.throttleRequests=!0;Jo.debugShowStatistics=!1;Jo.requestCompletedEvent=hN;Object.defineProperties(Jo,{statistics:{get:function(){return eo}},priorityHeapLength:{get:function(){return AS},set:function(e){if(ee;){let t=$a.pop();ox(t)}AS=e,$a.maximumLength=e,$a.reserve(e)}}});function Dq(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Jo.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(Jo.requestsByServer[e],Jo.maximumRequestsPerServer);return Tp[e]+t<=n};Jo.heapHasOpenSlots=function(e){return $a.length+e<=AS};function Bq(e){return e.state===jn.UNISSUED&&(e.state=jn.ISSUED,e.deferred=Sl()),e.deferred.promise}function ZVe(e){return function(t){if(e.state===jn.CANCELLED)return;let n=e.deferred;--eo.numberOfActiveRequests,--Tp[e.serverKey],hN.raiseEvent(),e.state=jn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function GVe(e){return function(t){e.state!==jn.CANCELLED&&(++eo.numberOfFailedRequests,--eo.numberOfActiveRequests,--Tp[e.serverKey],hN.raiseEvent(t),e.state=jn.FAILED,e.deferred.reject(t))}}function Oq(e){let t=Bq(e);return e.state=jn.ACTIVE,qh.push(e),++eo.numberOfActiveRequests,++eo.numberOfActiveRequestsEver,++Tp[e.serverKey],e.requestFunction().then(ZVe(e)).catch(GVe(e)),t}function ox(e){let t=e.state===jn.ACTIVE;if(e.state=jn.CANCELLED,++eo.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--eo.numberOfActiveRequests,--Tp[e.serverKey],++eo.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Jo.update=function(){let e,t,n=0,i=qh.length;for(e=0;e0&&(qh[e-n]=t)}qh.length-=n;let o=$a.internalArray,r=$a.length;for(e=0;e0;){if(t=$a.pop(),t.cancelled){ox(t);continue}if(t.throttleByServer&&!Jo.serverHasOpenSlots(t.serverKey)){ox(t);continue}Oq(t),++a}EVe()};Jo.getServerKey=function(e){let t=new mN.default(e);t.scheme()===""&&(t=t.absoluteTo(RVe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Tp[n];return l(i)||(Tp[n]=0),n};Jo.request=function(e){if(_p(e.url)||ex(e.url))return hN.raiseEvent(),e.state=jn.RECEIVED,e.requestFunction();if(++eo.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Jo.getServerKey(e.url)),Jo.throttleRequests&&e.throttleByServer&&!Jo.serverHasOpenSlots(e.serverKey))return;if(!Jo.throttleRequests||!e.throttle)return Oq(e);if(qh.length>=Jo.maximumRequests)return;Dq(e);let t=$a.insert(e);if(l(t)){if(t===e)return;ox(t)}return Bq(e)};function EVe(){Jo.debugShowStatistics&&(eo.numberOfActiveRequests===0&&eo.lastNumberOfActiveRequests>0&&(eo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${eo.numberOfAttemptedRequests}`),eo.numberOfAttemptedRequests=0),eo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${eo.numberOfCancelledRequests}`),eo.numberOfCancelledRequests=0),eo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${eo.numberOfCancelledActiveRequests}`),eo.numberOfCancelledActiveRequests=0),eo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${eo.numberOfFailedRequests}`),eo.numberOfFailedRequests=0)),eo.lastNumberOfActiveRequests=eo.numberOfActiveRequests)}Jo.clearForSpecs=function(){for(;$a.length>0;){let t=$a.pop();ox(t)}let e=qh.length;for(let t=0;t0}},credits:{get:function(){return this._credits}}});It.prototype.toString=function(){return this.getUrlComponent(!0,!0)};It.prototype.parseUrl=function(e,t,n,i){let o=new zq.default(e),r=XVe(o.query());this._queryParameters=t?pN(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Jh(i))),this._url=o.toString()};function XVe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:ad(e)}function pN(e,t,n){if(!n)return Tt(e,t);let i=Ye(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}It.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${WVe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function WVe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${nx(e)}`}It.prototype.setQueryParameters=function(e,t){t?this._queryParameters=pN(this._queryParameters,e,!1):this._queryParameters=pN(e,this._queryParameters,!1)};It.prototype.appendQueryParameters=function(e){this._queryParameters=pN(e,this._queryParameters,!0)};It.prototype.setTemplateValues=function(e,t){t?this._templateValues=Tt(this._templateValues,e):this._templateValues=Tt(e,this._templateValues)};It.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Tt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Tt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Tt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};It.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};It.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new It({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};It.prototype.getBaseUri=function(e){return OL(this.getUrlComponent(e),e)};It.prototype.appendForwardSlash=function(){this._url=BL(this._url)};It.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};It.fetchArrayBuffer=function(e){return new It(e).fetchArrayBuffer()};It.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};It.fetchBlob=function(e){return new It(e).fetchBlob()};It.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(a3(this.request),!Kq||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return s3({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return It.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return It.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(u);return c=new It({url:h}),s3({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(l(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return l(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};function s3(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Sl();return It._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=ec.request(r);if(l(s))return s.catch(function(a){return r.state!==jn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=jn.UNISSUED,r.deferred=void 0,s3({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}It.fetchImage=function(e){return new It(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};It.prototype.fetchText=function(){return this.fetch({responseType:"text"})};It.fetchText=function(e){return new It(e).fetchText()};It.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};It.fetchJson=function(e){return new It(e).fetchJson()};It.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};It.fetchXML=function(e){return new It(e).fetchXML()};It.prototype.fetchJsonp=function(e){e=y(e,"callback"),a3(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Jq(this,e,t)};function Jq(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=Sl();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},It._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=ec.request(o);if(l(s))return s.catch(function(a){return o.state!==jn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=jn.UNISSUED,o.deferred=void 0,Jq(e,t,n)):Promise.reject(a)})})}It.fetchJsonp=function(e){return new It(e).fetchJsonp(e.callbackParameterName)};It.prototype._makeRequest=function(e){let t=this;a3(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=Tt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=Sl(),h=It._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(h)&&l(h.abort)&&(n.cancelFunction=function(){h.abort()}),u.promise};let o=ec.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==jn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=jn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function a3(e){if(e.state===jn.ISSUED||e.state===jn.ACTIVE)throw new ae("The Resource is already being fetched.");e.state=jn.UNISSUED,e.deferred=void 0}var PVe=/^data:(.*?)(;base64)?,(.*)$/;function fN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Hq(e,t){let n=fN(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r{if(!a.ok){let c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new jh(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new jh)})}var FVe=typeof XMLHttpRequest>"u";It._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=PVe.exec(e);if(a!==null){r.resolve(vVe(a,t));return}if(FVe){wVe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(NS.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);l(t)&&(c.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new jh(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,h=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};g.forEach(function(x){let _=x.split(": "),C=_.shift();f[C]=_.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve(void 0);else if(l(u)&&(!l(t)||h===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(h===""||h==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(h===""||h==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new ae("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new jh)},c.send(i),c};It._Implementations.loadAndExecuteScript=function(e,t,n){return tx(e,t).catch(function(i){n.reject(i)})};It._DefaultImplementations={};It._DefaultImplementations.createImage=It._Implementations.createImage;It._DefaultImplementations.loadWithXhr=It._Implementations.loadWithXhr;It._DefaultImplementations.loadAndExecuteScript=It._Implementations.loadAndExecuteScript;It.DEFAULT=Object.freeze(new It({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ze=It;function QL(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?Qq(this,e.data):Qq(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}QL.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ze.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ae(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new QL({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};QL.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new I0(0,0,0,0,0),t}});QL.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new I0(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],d=q.lessThanOrEquals(a,e),u=!l(c),h=u||q.greaterThanOrEquals(c,e);if(d&&h)return o=i,!u&&c.equals(e)&&++o,r=o+1,qq(this,n,this._samples,e,o,r,t),t}let s=Xo(n,e,q.compare,this._dateColumn);return s>=0?(st.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],d=t[r];if(c.equals(d)||i.equals(c))return jq(e,n,o,a,s),s;if(i.equals(d))return jq(e,n,r,a,s),s;let u=q.secondsDifference(i,c)/q.secondsDifference(d,c),h=o*a,p=r*a,g=n[h+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],x=f-g;if(x>.5||x<-.5){let _=n[h+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];_!==C&&(d.equals(i)?g=f:f-=C-_)}return s.xPoleWander=JL(u,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=JL(u,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=JL(u,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=JL(u,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=JL(u,g,f),s}var jL=QL;var lEt=T(S(),1);function tc(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}tc.fromQuaternion=function(e,t){l(t)||(t=new tc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-W.asinClamped(n),t};tc.fromDegrees=function(e,t,n,i){return l(i)||(i=new tc),i.heading=e*W.RADIANS_PER_DEGREE,i.pitch=t*W.RADIANS_PER_DEGREE,i.roll=n*W.RADIANS_PER_DEGREE,i};tc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new tc(e.heading,e.pitch,e.roll)};tc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};tc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.heading,t.heading,n,i)&&W.equalsEpsilon(e.pitch,t.pitch,n,i)&&W.equalsEpsilon(e.roll,t.roll,n,i)};tc.prototype.clone=function(e){return tc.clone(this,e)};tc.prototype.equals=function(e){return tc.equals(this,e)};tc.prototype.equalsEpsilon=function(e,t,n){return tc.equalsEpsilon(this,e,t,n)};tc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Ra=tc;var REt=T(S(),1);var fEt=T(S(),1);var $q={};var e$=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function MVe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(l(bN)||(bN=document.createElement("a")),bN.href=e,bN.href)}var rx;function n$(){if(l(rx))return rx;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l($q?.url)?e=Jh(".",$q.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(U9.toUrl)?e=Jh("..",sx("Core/buildModuleUrl.js")):e=MVe(),rx=new Ze({url:t$(e)}),rx.appendForwardSlash(),rx}function NVe(e){return t$(U9.toUrl(`../${e}`))}function i$(e){return n$().getDerivedResource({url:e}).url}var gN;function sx(e){return l(gN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(U9.toUrl)?gN=NVe:gN=i$),gN(e)}sx._cesiumScriptRegex=e$;sx._buildModuleUrlFromBaseUrl=i$;sx._clearBaseResource=function(){rx=void 0};sx.setBaseUrl=function(e){rx=Ze.DEFAULT.getDerivedResource({url:e})};sx.getCesiumBaseUrl=n$;var nn=sx;var gEt=T(S(),1);function kVe(e,t,n){this.x=e,this.y=t,this.s=n}var ax=kVe;function d3(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Ze.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new q(this._sampleZeroJulianEphemerisDate,0,Hn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var UVe=new q(0,0,Hn.TAI);function c3(e,t,n){let i=UVe;return i.dayNumber=t,i.secondsOfDay=n,q.daysDifference(i,e._sampleZeroDateTT)}d3.prototype.preload=function(e,t,n,i){let o=c3(this,e,t),r=c3(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let h=c;h<=d;++h)u.push(l3(this,h));return Promise.all(u)};d3.prototype.computeXysRadians=function(e,t,n){let i=c3(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,d=this._samples;if(l(d[s*3])||(l3(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(l3(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new ax(0,0,0);let u=i-s*this._stepSizeDays,h=this._work,p=this._denominators,g=this._coef,f=this._xTable,x,_;for(x=0;x<=r;++x)h[x]=u-f[x];for(x=0;x<=r;++x){for(g[x]=1,_=0;_<=r;++_)_!==x&&(g[x]*=h[_]);g[x]*=p[x];let C=(s+x)*3;n.x+=g[x]*d[C++],n.y+=g[x]*d[C++],n.s+=g[x]*d[C]}return n};function l3(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Ze({url:nn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let d=0,u=a.length;d0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let h=DVe,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let g=h[p],f=h[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(f,f)]+1);let x=BVe;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(f,g)]-e[$.getElementIndex(g,f)])*n,x[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,x[f]=(e[$.getElementIndex(f,p)]+e[$.getElementIndex(p,f)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ot(i,o,r,s)};var o$=new ot,r$=new ot,u3=new ot,s$=new ot;ot.fromHeadingPitchRoll=function(e,t){return s$=ot.fromAxisAngle(m.UNIT_X,e.roll,o$),u3=ot.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=ot.multiply(u3,s$,u3),r$=ot.fromAxisAngle(m.UNIT_Z,-e.heading,o$),ot.multiply(r$,t,t)};var yN=new m,m3=new m,Rm=new ot,a$=new ot,xN=new ot;ot.packedLength=4;ot.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ot.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ot),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ot.packedInterpolationLength=3;ot.convertPackedArrayForInterpolation=function(e,t,n,i){ot.unpack(e,n*4,xN),ot.conjugate(xN,xN);for(let o=0,r=n-t+1;o=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,d=a*a;for(let g=7;g>=0;--g)Sp[g]=(_N[g]*c-TN[g])*s,Cp[g]=(_N[g]*d-TN[g])*s;let u=r*n*(1+Sp[0]*(1+Sp[1]*(1+Sp[2]*(1+Sp[3]*(1+Sp[4]*(1+Sp[5]*(1+Sp[6]*(1+Sp[7])))))))),h=a*(1+Cp[0]*(1+Cp[1]*(1+Cp[2]*(1+Cp[3]*(1+Cp[4]*(1+Cp[5]*(1+Cp[6]*(1+Cp[7])))))))),p=ot.multiplyByScalar(e,h,HVe);return ot.multiplyByScalar(t,u,i),ot.add(p,i,i)};ot.fastSquad=function(e,t,n,i,o,r){let s=ot.fastSlerp(e,t,o,eR),a=ot.fastSlerp(n,i,o,US);return ot.fastSlerp(s,a,2*o*(1-o),r)};ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};ot.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};ot.ZERO=Object.freeze(new ot(0,0,0,0));ot.IDENTITY=Object.freeze(new ot(0,0,0,1));ot.prototype.clone=function(e){return ot.clone(this,e)};ot.prototype.equals=function(e){return ot.equals(this,e)};ot.prototype.equalsEpsilon=function(e,t){return ot.equalsEpsilon(this,e,t)};ot.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var ve=ot;var ui={},b3={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},DS={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},g3={},Cl={east:new m,north:new m,up:new m,west:new m,south:new m,down:new m},P0=new m,v0=new m,w0=new m;ui.localFrameToFixedFrameGenerator=function(e,t){if(!b3.hasOwnProperty(e)||!b3[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=b3[e][t],i,o=e+t;return l(g3[o])?i=g3[o]:(i=function(r,s,a){if(l(a)||(a=new M),m.equalsEpsilon(r,m.ZERO,W.EPSILON14))m.unpack(DS[e],0,P0),m.unpack(DS[t],0,v0),m.unpack(DS[n],0,w0);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);m.unpack(DS[e],0,P0),e!=="east"&&e!=="west"&&m.multiplyByScalar(P0,c,P0),m.unpack(DS[t],0,v0),t!=="east"&&t!=="west"&&m.multiplyByScalar(v0,c,v0),m.unpack(DS[n],0,w0),n!=="east"&&n!=="west"&&m.multiplyByScalar(w0,c,w0)}else{s=y(s,ne.default),s.geodeticSurfaceNormal(r,Cl.up);let c=Cl.up,d=Cl.east;d.x=-r.y,d.y=r.x,d.z=0,m.normalize(d,Cl.east),m.cross(c,d,Cl.north),m.multiplyByScalar(Cl.up,-1,Cl.down),m.multiplyByScalar(Cl.east,-1,Cl.west),m.multiplyByScalar(Cl.north,-1,Cl.south),P0=Cl[e],v0=Cl[t],w0=Cl[n]}return a[0]=P0.x,a[1]=P0.y,a[2]=P0.z,a[3]=0,a[4]=v0.x,a[5]=v0.y,a[6]=v0.z,a[7]=0,a[8]=w0.x,a[9]=w0.y,a[10]=w0.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},g3[o]=i),i};ui.eastNorthUpToFixedFrame=ui.localFrameToFixedFrameGenerator("east","north");ui.northEastDownToFixedFrame=ui.localFrameToFixedFrameGenerator("north","east");ui.northUpEastToFixedFrame=ui.localFrameToFixedFrameGenerator("north","up");ui.northWestUpToFixedFrame=ui.localFrameToFixedFrameGenerator("north","west");var zVe=new ve,KVe=new m(1,1,1),JVe=new M;ui.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,ui.eastNorthUpToFixedFrame);let r=ve.fromHeadingPitchRoll(t,zVe),s=M.fromTranslationQuaternionRotationScale(m.ZERO,r,KVe,JVe);return o=i(e,n,o),M.multiply(o,s,o)};var QVe=new M,jVe=new $;ui.headingPitchRollQuaternion=function(e,t,n,i,o){let r=ui.headingPitchRollToFixedFrame(e,t,n,i,QVe),s=M.getMatrix3(r,jVe);return ve.fromRotationMatrix(s,o)};var qVe=new m(1,1,1),$Ve=new m,d$=new M,eLe=new M,tLe=new $,nLe=new ve;ui.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,ne.default),n=y(n,ui.eastNorthUpToFixedFrame),l(i)||(i=new Ra);let o=M.getTranslation(e,$Ve);if(m.equals(o,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=M.inverseTransformation(n(o,t,d$),d$),s=M.setScale(e,qVe,eLe);s=M.setTranslation(s,m.ZERO,s),r=M.multiply(r,s,r);let a=ve.fromRotationMatrix(M.getMatrix3(r,tLe),nLe);return a=ve.normalize(a,a),Ra.fromQuaternion(a,i)};var iLe=6*3600+41*60+50.54841,oLe=8640184812866e-6,rLe=.093104,sLe=-62e-7,aLe=11772758384668e-32,cLe=72921158553e-15,lLe=W.TWO_PI/86400,SN=new q;ui.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=ui.computeIcrfToFixedMatrix(e,t);return l(n)||(n=ui.computeTemeToPseudoFixedMatrix(e,t)),n};ui.computeTemeToPseudoFixedMatrix=function(e,t){SN=q.addSeconds(e,-q.computeTaiMinusUtc(e),SN);let n=SN.dayNumber,i=SN.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/Kn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Kn.DAYS_PER_JULIAN_CENTURY;let a=(iLe+o*(oLe+o*(rLe+o*sLe)))*lLe%W.TWO_PI,c=cLe+aLe*(n-24515455e-1),d=(i+Kn.SECONDS_PER_DAY*.5)%Kn.SECONDS_PER_DAY,u=a+c*d,h=Math.cos(u),p=Math.sin(u);return l(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(h,p,0,-p,h,0,0,0,1)};ui.iau2006XysData=new qL;ui.earthOrientationParameters=jL.NONE;var _3=32.184,dLe=2451545;ui.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+_3,i=e.stop.dayNumber,o=e.stop.secondsOfDay+_3;return ui.iau2006XysData.preload(t,n,i,o)};ui.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=ui.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var uLe=32.184,mLe=2451545,CN=new Ra,hLe=new $,fLe=new q;ui.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=q.addSeconds(e,uLe,fLe),i=q.totalDays(n)-mLe,o=W.toRadians(12.112)-W.toRadians(.052992)*i,r=W.toRadians(24.224)-W.toRadians(.105984)*i,s=W.toRadians(227.645)+W.toRadians(13.012)*i,a=W.toRadians(261.105)+W.toRadians(13.340716)*i,c=W.toRadians(358)+W.toRadians(.9856)*i;return CN.pitch=W.toRadians(180)-W.toRadians(3.878)*Math.sin(o)-W.toRadians(.12)*Math.sin(r)+W.toRadians(.07)*Math.sin(s)-W.toRadians(.017)*Math.sin(a),CN.roll=W.toRadians(66.53-90)+W.toRadians(1.543)*Math.cos(o)+W.toRadians(.24)*Math.cos(r)-W.toRadians(.028)*Math.cos(s)+W.toRadians(.007)*Math.cos(a),CN.heading=W.toRadians(244.375-90)+W.toRadians(13.17635831)*i+W.toRadians(3.558)*Math.sin(o)+W.toRadians(.121)*Math.sin(r)-W.toRadians(.064)*Math.sin(s)+W.toRadians(.016)*Math.sin(a)+W.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(CN,hLe)};ui.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=ui.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var pLe=new ax(0,0,0),bLe=new I0(0,0,0,0,0,0),y3=new $,x3=new $;ui.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=ui.earthOrientationParameters.compute(e,bLe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+_3,r=ui.iau2006XysData.computeXysRadians(i,o,pLe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=y3;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);let u=$.fromRotationZ(-r.s,x3),h=$.multiply(d,u,y3),p=e.dayNumber,g=e.secondsOfDay-q.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,x=g/Kn.SECONDS_PER_DAY,_=.779057273264+x+.00273781191135448*(f+x);_=_%1*W.TWO_PI;let C=$.fromRotationZ(_,x3),V=$.multiply(h,C,y3),L=Math.cos(n.xPoleWander),Z=Math.cos(n.yPoleWander),G=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),v=i-dLe+o/Kn.SECONDS_PER_DAY;v/=36525;let P=-47e-6*v*W.RADIANS_PER_DEGREE/3600,w=Math.cos(P),F=Math.sin(P),b=x3;return b[0]=L*w,b[1]=L*F,b[2]=G,b[3]=-Z*F+I*G*w,b[4]=Z*w+I*G*F,b[5]=-I*L,b[6]=-I*F-Z*G*w,b[7]=I*w-Z*G*F,b[8]=Z*L,$.multiply(V,b,t)};var gLe=new se;ui.pointToWindowCoordinates=function(e,t,n,i){return i=ui.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ui.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new D);let o=gLe;return M.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),M.multiplyByVector(t,o,o),D.fromCartesian4(o,i)};var yLe=new m,xLe=new m,_Le=new m;ui.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,ne.default).geodeticSurfaceNormal(e,yLe),r=m.cross(t,o,xLe);m.equalsEpsilon(r,m.ZERO,W.EPSILON6)&&(r=m.clone(m.UNIT_X,r));let s=m.cross(r,t,_Le);return m.normalize(s,s),m.cross(t,s,r),m.negate(r,r),m.normalize(r,r),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var u$=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),m$=new he,T3=new m,TLe=new m,SLe=new $,S3=new M,h$=new M;ui.basisTo2D=function(e,t,n){let i=M.getTranslation(t,TLe),o=e.ellipsoid,r;if(m.equals(i,m.ZERO))r=m.clone(m.ZERO,T3);else{let u=o.cartesianToCartographic(i,m$);r=e.project(u,T3),m.fromElements(r.z,r.x,r.y,r)}let s=ui.eastNorthUpToFixedFrame(i,o,S3),a=M.inverseTransformation(s,h$),c=M.getMatrix3(t,SLe),d=M.multiplyByMatrix3(a,c,n);return M.multiply(u$,d,n),M.setTranslation(n,r,n),n};ui.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=ui.eastNorthUpToFixedFrame(t,i,S3),r=M.inverseTransformation(o,h$),s=i.cartesianToCartographic(t,m$),a=e.project(s,T3);m.fromElements(a.z,a.x,a.y,a);let c=M.fromTranslation(a,S3);return M.multiply(u$,r,n),M.multiply(c,n,n),n};var vt=ui;function En(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(En.prototype,{width:{get:function(){return En.computeWidth(this)}},height:{get:function(){return En.computeHeight(this)}}});En.packedLength=4;En.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};En.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new En),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};En.computeWidth=function(e){let t=e.east,n=e.west;return t=0?u.longitude:u.longitude+W.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>W.PI&&(i=i-W.TWO_PI),n>W.PI&&(n=n-W.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new En(n,s,i,a)};En.fromCartesianArray=function(e,t,n){t=y(t,ne.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let d=0,u=e.length;d=0?h.longitude:h.longitude+W.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>W.PI&&(o=o-W.TWO_PI),i>W.PI&&(i=i-W.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new En(i,a,o,c)};var CLe=new m,VLe=new m,LLe=new m,RLe=new m,ZLe=new m,C3=new Array(5);for(let e=0;e0?i+=W.TWO_PI:r0&&(r+=W.TWO_PI),i=u))return l(n)?(n.west=a,n.south=d,n.east=c,n.north=u,n):new En(a,d,c,u)};En.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new En(i,o,r,s)};En.union=function(e,t,n){l(n)||(n=new En);let i=e.east,o=e.west,r=t.east,s=t.west;i0?i+=W.TWO_PI:r0&&(r+=W.TWO_PI),io||W.equalsEpsilon(n,o,W.EPSILON14))&&(n=e.south&&i<=e.north};var GLe=new he;En.subsample=function(e,t,n,i){t=y(t,ne.default),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,d=GLe;d.height=n,d.longitude=c,d.latitude=r,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.latitude=s,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,r<0?d.latitude=r:s>0?d.latitude=s:d.latitude=0;for(let u=1;u<8;++u)d.longitude=-Math.PI+u*W.PI_OVER_TWO,En.contains(e,d)&&(i[o]=t.cartographicToCartesian(d,i[o]),o++);return d.latitude===0&&(d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++),i.length=o,i};En.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new En),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=W.TWO_PI+e.east-e.west;r.west=W.negativePiToPi(e.west+t*a),r.east=W.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};En.MAX_VALUE=Object.freeze(new En(-Math.PI,-W.PI_OVER_TWO,Math.PI,W.PI_OVER_TWO));var ce=En;function Xr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Xr.packedLength=4;Xr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Xr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Xr.fromPoints=function(e,t){if(l(t)||(t=new Xr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;an.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};Xr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.widthr+t.height?Ht.OUTSIDE:Ht.INTERSECTING};Xr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Xr.prototype.clone=function(e){return Xr.clone(this,e)};Xr.prototype.intersect=function(e){return Xr.intersect(this,e)};Xr.prototype.equals=function(e){return Xr.equals(this,e)};var ze=Xr;var VIt=T(S(),1);var Za={POINTS:ie.POINTS,LINES:ie.LINES,LINE_LOOP:ie.LINE_LOOP,LINE_STRIP:ie.LINE_STRIP,TRIANGLES:ie.TRIANGLES,TRIANGLE_STRIP:ie.TRIANGLE_STRIP,TRIANGLE_FAN:ie.TRIANGLE_FAN};Za.isLines=function(e){return e===Za.LINES||e===Za.LINE_LOOP||e===Za.LINE_STRIP};Za.isTriangles=function(e){return e===Za.TRIANGLES||e===Za.TRIANGLE_STRIP||e===Za.TRIANGLE_FAN};Za.validate=function(e){return e===Za.POINTS||e===Za.LINES||e===Za.LINE_LOOP||e===Za.LINE_STRIP||e===Za.TRIANGLES||e===Za.TRIANGLE_STRIP||e===Za.TRIANGLE_FAN};var we=Object.freeze(Za);var RIt=T(S(),1),cx=`in vec4 position; in vec2 textureCoordinates; out vec2 v_textureCoordinates; @@ -87,14 +87,14 @@ void main() gl_Position = position; v_textureCoordinates = textureCoordinates; } -`;var ZIt=T(S(),1);var gr={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function qL(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,we.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function tc(e,t){return(e._flags&t)===t}function w0(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(qL.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return tc(this,gr.CULL)},set:function(e){tc(this,gr.CULL)!==e&&(w0(this,gr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return tc(this,gr.OCCLUDE)},set:function(e){tc(this,gr.OCCLUDE)!==e&&(w0(this,gr.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return tc(this,gr.CAST_SHADOWS)},set:function(e){tc(this,gr.CAST_SHADOWS)!==e&&(w0(this,gr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return tc(this,gr.RECEIVE_SHADOWS)},set:function(e){tc(this,gr.RECEIVE_SHADOWS)!==e&&(w0(this,gr.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return tc(this,gr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){tc(this,gr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(w0(this,gr.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return tc(this,gr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){tc(this,gr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(w0(this,gr.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return tc(this,gr.PICK_ONLY)},set:function(e){tc(this,gr.PICK_ONLY)!==e&&(w0(this,gr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return tc(this,gr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){tc(this,gr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(w0(this,gr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});qL.shallowClone=function(e,t){if(l(e))return l(t)||(t=new qL),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};qL.prototype.execute=function(e,t){e.draw(this,t)};var qe=qL;var DIt=T(S(),1);var vIt=T(S(),1);var IIt=T(S(),1);var ui={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,HALF_FLOAT:ie.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ie.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ie.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ie.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ie.UNSIGNED_SHORT_5_6_5};ui.toWebGLConstant=function(e,t){switch(e){case ui.UNSIGNED_BYTE:return ie.UNSIGNED_BYTE;case ui.UNSIGNED_SHORT:return ie.UNSIGNED_SHORT;case ui.UNSIGNED_INT:return ie.UNSIGNED_INT;case ui.FLOAT:return ie.FLOAT;case ui.HALF_FLOAT:return t.webgl2?ie.HALF_FLOAT:ie.HALF_FLOAT_OES;case ui.UNSIGNED_INT_24_8:return ie.UNSIGNED_INT_24_8;case ui.UNSIGNED_SHORT_4_4_4_4:return ie.UNSIGNED_SHORT_4_4_4_4;case ui.UNSIGNED_SHORT_5_5_5_1:return ie.UNSIGNED_SHORT_5_5_5_1;case ui.UNSIGNED_SHORT_5_6_5:return ui.UNSIGNED_SHORT_5_6_5}};ui.isPacked=function(e){return e===ui.UNSIGNED_INT_24_8||e===ui.UNSIGNED_SHORT_4_4_4_4||e===ui.UNSIGNED_SHORT_5_5_5_1||e===ui.UNSIGNED_SHORT_5_6_5};ui.sizeInBytes=function(e){switch(e){case ui.UNSIGNED_BYTE:return 1;case ui.UNSIGNED_SHORT:case ui.UNSIGNED_SHORT_4_4_4_4:case ui.UNSIGNED_SHORT_5_5_5_1:case ui.UNSIGNED_SHORT_5_6_5:case ui.HALF_FLOAT:return 2;case ui.UNSIGNED_INT:case ui.FLOAT:case ui.UNSIGNED_INT_24_8:return 4}};ui.validate=function(e){return e===ui.UNSIGNED_BYTE||e===ui.UNSIGNED_SHORT||e===ui.UNSIGNED_INT||e===ui.FLOAT||e===ui.HALF_FLOAT||e===ui.UNSIGNED_INT_24_8||e===ui.UNSIGNED_SHORT_4_4_4_4||e===ui.UNSIGNED_SHORT_5_5_5_1||e===ui.UNSIGNED_SHORT_5_6_5};ui.getTypedArrayConstructor=function(e){let t=ui.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===ui.FLOAT?Float32Array:Uint32Array};var je=Object.freeze(ui);var at={DEPTH_COMPONENT:ie.DEPTH_COMPONENT,DEPTH_STENCIL:ie.DEPTH_STENCIL,ALPHA:ie.ALPHA,RED:ie.RED,RG:ie.RG,RGB:ie.RGB,RGBA:ie.RGBA,LUMINANCE:ie.LUMINANCE,LUMINANCE_ALPHA:ie.LUMINANCE_ALPHA,RGB_DXT1:ie.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ie.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ie.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ie.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ie.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ie.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ie.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ie.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ie.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ie.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ie.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ie.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ie.COMPRESSED_RGBA_BPTC_UNORM};at.componentsLength=function(e){switch(e){case at.RGB:return 3;case at.RGBA:return 4;case at.LUMINANCE_ALPHA:case at.RG:return 2;case at.ALPHA:case at.RED:case at.LUMINANCE:return 1;default:return 1}};at.validate=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL||e===at.ALPHA||e===at.RED||e===at.RG||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA||e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isColorFormat=function(e){return e===at.RED||e===at.ALPHA||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA};at.isDepthFormat=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL};at.isCompressedFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isDXTFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5};at.isPVRTCFormat=function(e){return e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1};at.isASTCFormat=function(e){return e===at.RGBA_ASTC};at.isETC1Format=function(e){return e===at.RGB_ETC1};at.isETC2Format=function(e){return e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC};at.isBC7Format=function(e){return e===at.RGBA_BC7};at.compressedTextureSizeInBytes=function(e,t,n){switch(e){case at.RGB_DXT1:case at.RGBA_DXT1:case at.RGB_ETC1:case at.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case at.RGBA_DXT3:case at.RGBA_DXT5:case at.RGBA_ASTC:case at.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case at.RGB_PVRTC_4BPPV1:case at.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case at.RGB_PVRTC_2BPPV1:case at.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case at.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};at.textureSizeInBytes=function(e,t,n,i){let o=at.componentsLength(e);return je.isPacked(t)&&(o=1),o*je.sizeInBytes(t)*n*i};at.alignmentInBytes=function(e,t,n){let i=at.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};at.createTypedArray=function(e,t,n,i){let o=je.getTypedArrayConstructor(t),r=at.componentsLength(e)*n*i;return new o(r)};at.flipY=function(e,t,n,i,o){if(o===1)return e;let r=at.createTypedArray(t,n,i,o),s=at.componentsLength(t),a=i*s;for(let c=0;c0&&console.log(`${nf}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${nf}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${nf}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let d,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${nf}Shader program link log: ${c}`),h(o,"vertex"),h(r,"fragment"),d=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${nf}Vertex shader compile log: ${c}`),console.error(`${nf} Vertex shader source: +`;var XIt=T(S(),1);var gr={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function tR(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,we.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function nc(e,t){return(e._flags&t)===t}function F0(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(tR.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return nc(this,gr.CULL)},set:function(e){nc(this,gr.CULL)!==e&&(F0(this,gr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return nc(this,gr.OCCLUDE)},set:function(e){nc(this,gr.OCCLUDE)!==e&&(F0(this,gr.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return nc(this,gr.CAST_SHADOWS)},set:function(e){nc(this,gr.CAST_SHADOWS)!==e&&(F0(this,gr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return nc(this,gr.RECEIVE_SHADOWS)},set:function(e){nc(this,gr.RECEIVE_SHADOWS)!==e&&(F0(this,gr.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return nc(this,gr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){nc(this,gr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(F0(this,gr.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return nc(this,gr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){nc(this,gr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(F0(this,gr.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return nc(this,gr.PICK_ONLY)},set:function(e){nc(this,gr.PICK_ONLY)!==e&&(F0(this,gr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return nc(this,gr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){nc(this,gr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(F0(this,gr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});tR.shallowClone=function(e,t){if(l(e))return l(t)||(t=new tR),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};tR.prototype.execute=function(e,t){e.draw(this,t)};var qe=tR;var HIt=T(S(),1);var MIt=T(S(),1);var vIt=T(S(),1);var mi={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,HALF_FLOAT:ie.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ie.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ie.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ie.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ie.UNSIGNED_SHORT_5_6_5};mi.toWebGLConstant=function(e,t){switch(e){case mi.UNSIGNED_BYTE:return ie.UNSIGNED_BYTE;case mi.UNSIGNED_SHORT:return ie.UNSIGNED_SHORT;case mi.UNSIGNED_INT:return ie.UNSIGNED_INT;case mi.FLOAT:return ie.FLOAT;case mi.HALF_FLOAT:return t.webgl2?ie.HALF_FLOAT:ie.HALF_FLOAT_OES;case mi.UNSIGNED_INT_24_8:return ie.UNSIGNED_INT_24_8;case mi.UNSIGNED_SHORT_4_4_4_4:return ie.UNSIGNED_SHORT_4_4_4_4;case mi.UNSIGNED_SHORT_5_5_5_1:return ie.UNSIGNED_SHORT_5_5_5_1;case mi.UNSIGNED_SHORT_5_6_5:return mi.UNSIGNED_SHORT_5_6_5}};mi.isPacked=function(e){return e===mi.UNSIGNED_INT_24_8||e===mi.UNSIGNED_SHORT_4_4_4_4||e===mi.UNSIGNED_SHORT_5_5_5_1||e===mi.UNSIGNED_SHORT_5_6_5};mi.sizeInBytes=function(e){switch(e){case mi.UNSIGNED_BYTE:return 1;case mi.UNSIGNED_SHORT:case mi.UNSIGNED_SHORT_4_4_4_4:case mi.UNSIGNED_SHORT_5_5_5_1:case mi.UNSIGNED_SHORT_5_6_5:case mi.HALF_FLOAT:return 2;case mi.UNSIGNED_INT:case mi.FLOAT:case mi.UNSIGNED_INT_24_8:return 4}};mi.validate=function(e){return e===mi.UNSIGNED_BYTE||e===mi.UNSIGNED_SHORT||e===mi.UNSIGNED_INT||e===mi.FLOAT||e===mi.HALF_FLOAT||e===mi.UNSIGNED_INT_24_8||e===mi.UNSIGNED_SHORT_4_4_4_4||e===mi.UNSIGNED_SHORT_5_5_5_1||e===mi.UNSIGNED_SHORT_5_6_5};mi.getTypedArrayConstructor=function(e){let t=mi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===mi.FLOAT?Float32Array:Uint32Array};var je=Object.freeze(mi);var st={DEPTH_COMPONENT:ie.DEPTH_COMPONENT,DEPTH_STENCIL:ie.DEPTH_STENCIL,ALPHA:ie.ALPHA,RED:ie.RED,RG:ie.RG,RGB:ie.RGB,RGBA:ie.RGBA,LUMINANCE:ie.LUMINANCE,LUMINANCE_ALPHA:ie.LUMINANCE_ALPHA,RGB_DXT1:ie.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ie.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ie.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ie.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ie.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ie.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ie.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ie.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ie.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ie.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ie.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ie.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ie.COMPRESSED_RGBA_BPTC_UNORM};st.componentsLength=function(e){switch(e){case st.RGB:return 3;case st.RGBA:return 4;case st.LUMINANCE_ALPHA:case st.RG:return 2;case st.ALPHA:case st.RED:case st.LUMINANCE:return 1;default:return 1}};st.validate=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL||e===st.ALPHA||e===st.RED||e===st.RG||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA||e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isColorFormat=function(e){return e===st.RED||e===st.ALPHA||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA};st.isDepthFormat=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL};st.isCompressedFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isDXTFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5};st.isPVRTCFormat=function(e){return e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1};st.isASTCFormat=function(e){return e===st.RGBA_ASTC};st.isETC1Format=function(e){return e===st.RGB_ETC1};st.isETC2Format=function(e){return e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC};st.isBC7Format=function(e){return e===st.RGBA_BC7};st.compressedTextureSizeInBytes=function(e,t,n){switch(e){case st.RGB_DXT1:case st.RGBA_DXT1:case st.RGB_ETC1:case st.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case st.RGBA_DXT3:case st.RGBA_DXT5:case st.RGBA_ASTC:case st.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case st.RGB_PVRTC_4BPPV1:case st.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case st.RGB_PVRTC_2BPPV1:case st.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case st.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};st.textureSizeInBytes=function(e,t,n,i){let o=st.componentsLength(e);return je.isPacked(t)&&(o=1),o*je.sizeInBytes(t)*n*i};st.alignmentInBytes=function(e,t,n){let i=st.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};st.createTypedArray=function(e,t,n,i){let o=je.getTypedArrayConstructor(t),r=st.componentsLength(e)*n*i;return new o(r)};st.flipY=function(e,t,n,i,o){if(o===1)return e;let r=st.createTypedArray(t,n,i,o),s=st.componentsLength(t),a=i*s;for(let c=0;c0&&console.log(`${nf}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${nf}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${nf}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let d,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${nf}Shader program link log: ${c}`),h(o,"vertex"),h(r,"fragment"),d=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${nf}Vertex shader compile log: ${c}`),console.error(`${nf} Vertex shader source: ${n}`),d=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${nf}Fragment shader compile log: ${c}`),console.error(`${nf} Fragment shader source: ${i}`),d=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ae(d);function h(p,g){if(!l(u))return;let f=u.getTranslatedShaderSource(p);if(f===""){console.error(`${nf}${g} shader translation failed.`);return}console.error(`${nf}Translated ${g} shaderSource: -${f}`)}}function YLe(e,t,n){let i={};for(let o=0;o=0){if(u=n[d.slice(0,f)],!l(u))continue;h=u._locations,h.length<=1&&(p=u.value,g=e.getUniformLocation(t,d),g!==null&&(h.push(g),p.push(e.getUniform(t,g))))}else{h=[];for(let x=0;x{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),ra._canTransferArrayBuffer=s}})}return ra._canTransferArrayBuffer}var GO=new be;function ZO(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function EO(e){let t=new oee.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(X0(e))s=e;else if(!n){let a=rn(`${ra._workerModulePrefix}/${i}.js`);X0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=ZO(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${ZO(CESIUM_WORKERS)}"); +${f}`)}}function zLe(e,t,n){let i={};for(let o=0;o=0){if(u=n[d.slice(0,f)],!l(u))continue;h=u._locations,h.length<=1&&(p=u.value,g=e.getUniformLocation(t,d),g!==null&&(h.push(g),p.push(e.getUniform(t,g))))}else{h=[];for(let x=0;x{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),aa._canTransferArrayBuffer=s}})}return aa._canTransferArrayBuffer}var I3=new ge;function E3(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function X3(e){let t=new oee.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(W0(e))s=e;else if(!n){let a=nn(`${aa._workerModulePrefix}/${i}.js`);W0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=E3(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` + importScripts("${E3(CESIUM_WORKERS)}"); CesiumWorkers["${i}"](); - `;return r=ZO(a),new Worker(r,o)}if(r=e,n||(r=rn(`${ra._workerModulePrefix+i}.js`)),!Ot.supportsEsmWebWorkers())throw new ae("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function mRe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ot.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new ae(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=rn(t.fallbackModulePath),n}n.wasmBinaryFile=rn(t.wasmBinaryFile);let i=await Ze.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function ra(e,t){this._workerPath=e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var hRe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new ae(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new pe(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),GO.raiseEvent(s),i(s)}else GO.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},fRe=[];async function pRe(e,t,n){let i=await Promise.resolve(ree());l(n)?i||(n.length=0):n=fRe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",hRe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:rn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function bRe(e,t,n){++e._activeTasks;try{let i=await pRe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}ra.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=EO(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return bRe(this,e,t)};ra.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=EO(this._workerPath),i=await mRe(this,e),o=await Promise.resolve(ree()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,d)=>{n.onmessage=function({data:u}){l(u)?c(u.result):d(new ae("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};ra.prototype.isDestroyed=function(){return!1};ra.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),me(this)};ra.taskCompletedEvent=GO;ra._defaultWorkerModulePrefix="Workers/";ra._workerModulePrefix=ra._defaultWorkerModulePrefix;ra._canTransferArrayBuffer=void 0;var bi=ra;function Vp(){}Vp._transcodeTaskProcessor=new bi("transcodeKTX2",Number.POSITIVE_INFINITY);Vp._readyPromise=void 0;function gRe(){let e=Vp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return Vp._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});Vp._readyPromise=e}Vp.transcode=function(e,t){return l(Vp._readyPromise)||gRe(),Vp._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;rs.x&&m.clone(n,s),wa.y&&m.clone(n,a),Fc.z&&m.clone(n,c)}let h=m.magnitudeSquared(m.subtract(s,i,sa)),p=m.magnitudeSquared(m.subtract(a,o,sa)),g=m.magnitudeSquared(m.subtract(c,r,sa)),f=i,x=s,_=h;p>_&&(_=p,f=o,x=a),g>_&&(_=g,f=r,x=c);let C=NO;C.x=(f.x+x.x)*.5,C.y=(f.y+x.y)*.5,C.z=(f.z+x.z)*.5;let V=m.magnitudeSquared(m.subtract(x,C,sa)),L=Math.sqrt(V),Z=kO;Z.x=i.x,Z.y=o.y,Z.z=r.z;let G=UO;G.x=s.x,G.y=a.y,G.z=c.z;let I=m.midpoint(Z,G,DO),v=0;for(u=0;uv&&(v=P);let w=m.magnitudeSquared(m.subtract(n,C,sa));if(w>V){let F=Math.sqrt(w);L=(L+F)*.5,V=L*L;let b=F-L;C.x=(L*C.x+b*n.x)/F,C.y=(L*C.y+b*n.y)/F,C.z=(L*C.z+b*n.z)/F}}return Lc.x&&m.clone(o,c),bd.y&&m.clone(o,d),Ru.z&&m.clone(o,u)}let g=m.magnitudeSquared(m.subtract(c,r,sa)),f=m.magnitudeSquared(m.subtract(d,s,sa)),x=m.magnitudeSquared(m.subtract(u,a,sa)),_=r,C=c,V=g;f>V&&(V=f,_=s,C=d),x>V&&(V=x,_=a,C=u);let L=NO;L.x=(_.x+C.x)*.5,L.y=(_.y+C.y)*.5,L.z=(_.z+C.z)*.5;let Z=m.magnitudeSquared(m.subtract(C,L,sa)),G=Math.sqrt(Z),I=kO;I.x=r.x,I.y=s.y,I.z=a.z;let v=UO;v.x=c.x,v.y=d.y,v.z=u.z;let P=m.midpoint(I,v,DO),w=0;for(p=0;pw&&(w=F);let b=m.magnitudeSquared(m.subtract(o,L,sa));if(b>Z){let R=Math.sqrt(b);G=(G+R)*.5,Z=G*G;let E=R-G;L.x=(G*L.x+E*o.x)/R,L.y=(G*L.y+E*o.y)/R,L.z=(G*L.z+E*o.z)/R}}return Ga.x&&m.clone(i,a),Fc.y&&m.clone(i,c),bd.z&&m.clone(i,d)}let p=m.magnitudeSquared(m.subtract(a,o,sa)),g=m.magnitudeSquared(m.subtract(c,r,sa)),f=m.magnitudeSquared(m.subtract(d,s,sa)),x=o,_=a,C=p;g>C&&(C=g,x=r,_=c),f>C&&(C=f,x=s,_=d);let V=NO;V.x=(x.x+_.x)*.5,V.y=(x.y+_.y)*.5,V.z=(x.z+_.z)*.5;let L=m.magnitudeSquared(m.subtract(_,V,sa)),Z=Math.sqrt(L),G=kO;G.x=o.x,G.y=r.y,G.z=s.z;let I=UO;I.x=a.x,I.y=c.y,I.z=d.z;let v=m.midpoint(G,I,DO),P=0;for(h=0;hP&&(P=w);let F=m.magnitudeSquared(m.subtract(i,V,sa));if(F>L){let b=Math.sqrt(F);Z=(Z+b)*.5,L=Z*Z;let R=b-Z;V.x=(Z*V.x+R*i.x)/b,V.y=(Z*V.y+R*i.y)/b,V.z=(Z*V.z+R*i.z)/b}}return Z=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let d=(o+c+s)*.5,u=m.multiplyByScalar(a,(-o+d)/c,IRe);return m.add(u,i,u),m.clone(u,n.center),n.radius=d,n};var XRe=new m;pn.expand=function(e,t,n){n=pn.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,XRe));return i>n.radius&&(n.radius=i),n};pn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=m.dot(o,n)+t.distance;return r<-i?zt.OUTSIDE:r>1^-(e&1)}_o.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a>11,u=c>>5&o,h=c&i,p=3*a;t[p]=d*r,t[p+1]=u*s,t[p+2]=h*r}return t};var wn=_o;var a2t=T(S(),1);var xee=new m,_ee=new m,Tee=new m;function DRe(e,t,n,i,o){l(o)||(o=new m);let r,s,a,c,d,u,h,p;if(l(t.z)){if(m.equalsEpsilon(e,t,W.EPSILON14))return m.clone(m.UNIT_X,o);if(m.equalsEpsilon(e,n,W.EPSILON14))return m.clone(m.UNIT_Y,o);if(m.equalsEpsilon(e,i,W.EPSILON14))return m.clone(m.UNIT_Z,o);r=m.subtract(n,t,xee),s=m.subtract(i,t,_ee),a=m.subtract(e,t,Tee),c=m.dot(r,r),d=m.dot(r,s),u=m.dot(r,a),h=m.dot(s,s),p=m.dot(s,a)}else{if(D.equalsEpsilon(e,t,W.EPSILON14))return m.clone(m.UNIT_X,o);if(D.equalsEpsilon(e,n,W.EPSILON14))return m.clone(m.UNIT_Y,o);if(D.equalsEpsilon(e,i,W.EPSILON14))return m.clone(m.UNIT_Z,o);r=D.subtract(n,t,xee),s=D.subtract(i,t,_ee),a=D.subtract(e,t,Tee),c=D.dot(r,r),d=D.dot(r,s),u=D.dot(r,a),h=D.dot(s,s),p=D.dot(s,a)}o.y=h*u-d*p,o.z=c*p-d*u;let g=c*h-d*d;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var dx=DRe;var u2t=T(S(),1);function of(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}of.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var Lp={high:0,low:0};of.fromCartesian=function(e,t){l(t)||(t=new of);let n=t.high,i=t.low;return of.encode(e.x,Lp),n.x=Lp.high,i.x=Lp.low,of.encode(e.y,Lp),n.y=Lp.high,i.y=Lp.low,of.encode(e.z,Lp),n.z=Lp.high,i.z=Lp.low,t};var HO=new of;of.writeElements=function(e,t,n){of.fromCartesian(e,HO);let i=HO.high,o=HO.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var On=of;var N2t=T(S(),1);var f2t=T(S(),1);var zO={};zO.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function See(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))d&&d/c0?[a/e,n/a]:[n/a,a/e]};var vc=zO;var S2t=T(S(),1);var g2t=T(S(),1);var JO={};JO.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function KO(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,d=r*a,u=r*r,h=s*s,p=o*s-u,g=o*a-r*s,f=r*a-h,x=4*p*f-g*g,_,C;if(x<0){let H,J,te;u*d>=c*h?(H=o,J=p,te=-2*r*p+o*g):(H=a,J=f,te=-a*g+2*s*f);let j=-(te<0?-1:1)*Math.abs(H)*Math.sqrt(-x);C=-te+j;let ee=C/2,fe=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),_e=C===j?-fe:-J/fe;return _=J<=0?fe+_e:-te/(fe*fe+_e*_e+J),u*d>=c*h?[(_-r)/o]:[-a/(_+s)]}let V=p,L=-2*r*p+o*g,Z=f,G=-a*g+2*s*f,I=Math.sqrt(x),v=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*I,-L)/3);_=2*Math.sqrt(-V);let w=Math.cos(P);C=_*w;let F=_*(-w/2-v*Math.sin(P)),b=C+F>2*r?C-r:F-r,R=o,E=b/R;P=Math.abs(Math.atan2(a*I,-G)/3),_=2*Math.sqrt(-Z),w=Math.cos(P),C=_*w,F=_*(-w/2-v*Math.sin(P));let X=-a,A=C+F<2*s?C+s:F+s,N=X/A,O=R*A,U=-b*A-R*X,Y=b*X,k=(s*U-r*Y)/(-r*U+s*O);return E<=k?E<=N?k<=N?[E,k,N]:[E,N,k]:[N,E,k]:E<=N?[k,E,N]:k<=N?[k,N,E]:[N,k,E]}JO.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return vc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=vc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return KO(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):KO(e,t,0,i);if(i===0)return o=vc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return KO(e,t,n,i)};var ux=JO;var QO={};QO.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,d=n*n,u=d*n,h=i*i,p=h*i,g=o*o,f=g*o;return a*d*h-4*c*p-4*e*u*h+18*e*t*n*p-27*r*h*h+256*s*f+o*(18*c*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*h+144*r*n*h)+g*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function Gm(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=ux.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let d=-e/4,u=c[c.length-1];if(Math.abs(u)=0&&g>=0){let x=Math.sqrt(p),_=Math.sqrt(g);return[d-_,d-x,d+x,d+_]}else{if(p>=0&&g<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}}return[]}else if(u>0){let h=Math.sqrt(u),p=(r+u-s/h)/2,g=(r+u+s/h)/2,f=vc.computeRealRoots(1,h,p),x=vc.computeRealRoots(1,-h,g);return f.length!==0?(f[0]+=d,f[1]+=d,x.length!==0?(x[0]+=d,x[1]+=d,f[1]<=x[0]?[f[0],f[1],x[0],x[1]]:x[1]<=f[0]?[x[0],x[1],f[0],f[1]]:f[0]>=x[0]&&f[1]<=x[1]?[x[0],f[0],f[1],x[1]]:x[0]>=f[0]&&x[1]<=f[1]?[f[0],x[0],x[1],f[1]]:f[0]>x[0]&&f[0]0){let h=u[0],p=t-h,g=p*p,f=e/2,x=p/2,_=g-4*i,C=g+4*Math.abs(i),V=s-4*h,L=s+4*Math.abs(h),Z,G;if(h<0||_*L=b[0]&&F[1]<=b[1]?[b[0],F[0],F[1],b[1]]:b[0]>=F[0]&&b[1]<=F[1]?[F[0],b[0],b[1],F[1]]:F[0]>b[0]&&F[0]u)||(p=m.cross(h,a,Vee),f=m.dot(s,p),f<0||g+f>u))return;x=m.dot(c,p)/u}else{if(Math.abs(u)1||(p=m.cross(h,a,Vee),f=m.dot(s,p)*_,f<0||g+f>1))return;x=m.dot(c,p)*_}return x};No.rayTriangle=function(e,t,n,i,o,r){let s=No.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new m),m.multiplyByScalar(e.direction,s,r),m.add(e.origin,r,r)};var YRe=new bn;No.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=YRe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=No.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function HRe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,d=(-t-a)*s;return cs))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var JRe=new m,QRe=new m;No.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,JRe),o=m.multiplyComponents(n,e.direction,QRe),r=m.magnitudeSquared(i),s=m.dot(i,o),a,c,d,u,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=m.magnitudeSquared(o),d=c*a,pd){u=s*s-d,h=-s+Math.sqrt(u);let f=h/c,x=a/h;return f0?g.push(new m(i,o*w,o*-R)):R!==0?(g.push(new m(i,o*w,o*-R)),g.push(new m(i,o*w,o*R)),++P):g.push(new m(i,o*w,o*R))}return g};var jO=new m,Lee=new m,Ree=new m,GN=new m,jRe=new m,qRe=new $,$Re=new $,eZe=new $,tZe=new $,nZe=new $,Zee=new $,Gee=new $,Eee=new m,iZe=new m,oZe=new he;No.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let I=t.geodeticSurfaceNormal(n,jO);if(m.dot(i,I)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,jO),s=m.normalize(r,r),a=m.mostOrthogonalAxis(r,GN),c=m.normalize(m.cross(a,s,Lee),Lee),d=m.normalize(m.cross(s,c,Ree),Ree),u=qRe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=c.x,u[4]=c.y,u[5]=c.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let h=$.transpose(u,$Re),p=$.fromScale(t.radii,eZe),g=$.fromScale(t.oneOverRadii,tZe),f=nZe;f[0]=0,f[1]=-i.z,f[2]=i.y,f[3]=i.z,f[4]=0,f[5]=-i.x,f[6]=-i.y,f[7]=i.x,f[8]=0;let x=$.multiply($.multiply(h,g,Zee),f,Zee),_=$.multiply($.multiply(x,p,Gee),u,Gee),C=$.multiplyByVector(x,n,jRe),V=No.quadraticVectorExpression(_,m.negate(C,jO),0,0,1),L,Z,G=V.length;if(G>0){let I=m.clone(m.ZERO,iZe),v=Number.NEGATIVE_INFINITY;for(let w=0;wv&&(v=b,I=m.clone(L,I))}let P=t.cartesianToCartographic(I,oZe);return v=W.clamp(v,0,1),Z=m.magnitude(m.subtract(I,n,GN))*Math.sqrt(1-v*v),Z=o?-Z:Z,P.height=Z,t.cartographicToCartesian(P,new m)}};var rZe=new m;No.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let o=m.subtract(t,e,rZe),r=n.normal,s=m.dot(r,o);if(Math.abs(s)1))return m.multiplyByScalar(o,c,i),m.add(e,i,i),i};No.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=m.dot(o,e)+r<0,a=m.dot(o,t)+r<0,c=m.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=c?1:0;let u,h;if((d===1||d===2)&&(u=new m,h=new m),d===1){if(s)return No.lineSegmentPlane(e,t,i,u),No.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,u,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return No.lineSegmentPlane(t,n,i,u),No.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,u,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return No.lineSegmentPlane(n,e,i,u),No.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,u,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!c)return No.lineSegmentPlane(e,n,i,u),No.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,u,h],indices:[0,1,4,0,4,3,2,3,4]}}else return No.lineSegmentPlane(n,t,i,u),No.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,u,h],indices:[2,0,4,2,4,3,1,3,4]};else return No.lineSegmentPlane(t,e,i,u),No.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,u,h],indices:[1,2,4,1,4,3,0,3,4]}};var jn=No;var Y2t=T(S(),1);function Fs(e,t){this.normal=m.clone(e),this.distance=t}Fs.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new Fs(t,i)};var sZe=new m;Fs.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,sZe),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new Fs(n,i)};Fs.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var aZe=new m;Fs.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=Fs.getPointDistance(e,t),o=m.multiplyByScalar(e.normal,i,aZe);return m.subtract(t,o,n)};var cZe=new M,lZe=new se,dZe=new m;Fs.transform=function(e,t,n){let i=e.normal,o=e.distance,r=M.inverseTranspose(t,cZe),s=se.fromElements(i.x,i.y,i.z,o,lZe);s=M.multiplyByVector(r,s,s);let a=m.fromCartesian4(s,dZe);return s=se.divideByScalar(s,m.magnitude(a),s),Fs.fromCartesian4(s,n)};Fs.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new Fs(e.normal,e.distance)};Fs.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};Fs.ORIGIN_XY_PLANE=Object.freeze(new Fs(m.UNIT_Z,0));Fs.ORIGIN_YZ_PLANE=Object.freeze(new Fs(m.UNIT_X,0));Fs.ORIGIN_ZX_PLANE=Object.freeze(new Fs(m.UNIT_Y,0));var ln=Fs;var J2t=T(S(),1);var qO={};qO.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;an&&(n=c),++a,c=t[a]}let r=[];for(let a=0;ai&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};qO.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(b,R,E,X){for(;R.length>=1;){let A=R[R.length-1];if(R.splice(R.length-1,1),b[A].numLiveTriangles>0)return A}for(;o0)return++o,o-1;++o}return-1}function s(b,R,E,X,A,N,O){let U=-1,Y,k=-1,H=0;for(;Hk||k===-1)&&(k=Y,U=J)),++H}return U===-1?r(X,N,b,O):U}let a=t.length,c=0,d=0,u=t[d],h=a;if(l(n))c=n+1;else{for(;dc&&(c=u),++d,u=t[d];if(c===-1)return 0;++c}let p=[],g;for(g=0;gi&&(L.timeStamp=_,++_),++d}x=s(t,i,C,p,_,V,c)}return I};var lR=qO;var wc={};function wN(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function uZe(e){let t=e.length,n=t/3*6,i=Ae.createTypedArray(t,n),o=0;for(let r=0;r=3){let n=(t-2)*6,i=Ae.createTypedArray(t,n);wN(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r0){let t=e.length-1,n=(t-1)*6,i=Ae.createTypedArray(t,n),o=e[0],r=0;for(let s=1;so&&(o=n[r]);e.indices=lR.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Wee(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Ge({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function fZe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r=W.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Wee(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===we.TRIANGLES?d=3:e.primitiveType===we.LINES?d=2:e.primitiveType===we.POINTS&&(d=1);for(let u=0;u=W.SIXTY_FOUR_KILOBYTES&&(t.push(new lt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Wee(e.attributes))}o.length!==0&&t.push(new lt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Pee=new m,pZe=new he;wc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Zi;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),d=0;for(let u=0;u_&&(_=V)}return new lt({attributes:u,indices:f,primitiveType:d,boundingSphere:l(x)?new le(x,_):void 0})}wc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(nY(t,"geometry")),n.length>0&&(o.push(nY(n,"westHemisphereGeometry")),o.push(nY(n,"eastHemisphereGeometry"))),o};var yu=new m,dR=new m,DS=new m,BS=new m;wc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),d;for(d=0;d0){for(u=0;u3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;oo?i>r?s=W.sign(e.y):s=W.sign(n.y):o>r?s=W.sign(t.y):s=W.sign(n.y);let a=s<0;F0(e,a),F0(t,a),F0(n,a)}var Aee=new m;function xu(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,Aee),e.y/(e.y-t.y),Aee),n),m.clone(n,i),F0(n,!0),F0(i,!1)}var hx=new m,fx=new m,px=new m,bx=new m,iY={positions:new Array(7),indices:new Array(3*3)};function GZe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;ZZe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=iY.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(xu(e,t,hx,px),xu(e,n,fx,bx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(xu(t,n,hx,px),xu(t,e,fx,bx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(xu(n,e,hx,px),xu(n,t,fx,bx),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(xu(n,e,hx,px),xu(n,t,fx,bx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(xu(t,n,hx,px),xu(t,e,fx,bx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(xu(e,t,hx,px),xu(e,n,fx,bx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=iY.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=hx,c[4]=fx,c[5]=px,c[6]=bx,c.length=7),iY}function Mee(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=Q.createTypedArray(r.componentDatatype,r.values)}let i=lt.computeNumberOfVertices(e);return e.indices=Ae.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function YS(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new Ge({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new lt({attributes:n,indices:[],primitiveType:e.primitiveType})}function aY(e,t,n){let i=l(e.geometry.boundingSphere);t=Mee(t,i),n=Mee(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function cY(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,h,p){let g=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),x=e.fromArray(d,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(x,c.z,x);let _=e.add(g,f,g);e.add(_,x,_),p&&e.normalize(_,_),e.pack(_,u,h*t)}}var EZe=cY(se,4),vN=cY(m,3),Oee=cY(D,2),IZe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,d=o[n]*i.z;r[s]=a+c+d>W.EPSILON6?1:0},mR=new m,oY=new m,rY=new m,XZe=new m;function WN(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&g===0)return;let _=m.fromArray(o,e*3,mR),C=m.fromArray(o,t*3,oY),V=m.fromArray(o,n*3,rY),L=dx(i,_,C,V,XZe);if(l(L)){if(l(r)&&vN(e,t,n,L,r,h.normal.values,x,!0),l(d)){let Z=m.fromArray(d,e*3,mR),G=m.fromArray(d,t*3,oY),I=m.fromArray(d,n*3,rY);m.multiplyByScalar(Z,L.x,Z),m.multiplyByScalar(G,L.y,G),m.multiplyByScalar(I,L.z,I);let v;!m.equals(Z,m.ZERO)||!m.equals(G,m.ZERO)||!m.equals(I,m.ZERO)?(v=m.add(Z,G,Z),m.add(v,I,v),m.normalize(v,v)):(v=mR,v.x=0,v.y=0,v.z=0),m.pack(v,h.extrudeDirection.values,x*3)}if(l(u)&&IZe(e,t,n,L,u,h.applyOffset.values,x),l(s)&&vN(e,t,n,L,s,h.tangent.values,x,!0),l(a)&&vN(e,t,n,L,a,h.bitangent.values,x,!0),l(c)&&Oee(e,t,n,L,c,h.st.values,x),g>0)for(let Z=0;Z3){let X=E.positions,A=E.indices,N=A.length;for(let O=0;O0)continue;let c=m.unpack(i,s,zee);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let d=m.unpack(o,s,sY);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+30||le.intersectPlane(n,ln.ORIGIN_ZX_PLANE)!==zt.INTERSECTING))return e;if(t.geometryType!==gu.NONE)switch(t.geometryType){case gu.POLYLINES:UZe(e);break;case gu.TRIANGLES:Nee(e);break;case gu.LINES:kee(e);break}else RZe(t),t.primitiveType===we.TRIANGLES?Nee(e):t.primitiveType===we.LINES&&kee(e);return e};var Fn=wc;var Zvt=T(S(),1);function hR(e,t,n,i,o,r,s,a,c,d,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=d,this._initialized=u}Object.defineProperties(hR.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});hR.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let u=i.arrayBufferView,h=this._size,p=this._pixelFormat,g=this._internalFormat,f=this._pixelDatatype,x=this._preMultiplyAlpha,_=this._flipY,C=4;l(u)&&(C=nt.alignmentInBytes(p,f,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,C),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let V=!1;if(!this._initialized){let L;t===0&&n===0&&r===h&&s===h?(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=nt.flipY(u,p,f,h,h)),L=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),L=i),V=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),L=nt.createTypedArray(p,f,h,h)),a.texImage2D(d,0,g,h,h,0,p,je.toWebGLConstant(f,this._context),L),this._initialized=!0}V||(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=nt.flipY(u,p,f,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,je.toWebGLConstant(f,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),a.texSubImage2D(d,0,t,n,p,je.toWebGLConstant(f,this._context),i))),a.bindTexture(c,null)};hR.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._size),r=y(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};hR.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=y(e,0),t=y(t,0),n=y(n,this._size),i=y(i,this._size),o=y(o,0);let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var fR=hR;var Ivt=T(S(),1);var FN={DONT_CARE:ie.DONT_CARE,FASTEST:ie.FASTEST,NICEST:ie.NICEST,validate:function(e){return e===FN.DONT_CARE||e===FN.FASTEST||e===FN.NICEST}},sf=Object.freeze(FN);var Hvt=T(S(),1);var Pvt=T(S(),1);var AN={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR};AN.validate=function(e){return e===AN.NEAREST||e===AN.LINEAR};var mi=Object.freeze(AN);var Fvt=T(S(),1);var A0={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR,NEAREST_MIPMAP_NEAREST:ie.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ie.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ie.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ie.LINEAR_MIPMAP_LINEAR};A0.validate=function(e){return e===A0.NEAREST||e===A0.LINEAR||e===A0.NEAREST_MIPMAP_NEAREST||e===A0.LINEAR_MIPMAP_NEAREST||e===A0.NEAREST_MIPMAP_LINEAR||e===A0.LINEAR_MIPMAP_LINEAR};var qt=Object.freeze(A0);var Nvt=T(S(),1);var MN={CLAMP_TO_EDGE:ie.CLAMP_TO_EDGE,REPEAT:ie.REPEAT,MIRRORED_REPEAT:ie.MIRRORED_REPEAT,validate:function(e){return e===MN.CLAMP_TO_EDGE||e===MN.REPEAT||e===MN.MIRRORED_REPEAT}},Vn=Object.freeze(MN);function pR(e){e=y(e,y.EMPTY_OBJECT);let{wrapS:t=Vn.CLAMP_TO_EDGE,wrapT:n=Vn.CLAMP_TO_EDGE,minificationFilter:i=qt.LINEAR,magnificationFilter:o=mi.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(pR.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});pR.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};pR.NEAREST=Object.freeze(new pR({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:qt.NEAREST,magnificationFilter:mi.NEAREST}));var $t=pR;var rwt=T(S(),1);function DZe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,Q.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let d=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Jee(e,t,n){for(let i=0;i0&&(c=!0),l(s[r].value)&&(d=!0);let h;t.vertexArrayObject&&(h=t.glCreateVertexArray(),t.glBindVertexArray(h),Jee(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=h,this._attributes=s,this._indexBuffer=o}function Kee(e){return e.values.length/e.componentsPerAttribute}function BZe(e){return Q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function OZe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===Q.DOUBLE&&(e[n].componentDatatype=Q.FLOAT,e[n].values=Q.createTypedArray(Q.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=Kee(e[o[0]]),t=1;t0){let d=Q.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let h=r*a,p=new ArrayBuffer(h),g={};for(t=0;t=W.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=xt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ae.UNSIGNED_INT}):p=xt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ae.UNSIGNED_SHORT})),new Rp({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(Rp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Rp.prototype.getAttribute=function(e){return this._attributes[e]};function YZe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=At.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function HZe(e,t){let n=e._attributes,i=n.length;for(let o=0;o{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new ae(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new pe(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),I3.raiseEvent(s),i(s)}else I3.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},bRe=[];async function gRe(e,t,n){let i=await Promise.resolve(ree());l(n)?i||(n.length=0):n=bRe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",pRe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:nn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function yRe(e,t,n){++e._activeTasks;try{let i=await gRe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}aa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=X3(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return yRe(this,e,t)};aa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=X3(this._workerPath),i=await fRe(this,e),o=await Promise.resolve(ree()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,d)=>{n.onmessage=function({data:u}){l(u)?c(u.result):d(new ae("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};aa.prototype.isDestroyed=function(){return!1};aa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),me(this)};aa.taskCompletedEvent=I3;aa._defaultWorkerModulePrefix="Workers/";aa._workerModulePrefix=aa._defaultWorkerModulePrefix;aa._canTransferArrayBuffer=void 0;var gi=aa;function Lp(){}Lp._transcodeTaskProcessor=new gi("transcodeKTX2",Number.POSITIVE_INFINITY);Lp._readyPromise=void 0;function xRe(){let e=Lp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return Lp._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});Lp._readyPromise=e}Lp.transcode=function(e,t){return l(Lp._readyPromise)||xRe(),Lp._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;rs.x&&m.clone(n,s),wa.y&&m.clone(n,a),Fc.z&&m.clone(n,c)}let h=m.magnitudeSquared(m.subtract(s,i,ca)),p=m.magnitudeSquared(m.subtract(a,o,ca)),g=m.magnitudeSquared(m.subtract(c,r,ca)),f=i,x=s,_=h;p>_&&(_=p,f=o,x=a),g>_&&(_=g,f=r,x=c);let C=U3;C.x=(f.x+x.x)*.5,C.y=(f.y+x.y)*.5,C.z=(f.z+x.z)*.5;let V=m.magnitudeSquared(m.subtract(x,C,ca)),L=Math.sqrt(V),Z=D3;Z.x=i.x,Z.y=o.y,Z.z=r.z;let G=B3;G.x=s.x,G.y=a.y,G.z=c.z;let I=m.midpoint(Z,G,O3),v=0;for(u=0;uv&&(v=P);let w=m.magnitudeSquared(m.subtract(n,C,ca));if(w>V){let F=Math.sqrt(w);L=(L+F)*.5,V=L*L;let b=F-L;C.x=(L*C.x+b*n.x)/F,C.y=(L*C.y+b*n.y)/F,C.z=(L*C.z+b*n.z)/F}}return Lc.x&&m.clone(o,c),bd.y&&m.clone(o,d),Ru.z&&m.clone(o,u)}let g=m.magnitudeSquared(m.subtract(c,r,ca)),f=m.magnitudeSquared(m.subtract(d,s,ca)),x=m.magnitudeSquared(m.subtract(u,a,ca)),_=r,C=c,V=g;f>V&&(V=f,_=s,C=d),x>V&&(V=x,_=a,C=u);let L=U3;L.x=(_.x+C.x)*.5,L.y=(_.y+C.y)*.5,L.z=(_.z+C.z)*.5;let Z=m.magnitudeSquared(m.subtract(C,L,ca)),G=Math.sqrt(Z),I=D3;I.x=r.x,I.y=s.y,I.z=a.z;let v=B3;v.x=c.x,v.y=d.y,v.z=u.z;let P=m.midpoint(I,v,O3),w=0;for(p=0;pw&&(w=F);let b=m.magnitudeSquared(m.subtract(o,L,ca));if(b>Z){let R=Math.sqrt(b);G=(G+R)*.5,Z=G*G;let E=R-G;L.x=(G*L.x+E*o.x)/R,L.y=(G*L.y+E*o.y)/R,L.z=(G*L.z+E*o.z)/R}}return Ga.x&&m.clone(i,a),Fc.y&&m.clone(i,c),bd.z&&m.clone(i,d)}let p=m.magnitudeSquared(m.subtract(a,o,ca)),g=m.magnitudeSquared(m.subtract(c,r,ca)),f=m.magnitudeSquared(m.subtract(d,s,ca)),x=o,_=a,C=p;g>C&&(C=g,x=r,_=c),f>C&&(C=f,x=s,_=d);let V=U3;V.x=(x.x+_.x)*.5,V.y=(x.y+_.y)*.5,V.z=(x.z+_.z)*.5;let L=m.magnitudeSquared(m.subtract(_,V,ca)),Z=Math.sqrt(L),G=D3;G.x=o.x,G.y=r.y,G.z=s.z;let I=B3;I.x=a.x,I.y=c.y,I.z=d.z;let v=m.midpoint(G,I,O3),P=0;for(h=0;hP&&(P=w);let F=m.magnitudeSquared(m.subtract(i,V,ca));if(F>L){let b=Math.sqrt(F);Z=(Z+b)*.5,L=Z*Z;let R=b-Z;V.x=(Z*V.x+R*i.x)/b,V.y=(Z*V.y+R*i.y)/b,V.z=(Z*V.z+R*i.z)/b}}return Z=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let d=(o+c+s)*.5,u=m.multiplyByScalar(a,(-o+d)/c,WRe);return m.add(u,i,u),m.clone(u,n.center),n.radius=d,n};var PRe=new m;fn.expand=function(e,t,n){n=fn.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,PRe));return i>n.radius&&(n.radius=i),n};fn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=m.dot(o,n)+t.distance;return r<-i?Ht.OUTSIDE:r>1^-(e&1)}_o.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a>11,u=c>>5&o,h=c&i,p=3*a;t[p]=d*r,t[p+1]=u*s,t[p+2]=h*r}return t};var wn=_o;var uPt=T(S(),1);var xee=new m,_ee=new m,Tee=new m;function ORe(e,t,n,i,o){l(o)||(o=new m);let r,s,a,c,d,u,h,p;if(l(t.z)){if(m.equalsEpsilon(e,t,W.EPSILON14))return m.clone(m.UNIT_X,o);if(m.equalsEpsilon(e,n,W.EPSILON14))return m.clone(m.UNIT_Y,o);if(m.equalsEpsilon(e,i,W.EPSILON14))return m.clone(m.UNIT_Z,o);r=m.subtract(n,t,xee),s=m.subtract(i,t,_ee),a=m.subtract(e,t,Tee),c=m.dot(r,r),d=m.dot(r,s),u=m.dot(r,a),h=m.dot(s,s),p=m.dot(s,a)}else{if(D.equalsEpsilon(e,t,W.EPSILON14))return m.clone(m.UNIT_X,o);if(D.equalsEpsilon(e,n,W.EPSILON14))return m.clone(m.UNIT_Y,o);if(D.equalsEpsilon(e,i,W.EPSILON14))return m.clone(m.UNIT_Z,o);r=D.subtract(n,t,xee),s=D.subtract(i,t,_ee),a=D.subtract(e,t,Tee),c=D.dot(r,r),d=D.dot(r,s),u=D.dot(r,a),h=D.dot(s,s),p=D.dot(s,a)}o.y=h*u-d*p,o.z=c*p-d*u;let g=c*h-d*d;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var dx=ORe;var pPt=T(S(),1);function of(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}of.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var Rp={high:0,low:0};of.fromCartesian=function(e,t){l(t)||(t=new of);let n=t.high,i=t.low;return of.encode(e.x,Rp),n.x=Rp.high,i.x=Rp.low,of.encode(e.y,Rp),n.y=Rp.high,i.y=Rp.low,of.encode(e.z,Rp),n.z=Rp.high,i.z=Rp.low,t};var K3=new of;of.writeElements=function(e,t,n){of.fromCartesian(e,K3);let i=K3.high,o=K3.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var On=of;var BPt=T(S(),1);var yPt=T(S(),1);var J3={};J3.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function See(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))d&&d/c0?[a/e,n/a]:[n/a,a/e]};var wc=J3;var RPt=T(S(),1);var TPt=T(S(),1);var j3={};j3.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function Q3(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,d=r*a,u=r*r,h=s*s,p=o*s-u,g=o*a-r*s,f=r*a-h,x=4*p*f-g*g,_,C;if(x<0){let H,J,te;u*d>=c*h?(H=o,J=p,te=-2*r*p+o*g):(H=a,J=f,te=-a*g+2*s*f);let j=-(te<0?-1:1)*Math.abs(H)*Math.sqrt(-x);C=-te+j;let ee=C/2,fe=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),Te=C===j?-fe:-J/fe;return _=J<=0?fe+Te:-te/(fe*fe+Te*Te+J),u*d>=c*h?[(_-r)/o]:[-a/(_+s)]}let V=p,L=-2*r*p+o*g,Z=f,G=-a*g+2*s*f,I=Math.sqrt(x),v=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*I,-L)/3);_=2*Math.sqrt(-V);let w=Math.cos(P);C=_*w;let F=_*(-w/2-v*Math.sin(P)),b=C+F>2*r?C-r:F-r,R=o,E=b/R;P=Math.abs(Math.atan2(a*I,-G)/3),_=2*Math.sqrt(-Z),w=Math.cos(P),C=_*w,F=_*(-w/2-v*Math.sin(P));let X=-a,A=C+F<2*s?C+s:F+s,N=X/A,O=R*A,U=-b*A-R*X,Y=b*X,k=(s*U-r*Y)/(-r*U+s*O);return E<=k?E<=N?k<=N?[E,k,N]:[E,N,k]:[N,E,k]:E<=N?[k,E,N]:k<=N?[k,N,E]:[N,k,E]}j3.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return wc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=wc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return Q3(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):Q3(e,t,0,i);if(i===0)return o=wc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return Q3(e,t,n,i)};var ux=j3;var q3={};q3.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,d=n*n,u=d*n,h=i*i,p=h*i,g=o*o,f=g*o;return a*d*h-4*c*p-4*e*u*h+18*e*t*n*p-27*r*h*h+256*s*f+o*(18*c*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*h+144*r*n*h)+g*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function Gm(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=ux.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let d=-e/4,u=c[c.length-1];if(Math.abs(u)=0&&g>=0){let x=Math.sqrt(p),_=Math.sqrt(g);return[d-_,d-x,d+x,d+_]}else{if(p>=0&&g<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}}return[]}else if(u>0){let h=Math.sqrt(u),p=(r+u-s/h)/2,g=(r+u+s/h)/2,f=wc.computeRealRoots(1,h,p),x=wc.computeRealRoots(1,-h,g);return f.length!==0?(f[0]+=d,f[1]+=d,x.length!==0?(x[0]+=d,x[1]+=d,f[1]<=x[0]?[f[0],f[1],x[0],x[1]]:x[1]<=f[0]?[x[0],x[1],f[0],f[1]]:f[0]>=x[0]&&f[1]<=x[1]?[x[0],f[0],f[1],x[1]]:x[0]>=f[0]&&x[1]<=f[1]?[f[0],x[0],x[1],f[1]]:f[0]>x[0]&&f[0]0){let h=u[0],p=t-h,g=p*p,f=e/2,x=p/2,_=g-4*i,C=g+4*Math.abs(i),V=s-4*h,L=s+4*Math.abs(h),Z,G;if(h<0||_*L=b[0]&&F[1]<=b[1]?[b[0],F[0],F[1],b[1]]:b[0]>=F[0]&&b[1]<=F[1]?[F[0],b[0],b[1],F[1]]:F[0]>b[0]&&F[0]u)||(p=m.cross(h,a,Vee),f=m.dot(s,p),f<0||g+f>u))return;x=m.dot(c,p)/u}else{if(Math.abs(u)1||(p=m.cross(h,a,Vee),f=m.dot(s,p)*_,f<0||g+f>1))return;x=m.dot(c,p)*_}return x};Uo.rayTriangle=function(e,t,n,i,o,r){let s=Uo.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new m),m.multiplyByScalar(e.direction,s,r),m.add(e.origin,r,r)};var zRe=new pn;Uo.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=zRe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let c=Uo.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>m.distance(e,t)))return l(s)||(s=new m),m.multiplyByScalar(a.direction,c,s),m.add(a.origin,s,s)};function KRe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,d=(-t-a)*s;return cs))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var jRe=new m,qRe=new m;Uo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,jRe),o=m.multiplyComponents(n,e.direction,qRe),r=m.magnitudeSquared(i),s=m.dot(i,o),a,c,d,u,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=m.magnitudeSquared(o),d=c*a,pd){u=s*s-d,h=-s+Math.sqrt(u);let f=h/c,x=a/h;return f0?g.push(new m(i,o*w,o*-R)):R!==0?(g.push(new m(i,o*w,o*-R)),g.push(new m(i,o*w,o*R)),++P):g.push(new m(i,o*w,o*R))}return g};var $3=new m,Lee=new m,Ree=new m,IN=new m,$Re=new m,eZe=new $,tZe=new $,nZe=new $,iZe=new $,oZe=new $,Zee=new $,Gee=new $,Eee=new m,rZe=new m,sZe=new he;Uo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let I=t.geodeticSurfaceNormal(n,$3);if(m.dot(i,I)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,$3),s=m.normalize(r,r),a=m.mostOrthogonalAxis(r,IN),c=m.normalize(m.cross(a,s,Lee),Lee),d=m.normalize(m.cross(s,c,Ree),Ree),u=eZe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=c.x,u[4]=c.y,u[5]=c.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let h=$.transpose(u,tZe),p=$.fromScale(t.radii,nZe),g=$.fromScale(t.oneOverRadii,iZe),f=oZe;f[0]=0,f[1]=-i.z,f[2]=i.y,f[3]=i.z,f[4]=0,f[5]=-i.x,f[6]=-i.y,f[7]=i.x,f[8]=0;let x=$.multiply($.multiply(h,g,Zee),f,Zee),_=$.multiply($.multiply(x,p,Gee),u,Gee),C=$.multiplyByVector(x,n,$Re),V=Uo.quadraticVectorExpression(_,m.negate(C,$3),0,0,1),L,Z,G=V.length;if(G>0){let I=m.clone(m.ZERO,rZe),v=Number.NEGATIVE_INFINITY;for(let w=0;wv&&(v=b,I=m.clone(L,I))}let P=t.cartesianToCartographic(I,sZe);return v=W.clamp(v,0,1),Z=m.magnitude(m.subtract(I,n,IN))*Math.sqrt(1-v*v),Z=o?-Z:Z,P.height=Z,t.cartographicToCartesian(P,new m)}};var aZe=new m;Uo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new m);let o=m.subtract(t,e,aZe),r=n.normal,s=m.dot(r,o);if(Math.abs(s)1))return m.multiplyByScalar(o,c,i),m.add(e,i,i),i};Uo.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=m.dot(o,e)+r<0,a=m.dot(o,t)+r<0,c=m.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=c?1:0;let u,h;if((d===1||d===2)&&(u=new m,h=new m),d===1){if(s)return Uo.lineSegmentPlane(e,t,i,u),Uo.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,u,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Uo.lineSegmentPlane(t,n,i,u),Uo.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,u,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Uo.lineSegmentPlane(n,e,i,u),Uo.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,u,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!c)return Uo.lineSegmentPlane(e,n,i,u),Uo.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,u,h],indices:[0,1,4,0,4,3,2,3,4]}}else return Uo.lineSegmentPlane(n,t,i,u),Uo.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,u,h],indices:[2,0,4,2,4,3,1,3,4]};else return Uo.lineSegmentPlane(t,e,i,u),Uo.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,u,h],indices:[1,2,4,1,4,3,0,3,4]}};var qn=Uo;var JPt=T(S(),1);function Fs(e,t){this.normal=m.clone(e),this.distance=t}Fs.fromPointNormal=function(e,t,n){let i=-m.dot(t,e);return l(n)?(m.clone(t,n.normal),n.distance=i,n):new Fs(t,i)};var cZe=new m;Fs.fromCartesian4=function(e,t){let n=m.fromCartesian4(e,cZe),i=e.w;return l(t)?(m.clone(n,t.normal),t.distance=i,t):new Fs(n,i)};Fs.getPointDistance=function(e,t){return m.dot(e.normal,t)+e.distance};var lZe=new m;Fs.projectPointOntoPlane=function(e,t,n){l(n)||(n=new m);let i=Fs.getPointDistance(e,t),o=m.multiplyByScalar(e.normal,i,lZe);return m.subtract(t,o,n)};var dZe=new M,uZe=new se,mZe=new m;Fs.transform=function(e,t,n){let i=e.normal,o=e.distance,r=M.inverseTranspose(t,dZe),s=se.fromElements(i.x,i.y,i.z,o,uZe);s=M.multiplyByVector(r,s,s);let a=m.fromCartesian4(s,mZe);return s=se.divideByScalar(s,m.magnitude(a),s),Fs.fromCartesian4(s,n)};Fs.clone=function(e,t){return l(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new Fs(e.normal,e.distance)};Fs.equals=function(e,t){return e.distance===t.distance&&m.equals(e.normal,t.normal)};Fs.ORIGIN_XY_PLANE=Object.freeze(new Fs(m.UNIT_Z,0));Fs.ORIGIN_YZ_PLANE=Object.freeze(new Fs(m.UNIT_X,0));Fs.ORIGIN_ZX_PLANE=Object.freeze(new Fs(m.UNIT_Y,0));var an=Fs;var $Pt=T(S(),1);var eY={};eY.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;an&&(n=c),++a,c=t[a]}let r=[];for(let a=0;ai&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};eY.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(b,R,E,X){for(;R.length>=1;){let A=R[R.length-1];if(R.splice(R.length-1,1),b[A].numLiveTriangles>0)return A}for(;o0)return++o,o-1;++o}return-1}function s(b,R,E,X,A,N,O){let U=-1,Y,k=-1,H=0;for(;Hk||k===-1)&&(k=Y,U=J)),++H}return U===-1?r(X,N,b,O):U}let a=t.length,c=0,d=0,u=t[d],h=a;if(l(n))c=n+1;else{for(;dc&&(c=u),++d,u=t[d];if(c===-1)return 0;++c}let p=[],g;for(g=0;gi&&(L.timeStamp=_,++_),++d}x=s(t,i,C,p,_,V,c)}return I};var mR=eY;var Fc={};function AN(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function hZe(e){let t=e.length,n=t/3*6,i=Ae.createTypedArray(t,n),o=0;for(let r=0;r=3){let n=(t-2)*6,i=Ae.createTypedArray(t,n);AN(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r0){let t=e.length-1,n=(t-1)*6,i=Ae.createTypedArray(t,n),o=e[0],r=0;for(let s=1;so&&(o=n[r]);e.indices=mR.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Wee(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Ge({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function bZe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r=W.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Wee(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===we.TRIANGLES?d=3:e.primitiveType===we.LINES?d=2:e.primitiveType===we.POINTS&&(d=1);for(let u=0;u=W.SIXTY_FOUR_KILOBYTES&&(t.push(new ct({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Wee(e.attributes))}o.length!==0&&t.push(new ct({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Pee=new m,gZe=new he;Fc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Ei;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),d=0;for(let u=0;u_&&(_=V)}return new ct({attributes:u,indices:f,primitiveType:d,boundingSphere:l(x)?new le(x,_):void 0})}Fc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(oY(t,"geometry")),n.length>0&&(o.push(oY(n,"westHemisphereGeometry")),o.push(oY(n,"eastHemisphereGeometry"))),o};var yu=new m,hR=new m,OS=new m,YS=new m;Fc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),d;for(d=0;d0){for(u=0;u3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;oo?i>r?s=W.sign(e.y):s=W.sign(n.y):o>r?s=W.sign(t.y):s=W.sign(n.y);let a=s<0;A0(e,a),A0(t,a),A0(n,a)}var Aee=new m;function xu(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,Aee),e.y/(e.y-t.y),Aee),n),m.clone(n,i),A0(n,!0),A0(i,!1)}var hx=new m,fx=new m,px=new m,bx=new m,rY={positions:new Array(7),indices:new Array(3*3)};function IZe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;EZe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=rY.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(xu(e,t,hx,px),xu(e,n,fx,bx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(xu(t,n,hx,px),xu(t,e,fx,bx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(xu(n,e,hx,px),xu(n,t,fx,bx),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(xu(n,e,hx,px),xu(n,t,fx,bx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(xu(t,n,hx,px),xu(t,e,fx,bx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(xu(e,t,hx,px),xu(e,n,fx,bx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=rY.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=hx,c[4]=fx,c[5]=px,c[6]=bx,c.length=7),rY}function Mee(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=Q.createTypedArray(r.componentDatatype,r.values)}let i=ct.computeNumberOfVertices(e);return e.indices=Ae.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function zS(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new Ge({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ct({attributes:n,indices:[],primitiveType:e.primitiveType})}function lY(e,t,n){let i=l(e.geometry.boundingSphere);t=Mee(t,i),n=Mee(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function dY(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,h,p){let g=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),x=e.fromArray(d,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(x,c.z,x);let _=e.add(g,f,g);e.add(_,x,_),p&&e.normalize(_,_),e.pack(_,u,h*t)}}var XZe=dY(se,4),FN=dY(m,3),Oee=dY(D,2),WZe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,d=o[n]*i.z;r[s]=a+c+d>W.EPSILON6?1:0},pR=new m,sY=new m,aY=new m,PZe=new m;function vN(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&g===0)return;let _=m.fromArray(o,e*3,pR),C=m.fromArray(o,t*3,sY),V=m.fromArray(o,n*3,aY),L=dx(i,_,C,V,PZe);if(l(L)){if(l(r)&&FN(e,t,n,L,r,h.normal.values,x,!0),l(d)){let Z=m.fromArray(d,e*3,pR),G=m.fromArray(d,t*3,sY),I=m.fromArray(d,n*3,aY);m.multiplyByScalar(Z,L.x,Z),m.multiplyByScalar(G,L.y,G),m.multiplyByScalar(I,L.z,I);let v;!m.equals(Z,m.ZERO)||!m.equals(G,m.ZERO)||!m.equals(I,m.ZERO)?(v=m.add(Z,G,Z),m.add(v,I,v),m.normalize(v,v)):(v=pR,v.x=0,v.y=0,v.z=0),m.pack(v,h.extrudeDirection.values,x*3)}if(l(u)&&WZe(e,t,n,L,u,h.applyOffset.values,x),l(s)&&FN(e,t,n,L,s,h.tangent.values,x,!0),l(a)&&FN(e,t,n,L,a,h.bitangent.values,x,!0),l(c)&&Oee(e,t,n,L,c,h.st.values,x),g>0)for(let Z=0;Z3){let X=E.positions,A=E.indices,N=A.length;for(let O=0;O0)continue;let c=m.unpack(i,s,zee);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let d=m.unpack(o,s,cY);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+30||le.intersectPlane(n,an.ORIGIN_ZX_PLANE)!==Ht.INTERSECTING))return e;if(t.geometryType!==gu.NONE)switch(t.geometryType){case gu.POLYLINES:BZe(e);break;case gu.TRIANGLES:Nee(e);break;case gu.LINES:kee(e);break}else GZe(t),t.primitiveType===we.TRIANGLES?Nee(e):t.primitiveType===we.LINES&&kee(e);return e};var Fn=Fc;var Xvt=T(S(),1);function bR(e,t,n,i,o,r,s,a,c,d,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=d,this._initialized=u}Object.defineProperties(bR.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});bR.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let u=i.arrayBufferView,h=this._size,p=this._pixelFormat,g=this._internalFormat,f=this._pixelDatatype,x=this._preMultiplyAlpha,_=this._flipY,C=4;l(u)&&(C=nt.alignmentInBytes(p,f,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,C),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let V=!1;if(!this._initialized){let L;t===0&&n===0&&r===h&&s===h?(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=nt.flipY(u,p,f,h,h)),L=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),L=i),V=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),L=nt.createTypedArray(p,f,h,h)),a.texImage2D(d,0,g,h,h,0,p,je.toWebGLConstant(f,this._context),L),this._initialized=!0}V||(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=nt.flipY(u,p,f,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,je.toWebGLConstant(f,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),a.texSubImage2D(d,0,t,n,p,je.toWebGLConstant(f,this._context),i))),a.bindTexture(c,null)};bR.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._size),r=y(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};bR.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=y(e,0),t=y(t,0),n=y(n,this._size),i=y(i,this._size),o=y(o,0);let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var gR=bR;var vvt=T(S(),1);var MN={DONT_CARE:ie.DONT_CARE,FASTEST:ie.FASTEST,NICEST:ie.NICEST,validate:function(e){return e===MN.DONT_CARE||e===MN.FASTEST||e===MN.NICEST}},sf=Object.freeze(MN);var Qvt=T(S(),1);var Avt=T(S(),1);var NN={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR};NN.validate=function(e){return e===NN.NEAREST||e===NN.LINEAR};var hi=Object.freeze(NN);var kvt=T(S(),1);var M0={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR,NEAREST_MIPMAP_NEAREST:ie.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ie.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ie.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ie.LINEAR_MIPMAP_LINEAR};M0.validate=function(e){return e===M0.NEAREST||e===M0.LINEAR||e===M0.NEAREST_MIPMAP_NEAREST||e===M0.LINEAR_MIPMAP_NEAREST||e===M0.NEAREST_MIPMAP_LINEAR||e===M0.LINEAR_MIPMAP_LINEAR};var jt=Object.freeze(M0);var Bvt=T(S(),1);var kN={CLAMP_TO_EDGE:ie.CLAMP_TO_EDGE,REPEAT:ie.REPEAT,MIRRORED_REPEAT:ie.MIRRORED_REPEAT,validate:function(e){return e===kN.CLAMP_TO_EDGE||e===kN.REPEAT||e===kN.MIRRORED_REPEAT}},Vn=Object.freeze(kN);function yR(e){e=y(e,y.EMPTY_OBJECT);let{wrapS:t=Vn.CLAMP_TO_EDGE,wrapT:n=Vn.CLAMP_TO_EDGE,minificationFilter:i=jt.LINEAR,magnificationFilter:o=hi.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(yR.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});yR.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};yR.NEAREST=Object.freeze(new yR({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST}));var qt=yR;var lwt=T(S(),1);function OZe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,Q.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let d=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Jee(e,t,n){for(let i=0;i0&&(c=!0),l(s[r].value)&&(d=!0);let h;t.vertexArrayObject&&(h=t.glCreateVertexArray(),t.glBindVertexArray(h),Jee(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=h,this._attributes=s,this._indexBuffer=o}function Kee(e){return e.values.length/e.componentsPerAttribute}function YZe(e){return Q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function HZe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===Q.DOUBLE&&(e[n].componentDatatype=Q.FLOAT,e[n].values=Q.createTypedArray(Q.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=Kee(e[o[0]]),t=1;t0){let d=Q.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let h=r*a,p=new ArrayBuffer(h),g={};for(t=0;t=W.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=yt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ae.UNSIGNED_INT}):p=yt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ae.UNSIGNED_SHORT})),new Zp({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(Zp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Zp.prototype.getAttribute=function(e){return this._attributes[e]};function zZe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Ft.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function KZe(e,t){let n=e._attributes,i=n.length;for(let o=0;o1/pi. * * @alias czm_oneOverPi @@ -196,7 +196,7 @@ const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto i * float pi = 1.0 / czm_oneOverPi; */ const float czm_oneOverPi = 0.3183098861837907; -`;var Qwt=T(S(),1),ZR=`/** +`;var eFt=T(S(),1),IR=`/** * A built-in GLSL floating-point constant for 1/2pi. * * @alias czm_oneOverTwoPi @@ -212,7 +212,7 @@ const float czm_oneOverPi = 0.3183098861837907; * float pi = 2.0 * czm_oneOverTwoPi; */ const float czm_oneOverTwoPi = 0.15915494309189535; -`;var qwt=T(S(),1),GR=`/** +`;var nFt=T(S(),1),XR=`/** * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} * * @name czm_passCesium3DTile @@ -221,7 +221,7 @@ const float czm_oneOverTwoPi = 0.15915494309189535; * @see czm_pass */ const float czm_passCesium3DTile = 4.0; -`;var eFt=T(S(),1),ER=`/** +`;var oFt=T(S(),1),WR=`/** * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION} * * @name czm_passCesium3DTileClassification @@ -230,7 +230,7 @@ const float czm_passCesium3DTile = 4.0; * @see czm_pass */ const float czm_passCesium3DTileClassification = 5.0; -`;var nFt=T(S(),1),IR=`/** +`;var sFt=T(S(),1),PR=`/** * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW} * * @name czm_passCesium3DTileClassificationIgnoreShow @@ -239,7 +239,7 @@ const float czm_passCesium3DTileClassification = 5.0; * @see czm_pass */ const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; -`;var oFt=T(S(),1),XR=`/** +`;var cFt=T(S(),1),vR=`/** * The automatic GLSL constant for {@link Pass#CLASSIFICATION} * * @name czm_passClassification @@ -248,7 +248,7 @@ const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; * @see czm_pass */ const float czm_passClassification = 7.0; -`;var sFt=T(S(),1),WR=`/** +`;var dFt=T(S(),1),wR=`/** * The automatic GLSL constant for {@link Pass#COMPUTE} * * @name czm_passCompute @@ -257,7 +257,7 @@ const float czm_passClassification = 7.0; * @see czm_pass */ const float czm_passCompute = 1.0; -`;var cFt=T(S(),1),PR=`/** +`;var mFt=T(S(),1),FR=`/** * The automatic GLSL constant for {@link Pass#ENVIRONMENT} * * @name czm_passEnvironment @@ -266,7 +266,7 @@ const float czm_passCompute = 1.0; * @see czm_pass */ const float czm_passEnvironment = 0.0; -`;var dFt=T(S(),1),vR=`/** +`;var fFt=T(S(),1),AR=`/** * The automatic GLSL constant for {@link Pass#GLOBE} * * @name czm_passGlobe @@ -275,7 +275,7 @@ const float czm_passEnvironment = 0.0; * @see czm_pass */ const float czm_passGlobe = 2.0; -`;var mFt=T(S(),1),wR=`/** +`;var bFt=T(S(),1),MR=`/** * The automatic GLSL constant for {@link Pass#OPAQUE} * * @name czm_passOpaque @@ -284,7 +284,7 @@ const float czm_passGlobe = 2.0; * @see czm_pass */ const float czm_passOpaque = 7.0; -`;var fFt=T(S(),1),FR=`/** +`;var yFt=T(S(),1),NR=`/** * The automatic GLSL constant for {@link Pass#OVERLAY} * * @name czm_passOverlay @@ -293,7 +293,7 @@ const float czm_passOpaque = 7.0; * @see czm_pass */ const float czm_passOverlay = 10.0; -`;var bFt=T(S(),1),AR=`/** +`;var _Ft=T(S(),1),kR=`/** * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} * * @name czm_passTerrainClassification @@ -302,7 +302,7 @@ const float czm_passOverlay = 10.0; * @see czm_pass */ const float czm_passTerrainClassification = 3.0; -`;var yFt=T(S(),1),MR=`/** +`;var SFt=T(S(),1),UR=`/** * The automatic GLSL constant for {@link Pass#TRANSLUCENT} * * @name czm_passTranslucent @@ -311,7 +311,7 @@ const float czm_passTerrainClassification = 3.0; * @see czm_pass */ const float czm_passTranslucent = 8.0; -`;var _Ft=T(S(),1),NR=`/** +`;var VFt=T(S(),1),DR=`/** * The automatic GLSL constant for {@link Pass#VOXELS} * * @name czm_passVoxels @@ -320,7 +320,7 @@ const float czm_passTranslucent = 8.0; * @see czm_pass */ const float czm_passVoxels = 9.0; -`;var SFt=T(S(),1),kR=`/** +`;var RFt=T(S(),1),BR=`/** * A built-in GLSL floating-point constant for Math.PI. * * @alias czm_pi @@ -336,7 +336,7 @@ const float czm_passVoxels = 9.0; * float twoPi = 2.0 * czm_pi; */ const float czm_pi = 3.141592653589793; -`;var VFt=T(S(),1),UR=`/** +`;var GFt=T(S(),1),OR=`/** * A built-in GLSL floating-point constant for pi/4. * * @alias czm_piOverFour @@ -352,7 +352,7 @@ const float czm_pi = 3.141592653589793; * float pi = 4.0 * czm_piOverFour; */ const float czm_piOverFour = 0.7853981633974483; -`;var RFt=T(S(),1),DR=`/** +`;var IFt=T(S(),1),YR=`/** * A built-in GLSL floating-point constant for pi/6. * * @alias czm_piOverSix @@ -368,7 +368,7 @@ const float czm_piOverFour = 0.7853981633974483; * float pi = 6.0 * czm_piOverSix; */ const float czm_piOverSix = 0.5235987755982988; -`;var GFt=T(S(),1),BR=`/** +`;var WFt=T(S(),1),HR=`/** * A built-in GLSL floating-point constant for pi/3. * * @alias czm_piOverThree @@ -384,7 +384,7 @@ const float czm_piOverSix = 0.5235987755982988; * float pi = 3.0 * czm_piOverThree; */ const float czm_piOverThree = 1.0471975511965976; -`;var IFt=T(S(),1),OR=`/** +`;var vFt=T(S(),1),zR=`/** * A built-in GLSL floating-point constant for pi/2. * * @alias czm_piOverTwo @@ -400,7 +400,7 @@ const float czm_piOverThree = 1.0471975511965976; * float pi = 2.0 * czm_piOverTwo; */ const float czm_piOverTwo = 1.5707963267948966; -`;var WFt=T(S(),1),YR=`/** +`;var FFt=T(S(),1),KR=`/** * A built-in GLSL floating-point constant for converting degrees to radians. * * @alias czm_radiansPerDegree @@ -416,7 +416,7 @@ const float czm_piOverTwo = 1.5707963267948966; * float rad = czm_radiansPerDegree * deg; */ const float czm_radiansPerDegree = 0.017453292519943295; -`;var vFt=T(S(),1),HR=`/** +`;var MFt=T(S(),1),JR=`/** * The constant identifier for the 2D {@link SceneMode} * * @name czm_sceneMode2D @@ -427,7 +427,7 @@ const float czm_radiansPerDegree = 0.017453292519943295; * @see czm_sceneModeMorphing */ const float czm_sceneMode2D = 2.0; -`;var FFt=T(S(),1),zR=`/** +`;var kFt=T(S(),1),QR=`/** * The constant identifier for the 3D {@link SceneMode} * * @name czm_sceneMode3D @@ -438,7 +438,7 @@ const float czm_sceneMode2D = 2.0; * @see czm_sceneModeMorphing */ const float czm_sceneMode3D = 3.0; -`;var MFt=T(S(),1),KR=`/** +`;var DFt=T(S(),1),jR=`/** * The constant identifier for the Columbus View {@link SceneMode} * * @name czm_sceneModeColumbusView @@ -449,7 +449,7 @@ const float czm_sceneMode3D = 3.0; * @see czm_sceneModeMorphing */ const float czm_sceneModeColumbusView = 1.0; -`;var kFt=T(S(),1),JR=`/** +`;var OFt=T(S(),1),qR=`/** * The constant identifier for the Morphing {@link SceneMode} * * @name czm_sceneModeMorphing @@ -460,7 +460,7 @@ const float czm_sceneModeColumbusView = 1.0; * @see czm_sceneMode3D */ const float czm_sceneModeMorphing = 0.0; -`;var DFt=T(S(),1),QR=`/** +`;var HFt=T(S(),1),$R=`/** * A built-in GLSL floating-point constant for one solar radius. * * @alias czm_solarRadius @@ -473,7 +473,7 @@ const float czm_sceneModeMorphing = 0.0; * const float czm_solarRadius = ...; */ const float czm_solarRadius = 695500000.0; -`;var OFt=T(S(),1),jR=`/** +`;var KFt=T(S(),1),eZ=`/** * A built-in GLSL floating-point constant for 3pi/2. * * @alias czm_threePiOver2 @@ -489,7 +489,7 @@ const float czm_solarRadius = 695500000.0; * float pi = (2.0 / 3.0) * czm_threePiOver2; */ const float czm_threePiOver2 = 4.71238898038469; -`;var HFt=T(S(),1),qR=`/** +`;var QFt=T(S(),1),tZ=`/** * A built-in GLSL floating-point constant for 2pi. * * @alias czm_twoPi @@ -505,7 +505,7 @@ const float czm_threePiOver2 = 4.71238898038469; * float pi = czm_twoPi / 2.0; */ const float czm_twoPi = 6.283185307179586; -`;var KFt=T(S(),1),$R=`/** +`;var qFt=T(S(),1),nZ=`/** * The maximum latitude, in radians, both North and South, supported by a Web Mercator * (EPSG:3857) projection. Technically, the Mercator projection is defined * for any latitude up to (but not including) 90 degrees, but it makes sense @@ -521,7 +521,7 @@ const float czm_twoPi = 6.283185307179586; * @glslConstant */ const float czm_webMercatorMaxLatitude = 1.4844222297453324; -`;var QFt=T(S(),1),eZ=`/** +`;var eAt=T(S(),1),iZ=`/** * @name czm_depthRangeStruct * @glslStruct */ @@ -530,7 +530,7 @@ struct czm_depthRangeStruct float near; float far; }; -`;var qFt=T(S(),1),tZ=`/** +`;var nAt=T(S(),1),oZ=`/** * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions. * * @name czm_material @@ -552,7 +552,7 @@ struct czm_material vec3 emission; float alpha; }; -`;var eAt=T(S(),1),nZ=`/** +`;var oAt=T(S(),1),rZ=`/** * Used as input to every material's czm_getMaterial function. * * @name czm_materialInput @@ -582,7 +582,7 @@ struct czm_materialInput float aspect; float waterMask; }; -`;var nAt=T(S(),1),iZ=`/** +`;var sAt=T(S(),1),sZ=`/** * Struct for representing a material for a {@link Model}. The model * rendering pipeline will pass this struct between material, custom shaders, * and lighting stages. This is not to be confused with {@link czm_material} @@ -627,7 +627,7 @@ struct czm_modelMaterial { // Add clearcoatF0 when KHR_materials_ior is implemented #endif }; -`;var oAt=T(S(),1),oZ=`/** +`;var cAt=T(S(),1),aZ=`/** * Struct for representing the output of a custom vertex shader. * * @name czm_modelVertexOutput @@ -643,7 +643,7 @@ struct czm_modelVertexOutput { vec3 positionMC; float pointSize; }; -`;var sAt=T(S(),1),rZ=`/** +`;var dAt=T(S(),1),cZ=`/** * DOC_TBA * * @name czm_ray @@ -654,7 +654,7 @@ struct czm_ray vec3 origin; vec3 direction; }; -`;var cAt=T(S(),1),sZ=`/** +`;var mAt=T(S(),1),lZ=`/** * DOC_TBA * * @name czm_raySegment @@ -681,7 +681,7 @@ const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_in * @glslConstant */ const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); -`;var dAt=T(S(),1),aZ=`struct czm_shadowParameters +`;var fAt=T(S(),1),dZ=`struct czm_shadowParameters { #ifdef USE_CUBE_MAP_SHADOW vec3 texCoords; @@ -696,7 +696,7 @@ const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); float normalShadingSmooth; float darkness; }; -`;var mAt=T(S(),1),cZ=`/** +`;var bAt=T(S(),1),uZ=`/** * Converts an HSB color (hue, saturation, brightness) to RGB * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} * @@ -720,7 +720,7 @@ vec3 czm_HSBToRGB(vec3 hsb) vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www); return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y); } -`;var fAt=T(S(),1),lZ=`/** +`;var yAt=T(S(),1),mZ=`/** * Converts an HSL color (hue, saturation, lightness) to RGB * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} * @@ -751,7 +751,7 @@ vec3 czm_HSLToRGB(vec3 hsl) float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; return (rgb - 0.5) * c + hsl.z; } -`;var bAt=T(S(),1),dZ=`/** +`;var _At=T(S(),1),hZ=`/** * Converts an RGB color to HSB (hue, saturation, brightness) * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} * @@ -778,7 +778,7 @@ vec3 czm_RGBToHSB(vec3 rgb) float d = q.x - min(q.w, q.y); return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x); } -`;var yAt=T(S(),1),uZ=`/** +`;var SAt=T(S(),1),fZ=`/** * Converts an RGB color to HSL (hue, saturation, lightness) * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} * @@ -812,7 +812,7 @@ vec3 czm_RGBToHSL(vec3 rgb) float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7); return vec3(hcv.x, s, l); } -`;var _At=T(S(),1),mZ=`/** +`;var VAt=T(S(),1),pZ=`/** * Converts an RGB color to CIE Yxy. *

The conversion is described in * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} @@ -842,7 +842,7 @@ vec3 czm_RGBToXYZ(vec3 rgb) Yxy.gb = xyz.rg / temp; return Yxy; } -`;var SAt=T(S(),1),hZ=`/** +`;var RAt=T(S(),1),bZ=`/** * Converts a CIE Yxy color to RGB. *

The conversion is described in * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} @@ -872,7 +872,7 @@ vec3 czm_XYZToRGB(vec3 Yxy) return XYZ2RGB * xyz; } -`;var VAt=T(S(),1),fZ=`// See: +`;var GAt=T(S(),1),gZ=`// See: // https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ vec3 czm_acesTonemapping(vec3 color) { @@ -888,7 +888,7 @@ vec3 czm_acesTonemapping(vec3 color) { return color; } -`;var RAt=T(S(),1),pZ=`/** +`;var IAt=T(S(),1),yZ=`/** * @private */ float czm_alphaWeight(float a) @@ -899,7 +899,7 @@ float czm_alphaWeight(float a) // http://jcgt.org/published/0002/02/09/ return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0)))); } -`;var GAt=T(S(),1),bZ=`/** +`;var WAt=T(S(),1),xZ=`/** * Procedural anti-aliasing by blurring two colors that meet at a sharp edge. * * @name czm_antialias @@ -938,7 +938,7 @@ vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) { return czm_antialias(color1, color2, currentColor, dist, 0.1); } -`;var IAt=T(S(),1),gZ=`/** +`;var vAt=T(S(),1),_Z=`/** * Apply a HSB color shift to an RGB color. * * @param {vec3} rgb The color in RGB space. @@ -970,7 +970,7 @@ vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) { // Convert shifted hsb back to rgb return czm_HSBToRGB(hsb); } -`;var WAt=T(S(),1),yZ=`/** +`;var FAt=T(S(),1),TZ=`/** * Approximately computes spherical coordinates given a normal. * Uses approximate inverse trigonometry for speed and consistency, * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU. @@ -988,7 +988,7 @@ vec2 czm_approximateSphericalCoordinates(vec3 normal) { float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y); return vec2(latitudeApproximation, longitudeApproximation); } -`;var vAt=T(S(),1),xZ=`/** +`;var MAt=T(S(),1),SZ=`/** * Compute a rational approximation to tanh(x) * * @param {float} x A real number input @@ -998,7 +998,7 @@ float czm_approximateTanh(float x) { float x2 = x * x; return max(-1.0, min(1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2))); } -`;var FAt=T(S(),1),_Z=`/** +`;var kAt=T(S(),1),CZ=`/** * Determines if the fragment is back facing * * @name czm_backFacing @@ -1011,7 +1011,7 @@ bool czm_backFacing() // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494. return gl_FrontFacing == false; } -`;var MAt=T(S(),1),TZ=`/** +`;var DAt=T(S(),1),VZ=`/** * Branchless ternary operator to be used when it's inexpensive to explicitly * evaluate both possibilities for a float expression. * @@ -1082,7 +1082,7 @@ vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } -`;var kAt=T(S(),1),SZ=` +`;var OAt=T(S(),1),LZ=` vec4 czm_cascadeColor(vec4 weights) { return vec4(1.0, 0.0, 0.0, 1.0) * weights.x + @@ -1090,14 +1090,14 @@ vec4 czm_cascadeColor(vec4 weights) vec4(0.0, 0.0, 1.0, 1.0) * weights.z + vec4(1.0, 0.0, 1.0, 1.0) * weights.w; } -`;var DAt=T(S(),1),CZ=` +`;var HAt=T(S(),1),RZ=` uniform vec4 shadowMap_cascadeDistances; float czm_cascadeDistance(vec4 weights) { return dot(shadowMap_cascadeDistances, weights); } -`;var OAt=T(S(),1),VZ=` +`;var KAt=T(S(),1),ZZ=` uniform mat4 shadowMap_cascadeMatrices[4]; mat4 czm_cascadeMatrix(vec4 weights) @@ -1107,7 +1107,7 @@ mat4 czm_cascadeMatrix(vec4 weights) shadowMap_cascadeMatrices[2] * weights.z + shadowMap_cascadeMatrices[3] * weights.w; } -`;var HAt=T(S(),1),LZ=` +`;var QAt=T(S(),1),GZ=` uniform vec4 shadowMap_cascadeSplits[2]; vec4 czm_cascadeWeights(float depthEye) @@ -1117,7 +1117,7 @@ vec4 czm_cascadeWeights(float depthEye) vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); return near * far; } -`;var KAt=T(S(),1),RZ=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) { +`;var qAt=T(S(),1),EZ=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) { float signedDistance = texture(clippingDistance, uv).r; return (signedDistance - 0.5) * 2.0; } @@ -1154,7 +1154,7 @@ void czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 } #endif } -`;var QAt=T(S(),1),ZZ=`/** +`;var eMt=T(S(),1),IZ=`/** * DOC_TBA * * @name czm_columbusViewMorph @@ -1166,7 +1166,7 @@ vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) vec3 p = mix(position2D.xyz, position3D.xyz, time); return vec4(p, 1.0); } -`;var qAt=T(S(),1),GZ=`/** +`;var nMt=T(S(),1),XZ=`/** * Compute the atmosphere color, applying Rayleigh and Mie scattering. This * builtin uses automatic uniforms so the atmophere settings are synced with the * state of the Scene, even in other contexts like Model. @@ -1254,7 +1254,7 @@ vec4 czm_computeAtmosphereColor( return vec4(color, opacity); } -`;var e9t=T(S(),1),EZ=`/** +`;var oMt=T(S(),1),WZ=`/** * Compute atmosphere scattering for the ground atmosphere and fog. This method * uses automatic uniforms so it is always synced with the scene settings. * @@ -1284,7 +1284,7 @@ void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, opacity ); } -`;var n9t=T(S(),1),IZ=`/** +`;var sMt=T(S(),1),PZ=`/** * Returns a position in model coordinates relative to eye taking into * account the current scene mode: 3D, 2D, or Columbus view. *

@@ -1306,7 +1306,7 @@ void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, * @see czm_translateRelativeToEye */ vec4 czm_computePosition(); -`;var o9t=T(S(),1),XZ=`/** +`;var cMt=T(S(),1),vZ=`/** * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as * the transmittance value for the ray. This function uses automatic uniforms * so the atmosphere settings are always synced with the current scene. @@ -1455,7 +1455,7 @@ void czm_computeScattering( // Compute the transmittance i.e. how much light is passing through the atmosphere. opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); } -`;var s9t=T(S(),1),WZ=`/** +`;var dMt=T(S(),1),wZ=`/** * @private */ vec2 cordic(float angle) @@ -1666,7 +1666,7 @@ vec2 czm_cosineAndSine(float angle) return cordic(angle); } } -`;var c9t=T(S(),1),PZ=`/** +`;var mMt=T(S(),1),FZ=`/** * Decompresses texture coordinates that were packed into a single float. * * @name czm_decompressTextureCoordinates @@ -1683,7 +1683,7 @@ vec2 czm_cosineAndSine(float angle) float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; return vec2(stx, sty); } -`;var d9t=T(S(),1),vZ=`// emulated noperspective +`;var fMt=T(S(),1),AZ=`// emulated noperspective #if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) out float v_WindowZ; #endif @@ -1730,7 +1730,7 @@ vec4 czm_depthClamp(vec4 coords) #endif return coords; } -`;var m9t=T(S(),1),wZ=`/** +`;var bMt=T(S(),1),MZ=`/** * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping. @@ -1763,7 +1763,7 @@ mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) bitangentEC.x, bitangentEC.y, bitangentEC.z, normalEC.x, normalEC.y, normalEC.z); } -`;var f9t=T(S(),1),FZ=`/** +`;var yMt=T(S(),1),NZ=`/** * DOC_TBA * * @name czm_ellipsoidContainsPoint @@ -1775,7 +1775,7 @@ bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; return (dot(scaled, scaled) <= 1.0); } -`;var b9t=T(S(),1),AZ=`/** +`;var _Mt=T(S(),1),kZ=`/** * Approximate uv coordinates based on the ellipsoid normal. * * @name czm_ellipsoidTextureCoordinates @@ -1785,7 +1785,7 @@ vec2 czm_ellipsoidTextureCoordinates(vec3 normal) { return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); } -`;var y9t=T(S(),1),MZ=`/** +`;var SMt=T(S(),1),UZ=`/** * Compares left and right componentwise. Returns true * if they are within epsilon and false otherwise. The inputs * left and right can be floats, vec2s, @@ -1821,7 +1821,7 @@ bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { bool czm_equalsEpsilon(float left, float right, float epsilon) { return (abs(left - right) <= epsilon); } -`;var _9t=T(S(),1),NZ=`/** +`;var VMt=T(S(),1),DZ=`/** * DOC_TBA * * @name czm_eyeOffset @@ -1841,7 +1841,7 @@ vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) p.z += zEyeOffset.z; return p; } -`;var S9t=T(S(),1),kZ=`/** +`;var RMt=T(S(),1),BZ=`/** * Transforms a position from eye to window coordinates. The transformation * from eye to clip coordinates is done using {@link czm_projection}. * The transform from normalized device coordinates to window coordinates is @@ -1873,7 +1873,7 @@ vec4 czm_eyeToWindowCoordinates(vec4 positionEC) q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates return q; } -`;var V9t=T(S(),1),UZ=`/** +`;var GMt=T(S(),1),OZ=`/** * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input. * * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on @@ -1928,7 +1928,7 @@ float czm_fastApproximateAtan(float x, float y) { t = czm_branchFreeTernary(y < 0.0, -t, t); return t; } -`;var R9t=T(S(),1),DZ=`/** +`;var IMt=T(S(),1),YZ=`/** * Gets the color with fog at a distance from the camera. * * @name czm_fog @@ -1966,7 +1966,7 @@ vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifie float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); return mix(color, fogColor, fog); } -`;var G9t=T(S(),1),BZ=`/** +`;var WMt=T(S(),1),HZ=`/** * Converts a color from RGB space to linear space. * * @name czm_gammaCorrect @@ -1988,7 +1988,7 @@ vec4 czm_gammaCorrect(vec4 color) { #endif return color; } -`;var I9t=T(S(),1),OZ=`/** +`;var vMt=T(S(),1),zZ=`/** * DOC_TBA * * @name czm_geodeticSurfaceNormal @@ -2004,7 +2004,7 @@ vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, v { return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); } -`;var W9t=T(S(),1),YZ=`/** +`;var FMt=T(S(),1),KZ=`/** * An czm_material with default values. Every material's czm_getMaterial * should use this default material as a base for the material it returns. * The default normal value is given by materialInput.normalEC. @@ -2031,7 +2031,7 @@ czm_material czm_getDefaultMaterial(czm_materialInput materialInput) material.alpha = 1.0; return material; } -`;var v9t=T(S(),1),HZ=`/** +`;var MMt=T(S(),1),JZ=`/** * Select which direction vector to use for dynamic atmosphere lighting based on an enum value * * @name czm_getDynamicAtmosphereLightDirection @@ -2053,7 +2053,7 @@ vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) { czm_sunDirectionWC * float(lightEnum == SUNLIGHT); return normalize(lightDirection); } -`;var F9t=T(S(),1),zZ=`/** +`;var kMt=T(S(),1),QZ=`/** * Calculates the intensity of diffusely reflected light. * * @name czm_getLambertDiffuse @@ -2075,7 +2075,7 @@ float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) { return max(dot(lightDirectionEC, normalEC), 0.0); } -`;var M9t=T(S(),1),KZ=`/** +`;var DMt=T(S(),1),jZ=`/** * Calculates the specular intensity of reflected light. * * @name czm_getSpecular @@ -2104,7 +2104,7 @@ float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float // Prevent this by making sure shininess is at least czm_epsilon2. return pow(specular, max(shininess, czm_epsilon2)); } -`;var k9t=T(S(),1),JZ=`/** +`;var OMt=T(S(),1),qZ=`/** * @private */ vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) @@ -2141,7 +2141,7 @@ vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRa // average and scale to between -1 and 1 return ((noise / 4.0) - 0.5) * 2.0; } -`;var D9t=T(S(),1),QZ=`/** +`;var HMt=T(S(),1),$Z=`/** * Adjusts the hue of a color. * * @name czm_hue @@ -2171,7 +2171,7 @@ vec3 czm_hue(vec3 rgb, float adjustment) vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); return toRGB * color; } -`;var O9t=T(S(),1),jZ=`/** +`;var KMt=T(S(),1),eG=`/** * Converts a color in linear space to RGB space. * * @name czm_inverseGamma @@ -2183,7 +2183,7 @@ vec3 czm_hue(vec3 rgb, float adjustment) vec3 czm_inverseGamma(vec3 color) { return pow(color, vec3(1.0 / czm_gamma)); } -`;var H9t=T(S(),1),qZ=`/** +`;var QMt=T(S(),1),tG=`/** * Determines if a time interval is empty. * * @name czm_isEmpty @@ -2202,7 +2202,7 @@ bool czm_isEmpty(czm_raySegment interval) { return (interval.stop < 0.0); } -`;var K9t=T(S(),1),$Z=`/** +`;var qMt=T(S(),1),nG=`/** * Determines if a time interval is empty. * * @name czm_isFull @@ -2221,7 +2221,7 @@ bool czm_isFull(czm_raySegment interval) { return (interval.start == 0.0 && interval.stop == czm_infinity); } -`;var Q9t=T(S(),1),eG=`/** +`;var e9t=T(S(),1),iG=`/** * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located. * * @name czm_latitudeToWebMercatorFraction @@ -2242,7 +2242,7 @@ float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, fl return (mercatorY - southMercatorY) * oneOverMercatorHeight; } -`;var q9t=T(S(),1),tG=`/** +`;var n9t=T(S(),1),oG=`/** * Computes distance from an point in 2D to a line in 2D. * * @name czm_lineDistance @@ -2256,7 +2256,7 @@ float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, fl float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1); } -`;var eMt=T(S(),1),nG=`/** +`;var o9t=T(S(),1),rG=`/** * Converts a linear RGB color to an sRGB color. * * @param {vec3|vec4} linearIn The color in linear color space. @@ -2272,7 +2272,7 @@ vec4 czm_linearToSrgb(vec4 linearIn) vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); return vec4(srgbOut, linearIn.a); } -`;var nMt=T(S(),1),iG=`/** +`;var s9t=T(S(),1),sG=`/** * Computes the luminance of a color. * * @name czm_luminance @@ -2292,7 +2292,7 @@ float czm_luminance(vec3 rgb) const vec3 W = vec3(0.2125, 0.7154, 0.0721); return dot(rgb, W); } -`;var oMt=T(S(),1),oG=`/** +`;var c9t=T(S(),1),aG=`/** * Find the maximum component of a vector. * * @name czm_maximumComponent @@ -2313,7 +2313,7 @@ float czm_maximumComponent(vec4 v) { return max(max(max(v.x, v.y), v.z), v.w); } -`;var sMt=T(S(),1),rG=`/** +`;var d9t=T(S(),1),cG=`/** * Computes the size of a pixel in meters at a distance from the eye. *

* Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel. @@ -2374,7 +2374,7 @@ float czm_metersPerPixel(vec4 positionEC) { return czm_metersPerPixel(positionEC, czm_pixelRatio); } -`;var cMt=T(S(),1),sG=`/** +`;var m9t=T(S(),1),lG=`/** * Transforms a position from model to window coordinates. The transformation * from model to clip coordinates is done using {@link czm_modelViewProjection}. * The transform from normalized device coordinates to window coordinates is @@ -2411,7 +2411,7 @@ vec4 czm_modelToWindowCoordinates(vec4 position) q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates return q; } -`;var dMt=T(S(),1),aG=`/** +`;var f9t=T(S(),1),dG=`/** * DOC_TBA * * @name czm_multiplyWithColorBalance @@ -2429,7 +2429,7 @@ vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; } -`;var mMt=T(S(),1),cG=`/** +`;var b9t=T(S(),1),uG=`/** * Computes a value that scales with distance. The scaling is clamped at the near and * far distances, and does not extrapolate. This function works with the * {@link NearFarScalar} JavaScript class. @@ -2455,7 +2455,7 @@ float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) return mix(valueAtMin, valueAtMax, t); } -`;var fMt=T(S(),1),lG=` /** +`;var y9t=T(S(),1),mG=` /** * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ @@ -2538,7 +2538,7 @@ float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) vector3 = czm_octDecode(vec2(x, y)); } -`;var bMt=T(S(),1),dG=`/** +`;var _9t=T(S(),1),hG=`/** * Packs a depth value into a vec4 that can be represented by unsigned bytes. * * @name czm_packDepth @@ -2556,7 +2556,7 @@ vec4 czm_packDepth(float depth) enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); return enc; } -`;var yMt=T(S(),1),uG=`vec3 lambertianDiffuse(vec3 diffuseColor) +`;var S9t=T(S(),1),fG=`vec3 lambertianDiffuse(vec3 diffuseColor) { return diffuseColor / czm_pi; } @@ -2720,7 +2720,7 @@ vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, // Lo = (diffuse + specular) * Li * NdotL return (diffuseContribution + specularContribution) * NdotL; } -`;var _Mt=T(S(),1),mG=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral +`;var V9t=T(S(),1),pG=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral // Input color is non-negative and resides in the Linear Rec. 709 color space. // Output color is also Linear Rec. 709, but in the [0, 1] range. @@ -2743,7 +2743,7 @@ vec3 czm_pbrNeutralTonemapping(vec3 color) { float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0); return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g); } -`;var SMt=T(S(),1),hG=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) +`;var R9t=T(S(),1),bG=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) { return czm_getLambertDiffuse(lightDirectionEC, material.normal); } @@ -2806,7 +2806,7 @@ vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) return vec4(color, material.alpha); } -`;var VMt=T(S(),1),fG=`/** +`;var G9t=T(S(),1),gG=`/** * Computes distance from a point to a plane. * * @name czm_planeDistance @@ -2834,7 +2834,7 @@ float czm_planeDistance(vec4 plane, vec3 point) { float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { return (dot(planeNormal, point) + planeDistance); } -`;var RMt=T(S(),1),pG=`/** +`;var I9t=T(S(),1),yG=`/** * Computes the point along a ray at the given time. time can be positive, negative, or zero. * * @name czm_pointAlongRay @@ -2853,7 +2853,7 @@ vec3 czm_pointAlongRay(czm_ray ray, float time) { return ray.origin + (time * ray.direction); } -`;var GMt=T(S(),1),bG=`/** +`;var W9t=T(S(),1),xG=`/** * DOC_TBA * * @name czm_rayEllipsoidIntersectionInterval @@ -2936,7 +2936,7 @@ czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_ } } } -`;var IMt=T(S(),1),gG=`/** +`;var v9t=T(S(),1),_G=`/** * Compute the intersection interval of a ray with a sphere. * * @name czm_raySphereIntersectionInterval @@ -2972,11 +2972,11 @@ czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float czm_raySegment result = czm_raySegment(t0, t1); return result; } -`;var WMt=T(S(),1),yG=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) +`;var F9t=T(S(),1),TG=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) { return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } -`;var vMt=T(S(),1),xG=`/** +`;var M9t=T(S(),1),SG=`/** * Reads a value previously transformed with {@link czm_writeNonPerspective} * by dividing it by \`w\`, the value used in the perspective divide. * This function is intended to be called in a fragment shader to access a @@ -3007,7 +3007,7 @@ vec3 czm_readNonPerspective(vec3 value, float oneOverW) { vec4 czm_readNonPerspective(vec4 value, float oneOverW) { return value * oneOverW; } -`;var FMt=T(S(),1),_G=`float czm_reverseLogDepth(float logZ) +`;var k9t=T(S(),1),CG=`float czm_reverseLogDepth(float logZ) { #ifdef LOG_DEPTH float near = czm_currentFrustum.x; @@ -3018,7 +3018,7 @@ vec4 czm_readNonPerspective(vec4 value, float oneOverW) { #endif return logZ; } -`;var MMt=T(S(),1),TG=`/** +`;var D9t=T(S(),1),VG=`/** * Round a floating point value. This function exists because round() doesn't * exist in GLSL 1.00. * @@ -3040,7 +3040,7 @@ vec3 czm_round(vec3 value) { vec4 czm_round(vec4 value) { return floor(value + 0.5); } -`;var kMt=T(S(),1),SG=`/** +`;var O9t=T(S(),1),LG=`/** * Adjusts the saturation of a color. * * @name czm_saturation @@ -3062,7 +3062,7 @@ vec3 czm_saturation(vec3 rgb, float adjustment) vec3 intensity = vec3(dot(rgb, W)); return mix(intensity, rgb, adjustment); } -`;var DMt=T(S(),1),CG=` +`;var H9t=T(S(),1),RG=` float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) { return czm_unpackDepth(czm_textureCube(shadowMap, d)); @@ -3086,7 +3086,7 @@ float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) { return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -`;var OMt=T(S(),1),VG=` +`;var K9t=T(S(),1),ZG=` float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) { #ifdef USE_NORMAL_SHADING @@ -3152,7 +3152,7 @@ float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParam return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } #endif -`;var HMt=T(S(),1),LG=`/** +`;var Q9t=T(S(),1),GG=`/** * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL * built-in function sign except that returns 1.0 instead of 0.0 when the input value is 0.0. * @@ -3181,7 +3181,7 @@ vec4 czm_signNotZero(vec4 value) { return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); } -`;var KMt=T(S(),1),RG=`/** +`;var q9t=T(S(),1),EG=`/** * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector. *

* The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]. @@ -3225,7 +3225,7 @@ vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) return max(L, vec3(0.0)); } -`;var QMt=T(S(),1),ZG=`/** +`;var eNt=T(S(),1),IG=`/** * Converts an sRGB color to a linear RGB color. * * @param {vec3|vec4} srgbIn The color in sRGB space @@ -3241,7 +3241,7 @@ vec4 czm_srgbToLinear(vec4 srgbIn) vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); return vec4(linearOut, srgbIn.a); } -`;var qMt=T(S(),1),GG=`/** +`;var nNt=T(S(),1),XG=`/** * Creates a matrix that transforms vectors from tangent space to eye space. * * @name czm_tangentToEyeSpaceMatrix @@ -3266,7 +3266,7 @@ mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC bitangent.x, bitangent.y, bitangent.z, normal.x , normal.y , normal.z); } -`;var eNt=T(S(),1),EG=`/** +`;var oNt=T(S(),1),WG=`/** * A wrapper around the texture (WebGL2) / textureCube (WebGL1) * function to allow for WebGL 1 support. * @@ -3301,7 +3301,7 @@ vec4 czm_textureCube(samplerCube sampler, vec3 p, float lod) { #elif defined(GL_EXT_shader_texture_lod) return textureCubeLodEXT(sampler, p, lod); #endif -}`;var nNt=T(S(),1),IG=`/** +}`;var sNt=T(S(),1),PG=`/** * Transforms a plane. * * @name czm_transformPlane @@ -3316,7 +3316,7 @@ vec4 czm_transformPlane(vec4 plane, mat4 transform) { float normalMagnitude = length(transformedPlane.xyz); return transformedPlane / normalMagnitude; } -`;var oNt=T(S(),1),XG=`/** +`;var cNt=T(S(),1),vG=`/** * Translates a position (or any vec3) that was encoded with {@link EncodedCartesian3}, * and then provided to the shader as separate high and low bits to * be relative to the eye. As shown in the example, the position can then be transformed in eye @@ -3361,7 +3361,7 @@ vec4 czm_translateRelativeToEye(vec3 high, vec3 low) return vec4(highDifference + lowDifference, 1.0); } -`;var sNt=T(S(),1),WG=`/** +`;var dNt=T(S(),1),wG=`/** * @private */ vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) @@ -3388,7 +3388,7 @@ vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirection return vec4(color, material.alpha); } -`;var cNt=T(S(),1),PG=`/** +`;var mNt=T(S(),1),FG=`/** * Returns the transpose of the matrix. The input matrix can be * a mat2, mat3, or mat4. * @@ -3433,7 +3433,7 @@ mat4 czm_transpose(mat4 matrix) matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); } -`;var dNt=T(S(),1),vG=`vec2 getLookupUv(vec2 dimensions, int i) { +`;var fNt=T(S(),1),AG=`vec2 getLookupUv(vec2 dimensions, int i) { int pixY = i / int(dimensions.x); int pixX = i - (pixY * int(dimensions.x)); float pixelWidth = 1.0 / dimensions.x; @@ -3446,7 +3446,7 @@ mat4 czm_transpose(mat4 matrix) vec4 czm_unpackClippingExtents(highp sampler2D extentsTexture, int index) { vec2 textureDimensions = vec2(textureSize(extentsTexture, 0)); return texture(extentsTexture, getLookupUv(textureDimensions, index)); -}`;var mNt=T(S(),1),wG=`/** +}`;var bNt=T(S(),1),MG=`/** * Unpacks a vec4 depth value to a float in [0, 1) range. * * @name czm_unpackDepth @@ -3462,7 +3462,7 @@ float czm_unpackDepth(vec4 packedDepth) // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } -`;var fNt=T(S(),1),FG=`/** +`;var yNt=T(S(),1),NG=`/** * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4. * * @name czm_unpackFloat @@ -3486,7 +3486,7 @@ float czm_unpackFloat(vec4 packedFloat) float result = sign * exp2(exponent - 23.0) * mantissa; return result; } -`;var bNt=T(S(),1),AG=`/** +`;var _Nt=T(S(),1),kG=`/** * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type, * so the return value is an int. *

@@ -3517,7 +3517,7 @@ float czm_unpackFloat(vec4 packedFloat) vec4 rounded = czm_round(packedValue * 255.0); return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); } -`;var yNt=T(S(),1),MG=`/** +`;var SNt=T(S(),1),UG=`/** * Transform metadata values following the EXT_structural_metadata spec * by multiplying by scale and adding the offset. Operations are always * performed component-wise, even for matrices. @@ -3555,7 +3555,7 @@ mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { return matrixCompMult(scale, value) + offset; } -`;var _Nt=T(S(),1),NG=`#ifdef LOG_DEPTH +`;var VNt=T(S(),1),DG=`#ifdef LOG_DEPTH // 1.0 at the near plane, increasing linearly from there. out float v_depthFromNearPlusOne; #ifdef SHADOW_MAP @@ -3619,7 +3619,7 @@ void czm_vertexLogDepth(vec4 clipCoords) czm_updatePositionDepth(clipCoords); #endif } -`;var SNt=T(S(),1),kG=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +`;var RNt=T(S(),1),BG=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) { // Reconstruct NDC coordinates float x = 2.0 * screenCoordinate.x - 1.0; @@ -3730,7 +3730,7 @@ vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); } -`;var VNt=T(S(),1),UG=`// emulated noperspective +`;var GNt=T(S(),1),OG=`// emulated noperspective #if !defined(LOG_DEPTH) in float v_WindowZ; #endif @@ -3754,7 +3754,7 @@ void czm_writeDepthClamp() gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); #endif } -`;var RNt=T(S(),1),DG=`#ifdef LOG_DEPTH +`;var INt=T(S(),1),YG=`#ifdef LOG_DEPTH in float v_depthFromNearPlusOne; #ifdef POLYGON_OFFSET @@ -3833,7 +3833,7 @@ void czm_writeLogDepth() { czm_writeLogDepth(v_depthFromNearPlusOne); #endif } -`;var GNt=T(S(),1),BG=`/** +`;var WNt=T(S(),1),HG=`/** * Transforms a value for non-perspective interpolation by multiplying * it by w, the value used in the perspective divide. This function is * intended to be called in a vertex shader to compute the value of a @@ -3865,7 +3865,7 @@ vec3 czm_writeNonPerspective(vec3 value, float w) { vec4 czm_writeNonPerspective(vec4 value, float w) { return value * w; } -`;var gx={czm_degreesPerRadian:bR,czm_depthRange:gR,czm_epsilon1:yR,czm_epsilon2:xR,czm_epsilon3:_R,czm_epsilon4:TR,czm_epsilon5:SR,czm_epsilon6:CR,czm_epsilon7:VR,czm_infinity:LR,czm_oneOverPi:RR,czm_oneOverTwoPi:ZR,czm_passCesium3DTile:GR,czm_passCesium3DTileClassification:ER,czm_passCesium3DTileClassificationIgnoreShow:IR,czm_passClassification:XR,czm_passCompute:WR,czm_passEnvironment:PR,czm_passGlobe:vR,czm_passOpaque:wR,czm_passOverlay:FR,czm_passTerrainClassification:AR,czm_passTranslucent:MR,czm_passVoxels:NR,czm_pi:kR,czm_piOverFour:UR,czm_piOverSix:DR,czm_piOverThree:BR,czm_piOverTwo:OR,czm_radiansPerDegree:YR,czm_sceneMode2D:HR,czm_sceneMode3D:zR,czm_sceneModeColumbusView:KR,czm_sceneModeMorphing:JR,czm_solarRadius:QR,czm_threePiOver2:jR,czm_twoPi:qR,czm_webMercatorMaxLatitude:$R,czm_depthRangeStruct:eZ,czm_material:tZ,czm_materialInput:nZ,czm_modelMaterial:iZ,czm_modelVertexOutput:oZ,czm_ray:rZ,czm_raySegment:sZ,czm_shadowParameters:aZ,czm_HSBToRGB:cZ,czm_HSLToRGB:lZ,czm_RGBToHSB:dZ,czm_RGBToHSL:uZ,czm_RGBToXYZ:mZ,czm_XYZToRGB:hZ,czm_acesTonemapping:fZ,czm_alphaWeight:pZ,czm_antialias:bZ,czm_applyHSBShift:gZ,czm_approximateSphericalCoordinates:yZ,czm_approximateTanh:xZ,czm_backFacing:_Z,czm_branchFreeTernary:TZ,czm_cascadeColor:SZ,czm_cascadeDistance:CZ,czm_cascadeMatrix:VZ,czm_cascadeWeights:LZ,czm_clipPolygons:RZ,czm_columbusViewMorph:ZZ,czm_computeAtmosphereColor:GZ,czm_computeGroundAtmosphereScattering:EZ,czm_computePosition:IZ,czm_computeScattering:XZ,czm_cosineAndSine:WZ,czm_decompressTextureCoordinates:PZ,czm_depthClamp:vZ,czm_eastNorthUpToEyeCoordinates:wZ,czm_ellipsoidContainsPoint:FZ,czm_ellipsoidTextureCoordinates:AZ,czm_equalsEpsilon:MZ,czm_eyeOffset:NZ,czm_eyeToWindowCoordinates:kZ,czm_fastApproximateAtan:UZ,czm_fog:DZ,czm_gammaCorrect:BZ,czm_geodeticSurfaceNormal:OZ,czm_getDefaultMaterial:YZ,czm_getDynamicAtmosphereLightDirection:HZ,czm_getLambertDiffuse:zZ,czm_getSpecular:KZ,czm_getWaterNoise:JZ,czm_hue:QZ,czm_inverseGamma:jZ,czm_isEmpty:qZ,czm_isFull:$Z,czm_latitudeToWebMercatorFraction:eG,czm_lineDistance:tG,czm_linearToSrgb:nG,czm_luminance:iG,czm_maximumComponent:oG,czm_metersPerPixel:rG,czm_modelToWindowCoordinates:sG,czm_multiplyWithColorBalance:aG,czm_nearFarScalar:cG,czm_octDecode:lG,czm_packDepth:dG,czm_pbrLighting:uG,czm_pbrNeutralTonemapping:mG,czm_phong:hG,czm_planeDistance:fG,czm_pointAlongRay:pG,czm_rayEllipsoidIntersectionInterval:bG,czm_raySphereIntersectionInterval:gG,czm_readDepth:yG,czm_readNonPerspective:xG,czm_reverseLogDepth:_G,czm_round:TG,czm_saturation:SG,czm_shadowDepthCompare:CG,czm_shadowVisibility:VG,czm_signNotZero:LG,czm_sphericalHarmonics:RG,czm_srgbToLinear:ZG,czm_tangentToEyeSpaceMatrix:GG,czm_textureCube:EG,czm_transformPlane:IG,czm_translateRelativeToEye:XG,czm_translucentPhong:WG,czm_transpose:PG,czm_unpackClippingExtents:vG,czm_unpackDepth:wG,czm_unpackFloat:FG,czm_unpackUint:AG,czm_valueTransform:MG,czm_vertexLogDepth:NG,czm_windowToEyeCoordinates:kG,czm_writeDepthClamp:UG,czm_writeLogDepth:DG,czm_writeNonPerspective:BG};var sUt=T(S(),1);function JZe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` +`;var gx={czm_degreesPerRadian:xR,czm_depthRange:_R,czm_epsilon1:TR,czm_epsilon2:SR,czm_epsilon3:CR,czm_epsilon4:VR,czm_epsilon5:LR,czm_epsilon6:RR,czm_epsilon7:ZR,czm_infinity:GR,czm_oneOverPi:ER,czm_oneOverTwoPi:IR,czm_passCesium3DTile:XR,czm_passCesium3DTileClassification:WR,czm_passCesium3DTileClassificationIgnoreShow:PR,czm_passClassification:vR,czm_passCompute:wR,czm_passEnvironment:FR,czm_passGlobe:AR,czm_passOpaque:MR,czm_passOverlay:NR,czm_passTerrainClassification:kR,czm_passTranslucent:UR,czm_passVoxels:DR,czm_pi:BR,czm_piOverFour:OR,czm_piOverSix:YR,czm_piOverThree:HR,czm_piOverTwo:zR,czm_radiansPerDegree:KR,czm_sceneMode2D:JR,czm_sceneMode3D:QR,czm_sceneModeColumbusView:jR,czm_sceneModeMorphing:qR,czm_solarRadius:$R,czm_threePiOver2:eZ,czm_twoPi:tZ,czm_webMercatorMaxLatitude:nZ,czm_depthRangeStruct:iZ,czm_material:oZ,czm_materialInput:rZ,czm_modelMaterial:sZ,czm_modelVertexOutput:aZ,czm_ray:cZ,czm_raySegment:lZ,czm_shadowParameters:dZ,czm_HSBToRGB:uZ,czm_HSLToRGB:mZ,czm_RGBToHSB:hZ,czm_RGBToHSL:fZ,czm_RGBToXYZ:pZ,czm_XYZToRGB:bZ,czm_acesTonemapping:gZ,czm_alphaWeight:yZ,czm_antialias:xZ,czm_applyHSBShift:_Z,czm_approximateSphericalCoordinates:TZ,czm_approximateTanh:SZ,czm_backFacing:CZ,czm_branchFreeTernary:VZ,czm_cascadeColor:LZ,czm_cascadeDistance:RZ,czm_cascadeMatrix:ZZ,czm_cascadeWeights:GZ,czm_clipPolygons:EZ,czm_columbusViewMorph:IZ,czm_computeAtmosphereColor:XZ,czm_computeGroundAtmosphereScattering:WZ,czm_computePosition:PZ,czm_computeScattering:vZ,czm_cosineAndSine:wZ,czm_decompressTextureCoordinates:FZ,czm_depthClamp:AZ,czm_eastNorthUpToEyeCoordinates:MZ,czm_ellipsoidContainsPoint:NZ,czm_ellipsoidTextureCoordinates:kZ,czm_equalsEpsilon:UZ,czm_eyeOffset:DZ,czm_eyeToWindowCoordinates:BZ,czm_fastApproximateAtan:OZ,czm_fog:YZ,czm_gammaCorrect:HZ,czm_geodeticSurfaceNormal:zZ,czm_getDefaultMaterial:KZ,czm_getDynamicAtmosphereLightDirection:JZ,czm_getLambertDiffuse:QZ,czm_getSpecular:jZ,czm_getWaterNoise:qZ,czm_hue:$Z,czm_inverseGamma:eG,czm_isEmpty:tG,czm_isFull:nG,czm_latitudeToWebMercatorFraction:iG,czm_lineDistance:oG,czm_linearToSrgb:rG,czm_luminance:sG,czm_maximumComponent:aG,czm_metersPerPixel:cG,czm_modelToWindowCoordinates:lG,czm_multiplyWithColorBalance:dG,czm_nearFarScalar:uG,czm_octDecode:mG,czm_packDepth:hG,czm_pbrLighting:fG,czm_pbrNeutralTonemapping:pG,czm_phong:bG,czm_planeDistance:gG,czm_pointAlongRay:yG,czm_rayEllipsoidIntersectionInterval:xG,czm_raySphereIntersectionInterval:_G,czm_readDepth:TG,czm_readNonPerspective:SG,czm_reverseLogDepth:CG,czm_round:VG,czm_saturation:LG,czm_shadowDepthCompare:RG,czm_shadowVisibility:ZG,czm_signNotZero:GG,czm_sphericalHarmonics:EG,czm_srgbToLinear:IG,czm_tangentToEyeSpaceMatrix:XG,czm_textureCube:WG,czm_transformPlane:PG,czm_translateRelativeToEye:vG,czm_translucentPhong:wG,czm_transpose:FG,czm_unpackClippingExtents:AG,czm_unpackDepth:MG,czm_unpackFloat:NG,czm_unpackUint:kG,czm_valueTransform:UG,czm_vertexLogDepth:DG,czm_windowToEyeCoordinates:BG,czm_writeDepthClamp:OG,czm_writeLogDepth:YG,czm_writeNonPerspective:HG};var dUt=T(S(),1);function jZe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable ${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable ${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod @@ -3875,8 +3875,8 @@ ${n}`,n=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif ${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 -${n}`,n}var OG=JZe;function jee(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r=0;--o)i=`${i+t[o].glslSource} +${n}`,n}var zG=jZe;function jee(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r=0;--o)i=`${i+t[o].glslSource} `;return i.replace(n.glslSource,"")}function ete(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Xm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Xm.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new De({sources:[r]})),typeof s=="string"&&(s=new De({sources:[s]}));let c=this._context,d=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),h=new en({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function dY(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;ogGe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*W.TWO_PI,o}function xGe(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=W.zeroToTwoPi(r),e<0&&(r-=W.TWO_PI),r+=n*W.TWO_PI,r}function _Ge(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),d=Math.sin(n);return l(i)?(i[0]=c*o-d*r*s,i[1]=d*o+c*r*s,i[2]=r*a,i[3]=-c*r-d*o*s,i[4]=-d*r+c*o*s,i[5]=o*a,i[6]=d*a,i[7]=-c*a,i[8]=s):i=new $(c*o-d*r*s,-c*r-d*o*s,d*a,d*o+c*r*s,-d*r+c*o*s,-c*a,r*a,o*a,s),i}var TGe=1.0000010178*Ga,SGe=100.46645683*Tu,CGe=129597742283429e-5*cd,dte=16002,ute=21863,mte=32004,hte=10931,fte=14529,pte=16368,bte=15318,gte=32794,VGe=64*1e-7*Ga,LGe=-152*1e-7*Ga,RGe=62*1e-7*Ga,ZGe=-8*1e-7*Ga,GGe=32*1e-7*Ga,EGe=-41*1e-7*Ga,IGe=19*1e-7*Ga,XGe=-11*1e-7*Ga,WGe=-150*1e-7*Ga,PGe=-46*1e-7*Ga,vGe=68*1e-7*Ga,wGe=54*1e-7*Ga,FGe=14*1e-7*Ga,AGe=24*1e-7*Ga,MGe=-28*1e-7*Ga,NGe=22*1e-7*Ga,yte=10,xte=16002,_te=21863,Tte=10931,Ste=1473,Cte=32004,Vte=4387,Lte=73,kGe=-325*1e-7,UGe=-322*1e-7,DGe=-79*1e-7,BGe=232*1e-7,OGe=-52*1e-7,YGe=97*1e-7,HGe=55*1e-7,zGe=-41*1e-7,KGe=-105*1e-7,JGe=-137*1e-7,QGe=258*1e-7,jGe=35*1e-7,qGe=-116*1e-7,$Ge=-88*1e-7,eEe=-112*1e-7,tEe=-80*1e-7,HS=new q(0,0,Hn.TAI);function nEe(e,t){Zte(e,HS);let i=(HS.dayNumber-kN.dayNumber+(HS.secondsOfDay-kN.secondsOfDay)/zn.SECONDS_PER_DAY)/(zn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=TGe+VGe*Math.cos(dte*o)+WGe*Math.sin(dte*o)+LGe*Math.cos(ute*o)+PGe*Math.sin(ute*o)+RGe*Math.cos(mte*o)+vGe*Math.sin(mte*o)+ZGe*Math.cos(hte*o)+wGe*Math.sin(hte*o)+GGe*Math.cos(fte*o)+FGe*Math.sin(fte*o)+EGe*Math.cos(pte*o)+AGe*Math.sin(pte*o)+IGe*Math.cos(bte*o)+MGe*Math.sin(bte*o)+XGe*Math.cos(gte*o)+NGe*Math.sin(gte*o),s=SGe+CGe*i+kGe*Math.cos(yte*o)+KGe*Math.sin(yte*o)+UGe*Math.cos(xte*o)+JGe*Math.sin(xte*o)+DGe*Math.cos(_te*o)+QGe*Math.sin(_te*o)+BGe*Math.cos(Tte*o)+jGe*Math.sin(Tte*o)+OGe*Math.cos(Ste*o)+qGe*Math.sin(Ste*o)+YGe*Math.cos(Cte*o)+$Ge*Math.sin(Cte*o)+HGe*Math.cos(Vte*o)+eEe*Math.sin(Vte*o)+zGe*Math.cos(Lte*o)+tEe*Math.sin(Lte*o),a=.0167086342-.0004203654*i,c=102.93734808*Tu+11612.3529*cd*i,d=469.97289*cd*i,u=174.87317577*Tu-8679.27034*cd*i;return Gte(r,a,d,c,u,s,t)}function Ete(e,t){Zte(e,HS);let i=(HS.dayNumber-kN.dayNumber+(HS.secondsOfDay-kN.secondsOfDay)/zn.SECONDS_PER_DAY)/zn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,d=5.15668983*Tu,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*Tu,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Tu,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*Tu,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*Tu+cd*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),V=93.27209062*Tu+cd*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),L=134.96340251*Tu+cd*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),Z=357.52910918*Tu+cd*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),G=310.17137918*Tu-cd*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),I=2*C,v=4*C,P=6*C,w=2*L,F=3*L,b=4*L,R=2*V;a+=3400.4*Math.cos(I)-635.6*Math.cos(I-L)-235.6*Math.cos(L)+218.1*Math.cos(I-Z)+181*Math.cos(I+L),c+=.014216*Math.cos(I-L)+.008551*Math.cos(I-w)-.001383*Math.cos(L)+.001356*Math.cos(I+L)-.001147*Math.cos(v-F)-914e-6*Math.cos(v-w)+869e-6*Math.cos(I-Z-L)-627e-6*Math.cos(I)-394e-6*Math.cos(v-b)+282e-6*Math.cos(I-Z-w)-279e-6*Math.cos(C-L)-236e-6*Math.cos(w)+231e-6*Math.cos(v)+229e-6*Math.cos(P-b)-201e-6*Math.cos(w-R),u+=486.26*Math.cos(I-R)-40.13*Math.cos(I)+37.51*Math.cos(R)+25.73*Math.cos(w-R)+19.97*Math.cos(I-Z-R),p+=-55609*Math.sin(I-L)-34711*Math.sin(I-w)-9792*Math.sin(L)+9385*Math.sin(v-F)+7505*Math.sin(v-w)+5318*Math.sin(I+L)+3484*Math.sin(v-b)-3417*Math.sin(I-Z-L)-2530*Math.sin(P-b)-2376*Math.sin(I)-2075*Math.sin(I-F)-1883*Math.sin(w)-1736*Math.sin(P-5*L)+1626*Math.sin(Z)-1370*Math.sin(P-F),f+=-5392*Math.sin(I-R)-540*Math.sin(Z)-441*Math.sin(I)+423*Math.sin(R)-288*Math.sin(w-R),_+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-L)-662.5*Math.sin(Z)+396.3*Math.sin(L)-218*Math.sin(I-Z);let E=2*G,X=3*G;u+=46.997*Math.cos(G)*i-.614*Math.cos(I-R+G)*i+.614*Math.cos(I-R-G)*i-.0297*Math.cos(E)*o-.0335*Math.cos(G)*o+.0012*Math.cos(I-R+E)*o-16e-5*Math.cos(G)*r+4e-5*Math.cos(X)*r+4e-5*Math.cos(E)*r;let A=2.116*Math.sin(G)*i-.111*Math.sin(I-R-G)*i-.0015*Math.sin(G)*o;p+=A,_+=A,f+=-520.77*Math.sin(G)*i+13.66*Math.sin(I-R+G)*i+1.12*Math.sin(I-G)*i-1.06*Math.sin(R-G)*i+.66*Math.sin(E)*o+.371*Math.sin(G)*o-.035*Math.sin(I-R+E)*o-.015*Math.sin(I-R+G)*o+.0014*Math.sin(G)*r-.0011*Math.sin(X)*r-9e-4*Math.sin(E)*r,a*=hGe;let N=d+u*cd,O=h+p*cd,U=x+_*cd,Y=g+f*cd;return Gte(a,c,N,O,Y,U,t)}var Rte=.012300034,iEe=Rte/(Rte+1)*-1;function oEe(e,t){return t=Ete(e,t),m.multiplyByScalar(t,iEe,t)}var Ite=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),KG=new m;mY.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=q.now()),l(t)||(t=new m),KG=nEe(e,KG),t=m.negate(KG,t),oEe(e,KG),m.subtract(t,KG,t),$.multiplyByVector(Ite,t,t),t};mY.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=q.now()),t=Ete(e,t),$.multiplyByVector(Ite,t,t),t};var k0=mY;var bDt=T(S(),1),UN={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};UN.getMorphTime=function(e){return e===UN.SCENE3D?1:e===UN.MORPHING?void 0:0};var oe=Object.freeze(UN);var _Dt=T(S(),1);function rEe(e){e=y(e,y.EMPTY_OBJECT),this.color=B.clone(y(e.color,B.WHITE)),this.intensity=y(e.intensity,2)}var Zp=rEe;function zS(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new ze,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=M.clone(M.IDENTITY),this._viewportTransformation=M.clone(M.IDENTITY),this._model=M.clone(M.IDENTITY),this._view=M.clone(M.IDENTITY),this._inverseView=M.clone(M.IDENTITY),this._projection=M.clone(M.IDENTITY),this._infiniteProjection=M.clone(M.IDENTITY),this._entireFrustum=new D,this._currentFrustum=new D,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(M.IDENTITY),this._view3DDirty=!0,this._view3D=new M,this._inverseView3DDirty=!0,this._inverseView3D=new M,this._inverseModelDirty=!0,this._inverseModel=new M,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new M,this._modelViewDirty=!0,this._modelView=new M,this._modelView3DDirty=!0,this._modelView3D=new M,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new M,this._inverseModelViewDirty=!0,this._inverseModelView=new M,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new M,this._viewProjectionDirty=!0,this._viewProjection=new M,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new M,this._modelViewProjectionDirty=!0,this._modelViewProjection=new M,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new M,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new M,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new M,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new On,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new D,this._eyeEllipsoidNormalEC=new m,this._eyeEllipsoidCurvature=new D,this._modelToEnu=new M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new B,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new m,this._atmosphereRayleighScaleHeight=new m,this._atmosphereMieCoefficient=new m,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(zS.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!ze.equals(e,this._viewport)){ze.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Wte(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Wte(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){M.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,M.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,M.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return fY(this),this._view3D}},viewRotation:{get:function(){return fY(this),this._viewRotation}},viewRotation3D:{get:function(){return fY(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return wte(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return wte(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return bEe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return gEe(this),this._modelView}},modelView3D:{get:function(){return yEe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return VEe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return xEe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return _Ee(this),this._inverseModelView3D}},viewProjection:{get:function(){return TEe(this),this._viewProjection}},inverseViewProjection:{get:function(){return SEe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return CEe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return LEe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return REe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return ZEe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return GEe(this),this._normal}},normal3D:{get:function(){return EEe(this),this._normal3D}},inverseNormal:{get:function(){return IEe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return XEe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return vte(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return vte(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,ne.default)}}});function sEe(e,t){M.clone(t,e._view),M.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function aEe(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function cEe(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function lEe(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Xte=new m,dEe=new M;function uEe(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=m.fromRadians(o.longitude,o.latitude,0,n,Xte)):(e._eyeHeight=-n.maximumRadius,m.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=m.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Xte)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=wt.eastNorthUpToFixedFrame(i,n,dEe);e._enuToModel=M.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu),W.equalsEpsilon(n._radii.x,n._radii.y,W.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var hY=new $,mEe=new he;function hEe(e,t){wt.computeIcrfToCentralBodyFixedMatrix(t.time,hY);let n=k0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(hY,n,n),m.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=k0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(hY,n,n),$.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,mEe);i.project(r,e._sunPositionColumbusView)}zS.prototype.updateCamera=function(e){sEe(this,e.viewMatrix),aEe(this,e.inverseViewMatrix),uEe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==oe.SCENE2D&&e.frustum instanceof an};zS.prototype.updateFrustum=function(e){cEe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&lEe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=W.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};zS.prototype.updatePass=function(e){this._pass=e};var fEe=[],pEe=new Zp;zS.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===oe.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),hEe(this,e);let n=y(e.light,pEe);n instanceof Zp?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=m.multiplyByScalar(o,n.intensity,o);let r=m.maximumComponent(o);r>1?m.divideByScalar(o,r,this._lightColor):m.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,fEe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=m.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=m.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=m.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=wt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,h;l(d)?u.height>u.width?h=Math.tan(.5*d)*2/u.height:h=Math.tan(.5*d)*2/u.width:h=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,B.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Wte(e){if(e._viewportDirty){let t=e._viewport;M.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),M.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function bEe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function gEe(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function yEe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function xEe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function _Ee(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function TEe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function SEe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function CEe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function VEe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function LEe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function REe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function ZEe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function GEe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function EEe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function IEe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),$.transpose(t,t)}}function XEe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var Pte=new m;function vte(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,Pte),On.fromCartesian(Pte,e._encodedCameraPositionMC))}var WEe=new m,PEe=new m,vEe=new m,wEe=new m,FEe=new he,AEe=new m,MEe=new M;function NEe(e,t,n,i,o,r,s,a){let c=WEe;c.x=e.y,c.y=e.z,c.z=e.x;let d=PEe;d.x=n.y,d.y=n.z,d.z=n.x;let u=vEe;u.x=i.y,u.y=i.z,u.z=i.x;let h=wEe;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,FEe);p.longitude=W.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=W.clamp(p.latitude,-W.PI_OVER_TWO,W.PI_OVER_TWO);let g=s.ellipsoid,f=g.cartographicToCartesian(p,AEe),x=wt.eastNorthUpToFixedFrame(f,g,MEe);return M.multiplyByPointAsVector(x,d,d),M.multiplyByPointAsVector(x,u,u),M.multiplyByPointAsVector(x,h,h),l(a)||(a=new M),a[0]=d.x,a[1]=u.x,a[2]=-h.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-h.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-h.z,a[11]=0,a[12]=-m.dot(d,f),a[13]=-m.dot(u,f),a[14]=m.dot(h,f),a[15]=1,a}function fY(e){e._view3DDirty&&(e._mode===oe.SCENE3D?M.clone(e._view,e._view3D):NEe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),M.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function wte(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var JG=zS;function ld(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):kEe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Bn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new YG(this),this._textureCache=new HG;let d=s;this._stencilBits=d.getParameter(d.STENCIL_BITS),At._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),At._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),At._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),At._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),At._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),At._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),At._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),At._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),At._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),At._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS),At._maximumSamples=this._webgl2?d.getParameter(d.MAX_SAMPLES):0;let u=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);At._minimumAliasedLineWidth=u[0],At._maximumAliasedLineWidth=u[1];let h=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);At._minimumAliasedPointSize=h[0],At._maximumAliasedPointSize=h[1];let p=d.getParameter(d.MAX_VIEWPORT_DIMS);At._maximumViewportWidth=p[0],At._maximumViewportHeight=p[1];let g=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);At._highpFloatSupported=g.precision!==0;let f=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);At._highpIntSupported=f.rangeMax!==0,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!_r(d,["OES_standard_derivatives"]),this._blendMinmax=!!_r(d,["EXT_blend_minmax"]),this._elementIndexUint=!!_r(d,["OES_element_index_uint"]),this._depthTexture=!!_r(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!_r(d,["EXT_frag_depth"]),this._debugShaders=_r(d,["WEBGL_debug_shaders"]),this._textureFloat=!!_r(d,["OES_texture_float"]),this._textureHalfFloat=!!_r(d,["OES_texture_half_float"]),this._textureFloatLinear=!!_r(d,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!_r(d,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!_r(d,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!_r(d,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!_r(d,["EXT_float_blend"]),this._colorBufferHalfFloat=!!_r(d,["EXT_color_buffer_half_float"]),this._s3tc=!!_r(d,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!_r(d,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!_r(d,["WEBGL_compressed_texture_astc"]),this._etc=!!_r(d,["WEBG_compressed_texture_etc"]),this._etc1=!!_r(d,["WEBGL_compressed_texture_etc1"]),this._bc7=!!_r(d,["EXT_texture_compression_bptc"]),Sl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?_r(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,At._maximumTextureFilterAnisotropy=l(x)?d.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let _,C,V,L,Z,G,I,v,P,w;if(c){let E=this;_=function(){return E._gl.createVertexArray()},C=function(X){E._gl.bindVertexArray(X)},V=function(X){E._gl.deleteVertexArray(X)},L=function(X,A,N,O,U){d.drawElementsInstanced(X,A,N,O,U)},Z=function(X,A,N,O){d.drawArraysInstanced(X,A,N,O)},G=function(X,A){d.vertexAttribDivisor(X,A)},I=function(X){d.drawBuffers(X)}}else v=_r(d,["OES_vertex_array_object"]),l(v)&&(_=function(){return v.createVertexArrayOES()},C=function(E){v.bindVertexArrayOES(E)},V=function(E){v.deleteVertexArrayOES(E)}),P=_r(d,["ANGLE_instanced_arrays"]),l(P)&&(L=function(E,X,A,N,O){P.drawElementsInstancedANGLE(E,X,A,N,O)},Z=function(E,X,A,N){P.drawArraysInstancedANGLE(E,X,A,N)},G=function(E,X){P.vertexAttribDivisorANGLE(E,X)}),w=_r(d,["WEBGL_draw_buffers"]),l(w)&&(I=function(E){w.drawBuffersWEBGL(E)});this.glCreateVertexArray=_,this.glBindVertexArray=C,this.glDeleteVertexArray=V,this.glDrawElementsInstanced=L,this.glDrawArraysInstanced=Z,this.glVertexAttribDivisor=G,this.glDrawBuffers=I,this._vertexArrayObject=!!v,this._instancedArrays=!!P,this._drawBuffers=!!w,At._maximumDrawBuffers=this.drawBuffers?d.getParameter(ie.MAX_DRAW_BUFFERS):1,At._maximumColorAttachments=this.drawBuffers?d.getParameter(ie.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new B(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let F=new JG,b=new nc(this),R=Ue.fromCache();this._defaultPassState=b,this._defaultRenderState=R,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=F,this._currentRenderState=R,this._currentPassState=b,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let E=0;E"u")throw new ae("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new ae("The browser supports WebGL, but initialization failed.");return r}function UEe(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function DEe(e,t,n,i){let o=`${UEe(e,i)}: ${t.name}(`;for(let r=0;r=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=YEe(this._originalGLContext,e?BEe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Wt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Wt({context:this,pixelFormat:nt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Wt({context:this,pixelFormat:nt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new xr({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return HEe}}});function Fte(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ue.partialApply(e._gl,o,t,r,n,i)}var pY;typeof WebGLRenderingContext<"u"&&(pY=[ie.BACK]);function bY(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=pY;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var zEe=new $n;ld.prototype.clear=function(e,t){e=y(e,zEe),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(B.equals(this._clearColor,o)||(B.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);Fte(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);bY(this,c),n.clear(i)};function KEe(e,t,n,i,o){bY(e,t),Fte(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function JEe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,M.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;l(d)?(s=s*d.bytesPerIndex,l(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,c===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}ld.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),KEe(this,o,t,n,r),JEe(this,e,n,i)};ld.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=pY;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i0&&(a=s.getColorTexture(0).pixelDatatype);let c=nt.createTypedArray(nt.RGBA,a,o,r);return bY(this,s),t.readPixels(n,i,o,r,nt.RGBA,je.toWebGLConstant(a,this),c),c};var Ate={position:0,textureCoordinates:1};ld.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new lt({attributes:{position:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:we.TRIANGLES});e=ei.fromGeometry({context:this,geometry:t,attributeLocations:Ate,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};ld.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new qe({vertexArray:this.getViewportQuadVertexArray(),primitiveType:we.TRIANGLES,renderState:t.renderState,shaderProgram:en.fromCache({context:this,vertexShaderSource:cx,fragmentShaderSource:e,attributeLocations:Ate}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};ld.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function gY(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(gY.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});gY.prototype.destroy=function(){delete this._pickObjects[this.key]};ld.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ae("Out of unique Pick IDs.");return this._pickObjects[t]=e,new gY(this._pickObjects,t,B.fromRgba(t))};ld.prototype.isDestroyed=function(){return!1};ld.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),me(this)};ld._deprecationWarning=us;var QG=ld;var zBt=T(S(),1);var LBt=T(S(),1);function KS(e){e=y(e,y.EMPTY_OBJECT);let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new pe("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new pe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Wr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new Wr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}KS.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};KS.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};KS.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};KS.prototype.isDestroyed=function(){return!1};KS.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),me(this)};var jG=KS;var wBt=T(S(),1);var GBt=T(S(),1);var Vl={RGBA4:ie.RGBA4,RGBA8:ie.RGBA8,RGBA16F:ie.RGBA16F,RGBA32F:ie.RGBA32F,RGB5_A1:ie.RGB5_A1,RGB565:ie.RGB565,DEPTH_COMPONENT16:ie.DEPTH_COMPONENT16,STENCIL_INDEX8:ie.STENCIL_INDEX8,DEPTH_STENCIL:ie.DEPTH_STENCIL,DEPTH24_STENCIL8:ie.DEPTH24_STENCIL8,validate:function(e){return e===Vl.RGBA4||e===Vl.RGBA8||e===Vl.RGBA16F||e===Vl.RGBA32F||e===Vl.RGB5_A1||e===Vl.RGB565||e===Vl.DEPTH_COMPONENT16||e===Vl.STENCIL_INDEX8||e===Vl.DEPTH_STENCIL||e===Vl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ie.FLOAT?Vl.RGBA32F:e===ie.HALF_FLOAT_OES?Vl.RGBA16F:Vl.RGBA8}},Fc=Object.freeze(Vl);function qG(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=At.maximumRenderbufferSize,o=y(e.format,Fc.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(qG.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});qG.prototype._getRenderbuffer=function(){return this._renderbuffer};qG.prototype.isDestroyed=function(){return!1};qG.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),me(this)};var dd=qG;function Ss(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(Ss.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});Ss.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};Ss.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,je.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,nt.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s1){let a=Fc.getColorFormat(o);this._colorRenderbuffers[s]=new dd({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Wt({context:e,width:t,height:n,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:$t.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new dd({context:e,width:t,height:n,format:Fc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new dd({context:e,width:t,height:n,format:Fc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Wt({context:e,width:t,height:n,pixelFormat:nt.DEPTH_COMPONENT,pixelDatatype:je.UNSIGNED_INT,sampler:$t.NEAREST}):this._depthRenderbuffer=new dd({context:e,width:t,height:n,format:Fc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new jG({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Wr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ss.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};Ss.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ss.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};Ss.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ss.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ss.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ss.prototype.getDepthTexture=function(){return this._depthTexture};Ss.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ss.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ss.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ss.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ss.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Ss.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Ss.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Ss.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Ss.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Xm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Xm.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new De({sources:[r]})),typeof s=="string"&&(s=new De({sources:[s]}));let c=this._context,d=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),h=new $t({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function mY(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;oxGe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*W.TWO_PI,o}function TGe(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=W.zeroToTwoPi(r),e<0&&(r-=W.TWO_PI),r+=n*W.TWO_PI,r}function SGe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),d=Math.sin(n);return l(i)?(i[0]=c*o-d*r*s,i[1]=d*o+c*r*s,i[2]=r*a,i[3]=-c*r-d*o*s,i[4]=-d*r+c*o*s,i[5]=o*a,i[6]=d*a,i[7]=-c*a,i[8]=s):i=new $(c*o-d*r*s,-c*r-d*o*s,d*a,d*o+c*r*s,-d*r+c*o*s,-c*a,r*a,o*a,s),i}var CGe=1.0000010178*Ia,VGe=100.46645683*Tu,LGe=129597742283429e-5*ld,dte=16002,ute=21863,mte=32004,hte=10931,fte=14529,pte=16368,bte=15318,gte=32794,RGe=64*1e-7*Ia,ZGe=-152*1e-7*Ia,GGe=62*1e-7*Ia,EGe=-8*1e-7*Ia,IGe=32*1e-7*Ia,XGe=-41*1e-7*Ia,WGe=19*1e-7*Ia,PGe=-11*1e-7*Ia,vGe=-150*1e-7*Ia,wGe=-46*1e-7*Ia,FGe=68*1e-7*Ia,AGe=54*1e-7*Ia,MGe=14*1e-7*Ia,NGe=24*1e-7*Ia,kGe=-28*1e-7*Ia,UGe=22*1e-7*Ia,yte=10,xte=16002,_te=21863,Tte=10931,Ste=1473,Cte=32004,Vte=4387,Lte=73,DGe=-325*1e-7,BGe=-322*1e-7,OGe=-79*1e-7,YGe=232*1e-7,HGe=-52*1e-7,zGe=97*1e-7,KGe=55*1e-7,JGe=-41*1e-7,QGe=-105*1e-7,jGe=-137*1e-7,qGe=258*1e-7,$Ge=35*1e-7,eEe=-116*1e-7,tEe=-88*1e-7,nEe=-112*1e-7,iEe=-80*1e-7,KS=new q(0,0,Hn.TAI);function oEe(e,t){Zte(e,KS);let i=(KS.dayNumber-DN.dayNumber+(KS.secondsOfDay-DN.secondsOfDay)/Kn.SECONDS_PER_DAY)/(Kn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=CGe+RGe*Math.cos(dte*o)+vGe*Math.sin(dte*o)+ZGe*Math.cos(ute*o)+wGe*Math.sin(ute*o)+GGe*Math.cos(mte*o)+FGe*Math.sin(mte*o)+EGe*Math.cos(hte*o)+AGe*Math.sin(hte*o)+IGe*Math.cos(fte*o)+MGe*Math.sin(fte*o)+XGe*Math.cos(pte*o)+NGe*Math.sin(pte*o)+WGe*Math.cos(bte*o)+kGe*Math.sin(bte*o)+PGe*Math.cos(gte*o)+UGe*Math.sin(gte*o),s=VGe+LGe*i+DGe*Math.cos(yte*o)+QGe*Math.sin(yte*o)+BGe*Math.cos(xte*o)+jGe*Math.sin(xte*o)+OGe*Math.cos(_te*o)+qGe*Math.sin(_te*o)+YGe*Math.cos(Tte*o)+$Ge*Math.sin(Tte*o)+HGe*Math.cos(Ste*o)+eEe*Math.sin(Ste*o)+zGe*Math.cos(Cte*o)+tEe*Math.sin(Cte*o)+KGe*Math.cos(Vte*o)+nEe*Math.sin(Vte*o)+JGe*Math.cos(Lte*o)+iEe*Math.sin(Lte*o),a=.0167086342-.0004203654*i,c=102.93734808*Tu+11612.3529*ld*i,d=469.97289*ld*i,u=174.87317577*Tu-8679.27034*ld*i;return Gte(r,a,d,c,u,s,t)}function Ete(e,t){Zte(e,KS);let i=(KS.dayNumber-DN.dayNumber+(KS.secondsOfDay-DN.secondsOfDay)/Kn.SECONDS_PER_DAY)/Kn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,d=5.15668983*Tu,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*Tu,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Tu,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*Tu,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*Tu+ld*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),V=93.27209062*Tu+ld*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),L=134.96340251*Tu+ld*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),Z=357.52910918*Tu+ld*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),G=310.17137918*Tu-ld*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),I=2*C,v=4*C,P=6*C,w=2*L,F=3*L,b=4*L,R=2*V;a+=3400.4*Math.cos(I)-635.6*Math.cos(I-L)-235.6*Math.cos(L)+218.1*Math.cos(I-Z)+181*Math.cos(I+L),c+=.014216*Math.cos(I-L)+.008551*Math.cos(I-w)-.001383*Math.cos(L)+.001356*Math.cos(I+L)-.001147*Math.cos(v-F)-914e-6*Math.cos(v-w)+869e-6*Math.cos(I-Z-L)-627e-6*Math.cos(I)-394e-6*Math.cos(v-b)+282e-6*Math.cos(I-Z-w)-279e-6*Math.cos(C-L)-236e-6*Math.cos(w)+231e-6*Math.cos(v)+229e-6*Math.cos(P-b)-201e-6*Math.cos(w-R),u+=486.26*Math.cos(I-R)-40.13*Math.cos(I)+37.51*Math.cos(R)+25.73*Math.cos(w-R)+19.97*Math.cos(I-Z-R),p+=-55609*Math.sin(I-L)-34711*Math.sin(I-w)-9792*Math.sin(L)+9385*Math.sin(v-F)+7505*Math.sin(v-w)+5318*Math.sin(I+L)+3484*Math.sin(v-b)-3417*Math.sin(I-Z-L)-2530*Math.sin(P-b)-2376*Math.sin(I)-2075*Math.sin(I-F)-1883*Math.sin(w)-1736*Math.sin(P-5*L)+1626*Math.sin(Z)-1370*Math.sin(P-F),f+=-5392*Math.sin(I-R)-540*Math.sin(Z)-441*Math.sin(I)+423*Math.sin(R)-288*Math.sin(w-R),_+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-L)-662.5*Math.sin(Z)+396.3*Math.sin(L)-218*Math.sin(I-Z);let E=2*G,X=3*G;u+=46.997*Math.cos(G)*i-.614*Math.cos(I-R+G)*i+.614*Math.cos(I-R-G)*i-.0297*Math.cos(E)*o-.0335*Math.cos(G)*o+.0012*Math.cos(I-R+E)*o-16e-5*Math.cos(G)*r+4e-5*Math.cos(X)*r+4e-5*Math.cos(E)*r;let A=2.116*Math.sin(G)*i-.111*Math.sin(I-R-G)*i-.0015*Math.sin(G)*o;p+=A,_+=A,f+=-520.77*Math.sin(G)*i+13.66*Math.sin(I-R+G)*i+1.12*Math.sin(I-G)*i-1.06*Math.sin(R-G)*i+.66*Math.sin(E)*o+.371*Math.sin(G)*o-.035*Math.sin(I-R+E)*o-.015*Math.sin(I-R+G)*o+.0014*Math.sin(G)*r-.0011*Math.sin(X)*r-9e-4*Math.sin(E)*r,a*=pGe;let N=d+u*ld,O=h+p*ld,U=x+_*ld,Y=g+f*ld;return Gte(a,c,N,O,Y,U,t)}var Rte=.012300034,rEe=Rte/(Rte+1)*-1;function sEe(e,t){return t=Ete(e,t),m.multiplyByScalar(t,rEe,t)}var Ite=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),jG=new m;fY.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=q.now()),l(t)||(t=new m),jG=oEe(e,jG),t=m.negate(jG,t),sEe(e,jG),m.subtract(t,jG,t),$.multiplyByVector(Ite,t,t),t};fY.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=q.now()),t=Ete(e,t),$.multiplyByVector(Ite,t,t),t};var U0=fY;var _Dt=T(S(),1),BN={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};BN.getMorphTime=function(e){return e===BN.SCENE3D?1:e===BN.MORPHING?void 0:0};var oe=Object.freeze(BN);var VDt=T(S(),1);function aEe(e){e=y(e,y.EMPTY_OBJECT),this.color=B.clone(y(e.color,B.WHITE)),this.intensity=y(e.intensity,2)}var Gp=aEe;function JS(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new ze,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=M.clone(M.IDENTITY),this._viewportTransformation=M.clone(M.IDENTITY),this._model=M.clone(M.IDENTITY),this._view=M.clone(M.IDENTITY),this._inverseView=M.clone(M.IDENTITY),this._projection=M.clone(M.IDENTITY),this._infiniteProjection=M.clone(M.IDENTITY),this._entireFrustum=new D,this._currentFrustum=new D,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(M.IDENTITY),this._view3DDirty=!0,this._view3D=new M,this._inverseView3DDirty=!0,this._inverseView3D=new M,this._inverseModelDirty=!0,this._inverseModel=new M,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new M,this._modelViewDirty=!0,this._modelView=new M,this._modelView3DDirty=!0,this._modelView3D=new M,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new M,this._inverseModelViewDirty=!0,this._inverseModelView=new M,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new M,this._viewProjectionDirty=!0,this._viewProjection=new M,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new M,this._modelViewProjectionDirty=!0,this._modelViewProjection=new M,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new M,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new M,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new M,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new On,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new D,this._eyeEllipsoidNormalEC=new m,this._eyeEllipsoidCurvature=new D,this._modelToEnu=new M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new B,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new m,this._atmosphereRayleighScaleHeight=new m,this._atmosphereMieCoefficient=new m,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(JS.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!ze.equals(e,this._viewport)){ze.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Wte(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Wte(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){M.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,M.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,M.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return bY(this),this._view3D}},viewRotation:{get:function(){return bY(this),this._viewRotation}},viewRotation3D:{get:function(){return bY(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return wte(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return wte(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return yEe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return xEe(this),this._modelView}},modelView3D:{get:function(){return _Ee(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return REe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return TEe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return SEe(this),this._inverseModelView3D}},viewProjection:{get:function(){return CEe(this),this._viewProjection}},inverseViewProjection:{get:function(){return VEe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return LEe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return ZEe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return GEe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return EEe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return IEe(this),this._normal}},normal3D:{get:function(){return XEe(this),this._normal3D}},inverseNormal:{get:function(){return WEe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return PEe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return vte(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return vte(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,ne.default)}}});function cEe(e,t){M.clone(t,e._view),M.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function lEe(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function dEe(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function uEe(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Xte=new m,mEe=new M;function hEe(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=m.fromRadians(o.longitude,o.latitude,0,n,Xte)):(e._eyeHeight=-n.maximumRadius,m.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=m.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Xte)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=vt.eastNorthUpToFixedFrame(i,n,mEe);e._enuToModel=M.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu),W.equalsEpsilon(n._radii.x,n._radii.y,W.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var pY=new $,fEe=new he;function pEe(e,t){vt.computeIcrfToCentralBodyFixedMatrix(t.time,pY);let n=U0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(pY,n,n),m.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=U0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(pY,n,n),$.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,fEe);i.project(r,e._sunPositionColumbusView)}JS.prototype.updateCamera=function(e){cEe(this,e.viewMatrix),lEe(this,e.inverseViewMatrix),hEe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==oe.SCENE2D&&e.frustum instanceof rn};JS.prototype.updateFrustum=function(e){dEe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&uEe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=W.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};JS.prototype.updatePass=function(e){this._pass=e};var bEe=[],gEe=new Gp;JS.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===oe.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),pEe(this,e);let n=y(e.light,gEe);n instanceof Gp?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=m.multiplyByScalar(o,n.intensity,o);let r=m.maximumComponent(o);r>1?m.divideByScalar(o,r,this._lightColor):m.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,bEe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=m.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=m.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=m.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=vt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,h;l(d)?u.height>u.width?h=Math.tan(.5*d)*2/u.height:h=Math.tan(.5*d)*2/u.width:h=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,B.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Wte(e){if(e._viewportDirty){let t=e._viewport;M.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),M.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function yEe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function xEe(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function _Ee(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function TEe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function SEe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function CEe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function VEe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function LEe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function REe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function ZEe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function GEe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function EEe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function IEe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function XEe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function WEe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),$.transpose(t,t)}}function PEe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var Pte=new m;function vte(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,Pte),On.fromCartesian(Pte,e._encodedCameraPositionMC))}var vEe=new m,wEe=new m,FEe=new m,AEe=new m,MEe=new he,NEe=new m,kEe=new M;function UEe(e,t,n,i,o,r,s,a){let c=vEe;c.x=e.y,c.y=e.z,c.z=e.x;let d=wEe;d.x=n.y,d.y=n.z,d.z=n.x;let u=FEe;u.x=i.y,u.y=i.z,u.z=i.x;let h=AEe;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,MEe);p.longitude=W.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=W.clamp(p.latitude,-W.PI_OVER_TWO,W.PI_OVER_TWO);let g=s.ellipsoid,f=g.cartographicToCartesian(p,NEe),x=vt.eastNorthUpToFixedFrame(f,g,kEe);return M.multiplyByPointAsVector(x,d,d),M.multiplyByPointAsVector(x,u,u),M.multiplyByPointAsVector(x,h,h),l(a)||(a=new M),a[0]=d.x,a[1]=u.x,a[2]=-h.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-h.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-h.z,a[11]=0,a[12]=-m.dot(d,f),a[13]=-m.dot(u,f),a[14]=m.dot(h,f),a[15]=1,a}function bY(e){e._view3DDirty&&(e._mode===oe.SCENE3D?M.clone(e._view,e._view3D):UEe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),M.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function wte(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var qG=JS;function dd(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):DEe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Bn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new KG(this),this._textureCache=new JG;let d=s;this._stencilBits=d.getParameter(d.STENCIL_BITS),Ft._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Ft._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),Ft._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),Ft._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),Ft._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),Ft._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),Ft._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),Ft._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),Ft._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ft._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS),Ft._maximumSamples=this._webgl2?d.getParameter(d.MAX_SAMPLES):0;let u=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);Ft._minimumAliasedLineWidth=u[0],Ft._maximumAliasedLineWidth=u[1];let h=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);Ft._minimumAliasedPointSize=h[0],Ft._maximumAliasedPointSize=h[1];let p=d.getParameter(d.MAX_VIEWPORT_DIMS);Ft._maximumViewportWidth=p[0],Ft._maximumViewportHeight=p[1];let g=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);Ft._highpFloatSupported=g.precision!==0;let f=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);Ft._highpIntSupported=f.rangeMax!==0,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!_r(d,["OES_standard_derivatives"]),this._blendMinmax=!!_r(d,["EXT_blend_minmax"]),this._elementIndexUint=!!_r(d,["OES_element_index_uint"]),this._depthTexture=!!_r(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!_r(d,["EXT_frag_depth"]),this._debugShaders=_r(d,["WEBGL_debug_shaders"]),this._textureFloat=!!_r(d,["OES_texture_float"]),this._textureHalfFloat=!!_r(d,["OES_texture_half_float"]),this._textureFloatLinear=!!_r(d,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!_r(d,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!_r(d,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!_r(d,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!_r(d,["EXT_float_blend"]),this._colorBufferHalfFloat=!!_r(d,["EXT_color_buffer_half_float"]),this._s3tc=!!_r(d,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!_r(d,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!_r(d,["WEBGL_compressed_texture_astc"]),this._etc=!!_r(d,["WEBG_compressed_texture_etc"]),this._etc1=!!_r(d,["WEBGL_compressed_texture_etc1"]),this._bc7=!!_r(d,["EXT_texture_compression_bptc"]),Vl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?_r(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Ft._maximumTextureFilterAnisotropy=l(x)?d.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let _,C,V,L,Z,G,I,v,P,w;if(c){let E=this;_=function(){return E._gl.createVertexArray()},C=function(X){E._gl.bindVertexArray(X)},V=function(X){E._gl.deleteVertexArray(X)},L=function(X,A,N,O,U){d.drawElementsInstanced(X,A,N,O,U)},Z=function(X,A,N,O){d.drawArraysInstanced(X,A,N,O)},G=function(X,A){d.vertexAttribDivisor(X,A)},I=function(X){d.drawBuffers(X)}}else v=_r(d,["OES_vertex_array_object"]),l(v)&&(_=function(){return v.createVertexArrayOES()},C=function(E){v.bindVertexArrayOES(E)},V=function(E){v.deleteVertexArrayOES(E)}),P=_r(d,["ANGLE_instanced_arrays"]),l(P)&&(L=function(E,X,A,N,O){P.drawElementsInstancedANGLE(E,X,A,N,O)},Z=function(E,X,A,N){P.drawArraysInstancedANGLE(E,X,A,N)},G=function(E,X){P.vertexAttribDivisorANGLE(E,X)}),w=_r(d,["WEBGL_draw_buffers"]),l(w)&&(I=function(E){w.drawBuffersWEBGL(E)});this.glCreateVertexArray=_,this.glBindVertexArray=C,this.glDeleteVertexArray=V,this.glDrawElementsInstanced=L,this.glDrawArraysInstanced=Z,this.glVertexAttribDivisor=G,this.glDrawBuffers=I,this._vertexArrayObject=!!v,this._instancedArrays=!!P,this._drawBuffers=!!w,Ft._maximumDrawBuffers=this.drawBuffers?d.getParameter(ie.MAX_DRAW_BUFFERS):1,Ft._maximumColorAttachments=this.drawBuffers?d.getParameter(ie.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new B(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let F=new qG,b=new ic(this),R=Ue.fromCache();this._defaultPassState=b,this._defaultRenderState=R,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=F,this._currentRenderState=R,this._currentPassState=b,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let E=0;E"u")throw new ae("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new ae("The browser supports WebGL, but initialization failed.");return r}function BEe(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function OEe(e,t,n,i){let o=`${BEe(e,i)}: ${t.name}(`;for(let r=0;r=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=zEe(this._originalGLContext,e?YEe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Xt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Xt({context:this,pixelFormat:nt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Xt({context:this,pixelFormat:nt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new xr({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return KEe}}});function Fte(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ue.partialApply(e._gl,o,t,r,n,i)}var gY;typeof WebGLRenderingContext<"u"&&(gY=[ie.BACK]);function yY(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=gY;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var JEe=new ti;dd.prototype.clear=function(e,t){e=y(e,JEe),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(B.equals(this._clearColor,o)||(B.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);Fte(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);yY(this,c),n.clear(i)};function QEe(e,t,n,i,o){yY(e,t),Fte(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function jEe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,M.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;l(d)?(s=s*d.bytesPerIndex,l(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,c===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}dd.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),QEe(this,o,t,n,r),jEe(this,e,n,i)};dd.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=gY;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i0&&(a=s.getColorTexture(0).pixelDatatype);let c=nt.createTypedArray(nt.RGBA,a,o,r);return yY(this,s),t.readPixels(n,i,o,r,nt.RGBA,je.toWebGLConstant(a,this),c),c};var Ate={position:0,textureCoordinates:1};dd.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new ct({attributes:{position:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:we.TRIANGLES});e=ni.fromGeometry({context:this,geometry:t,attributeLocations:Ate,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};dd.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new qe({vertexArray:this.getViewportQuadVertexArray(),primitiveType:we.TRIANGLES,renderState:t.renderState,shaderProgram:$t.fromCache({context:this,vertexShaderSource:cx,fragmentShaderSource:e,attributeLocations:Ate}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};dd.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function xY(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(xY.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});xY.prototype.destroy=function(){delete this._pickObjects[this.key]};dd.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ae("Out of unique Pick IDs.");return this._pickObjects[t]=e,new xY(this._pickObjects,t,B.fromRgba(t))};dd.prototype.isDestroyed=function(){return!1};dd.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),me(this)};dd._deprecationWarning=us;var $G=dd;var jBt=T(S(),1);var EBt=T(S(),1);function QS(e){e=y(e,y.EMPTY_OBJECT);let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new pe("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new pe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Wr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new Wr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}QS.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};QS.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};QS.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};QS.prototype.isDestroyed=function(){return!1};QS.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),me(this)};var eE=QS;var NBt=T(S(),1);var WBt=T(S(),1);var Rl={RGBA4:ie.RGBA4,RGBA8:ie.RGBA8,RGBA16F:ie.RGBA16F,RGBA32F:ie.RGBA32F,RGB5_A1:ie.RGB5_A1,RGB565:ie.RGB565,DEPTH_COMPONENT16:ie.DEPTH_COMPONENT16,STENCIL_INDEX8:ie.STENCIL_INDEX8,DEPTH_STENCIL:ie.DEPTH_STENCIL,DEPTH24_STENCIL8:ie.DEPTH24_STENCIL8,validate:function(e){return e===Rl.RGBA4||e===Rl.RGBA8||e===Rl.RGBA16F||e===Rl.RGBA32F||e===Rl.RGB5_A1||e===Rl.RGB565||e===Rl.DEPTH_COMPONENT16||e===Rl.STENCIL_INDEX8||e===Rl.DEPTH_STENCIL||e===Rl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ie.FLOAT?Rl.RGBA32F:e===ie.HALF_FLOAT_OES?Rl.RGBA16F:Rl.RGBA8}},Ac=Object.freeze(Rl);function tE(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Ft.maximumRenderbufferSize,o=y(e.format,Ac.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(tE.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});tE.prototype._getRenderbuffer=function(){return this._renderbuffer};tE.prototype.isDestroyed=function(){return!1};tE.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),me(this)};var ud=tE;function Ss(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(Ss.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});Ss.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};Ss.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,je.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,nt.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s1){let a=Ac.getColorFormat(o);this._colorRenderbuffers[s]=new ud({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Xt({context:e,width:t,height:n,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:qt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new ud({context:e,width:t,height:n,format:Ac.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new ud({context:e,width:t,height:n,format:Ac.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Xt({context:e,width:t,height:n,pixelFormat:nt.DEPTH_COMPONENT,pixelDatatype:je.UNSIGNED_INT,sampler:qt.NEAREST}):this._depthRenderbuffer=new ud({context:e,width:t,height:n,format:Ac.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new eE({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Wr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ss.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};Ss.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ss.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};Ss.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ss.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ss.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ss.prototype.getDepthTexture=function(){return this._depthTexture};Ss.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ss.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ss.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ss.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ss.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Ss.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Ss.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Ss.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Ss.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n0?Q.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ms._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Ms.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t0?Q.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ms._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Ms.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t0&&(this._hash={},e.length=0)};var Rt=Tx;var JOt=T(S(),1);function md(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(md.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});md.packedLength=2;md.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};md.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new md),n.near=e[t++],n.far=e[t],n};md.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};md.clone=function(e,t){if(l(e))return l(t)||(t=new md),t.near=e.near,t.far=e.far,t};md.prototype.clone=function(e){return md.clone(this,e)};md.prototype.equals=function(e){return md.equals(this,e)};var wt=md;var $Ot=T(S(),1);function Su(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}Su.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Su(e.near,e.nearValue,e.far,e.farValue)};Su.packedLength=4;Su.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Su.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Su),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Su.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Su.prototype.clone=function(e){return Su.clone(this,e)};Su.prototype.equals=function(e){return Su.equals(this,e)};var Nt=Su;var t3t=T(S(),1),Sx={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},Je=Object.freeze(Sx);function Cu(e){return e===Sx.CLAMP_TO_GROUND||e===Sx.CLAMP_TO_3D_TILE||e===Sx.CLAMP_TO_TERRAIN}function jS(e){return e===Sx.RELATIVE_TO_GROUND||e===Sx.RELATIVE_TO_3D_TILE||e===Sx.RELATIVE_TO_TERRAIN}var i3t=T(S(),1),cIe={CENTER:0,LEFT:1,RIGHT:-1},yi=Object.freeze(cIe);var r3t=T(S(),1),lIe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Pn=Object.freeze(lIe);var a3t=T(S(),1),dIe={DONE:0,PENDING:1,FAILED:2},lt=Object.freeze(dIe);var m3t=T(S(),1);function Pm(){pe.throwInstantiationError()}Object.defineProperties(Pm.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Pm.prototype.getValue=pe.throwInstantiationError;Pm.prototype.equals=pe.throwInstantiationError;Pm.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Pm.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new Mte(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Mte(r)):(CY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],CY(s.get(r.id),r,a),s.remove(r.id)};function CY(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var sE=B0;var mnn=T(S(),1);var B3t=T(S(),1);var WIe=new m;function cf(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}cf.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new cf({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};cf.fromAxisAlignedBoundingBox=function(e){return new cf({minimum:e.minimum,maximum:e.maximum})};cf.packedLength=2*m.packedLength+1;cf.pack=function(e,t,n){return n=y(n,0),m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=y(e._offsetAttribute,-1),t};var kte=new m,Ute=new m,Nte={minimum:kte,maximum:Ute,offsetAttribute:void 0};cf.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,kte),o=m.unpack(e,t+m.packedLength,Ute),r=e[t+m.packedLength*2];return l(n)?(n._min=m.clone(i,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Nte.offsetAttribute=r===-1?void 0:r,new cf(Nte))};cf.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new mn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=m.subtract(n,t,WIe),a=m.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,d=e._offsetAttribute===sn.NONE?0:1,u=new Uint8Array(c/3).fill(d);i.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new ct({attributes:i,indices:o,primitiveType:we.LINES,boundingSphere:new le(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var vm=cf;var J3t=T(S(),1);function qS(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([B.floatToByte(e),B.floatToByte(t),B.floatToByte(n),B.floatToByte(i)])}Object.defineProperties(qS.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});qS.fromColor=function(e){return new qS(e.red,e.green,e.blue,e.alpha)};qS.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};qS.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Yt=qS;var eYt=T(S(),1);function aE(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(aE.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});aE.fromDistanceDisplayCondition=function(e){return new aE(e.near,e.far)};aE.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Nn=aE;var oYt=T(S(),1);function PIe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Zt=PIe;var fYt=T(S(),1);var dYt=T(S(),1);function jo(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?q.clone(e.start):new q,this.stop=l(e.stop)?q.clone(e.stop):new q,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(jo.prototype,{isEmpty:{get:function(){let e=q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var $S={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};jo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new pe("options.iso8601 is an invalid ISO 8601 interval.");let i=q.fromIso8601(n[0]),o=q.fromIso8601(n[1]),r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):($S.start=i,$S.stop=o,$S.isStartIncluded=r,$S.isStopIncluded=s,$S.data=a,new jo($S))};jo.toIso8601=function(e,t){return`${q.toIso8601(e.start,t)}/${q.toIso8601(e.stop,t)}`};jo.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new jo(e)};jo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&q.equals(e.start,t.start)&&q.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};jo.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&q.equalsEpsilon(e.start,t.start,n)&&q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};jo.intersect=function(e,t,n,i){if(!l(t))return jo.clone(jo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=q.greaterThanOrEquals(s,o)&&q.greaterThanOrEquals(r,s),d=!c&&q.lessThanOrEquals(s,o)&&q.lessThanOrEquals(o,a);if(!c&&!d)return jo.clone(jo.EMPTY,n);let u=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,f=q.lessThan(r,a);return l(n)||(n=new jo),n.start=c?s:o,n.isStartIncluded=u&&p||!q.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?h:h&&g||!q.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};jo.contains=function(e,t){if(e.isEmpty)return!1;let n=q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};jo.prototype.clone=function(e){return jo.clone(this,e)};jo.prototype.equals=function(e,t){return jo.equals(this,e,t)};jo.prototype.equalsEpsilon=function(e,t,n){return jo.equalsEpsilon(this,e,t,n)};jo.prototype.toString=function(){return jo.toIso8601(this)};jo.EMPTY=Object.freeze(new jo({start:new q,stop:new q,isStartIncluded:!1,isStopIncluded:!1}));var Ln=jo;var Dte=Object.freeze(q.fromIso8601("0000-01-01T00:00:00Z")),Bte=Object.freeze(q.fromIso8601("9999-12-31T24:00:00Z")),vIe=Object.freeze(new Ln({start:Dte,stop:Bte})),wIe={MINIMUM_VALUE:Dte,MAXIMUM_VALUE:Bte,MAXIMUM_INTERVAL:vIe},Oe=wIe;var xYt=T(S(),1);function cE(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(cE.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});cE.fromCartesian3=function(e){return new cE(e.x,e.y,e.z)};cE.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var qi=cE;var VYt=T(S(),1);function ON(e){e=y(e,!0),this.value=ON.toValue(e)}Object.defineProperties(ON.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});ON.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var xn=ON;var Nzt=T(S(),1);var RYt=T(S(),1),lE=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec3 v_tangentEC; +in vec3 v_bitangentEC; +in vec2 v_st; void main() { - if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) - { -#ifdef MRT - out_FragData_0 = u_bgColor; - out_FragData_1 = vec4(u_bgColor.a); -#else - out_FragColor = u_bgColor; + vec3 positionToEyeEC = -v_positionEC; + mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); #endif - return; + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = tangentToEyeMatrix; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var GYt=T(S(),1),dE=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec3 tangent; +in vec3 bitangent; +in vec2 st; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec3 v_tangentEC; +out vec3 v_bitangentEC; +out vec2 v_st; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_tangentEC = czm_normal * tangent; // tangent in eye coordinates + v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var IYt=T(S(),1),uE=`in vec3 v_positionEC; +in vec3 v_normalEC; + +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var WYt=T(S(),1),mE=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var vYt=T(S(),1),hE=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; + +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var FYt=T(S(),1),fE=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec2 st; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec2 v_st; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var iHt=T(S(),1);var HYt=T(S(),1);var NYt=T(S(),1);var FIe={ADD:ie.FUNC_ADD,SUBTRACT:ie.FUNC_SUBTRACT,REVERSE_SUBTRACT:ie.FUNC_REVERSE_SUBTRACT,MIN:ie.MIN,MAX:ie.MAX},Xa=Object.freeze(FIe);var DYt=T(S(),1);var AIe={ZERO:ie.ZERO,ONE:ie.ONE,SOURCE_COLOR:ie.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ie.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ie.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ie.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ie.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ie.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ie.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ie.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ie.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ie.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ie.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ie.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ie.SRC_ALPHA_SATURATE},Co=Object.freeze(AIe);var MIe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Xa.ADD,equationAlpha:Xa.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Xa.ADD,equationAlpha:Xa.ADD,functionSourceRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Xa.ADD,equationAlpha:Xa.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE,functionDestinationAlpha:Co.ONE})},un=Object.freeze(MIe);var JYt=T(S(),1);var NIe={FRONT:ie.FRONT,BACK:ie.BACK,FRONT_AND_BACK:ie.FRONT_AND_BACK},xi=Object.freeze(NIe);function eC(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(eC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});eC.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` +`)};eC.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};eC.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};eC.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=un.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:xi.BACK}),l(n)&&(i=Tt(n,i,!0)),i};var no=eC;var Rzt=T(S(),1);var rHt=T(S(),1),pE=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; +} +`;var aHt=T(S(),1),bE=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + vec2 centerPixel = fract(repeat * st); + float centerBump = texture(image, centerPixel).channel; + + float imageWidth = float(imageDimensions.x); + vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); + float rightBump = texture(image, rightPixel).channel; + + float imageHeight = float(imageDimensions.y); + vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); + float topBump = texture(image, leftPixel).channel; + + vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + material.diffuse = vec3(0.01); + + return material; +} +`;var lHt=T(S(),1),gE=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 + + // Find the distance from the closest separator (region between two colors) + float scaledWidth = fract(repeat.s * st.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(repeat.t * st.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + float value = min(scaledWidth, scaledHeight); + + vec4 currentColor = mix(lightColor, darkColor, b); + vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); + + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; +} +`;var uHt=T(S(),1),yE=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 + + vec4 color = mix(lightColor, darkColor, b); + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; +} +`;var hHt=T(S(),1),xE=`uniform sampler2D heights; +uniform sampler2D colors; + +// This material expects heights to be sorted from lowest to highest. + +float getHeight(int idx, float invTexSize) +{ + vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); +#ifdef OES_texture_float + return texture(heights, uv).x; +#else + return czm_unpackFloat(texture(heights, uv)); +#endif +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float height = materialInput.height; + float invTexSize = 1.0 / float(heightsDimensions.x); + + float minHeight = getHeight(0, invTexSize); + float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); + + // early-out when outside the height range + if (height < minHeight || height > maxHeight) { + material.diffuse = vec3(0.0); + material.alpha = 0.0; + return material; + } + + // Binary search to find heights above and below. + int idxBelow = 0; + int idxAbove = heightsDimensions.x; + float heightBelow = minHeight; + float heightAbove = maxHeight; + + // while loop not allowed, so use for loop with max iterations. + // maxIterations of 16 supports a texture size up to 65536 (2^16). + const int maxIterations = 16; + for (int i = 0; i < maxIterations; i++) { + if (idxBelow >= idxAbove - 1) { + break; + } + + int idxMid = (idxBelow + idxAbove) / 2; + float heightTex = getHeight(idxMid, invTexSize); + + if (height > heightTex) { + idxBelow = idxMid; + heightBelow = heightTex; + } else { + idxAbove = idxMid; + heightAbove = heightTex; + } + } + + float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); + vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); + vec4 color = texture(colors, colorUv); + + // undo preumultiplied alpha + if (color.a > 0.0) + { + color.rgb /= color.a; } - discard; + color.rgb = czm_gammaCorrect(color.rgb); + + material.diffuse = color.rgb; + material.alpha = color.a; + return material; } -`;var Z3t=T(S(),1),Pm=`uniform vec3 u_radiiAndDynamicAtmosphereColor; +`;var pHt=T(S(),1),_E=`uniform vec4 color; +uniform float spacing; +uniform float width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float distanceToContour = mod(materialInput.height, spacing); + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float dxc = abs(dFdx(materialInput.height)); + float dyc = abs(dFdy(materialInput.height)); + float dF = max(dxc, dyc) * czm_pixelRatio * width; + float alpha = (distanceToContour < dF) ? 1.0 : 0.0; +#else + // If no derivatives available (IE 10?), use pixel ratio + float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; +#endif + + vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var gHt=T(S(),1),TE=`uniform sampler2D image; +uniform float minimumHeight; +uniform float maximumHeight; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); + vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; +} +`;var xHt=T(S(),1),SE=`uniform vec4 fadeInColor; +uniform vec4 fadeOutColor; +uniform float maximumDistance; +uniform bool repeat; +uniform vec2 fadeDirection; +uniform vec2 time; + +float getTime(float t, float coord) +{ + float scalar = 1.0 / maximumDistance; + float q = distance(t, coord) * scalar; + if (repeat) + { + float r = distance(t, coord + 1.0) * scalar; + float s = distance(t, coord - 1.0) * scalar; + q = min(min(r, s), q); + } + return clamp(q, 0.0, 1.0); +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float s = getTime(time.x, st.s) * fadeDirection.s; + float t = getTime(time.y, st.t) * fadeDirection.t; + + float u = length(vec2(s, t)); + vec4 color = mix(fadeInColor, fadeOutColor, u); + + color = czm_gammaCorrect(color); + material.emission = color.rgb; + material.alpha = color.a; + + return material; +} +`;var THt=T(S(),1),CE=`uniform vec4 color; +uniform float cellAlpha; +uniform vec2 lineCount; +uniform vec2 lineThickness; +uniform vec2 lineOffset; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + + float value; + + // Fuzz Factor - Controls blurriness of lines +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + const float fuzz = 1.2; + vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; + + // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. + vec2 dx = abs(dFdx(st)); + vec2 dy = abs(dFdy(st)); + vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; + value = min( + smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), + smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); +#else + // If no derivatives available (IE 10?), revert to view-dependent fuzz + const float fuzz = 0.05; + + vec2 range = 0.5 - (lineThickness * 0.05); + value = min( + 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), + 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); +#endif + + // Edges taken from RimLightingMaterial.glsl + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); + float sRim = smoothstep(0.8, 1.0, dRim); + value *= (1.0 - sRim); + + vec4 halfColor; + halfColor.rgb = color.rgb * 0.5; + halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); + halfColor = czm_gammaCorrect(halfColor); + material.diffuse = halfColor.rgb; + material.emission = halfColor.rgb; + material.alpha = halfColor.a; + + return material; +} +`;var CHt=T(S(),1),VE=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec4 textureValue = texture(image, fract(repeat * materialInput.st)); + vec3 normalTangentSpace = textureValue.channels; + normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; + normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); + normalTangentSpace = normalize(normalTangentSpace); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + + return material; +} +`;var LHt=T(S(),1),LE=`uniform vec4 color; + +float getPointOnLine(vec2 p0, vec2 p1, float x) +{ + float slope = (p0.y - p1.y) / (p0.x - p1.x); + return slope * (x - p0.x) + p0.y; +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; +#else + // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head + float base = 0.975; +#endif + + vec2 center = vec2(1.0, 0.5); + float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); + float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); + + float halfWidth = 0.15; + float s = step(0.5 - halfWidth, st.t); + s *= 1.0 - step(0.5 + halfWidth, st.t); + s *= 1.0 - step(base, st.s); + + float t = step(base, materialInput.st.s); + t *= 1.0 - step(ptOnUpperLine, st.t); + t *= step(ptOnLowerLine, st.t); + + // Find the distance from the closest separator (region between two colors) + float dist; + if (st.s < base) + { + float d1 = abs(st.t - (0.5 - halfWidth)); + float d2 = abs(st.t - (0.5 + halfWidth)); + dist = min(d1, d2); + } + else + { + float d1 = czm_infinity; + if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) + { + d1 = abs(st.s - base); + } + float d2 = abs(st.t - ptOnUpperLine); + float d3 = abs(st.t - ptOnLowerLine); + dist = min(min(d1, d2), d3); + } + + vec4 outsideColor = vec4(0.0); + vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); + vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); + + outColor = czm_gammaCorrect(outColor); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + return material; +} +`;var ZHt=T(S(),1),RE=`uniform vec4 color; +uniform vec4 gapColor; +uniform float dashLength; +uniform float dashPattern; +in float v_polylineAngle; + +const float maskLength = 16.0; + +mat2 rotate(float rad) { + float c = cos(rad); + float s = sin(rad); + return mat2( + c, s, + -s, c + ); +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; + + // Get the relative position within the dash from 0 to 1 + float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); + // Figure out the mask index. + float maskIndex = floor(dashPosition * maskLength); + // Test the bit mask. + float maskTest = floor(dashPattern / pow(2.0, maskIndex)); + vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; + if (fragColor.a < 0.005) { // matches 0/255 and 1/255 + discard; + } + + fragColor = czm_gammaCorrect(fragColor); + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + return material; +} +`;var EHt=T(S(),1),ZE=`uniform vec4 color; +uniform float glowPower; +uniform float taperPower; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); + + if (taperPower <= 0.99999) { + glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); + } + + vec4 fragColor; + fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); + fragColor.a = clamp(0.0, 1.0, glow) * color.a; + fragColor = czm_gammaCorrect(fragColor); + + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + + return material; +} +`;var XHt=T(S(),1),GE=`uniform vec4 color; +uniform vec4 outlineColor; +uniform float outlineWidth; + +in float v_width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; + float b = step(0.5 - halfInteriorWidth, st.t); + b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); + + // Find the distance from the closest separator (region between two colors) + float d1 = abs(st.t - (0.5 - halfInteriorWidth)); + float d2 = abs(st.t - (0.5 + halfInteriorWidth)); + float dist = min(d1, d2); + + vec4 currentColor = mix(outlineColor, color, b); + vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); + outColor = czm_gammaCorrect(outColor); + + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var PHt=T(S(),1),EE=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); + float s = smoothstep(1.0 - width, 1.0, d); + + vec4 outColor = czm_gammaCorrect(color); + vec4 outRimColor = czm_gammaCorrect(rimColor); + + material.diffuse = outColor.rgb; + material.emission = outRimColor.rgb * s; + material.alpha = mix(outColor.a, outRimColor.a, s); + + return material; +} +`;var wHt=T(S(),1),IE=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; +} +`;var AHt=T(S(),1),XE=`uniform vec4 evenColor; +uniform vec4 oddColor; +uniform float offset; +uniform float repeat; +uniform bool horizontal; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) + float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); + float value = fract((coord - offset) * (repeat * 0.5)); + float dist = min(value, min(abs(value - 0.5), 1.0 - value)); + + vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); + vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); + color = czm_gammaCorrect(color); + + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; +} +`;var NHt=T(S(),1),WE=`uniform vec4 waterColor; +uniform vec4 landColor; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); + outColor = czm_gammaCorrect(outColor); + + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var UHt=T(S(),1),PE=`// Thanks for the contribution Jonas +// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + +uniform sampler2D specularMap; +uniform sampler2D normalMap; +uniform vec4 baseWaterColor; +uniform vec4 blendColor; +uniform float frequency; +uniform float animationSpeed; +uniform float amplitude; +uniform float specularIntensity; +uniform float fadeFactor; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float time = czm_frameNumber * animationSpeed; + + // fade is a function of the distance from the fragment and the frequency of the waves + float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); + + float specularMapValue = texture(specularMap, materialInput.st).r; + + // note: not using directional motion at this time, just set the angle to 0.0; + vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); + vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); + + // fade out the normal perturbation as we move further from the water surface + normalTangentSpace.xy /= fade; + + // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) + normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); + + normalTangentSpace = normalize(normalTangentSpace); + + // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane + float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); + + // fade out water effect as specular map value decreases + material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; + + // base color is a blend of the water and non-water color based on the value from the specular map + // may need a uniform blend factor to better control this + material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); + + // diffuse highlights are based on how perturbed the normal is + material.diffuse += (0.1 * tsPerturbationRatio); + + material.diffuse = material.diffuse; + + material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); + + material.specular = specularIntensity; + material.shininess = 10.0; + + return material; +} +`;function He(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,jt.LINEAR),this._magnificationFilter=y(e.magnificationFilter,hi.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,kIe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(He._uniformList[this.type])||(He._uniformList[this.type]=Object.keys(this._uniforms))}He._uniformList={};He.fromType=function(e,t){let n=new He({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};He.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i-1)return!0;return!1}function HIe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} +`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) +{ +`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&YIe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; +`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; +`:e.shaderSource+=`material.${o} = ${t[o]}; +`}e.shaderSource+=`return material; +} +`}}var Yte={mat2:Ii,mat3:$,mat4:M},zIe=/\.ktx2$/i;function KIe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===He.DefaultImageId;t=r;let c=n._textures[e],d,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new qt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Xt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Xt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=r._width,u.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=c._width,u.y=c._height)),a)return;let h=r instanceof Ze;if(!l(n._texturePaths[e])||h&&r.url!==n._texturePaths[e].url||!h&&r!==n._texturePaths[e]){if(typeof r=="string"||h){let p=h?r:Ze.createIfNeeded(r),g;zIe.test(p.url)?g=Vl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(f){n._loadedImages.push({id:e,image:f})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function JIe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof xr){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===He.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Ze.createIfNeeded(i.positiveX).fetchImage(),Ze.createIfNeeded(i.negativeX).fetchImage(),Ze.createIfNeeded(i.positiveY).fetchImage(),Ze.createIfNeeded(i.negativeY).fetchImage(),Ze.createIfNeeded(i.positiveZ).fetchImage(),Ze.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function QIe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Hte(e,n)}function Hte(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=jIe(o),s;if(r==="channels")s=vE(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;$Ie(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},Hte(e,d))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let d=`uniform ${r} ${t};`;e.shaderSource=d+e.shaderSource}let c=`${t}_${e._count++}`;if(s=vE(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(KIe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(JIe(t));else if(r.indexOf("mat")!==-1){let d=new Yte[r];e._uniforms[c]=function(){return Yte[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function jIe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Ze||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===He.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function qIe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new He({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=Tt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;vE(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=vE(e,i,a)}}function vE(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,d,u){return d||u?c:(o+=1,n)}),o}function $Ie(e,t,n){return vE(e,t,t,n)}He._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};He.DefaultImageId="czm_defaultImage";He.DefaultCubeMapId="czm_defaultCubeMap";He.ColorType="Color";He._materialCache.addMaterial(He.ColorType,{fabric:{type:He.ColorType,uniforms:{color:new B(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});He.ImageType="Image";He._materialCache.addMaterial(He.ImageType,{fabric:{type:He.ImageType,uniforms:{image:He.DefaultImageId,repeat:new D(1,1),color:new B(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});He.DiffuseMapType="DiffuseMap";He._materialCache.addMaterial(He.DiffuseMapType,{fabric:{type:He.DiffuseMapType,uniforms:{image:He.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});He.AlphaMapType="AlphaMap";He._materialCache.addMaterial(He.AlphaMapType,{fabric:{type:He.AlphaMapType,uniforms:{image:He.DefaultImageId,channel:"a",repeat:new D(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});He.SpecularMapType="SpecularMap";He._materialCache.addMaterial(He.SpecularMapType,{fabric:{type:He.SpecularMapType,uniforms:{image:He.DefaultImageId,channel:"r",repeat:new D(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});He.EmissionMapType="EmissionMap";He._materialCache.addMaterial(He.EmissionMapType,{fabric:{type:He.EmissionMapType,uniforms:{image:He.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});He.BumpMapType="BumpMap";He._materialCache.addMaterial(He.BumpMapType,{fabric:{type:He.BumpMapType,uniforms:{image:He.DefaultImageId,channel:"r",strength:.8,repeat:new D(1,1)},source:bE},translucent:!1});He.NormalMapType="NormalMap";He._materialCache.addMaterial(He.NormalMapType,{fabric:{type:He.NormalMapType,uniforms:{image:He.DefaultImageId,channels:"rgb",strength:.8,repeat:new D(1,1)},source:VE},translucent:!1});He.GridType="Grid";He._materialCache.addMaterial(He.GridType,{fabric:{type:He.GridType,uniforms:{color:new B(0,1,0,1),cellAlpha:.1,lineCount:new D(8,8),lineThickness:new D(1,1),lineOffset:new D(0,0)},source:CE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});He.StripeType="Stripe";He._materialCache.addMaterial(He.StripeType,{fabric:{type:He.StripeType,uniforms:{horizontal:!0,evenColor:new B(1,1,1,.5),oddColor:new B(0,0,1,.5),offset:0,repeat:5},source:XE},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});He.CheckerboardType="Checkerboard";He._materialCache.addMaterial(He.CheckerboardType,{fabric:{type:He.CheckerboardType,uniforms:{lightColor:new B(1,1,1,.5),darkColor:new B(0,0,0,.5),repeat:new D(5,5)},source:gE},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});He.DotType="Dot";He._materialCache.addMaterial(He.DotType,{fabric:{type:He.DotType,uniforms:{lightColor:new B(1,1,0,.75),darkColor:new B(0,1,1,.75),repeat:new D(5,5)},source:yE},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});He.WaterType="Water";He._materialCache.addMaterial(He.WaterType,{fabric:{type:He.WaterType,uniforms:{baseWaterColor:new B(.2,.3,.6,1),blendColor:new B(0,1,.699,1),specularMap:He.DefaultImageId,normalMap:He.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:PE},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});He.RimLightingType="RimLighting";He._materialCache.addMaterial(He.RimLightingType,{fabric:{type:He.RimLightingType,uniforms:{color:new B(1,0,0,.7),rimColor:new B(1,1,1,.4),width:.3},source:EE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});He.FadeType="Fade";He._materialCache.addMaterial(He.FadeType,{fabric:{type:He.FadeType,uniforms:{fadeInColor:new B(1,0,0,1),fadeOutColor:new B(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new D(.5,.5)},source:SE},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});He.PolylineArrowType="PolylineArrow";He._materialCache.addMaterial(He.PolylineArrowType,{fabric:{type:He.PolylineArrowType,uniforms:{color:new B(1,1,1,1)},source:LE},translucent:!0});He.PolylineDashType="PolylineDash";He._materialCache.addMaterial(He.PolylineDashType,{fabric:{type:He.PolylineDashType,uniforms:{color:new B(1,0,1,1),gapColor:new B(0,0,0,0),dashLength:16,dashPattern:255},source:RE},translucent:!0});He.PolylineGlowType="PolylineGlow";He._materialCache.addMaterial(He.PolylineGlowType,{fabric:{type:He.PolylineGlowType,uniforms:{color:new B(0,.5,1,1),glowPower:.25,taperPower:1},source:ZE},translucent:!0});He.PolylineOutlineType="PolylineOutline";He._materialCache.addMaterial(He.PolylineOutlineType,{fabric:{type:He.PolylineOutlineType,uniforms:{color:new B(1,1,1,1),outlineColor:new B(1,0,0,1),outlineWidth:1},source:GE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});He.ElevationContourType="ElevationContour";He._materialCache.addMaterial(He.ElevationContourType,{fabric:{type:He.ElevationContourType,uniforms:{spacing:100,color:new B(1,0,0,1),width:1},source:_E},translucent:!1});He.ElevationRampType="ElevationRamp";He._materialCache.addMaterial(He.ElevationRampType,{fabric:{type:He.ElevationRampType,uniforms:{image:He.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:TE},translucent:!1});He.SlopeRampMaterialType="SlopeRamp";He._materialCache.addMaterial(He.SlopeRampMaterialType,{fabric:{type:He.SlopeRampMaterialType,uniforms:{image:He.DefaultImageId},source:IE},translucent:!1});He.AspectRampMaterialType="AspectRamp";He._materialCache.addMaterial(He.AspectRampMaterialType,{fabric:{type:He.AspectRampMaterialType,uniforms:{image:He.DefaultImageId},source:pE},translucent:!1});He.ElevationBandType="ElevationBand";He._materialCache.addMaterial(He.ElevationBandType,{fabric:{type:He.ElevationBandType,uniforms:{heights:He.DefaultImageId,colors:He.DefaultImageId},source:xE},translucent:!0});He.WaterMaskType="WaterMask";He._materialCache.addMaterial(He.WaterMaskType,{fabric:{type:He.WaterMaskType,source:WE,uniforms:{waterColor:new B(1,1,1,1),landColor:new B(0,0,0,0)}},translucent:!1});var Hi=He;function Cx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,Cx.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Hi.fromType(Hi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Cx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Cx.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Cx.prototype.isTranslucent=no.prototype.isTranslucent;Cx.prototype.getRenderState=no.prototype.getRenderState;Cx.MaterialSupport={BASIC:Object.freeze({vertexFormat:Xe.POSITION_AND_NORMAL,vertexShaderSource:mE,fragmentShaderSource:uE}),TEXTURED:Object.freeze({vertexFormat:Xe.POSITION_NORMAL_AND_ST,vertexShaderSource:fE,fragmentShaderSource:hE}),ALL:Object.freeze({vertexFormat:Xe.ALL,vertexShaderSource:dE,fragmentShaderSource:lE})};var ao=Cx;var nKt=T(S(),1);var Uzt=T(S(),1),wE=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec4 v_color; + +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + vec4 color = czm_gammaCorrect(v_color); + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; + + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +} +`;var Bzt=T(S(),1),FE=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec4 color; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec4 v_color; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var Yzt=T(S(),1),Vx=`in vec4 v_color; + +void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +} +`;var zzt=T(S(),1),AE=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 color; +in float batchId; + +out vec4 v_color; + +void main() +{ + vec4 p = czm_computePosition(); + + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;function Ip(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?AE:FE,r=i?Vx:wE,s=i?Ip.FLAT_VERTEX_FORMAT:Ip.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Ip.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Ip.VERTEX_FORMAT=Xe.POSITION_AND_NORMAL;Ip.FLAT_VERTEX_FORMAT=Xe.POSITION_ONLY;Ip.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Ip.prototype.isTranslucent=no.prototype.isTranslucent;Ip.prototype.getRenderState=no.prototype.getRenderState;var ln=Ip;var dKt=T(S(),1);function tC(e){this._definitionChanged=new ge,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(tC.prototype,{isConstant:{get:function(){return K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});tC.prototype.getType=function(e){return"Color"};var eXe=new q;tC.prototype.getValue=function(e,t){return l(e)||(e=q.now(eXe)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,B.WHITE,t.color),t};tC.prototype.equals=function(e){return this===e||e instanceof tC&&K.equals(this._color,e._color)};var Dt=tC;var Jjt=T(S(),1);var Gjt=T(S(),1);var WKt=T(S(),1);var xKt=T(S(),1);function O0(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ne.default),this._rectangle=y(e.rectangle,ce.MAX_VALUE),this._projection=new Ei(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(O0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});O0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=o&&(d=o-1);let u=(i.north-e.latitude)/a|0;return u>=r&&(u=r-1),l(n)?(n.x=d,n.y=u,n):new D(d,u)};var zi=O0;var zte=new m,Kte=new m,Jte=new he,LY=new m,tXe=new m,Qte=new le,nXe=new zi,ME=[new he,new he,new he,new he],NE=new D,Jr={};Jr.initialize=function(){let e=Jr._initPromise;return l(e)||(e=Ze.fetchJson(nn("Assets/approximateTerrainHeights.json")).then(function(t){Jr._terrainHeights=t}),Jr._initPromise=e),e};Jr.getMinimumMaximumHeights=function(e,t){t=y(t,ne.default);let n=jte(e),i=Jr._defaultMinTerrainHeight,o=Jr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Jr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ce.northeast(e,Jte),zte),t.cartographicToCartesian(ce.southwest(e,Jte),Kte),m.midpoint(Kte,zte,LY);let a=t.scaleToGeodeticSurface(LY,tXe);if(l(a)){let c=m.distance(LY,a);i=Math.min(i,-c)}else i=Jr._defaultMinTerrainHeight}return i=Math.max(Jr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Jr.getBoundingSphere=function(e,t){t=y(t,ne.default);let n=jte(e),i=Jr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Jr._terrainHeights[r];l(s)&&(i=s[1])}let o=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,Qte),le.union(o,Qte,o)};function jte(e){he.fromRadians(e.east,e.north,0,ME[0]),he.fromRadians(e.west,e.north,0,ME[1]),he.fromRadians(e.east,e.south,0,ME[2]),he.fromRadians(e.west,e.south,0,ME[3]);let t=0,n=0,i=0,o=0,r=Jr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=ME[c];if(nXe.positionToTileXY(d,s,NE),c===0)i=NE.x,o=NE.y;else if(i!==NE.x||o!==NE.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Jr._terrainHeightsMaxLevel=6;Jr._defaultMaxTerrainHeight=9e3;Jr._defaultMinTerrainHeight=-1e5;Jr._terrainHeights=void 0;Jr._initPromise=void 0;Object.defineProperties(Jr,{initialized:{get:function(){return l(Jr._terrainHeights)}}});var di=Jr;var pJt=T(S(),1);var qKt=T(S(),1);var MKt=T(S(),1);function Nc(e,t,n){this.minimum=m.clone(y(e,m.ZERO)),this.maximum=m.clone(y(t,m.ZERO)),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}Nc.fromCorners=function(e,t,n){return l(n)||(n=new Nc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};Nc.fromPoints=function(e,t){if(l(t)||(t=new Nc),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let h=1;h0?Ht.INSIDE:r+o<0?Ht.OUTSIDE:Ht.INTERSECTING};Nc.prototype.clone=function(e){return Nc.clone(this,e)};Nc.prototype.intersectPlane=function(e){return Nc.intersectPlane(this,e)};Nc.prototype.equals=function(e){return Nc.equals(this,e)};var Y0=Nc;var RY=new se;function lf(e,t){t=y(t,ne.default),e=t.scaleToGeodeticSurface(e);let n=vt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(M.getColumn(n,0,RY)),this._yAxis=m.fromCartesian4(M.getColumn(n,1,RY));let i=m.fromCartesian4(M.getColumn(n,2,RY));this._plane=an.fromPointNormal(e,i)}Object.defineProperties(lf.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var iXe=new Y0;lf.fromPoints=function(e,t){let n=Y0.fromPoints(e,iXe);return new lf(n.center,t)};var qte=new pn,HN=new m;lf.prototype.projectPointOntoPlane=function(e,t){let n=qte;n.origin=e,m.normalize(e,n.direction);let i=qn.rayPlane(n,this._plane,HN);if(l(i)||(m.negate(n.direction,n.direction),i=qn.rayPlane(n,this._plane,HN)),l(i)){let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new D(r,s)}};lf.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o0?0:v.latitude,R=he.fromRadians(F,e.north,n,pXe),E=he.fromRadians(e.west,e.north,n,bXe),X=he.fromRadians(e.west,b,n,gXe),A=he.fromRadians(e.west,e.south,n,yXe),N=he.fromRadians(F,e.south,n,xXe),O=i.cartographicToCartesian(R,_Xe),U=i.cartographicToCartesian(E,tne),Y=i.cartographicToCartesian(X,TXe),k=i.cartographicToCartesian(A,nne),H=i.cartographicToCartesian(N,SXe),J=w.projectPointToNearestOnPlane(O,CXe),te=w.projectPointToNearestOnPlane(U,VXe),z=w.projectPointToNearestOnPlane(Y,LXe),j=w.projectPointToNearestOnPlane(k,RXe),ee=w.projectPointToNearestOnPlane(H,ZXe);return r=Math.min(te.x,z.x,j.x),s=-r,c=Math.max(te.y,J.y),a=Math.min(j.y,ee.y),E.height=A.height=t,U=i.cartographicToCartesian(E,tne),k=i.cartographicToCartesian(A,nne),d=Math.min(an.getPointDistance(h,U),an.getPointDistance(h,k)),u=n,$te(w.origin,w.xAxis,w.yAxis,w.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,g=e.north<0,f=p?e.south:g?e.north:0,x=ce.center(e,ene).longitude,_=m.fromRadians(x,f,n,i,GXe);_.z=0;let V=Math.abs(_.x)=c?Ht.INSIDE:Ht.INTERSECTING};var rne=new m,sne=new m,ane=new m,AXe=new m,ine=new m,MXe=new m;Ni.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,one),i=e.halfAxes,o=$.getColumn(i,0,rne),r=$.getColumn(i,1,sne),s=$.getColumn(i,2,ane),a=m.magnitude(o),c=m.magnitude(r),d=m.magnitude(s),u=!0,h=!0,p=!0;a>0?m.divideByScalar(o,a,o):u=!1,c>0?m.divideByScalar(r,c,r):h=!1,d>0?m.divideByScalar(s,d,s):p=!1;let g=!u+!h+!p,f,x,_;if(g===1){let Z=o;f=r,x=s,h?p||(Z=s,x=o):(Z=r,f=o),_=m.cross(f,x,ine),Z===o?o=_:Z===r?r=_:Z===s&&(s=_)}else if(g===2){f=o,h?f=r:p&&(f=s);let Z=m.UNIT_Y;Z.equalsEpsilon(f,W.EPSILON3)&&(Z=m.UNIT_X),x=m.cross(f,Z,AXe),m.normalize(x,x),_=m.cross(f,x,ine),m.normalize(_,_),f===o?(r=x,s=_):f===r?(s=x,o=_):f===s&&(o=x,r=_)}else g===3&&(o=m.UNIT_X,r=m.UNIT_Y,s=m.UNIT_Z);let C=MXe;C.x=m.dot(n,o),C.y=m.dot(n,r),C.z=m.dot(n,s);let V=0,L;return C.x<-a?(L=C.x+a,V+=L*L):C.x>a&&(L=C.x-a,V+=L*L),C.y<-c?(L=C.y+c,V+=L*L):C.y>c&&(L=C.y-c,V+=L*L),C.z<-d?(L=C.z+d,V+=L*L):C.z>d&&(L=C.z-d,V+=L*L),V};var NXe=new m,kXe=new m;Ni.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ga);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,rne),d=$.getColumn(a,1,sne),u=$.getColumn(a,2,ane),h=m.add(c,d,NXe);m.add(h,u,h),m.add(h,s,h);let p=m.subtract(h,t,kXe),g=m.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.add(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.subtract(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.subtract(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.add(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.add(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.subtract(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.subtract(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var UXe=new m,DXe=new m,BXe=new m;Ni.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,UXe),r=$.getColumn(i,1,DXe),s=$.getColumn(i,2,BXe);return m.clone(n,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],o,t[1]),m.subtract(t[1],r,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],o,t[2]),m.add(t[2],r,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],o,t[3]),m.add(t[3],r,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],o,t[4]),m.subtract(t[4],r,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],o,t[5]),m.subtract(t[5],r,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],o,t[6]),m.add(t[6],r,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],o,t[7]),m.add(t[7],r,t[7]),m.add(t[7],s,t[7]),t};var OXe=new $;Ni.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,OXe);return M.fromRotationTranslation(i,n,t)};var YXe=new le;Ni.isOccluded=function(e,t){let n=le.fromOrientedBoundingBox(e,YXe);return!t.isBoundingSphereVisible(n)};Ni.prototype.intersectPlane=function(e){return Ni.intersectPlane(this,e)};Ni.prototype.distanceSquaredTo=function(e){return Ni.distanceSquaredTo(this,e)};Ni.prototype.computePlaneDistances=function(e,t,n){return Ni.computePlaneDistances(this,e,t,n)};Ni.prototype.computeCorners=function(e){return Ni.computeCorners(this,e)};Ni.prototype.computeTransformation=function(e){return Ni.computeTransformation(this,e)};Ni.prototype.isOccluded=function(e){return Ni.isOccluded(this,e)};Ni.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Ni.prototype.clone=function(e){return Ni.clone(this,e)};Ni.prototype.equals=function(e){return Ni.equals(this,e)};var Gn=Ni;var _Jt=T(S(),1);var zN={};zN.getHeight=function(e,t,n){return(e-n)*t+n};var HXe=new he;zN.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,HXe);if(!l(r))return m.clone(e,o);let s=zN.getHeight(r.height,n,i);return m.fromRadians(r.longitude,r.latitude,s,t,o)};var Tr=zN;var djt=T(S(),1);var SJt=T(S(),1),kE=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; + +#ifdef EXTRUDED_GEOMETRY +in vec3 extrudeDirection; + +uniform float u_globeMinimumAltitude; +#endif // EXTRUDED_GEOMETRY + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif // PER_INSTANCE_COLOR + +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +out vec4 v_sphericalExtents; +#else // SPHERICAL +out vec2 v_inversePlaneExtents; +out vec4 v_westPlane; +out vec4 v_southPlane; +#endif // SPHERICAL +out vec3 v_uvMinAndSphericalLongitudeRotation; +out vec3 v_uMaxAndInverseDistance; +out vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES + +void main() +{ + vec4 position = czm_computePosition(); + +#ifdef EXTRUDED_GEOMETRY + float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); + delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; + + //extrudeDirection is zero for the top layer + position = position + vec4(extrudeDirection * delta, 0.0); +#endif + +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL + v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); + v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); +#else // SPHERICAL +#ifdef COLUMBUS_VIEW_2D + vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); + vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); + + // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): + // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) + // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) + // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) + vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); + bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; + planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); + planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); + + // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) + // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) + // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) + idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; + idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); + planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); + planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); + + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; + vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; + vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; +#else // COLUMBUS_VIEW_2D + // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; + vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; + vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; +#endif // COLUMBUS_VIEW_2D + + vec3 eastWard = southEastCorner - southWestCorner; + float eastExtent = length(eastWard); + eastWard /= eastExtent; + + vec3 northWard = northWestCorner - southWestCorner; + float northExtent = length(northWard); + northWard /= northExtent; + + v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); + v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); + v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); +#endif // SPHERICAL + vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); + vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); + + v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); + v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); + v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; +#endif // TEXTURE_COORDINATES + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif + + gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); +} +`;var VJt=T(S(),1),H0=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif + +void main(void) +{ +#ifdef VECTOR_TILE + out_FragColor = czm_gammaCorrect(u_highlightColor); +#else + out_FragColor = vec4(1.0); +#endif + czm_writeDepthClamp(); +} +`;var RJt=T(S(),1),cne={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};cne.NUMBER_OF_CLASSIFICATION_TYPES=3;var kn=Object.freeze(cne);var EJt=T(S(),1);var zXe={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},rc=Object.freeze(zXe);var s4t=T(S(),1);var XJt=T(S(),1);function KXe(e,t){let n=[],i=e.length,o=0;for(;oZl.MaximumLatitude?e=Zl.MaximumLatitude:e<-Zl.MaximumLatitude&&(e=-Zl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Zl.MaximumLatitude=Zl.mercatorAngleToGeodeticLatitude(Math.PI);Zl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Zl.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};Zl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=Zl.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Xi=Zl;function cWe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let d=0;dr&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function uWe(e,t){let n=[];return GY(e,"geometry",t,n),GY(e,"westHemisphereGeometry",t,n),GY(e,"eastHemisphereGeometry",t,n),n}var Wp={};Wp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=dWe(e),t.length>0&&(n=Fn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=uWe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),d=new Array(o);for(let u=0;u0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};Wp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s0){let G=_.length/C;for(Z=Ae.createTypedArray(G,x),i=0;i= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; + gl_Position *= show; +}`,`${i} +${o}`};function pne(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",d=`in ${a} ${c};`,u="",h="";if(i){u+=`vec2 st; +`;let f=s>1?`${c}.x`:c;h+=` st = czm_decompressTextureCoordinates(${f}); +`}n&&o&&r?(u+=`vec3 normal; +vec3 tangent; +vec3 bitangent; +`,h+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); +`):(n&&(u+=`vec3 normal; +`,h+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); +`),o&&(u+=`vec3 tangent; +`,h+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`),r&&(u+=`vec3 bitangent; +`,h+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=De.replaceMain(p,"czm_non_compressed_main");let g=`void main() +{ +${h} czm_non_compressed_main(); +}`;return[d,u,p,g].join(` +`)}function RWe(e){let t=De.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + gl_Position = czm_depthClamp(gl_Position);} +`,t}function ZWe(e){let t=De.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + #if defined(LOG_DEPTH) + czm_writeLogDepth(); + #else + czm_writeDepthClamp(); + #endif +} +`,t}function bne(e,t){let n=e.vertexAttributes}function GWe(e,t){return function(){return e[t]}}var EY=Math.max(Bt.hardwareConcurrency-1,1),KN,EWe=new gi("combineGeometry");function IWe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Sr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],d=[];for(o=0;o0){let x=new Float64Array(h);for(f=[x.buffer],r=0;r0?(e._recomputeBoundingSpheres=!0,e._state=Sr.COMBINED):OE(e,t,Sr.FAILED,void 0)}).catch(function(h){OE(e,t,Sr.FAILED,h)})}}function XWe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a0?(e._recomputeBoundingSpheres=!0,e._state=Sr.COMBINED):OE(e,t,Sr.FAILED,void 0)}function WWe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i0||le.intersectPlane(x,an.ORIGIN_ZX_PLANE)!==Ht.INTERSECTING?c.push(x):(d.push(x),u.push(x))}let h=c[0],p=u[0],g=d[0];for(i=1;i0){if(Ft.maximumVertexTextureImageUnits===0)throw new ae("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Sr.COMPLETE&&this._state!==Sr.COMBINED&&(this.asynchronous?IWe(this,e):XWe(this,e)),this._state===Sr.COMBINED&&(PWe(this,e),yne(this,e),wWe(this,e)),!this.show||this._state!==Sr.COMPLETE)return;this._batchTableOffsetsUpdated||yne(this,e),this._recomputeBoundingSpheres&&WWe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let d=n.closed&&c;o&&y(this._createRenderStatesFunction,FWe)(this,t,n,d),r&&y(this._createShaderProgramFunction,AWe)(this,e,n),(o||r)&&y(this._createCommandsFunction,MWe)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,NWe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var kWe=new le,UWe=new le;function Rne(e,t,n){if(n===sn.TOP){let i=le.clone(e,kWe),o=le.clone(e,UWe);o.center=m.add(o.center,t,o.center),e=le.union(i,o,e)}else n===sn.ALL&&(e.center=m.add(e.center,t,e.center));return e}function DWe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=Q.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function BWe(e,t,n,i,o){return function(r){let s=Sne(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var OWe=new m;function YWe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&Rne(i,m.fromArray(r.get(),0,OWe),e._offsetInstanceExtend[n]),l(o)&&(i=le.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function HWe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Cr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;d 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); + float useDownOrLeft = float(useUpOrRight == 0.0); + vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); + vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); + return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; +} +#endif // NORMAL_EC + +void main(void) +{ +#ifdef REQUIRES_EC + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +#endif + +#ifdef REQUIRES_WC + vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; + vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +#endif + +#ifdef TEXTURE_COORDINATES + vec2 uv; +#ifdef SPHERICAL + // Treat world coords as a sphere normal for spherical coordinates + vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); + sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; + sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); + uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; + uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; +#else // SPHERICAL + // Unpack planes and transform to eye space + uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; + uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; +#endif // SPHERICAL +#endif // TEXTURE_COORDINATES + +#ifdef PICK +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + // Check for logDepthOrDepth != 0.0 to make sure this should be classified. + if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { + out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource + czm_writeDepthClamp(); + } +#else // CULL_FRAGMENTS + out_FragColor.a = 1.0; +#endif // CULL_FRAGMENTS +#else // PICK + +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { + discard; + } +#endif + +#ifdef NORMAL_EC + // Compute normal by sampling adjacent pixels in 2x2 block in screen space + vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); + vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); + vec3 normalEC = normalize(cross(leftRight, downUp)); +#endif + + +#ifdef PER_INSTANCE_COLOR + + vec4 color = czm_gammaCorrect(v_color); +#ifdef FLAT + out_FragColor = color; +#else // FLAT + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = -eyeCoordinate.xyz; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; + + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + +#else // PER_INSTANCE_COLOR + + // Material support. + // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or + // dependencies for culling but might not actually be used by the material. + + czm_materialInput materialInput; + +#ifdef USES_NORMAL_EC + materialInput.normalEC = normalEC; +#endif + +#ifdef USES_POSITION_TO_EYE_EC + materialInput.positionToEyeEC = -eyeCoordinate.xyz; +#endif + +#ifdef USES_TANGENT_TO_EYE + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +#endif + +#ifdef USES_ST + // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired + // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. + // Shader is provided a set of reference points for remapping. + materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; + materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +#endif + + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else // FLAT + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + +#endif // PER_INSTANCE_COLOR + czm_writeDepthClamp(); +#endif // PICK +} +`;function Vu(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new XY;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new XY;if(o.requiresTextureCoordinates=e,n instanceof ln)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Vu.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof ln&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof ln||(o=t.material.shaderSource),new De({defines:i,sources:[o,nC]})};Vu.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new De({defines:n,sources:[nC],pickColorQualifier:"in"})};Vu.prototype.createVertexShader=function(e,t,n,i){return vne(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Vu.prototype.createPickVertexShader=function(e,t,n,i){return vne(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Zne=new m,Gne=new he,Ene={high:0,low:0};function vne(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let d=Gne;d.longitude=W.PI,d.latitude=0,d.height=0;let u=s.project(d,Zne),h=On.encode(u.x,Ene);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`;let p=Gne;p.longitude=-W.PI,p.latitude=0,p.height=0;let g=s.project(p,Zne);h=On.encode(g.x,Ene),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof ln&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new De({defines:c,sources:[o]})}function XY(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(XY.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function Ine(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/D.distance(t,e)}var KWe=[new D,new D,new D,new D];function wne(e,t){let n=KWe,i=D.unpack(t,0,n[0]),o=D.unpack(t,2,n[1]),r=D.unpack(t,4,n[2]);e.uMaxVmax=new sc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Ine(i,o,r),a=1/Ine(i,r,o);e.uvMinAndExtents=new sc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Fne=new he,Ane=new m,JWe=new m,QWe=new m,JN={high:0,low:0};function Mne(e,t,n){let i=Fne;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,Ane);i.latitude=e.north;let r=t.project(i,JWe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,QWe),a=[0,0,0,0],c=[0,0,0,0],d=On.encode(o.x,JN);a[0]=d.high,c[0]=d.low,d=On.encode(o.y,JN),a[1]=d.high,c[1]=d.low,d=On.encode(r.y,JN),a[2]=d.high,c[2]=d.low,d=On.encode(s.x,JN),a[3]=d.high,c[3]=d.low,n.planes2D_HIGH=new sc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new sc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var jWe=new M,qWe=new M,Xne=new m,$We=new he,e2e=[new he,new he,new he,new he,new he,new he,new he,new he];function t2e(e,t,n,i,o,r){let s=ce.center(e,$We);s.height=n;let a=he.toCartesian(s,t,Xne),c=vt.eastNorthUpToFixedFrame(a,t,jWe),d=M.inverse(c,qWe),u=e.west,h=e.east,p=e.north,g=e.south,f=e2e;f[0].latitude=g,f[0].longitude=u,f[1].latitude=p,f[1].longitude=u,f[2].latitude=p,f[2].longitude=h,f[3].latitude=g,f[3].longitude=h;let x=(u+h)*.5,_=(p+g)*.5;f[4].latitude=g,f[4].longitude=x,f[5].latitude=p,f[5].longitude=x,f[6].latitude=_,f[6].longitude=u,f[7].latitude=_,f[7].longitude=h;let C=Number.POSITIVE_INFINITY,V=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY;for(let P=0;P<8;P++){f[P].height=n;let w=he.toCartesian(f[P],t,Xne);M.multiplyByPoint(d,w,w),w.z=0,C=Math.min(C,w.x),V=Math.max(V,w.x),L=Math.min(L,w.y),Z=Math.max(Z,w.y)}let G=i;G.x=C,G.y=L,G.z=0,M.multiplyByPoint(c,G,G);let I=o;I.x=V,I.y=L,I.z=0,M.multiplyByPoint(c,I,I),m.subtract(I,G,o);let v=r;v.x=C,v.y=Z,v.z=0,M.multiplyByPoint(c,v,v),m.subtract(v,G,r)}var n2e=new m,i2e=new m,o2e=new On;Vu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=Ane,s=n2e,a=i2e;t2e(e,n,y(o,0),r,s,a);let c={};wne(c,t);let d=On.fromCartesian(r,o2e);return c.southWest_HIGH=new sc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(d.high,[0,0,0])}),c.southWest_LOW=new sc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(d.low,[0,0,0])}),c.eastward=new sc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),c.northward=new sc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),Mne(e,i,c),c};var r2e=new m;function Wne(e,t,n,i){let o=Fne;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,r2e),s=Math.sqrt(r.x*r.x+r.y*r.y),a=W.fastApproximateAtan2(s,r.z),c=W.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var Pne=new D;Vu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=Wne(e.south,e.west,n,Pne),r=o.x,s=o.y,a=Wne(e.north,e.east,n,Pne),c=a.x,d=a.y,u=0;s>d&&(u=W.PI-s,s=-W.PI,d+=u),r-=W.EPSILON5,s-=W.EPSILON5,c+=W.EPSILON5,d+=W.EPSILON5;let h=1/(d-s),p=1/(c-r),g={sphericalExtents:new sc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new sc({componentDatatype:Q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return wne(g,t),Mne(e,i,g),g};Vu.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Vu.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function s2e(e){return Math.max(e.width,e.height)>Vu.MAX_WIDTH_FOR_PLANAR_EXTENTS}Vu.shouldUseSphericalCoordinates=function(e){return s2e(e)};Vu.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var fd=Vu;var M4t=T(S(),1);var X4t=T(S(),1);var a2e={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},Un=Object.freeze(a2e);var v4t=T(S(),1);var c2e={ZERO:ie.ZERO,KEEP:ie.KEEP,REPLACE:ie.REPLACE,INCREMENT:ie.INCR,DECREMENT:ie.DECR,INVERT:ie.INVERT,INCREMENT_WRAP:ie.INCR_WRAP,DECREMENT_WRAP:ie.DECR_WRAP},mt=Object.freeze(c2e);var QN={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};QN.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Un.ALWAYS,frontOperation:{fail:mt.KEEP,zFail:mt.KEEP,zPass:mt.REPLACE},backFunction:Un.ALWAYS,backOperation:{fail:mt.KEEP,zFail:mt.KEEP,zPass:mt.REPLACE},reference:QN.CESIUM_3D_TILE_MASK,mask:QN.CESIUM_3D_TILE_MASK}};var Ut=Object.freeze(QN);function Zx(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Zx.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Zx.isSupported=function(e){return e.context.stencilBuffer};function iC(e,t){let n=t?Un.EQUAL:Un.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:mt.KEEP,zFail:mt.DECREMENT_WRAP,zPass:mt.KEEP},backFunction:n,backOperation:{fail:mt.KEEP,zFail:mt.INCREMENT_WRAP,zPass:mt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:rc.LESS_OR_EQUAL},depthMask:!1}}function PY(e){return{stencilTest:{enabled:e,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:mt.ZERO,zFail:mt.ZERO,zPass:mt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:mt.ZERO,zFail:mt.ZERO,zPass:mt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var l2e={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:mt.ZERO,zFail:mt.ZERO,zPass:mt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:mt.ZERO,zFail:mt.ZERO,zPass:mt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function d2e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ue.fromCache(iC(o,!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(iC(o,!0)),e._rsColorPass=Ue.fromCache(PY(o,!1)),e._rsPickPass=Ue.fromCache(l2e)}function u2e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; +`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=De.replaceMain(s,"czm_non_compressed_main");let a=`void main() +{ +${r} czm_non_compressed_main(); +}`;return[i,o,s,a].join(` +`)}}function m2e(e,t){let n=t.context,i=e._primitive,o=kE;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=u2e(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new De({defines:[a],sources:[o]}),d=new De({sources:[H0]}),u=e._primitive._attributeLocations,h=new fd(s,r,e.appearance);if(e._spStencil=$t.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=De.createPickVertexShaderSource(o);f=In._appendShowToShader(i,f),f=In._updatePickColorAttribute(f);let x=h.createPickFragmentShader(!1),_=h.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=$t.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let V=h.createPickFragmentShader(!0),L=h.createPickVertexShader([a],f,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:L,fragmentShaderSource:V,attributeLocations:u})}e._spPick2D=C}}else e._spPick=$t.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=In._appendShowToShader(i,o),c=new De({defines:[a],sources:[o]}),e._sp=$t.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=h.createFragmentShader(!1),g=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=$t.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let x=h.createFragmentShader(!0),_=h.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u})}e._spColor2D=f}}function h2e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o0&&(c=o[0].attributes,p=fd.hasAttributesForSphericalExtents(c),g=fd.hasAttributesForTextureCoordinatePlanes(c),h=c.color),s=0;s{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Zx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Zx.prototype.isDestroyed=function(){return!1};Zx.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,me(this)};var oC=Zx;var g2e={u_globeMinimumAltitude:function(){return 55e3}};function Gl(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Gl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Gl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Gl.prototype.isDestroyed=function(){return!1};Gl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};Gl._supportsMaterials=function(e){return e.depthTexture};Gl.supportsMaterials=function(e){return Gl._supportsMaterials(e.frameState.context)};var kc=Gl;var wjt=T(S(),1);function rC(){pe.throwInstantiationError()}Object.defineProperties(rC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});rC.prototype.getType=pe.throwInstantiationError;rC.prototype.getValue=pe.throwInstantiationError;rC.prototype.equals=pe.throwInstantiationError;var R2e=new q;rC.getValue=function(e,t,n){let i;return l(e)||(e=q.now(R2e)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Hi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Hi.ColorType)&&(n=Hi.fromType(Hi.ColorType)),B.clone(B.WHITE,n.uniforms.color),n)};var qo=rC;function Gx(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Gx.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!K.getValueOrDefault(t.show,n,!0)};Gx.prototype._setOptions=pe.throwInstantiationError;Gx.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof Dt,h,p=t._getIsClosed(c);if(u)h=new ln({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=qo.getValue(e,d,this._material);this._material=g,h=new ao({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=ln.VERTEX_FORMAT,this._primitive=o.add(new kc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),K.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=h.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);u&&(h.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:g,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let d=this._geometryUpdater.createOutlineGeometryInstance(e),u=K.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:d,appearance:new ln({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};Gx.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(le.clone(o.boundingSphere,e),lt.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(le.clone(o.boundingSphere,e),lt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?lt.PENDING:lt.FAILED};Gx.prototype.isDestroyed=function(){return!1};Gx.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),me(this)};var ii=Gx;var Ttn=T(S(),1);var otn=T(S(),1);var jjt=T(S(),1),Z2e={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Pp=Object.freeze(Z2e);var i6t=T(S(),1);var Y8t=T(S(),1);var $jt=T(S(),1),G2e={NONE:0,GEODESIC:1,RHUMB:2},en=Object.freeze(G2e);var o8t=T(S(),1);var One=W.EPSILON10;function E2e(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,d,u=0,h=-1;for(s=1;sW.EPSILON12);let R=F*(t*t-n*n)/(n*n),E=1+R*(4096+R*(R*(320-175*R)-768))/16384,X=R*(256+R*(R*(74-47*R)-128))/1024,A=b*b,N=X*w*(b+X*(P*(2*A-1)-X*b*(4*w*w-3)*(4*A-3)/6)/4),O=n*E*(v-N),U=Math.atan2(g*I,_-V*G),Y=Math.atan2(h*I,_*G-V);e._distance=O,e._startHeading=U,e._endHeading=Y,e._uSquared=R}var P2e=new m,FY=new m;function Hne(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,FY),P2e),r=m.normalize(i.cartographicToCartesian(n,FY),FY);W2e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,I2e(e)}function YE(e,t,n){let i=y(n,ne.default);this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Hne(this,e,t,i)}Object.defineProperties(YE.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});YE.prototype.setEndPoints=function(e,t){Hne(this,e,t,this._ellipsoid)};YE.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};YE.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),h=i*i,p=i*h,g=n.u8Over256,f=n.u2Over4,x=n.u6Over64,_=n.u4Over16,C=2*p*g*o/3+i*(1-f+7*_/4-15*x/4+579*g/64-(_-15*x/4+187*g/16)*o-(5*x/4-115*g/16)*r-29*g*s/16)+(f/2-_+71*x/32-85*g/16)*a+(5*_/16-5*x/4+383*g/96)*c-h*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*d+539*g*u/1536,V=Math.asin(Math.sin(C)*n.cosineAlpha),L=Math.atan(n.a/n.b*Math.tan(V));C=C-n.sigma;let Z=Math.cos(2*n.sigma+C),G=Math.sin(C),I=Math.cos(C),v=n.cosineU*I,P=n.sineU*G,F=Math.atan2(G*n.sineHeading,v-P*n.cosineHeading)-Yne(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,G,I,Z);return l(t)?(t.longitude=this._start.longitude+F,t.latitude=L,t.height=0,t):new he(this._start.longitude+F,L,0)};var vp=YE;var _8t=T(S(),1);function MY(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,d=n,u=Math.sin(2*d),h=Math.sin(4*d),p=Math.sin(6*d),g=Math.sin(8*d),f=Math.sin(10*d),x=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*x)}function v2e(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,d=c*c,u=d*c,h=u*c,p=h*c,g=p*c,f=Math.sin(2*i),x=Math.cos(2*i),_=Math.sin(4*i),C=Math.cos(4*i),V=Math.sin(6*i),L=Math.cos(6*i),Z=Math.sin(8*i),G=Math.cos(8*i),I=Math.sin(10*i),v=Math.cos(10*i),P=Math.sin(12*i);return i+i*c/4+7*i*d/64+15*i*u/256+579*i*h/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*x+(21*i*u/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*C+(151*i*h/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*L+(1097*i*p/65536+42783*i*g/1048576)*G+8011*i*g/1048576*v+(3*c/8+3*d/16+213*u/2048-3*o*u/64+255*h/4096-33*o*h/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*f+(21*d/256+21*u/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*_+(151*u/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*V+(1097*h/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*Z+(8011*p/2621440+8011*g/1048576)*I+293393*g/251658240*P}function sC(e,t){if(e===0)return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function w2e(e,t,n,i,o){let r=sC(e._ellipticity,n),s=sC(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function F2e(e,t,n,i,o,r,s){let a=e._heading,c=r-i,d=0;if(W.equalsEpsilon(Math.abs(a),W.PI_OVER_TWO,W.EPSILON8))if(t===n)d=t*Math.cos(o)*W.negativePiToPi(c);else{let u=Math.sin(o);d=t*Math.cos(o)*W.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=MY(e._ellipticity,t,o);d=(MY(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var A2e=new m,AY=new m;function zne(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,AY),A2e),r=m.normalize(i.cartographicToCartesian(n,AY),AY),s=i.maximumRadius,a=i.minimumRadius,c=s*s,d=a*a;e._ellipticitySquared=(c-d)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=w2e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=F2e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Kne(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,c,d;if(Math.abs(W.PI_OVER_TWO-Math.abs(t))>W.EPSILON8){let u=MY(o,i,e.latitude),h=n*Math.cos(t),p=u+h;if(c=v2e(p,o,i),Math.abs(t)0?a=W.negativePiToPi(e.longitude+d):a=W.negativePiToPi(e.longitude-d)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new he(a,c,0)}function wp(e,t,n){let i=y(n,ne.default);this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&zne(this,e,t,i)}Object.defineProperties(wp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});wp.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,ne.default),s=r.maximumRadius,a=r.minimumRadius,c=s*s,d=a*a,u=Math.sqrt((c-d)/c);t=W.negativePiToPi(t);let h=Kne(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new wp(e,h,r):(o.setEndPoints(e,h),o)};wp.prototype.setEndPoints=function(e,t){zne(this,e,t,this._ellipsoid)};wp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};wp.prototype.interpolateUsingSurfaceDistance=function(e,t){return Kne(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};wp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=W.negativePiToPi(e),W.equalsEpsilon(Math.abs(e),Math.PI,W.EPSILON14)&&(e=W.sign(r.longitude)*Math.PI),l(t)||(t=new he),Math.abs(W.PI_OVER_TWO-o)<=W.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(W.equalsEpsilon(Math.abs(W.PI_OVER_TWO-o),W.PI_OVER_TWO,W.EPSILON8))return W.equalsEpsilon(e,r.longitude,W.EPSILON12)?void 0:(t.longitude=e,t.latitude=W.PI_OVER_TWO*W.sign(W.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(W.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,h;do{h=u;let p=n*Math.sin(h),g=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(g/d,n/2))-W.PI_OVER_TWO}while(!W.equalsEpsilon(u,h,W.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};wp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(W.equalsEpsilon(Math.abs(i),W.PI_OVER_TWO,W.EPSILON8))return;let r=sC(n,o.latitude),s=sC(n,e),a=Math.tan(i)*(s-r),c=W.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Wa=wp;var HY=[Ei,Xi],M2e=HY.length,fie=Math.cos(W.toRadians(30)),Jne=Math.cos(W.toRadians(150)),pie=0,bie=1e3;function K0(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,en.GEODESIC),this._ellipsoid=ne.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(K0.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});K0.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;ifie||rW.PI_OVER_TWO&&(a=!0,s=m.subtract(r,n,iie),d=c.cartesianToCartographic(s,nie)),d.height=0;let u=e.project(d,o);return o=m.subtract(u,i,o),o.z=0,o=m.normalize(o,o),a&&m.negate(o,o),o}var oPe=new m,oie=new m;function rie(e,t,n,i,o,r){let s=m.subtract(t,e,oPe);m.normalize(s,s);let a=n-pie,c=m.multiplyByScalar(s,a,oie);m.add(e,c,o);let d=i-bie;c=m.multiplyByScalar(s,d,oie),m.add(t,c,r)}var rPe=new m;function e5(e,t){let n=an.getPointDistance(t5,e),i=an.getPointDistance(t5,t),o=rPe;W.equalsEpsilon(n,0,W.EPSILON2)?(o=Fp(t,e,o),m.multiplyByScalar(o,W.EPSILON2,o),m.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=Fp(e,t,o),m.multiplyByScalar(o,W.EPSILON2,o),m.add(t,o,t))}function sPe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(W.equalsEpsilon(n,W.PI,W.EPSILON11)){let o=W.sign(t.longitude);return e.longitude=o*(n-W.EPSILON11),1}else if(W.equalsEpsilon(i,W.PI,W.EPSILON11)){let o=W.sign(e.longitude);return t.longitude=o*(i-W.EPSILON11),2}return 0}var yie=new he,xie=new he,sie=new m,DY=new m,aie=new m,cie=new m,aPe=new m,lie=new m,cPe=[yie,xie],lPe=new ce,dPe=new m,uPe=new m,mPe=new m,hPe=new m,fPe=new m,pPe=new m,BY=new m,OY=new m,bPe=new m,gPe=new m,yPe=new m,die=new m,xPe=new m,_Pe=new m,TPe=new On,SPe=new On,uie=new m,CPe=new m,mie=new m,VPe=[new le,new le],_ie=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],hie=_ie.length;function LPe(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,h=u*8,p=h*4,g=u*36,f=h>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(h*3),_=new Float32Array(p),C=new Float32Array(p),V=new Float32Array(p),L=new Float32Array(p),Z=new Float32Array(p),G,I,v,P;s&&(G=new Float32Array(p),I=new Float32Array(p),v=new Float32Array(p),P=new Float32Array(h*2));let w=r.length/2,F=0,b=yie;b.height=0;let R=xie;R.height=0;let E=sie,X=DY;if(s)for(c=0,a=1;afie?(gt=HE(t,b,Be,it,BY),Ne=HE(t,R,j,Gt,OY)):pi===1?(Ne=HE(t,R,j,Gt,OY),gt.x=0,gt.y=W.sign(b.longitude-Math.abs(R.longitude)),gt.z=0):(gt=HE(t,b,Be,it,BY),Ne.x=0,Ne.y=W.sign(b.longitude-R.longitude),Ne.z=0)}let Kt=m.distance(ke,z),Lt=On.fromCartesian(Le,TPe),ut=m.subtract(te,Le,bPe),zn=m.normalize(ut,die),cn=m.subtract(ke,Le,gPe);cn=m.normalize(cn,cn);let be=m.cross(zn,cn,die);be=m.normalize(be,be);let Ve=m.cross(cn,Be,xPe);Ve=m.normalize(Ve,Ve);let bn=m.subtract(z,te,yPe);bn=m.normalize(bn,bn);let ht=m.cross(j,bn,_Pe);ht=m.normalize(ht,ht);let so=Kt/N,Eo=ee/N,ia=0,Gr,_s,Fe,rt=0,Ke=0;if(s){ia=m.distance(it,Gt),Gr=On.fromCartesian(it,SPe),_s=m.subtract(Gt,it,uie),Fe=m.normalize(_s,CPe);let pi=Fe.x;Fe.x=Fe.y,Fe.y=-pi,rt=ia/F,Ke=fe/F}for(O=0;O<8;O++){let pi=H+O*4,oa=Y+O*2,zr=pi+3,yl=O<4?1:-1,yo=O===2||O===3||O===6||O===7?1:-1;m.pack(Lt.high,_,pi),_[zr]=ut.x,m.pack(Lt.low,C,pi),C[zr]=ut.y,m.pack(Ve,V,pi),V[zr]=ut.z,m.pack(ht,L,pi),L[zr]=so*yl,m.pack(be,Z,pi);let Er=Eo*yo;Er===0&&yo<0&&(Er=9),Z[zr]=Er,s&&(G[pi]=Gr.high.x,G[pi+1]=Gr.high.y,G[pi+2]=Gr.low.x,G[pi+3]=Gr.low.y,v[pi]=-gt.y,v[pi+1]=gt.x,v[pi+2]=Ne.y,v[pi+3]=-Ne.x,I[pi]=_s.x,I[pi+1]=_s.y,I[pi+2]=Fe.x,I[pi+3]=Fe.y,P[oa]=rt*yl,Er=Ke*yo,Er===0&&yo<0&&(Er=9),P[oa+1]=Er)}let Qe=mPe,ft=hPe,Ot=dPe,Cn=uPe,Io=ce.fromCartographicArray(cPe,lPe),So=di.getMinimumMaximumHeights(Io,d),za=So.minimumTerrainHeight,Ka=So.maximumTerrainHeight;Te+=Math.abs(za),Te+=Math.abs(Ka),rie(Le,ke,za,Ka,Qe,Ot),rie(te,z,za,Ka,ft,Cn);let Ci=m.multiplyByScalar(be,W.EPSILON5,mie);m.add(Qe,Ci,Qe),m.add(ft,Ci,ft),m.add(Ot,Ci,Ot),m.add(Cn,Ci,Cn),e5(Qe,ft),e5(Ot,Cn),m.pack(Qe,x,k),m.pack(ft,x,k+3),m.pack(Cn,x,k+6),m.pack(Ot,x,k+9),Ci=m.multiplyByScalar(be,-2*W.EPSILON5,mie),m.add(Qe,Ci,Qe),m.add(ft,Ci,ft),m.add(Ot,Ci,Ot),m.add(Cn,Ci,Cn),e5(Qe,ft),e5(Ot,Cn),m.pack(Qe,x,k+12),m.pack(ft,x,k+15),m.pack(Cn,x,k+18),m.pack(Ot,x,k+21),U+=2,c+=3,Y+=16,k+=24,H+=32,ee+=Kt,fe+=ia}c=0;let de=0;for(a=0;a halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } + + // Check distance of the eye coordinate against start and end planes with normals in the right plane. + // For computing unskewed lengthwise texture coordinate. + // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. + + // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" + vec3 alignedPlaneNormal; + + // start aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); + + // end aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); + +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Clamp - distance to aligned planes may be negative due to mitering, + // so fragment texture coordinate might be out-of-bounds. + float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); + s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; + float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); + + czm_materialInput materialInput; + + materialInput.s = s; + materialInput.st = vec2(s, t); + materialInput.str = vec3(s, t, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + + czm_writeDepthClamp(); +} +`;var J8t=T(S(),1),KE=`in vec3 v_forwardDirectionEC; +in vec3 v_texcoordNormalizationAndHalfWidth; +in float v_batchId; + +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#else +in vec2 v_alignedPlaneDistances; +in float v_texcoordT; +#endif + +float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { + // We don't expect the ray to ever be parallel to the plane + return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); +} + +void main(void) +{ + vec4 eyeCoordinate = gl_FragCoord; + eyeCoordinate /= eyeCoordinate.w; + +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Use distances for planes aligned with segment to prevent skew in dashing + float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); + float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); + + // Clamp - distance to aligned planes may be negative due to mitering + distanceFromStart = max(0.0, distanceFromStart); + distanceFromEnd = max(0.0, distanceFromEnd); + + float s = distanceFromStart / (distanceFromStart + distanceFromEnd); + s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; + + czm_materialInput materialInput; + + materialInput.s = s; + materialInput.st = vec2(s, v_texcoordT); + materialInput.str = vec3(s, v_texcoordT, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR +} +`;var j8t=T(S(),1),JE=`in vec3 position3DHigh; +in vec3 position3DLow; + +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; + +in float batchId; + +out vec3 v_forwardDirectionEC; +out vec3 v_texcoordNormalizationAndHalfWidth; +out float v_batchId; + +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#else +out vec2 v_alignedPlaneDistances; +out float v_texcoordT; +#endif + +// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. +// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. +void main() +{ + v_batchId = batchId; + + // Start position + vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); + vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); + vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; + + // Start plane + vec4 startPlane2D; + vec4 startPlane3D; + startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); + startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); + + // Right plane + vec4 rightPlane2D; + vec4 rightPlane3D; + rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); + rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); + + // End position + posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); + posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); + posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; + vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); + vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); + + // End plane + vec4 endPlane2D; + vec4 endPlane3D; + endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); + endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); + + // Forward direction + v_forwardDirectionEC = normalize(endEC - startEC); + + vec2 cleanTexcoordNormalization2D; + cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); + cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); + vec2 cleanTexcoordNormalization3D; + cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; + cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); + + v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#else // PER_INSTANCE_COLOR + // For computing texture coordinates + + v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); + v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); +#endif // PER_INSTANCE_COLOR + +#ifdef WIDTH_VARYING + float width = czm_batchTable_width(batchId); + float halfWidth = width * 0.5; + v_width = width; + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#else + float halfWidth = 0.5 * czm_batchTable_width(batchId); + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#endif + + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + // Since this is morphing, compute both 3D and 2D positions and then blend. + + // ****** 3D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); + vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Nudge the top vertex upwards to prevent flickering + vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); + geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc3D.xyz += geodeticSurfaceNormal; + + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); + + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + + // ****** 2D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition + absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); + absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); + planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); + upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Nudge the top vertex upwards to prevent flickering + geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); + geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc2D.xyz += geodeticSurfaceNormal; + + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(texcoordNormalization2D.x); +#ifndef PER_INSTANCE_COLOR + // Use vertex's sidedness to compute its texture coordinate. + v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); +#endif + + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + + // Blend for actual position + gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); + +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif +} +`;var $8t=T(S(),1),QE=`in vec3 position3DHigh; +in vec3 position3DLow; + +// In 2D and in 3D, texture coordinate normalization component signs encodes: +// * X sign - sidedness relative to right plane +// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume +#ifndef COLUMBUS_VIEW_2D +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +#else +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +#endif + +in float batchId; + +out vec4 v_startPlaneNormalEcAndHalfWidth; +out vec4 v_endPlaneNormalEcAndBatchId; +out vec4 v_rightPlaneEC; +out vec4 v_endEcAndStartEcX; +out vec4 v_texcoordNormalizationAndStartEcYZ; + +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif + +void main() +{ +#ifdef COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; + + vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); + vec3 ecEnd = forwardDirectionEC + ecStart; + forwardDirectionEC = normalize(forwardDirectionEC); + + // Right plane + v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + + v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); + v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; + +#else // COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; + vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); + vec3 ecEnd = ecStart + offset; + + vec3 forwardDirectionEC = normalize(offset); + + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + + // Right plane + v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + + v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; + +#endif // COLUMBUS_VIEW_2D + + v_endEcAndStartEcX.xyz = ecEnd; + v_endEcAndStartEcX.w = ecStart.x; + v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif // PER_INSTANCE_COLOR + + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + vec4 positionRelativeToEye = czm_computePosition(); + + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); + vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Extrude bottom vertices downward for far view distances, like for GroundPrimitives + upOrDown = cross(forwardDirectionEC, normalEC); + upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; + upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; + upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; + positionEC.xyz += upOrDown; + + v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); + + // Determine distance along normalEC to push for a volume of appropriate width. + // Make volumes about double pixel width for a conservative fit - in practice the + // extra cost here is minimal compared to the loose volume heights. + // + // N = normalEC (guaranteed "right-facing") + // R = rightEC + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + float width = czm_batchTable_width(batchId); +#ifdef WIDTH_VARYING + v_width = width; +#endif + + v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; + v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; + + v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; + v_endPlaneNormalEcAndBatchId.w = batchId; + + width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R + width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N + + // Determine if this vertex is on the "left" or "right" +#ifdef COLUMBUS_VIEW_2D + normalEC *= sign(texcoordNormalization2D.x); +#else + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +#endif + + positionEC.xyz += width * normalEC; + gl_Position = czm_depthClamp(czm_projection * positionEC); + +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif +} +`;var m7t=T(S(),1);var t7t=T(S(),1),jE=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec4 color; +in float batchId; + +out vec4 v_color; + +void main() +{ + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; + + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); + + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; + + v_color = color; +} +`;var i7t=T(S(),1),pd=`void clipLineSegmentToNearPlane( + vec3 p0, + vec3 p1, + out vec4 positionWC, + out bool clipped, + out bool culledByNearPlane, + out vec4 clippedPositionEC) +{ + culledByNearPlane = false; + clipped = false; + + vec3 p0ToP1 = p1 - p0; + float magnitude = length(p0ToP1); + vec3 direction = normalize(p0ToP1); + + // Distance that p0 is behind the near plane. Negative means p0 is + // in front of the near plane. + float endPoint0Distance = czm_currentFrustum.x + p0.z; + + // Camera looks down -Z. + // When moving a point along +Z: LESS VISIBLE + // * Points in front of the camera move closer to the camera. + // * Points behind the camrea move farther away from the camera. + // When moving a point along -Z: MORE VISIBLE + // * Points in front of the camera move farther away from the camera. + // * Points behind the camera move closer to the camera. + + // Positive denominator: -Z, becoming more visible + // Negative denominator: +Z, becoming less visible + // Nearly zero: parallel to near plane + float denominator = -direction.z; + + if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) + { + // p0 is behind the near plane and the line to p1 is nearly parallel to + // the near plane, so cull the segment completely. + culledByNearPlane = true; + } + else if (endPoint0Distance > 0.0) + { + // p0 is behind the near plane, and the line to p1 is moving distinctly + // toward or away from it. + + // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) + float t = endPoint0Distance / denominator; + if (t < 0.0 || t > magnitude) + { + // Near plane intersection is not between the two points. + // We already confirmed p0 is behind the naer plane, so now + // we know the entire segment is behind it. + culledByNearPlane = true; + } + else + { + // Segment crosses the near plane, update p0 to lie exactly on it. + p0 = p0 + t * direction; + + // Numerical noise might put us a bit on the wrong side of the near plane. + // Don't let that happen. + p0.z = min(p0.z, -czm_currentFrustum.x); + + clipped = true; + } + } + + clippedPositionEC = vec4(p0, 1.0); + positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); +} + +vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) +{ + // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. + +#ifdef POLYLINE_DASH + // Compute the window coordinates of the points. + vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); + vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); + vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); + + // Determine the relative screen space direction of the line. + vec2 lineDir; + if (usePrevious) { + lineDir = normalize(positionWindow.xy - previousWindow.xy); + } + else { + lineDir = normalize(nextWindow.xy - positionWindow.xy); + } + angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) + + // Quantize the angle so it doesn't change rapidly between segments. + angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +#endif + + vec4 clippedPrevWC, clippedPrevEC; + bool prevSegmentClipped, prevSegmentCulled; + clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); + + vec4 clippedNextWC, clippedNextEC; + bool nextSegmentClipped, nextSegmentCulled; + clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); + + bool segmentClipped, segmentCulled; + vec4 clippedPositionWC, clippedPositionEC; + clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); + + if (segmentCulled) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + + vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); + vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); + + // If a segment was culled, we can't use the corresponding direction + // computed above. We should never see both of these be true without + // \`segmentCulled\` above also being true. + if (prevSegmentCulled) + { + directionToPrevWC = -directionToNextWC; + } + else if (nextSegmentCulled) + { + directionToNextWC = -directionToPrevWC; + } + + vec2 thisSegmentForwardWC, otherSegmentForwardWC; + if (usePrevious) + { + thisSegmentForwardWC = -directionToPrevWC; + otherSegmentForwardWC = directionToNextWC; + } + else + { + thisSegmentForwardWC = directionToNextWC; + otherSegmentForwardWC = -directionToPrevWC; + } + + vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); + + vec2 leftWC = thisSegmentLeftWC; + float expandWidth = width * 0.5; + + // When lines are split at the anti-meridian, the position may be at the + // same location as the next or previous position, and we need to handle + // that to avoid producing NaNs. + if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) + { + vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); + + vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; + float leftSumLength = length(leftSumWC); + leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); + + // The sine of the angle between the two vectors is given by the formula + // |a x b| = |a||b|sin(theta) + // which is + // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); + // Because the z components of both vectors are zero, the x and y coordinate will be zero. + // Therefore, the sine of the angle is just the z component of the cross product. + vec2 u = -thisSegmentForwardWC; + vec2 v = leftWC; + float sinAngle = abs(u.x * v.y - u.y * v.x); + expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); + } + + vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; + return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; +} + +vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) +{ + vec4 positionEC = czm_modelViewRelativeToEye * position; + vec4 prevEC = czm_modelViewRelativeToEye * previous; + vec4 nextEC = czm_modelViewRelativeToEye * next; + return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); +} +`;var zY=`${pd} +${jE}`,RPe=Vx;Bt.isInternetExplorer()||(zY=`#define CLIP_POLYLINE +${zY}`);function Ix(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Ix.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,zY),this._fragmentShaderSource=y(e.fragmentShaderSource,RPe),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Ix.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Ix.VERTEX_FORMAT=Xe.POSITION_ONLY;Ix.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Ix.prototype.isTranslucent=no.prototype.isTranslucent;Ix.prototype.getRenderState=no.prototype.getRenderState;var jr=Ix;var Z7t=T(S(),1);var f7t=T(S(),1),qE=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec2 st; +in float batchId; + +out float v_width; +out vec2 v_st; +out float v_polylineAngle; + +void main() +{ + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; + + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); + + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; + + v_width = width; + v_st.s = st.s; + v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); + v_polylineAngle = angle; +} +`;var b7t=T(S(),1),Xx=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif + +in vec2 v_st; + +void main() +{ + czm_materialInput materialInput; + + vec2 st = v_st; + st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); + + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = vec3(st, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#ifdef VECTOR_TILE + out_FragColor *= u_highlightColor; +#endif + + czm_writeLogDepth(); +} +`;var KY=`${pd} +${qE}`,ZPe=Xx;Bt.isInternetExplorer()||(KY=`#define CLIP_POLYLINE +${KY}`);function Wx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Wx.VERTEX_FORMAT;this.material=l(e.material)?e.material:Hi.fromType(Hi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,KY),this._fragmentShaderSource=y(e.fragmentShaderSource,ZPe),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Wx.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH +${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Wx.VERTEX_FORMAT=Xe.POSITION_AND_ST;Wx.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Wx.prototype.isTranslucent=no.prototype.isTranslucent;Wx.prototype.getRenderState=no.prototype.getRenderState;var la=Wx;function Ap(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new la),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Tie(!1),this._renderState3DTiles=Tie(!0),this._renderStateMorph=Ue.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Ap.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});Ap.initializeTerrainHeights=function(){return di.initialize()};function GPe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(QE);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(JE);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(zE),d=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],u="",h="";l(n.material)?(h=l(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&d.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",d.push(u);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],g=new De({defines:d,sources:[s]}),f=new De({defines:p,sources:[h,c]});e._sp=$t.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:f,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let C=new De({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:f,attributeLocations:r})}e._sp2D=x;let _=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(_)){let C=new De({defines:d.concat([`MAX_TERRAIN_HEIGHT ${di._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(KE);let V=new De({defines:p,sources:[h,c]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:V,attributeLocations:r})}e._spMorph=_}function Tie(e){return Ue.fromCache({cull:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Un.EQUAL,frontOperation:{fail:mt.KEEP,zFail:mt.KEEP,zPass:mt.KEEP},backFunction:Un.EQUAL,backOperation:{fail:mt.KEEP,zFail:mt.KEEP,zPass:mt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})}function EPe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof jr?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let h=0;h{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Ap.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Ap.isSupported=function(e){return e.frameState.context.depthTexture};Ap.prototype.isDestroyed=function(){return!1};Ap.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,me(this)};var wm=Ap;var Z6t=T(S(),1);var _6t=T(S(),1);var h6t=T(S(),1);var XPe=new D(1,1),WPe=!1,PPe=B.WHITE;function aC(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(aC.prototype,{isConstant:{get:function(){return K.isConstant(this._image)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:ue("image"),repeat:ue("repeat"),color:ue("color"),transparent:ue("transparent")});aC.prototype.getType=function(e){return"Image"};var vPe=new q;aC.prototype.getValue=function(e,t){return l(e)||(e=q.now(vPe)),l(t)||(t={}),t.image=K.getValueOrUndefined(this._image,e),t.repeat=K.getValueOrClonedDefault(this._repeat,e,XPe,t.repeat),t.color=K.getValueOrClonedDefault(this._color,e,PPe,t.color),K.getValueOrDefault(this._transparent,e,WPe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};aC.prototype.equals=function(e){return this===e||e instanceof aC&&K.equals(this._image,e._image)&&K.equals(this._repeat,e._repeat)&&K.equals(this._color,e._color)&&K.equals(this._transparent,e._transparent)};var J0=aC;function wPe(e){if(e instanceof B)return new Dt(e);if(typeof e=="string"||e instanceof Ze||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new J0;return t.image=e,t}}function FPe(e,t){return ue(e,t,wPe)}var Wo=FPe;function $E(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties($E.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),dimensions:ue("dimensions"),heightReference:ue("heightReference"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});$E.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new $E(this)};$E.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Px=$E;var H6t=T(S(),1);var E6t=T(S(),1),APe={FIXED:0,INERTIAL:1},ki=Object.freeze(APe);var A6t=T(S(),1);function cC(){pe.throwInstantiationError()}Object.defineProperties(cC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});cC.prototype.getValue=pe.throwInstantiationError;cC.prototype.getValueInReferenceFrame=pe.throwInstantiationError;cC.prototype.equals=pe.throwInstantiationError;var Cie=new $;cC.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new m),n===i)return m.clone(t,o);let r=vt.computeIcrfToCentralBodyFixedMatrix(e,Cie);if(n===ki.INERTIAL)return $.multiplyByVector(r,t,o);if(n===ki.FIXED)return $.multiplyByVector($.transpose(r,Cie),t,o)};var Fm=cC;function vx(e,t){this._definitionChanged=new ge,this._value=m.clone(e),this._referenceFrame=y(t,ki.FIXED)}Object.defineProperties(vx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===ki.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var MPe=new q;vx.prototype.getValue=function(e,t){return l(e)||(e=q.now(MPe)),this.getValueInReferenceFrame(e,ki.FIXED,t)};vx.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};vx.prototype.getValueInReferenceFrame=function(e,t,n){return Fm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};vx.prototype.equals=function(e){return this===e||e instanceof vx&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Dc=vx;var $6t=T(S(),1);function eI(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(eI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),width:ue("width"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),cornerType:ue("cornerType"),granularity:ue("granularity"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});eI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new eI(this)};eI.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var wx=eI;var nqt=T(S(),1);function NPe(e){return e}function kPe(e,t){return ue(e,t,NPe)}var Bc=kPe;var lqt=T(S(),1);function tI(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(tI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),length:ue("length"),topRadius:ue("topRadius"),bottomRadius:ue("bottomRadius"),heightReference:ue("heightReference"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),slices:ue("slices"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});tI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new tI(this)};tI.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Fx=tI;var bqt=T(S(),1);function nI(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(nI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),semiMajorAxis:ue("semiMajorAxis"),semiMinorAxis:ue("semiMinorAxis"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),rotation:ue("rotation"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});nI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new nI(this)};nI.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Ax=nI;var Cqt=T(S(),1);function iI(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(iI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),radii:ue("radii"),innerRadii:ue("innerRadii"),minimumClock:ue("minimumClock"),maximumClock:ue("maximumClock"),minimumCone:ue("minimumCone"),maximumCone:ue("maximumCone"),heightReference:ue("heightReference"),fill:ue("fill"),material:Wo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),stackPartitions:ue("stackPartitions"),slicePartitions:ue("slicePartitions"),subdivisions:ue("subdivisions"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});iI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new iI(this)};iI.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Mx=iI;var Eqt=T(S(),1);function oI(e){this._definitionChanged=new ge,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(oI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),text:ue("text"),font:ue("font"),style:ue("style"),scale:ue("scale"),showBackground:ue("showBackground"),backgroundColor:ue("backgroundColor"),backgroundPadding:ue("backgroundPadding"),pixelOffset:ue("pixelOffset"),eyeOffset:ue("eyeOffset"),horizontalOrigin:ue("horizontalOrigin"),verticalOrigin:ue("verticalOrigin"),heightReference:ue("heightReference"),fillColor:ue("fillColor"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),translucencyByDistance:ue("translucencyByDistance"),pixelOffsetScaleByDistance:ue("pixelOffsetScaleByDistance"),scaleByDistance:ue("scaleByDistance"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance")});oI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new oI(this)};oI.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Am=oI;var a$t=T(S(),1);var Oqt=T(S(),1);var wqt=T(S(),1);var UPe=new m(1,1,1),DPe=m.ZERO,BPe=ve.IDENTITY;function Vie(e,t,n){this.translation=m.clone(y(e,DPe)),this.rotation=ve.clone(y(t,BPe)),this.scale=m.clone(y(n,UPe))}Vie.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&ve.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var Q0=Vie;var JY=new Q0;function rI(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(rI.prototype,{isConstant:{get:function(){return K.isConstant(this._translation)&&K.isConstant(this._rotation)&&K.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:ue("translation"),rotation:ue("rotation"),scale:ue("scale")});var OPe=new q;rI.prototype.getValue=function(e,t){return l(e)||(e=q.now(OPe)),l(t)||(t=new Q0),t.translation=K.getValueOrClonedDefault(this._translation,e,JY.translation,t.translation),t.rotation=K.getValueOrClonedDefault(this._rotation,e,JY.rotation,t.rotation),t.scale=K.getValueOrClonedDefault(this._scale,e,JY.scale,t.scale),t};rI.prototype.equals=function(e){return this===e||e instanceof rI&&K.equals(this._translation,e._translation)&&K.equals(this._rotation,e._rotation)&&K.equals(this._scale,e._scale)};var Nx=rI;var $qt=T(S(),1);function Mp(e,t){this._propertyNames=[],this._definitionChanged=new ge,l(e)&&this.merge(e,t)}Object.defineProperties(Mp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var uve=new q;dC.prototype.getValue=function(e,t){l(e)||(e=q.now(uve));let n=K.getValueOrDefault(this._heightReference,e,Je.NONE),i=K.getValueOrDefault(this._extrudedHeightReference,e,Je.NONE);if(n===Je.NONE&&!jS(i))return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Eie);if(!l(r)||m.equals(r,m.ZERO)||!l(o.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,r,W.EPSILON10))return m.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=m.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return m.multiplyByScalar(s,this._terrainHeight,t)};dC.prototype.isDestroyed=function(){return!1};dC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),me(this)};var Bx=dC;function mve(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new km(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Bx(this._scene,s,r)}}var Dp=mve;var Iie=m.ZERO,Xie=new m,hve=new m,Wie=new B;function fve(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function bd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new fve(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(bd.prototype=Object.create(oi.prototype),bd.prototype.constructor=bd);Object.defineProperties(bd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});bd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Nn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Dt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Wie)),l(a)||(a=B.WHITE),s.color=Yt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Iie,Xie))),new Zt({id:t,geometry:Ea.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};bd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Wie),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Iie,Xie))),new Zt({id:t,geometry:vm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};bd.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};bd.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||oi.prototype._isHidden.call(this,e,t)};bd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.dimensions.isConstant||!K.isConstant(t.outlineWidth)};bd.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,Oe.MINIMUM_VALUE,Je.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Dt?ln.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Oe.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Je.NONE?sn.ALL:void 0};bd.prototype._onEntityPropertyChanged=Dp;bd.DynamicGeometryUpdater=uC;function uC(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(uC.prototype=Object.create(ii.prototype),uC.prototype.constructor=uC);uC.prototype._isHidden=function(e,t,n){let i=K.getValueOrUndefined(e.position,n,hve),o=this._options.dimensions;return!l(i)||!l(o)||ii.prototype._isHidden.call(this,e,t,n)};uC.prototype._setOptions=function(e,t,n){let i=K.getValueOrDefault(t.heightReference,n,Je.NONE),o=this._options;o.dimensions=K.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Je.NONE?sn.ALL:void 0};var gI=bd;var _nn=T(S(),1);function Ox(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=y(n,ki.FIXED),this._definitionChanged=new ge,this.setCallback(e,t)}Object.defineProperties(Ox.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var pve=new q;Ox.prototype.getValue=function(e,t){return l(e)||(e=q.now(pve)),this.getValueInReferenceFrame(e,ki.FIXED,t)};Ox.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Ox.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Fm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Ox.prototype.equals=function(e){return this===e||e instanceof Ox&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var yI=Ox;var BYn=T(S(),1);var WYn=T(S(),1);var Znn=T(S(),1);var Snn=T(S(),1);/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */var{entries:Die,setPrototypeOf:Pie,isFrozen:bve,getPrototypeOf:gve,getOwnPropertyDescriptor:yve}=Object,{freeze:zc,seal:Ru,create:Bie}=Object,{apply:iH,construct:oH}=typeof Reflect<"u"&&Reflect;zc||(zc=function(t){return t});Ru||(Ru=function(t){return t});iH||(iH=function(t,n,i){return t.apply(n,i)});oH||(oH=function(t,n){return new t(...n)});var n5=gd(Array.prototype.forEach),vie=gd(Array.prototype.pop),xI=gd(Array.prototype.push),o5=gd(String.prototype.toLowerCase),qY=gd(String.prototype.toString),wie=gd(String.prototype.match),_I=gd(String.prototype.replace),xve=gd(String.prototype.indexOf),_ve=gd(String.prototype.trim),Um=gd(Object.prototype.hasOwnProperty),Hc=gd(RegExp.prototype.test),TI=Tve(TypeError);function gd(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:o5;Pie&&Pie(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(bve(t)||(t[i]=r),o=r)}e[o]=!0}return e}function Sve(e){for(let t=0;t/gm),Zve=Ru(/\$\{[\w\W]*}/gm),Gve=Ru(/^data-[\-\w.\u00B7-\uFFFF]+$/),Eve=Ru(/^aria-[\-\w]+$/),Oie=Ru(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ive=Ru(/^(?:\w+script|data):/i),Xve=Ru(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yie=Ru(/^html$/i),Wve=Ru(/^[a-z][.\w]*(-[.\w]+)+$/i),kie=Object.freeze({__proto__:null,ARIA_ATTR:Eve,ATTR_WHITESPACE:Xve,CUSTOM_ELEMENT:Wve,DATA_ATTR:Gve,DOCTYPE_NAME:Yie,ERB_EXPR:Rve,IS_ALLOWED_URI:Oie,IS_SCRIPT_OR_DATA:Ive,MUSTACHE_EXPR:Lve,TMPLIT_EXPR:Zve}),CI={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Pve=function(){return typeof window>"u"?null:window},vve=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Uie=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Hie(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pve(),t=dn=>Hie(dn);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==CI.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:g}=e,f=c.prototype,x=SI(f,"cloneNode"),_=SI(f,"remove"),C=SI(f,"nextSibling"),V=SI(f,"childNodes"),L=SI(f,"parentNode");if(typeof s=="function"){let dn=n.createElement("template");dn.content&&dn.content.ownerDocument&&(n=dn.content.ownerDocument)}let Z,G="",{implementation:I,createNodeIterator:v,createDocumentFragment:P,getElementsByTagName:w}=n,{importNode:F}=i,b=Uie();t.isSupported=typeof Die=="function"&&typeof L=="function"&&I&&I.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:R,ERB_EXPR:E,TMPLIT_EXPR:X,DATA_ATTR:A,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:Y}=kie,{IS_ALLOWED_URI:k}=kie,H=null,J=Wi({},[...Fie,...$Y,...eH,...tH,...Aie]),te=null,z=Wi({},[...Mie,...nH,...Nie,...i5]),j=Object.seal(Bie(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ee=null,fe=null,Te=!0,de=!0,xe=!1,Se=!0,Ie=!1,Le=!0,ke=!1,Be=!1,it=!1,Gt=!1,gt=!1,Ne=!1,Kt=!0,Lt=!1,ut="user-content-",zn=!0,cn=!1,be={},Ve=null,bn=Wi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ht=null,so=Wi({},["audio","video","img","source","image","track"]),Eo=null,ia=Wi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Gr="http://www.w3.org/1998/Math/MathML",_s="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml",rt=Fe,Ke=!1,Qe=null,ft=Wi({},[Gr,_s,Fe],qY),Ot=Wi({},["mi","mo","mn","ms","mtext"]),Cn=Wi({},["annotation-xml"]),Io=Wi({},["title","style","font","a","script"]),So=null,za=["application/xhtml+xml","text/html"],Ka="text/html",Ci=null,pi=null,oa=n.createElement("form"),zr=function(Re){return Re instanceof RegExp||Re instanceof Function},yl=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(pi&&pi===Re)){if((!Re||typeof Re!="object")&&(Re={}),Re=Yx(Re),So=za.indexOf(Re.PARSER_MEDIA_TYPE)===-1?Ka:Re.PARSER_MEDIA_TYPE,Ci=So==="application/xhtml+xml"?qY:o5,H=Um(Re,"ALLOWED_TAGS")?Wi({},Re.ALLOWED_TAGS,Ci):J,te=Um(Re,"ALLOWED_ATTR")?Wi({},Re.ALLOWED_ATTR,Ci):z,Qe=Um(Re,"ALLOWED_NAMESPACES")?Wi({},Re.ALLOWED_NAMESPACES,qY):ft,Eo=Um(Re,"ADD_URI_SAFE_ATTR")?Wi(Yx(ia),Re.ADD_URI_SAFE_ATTR,Ci):ia,ht=Um(Re,"ADD_DATA_URI_TAGS")?Wi(Yx(so),Re.ADD_DATA_URI_TAGS,Ci):so,Ve=Um(Re,"FORBID_CONTENTS")?Wi({},Re.FORBID_CONTENTS,Ci):bn,ee=Um(Re,"FORBID_TAGS")?Wi({},Re.FORBID_TAGS,Ci):{},fe=Um(Re,"FORBID_ATTR")?Wi({},Re.FORBID_ATTR,Ci):{},be=Um(Re,"USE_PROFILES")?Re.USE_PROFILES:!1,Te=Re.ALLOW_ARIA_ATTR!==!1,de=Re.ALLOW_DATA_ATTR!==!1,xe=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ie=Re.SAFE_FOR_TEMPLATES||!1,Le=Re.SAFE_FOR_XML!==!1,ke=Re.WHOLE_DOCUMENT||!1,Gt=Re.RETURN_DOM||!1,gt=Re.RETURN_DOM_FRAGMENT||!1,Ne=Re.RETURN_TRUSTED_TYPE||!1,it=Re.FORCE_BODY||!1,Kt=Re.SANITIZE_DOM!==!1,Lt=Re.SANITIZE_NAMED_PROPS||!1,zn=Re.KEEP_CONTENT!==!1,cn=Re.IN_PLACE||!1,k=Re.ALLOWED_URI_REGEXP||Oie,rt=Re.NAMESPACE||Fe,Ot=Re.MATHML_TEXT_INTEGRATION_POINTS||Ot,Cn=Re.HTML_INTEGRATION_POINTS||Cn,j=Re.CUSTOM_ELEMENT_HANDLING||{},Re.CUSTOM_ELEMENT_HANDLING&&zr(Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(j.tagNameCheck=Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&zr(Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(j.attributeNameCheck=Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(j.allowCustomizedBuiltInElements=Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(de=!1),gt&&(Gt=!0),be&&(H=Wi({},Aie),te=[],be.html===!0&&(Wi(H,Fie),Wi(te,Mie)),be.svg===!0&&(Wi(H,$Y),Wi(te,nH),Wi(te,i5)),be.svgFilters===!0&&(Wi(H,eH),Wi(te,nH),Wi(te,i5)),be.mathMl===!0&&(Wi(H,tH),Wi(te,Nie),Wi(te,i5))),Re.ADD_TAGS&&(H===J&&(H=Yx(H)),Wi(H,Re.ADD_TAGS,Ci)),Re.ADD_ATTR&&(te===z&&(te=Yx(te)),Wi(te,Re.ADD_ATTR,Ci)),Re.ADD_URI_SAFE_ATTR&&Wi(Eo,Re.ADD_URI_SAFE_ATTR,Ci),Re.FORBID_CONTENTS&&(Ve===bn&&(Ve=Yx(Ve)),Wi(Ve,Re.FORBID_CONTENTS,Ci)),zn&&(H["#text"]=!0),ke&&Wi(H,["html","head","body"]),H.table&&(Wi(H,["tbody"]),delete ee.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw TI('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw TI('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=Re.TRUSTED_TYPES_POLICY,G=Z.createHTML("")}else Z===void 0&&(Z=vve(g,o)),Z!==null&&typeof G=="string"&&(G=Z.createHTML(""));zc&&zc(Re),pi=Re}},yo=Wi({},[...$Y,...eH,...Cve]),Er=Wi({},[...tH,...Vve]),pp=function(Re){let Wt=L(Re);(!Wt||!Wt.tagName)&&(Wt={namespaceURI:rt,tagName:"template"});let gn=o5(Re.tagName),pr=o5(Wt.tagName);return Qe[Re.namespaceURI]?Re.namespaceURI===_s?Wt.namespaceURI===Fe?gn==="svg":Wt.namespaceURI===Gr?gn==="svg"&&(pr==="annotation-xml"||Ot[pr]):!!yo[gn]:Re.namespaceURI===Gr?Wt.namespaceURI===Fe?gn==="math":Wt.namespaceURI===_s?gn==="math"&&Cn[pr]:!!Er[gn]:Re.namespaceURI===Fe?Wt.namespaceURI===_s&&!Cn[pr]||Wt.namespaceURI===Gr&&!Ot[pr]?!1:!Er[gn]&&(Io[gn]||!yo[gn]):!!(So==="application/xhtml+xml"&&Qe[Re.namespaceURI]):!1},Kr=function(Re){xI(t.removed,{element:Re});try{L(Re).removeChild(Re)}catch{_(Re)}},du=function(Re,Wt){try{xI(t.removed,{attribute:Wt.getAttributeNode(Re),from:Wt})}catch{xI(t.removed,{attribute:null,from:Wt})}if(Wt.removeAttribute(Re),Re==="is")if(Gt||gt)try{Kr(Wt)}catch{}else try{Wt.setAttribute(Re,"")}catch{}},Ja=function(Re){let Wt=null,gn=null;if(it)Re=""+Re;else{let La=wie(Re,/^[\r\n\t ]+/);gn=La&&La[0]}So==="application/xhtml+xml"&&rt===Fe&&(Re=''+Re+"");let pr=Z?Z.createHTML(Re):Re;if(rt===Fe)try{Wt=new p().parseFromString(pr,So)}catch{}if(!Wt||!Wt.documentElement){Wt=I.createDocument(rt,"template",null);try{Wt.documentElement.innerHTML=Ke?G:pr}catch{}}let Qa=Wt.body||Wt.documentElement;return Re&&gn&&Qa.insertBefore(n.createTextNode(gn),Qa.childNodes[0]||null),rt===Fe?w.call(Wt,ke?"html":"body")[0]:ke?Wt.documentElement:Qa},Jy=function(Re){return v.call(Re.ownerDocument||Re,Re,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},ra=function(Re){return Re instanceof h&&(typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||!(Re.attributes instanceof u)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function")},xl=function(Re){return typeof a=="function"&&Re instanceof a};function Xc(dn,Re,Wt){n5(dn,gn=>{gn.call(t,Re,Wt,pi)})}let cs=function(Re){let Wt=null;if(Xc(b.beforeSanitizeElements,Re,null),ra(Re))return Kr(Re),!0;let gn=Ci(Re.nodeName);if(Xc(b.uponSanitizeElement,Re,{tagName:gn,allowedTags:H}),Re.hasChildNodes()&&!xl(Re.firstElementChild)&&Hc(/<[/\w]/g,Re.innerHTML)&&Hc(/<[/\w]/g,Re.textContent)||Re.nodeType===CI.progressingInstruction||Le&&Re.nodeType===CI.comment&&Hc(/<[/\w]/g,Re.data))return Kr(Re),!0;if(!H[gn]||ee[gn]){if(!ee[gn]&&mu(gn)&&(j.tagNameCheck instanceof RegExp&&Hc(j.tagNameCheck,gn)||j.tagNameCheck instanceof Function&&j.tagNameCheck(gn)))return!1;if(zn&&!Ve[gn]){let pr=L(Re)||Re.parentNode,Qa=V(Re)||Re.childNodes;if(Qa&&pr){let La=Qa.length;for(let _l=La-1;_l>=0;--_l){let Kh=x(Qa[_l],!0);Kh.__removalCount=(Re.__removalCount||0)+1,pr.insertBefore(Kh,C(Re))}}}return Kr(Re),!0}return Re instanceof c&&!pp(Re)||(gn==="noscript"||gn==="noembed"||gn==="noframes")&&Hc(/<\/no(script|embed|frames)/i,Re.innerHTML)?(Kr(Re),!0):(Ie&&Re.nodeType===CI.text&&(Wt=Re.textContent,n5([R,E,X],pr=>{Wt=_I(Wt,pr," ")}),Re.textContent!==Wt&&(xI(t.removed,{element:Re.cloneNode()}),Re.textContent=Wt)),Xc(b.afterSanitizeElements,Re,null),!1)},uu=function(Re,Wt,gn){if(Kt&&(Wt==="id"||Wt==="name")&&(gn in n||gn in oa))return!1;if(!(de&&!fe[Wt]&&Hc(A,Wt))){if(!(Te&&Hc(N,Wt))){if(!te[Wt]||fe[Wt]){if(!(mu(Re)&&(j.tagNameCheck instanceof RegExp&&Hc(j.tagNameCheck,Re)||j.tagNameCheck instanceof Function&&j.tagNameCheck(Re))&&(j.attributeNameCheck instanceof RegExp&&Hc(j.attributeNameCheck,Wt)||j.attributeNameCheck instanceof Function&&j.attributeNameCheck(Wt))||Wt==="is"&&j.allowCustomizedBuiltInElements&&(j.tagNameCheck instanceof RegExp&&Hc(j.tagNameCheck,gn)||j.tagNameCheck instanceof Function&&j.tagNameCheck(gn))))return!1}else if(!Eo[Wt]){if(!Hc(k,_I(gn,U,""))){if(!((Wt==="src"||Wt==="xlink:href"||Wt==="href")&&Re!=="script"&&xve(gn,"data:")===0&&ht[Re])){if(!(xe&&!Hc(O,_I(gn,U,"")))){if(gn)return!1}}}}}}return!0},mu=function(Re){return Re!=="annotation-xml"&&wie(Re,Y)},hu=function(Re){Xc(b.beforeSanitizeAttributes,Re,null);let{attributes:Wt}=Re;if(!Wt||ra(Re))return;let gn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0},pr=Wt.length;for(;pr--;){let Qa=Wt[pr],{name:La,namespaceURI:_l,value:Kh}=Qa,NL=Ci(La),Wc=La==="value"?Kh:_ve(Kh);if(gn.attrName=NL,gn.attrValue=Wc,gn.keepAttr=!0,gn.forceKeepAttr=void 0,Xc(b.uponSanitizeAttribute,Re,gn),Wc=gn.attrValue,Lt&&(NL==="id"||NL==="name")&&(du(La,Re),Wc=ut+Wc),Le&&Hc(/((--!?|])>)|<\/(style|title)/i,Wc)){du(La,Re);continue}if(gn.forceKeepAttr||(du(La,Re),!gn.keepAttr))continue;if(!Se&&Hc(/\/>/i,Wc)){du(La,Re);continue}Ie&&n5([R,E,X],tq=>{Wc=_I(Wc,tq," ")});let eq=Ci(Re.nodeName);if(uu(eq,NL,Wc)){if(Z&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!_l)switch(g.getAttributeType(eq,NL)){case"TrustedHTML":{Wc=Z.createHTML(Wc);break}case"TrustedScriptURL":{Wc=Z.createScriptURL(Wc);break}}try{_l?Re.setAttributeNS(_l,La,Wc):Re.setAttribute(La,Wc),ra(Re)?Kr(Re):vie(t.removed)}catch{}}}Xc(b.afterSanitizeAttributes,Re,null)},Mo=function dn(Re){let Wt=null,gn=Jy(Re);for(Xc(b.beforeSanitizeShadowDOM,Re,null);Wt=gn.nextNode();)Xc(b.uponSanitizeShadowNode,Wt,null),cs(Wt),hu(Wt),Wt.content instanceof r&&dn(Wt.content);Xc(b.afterSanitizeShadowDOM,Re,null)};return t.sanitize=function(dn){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Wt=null,gn=null,pr=null,Qa=null;if(Ke=!dn,Ke&&(dn=""),typeof dn!="string"&&!xl(dn))if(typeof dn.toString=="function"){if(dn=dn.toString(),typeof dn!="string")throw TI("dirty is not a string, aborting")}else throw TI("toString is not a function");if(!t.isSupported)return dn;if(Be||yl(Re),t.removed=[],typeof dn=="string"&&(cn=!1),cn){if(dn.nodeName){let Kh=Ci(dn.nodeName);if(!H[Kh]||ee[Kh])throw TI("root node is forbidden and cannot be sanitized in-place")}}else if(dn instanceof a)Wt=Ja(""),gn=Wt.ownerDocument.importNode(dn,!0),gn.nodeType===CI.element&&gn.nodeName==="BODY"||gn.nodeName==="HTML"?Wt=gn:Wt.appendChild(gn);else{if(!Gt&&!Ie&&!ke&&dn.indexOf("<")===-1)return Z&&Ne?Z.createHTML(dn):dn;if(Wt=Ja(dn),!Wt)return Gt?null:Ne?G:""}Wt&&it&&Kr(Wt.firstChild);let La=Jy(cn?dn:Wt);for(;pr=La.nextNode();)cs(pr),hu(pr),pr.content instanceof r&&Mo(pr.content);if(cn)return dn;if(Gt){if(gt)for(Qa=P.call(Wt.ownerDocument);Wt.firstChild;)Qa.appendChild(Wt.firstChild);else Qa=Wt;return(te.shadowroot||te.shadowrootmode)&&(Qa=F.call(i,Qa,!0)),Qa}let _l=ke?Wt.outerHTML:Wt.innerHTML;return ke&&H["!doctype"]&&Wt.ownerDocument&&Wt.ownerDocument.doctype&&Wt.ownerDocument.doctype.name&&Hc(Yie,Wt.ownerDocument.doctype.name)&&(_l=" +`+_l),Ie&&n5([R,E,X],Kh=>{_l=_I(_l,Kh," ")}),Z&&Ne?Z.createHTML(_l):_l},t.setConfig=function(){let dn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yl(dn),Be=!0},t.clearConfig=function(){pi=null,Be=!1},t.isValidAttribute=function(dn,Re,Wt){pi||yl({});let gn=Ci(dn),pr=Ci(Re);return uu(gn,pr,Wt)},t.addHook=function(dn,Re){typeof Re=="function"&&xI(b[dn],Re)},t.removeHook=function(dn){return vie(b[dn])},t.removeHooks=function(dn){b[dn]=[]},t.removeAllHooks=function(){b=Uie()},t}var zie=Hie();var wve=0,rH={};function df(e,t){let n,i=e;l(rH[i])?n=rH[i]:(n=wve++,rH[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(df.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=zie.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i{u[h]=void 0});for(let h=r;h0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function Fve(e,t){if(Dm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Dm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}VI.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;D.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(Fve(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};VI.prototype.isDestroyed=function(){return!1};VI.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),me(this)};var zx=VI;var oin=T(S(),1),cH=T(sd(),1);var Qnn=T(S(),1);var aH,Kie="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzYTBjYzY2NC0yMGEyLTQxZDYtYmI2MC1hMWE4ZTBlMGNlNjciLCJpZCI6MjU5LCJpYXQiOjE3MzU4NTEwMzF9.nshpaoC5qpRD4F5diwcjwJ3tddp1OjCSXoMrv37Ales",r5={};r5.defaultAccessToken=Kie;r5.defaultServer=new Ze({url:"https://api.cesium.com/"});r5.getDefaultTokenCredit=function(e){if(e===Kie){if(!l(aH)){let t=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.`;aH=new St(t,!0)}return aH}};var Bm=r5;function Kc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:Ave};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ae("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ze.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new cH.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(Kc.prototype=Object.create(Ze.prototype),Kc.prototype.constructor=Kc);Kc.fromAssetId=function(e,t){let n=Kc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Kc(i,n)})};Object.defineProperties(Kc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Kc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Kc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(St.getIonCredit),i=Bm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(St.clone(i)),n};Kc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Kc(t._ionEndpoint,t._ionEndpointResource)),e=Ze.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Kc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ze.prototype.fetchImage.call(this,e)};Kc.prototype._makeRequest=function(e){return this._isExternal||new cH.default(this.url).authority()!==this._ionEndpointDomain?Ze.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Ze.prototype._makeRequest.call(this,e))};Kc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,Bm.defaultServer),i=y(t.accessToken,Bm.defaultAccessToken);n=Ze.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function Ave(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var yd=Kc;var ain=T(S(),1);function uf(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(uf.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(et.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});uf.prototype.get=function(e){return this._array[e]};uf.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};uf.prototype.peek=function(){return this._array[this._length-1]};uf.prototype.push=function(e){let t=this.length++;this._array[t]=e};uf.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};uf.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};uf.prototype.resize=function(e){this.length=e};uf.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Jc=uf;var uin=T(S(),1);var Bp={X:0,Y:1,Z:2};Bp.Y_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));Bp.Z_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));Bp.X_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));Bp.Z_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));Bp.X_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));Bp.Y_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));Bp.fromName=function(e){return Bp[e]};var Po=Object.freeze(Bp);var HBn=T(S(),1);var fin=T(S(),1);function Jie(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(Jie.prototype,{metadata:{get:function(){return this._metadata}}});var Kx=Jie;var x5n=T(S(),1);var Iin=T(S(),1);var Sin=T(S(),1);var yin=T(S(),1);function j0(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),j0.decode(e)}j0.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};j0.decodeWithFromCharCode=function(e){let t="",n=Mve(e),i=n.length;for(let o=0;o>10)+55296,(r&1023)+56320))}return t};function LI(e,t,n){return t<=e&&e<=n}function Mve(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c0){let o=Math.min(t,Ft.maximumTextureSize),r=Math.ceil(t/Ft.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new D(o,r),i=new se(s,a,c,d)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(cc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});cc.DEFAULT_COLOR_VALUE=B.WHITE;cc.DEFAULT_SHOW_VALUE=!0;function Qie(e){let t=e._textureDimensions;return t.x*t.y*4}function jie(e){if(!l(e._batchValues)){let t=Qie(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function qie(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}cc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=qie(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=jie(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};cc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,o=Qie(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c0;){if(t=u.pop(),c[t]===d)continue;c[t]=d;let h=n(e,t);if(l(h))return h;let p=o[t],g=s[t];for(let f=0;f0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${r} +${dwe(i)}${s}`}};function eoe(e,t){return e=De.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function uwe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};fo.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=De.replaceMain(e,"tile_main"),Ft.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_main(); + out_FragColor = tile_featureColor; + out_FragColor.rgb *= out_FragColor.a; +}`:e+=`uniform sampler2D tile_batchTexture; +uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +void main() +{ + tile_main(); + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } + out_FragColor = featureProperties; + out_FragColor.rgb *= out_FragColor.a; +} +`,e}};function mwe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Il.HIGHLIGHT)return 0;if(n===Il.REPLACE)return 1;if(n===Il.MIX)return W.clamp(i,W.EPSILON4,1)}fo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Tt(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return mwe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};fo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var q0={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};fo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=hwe(this);for(let d=t;d>>Ut.SKIP_LOD_BIT_SHIFT}function Twe(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=Ut.setCesium3DTileBit(),t.stencilMask=Ut.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}function Swe(e){let t=Ye(e,!0);return t.stencilTest=Ut.setCesium3DTileBit(),t.stencilMask=Ut.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}fo.prototype.update=function(e,t){this._batchTexture.update(e,t)};fo.prototype.isDestroyed=function(){return!1};fo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var Yp=fo;var qrn=T(S(),1);var Uon=T(S(),1);function Cwe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var mf=Cwe;var Nrn=T(S(),1);var Bon=T(S(),1),mC=`in vec3 position; +in float a_batchId; + +uniform mat4 u_modifiedModelViewProjection; + +void main() +{ + gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); +} +`;var zon=T(S(),1);function Gu(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Gu.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new B),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Gu.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Gu.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Gu.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Gu.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let d=e.tileset.metadata;if(l(d)){if(d.hasPropertyBySemantic(n))return d.getPropertyBySemantic(n);if(d.hasProperty(n))return d.getProperty(n)}};Gu.prototype.getPropertyInherited=function(e){return Gu.getPropertyInherited(this._content,this._batchId,e)};Gu.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Gu.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Gu.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Gu.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var ks=Gu;var lrn=T(S(),1);var Qon=T(S(),1),uH=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},mH=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Xl=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.lengthr.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+d),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Xl.max_unop_len=Xl.getMaxKeyLen(Xl.unary_ops);Xl.max_binop_len=Xl.getMaxKeyLen(Xl.binary_ops);var $0=e=>new Xl(e).parse(),Lwe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Xl).filter(e=>!Lwe.includes(e)&&$0[e]===void 0).forEach(e=>{$0[e]=Xl[e]});$0.Jsep=Xl;var Rwe="ConditionalExpression",Zwe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:Rwe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};$0.plugins.register(Zwe);var qon=T(S(),1),Gwe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},pt=Object.freeze(Gwe);function Ym(e,t){this._expression=e,e=Uwe(e,t),e=Bwe(Dwe(e)),$0.addBinaryOp("=~",0),$0.addBinaryOp("!~",0);let n;try{n=$0(e)}catch(i){throw new ae(i)}this._runtimeAst=Vi(this,n)}Object.defineProperties(Ym.prototype,{expression:{get:function(){return this._expression}}});var vn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new D],cartesian3Array:[new m],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new D),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};Ym.prototype.evaluate=function(e,t){vn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof B&&n instanceof se?B.fromCartesian4(n,t):n instanceof D||n instanceof m||n instanceof se?n.clone(t):n};Ym.prototype.evaluateColor=function(e,t){vn.reset();let n=this._runtimeAst.evaluate(e);return B.fromCartesian4(n,t)};Ym.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} +{ + return ${o}; +} +`,o};Ym.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Ym.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Ewe=["!","-","+"],ioe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],c5=/\${(.*?)}/g,Iwe=/\\/g,Xwe="@#%",Wwe=/@#%/g,l5=new B,d5={abs:Us(Math.abs),sqrt:Us(Math.sqrt),cos:Us(Math.cos),sin:Us(Math.sin),tan:Us(Math.tan),acos:Us(Math.acos),asin:Us(Math.asin),atan:Us(Math.atan),radians:Us(W.toRadians),degrees:Us(W.toDegrees),sign:Us(W.sign),floor:Us(Math.floor),ceil:Us(Math.ceil),round:Us(Math.round),exp:Us(Math.exp),exp2:Us(vwe),log:Us(Math.log),log2:Us(wwe),fract:Us(Pwe),length:Fwe,normalize:Awe},u5={atan2:s5(Math.atan2,!1),pow:s5(Math.pow,!1),min:s5(Math.min,!0),max:s5(Math.max,!0),distance:Mwe,dot:Nwe,cross:kwe},pH={clamp:ooe(W.clamp,!0),mix:ooe(W.lerp,!0)};function Pwe(e){return e-Math.floor(e)}function vwe(e){return Math.pow(2,e)}function wwe(e){return W.log2(e)}function Us(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof D)return D.fromElements(e(n.x),e(n.y),vn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),vn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),vn.getCartesian4());throw new ae(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function s5(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof D)return D.fromElements(e(i.x,o),e(i.y,o),vn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),vn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),vn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x),e(i.y,o.y),vn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),vn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),vn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function ooe(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),vn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),vn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),vn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof D&&o instanceof D&&r instanceof D)return D.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),vn.getCartesian2());if(i instanceof m&&o instanceof m&&r instanceof m)return m.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),vn.getCartesian3());if(i instanceof se&&o instanceof se&&r instanceof se)return se.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),vn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function Fwe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof D)return D.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Awe(e,t){if(typeof t=="number")return 1;if(t instanceof D)return D.normalize(t,vn.getCartesian2());if(t instanceof m)return m.normalize(t,vn.getCartesian3());if(t instanceof se)return se.normalize(t,vn.getCartesian4());throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Mwe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof D&&n instanceof D)return D.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Nwe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof D&&n instanceof D)return D.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function kwe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,vn.getCartesian3());throw new ae(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Ct(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,$we(this)}function Uwe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function Dwe(e){return e.replace(Iwe,Xwe)}function fH(e){return e.replace(Wwe,"\\")}function Bwe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o=0&&r=0?new Ct(pt.VARIABLE_IN_STRING,e.value):new Ct(pt.LITERAL_STRING,fH(e.value))}function Ywe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new ae(`${o} is not a function.`);return i===0?o==="test"?new Ct(pt.LITERAL_BOOLEAN,!1):new Ct(pt.LITERAL_NULL,null):(s=Vi(e,c),a=Vi(e,n[0]),new Ct(pt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Vi(e,c),new Ct(pt.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Ct(pt.LITERAL_COLOR,o);if(r=Vi(e,n[0]),l(n[1])){let c=Vi(e,n[1]);return new Ct(pt.LITERAL_COLOR,o,[r,c])}return new Ct(pt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[Vi(e,n[0]),Vi(e,n[1]),Vi(e,n[2])],new Ct(pt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[Vi(e,n[0]),Vi(e,n[1]),Vi(e,n[2]),Vi(e,n[3])],new Ct(pt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c1)throw new ae(`${o} requires exactly one argument.`);return r=Vi(e,n[0]),new Ct(pt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new Ct(pt.UNARY,o)}else if(l(d5[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=Vi(e,n[0]),new Ct(pt.UNARY,o,r)}else if(l(u5[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=Vi(e,n[0]),a=Vi(e,n[1]),new Ct(pt.BINARY,o,s,a)}else if(l(pH[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=Vi(e,n[0]),a=Vi(e,n[1]);let c=Vi(e,n[2]);return new Ct(pt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Ct(pt.LITERAL_BOOLEAN,!1):(r=Vi(e,n[0]),new Ct(pt.UNARY,o,r));if(o==="Number")return i===0?new Ct(pt.LITERAL_NUMBER,0):(r=Vi(e,n[0]),new Ct(pt.UNARY,o,r));if(o==="String")return i===0?new Ct(pt.LITERAL_STRING,""):(r=Vi(e,n[0]),new Ct(pt.UNARY,o,r));if(o==="regExp")return Hwe(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function Hwe(e,t){let n=t.arguments;if(n.length===0)return new Ct(pt.LITERAL_REGEX,new RegExp);let i=Vi(e,n[0]),o;if(n.length>1){let r=Vi(e,n[1]);if(hH(i)&&hH(r)){try{o=new RegExp(fH(String(i._value)),r._value)}catch(s){throw new ae(s)}return new Ct(pt.LITERAL_REGEX,o)}return new Ct(pt.REGEX,i,r)}if(hH(i)){try{o=new RegExp(fH(String(i._value)))}catch(r){throw new ae(r)}return new Ct(pt.LITERAL_REGEX,o)}return new Ct(pt.REGEX,i)}function zwe(e){if(jwe(e.name)){let t=qwe(e.name);return t.substr(0,8)==="tiles3d_"?new Ct(pt.BUILTIN_VARIABLE,t):new Ct(pt.VARIABLE,t)}else{if(e.name==="NaN")return new Ct(pt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Ct(pt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Ct(pt.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function Kwe(e){let t=e.property.name;if(t==="PI")return new Ct(pt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Ct(pt.LITERAL_NUMBER,Math.E)}function Jwe(e){if(e.property.name==="POSITIVE_INFINITY")return new Ct(pt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function Qwe(e,t){if(t.object.name==="Math")return Kwe(t);if(t.object.name==="Number")return Jwe(t);let n,i=Vi(e,t.object);return t.computed?(n=Vi(e,t.property),new Ct(pt.MEMBER,"brackets",i,n)):(n=new Ct(pt.LITERAL_STRING,t.property.name),new Ct(pt.MEMBER,"dot",i,n))}function hH(e){return e._type>=pt.LITERAL_NULL}function jwe(e){return e.substr(0,4)==="czm_"}function qwe(e){return e.substr(4)}function Vi(e,t){let n,i,o,r;if(t.type==="Literal")n=Owe(t);else if(t.type==="CallExpression")n=Ywe(e,t);else if(t.type==="Identifier")n=zwe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Vi(e,t.argument);if(Ewe.indexOf(i)>-1)n=new Ct(pt.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Vi(e,t.left),r=Vi(e,t.right),ioe.indexOf(i)>-1)n=new Ct(pt.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Vi(e,t.left),r=Vi(e,t.right),ioe.indexOf(i)>-1&&(n=new Ct(pt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Vi(e,t.test);o=Vi(e,t.consequent),r=Vi(e,t.alternate),n=new Ct(pt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=Qwe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(u5[e._value])&&(e.evaluate=nFe(e._value)):e._type===pt.TERNARY?e.evaluate=iFe(e._value):e._type===pt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===pt.ARRAY?e.evaluate=e._evaluateArray:e._type===pt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===pt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===pt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===pt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===pt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===pt.REGEX?e.evaluate=e._evaluateRegExp:e._type===pt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=eFe):e.evaluate=e._evaluateLiteral}function eFe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function tFe(e){let t=d5[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function nFe(e){let t=u5[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function iFe(e){let t=pH[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function m5(e,t){if(l(e))return e.getPropertyInherited(t)}Ct.prototype._evaluateLiteral=function(){return this._value};Ct.prototype._evaluateLiteralColor=function(e){let t=l5,n=this._left;if(this._value==="color")l(n)?n.length>1?(B.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):B.fromCssColorString(n[0].evaluate(e),t):B.fromBytes(255,255,255,255,t);else if(this._value==="rgb")B.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;B.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?B.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&B.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,vn.getCartesian4())};Ct.prototype._evaluateLiteralVector=function(e){let t=vn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a1)throw new ae(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ae(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return D.fromArray(t,0,vn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,vn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,vn.getCartesian4())};Ct.prototype._evaluateLiteralString=function(){return this._value};Ct.prototype._evaluateVariableString=function(e){let t=this._value,n=c5.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=m5(e,o);l(r)||(r=""),t=t.replace(i,r),n=c5.exec(t)}return t};Ct.prototype._evaluateVariable=function(e){return m5(e,this._value)};function Qx(e){return e._value==="feature"}Ct.prototype._evaluateMemberDot=function(e){if(Qx(this._left))return m5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof m||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Ct.prototype._evaluateMemberBrackets=function(e){if(Qx(this._left))return m5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof m||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Ct.prototype._evaluateArray=function(e){let t=[];for(let n=0;n" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Ct.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Ct.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Ct.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Ct.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.add(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,vn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ae(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.subtract(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ae(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.multiplyComponents(t,n,vn.getCartesian2());if(n instanceof D&&typeof t=="number")return D.multiplyByScalar(n,t,vn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.multiplyByScalar(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,vn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,vn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,vn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,vn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ae(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.divideComponents(t,n,vn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.divideByScalar(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,vn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,vn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ae(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.fromElements(t.x%n.x,t.y%n.y,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ae(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof m&&t instanceof m||n instanceof se&&t instanceof se?t.equals(n):t===n};Ct.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof m&&t instanceof m||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Ct.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ae(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Ct.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Ct.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Ct.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Ct.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Ct.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Ct.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Ct.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Ct.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Ct.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ae(o)}return i};Ct.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Ct.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new ae(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new ae(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Ct.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof D||t instanceof m||t instanceof se)return String(t);throw new ae(`Unexpected function call "${this._value}".`)};function roe(e){let t=e._left,n=t.length;for(let a=0;a1){let p=d[0],g=d[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=soe(this),l(i)?a5(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(c==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=soe(this),l(i)?a5(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=roe(this),l(i)?a5(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=roe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),a5(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case pt.LITERAL_VECTOR:u=o.length,h=`${c}(`;for(let p=0;p0;){let u=t.pop();if(B.equals(u.color,a.color))d=bH(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let h=d;d=bH(n,s,d,i,o,u.batchIds,r),u.offset=h,u.count=d-h,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function gH(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let d=0;d0;){let h=t.pop();if(B.equals(h.color,r.color))d=gH(a,c,d,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=d-r.offset;else{let p=d;d=gH(a,c,d,n,i,h.batchIds,o),h.offset=p,h.count=d-p,s.push(h),r=h}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function fFe(e,t){return t.color.toRgba()-e.color.toRgba()}function pFe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s=x&&s{e.isDestroyed()||(e._error=f)}):void 0}}function XFe(e){l(e._primitive)||(e._primitive=new qx({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}_d.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};_d.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};_d.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};_d.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};_d.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=IFe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};_d.prototype.isDestroyed=function(){return!1};_d.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var zp=_d;function hf(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,vFe(this,i,o)}Object.defineProperties(hf.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function WFe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function PFe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),d=y(e.ELLIPSOIDS_LENGTH,0),u=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let f=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let f=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,f,c)}if(d>0&&l(e.ELLIPSOID_BATCH_IDS)){let f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,f,d)}if(u>0&&l(e.SPHERE_BATCH_IDS)){let f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,f,u)}let h=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||d>0&&!l(o)||u>0&&!l(r);if(h&&p)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let f=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s0)for(i=new Uint16Array(c),s=0;s0)for(o=new Uint16Array(d),s=0;s0)for(r=new Uint16Array(u),s=0;s0&&(g=vo(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let x=y(h.BOXES_LENGTH,0),_=y(h.CYLINDERS_LENGTH,0),C=y(h.ELLIPSOIDS_LENGTH,0),V=y(h.SPHERES_LENGTH,0),L=x+_+C+V,Z=new Yp(e,L,g,f,WFe(e));if(e._batchTable=Z,L===0)return;let G=e.tile.computedTransform,I;l(h.RTC_CENTER)&&(I=m.unpack(h.RTC_CENTER),M.multiplyByPoint(G,I,I));let v=PFe(h,p);if(x>0||_>0||C>0||V>0){let P,w,F,b;if(x>0){let R=p.byteOffset+h.BOXES.byteOffset;P=new Float32Array(p.buffer,R,zp.packedBoxLength*x)}if(_>0){let R=p.byteOffset+h.CYLINDERS.byteOffset;w=new Float32Array(p.buffer,R,zp.packedCylinderLength*_)}if(C>0){let R=p.byteOffset+h.ELLIPSOIDS.byteOffset;F=new Float32Array(p.buffer,R,zp.packedEllipsoidLength*C)}if(V>0){let R=p.byteOffset+h.SPHERES.byteOffset;b=new Float32Array(p.buffer,R,zp.packedSphereLength*V)}return e._geometries=new zp({boxes:P,boxBatchIds:v.boxes,cylinders:w,cylinderBatchIds:v.cylinders,ellipsoids:F,ellipsoidBatchIds:v.ellipsoids,spheres:b,sphereBatchIds:v.spheres,center:I,modelMatrix:G,batchTable:Z,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function moe(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}hf.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};hf.prototype.getFeature=function(e){return moe(this),this._features[e]};hf.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};hf.prototype.applyStyle=function(e){moe(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};hf.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};hf.prototype.pick=function(e,t,n){};hf.prototype.isDestroyed=function(){return!1};hf.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};var EI=hf;var zfn=T(S(),1);var usn=T(S(),1);var yH={};yH.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),hoe(i,o,r,s);return c};yH.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s>>0,xH=2*e_+1,tg=4,boe=[],goe=[],AFe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],ng=1,fC=2,h5=[ng,0,0,ng|fC];function qr(e){if(!Bt.supportsBigInt())throw new ae("S2 required BigInt support");this._cellId=e,this._level=qr.getLevel(e)}qr.fromToken=function(e){return new qr(qr.getIdFromToken(e))};qr.isValidId=function(e){return!(e<=0||e>>BigInt(xH)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};qr.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?qr.isValidId(qr.getIdFromToken(e)):!1};qr.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};qr.getTokenFromId=function(e){let t=Math.floor(zFe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};qr.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return e_-(t>>1)};qr.prototype.getChild=function(e){let t=_oe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new qr(n)};qr.prototype.getParent=function(){let e=_oe(this._cellId)<>1&1;return xoe(i[0],o[0][r^n&1],o[1][r])}function kFe(e,t){let n=yoe(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,d=(o<<1)+c,u=(r<<1)+c;return[i,d,u]}function yoe(e){boe.length===0&&OFe();let t=Number(e>>BigInt(xH)),n=t&ng,i=(1<=0;s--){let c=(1<<2*(s===7?e_-7*tg:tg))-1;n+=Number(e>>BigInt(s*2*tg+1)&BigInt(c))<<2,n=goe[n];let d=s*tg;o+=n>>tg+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function foe(e){return 1/FFe*e}function DFe(e,t){let n=[[],[]],i=BFe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=f5(poe(r)),n[o][1]=f5(poe(s))}return n}function BFe(e){return 1<>>0}function poe(e){return 1/wFe*e}function ig(e,t,n,i,o,r){if(e===tg){let s=(t<>1),n+(s[0]&1),i,o,r^h5[0]),ig(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^h5[1]),ig(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^h5[2]),ig(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^h5[3])}}function OFe(){ig(0,0,0,0,0,0),ig(0,0,0,ng,0,ng),ig(0,0,0,fC,0,fC),ig(0,0,0,ng|fC,0,ng|fC)}function _oe(e){return e&~e+BigInt(1)}function YFe(e){return BigInt(1)<>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(_H.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});_H.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var pC=_H;var Isn=T(S(),1);function Jp(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Jp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Jp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Jp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Jp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Jp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Jp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Jp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var bC=Jp;var Wsn=T(S(),1);var p5={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};p5.getBranchingFactor=function(e){switch(e){case p5.OCTREE:return 8;case p5.QUADTREE:return 4}};var $r=Object.freeze(p5);var Dsn=T(S(),1);var Asn=T(S(),1);function da(){}Object.defineProperties(da.prototype,{class:{get:function(){pe.throwInstantiationError()}}});da.prototype.hasProperty=function(e){pe.throwInstantiationError()};da.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};da.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};da.prototype.getProperty=function(e){pe.throwInstantiationError()};da.prototype.setProperty=function(e,t){pe.throwInstantiationError()};da.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};da.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};da.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};da.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};da.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};da.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};da.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};da.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return da.getProperty(o.id,t,n)};da.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?da.setProperty(r.id,t,n,i):!1};var Mn=da;function Qp(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Qp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Qp.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Qp.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Qp.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Qp.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Qp.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var II=Qp;var Pan=T(S(),1);var Ran=T(S(),1);var zsn=T(S(),1);var At={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};At.getMinimum=function(e){switch(e){case At.INT8:return-128;case At.UINT8:return 0;case At.INT16:return-32768;case At.UINT16:return 0;case At.INT32:return-2147483648;case At.UINT32:return 0;case At.INT64:return Bt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case At.UINT64:return Bt.supportsBigInt()?BigInt(0):0;case At.FLOAT32:return-34028234663852886e22;case At.FLOAT64:return-Number.MAX_VALUE}};At.getMaximum=function(e){switch(e){case At.INT8:return 127;case At.UINT8:return 255;case At.INT16:return 32767;case At.UINT16:return 65535;case At.INT32:return 2147483647;case At.UINT32:return 4294967295;case At.INT64:return Bt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case At.UINT64:return Bt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case At.FLOAT32:return 34028234663852886e22;case At.FLOAT64:return Number.MAX_VALUE}};At.isIntegerType=function(e){switch(e){case At.INT8:case At.UINT8:case At.INT16:case At.UINT16:case At.INT32:case At.UINT32:case At.INT64:case At.UINT64:return!0;default:return!1}};At.isUnsignedIntegerType=function(e){switch(e){case At.UINT8:case At.UINT16:case At.UINT32:case At.UINT64:return!0;default:return!1}};At.isVectorCompatible=function(e){switch(e){case At.INT8:case At.UINT8:case At.INT16:case At.UINT16:case At.INT32:case At.UINT32:case At.FLOAT32:case At.FLOAT64:return!0;default:return!1}};At.normalize=function(e,t){return Math.max(Number(e)/Number(At.getMaximum(t)),-1)};At.unnormalize=function(e,t){let n=At.getMaximum(t),i=At.isUnsignedIntegerType(t)?0:-n;return e=W.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===At.INT64||t===At.UINT64)&&Bt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};va.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Voe(e,t))return e};function Voe(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};va.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=dt.getMathType(this._type),i=this._isArray,o=dt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};va.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?qFe(this,e):Loe(this,e)};function qFe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i1?Toe(e,t,n):void 0}if(ekt.getMaximum(t))return Toe(e,t,n)}function Coe(e,t){return`value ${e} of type ${t} must be finite`}function TH(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function lAe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function uAe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<96?_-97:_>64?_-39:_+4}for(var C=0,x=0;x=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/f,f*4)},encodeVertexBuffer:function(g,f,x){r(x>0&&x<=256),r(x%4==0);var _=n.exports.meshopt_encodeVertexBufferBound(f,x);return d(n.exports.meshopt_encodeVertexBuffer,_,g,f,x)},encodeIndexBuffer:function(g,f,x){r(x==2||x==4),r(f%3==0);var _=h(g,x),C=n.exports.meshopt_encodeIndexBufferBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexBuffer,C,_,f,4)},encodeIndexSequence:function(g,f,x){r(x==2||x==4);var _=h(g,x),C=n.exports.meshopt_encodeIndexSequenceBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexSequence,C,_,f,4)},encodeGltfBuffer:function(g,f,x,_){var C={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(C[_]),C[_](g,f,x)},encodeFilterOct:function(g,f,x,_){return r(x==4||x==8),r(_>=1&&_<=16),p(n.exports.meshopt_encodeFilterOct,g,f,x,_,16)},encodeFilterQuat:function(g,f,x,_){return r(x==8),r(_>=4&&_<=16),p(n.exports.meshopt_encodeFilterQuat,g,f,x,_,16)},encodeFilterExp:function(g,f,x,_,C){r(x>0&&x%4==0),r(_>=1&&_<=24);var V={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,f,x,_,x,C?V[C]:1)}}}();var qan=T(S()),Ioe=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(C){r=C.instance,r.exports.__wasm_call_ctors()});function a(C){for(var V=new Uint8Array(C.length),L=0;L96?Z-97:Z>64?Z-39:Z+4}for(var G=0,L=0;L0?x(C,V,L,u[Z],d[G]):s.then(function(){var I=new Uint8Array(C*V);return c(r,r.exports[u[Z]],I,C,V,L,r.exports[d[G]]),I})}}}();var tcn=T(S()),$an=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCf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HcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nmba8Lcj1jjbfRbbcFeGmekaAcufhYdnaAaL9hmbaYcFeGce0mbahaifydbaH9hmekdndnaAclSmbaLcl9hmekdnaYcFeGce0mbahaifydbaH9hmdkaLcufcFeGce0mbagawfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgYEBdlaAaOaHaYEBdbaAaYa8AGcb9hBdwaEcefhEkaeclfgecx9hmbkdna5cifg5ad9pmba8Fcxfh8FaEcifaT9nmekkaETmdcbhiinJbbbbJbbjZaqaQaDaicx2fgAydlgKaAydbgYaAydwgHEgLcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaYaKaHEg8Fcx2fgHIdwgRNaeIdz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ydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var x=new Uint8Array(f.length),_=0;_96?C-97:C>64?C-39:C+4}for(var V=0,_=0;_=3),r(C>=0&&C<=f.length),r(C%3==0),r(V>=0);for(var Z=0,G=0;G<(L?L.length:0);++G)r(L[G]in g),r(this.useExperimentalFeatures||L[G]!="Prune"),Z|=g[L[G]];var I=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),v=d(n.exports.meshopt_simplify,I,f.length,x,x.length/_,_*4,C,V,Z);return v[0]=f instanceof Uint32Array?v[0]:new f.constructor(v[0]),v},simplifyWithAttributes:function(f,x,_,C,V,L,Z,G,I,v){r(this.useExperimentalFeatures),r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C instanceof Float32Array),r(C.length%V==0),r(V>=0),r(Z==null||Z instanceof Uint8Array),r(Z==null||Z.length==x.length/_),r(G>=0&&G<=f.length),r(G%3==0),r(I>=0),r(Array.isArray(L)),r(V>=L.length),r(L.length<=32);for(var P=0;P=0);for(var w=0,P=0;P<(v?v.length:0);++P)r(v[P]in g),w|=g[v[P]];var F=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),b=u(n.exports.meshopt_simplifyWithAttributes,F,f.length,x,x.length/_,_*4,C,V*4,new Float32Array(L),Z?new Uint8Array(Z):null,G,I,w);return b[0]=f instanceof Uint32Array?b[0]:new f.constructor(b[0]),b},getScale:function(f,x){return r(f instanceof Float32Array),r(f.length%x==0),r(x>=3),h(n.exports.meshopt_simplifyScale,f,f.length/x,x*4)},simplifyPoints:function(f,x,_,C,V,L){return r(this.useExperimentalFeatures),r(f instanceof Float32Array),r(f.length%x==0),r(x>=3),r(_>=0&&_<=f.length/x),C?(r(C instanceof Float32Array),r(C.length%V==0),r(V>=3),r(f.length/x==C.length/V),p(n.exports.meshopt_simplifyPoints,f,f.length/x,x*4,C,V*4,L,_)):p(n.exports.meshopt_simplifyPoints,f,f.length/x,x*4,void 0,0,0,_)}}}();var ocn=T(S()),ncn=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtf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bhYJbbbbh8FJbbbbhgcbhlinJbbbbh3dnaPTmbJbbjZaP:Z:vh3kaka8Ea3NgaUdaaka5a3NghUd3akaEa3Ng8JUdKJbbbbh3dnagagNaYaYNa8Fa8FNMMg8KJbbbb9BmbJbbjZa8K:r:vh3kakaga3NUd8Saka8Fa3NUdyakaYa3NUd8Kdndndnakyd8WgQakydUgAakcKfaeaiakc;abfaKamara8Maqz:ejjjbgCcuSmbdnaPaD9pmbaAaraiaCcx2fgXydbfRbbcFeSfaraXclfydbfRbbcFeSfaraXcwfydbfRbbcFeSfaw9nmdkaQaAcbaeaiakc;abfaKamara8MJbbbbz:ejjjbgCcu9hmekakaaUdCakahUdzaka8JUdxakcuBdwakcFFF;7rBdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var x=new Uint8Array(f.length),_=0;_96?C-97:C>64?C-39:C+4}for(var V=0,_=0;_=3),r(C<=255||C>0),r(V<=512),r(V%4==0),L=L||0;var Z=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return u(Z,x,x.length/_,_*4,C,V,L)},computeClusterBounds:function(f,x,_){r(f.length%3==0),r(f.length/3<=512),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3);var C=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return g(C,x,x.length/_,_*4)},computeMeshletBounds:function(f,x,_){return r(f.meshletCount!=0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),p(f,x,x.length/_,_*4)},extractMeshlet:function(f,x){return r(x>=0&&x{wr._error=t}),wr._decoderTaskProcessor=e}return wr._decoderTaskProcessor};wr.decodePointCloud=function(e){let t=wr._getDecoderTaskProcessor();if(l(wr._error))throw wr._error;if(wr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};wr.decodeBufferView=function(e){let t=wr._getDecoderTaskProcessor();if(l(wr._error))throw wr._error;if(wr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var qp=wr;function rg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=bt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(rg.prototype=Object.create(Ki.prototype),rg.prototype.constructor=rg);Object.defineProperties(rg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function VAe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=bt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Xoe(e,n)}}rg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=bt.LOADING,this._promise=VAe(this),this._promise)};function Xoe(e,t){throw e.unload(),e._state=bt.FAILED,e.getError("Failed to load Draco",t)}async function LAe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=bt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}rg.prototype.process=function(e){if(this._state===bt.READY)return!0;if(this._state!==bt.PROCESSING||(l(this._dracoError)&&Xoe(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=qp.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=LAe(this,c)};rg.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var yC=rg;var Ycn=T(S(),1);var Fcn=T(S(),1);function RAe(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Ze.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Ze.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ze({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var i_=RAe;function $p(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,d=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=d,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=bt.UNLOADED,this._promise=void 0}l(Object.create)&&($p.prototype=Object.create(Ki.prototype),$p.prototype.constructor=$p);Object.defineProperties($p.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});$p.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=ZAe(this),this._promise):(this._promise=GAe(this),this._promise)};function Woe(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function ZAe(e){e._state=bt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await IAe(i);if(e.isDestroyed())return;let r=Woe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=bt.READY,e}catch(n){return e.isDestroyed()?void 0:Poe(e,n,"Failed to load embedded image")}}async function GAe(e){e._state=bt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await WAe(i);if(e.isDestroyed())return;let r=Woe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=bt.READY,e}catch(o){return e.isDestroyed()?void 0:Poe(e,o,`Failed to load image: ${n}`)}}function Poe(e,t,n){return e.unload(),e._state=bt.FAILED,Promise.reject(e.getError(n,t))}function EAe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new ae("Image format is not recognized")}async function IAe(e){let t=EAe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Vl(n)}return $p._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var XAe=/(^data:image\/ktx2)|(\.ktx2$)/i;function WAe(e){let t=e.getUrlComponent(!1,!0);return XAe.test(t)?Vl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}$p.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};$p._loadImageFromTypedArray=i_;var xC=$p;var rln=T(S(),1);var zcn=T(S(),1),PAe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},wa=Object.freeze(PAe);function sg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),d=y(e.loadBuffer,!1),u=y(e.loadTypedArray,!1),h=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=h,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=d,this._loadTypedArray=u,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=bt.UNLOADED,this._promise=void 0}l(Object.create)&&(sg.prototype=Object.create(Ki.prototype),sg.prototype.constructor=sg);Object.defineProperties(sg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var vAe=new VH;sg.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=wAe(this),this._promise):(this._promise=FAe(this),this._promise)};async function wAe(e){e._state=bt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=bt.LOADED,e)}catch(n){if(e.isDestroyed())return;CH(e,n)}}async function FAe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=bt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=AAe(e,a),e._state=bt.PROCESSING,e}catch(s){if(e.isDestroyed())return;CH(e,s)}}function AAe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ae.getSizeInBytes(s),c=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let h=r*a,p=new Uint8Array(c,d,h);c=new Uint8Array(p).buffer,d=0,us("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Ae.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Ae.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Ae.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function CH(e,t){throw e.unload(),e._state=bt.FAILED,e.getError("Failed to load index buffer",t)}function VH(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}VH.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};VH.prototype.execute=function(){this.buffer=voe(this.typedArray,this.indexDatatype,this.context)};function voe(e,t,n){let i=yt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}sg.prototype.process=function(e){if(this._state===bt.READY)return!0;if(this._state!==bt.LOADED&&this._state!==bt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=Q.fromTypedArray(t),this._indexDatatype=n)}catch(o){CH(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=vAe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,wa.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=voe(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=bt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};sg.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var _C=sg;var bmn=T(S(),1);var Iln=T(S(),1);var cln=T(S(),1);function MAe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Cs=MAe;var pln=T(S(),1);var uln=T(S(),1);function NAe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var ar=NAe;function zt(){}zt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};zt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i0)return i.byteStride}return Q.getSizeInBytes(t.componentType)*Td(t.type)}var Pl=UAe;function DAe(e){We.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),We.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),We.mesh(e,function(n){We.meshPrimitive(n,function(i){if(i.mode=y(i.mode,ie.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Cs(e.materials,o)}})}),We.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=Pl(e,i),r.target=ie.ARRAY_BUFFER}}),We.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ie.ELEMENT_ARRAY_BUFFER}}),We.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,d=l(o.values)?o.values:{};o.values=d,d.ambient=l(d.ambient)?d.ambient:[0,0,0,1],d.emission=l(d.emission)?d.emission:[0,0,0,1],d.transparency=y(d.transparency,1),c!=="CONSTANT"&&(d.diffuse=l(d.diffuse)?d.diffuse:[0,0,0,1],c!=="LAMBERT"&&(d.specular=l(d.specular)?d.specular:[0,0,0,1],d.shininess=y(d.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&We.materialValue(n,function(c){l(c.index)&&o_(c)}),o_(n.emissiveTexture),o_(n.normalTexture),o_(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),o_(s.baseColorTexture),o_(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),o_(a.specularGlossinessTexture))}),We.animation(e,function(n){We.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=BAe(e);return We.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),We.sampler(e,function(n){n.wrapS=y(n.wrapS,ie.REPEAT),n.wrapT=y(n.wrapT,ie.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function BAe(e){let t={};return We.animation(e,function(n){We.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function o_(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var PI=DAe;var vln=T(S(),1);function OAe(e){return We.shader(e,function(t){g5(t)}),We.buffer(e,function(t){g5(t)}),We.image(e,function(t){g5(t)}),g5(e),e}function g5(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var ag=OAe;var Qln=T(S(),1);var Uln=T(S(),1);var Aln=T(S(),1);function YAe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var vI=YAe;function HAe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),vI(e,t),n.length===0&&delete e.extensionsUsed}}var r_=HAe;var zAe=4;function KAe(e){if(Om(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=woe(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ae("Binary glTF version is not 1 or 2");return i===1?JAe(e,n):QAe(e,n)}function woe(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r0){let h=y(u.binary_glTF,u.KHR_binary_glTF);l(h)&&(h.extras._pipeline.source=d,delete h.uri)}return r_(c,"KHR_binary_glTF"),c}function QAe(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var wI=KAe;var edn=T(S(),1);function jAe(e){return We.shader(e,function(t){y5(t)}),We.buffer(e,function(t){y5(t)}),We.image(e,function(t){y5(t)}),y5(e),e}function y5(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var FI=jAe;var wun=T(S(),1);var odn=T(S(),1);function qAe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Cs(n,t,!0)}var Iu=qAe;var fdn=T(S(),1);var adn=T(S(),1);function $Ae(e){switch(e){case Q.BYTE:return function(t,n,i,o,r){for(let s=0;s-1:!1}var iMe=[ie.ZERO,ie.ONE,ie.SRC_COLOR,ie.ONE_MINUS_SRC_COLOR,ie.SRC_ALPHA,ie.ONE_MINUS_SRC_ALPHA,ie.DST_ALPHA,ie.ONE_MINUS_DST_ALPHA,ie.DST_COLOR,ie.ONE_MINUS_DST_COLOR];function oMe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(iMe.indexOf(e[n])===-1)return t;return e}function rMe(e){let t={},n={},i=e.techniques;return l(i)&&(We.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Foe(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,tMe),blendFactors:oMe(c.blendFuncSeparate,nMe)})}Foe(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Iu(e,"KHR_blend")),We.material(e,function(o){if(l(o.technique)){let r=n[o.technique];We.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var AI=rMe;var Pdn=T(S(),1);var Rdn=T(S(),1);function sMe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Cs(n,t,!0),Iu(e,t)}var MI=sMe;function aMe(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,We.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(We.techniqueAttribute(a,function(h,p){u=a.parameters[h],d.attributes[p]={semantic:u.semantic}}),We.techniqueUniform(a,function(h,p){u=a.parameters[h],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},l(n[c])||(n[c]={}),n[c][h]=p}),l(o[a.program]))d.program=o[a.program];else{let h=e.programs[a.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[h.fragmentShader];p.fragmentShader=Cs(r.shaders,g,!0);let f=e.shaders[h.vertexShader];p.vertexShader=Cs(r.shaders,f,!0),d.program=Cs(r.programs,p),o[a.program]=d.program}i[c]=Cs(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Iu(e,"KHR_techniques_webgl"),MI(e,"KHR_techniques_webgl"))}return We.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};We.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var NI=aMe;var Ydn=T(S(),1);var Mdn=T(S(),1);function cMe(e,t){xo.typeOf.object("material",e),xo.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,d=t(c.index,c);if(l(d))return d}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,d=t(c.index,c);if(l(d))return d}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:d}=s;if(l(c)){let u=t(c.index,c);if(l(u))return u}if(l(d)){let u=t(d.index,d);if(l(u))return u}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:d,emission:u,specular:h}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(h)&&l(h.index)){let p=t(h.index,h);if(l(p))return p}}}let o=We.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var TC=cMe;var Aoe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function lMe(e,t){return t=y(t,Aoe),Aoe.forEach(function(n){t.indexOf(n)>-1&&uMe(e,n)}),e}var dMe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function uMe(e,t){let n=dMe[t],i=e[n];if(l(i)){let o=0,r=bf[t](e),s=i.length;for(let a=0;at&&o.attributes[c]--}),We.meshPrimitiveTarget(o,function(a){We.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),We.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),We.animation(e,function(i){We.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};pf.buffer=function(e,t){e.buffers.splice(t,1),We.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};pf.bufferView=function(e,t){if(e.bufferViews.splice(t,1),We.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),We.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),We.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ar(e,"KHR_draco_mesh_compression")&&We.mesh(e,function(i){We.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),ar(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.bufferView)&&d.bufferView>t&&d.bufferView--,l(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,l(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(ar(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;st&&u.values--,l(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,l(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};pf.image=function(e,t){e.images.splice(t,1),We.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};pf.mesh=function(e,t){e.meshes.splice(t,1),We.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};pf.node=function(e,t){e.nodes.splice(t,1),We.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),We.animation(e,function(i){We.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),We.technique(e,function(i){We.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),We.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),We.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};pf.material=function(e,t){e.materials.splice(t,1),We.mesh(e,function(i){We.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};pf.sampler=function(e,t){e.samplers.splice(t,1),We.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};pf.texture=function(e,t){if(e.textures.splice(t,1),We.material(e,function(i){TC(i,function(o,r){r.index>t&&--r.index})}),ar(e,"EXT_feature_metadata")){We.mesh(e,function(r){We.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let h=0;ht&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c].texture;u.index>t&&--u.index}}}}if(ar(e,"EXT_mesh_features")&&We.mesh(e,function(i){We.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;dt&&--u.texture.index}}}})}),ar(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;st&&--u.index}}}}};function bf(){}bf.accessor=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){We.meshPrimitiveAttribute(i,function(r){t[r]=!0}),We.meshPrimitiveTarget(i,function(r){We.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),We.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),We.animation(e,function(n){We.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),ar(e,"EXT_mesh_gpu_instancing")&&We.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),ar(e,"CESIUM_primitive_outline")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};bf.buffer=function(e){let t={};return We.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};bf.bufferView=function(e){let t={};if(We.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),We.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),We.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ar(e,"KHR_draco_mesh_compression")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),ar(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(ar(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r0&&(t[n.mesh]=!0)}}),t};function Moe(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!Moe(e,o,n)}).length===0}bf.node=function(e){let t={};return We.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),We.skinJoint(n,function(i){t[i]=!0})}),We.animation(e,function(n){We.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),We.technique(e,function(n){We.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),We.node(e,function(n,i){Moe(e,i,t)||(t[i]=!0)}),t};bf.material=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};bf.texture=function(e){let t={};if(We.material(e,function(n){TC(n,function(i){t[i]=!0})}),ar(e,"EXT_feature_metadata")){We.mesh(e,function(o){We.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;u0)for(s.mesh=n.meshes[c[0]],t=1;t0&&l(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),We.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=vMe[a];l(u)?(d=u+c,t[r]=d):l(PMe[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),We.technique(e,function(n){We.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function FMe(e){We.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function ZH(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Pl(e,t)}function AMe(e){We.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),We.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=ZH(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function MMe(e){let t,n,i,o=e.bufferViews,r={};We.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};We.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let d=0,u=0,h=c.length;for(t=0;t=0;--r)if(i[r]===t){i.splice(r,1);return}}}),We.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Doe(n)&&Boe(e,i))}}),delete e.nodes[t]}function kMe(e){return We.node(e,function(t,n){Doe(t)&&Boe(e,n)}),e}function UMe(e){We.animation(e,function(t){We.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=s_(e,i);i.min=o.min,i.max=o.max}})})}function DMe(e){We.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=s_(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function BMe(e){e.asset=y(e.asset,{}),e.asset.version="2.0",Uoe(e),CMe(e),kMe(e),VMe(e),LMe(e),ZMe(e),EMe(e),AMe(e),MMe(e),NMe(e),UMe(e),DMe(e),IMe(e),XMe(e),WMe(e),wMe(e),BI(e),FMe(e),AI(e),NI(e),RMe(e)}var OMe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],YMe=["u_diffuse","u_diffuse_mat"];function GH(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function EH(e){return l(e.index)}function IH(e){return Array.isArray(e)&&e.length===4}function Ooe(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function HMe(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,OMe),i=y(t.baseColorFactorNames,YMe);We.material(e,function(o){We.materialValue(o,function(r,s){n.indexOf(s)!==-1&&EH(r)?(GH(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&IH(r)&&(GH(o),o.pbrMetallicRoughness.baseColorFactor=Ooe(r))})}),a_(e,"KHR_techniques_webgl"),a_(e,"KHR_blend")}function RH(e,t){l(t)&&(IH(t)?e.pbrMetallicRoughness.baseColorFactor=Ooe(t):EH(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function koe(e,t){l(t)&&(IH(t)?e.emissiveFactor=t.slice(0,3):EH(t)&&(e.emissiveTexture=t))}function zMe(e){We.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=y(n.values,{}),o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,d=n.transparent;GH(t),n.technique==="CONSTANT"?(Iu(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},RH(t,s),RH(t,o)):(RH(t,r),koe(t,o),koe(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),a_(e,"KHR_materials_common")}var OI=gMe;var jun=T(S(),1);var Mun=T(S(),1);var si={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function KMe(e){switch(e){case si.POSITION:return"positionMC";case si.NORMAL:return"normalMC";case si.TANGENT:return"tangentMC";case si.TEXCOORD:return"texCoord";case si.COLOR:return"color";case si.JOINTS:return"joints";case si.WEIGHTS:return"weights";case si.FEATURE_ID:return"featureId"}}si.hasSetIndex=function(e){switch(e){case si.POSITION:case si.NORMAL:case si.TANGENT:return!1;case si.TEXCOORD:case si.COLOR:case si.JOINTS:case si.WEIGHTS:case si.FEATURE_ID:return!0}};si.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return si.POSITION;case"NORMAL":return si.NORMAL;case"TANGENT":return si.TANGENT;case"TEXCOORD":return si.TEXCOORD;case"COLOR":return si.COLOR;case"JOINTS":return si.JOINTS;case"WEIGHTS":return si.WEIGHTS;case"_FEATURE_ID":return si.FEATURE_ID}};si.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return si.POSITION;case"RGBA":case"RGB":case"RGB565":return si.COLOR;case"NORMAL":case"NORMAL_OCT16P":return si.NORMAL;case"BATCH_ID":return si.FEATURE_ID}};si.getGlslType=function(e){switch(e){case si.POSITION:case si.NORMAL:case si.TANGENT:return"vec3";case si.TEXCOORD:return"vec2";case si.COLOR:return"vec4";case si.JOINTS:return"ivec4";case si.WEIGHTS:return"vec4";case si.FEATURE_ID:return"int"}};si.getVariableName=function(e,t){let n=KMe(e);return l(t)&&(n+=`_${t}`),n};var Vt=Object.freeze(si);function lc(){}lc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${n.message}`);let o=new ae(i);return l(n)&&(o.stack=`Original stack: +${n.stack} +Handler stack: +${o.stack}`),o};lc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:m.ZERO,l(e.rotation)?e.rotation:ve.IDENTITY,l(e.scale)?e.scale:m.ONE)};lc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r>t};ua.fromSubtreeJson=async function(e,t,n,i,o){let r=new ua(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=M9e(n);let a=s.json;r._subtreeJson=a;let c;if(ri(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let V=a.tileMetadata;c=a.propertyTables[V]}let d=[];if(l(a.contentMetadata)){let V=a.contentMetadata.length;for(let L=0;L0;u=u||h;for(let p=0;p>BigInt(61)),d=c%2===0?hC.encode2D(i,o,r):hC.encode2D(i,r,o),u=Kp.fromFacePositionLevel(c,BigInt(d),i),h,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;h=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else h=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Kp.getTokenFromId(u._cellId),minimumHeight:h,maximumHeight:p}}}}var sNe=new m,aNe=new m,MH=new m,cNe=new $;function ore(e,t,n,i,o){if(t===0)return e;let r=m.unpack(e,0,aNe),s=$.unpack(e,3,cNe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,h=m.fromElements(a,a,1,sNe);l(o)&&(u=-1+(2*o+1)*a,h.z=a);let p=m.fromElements(c,d,u,MH);p=$.multiplyByVector(s,p,MH),p=m.add(p,r,MH);let g=$.clone(s);g=$.multiplyByScale(g,h,g);let f=new Array(12);return m.pack(p,f),$.pack(g,f,3),f}var lNe=new ce;function rre(e,t,n,i,o){if(t===0)return e.slice();let r=ce.unpack(e,0,lNe),s=e[4],a=e[5],c=Math.pow(2,-t),d=c*r.width,u=W.negativePiToPi(r.west+n*d),h=W.negativePiToPi(u+d),p=c*r.height,g=W.negativePiToPi(r.south+i*p),f=W.negativePiToPi(g+p),x=s,_=a;if(l(o)){let C=c*(a-s);x+=o*C,_=x+C}return[u,g,h,f,x,_]}function dNe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=nre(i,o,n,!1,t),s=tre(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=sre(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function sre(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}jc.prototype.hasProperty=function(e,t){return!1};jc.prototype.getFeature=function(e){};jc.prototype.applyDebugSettings=function(e,t){};jc.prototype.applyStyle=function(e){};jc.prototype.update=function(e,t){};jc.prototype.pick=function(e,t,n){};jc.prototype.isDestroyed=function(){return!1};jc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),me(this)};jc._deriveBoundingBox=ore;jc._deriveBoundingRegion=rre;jc._deriveBoundingVolumeS2=ire;var ZC=jc;var nwn=T(S(),1);var Jfn=T(S(),1),uNe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Fl=Object.freeze(uNe);var Hvn=T(S(),1);var xpn=T(S(),1);var $fn=T(S(),1);function GC(e,t){this._distance=t,this._normal=new are(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(GC.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});GC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new GC(e.normal,e.distance),t};GC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new GC(e.normal,e.distance)};function are(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(are.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var h_=GC;function dc(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this.edgeColor=B.clone(y(e.edgeColor,B.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new ge,this.planeRemoved=new ge,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?mre:hre,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o0&&(r=Ht.OUTSIDE);for(let s=0;s80*n){a=1/0,c=1/0;let u=-1/0,h=-1/0;for(let p=n;pu&&(u=g),f>h&&(h=f)}d=Math.max(u-a,h-c),d=d!==0?32767/d:0}return tX(r,s,n,a,c,d,0),s}function gre(e,t,n,i,o){let r;if(o===XNe(e,t,n,i)>0)for(let s=t;s=t;s-=i)r=bre(s/i|0,e[s],e[s+1],r);return r&&EC(r,r.next)&&(iX(r),r=r.next),r}function f_(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(EC(n,n.next)||Fr(n.prev,n,n.next)===0)){if(iX(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function tX(e,t,n,i,o,r,s){if(!e)return;!s&&r&&LNe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?gNe(e,i,o,r):bNe(e)){t.push(c.i,e.i,d.i),iX(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=yNe(f_(e),t),tX(e,t,n,i,o,r,2)):s===2&&xNe(e,t,n,i,o,r):tX(f_(e),t,n,i,o,r,1);break}}}function bNe(e){let t=e.prev,n=e,i=e.next;if(Fr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,d=i.y,u=Math.min(o,r,s),h=Math.min(a,c,d),p=Math.max(o,r,s),g=Math.max(a,c,d),f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=g&&eX(o,a,r,c,s,d,f.x,f.y)&&Fr(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function gNe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Fr(o,r,s)>=0)return!1;let a=o.x,c=r.x,d=s.x,u=o.y,h=r.y,p=s.y,g=Math.min(a,c,d),f=Math.min(u,h,p),x=Math.max(a,c,d),_=Math.max(u,h,p),C=kH(g,f,t,n,i),V=kH(x,_,t,n,i),L=e.prevZ,Z=e.nextZ;for(;L&&L.z>=C&&Z&&Z.z<=V;){if(L.x>=g&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&eX(a,u,c,h,d,p,L.x,L.y)&&Fr(L.prev,L,L.next)>=0||(L=L.prevZ,Z.x>=g&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&eX(a,u,c,h,d,p,Z.x,Z.y)&&Fr(Z.prev,Z,Z.next)>=0))return!1;Z=Z.nextZ}for(;L&&L.z>=C;){if(L.x>=g&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&eX(a,u,c,h,d,p,L.x,L.y)&&Fr(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;Z&&Z.z<=V;){if(Z.x>=g&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&eX(a,u,c,h,d,p,Z.x,Z.y)&&Fr(Z.prev,Z,Z.next)>=0)return!1;Z=Z.nextZ}return!0}function yNe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!EC(i,o)&&xre(i,n,n.next,o)&&nX(i,o)&&nX(o,i)&&(t.push(i.i,n.i,o.i),iX(n),iX(n.next),n=e=o),n=n.next}while(n!==e);return f_(n)}function xNe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&GNe(s,a)){let c=_re(s,a);s=f_(s,s.next),c=f_(c,c.next),tX(s,t,n,i,o,r,0),tX(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function _Ne(e,t,n,i){let o=[];for(let r=0,s=t.length;r=n.next.y&&n.next.y!==n.y){let h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>r&&(r=h,s=n.x=n.x&&n.x>=c&&i!==n.x&&yre(os.x||n.x===s.x&&VNe(s,n)))&&(s=n,u=h)}n=n.next}while(n!==a);return s}function VNe(e,t){return Fr(e.prev,e,t.prev)<0&&Fr(t.next,e,e.next)<0}function LNe(e,t,n,i){let o=e;do o.z===0&&(o.z=kH(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,RNe(o)}function RNe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let d=0;d0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function kH(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function ZNe(e){let t=e,n=e;do(t.x=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function eX(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&yre(e,t,n,i,o,r,s,a)}function GNe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!ENe(e,t)&&(nX(e,t)&&nX(t,e)&&INe(e,t)&&(Fr(e.prev,e,t.prev)||Fr(e,t.prev,t))||EC(e,t)&&Fr(e.prev,e,e.next)>0&&Fr(t.prev,t,t.next)>0)}function Fr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function EC(e,t){return e.x===t.x&&e.y===t.y}function xre(e,t,n,i){let o=G5(Fr(e,t,n)),r=G5(Fr(e,t,i)),s=G5(Fr(n,i,e)),a=G5(Fr(n,i,t));return!!(o!==r&&s!==a||o===0&&Z5(e,n,t)||r===0&&Z5(e,i,t)||s===0&&Z5(n,e,i)||a===0&&Z5(n,t,i))}function Z5(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function G5(e){return e>0?1:e<0?-1:0}function ENe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&xre(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function nX(e,t){return Fr(e.prev,e,e.next)<0?Fr(e,t,e.next)>=0&&Fr(e,e.prev,t)>=0:Fr(e,t,e.prev)<0||Fr(e,e.next,t)<0}function INe(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function _re(e,t){let n=UH(e.i,e.x,e.y),i=UH(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function bre(e,t,n,i){let o=UH(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function iX(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function UH(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function XNe(e,t,n,i){let o=0;for(let r=t,s=n-i;r0?ds.COUNTER_CLOCKWISE:ds.CLOCKWISE};hg.triangulate=function(e,t){let n=D.packArray(e);return DH(n,t,2)};var Vre=new m,Lre=new m,Rre=new m,Tre=new m,Sre=new m,Cre=new m,tb=new m,Zre=new D,Gre=new D,Ere=new D,IC=new D;hg.computeSubdivision=function(e,t,n,i,o){o=y(o,W.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),h=0,p=0;for(a=0;a0;){let L=s.pop(),Z=s.pop(),G=s.pop(),I=m.fromArray(d,G*3,Vre),v=m.fromArray(d,Z*3,Lre),P=m.fromArray(d,L*3,Rre),w,F,b;r&&(w=D.fromArray(u,G*2,Zre),F=D.fromArray(u,Z*2,Gre),b=D.fromArray(u,L*2,Ere));let R=m.multiplyByScalar(m.normalize(I,Tre),x,Tre),E=m.multiplyByScalar(m.normalize(v,Sre),x,Sre),X=m.multiplyByScalar(m.normalize(P,Cre),x,Cre),A=m.magnitudeSquared(m.subtract(R,E,tb)),N=m.magnitudeSquared(m.subtract(E,X,tb)),O=m.magnitudeSquared(m.subtract(X,R,tb)),U=Math.max(A,N,O),Y,k,H;U>C?A===U?(Y=`${Math.min(G,Z)} ${Math.max(G,Z)}`,a=f[Y],l(a)||(k=m.add(I,v,tb),m.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(w,F,IC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(G,a,L),s.push(a,Z,L)):N===U?(Y=`${Math.min(Z,L)} ${Math.max(Z,L)}`,a=f[Y],l(a)||(k=m.add(v,P,tb),m.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(F,b,IC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(Z,a,G),s.push(a,L,G)):O===U&&(Y=`${Math.min(L,G)} ${Math.max(L,G)}`,a=f[Y],l(a)||(k=m.add(P,I,tb),m.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(b,w,IC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(L,a,Z),s.push(a,G,Z)):(g.push(G),g.push(Z),g.push(L))}let V={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:we.TRIANGLES};return r&&(V.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new ct(V)};var vNe=new he,wNe=new he,FNe=new he,BH=new he;hg.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,W.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),h=0,p=0;for(a=0;a0;){let G=s.pop(),I=s.pop(),v=s.pop(),P=m.fromArray(d,v*3,Vre),w=m.fromArray(d,I*3,Lre),F=m.fromArray(d,G*3,Rre),b,R,E;r&&(b=D.fromArray(u,v*2,Zre),R=D.fromArray(u,I*2,Gre),E=D.fromArray(u,G*2,Ere));let X=e.cartesianToCartographic(P,vNe),A=e.cartesianToCartographic(w,wNe),N=e.cartesianToCartographic(F,FNe);C.setEndPoints(X,A);let O=C.surfaceDistance;V.setEndPoints(A,N);let U=V.surfaceDistance;L.setEndPoints(N,X);let Y=L.surfaceDistance,k=Math.max(O,U,Y),H,J,te,z,j;k>_?O===k?(H=`${Math.min(v,I)} ${Math.max(v,I)}`,a=f[H],l(a)||(J=C.interpolateUsingFraction(.5,BH),te=(X.height+A.height)*.5,z=m.fromRadians(J.longitude,J.latitude,te,e,tb),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(j=D.add(b,R,IC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(v,a,G),s.push(a,I,G)):U===k?(H=`${Math.min(I,G)} ${Math.max(I,G)}`,a=f[H],l(a)||(J=V.interpolateUsingFraction(.5,BH),te=(A.height+N.height)*.5,z=m.fromRadians(J.longitude,J.latitude,te,e,tb),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(j=D.add(R,E,IC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(I,a,v),s.push(a,G,v)):Y===k&&(H=`${Math.min(G,v)} ${Math.max(G,v)}`,a=f[H],l(a)||(J=L.interpolateUsingFraction(.5,BH),te=(N.height+X.height)*.5,z=m.fromRadians(J.longitude,J.latitude,te,e,tb),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(j=D.add(E,b,IC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(G,a,I),s.push(a,v,I)):(g.push(v),g.push(I),g.push(G))}let Z={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:we.TRIANGLES};return r&&(Z.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new ct(Z)};hg.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,ne.default);let o=WNe,r=PNe;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};fg.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};fg.prototype.contains=function(e){return this._array.indexOf(e)!==-1};fg.prototype.clear=function(){this._array.length=this._offset=this._length=0};fg.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var pg=fg;var er={};er.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let d=0;d0?new Array(o):void 0;for(let a=0;aW.PI){let c=s;s=a,a=c}if(!(r.longitudea))return n.cartographicToCartesian(r)}function HNe(e,t,n,i){if(i===en.RHUMB)return YNe(e,t,n);let o=qn.lineSegmentPlane(e,t,an.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var zNe=new he;function KNe(e,t,n){let i=[],o,r,s,a,c,d=0;for(;dt.cartesianToCartographic(h,zNe).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=HNe(o,r,t,n),++d,!l(c))continue;e.splice(d,0,c),i.push({position:d,type:s,visited:!1,next:a,theta:u(c)})}++d}return i}function Pre(e,t,n,i,o,r,s){let a=[],c=r,d=h=>p=>p.position===h,u=[];do{let h=n[c];a.push(h);let p=i.findIndex(d(c)),g=i[p];if(!l(g)){++c;continue}let{visited:f,type:x,next:_}=g;if(g.visited=!0,x===0){if(_===0){let Z=i[p-(s?1:-1)];if(Z?.position===c+1)Z.visited=!0;else{++c;continue}}if(!f&&s&&_>0||r===c&&!s&&_<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}f||u.push(c);let V=p+(s?1:-1),L=i[V];if(!l(L)){++c;continue}c=L.position}while(c=0&&c!==r&&a.lengthd.theta-u.theta);let c=s[0].z>=0;o=Pre(i,o,s,a,1,0,c)}return i};er.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new pg;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),h=u.positions,p=u.holes,g,f;if(i)for(f=h.length,g=0;g1){for(let v of I)c.enqueue(new Pa(v,p));continue}}let V=h.slice(),L=l(p)?p.length:0,Z=[],G;for(g=0;gMath.PI&&(e-=W.TWO_PI),e}}});var XC=new he,t5e=new m;Ar.prototype.getLatitude=function(e){l(e)||(e=ne.default),XC.latitude=this.conformalLatitude,XC.longitude=this.longitude,XC.height=0;let t=this.ellipsoid.cartographicToCartesian(XC,t5e);return e.cartesianToCartographic(t,XC),XC.latitude};var n5e=new pn,i5e=new m,o5e=new m;Ar.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=Ar.NORTH_POLE_TANGENT_PLANE,o=Ar.SOUTH_POLE;n<0&&(i=Ar.SOUTH_POLE_TANGENT_PLANE,o=Ar.NORTH_POLE);let r=n5e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=m.subtract(r.origin,o,i5e),m.normalize(r.direction,r.direction);let s=qn.rayPlane(r,i.plane,o5e),a=m.subtract(s,o,s),c=m.dot(i.xAxis,a),d=n*m.dot(i.yAxis,a);return l(t)?(t.position=new D(c,d),t.tangentPlane=i,t):new Ar(new D(c,d),i)};Ar.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=0?s:s+W.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),d=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==en.RHUMB){let p=D.subtract(t.position,e.position,S5e),g=D.dot(t.position,p)/D.dot(p,p);if(g>0&&g<1){let f=D.add(t.position,D.multiplyByScalar(p,-g,p),C5e),x=uc.clone(t,V5e);x.position=f;let _=x.getLatitude(n);r.south=Math.min(r.south,_),r.north=Math.max(r.north,_),Math.abs(c)>Math.abs(_)&&(d=_)}}let u=t.x*e.y-e.x*t.y,h=Math.sign(u);h!==0&&(h*=D.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=h),d<=0&&(o.southAngle+=h)}var Nre=new uc,L5e=new uc,Xu={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Wu.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ce),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Xu.northAngle=0,Xu.southAngle=0,Xu.westOverIdl=Number.POSITIVE_INFINITY,Xu.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=uc.fromCartesian(e[0],L5e);for(let s=1;sXu.eastOverIdl-Xu.westOverIdl&&(i.west=Xu.westOverIdl,i.east=Xu.eastOverIdl,i.east>W.PI&&(i.east=i.east-W.TWO_PI),i.west>W.PI&&(i.west=i.west-W.TWO_PI)),W.equalsEpsilon(Math.abs(Xu.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(Xu.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var R5e=new uc;function Z5e(e,t,n){return e.height>=W.PI||e.width>=W.PI?uc.fromCartesian(t[0],R5e).tangentPlane:Qr.fromPoints(t,n)}var kre=new he;function G5e(e,t,n){return(i,o)=>{if(e.height>=W.PI||e.width>=W.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s=W.PI||e.width>=W.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,kre);return l(r)||(r=new D),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return uc.fromCartesian(o,r)};let i=Qr.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function I5e(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?Dn.splitPolygonsOnEquator(o,t,n,r):o}function X5e(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return ze.fromRectangle(t,void 0,wre);let o=e,r=Qr.fromPoints(o,n);return Dn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,wre)}Wu.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,d=e._arcType,u=e._textureCoordinates,h=l(u),p=r.positions;if(p.length<3)return;let g=e.rectangle,f=Dn.polygonsFromHierarchy(r,h,G5e(g,p,n),!s,n,I5e(g,n,d,s)),x=f.hierarchy,_=f.polygons,C=function(X){return X},V=h?Dn.polygonsFromHierarchy(u,!0,C,!1,n).polygons:void 0;if(x.length===0)return;let L=x[0].outerRing,Z=X5e(L,g,n,o),G=[],I=e._height,v=e._extrudedHeight,P=e._perPositionHeightExtrude||!W.equalsEpsilon(I,v,0,W.EPSILON2),w={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:Z5e(g,L,n).plane.normal,projectTo2d:E5e(g,L,n),boundingRectangle:Z,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},F;if(P)for(w.extrude=!0,w.top=a,w.bottom=c,w.shadowVolume=e._shadowVolume,w.offsetAttribute=e._offsetAttribute,F=0;F<_.length;F++){let X=y5e(n,_[F],h?V[F]:void 0,i,x[F],s,a,c,t,d),A;a&&c?(A=X.topAndBottom,w.geometry=Dn.scaleToGeodeticHeightExtruded(A.geometry,I,v,n,s)):a?(A=X.topAndBottom,A.geometry.attributes.position.values=ai.scaleToGeodeticHeight(A.geometry.attributes.position.values,I,n,!s),w.geometry=A.geometry):c&&(A=X.topAndBottom,A.geometry.attributes.position.values=ai.scaleToGeodeticHeight(A.geometry.attributes.position.values,v,n,!0),w.geometry=A.geometry),(a||c)&&(w.wall=!1,A.geometry=OH(w),G.push(A));let N=X.walls;w.wall=!0;for(let O=0;O 2) { + dimension = ceil(log2(float(u_extentsLength))); + } + int regionIndex = getPolygonIndex(dimension, v_textureCoordinates); + + for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) { + ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex); + int positionsLength = positionsLengthAndExtents.x; + int polygonExtentsIndex = positionsLengthAndExtents.y; + lastPolygonIndex += 1; + + // Only compute signed distance for the relevant part of the atlas + if (polygonExtentsIndex == regionIndex) { + float clipAmount = czm_infinity; + vec4 extents = getExtents(polygonExtentsIndex); + vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension; + vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents); + float s = 1.0; + + // Check each edge for absolute distance + for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) { + vec2 a = getPolygonPosition(lastPolygonIndex + i); + vec2 b = getPolygonPosition(lastPolygonIndex + j); + + vec2 ab = b - a; + vec2 pa = p - a; + float t = dot(pa, ab) / dot(ab, ab); + t = clamp(t, 0.0, 1.0); + + vec2 pq = pa - t * ab; + float d = length(pq); + + // Inside / outside computation to determine sign + bvec3 cond = bvec3(p.y >= a.y, + p.y < b.y, + ab.x * pa.y > ab.y * pa.x); + if (all(cond) || all(not(cond))) s = -s; + if (abs(d) < abs(clipAmount)) { + clipAmount = d; + } + } + + // Normalize the range to [0,1] + vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; + // In the case where we've iterated through multiple polygons, take the minimum + out_FragColor = min(out_FragColor, result); + } + + lastPolygonIndex += positionsLength; + } +}`;function es(e){e=y(e,y.EMPTY_OBJECT),this._polygons=[],this._totalPositions=0,this.enabled=y(e.enabled,!0),this.inverse=y(e.inverse,!1),this.polygonAdded=new ge,this.polygonRemoved=new ge,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;iPC.equals(t,e))};es.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>PC.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var v5e=new ce;function w5e(e){let t=[],n=[],i=e.length;for(let r=0;rce.union(e[_].computeSphericalExtents(v5e),x,x),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=ce.clone(a,u),u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI),p=-1}}t.push(u),n.push(h)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}es.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;ns+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s{e._signedDistanceComputeCommand=void 0}})}var Dre=new ce,M5e=new ce;es.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Ht.OUTSIDE;this.inverse&&(o=Ht.INSIDE);for(let r=0;r= 0.0; + float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); + + // Compute sky color for each position on a sphere at radius centered around the provided position's origin + vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; + + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); + vec3 mieColor; + vec3 rayleighColor; + float opacity; + czm_computeScattering( + ray, + rayLength, + lightDirectionWC, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); + + vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); + +#ifdef ATMOSPHERE_COLOR_CORRECT + const bool ignoreBlackPixels = true; + atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); +#endif + + vec3 lookupDirection = -normalizedDirection; + // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. + lookupDirection.x = -lookupDirection.x; + lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); + lookupDirection.x = -lookupDirection.x; + + // Values outside the atmopshere are rendered as black, when they should be treated as transparent + float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); + skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent + + // Blend starmap with atmopshere scattering + float intensity = u_brightnessSaturationGammaIntensity.w; + vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); + vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); + vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); + + // Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height + vec3 up = normalize(positionWC); + float occlusion = max(dot(lightDirectionWC, up), 0.05); + vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); + vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); + + vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); + + float brightness = u_brightnessSaturationGammaIntensity.x; + float saturation = u_brightnessSaturationGammaIntensity.y; + float gamma = u_brightnessSaturationGammaIntensity.z; + +#ifdef ENVIRONMENT_COLOR_CORRECT + color.rgb = mix(vec3(0.0), color.rgb, brightness); + color.rgb = czm_saturation(color.rgb, saturation); +#endif + color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0. + color.rgb = czm_gammaCorrect(color.rgb); + + out_FragColor = color; +} +`;var H0n=T(S(),1),cX=`precision highp float; + +in vec3 v_textureCoordinates; + +uniform float u_roughness; +uniform samplerCube u_radianceTexture; +uniform vec3 u_faceDirection; + +float vdcRadicalInverse(int i) +{ + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) + { + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); + } + return value; +} + +vec2 hammersley2D(int i, int N) +{ + return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} + +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ + float alphaRoughnessSquared = alphaRoughness * alphaRoughness; + float phi = czm_twoPi * xi.x; + float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); + vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangentX = normalize(cross(upVector, N)); + vec3 tangentY = cross(N, tangentX); + return tangentX * H.x + tangentY * H.y + N * H.z; +} + +// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses +const int samples = 128; + +void main() { + vec3 normal = u_faceDirection; + vec3 V = normalize(v_textureCoordinates); + float roughness = u_roughness; + + vec4 color = vec4(0.0); + float weight = 0.0; + for (int i = 0; i < samples; ++i) { + vec2 xi = hammersley2D(i, samples); + vec3 H = importanceSampleGGX(xi, roughness, V); + vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector + + float NdotL = max(dot(V, L), 0.0); + if (NdotL > 0.0) { + color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; + weight += NdotL; + } + } + out_FragColor = color / weight; +} +`;var K0n=T(S(),1),lX=`in vec3 position; +out vec3 v_textureCoordinates; + +uniform vec3 u_faceDirection; + +vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { + vec2 scaledUV = uv; + + if (faceDir.x != 0.0) { + return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); + } else if (faceDir.y != 0.0) { + return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); + } else { + return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); + } +} + +void main() +{ + v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); + v_textureCoordinates.y = -v_textureCoordinates.y; + v_textureCoordinates.z = -v_textureCoordinates.z; + gl_Position = vec4(position, 1.0); +} +`;function $n(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=y(e,y.EMPTY_OBJECT);let t=Math.min(y(e.mipmapLevels,7),Math.log2(Ft.maximumCubeMapSize));this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=$n.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new q;let n=Math.pow(2,t-1);this._textureDimensions=new D(n,n),this._radiiAndDynamicAtmosphereColor=new m,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=y(e.enabled,!0),this.shouldUpdate=!0,this.maximumSecondsDifference=y(e.maximumSecondsDifference,60*60),this.maximumPositionEpsilon=y(e.maximumPositionEpsilon,1e3),this.atmosphereScatteringIntensity=y(e.atmosphereScatteringIntensity,2),this.gamma=y(e.gamma,1),this.brightness=y(e.brightness,1),this.saturation=y(e.saturation,1),this.groundColor=y(e.groundColor,$n.AVERAGE_EARTH_GROUND_COLOR),this.groundAlbedo=y(e.groundAlbedo,.31)}Object.defineProperties($n.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){m.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=m.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});$n._maximumComputeCommandCount=8;$n._activeComputeCommandCount=0;$n._nextFrameCommandQueue=[];$n._queueCommand=(e,t)=>{if($n._activeComputeCommandCount>=$n._maximumComputeCommandCount){$n._nextFrameCommandQueue.push(e);return}t.commandList.push(e),$n._activeComputeCommandCount++};$n._updateCommandQueue=e=>{if($n._maximumComputeCommandCount=Math.log2(Ft.maximumCubeMapSize),$n._nextFrameCommandQueue.length>0&&$n._activeComputeCommandCount<$n._maximumComputeCommandCount){let t=$n._nextFrameCommandQueue.shift();for(;l(t)&&$n._activeComputeCommandCount<$n._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=$n._nextFrameCommandQueue.shift();continue}e.commandList.push(t),$n._activeComputeCommandCount++,t=$n._nextFrameCommandQueue.shift()}l(t)&&$n._nextFrameCommandQueue.push(t)}};$n.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};$n.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;ts,u_enuToFixedFrame:()=>c,u_faceDirection:()=>xr.getDirection(h,Ore),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,O5e)},owner:e});f.postExecute=()=>{if(e.isDestroyed()||f.canceled){$n._activeComputeCommandCount--;return}let x=e._radianceMapComputeCommands;x[g]=void 0;let _=new Wr({context:n,colorTextures:[e._radianceMapTextures[g]]});_._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),_._unBind(),_.destroy(),$n._activeComputeCommandCount--,x.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[u]=f,$n._queueCommand(f,t),u++}e._radianceCommandsDirty=!1}}function H5e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,d=(h,p,g,f,x)=>()=>{if(e.isDestroyed()||h.canceled){$n._activeComputeCommandCount--;return}let _=e._convolutionComputeCommands;_[p]=void 0,n.copyFace(t,g,f,x),c++,$n._activeComputeCommandCount--,g.destroy(),e._specularMapTextures[p]=void 0;let C=e._specularMapTextures.length;c>=C&&(e._irradianceCommandDirty=!0,n.sampler=new qt({minificationFilter:jt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},u=0;for(let h=1;hh/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>xr.getDirection(p,Ore)}});_.postExecute=d(_,u,g,p,h),e._convolutionComputeCommands[u]=_,$n._queueCommand(_,t),++u}r/=2,s/=2}}var Yre=new D(3,3);function z5e(e,t){let n=t.context,i=Yre,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new Xt({context:n,width:i.x,height:i.y,pixelDatatype:je.FLOAT,pixelFormat:nt.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new De({sources:[sX]}),e._irradianceMapFS=r);let s=new vc({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){$n._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,$n._activeComputeCommandCount--},e._irradianceComputeCommand=s,$n._queueCommand(s,t),e._irradianceTextureDirty=!0}function K5e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new Wr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Yre,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=m.unpack(r,s*4),m.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}$n.prototype.update=function(e){let t=e.mode;if(!$n.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}$n._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=U5e(this,e)||i===ib.SUNLIGHT&&!q.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=q.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(Y5e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(H5e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(z5e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){K5e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};$n.prototype.isDestroyed=function(){return!1};$n.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t4?(xt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==dt.SCALAR?(xt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==kt.UINT8?(xt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:dt.isVectorType(t)||t===dt.SCALAR?n!==kt.UINT8?(xt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(xt(`Property texture property ${e.id} has an unsupported type`),!1)};var j5e=[void 0,"float","vec2","vec3","vec4"],q5e=[void 0,"int","ivec2","ivec3","ivec4"];mX.prototype.getGlslType=function(){let e=this._classProperty,t=dt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?j5e[t]:q5e[t]};mX.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function $5e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var hX=mX;function zH(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new hX({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(zH.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});zH.prototype.getProperty=function(e){return this._properties[e]};var sb=zH;var dyn=T(S(),1);var ryn=T(S(),1);function zre(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=y(i,n.offset),o=y(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(zre.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var fX=zre;function KH(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new fX({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(KH.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});KH.prototype.getProperty=function(e){return this._properties[e]};var y_=KH;var fyn=T(S(),1);function pX(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(pX.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n=r;)C=o[C-r];o.push(C),s[x]=_}_>gke&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>yke&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=_,t[a]=_):x===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),x=Jre(i,c,d,u,p,g,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Jre(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=JH(e,t,a,c,d);if(u===0)return t;let h=0,p=o?1:0,g=r?1:0,f=JH(e,n,h,p,g);if(f===0)return n;let x=s?1:0,_=0,C=r?1:0,V=JH(e,i,x,_,C);if(V===0)return i;let L=u&f&V,Z,G,I;if(L&1)Z=0,G=1,I=2;else if(L&2)Z=0,I=1,G=2;else if(L&4)G=0,Z=1,I=2;else if(L&8)G=0,I=1,Z=2;else if(L&16)I=0,Z=1,G=2;else if(L&32)I=0,G=1,Z=2;else{let F=QH(u),b=QH(f),R=QH(V);return F>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}P5.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a1;)i>>=1,r.push(Qre(i));let s=new Xt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:nt.LUMINANCE,sampler:new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR_MIPMAP_LINEAR,magnificationFilter:hi.LINEAR})});return t.outlineTexture=s,s};function Qre(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function jre(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=wo.FAILED;let o=this._processError;this._processError=void 0,w5(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===wo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=wo.FAILED,w5(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=wo.FAILED,w5(this,o)}return this._incrementallyLoadTextures?n:n&&i};function oUe(e,t,n,i,o,r,s){let a=e.gltfJson,d=a.accessors[t].bufferView;return Li.getVertexBufferLoader({gltf:a,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,bufferViewId:d,draco:i,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function rUe(e,t,n,i,o,r){return Li.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:r,draco:n,asynchronous:e._asynchronous,loadBuffer:i,loadTypedArray:o})}function sUe(e,t){let n=Li.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function use(e,t,n){let i=t.byteOffset,o=Pl(e,t),r=t.count,s=Td(t.type),a=t.componentType,c=Q.getSizeInBytes(a),d=c*s,u=r*s;if(o===d)return n=new Uint8Array(n),Q.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let h=Q.createTypedArray(a,u),p=new DataView(n.buffer),g=new Array(s),f=eb(t.componentType);i=n.byteOffset+i;for(let x=0;x{l(i)&&l(i.attributes)&&l(i.attributes[u])?yUe(x,_,o,r):xUe(a,c,x,_,o,r)},x}function fse(e,t,n,i,o,r,s){let a=n.modelSemantic,c=a===Vt.POSITION,d=a===Vt.FEATURE_ID,u=c&&!o&&e._loadAttributesFor2D&&!s.scene3DOnly,h=c&&e._enablePick&&!s.context.webgl2,p=e._loadForClassification&&d,g=e._loadAttributesAsTypedArray,f=!g,x=g||u||h||p,V=hse(e,t,n,i,r?!1:f,r?!0:x,s),L=new __.AttributeLoadPlan(V);return L.loadBuffer=f,L.loadTypedArray=x,L}function _Ue(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=$H(e,ts,i),d=c.modelSemantic,u=d===ts.TRANSLATION||d===ts.ROTATION||d===ts.SCALE,h=d===ts.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,f=!p,x=e._loadAttributesFor2D&&!o.scene3DOnly;return hse(e,t,c,void 0,f,p||h&&(!a||x||g),o)}function TUe(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView;if(!l(n)&&!l(a))return;let c=new Pke;c.count=s.count;let d=e._loadAttributesAsTypedArray,u=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,h=e._loadForClassification&&i,g=!d,f=d||u||h,C=rUe(e,t,n,o?!1:g,o?!0:f,r),V=e._geometryLoaders.length;e._geometryLoaders.push(C);let L=C.load();e._loaderPromises.push(L),e._geometryCallbacks[V]=()=>{c.indexDatatype=C.indexDatatype,c.buffer=C.buffer,c.typedArray=C.typedArray};let Z=new __.IndicesLoadPlan(c);return Z.loadBuffer=g,Z.loadTypedArray=f,Z}function $c(e,t,n,i){let o=e.gltfJson,r=vl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Li.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=vl.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let d=s.load().catch(u=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw u;e._textureState=wo.FAILED,e._textureErrors.push(u)}});return e._texturesPromises.push(d),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function SUe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new Qke;return l(i)&&(c.diffuseTexture=$c(e,i,n)),l(o)&&(c.specularGlossinessTexture=$c(e,o,n)),c.diffuseFactor=Cd(se,r),c.specularFactor=Cd(m,s),c.glossinessFactor=a,c}function CUe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new Jke;return l(i)&&(c.baseColorTexture=$c(e,i,n)),l(o)&&(c.metallicRoughnessTexture=$c(e,o,n)),c.baseColorFactor=Cd(se,r),c.metallicFactor=s,c.roughnessFactor=a,c}function VUe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new jke;return l(o)&&(a.specularTexture=$c(e,o,n)),l(s)&&(a.specularColorTexture=$c(e,s,n)),a.specularFactor=i,a.specularColorFactor=Cd(m,r),a}function LUe(e,t,n){let{anisotropyStrength:i=jH.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=jH.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new jH;return l(r)&&(s.anisotropyTexture=$c(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function RUe(e,t,n){let{clearcoatFactor:i=qH.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=qH.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new qH;return l(o)&&(c.clearcoatTexture=$c(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=$c(e,s,n)),l(a)&&(c.clearcoatNormalTexture=$c(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function ZUe(e,t,n){let i=new qke,o=y(t.extensions,y.EMPTY_OBJECT),r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=SUe(e,r,n):(l(d)&&(i.metallicRoughness=CUe(e,d,n)),l(s)&&!i.unlit&&(i.specular=VUe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=LUe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=RUe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=$c(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=$c(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=$c(e,t.occlusionTexture,n)),i.emissiveFactor=Cd(m,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function pse(e,t){let n=new cse;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function bse(e,t,n,i){let o=new cse,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=mse(r.attribute),o.positionalLabel=i,o}function gse(e,t){let n=new dse;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function yse(e,t,n,i){let o=new dse,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function GUe(e,t,n,i){let o=new lse;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=$c(e,r,n,qt.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function EUe(e,t,n,i,o,r){let s=new lse,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=$c(e,c,i,qt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function IUe(e,t,n,i,o){let r=new vke,s=void 0,a=!1;for(let c in t){if(!t.hasOwnProperty(c))continue;let d=t[c],u=$H(e,Vt,c),h=fse(e,d,u,s,a,n,o);r.attributes.push(h.attribute),i.attributePlans.push(h)}return r}function XUe(e,t,n,i){let o=new wke,r=new __(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=ZUe(e,e.gltfJson.materials[s],i));let a=y(t.extensions,y.EMPTY_OBJECT),c=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=WUe(e,d,r));let u=e._loadForClassification,h=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(l(g))for(let G in g){if(!g.hasOwnProperty(G))continue;let I=g[G],v=$H(e,Vt,G),P=v.modelSemantic;if(u&&!gUe(P))continue;P===Vt.FEATURE_ID&&(p=!0);let w=fse(e,I,v,h,n,c,i);r.attributePlans.push(w),o.attributes.push(w.attribute)}let f=t.targets;if(l(f)&&!u)for(let G=0;Gn[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=F5(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(M.IDENTITY);return i}function BUe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=DUe(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r=s.clientWidth)d=!0;else{if(L.x>s.clientWidth*.5){a.width=L.x,c.frustum.right=p.x-C,pc=IX(r,n,c,pc),Fa.clipToGLWindowCoordinates(a,pc,tz),a.x+=L.x,c.position.x=-c.position.x;let Z=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-Z,pc=IX(r,n,c,pc),Fa.clipToGLWindowCoordinates(a,pc,nz)}else{a.x+=L.x,a.width-=L.x,c.frustum.left=-p.x-C,pc=IX(r,n,c,pc),Fa.clipToGLWindowCoordinates(a,pc,tz),a.x=a.x-a.width,c.position.x=-c.position.x;let Z=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-Z,pc=IX(r,n,c,pc),Fa.clipToGLWindowCoordinates(a,pc,nz)}m.clone(g,c.position),c.frustum=f.clone(),i=D.clone(tz,i),(i.x<0||i.x>s.clientWidth)&&(i.x=nz.x)}}if(o.mode!==oe.SCENE2D||d){if(pc=IX(r,n,c,pc),pc.z<0&&!(c.frustum instanceof rn)&&!(c.frustum instanceof Pr))return;i=Fa.clipToGLWindowCoordinates(a,pc,i)}return i.y=s.clientHeight-i.y,i};Fa.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Fa.worldToWindowCoordinates(e,t,n),!!l(n))return Fa.transformWindowToDrawingBuffer(e,n,n)};var lb=new m,yDe=new he;Fa.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return m.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,yDe);if(!l(r))return;if(o.project(r,lb),i===oe.COLUMBUS_VIEW)return m.fromElements(lb.z,lb.x,lb.y,n);if(i===oe.SCENE2D)return m.fromElements(0,lb.x,lb.y,n);let s=e.morphTime;return m.fromElements(W.lerp(lb.z,t.x,s),W.lerp(lb.x,t.y,s),W.lerp(lb.y,t.z,s),n)};var Vse=new m,Lse=new m,Rse=new M;Fa.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,Vse),M.computeViewportTransformation(e,0,1,Rse),M.multiplyByPoint(Rse,Vse,Lse),D.fromCartesian3(Lse,n)};Fa.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return D.fromElements(t.x*o,t.y*r,n)};var xDe=new se,Zse=new se;Fa.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,g)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=se.clone(se.UNIT_W,xDe);u.x=(t.x-d.x)/d.width*2-1,u.y=(t.y-d.y)/d.height*2-1,u.z=n*2-1,u.w=1;let h,p=e.camera.frustum;if(l(p.fovy)){h=M.multiplyByVector(r.inverseViewProjection,u,Zse);let g=1/h.w;m.multiplyByScalar(h,g,h)}else{let g=p.offCenterFrustum;l(g)&&(p=g),h=Zse,h.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(u.z*(a-c)-a-c)*.5,h.w=1,h=M.multiplyByVector(r.inverseView,h,h)}return m.fromCartesian4(h,i)};var Ui=Fa;var hSn=T(S(),1);var VTn=T(S(),1);var MC={};MC._deprecationWarning=us;var db=Uint32Array.BYTES_PER_ELEMENT;MC.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=db;let r=o.getUint32(t,!0);if(r!==1)throw new ae(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=db;let s=o.getUint32(t,!0);t+=db;let a=o.getUint32(t,!0);t+=db;let c=o.getUint32(t,!0);t+=db;let d=o.getUint32(t,!0);t+=db;let u=o.getUint32(t,!0);t+=db;let h;d>=570425344?(t-=db*2,h=a,d=c,u=0,a=0,c=0,MC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=db,h=d,d=a,u=c,a=0,c=0,MC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(h,0)}:(p=vo(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let f,x;d>0&&(f=vo(i,t,d),t+=d,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(MC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{batchLength:h,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:x,gltf:C}};var XX=MC;var ETn=T(S(),1);function WX(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Gse(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Q.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function _De(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=Q.createTypedArray(n,i),o[t]=r),r}WX.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,Q.UNSIGNED_INT),n=y(n,1),Gse(this,e,t,n,1,i.byteOffset)):i};WX.prototype.hasProperty=function(e){return l(this.json[e])};WX.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Q.fromName(i.componentType)),Gse(this,e,t,n,this.featuresLength,i.byteOffset)):_De(this,e,t,i)};WX.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a0&&(f=vo(i,t,d),t+=d,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(M5._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{gltfFormat:h,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:x,gltf:C}};var FX=M5;var mb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},N5=Tn.Attribute,UDe=Tn.FeatureIdAttribute,vse=Tn.Instances;function hb(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Po.Y),d=y(e.forwardAxis,Po.X),u=y(e.loadAttributesAsTypedArray,!1),h=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.enablePick,!1);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=mb.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(hb.prototype=Object.create(Ki.prototype),hb.prototype.constructor=hb);Object.defineProperties(hb.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});hb.prototype.load=function(){if(l(this._promise))return this._promise;let e=FX.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new eh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new ae("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(c)&&(this._transform=M.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:o};let d={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let h=El(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});d.gltfResource=p,d.baseResource=p}else d.gltfResource=this._i3dmResource,d.typedArray=e.gltf;let u=new ab(d);return this._gltfLoader=u,this._state=mb.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=mb.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw DDe(this,h)}),this._promise};function DDe(e,t){return e.unload(),e._state=mb.FAILED,e.getError("Failed to load i3dm",t)}hb.prototype.process=function(e){if(this._state===mb.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===mb.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),YDe(this,i,e),BDe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=mb.READY,!0};function BDe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=ub({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new qc({name:zm.BATCH_TABLE_CLASS_NAME,count:i});o=new Ds({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var k5=new m,rz=new Array(4),ODe=new M;function YDe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",Q.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=zDe(o,r),h;c&&(h=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let g=new Float32Array(r),f=m.unpackArray(u),x=new m,_=new m,C=new m,V=new m,L=new $,Z=new ve,G=new Array(4),I=new m,v=new Array(3),P=new M;if(!l(s)||m.equals(m.unpack(s),m.ZERO)){let U=le.fromPoints(f);for(i=0;i0&&(U.instances=O?HDe(w):w,O=!0)}}function HDe(e){let t=new vse;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o=n[o]&&e=0&&!(e>=n[o]&&en&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};NC.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var io=NC;function kC(e){this._value=e,this._valueType=io.getPointType(e)}Object.defineProperties(kC.prototype,{value:{get:function(){return this._value}}});kC.prototype.findTimeInterval=function(e){};kC.prototype.wrapTime=function(e){return 0};kC.prototype.clampTime=function(e){return 0};kC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var MX=kC;var KCn=T(S(),1);var wCn=T(S(),1);function UC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=io.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(UC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});UC.prototype.findTimeInterval=io.prototype.findTimeInterval;UC.prototype.wrapTime=io.prototype.wrapTime;UC.prototype.clampTime=io.prototype.clampTime;UC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new m),m.lerp(n[o],n[o+1],r,t))};var Sg=UC;var MCn=T(S(),1);var wse={};wse.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a=0;--a)s[a]=m.subtract(r[a],m.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var DC=wse;var Fse=[],Ase=[],Mse=[],Nse=[];function qDe(e,t,n){let i=Fse,o=Mse,r=Ase,s=Nse;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new m),m.clone(t,c),a=1;a0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Fl.REPEAT)g=g-Math.floor(g);else if(a.loop===Fl.MIRRORED_REPEAT){let C=Math.floor(g),V=g-C;g=C%2===1?1-V:V}a.reverse&&(g=1-g);let _=g*d*a.multiplier;_=W.clamp(_,a.localStartTime,a.localStopTime),a.animate(_),a.update.numberOfListeners>0&&(a._updateEventTime=_,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=th.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&U5.push(a))}}n=U5.length;for(let s=0;sW.EPSILON3}};var QX=Dse;var EVn=T(S(),1);var TVn=T(S(),1),jX=`#ifdef DIFFUSE_IBL +vec3 sampleDiffuseEnvironment(vec3 cubeDir) +{ + #ifdef CUSTOM_SPHERICAL_HARMONICS + return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); + #else + return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); + #endif +} +#endif + +#ifdef SPECULAR_IBL +vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) +{ + #ifdef CUSTOM_SPECULAR_IBL + float lod = roughness * model_specularEnvironmentMapsMaximumLOD; + return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; + #else + float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; + return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; + #endif +} +vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) +{ + // see https://bruop.github.io/ibl/ at Single Scattering Results + // Roughness dependent fresnel, from Fdez-Aguera + vec3 f90 = max(vec3(1.0 - roughness), f0); + vec3 F = fresnelSchlick2(f0, f90, NdotV); + + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); + + return specularSample * (F * brdfLut.x + brdfLut.y); +} +#endif + +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +/** + * Compute the light contributions from environment maps and spherical harmonic coefficients. + * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation + * of the single- and multi-scattering terms. + * + * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position. + * @param {vec3} normalEC The surface normal in eye coordinates. + * @param {czm_modelMaterial} The material properties. + * @return {vec3} The computed HDR color. + */ +vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { + vec3 f0 = material.specular; + float roughness = material.roughness; + float specularWeight = 1.0; + #ifdef USE_SPECULAR + specularWeight = material.specularWeight; + #endif + float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); + + // see https://bruop.github.io/ibl/ at Single Scattering Results + // Roughness dependent fresnel, from Fdez-Aguera + vec3 f90 = max(vec3(1.0 - roughness), f0); + vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); + + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); + + #ifdef DIFFUSE_IBL + vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); + vec3 irradiance = sampleDiffuseEnvironment(normalMC); + + vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; + float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); + vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); + vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; + vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; + #else + vec3 diffuseContribution = vec3(0.0); + #endif + + #ifdef USE_ANISOTROPY + // Bend normal to account for anisotropic distortion of specular reflection + vec3 anisotropyDirection = material.anisotropicB; + vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); + vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); + float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); + float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; + vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); + vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); + #else + vec3 reflectEC = reflect(-viewDirectionEC, normalEC); + #endif + + #ifdef SPECULAR_IBL + vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); + vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); + vec3 specularContribution = radiance * FssEss * model_iblFactor.y; + #else + vec3 specularContribution = vec3(0.0); + #endif + + return diffuseContribution + specularContribution; +} +#endif +`;var Bse={name:"ImageBasedLightingPipelineStage"},uBe=new D;Bse.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,ye.FRAGMENT),r.addUniform("vec2","model_iblFactor",ye.FRAGMENT),Dm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",ye.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ye.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,ye.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ye.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ye.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,ye.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,ye.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,ye.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",ye.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ye.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,ye.FRAGMENT)),r.addFragmentLines(jX);let c={model_iblFactor:function(){return D.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,uBe)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=Tt(c,e.uniformMap)};var qX=Bse;var BVn=T(S(),1);var AVn=T(S(),1);var mBe=W.EPSILON16;function dz(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(dz.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=W.clamp(e,this.minimumValue,this.maximumValue),W.equalsEpsilon(this._currentValue,e,mBe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var hBe=new m,lz=new $;dz.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=hBe,o;switch(t){case hc.XROTATE:o=$.fromRotationX(W.toRadians(n),lz),e=M.multiplyByMatrix3(e,o,e);break;case hc.YROTATE:o=$.fromRotationY(W.toRadians(n),lz),e=M.multiplyByMatrix3(e,o,e);break;case hc.ZROTATE:o=$.fromRotationZ(W.toRadians(n),lz),e=M.multiplyByMatrix3(e,o,e);break;case hc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case hc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case hc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case hc.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case hc.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case hc.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case hc.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var $X=dz;function D5(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,fBe(this)}Object.defineProperties(D5.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function fBe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s 0.0 && clipDistance < clippingPlanesEdgeWidth) { + color = clippingPlanesEdgeColor; + } +} +`;var Ose={name:"ModelClippingPlanesPipelineStage"},gBe=new D;Ose.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ye.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ye.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ye.FRAGMENT),fs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ye.FRAGMENT);let s=fs.getTextureResolution(i,o,gBe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ye.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ye.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ye.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ye.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ye.FRAGMENT),r.addFragmentLines(nW);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=B.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=Tt(a,e.uniformMap)};var iW=Ose;var yLn=T(S(),1);var dLn=T(S(),1),oW=`void modelClippingPolygonsStage(ProcessedAttributes attributes) +{ + vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC); + sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); + + vec2 minDistance = vec2(czm_infinity); + v_regionIndex = -1; + v_clippingPosition = vec2(czm_infinity); + + for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) { + vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex); + vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz; + + vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0)); + vec2 distance = abs(rectUv - clamped) * extents.wz; + + if (minDistance.x > distance.x || minDistance.y > distance.y) { + minDistance = distance; + v_clippingPosition = rectUv; + } + + float threshold = 0.01; + if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) { + v_regionIndex = regionIndex; + } + } +} +`;var mLn=T(S(),1),rW=`void modelClippingPolygonsStage() +{ + vec2 clippingPosition = v_clippingPosition; + int regionIndex = v_regionIndex; + czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); +} +`;var Yse={name:"ModelClippingPolygonsPipelineStage"};Yse.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ye.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ye.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ye.BOTH),o.addUniform("sampler2D","model_clippingDistance",ye.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ye.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(oW),o.addFragmentLines(rW);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=Tt(r,e.uniformMap)};var sW=Yse;var TLn=T(S(),1);function Hse(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Hse.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var aW=Hse;var fRn=T(S(),1);var JLn=T(S(),1);var CLn=T(S(),1),cW=`mat4 getInstancingTransform() +{ + mat4 instancingTransform; + + #ifdef HAS_INSTANCE_MATRICES + instancingTransform = mat4( + a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 + a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 + a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 + a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation = a_instanceTranslation; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif + + instancingTransform = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation.x, translation.y, translation.z, 1.0 + ); + #endif + + return instancingTransform; +} + +#ifdef USE_2D_INSTANCING +mat4 getInstancingTransform2D() +{ + mat4 instancingTransform2D; + + #ifdef HAS_INSTANCE_MATRICES + instancingTransform2D = mat4( + a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 + a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 + a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 + a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation2D = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation2D = a_instanceTranslation2D; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif + + instancingTransform2D = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation2D.x, translation2D.y, translation2D.z, 1.0 + ); + #endif + + return instancingTransform2D; +} +#endif +`;var LLn=T(S(),1),lW=`void instancingStage(inout ProcessedAttributes attributes) +{ + vec3 positionMC = attributes.positionMC; + + mat4 instancingTransform = getInstancingTransform(); + + attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; + + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; + #endif + + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var ZLn=T(S(),1),dW=`void legacyInstancingStage( + inout ProcessedAttributes attributes, + out mat4 instanceModelView, + out mat3 instanceModelViewInverseTranspose) +{ + vec3 positionMC = attributes.positionMC; + + mat4 instancingTransform = getInstancingTransform(); + + mat4 instanceModel = instancingTransform * u_instance_nodeTransform; + instanceModelView = u_instance_modifiedModelView; + instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); + + attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; + + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var B5=new M,yBe=new M,xBe=new M,Kse={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:$se,_transformsToTypedArray:mz};Kse.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(cW);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,h=[];vBe(e,n,i,h,d,u),ABe(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ye.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ye.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ye.VERTEX),p.u_instance_modifiedModelView=function(){let g=M.multiplyTransformation(s.modelMatrix,a.components.transform,B5);return d?M.multiplyTransformation(n.context.uniformState.view3D,g,B5):(n.mode!==oe.SCENE3D&&(g=vt.basisTo2D(n.mapProjection,g,B5)),M.multiplyTransformation(n.context.uniformState.view,g,B5))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,yBe)},r.addVertexLines(dW)):r.addVertexLines(lW),d){r.addDefine("USE_2D_INSTANCING",void 0,ye.VERTEX),r.addUniform("mat4","u_modelView2D",ye.VERTEX);let g=n.context,f=M.fromTranslation(c.instancingReferencePoint2D,new M);p.u_modelView2D=function(){return M.multiplyTransformation(g.uniformState.view,f,xBe)}}e.uniformMap=Tt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,h)};var uW=new M,_Be=new m;function TBe(e,t,n,i,o){let r=M.multiplyTransformation(t,e,uW);return r=M.multiplyTransformation(r,n,uW),o=vt.basisTo2D(i.mapProjection,r,o),o}function SBe(e,t,n,i,o){let r=M.fromTranslation(e,uW),s=M.multiplyTransformation(t,r,uW);s=M.multiplyTransformation(s,n,uW);let a=M.getTranslation(s,_Be);return o=Ui.computeActualEllipsoidPosition(i,a,o),o}function Jse(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=M.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=M.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=M.clone(o.computedModelMatrix,t),t=M.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=M.clone(M.IDENTITY,n))}var Qse=new M,jse=new M,CBe=new M,VBe=new m;function LBe(e,t,n,i){let o=Qse,r=jse;Jse(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:on.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var mW=Kse;var eRn=T(S(),1);var fz={};fz.name="ModelMatrixUpdateStage";fz.update=function(e,t,n){let i=n.mode!==oe.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;eae(e,t,o,e.transformToRoot),e._transformDirty=!1}};function MBe(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Qt.getCullFace(e.modelMatrix,e.primitiveType)}function eae(e,t,n,i){let o;i=M.multiplyTransformation(i,e.transform,new M),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Tt(o,e.uniformMap)};var gW=rae;var WRn=T(S(),1);var sae={name:"ClassificationPipelineStage"};sae.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ye.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||kBe(t,o)};function kBe(e,t){let n=Qt.getAttributeBySemantic(e,Vt.POSITION);if(!l(n))throw new ae("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=Qt.getAttributeBySemantic(e,Vt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let d=[],u=[0],h=r?i[0]:0,p=c[h],g=0;for(let x=1;xQBe(i,t,n)):[]}function QBe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Qt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),d=new Array(c.length);for(let u=0;uqBe(n,t)):[]}function qBe(e,t){let{sanitizeGlslIdentifier:n}=Qt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;au),n.addStructField(Ri.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,f=g;if(l(h)&&!$.equals(h,$.IDENTITY)){let L=`${p}Transform`;n.addUniform("mat3",L,ye.FRAGMENT),i[L]=function(){return h},f=`vec2(${L} * vec3(${g}, 1.0))`}let x=`texture(${p}, ${f}).${c}`,_=s.unpackInShader(x),C=fae({valueExpression:_,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ye.FRAGMENT,property:s}),V=`metadata.${o} = ${C};`;n.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,[V])}function uae(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=hae(Ri.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Ri.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,s),ye.includesVertexShader(r)&&(e.addStructField(Ri.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function mae(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===dt.ENUM)return;let s=Ri.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=hae(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(Ri.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_FS,c),ye.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ri.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Ri.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function hae(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function fae(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:d}=e;s.addUniform(c,o,d),s.addUniform(c,r,d);let{offset:u,scale:h}=n;return a[o]=()=>u,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var Pu=Ri;var IZn=T(S(),1),aOe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Zg=Object.freeze(aOe);var ma={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:xt};ma.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Zg.TRANSLUCENT?r.pass=Ee.TRANSLUCENT:c===Zg.OPAQUE&&(r.pass=void 0);let d=pOe(s,t);if(!d.customShaderEnabled)return;if(xOe(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ye.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ye.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ye.FRAGMENT);let p=pb.getDefineName(s.mode);i.addDefine(p,void 0,ye.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];i.addUniform(g.type,p)}let h=s.varyings;for(let p in h)if(h.hasOwnProperty(p)){let g=h[p];i.addVarying(g,p)}e.uniformMap=Tt(e.uniformMap,s.uniformMap)};function cOe(e){let t={};for(let n=0;n1?(g=e.attributeIndex,e.attributeIndex+=h):p&&!a?g=0:g=e.attributeIndex++,ROe(e,u,g,h,r,s)}wOe(i,t.attributes),t.primitiveType===we.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(WW),i.addFragmentLines(XW)};function ROe(e,t,n,i,o,r){let s=e.shaderBuilder,a=Qt.getAttributeInfo(t),c=o&&!r;i>1?EOe(e,t,n,i):GOe(e,t,n,c),XOe(s,a,c),IOe(s,a),l(t.semantic)&&ZOe(s,t),WOe(s,a,o),POe(s,a,c),vOe(s,a)}function ZOe(e,t){let{semantic:n,setIndex:i}=t;switch(n){case Vt.NORMAL:e.addDefine("HAS_NORMALS");break;case Vt.TANGENT:e.addDefine("HAS_TANGENTS");break;case Vt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case Vt.TEXCOORD:case Vt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function GOe(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===Vt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===Vt.POSITION,u=d?0:n,h=on.getNumberOfComponents(a),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let g=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:h,componentDatatype:Q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function EOe(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,d=on.getNumberOfComponents(s)/i,u=Q.getSizeInBytes(a),h=d*u,p=t.byteStride;for(let g=0;g0,d=!l(a)&&c;if(l(r)&&!d){let x=s3e(a),_=a3e(r,x);c3e(i,_);let V=l3e(_).indexOf("normalMC")>=0,L=Qt.getAttributeBySemantic(t,Vt.NORMAL);if(V&&!L)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ye.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Ee.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ye.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ye.VERTEX);let h,p,g;cr.is3DTiles(o.type)&&(p=!0,h=o.content,g=h.tile.refine===Bo.ADD),i.addUniform("vec4","model_pointCloudParameters",ye.VERTEX),i.addVertexLines(DW);let f=e.uniformMap;f.model_pointCloudParameters=function(){let x=n3e,_=1;p&&(_=g?5:h.tileset.memoryAdjustedScreenSpaceError),x.x=y(u.maximumAttenuation,_),x.x*=n.pixelRatio;let C=i3e(e,t,u,h);x.y=C*u.geometricErrorScale;let V=n.context,L=n.camera.frustum,Z;return n.mode===oe.SCENE2D||L instanceof rn?Z=Number.POSITIVE_INFINITY:Z=V.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=Z,p&&(x.w=h.tileset.timeSinceLoad),x}};var Gae=new m;function i3e(e,t,n,i){if(l(i)){let u=i.tile.geometricError;if(u>0)return u}if(l(n.baseResolution))return n.baseResolution;let o=Qt.getAttributeBySemantic(t,Vt.POSITION),r=o.count,s=e.runtimeNode.transform,a=m.subtract(o.max,o.min,Gae);a=M.multiplyByPointAsVector(s,a,Gae);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var o3e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},r3e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function s3e(e){let t=Ye(r3e);if(!l(e))return t;for(let n=0;n0,p=l(i.skin),g=l(r),x=!(g&&l(r.fragmentShaderText))||r.mode!==pb.REPLACE_MATERIAL,_=Qt.hasQuantizedAttributes(n.attributes),C=o.debugWireframe&&we.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),V=o.pointCloudShading,L=l(V)&&V.attenuation,Z=l(V)&&V.backFaceCulling,G=n.primitiveType===we.POINTS&&(l(s)||L||Z),I=o._enableShowOutline&&l(n.outlineCoordinates),v=X3e(o,i,n),P=l(o.classificationType);d&&t.push(KW),t.push(vW),C&&t.push($W),P&&t.push(yW),h&&t.push(kW),p&&t.push(QW),G&&t.push(BW),_&&t.push(IW),x&&t.push(MW),t.push(Rg),t.push(Pu),t.push(Vd),v.hasPropertyTable&&(t.push(Gg),t.push(gW),t.push(TW)),u&&t.push(qW),g&&t.push(GW),t.push(FW),o.allowPicking&&t.push(UW),I&&t.push(HW),t.push(bW),t.push(zW)};function X3e(e,t,n){let i;return l(t.instances)&&(i=Qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var e2=Dae;var vXn=T(S(),1);function Tz(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],W3e(this)}Object.defineProperties(Tz.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function W3e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c czm_splitPosition) discard; + if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +#endif +} +`;var Y5={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};Y5.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ye.FRAGMENT),i.addFragmentLines(a2);let o={};i.addUniform("float",Y5.SPLIT_DIRECTION_UNIFORM_NAME,ye.FRAGMENT),o[Y5.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Tt(o,e.uniformMap)};var c2=Y5;var lWn=T(S(),1);function w3e(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var l2=w3e;var TWn=T(S(),1);var hWn=T(S(),1);function F3e(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,_f.UNLIT)}var d2=F3e;function A3e(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Qt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Qt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=le.fromCornerPoints(this.positionMin,this.positionMax,new le),this.lightingOptions=new d2,this.pickId=void 0}var u2=A3e;var S2n=T(S(),1);var wWn=T(S(),1);function Cz(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==kn.CESIUM_3D_TILE,this._classifies3DTiles=o!==kn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],U3e(this)}function M3e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:mt.KEEP,zFail:mt.DECREMENT_WRAP,zPass:mt.KEEP},backFunction:e,backOperation:{fail:mt.KEEP,zFail:mt.INCREMENT_WRAP,zPass:mt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:rc.LESS_OR_EQUAL},depthMask:!1}}var N3e={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:mt.ZERO,zFail:mt.ZERO,zPass:mt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:mt.ZERO,zFail:mt.ZERO,zPass:mt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},k3e={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:mt.ZERO,zFail:mt.ZERO,zPass:mt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:mt.ZERO,zFail:mt.ZERO,zPass:mt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Hae=[];function U3e(e){let t=e._command,n=Hae;if(e._useDebugWireframe){t.pass=Ee.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=m2(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;as||o<-s&&r>-s}function jC(e,t){if(!l(t))return;let n=bb.clone(t),i=qe.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function J3e(e){jC(e,e._originalCommand),jC(e,e._translucentCommand),jC(e,e._skipLodBackfaceCommand),jC(e,e._skipLodStencilCommand),jC(e,e._silhouetteModelCommand),jC(e,e._silhouetteColorCommand)}function Q3e(e){let t=qe.shallowClone(e);t.pass=Ee.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=Ue.fromCache(n),t}function j3e(e,t){let n=t._silhouetteId%255,i=qe.shallowClone(e),o=Ye(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ie.ALWAYS,backFunction:ie.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ue.fromCache(o),i}function q3e(e,t){let n=t._silhouetteId%255,i=qe.shallowClone(e),o=Ye(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ee.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ee.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ie.NOTEQUAL,backFunction:ie.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP}};let s=Ye(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ue.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function $3e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=eYe(o);if(r!==s){let a=tYe(r),c=Ye(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ue.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function eYe(e){return(e.renderState.stencilTest.reference&Ut.SKIP_LOD_MASK)>>>Ut.SKIP_LOD_BIT_SHIFT}function tYe(e){return Ut.CESIUM_3D_TILE_MASK|e<0&&(h=vo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new eh(d,u),f=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=f,!l(f))throw new ae("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(x)&&(x=m.unpack(x));let _=SYe(g,h);if(_.rtcCenter=x,_.pointsLength=f,!_.hasPositions){let C=CYe(g);_.positions=C,_.hasPositions=_.hasPositions||l(C)}if(!_.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let C=LYe(g);_.normals=C,_.hasNormals=_.hasNormals||l(C)}if(!_.hasColors){let C=VYe(g);_.colors=C,_.hasColors=_.hasColors||l(C),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(C)&&C.isTranslucent}if(!_.hasBatchIds){let C=RYe(g);_.batchIds=C,_.hasBatchIds=_.hasBatchIds||l(C)}if(_.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new ae("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");_.batchLength=C}return l(p)&&(p=new Uint8Array(p),_.batchTableJson=h,_.batchTableBinary=p),_};function SYe(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,d,u,h,p;if(l(s)){o=s.properties;let f=s.byteOffset,x=s.byteLength;if(!l(o)||!l(f)||!l(x))throw new ae("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+x),c=l(o.POSITION),d=l(o.RGB)||l(o.RGBA),u=l(o.NORMAL),h=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:Tt(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:h}}function CYe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Q.FLOAT,3),{name:Vt.POSITION,semantic:Vt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Q.FLOAT,type:on.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(i))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(r))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:Vt.POSITION,semantic:Vt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Q.FLOAT,type:on.VEC3,quantizedRange:o,quantizedVolumeOffset:m.unpack(r),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:Q.UNSIGNED_SHORT,quantizedType:on.VEC3}}}function VYe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Q.UNSIGNED_BYTE,4),{name:Vt.COLOR,semantic:Vt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:on.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:Vt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:on.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:Vt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.FLOAT,type:on.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Q.UNSIGNED_BYTE,4),o=i[3],r=B.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:Vt.COLOR,semantic:Vt.COLOR,setIndex:0,constantColor:r,componentDatatype:Q.FLOAT,type:on.VEC4,isQuantized:!1,isTranslucent:s}}}function LYe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Q.FLOAT,3),{name:Vt.NORMAL,semantic:Vt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Q.FLOAT,type:on.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Q.UNSIGNED_BYTE,2),{name:Vt.NORMAL,semantic:Vt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:on.VEC2,quantizedComponentDatatype:Q.UNSIGNED_BYTE,componentDatatype:Q.FLOAT,type:on.VEC3}}function RYe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Q.UNSIGNED_SHORT,1);return{name:Vt.FEATURE_ID,semantic:Vt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Q.fromTypedArray(n),type:on.SCALAR}}}var L_=$ae;var ZYe=Tn.Components,GYe=Tn.Scene,EYe=Tn.Node,IYe=Tn.Primitive,XYe=Tn.Attribute,ece=Tn.Quantization,WYe=Tn.FeatureIdAttribute,PYe=Tn.Material,vYe=Tn.MetallicRoughness;function Ig(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=bt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}l(Object.create)&&(Ig.prototype=Object.create(Ki.prototype),Ig.prototype.constructor=Ig);Object.defineProperties(Ig.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Ig.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=L_.parse(this._arrayBuffer,this._byteOffset),this._state=bt.PROCESSING,this._promise=Promise.resolve(this)};Ig.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===bt.READY)return!0;if(this._state===bt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=wYe(this,e.context)}return!1};function wYe(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=qp.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&FYe(e,i,r),zYe(e,t),e._state=bt.READY,e}).catch(function(r){e.unload(),e._state=bt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function FYe(e,t,n){e._state=bt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:Vt.POSITION,typedArray:n.POSITION.array,componentDatatype:Q.FLOAT,type:on.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,d=m.fromElements(c,c,c),u=m.unpack(a.minValues),h=(1<0&&KYe(e,a,h,t),l(n.rtcCenter)&&(u.transform=M.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=M.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function KYe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s=0&&(a=xe)}}}}if(a!==Number.MAX_VALUE){if(s=pn.getPoint(t,a,s),n.mode!==oe.SCENE3D){m.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,h=u.ellipsoid,p=u.unproject(s,tHe);h.cartographicToCartesian(p,s)}return s}}function Vz(e,t,n,i,o,r,s,a,c,d){let u=n+t*i;if(d.x=e[u],d.y=e[u+1],d.z=e[u+2],l(o))if(o.octEncoded){if(d=wn.octDecodeInRange(d,o.normalizationRange,d),o.octEncodedZXY){let h=d.x;d.x=d.z,d.z=d.y,d.y=h}}else d=m.multiplyComponents(d,o.quantizedVolumeStepSize,d),d=m.add(d,o.quantizedVolumeOffset,d);return d=M.multiplyByPoint(r,d,d),s!==1&&Tr.getPosition(d,c,s,a,d),d}function co(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,cr.GLTF),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=M.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new BX(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=B.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,mc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,B.RED);this._silhouetteColor=B.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Ee.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new le,this._initialRadius=void 0,this._heightReference=y(e.heightReference,Je.NONE),this._heightDirty=this._heightReference!==Je.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=y(e.enableVerticalExaggeration,!0),this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new xf(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?fs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=M.clone(M.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?Qm.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new zx,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new ob(e.environmentMapOptions);ob.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,_n.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===cr.GLTF&&xt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let d=e.credit;typeof d=="string"&&(d=new St(d)),this._credits=[],this._credit=d,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,vr.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,B.BLACK),this._classificationType=e.classificationType,this._statistics=new x2,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._errorEvent=new ge,this._readyEvent=new ge,this._texturesReadyEvent=new ge,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function Lz(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function iHe(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return rce(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===cr.GLTF&&xt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(fs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Qm.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(ob.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});co.prototype.getNode=function(e){return this._nodesByName[e]};co.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};co.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};co.prototype.getExtension=function(e){return this._loader.components.extensions[e]};co.prototype.makeStyleDirty=function(){this._styleDirty=!0};co.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var rHe=new M,sHe=new $,aHe=new M;co.prototype.update=function(e){let t=!1;try{t=cHe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")Lz(this,n);else{let i=Qt.getError("model",this._resource,n);Lz(this,i)}}if(lHe(this,e),dHe(this,e),uHe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=Qt.getError("model",this._resource,new ae("Failed to load model."));Lz(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&iHe(this,i);let o=new y2({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(mHe(this),hHe(this),fHe(this,e),pHe(this),bHe(this,e),gHe(this,e),yHe(this,e),xHe(this,e),_He(this,e),THe(this,e),SHe(this,e),this._defaultTexture=e.context.defaultTexture,CHe(this,e),VHe(this,e),LHe(this),RHe(this,e),IHe(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),GHe(this),XHe(this,e),WHe(this),PHe(this,e)}};function cHe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function lHe(e,t){l(e._customShader)&&e._customShader.update(t)}function dHe(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function uHe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function mHe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=oHe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function hHe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function fHe(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r=i&&r<=o}function AHe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r0&&e.alpha<1};co.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function sce(e){return e.context.stencilBuffer}co.prototype.hasSilhouette=function(e){return sce(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};co.prototype.hasSkipLevelOfDetail=function(e){if(!cr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};co.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};co.prototype.pick=function(e,t,n,i,o){return $C(this,e,t,n,i,o)};co.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};co.prototype.isDestroyed=function(){return!1};co.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let s=0;s0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),oce(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function S2(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var ih=co;function Nr(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Nr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Nr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Nr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Nr.prototype.getExtension=function(e){return this._model.getExtension(e)};Nr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Nr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Nr.prototype.applyDebugSettings=function(e,t){t=e?t:B.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Nr.prototype.applyStyle=function(e){this._model.style=e};Nr.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;l(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),l(s)&&l(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Fl.REPEAT}),this._ready=!0)};Nr.prototype.isDestroyed=function(){return!1};Nr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),me(this)};Nr.fromGltf=async function(e,t,n,i){let o=new Nr(e,t,n),s=C2(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await ih.fromGltfAsync(s);return o._model=c,o};Nr.fromB3dm=async function(e,t,n,i,o){let r=new Nr(e,t,n),a=C2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let d=await ih.fromB3dm(a);return r._model=d,r};Nr.fromI3dm=async function(e,t,n,i,o){let r=new Nr(e,t,n),a=C2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await ih.fromI3dm(a);return r._model=c,r};Nr.fromPnts=async function(e,t,n,i,o){let r=new Nr(e,t,n),a=C2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await ih.fromPnts(a);return r._model=c,r};Nr.fromGeoJson=async function(e,t,n,i){let o=new Nr(e,t,n),s=C2(e,t,o,{geoJson:i,resource:n}),a=await ih.fromGeoJson(s);return o._model=a,o};Nr.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ne.WGS84,n)};function C2(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ee.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return Tt(i,o)}var Rd=Nr;var rwn=T(S(),1);function vu(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(vu.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});vu.fromJson=function(e,t,n,i){let o=new vu(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};vu.prototype.hasProperty=function(e,t){return!1};vu.prototype.getFeature=function(e){};vu.prototype.applyDebugSettings=function(e,t){};vu.prototype.applyStyle=function(e){};vu.prototype.update=function(e,t){};vu.prototype.pick=function(e,t,n){};vu.prototype.isDestroyed=function(){return!1};vu.prototype.destroy=function(){return me(this)};var V2=vu;var d5n=T(S(),1);var l9n=T(S(),1);var IFn=T(S(),1);var awn=T(S(),1),L2=`uniform sampler2D u_atlas; #ifdef VECTOR_TILE uniform vec4 u_highlightColor; @@ -4341,7 +8744,7 @@ void main() #endif } -`;var X3t=T(S(),1),iE=`#ifdef INSTANCED +`;var lwn=T(S(),1),R2=`#ifdef INSTANCED in vec2 direction; #endif in vec4 positionHighAndScale; @@ -4777,1729 +9180,526 @@ if (lengthSq < disableDepthTestDistance) { v_color.a *= translucency; v_splitDirection = splitDirection; } -`;var P3t=T(S(),1),oE=`in vec2 v_textureCoordinates; -const float M_PI = 3.141592653589793; - -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) - { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); - } - return value; -} - -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); -} - -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) -{ - float alphaRoughnessSquared = alphaRoughness * alphaRoughness; - float phi = 2.0 * M_PI * xi.x; - float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(upVector, N)); - vec3 tangentY = cross(N, tangentX); - return tangentX * H.x + tangentY * H.y + N * H.z; -} - -/** - * Estimate the geometric self-shadowing of the microfacets in a surface, - * using the Smith Joint GGX visibility function. - * Note: Vis = G / (4 * NdotL * NdotV) - * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3 - * see Real-Time Rendering. Page 331 to 336. - * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg) - * - * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness. - * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source. - * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera. - */ -float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) -{ - float alphaRoughnessSq = alphaRoughness * alphaRoughness; - - float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); - float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); - - float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0 - if (GGX > 0.0) - { - return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0 - } - return 0.0; -} - -vec2 integrateBrdf(float roughness, float NdotV) -{ - vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); - float A = 0.0; - float B = 0.0; - const int NumSamples = 1024; - float alphaRoughness = roughness * roughness; - for (int i = 0; i < NumSamples; i++) - { - vec2 xi = hammersley2D(i, NumSamples); - vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); - vec3 L = 2.0 * dot(V, H) * H - V; - float NdotL = clamp(L.z, 0.0, 1.0); - float NdotH = clamp(H.z, 0.0, 1.0); - float VdotH = clamp(dot(V, H), 0.0, 1.0); - if (NdotL > 0.0) - { - float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); - float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; - float Fc = pow(1.0 - VdotH, 5.0); - A += (1.0 - Fc) * G_Vis; - B += Fc * G_Vis; - } - } - return vec2(A, B) / float(NumSamples); -} - -void main() -{ - out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); -} -`;var w3t=T(S(),1),rE=`uniform sampler2D u_noiseTexture; -uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -in vec2 v_offset; -in vec3 v_maximumSize; -in vec4 v_color; -in float v_slice; -in float v_brightness; - -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); - } - return mod(value, rangeLength); -} - -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); -} - -vec2 voxelToUV(vec3 voxelIndex) { - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - - float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; - vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, - inverseNoiseTextureRows / textureSliceWidth); - vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); - float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); - float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); - - float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; - float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; - return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; -} - -// Interpolate a voxel with its neighbor (along the positive X-axis) -vec4 lerpSamplesX(vec3 voxelIndex, float x) { - vec2 uv0 = voxelToUV(voxelIndex); - vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); - vec4 sample0 = texture(u_noiseTexture, uv0); - vec4 sample1 = texture(u_noiseTexture, uv1); - return mix(sample0, sample1, x); -} - -vec4 sampleNoiseTexture(vec3 position) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); - vec3 lerpValue = fract(recenteredPos); - vec3 voxelIndex = floor(recenteredPos); - - vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); - vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); - vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); - vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); - - vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); - vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); - return mix(yLerp0, yLerp1, lerpValue.z); -} - -// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). -bool intersectSphere(vec3 origin, vec3 dir, float slice, - out vec3 point, out vec3 normal) { - float A = dot(dir, dir); - float B = dot(origin, dir); - float C = dot(origin, origin) - 0.25; - float discriminant = (B * B) - (A * C); - if(discriminant < 0.0) { - return false; - } - float root = sqrt(discriminant); - float t = (-B - root) / A; - if(t < 0.0) { - t = (-B + root) / A; - } - point = origin + t * dir; - - if(slice >= 0.0) { - point.z = (slice / 2.0) - 0.5; - if(length(point) > 0.5) { - return false; - } - } - - normal = normalize(point); - point -= czm_epsilon2 * normal; - return true; -} - -// Transforms the ray origin and direction into unit sphere space, -// then transforms the result back into the ellipsoid's space. -bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, - out vec3 point, out vec3 normal) { - if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { - return false; - } - - vec3 o = (origin - center) / scale; - vec3 d = dir / scale; - vec3 p, n; - bool intersected = intersectSphere(o, d, slice, p, n); - if(intersected) { - point = (p * scale) + center; - normal = n; - } - return intersected; -} - -// Assume that if phase shift is being called for octave i, -// the frequency is of i - 1. This saves us from doing extra -// division / multiplication operations. -vec2 phaseShift2D(vec2 p, vec2 freq) { - return (czm_pi / 2.0) * sin(freq.yx * p.yx); -} - -vec2 phaseShift3D(vec3 p, vec2 freq) { - return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); -} - -// The cloud texture function derived from Gardner's 1985 paper, -// "Visual Simulation of Clouds." -// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf -const float T0 = 0.6; // contrast of the texture pattern -const float k = 0.1; // computed to produce a maximum value of 1 -const float C0 = 0.8; // coefficient -const float FX0 = 0.6; // frequency X -const float FY0 = 0.6; // frequency Y -const int octaves = 5; - -float T(vec3 point) { - vec2 sum = vec2(0.0); - float Ci = C0; - vec2 FXY = vec2(FX0, FY0); - vec2 PXY = vec2(0.0); - for(int i = 1; i <= octaves; i++) { - PXY = phaseShift3D(point, FXY); - Ci *= 0.707; - FXY *= 2.0; - vec2 sinTerm = sin(FXY * point.xy + PXY); - sum += Ci * sinTerm + vec2(T0); - } - return k * sum.x * sum.y; -} - -const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, -const float t = 0.4; // fraction of texture shading -const float s = 0.25; // fraction of specular reflection - -float I(float Id, float Is, float It) { - return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; -} - -const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); - -vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, - float brightness) { - vec3 cloudPoint, cloudNormal; - if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, - cloudPoint, cloudNormal)) { - return vec4(0.0); - } - - float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection - float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection - float It = T(cloudPoint); // texture function - float intensity = I(Id, Is, It); - vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); - - vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); - float W = noise.x; - float W2 = noise.y; - float W3 = noise.z; - - // The dot product between the cloud's normal and the ray's direction is greatest - // in the center of the ellipsoid's surface. It decreases towards the edge. - // Thus, it is used to blur the areas leading to the edges of the ellipsoid, - // so that no harsh lines appear. - - // The first (and biggest) layer of worley noise is then subtracted from this. - // The final result is scaled up so that the base cloud is not too translucent. - float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); - float TR = pow(ndDot, 3.0) - W; // translucency - TR *= 1.3; - - // Subtracting the second and third layers of worley noise is more complicated. - // If these layers of noise were simply subtracted from the current translucency, - // the shape derived from the first layer of noise would be completely deleted. - // The erosion of this noise should thus be constricted to the edges of the cloud. - // However, because the edges of the ellipsoid were already blurred away, mapping - // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. - // The value of (0.5 - ndDot) provides the best compromise. - float minusDot = 0.5 - ndDot; - - // Even with the previous calculation, subtracting the second layer of wnoise - // erode too much of the cloud. The addition of it, however, will detailed - // volume to the cloud. As long as the noise is only added and not subtracted, - // the results are aesthetically pleasing. - - // The minusDot product is mapped in a way that it is larger at the edges of - // the ellipsoid, so a subtraction and min operation are used instead of - // an addition and max one. - TR -= min(minusDot * W2, 0.0); - - // The third level of worley noise is subtracted from the result, with some - // modifications. First, a scalar is added to minusDot so that the noise - // starts affecting the shape farther away from the center of the ellipsoid's - // surface. Then, it is scaled down so its impact is not too intense. - TR -= 0.8 * (minusDot + 0.25) * W3; - - // The texture function's shading does not correlate with the shape of the cloud - // produced by the layers of noise, so an extra shading scalar is calculated. - // The darkest areas of the cloud are assigned to be where the noise erodes - // the cloud the most. This is then interpolated based on the translucency - // and the diffuse shading term of that point in the cloud. - float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); - - // To avoid values that are too dark, this scalar is increased by a small amount - // and clamped so it never goes to zero. - shading = clamp(shading + 0.2, 0.3, 1.0); - - // Finally, the contrast of the cloud's color is increased. - vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); - return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; -} - -void main() { -#ifdef DEBUG_BILLBOARDS - out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); -#endif - // To avoid calculations with high values, - // we raycast from an arbitrarily smaller space. - vec2 coordinate = v_maximumSize.xy * v_offset; - - vec3 ellipsoidScale = 0.82 * v_maximumSize; - vec3 ellipsoidCenter = vec3(0.0); - - float zOffset = max(ellipsoidScale.z - 10.0, 0.0); - vec3 eye = vec3(0, 0, -10.0 - zOffset); - vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); - vec3 rayOrigin = eye; -#ifdef DEBUG_ELLIPSOIDS - vec3 point, normal; - if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, - point, normal)) { - out_FragColor = v_brightness * v_color; - } -#else -#ifndef DEBUG_BILLBOARDS - vec4 cloud = drawCloud(rayOrigin, rayDir, - ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); - if(cloud.w < 0.01) { - discard; - } - out_FragColor = cloud; -#endif -#endif -} -`;var A3t=T(S(),1),sE=`#ifdef INSTANCED -in vec2 direction; -#endif -in vec4 positionHighAndScaleX; -in vec4 positionLowAndScaleY; -in vec4 packedAttribute0; -in vec4 packedAttribute1; -in vec4 color; - -out vec2 v_offset; -out vec3 v_maximumSize; -out vec4 v_color; -out float v_slice; -out float v_brightness; - -void main() { - // Unpack attributes. - vec3 positionHigh = positionHighAndScaleX.xyz; - vec3 positionLow = positionLowAndScaleY.xyz; - vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); - - float show = packedAttribute0.x; - float brightness = packedAttribute0.y; - vec2 coordinates = packedAttribute0.wz; - vec3 maximumSize = packedAttribute1.xyz; - float slice = packedAttribute1.w; - -#ifdef INSTANCED - vec2 dir = direction; -#else - vec2 dir = coordinates; -#endif - - vec2 offset = dir - vec2(0.5, 0.5); - vec2 scaledOffset = scale * offset; - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - positionEC.xy += scaledOffset; - - positionEC.xyz *= show; - gl_Position = czm_projection * positionEC; - - v_offset = offset; - v_maximumSize = maximumSize; - v_color = color; - v_slice = slice; - v_brightness = brightness; -} -`;var N3t=T(S(),1),aE=`uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -uniform vec3 u_noiseOffset; -in vec2 v_position; - -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); - } - return mod(value, rangeLength); -} - -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); -} - -vec3 random3(vec3 p) { - float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); - float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); - return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); -} - -// Frequency corresponds to cell size. -// The higher the frequency, the smaller the cell size. -vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 cell = centerCell + offset; - cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); - cell += floor(u_noiseOffset / u_noiseDetail); - vec3 p = offset + random3(cell); - return p; -} - -float worleyNoise(vec3 p, float freq) { - vec3 centerCell = floor(p * freq); - vec3 pointInCell = fract(p * freq); - float shortestDistance = 1000.0; - - for(float z = -1.0; z <= 1.0; z++) { - for(float y = -1.0; y <= 1.0; y++) { - for(float x = -1.0; x <= 1.0; x++) { - vec3 offset = vec3(x, y, z); - vec3 point = getWorleyCellPoint(centerCell, offset, freq); - - float distance = length(pointInCell - point); - if(distance < shortestDistance) { - shortestDistance = distance; - } - } - } - } - - return shortestDistance; -} - -const float MAX_FBM_ITERATIONS = 10.0; - -float worleyFBMNoise(vec3 p, float octaves, float scale) { - float noise = 0.0; - float freq = 1.0; - float persistence = 0.625; - for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { - if(i >= octaves) { - break; - } - - noise += worleyNoise(p * scale, freq * scale) * persistence; - persistence *= 0.5; - freq *= 2.0; - } - return noise; -} - -void main() { - float textureSliceWidth = u_noiseTextureDimensions.x; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - float x = mod(v_position.x, textureSliceWidth); - float y = mod(v_position.y, textureSliceWidth); - float sliceRow = floor(v_position.y / textureSliceWidth); - float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; - - vec3 position = vec3(x, y, z); - position /= u_noiseDetail; - float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); - float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); - float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); - out_FragColor = vec4(worley0, worley1, worley2, 1.0); -} -`;var U3t=T(S(),1),cE=`uniform vec3 u_noiseTextureDimensions; -in vec2 position; - -out vec2 v_position; - -void main() -{ - gl_Position = vec4(position, 0.1, 1.0); - - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - vec2 transformedPos = (position * 0.5) + vec2(0.5); - transformedPos *= textureSliceWidth; - transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; - transformedPos.y *= noiseTextureRows; - v_position = transformedPos; -} -`;var B3t=T(S(),1),lE=`uniform sampler2D u_opaqueDepthTexture; -uniform sampler2D u_translucentDepthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; - float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; - translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); - out_FragColor = czm_packDepth(translucentDepth); -} -`;var Y3t=T(S(),1),dE=`/** - * Compositing for Weighted Blended Order-Independent Transparency. See: - * - http://jcgt.org/published/0002/02/09/ - * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html - */ - -uniform sampler2D u_opaque; -uniform sampler2D u_accumulation; -uniform sampler2D u_revealage; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 opaque = texture(u_opaque, v_textureCoordinates); - vec4 accum = texture(u_accumulation, v_textureCoordinates); - float r = texture(u_revealage, v_textureCoordinates).r; - -#ifdef MRT - vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); -#else - vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); -#endif - - out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; - - if (opaque != czm_backgroundColor) - { - out_FragColor.a = 1.0; - } -} -`;var z3t=T(S(),1),uE=`uniform samplerCube u_radianceMap; - -in vec2 v_textureCoordinates; - - -const float twoSqrtPi = 2.0 * sqrt(czm_pi); - -// Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf -float computeShBasis(int index, vec3 s) { - if (index == 0) { // l = 0, m = 0 - return 1.0 / twoSqrtPi; - } - - if (index == 1) { // l = 1, m = -1 - return -sqrt(3.0) * s.y / twoSqrtPi; - } - - if (index == 2) { // l = 1, m = 0 - return sqrt(3.0) * s.z / twoSqrtPi; - } - - if (index == 3) { // l = 1, m = 1 - return -sqrt(3.0) * s.x / twoSqrtPi; - } - - if (index == 4) { // l = 2, m = -2 - return sqrt(15.0) * s.y * s.x / twoSqrtPi; - } - - if (index == 5) { // l = 2, m = -1 - return -sqrt(15.0) * s.y * s.z / twoSqrtPi; - } - - if (index == 6) { // l = 2, m = 0 - return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; - } - - if (index == 7) { // l = 2, m = 1 - return -sqrt(15.0) * s.x * s.z / twoSqrtPi; - } - - if (index == 8) { // l = 2, m = 2 - return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; - } - - return 0.0; -} - -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) - { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); - } - return value; -} - -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); -} - -// Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics -const int samples = 256; -const float solidAngle = 1.0 / float(samples); - -void main() { - // Get the current coefficient based on the uv - vec2 uv = v_textureCoordinates.xy * 3.0; - int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); - - for (int i = 0; i < samples; ++i) { - vec2 xi = hammersley2D(i, samples); - float phi = czm_twoPi * xi.x; - float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); - - // Generate the spherical harmonics basis from the direction - float Ylm = computeShBasis(coefficientIndex, direction); - - vec3 lookupDirection = -direction.xyz; - lookupDirection.z = -lookupDirection.z; - - vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); - - // Use the relevant function for this coefficient - out_FragColor += Ylm * color * solidAngle * sinTheta; - } - -} -`;var J3t=T(S(),1),mE=`precision highp float; - -in vec2 v_textureCoordinates; - -uniform vec3 u_faceDirection; // Current cubemap face -uniform vec3 u_positionWC; -uniform mat4 u_enuToFixedFrame; -uniform vec4 u_brightnessSaturationGammaIntensity; -uniform vec4 u_groundColor; // alpha component represent albedo - -vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { - vec2 scaledUV = uv * 2.0 - 1.0; - - if (faceDir.x != 0.0) { - return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); - } else if (faceDir.y != 0.0) { - return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); - } else { - return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); - } -} - -void main() { - float height = length(u_positionWC); - float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; - float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); - - // Scale the position to ensure the sky color is present, even when underground. - vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); - - float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; - float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; - - vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; - vec3 normalizedDirection = normalize(direction); - - czm_ray ray = czm_ray(positionWC, normalizedDirection); - czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); - if (!czm_isEmpty(intersection)) { - intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); - } - - bool onEllipsoid = intersection.start >= 0.0; - float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); - - // Compute sky color for each position on a sphere at radius centered around the provided position's origin - vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; - - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); - vec3 mieColor; - vec3 rayleighColor; - float opacity; - czm_computeScattering( - ray, - rayLength, - lightDirectionWC, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); - - vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); - -#ifdef ATMOSPHERE_COLOR_CORRECT - const bool ignoreBlackPixels = true; - atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); -#endif - - vec3 lookupDirection = -normalizedDirection; - // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. - lookupDirection.x = -lookupDirection.x; - lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); - lookupDirection.x = -lookupDirection.x; - - // Values outside the atmopshere are rendered as black, when they should be treated as transparent - float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); - skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent - - // Blend starmap with atmopshere scattering - float intensity = u_brightnessSaturationGammaIntensity.w; - vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); - vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); - vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); - - // Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height - vec3 up = normalize(positionWC); - float occlusion = max(dot(lightDirectionWC, up), 0.05); - vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); - vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); - - vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); - - float brightness = u_brightnessSaturationGammaIntensity.x; - float saturation = u_brightnessSaturationGammaIntensity.y; - float gamma = u_brightnessSaturationGammaIntensity.z; - -#ifdef ENVIRONMENT_COLOR_CORRECT - color.rgb = mix(vec3(0.0), color.rgb, brightness); - color.rgb = czm_saturation(color.rgb, saturation); -#endif - color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0. - color.rgb = czm_gammaCorrect(color.rgb); - - out_FragColor = color; -} -`;var j3t=T(S(),1),hE=`precision highp float; - -in vec3 v_textureCoordinates; - -uniform float u_roughness; -uniform samplerCube u_radianceTexture; -uniform vec3 u_faceDirection; - -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) - { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); - } - return value; -} - -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); -} - -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) -{ - float alphaRoughnessSquared = alphaRoughness * alphaRoughness; - float phi = czm_twoPi * xi.x; - float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(upVector, N)); - vec3 tangentY = cross(N, tangentX); - return tangentX * H.x + tangentY * H.y + N * H.z; -} - -// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses -const int samples = 128; - -void main() { - vec3 normal = u_faceDirection; - vec3 V = normalize(v_textureCoordinates); - float roughness = u_roughness; - - vec4 color = vec4(0.0); - float weight = 0.0; - for (int i = 0; i < samples; ++i) { - vec2 xi = hammersley2D(i, samples); - vec3 H = importanceSampleGGX(xi, roughness, V); - vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector - - float NdotL = max(dot(V, L), 0.0); - if (NdotL > 0.0) { - color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; - weight += NdotL; - } - } - out_FragColor = color / weight; -} -`;var $3t=T(S(),1),fE=`in vec3 position; -out vec3 v_textureCoordinates; - -uniform vec3 u_faceDirection; - -vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { - vec2 scaledUV = uv; - - if (faceDir.x != 0.0) { - return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); - } else if (faceDir.y != 0.0) { - return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); - } else { - return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); - } -} - +`;var Xwn=T(S(),1);function _i(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Nt.clone(n)),l(i)&&(i=Nt.clone(i)),l(o)&&(o=Nt.clone(o)),l(r)&&(r=wt.clone(r)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._pixelOffset=D.clone(y(e.pixelOffset,D.ZERO)),this._translate=new D(0,0),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._heightReference=y(e.heightReference,Je.NONE),this._verticalOrigin=y(e.verticalOrigin,Pn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,yi.CENTER),this._scale=y(e.scale,1),this._color=B.clone(y(e.color,B.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=m.clone(y(e.alignedAxis,m.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=Bn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=B.clone(y(e.outlineColor,B.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping(),this._splitDirection=y(e.splitDirection,vr.NONE)}var ace=_i.SHOW_INDEX=0,j5=_i.POSITION_INDEX=1,uce=_i.PIXEL_OFFSET_INDEX=2,NHe=_i.EYE_OFFSET_INDEX=3,kHe=_i.HORIZONTAL_ORIGIN_INDEX=4,UHe=_i.VERTICAL_ORIGIN_INDEX=5,DHe=_i.SCALE_INDEX=6,q5=_i.IMAGE_INDEX_INDEX=7,cce=_i.COLOR_INDEX=8,BHe=_i.ROTATION_INDEX=9,OHe=_i.ALIGNED_AXIS_INDEX=10,YHe=_i.SCALE_BY_DISTANCE_INDEX=11,HHe=_i.TRANSLUCENCY_BY_DISTANCE_INDEX=12,zHe=_i.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,KHe=_i.DISTANCE_DISPLAY_CONDITION=14,JHe=_i.DISABLE_DEPTH_DISTANCE=15;_i.TEXTURE_COORDINATE_BOUNDS=16;var lce=_i.SDF_INDEX=17,QHe=_i.SPLIT_DIRECTION_INDEX=18;_i.NUMBER_OF_PROPERTIES=19;function Fo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(_i.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Fo(this,ace))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),Fo(this,j5))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Fo(this,j5))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;D.equals(t,e)||(D.clone(e,t),Fo(this,uce))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Nt.equals(t,e)||(this._scaleByDistance=Nt.clone(e,t),Fo(this,YHe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Nt.equals(t,e)||(this._translucencyByDistance=Nt.clone(e,t),Fo(this,HHe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Nt.equals(t,e)||(this._pixelOffsetScaleByDistance=Nt.clone(e,t),Fo(this,zHe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),Fo(this,NHe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Fo(this,kHe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Fo(this,UHe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Fo(this,DHe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),Fo(this,cce))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Fo(this,BHe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),Fo(this,OHe))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Fo(this,q5))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Fo(this,q5))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Fo(this,cce))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){wt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition),Fo(this,KHe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Fo(this,JHe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof Ze?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Bn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Fo(this,q5))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),Fo(this,j5)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Fo(this,ace))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),Fo(this,lce))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Fo(this,lce))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Fo(this,QHe))}}});_i.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};_i.prototype._updateClamping=function(){_i._updateClamping(this._billboardCollection,this)};var $5=new he;_i._updateClamping=function(e,t){let n=e._scene;if(!l(n))return;let i=y(n.ellipsoid,ne.default),o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===Je.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Je.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(d){let u=i.cartographicToCartesian(d,t._clampedPosition);jS(t._heightReference)&&(t._mode===oe.SCENE3D?(d.height+=s.height,i.cartographicToCartesian(d,u)):u.x+=s.height),t._clampedPosition=u}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,$5);let c=n.getHeight(s,t._heightReference);l(c)&&($5.height=c),a($5)};_i.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(c){if(r._imageId!==t||r._image!==n||!ze.equals(r._imageSubRegion,i))return;let d=e.textureCoordinates[c];r._imageWidth=e.texture.width*d.width,r._imageHeight=e.texture.height*d.height,r._imageIndex=c,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,Fo(r,q5);let u=r._billboardCollection._scene;l(u)&&u.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;let a=e.getImageIndex(t);if(l(a)&&!l(i)){s(a);return}o.then(s).catch(function(c){console.error(`Error loading image for billboard: ${c}`),r._imageIndexPromise=void 0})};_i.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};_i.prototype.setImageSubRegion=function(e,t){this._imageId===e&&ze.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=ze.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};_i.prototype._setTranslate=function(e){let t=this._translate;D.equals(t,e)||(D.clone(e,t),Fo(this,uce))};_i.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};_i.prototype._setActualPosition=function(e){l(this._clampedPosition)||m.clone(e,this._actualPosition),Fo(this,j5)};var dce=new se;_i._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(M.multiplyByPoint(i,t,dce),Ui.computeActualEllipsoidPosition(n,dce))};var mce=new m;_i._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=M.multiplyByPoint(e,t,mce),a=Ui.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return D.add(a,i,a),a};var Q5=new D(0,0);_i.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new D),D.clone(this._pixelOffset,Q5),D.add(Q5,this._translate,Q5);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,$5);o=a.cartographicToCartesian(c,mce),i=M.IDENTITY}return _i._computeScreenSpacePosition(i,o,this._eyeOffset,Q5,e,t)};_i.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===yi.RIGHT?s-=i:e.horizontalOrigin===yi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Pn.BOTTOM||e.verticalOrigin===Pn.BASELINE?a-=o:e.verticalOrigin===Pn.CENTER&&(a-=o*.5),l(n)||(n=new ze),n.x=s,n.y=a,n.width=i,n.height=o,n};_i.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&ze.equals(this._imageSubRegion,e._imageSubRegion)&&B.equals(this._color,e._color)&&D.equals(this._pixelOffset,e._pixelOffset)&&D.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&Nt.equals(this._scaleByDistance,e._scaleByDistance)&&Nt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Nt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&wt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};_i.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var lo=_i;var Pwn=T(S(),1),jHe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Lo=Object.freeze(jHe);var wwn=T(S(),1),qHe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Os=Object.freeze(qHe);var Kwn=T(S(),1);function gb(e,t,n,i,o){this.bottomLeft=y(e,D.ZERO),this.topRight=y(t,D.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var $He=new D(16,16);function Wg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,$He);this._context=e.context,this._pixelFormat=y(e.pixelFormat,nt.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Bn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(Wg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Xt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function eze(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),d=o*(a+t.height+r),u=s/c,h=a/d,p=new gb(new D(s+r,r),new D(c,a)),g=new gb(new D,new D(c,a),e._root,p),f=new gb(new D(r,a+r),new D(c,d)),x=new gb(new D,new D(c,d),g,f);for(let V=0;Vs){t.childNode1=new gb(new D(t.bottomLeft.x,t.bottomLeft.y),new D(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let p,g;if(l(o._labelDimensions))g=o._labelDimensions.x,p=o._labelDimensions.y;else{let C=0,V=0,L=o._imageIndex;if(L!==-1){let G=n[L];C=G.height,V=G.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*C));let Z=e._textureAtlas.texture.width;g=Math.round(y(o.width,Z*V))}let f=Math.floor(W.clamp(g,0,Xz)),x=Math.floor(W.clamp(p,0,Xz)),_=f*Xz+x;e._instanced?(r=o._index,s(r,a,c,u,_)):(r=o._index*4,s(r+0,a,c,u,_),s(r+1,a,c,u,_),s(r+2,a,c,u,_),s(r+3,a,c,u,_))}function Fce(e,t,n,i,o){if(Cu(o.heightReference)){let f=e._scene,x=t.context,_=t.globeTranslucencyState.translucent,C=l(f.globe)&&f.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!_&&C}let r,s=i[uo.textureCoordinateBoundsOrLabelTranslate];if(Ft.maximumVertexTextureImageUnits>0){let f=0,x=0;l(o._labelTranslate)&&(f=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,f,x,0,0)):(r=o._index*4,s(r+0,f,x,0,0),s(r+1,f,x,0,0),s(r+2,f,x,0,0),s(r+3,f,x,0,0));return}let a=0,c=0,d=0,u=0,h=o._imageIndex;if(h!==-1){let f=n[h];a=f.x,c=f.y,d=f.width,u=f.height}let p=a+d,g=c+u;e._instanced?(r=o._index,s(r,a,c,p,g)):(r=o._index*4,s(r+0,a,c,p,g),s(r+1,a,c,p,g),s(r+2,a,c,p,g),s(r+3,a,c,p,g))}function xze(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[uo.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function Ace(e,t,n,i,o){if(!e._sdf)return;let r,s=i[uo.sdf],a=o.outlineColor,c=o.outlineWidth,d=B.floatToByte(a.red),u=B.floatToByte(a.green),h=B.floatToByte(a.blue),p=d*e1+u*Tf+h,g=c/Os.RADIUS,f=B.floatToByte(a.alpha)*e1+B.floatToByte(g)*Tf;e._instanced?(r=o._index,s(r,p,f)):(r=o._index*4,s(r+0,p+Zce,f),s(r+1,p+Gce,f),s(r+2,p+Ece,f),s(r+3,p+Ice,f))}function Mce(e,t,n,i,o){let r=i[uo.splitDirection],s=0,a=o.splitDirection;l(a)&&(s=a);let c;e._instanced?(c=o._index,r(c,s)):(c=o._index*4,r(c+0,s),r(c+1,s),r(c+2,s),r(c+3,s))}function _ze(e,t,n,i,o){Lce(e,t,n,i,o),Xce(e,t,n,i,o),Wce(e,t,n,i,o),Pz(e,t,n,i,o),vz(e,t,n,i,o),Pce(e,t,n,i,o),vce(e,t,n,i,o),wce(e,t,n,i,o),Fce(e,t,n,i,o),xze(e,t,n,i,o),Ace(e,t,n,i,o),Mce(e,t,n,i,o)}function Wz(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c0){this._vaf=fze(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let P=0;P0){let P=Vze;P.length=0,(c[G2]||c[rze]||c[oze])&&P.push(Lce),(c[Z2]||c[pce]||c[nze]||c[ize]||c[tze])&&(P.push(Xce),this._instanced&&P.push(vz)),(c[Z2]||c[sze]||c[xce])&&(P.push(Wce),P.push(Pz)),(c[Z2]||c[gce])&&P.push(Pz),c[bce]&&P.push(vz),c[yce]&&P.push(Pce),c[_ce]&&P.push(vce),(c[Tce]||c[aze]||c[Z2]||c[G2])&&P.push(wce),(c[Z2]||c[G2])&&P.push(Fce),c[Sce]&&P.push(Ace),c[Cce]&&P.push(Mce);let w=P.length;if(h=this._vaf.writers,a/n>.1){for(let F=0;Fn*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,x=M.IDENTITY;e.mode===oe.SCENE3D?(x=this.modelMatrix,f=le.clone(this._baseVolumeWC,this._boundingVolume)):f=le.clone(this._baseVolume2D,this._boundingVolume),Sze(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Lo.TRANSLUCENT;this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:P?ie.LEQUAL:ie.LESS},depthMask:P,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,V,L,Z,G,I=Ft.maximumVertexTextureImageUnits>0;if(_||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=R2,V=L2,G=[],l(this._batchTable)&&(G.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),V=this._batchTable.getFragmentShaderCallback(!1,void 0)(V)),L=new De({defines:G,sources:[C]}),this._instanced&&L.defines.push("INSTANCED"),this._shaderRotation&&L.defines.push("ROTATION"),this._shaderAlignedAxis&&L.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&L.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&L.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&L.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&L.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&L.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(I?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK"));let P=1-Os.CUTOFF;this._sdf&&L.defines.push("SDF");let w=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(Z=new De({defines:["OPAQUE",w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._sp=$t.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:uo}),Z=new De({defines:["TRANSLUCENT",w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=$t.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:uo})),this._blendOption===Lo.OPAQUE&&(Z=new De({defines:[w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._sp=$t.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:uo})),this._blendOption===Lo.TRANSLUCENT&&(Z=new De({defines:[w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=$t.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:uo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let v=e.commandList;if(p.render||p.pick){let P=this._colorCommands,w=this._blendOption===Lo.OPAQUE,F=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT,b=this._vaf.va,R=b.length,E=this._uniforms,X;l(this._batchTable)?(E=this._batchTable.getUniformMapCallback()(E),X=this._batchTable.getPickId()):X="v_pickColor",P.length=R;let A=F?R*2:R;for(let N=0;N0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,Rze);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=B.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&t1(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ha.defaultColor=B.WHITE;ha.defaultPointOutlineColor=B.BLACK;ha.defaultPointOutlineWidth=0;ha.defaultPointSize=8;function t1(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,ha.defaultColor),i=y(e._pointOutlineColor,ha.defaultPointOutlineColor),o=y(e._pointOutlineWidth,ha.defaultPointOutlineWidth),r=y(e._pointSize,ha.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(B.equals(n,s)&&B.equals(i,a)&&o===c&&r===d)return;e._billboardColor=B.clone(n,e._billboardColor),e._billboardOutlineColor=B.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([h,r,p,o]);t.setImage(g,R_(u,h,p,o,r))}ha.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ha.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ha.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ha.prototype.getPropertyInherited=function(e){return ks.getPropertyInherited(this._content,this._batchId,e)};ha.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ha.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ha.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ha.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var yb=ha;var WAn=T(S(),1);var YFn=T(S(),1);function Zze(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),d=100,u=r.width+d|0,h=3*a,p=h/2;c.width=u,c.height=h;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,d/2,p)),o&&(g.fillStyle="black",g.fillText(t,d/2,p));let f=g.getImageData(0,0,u,h).data,x=f.length,_=u*4,C,V,L,Z;for(C=0;C=0;--C)if(f[C]!==255){Z=C/_|0;break}let G=-1;for(C=0;C]/,o=[],r="",s=ps.LTR,a="",c=e.length;for(let d=0;d";case">":return"<"}}var Aze="\u05D0-\u05EA",Mze="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Yce=new RegExp(`[${Aze}${Mze}]`);function Nze(e){let t=e.split(` +`),n="";for(let i=0;id+1?s[d+1].Type===ps.RTL?(c=h+c,a=0):(c=W2(c,a,u.Word),a+=u.Word.length):c=W2(c,0,h)):u.Type===ps.RTL?c=W2(c,a,h):u.Type===ps.LTR?(c+=u.Word,a=c.length):(u.Type===ps.WEAK||u.Type===ps.BRACKETS)&&(d>0&&s[d-1].Type===ps.RTL?s.length>d+1?s[d+1].Type===ps.RTL?c=W2(c,a,h):(c+=u.Word,a=c.length):c+=u.Word:(c+=u.Word,a=c.length))}n+=c,i0,h=t._backgroundBillboard,p=e._backgroundBillboardCollection;u?(l(h)||(h=p.add({collection:e,image:jce,imageSubRegion:Oze}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=yi.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t.totalScale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition,h.disableDepthTestDistance=t._disableDepthTestDistance,h.clusterShow=t.clusterShow):l(h)&&(p.remove(h),t._backgroundBillboard=h=void 0);let g=e._glyphTextureCache;for(d=0;d0&&L.height>0){let Z=(0,Jce.default)(L,{cutoff:Os.CUTOFF,radius:Os.RADIUS}),G=L.getContext("2d"),I=L.width,v=L.height,P=G.getImageData(0,0,I,v);for(let w=0;w0?V=L.pop():(V=e._billboardCollection.add({collection:e}),V._labelDimensions=new D,V._labelTranslate=new D),a.billboard=V),V.show=t._show,V.position=t._position,V.eyeOffset=t._eyeOffset,V.pixelOffset=t._pixelOffset,V.horizontalOrigin=yi.LEFT,V.verticalOrigin=t._verticalOrigin,V.heightReference=t._heightReference,V.scale=t.totalScale,V.pickPrimitive=t,V.id=t._id,V.image=_,V.translucencyByDistance=t._translucencyByDistance,V.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,V.scaleByDistance=t._scaleByDistance,V.distanceDisplayCondition=t._distanceDisplayCondition,V.disableDepthTestDistance=t._disableDepthTestDistance,V._batchIndex=t._batchIndex,V.outlineColor=t.outlineColor,t.style===Oo.FILL_AND_OUTLINE?(V.color=t._fillColor,V.outlineWidth=t.outlineWidth):t.style===Oo.FILL?(V.color=t._fillColor,V.outlineWidth=0):t.style===Oo.OUTLINE&&(V.color=B.TRANSPARENT,V.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function Kce(e,t,n){return t===yi.CENTER?-e/2:t===yi.RIGHT?-(e+n.x):n.x}var lr=new D,Qze=new D;function jze(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,d=0,u=1,h,p=t.length,g=e._backgroundBillboard,f=D.clone(l(g)?e._backgroundPadding:D.ZERO,Qze);for(f.x/=e._relativeSize,f.y/=e._relativeSize,h=0;h0&&(C===yi.CENTER?G=-s/2-f.x:C===yi.RIGHT?G=-(s+f.x*2):G=0,lr.x=G*_,V===Pn.TOP?lr.y=x-d-c:V===Pn.CENTER?lr.y=(x-d)/2-c:V===Pn.BASELINE?lr.y=-f.y-c:lr.y=0,lr.y=lr.y*_,g.width=P,g.height=w,g._setTranslate(lr),g._labelTranslate=D.clone(lr,g._labelTranslate)),Cu(e.heightReference))for(h=0;h0?Lo.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Sf.prototype.isDestroyed=function(){return!1};Sf.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),me(this)};var Cf=Sf;var OMn=T(S(),1);var vAn=T(S(),1),P2=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 position2DHigh; +in vec3 position2DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 prevPosition2DHigh; +in vec3 prevPosition2DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec3 nextPosition2DHigh; +in vec3 nextPosition2DLow; +in vec4 texCoordExpandAndBatchIndex; + +out vec2 v_st; +out float v_width; +out vec4 v_pickColor; +out float v_polylineAngle; void main() { - vec3 position; - vec3 direction; - if (czm_orthographicIn3D == 1.0) + float texCoord = texCoordExpandAndBatchIndex.x; + float expandDir = texCoordExpandAndBatchIndex.y; + bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; + float batchTableIndex = texCoordExpandAndBatchIndex.w; + + vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); + float width = widthAndShow.x + 0.5; + float show = widthAndShow.y; + + if (width < 1.0) { - vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; - vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom - vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top - position = vec3(mix(minPlane, maxPlane, uv), 0.0); - direction = vec3(0.0, 0.0, -1.0); - } - else - { - position = vec3(0.0); - direction = normalize(positionEC.xyz); + show = 0.0; } - czm_ray ray = czm_ray(position, direction); + vec4 pickColor = batchTable_getPickColor(batchTableIndex); - vec3 ellipsoid_center = czm_view[3].xyz; - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); - if (!czm_isEmpty(intersection)) + vec4 p, prev, next; + if (czm_morphTime == 1.0) { - out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); + p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); + prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); + next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); + prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); + next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); } else { - discard; + p = czm_columbusViewMorph( + czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), + czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), + czm_morphTime); + prev = czm_columbusViewMorph( + czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), + czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), + czm_morphTime); + next = czm_columbusViewMorph( + czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), + czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), + czm_morphTime); } - czm_writeLogDepth(); -} -`;var iOt=T(S(),1),bE=`in vec4 position; + #ifdef DISTANCE_DISPLAY_CONDITION + vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); + vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); + vec3 centerLow = centerLowAndRadius.xyz; + float radius = centerLowAndRadius.w; + vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); -out vec4 positionEC; + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + lengthSq = czm_eyeHeight2D.y; + } + else + { + vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); + lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); + } + + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + if (lengthSq < nearSq || lengthSq > farSq) + { + show = 0.0; + } + #endif + + float polylineAngle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); + gl_Position = czm_viewportOrthographic * positionWC * show; + + v_st.s = texCoord; + v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); + + v_width = width; + v_pickColor = pickColor; + v_polylineAngle = polylineAngle; +} +`;var rMn=T(S(),1);var zAn=T(S(),1);var tl={};tl.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};tl.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var qze=new he;tl.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o0){t=y(t,M.IDENTITY);let o=M.inverseTransformation(t,$ze),r=M.multiplyByPoint(o,m.ZERO,eKe),s=m.normalize(M.multiplyByPointAsVector(o,m.UNIT_Y,$ce),$ce),a=an.fromPointNormal(r,s,tKe),c=m.normalize(M.multiplyByPointAsVector(o,m.UNIT_X,ele),ele),d=an.fromPointNormal(r,c,nKe),u=1;n.push(m.clone(e[0]));let h=n[0],p=e.length;for(let g=1;g2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Pi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(ole),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=le.fromPoints(this._actualPositions),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new le}var ile=Gd.POSITION_INDEX=0,lKe=Gd.SHOW_INDEX=1,dKe=Gd.WIDTH_INDEX=2,uKe=Gd.MATERIAL_INDEX=3,w2=Gd.POSITION_SIZE_INDEX=4,mKe=Gd.DISTANCE_DISPLAY_CONDITION=5,ole=Gd.NUMBER_OF_PROPERTIES=6;function xb(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Gd.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,xb(this,lKe))}},positions:{get:function(){return this._positions},set:function(e){let t=To(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&xb(this,w2),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=le.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),xb(this,ile),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,xb(this,uKe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,xb(this,dKe))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,xb(this,w2)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){wt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition),xb(this,mKe))}}});Gd.prototype.update=function(){let e=M.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[ile]>0||this._propertiesChanged[w2]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=Pi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)xb(this,w2);else{let o=n.length;for(let r=0;r2){if(o[Bz]||o[rle]){let f=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=On.fromCartesian(f.center,hle),_=se.fromElements(x.low.x,x.low.y,x.low.z,f.radius,fle);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[bKe]){let f=ple;f.x=0,f.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(f.x=x.near,f.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c0){let Y=w.isTranslucent();a>=s?(b=new qe({owner:e}),n.push(b)):b=n[a],++a,R=Tt(p(w._uniforms),e._uniformMap),b.boundingVolume=le.clone(F2,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=Y?e._translucentRS:e._opaqueRS,b.pass=Y?Ee.TRANSLUCENT:Ee.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=F,b.offset=Z,Z+=F,F=0,c=!0,r.push(b)}w=X._material,w.update(o),P=A}let N=X._locatorBuckets,O=N.length;for(let Y=0;Y0&&(a>=s?(b=new qe({owner:e}),n.push(b)):b=n[a],++a,R=Tt(p(w._uniforms),e._uniformMap),b.boundingVolume=le.clone(F2,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=w.isTranslucent()?e._translucentRS:e._opaqueRS,b.pass=w.isTranslucent()?Ee.TRANSLUCENT:Ee.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=F,b.offset=Z,c=!0,r.push(b)),P=void 0}}n.length=a}rh.prototype.isDestroyed=function(){return!1};rh.prototype.destroy=function(){return ble(this),Yz(this),gle(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function xKe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Bz]?(i.bufferUsage!==Me.STREAM_DRAW&&(t=!0,i.bufferUsage=Me.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Me.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Me.STATIC_DRAW):i.frameCount--),t}var ale=[0,0,0];function cle(e,t,n){e._createVertexArray=!1,Yz(e),ble(e),SKe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,h=e._polylineBuckets,p,g;for(p in h)h.hasOwnProperty(p)&&(g=h[p],g.updateShader(t,r,s),u+=g.lengthOfPositions);if(u>0){let f=e._mode,x=new Float32Array(6*u*3),_=new Float32Array(u*4),C,V=0,L=0,Z=0;for(p in h)if(h.hasOwnProperty(p)){g=h[p],g.write(x,_,V,L,Z,r,t,n),f===oe.MORPHING&&(l(C)||(C=new Float32Array(6*u*3)),g.writeForMorph(C,V));let R=g.lengthOfPositions;V+=6*R*3,L+=R*4,Z+=R*4,c=g.updateIndices(i,a,d,c)}let G=e._positionBufferUsage.bufferUsage,I=Me.STATIC_DRAW;e._positionBuffer=yt.createVertexBuffer({context:t,typedArray:x,usage:G});let v;l(C)&&(v=yt.createVertexBuffer({context:t,typedArray:C,usage:G})),e._texCoordExpandAndBatchIndexBuffer=yt.createVertexBuffer({context:t,typedArray:_,usage:I});let P=3*Float32Array.BYTES_PER_ELEMENT,w=4*Float32Array.BYTES_PER_ELEMENT,F=0,b=i.length;for(let R=0;R0){let E=new Uint16Array(o),X=yt.createIndexBuffer({context:t,typedArray:E,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});F+=a[R];let A=6*(R*(P*W.SIXTY_FOUR_KILOBYTES)-F*P),N=P+A,O=P+N,U=P+O,Y=P+U,k=P+Y,H=R*(w*W.SIXTY_FOUR_KILOBYTES)-F*w,J=[{index:Nl.position3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:Nl.position3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:Nl.position2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:Nl.position2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:Nl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Nl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Nl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Nl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Nl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*P},{index:Nl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Nl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*P},{index:Nl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Nl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:H}],te,z,j,ee;f===oe.SCENE3D?(z=e._positionBuffer,te="vertexBuffer",j=ale,ee="value"):f===oe.SCENE2D||f===oe.COLUMBUS_VIEW?(z=ale,te="value",j=e._positionBuffer,ee="vertexBuffer"):(z=v,te="vertexBuffer",j=e._positionBuffer,ee="vertexBuffer"),J[0][te]=z,J[1][te]=z,J[2][ee]=j,J[3][ee]=j,J[4][te]=z,J[5][te]=z,J[6][ee]=j,J[7][ee]=j,J[8][te]=z,J[9][te]=z,J[10][ee]=j,J[11][ee]=j;let fe=new ni({context:t,attributes:J,indexBuffer:X});e._vertexArrays.push({va:fe,buckets:d[R]})}}}function _Ke(e,t){return t instanceof Xt?t.id:t}var ok=[];function TKe(e){let t=Hi._uniformList[e.type],n=t.length;ok.length=2*n;let i=0;for(let o=0;o1){a.update();let c=a.material,d=i[c.type];l(d)||(d=i[c.type]=new Vf(c,t,n)),d.addPolyline(a)}}}function CKe(e,t){let n=t.mode;(e._mode!==n||!M.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=M.clone(e.modelMatrix),e._createVertexArray=!0)}function Oz(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s0,_=g._index,C=this.getSegments(g,a),V=C.positions,L=C.lengths,Z=V.length,G=g.getPickId(s).color,I=0,v=0,P;for(let O=0;O0||Vs.x>0&&ku.x<0)&&m.clone(Vs,ku),(Vs.x<0&&Uu.x>0||Vs.x>0&&Uu.x<0)&&m.clone(Vs,Uu));let H=Y?2:0,J=k?2:4;for(let te=H;te2&&(r.setBatchedAttribute(_,2,E),r.setBatchedAttribute(_,3,X),r.setBatchedAttribute(_,4,A))}};var RKe=new m,ZKe=new m,GKe=new m,lle=new m;Vf.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r0&&(c=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let h=0;h0)g[0]=x;else continue}else g=p._segments.lengths;let f=g.length;if(f>0){let x=0;for(let _=0;_W.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new Dz(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>W.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new Dz(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Vf.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o0){e._boundingVolume2D=le.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(d.z,d.x,d.y)}return n1.positions=o,n1.lengths=e._segments.lengths,n1};var ule;Vf.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*W.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=ule,c=6*s*3;!l(a)||a.lengthc&&(a=new Float32Array(a.buffer,0,c));let d=this.getSegments(t,i),u=d.positions,h=d.lengths,p=0,g=0,f=0,x;s=u.length;for(let _=0;_0||Vs.x>0&&ku.x<0)&&m.clone(Vs,ku),(Vs.x<0&&Uu.x>0||Vs.x>0&&Uu.x<0)&&m.clone(Vs,Uu));let Z=V?2:0,G=L?2:4;for(let I=Z;I{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3;for(let g=0;g{e.isDestroyed()||(e._error=a)})}Fg.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(g.packedBuffer),x=f[0];OKe(e,f),e._indices=Ae.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),KKe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function KKe(e){l(e._primitive)||(e._primitive=new qx({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}_b.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};_b.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};_b.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};_b.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};_b.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=zKe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};_b.prototype.isDestroyed=function(){return!1};_b.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var k2=_b;var q9n=T(S(),1);var R9n=T(S(),1),U2=`in vec4 currentPosition; +in vec4 previousPosition; +in vec4 nextPosition; +in vec2 expandAndWidth; +in float a_batchId; + +uniform mat4 u_modifiedModelView; void main() { - positionEC = czm_modelView * position; - gl_Position = czm_modelViewProjection * position; + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; - czm_vertexLogDepth(); + vec4 p = u_modifiedModelView * currentPosition; + vec4 prev = u_modifiedModelView * previousPosition; + vec4 next = u_modifiedModelView * nextPosition; + + float angle; + vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; } -`;var rOt=T(S(),1),QS=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; - -in vec3 v_positionEC; - -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +`;function ah(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(ah.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function JKe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ne.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,ne.pack(o,a,c),c+=ne.packedLength,m.pack(r,a,c),a}var QKe=new gi("createVectorTilePolylines",5),i1={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function jKe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=JKe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=QKe.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let h=u.indexDatatype;e._indices=h===Ae.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),qKe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function qKe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let d=yt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),u=yt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),h=yt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),p=yt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),g=yt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),f=yt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),x=[{index:i1.previousPosition,vertexBuffer:d,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:i1.currentPosition,vertexBuffer:u,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:i1.nextPosition,vertexBuffer:h,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:i1.expandAndWidth,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:2},{index:i1.a_batchId,vertexBuffer:g,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:x,indexBuffer:f}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var D2=new M,xle=new m;function $Ke(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,D2),M.multiplyByPoint(D2,e._center,xle),M.setTranslation(D2,xle,D2),D2},u_highlightColor:function(){return e._highlightColor}})}function eJe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ue.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var tJe=`uniform vec4 u_highlightColor; +void main() { - vec3 positionEC = czm_pointAlongRay(ray, intersection); - vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; - vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); - vec3 sphericalNormal = normalize(positionMC / u_radii); - vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates - vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates - - vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal); - vec3 positionToEyeEC = -positionEC; - - czm_materialInput materialInput; - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = (positionMC + u_radii) / u_radii; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef ONLY_SUN_LIGHTING - return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); -#else - return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif + out_FragColor = u_highlightColor; } +`;function nJe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(U2),o=n.getFragmentShaderCallback(!1,void 0,!1)(tJe),r=new De({defines:["VECTOR_TILE",Bt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[pd,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i1})}function iJe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ee.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}ah.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,d=0;for(r=0;r= 0.0) { - t1 = (-b - sqrt(discriminant)) * 0.5; - t2 = (-b + sqrt(discriminant)) * 0.5; - } + // Push for volume height + float offset; + vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); - if (t1 < 0.0 && t2 < 0.0) { + // offset height to create volume + offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); + offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; + position.xyz += offset * ellipsoidNormal; + + // move from RTC to EC + position = u_modifiedModelView * position; + right = czm_normal * right; + + // Push for width in a direction that is in the start or end plane and in a plane with right + // N = normalEC ("right-facing" direction for push) + // R = right + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); + scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); + vec3 miterPushNormal = czm_normal * normalize(scratchNormal); + + offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC + offset = offset / dot(miterPushNormal, right); + position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); + + gl_Position = czm_depthClamp(czm_projection * position); + + position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); + vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; + v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); + v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); + + position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); + vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; + v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); + v_halfWidth = endFaceNormalAndHalfWidth.w; +} +`;var nNn=T(S(),1),O2=`in vec4 v_startPlaneEC; +in vec4 v_endPlaneEC; +in vec4 v_rightPlaneEC; +in float v_halfWidth; +in vec3 v_volumeUpEC; + +uniform vec4 u_highlightColor; +void main() +{ + float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); + + // Discard for sky + if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME discard; +#endif // DEBUG_SHOW_VOLUME } - float t = min(t1, t2); - if (t < 0.0) { - t = 0.0; + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + eyeCoordinate /= eyeCoordinate.w; + + float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); + + // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction + halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); + + // Check distance of the eye coordinate against the right-facing plane + float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); + + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); + + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME } + out_FragColor = u_highlightColor; - // March ray forward to intersection with larger sphere and find - czm_ray ray = czm_ray(t * direction, direction); + czm_writeDepthClamp(); +} +`;function Tb(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new D(di._defaultMinTerrainHeight,di._defaultMaxTerrainHeight),this._boundingVolume=Gn.fromRectangle(e.rectangle,di._defaultMinTerrainHeight,di._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Tb.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function cJe(e,t,n){let i=di.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;Gn.fromRectangle(c,o,r,n,a)}function lJe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ne.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,ne.pack(o,a,c),c+=ne.packedLength,m.pack(r,a,c),a}var dJe=new gi("createVectorTileClampedPolylines"),Ag={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function uJe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=lJe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=dJe.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(u.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(u.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(u.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(u.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(u.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(u.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(u.vertexBatchIds);let h=u.indexDatatype;e._indices=h===Ae.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),mJe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function mJe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=c.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let h=yt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=yt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=yt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),f=yt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),x=yt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),_=yt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),C=yt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),V=yt.createIndexBuffer({context:t,typedArray:d,usage:Me.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),L=[{index:Ag.startEllipsoidNormal,vertexBuffer:h,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:Ag.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:Ag.startPositionAndHeight,vertexBuffer:g,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ag.endPositionAndHeight,vertexBuffer:f,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ag.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ag.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ag.a_batchId,vertexBuffer:C,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:L,indexBuffer:V}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var Y2=new M,_le=new m;function hJe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,Y2),M.multiplyByPoint(Y2,e._center,_le),M.setTranslation(Y2,_le,Y2),Y2},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Tle(e){return Ue.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Un.EQUAL,frontOperation:{fail:mt.KEEP,zFail:mt.KEEP,zPass:mt.KEEP},backFunction:Un.EQUAL,backOperation:{fail:mt.KEEP,zFail:mt.KEEP,zPass:mt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})}function fJe(e){l(e._rs)||(e._rs=Tle(!1),e._rs3DTiles=Tle(!0))}function pJe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(B2),o=n.getFragmentShaderCallback(!1,void 0,!0)(O2),r=new De({defines:["VECTOR_TILE",Bt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[pd,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Ag})}function bJe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Ee.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=qe.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===kn.TERRAIN||i===kn.BOTH)&&t.commandList.push(n),(i===kn.CESIUM_3D_TILE||i===kn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Tb.prototype.getPositions=function(e){return I_.getPolylinePositions(this,e)};Tb.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o{e.isDestroyed()||(e._error=t)})}Tb.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=TJe(this).then(uJe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}hJe(this,t),pJe(this,t),fJe(this);let n=e.passes;(n.render||n.pick)&&bJe(this,e)};Tb.prototype.isDestroyed=function(){return!1};Tb.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var H2=Tb;var ONn=T(S(),1);var zz=32767,SJe=new he,CJe=new m;function VJe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);wn.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let d=l(n)||l(i)||l(o),u=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(d&&u)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r0)for(i=new Uint16Array(a),r=0;r0)for(o=new Uint16Array(c),r=0;r0&&(C=vo(i,n,d),n+=d,u>0&&(V=new Uint8Array(t,n,u),V=new Uint8Array(V),n+=u));let L=y(x.POLYGONS_LENGTH,0),Z=y(x.POLYLINES_LENGTH,0),G=y(x.POINTS_LENGTH,0),I=L+Z+G,v=new Yp(e,I,C,V,LJe(e));if(e._batchTable=v,I===0)return;let P=new eh(x,_),w=P.getGlobalProperty("REGION");if(!l(w))throw new ae("Feature table global property: REGION must be defined");let F=ce.unpack(w),b=w[4],R=w[5],E=e._tile.computedTransform,X=P.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(X)?(X=m.unpack(X),M.multiplyByPoint(E,X,X)):(X=ce.center(F),X.height=W.lerp(b,R,.5),X=ne.WGS84.cartographicToCartesian(X));let A=RJe(x,_);if(n+=(4-n%4)%4,L>0){P.featuresLength=L;let N=y(P.getPropertyArray("POLYGON_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new ae("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let O=y(P.getPropertyArray("POLYGON_INDEX_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_INDEX_COUNT",Q.UNSIGNED_INT,1));if(!l(O))throw new ae("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=N.reduce(function(z,j){return z+j*2},0),Y=O.reduce(function(z,j){return z+j},0),k=new Uint32Array(t,n,Y);n+=h;let H=new Uint16Array(t,n,U);n+=p;let J,te;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(J=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Q.FLOAT,1),te=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Q.FLOAT,1)),e._polygons=new k2({positions:H,counts:N,indexCounts:O,indices:k,minimumHeight:b,maximumHeight:R,polygonMinimumHeights:J,polygonMaximumHeights:te,center:X,rectangle:F,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,batchIds:A.polygons,modelMatrix:E})}if(Z>0){P.featuresLength=Z;let N=y(P.getPropertyArray("POLYLINE_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYLINE_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new ae("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let O=P.getPropertyArray("POLYLINE_WIDTHS",Q.UNSIGNED_SHORT,1);if(!l(O)){O=new Uint16Array(Z);for(let te=0;te0){let N=new Uint16Array(t,n,G*3);n+=f,e._points=new N2({positions:N,batchIds:A.points,minimumHeight:b,maximumHeight:R,rectangle:F,batchTable:v})}}function Kz(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}lh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};lh.prototype.getFeature=function(e){return l(this._features)||Kz(this),this._features[e]};lh.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};lh.prototype.applyStyle=function(e){l(this._features)||Kz(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};lh.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||Kz(this),this._batchTable.update(e,t),this._ready=!0)};lh.prototype.pick=function(e,t,n){};lh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};lh.prototype.isDestroyed=function(){return!1};lh.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function IJe(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c=0?i[r]:void 0}var P_=PJe;var nkn=T(S(),1);var J5n=T(S(),1);function Vb(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Vb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Vb.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Vb.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Vb.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Vb.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Vb.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Vb.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Vb.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var Q2=Vb;function Qz(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Qz._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new Q2({tile:n,class:o})}}Qz._oneTimeWarning=xt;var j2=Qz;var Lkn=T(S(),1);var lkn=T(S(),1);function vJe(e){let t=new Uint8Array(e),n=Om(t);if(n==="glTF"&&(n="glb"),Ls.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=wJe(t);if(l(i.root))return{contentType:Ls.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ls.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ls.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ls.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ls.VOXEL_JSON,jsonPayload:i};throw new ae("Invalid tile content.")}function wJe(e){let t;try{t=vo(e)}catch{throw new ae("Invalid tile content.")}return t}var Rf=vJe;function Bu(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;sNJe(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function NJe(e,t,n){if(l(t))try{let i=Rf(t);if(i.contentType===Ls.EXTERNAL_TILESET)throw new ae("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ls.GEOMETRY||i.contentType===Ls.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=X_[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=W_(o,d));let u=P_(o,d);return l(u)&&(a.group=new Kx({metadata:u})),a}catch(i){Vle(e,n,i)}}function Vle(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}Bu.prototype.cancelRequests=function(){for(let e=0;ea?g=W.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,_=Math.ceil(f/t)+1,C=g/(x-1),V=f/(_-1),L=ce.northwest(e,r),Z=ce.center(e,DJe);(n!==0||i!==0)&&(Z.longitude=0;f--)Rs.computePosition(t,n,!1,g,f,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;for(f=0,g=i-2;g>0;g--)Rs.computePosition(t,n,!1,g,f,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;let _=h.length/3*2,C=Ae.createTypedArray(h.length/3,_),V=0;for(let Z=0;Z0){Yu.longitude=(t.west+t.east)*.5,Yu.latitude=d;let x=n.cartographicToCartesian(Yu,a1.origin);m.clone(c,a1.direction);let _=an.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Ple);qn.rayPlane(a1,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(x,ak)}else u=n.geodeticSurfaceNormalCartographic(ce.southeast(t),ak);let h=m.cross(u,a,Wle);m.normalize(h,e.southNormal);let p=t.north,g;if(p<0){Yu.longitude=(t.west+t.east)*.5,Yu.latitude=p;let x=n.cartographicToCartesian(Yu,a1.origin);m.negate(c,a1.direction);let _=an.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Ple);qn.rayPlane(a1,_,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,ak)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),ak);let f=m.cross(a,g,Wle);m.normalize(f,e.northNormal)}var eQe=new m,tQe=new m,nQe=new m(0,-1,0),iQe=new m(0,0,-1),vle=new m;function oQe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,g=e.eastNormal,f=e.northNormal;t.mode!==oe.SCENE3D&&(d=t.mapProjection.project(ce.southwest(e.rectangle),eQe),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(ce.northeast(e.rectangle),tQe),u.z=u.y,u.y=u.x,u.x=0,h=nQe,g=m.UNIT_Y,p=iQe,f=m.UNIT_Z);let x=m.subtract(i,d,vle),_=m.dot(x,h),C=m.dot(x,p),V=m.subtract(i,u,vle),L=m.dot(V,g),Z=m.dot(V,f);_>0?r+=_*_:L>0&&(r+=L*L),C>0?r+=C*C:Z>0&&(r+=Z*Z)}let s,a,c;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let d=s-c;r+=d*d}else if(s0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):an.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,an.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=cK(an.projectPointOntoPlane(c,t,aK),i[0],c,o),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Ule(t,p[0],p[1]),m.distance(a,t)}let u=Number.MAX_VALUE,h;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=cK(an.projectPointOntoPlane(c,t,aK),i[r],c,this._edgeNormals[n[r]]),h=m.distanceSquared(a,t),h3)return a=cK(an.projectPointOntoPlane(this._boundingPlanes[1],t,aK),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+d)%4]):m.distance(t,this._vertices[4+(n[1]-2+d)%4])};var TQe=new m,SQe=new m;function Ule(e,t,n){let i=m.subtract(n,t,TQe),o=m.subtract(e,t,SQe),r=m.dot(i,o);if(r<=0)return t;let s=m.dot(i,i);return r>=s?n:(r=r/s,new m((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var CQe=new an(m.UNIT_X,0);function cK(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c0&&(f=!0,h+=d),s1||ri(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=M.multiply(a,this.transform,new M),d=l(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(d,this.transform,new M),this.computedTransform=c,this.metadata=j2(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let u;l(s)&&l(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let h;l(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,tr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&tr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Bo.REPLACE:Bo.ADD):l(i)?p=i.refine:p=Bo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,f=!1,x,_,C;if(t=Ze.createIfNeeded(t),r)x=Yo.UNLOADED,_=t.clone();else if(l(s)){let G=s.uri;l(s.url)&&(tr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),G=s.url),G===""?(tr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new o1(e,this),f=!0,x=Yo.READY):(x=Yo.UNLOADED,_=t.getDerivedResource({url:G}),C=ec.getServerKey(_.getUrlComponent()))}else g=new o1(e,this),f=!0,x=Yo.READY;this._content=g,this._contentResource=_,this._contentState=x,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let V=n.expire,L,Z;l(V)&&(L=V.duration,l(V.date)&&(Z=q.fromIso8601(V.date))),this.expireDuration=L,this.expireDate=Z,this.lastStyleTime=0,this._optimChildrenWithinParent=Du.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=B.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new q,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}tr._deprecationWarning=us;Object.defineProperties(tr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new B),B.clone(this._color)},set:function(e){this._color=B.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Yo.READY}},contentUnloaded:{get:function(){return this._contentState===Yo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Yo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Yo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Ng=new m;function IQe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,Ng),c=m.add(s.positionWC,a,Ng),d=m.subtract(c,r,Ng);if(m.magnitude(d)>o){let Z=m.normalize(d,Ng),G=m.multiplyByScalar(Z,o,Ng),I=m.add(r,G,Ng),v=m.subtract(I,s.positionWC,Ng),P=m.normalize(v,Ng);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,P))}else e._foveatedFactor=0;let p=e.refine===Bo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Ao.PRELOAD_FLIGHT||n._pass===Ao.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*f;if(e._foveatedFactor<=x)return!1;let _=f-x,C=W.clamp((e._foveatedFactor-x)/_,0,1),V=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,C),L=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-V<=L}var Kle=new q;tr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,d=a.frustum,u=c.drawingBufferWidth,h=c.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||d instanceof rn){let g=d.offCenterFrustum;l(g)&&(d=g);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,h);p=s/f}else{let g=Math.max(this._distanceToCamera,W.EPSILON7),f=d.sseDenominator;if(p=s*h/(g*f),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,C=W.fog(g,x)*_;p-=C}}return p/=e.pixelRatio,p};function XQe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function WQe(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}tr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:hs.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==hs.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=WQe(n,this),this._priorityProgressiveResolution=XQe(n,this),this.priorityDeferred=IQe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};tr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=q.now(Kle);q.lessThan(this.expireDate,e)&&(this._contentState=Yo.EXPIRED,this._expiredContent=this._content)}};function PQe(e){if(!l(e.expireDuration))return;let t=q.now(Kle);q.addSeconds(t,e.expireDuration,t),l(e.expireDate)?q.lessThan(e.expireDate,t)&&q.clone(t,e.expireDate):e.expireDate=q.clone(t)}function vQe(e){return function(){return e._priority}}tr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?wQe(this):AQe(this)};function wQe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ri(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new q2(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Yo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Yo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Yo.FAILED,o})}async function FQe(e,t,n,i,o){let r=e._contentState;e._contentState=Yo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===jn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Yo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===jn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await MQe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Yo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Yo.FAILED,a}}function AQe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Ko({throttle:!0,throttleByServer:!0,type:ls.TILES3D,priorityFunction:vQe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return FQe(e,o,i,n,r)}async function MQe(e,t){let n=Rf(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Ls.GEOMETRY||n.contentType===Ls.VECTOR,(n.contentType===Ls.IMPLICIT_SUBTREE||n.contentType===Ls.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===Ls.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=X_[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,d=e.implicitCoordinates;o.metadata=c.getContentMetadataView(d,0)}else e.hasImplicitContent||(o.metadata=W_(i,s));let a=P_(i,s);return l(a)&&(o.group=new Kx({metadata:a})),o}tr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};tr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Yo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var Jle=new le;function uK(e,t){if(t.mode!==oe.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Jle);e._boundingVolume2D=new Gb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function NQe(e,t){if(t.mode!==oe.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Jle);e._contentBoundingVolume2D=new Gb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}tr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=uK(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Ht.INSIDE,a===Ht.OUTSIDE)return hs.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Ht.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};tr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Ht.INSIDE;if(this._visibilityPlaneMask===hs.MASK_INSIDE)return Ht.INSIDE;let t=e.cullingVolume,n=NQe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Ht.INSIDE,s===Ht.OUTSIDE)return Ht.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Ht.OUTSIDE,s===Ht.INSIDE)return Ht.OUTSIDE}return t.computeVisibility(n)};tr.prototype.distanceToTile=function(e){return uK(this,e).distanceToCamera(e)};var kQe=new m;tr.prototype.distanceToTileCenter=function(e){let n=uK(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,kQe);return m.dot(e.camera.directionWC,i)};tr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Qle=new $,jle=new m,UQe=new $,mK=new m,qle=new ce,$le=new Gn,dK=new M;function DQe(e,t,n){let i=m.fromElements(e[0],e[1],e[2],mK),o=$.fromArray(e,3,UQe);i=M.multiplyByPoint(t,i,i);let r=M.getMatrix3(t,Qle);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new Id(i,o)}function BQe(e,t,n,i){let o=ce.unpack(e,0,qle),r=e[4],s=e[5],a=Gn.fromRectangle(o,r,s,ne.WGS84,$le),c=a.center,d=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,dK),dK),c=M.multiplyByPoint(t,c,c);let u=M.getMatrix3(t,Qle);return d=$.multiply(u,d,d),l(i)&&i instanceof Id?(i.update(c,d),i):new Id(c,d)}function OQe(e,t,n,i){if(!M.equalsEpsilon(t,n,W.EPSILON8))return BQe(e,t,n,i);let o=ce.unpack(e,0,qle);return l(i)?(i.rectangle=ce.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ne.WGS84),i):new Hu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function YQe(e,t,n){let i=m.fromElements(e[0],e[1],e[2],mK),o=e[3];i=M.multiplyByPoint(t,i,i);let r=M.getScale(t,jle),s=m.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new Gb(i,o)}tr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=m_.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ae("boundingVolume must be defined");if(ri(e,"3DTILES_bounding_volume_S2"))return new nP(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=DQe(r,t,n);return this._verticalExaggeration!==1&&Yle(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=OQe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Id?Yle(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Tr.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Tr.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ne.WGS84))),c}if(l(a)){let c=YQe(a,t,n);if(this._verticalExaggeration!==1){let d=Tr.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,mK),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new ae("boundingVolume must contain a sphere, region, or box")};var HQe=m.unpackArray(new Array(8*3).fill(0));function Yle(e,t,n){let i=e.boundingVolume.computeCorners(HQe).map(r=>Tr.getPosition(r,ne.WGS84,t,n,r)),o=Gn.fromPoints(i,$le);e.update(o.center,o.halfAxes)}tr.prototype.updateTransform=function(e,t){e=y(e,M.IDENTITY);let n=M.multiplyTransformation(e,this.transform,dK),i=!M.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&M.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};tr.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,jle),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function zQe(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=B.WHITE:c=B.DARKGRAY:c=B.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=Yt.toValue(c,d.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(B.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(B.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=B.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function KQe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Yo.FAILED,o}}function JQe(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function QQe(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}tr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;JQe(this,e),QQe(this,e),zQe(this,e,t,n),KQe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;se.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};D_.prototype.trim=function(){this._trimTiles=!0};var aP=D_;var ZOn=T(S(),1);function mk(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function fK(e,t){let n;return t==="_loadTimestamp"?n=q.toDate(e).getTime():n=e,n}mk.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=fK(e,n),this._referenceMaximum[n]=fK(t,n)};function $Qe(e,t){let n=e.tilePropertyName;if(l(n)){let i=fK(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var hK=[new B(.1,.1,.1,1),new B(.153,.278,.878,1),new B(.827,.231,.49,1),new B(.827,.188,.22,1),new B(1,.592,.259,1),new B(1,.843,0,1)];mk.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=$Qe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+W.EPSILON7,c=W.clamp(i-o,0,s)/s,d=hK.length-1,u=c*d,h=Math.floor(u),p=Math.ceil(u),g=u-h,f=hK[h],x=hK[p],_=B.clone(B.WHITE);_.red=W.lerp(f.red,x.red,g),_.green=W.lerp(f.green,x.green,g),_.blue=W.lerp(f.blue,x.blue,g),e._debugColor=_};mk.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var cP=mk;var XOn=T(S(),1);function p1(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}p1.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};p1.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function bK(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}uP.encode2D=function(e,t){return(ide(e)|ide(t)<<1)>>>0};uP.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=ode(e),t[1]=ode(e>>1),t};uP.encode3D=function(e,t,n){return pK(e)|pK(t)<<1|pK(n)<<2};uP.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=bK(e),t[1]=bK(e>>1),t[2]=bK(e>>2),t};var kg=uP;function Ho(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===$r.OCTREE&&(this.z=e.z)}Object.defineProperties(Ho.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===$r.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===$r.OCTREE?kg.encode3D(this.x,this.y,this.z):kg.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===$r.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Ho.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===$r.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Ho.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===$r.OCTREE?this.z===e.z:!0)};Ho.prototype.isImplicitTilesetRoot=function(){return this.level===0};Ho.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Ho.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Ho.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===$r.OCTREE&&(e.z=this.z),e};var rde=[0,0,0];Ho.fromMortonIndex=function(e,t,n,i){let o;return e===$r.OCTREE?(o=kg.decode3D(i,rde),new Ho({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=kg.decode2D(i,rde),new Ho({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Ho.fromTileIndex=function(e,t,n){let i,o,r;return e===$r.OCTREE?(i=Math.floor(W.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(W.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Ho.fromMortonIndex(e,t,i,r)};var O_=Ho;var l3n=T(S(),1);var i3n=T(S(),1);function Wb(){}Wb.selectTiles=function(e,t){pe.throwInstantiationError()};Wb.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Wb.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Wb.selectTile=function(e,t){if(e.contentVisibility(t)===Ht.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];sde(r,t),e._visible=r._visible;return}if(o4e(e,t)){e._visible=!1;return}let i=e.refine===Bo.REPLACE,o=e._optimChildrenWithinParent===Du.USE_OPTIMIZATION;if(i&&o&&n&&!r4e(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function o4e(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Bo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function r4e(e,t){let n=!1,i=e.children;for(let o=0;o0;){mP.stackMaximumLength=Math.max(mP.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Bo.ADD,d=a.refine===Bo.REPLACE,u=a4e(a);u&&c4e(a,s,t),(c||d&&!u)&&(l4e(e,a),o(a,t),d4e(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return mP.stack.trim(mP.stackMaximumLength),n};function a4e(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function c4e(e,t,n){let{children:i}=e;for(let o=0;o0;){fP.stackMaximumLength=Math.max(fP.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?u4e(c,a,t)&&u:!1;let h=!c._refines&&u;c.hasRenderableContent?c.refine===Bo.ADD?(gK(c,t),o(c,t)):c.refine===Bo.REPLACE&&(o(c,t),h&&gK(c,t)):(n._emptyTiles.push(c),o(c,t),h&&gK(c,t)),r(c,t),s(c,t)}}function h4e(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Hs,s=!0,a=pP.stack;for(a.push(e);a.length>0;){pP.stackMaximumLength=Math.max(pP.stackMaximumLength,a.length);let c=a.pop(),d=c.children,u=d.length,h=!c.hasRenderableContent&&n(c);if(!h&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),h)for(let p=0;p0;){yP.stackMaximumLength=Math.max(yP.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;cn._depth+e.skipLevels)}function y4e(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Hs;for(let d=0;dt:e._screenSpaceError>t:!0}function _4e(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Hs,c=gP.stack;for(c.push(e);c.length>0;){gP.stackMaximumLength=Math.max(gP.stackMaximumLength,c.length);let d=c.pop();b4e(d,t);let u=d.parent,h=!l(u)||u._refines;d._refines=o(d)?y4e(d,c,t)&&h:!1;let p=!d._refines&&h;d.hasRenderableContent?d.refine===Bo.ADD?(hk(d,t),r(d,t)):d.refine===Bo.REPLACE&&(x4e(d,i)?(r(d,t),p&&hk(d,t)):p?(hk(d,t),r(d,t)):g4e(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&hk(d,t)),s(d,t),a(d,t)}}function T4e(e,t){let{selectTile:n,canTraverse:i}=Hs,{stack:o,ancestorStack:r}=Pb,s;for(o.push(e);o.length>0||r.length>0;){if(Pb.stackMaximumLength=Math.max(Pb.stackMaximumLength,o.length),Pb.ancestorStackMaximumLength=Math.max(Pb.ancestorStackMaximumLength,r.length),r.length>0){let d=r.peek();if(d._stackLength===o.length){r.pop(),d!==s&&(d._finalResolution=!1),n(d,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Bo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let d=a.children;for(let u=0;udi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=vt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=M.clone(s._initialClippingPlanesOriginMatrix),s};nr.loadJson=function(e){return Ze.createIfNeeded(e).fetchJson()};nr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};nr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new ae("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ae("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&nr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=dde(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Bo.ADD;let d=c._header.children;if(l(d))for(let u=0;u_.minimumRadius){let L=he.fromCartesian(V,_,C4e);n=m.normalize(a.positionWC,ude),i=a.directionWC,o=a.positionCartographic.height,r=0,s=L.height*2}else{let L=M.multiplyByPoint(x,a.positionWC,R4e);if(n=m.UNIT_Z,i=M.multiplyByPointAsVector(x,a.directionWC,Z4e),i=m.normalize(i,i),o=L.z,d instanceof Id){let Z=$.getColumn(C.halfAxes,2,G4e),G=m.magnitude(Z);r=V.z-G,s=V.z+G}else if(d instanceof Gb){let Z=C.radius;r=V.z-Z,s=V.z+Z}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*u,p=s,g=W.clamp((o-h)/(p-h),0,1),f=1-Math.abs(m.dot(i,n));f=f*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function I4e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{fde(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?O4e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function hde(e,t){return e._priority-t._priority}nr.prototype.postPassesUpdate=function(e){l(this._root)&&(X4e(this,e),H4e(this,e),this._cache.unloadTiles(this,bde),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};nr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;M4e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=q.clone(e.time)),this._timeSinceLoad=Math.max(q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&E4e(this,e),e.newFrame&&this._cache.reset()};function X4e(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o=1;if(r._contentState!==Yo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function W4e(e){let t=e._requestedTiles;t.sort(hde);for(let n=0;n0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function P4e(e){let t=e._processingQueue,n=0;for(let i=0;i0&&(t[i-n]=o)}t.length-=n}var v4e=new he,w4e=new he,F4e=new m;function A4e(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=he.clone(r.positionCartographic,v4e),c=he.fromCartesian(o.center,s,w4e);l(c)&&(a.height=c.height);let d=he.toCartesian(a,s,F4e);m.distance(d,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function M4e(e,t){P4e(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;cs){a=!0;break}let d=n[c];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,fde(u,e,d)}}e.totalMemoryUsageInBytes0&&N4e(e)}function N4e(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n0&&(i+=` +Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=` +Triangles: ${e.content.trianglesLength}`,o++),i+=` +Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=` +Texture Memory: ${mde(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${mde(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +Urls:`;let s=e.content.innerContentUrls;for(let a=0;a0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ti({stencil:0,pass:Ee.CESIUM_3D_TILE,renderState:Ue.fromCache({stencilMask:Ut.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:d}=e,u=n.isRender,h=i.length;for(let f=0;f=0;--_)i[h+x+_]=i[h+_];for(let _=0;_0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Cf),D4e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var pde=[];function O4e(e,t){let n=t,i=pde;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r{t.push(St.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;oi.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}nr.prototype.getTraversal=function(e){let{pass:t}=e;return t===Ao.MOST_DETAILED_PRELOAD||t===Ao.MOST_DETAILED_PICK?hP:this.isSkippingLevelOfDetail?xP:bP};nr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};nr.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Ao.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Ao.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Ao.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Ao.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),d=c.length;if(e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r),s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let u=this._clippingPolygons;l(u)&&u.enabled&&u.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=J4e(this,e,h,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};nr.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};nr.prototype.isDestroyed=function(){return!1};nr.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=pde;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a{let u=le.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),h=le.distanceSquaredTo(d.contentBoundingVolume.boundingSphere,e.origin);return u-h});let a;for(let c=0;c-1;i--)_K(this,e[i],t,n);return me(this)};Ug.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return lt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(le.clone(i.boundingSphere,t),lt.DONE):lt.FAILED:lt.PENDING};Ug.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(_K(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],_K(this,r,a,c),s.remove(r.id)};function _K(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function nje(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await bs.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var _P=Ug;var $Yn=T(S(),1);var ije=B.WHITE,oje=B.BLACK,rje=new D(2,2);function b1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new ge,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(b1.prototype,{isConstant:{get:function(){return K.isConstant(this._evenColor)&&K.isConstant(this._oddColor)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:ue("evenColor"),oddColor:ue("oddColor"),repeat:ue("repeat")});b1.prototype.getType=function(e){return"Checkerboard"};var sje=new q;b1.prototype.getValue=function(e,t){return l(e)||(e=q.now(sje)),l(t)||(t={}),t.lightColor=K.getValueOrClonedDefault(this._evenColor,e,ije,t.lightColor),t.darkColor=K.getValueOrClonedDefault(this._oddColor,e,oje,t.darkColor),t.repeat=K.getValueOrDefault(this._repeat,e,rje),t};b1.prototype.equals=function(e){return this===e||e instanceof b1&&K.equals(this._evenColor,e._evenColor)&&K.equals(this._oddColor,e._oddColor)&&K.equals(this._repeat,e._repeat)};var g1=b1;var gHn=T(S(),1);var dHn=T(S(),1);var yde={id:void 0};function TP(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function bc(e){this._owner=e,this._entities=new Rt,this._addedEntities=new Rt,this._removedEntities=new Rt,this._changedEntities=new Rt,this._suspendCount=0,this._collectionChanged=new ge,this._id=Bn(),this._show=!0,this._firing=!1,this._refire=!1}bc.prototype.suspendEvents=function(){this._suspendCount++};bc.prototype.resumeEvents=function(){this._suspendCount--,TP(this)};Object.defineProperties(bc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t-1;c--)s=a[c],_de(e,p,g,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(kr.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--){s=a[c],xde(e,p,g,s);let x=h.getById(s.id);l(x)||(x=u.getById(s.id),l(x)?TK(x):(pk.id=s.id,x=new $o(pk)),h.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=h.values;for(r=0;r=0;a--)c=i[a].getById(x),l(c)&&(l(d)||(d=r.getById(x),TK(d)),d.merge(c));l(d)||r.removeById(x),d=void 0}let g=t.length;for(s=0;s=0;a--)c=i[a].getById(x),l(c)&&(l(d)||(d=r.getById(x),l(d)?TK(d):(pk.id=x,d=new $o(pk),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};kr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),d=c[t],u=!l(d),h=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let f=g[t];if(l(f)){if(h)if(h=!1,l(f.merge)&&l(f.clone))d=f.clone(d);else{d=f;break}d.merge(f)}}}u&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=d};var SK=kr;var YHn=T(S(),1);var MHn=T(S(),1);var xHn=T(S(),1);function CK(){this._removalFunctions=[]}CK.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};CK.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Ur.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Ur.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Ur.prototype.contains=function(e){return this.indexOf(e)>=0};var VK=new Ln;Ur.prototype.indexOf=function(e){let t=this._intervals;VK.start=e,VK.stop=e;let n=Xo(t,VK,RK);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-10&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i0&&(o=q.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(q.greaterThan(e.stop,n[i-1].stop)?e=new Ln({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Ln({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=q.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Ln({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Ln({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Ln({start:e.start,stop:q.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:q.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Ln({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Ur.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Xo(t,e,RK);n<0&&(n=~n);let i=!1;for(n>0&&(q.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(q.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Ln({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Ln({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),SP[2]=Vm(d)?29:28;a>SP[c]||c>=13;)a>SP[c]&&(a-=SP[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),SP[2]=Vm(d)?29:28;return gc.millisecond=i,gc.second=o,gc.minute=r,gc.hour=s,gc.day=a,gc.month=c,gc.year=d,q.fromGregorianDate(gc,n)}var aje=new q,cje=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Sde(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(cje);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),q.toGregorianDate(q.fromIso8601(e,aje),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var CP=new xp;Ur.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=q.fromIso8601(n[0]),o=q.fromIso8601(n[1]),r=[];if(!Sde(n[2],CP))r.push(i,o);else{let s=q.clone(i);for(r.push(s);q.compare(s,o)<0;)s=LK(s,CP),q.compare(o,s)<=0&&q.clone(o,s),r.push(s)}return Ur.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ur.fromIso8601DateArray=function(e,t){return Ur.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return q.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ur.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let d=0;d=0?-a:a}var Lje=new m(-1,0,0),H_=new M,Rje=new M,EK=new $,Zje=$.IDENTITY.clone(),Gje=new m,Eje=new se,Cde=new m;function vb(e,t,n,i,o,r,s,a){let c=Gje,d=Eje;H_=vt.eastNorthUpToFixedFrame(e,o,H_),c=M.multiplyByPointAsVector(H_,Lje,c),c=m.normalize(c,c);let u=Vje(c,t,e,o);EK=$.fromRotationZ(u,EK),Cde.z=r,H_=M.multiplyTransformation(H_,M.fromRotationTranslation(EK,Cde,Rje),H_);let h=Zje;h[0]=s;for(let p=0;p0){let x=d?2:1;for(let _=0;_=0};var Wje=new m,Pje=new m;VP.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=Cje(e,r),a=i._granularity,c=i._cornerType,d=o?Xje(t,n):Vde(t,n),u=o?Vde(t,n):void 0,h=n.height/2,p=n.width/2,g=e.length,f=[],x=o?[]:void 0,_=fje,C=pje,V=bje,L=gje,Z=yje,G=xje,I=_je,v=Tje,P=Sje,w=e[0],F=e[1];L=r.geodeticSurfaceNormal(w,L),_=m.subtract(F,w,_),_=m.normalize(_,_),v=m.cross(L,_,v),v=m.normalize(v,v);let b=s[0],R=s[1];o&&(x=vb(w,v,u,x,r,b+h,1,1)),P=m.clone(w,P),w=F,C=m.negate(_,C);let E,X;for(let O=1;OIe;p--)Se=W.PI_OVER_TWO-p*xe,ee[de++]=1-fe*(1+Math.cos(Se)),ee[de++]=.5*(1+Math.sin(Se));for(p=Ie;p>0;p--)Se=W.PI_OVER_TWO-xe*p,ee[de++]=1-Te*(1+Math.cos(Se)),ee[de++]=.5*(1+Math.sin(Se));for(p=u-_;p>0;p--)ee[de++]=p*Te,ee[de++]=1;for(p=1;p0;p--)ee[de++]=(p-1)*Te,ee[de++]=1}c.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(c.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(c.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(c.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:c,indices:U}}function Hje(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,h=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Nde,f=kde,x=Tk,_=Sk,C=Yje,V=Ude,L=c;for(d=0;d-t?(o=$je,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),wK(e,o,i)};Gf.prototype.computeHorizonCullingPoint=function(e,t,n){return oue(this._ellipsoid,e,t,n)};var nue=ne.clone(ne.UNIT_SPHERE);Gf.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=iue(this._ellipsoid,n,nue);return oue(o,e,t,i)};Gf.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return rue(this._ellipsoid,e,t,n,i,o)};Gf.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=iue(this._ellipsoid,o,nue);return rue(s,e,t,n,i,r)};var e8e=[];Gf.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,e8e),o=le.fromPoints(i);if(!(m.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var t8e=new m;function iue(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,t8e);e=ne.fromCartesian3(i,n)}return e}function oue(e,t,n,i){l(i)||(i=new m);let o=cue(e,t),r=0;for(let s=0,a=n.length;s0:s>o&&s*s/m.magnitudeSquared(r)>o)}var n8e=new m,i8e=new m;function sue(e,t,n){let i=e.transformPositionToScaledSpace(t,n8e),o=m.magnitudeSquared(i),r=Math.sqrt(o),s=m.divideByScalar(i,r,i8e);o=Math.max(1,o),r=Math.max(1,r);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-c*u)}function aue(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var vK=new m;function cue(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,vK),m.normalize(vK,vK))}var Ab=Gf;var SJn=T(S(),1);function Lr(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Nt.clone(n)),l(i)&&(i=Nt.clone(i)),l(o)&&(o=wt.clone(o)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._color=B.clone(y(e.color,B.WHITE)),this._outlineColor=B.clone(y(e.outlineColor,B.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=y(e.splitDirection,vr.NONE)}var lue=Lr.SHOW_INDEX=0,mue=Lr.POSITION_INDEX=1,o8e=Lr.COLOR_INDEX=2,r8e=Lr.OUTLINE_COLOR_INDEX=3,s8e=Lr.OUTLINE_WIDTH_INDEX=4,a8e=Lr.PIXEL_SIZE_INDEX=5,c8e=Lr.SCALE_BY_DISTANCE_INDEX=6,l8e=Lr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,d8e=Lr.DISTANCE_DISPLAY_CONDITION_INDEX=8,u8e=Lr.DISABLE_DEPTH_DISTANCE_INDEX=9,m8e=Lr.SPLIT_DIRECTION_INDEX=10;Lr.NUMBER_OF_PROPERTIES=11;function Xd(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Lr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Xd(this,lue))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Xd(this,mue))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Nt.equals(t,e)||(this._scaleByDistance=Nt.clone(e,t),Xd(this,c8e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Nt.equals(t,e)||(this._translucencyByDistance=Nt.clone(e,t),Xd(this,l8e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Xd(this,a8e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),Xd(this,o8e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),Xd(this,r8e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Xd(this,s8e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){wt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=wt.clone(e,this._distanceDisplayCondition),Xd(this,d8e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Xd(this,u8e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Xd(this,lue))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Xd(this,m8e))}}});Lr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Lr.prototype._getActualPosition=function(){return this._actualPosition};Lr.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Xd(this,mue)};var due=new se;Lr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(M.multiplyByPoint(n,e,due),Ui.computeActualEllipsoidPosition(t,due))};var uue=new se;Lr._computeScreenSpacePosition=function(e,t,n,i){let o=M.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,uue),uue);return Ui.worldToWindowCoordinates(n,o,i)};Lr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new D);let i=n.modelMatrix,o=Lr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Lr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new ze),n.x=r,n.y=s,n.width=a,n.height=c,n};Lr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&B.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&B.equals(this._outlineColor,e._outlineColor)&&Nt.equals(this._scaleByDistance,e._scaleByDistance)&&Nt.equals(this._translucencyByDistance,e._translucencyByDistance)&&wt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Lr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Zs=Lr;var $Jn=T(S(),1);var VJn=T(S(),1),zg=`in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerPercent; +in float v_pixelDistance; +in vec4 v_pickColor; +in float v_splitDirection; - vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); +void main() +{ + if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; + if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); + // The distance in UV space from this fragment to the center of the point, at most 0.5. + float distanceToCenter = length(gl_PointCoord - vec2(0.5)); + // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. + float maxDistance = max(0.0, 0.5 - v_pixelDistance); + float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); + float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); - if (czm_isEmpty(intersection)) + vec4 color = mix(v_outlineColor, v_color, innerAlpha); + color.a *= wholeAlpha; + +// Fully transparent parts of the billboard are not pickable. +#if !defined(OPAQUE) && !defined(TRANSLUCENT) + if (color.a < 0.005) // matches 0/255 and 1/255 { discard; } - - // If the viewer is outside, compute outsideFaceColor, with normals facing outward. - vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); - - // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. - vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); - - out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); - out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); - -#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - t = (intersection.start != 0.0) ? intersection.start : intersection.stop; - vec3 positionEC = czm_pointAlongRay(ray, t); - vec4 positionCC = czm_projection * vec4(positionEC, 1.0); -#ifdef LOG_DEPTH - czm_writeLogDepth(1.0 + positionCC.w); #else - float z = positionCC.z / positionCC.w; - - float n = czm_depthRange.near; - float f = czm_depthRange.far; - - gl_FragDepth = (z * (f - n) + f + n) * 0.5; +// The billboard is rendered twice. The opaque pass discards translucent fragments +// and the translucent pass discards opaque fragments. +#ifdef OPAQUE + if (color.a < 0.995) // matches < 254/255 + { + discard; + } +#else + if (color.a >= 0.995) // matches 254/255 and 255/255 + { + discard; + } #endif #endif + + out_FragColor = czm_gammaCorrect(color); + czm_writeLogDepth(); } -`;var aOt=T(S(),1),jS=`in vec3 position; +`;var RJn=T(S(),1),IP=`uniform float u_maxTotalPointSize; -uniform vec3 u_radii; +in vec4 positionHighAndSize; +in vec4 positionLowAndOutline; +in vec4 compressedAttribute0; // color, outlineColor, pick color +in vec4 compressedAttribute1; // show, translucency by distance, some free space +in vec4 scaleByDistance; // near, nearScale, far, farScale +in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection -out vec3 v_positionEC; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerPercent; +out float v_pixelDistance; +out vec4 v_pickColor; +out float v_splitDirection; + +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; void main() { - // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. - // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, - // but doing it here allows us to change the radii without rewriting the vertex data, and - // allows all ellipsoids to reuse the same vertex data. - vec4 p = vec4(u_radii * position, 1.0); + // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates - gl_Position = czm_modelViewProjection * p; // position in clip coordinates + // unpack attributes + vec3 positionHigh = positionHighAndSize.xyz; + vec3 positionLow = positionLowAndOutline.xyz; + float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; + float totalSize = positionHighAndSize.w + outlineWidthBothSides; + float outlinePercent = outlineWidthBothSides / totalSize; + // Scale in response to browser-zoom. + totalSize *= czm_pixelRatio; - // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums - // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the - // ellipsoid (does not write depth) that was rendered in the farther frustum. - // - // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates - // artifacts since some fragments can be alpha blended twice. This is solved by only rendering - // the ellipsoid in the closest frustum to the viewer. - gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); + float temp = compressedAttribute1.x * SHIFT_RIGHT8; + float show = floor(temp); +#ifdef EYE_DISTANCE_TRANSLUCENCY + vec4 translucencyByDistance; + translucencyByDistance.x = compressedAttribute1.z; + translucencyByDistance.z = compressedAttribute1.w; + + translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; + + temp = compressedAttribute1.y * SHIFT_RIGHT8; + translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +#endif + + /////////////////////////////////////////////////////////////////////////// + + vec4 color; + vec4 outlineColor; + vec4 pickColor; + + // compressedAttribute0.z => pickColor.rgb + + temp = compressedAttribute0.z * SHIFT_RIGHT8; + pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor.r = floor(temp); + + // compressedAttribute0.x => color.rgb + + temp = compressedAttribute0.x * SHIFT_RIGHT8; + color.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + color.g = (temp - floor(temp)) * SHIFT_LEFT8; + color.r = floor(temp); + + // compressedAttribute0.y => outlineColor.rgb + + temp = compressedAttribute0.y * SHIFT_RIGHT8; + outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.r = floor(temp); + + // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a + + temp = compressedAttribute0.w * SHIFT_RIGHT8; + pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor = pickColor / 255.0; + + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor /= 255.0; + color.a = floor(temp); + color /= 255.0; + + /////////////////////////////////////////////////////////////////////////// + + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + + /////////////////////////////////////////////////////////////////////////// + +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + // 2D camera distance is a special case + // treat all billboards as flattened to the z=0.0 plane + lengthSq = czm_eyeHeight2D.y; + } + else + { + lengthSq = dot(positionEC.xyz, positionEC.xyz); + } +#endif + +#ifdef EYE_DISTANCE_SCALING + totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); +#endif + if (totalSize > 0.0) { + // Add padding for anti-aliasing on both sides. + totalSize += 3.0; + } + + // Clamp to max point size. + totalSize = min(totalSize, u_maxTotalPointSize); + // If size is too small, push vertex behind near plane for clipping. + // Note that context.minimumAliasedPointSize "will be at most 1.0". + if (totalSize < 1.0) + { + positionEC.xyz = vec3(0.0); + totalSize = 1.0; + } + + float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY + translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); + // push vertex behind near plane for clipping + if (translucency < 0.004) + { + positionEC.xyz = vec3(0.0); + } +#endif + +#ifdef DISTANCE_DISPLAY_CONDITION + float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; + float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; + if (lengthSq < nearSq || lengthSq > farSq) { + // push vertex behind camera to force it to be clipped + positionEC.xyz = vec3(0.0, 0.0, 1.0); + } +#endif + + gl_Position = czm_projection * positionEC; czm_vertexLogDepth(); -} -`;var lOt=T(S(),1);/** - * @license - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */var gE=`/** - * @license - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples -// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h - -// Steps used to integrate into Cesium: -// * The following defines are set: -// #define FXAA_PC 1 -// #define FXAA_WEBGL_1 1 -// #define FXAA_GREEN_AS_LUMA 1 -// #define FXAA_EARLY_EXIT 1 -// #define FXAA_GLSL_120 1 -// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. -// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace -// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. -// * There are no implicit conversions from ivec* to vec* so replace: -// #define FxaaInt2 ivec2 -// with -// #define FxaaInt2 vec2 -// * The texture2DLod function is only available in vertex shaders so replace: -// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) -// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) -// with -// #define FxaaTexTop(t, p) texture(t, p) -// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) -// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. -// * The following parameters to FxaaPixelShader are unused and can be removed: -// fxaaConsolePosPos -// fxaaConsoleRcpFrameOpt -// fxaaConsoleRcpFrameOpt2 -// fxaaConsole360RcpFrameOpt2 -// fxaaConsoleEdgeSharpness -// fxaaConsoleEdgeThreshold -// fxaaConsoleEdgeThresholdMi -// fxaaConsole360ConstDir - -// -// Choose the quality preset. -// This needs to be compiled into the shader as it effects code. -// Best option to include multiple presets is to -// in each shader define the preset, then include this file. -// -// OPTIONS -// ----------------------------------------------------------------------- -// 10 to 15 - default medium dither (10=fastest, 15=highest quality) -// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) -// 39 - no dither, very expensive -// -// NOTES -// ----------------------------------------------------------------------- -// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) -// 13 = about same speed as FXAA 3.9 and better than 12 -// 23 = closest to FXAA 3.9 visually and performance wise -// _ = the lowest digit is directly related to performance -// _ = the highest digit is directly related to style -// -//#define FXAA_QUALITY_PRESET 12 - - -#if (FXAA_QUALITY_PRESET == 10) - #define FXAA_QUALITY_PS 3 - #define FXAA_QUALITY_P0 1.5 - #define FXAA_QUALITY_P1 3.0 - #define FXAA_QUALITY_P2 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 11) - #define FXAA_QUALITY_PS 4 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 3.0 - #define FXAA_QUALITY_P3 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 12) - #define FXAA_QUALITY_PS 5 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 4.0 - #define FXAA_QUALITY_P4 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 13) - #define FXAA_QUALITY_PS 6 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 4.0 - #define FXAA_QUALITY_P5 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 14) - #define FXAA_QUALITY_PS 7 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 4.0 - #define FXAA_QUALITY_P6 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 15) - #define FXAA_QUALITY_PS 8 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 4.0 - #define FXAA_QUALITY_P7 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 20) - #define FXAA_QUALITY_PS 3 - #define FXAA_QUALITY_P0 1.5 - #define FXAA_QUALITY_P1 2.0 - #define FXAA_QUALITY_P2 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 21) - #define FXAA_QUALITY_PS 4 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 22) - #define FXAA_QUALITY_PS 5 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 23) - #define FXAA_QUALITY_PS 6 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 24) - #define FXAA_QUALITY_PS 7 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 3.0 - #define FXAA_QUALITY_P6 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 25) - #define FXAA_QUALITY_PS 8 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 4.0 - #define FXAA_QUALITY_P7 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 26) - #define FXAA_QUALITY_PS 9 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 4.0 - #define FXAA_QUALITY_P8 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 27) - #define FXAA_QUALITY_PS 10 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 4.0 - #define FXAA_QUALITY_P9 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 28) - #define FXAA_QUALITY_PS 11 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 4.0 - #define FXAA_QUALITY_P10 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 29) - #define FXAA_QUALITY_PS 12 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 2.0 - #define FXAA_QUALITY_P10 4.0 - #define FXAA_QUALITY_P11 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 39) - #define FXAA_QUALITY_PS 12 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.0 - #define FXAA_QUALITY_P2 1.0 - #define FXAA_QUALITY_P3 1.0 - #define FXAA_QUALITY_P4 1.0 - #define FXAA_QUALITY_P5 1.5 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 2.0 - #define FXAA_QUALITY_P10 4.0 - #define FXAA_QUALITY_P11 8.0 -#endif - -#define FxaaBool bool -#define FxaaFloat float -#define FxaaFloat2 vec2 -#define FxaaFloat3 vec3 -#define FxaaFloat4 vec4 -#define FxaaHalf float -#define FxaaHalf2 vec2 -#define FxaaHalf3 vec3 -#define FxaaHalf4 vec4 -#define FxaaInt2 vec2 -#define FxaaTex sampler2D - -#define FxaaSat(x) clamp(x, 0.0, 1.0) -#define FxaaTexTop(t, p) texture(t, p) -#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) - -FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } - -FxaaFloat4 FxaaPixelShader( - // - // Use noperspective interpolation here (turn off perspective interpolation). - // {xy} = center of pixel - FxaaFloat2 pos, - // - // Input color texture. - // {rgb_} = color in linear or perceptual color space - // if (FXAA_GREEN_AS_LUMA == 0) - // {___a} = luma in perceptual color space (not linear) - FxaaTex tex, - // - // Only used on FXAA Quality. - // This must be from a constant/uniform. - // {x_} = 1.0/screenWidthInPixels - // {_y} = 1.0/screenHeightInPixels - FxaaFloat2 fxaaQualityRcpFrame, - // - // Only used on FXAA Quality. - // This used to be the FXAA_QUALITY_SUBPIX define. - // It is here now to allow easier tuning. - // Choose the amount of sub-pixel aliasing removal. - // This can effect sharpness. - // 1.00 - upper limit (softer) - // 0.75 - default amount of filtering - // 0.50 - lower limit (sharper, less sub-pixel aliasing removal) - // 0.25 - almost off - // 0.00 - completely off - FxaaFloat fxaaQualitySubpix, - // - // Only used on FXAA Quality. - // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define. - // It is here now to allow easier tuning. - // The minimum amount of local contrast required to apply algorithm. - // 0.333 - too little (faster) - // 0.250 - low quality - // 0.166 - default - // 0.125 - high quality - // 0.063 - overkill (slower) - FxaaFloat fxaaQualityEdgeThreshold, - // - // Only used on FXAA Quality. - // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define. - // It is here now to allow easier tuning. - // Trims the algorithm from processing darks. - // 0.0833 - upper limit (default, the start of visible unfiltered edges) - // 0.0625 - high quality (faster) - // 0.0312 - visible limit (slower) - // Special notes when using FXAA_GREEN_AS_LUMA, - // Likely want to set this to zero. - // As colors that are mostly not-green - // will appear very dark in the green channel! - // Tune by looking at mostly non-green content, - // then start at zero and increase until aliasing is a problem. - FxaaFloat fxaaQualityEdgeThresholdMin -) { -/*--------------------------------------------------------------------------*/ - FxaaFloat2 posM; - posM.x = pos.x; - posM.y = pos.y; - FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); - #define lumaM rgbyM.y - FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); -/*--------------------------------------------------------------------------*/ - FxaaFloat maxSM = max(lumaS, lumaM); - FxaaFloat minSM = min(lumaS, lumaM); - FxaaFloat maxESM = max(lumaE, maxSM); - FxaaFloat minESM = min(lumaE, minSM); - FxaaFloat maxWN = max(lumaN, lumaW); - FxaaFloat minWN = min(lumaN, lumaW); - FxaaFloat rangeMax = max(maxWN, maxESM); - FxaaFloat rangeMin = min(minWN, minESM); - FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; - FxaaFloat range = rangeMax - rangeMin; - FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); - FxaaBool earlyExit = range < rangeMaxClamped; -/*--------------------------------------------------------------------------*/ - if(earlyExit) - return rgbyM; -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNS = lumaN + lumaS; - FxaaFloat lumaWE = lumaW + lumaE; - FxaaFloat subpixRcpRange = 1.0/range; - FxaaFloat subpixNSWE = lumaNS + lumaWE; - FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; - FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNESE = lumaNE + lumaSE; - FxaaFloat lumaNWNE = lumaNW + lumaNE; - FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; - FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNWSW = lumaNW + lumaSW; - FxaaFloat lumaSWSE = lumaSW + lumaSE; - FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); - FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); - FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; - FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; - FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; - FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; -/*--------------------------------------------------------------------------*/ - FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; - FxaaFloat lengthSign = fxaaQualityRcpFrame.x; - FxaaBool horzSpan = edgeHorz >= edgeVert; - FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; -/*--------------------------------------------------------------------------*/ - if(!horzSpan) lumaN = lumaW; - if(!horzSpan) lumaS = lumaE; - if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; - FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; -/*--------------------------------------------------------------------------*/ - FxaaFloat gradientN = lumaN - lumaM; - FxaaFloat gradientS = lumaS - lumaM; - FxaaFloat lumaNN = lumaN + lumaM; - FxaaFloat lumaSS = lumaS + lumaM; - FxaaBool pairN = abs(gradientN) >= abs(gradientS); - FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); - if(pairN) lengthSign = -lengthSign; - FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); -/*--------------------------------------------------------------------------*/ - FxaaFloat2 posB; - posB.x = posM.x; - posB.y = posM.y; - FxaaFloat2 offNP; - offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; - offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; - if(!horzSpan) posB.x += lengthSign * 0.5; - if( horzSpan) posB.y += lengthSign * 0.5; -/*--------------------------------------------------------------------------*/ - FxaaFloat2 posN; - posN.x = posB.x - offNP.x * FXAA_QUALITY_P0; - posN.y = posB.y - offNP.y * FXAA_QUALITY_P0; - FxaaFloat2 posP; - posP.x = posB.x + offNP.x * FXAA_QUALITY_P0; - posP.y = posB.y + offNP.y * FXAA_QUALITY_P0; - FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; - FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); - FxaaFloat subpixE = subpixC * subpixC; - FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); -/*--------------------------------------------------------------------------*/ - if(!pairN) lumaNN = lumaSS; - FxaaFloat gradientScaled = gradient * 1.0/4.0; - FxaaFloat lumaMM = lumaM - lumaNN * 0.5; - FxaaFloat subpixF = subpixD * subpixE; - FxaaBool lumaMLTZero = lumaMM < 0.0; -/*--------------------------------------------------------------------------*/ - lumaEndN -= lumaNN * 0.5; - lumaEndP -= lumaNN * 0.5; - FxaaBool doneN = abs(lumaEndN) >= gradientScaled; - FxaaBool doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1; - FxaaBool doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1; -/*--------------------------------------------------------------------------*/ - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 3) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 4) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 5) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 6) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 7) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 8) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 9) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 10) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 11) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 12) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ +#ifdef DISABLE_DEPTH_DISTANCE + float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; + if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) + { + disableDepthTestDistance = czm_minimumDisableDepthTestDistance; } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ + + if (disableDepthTestDistance != 0.0) + { + // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. + float zclip = gl_Position.z / gl_Position.w; + bool clipped = (zclip < -1.0 || zclip > 1.0); + if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) + { + // Position z on the near plane. + gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH + czm_vertexLogDepth(vec4(czm_currentFrustum.x)); +#endif } - #endif -/*--------------------------------------------------------------------------*/ } -/*--------------------------------------------------------------------------*/ - FxaaFloat dstN = posM.x - posN.x; - FxaaFloat dstP = posP.x - posM.x; - if(!horzSpan) dstN = posM.y - posN.y; - if(!horzSpan) dstP = posP.y - posM.y; -/*--------------------------------------------------------------------------*/ - FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; - FxaaFloat spanLength = (dstP + dstN); - FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; - FxaaFloat spanLengthRcp = 1.0/spanLength; -/*--------------------------------------------------------------------------*/ - FxaaBool directionN = dstN < dstP; - FxaaFloat dst = min(dstN, dstP); - FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; - FxaaFloat subpixG = subpixF * subpixF; - FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; - FxaaFloat subpixH = subpixG * fxaaQualitySubpix; -/*--------------------------------------------------------------------------*/ - FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; - FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); - if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; - if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; - return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); +#endif + + v_color = color; + v_color.a *= translucency * show; + v_outlineColor = outlineColor; + v_outlineColor.a *= translucency * show; + + v_innerPercent = 1.0 - outlinePercent; + v_pixelDistance = 2.0 / totalSize; + gl_PointSize = totalSize * show; + gl_Position *= show; + + v_pickColor = pickColor; + v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; } -`;var uOt=T(S(),1),yE=`uniform vec4 u_initialColor; +`;var h8e=Zs.SHOW_INDEX,MK=Zs.POSITION_INDEX,hue=Zs.COLOR_INDEX,f8e=Zs.OUTLINE_COLOR_INDEX,p8e=Zs.OUTLINE_WIDTH_INDEX,b8e=Zs.PIXEL_SIZE_INDEX,fue=Zs.SCALE_BY_DISTANCE_INDEX,pue=Zs.TRANSLUCENCY_BY_DISTANCE_INDEX,bue=Zs.DISTANCE_DISPLAY_CONDITION_INDEX,g8e=Zs.DISABLE_DEPTH_DISTANCE_INDEX,y8e=Zs.SPLIT_DIRECTION_INDEX,NK=Zs.NUMBER_OF_PROPERTIES,xc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function ju(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(NK),this._maxPixelSize=1,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Lo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ju.prototype,{length:{get:function(){return kK(this),this._pointPrimitives.length}}});function gue(e){let t=e.length;for(let n=0;n0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let u=0,h=i.splitDirection;l(h)&&(u=h),r(o,s,a,d,u)}function _8e(e,t,n,i){yue(e,t,n,i),xue(e,t,n,i),_ue(e,t,n,i),Tue(e,t,n,i),Sue(e,t,n,i)}function AK(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c0){this._vaf=x8e(c,n,this._buffersUsage),a=this._vaf.writers;for(let G=0;G0){let G=C8e;G.length=0,(r[MK]||r[p8e]||r[b8e])&&G.push(yue),(r[hue]||r[f8e])&&G.push(xue),(r[h8e]||r[pue])&&G.push(_ue),r[fue]&&G.push(Tue),(r[bue]||r[g8e]||r[y8e])&&G.push(Sue);let I=G.length;if(a=this._vaf.writers,o/n>.1){for(let v=0;vn*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=M.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,h=le.clone(this._baseVolumeWC,this._boundingVolume)):h=le.clone(this._baseVolume2D,this._boundingVolume),S8e(this,e,h);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new De({sources:[IP]}),this._shaderScaleByDistance&&f.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&f.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&f.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&f.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(x=new De({defines:["OPAQUE"],sources:[zg]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:xc}),x=new De({defines:["TRANSLUCENT"],sources:[zg]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:xc})),this._blendOption===Lo.OPAQUE&&(x=new De({sources:[zg]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:xc})),this._blendOption===Lo.TRANSLUCENT&&(x=new De({sources:[zg]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:xc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let _,C,V,L,Z=e.commandList;if(d.render||u){let G=this._colorCommands,I=this._blendOption===Lo.OPAQUE,v=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,C=_.length,G.length=C;let P=v?C*2:C;for(L=0;L>4;if(o!==UK)throw new Error(`Got v${o} data when expected v${UK}.`);let r=Cue[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=Cue.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,WP,t),this.coords=new this.ArrayType(this.data,WP+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(WP+s+a+c),this.ids=new this.IndexArrayType(this.data,WP,t),this.coords=new this.ArrayType(this.data,WP+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(UK<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return BK(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],d=[];for(;c.length;){let u=c.pop()||0,h=c.pop()||0,p=c.pop()||0;if(h-p<=a){for(let _=p;_<=h;_++){let C=s[2*_],V=s[2*_+1];C>=t&&C<=i&&V>=n&&V<=o&&d.push(r[_])}continue}let g=p+h>>1,f=s[2*g],x=s[2*g+1];f>=t&&f<=i&&x>=n&&x<=o&&d.push(r[g]),(u===0?t<=f:n<=x)&&(c.push(p),c.push(g-1),c.push(1-u)),(u===0?i>=f:o>=x)&&(c.push(g+1),c.push(h),c.push(1-u))}return d}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],d=i*i;for(;a.length;){let u=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let _=p;_<=h;_++)Vue(r[2*_],r[2*_+1],t,n)<=d&&c.push(o[_]);continue}let g=p+h>>1,f=r[2*g],x=r[2*g+1];Vue(f,x,t,n)<=d&&c.push(o[g]),(u===0?t-i<=f:n-i<=x)&&(a.push(p),a.push(g-1),a.push(1-u)),(u===0?t+i>=f:n+i>=x)&&(a.push(g+1),a.push(h),a.push(1-u))}return c}};function BK(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Lue(e,t,s,i,o,r),BK(e,t,n,i,s-1,1-r),BK(e,t,n,s+1,o,1-r)}function Lue(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+g)),x=Math.min(o,Math.floor(n+(d-u)*p/d+g));Lue(e,t,n,f,x,r)}let s=t[2*n+r],a=i,c=o;for(PP(e,t,i,n),t[2*o+r]>s&&PP(e,t,i,o);as;)c--}t[2*i+r]===s?PP(e,t,i,c):(c++,PP(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function PP(e,t,n,i){DK(e,n,i),DK(t,2*n,2*i),DK(t,2*n+1,2*i+1)}function DK(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Vue(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function fh(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new ge,this.show=y(e.show,!0)}function Rue(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var V8e=new ze;function Zue(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=vg.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=lo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Zs.getScreenSpaceBoundingBox(e,t,o)),Rue(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Eue(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=vg.getScreenSpaceBoundingBox(s,t,V8e);Rue(a,n),o=ze.union(o,a,o)}return o}function L8e(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Eue(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Gue(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function Eue(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function OK(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s0){let A=new vP(V.length,64,Uint32Array);for(let N=0;N=u)for(Gue(N.position,R,b,e),p.push(N),Z=0;Z=u){let k=m.multiplyByScalar(Y,1/R,Y);for(Gue(k,R,b,e),p.push({position:k,width:U.width,height:U.height,minimumWidth:I.width,minimumHeight:I.height}),Z=0;Z0?(a=d.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function zK(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}fh.prototype.getLabel=HK("_labelCollection",Cf,"_unusedLabelIndices","labelIndex");fh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,zK(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};fh.prototype.getBillboard=HK("_billboardCollection",Zd,"_unusedBillboardIndices","billboardIndex");fh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,zK(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};fh.prototype.getPoint=HK("_pointCollection",V1,"_unusedPointIndices","pointIndex");fh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,zK(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function YK(e){if(!l(e))return;let t=e.length;for(let n=0;n0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,I8e(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};fh.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Wd=fh;function KK(e){this._name=e,this._clock=void 0,this._changed=new ge,this._error=new ge,this._isLoading=!1,this._loading=new ge,this._entityCollection=new zs(this),this._entityCluster=new Wd}Object.defineProperties(KK.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Br.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});KK.prototype.update=function(e){return!0};var wP=KK;var G4n=T(S(),1);var YQn=T(S(),1);var GQn=T(S(),1);var Iue={};Iue.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,d=new Float64Array(c*3),u,h=0,p=0,g=o?a*3:0,f=o?(a+i)*3:i*3;for(u=0;u0){let x=Math.min(r,o);d=Math.round(o/x),c+=x}let u=Ae.createTypedArray(s,c*2),h=0,p;for(p=0;p0)for(p=0;p0){for(c=0;c=t;i--)e[i]=e[a--]}for(i=0;i=0||l(h)&&q.compare(u,h)>=0));){for(iJ[p++]=u,r=r+1,s=0;s0&&(oJ.length=g,Aue(n,d,oJ),iJ.length=p,Aue(t,c,iJ))}else{for(s=0;so)return;if(this._backwardExtrapolationType===vd.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let Z=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===vd.NONE||o!==0&&q.secondsDifference(e,Z)>o)return;if(this._forwardExtrapolationType===vd.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,d=this._yTable,u=this._interpolationAlgorithm,h=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let Z=Math.min(u.getRequiredDataPoints(this._interpolationDegree,p),i);Z!==this._numberOfPoints&&(this._numberOfPoints=Z,c.length=Z,d.length=Z*h)}let g=this._numberOfPoints-1;if(g<1)return;let f=0,x=i-1;if(x-f+1>=g+1){let Z=a-(g/2|0)-1;Zx&&(G=x,Z=G-g,Z0){n=new Array(t);for(let i=0;ic&&e!==Object}let f=typeof e.unpack=="function"&&e!==qu;if(!g&&!p){h?t[n]=new Qn(f?e.unpack(d,0):d):t[n]=Oue(e,s,i);return}let x=t[n],_,C=i.epoch;if(l(C)&&(_=q.fromIso8601(C)),g&&!p){x instanceof Fd||(t[n]=x=new Fd(e)),x.addSamplesPackedArray(d,_),Ek(i,x);return}let V;if(!g&&p){a=a.clone(),h?a.data=f?e.unpack(d,0):d:a.data=Oue(e,s,i),l(x)||(t[n]=x=h?new Ob:new yc),h&&x instanceof Ob?x.intervals.addInterval(a):x instanceof yc?(h&&(a.data=new Qn(a.data)),x.intervals.addInterval(a)):(t[n]=x=Que(x),h&&(a.data=new Qn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new yc),x instanceof yc||(t[n]=x=Que(x));let L=x.intervals;V=L.findInterval(a),(!l(V)||!(V.data instanceof Fd))&&(V=a.clone(),V.data=new Fd(e),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),Ek(i,V.data)}function cme(e,t){if(e instanceof Fd){e.removeSamples(t);return}else if(e instanceof Ob){e.intervals.removeInterval(t);return}else if(e instanceof yc){let n=e.intervals;for(let i=0;ic),!f&&!p){h?e[t]=new Dc(m.unpack(d),g):e[t]=OP(r,n.reference);return}let x=e[t],_,C=n.epoch;if(l(C)&&(_=q.fromIso8601(C)),f&&!p){(!(x instanceof ba)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new ba(g,a)),x.addSamplesPackedArray(d,_),Ek(n,x);return}let V;if(!f&&p){s=s.clone(),h?s.data=m.unpack(d):s.data=OP(r,n.reference),l(x)||(h?x=new Bb(g):x=new fa(g),e[t]=x),h&&x instanceof Bb&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof fa?(h&&(s.data=new Dc(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=jue(x),h&&(s.data=new Dc(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof fa||(e[t]=x=jue(x)):e[t]=x=new fa(g);let L=x.intervals;V=L.findInterval(s),(!l(V)||!(V.data instanceof ba)||l(g)&&V.data.referenceFrame!==g)&&(V=s.clone(),V.data=new ba(g,a),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),Ek(n,V.data)}function lme(e,t){if(e instanceof ba){e.removeSamples(t);return}else if(e instanceof Bb){e.intervals.removeInterval(t);return}else if(e instanceof fa){let n=e.intervals;for(let i=0;i. version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function o6e(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=ur(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Ax),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),_e(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Je,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(qu,s,"rotation",o.rotation,r,i,n),_e(qu,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),_e(_n,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(kn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function r6e(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=ur(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Mx),_e(Boolean,s,"show",o.show,r,i,n),_e(m,s,"radii",o.radii,r,i,n),_e(m,s,"innerRadii",o.innerRadii,r,i,n),_e(Number,s,"minimumClock",o.minimumClock,r,i,n),_e(Number,s,"maximumClock",o.maximumClock,r,i,n),_e(Number,s,"minimumCone",o.minimumCone,r,i,n),_e(Number,s,"maximumCone",o.maximumCone,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"stackPartitions",o.stackPartitions,r,i,n),_e(Number,s,"slicePartitions",o.slicePartitions,r,i,n),_e(Number,s,"subdivisions",o.subdivisions,r,i,n),_e(_n,s,"shadows",o.shadows,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function s6e(e,t,n,i){let o=t.label;if(!l(o))return;let r=ur(o.interval),s=e.label;l(s)||(e.label=s=new Am),_e(Boolean,s,"show",o.show,r,i,n),_e(String,s,"text",o.text,r,i,n),_e(String,s,"font",o.font,r,i,n),_e(Oo,s,"style",o.style,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(Boolean,s,"showBackground",o.showBackground,r,i,n),_e(B,s,"backgroundColor",o.backgroundColor,r,i,n),_e(D,s,"backgroundPadding",o.backgroundPadding,r,i,n),_e(D,s,"pixelOffset",o.pixelOffset,r,i,n),_e(m,s,"eyeOffset",o.eyeOffset,r,i,n),_e(yi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),_e(Pn,s,"verticalOrigin",o.verticalOrigin,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(B,s,"fillColor",o.fillColor,r,i,n),_e(B,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Nt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(Nt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),_e(Nt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function a6e(e,t,n,i){let o=t.model;if(!l(o))return;let r=ur(o.interval),s=e.model;l(s)||(e.model=s=new Np),_e(Boolean,s,"show",o.show,r,i,n),_e(HP.default,s,"uri",o.gltf,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),_e(Number,s,"maximumScale",o.maximumScale,r,i,n),_e(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),_e(Boolean,s,"runAnimations",o.runAnimations,r,i,n),_e(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),_e(_n,s,"shadows",o.shadows,r,i,n),_e(Je,s,"heightReference",o.heightReference,r,i,n),_e(B,s,"silhouetteColor",o.silhouetteColor,r,i,n),_e(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),_e(B,s,"color",o.color,r,i,n),_e(mc,s,"colorBlendMode",o.colorBlendMode,r,i,n),_e(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),_e(wt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,d=o.nodeTransformations;if(l(d))if(Array.isArray(d))for(a=0,c=d.length;a-1;c--)n[c](s,e,t,i)}sJ=void 0}function g6e(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Oe.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=q.secondsDifference(s,r),c=Math.round(a/120);return t=new bh,t.startTime=q.clone(r),t.stopTime=q.clone(s),t.clockRange=Or.LOOP_STOP,t.multiplier=c,t.currentTime=q.clone(r),t.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new bh,t.startTime=Oe.MINIMUM_VALUE.clone(),t.stopTime=Oe.MAXIMUM_VALUE.clone(),t.currentTime=Oe.MINIMUM_VALUE.clone(),t.clockRange=Or.LOOP_STOP,t.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=ur(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=q.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Or[n.range],Or.LOOP_STOP)),l(n.step)&&(t.clockStep=y(po[n.step],po.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function ume(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new St(s)),e._credit=s,typeof t=="string"||t instanceof Ze){t=Ze.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u1;--b){if(C=W.PI_OVER_TWO-(b-1)*_,G=B1(-C,r,f,g,c,u,d,h,p,G),I=B1(C+Math.PI,r,f,g,c,u,d,h,p,I),t){for(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,E=2*(b-1)+2,R=1;R1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;aW.PI&&(h.north=h.north>0?W.PI_OVER_TWO-W.EPSILON7:h.north,h.south=h.south<0?W.EPSILON7-W.PI_OVER_TWO:h.south,h.east=W.PI,h.west=-W.PI),h}function Xf(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ne.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Xe.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Xe.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Xf.packedLength=m.packedLength+ne.packedLength+Xe.packedLength+9;Xf.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Ime=new m,Xme=new ne,Wme=new Xe,If={center:Ime,ellipsoid:Xme,vertexFormat:Wme,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Xf.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Ime);t+=m.packedLength;let o=ne.unpack(e,t,Xme);t+=ne.packedLength;let r=Xe.unpack(e,t,Wme);t+=Xe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t++],g=e[t++]===1,f=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=d,n._height=u,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=f===-1?void 0:f,n):(If.height=u,If.extrudedHeight=p,If.granularity=h,If.stRotation=d,If.rotation=c,If.semiMajorAxis=s,If.semiMinorAxis=a,If.shadowVolume=g,If.offsetAttribute=f===-1?void 0:f,new Xf(If))};Xf.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,ne.default),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,W.RADIANS_PER_DEGREE),a=y(e.rotation,0);return Eme(n,o,r,a,s,i,t)};Xf.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=Z6e(o);else if(r=V6e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===sn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ct({attributes:r.attributes,indices:r.indices,primitiveType:we.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Xf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Xf({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};function G6e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Bl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c0){let f=Math.min(d,c);g=Math.round(c/f);let x=Math.min(g*d,c);for(p=0;p0&&(Z=!0,C+=c-1),s0&&u!==x-1&&h!==0&&h!==_-1&&(F[J]=!0),J++;p=0;let te,z;for(u=1;u=Ne&&u1||G>1))for(let R=0;R0;u-=d)Se=u*3,H=q1(H,ee,Se,p,_),ee+=6,o.st&&(z=$1(z,fe,u*2,G),fe+=4),n&&(Te+=3,J[Te++]=I[Se],J[Te++]=I[Se+1],J[Te++]=I[Se+2]),j&&(te[de++]=1,de+=1);if(E){let Ne=xe;for(Se=Ne*3,u=0;u<2;u++)H=q1(H,ee,Se,p,_),ee+=6,o.st&&(z=$1(z,fe,Ne*2,G),fe+=4),n&&(Te+=3,J[Te++]=I[Se],J[Te++]=I[Se+1],J[Te++]=I[Se+2]),j&&(te[de++]=1,de+=1)}else for(u=d-1;u>=0;u--)Se=u*3,H=q1(H,ee,Se,p,_),ee+=6,o.st&&(z=$1(z,fe,u*2,G),fe+=4),n&&(Te+=3,J[Te++]=I[Se],J[Te++]=I[Se+1],J[Te++]=I[Se+2]),j&&(te[de++]=1,de+=1);let Ie=Xqe(H,o,a);o.st&&(Ie.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:z})),n&&(Ie.attributes.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:J})),P&&(Ie.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Le=Ae.createTypedArray(k,O*6),ke,Be,it,Gt;g=H.length/3;let gt=0;for(u=0;u0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(uT.prototype._onEntityPropertyChanged,this)}uT.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Dt)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}nV.prototype.remove=function(e){Ihe(this._solidItems,e)||Ihe(this._translucentItems,e)};function Xhe(e,t,n){let i=!1,o=t.length;for(let r=0;r0)for(r=0;r=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let d=0;d0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=qo.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Dt)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};iV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new kc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};oV.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=qo.getValue(e,this.materialProperty,this.material),n=new kc({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};sV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new ln({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r0)for(h=!0,t=0;t0)for(h=!0,t=0;t-1;a--)c=s[a],d=c.id,u=this._updaterSets.get(d),u.entity===c?u.forEach(function(x){h._removeUpdater(x),h._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaterSets.get(d),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new mT(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(x){h._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Ol._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,f=g.length;for(a=0;a-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var Tv=Ol;var tli=T(S(),1);var Z$e=1,G$e="30px sans-serif",E$e=Oo.FILL,I$e=B.WHITE,X$e=B.BLACK,W$e=1,P$e=!1,v$e=new B(.165,.165,.165,.8),w$e=new D(7,5),F$e=D.ZERO,A$e=m.ZERO,M$e=Je.NONE,N$e=yi.CENTER,k$e=Pn.CENTER,U$e=new m,D$e=new B,B$e=new B,O$e=new B,Y$e=new D,H$e=new m,z$e=new D,K$e=new Nt,J$e=new Nt,Q$e=new Nt,j$e=new wt;function Fhe(e){this.entity=e,this.label=void 0,this.index=void 0}function ty(e,t){t.collectionChanged.addEventListener(ty.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Rt,this._onCollectionChanged(t,t.values,[],[])}ty.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new Fhe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Fhe(r)):(RJ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],RJ(s.get(r.id),r,a),s.remove(r.id)};function RJ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var Sv=ty;var Sli=T(S(),1);var q$e=1,$$e=!0,eet=0,tet=!0,net=!0,iet=_n.ENABLED,oet=Je.NONE,ret=B.RED,set=0,aet=B.WHITE,cet=mc.HIGHLIGHT,det=.5,uet=new D(1,1),Ahe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},met=new M,het=new M,Mhe=new B,Nhe=new Array(4),fet=new m;function ny(e,t){t.collectionChanged.addEventListener(ny.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Rt,this._onCollectionChanged(t,t.values,[],[])}async function pet(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await ih.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}ny.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o-1;i--)ZJ(this,e[i],t,n);return me(this)};var zk=new m,bet=new he;ny.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return lt.FAILED;if(n.loadFailed)return lt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return lt.PENDING;if(!i.ready||!n.modelUpdated)return lt.PENDING;let o=this._scene,r=y(o.ellipsoid,ne.default);if(i.heightReference!==Je.NONE){let a=i.modelMatrix;zk.x=a[12],zk.y=a[13],zk.z=a[14];let c=r.cartesianToCartographic(zk,bet),d=o.getHeight(c,i.heightReference);return l(d)&&(Cu(i.heightReference)?c.height=d:c.height+=d),le.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),lt.DONE}return le.clone(i.boundingSphere,t),lt.DONE};ny.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(get(r,a),s.set(r.id,r)):(ZJ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],ZJ(this,r,a,c),s.remove(r.id)};function ZJ(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function get(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var Cv=ny;var $li=T(S(),1);var Ili=T(S(),1);function iy(e){this._definitionChanged=new ge,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(iy.prototype,{isConstant:{get:function(){return K.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:ki.FIXED}}});var yet=new q;iy.prototype.getValue=function(e,t){return l(e)||(e=q.now(yet)),this.getValueInReferenceFrame(e,ki.FIXED,t)};iy.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};iy.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ne.default.scaleToGeodeticSurface(n,n):void 0};iy.prototype.equals=function(e){return this===e||e instanceof iy&&this._value===e._value};iy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var vf=iy;var xet=60,_et=1,Uhe=new Ln,GJ=new Ln,EJ=new Ln;function khe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function Tet(e,t,n,i,o,r,s,a,c){let d=a,u;u=e.getValueInReferenceFrame(t,r,c[d]),l(u)&&(c[d++]=u);let h=!l(o)||q.lessThanOrEquals(o,t)||q.greaterThanOrEquals(o,n),p=0,g=i.length,f=i[p],x=n,_=!1,C,V,L;for(;p0&&!_){let Z=i[p+1],G=q.secondsDifference(Z,f);_=G>s,_&&(C=Math.ceil(G/s),V=0,L=G/Math.max(C,2),C=Math.max(C-1,1))}if(_&&V0){let g=h.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=K.getValueOrDefault(i._resolution,e,xet);c.show=!0,c.positions=Bhe(o,r,s,e,this._referenceFrame,u,c.positions.slice()),c.material=qo.getValue(e,i._material,c.material),c.width=K.getValueOrDefault(i._width,e,_et),c.distanceDisplayCondition=K.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};Vv.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};Vv.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),me(this)};function oy(e,t){t.collectionChanged.addEventListener(oy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Rt,this._onCollectionChanged(t,t.values,[],[])}oy.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new khe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new khe(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};oy._subSample=Bhe;var Lv=oy;var hdi=T(S(),1);var Ohe=B.WHITE,Yhe=B.BLACK,Hhe=0,zhe=1,Khe=0,Jhe=vr.NONE,Qhe=new B,Eet=new m,jhe=new B,qhe=new Nt,$he=new Nt,efe=new wt;function tfe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function ry(e,t){t.collectionChanged.addEventListener(ry.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Rt,this._onCollectionChanged(t,t.values,[],[])}ry.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i0?(d.scale=1,g=g||C!==r.outlineWidth||V!==r.pixelSize||!B.equals(x,r.color)||!B.equals(_,r.outlineColor)):(d.scale=V/50,V=50,g=g||C!==r.outlineWidth||!B.equals(x,r.color)||!B.equals(_,r.outlineColor)),g){r.color=B.clone(x,r.color),r.outlineColor=B.clone(_,r.outlineColor),r.pixelSize=V,r.outlineWidth=C;let L=x.alpha,Z=x.toCssColorString(),G=_.toCssColorString(),I=JSON.stringify([Z,V,G,C]);d.setImage(I,R_(L,Z,G,C,V))}f&&d._updateClamping()}}return!0};ry.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return lt.FAILED;if(l(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return lt.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};ry.prototype.isDestroyed=function(){return!1};ry.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ry.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new tfe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new tfe(r)):(Rv(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Rv(s.get(r.id),r,a),s.remove(r.id)};function Rv(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var Zv=ry;var Yui=T(S(),1);var dui=T(S(),1);var Pdi=T(S(),1);var sfe=[];function Iet(e,t,n,i,o){let r=sfe;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,h=i.red,p=i.green,g=i.blue,f=i.alpha;if(B.equals(n,i)){for(s=0;s0?new Array(o):void 0;for(i=0;i0){let A=0,N=h[0];i=i.filter(function(O,U){let Y=!1;return o?Y=U===N||U===0&&N===1:Y=U+1===N,Y?(A++,N=h[A],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===en.GEODESIC||r===en.RHUMB){let A,N;r===en.GEODESIC?(A=W.chordLength(s,a.maximumRadius),N=Pi.numberOfPoints):(A=s,N=Pi.numberOfPointsRhumbLine);let O=Pi.extractHeights(p,a);if(l(i)){let U=1;for(c=0;c0)return le.fromPoints(t.positions,e),lt.DONE}return lt.FAILED};Ev.prototype.isDestroyed=function(){return!1};Ev.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Kk[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Kk[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),me(this)};var Iv=Ch;var Zui=T(S(),1);var Net=new B,ket=new wt,Uet=new wt;function Vh(e,t,n,i,o){let r;n instanceof Dt?r=jr:r=la,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Rt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Rt,this.material=void 0,this.updatersWithAttributes=new Rt,this.attributes=new Rt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Vh.prototype.onMaterialChanged,this),this.subscriptions=new Rt,this.showsUpdated=new Rt,this.zIndex=i,this._asynchronous=o}Vh.prototype.onMaterialChanged=function(){this.invalidated=!0};Vh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Dt&&t instanceof Dt?!0:l(t)&&t.equals(n)};Vh.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!K.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Vh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Vh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new wm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===la&&(this.material=qo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===la&&(this.material=qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};dV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c-1;a--)c=s[a],d=c.id,u=this._updaters.get(d),u.entity===c?(ufe(this,u),mfe(this,e,u)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaters.get(d),ufe(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new Iv(c,this._scene),this._updaters.set(d,u),mfe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(wf._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,g=p.length;for(a=0;a-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var Wv=wf;function Yl(e){kc.initializeTerrainHeights(),wm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new dr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Yl.defaultVisualizersCallback);let i=!1,o=new Dl,r=new Dl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let d=0,u=n.length;dnew o(e,i))]};Object.defineProperties(Yl.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Yl.prototype.isDestroyed=function(){return!1};Yl.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;tjet*d.maximumRadius?(f=bfe,m.normalize(h,f),m.negate(f,f),_=m.clone(m.UNIT_Z,XJ),x=m.cross(_,f,Jk),m.magnitude(x)>W.EPSILON7&&(m.normalize(f,f),m.normalize(x,x),_=m.cross(f,x,XJ),m.normalize(_,_),p=!0)):m.equalsEpsilon(h,v,W.EPSILON7)||(_=bfe,m.normalize(b,_),m.normalize(R,R),x=m.cross(_,R,XJ),g&&(x=m.multiplyByScalar(x,-1,x)),m.equalsEpsilon(x,m.ZERO,W.EPSILON7)||(f=m.cross(x,_,Jk),$.multiplyByVector(F,f,f),$.multiplyByVector(F,x,x),$.multiplyByVector(F,_,_),m.normalize(f,f),m.normalize(x,x),m.normalize(_,_),p=!0))}}l(e.boundingSphere)&&(h=e.boundingSphere.center);let C,V,L;i&&(C=m.clone(t.position,WJ),V=m.clone(t.direction,gfe),L=m.clone(t.up,yfe));let Z=zet,G;l(s)&&(G=s.getValue(c,Ket));let I=r.getValue(c,Jet);if(a===Pp.INERTIAL&&l(G))M.fromTranslationQuaternionRotationScale(h,G,m.ONE,Z);else if(a===Pp.VELOCITY&&l(I)){let v=vt.rotationMatrixFromPositionVelocity(h,I,d,Qet);M.fromRotationTranslation(v,h,Z)}else a===Pp.ENU||!p?vt.eastNorthUpToFixedFrame(h,d,Z):(Z[0]=f.x,Z[1]=f.y,Z[2]=f.z,Z[3]=0,Z[4]=x.x,Z[5]=x.y,Z[6]=x.z,Z[7]=0,Z[8]=_.x,Z[9]=_.y,Z[10]=_.z,Z[11]=0,Z[12]=h.x,Z[13]=h.y,Z[14]=h.z,Z[15]=0);t._setTransform(Z),i&&(m.clone(C,t.position),m.clone(V,t.direction),m.clone(L,t.up),m.cross(V,L,t.right))}if(n){let p=u===oe.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function vv(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,ne.default),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._velocityProperty=new Yb(e.position,!0),this._offset3D=new m}Object.defineProperties(vv,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});vv.defaultOffset3D=new m(-14e3,3500,3500);var Qk=new rm,$et=new m;vv.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,d=r.orientation,u=r!==this._lastEntity,h=o!==this._mode,p=n.camera,g=u||h,f=!0;if(u){let x=r.viewFrom,_=l(x);if(!_&&l(t)){Qk.pitch=-W.PI_OVER_FOUR,Qk.range=0;let C=a.getValue(e,$et);if(l(C)){let V=2-1/Math.max(1,m.magnitude(C)/i.maximumRadius);Qk.pitch*=V}p.viewBoundingSphere(t,Qk),this.boundingSphere=t,g=!1,f=!1}else(!_||!l(x.getValue(e,this._offset3D)))&&m.clone(vv._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&m.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,qet(this,p,g,f,a,c,d,s,e,i)};var wv=vv;var ufi=T(S(),1);var kmi=T(S(),1);function Av(){this._cache={}}Av.prototype.fromColor=function(e,t){return jk(void 0,void 0,e,t,this._cache)};Av.prototype.fromUrl=function(e,t,n){return jk(e,void 0,t,n,this._cache)};Av.prototype.fromMakiIconId=function(e,t,n){return jk(nn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};Av.prototype.fromText=function(e,t,n){return jk(void 0,e,t,n,this._cache)};var ett=new B;function ttt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,ett).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function xfe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width${i}${Vfe(o)}`:n+=`${i}${o}`)}return n.length>0&&(n=`${n}
`),n}function ctt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function ltt(e,t){return new km(ctt(Vfe,e,t),!0)}function eU(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Bn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let h=u.toLowerCase();if(d>1&&h==="title"){d=1,s=u;break}else d>2&&h==="name"?(d=2,s=u):d>3&&/title/i.test(u)?(d=3,s=u):d>4&&/name/i.test(u)&&(d=4,s=u)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new Qn(c):n(r,s))}return o}function OJ(e,t){let n=new Array(e.length);for(let i=0;i2?d.perPositionHeight=new Qn(!0):o.clampToGround||(d.height=0);let p=eU(t,e._entityCollection,o.describe);p.polygon=d}function Ffe(e,t,n,i,o){wfe(e,t,i,n.coordinates,o)}function Afe(e,t,n,i,o){let r=n.coordinates;for(let s=0;st&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function zo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function ay(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Ff(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var vfi=T(S());var Tfi=T(S());var yfi=T(S()),cy=/[A-Za-z]/,Js=/[\d]/;var Dd=/\s/,tU=/['"]/,Bfe=/[\x00-\x1F\x7F]/,Ofe=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,htt=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,ftt=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,ptt=Ofe+htt+ftt,Yfe=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,bfi=new RegExp("[".concat(Ofe+Yfe,"]")),YJ=ptt+Yfe,Lh=new RegExp("[".concat(YJ,"]"));var nU=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(Dd):[],o=t.split(Dd),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(Dd):[],o=t.split(Dd),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),""].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();var Cfi=T(S());function Hfe(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(V){var L={},Z=V,G=Z.match(/^([a-z]+):\/\//i);return G&&(L.scheme=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^(.*?)(?=(\?|#|\/|$))/i),G&&(L.host=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^\/(.*?)(?=(\?|#|$))/i),G&&(L.path=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^\?(.*?)(?=(#|$))/i),G&&(L.query=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^#(.*?)$/i),G&&(L.fragment=G[1]),L},s=function(V){var L="";return V.scheme&&V.host&&(L+=V.scheme+"://"),V.host&&(L+=V.host),V.path&&(L+="/"+V.path),V.query&&(L+="?"+V.query),V.fragment&&(L+="#"+V.fragment),L},a=function(V,L){var Z=L/2,G=Math.ceil(Z),I=-1*Math.floor(Z),v="";return I<0&&(v=V.substr(I)),V.substr(0,G)+n+v};if(e.length<=t)return e;var c=t-o,d=r(e);if(d.query){var u=d.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);u&&(d.query=d.query.substr(0,u[1].length),e=s(d))}if(e.length<=t||(d.host&&(d.host=d.host.replace(/^www\./,""),e=s(d)),e.length<=t))return e;var h="";if(d.host&&(h+=d.host),h.length>=c)return d.host.length==t?(d.host.substr(0,t-o)+n).substr(0,c+i):a(h,c).substr(0,c+i);var p="";if(d.path&&(p+="/"+d.path),d.query&&(p+="?"+d.query),p)if((h+p).length>=c){if((h+p).length==t)return(h+p).substr(0,t);var g=c-h.length;return(h+a(p,g)).substr(0,c+i)}else h+=p;if(d.fragment){var f="#"+d.fragment;if((h+f).length>=c){if((h+f).length==t)return(h+f).substr(0,t);var x=c-h.length;return(h+a(f,x)).substr(0,c+i)}else h+=f}if(d.scheme&&d.host){var _=d.scheme+"://";if((h+_).length0&&(C=h.substr(-1*Math.floor(c/2))),(h.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}var Lfi=T(S());function zfe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var Gfi=T(S());function Kfe(e,t,n){return Dfe(e,t,n)}var Jfe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new nU({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length=0;g--){var f=u[g];switch(f.state){case 11:v(f,p);break;case 12:P(f,p);break;case 0:V(f,p);break;case 1:L(f,p);break;case 2:Z(f,p);break;case 3:G(f,p);break;case 4:I(f,p);break;case 5:w(f,p);break;case 6:F(f,p);break;case 7:b(f,p);break;case 13:R(f,p);break;case 14:E(f,p);break;case 8:X(f,p);break;case 9:A(f,p);break;case 10:N(f,p);break;case 15:O(f,p);break;case 16:U(f,p);break;case 17:Y(f,p);break;case 18:k(f,p);break;case 19:H(f,p);break;case 20:J(f,p);break;case 21:te(f,p);break;case 22:z(f,p);break;case 23:j(f,p);break;case 24:ee(f,p);break;case 25:fe(f,p);break;case 26:Te(f,p);break;case 27:de(f,p);break;case 28:xe(f,p);break;case 29:Se(f,p);break;case 30:Ie(f,p);break;case 31:Le(f,p);break;case 32:Be(f,p);break;case 33:it(f,p);break;case 34:Gt(f,p);break;case 35:gt(f,p);break;case 36:Ne(f,p);break;case 37:ke(f,p);break;case 38:Kt(f,p);break;case 39:Lt(f,p);break;case 40:ut(f,p);break;case 41:zn(f,p);break;default:Ff(f.state)}}if(h>0&&hV(p)){var x=e.charAt(h-1);!hV(x)&&!u.some(Htt)&&u.push(aU(h,0))}}}for(var _=u.length-1;_>=0;_--)u.forEach(function(be){return cn(be)});return c;function C(be){if(be==="#")u.push(Ott(h,28));else if(be==="@")u.push(Ytt(h,30));else if(be==="/")u.push(eQ(h,11));else if(be==="+")u.push(tQ(h,37));else if(be==="(")u.push(tQ(h,32));else{if(Js.test(be)&&(u.push(tQ(h,38)),u.push(Dtt(h,13))),rpe(be)){var Ve=be.toLowerCase()==="m"?15:22;u.push(Btt(h,Ve))}hV(be)&&u.push(aU(h,0)),Lh.test(be)&&u.push(eQ(h,5))}}function V(be,Ve){Ve===":"?be.state=2:Ve==="-"?be.state=1:KJ(Ve)||zo(u,be)}function L(be,Ve){Ve==="-"||(Ve==="/"?(zo(u,be),u.push(eQ(h,11))):KJ(Ve)?be.state=0:zo(u,be))}function Z(be,Ve){Ve==="/"?be.state=3:Ve==="."?zo(u,be):$b(Ve)?(be.state=5,hV(Ve)&&u.push(aU(h,0))):zo(u,be)}function G(be,Ve){Ve==="/"?be.state=4:JJ(Ve)?(be.state=10,be.acceptStateReached=!0):cn(be)}function I(be,Ve){Ve==="/"?be.state=10:$b(Ve)?(be.state=5,be.acceptStateReached=!0):zo(u,be)}function v(be,Ve){Ve==="/"?be.state=12:zo(u,be)}function P(be,Ve){$b(Ve)?be.state=5:zo(u,be)}function w(be,Ve){Ve==="."?be.state=7:Ve==="-"?be.state=6:Ve===":"?be.state=8:oU(Ve)?be.state=10:iU(Ve)||cn(be)}function F(be,Ve){Ve==="-"||(Ve==="."?cn(be):$b(Ve)?be.state=5:cn(be))}function b(be,Ve){Ve==="."?cn(be):$b(Ve)?(be.state=5,be.acceptStateReached=!0):cn(be)}function R(be,Ve){Ve==="."?be.state=14:Ve===":"?be.state=8:Js.test(Ve)||(oU(Ve)?be.state=10:Lh.test(Ve)?zo(u,be):cn(be))}function E(be,Ve){Js.test(Ve)?(be.octetsEncountered++,be.octetsEncountered===4&&(be.acceptStateReached=!0),be.state=13):cn(be)}function X(be,Ve){Js.test(Ve)?be.state=9:cn(be)}function A(be,Ve){Js.test(Ve)||(oU(Ve)?be.state=10:cn(be))}function N(be,Ve){JJ(Ve)||cn(be)}function O(be,Ve){Ve.toLowerCase()==="a"?be.state=16:z(be,Ve)}function U(be,Ve){Ve.toLowerCase()==="i"?be.state=17:z(be,Ve)}function Y(be,Ve){Ve.toLowerCase()==="l"?be.state=18:z(be,Ve)}function k(be,Ve){Ve.toLowerCase()==="t"?be.state=19:z(be,Ve)}function H(be,Ve){Ve.toLowerCase()==="o"?be.state=20:z(be,Ve)}function J(be,Ve){Ve.toLowerCase()===":"?be.state=21:z(be,Ve)}function te(be,Ve){rU(Ve)?be.state=22:zo(u,be)}function z(be,Ve){Ve==="."?be.state=23:Ve==="@"?be.state=24:rU(Ve)?be.state=22:zo(u,be)}function j(be,Ve){Ve==="."?zo(u,be):Ve==="@"?zo(u,be):rU(Ve)?be.state=22:zo(u,be)}function ee(be,Ve){$b(Ve)?be.state=25:zo(u,be)}function fe(be,Ve){Ve==="."?be.state=27:Ve==="-"?be.state=26:iU(Ve)||cn(be)}function Te(be,Ve){Ve==="-"||Ve==="."?cn(be):iU(Ve)?be.state=25:cn(be)}function de(be,Ve){Ve==="."||Ve==="-"?cn(be):$b(Ve)?(be.state=25,be.acceptStateReached=!0):cn(be)}function xe(be,Ve){jJ(Ve)?(be.state=29,be.acceptStateReached=!0):zo(u,be)}function Se(be,Ve){jJ(Ve)||cn(be)}function Ie(be,Ve){qJ(Ve)?(be.state=31,be.acceptStateReached=!0):zo(u,be)}function Le(be,Ve){qJ(Ve)||(Lh.test(Ve)?zo(u,be):cn(be))}function ke(be,Ve){Js.test(Ve)?be.state=38:(zo(u,be),C(Ve))}function Be(be,Ve){Js.test(Ve)?be.state=33:zo(u,be),C(Ve)}function it(be,Ve){Js.test(Ve)?be.state=34:zo(u,be)}function Gt(be,Ve){Js.test(Ve)?be.state=35:zo(u,be)}function gt(be,Ve){Ve===")"?be.state=36:zo(u,be)}function Ne(be,Ve){Js.test(Ve)?be.state=38:$J(Ve)?be.state=39:zo(u,be)}function Kt(be,Ve){be.acceptStateReached=!0,sU(Ve)?be.state=40:Ve==="#"?be.state=41:Js.test(Ve)||(Ve==="("?be.state=32:$J(Ve)?be.state=39:(cn(be),hV(Ve)&&u.push(aU(h,0))))}function Lt(be,Ve){Js.test(Ve)?be.state=38:Ve==="("?be.state=32:(cn(be),C(Ve))}function ut(be,Ve){sU(Ve)||(Ve==="#"?be.state=41:Js.test(Ve)?be.state=38:cn(be))}function zn(be,Ve){sU(Ve)?be.state=40:Js.test(Ve)?zo(u,be):cn(be)}function cn(be){if(zo(u,be),!!be.acceptStateReached){var Ve=be.startIdx,bn=e.slice(be.startIdx,h);if(bn=Utt(bn),be.type==="url"){var ht=e.charAt(be.startIdx-1);if(ht==="@")return;var so=be.matchType;if(so==="scheme"){var Eo=zJ.exec(bn);if(Eo&&(Ve=Ve+Eo.index,bn=bn.slice(Eo.index)),!epe(bn))return}else if(so==="tld"){if(!tpe(bn))return}else if(so==="ipV4"){if(!npe(bn))return}else Ff(so);c.push(new ipe({tagBuilder:n,matchedText:bn,offset:Ve,urlMatchType:so,url:bn,protocolRelativeMatch:bn.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(be.type==="email")spe(bn)&&c.push(new ape({tagBuilder:n,matchedText:bn,offset:Ve,email:bn.replace(ope,"")}));else if(be.type==="hashtag")cpe(bn)&&c.push(new dpe({tagBuilder:n,matchedText:bn,offset:Ve,serviceName:s,hashtag:bn.slice(1)}));else if(be.type==="mention")upe(bn,a)&&c.push(new hpe({tagBuilder:n,matchedText:bn,offset:Ve,serviceName:a,mention:bn.slice(1)}));else if(be.type==="phone"){if(bn=bn.replace(/ +$/g,""),fpe(bn)){var ia=bn.replace(/[^0-9,;#]/g,"");c.push(new ppe({tagBuilder:n,matchedText:bn,offset:Ve,number:ia,plusSign:bn.charAt(0)==="+"}))}}else Ff(be)}}}var ktt=/[\(\{\[]/,bpe=/[\)\}\]]/,gpe={")":"(","}":"{","]":"["};function Utt(e){for(var t={"(":0,"{":0,"[":0},n=0;n=0;)if(r=e.charAt(o),bpe.test(r)){var s=gpe[r];if(t[s]<0)t[s]++,o--;else break}else if($fe.test(r))o--;else break;return e.slice(0,o+1)}function aU(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function eQ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Dtt(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Btt(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Ott(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Ytt(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function tQ(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Htt(e){return e.type==="url"&&e.matchType==="scheme"}var Bpi=T(S());function xpe(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Nf,c=0,d=e.length,u=0,h=0,p=a;c"?(p=new Nf(Qs(Qs({},p),{name:te()})),H()):!cy.test(j)&&!Js.test(j)&&j!==":"&&Y()}function C(j){j===">"?Y():cy.test(j)?u=3:Y()}function V(j){Dd.test(j)||(j==="/"?u=12:j===">"?H():j==="<"?k():j==="="||tU.test(j)||Bfe.test(j)?Y():u=5)}function L(j){Dd.test(j)?u=6:j==="/"?u=12:j==="="?u=7:j===">"?H():j==="<"?k():tU.test(j)&&Y()}function Z(j){Dd.test(j)||(j==="/"?u=12:j==="="?u=7:j===">"?H():j==="<"?k():tU.test(j)?Y():u=5)}function G(j){Dd.test(j)||(j==='"'?u=8:j==="'"?u=9:/[>=`]/.test(j)?Y():j==="<"?k():u=10)}function I(j){j==='"'&&(u=11)}function v(j){j==="'"&&(u=11)}function P(j){Dd.test(j)?u=4:j===">"?H():j==="<"&&k()}function w(j){Dd.test(j)?u=4:j==="/"?u=12:j===">"?H():j==="<"?k():(u=4,z())}function F(j){j===">"?(p=new Nf(Qs(Qs({},p),{isClosing:!0})),H()):u=4}function b(j){e.substr(c,2)==="--"?(c+=2,p=new Nf(Qs(Qs({},p),{type:"comment"})),u=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Nf(Qs(Qs({},p),{type:"doctype"})),u=20):Y()}function R(j){j==="-"?u=15:j===">"?Y():u=16}function E(j){j==="-"?u=18:j===">"?Y():u=16}function X(j){j==="-"&&(u=17)}function A(j){j==="-"?u=18:u=16}function N(j){j===">"?H():j==="!"?u=19:j==="-"||(u=16)}function O(j){j==="-"?u=17:j===">"?H():u=16}function U(j){j===">"?H():j==="<"&&k()}function Y(){u=0,p=a}function k(){u=1,p=new Nf({idx:c})}function H(){var j=e.slice(h,p.idx);j&&o(j,h),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),Y(),h=c+1}function J(){var j=e.slice(h,c);o(j,h),h=c+1}function te(){var j=p.idx+(p.isClosing?2:1);return e.slice(j,c).toLowerCase()}function z(){c--}}var Nf=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var ztt=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=Ktt(t.urls),this.email=Ud(t.email)?t.email:this.email,this.phone=Ud(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Ud(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Jtt(t.stripPrefix),this.stripTrailingSlash=Ud(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Ud(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&mpe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&lpe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Qtt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return xpe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,d=s.split(c),u=a;d.forEach(function(h,p){if(p%2===0){var g=n.parseText(h,u);r.push.apply(r,g)}u+=h.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,d){return c.getOffset()-d.getOffset()});for(var n=0;nr?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function nQ(e,t){let n=kv(e,"id");return n=l(n)?n:Bn(),t.getOrCreateEntity(n)}function iQ(e){let t=Lpe(e,"lon"),n=Lpe(e,"lat"),i=Mv(e,"ele",Ro.gpx);return m.fromDegrees(t,n,i)}function Lpe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function kv(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function ly(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r${h.text}: ${h.value}

`)}if(!l(i)||i==="")return;i=jtt.link(i),Nv.innerHTML=i;let s=Nv.querySelectorAll("a");for(n=0;n',d+=`${Nv.innerHTML}`,Nv.innerHTML="",d}function Wpe(e,t,n,i){let o=iQ(t),r=nQ(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",B.RED,lU);r.billboard=Ipe(s);let a=Hl(t,"name",Ro.gpx);r.name=a,r.label=ent(),r.label.text=a,r.description=rQ(t,r),i.clampToGround&&(r.billboard.heightReference=Je.CLAMP_TO_GROUND,r.label.heightReference=Je.CLAMP_TO_GROUND)}function tnt(e,t,n,i){let o=nQ(t,n);o.description=rQ(t,o);let r=oQ(t,"rtept",Ro.gpx),s=new Array(r.length);for(let a=0;a0?(a=a.concat(c.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let h=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",B.RED,lU);o.billboard=Ipe(h),o.position=u,i.clampToGround&&(o.billboard.heightReference=Je.CLAMP_TO_GROUND),o.availability=new Dr,o.availability.addInterval(new Ln({start:a[0],stop:a[a.length-1]}))}o.polyline=Xpe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function int(e){let t={positions:[],times:[]},n=oQ(e,"trkpt",Ro.gpx),i;for(let o=0;onew Array(t).fill(n,0,t)))}function gU(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?gU(n):n),[])}var vpe=[0,1,2,3].concat(...bU([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function mr(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,d=e.stat_desc.max_length,u,h,p,g,f,x,_=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<573;u++)h=o.heap[u],g=r[r[h*2+1]*2+1]+1,g>d&&(g=d,_++),r[h*2+1]=g,!(h>e.max_code)&&(o.bl_count[g]++,f=0,h>=c&&(f=a[h-c]),x=r[h*2],o.opt_len+=x*(g+f),s&&(o.static_len+=x*(s[h*2+1]+f)));if(_!==0){do{for(g=d-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[d]--,_-=2}while(_>0);for(g=d;g!==0;g--)for(h=o.bl_count[g];h!==0;)p=o.heap[--u],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),h--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,d,u,h;for(d=1;d<=15;d++)a[d]=c=c+s[d-1]<<1;for(u=0;u<=r;u++)h=o[u*2+1],h!==0&&(o[u*2]=n(a[h]++,h))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,d,u=-1,h;for(o.heap_len=0,o.heap_max=573,c=0;c=1;c--)o.pqdownheap(r,c);h=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),d=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=d,r[h*2]=r[c*2]+r[d*2],o.depth[h]=Math.max(o.depth[c],o.depth[d])+1,r[c*2+1]=r[d*2+1]=h,o.heap[1]=h++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}mr._length_code=[0,1,2,3,4,5,6,7].concat(...bU([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));mr.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];mr.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];mr.d_code=function(e){return e<256?vpe[e]:vpe[256+(e>>>7)]};mr.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];mr.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];mr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];mr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Ma(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var hnt=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],fnt=bU([[144,8],[112,9],[24,7],[8,8]]);Ma.static_ltree=gU(hnt.map((e,t)=>[e,fnt[t]]));var pnt=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],bnt=bU([[30,5]]);Ma.static_dtree=gU(pnt.map((e,t)=>[e,bnt[t]]));Ma.static_l_desc=new Ma(Ma.static_ltree,mr.extra_lbits,257,286,15);Ma.static_d_desc=new Ma(Ma.static_dtree,mr.extra_dbits,0,30,15);Ma.static_bl_desc=new Ma(null,mr.extra_blbits,0,19,7);var gnt=9,ynt=8;function kf(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var Fpe=0,fU=1,gT=2,Rh=[new kf(0,0,0,0,Fpe),new kf(4,4,8,4,fU),new kf(4,5,16,8,fU),new kf(4,6,32,32,fU),new kf(4,4,16,16,gT),new kf(8,16,32,32,gT),new kf(8,16,128,128,gT),new kf(8,32,128,256,gT),new kf(32,128,258,1024,gT),new kf(32,258,258,4096,gT)],dU=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],sm=0,uU=1,Bv=2,mU=3,xnt=32,sQ=42,hU=113,Ov=666,aQ=8,_nt=0,cQ=1,Tnt=2,Rr=3,pU=258,Bd=pU+Rr+1;function wpe(e,t,n,i){let o=e[t*2],r=e[n*2];return o=3&&O[mr.bl_order[Fe]*2+1]===0;Fe--);return e.opt_len+=3*(Fe+1)+5+5+4,Fe}function Ie(Fe){e.pending_buf[e.pending++]=Fe}function Le(Fe){Ie(Fe&255),Ie(Fe>>>8&255)}function ke(Fe){Ie(Fe>>8&255),Ie(Fe&255&255)}function Be(Fe,rt){let Ke,Qe=rt;ee>16-Qe?(Ke=Fe,j|=Ke<>>16-ee,ee+=Qe-16):(j|=Fe<=8&&(Ie(j&255),j>>>=8,ee-=8)}function Kt(){Be(cQ<<1,3),it(256,Ma.static_ltree),Ne(),1+z+10-ee<9&&(Be(cQ<<1,3),it(256,Ma.static_ltree),Ne()),z=7}function Lt(Fe,rt){let Ke,Qe,ft;if(e.dist_buf[J]=Fe,e.lc_buf[J]=rt&255,J++,Fe===0?A[rt*2]++:(te++,Fe--,A[(mr._length_code[rt]+256+1)*2]++,N[mr.d_code(Fe)*2]++),!(J&8191)&&b>2){for(Ke=J*8,Qe=G-C,ft=0;ft<30;ft++)Ke+=N[ft*2]*(5+mr.extra_dbits[ft]);if(Ke>>>=3,te8?Le(j):ee>0&&Ie(j&255),j=0,ee=0}function cn(Fe,rt,Ke){zn(),z=8,Ke&&(Le(rt),Le(~rt)),e.pending_buf.set(c.subarray(Fe,Fe+rt),e.pending),e.pending+=rt}function be(Fe,rt,Ke){Be((_nt<<1)+(Ke?1:0),3),cn(Fe,rt,!0)}function Ve(Fe,rt,Ke){let Qe,ft,Ot=0;b>0?(U.build_tree(e),Y.build_tree(e),Ot=Se(),Qe=e.opt_len+3+7>>>3,ft=e.static_len+3+7>>>3,ft<=Qe&&(Qe=ft)):Qe=ft=rt+5,rt+4<=Qe&&Fe!=-1?be(Fe,rt,Ke):ft==Qe?(Be((cQ<<1)+(Ke?1:0),3),ut(Ma.static_ltree,Ma.static_dtree)):(Be((Tnt<<1)+(Ke?1:0),3),gt(U.max_code+1,Y.max_code+1,Ot+1),ut(A,N)),Te(),Ke&&zn()}function bn(Fe){Ve(C>=0?C:-1,G-C,Fe),C=G,t.flush_pending()}function ht(){let Fe,rt,Ke,Qe;do{if(Qe=d-v-G,Qe===0&&G===0&&v===0)Qe=r;else if(Qe==-1)Qe--;else if(G>=r+r-Bd){c.set(c.subarray(r,r+r),0),I-=r,G-=r,C-=r,Fe=g,Ke=Fe;do rt=h[--Ke]&65535,h[Ke]=rt>=r?rt-r:0;while(--Fe!==0);Fe=r,Ke=Fe;do rt=u[--Ke]&65535,u[Ke]=rt>=r?rt-r:0;while(--Fe!==0);Qe+=r}if(t.avail_in===0)return;Fe=t.read_buf(c,G+v,Qe),v+=Fe,v>=Rr&&(p=c[G]&255,p=(p<<_^c[G+1]&255)&x)}while(vi-5&&(rt=i-5);;){if(v<=1){if(ht(),v===0&&Fe==0)return sm;if(v===0)break}if(G+=v,v=0,Ke=C+rt,(G===0||G>=Ke)&&(v=G-Ke,G=Ke,bn(!1),t.avail_out===0)||G-C>=r-Bd&&(bn(!1),t.avail_out===0))return sm}return bn(Fe==4),t.avail_out===0?Fe==4?Bv:sm:Fe==4?mU:uU}function Eo(Fe){let rt=w,Ke=G,Qe,ft,Ot=P,Cn=G>r-Bd?G-(r-Bd):0,Io=X,So=a,za=G+pU,Ka=c[Ke+Ot-1],Ci=c[Ke+Ot];P>=E&&(rt>>=2),Io>v&&(Io=v);do if(Qe=Fe,!(c[Qe+Ot]!=Ci||c[Qe+Ot-1]!=Ka||c[Qe]!=c[Ke]||c[++Qe]!=c[Ke+1])){Ke+=2,Qe++;do;while(c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&KeOt){if(I=Fe,Ot=ft,ft>=Io)break;Ka=c[Ke+Ot-1],Ci=c[Ke+Ot]}}while((Fe=u[Fe&So]&65535)>Cn&&--rt!==0);return Ot<=v?Ot:v}function ia(Fe){let rt=0,Ke;for(;;){if(v=Rr&&(p=(p<<_^c[G+(Rr-1)]&255)&x,rt=h[p]&65535,u[G&a]=h[p],h[p]=G),rt!==0&&(G-rt&65535)<=r-Bd&&R!=2&&(V=Eo(rt)),V>=Rr)if(Ke=Lt(G-I,V-Rr),v-=V,V<=F&&v>=Rr){V--;do G++,p=(p<<_^c[G+(Rr-1)]&255)&x,rt=h[p]&65535,u[G&a]=h[p],h[p]=G;while(--V!==0);G++}else G+=V,V=0,p=c[G]&255,p=(p<<_^c[G+1]&255)&x;else Ke=Lt(0,c[G]&255),v--,G++;if(Ke&&(bn(!1),t.avail_out===0))return sm}return bn(Fe==4),t.avail_out===0?Fe==4?Bv:sm:Fe==4?mU:uU}function Gr(Fe){let rt=0,Ke,Qe;for(;;){if(v=Rr&&(p=(p<<_^c[G+(Rr-1)]&255)&x,rt=h[p]&65535,u[G&a]=h[p],h[p]=G),P=V,L=I,V=Rr-1,rt!==0&&P4096)&&(V=Rr-1)),P>=Rr&&V<=P){Qe=G+v-Rr,Ke=Lt(G-1-L,P-Rr),v-=P-1,P-=2;do++G<=Qe&&(p=(p<<_^c[G+(Rr-1)]&255)&x,rt=h[p]&65535,u[G&a]=h[p],h[p]=G);while(--P!==0);if(Z=0,V=Rr-1,G++,Ke&&(bn(!1),t.avail_out===0))return sm}else if(Z!==0){if(Ke=Lt(0,c[G-1]&255),Ke&&bn(!1),G++,v--,t.avail_out===0)return sm}else Z=1,G++,v--}return Z!==0&&(Ke=Lt(0,c[G-1]&255),Z=0),bn(Fe==4),t.avail_out===0?Fe==4?Bv:sm:Fe==4?mU:uU}function _s(Fe){return Fe.total_in=Fe.total_out=0,Fe.msg=null,e.pending=0,e.pending_out=0,n=hU,o=0,de(),fe(),0}e.deflateInit=function(Fe,rt,Ke,Qe,ft,Ot){return Qe||(Qe=aQ),ft||(ft=ynt),Ot||(Ot=0),Fe.msg=null,rt==-1&&(rt=6),ft<1||ft>gnt||Qe!=aQ||Ke<9||Ke>15||rt<0||rt>9||Ot<0||Ot>2?-2:(Fe.dstate=e,s=Ke,r=1<9||Ke<0||Ke>2?-2:(Rh[b].func!=Rh[rt].func&&Fe.total_in!==0&&(Qe=Fe.deflate(1)),b!=rt&&(b=rt,F=Rh[b].max_lazy,E=Rh[b].good_length,X=Rh[b].nice_length,w=Rh[b].max_chain),R=Ke,Qe)},e.deflateSetDictionary=function(Fe,rt,Ke){let Qe=Ke,ft,Ot=0;if(!rt||n!=sQ)return-2;if(Qer-Bd&&(Qe=r-Bd,Ot=Ke-Qe),c.set(rt.subarray(Ot,Ot+Qe),0),G=Qe,C=Qe,p=c[0]&255,p=(p<<_^c[1]&255)&x,ft=0;ft<=Qe-Rr;ft++)p=(p<<_^c[ft+(Rr-1)]&255)&x,u[ft&a]=h[p],h[p]=ft;return 0},e.deflate=function(Fe,rt){let Ke,Qe,ft,Ot,Cn;if(rt>4||rt<0)return-2;if(!Fe.next_out||!Fe.next_in&&Fe.avail_in!==0||n==Ov&&rt!=4)return Fe.msg=dU[4],-2;if(Fe.avail_out===0)return Fe.msg=dU[7],-5;if(t=Fe,Ot=o,o=rt,n==sQ&&(Qe=aQ+(s-8<<4)<<8,ft=(b-1&255)>>1,ft>3&&(ft=3),Qe|=ft<<6,G!==0&&(Qe|=xnt),Qe+=31-Qe%31,n=hU,ke(Qe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&rt<=Ot&&rt!=4)return t.msg=dU[7],-5;if(n==Ov&&t.avail_in!==0)return Fe.msg=dU[7],-5;if(t.avail_in!==0||v!==0||rt!=0&&n!=Ov){switch(Cn=-1,Rh[b].func){case Fpe:Cn=so(rt);break;case fU:Cn=ia(rt);break;case gT:Cn=Gr(rt);break;default:}if((Cn==Bv||Cn==mU)&&(n=Ov),Cn==sm||Cn==Bv)return t.avail_out===0&&(o=-1),0;if(Cn==uU){if(rt==1)Kt();else if(be(0,0,!1),rt==3)for(Ke=0;Ken&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function Mpe(e){let t=this,n=new Ape,i=Cnt(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let d,u,h=0,p=0,g=0,f=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,d=n.deflate(o),d!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?f.push(new Uint8Array(r)):f.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=h&&(c(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return f.length>1?(u=new Uint8Array(g),f.forEach(function(x){u.set(x,p),p+=x.length})):u=f[0]?new Uint8Array(f[0]):new Uint8Array,u}},t.flush=function(){let a,c,d=0,u=0,h=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&h.push(r.slice(0,n.next_out_index)),u+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(u),h.forEach(function(p){c.set(p,d),d+=p.length}),c}}function Cnt(e){return e+5*(Math.floor(e/16383)+1)}var a0i=T(S(),1);var Od=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],obe=1440,Vnt=0,Lnt=4,Rnt=9,Znt=5,Gnt=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Ent=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Int=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Xnt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],Wnt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Pnt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],dy=15;function mQ(){let e=this,t,n,i,o,r,s;function a(d,u,h,p,g,f,x,_,C,V,L){let Z,G,I,v,P,w,F,b,R,E,X,A,N,O,U;E=0,P=h;do i[d[u+E]]++,E++,P--;while(P!==0);if(i[0]==h)return x[0]=-1,_[0]=0,0;for(b=_[0],w=1;w<=dy&&i[w]===0;w++);for(F=w,bP&&(b=P),_[0]=b,O=1<A+b;){if(v++,A+=b,U=I-A,U=U>b?b:U,(G=1<<(w=F-A))>Z+1&&(G-=Z+1,N=F,wobe)return-3;r[v]=X=V[0],V[0]+=U,v!==0?(s[v]=P,o[0]=w,o[1]=b,w=P>>>A-b,o[2]=X-r[v-1]-w,C.set(o,(r[v-1]+w)*3)):x[0]=X}for(o[1]=F-A,E>=h?o[0]=192:L[E]>>A;w>>=1)P^=w;for(P^=w,R=(1<257?(V==-3?C.msg="oversubscribed distance tree":V==-5?(C.msg="incomplete distance tree",V=-3):V!=-4&&(C.msg="empty distance tree with lengths",V=-3),V):0)}}mQ.inflate_trees_fixed=function(e,t,n,i){return e[0]=Rnt,t[0]=Znt,n[0]=Gnt,i[0]=Ent,0};var yU=0,Npe=1,kpe=2,Upe=3,Dpe=4,Bpe=5,Ope=6,lQ=7,Ype=8,xU=9;function vnt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,d=0,u=0,h,p=0,g,f=0;function x(_,C,V,L,Z,G,I,v){let P,w,F,b,R,E,X,A,N,O,U,Y,k,H,J,te;X=v.next_in_index,A=v.avail_in,R=I.bitb,E=I.bitk,N=I.write,O=N>=w[te+1],E-=w[te+1],I.win[N++]=w[te+2],O--;continue}do{if(R>>=w[te+1],E-=w[te+1],b&16){for(b&=15,k=w[te+2]+(R&Od[b]),R>>=b,E-=b;E<15;)A--,R|=(v.read_byte(X++)&255)<>=w[te+1],E-=w[te+1],b&16){for(b&=15;E>=b,E-=b,O-=k,N>=H)J=N-H,N-J>0&&2>N-J?(I.win[N++]=I.win[J++],I.win[N++]=I.win[J++],k-=2):(I.win.set(I.win.subarray(J,J+2),N),N+=2,J+=2,k-=2);else{J=N-H;do J+=I.end;while(J<0);if(b=I.end-J,k>b){if(k-=b,N-J>0&&b>N-J)do I.win[N++]=I.win[J++];while(--b!==0);else I.win.set(I.win.subarray(J,J+b),N),N+=b,J+=b,b=0;J=0}}if(N-J>0&&k>N-J)do I.win[N++]=I.win[J++];while(--k!==0);else I.win.set(I.win.subarray(J,J+k),N),N+=k,J+=k,k=0;break}else if(!(b&64))P+=w[te+2],P+=R&Od[b],te=(F+P)*3,b=w[te];else return v.msg="invalid distance code",k=v.avail_in-A,k=E>>3>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,-3;while(!0);break}if(b&64)return b&32?(k=v.avail_in-A,k=E>>3>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,1):(v.msg="invalid literal/length code",k=v.avail_in-A,k=E>>3>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,-3);if(P+=w[te+2],P+=R&Od[b],te=(F+P)*3,(b=w[te])===0){R>>=w[te+1],E-=w[te+1],I.win[N++]=w[te+2],O--;break}}while(!0)}while(O>=258&&A>=10);return k=v.avail_in-A,k=E>>3>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,0}e.init=function(_,C,V,L,Z,G){t=yU,d=_,u=C,h=V,p=L,g=Z,f=G,i=null},e.proc=function(_,C,V){let L,Z,G,I=0,v=0,P=0,w,F,b,R;for(P=C.next_in_index,w=C.avail_in,I=_.bitb,v=_.bitk,F=_.write,b=F<_.read?_.read-F-1:_.end-F;;)switch(t){case yU:if(b>=258&&w>=10&&(_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,V=x(d,u,h,p,g,f,_,C),P=C.next_in_index,w=C.avail_in,I=_.bitb,v=_.bitk,F=_.write,b=F<_.read?_.read-F-1:_.end-F,V!=0)){t=V==1?lQ:xU;break}r=d,i=h,o=p,t=Npe;case Npe:for(L=r;v>>=i[Z+1],v-=i[Z+1],G=i[Z],G===0){s=i[Z+2],t=Ope;break}if(G&16){a=G&15,n=i[Z+2],t=kpe;break}if(!(G&64)){r=G,o=Z/3+i[Z+2];break}if(G&32){t=lQ;break}return t=xU,C.msg="invalid literal/length code",V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);case kpe:for(L=a;v>=L,v-=L,r=u,i=g,o=f,t=Upe;case Upe:for(L=r;v>=i[Z+1],v-=i[Z+1],G=i[Z],G&16){a=G&15,c=i[Z+2],t=Dpe;break}if(!(G&64)){r=G,o=Z/3+i[Z+2];break}return t=xU,C.msg="invalid distance code",V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);case Dpe:for(L=a;v>=L,v-=L,t=Bpe;case Bpe:for(R=F-c;R<0;)R+=_.end;for(;n!==0;){if(b===0&&(F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0&&(_.write=F,V=_.inflate_flush(C,V),F=_.write,b=F<_.read?_.read-F-1:_.end-F,F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0)))return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);_.win[F++]=_.win[R++],b--,R==_.end&&(R=0),n--}t=yU;break;case Ope:if(b===0&&(F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0&&(_.write=F,V=_.inflate_flush(C,V),F=_.write,b=F<_.read?_.read-F-1:_.end-F,F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0)))return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);V=0,_.win[F++]=s,b--,t=yU;break;case lQ:if(v>7&&(v-=8,w++,P--),_.write=F,V=_.inflate_flush(C,V),F=_.write,b=F<_.read?_.read-F-1:_.end-F,_.read!=_.write)return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);t=Ype;case Ype:return V=1,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);case xU:return V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);default:return V=-2,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V)}},e.free=function(){}}var Hpe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],pV=0,dQ=1,zpe=2,Kpe=3,Jpe=4,Qpe=5,_U=6,TU=7,jpe=8,yT=9;function wnt(e,t){let n=this,i=pV,o=0,r=0,s=0,a,c=[0],d=[0],u=new vnt,h=0,p=new Int32Array(obe*3),g=0,f=new mQ;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,_){_&&(_[0]=g),i==_U&&u.free(x),i=pV,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,_){let C,V,L;return V=x.next_out_index,L=n.read,C=(L<=n.write?n.write:n.end)-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C,L==n.end&&(L=0,n.write==n.end&&(n.write=0),C=n.write-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C),x.next_out_index=V,n.read=L,_},n.proc=function(x,_){let C,V,L,Z,G,I,v,P;for(Z=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,I=n.write,v=I>>1){case 0:V>>>=3,L-=3,C=L&7,V>>>=C,L-=C,i=dQ;break;case 1:w=[],F=[],b=[[]],R=[[]],mQ.inflate_trees_fixed(w,F,b,R),u.init(w[0],F[0],b[0],0,R[0],0),V>>>=3,L-=3,i=_U;break;case 2:V>>>=3,L-=3,i=Kpe;break;case 3:return V>>>=3,L-=3,i=yT,x.msg="invalid block type",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_)}break;case dQ:for(;L<32;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<>>16&65535)!=(V&65535))return i=yT,x.msg="invalid stored block lengths",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);o=V&65535,V=L=0,i=o!==0?zpe:h!==0?TU:pV;break;case zpe:if(G===0||v===0&&(I==n.end&&n.read!==0&&(I=0,v=IG&&(C=G),C>v&&(C=v),n.win.set(x.read_buf(Z,C),I),Z+=C,G-=C,I+=C,v-=C,(o-=C)!==0)break;i=h!==0?TU:pV;break;case Kpe:for(;L<14;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<29||(C>>5&31)>29)return i=yT,x.msg="too many length or distance symbols",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);if(C=258+(C&31)+(C>>5&31),!a||a.length>>=14,L-=14,s=0,i=Jpe;case Jpe:for(;s<4+(r>>>10);){for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<>>=3,L-=3}for(;s<19;)a[Hpe[s++]]=0;if(c[0]=7,C=f.inflate_trees_bits(a,c,d,p,x),C!=0)return _=C,_==-3&&(a=null,i=yT),n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);s=0,i=Qpe;case Qpe:for(;C=r,!(s>=258+(C&31)+(C>>5&31));){let O,U;for(C=c[0];L>>=C,L-=C,a[s++]=U;else{for(P=U==18?7:U-14,O=U==18?11:3;L>>=C,L-=C,O+=V&Od[P],V>>>=P,L-=P,P=s,C=r,P+O>258+(C&31)+(C>>5&31)||U==16&&P<1)return a=null,i=yT,x.msg="invalid bit length repeat",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);U=U==16?a[P-1]:0;do a[P++]=U;while(--O!==0);s=P}}if(d[0]=-1,E=[],X=[],A=[],N=[],E[0]=9,X[0]=6,C=r,C=f.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,E,X,A,N,p,x),C!=0)return C==-3&&(a=null,i=yT),_=C,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);u.init(E[0],X[0],p,A[0],p,N[0]),i=_U;case _U:if(n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,(_=u.proc(n,x,_))!=1)return n.inflate_flush(x,_);if(_=0,u.free(x),Z=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,I=n.write,v=I15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new wnt(n,1<>4)+8>s.wbits){s.mode=uy,n.msg="invalid win size",s.marker=5;break}s.mode=qpe;case qpe:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=uy,n.msg="incorrect header check",s.marker=5;break}if(!(r&Fnt)){s.mode=Yv;break}s.mode=$pe;case $pe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=ebe;case ebe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=tbe;case tbe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=nbe;case nbe:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=uQ,2);case uQ:return s.mode=uy,n.msg="need dictionary",s.marker=0,-2;case Yv:if(o=s.blocks.proc(n,o),o==-3){s.mode=uy,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=ibe;case ibe:return n.avail_in=0,1;case uy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=uQ)return-2;let a=n.istate;return s>=1<0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return d.length>1?(h=new Uint8Array(f),d.forEach(function(x){h.set(x,g),g+=x.length})):h=d[0]?new Uint8Array(d[0]):new Uint8Array,h}},t.flush=function(){n.inflateEnd()}}var b0i=T(S(),1);var l0i=T(S(),1);var bV="/",hQ=new Date(2107,11,31),fQ=new Date(1980,0,1),Zi=void 0,Yd="undefined",e0="function";var u0i=T(S(),1);var Hv=class{constructor(t){return class extends TransformStream{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var Unt=64,abe=2;try{typeof navigator!=Yd&&navigator.hardwareConcurrency&&(abe=navigator.hardwareConcurrency)}catch{}var Dnt={chunkSize:512*1024,maxWorkers:abe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Zi,CompressionStreamNative:typeof CompressionStream!=Yd&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Yd&&DecompressionStream},hy=Object.assign({},Dnt);function zv(){return hy}function SU(e){return Math.max(e.chunkSize,Unt)}function gV(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:d,DecompressionStream:u,workerScripts:h}=e;if(my("baseURL",t),my("chunkSize",n),my("maxWorkers",i),my("terminateWorkerTimeout",o),my("useCompressionStream",r),my("useWebWorkers",s),a&&(hy.CompressionStream=new Hv(a)),c&&(hy.DecompressionStream=new Hv(c)),my("CompressionStream",d),my("DecompressionStream",u),h!==Zi){let{deflate:p,inflate:g}=h;if((p||g)&&(hy.workerScripts||(hy.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");hy.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");hy.workerScripts.inflate=g}}}function my(e,t){t!==Zi&&(hy[e]=t)}var y0i=T(S(),1);var dgi=T(S(),1);var tgi=T(S(),1);var q0i=T(S(),1);var C0i=T(S(),1);var _0i=T(S(),1),cbe=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;cbe[e]=t}var t0=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i>>8^cbe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var Kv=class extends TransformStream{constructor(){let t,n=new t0;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};var D0i=T(S(),1);var R0i=T(S(),1);function yV(e){if(typeof TextEncoder==Yd){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n0&&t&&(e[n-1]=al.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=al.getPartial(o);return i.push(al.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},Jv={bytes:{fromBits(e){let n=al.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=al.concat(t,[al.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let d=0;d<16;d++)i[d]=e[d];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=t._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));let u=t._S(5,o)+t._f(d,r,s,a)+c+i[d]+t._key[Math.floor(d/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var pQ={};pQ.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let d=s[r-1];(r%o===0||o===8&&r%o===4)&&(d=n[d>>>24]<<24^n[d>>16&255]<<16^n[d>>8&255]<<8^n[d&255],r%o===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^d}for(let d=0;r;d++,r--){let u=s[d&3?r:r-4];r<=4||d<4?a[d]=u:a[d]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,d;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[u]=h,i[h]=u,d=o[c=o[a=o[u]]];let p=d*16843009^c*65537^a*257^u*16843008,g=o[h]*257^h*16843008;for(let f=0;f<4;f++)e[f][u]=g=g<<24^g>>>8,t[f][h]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],d=r[3],u=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],f=e[t?1:3]^n[3],x=4,_,C,V;for(let L=0;L>>24]^a[p>>16&255]^c[g>>8&255]^d[f&255]^n[x],C=s[p>>>24]^a[g>>16&255]^c[f>>8&255]^d[h&255]^n[x+1],V=s[g>>>24]^a[f>>16&255]^c[h>>8&255]^d[p&255]^n[x+2],f=s[f>>>24]^a[h>>16&255]^c[p>>8&255]^d[g&255]^n[x+3],x+=4,h=_,p=C,g=V;for(let L=0;L<4;L++)o[t?3&-L:L]=u[h>>>24]<<24^u[p>>16&255]<<16^u[g>>8&255]<<8^u[f&255]^n[x++],_=h,h=p,p=g,g=f,f=_;return o}};var dbe={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=al.bitLength(t);for(let r=0;r>5)+1<<2,r,s,a,c,d,u=new ArrayBuffer(o),h=new DataView(u),p=0,g=al;for(t=Jv.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(g.concat(t,[d])),a=1;ao&&(e=new n().update(e).finalize());for(let r=0;rthis.resolveReady=s),password:gbe(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:h,ready:p}=c;d?(await $nt(c,u,d,am(s,0,jv[u]+2)),s=am(s,jv[u]+2),r?a.error(new Error(n0)):h()):await p;let g=new Uint8Array(s.length-by-(s.length-by)%xV);a.enqueue(pbe(c,s,g,0,by,!0))},async flush(s){let{signed:a,ctr:c,hmac:d,pending:u,ready:h}=this;if(d&&c){await h;let p=am(u,0,u.length-by),g=am(u,u.length-by),f=new Uint8Array;if(p.length){let x=$v(Uf,p);d.update(x);let _=c.update(x);f=qv(Uf,_)}if(a){let x=am(qv(Uf,d.digest()),0,by);for(let _=0;_this.resolveReady=r),password:gbe(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:d,resolveReady:u,ready:h}=a,p=new Uint8Array;c?(p=await eit(a,d,c),u()):await h;let g=new Uint8Array(p.length+r.length-r.length%xV);g.set(p,0),s.enqueue(pbe(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:d}=this;if(a&&s){await d;let u=new Uint8Array;if(c.length){let h=s.update($v(Uf,c));a.update(h),u=qv(Uf,h)}o.signature=qv(Uf,a.digest()).slice(0,by),r.enqueue(yQ(u,o.signature))}}}),o=this}};function pbe(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,d=t.length-o;c.length&&(t=yQ(c,t),n=iit(n,d-d%xV));let u;for(u=0;u<=d-xV;u+=xV){let h=$v(Uf,am(t,u,u+xV));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(qv(Uf,p),u+i)}return e.pending=am(t,u),n}async function $nt(e,t,n,i){let o=await bbe(e,t,n,am(i,0,jv[t])),r=am(i,jv[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(py)}async function eit(e,t,n){let i=CU(new Uint8Array(jv[t])),o=await bbe(e,t,n,i);return yQ(i,o)}async function bbe(e,t,n,i){e.password=null;let o=await tit(Ont,n,znt,!1,Knt),r=await nit(Object.assign({salt:i},gQ),o,8*(Qv[t]*2+2)),s=new Uint8Array(r),a=$v(Uf,am(s,0,Qv[t])),c=$v(Uf,am(s,Qv[t],Qv[t]*2)),d=am(s,Qv[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new jnt(new Qnt(a),Array.from(Jnt)),hmac:new qnt(c)}),d}async function tit(e,t,n,i,o){if(ube)try{return await ew.importKey(e,t,n,i,o)}catch{return ube=!1,fy.importKey(t)}else return fy.importKey(t)}async function nit(e,t,n){if(mbe)try{return await ew.deriveBits(e,t,n)}catch{return mbe=!1,fy.pbkdf2(t,e.salt,gQ.iterations,n)}else return fy.pbkdf2(t,e.salt,gQ.iterations,n)}function gbe(e,t){return t===Zi?yV(e):t}function yQ(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function iit(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function am(e,t,n){return e.subarray(t,n)}function qv(e,t){return e.fromBits(t)}function $v(e,t){return e.toBits(t)}var H0i=T(S(),1);var _V=12,ZU=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Tbe(this,t)},transform(o,r){let s=this;if(s.password){let a=ybe(s,o.subarray(0,_V));if(s.password=null,a[_V-1]!=s.passwordVerification)throw new Error(py);o=o.subarray(_V)}i?r.error(new Error(n0)):r.enqueue(ybe(s,o))}})}},GU=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Tbe(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=CU(new Uint8Array(_V));c[_V-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(xbe(r,c),0),a=_V}else s=new Uint8Array(i.length),a=0;s.set(xbe(r,i),a),o.enqueue(s)}})}};function ybe(e,t){let n=new Uint8Array(t.length);for(let i=0;i>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function Sbe(e){let t=e.keys[2]|2;return Cbe(Math.imul(t,t^1)>>>8)}function Cbe(e){return e&255}function _be(e){return e&4294967295}var Vbe="deflate-raw",EU=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:d,level:u}=t,h=this,p,g,f=Lbe(super.readable);(!s||c)&&d&&(p=new Kv,f=Df(f,p)),r&&(f=Zbe(f,a,{level:u,chunkSize:n},o,i)),s&&(c?f=Df(f,new GU(t)):(g=new LU(t),f=Df(f,g))),Rbe(h,f,()=>{let x;s&&!c&&(x=g.signature),(!s||c)&&d&&(x=new DataView(p.value.buffer).getUint32(0)),h.signature=x})}},IU=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:d,useCompressionStream:u}=t,h,p,g=Lbe(super.readable);s&&(r?g=Df(g,new ZU(t)):(p=new VU(t),g=Df(g,p))),d&&(g=Zbe(g,u,{chunkSize:n},o,i)),(!s||r)&&a&&(h=new Kv,g=Df(g,h)),Rbe(this,g,()=>{if((!s||r)&&a){let f=new DataView(h.value.buffer);if(c!=f.getUint32(0,!1))throw new Error(xT)}})}};function Lbe(e){return Df(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function Rbe(e,t,n){t=Df(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function Zbe(e,t,n,i,o){try{let r=t&&i?i:o;e=Df(e,new r(Vbe,n))}catch{if(t)try{e=Df(e,new o(Vbe,n))}catch{return e}else return e}return e}function Df(e,t){return e.pipeThrough(t)}var Gbe="message",Ebe="start",Ibe="pull",_Q="data",Xbe="ack",TQ="close",PU="deflate",vU="inflate";var XU=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(PU)?r=EU:o.startsWith(vU)&&(r=IU);let s=0,a=0,c=new r(t,n),d=super.readable,u=new TransformStream({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),h=new TransformStream({transform(p,g){p&&p.length&&(s+=p.length,g.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return d.pipeThrough(u).pipeThrough(c).pipeThrough(h)}})}},WU=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var rgi=T(S(),1);var vbe=typeof Worker!=Yd;var TV=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:d},u){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new WU(r.chunkSize)).pipeThrough(new CQ(n,s),{signal:h}),writable:i,options:Object.assign({},o),scripts:d,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:f}=t;g?(f?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,u(t)}}),(a&&vbe?oit:wbe)(t,r)}},CQ=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await SQ(n,o)},async transform(a,c){s+=a.length,i&&await SQ(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await SQ(r,s)}})}};async function SQ(e,...t){try{await e(...t)}catch{}}function wbe(e,t){return{run:()=>rit(e,t)}}function oit(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=cit(e.scripts[0],n,e)}catch{return vbe=!1,wbe(e,t)}Object.assign(e,{worker:o,interface:{run:()=>sit(e,{chunkSize:i})}})}return e.interface}async function rit({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new XU(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}finally{i()}}async function sit(e,t){let n,i,o=new Promise((p,g)=>{n=p,i=g});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:d}=ait(e.writable),u=wU({type:Ebe,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);u||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let h=await o;return u||await c.getWriter().close(),await d,h}function ait(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var Wbe=!0,Pbe=!0;function cit(e,t,n){let i={type:"module"},o,r;typeof e==e0&&(e=e());try{o=new URL(e,t)}catch{o=e}if(Wbe)try{r=new Worker(o)}catch{Wbe=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(Gbe,s=>lit(s,n)),r}function wU(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(r.byteLength!C.busy);if(_)return Abe(_),new TV(_,e,t,x);if(_T.lengthVQ.push({resolve:C,stream:e,workerOptions:t}))}function x(_){if(VQ.length){let[{resolve:C,stream:V,workerOptions:L}]=VQ.splice(0,1);C(new TV(_,V,L,x))}else _.worker?(Abe(_),dit(_,t)):_T=_T.filter(C=>C!=_)}}function dit(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{_T=_T.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function Abe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var fgi=T(S(),1);var uit="Writer iterator completed too soon",mit="text/plain";var hit="Content-Type";var fit=64*1024,ZQ="writable",SV=class{constructor(){this.size=0}init(){this.initialized=!0}},AU=class extends SV{get readable(){let t=this,{chunkSize:n=fit}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this;o.enqueue(await Na(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},LQ=class extends SV{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,ZQ,{get(){return n}})}writeUint8Array(){}};var MU=class extends LQ{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},i0=class extends AU{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||on&&(s=s.slice(t,o)),new Uint8Array(s)}},tw=class extends SV{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([hit,t]),Object.defineProperty(n,ZQ,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},NU=class extends i0{constructor(t){super(new Blob([t],{type:mit}))}},kU=class extends tw{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var RQ=class extends AU{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;c>=r[a].size;)c-=r[a].size,a++;let d=r[a],u=d.size;if(c+n<=u)s=await Na(d,c,n);else{let h=u-c;s=new Uint8Array(n),s.set(await Na(d,c,h)),s.set(await o.readUint8Array(t+h,n-h,i),h)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},UU=class extends SV{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(u){let{availableSize:h}=i;if(s)u.length>=h?(await c(u.slice(0,h)),await d(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(u.slice(h))):await c(u);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(uit);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Of(o),r=p.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await d()}});Object.defineProperty(i,ZQ,{get(){return a}});async function c(u){let h=u.length;h&&(await s.ready,await s.write(u),o.size+=h,i.size+=h,i.availableSize-=h)}async function d(){r.size=o.size,await s.close()}}};async function Of(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function DU(e){return Array.isArray(e)&&(e=new RQ(e)),e instanceof ReadableStream&&(e={readable:e}),e}function BU(e){e.writable===Zi&&typeof e.next==e0&&(e=new UU(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Zi&&(t.size=0),e instanceof UU||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Na(e,t,n,i){return e.readUint8Array(t,n,i)}var Igi=T(S(),1);var xgi=T(S(),1);var bgi=T(S(),1),Mbe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),pit=Mbe.length==256;function Nbe(e){if(pit){let t="";for(let n=0;nthis[n]=t[n])}};var DQ="File format is not recognized",_it="End of central directory not found",Tit="End of Zip64 central directory locator not found",Sit="Central directory header not found",Cit="Local file header not found",Vit="Zip64 extra field not found",Lit="File contains encrypted entry",Rit="Encryption method not supported",Dbe="Compression method not supported",Bbe="Split zip file",Obe="utf-8",Ybe="cp437",Zit=[[WQ,4294967295],[PQ,4294967295],[vQ,4294967295],[OU,65535]],Git={[65535]:{getValue:ys,bytes:4},[4294967295]:{getValue:zU,bytes:8}},eD=class{constructor(t,n={}){Object.assign(this,{reader:DU(t),options:n,config:zv()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Of(i),(i.size===Zi||!i.readUint8Array)&&(i=new i0(await new Response(i.readable).blob()),await Of(i)),i.size<22)throw new Error(DQ);i.chunkSize=SU(o);let r=await Pit(i,101010256,i.size,22,65535*16);if(!r){let F=await Na(i,0,4),b=xa(F);throw ys(b)==134695760?new Error(Bbe):new Error(_it)}let s=xa(r),a=ys(s,12),c=ys(s,16),d=r.offset,u=ya(s,20),h=d+22+u,p=ya(s,4),g=i.lastDiskNumber||0,f=ya(s,6),x=ya(s,8),_=0,C=0;if(c==4294967295||a==4294967295||x==65535||f==65535){let F=await Na(i,r.offset-20,20),b=xa(F);if(ys(b,0)==117853008){c=zU(b,8);let R=await Na(i,c,56,-1),E=xa(R),X=r.offset-20-56;if(ys(E,0)!=101075792&&c!=X){let A=c;c=X,_=c-A,R=await Na(i,c,56,-1),E=xa(R)}if(ys(E,0)!=101075792)throw new Error(Tit);p==65535&&(p=ys(E,16)),f==65535&&(f=ys(E,20)),x==65535&&(x=zU(E,32)),a==4294967295&&(a=zU(E,40)),c-=a}}if(c>=i.size&&(_=i.size-c-a-22,c=i.size-a-22),g!=p)throw new Error(Bbe);if(c<0)throw new Error(DQ);let V=0,L=await Na(i,c,a,f),Z=xa(L);if(a){let F=r.offset-a;if(ys(Z,V)!=33639248&&c!=F){let b=c;c=F,_+=c-b,L=await Na(i,c,a,f),Z=xa(L)}}let G=r.offset-c-(i.lastDiskOffset||0);if(a!=G&&G>=0&&(a=G,L=await Na(i,c,a,f),Z=xa(L)),c<0||c>=i.size)throw new Error(DQ);let I=cl(n,t,"filenameEncoding"),v=cl(n,t,"commentEncoding");for(let F=0;Fb.getData(Le,Se,ke),V=k;let{onprogress:Ie}=t;if(Ie)try{await Ie(F+1,x,new gy(b))}catch{}yield Se}let P=cl(n,t,"extractPrependedData"),w=cl(n,t,"extractAppendedData");return P&&(n.prependedData=C>0?await Na(i,0,C):new Uint8Array),n.comment=u?await Na(i,d+22,u):new Uint8Array,w&&(n.appendedData=h>>8&255:p>>>24&255),signature:p,compressed:d!=0&&!G,encrypted:o.encrypted&&!G,useWebWorkers:cl(o,i,"useWebWorkers"),useCompressionStream:cl(o,i,"useCompressionStream"),transferStreams:cl(o,i,"transferStreams"),checkPasswordOnly:R},config:u,streamOptions:{signal:b,size:w,onstart:X,onprogress:A,onend:N}},U=0;try{({outputSize:U}=await FU({readable:F,writable:E},O))}catch(Y){if(!R||Y.message!=n0)throw Y}finally{let Y=cl(o,i,"preventClose");E.size+=U,!Y&&!E.locked&&await E.getWriter().close()}return R?Zi:t.getData?t.getData():E}};function zbe(e,t,n){let i=e.rawBitFlag=ya(t,n+2),o=(i&1)==1,r=ys(t,n+6);Object.assign(e,{encrypted:o,version:ya(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:vit(r),filenameLength:ya(t,n+22),extraFieldLength:ya(t,n+24)})}function Kbe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=xa(new Uint8Array(r)),c=0;try{for(;ct[o]==r);for(let o=0,r=0;o=5&&(r.push(CV),s.push(YU));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=ys(i,a);t[c]=e[c]=new Date(u*1e3);let h=s[d];e[h]=u}a+=4})}async function Pit(e,t,n,i,o){let r=new Uint8Array(4),s=xa(r);wit(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(d){let u=n-d,h=await Na(e,u,d);for(let p=h.length-i;p>=0;p--)if(h[p]==r[0]&&h[p+1]==r[1]&&h[p+2]==r[2]&&h[p+3]==r[3])return{offset:u+p,buffer:h.slice(p,p+i).buffer}}}function cl(e,t,n){return t[n]===Zi?e.options[n]:t[n]}function vit(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function BQ(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function VV(e,t){return e.getUint8(t)}function ya(e,t){return e.getUint16(t,!0)}function ys(e,t){return e.getUint32(t,!0)}function zU(e,t){return Number(e.getBigUint64(t,!0))}function wit(e,t,n){e.setUint32(t,n,!0)}function xa(e){return new DataView(e.buffer)}var Mgi=T(S(),1);var Nit="File already exists",kit="Zip file comment exceeds 64KB",Uit="File entry comment exceeds 64KB",Dit="File entry name exceeds 64KB",jbe="Version exceeds 65535",Bit="The strength must equal 1, 2, or 3",Oit="Extra field type exceeds 65535",Yit="Extra field data exceeds 64KB",o4="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Hit="Undefined uncompressed size",qbe=new Uint8Array([7,0,2,0,65,69,3,0,0]),n4=0,$be=[],iD=class{constructor(t,n={}){t=BU(t);let i=t.availableSize!==Zi&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Zi&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:zv(),files:new Map,filenames:new Set,offset:n.offset===Zi?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;n4$be.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(Nit);return o.filenames.add(t),a=zit(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=$be.shift();c?c():n4--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await not(this,t,n),bo(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function zit(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(bV)?t+=bV:i.directory=t.endsWith(bV);let o=bo(e,i,"encodeText",yV),r=o(t);if(r===Zi&&(r=yV(t)),Qi(r)>65535)throw new Error(Dit);let s=i.comment||"",a=o(s);if(a===Zi&&(a=yV(s)),Qi(a)>65535)throw new Error(Uit);let c=bo(e,i,NQ,20);if(c>65535)throw new Error(jbe);let d=bo(e,i,kQ,20);if(d>65535)throw new Error(jbe);let u=bo(e,i,CV,new Date),h=bo(e,i,iw),p=bo(e,i,ow),g=bo(e,i,AQ,!0),f=bo(e,i,wQ,0),x=bo(e,i,FQ,0),_=bo(e,i,"passThrough"),C,V;_||(C=bo(e,i,"password"),V=bo(e,i,"rawPassword"));let L=bo(e,i,"encryptionStrength",3),Z=bo(e,i,UQ),G=bo(e,i,"extendedTimestamp",!0),I=bo(e,i,"keepOrder",!0),v=bo(e,i,"level"),P=bo(e,i,"useWebWorkers"),w=bo(e,i,"bufferedWrite"),F=bo(e,i,"dataDescriptorSignature",!1),b=bo(e,i,"signal"),R=bo(e,i,"useUnicodeFileNames",!0),E=bo(e,i,"useCompressionStream"),X=bo(e,i,"compressionMethod"),A=bo(e,i,"dataDescriptor",!0),N=bo(e,i,HU);if(!Z&&(C!==Zi||V!==Zi)&&!(L>=1&&L<=3))throw new Error(Bit);let O=new Uint8Array,{extraField:U}=i;if(U){let Gt=0,gt=0;U.forEach(Ne=>Gt+=4+Qi(Ne)),O=new Uint8Array(Gt),U.forEach((Ne,Kt)=>{if(Kt>65535)throw new Error(Oit);if(Qi(Ne)>65535)throw new Error(Yit);Es(O,new Uint16Array([Kt]),gt),Es(O,new Uint16Array([Qi(Ne)]),gt+2),Es(O,Ne,gt+4),gt+=4+Qi(Ne)})}let Y=0,k=0,H=0;if(_&&({uncompressedSize:H}=i,H===Zi))throw new Error(Hit);let J=N===!0;n&&(n=DU(n),await Of(n),_?Y=e0e(H):n.size===Zi?(A=!0,(N||N===Zi)&&(N=!0,H=Y=4294967296)):(H=n.size,Y=e0e(H)));let{diskOffset:te,diskNumber:z,maxSize:j}=e.writer,ee=J||H>4294967295,fe=J||Y>4294967295,Te=J||e.offset+e.pendingEntriesSize-te>4294967295,xe=bo(e,i,"supportZip64SplitFile",!0)&&J||z+Math.ceil(e.pendingEntriesSize/j)>65535;if(Te||ee||fe||xe){if(N===!1||!I)throw new Error(o4);N=!0}N=N||!1;let Se=bo(e,i,MQ),{signature:Ie}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:c,versionMadeBy:d,lastModDate:u,lastAccessDate:h,creationDate:p,rawExtraField:O,zip64:N,zip64UncompressedSize:ee,zip64CompressedSize:fe,zip64Offset:Te,zip64DiskNumberStart:xe,password:C,rawPassword:V,level:!E&&e.config.CompressionStream===Zi&&e.config.CompressionStreamNative===Zi?0:v,useWebWorkers:P,encryptionStrength:L,extendedTimestamp:G,zipCrypto:Z,bufferedWrite:w,keepOrder:I,useUnicodeFileNames:R,dataDescriptor:A,dataDescriptorSignature:F,signal:b,msDosCompatible:g,internalFileAttribute:f,externalFileAttribute:x,useCompressionStream:E,passThrough:_,encrypted:!!(C&&Qi(C)||V&&Qi(V))||_&&Se,signature:Ie,compressionMethod:X});let Le=Qit(i),ke=qit(i),Be=Qi(Le.localHeaderArray,ke.dataDescriptorArray);k=Be+Y,e.options.usdz&&(k+=k+64),e.pendingEntriesSize+=k;let it;try{it=await Kit(e,t,n,{headerInfo:Le,dataDescriptorInfo:ke,metadataSize:Be},i)}finally{e.pendingEntriesSize-=k}return Object.assign(it,{name:t,comment:s,extraField:U}),new gy(it)}async function Kit(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:d}=o,{headerInfo:u}=i,{usdz:h}=e.options,p=Array.from(r.values()).pop(),g={},f,x,_,C,V,L,Z;r.set(t,g);try{let P;a&&(P=p&&p.lock,G()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!h?(L=new TransformStream,Z=new Response(L.readable).blob(),L.writable.size=0,f=!0,e.bufferedWrites++,await Of(s)):(L=s,await I()),await Of(L);let{writable:w}=s,{diskOffset:F}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let R=new Uint8Array(4),E=ka(R);Ji(E,0,134695760),await Yf(w,R),e.offset+=4}h&&jit(i,e.offset-F),f||(await P,await v(w));let{diskNumber:b}=s;if(V=!0,g.diskNumberStart=b,g=await Jit(n,L,g,i,e.config,o),V=!1,r.set(t,g),g.filename=t,f){await L.writable.getWriter().close();let R=await Z;await P,await I(),C=!0,c||(R=await eot(g,R,w,o)),await v(w),g.diskNumberStart=s.diskNumber,F=s.diskOffset,await R.stream().pipeTo(w,{preventClose:!0,preventAbort:!0,signal:d}),w.size+=R.size,C=!1}if(g.offset=e.offset-F,g.zip64)tot(g,o);else if(g.offset>4294967295)throw new Error(o4);return e.offset+=g.size,g}catch(P){if(f&&C||!f&&V){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}f?e.offset+=L.writable.size:e.offset=L.writable.size}throw r.delete(t),P}finally{f&&e.bufferedWrites--,_&&_(),x&&x()}function G(){g.lock=new Promise(P=>_=P)}async function I(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(w=>x=()=>{e.writerLocked=!1,w()}),await P}async function v(P){Qi(u.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Yf(P,new Uint8Array))}}async function Jit(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{localHeaderArray:u,headerArray:h,lastModDate:p,rawLastModDate:g,encrypted:f,compressed:x,version:_,compressionMethod:C,rawExtraFieldExtendedTimestamp:V,extraFieldExtendedTimestampFlag:L,rawExtraFieldNTFS:Z,rawExtraFieldAES:G}=a,{dataDescriptorArray:I}=c,{rawFilename:v,lastAccessDate:P,creationDate:w,password:F,rawPassword:b,level:R,zip64:E,zip64UncompressedSize:X,zip64CompressedSize:A,zip64Offset:N,zip64DiskNumberStart:O,zipCrypto:U,dataDescriptor:Y,directory:k,versionMadeBy:H,rawComment:J,rawExtraField:te,useWebWorkers:z,onstart:j,onprogress:ee,onend:fe,signal:Te,encryptionStrength:de,extendedTimestamp:xe,msDosCompatible:Se,internalFileAttribute:Ie,externalFileAttribute:Le,useCompressionStream:ke,passThrough:Be}=s,it={lock:i,versionMadeBy:H,zip64:E,directory:!!k,filenameUTF8:!0,rawFilename:v,commentUTF8:!0,rawComment:J,rawExtraFieldExtendedTimestamp:V,rawExtraFieldNTFS:Z,rawExtraFieldAES:G,rawExtraField:te,extendedTimestamp:xe,msDosCompatible:Se,internalFileAttribute:Ie,externalFileAttribute:Le,diskNumberStart:n},{signature:Gt,uncompressedSize:gt}=s,Ne=0;Be||(gt=0);let{writable:Kt}=t;if(e){e.chunkSize=SU(r),await Yf(Kt,u);let ut=e.readable,zn=ut.size=e.size,cn={options:{codecType:PU,level:R,rawPassword:b,password:F,encryptionStrength:de,zipCrypto:f&&U,passwordVerification:f&&U&&g>>8&255,signed:!Be,compressed:x&&!Be,encrypted:f&&!Be,useWebWorkers:z,useCompressionStream:ke,transferStreams:!1},config:r,streamOptions:{signal:Te,size:zn,onstart:j,onprogress:ee,onend:fe}},be=await FU({readable:ut,writable:Kt},cn);Ne=be.outputSize,Be||(gt=be.inputSize,Gt=be.signature),Kt.size+=gt}else await Yf(Kt,u);let Lt;if(E){let ut=4;X&&(ut+=8),A&&(ut+=8),N&&(ut+=8),O&&(ut+=4),Lt=new Uint8Array(ut)}else Lt=new Uint8Array;return $it({signature:Gt,rawExtraFieldZip64:Lt,compressedSize:Ne,uncompressedSize:gt,headerInfo:a,dataDescriptorInfo:c},s),Y&&await Yf(Kt,I),Object.assign(it,{uncompressedSize:gt,compressedSize:Ne,lastModDate:p,rawLastModDate:g,creationDate:w,lastAccessDate:P,encrypted:f,zipCrypto:U,size:d+Ne,compressionMethod:C,version:_,headerArray:h,signature:Gt,rawExtraFieldZip64:Lt,extraFieldExtendedTimestampFlag:L,zip64UncompressedSize:X,zip64CompressedSize:A,zip64Offset:N,zip64DiskNumberStart:O}),it}function Qit(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:d,directory:u,rawExtraField:h,encryptionStrength:p,extendedTimestamp:g,encrypted:f}=e,{version:x,compressionMethod:_}=e,C=!u&&(r>0||r===Zi&&_!==0),V;if(f&&!a){V=new Uint8Array(Qi(qbe)+2);let N=ka(V);oo(N,0,39169),Es(V,qbe,2),oD(N,8,p)}else V=new Uint8Array;let L,Z,G;if(g){Z=new Uint8Array(9+(i?4:0)+(o?4:0));let N=ka(Z);oo(N,0,21589),oo(N,2,Qi(Z)-4),G=1+(i?2:0)+(o?4:0),oD(N,4,G);let O=5;Ji(N,O,Math.floor(n.getTime()/1e3)),O+=4,i&&(Ji(N,O,Math.floor(i.getTime()/1e3)),O+=4),o&&Ji(N,O,Math.floor(o.getTime()/1e3));try{L=new Uint8Array(36);let U=ka(L),Y=i4(n);oo(U,0,10),oo(U,2,32),oo(U,8,1),oo(U,10,24),zl(U,12,Y),zl(U,20,i4(i)||Y),zl(U,28,i4(o)||Y)}catch{L=new Uint8Array}}else L=Z=new Uint8Array;let I=0;c&&(I=I|2048),d&&(I=I|8),_===Zi&&(_=C?8:0),_==8&&(r>=1&&r<3&&(I=I|6),r>=3&&r<5&&(I=I|1),r===9&&(I=I|2)),s&&(x=x>45?x:45),f&&(I=I|1,a||(x=x>51?x:51,V[9]=_,_=99));let v=new Uint8Array(26),P=ka(v);oo(P,0,x),oo(P,2,I),oo(P,4,_);let w=new Uint32Array(1),F=ka(w),b;nhQ?b=hQ:b=n,oo(F,0,(b.getHours()<<6|b.getMinutes())<<5|b.getSeconds()/2),oo(F,2,(b.getFullYear()-1980<<4|b.getMonth()+1)<<5|b.getDate());let R=w[0];Ji(P,6,R),oo(P,22,Qi(t));let E=Qi(V,Z,L,h);oo(P,24,E);let X=new Uint8Array(30+Qi(t)+E),A=ka(X);return Ji(A,0,67324752),Es(X,v,4),Es(X,t,30),Es(X,V,30+Qi(t)),Es(X,Z,30+Qi(t,V)),Es(X,L,30+Qi(t,V,Z)),Es(X,h,30+Qi(t,V,Z,L)),{localHeaderArray:X,headerArray:v,headerView:P,lastModDate:n,rawLastModDate:R,encrypted:f,compressed:C,version:x,compressionMethod:_,extraFieldExtendedTimestampFlag:G,rawExtraFieldExtendedTimestamp:Z,rawExtraFieldNTFS:L,rawExtraFieldAES:V,extraFieldLength:E}}function jit(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=ka(i),s=64-(t+Qi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=ka(a);oo(c,0,6534),oo(c,2,s-2);let d=i;n.localHeaderArray=i=new Uint8Array(Qi(d)+s),Es(i,d),Es(i,a,Qi(d)),r=ka(i),oo(r,28,o+s),e.metadataSize+=s}function qit(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=ka(o),i&&(s=4,Ji(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function $it(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:d}=s,{dataDescriptorView:u,dataDescriptorOffset:h}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:f,zipCrypto:x,dataDescriptor:_}=t;if((!d||x)&&n!==Zi&&(Ji(c,10,n),_&&Ji(u,h,n)),p){let C=ka(i);oo(C,0,1),oo(C,2,Qi(i)-4);let V=4;g&&(Ji(c,18,4294967295),zl(C,V,BigInt(r)),V+=8),f&&(Ji(c,14,4294967295),zl(C,V,BigInt(o))),_&&(zl(u,h+4,BigInt(o)),zl(u,h+12,BigInt(r)))}else Ji(c,14,o),Ji(c,18,r),_&&(Ji(u,h+4,o),Ji(u,h+8,r))}async function eot(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&Ji(r,14,e.signature),e.zip64?(Ji(r,18,4294967295),Ji(r,22,4294967295)):(Ji(r,18,e.compressedSize),Ji(r,22,e.uncompressedSize)),await Yf(n,new Uint8Array(o)),t.slice(o.byteLength)}function tot(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,d=ka(n),u=4;r&&(u+=8),s&&(u+=8),a&&(zl(d,u,BigInt(i)),u+=8),c&&Ji(d,u,o)}async function not(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,d=0,u=e.offset-r,h=i.size;for(let[,G]of i){let{rawFilename:I,rawExtraFieldZip64:v,rawExtraFieldAES:P,rawComment:w,rawExtraFieldNTFS:F,rawExtraField:b,extendedTimestamp:R,extraFieldExtendedTimestampFlag:E,lastModDate:X}=G,A;if(R){A=new Uint8Array(9);let N=ka(A);oo(N,0,21589),oo(N,2,5),oD(N,4,E),Ji(N,5,Math.floor(X.getTime()/1e3))}else A=new Uint8Array;G.rawExtraFieldCDExtendedTimestamp=A,d+=46+Qi(I,w,v,P,F,A,b)}let p=new Uint8Array(d),g=ka(p);await Of(o);let f=0;for(let[G,I]of Array.from(i.values()).entries()){let{offset:v,rawFilename:P,rawExtraFieldZip64:w,rawExtraFieldAES:F,rawExtraFieldCDExtendedTimestamp:b,rawExtraFieldNTFS:R,rawExtraField:E,rawComment:X,versionMadeBy:A,headerArray:N,directory:O,zip64:U,zip64UncompressedSize:Y,zip64CompressedSize:k,zip64DiskNumberStart:H,zip64Offset:J,msDosCompatible:te,internalFileAttribute:z,externalFileAttribute:j,diskNumberStart:ee,uncompressedSize:fe,compressedSize:Te}=I,de=Qi(w,F,b,R,E);Ji(g,c,33639248),oo(g,c+4,A);let xe=ka(N);Y||Ji(xe,18,fe),k||Ji(xe,14,Te),Es(p,N,c+6),oo(g,c+30,de),oo(g,c+32,Qi(X)),oo(g,c+34,U&&H?65535:ee),oo(g,c+36,z),j?Ji(g,c+38,j):O&&te&&oD(g,c+38,16),Ji(g,c+42,U&&J?4294967295:v),Es(p,P,c+46),Es(p,w,c+46+Qi(P)),Es(p,F,c+46+Qi(P,w)),Es(p,b,c+46+Qi(P,w,F)),Es(p,R,c+46+Qi(P,w,F,b)),Es(p,E,c+46+Qi(P,w,F,b,R)),Es(p,X,c+46+Qi(P)+de);let Se=46+Qi(P,X)+de;if(c-f>o.availableSize&&(o.availableSize=0,await Yf(s,p.slice(f,c)),f=c),c+=Se,n.onprogress)try{await n.onprogress(G+1,i.size,new gy(I))}catch{}}await Yf(s,f?p.slice(f):p);let x=o.diskNumber,{availableSize:_}=o;_<22&&x++;let C=bo(e,n,HU);if(u>4294967295||d>4294967295||h>65535||x>65535){if(C===!1)throw new Error(o4);C=!0}let V=new Uint8Array(C?98:22),L=ka(V);c=0,C&&(Ji(L,0,101075792),zl(L,4,BigInt(44)),oo(L,12,45),oo(L,14,45),Ji(L,16,x),Ji(L,20,a),zl(L,24,BigInt(h)),zl(L,32,BigInt(h)),zl(L,40,BigInt(d)),zl(L,48,BigInt(u)),Ji(L,56,117853008),zl(L,64,BigInt(u)+BigInt(d)),Ji(L,72,x+1),bo(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),h=65535,u=4294967295,d=4294967295,c+=76),Ji(L,c,101010256),oo(L,c+4,x),oo(L,c+6,a),oo(L,c+8,h),oo(L,c+10,h),Ji(L,c+12,d),Ji(L,c+16,u);let Z=Qi(t);if(Z)if(Z<=65535)oo(L,c+20,Z);else throw new Error(kit);await Yf(s,V),Z&&await Yf(s,t)}async function Yf(e,t){let n=e.getWriter();try{await n.ready,e.size+=Qi(t),await n.write(t)}finally{n.releaseLock()}}function i4(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function bo(e,t,n,i){let o=t[n]===Zi?e.options[n]:t[n];return o===Zi?i:o}function e0e(e){return e+5*(Math.floor(e/16383)+1)}function oD(e,t,n){e.setUint8(t,n)}function oo(e,t,n){e.setUint16(t,n,!0)}function Ji(e,t,n){e.setUint32(t,n,!0)}function zl(e,t,n){e.setBigUint64(t,n,!0)}function Es(e,t,n){e.set(t,n)}function ka(e){return new DataView(e.buffer)}function Qi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}gV({Deflate:Mpe,Inflate:sbe});var jgi=T(S(),1);function iot(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Xn=iot;var $gi=T(S(),1);function oot(e,t){this.position=e,this.headingPitchRange=t}var aw=oot;var iyi=T(S(),1);function rD(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new ge,this.tourEnd=new ge,this.entryStart=new ge,this.entryEnd=new ge,this._activeEntries=[]}rD.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};rD.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;i0e.call(this,e,t,function(i){n.playlistIndex=0,i||n0e(n._activeEntries),n.tourEnd.raiseEvent(i)})};rD.prototype.stop=function(){n0e(this._activeEntries)};function n0e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function i0e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=rot.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function rot(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,i0e.call(this,e,t,n)}}var cw=rD;var _yi=T(S(),1);var fyi=T(S(),1);var uyi=T(S(),1),wi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-wi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?wi.Bounce.In(e*2)*.5:wi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),lw=function(){return performance.now()},sot=function(){function e(){for(var t=[],n=0;n0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=LV.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=LV.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},o0e=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),r4=new sot,r0e=function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=wi.Linear.None,this._interpolationFunction=LV.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=o0e.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=r4,r4.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=lw()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),d=c?"array":typeof a,u=!c&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var h=i[s];if(h.length===0)continue;for(var p=[a],g=0,f=h.length;g"u"||r)&&(n[s]=a),c||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=lw()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=lw()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;tc)return 1;var x=Math.trunc(s/a),_=s-x*a,C=Math.min(_/i._duration,1);return C===0&&s===i._duration?1:C},u=d(),h=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,f=this._chainedTweens.length;gthis._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function dot(e){let t=e.slice(0,Math.min(4,e.size)),n=Sl(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function uot(e){let t=Sl(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function b0e(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("",t),i,o,r;for(;t!==-1&&t0?(Kl.maximumRed=r,Kl.red=void 0):(Kl.maximumRed=void 0,Kl.red=0),o>0?(Kl.maximumGreen=o,Kl.green=void 0):(Kl.maximumGreen=void 0,Kl.green=0),i>0?(Kl.maximumBlue=i,Kl.blue=void 0):(Kl.maximumBlue=void 0,Kl.blue=0),Kl.alpha=n,B.fromRandom(Kl)):new B(r,o,i,n)}function TT(e,t,n){let i=Wn(e,t,n);if(l(i))return u4(i,Wn(e,"colorMode",n)==="random")}function hot(e){let t=Fi(e,"TimeStamp",Pe.kmlgx),n=Wn(t,"when",Pe.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=q.fromIso8601(n),o=new Dr;return o.addInterval(new Ln({start:i,stop:Oe.MAXIMUM_VALUE})),o}function fot(e){let t=Fi(e,"TimeSpan",Pe.kmlgx);if(!l(t))return;let n,i=Fi(t,"begin",Pe.kmlgx),o=l(i)?q.fromIso8601(i.textContent):void 0,r=Fi(t,"end",Pe.kmlgx),s=l(r)?q.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(q.lessThan(s,o)){let a=o;o=s,s=a}n=new Dr,n.addInterval(new Ln({start:o,stop:s}))}else l(o)?(n=new Dr,n.addInterval(new Ln({start:o,stop:Oe.MAXIMUM_VALUE}))):l(s)&&(n=new Dr,n.addInterval(new Ln({start:Oe.MINIMUM_VALUE,stop:s})));return n}function x0e(){let e=new oc;return e.width=yy,e.height=yy,e.scaleByDistance=new Nt(s0e,a0e,c0e,l0e),e.pixelOffsetScaleByDistance=new Nt(s0e,a0e,c0e,l0e),e}function b4(){let e=new Mm;return e.outline=!0,e.outlineColor=B.WHITE,e}function _0e(){let e=new Am;return e.translucencyByDistance=new Nt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=yi.LEFT,e.font="16px sans-serif",e.style=Oo.FILL_AND_OUTLINE,e}function g4(e,t,n,i,o){let r=Wn(e,"href",Pe.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y(ei(e,"x",Pe.gx),0),d=y(ei(e,"y",Pe.gx),0);c=Math.min(c/32,7),d=7-Math.min(d/32,7);let u=8*d+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=p4(r,n,i);if(o){let a=Wn(e,"refreshMode",Pe.kml),c=Wn(e,"viewRefreshMode",Pe.kml);a==="onInterval"||a==="onExpire"?xt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&xt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=y(Wn(e,"viewBoundScale",Pe.kml),1),u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=y(Wn(e,"viewFormat",Pe.kml),u),p=Wn(e,"httpQuery",Pe.kml);l(h)&&s.setQueryParameters(ad(lD(h))),l(p)&&s.setQueryParameters(ad(lD(p)));let g=t._ellipsoid;return x4(s,t.camera,t.canvas,d,t._lastCameraView.bbox,g),s}return s}function pot(e,t,n,i,o){let r=ei(t,"scale",Pe.kml),s=ei(t,"heading",Pe.kml),a=TT(t,"color",Pe.kml),c=Fi(t,"Icon",Pe.kml),d=g4(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=ei(c,"x",Pe.gx),h=ei(c,"y",Pe.gx),p=ei(c,"w",Pe.gx),g=ei(c,"h",Pe.gx),f=Fi(t,"hotSpot",Pe.kml),x=xy(f,"x"),_=xy(f,"y"),C=Is(f,"xunits"),V=Is(f,"yunits"),L=n.billboard;l(L)||(L=x0e(),n.billboard=L),L.image=d,L.scale=r,L.color=a,(l(u)||l(h)||l(p)||l(g))&&(L.imageSubRegion=new ze(u,h,p,g)),l(s)&&s!==0&&(L.rotation=W.toRadians(-s),L.alignedAxis=m.UNIT_Z),r=y(r,1);let Z,G;l(x)&&(C==="pixels"?Z=-x*r:C==="insetPixels"?Z=(x-yy)*r:C==="fraction"&&(Z=-x*yy*r),Z+=yy*.5*r),l(_)&&(V==="pixels"?G=_*r:V==="insetPixels"?G=(-_+yy)*r:V==="fraction"&&(G=_*yy*r),G-=yy*.5*r),(l(Z)||l(G))&&(L.pixelOffset=new D(Z,G))}function cD(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r:clampToSeaFloor is currently not supported, using :clampToGround."),Je.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(xt("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),Je.RELATIVE_TO_GROUND):(l(e)?xt("kml-altitudeMode-unknown",`KML - Unknown :${e}, using :CLAMP_TO_GROUND.`):xt("kml-gx:altitudeMode-unknown",`KML - Unknown :${t}, using :CLAMP_TO_GROUND.`),Je.CLAMP_TO_GROUND)}function yot(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new vf(e))}function xot(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r0&&xt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,d.length),f=[],x=[];for(let C=0;C0&&i.availability.addInterval(new Ln({start:x[0],stop:x[x.length-1]})),h&&u&&y4(t,i,o),!0}function f0e(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],h=new ba;h.addSamples(e,t),n.intervals.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:yot(h,s,a)})),i.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function Cot(e,t,n,i,o){let r=Gh(n,"interpolate",Pe.gx),s=Zh(n,"Track",Pe.gx),a,c,d,u=!1,h=new Ob,p=new Dr,g=new fa,f=e._ellipsoid;for(let x=0,_=s.length;x<_;x++){let C=s[x],V=Zh(C,"when",Pe.kml),L=Zh(C,"coord",Pe.gx),Z=Wn(C,"altitudeMode",Pe.kml),G=Wn(C,"altitudeMode",Pe.gx),I=hw(Z,G),v=Gh(C,"extrude",Pe.kml),P=Math.min(L.length,V.length),w=[];a=[];for(let F=0;F0)){for(f='',r=0;r`;f+="
${y(x.displayName,s)}${y(x.value,"")}
"}if(!l(f))return;f=cot.link(f),go.innerHTML=f;let _=go.querySelectorAll("a");for(r=0;r<_.length;r++)_[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Hd(go,"a","href",i),Hd(go,"link","href",i),Hd(go,"area","href",i),Hd(go,"img","src",i),Hd(go,"iframe","src",i),Hd(go,"video","src",i),Hd(go,"audio","src",i),Hd(go,"source","src",i),Hd(go,"track","src",i),Hd(go,"input","src",i),Hd(go,"embed","src",i),Hd(go,"script","src",i),Hd(go,"video","poster",i)),zd(go,"a","href",o),zd(go,"link","href",o),zd(go,"area","href",o),zd(go,"img","src",o),zd(go,"iframe","src",o),zd(go,"video","src",o),zd(go,"audio","src",o),zd(go,"source","src",o),zd(go,"track","src",o),zd(go,"input","src",o),zd(go,"embed","src",o),zd(go,"script","src",o),zd(go,"video","poster",o);let C='
',C+=`${go.innerHTML}
`,go.innerHTML="",t.description=C}function mD(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=y0e(t,i,n.context),c=a.kml,d=bot(e,t,n.styleCollection,r,s),u=Wn(t,"name",Pe.kml);a.name=u,a.parent=o;let h=fot(t);l(h)||(h=hot(t)),a.availability=h,T4(a);function p(L){return L?L.show&&p(L.parent):!0}let g=Gh(t,"visibility",Pe.kml);a.show=p(o)&&y(g,!0);let f=Fi(t,"author",Pe.atom),x=c.author;x.name=Wn(f,"name",Pe.atom),x.uri=Wn(f,"uri",Pe.atom),x.email=Wn(f,"email",Pe.atom);let _=Fi(t,"link",Pe.atom),C=c.link;C.href=Is(_,"href"),C.hreflang=Is(_,"hreflang"),C.rel=Is(_,"rel"),C.type=Is(_,"type"),C.title=Is(_,"title"),C.length=Is(_,"length"),c.address=Wn(t,"address",Pe.kml),c.phoneNumber=Wn(t,"phoneNumber",Pe.kml),c.snippet=Wn(t,"Snippet",Pe.kml),Rot(t,a),Zot(t,a,d,s,r);let V=e._ellipsoid;return Z0e(t,a,V),R0e(t,a,V),l(Fi(t,"Region",Pe.kml))&&xt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function L0e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Got(e,t,n,i){let o=mD(e,t,n),r=Ye(n);r.parentEntity=o.entity,L0e(e,t,r,i)}function Eot(e,t,n,i){let o=mD(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let d=0,u=c.length;dW.PI_OVER_TWO?W.PI_OVER_TWO:d}function a(d){return d>W.PI?d-W.TWO_PI:d<-W.PI?d+W.TWO_PI:d}let c=nx(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==oe.MORPHING){let d,u;if(o=y(o,Fot),l(n)&&(l4.x=n.clientWidth*.5,l4.y=n.clientHeight*.5,d=t.pickEllipsoid(l4,r,Aot)),l(d)?u=r.cartesianToCartographic(d,RV):(u=ce.center(o,RV),d=r.cartographicToCartesian(u)),l(i)&&!W.equalsEpsilon(i,1,W.EPSILON9)){let C=o.width*i*.5,V=o.height*i*.5;o=new ce(a(u.longitude-C),s(u.latitude-V),a(u.longitude+C),s(u.latitude+V))}c=c.replace("[bboxWest]",W.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",W.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",W.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",W.toDegrees(o.north).toString());let h=W.toDegrees(u.longitude).toString(),p=W.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",h),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",W.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",W.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,d)),c=c.replace("[lookatTerrainLon]",h),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,RV),c=c.replace("[cameraLon]",W.toDegrees(RV.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(RV.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(RV.height).toString());let g=t.frustum,f=g.aspectRatio,x="",_="";if(l(f)){let C=W.toDegrees(g.fov);f>1?(x=C,_=C/f):(_=C,x=C*f)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",_.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(ad(c))}function Mot(e,t,n,i){let r=mD(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Fi(t,"Link",Pe.kml);if(l(c)||(c=Fi(t,"Url",Pe.kml)),l(c)){let d=Wn(c,"href",Pe.kml),u,h;if(l(d)){let p=d;if(d=p4(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=Wn(c,"viewRefreshMode",Pe.kml),u==="onRegion"){xt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=y(Wn(c,"viewBoundScale",Pe.kml),1);let _=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(Wn(c,"viewFormat",Pe.kml),_),V=Wn(c,"httpQuery",Pe.kml);l(C)&&d.setQueryParameters(ad(lD(C))),l(V)&&d.setQueryParameters(ad(lD(V)));let L=e._ellipsoid;x4(d,e.camera,e.canvas,h,e._lastCameraView.bbox,L)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new zs,x=_4(e,f,d,g).then(function(_){let C=e._entityCollection,V=f.values;C.suspendEvents();for(let G=0;G0||L==="onExpire"||u==="onStop"){let G=Fi(_,"NetworkLinkControl",Pe.kml),I=l(G),v=q.now(),P={id:Bn(),href:d,cookie:{},lastUpdated:v,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:v},w=0;if(I&&(P.cookie=ad(y(Wn(G,"cookie",Pe.kml),"")),w=y(ei(G,"minRefreshPeriod",Pe.kml),0)),L==="onInterval")I&&(Z=Math.max(w,Z)),P.refreshMode=_y.INTERVAL,P.time=Z;else if(L==="onExpire"){let F;if(I&&(F=Wn(G,"expires",Pe.kml)),l(F))try{let b=q.fromIso8601(F),R=q.secondsDifference(b,v);R>0&&R0;)this._screenOverlays.pop().remove()};function T4(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function Uot(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Fi(r,"NetworkLinkControl",Pe.kml),c=l(a),d=0;if(c){if(l(Fi(a,"Update",Pe.kml))){xt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=ad(y(Wn(a,"cookie",Pe.kml),"")),d=y(ei(a,"minRefreshPeriod",Pe.kml),0)}let u=q.now(),h=t.refreshMode;if(h===_y.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(h===_y.EXPIRE){let v;if(l(a)&&(v=Wn(a,"expires",Pe.kml)),l(v))try{let P=q.fromIso8601(v),w=q.secondsDifference(P,u);w>0&&wu.time&&(p=!0):u.refreshMode===_y.EXPIRE?q.greaterThan(n,u.time)&&(p=!0):u.refreshMode===_y.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&q.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(h),u.updating=!0;let g=new zs,f=u.href.clone();f.setQueryParameters(u.cookie);let x=y(i._ellipsoid,ne.default);x4(f,i.camera,i.canvas,u.viewBoundScale,s.bbox,x),_4(i,g,f,{context:h.id}).then(Uot(i,u,g,c,f)).catch(function(_){let C=`NetworkLink ${u.href} refresh failed: ${_}`;console.log(C),i._error.raiseEvent(i,C)}),d=!0}}c.set(u.id,u)}}),d&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function Dot(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}Kd._DeferredLoading=zf;Kd._getTimestamp=Ti;var ST=Kd;var kxi=T(S(),1);function fw(){pe.throwInstantiationError()}fw.prototype.update=pe.throwInstantiationError;fw.prototype.getBoundingSphere=pe.throwInstantiationError;fw.prototype.isDestroyed=pe.throwInstantiationError;fw.prototype.destroy=pe.throwInstantiationError;var S4=fw;var b_i=T(S(),1);var C4=32,Bot="http://www.opengis.net/kml/2.2",Ih="http://www.google.com/kml/ext/2.2",Oot="http://www.w3.org/2000/xmlns/";function hD(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Yot=/^data:image\/([^,;]+)/;hD.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ze){if(e=Ze.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Yot);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function Hot(e,t){return function(n){e._files[t]=n}}hD.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new ae("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(Hot(this,r))}return o};Object.defineProperties(hD.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function fD(e){this._time=e}fD.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};fD.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return VT(n)};fD.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function V4(){this._ids={},this._styles={},this._count=0}V4.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};V4.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function X0e(){this._ids={}}X0e.prototype.get=function(e){if(!l(e))return this.get(Bn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function L4(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=L4._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(Oot,"xmlns:gx",Ih);let a=r.createElement("Document");s.appendChild(a),P0e(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?zot(u,c.files):{kml:u,externalFiles:c.files}})}function zot(e,t){let n=nn("ThirdParty/Workers/z-worker-pako.js");gV({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new tw,o=new iD(i);return o.add("doc.kml",new NU(e)).then(function(){let r=Object.keys(t);return W0e(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function W0e(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new i0(n[o])).then(function(){return W0e(e,t,n,i+1)})}L4._createState=function(e){let t=e.entities,n=new V4,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===Oe.MINIMUM_VALUE?r.stop===Oe.MAXIMUM_VALUE?r=new Ln:q.addSeconds(r.stop,-10*s,r.start):r.stop===Oe.MAXIMUM_VALUE&&q.addSeconds(r.start,10*s,r.stop);let a=new hD(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Bot,"kml"),ellipsoid:y(e.ellipsoid,ne.default),idManager:new X0e,styleCache:n,externalFileHandler:a,time:o,valueGetter:new fD(o),sampleDuration:s,defaultAvailability:new Dr([r])}};function P0e(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,d,u;for(let h=0;h0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let V=p.name,L=p.label;if(l(L)){let G=i.createElement("LabelStyle"),I=r.get(L.text);V=l(I)&&I.length>0?I:V;let v=r.getColor(L.fillColor);l(v)&&(G.appendChild(hn(i,"color",v)),G.appendChild(hn(i,"colorMode","normal")));let P=r.get(L.scale);l(P)&&G.appendChild(hn(i,"scale",P)),u.push(G)}C.appendChild(hn(i,"name",V)),C.appendChild(hn(i,"visibility",p.show)),C.appendChild(hn(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C);let Z=u.length;if(Z>0){let G=i.createElement("Style");for(let I=0;I1){let G=i.createElement("MultiGeometry");for(let I=0;I0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(hn(i,"name",p.name)),C.appendChild(hn(i,"visibility",p.show)),C.appendChild(hn(i,"description",p.description)),t.appendChild(C),P0e(e,C,_)}}}var Jl=new m,ll=new he,Eh=new q;function Kot(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){v0e(e,t,a,n,i);return}s.get(c,void 0,Jl);let d=hn(o,"coordinates",CT(Jl,r)),u=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(LT(e,a.heightReference)),u.appendChild(h),u.appendChild(d),n.push(u);let p=a instanceof oc?F0e(e,a):w0e(e,a);i.push(p)}function v0e(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof fa?(c=d.intervals,u=!1):c=y(t.availability,e.defaultAvailability);let h=n instanceof Np,p,g,f,x=[];for(p=0;p1){let C=r.createElementNS(Ih,"MultiTrack");for(p=0;p0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],d=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)d[g](a,ll),c.push(`${W.toDegrees(ll.longitude)},${W.toDegrees(ll.latitude)},${r}`);let u=hn(i,"coordinates",c.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),h.appendChild(p),[h]}function E0e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u0&&(r=n);let a=[],c=t.hierarchy,d=o.get(c),u=Array.isArray(d)?d:d.positions,h=i.createElement("outerBoundaryIs");h.appendChild(E0e(e,u,r,s)),a.push(h);let p=d.holes;if(l(p)){let g=p.length;for(let f=0;f0&&c.appendChild(hn(r,"extrude",!0));let u=a?Qot(e,t,d):jot(e,t,d),h=u.length;for(let _=0;_=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var Z4=L4;var xJi=T(S(),1);var x_i=T(S(),1);function ert(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=` +${o}`),t}var Kf=ert;var P_i=T(S(),1);var Z_i=T(S(),1);var S_i=T(S(),1);async function trt(e,t,n,i){return l(i)||(i=!1),ort(e,t,n,i)}function nrt(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(N0e(i)):r=o.then(N0e(i)).catch(rrt(i)),e.shift(),t.push(r),!0}function irt(e){return new Promise(function(t){setTimeout(t,e)})}function G4(e,t,n){return e.length?nrt(e,t,n)?G4(e,t,n):irt(100).then(()=>G4(e,t,n)):Promise.resolve()}function ort(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r0&&await k0e(e,a,n),t}var RT=k0e;async function I4(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===oe.SCENE2D)return r;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],d=await I4._sampleTerrainMostDetailed(n,c),u=!1,h=d.reduce(function(g,f){return l(f.height)?(u=!0,Math.max(f.height,g)):g},-Number.MAX_VALUE),p=r;return u&&(p.height+=h),p}I4._sampleTerrainMostDetailed=RT;var ZT=I4;var vEi=T(S(),1);var QTi=T(S(),1);var UTi=T(S(),1);var w_i=T(S(),1),srt={NONE:0,LERC:1},cm=Object.freeze(srt);var mTi=T(S(),1);var J_i=T(S(),1);var A_i=T(S(),1),art={NONE:0,BITS12:1},js=Object.freeze(art);var GT=new m,crt=new m,lm=new D,pD=new M,lrt=new M,drt=Math.pow(2,12);function Sc(e,t,n,i,o,r,s,a,c,d){let u=js.NONE,h,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,f=t.maximum,x=m.subtract(f,g,crt),_=i-n;Math.max(m.maximumComponent(x),_)0,g=y(e.isGeographic,!0),f=y(e.ellipsoid,ne.default),x=1/f.maximumRadius,_=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),V,L,Z,G;l(C)?(V=C.west,L=C.south,Z=C.east,G=C.north):g?(V=a(_.west),L=a(_.south),Z=a(_.east),G=a(_.north)):(V=_.west*x,L=s-2*o(r(-_.south*x)),Z=_.east*x,G=s-2*o(r(-_.north*x)));let I=e.relativeToCenter,v=l(I);I=v?I:m.ZERO;let P=y(e.includeWebMercatorT,!1),w=y(e.exaggeration,1),F=y(e.exaggerationRelativeHeight,0),R=w!==1,E=y(e.structure,Jf.DEFAULT_STRUCTURE),X=y(E.heightScale,Jf.DEFAULT_STRUCTURE.heightScale),A=y(E.heightOffset,Jf.DEFAULT_STRUCTURE.heightOffset),N=y(E.elementsPerHeight,Jf.DEFAULT_STRUCTURE.elementsPerHeight),O=y(E.stride,Jf.DEFAULT_STRUCTURE.stride),U=y(E.elementMultiplier,Jf.DEFAULT_STRUCTURE.elementMultiplier),Y=y(E.isBigEndian,Jf.DEFAULT_STRUCTURE.isBigEndian),k=ce.computeWidth(_),H=ce.computeHeight(_),J=k/(d-1),te=H/(u-1);g||(k*=x,H*=x);let z=f.radiiSquared,j=z.x,ee=z.y,fe=z.z,Te=65536,de=-65536,xe=vt.eastNorthUpToFixedFrame(I,f),Se=M.inverseTransformation(xe,mrt),Ie,Le;P&&(Ie=Xi.geodeticLatitudeToMercatorAngle(L),Le=1/(Xi.geodeticLatitudeToMercatorAngle(G)-Ie));let ke=hrt;ke.x=Number.POSITIVE_INFINITY,ke.y=Number.POSITIVE_INFINITY,ke.z=Number.POSITIVE_INFINITY;let Be=frt;Be.x=Number.NEGATIVE_INFINITY,Be.y=Number.NEGATIVE_INFINITY,Be.z=Number.NEGATIVE_INFINITY;let it=Number.POSITIVE_INFINITY,Gt=d*u,gt=h>0?d*2+u*2:0,Ne=Gt+gt,Kt=new Array(Ne),Lt=new Array(Ne),ut=new Array(Ne),zn=P?new Array(Ne):[],cn=R?new Array(Ne):[],be=0,Ve=u,bn=0,ht=d;p&&(--be,++Ve,--bn,++ht);let so=1e-5;for(let Qe=be;Qe=u&&(ft=u-1);let Ot=_.north-te*ft;g?Ot=a(Ot):Ot=s-2*o(r(-Ot*x));let Cn=(Ot-L)/(G-L);Cn=W.clamp(Cn,0,1);let Io=Qe===be,So=Qe===Ve-1;h>0&&(Io?Ot+=so*H:So&&(Ot-=so*H));let za=t(Ot),Ka=n(Ot),Ci=fe*Ka,pi;P&&(pi=(Xi.geodeticLatitudeToMercatorAngle(Ot)-Ie)*Le);for(let oa=bn;oa=d&&(zr=d-1);let yl=ft*(d*O)+zr*O,yo;if(N===1)yo=c[yl];else{yo=0;let Mo;if(Y)for(Mo=0;Mo=0;--Mo)yo=yo*U+c[yl+Mo]}yo=yo*X+A,de=Math.max(de,yo),Te=Math.min(Te,yo);let Er=_.west+J*zr;g?Er=a(Er):Er=Er*x;let pp=(Er-V)/(Z-V);pp=W.clamp(pp,0,1);let Kr=ft*d+zr;if(h>0){let Mo=oa===bn,dn=oa===ht-1,Re=Io||So||Mo||dn;if((Io||So)&&(Mo||dn))continue;Re&&(yo-=h,Mo?(Kr=Gt+(u-ft-1),Er-=so*k):So?Kr=Gt+u+(d-zr-1):dn?(Kr=Gt+u+d+ft,Er+=so*k):Io&&(Kr=Gt+u+d+u+zr))}let du=za*t(Er),Ja=za*n(Er),Jy=j*du,ra=ee*Ja,Xc=1/i(Jy*du+ra*Ja+Ci*Ka),cs=Jy*Xc,uu=ra*Xc,mu=Ci*Xc,hu=new m;hu.x=cs+du*yo,hu.y=uu+Ja*yo,hu.z=mu+Ka*yo,M.multiplyByPoint(Se,hu,X4),m.minimumByComponent(X4,ke,ke),m.maximumByComponent(X4,Be,Be),it=Math.min(it,yo),Kt[Kr]=hu,ut[Kr]=new D(pp,Cn),Lt[Kr]=yo,P&&(zn[Kr]=pi),R&&(cn[Kr]=f.geodeticSurfaceNormal(hu))}}let Eo=le.fromPoints(Kt),ia;l(C)&&(ia=Gn.fromRectangle(C,Te,de,f));let Gr;v&&(Gr=new Ab(f).computeHorizonCullingPointPossiblyUnderEllipsoid(I,Kt,Te));let _s=new Y0(ke,Be,I),Fe=new Cc(I,_s,it,de,xe,!1,P,R,w,F),rt=new Float32Array(Ne*Fe.stride),Ke=0;for(let Qe=0;Qe0?L=is.getRegularGridAndSkirtIndicesAndEdgeIndices(V.gridWidth,V.gridHeight):L=is.getRegularGridIndicesAndEdgeIndices(V.gridWidth,V.gridHeight);let Z=V.gridWidth*V.gridHeight;return C._mesh=new dm(h,new Float32Array(V.vertices),L.indices,L.indexCountWithoutSkirts,Z,V.minimumHeight,V.maximumHeight,le.clone(V.boundingSphere3D),m.clone(V.occludeePointInScaledSpace),V.numberOfAttributes,Gn.clone(V.orientedBoundingBox),Cc.clone(V.encoding),L.westIndicesSouthToNorth,L.southIndicesEastToWest,L.eastIndicesNorthToSouth,L.northIndicesWestToEast),C._buffer=void 0,C._mesh})};o0.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(ce.center(d)),h=this._structure,g=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<0?x=is.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=is.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=f.gridWidth*f.gridHeight;return this._mesh=new dm(u,f.vertices,x.indices,x.indexCountWithoutSkirts,_,f.minimumHeight,f.maximumHeight,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};o0.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,h=r.heightScale,p=l(this._mesh),g=this._encoding===cm.LERC;if(!p&&g)return;let x;if(p){let _=this._mesh.vertices,C=this._mesh.encoding;x=K0e(_,C,u,h,e,i,o,t,n)}else x=yrt(this._buffer,a,c,s,d,e,i,o,t,n),x=x*h+u;return x};o0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,d=this._height,u=this._structure,h=u.stride,p=new this._bufferType(c*d*h),g=a.vertices,f=a.encoding,x=e.tileXYToRectangle(t,n,i),_=e.tileXYToRectangle(o,r,s),C=u.heightOffset,V=u.heightScale,L=u.elementsPerHeight,Z=u.elementMultiplier,G=u.isBigEndian,I=Math.pow(Z,L-1);for(let v=0;vu.highestEncodedHeight?u.highestEncodedHeight:b,xrt(p,L,Z,I,h,G,v*c+w,b)}}return Promise.resolve(new o0({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};o0.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<=s&&(g=s-1,p=s-2);let f=h|0,x=f+1;x>=a&&(x=a-1,f=a-2);let _=u-p,C=h-f;f=a-1-f,x=a-1-x;let V=xD(e,t,n,i,o,f*s+p),L=xD(e,t,n,i,o,f*s+g),Z=xD(e,t,n,i,o,x*s+p),G=xD(e,t,n,i,o,x*s+g);return J0e(_,C,V,L,Z,G)}function K0e(e,t,n,i,o,r,s,a,c){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(c-o.south)*(s-1)/(o.north-o.south),h=d|0,p=h+1;p>=r&&(p=r-1,h=r-2);let g=u|0,f=g+1;f>=s&&(f=s-1,g=s-2);let x=d-h,_=u-g;g=s-1-g,f=s-1-f;let C=(t.decodeHeight(e,g*r+h)-n)/i,V=(t.decodeHeight(e,g*r+p)-n)/i,L=(t.decodeHeight(e,f*r+h)-n)/i,Z=(t.decodeHeight(e,f*r+p)-n)/i;return J0e(x,_,C,V,L,Z)}function J0e(e,t,n,i,o,r){return t=0;--a)s=s*n+e[r+a];return s}function xrt(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Ua=o0;function GV(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new zi({ellipsoid:y(e.ellipsoid,ne.default)})),this._levelZeroMaximumGeometricError=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ge}Object.defineProperties(GV.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});GV.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Ua({buffer:new Uint8Array(16*16),width:16,height:16}))};GV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1< 0 uniform sampler2D u_dayTextures[TEXTURE_UNITS]; @@ -7160,7 +10360,7 @@ vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat } #endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var hOt=T(S(),1),xE=`#ifdef QUANTIZATION_BITS12 +`;var eSi=T(S(),1),gw=`#ifdef QUANTIZATION_BITS12 in vec4 compressed0; in float compressed1; #else @@ -7445,7 +10645,7 @@ void main() v_height = height; #endif } -`;var pOt=T(S(),1),qS=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +`;var nSi=T(S(),1),EV=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); @@ -7463,4970 +10663,8 @@ void main() opacity ); } -`;var gOt=T(S(),1),U0=`in vec4 v_color; -in vec4 v_outlineColor; -in float v_innerPercent; -in float v_pixelDistance; -in vec4 v_pickColor; -in float v_splitDirection; - -void main() -{ - if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; - - // The distance in UV space from this fragment to the center of the point, at most 0.5. - float distanceToCenter = length(gl_PointCoord - vec2(0.5)); - // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. - float maxDistance = max(0.0, 0.5 - v_pixelDistance); - float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); - float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); - - vec4 color = mix(v_outlineColor, v_color, innerAlpha); - color.a *= wholeAlpha; - -// Fully transparent parts of the billboard are not pickable. -#if !defined(OPAQUE) && !defined(TRANSLUCENT) - if (color.a < 0.005) // matches 0/255 and 1/255 - { - discard; - } -#else -// The billboard is rendered twice. The opaque pass discards translucent fragments -// and the translucent pass discards opaque fragments. -#ifdef OPAQUE - if (color.a < 0.995) // matches < 254/255 - { - discard; - } -#else - if (color.a >= 0.995) // matches 254/255 and 255/255 - { - discard; - } -#endif -#endif - - out_FragColor = czm_gammaCorrect(color); - czm_writeLogDepth(); -} -`;var xOt=T(S(),1),_E=`uniform float u_maxTotalPointSize; - -in vec4 positionHighAndSize; -in vec4 positionLowAndOutline; -in vec4 compressedAttribute0; // color, outlineColor, pick color -in vec4 compressedAttribute1; // show, translucency by distance, some free space -in vec4 scaleByDistance; // near, nearScale, far, farScale -in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection - -out vec4 v_color; -out vec4 v_outlineColor; -out float v_innerPercent; -out float v_pixelDistance; -out vec4 v_pickColor; -out float v_splitDirection; - -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; - -void main() -{ - // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - - // unpack attributes - vec3 positionHigh = positionHighAndSize.xyz; - vec3 positionLow = positionLowAndOutline.xyz; - float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; - float totalSize = positionHighAndSize.w + outlineWidthBothSides; - float outlinePercent = outlineWidthBothSides / totalSize; - // Scale in response to browser-zoom. - totalSize *= czm_pixelRatio; - - float temp = compressedAttribute1.x * SHIFT_RIGHT8; - float show = floor(temp); - -#ifdef EYE_DISTANCE_TRANSLUCENCY - vec4 translucencyByDistance; - translucencyByDistance.x = compressedAttribute1.z; - translucencyByDistance.z = compressedAttribute1.w; - - translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; - - temp = compressedAttribute1.y * SHIFT_RIGHT8; - translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif - - /////////////////////////////////////////////////////////////////////////// - - vec4 color; - vec4 outlineColor; - vec4 pickColor; - - // compressedAttribute0.z => pickColor.rgb - - temp = compressedAttribute0.z * SHIFT_RIGHT8; - pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor.r = floor(temp); - - // compressedAttribute0.x => color.rgb - - temp = compressedAttribute0.x * SHIFT_RIGHT8; - color.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - color.g = (temp - floor(temp)) * SHIFT_LEFT8; - color.r = floor(temp); - - // compressedAttribute0.y => outlineColor.rgb - - temp = compressedAttribute0.y * SHIFT_RIGHT8; - outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.r = floor(temp); - - // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a - - temp = compressedAttribute0.w * SHIFT_RIGHT8; - pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor = pickColor / 255.0; - - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor /= 255.0; - color.a = floor(temp); - color /= 255.0; - - /////////////////////////////////////////////////////////////////////////// - - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - - /////////////////////////////////////////////////////////////////////////// - -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - // 2D camera distance is a special case - // treat all billboards as flattened to the z=0.0 plane - lengthSq = czm_eyeHeight2D.y; - } - else - { - lengthSq = dot(positionEC.xyz, positionEC.xyz); - } -#endif - -#ifdef EYE_DISTANCE_SCALING - totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); -#endif - if (totalSize > 0.0) { - // Add padding for anti-aliasing on both sides. - totalSize += 3.0; - } - - // Clamp to max point size. - totalSize = min(totalSize, u_maxTotalPointSize); - // If size is too small, push vertex behind near plane for clipping. - // Note that context.minimumAliasedPointSize "will be at most 1.0". - if (totalSize < 1.0) - { - positionEC.xyz = vec3(0.0); - totalSize = 1.0; - } - - float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY - translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); - // push vertex behind near plane for clipping - if (translucency < 0.004) - { - positionEC.xyz = vec3(0.0); - } -#endif - -#ifdef DISTANCE_DISPLAY_CONDITION - float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; - float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; - if (lengthSq < nearSq || lengthSq > farSq) { - // push vertex behind camera to force it to be clipped - positionEC.xyz = vec3(0.0, 0.0, 1.0); - } -#endif - - gl_Position = czm_projection * positionEC; - czm_vertexLogDepth(); - -#ifdef DISABLE_DEPTH_DISTANCE - float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; - if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) - { - disableDepthTestDistance = czm_minimumDisableDepthTestDistance; - } - - if (disableDepthTestDistance != 0.0) - { - // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. - float zclip = gl_Position.z / gl_Position.w; - bool clipped = (zclip < -1.0 || zclip > 1.0); - if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) - { - // Position z on the near plane. - gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH - czm_vertexLogDepth(vec4(czm_currentFrustum.x)); -#endif - } - } -#endif - - v_color = color; - v_color.a *= translucency * show; - v_outlineColor = outlineColor; - v_outlineColor.a *= translucency * show; - - v_innerPercent = 1.0 - outlinePercent; - v_pixelDistance = 2.0 / totalSize; - gl_PointSize = totalSize * show; - gl_Position *= show; - - v_pickColor = pickColor; - v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; -} -`;var TOt=T(S(),1),TE=`in vec2 v_textureCoordinates; - -uniform int u_polygonsLength; -uniform int u_extentsLength; -uniform highp sampler2D u_polygonTexture; -uniform highp sampler2D u_extentsTexture; - -int getPolygonIndex(float dimension, vec2 coord) { - vec2 uv = coord.xy * dimension; - return int(floor(uv.y) * dimension + floor(uv.x)); -} - -vec2 getLookupUv(ivec2 dimensions, int i) { - int pixY = i / dimensions.x; - int pixX = i - (pixY * dimensions.x); - float pixelWidth = 1.0 / float(dimensions.x); - float pixelHeight = 1.0 / float(dimensions.y); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - return vec2(u, v); -} - -vec4 getExtents(int i) { - return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i)); -} - -ivec2 getPositionsLengthAndExtentsIndex(int i) { - vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i); - vec4 value = texture(u_polygonTexture, uv); - return ivec2(int(value.x), int(value.y)); -} - -vec2 getPolygonPosition(int i) { - vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i); - return texture(u_polygonTexture, uv).xy; -} - -vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) { - float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y); - float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x); - return vec2(latitude, longitude); -} - -void main() { - int lastPolygonIndex = 0; - out_FragColor = vec4(1.0); - - // Get the relevant region of the texture - float dimension = float(u_extentsLength); - if (u_extentsLength > 2) { - dimension = ceil(log2(float(u_extentsLength))); - } - int regionIndex = getPolygonIndex(dimension, v_textureCoordinates); - - for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) { - ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex); - int positionsLength = positionsLengthAndExtents.x; - int polygonExtentsIndex = positionsLengthAndExtents.y; - lastPolygonIndex += 1; - - // Only compute signed distance for the relevant part of the atlas - if (polygonExtentsIndex == regionIndex) { - float clipAmount = czm_infinity; - vec4 extents = getExtents(polygonExtentsIndex); - vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension; - vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents); - float s = 1.0; - - // Check each edge for absolute distance - for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) { - vec2 a = getPolygonPosition(lastPolygonIndex + i); - vec2 b = getPolygonPosition(lastPolygonIndex + j); - - vec2 ab = b - a; - vec2 pa = p - a; - float t = dot(pa, ab) / dot(ab, ab); - t = clamp(t, 0.0, 1.0); - - vec2 pq = pa - t * ab; - float d = length(pq); - - // Inside / outside computation to determine sign - bvec3 cond = bvec3(p.y >= a.y, - p.y < b.y, - ab.x * pa.y > ab.y * pa.x); - if (all(cond) || all(not(cond))) s = -s; - if (abs(d) < abs(clipAmount)) { - clipAmount = d; - } - } - - // Normalize the range to [0,1] - vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; - // In the case where we've iterated through multiple polygons, take the minimum - out_FragColor = min(out_FragColor, result); - } - - lastPolygonIndex += positionsLength; - } -}`;var COt=T(S(),1),ud=`void clipLineSegmentToNearPlane( - vec3 p0, - vec3 p1, - out vec4 positionWC, - out bool clipped, - out bool culledByNearPlane, - out vec4 clippedPositionEC) -{ - culledByNearPlane = false; - clipped = false; - - vec3 p0ToP1 = p1 - p0; - float magnitude = length(p0ToP1); - vec3 direction = normalize(p0ToP1); - - // Distance that p0 is behind the near plane. Negative means p0 is - // in front of the near plane. - float endPoint0Distance = czm_currentFrustum.x + p0.z; - - // Camera looks down -Z. - // When moving a point along +Z: LESS VISIBLE - // * Points in front of the camera move closer to the camera. - // * Points behind the camrea move farther away from the camera. - // When moving a point along -Z: MORE VISIBLE - // * Points in front of the camera move farther away from the camera. - // * Points behind the camera move closer to the camera. - - // Positive denominator: -Z, becoming more visible - // Negative denominator: +Z, becoming less visible - // Nearly zero: parallel to near plane - float denominator = -direction.z; - - if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) - { - // p0 is behind the near plane and the line to p1 is nearly parallel to - // the near plane, so cull the segment completely. - culledByNearPlane = true; - } - else if (endPoint0Distance > 0.0) - { - // p0 is behind the near plane, and the line to p1 is moving distinctly - // toward or away from it. - - // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) - float t = endPoint0Distance / denominator; - if (t < 0.0 || t > magnitude) - { - // Near plane intersection is not between the two points. - // We already confirmed p0 is behind the naer plane, so now - // we know the entire segment is behind it. - culledByNearPlane = true; - } - else - { - // Segment crosses the near plane, update p0 to lie exactly on it. - p0 = p0 + t * direction; - - // Numerical noise might put us a bit on the wrong side of the near plane. - // Don't let that happen. - p0.z = min(p0.z, -czm_currentFrustum.x); - - clipped = true; - } - } - - clippedPositionEC = vec4(p0, 1.0); - positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); -} - -vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) -{ - // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. - -#ifdef POLYLINE_DASH - // Compute the window coordinates of the points. - vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); - vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); - vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); - - // Determine the relative screen space direction of the line. - vec2 lineDir; - if (usePrevious) { - lineDir = normalize(positionWindow.xy - previousWindow.xy); - } - else { - lineDir = normalize(nextWindow.xy - positionWindow.xy); - } - angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) - - // Quantize the angle so it doesn't change rapidly between segments. - angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; -#endif - - vec4 clippedPrevWC, clippedPrevEC; - bool prevSegmentClipped, prevSegmentCulled; - clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); - - vec4 clippedNextWC, clippedNextEC; - bool nextSegmentClipped, nextSegmentCulled; - clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); - - bool segmentClipped, segmentCulled; - vec4 clippedPositionWC, clippedPositionEC; - clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); - - if (segmentCulled) - { - return vec4(0.0, 0.0, 0.0, 1.0); - } - - vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); - vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); - - // If a segment was culled, we can't use the corresponding direction - // computed above. We should never see both of these be true without - // \`segmentCulled\` above also being true. - if (prevSegmentCulled) - { - directionToPrevWC = -directionToNextWC; - } - else if (nextSegmentCulled) - { - directionToNextWC = -directionToPrevWC; - } - - vec2 thisSegmentForwardWC, otherSegmentForwardWC; - if (usePrevious) - { - thisSegmentForwardWC = -directionToPrevWC; - otherSegmentForwardWC = directionToNextWC; - } - else - { - thisSegmentForwardWC = directionToNextWC; - otherSegmentForwardWC = -directionToPrevWC; - } - - vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); - - vec2 leftWC = thisSegmentLeftWC; - float expandWidth = width * 0.5; - - // When lines are split at the anti-meridian, the position may be at the - // same location as the next or previous position, and we need to handle - // that to avoid producing NaNs. - if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) - { - vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); - - vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; - float leftSumLength = length(leftSumWC); - leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); - - // The sine of the angle between the two vectors is given by the formula - // |a x b| = |a||b|sin(theta) - // which is - // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); - // Because the z components of both vectors are zero, the x and y coordinate will be zero. - // Therefore, the sine of the angle is just the z component of the cross product. - vec2 u = -thisSegmentForwardWC; - vec2 v = leftWC; - float sinAngle = abs(u.x * v.y - u.y * v.x); - expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); - } - - vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; - return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; -} - -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) -{ - vec4 positionEC = czm_modelViewRelativeToEye * position; - vec4 prevEC = czm_modelViewRelativeToEye * previous; - vec4 nextEC = czm_modelViewRelativeToEye * next; - return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); -} -`;var LOt=T(S(),1),Tx=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif - -in vec2 v_st; - -void main() -{ - czm_materialInput materialInput; - - vec2 st = v_st; - st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); - - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = vec3(st, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#ifdef VECTOR_TILE - out_FragColor *= u_highlightColor; -#endif - - czm_writeLogDepth(); -} -`;var ZOt=T(S(),1),SE=`in vec4 v_startPlaneNormalEcAndHalfWidth; -in vec4 v_endPlaneNormalEcAndBatchId; -in vec4 v_rightPlaneEC; // Technically can compute distance for this here -in vec4 v_endEcAndStartEcX; -in vec4 v_texcoordNormalizationAndStartEcYZ; - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif - -void main(void) -{ - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); - - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; - - float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); - - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - // Check distance of the eye coordinate against start and end planes with normals in the right plane. - // For computing unskewed lengthwise texture coordinate. - // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. - - // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" - vec3 alignedPlaneNormal; - - // start aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); - - // end aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); - -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Clamp - distance to aligned planes may be negative due to mitering, - // so fragment texture coordinate might be out-of-bounds. - float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); - s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; - float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); - - czm_materialInput materialInput; - - materialInput.s = s; - materialInput.st = vec2(s, t); - materialInput.str = vec3(s, t, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - - czm_writeDepthClamp(); -} -`;var EOt=T(S(),1),CE=`in vec3 v_forwardDirectionEC; -in vec3 v_texcoordNormalizationAndHalfWidth; -in float v_batchId; - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#else -in vec2 v_alignedPlaneDistances; -in float v_texcoordT; -#endif - -float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { - // We don't expect the ray to ever be parallel to the plane - return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); -} - -void main(void) -{ - vec4 eyeCoordinate = gl_FragCoord; - eyeCoordinate /= eyeCoordinate.w; - -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Use distances for planes aligned with segment to prevent skew in dashing - float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); - float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); - - // Clamp - distance to aligned planes may be negative due to mitering - distanceFromStart = max(0.0, distanceFromStart); - distanceFromEnd = max(0.0, distanceFromEnd); - - float s = distanceFromStart / (distanceFromStart + distanceFromEnd); - s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; - - czm_materialInput materialInput; - - materialInput.s = s; - materialInput.st = vec2(s, v_texcoordT); - materialInput.str = vec3(s, v_texcoordT, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR -} -`;var XOt=T(S(),1),VE=`in vec3 position3DHigh; -in vec3 position3DLow; - -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; - -in float batchId; - -out vec3 v_forwardDirectionEC; -out vec3 v_texcoordNormalizationAndHalfWidth; -out float v_batchId; - -// For materials -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#else -out vec2 v_alignedPlaneDistances; -out float v_texcoordT; -#endif - -// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. -// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. -void main() -{ - v_batchId = batchId; - - // Start position - vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); - vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); - vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - - // Start plane - vec4 startPlane2D; - vec4 startPlane3D; - startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); - startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); - - // Right plane - vec4 rightPlane2D; - vec4 rightPlane3D; - rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); - rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); - - // End position - posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); - posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); - posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); - vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); - - // End plane - vec4 endPlane2D; - vec4 endPlane3D; - endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); - endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); - - // Forward direction - v_forwardDirectionEC = normalize(endEC - startEC); - - vec2 cleanTexcoordNormalization2D; - cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); - cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); - vec2 cleanTexcoordNormalization3D; - cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; - cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); - - v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#else // PER_INSTANCE_COLOR - // For computing texture coordinates - - v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); - v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); -#endif // PER_INSTANCE_COLOR - -#ifdef WIDTH_VARYING - float width = czm_batchTable_width(batchId); - float halfWidth = width * 0.5; - v_width = width; - v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#else - float halfWidth = 0.5 * czm_batchTable_width(batchId); - v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#endif - - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - // Since this is morphing, compute both 3D and 2D positions and then blend. - - // ****** 3D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); - vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Nudge the top vertex upwards to prevent flickering - vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); - geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc3D.xyz += geodeticSurfaceNormal; - - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); - - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - - // ****** 2D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition - absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); - absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); - planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); - upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Nudge the top vertex upwards to prevent flickering - geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); - geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc2D.xyz += geodeticSurfaceNormal; - - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(texcoordNormalization2D.x); -#ifndef PER_INSTANCE_COLOR - // Use vertex's sidedness to compute its texture coordinate. - v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); -#endif - - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - - // Blend for actual position - gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); - -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var POt=T(S(),1),LE=`in vec3 position3DHigh; -in vec3 position3DLow; - -// In 2D and in 3D, texture coordinate normalization component signs encodes: -// * X sign - sidedness relative to right plane -// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume -#ifndef COLUMBUS_VIEW_2D -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -#else -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -#endif - -in float batchId; - -out vec4 v_startPlaneNormalEcAndHalfWidth; -out vec4 v_endPlaneNormalEcAndBatchId; -out vec4 v_rightPlaneEC; -out vec4 v_endEcAndStartEcX; -out vec4 v_texcoordNormalizationAndStartEcYZ; - -// For materials -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif - -void main() -{ -#ifdef COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; - - vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); - vec3 ecEnd = forwardDirectionEC + ecStart; - forwardDirectionEC = normalize(forwardDirectionEC); - - // Right plane - v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - - v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); - v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; - -#else // COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; - vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); - vec3 ecEnd = ecStart + offset; - - vec3 forwardDirectionEC = normalize(offset); - - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - - // Right plane - v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - - v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; - -#endif // COLUMBUS_VIEW_2D - - v_endEcAndStartEcX.xyz = ecEnd; - v_endEcAndStartEcX.w = ecStart.x; - v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif // PER_INSTANCE_COLOR - - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - vec4 positionRelativeToEye = czm_computePosition(); - - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); - vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Extrude bottom vertices downward for far view distances, like for GroundPrimitives - upOrDown = cross(forwardDirectionEC, normalEC); - upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; - upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; - upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; - positionEC.xyz += upOrDown; - - v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); - - // Determine distance along normalEC to push for a volume of appropriate width. - // Make volumes about double pixel width for a conservative fit - in practice the - // extra cost here is minimal compared to the loose volume heights. - // - // N = normalEC (guaranteed "right-facing") - // R = rightEC - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - float width = czm_batchTable_width(batchId); -#ifdef WIDTH_VARYING - v_width = width; -#endif - - v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; - v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; - - v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; - v_endPlaneNormalEcAndBatchId.w = batchId; - - width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R - width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N - - // Determine if this vertex is on the "left" or "right" -#ifdef COLUMBUS_VIEW_2D - normalEC *= sign(texcoordNormalization2D.x); -#else - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); -#endif - - positionEC.xyz += width * normalEC; - gl_Position = czm_depthClamp(czm_projection * positionEC); - -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var wOt=T(S(),1),RE=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 position2DHigh; -in vec3 position2DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 prevPosition2DHigh; -in vec3 prevPosition2DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec3 nextPosition2DHigh; -in vec3 nextPosition2DLow; -in vec4 texCoordExpandAndBatchIndex; - -out vec2 v_st; -out float v_width; -out vec4 v_pickColor; -out float v_polylineAngle; - -void main() -{ - float texCoord = texCoordExpandAndBatchIndex.x; - float expandDir = texCoordExpandAndBatchIndex.y; - bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; - float batchTableIndex = texCoordExpandAndBatchIndex.w; - - vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); - float width = widthAndShow.x + 0.5; - float show = widthAndShow.y; - - if (width < 1.0) - { - show = 0.0; - } - - vec4 pickColor = batchTable_getPickColor(batchTableIndex); - - vec4 p, prev, next; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); - prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); - next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); - prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); - next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), - czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), - czm_morphTime); - prev = czm_columbusViewMorph( - czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), - czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), - czm_morphTime); - next = czm_columbusViewMorph( - czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), - czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), - czm_morphTime); - } - - #ifdef DISTANCE_DISPLAY_CONDITION - vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); - vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); - vec3 centerLow = centerLowAndRadius.xyz; - float radius = centerLowAndRadius.w; - vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); - - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - lengthSq = czm_eyeHeight2D.y; - } - else - { - vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); - lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); - } - - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - if (lengthSq < nearSq || lengthSq > farSq) - { - show = 0.0; - } - #endif - - float polylineAngle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); - gl_Position = czm_viewportOrthographic * positionWC * show; - - v_st.s = texCoord; - v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); - - v_width = width; - v_pickColor = pickColor; - v_polylineAngle = polylineAngle; -} -`;var AOt=T(S(),1),ZE=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(u_texture, v_textureCoordinates); -} -`;var NOt=T(S(),1),GE=`in vec4 position; -in float webMercatorT; - -uniform vec2 u_textureDimensions; - -out vec2 v_textureCoordinates; - -void main() -{ - v_textureCoordinates = vec2(position.x, webMercatorT); - gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); -} -`;var UOt=T(S(),1),$S=`#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -in vec4 v_sphericalExtents; -#else // SPHERICAL -in vec2 v_inversePlaneExtents; -in vec4 v_westPlane; -in vec4 v_southPlane; -#endif // SPHERICAL -in vec3 v_uvMinAndSphericalLongitudeRotation; -in vec3 v_uMaxAndInverseDistance; -in vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif - -#ifdef NORMAL_EC -vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); - return eyeCoordinate.xyz / eyeCoordinate.w; -} - -vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { - vec2 glFragCoordXY = gl_FragCoord.xy; - // Sample depths at both offset and negative offset - float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); - float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); - // Explicitly evaluate both paths - // Necessary for multifrustum and for edges of the screen - bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); - float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); - float useDownOrLeft = float(useUpOrRight == 0.0); - vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); - vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); - return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; -} -#endif // NORMAL_EC - -void main(void) -{ -#ifdef REQUIRES_EC - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -#endif - -#ifdef REQUIRES_WC - vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; - vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; -#endif - -#ifdef TEXTURE_COORDINATES - vec2 uv; -#ifdef SPHERICAL - // Treat world coords as a sphere normal for spherical coordinates - vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); - sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; - sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); - uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; - uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; -#else // SPHERICAL - // Unpack planes and transform to eye space - uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; - uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; -#endif // SPHERICAL -#endif // TEXTURE_COORDINATES - -#ifdef PICK -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - // Check for logDepthOrDepth != 0.0 to make sure this should be classified. - if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { - out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource - czm_writeDepthClamp(); - } -#else // CULL_FRAGMENTS - out_FragColor.a = 1.0; -#endif // CULL_FRAGMENTS -#else // PICK - -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { - discard; - } -#endif - -#ifdef NORMAL_EC - // Compute normal by sampling adjacent pixels in 2x2 block in screen space - vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); - vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); - vec3 normalEC = normalize(cross(leftRight, downUp)); -#endif - - -#ifdef PER_INSTANCE_COLOR - - vec4 color = czm_gammaCorrect(v_color); -#ifdef FLAT - out_FragColor = color; -#else // FLAT - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = -eyeCoordinate.xyz; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - -#else // PER_INSTANCE_COLOR - - // Material support. - // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or - // dependencies for culling but might not actually be used by the material. - - czm_materialInput materialInput; - -#ifdef USES_NORMAL_EC - materialInput.normalEC = normalEC; -#endif - -#ifdef USES_POSITION_TO_EYE_EC - materialInput.positionToEyeEC = -eyeCoordinate.xyz; -#endif - -#ifdef USES_TANGENT_TO_EYE - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); -#endif - -#ifdef USES_ST - // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired - // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. - // Shader is provided a set of reference points for remapping. - materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; - materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; -#endif - - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else // FLAT - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - -#endif // PER_INSTANCE_COLOR - czm_writeDepthClamp(); -#endif // PICK -} -`;var BOt=T(S(),1),EE=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; - -#ifdef EXTRUDED_GEOMETRY -in vec3 extrudeDirection; - -uniform float u_globeMinimumAltitude; -#endif // EXTRUDED_GEOMETRY - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif // PER_INSTANCE_COLOR - -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -out vec4 v_sphericalExtents; -#else // SPHERICAL -out vec2 v_inversePlaneExtents; -out vec4 v_westPlane; -out vec4 v_southPlane; -#endif // SPHERICAL -out vec3 v_uvMinAndSphericalLongitudeRotation; -out vec3 v_uMaxAndInverseDistance; -out vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES - -void main() -{ - vec4 position = czm_computePosition(); - -#ifdef EXTRUDED_GEOMETRY - float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); - delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; - - //extrudeDirection is zero for the top layer - position = position + vec4(extrudeDirection * delta, 0.0); -#endif - -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL - v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); - v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); -#else // SPHERICAL -#ifdef COLUMBUS_VIEW_2D - vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); - vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); - - // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): - // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) - // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) - // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) - vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); - bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; - planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); - planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); - - // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) - // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) - // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) - idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; - idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); - planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); - planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); - - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; - vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; - vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; -#else // COLUMBUS_VIEW_2D - // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; - vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; - vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; -#endif // COLUMBUS_VIEW_2D - - vec3 eastWard = southEastCorner - southWestCorner; - float eastExtent = length(eastWard); - eastWard /= eastExtent; - - vec3 northWard = northWestCorner - southWestCorner; - float northExtent = length(northWard); - northWard /= northExtent; - - v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); - v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); - v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); -#endif // SPHERICAL - vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); - vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); - - v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); - v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); - v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; -#endif // TEXTURE_COORDINATES - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif - - gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); -} -`;var YOt=T(S(),1),D0=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif - -void main(void) -{ -#ifdef VECTOR_TILE - out_FragColor = czm_gammaCorrect(u_highlightColor); -#else - out_FragColor = vec4(1.0); -#endif - czm_writeDepthClamp(); -} -`;var zOt=T(S(),1),eC=`float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); -} - -void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) -{ - float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; - - // Adjustment to the atmosphere radius applied based on the camera height. - float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; - float distanceAdjustMax = czm_ellipsoidRadii.x; - float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; - float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); - - // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit - // for the position on the ellipsoid. - float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; - float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; - - // Setup the primary ray: from the camera position to the vertex position. - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); - - underTranslucentGlobe = 0.0; - - // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. - #if defined(GLOBE_TRANSLUCENT) - - // Check for intersection with the inner radius of the atmopshere. - czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); - if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { - - // Compute position on globe. - vec3 direction = normalize(positionWC); - czm_ray ellipsoidRay = czm_ray(positionWC, -direction); - czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); - vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); - - // Control the color using the camera angle. - float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); - - // Control the opacity using the distance from Earth. - opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); - vec3 horizonColor = vec3(0.1, 0.2, 0.3); - vec3 nearColor = vec3(0.0); - - rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); - - // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. - underTranslucentGlobe = 1.0; - return; - } - #endif - - computeScattering( - primaryRay, - length(cameraToPositionWC), - lightDirection, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); - - // Alter the opacity based on how close the viewer is to the ground. - // (0.0 = At edge of atmosphere, 1.0 = On ground) - float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; - float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; - opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); - - // Alter alpha based on time of day (0.0 = night , 1.0 = day) - float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; - opacity *= pow(nightAlpha, 0.5); -} -`;var JOt=T(S(),1),IE=`in vec3 v_outerPositionWC; - -uniform vec3 u_hsbShift; - -#ifndef PER_FRAGMENT_ATMOSPHERE -in vec3 v_mieColor; -in vec3 v_rayleighColor; -in float v_opacity; -in float v_translucent; -#endif - -void main (void) -{ - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum); - - vec3 mieColor; - vec3 rayleighColor; - float opacity; - float translucent; - - #ifdef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - v_outerPositionWC, - lightDirection, - rayleighColor, - mieColor, - opacity, - translucent - ); - #else - mieColor = v_mieColor; - rayleighColor = v_rayleighColor; - opacity = v_opacity; - translucent = v_translucent; - #endif - - vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); - - #ifndef HDR - color.rgb = czm_pbrNeutralTonemapping(color.rgb); - color.rgb = czm_inverseGamma(color.rgb); - #endif - - #ifdef COLOR_CORRECT - const bool ignoreBlackPixels = true; - color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels); - #endif - - // For the parts of the sky atmosphere that are not behind a translucent globe, - // we mix in the default opacity so that the sky atmosphere still appears at distance. - // This is needed because the opacity in the sky atmosphere is initially adjusted based - // on the camera height. - if (translucent == 0.0) { - color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); - } - - out_FragColor = color; -} -`;var jOt=T(S(),1),XE=`in vec4 position; - -out vec3 v_outerPositionWC; - -#ifndef PER_FRAGMENT_ATMOSPHERE -out vec3 v_mieColor; -out vec3 v_rayleighColor; -out float v_opacity; -out float v_translucent; -#endif - -void main(void) -{ - vec4 positionWC = czm_model * position; - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum); - - #ifndef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - positionWC.xyz, - lightDirection, - v_rayleighColor, - v_mieColor, - v_opacity, - v_translucent - ); - #endif - - v_outerPositionWC = positionWC.xyz; - gl_Position = czm_modelViewProjection * position; -} -`;var $Ot=T(S(),1),WE=`uniform samplerCube u_cubeMap; - -in vec3 v_texCoord; - -void main() -{ - vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); - out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); -} -`;var tYt=T(S(),1),PE=`in vec3 position; -out vec3 v_texCoord; - -void main() -{ - vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); - gl_Position = czm_projection * vec4(p, 1.0); - v_texCoord = position.xyz; -} -`;var iYt=T(S(),1),vE=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 color = texture(u_texture, v_textureCoordinates); - out_FragColor = czm_gammaCorrect(color); -} -`;var rYt=T(S(),1),wE=`uniform float u_radiusTS; - -in vec2 v_textureCoordinates; - -vec2 rotate(vec2 p, vec2 direction) -{ - return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); -} - -vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) -{ - vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); - float radius = length(rotatedPosition) * lengthScalar; - float burst = 1.0 - smoothstep(0.0, 0.55, radius); - return vec4(burst); -} - -void main() -{ - float lengthScalar = 2.0 / sqrt(2.0); - vec2 position = v_textureCoordinates - vec2(0.5); - float radius = length(position) * lengthScalar; - float surface = step(radius, u_radiusTS); - vec4 color = vec4(vec2(1.0), surface + 0.2, surface); - - float glow = 1.0 - smoothstep(0.0, 0.55, radius); - color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; - - vec4 burst = vec4(0.0); - - // The following loop has been manually unrolled for speed, to - // avoid sin() and cos(). - // - //for (float i = 0.4; i < 3.2; i += 1.047) { - // vec2 direction = vec2(sin(i), cos(i)); - // burst += 0.4 * addBurst(position, direction, lengthScalar); - // - // direction = vec2(sin(i - 0.08), cos(i - 0.08)); - // burst += 0.3 * addBurst(position, direction, lengthScalar); - //} - - burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 - burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 - burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - - burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 - - // End of manual loop unrolling. - - color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; - - out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); -} -`;var aYt=T(S(),1),FE=`in vec2 direction; - -uniform float u_size; - -out vec2 v_textureCoordinates; - -void main() -{ - vec4 position; - if (czm_morphTime == 1.0) - { - position = vec4(czm_sunPositionWC, 1.0); - } - else - { - position = vec4(czm_sunPositionColumbusView.zxy, 1.0); - } - - vec4 positionEC = czm_view * position; - vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - - vec2 halfSize = vec2(u_size * 0.5); - halfSize *= ((direction * 2.0) - 1.0); - - gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); - - v_textureCoordinates = direction; -} -`;var lYt=T(S(),1),AE=`in vec4 v_startPlaneEC; -in vec4 v_endPlaneEC; -in vec4 v_rightPlaneEC; -in float v_halfWidth; -in vec3 v_volumeUpEC; - -uniform vec4 u_highlightColor; -void main() -{ - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; - - float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); - - // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction - halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); - - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); - - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - out_FragColor = u_highlightColor; - - czm_writeDepthClamp(); -} -`;var uYt=T(S(),1),ME=`in vec3 startEllipsoidNormal; -in vec3 endEllipsoidNormal; -in vec4 startPositionAndHeight; -in vec4 endPositionAndHeight; -in vec4 startFaceNormalAndVertexCorner; -in vec4 endFaceNormalAndHalfWidth; -in float a_batchId; - -uniform mat4 u_modifiedModelView; -uniform vec2 u_minimumMaximumVectorHeights; - -out vec4 v_startPlaneEC; -out vec4 v_endPlaneEC; -out vec4 v_rightPlaneEC; -out float v_halfWidth; -out vec3 v_volumeUpEC; - -void main() -{ - // vertex corner IDs - // 3-----------7 - // /| left /| - // / | 1 / | - // 2-----------6 5 end - // | / | / - // start |/ right |/ - // 0-----------4 - // - float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end - float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top - - vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; - vec3 right = normalize(cross(forward, startEllipsoidNormal)); - - vec4 position = vec4(startPositionAndHeight.xyz, 1.0); - position.xyz += forward * isEnd; - - v_volumeUpEC = czm_normal * normalize(cross(right, forward)); - - // Push for volume height - float offset; - vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); - - // offset height to create volume - offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); - offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; - position.xyz += offset * ellipsoidNormal; - - // move from RTC to EC - position = u_modifiedModelView * position; - right = czm_normal * right; - - // Push for width in a direction that is in the start or end plane and in a plane with right - // N = normalEC ("right-facing" direction for push) - // R = right - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); - scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); - vec3 miterPushNormal = czm_normal * normalize(scratchNormal); - - offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC - offset = offset / dot(miterPushNormal, right); - position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); - - gl_Position = czm_depthClamp(czm_projection * position); - - position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); - vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; - v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); - v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); - - position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); - vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; - v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); - v_halfWidth = endFaceNormalAndHalfWidth.w; -} -`;var hYt=T(S(),1),NE=`in vec4 currentPosition; -in vec4 previousPosition; -in vec4 nextPosition; -in vec2 expandAndWidth; -in float a_batchId; - -uniform mat4 u_modifiedModelView; - -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; - - vec4 p = u_modifiedModelView * currentPosition; - vec4 prev = u_modifiedModelView * previousPosition; - vec4 next = u_modifiedModelView * nextPosition; - - float angle; - vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; -} -`;var pYt=T(S(),1),tC=`in vec3 position; -in float a_batchId; - -uniform mat4 u_modifiedModelViewProjection; - -void main() -{ - gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;var gYt=T(S(),1),kE=` -in vec2 v_textureCoordinates; - -void main() -{ - czm_materialInput materialInput; - - materialInput.s = v_textureCoordinates.s; - materialInput.st = v_textureCoordinates; - materialInput.str = vec3(v_textureCoordinates, 0.0); - materialInput.normalEC = vec3(0.0, 0.0, -1.0); - - czm_material material = czm_getMaterial(materialInput); - - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -} -`;var WYt=T(S(),1);var RYt=T(S(),1);var TYt=T(S(),1);function B0(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(B0.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});B0.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};B0.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};B0.prototype.equals=function(e){return this===e||e instanceof B0&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};B0.prototype.valueOf=function(){return this._value};B0.prototype.toString=function(){return String(this._value)};var Jn=B0;function iIe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function oIe(e){return new Jn(e)}function rIe(e,t,n){return iIe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,oIe))}var ue=rIe;function UE(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(UE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),image:ue("image"),scale:ue("scale"),pixelOffset:ue("pixelOffset"),eyeOffset:ue("eyeOffset"),horizontalOrigin:ue("horizontalOrigin"),verticalOrigin:ue("verticalOrigin"),heightReference:ue("heightReference"),color:ue("color"),rotation:ue("rotation"),alignedAxis:ue("alignedAxis"),sizeInMeters:ue("sizeInMeters"),width:ue("width"),height:ue("height"),scaleByDistance:ue("scaleByDistance"),translucencyByDistance:ue("translucencyByDistance"),pixelOffsetScaleByDistance:ue("pixelOffsetScaleByDistance"),imageSubRegion:ue("imageSubRegion"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance"),splitDirection:ue("splitDirection")});UE.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new UE(this)};UE.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var ic=UE;var THt=T(S(),1);var wYt=T(S(),1);function Sx(){this._array=[],this._hash={}}Object.defineProperties(Sx.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Sx.prototype.contains=function(e){return l(this._hash[e])};Sx.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Sx.prototype.get=function(e){return this._hash[e]};Sx.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};Sx.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Zt=Sx;var NYt=T(S(),1);function md(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(md.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});md.packedLength=2;md.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};md.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new md),n.near=e[t++],n.far=e[t],n};md.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};md.clone=function(e,t){if(l(e))return l(t)||(t=new md),t.near=e.near,t.far=e.far,t};md.prototype.clone=function(e){return md.clone(this,e)};md.prototype.equals=function(e){return md.equals(this,e)};var Ft=md;var BYt=T(S(),1);function Su(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}Su.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Su(e.near,e.nearValue,e.far,e.farValue)};Su.packedLength=4;Su.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Su.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Su),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Su.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Su.prototype.clone=function(e){return Su.clone(this,e)};Su.prototype.equals=function(e){return Su.equals(this,e)};var kt=Su;var YYt=T(S(),1),Cx={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},Je=Object.freeze(Cx);function Cu(e){return e===Cx.CLAMP_TO_GROUND||e===Cx.CLAMP_TO_3D_TILE||e===Cx.CLAMP_TO_TERRAIN}function nC(e){return e===Cx.RELATIVE_TO_GROUND||e===Cx.RELATIVE_TO_3D_TILE||e===Cx.RELATIVE_TO_TERRAIN}var zYt=T(S(),1),sIe={CENTER:0,LEFT:1,RIGHT:-1},gi=Object.freeze(sIe);var JYt=T(S(),1),aIe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Pn=Object.freeze(aIe);var jYt=T(S(),1),cIe={DONE:0,PENDING:1,FAILED:2},dt=Object.freeze(cIe);var nHt=T(S(),1);function vm(){pe.throwInstantiationError()}Object.defineProperties(vm.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});vm.prototype.getValue=pe.throwInstantiationError;vm.prototype.equals=pe.throwInstantiationError;vm.equals=function(e,t){return e===t||l(e)&&e.equals(t)};vm.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new Mte(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Mte(r)):(TY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],TY(s.get(r.id),r,a),s.remove(r.id)};function TY(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var DE=O0;var Min=T(S(),1);var PHt=T(S(),1);var IIe=new m;function cf(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}cf.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=m.multiplyByScalar(t,.5,new m);return new cf({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};cf.fromAxisAlignedBoundingBox=function(e){return new cf({minimum:e.minimum,maximum:e.maximum})};cf.packedLength=2*m.packedLength+1;cf.pack=function(e,t,n){return n=y(n,0),m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=y(e._offsetAttribute,-1),t};var kte=new m,Ute=new m,Nte={minimum:kte,maximum:Ute,offsetAttribute:void 0};cf.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,kte),o=m.unpack(e,t+m.packedLength,Ute),r=e[t+m.packedLength*2];return l(n)?(n._min=m.clone(i,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Nte.offsetAttribute=r===-1?void 0:r,new cf(Nte))};cf.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new hn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=m.subtract(n,t,IIe),a=m.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,d=e._offsetAttribute===cn.NONE?0:1,u=new Uint8Array(c/3).fill(d);i.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new lt({attributes:i,indices:o,primitiveType:we.LINES,boundingSphere:new le(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var wm=cf;var NHt=T(S(),1);function iC(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([B.floatToByte(e),B.floatToByte(t),B.floatToByte(n),B.floatToByte(i)])}Object.defineProperties(iC.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});iC.fromColor=function(e){return new iC(e.red,e.green,e.blue,e.alpha)};iC.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};iC.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Ht=iC;var OHt=T(S(),1);function BE(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(BE.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});BE.fromDistanceDisplayCondition=function(e){return new BE(e.near,e.far)};BE.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Nn=BE;var KHt=T(S(),1);function XIe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Gt=XIe;var ozt=T(S(),1);var ezt=T(S(),1);function jo(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?q.clone(e.start):new q,this.stop=l(e.stop)?q.clone(e.stop):new q,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(jo.prototype,{isEmpty:{get:function(){let e=q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var oC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};jo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new pe("options.iso8601 is an invalid ISO 8601 interval.");let i=q.fromIso8601(n[0]),o=q.fromIso8601(n[1]),r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(oC.start=i,oC.stop=o,oC.isStartIncluded=r,oC.isStopIncluded=s,oC.data=a,new jo(oC))};jo.toIso8601=function(e,t){return`${q.toIso8601(e.start,t)}/${q.toIso8601(e.stop,t)}`};jo.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new jo(e)};jo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&q.equals(e.start,t.start)&&q.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};jo.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&q.equalsEpsilon(e.start,t.start,n)&&q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};jo.intersect=function(e,t,n,i){if(!l(t))return jo.clone(jo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=q.greaterThanOrEquals(s,o)&&q.greaterThanOrEquals(r,s),d=!c&&q.lessThanOrEquals(s,o)&&q.lessThanOrEquals(o,a);if(!c&&!d)return jo.clone(jo.EMPTY,n);let u=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,f=q.lessThan(r,a);return l(n)||(n=new jo),n.start=c?s:o,n.isStartIncluded=u&&p||!q.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?h:h&&g||!q.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};jo.contains=function(e,t){if(e.isEmpty)return!1;let n=q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};jo.prototype.clone=function(e){return jo.clone(this,e)};jo.prototype.equals=function(e,t){return jo.equals(this,e,t)};jo.prototype.equalsEpsilon=function(e,t,n){return jo.equalsEpsilon(this,e,t,n)};jo.prototype.toString=function(){return jo.toIso8601(this)};jo.EMPTY=Object.freeze(new jo({start:new q,stop:new q,isStartIncluded:!1,isStopIncluded:!1}));var Ln=jo;var Dte=Object.freeze(q.fromIso8601("0000-01-01T00:00:00Z")),Bte=Object.freeze(q.fromIso8601("9999-12-31T24:00:00Z")),WIe=Object.freeze(new Ln({start:Dte,stop:Bte})),PIe={MINIMUM_VALUE:Dte,MAXIMUM_VALUE:Bte,MAXIMUM_INTERVAL:WIe},Oe=PIe;var lzt=T(S(),1);function OE(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(OE.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});OE.fromCartesian3=function(e){return new OE(e.x,e.y,e.z)};OE.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var qi=OE;var fzt=T(S(),1);function DN(e){e=y(e,!0),this.value=DN.toValue(e)}Object.defineProperties(DN.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});DN.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var xn=DN;var EJt=T(S(),1);var bzt=T(S(),1),YE=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = tangentToEyeMatrix; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var yzt=T(S(),1),HE=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec3 tangent; -in vec3 bitangent; -in vec2 st; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec3 v_tangentEC; -out vec3 v_bitangentEC; -out vec2 v_st; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_tangentEC = czm_normal * tangent; // tangent in eye coordinates - v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var _zt=T(S(),1),zE=`in vec3 v_positionEC; -in vec3 v_normalEC; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var Szt=T(S(),1),KE=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var Vzt=T(S(),1),JE=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var Rzt=T(S(),1),QE=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec2 st; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec2 v_st; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var zzt=T(S(),1);var Fzt=T(S(),1);var Ezt=T(S(),1);var vIe={ADD:ie.FUNC_ADD,SUBTRACT:ie.FUNC_SUBTRACT,REVERSE_SUBTRACT:ie.FUNC_REVERSE_SUBTRACT,MIN:ie.MIN,MAX:ie.MAX},Ea=Object.freeze(vIe);var Wzt=T(S(),1);var wIe={ZERO:ie.ZERO,ONE:ie.ONE,SOURCE_COLOR:ie.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ie.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ie.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ie.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ie.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ie.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ie.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ie.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ie.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ie.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ie.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ie.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ie.SRC_ALPHA_SATURATE},Co=Object.freeze(wIe);var FIe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ea.ADD,equationAlpha:Ea.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ea.ADD,equationAlpha:Ea.ADD,functionSourceRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Ea.ADD,equationAlpha:Ea.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE,functionDestinationAlpha:Co.ONE})},mn=Object.freeze(FIe);var Nzt=T(S(),1);var AIe={FRONT:ie.FRONT,BACK:ie.BACK,FRONT_AND_BACK:ie.FRONT_AND_BACK},yi=Object.freeze(AIe);function rC(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(rC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});rC.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};rC.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};rC.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=mn.ALPHA_BLEND):t.depthMask=!0,t};rC.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=mn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:yi.BACK}),l(n)&&(i=St(n,i,!0)),i};var no=rC;var bJt=T(S(),1);var Jzt=T(S(),1),jE=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var jzt=T(S(),1),qE=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - vec2 centerPixel = fract(repeat * st); - float centerBump = texture(image, centerPixel).channel; - - float imageWidth = float(imageDimensions.x); - vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); - float rightBump = texture(image, rightPixel).channel; - - float imageHeight = float(imageDimensions.y); - vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); - float topBump = texture(image, leftPixel).channel; - - vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - material.diffuse = vec3(0.01); - - return material; -} -`;var $zt=T(S(),1),$E=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 - - // Find the distance from the closest separator (region between two colors) - float scaledWidth = fract(repeat.s * st.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(repeat.t * st.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - float value = min(scaledWidth, scaledHeight); - - vec4 currentColor = mix(lightColor, darkColor, b); - vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); - - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var tKt=T(S(),1),eI=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 - - vec4 color = mix(lightColor, darkColor, b); - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var iKt=T(S(),1),tI=`uniform sampler2D heights; -uniform sampler2D colors; - -// This material expects heights to be sorted from lowest to highest. - -float getHeight(int idx, float invTexSize) -{ - vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); -#ifdef OES_texture_float - return texture(heights, uv).x; -#else - return czm_unpackFloat(texture(heights, uv)); -#endif -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float height = materialInput.height; - float invTexSize = 1.0 / float(heightsDimensions.x); - - float minHeight = getHeight(0, invTexSize); - float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); - - // early-out when outside the height range - if (height < minHeight || height > maxHeight) { - material.diffuse = vec3(0.0); - material.alpha = 0.0; - return material; - } - - // Binary search to find heights above and below. - int idxBelow = 0; - int idxAbove = heightsDimensions.x; - float heightBelow = minHeight; - float heightAbove = maxHeight; - - // while loop not allowed, so use for loop with max iterations. - // maxIterations of 16 supports a texture size up to 65536 (2^16). - const int maxIterations = 16; - for (int i = 0; i < maxIterations; i++) { - if (idxBelow >= idxAbove - 1) { - break; - } - - int idxMid = (idxBelow + idxAbove) / 2; - float heightTex = getHeight(idxMid, invTexSize); - - if (height > heightTex) { - idxBelow = idxMid; - heightBelow = heightTex; - } else { - idxAbove = idxMid; - heightAbove = heightTex; - } - } - - float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); - vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); - vec4 color = texture(colors, colorUv); - - // undo preumultiplied alpha - if (color.a > 0.0) - { - color.rgb /= color.a; - } - - color.rgb = czm_gammaCorrect(color.rgb); - - material.diffuse = color.rgb; - material.alpha = color.a; - return material; -} -`;var rKt=T(S(),1),nI=`uniform vec4 color; -uniform float spacing; -uniform float width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float distanceToContour = mod(materialInput.height, spacing); - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float dxc = abs(dFdx(materialInput.height)); - float dyc = abs(dFdy(materialInput.height)); - float dF = max(dxc, dyc) * czm_pixelRatio * width; - float alpha = (distanceToContour < dF) ? 1.0 : 0.0; -#else - // If no derivatives available (IE 10?), use pixel ratio - float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; -#endif - - vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var aKt=T(S(),1),iI=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); - vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var lKt=T(S(),1),oI=`uniform vec4 fadeInColor; -uniform vec4 fadeOutColor; -uniform float maximumDistance; -uniform bool repeat; -uniform vec2 fadeDirection; -uniform vec2 time; - -float getTime(float t, float coord) -{ - float scalar = 1.0 / maximumDistance; - float q = distance(t, coord) * scalar; - if (repeat) - { - float r = distance(t, coord + 1.0) * scalar; - float s = distance(t, coord - 1.0) * scalar; - q = min(min(r, s), q); - } - return clamp(q, 0.0, 1.0); -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float s = getTime(time.x, st.s) * fadeDirection.s; - float t = getTime(time.y, st.t) * fadeDirection.t; - - float u = length(vec2(s, t)); - vec4 color = mix(fadeInColor, fadeOutColor, u); - - color = czm_gammaCorrect(color); - material.emission = color.rgb; - material.alpha = color.a; - - return material; -} -`;var uKt=T(S(),1),rI=`uniform vec4 color; -uniform float cellAlpha; -uniform vec2 lineCount; -uniform vec2 lineThickness; -uniform vec2 lineOffset; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - - float value; - - // Fuzz Factor - Controls blurriness of lines -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - const float fuzz = 1.2; - vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; - - // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. - vec2 dx = abs(dFdx(st)); - vec2 dy = abs(dFdy(st)); - vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; - value = min( - smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), - smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); -#else - // If no derivatives available (IE 10?), revert to view-dependent fuzz - const float fuzz = 0.05; - - vec2 range = 0.5 - (lineThickness * 0.05); - value = min( - 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), - 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); -#endif - - // Edges taken from RimLightingMaterial.glsl - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); - float sRim = smoothstep(0.8, 1.0, dRim); - value *= (1.0 - sRim); - - vec4 halfColor; - halfColor.rgb = color.rgb * 0.5; - halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); - halfColor = czm_gammaCorrect(halfColor); - material.diffuse = halfColor.rgb; - material.emission = halfColor.rgb; - material.alpha = halfColor.a; - - return material; -} -`;var hKt=T(S(),1),sI=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec4 textureValue = texture(image, fract(repeat * materialInput.st)); - vec3 normalTangentSpace = textureValue.channels; - normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; - normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); - normalTangentSpace = normalize(normalTangentSpace); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - - return material; -} -`;var pKt=T(S(),1),aI=`uniform vec4 color; - -float getPointOnLine(vec2 p0, vec2 p1, float x) -{ - float slope = (p0.y - p1.y) / (p0.x - p1.x); - return slope * (x - p0.x) + p0.y; -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; -#else - // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head - float base = 0.975; -#endif - - vec2 center = vec2(1.0, 0.5); - float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); - float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); - - float halfWidth = 0.15; - float s = step(0.5 - halfWidth, st.t); - s *= 1.0 - step(0.5 + halfWidth, st.t); - s *= 1.0 - step(base, st.s); - - float t = step(base, materialInput.st.s); - t *= 1.0 - step(ptOnUpperLine, st.t); - t *= step(ptOnLowerLine, st.t); - - // Find the distance from the closest separator (region between two colors) - float dist; - if (st.s < base) - { - float d1 = abs(st.t - (0.5 - halfWidth)); - float d2 = abs(st.t - (0.5 + halfWidth)); - dist = min(d1, d2); - } - else - { - float d1 = czm_infinity; - if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) - { - d1 = abs(st.s - base); - } - float d2 = abs(st.t - ptOnUpperLine); - float d3 = abs(st.t - ptOnLowerLine); - dist = min(min(d1, d2), d3); - } - - vec4 outsideColor = vec4(0.0); - vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); - vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); - - outColor = czm_gammaCorrect(outColor); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - return material; -} -`;var gKt=T(S(),1),cI=`uniform vec4 color; -uniform vec4 gapColor; -uniform float dashLength; -uniform float dashPattern; -in float v_polylineAngle; - -const float maskLength = 16.0; - -mat2 rotate(float rad) { - float c = cos(rad); - float s = sin(rad); - return mat2( - c, s, - -s, c - ); -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; - - // Get the relative position within the dash from 0 to 1 - float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); - // Figure out the mask index. - float maskIndex = floor(dashPosition * maskLength); - // Test the bit mask. - float maskTest = floor(dashPattern / pow(2.0, maskIndex)); - vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; - if (fragColor.a < 0.005) { // matches 0/255 and 1/255 - discard; - } - - fragColor = czm_gammaCorrect(fragColor); - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - return material; -} -`;var xKt=T(S(),1),lI=`uniform vec4 color; -uniform float glowPower; -uniform float taperPower; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); - - if (taperPower <= 0.99999) { - glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); - } - - vec4 fragColor; - fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); - fragColor.a = clamp(0.0, 1.0, glow) * color.a; - fragColor = czm_gammaCorrect(fragColor); - - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - - return material; -} -`;var TKt=T(S(),1),dI=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; - -in float v_width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; - float b = step(0.5 - halfInteriorWidth, st.t); - b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); - - // Find the distance from the closest separator (region between two colors) - float d1 = abs(st.t - (0.5 - halfInteriorWidth)); - float d2 = abs(st.t - (0.5 + halfInteriorWidth)); - float dist = min(d1, d2); - - vec4 currentColor = mix(outlineColor, color, b); - vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); - outColor = czm_gammaCorrect(outColor); - - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var CKt=T(S(),1),uI=`uniform vec4 color; -uniform vec4 rimColor; -uniform float width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); - float s = smoothstep(1.0 - width, 1.0, d); - - vec4 outColor = czm_gammaCorrect(color); - vec4 outRimColor = czm_gammaCorrect(rimColor); - - material.diffuse = outColor.rgb; - material.emission = outRimColor.rgb * s; - material.alpha = mix(outColor.a, outRimColor.a, s); - - return material; -} -`;var LKt=T(S(),1),mI=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var ZKt=T(S(),1),hI=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) - float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); - float value = fract((coord - offset) * (repeat * 0.5)); - float dist = min(value, min(abs(value - 0.5), 1.0 - value)); - - vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); - vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); - color = czm_gammaCorrect(color); - - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var EKt=T(S(),1),fI=`uniform vec4 waterColor; -uniform vec4 landColor; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); - outColor = czm_gammaCorrect(outColor); - - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var XKt=T(S(),1),pI=`// Thanks for the contribution Jonas -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog - -uniform sampler2D specularMap; -uniform sampler2D normalMap; -uniform vec4 baseWaterColor; -uniform vec4 blendColor; -uniform float frequency; -uniform float animationSpeed; -uniform float amplitude; -uniform float specularIntensity; -uniform float fadeFactor; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float time = czm_frameNumber * animationSpeed; - - // fade is a function of the distance from the fragment and the frequency of the waves - float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); - - float specularMapValue = texture(specularMap, materialInput.st).r; - - // note: not using directional motion at this time, just set the angle to 0.0; - vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); - vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); - - // fade out the normal perturbation as we move further from the water surface - normalTangentSpace.xy /= fade; - - // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) - normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); - - normalTangentSpace = normalize(normalTangentSpace); - - // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane - float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); - - // fade out water effect as specular map value decreases - material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; - - // base color is a blend of the water and non-water color based on the value from the specular map - // may need a uniform blend factor to better control this - material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); - - // diffuse highlights are based on how perturbed the normal is - material.diffuse += (0.1 * tsPerturbationRatio); - - material.diffuse = material.diffuse; - - material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); - - material.specular = specularIntensity; - material.shininess = 10.0; - - return material; -} -`;function He(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,qt.LINEAR),this._magnificationFilter=y(e.magnificationFilter,mi.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,MIe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(He._uniformList[this.type])||(He._uniformList[this.type]=Object.keys(this._uniforms))}He._uniformList={};He.fromType=function(e,t){let n=new He({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};He.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i-1)return!0;return!1}function OIe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} -`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) -{ -`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&BIe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; -`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; -`:e.shaderSource+=`material.${o} = ${t[o]}; -`}e.shaderSource+=`return material; -} -`}}var Yte={mat2:Gi,mat3:$,mat4:M},YIe=/\.ktx2$/i;function HIe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===He.DefaultImageId;t=r;let c=n._textures[e],d,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new $t({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Wt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Wt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=r._width,u.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=c._width,u.y=c._height)),a)return;let h=r instanceof Ze;if(!l(n._texturePaths[e])||h&&r.url!==n._texturePaths[e].url||!h&&r!==n._texturePaths[e]){if(typeof r=="string"||h){let p=h?r:Ze.createIfNeeded(r),g;YIe.test(p.url)?g=Sl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(f){n._loadedImages.push({id:e,image:f})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function zIe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof xr){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===He.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Ze.createIfNeeded(i.positiveX).fetchImage(),Ze.createIfNeeded(i.negativeX).fetchImage(),Ze.createIfNeeded(i.positiveY).fetchImage(),Ze.createIfNeeded(i.negativeY).fetchImage(),Ze.createIfNeeded(i.positiveZ).fetchImage(),Ze.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function KIe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Hte(e,n)}function Hte(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=JIe(o),s;if(r==="channels")s=bI(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;jIe(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},Hte(e,d))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let d=`uniform ${r} ${t};`;e.shaderSource=d+e.shaderSource}let c=`${t}_${e._count++}`;if(s=bI(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(HIe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(zIe(t));else if(r.indexOf("mat")!==-1){let d=new Yte[r];e._uniforms[c]=function(){return Yte[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function JIe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Ze||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===He.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function QIe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new He({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=St(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;bI(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=bI(e,i,a)}}function bI(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,d,u){return d||u?c:(o+=1,n)}),o}function jIe(e,t,n){return bI(e,t,t,n)}He._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};He.DefaultImageId="czm_defaultImage";He.DefaultCubeMapId="czm_defaultCubeMap";He.ColorType="Color";He._materialCache.addMaterial(He.ColorType,{fabric:{type:He.ColorType,uniforms:{color:new B(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});He.ImageType="Image";He._materialCache.addMaterial(He.ImageType,{fabric:{type:He.ImageType,uniforms:{image:He.DefaultImageId,repeat:new D(1,1),color:new B(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});He.DiffuseMapType="DiffuseMap";He._materialCache.addMaterial(He.DiffuseMapType,{fabric:{type:He.DiffuseMapType,uniforms:{image:He.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});He.AlphaMapType="AlphaMap";He._materialCache.addMaterial(He.AlphaMapType,{fabric:{type:He.AlphaMapType,uniforms:{image:He.DefaultImageId,channel:"a",repeat:new D(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});He.SpecularMapType="SpecularMap";He._materialCache.addMaterial(He.SpecularMapType,{fabric:{type:He.SpecularMapType,uniforms:{image:He.DefaultImageId,channel:"r",repeat:new D(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});He.EmissionMapType="EmissionMap";He._materialCache.addMaterial(He.EmissionMapType,{fabric:{type:He.EmissionMapType,uniforms:{image:He.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});He.BumpMapType="BumpMap";He._materialCache.addMaterial(He.BumpMapType,{fabric:{type:He.BumpMapType,uniforms:{image:He.DefaultImageId,channel:"r",strength:.8,repeat:new D(1,1)},source:qE},translucent:!1});He.NormalMapType="NormalMap";He._materialCache.addMaterial(He.NormalMapType,{fabric:{type:He.NormalMapType,uniforms:{image:He.DefaultImageId,channels:"rgb",strength:.8,repeat:new D(1,1)},source:sI},translucent:!1});He.GridType="Grid";He._materialCache.addMaterial(He.GridType,{fabric:{type:He.GridType,uniforms:{color:new B(0,1,0,1),cellAlpha:.1,lineCount:new D(8,8),lineThickness:new D(1,1),lineOffset:new D(0,0)},source:rI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});He.StripeType="Stripe";He._materialCache.addMaterial(He.StripeType,{fabric:{type:He.StripeType,uniforms:{horizontal:!0,evenColor:new B(1,1,1,.5),oddColor:new B(0,0,1,.5),offset:0,repeat:5},source:hI},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});He.CheckerboardType="Checkerboard";He._materialCache.addMaterial(He.CheckerboardType,{fabric:{type:He.CheckerboardType,uniforms:{lightColor:new B(1,1,1,.5),darkColor:new B(0,0,0,.5),repeat:new D(5,5)},source:$E},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});He.DotType="Dot";He._materialCache.addMaterial(He.DotType,{fabric:{type:He.DotType,uniforms:{lightColor:new B(1,1,0,.75),darkColor:new B(0,1,1,.75),repeat:new D(5,5)},source:eI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});He.WaterType="Water";He._materialCache.addMaterial(He.WaterType,{fabric:{type:He.WaterType,uniforms:{baseWaterColor:new B(.2,.3,.6,1),blendColor:new B(0,1,.699,1),specularMap:He.DefaultImageId,normalMap:He.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:pI},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});He.RimLightingType="RimLighting";He._materialCache.addMaterial(He.RimLightingType,{fabric:{type:He.RimLightingType,uniforms:{color:new B(1,0,0,.7),rimColor:new B(1,1,1,.4),width:.3},source:uI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});He.FadeType="Fade";He._materialCache.addMaterial(He.FadeType,{fabric:{type:He.FadeType,uniforms:{fadeInColor:new B(1,0,0,1),fadeOutColor:new B(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new D(.5,.5)},source:oI},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});He.PolylineArrowType="PolylineArrow";He._materialCache.addMaterial(He.PolylineArrowType,{fabric:{type:He.PolylineArrowType,uniforms:{color:new B(1,1,1,1)},source:aI},translucent:!0});He.PolylineDashType="PolylineDash";He._materialCache.addMaterial(He.PolylineDashType,{fabric:{type:He.PolylineDashType,uniforms:{color:new B(1,0,1,1),gapColor:new B(0,0,0,0),dashLength:16,dashPattern:255},source:cI},translucent:!0});He.PolylineGlowType="PolylineGlow";He._materialCache.addMaterial(He.PolylineGlowType,{fabric:{type:He.PolylineGlowType,uniforms:{color:new B(0,.5,1,1),glowPower:.25,taperPower:1},source:lI},translucent:!0});He.PolylineOutlineType="PolylineOutline";He._materialCache.addMaterial(He.PolylineOutlineType,{fabric:{type:He.PolylineOutlineType,uniforms:{color:new B(1,1,1,1),outlineColor:new B(1,0,0,1),outlineWidth:1},source:dI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});He.ElevationContourType="ElevationContour";He._materialCache.addMaterial(He.ElevationContourType,{fabric:{type:He.ElevationContourType,uniforms:{spacing:100,color:new B(1,0,0,1),width:1},source:nI},translucent:!1});He.ElevationRampType="ElevationRamp";He._materialCache.addMaterial(He.ElevationRampType,{fabric:{type:He.ElevationRampType,uniforms:{image:He.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:iI},translucent:!1});He.SlopeRampMaterialType="SlopeRamp";He._materialCache.addMaterial(He.SlopeRampMaterialType,{fabric:{type:He.SlopeRampMaterialType,uniforms:{image:He.DefaultImageId},source:mI},translucent:!1});He.AspectRampMaterialType="AspectRamp";He._materialCache.addMaterial(He.AspectRampMaterialType,{fabric:{type:He.AspectRampMaterialType,uniforms:{image:He.DefaultImageId},source:jE},translucent:!1});He.ElevationBandType="ElevationBand";He._materialCache.addMaterial(He.ElevationBandType,{fabric:{type:He.ElevationBandType,uniforms:{heights:He.DefaultImageId,colors:He.DefaultImageId},source:tI},translucent:!0});He.WaterMaskType="WaterMask";He._materialCache.addMaterial(He.WaterMaskType,{fabric:{type:He.WaterMaskType,source:fI,uniforms:{waterColor:new B(1,1,1,1),landColor:new B(0,0,0,0)}},translucent:!1});var Hi=He;function Vx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,Vx.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Hi.fromType(Hi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Vx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Vx.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Vx.prototype.isTranslucent=no.prototype.isTranslucent;Vx.prototype.getRenderState=no.prototype.getRenderState;Vx.MaterialSupport={BASIC:Object.freeze({vertexFormat:Xe.POSITION_AND_NORMAL,vertexShaderSource:KE,fragmentShaderSource:zE}),TEXTURED:Object.freeze({vertexFormat:Xe.POSITION_NORMAL_AND_ST,vertexShaderSource:QE,fragmentShaderSource:JE}),ALL:Object.freeze({vertexFormat:Xe.ALL,vertexShaderSource:HE,fragmentShaderSource:YE})};var so=Vx;var HJt=T(S(),1);var XJt=T(S(),1),gI=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec4 v_color; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - vec4 color = czm_gammaCorrect(v_color); - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -} -`;var PJt=T(S(),1),yI=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec4 color; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec4 v_color; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_color = color; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var wJt=T(S(),1),Lx=`in vec4 v_color; - -void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -} -`;var AJt=T(S(),1),xI=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 color; -in float batchId; - -out vec4 v_color; - -void main() -{ - vec4 p = czm_computePosition(); - - v_color = color; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function Ep(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?xI:yI,r=i?Lx:gI,s=i?Ep.FLAT_VERTEX_FORMAT:Ep.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Ep.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Ep.VERTEX_FORMAT=Xe.POSITION_AND_NORMAL;Ep.FLAT_VERTEX_FORMAT=Xe.POSITION_ONLY;Ep.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Ep.prototype.isTranslucent=no.prototype.isTranslucent;Ep.prototype.getRenderState=no.prototype.getRenderState;var dn=Ep;var eQt=T(S(),1);function sC(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(sC.prototype,{isConstant:{get:function(){return K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});sC.prototype.getType=function(e){return"Color"};var qIe=new q;sC.prototype.getValue=function(e,t){return l(e)||(e=q.now(qIe)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,B.WHITE,t.color),t};sC.prototype.equals=function(e){return this===e||e instanceof sC&&K.equals(this._color,e._color)};var Bt=sC;var P7t=T(S(),1);var m7t=T(S(),1);var SQt=T(S(),1);var lQt=T(S(),1);function Y0(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ne.default),this._rectangle=y(e.rectangle,ce.MAX_VALUE),this._projection=new Zi(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(Y0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Y0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=o&&(d=o-1);let u=(i.north-e.latitude)/a|0;return u>=r&&(u=r-1),l(n)?(n.x=d,n.y=u,n):new D(d,u)};var zi=Y0;var zte=new m,Kte=new m,Jte=new he,CY=new m,$Ie=new m,Qte=new le,eXe=new zi,_I=[new he,new he,new he,new he],TI=new D,Jr={};Jr.initialize=function(){let e=Jr._initPromise;return l(e)||(e=Ze.fetchJson(rn("Assets/approximateTerrainHeights.json")).then(function(t){Jr._terrainHeights=t}),Jr._initPromise=e),e};Jr.getMinimumMaximumHeights=function(e,t){t=y(t,ne.default);let n=jte(e),i=Jr._defaultMinTerrainHeight,o=Jr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Jr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ce.northeast(e,Jte),zte),t.cartographicToCartesian(ce.southwest(e,Jte),Kte),m.midpoint(Kte,zte,CY);let a=t.scaleToGeodeticSurface(CY,$Ie);if(l(a)){let c=m.distance(CY,a);i=Math.min(i,-c)}else i=Jr._defaultMinTerrainHeight}return i=Math.max(Jr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Jr.getBoundingSphere=function(e,t){t=y(t,ne.default);let n=jte(e),i=Jr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Jr._terrainHeights[r];l(s)&&(i=s[1])}let o=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,Qte),le.union(o,Qte,o)};function jte(e){he.fromRadians(e.east,e.north,0,_I[0]),he.fromRadians(e.west,e.north,0,_I[1]),he.fromRadians(e.east,e.south,0,_I[2]),he.fromRadians(e.west,e.south,0,_I[3]);let t=0,n=0,i=0,o=0,r=Jr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=_I[c];if(eXe.positionToTileXY(d,s,TI),c===0)i=TI.x,o=TI.y;else if(i!==TI.x||o!==TI.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Jr._terrainHeightsMaxLevel=6;Jr._defaultMaxTerrainHeight=9e3;Jr._defaultMinTerrainHeight=-1e5;Jr._terrainHeights=void 0;Jr._initPromise=void 0;Object.defineProperties(Jr,{initialized:{get:function(){return l(Jr._terrainHeights)}}});var li=Jr;var r4t=T(S(),1);var DQt=T(S(),1);var GQt=T(S(),1);function Mc(e,t,n){this.minimum=m.clone(y(e,m.ZERO)),this.maximum=m.clone(y(t,m.ZERO)),l(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}Mc.fromCorners=function(e,t,n){return l(n)||(n=new Mc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};Mc.fromPoints=function(e,t){if(l(t)||(t=new Mc),!l(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let h=1;h0?zt.INSIDE:r+o<0?zt.OUTSIDE:zt.INTERSECTING};Mc.prototype.clone=function(e){return Mc.clone(this,e)};Mc.prototype.intersectPlane=function(e){return Mc.intersectPlane(this,e)};Mc.prototype.equals=function(e){return Mc.equals(this,e)};var H0=Mc;var VY=new se;function lf(e,t){t=y(t,ne.default),e=t.scaleToGeodeticSurface(e);let n=wt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(M.getColumn(n,0,VY)),this._yAxis=m.fromCartesian4(M.getColumn(n,1,VY));let i=m.fromCartesian4(M.getColumn(n,2,VY));this._plane=ln.fromPointNormal(e,i)}Object.defineProperties(lf.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var tXe=new H0;lf.fromPoints=function(e,t){let n=H0.fromPoints(e,tXe);return new lf(n.center,t)};var qte=new bn,ON=new m;lf.prototype.projectPointOntoPlane=function(e,t){let n=qte;n.origin=e,m.normalize(e,n.direction);let i=jn.rayPlane(n,this._plane,ON);if(l(i)||(m.negate(n.direction,n.direction),i=jn.rayPlane(n,this._plane,ON)),l(i)){let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new D(r,s)}};lf.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o0?0:v.latitude,R=he.fromRadians(F,e.north,n,hXe),E=he.fromRadians(e.west,e.north,n,fXe),X=he.fromRadians(e.west,b,n,pXe),A=he.fromRadians(e.west,e.south,n,bXe),N=he.fromRadians(F,e.south,n,gXe),O=i.cartographicToCartesian(R,yXe),U=i.cartographicToCartesian(E,tne),Y=i.cartographicToCartesian(X,xXe),k=i.cartographicToCartesian(A,nne),H=i.cartographicToCartesian(N,_Xe),J=w.projectPointToNearestOnPlane(O,TXe),te=w.projectPointToNearestOnPlane(U,SXe),z=w.projectPointToNearestOnPlane(Y,CXe),j=w.projectPointToNearestOnPlane(k,VXe),ee=w.projectPointToNearestOnPlane(H,LXe);return r=Math.min(te.x,z.x,j.x),s=-r,c=Math.max(te.y,J.y),a=Math.min(j.y,ee.y),E.height=A.height=t,U=i.cartographicToCartesian(E,tne),k=i.cartographicToCartesian(A,nne),d=Math.min(ln.getPointDistance(h,U),ln.getPointDistance(h,k)),u=n,$te(w.origin,w.xAxis,w.yAxis,w.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,g=e.north<0,f=p?e.south:g?e.north:0,x=ce.center(e,ene).longitude,_=m.fromRadians(x,f,n,i,RXe);_.z=0;let V=Math.abs(_.x)=c?zt.INSIDE:zt.INTERSECTING};var rne=new m,sne=new m,ane=new m,wXe=new m,ine=new m,FXe=new m;Mi.distanceSquaredTo=function(e,t){let n=m.subtract(t,e.center,one),i=e.halfAxes,o=$.getColumn(i,0,rne),r=$.getColumn(i,1,sne),s=$.getColumn(i,2,ane),a=m.magnitude(o),c=m.magnitude(r),d=m.magnitude(s),u=!0,h=!0,p=!0;a>0?m.divideByScalar(o,a,o):u=!1,c>0?m.divideByScalar(r,c,r):h=!1,d>0?m.divideByScalar(s,d,s):p=!1;let g=!u+!h+!p,f,x,_;if(g===1){let Z=o;f=r,x=s,h?p||(Z=s,x=o):(Z=r,f=o),_=m.cross(f,x,ine),Z===o?o=_:Z===r?r=_:Z===s&&(s=_)}else if(g===2){f=o,h?f=r:p&&(f=s);let Z=m.UNIT_Y;Z.equalsEpsilon(f,W.EPSILON3)&&(Z=m.UNIT_X),x=m.cross(f,Z,wXe),m.normalize(x,x),_=m.cross(f,x,ine),m.normalize(_,_),f===o?(r=x,s=_):f===r?(s=x,o=_):f===s&&(o=x,r=_)}else g===3&&(o=m.UNIT_X,r=m.UNIT_Y,s=m.UNIT_Z);let C=FXe;C.x=m.dot(n,o),C.y=m.dot(n,r),C.z=m.dot(n,s);let V=0,L;return C.x<-a?(L=C.x+a,V+=L*L):C.x>a&&(L=C.x-a,V+=L*L),C.y<-c?(L=C.y+c,V+=L*L):C.y>c&&(L=C.y-c,V+=L*L),C.z<-d?(L=C.z+d,V+=L*L):C.z>d&&(L=C.z-d,V+=L*L),V};var AXe=new m,MXe=new m;Mi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ra);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,rne),d=$.getColumn(a,1,sne),u=$.getColumn(a,2,ane),h=m.add(c,d,AXe);m.add(h,u,h),m.add(h,s,h);let p=m.subtract(h,t,MXe),g=m.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.add(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.subtract(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.add(s,c,h),m.subtract(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.add(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.add(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.subtract(h,d,h),m.add(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),m.subtract(s,c,h),m.subtract(h,d,h),m.subtract(h,u,h),m.subtract(h,t,p),g=m.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var NXe=new m,kXe=new m,UXe=new m;Mi.computeCorners=function(e,t){l(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,NXe),r=$.getColumn(i,1,kXe),s=$.getColumn(i,2,UXe);return m.clone(n,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],o,t[1]),m.subtract(t[1],r,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],o,t[2]),m.add(t[2],r,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],o,t[3]),m.add(t[3],r,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],o,t[4]),m.subtract(t[4],r,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],o,t[5]),m.subtract(t[5],r,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],o,t[6]),m.add(t[6],r,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],o,t[7]),m.add(t[7],r,t[7]),m.add(t[7],s,t[7]),t};var DXe=new $;Mi.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,DXe);return M.fromRotationTranslation(i,n,t)};var BXe=new le;Mi.isOccluded=function(e,t){let n=le.fromOrientedBoundingBox(e,BXe);return!t.isBoundingSphereVisible(n)};Mi.prototype.intersectPlane=function(e){return Mi.intersectPlane(this,e)};Mi.prototype.distanceSquaredTo=function(e){return Mi.distanceSquaredTo(this,e)};Mi.prototype.computePlaneDistances=function(e,t,n){return Mi.computePlaneDistances(this,e,t,n)};Mi.prototype.computeCorners=function(e){return Mi.computeCorners(this,e)};Mi.prototype.computeTransformation=function(e){return Mi.computeTransformation(this,e)};Mi.prototype.isOccluded=function(e){return Mi.isOccluded(this,e)};Mi.equals=function(e,t){return e===t||l(e)&&l(t)&&m.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Mi.prototype.clone=function(e){return Mi.clone(this,e)};Mi.prototype.equals=function(e){return Mi.equals(this,e)};var Gn=Mi;var d4t=T(S(),1);var YN={};YN.getHeight=function(e,t,n){return(e-n)*t+n};var OXe=new he;YN.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,OXe);if(!l(r))return m.clone(e,o);let s=YN.getHeight(r.height,n,i);return m.fromRadians(r.longitude,r.latitude,s,t,o)};var Tr=YN;var K8t=T(S(),1);var m4t=T(S(),1),cne={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};cne.NUMBER_OF_CLASSIFICATION_TYPES=3;var kn=Object.freeze(cne);var p4t=T(S(),1);var YXe={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},oc=Object.freeze(YXe);var Hjt=T(S(),1);var g4t=T(S(),1);function HXe(e,t){let n=[],i=e.length,o=0;for(;oLl.MaximumLatitude?e=Ll.MaximumLatitude:e<-Ll.MaximumLatitude&&(e=-Ll.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Ll.MaximumLatitude=Ll.mercatorAngleToGeodeticLatitude(Math.PI);Ll.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Ll.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};Ll.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=Ll.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Ei=Ll;function sWe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let d=0;dr&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function lWe(e,t){let n=[];return RY(e,"geometry",t,n),RY(e,"westHemisphereGeometry",t,n),RY(e,"eastHemisphereGeometry",t,n),n}var Xp={};Xp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=cWe(e),t.length>0&&(n=Fn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=lWe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),d=new Array(o);for(let u=0;u0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};Xp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s0){let G=_.length/C;for(Z=Ae.createTypedArray(G,x),i=0;i= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${o}`};function pne(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",d=`in ${a} ${c};`,u="",h="";if(i){u+=`vec2 st; -`;let f=s>1?`${c}.x`:c;h+=` st = czm_decompressTextureCoordinates(${f}); -`}n&&o&&r?(u+=`vec3 normal; -vec3 tangent; -vec3 bitangent; -`,h+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(u+=`vec3 normal; -`,h+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); -`),o&&(u+=`vec3 tangent; -`,h+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`),r&&(u+=`vec3 bitangent; -`,h+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=De.replaceMain(p,"czm_non_compressed_main");let g=`void main() -{ -${h} czm_non_compressed_main(); -}`;return[d,u,p,g].join(` -`)}function VWe(e){let t=De.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - gl_Position = czm_depthClamp(gl_Position);} -`,t}function LWe(e){let t=De.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - #if defined(LOG_DEPTH) - czm_writeLogDepth(); - #else - czm_writeDepthClamp(); - #endif -} -`,t}function bne(e,t){let n=e.vertexAttributes}function RWe(e,t){return function(){return e[t]}}var ZY=Math.max(Ot.hardwareConcurrency-1,1),HN,ZWe=new bi("combineGeometry");function GWe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Sr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],d=[];for(o=0;o0){let x=new Float64Array(h);for(f=[x.buffer],r=0;r0?(e._recomputeBoundingSpheres=!0,e._state=Sr.COMBINED):LI(e,t,Sr.FAILED,void 0)}).catch(function(h){LI(e,t,Sr.FAILED,h)})}}function EWe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a0?(e._recomputeBoundingSpheres=!0,e._state=Sr.COMBINED):LI(e,t,Sr.FAILED,void 0)}function IWe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i0||le.intersectPlane(x,ln.ORIGIN_ZX_PLANE)!==zt.INTERSECTING?c.push(x):(d.push(x),u.push(x))}let h=c[0],p=u[0],g=d[0];for(i=1;i0){if(At.maximumVertexTextureImageUnits===0)throw new ae("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Sr.COMPLETE&&this._state!==Sr.COMBINED&&(this.asynchronous?GWe(this,e):EWe(this,e)),this._state===Sr.COMBINED&&(XWe(this,e),yne(this,e),PWe(this,e)),!this.show||this._state!==Sr.COMPLETE)return;this._batchTableOffsetsUpdated||yne(this,e),this._recomputeBoundingSpheres&&IWe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let d=n.closed&&c;o&&y(this._createRenderStatesFunction,vWe)(this,t,n,d),r&&y(this._createShaderProgramFunction,wWe)(this,e,n),(o||r)&&y(this._createCommandsFunction,FWe)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,AWe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var MWe=new le,NWe=new le;function Rne(e,t,n){if(n===cn.TOP){let i=le.clone(e,MWe),o=le.clone(e,NWe);o.center=m.add(o.center,t,o.center),e=le.union(i,o,e)}else n===cn.ALL&&(e.center=m.add(e.center,t,e.center));return e}function kWe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=Q.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function UWe(e,t,n,i,o){return function(r){let s=Sne(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var DWe=new m;function BWe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&Rne(i,m.fromArray(r.get(),0,DWe),e._offsetInstanceExtend[n]),l(o)&&(i=le.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function OWe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Cr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;dd&&(u=W.PI-s,s=-W.PI,d+=u),r-=W.EPSILON5,s-=W.EPSILON5,c+=W.EPSILON5,d+=W.EPSILON5;let h=1/(d-s),p=1/(c-r),g={sphericalExtents:new rc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new rc({componentDatatype:Q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return wne(g,t),Mne(e,i,g),g};Vu.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Vu.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function oPe(e){return Math.max(e.width,e.height)>Vu.MAX_WIDTH_FOR_PLANAR_EXTENTS}Vu.shouldUseSphericalCoordinates=function(e){return oPe(e)};Vu.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var fd=Vu;var S8t=T(S(),1);var p8t=T(S(),1);var rPe={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},Un=Object.freeze(rPe);var y8t=T(S(),1);var sPe={ZERO:ie.ZERO,KEEP:ie.KEEP,REPLACE:ie.REPLACE,INCREMENT:ie.INCR,DECREMENT:ie.DECR,INVERT:ie.INVERT,INCREMENT_WRAP:ie.INCR_WRAP,DECREMENT_WRAP:ie.DECR_WRAP},ft=Object.freeze(sPe);var KN={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};KN.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Un.ALWAYS,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},backFunction:Un.ALWAYS,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},reference:KN.CESIUM_3D_TILE_MASK,mask:KN.CESIUM_3D_TILE_MASK}};var Dt=Object.freeze(KN);function Gx(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Gx.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Gx.isSupported=function(e){return e.context.stencilBuffer};function aC(e,t){let n=t?Un.EQUAL:Un.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:n,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:Dt.CESIUM_3D_TILE_MASK,mask:Dt.CESIUM_3D_TILE_MASK},stencilMask:Dt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:oc.LESS_OR_EQUAL},depthMask:!1}}function XY(e){return{stencilTest:{enabled:e,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:Dt.CLASSIFICATION_MASK},stencilMask:Dt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}}var aPe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:Dt.CLASSIFICATION_MASK},stencilMask:Dt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function cPe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ue.fromCache(aC(o,!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(aC(o,!0)),e._rsColorPass=Ue.fromCache(XY(o,!1)),e._rsPickPass=Ue.fromCache(aPe)}function lPe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; -`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=De.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${r} czm_non_compressed_main(); -}`;return[i,o,s,a].join(` -`)}}function dPe(e,t){let n=t.context,i=e._primitive,o=EE;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=lPe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new De({defines:[a],sources:[o]}),d=new De({sources:[D0]}),u=e._primitive._attributeLocations,h=new fd(s,r,e.appearance);if(e._spStencil=en.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=De.createPickVertexShaderSource(o);f=In._appendShowToShader(i,f),f=In._updatePickColorAttribute(f);let x=h.createPickFragmentShader(!1),_=h.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=en.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let V=h.createPickFragmentShader(!0),L=h.createPickVertexShader([a],f,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:L,fragmentShaderSource:V,attributeLocations:u})}e._spPick2D=C}}else e._spPick=en.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=In._appendShowToShader(i,o),c=new De({defines:[a],sources:[o]}),e._sp=en.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=h.createFragmentShader(!1),g=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=en.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let x=h.createFragmentShader(!0),_=h.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u})}e._spColor2D=f}}function uPe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o0&&(c=o[0].attributes,p=fd.hasAttributesForSphericalExtents(c),g=fd.hasAttributesForTextureCoordinatePlanes(c),h=c.color),s=0;s{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Gx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Gx.prototype.isDestroyed=function(){return!1};Gx.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,me(this)};var cC=Gx;var pPe={u_globeMinimumAltitude:function(){return 55e3}};function Rl(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Rl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Rl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Rl.prototype.isDestroyed=function(){return!1};Rl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};Rl._supportsMaterials=function(e){return e.depthTexture};Rl.supportsMaterials=function(e){return Rl._supportsMaterials(e.frameState.context)};var Nc=Rl;var x7t=T(S(),1);function lC(){pe.throwInstantiationError()}Object.defineProperties(lC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});lC.prototype.getType=pe.throwInstantiationError;lC.prototype.getValue=pe.throwInstantiationError;lC.prototype.equals=pe.throwInstantiationError;var VPe=new q;lC.getValue=function(e,t,n){let i;return l(e)||(e=q.now(VPe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Hi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Hi.ColorType)&&(n=Hi.fromType(Hi.ColorType)),B.clone(B.WHITE,n.uniforms.color),n)};var qo=lC;function Ex(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Ex.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!K.getValueOrDefault(t.show,n,!0)};Ex.prototype._setOptions=pe.throwInstantiationError;Ex.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof Bt,h,p=t._getIsClosed(c);if(u)h=new dn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=qo.getValue(e,d,this._material);this._material=g,h=new so({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=dn.VERTEX_FORMAT,this._primitive=o.add(new Nc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),K.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=h.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);u&&(h.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:g,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let d=this._geometryUpdater.createOutlineGeometryInstance(e),u=K.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:d,appearance:new dn({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};Ex.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(le.clone(o.boundingSphere,e),dt.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(le.clone(o.boundingSphere,e),dt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?dt.PENDING:dt.FAILED};Ex.prototype.isDestroyed=function(){return!1};Ex.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),me(this)};var ti=Ex;var znn=T(S(),1);var Inn=T(S(),1);var w7t=T(S(),1),LPe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Wp=Object.freeze(LPe);var Eqt=T(S(),1);var E6t=T(S(),1);var A7t=T(S(),1),RPe={NONE:0,GEODESIC:1,RHUMB:2},tn=Object.freeze(RPe);var D7t=T(S(),1);var One=W.EPSILON10;function ZPe(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,d,u=0,h=-1;for(s=1;sW.EPSILON12);let R=F*(t*t-n*n)/(n*n),E=1+R*(4096+R*(R*(320-175*R)-768))/16384,X=R*(256+R*(R*(74-47*R)-128))/1024,A=b*b,N=X*w*(b+X*(P*(2*A-1)-X*b*(4*w*w-3)*(4*A-3)/6)/4),O=n*E*(v-N),U=Math.atan2(g*I,_-V*G),Y=Math.atan2(h*I,_*G-V);e._distance=O,e._startHeading=U,e._endHeading=Y,e._uSquared=R}var XPe=new m,vY=new m;function Hne(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,vY),XPe),r=m.normalize(i.cartographicToCartesian(n,vY),vY);IPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,GPe(e)}function RI(e,t,n){let i=y(n,ne.default);this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Hne(this,e,t,i)}Object.defineProperties(RI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});RI.prototype.setEndPoints=function(e,t){Hne(this,e,t,this._ellipsoid)};RI.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};RI.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),h=i*i,p=i*h,g=n.u8Over256,f=n.u2Over4,x=n.u6Over64,_=n.u4Over16,C=2*p*g*o/3+i*(1-f+7*_/4-15*x/4+579*g/64-(_-15*x/4+187*g/16)*o-(5*x/4-115*g/16)*r-29*g*s/16)+(f/2-_+71*x/32-85*g/16)*a+(5*_/16-5*x/4+383*g/96)*c-h*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*d+539*g*u/1536,V=Math.asin(Math.sin(C)*n.cosineAlpha),L=Math.atan(n.a/n.b*Math.tan(V));C=C-n.sigma;let Z=Math.cos(2*n.sigma+C),G=Math.sin(C),I=Math.cos(C),v=n.cosineU*I,P=n.sineU*G,F=Math.atan2(G*n.sineHeading,v-P*n.cosineHeading)-Yne(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,G,I,Z);return l(t)?(t.longitude=this._start.longitude+F,t.latitude=L,t.height=0,t):new he(this._start.longitude+F,L,0)};var Pp=RI;var o6t=T(S(),1);function FY(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,d=n,u=Math.sin(2*d),h=Math.sin(4*d),p=Math.sin(6*d),g=Math.sin(8*d),f=Math.sin(10*d),x=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*x)}function WPe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,d=c*c,u=d*c,h=u*c,p=h*c,g=p*c,f=Math.sin(2*i),x=Math.cos(2*i),_=Math.sin(4*i),C=Math.cos(4*i),V=Math.sin(6*i),L=Math.cos(6*i),Z=Math.sin(8*i),G=Math.cos(8*i),I=Math.sin(10*i),v=Math.cos(10*i),P=Math.sin(12*i);return i+i*c/4+7*i*d/64+15*i*u/256+579*i*h/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*x+(21*i*u/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*C+(151*i*h/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*L+(1097*i*p/65536+42783*i*g/1048576)*G+8011*i*g/1048576*v+(3*c/8+3*d/16+213*u/2048-3*o*u/64+255*h/4096-33*o*h/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*f+(21*d/256+21*u/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*_+(151*u/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*V+(1097*h/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*Z+(8011*p/2621440+8011*g/1048576)*I+293393*g/251658240*P}function dC(e,t){if(e===0)return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function PPe(e,t,n,i,o){let r=dC(e._ellipticity,n),s=dC(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function vPe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,d=0;if(W.equalsEpsilon(Math.abs(a),W.PI_OVER_TWO,W.EPSILON8))if(t===n)d=t*Math.cos(o)*W.negativePiToPi(c);else{let u=Math.sin(o);d=t*Math.cos(o)*W.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=FY(e._ellipticity,t,o);d=(FY(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var wPe=new m,wY=new m;function zne(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,wY),wPe),r=m.normalize(i.cartographicToCartesian(n,wY),wY),s=i.maximumRadius,a=i.minimumRadius,c=s*s,d=a*a;e._ellipticitySquared=(c-d)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=PPe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=vPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Kne(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,c,d;if(Math.abs(W.PI_OVER_TWO-Math.abs(t))>W.EPSILON8){let u=FY(o,i,e.latitude),h=n*Math.cos(t),p=u+h;if(c=WPe(p,o,i),Math.abs(t)0?a=W.negativePiToPi(e.longitude+d):a=W.negativePiToPi(e.longitude-d)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new he(a,c,0)}function vp(e,t,n){let i=y(n,ne.default);this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&zne(this,e,t,i)}Object.defineProperties(vp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});vp.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,ne.default),s=r.maximumRadius,a=r.minimumRadius,c=s*s,d=a*a,u=Math.sqrt((c-d)/c);t=W.negativePiToPi(t);let h=Kne(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new vp(e,h,r):(o.setEndPoints(e,h),o)};vp.prototype.setEndPoints=function(e,t){zne(this,e,t,this._ellipsoid)};vp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};vp.prototype.interpolateUsingSurfaceDistance=function(e,t){return Kne(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};vp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=W.negativePiToPi(e),W.equalsEpsilon(Math.abs(e),Math.PI,W.EPSILON14)&&(e=W.sign(r.longitude)*Math.PI),l(t)||(t=new he),Math.abs(W.PI_OVER_TWO-o)<=W.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(W.equalsEpsilon(Math.abs(W.PI_OVER_TWO-o),W.PI_OVER_TWO,W.EPSILON8))return W.equalsEpsilon(e,r.longitude,W.EPSILON12)?void 0:(t.longitude=e,t.latitude=W.PI_OVER_TWO*W.sign(W.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(W.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,h;do{h=u;let p=n*Math.sin(h),g=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(g/d,n/2))-W.PI_OVER_TWO}while(!W.equalsEpsilon(u,h,W.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};vp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(W.equalsEpsilon(Math.abs(i),W.PI_OVER_TWO,W.EPSILON8))return;let r=dC(n,o.latitude),s=dC(n,e),a=Math.tan(i)*(s-r),c=W.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Ia=vp;var OY=[Zi,Ei],FPe=OY.length,fie=Math.cos(W.toRadians(30)),Jne=Math.cos(W.toRadians(150)),pie=0,bie=1e3;function K0(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,tn.GEODESIC),this._ellipsoid=ne.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(K0.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});K0.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;ifie||rW.PI_OVER_TWO&&(a=!0,s=m.subtract(r,n,iie),d=c.cartesianToCartographic(s,nie)),d.height=0;let u=e.project(d,o);return o=m.subtract(u,i,o),o.z=0,o=m.normalize(o,o),a&&m.negate(o,o),o}var n2e=new m,oie=new m;function rie(e,t,n,i,o,r){let s=m.subtract(t,e,n2e);m.normalize(s,s);let a=n-pie,c=m.multiplyByScalar(s,a,oie);m.add(e,c,o);let d=i-bie;c=m.multiplyByScalar(s,d,oie),m.add(t,c,r)}var i2e=new m;function qN(e,t){let n=ln.getPointDistance($N,e),i=ln.getPointDistance($N,t),o=i2e;W.equalsEpsilon(n,0,W.EPSILON2)?(o=wp(t,e,o),m.multiplyByScalar(o,W.EPSILON2,o),m.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=wp(e,t,o),m.multiplyByScalar(o,W.EPSILON2,o),m.add(t,o,t))}function o2e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(W.equalsEpsilon(n,W.PI,W.EPSILON11)){let o=W.sign(t.longitude);return e.longitude=o*(n-W.EPSILON11),1}else if(W.equalsEpsilon(i,W.PI,W.EPSILON11)){let o=W.sign(e.longitude);return t.longitude=o*(i-W.EPSILON11),2}return 0}var yie=new he,xie=new he,sie=new m,kY=new m,aie=new m,cie=new m,r2e=new m,lie=new m,s2e=[yie,xie],a2e=new ce,c2e=new m,l2e=new m,d2e=new m,u2e=new m,m2e=new m,h2e=new m,UY=new m,DY=new m,f2e=new m,p2e=new m,b2e=new m,die=new m,g2e=new m,y2e=new m,x2e=new On,_2e=new On,uie=new m,T2e=new m,mie=new m,S2e=[new le,new le],_ie=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],hie=_ie.length;function C2e(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,h=u*8,p=h*4,g=u*36,f=h>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(h*3),_=new Float32Array(p),C=new Float32Array(p),V=new Float32Array(p),L=new Float32Array(p),Z=new Float32Array(p),G,I,v,P;s&&(G=new Float32Array(p),I=new Float32Array(p),v=new Float32Array(p),P=new Float32Array(h*2));let w=r.length/2,F=0,b=yie;b.height=0;let R=xie;R.height=0;let E=sie,X=kY;if(s)for(c=0,a=1;afie?(yt=ZI(t,b,Be,it,UY),Ne=ZI(t,R,j,Et,DY)):fi===1?(Ne=ZI(t,R,j,Et,DY),yt.x=0,yt.y=W.sign(b.longitude-Math.abs(R.longitude)),yt.z=0):(yt=ZI(t,b,Be,it,UY),Ne.x=0,Ne.y=W.sign(b.longitude-R.longitude),Ne.z=0)}let Jt=m.distance(ke,z),Rt=On.fromCartesian(Le,x2e),mt=m.subtract(te,Le,f2e),on=m.normalize(mt,die),Ve=m.subtract(ke,Le,p2e);Ve=m.normalize(Ve,Ve);let Ce=m.cross(on,Ve,die);Ce=m.normalize(Ce,Ce);let rt=m.cross(Ve,Be,g2e);rt=m.normalize(rt,rt);let Oi=m.subtract(z,te,b2e);Oi=m.normalize(Oi,Oi);let ht=m.cross(j,Oi,y2e);ht=m.normalize(ht,ht);let go=Jt/N,zo=ee/N,Ya=0,Gr,_s,Fe,st=0,Ke=0;if(s){Ya=m.distance(it,Et),Gr=On.fromCartesian(it,_2e),_s=m.subtract(Et,it,uie),Fe=m.normalize(_s,T2e);let fi=Fe.x;Fe.x=Fe.y,Fe.y=-fi,st=Ya/F,Ke=fe/F}for(O=0;O<8;O++){let fi=H+O*4,ia=Y+O*2,zr=fi+3,bl=O<4?1:-1,yo=O===2||O===3||O===6||O===7?1:-1;m.pack(Rt.high,_,fi),_[zr]=mt.x,m.pack(Rt.low,C,fi),C[zr]=mt.y,m.pack(rt,V,fi),V[zr]=mt.z,m.pack(ht,L,fi),L[zr]=go*bl,m.pack(Ce,Z,fi);let Er=zo*yo;Er===0&&yo<0&&(Er=9),Z[zr]=Er,s&&(G[fi]=Gr.high.x,G[fi+1]=Gr.high.y,G[fi+2]=Gr.low.x,G[fi+3]=Gr.low.y,v[fi]=-yt.y,v[fi+1]=yt.x,v[fi+2]=Ne.y,v[fi+3]=-Ne.x,I[fi]=_s.x,I[fi+1]=_s.y,I[fi+2]=Fe.x,I[fi+3]=Fe.y,P[ia]=st*bl,Er=Ke*yo,Er===0&&yo<0&&(Er=9),P[ia+1]=Er)}let Qe=d2e,pt=u2e,Yt=c2e,Cn=l2e,Eo=ce.fromCartographicArray(s2e,a2e),So=li.getMinimumMaximumHeights(Eo,d),Ha=So.minimumTerrainHeight,za=So.maximumTerrainHeight;_e+=Math.abs(Ha),_e+=Math.abs(za),rie(Le,ke,Ha,za,Qe,Yt),rie(te,z,Ha,za,pt,Cn);let Si=m.multiplyByScalar(Ce,W.EPSILON5,mie);m.add(Qe,Si,Qe),m.add(pt,Si,pt),m.add(Yt,Si,Yt),m.add(Cn,Si,Cn),qN(Qe,pt),qN(Yt,Cn),m.pack(Qe,x,k),m.pack(pt,x,k+3),m.pack(Cn,x,k+6),m.pack(Yt,x,k+9),Si=m.multiplyByScalar(Ce,-2*W.EPSILON5,mie),m.add(Qe,Si,Qe),m.add(pt,Si,pt),m.add(Yt,Si,Yt),m.add(Cn,Si,Cn),qN(Qe,pt),qN(Yt,Cn),m.pack(Qe,x,k+12),m.pack(pt,x,k+15),m.pack(Cn,x,k+18),m.pack(Yt,x,k+21),U+=2,c+=3,Y+=16,k+=24,H+=32,ee+=Jt,fe+=Ya}c=0;let de=0;for(a=0;a{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Fp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Fp.isSupported=function(e){return e.frameState.context.depthTexture};Fp.prototype.isDestroyed=function(){return!1};Fp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,me(this)};var Fm=Fp;var $qt=T(S(),1);var Hqt=T(S(),1);var Nqt=T(S(),1);var E2e=new D(1,1),I2e=!1,X2e=B.WHITE;function uC(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(uC.prototype,{isConstant:{get:function(){return K.isConstant(this._image)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:ue("image"),repeat:ue("repeat"),color:ue("color"),transparent:ue("transparent")});uC.prototype.getType=function(e){return"Image"};var W2e=new q;uC.prototype.getValue=function(e,t){return l(e)||(e=q.now(W2e)),l(t)||(t={}),t.image=K.getValueOrUndefined(this._image,e),t.repeat=K.getValueOrClonedDefault(this._repeat,e,E2e,t.repeat),t.color=K.getValueOrClonedDefault(this._color,e,X2e,t.color),K.getValueOrDefault(this._transparent,e,I2e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};uC.prototype.equals=function(e){return this===e||e instanceof uC&&K.equals(this._image,e._image)&&K.equals(this._repeat,e._repeat)&&K.equals(this._color,e._color)&&K.equals(this._transparent,e._transparent)};var J0=uC;function P2e(e){if(e instanceof B)return new Bt(e);if(typeof e=="string"||e instanceof Ze||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new J0;return t.image=e,t}}function v2e(e,t){return ue(e,t,P2e)}var Xo=v2e;function II(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(II.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),dimensions:ue("dimensions"),heightReference:ue("heightReference"),fill:ue("fill"),material:Xo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});II.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new II(this)};II.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Px=II;var y$t=T(S(),1);var t$t=T(S(),1),w2e={FIXED:0,INERTIAL:1},Ni=Object.freeze(w2e);var l$t=T(S(),1);function mC(){pe.throwInstantiationError()}Object.defineProperties(mC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});mC.prototype.getValue=pe.throwInstantiationError;mC.prototype.getValueInReferenceFrame=pe.throwInstantiationError;mC.prototype.equals=pe.throwInstantiationError;var Cie=new $;mC.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new m),n===i)return m.clone(t,o);let r=wt.computeIcrfToCentralBodyFixedMatrix(e,Cie);if(n===Ni.INERTIAL)return $.multiplyByVector(r,t,o);if(n===Ni.FIXED)return $.multiplyByVector($.transpose(r,Cie),t,o)};var Am=mC;function vx(e,t){this._definitionChanged=new be,this._value=m.clone(e),this._referenceFrame=y(t,Ni.FIXED)}Object.defineProperties(vx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Ni.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var F2e=new q;vx.prototype.getValue=function(e,t){return l(e)||(e=q.now(F2e)),this.getValueInReferenceFrame(e,Ni.FIXED,t)};vx.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};vx.prototype.getValueInReferenceFrame=function(e,t,n){return Am.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};vx.prototype.equals=function(e){return this===e||e instanceof vx&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Uc=vx;var L$t=T(S(),1);function XI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(XI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),width:ue("width"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),cornerType:ue("cornerType"),granularity:ue("granularity"),fill:ue("fill"),material:Xo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});XI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new XI(this)};XI.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var wx=XI;var G$t=T(S(),1);function A2e(e){return e}function M2e(e,t){return ue(e,t,A2e)}var Dc=M2e;var w$t=T(S(),1);function WI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(WI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),length:ue("length"),topRadius:ue("topRadius"),bottomRadius:ue("bottomRadius"),heightReference:ue("heightReference"),fill:ue("fill"),material:Xo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),slices:ue("slices"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});WI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new WI(this)};WI.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Fx=WI;var D$t=T(S(),1);function PI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(PI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),semiMajorAxis:ue("semiMajorAxis"),semiMinorAxis:ue("semiMinorAxis"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),rotation:ue("rotation"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Xo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});PI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new PI(this)};PI.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Ax=PI;var J$t=T(S(),1);function vI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(vI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),radii:ue("radii"),innerRadii:ue("innerRadii"),minimumClock:ue("minimumClock"),maximumClock:ue("maximumClock"),minimumCone:ue("minimumCone"),maximumCone:ue("maximumCone"),heightReference:ue("heightReference"),fill:ue("fill"),material:Xo("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),stackPartitions:ue("stackPartitions"),slicePartitions:ue("slicePartitions"),subdivisions:ue("subdivisions"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});vI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new vI(this)};vI.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Mx=vI;var ten=T(S(),1);function wI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(wI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),text:ue("text"),font:ue("font"),style:ue("style"),scale:ue("scale"),showBackground:ue("showBackground"),backgroundColor:ue("backgroundColor"),backgroundPadding:ue("backgroundPadding"),pixelOffset:ue("pixelOffset"),eyeOffset:ue("eyeOffset"),horizontalOrigin:ue("horizontalOrigin"),verticalOrigin:ue("verticalOrigin"),heightReference:ue("heightReference"),fillColor:ue("fillColor"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),translucencyByDistance:ue("translucencyByDistance"),pixelOffsetScaleByDistance:ue("pixelOffsetScaleByDistance"),scaleByDistance:ue("scaleByDistance"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance")});wI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new wI(this)};wI.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Mm=wI;var Pen=T(S(),1);var ben=T(S(),1);var aen=T(S(),1);var N2e=new m(1,1,1),k2e=m.ZERO,U2e=ve.IDENTITY;function Vie(e,t,n){this.translation=m.clone(y(e,k2e)),this.rotation=ve.clone(y(t,U2e)),this.scale=m.clone(y(n,N2e))}Vie.prototype.equals=function(e){return this===e||l(e)&&m.equals(this.translation,e.translation)&&ve.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var Q0=Vie;var zY=new Q0;function FI(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(FI.prototype,{isConstant:{get:function(){return K.isConstant(this._translation)&&K.isConstant(this._rotation)&&K.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:ue("translation"),rotation:ue("rotation"),scale:ue("scale")});var D2e=new q;FI.prototype.getValue=function(e,t){return l(e)||(e=q.now(D2e)),l(t)||(t=new Q0),t.translation=K.getValueOrClonedDefault(this._translation,e,zY.translation,t.translation),t.rotation=K.getValueOrClonedDefault(this._rotation,e,zY.rotation,t.rotation),t.scale=K.getValueOrClonedDefault(this._scale,e,zY.scale,t.scale),t};FI.prototype.equals=function(e){return this===e||e instanceof FI&&K.equals(this._translation,e._translation)&&K.equals(this._rotation,e._rotation)&&K.equals(this._scale,e._scale)};var Nx=FI;var Len=T(S(),1);function Ap(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(Ap.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var cve=new q;fC.prototype.getValue=function(e,t){l(e)||(e=q.now(cve));let n=K.getValueOrDefault(this._heightReference,e,Je.NONE),i=K.getValueOrDefault(this._extrudedHeightReference,e,Je.NONE);if(n===Je.NONE&&!nC(i))return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Eie);if(!l(r)||m.equals(r,m.ZERO)||!l(o.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,r,W.EPSILON10))return m.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=m.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return m.multiplyByScalar(s,this._terrainHeight,t)};fC.prototype.isDestroyed=function(){return!1};fC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),me(this)};var Bx=fC;function lve(e,t,n,i){if(ni.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new Um(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Bx(this._scene,s,r)}}var Up=lve;var Iie=m.ZERO,Xie=new m,dve=new m,Wie=new B;function uve(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function pd(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new uve(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(pd.prototype=Object.create(ni.prototype),pd.prototype.constructor=pd);Object.defineProperties(pd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});pd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Nn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Bt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Wie)),l(a)||(a=B.WHITE),s.color=Ht.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Iie,Xie))),new Gt({id:t,geometry:Za.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};pd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Wie),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Iie,Xie))),new Gt({id:t,geometry:wm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};pd.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};pd.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ni.prototype._isHidden.call(this,e,t)};pd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.dimensions.isConstant||!K.isConstant(t.outlineWidth)};pd.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,Oe.MINIMUM_VALUE,Je.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Bt?dn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Oe.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Je.NONE?cn.ALL:void 0};pd.prototype._onEntityPropertyChanged=Up;pd.DynamicGeometryUpdater=pC;function pC(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(pC.prototype=Object.create(ti.prototype),pC.prototype.constructor=pC);pC.prototype._isHidden=function(e,t,n){let i=K.getValueOrUndefined(e.position,n,dve),o=this._options.dimensions;return!l(i)||!l(o)||ti.prototype._isHidden.call(this,e,t,n)};pC.prototype._setOptions=function(e,t,n){let i=K.getValueOrDefault(t.heightReference,n,Je.NONE),o=this._options;o.dimensions=K.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Je.NONE?cn.ALL:void 0};var KI=pd;var Hin=T(S(),1);function Ox(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=y(n,Ni.FIXED),this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Ox.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var mve=new q;Ox.prototype.getValue=function(e,t){return l(e)||(e=q.now(mve)),this.getValueInReferenceFrame(e,Ni.FIXED,t)};Ox.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Ox.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Am.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Ox.prototype.equals=function(e){return this===e||e instanceof Ox&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var JI=Ox;var BHn=T(S(),1);var WHn=T(S(),1);var $in=T(S(),1);var Kin=T(S(),1);/*! @license DOMPurify 3.2.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.2/LICENSE */var{entries:Die,setPrototypeOf:Pie,isFrozen:hve,getPrototypeOf:fve,getOwnPropertyDescriptor:pve}=Object,{freeze:Yc,seal:Ru,create:Bie}=Object,{apply:tH,construct:nH}=typeof Reflect<"u"&&Reflect;Yc||(Yc=function(t){return t});Ru||(Ru=function(t){return t});tH||(tH=function(t,n,i){return t.apply(n,i)});nH||(nH=function(t,n){return new t(...n)});var e5=bd(Array.prototype.forEach),vie=bd(Array.prototype.pop),QI=bd(Array.prototype.push),n5=bd(String.prototype.toLowerCase),QY=bd(String.prototype.toString),wie=bd(String.prototype.match),jI=bd(String.prototype.replace),bve=bd(String.prototype.indexOf),gve=bd(String.prototype.trim),Dm=bd(Object.prototype.hasOwnProperty),Oc=bd(RegExp.prototype.test),qI=yve(TypeError);function bd(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:n5;Pie&&Pie(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(hve(t)||(t[i]=r),o=r)}e[o]=!0}return e}function xve(e){for(let t=0;t/gm),Vve=Ru(/\${[\w\W]*}/gm),Lve=Ru(/^data-[\-\w.\u00B7-\uFFFF]/),Rve=Ru(/^aria-[\-\w]+$/),Oie=Ru(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zve=Ru(/^(?:\w+script|data):/i),Gve=Ru(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yie=Ru(/^html$/i),Eve=Ru(/^[a-z][.\w]*(-[.\w]+)+$/i),kie=Object.freeze({__proto__:null,ARIA_ATTR:Rve,ATTR_WHITESPACE:Gve,CUSTOM_ELEMENT:Eve,DATA_ATTR:Lve,DOCTYPE_NAME:Yie,ERB_EXPR:Cve,IS_ALLOWED_URI:Oie,IS_SCRIPT_OR_DATA:Zve,MUSTACHE_EXPR:Sve,TMPLIT_EXPR:Vve}),eX={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ive=function(){return typeof window>"u"?null:window},Xve=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Uie=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Hie(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ive(),t=un=>Hie(un);if(t.version="3.2.2",t.removed=[],!e||!e.document||e.document.nodeType!==eX.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:g}=e,f=c.prototype,x=$I(f,"cloneNode"),_=$I(f,"remove"),C=$I(f,"nextSibling"),V=$I(f,"childNodes"),L=$I(f,"parentNode");if(typeof s=="function"){let un=n.createElement("template");un.content&&un.content.ownerDocument&&(n=un.content.ownerDocument)}let Z,G="",{implementation:I,createNodeIterator:v,createDocumentFragment:P,getElementsByTagName:w}=n,{importNode:F}=i,b=Uie();t.isSupported=typeof Die=="function"&&typeof L=="function"&&I&&I.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:R,ERB_EXPR:E,TMPLIT_EXPR:X,DATA_ATTR:A,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:Y}=kie,{IS_ALLOWED_URI:k}=kie,H=null,J=Ii({},[...Fie,...jY,...qY,...$Y,...Aie]),te=null,z=Ii({},[...Mie,...eH,...Nie,...t5]),j=Object.seal(Bie(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ee=null,fe=null,_e=!0,de=!0,ye=!1,Te=!0,Ie=!1,Le=!0,ke=!1,Be=!1,it=!1,Et=!1,yt=!1,Ne=!1,Jt=!0,Rt=!1,mt="user-content-",on=!0,Ve=!1,Ce={},rt=null,Oi=Ii({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ht=null,go=Ii({},["audio","video","img","source","image","track"]),zo=null,Ya=Ii({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Gr="http://www.w3.org/1998/Math/MathML",_s="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml",st=Fe,Ke=!1,Qe=null,pt=Ii({},[Gr,_s,Fe],QY),Yt=Ii({},["mi","mo","mn","ms","mtext"]),Cn=Ii({},["annotation-xml"]),Eo=Ii({},["title","style","font","a","script"]),So=null,Ha=["application/xhtml+xml","text/html"],za="text/html",Si=null,fi=null,ia=n.createElement("form"),zr=function(Re){return Re instanceof RegExp||Re instanceof Function},bl=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(fi&&fi===Re)){if((!Re||typeof Re!="object")&&(Re={}),Re=Yx(Re),So=Ha.indexOf(Re.PARSER_MEDIA_TYPE)===-1?za:Re.PARSER_MEDIA_TYPE,Si=So==="application/xhtml+xml"?QY:n5,H=Dm(Re,"ALLOWED_TAGS")?Ii({},Re.ALLOWED_TAGS,Si):J,te=Dm(Re,"ALLOWED_ATTR")?Ii({},Re.ALLOWED_ATTR,Si):z,Qe=Dm(Re,"ALLOWED_NAMESPACES")?Ii({},Re.ALLOWED_NAMESPACES,QY):pt,zo=Dm(Re,"ADD_URI_SAFE_ATTR")?Ii(Yx(Ya),Re.ADD_URI_SAFE_ATTR,Si):Ya,ht=Dm(Re,"ADD_DATA_URI_TAGS")?Ii(Yx(go),Re.ADD_DATA_URI_TAGS,Si):go,rt=Dm(Re,"FORBID_CONTENTS")?Ii({},Re.FORBID_CONTENTS,Si):Oi,ee=Dm(Re,"FORBID_TAGS")?Ii({},Re.FORBID_TAGS,Si):{},fe=Dm(Re,"FORBID_ATTR")?Ii({},Re.FORBID_ATTR,Si):{},Ce=Dm(Re,"USE_PROFILES")?Re.USE_PROFILES:!1,_e=Re.ALLOW_ARIA_ATTR!==!1,de=Re.ALLOW_DATA_ATTR!==!1,ye=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ie=Re.SAFE_FOR_TEMPLATES||!1,Le=Re.SAFE_FOR_XML!==!1,ke=Re.WHOLE_DOCUMENT||!1,Et=Re.RETURN_DOM||!1,yt=Re.RETURN_DOM_FRAGMENT||!1,Ne=Re.RETURN_TRUSTED_TYPE||!1,it=Re.FORCE_BODY||!1,Jt=Re.SANITIZE_DOM!==!1,Rt=Re.SANITIZE_NAMED_PROPS||!1,on=Re.KEEP_CONTENT!==!1,Ve=Re.IN_PLACE||!1,k=Re.ALLOWED_URI_REGEXP||Oie,st=Re.NAMESPACE||Fe,Yt=Re.MATHML_TEXT_INTEGRATION_POINTS||Yt,Cn=Re.HTML_INTEGRATION_POINTS||Cn,j=Re.CUSTOM_ELEMENT_HANDLING||{},Re.CUSTOM_ELEMENT_HANDLING&&zr(Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(j.tagNameCheck=Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&zr(Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(j.attributeNameCheck=Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(j.allowCustomizedBuiltInElements=Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(de=!1),yt&&(Et=!0),Ce&&(H=Ii({},Aie),te=[],Ce.html===!0&&(Ii(H,Fie),Ii(te,Mie)),Ce.svg===!0&&(Ii(H,jY),Ii(te,eH),Ii(te,t5)),Ce.svgFilters===!0&&(Ii(H,qY),Ii(te,eH),Ii(te,t5)),Ce.mathMl===!0&&(Ii(H,$Y),Ii(te,Nie),Ii(te,t5))),Re.ADD_TAGS&&(H===J&&(H=Yx(H)),Ii(H,Re.ADD_TAGS,Si)),Re.ADD_ATTR&&(te===z&&(te=Yx(te)),Ii(te,Re.ADD_ATTR,Si)),Re.ADD_URI_SAFE_ATTR&&Ii(zo,Re.ADD_URI_SAFE_ATTR,Si),Re.FORBID_CONTENTS&&(rt===Oi&&(rt=Yx(rt)),Ii(rt,Re.FORBID_CONTENTS,Si)),on&&(H["#text"]=!0),ke&&Ii(H,["html","head","body"]),H.table&&(Ii(H,["tbody"]),delete ee.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw qI('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qI('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=Re.TRUSTED_TYPES_POLICY,G=Z.createHTML("")}else Z===void 0&&(Z=Xve(g,o)),Z!==null&&typeof G=="string"&&(G=Z.createHTML(""));Yc&&Yc(Re),fi=Re}},yo=Ii({},[...jY,...qY,..._ve]),Er=Ii({},[...$Y,...Tve]),fp=function(Re){let Pt=L(Re);(!Pt||!Pt.tagName)&&(Pt={namespaceURI:st,tagName:"template"});let gn=n5(Re.tagName),pr=n5(Pt.tagName);return Qe[Re.namespaceURI]?Re.namespaceURI===_s?Pt.namespaceURI===Fe?gn==="svg":Pt.namespaceURI===Gr?gn==="svg"&&(pr==="annotation-xml"||Yt[pr]):!!yo[gn]:Re.namespaceURI===Gr?Pt.namespaceURI===Fe?gn==="math":Pt.namespaceURI===_s?gn==="math"&&Cn[pr]:!!Er[gn]:Re.namespaceURI===Fe?Pt.namespaceURI===_s&&!Cn[pr]||Pt.namespaceURI===Gr&&!Yt[pr]?!1:!Er[gn]&&(Eo[gn]||!yo[gn]):!!(So==="application/xhtml+xml"&&Qe[Re.namespaceURI]):!1},Kr=function(Re){QI(t.removed,{element:Re});try{L(Re).removeChild(Re)}catch{_(Re)}},du=function(Re,Pt){try{QI(t.removed,{attribute:Pt.getAttributeNode(Re),from:Pt})}catch{QI(t.removed,{attribute:null,from:Pt})}if(Pt.removeAttribute(Re),Re==="is")if(Et||yt)try{Kr(Pt)}catch{}else try{Pt.setAttribute(Re,"")}catch{}},Ka=function(Re){let Pt=null,gn=null;if(it)Re=""+Re;else{let Ca=wie(Re,/^[\r\n\t ]+/);gn=Ca&&Ca[0]}So==="application/xhtml+xml"&&st===Fe&&(Re=''+Re+"");let pr=Z?Z.createHTML(Re):Re;if(st===Fe)try{Pt=new p().parseFromString(pr,So)}catch{}if(!Pt||!Pt.documentElement){Pt=I.createDocument(st,"template",null);try{Pt.documentElement.innerHTML=Ke?G:pr}catch{}}let Ja=Pt.body||Pt.documentElement;return Re&&gn&&Ja.insertBefore(n.createTextNode(gn),Ja.childNodes[0]||null),st===Fe?w.call(Pt,ke?"html":"body")[0]:ke?Pt.documentElement:Ja},Jy=function(Re){return v.call(Re.ownerDocument||Re,Re,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Sa=function(Re){return Re instanceof h&&(typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||!(Re.attributes instanceof u)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function")},gl=function(Re){return typeof a=="function"&&Re instanceof a};function Ic(un,Re,Pt){e5(un,gn=>{gn.call(t,Re,Pt,fi)})}let cs=function(Re){let Pt=null;if(Ic(b.beforeSanitizeElements,Re,null),Sa(Re))return Kr(Re),!0;let gn=Si(Re.nodeName);if(Ic(b.uponSanitizeElement,Re,{tagName:gn,allowedTags:H}),Re.hasChildNodes()&&!gl(Re.firstElementChild)&&Oc(/<[/\w]/g,Re.innerHTML)&&Oc(/<[/\w]/g,Re.textContent)||Re.nodeType===eX.progressingInstruction||Le&&Re.nodeType===eX.comment&&Oc(/<[/\w]/g,Re.data))return Kr(Re),!0;if(!H[gn]||ee[gn]){if(!ee[gn]&&mu(gn)&&(j.tagNameCheck instanceof RegExp&&Oc(j.tagNameCheck,gn)||j.tagNameCheck instanceof Function&&j.tagNameCheck(gn)))return!1;if(on&&!rt[gn]){let pr=L(Re)||Re.parentNode,Ja=V(Re)||Re.childNodes;if(Ja&&pr){let Ca=Ja.length;for(let yl=Ca-1;yl>=0;--yl){let Kh=x(Ja[yl],!0);Kh.__removalCount=(Re.__removalCount||0)+1,pr.insertBefore(Kh,C(Re))}}}return Kr(Re),!0}return Re instanceof c&&!fp(Re)||(gn==="noscript"||gn==="noembed"||gn==="noframes")&&Oc(/<\/no(script|embed|frames)/i,Re.innerHTML)?(Kr(Re),!0):(Ie&&Re.nodeType===eX.text&&(Pt=Re.textContent,e5([R,E,X],pr=>{Pt=jI(Pt,pr," ")}),Re.textContent!==Pt&&(QI(t.removed,{element:Re.cloneNode()}),Re.textContent=Pt)),Ic(b.afterSanitizeElements,Re,null),!1)},uu=function(Re,Pt,gn){if(Jt&&(Pt==="id"||Pt==="name")&&(gn in n||gn in ia))return!1;if(!(de&&!fe[Pt]&&Oc(A,Pt))){if(!(_e&&Oc(N,Pt))){if(!te[Pt]||fe[Pt]){if(!(mu(Re)&&(j.tagNameCheck instanceof RegExp&&Oc(j.tagNameCheck,Re)||j.tagNameCheck instanceof Function&&j.tagNameCheck(Re))&&(j.attributeNameCheck instanceof RegExp&&Oc(j.attributeNameCheck,Pt)||j.attributeNameCheck instanceof Function&&j.attributeNameCheck(Pt))||Pt==="is"&&j.allowCustomizedBuiltInElements&&(j.tagNameCheck instanceof RegExp&&Oc(j.tagNameCheck,gn)||j.tagNameCheck instanceof Function&&j.tagNameCheck(gn))))return!1}else if(!zo[Pt]){if(!Oc(k,jI(gn,U,""))){if(!((Pt==="src"||Pt==="xlink:href"||Pt==="href")&&Re!=="script"&&bve(gn,"data:")===0&&ht[Re])){if(!(ye&&!Oc(O,jI(gn,U,"")))){if(gn)return!1}}}}}}return!0},mu=function(Re){return Re!=="annotation-xml"&&wie(Re,Y)},hu=function(Re){Ic(b.beforeSanitizeAttributes,Re,null);let{attributes:Pt}=Re;if(!Pt)return;let gn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0},pr=Pt.length;for(;pr--;){let Ja=Pt[pr],{name:Ca,namespaceURI:yl,value:Kh}=Ja,FL=Si(Ca),Xc=Ca==="value"?Kh:gve(Kh);if(gn.attrName=FL,gn.attrValue=Xc,gn.keepAttr=!0,gn.forceKeepAttr=void 0,Ic(b.uponSanitizeAttribute,Re,gn),Xc=gn.attrValue,Rt&&(FL==="id"||FL==="name")&&(du(Ca,Re),Xc=mt+Xc),Le&&Oc(/((--!?|])>)|<\/(style|title)/i,Xc)){du(Ca,Re);continue}if(gn.forceKeepAttr||(du(Ca,Re),!gn.keepAttr))continue;if(!Te&&Oc(/\/>/i,Xc)){du(Ca,Re);continue}Ie&&e5([R,E,X],tq=>{Xc=jI(Xc,tq," ")});let eq=Si(Re.nodeName);if(uu(eq,FL,Xc)){if(Z&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!yl)switch(g.getAttributeType(eq,FL)){case"TrustedHTML":{Xc=Z.createHTML(Xc);break}case"TrustedScriptURL":{Xc=Z.createScriptURL(Xc);break}}try{yl?Re.setAttributeNS(yl,Ca,Xc):Re.setAttribute(Ca,Xc),Sa(Re)?Kr(Re):vie(t.removed)}catch{}}}Ic(b.afterSanitizeAttributes,Re,null)},Ao=function un(Re){let Pt=null,gn=Jy(Re);for(Ic(b.beforeSanitizeShadowDOM,Re,null);Pt=gn.nextNode();)Ic(b.uponSanitizeShadowNode,Pt,null),!cs(Pt)&&(Pt.content instanceof r&&un(Pt.content),hu(Pt));Ic(b.afterSanitizeShadowDOM,Re,null)};return t.sanitize=function(un){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Pt=null,gn=null,pr=null,Ja=null;if(Ke=!un,Ke&&(un=""),typeof un!="string"&&!gl(un))if(typeof un.toString=="function"){if(un=un.toString(),typeof un!="string")throw qI("dirty is not a string, aborting")}else throw qI("toString is not a function");if(!t.isSupported)return un;if(Be||bl(Re),t.removed=[],typeof un=="string"&&(Ve=!1),Ve){if(un.nodeName){let Kh=Si(un.nodeName);if(!H[Kh]||ee[Kh])throw qI("root node is forbidden and cannot be sanitized in-place")}}else if(un instanceof a)Pt=Ka(""),gn=Pt.ownerDocument.importNode(un,!0),gn.nodeType===eX.element&&gn.nodeName==="BODY"||gn.nodeName==="HTML"?Pt=gn:Pt.appendChild(gn);else{if(!Et&&!Ie&&!ke&&un.indexOf("<")===-1)return Z&&Ne?Z.createHTML(un):un;if(Pt=Ka(un),!Pt)return Et?null:Ne?G:""}Pt&&it&&Kr(Pt.firstChild);let Ca=Jy(Ve?un:Pt);for(;pr=Ca.nextNode();)cs(pr)||(pr.content instanceof r&&Ao(pr.content),hu(pr));if(Ve)return un;if(Et){if(yt)for(Ja=P.call(Pt.ownerDocument);Pt.firstChild;)Ja.appendChild(Pt.firstChild);else Ja=Pt;return(te.shadowroot||te.shadowrootmode)&&(Ja=F.call(i,Ja,!0)),Ja}let yl=ke?Pt.outerHTML:Pt.innerHTML;return ke&&H["!doctype"]&&Pt.ownerDocument&&Pt.ownerDocument.doctype&&Pt.ownerDocument.doctype.name&&Oc(Yie,Pt.ownerDocument.doctype.name)&&(yl=" -`+yl),Ie&&e5([R,E,X],Kh=>{yl=jI(yl,Kh," ")}),Z&&Ne?Z.createHTML(yl):yl},t.setConfig=function(){let un=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bl(un),Be=!0},t.clearConfig=function(){fi=null,Be=!1},t.isValidAttribute=function(un,Re,Pt){fi||bl({});let gn=Si(un),pr=Si(Re);return uu(gn,pr,Pt)},t.addHook=function(un,Re){typeof Re=="function"&&QI(b[un],Re)},t.removeHook=function(un){return vie(b[un])},t.removeHooks=function(un){b[un]=[]},t.removeAllHooks=function(){b=Uie()},t}var zie=Hie();var Wve=0,iH={};function df(e,t){let n,i=e;l(iH[i])?n=iH[i]:(n=Wve++,iH[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(df.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=zie.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i{u[h]=void 0});for(let h=r;h0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function Pve(e,t){if(Bm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Bm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}tX.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;D.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(Pve(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};tX.prototype.isDestroyed=function(){return!1};tX.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),me(this)};var zx=tX;var Ion=T(S(),1),sH=T(rd(),1);var Son=T(S(),1);var rH,Kie="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0ZDdmNWJiNy0wMmNlLTQ1MWUtODM2YS02NGM1MTBlOGMwMWQiLCJpZCI6MjU5LCJpYXQiOjE3MzMxNTc4OTV9.B3URHf0VdHDtGckb-hv7uqATdn8KfvkiuoAFZUq8tAo",i5={};i5.defaultAccessToken=Kie;i5.defaultServer=new Ze({url:"https://api.cesium.com/"});i5.getDefaultTokenCredit=function(e){if(e===Kie){if(!l(rH)){let t=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.`;rH=new Ct(t,!0)}return rH}};var Om=i5;function Hc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:vve};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ae("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ze.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new sH.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(Hc.prototype=Object.create(Ze.prototype),Hc.prototype.constructor=Hc);Hc.fromAssetId=function(e,t){let n=Hc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Hc(i,n)})};Object.defineProperties(Hc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Hc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Hc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Ct.getIonCredit),i=Om.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Ct.clone(i)),n};Hc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Hc(t._ionEndpoint,t._ionEndpointResource)),e=Ze.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Hc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ze.prototype.fetchImage.call(this,e)};Hc.prototype._makeRequest=function(e){return this._isExternal||new sH.default(this.url).authority()!==this._ionEndpointDomain?Ze.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Ze.prototype._makeRequest.call(this,e))};Hc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,Om.defaultServer),i=y(t.accessToken,Om.defaultAccessToken);n=Ze.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function vve(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var gd=Hc;var Pon=T(S(),1);function uf(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(uf.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(et.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});uf.prototype.get=function(e){return this._array[e]};uf.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};uf.prototype.peek=function(){return this._array[this._length-1]};uf.prototype.push=function(e){let t=this.length++;this._array[t]=e};uf.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};uf.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};uf.prototype.resize=function(e){this.length=e};uf.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var zc=uf;var Aon=T(S(),1);var Dp={X:0,Y:1,Z:2};Dp.Y_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));Dp.Z_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));Dp.X_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));Dp.Z_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));Dp.X_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));Dp.Y_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));Dp.fromName=function(e){return Dp[e]};var Wo=Object.freeze(Dp);var H3n=T(S(),1);var kon=T(S(),1);function Jie(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(Jie.prototype,{metadata:{get:function(){return this._metadata}}});var Kx=Jie;var xkn=T(S(),1);var nrn=T(S(),1);var Kon=T(S(),1);var Oon=T(S(),1);function j0(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),j0.decode(e)}j0.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};j0.decodeWithFromCharCode=function(e){let t="",n=wve(e),i=n.length;for(let o=0;o>10)+55296,(r&1023)+56320))}return t};function nX(e,t,n){return t<=e&&e<=n}function wve(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c0){let o=Math.min(t,At.maximumTextureSize),r=Math.ceil(t/At.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new D(o,r),i=new se(s,a,c,d)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(ac.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});ac.DEFAULT_COLOR_VALUE=B.WHITE;ac.DEFAULT_SHOW_VALUE=!0;function Qie(e){let t=e._textureDimensions;return t.x*t.y*4}function jie(e){if(!l(e._batchValues)){let t=Qie(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function qie(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}ac.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=qie(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=jie(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};ac.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,o=Qie(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c0;){if(t=u.pop(),c[t]===d)continue;c[t]=d;let h=n(e,t);if(l(h))return h;let p=o[t],g=s[t];for(let f=0;f0?(s="",e&&(s+=`uniform bool tile_translucentCommand; -`),s+=`uniform sampler2D tile_batchTexture; -out vec4 tile_featureColor; -out vec2 tile_featureSt; -void main() -{ - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; -void main() -{ - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${r} -${awe(i)}${s}`}};function eoe(e,t){return e=De.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function cwe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};ho.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=De.replaceMain(e,"tile_main"),At.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_main(); - out_FragColor = tile_featureColor; - out_FragColor.rgb *= out_FragColor.a; -}`:e+=`uniform sampler2D tile_batchTexture; -uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -void main() -{ - tile_main(); - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } - out_FragColor = featureProperties; - out_FragColor.rgb *= out_FragColor.a; -} -`,e}};function lwe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===El.HIGHLIGHT)return 0;if(n===El.REPLACE)return 1;if(n===El.MIX)return W.clamp(i,W.EPSILON4,1)}ho.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return St(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return lwe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};ho.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var q0={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};ho.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=dwe(this);for(let d=t;d>>Dt.SKIP_LOD_BIT_SHIFT}function ywe(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=mn.ALPHA_BLEND,t.stencilTest=Dt.setCesium3DTileBit(),t.stencilMask=Dt.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}function xwe(e){let t=Ye(e,!0);return t.stencilTest=Dt.setCesium3DTileBit(),t.stencilMask=Dt.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}ho.prototype.update=function(e,t){this._batchTexture.update(e,t)};ho.prototype.isDestroyed=function(){return!1};ho.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var Op=ho;var San=T(S(),1);var hsn=T(S(),1);function _we(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var mf=_we;var lan=T(S(),1);var gsn=T(S(),1);function Gu(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Gu.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new B),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Gu.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Gu.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Gu.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Gu.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let d=e.tileset.metadata;if(l(d)){if(d.hasPropertyBySemantic(n))return d.getPropertyBySemantic(n);if(d.hasProperty(n))return d.getProperty(n)}};Gu.prototype.getPropertyInherited=function(e){return Gu.getPropertyInherited(this._content,this._batchId,e)};Gu.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Gu.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Gu.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Gu.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var ks=Gu;var Psn=T(S(),1);var _sn=T(S(),1),lH=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},dH=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Il=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.lengthr.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+d),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Il.max_unop_len=Il.getMaxKeyLen(Il.unary_ops);Il.max_binop_len=Il.getMaxKeyLen(Il.binary_ops);var $0=e=>new Il(e).parse(),Swe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Il).filter(e=>!Swe.includes(e)&&$0[e]===void 0).forEach(e=>{$0[e]=Il[e]});$0.Jsep=Il;var Cwe="ConditionalExpression",Vwe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:Cwe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};$0.plugins.register(Vwe);var Ssn=T(S(),1),Lwe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},bt=Object.freeze(Lwe);function Hm(e,t){this._expression=e,e=Mwe(e,t),e=kwe(Nwe(e)),$0.addBinaryOp("=~",0),$0.addBinaryOp("!~",0);let n;try{n=$0(e)}catch(i){throw new ae(i)}this._runtimeAst=Ci(this,n)}Object.defineProperties(Hm.prototype,{expression:{get:function(){return this._expression}}});var vn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new D],cartesian3Array:[new m],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new D),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};Hm.prototype.evaluate=function(e,t){vn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof B&&n instanceof se?B.fromCartesian4(n,t):n instanceof D||n instanceof m||n instanceof se?n.clone(t):n};Hm.prototype.evaluateColor=function(e,t){vn.reset();let n=this._runtimeAst.evaluate(e);return B.fromCartesian4(n,t)};Hm.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} -{ - return ${o}; -} -`,o};Hm.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Hm.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Rwe=["!","-","+"],ioe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],s5=/\${(.*?)}/g,Zwe=/\\/g,Gwe="@#%",Ewe=/@#%/g,a5=new B,c5={abs:Us(Math.abs),sqrt:Us(Math.sqrt),cos:Us(Math.cos),sin:Us(Math.sin),tan:Us(Math.tan),acos:Us(Math.acos),asin:Us(Math.asin),atan:Us(Math.atan),radians:Us(W.toRadians),degrees:Us(W.toDegrees),sign:Us(W.sign),floor:Us(Math.floor),ceil:Us(Math.ceil),round:Us(Math.round),exp:Us(Math.exp),exp2:Us(Xwe),log:Us(Math.log),log2:Us(Wwe),fract:Us(Iwe),length:Pwe,normalize:vwe},l5={atan2:o5(Math.atan2,!1),pow:o5(Math.pow,!1),min:o5(Math.min,!0),max:o5(Math.max,!0),distance:wwe,dot:Fwe,cross:Awe},hH={clamp:ooe(W.clamp,!0),mix:ooe(W.lerp,!0)};function Iwe(e){return e-Math.floor(e)}function Xwe(e){return Math.pow(2,e)}function Wwe(e){return W.log2(e)}function Us(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof D)return D.fromElements(e(n.x),e(n.y),vn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),vn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),vn.getCartesian4());throw new ae(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function o5(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof D)return D.fromElements(e(i.x,o),e(i.y,o),vn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),vn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),vn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x),e(i.y,o.y),vn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),vn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),vn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function ooe(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),vn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),vn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),vn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof D&&o instanceof D&&r instanceof D)return D.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),vn.getCartesian2());if(i instanceof m&&o instanceof m&&r instanceof m)return m.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),vn.getCartesian3());if(i instanceof se&&o instanceof se&&r instanceof se)return se.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),vn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function Pwe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof D)return D.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function vwe(e,t){if(typeof t=="number")return 1;if(t instanceof D)return D.normalize(t,vn.getCartesian2());if(t instanceof m)return m.normalize(t,vn.getCartesian3());if(t instanceof se)return se.normalize(t,vn.getCartesian4());throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function wwe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof D&&n instanceof D)return D.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Fwe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof D&&n instanceof D)return D.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Awe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,vn.getCartesian3());throw new ae(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Vt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,Qwe(this)}function Mwe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function Nwe(e){return e.replace(Zwe,Gwe)}function mH(e){return e.replace(Ewe,"\\")}function kwe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o=0&&r=0?new Vt(bt.VARIABLE_IN_STRING,e.value):new Vt(bt.LITERAL_STRING,mH(e.value))}function Dwe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new ae(`${o} is not a function.`);return i===0?o==="test"?new Vt(bt.LITERAL_BOOLEAN,!1):new Vt(bt.LITERAL_NULL,null):(s=Ci(e,c),a=Ci(e,n[0]),new Vt(bt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Ci(e,c),new Vt(bt.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Vt(bt.LITERAL_COLOR,o);if(r=Ci(e,n[0]),l(n[1])){let c=Ci(e,n[1]);return new Vt(bt.LITERAL_COLOR,o,[r,c])}return new Vt(bt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[Ci(e,n[0]),Ci(e,n[1]),Ci(e,n[2])],new Vt(bt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[Ci(e,n[0]),Ci(e,n[1]),Ci(e,n[2]),Ci(e,n[3])],new Vt(bt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c1)throw new ae(`${o} requires exactly one argument.`);return r=Ci(e,n[0]),new Vt(bt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new Vt(bt.UNARY,o)}else if(l(c5[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=Ci(e,n[0]),new Vt(bt.UNARY,o,r)}else if(l(l5[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=Ci(e,n[0]),a=Ci(e,n[1]),new Vt(bt.BINARY,o,s,a)}else if(l(hH[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=Ci(e,n[0]),a=Ci(e,n[1]);let c=Ci(e,n[2]);return new Vt(bt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Vt(bt.LITERAL_BOOLEAN,!1):(r=Ci(e,n[0]),new Vt(bt.UNARY,o,r));if(o==="Number")return i===0?new Vt(bt.LITERAL_NUMBER,0):(r=Ci(e,n[0]),new Vt(bt.UNARY,o,r));if(o==="String")return i===0?new Vt(bt.LITERAL_STRING,""):(r=Ci(e,n[0]),new Vt(bt.UNARY,o,r));if(o==="regExp")return Bwe(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function Bwe(e,t){let n=t.arguments;if(n.length===0)return new Vt(bt.LITERAL_REGEX,new RegExp);let i=Ci(e,n[0]),o;if(n.length>1){let r=Ci(e,n[1]);if(uH(i)&&uH(r)){try{o=new RegExp(mH(String(i._value)),r._value)}catch(s){throw new ae(s)}return new Vt(bt.LITERAL_REGEX,o)}return new Vt(bt.REGEX,i,r)}if(uH(i)){try{o=new RegExp(mH(String(i._value)))}catch(r){throw new ae(r)}return new Vt(bt.LITERAL_REGEX,o)}return new Vt(bt.REGEX,i)}function Owe(e){if(Kwe(e.name)){let t=Jwe(e.name);return t.substr(0,8)==="tiles3d_"?new Vt(bt.BUILTIN_VARIABLE,t):new Vt(bt.VARIABLE,t)}else{if(e.name==="NaN")return new Vt(bt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Vt(bt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Vt(bt.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function Ywe(e){let t=e.property.name;if(t==="PI")return new Vt(bt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Vt(bt.LITERAL_NUMBER,Math.E)}function Hwe(e){if(e.property.name==="POSITIVE_INFINITY")return new Vt(bt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function zwe(e,t){if(t.object.name==="Math")return Ywe(t);if(t.object.name==="Number")return Hwe(t);let n,i=Ci(e,t.object);return t.computed?(n=Ci(e,t.property),new Vt(bt.MEMBER,"brackets",i,n)):(n=new Vt(bt.LITERAL_STRING,t.property.name),new Vt(bt.MEMBER,"dot",i,n))}function uH(e){return e._type>=bt.LITERAL_NULL}function Kwe(e){return e.substr(0,4)==="czm_"}function Jwe(e){return e.substr(4)}function Ci(e,t){let n,i,o,r;if(t.type==="Literal")n=Uwe(t);else if(t.type==="CallExpression")n=Dwe(e,t);else if(t.type==="Identifier")n=Owe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ci(e,t.argument);if(Rwe.indexOf(i)>-1)n=new Vt(bt.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Ci(e,t.left),r=Ci(e,t.right),ioe.indexOf(i)>-1)n=new Vt(bt.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Ci(e,t.left),r=Ci(e,t.right),ioe.indexOf(i)>-1&&(n=new Vt(bt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Ci(e,t.test);o=Ci(e,t.consequent),r=Ci(e,t.alternate),n=new Vt(bt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=zwe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(l5[e._value])&&(e.evaluate=$we(e._value)):e._type===bt.TERNARY?e.evaluate=eFe(e._value):e._type===bt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===bt.ARRAY?e.evaluate=e._evaluateArray:e._type===bt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===bt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===bt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===bt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===bt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===bt.REGEX?e.evaluate=e._evaluateRegExp:e._type===bt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=jwe):e.evaluate=e._evaluateLiteral}function jwe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function qwe(e){let t=c5[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function $we(e){let t=l5[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function eFe(e){let t=hH[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function d5(e,t){if(l(e))return e.getPropertyInherited(t)}Vt.prototype._evaluateLiteral=function(){return this._value};Vt.prototype._evaluateLiteralColor=function(e){let t=a5,n=this._left;if(this._value==="color")l(n)?n.length>1?(B.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):B.fromCssColorString(n[0].evaluate(e),t):B.fromBytes(255,255,255,255,t);else if(this._value==="rgb")B.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;B.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?B.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&B.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,vn.getCartesian4())};Vt.prototype._evaluateLiteralVector=function(e){let t=vn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a1)throw new ae(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ae(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return D.fromArray(t,0,vn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,vn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,vn.getCartesian4())};Vt.prototype._evaluateLiteralString=function(){return this._value};Vt.prototype._evaluateVariableString=function(e){let t=this._value,n=s5.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=d5(e,o);l(r)||(r=""),t=t.replace(i,r),n=s5.exec(t)}return t};Vt.prototype._evaluateVariable=function(e){return d5(e,this._value)};function Qx(e){return e._value==="feature"}Vt.prototype._evaluateMemberDot=function(e){if(Qx(this._left))return d5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof m||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Vt.prototype._evaluateMemberBrackets=function(e){if(Qx(this._left))return d5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof m||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Vt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Vt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Vt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Vt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Vt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.add(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,vn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ae(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.subtract(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ae(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.multiplyComponents(t,n,vn.getCartesian2());if(n instanceof D&&typeof t=="number")return D.multiplyByScalar(n,t,vn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.multiplyByScalar(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,vn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,vn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,vn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,vn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ae(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.divideComponents(t,n,vn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.divideByScalar(t,n,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,vn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,vn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ae(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.fromElements(t.x%n.x,t.y%n.y,vn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ae(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof m&&t instanceof m||n instanceof se&&t instanceof se?t.equals(n):t===n};Vt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof m&&t instanceof m||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Vt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ae(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Vt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Vt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Vt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Vt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Vt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Vt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Vt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Vt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Vt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ae(o)}return i};Vt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Vt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new ae(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new ae(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Vt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof D||t instanceof m||t instanceof se)return String(t);throw new ae(`Unexpected function call "${this._value}".`)};function roe(e){let t=e._left,n=t.length;for(let a=0;a1){let p=d[0],g=d[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=soe(this),l(i)?r5(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(c==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=soe(this),l(i)?r5(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=roe(this),l(i)?r5(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=roe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),r5(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case bt.LITERAL_VECTOR:u=o.length,h=`${c}(`;for(let p=0;p0;){let u=t.pop();if(B.equals(u.color,a.color))d=fH(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let h=d;d=fH(n,s,d,i,o,u.batchIds,r),u.offset=h,u.count=d-h,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function pH(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let d=0;d0;){let h=t.pop();if(B.equals(h.color,r.color))d=pH(a,c,d,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=d-r.offset;else{let p=d;d=pH(a,c,d,n,i,h.batchIds,o),h.offset=p,h.count=d-p,s.push(h),r=h}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function uFe(e,t){return t.color.toRgba()-e.color.toRgba()}function mFe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s=x&&s{e.isDestroyed()||(e._error=f)}):void 0}}function GFe(e){l(e._primitive)||(e._primitive=new qx({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}xd.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};xd.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};xd.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};xd.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};xd.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=ZFe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};xd.prototype.isDestroyed=function(){return!1};xd.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var Hp=xd;function hf(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,XFe(this,i,o)}Object.defineProperties(hf.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function EFe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function IFe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),d=y(e.ELLIPSOIDS_LENGTH,0),u=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let f=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let f=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,f,c)}if(d>0&&l(e.ELLIPSOID_BATCH_IDS)){let f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,f,d)}if(u>0&&l(e.SPHERE_BATCH_IDS)){let f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,f,u)}let h=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||d>0&&!l(o)||u>0&&!l(r);if(h&&p)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let f=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s0)for(i=new Uint16Array(c),s=0;s0)for(o=new Uint16Array(d),s=0;s0)for(r=new Uint16Array(u),s=0;s0&&(g=Po(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let x=y(h.BOXES_LENGTH,0),_=y(h.CYLINDERS_LENGTH,0),C=y(h.ELLIPSOIDS_LENGTH,0),V=y(h.SPHERES_LENGTH,0),L=x+_+C+V,Z=new Op(e,L,g,f,EFe(e));if(e._batchTable=Z,L===0)return;let G=e.tile.computedTransform,I;l(h.RTC_CENTER)&&(I=m.unpack(h.RTC_CENTER),M.multiplyByPoint(G,I,I));let v=IFe(h,p);if(x>0||_>0||C>0||V>0){let P,w,F,b;if(x>0){let R=p.byteOffset+h.BOXES.byteOffset;P=new Float32Array(p.buffer,R,Hp.packedBoxLength*x)}if(_>0){let R=p.byteOffset+h.CYLINDERS.byteOffset;w=new Float32Array(p.buffer,R,Hp.packedCylinderLength*_)}if(C>0){let R=p.byteOffset+h.ELLIPSOIDS.byteOffset;F=new Float32Array(p.buffer,R,Hp.packedEllipsoidLength*C)}if(V>0){let R=p.byteOffset+h.SPHERES.byteOffset;b=new Float32Array(p.buffer,R,Hp.packedSphereLength*V)}return e._geometries=new Hp({boxes:P,boxBatchIds:v.boxes,cylinders:w,cylinderBatchIds:v.cylinders,ellipsoids:F,ellipsoidBatchIds:v.ellipsoids,spheres:b,sphereBatchIds:v.spheres,center:I,modelMatrix:G,batchTable:Z,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function moe(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}hf.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};hf.prototype.getFeature=function(e){return moe(this),this._features[e]};hf.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};hf.prototype.applyStyle=function(e){moe(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};hf.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};hf.prototype.pick=function(e,t,n){};hf.prototype.isDestroyed=function(){return!1};hf.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};var sX=hf;var gbn=T(S(),1);var wan=T(S(),1);var bH={};bH.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),hoe(i,o,r,s);return c};bH.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s>>0,gH=2*e_+1,tg=4,boe=[],goe=[],vFe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],ng=1,gC=2,u5=[ng,0,0,ng|gC];function qr(e){if(!Ot.supportsBigInt())throw new ae("S2 required BigInt support");this._cellId=e,this._level=qr.getLevel(e)}qr.fromToken=function(e){return new qr(qr.getIdFromToken(e))};qr.isValidId=function(e){return!(e<=0||e>>BigInt(gH)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};qr.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?qr.isValidId(qr.getIdFromToken(e)):!1};qr.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};qr.getTokenFromId=function(e){let t=Math.floor(OFe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};qr.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return e_-(t>>1)};qr.prototype.getChild=function(e){let t=_oe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new qr(n)};qr.prototype.getParent=function(){let e=_oe(this._cellId)<>1&1;return xoe(i[0],o[0][r^n&1],o[1][r])}function AFe(e,t){let n=yoe(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,d=(o<<1)+c,u=(r<<1)+c;return[i,d,u]}function yoe(e){boe.length===0&&UFe();let t=Number(e>>BigInt(gH)),n=t&ng,i=(1<=0;s--){let c=(1<<2*(s===7?e_-7*tg:tg))-1;n+=Number(e>>BigInt(s*2*tg+1)&BigInt(c))<<2,n=goe[n];let d=s*tg;o+=n>>tg+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function foe(e){return 1/PFe*e}function NFe(e,t){let n=[[],[]],i=kFe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=m5(poe(r)),n[o][1]=m5(poe(s))}return n}function kFe(e){return 1<>>0}function poe(e){return 1/WFe*e}function ig(e,t,n,i,o,r){if(e===tg){let s=(t<>1),n+(s[0]&1),i,o,r^u5[0]),ig(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^u5[1]),ig(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^u5[2]),ig(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^u5[3])}}function UFe(){ig(0,0,0,0,0,0),ig(0,0,0,ng,0,ng),ig(0,0,0,gC,0,gC),ig(0,0,0,ng|gC,0,ng|gC)}function _oe(e){return e&~e+BigInt(1)}function DFe(e){return BigInt(1)<>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(yH.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});yH.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var yC=yH;var ecn=T(S(),1);function Kp(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Kp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Kp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Kp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Kp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Kp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Kp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Kp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Kp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var xC=Kp;var ncn=T(S(),1);var h5={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};h5.getBranchingFactor=function(e){switch(e){case h5.OCTREE:return 8;case h5.QUADTREE:return 4}};var $r=Object.freeze(h5);var mcn=T(S(),1);var acn=T(S(),1);function ca(){}Object.defineProperties(ca.prototype,{class:{get:function(){pe.throwInstantiationError()}}});ca.prototype.hasProperty=function(e){pe.throwInstantiationError()};ca.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};ca.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};ca.prototype.getProperty=function(e){pe.throwInstantiationError()};ca.prototype.setProperty=function(e,t){pe.throwInstantiationError()};ca.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};ca.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};ca.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};ca.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};ca.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};ca.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ca.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};ca.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return ca.getProperty(o.id,t,n)};ca.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?ca.setProperty(r.id,t,n,i):!1};var Mn=ca;function Jp(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Jp.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Jp.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Jp.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Jp.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Jp.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Jp.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Jp.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var aX=Jp;var iln=T(S(),1);var Qcn=T(S(),1);var gcn=T(S(),1);var Mt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Mt.getMinimum=function(e){switch(e){case Mt.INT8:return-128;case Mt.UINT8:return 0;case Mt.INT16:return-32768;case Mt.UINT16:return 0;case Mt.INT32:return-2147483648;case Mt.UINT32:return 0;case Mt.INT64:return Ot.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Mt.UINT64:return Ot.supportsBigInt()?BigInt(0):0;case Mt.FLOAT32:return-34028234663852886e22;case Mt.FLOAT64:return-Number.MAX_VALUE}};Mt.getMaximum=function(e){switch(e){case Mt.INT8:return 127;case Mt.UINT8:return 255;case Mt.INT16:return 32767;case Mt.UINT16:return 65535;case Mt.INT32:return 2147483647;case Mt.UINT32:return 4294967295;case Mt.INT64:return Ot.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Mt.UINT64:return Ot.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Mt.FLOAT32:return 34028234663852886e22;case Mt.FLOAT64:return Number.MAX_VALUE}};Mt.isIntegerType=function(e){switch(e){case Mt.INT8:case Mt.UINT8:case Mt.INT16:case Mt.UINT16:case Mt.INT32:case Mt.UINT32:case Mt.INT64:case Mt.UINT64:return!0;default:return!1}};Mt.isUnsignedIntegerType=function(e){switch(e){case Mt.UINT8:case Mt.UINT16:case Mt.UINT32:case Mt.UINT64:return!0;default:return!1}};Mt.isVectorCompatible=function(e){switch(e){case Mt.INT8:case Mt.UINT8:case Mt.INT16:case Mt.UINT16:case Mt.INT32:case Mt.UINT32:case Mt.FLOAT32:case Mt.FLOAT64:return!0;default:return!1}};Mt.normalize=function(e,t){return Math.max(Number(e)/Number(Mt.getMaximum(t)),-1)};Mt.unnormalize=function(e,t){let n=Mt.getMaximum(t),i=Mt.isUnsignedIntegerType(t)?0:-n;return e=W.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Mt.INT64||t===Mt.UINT64)&&Ot.supportsBigInt()&&(e=BigInt(e)),e>n?n:e1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};Wa.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Voe(e,t))return e};function Voe(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Wa.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=ut.getMathType(this._type),i=this._isArray,o=ut.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Wa.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?JFe(this,e):Loe(this,e)};function JFe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i1?Toe(e,t,n):void 0}if(eUt.getMaximum(t))return Toe(e,t,n)}function Coe(e,t){return`value ${e} of type ${t} must be finite`}function xH(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function sAe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function cAe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<96?_-97:_>64?_-39:_+4}for(var C=0,x=0;x=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/f,f*4)},encodeVertexBuffer:function(g,f,x){r(x>0&&x<=256),r(x%4==0);var _=n.exports.meshopt_encodeVertexBufferBound(f,x);return d(n.exports.meshopt_encodeVertexBuffer,_,g,f,x)},encodeIndexBuffer:function(g,f,x){r(x==2||x==4),r(f%3==0);var _=h(g,x),C=n.exports.meshopt_encodeIndexBufferBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexBuffer,C,_,f,4)},encodeIndexSequence:function(g,f,x){r(x==2||x==4);var _=h(g,x),C=n.exports.meshopt_encodeIndexSequenceBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexSequence,C,_,f,4)},encodeGltfBuffer:function(g,f,x,_){var C={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(C[_]),C[_](g,f,x)},encodeFilterOct:function(g,f,x,_){return r(x==4||x==8),r(_>=1&&_<=16),p(n.exports.meshopt_encodeFilterOct,g,f,x,_,16)},encodeFilterQuat:function(g,f,x,_){return r(x==8),r(_>=4&&_<=16),p(n.exports.meshopt_encodeFilterQuat,g,f,x,_,16)},encodeFilterExp:function(g,f,x,_,C){r(x>0&&x%4==0),r(_>=1&&_<=24);var V={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,f,x,_,x,C?V[C]:1)}}}();var Sln=T(S()),Ioe=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(C){r=C.instance,r.exports.__wasm_call_ctors()});function a(C){for(var V=new Uint8Array(C.length),L=0;L96?Z-97:Z>64?Z-39:Z+4}for(var G=0,L=0;L0?x(C,V,L,u[Z],d[G]):s.then(function(){var I=new Uint8Array(C*V);return c(r,r.exports[u[Z]],I,C,V,L,r.exports[d[G]]),I})}}}();var Lln=T(S()),Cln=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd;S1jjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgYcx2fgeIdbaaaHydbgKcx2fgOIdbg8P:tgIaaaHcwfydbgL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ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyara3cltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkara8LcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkarawcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba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d3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9iaO2hLarhHa8JhAinaHaLfgeaHaKfgOIdbaeIdbMUdbaeclfgYaOclfIdbaYIdbMUdbaecwfgYaOcwfIdbaYIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbka3mbJbbbbJbbjZaqawfgeIdyg8S:va8SJbbbb9BEaeIdwaaa8Fcx2fgHIdwg8SNaeIdzaHIdbgINaeIdaMg8Va8VMMa8SNaeIdlaHIdlg8VNaeIdCa8SNaeId3Mg8Sa8SMMa8VNaeIdbaINaeIdxa8VNaeIdKMg8Sa8SMMaINaeId8KMMM:lNg8SaBaBa8S9DEhBkaKa9ifhKaicefgial9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var x=new Uint8Array(f.length),_=0;_96?C-97:C>64?C-39:C+4}for(var V=0,_=0;_=3),r(C>=0&&C<=f.length),r(C%3==0),r(V>=0);for(var Z=0,G=0;G<(L?L.length:0);++G)r(L[G]in g),r(this.useExperimentalFeatures||L[G]!="Prune"),Z|=g[L[G]];var I=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),v=d(n.exports.meshopt_simplify,I,f.length,x,x.length/_,_*4,C,V,Z);return v[0]=f instanceof Uint32Array?v[0]:new f.constructor(v[0]),v},simplifyWithAttributes:function(f,x,_,C,V,L,Z,G,I,v){r(this.useExperimentalFeatures),r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C instanceof Float32Array),r(C.length%V==0),r(V>=0),r(Z==null||Z instanceof Uint8Array),r(Z==null||Z.length==x.length/_),r(G>=0&&G<=f.length),r(G%3==0),r(I>=0),r(Array.isArray(L)),r(V>=L.length),r(L.length<=32);for(var P=0;P=0);for(var w=0,P=0;P<(v?v.length:0);++P)r(v[P]in g),w|=g[v[P]];var F=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),b=u(n.exports.meshopt_simplifyWithAttributes,F,f.length,x,x.length/_,_*4,C,V*4,new Float32Array(L),Z?new Uint8Array(Z):null,G,I,w);return b[0]=f instanceof Uint32Array?b[0]:new f.constructor(b[0]),b},getScale:function(f,x){return r(f instanceof Float32Array),r(f.length%x==0),r(x>=3),h(n.exports.meshopt_simplifyScale,f,f.length/x,x*4)},simplifyPoints:function(f,x,_,C,V,L){return r(this.useExperimentalFeatures),r(f instanceof Float32Array),r(f.length%x==0),r(x>=3),r(_>=0&&_<=f.length/x),C?(r(C instanceof Float32Array),r(C.length%V==0),r(V>=3),r(f.length/x==C.length/V),p(n.exports.meshopt_simplifyPoints,f,f.length/x,x*4,C,V*4,L,_)):p(n.exports.meshopt_simplifyPoints,f,f.length/x,x*4,void 0,0,0,_)}}}();var Gln=T(S()),Rln=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbgKBd9GakcoBd:SeJbbbbhYdnalci6g8Ambarcd4hxaihAaKhPaOhrJbbbbhEinavaAclfydbax2cdtfgCIdlh3avaAydbax2cdtfgXIdlhYavaAcwfydbax2cdtfgQIdlh5aCIdwh8EaXIdwh8FaQIdwhaaPaCIdbghaXIdbggMaQIdbg8JMJbbnn:vUdbaPclfaXI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bbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var x=new Uint8Array(f.length),_=0;_96?C-97:C>64?C-39:C+4}for(var V=0,_=0;_=3),r(C<=255||C>0),r(V<=512),r(V%4==0),L=L||0;var Z=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return u(Z,x,x.length/_,_*4,C,V,L)},computeClusterBounds:function(f,x,_){r(f.length%3==0),r(f.length/3<=512),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3);var C=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return g(C,x,x.length/_,_*4)},computeMeshletBounds:function(f,x,_){return r(f.meshletCount!=0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),p(f,x,x.length/_,_*4)},extractMeshlet:function(f,x){return r(x>=0&&x{wr._error=t}),wr._decoderTaskProcessor=e}return wr._decoderTaskProcessor};wr.decodePointCloud=function(e){let t=wr._getDecoderTaskProcessor();if(l(wr._error))throw wr._error;if(wr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};wr.decodeBufferView=function(e){let t=wr._getDecoderTaskProcessor();if(l(wr._error))throw wr._error;if(wr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var jp=wr;function rg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=gt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(rg.prototype=Object.create(Ki.prototype),rg.prototype.constructor=rg);Object.defineProperties(rg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function TAe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Xoe(e,n)}}rg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=TAe(this),this._promise)};function Xoe(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load Draco",t)}async function SAe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}rg.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(l(this._dracoError)&&Xoe(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=jp.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=SAe(this,c)};rg.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var TC=rg;var pdn=T(S(),1);var sdn=T(S(),1);function CAe(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Ze.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Ze.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ze({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var i_=CAe;function qp(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,d=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=d,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(qp.prototype=Object.create(Ki.prototype),qp.prototype.constructor=qp);Object.defineProperties(qp.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});qp.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=VAe(this),this._promise):(this._promise=LAe(this),this._promise)};function Woe(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function VAe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await ZAe(i);if(e.isDestroyed())return;let r=Woe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(n){return e.isDestroyed()?void 0:Poe(e,n,"Failed to load embedded image")}}async function LAe(e){e._state=gt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await EAe(i);if(e.isDestroyed())return;let r=Woe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(o){return e.isDestroyed()?void 0:Poe(e,o,`Failed to load image: ${n}`)}}function Poe(e,t,n){return e.unload(),e._state=gt.FAILED,Promise.reject(e.getError(n,t))}function RAe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new ae("Image format is not recognized")}async function ZAe(e){let t=RAe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Sl(n)}return qp._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var GAe=/(^data:image\/ktx2)|(\.ktx2$)/i;function EAe(e){let t=e.getUrlComponent(!1,!0);return GAe.test(t)?Sl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}qp.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};qp._loadImageFromTypedArray=i_;var SC=qp;var Edn=T(S(),1);var gdn=T(S(),1),IAe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Pa=Object.freeze(IAe);function sg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),d=y(e.loadBuffer,!1),u=y(e.loadTypedArray,!1),h=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=h,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=d,this._loadTypedArray=u,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(sg.prototype=Object.create(Ki.prototype),sg.prototype.constructor=sg);Object.defineProperties(sg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var XAe=new SH;sg.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=WAe(this),this._promise):(this._promise=PAe(this),this._promise)};async function WAe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;TH(e,n)}}async function PAe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=gt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=vAe(e,a),e._state=gt.PROCESSING,e}catch(s){if(e.isDestroyed())return;TH(e,s)}}function vAe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ae.getSizeInBytes(s),c=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let h=r*a,p=new Uint8Array(c,d,h);c=new Uint8Array(p).buffer,d=0,us("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Ae.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Ae.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Ae.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function TH(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load index buffer",t)}function SH(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}SH.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};SH.prototype.execute=function(){this.buffer=voe(this.typedArray,this.indexDatatype,this.context)};function voe(e,t,n){let i=xt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}sg.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=Q.fromTypedArray(t),this._indexDatatype=n)}catch(o){TH(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=XAe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Pa.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=voe(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};sg.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var CC=sg;var khn=T(S(),1);var eun=T(S(),1);var Wdn=T(S(),1);function wAe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Cs=wAe;var Ndn=T(S(),1);var wdn=T(S(),1);function FAe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var ar=FAe;function Kt(){}Kt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};Kt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i0)return i.byteStride}return Q.getSizeInBytes(t.componentType)*_d(t.type)}var Wl=MAe;function NAe(e){We.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),We.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),We.mesh(e,function(n){We.meshPrimitive(n,function(i){if(i.mode=y(i.mode,ie.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Cs(e.materials,o)}})}),We.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=Wl(e,i),r.target=ie.ARRAY_BUFFER}}),We.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ie.ELEMENT_ARRAY_BUFFER}}),We.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,d=l(o.values)?o.values:{};o.values=d,d.ambient=l(d.ambient)?d.ambient:[0,0,0,1],d.emission=l(d.emission)?d.emission:[0,0,0,1],d.transparency=y(d.transparency,1),c!=="CONSTANT"&&(d.diffuse=l(d.diffuse)?d.diffuse:[0,0,0,1],c!=="LAMBERT"&&(d.specular=l(d.specular)?d.specular:[0,0,0,1],d.shininess=y(d.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&We.materialValue(n,function(c){l(c.index)&&o_(c)}),o_(n.emissiveTexture),o_(n.normalTexture),o_(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),o_(s.baseColorTexture),o_(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),o_(a.specularGlossinessTexture))}),We.animation(e,function(n){We.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=kAe(e);return We.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),We.sampler(e,function(n){n.wrapS=y(n.wrapS,ie.REPEAT),n.wrapT=y(n.wrapT,ie.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function kAe(e){let t={};return We.animation(e,function(n){We.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function o_(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var dX=NAe;var oun=T(S(),1);function UAe(e){return We.shader(e,function(t){p5(t)}),We.buffer(e,function(t){p5(t)}),We.image(e,function(t){p5(t)}),p5(e),e}function p5(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var ag=UAe;var _un=T(S(),1);var uun=T(S(),1);var aun=T(S(),1);function DAe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var uX=DAe;function BAe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),uX(e,t),n.length===0&&delete e.extensionsUsed}}var r_=BAe;var OAe=4;function YAe(e){if(Ym(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=woe(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ae("Binary glTF version is not 1 or 2");return i===1?HAe(e,n):zAe(e,n)}function woe(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r0){let h=y(u.binary_glTF,u.KHR_binary_glTF);l(h)&&(h.extras._pipeline.source=d,delete h.uri)}return r_(c,"KHR_binary_glTF"),c}function zAe(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var mX=YAe;var Vun=T(S(),1);function KAe(e){return We.shader(e,function(t){b5(t)}),We.buffer(e,function(t){b5(t)}),We.image(e,function(t){b5(t)}),b5(e),e}function b5(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var hX=KAe;var rhn=T(S(),1);var Gun=T(S(),1);function JAe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Cs(n,t,!0)}var Iu=JAe;var Mun=T(S(),1);var Xun=T(S(),1);function QAe(e){switch(e){case Q.BYTE:return function(t,n,i,o,r){for(let s=0;s-1:!1}var e9e=[ie.ZERO,ie.ONE,ie.SRC_COLOR,ie.ONE_MINUS_SRC_COLOR,ie.SRC_ALPHA,ie.ONE_MINUS_SRC_ALPHA,ie.DST_ALPHA,ie.ONE_MINUS_DST_ALPHA,ie.DST_COLOR,ie.ONE_MINUS_DST_COLOR];function t9e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(e9e.indexOf(e[n])===-1)return t;return e}function n9e(e){let t={},n={},i=e.techniques;return l(i)&&(We.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Foe(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,qAe),blendFactors:t9e(c.blendFuncSeparate,$Ae)})}Foe(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Iu(e,"KHR_blend")),We.material(e,function(o){if(l(o.technique)){let r=n[o.technique];We.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var fX=n9e;var imn=T(S(),1);var Qun=T(S(),1);function i9e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Cs(n,t,!0),Iu(e,t)}var pX=i9e;function o9e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,We.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(We.techniqueAttribute(a,function(h,p){u=a.parameters[h],d.attributes[p]={semantic:u.semantic}}),We.techniqueUniform(a,function(h,p){u=a.parameters[h],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},l(n[c])||(n[c]={}),n[c][h]=p}),l(o[a.program]))d.program=o[a.program];else{let h=e.programs[a.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[h.fragmentShader];p.fragmentShader=Cs(r.shaders,g,!0);let f=e.shaders[h.vertexShader];p.vertexShader=Cs(r.shaders,f,!0),d.program=Cs(r.programs,p),o[a.program]=d.program}i[c]=Cs(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Iu(e,"KHR_techniques_webgl"),pX(e,"KHR_techniques_webgl"))}return We.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};We.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var bX=o9e;var pmn=T(S(),1);var cmn=T(S(),1);function r9e(e,t){xo.typeOf.object("material",e),xo.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,d=t(c.index,c);if(l(d))return d}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,d=t(c.index,c);if(l(d))return d}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:d}=s;if(l(c)){let u=t(c.index,c);if(l(u))return u}if(l(d)){let u=t(d.index,d);if(l(u))return u}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:d,emission:u,specular:h}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(h)&&l(h.index)){let p=t(h.index,h);if(l(p))return p}}}let o=We.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var VC=r9e;var Aoe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function s9e(e,t){return t=y(t,Aoe),Aoe.forEach(function(n){t.indexOf(n)>-1&&c9e(e,n)}),e}var a9e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function c9e(e,t){let n=a9e[t],i=e[n];if(l(i)){let o=0,r=bf[t](e),s=i.length;for(let a=0;at&&o.attributes[c]--}),We.meshPrimitiveTarget(o,function(a){We.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),We.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),We.animation(e,function(i){We.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};pf.buffer=function(e,t){e.buffers.splice(t,1),We.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};pf.bufferView=function(e,t){if(e.bufferViews.splice(t,1),We.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),We.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),We.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ar(e,"KHR_draco_mesh_compression")&&We.mesh(e,function(i){We.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),ar(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.bufferView)&&d.bufferView>t&&d.bufferView--,l(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,l(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(ar(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;st&&u.values--,l(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,l(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};pf.image=function(e,t){e.images.splice(t,1),We.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};pf.mesh=function(e,t){e.meshes.splice(t,1),We.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};pf.node=function(e,t){e.nodes.splice(t,1),We.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),We.animation(e,function(i){We.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),We.technique(e,function(i){We.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),We.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),We.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};pf.material=function(e,t){e.materials.splice(t,1),We.mesh(e,function(i){We.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};pf.sampler=function(e,t){e.samplers.splice(t,1),We.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};pf.texture=function(e,t){if(e.textures.splice(t,1),We.material(e,function(i){VC(i,function(o,r){r.index>t&&--r.index})}),ar(e,"EXT_feature_metadata")){We.mesh(e,function(r){We.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let h=0;ht&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c].texture;u.index>t&&--u.index}}}}if(ar(e,"EXT_mesh_features")&&We.mesh(e,function(i){We.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;dt&&--u.texture.index}}}})}),ar(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;st&&--u.index}}}}};function bf(){}bf.accessor=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){We.meshPrimitiveAttribute(i,function(r){t[r]=!0}),We.meshPrimitiveTarget(i,function(r){We.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),We.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),We.animation(e,function(n){We.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),ar(e,"EXT_mesh_gpu_instancing")&&We.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),ar(e,"CESIUM_primitive_outline")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};bf.buffer=function(e){let t={};return We.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};bf.bufferView=function(e){let t={};if(We.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),We.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),We.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ar(e,"KHR_draco_mesh_compression")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),ar(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(ar(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r0&&(t[n.mesh]=!0)}}),t};function Moe(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!Moe(e,o,n)}).length===0}bf.node=function(e){let t={};return We.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),We.skinJoint(n,function(i){t[i]=!0})}),We.animation(e,function(n){We.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),We.technique(e,function(n){We.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),We.node(e,function(n,i){Moe(e,i,t)||(t[i]=!0)}),t};bf.material=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};bf.texture=function(e){let t={};if(We.material(e,function(n){VC(n,function(i){t[i]=!0})}),ar(e,"EXT_feature_metadata")){We.mesh(e,function(o){We.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;u0)for(s.mesh=n.meshes[c[0]],t=1;t0&&l(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),We.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=X9e[a];l(u)?(d=u+c,t[r]=d):l(I9e[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),We.technique(e,function(n){We.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function P9e(e){We.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function LH(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Wl(e,t)}function v9e(e){We.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),We.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=LH(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function w9e(e){let t,n,i,o=e.bufferViews,r={};We.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};We.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let d=0,u=0,h=c.length;for(t=0;t=0;--r)if(i[r]===t){i.splice(r,1);return}}}),We.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Doe(n)&&Boe(e,i))}}),delete e.nodes[t]}function A9e(e){return We.node(e,function(t,n){Doe(t)&&Boe(e,n)}),e}function M9e(e){We.animation(e,function(t){We.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=s_(e,i);i.min=o.min,i.max=o.max}})})}function N9e(e){We.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=s_(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function k9e(e){e.asset=y(e.asset,{}),e.asset.version="2.0",Uoe(e),_9e(e),A9e(e),T9e(e),S9e(e),V9e(e),R9e(e),v9e(e),w9e(e),F9e(e),M9e(e),N9e(e),Z9e(e),G9e(e),E9e(e),W9e(e),_X(e),P9e(e),fX(e),bX(e),C9e(e)}var U9e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],D9e=["u_diffuse","u_diffuse_mat"];function RH(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function ZH(e){return l(e.index)}function GH(e){return Array.isArray(e)&&e.length===4}function Ooe(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function B9e(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,U9e),i=y(t.baseColorFactorNames,D9e);We.material(e,function(o){We.materialValue(o,function(r,s){n.indexOf(s)!==-1&&ZH(r)?(RH(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&GH(r)&&(RH(o),o.pbrMetallicRoughness.baseColorFactor=Ooe(r))})}),a_(e,"KHR_techniques_webgl"),a_(e,"KHR_blend")}function VH(e,t){l(t)&&(GH(t)?e.pbrMetallicRoughness.baseColorFactor=Ooe(t):ZH(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function koe(e,t){l(t)&&(GH(t)?e.emissiveFactor=t.slice(0,3):ZH(t)&&(e.emissiveTexture=t))}function O9e(e){We.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=y(n.values,{}),o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,d=n.transparent;RH(t),n.technique==="CONSTANT"?(Iu(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},VH(t,s),VH(t,o)):(VH(t,r),koe(t,o),koe(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),a_(e,"KHR_materials_common")}var TX=f9e;var Thn=T(S(),1);var chn=T(S(),1);var oi={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function Y9e(e){switch(e){case oi.POSITION:return"positionMC";case oi.NORMAL:return"normalMC";case oi.TANGENT:return"tangentMC";case oi.TEXCOORD:return"texCoord";case oi.COLOR:return"color";case oi.JOINTS:return"joints";case oi.WEIGHTS:return"weights";case oi.FEATURE_ID:return"featureId"}}oi.hasSetIndex=function(e){switch(e){case oi.POSITION:case oi.NORMAL:case oi.TANGENT:return!1;case oi.TEXCOORD:case oi.COLOR:case oi.JOINTS:case oi.WEIGHTS:case oi.FEATURE_ID:return!0}};oi.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return oi.POSITION;case"NORMAL":return oi.NORMAL;case"TANGENT":return oi.TANGENT;case"TEXCOORD":return oi.TEXCOORD;case"COLOR":return oi.COLOR;case"JOINTS":return oi.JOINTS;case"WEIGHTS":return oi.WEIGHTS;case"_FEATURE_ID":return oi.FEATURE_ID}};oi.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return oi.POSITION;case"RGBA":case"RGB":case"RGB565":return oi.COLOR;case"NORMAL":case"NORMAL_OCT16P":return oi.NORMAL;case"BATCH_ID":return oi.FEATURE_ID}};oi.getGlslType=function(e){switch(e){case oi.POSITION:case oi.NORMAL:case oi.TANGENT:return"vec3";case oi.TEXCOORD:return"vec2";case oi.COLOR:return"vec4";case oi.JOINTS:return"ivec4";case oi.WEIGHTS:return"vec4";case oi.FEATURE_ID:return"int"}};oi.getVariableName=function(e,t){let n=Y9e(e);return l(t)&&(n+=`_${t}`),n};var Lt=Object.freeze(oi);function cc(){}cc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` -${n.message}`);let o=new ae(i);return l(n)&&(o.stack=`Original stack: -${n.stack} -Handler stack: -${o.stack}`),o};cc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:m.ZERO,l(e.rotation)?e.rotation:ve.IDENTITY,l(e.scale)?e.scale:m.ONE)};cc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r>t};la.fromSubtreeJson=async function(e,t,n,i,o){let r=new la(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=wMe(n);let a=s.json;r._subtreeJson=a;let c;if(ii(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let V=a.tileMetadata;c=a.propertyTables[V]}let d=[];if(l(a.contentMetadata)){let V=a.contentMetadata.length;for(let L=0;L0;u=u||h;for(let p=0;p>BigInt(61)),d=c%2===0?bC.encode2D(i,o,r):bC.encode2D(i,r,o),u=zp.fromFacePositionLevel(c,BigInt(d),i),h,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;h=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else h=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:zp.getTokenFromId(u._cellId),minimumHeight:h,maximumHeight:p}}}}var iNe=new m,oNe=new m,FH=new m,rNe=new $;function ore(e,t,n,i,o){if(t===0)return e;let r=m.unpack(e,0,oNe),s=$.unpack(e,3,rNe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,h=m.fromElements(a,a,1,iNe);l(o)&&(u=-1+(2*o+1)*a,h.z=a);let p=m.fromElements(c,d,u,FH);p=$.multiplyByVector(s,p,FH),p=m.add(p,r,FH);let g=$.clone(s);g=$.multiplyByScale(g,h,g);let f=new Array(12);return m.pack(p,f),$.pack(g,f,3),f}var sNe=new ce;function rre(e,t,n,i,o){if(t===0)return e.slice();let r=ce.unpack(e,0,sNe),s=e[4],a=e[5],c=Math.pow(2,-t),d=c*r.width,u=W.negativePiToPi(r.west+n*d),h=W.negativePiToPi(u+d),p=c*r.height,g=W.negativePiToPi(r.south+i*p),f=W.negativePiToPi(g+p),x=s,_=a;if(l(o)){let C=c*(a-s);x+=o*C,_=x+C}return[u,g,h,f,x,_]}function aNe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=nre(i,o,n,!1,t),s=tre(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=sre(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function sre(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Jc.prototype.hasProperty=function(e,t){return!1};Jc.prototype.getFeature=function(e){};Jc.prototype.applyDebugSettings=function(e,t){};Jc.prototype.applyStyle=function(e){};Jc.prototype.update=function(e,t){};Jc.prototype.pick=function(e,t,n){};Jc.prototype.isDestroyed=function(){return!1};Jc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),me(this)};Jc._deriveBoundingBox=ore;Jc._deriveBoundingRegion=rre;Jc._deriveBoundingVolumeS2=ire;var IC=Jc;var fFn=T(S(),1);var xbn=T(S(),1),cNe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},wl=Object.freeze(cNe);var oFn=T(S(),1);var Bbn=T(S(),1);var Cbn=T(S(),1);function XC(e,t){this._distance=t,this._normal=new are(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(XC.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});XC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new XC(e.normal,e.distance),t};XC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new XC(e.normal,e.distance)};function are(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(are.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var h_=XC;function lc(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this.edgeColor=B.clone(y(e.edgeColor,B.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?mre:hre,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o0&&(r=zt.OUTSIDE);for(let s=0;s80*n){a=1/0,c=1/0;let u=-1/0,h=-1/0;for(let p=n;pu&&(u=g),f>h&&(h=f)}d=Math.max(u-a,h-c),d=d!==0?32767/d:0}return XX(r,s,n,a,c,d,0),s}function gre(e,t,n,i,o){let r;if(o===GNe(e,t,n,i)>0)for(let s=t;s=t;s-=i)r=bre(s/i|0,e[s],e[s+1],r);return r&&Z5(r,r.next)&&(PX(r),r=r.next),r}function f_(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(Z5(n,n.next)||Fr(n.prev,n,n.next)===0)){if(PX(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function XX(e,t,n,i,o,r,s){if(!e)return;!s&&r&&SNe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?fNe(e,i,o,r):hNe(e)){t.push(c.i,e.i,d.i),PX(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=pNe(f_(e),t),XX(e,t,n,i,o,r,2)):s===2&&bNe(e,t,n,i,o,r):XX(f_(e),t,n,i,o,r,1);break}}}function hNe(e){let t=e.prev,n=e,i=e.next;if(Fr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,d=i.y,u=or?o>s?o:s:r>s?r:s,g=a>c?a>d?a:d:c>d?c:d,f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=g&&WC(o,a,r,c,s,d,f.x,f.y)&&Fr(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function fNe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Fr(o,r,s)>=0)return!1;let a=o.x,c=r.x,d=s.x,u=o.y,h=r.y,p=s.y,g=ac?a>d?a:d:c>d?c:d,_=u>h?u>p?u:p:h>p?h:p,C=MH(g,f,t,n,i),V=MH(x,_,t,n,i),L=e.prevZ,Z=e.nextZ;for(;L&&L.z>=C&&Z&&Z.z<=V;){if(L.x>=g&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&WC(a,u,c,h,d,p,L.x,L.y)&&Fr(L.prev,L,L.next)>=0||(L=L.prevZ,Z.x>=g&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&WC(a,u,c,h,d,p,Z.x,Z.y)&&Fr(Z.prev,Z,Z.next)>=0))return!1;Z=Z.nextZ}for(;L&&L.z>=C;){if(L.x>=g&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&WC(a,u,c,h,d,p,L.x,L.y)&&Fr(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;Z&&Z.z<=V;){if(Z.x>=g&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&WC(a,u,c,h,d,p,Z.x,Z.y)&&Fr(Z.prev,Z,Z.next)>=0)return!1;Z=Z.nextZ}return!0}function pNe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!Z5(i,o)&&yre(i,n,n.next,o)&&WX(i,o)&&WX(o,i)&&(t.push(i.i,n.i,o.i),PX(n),PX(n.next),n=e=o),n=n.next}while(n!==e);return f_(n)}function bNe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&LNe(s,a)){let c=xre(s,a);s=f_(s,s.next),c=f_(c,c.next),XX(s,t,n,i,o,r,0),XX(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function gNe(e,t,n,i){let o=[];for(let r=0,s=t.length;r=n.next.y&&n.next.y!==n.y){let h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>r&&(r=h,s=n.x=n.x&&n.x>=c&&i!==n.x&&WC(os.x||n.x===s.x&&TNe(s,n)))&&(s=n,u=h)}n=n.next}while(n!==a);return s}function TNe(e,t){return Fr(e.prev,e,t.prev)<0&&Fr(t.next,e,e.next)<0}function SNe(e,t,n,i){let o=e;do o.z===0&&(o.z=MH(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,CNe(o)}function CNe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let d=0;d0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function MH(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function VNe(e){let t=e,n=e;do(t.x=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function LNe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!RNe(e,t)&&(WX(e,t)&&WX(t,e)&&ZNe(e,t)&&(Fr(e.prev,e,t.prev)||Fr(e,t.prev,t))||Z5(e,t)&&Fr(e.prev,e,e.next)>0&&Fr(t.prev,t,t.next)>0)}function Fr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Z5(e,t){return e.x===t.x&&e.y===t.y}function yre(e,t,n,i){let o=R5(Fr(e,t,n)),r=R5(Fr(e,t,i)),s=R5(Fr(n,i,e)),a=R5(Fr(n,i,t));return!!(o!==r&&s!==a||o===0&&L5(e,n,t)||r===0&&L5(e,i,t)||s===0&&L5(n,e,i)||a===0&&L5(n,t,i))}function L5(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function R5(e){return e>0?1:e<0?-1:0}function RNe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&yre(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function WX(e,t){return Fr(e.prev,e,e.next)<0?Fr(e,t,e.next)>=0&&Fr(e,e.prev,t)>=0:Fr(e,t,e.prev)<0||Fr(e,e.next,t)<0}function ZNe(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function xre(e,t){let n=NH(e.i,e.x,e.y),i=NH(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function bre(e,t,n,i){let o=NH(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function PX(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function NH(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function GNe(e,t,n,i){let o=0;for(let r=t,s=n-i;r0?ds.COUNTER_CLOCKWISE:ds.CLOCKWISE};hg.triangulate=function(e,t){let n=D.packArray(e);return kH(n,t,2)};var Cre=new m,Vre=new m,Lre=new m,_re=new m,Tre=new m,Sre=new m,eb=new m,Rre=new D,Zre=new D,Gre=new D,PC=new D;hg.computeSubdivision=function(e,t,n,i,o){o=y(o,W.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),h=0,p=0;for(a=0;a0;){let L=s.pop(),Z=s.pop(),G=s.pop(),I=m.fromArray(d,G*3,Cre),v=m.fromArray(d,Z*3,Vre),P=m.fromArray(d,L*3,Lre),w,F,b;r&&(w=D.fromArray(u,G*2,Rre),F=D.fromArray(u,Z*2,Zre),b=D.fromArray(u,L*2,Gre));let R=m.multiplyByScalar(m.normalize(I,_re),x,_re),E=m.multiplyByScalar(m.normalize(v,Tre),x,Tre),X=m.multiplyByScalar(m.normalize(P,Sre),x,Sre),A=m.magnitudeSquared(m.subtract(R,E,eb)),N=m.magnitudeSquared(m.subtract(E,X,eb)),O=m.magnitudeSquared(m.subtract(X,R,eb)),U=Math.max(A,N,O),Y,k,H;U>C?A===U?(Y=`${Math.min(G,Z)} ${Math.max(G,Z)}`,a=f[Y],l(a)||(k=m.add(I,v,eb),m.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(w,F,PC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(G,a,L),s.push(a,Z,L)):N===U?(Y=`${Math.min(Z,L)} ${Math.max(Z,L)}`,a=f[Y],l(a)||(k=m.add(v,P,eb),m.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(F,b,PC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(Z,a,G),s.push(a,L,G)):O===U&&(Y=`${Math.min(L,G)} ${Math.max(L,G)}`,a=f[Y],l(a)||(k=m.add(P,I,eb),m.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(b,w,PC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(L,a,Z),s.push(a,G,Z)):(g.push(G),g.push(Z),g.push(L))}let V={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:we.TRIANGLES};return r&&(V.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new lt(V)};var XNe=new he,WNe=new he,PNe=new he,UH=new he;hg.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,W.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),h=0,p=0;for(a=0;a0;){let G=s.pop(),I=s.pop(),v=s.pop(),P=m.fromArray(d,v*3,Cre),w=m.fromArray(d,I*3,Vre),F=m.fromArray(d,G*3,Lre),b,R,E;r&&(b=D.fromArray(u,v*2,Rre),R=D.fromArray(u,I*2,Zre),E=D.fromArray(u,G*2,Gre));let X=e.cartesianToCartographic(P,XNe),A=e.cartesianToCartographic(w,WNe),N=e.cartesianToCartographic(F,PNe);C.setEndPoints(X,A);let O=C.surfaceDistance;V.setEndPoints(A,N);let U=V.surfaceDistance;L.setEndPoints(N,X);let Y=L.surfaceDistance,k=Math.max(O,U,Y),H,J,te,z,j;k>_?O===k?(H=`${Math.min(v,I)} ${Math.max(v,I)}`,a=f[H],l(a)||(J=C.interpolateUsingFraction(.5,UH),te=(X.height+A.height)*.5,z=m.fromRadians(J.longitude,J.latitude,te,e,eb),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(j=D.add(b,R,PC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(v,a,G),s.push(a,I,G)):U===k?(H=`${Math.min(I,G)} ${Math.max(I,G)}`,a=f[H],l(a)||(J=V.interpolateUsingFraction(.5,UH),te=(A.height+N.height)*.5,z=m.fromRadians(J.longitude,J.latitude,te,e,eb),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(j=D.add(R,E,PC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(I,a,v),s.push(a,G,v)):Y===k&&(H=`${Math.min(G,v)} ${Math.max(G,v)}`,a=f[H],l(a)||(J=L.interpolateUsingFraction(.5,UH),te=(N.height+X.height)*.5,z=m.fromRadians(J.longitude,J.latitude,te,e,eb),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(j=D.add(E,b,PC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(G,a,I),s.push(a,v,I)):(g.push(v),g.push(I),g.push(G))}let Z={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:we.TRIANGLES};return r&&(Z.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new lt(Z)};hg.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,ne.default);let o=ENe,r=INe;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};fg.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};fg.prototype.contains=function(e){return this._array.indexOf(e)!==-1};fg.prototype.clear=function(){this._array.length=this._offset=this._length=0};fg.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var pg=fg;var er={};er.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let d=0;d0?new Array(o):void 0;for(let a=0;aW.PI){let c=s;s=a,a=c}if(!(r.longitudea))return n.cartographicToCartesian(r)}function BNe(e,t,n,i){if(i===tn.RHUMB)return DNe(e,t,n);let o=jn.lineSegmentPlane(e,t,ln.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var ONe=new he;function YNe(e,t,n){let i=[],o,r,s,a,c,d=0;for(;dt.cartesianToCartographic(h,ONe).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=BNe(o,r,t,n),++d,!l(c))continue;e.splice(d,0,c),i.push({position:d,type:s,visited:!1,next:a,theta:u(c)})}++d}return i}function Wre(e,t,n,i,o,r,s){let a=[],c=r,d=h=>p=>p.position===h,u=[];do{let h=n[c];a.push(h);let p=i.findIndex(d(c)),g=i[p];if(!l(g)){++c;continue}let{visited:f,type:x,next:_}=g;if(g.visited=!0,x===0){if(_===0){let Z=i[p-(s?1:-1)];if(Z?.position===c+1)Z.visited=!0;else{++c;continue}}if(!f&&s&&_>0||r===c&&!s&&_<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}f||u.push(c);let V=p+(s?1:-1),L=i[V];if(!l(L)){++c;continue}c=L.position}while(c=0&&c!==r&&a.lengthd.theta-u.theta);let c=s[0].z>=0;o=Wre(i,o,s,a,1,0,c)}return i};er.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new pg;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),h=u.positions,p=u.holes,g,f;if(i)for(f=h.length,g=0;g1){for(let v of I)c.enqueue(new Xa(v,p));continue}}let V=h.slice(),L=l(p)?p.length:0,Z=[],G;for(g=0;gMath.PI&&(e-=W.TWO_PI),e}}});var vC=new he,qNe=new m;Ar.prototype.getLatitude=function(e){l(e)||(e=ne.default),vC.latitude=this.conformalLatitude,vC.longitude=this.longitude,vC.height=0;let t=this.ellipsoid.cartographicToCartesian(vC,qNe);return e.cartesianToCartographic(t,vC),vC.latitude};var $Ne=new bn,e5e=new m,t5e=new m;Ar.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=Ar.NORTH_POLE_TANGENT_PLANE,o=Ar.SOUTH_POLE;n<0&&(i=Ar.SOUTH_POLE_TANGENT_PLANE,o=Ar.NORTH_POLE);let r=$Ne;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=m.subtract(r.origin,o,e5e),m.normalize(r.direction,r.direction);let s=jn.rayPlane(r,i.plane,t5e),a=m.subtract(s,o,s),c=m.dot(i.xAxis,a),d=n*m.dot(i.yAxis,a);return l(t)?(t.position=new D(c,d),t.tangentPlane=i,t):new Ar(new D(c,d),i)};Ar.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=0?s:s+W.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),d=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==tn.RHUMB){let p=D.subtract(t.position,e.position,x5e),g=D.dot(t.position,p)/D.dot(p,p);if(g>0&&g<1){let f=D.add(t.position,D.multiplyByScalar(p,-g,p),_5e),x=dc.clone(t,T5e);x.position=f;let _=x.getLatitude(n);r.south=Math.min(r.south,_),r.north=Math.max(r.north,_),Math.abs(c)>Math.abs(_)&&(d=_)}}let u=t.x*e.y-e.x*t.y,h=Math.sign(u);h!==0&&(h*=D.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=h),d<=0&&(o.southAngle+=h)}var Mre=new dc,S5e=new dc,Xu={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Wu.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ce),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Xu.northAngle=0,Xu.southAngle=0,Xu.westOverIdl=Number.POSITIVE_INFINITY,Xu.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=dc.fromCartesian(e[0],S5e);for(let s=1;sXu.eastOverIdl-Xu.westOverIdl&&(i.west=Xu.westOverIdl,i.east=Xu.eastOverIdl,i.east>W.PI&&(i.east=i.east-W.TWO_PI),i.west>W.PI&&(i.west=i.west-W.TWO_PI)),W.equalsEpsilon(Math.abs(Xu.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(Xu.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var C5e=new dc;function V5e(e,t,n){return e.height>=W.PI||e.width>=W.PI?dc.fromCartesian(t[0],C5e).tangentPlane:Qr.fromPoints(t,n)}var Nre=new he;function L5e(e,t,n){return(i,o)=>{if(e.height>=W.PI||e.width>=W.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s=W.PI||e.width>=W.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,Nre);return l(r)||(r=new D),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return dc.fromCartesian(o,r)};let i=Qr.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function Z5e(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?Dn.splitPolygonsOnEquator(o,t,n,r):o}function G5e(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return ze.fromRectangle(t,void 0,vre);let o=e,r=Qr.fromPoints(o,n);return Dn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,vre)}Wu.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,d=e._arcType,u=e._textureCoordinates,h=l(u),p=r.positions;if(p.length<3)return;let g=e.rectangle,f=Dn.polygonsFromHierarchy(r,h,L5e(g,p,n),!s,n,Z5e(g,n,d,s)),x=f.hierarchy,_=f.polygons,C=function(X){return X},V=h?Dn.polygonsFromHierarchy(u,!0,C,!1,n).polygons:void 0;if(x.length===0)return;let L=x[0].outerRing,Z=G5e(L,g,n,o),G=[],I=e._height,v=e._extrudedHeight,P=e._perPositionHeightExtrude||!W.equalsEpsilon(I,v,0,W.EPSILON2),w={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:V5e(g,L,n).plane.normal,projectTo2d:R5e(g,L,n),boundingRectangle:Z,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},F;if(P)for(w.extrude=!0,w.top=a,w.bottom=c,w.shadowVolume=e._shadowVolume,w.offsetAttribute=e._offsetAttribute,F=0;F<_.length;F++){let X=p5e(n,_[F],h?V[F]:void 0,i,x[F],s,a,c,t,d),A;a&&c?(A=X.topAndBottom,w.geometry=Dn.scaleToGeodeticHeightExtruded(A.geometry,I,v,n,s)):a?(A=X.topAndBottom,A.geometry.attributes.position.values=ri.scaleToGeodeticHeight(A.geometry.attributes.position.values,I,n,!s),w.geometry=A.geometry):c&&(A=X.topAndBottom,A.geometry.attributes.position.values=ri.scaleToGeodeticHeight(A.geometry.attributes.position.values,v,n,!0),w.geometry=A.geometry),(a||c)&&(w.wall=!1,A.geometry=DH(w),G.push(A));let N=X.walls;w.wall=!0;for(let O=0;OFC.equals(t,e))};es.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>FC.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var X5e=new ce;function W5e(e){let t=[],n=[],i=e.length;for(let r=0;rce.union(e[_].computeSphericalExtents(X5e),x,x),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=ce.clone(a,u),u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI),p=-1}}t.push(u),n.push(h)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}es.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;ns+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s{e._signedDistanceComputeCommand=void 0}})}var Ure=new ce,w5e=new ce;es.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=zt.OUTSIDE;this.inverse&&(o=zt.INSIDE);for(let r=0;r{if(si._activeComputeCommandCount>=si._maximumComputeCommandCount){si._nextFrameCommandQueue.push(e);return}t.commandList.push(e),si._activeComputeCommandCount++};si._updateCommandQueue=e=>{if(si._maximumComputeCommandCount=Math.log2(At.maximumCubeMapSize),si._nextFrameCommandQueue.length>0&&si._activeComputeCommandCounts,u_enuToFixedFrame:()=>c,u_faceDirection:()=>xr.getDirection(h,Bre),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,U5e)},persists:!0,owner:e,postExecute:()=>{let x=e._radianceMapComputeCommands;if(!l(x[g]))return;x[g]=void 0;let _=new Wr({context:n,colorTextures:[e._radianceMapTextures[g]],destroyAttachments:!1});_._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),_._unBind(),_.destroy(),si._activeComputeCommandCount--,x.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)}});e._radianceMapComputeCommands[u]=f,si._queueCommand(f,t),u++}e._radianceCommandsDirty=!1}}function B5e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,d=(h,p,g,f)=>()=>{let x=e._convolutionComputeCommands;!l(x[h])||x[h].canceled||(x[h]=void 0,n.copyFace(t,p,g,f),c++,si._activeComputeCommandCount--,c===e._specularMapTextures.length&&(e._irradianceCommandDirty=!0,n.sampler=new $t({minificationFilter:qt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0))},u=0;for(let h=1;hh/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>xr.getDirection(p,Bre)},postExecute:d(u,g,p,h)});e._convolutionComputeCommands[u]=_,si._queueCommand(_,t),++u}r/=2,s/=2}}var Ore=new D(3,3);function O5e(e,t){let n=t.context,i=Ore,o=e._irradianceMapTexture;l(o)||(o=new Wt({context:n,width:i.x,height:i.y,pixelDatatype:je.FLOAT,pixelFormat:nt.RGBA}),e._irradianceMapTexture=o);let r=e._irradianceMapFS;l(r)||(r=new De({sources:[uE]}),e._irradianceMapFS=r);let s=new Pc({fragmentShaderSource:r,outputTexture:o,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture},postExecute:()=>{l(e._irradianceComputeCommand)&&(e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,si._activeComputeCommandCount--)}});e._irradianceComputeCommand=s,si._queueCommand(s,t),e._irradianceTextureDirty=!0}function Y5e(e,t){let n=t.context,i=new Wr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Ore,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=m.unpack(r,s*4),m.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._shouldRegenerateShaders=!0}si.prototype.update=function(e){let t=e.mode;if(!si.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}si._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting;if((M5e(this,e)||i===nb.SUNLIGHT&&!q.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference))&&(this.reset(),this._lastTime=q.clone(e.time,this._lastTime)),this._radianceMapDirty&&(D5e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(B5e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(O5e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){Y5e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};si.prototype.isDestroyed=function(){return!1};si.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t4?(_t(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==ut.SCALAR?(_t(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Ut.UINT8?(_t(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:ut.isVectorType(t)||t===ut.SCALAR?n!==Ut.UINT8?(_t(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(_t(`Property texture property ${e.id} has an unsupported type`),!1)};var K5e=[void 0,"float","vec2","vec3","vec4"],J5e=[void 0,"int","ivec2","ivec3","ivec4"];AX.prototype.getGlslType=function(){let e=this._classProperty,t=ut.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?K5e[t]:J5e[t]};AX.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function Q5e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var MX=AX;function YH(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new MX({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(YH.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});YH.prototype.getProperty=function(e){return this._properties[e]};var rb=YH;var Sxn=T(S(),1);var gxn=T(S(),1);function Hre(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=y(i,n.offset),o=y(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Hre.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var NX=Hre;function HH(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new NX({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(HH.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});HH.prototype.getProperty=function(e){return this._properties[e]};var y_=HH;var Rxn=T(S(),1);function kX(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(kX.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n=r;)C=o[C-r];o.push(C),s[x]=_}_>fke&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>pke&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=_,t[a]=_):x===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),x=Kre(i,c,d,u,p,g,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Kre(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=zH(e,t,a,c,d);if(u===0)return t;let h=0,p=o?1:0,g=r?1:0,f=zH(e,n,h,p,g);if(f===0)return n;let x=s?1:0,_=0,C=r?1:0,V=zH(e,i,x,_,C);if(V===0)return i;let L=u&f&V,Z,G,I;if(L&1)Z=0,G=1,I=2;else if(L&2)Z=0,I=1,G=2;else if(L&4)G=0,Z=1,I=2;else if(L&8)G=0,I=1,Z=2;else if(L&16)I=0,Z=1,G=2;else if(L&32)I=0,G=1,Z=2;else{let F=KH(u),b=KH(f),R=KH(V);return F>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}W5.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a1;)i>>=1,r.push(Jre(i));let s=new Wt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:nt.LUMINANCE,sampler:new $t({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR_MIPMAP_LINEAR,magnificationFilter:mi.LINEAR})});return t.outlineTexture=s,s};function Jre(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Qre(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=vo.FAILED;let o=this._processError;this._processError=void 0,v5(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===vo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=vo.FAILED,v5(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=vo.FAILED,v5(this,o)}return this._incrementallyLoadTextures?n:n&&i};function tUe(e,t,n,i,o,r,s){let a=e.gltfJson,d=a.accessors[t].bufferView;return Vi.getVertexBufferLoader({gltf:a,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,bufferViewId:d,draco:i,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function nUe(e,t,n,i,o,r){return Vi.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:r,draco:n,asynchronous:e._asynchronous,loadBuffer:i,loadTypedArray:o})}function iUe(e,t){let n=Vi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function dse(e,t,n){let i=t.byteOffset,o=Wl(e,t),r=t.count,s=_d(t.type),a=t.componentType,c=Q.getSizeInBytes(a),d=c*s,u=r*s;if(o===d)return n=new Uint8Array(n),Q.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let h=Q.createTypedArray(a,u),p=new DataView(n.buffer),g=new Array(s),f=$p(t.componentType);i=n.byteOffset+i;for(let x=0;x{l(i)&&l(i.attributes)&&l(i.attributes[u])?pUe(x,_,o,r):bUe(a,c,x,_,o,r)},x}function hse(e,t,n,i,o,r,s){let a=n.modelSemantic,c=a===Lt.POSITION,d=a===Lt.FEATURE_ID,u=c&&!o&&e._loadAttributesFor2D&&!s.scene3DOnly,h=c&&e._enablePick&&!s.context.webgl2,p=e._loadForClassification&&d,g=e._loadAttributesAsTypedArray,f=!g,x=g||u||h||p,V=mse(e,t,n,i,r?!1:f,r?!0:x,s),L=new __.AttributeLoadPlan(V);return L.loadBuffer=f,L.loadTypedArray=x,L}function gUe(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=jH(e,ts,i),d=c.modelSemantic,u=d===ts.TRANSLATION||d===ts.ROTATION||d===ts.SCALE,h=d===ts.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,f=!p,x=e._loadAttributesFor2D&&!o.scene3DOnly;return mse(e,t,c,void 0,f,p||h&&(!a||x||g),o)}function yUe(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView;if(!l(n)&&!l(a))return;let c=new Ike;c.count=s.count;let d=e._loadAttributesAsTypedArray,u=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,h=e._loadForClassification&&i,g=!d,f=d||u||h,C=nUe(e,t,n,o?!1:g,o?!0:f,r),V=e._geometryLoaders.length;e._geometryLoaders.push(C);let L=C.load();e._loaderPromises.push(L),e._geometryCallbacks[V]=()=>{c.indexDatatype=C.indexDatatype,c.buffer=C.buffer,c.typedArray=C.typedArray};let Z=new __.IndicesLoadPlan(c);return Z.loadBuffer=g,Z.loadTypedArray=f,Z}function jc(e,t,n,i){let o=e.gltfJson,r=Pl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Vi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=Pl.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let d=s.load().catch(u=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw u;e._textureState=vo.FAILED,e._textureErrors.push(u)}});return e._texturesPromises.push(d),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function xUe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new zke;return l(i)&&(c.diffuseTexture=jc(e,i,n)),l(o)&&(c.specularGlossinessTexture=jc(e,o,n)),c.diffuseFactor=Sd(se,r),c.specularFactor=Sd(m,s),c.glossinessFactor=a,c}function _Ue(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new Hke;return l(i)&&(c.baseColorTexture=jc(e,i,n)),l(o)&&(c.metallicRoughnessTexture=jc(e,o,n)),c.baseColorFactor=Sd(se,r),c.metallicFactor=s,c.roughnessFactor=a,c}function TUe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new Kke;return l(o)&&(a.specularTexture=jc(e,o,n)),l(s)&&(a.specularColorTexture=jc(e,s,n)),a.specularFactor=i,a.specularColorFactor=Sd(m,r),a}function SUe(e,t,n){let{anisotropyStrength:i=JH.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=JH.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new JH;return l(r)&&(s.anisotropyTexture=jc(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function CUe(e,t,n){let{clearcoatFactor:i=QH.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=QH.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new QH;return l(o)&&(c.clearcoatTexture=jc(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=jc(e,s,n)),l(a)&&(c.clearcoatNormalTexture=jc(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function VUe(e,t,n){let i=new Jke,o=y(t.extensions,y.EMPTY_OBJECT),r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=xUe(e,r,n):(l(d)&&(i.metallicRoughness=_Ue(e,d,n)),l(s)&&!i.unlit&&(i.specular=TUe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=SUe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=CUe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=jc(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=jc(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=jc(e,t.occlusionTexture,n)),i.emissiveFactor=Sd(m,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function fse(e,t){let n=new ase;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function pse(e,t,n,i){let o=new ase,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=use(r.attribute),o.positionalLabel=i,o}function bse(e,t){let n=new lse;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function gse(e,t,n,i){let o=new lse,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function LUe(e,t,n,i){let o=new cse;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=jc(e,r,n,$t.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function RUe(e,t,n,i,o,r){let s=new cse,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=jc(e,c,i,$t.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function ZUe(e,t,n,i,o){let r=new Xke,s=void 0,a=!1;for(let c in t){if(!t.hasOwnProperty(c))continue;let d=t[c],u=jH(e,Lt,c),h=hse(e,d,u,s,a,n,o);r.attributes.push(h.attribute),i.attributePlans.push(h)}return r}function GUe(e,t,n,i){let o=new Wke,r=new __(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=VUe(e,e.gltfJson.materials[s],i));let a=y(t.extensions,y.EMPTY_OBJECT),c=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=EUe(e,d,r));let u=e._loadForClassification,h=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(l(g))for(let G in g){if(!g.hasOwnProperty(G))continue;let I=g[G],v=jH(e,Lt,G),P=v.modelSemantic;if(u&&!fUe(P))continue;P===Lt.FEATURE_ID&&(p=!0);let w=hse(e,I,v,h,n,c,i);r.attributePlans.push(w),o.attributes.push(w.attribute)}let f=t.targets;if(l(f)&&!u)for(let G=0;Gn[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=w5(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(M.IDENTITY);return i}function kUe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=NUe(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r=s.clientWidth)d=!0;else{if(L.x>s.clientWidth*.5){a.width=L.x,c.frustum.right=p.x-C,fc=tW(r,n,c,fc),va.clipToGLWindowCoordinates(a,fc,$H),a.x+=L.x,c.position.x=-c.position.x;let Z=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-Z,fc=tW(r,n,c,fc),va.clipToGLWindowCoordinates(a,fc,ez)}else{a.x+=L.x,a.width-=L.x,c.frustum.left=-p.x-C,fc=tW(r,n,c,fc),va.clipToGLWindowCoordinates(a,fc,$H),a.x=a.x-a.width,c.position.x=-c.position.x;let Z=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-Z,fc=tW(r,n,c,fc),va.clipToGLWindowCoordinates(a,fc,ez)}m.clone(g,c.position),c.frustum=f.clone(),i=D.clone($H,i),(i.x<0||i.x>s.clientWidth)&&(i.x=ez.x)}}if(o.mode!==oe.SCENE2D||d){if(fc=tW(r,n,c,fc),fc.z<0&&!(c.frustum instanceof an)&&!(c.frustum instanceof Pr))return;i=va.clipToGLWindowCoordinates(a,fc,i)}return i.y=s.clientHeight-i.y,i};va.worldToDrawingBufferCoordinates=function(e,t,n){if(n=va.worldToWindowCoordinates(e,t,n),!!l(n))return va.transformWindowToDrawingBuffer(e,n,n)};var cb=new m,pDe=new he;va.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return m.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,pDe);if(!l(r))return;if(o.project(r,cb),i===oe.COLUMBUS_VIEW)return m.fromElements(cb.z,cb.x,cb.y,n);if(i===oe.SCENE2D)return m.fromElements(0,cb.x,cb.y,n);let s=e.morphTime;return m.fromElements(W.lerp(cb.z,t.x,s),W.lerp(cb.x,t.y,s),W.lerp(cb.y,t.z,s),n)};var Cse=new m,Vse=new m,Lse=new M;va.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,Cse),M.computeViewportTransformation(e,0,1,Lse),M.multiplyByPoint(Lse,Cse,Vse),D.fromCartesian3(Vse,n)};va.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return D.fromElements(t.x*o,t.y*r,n)};var bDe=new se,Rse=new se;va.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,g)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=se.clone(se.UNIT_W,bDe);u.x=(t.x-d.x)/d.width*2-1,u.y=(t.y-d.y)/d.height*2-1,u.z=n*2-1,u.w=1;let h,p=e.camera.frustum;if(l(p.fovy)){h=M.multiplyByVector(r.inverseViewProjection,u,Rse);let g=1/h.w;m.multiplyByScalar(h,g,h)}else{let g=p.offCenterFrustum;l(g)&&(p=g),h=Rse,h.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(u.z*(a-c)-a-c)*.5,h.w=1,h=M.multiplyByVector(r.inverseView,h,h)}return m.fromCartesian4(h,i)};var ki=va;var LCn=T(S(),1);var FSn=T(S(),1);var UC={};UC._deprecationWarning=us;var lb=Uint32Array.BYTES_PER_ELEMENT;UC.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=lb;let r=o.getUint32(t,!0);if(r!==1)throw new ae(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=lb;let s=o.getUint32(t,!0);t+=lb;let a=o.getUint32(t,!0);t+=lb;let c=o.getUint32(t,!0);t+=lb;let d=o.getUint32(t,!0);t+=lb;let u=o.getUint32(t,!0);t+=lb;let h;d>=570425344?(t-=lb*2,h=a,d=c,u=0,a=0,c=0,UC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=lb,h=d,d=a,u=c,a=0,c=0,UC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(h,0)}:(p=Po(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let f,x;d>0&&(f=Po(i,t,d),t+=d,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(UC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{batchLength:h,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:x,gltf:C}};var nW=UC;var USn=T(S(),1);function iW(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Zse(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Q.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function gDe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=Q.createTypedArray(n,i),o[t]=r),r}iW.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,Q.UNSIGNED_INT),n=y(n,1),Zse(this,e,t,n,1,i.byteOffset)):i};iW.prototype.hasProperty=function(e){return l(this.json[e])};iW.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Q.fromName(i.componentType)),Zse(this,e,t,n,this.featuresLength,i.byteOffset)):gDe(this,e,t,i)};iW.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a0&&(f=Po(i,t,d),t+=d,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(A5._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{gltfFormat:h,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:x,gltf:C}};var aW=A5;var ub={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},M5=Tn.Attribute,MDe=Tn.FeatureIdAttribute,Pse=Tn.Instances;function mb(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Wo.Y),d=y(e.forwardAxis,Wo.X),u=y(e.loadAttributesAsTypedArray,!1),h=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.enablePick,!1);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=ub.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(mb.prototype=Object.create(Ki.prototype),mb.prototype.constructor=mb);Object.defineProperties(mb.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});mb.prototype.load=function(){if(l(this._promise))return this._promise;let e=aW.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new eh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new ae("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(c)&&(this._transform=M.fromTranslation(m.fromArray(c))),this._batchTable={json:i,binary:o};let d={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let h=Gl(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});d.gltfResource=p,d.baseResource=p}else d.gltfResource=this._i3dmResource,d.typedArray=e.gltf;let u=new sb(d);return this._gltfLoader=u,this._state=ub.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=ub.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw NDe(this,h)}),this._promise};function NDe(e,t){return e.unload(),e._state=ub.FAILED,e.getError("Failed to load i3dm",t)}mb.prototype.process=function(e){if(this._state===ub.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===ub.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),DDe(this,i,e),kDe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=ub.READY,!0};function kDe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=db({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Qc({name:Km.BATCH_TABLE_CLASS_NAME,count:i});o=new Ds({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var N5=new m,iz=new Array(4),UDe=new M;function DDe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",Q.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=ODe(o,r),h;c&&(h=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let g=new Float32Array(r),f=m.unpackArray(u),x=new m,_=new m,C=new m,V=new m,L=new $,Z=new ve,G=new Array(4),I=new m,v=new Array(3),P=new M;if(!l(s)||m.equals(m.unpack(s),m.ZERO)){let U=le.fromPoints(f);for(i=0;i0&&(U.instances=O?BDe(w):w,O=!0)}}function BDe(e){let t=new Pse;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o=n[o]&&e=0&&!(e>=n[o]&&en&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};DC.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var io=DC;function BC(e){this._value=e,this._valueType=io.getPointType(e)}Object.defineProperties(BC.prototype,{value:{get:function(){return this._value}}});BC.prototype.findTimeInterval=function(e){};BC.prototype.wrapTime=function(e){return 0};BC.prototype.clampTime=function(e){return 0};BC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var lW=BC;var sVn=T(S(),1);var z1n=T(S(),1);function OC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=io.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(OC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});OC.prototype.findTimeInterval=io.prototype.findTimeInterval;OC.prototype.wrapTime=io.prototype.wrapTime;OC.prototype.clampTime=io.prototype.clampTime;OC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new m),m.lerp(n[o],n[o+1],r,t))};var Sg=OC;var Q1n=T(S(),1);var vse={};vse.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a=0;--a)s[a]=m.subtract(r[a],m.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var YC=vse;var wse=[],Fse=[],Ase=[],Mse=[];function JDe(e,t,n){let i=wse,o=Ase,r=Fse,s=Mse;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new m),m.clone(t,c),a=1;a0&&e.afterRender.push(a._raiseStartEvent)),a.loop===wl.REPEAT)g=g-Math.floor(g);else if(a.loop===wl.MIRRORED_REPEAT){let C=Math.floor(g),V=g-C;g=C%2===1?1-V:V}a.reverse&&(g=1-g);let _=g*d*a.multiplier;_=W.clamp(_,a.localStartTime,a.localStopTime),a.animate(_),a.update.numberOfListeners>0&&(a._updateEventTime=_,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=th.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&k5.push(a))}}n=k5.length;for(let s=0;sW.EPSILON3}};var TW=Use;var ULn=T(S(),1);var PLn=T(S(),1),SW=`#ifdef DIFFUSE_IBL -vec3 sampleDiffuseEnvironment(vec3 cubeDir) -{ - #ifdef CUSTOM_SPHERICAL_HARMONICS - return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); - #else - return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); - #endif -} -#endif - -#ifdef SPECULAR_IBL -vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) -{ - #ifdef CUSTOM_SPECULAR_IBL - float lod = roughness * model_specularEnvironmentMapsMaximumLOD; - return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; - #else - float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; - return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; - #endif -} -vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) -{ - // see https://bruop.github.io/ibl/ at Single Scattering Results - // Roughness dependent fresnel, from Fdez-Aguera - vec3 f90 = max(vec3(1.0 - roughness), f0); - vec3 F = fresnelSchlick2(f0, f90, NdotV); - - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); - - return specularSample * (F * brdfLut.x + brdfLut.y); -} -#endif - -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -/** - * Compute the light contributions from environment maps and spherical harmonic coefficients. - * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation - * of the single- and multi-scattering terms. - * - * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position. - * @param {vec3} normalEC The surface normal in eye coordinates. - * @param {czm_modelMaterial} The material properties. - * @return {vec3} The computed HDR color. - */ -vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { - vec3 f0 = material.specular; - float roughness = material.roughness; - float specularWeight = 1.0; - #ifdef USE_SPECULAR - specularWeight = material.specularWeight; - #endif - float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); - - // see https://bruop.github.io/ibl/ at Single Scattering Results - // Roughness dependent fresnel, from Fdez-Aguera - vec3 f90 = max(vec3(1.0 - roughness), f0); - vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); - - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); - - #ifdef DIFFUSE_IBL - vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); - vec3 irradiance = sampleDiffuseEnvironment(normalMC); - - vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; - float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); - vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); - vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; - vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; - #else - vec3 diffuseContribution = vec3(0.0); - #endif - - #ifdef USE_ANISOTROPY - // Bend normal to account for anisotropic distortion of specular reflection - vec3 anisotropyDirection = material.anisotropicB; - vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); - vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); - float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); - float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; - vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); - vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); - #else - vec3 reflectEC = reflect(-viewDirectionEC, normalEC); - #endif - - #ifdef SPECULAR_IBL - vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); - vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); - vec3 specularContribution = radiance * FssEss * model_iblFactor.y; - #else - vec3 specularContribution = vec3(0.0); - #endif - - return diffuseContribution + specularContribution; -} -#endif -`;var Dse={name:"ImageBasedLightingPipelineStage"},cBe=new D;Dse.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,ge.FRAGMENT),r.addUniform("vec2","model_iblFactor",ge.FRAGMENT),Bm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",ge.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ge.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ge.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,ge.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",ge.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ge.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT)),r.addFragmentLines(SW);let c={model_iblFactor:function(){return D.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,cBe)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=St(c,e.uniformMap)};var CW=Dse;var tRn=T(S(),1);var JLn=T(S(),1);var lBe=W.EPSILON16;function cz(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(cz.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=W.clamp(e,this.minimumValue,this.maximumValue),W.equalsEpsilon(this._currentValue,e,lBe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var dBe=new m,az=new $;cz.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=dBe,o;switch(t){case mc.XROTATE:o=$.fromRotationX(W.toRadians(n),az),e=M.multiplyByMatrix3(e,o,e);break;case mc.YROTATE:o=$.fromRotationY(W.toRadians(n),az),e=M.multiplyByMatrix3(e,o,e);break;case mc.ZROTATE:o=$.fromRotationZ(W.toRadians(n),az),e=M.multiplyByMatrix3(e,o,e);break;case mc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case mc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case mc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case mc.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case mc.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case mc.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case mc.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var VW=cz;function U5(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,uBe(this)}Object.defineProperties(U5.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function uBe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s 0.0 && clipDistance < clippingPlanesEdgeWidth) { - color = clippingPlanesEdgeColor; - } -} -`;var Bse={name:"ModelClippingPlanesPipelineStage"},fBe=new D;Bse.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ge.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ge.FRAGMENT),fs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ge.FRAGMENT);let s=fs.getTextureResolution(i,o,fBe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ge.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ge.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ge.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ge.FRAGMENT),r.addFragmentLines(ZW);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=B.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=St(a,e.uniformMap)};var GW=Bse;var IRn=T(S(),1);var SRn=T(S(),1),EW=`void modelClippingPolygonsStage(ProcessedAttributes attributes) -{ - vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC); - sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); - - vec2 minDistance = vec2(czm_infinity); - v_regionIndex = -1; - v_clippingPosition = vec2(czm_infinity); - - for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) { - vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex); - vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz; - - vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0)); - vec2 distance = abs(rectUv - clamped) * extents.wz; - - if (minDistance.x > distance.x || minDistance.y > distance.y) { - minDistance = distance; - v_clippingPosition = rectUv; - } - - float threshold = 0.01; - if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) { - v_regionIndex = regionIndex; - } - } -} -`;var VRn=T(S(),1),IW=`void modelClippingPolygonsStage() -{ - vec2 clippingPosition = v_clippingPosition; - int regionIndex = v_regionIndex; - czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); -} -`;var Ose={name:"ModelClippingPolygonsPipelineStage"};Ose.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ge.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ge.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ge.BOTH),o.addUniform("sampler2D","model_clippingDistance",ge.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ge.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(EW),o.addFragmentLines(IW);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=St(r,e.uniformMap)};var XW=Ose;var PRn=T(S(),1);function Yse(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Yse.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var WW=Yse;var RZn=T(S(),1);var aZn=T(S(),1);var wRn=T(S(),1),PW=`mat4 getInstancingTransform() -{ - mat4 instancingTransform; - - #ifdef HAS_INSTANCE_MATRICES - instancingTransform = mat4( - a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 - a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 - a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 - a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation = a_instanceTranslation; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif - - instancingTransform = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation.x, translation.y, translation.z, 1.0 - ); - #endif - - return instancingTransform; -} - -#ifdef USE_2D_INSTANCING -mat4 getInstancingTransform2D() -{ - mat4 instancingTransform2D; - - #ifdef HAS_INSTANCE_MATRICES - instancingTransform2D = mat4( - a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 - a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 - a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 - a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation2D = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation2D = a_instanceTranslation2D; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif - - instancingTransform2D = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation2D.x, translation2D.y, translation2D.z, 1.0 - ); - #endif - - return instancingTransform2D; -} -#endif -`;var ARn=T(S(),1),vW=`void instancingStage(inout ProcessedAttributes attributes) -{ - vec3 positionMC = attributes.positionMC; - - mat4 instancingTransform = getInstancingTransform(); - - attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; - - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; - #endif - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var NRn=T(S(),1),wW=`void legacyInstancingStage( - inout ProcessedAttributes attributes, - out mat4 instanceModelView, - out mat3 instanceModelViewInverseTranspose) -{ - vec3 positionMC = attributes.positionMC; - - mat4 instancingTransform = getInstancingTransform(); - - mat4 instanceModel = instancingTransform * u_instance_nodeTransform; - instanceModelView = u_instance_modifiedModelView; - instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); - - attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var D5=new M,pBe=new M,bBe=new M,zse={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:qse,_transformsToTypedArray:dz};zse.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(PW);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,h=[];XBe(e,n,i,h,d,u),vBe(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ge.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ge.VERTEX),p.u_instance_modifiedModelView=function(){let g=M.multiplyTransformation(s.modelMatrix,a.components.transform,D5);return d?M.multiplyTransformation(n.context.uniformState.view3D,g,D5):(n.mode!==oe.SCENE3D&&(g=wt.basisTo2D(n.mapProjection,g,D5)),M.multiplyTransformation(n.context.uniformState.view,g,D5))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,pBe)},r.addVertexLines(wW)):r.addVertexLines(vW),d){r.addDefine("USE_2D_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_modelView2D",ge.VERTEX);let g=n.context,f=M.fromTranslation(c.instancingReferencePoint2D,new M);p.u_modelView2D=function(){return M.multiplyTransformation(g.uniformState.view,f,bBe)}}e.uniformMap=St(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,h)};var FW=new M,gBe=new m;function yBe(e,t,n,i,o){let r=M.multiplyTransformation(t,e,FW);return r=M.multiplyTransformation(r,n,FW),o=wt.basisTo2D(i.mapProjection,r,o),o}function xBe(e,t,n,i,o){let r=M.fromTranslation(e,FW),s=M.multiplyTransformation(t,r,FW);s=M.multiplyTransformation(s,n,FW);let a=M.getTranslation(s,gBe);return o=ki.computeActualEllipsoidPosition(i,a,o),o}function Kse(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=M.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=M.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=M.clone(o.computedModelMatrix,t),t=M.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=M.clone(M.IDENTITY,n))}var Jse=new M,Qse=new M,_Be=new M,TBe=new m;function SBe(e,t,n,i){let o=Jse,r=Qse;Kse(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:sn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var AW=zse;var mZn=T(S(),1);var mz={};mz.name="ModelMatrixUpdateStage";mz.update=function(e,t,n){let i=n.mode!==oe.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;$se(e,t,o,e.transformToRoot),e._transformDirty=!1}};function wBe(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=jt.getCullFace(e.modelMatrix,e.primitiveType)}function $se(e,t,n,i){let o;i=M.multiplyTransformation(i,e.transform,new M),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=St(o,e.uniformMap)};var DW=oae;var OZn=T(S(),1);var rae={name:"ClassificationPipelineStage"};rae.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ge.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||ABe(t,o)};function ABe(e,t){let n=jt.getAttributeBySemantic(e,Lt.POSITION);if(!l(n))throw new ae("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=jt.getAttributeBySemantic(e,Lt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let d=[],u=[0],h=r?i[0]:0,p=c[h],g=0;for(let x=1;xzBe(i,t,n)):[]}function zBe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=jt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),d=new Array(c.length);for(let u=0;uJBe(n,t)):[]}function JBe(e,t){let{sanitizeGlslIdentifier:n}=jt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;au),n.addStructField(Li.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,f=g;if(l(h)&&!$.equals(h,$.IDENTITY)){let L=`${p}Transform`;n.addUniform("mat3",L,ge.FRAGMENT),i[L]=function(){return h},f=`vec2(${L} * vec3(${g}, 1.0))`}let x=`texture(${p}, ${f}).${c}`,_=s.unpackInShader(x),C=hae({valueExpression:_,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ge.FRAGMENT,property:s}),V=`metadata.${o} = ${C};`;n.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,[V])}function dae(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=mae(Li.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Li.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,s),ge.includesVertexShader(r)&&(e.addStructField(Li.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function uae(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===ut.ENUM)return;let s=Li.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=mae(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(Li.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,c),ge.includesVertexShader(t.shaderDestination)&&(e.addStructField(Li.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function mae(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function hae(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:d}=e;s.addUniform(c,o,d),s.addUniform(c,r,d);let{offset:u,scale:h}=n;return a[o]=()=>u,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var Pu=Li;var DGn=T(S(),1),o3e={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Zg=Object.freeze(o3e);var da={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:_t};da.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Zg.TRANSLUCENT?r.pass=Ee.TRANSLUCENT:c===Zg.OPAQUE&&(r.pass=void 0);let d=m3e(s,t);if(!d.customShaderEnabled)return;if(b3e(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ge.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ge.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ge.FRAGMENT);let p=fb.getDefineName(s.mode);i.addDefine(p,void 0,ge.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];i.addUniform(g.type,p)}let h=s.varyings;for(let p in h)if(h.hasOwnProperty(p)){let g=h[p];i.addVarying(g,p)}e.uniformMap=St(e.uniformMap,s.uniformMap)};function r3e(e){let t={};for(let n=0;n1?(g=e.attributeIndex,e.attributeIndex+=h):p&&!a?g=0:g=e.attributeIndex++,C3e(e,u,g,h,r,s)}W3e(i,t.attributes),t.primitiveType===we.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(iP),i.addFragmentLines(nP)};function C3e(e,t,n,i,o,r){let s=e.shaderBuilder,a=jt.getAttributeInfo(t),c=o&&!r;i>1?R3e(e,t,n,i):L3e(e,t,n,c),G3e(s,a,c),Z3e(s,a),l(t.semantic)&&V3e(s,t),E3e(s,a,o),I3e(s,a,c),X3e(s,a)}function V3e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case Lt.NORMAL:e.addDefine("HAS_NORMALS");break;case Lt.TANGENT:e.addDefine("HAS_TANGENTS");break;case Lt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case Lt.TEXCOORD:case Lt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function L3e(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===Lt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===Lt.POSITION,u=d?0:n,h=sn.getNumberOfComponents(a),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let g=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:h,componentDatatype:Q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function R3e(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,d=sn.getNumberOfComponents(s)/i,u=Q.getSizeInBytes(a),h=d*u,p=t.byteStride;for(let g=0;g0,d=!l(a)&&c;if(l(r)&&!d){let x=iOe(a),_=oOe(r,x);rOe(i,_);let V=sOe(_).indexOf("normalMC")>=0,L=jt.getAttributeBySemantic(t,Lt.NORMAL);if(V&&!L)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ge.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Ee.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ge.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ge.VERTEX);let h,p,g;cr.is3DTiles(o.type)&&(p=!0,h=o.content,g=h.tile.refine===Do.ADD),i.addUniform("vec4","model_pointCloudParameters",ge.VERTEX),i.addVertexLines(hP);let f=e.uniformMap;f.model_pointCloudParameters=function(){let x=$3e,_=1;p&&(_=g?5:h.tileset.memoryAdjustedScreenSpaceError),x.x=y(u.maximumAttenuation,_),x.x*=n.pixelRatio;let C=eOe(e,t,u,h);x.y=C*u.geometricErrorScale;let V=n.context,L=n.camera.frustum,Z;return n.mode===oe.SCENE2D||L instanceof an?Z=Number.POSITIVE_INFINITY:Z=V.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=Z,p&&(x.w=h.tileset.timeSinceLoad),x}};var Zae=new m;function eOe(e,t,n,i){if(l(i)){let u=i.tile.geometricError;if(u>0)return u}if(l(n.baseResolution))return n.baseResolution;let o=jt.getAttributeBySemantic(t,Lt.POSITION),r=o.count,s=e.runtimeNode.transform,a=m.subtract(o.max,o.min,Zae);a=M.multiplyByPointAsVector(s,a,Zae);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var tOe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},nOe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function iOe(e){let t=Ye(nOe);if(!l(e))return t;for(let n=0;n0,p=l(i.skin),g=l(r),x=!(g&&l(r.fragmentShaderText))||r.mode!==fb.REPLACE_MATERIAL,_=jt.hasQuantizedAttributes(n.attributes),C=o.debugWireframe&&we.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),V=o.pointCloudShading,L=l(V)&&V.attenuation,Z=l(V)&&V.backFaceCulling,G=n.primitiveType===we.POINTS&&(l(s)||L||Z),I=o._enableShowOutline&&l(n.outlineCoordinates),v=GOe(o,i,n),P=l(o.classificationType);d&&t.push(xP),t.push(rP),C&&t.push(VP),P&&t.push(BW),h&&t.push(uP),p&&t.push(TP),G&&t.push(fP),_&&t.push(tP),x&&t.push(lP),t.push(Rg),t.push(Pu),t.push(Cd),v.hasPropertyTable&&(t.push(Gg),t.push(DW),t.push(HW)),u&&t.push(CP),g&&t.push($W),t.push(aP),o.allowPicking&&t.push(mP),I&&t.push(gP),t.push(UW),t.push(yP)};function GOe(e,t,n){let i;return l(t.instances)&&(i=jt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=jt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var LP=Uae;var HWn=T(S(),1);function xz(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],EOe(this)}Object.defineProperties(xz.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function EOe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c czm_splitPosition) discard; - if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif -} -`;var O5={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};O5.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ge.FRAGMENT),i.addFragmentLines(WP);let o={};i.addUniform("float",O5.SPLIT_DIRECTION_UNIFORM_NAME,ge.FRAGMENT),o[O5.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=St(o,e.uniformMap)};var PP=O5;var TPn=T(S(),1);function WOe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var vP=WOe;var PPn=T(S(),1);var LPn=T(S(),1);function POe(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,_f.UNLIT)}var wP=POe;function vOe(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:jt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=jt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=le.fromCornerPoints(this.positionMin,this.positionMax,new le),this.lightingOptions=new wP,this.pickId=void 0}var FP=vOe;var v2n=T(S(),1);var zPn=T(S(),1);function Tz(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==kn.CESIUM_3D_TILE,this._classifies3DTiles=o!==kn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],MOe(this)}function wOe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:e,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:Dt.CESIUM_3D_TILE_MASK,mask:Dt.CESIUM_3D_TILE_MASK},stencilMask:Dt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:oc.LESS_OR_EQUAL},depthMask:!1}}var FOe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:Dt.CLASSIFICATION_MASK},stencilMask:Dt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND},AOe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:Dt.CLASSIFICATION_MASK},stencilMask:Dt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Yae=[];function MOe(e){let t=e._command,n=Yae;if(e._useDebugWireframe){t.pass=Ee.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=AP(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;as||o<-s&&r>-s}function e1(e,t){if(!l(t))return;let n=pb.clone(t),i=qe.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function HOe(e){e1(e,e._originalCommand),e1(e,e._translucentCommand),e1(e,e._skipLodBackfaceCommand),e1(e,e._skipLodStencilCommand),e1(e,e._silhouetteModelCommand),e1(e,e._silhouetteColorCommand)}function zOe(e){let t=qe.shallowClone(e);t.pass=Ee.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=mn.ALPHA_BLEND,t.renderState=Ue.fromCache(n),t}function KOe(e,t){let n=t._silhouetteId%255,i=qe.shallowClone(e),o=Ye(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ie.ALWAYS,backFunction:ie.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ue.fromCache(o),i}function JOe(e,t){let n=t._silhouetteId%255,i=qe.shallowClone(e),o=Ye(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ee.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ee.TRANSLUCENT,o.depthMask=!1,o.blending=mn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ie.NOTEQUAL,backFunction:ie.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP}};let s=Ye(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ue.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function QOe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=jOe(o);if(r!==s){let a=qOe(r),c=Ye(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ue.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function jOe(e){return(e.renderState.stencilTest.reference&Dt.SKIP_LOD_MASK)>>>Dt.SKIP_LOD_BIT_SHIFT}function qOe(e){return Dt.CESIUM_3D_TILE_MASK|e<0&&(h=Po(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new eh(d,u),f=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=f,!l(f))throw new ae("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(x)&&(x=m.unpack(x));let _=xYe(g,h);if(_.rtcCenter=x,_.pointsLength=f,!_.hasPositions){let C=_Ye(g);_.positions=C,_.hasPositions=_.hasPositions||l(C)}if(!_.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let C=SYe(g);_.normals=C,_.hasNormals=_.hasNormals||l(C)}if(!_.hasColors){let C=TYe(g);_.colors=C,_.hasColors=_.hasColors||l(C),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(C)&&C.isTranslucent}if(!_.hasBatchIds){let C=CYe(g);_.batchIds=C,_.hasBatchIds=_.hasBatchIds||l(C)}if(_.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new ae("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");_.batchLength=C}return l(p)&&(p=new Uint8Array(p),_.batchTableJson=h,_.batchTableBinary=p),_};function xYe(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,d,u,h,p;if(l(s)){o=s.properties;let f=s.byteOffset,x=s.byteLength;if(!l(o)||!l(f)||!l(x))throw new ae("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+x),c=l(o.POSITION),d=l(o.RGB)||l(o.RGBA),u=l(o.NORMAL),h=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:St(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:h}}function _Ye(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Q.FLOAT,3),{name:Lt.POSITION,semantic:Lt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Q.FLOAT,type:sn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(i))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(r))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:Lt.POSITION,semantic:Lt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Q.FLOAT,type:sn.VEC3,quantizedRange:o,quantizedVolumeOffset:m.unpack(r),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:Q.UNSIGNED_SHORT,quantizedType:sn.VEC3}}}function TYe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Q.UNSIGNED_BYTE,4),{name:Lt.COLOR,semantic:Lt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:sn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:Lt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:sn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:Lt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.FLOAT,type:sn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Q.UNSIGNED_BYTE,4),o=i[3],r=B.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:Lt.COLOR,semantic:Lt.COLOR,setIndex:0,constantColor:r,componentDatatype:Q.FLOAT,type:sn.VEC4,isQuantized:!1,isTranslucent:s}}}function SYe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Q.FLOAT,3),{name:Lt.NORMAL,semantic:Lt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Q.FLOAT,type:sn.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Q.UNSIGNED_BYTE,2),{name:Lt.NORMAL,semantic:Lt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:sn.VEC2,quantizedComponentDatatype:Q.UNSIGNED_BYTE,componentDatatype:Q.FLOAT,type:sn.VEC3}}function CYe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Q.UNSIGNED_SHORT,1);return{name:Lt.FEATURE_ID,semantic:Lt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Q.fromTypedArray(n),type:sn.SCALAR}}}var L_=qae;var VYe=Tn.Components,LYe=Tn.Scene,RYe=Tn.Node,ZYe=Tn.Primitive,GYe=Tn.Attribute,$ae=Tn.Quantization,EYe=Tn.FeatureIdAttribute,IYe=Tn.Material,XYe=Tn.MetallicRoughness;function Ig(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=gt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}l(Object.create)&&(Ig.prototype=Object.create(Ki.prototype),Ig.prototype.constructor=Ig);Object.defineProperties(Ig.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Ig.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=L_.parse(this._arrayBuffer,this._byteOffset),this._state=gt.PROCESSING,this._promise=Promise.resolve(this)};Ig.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===gt.READY)return!0;if(this._state===gt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=WYe(this,e.context)}return!1};function WYe(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=jp.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&PYe(e,i,r),OYe(e,t),e._state=gt.READY,e}).catch(function(r){e.unload(),e._state=gt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function PYe(e,t,n){e._state=gt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:Lt.POSITION,typedArray:n.POSITION.array,componentDatatype:Q.FLOAT,type:sn.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,d=m.fromElements(c,c,c),u=m.unpack(a.minValues),h=(1<0&&YYe(e,a,h,t),l(n.rtcCenter)&&(u.transform=M.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=M.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function YYe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s=0&&(a=ye)}}}}if(a!==Number.MAX_VALUE){if(s=bn.getPoint(t,a,s),n.mode!==oe.SCENE3D){m.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,h=u.ellipsoid,p=u.unproject(s,qYe);h.cartographicToCartesian(p,s)}return s}}function Sz(e,t,n,i,o,r,s,a,c,d){let u=n+t*i;if(d.x=e[u],d.y=e[u+1],d.z=e[u+2],l(o))if(o.octEncoded){if(d=wn.octDecodeInRange(d,o.normalizationRange,d),o.octEncodedZXY){let h=d.x;d.x=d.z,d.z=d.y,d.y=h}}else d=m.multiplyComponents(d,o.quantizedVolumeStepSize,d),d=m.add(d,o.quantizedVolumeOffset,d);return d=M.multiplyByPoint(r,d,d),s!==1&&Tr.getPosition(d,c,s,a,d),d}function ao(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,cr.GLTF),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=M.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new fW(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=B.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,uc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,B.RED);this._silhouetteColor=B.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Ee.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new le,this._initialRadius=void 0,this._heightReference=y(e.heightReference,Je.NONE),this._heightDirty=this._heightReference!==Je.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=y(e.enableVerticalExaggeration,!0),this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new xf(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?fs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=M.clone(M.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?jm.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new zx,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new ib(e.environmentMapOptions);ib.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,_n.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===cr.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let d=e.credit;typeof d=="string"&&(d=new Ct(d)),this._credits=[],this._credit=d,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,vr.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,B.BLACK),this._classificationType=e.classificationType,this._statistics=new OP,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._errorEvent=new be,this._readyEvent=new be,this._texturesReadyEvent=new be,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function Cz(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function eHe(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return oce(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===cr.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(fs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(jm.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(ib.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});ao.prototype.getNode=function(e){return this._nodesByName[e]};ao.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};ao.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};ao.prototype.getExtension=function(e){return this._loader.components.extensions[e]};ao.prototype.makeStyleDirty=function(){this._styleDirty=!0};ao.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var nHe=new M,iHe=new $,oHe=new M;ao.prototype.update=function(e){let t=!1;try{t=rHe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")Cz(this,n);else{let i=jt.getError("model",this._resource,n);Cz(this,i)}}if(sHe(this,e),aHe(this,e),cHe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=jt.getError("model",this._resource,new ae("Failed to load model."));Cz(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&eHe(this,i);let o=new BP({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(lHe(this),dHe(this),uHe(this,e),mHe(this),hHe(this,e),fHe(this,e),pHe(this,e),bHe(this,e),gHe(this,e),yHe(this,e),xHe(this,e),this._defaultTexture=e.context.defaultTexture,_He(this,e),THe(this,e),SHe(this),CHe(this,e),ZHe(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),LHe(this),GHe(this,e),EHe(this),IHe(this,e)}};function rHe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function sHe(e,t){l(e._customShader)&&e._customShader.update(t)}function aHe(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function cHe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function lHe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=tHe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function dHe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function uHe(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r=i&&r<=o}function vHe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r0&&e.alpha<1};ao.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function rce(e){return e.context.stencilBuffer}ao.prototype.hasSilhouette=function(e){return rce(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};ao.prototype.hasSkipLevelOfDetail=function(e){if(!cr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};ao.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};ao.prototype.pick=function(e,t,n,i,o){return n1(this,e,t,n,i,o)};ao.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};ao.prototype.isDestroyed=function(){return!1};ao.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let s=0;s0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),ice(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function zP(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var ih=ao;function Nr(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Nr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Nr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Nr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Nr.prototype.getExtension=function(e){return this._model.getExtension(e)};Nr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Nr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Nr.prototype.applyDebugSettings=function(e,t){t=e?t:B.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Nr.prototype.applyStyle=function(e){this._model.style=e};Nr.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;l(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),l(s)&&l(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:wl.REPEAT}),this._ready=!0)};Nr.prototype.isDestroyed=function(){return!1};Nr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),me(this)};Nr.fromGltf=async function(e,t,n,i){let o=new Nr(e,t,n),s=KP(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await ih.fromGltfAsync(s);return o._model=c,o};Nr.fromB3dm=async function(e,t,n,i,o){let r=new Nr(e,t,n),a=KP(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let d=await ih.fromB3dm(a);return r._model=d,r};Nr.fromI3dm=async function(e,t,n,i,o){let r=new Nr(e,t,n),a=KP(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await ih.fromI3dm(a);return r._model=c,r};Nr.fromPnts=async function(e,t,n,i,o){let r=new Nr(e,t,n),a=KP(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await ih.fromPnts(a);return r._model=c,r};Nr.fromGeoJson=async function(e,t,n,i){let o=new Nr(e,t,n),s=KP(e,t,o,{geoJson:i,resource:n}),a=await ih.fromGeoJson(s);return o._model=a,o};Nr.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ne.WGS84,n)};function KP(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ee.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return St(i,o)}var Ld=Nr;var gFn=T(S(),1);function vu(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(vu.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});vu.fromJson=function(e,t,n,i){let o=new vu(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};vu.prototype.hasProperty=function(e,t){return!1};vu.prototype.getFeature=function(e){};vu.prototype.applyDebugSettings=function(e,t){};vu.prototype.applyStyle=function(e){};vu.prototype.update=function(e,t){};vu.prototype.pick=function(e,t,n){};vu.prototype.isDestroyed=function(){return!1};vu.prototype.destroy=function(){return me(this)};var JP=vu;var dkn=T(S(),1);var pNn=T(S(),1);var MAn=T(S(),1);var NFn=T(S(),1);function xi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=Ft.clone(r)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._pixelOffset=D.clone(y(e.pixelOffset,D.ZERO)),this._translate=new D(0,0),this._eyeOffset=m.clone(y(e.eyeOffset,m.ZERO)),this._heightReference=y(e.heightReference,Je.NONE),this._verticalOrigin=y(e.verticalOrigin,Pn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,gi.CENTER),this._scale=y(e.scale,1),this._color=B.clone(y(e.color,B.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=m.clone(y(e.alignedAxis,m.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=Bn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=B.clone(y(e.outlineColor,B.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping(),this._splitDirection=y(e.splitDirection,vr.NONE)}var sce=xi.SHOW_INDEX=0,Q5=xi.POSITION_INDEX=1,dce=xi.PIXEL_OFFSET_INDEX=2,FHe=xi.EYE_OFFSET_INDEX=3,AHe=xi.HORIZONTAL_ORIGIN_INDEX=4,MHe=xi.VERTICAL_ORIGIN_INDEX=5,NHe=xi.SCALE_INDEX=6,j5=xi.IMAGE_INDEX_INDEX=7,ace=xi.COLOR_INDEX=8,kHe=xi.ROTATION_INDEX=9,UHe=xi.ALIGNED_AXIS_INDEX=10,DHe=xi.SCALE_BY_DISTANCE_INDEX=11,BHe=xi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,OHe=xi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,YHe=xi.DISTANCE_DISPLAY_CONDITION=14,HHe=xi.DISABLE_DEPTH_DISTANCE=15;xi.TEXTURE_COORDINATE_BOUNDS=16;var cce=xi.SDF_INDEX=17,zHe=xi.SPLIT_DIRECTION_INDEX=18;xi.NUMBER_OF_PROPERTIES=19;function wo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(xi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,wo(this,sce))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),wo(this,Q5))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),wo(this,Q5))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;D.equals(t,e)||(D.clone(e,t),wo(this,dce))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),wo(this,DHe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),wo(this,BHe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;kt.equals(t,e)||(this._pixelOffsetScaleByDistance=kt.clone(e,t),wo(this,OHe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),wo(this,FHe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,wo(this,AHe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,wo(this,MHe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,wo(this,NHe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),wo(this,ace))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,wo(this,kHe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),wo(this,UHe))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,wo(this,j5))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,wo(this,j5))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,wo(this,ace))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ft.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ft.clone(e,this._distanceDisplayCondition),wo(this,YHe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,wo(this,HHe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof Ze?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Bn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,wo(this,j5))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),wo(this,Q5)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,wo(this,sce))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),wo(this,cce))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,wo(this,cce))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,wo(this,zHe))}}});xi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};xi.prototype._updateClamping=function(){xi._updateClamping(this._billboardCollection,this)};var q5=new he;xi._updateClamping=function(e,t){let n=e._scene;if(!l(n))return;let i=y(n.ellipsoid,ne.default),o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===Je.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Je.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(d){let u=i.cartographicToCartesian(d,t._clampedPosition);nC(t._heightReference)&&(t._mode===oe.SCENE3D?(d.height+=s.height,i.cartographicToCartesian(d,u)):u.x+=s.height),t._clampedPosition=u}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,q5);let c=n.getHeight(s,t._heightReference);l(c)&&(q5.height=c),a(q5)};xi.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(c){if(r._imageId!==t||r._image!==n||!ze.equals(r._imageSubRegion,i))return;let d=e.textureCoordinates[c];r._imageWidth=e.texture.width*d.width,r._imageHeight=e.texture.height*d.height,r._imageIndex=c,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,wo(r,j5);let u=r._billboardCollection._scene;l(u)&&u.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;let a=e.getImageIndex(t);if(l(a)&&!l(i)){s(a);return}o.then(s).catch(function(c){console.error(`Error loading image for billboard: ${c}`),r._imageIndexPromise=void 0})};xi.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};xi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&ze.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=ze.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};xi.prototype._setTranslate=function(e){let t=this._translate;D.equals(t,e)||(D.clone(e,t),wo(this,dce))};xi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};xi.prototype._setActualPosition=function(e){l(this._clampedPosition)||m.clone(e,this._actualPosition),wo(this,Q5)};var lce=new se;xi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(M.multiplyByPoint(i,t,lce),ki.computeActualEllipsoidPosition(n,lce))};var uce=new m;xi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=M.multiplyByPoint(e,t,uce),a=ki.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return D.add(a,i,a),a};var J5=new D(0,0);xi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new D),D.clone(this._pixelOffset,J5),D.add(J5,this._translate,J5);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,q5);o=a.cartographicToCartesian(c,uce),i=M.IDENTITY}return xi._computeScreenSpacePosition(i,o,this._eyeOffset,J5,e,t)};xi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===gi.RIGHT?s-=i:e.horizontalOrigin===gi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Pn.BOTTOM||e.verticalOrigin===Pn.BASELINE?a-=o:e.verticalOrigin===Pn.CENTER&&(a-=o*.5),l(n)||(n=new ze),n.x=s,n.y=a,n.width=i,n.height=o,n};xi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&ze.equals(this._imageSubRegion,e._imageSubRegion)&&B.equals(this._color,e._color)&&D.equals(this._pixelOffset,e._pixelOffset)&&D.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ft.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};xi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var co=xi;var UFn=T(S(),1),KHe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Lo=Object.freeze(KHe);var BFn=T(S(),1),JHe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Os=Object.freeze(JHe);var nAn=T(S(),1);function bb(e,t,n,i,o){this.bottomLeft=y(e,D.ZERO),this.topRight=y(t,D.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var QHe=new D(16,16);function Wg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,QHe);this._context=e.context,this._pixelFormat=y(e.pixelFormat,nt.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Bn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(Wg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Wt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function jHe(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),d=o*(a+t.height+r),u=s/c,h=a/d,p=new bb(new D(s+r,r),new D(c,a)),g=new bb(new D,new D(c,a),e._root,p),f=new bb(new D(r,a+r),new D(c,d)),x=new bb(new D,new D(c,d),g,f);for(let V=0;Vs){t.childNode1=new bb(new D(t.bottomLeft.x,t.bottomLeft.y),new D(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let p,g;if(l(o._labelDimensions))g=o._labelDimensions.x,p=o._labelDimensions.y;else{let C=0,V=0,L=o._imageIndex;if(L!==-1){let G=n[L];C=G.height,V=G.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*C));let Z=e._textureAtlas.texture.width;g=Math.round(y(o.width,Z*V))}let f=Math.floor(W.clamp(g,0,Ez)),x=Math.floor(W.clamp(p,0,Ez)),_=f*Ez+x;e._instanced?(r=o._index,s(r,a,c,u,_)):(r=o._index*4,s(r+0,a,c,u,_),s(r+1,a,c,u,_),s(r+2,a,c,u,_),s(r+3,a,c,u,_))}function wce(e,t,n,i,o){if(Cu(o.heightReference)){let f=e._scene,x=t.context,_=t.globeTranslucencyState.translucent,C=l(f.globe)&&f.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!_&&C}let r,s=i[lo.textureCoordinateBoundsOrLabelTranslate];if(At.maximumVertexTextureImageUnits>0){let f=0,x=0;l(o._labelTranslate)&&(f=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,f,x,0,0)):(r=o._index*4,s(r+0,f,x,0,0),s(r+1,f,x,0,0),s(r+2,f,x,0,0),s(r+3,f,x,0,0));return}let a=0,c=0,d=0,u=0,h=o._imageIndex;if(h!==-1){let f=n[h];a=f.x,c=f.y,d=f.width,u=f.height}let p=a+d,g=c+u;e._instanced?(r=o._index,s(r,a,c,p,g)):(r=o._index*4,s(r+0,a,c,p,g),s(r+1,a,c,p,g),s(r+2,a,c,p,g),s(r+3,a,c,p,g))}function bze(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[lo.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function Fce(e,t,n,i,o){if(!e._sdf)return;let r,s=i[lo.sdf],a=o.outlineColor,c=o.outlineWidth,d=B.floatToByte(a.red),u=B.floatToByte(a.green),h=B.floatToByte(a.blue),p=d*i1+u*Tf+h,g=c/Os.RADIUS,f=B.floatToByte(a.alpha)*i1+B.floatToByte(g)*Tf;e._instanced?(r=o._index,s(r,p,f)):(r=o._index*4,s(r+0,p+Rce,f),s(r+1,p+Zce,f),s(r+2,p+Gce,f),s(r+3,p+Ece,f))}function Ace(e,t,n,i,o){let r=i[lo.splitDirection],s=0,a=o.splitDirection;l(a)&&(s=a);let c;e._instanced?(c=o._index,r(c,s)):(c=o._index*4,r(c+0,s),r(c+1,s),r(c+2,s),r(c+3,s))}function gze(e,t,n,i,o){Vce(e,t,n,i,o),Ice(e,t,n,i,o),Xce(e,t,n,i,o),Xz(e,t,n,i,o),Wz(e,t,n,i,o),Wce(e,t,n,i,o),Pce(e,t,n,i,o),vce(e,t,n,i,o),wce(e,t,n,i,o),bze(e,t,n,i,o),Fce(e,t,n,i,o),Ace(e,t,n,i,o)}function Iz(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c0){this._vaf=uze(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let P=0;P0){let P=Tze;P.length=0,(c[jP]||c[nze]||c[tze])&&P.push(Vce),(c[QP]||c[fce]||c[$He]||c[eze]||c[qHe])&&(P.push(Ice),this._instanced&&P.push(Wz)),(c[QP]||c[ize]||c[yce])&&(P.push(Xce),P.push(Xz)),(c[QP]||c[bce])&&P.push(Xz),c[pce]&&P.push(Wz),c[gce]&&P.push(Wce),c[xce]&&P.push(Pce),(c[_ce]||c[oze]||c[QP]||c[jP])&&P.push(vce),(c[QP]||c[jP])&&P.push(wce),c[Tce]&&P.push(Fce),c[Sce]&&P.push(Ace);let w=P.length;if(h=this._vaf.writers,a/n>.1){for(let F=0;Fn*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,x=M.IDENTITY;e.mode===oe.SCENE3D?(x=this.modelMatrix,f=le.clone(this._baseVolumeWC,this._boundingVolume)):f=le.clone(this._baseVolume2D,this._boundingVolume),xze(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Lo.TRANSLUCENT;this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:P?ie.LEQUAL:ie.LESS},depthMask:P,blending:mn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,V,L,Z,G,I=At.maximumVertexTextureImageUnits>0;if(_||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=iE,V=nE,G=[],l(this._batchTable)&&(G.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),V=this._batchTable.getFragmentShaderCallback(!1,void 0)(V)),L=new De({defines:G,sources:[C]}),this._instanced&&L.defines.push("INSTANCED"),this._shaderRotation&&L.defines.push("ROTATION"),this._shaderAlignedAxis&&L.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&L.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&L.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&L.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&L.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&L.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(I?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK"));let P=1-Os.CUTOFF;this._sdf&&L.defines.push("SDF");let w=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(Z=new De({defines:["OPAQUE",w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._sp=en.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:lo}),Z=new De({defines:["TRANSLUCENT",w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=en.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:lo})),this._blendOption===Lo.OPAQUE&&(Z=new De({defines:[w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._sp=en.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:lo})),this._blendOption===Lo.TRANSLUCENT&&(Z=new De({defines:[w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=en.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:lo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let v=e.commandList;if(p.render||p.pick){let P=this._colorCommands,w=this._blendOption===Lo.OPAQUE,F=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT,b=this._vaf.va,R=b.length,E=this._uniforms,X;l(this._batchTable)?(E=this._batchTable.getUniformMapCallback()(E),X=this._batchTable.getPickId()):X="v_pickColor",P.length=R;let A=F?R*2:R;for(let N=0;N0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,Cze);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=B.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&o1(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ua.defaultColor=B.WHITE;ua.defaultPointOutlineColor=B.BLACK;ua.defaultPointOutlineWidth=0;ua.defaultPointSize=8;function o1(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,ua.defaultColor),i=y(e._pointOutlineColor,ua.defaultPointOutlineColor),o=y(e._pointOutlineWidth,ua.defaultPointOutlineWidth),r=y(e._pointSize,ua.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(B.equals(n,s)&&B.equals(i,a)&&o===c&&r===d)return;e._billboardColor=B.clone(n,e._billboardColor),e._billboardOutlineColor=B.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([h,r,p,o]);t.setImage(g,R_(u,h,p,o,r))}ua.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ua.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ua.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ua.prototype.getPropertyInherited=function(e){return ks.getPropertyInherited(this._content,this._batchId,e)};ua.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ua.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ua.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ua.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var gb=ua;var k9n=T(S(),1);var $An=T(S(),1);function Vze(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),d=100,u=r.width+d|0,h=3*a,p=h/2;c.width=u,c.height=h;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,d/2,p)),o&&(g.fillStyle="black",g.fillText(t,d/2,p));let f=g.getImageData(0,0,u,h).data,x=f.length,_=u*4,C,V,L,Z;for(C=0;C=0;--C)if(f[C]!==255){Z=C/_|0;break}let G=-1;for(C=0;C]/,o=[],r="",s=ps.LTR,a="",c=e.length;for(let d=0;d";case">":return"<"}}var vze="\u05D0-\u05EA",wze="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Oce=new RegExp(`[${vze}${wze}]`);function Fze(e){let t=e.split(` -`),n="";for(let i=0;id+1?s[d+1].Type===ps.RTL?(c=h+c,a=0):(c=t2(c,a,u.Word),a+=u.Word.length):c=t2(c,0,h)):u.Type===ps.RTL?c=t2(c,a,h):u.Type===ps.LTR?(c+=u.Word,a=c.length):(u.Type===ps.WEAK||u.Type===ps.BRACKETS)&&(d>0&&s[d-1].Type===ps.RTL?s.length>d+1?s[d+1].Type===ps.RTL?c=t2(c,a,h):(c+=u.Word,a=c.length):c+=u.Word:(c+=u.Word,a=c.length))}n+=c,i0,h=t._backgroundBillboard,p=e._backgroundBillboardCollection;u?(l(h)||(h=p.add({collection:e,image:Qce,imageSubRegion:Uze}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=gi.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t.totalScale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition,h.disableDepthTestDistance=t._disableDepthTestDistance,h.clusterShow=t.clusterShow):l(h)&&(p.remove(h),t._backgroundBillboard=h=void 0);let g=e._glyphTextureCache;for(d=0;d0&&L.height>0){let Z=(0,Kce.default)(L,{cutoff:Os.CUTOFF,radius:Os.RADIUS}),G=L.getContext("2d"),I=L.width,v=L.height,P=G.getImageData(0,0,I,v);for(let w=0;w0?V=L.pop():(V=e._billboardCollection.add({collection:e}),V._labelDimensions=new D,V._labelTranslate=new D),a.billboard=V),V.show=t._show,V.position=t._position,V.eyeOffset=t._eyeOffset,V.pixelOffset=t._pixelOffset,V.horizontalOrigin=gi.LEFT,V.verticalOrigin=t._verticalOrigin,V.heightReference=t._heightReference,V.scale=t.totalScale,V.pickPrimitive=t,V.id=t._id,V.image=_,V.translucencyByDistance=t._translucencyByDistance,V.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,V.scaleByDistance=t._scaleByDistance,V.distanceDisplayCondition=t._distanceDisplayCondition,V.disableDepthTestDistance=t._disableDepthTestDistance,V._batchIndex=t._batchIndex,V.outlineColor=t.outlineColor,t.style===Bo.FILL_AND_OUTLINE?(V.color=t._fillColor,V.outlineWidth=t.outlineWidth):t.style===Bo.FILL?(V.color=t._fillColor,V.outlineWidth=0):t.style===Bo.OUTLINE&&(V.color=B.TRANSPARENT,V.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function zce(e,t,n){return t===gi.CENTER?-e/2:t===gi.RIGHT?-(e+n.x):n.x}var lr=new D,zze=new D;function Kze(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,d=0,u=1,h,p=t.length,g=e._backgroundBillboard,f=D.clone(l(g)?e._backgroundPadding:D.ZERO,zze);for(f.x/=e._relativeSize,f.y/=e._relativeSize,h=0;h0&&(C===gi.CENTER?G=-s/2-f.x:C===gi.RIGHT?G=-(s+f.x*2):G=0,lr.x=G*_,V===Pn.TOP?lr.y=x-d-c:V===Pn.CENTER?lr.y=(x-d)/2-c:V===Pn.BASELINE?lr.y=-f.y-c:lr.y=0,lr.y=lr.y*_,g.width=P,g.height=w,g._setTranslate(lr),g._labelTranslate=D.clone(lr,g._labelTranslate)),Cu(e.heightReference))for(h=0;h0?Lo.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Sf.prototype.isDestroyed=function(){return!1};Sf.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),me(this)};var Cf=Sf;var QMn=T(S(),1);var uMn=T(S(),1);var $9n=T(S(),1);var $c={};$c.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};$c.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var Jze=new he;$c.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o0){t=y(t,M.IDENTITY);let o=M.inverseTransformation(t,Qze),r=M.multiplyByPoint(o,m.ZERO,jze),s=m.normalize(M.multiplyByPointAsVector(o,m.UNIT_Y,qce),qce),a=ln.fromPointNormal(r,s,qze),c=m.normalize(M.multiplyByPointAsVector(o,m.UNIT_X,$ce),$ce),d=ln.fromPointNormal(r,c,$ze),u=1;n.push(m.clone(e[0]));let h=n[0],p=e.length;for(let g=1;g2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Xi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(ile),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=le.fromPoints(this._actualPositions),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new le}var nle=Zd.POSITION_INDEX=0,sKe=Zd.SHOW_INDEX=1,aKe=Zd.WIDTH_INDEX=2,cKe=Zd.MATERIAL_INDEX=3,i2=Zd.POSITION_SIZE_INDEX=4,lKe=Zd.DISTANCE_DISPLAY_CONDITION=5,ile=Zd.NUMBER_OF_PROPERTIES=6;function yb(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Zd.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,yb(this,sKe))}},positions:{get:function(){return this._positions},set:function(e){let t=To(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&yb(this,i2),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=le.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),yb(this,nle),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,yb(this,cKe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,yb(this,aKe))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,yb(this,i2)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ft.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ft.clone(e,this._distanceDisplayCondition),yb(this,lKe))}}});Zd.prototype.update=function(){let e=M.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[nle]>0||this._propertiesChanged[i2]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=Xi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)yb(this,i2);else{let o=n.length;for(let r=0;r2){if(o[Uz]||o[ole]){let f=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=On.fromCartesian(f.center,mle),_=se.fromElements(x.low.x,x.low.y,x.low.z,f.radius,hle);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[hKe]){let f=fle;f.x=0,f.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(f.x=x.near,f.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c0){let Y=w.isTranslucent();a>=s?(b=new qe({owner:e}),n.push(b)):b=n[a],++a,R=St(p(w._uniforms),e._uniformMap),b.boundingVolume=le.clone(o2,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=Y?e._translucentRS:e._opaqueRS,b.pass=Y?Ee.TRANSLUCENT:Ee.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=F,b.offset=Z,Z+=F,F=0,c=!0,r.push(b)}w=X._material,w.update(o),P=A}let N=X._locatorBuckets,O=N.length;for(let Y=0;Y0&&(a>=s?(b=new qe({owner:e}),n.push(b)):b=n[a],++a,R=St(p(w._uniforms),e._uniformMap),b.boundingVolume=le.clone(o2,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=w.isTranslucent()?e._translucentRS:e._opaqueRS,b.pass=w.isTranslucent()?Ee.TRANSLUCENT:Ee.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=F,b.offset=Z,c=!0,r.push(b)),P=void 0}}n.length=a}rh.prototype.isDestroyed=function(){return!1};rh.prototype.destroy=function(){return ple(this),Bz(this),ble(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function bKe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Uz]?(i.bufferUsage!==Me.STREAM_DRAW&&(t=!0,i.bufferUsage=Me.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Me.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Me.STATIC_DRAW):i.frameCount--),t}var sle=[0,0,0];function ale(e,t,n){e._createVertexArray=!1,Bz(e),ple(e),xKe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,h=e._polylineBuckets,p,g;for(p in h)h.hasOwnProperty(p)&&(g=h[p],g.updateShader(t,r,s),u+=g.lengthOfPositions);if(u>0){let f=e._mode,x=new Float32Array(6*u*3),_=new Float32Array(u*4),C,V=0,L=0,Z=0;for(p in h)if(h.hasOwnProperty(p)){g=h[p],g.write(x,_,V,L,Z,r,t,n),f===oe.MORPHING&&(l(C)||(C=new Float32Array(6*u*3)),g.writeForMorph(C,V));let R=g.lengthOfPositions;V+=6*R*3,L+=R*4,Z+=R*4,c=g.updateIndices(i,a,d,c)}let G=e._positionBufferUsage.bufferUsage,I=Me.STATIC_DRAW;e._positionBuffer=xt.createVertexBuffer({context:t,typedArray:x,usage:G});let v;l(C)&&(v=xt.createVertexBuffer({context:t,typedArray:C,usage:G})),e._texCoordExpandAndBatchIndexBuffer=xt.createVertexBuffer({context:t,typedArray:_,usage:I});let P=3*Float32Array.BYTES_PER_ELEMENT,w=4*Float32Array.BYTES_PER_ELEMENT,F=0,b=i.length;for(let R=0;R0){let E=new Uint16Array(o),X=xt.createIndexBuffer({context:t,typedArray:E,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});F+=a[R];let A=6*(R*(P*W.SIXTY_FOUR_KILOBYTES)-F*P),N=P+A,O=P+N,U=P+O,Y=P+U,k=P+Y,H=R*(w*W.SIXTY_FOUR_KILOBYTES)-F*w,J=[{index:Ml.position3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:Ml.position3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:Ml.position2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:Ml.position2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:Ml.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Ml.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Ml.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Ml.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Ml.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*P},{index:Ml.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Ml.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*P},{index:Ml.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Ml.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:H}],te,z,j,ee;f===oe.SCENE3D?(z=e._positionBuffer,te="vertexBuffer",j=sle,ee="value"):f===oe.SCENE2D||f===oe.COLUMBUS_VIEW?(z=sle,te="value",j=e._positionBuffer,ee="vertexBuffer"):(z=v,te="vertexBuffer",j=e._positionBuffer,ee="vertexBuffer"),J[0][te]=z,J[1][te]=z,J[2][ee]=j,J[3][ee]=j,J[4][te]=z,J[5][te]=z,J[6][ee]=j,J[7][ee]=j,J[8][te]=z,J[9][te]=z,J[10][ee]=j,J[11][ee]=j;let fe=new ei({context:t,attributes:J,indexBuffer:X});e._vertexArrays.push({va:fe,buckets:d[R]})}}}function gKe(e,t){return t instanceof Wt?t.id:t}var ik=[];function yKe(e){let t=Hi._uniformList[e.type],n=t.length;ik.length=2*n;let i=0;for(let o=0;o1){a.update();let c=a.material,d=i[c.type];l(d)||(d=i[c.type]=new Vf(c,t,n)),d.addPolyline(a)}}}function _Ke(e,t){let n=t.mode;(e._mode!==n||!M.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=M.clone(e.modelMatrix),e._createVertexArray=!0)}function Dz(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s0,_=g._index,C=this.getSegments(g,a),V=C.positions,L=C.lengths,Z=V.length,G=g.getPickId(s).color,I=0,v=0,P;for(let O=0;O0||Vs.x>0&&ku.x<0)&&m.clone(Vs,ku),(Vs.x<0&&Uu.x>0||Vs.x>0&&Uu.x<0)&&m.clone(Vs,Uu));let H=Y?2:0,J=k?2:4;for(let te=H;te2&&(r.setBatchedAttribute(_,2,E),r.setBatchedAttribute(_,3,X),r.setBatchedAttribute(_,4,A))}};var CKe=new m,VKe=new m,LKe=new m,cle=new m;Vf.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r0&&(c=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let h=0;h0)g[0]=x;else continue}else g=p._segments.lengths;let f=g.length;if(f>0){let x=0;for(let _=0;_W.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new kz(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>W.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new kz(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Vf.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o0){e._boundingVolume2D=le.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(d.z,d.x,d.y)}return r1.positions=o,r1.lengths=e._segments.lengths,r1};var dle;Vf.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*W.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=dle,c=6*s*3;!l(a)||a.lengthc&&(a=new Float32Array(a.buffer,0,c));let d=this.getSegments(t,i),u=d.positions,h=d.lengths,p=0,g=0,f=0,x;s=u.length;for(let _=0;_0||Vs.x>0&&ku.x<0)&&m.clone(Vs,ku),(Vs.x<0&&Uu.x>0||Vs.x>0&&Uu.x<0)&&m.clone(Vs,Uu));let Z=V?2:0,G=L?2:4;for(let I=Z;I{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3;for(let g=0;g{e.isDestroyed()||(e._error=a)})}Fg.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(g.packedBuffer),x=f[0];UKe(e,f),e._indices=Ae.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),YKe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function YKe(e){l(e._primitive)||(e._primitive=new qx({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}xb.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};xb.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};xb.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};xb.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};xb.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=OKe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};xb.prototype.isDestroyed=function(){return!1};xb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var c2=xb;var n5n=T(S(),1);function ah(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(ah.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function HKe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ne.packedLength+m.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ce.pack(t,a,c),c+=ce.packedLength,ne.pack(o,a,c),c+=ne.packedLength,m.pack(r,a,c),a}var zKe=new bi("createVectorTilePolylines",5),s1={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function KKe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=HKe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=zKe.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let h=u.indexDatatype;e._indices=h===Ae.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),JKe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function JKe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let d=xt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),u=xt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),h=xt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),p=xt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),g=xt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),f=xt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),x=[{index:s1.previousPosition,vertexBuffer:d,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:s1.currentPosition,vertexBuffer:u,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:s1.nextPosition,vertexBuffer:h,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:s1.expandAndWidth,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:2},{index:s1.a_batchId,vertexBuffer:g,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ei({context:t,attributes:x,indexBuffer:f}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var l2=new M,yle=new m;function QKe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,l2),M.multiplyByPoint(l2,e._center,yle),M.setTranslation(l2,yle,l2),l2},u_highlightColor:function(){return e._highlightColor}})}function jKe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ue.fromCache({blending:mn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var qKe=`uniform vec4 u_highlightColor; -void main() -{ - out_FragColor = u_highlightColor; -} -`;function $Ke(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(NE),o=n.getFragmentShaderCallback(!1,void 0,!1)(qKe),r=new De({defines:["VECTOR_TILE",Ot.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[ud,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:s1})}function eJe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ee.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}ah.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,d=0;for(r=0;r{e.isDestroyed()||(e._error=u)})}function lJe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=c.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let h=xt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=xt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=xt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),f=xt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),x=xt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),_=xt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),C=xt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),V=xt.createIndexBuffer({context:t,typedArray:d,usage:Me.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),L=[{index:Ag.startEllipsoidNormal,vertexBuffer:h,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:Ag.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:Ag.startPositionAndHeight,vertexBuffer:g,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ag.endPositionAndHeight,vertexBuffer:f,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ag.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ag.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ag.a_batchId,vertexBuffer:C,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ei({context:t,attributes:L,indexBuffer:V}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var d2=new M,xle=new m;function dJe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,d2),M.multiplyByPoint(d2,e._center,xle),M.setTranslation(d2,xle,d2),d2},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function _le(e){return Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Un.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Un.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:Dt.CESIUM_3D_TILE_MASK,mask:Dt.CESIUM_3D_TILE_MASK}})}function uJe(e){l(e._rs)||(e._rs=_le(!1),e._rs3DTiles=_le(!0))}function mJe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(ME),o=n.getFragmentShaderCallback(!1,void 0,!0)(AE),r=new De({defines:["VECTOR_TILE",Ot.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[ud,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Ag})}function hJe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Ee.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=qe.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ee.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===kn.TERRAIN||i===kn.BOTH)&&t.commandList.push(n),(i===kn.CESIUM_3D_TILE||i===kn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}_b.prototype.getPositions=function(e){return I_.getPolylinePositions(this,e)};_b.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o{e.isDestroyed()||(e._error=t)})}_b.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=yJe(this).then(cJe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}dJe(this,t),mJe(this,t),uJe(this);let n=e.passes;(n.render||n.pick)&&hJe(this,e)};_b.prototype.isDestroyed=function(){return!1};_b.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var u2=_b;var O5n=T(S(),1);var Yz=32767,xJe=new he,_Je=new m;function TJe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);wn.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let d=l(n)||l(i)||l(o),u=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(d&&u)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r0)for(i=new Uint16Array(a),r=0;r0)for(o=new Uint16Array(c),r=0;r0&&(C=Po(i,n,d),n+=d,u>0&&(V=new Uint8Array(t,n,u),V=new Uint8Array(V),n+=u));let L=y(x.POLYGONS_LENGTH,0),Z=y(x.POLYLINES_LENGTH,0),G=y(x.POINTS_LENGTH,0),I=L+Z+G,v=new Op(e,I,C,V,SJe(e));if(e._batchTable=v,I===0)return;let P=new eh(x,_),w=P.getGlobalProperty("REGION");if(!l(w))throw new ae("Feature table global property: REGION must be defined");let F=ce.unpack(w),b=w[4],R=w[5],E=e._tile.computedTransform,X=P.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(X)?(X=m.unpack(X),M.multiplyByPoint(E,X,X)):(X=ce.center(F),X.height=W.lerp(b,R,.5),X=ne.WGS84.cartographicToCartesian(X));let A=CJe(x,_);if(n+=(4-n%4)%4,L>0){P.featuresLength=L;let N=y(P.getPropertyArray("POLYGON_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new ae("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let O=y(P.getPropertyArray("POLYGON_INDEX_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_INDEX_COUNT",Q.UNSIGNED_INT,1));if(!l(O))throw new ae("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=N.reduce(function(z,j){return z+j*2},0),Y=O.reduce(function(z,j){return z+j},0),k=new Uint32Array(t,n,Y);n+=h;let H=new Uint16Array(t,n,U);n+=p;let J,te;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(J=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Q.FLOAT,1),te=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Q.FLOAT,1)),e._polygons=new c2({positions:H,counts:N,indexCounts:O,indices:k,minimumHeight:b,maximumHeight:R,polygonMinimumHeights:J,polygonMaximumHeights:te,center:X,rectangle:F,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,batchIds:A.polygons,modelMatrix:E})}if(Z>0){P.featuresLength=Z;let N=y(P.getPropertyArray("POLYLINE_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYLINE_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new ae("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let O=P.getPropertyArray("POLYLINE_WIDTHS",Q.UNSIGNED_SHORT,1);if(!l(O)){O=new Uint16Array(Z);for(let te=0;te0){let N=new Uint16Array(t,n,G*3);n+=f,e._points=new a2({positions:N,batchIds:A.points,minimumHeight:b,maximumHeight:R,rectangle:F,batchTable:v})}}function Hz(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}lh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};lh.prototype.getFeature=function(e){return l(this._features)||Hz(this),this._features[e]};lh.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};lh.prototype.applyStyle=function(e){l(this._features)||Hz(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};lh.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||Hz(this),this._batchTable.update(e,t),this._ready=!0)};lh.prototype.pick=function(e,t,n){};lh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};lh.prototype.isDestroyed=function(){return!1};lh.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function ZJe(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c=0?i[r]:void 0}var P_=IJe;var nUn=T(S(),1);var Jkn=T(S(),1);function Cb(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Cb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Cb.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Cb.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Cb.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Cb.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Cb.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Cb.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Cb.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var p2=Cb;function Kz(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Kz._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new p2({tile:n,class:o})}}Kz._oneTimeWarning=_t;var b2=Kz;var LUn=T(S(),1);var lUn=T(S(),1);function XJe(e){let t=new Uint8Array(e),n=Ym(t);if(n==="glTF"&&(n="glb"),Ls.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=WJe(t);if(l(i.root))return{contentType:Ls.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ls.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ls.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ls.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ls.VOXEL_JSON,jsonPayload:i};throw new ae("Invalid tile content.")}function WJe(e){let t;try{t=Po(e)}catch{throw new ae("Invalid tile content.")}return t}var Rf=XJe;function Bu(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;sFJe(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function FJe(e,t,n){if(l(t))try{let i=Rf(t);if(i.contentType===Ls.EXTERNAL_TILESET)throw new ae("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ls.GEOMETRY||i.contentType===Ls.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=X_[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=W_(o,d));let u=P_(o,d);return l(u)&&(a.group=new Kx({metadata:u})),a}catch(i){Cle(e,n,i)}}function Cle(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}Bu.prototype.cancelRequests=function(){for(let e=0;ea?g=W.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,_=Math.ceil(f/t)+1,C=g/(x-1),V=f/(_-1),L=ce.northwest(e,r),Z=ce.center(e,NJe);(n!==0||i!==0)&&(Z.longitude=0;f--)Rs.computePosition(t,n,!1,g,f,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;for(f=0,g=i-2;g>0;g--)Rs.computePosition(t,n,!1,g,f,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;let _=h.length/3*2,C=Ae.createTypedArray(h.length/3,_),V=0;for(let Z=0;Z0){Yu.longitude=(t.west+t.east)*.5,Yu.latitude=d;let x=n.cartographicToCartesian(Yu,d1.origin);m.clone(c,d1.direction);let _=ln.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Wle);jn.rayPlane(d1,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(x,sk)}else u=n.geodeticSurfaceNormalCartographic(ce.southeast(t),sk);let h=m.cross(u,a,Xle);m.normalize(h,e.southNormal);let p=t.north,g;if(p<0){Yu.longitude=(t.west+t.east)*.5,Yu.latitude=p;let x=n.cartographicToCartesian(Yu,d1.origin);m.negate(c,d1.direction);let _=ln.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Wle);jn.rayPlane(d1,_,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,sk)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),sk);let f=m.cross(a,g,Xle);m.normalize(f,e.northNormal)}var jJe=new m,qJe=new m,$Je=new m(0,-1,0),eQe=new m(0,0,-1),Ple=new m;function tQe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,g=e.eastNormal,f=e.northNormal;t.mode!==oe.SCENE3D&&(d=t.mapProjection.project(ce.southwest(e.rectangle),jJe),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(ce.northeast(e.rectangle),qJe),u.z=u.y,u.y=u.x,u.x=0,h=$Je,g=m.UNIT_Y,p=eQe,f=m.UNIT_Z);let x=m.subtract(i,d,Ple),_=m.dot(x,h),C=m.dot(x,p),V=m.subtract(i,u,Ple),L=m.dot(V,g),Z=m.dot(V,f);_>0?r+=_*_:L>0&&(r+=L*L),C>0?r+=C*C:Z>0&&(r+=Z*Z)}let s,a,c;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let d=s-c;r+=d*d}else if(s0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):ln.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,ln.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=sK(ln.projectPointOntoPlane(c,t,rK),i[0],c,o),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=kle(t,p[0],p[1]),m.distance(a,t)}let u=Number.MAX_VALUE,h;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=sK(ln.projectPointOntoPlane(c,t,rK),i[r],c,this._edgeNormals[n[r]]),h=m.distanceSquared(a,t),h3)return a=sK(ln.projectPointOntoPlane(this._boundingPlanes[1],t,rK),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+d)%4]):m.distance(t,this._vertices[4+(n[1]-2+d)%4])};var yQe=new m,xQe=new m;function kle(e,t,n){let i=m.subtract(n,t,yQe),o=m.subtract(e,t,xQe),r=m.dot(i,o);if(r<=0)return t;let s=m.dot(i,i);return r>=s?n:(r=r/s,new m((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var _Qe=new ln(m.UNIT_X,0);function sK(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c0&&(f=!0,h+=d),s1||ii(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=M.multiply(a,this.transform,new M),d=l(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(d,this.transform,new M),this.computedTransform=c,this.metadata=b2(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let u;l(s)&&l(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let h;l(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,tr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&tr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Do.REPLACE:Do.ADD):l(i)?p=i.refine:p=Do.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,f=!1,x,_,C;if(t=Ze.createIfNeeded(t),r)x=Oo.UNLOADED,_=t.clone();else if(l(s)){let G=s.uri;l(s.url)&&(tr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),G=s.url),G===""?(tr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new a1(e,this),f=!0,x=Oo.READY):(x=Oo.UNLOADED,_=t.getDerivedResource({url:G}),C=$a.getServerKey(_.getUrlComponent()))}else g=new a1(e,this),f=!0,x=Oo.READY;this._content=g,this._contentResource=_,this._contentState=x,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let V=n.expire,L,Z;l(V)&&(L=V.duration,l(V.date)&&(Z=q.fromIso8601(V.date))),this.expireDuration=L,this.expireDate=Z,this.lastStyleTime=0,this._optimChildrenWithinParent=Du.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=B.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new q,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}tr._deprecationWarning=us;Object.defineProperties(tr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new B),B.clone(this._color)},set:function(e){this._color=B.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Oo.READY}},contentUnloaded:{get:function(){return this._contentState===Oo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Oo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Oo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Ng=new m;function ZQe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,Ng),c=m.add(s.positionWC,a,Ng),d=m.subtract(c,r,Ng);if(m.magnitude(d)>o){let Z=m.normalize(d,Ng),G=m.multiplyByScalar(Z,o,Ng),I=m.add(r,G,Ng),v=m.subtract(I,s.positionWC,Ng),P=m.normalize(v,Ng);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,P))}else e._foveatedFactor=0;let p=e.refine===Do.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Fo.PRELOAD_FLIGHT||n._pass===Fo.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*f;if(e._foveatedFactor<=x)return!1;let _=f-x,C=W.clamp((e._foveatedFactor-x)/_,0,1),V=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,C),L=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-V<=L}var zle=new q;tr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,d=a.frustum,u=c.drawingBufferWidth,h=c.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||d instanceof an){let g=d.offCenterFrustum;l(g)&&(d=g);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,h);p=s/f}else{let g=Math.max(this._distanceToCamera,W.EPSILON7),f=d.sseDenominator;if(p=s*h/(g*f),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,C=W.fog(g,x)*_;p-=C}}return p/=e.pixelRatio,p};function GQe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function EQe(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}tr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:hs.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==hs.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=EQe(n,this),this._priorityProgressiveResolution=GQe(n,this),this.priorityDeferred=ZQe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};tr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=q.now(zle);q.lessThan(this.expireDate,e)&&(this._contentState=Oo.EXPIRED,this._expiredContent=this._content)}};function IQe(e){if(!l(e.expireDuration))return;let t=q.now(zle);q.addSeconds(t,e.expireDuration,t),l(e.expireDate)?q.lessThan(e.expireDate,t)&&q.clone(t,e.expireDate):e.expireDate=q.clone(t)}function XQe(e){return function(){return e._priority}}tr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?WQe(this):vQe(this)};function WQe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ii(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new g2(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Oo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Oo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Oo.FAILED,o})}async function PQe(e,t,n,i,o){let r=e._contentState;e._contentState=Oo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Qn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Oo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Qn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await wQe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Oo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Oo.FAILED,a}}function vQe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Ko({throttle:!0,throttleByServer:!0,type:ls.TILES3D,priorityFunction:XQe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return PQe(e,o,i,n,r)}async function wQe(e,t){let n=Rf(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Ls.GEOMETRY||n.contentType===Ls.VECTOR,(n.contentType===Ls.IMPLICIT_SUBTREE||n.contentType===Ls.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===Ls.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=X_[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,d=e.implicitCoordinates;o.metadata=c.getContentMetadataView(d,0)}else e.hasImplicitContent||(o.metadata=W_(i,s));let a=P_(i,s);return l(a)&&(o.group=new Kx({metadata:a})),o}tr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};tr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Oo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var Kle=new le;function lK(e,t){if(t.mode!==oe.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Kle);e._boundingVolume2D=new Zb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function FQe(e,t){if(t.mode!==oe.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Kle);e._contentBoundingVolume2D=new Zb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}tr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=lK(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==zt.INSIDE,a===zt.OUTSIDE)return hs.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==zt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};tr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return zt.INSIDE;if(this._visibilityPlaneMask===hs.MASK_INSIDE)return zt.INSIDE;let t=e.cullingVolume,n=FQe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==zt.INSIDE,s===zt.OUTSIDE)return zt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==zt.OUTSIDE,s===zt.INSIDE)return zt.OUTSIDE}return t.computeVisibility(n)};tr.prototype.distanceToTile=function(e){return lK(this,e).distanceToCamera(e)};var AQe=new m;tr.prototype.distanceToTileCenter=function(e){let n=lK(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,AQe);return m.dot(e.camera.directionWC,i)};tr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Jle=new $,Qle=new m,MQe=new $,dK=new m,jle=new ce,qle=new Gn,cK=new M;function NQe(e,t,n){let i=m.fromElements(e[0],e[1],e[2],dK),o=$.fromArray(e,3,MQe);i=M.multiplyByPoint(t,i,i);let r=M.getMatrix3(t,Jle);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new Ed(i,o)}function kQe(e,t,n,i){let o=ce.unpack(e,0,jle),r=e[4],s=e[5],a=Gn.fromRectangle(o,r,s,ne.WGS84,qle),c=a.center,d=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,cK),cK),c=M.multiplyByPoint(t,c,c);let u=M.getMatrix3(t,Jle);return d=$.multiply(u,d,d),l(i)&&i instanceof Ed?(i.update(c,d),i):new Ed(c,d)}function UQe(e,t,n,i){if(!M.equalsEpsilon(t,n,W.EPSILON8))return kQe(e,t,n,i);let o=ce.unpack(e,0,jle);return l(i)?(i.rectangle=ce.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ne.WGS84),i):new Hu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function DQe(e,t,n){let i=m.fromElements(e[0],e[1],e[2],dK),o=e[3];i=M.multiplyByPoint(t,i,i);let r=M.getScale(t,Qle),s=m.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new Zb(i,o)}tr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=m_.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ae("boundingVolume must be defined");if(ii(e,"3DTILES_bounding_volume_S2"))return new T2(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=NQe(r,t,n);return this._verticalExaggeration!==1&&Ole(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=UQe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Ed?Ole(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Tr.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Tr.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ne.WGS84))),c}if(l(a)){let c=DQe(a,t,n);if(this._verticalExaggeration!==1){let d=Tr.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,dK),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new ae("boundingVolume must contain a sphere, region, or box")};var BQe=m.unpackArray(new Array(8*3).fill(0));function Ole(e,t,n){let i=e.boundingVolume.computeCorners(BQe).map(r=>Tr.getPosition(r,ne.WGS84,t,n,r)),o=Gn.fromPoints(i,qle);e.update(o.center,o.halfAxes)}tr.prototype.updateTransform=function(e,t){e=y(e,M.IDENTITY);let n=M.multiplyTransformation(e,this.transform,cK),i=!M.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&M.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};tr.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,Qle),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function OQe(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=B.WHITE:c=B.DARKGRAY:c=B.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=Ht.toValue(c,d.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(B.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(B.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=B.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function YQe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Oo.FAILED,o}}function HQe(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function zQe(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}tr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;HQe(this,e),zQe(this,e),OQe(this,e,t,n),YQe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;se.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};D_.prototype.trim=function(){this._trimTiles=!0};var R2=D_;var ZOn=T(S(),1);function uk(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function mK(e,t){let n;return t==="_loadTimestamp"?n=q.toDate(e).getTime():n=e,n}uk.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=mK(e,n),this._referenceMaximum[n]=mK(t,n)};function QQe(e,t){let n=e.tilePropertyName;if(l(n)){let i=mK(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var uK=[new B(.1,.1,.1,1),new B(.153,.278,.878,1),new B(.827,.231,.49,1),new B(.827,.188,.22,1),new B(1,.592,.259,1),new B(1,.843,0,1)];uk.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=QQe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+W.EPSILON7,c=W.clamp(i-o,0,s)/s,d=uK.length-1,u=c*d,h=Math.floor(u),p=Math.ceil(u),g=u-h,f=uK[h],x=uK[p],_=B.clone(B.WHITE);_.red=W.lerp(f.red,x.red,g),_.green=W.lerp(f.green,x.green,g),_.blue=W.lerp(f.blue,x.blue,g),e._debugColor=_};uk.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var Z2=uk;var XOn=T(S(),1);function y1(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}y1.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};y1.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function fK(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}I2.encode2D=function(e,t){return(nde(e)|nde(t)<<1)>>>0};I2.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=ide(e),t[1]=ide(e>>1),t};I2.encode3D=function(e,t,n){return hK(e)|hK(t)<<1|hK(n)<<2};I2.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=fK(e),t[1]=fK(e>>1),t[2]=fK(e>>2),t};var kg=I2;function Yo(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===$r.OCTREE&&(this.z=e.z)}Object.defineProperties(Yo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===$r.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===$r.OCTREE?kg.encode3D(this.x,this.y,this.z):kg.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===$r.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Yo.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===$r.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Yo.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===$r.OCTREE?this.z===e.z:!0)};Yo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Yo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Yo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Yo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===$r.OCTREE&&(e.z=this.z),e};var ode=[0,0,0];Yo.fromMortonIndex=function(e,t,n,i){let o;return e===$r.OCTREE?(o=kg.decode3D(i,ode),new Yo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=kg.decode2D(i,ode),new Yo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Yo.fromTileIndex=function(e,t,n){let i,o,r;return e===$r.OCTREE?(i=Math.floor(W.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(W.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Yo.fromMortonIndex(e,t,i,r)};var O_=Yo;var lYn=T(S(),1);var iYn=T(S(),1);function Xb(){}Xb.selectTiles=function(e,t){pe.throwInstantiationError()};Xb.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Xb.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Xb.selectTile=function(e,t){if(e.contentVisibility(t)===zt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];rde(r,t),e._visible=r._visible;return}if(t4e(e,t)){e._visible=!1;return}let i=e.refine===Do.REPLACE,o=e._optimChildrenWithinParent===Du.USE_OPTIMIZATION;if(i&&o&&n&&!n4e(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function t4e(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Do.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function n4e(e,t){let n=!1,i=e.children;for(let o=0;o0;){X2.stackMaximumLength=Math.max(X2.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Do.ADD,d=a.refine===Do.REPLACE,u=o4e(a);u&&r4e(a,s,t),(c||d&&!u)&&(s4e(e,a),o(a,t),a4e(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return X2.stack.trim(X2.stackMaximumLength),n};function o4e(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function r4e(e,t,n){let{children:i}=e;for(let o=0;o0;){P2.stackMaximumLength=Math.max(P2.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?c4e(c,a,t)&&u:!1;let h=!c._refines&&u;c.hasRenderableContent?c.refine===Do.ADD?(pK(c,t),o(c,t)):c.refine===Do.REPLACE&&(o(c,t),h&&pK(c,t)):(n._emptyTiles.push(c),o(c,t),h&&pK(c,t)),r(c,t),s(c,t)}}function d4e(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Hs,s=!0,a=v2.stack;for(a.push(e);a.length>0;){v2.stackMaximumLength=Math.max(v2.stackMaximumLength,a.length);let c=a.pop(),d=c.children,u=d.length,h=!c.hasRenderableContent&&n(c);if(!h&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),h)for(let p=0;p0;){A2.stackMaximumLength=Math.max(A2.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;cn._depth+e.skipLevels)}function p4e(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Hs;for(let d=0;dt:e._screenSpaceError>t:!0}function g4e(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Hs,c=F2.stack;for(c.push(e);c.length>0;){F2.stackMaximumLength=Math.max(F2.stackMaximumLength,c.length);let d=c.pop();h4e(d,t);let u=d.parent,h=!l(u)||u._refines;d._refines=o(d)?p4e(d,c,t)&&h:!1;let p=!d._refines&&h;d.hasRenderableContent?d.refine===Do.ADD?(mk(d,t),r(d,t)):d.refine===Do.REPLACE&&(b4e(d,i)?(r(d,t),p&&mk(d,t)):p?(mk(d,t),r(d,t)):f4e(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&mk(d,t)),s(d,t),a(d,t)}}function y4e(e,t){let{selectTile:n,canTraverse:i}=Hs,{stack:o,ancestorStack:r}=Wb,s;for(o.push(e);o.length>0||r.length>0;){if(Wb.stackMaximumLength=Math.max(Wb.stackMaximumLength,o.length),Wb.ancestorStackMaximumLength=Math.max(Wb.ancestorStackMaximumLength,r.length),r.length>0){let d=r.peek();if(d._stackLength===o.length){r.pop(),d!==s&&(d._finalResolution=!1),n(d,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Do.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let d=a.children;for(let u=0;uli._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=wt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=M.clone(s._initialClippingPlanesOriginMatrix),s};nr.loadJson=function(e){return Ze.createIfNeeded(e).fetchJson()};nr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};nr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new ae("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ae("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&nr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=lde(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Do.ADD;let d=c._header.children;if(l(d))for(let u=0;u_.minimumRadius){let L=he.fromCartesian(V,_,_4e);n=m.normalize(a.positionWC,dde),i=a.directionWC,o=a.positionCartographic.height,r=0,s=L.height*2}else{let L=M.multiplyByPoint(x,a.positionWC,C4e);if(n=m.UNIT_Z,i=M.multiplyByPointAsVector(x,a.directionWC,V4e),i=m.normalize(i,i),o=L.z,d instanceof Ed){let Z=$.getColumn(C.halfAxes,2,L4e),G=m.magnitude(Z);r=V.z-G,s=V.z+G}else if(d instanceof Zb){let Z=C.radius;r=V.z-Z,s=V.z+Z}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*u,p=s,g=W.clamp((o-h)/(p-h),0,1),f=1-Math.abs(m.dot(i,n));f=f*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function Z4e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{hde(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?U4e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function mde(e,t){return e._priority-t._priority}nr.prototype.postPassesUpdate=function(e){l(this._root)&&(G4e(this,e),B4e(this,e),this._cache.unloadTiles(this,pde),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};nr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;w4e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=q.clone(e.time)),this._timeSinceLoad=Math.max(q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&R4e(this,e),e.newFrame&&this._cache.reset()};function G4e(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o=1;if(r._contentState!==Oo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function E4e(e){let t=e._requestedTiles;t.sort(mde);for(let n=0;n0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function I4e(e){let t=e._processingQueue,n=0;for(let i=0;i0&&(t[i-n]=o)}t.length-=n}var X4e=new he,W4e=new he,P4e=new m;function v4e(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=he.clone(r.positionCartographic,X4e),c=he.fromCartesian(o.center,s,W4e);l(c)&&(a.height=c.height);let d=he.toCartesian(a,s,P4e);m.distance(d,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function w4e(e,t){I4e(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;cs){a=!0;break}let d=n[c];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,hde(u,e,d)}}e.totalMemoryUsageInBytes0&&F4e(e)}function F4e(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n0&&(i+=` -Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=` -Triangles: ${e.content.trianglesLength}`,o++),i+=` -Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=` -Texture Memory: ${ude(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${ude(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` -Urls:`;let s=e.content.innerContentUrls;for(let a=0;a0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new $n({stencil:0,pass:Ee.CESIUM_3D_TILE,renderState:Ue.fromCache({stencilMask:Dt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:d}=e,u=n.isRender,h=i.length;for(let f=0;f=0;--_)i[h+x+_]=i[h+_];for(let _=0;_0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Cf),N4e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var fde=[];function U4e(e,t){let n=t,i=fde;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r{t.push(Ct.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;oi.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}nr.prototype.getTraversal=function(e){let{pass:t}=e;return t===Fo.MOST_DETAILED_PRELOAD||t===Fo.MOST_DETAILED_PICK?W2:this.isSkippingLevelOfDetail?M2:w2};nr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};nr.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Fo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Fo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Fo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Fo.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),d=c.length;if(e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r),s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let u=this._clippingPolygons;l(u)&&u.enabled&&u.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=H4e(this,e,h,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};nr.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};nr.prototype.isDestroyed=function(){return!1};nr.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=fde;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a{let u=le.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),h=le.distanceSquaredTo(d.contentBoundingVolume.boundingSphere,e.origin);return u-h});let a;for(let c=0;c-1;i--)yK(this,e[i],t,n);return me(this)};Ug.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return dt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(le.clone(i.boundingSphere,t),dt.DONE):dt.FAILED:dt.PENDING};Ug.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(yK(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],yK(this,r,a,c),s.remove(r.id)};function yK(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function $4e(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await bs.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var N2=Ug;var $Hn=T(S(),1);var eje=B.WHITE,tje=B.BLACK,nje=new D(2,2);function x1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(x1.prototype,{isConstant:{get:function(){return K.isConstant(this._evenColor)&&K.isConstant(this._oddColor)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:ue("evenColor"),oddColor:ue("oddColor"),repeat:ue("repeat")});x1.prototype.getType=function(e){return"Checkerboard"};var ije=new q;x1.prototype.getValue=function(e,t){return l(e)||(e=q.now(ije)),l(t)||(t={}),t.lightColor=K.getValueOrClonedDefault(this._evenColor,e,eje,t.lightColor),t.darkColor=K.getValueOrClonedDefault(this._oddColor,e,tje,t.darkColor),t.repeat=K.getValueOrDefault(this._repeat,e,nje),t};x1.prototype.equals=function(e){return this===e||e instanceof x1&&K.equals(this._evenColor,e._evenColor)&&K.equals(this._oddColor,e._oddColor)&&K.equals(this._repeat,e._repeat)};var _1=x1;var gzn=T(S(),1);var dzn=T(S(),1);var gde={id:void 0};function k2(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function pc(e){this._owner=e,this._entities=new Zt,this._addedEntities=new Zt,this._removedEntities=new Zt,this._changedEntities=new Zt,this._suspendCount=0,this._collectionChanged=new be,this._id=Bn(),this._show=!0,this._firing=!1,this._refire=!1}pc.prototype.suspendEvents=function(){this._suspendCount++};pc.prototype.resumeEvents=function(){this._suspendCount--,k2(this)};Object.defineProperties(pc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t-1;c--)s=a[c],xde(e,p,g,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(kr.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--){s=a[c],yde(e,p,g,s);let x=h.getById(s.id);l(x)||(x=u.getById(s.id),l(x)?xK(x):(fk.id=s.id,x=new $o(fk)),h.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=h.values;for(r=0;r=0;a--)c=i[a].getById(x),l(c)&&(l(d)||(d=r.getById(x),xK(d)),d.merge(c));l(d)||r.removeById(x),d=void 0}let g=t.length;for(s=0;s=0;a--)c=i[a].getById(x),l(c)&&(l(d)||(d=r.getById(x),l(d)?xK(d):(fk.id=x,d=new $o(fk),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};kr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),d=c[t],u=!l(d),h=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let f=g[t];if(l(f)){if(h)if(h=!1,l(f.merge)&&l(f.clone))d=f.clone(d);else{d=f;break}d.merge(f)}}}u&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=d};var _K=kr;var Yzn=T(S(),1);var Mzn=T(S(),1);var xzn=T(S(),1);function TK(){this._removalFunctions=[]}TK.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};TK.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Ur.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Ur.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Ur.prototype.contains=function(e){return this.indexOf(e)>=0};var SK=new Ln;Ur.prototype.indexOf=function(e){let t=this._intervals;SK.start=e,SK.stop=e;let n=Io(t,SK,VK);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-10&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i0&&(o=q.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(q.greaterThan(e.stop,n[i-1].stop)?e=new Ln({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Ln({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=q.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Ln({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Ln({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Ln({start:e.start,stop:q.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:q.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Ln({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Ur.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Io(t,e,VK);n<0&&(n=~n);let i=!1;for(n>0&&(q.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(q.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Ln({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Ln({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),U2[2]=Vm(d)?29:28;a>U2[c]||c>=13;)a>U2[c]&&(a-=U2[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),U2[2]=Vm(d)?29:28;return bc.millisecond=i,bc.second=o,bc.minute=r,bc.hour=s,bc.day=a,bc.month=c,bc.year=d,q.fromGregorianDate(bc,n)}var oje=new q,rje=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Tde(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(rje);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),q.toGregorianDate(q.fromIso8601(e,oje),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var D2=new yp;Ur.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=q.fromIso8601(n[0]),o=q.fromIso8601(n[1]),r=[];if(!Tde(n[2],D2))r.push(i,o);else{let s=q.clone(i);for(r.push(s);q.compare(s,o)<0;)s=CK(s,D2),q.compare(o,s)<=0&&q.clone(o,s),r.push(s)}return Ur.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ur.fromIso8601DateArray=function(e,t){return Ur.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return q.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ur.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let d=0;d=0?-a:a}var Sje=new m(-1,0,0),H_=new M,Cje=new M,ZK=new $,Vje=$.IDENTITY.clone(),Lje=new m,Rje=new se,Sde=new m;function Pb(e,t,n,i,o,r,s,a){let c=Lje,d=Rje;H_=wt.eastNorthUpToFixedFrame(e,o,H_),c=M.multiplyByPointAsVector(H_,Sje,c),c=m.normalize(c,c);let u=Tje(c,t,e,o);ZK=$.fromRotationZ(u,ZK),Sde.z=r,H_=M.multiplyTransformation(H_,M.fromRotationTranslation(ZK,Sde,Cje),H_);let h=Vje;h[0]=s;for(let p=0;p0){let x=d?2:1;for(let _=0;_=0};var Eje=new m,Ije=new m;B2.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=_je(e,r),a=i._granularity,c=i._cornerType,d=o?Gje(t,n):Cde(t,n),u=o?Cde(t,n):void 0,h=n.height/2,p=n.width/2,g=e.length,f=[],x=o?[]:void 0,_=uje,C=mje,V=hje,L=fje,Z=pje,G=bje,I=gje,v=yje,P=xje,w=e[0],F=e[1];L=r.geodeticSurfaceNormal(w,L),_=m.subtract(F,w,_),_=m.normalize(_,_),v=m.cross(L,_,v),v=m.normalize(v,v);let b=s[0],R=s[1];o&&(x=Pb(w,v,u,x,r,b+h,1,1)),P=m.clone(w,P),w=F,C=m.negate(_,C);let E,X;for(let O=1;OIe;p--)Te=W.PI_OVER_TWO-p*ye,ee[de++]=1-fe*(1+Math.cos(Te)),ee[de++]=.5*(1+Math.sin(Te));for(p=Ie;p>0;p--)Te=W.PI_OVER_TWO-ye*p,ee[de++]=1-_e*(1+Math.cos(Te)),ee[de++]=.5*(1+Math.sin(Te));for(p=u-_;p>0;p--)ee[de++]=p*_e,ee[de++]=1;for(p=1;p0;p--)ee[de++]=(p-1)*_e,ee[de++]=1}c.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(c.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(c.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(c.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:c,indices:U}}function Bje(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,h=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Mde,f=Nde,x=_k,_=Tk,C=Dje,V=kde,L=c;for(d=0;d-t?(o=Qje,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),PK(e,o,i)};Gf.prototype.computeHorizonCullingPoint=function(e,t,n){return iue(this._ellipsoid,e,t,n)};var tue=ne.clone(ne.UNIT_SPHERE);Gf.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=nue(this._ellipsoid,n,tue);return iue(o,e,t,i)};Gf.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return oue(this._ellipsoid,e,t,n,i,o)};Gf.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=nue(this._ellipsoid,o,tue);return oue(s,e,t,n,i,r)};var jje=[];Gf.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,jje),o=le.fromPoints(i);if(!(m.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var qje=new m;function nue(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,qje);e=ne.fromCartesian3(i,n)}return e}function iue(e,t,n,i){l(i)||(i=new m);let o=aue(e,t),r=0;for(let s=0,a=n.length;s0:s>o&&s*s/m.magnitudeSquared(r)>o)}var $je=new m,e8e=new m;function rue(e,t,n){let i=e.transformPositionToScaledSpace(t,$je),o=m.magnitudeSquared(i),r=Math.sqrt(o),s=m.divideByScalar(i,r,e8e);o=Math.max(1,o),r=Math.max(1,r);let a=m.dot(s,n),c=m.magnitude(m.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-c*u)}function sue(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var WK=new m;function aue(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,WK),m.normalize(WK,WK))}var Fb=Gf;var SQn=T(S(),1);function Lr(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=Ft.clone(o)),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),this._actualPosition=m.clone(this._position),this._color=B.clone(y(e.color,B.WHITE)),this._outlineColor=B.clone(y(e.outlineColor,B.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=y(e.splitDirection,vr.NONE)}var cue=Lr.SHOW_INDEX=0,uue=Lr.POSITION_INDEX=1,t8e=Lr.COLOR_INDEX=2,n8e=Lr.OUTLINE_COLOR_INDEX=3,i8e=Lr.OUTLINE_WIDTH_INDEX=4,o8e=Lr.PIXEL_SIZE_INDEX=5,r8e=Lr.SCALE_BY_DISTANCE_INDEX=6,s8e=Lr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,a8e=Lr.DISTANCE_DISPLAY_CONDITION_INDEX=8,c8e=Lr.DISABLE_DEPTH_DISTANCE_INDEX=9,l8e=Lr.SPLIT_DIRECTION_INDEX=10;Lr.NUMBER_OF_PROPERTIES=11;function Id(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Lr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Id(this,cue))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Id(this,uue))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),Id(this,r8e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),Id(this,s8e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Id(this,o8e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),Id(this,t8e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),Id(this,n8e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Id(this,i8e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ft.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Ft.clone(e,this._distanceDisplayCondition),Id(this,a8e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Id(this,c8e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Id(this,cue))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Id(this,l8e))}}});Lr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Lr.prototype._getActualPosition=function(){return this._actualPosition};Lr.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Id(this,uue)};var lue=new se;Lr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(M.multiplyByPoint(n,e,lue),ki.computeActualEllipsoidPosition(t,lue))};var due=new se;Lr._computeScreenSpacePosition=function(e,t,n,i){let o=M.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,due),due);return ki.worldToWindowCoordinates(n,o,i)};Lr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new D);let i=n.modelMatrix,o=Lr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Lr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new ze),n.x=r,n.y=s,n.width=a,n.height=c,n};Lr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&m.equals(this._position,e._position)&&B.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&B.equals(this._outlineColor,e._outlineColor)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ft.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Lr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Zs=Lr;var JQn=T(S(),1);var d8e=Zs.SHOW_INDEX,FK=Zs.POSITION_INDEX,mue=Zs.COLOR_INDEX,u8e=Zs.OUTLINE_COLOR_INDEX,m8e=Zs.OUTLINE_WIDTH_INDEX,h8e=Zs.PIXEL_SIZE_INDEX,hue=Zs.SCALE_BY_DISTANCE_INDEX,fue=Zs.TRANSLUCENCY_BY_DISTANCE_INDEX,pue=Zs.DISTANCE_DISPLAY_CONDITION_INDEX,f8e=Zs.DISABLE_DEPTH_DISTANCE_INDEX,p8e=Zs.SPLIT_DIRECTION_INDEX,AK=Zs.NUMBER_OF_PROPERTIES,yc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function ju(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(AK),this._maxPixelSize=1,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Lo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ju.prototype,{length:{get:function(){return MK(this),this._pointPrimitives.length}}});function bue(e){let t=e.length;for(let n=0;n0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let u=0,h=i.splitDirection;l(h)&&(u=h),r(o,s,a,d,u)}function g8e(e,t,n,i){gue(e,t,n,i),yue(e,t,n,i),xue(e,t,n,i),_ue(e,t,n,i),Tue(e,t,n,i)}function wK(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c0){this._vaf=b8e(c,n,this._buffersUsage),a=this._vaf.writers;for(let G=0;G0){let G=_8e;G.length=0,(r[FK]||r[m8e]||r[h8e])&&G.push(gue),(r[mue]||r[u8e])&&G.push(yue),(r[d8e]||r[fue])&&G.push(xue),r[hue]&&G.push(_ue),(r[pue]||r[f8e]||r[p8e])&&G.push(Tue);let I=G.length;if(a=this._vaf.writers,o/n>.1){for(let v=0;vn*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=M.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,h=le.clone(this._baseVolumeWC,this._boundingVolume)):h=le.clone(this._baseVolume2D,this._boundingVolume),x8e(this,e,h);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!1,blending:mn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new De({sources:[_E]}),this._shaderScaleByDistance&&f.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&f.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&f.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&f.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(x=new De({defines:["OPAQUE"],sources:[U0]}),this._sp=en.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:yc}),x=new De({defines:["TRANSLUCENT"],sources:[U0]}),this._spTranslucent=en.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:yc})),this._blendOption===Lo.OPAQUE&&(x=new De({sources:[U0]}),this._sp=en.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:yc})),this._blendOption===Lo.TRANSLUCENT&&(x=new De({sources:[U0]}),this._spTranslucent=en.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:yc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let _,C,V,L,Z=e.commandList;if(d.render||u){let G=this._colorCommands,I=this._blendOption===Lo.OPAQUE,v=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,C=_.length,G.length=C;let P=v?C*2:C;for(L=0;L>4;if(o!==NK)throw new Error(`Got v${o} data when expected v${NK}.`);let r=Sue[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=Sue.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,Q2,t),this.coords=new this.ArrayType(this.data,Q2+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Q2+s+a+c),this.ids=new this.IndexArrayType(this.data,Q2,t),this.coords=new this.ArrayType(this.data,Q2+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(NK<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return UK(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],d=[];for(;c.length;){let u=c.pop()||0,h=c.pop()||0,p=c.pop()||0;if(h-p<=a){for(let _=p;_<=h;_++){let C=s[2*_],V=s[2*_+1];C>=t&&C<=i&&V>=n&&V<=o&&d.push(r[_])}continue}let g=p+h>>1,f=s[2*g],x=s[2*g+1];f>=t&&f<=i&&x>=n&&x<=o&&d.push(r[g]),(u===0?t<=f:n<=x)&&(c.push(p),c.push(g-1),c.push(1-u)),(u===0?i>=f:o>=x)&&(c.push(g+1),c.push(h),c.push(1-u))}return d}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],d=i*i;for(;a.length;){let u=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let _=p;_<=h;_++)Cue(r[2*_],r[2*_+1],t,n)<=d&&c.push(o[_]);continue}let g=p+h>>1,f=r[2*g],x=r[2*g+1];Cue(f,x,t,n)<=d&&c.push(o[g]),(u===0?t-i<=f:n-i<=x)&&(a.push(p),a.push(g-1),a.push(1-u)),(u===0?t+i>=f:n+i>=x)&&(a.push(g+1),a.push(h),a.push(1-u))}return c}};function UK(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Vue(e,t,s,i,o,r),UK(e,t,n,i,s-1,1-r),UK(e,t,n,s+1,o,1-r)}function Vue(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+g)),x=Math.min(o,Math.floor(n+(d-u)*p/d+g));Vue(e,t,n,f,x,r)}let s=t[2*n+r],a=i,c=o;for(j2(e,t,i,n),t[2*o+r]>s&&j2(e,t,i,o);as;)c--}t[2*i+r]===s?j2(e,t,i,c):(c++,j2(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function j2(e,t,n,i){kK(e,n,i),kK(t,2*n,2*i),kK(t,2*n+1,2*i+1)}function kK(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Cue(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function fh(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new be,this.show=y(e.show,!0)}function Lue(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var T8e=new ze;function Rue(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=vg.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=co.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Zs.getScreenSpaceBoundingBox(e,t,o)),Lue(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Gue(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=vg.getScreenSpaceBoundingBox(s,t,T8e);Lue(a,n),o=ze.union(o,a,o)}return o}function S8e(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Gue(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Zue(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function Gue(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function DK(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s0){let A=new q2(V.length,64,Uint32Array);for(let N=0;N=u)for(Zue(N.position,R,b,e),p.push(N),Z=0;Z=u){let k=m.multiplyByScalar(Y,1/R,Y);for(Zue(k,R,b,e),p.push({position:k,width:U.width,height:U.height,minimumWidth:I.width,minimumHeight:I.height}),Z=0;Z0?(a=d.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function YK(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}fh.prototype.getLabel=OK("_labelCollection",Cf,"_unusedLabelIndices","labelIndex");fh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,YK(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};fh.prototype.getBillboard=OK("_billboardCollection",Rd,"_unusedBillboardIndices","billboardIndex");fh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,YK(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};fh.prototype.getPoint=OK("_pointCollection",Z1,"_unusedPointIndices","pointIndex");fh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,YK(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function BK(e){if(!l(e))return;let t=e.length;for(let n=0;n0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,Z8e(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};fh.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Xd=fh;function HK(e){this._name=e,this._clock=void 0,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new zs(this),this._entityCluster=new Xd}Object.defineProperties(HK.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Br.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});HK.prototype.update=function(e){return!0};var $2=HK;var Vjn=T(S(),1);var U4n=T(S(),1);var V4n=T(S(),1);var Eue={};Eue.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,d=new Float64Array(c*3),u,h=0,p=0,g=o?a*3:0,f=o?(a+i)*3:i*3;for(u=0;u0){let x=Math.min(r,o);d=Math.round(o/x),c+=x}let u=Ae.createTypedArray(s,c*2),h=0,p;for(p=0;p0)for(p=0;p0){for(c=0;c=t;i--)e[i]=e[a--]}for(i=0;i=0||l(h)&&q.compare(u,h)>=0));){for(tJ[p++]=u,r=r+1,s=0;s0&&(nJ.length=g,Fue(n,d,nJ),tJ.length=p,Fue(t,c,tJ))}else{for(s=0;so)return;if(this._backwardExtrapolationType===Pd.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let Z=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Pd.NONE||o!==0&&q.secondsDifference(e,Z)>o)return;if(this._forwardExtrapolationType===Pd.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,d=this._yTable,u=this._interpolationAlgorithm,h=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let Z=Math.min(u.getRequiredDataPoints(this._interpolationDegree,p),i);Z!==this._numberOfPoints&&(this._numberOfPoints=Z,c.length=Z,d.length=Z*h)}let g=this._numberOfPoints-1;if(g<1)return;let f=0,x=i-1;if(x-f+1>=g+1){let Z=a-(g/2|0)-1;Zx&&(G=x,Z=G-g,Z0){n=new Array(t);for(let i=0;ic&&e!==Object}let f=typeof e.unpack=="function"&&e!==qu;if(!g&&!p){h?t[n]=new Jn(f?e.unpack(d,0):d):t[n]=Bue(e,s,i);return}let x=t[n],_,C=i.epoch;if(l(C)&&(_=q.fromIso8601(C)),g&&!p){x instanceof wd||(t[n]=x=new wd(e)),x.addSamplesPackedArray(d,_),Gk(i,x);return}let V;if(!g&&p){a=a.clone(),h?a.data=f?e.unpack(d,0):d:a.data=Bue(e,s,i),l(x)||(t[n]=x=h?new Bb:new gc),h&&x instanceof Bb?x.intervals.addInterval(a):x instanceof gc?(h&&(a.data=new Jn(a.data)),x.intervals.addInterval(a)):(t[n]=x=Jue(x),h&&(a.data=new Jn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new gc),x instanceof gc||(t[n]=x=Jue(x));let L=x.intervals;V=L.findInterval(a),(!l(V)||!(V.data instanceof wd))&&(V=a.clone(),V.data=new wd(e),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),Gk(i,V.data)}function ame(e,t){if(e instanceof wd){e.removeSamples(t);return}else if(e instanceof Bb){e.intervals.removeInterval(t);return}else if(e instanceof gc){let n=e.intervals;for(let i=0;ic),!f&&!p){h?e[t]=new Uc(m.unpack(d),g):e[t]=cv(r,n.reference);return}let x=e[t],_,C=n.epoch;if(l(C)&&(_=q.fromIso8601(C)),f&&!p){(!(x instanceof fa)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new fa(g,a)),x.addSamplesPackedArray(d,_),Gk(n,x);return}let V;if(!f&&p){s=s.clone(),h?s.data=m.unpack(d):s.data=cv(r,n.reference),l(x)||(h?x=new Db(g):x=new ma(g),e[t]=x),h&&x instanceof Db&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof ma?(h&&(s.data=new Uc(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=Que(x),h&&(s.data=new Uc(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof ma||(e[t]=x=Que(x)):e[t]=x=new ma(g);let L=x.intervals;V=L.findInterval(s),(!l(V)||!(V.data instanceof fa)||l(g)&&V.data.referenceFrame!==g)&&(V=s.clone(),V.data=new fa(g,a),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),Gk(n,V.data)}function cme(e,t){if(e instanceof fa){e.removeSamples(t);return}else if(e instanceof Db){e.intervals.removeInterval(t);return}else if(e instanceof ma){let n=e.intervals;for(let i=0;i. version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function t6e(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=ur(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Ax),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),xe(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Je,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Je,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe(qu,s,"rotation",o.rotation,r,i,n),xe(qu,s,"stRotation",o.stRotation,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Fd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(Ft,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function n6e(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=ur(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Mx),xe(Boolean,s,"show",o.show,r,i,n),xe(m,s,"radii",o.radii,r,i,n),xe(m,s,"innerRadii",o.innerRadii,r,i,n),xe(Number,s,"minimumClock",o.minimumClock,r,i,n),xe(Number,s,"maximumClock",o.maximumClock,r,i,n),xe(Number,s,"minimumCone",o.minimumCone,r,i,n),xe(Number,s,"maximumCone",o.maximumCone,r,i,n),xe(Je,s,"heightReference",o.heightReference,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Fd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"stackPartitions",o.stackPartitions,r,i,n),xe(Number,s,"slicePartitions",o.slicePartitions,r,i,n),xe(Number,s,"subdivisions",o.subdivisions,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(Ft,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function i6e(e,t,n,i){let o=t.label;if(!l(o))return;let r=ur(o.interval),s=e.label;l(s)||(e.label=s=new Mm),xe(Boolean,s,"show",o.show,r,i,n),xe(String,s,"text",o.text,r,i,n),xe(String,s,"font",o.font,r,i,n),xe(Bo,s,"style",o.style,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(Boolean,s,"showBackground",o.showBackground,r,i,n),xe(B,s,"backgroundColor",o.backgroundColor,r,i,n),xe(D,s,"backgroundPadding",o.backgroundPadding,r,i,n),xe(D,s,"pixelOffset",o.pixelOffset,r,i,n),xe(m,s,"eyeOffset",o.eyeOffset,r,i,n),xe(gi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),xe(Pn,s,"verticalOrigin",o.verticalOrigin,r,i,n),xe(Je,s,"heightReference",o.heightReference,r,i,n),xe(B,s,"fillColor",o.fillColor,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),xe(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(Ft,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function o6e(e,t,n,i){let o=t.model;if(!l(o))return;let r=ur(o.interval),s=e.model;l(s)||(e.model=s=new Mp),xe(Boolean,s,"show",o.show,r,i,n),xe(dv.default,s,"uri",o.gltf,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),xe(Number,s,"maximumScale",o.maximumScale,r,i,n),xe(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),xe(Boolean,s,"runAnimations",o.runAnimations,r,i,n),xe(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(Je,s,"heightReference",o.heightReference,r,i,n),xe(B,s,"silhouetteColor",o.silhouetteColor,r,i,n),xe(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),xe(B,s,"color",o.color,r,i,n),xe(uc,s,"colorBlendMode",o.colorBlendMode,r,i,n),xe(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),xe(Ft,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,d=o.nodeTransformations;if(l(d))if(Array.isArray(d))for(a=0,c=d.length;a-1;c--)n[c](s,e,t,i)}oJ=void 0}function f6e(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Oe.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=q.secondsDifference(s,r),c=Math.round(a/120);return t=new bh,t.startTime=q.clone(r),t.stopTime=q.clone(s),t.clockRange=Or.LOOP_STOP,t.multiplier=c,t.currentTime=q.clone(r),t.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new bh,t.startTime=Oe.MINIMUM_VALUE.clone(),t.stopTime=Oe.MAXIMUM_VALUE.clone(),t.currentTime=Oe.MINIMUM_VALUE.clone(),t.clockRange=Or.LOOP_STOP,t.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=ur(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=q.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Or[n.range],Or.LOOP_STOP)),l(n.step)&&(t.clockStep=y(fo[n.step],fo.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function dme(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Ct(s)),e._credit=s,typeof t=="string"||t instanceof Ze){t=Ze.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u1;--b){if(C=W.PI_OVER_TWO-(b-1)*_,G=H1(-C,r,f,g,c,u,d,h,p,G),I=H1(C+Math.PI,r,f,g,c,u,d,h,p,I),t){for(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,E=2*(b-1)+2,R=1;R1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;aW.PI&&(h.north=h.north>0?W.PI_OVER_TWO-W.EPSILON7:h.north,h.south=h.south<0?W.EPSILON7-W.PI_OVER_TWO:h.south,h.east=W.PI,h.west=-W.PI),h}function Xf(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ne.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Xe.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Xe.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Xf.packedLength=m.packedLength+ne.packedLength+Xe.packedLength+9;Xf.pack=function(e,t,n){return n=y(n,0),m.pack(e._center,t,n),n+=m.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Eme=new m,Ime=new ne,Xme=new Xe,If={center:Eme,ellipsoid:Ime,vertexFormat:Xme,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Xf.unpack=function(e,t,n){t=y(t,0);let i=m.unpack(e,t,Eme);t+=m.packedLength;let o=ne.unpack(e,t,Ime);t+=ne.packedLength;let r=Xe.unpack(e,t,Xme);t+=Xe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],h=e[t++],p=e[t++],g=e[t++]===1,f=e[t];return l(n)?(n._center=m.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Xe.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=d,n._height=u,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=f===-1?void 0:f,n):(If.height=u,If.extrudedHeight=p,If.granularity=h,If.stRotation=d,If.rotation=c,If.semiMajorAxis=s,If.semiMinorAxis=a,If.shadowVolume=g,If.offsetAttribute=f===-1?void 0:f,new Xf(If))};Xf.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,ne.default),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,W.RADIANS_PER_DEGREE),a=y(e.rotation,0);return Gme(n,o,r,a,s,i,t)};Xf.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=V6e(o);else if(r=T6e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===cn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new lt({attributes:r.attributes,indices:r.indices,primitiveType:we.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Xf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Xf({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};function L6e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Dl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c0){let f=Math.min(d,c);g=Math.round(c/f);let x=Math.min(g*d,c);for(p=0;p0&&(Z=!0,C+=c-1),s0&&u!==x-1&&h!==0&&h!==_-1&&(F[J]=!0),J++;p=0;let te,z;for(u=1;u=Ne&&u1||G>1))for(let R=0;R0;u-=d)Te=u*3,H=tV(H,ee,Te,p,_),ee+=6,o.st&&(z=nV(z,fe,u*2,G),fe+=4),n&&(_e+=3,J[_e++]=I[Te],J[_e++]=I[Te+1],J[_e++]=I[Te+2]),j&&(te[de++]=1,de+=1);if(E){let Ne=ye;for(Te=Ne*3,u=0;u<2;u++)H=tV(H,ee,Te,p,_),ee+=6,o.st&&(z=nV(z,fe,Ne*2,G),fe+=4),n&&(_e+=3,J[_e++]=I[Te],J[_e++]=I[Te+1],J[_e++]=I[Te+2]),j&&(te[de++]=1,de+=1)}else for(u=d-1;u>=0;u--)Te=u*3,H=tV(H,ee,Te,p,_),ee+=6,o.st&&(z=nV(z,fe,u*2,G),fe+=4),n&&(_e+=3,J[_e++]=I[Te],J[_e++]=I[Te+1],J[_e++]=I[Te+2]),j&&(te[de++]=1,de+=1);let Ie=Gqe(H,o,a);o.st&&(Ie.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:z})),n&&(Ie.attributes.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:J})),P&&(Ie.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Le=Ae.createTypedArray(k,O*6),ke,Be,it,Et;g=H.length/3;let yt=0;for(u=0;u0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(uT.prototype._onEntityPropertyChanged,this)}uT.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Bt)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}rV.prototype.remove=function(e){Ehe(this._solidItems,e)||Ehe(this._translucentItems,e)};function Ihe(e,t,n){let i=!1,o=t.length;for(let r=0;r0)for(r=0;r=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let d=0;d0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=qo.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Bt)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};sV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Nc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};aV.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=qo.getValue(e,this.materialProperty,this.material),n=new Nc({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};lV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new dn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r0)for(h=!0,t=0;t0)for(h=!0,t=0;t-1;a--)c=s[a],d=c.id,u=this._updaterSets.get(d),u.entity===c?u.forEach(function(x){h._removeUpdater(x),h._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaterSets.get(d),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new mT(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(x){h._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Bl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,f=g.length;for(a=0;a-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var Nv=Bl;var jli=T(S(),1);var V$e=1,L$e="30px sans-serif",R$e=Bo.FILL,Z$e=B.WHITE,G$e=B.BLACK,E$e=1,I$e=!1,X$e=new B(.165,.165,.165,.8),W$e=new D(7,5),P$e=D.ZERO,v$e=m.ZERO,w$e=Je.NONE,F$e=gi.CENTER,A$e=Pn.CENTER,M$e=new m,N$e=new B,k$e=new B,U$e=new B,D$e=new D,B$e=new m,O$e=new D,Y$e=new kt,H$e=new kt,z$e=new kt,K$e=new Ft;function whe(e){this.entity=e,this.label=void 0,this.index=void 0}function ey(e,t){t.collectionChanged.addEventListener(ey.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}ey.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new whe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new whe(r)):(VJ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],VJ(s.get(r.id),r,a),s.remove(r.id)};function VJ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var kv=ey;var ydi=T(S(),1);var J$e=1,Q$e=!0,j$e=0,q$e=!0,$$e=!0,eet=_n.ENABLED,tet=Je.NONE,net=B.RED,iet=0,oet=B.WHITE,ret=uc.HIGHLIGHT,set=.5,aet=new D(1,1),cet=new M,det=new M,Fhe=new B,Ahe=new Array(4),uet=new m;function ty(e,t){t.collectionChanged.addEventListener(ty.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Zt,this._onCollectionChanged(t,t.values,[],[])}async function met(e,t,n,i){let o=e._primitives,r=e._modelHash;try{let s=await ih.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(r[t.id]))return;s.id=t,o.add(s),r[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(r[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(r[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(r[t.id]))return;console.log(s),r[t.id].loadFailed=!0}}ty.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o-1;i--)LJ(this,e[i],t,n);return me(this)};var Hk=new m,het=new he;ty.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return dt.FAILED;if(n.loadFailed)return dt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return dt.PENDING;if(!i.ready||!n.modelUpdated)return dt.PENDING;let o=this._scene,r=y(o.ellipsoid,ne.default);if(i.heightReference!==Je.NONE){let a=i.modelMatrix;Hk.x=a[12],Hk.y=a[13],Hk.z=a[14];let c=r.cartesianToCartographic(Hk,het),d=o.getHeight(c,i.heightReference);return l(d)&&(Cu(i.heightReference)?c.height=d:c.height+=d),le.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),dt.DONE}return le.clone(i.boundingSphere,t),dt.DONE};ty.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(fet(r,a),s.set(r.id,r)):(LJ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],LJ(this,r,a,c),s.remove(r.id)};function LJ(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function fet(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var Uv=ty;var Jdi=T(S(),1);var Rdi=T(S(),1);function ny(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(ny.prototype,{isConstant:{get:function(){return K.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Ni.FIXED}}});var pet=new q;ny.prototype.getValue=function(e,t){return l(e)||(e=q.now(pet)),this.getValueInReferenceFrame(e,Ni.FIXED,t)};ny.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};ny.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ne.default.scaleToGeodeticSurface(n,n):void 0};ny.prototype.equals=function(e){return this===e||e instanceof ny&&this._value===e._value};ny.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var vf=ny;var bet=60,get=1,Nhe=new Ln,RJ=new Ln,ZJ=new Ln;function Mhe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function yet(e,t,n,i,o,r,s,a,c){let d=a,u;u=e.getValueInReferenceFrame(t,r,c[d]),l(u)&&(c[d++]=u);let h=!l(o)||q.lessThanOrEquals(o,t)||q.greaterThanOrEquals(o,n),p=0,g=i.length,f=i[p],x=n,_=!1,C,V,L;for(;p0&&!_){let Z=i[p+1],G=q.secondsDifference(Z,f);_=G>s,_&&(C=Math.ceil(G/s),V=0,L=G/Math.max(C,2),C=Math.max(C-1,1))}if(_&&V0){let g=h.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=K.getValueOrDefault(i._resolution,e,bet);c.show=!0,c.positions=Uhe(o,r,s,e,this._referenceFrame,u,c.positions.slice()),c.material=qo.getValue(e,i._material,c.material),c.width=K.getValueOrDefault(i._width,e,get),c.distanceDisplayCondition=K.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};Dv.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};Dv.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),me(this)};function iy(e,t){t.collectionChanged.addEventListener(iy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}iy.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new Mhe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Mhe(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};iy._subSample=Uhe;var Bv=iy;var lui=T(S(),1);var Dhe=B.WHITE,Bhe=B.BLACK,Ohe=0,Yhe=1,Hhe=0,zhe=vr.NONE,Khe=new B,Ret=new m,Jhe=new B,Qhe=new kt,jhe=new kt,qhe=new Ft;function $he(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function oy(e,t){t.collectionChanged.addEventListener(oy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}oy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i0?(d.scale=1,g=g||C!==r.outlineWidth||V!==r.pixelSize||!B.equals(x,r.color)||!B.equals(_,r.outlineColor)):(d.scale=V/50,V=50,g=g||C!==r.outlineWidth||!B.equals(x,r.color)||!B.equals(_,r.outlineColor)),g){r.color=B.clone(x,r.color),r.outlineColor=B.clone(_,r.outlineColor),r.pixelSize=V,r.outlineWidth=C;let L=x.alpha,Z=x.toCssColorString(),G=_.toCssColorString(),I=JSON.stringify([Z,V,G,C]);d.setImage(I,R_(L,Z,G,C,V))}f&&d._updateClamping()}}return!0};oy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return dt.FAILED;if(l(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return dt.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,dt.DONE};oy.prototype.isDestroyed=function(){return!1};oy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(oy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new $he(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new $he(r)):(Ov(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Ov(s.get(r.id),r,a),s.remove(r.id)};function Ov(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var Yv=oy;var Umi=T(S(),1);var smi=T(S(),1);var Eui=T(S(),1);var ofe=[];function Zet(e,t,n,i,o){let r=ofe;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,h=i.red,p=i.green,g=i.blue,f=i.alpha;if(B.equals(n,i)){for(s=0;s0?new Array(o):void 0;for(i=0;i0){let A=0,N=h[0];i=i.filter(function(O,U){let Y=!1;return o?Y=U===N||U===0&&N===1:Y=U+1===N,Y?(A++,N=h[A],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===tn.GEODESIC||r===tn.RHUMB){let A,N;r===tn.GEODESIC?(A=W.chordLength(s,a.maximumRadius),N=Xi.numberOfPoints):(A=s,N=Xi.numberOfPointsRhumbLine);let O=Xi.extractHeights(p,a);if(l(i)){let U=1;for(c=0;c0)return le.fromPoints(t.positions,e),dt.DONE}return dt.FAILED};zv.prototype.isDestroyed=function(){return!1};zv.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=zk[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete zk[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),me(this)};var Kv=Ch;var Cmi=T(S(),1);var Fet=new B,Aet=new Ft,Met=new Ft;function Vh(e,t,n,i,o){let r;n instanceof Bt?r=jr:r=aa,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.material=void 0,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Vh.prototype.onMaterialChanged,this),this.subscriptions=new Zt,this.showsUpdated=new Zt,this.zIndex=i,this._asynchronous=o}Vh.prototype.onMaterialChanged=function(){this.invalidated=!0};Vh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Bt&&t instanceof Bt?!0:l(t)&&t.equals(n)};Vh.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!K.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Vh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Vh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Fm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===aa&&(this.material=qo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===aa&&(this.material=qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};hV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c-1;a--)c=s[a],d=c.id,u=this._updaters.get(d),u.entity===c?(lfe(this,u),dfe(this,e,u)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaters.get(d),lfe(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new Kv(c,this._scene),this._updaters.set(d,u),dfe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(wf._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,g=p.length;for(a=0;a-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var Qv=wf;function Ol(e){Nc.initializeTerrainHeights(),Fm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new dr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Ol.defaultVisualizersCallback);let i=!1,o=new Ul,r=new Ul;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let d=0,u=n.length;dnew o(e,i))]};Object.defineProperties(Ol.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Ol.prototype.isDestroyed=function(){return!1};Ol.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;tKet*d.maximumRadius?(f=ffe,m.normalize(h,f),m.negate(f,f),_=m.clone(m.UNIT_Z,EJ),x=m.cross(_,f,Kk),m.magnitude(x)>W.EPSILON7&&(m.normalize(f,f),m.normalize(x,x),_=m.cross(f,x,EJ),m.normalize(_,_),p=!0)):m.equalsEpsilon(h,v,W.EPSILON7)||(_=ffe,m.normalize(b,_),m.normalize(R,R),x=m.cross(_,R,EJ),g&&(x=m.multiplyByScalar(x,-1,x)),m.equalsEpsilon(x,m.ZERO,W.EPSILON7)||(f=m.cross(x,_,Kk),$.multiplyByVector(F,f,f),$.multiplyByVector(F,x,x),$.multiplyByVector(F,_,_),m.normalize(f,f),m.normalize(x,x),m.normalize(_,_),p=!0))}}l(e.boundingSphere)&&(h=e.boundingSphere.center);let C,V,L;i&&(C=m.clone(t.position,IJ),V=m.clone(t.direction,pfe),L=m.clone(t.up,bfe));let Z=Oet,G;l(s)&&(G=s.getValue(c,Yet));let I=r.getValue(c,Het);if(a===Wp.INERTIAL&&l(G))M.fromTranslationQuaternionRotationScale(h,G,m.ONE,Z);else if(a===Wp.VELOCITY&&l(I)){let v=wt.rotationMatrixFromPositionVelocity(h,I,d,zet);M.fromRotationTranslation(v,h,Z)}else a===Wp.ENU||!p?wt.eastNorthUpToFixedFrame(h,d,Z):(Z[0]=f.x,Z[1]=f.y,Z[2]=f.z,Z[3]=0,Z[4]=x.x,Z[5]=x.y,Z[6]=x.z,Z[7]=0,Z[8]=_.x,Z[9]=_.y,Z[10]=_.z,Z[11]=0,Z[12]=h.x,Z[13]=h.y,Z[14]=h.z,Z[15]=0);t._setTransform(Z),i&&(m.clone(C,t.position),m.clone(V,t.direction),m.clone(L,t.up),m.cross(V,L,t.right))}if(n){let p=u===oe.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function qv(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,ne.default),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._velocityProperty=new Ob(e.position,!0),this._offset3D=new m}Object.defineProperties(qv,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});qv.defaultOffset3D=new m(-14e3,3500,3500);var Jk=new rm,Qet=new m;qv.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,d=r.orientation,u=r!==this._lastEntity,h=o!==this._mode,p=n.camera,g=u||h,f=!0;if(u){let x=r.viewFrom,_=l(x);if(!_&&l(t)){Jk.pitch=-W.PI_OVER_FOUR,Jk.range=0;let C=a.getValue(e,Qet);if(l(C)){let V=2-1/Math.max(1,m.magnitude(C)/i.maximumRadius);Jk.pitch*=V}p.viewBoundingSphere(t,Jk),this.boundingSphere=t,g=!1,f=!1}else(!_||!l(x.getValue(e,this._offset3D)))&&m.clone(qv._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&m.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Jet(this,p,g,f,a,c,d,s,e,i)};var $v=qv;var api=T(S(),1);var Fhi=T(S(),1);function tw(){this._cache={}}tw.prototype.fromColor=function(e,t){return Qk(void 0,void 0,e,t,this._cache)};tw.prototype.fromUrl=function(e,t,n){return Qk(e,void 0,t,n,this._cache)};tw.prototype.fromMakiIconId=function(e,t,n){return Qk(rn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};tw.prototype.fromText=function(e,t,n){return Qk(void 0,e,t,n,this._cache)};var jet=new B;function qet(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,jet).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function gfe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width${i}${Sfe(o)}`:n+=`${i}${o}`)}return n.length>0&&(n=`${n}
`),n}function rtt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function stt(e,t){return new Um(rtt(Sfe,e,t),!0)}function $k(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Bn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let h=u.toLowerCase();if(d>1&&h==="title"){d=1,s=u;break}else d>2&&h==="name"?(d=2,s=u):d>3&&/title/i.test(u)?(d=3,s=u):d>4&&/name/i.test(u)&&(d=4,s=u)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new Jn(c):n(r,s))}return o}function DJ(e,t){let n=new Array(e.length);for(let i=0;i2?d.perPositionHeight=new Jn(!0):o.clampToGround||(d.height=0);let p=$k(t,e._entityCollection,o.describe);p.polygon=d}function vfe(e,t,n,i,o){Pfe(e,t,i,n.coordinates,o)}function wfe(e,t,n,i,o){let r=n.coordinates;for(let s=0;st&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Ho(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function sy(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function ay(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var Ipi=T(S());var gpi=T(S());var fpi=T(S()),cy=/[A-Za-z]/,Js=/[\d]/;var Ud=/\s/,eU=/['"]/,Ufe=/[\x00-\x1F\x7F]/,Dfe=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,dtt=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,utt=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,mtt=Dfe+dtt+utt,Bfe=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,mpi=new RegExp("[".concat(Dfe+Bfe,"]")),BJ=mtt+Bfe,Lh=new RegExp("[".concat(BJ,"]"));var tU=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(Ud):[],o=t.split(Ud),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(Ud):[],o=t.split(Ud),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),""].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();var xpi=T(S());function Ofe(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(V){var L={},Z=V,G=Z.match(/^([a-z]+):\/\//i);return G&&(L.scheme=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^(.*?)(?=(\?|#|\/|$))/i),G&&(L.host=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^\/(.*?)(?=(\?|#|$))/i),G&&(L.path=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^\?(.*?)(?=(#|$))/i),G&&(L.query=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^#(.*?)$/i),G&&(L.fragment=G[1]),L},s=function(V){var L="";return V.scheme&&V.host&&(L+=V.scheme+"://"),V.host&&(L+=V.host),V.path&&(L+="/"+V.path),V.query&&(L+="?"+V.query),V.fragment&&(L+="#"+V.fragment),L},a=function(V,L){var Z=L/2,G=Math.ceil(Z),I=-1*Math.floor(Z),v="";return I<0&&(v=V.substr(I)),V.substr(0,G)+n+v};if(e.length<=t)return e;var c=t-o,d=r(e);if(d.query){var u=d.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);u&&(d.query=d.query.substr(0,u[1].length),e=s(d))}if(e.length<=t||(d.host&&(d.host=d.host.replace(/^www\./,""),e=s(d)),e.length<=t))return e;var h="";if(d.host&&(h+=d.host),h.length>=c)return d.host.length==t?(d.host.substr(0,t-o)+n).substr(0,c+i):a(h,c).substr(0,c+i);var p="";if(d.path&&(p+="/"+d.path),d.query&&(p+="?"+d.query),p)if((h+p).length>=c){if((h+p).length==t)return(h+p).substr(0,t);var g=c-h.length;return(h+a(p,g)).substr(0,c+i)}else h+=p;if(d.fragment){var f="#"+d.fragment;if((h+f).length>=c){if((h+f).length==t)return(h+f).substr(0,t);var x=c-h.length;return(h+a(f,x)).substr(0,c+i)}else h+=f}if(d.scheme&&d.host){var _=d.scheme+"://";if((h+_).length0&&(C=h.substr(-1*Math.floor(c/2))),(h.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}var Tpi=T(S());function Yfe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var Vpi=T(S());function Hfe(e,t,n){return kfe(e,t,n)}var zfe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new tU({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length=0;g--){var f=u[g];switch(f.state){case 11:I(f,p);break;case 12:v(f,p);break;case 0:C(f,p);break;case 1:V(f,p);break;case 2:L(f,p);break;case 3:Z(f,p);break;case 4:G(f,p);break;case 5:P(f,p);break;case 6:w(f,p);break;case 7:F(f,p);break;case 13:b(f,p);break;case 14:R(f,p);break;case 8:E(f,p);break;case 9:X(f,p);break;case 10:A(f,p);break;case 15:N(f,p);break;case 16:O(f,p);break;case 17:U(f,p);break;case 18:Y(f,p);break;case 19:k(f,p);break;case 20:H(f,p);break;case 21:J(f,p);break;case 22:te(f,p);break;case 23:z(f,p);break;case 24:j(f,p);break;case 25:ee(f,p);break;case 26:fe(f,p);break;case 27:_e(f,p);break;case 28:de(f,p);break;case 29:ye(f,p);break;case 30:Te(f,p);break;case 31:Ie(f,p);break;case 32:ke(f,p);break;case 33:Be(f,p);break;case 34:it(f,p);break;case 35:Et(f,p);break;case 36:yt(f,p);break;case 37:Le(f,p);break;case 38:Ne(f,p);break;case 39:Jt(f,p);break;case 40:Rt(f,p);break;case 41:mt(f,p);break;default:ay(f.state)}}}for(var x=u.length-1;x>=0;x--)u.forEach(function(Ve){return on(Ve)});return c;function _(Ve){if(Ve==="#")u.push(Utt(h,28));else if(Ve==="@")u.push(Dtt(h,30));else if(Ve==="/")u.push($J(h,11));else if(Ve==="+")u.push(eQ(h,37));else if(Ve==="(")u.push(eQ(h,32));else{if(Js.test(Ve)&&(u.push(eQ(h,38)),u.push(Ntt(h,13))),ipe(Ve)){var Ce=Ve.toLowerCase()==="m"?15:22;u.push(ktt(h,Ce))}nU(Ve)&&u.push(qJ(h,0)),Lh.test(Ve)&&u.push($J(h,5))}}function C(Ve,Ce){Ce===":"?Ve.state=2:Ce==="-"?Ve.state=1:HJ(Ce)||Ho(u,Ve)}function V(Ve,Ce){Ce==="-"||(Ce==="/"?(Ho(u,Ve),u.push($J(h,11))):HJ(Ce)?Ve.state=0:Ho(u,Ve))}function L(Ve,Ce){Ce==="/"?Ve.state=3:Ce==="."?Ho(u,Ve):qb(Ce)?(Ve.state=5,nU(Ce)&&u.push(qJ(h,0))):Ho(u,Ve)}function Z(Ve,Ce){Ce==="/"?Ve.state=4:zJ(Ce)?(Ve.state=10,Ve.acceptStateReached=!0):on(Ve)}function G(Ve,Ce){Ce==="/"?Ve.state=10:qb(Ce)?(Ve.state=5,Ve.acceptStateReached=!0):Ho(u,Ve)}function I(Ve,Ce){Ce==="/"?Ve.state=12:Ho(u,Ve)}function v(Ve,Ce){qb(Ce)?Ve.state=5:Ho(u,Ve)}function P(Ve,Ce){Ce==="."?Ve.state=7:Ce==="-"?Ve.state=6:Ce===":"?Ve.state=8:oU(Ce)?Ve.state=10:iU(Ce)||on(Ve)}function w(Ve,Ce){Ce==="-"||(Ce==="."?on(Ve):qb(Ce)?Ve.state=5:on(Ve))}function F(Ve,Ce){Ce==="."?on(Ve):qb(Ce)?(Ve.state=5,Ve.acceptStateReached=!0):on(Ve)}function b(Ve,Ce){Ce==="."?Ve.state=14:Ce===":"?Ve.state=8:Js.test(Ce)||(oU(Ce)?Ve.state=10:Lh.test(Ce)?Ho(u,Ve):on(Ve))}function R(Ve,Ce){Js.test(Ce)?(Ve.octetsEncountered++,Ve.octetsEncountered===4&&(Ve.acceptStateReached=!0),Ve.state=13):on(Ve)}function E(Ve,Ce){Js.test(Ce)?Ve.state=9:on(Ve)}function X(Ve,Ce){Js.test(Ce)||(oU(Ce)?Ve.state=10:on(Ve))}function A(Ve,Ce){zJ(Ce)||on(Ve)}function N(Ve,Ce){Ce.toLowerCase()==="a"?Ve.state=16:te(Ve,Ce)}function O(Ve,Ce){Ce.toLowerCase()==="i"?Ve.state=17:te(Ve,Ce)}function U(Ve,Ce){Ce.toLowerCase()==="l"?Ve.state=18:te(Ve,Ce)}function Y(Ve,Ce){Ce.toLowerCase()==="t"?Ve.state=19:te(Ve,Ce)}function k(Ve,Ce){Ce.toLowerCase()==="o"?Ve.state=20:te(Ve,Ce)}function H(Ve,Ce){Ce.toLowerCase()===":"?Ve.state=21:te(Ve,Ce)}function J(Ve,Ce){rU(Ce)?Ve.state=22:Ho(u,Ve)}function te(Ve,Ce){Ce==="."?Ve.state=23:Ce==="@"?Ve.state=24:rU(Ce)?Ve.state=22:Ho(u,Ve)}function z(Ve,Ce){Ce==="."?Ho(u,Ve):Ce==="@"?Ho(u,Ve):rU(Ce)?Ve.state=22:Ho(u,Ve)}function j(Ve,Ce){qb(Ce)?Ve.state=25:Ho(u,Ve)}function ee(Ve,Ce){Ce==="."?Ve.state=27:Ce==="-"?Ve.state=26:iU(Ce)||on(Ve)}function fe(Ve,Ce){Ce==="-"||Ce==="."?on(Ve):iU(Ce)?Ve.state=25:on(Ve)}function _e(Ve,Ce){Ce==="."||Ce==="-"?on(Ve):qb(Ce)?(Ve.state=25,Ve.acceptStateReached=!0):on(Ve)}function de(Ve,Ce){JJ(Ce)?(Ve.state=29,Ve.acceptStateReached=!0):Ho(u,Ve)}function ye(Ve,Ce){JJ(Ce)||on(Ve)}function Te(Ve,Ce){QJ(Ce)?(Ve.state=31,Ve.acceptStateReached=!0):Ho(u,Ve)}function Ie(Ve,Ce){QJ(Ce)||(Lh.test(Ce)?Ho(u,Ve):on(Ve))}function Le(Ve,Ce){Js.test(Ce)?Ve.state=38:(Ho(u,Ve),_(Ce))}function ke(Ve,Ce){Js.test(Ce)?Ve.state=33:Ho(u,Ve),_(Ce)}function Be(Ve,Ce){Js.test(Ce)?Ve.state=34:Ho(u,Ve)}function it(Ve,Ce){Js.test(Ce)?Ve.state=35:Ho(u,Ve)}function Et(Ve,Ce){Ce===")"?Ve.state=36:Ho(u,Ve)}function yt(Ve,Ce){Js.test(Ce)?Ve.state=38:jJ(Ce)?Ve.state=39:Ho(u,Ve)}function Ne(Ve,Ce){Ve.acceptStateReached=!0,sU(Ce)?Ve.state=40:Ce==="#"?Ve.state=41:Js.test(Ce)||(Ce==="("?Ve.state=32:jJ(Ce)?Ve.state=39:(on(Ve),nU(Ce)&&u.push(qJ(h,0))))}function Jt(Ve,Ce){Js.test(Ce)?Ve.state=38:Ce==="("?Ve.state=32:(on(Ve),_(Ce))}function Rt(Ve,Ce){sU(Ce)||(Ce==="#"?Ve.state=41:Js.test(Ce)?Ve.state=38:on(Ve))}function mt(Ve,Ce){sU(Ce)?Ve.state=40:Js.test(Ce)?Ho(u,Ve):on(Ve)}function on(Ve){if(Ho(u,Ve),!!Ve.acceptStateReached){var Ce=Ve.startIdx,rt=e.slice(Ve.startIdx,h);if(rt=Mtt(rt),Ve.type==="url"){var Oi=e.charAt(Ve.startIdx-1);if(Oi==="@")return;var ht=Ve.matchType;if(ht==="scheme"){var go=YJ.exec(rt);if(go&&(Ce=Ce+go.index,rt=rt.slice(go.index)),!qfe(rt))return}else if(ht==="tld"){if(!$fe(rt))return}else if(ht==="ipV4"){if(!epe(rt))return}else ay(ht);c.push(new tpe({tagBuilder:n,matchedText:rt,offset:Ce,urlMatchType:ht,url:rt,protocolRelativeMatch:rt.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(Ve.type==="email")ope(rt)&&c.push(new rpe({tagBuilder:n,matchedText:rt,offset:Ce,email:rt.replace(npe,"")}));else if(Ve.type==="hashtag")spe(rt)&&c.push(new cpe({tagBuilder:n,matchedText:rt,offset:Ce,serviceName:s,hashtag:rt.slice(1)}));else if(Ve.type==="mention")lpe(rt,a)&&c.push(new upe({tagBuilder:n,matchedText:rt,offset:Ce,serviceName:a,mention:rt.slice(1)}));else if(Ve.type==="phone"){if(rt=rt.replace(/ +$/g,""),mpe(rt)){var zo=rt.replace(/[^0-9,;#]/g,"");c.push(new hpe({tagBuilder:n,matchedText:rt,offset:Ce,number:zo,plusSign:rt.charAt(0)==="+"}))}}else ay(Ve)}}}var Att=/[\(\{\[]/,fpe=/[\)\}\]]/,ppe={")":"(","}":"{","]":"["};function Mtt(e){for(var t={"(":0,"{":0,"[":0},n=0;n=0;)if(r=e.charAt(o),fpe.test(r)){var s=ppe[r];if(t[s]<0)t[s]++,o--;else break}else if(jfe.test(r))o--;else break;return e.slice(0,o+1)}function qJ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function $J(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Ntt(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function ktt(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Utt(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Dtt(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function eQ(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}var Mbi=T(S());function gpe(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Mf,c=0,d=e.length,u=0,h=0,p=a;c"?(p=new Mf(Qs(Qs({},p),{name:te()})),H()):!cy.test(j)&&!Js.test(j)&&j!==":"&&Y()}function C(j){j===">"?Y():cy.test(j)?u=3:Y()}function V(j){Ud.test(j)||(j==="/"?u=12:j===">"?H():j==="<"?k():j==="="||eU.test(j)||Ufe.test(j)?Y():u=5)}function L(j){Ud.test(j)?u=6:j==="/"?u=12:j==="="?u=7:j===">"?H():j==="<"?k():eU.test(j)&&Y()}function Z(j){Ud.test(j)||(j==="/"?u=12:j==="="?u=7:j===">"?H():j==="<"?k():eU.test(j)?Y():u=5)}function G(j){Ud.test(j)||(j==='"'?u=8:j==="'"?u=9:/[>=`]/.test(j)?Y():j==="<"?k():u=10)}function I(j){j==='"'&&(u=11)}function v(j){j==="'"&&(u=11)}function P(j){Ud.test(j)?u=4:j===">"?H():j==="<"&&k()}function w(j){Ud.test(j)?u=4:j==="/"?u=12:j===">"?H():j==="<"?k():(u=4,z())}function F(j){j===">"?(p=new Mf(Qs(Qs({},p),{isClosing:!0})),H()):u=4}function b(j){e.substr(c,2)==="--"?(c+=2,p=new Mf(Qs(Qs({},p),{type:"comment"})),u=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Mf(Qs(Qs({},p),{type:"doctype"})),u=20):Y()}function R(j){j==="-"?u=15:j===">"?Y():u=16}function E(j){j==="-"?u=18:j===">"?Y():u=16}function X(j){j==="-"&&(u=17)}function A(j){j==="-"?u=18:u=16}function N(j){j===">"?H():j==="!"?u=19:j==="-"||(u=16)}function O(j){j==="-"?u=17:j===">"?H():u=16}function U(j){j===">"?H():j==="<"&&k()}function Y(){u=0,p=a}function k(){u=1,p=new Mf({idx:c})}function H(){var j=e.slice(h,p.idx);j&&o(j,h),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),Y(),h=c+1}function J(){var j=e.slice(h,c);o(j,h),h=c+1}function te(){var j=p.idx+(p.isClosing?2:1);return e.slice(j,c).toLowerCase()}function z(){c--}}var Mf=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var Btt=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=Ott(t.urls),this.email=kd(t.email)?t.email:this.email,this.phone=kd(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=kd(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Ytt(t.stripPrefix),this.stripTrailingSlash=kd(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=kd(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&dpe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&ape.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Htt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return gpe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,d=s.split(c),u=a;d.forEach(function(h,p){if(p%2===0){var g=n.parseText(h,u);r.push.apply(r,g)}u+=h.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,d){return c.getOffset()-d.getOffset()});for(var n=0;nr?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function tQ(e,t){let n=rw(e,"id");return n=l(n)?n:Bn(),t.getOrCreateEntity(n)}function nQ(e){let t=Cpe(e,"lon"),n=Cpe(e,"lat"),i=iw(e,"ele",Ro.gpx);return m.fromDegrees(t,n,i)}function Cpe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function rw(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function ly(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r${h.text}: ${h.value}

`)}if(!l(i)||i==="")return;i=ztt.link(i),ow.innerHTML=i;let s=ow.querySelectorAll("a");for(n=0;n',d+=`${ow.innerHTML}`,ow.innerHTML="",d}function Ipe(e,t,n,i){let o=nQ(t),r=tQ(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",B.RED,cU);r.billboard=Gpe(s);let a=Yl(t,"name",Ro.gpx);r.name=a,r.label=Qtt(),r.label.text=a,r.description=oQ(t,r),i.clampToGround&&(r.billboard.heightReference=Je.CLAMP_TO_GROUND,r.label.heightReference=Je.CLAMP_TO_GROUND)}function jtt(e,t,n,i){let o=tQ(t,n);o.description=oQ(t,o);let r=iQ(t,"rtept",Ro.gpx),s=new Array(r.length);for(let a=0;a0?(a=a.concat(c.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let h=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",B.RED,cU);o.billboard=Gpe(h),o.position=u,i.clampToGround&&(o.billboard.heightReference=Je.CLAMP_TO_GROUND),o.availability=new Dr,o.availability.addInterval(new Ln({start:a[0],stop:a[a.length-1]}))}o.polyline=Epe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function $tt(e){let t={positions:[],times:[]},n=iQ(e,"trkpt",Ro.gpx),i;for(let o=0;onew Array(t).fill(n,0,t)))}function bU(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?bU(n):n),[])}var Wpe=[0,1,2,3].concat(...pU([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function mr(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,d=e.stat_desc.max_length,u,h,p,g,f,x,_=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<573;u++)h=o.heap[u],g=r[r[h*2+1]*2+1]+1,g>d&&(g=d,_++),r[h*2+1]=g,!(h>e.max_code)&&(o.bl_count[g]++,f=0,h>=c&&(f=a[h-c]),x=r[h*2],o.opt_len+=x*(g+f),s&&(o.static_len+=x*(s[h*2+1]+f)));if(_!==0){do{for(g=d-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[d]--,_-=2}while(_>0);for(g=d;g!==0;g--)for(h=o.bl_count[g];h!==0;)p=o.heap[--u],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),h--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,d,u,h;for(d=1;d<=15;d++)a[d]=c=c+s[d-1]<<1;for(u=0;u<=r;u++)h=o[u*2+1],h!==0&&(o[u*2]=n(a[h]++,h))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,d,u=-1,h;for(o.heap_len=0,o.heap_max=573,c=0;c=1;c--)o.pqdownheap(r,c);h=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),d=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=d,r[h*2]=r[c*2]+r[d*2],o.depth[h]=Math.max(o.depth[c],o.depth[d])+1,r[c*2+1]=r[d*2+1]=h,o.heap[1]=h++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}mr._length_code=[0,1,2,3,4,5,6,7].concat(...pU([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));mr.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];mr.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];mr.d_code=function(e){return e<256?Wpe[e]:Wpe[256+(e>>>7)]};mr.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];mr.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];mr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];mr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Fa(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var lnt=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],dnt=pU([[144,8],[112,9],[24,7],[8,8]]);Fa.static_ltree=bU(lnt.map((e,t)=>[e,dnt[t]]));var unt=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],mnt=pU([[30,5]]);Fa.static_dtree=bU(unt.map((e,t)=>[e,mnt[t]]));Fa.static_l_desc=new Fa(Fa.static_ltree,mr.extra_lbits,257,286,15);Fa.static_d_desc=new Fa(Fa.static_dtree,mr.extra_dbits,0,30,15);Fa.static_bl_desc=new Fa(null,mr.extra_blbits,0,19,7);var hnt=9,fnt=8;function Nf(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var vpe=0,hU=1,bT=2,Rh=[new Nf(0,0,0,0,vpe),new Nf(4,4,8,4,hU),new Nf(4,5,16,8,hU),new Nf(4,6,32,32,hU),new Nf(4,4,16,16,bT),new Nf(8,16,32,32,bT),new Nf(8,16,128,128,bT),new Nf(8,32,128,256,bT),new Nf(32,128,258,1024,bT),new Nf(32,258,258,4096,bT)],lU=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],sm=0,dU=1,cw=2,uU=3,pnt=32,rQ=42,mU=113,lw=666,sQ=8,bnt=0,aQ=1,gnt=2,Rr=3,fU=258,Dd=fU+Rr+1;function Ppe(e,t,n,i){let o=e[t*2],r=e[n*2];return o=3&&O[mr.bl_order[Fe]*2+1]===0;Fe--);return e.opt_len+=3*(Fe+1)+5+5+4,Fe}function Ie(Fe){e.pending_buf[e.pending++]=Fe}function Le(Fe){Ie(Fe&255),Ie(Fe>>>8&255)}function ke(Fe){Ie(Fe>>8&255),Ie(Fe&255&255)}function Be(Fe,st){let Ke,Qe=st;ee>16-Qe?(Ke=Fe,j|=Ke<>>16-ee,ee+=Qe-16):(j|=Fe<=8&&(Ie(j&255),j>>>=8,ee-=8)}function Jt(){Be(aQ<<1,3),it(256,Fa.static_ltree),Ne(),1+z+10-ee<9&&(Be(aQ<<1,3),it(256,Fa.static_ltree),Ne()),z=7}function Rt(Fe,st){let Ke,Qe,pt;if(e.dist_buf[J]=Fe,e.lc_buf[J]=st&255,J++,Fe===0?A[st*2]++:(te++,Fe--,A[(mr._length_code[st]+256+1)*2]++,N[mr.d_code(Fe)*2]++),!(J&8191)&&b>2){for(Ke=J*8,Qe=G-C,pt=0;pt<30;pt++)Ke+=N[pt*2]*(5+mr.extra_dbits[pt]);if(Ke>>>=3,te8?Le(j):ee>0&&Ie(j&255),j=0,ee=0}function Ve(Fe,st,Ke){on(),z=8,Ke&&(Le(st),Le(~st)),e.pending_buf.set(c.subarray(Fe,Fe+st),e.pending),e.pending+=st}function Ce(Fe,st,Ke){Be((bnt<<1)+(Ke?1:0),3),Ve(Fe,st,!0)}function rt(Fe,st,Ke){let Qe,pt,Yt=0;b>0?(U.build_tree(e),Y.build_tree(e),Yt=Te(),Qe=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=Qe&&(Qe=pt)):Qe=pt=st+5,st+4<=Qe&&Fe!=-1?Ce(Fe,st,Ke):pt==Qe?(Be((aQ<<1)+(Ke?1:0),3),mt(Fa.static_ltree,Fa.static_dtree)):(Be((gnt<<1)+(Ke?1:0),3),yt(U.max_code+1,Y.max_code+1,Yt+1),mt(A,N)),_e(),Ke&&on()}function Oi(Fe){rt(C>=0?C:-1,G-C,Fe),C=G,t.flush_pending()}function ht(){let Fe,st,Ke,Qe;do{if(Qe=d-v-G,Qe===0&&G===0&&v===0)Qe=r;else if(Qe==-1)Qe--;else if(G>=r+r-Dd){c.set(c.subarray(r,r+r),0),I-=r,G-=r,C-=r,Fe=g,Ke=Fe;do st=h[--Ke]&65535,h[Ke]=st>=r?st-r:0;while(--Fe!==0);Fe=r,Ke=Fe;do st=u[--Ke]&65535,u[Ke]=st>=r?st-r:0;while(--Fe!==0);Qe+=r}if(t.avail_in===0)return;Fe=t.read_buf(c,G+v,Qe),v+=Fe,v>=Rr&&(p=c[G]&255,p=(p<<_^c[G+1]&255)&x)}while(vi-5&&(st=i-5);;){if(v<=1){if(ht(),v===0&&Fe==0)return sm;if(v===0)break}if(G+=v,v=0,Ke=C+st,(G===0||G>=Ke)&&(v=G-Ke,G=Ke,Oi(!1),t.avail_out===0)||G-C>=r-Dd&&(Oi(!1),t.avail_out===0))return sm}return Oi(Fe==4),t.avail_out===0?Fe==4?cw:sm:Fe==4?uU:dU}function zo(Fe){let st=w,Ke=G,Qe,pt,Yt=P,Cn=G>r-Dd?G-(r-Dd):0,Eo=X,So=a,Ha=G+fU,za=c[Ke+Yt-1],Si=c[Ke+Yt];P>=E&&(st>>=2),Eo>v&&(Eo=v);do if(Qe=Fe,!(c[Qe+Yt]!=Si||c[Qe+Yt-1]!=za||c[Qe]!=c[Ke]||c[++Qe]!=c[Ke+1])){Ke+=2,Qe++;do;while(c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&c[++Ke]==c[++Qe]&&KeYt){if(I=Fe,Yt=pt,pt>=Eo)break;za=c[Ke+Yt-1],Si=c[Ke+Yt]}}while((Fe=u[Fe&So]&65535)>Cn&&--st!==0);return Yt<=v?Yt:v}function Ya(Fe){let st=0,Ke;for(;;){if(v=Rr&&(p=(p<<_^c[G+(Rr-1)]&255)&x,st=h[p]&65535,u[G&a]=h[p],h[p]=G),st!==0&&(G-st&65535)<=r-Dd&&R!=2&&(V=zo(st)),V>=Rr)if(Ke=Rt(G-I,V-Rr),v-=V,V<=F&&v>=Rr){V--;do G++,p=(p<<_^c[G+(Rr-1)]&255)&x,st=h[p]&65535,u[G&a]=h[p],h[p]=G;while(--V!==0);G++}else G+=V,V=0,p=c[G]&255,p=(p<<_^c[G+1]&255)&x;else Ke=Rt(0,c[G]&255),v--,G++;if(Ke&&(Oi(!1),t.avail_out===0))return sm}return Oi(Fe==4),t.avail_out===0?Fe==4?cw:sm:Fe==4?uU:dU}function Gr(Fe){let st=0,Ke,Qe;for(;;){if(v=Rr&&(p=(p<<_^c[G+(Rr-1)]&255)&x,st=h[p]&65535,u[G&a]=h[p],h[p]=G),P=V,L=I,V=Rr-1,st!==0&&P4096)&&(V=Rr-1)),P>=Rr&&V<=P){Qe=G+v-Rr,Ke=Rt(G-1-L,P-Rr),v-=P-1,P-=2;do++G<=Qe&&(p=(p<<_^c[G+(Rr-1)]&255)&x,st=h[p]&65535,u[G&a]=h[p],h[p]=G);while(--P!==0);if(Z=0,V=Rr-1,G++,Ke&&(Oi(!1),t.avail_out===0))return sm}else if(Z!==0){if(Ke=Rt(0,c[G-1]&255),Ke&&Oi(!1),G++,v--,t.avail_out===0)return sm}else Z=1,G++,v--}return Z!==0&&(Ke=Rt(0,c[G-1]&255),Z=0),Oi(Fe==4),t.avail_out===0?Fe==4?cw:sm:Fe==4?uU:dU}function _s(Fe){return Fe.total_in=Fe.total_out=0,Fe.msg=null,e.pending=0,e.pending_out=0,n=mU,o=0,de(),fe(),0}e.deflateInit=function(Fe,st,Ke,Qe,pt,Yt){return Qe||(Qe=sQ),pt||(pt=fnt),Yt||(Yt=0),Fe.msg=null,st==-1&&(st=6),pt<1||pt>hnt||Qe!=sQ||Ke<9||Ke>15||st<0||st>9||Yt<0||Yt>2?-2:(Fe.dstate=e,s=Ke,r=1<9||Ke<0||Ke>2?-2:(Rh[b].func!=Rh[st].func&&Fe.total_in!==0&&(Qe=Fe.deflate(1)),b!=st&&(b=st,F=Rh[b].max_lazy,E=Rh[b].good_length,X=Rh[b].nice_length,w=Rh[b].max_chain),R=Ke,Qe)},e.deflateSetDictionary=function(Fe,st,Ke){let Qe=Ke,pt,Yt=0;if(!st||n!=rQ)return-2;if(Qer-Dd&&(Qe=r-Dd,Yt=Ke-Qe),c.set(st.subarray(Yt,Yt+Qe),0),G=Qe,C=Qe,p=c[0]&255,p=(p<<_^c[1]&255)&x,pt=0;pt<=Qe-Rr;pt++)p=(p<<_^c[pt+(Rr-1)]&255)&x,u[pt&a]=h[p],h[p]=pt;return 0},e.deflate=function(Fe,st){let Ke,Qe,pt,Yt,Cn;if(st>4||st<0)return-2;if(!Fe.next_out||!Fe.next_in&&Fe.avail_in!==0||n==lw&&st!=4)return Fe.msg=lU[4],-2;if(Fe.avail_out===0)return Fe.msg=lU[7],-5;if(t=Fe,Yt=o,o=st,n==rQ&&(Qe=sQ+(s-8<<4)<<8,pt=(b-1&255)>>1,pt>3&&(pt=3),Qe|=pt<<6,G!==0&&(Qe|=pnt),Qe+=31-Qe%31,n=mU,ke(Qe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&st<=Yt&&st!=4)return t.msg=lU[7],-5;if(n==lw&&t.avail_in!==0)return Fe.msg=lU[7],-5;if(t.avail_in!==0||v!==0||st!=0&&n!=lw){switch(Cn=-1,Rh[b].func){case vpe:Cn=go(st);break;case hU:Cn=Ya(st);break;case bT:Cn=Gr(st);break;default:}if((Cn==cw||Cn==uU)&&(n=lw),Cn==sm||Cn==cw)return t.avail_out===0&&(o=-1),0;if(Cn==dU){if(st==1)Jt();else if(Ce(0,0,!1),st==3)for(Ke=0;Ken&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function Fpe(e){let t=this,n=new wpe,i=xnt(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let d,u,h=0,p=0,g=0,f=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,d=n.deflate(o),d!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?f.push(new Uint8Array(r)):f.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=h&&(c(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return f.length>1?(u=new Uint8Array(g),f.forEach(function(x){u.set(x,p),p+=x.length})):u=f[0]?new Uint8Array(f[0]):new Uint8Array,u}},t.flush=function(){let a,c,d=0,u=0,h=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&h.push(r.slice(0,n.next_out_index)),u+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(u),h.forEach(function(p){c.set(p,d),d+=p.length}),c}}function xnt(e){return e+5*(Math.floor(e/16383)+1)}var ngi=T(S(),1);var Bd=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],nbe=1440,_nt=0,Tnt=4,Snt=9,Cnt=5,Vnt=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Lnt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Rnt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Znt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],Gnt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Ent=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],dy=15;function uQ(){let e=this,t,n,i,o,r,s;function a(d,u,h,p,g,f,x,_,C,V,L){let Z,G,I,v,P,w,F,b,R,E,X,A,N,O,U;E=0,P=h;do i[d[u+E]]++,E++,P--;while(P!==0);if(i[0]==h)return x[0]=-1,_[0]=0,0;for(b=_[0],w=1;w<=dy&&i[w]===0;w++);for(F=w,bP&&(b=P),_[0]=b,O=1<A+b;){if(v++,A+=b,U=I-A,U=U>b?b:U,(G=1<<(w=F-A))>Z+1&&(G-=Z+1,N=F,wnbe)return-3;r[v]=X=V[0],V[0]+=U,v!==0?(s[v]=P,o[0]=w,o[1]=b,w=P>>>A-b,o[2]=X-r[v-1]-w,C.set(o,(r[v-1]+w)*3)):x[0]=X}for(o[1]=F-A,E>=h?o[0]=192:L[E]>>A;w>>=1)P^=w;for(P^=w,R=(1<257?(V==-3?C.msg="oversubscribed distance tree":V==-5?(C.msg="incomplete distance tree",V=-3):V!=-4&&(C.msg="empty distance tree with lengths",V=-3),V):0)}}uQ.inflate_trees_fixed=function(e,t,n,i){return e[0]=Snt,t[0]=Cnt,n[0]=Vnt,i[0]=Lnt,0};var gU=0,Ape=1,Mpe=2,Npe=3,kpe=4,Upe=5,Dpe=6,cQ=7,Bpe=8,yU=9;function Int(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,d=0,u=0,h,p=0,g,f=0;function x(_,C,V,L,Z,G,I,v){let P,w,F,b,R,E,X,A,N,O,U,Y,k,H,J,te;X=v.next_in_index,A=v.avail_in,R=I.bitb,E=I.bitk,N=I.write,O=N>=w[te+1],E-=w[te+1],I.win[N++]=w[te+2],O--;continue}do{if(R>>=w[te+1],E-=w[te+1],b&16){for(b&=15,k=w[te+2]+(R&Bd[b]),R>>=b,E-=b;E<15;)A--,R|=(v.read_byte(X++)&255)<>=w[te+1],E-=w[te+1],b&16){for(b&=15;E>=b,E-=b,O-=k,N>=H)J=N-H,N-J>0&&2>N-J?(I.win[N++]=I.win[J++],I.win[N++]=I.win[J++],k-=2):(I.win.set(I.win.subarray(J,J+2),N),N+=2,J+=2,k-=2);else{J=N-H;do J+=I.end;while(J<0);if(b=I.end-J,k>b){if(k-=b,N-J>0&&b>N-J)do I.win[N++]=I.win[J++];while(--b!==0);else I.win.set(I.win.subarray(J,J+b),N),N+=b,J+=b,b=0;J=0}}if(N-J>0&&k>N-J)do I.win[N++]=I.win[J++];while(--k!==0);else I.win.set(I.win.subarray(J,J+k),N),N+=k,J+=k,k=0;break}else if(!(b&64))P+=w[te+2],P+=R&Bd[b],te=(F+P)*3,b=w[te];else return v.msg="invalid distance code",k=v.avail_in-A,k=E>>3>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,-3;while(!0);break}if(b&64)return b&32?(k=v.avail_in-A,k=E>>3>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,1):(v.msg="invalid literal/length code",k=v.avail_in-A,k=E>>3>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,-3);if(P+=w[te+2],P+=R&Bd[b],te=(F+P)*3,(b=w[te])===0){R>>=w[te+1],E-=w[te+1],I.win[N++]=w[te+2],O--;break}}while(!0)}while(O>=258&&A>=10);return k=v.avail_in-A,k=E>>3>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,0}e.init=function(_,C,V,L,Z,G){t=gU,d=_,u=C,h=V,p=L,g=Z,f=G,i=null},e.proc=function(_,C,V){let L,Z,G,I=0,v=0,P=0,w,F,b,R;for(P=C.next_in_index,w=C.avail_in,I=_.bitb,v=_.bitk,F=_.write,b=F<_.read?_.read-F-1:_.end-F;;)switch(t){case gU:if(b>=258&&w>=10&&(_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,V=x(d,u,h,p,g,f,_,C),P=C.next_in_index,w=C.avail_in,I=_.bitb,v=_.bitk,F=_.write,b=F<_.read?_.read-F-1:_.end-F,V!=0)){t=V==1?cQ:yU;break}r=d,i=h,o=p,t=Ape;case Ape:for(L=r;v>>=i[Z+1],v-=i[Z+1],G=i[Z],G===0){s=i[Z+2],t=Dpe;break}if(G&16){a=G&15,n=i[Z+2],t=Mpe;break}if(!(G&64)){r=G,o=Z/3+i[Z+2];break}if(G&32){t=cQ;break}return t=yU,C.msg="invalid literal/length code",V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);case Mpe:for(L=a;v>=L,v-=L,r=u,i=g,o=f,t=Npe;case Npe:for(L=r;v>=i[Z+1],v-=i[Z+1],G=i[Z],G&16){a=G&15,c=i[Z+2],t=kpe;break}if(!(G&64)){r=G,o=Z/3+i[Z+2];break}return t=yU,C.msg="invalid distance code",V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);case kpe:for(L=a;v>=L,v-=L,t=Upe;case Upe:for(R=F-c;R<0;)R+=_.end;for(;n!==0;){if(b===0&&(F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0&&(_.write=F,V=_.inflate_flush(C,V),F=_.write,b=F<_.read?_.read-F-1:_.end-F,F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0)))return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);_.win[F++]=_.win[R++],b--,R==_.end&&(R=0),n--}t=gU;break;case Dpe:if(b===0&&(F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0&&(_.write=F,V=_.inflate_flush(C,V),F=_.write,b=F<_.read?_.read-F-1:_.end-F,F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0)))return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);V=0,_.win[F++]=s,b--,t=gU;break;case cQ:if(v>7&&(v-=8,w++,P--),_.write=F,V=_.inflate_flush(C,V),F=_.write,b=F<_.read?_.read-F-1:_.end-F,_.read!=_.write)return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);t=Bpe;case Bpe:return V=1,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);case yU:return V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);default:return V=-2,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V)}},e.free=function(){}}var Ope=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],gV=0,lQ=1,Ype=2,Hpe=3,zpe=4,Kpe=5,xU=6,_U=7,Jpe=8,gT=9;function Xnt(e,t){let n=this,i=gV,o=0,r=0,s=0,a,c=[0],d=[0],u=new Int,h=0,p=new Int32Array(nbe*3),g=0,f=new uQ;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,_){_&&(_[0]=g),i==xU&&u.free(x),i=gV,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,_){let C,V,L;return V=x.next_out_index,L=n.read,C=(L<=n.write?n.write:n.end)-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C,L==n.end&&(L=0,n.write==n.end&&(n.write=0),C=n.write-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C),x.next_out_index=V,n.read=L,_},n.proc=function(x,_){let C,V,L,Z,G,I,v,P;for(Z=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,I=n.write,v=I>>1){case 0:V>>>=3,L-=3,C=L&7,V>>>=C,L-=C,i=lQ;break;case 1:w=[],F=[],b=[[]],R=[[]],uQ.inflate_trees_fixed(w,F,b,R),u.init(w[0],F[0],b[0],0,R[0],0),V>>>=3,L-=3,i=xU;break;case 2:V>>>=3,L-=3,i=Hpe;break;case 3:return V>>>=3,L-=3,i=gT,x.msg="invalid block type",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_)}break;case lQ:for(;L<32;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<>>16&65535)!=(V&65535))return i=gT,x.msg="invalid stored block lengths",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);o=V&65535,V=L=0,i=o!==0?Ype:h!==0?_U:gV;break;case Ype:if(G===0||v===0&&(I==n.end&&n.read!==0&&(I=0,v=IG&&(C=G),C>v&&(C=v),n.win.set(x.read_buf(Z,C),I),Z+=C,G-=C,I+=C,v-=C,(o-=C)!==0)break;i=h!==0?_U:gV;break;case Hpe:for(;L<14;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<29||(C>>5&31)>29)return i=gT,x.msg="too many length or distance symbols",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);if(C=258+(C&31)+(C>>5&31),!a||a.length>>=14,L-=14,s=0,i=zpe;case zpe:for(;s<4+(r>>>10);){for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<>>=3,L-=3}for(;s<19;)a[Ope[s++]]=0;if(c[0]=7,C=f.inflate_trees_bits(a,c,d,p,x),C!=0)return _=C,_==-3&&(a=null,i=gT),n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);s=0,i=Kpe;case Kpe:for(;C=r,!(s>=258+(C&31)+(C>>5&31));){let O,U;for(C=c[0];L>>=C,L-=C,a[s++]=U;else{for(P=U==18?7:U-14,O=U==18?11:3;L>>=C,L-=C,O+=V&Bd[P],V>>>=P,L-=P,P=s,C=r,P+O>258+(C&31)+(C>>5&31)||U==16&&P<1)return a=null,i=gT,x.msg="invalid bit length repeat",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);U=U==16?a[P-1]:0;do a[P++]=U;while(--O!==0);s=P}}if(d[0]=-1,E=[],X=[],A=[],N=[],E[0]=9,X[0]=6,C=r,C=f.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,E,X,A,N,p,x),C!=0)return C==-3&&(a=null,i=gT),_=C,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);u.init(E[0],X[0],p,A[0],p,N[0]),i=xU;case xU:if(n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,(_=u.proc(n,x,_))!=1)return n.inflate_flush(x,_);if(_=0,u.free(x),Z=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,I=n.write,v=I15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new Xnt(n,1<>4)+8>s.wbits){s.mode=uy,n.msg="invalid win size",s.marker=5;break}s.mode=Qpe;case Qpe:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=uy,n.msg="incorrect header check",s.marker=5;break}if(!(r&Wnt)){s.mode=dw;break}s.mode=jpe;case jpe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=qpe;case qpe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=$pe;case $pe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=ebe;case ebe:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=dQ,2);case dQ:return s.mode=uy,n.msg="need dictionary",s.marker=0,-2;case dw:if(o=s.blocks.proc(n,o),o==-3){s.mode=uy,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=tbe;case tbe:return n.avail_in=0,1;case uy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=dQ)return-2;let a=n.istate;return s>=1<0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return d.length>1?(h=new Uint8Array(f),d.forEach(function(x){h.set(x,g),g+=x.length})):h=d[0]?new Uint8Array(d[0]):new Uint8Array,h}},t.flush=function(){n.inflateEnd()}}var ugi=T(S(),1);var ogi=T(S(),1);var yV="/",mQ=new Date(2107,11,31),hQ=new Date(1980,0,1),Pi=void 0,Od="undefined",$b="function";var sgi=T(S(),1);var uw=class{constructor(t){return class extends TransformStream{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var Ant=64,rbe=2;try{typeof navigator!=Od&&navigator.hardwareConcurrency&&(rbe=navigator.hardwareConcurrency)}catch{}var Mnt={chunkSize:512*1024,maxWorkers:rbe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Pi,CompressionStreamNative:typeof CompressionStream!=Od&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Od&&DecompressionStream},hy=Object.assign({},Mnt);function mw(){return hy}function TU(e){return Math.max(e.chunkSize,Ant)}function xV(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:d,DecompressionStream:u,workerScripts:h}=e;if(my("baseURL",t),my("chunkSize",n),my("maxWorkers",i),my("terminateWorkerTimeout",o),my("useCompressionStream",r),my("useWebWorkers",s),a&&(hy.CompressionStream=new uw(a)),c&&(hy.DecompressionStream=new uw(c)),my("CompressionStream",d),my("DecompressionStream",u),h!==Pi){let{deflate:p,inflate:g}=h;if((p||g)&&(hy.workerScripts||(hy.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");hy.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");hy.workerScripts.inflate=g}}}function my(e,t){t!==Pi&&(hy[e]=t)}var hgi=T(S(),1);var ryi=T(S(),1);var Qgi=T(S(),1);var zgi=T(S(),1);var ygi=T(S(),1);var pgi=T(S(),1),sbe=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;sbe[e]=t}var e0=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i>>8^sbe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var hw=class extends TransformStream{constructor(){let t,n=new e0;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};var Agi=T(S(),1);var Tgi=T(S(),1);function _V(e){if(typeof TextEncoder==Od){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n0&&t&&(e[n-1]=rl.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=rl.getPartial(o);return i.push(rl.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},fw={bytes:{fromBits(e){let n=rl.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=rl.concat(t,[rl.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let d=0;d<16;d++)i[d]=e[d];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=t._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));let u=t._S(5,o)+t._f(d,r,s,a)+c+i[d]+t._key[Math.floor(d/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var fQ={};fQ.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let d=s[r-1];(r%o===0||o===8&&r%o===4)&&(d=n[d>>>24]<<24^n[d>>16&255]<<16^n[d>>8&255]<<8^n[d&255],r%o===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^d}for(let d=0;r;d++,r--){let u=s[d&3?r:r-4];r<=4||d<4?a[d]=u:a[d]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,d;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[u]=h,i[h]=u,d=o[c=o[a=o[u]]];let p=d*16843009^c*65537^a*257^u*16843008,g=o[h]*257^h*16843008;for(let f=0;f<4;f++)e[f][u]=g=g<<24^g>>>8,t[f][h]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],d=r[3],u=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],f=e[t?1:3]^n[3],x=4,_,C,V;for(let L=0;L>>24]^a[p>>16&255]^c[g>>8&255]^d[f&255]^n[x],C=s[p>>>24]^a[g>>16&255]^c[f>>8&255]^d[h&255]^n[x+1],V=s[g>>>24]^a[f>>16&255]^c[h>>8&255]^d[p&255]^n[x+2],f=s[f>>>24]^a[h>>16&255]^c[p>>8&255]^d[g&255]^n[x+3],x+=4,h=_,p=C,g=V;for(let L=0;L<4;L++)o[t?3&-L:L]=u[h>>>24]<<24^u[p>>16&255]<<16^u[g>>8&255]<<8^u[f&255]^n[x++],_=h,h=p,p=g,g=f,f=_;return o}};var cbe={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=rl.bitLength(t);for(let r=0;r>5)+1<<2,r,s,a,c,d,u=new ArrayBuffer(o),h=new DataView(u),p=0,g=rl;for(t=fw.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(g.concat(t,[d])),a=1;ao&&(e=new n().update(e).finalize());for(let r=0;rthis.resolveReady=s),password:pbe(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:h,ready:p}=c;d?(await Jnt(c,u,d,am(s,0,bw[u]+2)),s=am(s,bw[u]+2),r?a.error(new Error(t0)):h()):await p;let g=new Uint8Array(s.length-by-(s.length-by)%TV);a.enqueue(hbe(c,s,g,0,by,!0))},async flush(s){let{signed:a,ctr:c,hmac:d,pending:u,ready:h}=this;if(d&&c){await h;let p=am(u,0,u.length-by),g=am(u,u.length-by),f=new Uint8Array;if(p.length){let x=yw(kf,p);d.update(x);let _=c.update(x);f=gw(kf,_)}if(a){let x=am(gw(kf,d.digest()),0,by);for(let _=0;_this.resolveReady=r),password:pbe(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:d,resolveReady:u,ready:h}=a,p=new Uint8Array;c?(p=await Qnt(a,d,c),u()):await h;let g=new Uint8Array(p.length+r.length-r.length%TV);g.set(p,0),s.enqueue(hbe(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:d}=this;if(a&&s){await d;let u=new Uint8Array;if(c.length){let h=s.update(yw(kf,c));a.update(h),u=gw(kf,h)}o.signature=gw(kf,a.digest()).slice(0,by),r.enqueue(gQ(u,o.signature))}}}),o=this}};function hbe(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,d=t.length-o;c.length&&(t=gQ(c,t),n=$nt(n,d-d%TV));let u;for(u=0;u<=d-TV;u+=TV){let h=yw(kf,am(t,u,u+TV));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(gw(kf,p),u+i)}return e.pending=am(t,u),n}async function Jnt(e,t,n,i){let o=await fbe(e,t,n,am(i,0,bw[t])),r=am(i,bw[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(py)}async function Qnt(e,t,n){let i=SU(new Uint8Array(bw[t])),o=await fbe(e,t,n,i);return gQ(i,o)}async function fbe(e,t,n,i){e.password=null;let o=await jnt(knt,n,Bnt,!1,Ont),r=await qnt(Object.assign({salt:i},bQ),o,8*(pw[t]*2+2)),s=new Uint8Array(r),a=yw(kf,am(s,0,pw[t])),c=yw(kf,am(s,pw[t],pw[t]*2)),d=am(s,pw[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new znt(new Hnt(a),Array.from(Ynt)),hmac:new Knt(c)}),d}async function jnt(e,t,n,i,o){if(lbe)try{return await xw.importKey(e,t,n,i,o)}catch{return lbe=!1,fy.importKey(t)}else return fy.importKey(t)}async function qnt(e,t,n){if(dbe)try{return await xw.deriveBits(e,t,n)}catch{return dbe=!1,fy.pbkdf2(t,e.salt,bQ.iterations,n)}else return fy.pbkdf2(t,e.salt,bQ.iterations,n)}function pbe(e,t){return t===Pi?_V(e):t}function gQ(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function $nt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function am(e,t,n){return e.subarray(t,n)}function gw(e,t){return e.fromBits(t)}function yw(e,t){return e.toBits(t)}var Ugi=T(S(),1);var SV=12,RU=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),xbe(this,t)},transform(o,r){let s=this;if(s.password){let a=bbe(s,o.subarray(0,SV));if(s.password=null,a[SV-1]!=s.passwordVerification)throw new Error(py);o=o.subarray(SV)}i?r.error(new Error(t0)):r.enqueue(bbe(s,o))}})}},ZU=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),xbe(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=SU(new Uint8Array(SV));c[SV-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(gbe(r,c),0),a=SV}else s=new Uint8Array(i.length),a=0;s.set(gbe(r,i),a),o.enqueue(s)}})}};function bbe(e,t){let n=new Uint8Array(t.length);for(let i=0;i>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function _be(e){let t=e.keys[2]|2;return Tbe(Math.imul(t,t^1)>>>8)}function Tbe(e){return e&255}function ybe(e){return e&4294967295}var Sbe="deflate-raw",GU=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:d,level:u}=t,h=this,p,g,f=Cbe(super.readable);(!s||c)&&d&&(p=new hw,f=Uf(f,p)),r&&(f=Lbe(f,a,{level:u,chunkSize:n},o,i)),s&&(c?f=Uf(f,new ZU(t)):(g=new VU(t),f=Uf(f,g))),Vbe(h,f,()=>{let x;s&&!c&&(x=g.signature),(!s||c)&&d&&(x=new DataView(p.value.buffer).getUint32(0)),h.signature=x})}},EU=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:d,useCompressionStream:u}=t,h,p,g=Cbe(super.readable);s&&(r?g=Uf(g,new RU(t)):(p=new CU(t),g=Uf(g,p))),d&&(g=Lbe(g,u,{chunkSize:n},o,i)),(!s||r)&&a&&(h=new hw,g=Uf(g,h)),Vbe(this,g,()=>{if((!s||r)&&a){let f=new DataView(h.value.buffer);if(c!=f.getUint32(0,!1))throw new Error(yT)}})}};function Cbe(e){return Uf(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function Vbe(e,t,n){t=Uf(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function Lbe(e,t,n,i,o){try{let r=t&&i?i:o;e=Uf(e,new r(Sbe,n))}catch{if(t)try{e=Uf(e,new o(Sbe,n))}catch{return e}else return e}return e}function Uf(e,t){return e.pipeThrough(t)}var Rbe="message",Zbe="start",Gbe="pull",xQ="data",Ebe="ack",_Q="close",WU="deflate",PU="inflate";var IU=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(WU)?r=GU:o.startsWith(PU)&&(r=EU);let s=0,a=0,c=new r(t,n),d=super.readable,u=new TransformStream({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),h=new TransformStream({transform(p,g){p&&p.length&&(s+=p.length,g.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return d.pipeThrough(u).pipeThrough(c).pipeThrough(h)}})}},XU=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var eyi=T(S(),1);var Wbe=typeof Worker!=Od;var CV=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:d},u){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new XU(r.chunkSize)).pipeThrough(new SQ(n,s),{signal:h}),writable:i,options:Object.assign({},o),scripts:d,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:f}=t;g?(f?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,u(t)}}),(a&&Wbe?eit:Pbe)(t,r)}},SQ=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await TQ(n,o)},async transform(a,c){s+=a.length,i&&await TQ(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await TQ(r,s)}})}};async function TQ(e,...t){try{await e(...t)}catch{}}function Pbe(e,t){return{run:()=>tit(e,t)}}function eit(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=oit(e.scripts[0],n,e)}catch{return Wbe=!1,Pbe(e,t)}Object.assign(e,{worker:o,interface:{run:()=>nit(e,{chunkSize:i})}})}return e.interface}async function tit({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new IU(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}finally{i()}}async function nit(e,t){let n,i,o=new Promise((p,g)=>{n=p,i=g});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:d}=iit(e.writable),u=vU({type:Zbe,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);u||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let h=await o;return u||await c.getWriter().close(),await d,h}function iit(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var Ibe=!0,Xbe=!0;function oit(e,t,n){let i={type:"module"},o,r;typeof e==$b&&(e=e());try{o=new URL(e,t)}catch{o=e}if(Ibe)try{r=new Worker(o)}catch{Ibe=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(Rbe,s=>rit(s,n)),r}function vU(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(r.byteLength!C.busy);if(_)return wbe(_),new CV(_,e,t,x);if(xT.lengthCQ.push({resolve:C,stream:e,workerOptions:t}))}function x(_){if(CQ.length){let[{resolve:C,stream:V,workerOptions:L}]=CQ.splice(0,1);C(new CV(_,V,L,x))}else _.worker?(wbe(_),sit(_,t)):xT=xT.filter(C=>C!=_)}}function sit(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{xT=xT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function wbe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var lyi=T(S(),1);var ait="Writer iterator completed too soon",cit="text/plain";var lit="Content-Type";var dit=64*1024,RQ="writable",VV=class{constructor(){this.size=0}init(){this.initialized=!0}},FU=class extends VV{get readable(){let t=this,{chunkSize:n=dit}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this;o.enqueue(await Aa(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},VQ=class extends VV{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,RQ,{get(){return n}})}writeUint8Array(){}};var AU=class extends VQ{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},n0=class extends FU{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||on&&(s=s.slice(t,o)),new Uint8Array(s)}},_w=class extends VV{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([lit,t]),Object.defineProperty(n,RQ,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},MU=class extends n0{constructor(t){super(new Blob([t],{type:cit}))}},NU=class extends _w{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var LQ=class extends FU{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;c>=r[a].size;)c-=r[a].size,a++;let d=r[a],u=d.size;if(c+n<=u)s=await Aa(d,c,n);else{let h=u-c;s=new Uint8Array(n),s.set(await Aa(d,c,h)),s.set(await o.readUint8Array(t+h,n-h,i),h)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},kU=class extends VV{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(u){let{availableSize:h}=i;if(s)u.length>=h?(await c(u.slice(0,h)),await d(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(u.slice(h))):await c(u);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(ait);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Bf(o),r=p.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await d()}});Object.defineProperty(i,RQ,{get(){return a}});async function c(u){let h=u.length;h&&(await s.ready,await s.write(u),o.size+=h,i.size+=h,i.availableSize-=h)}async function d(){r.size=o.size,await s.close()}}};async function Bf(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function UU(e){return Array.isArray(e)&&(e=new LQ(e)),e instanceof ReadableStream&&(e={readable:e}),e}function DU(e){e.writable===Pi&&typeof e.next==$b&&(e=new kU(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Pi&&(t.size=0),e instanceof kU||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Aa(e,t,n,i){return e.readUint8Array(t,n,i)}var Lyi=T(S(),1);var fyi=T(S(),1);var uyi=T(S(),1),Fbe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),uit=Fbe.length==256;function Abe(e){if(uit){let t="";for(let n=0;nthis[n]=t[n])}};var UQ="File format is not recognized",bit="End of central directory not found",git="End of Zip64 central directory locator not found",yit="Central directory header not found",xit="Local file header not found",_it="Zip64 extra field not found",Tit="File contains encrypted entry",Sit="Encryption method not supported",kbe="Compression method not supported",Ube="Split zip file",Dbe="utf-8",Bbe="cp437",Cit=[[XQ,4294967295],[WQ,4294967295],[PQ,4294967295],[BU,65535]],Vit={[65535]:{getValue:ys,bytes:4},[4294967295]:{getValue:HU,bytes:8}},$U=class{constructor(t,n={}){Object.assign(this,{reader:UU(t),options:n,config:mw()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Bf(i),(i.size===Pi||!i.readUint8Array)&&(i=new n0(await new Response(i.readable).blob()),await Bf(i)),i.size<22)throw new Error(UQ);i.chunkSize=TU(o);let r=await Eit(i,101010256,i.size,22,65535*16);if(!r){let F=await Aa(i,0,4),b=ga(F);throw ys(b)==134695760?new Error(Ube):new Error(bit)}let s=ga(r),a=ys(s,12),c=ys(s,16),d=r.offset,u=ba(s,20),h=d+22+u,p=ba(s,4),g=i.lastDiskNumber||0,f=ba(s,6),x=ba(s,8),_=0,C=0;if(c==4294967295||a==4294967295||x==65535||f==65535){let F=await Aa(i,r.offset-20,20),b=ga(F);if(ys(b,0)==117853008){c=HU(b,8);let R=await Aa(i,c,56,-1),E=ga(R),X=r.offset-20-56;if(ys(E,0)!=101075792&&c!=X){let A=c;c=X,_=c-A,R=await Aa(i,c,56,-1),E=ga(R)}if(ys(E,0)!=101075792)throw new Error(git);p==65535&&(p=ys(E,16)),f==65535&&(f=ys(E,20)),x==65535&&(x=HU(E,32)),a==4294967295&&(a=HU(E,40)),c-=a}}if(c>=i.size&&(_=i.size-c-a-22,c=i.size-a-22),g!=p)throw new Error(Ube);if(c<0)throw new Error(UQ);let V=0,L=await Aa(i,c,a,f),Z=ga(L);if(a){let F=r.offset-a;if(ys(Z,V)!=33639248&&c!=F){let b=c;c=F,_+=c-b,L=await Aa(i,c,a,f),Z=ga(L)}}let G=r.offset-c-(i.lastDiskOffset||0);if(a!=G&&G>=0&&(a=G,L=await Aa(i,c,a,f),Z=ga(L)),c<0||c>=i.size)throw new Error(UQ);let I=sl(n,t,"filenameEncoding"),v=sl(n,t,"commentEncoding");for(let F=0;Fb.getData(Le,Te,ke),V=k;let{onprogress:Ie}=t;if(Ie)try{await Ie(F+1,x,new gy(b))}catch{}yield Te}let P=sl(n,t,"extractPrependedData"),w=sl(n,t,"extractAppendedData");return P&&(n.prependedData=C>0?await Aa(i,0,C):new Uint8Array),n.comment=u?await Aa(i,d+22,u):new Uint8Array,w&&(n.appendedData=h>>8&255:p>>>24&255),signature:p,compressed:d!=0&&!G,encrypted:o.encrypted&&!G,useWebWorkers:sl(o,i,"useWebWorkers"),useCompressionStream:sl(o,i,"useCompressionStream"),transferStreams:sl(o,i,"transferStreams"),checkPasswordOnly:R},config:u,streamOptions:{signal:b,size:w,onstart:X,onprogress:A,onend:N}},U=0;try{({outputSize:U}=await wU({readable:F,writable:E},O))}catch(Y){if(!R||Y.message!=t0)throw Y}finally{let Y=sl(o,i,"preventClose");E.size+=U,!Y&&!E.locked&&await E.getWriter().close()}return R?Pi:t.getData?t.getData():E}};function Ybe(e,t,n){let i=e.rawBitFlag=ba(t,n+2),o=(i&1)==1,r=ys(t,n+6);Object.assign(e,{encrypted:o,version:ba(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:Iit(r),filenameLength:ba(t,n+22),extraFieldLength:ba(t,n+24)})}async function Hbe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=ga(new Uint8Array(r)),c=0;try{for(;ct[o]==r);for(let o=0,r=0;o=5&&(r.push(LV),s.push(OU));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=ys(i,a);t[c]=e[c]=new Date(u*1e3);let h=s[d];e[h]=u}a+=4})}async function Eit(e,t,n,i,o){let r=new Uint8Array(4),s=ga(r);Xit(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(d){let u=n-d,h=await Aa(e,u,d);for(let p=h.length-i;p>=0;p--)if(h[p]==r[0]&&h[p+1]==r[1]&&h[p+2]==r[2]&&h[p+3]==r[3])return{offset:u+p,buffer:h.slice(p,p+i).buffer}}}function sl(e,t,n){return t[n]===Pi?e.options[n]:t[n]}function Iit(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function DQ(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function RV(e,t){return e.getUint8(t)}function ba(e,t){return e.getUint16(t,!0)}function ys(e,t){return e.getUint32(t,!0)}function HU(e,t){return Number(e.getBigUint64(t,!0))}function Xit(e,t,n){e.setUint32(t,n,!0)}function ga(e){return new DataView(e.buffer)}var Pyi=T(S(),1);var wit="File already exists",Fit="Zip file comment exceeds 64KB",Ait="File entry comment exceeds 64KB",Mit="File entry name exceeds 64KB",Jbe="Version exceeds 65535",Nit="The strength must equal 1, 2, or 3",kit="Extra field type exceeds 65535",Uit="Extra field data exceeds 64KB",i4="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Dit="Undefined uncompressed size",Qbe=new Uint8Array([7,0,2,0,65,69,3,0,0]),t4=0,jbe=[],nD=class{constructor(t,n={}){t=DU(t);let i=t.availableSize!==Pi&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Pi&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:mw(),files:new Map,filenames:new Set,offset:n.offset===Pi?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;t4jbe.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(wit);return o.filenames.add(t),a=Bit(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=jbe.shift();c?c():t4--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await qit(this,t,n),po(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function Bit(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(yV)?t+=yV:i.directory=t.endsWith(yV);let o=po(e,i,"encodeText",_V),r=o(t);if(r===Pi&&(r=_V(t)),Qi(r)>65535)throw new Error(Mit);let s=i.comment||"",a=o(s);if(a===Pi&&(a=_V(s)),Qi(a)>65535)throw new Error(Ait);let c=po(e,i,MQ,20);if(c>65535)throw new Error(Jbe);let d=po(e,i,NQ,20);if(d>65535)throw new Error(Jbe);let u=po(e,i,LV,new Date),h=po(e,i,Sw),p=po(e,i,Cw),g=po(e,i,FQ,!0),f=po(e,i,vQ,0),x=po(e,i,wQ,0),_=po(e,i,"passThrough"),C,V;_||(C=po(e,i,"password"),V=po(e,i,"rawPassword"));let L=po(e,i,"encryptionStrength",3),Z=po(e,i,kQ),G=po(e,i,"extendedTimestamp",!0),I=po(e,i,"keepOrder",!0),v=po(e,i,"level"),P=po(e,i,"useWebWorkers"),w=po(e,i,"bufferedWrite"),F=po(e,i,"dataDescriptorSignature",!1),b=po(e,i,"signal"),R=po(e,i,"useUnicodeFileNames",!0),E=po(e,i,"useCompressionStream"),X=po(e,i,"compressionMethod"),A=po(e,i,"dataDescriptor",!0),N=po(e,i,YU);if(!Z&&(C!==Pi||V!==Pi)&&!(L>=1&&L<=3))throw new Error(Nit);let O=new Uint8Array,{extraField:U}=i;if(U){let Et=0,yt=0;U.forEach(Ne=>Et+=4+Qi(Ne)),O=new Uint8Array(Et),U.forEach((Ne,Jt)=>{if(Jt>65535)throw new Error(kit);if(Qi(Ne)>65535)throw new Error(Uit);Es(O,new Uint16Array([Jt]),yt),Es(O,new Uint16Array([Qi(Ne)]),yt+2),Es(O,Ne,yt+4),yt+=4+Qi(Ne)})}let Y=0,k=0,H=0;if(_&&({uncompressedSize:H}=i,H===Pi))throw new Error(Dit);let J=N===!0;n&&(n=UU(n),await Bf(n),_?Y=qbe(H):n.size===Pi?(A=!0,(N||N===Pi)&&(N=!0,H=Y=4294967296)):(H=n.size,Y=qbe(H)));let{diskOffset:te,diskNumber:z,maxSize:j}=e.writer,ee=J||H>4294967295,fe=J||Y>4294967295,_e=J||e.offset+e.pendingEntriesSize-te>4294967295,ye=po(e,i,"supportZip64SplitFile",!0)&&J||z+Math.ceil(e.pendingEntriesSize/j)>65535;if(_e||ee||fe||ye){if(N===!1||!I)throw new Error(i4);N=!0}N=N||!1;let Te=po(e,i,AQ),{signature:Ie}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:c,versionMadeBy:d,lastModDate:u,lastAccessDate:h,creationDate:p,rawExtraField:O,zip64:N,zip64UncompressedSize:ee,zip64CompressedSize:fe,zip64Offset:_e,zip64DiskNumberStart:ye,password:C,rawPassword:V,level:!E&&e.config.CompressionStream===Pi&&e.config.CompressionStreamNative===Pi?0:v,useWebWorkers:P,encryptionStrength:L,extendedTimestamp:G,zipCrypto:Z,bufferedWrite:w,keepOrder:I,useUnicodeFileNames:R,dataDescriptor:A,dataDescriptorSignature:F,signal:b,msDosCompatible:g,internalFileAttribute:f,externalFileAttribute:x,useCompressionStream:E,passThrough:_,encrypted:!!(C&&Qi(C)||V&&Qi(V))||_&&Te,signature:Ie,compressionMethod:X});let Le=Hit(i),ke=Kit(i),Be=Qi(Le.localHeaderArray,ke.dataDescriptorArray);k=Be+Y,e.options.usdz&&(k+=k+64),e.pendingEntriesSize+=k;let it;try{it=await Oit(e,t,n,{headerInfo:Le,dataDescriptorInfo:ke,metadataSize:Be},i)}finally{e.pendingEntriesSize-=k}return Object.assign(it,{name:t,comment:s,extraField:U}),new gy(it)}async function Oit(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:d}=o,{headerInfo:u}=i,{usdz:h}=e.options,p=Array.from(r.values()).pop(),g={},f,x,_,C,V,L,Z;r.set(t,g);try{let P;a&&(P=p&&p.lock,G()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!h?(L=new TransformStream,Z=new Response(L.readable).blob(),L.writable.size=0,f=!0,e.bufferedWrites++,await Bf(s)):(L=s,await I()),await Bf(L);let{writable:w}=s,{diskOffset:F}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let R=new Uint8Array(4),E=Ma(R);Ji(E,0,134695760),await Of(w,R),e.offset+=4}h&&zit(i,e.offset-F),f||(await P,await v(w));let{diskNumber:b}=s;if(V=!0,g.diskNumberStart=b,g=await Yit(n,L,g,i,e.config,o),V=!1,r.set(t,g),g.filename=t,f){await L.writable.getWriter().close();let R=await Z;await P,await I(),C=!0,c||(R=await Qit(g,R,w,o)),await v(w),g.diskNumberStart=s.diskNumber,F=s.diskOffset,await R.stream().pipeTo(w,{preventClose:!0,preventAbort:!0,signal:d}),w.size+=R.size,C=!1}if(g.offset=e.offset-F,g.zip64)jit(g,o);else if(g.offset>4294967295)throw new Error(i4);return e.offset+=g.size,g}catch(P){if(f&&C||!f&&V){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}f?e.offset+=L.writable.size:e.offset=L.writable.size}throw r.delete(t),P}finally{f&&e.bufferedWrites--,_&&_(),x&&x()}function G(){g.lock=new Promise(P=>_=P)}async function I(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(w=>x=()=>{e.writerLocked=!1,w()}),await P}async function v(P){Qi(u.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Of(P,new Uint8Array))}}async function Yit(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{localHeaderArray:u,headerArray:h,lastModDate:p,rawLastModDate:g,encrypted:f,compressed:x,version:_,compressionMethod:C,rawExtraFieldExtendedTimestamp:V,extraFieldExtendedTimestampFlag:L,rawExtraFieldNTFS:Z,rawExtraFieldAES:G}=a,{dataDescriptorArray:I}=c,{rawFilename:v,lastAccessDate:P,creationDate:w,password:F,rawPassword:b,level:R,zip64:E,zip64UncompressedSize:X,zip64CompressedSize:A,zip64Offset:N,zip64DiskNumberStart:O,zipCrypto:U,dataDescriptor:Y,directory:k,versionMadeBy:H,rawComment:J,rawExtraField:te,useWebWorkers:z,onstart:j,onprogress:ee,onend:fe,signal:_e,encryptionStrength:de,extendedTimestamp:ye,msDosCompatible:Te,internalFileAttribute:Ie,externalFileAttribute:Le,useCompressionStream:ke,passThrough:Be}=s,it={lock:i,versionMadeBy:H,zip64:E,directory:!!k,filenameUTF8:!0,rawFilename:v,commentUTF8:!0,rawComment:J,rawExtraFieldExtendedTimestamp:V,rawExtraFieldNTFS:Z,rawExtraFieldAES:G,rawExtraField:te,extendedTimestamp:ye,msDosCompatible:Te,internalFileAttribute:Ie,externalFileAttribute:Le,diskNumberStart:n},{signature:Et,uncompressedSize:yt}=s,Ne=0;Be||(yt=0);let{writable:Jt}=t;if(e){e.chunkSize=TU(r),await Of(Jt,u);let mt=e.readable,on=mt.size=e.size,Ve={options:{codecType:WU,level:R,rawPassword:b,password:F,encryptionStrength:de,zipCrypto:f&&U,passwordVerification:f&&U&&g>>8&255,signed:!Be,compressed:x&&!Be,encrypted:f&&!Be,useWebWorkers:z,useCompressionStream:ke,transferStreams:!1},config:r,streamOptions:{signal:_e,size:on,onstart:j,onprogress:ee,onend:fe}},Ce=await wU({readable:mt,writable:Jt},Ve);Ne=Ce.outputSize,Be||(yt=Ce.inputSize,Et=Ce.signature),Jt.size+=yt}else await Of(Jt,u);let Rt;if(E){let mt=4;X&&(mt+=8),A&&(mt+=8),N&&(mt+=8),O&&(mt+=4),Rt=new Uint8Array(mt)}else Rt=new Uint8Array;return Jit({signature:Et,rawExtraFieldZip64:Rt,compressedSize:Ne,uncompressedSize:yt,headerInfo:a,dataDescriptorInfo:c},s),Y&&await Of(Jt,I),Object.assign(it,{uncompressedSize:yt,compressedSize:Ne,lastModDate:p,rawLastModDate:g,creationDate:w,lastAccessDate:P,encrypted:f,zipCrypto:U,size:d+Ne,compressionMethod:C,version:_,headerArray:h,signature:Et,rawExtraFieldZip64:Rt,extraFieldExtendedTimestampFlag:L,zip64UncompressedSize:X,zip64CompressedSize:A,zip64Offset:N,zip64DiskNumberStart:O}),it}function Hit(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:d,directory:u,rawExtraField:h,encryptionStrength:p,extendedTimestamp:g,encrypted:f}=e,x=r!==0&&!u,{version:_,compressionMethod:C}=e,V;if(f&&!a){V=new Uint8Array(Qi(Qbe)+2);let N=Ma(V);oo(N,0,39169),Es(V,Qbe,2),iD(N,8,p)}else V=new Uint8Array;let L,Z,G;if(g){Z=new Uint8Array(9+(i?4:0)+(o?4:0));let N=Ma(Z);oo(N,0,21589),oo(N,2,Qi(Z)-4),G=1+(i?2:0)+(o?4:0),iD(N,4,G);let O=5;Ji(N,O,Math.floor(n.getTime()/1e3)),O+=4,i&&(Ji(N,O,Math.floor(i.getTime()/1e3)),O+=4),o&&Ji(N,O,Math.floor(o.getTime()/1e3));try{L=new Uint8Array(36);let U=Ma(L),Y=n4(n);oo(U,0,10),oo(U,2,32),oo(U,8,1),oo(U,10,24),Hl(U,12,Y),Hl(U,20,n4(i)||Y),Hl(U,28,n4(o)||Y)}catch{L=new Uint8Array}}else L=Z=new Uint8Array;let I=0;c&&(I=I|2048),d&&(I=I|8),C===Pi&&(C=x?8:0),C==8&&(r>=1&&r<3&&(I=I|6),r>=3&&r<5&&(I=I|1),r===9&&(I=I|2)),s&&(_=_>45?_:45),f&&(I=I|1,a||(_=_>51?_:51,V[9]=C,C=99));let v=new Uint8Array(26),P=Ma(v);oo(P,0,_),oo(P,2,I),oo(P,4,C);let w=new Uint32Array(1),F=Ma(w),b;nmQ?b=mQ:b=n,oo(F,0,(b.getHours()<<6|b.getMinutes())<<5|b.getSeconds()/2),oo(F,2,(b.getFullYear()-1980<<4|b.getMonth()+1)<<5|b.getDate());let R=w[0];Ji(P,6,R),oo(P,22,Qi(t));let E=Qi(V,Z,L,h);oo(P,24,E);let X=new Uint8Array(30+Qi(t)+E),A=Ma(X);return Ji(A,0,67324752),Es(X,v,4),Es(X,t,30),Es(X,V,30+Qi(t)),Es(X,Z,30+Qi(t,V)),Es(X,L,30+Qi(t,V,Z)),Es(X,h,30+Qi(t,V,Z,L)),{localHeaderArray:X,headerArray:v,headerView:P,lastModDate:n,rawLastModDate:R,encrypted:f,compressed:x,version:_,compressionMethod:C,extraFieldExtendedTimestampFlag:G,rawExtraFieldExtendedTimestamp:Z,rawExtraFieldNTFS:L,rawExtraFieldAES:V,extraFieldLength:E}}function zit(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ma(i),s=64-(t+Qi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Ma(a);oo(c,0,6534),oo(c,2,s-2);let d=i;n.localHeaderArray=i=new Uint8Array(Qi(d)+s),Es(i,d),Es(i,a,Qi(d)),r=Ma(i),oo(r,28,o+s),e.metadataSize+=s}function Kit(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=Ma(o),i&&(s=4,Ji(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function Jit(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:d}=s,{dataDescriptorView:u,dataDescriptorOffset:h}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:f,zipCrypto:x,dataDescriptor:_}=t;if((!d||x)&&n!==Pi&&(Ji(c,10,n),_&&Ji(u,h,n)),p){let C=Ma(i);oo(C,0,1),oo(C,2,Qi(i)-4);let V=4;g&&(Ji(c,18,4294967295),Hl(C,V,BigInt(r)),V+=8),f&&(Ji(c,14,4294967295),Hl(C,V,BigInt(o))),_&&(Hl(u,h+4,BigInt(o)),Hl(u,h+12,BigInt(r)))}else Ji(c,14,o),Ji(c,18,r),_&&(Ji(u,h+4,o),Ji(u,h+8,r))}async function Qit(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&Ji(r,14,e.signature),e.zip64?(Ji(r,18,4294967295),Ji(r,22,4294967295)):(Ji(r,18,e.compressedSize),Ji(r,22,e.uncompressedSize)),await Of(n,new Uint8Array(o)),t.slice(o.byteLength)}function jit(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,d=Ma(n),u=4;r&&(u+=8),s&&(u+=8),a&&(Hl(d,u,BigInt(i)),u+=8),c&&Ji(d,u,o)}async function qit(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,d=0,u=e.offset-r,h=i.size;for(let[,G]of i){let{rawFilename:I,rawExtraFieldZip64:v,rawExtraFieldAES:P,rawComment:w,rawExtraFieldNTFS:F,rawExtraField:b,extendedTimestamp:R,extraFieldExtendedTimestampFlag:E,lastModDate:X}=G,A;if(R){A=new Uint8Array(9);let N=Ma(A);oo(N,0,21589),oo(N,2,5),iD(N,4,E),Ji(N,5,Math.floor(X.getTime()/1e3))}else A=new Uint8Array;G.rawExtraFieldCDExtendedTimestamp=A,d+=46+Qi(I,w,v,P,F,A,b)}let p=new Uint8Array(d),g=Ma(p);await Bf(o);let f=0;for(let[G,I]of Array.from(i.values()).entries()){let{offset:v,rawFilename:P,rawExtraFieldZip64:w,rawExtraFieldAES:F,rawExtraFieldCDExtendedTimestamp:b,rawExtraFieldNTFS:R,rawExtraField:E,rawComment:X,versionMadeBy:A,headerArray:N,directory:O,zip64:U,zip64UncompressedSize:Y,zip64CompressedSize:k,zip64DiskNumberStart:H,zip64Offset:J,msDosCompatible:te,internalFileAttribute:z,externalFileAttribute:j,diskNumberStart:ee,uncompressedSize:fe,compressedSize:_e}=I,de=Qi(w,F,b,R,E);Ji(g,c,33639248),oo(g,c+4,A);let ye=Ma(N);Y||Ji(ye,18,fe),k||Ji(ye,14,_e),Es(p,N,c+6),oo(g,c+30,de),oo(g,c+32,Qi(X)),oo(g,c+34,U&&H?65535:ee),oo(g,c+36,z),j?Ji(g,c+38,j):O&&te&&iD(g,c+38,16),Ji(g,c+42,U&&J?4294967295:v),Es(p,P,c+46),Es(p,w,c+46+Qi(P)),Es(p,F,c+46+Qi(P,w)),Es(p,b,c+46+Qi(P,w,F)),Es(p,R,c+46+Qi(P,w,F,b)),Es(p,E,c+46+Qi(P,w,F,b,R)),Es(p,X,c+46+Qi(P)+de);let Te=46+Qi(P,X)+de;if(c-f>o.availableSize&&(o.availableSize=0,await Of(s,p.slice(f,c)),f=c),c+=Te,n.onprogress)try{await n.onprogress(G+1,i.size,new gy(I))}catch{}}await Of(s,f?p.slice(f):p);let x=o.diskNumber,{availableSize:_}=o;_<22&&x++;let C=po(e,n,YU);if(u>4294967295||d>4294967295||h>65535||x>65535){if(C===!1)throw new Error(i4);C=!0}let V=new Uint8Array(C?98:22),L=Ma(V);c=0,C&&(Ji(L,0,101075792),Hl(L,4,BigInt(44)),oo(L,12,45),oo(L,14,45),Ji(L,16,x),Ji(L,20,a),Hl(L,24,BigInt(h)),Hl(L,32,BigInt(h)),Hl(L,40,BigInt(d)),Hl(L,48,BigInt(u)),Ji(L,56,117853008),Hl(L,64,BigInt(u)+BigInt(d)),Ji(L,72,x+1),po(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),h=65535,u=4294967295,d=4294967295,c+=76),Ji(L,c,101010256),oo(L,c+4,x),oo(L,c+6,a),oo(L,c+8,h),oo(L,c+10,h),Ji(L,c+12,d),Ji(L,c+16,u);let Z=Qi(t);if(Z)if(Z<=65535)oo(L,c+20,Z);else throw new Error(Fit);await Of(s,V),Z&&await Of(s,t)}async function Of(e,t){let n=e.getWriter();try{await n.ready,e.size+=Qi(t),await n.write(t)}finally{n.releaseLock()}}function n4(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function po(e,t,n,i){let o=t[n]===Pi?e.options[n]:t[n];return o===Pi?i:o}function qbe(e){return e+5*(Math.floor(e/16383)+1)}function iD(e,t,n){e.setUint8(t,n)}function oo(e,t,n){e.setUint16(t,n,!0)}function Ji(e,t,n){e.setUint32(t,n,!0)}function Hl(e,t,n){e.setBigUint64(t,n,!0)}function Es(e,t,n){e.set(t,n)}function Ma(e){return new DataView(e.buffer)}function Qi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}xV({Deflate:Fpe,Inflate:obe});var Hyi=T(S(),1);function $it(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Xn=$it;var Kyi=T(S(),1);function eot(e,t){this.position=e,this.headingPitchRange=t}var Rw=eot;var qyi=T(S(),1);function oD(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new be,this.tourEnd=new be,this.entryStart=new be,this.entryEnd=new be,this._activeEntries=[]}oD.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};oD.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;t0e.call(this,e,t,function(i){n.playlistIndex=0,i||e0e(n._activeEntries),n.tourEnd.raiseEvent(i)})};oD.prototype.stop=function(){e0e(this._activeEntries)};function e0e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function t0e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=tot.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function tot(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,t0e.call(this,e,t,n)}}var Zw=oD;var pxi=T(S(),1);var lxi=T(S(),1);var sxi=T(S(),1),vi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-vi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?vi.Bounce.In(e*2)*.5:vi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),Gw=function(){return performance.now()},not=function(){function e(){for(var t=[],n=0;n0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=ZV.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=ZV.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},n0e=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),o4=new not,i0e=function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=vi.Linear.None,this._interpolationFunction=ZV.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=n0e.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=o4,o4.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=Gw()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),d=c?"array":typeof a,u=!c&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var h=i[s];if(h.length===0)continue;for(var p=[a],g=0,f=h.length;g"u"||r)&&(n[s]=a),c||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=Gw()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Gw()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;tc)return 1;var x=Math.trunc(s/a),_=s-x*a,C=Math.min(_/i._duration,1);return C===0&&s===i._duration?1:C},u=d(),h=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,f=this._chainedTweens.length;gthis._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function sot(e){let t=e.slice(0,Math.min(4,e.size)),n=_l(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function aot(e){let t=_l(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function f0e(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("",t),i,o,r;for(;t!==-1&&t0?(zl.maximumRed=r,zl.red=void 0):(zl.maximumRed=void 0,zl.red=0),o>0?(zl.maximumGreen=o,zl.green=void 0):(zl.maximumGreen=void 0,zl.green=0),i>0?(zl.maximumBlue=i,zl.blue=void 0):(zl.maximumBlue=void 0,zl.blue=0),zl.alpha=n,B.fromRandom(zl)):new B(r,o,i,n)}function _T(e,t,n){let i=Wn(e,t,n);if(l(i))return d4(i,Wn(e,"colorMode",n)==="random")}function lot(e){let t=wi(e,"TimeStamp",Pe.kmlgx),n=Wn(t,"when",Pe.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=q.fromIso8601(n),o=new Dr;return o.addInterval(new Ln({start:i,stop:Oe.MAXIMUM_VALUE})),o}function dot(e){let t=wi(e,"TimeSpan",Pe.kmlgx);if(!l(t))return;let n,i=wi(t,"begin",Pe.kmlgx),o=l(i)?q.fromIso8601(i.textContent):void 0,r=wi(t,"end",Pe.kmlgx),s=l(r)?q.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(q.lessThan(s,o)){let a=o;o=s,s=a}n=new Dr,n.addInterval(new Ln({start:o,stop:s}))}else l(o)?(n=new Dr,n.addInterval(new Ln({start:o,stop:Oe.MAXIMUM_VALUE}))):l(s)&&(n=new Dr,n.addInterval(new Ln({start:Oe.MINIMUM_VALUE,stop:s})));return n}function g0e(){let e=new ic;return e.width=yy,e.height=yy,e.scaleByDistance=new kt(o0e,r0e,s0e,a0e),e.pixelOffsetScaleByDistance=new kt(o0e,r0e,s0e,a0e),e}function p4(){let e=new Nm;return e.outline=!0,e.outlineColor=B.WHITE,e}function y0e(){let e=new Mm;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=Bo.FILL_AND_OUTLINE,e}function b4(e,t,n,i,o){let r=Wn(e,"href",Pe.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y(qn(e,"x",Pe.gx),0),d=y(qn(e,"y",Pe.gx),0);c=Math.min(c/32,7),d=7-Math.min(d/32,7);let u=8*d+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=f4(r,n,i);if(o){let a=Wn(e,"refreshMode",Pe.kml),c=Wn(e,"viewRefreshMode",Pe.kml);a==="onInterval"||a==="onExpire"?_t(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&_t(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=y(Wn(e,"viewBoundScale",Pe.kml),1),u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=y(Wn(e,"viewFormat",Pe.kml),u),p=Wn(e,"httpQuery",Pe.kml);l(h)&&s.setQueryParameters(sd(cD(h))),l(p)&&s.setQueryParameters(sd(cD(p)));let g=t._ellipsoid;return y4(s,t.camera,t.canvas,d,t._lastCameraView.bbox,g),s}return s}function uot(e,t,n,i,o){let r=qn(t,"scale",Pe.kml),s=qn(t,"heading",Pe.kml),a=_T(t,"color",Pe.kml),c=wi(t,"Icon",Pe.kml),d=b4(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=qn(c,"x",Pe.gx),h=qn(c,"y",Pe.gx),p=qn(c,"w",Pe.gx),g=qn(c,"h",Pe.gx),f=wi(t,"hotSpot",Pe.kml),x=xy(f,"x"),_=xy(f,"y"),C=Is(f,"xunits"),V=Is(f,"yunits"),L=n.billboard;l(L)||(L=g0e(),n.billboard=L),L.image=d,L.scale=r,L.color=a,(l(u)||l(h)||l(p)||l(g))&&(L.imageSubRegion=new ze(u,h,p,g)),l(s)&&s!==0&&(L.rotation=W.toRadians(-s),L.alignedAxis=m.UNIT_Z),r=y(r,1);let Z,G;l(x)&&(C==="pixels"?Z=-x*r:C==="insetPixels"?Z=(x-yy)*r:C==="fraction"&&(Z=-x*yy*r),Z+=yy*.5*r),l(_)&&(V==="pixels"?G=_*r:V==="insetPixels"?G=(-_+yy)*r:V==="fraction"&&(G=_*yy*r),G-=yy*.5*r),(l(Z)||l(G))&&(L.pixelOffset=new D(Z,G))}function aD(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r:clampToSeaFloor is currently not supported, using :clampToGround."),Je.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(_t("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),Je.RELATIVE_TO_GROUND):(l(e)?_t("kml-altitudeMode-unknown",`KML - Unknown :${e}, using :CLAMP_TO_GROUND.`):_t("kml-gx:altitudeMode-unknown",`KML - Unknown :${t}, using :CLAMP_TO_GROUND.`),Je.CLAMP_TO_GROUND)}function fot(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new vf(e))}function pot(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r0&&_t("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,d.length),f=[],x=[];for(let C=0;C0&&i.availability.addInterval(new Ln({start:x[0],stop:x[x.length-1]})),h&&u&&g4(t,i,o),!0}function m0e(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],h=new fa;h.addSamples(e,t),n.intervals.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:fot(h,s,a)})),i.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function xot(e,t,n,i,o){let r=Gh(n,"interpolate",Pe.gx),s=Zh(n,"Track",Pe.gx),a,c,d,u=!1,h=new Bb,p=new Dr,g=new ma,f=e._ellipsoid;for(let x=0,_=s.length;x<_;x++){let C=s[x],V=Zh(C,"when",Pe.kml),L=Zh(C,"coord",Pe.gx),Z=Wn(C,"altitudeMode",Pe.kml),G=Wn(C,"altitudeMode",Pe.gx),I=Ww(Z,G),v=Gh(C,"extrude",Pe.kml),P=Math.min(L.length,V.length),w=[];a=[];for(let F=0;F0)){for(f='',r=0;r`;f+="
${y(x.displayName,s)}${y(x.value,"")}
"}if(!l(f))return;f=oot.link(f),bo.innerHTML=f;let _=bo.querySelectorAll("a");for(r=0;r<_.length;r++)_[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Yd(bo,"a","href",i),Yd(bo,"link","href",i),Yd(bo,"area","href",i),Yd(bo,"img","src",i),Yd(bo,"iframe","src",i),Yd(bo,"video","src",i),Yd(bo,"audio","src",i),Yd(bo,"source","src",i),Yd(bo,"track","src",i),Yd(bo,"input","src",i),Yd(bo,"embed","src",i),Yd(bo,"script","src",i),Yd(bo,"video","poster",i)),Hd(bo,"a","href",o),Hd(bo,"link","href",o),Hd(bo,"area","href",o),Hd(bo,"img","src",o),Hd(bo,"iframe","src",o),Hd(bo,"video","src",o),Hd(bo,"audio","src",o),Hd(bo,"source","src",o),Hd(bo,"track","src",o),Hd(bo,"input","src",o),Hd(bo,"embed","src",o),Hd(bo,"script","src",o),Hd(bo,"video","poster",o);let C='
',C+=`${bo.innerHTML}
`,bo.innerHTML="",t.description=C}function uD(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=b0e(t,i,n.context),c=a.kml,d=mot(e,t,n.styleCollection,r,s),u=Wn(t,"name",Pe.kml);a.name=u,a.parent=o;let h=dot(t);l(h)||(h=lot(t)),a.availability=h,_4(a);function p(L){return L?L.show&&p(L.parent):!0}let g=Gh(t,"visibility",Pe.kml);a.show=p(o)&&y(g,!0);let f=wi(t,"author",Pe.atom),x=c.author;x.name=Wn(f,"name",Pe.atom),x.uri=Wn(f,"uri",Pe.atom),x.email=Wn(f,"email",Pe.atom);let _=wi(t,"link",Pe.atom),C=c.link;C.href=Is(_,"href"),C.hreflang=Is(_,"hreflang"),C.rel=Is(_,"rel"),C.type=Is(_,"type"),C.title=Is(_,"title"),C.length=Is(_,"length"),c.address=Wn(t,"address",Pe.kml),c.phoneNumber=Wn(t,"phoneNumber",Pe.kml),c.snippet=Wn(t,"Snippet",Pe.kml),Sot(t,a),Cot(t,a,d,s,r);let V=e._ellipsoid;return L0e(t,a,V),V0e(t,a,V),l(wi(t,"Region",Pe.kml))&&_t("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function C0e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Vot(e,t,n,i){let o=uD(e,t,n),r=Ye(n);r.parentEntity=o.entity,C0e(e,t,r,i)}function Lot(e,t,n,i){let o=uD(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let d=0,u=c.length;dW.PI_OVER_TWO?W.PI_OVER_TWO:d}function a(d){return d>W.PI?d-W.TWO_PI:d<-W.PI?d+W.TWO_PI:d}let c=nx(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==oe.MORPHING){let d,u;if(o=y(o,Wot),l(n)&&(c4.x=n.clientWidth*.5,c4.y=n.clientHeight*.5,d=t.pickEllipsoid(c4,r,Pot)),l(d)?u=r.cartesianToCartographic(d,GV):(u=ce.center(o,GV),d=r.cartographicToCartesian(u)),l(i)&&!W.equalsEpsilon(i,1,W.EPSILON9)){let C=o.width*i*.5,V=o.height*i*.5;o=new ce(a(u.longitude-C),s(u.latitude-V),a(u.longitude+C),s(u.latitude+V))}c=c.replace("[bboxWest]",W.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",W.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",W.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",W.toDegrees(o.north).toString());let h=W.toDegrees(u.longitude).toString(),p=W.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",h),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",W.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",W.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",m.distance(t.positionWC,d)),c=c.replace("[lookatTerrainLon]",h),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,GV),c=c.replace("[cameraLon]",W.toDegrees(GV.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(GV.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(GV.height).toString());let g=t.frustum,f=g.aspectRatio,x="",_="";if(l(f)){let C=W.toDegrees(g.fov);f>1?(x=C,_=C/f):(_=C,x=C*f)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",_.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(sd(c))}function vot(e,t,n,i){let r=uD(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=wi(t,"Link",Pe.kml);if(l(c)||(c=wi(t,"Url",Pe.kml)),l(c)){let d=Wn(c,"href",Pe.kml),u,h;if(l(d)){let p=d;if(d=f4(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=Wn(c,"viewRefreshMode",Pe.kml),u==="onRegion"){_t("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=y(Wn(c,"viewBoundScale",Pe.kml),1);let _=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(Wn(c,"viewFormat",Pe.kml),_),V=Wn(c,"httpQuery",Pe.kml);l(C)&&d.setQueryParameters(sd(cD(C))),l(V)&&d.setQueryParameters(sd(cD(V)));let L=e._ellipsoid;y4(d,e.camera,e.canvas,h,e._lastCameraView.bbox,L)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new zs,x=x4(e,f,d,g).then(function(_){let C=e._entityCollection,V=f.values;C.suspendEvents();for(let G=0;G0||L==="onExpire"||u==="onStop"){let G=wi(_,"NetworkLinkControl",Pe.kml),I=l(G),v=q.now(),P={id:Bn(),href:d,cookie:{},lastUpdated:v,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:v},w=0;if(I&&(P.cookie=sd(y(Wn(G,"cookie",Pe.kml),"")),w=y(qn(G,"minRefreshPeriod",Pe.kml),0)),L==="onInterval")I&&(Z=Math.max(w,Z)),P.refreshMode=_y.INTERVAL,P.time=Z;else if(L==="onExpire"){let F;if(I&&(F=Wn(G,"expires",Pe.kml)),l(F))try{let b=q.fromIso8601(F),R=q.secondsDifference(b,v);R>0&&R0;)this._screenOverlays.pop().remove()};function _4(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function Aot(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=wi(r,"NetworkLinkControl",Pe.kml),c=l(a),d=0;if(c){if(l(wi(a,"Update",Pe.kml))){_t("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=sd(y(Wn(a,"cookie",Pe.kml),"")),d=y(qn(a,"minRefreshPeriod",Pe.kml),0)}let u=q.now(),h=t.refreshMode;if(h===_y.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(h===_y.EXPIRE){let v;if(l(a)&&(v=Wn(a,"expires",Pe.kml)),l(v))try{let P=q.fromIso8601(v),w=q.secondsDifference(P,u);w>0&&wu.time&&(p=!0):u.refreshMode===_y.EXPIRE?q.greaterThan(n,u.time)&&(p=!0):u.refreshMode===_y.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&q.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(h),u.updating=!0;let g=new zs,f=u.href.clone();f.setQueryParameters(u.cookie);let x=y(i._ellipsoid,ne.default);y4(f,i.camera,i.canvas,u.viewBoundScale,s.bbox,x),x4(i,g,f,{context:h.id}).then(Aot(i,u,g,c,f)).catch(function(_){let C=`NetworkLink ${u.href} refresh failed: ${_}`;console.log(C),i._error.raiseEvent(i,C)}),d=!0}}c.set(u.id,u)}}),d&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function Mot(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}zd._DeferredLoading=Hf;zd._getTimestamp=_i;var Pw=zd;var w_i=T(S(),1);function vw(){pe.throwInstantiationError()}vw.prototype.update=pe.throwInstantiationError;vw.prototype.getBoundingSphere=pe.throwInstantiationError;vw.prototype.isDestroyed=pe.throwInstantiationError;vw.prototype.destroy=pe.throwInstantiationError;var T4=vw;var uTi=T(S(),1);var S4=32,Not="http://www.opengis.net/kml/2.2",Ih="http://www.google.com/kml/ext/2.2",kot="http://www.w3.org/2000/xmlns/";function mD(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Uot=/^data:image\/([^,;]+)/;mD.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ze){if(e=Ze.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Uot);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function Dot(e,t){return function(n){e._files[t]=n}}mD.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new ae("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(Dot(this,r))}return o};Object.defineProperties(mD.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function hD(e){this._time=e}hD.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};hD.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return ST(n)};hD.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function C4(){this._ids={},this._styles={},this._count=0}C4.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};C4.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function E0e(){this._ids={}}E0e.prototype.get=function(e){if(!l(e))return this.get(Bn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function V4(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=V4._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(kot,"xmlns:gx",Ih);let a=r.createElement("Document");s.appendChild(a),X0e(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?Bot(u,c.files):{kml:u,externalFiles:c.files}})}function Bot(e,t){let n=rn("ThirdParty/Workers/z-worker-pako.js");xV({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new _w,o=new nD(i);return o.add("doc.kml",new MU(e)).then(function(){let r=Object.keys(t);return I0e(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function I0e(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new n0(n[o])).then(function(){return I0e(e,t,n,i+1)})}V4._createState=function(e){let t=e.entities,n=new C4,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===Oe.MINIMUM_VALUE?r.stop===Oe.MAXIMUM_VALUE?r=new Ln:q.addSeconds(r.stop,-10*s,r.start):r.stop===Oe.MAXIMUM_VALUE&&q.addSeconds(r.start,10*s,r.stop);let a=new mD(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Not,"kml"),ellipsoid:y(e.ellipsoid,ne.default),idManager:new E0e,styleCache:n,externalFileHandler:a,time:o,valueGetter:new hD(o),sampleDuration:s,defaultAvailability:new Dr([r])}};function X0e(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,d,u;for(let h=0;h0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let V=p.name,L=p.label;if(l(L)){let G=i.createElement("LabelStyle"),I=r.get(L.text);V=l(I)&&I.length>0?I:V;let v=r.getColor(L.fillColor);l(v)&&(G.appendChild(fn(i,"color",v)),G.appendChild(fn(i,"colorMode","normal")));let P=r.get(L.scale);l(P)&&G.appendChild(fn(i,"scale",P)),u.push(G)}C.appendChild(fn(i,"name",V)),C.appendChild(fn(i,"visibility",p.show)),C.appendChild(fn(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C);let Z=u.length;if(Z>0){let G=i.createElement("Style");for(let I=0;I1){let G=i.createElement("MultiGeometry");for(let I=0;I0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(fn(i,"name",p.name)),C.appendChild(fn(i,"visibility",p.show)),C.appendChild(fn(i,"description",p.description)),t.appendChild(C),X0e(e,C,_)}}}var Kl=new m,al=new he,Eh=new q;function Oot(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){W0e(e,t,a,n,i);return}s.get(c,void 0,Kl);let d=fn(o,"coordinates",TT(Kl,r)),u=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(CT(e,a.heightReference)),u.appendChild(h),u.appendChild(d),n.push(u);let p=a instanceof ic?v0e(e,a):P0e(e,a);i.push(p)}function W0e(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof ma?(c=d.intervals,u=!1):c=y(t.availability,e.defaultAvailability);let h=n instanceof Mp,p,g,f,x=[];for(p=0;p1){let C=r.createElementNS(Ih,"MultiTrack");for(p=0;p0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],d=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)d[g](a,al),c.push(`${W.toDegrees(al.longitude)},${W.toDegrees(al.latitude)},${r}`);let u=fn(i,"coordinates",c.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),h.appendChild(p),[h]}function Z0e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u0&&(r=n);let a=[],c=t.hierarchy,d=o.get(c),u=Array.isArray(d)?d:d.positions,h=i.createElement("outerBoundaryIs");h.appendChild(Z0e(e,u,r,s)),a.push(h);let p=d.holes;if(l(p)){let g=p.length;for(let f=0;f0&&c.appendChild(fn(r,"extrude",!0));let u=a?Hot(e,t,d):zot(e,t,d),h=u.length;for(let _=0;_=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var R4=V4;var VJi=T(S(),1);var fTi=T(S(),1);function Qot(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=` -${o}`),t}var zf=Qot;var GTi=T(S(),1);var STi=T(S(),1);var gTi=T(S(),1);async function jot(e,t,n,i){return l(i)||(i=!1),ert(e,t,n,i)}function qot(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(A0e(i)):r=o.then(A0e(i)).catch(trt(i)),e.shift(),t.push(r),!0}function $ot(e){return new Promise(function(t){setTimeout(t,e)})}function Z4(e,t,n){return e.length?qot(e,t,n)?Z4(e,t,n):$ot(100).then(()=>Z4(e,t,n)):Promise.resolve()}function ert(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r0&&await M0e(e,a,n),t}var VT=M0e;async function E4(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===oe.SCENE2D)return r;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],d=await E4._sampleTerrainMostDetailed(n,c),u=!1,h=d.reduce(function(g,f){return l(f.height)?(u=!0,Math.max(f.height,g)):g},-Number.MAX_VALUE),p=r;return u&&(p.height+=h),p}E4._sampleTerrainMostDetailed=VT;var LT=E4;var xIi=T(S(),1);var YSi=T(S(),1);var FSi=T(S(),1);var ITi=T(S(),1),nrt={NONE:0,LERC:1},cm=Object.freeze(nrt);var aSi=T(S(),1);var OTi=T(S(),1);var WTi=T(S(),1),irt={NONE:0,BITS12:1},js=Object.freeze(irt);var RT=new m,ort=new m,lm=new D,fD=new M,rrt=new M,srt=Math.pow(2,12);function Tc(e,t,n,i,o,r,s,a,c,d){let u=js.NONE,h,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,f=t.maximum,x=m.subtract(f,g,ort),_=i-n;Math.max(m.maximumComponent(x),_)0,g=y(e.isGeographic,!0),f=y(e.ellipsoid,ne.default),x=1/f.maximumRadius,_=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),V,L,Z,G;l(C)?(V=C.west,L=C.south,Z=C.east,G=C.north):g?(V=a(_.west),L=a(_.south),Z=a(_.east),G=a(_.north)):(V=_.west*x,L=s-2*o(r(-_.south*x)),Z=_.east*x,G=s-2*o(r(-_.north*x)));let I=e.relativeToCenter,v=l(I);I=v?I:m.ZERO;let P=y(e.includeWebMercatorT,!1),w=y(e.exaggeration,1),F=y(e.exaggerationRelativeHeight,0),R=w!==1,E=y(e.structure,Kf.DEFAULT_STRUCTURE),X=y(E.heightScale,Kf.DEFAULT_STRUCTURE.heightScale),A=y(E.heightOffset,Kf.DEFAULT_STRUCTURE.heightOffset),N=y(E.elementsPerHeight,Kf.DEFAULT_STRUCTURE.elementsPerHeight),O=y(E.stride,Kf.DEFAULT_STRUCTURE.stride),U=y(E.elementMultiplier,Kf.DEFAULT_STRUCTURE.elementMultiplier),Y=y(E.isBigEndian,Kf.DEFAULT_STRUCTURE.isBigEndian),k=ce.computeWidth(_),H=ce.computeHeight(_),J=k/(d-1),te=H/(u-1);g||(k*=x,H*=x);let z=f.radiiSquared,j=z.x,ee=z.y,fe=z.z,_e=65536,de=-65536,ye=wt.eastNorthUpToFixedFrame(I,f),Te=M.inverseTransformation(ye,crt),Ie,Le;P&&(Ie=Ei.geodeticLatitudeToMercatorAngle(L),Le=1/(Ei.geodeticLatitudeToMercatorAngle(G)-Ie));let ke=lrt;ke.x=Number.POSITIVE_INFINITY,ke.y=Number.POSITIVE_INFINITY,ke.z=Number.POSITIVE_INFINITY;let Be=drt;Be.x=Number.NEGATIVE_INFINITY,Be.y=Number.NEGATIVE_INFINITY,Be.z=Number.NEGATIVE_INFINITY;let it=Number.POSITIVE_INFINITY,Et=d*u,yt=h>0?d*2+u*2:0,Ne=Et+yt,Jt=new Array(Ne),Rt=new Array(Ne),mt=new Array(Ne),on=P?new Array(Ne):[],Ve=R?new Array(Ne):[],Ce=0,rt=u,Oi=0,ht=d;p&&(--Ce,++rt,--Oi,++ht);let go=1e-5;for(let Qe=Ce;Qe=u&&(pt=u-1);let Yt=_.north-te*pt;g?Yt=a(Yt):Yt=s-2*o(r(-Yt*x));let Cn=(Yt-L)/(G-L);Cn=W.clamp(Cn,0,1);let Eo=Qe===Ce,So=Qe===rt-1;h>0&&(Eo?Yt+=go*H:So&&(Yt-=go*H));let Ha=t(Yt),za=n(Yt),Si=fe*za,fi;P&&(fi=(Ei.geodeticLatitudeToMercatorAngle(Yt)-Ie)*Le);for(let ia=Oi;ia=d&&(zr=d-1);let bl=pt*(d*O)+zr*O,yo;if(N===1)yo=c[bl];else{yo=0;let Ao;if(Y)for(Ao=0;Ao=0;--Ao)yo=yo*U+c[bl+Ao]}yo=yo*X+A,de=Math.max(de,yo),_e=Math.min(_e,yo);let Er=_.west+J*zr;g?Er=a(Er):Er=Er*x;let fp=(Er-V)/(Z-V);fp=W.clamp(fp,0,1);let Kr=pt*d+zr;if(h>0){let Ao=ia===Oi,un=ia===ht-1,Re=Eo||So||Ao||un;if((Eo||So)&&(Ao||un))continue;Re&&(yo-=h,Ao?(Kr=Et+(u-pt-1),Er-=go*k):So?Kr=Et+u+(d-zr-1):un?(Kr=Et+u+d+pt,Er+=go*k):Eo&&(Kr=Et+u+d+u+zr))}let du=Ha*t(Er),Ka=Ha*n(Er),Jy=j*du,Sa=ee*Ka,Ic=1/i(Jy*du+Sa*Ka+Si*za),cs=Jy*Ic,uu=Sa*Ic,mu=Si*Ic,hu=new m;hu.x=cs+du*yo,hu.y=uu+Ka*yo,hu.z=mu+za*yo,M.multiplyByPoint(Te,hu,I4),m.minimumByComponent(I4,ke,ke),m.maximumByComponent(I4,Be,Be),it=Math.min(it,yo),Jt[Kr]=hu,mt[Kr]=new D(fp,Cn),Rt[Kr]=yo,P&&(on[Kr]=fi),R&&(Ve[Kr]=f.geodeticSurfaceNormal(hu))}}let zo=le.fromPoints(Jt),Ya;l(C)&&(Ya=Gn.fromRectangle(C,_e,de,f));let Gr;v&&(Gr=new Fb(f).computeHorizonCullingPointPossiblyUnderEllipsoid(I,Jt,_e));let _s=new H0(ke,Be,I),Fe=new Sc(I,_s,it,de,ye,!1,P,R,w,F),st=new Float32Array(Ne*Fe.stride),Ke=0;for(let Qe=0;Qe0?L=is.getRegularGridAndSkirtIndicesAndEdgeIndices(V.gridWidth,V.gridHeight):L=is.getRegularGridIndicesAndEdgeIndices(V.gridWidth,V.gridHeight);let Z=V.gridWidth*V.gridHeight;return C._mesh=new dm(h,new Float32Array(V.vertices),L.indices,L.indexCountWithoutSkirts,Z,V.minimumHeight,V.maximumHeight,le.clone(V.boundingSphere3D),m.clone(V.occludeePointInScaledSpace),V.numberOfAttributes,Gn.clone(V.orientedBoundingBox),Sc.clone(V.encoding),L.westIndicesSouthToNorth,L.southIndicesEastToWest,L.eastIndicesNorthToSouth,L.northIndicesWestToEast),C._buffer=void 0,C._mesh})};i0.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(ce.center(d)),h=this._structure,g=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<0?x=is.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=is.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=f.gridWidth*f.gridHeight;return this._mesh=new dm(u,f.vertices,x.indices,x.indexCountWithoutSkirts,_,f.minimumHeight,f.maximumHeight,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};i0.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,h=r.heightScale,p=l(this._mesh),g=this._encoding===cm.LERC;if(!p&&g)return;let x;if(p){let _=this._mesh.vertices,C=this._mesh.encoding;x=H0e(_,C,u,h,e,i,o,t,n)}else x=frt(this._buffer,a,c,s,d,e,i,o,t,n),x=x*h+u;return x};i0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,d=this._height,u=this._structure,h=u.stride,p=new this._bufferType(c*d*h),g=a.vertices,f=a.encoding,x=e.tileXYToRectangle(t,n,i),_=e.tileXYToRectangle(o,r,s),C=u.heightOffset,V=u.heightScale,L=u.elementsPerHeight,Z=u.elementMultiplier,G=u.isBigEndian,I=Math.pow(Z,L-1);for(let v=0;vu.highestEncodedHeight?u.highestEncodedHeight:b,prt(p,L,Z,I,h,G,v*c+w,b)}}return Promise.resolve(new i0({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};i0.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<=s&&(g=s-1,p=s-2);let f=h|0,x=f+1;x>=a&&(x=a-1,f=a-2);let _=u-p,C=h-f;f=a-1-f,x=a-1-x;let V=yD(e,t,n,i,o,f*s+p),L=yD(e,t,n,i,o,f*s+g),Z=yD(e,t,n,i,o,x*s+p),G=yD(e,t,n,i,o,x*s+g);return z0e(_,C,V,L,Z,G)}function H0e(e,t,n,i,o,r,s,a,c){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(c-o.south)*(s-1)/(o.north-o.south),h=d|0,p=h+1;p>=r&&(p=r-1,h=r-2);let g=u|0,f=g+1;f>=s&&(f=s-1,g=s-2);let x=d-h,_=u-g;g=s-1-g,f=s-1-f;let C=(t.decodeHeight(e,g*r+h)-n)/i,V=(t.decodeHeight(e,g*r+p)-n)/i,L=(t.decodeHeight(e,f*r+h)-n)/i,Z=(t.decodeHeight(e,f*r+p)-n)/i;return z0e(x,_,C,V,L,Z)}function z0e(e,t,n,i,o,r){return t=0;--a)s=s*n+e[r+a];return s}function prt(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Na=i0;function IV(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new zi({ellipsoid:y(e.ellipsoid,ne.default)})),this._levelZeroMaximumGeometricError=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(IV.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});IV.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Na({buffer:new Uint8Array(16*16),width:16,height:16}))};IV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<0&&(Te=v?P.clippingPlanesState:0);let Ie=0;l(F)&&F.length>0&&(Ie=w?F.clippingPolygonsState:0);let Le=n.surfaceShader;if(l(Le)&&Le.numberOfDayTextures===i&&Le.flags===ye&&Le.material===this.material&&Le.clippingShaderState===Te&&Le.clippingPolygonShaderState===Ie)return Le.shaderProgram;let ke=this._shadersByTexturesFlags[i];if(l(ke)||(ke=this._shadersByTexturesFlags[i]=[]),Le=ke[ye],!l(Le)||Le.material!==this.material||Le.clippingShaderState!==Te||Le.clippingPolygonShaderState!==Ie){let Be=this.baseVertexShaderSource.clone(),it=this.baseFragmentShaderSource.clone();Te!==0&&it.sources.unshift(o0(P,t.context)),Ie!==0&&(it.sources.unshift(Vrt(t.context)),Be.sources.unshift(Lrt(t.context))),Be.defines.push(H),it.defines.push(`TEXTURE_UNITS ${i}`,ee,_e),o&&it.defines.push("APPLY_BRIGHTNESS"),r&&it.defines.push("APPLY_CONTRAST"),s&&it.defines.push("APPLY_HUE"),a&&it.defines.push("APPLY_SATURATION"),c&&it.defines.push("APPLY_GAMMA"),d&&it.defines.push("APPLY_ALPHA"),u&&it.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&it.defines.push("HAS_WATER_MASK"),g&&(it.defines.push("SHOW_REFLECTIVE_OCEAN"),Be.defines.push("SHOW_REFLECTIVE_OCEAN")),f&&it.defines.push("SHOW_OCEAN_WAVES"),A&&it.defines.push("APPLY_COLOR_TO_ALPHA"),U&&(Be.defines.push("UNDERGROUND_COLOR"),it.defines.push("UNDERGROUND_COLOR")),Y&&(Be.defines.push("TRANSLUCENT"),it.defines.push("TRANSLUCENT")),x&&(Z?(Be.defines.push("ENABLE_VERTEX_LIGHTING"),it.defines.push("ENABLE_VERTEX_LIGHTING")):(Be.defines.push("ENABLE_DAYNIGHT_SHADING"),it.defines.push("ENABLE_DAYNIGHT_SHADING"))),_&&(Be.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),C&&(Be.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),V&&(Be.defines.push("GROUND_ATMOSPHERE"),it.defines.push("GROUND_ATMOSPHERE"),L&&(Be.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),it.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Be.defines.push("INCLUDE_WEB_MERCATOR_Y"),it.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(Be.defines.push("FOG"),it.defines.push("FOG")),h&&it.defines.push("APPLY_SPLIT"),v&&it.defines.push("ENABLE_CLIPPING_PLANES"),w&&(it.defines.push("ENABLE_CLIPPING_POLYGONS"),Be.defines.push("ENABLE_CLIPPING_POLYGONS"),F.inverse&&it.defines.push("CLIPPING_INVERSE"),it.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`),Be.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`)),E&&it.defines.push("COLOR_CORRECT"),X&&it.defines.push("HIGHLIGHT_FILL_TILE"),N&&Be.defines.push("GEODETIC_SURFACE_NORMALS"),O&&Be.defines.push("EXAGGERATION");let Et=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) + }`}function Irt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}W4.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,d=e.applyAlpha,u=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,f=e.showOceanWaves,x=e.enableLighting,_=e.dynamicAtmosphereLighting,C=e.dynamicAtmosphereLightingFromSun,V=e.showGroundAtmosphere,L=e.perFragmentGroundAtmosphere,Z=e.hasVertexNormals,G=e.useWebMercatorProjection,I=e.enableFog,v=e.enableClippingPlanes,P=e.clippingPlanes,w=e.enableClippingPolygons,F=e.clippingPolygons,b=e.clippedByBoundaries,R=e.hasImageryLayerCutout,E=e.colorCorrect,X=e.highlightFillTile,A=e.colorToAlpha,N=e.hasGeodeticSurfaceNormals,O=e.hasExaggeration,U=e.showUndergroundColor,Y=e.translucent,k=0,H="",te=n.renderedMesh.encoding;te.quantization===js.BITS12&&(k=1,H="QUANTIZATION_BITS12");let j=0,ee="";b&&(j=1,ee="TILE_LIMIT_RECTANGLE");let fe=0,Te="";R&&(fe=1,Te="APPLY_IMAGERY_CUTOUT");let de=t.mode,xe=de|o<<2|r<<3|s<<4|a<<5|c<<6|d<<7|p<<8|g<<9|f<<10|x<<11|_<<12|C<<13|V<<14|L<<15|Z<<16|G<<17|I<<18|k<<19|h<<20|v<<21|w<<22|j<<23|fe<<24|E<<25|X<<26|A<<27|N<<28|O<<29|U<<30|Y<<31|u<<32,Se=0;l(P)&&P.length>0&&(Se=v?P.clippingPlanesState:0);let Ie=0;l(F)&&F.length>0&&(Ie=w?F.clippingPolygonsState:0);let Le=n.surfaceShader;if(l(Le)&&Le.numberOfDayTextures===i&&Le.flags===xe&&Le.material===this.material&&Le.clippingShaderState===Se&&Le.clippingPolygonShaderState===Ie)return Le.shaderProgram;let ke=this._shadersByTexturesFlags[i];if(l(ke)||(ke=this._shadersByTexturesFlags[i]=[]),Le=ke[xe],!l(Le)||Le.material!==this.material||Le.clippingShaderState!==Se||Le.clippingPolygonShaderState!==Ie){let Be=this.baseVertexShaderSource.clone(),it=this.baseFragmentShaderSource.clone();Se!==0&&it.sources.unshift(r0(P,t.context)),Ie!==0&&(it.sources.unshift(Grt(t.context)),Be.sources.unshift(Ert(t.context))),Be.defines.push(H),it.defines.push(`TEXTURE_UNITS ${i}`,ee,Te),o&&it.defines.push("APPLY_BRIGHTNESS"),r&&it.defines.push("APPLY_CONTRAST"),s&&it.defines.push("APPLY_HUE"),a&&it.defines.push("APPLY_SATURATION"),c&&it.defines.push("APPLY_GAMMA"),d&&it.defines.push("APPLY_ALPHA"),u&&it.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&it.defines.push("HAS_WATER_MASK"),g&&(it.defines.push("SHOW_REFLECTIVE_OCEAN"),Be.defines.push("SHOW_REFLECTIVE_OCEAN")),f&&it.defines.push("SHOW_OCEAN_WAVES"),A&&it.defines.push("APPLY_COLOR_TO_ALPHA"),U&&(Be.defines.push("UNDERGROUND_COLOR"),it.defines.push("UNDERGROUND_COLOR")),Y&&(Be.defines.push("TRANSLUCENT"),it.defines.push("TRANSLUCENT")),x&&(Z?(Be.defines.push("ENABLE_VERTEX_LIGHTING"),it.defines.push("ENABLE_VERTEX_LIGHTING")):(Be.defines.push("ENABLE_DAYNIGHT_SHADING"),it.defines.push("ENABLE_DAYNIGHT_SHADING"))),_&&(Be.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),C&&(Be.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),V&&(Be.defines.push("GROUND_ATMOSPHERE"),it.defines.push("GROUND_ATMOSPHERE"),L&&(Be.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),it.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Be.defines.push("INCLUDE_WEB_MERCATOR_Y"),it.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(Be.defines.push("FOG"),it.defines.push("FOG")),h&&it.defines.push("APPLY_SPLIT"),v&&it.defines.push("ENABLE_CLIPPING_PLANES"),w&&(it.defines.push("ENABLE_CLIPPING_POLYGONS"),Be.defines.push("ENABLE_CLIPPING_POLYGONS"),F.inverse&&it.defines.push("CLIPPING_INVERSE"),it.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`),Be.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`)),E&&it.defines.push("COLOR_CORRECT"),X&&it.defines.push("HIGHLIGHT_FILL_TILE"),N&&Be.defines.push("GEODETIC_SURFACE_NORMALS"),O&&Be.defines.push("EXAGGERATION");let Gt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) { vec4 color = initialColor; -`;R&&(Et+=` vec4 cutoutAndColorResult; +`;R&&(Gt+=` vec4 cutoutAndColorResult; bool texelUnclipped; -`);for(let Ne=0;Ne0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${zf(i)}`),c};xD.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Zo=xD;var mCi=T(S(),1),Grt={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ai=Object.freeze(Grt);var fCi=T(S(),1),Ert={START:0,LOADING:1,DONE:2,FAILED:3},qs=Object.freeze(Ert);var bCi=T(S(),1),Irt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},uo=Object.freeze(Irt);function ir(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=uo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new le,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(ir.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===uo.RECEIVING||e===uo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o=0&&(u=V)}return u!==Number.MAX_VALUE?bn.getPoint(e,u,o):void 0};ir.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=uo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t=uo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Brt(t.context,s);else{let d=s._findAncestorTileWithTerrainData(e);l(d)&&l(d.data.waterMaskTexture)&&(s.waterMaskTexture=d.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,d,s.waterMaskTranslationAndScale))}}function Art(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=qs.FAILED;return}let c=a.data.terrainData,d=a.x,u=a.y,h=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,d,u,h,o,r,s);l(p)&&(e.terrainState=uo.RECEIVING,Promise.resolve(p).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=uo.RECEIVED)}).catch(function(){e.terrainState=uo.FAILED}))}function Mrt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=uo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=uo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Qn.CANCELLED){e.terrainData=void 0,e.terrainState=uo.UNLOADED,e.request=void 0;return}e.terrainState=uo.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Zo.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new Ko({throttle:!1,throttleByServer:!0,type:ls.TERRAIN});e.request=c;let d=t.requestTileGeometry(n,i,o,c);l(d)?(e.terrainState=uo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=uo.UNLOADED,e.request=void 0)}a()}var Nrt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function krt(e,t,n,i,o,r){let s=n.tilingScheme,a=Nrt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let d=e.terrainData.createMesh(a);l(d)&&(e.terrainState=uo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=uo.TRANSFORMED}).catch(function(){e.terrainState=uo.FAILED}))}ir._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=xt.createVertexBuffer({context:e,typedArray:n,usage:Me.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=xt.createIndexBuffer({context:e,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:Ae.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ei({context:e,attributes:o,indexBuffer:s})};ir._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Urt(e,t,n,i,o,r,s){e.vertexArray=ir._createVertexArrayForMesh(t,e.mesh),e.terrainState=uo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Drt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Wt.create({context:e,pixelFormat:nt.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new $t({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR,magnificationFilter:mi.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Brt(e,t){let n=t.terrainData.waterMask,i=Drt(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Wt.create({context:e,pixelFormat:nt.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}ir.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};ir.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var um=ir;var _Zi=T(S(),1);var LRi=T(S(),1);var yRi=T(S(),1);var B1i=T(S(),1);var $Ci=T(S(),1);function Sy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ne.default),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Ei(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new D(-i,-i),this._rectangleNortheastInMeters=new D(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(Sy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Sy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=o&&(f=o-1);let x=g/d|0;return x>=r&&(x=r-1),l(n)?(n.x=f,n.y=x,n):new D(f,x)};var os=Sy;var o1i=T(S(),1);var P4,J0e="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSrZYLHFXe7j_lQcsSJKc8-7rwh0IFSNWLGZErkzXRnYjMjURTz-hGiKMEeAJIZBG7uiYEn0Mt1rrwlJGIpirZQC4iO428519DlO3QC9DnRBqLXGTBhirgoU7-Z2209sy87s49kw6NOC8_Eew6nCLf-pZ883DRPRyAYH7LC8cvRLInud0EdndtUFa4y83TamrA.AT1_ahjrWDrq",XV={};XV.defaultAccessToken=J0e;XV.defaultWorldImageryServer=new Ze({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});XV.defaultWorldHillshadeServer=new Ze({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});XV.defaultWorldOceanServer=new Ze({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});XV.getDefaultTokenCredit=function(e){if(e===J0e){if(!l(P4)){let t=' This application is using a default ArcGIS access token. Please assign Cesium.ArcGisMapService.defaultAccessToken with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at https://developers.arcgis.com/.';P4=new Ct(t,!0)}return P4}};var Kd=XV;var d1i=T(S(),1);function v4(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ze.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Lm(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,d=e.pixelsToCheck;for(let u=0,h=d.length;a&&u0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}v4.prototype.isReady=function(){return this._isReady};v4.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Lm(e),o=e.width;for(let r=0,s=t.length;r1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};w4.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=``:i+=``)}return i+="
${o}${t(r)}
${o}${r}
",i}this.description=t(e)};var Wh=w4;var x1i=T(S(),1);function WV(){pe.throwInstantiationError()}Object.defineProperties(WV.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}});WV.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};WV.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};WV.prototype.pickFeatures=function(e,t,n,i,o){pe.throwInstantiationError()};var Ort=/\.ktx2$/i;WV.loadImage=function(e,t){let n=Ze.createIfNeeded(t);return Ort.test(n.url)?Sl(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var ll=WV;var T1i=T(S(),1),Yrt={SATELLITE:1,OCEANS:2,HILLSHADE:3},Ph=Object.freeze(Yrt);function Q0e(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new zi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Ct(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}Q0e.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new Aw({missingImageUrl:j0e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new D(0,0),new D(200,20),new D(20,200),new D(80,110),new D(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Hrt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new os({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new zi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ae(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Ei,o=e.fullExtent,r=i.unproject(new m(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new ae(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Ct(e.copyrightText)]:t.credit=new Ct(e.copyrightText))}function zrt(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new ae(n)}async function Krt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Hrt(i,t)}catch(i){zrt(e,i)}}function Qf(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new zi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new be}Qf.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case Ph.SATELLITE:{n=y(t.token,Kd.defaultAccessToken),i=Ze.createIfNeeded(Kd.defaultWorldImageryServer),i.appendForwardSlash();let r=Kd.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;case Ph.OCEANS:{n=y(t.token,Kd.defaultAccessToken),i=Ze.createIfNeeded(Kd.defaultWorldOceanServer),i.appendForwardSlash();let r=Kd.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;case Ph.HILLSHADE:{n=y(t.token,Kd.defaultAccessToken),i=Ze.createIfNeeded(Kd.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Kd.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;default:}return Qf.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function j0e(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Zi?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(Qf.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Qf.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ze.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Qf(t);i._resource=n;let o=new Q0e(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await Krt(n,o),o.build(i),i};Qf.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Qf.prototype.requestImage=function(e,t,n,i){return ll.loadImage(this,j0e(this,e,t,n,i))};Qf.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Zi)s=W.toDegrees(i),a=W.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,c="3857"}let d="visible";l(this._layers)&&(d+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let g=[],f=p.results;if(!l(f))return g;for(let x=0;xo.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function jrt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function qrt(e,t,n){let i=e.url,o=Xs._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),Xs._metadataCache[i]=o);try{let r=await o;return Qrt(r,t)}catch(r){jrt(e,r,n)}}function Xs(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,PV.AERIAL),this._mapLayer=e.mapLayer,this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new vV),this._proxy=e.proxy,this._credit=new Ct(``),this._tilingScheme=new os({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new be}Object.defineProperties(Xs.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});Xs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,PV.AERIAL),o=Ze.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Xs(t);a._resource=o;let c=new q0e(t);return await qrt(s,c),c.build(a),a};var $rt=new ce;Xs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,$rt);return nst(this._attributionList,n,i)};Xs.prototype.requestImage=function(e,t,n,i){let o=ll.loadImage(this,est(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?vV.EMPTY_IMAGE:Promise.reject(r)})};Xs.prototype.pickFeatures=function(e,t,n,i,o){};Xs.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<=0;--o){let r=1<=h.zoomMin&&t<=h.zoomMax){let p=ce.intersection(n,h.bbox,tst);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Xs._metadataCache={};var Nw=Xs;var UVi=T(S(),1);var RVi=T(S(),1);var $0e=/{[^}]+}/g,ege={x:sst,y:cst,z:ust,s:mst,reverseX:ast,reverseY:lst,reverseZ:dst,westDegrees:hst,southDegrees:fst,eastDegrees:pst,northDegrees:bst,westProjected:gst,southProjected:yst,eastProjected:xst,northProjected:_st,width:Tst,height:Sst},ist=St(ege,{i:Cst,j:Vst,reverseI:Lst,reverseJ:Rst,longitudeDegrees:Gst,latitudeDegrees:Est,longitudeProjected:Ist,latitudeProjected:Xst,format:Pst});function kw(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new be;let t=Ze.createIfNeeded(e.url),n=Ze.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new os({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Ct(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=St(ege,r),a=St(ist,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(kw.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});kw.prototype.getTileCredits=function(e,t,n){};kw.prototype.requestImage=function(e,t,n,i){return ll.loadImage(this,ost(this,e,t,n,i))};kw.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=rst(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(c):d.type==="xml"?u.fetchXML().then(d.callback).catch(c):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(c):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(c)}return c()};var TD=!1,Jd=new ce,SD=!1,Uw=new ce;function ost(e,t,n,i,o){TD=!1,SD=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match($0e);return l(d)&&d.forEach(function(u){let h=u.substring(1,u.length-1);l(a[h])&&(c[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var F4=!1,FV=new D,A4=!1;function rst(e,t,n,i,o,r,s){TD=!1,SD=!1,F4=!1,A4=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},h=c.match($0e);return l(h)&&h.forEach(function(p){let g=p.substring(1,p.length-1);l(d[g])&&(u[g]=d[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function AV(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function sst(e,t,n,i){return AV(e,"{x}",t)}function ast(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return AV(e,"{reverseX}",o)}function cst(e,t,n,i){return AV(e,"{y}",n)}function lst(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return AV(e,"{reverseY}",o)}function dst(e,t,n,i){let o=e.maximumLevel,r=l(o)&&it.rectangle.east&&(e.east=t.rectangle.east),e.southt.rectangle.north&&(e.north=t.rectangle.north),e}function nge(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),o=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}mm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,h,p=[],g=e.childNodes[0].childNodes;for(let P=0;P`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new be}Object.defineProperties(Jl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Jl.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=Ze.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new ige(n);s.channel=t,await Fst(r,s);let a=new Jl(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Jl.prototype.getTileCredits=function(e,t,n){};Jl.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return ll.loadImage(this,o)};Jl.prototype.pickFeatures=function(e,t,n,i,o){};Jl._logoUrl=void 0;Object.defineProperties(Jl,{logoUrl:{get:function(){return l(Jl._logoUrl)||(Jl._logoUrl=rn("Assets/Images/google_earth_credit.png")),Jl._logoUrl},set:function(e){Jl._logoUrl=e}}});var Dw=Jl;var cLi=T(S(),1);var Ast=/\/$/,oge=new Ct('© Mapbox © OpenStreetMap Improve this map');function MV(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ze.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Ast.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Ct(s))):s=oge,this._resource=i,this._imageryProvider=new ka({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(MV.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});MV.prototype.getTileCredits=function(e,t,n){};MV.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};MV.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};MV._defaultCredit=oge;var Bw=MV;var _Li=T(S(),1);function ZT(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,ce.MAX_VALUE),n=new zi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new be;let i=e.credit;typeof i=="string"&&(i=new Ct(i)),this._credit=i;let o=Ze.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(ZT.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function Mst(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Zo.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return N4(e,n,r);throw l(n)&&(n._hasError=!0),new ae(o)}async function N4(e,t,n){try{return await ll.loadImage(null,e)}catch(i){return Mst(e,i,t,n)}}ZT.fromUrl=async function(e,t){let n=Ze.createIfNeeded(e),i=await N4(n);t=y(t,y.EMPTY_OBJECT);let o=new ZT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};ZT.prototype.getTileCredits=function(e,t,n){};ZT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await N4(this._resource,this);return this._image=o,Zo.reportSuccess(this._errorEvent),o}return this._image};ZT.prototype.pickFeatures=function(e,t,n,i,o){};var Ow=ZT;var OLi=T(S(),1);var RLi=T(S(),1);function Nst(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=kst:e==="xml"?n=Ost:(e==="html"||e==="text")&&(n=rge)),this.callback=n}function kst(e){let t=[],n=e.features;for(let i=0;i0)for(let r=0;r\s*<\/body>/im,jst=//im,qst=/([\s\S]*)<\/title>/im;function rge(e){if(Qst.test(e)||jst.test(e))return;let t,n=qst.exec(e);n&&n.length>1&&(t=n[1]);let i=new Wh;return i.name=t,i.description=e,i.data=e,[i]}var GT=Nst;var PLi=T(S(),1);function Yw(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(Yw.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});Yw.prototype.getFromCache=function(e,t,n,i){let o=sge(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};Yw.prototype.checkApproachingInterval=function(e,t,n,i){let o=sge(e,t,n),r=this._tilesRequestedForInterval,s=age(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!cge(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};Yw.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=age(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=cge(this,c,r),a||s.push(c)}}};function sge(e,t,n){return`${e}-${t}-${n}`}function $st(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function age(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=q.secondsDifference(c.stop,i),++a):(s=q.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function cge(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=$st(s),c=new Ko({throttle:!1,throttleByServer:!0,type:ls.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(d)?(r[s]={promise:d,request:c},!0):!1}var ET=Yw;var eat=[3034,3035,3042,3043,3044],tat=[4471,4559];function vh(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new pe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=Ze.createIfNeeded(e.url),n=Ze.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(vh.DefaultParameters,!0),n.setQueryParameters(vh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(lge(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(lge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new ET({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return dge(i,s,a,c,d,u)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Ei?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!tat.includes(a)||eat.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Ei?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new ka({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new zi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,vh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function dge(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function nat(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(vh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});vh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};vh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=dge(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};vh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return nat(this,e,t,n,i,o,s)};vh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});vh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});vh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new GT("json","application/json")),Object.freeze(new GT("xml","text/xml")),Object.freeze(new GT("text","text/html"))]);function lge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var Hw=vh;var nRi=T(S(),1);var iat=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function zw(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Ze.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(iat),this._useKvp=!0;else{let h={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(h),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new os({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new ET({clock:e.clock,times:e.times,requestImageFunction:function(h,p,g,f,x){return uge(s,h,p,g,f,x)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new be;let u=e.credit;this._credit=typeof u=="string"?new Ct(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function uge(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,d=e._dimensions,u=l(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),l(d)&&h.setTemplateValues(d),l(u)&&h.setTemplateValues(u);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(d)&&(g=St(g,d)),l(u)&&(g=St(g,u)),p={s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({queryParameters:g,request:o}),h.setTemplateValues(p)}return ll.loadImage(e,h)}Object.defineProperties(zw.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}}});zw.prototype.getTileCredits=function(e,t,n){};zw.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=uge(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};zw.prototype.pickFeatures=function(e,t,n,i,o){};var Kw=zw;var oat={ARCGIS_MAPSERVER:r0.fromUrl,BING:async(e,t)=>Nw.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,Dw.fromUrl(e,n,t)},MAPBOX:(e,t)=>new Bw({url:e,...t}),SINGLE_TILE:Ow.fromUrl,TMS:Cy.fromUrl,URL_TEMPLATE:(e,t)=>new ka({url:e,...t}),WMS:(e,t)=>new Hw({url:e,...t}),WMTS:(e,t)=>new Kw({url:e,...t})};function jf(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new be}Object.defineProperties(jf.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});jf.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=gd._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=jf._endpointCache[i];l(o)||(o=n.fetchJson(),jf._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ae(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await Cy.fromUrl(new gd(r,n));else{let d=oat[a];if(!l(d))throw new ae(`Unrecognized Cesium ion imagery type: ${a}`);let u={...r.options},h=u.url;delete u.url,s=await d(h,u)}let c=new jf(t);return s.errorEvent.addEventListener(function(d){d.provider=c,c._errorEvent.raiseEvent(d)}),c._tileCredits=gd.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};jf.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};jf.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};jf.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};jf._endpointCache={};var s0=jf;var _Ri=T(S(),1),rat={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},a0=Object.freeze(rat);function sat(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,a0.AERIAL);return s0.fromAssetId(t)}var c0=sat;var IRi=T(S(),1);function NV(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ai.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}NV.createPlaceholder=function(e){let t=new NV(e,0,0,0);return t.addReference(),t.state=ai.PLACEHOLDER,t};NV.prototype.addReference=function(){++this.referenceCount};NV.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),me(this),0):this.referenceCount};NV.prototype.processStateMachine=function(e,t,n){this.state===ai.UNLOADED&&!n&&(this.state=ai.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ai.RECEIVED&&(this.state=ai.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ai.READY&&t&&!this.texture;(this.state===ai.TEXTURE_LOADED||i)&&(this.state=ai.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var kV=NV;var vRi=T(S(),1);function D4(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}D4.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};D4.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ai.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==ai.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==ai.FAILED&&r.state!==ai.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ai.FAILED||i.state===ai.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var UV=D4;function Ti(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,Ti.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,Ti.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,Ti.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,Ti.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,Ti.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,Ti.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,Ti.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,Ti.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ce.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new UV(kV.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(Ti.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Ti.DEFAULT_BRIGHTNESS=1;Ti.DEFAULT_CONTRAST=1;Ti.DEFAULT_HUE=0;Ti.DEFAULT_SATURATION=1;Ti.DEFAULT_GAMMA=1;Ti.DEFAULT_SPLIT=vr.NONE;Ti.DEFAULT_MINIFICATION_FILTER=qt.LINEAR;Ti.DEFAULT_MAGNIFICATION_FILTER=mi.LINEAR;Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ti.fromProviderAsync=function(e,t){let n=new Ti(void 0,t);return uat(n,Promise.resolve(e)),n};Ti.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),Ti.fromProviderAsync(c0({style:e.style}),e)};Ti.prototype.isBaseLayer=function(){return this._isBaseLayer};Ti.prototype.isDestroyed=function(){return!1};Ti.prototype.destroy=function(){return me(this)};var fge=new ce,mge=new ce,B4=new ce,pge=new ce;Ti.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};Ti.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Ei&&e.rectangle.north<Ei.MaximumLatitude&&e.rectangle.south>-Ei.MaximumLatitude,s=ce.intersection(o.rectangle,this._rectangle,fge),a=ce.intersection(e.rectangle,s,mge);if(!l(a)){if(!this.isBaseLayer())return!1;let E=s,X=e.rectangle;a=mge,X.south>=E.north?a.north=a.south=E.north:X.north<=E.south?a.north=a.south=E.south:(a.south=Math.max(X.south,E.south),a.north=Math.min(X.north,E.north)),X.west>=E.east?a.west=a.east=E.east:X.east<=E.west?a.west=a.east=E.west:(a.west=Math.max(X.west,E.west),a.east=Math.min(X.east,E.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),h=lat(this,u,c);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),l(o.minimumLevel)){let E=o.minimumLevel;h<E&&(h=E)}let g=o.tilingScheme,f=g.positionToTileXY(ce.northwest(a),h),x=g.positionToTileXY(ce.southeast(a),h),_=e.rectangle.width/512,C=e.rectangle.height/512,V=g.tileXYToRectangle(f.x,f.y,h);Math.abs(V.south-e.rectangle.north)<C&&f.y<x.y&&++f.y,Math.abs(V.east-e.rectangle.west)<_&&f.x<x.x&&++f.x;let L=g.tileXYToRectangle(x.x,x.y,h);Math.abs(L.north-e.rectangle.south)<C&&x.y>f.y&&--x.y,Math.abs(L.west-e.rectangle.east)<_&&x.x>f.x&&--x.x;let Z=ce.clone(e.rectangle,pge),G=g.tileXYToRectangle(f.x,f.y,h),I=ce.intersection(G,s,B4),v;r?(g.rectangleToNativeRectangle(Z,Z),g.rectangleToNativeRectangle(G,G),g.rectangleToNativeRectangle(I,I),g.rectangleToNativeRectangle(s,s),v=g.tileXYToNativeRectangle.bind(g),_=Z.width/512,C=Z.height/512):v=g.tileXYToRectangle.bind(g);let P,w=0,F=1,b;!this.isBaseLayer()&&Math.abs(I.west-Z.west)>=_&&(w=Math.min(1,(I.west-Z.west)/Z.width)),!this.isBaseLayer()&&Math.abs(I.north-Z.north)>=C&&(F=Math.max(0,(I.north-Z.south)/Z.height));let R=F;for(let E=f.x;E<=x.x;E++)if(P=w,G=v(E,f.y,h),I=ce.simpleIntersection(G,s,B4),!!l(I)){w=Math.min(1,(I.east-Z.west)/Z.width),E===x.x&&(this.isBaseLayer()||Math.abs(I.east-Z.east)<_)&&(w=1),F=R;for(let X=f.y;X<=x.y;X++){if(b=F,G=v(E,X,h),I=ce.simpleIntersection(G,s,B4),!l(I))continue;F=Math.max(0,(I.south-Z.south)/Z.height),X===x.y&&(this.isBaseLayer()||Math.abs(I.south-Z.south)<C)&&(F=0);let A=new se(P,F,w,b),N=this.getImageryFromCache(E,X,h);i.imagery.splice(n,0,new UV(N,A,r)),++n}}return!0};Ti.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,fge),i=c.rectangleToNativeRectangle(i,pge)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new se(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Ti.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=ai.RECEIVED,e.request=void 0,Zo.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Qn.CANCELLED){e.state=ai.UNLOADED,e.request=void 0;return}e.state=ai.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Zo.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Ko({throttle:!1,throttleByServer:!0,type:ls.IMAGERY});e.request=s,e.state=ai.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=ai.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Ti.prototype._createTextureWebGL=function(e,t){let n=new $t({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Wt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Wt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?nt.RGBA:nt.RGB,sampler:n})};Ti.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=ai.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ai.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Ei?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ai.TEXTURE_LOADED};function hge(e,t,n){return`${e}:${t}:${n}`}Ti.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===qt.LINEAR&&i===mi.LINEAR&&!nt.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=qt.LINEAR_MIPMAP_LINEAR;let r=At.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=hge(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new $t({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(sf.NICEST),t.sampler=d}else{let r=hge(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new $t({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ti.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Zi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Pc({persists:!0,owner:this,preExecute:function(c){cat(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ai.READY,t.releaseReference()},canceled:function(){t.state=ai.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ai.READY};Ti.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Ti.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ti.prototype.getImageryFromCache=function(e,t,n,i){let o=bge(e,t,n),r=this._imageryCache[o];return l(r)||(r=new kV(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ti.prototype.removeImageryFromCache=function(e){let t=bge(e.x,e.y,e.level);delete this._imageryCache[t]};function bge(e,t,n){return JSON.stringify([e,t,n])}var ZD={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new D,texture:void 0},aat=Ot.supportsTypedArrays()?new Float32Array(2*64):void 0;function cat(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let _=new Float32Array(2*64*2),C=0;for(let I=0;I<64;++I){let v=I/63;_[C++]=0,_[C++]=v,_[C++]=1,_[C++]=v}let V={position:0,webMercatorT:1},L=is.getRegularGridIndices(2,64),Z=xt.createIndexBuffer({context:t,typedArray:L,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});o.vertexArray=new ei({context:t,attributes:[{index:V.position,vertexBuffer:xt.createVertexBuffer({context:t,typedArray:_,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:V.webMercatorT,vertexBuffer:xt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:Z});let G=new De({sources:[GE]});o.shaderProgram=en.fromCache({context:t,vertexShaderSource:G,fragmentShaderSource:ZE,attributeLocations:V}),o.sampler=new $t({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR,magnificationFilter:mi.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;ZD.textureDimensions.x=r,ZD.textureDimensions.y=s,ZD.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-c),h=new Wt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});W.isPowerOfTwo(r)&&W.isPowerOfTwo(s)&&h.generateMipmap(sf.NICEST);let p=i.south,g=i.north,f=aat,x=0;for(let _=0;_<64;++_){let C=_/63,V=W.lerp(p,g,C);a=Math.sin(V);let Z=(.5*Math.log((1+a)/(1-a))-c)*u;f[x++]=Z,f[x++]=Z}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=ZD,e.vertexArray=o.vertexArray}function lat(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Zi?1:Math.cos(n),a=o.rectangle,d=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(d)/Math.log(2);return Math.round(u)|0}function dat(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function uat(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){dat(e._errorEvent,i)}}var Ua=Ti;var HZi=T(S(),1);var SZi=T(S(),1),mat={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=mat;var VZi=T(S(),1),gge={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=gge.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Kn=gge;function BV(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}BV.prototype.update=function(e,t,n){this.changedThisFrame&&(Vge(e,t,this.tile,n),this.changedThisFrame=!1)};BV.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};BV.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):um._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var hat=new pg;BV.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=hat;a.clear();for(let d=0;d<t.length;++d){let u=t[d];l(u.data.vertexArray)&&a.enqueue(t[d])}let c=a.dequeue();for(;c!==void 0;){let d=c.findTileToWest(r),u=c.findTileToSouth(r),h=c.findTileToEast(r),p=c.findTileToNorth(r);Ws(e,n,c,d,s,yn.EAST,!1,a,i),Ws(e,n,c,u,s,yn.NORTH,!1,a,i),Ws(e,n,c,h,s,yn.WEST,!1,a,i),Ws(e,n,c,p,s,yn.SOUTH,!1,a,i);let g=d.findTileToNorth(r),f=d.findTileToSouth(r),x=h.findTileToNorth(r),_=h.findTileToSouth(r);Ws(e,n,c,g,s,yn.SOUTHEAST,!1,a,i),Ws(e,n,c,x,s,yn.SOUTHWEST,!1,a,i),Ws(e,n,c,f,s,yn.NORTHEAST,!1,a,i),Ws(e,n,c,_,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Ws(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||Kn.wasKicked(d._lastSelectionResult)||Kn.originalResult(d._lastSelectionResult)===Kn.CULLED);){if(s)return;let u=d.parent;if(r>=yn.NORTHWEST&&u!==void 0)switch(r){case yn.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case yn.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case yn.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case yn.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===Kn.RENDERED){if(l(d.data.vertexArray))return;fat(e,t,n,d,r,o,a,c);return}if(Kn.originalResult(i._lastSelectionResult)!==Kn.CULLED)switch(r){case yn.WEST:Ws(e,t,n,i.northwestChild,o,r,!0,a,c),Ws(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.EAST:Ws(e,t,n,i.southeastChild,o,r,!0,a,c),Ws(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTH:Ws(e,t,n,i.southwestChild,o,r,!0,a,c),Ws(e,t,n,i.southeastChild,o,r,!0,a,c);break;case yn.NORTH:Ws(e,t,n,i.northeastChild,o,r,!0,a,c),Ws(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHWEST:Ws(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHEAST:Ws(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTHWEST:Ws(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.SOUTHEAST:Ws(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new pe("Invalid edge")}}}function fat(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new BV(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),pat(e,t,n,i,o,a)}function pat(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(Vge(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case yn.WEST:d=s.westMeshes,u=s.westTiles;break;case yn.SOUTH:d=s.southMeshes,u=s.southTiles;break;case yn.EAST:d=s.eastMeshes,u=s.eastTiles;break;case yn.NORTH:d=s.northMeshes,u=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||d[0]!==a||d.length!==1,d[0]=a,u[0]=n,d.length=1,u.length=1;return}let h,p,g,f,x=n.rectangle,_,C=i.rectangle;switch(o){case yn.WEST:for(_=(C.north-C.south)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.greaterThan(x.north,f.south,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.greaterThanOrEquals(x.south,f.north,_));++p);break;case yn.SOUTH:for(_=(C.east-C.west)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.lessThan(x.west,f.east,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.lessThanOrEquals(x.east,f.west,_));++p);break;case yn.EAST:for(_=(C.north-C.south)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.lessThan(x.south,f.north,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.lessThanOrEquals(x.north,f.south,_));++p);break;case yn.NORTH:for(_=(C.east-C.west)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.greaterThan(x.east,f.west,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.greaterThanOrEquals(x.west,f.east,_));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||d[h]!==a,d[h]=a,u[h]=n):(s.changedThisFrame=!0,d.splice(h,p-h,a),u.splice(h,p-h,n))}var IT=new he,bat=new he,DV=new m,z4=new m,O4=new D,Y4=new D,Qd=new D;function vD(){this.height=0,this.encodedNormal=new D}function GD(e,t,n,i,o,r,s,a,c){if(l(o))return o;let d;if(l(r)&&l(s))d=(r.height+s.height)*.5;else if(l(r))d=r.height;else if(l(s))d=s.height;else if(l(a))d=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,g=0;l(h)&&(p=h.minimumHeight,g=h.maximumHeight),d=(p+g)*.5}return Lge(e,t,n,i,d,c),c}var gat={minimumHeight:0,maximumHeight:0},yat=new m,yge=new vD,xge=new vD,_ge=new vD,Tge=new vD,xat=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,_at={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function Vge(e,t,n,i){um.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,h=ID(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,_ge),p=ID(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,yge),g=ID(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,xge),f=ID(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,Tge);h=GD(r,u,0,1,h,p,f,g,_ge),p=GD(r,u,0,0,p,h,g,f,yge),g=GD(r,u,1,1,g,p,f,h,xge),f=GD(r,u,1,1,f,g,h,p,Tge);let x=p.height,_=g.height,C=h.height,V=f.height,L=Math.min(x,_,C,V),Z=Math.max(x,_,C,V),G=(L+Z)*.5,I,v,P=e.getLevelMaximumGeometricError(n.level),w=u.maximumRadius-P,F=Math.acos(w/u.maximumRadius)*4;if(F*=1.5,s.width>F&&Z-L<=P){let E=new Na({width:9,height:9,buffer:xat,structure:{heightOffset:Z}}),X=_at;X.tilingScheme=n.tilingScheme,X.x=n.x,X.y=n.y,X.level=n.level,X.exaggeration=a,X.exaggerationRelativeHeight=c,r.mesh=E._createMeshSync(X)}else{let E=d,X=ce.center(s,bat);X.height=G;let A=u.cartographicToCartesian(X,yat),N=new Sc(A,void 0,void 0,void 0,void 0,!0,!0,E,a,c),O=5,U;for(U=r.westMeshes,I=0,v=U.length;I<v;++I)O+=U[I].eastIndicesNorthToSouth.length;for(U=r.southMeshes,I=0,v=U.length;I<v;++I)O+=U[I].northIndicesWestToEast.length;for(U=r.eastMeshes,I=0,v=U.length;I<v;++I)O+=U[I].westIndicesSouthToNorth.length;for(U=r.northMeshes,I=0,v=U.length;I<v;++I)O+=U[I].southIndicesEastToWest.length;let Y=gat;Y.minimumHeight=L,Y.maximumHeight=Z;let k=N.stride,H=new Float32Array(O*k),J=0,te=J;J=ED(u,s,N,H,J,0,1,h.height,h.encodedNormal,1,Y),J=WD(r,u,N,H,J,r.westTiles,r.westMeshes,yn.EAST,Y);let z=J;J=ED(u,s,N,H,J,0,0,p.height,p.encodedNormal,0,Y),J=WD(r,u,N,H,J,r.southTiles,r.southMeshes,yn.NORTH,Y);let j=J;J=ED(u,s,N,H,J,1,0,g.height,g.encodedNormal,0,Y),J=WD(r,u,N,H,J,r.eastTiles,r.eastMeshes,yn.WEST,Y);let ee=J;J=ED(u,s,N,H,J,1,1,f.height,f.encodedNormal,1,Y),J=WD(r,u,N,H,J,r.northTiles,r.northMeshes,yn.SOUTH,Y),L=Y.minimumHeight,Z=Y.maximumHeight;let fe=Gn.fromRectangle(s,L,Z,n.tilingScheme.ellipsoid),_e=Ei.geodeticLatitudeToMercatorAngle(s.south),de=1/(Ei.geodeticLatitudeToMercatorAngle(s.north)-_e),ye=(Ei.geodeticLatitudeToMercatorAngle(X.latitude)-_e)*de,Te=u.geodeticSurfaceNormalCartographic(IT,z4),Ie=wn.octEncode(Te,O4),Le=J;N.encode(H,J*k,fe.center,D.fromElements(.5,.5,Qd),G,Ie,ye,Te),++J;let ke=J,Be=ke<256?1:2,it=(ke-1)*3,Et=it*Be,yt=(H.length-ke*k)*Float32Array.BYTES_PER_ELEMENT,Ne;if(yt>=Et){let Ce=ke*k*Float32Array.BYTES_PER_ELEMENT;Ne=ke<256?new Uint8Array(H.buffer,Ce,it):new Uint16Array(H.buffer,Ce,it)}else Ne=ke<256?new Uint8Array(it):new Uint16Array(it);H=new Float32Array(H.buffer,0,ke*k);let Jt=0;for(I=0;I<ke-2;++I)Ne[Jt++]=Le,Ne[Jt++]=I,Ne[Jt++]=I+1;Ne[Jt++]=Le,Ne[Jt++]=I,Ne[Jt++]=0;let Rt=[];for(I=z;I>=te;--I)Rt.push(I);let mt=[];for(I=j;I>=z;--I)mt.push(I);let on=[];for(I=ee;I>=j;--I)on.push(I);let Ve=[];for(Ve.push(0),I=Le-1;I>=ee;--I)Ve.push(I);r.mesh=new dm(N.center,H,Ne,it,ke,L,Z,le.fromOrientedBoundingBox(fe),Zat(e,fe.center,s,L,Z),N.stride,fe,N,Rt,mt,on,Ve)}let b=t.context;r._destroyVertexArray(i),r.vertexArray=um._createVertexArrayForMesh(b,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let R=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let E=o._findAncestorTileWithTerrainData(n);l(E)&&l(E.data.waterMaskTexture)&&(r.waterMaskTexture=E.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,E,r.waterMaskTranslationAndScale))}l(R)&&(--R.referenceCount,R.referenceCount===0&&R.destroy())}function ED(e,t,n,i,o,r,s,a,c,d,u){let h=IT;h.longitude=W.lerp(t.west,t.east,r),h.latitude=W.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,DV),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,z4));let f=Y4;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,g),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var PD=new ce;function Jw(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=ce.clone(e.rectangle,PD),o.west-=W.TWO_PI,o.east-=W.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,PD),o.west+=W.TWO_PI,o.east+=W.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,h=(r.north-o.south)/d,p=(n.x-a)/(c-a),g=(n.y-u)/(h-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var Tat=new D;function H4(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var Sat=new D,Cat=new m;function Vat(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,h=i.vertices,p=Jw(t,n,u.decodeTextureCoordinates(h,o,Qd),Qd),g=Jw(t,n,u.decodeTextureCoordinates(h,r,Y4),Y4),f;c?f=(s-p.x)/(g.x-p.x):f=(a-p.y)/(g.y-p.y);let x=u.decodeHeight(h,o),_=u.decodeHeight(h,r),C=n.rectangle;IT.longitude=W.lerp(C.west,C.east,s),IT.latitude=W.lerp(C.south,C.north,a),d.height=IT.height=W.lerp(x,_,f);let V;if(u.hasVertexNormals){let L=u.getOctEncodedNormal(h,o,Tat),Z=u.getOctEncodedNormal(h,r,Sat),G=wn.octDecode(L.x,L.y,DV),I=wn.octDecode(Z.x,Z.y,Cat);V=m.lerp(G,I,f,DV),m.normalize(V,V),wn.octEncode(V,d.encodedNormal)}else V=e.geodeticSurfaceNormalCartographic(IT,DV),wn.octEncode(V,d.encodedNormal)}function Lge(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(IT,DV);wn.octEncode(s,r.encodedNormal)}function ID(e,t,n,i,o,r,s,a,c,d,u){if(Cge(e,t,a,s,!1,n,i,u)||Cge(e,t,d,c,!0,n,i,u))return u;let p;if(K4(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],H4(r,p,n,i,u),u;let g;if(n===0?i===0?g=XD(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=XD(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=XD(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=XD(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),l(g))return Lge(e,t,n,i,g,u),u}function XD(e,t,n,i,o,r,s,a){let c=Sge(e,t,!1,n,s,a),d=Sge(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function WD(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=Lat(e,t,n,i,o,r[d],s[d],a,c);return o}function Lat(e,t,n,i,o,r,s,a,c){let d=r.rectangle;a===yn.EAST&&e.tile.x===0?(d=ce.clone(r.rectangle,PD),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===yn.WEST&&r.x===0&&(d=ce.clone(r.rectangle,PD),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Qd),h=Qd.x,p=Qd.y);let g,f;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,f=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,f=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,f=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,f=!0;break}let x=r,_=e.tile,C=s.encoding,V=s.vertices,L=n.stride,Z,G;C.hasWebMercatorT&&(Z=Ei.geodeticLatitudeToMercatorAngle(u.south),G=1/(Ei.geodeticLatitudeToMercatorAngle(u.north)-Z));for(let I=0;I<g.length;++I){let v=g[I],P=C.decodeTextureCoordinates(V,v,Qd);Jw(x,_,P,P);let w=P.x,F=P.y,b=f?w:F;if(b<0||b>1||Math.abs(w-h)<W.EPSILON5&&Math.abs(F-p)<W.EPSILON5)continue;let R=Math.abs(w)<W.EPSILON5||Math.abs(w-1)<W.EPSILON5,E=Math.abs(F)<W.EPSILON5||Math.abs(F-1)<W.EPSILON5;if(R&&E)continue;let X=C.decodePosition(V,v,DV),A=C.decodeHeight(V,v),N;C.hasVertexNormals?N=C.getOctEncodedNormal(V,v,O4):(N=O4,N.x=0,N.y=0);let O=F;if(C.hasWebMercatorT){let Y=W.lerp(u.south,u.north,F);O=(Ei.geodeticLatitudeToMercatorAngle(Y)-Z)*G}let U;n.hasGeodeticSurfaceNormals&&(U=t.geodeticSurfaceNormal(X,z4)),n.encode(i,o*L,X,P,A,N,O,U),c.minimumHeight=Math.min(c.minimumHeight,A),c.maximumHeight=Math.max(c.maximumHeight,A),++o}return o}function Sge(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let d=s;d!==a;d+=c){let u=e[d],h=t[d];if(!K4(h,u))continue;let p;switch(i){case yn.WEST:p=u.westIndicesSouthToNorth;break;case yn.SOUTH:p=u.southIndicesEastToWest;break;case yn.EAST:p=u.eastIndicesNorthToSouth;break;case yn.NORTH:p=u.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return u.encoding.decodeHeight(u.vertices,g)}}function K4(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Cge(e,t,n,i,o,r,s,a){let c,d,u,h,p,g=i[o?0:n.length-1],f=n[o?0:n.length-1];if(K4(g,f)&&(r===0?s===0?(c=o?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,d=o,u=o):(c=o?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,d=!o,u=!1):s===0?(c=o?f.westIndicesSouthToNorth:f.northIndicesWestToEast,d=!o,u=!0):(c=o?f.southIndicesEastToWest:f.westIndicesSouthToNorth,d=o,u=!o),c.length>0)){h=o?0:c.length-1,p=c[h],f.encoding.decodeTextureCoordinates(f.vertices,p,Qd);let x=Jw(g,e.tile,Qd,Qd);if(x.x===r&&x.y===s)return H4(f,p,r,s,a),!0;if(h=Io(c,d?r:s,function(_,C){f.encoding.decodeTextureCoordinates(f.vertices,_,Qd);let V=Jw(g,e.tile,Qd,Qd);return u?d?V.x-r:V.y-s:d?r-V.x:s-V.y}),h<0){if(h=~h,h>0&&h<c.length)return Vat(t,g,e.tile,f,c[h-1],c[h],r,s,d,a),!0}else return H4(f,c[h],r,s,a),!0}return!1}var Rat=[new m,new m,new m,new m];function Zat(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Rat;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var OV=BV;function or(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=_n.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new be,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(or.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(or.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(or.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(or.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new be,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new B(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(or.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){fs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){jm.setOwner(e,this,"_clippingPolygons")}}});function Gat(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}or.prototype.update=function(e){this._imageryLayers._update()};function Eat(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}or.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Gat)})),Eat(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)um._freeVertexArray(t[i]);t.length=0};or.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};or.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:oc.LESS}}),this._blendRenderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:oc.LESS_OR_EQUAL},blending:mn.ALPHA_BLEND});let s=Ye(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ue.fromCache(s),s=Ye(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ue.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&OV.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let d=0,u=c.length;d<u;++d){let h=c[d],p=h.data.tileBoundingRegion;$at(this,h,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function Ige(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}or.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)Ige(t[n],e)};or.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};or.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};or.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Kn.CULLED_BUT_NEEDED,o=n.terrainState),um.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==hr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,um.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Iat=new le,Xge=new ce,Xat=new ce,Wat=new he;function FD(e,t){if(t.west<t.east)return t;let n=ce.clone(t,Xat);return ce.center(e,Wat).longitude>0?n.east=W.PI:n.west=-W.PI,n}function Wge(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}or.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=Wge(this,t);if(t.fog.enabled&&!o&&W.fog(i,t.fog.density)>=1)return hr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return hr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let d=FD(e.rectangle,this.cartographicLimitRectangle),u=ce.simpleIntersection(d,e.rectangle,Xge);if(!l(u))return hr.NONE;if(ce.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(c=Iat,le.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===oe.MORPHING&&l(r.renderedMesh)&&(c=le.union(s.boundingSphere,c,c))),!l(c))return hr.PARTIAL;let h=this._clippingPlanes;if(l(h)&&h.enabled){let _=h.computeIntersectionWithBoundingVolume(c);if(e.isClipped=_!==zt.INSIDE,_===zt.OUTSIDE)return hr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let _=p.computeIntersectionWithBoundingVolume(s);e.isClipped=_!==zt.OUTSIDE}let g,f=a.computeVisibility(c);if(f===zt.OUTSIDE?g=hr.NONE:f===zt.INTERSECTING?g=hr.PARTIAL:f===zt.INSIDE&&(g=hr.FULL),g===hr.NONE)return g;let x=t.mode===oe.SCENE3D&&t.camera.frustum instanceof an;if(t.mode===oe.SCENE3D&&!x&&l(n)&&!o){let _=r.occludeePointInScaledSpace;return!l(_)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(_,s.minimumHeight)?g:hr.NONE}return g};or.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Pat=[],vat=[];or.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Pat;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===uo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let h=s[a],p=h.loadingImagery,g=!l(p)||p.state===ai.FAILED||p.state===ai.INVALID,f=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[f]=g&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=vat;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);u.length>0;){let h=u.pop(),p=h._lastSelectionResultFrame===d?h._lastSelectionResult:Kn.NONE;if(p===Kn.RENDERED){let g=h.data;if(!l(g))continue;if(!o&&h.data.terrainState===uo.READY)return!1;let f=h.data.imagery;for(a=0,c=f.length;a<c;++a){let x=f[a],_=x.loadingImagery,C=!l(_)||_.state===ai.FAILED||_.state===ai.INVALID,V=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[V])return!1}}else p===Kn.REFINED&&u.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var wat=new m;or.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=m.subtract(i.center,o,wat),a=m.magnitude(s);return a<W.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,r))*e._distance)};var Rge=new M,wD=new M,Fat=new se,Aat=new se,Mat=new se,Nat=new m,Zge=new m,kat=new m,Uat=new m;or.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let d=i[a];l(d.readyImagery)&&d.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Dat=[new m,new m,new m,new m];function Gge(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Dat;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}or.prototype.computeDistanceToTile=function(e,t){Bat(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,d=Math.abs(c-r),u=Math.abs(c-s);d>u?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function Bat(e,t,n){let i=e.data;i===void 0&&(i=e.data=new um);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Hu({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,d=e,u=i.mesh,h=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,c=!0;else if(h!==void 0&&h._minimumHeight!==void 0&&h._maximumHeight!==void 0)r.minimumHeight=h._minimumHeight,r.maximumHeight=h._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let f=g.mesh,x=g.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0){r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Tr.getHeight(r.minimumHeight,p,g),r.maximumHeight=Tr.getHeight(r.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Gn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=le.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=m.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Gge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=Gge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}or.prototype.isDestroyed=function(){return!1};or.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),me(this)};function Oat(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,d;for(d=0;d<c;++d)if(o=a[d],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(d=s;d<u;++d)a[d].freeResources();a.splice(s,e)}return!0}}or.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,d=c.length,u=-1,h=0;for(a=0;a<d;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)u===-1&&(u=a),++h;else if(u!==-1)break}if(u===-1)return;let p=u+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Oat(h,e,n),s.state=qs.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=qs.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Kn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};or.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],d=c.loadingImagery;if(l(d)||(d=c.readyImagery),d.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};or.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};or.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Yat=new M,Hat=new M;function Ege(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=M.multiplyByPoint(i,this.properties.rtc,Zge);return M.setTranslation(i,o,Rge),Rge},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=M.multiplyByPoint(i,this.properties.rtc,Zge);return M.setTranslation(i,r,wD),M.multiply(o,wD,wD),wD},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?M.multiply(e.context.uniformState.view,i.modelMatrix,Yat):M.IDENTITY;return M.inverseTranspose(o,Hat)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new B(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new D(65e5,9e6),nightFadeDistance:new D(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,center3D:void 0,rtc:new m,modifiedModelView:new M,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new D(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new D,southMercatorYAndOneOverHeight:new D,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new D,scaleAndBias:new M,clippingPlanesEdgeColor:B.clone(B.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:B.clone(B.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?St(n,t.materialUniformMap):n}function zat(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Kat(e,r,o),i.wireframeVertexArray.mesh=o}}function Kat(e,t,n){let o={indices:n.indices,primitiveType:we.TRIANGLES};Fn.toWireframe(o);let r=o.indices,s=xt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:Ae.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ei({context:e,attributes:t._attributes,indexBuffer:s})}var Pge,vge,AD;(function(){let e=new Gt({geometry:wm.fromDimensions({dimensions:new m(2,2,2)})}),t=new Gt({geometry:new Rb({radius:1})}),n=new M,i,o;function r(s){return new In({geometryInstances:s,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})}Pge=function(s,a){return s===i||(AD(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Ht.fromColor(a),o=r(e)),o},vge=function(s,a){return s===i||(AD(),i=s,n=M.fromTranslation(s.center,n),n=M.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Ht.fromColor(a),o=r(t)),o},AD=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Jat=new se(0,0,0,0),Qat={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},jat=B.TRANSPARENT,qat=new kt;function $at(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new OV(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let Ce=r.credits;for(let rt=0,Oi=Ce.length;rt<Oi;++rt)o.addCreditToNextFrame(Ce[rt])}let s=At.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let d=n.cameraUnderground,u=n.globeTranslucencyState,h=u.translucent,p=u.frontFaceAlphaByDistance,g=u.backFaceAlphaByDistance,f=u.rectangle,x=y(e.undergroundColor,jat),_=y(e.undergroundColorAlphaByDistance,qat),C=Wge(e,n)&&n.mode===oe.SCENE3D&&x.alpha>0&&(_.nearValue>0||_.farValue>0),V=e.lambertDiffuseMultiplier,L=e.vertexShadowDarkness,Z=e.hasWaterMask&&l(a),G=Z&&e.showWaterEffect,I=e.oceanNormalMap,v=G&&l(I),P=e.terrainProvider,w=l(P)&&e.terrainProvider.hasVertexNormals,F=n.fog.enabled&&n.fog.renderable&&!d,b=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,R=_n.castShadows(e.shadows)&&!h,E=_n.receiveShadows(e.shadows)&&!h,X=e.hueShift,A=e.saturationShift,N=e.brightnessShift,O=!(W.equalsEpsilon(X,0,W.EPSILON7)&&W.equalsEpsilon(A,0,W.EPSILON7)&&W.equalsEpsilon(N,0,W.EPSILON7)),U=!1;if(b){let Ce=m.magnitude(n.camera.positionWC),rt=e.nightFadeOutDistance;U=Ce>rt}Z&&--s,v&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=u.numberOfTextureUniforms;let Y=i.renderedMesh,k=Y.center,H=Y.encoding,J=i.tileBoundingRegion,te=n.verticalExaggeration,z=n.verticalExaggerationRelativeHeight,j=te!==1,ee=H.hasGeodeticSurfaceNormals,fe=Fat,_e=0,de=0,ye=0,Te=0,Ie=!1;if(n.mode!==oe.SCENE3D){let Ce=n.mapProjection,rt=Ce.project(ce.southwest(t.rectangle),kat),Oi=Ce.project(ce.northeast(t.rectangle),Uat);if(fe.x=rt.x,fe.y=rt.y,fe.z=Oi.x,fe.w=Oi.y,n.mode!==oe.MORPHING&&(k=Nat,k.x=0,k.y=(fe.z+fe.x)*.5,k.z=(fe.w+fe.y)*.5,fe.x-=k.y,fe.y-=k.z,fe.z-=k.y,fe.w-=k.z),n.mode===oe.SCENE2D&&H.quantization===js.BITS12){let ht=1/(Math.pow(2,12)-1)*.5,go=(fe.z-fe.x)*ht,zo=(fe.w-fe.y)*ht;fe.x-=go,fe.y-=zo,fe.z+=go,fe.w+=zo}Ce instanceof Ei&&(_e=t.rectangle.south,de=t.rectangle.north,ye=Ei.geodeticLatitudeToMercatorAngle(_e),Te=1/(Ei.geodeticLatitudeToMercatorAngle(de)-ye),Ie=!0)}let Le=Qat;Le.frameState=n,Le.surfaceTile=i,Le.hasWaterMask=Z,Le.showReflectiveOcean=G,Le.showOceanWaves=v,Le.enableLighting=e.enableLighting,Le.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Le.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Le.showGroundAtmosphere=b,Le.atmosphereLightIntensity=e.atmosphereLightIntensity,Le.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Le.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Le.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Le.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Le.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Le.perFragmentGroundAtmosphere=U,Le.hasVertexNormals=w,Le.useWebMercatorProjection=Ie,Le.clippedByBoundaries=i.clippedByBoundaries,Le.hasGeodeticSurfaceNormals=ee,Le.hasExaggeration=j;let ke=i.imagery,Be=0,it=ke.length,Et=e.showSkirts&&!d&&!h,yt=e.backFaceCulling&&!d&&!h,Ne=yt?e._renderState:e._disableCullingRenderState,Jt=yt?e._blendRenderState:e._disableCullingBlendRenderState,Rt=Ne,mt=e._firstPassInitialColor,on=n.context;if(l(e._debug.boundingSphereTile)||AD(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let Ce=e._drawCommands.length;for(let rt=0;rt<Ce;++rt)e._uniformMaps[rt]=Ege(n,e)}do{let Ce=0,rt,Oi;if(e._drawCommands.length<=e._usedDrawCommands?(rt=new qe,rt.owner=t,rt.cull=!1,rt.boundingVolume=new le,rt.orientedBoundingBox=void 0,Oi=Ege(n,e),e._drawCommands.push(rt),e._uniformMaps.push(Oi)):(rt=e._drawCommands[e._usedDrawCommands],Oi=e._uniformMaps[e._usedDrawCommands]),rt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Sa=J.boundingVolume,gl=J.boundingSphere;l(Sa)?Pge(Sa,B.RED).update(n):l(gl)&&vge(gl,B.RED).update(n)}let ht=Oi.properties;se.clone(mt,ht.initialColor),ht.oceanNormalMap=I,ht.lightingFadeDistance.x=e.lightingFadeOutDistance,ht.lightingFadeDistance.y=e.lightingFadeInDistance,ht.nightFadeDistance.x=e.nightFadeOutDistance,ht.nightFadeDistance.y=e.nightFadeInDistance,ht.atmosphereLightIntensity=e.atmosphereLightIntensity,ht.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ht.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ht.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ht.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ht.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ht.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let go=d?g:p,zo=d?p:g;l(go)&&(se.fromElements(go.near,go.nearValue,go.far,go.farValue,ht.frontFaceAlphaByDistance),se.fromElements(zo.near,zo.nearValue,zo.far,zo.farValue,ht.backFaceAlphaByDistance)),se.fromElements(_.near,_.nearValue,_.far,_.farValue,ht.undergroundColorAlphaByDistance),B.clone(x,ht.undergroundColor),ht.lambertDiffuseMultiplier=V,ht.vertexShadowDarkness=L;let Ya=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Ya&&B.clone(e.fillHighlightColor,ht.fillHighlightColor),ht.verticalExaggerationAndRelativeHeight.x=te,ht.verticalExaggerationAndRelativeHeight.y=z,ht.center3D=Y.center,m.clone(k,ht.rtc),se.clone(fe,ht.tileRectangle),ht.southAndNorthLatitude.x=_e,ht.southAndNorthLatitude.y=de,ht.southMercatorYAndOneOverHeight.x=ye,ht.southMercatorYAndOneOverHeight.y=Te;let Gr=Aat,_s=FD(t.rectangle,e.cartographicLimitRectangle),Fe=Mat,st=FD(t.rectangle,f);m.fromElements(X,A,N,ht.hsbShift);let Ke=t.rectangle,Qe=1/Ke.width,pt=1/Ke.height;Gr.x=(_s.west-Ke.west)*Qe,Gr.y=(_s.south-Ke.south)*pt,Gr.z=(_s.east-Ke.west)*Qe,Gr.w=(_s.north-Ke.south)*pt,se.clone(Gr,ht.localizedCartographicLimitRectangle),Fe.x=(st.west-Ke.west)*Qe,Fe.y=(st.south-Ke.south)*pt,Fe.z=(st.east-Ke.west)*Qe,Fe.w=(st.north-Ke.south)*pt,se.clone(Fe,ht.localizedTranslucencyRectangle);let Yt=F&&W.fog(t._distance,n.fog.density)>W.EPSILON3;O=O&&(Yt||b);let Cn=!1,Eo=!1,So=!1,Ha=!1,za=!1,Si=!1,fi=!1,ia=!1,zr=!1,bl=!1;for(;Ce<s&&Be<it;){let Sa=ke[Be],gl=Sa.readyImagery;if(++Be,!l(gl)||gl.imageryLayer.alpha===0)continue;let Ic=Sa.useWebMercatorT?gl.textureWebMercator:gl.texture,cs=gl.imageryLayer;l(Sa.textureTranslationAndScale)||(Sa.textureTranslationAndScale=cs._calculateTextureTranslationAndScale(t,Sa)),ht.dayTextures[Ce]=Ic,ht.dayTextureTranslationAndScale[Ce]=Sa.textureTranslationAndScale,ht.dayTextureTexCoordsRectangle[Ce]=Sa.textureCoordinateRectangle,ht.dayTextureUseWebMercatorT[Ce]=Sa.useWebMercatorT,ht.dayTextureAlpha[Ce]=cs.alpha,Si=Si||ht.dayTextureAlpha[Ce]!==1,ht.dayTextureNightAlpha[Ce]=cs.nightAlpha,fi=fi||ht.dayTextureNightAlpha[Ce]!==1,ht.dayTextureDayAlpha[Ce]=cs.dayAlpha,fi=fi||ht.dayTextureDayAlpha[Ce]!==1,ht.dayTextureBrightness[Ce]=cs.brightness,Cn=Cn||ht.dayTextureBrightness[Ce]!==Ua.DEFAULT_BRIGHTNESS,ht.dayTextureContrast[Ce]=cs.contrast,Eo=Eo||ht.dayTextureContrast[Ce]!==Ua.DEFAULT_CONTRAST,ht.dayTextureHue[Ce]=cs.hue,So=So||ht.dayTextureHue[Ce]!==Ua.DEFAULT_HUE,ht.dayTextureSaturation[Ce]=cs.saturation,Ha=Ha||ht.dayTextureSaturation[Ce]!==Ua.DEFAULT_SATURATION,ht.dayTextureOneOverGamma[Ce]=1/cs.gamma,za=za||ht.dayTextureOneOverGamma[Ce]!==1/Ua.DEFAULT_GAMMA,ht.dayTextureSplit[Ce]=cs.splitDirection,ia=ia||ht.dayTextureSplit[Ce]!==0;let uu=ht.dayTextureCutoutRectangles[Ce];if(l(uu)||(uu=ht.dayTextureCutoutRectangles[Ce]=new se),se.clone(se.ZERO,uu),l(cs.cutoutRectangle)){let Ao=FD(Ke,cs.cutoutRectangle),un=ce.simpleIntersection(Ao,Ke,Xge);zr=l(un)||zr,uu.x=(Ao.west-Ke.west)*Qe,uu.y=(Ao.south-Ke.south)*pt,uu.z=(Ao.east-Ke.west)*Qe,uu.w=(Ao.north-Ke.south)*pt}let mu=ht.colorsToAlpha[Ce];l(mu)||(mu=ht.colorsToAlpha[Ce]=new se);let hu=l(cs.colorToAlpha)&&cs.colorToAlphaThreshold>0;if(bl=bl||hu,hu){let Ao=cs.colorToAlpha;mu.x=Ao.red,mu.y=Ao.green,mu.z=Ao.blue,mu.w=cs.colorToAlphaThreshold}else mu.w=-1;if(l(gl.credits)){let Ao=gl.credits;for(let un=0,Re=Ao.length;un<Re;++un)o.addCreditToNextFrame(Ao[un])}++Ce}ht.dayTextures.length=Ce,ht.waterMask=a,se.clone(c,ht.waterMaskTranslationAndScale),ht.minMaxHeight.x=H.minimumHeight,ht.minMaxHeight.y=H.maximumHeight,M.clone(H.matrix,ht.scaleAndBias);let yo=e._clippingPlanes,Er=l(yo)&&yo.enabled&&t.isClipped;Er&&(ht.clippingPlanesEdgeColor=B.clone(yo.edgeColor,ht.clippingPlanesEdgeColor),ht.clippingPlanesEdgeWidth=yo.edgeWidth);let fp=e._clippingPolygons,Kr=l(fp)&&fp.enabled&&t.isClipped;Le.numberOfDayTextures=Ce,Le.applyBrightness=Cn,Le.applyContrast=Eo,Le.applyHue=So,Le.applySaturation=Ha,Le.applyGamma=za,Le.applyAlpha=Si,Le.applyDayNightAlpha=fi,Le.applySplit=ia,Le.enableFog=Yt,Le.enableClippingPlanes=Er,Le.clippingPlanes=yo,Le.enableClippingPolygons=Kr,Le.clippingPolygons=fp,Le.hasImageryLayerCutout=zr,Le.colorCorrect=O,Le.highlightFillTile=Ya,Le.colorToAlpha=bl,Le.showUndergroundColor=C,Le.translucent=h;let du=i.renderedMesh.indices.length;Et||(du=i.renderedMesh.indexCountWithoutSkirts),rt.shaderProgram=e._surfaceShaderSet.getShaderProgram(Le),rt.castShadows=R,rt.receiveShadows=E,rt.renderState=Rt,rt.primitiveType=we.TRIANGLES,rt.vertexArray=i.vertexArray||i.fill.vertexArray,rt.count=du,rt.uniformMap=Oi,rt.pass=Ee.GLOBE,e._debug.wireframe&&(zat(on,e,t),l(i.wireframeVertexArray)&&(rt.vertexArray=i.wireframeVertexArray,rt.primitiveType=we.LINES,rt.count=du*2));let Ka=rt.boundingVolume,Jy=rt.orientedBoundingBox;n.mode!==oe.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,J.minimumHeight,J.maximumHeight,Ka),m.fromElements(Ka.center.z,Ka.center.x,Ka.center.y,Ka.center),n.mode===oe.MORPHING&&(Ka=le.union(J.boundingSphere,Ka,Ka))):(rt.boundingVolume=le.clone(J.boundingSphere,Ka),rt.orientedBoundingBox=Gn.clone(J.boundingVolume,Jy)),rt.dirty=!0,h&&u.updateDerivedCommands(rt,n),Ige(rt,n),Rt=Jt,mt=Jat}while(Be<it)}var Qw=or;var qGi=T(S(),1);function wge(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(wge.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=kt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=kt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var jw=wge;var aEi=T(S(),1);function Ps(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(Ps.prototype,{length:{get:function(){return this._layers.length}}});Ps.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Ps.prototype.addImageryProvider=function(e,t){let n=new Ua(e);return this.add(n,t),n};Ps.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Ps.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Ps.prototype.contains=function(e){return this.indexOf(e)!==-1};Ps.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ps.prototype.get=function(e){return this._layers[e]};function MD(e,t){return e.indexOf(t)}function Fge(e,t,n){let i=e._layers;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Ps.prototype.raise=function(e){let t=MD(this._layers,e);Fge(this,t,t+1)};Ps.prototype.lower=function(e){let t=MD(this._layers,e);Fge(this,t,t-1)};Ps.prototype.raiseToTop=function(e){let t=MD(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Ps.prototype.lowerToBottom=function(e){let t=MD(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var ect=new ce;function Age(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];ce.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],d=c.readyImagery;if(!l(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!l(u.pickFeatures)||!ce.contains(d.rectangle,t))continue;let h=ect,p=1/1024;h.west=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),h.east=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),h.south=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),h.north=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(h,t)&&i(d)}}Ps.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(Age(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Ps.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(Age(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let d=s[c],u=r[c];if(l(d)&&d.length>0)for(let h=0;h<d.length;++h){let p=d[h];p.imageryLayer=u,l(p.position)||(p.position=i),a.push(p)}}return a})};Ps.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ps.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ps.prototype.isDestroyed=function(){return!1};Ps.prototype.destroy=function(){return this.removeAll(!0),me(this)};Ps.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var qw=Ps;var UEi=T(S(),1);var uEi=T(S(),1);function Mge(e){this._ellipsoid=new Fb(e.ellipsoid,m.ZERO)}Object.defineProperties(Mge.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var $w=Mge;var gEi=T(S(),1);function dl(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Kn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=qs.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}dl.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new dl({tilingScheme:e,x:s,y:r,level:0});return i};dl.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(dl.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new dl({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new dl({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new dl({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new dl({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<qs.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});dl.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};dl.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};dl.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};dl.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};dl.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};dl.prototype.freeResources=function(){this.state=qs.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),ND(this._southwestChild),this._southwestChild=void 0,ND(this._southeastChild),this._southeastChild=void 0,ND(this._northwestChild),this._northwestChild=void 0,ND(this._northeastChild),this._northeastChild=void 0};function ND(e){l(e)&&e.freeResources()}var eF=dl;var _Ei=T(S(),1);function kD(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}kD.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};kD.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Nge(this,t)),t=i}};function Nge(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}kD.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&Nge(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var tF=kD;function hm(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new tF,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new $w({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(hm.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});hm.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function tct(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Uge(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}hm.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==qs.START&&e(t),t=t.replacementNext};hm.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};hm.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};hm.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function Uge(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}hm.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(tct(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Uge(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};hm.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),rct(this,e),pct(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function nct(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=be.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}hm.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(uct(this,e),fct(this,e),nct(this,e))};hm.prototype.isDestroyed=function(){return!1};hm.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var iF,kge=new he;function ict(e,t){let n=ce.center(e.rectangle,kge),i=n.longitude-iF.longitude,o=n.latitude-iF.latitude;n=ce.center(t.rectangle,kge);let r=n.longitude-iF.longitude,s=n.latitude-iF.latitude;return i*i+o*o-(r*r+s*s)}var oct=new m,nF=[];function rct(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles)){let x=r.tilingScheme;if(l(x)){let _=r.tilingScheme;e._levelZeroTiles=eF.createLevelZeroTiles(_);let C=e._levelZeroTiles.length;if(nF.length<C)for(nF=new Array(C),o=0;o<C;++o)nF[o]===void 0&&(nF[o]=new oF)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;iF=t.camera.positionCartographic,a.sort(ict);let d=e._addHeightCallbacks,u=e._removeHeightCallbacks,h=t.frameNumber,p;if(d.length>0||u.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(h,d,u);d.length=0,u.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let f=M.getTranslation(g.transform,oct);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Da(e,s,r,t,c,!1,nF[o]):(l0(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}function l0(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function oF(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Dge(){this.southwest=new oF,this.southeast=new oF,this.northwest=new oF,this.northeast=new oF}Dge.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var j4=new Array(31);for(let e=0;e<j4.length;++e)j4[e]=new Dge;function sct(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=lct(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,d=n.northwestChild,u=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:Kn.NONE,g=e.tileProvider;if(s||i){let f=Kn.originalResult(p)===Kn.RENDERED,x=Kn.originalResult(p)===Kn.CULLED||p===Kn.NONE,_=n.state===qs.DONE,C=f||x||_;if(C||l(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&l0(e,e._tileLoadQueueMedium,n,t),UD(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Kn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&l0(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){UD(e,n),l0(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Kn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.REFINED;let x=e._tilesToRender.length,_=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,V=e._tileLoadQueueHigh.length,L=e._tileToUpdateHeights.length;if(act(e,a,c,d,u,t,i,o),x!==e._tilesToRender.length){let Z=o.allAreRenderable,G=o.anyWereRenderedLastFrame,I=o.notYetRenderableCount,v=!1;if(!Z&&!G){let P=e._tilesToRender;for(let F=x;F<P.length;++F){let b=P[F];for(;b!==void 0&&b._lastSelectionResult!==Kn.KICKED&&b!==n;)b._lastSelectionResult=Kn.kick(b._lastSelectionResult),b=b.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=L,UD(e,n),n._lastSelectionResult=Kn.RENDERED;let w=p===Kn.RENDERED;!w&&I>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=V,l0(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,v=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=w,w||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!v&&l0(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,UD(e,n),l0(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Kn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function act(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,h=j4[t.level],p=h.southwest,g=h.southeast,f=h.northwest,x=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Da(e,t,d,r,u,s,p),Da(e,n,d,r,u,s,g),Da(e,i,d,r,u,s,f),Da(e,o,d,r,u,s,x)):(Da(e,i,d,r,u,s,f),Da(e,t,d,r,u,s,p),Da(e,o,d,r,u,s,x),Da(e,n,d,r,u,s,g)):c.latitude<t.rectangle.north?(Da(e,n,d,r,u,s,g),Da(e,t,d,r,u,s,p),Da(e,o,d,r,u,s,x),Da(e,i,d,r,u,s,f)):(Da(e,o,d,r,u,s,x),Da(e,i,d,r,u,s,f),Da(e,n,d,r,u,s,g),Da(e,t,d,r,u,s,p)),h.combine(a)}function cct(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Da(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==hr.NONE)return sct(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,cct(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&l0(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Kn.NONE;c!==Kn.CULLED_BUT_NEEDED&&c!==Kn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Kn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(l0(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Kn.CULLED):t._lastSelectionResult=Kn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function lct(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof an||t.camera.frustum instanceof Pr)return dct(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=W.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function dct(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),h=d/u;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=W.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function UD(e,t){e._tilesToRender.push(t)}function uct(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=_i()+e._loadQueueTimeSlice,s=e._tileProvider,a=J4(e,t,s,r,n,!1);a=J4(e,t,s,r,i,a),J4(e,t,s,r,o,a)}function mct(e,t){return e._loadPriority-t._loadPriority}function J4(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(mct);for(let s=0,a=o.length;s<a&&(_i()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var YV=new bn,Q4=new he,Vy=new m,hct=[];function fct(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=hct;n.length=0;let i=e._tileToUpdateHeights,o=_i(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let h=i[0];if(!l(h.data)||!l(h.data.mesh)){let x=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:Kn.NONE;(x===Kn.RENDERED||x===Kn.CULLED_BUT_NEEDED)&&n.push(h),i.shift(),e._lastTileIndex=0;continue}let p=h.customData,g=p.length,f=!1;for(u=e._lastTileIndex;u<g;++u){let x=p[u],_=h.data.terrainData,C=l(_)&&_.wasCreatedByUpsampling();if(h.level>x.level&&!C){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=m.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,d)),a===oe.SCENE3D){let L=d.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,YV.direction),Z=d.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,YV.origin);if(!l(Z)){let G=0;l(h.data.tileBoundingRegion)&&(G=h.data.tileBoundingRegion.minimumHeight);let I=Math.min(G,-11500),v=m.multiplyByScalar(L,Math.abs(I)+1,Vy);m.subtract(x.positionOnEllipsoidSurface,v,YV.origin)}}else he.clone(x.positionCartographic,Q4),Q4.height=-11500,c.project(Q4,Vy),m.fromElements(Vy.z,Vy.x,Vy.y,Vy),m.clone(Vy,YV.origin),m.clone(m.UNIT_X,YV.direction);let V=h.data.pick(YV,a,c,!1,Vy);l(V)&&(l(x.callback)&&x.callback(V),x.level=h.level)}if(_i()>=s){f=!0;break}}if(f){e._lastTileIndex=u;break}else e._lastTileIndex=0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function pct(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var rF=hm;function wh(e){e=y(e,ne.default);let t=new Jf({ellipsoid:e}),n=new qw;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new Fw,this._material=void 0,this._surface=new rF({tileProvider:new Qw({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._undergroundColor=B.clone(B.BLACK),this._undergroundColorAlphaByDistance=new kt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new jw,$4(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ze({url:rn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ne.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=W.PI*e.minimumRadius,this.nightFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*W.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=_n.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(wh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&$4(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,$4(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=B.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=kt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function $4(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Pm,qS];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(yE),e._surfaceShaderSet.baseVertexShaderSource=new De({sources:[Pm,qS,xE],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new De({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function bct(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),o=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var gct=[],yct={start:0,stop:0};wh.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=gct;s.length=0;let a=this._surface._tilesToRender,c=a.length,d,u;for(u=0;u<c;++u){d=a[u];let p=d.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=g=le.fromRectangleWithHeights2D(d.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),m.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))le.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let f=jn.raySphere(e,g,yct);l(f)&&s.push(p)}s.sort(bct(e.origin));let h;for(c=s.length,u=0;u<c&&(h=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(h));++u);return h};var xct=new he;wh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==oe.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,xct);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var _ct=new m,Bge=new m,Tct=new he,Sct=new bn;function q4(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}wh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=q4(n._southwestChild,e)||q4(n._southeastChild,e)||q4(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,_ct),d=Sct,u=a.geodeticSurfaceNormal(c,d.direction),h=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(h)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(y(g,0),-11500),x=m.multiplyByScalar(u,Math.abs(f)+1,Bge);m.subtract(c,x,d.origin)}let p=n.data.pick(d,void 0,s,!1,Bge);if(l(p))return a.cartesianToCartographic(p,Tct).height};wh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};wh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let d=this;a.fetchImage().then(function(u){c===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new Wt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===oe.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};wh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};wh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};wh.prototype.isDestroyed=function(){return!1};wh.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),me(this)};var sF=wh;var SXi=T(S(),1);var AIi=T(S(),1);var GIi=T(S(),1);var TIi=T(S(),1);function Cct(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var aF=Cct;var iye={},Vct=32.184,Lct=2451545,Oge=-.0529921,Yge=-.1059842,Hge=13.0120009,zge=13.3407154,Kge=.9856003,Jge=26.4057084,Qge=13.064993,jge=.3287146,qge=1.7484877,$ge=-.1589763,eye=.0036096,tye=.1643573,nye=12.9590088,ej=new q;iye.ComputeMoon=function(e,t){l(e)||(e=q.now()),ej=q.addSeconds(e,Vct,ej);let n=q.totalDays(ej)-Lct,i=n/zn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Oge*n)*W.RADIANS_PER_DEGREE,r=(250.089+Yge*n)*W.RADIANS_PER_DEGREE,s=(260.008+Hge*n)*W.RADIANS_PER_DEGREE,a=(176.625+zge*n)*W.RADIANS_PER_DEGREE,c=(357.529+Kge*n)*W.RADIANS_PER_DEGREE,d=(311.589+Jge*n)*W.RADIANS_PER_DEGREE,u=(134.963+Qge*n)*W.RADIANS_PER_DEGREE,h=(276.617+jge*n)*W.RADIANS_PER_DEGREE,p=(34.226+qge*n)*W.RADIANS_PER_DEGREE,g=(15.134+$ge*n)*W.RADIANS_PER_DEGREE,f=(119.743+eye*n)*W.RADIANS_PER_DEGREE,x=(239.961+tye*n)*W.RADIANS_PER_DEGREE,_=(25.053+nye*n)*W.RADIANS_PER_DEGREE,C=Math.sin(o),V=Math.sin(r),L=Math.sin(s),Z=Math.sin(a),G=Math.sin(c),I=Math.sin(d),v=Math.sin(u),P=Math.sin(h),w=Math.sin(p),F=Math.sin(g),b=Math.sin(f),R=Math.sin(x),E=Math.sin(_),X=Math.cos(o),A=Math.cos(r),N=Math.cos(s),O=Math.cos(a),U=Math.cos(c),Y=Math.cos(d),k=Math.cos(u),H=Math.cos(h),J=Math.cos(p),te=Math.cos(g),z=Math.cos(f),j=Math.cos(x),ee=Math.cos(_),fe=(269.9949+.0031*i-3.8787*C-.1204*V+.07*L-.0172*Z+.0072*I-.0052*F+.0043*E)*W.RADIANS_PER_DEGREE,_e=(66.5392+.013*i+1.5419*X+.0239*A-.0278*N+.0068*O-.0029*Y+9e-4*k+8e-4*te-9e-4*ee)*W.RADIANS_PER_DEGREE,de=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*V-.0642*L+.0158*Z+.0252*G-.0066*I-.0047*v-.0046*P+.0028*w+.0052*F+.004*b+.0019*R-.0044*E)*W.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*X*Oge+.1208*A*Yge-.0642*N*Hge+.0158*O*zge+.0252*U*Kge-.0066*Y*Jge-.0047*k*Qge-.0046*H*jge+.0028*J*qge+.0052*te*$ge+.004*z*eye+.0019*j*tye-.0044*ee*nye)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new aF),t.rightAscension=fe,t.declination=_e,t.rotation=de,t.rotationRate=ye,t};var cF=iye;function oye(e){(!l(e)||typeof e!="function")&&(e=cF.ComputeMoon),this._computeFunction=e}var Rct=new m,Zct=new m,Gct=new m;function Ect(e,t,n){let i=Rct;i.x=Math.cos(e+W.PI_OVER_TWO),i.y=Math.sin(e+W.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=Gct;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=m.cross(r,i,Zct);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var Ict=new $,Xct=new ve;oye.prototype.evaluate=function(e,t){l(e)||(e=q.now());let n=this._computeFunction(e),i=Ect(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=ve.fromAxisAngle(m.UNIT_Z,o,Xct),s=$.fromQuaternion(ve.conjugate(r,r),Ict);return $.multiply(s,i,i)};var lF=oye;var aXi=T(S(),1);var tj={position:0};function DD(e){e=y(e,y.EMPTY_OBJECT),this.center=m.clone(y(e.center,m.ZERO)),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new le,this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=y(e.show,!0),this.material=y(e.material,Hi.fromType(Hi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new qe({owner:y(e._owner,this)}),this._pickCommand=new qe({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function Wct(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Za.createGeometry(Za.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Xe.POSITION_ONLY}));return t=ei.fromGeometry({context:e,geometry:n,attributeLocations:tj,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}DD.prototype.update=function(e){if(!this.show||e.mode!==oe.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?mn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Wct(t));let o=!1,r=this.radii;if(!m.equals(this._radii,r)){m.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!M.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(r),le.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,d=this._useLogDepth!==c;this._useLogDepth=c;let u=this._colorCommand,h,p;(s||a||i||d)&&(h=new De({sources:[jS]}),p=new De({sources:[this.material.shaderSource,QS]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:tj}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=St(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let g=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Ee.TRANSLUCENT:Ee.OPAQUE,g.push(u)),f.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||d)&&(h=new De({sources:[jS]}),p=new De({sources:[this.material.shaderSource,QS],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=en.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:tj}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=St(St(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Ee.TRANSLUCENT:Ee.OPAQUE,g.push(x)}};DD.prototype.isDestroyed=function(){return!1};DD.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var dF=DD;function uF(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=rn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,ne.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new dF({radii:this.ellipsoid.radii,material:Hi.fromType(Hi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new lF}Object.defineProperties(uF.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var BD=new $,Pct=new $,vct=new m,OD=[];uF.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(wt.computeIcrfToFixedMatrix(n,BD))||wt.computeTemeToPseudoFixedMatrix(n,BD);let i=this._axes.evaluate(n,Pct);$.transpose(i,i),$.multiply(BD,i,i);let o=k0.computeMoonPositionInEarthInertialFrame(n,vct);$.multiplyByVector(BD,o,o),M.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=OD,OD.length=0,t.update(e),e.commandList=r,OD.length===1?OD[0]:void 0};uF.prototype.isDestroyed=function(){return!1};uF.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),me(this)};var mF=uF;var mHi=T(S(),1);var VXi=T(S(),1);var nj=[],ij=[];function wct(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=nj,d=ij,u,h;for(u=0;u<s;++u)c[u]=e[i+u];for(h=0;h<a;++h)d[h]=e[o+h+1];u=0,h=0;for(let p=i;p<=r;++p){let g=c[u],f=d[h];u<s&&(h>=a||t(g,f,n)<=0)?(e[p]=g,++u):h<a&&(e[p]=f,++h)}}function oj(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);oj(e,t,n,i,r),oj(e,t,n,r+1,o),wct(e,t,n,i,r,o)}function Fct(e,t,n){let i=e.length,o=Math.ceil(i*.5);nj.length=o,ij.length=o,oj(e,t,n,0,i-1),nj.length=0,ij.length=0}var d0=Fct;var vXi=T(S(),1);function Cc(e,t){this._occluderPosition=m.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var YD=new m;Object.defineProperties(Cc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,YD),n=m.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=m.multiplyByScalar(t,n,YD);let a=o*o*n;s=m.add(e,m.multiplyByScalar(r,a,YD),YD)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Cc.fromBoundingSphere=function(e,t,n){return l(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Cc(e,t)};var sye=new m;Cc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,sye),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var Act=new m;Cc.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,Act),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,sye),o=this._occluderRadius-n;if(o=m.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),o*o+n*n>m.magnitudeSquared(i)):!1;if(o>0){i=m.subtract(t,this._cameraPosition,i);let r=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var Mct=new m;Cc.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return hr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,Mct),o=this._occluderRadius-n,r=m.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return o*o+n*n<s?hr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?hr.FULL:hr.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?hr.PARTIAL:hr.FULL))}}return hr.NONE};var HD=new m;Cc.computeOccludeePoint=function(e,t,n){let i=m.clone(t),o=m.clone(e.center),r=e.radius,s=n.length,a=m.normalize(m.subtract(i,o,HD),HD),c=-m.dot(a,o),d=Cc._anyRotationVector(o,a,c),u=Cc._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let h;for(let g=1;g<s;++g){if(h=Cc._horizonToPlaneNormalDotProduct(e,a,c,d,n[g]),!h)return;h<u&&(u=h)}if(u<.0017453283658983088)return;let p=r/u;return m.add(o,m.multiplyByScalar(a,p,HD),HD)};var Nct=[];Cc.computeOccludeePointFromRectangle=function(e,t){t=y(t,ne.default);let n=ce.subsample(e,t,0,Nct),i=le.fromPoints(n),o=m.ZERO;if(!m.equals(o,i.center))return Cc.computeOccludeePoint(new le(o,t.minimumRadius),i.center,n)};var kct=new m;Cc._anyRotationVector=function(e,t,n){let i=m.abs(t,kct),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new m,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,r),i),e,i),i)};var Uct=new m;Cc._rotationVector=function(e,t,n,i,o){let r=m.subtract(i,e,Uct);if(r=m.normalize(r,r),m.dot(t,r)<.9999999847691291){let s=m.cross(t,r,r);if(m.magnitude(s)>W.EPSILON13)return m.normalize(s,new m)}return o};var rj=new m,Dct=new m,zD=new m,rye=new m;Cc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=m.clone(o,rj),s=m.clone(e.center,Dct),a=e.radius,c=m.subtract(s,r,zD),d=m.magnitudeSquared(c),u=a*a;if(d<u)return!1;let h=d-u,p=Math.sqrt(h),f=1/Math.sqrt(d),_=p*f*p;c=m.normalize(c,c);let C=m.add(r,m.multiplyByScalar(c,_,rye),rye),V=Math.sqrt(h-_*_),L=this._rotationVector(s,t,n,r,i),Z=m.fromElements(L.x*L.x*c.x+(L.x*L.y-L.z)*c.y+(L.x*L.z+L.y)*c.z,(L.x*L.y+L.z)*c.x+L.y*L.y*c.y+(L.y*L.z-L.x)*c.z,(L.x*L.z-L.y)*c.x+(L.y*L.z+L.x)*c.y+L.z*L.z*c.z,rj);Z=m.normalize(Z,Z);let G=m.multiplyByScalar(Z,V,rj);L=m.normalize(m.subtract(m.add(C,G,zD),s,zD),zD);let I=m.dot(t,L);L=m.normalize(m.subtract(m.subtract(C,G,L),s,L),L);let v=m.dot(t,L);return I<v?I:v};var hF=Cc;var JXi=T(S(),1);var BXi=T(S(),1);function qf(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new hs,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function sj(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=M.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=M.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(qf.prototype,{projectionMatrix:{get:function(){return sj(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return sj(this),this._infinitePerspective}}});var Bct=new m,Oct=new m,Yct=new m,Hct=new m;qf.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=m.cross(t,n,Bct),h=Oct;m.multiplyByScalar(t,c,h),m.add(e,h,h);let p=Yct;m.multiplyByScalar(t,d,p),m.add(e,p,p);let g=Hct;m.multiplyByScalar(u,a,g),m.add(h,g,g),m.subtract(g,e,g),m.normalize(g,g),m.cross(g,n,g),m.normalize(g,g);let f=i[0];return l(f)||(f=i[0]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(u,s,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(n,g,g),m.normalize(g,g),f=i[1],l(f)||(f=i[1]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(n,r,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(u,g,g),m.normalize(g,g),f=i[2],l(f)||(f=i[2]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(n,o,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(g,u,g),m.normalize(g,g),f=i[3],l(f)||(f=i[3]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),f=i[4],l(f)||(f=i[4]=new se),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-m.dot(t,h),m.negate(t,g),f=i[5],l(f)||(f=i[5]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,p),this._cullingVolume};qf.prototype.getPixelDimensions=function(e,t,n,i,o){sj(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};qf.prototype.clone=function(e){return l(e)||(e=new qf),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};qf.prototype.equals=function(e){return l(e)&&e instanceof qf&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};qf.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof qf&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var ul=qf;function Ql(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new ul,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}Ql.packedLength=6;Ql.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};Ql.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ql),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Fh(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(Ql.prototype,{projectionMatrix:{get:function(){return Fh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Fh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Fh(this),this._fovy}},sseDenominator:{get:function(){return Fh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Fh(this),this._offCenterFrustum}}});Ql.prototype.computeCullingVolume=function(e,t,n){return Fh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Ql.prototype.getPixelDimensions=function(e,t,n,i,o){return Fh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Ql.prototype.clone=function(e){return l(e)||(e=new Ql),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Ql.prototype.equals=function(e){return!l(e)||!(e instanceof Ql)?!1:(Fh(this),Fh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Ql.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Ql)?!1:(Fh(this),Fh(e),W.equalsEpsilon(this.fov,e.fov,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ri=Ql;var aWi=T(S(),1);function fF(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(fF.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function zct(e,t,n){let i=t.createViewportQuadCommand(oE,{framebuffer:n,renderState:Ue.fromCache({viewport:new ze(0,0,256,256)})});e._drawCommand=i}fF.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Wt({context:t,width:256,height:256,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:$t.NEAREST});this._colorTexture=n;let i=new Wr({context:t,colorTextures:[n],destroyAttachments:!1});zct(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};fF.prototype.isDestroyed=function(){return!1};fF.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),me(this)};var pF=fF;var jWi=T(S(),1);var xWi=T(S(),1);var dye={};function Kct(e,t,n){let i,o,r;if(e instanceof Ri){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof ul)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var Jct=new m,aye=new m;function uye(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(d){let u=n(d);if(d<=.5){let p=(u-o)/a;return W.lerp(e,-W.PI_OVER_TWO,p)}let h=(u-r)/c;return W.lerp(-W.PI_OVER_TWO,t,1-h)}}return function(o){return W.lerp(e,t,o)}}function cj(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,d=e.up,u=e.right,h=e.frustum,p=m.subtract(a,c,Jct),g=m.magnitude(m.multiplyByScalar(d,m.dot(p,d),aye)),f=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),aye));r=Math.min(Kct(h,g,f)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return W.lerp(n,i,a)}}function bF(e,t){return W.equalsEpsilon(e,W.TWO_PI,W.EPSILON11)&&(e=0),t>e+Math.PI?e+=W.TWO_PI:t<e-Math.PI&&(e-=W.TWO_PI),e}var mye=new m;function Qct(e,t,n,i,o,r,s,a){let c=e.camera,d=m.clone(c.position,mye),u=c.pitch,h=bF(c.heading,i),p=bF(c.roll,r),g=cj(c,n,d.z,n.z,s),f=uye(u,o,g,a);function x(_){let C=_.time/t;c.setView({orientation:{heading:W.lerp(h,i,C),pitch:f(C),roll:W.lerp(p,r,C)}}),D.lerp(d,n,C,c.position),c.position.z=g(C)}return x}function jct(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function qct(e,t){let n=e.longitude-t.longitude;n<-W.PI?e.longitude+=W.TWO_PI:n>W.PI&&(t.longitude+=W.TWO_PI)}var $ct=new he,elt=new he;function tlt(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(u.positionCartographic,$ct),f=u.pitch,x=bF(u.heading,i),_=bF(u.roll,r),C=p.cartesianToCartographic(n,elt);g.longitude=W.zeroToTwoPi(g.longitude),C.longitude=W.zeroToTwoPi(C.longitude);let V=!1;if(l(a)){let I=W.zeroToTwoPi(a),v=Math.min(g.longitude,C.longitude),P=Math.max(g.longitude,C.longitude),w=I>=v&&I<=P;if(l(c)){let F=Math.abs(g.longitude-C.longitude),b=W.TWO_PI-F;(w?F:b)<(w?b:F)*c&&!w&&(V=!0)}else w||(V=!0)}V?jct(g,C):qct(g,C);let L=cj(u,n,g.height,C.height,s),Z=uye(f,o,L,d);function G(){let I=g.longitude,v=C.longitude,P=g.latitude,w=C.latitude;return function(b){let R=b.time/t,E=m.fromRadians(W.lerp(I,v,R),W.lerp(P,w,R),L(R),p);u.setView({destination:E,orientation:{heading:W.lerp(x,i,R),pitch:Z(R),roll:W.lerp(_,r,R)}})}}return G()}function nlt(e,t,n,i,o,r,s){let a=e.camera,c=m.clone(a.position,mye),d=bF(a.heading,i),u=a.frustum.right-a.frustum.left,h=cj(a,n,u,n.z,s);function p(g){let f=g.time/t;a.setView({orientation:{heading:W.lerp(d,i,f)}}),D.lerp(c,n,f,a.position);let x=h(f),_=a.frustum,C=_.top/_.right,V=(x-(_.right-_.left))*.5;_.right+=V,_.left-=V,_.top=C*_.right,_.bottom=-_.top}return p}var cye=new he,ilt=new m;function aj(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function lye(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}dye.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===oe.MORPHING)return aj();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,cye),n=r.project(cye,ilt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let f=t.duration;l(f)||(f=Math.ceil(m.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let x=y(t.heading,0),_=y(t.pitch,-W.PI_OVER_TWO),C=y(t.roll,0),V=e.screenSpaceCameraController;V.enableInputs=!1;let L=lye(V,t.complete),Z=lye(V,t.cancel),G=p.frustum,I=e.mode===oe.SCENE2D;if(I=I&&D.equalsEpsilon(p.position,n,W.EPSILON6),I=I&&W.equalsEpsilon(Math.max(G.right-G.left,G.top-G.bottom),n.z,W.EPSILON6),I=I||e.mode!==oe.SCENE2D&&m.equalsEpsilon(n,p.position,W.EPSILON10),I=I&&W.equalsEpsilon(W.negativePiToPi(x),W.negativePiToPi(p.heading),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(_),W.negativePiToPi(p.pitch),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(C),W.negativePiToPi(p.roll),W.EPSILON10),I)return aj(L,Z);let v=new Array(4);if(v[oe.SCENE2D]=nlt,v[oe.SCENE3D]=tlt,v[oe.COLUMBUS_VIEW]=Qct,f<=0)return aj(function(){v[i](e,1,n,x,_,C,a,c,d,u)({time:1}),typeof L=="function"&&L()},Z);let P=v[i](e,f,n,x,_,C,a,c,d,u);if(!l(h)){let w=p.positionCartographic.height,F=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;w>F&&w>11500?h=Hr.CUBIC_OUT:h=Hr.QUINTIC_IN_OUT}return{duration:f,easingFunction:h,startObject:{time:0},stopObject:{time:f},update:P,complete:L,cancel:Z}};var gF=dye;var TWi=T(S(),1),olt={ROTATE:0,INFINITE_SCROLL:1},jl=Object.freeze(olt);function nn(e){this._scene=e,this._transform=M.clone(M.IDENTITY),this._invTransform=M.clone(M.IDENTITY),this._actualTransform=M.clone(M.IDENTITY),this._actualInvTransform=M.clone(M.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new Ri,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new be,this._moveEnd=new be,this._changed=new be,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new M,this._invViewMatrix=new M,_ye(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,W.PI_OVER_TWO)),this._max2Dfrustum=void 0,Wye(this,nn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*nn.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}nn.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);nn.TRANSFORM_2D_INVERSE=M.inverseTransformation(nn.TRANSFORM_2D,new M);nn.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);nn.DEFAULT_VIEW_FACTOR=.5;nn.DEFAULT_OFFSET=new rm(0,-W.PI_OVER_FOUR,0);function _ye(e){M.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),M.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),M.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function rlt(e){if(!l(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=_i()):e.timeSinceMoved=Math.max(_i()-e._lastMovedTimestamp,0)/1e3}}nn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==oe.SCENE2D};nn.prototype._updateCameraChanged=function(){let e=this;if(rlt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%W.TWO_PI;i=i>W.PI?W.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%W.TWO_PI;s=s>W.PI?W.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===oe.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,f=e.frustum,x=e._changedFrustum,_=p.x+f.left,C=p.x+f.right,V=g.x+x.left,L=g.x+x.right,Z=p.y+f.bottom,G=p.y+f.top,I=g.y+x.bottom,v=g.y+x.top,P=Math.max(_,V),w=Math.min(C,L),F=Math.max(Z,I),b=Math.min(G,v),R;if(P>=w||F>=G)R=1;else{let E=x;_<V&&C>L&&Z<I&&G>v&&(E=f),R=1-(w-P)*(b-F)/((E.right-E.left)*(E.top-E.bottom))}R>t&&(e._changed.raiseEvent(R),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let c=W.acosClamped(m.dot(e.directionWC,e._changedDirection)),d;l(e.frustum.fovy)?d=c/(e.frustum.fovy*.5):d=c;let h=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||h>t)&&(e._changed.raiseEvent(Math.max(d,h)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function slt(e){wt.basisTo2D(e._projection,e._transform,e._actualTransform)}var alt=new he,clt=new m,KD=new m,llt=new se,dlt=new se,ult=new se,mlt=new se,hlt=new se;function flt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,llt),o=n.cartesianToCartographic(i,alt),r=t.project(o,clt),s=dlt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,hlt),c=se.add(M.getColumn(e._transform,0,KD),i,KD);n.cartesianToCartographic(c,o),t.project(o,r);let d=ult;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,m.subtract(d,s,d),d.x=0;let u=mlt;if(m.magnitudeSquared(d)>W.EPSILON10)m.cross(a,d,u);else{let h=se.add(M.getColumn(e._transform,1,KD),i,KD);n.cartesianToCartographic(h,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,m.subtract(u,s,u),u.x=0,m.magnitudeSquared(u)<W.EPSILON10&&(se.clone(se.UNIT_Y,d),se.clone(se.UNIT_Z,u))}m.cross(u,a,d),m.normalize(d,d),m.cross(a,d,u),m.normalize(u,u),M.setColumn(e._actualTransform,0,d,e._actualTransform),M.setColumn(e._actualTransform,1,u,e._actualTransform),M.setColumn(e._actualTransform,2,a,e._actualTransform),M.setColumn(e._actualTransform,3,s,e._actualTransform)}var lj=new m;function Lc(e){let t=e._mode,n=!1,i=0;t===oe.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!m.equals(o,e.position)||n;r&&(o=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let c=e._up,d=!m.equals(c,e.up);d&&(m.normalize(e.up,e.up),c=m.clone(e.up,e._up));let u=e._right,h=!m.equals(u,e.right);h&&(m.normalize(e.right,e.right),u=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(nn.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?slt(e):flt(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=M.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=lj;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===oe.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||h){let f=m.dot(s,m.cross(c,u,lj));if(Math.abs(1-f)>W.EPSILON2){let x=1/m.magnitudeSquared(c),_=m.dot(c,s)*x,C=m.multiplyByScalar(s,_,lj);c=m.normalize(m.subtract(c,C,e._up),e._up),m.clone(c,e.up),u=m.cross(s,c,e._right),m.clone(u,e.right)}}(a||p)&&(e._directionWC=M.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=M.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=M.multiplyByPointAsVector(g,u,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(r||a||d||h||p)&&_ye(e)}function Tye(e,t){let n;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)?n=Math.atan2(t.y,t.x)-W.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-W.PI_OVER_TWO,W.TWO_PI-W.zeroToTwoPi(n)}function Sye(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function Cye(e,t,n){let i=0;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=W.zeroToTwoPi(i+W.TWO_PI)),i}var jD=new M,qD=new M;Object.defineProperties(nn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Lc(this),this._invTransform}},viewMatrix:{get:function(){return Lc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Lc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Lc(this),this._positionCartographic}},positionWC:{get:function(){return Lc(this),this._positionWC}},directionWC:{get:function(){return Lc(this),this._directionWC}},upWC:{get:function(){return Lc(this),this._upWC}},rightWC:{get:function(){return Lc(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,jD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,qD);this._setTransform(n);let i=Tye(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,jD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,qD);this._setTransform(n);let i=Sye(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,jD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,qD);this._setTransform(n);let i=Cye(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});nn.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==oe.MORPHING,t=this._mode===oe.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===oe.SCENE2D&&Zye(this,this.position)};var plt=new m,blt=new m,glt=new m;nn.prototype._setTransform=function(e){let t=m.clone(this.positionWC,plt),n=m.clone(this.upWC,blt),i=m.clone(this.directionWC,glt);M.clone(e,this._transform),this._transformChanged=!0,Lc(this);let o=this._actualInvTransform;M.multiplyByPoint(o,t,this.position),M.multiplyByPointAsVector(o,i,this.direction),M.multiplyByPointAsVector(o,n,this.up),m.cross(this.direction,this.up,this.right),Lc(this)};var ylt=new D,xlt=new bn,_lt=new m,Tlt=new m;function Vye(e){if(!M.equals(M.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=ylt;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,xlt);o=n.pickWorldCoordinates(a,t,!0,_lt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,Tlt));let s;if(l(o)||l(r)){let a=l(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}nn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof an&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Vye(this)))};var $D=new m,fj=new M,Slt=new M,pj=new ve,bj=new $,Lye=new he;function Clt(e,t,n){let i=M.clone(e.transform,fj),o=wt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Slt);e._setTransform(o),m.clone(m.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=ve.fromHeadingPitchRoll(n,pj),s=$.fromQuaternion(r,bj);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Vlt(e,t,n,i){let o=M.clone(e.transform,fj);if(e._setTransform(M.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Lye);t=a.project(c,$D)}m.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=ve.fromHeadingPitchRoll(n,pj),s=$.fromQuaternion(r,bj);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Llt(e,t,n,i){let o=M.clone(e.transform,fj);if(e._setTransform(M.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,Lye);t=c.project(d,$D)}D.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===jl.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=ve.fromHeadingPitchRoll(n,pj),s=$.fromQuaternion(r,bj);$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Rlt=new m,Zlt=new m,Glt=new m;function Rye(e,t,n,i){let o=m.clone(n.direction,Rlt),r=m.clone(n.up,Zlt);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,c=wt.eastNorthUpToFixedFrame(t,a,jD),d=M.inverseTransformation(c,qD);M.multiplyByPointAsVector(d,o,o),M.multiplyByPointAsVector(d,r,r)}let s=m.cross(o,r,Glt);return i.heading=Tye(o,r),i.pitch=Sye(o),i.roll=Cye(o,r,s),i}var hj={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},HV=new Va;nn.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===oe.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,m.clone(this.positionWC,$D));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,$D),i=!1),l(t.direction)&&(t=Rye(this,o,t,hj.orientation)),HV.heading=y(t.heading,0),HV.pitch=y(t.pitch,-W.PI_OVER_TWO),HV.roll=y(t.roll,0),n===oe.SCENE3D?Clt(this,o,HV):n===oe.SCENE2D?Llt(this,o,HV,i):Vlt(this,o,HV,i)};var Elt=new m;nn.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:nn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(nn.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*nn.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,Elt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};nn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),Lc(this),M.multiplyByVector(this._actualInvTransform,e,t)};nn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new m),Lc(this),M.multiplyByPoint(this._actualInvTransform,e,t)};nn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new m),Lc(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};nn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),Lc(this),M.multiplyByVector(this._actualTransform,e,t)};nn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new m),Lc(this),M.multiplyByPoint(this._actualTransform,e,t)};nn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new m),Lc(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function Zye(e,t){let n=e._scene.mapMode2D===jl.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var hye=new m;nn.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,hye),m.add(n,hye,n),this._mode===oe.SCENE2D&&Zye(this,n),this._adjustOrthographicFrustum(!0)};nn.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?eB(this,e):this.move(this.direction,e)};nn.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?eB(this,-e):this.move(this.direction,-e)};nn.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};nn.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};nn.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};nn.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};nn.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,-e)};nn.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,e)};nn.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,-e)};nn.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,e)};var Ilt=new ve,Xlt=new $;nn.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=ve.fromAxisAngle(e,-n,Ilt),o=$.fromQuaternion(i,Xlt),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};nn.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};nn.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Wlt=new ve,Plt=new $;nn.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=ve.fromAxisAngle(e,-n,Wlt),o=$.fromQuaternion(i,Plt);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};nn.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),Gye(this,e)};nn.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),Gye(this,-e)};var vlt=new m,wlt=new m,Flt=new m,fye=new m;function Gye(e,t){let n=e.position;if(l(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,W.EPSILON2)){let i=m.normalize(n,vlt),o=m.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=m.equalsEpsilon(i,m.negate(e.constrainedAxis,fye),W.EPSILON2);if(!o&&!r){let s=m.normalize(e.constrainedAxis,wlt),a=m.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=m.dot(i,m.negate(s,fye)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=m.cross(s,i,Flt);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}nn.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),Eye(this,-e)};nn.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),Eye(this,e)};function Eye(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function eB(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===jl.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===jl.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Iye(e,t){e.move(e.direction,t)}nn.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?eB(this,e):Iye(this,e)};nn.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?eB(this,-e):Iye(this,-e)};nn.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return m.magnitude(this.position);if(this._mode===oe.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===oe.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Alt=new M;nn.prototype.lookAt=function(e,t){let n=this._scene,i=y(n.ellipsoid,ne.default),o=wt.eastNorthUpToFixedFrame(e,i,Alt);this.lookAtTransform(o,t)};var Mlt=new m,Nlt=new ve,klt=new ve,Ult=new $;function Xye(e,t,n){t=W.clamp(t,-W.PI_OVER_TWO,W.PI_OVER_TWO),e=W.zeroToTwoPi(e)-W.PI_OVER_TWO;let i=ve.fromAxisAngle(m.UNIT_Y,-t,Nlt),o=ve.fromAxisAngle(m.UNIT_Z,-e,klt),r=ve.multiply(o,i,o),s=$.fromQuaternion(r,Ult),a=m.clone(m.UNIT_X,Mlt);return $.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}nn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=Xye(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){D.clone(D.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<W.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(M.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<W.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var yF=new he,Dlt=new he,Blt=new m,Olt=new m,Ylt=new m,Hlt=new m,zlt=new m,Klt=new m,Jlt=new m,dj=new m,Qlt={direction:new m,right:new m,up:new m},pye;function Vc(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function Wye(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Qlt,{north:s,south:a,west:c}=t,{east:d}=t;c>d&&(d+=W.TWO_PI);let u=(c+d)*.5,h;if(a<-W.PI_OVER_TWO+W.RADIANS_PER_DEGREE&&s>W.PI_OVER_TWO-W.RADIANS_PER_DEGREE)h=0;else{let w=yF;w.longitude=u,w.latitude=s,w.height=0;let F=Dlt;F.longitude=u,F.latitude=a,F.height=0;let b=pye;(!l(b)||b.ellipsoid!==o)&&(pye=b=new Pp(void 0,void 0,o)),b.setEndPoints(w,F),h=b.interpolateUsingFraction(.5,yF).latitude}let p=yF;p.longitude=u,p.latitude=h,p.height=0;let g=o.cartographicToCartesian(p,Jlt),f=yF;f.longitude=d,f.latitude=s;let x=o.cartographicToCartesian(f,Blt);f.longitude=c;let _=o.cartographicToCartesian(f,Ylt);f.longitude=u;let C=o.cartographicToCartesian(f,zlt);f.latitude=a;let V=o.cartographicToCartesian(f,Klt);f.longitude=d;let L=o.cartographicToCartesian(f,Hlt);f.longitude=c;let Z=o.cartographicToCartesian(f,Olt);m.subtract(_,g,_),m.subtract(L,g,L),m.subtract(x,g,x),m.subtract(Z,g,Z),m.subtract(C,g,C),m.subtract(V,g,V);let G=o.geodeticSurfaceNormal(g,r.direction);m.negate(G,G);let I=m.cross(G,m.UNIT_Z,r.right);m.normalize(I,I);let v=m.cross(I,G,r.up),P;if(e.frustum instanceof an){let w=Math.max(m.distance(x,_),m.distance(L,Z)),F=Math.max(m.distance(x,L),m.distance(_,Z)),b,R,E=e.frustum._offCenterFrustum,X=E.right/E.top,A=F*X;w>A?(b=w,R=b/X):(R=F,b=A),P=Math.max(b,R)}else{let w=Math.tan(e.frustum.fovy*.5),F=e.frustum.aspectRatio*w;if(P=Math.max(Vc(G,v,_,w),Vc(G,v,L,w),Vc(G,v,x,w),Vc(G,v,Z,w),Vc(G,v,C,w),Vc(G,v,V,w),Vc(G,I,_,F),Vc(G,I,L,F),Vc(G,I,x,F),Vc(G,I,Z,F),Vc(G,I,C,F),Vc(G,I,V,F)),a<0&&s>0){let b=yF;b.longitude=c,b.latitude=0,b.height=0;let R=o.cartographicToCartesian(b,dj);m.subtract(R,g,R),P=Math.max(P,Vc(G,v,R,w),Vc(G,I,R,F)),b.longitude=d,R=o.cartographicToCartesian(b,dj),m.subtract(R,g,R),P=Math.max(P,Vc(G,v,R,w),Vc(G,I,R,F))}}return m.add(g,m.multiplyByScalar(G,-P,dj),n)}var jlt=new he,qlt=new m,$lt=new m;function edt(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=jlt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,qlt);M.multiplyByPoint(o,a,a),M.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,$lt);if(M.multiplyByPoint(o,c,c),M.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-c.x)/u,(a.y-c.y)/d)*.5}else{let d=a.x-c.x,u=a.y-c.y;n.z=Math.max(d,u)}return n}var tdt=new he,ndt=new m,idt=new m;function odt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===jl.INFINITE_SCROLL?o+=W.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=tdt;r.longitude=o,r.latitude=t.north;let s=i.project(r,ndt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,idt),c=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,h,p=e.frustum.right/e.frustum.top,g=d*p;return c>g?(u=c,h=u/p):(h=d,u=g),d=Math.max(2*u,2*h),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=d,n=i.project(r,n),n}nn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new m),n===oe.SCENE3D)return Wye(this,e,t);if(n===oe.COLUMBUS_VIEW)return edt(this,e,t);if(n===oe.SCENE2D)return odt(this,e,t)};var rdt=new bn;function sdt(e,t,n,i){n=y(n,ne.default);let o=e.getPickRay(t,rdt),r=jn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return bn.getPoint(o,s,i)}var adt=new bn;function cdt(e,t,n,i){let r=e.getPickRay(t,adt).origin;r=m.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var ldt=new bn;function ddt(e,t,n,i){let o=e.getPickRay(t,ldt),r=-o.origin.x/o.direction.x;bn.getPoint(o,r,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}nn.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new m),t=y(t,ne.default),this._mode===oe.SCENE3D)n=sdt(this,e,t,n);else if(this._mode===oe.SCENE2D)n=cdt(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=ddt(this,e,this._projection,n);else return;return n}};var udt=new m,mdt=new m,hdt=new m;function fdt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,h=e.positionWC;m.clone(h,n.origin);let p=m.multiplyByScalar(e.directionWC,c,udt);m.add(h,p,p);let g=m.multiplyByScalar(e.rightWC,d*c*a,mdt),f=m.multiplyByScalar(e.upWC,u*c*s,hdt),x=m.add(p,g,n.direction);return m.add(x,f,x),m.subtract(x,h,x),m.normalize(x,x),n}var JD=new m;function pdt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let d=2/r*(r-t.y)-1;d*=(s.top-s.bottom)*.5;let u=n.origin;return m.clone(e.position,u),m.multiplyByScalar(e.right,c,JD),m.add(JD,u,u),m.multiplyByScalar(e.up,d,JD),m.add(JD,u,u),m.clone(e.directionWC,n.direction),(e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D)&&m.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}nn.prototype.getPickRay=function(e,t){l(t)||(t=new bn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?fdt(this,e,t):pdt(this,e,t)};var bdt=new m,gdt=new m;nn.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,bdt),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),gdt);return Math.max(0,m.magnitude(n)-e.radius)};var ydt=new D;nn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,ydt);return Math.max(o.x,o.y)};function xdt(e,t,n,i,o,r){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let d=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:Hr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var _dt=new m,bye=new m,Tdt=new m,Sdt=new m;function Cdt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(m.UNIT_X,_dt),r=-m.dot(o,n)/m.dot(o,i),s=m.add(n,m.multiplyByScalar(i,r,bye),bye);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Tdt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=m.magnitude(m.subtract(n,s,Sdt)),u=c*d,h=a*d,p=e._maxCoord.x,g=e._maxCoord.y,f=Math.max(u-p,p),x=Math.max(h-g,g);if(n.z<-f||n.z>f||n.y<-x||n.y>x){let _=s.y<-f||s.y>f,C=s.z<-x||s.z>x;if(_||C)return xdt(e,n,s,f,x,t)}}nn.prototype.createCorrectPositionTween=function(e){if(this._mode===oe.COLUMBUS_VIEW)return Cdt(this,e)};var Vdt=new m,$s={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};nn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};nn.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=$s.destination,e.orientation.heading=$s.heading,e.orientation.pitch=$s.pitch,e.orientation.roll=$s.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};nn.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,Vdt));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=Rye(this,t,o,hj.orientation)),l(e.duration)&&e.duration<=0){let u=hj;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;$s.destination=t,$s.heading=o.heading,$s.pitch=o.pitch,$s.roll=o.roll,$s.duration=e.duration,$s.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},$s.cancel=e.cancel,$s.endTransform=e.endTransform,$s.convert=i?!1:e.convert,$s.maximumHeight=e.maximumHeight,$s.pitchAdjustHeight=e.pitchAdjustHeight,$s.flyOverLongitude=e.flyOverLongitude,$s.flyOverLongitudeWeight=e.flyOverLongitudeWeight,$s.easingFunction=e.easingFunction;let a=this._scene,c=gF.createTween(a,$s);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(l(d)||(d=nn.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function Ldt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Rdt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var Zdt=100;function Pye(e,t,n){n=rm.clone(l(n)?n:nn.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=Zdt:e.frustum instanceof an||e._mode===oe.SCENE2D?n.range=Rdt(e,s):n.range=Ldt(e,s),n.range=W.clamp(n.range,i,o)}return n}nn.prototype.viewBoundingSphere=function(e,t){t=Pye(this,e,t),this.lookAt(e.center,t)};var Gdt=new M,Edt=new m,Idt=new m,Xdt=new m,Wdt=new m,Pdt=new se,vdt=new ve,wdt=new $;nn.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=Pye(this,e,t.offset),o;n?o=m.multiplyByScalar(m.UNIT_Z,i.range,Edt):o=Xye(i.heading,i.pitch,i.range);let r=this._scene,s=y(r.ellipsoid,ne.default),a=wt.eastNorthUpToFixedFrame(e.center,s,Gdt);M.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=m.subtract(e.center,o,Idt),m.normalize(c,c),d=M.multiplyByPointAsVector(a,m.UNIT_Z,Xdt),1-Math.abs(m.dot(c,d))<W.EPSILON6){let h=ve.fromAxisAngle(c,i.heading,vdt),p=$.fromQuaternion(h,wdt);m.fromCartesian4(M.getColumn(a,1,Pdt),d),$.multiplyByVector(p,d,d)}let u=m.cross(c,d,Wdt);m.cross(u,c,d),m.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:c,up:d},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var gye=new m,yye=new m,uj=new m,xye=new m,xF=[new m,new m,new m,new m];function Fdt(e,t){let n=t.radii,i=e.positionWC,o=m.multiplyComponents(t.oneOverRadii,i,gye),r=m.magnitude(o),s=m.normalize(o,yye),a,c;m.equalsEpsilon(s,m.UNIT_Z,W.EPSILON10)?(a=new m(0,1,0),c=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,uj),uj),c=m.normalize(m.cross(s,a,xye),xye));let d=Math.sqrt(m.magnitudeSquared(o)-1),u=m.multiplyByScalar(s,1/r,gye),h=d/r,p=m.multiplyByScalar(a,h,yye),g=m.multiplyByScalar(c,h,uj),f=m.add(u,g,xF[0]);m.subtract(f,p,f),m.multiplyComponents(n,f,f);let x=m.subtract(u,g,xF[1]);m.subtract(x,p,x),m.multiplyComponents(n,x,x);let _=m.subtract(u,g,xF[2]);m.add(_,p,_),m.multiplyComponents(n,_,_);let C=m.add(u,g,xF[3]);return m.add(C,p,C),m.multiplyComponents(n,C,C),xF}var mj=new D,Adt=new m,Ly=[new he,new he,new he,new he];function QD(e,t,n,i,o,r){mj.x=e,mj.y=t;let s=i.pickEllipsoid(mj,o,Adt);return l(s)?(Ly[n]=o.cartesianToCartographic(s,Ly[n]),1):(Ly[n]=o.cartesianToCartographic(r[n],Ly[n]),0)}nn.prototype.computeViewRectangle=function(e,t){e=y(e,ne.default);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===zt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=Fdt(this,e);if(c+=QD(0,0,0,this,e,d),c+=QD(0,a,1,this,e,d),c+=QD(s,a,2,this,e,d),c+=QD(s,0,3,this,e,d),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(Ly,t);let u=0,h=Ly[3].longitude;for(let p=0;p<4;++p){let g=Ly[p].longitude,f=Math.abs(g-h);f>W.PI?u+=W.TWO_PI-f:u+=f,h=g}return W.equalsEpsilon(Math.abs(u),W.TWO_PI,W.EPSILON9)&&(t.west=-W.PI,t.east=W.PI,Ly[0].latitude>=0?t.north=W.PI_OVER_TWO:t.south=-W.PI_OVER_TWO),t};nn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof Ri)return;let e=this._scene;this.frustum=new Ri,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60)};nn.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof an)return;let e=Vye(this),t=this._scene;this.frustum=new an,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};nn.clone=function(e,t){return l(t)||(t=new nn(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var ro=nn;var $Wi=T(S(),1);function Mdt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var fm=Mdt;var aPi=T(S(),1);var Mye=T(rd(),1),vye=576,Ndt=100,_F="#ffffff",tB="#48b";function Nye(e,t){this.credit=e,this.count=y(t,1)}function kdt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Ct.equals(o,t))return!0}return!1}function Udt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Ct.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var kye="cesium-credit-delimiter";function wye(e){let t=document.createElement("span");return t.textContent=e,t.className=kye,t}function Fye(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Aye(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(wye(n));else{let u=o[d];u.className!==kye&&e.replaceChild(wye(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(Fye(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(Fye(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Ddt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<vye?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=vye&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Bdt(e){let t=` +`,R&&(Gt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); +`);Gt+=` return color; + }`,it.sources.push(Gt),Be.sources.push(Zrt(de)),Be.sources.push(Irt(G));let gt=$t.fromCache({context:t.context,vertexShaderSource:Be,fragmentShaderSource:it,attributeLocations:te.getAttributeLocations()});Le=ke[xe]=new Rrt(i,xe,this.material,gt,Se,Ie)}return n.surfaceShader=Le,Le.shaderProgram};W4.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return me(this)};var yw=W4;var cGi=T(S(),1);var bSi=T(S(),1),Xrt={NONE:-1,PARTIAL:0,FULL:1},hr=Object.freeze(Xrt);var nCi=T(S(),1);var TSi=T(S(),1);function _D(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}_D.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new _D(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Kf(i)}`),c};_D.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Zo=_D;var CSi=T(S(),1),Wrt={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ci=Object.freeze(Wrt);var LSi=T(S(),1),Prt={START:0,LOADING:1,DONE:2,FAILED:3},qs=Object.freeze(Prt);var ZSi=T(S(),1),vrt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},mo=Object.freeze(vrt);function ir(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=mo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new le,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(ir.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===mo.RECEIVING||e===mo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==ci.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var wrt=new he;function P4(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==oe.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,wrt);s=n.project(c,r),s=m.fromElements(s.z,s.x,s.y,r)}return s}var Frt=new m,Art=new m,Mrt=new m;ir.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,d=a.length,u=Number.MAX_VALUE;for(let h=0;h<d;h+=3){let p=a[h],g=a[h+1],f=a[h+2],x=P4(c,t,n,s,p,Frt),_=P4(c,t,n,s,g,Art),C=P4(c,t,n,s,f,Mrt),V=qn.rayTriangleParametric(e,x,_,C,i);l(V)&&V<u&&V>=0&&(u=V)}return u!==Number.MAX_VALUE?pn.getPoint(e,u,o):void 0};ir.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=mo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};ir.prototype.freeVertexArray=function(){ir._freeVertexArray(this.vertexArray),this.vertexArray=void 0,ir._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};ir.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new ir),e.state===qs.START&&(Nrt(e,t,n),e.state=qs.LOADING)};ir.processStateMachine=function(e,t,n,i,o,r,s){ir.initialize(e,n,i);let a=e.data;if(e.state===qs.LOADING&&krt(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let d=a.terrainState===mo.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let u=a.processImagery(e,n,t);if(d&&u){let h=e._loadedCallbacks,p={};for(let g in h)h.hasOwnProperty(g)&&(h[g](e)||(p[g]=h[g]));e._loadedCallbacks=p,e.state=qs.DONE}c&&(e.renderable=!0)};ir.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,d,u;for(d=0,u=c.length;d<u;++d){let h=c[d];if(!l(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===ci.PLACEHOLDER){let g=h.loadingImagery.imageryLayer;if(g.ready){h.freeResources(),c.splice(d,1),g._createTileImagerySkeletons(e,t,d),--d,u=c.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);a=a&&p,s=s||p||l(h.readyImagery),r=r&&l(h.loadingImagery)&&(h.loadingImagery.state===ci.FAILED||h.loadingImagery.state===ci.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function Q0e(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=Cc.clone(s);c.hasGeodeticSurfaceNormals=t,c=Cc.clone(c);let d=c.stride,u=new Float32Array(a*d);t?s.addGeodeticSurfaceNormals(r,u,n):s.removeGeodeticSurfaceNormals(r,u),o.vertices=u,o.stride=d,o!==e.mesh?(ir._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=ir._createVertexArrayForMesh(i.context,o)):(ir._freeVertexArray(e.vertexArray),e.vertexArray=ir._createVertexArrayForMesh(i.context,o)),ir._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}ir.prototype.addGeodeticSurfaceNormals=function(e,t){Q0e(this,!0,e,t)};ir.prototype.removeGeodeticSurfaceNormals=function(e){Q0e(this,!1,void 0,e)};ir.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,d=c.exaggeration!==r,u=c.exaggerationRelativeHeight!==s;if(d||u){if(d)if(a&&!c.hasGeodeticSurfaceNormals){let h=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(h,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let h=e.customData,p=h.length;for(let g=0;g<p;g++){let f=h[g];f.level=-1}}}};function Nrt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=mo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function krt(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===mo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||ir.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===mo.FAILED&&Urt(s,e,t,n,e.x,e.y,e.level),s.terrainState===mo.UNLOADED&&Drt(s,n,e.x,e.y,e.level),s.terrainState===mo.RECEIVED&&Ort(s,t,n,e.x,e.y,e.level),s.terrainState===mo.TRANSFORMED&&(Yrt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=mo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)zrt(t.context,s);else{let d=s._findAncestorTileWithTerrainData(e);l(d)&&l(d.data.waterMaskTexture)&&(s.waterMaskTexture=d.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,d,s.waterMaskTranslationAndScale))}}function Urt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=qs.FAILED;return}let c=a.data.terrainData,d=a.x,u=a.y,h=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,d,u,h,o,r,s);l(p)&&(e.terrainState=mo.RECEIVING,Promise.resolve(p).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=mo.RECEIVED)}).catch(function(){e.terrainState=mo.FAILED}))}function Drt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=mo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=mo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===jn.CANCELLED){e.terrainData=void 0,e.terrainState=mo.UNLOADED,e.request=void 0;return}e.terrainState=mo.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Zo.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new Ko({throttle:!1,throttleByServer:!0,type:ls.TERRAIN});e.request=c;let d=t.requestTileGeometry(n,i,o,c);l(d)?(e.terrainState=mo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=mo.UNLOADED,e.request=void 0)}a()}var Brt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Ort(e,t,n,i,o,r){let s=n.tilingScheme,a=Brt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let d=e.terrainData.createMesh(a);l(d)&&(e.terrainState=mo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=mo.TRANSFORMED}).catch(function(){e.terrainState=mo.FAILED}))}ir._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=yt.createVertexBuffer({context:e,typedArray:n,usage:Me.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=yt.createIndexBuffer({context:e,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:Ae.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ni({context:e,attributes:o,indexBuffer:s})};ir._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Yrt(e,t,n,i,o,r,s){e.vertexArray=ir._createVertexArrayForMesh(t,e.mesh),e.terrainState=mo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Hrt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Xt.create({context:e,pixelFormat:nt.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR,magnificationFilter:hi.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function zrt(e,t){let n=t.terrainData.waterMask,i=Hrt(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Xt.create({context:e,pixelFormat:nt.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}ir.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};ir.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var um=ir;var wRi=T(S(),1);var FLi=T(S(),1);var ELi=T(S(),1);var e1i=T(S(),1);var dCi=T(S(),1);function Sy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ne.default),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Xi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new D(-i,-i),this._rectangleNortheastInMeters=new D(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(Sy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Sy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Sy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Sy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),o=n.project(ce.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ce(i.x,i.y,o.x,o.y)};Sy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,u=this._rectangleNortheastInMeters.y-t*d,h=this._rectangleNortheastInMeters.y-(t+1)*d;return l(i)?(i.west=a,i.south=h,i.east=c,i.north=u,i):new ce(a,h,c,u)};Sy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new D(o.west,o.south)),a=r.unproject(new D(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};Sy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-h.y,f=p/a|0;f>=o&&(f=o-1);let x=g/d|0;return x>=r&&(x=r-1),l(n)?(n.x=f,n.y=x,n):new D(f,x)};var os=Sy;var pCi=T(S(),1);var v4,j0e="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSFctdVnwhKUPPSRxMpNygUNlP8JmGGUdPJSkOUNGzOjDGJ6_IBw0ZIYb2CxiR6SbKR4hMj3np1HXa_Idxv_txLhu62WcUsFQSTBvq7ktym5DNKxqVmIzBnPljNsM8ff9hCKEXq0LTd8VzkHqjVA7-ig_wg7BqJGg7vUMgG1QseyUAjpmY2OaEv9rA8aeBjRrc.AT1_8nZ92i8c",IV={};IV.defaultAccessToken=j0e;IV.defaultWorldImageryServer=new Ze({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});IV.defaultWorldHillshadeServer=new Ze({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});IV.defaultWorldOceanServer=new Ze({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});IV.getDefaultTokenCredit=function(e){if(e===j0e){if(!l(v4)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';v4=new St(t,!0)}return v4}};var Jd=IV;var TCi=T(S(),1);function w4(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ze.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Lm(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,d=e.pixelsToCheck;for(let u=0,h=d.length;a&&u<h;++u){let p=d[u],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}w4.prototype.isReady=function(){return this._isReady};w4.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Lm(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let d=0;d<4;++d){let u=c+d;if(i[u]!==n[u])return!1}}return!0};var xw=w4;var VCi=T(S(),1);function F4(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}F4.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};F4.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Wh=F4;var ICi=T(S(),1);function XV(){pe.throwInstantiationError()}Object.defineProperties(XV.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}});XV.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};XV.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};XV.prototype.pickFeatures=function(e,t,n,i,o){pe.throwInstantiationError()};var Krt=/\.ktx2$/i;XV.loadImage=function(e,t){let n=Ze.createIfNeeded(t);return Krt.test(n.url)?Vl(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var ul=XV;var WCi=T(S(),1),Jrt={SATELLITE:1,OCEANS:2,HILLSHADE:3},Ph=Object.freeze(Jrt);function q0e(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new zi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new St(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}q0e.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new xw({missingImageUrl:$0e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new D(0,0),new D(200,20),new D(20,200),new D(80,110),new D(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Qrt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new os({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new zi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ae(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Xi,o=e.fullExtent,r=i.unproject(new m(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new ae(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new St(e.copyrightText)]:t.credit=new St(e.copyrightText))}function jrt(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new ae(n)}async function qrt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Qrt(i,t)}catch(i){jrt(e,i)}}function jf(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new zi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new St(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new ge}jf.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case Ph.SATELLITE:{n=y(t.token,Jd.defaultAccessToken),i=Ze.createIfNeeded(Jd.defaultWorldImageryServer),i.appendForwardSlash();let r=Jd.getDefaultTokenCredit(n);l(r)&&(o=St.clone(r))}break;case Ph.OCEANS:{n=y(t.token,Jd.defaultAccessToken),i=Ze.createIfNeeded(Jd.defaultWorldOceanServer),i.appendForwardSlash();let r=Jd.getDefaultTokenCredit(n);l(r)&&(o=St.clone(r))}break;case Ph.HILLSHADE:{n=y(t.token,Jd.defaultAccessToken),i=Ze.createIfNeeded(Jd.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Jd.getDefaultTokenCredit(n);l(r)&&(o=St.clone(r))}break;default:}return jf.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function $0e(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Ei?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(jf.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});jf.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ze.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new jf(t);i._resource=n;let o=new q0e(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await qrt(n,o),o.build(i),i};jf.prototype.getTileCredits=function(e,t,n){return this._tileCredits};jf.prototype.requestImage=function(e,t,n,i){return ul.loadImage(this,$0e(this,e,t,n,i))};jf.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ei)s=W.toDegrees(i),a=W.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,c="3857"}let d="visible";l(this._layers)&&(d+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let g=[],f=p.results;if(!l(f))return g;for(let x=0;x<f.length;++x){let _=f[x],C=new Wh;if(C.data=_,C.name=_.value,C.properties=_.attributes,C.configureDescriptionFromProperties(_.attributes),_.geometryType==="esriGeometryPoint"&&_.geometry){let V=_.geometry.spatialReference&&_.geometry.spatialReference.wkid?_.geometry.spatialReference.wkid:4326;if(V===4326||V===4283)C.position=he.fromDegrees(_.geometry.x,_.geometry.y,_.geometry.z);else if(V===102100||V===900913||V===3857){let L=new Xi;C.position=L.unproject(new m(_.geometry.x,_.geometry.y,_.geometry.z))}}g.push(C)}return g})};jf._metadataCache={};var s0=jf;var T1i=T(S(),1);var n1i=T(S(),1),$rt={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},WV=Object.freeze($rt);var r1i=T(S(),1);function _w(e){}_w.prototype.isReady=function(){return!0};_w.prototype.shouldDiscardImage=function(e){return _w.EMPTY_IMAGE===e};var TD;Object.defineProperties(_w,{EMPTY_IMAGE:{get:function(){return l(TD)||(TD=new Image,TD.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),TD}}});var PV=_w;function ege(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}ege.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof St)break;o.credit=new St(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],d=c.bbox;c.bbox=new ce(W.toRadians(d[1]),W.toRadians(d[0]),W.toRadians(d[3]),W.toRadians(d[2]))}}};function est(e,t){if(e.resourceSets.length!==1)throw new ae("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function tst(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function nst(e,t,n){let i=e.url,o=Xs._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),Xs._metadataCache[i]=o);try{let r=await o;return est(r,t)}catch(r){tst(e,r,n)}}function Xs(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,WV.AERIAL),this._mapLayer=e.mapLayer,this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new PV),this._proxy=e.proxy,this._credit=new St(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Xs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new os({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new ge}Object.defineProperties(Xs.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});Xs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,WV.AERIAL),o=Ze.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Xs(t);a._resource=o;let c=new ege(t);return await nst(s,c),c.build(a),a};var ist=new ce;Xs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,ist);return sst(this._attributionList,n,i)};Xs.prototype.requestImage=function(e,t,n,i){let o=ul.loadImage(this,ost(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?PV.EMPTY_IMAGE:Promise.reject(r)})};Xs.prototype.pickFeatures=function(e,t,n,i,o){};Xs.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};Xs.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};Xs._logoUrl=void 0;Object.defineProperties(Xs,{logoUrl:{get:function(){return l(Xs._logoUrl)||(Xs._logoUrl=nn("Assets/Images/bing_maps_credit.png")),Xs._logoUrl},set:function(e){Xs._logoUrl=e}}});function ost(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:Xs.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var rst=new ce;function sst(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let d=0,u=s.coverageAreas.length;!c&&d<u;++d){let h=a[d];if(t>=h.zoomMin&&t<=h.zoomMax){let p=ce.intersection(n,h.bbox,rst);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Xs._metadataCache={};var Tw=Xs;var q1i=T(S(),1);var A1i=T(S(),1);var tge=/{[^}]+}/g,nge={x:dst,y:mst,z:pst,s:bst,reverseX:ust,reverseY:hst,reverseZ:fst,westDegrees:gst,southDegrees:yst,eastDegrees:xst,northDegrees:_st,westProjected:Tst,southProjected:Sst,eastProjected:Cst,northProjected:Vst,width:Lst,height:Rst},ast=Tt(nge,{i:Zst,j:Gst,reverseI:Est,reverseJ:Ist,longitudeDegrees:Wst,latitudeDegrees:Pst,longitudeProjected:vst,latitudeProjected:wst,format:Ast});function Sw(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new ge;let t=Ze.createIfNeeded(e.url),n=Ze.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new os({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new St(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=Tt(nge,r),a=Tt(ast,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(Sw.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});Sw.prototype.getTileCredits=function(e,t,n){};Sw.prototype.requestImage=function(e,t,n,i){return ul.loadImage(this,cst(this,e,t,n,i))};Sw.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=lst(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(c):d.type==="xml"?u.fetchXML().then(d.callback).catch(c):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(c):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(c)}return c()};var SD=!1,Qd=new ce,CD=!1,Cw=new ce;function cst(e,t,n,i,o){SD=!1,CD=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(tge);return l(d)&&d.forEach(function(u){let h=u.substring(1,u.length-1);l(a[h])&&(c[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var A4=!1,wV=new D,M4=!1;function lst(e,t,n,i,o,r,s){SD=!1,CD=!1,A4=!1,M4=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},h=c.match(tge);return l(h)&&h.forEach(function(p){let g=p.substring(1,p.length-1);l(d[g])&&(u[g]=d[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function FV(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function dst(e,t,n,i){return FV(e,"{x}",t)}function ust(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return FV(e,"{reverseX}",o)}function mst(e,t,n,i){return FV(e,"{y}",n)}function hst(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return FV(e,"{reverseY}",o)}function fst(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return FV(e,"{reverseZ}",r)}function pst(e,t,n,i){return FV(e,"{z}",i)}function bst(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function VD(e,t,n,i){SD||(e.tilingScheme.tileXYToRectangle(t,n,i,Qd),Qd.west=W.toDegrees(Qd.west),Qd.south=W.toDegrees(Qd.south),Qd.east=W.toDegrees(Qd.east),Qd.north=W.toDegrees(Qd.north),SD=!0)}function gst(e,t,n,i){return VD(e,t,n,i),Qd.west}function yst(e,t,n,i){return VD(e,t,n,i),Qd.south}function xst(e,t,n,i){return VD(e,t,n,i),Qd.east}function _st(e,t,n,i){return VD(e,t,n,i),Qd.north}function LD(e,t,n,i){CD||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,Cw),CD=!0)}function Tst(e,t,n,i){return LD(e,t,n,i),Cw.west}function Sst(e,t,n,i){return LD(e,t,n,i),Cw.south}function Cst(e,t,n,i){return LD(e,t,n,i),Cw.east}function Vst(e,t,n,i){return LD(e,t,n,i),Cw.north}function Lst(e,t,n,i){return e.tileWidth}function Rst(e,t,n,i){return e.tileHeight}function Zst(e,t,n,i,o,r,s){return RD(e,t,n,i,o,r),wV.x}function Gst(e,t,n,i,o,r,s){return RD(e,t,n,i,o,r),wV.y}function Est(e,t,n,i,o,r,s){return RD(e,t,n,i,o,r),e.tileWidth-wV.x-1}function Ist(e,t,n,i,o,r,s){return RD(e,t,n,i,o,r),e.tileHeight-wV.y-1}var Xst=new ce,vV=new m;function RD(e,t,n,i,o,r,s){if(A4)return;N4(e,t,n,i,o,r);let a=vV,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Xst);wV.x=e.tileWidth*(a.x-c.west)/c.width|0,wV.y=e.tileHeight*(c.north-a.y)/c.height|0,A4=!0}function Wst(e,t,n,i,o,r,s){return W.toDegrees(o)}function Pst(e,t,n,i,o,r,s){return W.toDegrees(r)}function vst(e,t,n,i,o,r,s){return N4(e,t,n,i,o,r),vV.x}function wst(e,t,n,i,o,r,s){return N4(e,t,n,i,o,r),vV.y}var Fst=new he;function N4(e,t,n,i,o,r,s){if(!M4){if(e.tilingScheme.projection instanceof Ei)vV.x=W.toDegrees(o),vV.y=W.toDegrees(r);else{let a=Fst;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,vV)}M4=!0}}function Ast(e,t,n,i,o,r,s){return s}var Da=Sw;function mm(e){Da.call(this,e)}mm._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return mm._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof jh)return mm._metadataFailure(e,t);throw o}};mm.fromUrl=async function(e,t){let n=Ze.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let r=await mm._requestMetadata(t,i,o);return new mm(r)};l(Object.create)&&(mm.prototype=Object.create(Da.prototype),mm.prototype.constructor=mm);function ige(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function oge(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),o=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}mm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,h,p=[],g=e.childNodes[0].childNodes;for(let P=0;P<g.length;P++)if(r.test(g.item(P).nodeName))d=g.item(P);else if(a.test(g.item(P).nodeName)){h=g.item(P);let w=g.item(P).childNodes;for(let F=0;F<w.length;F++)s.test(w.item(F).nodeName)&&p.push(w.item(F))}else c.test(g.item(P).nodeName)&&(u=g.item(P));let f;if(!l(h)||!l(u))throw f=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Zo.reportError(void 0,o,o.errorEvent,f),new ae(f);let x=y(t.fileExtension,d.getAttribute("extension")),_=y(t.tileWidth,parseInt(d.getAttribute("width"),10)),C=y(t.tileHeight,parseInt(d.getAttribute("height"),10)),V=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),L=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),Z=h.getAttribute("profile"),G=t.tilingScheme;if(!l(G))if(Z==="geodetic"||Z==="global-geodetic")G=new zi({ellipsoid:t.ellipsoid});else if(Z==="mercator"||Z==="global-mercator")G=new os({ellipsoid:t.ellipsoid});else throw f=`${i.url} specifies an unsupported profile attribute, ${Z}.`,l(o)&&Zo.reportError(void 0,o,o.errorEvent,f),new ae(f);let I=ce.clone(t.rectangle);if(!l(I)){let P,w,F,b;y(t.flipXY,!1)?(F=new D(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),b=new D(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(F=new D(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),b=new D(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let E=Z==="geodetic"||Z==="mercator";if(G.projection instanceof Ei||E)P=he.fromDegrees(F.x,F.y),w=he.fromDegrees(b.x,b.y);else{let X=G.projection;P=X.unproject(F),w=X.unproject(b)}I=new ce(P.longitude,P.latitude,w.longitude,w.latitude)}return I=ige(I,G),V=oge(G,I,V),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:G,rectangle:I,tileWidth:_,tileHeight:C,minimumLevel:V,maximumLevel:L,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};mm._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),o=y(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new os({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=ige(a,s);let c=oge(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Cy=mm;var mVi=T(S(),1);function rge(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}rge.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Mst(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new ae(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ae(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new zi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new os({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ae(o)}return!0}function Nst(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function kst(e,t,n){try{let i=await e.fetchText();Mst(i,t)}catch(i){Nst(i,e,n)}}function Ql(e){e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new St(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Ql.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new ge}Object.defineProperties(Ql.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Ql.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=Ze.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new rge(n);s.channel=t,await kst(r,s);let a=new Ql(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Ql.prototype.getTileCredits=function(e,t,n){};Ql.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return ul.loadImage(this,o)};Ql.prototype.pickFeatures=function(e,t,n,i,o){};Ql._logoUrl=void 0;Object.defineProperties(Ql,{logoUrl:{get:function(){return l(Ql._logoUrl)||(Ql._logoUrl=nn("Assets/Images/google_earth_credit.png")),Ql._logoUrl},set:function(e){Ql._logoUrl=e}}});var Vw=Ql;var xVi=T(S(),1);var Ust=/\/$/,sge=new St('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function AV(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ze.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Ust.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new St(s))):s=sge,this._resource=i,this._imageryProvider=new Da({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(AV.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});AV.prototype.getTileCredits=function(e,t,n){};AV.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};AV.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};AV._defaultCredit=sge;var Lw=AV;var XVi=T(S(),1);function ET(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,ce.MAX_VALUE),n=new zi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new ge;let i=e.credit;typeof i=="string"&&(i=new St(i)),this._credit=i;let o=Ze.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(ET.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function Dst(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Zo.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return k4(e,n,r);throw l(n)&&(n._hasError=!0),new ae(o)}async function k4(e,t,n){try{return await ul.loadImage(null,e)}catch(i){return Dst(e,i,t,n)}}ET.fromUrl=async function(e,t){let n=Ze.createIfNeeded(e),i=await k4(n);t=y(t,y.EMPTY_OBJECT);let o=new ET({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};ET.prototype.getTileCredits=function(e,t,n){};ET.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await k4(this._resource,this);return this._image=o,Zo.reportSuccess(this._errorEvent),o}return this._image};ET.prototype.pickFeatures=function(e,t,n,i,o){};var Rw=ET;var tLi=T(S(),1);var AVi=T(S(),1);function Bst(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Ost:e==="xml"?n=Kst:(e==="html"||e==="text")&&(n=age)),this.callback=n}function Ost(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Wh;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=he.fromDegrees(s,a)}t.push(r)}return t}var U4="http://www.mapinfo.com/mxp",Yst="http://www.esri.com/wms",Hst="http://www.opengis.net/wfs",zst="http://www.opengis.net/gml";function Kst(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===U4)return Jst(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Yst)return Qst(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Hst)return jst(e);if(t.localName==="ServiceExceptionReport")throw new ae(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?qst(e):$st(e)}function Jst(e){let t=[],i=e.documentElement.getElementsByTagNameNS(U4,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(U4,"Val");for(let d=0;d<a.length;++d){let u=a[d];if(u.hasAttribute("ref")){let h=u.getAttribute("ref"),p=u.textContent.trim();s[h]=p}}let c=new Wh;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Qst(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let d=a[c];i[d.name]=d.value}n.push(ZD(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let d=0;d<c.length;++d){let u=c[d];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push(ZD(a,i))}}return n}function jst(e){let t=[],i=e.documentElement.getElementsByTagNameNS(zst,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};D4(r,s),t.push(ZD(r,s))}return t}function qst(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new ae("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};D4(s,a),t.push(ZD(s,a))}}return t}function D4(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&D4(o,t)&&(t[o.localName]=o.textContent)}return n}function ZD(e,t){let n=new Wh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function $st(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Wh;return o.data=e,o.description=n.innerHTML,[o]}var eat=/<body>\s*<\/body>/im,tat=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,nat=/<title>([\s\S]*)<\/title>/im;function age(e){if(eat.test(e)||tat.test(e))return;let t,n=nat.exec(e);n&&n.length>1&&(t=n[1]);let i=new Wh;return i.name=t,i.description=e,i.data=e,[i]}var IT=Bst;var OVi=T(S(),1);function Zw(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(Zw.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});Zw.prototype.getFromCache=function(e,t,n,i){let o=cge(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};Zw.prototype.checkApproachingInterval=function(e,t,n,i){let o=cge(e,t,n),r=this._tilesRequestedForInterval,s=lge(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!dge(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};Zw.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=lge(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=dge(this,c,r),a||s.push(c)}}};function cge(e,t,n){return`${e}-${t}-${n}`}function iat(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function lge(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=q.secondsDifference(c.stop,i),++a):(s=q.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function dge(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=iat(s),c=new Ko({throttle:!1,throttleByServer:!0,type:ls.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(d)?(r[s]={promise:d,request:c},!0):!1}var XT=Zw;var oat=[3034,3035,3042,3043,3044],rat=[4471,4559];function vh(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new pe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=Ze.createIfNeeded(e.url),n=Ze.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(vh.DefaultParameters,!0),n.setQueryParameters(vh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(uge(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(uge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new XT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return mge(i,s,a,c,d,u)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Xi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!rat.includes(a)||oat.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Xi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Da({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new zi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,vh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function mge(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function sat(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(vh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});vh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};vh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=mge(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};vh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return sat(this,e,t,n,i,o,s)};vh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});vh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});vh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new IT("json","application/json")),Object.freeze(new IT("xml","text/xml")),Object.freeze(new IT("text","text/html"))]);function uge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var Gw=vh;var hLi=T(S(),1);var aat=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function Ew(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Ze.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(aat),this._useKvp=!0;else{let h={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(h),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new os({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new XT({clock:e.clock,times:e.times,requestImageFunction:function(h,p,g,f,x){return hge(s,h,p,g,f,x)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new ge;let u=e.credit;this._credit=typeof u=="string"?new St(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function hge(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,d=e._dimensions,u=l(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),l(d)&&h.setTemplateValues(d),l(u)&&h.setTemplateValues(u);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(d)&&(g=Tt(g,d)),l(u)&&(g=Tt(g,u)),p={s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({queryParameters:g,request:o}),h.setTemplateValues(p)}return ul.loadImage(e,h)}Object.defineProperties(Ew.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}}});Ew.prototype.getTileCredits=function(e,t,n){};Ew.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=hge(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Ew.prototype.pickFeatures=function(e,t,n,i,o){};var Iw=Ew;var cat={ARCGIS_MAPSERVER:s0.fromUrl,BING:async(e,t)=>Tw.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,Vw.fromUrl(e,n,t)},MAPBOX:(e,t)=>new Lw({url:e,...t}),SINGLE_TILE:Rw.fromUrl,TMS:Cy.fromUrl,URL_TEMPLATE:(e,t)=>new Da({url:e,...t}),WMS:(e,t)=>new Gw({url:e,...t}),WMTS:(e,t)=>new Iw({url:e,...t})};function qf(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new ge}Object.defineProperties(qf.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});qf.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=yd._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=qf._endpointCache[i];l(o)||(o=n.fetchJson(),qf._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ae(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await Cy.fromUrl(new yd(r,n));else{let d=cat[a];if(!l(d))throw new ae(`Unrecognized Cesium ion imagery type: ${a}`);let u={...r.options},h=u.url;delete u.url,s=await d(h,u)}let c=new qf(t);return s.errorEvent.addEventListener(function(d){d.provider=c,c._errorEvent.raiseEvent(d)}),c._tileCredits=yd.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};qf.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};qf.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};qf.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};qf._endpointCache={};var a0=qf;var XLi=T(S(),1),lat={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},c0=Object.freeze(lat);function dat(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,c0.AERIAL);return a0.fromAssetId(t)}var l0=dat;var MLi=T(S(),1),Xw=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = texture(u_texture, v_textureCoordinates); +} +`;var kLi=T(S(),1),Ww=`in vec4 position; +in float webMercatorT; + +uniform vec2 u_textureDimensions; + +out vec2 v_textureCoordinates; + +void main() +{ + v_textureCoordinates = vec2(position.x, webMercatorT); + gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); +} +`;var YLi=T(S(),1);function MV(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ci.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}MV.createPlaceholder=function(e){let t=new MV(e,0,0,0);return t.addReference(),t.state=ci.PLACEHOLDER,t};MV.prototype.addReference=function(){++this.referenceCount};MV.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),me(this),0):this.referenceCount};MV.prototype.processStateMachine=function(e,t,n){this.state===ci.UNLOADED&&!n&&(this.state=ci.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ci.RECEIVED&&(this.state=ci.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ci.READY&&t&&!this.texture;(this.state===ci.TEXTURE_LOADED||i)&&(this.state=ci.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var NV=MV;var JLi=T(S(),1);function B4(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}B4.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};B4.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ci.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==ci.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==ci.FAILED&&r.state!==ci.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ci.FAILED||i.state===ci.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var kV=B4;function Si(e,t){this._imageryProvider=e,this._readyEvent=new ge,this._errorEvent=new ge,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,Si.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,Si.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,Si.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,Si.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,Si.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,Si.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,Si.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,Si.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ce.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new kV(NV.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,Si.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(Si.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Si.DEFAULT_BRIGHTNESS=1;Si.DEFAULT_CONTRAST=1;Si.DEFAULT_HUE=0;Si.DEFAULT_SATURATION=1;Si.DEFAULT_GAMMA=1;Si.DEFAULT_SPLIT=vr.NONE;Si.DEFAULT_MINIFICATION_FILTER=jt.LINEAR;Si.DEFAULT_MAGNIFICATION_FILTER=hi.LINEAR;Si.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Si.fromProviderAsync=function(e,t){let n=new Si(void 0,t);return pat(n,Promise.resolve(e)),n};Si.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),Si.fromProviderAsync(l0({style:e.style}),e)};Si.prototype.isBaseLayer=function(){return this._isBaseLayer};Si.prototype.isDestroyed=function(){return!1};Si.prototype.destroy=function(){return me(this)};var bge=new ce,fge=new ce,O4=new ce,gge=new ce;Si.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};Si.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Xi&&e.rectangle.north<Xi.MaximumLatitude&&e.rectangle.south>-Xi.MaximumLatitude,s=ce.intersection(o.rectangle,this._rectangle,bge),a=ce.intersection(e.rectangle,s,fge);if(!l(a)){if(!this.isBaseLayer())return!1;let E=s,X=e.rectangle;a=fge,X.south>=E.north?a.north=a.south=E.north:X.north<=E.south?a.north=a.south=E.south:(a.south=Math.max(X.south,E.south),a.north=Math.min(X.north,E.north)),X.west>=E.east?a.west=a.east=E.east:X.east<=E.west?a.west=a.east=E.west:(a.west=Math.max(X.west,E.west),a.east=Math.min(X.east,E.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),h=hat(this,u,c);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),l(o.minimumLevel)){let E=o.minimumLevel;h<E&&(h=E)}let g=o.tilingScheme,f=g.positionToTileXY(ce.northwest(a),h),x=g.positionToTileXY(ce.southeast(a),h),_=e.rectangle.width/512,C=e.rectangle.height/512,V=g.tileXYToRectangle(f.x,f.y,h);Math.abs(V.south-e.rectangle.north)<C&&f.y<x.y&&++f.y,Math.abs(V.east-e.rectangle.west)<_&&f.x<x.x&&++f.x;let L=g.tileXYToRectangle(x.x,x.y,h);Math.abs(L.north-e.rectangle.south)<C&&x.y>f.y&&--x.y,Math.abs(L.west-e.rectangle.east)<_&&x.x>f.x&&--x.x;let Z=ce.clone(e.rectangle,gge),G=g.tileXYToRectangle(f.x,f.y,h),I=ce.intersection(G,s,O4),v;r?(g.rectangleToNativeRectangle(Z,Z),g.rectangleToNativeRectangle(G,G),g.rectangleToNativeRectangle(I,I),g.rectangleToNativeRectangle(s,s),v=g.tileXYToNativeRectangle.bind(g),_=Z.width/512,C=Z.height/512):v=g.tileXYToRectangle.bind(g);let P,w=0,F=1,b;!this.isBaseLayer()&&Math.abs(I.west-Z.west)>=_&&(w=Math.min(1,(I.west-Z.west)/Z.width)),!this.isBaseLayer()&&Math.abs(I.north-Z.north)>=C&&(F=Math.max(0,(I.north-Z.south)/Z.height));let R=F;for(let E=f.x;E<=x.x;E++)if(P=w,G=v(E,f.y,h),I=ce.simpleIntersection(G,s,O4),!!l(I)){w=Math.min(1,(I.east-Z.west)/Z.width),E===x.x&&(this.isBaseLayer()||Math.abs(I.east-Z.east)<_)&&(w=1),F=R;for(let X=f.y;X<=x.y;X++){if(b=F,G=v(E,X,h),I=ce.simpleIntersection(G,s,O4),!l(I))continue;F=Math.max(0,(I.south-Z.south)/Z.height),X===x.y&&(this.isBaseLayer()||Math.abs(I.south-Z.south)<C)&&(F=0);let A=new se(P,F,w,b),N=this.getImageryFromCache(E,X,h);i.imagery.splice(n,0,new kV(N,A,r)),++n}}return!0};Si.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,bge),i=c.rectangleToNativeRectangle(i,gge)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new se(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Si.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=ci.RECEIVED,e.request=void 0,Zo.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===jn.CANCELLED){e.state=ci.UNLOADED,e.request=void 0;return}e.state=ci.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Zo.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Ko({throttle:!1,throttleByServer:!0,type:ls.IMAGERY});e.request=s,e.state=ci.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=ci.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Si.prototype._createTextureWebGL=function(e,t){let n=new qt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Xt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Xt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?nt.RGBA:nt.RGB,sampler:n})};Si.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=ci.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ci.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Xi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ci.TEXTURE_LOADED};function pge(e,t,n){return`${e}:${t}:${n}`}Si.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===jt.LINEAR&&i===hi.LINEAR&&!nt.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=jt.LINEAR_MIPMAP_LINEAR;let r=Ft.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=pge(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(sf.NICEST),t.sampler=d}else{let r=pge(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Si.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Ei)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new vc({persists:!0,owner:this,preExecute:function(c){mat(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ci.READY,t.releaseReference()},canceled:function(){t.state=ci.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ci.READY};Si.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Si.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Si.prototype.getImageryFromCache=function(e,t,n,i){let o=yge(e,t,n),r=this._imageryCache[o];return l(r)||(r=new NV(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Si.prototype.removeImageryFromCache=function(e){let t=yge(e.x,e.y,e.level);delete this._imageryCache[t]};function yge(e,t,n){return JSON.stringify([e,t,n])}var GD={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new D,texture:void 0},uat=Bt.supportsTypedArrays()?new Float32Array(2*64):void 0;function mat(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let _=new Float32Array(2*64*2),C=0;for(let I=0;I<64;++I){let v=I/63;_[C++]=0,_[C++]=v,_[C++]=1,_[C++]=v}let V={position:0,webMercatorT:1},L=is.getRegularGridIndices(2,64),Z=yt.createIndexBuffer({context:t,typedArray:L,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});o.vertexArray=new ni({context:t,attributes:[{index:V.position,vertexBuffer:yt.createVertexBuffer({context:t,typedArray:_,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:V.webMercatorT,vertexBuffer:yt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:Z});let G=new De({sources:[Ww]});o.shaderProgram=$t.fromCache({context:t,vertexShaderSource:G,fragmentShaderSource:Xw,attributeLocations:V}),o.sampler=new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR,magnificationFilter:hi.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;GD.textureDimensions.x=r,GD.textureDimensions.y=s,GD.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-c),h=new Xt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});W.isPowerOfTwo(r)&&W.isPowerOfTwo(s)&&h.generateMipmap(sf.NICEST);let p=i.south,g=i.north,f=uat,x=0;for(let _=0;_<64;++_){let C=_/63,V=W.lerp(p,g,C);a=Math.sin(V);let Z=(.5*Math.log((1+a)/(1-a))-c)*u;f[x++]=Z,f[x++]=Z}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=GD,e.vertexArray=o.vertexArray}function hat(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ei?1:Math.cos(n),a=o.rectangle,d=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(d)/Math.log(2);return Math.round(u)|0}function fat(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function pat(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){fat(e._errorEvent,i)}}var Ba=Si;var aZi=T(S(),1);var ARi=T(S(),1),bat={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=bat;var NRi=T(S(),1),xge={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=xge.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Jn=xge;function DV(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}DV.prototype.update=function(e,t,n){this.changedThisFrame&&(Rge(e,t,this.tile,n),this.changedThisFrame=!1)};DV.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};DV.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):um._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var gat=new pg;DV.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=gat;a.clear();for(let d=0;d<t.length;++d){let u=t[d];l(u.data.vertexArray)&&a.enqueue(t[d])}let c=a.dequeue();for(;c!==void 0;){let d=c.findTileToWest(r),u=c.findTileToSouth(r),h=c.findTileToEast(r),p=c.findTileToNorth(r);Ws(e,n,c,d,s,yn.EAST,!1,a,i),Ws(e,n,c,u,s,yn.NORTH,!1,a,i),Ws(e,n,c,h,s,yn.WEST,!1,a,i),Ws(e,n,c,p,s,yn.SOUTH,!1,a,i);let g=d.findTileToNorth(r),f=d.findTileToSouth(r),x=h.findTileToNorth(r),_=h.findTileToSouth(r);Ws(e,n,c,g,s,yn.SOUTHEAST,!1,a,i),Ws(e,n,c,x,s,yn.SOUTHWEST,!1,a,i),Ws(e,n,c,f,s,yn.NORTHEAST,!1,a,i),Ws(e,n,c,_,s,yn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Ws(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||Jn.wasKicked(d._lastSelectionResult)||Jn.originalResult(d._lastSelectionResult)===Jn.CULLED);){if(s)return;let u=d.parent;if(r>=yn.NORTHWEST&&u!==void 0)switch(r){case yn.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case yn.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case yn.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case yn.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===Jn.RENDERED){if(l(d.data.vertexArray))return;yat(e,t,n,d,r,o,a,c);return}if(Jn.originalResult(i._lastSelectionResult)!==Jn.CULLED)switch(r){case yn.WEST:Ws(e,t,n,i.northwestChild,o,r,!0,a,c),Ws(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.EAST:Ws(e,t,n,i.southeastChild,o,r,!0,a,c),Ws(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTH:Ws(e,t,n,i.southwestChild,o,r,!0,a,c),Ws(e,t,n,i.southeastChild,o,r,!0,a,c);break;case yn.NORTH:Ws(e,t,n,i.northeastChild,o,r,!0,a,c),Ws(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHWEST:Ws(e,t,n,i.northwestChild,o,r,!0,a,c);break;case yn.NORTHEAST:Ws(e,t,n,i.northeastChild,o,r,!0,a,c);break;case yn.SOUTHWEST:Ws(e,t,n,i.southwestChild,o,r,!0,a,c);break;case yn.SOUTHEAST:Ws(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new pe("Invalid edge")}}}function yat(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new DV(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),xat(e,t,n,i,o,a)}function xat(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(Rge(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case yn.WEST:d=s.westMeshes,u=s.westTiles;break;case yn.SOUTH:d=s.southMeshes,u=s.southTiles;break;case yn.EAST:d=s.eastMeshes,u=s.eastTiles;break;case yn.NORTH:d=s.northMeshes,u=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||d[0]!==a||d.length!==1,d[0]=a,u[0]=n,d.length=1,u.length=1;return}let h,p,g,f,x=n.rectangle,_,C=i.rectangle;switch(o){case yn.WEST:for(_=(C.north-C.south)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.greaterThan(x.north,f.south,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.greaterThanOrEquals(x.south,f.north,_));++p);break;case yn.SOUTH:for(_=(C.east-C.west)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.lessThan(x.west,f.east,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.lessThanOrEquals(x.east,f.west,_));++p);break;case yn.EAST:for(_=(C.north-C.south)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.lessThan(x.south,f.north,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.lessThanOrEquals(x.north,f.south,_));++p);break;case yn.NORTH:for(_=(C.east-C.west)*W.EPSILON5,h=0;h<u.length&&(g=u[h],f=g.rectangle,!W.greaterThan(x.east,f.west,_));++h);for(p=h;p<u.length&&(g=u[p],f=g.rectangle,!W.greaterThanOrEquals(x.west,f.east,_));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||d[h]!==a,d[h]=a,u[h]=n):(s.changedThisFrame=!0,d.splice(h,p-h,a),u.splice(h,p-h,n))}var WT=new he,_at=new he,UV=new m,K4=new m,Y4=new D,H4=new D,jd=new D;function wD(){this.height=0,this.encodedNormal=new D}function ED(e,t,n,i,o,r,s,a,c){if(l(o))return o;let d;if(l(r)&&l(s))d=(r.height+s.height)*.5;else if(l(r))d=r.height;else if(l(s))d=s.height;else if(l(a))d=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,g=0;l(h)&&(p=h.minimumHeight,g=h.maximumHeight),d=(p+g)*.5}return Zge(e,t,n,i,d,c),c}var Tat={minimumHeight:0,maximumHeight:0},Sat=new m,_ge=new wD,Tge=new wD,Sge=new wD,Cge=new wD,Cat=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,Vat={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function Rge(e,t,n,i){um.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,h=XD(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,Sge),p=XD(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,_ge),g=XD(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,Tge),f=XD(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,Cge);h=ED(r,u,0,1,h,p,f,g,Sge),p=ED(r,u,0,0,p,h,g,f,_ge),g=ED(r,u,1,1,g,p,f,h,Tge),f=ED(r,u,1,1,f,g,h,p,Cge);let x=p.height,_=g.height,C=h.height,V=f.height,L=Math.min(x,_,C,V),Z=Math.max(x,_,C,V),G=(L+Z)*.5,I,v,P=e.getLevelMaximumGeometricError(n.level),w=u.maximumRadius-P,F=Math.acos(w/u.maximumRadius)*4;if(F*=1.5,s.width>F&&Z-L<=P){let E=new Ua({width:9,height:9,buffer:Cat,structure:{heightOffset:Z}}),X=Vat;X.tilingScheme=n.tilingScheme,X.x=n.x,X.y=n.y,X.level=n.level,X.exaggeration=a,X.exaggerationRelativeHeight=c,r.mesh=E._createMeshSync(X)}else{let E=d,X=ce.center(s,_at);X.height=G;let A=u.cartographicToCartesian(X,Sat),N=new Cc(A,void 0,void 0,void 0,void 0,!0,!0,E,a,c),O=5,U;for(U=r.westMeshes,I=0,v=U.length;I<v;++I)O+=U[I].eastIndicesNorthToSouth.length;for(U=r.southMeshes,I=0,v=U.length;I<v;++I)O+=U[I].northIndicesWestToEast.length;for(U=r.eastMeshes,I=0,v=U.length;I<v;++I)O+=U[I].westIndicesSouthToNorth.length;for(U=r.northMeshes,I=0,v=U.length;I<v;++I)O+=U[I].southIndicesEastToWest.length;let Y=Tat;Y.minimumHeight=L,Y.maximumHeight=Z;let k=N.stride,H=new Float32Array(O*k),J=0,te=J;J=ID(u,s,N,H,J,0,1,h.height,h.encodedNormal,1,Y),J=PD(r,u,N,H,J,r.westTiles,r.westMeshes,yn.EAST,Y);let z=J;J=ID(u,s,N,H,J,0,0,p.height,p.encodedNormal,0,Y),J=PD(r,u,N,H,J,r.southTiles,r.southMeshes,yn.NORTH,Y);let j=J;J=ID(u,s,N,H,J,1,0,g.height,g.encodedNormal,0,Y),J=PD(r,u,N,H,J,r.eastTiles,r.eastMeshes,yn.WEST,Y);let ee=J;J=ID(u,s,N,H,J,1,1,f.height,f.encodedNormal,1,Y),J=PD(r,u,N,H,J,r.northTiles,r.northMeshes,yn.SOUTH,Y),L=Y.minimumHeight,Z=Y.maximumHeight;let fe=Gn.fromRectangle(s,L,Z,n.tilingScheme.ellipsoid),Te=Xi.geodeticLatitudeToMercatorAngle(s.south),de=1/(Xi.geodeticLatitudeToMercatorAngle(s.north)-Te),xe=(Xi.geodeticLatitudeToMercatorAngle(X.latitude)-Te)*de,Se=u.geodeticSurfaceNormalCartographic(WT,K4),Ie=wn.octEncode(Se,Y4),Le=J;N.encode(H,J*k,fe.center,D.fromElements(.5,.5,jd),G,Ie,xe,Se),++J;let ke=J,Be=ke<256?1:2,it=(ke-1)*3,Gt=it*Be,gt=(H.length-ke*k)*Float32Array.BYTES_PER_ELEMENT,Ne;if(gt>=Gt){let be=ke*k*Float32Array.BYTES_PER_ELEMENT;Ne=ke<256?new Uint8Array(H.buffer,be,it):new Uint16Array(H.buffer,be,it)}else Ne=ke<256?new Uint8Array(it):new Uint16Array(it);H=new Float32Array(H.buffer,0,ke*k);let Kt=0;for(I=0;I<ke-2;++I)Ne[Kt++]=Le,Ne[Kt++]=I,Ne[Kt++]=I+1;Ne[Kt++]=Le,Ne[Kt++]=I,Ne[Kt++]=0;let Lt=[];for(I=z;I>=te;--I)Lt.push(I);let ut=[];for(I=j;I>=z;--I)ut.push(I);let zn=[];for(I=ee;I>=j;--I)zn.push(I);let cn=[];for(cn.push(0),I=Le-1;I>=ee;--I)cn.push(I);r.mesh=new dm(N.center,H,Ne,it,ke,L,Z,le.fromOrientedBoundingBox(fe),Xat(e,fe.center,s,L,Z),N.stride,fe,N,Lt,ut,zn,cn)}let b=t.context;r._destroyVertexArray(i),r.vertexArray=um._createVertexArrayForMesh(b,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let R=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let E=o._findAncestorTileWithTerrainData(n);l(E)&&l(E.data.waterMaskTexture)&&(r.waterMaskTexture=E.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,E,r.waterMaskTranslationAndScale))}l(R)&&(--R.referenceCount,R.referenceCount===0&&R.destroy())}function ID(e,t,n,i,o,r,s,a,c,d,u){let h=WT;h.longitude=W.lerp(t.west,t.east,r),h.latitude=W.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,UV),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,K4));let f=H4;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,g),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var vD=new ce;function Pw(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=ce.clone(e.rectangle,vD),o.west-=W.TWO_PI,o.east-=W.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,vD),o.west+=W.TWO_PI,o.east+=W.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,h=(r.north-o.south)/d,p=(n.x-a)/(c-a),g=(n.y-u)/(h-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var Lat=new D;function z4(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var Rat=new D,Zat=new m;function Gat(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,h=i.vertices,p=Pw(t,n,u.decodeTextureCoordinates(h,o,jd),jd),g=Pw(t,n,u.decodeTextureCoordinates(h,r,H4),H4),f;c?f=(s-p.x)/(g.x-p.x):f=(a-p.y)/(g.y-p.y);let x=u.decodeHeight(h,o),_=u.decodeHeight(h,r),C=n.rectangle;WT.longitude=W.lerp(C.west,C.east,s),WT.latitude=W.lerp(C.south,C.north,a),d.height=WT.height=W.lerp(x,_,f);let V;if(u.hasVertexNormals){let L=u.getOctEncodedNormal(h,o,Lat),Z=u.getOctEncodedNormal(h,r,Rat),G=wn.octDecode(L.x,L.y,UV),I=wn.octDecode(Z.x,Z.y,Zat);V=m.lerp(G,I,f,UV),m.normalize(V,V),wn.octEncode(V,d.encodedNormal)}else V=e.geodeticSurfaceNormalCartographic(WT,UV),wn.octEncode(V,d.encodedNormal)}function Zge(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(WT,UV);wn.octEncode(s,r.encodedNormal)}function XD(e,t,n,i,o,r,s,a,c,d,u){if(Lge(e,t,a,s,!1,n,i,u)||Lge(e,t,d,c,!0,n,i,u))return u;let p;if(J4(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],z4(r,p,n,i,u),u;let g;if(n===0?i===0?g=WD(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=WD(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=WD(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=WD(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),l(g))return Zge(e,t,n,i,g,u),u}function WD(e,t,n,i,o,r,s,a){let c=Vge(e,t,!1,n,s,a),d=Vge(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function PD(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=Eat(e,t,n,i,o,r[d],s[d],a,c);return o}function Eat(e,t,n,i,o,r,s,a,c){let d=r.rectangle;a===yn.EAST&&e.tile.x===0?(d=ce.clone(r.rectangle,vD),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===yn.WEST&&r.x===0&&(d=ce.clone(r.rectangle,vD),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,jd),h=jd.x,p=jd.y);let g,f;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,f=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,f=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,f=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,f=!0;break}let x=r,_=e.tile,C=s.encoding,V=s.vertices,L=n.stride,Z,G;C.hasWebMercatorT&&(Z=Xi.geodeticLatitudeToMercatorAngle(u.south),G=1/(Xi.geodeticLatitudeToMercatorAngle(u.north)-Z));for(let I=0;I<g.length;++I){let v=g[I],P=C.decodeTextureCoordinates(V,v,jd);Pw(x,_,P,P);let w=P.x,F=P.y,b=f?w:F;if(b<0||b>1||Math.abs(w-h)<W.EPSILON5&&Math.abs(F-p)<W.EPSILON5)continue;let R=Math.abs(w)<W.EPSILON5||Math.abs(w-1)<W.EPSILON5,E=Math.abs(F)<W.EPSILON5||Math.abs(F-1)<W.EPSILON5;if(R&&E)continue;let X=C.decodePosition(V,v,UV),A=C.decodeHeight(V,v),N;C.hasVertexNormals?N=C.getOctEncodedNormal(V,v,Y4):(N=Y4,N.x=0,N.y=0);let O=F;if(C.hasWebMercatorT){let Y=W.lerp(u.south,u.north,F);O=(Xi.geodeticLatitudeToMercatorAngle(Y)-Z)*G}let U;n.hasGeodeticSurfaceNormals&&(U=t.geodeticSurfaceNormal(X,K4)),n.encode(i,o*L,X,P,A,N,O,U),c.minimumHeight=Math.min(c.minimumHeight,A),c.maximumHeight=Math.max(c.maximumHeight,A),++o}return o}function Vge(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let d=s;d!==a;d+=c){let u=e[d],h=t[d];if(!J4(h,u))continue;let p;switch(i){case yn.WEST:p=u.westIndicesSouthToNorth;break;case yn.SOUTH:p=u.southIndicesEastToWest;break;case yn.EAST:p=u.eastIndicesNorthToSouth;break;case yn.NORTH:p=u.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return u.encoding.decodeHeight(u.vertices,g)}}function J4(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Lge(e,t,n,i,o,r,s,a){let c,d,u,h,p,g=i[o?0:n.length-1],f=n[o?0:n.length-1];if(J4(g,f)&&(r===0?s===0?(c=o?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,d=o,u=o):(c=o?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,d=!o,u=!1):s===0?(c=o?f.westIndicesSouthToNorth:f.northIndicesWestToEast,d=!o,u=!0):(c=o?f.southIndicesEastToWest:f.westIndicesSouthToNorth,d=o,u=!o),c.length>0)){h=o?0:c.length-1,p=c[h],f.encoding.decodeTextureCoordinates(f.vertices,p,jd);let x=Pw(g,e.tile,jd,jd);if(x.x===r&&x.y===s)return z4(f,p,r,s,a),!0;if(h=Xo(c,d?r:s,function(_,C){f.encoding.decodeTextureCoordinates(f.vertices,_,jd);let V=Pw(g,e.tile,jd,jd);return u?d?V.x-r:V.y-s:d?r-V.x:s-V.y}),h<0){if(h=~h,h>0&&h<c.length)return Gat(t,g,e.tile,f,c[h-1],c[h],r,s,d,a),!0}else return z4(f,c[h],r,s,a),!0}return!1}var Iat=[new m,new m,new m,new m];function Xat(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Iat;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var BV=DV;function or(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=_n.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new ge,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(or.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(or.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(or.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(or.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new ge,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new B(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(or.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){fs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Qm.setOwner(e,this,"_clippingPolygons")}}});function Wat(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}or.prototype.update=function(e){this._imageryLayers._update()};function Pat(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}or.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Wat)})),Pat(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)um._freeVertexArray(t[i]);t.length=0};or.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};or.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:rc.LESS}}),this._blendRenderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:rc.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=Ye(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ue.fromCache(s),s=Ye(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ue.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&BV.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let d=0,u=c.length;d<u;++d){let h=c[d],p=h.data.tileBoundingRegion;ict(this,h,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function Wge(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}or.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)Wge(t[n],e)};or.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};or.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};or.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Jn.CULLED_BUT_NEEDED,o=n.terrainState),um.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==hr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,um.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var vat=new le,Pge=new ce,wat=new ce,Fat=new he;function AD(e,t){if(t.west<t.east)return t;let n=ce.clone(t,wat);return ce.center(e,Fat).longitude>0?n.east=W.PI:n.west=-W.PI,n}function vge(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}or.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=vge(this,t);if(t.fog.enabled&&!o&&W.fog(i,t.fog.density)>=1)return hr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return hr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let d=AD(e.rectangle,this.cartographicLimitRectangle),u=ce.simpleIntersection(d,e.rectangle,Pge);if(!l(u))return hr.NONE;if(ce.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(c=vat,le.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),m.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===oe.MORPHING&&l(r.renderedMesh)&&(c=le.union(s.boundingSphere,c,c))),!l(c))return hr.PARTIAL;let h=this._clippingPlanes;if(l(h)&&h.enabled){let _=h.computeIntersectionWithBoundingVolume(c);if(e.isClipped=_!==Ht.INSIDE,_===Ht.OUTSIDE)return hr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let _=p.computeIntersectionWithBoundingVolume(s);e.isClipped=_!==Ht.OUTSIDE}let g,f=a.computeVisibility(c);if(f===Ht.OUTSIDE?g=hr.NONE:f===Ht.INTERSECTING?g=hr.PARTIAL:f===Ht.INSIDE&&(g=hr.FULL),g===hr.NONE)return g;let x=t.mode===oe.SCENE3D&&t.camera.frustum instanceof rn;if(t.mode===oe.SCENE3D&&!x&&l(n)&&!o){let _=r.occludeePointInScaledSpace;return!l(_)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(_,s.minimumHeight)?g:hr.NONE}return g};or.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Aat=[],Mat=[];or.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Aat;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===mo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let h=s[a],p=h.loadingImagery,g=!l(p)||p.state===ci.FAILED||p.state===ci.INVALID,f=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[f]=g&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=Mat;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);u.length>0;){let h=u.pop(),p=h._lastSelectionResultFrame===d?h._lastSelectionResult:Jn.NONE;if(p===Jn.RENDERED){let g=h.data;if(!l(g))continue;if(!o&&h.data.terrainState===mo.READY)return!1;let f=h.data.imagery;for(a=0,c=f.length;a<c;++a){let x=f[a],_=x.loadingImagery,C=!l(_)||_.state===ci.FAILED||_.state===ci.INVALID,V=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[V])return!1}}else p===Jn.REFINED&&u.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var Nat=new m;or.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=m.subtract(i.center,o,Nat),a=m.magnitude(s);return a<W.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,r))*e._distance)};var Gge=new M,FD=new M,kat=new se,Uat=new se,Dat=new se,Bat=new m,Ege=new m,Oat=new m,Yat=new m;or.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let d=i[a];l(d.readyImagery)&&d.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Hat=[new m,new m,new m,new m];function Ige(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Hat;return m.fromRadians(n.west,n.south,o,a,c[0]),m.fromRadians(n.east,n.south,o,a,c[1]),m.fromRadians(n.west,n.north,o,a,c[2]),m.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}or.prototype.computeDistanceToTile=function(e,t){zat(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,d=Math.abs(c-r),u=Math.abs(c-s);d>u?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function zat(e,t,n){let i=e.data;i===void 0&&(i=e.data=new um);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Hu({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,d=e,u=i.mesh,h=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,c=!0;else if(h!==void 0&&h._minimumHeight!==void 0&&h._maximumHeight!==void 0)r.minimumHeight=h._minimumHeight,r.maximumHeight=h._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let f=g.mesh,x=g.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0){r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Tr.getHeight(r.minimumHeight,p,g),r.maximumHeight=Tr.getHeight(r.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Gn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=le.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=m.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Ige(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=Ige(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}or.prototype.isDestroyed=function(){return!1};or.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),me(this)};function Kat(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,d;for(d=0;d<c;++d)if(o=a[d],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(d=s;d<u;++d)a[d].freeResources();a.splice(s,e)}return!0}}or.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,d=c.length,u=-1,h=0;for(a=0;a<d;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)u===-1&&(u=a),++h;else if(u!==-1)break}if(u===-1)return;let p=u+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Kat(h,e,n),s.state=qs.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=qs.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Jn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};or.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],d=c.loadingImagery;if(l(d)||(d=c.readyImagery),d.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};or.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};or.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Jat=new M,Qat=new M;function Xge(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=M.multiplyByPoint(i,this.properties.rtc,Ege);return M.setTranslation(i,o,Gge),Gge},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=M.multiplyByPoint(i,this.properties.rtc,Ege);return M.setTranslation(i,r,FD),M.multiply(o,FD,FD),FD},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?M.multiply(e.context.uniformState.view,i.modelMatrix,Jat):M.IDENTITY;return M.inverseTranspose(o,Qat)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new B(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new D(65e5,9e6),nightFadeDistance:new D(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,center3D:void 0,rtc:new m,modifiedModelView:new M,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new D(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new D,southMercatorYAndOneOverHeight:new D,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new D,scaleAndBias:new M,clippingPlanesEdgeColor:B.clone(B.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:B.clone(B.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?Tt(n,t.materialUniformMap):n}function jat(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=qat(e,r,o),i.wireframeVertexArray.mesh=o}}function qat(e,t,n){let o={indices:n.indices,primitiveType:we.TRIANGLES};Fn.toWireframe(o);let r=o.indices,s=yt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:Ae.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ni({context:e,attributes:t._attributes,indexBuffer:s})}var wge,Fge,MD;(function(){let e=new Zt({geometry:vm.fromDimensions({dimensions:new m(2,2,2)})}),t=new Zt({geometry:new Zb({radius:1})}),n=new M,i,o;function r(s){return new In({geometryInstances:s,appearance:new ln({translucent:!1,flat:!0}),asynchronous:!1})}wge=function(s,a){return s===i||(MD(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Yt.fromColor(a),o=r(e)),o},Fge=function(s,a){return s===i||(MD(),i=s,n=M.fromTranslation(s.center,n),n=M.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Yt.fromColor(a),o=r(t)),o},MD=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var $at=new se(0,0,0,0),ect={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},tct=B.TRANSPARENT,nct=new Nt;function ict(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new BV(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let be=r.credits;for(let Ve=0,bn=be.length;Ve<bn;++Ve)o.addCreditToNextFrame(be[Ve])}let s=Ft.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let d=n.cameraUnderground,u=n.globeTranslucencyState,h=u.translucent,p=u.frontFaceAlphaByDistance,g=u.backFaceAlphaByDistance,f=u.rectangle,x=y(e.undergroundColor,tct),_=y(e.undergroundColorAlphaByDistance,nct),C=vge(e,n)&&n.mode===oe.SCENE3D&&x.alpha>0&&(_.nearValue>0||_.farValue>0),V=e.lambertDiffuseMultiplier,L=e.vertexShadowDarkness,Z=e.hasWaterMask&&l(a),G=Z&&e.showWaterEffect,I=e.oceanNormalMap,v=G&&l(I),P=e.terrainProvider,w=l(P)&&e.terrainProvider.hasVertexNormals,F=n.fog.enabled&&n.fog.renderable&&!d,b=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,R=_n.castShadows(e.shadows)&&!h,E=_n.receiveShadows(e.shadows)&&!h,X=e.hueShift,A=e.saturationShift,N=e.brightnessShift,O=!(W.equalsEpsilon(X,0,W.EPSILON7)&&W.equalsEpsilon(A,0,W.EPSILON7)&&W.equalsEpsilon(N,0,W.EPSILON7)),U=!1;if(b){let be=m.magnitude(n.camera.positionWC),Ve=e.nightFadeOutDistance;U=be>Ve}Z&&--s,v&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=u.numberOfTextureUniforms;let Y=i.renderedMesh,k=Y.center,H=Y.encoding,J=i.tileBoundingRegion,te=n.verticalExaggeration,z=n.verticalExaggerationRelativeHeight,j=te!==1,ee=H.hasGeodeticSurfaceNormals,fe=kat,Te=0,de=0,xe=0,Se=0,Ie=!1;if(n.mode!==oe.SCENE3D){let be=n.mapProjection,Ve=be.project(ce.southwest(t.rectangle),Oat),bn=be.project(ce.northeast(t.rectangle),Yat);if(fe.x=Ve.x,fe.y=Ve.y,fe.z=bn.x,fe.w=bn.y,n.mode!==oe.MORPHING&&(k=Bat,k.x=0,k.y=(fe.z+fe.x)*.5,k.z=(fe.w+fe.y)*.5,fe.x-=k.y,fe.y-=k.z,fe.z-=k.y,fe.w-=k.z),n.mode===oe.SCENE2D&&H.quantization===js.BITS12){let ht=1/(Math.pow(2,12)-1)*.5,so=(fe.z-fe.x)*ht,Eo=(fe.w-fe.y)*ht;fe.x-=so,fe.y-=Eo,fe.z+=so,fe.w+=Eo}be instanceof Xi&&(Te=t.rectangle.south,de=t.rectangle.north,xe=Xi.geodeticLatitudeToMercatorAngle(Te),Se=1/(Xi.geodeticLatitudeToMercatorAngle(de)-xe),Ie=!0)}let Le=ect;Le.frameState=n,Le.surfaceTile=i,Le.hasWaterMask=Z,Le.showReflectiveOcean=G,Le.showOceanWaves=v,Le.enableLighting=e.enableLighting,Le.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Le.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Le.showGroundAtmosphere=b,Le.atmosphereLightIntensity=e.atmosphereLightIntensity,Le.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Le.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Le.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Le.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Le.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Le.perFragmentGroundAtmosphere=U,Le.hasVertexNormals=w,Le.useWebMercatorProjection=Ie,Le.clippedByBoundaries=i.clippedByBoundaries,Le.hasGeodeticSurfaceNormals=ee,Le.hasExaggeration=j;let ke=i.imagery,Be=0,it=ke.length,Gt=e.showSkirts&&!d&&!h,gt=e.backFaceCulling&&!d&&!h,Ne=gt?e._renderState:e._disableCullingRenderState,Kt=gt?e._blendRenderState:e._disableCullingBlendRenderState,Lt=Ne,ut=e._firstPassInitialColor,zn=n.context;if(l(e._debug.boundingSphereTile)||MD(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let be=e._drawCommands.length;for(let Ve=0;Ve<be;++Ve)e._uniformMaps[Ve]=Xge(n,e)}do{let be=0,Ve,bn;if(e._drawCommands.length<=e._usedDrawCommands?(Ve=new qe,Ve.owner=t,Ve.cull=!1,Ve.boundingVolume=new le,Ve.orientedBoundingBox=void 0,bn=Xge(n,e),e._drawCommands.push(Ve),e._uniformMaps.push(bn)):(Ve=e._drawCommands[e._usedDrawCommands],bn=e._uniformMaps[e._usedDrawCommands]),Ve.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let ra=J.boundingVolume,xl=J.boundingSphere;l(ra)?wge(ra,B.RED).update(n):l(xl)&&Fge(xl,B.RED).update(n)}let ht=bn.properties;se.clone(ut,ht.initialColor),ht.oceanNormalMap=I,ht.lightingFadeDistance.x=e.lightingFadeOutDistance,ht.lightingFadeDistance.y=e.lightingFadeInDistance,ht.nightFadeDistance.x=e.nightFadeOutDistance,ht.nightFadeDistance.y=e.nightFadeInDistance,ht.atmosphereLightIntensity=e.atmosphereLightIntensity,ht.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ht.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ht.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ht.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ht.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ht.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let so=d?g:p,Eo=d?p:g;l(so)&&(se.fromElements(so.near,so.nearValue,so.far,so.farValue,ht.frontFaceAlphaByDistance),se.fromElements(Eo.near,Eo.nearValue,Eo.far,Eo.farValue,ht.backFaceAlphaByDistance)),se.fromElements(_.near,_.nearValue,_.far,_.farValue,ht.undergroundColorAlphaByDistance),B.clone(x,ht.undergroundColor),ht.lambertDiffuseMultiplier=V,ht.vertexShadowDarkness=L;let ia=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;ia&&B.clone(e.fillHighlightColor,ht.fillHighlightColor),ht.verticalExaggerationAndRelativeHeight.x=te,ht.verticalExaggerationAndRelativeHeight.y=z,ht.center3D=Y.center,m.clone(k,ht.rtc),se.clone(fe,ht.tileRectangle),ht.southAndNorthLatitude.x=Te,ht.southAndNorthLatitude.y=de,ht.southMercatorYAndOneOverHeight.x=xe,ht.southMercatorYAndOneOverHeight.y=Se;let Gr=Uat,_s=AD(t.rectangle,e.cartographicLimitRectangle),Fe=Dat,rt=AD(t.rectangle,f);m.fromElements(X,A,N,ht.hsbShift);let Ke=t.rectangle,Qe=1/Ke.width,ft=1/Ke.height;Gr.x=(_s.west-Ke.west)*Qe,Gr.y=(_s.south-Ke.south)*ft,Gr.z=(_s.east-Ke.west)*Qe,Gr.w=(_s.north-Ke.south)*ft,se.clone(Gr,ht.localizedCartographicLimitRectangle),Fe.x=(rt.west-Ke.west)*Qe,Fe.y=(rt.south-Ke.south)*ft,Fe.z=(rt.east-Ke.west)*Qe,Fe.w=(rt.north-Ke.south)*ft,se.clone(Fe,ht.localizedTranslucencyRectangle);let Ot=F&&W.fog(t._distance,n.fog.density)>W.EPSILON3;O=O&&(Ot||b);let Cn=!1,Io=!1,So=!1,za=!1,Ka=!1,Ci=!1,pi=!1,oa=!1,zr=!1,yl=!1;for(;be<s&&Be<it;){let ra=ke[Be],xl=ra.readyImagery;if(++Be,!l(xl)||xl.imageryLayer.alpha===0)continue;let Xc=ra.useWebMercatorT?xl.textureWebMercator:xl.texture,cs=xl.imageryLayer;l(ra.textureTranslationAndScale)||(ra.textureTranslationAndScale=cs._calculateTextureTranslationAndScale(t,ra)),ht.dayTextures[be]=Xc,ht.dayTextureTranslationAndScale[be]=ra.textureTranslationAndScale,ht.dayTextureTexCoordsRectangle[be]=ra.textureCoordinateRectangle,ht.dayTextureUseWebMercatorT[be]=ra.useWebMercatorT,ht.dayTextureAlpha[be]=cs.alpha,Ci=Ci||ht.dayTextureAlpha[be]!==1,ht.dayTextureNightAlpha[be]=cs.nightAlpha,pi=pi||ht.dayTextureNightAlpha[be]!==1,ht.dayTextureDayAlpha[be]=cs.dayAlpha,pi=pi||ht.dayTextureDayAlpha[be]!==1,ht.dayTextureBrightness[be]=cs.brightness,Cn=Cn||ht.dayTextureBrightness[be]!==Ba.DEFAULT_BRIGHTNESS,ht.dayTextureContrast[be]=cs.contrast,Io=Io||ht.dayTextureContrast[be]!==Ba.DEFAULT_CONTRAST,ht.dayTextureHue[be]=cs.hue,So=So||ht.dayTextureHue[be]!==Ba.DEFAULT_HUE,ht.dayTextureSaturation[be]=cs.saturation,za=za||ht.dayTextureSaturation[be]!==Ba.DEFAULT_SATURATION,ht.dayTextureOneOverGamma[be]=1/cs.gamma,Ka=Ka||ht.dayTextureOneOverGamma[be]!==1/Ba.DEFAULT_GAMMA,ht.dayTextureSplit[be]=cs.splitDirection,oa=oa||ht.dayTextureSplit[be]!==0;let uu=ht.dayTextureCutoutRectangles[be];if(l(uu)||(uu=ht.dayTextureCutoutRectangles[be]=new se),se.clone(se.ZERO,uu),l(cs.cutoutRectangle)){let Mo=AD(Ke,cs.cutoutRectangle),dn=ce.simpleIntersection(Mo,Ke,Pge);zr=l(dn)||zr,uu.x=(Mo.west-Ke.west)*Qe,uu.y=(Mo.south-Ke.south)*ft,uu.z=(Mo.east-Ke.west)*Qe,uu.w=(Mo.north-Ke.south)*ft}let mu=ht.colorsToAlpha[be];l(mu)||(mu=ht.colorsToAlpha[be]=new se);let hu=l(cs.colorToAlpha)&&cs.colorToAlphaThreshold>0;if(yl=yl||hu,hu){let Mo=cs.colorToAlpha;mu.x=Mo.red,mu.y=Mo.green,mu.z=Mo.blue,mu.w=cs.colorToAlphaThreshold}else mu.w=-1;if(l(xl.credits)){let Mo=xl.credits;for(let dn=0,Re=Mo.length;dn<Re;++dn)o.addCreditToNextFrame(Mo[dn])}++be}ht.dayTextures.length=be,ht.waterMask=a,se.clone(c,ht.waterMaskTranslationAndScale),ht.minMaxHeight.x=H.minimumHeight,ht.minMaxHeight.y=H.maximumHeight,M.clone(H.matrix,ht.scaleAndBias);let yo=e._clippingPlanes,Er=l(yo)&&yo.enabled&&t.isClipped;Er&&(ht.clippingPlanesEdgeColor=B.clone(yo.edgeColor,ht.clippingPlanesEdgeColor),ht.clippingPlanesEdgeWidth=yo.edgeWidth);let pp=e._clippingPolygons,Kr=l(pp)&&pp.enabled&&t.isClipped;Le.numberOfDayTextures=be,Le.applyBrightness=Cn,Le.applyContrast=Io,Le.applyHue=So,Le.applySaturation=za,Le.applyGamma=Ka,Le.applyAlpha=Ci,Le.applyDayNightAlpha=pi,Le.applySplit=oa,Le.enableFog=Ot,Le.enableClippingPlanes=Er,Le.clippingPlanes=yo,Le.enableClippingPolygons=Kr,Le.clippingPolygons=pp,Le.hasImageryLayerCutout=zr,Le.colorCorrect=O,Le.highlightFillTile=ia,Le.colorToAlpha=yl,Le.showUndergroundColor=C,Le.translucent=h;let du=i.renderedMesh.indices.length;Gt||(du=i.renderedMesh.indexCountWithoutSkirts),Ve.shaderProgram=e._surfaceShaderSet.getShaderProgram(Le),Ve.castShadows=R,Ve.receiveShadows=E,Ve.renderState=Lt,Ve.primitiveType=we.TRIANGLES,Ve.vertexArray=i.vertexArray||i.fill.vertexArray,Ve.count=du,Ve.uniformMap=bn,Ve.pass=Ee.GLOBE,e._debug.wireframe&&(jat(zn,e,t),l(i.wireframeVertexArray)&&(Ve.vertexArray=i.wireframeVertexArray,Ve.primitiveType=we.LINES,Ve.count=du*2));let Ja=Ve.boundingVolume,Jy=Ve.orientedBoundingBox;n.mode!==oe.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,J.minimumHeight,J.maximumHeight,Ja),m.fromElements(Ja.center.z,Ja.center.x,Ja.center.y,Ja.center),n.mode===oe.MORPHING&&(Ja=le.union(J.boundingSphere,Ja,Ja))):(Ve.boundingVolume=le.clone(J.boundingSphere,Ja),Ve.orientedBoundingBox=Gn.clone(J.boundingVolume,Jy)),Ve.dirty=!0,h&&u.updateDerivedCommands(Ve,n),Wge(Ve,n),Lt=Kt,ut=$at}while(Be<it)}var vw=or;var hGi=T(S(),1);function Age(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(Age.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Nt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Nt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var ww=Age;var SGi=T(S(),1);function Ps(){this._layers=[],this.layerAdded=new ge,this.layerRemoved=new ge,this.layerMoved=new ge,this.layerShownOrHidden=new ge}Object.defineProperties(Ps.prototype,{length:{get:function(){return this._layers.length}}});Ps.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Ps.prototype.addImageryProvider=function(e,t){let n=new Ba(e);return this.add(n,t),n};Ps.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Ps.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Ps.prototype.contains=function(e){return this.indexOf(e)!==-1};Ps.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ps.prototype.get=function(e){return this._layers[e]};function ND(e,t){return e.indexOf(t)}function Mge(e,t,n){let i=e._layers;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Ps.prototype.raise=function(e){let t=ND(this._layers,e);Mge(this,t,t+1)};Ps.prototype.lower=function(e){let t=ND(this._layers,e);Mge(this,t,t-1)};Ps.prototype.raiseToTop=function(e){let t=ND(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Ps.prototype.lowerToBottom=function(e){let t=ND(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var oct=new ce;function Nge(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];ce.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],d=c.readyImagery;if(!l(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!l(u.pickFeatures)||!ce.contains(d.rectangle,t))continue;let h=oct,p=1/1024;h.west=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),h.east=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),h.south=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),h.north=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(h,t)&&i(d)}}Ps.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(Nge(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Ps.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(Nge(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let d=s[c],u=r[c];if(l(d)&&d.length>0)for(let h=0;h<d.length;++h){let p=d[h];p.imageryLayer=u,l(p.position)||(p.position=i),a.push(p)}}return a})};Ps.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ps.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ps.prototype.isDestroyed=function(){return!1};Ps.prototype.destroy=function(){return this.removeAll(!0),me(this)};Ps.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var Fw=Ps;var nEi=T(S(),1);var RGi=T(S(),1);function kge(e){this._ellipsoid=new Ab(e.ellipsoid,m.ZERO)}Object.defineProperties(kge.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var Aw=kge;var WGi=T(S(),1);function ml(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Jn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=qs.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}ml.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new ml({tilingScheme:e,x:s,y:r,level:0});return i};ml.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(ml.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new ml({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new ml({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new ml({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new ml({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<qs.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});ml.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};ml.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};ml.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};ml.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};ml.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};ml.prototype.freeResources=function(){this.state=qs.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),kD(this._southwestChild),this._southwestChild=void 0,kD(this._southeastChild),this._southeastChild=void 0,kD(this._northwestChild),this._northwestChild=void 0,kD(this._northeastChild),this._northeastChild=void 0};function kD(e){l(e)&&e.freeResources()}var Mw=ml;var wGi=T(S(),1);function UD(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}UD.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};UD.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Uge(this,t)),t=i}};function Uge(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}UD.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&Uge(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var Nw=UD;function hm(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new Nw,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new Aw({ellipsoid:n}),this._tileLoadProgressEvent=new ge,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(hm.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});hm.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function rct(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Bge(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}hm.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==qs.START&&e(t),t=t.replacementNext};hm.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};hm.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};hm.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function Bge(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}hm.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(rct(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Bge(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};hm.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),lct(this,e),xct(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function sct(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=ge.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}hm.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(pct(this,e),yct(this,e),sct(this,e))};hm.prototype.isDestroyed=function(){return!1};hm.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var Uw,Dge=new he;function act(e,t){let n=ce.center(e.rectangle,Dge),i=n.longitude-Uw.longitude,o=n.latitude-Uw.latitude;n=ce.center(t.rectangle,Dge);let r=n.longitude-Uw.longitude,s=n.latitude-Uw.latitude;return i*i+o*o-(r*r+s*s)}var cct=new m,kw=[];function lct(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles)){let x=r.tilingScheme;if(l(x)){let _=r.tilingScheme;e._levelZeroTiles=Mw.createLevelZeroTiles(_);let C=e._levelZeroTiles.length;if(kw.length<C)for(kw=new Array(C),o=0;o<C;++o)kw[o]===void 0&&(kw[o]=new Dw)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;Uw=t.camera.positionCartographic,a.sort(act);let d=e._addHeightCallbacks,u=e._removeHeightCallbacks,h=t.frameNumber,p;if(d.length>0||u.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(h,d,u);d.length=0,u.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let f=M.getTranslation(g.transform,cct);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Oa(e,s,r,t,c,!1,kw[o]):(d0(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}function d0(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function Dw(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Oge(){this.southwest=new Dw,this.southeast=new Dw,this.northwest=new Dw,this.northeast=new Dw}Oge.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var q4=new Array(31);for(let e=0;e<q4.length;++e)q4[e]=new Oge;function dct(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=hct(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,d=n.northwestChild,u=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:Jn.NONE,g=e.tileProvider;if(s||i){let f=Jn.originalResult(p)===Jn.RENDERED,x=Jn.originalResult(p)===Jn.CULLED||p===Jn.NONE,_=n.state===qs.DONE,C=f||x||_;if(C||l(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&d0(e,e._tileLoadQueueMedium,n,t),DD(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&d0(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){DD(e,n),d0(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.REFINED;let x=e._tilesToRender.length,_=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,V=e._tileLoadQueueHigh.length,L=e._tileToUpdateHeights.length;if(uct(e,a,c,d,u,t,i,o),x!==e._tilesToRender.length){let Z=o.allAreRenderable,G=o.anyWereRenderedLastFrame,I=o.notYetRenderableCount,v=!1;if(!Z&&!G){let P=e._tilesToRender;for(let F=x;F<P.length;++F){let b=P[F];for(;b!==void 0&&b._lastSelectionResult!==Jn.KICKED&&b!==n;)b._lastSelectionResult=Jn.kick(b._lastSelectionResult),b=b.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=L,DD(e,n),n._lastSelectionResult=Jn.RENDERED;let w=p===Jn.RENDERED;!w&&I>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=V,d0(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,v=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=w,w||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!v&&d0(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.RENDERED,DD(e,n),d0(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function uct(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,h=q4[t.level],p=h.southwest,g=h.southeast,f=h.northwest,x=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Oa(e,t,d,r,u,s,p),Oa(e,n,d,r,u,s,g),Oa(e,i,d,r,u,s,f),Oa(e,o,d,r,u,s,x)):(Oa(e,i,d,r,u,s,f),Oa(e,t,d,r,u,s,p),Oa(e,o,d,r,u,s,x),Oa(e,n,d,r,u,s,g)):c.latitude<t.rectangle.north?(Oa(e,n,d,r,u,s,g),Oa(e,t,d,r,u,s,p),Oa(e,o,d,r,u,s,x),Oa(e,i,d,r,u,s,f)):(Oa(e,o,d,r,u,s,x),Oa(e,i,d,r,u,s,f),Oa(e,n,d,r,u,s,g),Oa(e,t,d,r,u,s,p)),h.combine(a)}function mct(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Oa(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==hr.NONE)return dct(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,mct(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&d0(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Jn.NONE;c!==Jn.CULLED_BUT_NEEDED&&c!==Jn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Jn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(d0(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Jn.CULLED):t._lastSelectionResult=Jn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function hct(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof rn||t.camera.frustum instanceof Pr)return fct(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=W.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function fct(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),h=d/u;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=W.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function DD(e,t){e._tilesToRender.push(t)}function pct(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=Ti()+e._loadQueueTimeSlice,s=e._tileProvider,a=Q4(e,t,s,r,n,!1);a=Q4(e,t,s,r,i,a),Q4(e,t,s,r,o,a)}function bct(e,t){return e._loadPriority-t._loadPriority}function Q4(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(bct);for(let s=0,a=o.length;s<a&&(Ti()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var OV=new pn,j4=new he,Vy=new m,gct=[];function yct(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=gct;n.length=0;let i=e._tileToUpdateHeights,o=Ti(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let h=i[0];if(!l(h.data)||!l(h.data.mesh)){let x=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:Jn.NONE;(x===Jn.RENDERED||x===Jn.CULLED_BUT_NEEDED)&&n.push(h),i.shift(),e._lastTileIndex=0;continue}let p=h.customData,g=p.length,f=!1;for(u=e._lastTileIndex;u<g;++u){let x=p[u],_=h.data.terrainData,C=l(_)&&_.wasCreatedByUpsampling();if(h.level>x.level&&!C){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=m.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,d)),a===oe.SCENE3D){let L=d.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,OV.direction),Z=d.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,OV.origin);if(!l(Z)){let G=0;l(h.data.tileBoundingRegion)&&(G=h.data.tileBoundingRegion.minimumHeight);let I=Math.min(G,-11500),v=m.multiplyByScalar(L,Math.abs(I)+1,Vy);m.subtract(x.positionOnEllipsoidSurface,v,OV.origin)}}else he.clone(x.positionCartographic,j4),j4.height=-11500,c.project(j4,Vy),m.fromElements(Vy.z,Vy.x,Vy.y,Vy),m.clone(Vy,OV.origin),m.clone(m.UNIT_X,OV.direction);let V=h.data.pick(OV,a,c,!1,Vy);l(V)&&(l(x.callback)&&x.callback(V),x.level=h.level)}if(Ti()>=s){f=!0;break}}if(f){e._lastTileIndex=u;break}else e._lastTileIndex=0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function xct(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var Bw=hm;function wh(e){e=y(e,ne.default);let t=new Qf({ellipsoid:e}),n=new Fw;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new yw,this._material=void 0,this._surface=new Bw({tileProvider:new vw({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new ge,this._undergroundColor=B.clone(B.BLACK),this._undergroundColorAlphaByDistance=new Nt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new ww,ej(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ze({url:nn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ne.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=W.PI*e.minimumRadius,this.nightFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*W.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=_n.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(wh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&ej(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,ej(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=B.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Nt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function ej(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[jm,EV];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(bw),e._surfaceShaderSet.baseVertexShaderSource=new De({sources:[jm,EV,gw],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new De({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function _ct(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),o=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var Tct=[],Sct={start:0,stop:0};wh.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=Tct;s.length=0;let a=this._surface._tilesToRender,c=a.length,d,u;for(u=0;u<c;++u){d=a[u];let p=d.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=g=le.fromRectangleWithHeights2D(d.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),m.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))le.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let f=qn.raySphere(e,g,Sct);l(f)&&s.push(p)}s.sort(_ct(e.origin));let h;for(c=s.length,u=0;u<c&&(h=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(h));++u);return h};var Cct=new he;wh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==oe.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Cct);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var Vct=new m,Yge=new m,Lct=new he,Rct=new pn;function $4(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}wh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=$4(n._southwestChild,e)||$4(n._southeastChild,e)||$4(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=m.fromRadians(e.longitude,e.latitude,0,a,Vct),d=Rct,u=a.geodeticSurfaceNormal(c,d.direction),h=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(h)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(y(g,0),-11500),x=m.multiplyByScalar(u,Math.abs(f)+1,Yge);m.subtract(c,x,d.origin)}let p=n.data.pick(d,void 0,s,!1,Yge);if(l(p))return a.cartesianToCartographic(p,Lct).height};wh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};wh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let d=this;a.fetchImage().then(function(u){c===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new Xt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===oe.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};wh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};wh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};wh.prototype.isDestroyed=function(){return!1};wh.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),me(this)};var Ow=wh;var UIi=T(S(),1);var qEi=T(S(),1);var BEi=T(S(),1);var FEi=T(S(),1);function Zct(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Yw=Zct;var rye={},Gct=32.184,Ect=2451545,Hge=-.0529921,zge=-.1059842,Kge=13.0120009,Jge=13.3407154,Qge=.9856003,jge=26.4057084,qge=13.064993,$ge=.3287146,eye=1.7484877,tye=-.1589763,nye=.0036096,iye=.1643573,oye=12.9590088,tj=new q;rye.ComputeMoon=function(e,t){l(e)||(e=q.now()),tj=q.addSeconds(e,Gct,tj);let n=q.totalDays(tj)-Ect,i=n/Kn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Hge*n)*W.RADIANS_PER_DEGREE,r=(250.089+zge*n)*W.RADIANS_PER_DEGREE,s=(260.008+Kge*n)*W.RADIANS_PER_DEGREE,a=(176.625+Jge*n)*W.RADIANS_PER_DEGREE,c=(357.529+Qge*n)*W.RADIANS_PER_DEGREE,d=(311.589+jge*n)*W.RADIANS_PER_DEGREE,u=(134.963+qge*n)*W.RADIANS_PER_DEGREE,h=(276.617+$ge*n)*W.RADIANS_PER_DEGREE,p=(34.226+eye*n)*W.RADIANS_PER_DEGREE,g=(15.134+tye*n)*W.RADIANS_PER_DEGREE,f=(119.743+nye*n)*W.RADIANS_PER_DEGREE,x=(239.961+iye*n)*W.RADIANS_PER_DEGREE,_=(25.053+oye*n)*W.RADIANS_PER_DEGREE,C=Math.sin(o),V=Math.sin(r),L=Math.sin(s),Z=Math.sin(a),G=Math.sin(c),I=Math.sin(d),v=Math.sin(u),P=Math.sin(h),w=Math.sin(p),F=Math.sin(g),b=Math.sin(f),R=Math.sin(x),E=Math.sin(_),X=Math.cos(o),A=Math.cos(r),N=Math.cos(s),O=Math.cos(a),U=Math.cos(c),Y=Math.cos(d),k=Math.cos(u),H=Math.cos(h),J=Math.cos(p),te=Math.cos(g),z=Math.cos(f),j=Math.cos(x),ee=Math.cos(_),fe=(269.9949+.0031*i-3.8787*C-.1204*V+.07*L-.0172*Z+.0072*I-.0052*F+.0043*E)*W.RADIANS_PER_DEGREE,Te=(66.5392+.013*i+1.5419*X+.0239*A-.0278*N+.0068*O-.0029*Y+9e-4*k+8e-4*te-9e-4*ee)*W.RADIANS_PER_DEGREE,de=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*V-.0642*L+.0158*Z+.0252*G-.0066*I-.0047*v-.0046*P+.0028*w+.0052*F+.004*b+.0019*R-.0044*E)*W.RADIANS_PER_DEGREE,xe=(13.17635815-14e-13*(2*n)+3.561*X*Hge+.1208*A*zge-.0642*N*Kge+.0158*O*Jge+.0252*U*Qge-.0066*Y*jge-.0047*k*qge-.0046*H*$ge+.0028*J*eye+.0052*te*tye+.004*z*nye+.0019*j*iye-.0044*ee*oye)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new Yw),t.rightAscension=fe,t.declination=Te,t.rotation=de,t.rotationRate=xe,t};var Hw=rye;function sye(e){(!l(e)||typeof e!="function")&&(e=Hw.ComputeMoon),this._computeFunction=e}var Ict=new m,Xct=new m,Wct=new m;function Pct(e,t,n){let i=Ict;i.x=Math.cos(e+W.PI_OVER_TWO),i.y=Math.sin(e+W.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=Wct;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=m.cross(r,i,Xct);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var vct=new $,wct=new ve;sye.prototype.evaluate=function(e,t){l(e)||(e=q.now());let n=this._computeFunction(e),i=Pct(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=ve.fromAxisAngle(m.UNIT_Z,o,wct),s=$.fromQuaternion(ve.conjugate(r,r),vct);return $.multiply(s,i,i)};var zw=sye;var RIi=T(S(),1);var eIi=T(S(),1),YV=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; + +in vec3 v_positionEC; + +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +{ + vec3 positionEC = czm_pointAlongRay(ray, intersection); + vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; + vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); + vec3 sphericalNormal = normalize(positionMC / u_radii); + vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates + vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates + + vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal); + vec3 positionToEyeEC = -positionEC; + + czm_materialInput materialInput; + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = (positionMC + u_radii) / u_radii; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); + +#ifdef ONLY_SUN_LIGHTING + return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); +#else + return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} + +void main() +{ + // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii + // in the vertex shader. Only when it is larger than some constant, march along the ray. + // Otherwise perform one intersection test which will be the common case. + + // Test if the ray intersects a sphere with the ellipsoid's maximum radius. + // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test + // may cause false negatives. This will discard fragments before marching the ray forward. + float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; + vec3 direction = normalize(v_positionEC); + vec3 ellipsoidCenter = czm_modelView[3].xyz; + + float t1 = -1.0; + float t2 = -1.0; + + float b = -2.0 * dot(direction, ellipsoidCenter); + float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; + + float discriminant = b * b - 4.0 * c; + if (discriminant >= 0.0) { + t1 = (-b - sqrt(discriminant)) * 0.5; + t2 = (-b + sqrt(discriminant)) * 0.5; + } + + if (t1 < 0.0 && t2 < 0.0) { + discard; + } + + float t = min(t1, t2); + if (t < 0.0) { + t = 0.0; + } + + // March ray forward to intersection with larger sphere and find + czm_ray ray = czm_ray(t * direction, direction); + + vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); + + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); + + if (czm_isEmpty(intersection)) + { + discard; + } + + // If the viewer is outside, compute outsideFaceColor, with normals facing outward. + vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); + + // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. + vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); + + out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); + out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); + +#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + t = (intersection.start != 0.0) ? intersection.start : intersection.stop; + vec3 positionEC = czm_pointAlongRay(ray, t); + vec4 positionCC = czm_projection * vec4(positionEC, 1.0); +#ifdef LOG_DEPTH + czm_writeLogDepth(1.0 + positionCC.w); +#else + float z = positionCC.z / positionCC.w; + + float n = czm_depthRange.near; + float f = czm_depthRange.far; + + gl_FragDepth = (z * (f - n) + f + n) * 0.5; +#endif +#endif +} +`;var nIi=T(S(),1),HV=`in vec3 position; + +uniform vec3 u_radii; + +out vec3 v_positionEC; + +void main() +{ + // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. + // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, + // but doing it here allows us to change the radii without rewriting the vertex data, and + // allows all ellipsoids to reuse the same vertex data. + vec4 p = vec4(u_radii * position, 1.0); + + v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates + gl_Position = czm_modelViewProjection * p; // position in clip coordinates + + // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums + // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the + // ellipsoid (does not write depth) that was rendered in the farther frustum. + // + // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates + // artifacts since some fragments can be alpha blended twice. This is solved by only rendering + // the ellipsoid in the closest frustum to the viewer. + gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); + + czm_vertexLogDepth(); +} +`;var nj={position:0};function BD(e){e=y(e,y.EMPTY_OBJECT),this.center=m.clone(y(e.center,m.ZERO)),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new le,this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=y(e.show,!0),this.material=y(e.material,Hi.fromType(Hi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new qe({owner:y(e._owner,this)}),this._pickCommand=new qe({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function Fct(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ea.createGeometry(Ea.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Xe.POSITION_ONLY}));return t=ni.fromGeometry({context:e,geometry:n,attributeLocations:nj,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}BD.prototype.update=function(e){if(!this.show||e.mode!==oe.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ue.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Fct(t));let o=!1,r=this.radii;if(!m.equals(this._radii,r)){m.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!M.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(r),le.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,d=this._useLogDepth!==c;this._useLogDepth=c;let u=this._colorCommand,h,p;(s||a||i||d)&&(h=new De({sources:[HV]}),p=new De({sources:[this.material.shaderSource,YV]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:nj}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=Tt(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let g=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Ee.TRANSLUCENT:Ee.OPAQUE,g.push(u)),f.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||d)&&(h=new De({sources:[HV]}),p=new De({sources:[this.material.shaderSource,YV],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=$t.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:nj}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=Tt(Tt(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Ee.TRANSLUCENT:Ee.OPAQUE,g.push(x)}};BD.prototype.isDestroyed=function(){return!1};BD.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var Kw=BD;function Jw(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=nn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,ne.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new Kw({radii:this.ellipsoid.radii,material:Hi.fromType(Hi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new zw}Object.defineProperties(Jw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var OD=new $,Act=new $,Mct=new m,YD=[];Jw.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(vt.computeIcrfToFixedMatrix(n,OD))||vt.computeTemeToPseudoFixedMatrix(n,OD);let i=this._axes.evaluate(n,Act);$.transpose(i,i),$.multiply(OD,i,i);let o=U0.computeMoonPositionInEarthInertialFrame(n,Mct);$.multiplyByVector(OD,o,o),M.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=YD,YD.length=0,t.update(e),e.commandList=r,YD.length===1?YD[0]:void 0};Jw.prototype.isDestroyed=function(){return!1};Jw.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),me(this)};var Qw=Jw;var YYi=T(S(),1);var BIi=T(S(),1);var ij=[],oj=[];function Nct(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=ij,d=oj,u,h;for(u=0;u<s;++u)c[u]=e[i+u];for(h=0;h<a;++h)d[h]=e[o+h+1];u=0,h=0;for(let p=i;p<=r;++p){let g=c[u],f=d[h];u<s&&(h>=a||t(g,f,n)<=0)?(e[p]=g,++u):h<a&&(e[p]=f,++h)}}function rj(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);rj(e,t,n,i,r),rj(e,t,n,r+1,o),Nct(e,t,n,i,r,o)}function kct(e,t,n){let i=e.length,o=Math.ceil(i*.5);ij.length=o,oj.length=o,rj(e,t,n,0,i-1),ij.length=0,oj.length=0}var u0=kct;var $Ii=T(S(),1);function Vc(e,t){this._occluderPosition=m.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var HD=new m;Object.defineProperties(Vc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,HD),n=m.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=m.multiplyByScalar(t,n,HD);let a=o*o*n;s=m.add(e,m.multiplyByScalar(r,a,HD),HD)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Vc.fromBoundingSphere=function(e,t,n){return l(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Vc(e,t)};var cye=new m;Vc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,cye),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var Uct=new m;Vc.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,Uct),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,cye),o=this._occluderRadius-n;if(o=m.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),o*o+n*n>m.magnitudeSquared(i)):!1;if(o>0){i=m.subtract(t,this._cameraPosition,i);let r=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var Dct=new m;Vc.prototype.computeVisibility=function(e){let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return hr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,Dct),o=this._occluderRadius-n,r=m.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return o*o+n*n<s?hr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?hr.FULL:hr.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?hr.PARTIAL:hr.FULL))}}return hr.NONE};var zD=new m;Vc.computeOccludeePoint=function(e,t,n){let i=m.clone(t),o=m.clone(e.center),r=e.radius,s=n.length,a=m.normalize(m.subtract(i,o,zD),zD),c=-m.dot(a,o),d=Vc._anyRotationVector(o,a,c),u=Vc._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let h;for(let g=1;g<s;++g){if(h=Vc._horizonToPlaneNormalDotProduct(e,a,c,d,n[g]),!h)return;h<u&&(u=h)}if(u<.0017453283658983088)return;let p=r/u;return m.add(o,m.multiplyByScalar(a,p,zD),zD)};var Bct=[];Vc.computeOccludeePointFromRectangle=function(e,t){t=y(t,ne.default);let n=ce.subsample(e,t,0,Bct),i=le.fromPoints(n),o=m.ZERO;if(!m.equals(o,i.center))return Vc.computeOccludeePoint(new le(o,t.minimumRadius),i.center,n)};var Oct=new m;Vc._anyRotationVector=function(e,t,n){let i=m.abs(t,Oct),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new m,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,r),i),e,i),i)};var Yct=new m;Vc._rotationVector=function(e,t,n,i,o){let r=m.subtract(i,e,Yct);if(r=m.normalize(r,r),m.dot(t,r)<.9999999847691291){let s=m.cross(t,r,r);if(m.magnitude(s)>W.EPSILON13)return m.normalize(s,new m)}return o};var sj=new m,Hct=new m,KD=new m,aye=new m;Vc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=m.clone(o,sj),s=m.clone(e.center,Hct),a=e.radius,c=m.subtract(s,r,KD),d=m.magnitudeSquared(c),u=a*a;if(d<u)return!1;let h=d-u,p=Math.sqrt(h),f=1/Math.sqrt(d),_=p*f*p;c=m.normalize(c,c);let C=m.add(r,m.multiplyByScalar(c,_,aye),aye),V=Math.sqrt(h-_*_),L=this._rotationVector(s,t,n,r,i),Z=m.fromElements(L.x*L.x*c.x+(L.x*L.y-L.z)*c.y+(L.x*L.z+L.y)*c.z,(L.x*L.y+L.z)*c.x+L.y*L.y*c.y+(L.y*L.z-L.x)*c.z,(L.x*L.z-L.y)*c.x+(L.y*L.z+L.x)*c.y+L.z*L.z*c.z,sj);Z=m.normalize(Z,Z);let G=m.multiplyByScalar(Z,V,sj);L=m.normalize(m.subtract(m.add(C,G,KD),s,KD),KD);let I=m.dot(t,L);L=m.normalize(m.subtract(m.subtract(C,G,L),s,L),L);let v=m.dot(t,L);return I<v?I:v};var jw=Vc;var fXi=T(S(),1);var cXi=T(S(),1);function $f(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new hs,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function aj(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=M.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=M.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties($f.prototype,{projectionMatrix:{get:function(){return aj(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return aj(this),this._infinitePerspective}}});var zct=new m,Kct=new m,Jct=new m,Qct=new m;$f.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=m.cross(t,n,zct),h=Kct;m.multiplyByScalar(t,c,h),m.add(e,h,h);let p=Jct;m.multiplyByScalar(t,d,p),m.add(e,p,p);let g=Qct;m.multiplyByScalar(u,a,g),m.add(h,g,g),m.subtract(g,e,g),m.normalize(g,g),m.cross(g,n,g),m.normalize(g,g);let f=i[0];return l(f)||(f=i[0]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(u,s,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(n,g,g),m.normalize(g,g),f=i[1],l(f)||(f=i[1]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(n,r,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(u,g,g),m.normalize(g,g),f=i[2],l(f)||(f=i[2]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),m.multiplyByScalar(n,o,g),m.add(h,g,g),m.subtract(g,e,g),m.cross(g,u,g),m.normalize(g,g),f=i[3],l(f)||(f=i[3]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,e),f=i[4],l(f)||(f=i[4]=new se),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-m.dot(t,h),m.negate(t,g),f=i[5],l(f)||(f=i[5]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-m.dot(g,p),this._cullingVolume};$f.prototype.getPixelDimensions=function(e,t,n,i,o){aj(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};$f.prototype.clone=function(e){return l(e)||(e=new $f),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};$f.prototype.equals=function(e){return l(e)&&e instanceof $f&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};$f.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof $f&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var hl=$f;function jl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new hl,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}jl.packedLength=6;jl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};jl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new jl),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Fh(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(jl.prototype,{projectionMatrix:{get:function(){return Fh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Fh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Fh(this),this._fovy}},sseDenominator:{get:function(){return Fh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Fh(this),this._offCenterFrustum}}});jl.prototype.computeCullingVolume=function(e,t,n){return Fh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};jl.prototype.getPixelDimensions=function(e,t,n,i,o){return Fh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};jl.prototype.clone=function(e){return l(e)||(e=new jl),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};jl.prototype.equals=function(e){return!l(e)||!(e instanceof jl)?!1:(Fh(this),Fh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};jl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof jl)?!1:(Fh(this),Fh(e),W.equalsEpsilon(this.fov,e.fov,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Gi=jl;var GXi=T(S(),1);var bXi=T(S(),1),qw=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; + +float vdcRadicalInverse(int i) +{ + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) + { + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); + } + return value; +} + +vec2 hammersley2D(int i, int N) +{ + return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} + +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ + float alphaRoughnessSquared = alphaRoughness * alphaRoughness; + float phi = 2.0 * M_PI * xi.x; + float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); + vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangentX = normalize(cross(upVector, N)); + vec3 tangentY = cross(N, tangentX); + return tangentX * H.x + tangentY * H.y + N * H.z; +} + +/** + * Estimate the geometric self-shadowing of the microfacets in a surface, + * using the Smith Joint GGX visibility function. + * Note: Vis = G / (4 * NdotL * NdotV) + * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3 + * see Real-Time Rendering. Page 331 to 336. + * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg) + * + * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness. + * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source. + * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera. + */ +float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) +{ + float alphaRoughnessSq = alphaRoughness * alphaRoughness; + + float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); + float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); + + float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0 + if (GGX > 0.0) + { + return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0 + } + return 0.0; +} + +vec2 integrateBrdf(float roughness, float NdotV) +{ + vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); + float A = 0.0; + float B = 0.0; + const int NumSamples = 1024; + float alphaRoughness = roughness * roughness; + for (int i = 0; i < NumSamples; i++) + { + vec2 xi = hammersley2D(i, NumSamples); + vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); + vec3 L = 2.0 * dot(V, H) * H - V; + float NdotL = clamp(L.z, 0.0, 1.0); + float NdotH = clamp(H.z, 0.0, 1.0); + float VdotH = clamp(dot(V, H), 0.0, 1.0); + if (NdotL > 0.0) + { + float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); + float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; + float Fc = pow(1.0 - VdotH, 5.0); + A += (1.0 - Fc) * G_Vis; + B += Fc * G_Vis; + } + } + return vec2(A, B) / float(NumSamples); +} + +void main() +{ + out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); +} +`;function $w(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties($w.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function jct(e,t,n){let i=t.createViewportQuadCommand(qw,{framebuffer:n,renderState:Ue.fromCache({viewport:new ze(0,0,256,256)})});e._drawCommand=i}$w.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Xt({context:t,width:256,height:256,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:qt.NEAREST});this._colorTexture=n;let i=new Wr({context:t,colorTextures:[n],destroyAttachments:!1});jct(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};$w.prototype.isDestroyed=function(){return!1};$w.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),me(this)};var eF=$w;var yWi=T(S(),1);var kXi=T(S(),1);var mye={};function qct(e,t,n){let i,o,r;if(e instanceof Gi){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof hl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var $ct=new m,lye=new m;function hye(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(d){let u=n(d);if(d<=.5){let p=(u-o)/a;return W.lerp(e,-W.PI_OVER_TWO,p)}let h=(u-r)/c;return W.lerp(-W.PI_OVER_TWO,t,1-h)}}return function(o){return W.lerp(e,t,o)}}function lj(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,d=e.up,u=e.right,h=e.frustum,p=m.subtract(a,c,$ct),g=m.magnitude(m.multiplyByScalar(d,m.dot(p,d),lye)),f=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),lye));r=Math.min(qct(h,g,f)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return W.lerp(n,i,a)}}function tF(e,t){return W.equalsEpsilon(e,W.TWO_PI,W.EPSILON11)&&(e=0),t>e+Math.PI?e+=W.TWO_PI:t<e-Math.PI&&(e-=W.TWO_PI),e}var fye=new m;function elt(e,t,n,i,o,r,s,a){let c=e.camera,d=m.clone(c.position,fye),u=c.pitch,h=tF(c.heading,i),p=tF(c.roll,r),g=lj(c,n,d.z,n.z,s),f=hye(u,o,g,a);function x(_){let C=_.time/t;c.setView({orientation:{heading:W.lerp(h,i,C),pitch:f(C),roll:W.lerp(p,r,C)}}),D.lerp(d,n,C,c.position),c.position.z=g(C)}return x}function tlt(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function nlt(e,t){let n=e.longitude-t.longitude;n<-W.PI?e.longitude+=W.TWO_PI:n>W.PI&&(t.longitude+=W.TWO_PI)}var ilt=new he,olt=new he;function rlt(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(u.positionCartographic,ilt),f=u.pitch,x=tF(u.heading,i),_=tF(u.roll,r),C=p.cartesianToCartographic(n,olt);g.longitude=W.zeroToTwoPi(g.longitude),C.longitude=W.zeroToTwoPi(C.longitude);let V=!1;if(l(a)){let I=W.zeroToTwoPi(a),v=Math.min(g.longitude,C.longitude),P=Math.max(g.longitude,C.longitude),w=I>=v&&I<=P;if(l(c)){let F=Math.abs(g.longitude-C.longitude),b=W.TWO_PI-F;(w?F:b)<(w?b:F)*c&&!w&&(V=!0)}else w||(V=!0)}V?tlt(g,C):nlt(g,C);let L=lj(u,n,g.height,C.height,s),Z=hye(f,o,L,d);function G(){let I=g.longitude,v=C.longitude,P=g.latitude,w=C.latitude;return function(b){let R=b.time/t,E=m.fromRadians(W.lerp(I,v,R),W.lerp(P,w,R),L(R),p);u.setView({destination:E,orientation:{heading:W.lerp(x,i,R),pitch:Z(R),roll:W.lerp(_,r,R)}})}}return G()}function slt(e,t,n,i,o,r,s){let a=e.camera,c=m.clone(a.position,fye),d=tF(a.heading,i),u=a.frustum.right-a.frustum.left,h=lj(a,n,u,n.z,s);function p(g){let f=g.time/t;a.setView({orientation:{heading:W.lerp(d,i,f)}}),D.lerp(c,n,f,a.position);let x=h(f),_=a.frustum,C=_.top/_.right,V=(x-(_.right-_.left))*.5;_.right+=V,_.left-=V,_.top=C*_.right,_.bottom=-_.top}return p}var dye=new he,alt=new m;function cj(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function uye(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}mye.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===oe.MORPHING)return cj();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,dye),n=r.project(dye,alt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let f=t.duration;l(f)||(f=Math.ceil(m.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let x=y(t.heading,0),_=y(t.pitch,-W.PI_OVER_TWO),C=y(t.roll,0),V=e.screenSpaceCameraController;V.enableInputs=!1;let L=uye(V,t.complete),Z=uye(V,t.cancel),G=p.frustum,I=e.mode===oe.SCENE2D;if(I=I&&D.equalsEpsilon(p.position,n,W.EPSILON6),I=I&&W.equalsEpsilon(Math.max(G.right-G.left,G.top-G.bottom),n.z,W.EPSILON6),I=I||e.mode!==oe.SCENE2D&&m.equalsEpsilon(n,p.position,W.EPSILON10),I=I&&W.equalsEpsilon(W.negativePiToPi(x),W.negativePiToPi(p.heading),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(_),W.negativePiToPi(p.pitch),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(C),W.negativePiToPi(p.roll),W.EPSILON10),I)return cj(L,Z);let v=new Array(4);if(v[oe.SCENE2D]=slt,v[oe.SCENE3D]=rlt,v[oe.COLUMBUS_VIEW]=elt,f<=0)return cj(function(){v[i](e,1,n,x,_,C,a,c,d,u)({time:1}),typeof L=="function"&&L()},Z);let P=v[i](e,f,n,x,_,C,a,c,d,u);if(!l(h)){let w=p.positionCartographic.height,F=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;w>F&&w>11500?h=Hr.CUBIC_OUT:h=Hr.QUINTIC_IN_OUT}return{duration:f,easingFunction:h,startObject:{time:0},stopObject:{time:f},update:P,complete:L,cancel:Z}};var nF=mye;var DXi=T(S(),1),clt={ROTATE:0,INFINITE_SCROLL:1},ql=Object.freeze(clt);function tn(e){this._scene=e,this._transform=M.clone(M.IDENTITY),this._invTransform=M.clone(M.IDENTITY),this._actualTransform=M.clone(M.IDENTITY),this._actualInvTransform=M.clone(M.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new Gi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new ge,this._moveEnd=new ge,this._changed=new ge,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new M,this._invViewMatrix=new M,Sye(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,W.PI_OVER_TWO)),this._max2Dfrustum=void 0,vye(this,tn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*tn.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}tn.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);tn.TRANSFORM_2D_INVERSE=M.inverseTransformation(tn.TRANSFORM_2D,new M);tn.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);tn.DEFAULT_VIEW_FACTOR=.5;tn.DEFAULT_OFFSET=new rm(0,-W.PI_OVER_FOUR,0);function Sye(e){M.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),M.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),M.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function llt(e){if(!l(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ti()):e.timeSinceMoved=Math.max(Ti()-e._lastMovedTimestamp,0)/1e3}}tn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==oe.SCENE2D};tn.prototype._updateCameraChanged=function(){let e=this;if(llt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%W.TWO_PI;i=i>W.PI?W.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%W.TWO_PI;s=s>W.PI?W.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===oe.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,f=e.frustum,x=e._changedFrustum,_=p.x+f.left,C=p.x+f.right,V=g.x+x.left,L=g.x+x.right,Z=p.y+f.bottom,G=p.y+f.top,I=g.y+x.bottom,v=g.y+x.top,P=Math.max(_,V),w=Math.min(C,L),F=Math.max(Z,I),b=Math.min(G,v),R;if(P>=w||F>=G)R=1;else{let E=x;_<V&&C>L&&Z<I&&G>v&&(E=f),R=1-(w-P)*(b-F)/((E.right-E.left)*(E.top-E.bottom))}R>t&&(e._changed.raiseEvent(R),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let c=W.acosClamped(m.dot(e.directionWC,e._changedDirection)),d;l(e.frustum.fovy)?d=c/(e.frustum.fovy*.5):d=c;let h=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||h>t)&&(e._changed.raiseEvent(Math.max(d,h)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function dlt(e){vt.basisTo2D(e._projection,e._transform,e._actualTransform)}var ult=new he,mlt=new m,JD=new m,hlt=new se,flt=new se,plt=new se,blt=new se,glt=new se;function ylt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,hlt),o=n.cartesianToCartographic(i,ult),r=t.project(o,mlt),s=flt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,glt),c=se.add(M.getColumn(e._transform,0,JD),i,JD);n.cartesianToCartographic(c,o),t.project(o,r);let d=plt;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,m.subtract(d,s,d),d.x=0;let u=blt;if(m.magnitudeSquared(d)>W.EPSILON10)m.cross(a,d,u);else{let h=se.add(M.getColumn(e._transform,1,JD),i,JD);n.cartesianToCartographic(h,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,m.subtract(u,s,u),u.x=0,m.magnitudeSquared(u)<W.EPSILON10&&(se.clone(se.UNIT_Y,d),se.clone(se.UNIT_Z,u))}m.cross(u,a,d),m.normalize(d,d),m.cross(a,d,u),m.normalize(u,u),M.setColumn(e._actualTransform,0,d,e._actualTransform),M.setColumn(e._actualTransform,1,u,e._actualTransform),M.setColumn(e._actualTransform,2,a,e._actualTransform),M.setColumn(e._actualTransform,3,s,e._actualTransform)}var dj=new m;function Rc(e){let t=e._mode,n=!1,i=0;t===oe.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!m.equals(o,e.position)||n;r&&(o=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let c=e._up,d=!m.equals(c,e.up);d&&(m.normalize(e.up,e.up),c=m.clone(e.up,e._up));let u=e._right,h=!m.equals(u,e.right);h&&(m.normalize(e.right,e.right),u=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(tn.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?dlt(e):ylt(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=M.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=dj;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===oe.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||h){let f=m.dot(s,m.cross(c,u,dj));if(Math.abs(1-f)>W.EPSILON2){let x=1/m.magnitudeSquared(c),_=m.dot(c,s)*x,C=m.multiplyByScalar(s,_,dj);c=m.normalize(m.subtract(c,C,e._up),e._up),m.clone(c,e.up),u=m.cross(s,c,e._right),m.clone(u,e.right)}}(a||p)&&(e._directionWC=M.multiplyByPointAsVector(g,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=M.multiplyByPointAsVector(g,c,e._upWC),m.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=M.multiplyByPointAsVector(g,u,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(r||a||d||h||p)&&Sye(e)}function Cye(e,t){let n;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)?n=Math.atan2(t.y,t.x)-W.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-W.PI_OVER_TWO,W.TWO_PI-W.zeroToTwoPi(n)}function Vye(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function Lye(e,t,n){let i=0;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=W.zeroToTwoPi(i+W.TWO_PI)),i}var qD=new M,$D=new M;Object.defineProperties(tn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Rc(this),this._invTransform}},viewMatrix:{get:function(){return Rc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Rc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Rc(this),this._positionCartographic}},positionWC:{get:function(){return Rc(this),this._positionWC}},directionWC:{get:function(){return Rc(this),this._directionWC}},upWC:{get:function(){return Rc(this),this._upWC}},rightWC:{get:function(){return Rc(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,qD),n=vt.eastNorthUpToFixedFrame(this.positionWC,e,$D);this._setTransform(n);let i=Cye(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,qD),n=vt.eastNorthUpToFixedFrame(this.positionWC,e,$D);this._setTransform(n);let i=Vye(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,qD),n=vt.eastNorthUpToFixedFrame(this.positionWC,e,$D);this._setTransform(n);let i=Lye(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});tn.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==oe.MORPHING,t=this._mode===oe.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===oe.SCENE2D&&Eye(this,this.position)};var xlt=new m,_lt=new m,Tlt=new m;tn.prototype._setTransform=function(e){let t=m.clone(this.positionWC,xlt),n=m.clone(this.upWC,_lt),i=m.clone(this.directionWC,Tlt);M.clone(e,this._transform),this._transformChanged=!0,Rc(this);let o=this._actualInvTransform;M.multiplyByPoint(o,t,this.position),M.multiplyByPointAsVector(o,i,this.direction),M.multiplyByPointAsVector(o,n,this.up),m.cross(this.direction,this.up,this.right),Rc(this)};var Slt=new D,Clt=new pn,Vlt=new m,Llt=new m;function Rye(e){if(!M.equals(M.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=Slt;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,Clt);o=n.pickWorldCoordinates(a,t,!0,Vlt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,Llt));let s;if(l(o)||l(r)){let a=l(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}tn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof rn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Rye(this)))};var eB=new m,pj=new M,Rlt=new M,bj=new ve,gj=new $,Zye=new he;function Zlt(e,t,n){let i=M.clone(e.transform,pj),o=vt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Rlt);e._setTransform(o),m.clone(m.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=ve.fromHeadingPitchRoll(n,bj),s=$.fromQuaternion(r,gj);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Glt(e,t,n,i){let o=M.clone(e.transform,pj);if(e._setTransform(M.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Zye);t=a.project(c,eB)}m.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=ve.fromHeadingPitchRoll(n,bj),s=$.fromQuaternion(r,gj);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Elt(e,t,n,i){let o=M.clone(e.transform,pj);if(e._setTransform(M.IDENTITY),!m.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,Zye);t=c.project(d,eB)}D.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===ql.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=ve.fromHeadingPitchRoll(n,bj),s=$.fromQuaternion(r,gj);$.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Ilt=new m,Xlt=new m,Wlt=new m;function Gye(e,t,n,i){let o=m.clone(n.direction,Ilt),r=m.clone(n.up,Xlt);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,c=vt.eastNorthUpToFixedFrame(t,a,qD),d=M.inverseTransformation(c,$D);M.multiplyByPointAsVector(d,o,o),M.multiplyByPointAsVector(d,r,r)}let s=m.cross(o,r,Wlt);return i.heading=Cye(o,r),i.pitch=Vye(o),i.roll=Lye(o,r,s),i}var fj={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},zV=new Ra;tn.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===oe.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,m.clone(this.positionWC,eB));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,eB),i=!1),l(t.direction)&&(t=Gye(this,o,t,fj.orientation)),zV.heading=y(t.heading,0),zV.pitch=y(t.pitch,-W.PI_OVER_TWO),zV.roll=y(t.roll,0),n===oe.SCENE3D?Zlt(this,o,zV):n===oe.SCENE2D?Elt(this,o,zV,i):Glt(this,o,zV,i)};var Plt=new m;tn.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:tn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(tn.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*tn.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,Plt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};tn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),Rc(this),M.multiplyByVector(this._actualInvTransform,e,t)};tn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new m),Rc(this),M.multiplyByPoint(this._actualInvTransform,e,t)};tn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new m),Rc(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};tn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),Rc(this),M.multiplyByVector(this._actualTransform,e,t)};tn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new m),Rc(this),M.multiplyByPoint(this._actualTransform,e,t)};tn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new m),Rc(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function Eye(e,t){let n=e._scene.mapMode2D===ql.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var pye=new m;tn.prototype.move=function(e,t){let n=this.position;m.multiplyByScalar(e,t,pye),m.add(n,pye,n),this._mode===oe.SCENE2D&&Eye(this,n),this._adjustOrthographicFrustum(!0)};tn.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?tB(this,e):this.move(this.direction,e)};tn.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?tB(this,-e):this.move(this.direction,-e)};tn.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};tn.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};tn.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};tn.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};tn.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,-e)};tn.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,e)};tn.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,-e)};tn.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,e)};var vlt=new ve,wlt=new $;tn.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=ve.fromAxisAngle(e,-n,vlt),o=$.fromQuaternion(i,wlt),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};tn.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};tn.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Flt=new ve,Alt=new $;tn.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=ve.fromAxisAngle(e,-n,Flt),o=$.fromQuaternion(i,Alt);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};tn.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),Iye(this,e)};tn.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),Iye(this,-e)};var Mlt=new m,Nlt=new m,klt=new m,bye=new m;function Iye(e,t){let n=e.position;if(l(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,W.EPSILON2)){let i=m.normalize(n,Mlt),o=m.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=m.equalsEpsilon(i,m.negate(e.constrainedAxis,bye),W.EPSILON2);if(!o&&!r){let s=m.normalize(e.constrainedAxis,Nlt),a=m.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=m.dot(i,m.negate(s,bye)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=m.cross(s,i,klt);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}tn.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),Xye(this,-e)};tn.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),Xye(this,e)};function Xye(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function tB(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===ql.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===ql.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Wye(e,t){e.move(e.direction,t)}tn.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?tB(this,e):Wye(this,e)};tn.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?tB(this,-e):Wye(this,-e)};tn.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return m.magnitude(this.position);if(this._mode===oe.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===oe.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Ult=new M;tn.prototype.lookAt=function(e,t){let n=this._scene,i=y(n.ellipsoid,ne.default),o=vt.eastNorthUpToFixedFrame(e,i,Ult);this.lookAtTransform(o,t)};var Dlt=new m,Blt=new ve,Olt=new ve,Ylt=new $;function Pye(e,t,n){t=W.clamp(t,-W.PI_OVER_TWO,W.PI_OVER_TWO),e=W.zeroToTwoPi(e)-W.PI_OVER_TWO;let i=ve.fromAxisAngle(m.UNIT_Y,-t,Blt),o=ve.fromAxisAngle(m.UNIT_Z,-e,Olt),r=ve.multiply(o,i,o),s=$.fromQuaternion(r,Ylt),a=m.clone(m.UNIT_X,Dlt);return $.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}tn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=Pye(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){D.clone(D.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<W.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(M.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<W.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var iF=new he,Hlt=new he,zlt=new m,Klt=new m,Jlt=new m,Qlt=new m,jlt=new m,qlt=new m,$lt=new m,uj=new m,edt={direction:new m,right:new m,up:new m},gye;function Lc(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function vye(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:edt,{north:s,south:a,west:c}=t,{east:d}=t;c>d&&(d+=W.TWO_PI);let u=(c+d)*.5,h;if(a<-W.PI_OVER_TWO+W.RADIANS_PER_DEGREE&&s>W.PI_OVER_TWO-W.RADIANS_PER_DEGREE)h=0;else{let w=iF;w.longitude=u,w.latitude=s,w.height=0;let F=Hlt;F.longitude=u,F.latitude=a,F.height=0;let b=gye;(!l(b)||b.ellipsoid!==o)&&(gye=b=new vp(void 0,void 0,o)),b.setEndPoints(w,F),h=b.interpolateUsingFraction(.5,iF).latitude}let p=iF;p.longitude=u,p.latitude=h,p.height=0;let g=o.cartographicToCartesian(p,$lt),f=iF;f.longitude=d,f.latitude=s;let x=o.cartographicToCartesian(f,zlt);f.longitude=c;let _=o.cartographicToCartesian(f,Jlt);f.longitude=u;let C=o.cartographicToCartesian(f,jlt);f.latitude=a;let V=o.cartographicToCartesian(f,qlt);f.longitude=d;let L=o.cartographicToCartesian(f,Qlt);f.longitude=c;let Z=o.cartographicToCartesian(f,Klt);m.subtract(_,g,_),m.subtract(L,g,L),m.subtract(x,g,x),m.subtract(Z,g,Z),m.subtract(C,g,C),m.subtract(V,g,V);let G=o.geodeticSurfaceNormal(g,r.direction);m.negate(G,G);let I=m.cross(G,m.UNIT_Z,r.right);m.normalize(I,I);let v=m.cross(I,G,r.up),P;if(e.frustum instanceof rn){let w=Math.max(m.distance(x,_),m.distance(L,Z)),F=Math.max(m.distance(x,L),m.distance(_,Z)),b,R,E=e.frustum._offCenterFrustum,X=E.right/E.top,A=F*X;w>A?(b=w,R=b/X):(R=F,b=A),P=Math.max(b,R)}else{let w=Math.tan(e.frustum.fovy*.5),F=e.frustum.aspectRatio*w;if(P=Math.max(Lc(G,v,_,w),Lc(G,v,L,w),Lc(G,v,x,w),Lc(G,v,Z,w),Lc(G,v,C,w),Lc(G,v,V,w),Lc(G,I,_,F),Lc(G,I,L,F),Lc(G,I,x,F),Lc(G,I,Z,F),Lc(G,I,C,F),Lc(G,I,V,F)),a<0&&s>0){let b=iF;b.longitude=c,b.latitude=0,b.height=0;let R=o.cartographicToCartesian(b,uj);m.subtract(R,g,R),P=Math.max(P,Lc(G,v,R,w),Lc(G,I,R,F)),b.longitude=d,R=o.cartographicToCartesian(b,uj),m.subtract(R,g,R),P=Math.max(P,Lc(G,v,R,w),Lc(G,I,R,F))}}return m.add(g,m.multiplyByScalar(G,-P,uj),n)}var tdt=new he,ndt=new m,idt=new m;function odt(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=tdt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,ndt);M.multiplyByPoint(o,a,a),M.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,idt);if(M.multiplyByPoint(o,c,c),M.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-c.x)/u,(a.y-c.y)/d)*.5}else{let d=a.x-c.x,u=a.y-c.y;n.z=Math.max(d,u)}return n}var rdt=new he,sdt=new m,adt=new m;function cdt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===ql.INFINITE_SCROLL?o+=W.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=rdt;r.longitude=o,r.latitude=t.north;let s=i.project(r,sdt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,adt),c=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,h,p=e.frustum.right/e.frustum.top,g=d*p;return c>g?(u=c,h=u/p):(h=d,u=g),d=Math.max(2*u,2*h),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=d,n=i.project(r,n),n}tn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new m),n===oe.SCENE3D)return vye(this,e,t);if(n===oe.COLUMBUS_VIEW)return odt(this,e,t);if(n===oe.SCENE2D)return cdt(this,e,t)};var ldt=new pn;function ddt(e,t,n,i){n=y(n,ne.default);let o=e.getPickRay(t,ldt),r=qn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return pn.getPoint(o,s,i)}var udt=new pn;function mdt(e,t,n,i){let r=e.getPickRay(t,udt).origin;r=m.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var hdt=new pn;function fdt(e,t,n,i){let o=e.getPickRay(t,hdt),r=-o.origin.x/o.direction.x;pn.getPoint(o,r,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}tn.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new m),t=y(t,ne.default),this._mode===oe.SCENE3D)n=ddt(this,e,t,n);else if(this._mode===oe.SCENE2D)n=mdt(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=fdt(this,e,this._projection,n);else return;return n}};var pdt=new m,bdt=new m,gdt=new m;function ydt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,h=e.positionWC;m.clone(h,n.origin);let p=m.multiplyByScalar(e.directionWC,c,pdt);m.add(h,p,p);let g=m.multiplyByScalar(e.rightWC,d*c*a,bdt),f=m.multiplyByScalar(e.upWC,u*c*s,gdt),x=m.add(p,g,n.direction);return m.add(x,f,x),m.subtract(x,h,x),m.normalize(x,x),n}var QD=new m;function xdt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let d=2/r*(r-t.y)-1;d*=(s.top-s.bottom)*.5;let u=n.origin;return m.clone(e.position,u),m.multiplyByScalar(e.right,c,QD),m.add(QD,u,u),m.multiplyByScalar(e.up,d,QD),m.add(QD,u,u),m.clone(e.directionWC,n.direction),(e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D)&&m.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}tn.prototype.getPickRay=function(e,t){l(t)||(t=new pn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?ydt(this,e,t):xdt(this,e,t)};var _dt=new m,Tdt=new m;tn.prototype.distanceToBoundingSphere=function(e){let t=m.subtract(this.positionWC,e.center,_dt),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),Tdt);return Math.max(0,m.magnitude(n)-e.radius)};var Sdt=new D;tn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Sdt);return Math.max(o.x,o.y)};function Cdt(e,t,n,i,o,r){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let d=m.lerp(t,s,c.time,new m);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:Hr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var Vdt=new m,yye=new m,Ldt=new m,Rdt=new m;function Zdt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(m.UNIT_X,Vdt),r=-m.dot(o,n)/m.dot(o,i),s=m.add(n,m.multiplyByScalar(i,r,yye),yye);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Ldt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=m.magnitude(m.subtract(n,s,Rdt)),u=c*d,h=a*d,p=e._maxCoord.x,g=e._maxCoord.y,f=Math.max(u-p,p),x=Math.max(h-g,g);if(n.z<-f||n.z>f||n.y<-x||n.y>x){let _=s.y<-f||s.y>f,C=s.z<-x||s.z>x;if(_||C)return Cdt(e,n,s,f,x,t)}}tn.prototype.createCorrectPositionTween=function(e){if(this._mode===oe.COLUMBUS_VIEW)return Zdt(this,e)};var Gdt=new m,$s={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};tn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};tn.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=$s.destination,e.orientation.heading=$s.heading,e.orientation.pitch=$s.pitch,e.orientation.roll=$s.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};tn.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,Gdt));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=Gye(this,t,o,fj.orientation)),l(e.duration)&&e.duration<=0){let u=fj;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;$s.destination=t,$s.heading=o.heading,$s.pitch=o.pitch,$s.roll=o.roll,$s.duration=e.duration,$s.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},$s.cancel=e.cancel,$s.endTransform=e.endTransform,$s.convert=i?!1:e.convert,$s.maximumHeight=e.maximumHeight,$s.pitchAdjustHeight=e.pitchAdjustHeight,$s.flyOverLongitude=e.flyOverLongitude,$s.flyOverLongitudeWeight=e.flyOverLongitudeWeight,$s.easingFunction=e.easingFunction;let a=this._scene,c=nF.createTween(a,$s);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(l(d)||(d=tn.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function Edt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Idt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var Xdt=100;function wye(e,t,n){n=rm.clone(l(n)?n:tn.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=Xdt:e.frustum instanceof rn||e._mode===oe.SCENE2D?n.range=Idt(e,s):n.range=Edt(e,s),n.range=W.clamp(n.range,i,o)}return n}tn.prototype.viewBoundingSphere=function(e,t){t=wye(this,e,t),this.lookAt(e.center,t)};var Wdt=new M,Pdt=new m,vdt=new m,wdt=new m,Fdt=new m,Adt=new se,Mdt=new ve,Ndt=new $;tn.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=wye(this,e,t.offset),o;n?o=m.multiplyByScalar(m.UNIT_Z,i.range,Pdt):o=Pye(i.heading,i.pitch,i.range);let r=this._scene,s=y(r.ellipsoid,ne.default),a=vt.eastNorthUpToFixedFrame(e.center,s,Wdt);M.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=m.subtract(e.center,o,vdt),m.normalize(c,c),d=M.multiplyByPointAsVector(a,m.UNIT_Z,wdt),1-Math.abs(m.dot(c,d))<W.EPSILON6){let h=ve.fromAxisAngle(c,i.heading,Mdt),p=$.fromQuaternion(h,Ndt);m.fromCartesian4(M.getColumn(a,1,Adt),d),$.multiplyByVector(p,d,d)}let u=m.cross(c,d,Fdt);m.cross(u,c,d),m.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:c,up:d},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var xye=new m,_ye=new m,mj=new m,Tye=new m,oF=[new m,new m,new m,new m];function kdt(e,t){let n=t.radii,i=e.positionWC,o=m.multiplyComponents(t.oneOverRadii,i,xye),r=m.magnitude(o),s=m.normalize(o,_ye),a,c;m.equalsEpsilon(s,m.UNIT_Z,W.EPSILON10)?(a=new m(0,1,0),c=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,mj),mj),c=m.normalize(m.cross(s,a,Tye),Tye));let d=Math.sqrt(m.magnitudeSquared(o)-1),u=m.multiplyByScalar(s,1/r,xye),h=d/r,p=m.multiplyByScalar(a,h,_ye),g=m.multiplyByScalar(c,h,mj),f=m.add(u,g,oF[0]);m.subtract(f,p,f),m.multiplyComponents(n,f,f);let x=m.subtract(u,g,oF[1]);m.subtract(x,p,x),m.multiplyComponents(n,x,x);let _=m.subtract(u,g,oF[2]);m.add(_,p,_),m.multiplyComponents(n,_,_);let C=m.add(u,g,oF[3]);return m.add(C,p,C),m.multiplyComponents(n,C,C),oF}var hj=new D,Udt=new m,Ly=[new he,new he,new he,new he];function jD(e,t,n,i,o,r){hj.x=e,hj.y=t;let s=i.pickEllipsoid(hj,o,Udt);return l(s)?(Ly[n]=o.cartesianToCartographic(s,Ly[n]),1):(Ly[n]=o.cartesianToCartographic(r[n],Ly[n]),0)}tn.prototype.computeViewRectangle=function(e,t){e=y(e,ne.default);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Ht.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=kdt(this,e);if(c+=jD(0,0,0,this,e,d),c+=jD(0,a,1,this,e,d),c+=jD(s,a,2,this,e,d),c+=jD(s,0,3,this,e,d),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(Ly,t);let u=0,h=Ly[3].longitude;for(let p=0;p<4;++p){let g=Ly[p].longitude,f=Math.abs(g-h);f>W.PI?u+=W.TWO_PI-f:u+=f,h=g}return W.equalsEpsilon(Math.abs(u),W.TWO_PI,W.EPSILON9)&&(t.west=-W.PI,t.east=W.PI,Ly[0].latitude>=0?t.north=W.PI_OVER_TWO:t.south=-W.PI_OVER_TWO),t};tn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof Gi)return;let e=this._scene;this.frustum=new Gi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60)};tn.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof rn)return;let e=Rye(this),t=this._scene;this.frustum=new rn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};tn.clone=function(e,t){return l(t)||(t=new tn(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var ro=tn;var _Wi=T(S(),1);function Ddt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var fm=Ddt;var GWi=T(S(),1);var kye=T(sd(),1),Fye=576,Bdt=100,rF="#ffffff",nB="#48b";function Uye(e,t){this.credit=e,this.count=y(t,1)}function Odt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(St.equals(o,t))return!0}return!1}function Ydt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;St.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Dye="cesium-credit-delimiter";function Aye(e){let t=document.createElement("span");return t.textContent=e,t.className=Dye,t}function Mye(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Nye(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(Aye(n));else{let u=o[d];u.className!==Dye&&e.replaceChild(Aye(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(Mye(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(Mye(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Hdt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<Fye?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=Fye&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function zdt(e){let t=` .cesium-credit-lightbox-overlay { display: none; z-index: 1; @@ -12546,19 +11036,19 @@ ${o?`u_dayTextureBrightness[${Ne}]`:"0.0"}, .cesium-credit-lightbox { background-color: #303336; - color: ${_F}; + color: ${rF}; position: relative; - min-height: ${Ndt}px; + min-height: ${Bdt}px; margin: auto; } .cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited, .cesium-credit-wrapper a, .cesium-credit-wrapper a:visited { - color: ${_F}; + color: ${rF}; } .cesium-credit-lightbox > ul > li a:hover { - color: ${tB}; + color: ${nB}; } .cesium-credit-lightbox.cesium-credit-lightbox-expanded { border: 1px solid #444; @@ -12578,10 +11068,10 @@ ${o?`u_dayTextureBrightness[${Ne}]`:"0.0"}, position: absolute; top: 0; right: 6px; - color: ${_F}; + color: ${rF}; } .cesium-credit-lightbox-close:hover { - color: ${tB}; + color: ${nB}; } .cesium-credit-lightbox > ul { margin: 0; @@ -12600,14 +11090,14 @@ ${o?`u_dayTextureBrightness[${Ne}]`:"0.0"}, padding-left: 5px; cursor: pointer; text-decoration: underline; - color: ${_F}; + color: ${rF}; } .cesium-credit-expand-link:hover { - color: ${tB}; + color: ${nB}; } .cesium-credit-text { - color: ${_F}; + color: ${rF}; } .cesium-credit-delimiter { @@ -12620,13 +11110,60 @@ ${o?`u_dayTextureBrightness[${Ne}]`:"0.0"}, } .cesium-credit-textContainer a:hover { - color: ${tB} + color: ${nB} } .cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { padding-left: 5px; } -`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function fr(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(f){r.contains(f.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let d=document.createElement("ul");r.appendChild(d);let u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Bdt(e);let g=Ct.clone(fr.cesiumCredit);this._delimiter=y(t,"\u2022"),this._screenContainer=h,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=d,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Zt,lightboxCredits:new Zt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function Uye(e,t,n,i){i=y(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Nye(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}fr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Ct.clone(Dye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,Uye(this,t,e)};fr.prototype.addStaticCredit=function(e){let t=this._staticCredits;kdt(t,e)||t.push(e)};fr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};fr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};fr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};fr.prototype.update=function(){this._expanded&&Ddt(this)};fr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Ct.equals(fr.cesiumCredit,this._cesiumCredit)||Uye(this,s,r,Number.MAX_VALUE)}Ct.equals(fr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Ct.clone(fr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};fr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Aye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Aye(this._creditList,t,void 0,"li"),Udt(this)};fr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),me(this)};fr.prototype.isDestroyed=function(){return!1};fr._cesiumCredit=void 0;fr._cesiumCreditInitialized=!1;var nB;function Dye(){if(!l(nB)){let e=rn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Mye.default(e).path()),nB=new Ct(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return fr._cesiumCreditInitialized||(fr._cesiumCredit=nB,fr._cesiumCreditInitialized=!0),nB}Object.defineProperties(fr,{cesiumCredit:{get:function(){return Dye(),fr._cesiumCredit},set:function(e){fr._cesiumCredit=e,fr._cesiumCreditInitialized=!0}}});fr.CreditDisplayElement=Nye;var TF=fr;var r2i=T(S(),1);var LPi=T(S(),1);var iB=0,Odt=1;function XT(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e.vertexFormat,Xe.DEFAULT),r=y(e._drawNearPlane,!0),s,a;t instanceof Ri?(s=iB,a=Ri.packedLength):t instanceof an&&(s=Odt,a=an.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=ve.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+ve.packedLength+Xe.packedLength}XT.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===iB?(Ri.pack(o,t,n),n+=Ri.packedLength):(an.pack(o,t,n),n+=an.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,ve.pack(e._orientation,t,n),n+=ve.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n]=e._drawNearPlane?1:0,t};var Ydt=new Ri,Hdt=new an,zdt=new ve,Kdt=new m,Jdt=new Xe;XT.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===iB?(o=Ri.unpack(e,t,Ydt),t+=Ri.packedLength):(o=an.unpack(e,t,Hdt),t+=an.packedLength);let r=m.unpack(e,t,Kdt);t+=m.packedLength;let s=ve.unpack(e,t,zdt);t+=ve.packedLength;let a=Xe.unpack(e,t,Jdt);t+=Xe.packedLength;let c=e[t]===1;if(!l(n))return new XT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let d=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(d),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=ve.clone(s,n._orientation),n._vertexFormat=Xe.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function zV(e,t,n,i,o,r,s,a){let c=e/3*2;for(let d=0;d<4;++d)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var Qdt=new $,jdt=new M,gj=new M,Bye=new m,Oye=new m,Yye=new m,qdt=new m,$dt=new m,eut=new m,Ry=new Array(3),SF=new Array(4);SF[0]=new se(-1,-1,1,1);SF[1]=new se(1,-1,1,1);SF[2]=new se(1,1,1,1);SF[3]=new se(-1,1,1,1);var Hye=new Array(4);for(let e=0;e<4;++e)Hye[e]=new se;XT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,Qdt),d=y(r,Bye),u=y(s,Oye),h=y(a,Yye);d=$.getColumn(c,0,d),u=$.getColumn(c,1,u),h=$.getColumn(c,2,h),m.normalize(d,d),m.normalize(u,u),m.normalize(h,h),m.negate(d,d);let p=M.computeView(e,h,u,d,jdt),g,f,x=i.projectionMatrix;if(n===iB){let _=M.multiply(x,p,gj);f=M.inverse(_,gj)}else g=M.inverseTransformation(p,gj);l(f)?(Ry[0]=i.near,Ry[1]=i.far):(Ry[0]=0,Ry[1]=i.near,Ry[2]=i.far);for(let _=0;_<2;++_)for(let C=0;C<4;++C){let V=se.clone(SF[C],Hye[C]);if(l(f)){V=M.multiplyByVector(f,V,V);let L=1/V.w;m.multiplyByScalar(V,L,V),m.subtract(V,e,V),m.normalize(V,V);let Z=m.dot(h,V);m.multiplyByScalar(V,Ry[_]/Z,V),m.add(V,e,V)}else{let L=i.offCenterFrustum;l(L)&&(i=L);let Z=Ry[_],G=Ry[_+1];V.x=(V.x*(i.right-i.left)+i.left+i.right)*.5,V.y=(V.y*(i.top-i.bottom)+i.bottom+i.top)*.5,V.z=(V.z*(Z-G)-Z-G)*.5,V.w=1,M.multiplyByVector(g,V,V)}o[12*_+C*3]=V.x,o[12*_+C*3+1]=V.y,o[12*_+C*3+2]=V.z}};XT.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);XT._computeNearFarPlanes(i,o,t,n,c);let d=3*4*2;c[d]=c[3*4],c[d+1]=c[3*4+1],c[d+2]=c[3*4+2],c[d+3]=c[0],c[d+4]=c[1],c[d+5]=c[2],c[d+6]=c[3*3],c[d+7]=c[3*3+1],c[d+8]=c[3*3+2],c[d+9]=c[3*7],c[d+10]=c[3*7+1],c[d+11]=c[3*7+2],d+=3*4,c[d]=c[3*5],c[d+1]=c[3*5+1],c[d+2]=c[3*5+2],c[d+3]=c[3],c[d+4]=c[4],c[d+5]=c[5],c[d+6]=c[0],c[d+7]=c[1],c[d+8]=c[2],c[d+9]=c[3*4],c[d+10]=c[3*4+1],c[d+11]=c[3*4+2],d+=3*4,c[d]=c[3],c[d+1]=c[4],c[d+2]=c[5],c[d+3]=c[3*5],c[d+4]=c[3*5+1],c[d+5]=c[3*5+2],c[d+6]=c[3*6],c[d+7]=c[3*6+1],c[d+8]=c[3*6+2],c[d+9]=c[3*2],c[d+10]=c[3*2+1],c[d+11]=c[3*2+2],d+=3*4,c[d]=c[3*2],c[d+1]=c[3*2+1],c[d+2]=c[3*2+2],c[d+3]=c[3*6],c[d+4]=c[3*6+1],c[d+5]=c[3*6+2],c[d+6]=c[3*7],c[d+7]=c[3*7+1],c[d+8]=c[3*7+2],c[d+9]=c[3*3],c[d+10]=c[3*3+1],c[d+11]=c[3*3+2],r||(c=c.subarray(3*4));let u=new hn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,f=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,_=Bye,C=Oye,V=Yye,L=m.negate(_,qdt),Z=m.negate(C,$dt),G=m.negate(V,eut);d=0,r&&(zV(d,p,g,f,x,G,_,C),d+=3*4),zV(d,p,g,f,x,V,L,C),d+=3*4,zV(d,p,g,f,x,L,G,C),d+=3*4,zV(d,p,g,f,x,Z,G,L),d+=3*4,zV(d,p,g,f,x,_,V,C),d+=3*4,zV(d,p,g,f,x,C,V,L),l(p)&&(u.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(u.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),l(f)&&(u.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),l(x)&&(u.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:x}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,f=p*4;h[g]=f,h[g+1]=f+1,h[g+2]=f+2,h[g+3]=f,h[g+4]=f+2,h[g+5]=f+3}return new lt({attributes:u,indices:h,primitiveType:we.TRIANGLES,boundingSphere:le.fromVertices(c)})};var WT=XT;var kPi=T(S(),1);var yj=0,tut=1;function CF(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e._drawNearPlane,!0),r,s;t instanceof Ri?(r=yj,s=Ri.packedLength):t instanceof an&&(r=tut,s=an.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=ve.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+ve.packedLength}CF.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===yj?(Ri.pack(o,t,n),n+=Ri.packedLength):(an.pack(o,t,n),n+=an.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,ve.pack(e._orientation,t,n),n+=ve.packedLength,t[n]=e._drawNearPlane?1:0,t};var nut=new Ri,iut=new an,out=new ve,rut=new m;CF.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===yj?(o=Ri.unpack(e,t,nut),t+=Ri.packedLength):(o=an.unpack(e,t,iut),t+=an.packedLength);let r=m.unpack(e,t,rut);t+=m.packedLength;let s=ve.unpack(e,t,out);t+=ve.packedLength;let a=e[t]===1;if(!l(n))return new CF({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=ve.clone(s,n._orientation),n._drawNearPlane=a,n};CF.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);WT._computeNearFarPlanes(i,o,t,n,s);let a=new hn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),c,d,u=r?2:1,h=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,d=p*4,h[c]=d,h[c+1]=d+1,h[c+2]=d+1,h[c+3]=d+2,h[c+4]=d+2,h[c+5]=d+3,h[c+6]=d+3,h[c+7]=d;for(p=0;p<2;++p)c=(u+p)*8,d=p*4,h[c]=d,h[c+1]=d+4,h[c+2]=d+1,h[c+3]=d+5,h[c+4]=d+2,h[c+5]=d+6,h[c+6]=d+3,h[c+7]=d+7;return new lt({attributes:a,indices:h,primitiveType:we.LINES,boundingSphere:le.fromVertices(s)})};var VF=CF;function oB(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,B.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var sut=new m,aut=new $,cut=new ve,lut=new Ri,dut=new ul,uut=new an,mut=new Pr,hut=new B,fut=[1,1e5];oB.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Ri?a=lut:s instanceof ul?a=dut:s instanceof an?a=uut:a=mut,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=fut,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,c=1):c=d.length-1;let u=r.positionWC,h=r.directionWC,p=r.upWC,g=r.rightWC;g=m.negate(g,sut);let f=aut;$.setColumn(f,0,g,f),$.setColumn(f,1,p,f),$.setColumn(f,2,h,f);let x=ve.fromRotationMatrix(f,cut);for(t.length=n.length=c,i=0;i<c;++i)a.near=d[i],a.far=d[i+1],t[i]=new In({geometryInstances:new Gt({geometry:new WT({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ht.fromColor(B.fromAlpha(this._color,.1,hut))},id:this.id,pickPrimitive:this}),appearance:new dn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Gt({geometry:new VF({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ht.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};oB.prototype.isDestroyed=function(){return!1};oB.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return me(this)};var $f=oB;var G2i=T(S(),1);function RF(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var LF=Ot.supportsTypedArrays()?new Float32Array(12):[],zye=new m,Kye=new m,xj=new m,Jye=new m,rB=new m;function put(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof an)o=m.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,h,zye),g=m.normalize(p,Kye),f=m.normalize(m.cross(m.UNIT_Z,p,xj),xj),x=m.normalize(m.cross(g,f,Jye),Jye),_=m.magnitude(p),C=Math.sqrt(_*_-1);o=m.multiplyByScalar(g,1/_,zye);let V=C/_;r=m.multiplyByScalar(f,V,Kye),s=m.multiplyByScalar(x,V,xj)}let a=m.add(o,s,rB);m.subtract(a,r,a),m.multiplyComponents(n,a,a),m.pack(a,LF,0);let c=m.subtract(o,s,rB);m.subtract(c,r,c),m.multiplyComponents(n,c,c),m.pack(c,LF,3);let d=m.add(o,s,rB);m.add(d,r,d),m.multiplyComponents(n,d,d),m.pack(d,LF,6);let u=m.subtract(o,s,rB);return m.add(u,r,u),m.multiplyComponents(n,u,u),m.pack(u,LF,9),LF}RF.prototype.update=function(e){if(this._mode=e.mode,e.mode!==oe.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ne(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new qe({renderState:this._rs,boundingVolume:new le(m.ZERO,i.maximumRadius),pass:Ee.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new De({sources:[bE]}),a=new De({sources:[pE]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=en.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=put(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new lt({attributes:{position:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:we.TRIANGLES});this._va=ei.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};RF.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};RF.prototype.isDestroyed=function(){return!1};RF.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var ZF=RF;var A2i=T(S(),1);function JV(){}var but=/\bgl_FragDepth\b/,gut=/\bdiscard\b/;function yut(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(but.test(r[a])||gut.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() +`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function fr(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(f){r.contains(f.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let d=document.createElement("ul");r.appendChild(d);let u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),zdt(e);let g=St.clone(fr.cesiumCredit);this._delimiter=y(t,"\u2022"),this._screenContainer=h,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=d,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Rt,lightboxCredits:new Rt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function Bye(e,t,n,i){i=y(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Uye(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}fr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=St.clone(Oye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,Bye(this,t,e)};fr.prototype.addStaticCredit=function(e){let t=this._staticCredits;Odt(t,e)||t.push(e)};fr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};fr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};fr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};fr.prototype.update=function(){this._expanded&&Hdt(this)};fr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&St.equals(fr.cesiumCredit,this._cesiumCredit)||Bye(this,s,r,Number.MAX_VALUE)}St.equals(fr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=St.clone(fr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};fr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Nye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Nye(this._creditList,t,void 0,"li"),Ydt(this)};fr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),me(this)};fr.prototype.isDestroyed=function(){return!1};fr._cesiumCredit=void 0;fr._cesiumCreditInitialized=!1;var iB;function Oye(){if(!l(iB)){let e=nn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new kye.default(e).path()),iB=new St(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return fr._cesiumCreditInitialized||(fr._cesiumCredit=iB,fr._cesiumCreditInitialized=!0),iB}Object.defineProperties(fr,{cesiumCredit:{get:function(){return Oye(),fr._cesiumCredit},set:function(e){fr._cesiumCredit=e,fr._cesiumCreditInitialized=!0}}});fr.CreditDisplayElement=Uye;var sF=fr;var R2i=T(S(),1);var HWi=T(S(),1);var oB=0,Kdt=1;function PT(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e.vertexFormat,Xe.DEFAULT),r=y(e._drawNearPlane,!0),s,a;t instanceof Gi?(s=oB,a=Gi.packedLength):t instanceof rn&&(s=Kdt,a=rn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=ve.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+ve.packedLength+Xe.packedLength}PT.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===oB?(Gi.pack(o,t,n),n+=Gi.packedLength):(rn.pack(o,t,n),n+=rn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,ve.pack(e._orientation,t,n),n+=ve.packedLength,Xe.pack(e._vertexFormat,t,n),n+=Xe.packedLength,t[n]=e._drawNearPlane?1:0,t};var Jdt=new Gi,Qdt=new rn,jdt=new ve,qdt=new m,$dt=new Xe;PT.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===oB?(o=Gi.unpack(e,t,Jdt),t+=Gi.packedLength):(o=rn.unpack(e,t,Qdt),t+=rn.packedLength);let r=m.unpack(e,t,qdt);t+=m.packedLength;let s=ve.unpack(e,t,jdt);t+=ve.packedLength;let a=Xe.unpack(e,t,$dt);t+=Xe.packedLength;let c=e[t]===1;if(!l(n))return new PT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let d=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(d),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=ve.clone(s,n._orientation),n._vertexFormat=Xe.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function KV(e,t,n,i,o,r,s,a){let c=e/3*2;for(let d=0;d<4;++d)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var eut=new $,tut=new M,yj=new M,Yye=new m,Hye=new m,zye=new m,nut=new m,iut=new m,out=new m,Ry=new Array(3),aF=new Array(4);aF[0]=new se(-1,-1,1,1);aF[1]=new se(1,-1,1,1);aF[2]=new se(1,1,1,1);aF[3]=new se(-1,1,1,1);var Kye=new Array(4);for(let e=0;e<4;++e)Kye[e]=new se;PT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,eut),d=y(r,Yye),u=y(s,Hye),h=y(a,zye);d=$.getColumn(c,0,d),u=$.getColumn(c,1,u),h=$.getColumn(c,2,h),m.normalize(d,d),m.normalize(u,u),m.normalize(h,h),m.negate(d,d);let p=M.computeView(e,h,u,d,tut),g,f,x=i.projectionMatrix;if(n===oB){let _=M.multiply(x,p,yj);f=M.inverse(_,yj)}else g=M.inverseTransformation(p,yj);l(f)?(Ry[0]=i.near,Ry[1]=i.far):(Ry[0]=0,Ry[1]=i.near,Ry[2]=i.far);for(let _=0;_<2;++_)for(let C=0;C<4;++C){let V=se.clone(aF[C],Kye[C]);if(l(f)){V=M.multiplyByVector(f,V,V);let L=1/V.w;m.multiplyByScalar(V,L,V),m.subtract(V,e,V),m.normalize(V,V);let Z=m.dot(h,V);m.multiplyByScalar(V,Ry[_]/Z,V),m.add(V,e,V)}else{let L=i.offCenterFrustum;l(L)&&(i=L);let Z=Ry[_],G=Ry[_+1];V.x=(V.x*(i.right-i.left)+i.left+i.right)*.5,V.y=(V.y*(i.top-i.bottom)+i.bottom+i.top)*.5,V.z=(V.z*(Z-G)-Z-G)*.5,V.w=1,M.multiplyByVector(g,V,V)}o[12*_+C*3]=V.x,o[12*_+C*3+1]=V.y,o[12*_+C*3+2]=V.z}};PT.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);PT._computeNearFarPlanes(i,o,t,n,c);let d=3*4*2;c[d]=c[3*4],c[d+1]=c[3*4+1],c[d+2]=c[3*4+2],c[d+3]=c[0],c[d+4]=c[1],c[d+5]=c[2],c[d+6]=c[3*3],c[d+7]=c[3*3+1],c[d+8]=c[3*3+2],c[d+9]=c[3*7],c[d+10]=c[3*7+1],c[d+11]=c[3*7+2],d+=3*4,c[d]=c[3*5],c[d+1]=c[3*5+1],c[d+2]=c[3*5+2],c[d+3]=c[3],c[d+4]=c[4],c[d+5]=c[5],c[d+6]=c[0],c[d+7]=c[1],c[d+8]=c[2],c[d+9]=c[3*4],c[d+10]=c[3*4+1],c[d+11]=c[3*4+2],d+=3*4,c[d]=c[3],c[d+1]=c[4],c[d+2]=c[5],c[d+3]=c[3*5],c[d+4]=c[3*5+1],c[d+5]=c[3*5+2],c[d+6]=c[3*6],c[d+7]=c[3*6+1],c[d+8]=c[3*6+2],c[d+9]=c[3*2],c[d+10]=c[3*2+1],c[d+11]=c[3*2+2],d+=3*4,c[d]=c[3*2],c[d+1]=c[3*2+1],c[d+2]=c[3*2+2],c[d+3]=c[3*6],c[d+4]=c[3*6+1],c[d+5]=c[3*6+2],c[d+6]=c[3*7],c[d+7]=c[3*7+1],c[d+8]=c[3*7+2],c[d+9]=c[3*3],c[d+10]=c[3*3+1],c[d+11]=c[3*3+2],r||(c=c.subarray(3*4));let u=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,f=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,_=Yye,C=Hye,V=zye,L=m.negate(_,nut),Z=m.negate(C,iut),G=m.negate(V,out);d=0,r&&(KV(d,p,g,f,x,G,_,C),d+=3*4),KV(d,p,g,f,x,V,L,C),d+=3*4,KV(d,p,g,f,x,L,G,C),d+=3*4,KV(d,p,g,f,x,Z,G,L),d+=3*4,KV(d,p,g,f,x,_,V,C),d+=3*4,KV(d,p,g,f,x,C,V,L),l(p)&&(u.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(u.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),l(f)&&(u.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),l(x)&&(u.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:x}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,f=p*4;h[g]=f,h[g+1]=f+1,h[g+2]=f+2,h[g+3]=f,h[g+4]=f+2,h[g+5]=f+3}return new ct({attributes:u,indices:h,primitiveType:we.TRIANGLES,boundingSphere:le.fromVertices(c)})};var vT=PT;var a2i=T(S(),1);var xj=0,rut=1;function cF(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e._drawNearPlane,!0),r,s;t instanceof Gi?(r=xj,s=Gi.packedLength):t instanceof rn&&(r=rut,s=rn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=ve.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+ve.packedLength}cF.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===xj?(Gi.pack(o,t,n),n+=Gi.packedLength):(rn.pack(o,t,n),n+=rn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,ve.pack(e._orientation,t,n),n+=ve.packedLength,t[n]=e._drawNearPlane?1:0,t};var sut=new Gi,aut=new rn,cut=new ve,lut=new m;cF.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===xj?(o=Gi.unpack(e,t,sut),t+=Gi.packedLength):(o=rn.unpack(e,t,aut),t+=rn.packedLength);let r=m.unpack(e,t,lut);t+=m.packedLength;let s=ve.unpack(e,t,cut);t+=ve.packedLength;let a=e[t]===1;if(!l(n))return new cF({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=ve.clone(s,n._orientation),n._drawNearPlane=a,n};cF.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);vT._computeNearFarPlanes(i,o,t,n,s);let a=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),c,d,u=r?2:1,h=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,d=p*4,h[c]=d,h[c+1]=d+1,h[c+2]=d+1,h[c+3]=d+2,h[c+4]=d+2,h[c+5]=d+3,h[c+6]=d+3,h[c+7]=d;for(p=0;p<2;++p)c=(u+p)*8,d=p*4,h[c]=d,h[c+1]=d+4,h[c+2]=d+1,h[c+3]=d+5,h[c+4]=d+2,h[c+5]=d+6,h[c+6]=d+3,h[c+7]=d+7;return new ct({attributes:a,indices:h,primitiveType:we.LINES,boundingSphere:le.fromVertices(s)})};var lF=cF;function rB(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,B.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var dut=new m,uut=new $,mut=new ve,hut=new Gi,fut=new hl,put=new rn,but=new Pr,gut=new B,yut=[1,1e5];rB.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Gi?a=hut:s instanceof hl?a=fut:s instanceof rn?a=put:a=but,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=yut,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,c=1):c=d.length-1;let u=r.positionWC,h=r.directionWC,p=r.upWC,g=r.rightWC;g=m.negate(g,dut);let f=uut;$.setColumn(f,0,g,f),$.setColumn(f,1,p,f),$.setColumn(f,2,h,f);let x=ve.fromRotationMatrix(f,mut);for(t.length=n.length=c,i=0;i<c;++i)a.near=d[i],a.far=d[i+1],t[i]=new In({geometryInstances:new Zt({geometry:new vT({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(B.fromAlpha(this._color,.1,gut))},id:this.id,pickPrimitive:this}),appearance:new ln({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Zt({geometry:new lF({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new ln({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};rB.prototype.isDestroyed=function(){return!1};rB.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return me(this)};var ep=rB;var $2i=T(S(),1);var G2i=T(S(),1),dF=`in vec4 positionEC; + +void main() +{ + vec3 position; + vec3 direction; + if (czm_orthographicIn3D == 1.0) + { + vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; + vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom + vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top + position = vec3(mix(minPlane, maxPlane, uv), 0.0); + direction = vec3(0.0, 0.0, -1.0); + } + else + { + position = vec3(0.0); + direction = normalize(positionEC.xyz); + } + + czm_ray ray = czm_ray(position, direction); + + vec3 ellipsoid_center = czm_view[3].xyz; + + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); + if (!czm_isEmpty(intersection)) + { + out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); + } + else + { + discard; + } + + czm_writeLogDepth(); +} +`;var I2i=T(S(),1),uF=`in vec4 position; + +out vec4 positionEC; + +void main() +{ + positionEC = czm_modelView * position; + gl_Position = czm_projection * positionEC; + + czm_vertexLogDepth(); +} +`;function hF(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var mF=Bt.supportsTypedArrays()?new Float32Array(12):[],Jye=new m,Qye=new m,_j=new m,jye=new m,sB=new m;function xut(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof rn)o=m.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,h,Jye),g=m.normalize(p,Qye),f=m.normalize(m.cross(m.UNIT_Z,p,_j),_j),x=m.normalize(m.cross(g,f,jye),jye),_=m.magnitude(p),C=Math.sqrt(_*_-1);o=m.multiplyByScalar(g,1/_,Jye);let V=C/_;r=m.multiplyByScalar(f,V,Qye),s=m.multiplyByScalar(x,V,_j)}let a=m.add(o,s,sB);m.subtract(a,r,a),m.multiplyComponents(n,a,a),m.pack(a,mF,0);let c=m.subtract(o,s,sB);m.subtract(c,r,c),m.multiplyComponents(n,c,c),m.pack(c,mF,3);let d=m.add(o,s,sB);m.add(d,r,d),m.multiplyComponents(n,d,d),m.pack(d,mF,6);let u=m.subtract(o,s,sB);return m.add(u,r,u),m.multiplyComponents(n,u,u),m.pack(u,mF,9),mF}hF.prototype.update=function(e){if(this._mode=e.mode,e.mode!==oe.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ne(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new qe({renderState:this._rs,boundingVolume:new le(m.ZERO,i.maximumRadius),pass:Ee.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new De({sources:[uF]}),a=new De({sources:[dF]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=xut(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new ct({attributes:{position:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:we.TRIANGLES});this._va=ni.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};hF.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};hF.prototype.isDestroyed=function(){return!1};hF.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var fF=hF;var cPi=T(S(),1);function QV(){}var _ut=/\bgl_FragDepth\b/,Tut=/\bdiscard\b/;function Sut(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(_ut.test(r[a])||Tut.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() { out_FragColor = vec4(1.0); } @@ -12635,31 +11172,31 @@ ${o?`u_dayTextureBrightness[${Ne}]`:"0.0"}, out_FragColor = vec4(1.0); czm_writeLogDepth(); } -`;i=new De({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function xut(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ue.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ue.fromCache(o);return n[t.id]=r,r}JV.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=qe.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=yut(n,t.shaderProgram),i.depthOnlyCommand.renderState=xut(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var _ut=/\s+czm_writeLogDepth\(/,Tut=/\s+czm_vertexLogDepth\(/;function Sut(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let u=0;u<c.length;++u)if(Tut.test(c[u])){a=!0;break}if(!a){for(let h=0;h<c.length;++h)c[h]=De.replaceMain(c[h],"czm_log_depth_main");c.push(` +`;i=new De({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function Cut(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ue.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ue.fromCache(o);return n[t.id]=r,r}QV.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=qe.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=Sut(n,t.shaderProgram),i.depthOnlyCommand.renderState=Cut(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var Vut=/\s+czm_writeLogDepth\(/,Lut=/\s+czm_vertexLogDepth\(/;function Rut(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let u=0;u<c.length;++u)if(Lut.test(c[u])){a=!0;break}if(!a){for(let h=0;h<c.length;++h)c[h]=De.replaceMain(c[h],"czm_log_depth_main");c.push(` void main() { czm_log_depth_main(); czm_vertexLogDepth(); } -`)}c=s.sources,a=!1;for(let u=0;u<c.length;++u)_ut.test(c[u])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let d="";if(!a){for(let u=0;u<c.length;u++)c[u]=De.replaceMain(c[u],"czm_log_depth_main");d=` +`)}c=s.sources,a=!1;for(let u=0;u<c.length;++u)Vut.test(c[u])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let d="";if(!a){for(let u=0;u<c.length;u++)c[u]=De.replaceMain(c[u],"czm_log_depth_main");d=` void main() { czm_log_depth_main(); czm_writeLogDepth(); } -`}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}JV.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=qe.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Sut(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Cut(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main () +`}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}QV.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=qe.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Rut(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Zut(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main () { czm_non_pick_main(); if (${c}.a == 0.0) { discard; } ${c} = ${n}; -} `,u=r.length,h=new Array(u+1);for(let g=0;g<u;++g)h[g]=De.replaceMain(r[g],"czm_non_pick_main");h[u]=d;let p=new De({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function Qye(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ue.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ue.fromCache(o);return n[t.id]=r,r}JV.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=qe.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Cut(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Qye(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function KV(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function jye(e){return e.isArray?e.arrayLength:ut.getComponentCount(e.type)}function Vut(e){let t=jye(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function qye(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function $ye(e,t){let n=Ut.getMaximum(t);return`(${e}) / float(${n})`}function Lut(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=qye(n,i,o)}return e.normalized||(n=$ye(n,e.componentType)),n}function Rut(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=qye(o,r,s)}return e.normalized||(o=$ye(o,e.componentType)),o}function Zut(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,d=n.classProperty,u=Vut(d),h=["0.0","0.0","0.0","0.0"],p=jye(d);if(p===1)h[0]=Lut(d,c);else{let _=["x","y","z","w"];for(let C=0;C<p;C++)h[C]=Rut(d,c,_[C])}let g=t.fragmentShaderSource.defines.slice();g.push(Cd.METADATA_PICKING_ENABLED),KV(g,Cd.METADATA_PICKING_VALUE_TYPE,u),KV(g,Cd.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),KV(g,Cd.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),KV(g,Cd.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),KV(g,Cd.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),KV(g,Cd.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let f=new De({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:f,attributeLocations:t._attributeLocations})}JV.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=qe.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Zut(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Qye(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function Gut(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}JV.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=qe.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Gut(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var ep=JV;var O2i=T(S(),1);function sB(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=W.toRadians(o),t._beta=W.toRadians(i.beta),t._gamma=W.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var Eut=new ve,exe=new ve,Iut=new $;function Xut(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=ve.fromAxisAngle(o,n,exe),c=ve.fromAxisAngle(r,i,Eut),d=ve.multiply(c,a,c),u=ve.fromAxisAngle(s,t,exe);ve.multiply(u,d,d);let h=$.fromQuaternion(d,Iut);$.multiplyByVector(h,r,r),$.multiplyByVector(h,s,s),$.multiplyByVector(h,o,o)}sB.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;Xut(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};sB.prototype.isDestroyed=function(){return!1};sB.prototype.destroy=function(){return this._removeListener(),me(this)};var GF=sB;var Q2i=T(S(),1);function _j(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(_j.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var Wut=new m;_j.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==oe.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,W.EPSILON4),-Math.max(this._heightFalloff,0)),s=m.normalize(n.positionWC,Wut),a=Math.abs(m.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var EF=_j;var $2i=T(S(),1);function Put(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=oe.SCENE3D,this.morphTime=oe.getMorphTime(oe.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var IF=Put;var hvi=T(S(),1);var ya={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},PT=ya.DERIVED_COMMANDS_MAXIMUM_LENGTH,dxe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function vT(){this._frontFaceAlphaByDistance=new kt(0,1,0,1),this._backFaceAlphaByDistance=new kt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(PT),this._derivedBlendCommandTypes=new Array(PT),this._derivedPickCommandTypes=new Array(PT),this._derivedCommandTypesToUpdate=new Array(PT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(vT.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});vT.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=txe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=txe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=nxe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=nxe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Aut(this,e,t),this._sunVisibleThroughGlobe=vut(this,e),this._environmentVisible=wut(this,e),this._useDepthPlane=Fut(this,e),this._numberOfTextureUniforms=Mut(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),Nut(this,e)};function txe(e,t,n,i){return e?l(n)?(kt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function nxe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function vut(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function wut(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Fut(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Aut(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function Mut(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Nut(e,t){e._derivedCommandsLength=Tj(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Tj(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Tj(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<PT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=emt())}function Tj(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?ya.PICK_FRONT_FACE:d?ya.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ya.TRANSLUCENT_FRONT_FACE,h=i?ya.PICK_BACK_FACE:d?ya.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ya.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=ya.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=ya.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=h):(o[r++]=h,o[r++]=u)):c?(n||(o[r++]=ya.DEPTH_ONLY_BACK_FACE),o[r++]=ya.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=ya.DEPTH_ONLY_FRONT_FACE),o[r++]=ya.OPAQUE_BACK_FACE,o[r++]=u),r)}function pm(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function ixe(e,t){return e.indexOf(t)>-1}function kut(e,t){pm(e.defines,"TRANSLUCENT"),pm(t.defines,"TRANSLUCENT")}function Uut(e,t){pm(e.defines,"GROUND_ATMOSPHERE"),pm(t.defines,"GROUND_ATMOSPHERE"),pm(e.defines,"FOG"),pm(t.defines,"FOG"),pm(e.defines,"TRANSLUCENT"),pm(t.defines,"TRANSLUCENT")}function Sj(e,t){if(ixe(t.defines,"TILE_LIMIT_RECTANGLE")||ixe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +} `,u=r.length,h=new Array(u+1);for(let g=0;g<u;++g)h[g]=De.replaceMain(r[g],"czm_non_pick_main");h[u]=d;let p=new De({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function qye(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ue.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ue.fromCache(o);return n[t.id]=r,r}QV.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=qe.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Zut(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=qye(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function JV(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function $ye(e){return e.isArray?e.arrayLength:dt.getComponentCount(e.type)}function Gut(e){let t=$ye(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function exe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function txe(e,t){let n=kt.getMaximum(t);return`(${e}) / float(${n})`}function Eut(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=exe(n,i,o)}return e.normalized||(n=txe(n,e.componentType)),n}function Iut(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=exe(o,r,s)}return e.normalized||(o=txe(o,e.componentType)),o}function Xut(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,d=n.classProperty,u=Gut(d),h=["0.0","0.0","0.0","0.0"],p=$ye(d);if(p===1)h[0]=Eut(d,c);else{let _=["x","y","z","w"];for(let C=0;C<p;C++)h[C]=Iut(d,c,_[C])}let g=t.fragmentShaderSource.defines.slice();g.push(Vd.METADATA_PICKING_ENABLED),JV(g,Vd.METADATA_PICKING_VALUE_TYPE,u),JV(g,Vd.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),JV(g,Vd.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),JV(g,Vd.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),JV(g,Vd.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),JV(g,Vd.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let f=new De({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:f,attributeLocations:t._attributeLocations})}QV.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=qe.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Xut(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=qye(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function Wut(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}QV.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=qe.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Wut(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var tp=QV;var pPi=T(S(),1);function aB(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=W.toRadians(o),t._beta=W.toRadians(i.beta),t._gamma=W.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var Put=new ve,nxe=new ve,vut=new $;function wut(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=ve.fromAxisAngle(o,n,nxe),c=ve.fromAxisAngle(r,i,Put),d=ve.multiply(c,a,c),u=ve.fromAxisAngle(s,t,nxe);ve.multiply(u,d,d);let h=$.fromQuaternion(d,vut);$.multiplyByVector(h,r,r),$.multiplyByVector(h,s,s),$.multiplyByVector(h,o,o)}aB.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;wut(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};aB.prototype.isDestroyed=function(){return!1};aB.prototype.destroy=function(){return this._removeListener(),me(this)};var pF=aB;var TPi=T(S(),1);function Tj(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(Tj.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var Fut=new m;Tj.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==oe.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,W.EPSILON4),-Math.max(this._heightFalloff,0)),s=m.normalize(n.positionWC,Fut),a=Math.abs(m.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var bF=Tj;var VPi=T(S(),1);function Aut(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=oe.SCENE3D,this.morphTime=oe.getMorphTime(oe.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var gF=Aut;var MPi=T(S(),1);var _a={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},wT=_a.DERIVED_COMMANDS_MAXIMUM_LENGTH,mxe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function FT(){this._frontFaceAlphaByDistance=new Nt(0,1,0,1),this._backFaceAlphaByDistance=new Nt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(wT),this._derivedBlendCommandTypes=new Array(wT),this._derivedPickCommandTypes=new Array(wT),this._derivedCommandTypesToUpdate=new Array(wT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(FT.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});FT.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=ixe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=ixe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=oxe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=oxe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Uut(this,e,t),this._sunVisibleThroughGlobe=Mut(this,e),this._environmentVisible=Nut(this,e),this._useDepthPlane=kut(this,e),this._numberOfTextureUniforms=Dut(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),But(this,e)};function ixe(e,t,n,i){return e?l(n)?(Nt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function oxe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Mut(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Nut(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function kut(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Uut(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function Dut(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function But(e,t){e._derivedCommandsLength=Sj(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Sj(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Sj(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<wT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=omt())}function Sj(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?_a.PICK_FRONT_FACE:d?_a.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:_a.TRANSLUCENT_FRONT_FACE,h=i?_a.PICK_BACK_FACE:d?_a.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:_a.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=_a.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=_a.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=h):(o[r++]=h,o[r++]=u)):c?(n||(o[r++]=_a.DEPTH_ONLY_BACK_FACE),o[r++]=_a.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=_a.DEPTH_ONLY_FRONT_FACE),o[r++]=_a.OPAQUE_BACK_FACE,o[r++]=u),r)}function pm(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function rxe(e,t){return e.indexOf(t)>-1}function Out(e,t){pm(e.defines,"TRANSLUCENT"),pm(t.defines,"TRANSLUCENT")}function Yut(e,t){pm(e.defines,"GROUND_ATMOSPHERE"),pm(t.defines,"GROUND_ATMOSPHERE"),pm(e.defines,"FOG"),pm(t.defines,"FOG"),pm(e.defines,"TRANSLUCENT"),pm(t.defines,"TRANSLUCENT")}function Cj(e,t){if(rxe(t.defines,"TILE_LIMIT_RECTANGLE")||rxe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() { out_FragColor = vec4(1.0); } -`;t.sources=[n]}function Cj(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=De.replaceMain(n[r],"czm_globe_translucency_main");n.push(` +`;t.sources=[n]}function Vj(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=De.replaceMain(n[r],"czm_globe_translucency_main");n.push(` uniform sampler2D u_classificationTexture; void main() @@ -12686,7 +11223,7 @@ void main() } out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); } -`)}function uxe(e,t){Cj(e,t),pm(e.defines,"GROUND_ATMOSPHERE"),pm(t.defines,"GROUND_ATMOSPHERE"),pm(e.defines,"FOG"),pm(t.defines,"FOG")}function Dut(e,t){Cj(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function But(e,t){uxe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function oxe(e,t){let n=`uniform sampler2D u_classificationTexture; +`)}function hxe(e,t){Vj(e,t),pm(e.defines,"GROUND_ATMOSPHERE"),pm(t.defines,"GROUND_ATMOSPHERE"),pm(e.defines,"FOG"),pm(t.defines,"FOG")}function Hut(e,t){Vj(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function zut(e,t){hxe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function sxe(e,t){let n=`uniform sampler2D u_classificationTexture; void main() { vec2 st = gl_FragCoord.xy / czm_viewport.zw; @@ -12697,7 +11234,7 @@ void main() } out_FragColor = pickColor; } -`;t.sources=[n]}function Out(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],d.defines=l(d.defines)?d.defines.slice(0):[],o(c,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:a})}return s}function Yut(e){e.cull.face=yi.BACK,e.cull.enabled=!0}function Hut(e){e.cull.face=yi.FRONT,e.cull.enabled=!0}function zut(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Kut(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Jut(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function rxe(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=mn.ALPHA_BLEND}function sxe(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=mn.ALPHA_BLEND}function Qut(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function jut(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function qut(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ue.getState(e);i(s),r=Ue.fromCache(s),o[e.id]=r}return r}function QV(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function $ut(e,t,n,i,o){return l(o)?!i&&l(n)?n:St(t,o(e),!1):t}function Ah(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function emt(){return[new Ah({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:kut,getRenderStateFunction:Yut,getUniformMapFunction:void 0}),new Ah({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:Uut,getRenderStateFunction:Hut,getUniformMapFunction:void 0}),new Ah({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:Sj,getRenderStateFunction:zut,getUniformMapFunction:void 0}),new Ah({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:Sj,getRenderStateFunction:Kut,getUniformMapFunction:void 0}),new Ah({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:Sj,getRenderStateFunction:Jut,getUniformMapFunction:void 0}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Cj,getRenderStateFunction:rxe,getUniformMapFunction:QV}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:uxe,getRenderStateFunction:sxe,getUniformMapFunction:QV}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Dut,getRenderStateFunction:rxe,getUniformMapFunction:QV}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:But,getRenderStateFunction:sxe,getUniformMapFunction:QV}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:oxe,getRenderStateFunction:Qut,getUniformMapFunction:QV}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:oxe,getRenderStateFunction:jut,getUniformMapFunction:QV})]}var axe=new Array(PT),cxe=new Array(PT);vT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)cxe[o]=this._derivedCommandPacks[n[o]],axe[o]=dxe[n[o]];tmt(this,e,i,n,axe,cxe,t)}};function tmt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=y(a.uniformMapDirtyFrame,0),h=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=d),f&&(a.shaderProgramDirtyFrame=d),x&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let _=0;_<n;++_){let C=r[_],V=i[_],L=o[_],Z=a[L],G,I,v;l(Z)?(G=Z.uniformMap,I=Z.shaderProgram,v=Z.renderState):(G=void 0,I=void 0,v=void 0),Z=qe.shallowClone(t,Z),a[L]=Z;let P=y(Z.derivedCommands.uniformMapDirtyFrame,0),w=y(Z.derivedCommands.shaderProgramDirtyFrame,0),F=y(Z.derivedCommands.renderStateDirtyFrame,0),b=g||P<u,R=f||w<h,E=x||F<p;b&&(Z.derivedCommands.uniformMapDirtyFrame=d),R&&(Z.derivedCommands.shaderProgramDirtyFrame=d),E&&(Z.derivedCommands.renderStateDirtyFrame=d),Z.derivedCommands.type=V,Z.pass=C.pass,Z.pickOnly=C.pickOnly,Z.uniformMap=$ut(e,t.uniformMap,G,b,C.getUniformMapFunction),Z.shaderProgram=Out(s.context,t.shaderProgram,I,R,C.getShaderProgramFunction,L),Z.renderState=qut(t.renderState,v,E,C.getRenderStateFunction,C.renderStateCache)}}}vT.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=dxe[o[a]];n.commandList.push(s[c])}};function mxe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function lxe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var nmt=[ya.OPAQUE_FRONT_FACE,ya.OPAQUE_BACK_FACE],imt=[ya.DEPTH_ONLY_FRONT_FACE,ya.DEPTH_ONLY_BACK_FACE,ya.DEPTH_ONLY_FRONT_AND_BACK_FACE];vT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ee.GLOBE],a=e.indices[Ee.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),mxe(s,a,t,i,o,nmt))};vT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Ee.GLOBE],c=e.indices[Ee.GLOBE],d=e.commands[Ee.TERRAIN_CLASSIFICATION],u=e.indices[Ee.TERRAIN_CLASSIFICATION];if(c===0||u===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&lxe(d,u,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,mxe(a,c,t,i,o,imt),r.depthTexture){let x=n.packDepth(r,o);s.globeDepthTexture=x}lxe(d,u,t,i,o),s.globeDepthTexture=g,o.framebuffer=f};var XF=vT;var vvi=T(S(),1);var pvi=T(S(),1),ql=`uniform sampler2D colorTexture; +`;t.sources=[n]}function Kut(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],d.defines=l(d.defines)?d.defines.slice(0):[],o(c,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:a})}return s}function Jut(e){e.cull.face=xi.BACK,e.cull.enabled=!0}function Qut(e){e.cull.face=xi.FRONT,e.cull.enabled=!0}function jut(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function qut(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function $ut(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function axe(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function cxe(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function emt(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function tmt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function nmt(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ue.getState(e);i(s),r=Ue.fromCache(s),o[e.id]=r}return r}function jV(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function imt(e,t,n,i,o){return l(o)?!i&&l(n)?n:Tt(t,o(e),!1):t}function Ah(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function omt(){return[new Ah({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:Out,getRenderStateFunction:Jut,getUniformMapFunction:void 0}),new Ah({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:Yut,getRenderStateFunction:Qut,getUniformMapFunction:void 0}),new Ah({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:Cj,getRenderStateFunction:jut,getUniformMapFunction:void 0}),new Ah({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:Cj,getRenderStateFunction:qut,getUniformMapFunction:void 0}),new Ah({pass:Ee.GLOBE,pickOnly:!1,getShaderProgramFunction:Cj,getRenderStateFunction:$ut,getUniformMapFunction:void 0}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Vj,getRenderStateFunction:axe,getUniformMapFunction:jV}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:hxe,getRenderStateFunction:cxe,getUniformMapFunction:jV}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Hut,getRenderStateFunction:axe,getUniformMapFunction:jV}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:zut,getRenderStateFunction:cxe,getUniformMapFunction:jV}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:sxe,getRenderStateFunction:emt,getUniformMapFunction:jV}),new Ah({pass:Ee.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:sxe,getRenderStateFunction:tmt,getUniformMapFunction:jV})]}var lxe=new Array(wT),dxe=new Array(wT);FT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)dxe[o]=this._derivedCommandPacks[n[o]],lxe[o]=mxe[n[o]];rmt(this,e,i,n,lxe,dxe,t)}};function rmt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=y(a.uniformMapDirtyFrame,0),h=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=d),f&&(a.shaderProgramDirtyFrame=d),x&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let _=0;_<n;++_){let C=r[_],V=i[_],L=o[_],Z=a[L],G,I,v;l(Z)?(G=Z.uniformMap,I=Z.shaderProgram,v=Z.renderState):(G=void 0,I=void 0,v=void 0),Z=qe.shallowClone(t,Z),a[L]=Z;let P=y(Z.derivedCommands.uniformMapDirtyFrame,0),w=y(Z.derivedCommands.shaderProgramDirtyFrame,0),F=y(Z.derivedCommands.renderStateDirtyFrame,0),b=g||P<u,R=f||w<h,E=x||F<p;b&&(Z.derivedCommands.uniformMapDirtyFrame=d),R&&(Z.derivedCommands.shaderProgramDirtyFrame=d),E&&(Z.derivedCommands.renderStateDirtyFrame=d),Z.derivedCommands.type=V,Z.pass=C.pass,Z.pickOnly=C.pickOnly,Z.uniformMap=imt(e,t.uniformMap,G,b,C.getUniformMapFunction),Z.shaderProgram=Kut(s.context,t.shaderProgram,I,R,C.getShaderProgramFunction,L),Z.renderState=nmt(t.renderState,v,E,C.getRenderStateFunction,C.renderStateCache)}}}FT.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=mxe[o[a]];n.commandList.push(s[c])}};function fxe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function uxe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var smt=[_a.OPAQUE_FRONT_FACE,_a.OPAQUE_BACK_FACE],amt=[_a.DEPTH_ONLY_FRONT_FACE,_a.DEPTH_ONLY_BACK_FACE,_a.DEPTH_ONLY_FRONT_AND_BACK_FACE];FT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ee.GLOBE],a=e.indices[Ee.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),fxe(s,a,t,i,o,smt))};FT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Ee.GLOBE],c=e.indices[Ee.GLOBE],d=e.commands[Ee.TERRAIN_CLASSIFICATION],u=e.indices[Ee.TERRAIN_CLASSIFICATION];if(c===0||u===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&uxe(d,u,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,fxe(a,c,t,i,o,amt),r.depthTexture){let x=n.packDepth(r,o);s.globeDepthTexture=x}uxe(d,u,t,i,o),s.globeDepthTexture=g,o.framebuffer=f};var yF=FT;var rvi=T(S(),1);var kPi=T(S(),1),$l=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -12705,7 +11242,7 @@ void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); } -`;function tp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new $n({color:new B(0,0,0,0),owner:this}),this._clearCommand=new $n({color:new B(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(tp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});tp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var omt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Un.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Un.NEVER,reference:0,mask:Dt.CLASSIFICATION_MASK},blending:mn.ALPHA_BLEND},rmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Un.NEVER,reference:0,mask:Dt.CLASSIFICATION_MASK},blending:mn.ALPHA_BLEND},smt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Dt.setCesium3DTileBit(),stencilMask:Dt.CESIUM_3D_TILE_MASK,blending:mn.ALPHA_BLEND},amt=`uniform sampler2D colorTexture; +`;function np(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new fi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new fi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ti({color:new B(0,0,0,0),owner:this}),this._clearCommand=new ti({color:new B(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(np.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});np.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var cmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Un.EQUAL,frontOperation:{fail:mt.KEEP,zFail:mt.KEEP,zPass:mt.KEEP},backFunction:Un.NEVER,reference:0,mask:Ut.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},lmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:mt.KEEP,zFail:mt.KEEP,zPass:mt.KEEP},backFunction:Un.NEVER,reference:0,mask:Ut.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},dmt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ut.setCesium3DTileBit(),stencilMask:Ut.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},umt=`uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; @@ -12733,7 +11270,7 @@ void main() out_FragColor = color * highlightColor; gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; } -`,cmt=`uniform sampler2D colorTexture; +`,mmt=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { @@ -12748,7 +11285,7 @@ void main() out_FragColor = color; #endif } -`;tp.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Wt({context:e,width:s,height:a,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new dd({context:e,width:s,height:a,format:Fc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;l(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),l(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ue.fromCache(omt),this._rsClassified=Ue.fromCache(rmt),this._rsDefault=Ue.fromCache(smt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=l(this._previousFramebuffer)?cmt:amt,u=new De({defines:["UNCLASSIFIED"],sources:[d]}),h=new De({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(ql,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};tp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};tp.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};tp.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};tp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};tp.prototype.isDestroyed=function(){return!1};tp.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),me(this)};var jV=tp;var Nvi=T(S(),1);function aB(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(aB.prototype,{total:{get:function(){return this._total}}});function Zy(e){let t=new Array(Pa.NUMBER_OF_JOB_TYPES);t[Pa.TEXTURE]=new aB(l(e)?e[Pa.TEXTURE]:10),t[Pa.PROGRAM]=new aB(l(e)?e[Pa.PROGRAM]:10),t[Pa.BUFFER]=new aB(l(e)?e[Pa.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}Zy.getTimestamp=_i;Object.defineProperties(Zy.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Zy.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Zy.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};Zy.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,d;for(d=0;d<c&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Zy.getTimestamp();e.execute();let a=Zy.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var WF=Zy;var Yvi=T(S(),1);function cB(e){e=y(e,y.EMPTY_OBJECT);let t=Xn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=_i(),this._lastMsSampleTime=_i(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(cB.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});cB.prototype.update=function(e){let t=_i(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};cB.prototype.destroy=function(){return me(this)};var u0=cB;var K9i=T(S(),1);var owi=T(S(),1);var xa={};xa.decodeRawMetadataValue=function(e,t,n){switch(e){case Ut.INT8:return t.getInt8(n);case Ut.UINT8:return t.getUint8(n);case Ut.INT16:return t.getInt16(n,!0);case Ut.UINT16:return t.getUint16(n,!0);case Ut.INT32:return t.getInt32(n,!0);case Ut.UINT32:return t.getUint32(n,!0);case Ut.INT64:return t.getBigInt64(n,!0);case Ut.UINT64:return t.getBigUint64(n,!0);case Ut.FLOAT32:return t.getFloat32(n,!0);case Ut.FLOAT64:return t.getFloat64(n,!0)}throw new ae(`Invalid component type: ${e}`)};xa.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=xa.decodeRawMetadataValue(i,t,n);return e.normalized?Ut.normalize(o,i):o};xa.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Ut.getSizeInBytes(i),r=e.type,s=ut.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,g=xa.decodeRawMetadataValueComponent(e,t,p);u[h]=g}return u}let c=n*a;return xa.decodeRawMetadataValueComponent(e,t,c)};xa.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=xa.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return xa.decodeRawMetadataValueElement(e,n,0)};xa.convertToObjectType=function(e,t){if(!l(t)||e===ut.SCALAR||e===ut.STRING||e===ut.BOOLEAN||e===ut.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case ut.VEC2:return D.unpack(n,0,new D);case ut.VEC3:return m.unpack(n,0,new m);case ut.VEC4:return se.unpack(n,0,new se);case ut.MAT2:return Gi.unpack(n,0,new Gi);case ut.MAT3:return $.unpack(n,0,new $);case ut.MAT4:return M.unpack(n,0,new M)}throw new ae(`Invalid metadata object type: ${e}`)};xa.convertFromObjectType=function(e,t){if(!l(t)||e===ut.SCALAR||e===ut.STRING||e===ut.BOOLEAN||e===ut.ENUM)return t;switch(e){case ut.VEC2:return D.pack(t,Array(2));case ut.VEC3:return m.pack(t,Array(3));case ut.VEC4:return se.pack(t,Array(4));case ut.MAT2:return Gi.pack(t,Array(4));case ut.MAT3:return $.pack(t,Array(9));case ut.MAT4:return M.pack(t,Array(16))}throw new ae(`Invalid metadata object type: ${e}`)};xa.decodeMetadataValues=function(e,t,n){let i=xa.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=xa.convertFromObjectType(e.type,t.offset),s=xa.convertFromObjectType(e.type,t.scale);i=ff.valueTransformInPlace(i,r,s,Ut.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],d=xa.convertToObjectType(e.type,c);s[a]=d}return s}return xa.convertToObjectType(e.type,i)};var PF=Object.freeze(xa);var uwi=T(S(),1);function wT(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(wT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function lmt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function dmt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; +`;np.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Xt({context:e,width:s,height:a,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new ud({context:e,width:s,height:a,format:Ac.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;l(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),l(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ue.fromCache(cmt),this._rsClassified=Ue.fromCache(lmt),this._rsDefault=Ue.fromCache(dmt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=l(this._previousFramebuffer)?mmt:umt,u=new De({defines:["UNCLASSIFIED"],sources:[d]}),h=new De({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand($l,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};np.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};np.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};np.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};np.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};np.prototype.isDestroyed=function(){return!1};np.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),me(this)};var qV=np;var dvi=T(S(),1);function cB(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(cB.prototype,{total:{get:function(){return this._total}}});function Zy(e){let t=new Array(wa.NUMBER_OF_JOB_TYPES);t[wa.TEXTURE]=new cB(l(e)?e[wa.TEXTURE]:10),t[wa.PROGRAM]=new cB(l(e)?e[wa.PROGRAM]:10),t[wa.BUFFER]=new cB(l(e)?e[wa.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}Zy.getTimestamp=Ti;Object.defineProperties(Zy.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Zy.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Zy.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};Zy.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,d;for(d=0;d<c&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Zy.getTimestamp();e.execute();let a=Zy.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var xF=Zy;var bvi=T(S(),1);function lB(e){e=y(e,y.EMPTY_OBJECT);let t=Xn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Ti(),this._lastMsSampleTime=Ti(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(lB.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});lB.prototype.update=function(e){let t=Ti(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};lB.prototype.destroy=function(){return me(this)};var m0=lB;var LMi=T(S(),1);var Evi=T(S(),1);var Ta={};Ta.decodeRawMetadataValue=function(e,t,n){switch(e){case kt.INT8:return t.getInt8(n);case kt.UINT8:return t.getUint8(n);case kt.INT16:return t.getInt16(n,!0);case kt.UINT16:return t.getUint16(n,!0);case kt.INT32:return t.getInt32(n,!0);case kt.UINT32:return t.getUint32(n,!0);case kt.INT64:return t.getBigInt64(n,!0);case kt.UINT64:return t.getBigUint64(n,!0);case kt.FLOAT32:return t.getFloat32(n,!0);case kt.FLOAT64:return t.getFloat64(n,!0)}throw new ae(`Invalid component type: ${e}`)};Ta.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=Ta.decodeRawMetadataValue(i,t,n);return e.normalized?kt.normalize(o,i):o};Ta.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=kt.getSizeInBytes(i),r=e.type,s=dt.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,g=Ta.decodeRawMetadataValueComponent(e,t,p);u[h]=g}return u}let c=n*a;return Ta.decodeRawMetadataValueComponent(e,t,c)};Ta.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=Ta.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return Ta.decodeRawMetadataValueElement(e,n,0)};Ta.convertToObjectType=function(e,t){if(!l(t)||e===dt.SCALAR||e===dt.STRING||e===dt.BOOLEAN||e===dt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case dt.VEC2:return D.unpack(n,0,new D);case dt.VEC3:return m.unpack(n,0,new m);case dt.VEC4:return se.unpack(n,0,new se);case dt.MAT2:return Ii.unpack(n,0,new Ii);case dt.MAT3:return $.unpack(n,0,new $);case dt.MAT4:return M.unpack(n,0,new M)}throw new ae(`Invalid metadata object type: ${e}`)};Ta.convertFromObjectType=function(e,t){if(!l(t)||e===dt.SCALAR||e===dt.STRING||e===dt.BOOLEAN||e===dt.ENUM)return t;switch(e){case dt.VEC2:return D.pack(t,Array(2));case dt.VEC3:return m.pack(t,Array(3));case dt.VEC4:return se.pack(t,Array(4));case dt.MAT2:return Ii.pack(t,Array(4));case dt.MAT3:return $.pack(t,Array(9));case dt.MAT4:return M.pack(t,Array(16))}throw new ae(`Invalid metadata object type: ${e}`)};Ta.decodeMetadataValues=function(e,t,n){let i=Ta.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=Ta.convertFromObjectType(e.type,t.offset),s=Ta.convertFromObjectType(e.type,t.scale);i=ff.valueTransformInPlace(i,r,s,kt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],d=Ta.convertToObjectType(e.type,c);s[a]=d}return s}return Ta.convertToObjectType(e.type,i)};var _F=Object.freeze(Ta);var Fvi=T(S(),1);function AT(){this._framebuffer=new fi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(AT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function hmt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function fmt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -12760,7 +11297,7 @@ void main() out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0, czm_packDepth(depth), globeDepthPacked); } -`,{renderState:Ue.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}wT.prototype.update=function(e,t){lmt(this,e,t),dmt(this,e,t)};var umt=new se,mmt=new se(1,1/255,1/65025,1/16581375);wT.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=se.unpack(i,0,umt);return se.divideByScalar(o,255,o),se.dot(o,mmt)};wT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};wT.prototype.isDestroyed=function(){return!1};wT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),me(this)};var vF=wT;var T9i=T(S(),1);var pwi=T(S(),1);function hmt(e,t){this.near=y(e,0),this.far=y(t,0);let n=Ee.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var wF=hmt;var Pwi=T(S(),1);var gwi=T(S(),1),Gy=`uniform highp sampler2D u_depthTexture; +`,{renderState:Ue.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}AT.prototype.update=function(e,t){hmt(this,e,t),fmt(this,e,t)};var pmt=new se,bmt=new se(1,1/255,1/65025,1/16581375);AT.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=se.unpack(i,0,pmt);return se.divideByScalar(o,255,o),se.dot(o,bmt)};AT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};AT.prototype.isDestroyed=function(){return!1};AT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),me(this)};var TF=AT;var qAi=T(S(),1);var kvi=T(S(),1);function gmt(e,t){this.near=y(e,0),this.far=y(t,0);let n=Ee.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var SF=gmt;var owi=T(S(),1);var Dvi=T(S(),1),Gy=`uniform highp sampler2D u_depthTexture; in vec2 v_textureCoordinates; @@ -12768,18 +11305,76 @@ void main() { out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;function np(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new ze,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(np.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function hxe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!ze.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,ze.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=ze.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!ze.equals(r,e._rs.viewport)||a)&&(e._rs=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:mn.ALPHA_BLEND}),e._rsUpdate=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Un.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Un.NEVER,reference:Dt.CESIUM_3D_TILE_MASK,mask:Dt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Gy,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(ql,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Gy,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(ql,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new $n({color:new B(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}np.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),hxe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};np.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};np.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};np.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),hxe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};np.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};np.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(B.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};np.prototype.isDestroyed=function(){return!1};np.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),me(this)};var FF=np;var Owi=T(S(),1);function FT(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new ze,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(FT.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function fmt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function pmt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function bmt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!ze.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,ze.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=ze.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!ze.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Gy,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new $n({color:new B(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}FT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;pmt(this,n,o,r,e),bmt(this,n,o,r,i),this._useHdr=e};FT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};FT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};FT.prototype.isDestroyed=function(){return!1};FT.prototype.destroy=function(){return fmt(this),me(this)};var AF=FT;var lFi=T(S(),1);function m0(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new $n({color:new B(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new $n({color:new B(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new $n({color:new B(0,0,0,0),owner:this}),this._alphaClearCommand=new $n({color:new B(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new ze,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function fxe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Vj(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function pxe(e){fxe(e),Vj(e)}function gmt(e,t,n,i){fxe(e),e._accumulationTexture=new Wt({context:t,width:n,height:i,pixelFormat:nt.RGBA,pixelDatatype:je.FLOAT}),e._revealageTexture=new Wt({context:t,pixelFormat:nt.RGBA,pixelDatatype:je.FLOAT,width:n,height:i,flipY:!1})}function ymt(e,t){Vj(e);let n=ie.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Vj(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!c||!d)&&(pxe(e),e._translucentMultipassSupport=!1,i=!1)}return i}m0.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((c||d)&&(this._numSamples=o,gmt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!ymt(this,e))return;this._useHDR=i;let u=this,h,p;l(this._compositeCommand)||(h=new De({sources:[dE]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new De({defines:["MRT"],sources:[JS]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new De({sources:[JS]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!ze.equals(this._viewport,t.viewport),f=g!==this._useScissorTest;this._useScissorTest=g,ze.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=ze.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!ze.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=Ue.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var xmt={enabled:!0,color:new B(0,0,0,0),equationRgb:Ea.ADD,equationAlpha:Ea.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA},_mt={enabled:!0,color:new B(0,0,0,0),equationRgb:Ea.ADD,equationAlpha:Ea.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationAlpha:Co.ONE},Tmt={enabled:!0,color:new B(0,0,0,0),equationRgb:Ea.ADD,equationAlpha:Ea.ADD,functionSourceRgb:Co.ZERO,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA};function Lj(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ue.getState(i);r.depthMask=!1,r.blending=t,o=Ue.fromCache(r),n[i.id]=o}return o}function Smt(e,t,n){return Lj(t,xmt,e._translucentRenderStateCache,n)}function Cmt(e,t,n){return Lj(t,_mt,e._translucentRenderStateCache,n)}function Vmt(e,t,n){return Lj(t,Tmt,e._alphaRenderStateCache,n)}var Lmt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`;function ip(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new fi,this._tempCopyDepthFramebuffer=new fi,this._updateDepthFramebuffer=new fi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new ze,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(ip.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function pxe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!ze.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,ze.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=ze.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!ze.equals(r,e._rs.viewport)||a)&&(e._rs=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Un.EQUAL,frontOperation:{fail:mt.KEEP,zFail:mt.KEEP,zPass:mt.KEEP},backFunction:Un.NEVER,reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Gy,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand($l,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Gy,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand($l,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ti({color:new B(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}ip.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),pxe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};ip.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};ip.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};ip.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),pxe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};ip.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};ip.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(B.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};ip.prototype.isDestroyed=function(){return!1};ip.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),me(this)};var CF=ip;var pwi=T(S(),1);function MT(){this._framebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new fi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new ze,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(MT.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function ymt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function xmt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function _mt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!ze.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,ze.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=ze.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!ze.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Gy,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ti({color:new B(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}MT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;xmt(this,n,o,r,e),_mt(this,n,o,r,i),this._useHdr=e};MT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};MT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};MT.prototype.isDestroyed=function(){return!1};MT.prototype.destroy=function(){return ymt(this),me(this)};var VF=MT;var Mwi=T(S(),1);var gwi=T(S(),1),$V=`#ifdef MRT +layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1; +#else +layout (location = 0) out vec4 out_FragColor; +#endif + +uniform vec4 u_bgColor; +uniform sampler2D u_depthTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) + { +#ifdef MRT + out_FragData_0 = u_bgColor; + out_FragData_1 = vec4(u_bgColor.a); +#else + out_FragColor = u_bgColor; +#endif + return; + } + + discard; +} +`;var xwi=T(S(),1),LF=`/** + * Compositing for Weighted Blended Order-Independent Transparency. See: + * - http://jcgt.org/published/0002/02/09/ + * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html + */ + +uniform sampler2D u_opaque; +uniform sampler2D u_accumulation; +uniform sampler2D u_revealage; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 opaque = texture(u_opaque, v_textureCoordinates); + vec4 accum = texture(u_accumulation, v_textureCoordinates); + float r = texture(u_revealage, v_textureCoordinates).r; + +#ifdef MRT + vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); +#else + vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); +#endif + + out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; + + if (opaque != czm_backgroundColor) + { + out_FragColor.a = 1.0; + } +} +`;function h0(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new fi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new fi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new fi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new fi({createColorAttachments:!1}),this._opaqueClearCommand=new ti({color:new B(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ti({color:new B(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ti({color:new B(0,0,0,0),owner:this}),this._alphaClearCommand=new ti({color:new B(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new ze,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function bxe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Lj(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function gxe(e){bxe(e),Lj(e)}function Tmt(e,t,n,i){bxe(e),e._accumulationTexture=new Xt({context:t,width:n,height:i,pixelFormat:nt.RGBA,pixelDatatype:je.FLOAT}),e._revealageTexture=new Xt({context:t,pixelFormat:nt.RGBA,pixelDatatype:je.FLOAT,width:n,height:i,flipY:!1})}function Smt(e,t){Lj(e);let n=ie.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Lj(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!c||!d)&&(gxe(e),e._translucentMultipassSupport=!1,i=!1)}return i}h0.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((c||d)&&(this._numSamples=o,Tmt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!Smt(this,e))return;this._useHDR=i;let u=this,h,p;l(this._compositeCommand)||(h=new De({sources:[LF]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new De({defines:["MRT"],sources:[$V]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new De({sources:[$V]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!ze.equals(this._viewport,t.viewport),f=g!==this._useScissorTest;this._useScissorTest=g,ze.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=ze.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!ze.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=Ue.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Cmt={enabled:!0,color:new B(0,0,0,0),equationRgb:Xa.ADD,equationAlpha:Xa.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA},Vmt={enabled:!0,color:new B(0,0,0,0),equationRgb:Xa.ADD,equationAlpha:Xa.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationAlpha:Co.ONE},Lmt={enabled:!0,color:new B(0,0,0,0),equationRgb:Xa.ADD,equationAlpha:Xa.ADD,functionSourceRgb:Co.ZERO,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA};function Rj(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ue.getState(i);r.depthMask=!1,r.blending=t,o=Ue.fromCache(r),n[i.id]=o}return o}function Rmt(e,t,n){return Rj(t,Cmt,e._translucentRenderStateCache,n)}function Zmt(e,t,n){return Rj(t,Vmt,e._translucentRenderStateCache,n)}function Gmt(e,t,n){return Rj(t,Lmt,e._alphaRenderStateCache,n)}var Emt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragData_0 = vec4(Ci * wzi, ai); out_FragData_1 = vec4(ai * wzi); -`,Rmt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`,Imt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragColor = vec4(Ci, ai) * wzi; -`,Zmt=` float ai = czm_out_FragColor.a; +`,Xmt=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); -`;function Rj(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return De.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; +`;function Zj(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return De.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; bool czm_discard = false; `);let c=[...i.matchAll(/out_FragData_(\d+)/g)],d="";for(let u=0;u<c.length;u++){let h=c[u];d=`layout (location = ${h[1]}) out vec4 ${h[0]}; ${d}`}return a.sources.push(d),a.sources.push(`void main() @@ -12790,12 +11385,12 @@ ${d}`}return a.sources.push(d),a.sources.push(`void main() discard; } ${i}} -`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Gmt(e,t){return Rj(e,t,"translucentMRT",Lmt)}function Emt(e,t){return Rj(e,t,"translucentMultipass",Rmt)}function Imt(e,t){return Rj(e,t,"alphaMultipass",Zmt)}m0.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=qe.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Gmt(t,e.shaderProgram),n.translucentCommand.renderState=Smt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=qe.shallowClone(e,n.translucentCommand),n.alphaCommand=qe.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Emt(t,e.shaderProgram),n.translucentCommand.renderState=Cmt(this,t,e.renderState),n.alphaCommand.shaderProgram=Imt(t,e.shaderProgram),n.alphaCommand.renderState=Vmt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function Xmt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,h=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.alphaCommand:x.derivedCommands.oit.alphaCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.alphaCommand:f.derivedCommands.oit.alphaCommand;n(x,t,i,g)}i.framebuffer=h}function Wmt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,h=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=h}m0.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Wmt(this,e,t,n,i,o);return}Xmt(this,e,t,n,i,o)};m0.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};m0.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,B.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};m0.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};m0.prototype.isDestroyed=function(){return!1};m0.prototype.destroy=function(){return pxe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),me(this)};var MF=m0;var pFi=T(S(),1);function NF(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(NF.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Pmt(e){e._framebuffer.destroy()}function vmt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new nc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new ze},o.viewport=new ze,e._passState=o}NF.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&vmt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};NF.prototype.isDestroyed=function(){return!1};NF.prototype.destroy=function(){return Pmt(this),me(this)};var kF=NF;var VFi=T(S(),1);function qV(e){let t=new nc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new ze},t.viewport=new ze,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}qV.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return ze.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var UF=new B;qV.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),d=0,u=0,h=0,p=-1;for(let g=0;g<s;++g){if(-a<=d&&d<=a&&-c<=u&&u<=c){let f=4*((c-u)*t+d+a);UF.red=B.byteToFloat(o[f]),UF.green=B.byteToFloat(o[f+1]),UF.blue=B.byteToFloat(o[f+2]),UF.alpha=B.byteToFloat(o[f+3]);let x=i.getObjectByPickColor(UF);if(l(x))return x}if(d===u||d<0&&-d===u||d>0&&d===1-u){let f=h;h=-p,p=f}d+=h,u+=p}};qV.prototype.readCenterPixel=function(e){let t=y(e.width,1),n=y(e.height,1),o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};qV.prototype.isDestroyed=function(){return!1};qV.prototype.destroy=function(){return this._fb.destroy(),me(this)};var DF=qV;var XFi=T(S(),1);function h0(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new B(0,0,0,0),this._clearCommand=new $n({color:new B(0,0,0,0),depth:1,owner:this})}function wmt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(h0.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});h0.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};h0.prototype.clear=function(e,t,n){B.clone(n,this._clearCommand.color),B.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};h0.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};h0.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};h0.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};h0.prototype.isDestroyed=function(){return!1};h0.prototype.destroy=function(){return wmt(this),me(this)};var AT=h0;var GAi=T(S(),1);var wFi=T(S(),1);function MT(){}MT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};MT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=De.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=De.replaceMain(o[d],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; +`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Wmt(e,t){return Zj(e,t,"translucentMRT",Emt)}function Pmt(e,t){return Zj(e,t,"translucentMultipass",Imt)}function vmt(e,t){return Zj(e,t,"alphaMultipass",Xmt)}h0.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=qe.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Wmt(t,e.shaderProgram),n.translucentCommand.renderState=Rmt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=qe.shallowClone(e,n.translucentCommand),n.alphaCommand=qe.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Pmt(t,e.shaderProgram),n.translucentCommand.renderState=Zmt(this,t,e.renderState),n.alphaCommand.shaderProgram=vmt(t,e.shaderProgram),n.alphaCommand.renderState=Gmt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function wmt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,h=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.alphaCommand:x.derivedCommands.oit.alphaCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.alphaCommand:f.derivedCommands.oit.alphaCommand;n(x,t,i,g)}i.framebuffer=h}function Fmt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,h=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=h}h0.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Fmt(this,e,t,n,i,o);return}wmt(this,e,t,n,i,o)};h0.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};h0.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,B.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};h0.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};h0.prototype.isDestroyed=function(){return!1};h0.prototype.destroy=function(){return gxe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),me(this)};var RF=h0;var Owi=T(S(),1);function ZF(){this._framebuffer=new fi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(ZF.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Amt(e){e._framebuffer.destroy()}function Mmt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new ic(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new ze},o.viewport=new ze,e._passState=o}ZF.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&Mmt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};ZF.prototype.isDestroyed=function(){return!1};ZF.prototype.destroy=function(){return Amt(this),me(this)};var GF=ZF;var $wi=T(S(),1);function eL(e){let t=new ic(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new ze},t.viewport=new ze,this._context=e,this._fb=new fi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}eL.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return ze.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var EF=new B;eL.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),d=0,u=0,h=0,p=-1;for(let g=0;g<s;++g){if(-a<=d&&d<=a&&-c<=u&&u<=c){let f=4*((c-u)*t+d+a);EF.red=B.byteToFloat(o[f]),EF.green=B.byteToFloat(o[f+1]),EF.blue=B.byteToFloat(o[f+2]),EF.alpha=B.byteToFloat(o[f+3]);let x=i.getObjectByPickColor(EF);if(l(x))return x}if(d===u||d<0&&-d===u||d>0&&d===1-u){let f=h;h=-p,p=f}d+=h,u+=p}};eL.prototype.readCenterPixel=function(e){let t=y(e.width,1),n=y(e.height,1),o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};eL.prototype.isDestroyed=function(){return!1};eL.prototype.destroy=function(){return this._fb.destroy(),me(this)};var IF=eL;var sFi=T(S(),1);function f0(){this._numSamples=1,this._colorFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new B(0,0,0,0),this._clearCommand=new ti({color:new B(0,0,0,0),depth:1,owner:this})}function Nmt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(f0.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});f0.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};f0.prototype.clear=function(e,t,n){B.clone(n,this._clearCommand.color),B.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};f0.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};f0.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};f0.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};f0.prototype.isDestroyed=function(){return!1};f0.prototype.destroy=function(){return Nmt(this),me(this)};var NT=f0;var iAi=T(S(),1);var dFi=T(S(),1);function kT(){}kT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};kT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=De.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=De.replaceMain(o[d],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; void main() { czm_shadow_cast_main(); v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`)}return new De({defines:i,sources:o})};MT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=De.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let u=0;u<c;++u)r[u]=De.replaceMain(r[u],"czm_shadow_cast_main");let d="";return t&&(a||(d+=`in vec3 v_positionEC; +}`)}return new De({defines:i,sources:o})};kT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=De.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let u=0;u<c;++u)r[u]=De.replaceMain(r[u],"czm_shadow_cast_main");let d="";return t&&(a||(d+=`in vec3 v_positionEC; `),d+=`uniform vec4 shadowMap_lightPositionEC; `),i?d+=`void main() { @@ -12816,7 +11411,7 @@ void main() `:n?d+=` out_FragColor = vec4(1.0); `:d+=` out_FragColor = czm_packDepth(gl_FragCoord.z); `,d+=`} -`,r.push(d),new De({defines:o,sources:r})};MT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${d}${u}${t}${n}${i}`};MT.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new De({defines:i,sources:o})};MT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=De.findNormalVarying(e),s=!i&&l(r)||i&&o,a=De.findPositionVarying(e),c=l(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,f=t.debugCascadeColors,x=t.softShadows,_=h?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),V=e.sources.slice(0),L=V.length;for(let I=0;I<L;++I)V[I]=De.replaceMain(V[I],"czm_shadow_receive_main");h?C.push("USE_CUBE_MAP_SHADOW"):d&&C.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!h&&C.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let Z="";h?Z+=`uniform samplerCube shadowMap_textureCube; +`,r.push(d),new De({defines:o,sources:r})};kT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${d}${u}${t}${n}${i}`};kT.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new De({defines:i,sources:o})};kT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=De.findNormalVarying(e),s=!i&&l(r)||i&&o,a=De.findPositionVarying(e),c=l(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,f=t.debugCascadeColors,x=t.softShadows,_=h?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),V=e.sources.slice(0),L=V.length;for(let I=0;I<L;++I)V[I]=De.replaceMain(V[I],"czm_shadow_receive_main");h?C.push("USE_CUBE_MAP_SHADOW"):d&&C.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!h&&C.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let Z="";h?Z+=`uniform samplerCube shadowMap_textureCube; `:Z+=`uniform sampler2D shadowMap_texture; `;let G;return c?G=` return vec4(${a}, 1.0); `:G=`#ifndef LOG_DEPTH @@ -12927,7 +11522,7 @@ ${f?` // Draw cascade colors for debugging float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,Z+=` out_FragColor.rgb *= visibility; } -`,V.push(Z),new De({defines:C,sources:V})};var ip=MT;function op(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Ot.isInternetExplorer()||Ot.isEdge()||(Ot.isChrome()||Ot.isFirefox())&&Ot.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new M,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new lB,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new le,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new D,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Pr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new Fmt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,Gj(this),this._clearCommand=new $n({depth:1,color:new B}),this._clearPassState=new nc(t),this._size=y(e.size,2048),this.size=this._size}op.MAXIMUM_DISTANCE=2e4;function Fmt(e){this.camera=new lB,this.passState=new nc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Zj(e,t){return Ue.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function Gj(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Zj(t,e._primitiveBias),e._terrainRenderState=Zj(t,e._terrainBias),e._pointRenderState=Zj(t,e._pointBias)}op.prototype.debugCreateRenderStates=function(){Gj(this)};Object.defineProperties(op.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){Dmt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function Ej(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Amt(e,t){let n=new dd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Fc.DEPTH_COMPONENT16}),i=new Wt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:$t.NEAREST}),o=new Wr({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Mmt(e,t){let n=new Wt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:$t.NEAREST}),i=new Wr({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Nmt(e,t){let n=new dd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Fc.DEPTH_COMPONENT16}),i=new xr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:$t.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Wr({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function yxe(e,t){e._isPointLight?Nmt(e,t):e._usesDepthTexture?Mmt(e,t):Amt(e,t)}function kmt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Gj(e),Ej(e),yxe(e,t))}function Umt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Ej(e),yxe(e,t),kmt(e,t),xxe(e,t))}function xxe(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Dmt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=At.maximumCubeMapSize>=t?t:At.maximumCubeMapSize,o.x=t,o.y=t;let r=new ze(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=At.maximumTextureSize>=t?t:At.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new ze(0,0,t,t)):i===4&&(t=At.maximumTextureSize>=t*2?t:At.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new ze(0,0,t,t),n[1].passState.viewport=new ze(t,0,t,t),n[2].passState.viewport=new ze(0,t,t,t),n[3].passState.viewport=new ze(t,t,t,t));e._clearPassState.viewport=new ze(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,d=a.y/o.y,u=a.width/o.x,h=a.height/o.y;s.textureOffsets=new M(u,0,0,c,0,h,0,d,0,0,1,0,0,0,0,1)}}var Bmt=new ze;function Omt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,V.push(Z),new De({defines:C,sources:V})};var op=kT;function rp(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Bt.isInternetExplorer()||Bt.isEdge()||(Bt.isChrome()||Bt.isFirefox())&&Bt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new M,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new dB,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new le,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new D,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Pr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new kmt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,Ej(this),this._clearCommand=new ti({depth:1,color:new B}),this._clearPassState=new ic(t),this._size=y(e.size,2048),this.size=this._size}rp.MAXIMUM_DISTANCE=2e4;function kmt(e){this.camera=new dB,this.passState=new ic(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Gj(e,t){return Ue.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function Ej(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Gj(t,e._primitiveBias),e._terrainRenderState=Gj(t,e._terrainBias),e._pointRenderState=Gj(t,e._pointBias)}rp.prototype.debugCreateRenderStates=function(){Ej(this)};Object.defineProperties(rp.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){Hmt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function Ij(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Umt(e,t){let n=new ud({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ac.DEPTH_COMPONENT16}),i=new Xt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:qt.NEAREST}),o=new Wr({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Dmt(e,t){let n=new Xt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:qt.NEAREST}),i=new Wr({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Bmt(e,t){let n=new ud({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ac.DEPTH_COMPONENT16}),i=new xr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:qt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Wr({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function _xe(e,t){e._isPointLight?Bmt(e,t):e._usesDepthTexture?Dmt(e,t):Umt(e,t)}function Omt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Ej(e),Ij(e),_xe(e,t))}function Ymt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Ij(e),_xe(e,t),Omt(e,t),Txe(e,t))}function Txe(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Hmt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Ft.maximumCubeMapSize>=t?t:Ft.maximumCubeMapSize,o.x=t,o.y=t;let r=new ze(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Ft.maximumTextureSize>=t?t:Ft.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new ze(0,0,t,t)):i===4&&(t=Ft.maximumTextureSize>=t*2?t:Ft.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new ze(0,0,t,t),n[1].passState.viewport=new ze(t,0,t,t),n[2].passState.viewport=new ze(0,t,t,t),n[3].passState.viewport=new ze(t,t,t,t));e._clearPassState.viewport=new ze(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,d=a.y/o.y,u=a.width/o.x,h=a.height/o.y;s.textureOffsets=new M(u,0,0,c,0,h,0,d,0,0,1,0,0,0,0,1)}}var zmt=new ze;function Kmt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -12988,7 +11583,19 @@ ${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCo `:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); `} out_FragColor = vec4(vec3(shadow), 1.0); } -`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ee.OVERLAY,i}function Ymt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Bmt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Omt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!ze.equals(a.renderState.viewport,s))&&(a.renderState=Ue.fromCache({viewport:ze.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var rp=new Array(8);rp[0]=new se(-1,-1,-1,1);rp[1]=new se(1,-1,-1,1);rp[2]=new se(1,1,-1,1);rp[3]=new se(-1,1,-1,1);rp[4]=new se(-1,-1,1,1);rp[5]=new se(1,-1,1,1);rp[6]=new se(1,1,1,1);rp[7]=new se(-1,1,1,1);var Ey=new M,Ij=new Array(8);for(let e=0;e<8;++e)Ij[e]=new se;function Hmt(e,t){let n=new Gt({geometry:new wm({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:Ht.fromColor(t)}}),i=new Gt({geometry:new Rb({radius:.5}),attributes:{color:Ht.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var zmt=[B.RED,B.GREEN,B.BLUE,B.MAGENTA],Kmt=new m;function Jmt(e,t){Ymt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new $f({camera:e._sceneCamera,color:B.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new $f({camera:e._shadowMapCamera,color:B.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new $f({camera:e._passes[i].camera,color:zmt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=ve.IDENTITY,r=e._pointLightRadius*2,s=m.fromElements(r,r,r,Kmt),a=M.fromTranslationQuaternionRotationScale(i,o,s,Ey);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Hmt(a,B.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new $f({camera:e._shadowMapCamera,color:B.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function lB(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new M}lB.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var Qmt=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);lB.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(Qmt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var jmt=new Array(5),qmt=new Ri,$mt=new Array(4),_xe=new m,Txe=new m;function eht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,d=r/o,u=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,u=.9);let p=$mt,g=jmt;for(g[0]=o,g[s]=r,a=0;a<s;++a){let F=(a+1)/s,b=o*Math.pow(d,F),R=o+c*F,E=W.lerp(R,b,u);g[a+1]=E,p[a]=E-g[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let F=g[0];for(a=0;a<s-1;++a)F+=p[a],g[a+1]=F}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let f=n.frustum,x=f.left,_=f.right,C=f.bottom,V=f.top,L=f.near,Z=f.far,G=n.positionWC,I=n.directionWC,v=n.upWC,P=i.frustum.clone(qmt),w=n.getViewProjection();for(a=0;a<s;++a){P.near=g[a],P.far=g[a+1];let F=M.multiply(P.projectionMatrix,i.viewMatrix,Ey),b=M.inverse(F,Ey),R=M.multiply(w,b,Ey),E=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,_xe),X=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Txe);for(let Y=0;Y<8;++Y){let k=se.clone(rp[Y],Ij[Y]);M.multiplyByVector(R,k,k),m.divideByScalar(k,k.w,k),m.minimumByComponent(k,E,E),m.maximumByComponent(k,X,X)}E.x=Math.max(E.x,0),E.y=Math.max(E.y,0),E.z=0,X.x=Math.min(X.x,1),X.y=Math.min(X.y,1),X.z=Math.min(X.z,1);let A=e._passes[a],N=A.camera;N.clone(n);let O=N.frustum;O.left=x+E.x*(_-x),O.right=x+X.x*(_-x),O.bottom=C+E.y*(V-C),O.top=C+X.y*(V-C),O.near=L+E.z*(Z-L),O.far=L+X.z*(Z-L),A.cullingVolume=N.frustum.computeCullingVolume(G,I,v);let U=e._cascadeMatrices[a];M.multiply(N.getViewProjection(),i.inverseViewMatrix,U),M.multiply(A.textureOffsets,U,U)}}var tht=new M,nht=new m,iht=new m,bxe=new m;function oht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,Ey),r=M.inverse(o,Ey),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,nht);a=m.cross(c,s,iht),m.normalize(a,a),m.normalize(c,c);let d=m.fromElements(0,0,0,bxe),u=M.computeView(d,s,a,c,tht),h=M.multiply(u,r,Ey),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,_xe),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Txe);for(let Z=0;Z<8;++Z){let G=se.clone(rp[Z],Ij[Z]);M.multiplyByVector(h,G,G),m.divideByScalar(G,G.w,G),m.minimumByComponent(G,p,p),m.maximumByComponent(G,g,g)}g.z+=1e3,p.z-=10;let f=bxe;f.x=-(.5*(p.x+g.x)),f.y=-(.5*(p.y+g.y)),f.z=-g.z;let x=M.fromTranslation(f,Ey);u=M.multiply(x,u,u);let _=.5*(g.x-p.x),C=.5*(g.y-p.y),V=g.z-p.z,L=n.frustum;L.left=-_,L.right=_,L.bottom=-C,L.top=C,L.near=.01,L.far=V,M.clone(u,n.viewMatrix),M.inverse(u,n.inverseViewMatrix),M.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var rht=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],sht=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],aht=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function cht(e,t){let n=new Ri;n.fov=W.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=rht[i],o.upWC=sht[i],o.rightWC=aht[i],M.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),M.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var lht=new m,dht=new m,Sxe=new le,gxe=Sxe.center;function uht(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=Sxe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,lht),s=m.negate(i.directionWC,dht),a=m.dot(r,s);if(e.fadingEnabled){let c=W.clamp(a/.1,0,1);e._darkness=W.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===zt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,r,gxe),gxe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===zt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere)}}function mht(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,r.directionWC):e._isPointLight?m.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;M.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),m.normalize(s,s),m.negate(s,s),M.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=ro.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,uht(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}op.prototype.update=function(e){if(mht(this,e),this._needsUpdate)if(Umt(this,e.context),this._isPointLight&&cht(this,e),this._cascadesEnabled&&(oht(this,e),this._numberOfCascades>1&&eht(this,e)),this._isPointLight)this._shadowMapCullingVolume=hs.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;M.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Jmt(this,e)};op.prototype.updatePass=function(e,t){xxe(this,e,t)};var hht=new D;function Cxe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=hht;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,se.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return St(t,o,!1)}function fht(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=qe.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Ee.GLOBE,h=n.pass!==Ee.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,f=ip.getShadowCastShaderKeyword(p,u,g,h);if(s=i.shaderCache.getDerivedShaderProgram(d,f),!l(s)){let _=d.vertexShaderSource,C=d.fragmentShaderSource,V=ip.createShadowCastVertexShader(_,p,u),L=ip.createShadowCastFragmentShader(C,p,g,h);s=i.shaderCache.createDerivedShaderProgram(d,f,{vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ye(a,!1),a.cull=Ye(a.cull,!1),a.cull.enabled=!1,a=Ue.fromCache(a)),c=Cxe(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}op.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,d=t.pass===Ee.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;l(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=qe.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(h)||f||n||g){let x=ip.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(h=i.shaderCache.getDerivedShaderProgram(s,x),!l(h)){let _=ip.createShadowReceiveVertexShader(a,d,u),C=ip.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);h=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:_,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=Cxe(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};op.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=fht(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};op.prototype.isDestroyed=function(){return!1};op.prototype.destroy=function(){Ej(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return me(this)};var f0=op;var jAi=T(S(),1);var IAi=T(S(),1),NT=`uniform sampler2D colorTexture; +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ee.OVERLAY,i}function Jmt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=zmt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Kmt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!ze.equals(a.renderState.viewport,s))&&(a.renderState=Ue.fromCache({viewport:ze.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var sp=new Array(8);sp[0]=new se(-1,-1,-1,1);sp[1]=new se(1,-1,-1,1);sp[2]=new se(1,1,-1,1);sp[3]=new se(-1,1,-1,1);sp[4]=new se(-1,-1,1,1);sp[5]=new se(1,-1,1,1);sp[6]=new se(1,1,1,1);sp[7]=new se(-1,1,1,1);var Ey=new M,Xj=new Array(8);for(let e=0;e<8;++e)Xj[e]=new se;function Qmt(e,t){let n=new Zt({geometry:new vm({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:Yt.fromColor(t)}}),i=new Zt({geometry:new Zb({radius:.5}),attributes:{color:Yt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new ln({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var jmt=[B.RED,B.GREEN,B.BLUE,B.MAGENTA],qmt=new m;function $mt(e,t){Jmt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new ep({camera:e._sceneCamera,color:B.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new ep({camera:e._shadowMapCamera,color:B.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new ep({camera:e._passes[i].camera,color:jmt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=ve.IDENTITY,r=e._pointLightRadius*2,s=m.fromElements(r,r,r,qmt),a=M.fromTranslationQuaternionRotationScale(i,o,s,Ey);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Qmt(a,B.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new ep({camera:e._shadowMapCamera,color:B.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function dB(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new M}dB.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var eht=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);dB.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(eht,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var tht=new Array(5),nht=new Gi,iht=new Array(4),Sxe=new m,Cxe=new m;function oht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,d=r/o,u=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,u=.9);let p=iht,g=tht;for(g[0]=o,g[s]=r,a=0;a<s;++a){let F=(a+1)/s,b=o*Math.pow(d,F),R=o+c*F,E=W.lerp(R,b,u);g[a+1]=E,p[a]=E-g[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let F=g[0];for(a=0;a<s-1;++a)F+=p[a],g[a+1]=F}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let f=n.frustum,x=f.left,_=f.right,C=f.bottom,V=f.top,L=f.near,Z=f.far,G=n.positionWC,I=n.directionWC,v=n.upWC,P=i.frustum.clone(nht),w=n.getViewProjection();for(a=0;a<s;++a){P.near=g[a],P.far=g[a+1];let F=M.multiply(P.projectionMatrix,i.viewMatrix,Ey),b=M.inverse(F,Ey),R=M.multiply(w,b,Ey),E=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Sxe),X=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Cxe);for(let Y=0;Y<8;++Y){let k=se.clone(sp[Y],Xj[Y]);M.multiplyByVector(R,k,k),m.divideByScalar(k,k.w,k),m.minimumByComponent(k,E,E),m.maximumByComponent(k,X,X)}E.x=Math.max(E.x,0),E.y=Math.max(E.y,0),E.z=0,X.x=Math.min(X.x,1),X.y=Math.min(X.y,1),X.z=Math.min(X.z,1);let A=e._passes[a],N=A.camera;N.clone(n);let O=N.frustum;O.left=x+E.x*(_-x),O.right=x+X.x*(_-x),O.bottom=C+E.y*(V-C),O.top=C+X.y*(V-C),O.near=L+E.z*(Z-L),O.far=L+X.z*(Z-L),A.cullingVolume=N.frustum.computeCullingVolume(G,I,v);let U=e._cascadeMatrices[a];M.multiply(N.getViewProjection(),i.inverseViewMatrix,U),M.multiply(A.textureOffsets,U,U)}}var rht=new M,sht=new m,aht=new m,yxe=new m;function cht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,Ey),r=M.inverse(o,Ey),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=m.cross(s,a,sht);a=m.cross(c,s,aht),m.normalize(a,a),m.normalize(c,c);let d=m.fromElements(0,0,0,yxe),u=M.computeView(d,s,a,c,rht),h=M.multiply(u,r,Ey),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Sxe),g=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Cxe);for(let Z=0;Z<8;++Z){let G=se.clone(sp[Z],Xj[Z]);M.multiplyByVector(h,G,G),m.divideByScalar(G,G.w,G),m.minimumByComponent(G,p,p),m.maximumByComponent(G,g,g)}g.z+=1e3,p.z-=10;let f=yxe;f.x=-(.5*(p.x+g.x)),f.y=-(.5*(p.y+g.y)),f.z=-g.z;let x=M.fromTranslation(f,Ey);u=M.multiply(x,u,u);let _=.5*(g.x-p.x),C=.5*(g.y-p.y),V=g.z-p.z,L=n.frustum;L.left=-_,L.right=_,L.bottom=-C,L.top=C,L.near=.01,L.far=V,M.clone(u,n.viewMatrix),M.inverse(u,n.inverseViewMatrix),M.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(c,n.rightWC)}var lht=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],dht=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],uht=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function mht(e,t){let n=new Gi;n.fov=W.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=lht[i],o.upWC=dht[i],o.rightWC=uht[i],M.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),M.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var hht=new m,fht=new m,Vxe=new le,xxe=Vxe.center;function pht(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=Vxe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,hht),s=m.negate(i.directionWC,fht),a=m.dot(r,s);if(e.fadingEnabled){let c=W.clamp(a/.1,0,1);e._darkness=W.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===Ht.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,r,xxe),xxe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Ht.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere)}}function bht(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,r.directionWC):e._isPointLight?m.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;M.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),m.normalize(s,s),m.negate(s,s),M.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=ro.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,pht(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}rp.prototype.update=function(e){if(bht(this,e),this._needsUpdate)if(Ymt(this,e.context),this._isPointLight&&mht(this,e),this._cascadesEnabled&&(cht(this,e),this._numberOfCascades>1&&oht(this,e)),this._isPointLight)this._shadowMapCullingVolume=hs.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;M.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&$mt(this,e)};rp.prototype.updatePass=function(e,t){Txe(this,e,t)};var ght=new D;function Lxe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=ght;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,se.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return Tt(t,o,!1)}function yht(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=qe.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Ee.GLOBE,h=n.pass!==Ee.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,f=op.getShadowCastShaderKeyword(p,u,g,h);if(s=i.shaderCache.getDerivedShaderProgram(d,f),!l(s)){let _=d.vertexShaderSource,C=d.fragmentShaderSource,V=op.createShadowCastVertexShader(_,p,u),L=op.createShadowCastFragmentShader(C,p,g,h);s=i.shaderCache.createDerivedShaderProgram(d,f,{vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ye(a,!1),a.cull=Ye(a.cull,!1),a.cull.enabled=!1,a=Ue.fromCache(a)),c=Lxe(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}rp.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,d=t.pass===Ee.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;l(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=qe.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(h)||f||n||g){let x=op.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(h=i.shaderCache.getDerivedShaderProgram(s,x),!l(h)){let _=op.createShadowReceiveVertexShader(a,d,u),C=op.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);h=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:_,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=Lxe(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};rp.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=yht(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};rp.prototype.isDestroyed=function(){return!1};rp.prototype.destroy=function(){Ij(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return me(this)};var p0=rp;var GAi=T(S(),1);var rAi=T(S(),1),XF=`uniform sampler2D u_opaqueDepthTexture; +uniform sampler2D u_translucentDepthTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; + float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; + translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); + out_FragColor = czm_packDepth(translucentDepth); +} +`;var aAi=T(S(),1),UT=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; @@ -13019,7 +11626,7 @@ void main() out_FragColor = color; #endif } -`;var pht=!1;function Iy(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new $n({color:new B(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new $n({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new ze,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(Iy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Vxe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Lxe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function bht(e,t,n,i){Vxe(e),e._translucentDepthStencilTexture=new Wt({context:t,width:n,height:i,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:$t.NEAREST})}function ght(e,t,n,i){Lxe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function yht(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(bht(e,t,o,r),ght(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new De({sources:[lE]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new De({sources:[NT]}),a={colorTexture:function(){return e._textureToComposite}},pht&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,h=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new De({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),g=qe.shallowClone(u);g.shaderProgram=p,u.derivedCommands.pick=g}l(e._copyCommand)||(s=new De({sources:[NT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new De({sources:[NT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!ze.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,ze.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=ze.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!ze.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!ze.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Un.EQUAL,reference:Dt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!ze.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:mn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Iy.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,d.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){yht(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,!d.depthForTranslucentClassification)continue;let u=d.derivedCommands.depth.depthOnlyCommand;t(u,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};Iy.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Ee.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ee.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(c[u],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};Iy.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),xht(this,e,t)};function xht(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}Iy.prototype.isSupported=function(){return this._supported};Iy.prototype.isDestroyed=function(){return!1};Iy.prototype.destroy=function(){return Vxe(this),Lxe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),me(this)};var BF=Iy;function _ht(){this.command=void 0,this.near=void 0,this.far=void 0}function dB(e,t,n){let i=e.context,o;i.depthTexture&&(o=new FF);let r;e._useOIT&&i.depthTexture&&(r=new MF(i));let s=new nc(i);s.viewport=ze.clone(n),this.camera=t,this._cameraClone=ro.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new DF(i),this.pickDepthFramebuffer=new kF,this.sceneFramebuffer=new AT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new AF,this.oit=r,this.translucentTileClassification=new BF(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Xj=new m,Wj=new m;function Tht(e,t,n){let i=Math.max(m.maximumComponent(m.abs(e.position,Xj)),m.maximumComponent(m.abs(t.position,Wj))),o=1/Math.max(1,i);return m.multiplyByScalar(e.position,o,Xj),m.multiplyByScalar(t.position,o,Wj),m.equalsEpsilon(Xj,Wj,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}dB.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Tht(t,n,W.EPSILON15)?(this._cameraStartFired&&_i()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=_i(),ro.clone(t,n),!0)};function Sht(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===oe.SCENE2D,d=t.nearToFarDistance2D;i*=1+W.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let u;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=u;for(let p=0;p<u;++p){let g,f;c?(g=Math.min(i-d,n+p*d),f=Math.min(i,g+d)):(g=Math.max(n,Math.pow(a,p)*n),f=Math.min(i,a*g));let x=h[p];l(x)?(x.near=g,x.far=f):x=h[p]=new wF(g,f)}}function Cht(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,d=a.commandsInFrustums;d[c]=l(d[c])?d[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var Rxe=new hs,Vht=new Ra;dB.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,d=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList;for(let w=0;w<u.length;++w)for(let F=0;F<Ee.NUMBER_OF_PASSES;++F)u[w].indices[F]=0;c.length=0,d.length=0;let h=this._commandExtents,p=h.length,g=0,f=+Number.MAX_VALUE,x=-Number.MAX_VALUE,{shadowsEnabled:_}=o,C=+Number.MAX_VALUE,V=-Number.MAX_VALUE,L=Number.MAX_VALUE,Z=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:G}=t,I=Rxe.planes;for(let w=0;w<5;++w)I[w]=G.planes[w];G=Rxe;for(let w=0;w<i.length;++w){let F=i[w],{pass:b,boundingVolume:R}=F;if(b===Ee.COMPUTE)c.push(F);else if(b===Ee.OVERLAY)d.push(F);else{let E,X;if(l(R)){if(!e.isVisible(G,F,Z))continue;let N=R.computePlaneDistances(r,s,Vht);if(E=N.start,X=N.stop,f=Math.min(f,E),x=Math.max(x,X),_&&F.receiveShadows&&E<f0.MAXIMUM_DISTANCE&&!(b===Ee.GLOBE&&E<-100&&X>100)){let O=X-E;b!==Ee.GLOBE&&E<100&&(L=Math.min(L,O)),C=Math.min(C,E),V=Math.max(V,X)}}else F instanceof $n?(E=a.near,X=a.far):(E=a.near,X=a.far,f=Math.min(f,E),x=Math.max(x,X));let A=h[g];l(A)||(A=h[g]=new _ht),A.command=F,A.near=E,A.far=X,g++}}_&&(C=Math.min(Math.max(C,a.near),a.far),V=Math.max(Math.min(V,a.far),C),o.nearPlane=C,o.farPlane=V,o.closestObjectSize=L),Sht(this,e,f,x);for(let w=0;w<g;w++)Cht(this,e,h[w]);if(g<p)for(let w=g;w<p;w++){let F=h[w];if(!l(F.command))break;F.command=void 0}let v=u.length,{frustumSplits:P}=t;P.length=v+1;for(let w=0;w<v;++w)P[w]=u[w].near,w===v-1&&(P[w+1]=u[w].far)};dB.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var kT=dB;var Gxe=.1,Lht=new fm({pass:Fo.MOST_DETAILED_PRELOAD}),Rht=new fm({pass:Fo.MOST_DETAILED_PICK}),OF=new fm({pass:Fo.PICK});function ea(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new ze(0,0,1,1),n=new ro(e);n.frustum=new an({width:Gxe,aspectRatio:1,near:.1}),this._pickOffscreenView=new kT(e,n,t)}ea.prototype.update=function(){this._pickPositionCacheDirty=!0};ea.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new vF,n[t]=i),i};var Zht=new Pr,Ght=new m,uB=new m,Eht=new D,Iht=new M;function Xht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let d=2*(o.height-t.y-o.y)/o.height-1;d*=(s.top-s.bottom)*.5;let u=M.clone(r.transform,Iht);r._setTransform(M.IDENTITY);let h=m.clone(r.position,Ght);m.multiplyByScalar(r.right,c,uB),m.add(uB,h,h),m.multiplyByScalar(r.up,d,uB),m.add(uB,h,h),r._setTransform(u),e.mode===oe.SCENE2D&&m.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,Eht),g=Zht;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(h,r.directionWC,r.upWC)}var Wht=new ul,Pht=new D;function vht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),d=s.aspectRatio*c,u=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,g=h*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,Pht),x=f.x*n*.5,_=f.y*i*.5,C=Wht;return C.top=g+_,C.bottom=g-_,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function mB(e,t,n,i,o){let r=e.camera.frustum;return r instanceof an||r instanceof Pr?Xht(e,t,n,i,o):vht(e,t,n,i,o)}var hB=new ze(0,0,3,3),fB=new D,YF=new B(0,0,0,0);function Pj(e,t,n,i,o){return o.width=y(n,3),o.height=y(i,o.width),o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}ea.prototype.pick=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=ze.clone(a,d.viewport);let u=ki.transformWindowToDrawingBuffer(e,t,fB),h=Pj(o.drawingBufferHeight,u,n,i,hB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=mB(e,u,h.width,h.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=OF,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(h,a),e.updateAndExecuteCommands(d,YF),e.resolveFramebuffers(d);let p=c.end(h);return o.endFrame(),p};ea.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=ze.clone(a,d.viewport);let u=ki.transformWindowToDrawingBuffer(e,t,fB),h=Pj(o.drawingBufferHeight,u,n,i,hB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=mB(e,u,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=OF,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(h,a),e.updateAndExecuteCommands(d,YF),e.resolveFramebuffers(d);let p=c.readCenterPixel(h);return o.endFrame(),p};ea.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=ze.clone(s,c.viewport);let d=ki.transformWindowToDrawingBuffer(e,t,fB),u=Pj(i.drawingBufferHeight,d,1,1,hB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=mB(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=OF,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,YF);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=h;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,PF.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function wht(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=ze.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=mB(e,t,1,1,s),o.tilesetPassState=OF,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,YF),e.resolveFramebuffers(c),i.endFrame()}var Fht=new Ri,Aht=new ul,Mht=new an,Nht=new Pr;ea.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let d=ki.transformWindowToDrawingBuffer(e,t,fB);e.pickTranslucentDepth?wht(e,d):(e.updateFrameState(),c.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;l(s.frustum.fov)?u=s.frustum.clone(Fht):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(Aht):l(s.frustum.width)?u=s.frustum.clone(Mht):u=s.frustum.clone(Nht);let{frustumCommandsList:h}=a,p=h.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(o,d.x,d.y);if(l(x)&&x>0&&x<1){let _=h[g],C;return e.mode===oe.SCENE2D?(C=s.position.z,s.position.z=C-_.near+1,u.far=Math.max(1,_.far-_.near),u.near=1,c.update(r),c.updateFrustum(u)):(u.near=_.near*(g!==0?e.opaqueFrustumNearOffset:1),u.far=_.far,c.updateFrustum(u)),n=ki.drawingBufferToWorldCoordinates(e,d,x,n),e.mode===oe.SCENE2D&&(s.position.z=C,c.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var kht=new he;ea.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==oe.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,kht);o.cartographicToCartesian(r,n)}return n};function Exe(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let d=c.object,u=c.position,h=c.exclude;if(l(u)&&!l(d)){o.push(c);break}if(!l(d)||!l(d.primitive)||!h&&(o.push(c),0>=--e))break;let p=d.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(d.id)&&(i=p.getGeometryInstanceAttributes(d.id),l(i)&&l(i.show)&&(g=!0,i.show=xn.toValue(!1,i.show),s.push(i))),d instanceof ks&&(g=!0,d.show=!1,a.push(d)),g||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=xn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}ea.prototype.drillPick=function(e,t,n,i,o){let r=this;return Exe(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var Zxe=new m,Uht=new m;function Dht(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function Ixe(e,t,n,i){let o=t.direction,r=m.mostOrthogonalAxis(o,Zxe),s=m.cross(o,r,Zxe),a=m.cross(o,s,Uht);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,Gxe),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Bht(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=Ixe(e,o,r,a),d=Lht;d.camera=a,d.cullingVolume=c;let u=!0,h=s.length;for(let p=0;p<h;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}ea.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Bht(this,e,t[n])&&t.splice(n--,1)};function Xxe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Ul&&Xxe(o,t,n))}}function pB(e,t,n,i,o,r){let s=[];if(Xxe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Dht(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Oht(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Yht(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,Ixe(e,n,o,u.camera);let h=ze.clone(u.viewport,hB),p=u.pickFramebuffer.begin(h,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=Rht:c.tilesetPassState=OF,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,YF),t.resolveFramebuffers(p);let g,f=u.pickFramebuffer.end(h);if(t.context.depthTexture){let{frustumCommandsList:x}=u,_=x.length;for(let C=0;C<_;++C){let L=e.getPickDepth(t,C).getDepth(a,0,0);if(l(L)&&L>0&&L<1){let Z=x[C],G=Z.near*(C!==0?t.opaqueFrustumNearOffset:1),I=Z.far,v=G+L*(I-G);g=bn.getPoint(n,v);break}}}if(t.view=t.defaultView,a.endFrame(),l(f)||l(g))return{object:f,position:g,exclude:!l(g)&&r||Oht(f,i)}}function Wxe(e,t,n,i,o,r,s,a){return Exe(i,function(){return Yht(e,t,n,o,r,s,a)})}function $V(e,t,n,i,o,r,s){let a=Wxe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function Pxe(e,t,n,i,o,r,s,a){return Wxe(e,t,n,i,o,r,s,a)}function bB(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}ea.prototype.pickFromRay=function(e,t,n,i){return $V(this,e,t,n,i,!1,!1)};ea.prototype.drillPickFromRay=function(e,t,n,i,o){return Pxe(this,e,t,n,i,o,!1,!1)};ea.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=bn.clone(t),n=l(n)?n.slice():n,bB(e,pB(o,e,t,n,i,function(){return $V(o,e,t,n,i,!1,!0)}))};ea.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=bn.clone(t),i=l(i)?i.slice():i,bB(e,pB(r,e,t,i,o,function(){return Pxe(r,e,t,n,i,o,!1,!0)}))};var Hht=new m,zht=new m,Kht=new bn,vxe=new he;function vj(e,t){let n=e.ellipsoid,i=li._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,zht),r=he.toCartesian(t,n,Hht),s=Kht;s.origin=r,s.direction=o;let a=new bn;return bn.getPoint(s,i,a.origin),m.negate(o,a.direction),a}function wxe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,vxe);return vj(e,i)}function Fxe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,vxe).height}function Jht(e,t,n,i,o){let r=vj(t,n);return pB(e,t,r,i,o,function(){let s=$V(e,t,r,i,o,!0,!0);if(l(s))return Fxe(t,s.position)})}function Qht(e,t,n,i,o,r){let s=wxe(t,n);return pB(e,t,s,i,o,function(){let a=$V(e,t,s,i,o,!0,!0);if(l(a))return m.clone(a.position,r)})}ea.prototype.sampleHeight=function(e,t,n,i){let o=vj(e,t),r=$V(this,e,o,n,i,!0,!1);if(l(r))return Fxe(e,r.position)};ea.prototype.clampToHeight=function(e,t,n,i,o){let r=wxe(e,t),s=$V(this,e,r,n,i,!0,!1);if(l(s))return m.clone(s.position,o)};ea.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Jht(this,e,t[s],n,i);return bB(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};ea.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Qht(this,e,t[s],n,i,t[s]);return bB(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};ea.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var HF=ea;var x5i=T(S(),1);var zNi=T(S(),1);var Q9i=T(S(),1),zF=`uniform sampler2D colorTexture; +`;var xht=!1;function Iy(e){this._drawClassificationFBO=new fi({createDepthAttachments:!1}),this._accumulationFBO=new fi({createDepthAttachments:!1}),this._packFBO=new fi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ti({color:new B(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ti({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new ze,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(Iy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Rxe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Zxe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function _ht(e,t,n,i){Rxe(e),e._translucentDepthStencilTexture=new Xt({context:t,width:n,height:i,pixelFormat:nt.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:qt.NEAREST})}function Tht(e,t,n,i){Zxe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function Sht(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(_ht(e,t,o,r),Tht(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new De({sources:[XF]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new De({sources:[UT]}),a={colorTexture:function(){return e._textureToComposite}},xht&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,h=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new De({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),g=qe.shallowClone(u);g.shaderProgram=p,u.derivedCommands.pick=g}l(e._copyCommand)||(s=new De({sources:[UT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new De({sources:[UT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!ze.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,ze.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=ze.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!ze.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!ze.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Un.EQUAL,reference:Ut.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!ze.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Iy.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,d.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){Sht(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,!d.depthForTranslucentClassification)continue;let u=d.derivedCommands.depth.depthOnlyCommand;t(u,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};Iy.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Ee.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ee.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(c[u],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};Iy.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),Cht(this,e,t)};function Cht(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}Iy.prototype.isSupported=function(){return this._supported};Iy.prototype.isDestroyed=function(){return!1};Iy.prototype.destroy=function(){return Rxe(this),Zxe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),me(this)};var WF=Iy;function Vht(){this.command=void 0,this.near=void 0,this.far=void 0}function uB(e,t,n){let i=e.context,o;i.depthTexture&&(o=new CF);let r;e._useOIT&&i.depthTexture&&(r=new RF(i));let s=new ic(i);s.viewport=ze.clone(n),this.camera=t,this._cameraClone=ro.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new IF(i),this.pickDepthFramebuffer=new GF,this.sceneFramebuffer=new NT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new VF,this.oit=r,this.translucentTileClassification=new WF(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Wj=new m,Pj=new m;function Lht(e,t,n){let i=Math.max(m.maximumComponent(m.abs(e.position,Wj)),m.maximumComponent(m.abs(t.position,Pj))),o=1/Math.max(1,i);return m.multiplyByScalar(e.position,o,Wj),m.multiplyByScalar(t.position,o,Pj),m.equalsEpsilon(Wj,Pj,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}uB.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Lht(t,n,W.EPSILON15)?(this._cameraStartFired&&Ti()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ti(),ro.clone(t,n),!0)};function Rht(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===oe.SCENE2D,d=t.nearToFarDistance2D;i*=1+W.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let u;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=u;for(let p=0;p<u;++p){let g,f;c?(g=Math.min(i-d,n+p*d),f=Math.min(i,g+d)):(g=Math.max(n,Math.pow(a,p)*n),f=Math.min(i,a*g));let x=h[p];l(x)?(x.near=g,x.far=f):x=h[p]=new SF(g,f)}}function Zht(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,d=a.commandsInFrustums;d[c]=l(d[c])?d[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var Gxe=new hs,Ght=new Ga;uB.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,d=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList;for(let w=0;w<u.length;++w)for(let F=0;F<Ee.NUMBER_OF_PASSES;++F)u[w].indices[F]=0;c.length=0,d.length=0;let h=this._commandExtents,p=h.length,g=0,f=+Number.MAX_VALUE,x=-Number.MAX_VALUE,{shadowsEnabled:_}=o,C=+Number.MAX_VALUE,V=-Number.MAX_VALUE,L=Number.MAX_VALUE,Z=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:G}=t,I=Gxe.planes;for(let w=0;w<5;++w)I[w]=G.planes[w];G=Gxe;for(let w=0;w<i.length;++w){let F=i[w],{pass:b,boundingVolume:R}=F;if(b===Ee.COMPUTE)c.push(F);else if(b===Ee.OVERLAY)d.push(F);else{let E,X;if(l(R)){if(!e.isVisible(G,F,Z))continue;let N=R.computePlaneDistances(r,s,Ght);if(E=N.start,X=N.stop,f=Math.min(f,E),x=Math.max(x,X),_&&F.receiveShadows&&E<p0.MAXIMUM_DISTANCE&&!(b===Ee.GLOBE&&E<-100&&X>100)){let O=X-E;b!==Ee.GLOBE&&E<100&&(L=Math.min(L,O)),C=Math.min(C,E),V=Math.max(V,X)}}else F instanceof ti?(E=a.near,X=a.far):(E=a.near,X=a.far,f=Math.min(f,E),x=Math.max(x,X));let A=h[g];l(A)||(A=h[g]=new Vht),A.command=F,A.near=E,A.far=X,g++}}_&&(C=Math.min(Math.max(C,a.near),a.far),V=Math.max(Math.min(V,a.far),C),o.nearPlane=C,o.farPlane=V,o.closestObjectSize=L),Rht(this,e,f,x);for(let w=0;w<g;w++)Zht(this,e,h[w]);if(g<p)for(let w=g;w<p;w++){let F=h[w];if(!l(F.command))break;F.command=void 0}let v=u.length,{frustumSplits:P}=t;P.length=v+1;for(let w=0;w<v;++w)P[w]=u[w].near,w===v-1&&(P[w+1]=u[w].far)};uB.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var DT=uB;var Ixe=.1,Eht=new fm({pass:Ao.MOST_DETAILED_PRELOAD}),Iht=new fm({pass:Ao.MOST_DETAILED_PICK}),PF=new fm({pass:Ao.PICK});function ea(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new ze(0,0,1,1),n=new ro(e);n.frustum=new rn({width:Ixe,aspectRatio:1,near:.1}),this._pickOffscreenView=new DT(e,n,t)}ea.prototype.update=function(){this._pickPositionCacheDirty=!0};ea.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new TF,n[t]=i),i};var Xht=new Pr,Wht=new m,mB=new m,Pht=new D,vht=new M;function wht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let d=2*(o.height-t.y-o.y)/o.height-1;d*=(s.top-s.bottom)*.5;let u=M.clone(r.transform,vht);r._setTransform(M.IDENTITY);let h=m.clone(r.position,Wht);m.multiplyByScalar(r.right,c,mB),m.add(mB,h,h),m.multiplyByScalar(r.up,d,mB),m.add(mB,h,h),r._setTransform(u),e.mode===oe.SCENE2D&&m.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,Pht),g=Xht;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(h,r.directionWC,r.upWC)}var Fht=new hl,Aht=new D;function Mht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),d=s.aspectRatio*c,u=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,g=h*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,Aht),x=f.x*n*.5,_=f.y*i*.5,C=Fht;return C.top=g+_,C.bottom=g-_,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function hB(e,t,n,i,o){let r=e.camera.frustum;return r instanceof rn||r instanceof Pr?wht(e,t,n,i,o):Mht(e,t,n,i,o)}var fB=new ze(0,0,3,3),pB=new D,vF=new B(0,0,0,0);function vj(e,t,n,i,o){return o.width=y(n,3),o.height=y(i,o.width),o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}ea.prototype.pick=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=ze.clone(a,d.viewport);let u=Ui.transformWindowToDrawingBuffer(e,t,pB),h=vj(o.drawingBufferHeight,u,n,i,fB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=hB(e,u,h.width,h.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=PF,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(h,a),e.updateAndExecuteCommands(d,vF),e.resolveFramebuffers(d);let p=c.end(h);return o.endFrame(),p};ea.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=ze.clone(a,d.viewport);let u=Ui.transformWindowToDrawingBuffer(e,t,pB),h=vj(o.drawingBufferHeight,u,n,i,fB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=hB(e,u,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=PF,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(h,a),e.updateAndExecuteCommands(d,vF),e.resolveFramebuffers(d);let p=c.readCenterPixel(h);return o.endFrame(),p};ea.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=ze.clone(s,c.viewport);let d=Ui.transformWindowToDrawingBuffer(e,t,pB),u=vj(i.drawingBufferHeight,d,1,1,fB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=hB(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=PF,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,vF);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=h;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,_F.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function Nht(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=ze.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=hB(e,t,1,1,s),o.tilesetPassState=PF,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,vF),e.resolveFramebuffers(c),i.endFrame()}var kht=new Gi,Uht=new hl,Dht=new rn,Bht=new Pr;ea.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let d=Ui.transformWindowToDrawingBuffer(e,t,pB);e.pickTranslucentDepth?Nht(e,d):(e.updateFrameState(),c.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;l(s.frustum.fov)?u=s.frustum.clone(kht):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(Uht):l(s.frustum.width)?u=s.frustum.clone(Dht):u=s.frustum.clone(Bht);let{frustumCommandsList:h}=a,p=h.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(o,d.x,d.y);if(l(x)&&x>0&&x<1){let _=h[g],C;return e.mode===oe.SCENE2D?(C=s.position.z,s.position.z=C-_.near+1,u.far=Math.max(1,_.far-_.near),u.near=1,c.update(r),c.updateFrustum(u)):(u.near=_.near*(g!==0?e.opaqueFrustumNearOffset:1),u.far=_.far,c.updateFrustum(u)),n=Ui.drawingBufferToWorldCoordinates(e,d,x,n),e.mode===oe.SCENE2D&&(s.position.z=C,c.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var Oht=new he;ea.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==oe.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,Oht);o.cartographicToCartesian(r,n)}return n};function Xxe(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let d=c.object,u=c.position,h=c.exclude;if(l(u)&&!l(d)){o.push(c);break}if(!l(d)||!l(d.primitive)||!h&&(o.push(c),0>=--e))break;let p=d.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(d.id)&&(i=p.getGeometryInstanceAttributes(d.id),l(i)&&l(i.show)&&(g=!0,i.show=xn.toValue(!1,i.show),s.push(i))),d instanceof ks&&(g=!0,d.show=!1,a.push(d)),g||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=xn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}ea.prototype.drillPick=function(e,t,n,i,o){let r=this;return Xxe(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var Exe=new m,Yht=new m;function Hht(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function Wxe(e,t,n,i){let o=t.direction,r=m.mostOrthogonalAxis(o,Exe),s=m.cross(o,r,Exe),a=m.cross(o,s,Yht);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,Ixe),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function zht(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=Wxe(e,o,r,a),d=Eht;d.camera=a,d.cullingVolume=c;let u=!0,h=s.length;for(let p=0;p<h;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}ea.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)zht(this,e,t[n])&&t.splice(n--,1)};function Pxe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Dl&&Pxe(o,t,n))}}function bB(e,t,n,i,o,r){let s=[];if(Pxe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Hht(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Kht(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Jht(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,Wxe(e,n,o,u.camera);let h=ze.clone(u.viewport,fB),p=u.pickFramebuffer.begin(h,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=Iht:c.tilesetPassState=PF,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,vF),t.resolveFramebuffers(p);let g,f=u.pickFramebuffer.end(h);if(t.context.depthTexture){let{frustumCommandsList:x}=u,_=x.length;for(let C=0;C<_;++C){let L=e.getPickDepth(t,C).getDepth(a,0,0);if(l(L)&&L>0&&L<1){let Z=x[C],G=Z.near*(C!==0?t.opaqueFrustumNearOffset:1),I=Z.far,v=G+L*(I-G);g=pn.getPoint(n,v);break}}}if(t.view=t.defaultView,a.endFrame(),l(f)||l(g))return{object:f,position:g,exclude:!l(g)&&r||Kht(f,i)}}function vxe(e,t,n,i,o,r,s,a){return Xxe(i,function(){return Jht(e,t,n,o,r,s,a)})}function tL(e,t,n,i,o,r,s){let a=vxe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function wxe(e,t,n,i,o,r,s,a){return vxe(e,t,n,i,o,r,s,a)}function gB(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}ea.prototype.pickFromRay=function(e,t,n,i){return tL(this,e,t,n,i,!1,!1)};ea.prototype.drillPickFromRay=function(e,t,n,i,o){return wxe(this,e,t,n,i,o,!1,!1)};ea.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=pn.clone(t),n=l(n)?n.slice():n,gB(e,bB(o,e,t,n,i,function(){return tL(o,e,t,n,i,!1,!0)}))};ea.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=pn.clone(t),i=l(i)?i.slice():i,gB(e,bB(r,e,t,i,o,function(){return wxe(r,e,t,n,i,o,!1,!0)}))};var Qht=new m,jht=new m,qht=new pn,Fxe=new he;function wj(e,t){let n=e.ellipsoid,i=di._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,jht),r=he.toCartesian(t,n,Qht),s=qht;s.origin=r,s.direction=o;let a=new pn;return pn.getPoint(s,i,a.origin),m.negate(o,a.direction),a}function Axe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,Fxe);return wj(e,i)}function Mxe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,Fxe).height}function $ht(e,t,n,i,o){let r=wj(t,n);return bB(e,t,r,i,o,function(){let s=tL(e,t,r,i,o,!0,!0);if(l(s))return Mxe(t,s.position)})}function eft(e,t,n,i,o,r){let s=Axe(t,n);return bB(e,t,s,i,o,function(){let a=tL(e,t,s,i,o,!0,!0);if(l(a))return m.clone(a.position,r)})}ea.prototype.sampleHeight=function(e,t,n,i){let o=wj(e,t),r=tL(this,e,o,n,i,!0,!1);if(l(r))return Mxe(e,r.position)};ea.prototype.clampToHeight=function(e,t,n,i,o){let r=Axe(e,t),s=tL(this,e,r,n,i,!0,!1);if(l(s))return m.clone(s.position,o)};ea.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=$ht(this,e,t[s],n,i);return gB(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};ea.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=eft(this,e,t[s],n,i,t[s]);return gB(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};ea.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var wF=ea;var qNi=T(S(),1);var RNi=T(S(),1);var ZMi=T(S(),1),FF=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13044,7 +11651,7 @@ void main() out_FragColor = vec4(color, fragmentColor.a); } -`;var q9i=T(S(),1),KF=`precision highp float; +`;var EMi=T(S(),1),AF=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; @@ -13188,7 +11795,7 @@ void main(void) ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var eMi=T(S(),1),JF=`uniform sampler2D colorTexture; +`;var XMi=T(S(),1),MF=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -13199,7 +11806,7 @@ void main(void) vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var nMi=T(S(),1),QF=`uniform sampler2D colorTexture; +`;var PMi=T(S(),1),NF=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; @@ -13218,7 +11825,7 @@ void main(void) darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var oMi=T(S(),1),jF=`uniform sampler2D colorTexture; +`;var wMi=T(S(),1),kF=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; @@ -13238,7 +11845,7 @@ void main(void) vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var sMi=T(S(),1),qF=`uniform sampler2D colorTexture; +`;var AMi=T(S(),1),UF=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; @@ -13249,7 +11856,7 @@ void main(void) vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var cMi=T(S(),1),$F=`uniform sampler2D colorTexture; +`;var NMi=T(S(),1),DF=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; @@ -13266,7 +11873,7 @@ void main(void) sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); out_FragColor = vec4(sceneColor, 1.0); } -`;var dMi=T(S(),1),eA=`uniform sampler2D colorTexture; +`;var UMi=T(S(),1),BF=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -13305,7 +11912,7 @@ void main(void) float d = computeDepthBlur(-posInCamera.z); out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); } -`;var mMi=T(S(),1),tA=`uniform sampler2D depthTexture; +`;var BMi=T(S(),1),OF=`uniform sampler2D depthTexture; in vec2 v_textureCoordinates; @@ -13314,7 +11921,7 @@ void main(void) float depth = czm_readDepth(depthTexture, v_textureCoordinates); out_FragColor = vec4(vec3(depth), 1.0); } -`;var fMi=T(S(),1),nA=`uniform sampler2D depthTexture; +`;var YMi=T(S(),1),YF=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; @@ -13374,7 +11981,7 @@ void main(void) float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } -`;var bMi=T(S(),1),iA=`uniform sampler2D colorTexture; +`;var zMi=T(S(),1),HF=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13414,7 +12021,7 @@ void main() c = czm_inverseGamma(c / w); out_FragColor = vec4(c, fragmentColor.a); } -`;var yMi=T(S(),1),oA=`uniform sampler2D colorTexture; +`;var JMi=T(S(),1),zF=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13439,7 +12046,7 @@ void main() out_FragColor = vec4(color, fragmentColor.a); } -`;var _Mi=T(S(),1),rA=`in vec2 v_textureCoordinates; +`;var jMi=T(S(),1),KF=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; @@ -13460,7 +12067,7 @@ void main() float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } -`;var SMi=T(S(),1),Xy=`#define SAMPLES 8 +`;var $Mi=T(S(),1),Xy=`#define SAMPLES 8 uniform float delta; uniform float sigma; @@ -13507,7 +12114,7 @@ void main() out_FragColor = result; } -`;var VMi=T(S(),1),sA=`uniform sampler2D colorTexture; +`;var t9i=T(S(),1),JF=`uniform sampler2D colorTexture; uniform sampler2D dirtTexture; uniform sampler2D starTexture; uniform vec2 dirtTextureDimensions; @@ -13660,7 +12267,7 @@ void main(void) out_FragColor = result; } -`;var RMi=T(S(),1),aA=`uniform sampler2D colorTexture; +`;var i9i=T(S(),1),QF=`uniform sampler2D colorTexture; uniform vec3 white; in vec2 v_textureCoordinates; @@ -13688,7 +12295,7 @@ void main() color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var GMi=T(S(),1),cA=`uniform sampler2D colorTexture; +`;var r9i=T(S(),1),jF=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13704,7 +12311,7 @@ void main(void) vec3 green = vec3(0.0, 1.0, 0.0); out_FragColor = vec4((noiseValue + rgb) * green, 1.0); } -`;var IMi=T(S(),1),lA=`uniform sampler2D colorTexture; +`;var a9i=T(S(),1),qF=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13731,7 +12338,7 @@ void main() color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var WMi=T(S(),1),dA=`uniform sampler2D colorTexture; +`;var l9i=T(S(),1),$F=`uniform sampler2D colorTexture; uniform sampler2D silhouetteTexture; in vec2 v_textureCoordinates; @@ -13742,7 +12349,682 @@ void main(void) vec4 color = texture(colorTexture, v_textureCoordinates); out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); } -`;var UMi=T(S(),1);function UT(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new D,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(UT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function Axe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function jht(e,t){Axe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new hi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function Mxe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function qht(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function $ht(e,t){let n=`uniform sampler2D colorTexture; +`;var u9i=T(S(),1);/** + * @license + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */var eA=`/** + * @license + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples +// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h + +// Steps used to integrate into Cesium: +// * The following defines are set: +// #define FXAA_PC 1 +// #define FXAA_WEBGL_1 1 +// #define FXAA_GREEN_AS_LUMA 1 +// #define FXAA_EARLY_EXIT 1 +// #define FXAA_GLSL_120 1 +// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. +// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace +// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. +// * There are no implicit conversions from ivec* to vec* so replace: +// #define FxaaInt2 ivec2 +// with +// #define FxaaInt2 vec2 +// * The texture2DLod function is only available in vertex shaders so replace: +// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) +// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) +// with +// #define FxaaTexTop(t, p) texture(t, p) +// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) +// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. +// * The following parameters to FxaaPixelShader are unused and can be removed: +// fxaaConsolePosPos +// fxaaConsoleRcpFrameOpt +// fxaaConsoleRcpFrameOpt2 +// fxaaConsole360RcpFrameOpt2 +// fxaaConsoleEdgeSharpness +// fxaaConsoleEdgeThreshold +// fxaaConsoleEdgeThresholdMi +// fxaaConsole360ConstDir + +// +// Choose the quality preset. +// This needs to be compiled into the shader as it effects code. +// Best option to include multiple presets is to +// in each shader define the preset, then include this file. +// +// OPTIONS +// ----------------------------------------------------------------------- +// 10 to 15 - default medium dither (10=fastest, 15=highest quality) +// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) +// 39 - no dither, very expensive +// +// NOTES +// ----------------------------------------------------------------------- +// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) +// 13 = about same speed as FXAA 3.9 and better than 12 +// 23 = closest to FXAA 3.9 visually and performance wise +// _ = the lowest digit is directly related to performance +// _ = the highest digit is directly related to style +// +//#define FXAA_QUALITY_PRESET 12 + + +#if (FXAA_QUALITY_PRESET == 10) + #define FXAA_QUALITY_PS 3 + #define FXAA_QUALITY_P0 1.5 + #define FXAA_QUALITY_P1 3.0 + #define FXAA_QUALITY_P2 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 11) + #define FXAA_QUALITY_PS 4 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 3.0 + #define FXAA_QUALITY_P3 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 12) + #define FXAA_QUALITY_PS 5 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 4.0 + #define FXAA_QUALITY_P4 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 13) + #define FXAA_QUALITY_PS 6 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 4.0 + #define FXAA_QUALITY_P5 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 14) + #define FXAA_QUALITY_PS 7 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 4.0 + #define FXAA_QUALITY_P6 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 15) + #define FXAA_QUALITY_PS 8 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 4.0 + #define FXAA_QUALITY_P7 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 20) + #define FXAA_QUALITY_PS 3 + #define FXAA_QUALITY_P0 1.5 + #define FXAA_QUALITY_P1 2.0 + #define FXAA_QUALITY_P2 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 21) + #define FXAA_QUALITY_PS 4 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 22) + #define FXAA_QUALITY_PS 5 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 23) + #define FXAA_QUALITY_PS 6 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 24) + #define FXAA_QUALITY_PS 7 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 3.0 + #define FXAA_QUALITY_P6 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 25) + #define FXAA_QUALITY_PS 8 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 4.0 + #define FXAA_QUALITY_P7 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 26) + #define FXAA_QUALITY_PS 9 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 4.0 + #define FXAA_QUALITY_P8 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 27) + #define FXAA_QUALITY_PS 10 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 4.0 + #define FXAA_QUALITY_P9 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 28) + #define FXAA_QUALITY_PS 11 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 4.0 + #define FXAA_QUALITY_P10 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 29) + #define FXAA_QUALITY_PS 12 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 2.0 + #define FXAA_QUALITY_P10 4.0 + #define FXAA_QUALITY_P11 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 39) + #define FXAA_QUALITY_PS 12 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.0 + #define FXAA_QUALITY_P2 1.0 + #define FXAA_QUALITY_P3 1.0 + #define FXAA_QUALITY_P4 1.0 + #define FXAA_QUALITY_P5 1.5 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 2.0 + #define FXAA_QUALITY_P10 4.0 + #define FXAA_QUALITY_P11 8.0 +#endif + +#define FxaaBool bool +#define FxaaFloat float +#define FxaaFloat2 vec2 +#define FxaaFloat3 vec3 +#define FxaaFloat4 vec4 +#define FxaaHalf float +#define FxaaHalf2 vec2 +#define FxaaHalf3 vec3 +#define FxaaHalf4 vec4 +#define FxaaInt2 vec2 +#define FxaaTex sampler2D + +#define FxaaSat(x) clamp(x, 0.0, 1.0) +#define FxaaTexTop(t, p) texture(t, p) +#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) + +FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } + +FxaaFloat4 FxaaPixelShader( + // + // Use noperspective interpolation here (turn off perspective interpolation). + // {xy} = center of pixel + FxaaFloat2 pos, + // + // Input color texture. + // {rgb_} = color in linear or perceptual color space + // if (FXAA_GREEN_AS_LUMA == 0) + // {___a} = luma in perceptual color space (not linear) + FxaaTex tex, + // + // Only used on FXAA Quality. + // This must be from a constant/uniform. + // {x_} = 1.0/screenWidthInPixels + // {_y} = 1.0/screenHeightInPixels + FxaaFloat2 fxaaQualityRcpFrame, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY_SUBPIX define. + // It is here now to allow easier tuning. + // Choose the amount of sub-pixel aliasing removal. + // This can effect sharpness. + // 1.00 - upper limit (softer) + // 0.75 - default amount of filtering + // 0.50 - lower limit (sharper, less sub-pixel aliasing removal) + // 0.25 - almost off + // 0.00 - completely off + FxaaFloat fxaaQualitySubpix, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define. + // It is here now to allow easier tuning. + // The minimum amount of local contrast required to apply algorithm. + // 0.333 - too little (faster) + // 0.250 - low quality + // 0.166 - default + // 0.125 - high quality + // 0.063 - overkill (slower) + FxaaFloat fxaaQualityEdgeThreshold, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define. + // It is here now to allow easier tuning. + // Trims the algorithm from processing darks. + // 0.0833 - upper limit (default, the start of visible unfiltered edges) + // 0.0625 - high quality (faster) + // 0.0312 - visible limit (slower) + // Special notes when using FXAA_GREEN_AS_LUMA, + // Likely want to set this to zero. + // As colors that are mostly not-green + // will appear very dark in the green channel! + // Tune by looking at mostly non-green content, + // then start at zero and increase until aliasing is a problem. + FxaaFloat fxaaQualityEdgeThresholdMin +) { +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posM; + posM.x = pos.x; + posM.y = pos.y; + FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); + #define lumaM rgbyM.y + FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); +/*--------------------------------------------------------------------------*/ + FxaaFloat maxSM = max(lumaS, lumaM); + FxaaFloat minSM = min(lumaS, lumaM); + FxaaFloat maxESM = max(lumaE, maxSM); + FxaaFloat minESM = min(lumaE, minSM); + FxaaFloat maxWN = max(lumaN, lumaW); + FxaaFloat minWN = min(lumaN, lumaW); + FxaaFloat rangeMax = max(maxWN, maxESM); + FxaaFloat rangeMin = min(minWN, minESM); + FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; + FxaaFloat range = rangeMax - rangeMin; + FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); + FxaaBool earlyExit = range < rangeMaxClamped; +/*--------------------------------------------------------------------------*/ + if(earlyExit) + return rgbyM; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNS = lumaN + lumaS; + FxaaFloat lumaWE = lumaW + lumaE; + FxaaFloat subpixRcpRange = 1.0/range; + FxaaFloat subpixNSWE = lumaNS + lumaWE; + FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; + FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNESE = lumaNE + lumaSE; + FxaaFloat lumaNWNE = lumaNW + lumaNE; + FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; + FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNWSW = lumaNW + lumaSW; + FxaaFloat lumaSWSE = lumaSW + lumaSE; + FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); + FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); + FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; + FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; + FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; + FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; +/*--------------------------------------------------------------------------*/ + FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; + FxaaFloat lengthSign = fxaaQualityRcpFrame.x; + FxaaBool horzSpan = edgeHorz >= edgeVert; + FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; +/*--------------------------------------------------------------------------*/ + if(!horzSpan) lumaN = lumaW; + if(!horzSpan) lumaS = lumaE; + if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; + FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; +/*--------------------------------------------------------------------------*/ + FxaaFloat gradientN = lumaN - lumaM; + FxaaFloat gradientS = lumaS - lumaM; + FxaaFloat lumaNN = lumaN + lumaM; + FxaaFloat lumaSS = lumaS + lumaM; + FxaaBool pairN = abs(gradientN) >= abs(gradientS); + FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); + if(pairN) lengthSign = -lengthSign; + FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posB; + posB.x = posM.x; + posB.y = posM.y; + FxaaFloat2 offNP; + offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; + offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; + if(!horzSpan) posB.x += lengthSign * 0.5; + if( horzSpan) posB.y += lengthSign * 0.5; +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posN; + posN.x = posB.x - offNP.x * FXAA_QUALITY_P0; + posN.y = posB.y - offNP.y * FXAA_QUALITY_P0; + FxaaFloat2 posP; + posP.x = posB.x + offNP.x * FXAA_QUALITY_P0; + posP.y = posB.y + offNP.y * FXAA_QUALITY_P0; + FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; + FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); + FxaaFloat subpixE = subpixC * subpixC; + FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); +/*--------------------------------------------------------------------------*/ + if(!pairN) lumaNN = lumaSS; + FxaaFloat gradientScaled = gradient * 1.0/4.0; + FxaaFloat lumaMM = lumaM - lumaNN * 0.5; + FxaaFloat subpixF = subpixD * subpixE; + FxaaBool lumaMLTZero = lumaMM < 0.0; +/*--------------------------------------------------------------------------*/ + lumaEndN -= lumaNN * 0.5; + lumaEndP -= lumaNN * 0.5; + FxaaBool doneN = abs(lumaEndN) >= gradientScaled; + FxaaBool doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1; + FxaaBool doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1; +/*--------------------------------------------------------------------------*/ + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 3) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 4) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 5) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 6) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 7) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 8) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 9) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 10) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 11) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 12) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } +/*--------------------------------------------------------------------------*/ + FxaaFloat dstN = posM.x - posN.x; + FxaaFloat dstP = posP.x - posM.x; + if(!horzSpan) dstN = posM.y - posN.y; + if(!horzSpan) dstP = posP.y - posM.y; +/*--------------------------------------------------------------------------*/ + FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; + FxaaFloat spanLength = (dstP + dstN); + FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; + FxaaFloat spanLengthRcp = 1.0/spanLength; +/*--------------------------------------------------------------------------*/ + FxaaBool directionN = dstN < dstP; + FxaaFloat dst = min(dstN, dstP); + FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; + FxaaFloat subpixG = subpixF * subpixF; + FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; + FxaaFloat subpixH = subpixG * fxaaQualitySubpix; +/*--------------------------------------------------------------------------*/ + FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; + FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); + if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; + if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; + return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); +} +`;var _9i=T(S(),1);function BT(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new fi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new D,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(BT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function Nxe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function tft(e,t){Nxe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new fi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function kxe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function nft(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function ift(e,t){let n=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float sampleTexture(vec2 offset) { `;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); @@ -13779,7 +13061,7 @@ void main() { color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); `),n+=` out_FragColor = vec4(color); } -`,n}function eft(e,t){Mxe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand($ht(r,i),{framebuffer:n[r].framebuffer,uniformMap:qht(e,r)});e._commands=o}UT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new $n({color:new B(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};UT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,jht(this,e),eft(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};UT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};UT.prototype.isDestroyed=function(){return!1};UT.prototype.destroy=function(){return Axe(this),Mxe(this),me(this)};var uA=UT;var dNi=T(S(),1);var BMi=T(S(),1),tft={NEAREST:0,LINEAR:1},jd=tft;function DT(e){e=y(e,y.EMPTY_OBJECT);let{name:t=Bn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=jd.NEAREST,pixelFormat:a=nt.RGBA,pixelDatatype:c=je.UNSIGNED_BYTE,clearColor:d=B.BLACK,scissorRectangle:u}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=d,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let h=new nc;h.scissorTest={enabled:!0,rectangle:l(u)?ze.clone(u):new ze},this._passState=h,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(DT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var nft=/uniform\s+sampler2D\s+depthTexture/g;DT.prototype._isSupported=function(e){return!nft.test(this._fragmentShader)||e.depthTexture};function ift(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof Wt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Wt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function oft(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function rft(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function sft(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=oft(e,r),n[r]=ift(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Wt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=rft(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=St(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function aft(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,n}function oft(e,t){kxe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(ift(r,i),{framebuffer:n[r].framebuffer,uniformMap:nft(e,r)});e._commands=o}BT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ti({color:new B(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};BT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,tft(this,e),oft(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};BT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};BT.prototype.isDestroyed=function(){return!1};BT.prototype.destroy=function(){return Nxe(this),kxe(this),me(this)};var tA=BT;var B9i=T(S(),1);var S9i=T(S(),1),rft={NEAREST:0,LINEAR:1},qd=rft;function OT(e){e=y(e,y.EMPTY_OBJECT);let{name:t=Bn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=qd.NEAREST,pixelFormat:a=nt.RGBA,pixelDatatype:c=je.UNSIGNED_BYTE,clearColor:d=B.BLACK,scissorRectangle:u}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=d,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let h=new ic;h.scissorTest={enabled:!0,rectangle:l(u)?ze.clone(u):new ze},this._passState=h,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(OT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var sft=/uniform\s+sampler2D\s+depthTexture/g;OT.prototype._isSupported=function(e){return!sft.test(this._fragmentShader)||e.depthTexture};function aft(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof Xt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Xt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function cft(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function lft(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function dft(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=cft(e,r),n[r]=aft(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Xt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=lft(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Tt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function uft(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE uniform sampler2D czm_idTexture; uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; @@ -13803,8 +13085,8 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function cft(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=aft(n,o)}let i=new De({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function lft(e){let t=e._sampleMode,n,i;t===jd.LINEAR?(n=qt.LINEAR,i=mi.LINEAR):(n=qt.NEAREST,i=mi.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new $t({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function dft(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function uft(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function mft(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:d}=i[a];e._actualUniforms[c]=new Wt({context:t,source:d})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],d=r[c],u=e._textureCache.getStageByName(d);if(l(u))e._actualUniforms[c]=uft(e,d);else if(typeof d=="string"){let h=new Ze({url:d});s.push(h.fetchImage().then(dft(e,c)))}else e._texturesToCreate.push({name:c,source:d})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function Nxe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof Wt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function hft(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function fft(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];l(a.pickIds)?i+=a.pickIds.length:l(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Wt({context:t,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:$t.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,d=c.length;for(let u=0;u<d;++u){let h=c[u].color;r[o]=B.floatToByte(h.red),r[o+1]=B.floatToByte(h.green),r[o+2]=B.floatToByte(h.blue),r[o+3]=B.floatToByte(h.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=B.floatToByte(c.red),r[o+1]=B.floatToByte(c.green),r[o+2]=B.floatToByte(c.blue),r[o+3]=B.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new Wt({context:t,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:$t.NEAREST})}DT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&Nxe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=hft(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,fft(this,e),sft(this),mft(this,e),cft(this,e),lft(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ue.fromCache({viewport:new ze(0,0,i.width,i.height)}))),this._command.renderState=o};DT.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,$t.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};DT.prototype.isDestroyed=function(){return!1};DT.prototype.destroy=function(){return Nxe(this),me(this)};var mo=DT;var bNi=T(S(),1);function BT(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Bn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(BT.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});BT.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};BT.prototype.get=function(e){return this._stages[e]};function pft(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}BT.prototype.update=function(e,t){this._selectedDirty=pft(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};BT.prototype.isDestroyed=function(){return!1};BT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var $l=BT;var Zr={};function wj(e){let o=`#define USE_STEP_SIZE -${Xy}`,r=new mo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:jd.LINEAR}),s=new mo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:jd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=c}}}),new $l({name:e,stages:[r,s],uniforms:a})}Zr.createBlurStage=function(){return wj("czm_blur")};Zr.createDepthOfFieldStage=function(){let e=wj("czm_depth_of_field_blur"),t=new mo({name:"czm_depth_of_field_composite",fragmentShader:eA,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new $l({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Zr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Zr.createEdgeDetectionStage=function(){let e=Bn();return new mo({name:`czm_edge_detection_${e}`,fragmentShader:nA,uniforms:{length:.25,color:B.clone(B.BLACK)}})};Zr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function bft(e){if(!l(e))return Zr.createEdgeDetectionStage();let t=new $l({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +${e}`}function mft(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=uft(n,o)}let i=new De({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function hft(e){let t=e._sampleMode,n,i;t===qd.LINEAR?(n=jt.LINEAR,i=hi.LINEAR):(n=jt.NEAREST,i=hi.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function fft(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function pft(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function bft(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:d}=i[a];e._actualUniforms[c]=new Xt({context:t,source:d})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],d=r[c],u=e._textureCache.getStageByName(d);if(l(u))e._actualUniforms[c]=pft(e,d);else if(typeof d=="string"){let h=new Ze({url:d});s.push(h.fetchImage().then(fft(e,c)))}else e._texturesToCreate.push({name:c,source:d})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function Uxe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof Xt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function gft(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function yft(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];l(a.pickIds)?i+=a.pickIds.length:l(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Xt({context:t,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:qt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,d=c.length;for(let u=0;u<d;++u){let h=c[u].color;r[o]=B.floatToByte(h.red),r[o+1]=B.floatToByte(h.green),r[o+2]=B.floatToByte(h.blue),r[o+3]=B.floatToByte(h.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=B.floatToByte(c.red),r[o+1]=B.floatToByte(c.green),r[o+2]=B.floatToByte(c.blue),r[o+3]=B.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new Xt({context:t,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:qt.NEAREST})}OT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&Uxe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=gft(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,yft(this,e),dft(this),bft(this,e),mft(this,e),hft(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ue.fromCache({viewport:new ze(0,0,i.width,i.height)}))),this._command.renderState=o};OT.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,qt.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};OT.prototype.isDestroyed=function(){return!1};OT.prototype.destroy=function(){return Uxe(this),me(this)};var ho=OT;var J9i=T(S(),1);function YT(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Bn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(YT.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});YT.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};YT.prototype.get=function(e){return this._stages[e]};function xft(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}YT.prototype.update=function(e,t){this._selectedDirty=xft(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};YT.prototype.isDestroyed=function(){return!1};YT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var ed=YT;var Zr={};function Fj(e){let o=`#define USE_STEP_SIZE +${Xy}`,r=new ho({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:qd.LINEAR}),s=new ho({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:qd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=c}}}),new ed({name:e,stages:[r,s],uniforms:a})}Zr.createBlurStage=function(){return Fj("czm_blur")};Zr.createDepthOfFieldStage=function(){let e=Fj("czm_depth_of_field_blur"),t=new ho({name:"czm_depth_of_field_composite",fragmentShader:BF,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new ed({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Zr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Zr.createEdgeDetectionStage=function(){let e=Bn();return new ho({name:`czm_edge_detection_${e}`,fragmentShader:YF,uniforms:{length:.25,color:B.clone(B.BLACK)}})};Zr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function _ft(e){if(!l(e))return Zr.createEdgeDetectionStage();let t=new ed({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; `,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); if (edge${a}.a > 0.0) { @@ -13819,14 +13101,14 @@ void main() { ${o} } out_FragColor = color; } -`,s=new mo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new $l({name:"czm_edge_detection_composite",stages:[t,s]})}Zr.createSilhouetteStage=function(e){let t=bft(e),n=new mo({name:"czm_silhouette_color_edges",fragmentShader:dA,uniforms:{silhouetteTexture:t.name}});return new $l({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Zr.isSilhouetteSupported=function(e){return e.context.depthTexture};Zr.createBloomStage=function(){let e=new mo({name:"czm_bloom_contrast_bias",fragmentShader:$F,uniforms:{contrast:128,brightness:-.3}}),t=wj("czm_bloom_blur"),n=new $l({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new mo({name:"czm_bloom_generate_composite",fragmentShader:jF,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new $l({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Zr.createAmbientOcclusionStage=function(){let e=new mo({name:"czm_ambient_occlusion_generate",fragmentShader:KF,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new mo({name:"czm_ambient_occlusion_composite",fragmentShader:JF,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new $l({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Zr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var gft=`#define FXAA_QUALITY_PRESET 39 -${gE} -${rA}`;Zr.createFXAAStage=function(){return new mo({name:"czm_FXAA",fragmentShader:gft,sampleMode:jd.LINEAR})};Zr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=zF,new mo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=iA,new mo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=oA,new mo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=lA,new mo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=aA,new mo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:B.WHITE,autoExposure:void 0,exposure:1}})};Zr.createAutoExposureStage=function(){return new uA};Zr.createBlackAndWhiteStage=function(){return new mo({name:"czm_black_and_white",fragmentShader:QF,uniforms:{gradations:5}})};Zr.createBrightnessStage=function(){return new mo({name:"czm_brightness",fragmentShader:qF,uniforms:{brightness:.5}})};Zr.createNightVisionStage=function(){return new mo({name:"czm_night_vision",fragmentShader:cA})};Zr.createDepthViewStage=function(){return new mo({name:"czm_depth_view",fragmentShader:tA})};Zr.createLensFlareStage=function(){return new mo({name:"czm_lens_flare",fragmentShader:sA,uniforms:{dirtTexture:rn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:rn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ne.WGS84.maximumRadius}})};var qd=Zr;var t5i=T(S(),1);function p0(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function hA(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Fj(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[hA(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let d=0;d<c;++d){let u=s[a[d]];if(typeof u=="string"){let h=e.getStageByName(u);l(h)&&(r[hA(h)]=!0)}}}return i.name}function mA(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let h=0;h<c;++h){let p=i.get(h);l(p.length)?a=mA(e,t,n,p,o):a=Fj(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=hA(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=hA(i.get(d));let h=n[u];for(let p=0;p<d;++p)h[hA(i.get(p))]=!0}return a}function yft(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=mA(e,t,n,i,void 0);a=mA(e,t,n,o,a),a=Fj(e,t,n,r,a),a=mA(e,t,n,e,a),Fj(e,t,n,s,a)}else mA(e,t,n,e,void 0);return n}function xft(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,d=o._clearColor,u,h,p=e._framebuffers,g=p.length;for(u=0;u<g;++u){if(h=p[u],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||c!==h.pixelDatatype||!B.equals(d,h.clearColor))continue;let f=h.stages,x=f.length,_=!1;for(let C=0;C<x;++C)if(n[f[C]]){_=!0;break}if(!_)break}return l(h)&&u<g?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(h),h)}function _ft(e,t){let n=yft(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=xft(e,i,n[i]))}function Aj(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function Tft(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,d=Math.ceil(n*c),u=Math.ceil(i*c),h=Math.min(d,u);a.forcePowerOfTwo&&(W.isPowerOfTwo(h)||(h=W.nextPowerOfTwo(h)),d=h,u=h),a.buffer.update(t,d,u),a.clear=new $n({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}p0.prototype.updateDependencies=function(){this._updateDependencies=!0};p0.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(Aj(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&_ft(this,e);let c=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==c||this._height!==d;!n&&!u||(this._width=c,this._height=d,this._updateDependencies=!1,Aj(this),Tft(this,e))};p0.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};p0.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};p0.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};p0.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};p0.prototype.isDestroyed=function(){return!1};p0.prototype.destroy=function(){return Aj(this),me(this)};var OT=p0;var i5i=T(S(),1),Sft={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var b0=Object.freeze(Sft);var Mj=[];function ml(){let e=qd.createFXAAStage(),t=qd.createAmbientOcclusionStage(),n=qd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=qd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=b0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new OT(this),r={},s=Mj;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let d=c.length;if(l(d))for(let u=0;u<d;++u)s.push(c.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(ml.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return Nj(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case b0.REINHARD:n=qd.createReinhardTonemappingStage(t);break;case b0.MODIFIED_REINHARD:n=qd.createModifiedReinhardTonemappingStage(t);break;case b0.FILMIC:n=qd.createFilmicTonemappingStage(t);break;case b0.PBR_NEUTRAL:n=qd.createPbrNeutralTonemappingStage(t);break;default:n=qd.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function Nj(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}ml.prototype.add=function(e){let t=this._stageNames,n=Mj;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};ml.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Mj;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};ml.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};ml.prototype.get=function(e){return Nj(this),this._stages[e]};ml.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};ml.prototype.getStageByName=function(e){return this._stageNames[e]};ml.prototype.update=function(e,t,n){Nj(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let C=0;C<r.length;++C){let V=r[C];V.ready&&V.enabled&&V._isSupported(e)&&(o[s++]=V)}o.length=s;let a=s!==i.length;if(!a){for(let C=0;C<s;++C)if(o[C]!==i[C]){a=!0;break}}let c=this._ao,d=this._bloom,u=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let g=c.enabled&&c._isSupported(e),f=d.enabled&&d._isSupported(e),x=h.enabled&&h._isSupported(e),_=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||f!==this._bloomEnabled||x!==this._tonemappingEnabled||_!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=f,this._tonemappingEnabled=x,this._fxaaEnabled=_,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let V=new Uint8Array(196608);for(let L=0;L<196608;L+=3)V[L]=Math.floor(Math.random()*255);this._randomTexture=new Wt({context:e,pixelFormat:nt.RGB,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:V,width:256,height:256},sampler:new $t({wrapS:Vn.REPEAT,wrapT:Vn.REPEAT,minificationFilter:qt.NEAREST,magnificationFilter:mi.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),d.update(e,t),h.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let C=0;C<r.length;++C)r[C].update(e,t);s=0;for(let C=0;C<r.length;++C){let V=r[C];V.ready&&V.enabled&&V._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};ml.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function YT(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}ml.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return YT(t)};function sp(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){sp(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)sp(e.get(r),t,YT(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)sp(e.get(r),t,n,i,o)}ml.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,d=this._autoExposure,u=this._tonemapping,h=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!h&&!p&&!f&&r===0)return;let _=t;h&&a.ready&&(sp(a,e,_,n,i),_=YT(a)),p&&c.ready&&(sp(c,e,_,n,i),_=YT(c)),g&&d.ready&&sp(d,e,_,n,i),f&&u.ready&&(sp(u,e,_,n,i),_=YT(u));let C=_;if(r>0){sp(o[0],e,_,n,i);for(let V=1;V<r;++V)sp(o[V],e,YT(o[V-1]),n,i);C=YT(o[r-1])}x&&s.ready&&sp(s,e,C,n,i)};ml.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(ql,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};ml.prototype.isDestroyed=function(){return!1};ml.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),me(this)};var fA=ml;var q5i=T(S(),1);var v5i=T(S(),1);var T5i=T(S(),1),Cft={SHIFT:0,CTRL:1,ALT:2},ta=Object.freeze(Cft);var C5i=T(S(),1),Vft={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Sn=Object.freeze(Vft);function Wy(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function Yj(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function HT(e){if(e.shiftKey)return ta.SHIFT;if(e.ctrlKey)return ta.CTRL;if(e.altKey)return ta.ALT}var vs={LEFT:0,MIDDLE:1,RIGHT:2};function $d(e,t,n,i){function o(r){i(e,r)}Ot.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Lft(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Ot.supportsPointerEvents()?($d(e,"pointerdown",t,Xft),$d(e,"pointerup",t,Jxe),$d(e,"pointermove",t,Wft),$d(e,"pointercancel",t,Jxe)):($d(e,"mousedown",t,Qxe),$d(e,"mouseup",n,jxe),$d(e,"mousemove",n,qxe),$d(e,"touchstart",t,Eft),$d(e,"touchend",n,Oxe),$d(e,"touchmove",n,Ift),$d(e,"touchcancel",n,Oxe)),$d(e,"dblclick",t,Zft);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",$d(e,i,t,Gft)}function Rft(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var kxe={position:new D};function Hj(e){e._lastSeenTouchEvent=_i()}function zj(e){return _i()-e._lastSeenTouchEvent>Mh.mouseEmulationIgnoreMilliseconds}function Oj(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function Qxe(e,t){if(!zj(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===vs.LEFT)i=Sn.LEFT_DOWN;else if(n===vs.MIDDLE)i=Sn.MIDDLE_DOWN;else if(n===vs.RIGHT)i=Sn.RIGHT_DOWN;else return;let o=Wy(e,t,e._primaryPosition);D.clone(o,e._primaryStartPosition),D.clone(o,e._primaryPreviousPosition);let r=HT(t),s=e.getInputAction(i,r);l(s)&&(D.clone(o,kxe.position),s(kxe),t.preventDefault())}var Uxe={position:new D},Dxe={position:new D};function kj(e,t,n,i){let o=HT(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=Wy(e,i,e._primaryPosition);if(l(r)&&(D.clone(a,Uxe.position),r(Uxe)),l(s)){let c=e._primaryStartPosition;Oj(c,a,e._clickPixelTolerance)&&(D.clone(a,Dxe.position),s(Dxe))}}}function jxe(e,t){if(!zj(e))return;let n=t.button;n!==vs.LEFT&&n!==vs.MIDDLE&&n!==vs.RIGHT||(e._buttonDown[vs.LEFT]&&(kj(e,Sn.LEFT_UP,Sn.LEFT_CLICK,t),e._buttonDown[vs.LEFT]=!1),e._buttonDown[vs.MIDDLE]&&(kj(e,Sn.MIDDLE_UP,Sn.MIDDLE_CLICK,t),e._buttonDown[vs.MIDDLE]=!1),e._buttonDown[vs.RIGHT]&&(kj(e,Sn.RIGHT_UP,Sn.RIGHT_CLICK,t),e._buttonDown[vs.RIGHT]=!1))}var Uj={startPosition:new D,endPosition:new D};function qxe(e,t){if(!zj(e))return;let n=HT(t),i=Wy(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Sn.MOUSE_MOVE,n);l(r)&&(D.clone(o,Uj.startPosition),D.clone(i,Uj.endPosition),r(Uj)),D.clone(i,o),(e._buttonDown[vs.LEFT]||e._buttonDown[vs.MIDDLE]||e._buttonDown[vs.RIGHT])&&t.preventDefault()}var Bxe={position:new D};function Zft(e,t){let n=t.button,i;if(n===vs.LEFT)i=Sn.LEFT_DOUBLE_CLICK;else return;let o=HT(t),r=e.getInputAction(i,o);l(r)&&(Wy(e,t,Bxe.position),r(Bxe))}function Gft(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=HT(t),o=e.getInputAction(Sn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function Eft(e,t){Hj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,Wy(e,r,new D));gB(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,D.clone(a.get(s)))}function Oxe(e,t){Hj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);gB(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var Yxe={position:new D},Dj={position1:new D,position2:new D},Hxe={position:new D},zxe={position:new D},Kxe={position:new D};function gB(e,t){let n=HT(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[vs.LEFT]){if(e._buttonDown[vs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Sn.LEFT_UP,n),l(r)&&(D.clone(e._primaryPosition,Hxe.position),r(Hxe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Sn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];Oj(c,d,e._clickPixelTolerance)&&(D.clone(e._primaryPosition,zxe.position),s(zxe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Sn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];D.clone(c,e._primaryPosition),D.clone(c,e._primaryStartPosition),D.clone(c,e._primaryPreviousPosition),e._buttonDown[vs.LEFT]=!0,r=e.getInputAction(Sn.LEFT_DOWN,n),l(r)&&(D.clone(c,Yxe.position),r(Yxe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Sn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];Oj(d,u,e._holdPixelTolerance)&&(D.clone(e._primaryPosition,Kxe.position),s(Kxe))}},Mh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Sn.PINCH_START,n),l(r)&&(D.clone(i.values[0],Dj.position1),D.clone(i.values[1],Dj.position2),r(Dj),t.preventDefault()))}function Ift(e,t){Hj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let d=a.get(s);l(d)&&Wy(e,r,d)}$xe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,D.clone(a.get(s),c.get(s))}var Bj={startPosition:new D,endPosition:new D},pA={distance:{startPosition:new D,endPosition:new D},angleAndHeight:{startPosition:new D,endPosition:new D}};function $xe(e,t){let n=HT(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[vs.LEFT]){let a=i.values[0];D.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Sn.MOUSE_MOVE,n),l(s)&&(D.clone(c,Bj.startPosition),D.clone(a,Bj.endPosition),s(Bj)),D.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Sn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],d=o.values[0],u=o.values[1],h=c.x-a.x,p=c.y-a.y,g=Math.sqrt(h*h+p*p)*.25,f=u.x-d.x,x=u.y-d.y,_=Math.sqrt(f*f+x*x)*.25,C=(c.y+a.y)*.125,V=(u.y+d.y)*.125,L=Math.atan2(p,h),Z=Math.atan2(x,f);D.fromElements(0,_,pA.distance.startPosition),D.fromElements(0,g,pA.distance.endPosition),D.fromElements(Z,V,pA.angleAndHeight.startPosition),D.fromElements(L,C,pA.angleAndHeight.endPosition),s(pA)}}function Xft(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Wy(e,t,new D)),gB(e,t),e._previousPositions.set(i,D.clone(n.get(i)))}else Qxe(e,t)}function Jxe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),gB(e,t),e._previousPositions.remove(i)}else jxe(e,t)}function Wft(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;Wy(e,t,o),$xe(e,t);let r=e._previousPositions;D.clone(n.get(i),r.get(i))}else qxe(e,t)}function Mh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Mh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new D,this._primaryPosition=new D,this._primaryPreviousPosition=new D,this._positions=new Zt,this._previousPositions=new Zt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),Lft(this)}Mh.prototype.setInputAction=function(e,t,n){let i=Yj(t,n);this._inputEvents[i]=e};Mh.prototype.getInputAction=function(e,t){let n=Yj(e,t);return this._inputEvents[n]};Mh.prototype.removeInputAction=function(e,t){let n=Yj(e,t);delete this._inputEvents[n]};Mh.prototype.isDestroyed=function(){return!1};Mh.prototype.destroy=function(){return Rft(this),me(this)};Mh.mouseEmulationIgnoreMilliseconds=800;Mh.touchHoldDelayMilliseconds=1500;var eu=Mh;function zT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}zT.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};zT.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof an,!(this._previousMode===oe.SCENE2D||this._previousMode===oe.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE2D,!0),n._mode=oe.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?upt(this,e):ypt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Pft=new m,vft=new m,wft=new m,Fft=new m,Aft=new m,Mft=new m,Nft=new m,kft=new he,Uft=new M,Dft=new Ri,Bft=new an,Oft={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};zT.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===oe.COLUMBUS_VIEW||this._previousMode===oe.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,oe.COLUMBUS_VIEW,!0),n.camera._setTransform(M.IDENTITY);let i=Pft,o=vft,r=wft;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,o),o),m.cross(m.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===oe.SCENE2D)m.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,m.negate(m.UNIT_Z,o),m.clone(m.UNIT_Y,r);else{m.clone(d.positionWC,i),m.clone(d.directionWC,o),m.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,Nft),h=wt.eastNorthUpToFixedFrame(u,t,Uft);M.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,kft),i),M.multiplyByPointAsVector(h,o,o),M.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=Bft,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Dft,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=Oft;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=_pt(a);bA(this,c),this._previousMode===oe.SCENE2D?xpt(this,e,a,c):(a.position2D=M.multiplyByPoint(ro.TRANSFORM_2D,i,Fft),a.direction2D=M.multiplyByPointAsVector(ro.TRANSFORM_2D,o,Aft),a.up2D=M.multiplyByPointAsVector(ro.TRANSFORM_2D,r,Mft),n._mode=oe.MORPHING,d_e(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Qj={position:new m,direction:new m,up:new m,frustum:void 0},t_e=new Ri;zT.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===oe.SCENE3D||this._previousMode===oe.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE3D,!0),n._mode=oe.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===oe.SCENE2D)tpt(this,e,t);else{let i;e>0?(i=Qj,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=n_e(this,t);let o,r=n.camera;r.frustum instanceof an?o=r.frustum.clone():(o=t_e,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=m_e(i);bA(this,s),Jj(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};zT.prototype.isDestroyed=function(){return!1};zT.prototype.destroy=function(){return yB(this),me(this)};function bA(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new eu(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Sn.LEFT_DOWN),e._morphHandler.setInputAction(n,Sn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Sn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Sn.WHEEL)}}function yB(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var Yft=new he,Hft=new m,zft=new M;function n_e(e,t){let n=e._scene,i=n.camera,o=Qj,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,Yft);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,Hft),u=wt.eastNorthUpToFixedFrame(d,t,zft);return M.multiplyByPointAsVector(u,i.direction,s),M.multiplyByPointAsVector(u,i.up,a),o}var Kft=new m,Jft=new m,Qft=new m,jft=new m,qft=new m,$ft=new m;function Jj(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(r.position,Kft),a=m.clone(r.direction,Jft),c=m.clone(r.up,Qft),d=M.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,n.position,jft),u=M.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.direction,qft),h=M.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.up,$ft);function p(f){bm(s,d,f.time,r.position),bm(a,u,f.time,r.direction),bm(c,h,f.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){u_e(e,o,0,1,t,i)}});e._currentTweens.push(g)}var ept=new an,i_e=new m,o_e=new m,r_e=new m,jj=new m,s_e=new m,a_e=new m;function tpt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=Qj,m.fromDegrees(0,0,5*n.maximumRadius,n,r.position),m.negate(r.position,r.direction),m.normalize(r.direction,r.direction),m.clone(m.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=n_e(e,n));let s;e._morphToOrthographic?(s=ept,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=t_e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=m_e(r);bA(e,a);let c;e._morphToOrthographic?c=function(){Jj(e,t,r,a)}:c=function(){l_e(e,t,r,function(){Jj(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,jj),complete:function(){i._mode=oe.MORPHING,c()}})):c()}function bm(e,t,n,i){return m.lerp(e,t,n,i)}function c_e(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof an)return;let a=s.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(c*.5)+1e7;function u(p){s.frustum.fov=W.lerp(a,c,p.time);let g=d/Math.tan(s.frustum.fov*.5);i(s,g)}let h=r.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var npt=new m,ipt=new m,opt=new m,Kj=new m,rpt=new m,spt=new m,apt=new Pr,cpt=new bn,lpt=new m,dpt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function upt(e,t){t*=.5;let n=e._scene,i=n.camera,o=m.clone(i.position,npt),r=m.clone(i.direction,ipt),s=m.clone(i.up,opt),a=m.negate(m.UNIT_Z,rpt),c=m.clone(m.UNIT_Y,spt),d=Kj;if(t>0)m.clone(m.ZERO,Kj),d.z=5*n.ellipsoid.maximumRadius;else{m.clone(o,Kj);let _=cpt;M.multiplyByPoint(ro.TRANSFORM_2D,o,_.origin),M.multiplyByPointAsVector(ro.TRANSFORM_2D,r,_.direction);let C=n.globe;if(l(C)){let V=C.pickWorldCoordinates(_,n,!0,lpt);l(V)&&(M.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,V,d),d.z+=m.distance(o,d))}}let u=apt;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let h=dpt;h.position=d,h.direction=a,h.up=c,h.frustum=u;let p=h_e(h);bA(e,p);function g(_){bm(o,d,_.time,i.position),bm(r,a,_.time,i.direction),bm(s,c,_.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(_,C){_.position.z=C}let x=n.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){c_e(e,t,h,f,p)}});e._currentTweens.push(x)}var e_e=new he,mpt={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new Pr},hpt={position:new m,direction:new m,up:new m,frustum:void 0},fpt=new m,ppt=new bn,bpt=new M,gpt=new m;function ypt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=mpt;if(t>0)m.clone(m.ZERO,r.position),r.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,e_e),i.mapProjection.project(e_e,r.position),m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);let h=ppt;m.clone(r.position2D,h.origin);let p=m.clone(o.directionWC,h.direction),g=n.scaleToGeodeticSurface(o.positionWC,gpt),f=wt.eastNorthUpToFixedFrame(g,n,bpt);M.inverseTransformation(f,f),M.multiplyByPointAsVector(f,p,p),M.multiplyByPointAsVector(ro.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let _=x.pickWorldCoordinates(h,i,!0,fpt);if(l(_)){let C=m.distance(r.position2D,_);_.x+=C,m.clone(_,r.position2D)}}}function s(h,p){h.position.x=p}M.multiplyByPoint(ro.TRANSFORM_2D,r.position,r.position2D),M.multiplyByPointAsVector(ro.TRANSFORM_2D,r.direction,r.direction2D),M.multiplyByPointAsVector(ro.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=hpt;M.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,r.position2D,c.position),m.clone(r.direction,c.direction),m.clone(r.up,c.up),c.frustum=a;let d=h_e(c);bA(e,d);function u(){c_e(e,t,r,s,d)}d_e(e,t,r,u)}function l_e(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(c*.5)+1e7,r.frustum.fov=c;function u(p){r.frustum.fov=W.lerp(c,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(h)}function xpt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(n.position,jj),a=m.clone(n.direction,s_e),c=m.clone(n.up,a_e);o._mode=oe.MORPHING;function d(){r.frustum=n.frustum.clone();let u=m.clone(r.position,i_e),h=m.clone(r.direction,o_e),p=m.clone(r.up,r_e);u.z=s.z;function g(x){bm(u,s,x.time,r.position),bm(h,a,x.time,r.direction),bm(p,c,x.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():l_e(e,0,n,d)}function d_e(e,t,n,i){let o=e._scene,r=o.camera,s=m.clone(r.position,i_e),a=m.clone(r.direction,o_e),c=m.clone(r.up,r_e),d=m.clone(n.position2D,jj),u=m.clone(n.direction2D,s_e),h=m.clone(n.up2D,a_e);function p(f){bm(s,d,f.time,r.position),bm(a,u,f.time,r.direction),bm(c,h,f.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){u_e(e,o,1,0,t,i)}});e._currentTweens.push(g)}function u_e(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Hr.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function m_e(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),yB(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE3D,r)}}function h_e(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),yB(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE2D,o)}}function _pt(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),yB(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.COLUMBUS_VIEW,r)}}var gA=zT;var zki=T(S(),1);var dki=T(S(),1);var eki=T(S(),1),Tpt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Fi=Object.freeze(Tpt);function na(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function Spt(e,t){D.clone(e.distance.startPosition,t.distance.startPosition),D.clone(e.distance.endPosition,t.distance.endPosition),D.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),D.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function f_e(e,t,n){let i=na(Fi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new D;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new D,endPosition:new D},d.angleAndHeight={startPosition:new D,endPosition:new D},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,D.lerp(u.position1,u.position2,.5,s[i])},Sn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Sn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(Spt(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(D.clone(u.distance.endPosition,d.distance.endPosition),D.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let h=d.angleAndHeight.endPosition.x,p=d.prevAngle,g=Math.PI*2;for(;h>=p+Math.PI;)h-=g;for(;h<p-Math.PI;)h+=g;d.angleAndHeight.endPosition.x=-h*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Sn.PINCH_MOVE,t)}function p_e(e,t){let n=na(Fi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new D,endPosition:new D,valid:!1}),s.startPosition=new D,D.clone(D.ZERO,s.startPosition),s.endPosition=new D,e._eventHandler.setInputAction(function(c){let d=7.5*W.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=d,D.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Sn.WHEEL,t)}function eL(e,t,n){let i=na(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new D;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new D,endPosition:new D,valid:!1});let c,d;n===Fi.LEFT_DRAG?(c=Sn.LEFT_DOWN,d=Sn.LEFT_UP):n===Fi.RIGHT_DRAG?(c=Sn.RIGHT_DOWN,d=Sn.RIGHT_UP):n===Fi.MIDDLE_DRAG&&(c=Sn.MIDDLE_DOWN,d=Sn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,D.clone(u.position,r[i])},c,t),e._eventHandler.setInputAction(function(){qj(na(n,void 0),e);for(let u of Object.values(ta)){let h=na(n,u);qj(h,e)}},d,t)}function qj(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function b_e(e,t){D.clone(e.startPosition,t.startPosition),D.clone(e.endPosition,t.endPosition)}function Cpt(e,t,n){let i=n._isDown,o=!1,r=na(e,t);for(let[c,d]of Object.entries(i))c.startsWith(e)&&d&&c!==r&&(o=!0,qj(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new D,endPosition:new D,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function g_e(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Fi)if(Fi.hasOwnProperty(s)){let a=Fi[s];if(l(a)){let c=na(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new D,endPosition:new D,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new D,endPosition:new D})}}e._eventHandler.setInputAction(function(s){for(let a in Fi)if(Fi.hasOwnProperty(a)){let c=Fi[a];if(l(c)){let d=na(c,t);Cpt(c,t,e),r[d]&&(n[d]?(b_e(i[d],o[d]),o[d].valid=!0,b_e(s,i[d]),n[d]=!1):D.clone(s.endPosition,i[d].endPosition))}}D.clone(s.endPosition,e._currentMousePosition)},Sn.MOUSE_MOVE,t)}function gm(e){this._eventHandler=new eu(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new D,p_e(this,void 0),f_e(this,void 0,e),eL(this,void 0,Fi.LEFT_DRAG),eL(this,void 0,Fi.RIGHT_DRAG),eL(this,void 0,Fi.MIDDLE_DRAG),g_e(this,void 0);for(let t in ta)if(ta.hasOwnProperty(t)){let n=ta[t];l(n)&&(p_e(this,n),f_e(this,n,e),eL(this,n,Fi.LEFT_DRAG),eL(this,n,Fi.RIGHT_DRAG),eL(this,n,Fi.MIDDLE_DRAG),g_e(this,n))}}Object.defineProperties(gm.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[na(Fi.WHEEL)]||!this._update[na(Fi.WHEEL,ta.SHIFT)]||!this._update[na(Fi.WHEEL,ta.CTRL)]||!this._update[na(Fi.WHEEL,ta.ALT)];return this._buttonsDown>0||e}}});gm.prototype.isMoving=function(e,t){let n=na(e,t);return!this._update[n]};gm.prototype.getMovement=function(e,t){let n=na(e,t);return this._movement[n]};gm.prototype.getLastMovement=function(e,t){let n=na(e,t),i=this._lastMovement[n];if(i.valid)return i};gm.prototype.isButtonDown=function(e,t){let n=na(e,t);return this._isDown[n]};gm.prototype.getStartMousePosition=function(e,t){if(e===Fi.WHEEL)return this._currentMousePosition;let n=na(e,t);return this._eventStartPosition[n]};gm.prototype.getButtonPressTime=function(e,t){let n=na(e,t);return this._pressTime[n]};gm.prototype.getButtonReleaseTime=function(e,t){let n=na(e,t);return this._releaseTime[n]};gm.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};gm.prototype.isDestroyed=function(){return!1};gm.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),me(this)};var yA=gm;var xki=T(S(),1);function xB(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(xB.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});xB.prototype.cancelTween=function(){this._tweens.remove(this)};function Nh(){this._tweens=[]}Object.defineProperties(Nh.prototype,{length:{get:function(){return this._tweens.length}}});Nh.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new xB(this);let t=e.duration/zn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/zn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,Hr.LINEAR_NONE),r=e.startObject,s=new i0e(r);s.to(Ye(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new xB(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Nh.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Nh.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Nh.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Nh.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Nh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Nh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Nh.prototype.get=function(e){return this._tweens[e]};Nh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/zn.SECONDS_PER_MILLISECOND:_i();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var KT=Nh;function _A(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=Fi.LEFT_DRAG,this.zoomEventTypes=[Fi.RIGHT_DRAG,Fi.WHEEL,Fi.PINCH],this.rotateEventTypes=Fi.LEFT_DRAG,this.tiltEventTypes=[Fi.MIDDLE_DRAG,Fi.PINCH,{eventType:Fi.LEFT_DRAG,modifier:ta.CTRL},{eventType:Fi.RIGHT_DRAG,modifier:ta.CTRL}],this.lookEventTypes={eventType:Fi.LEFT_DRAG,modifier:ta.SHIFT};let t=y(e.ellipsoid,ne.default);this.minimumPickingTerrainHeight=ne.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ne.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ne.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ne.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new yA(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new KT,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new D(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new D(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new D,this._strafeEndMousePosition=new D,this._zoomMouseStart=new D(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._panLastMousePosition=new D,this._panLastWorldPosition=new m,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,W.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function Vpt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Lpt(e){return D.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var Rpt=.4;function Zpt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new D,endPosition:new D,motion:new D,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=c&&d&&(d.getTime()-c.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(c&&d&&u<Rpt){let g=Vpt(p,i),f=e.getLastMovement(t,n);if(!l(f)||Lpt(f)||!a.inertiaEnabled||(a.motion.x=(f.endPosition.x-f.startPosition.x)*.5,a.motion.y=(f.endPosition.y-f.startPosition.y)*.5,a.startPosition=D.clone(f.startPosition,a.startPosition),a.endPosition=D.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=D.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||D.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function Gpt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var y_e=[];function hl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(y_e[0]=n,n=y_e);let a=n.length;for(let c=0;c<a;++c){let d=n[c],u=l(d.eventType)?d.eventType:d,h=d.modifier,p=s.isMoving(u,h)&&s.getMovement(u,h),g=s.getStartMousePosition(u,h);e.enableInputs&&t&&(p?(i(e,g,p),Gpt(e,r)):o<1&&Zpt(s,u,h,o,i,e,r))}}var _B=new bn,Ept=new m,Ipt=new D,Xpt=new m,Wpt=new D,Ppt=new m,vpt=new m,wpt=new m,Fpt=new m,I_e=new m,Apt=new m,Mpt=new m,Npt=new m,kpt=new m,Upt=new m,Dpt=new m,Bpt=new m,Opt=new m,Ypt=new m,Hpt=new m,JT=new m,x_e=new m,__e=new m,$j={orientation:new Va};function a8(e,t,n,i,o,r){let s=1;l(r)&&(s=W.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,d=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,h=o-d,p=i*h;p=W.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let f=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(f>0&&Math.abs(o-d)<1||f<0&&Math.abs(o-u)<1)return;o-f<d?f=o-d-1:o-f>u&&(f=o-u)}let x=e._scene,_=x.camera,C=x.mode,V=$j.orientation;if(V.heading=_.heading,V.pitch=_.pitch,V.roll=_.roll,_.frustum instanceof an){Math.abs(f)>0&&(_.zoomIn(f),_._adjustOrthographicFrustum(!0));return}let L=y(n.inertiaEnabled,D.equals(t,e._zoomMouseStart)),Z=e._zoomingOnVector,G=e._rotatingZoom,I;if(L||(e._zoomMouseStart=D.clone(t,e._zoomMouseStart),l(e._globe)&&C===oe.SCENE2D?(I=_.getPickRay(t,_B).origin,I=m.fromElements(I.y,I.z,I.x)):l(e._globe)&&(I=g0(e,t,Ept)),l(I)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,Z=e._zoomingOnVector=!1,G=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(f);return}let v=C===oe.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(G=!0),!L||G){if(C===oe.SCENE2D){let P=e._zoomWorldPosition,w=_.position;if(!m.equals(P,w)&&_.positionCartographic.height<e._maxCoord.x*2){let F=_.position.x,b=m.subtract(P,w,Xpt);m.normalize(b,b);let R=m.distance(P,w)*f/(_.getMagnitude()*.5);_.move(b,R*.5),(_.position.x<0&&F>0||_.position.x>0&&F<0)&&(I=_.getPickRay(t,_B).origin,I=m.fromElements(I.y,I.z,I.x),e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition))}}else if(C===oe.SCENE3D){let P=m.normalize(_.position,I_e);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(m.dot(_.direction,P))<.6)v=!0;else{let w=x.canvas,F=Wpt;F.x=w.clientWidth/2,F.y=w.clientHeight/2;let b=g0(e,F,Ppt);if(!l(b))v=!0;else if(_.positionCartographic.height<1e6)if(m.dot(_.direction,P)>=-.5)v=!0;else{let R=Mpt;m.clone(_.position,R);let E=e._zoomWorldPosition,X=Apt;if(X=m.normalize(E,X),m.dot(X,P)<0)return;let A=Hpt,N=Upt;m.clone(_.direction,N),m.add(R,m.multiplyByScalar(N,1e3,JT),A);let O=Dpt,U=Bpt;m.subtract(E,R,O),m.normalize(O,U);let Y=m.dot(P,U);if(Y>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-Y),H=m.magnitude(R),J=m.magnitude(E),te=H-f,z=m.magnitude(O),j=Math.asin(W.clamp(z/J*Math.sin(k),-1,1)),ee=Math.asin(W.clamp(te/J*Math.sin(k),-1,1)),fe=j-ee+k,_e=Npt;m.normalize(R,_e);let de=kpt;de=m.cross(U,_e,de),de=m.normalize(de,de),m.normalize(m.cross(_e,de,JT),N),m.multiplyByScalar(m.normalize(A,JT),m.magnitude(A)-f,A),m.normalize(R,R),m.multiplyByScalar(R,te,R);let ye=Opt;m.multiplyByScalar(m.add(m.multiplyByScalar(_e,Math.cos(fe)-1,x_e),m.multiplyByScalar(N,Math.sin(fe),__e),JT),te,ye),m.add(R,ye,R),m.normalize(A,_e),m.normalize(m.cross(_e,de,JT),N);let Te=Ypt;m.multiplyByScalar(m.add(m.multiplyByScalar(_e,Math.cos(fe)-1,x_e),m.multiplyByScalar(N,Math.sin(fe),__e),JT),m.magnitude(A),Te),m.add(A,Te,A),m.clone(R,_.position),m.normalize(m.subtract(A,R,JT),_.direction),m.clone(_.direction,_.direction),m.cross(_.direction,_.up,_.right),m.cross(_.right,_.direction,_.up),_.setView($j);return}else{let R=m.normalize(b,vpt),E=m.normalize(e._zoomWorldPosition,wpt),X=m.dot(E,R);if(X>0&&X<1){let A=W.acosClamped(X),N=m.cross(E,R,Fpt),O=Math.abs(A)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,U=f/O;_.rotate(N,A*U)}}}}e._rotatingZoom=!v}if(!L&&v||Z){let P,w=ki.worldToWindowCoordinates(x,e._zoomWorldPosition,Ipt);C!==oe.COLUMBUS_VIEW&&D.equals(t,e._zoomMouseStart)&&l(w)?P=_.getPickRay(w,_B):P=_.getPickRay(t,_B);let F=P.direction;(C===oe.COLUMBUS_VIEW||C===oe.SCENE2D)&&m.fromElements(F.y,F.z,F.x,F),_.move(F,f),e._zoomingOnVector=!0}else _.zoomIn(f);e._cameraUnderground||_.setView($j)}var zpt=new bn,Kpt=new bn,Jpt=new m;function Qpt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,zpt).origin,s=o.getPickRay(n.endPosition,Kpt).origin;r=m.fromElements(r.y,r.z,r.x,r),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(r,s,Jpt),c=m.magnitude(a);c>0&&(m.normalize(a,a),o.move(a,c))}function T_e(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;a8(e,t,n,e.zoomFactor,o.getMagnitude())}var jpt=new D,qpt=new D;function S_e(e,t,n){if(l(n.angleAndHeight)){$pt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=jpt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=D.normalize(c,c);let d=qpt;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=D.normalize(d,d);let u=W.acosClamped(c.x);c.y<0&&(u=W.TWO_PI-u);let h=W.acosClamped(d.x);d.y<0&&(h=W.TWO_PI-h);let p=h-u;o.twistRight(p)}function $pt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function ebt(e){let t=e._scene.mapMode2D===jl.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(hl(e,e.enableTranslate,e.translateEventTypes,Qpt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),hl(e,e.enableZoom,e.zoomEventTypes,T_e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&hl(e,e.enableRotate,e.tiltEventTypes,S_e,e.inertiaSpin,"_lastInertiaTiltMovement")):(hl(e,e.enableZoom,e.zoomEventTypes,T_e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&hl(e,e.enableRotate,e.translateEventTypes,S_e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var X_e=new bn,tbt=new m,nbt=new m;function g0(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,tbt)),!l(o))return m.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,X_e),d=o.pickWorldCoordinates(c,i,a,nbt),u=l(s)?m.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=l(d)?m.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<h?m.clone(s,n):m.clone(d,n)}var ibt=new he;function ZB(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let c=t.cartesianToCartographic(i.position,ibt);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var obt=new m;function W_e(e,t){let n=t.origin,i=t.direction,o=ZB(e),r=m.normalize(n,obt),s=Math.abs(m.dot(r,i));return s=Math.max(s,.5)*2,o*s}function P_e(e,t,n,i){let o=m.distance(t.origin,n),r=ZB(e),s=W.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),bn.getPoint(t,o,i)}function v_e(e,t,n,i){let o;return l(n)?(o=m.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=ZB(e))):o=ZB(e),bn.getPoint(t,o,i)}var rbt=new D;function w_e(e,t){let n=t.endPosition,i=D.subtract(t.endPosition,t.startPosition,rbt),o=e._strafeEndMousePosition;D.add(o,i,o),t.endPosition=o,c8(e,t,e._strafeStartPosition),t.endPosition=n}var C_e=new bn,sbt=new bn,e8=new m,abt=new m,cbt=new m,lbt=new m,dbt=new ln(m.UNIT_X,0),ubt=new D,mbt=new D;function hbt(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){nu(e,t,n);return}if(e._strafing){w_e(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=D.clone(n.startPosition,ubt),a=D.clone(n.endPosition,mbt),c=o.getPickRay(s,C_e),d=m.clone(m.ZERO,lbt),u=m.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=g0(e,s,e8),l(h)&&(d.x=h.x)),r||d.x>o.position.z&&l(h)){let L=h;r&&(L=v_e(e,c,h,e8)),D.clone(t,e._strafeMousePosition),D.clone(t,e._strafeEndMousePosition),m.clone(L,e._strafeStartPosition),e._strafing=!0,c8(e,n,e._strafeStartPosition);return}let p=ln.fromPointNormal(d,u,dbt);c=o.getPickRay(s,C_e);let g=jn.rayPlane(c,p,e8),f=o.getPickRay(a,sbt),x=jn.rayPlane(f,p,abt);if(!l(g)||!l(x)){e._looking=!0,nu(e,t,n),D.clone(t,e._translateMousePosition);return}let _=m.subtract(g,x,cbt),C=_.x;_.x=_.y,_.y=_.z,_.z=C;let V=m.magnitude(_);V>W.EPSILON6&&(m.normalize(_,_),o.move(_,V))}var F_e=new D,CB=new bn,VB=new m,fbt=new m,A_e=new M,pbt=new M,bbt=new m,gbt=new ln(m.UNIT_X,0),t8=new m,o8=new he,M_e=new M,ybt=new ve,xbt=new $,LB=new m;function _bt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){nu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Tbt(e,t,n)):Sbt(e,t,n)}function Tbt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=F_e;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,CB),c=m.UNIT_X,d=a.origin,u=a.direction,h,p=m.dot(c,u);if(Math.abs(p)>W.EPSILON6&&(h=-m.dot(c,d)/p),!l(h)||h<=0){e._looking=!0,nu(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(u,h,VB);m.add(d,g,g);let f=i.mapProjection,x=f.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let _=f.unproject(g,o8);x.cartographicToCartesian(_,g);let C=wt.eastNorthUpToFixedFrame(g,x,A_e),V=e._globe,L=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let Z=M.clone(o.transform,M_e);o._setTransform(C),tu(e,t,n,m.UNIT_Z),o._setTransform(Z),e._globe=V,e._ellipsoid=L;let G=L.maximumRadius;e._rotateFactor=1/G,e._rotateRateRangeAdjustment=G}function Sbt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=m.UNIT_X;if(D.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,VB);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=g0(e,t,VB)),!l(s)){a=o.getPickRay(t,CB);let b=a.origin,R=a.direction,E,X=m.dot(c,R);if(Math.abs(X)>W.EPSILON6&&(E=-m.dot(c,b)/X),!l(E)||E<=0){e._looking=!0,nu(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(R,E,VB),m.add(b,s,s)}r&&(l(a)||(a=o.getPickRay(t,CB)),P_e(e,a,s,s)),D.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let d=i.canvas,u=F_e;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,CB);let h=m.clone(m.ZERO,bbt);h.x=s.x;let p=ln.fromPointNormal(h,c,gbt),g=jn.rayPlane(a,p,fbt),f=o._projection,x=f.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,o8);x.cartographicToCartesian(_,s);let C=wt.eastNorthUpToFixedFrame(s,x,A_e),V;l(g)?(m.fromElements(g.y,g.z,g.x,g),_=f.unproject(g,o8),x.cartographicToCartesian(_,g),V=wt.eastNorthUpToFixedFrame(g,x,pbt)):V=C;let L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=m.UNIT_Z,I=M.clone(o.transform,M_e);o._setTransform(C);let v=m.cross(m.UNIT_Z,m.normalize(o.position,t8),t8),P=m.dot(o.right,v);if(tu(e,t,n,G,!1,!0),o._setTransform(V),P<0){let b=n.startPosition.y-n.endPosition.y;(r&&b<0||!r&&b>0)&&(G=void 0);let R=o.constrainedAxis;o.constrainedAxis=void 0,tu(e,t,n,G,!0,!1),o.constrainedAxis=R}else tu(e,t,n,G,!0,!1);if(l(o.constrainedAxis)){let b=m.cross(o.direction,o.constrainedAxis,LB);m.equalsEpsilon(b,m.ZERO,W.EPSILON6)||(m.dot(b,o.right)<0&&m.negate(b,b),m.cross(b,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(I),e._globe=L,e._ellipsoid=Z;let w=Z.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w;let F=m.clone(o.positionWC,t8);if(e.enableCollisionDetection&&u8(e,!0),!m.equals(o.positionWC,F)){o._setTransform(V),o.worldToCameraCoordinatesPoint(F,F);let b=m.magnitudeSquared(F);m.magnitudeSquared(o.position)>b&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(b),o.position));let R=m.angleBetween(F,o.position),E=m.cross(F,o.position,F);m.normalize(E,E);let X=ve.fromAxisAngle(E,R,ybt),A=$.fromQuaternion(X,xbt);$.multiplyByVector(A,o.direction,o.direction),$.multiplyByVector(A,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(I)}}var N_e=new D,k_e=new bn,U_e=new m;function Cbt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=N_e,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,k_e),d=c.origin,u=c.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=g0(e,a,U_e));let g;if(l(p)&&(g=m.distance(d,p)),s){let f=W_e(e,c,h);l(g)?g=Math.min(g,f):g=f}if(!l(g)){let f=m.UNIT_X;g=-m.dot(f,d)/m.dot(f,u)}a8(e,t,n,e.zoomFactor,g)}function Vbt(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))hl(e,e.enableRotate,e.rotateEventTypes,tu,e.inertiaSpin,"_lastInertiaSpinMovement"),hl(e,e.enableZoom,e.zoomEventTypes,B_e,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),hl(e,e.enableTilt,e.tiltEventTypes,_bt,e.inertiaSpin,"_lastInertiaTiltMovement"),hl(e,e.enableTranslate,e.translateEventTypes,hbt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),hl(e,e.enableZoom,e.zoomEventTypes,Cbt,e.inertiaZoom,"_lastInertiaZoomMovement"),hl(e,e.enableLook,e.lookEventTypes,nu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var Lbt=new bn,Rbt=new ln(m.UNIT_X,0),Zbt=new m,Gbt=new m;function c8(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Lbt),s=m.clone(o.direction,Gbt);i.mode===oe.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=ln.fromPointNormal(n,s,Rbt),c=jn.rayPlane(r,a,Zbt);l(c)&&(s=m.subtract(n,c,s),i.mode===oe.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(o.position,s,o.position))}var V_e=new m,D_e=new he,r8=new m,s8=new ne,Ebt=new m,Ibt=new m,Xbt=new m;function Wbt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(o.transform,M.IDENTITY)){tu(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,Ebt);if(D.equals(t,e._rotateMousePosition)){if(e._looking)nu(e,t,n,d);else if(e._rotating)tu(e,t,n);else if(e._strafing)w_e(e,n);else{if(m.magnitude(o.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=r8,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,s8),i8(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,D_e).height,h=e._globe;if(l(h)&&u<e._minimumPickingTerrainHeight){let p=g0(e,n.startPosition,Xbt);if(l(p)){let g=!1,f=o.getPickRay(n.startPosition,X_e);if(r)g=!0,v_e(e,f,p,p);else{let x=s.geodeticSurfaceNormal(p,Ibt);Math.abs(m.dot(f.direction,x))<.05?g=!0:g=m.magnitude(o.position)<m.magnitude(p)}g?(D.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,c8(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=r8,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,s8),i8(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,nu(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,V_e))?(i8(e,t,n,e._ellipsoid),m.clone(V_e,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,tu(e,t,n)):(e._looking=!0,nu(e,t,n,d));D.clone(t,e._rotateMousePosition)}function tu(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,d=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let u=m.magnitude(a.position),h=e._rotateFactor*(u-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let f=h*p*Math.PI*2,x=h*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let _=e.maximumTiltAngle,C=m.dot(a.direction,i),V=Math.PI-Math.acos(C)+x;V>_&&(x-=V-_)}o||a.rotateRight(f),r||a.rotateUp(x),a.constrainedAxis=d}var n8=se.clone(se.UNIT_W),L_e=se.clone(se.UNIT_W),TB=new m,tL=new m,SB=new m,R_e=new m,Pbt=new D,vbt=new D,wbt=new D,Fbt=new D,Abt=new bn;function i8(e,t,n,i){let o=e._scene,r=o.camera,s=D.clone(n.startPosition,Pbt),a=D.clone(n.endPosition,vbt),c=i.cartesianToCartographic(r.positionWC,D_e).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=m.clone(e._panLastWorldPosition,n8),!l(e._globe)&&!D.equalsEpsilon(s,e._panLastMousePosition)&&(d=g0(e,s,n8)),!l(e._globe)&&l(d))){let h=m.subtract(d,r.positionWC,tL),p=m.multiplyByScalar(r.directionWC,m.dot(r.directionWC,h),tL),g=m.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,Fbt),x=D.subtract(a,s,wbt),_=m.multiplyByScalar(r.rightWC,x.x*f.x,tL),C=m.normalize(r.positionWC,I_e),V=r.getPickRay(a,Abt).direction,L=m.subtract(V,m.projectVector(V,r.rightWC,SB),SB),Z=m.angleBetween(L,r.directionWC),G=1;l(r.frustum.fov)&&(G=Math.max(Math.tan(Z),.1));let I=Math.abs(m.dot(r.directionWC,C)),v=-x.y*f.y*2/Math.sqrt(G)*(1-I),P=m.multiplyByScalar(V,v,SB);I=Math.abs(m.dot(r.upWC,C));let w=m.multiplyByScalar(r.upWC,-x.y*(1-I)*f.y,R_e);u=m.add(d,_,L_e),u=m.add(u,P,u),u=m.add(u,w,u),m.clone(u,e._panLastWorldPosition),D.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,n8),u=r.pickEllipsoid(a,i,L_e)),!l(d)||!l(u)){e._rotating=!0,tu(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),l(r.constrainedAxis)){let h=r.constrainedAxis,p=m.mostOrthogonalAxis(h,TB);m.cross(p,h,p),m.normalize(p,p);let g=m.cross(h,p,tL),f=m.magnitude(d),x=m.dot(h,d),_=Math.acos(x/f),C=m.multiplyByScalar(h,x,SB);m.subtract(d,C,C),m.normalize(C,C);let V=m.magnitude(u),L=m.dot(h,u),Z=Math.acos(L/V),G=m.multiplyByScalar(h,L,R_e);m.subtract(u,G,G),m.normalize(G,G);let I=Math.acos(m.dot(C,p));m.dot(C,g)<0&&(I=W.TWO_PI-I);let v=Math.acos(m.dot(G,p));m.dot(G,g)<0&&(v=W.TWO_PI-v);let P=I-v,w;m.equalsEpsilon(h,r.position,W.EPSILON2)?w=r.right:w=m.cross(h,r.position,TB);let F=m.cross(h,w,TB),b=m.dot(F,m.subtract(d,h,tL)),R=m.dot(F,m.subtract(u,h,tL)),E;b>0&&R>0?E=Z-_:b>0&&R<=0?m.dot(r.position,h)>0?E=-_-Z:E=_+Z:E=_-Z,r.rotateRight(P),r.rotateUp(E)}else{m.normalize(d,d),m.normalize(u,u);let h=m.dot(d,u),p=m.cross(d,u,TB);if(h<1&&!m.equalsEpsilon(p,m.ZERO,W.EPSILON14)){let g=Math.acos(h);r.rotate(p,g)}}}var Mbt=new m,Nbt=new he,Z_e=0;function B_e(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,d;c?d=t:(d=N_e,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,k_e),h,p=o.cartesianToCartographic(s.position,Nbt).height,g=Math.abs(Z_e)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(h=g0(e,d,U_e));let x;if(l(h)&&(x=m.distance(u.origin,h),Z_e=x),c){let C=W_e(e,u,p);l(x)?x=Math.min(x,C):x=C}l(x)||(x=p);let _=m.normalize(s.position,Mbt);a8(e,t,n,e.zoomFactor,x,m.dot(_,s.direction))}var O_e=new D,RB=new bn,xA=new m,kbt=new m,Y_e=new M,Ubt=new M,H_e=new M,Dbt=new ve,Bbt=new $,l8=new he,d8=new m;function Obt(e,t,n){let o=e._scene.camera;if(!M.equals(o.transform,M.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,d8);nu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,l8);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Hbt(e,t,n)):zbt(e,t,n)}var Ybt=new he;function Hbt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,Ybt).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=O_e;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,RB),h,p=jn.rayEllipsoid(u,i);if(l(p))h=bn.getPoint(u,p.start,xA);else if(a>e._minimumTrackBallHeight){let V=jn.grazingAltitudeLocation(u,i);if(!l(V))return;let L=i.cartesianToCartographic(V,l8);L.height=0,h=i.cartographicToCartesian(L,xA)}else{e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,d8);nu(e,t,n,V),D.clone(t,e._tiltCenterMousePosition);return}let g=wt.eastNorthUpToFixedFrame(h,i,Y_e),f=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=M.clone(r.transform,H_e);r._setTransform(g),tu(e,t,n,m.UNIT_Z),r._setTransform(_),e._globe=f,e._ellipsoid=x;let C=x.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function zbt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(D.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,xA);else{if(a=g0(e,t,xA),!l(a)){if(c=r.getPickRay(t,RB),d=jn.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,l8).height<=e._minimumTrackBallHeight){e._looking=!0;let R=e._ellipsoid.geodeticSurfaceNormal(r.position,d8);nu(e,t,n,R),D.clone(t,e._tiltCenterMousePosition)}return}a=bn.getPoint(c,d.start,xA)}s&&(l(c)||(c=r.getPickRay(t,RB)),P_e(e,c,a,a)),D.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let u=o.canvas,h=O_e;h.x=u.clientWidth/2,h.y=e._tiltCenterMousePosition.y,c=r.getPickRay(h,RB);let p=m.magnitude(a),g=m.fromElements(p,p,p,r8),f=ne.fromCartesian3(g,s8);if(d=jn.rayEllipsoid(c,f),!l(d))return;let x=m.magnitude(c.origin)>p?d.start:d.stop,_=bn.getPoint(c,x,kbt),C=wt.eastNorthUpToFixedFrame(a,i,Y_e),V=wt.eastNorthUpToFixedFrame(_,f,Ubt),L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=m.UNIT_Z,I=M.clone(r.transform,H_e);r._setTransform(V);let v=m.cross(_,r.positionWC,LB);if(m.dot(r.rightWC,v)<0){let b=n.startPosition.y-n.endPosition.y;(s&&b<0||!s&&b>0)&&(G=void 0);let R=r.constrainedAxis;r.constrainedAxis=void 0,tu(e,t,n,G,!0,!1),r.constrainedAxis=R}else tu(e,t,n,G,!0,!1);if(r._setTransform(C),tu(e,t,n,G,!1,!0),l(r.constrainedAxis)){let b=m.cross(r.direction,r.constrainedAxis,LB);m.equalsEpsilon(b,m.ZERO,W.EPSILON6)||(m.dot(b,r.right)<0&&m.negate(b,b),m.cross(b,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(I),e._globe=L,e._ellipsoid=Z;let w=Z.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w;let F=m.clone(r.positionWC,LB);if(e.enableCollisionDetection&&u8(e,!0),!m.equals(r.positionWC,F)){r._setTransform(V),r.worldToCameraCoordinatesPoint(F,F);let b=m.magnitudeSquared(F);m.magnitudeSquared(r.position)>b&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(b),r.position));let R=m.angleBetween(F,r.position),E=m.cross(F,r.position,F);m.normalize(E,E);let X=ve.fromAxisAngle(E,R,Dbt),A=$.fromQuaternion(X,Bbt);$.multiplyByVector(A,r.direction,r.direction),$.multiplyByVector(A,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(I)}}var Kbt=new D,Jbt=new D,G_e=new bn,E_e=new bn,Qbt=new m,jbt=new m;function nu(e,t,n,i){let r=e._scene.camera,s=Kbt;s.x=n.startPosition.x,s.y=0;let a=Jbt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,G_e),d=r.getPickRay(a,E_e),u=0,h,p;r.frustum instanceof an?(h=c.origin,p=d.origin,m.add(r.direction,h,h),m.add(r.direction,p,p),m.subtract(h,r.position,h),m.subtract(p,r.position,p),m.normalize(h,h),m.normalize(p,p)):(h=c.direction,p=d.direction);let g=m.dot(h,p);g<1&&(u=Math.acos(g)),u=n.startPosition.x>n.endPosition.x?-u:u;let f=e._horizontalRotationAxis;if(l(i)?r.look(i,-u):l(f)?r.look(f,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,G_e),d=r.getPickRay(a,E_e),u=0,r.frustum instanceof an?(h=c.origin,p=d.origin,m.add(r.direction,h,h),m.add(r.direction,p,p),m.subtract(h,r.position,h),m.subtract(p,r.position,p),m.normalize(h,h),m.normalize(p,p)):(h=c.direction,p=d.direction),g=m.dot(h,p),g<1&&(u=Math.acos(g)),u=n.startPosition.y>n.endPosition.y?-u:u,i=y(i,f),l(i)){let x=r.direction,_=m.negate(i,Qbt),C=m.equalsEpsilon(x,i,W.EPSILON2),V=m.equalsEpsilon(x,_,W.EPSILON2);if(!C&&!V){g=m.dot(x,i);let L=W.acosClamped(g);u>0&&u>L&&(u=L-W.EPSILON4),g=m.dot(x,_),L=W.acosClamped(g),u<0&&-u>L&&(u=-L+W.EPSILON4);let Z=m.cross(i,x,jbt);r.look(Z,u)}else(C&&u<0||V&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function qbt(e){hl(e,e.enableRotate,e.rotateEventTypes,Wbt,e.inertiaSpin,"_lastInertiaSpinMovement"),hl(e,e.enableZoom,e.zoomEventTypes,B_e,e.inertiaZoom,"_lastInertiaZoomMovement"),hl(e,e.enableTilt,e.tiltEventTypes,Obt,e.inertiaSpin,"_lastInertiaTiltMovement"),hl(e,e.enableLook,e.lookEventTypes,nu)}var $bt=new M,e0t=new he;function u8(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===oe.SCENE2D||i===oe.MORPHING)return;let o=n.camera,r=y(n.ellipsoid,ne.WGS84),s=n.mapProjection,a,c;M.equals(o.transform,M.IDENTITY)||(a=M.clone(o.transform,$bt),c=m.magnitude(o.position),o._setTransform(M.IDENTITY));let d=e0t;i===oe.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(l(h)){let p=h+e.minimumZoomDistance,g=h-e._lastGlobeHeight,f=g/e._lastGlobeHeight;d.height<p&&(t||Math.abs(f)<=.1)&&(d.height=p,i===oe.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(f)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=g*.1}}l(a)&&(o._setTransform(a),u&&(m.normalize(o.position,o.position),m.negate(o.position,o.direction),m.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),m.normalize(o.direction,o.direction),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up)))}_A.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===oe.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var t0t=new m,n0t=new m;_A.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;M.equals(t.transform,M.IDENTITY)?(this._globe=n,this._ellipsoid=y(e.ellipsoid,ne.default)):(this._globe=void 0,this._ellipsoid=ne.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Tr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Tr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Tr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,t0t),c=m.clone(t.directionWC,n0t);if(i===oe.SCENE2D?ebt(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,Vbt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,qbt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC);u8(this,d)}this._aggregator.reset()};_A.prototype.isDestroyed=function(){return!1};_A.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),me(this)};var TA=_A;var bUi=T(S(),1);var Jki=T(S(),1),SA=`uniform sampler2D colorTexture; +`,s=new ho({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new ed({name:"czm_edge_detection_composite",stages:[t,s]})}Zr.createSilhouetteStage=function(e){let t=_ft(e),n=new ho({name:"czm_silhouette_color_edges",fragmentShader:$F,uniforms:{silhouetteTexture:t.name}});return new ed({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Zr.isSilhouetteSupported=function(e){return e.context.depthTexture};Zr.createBloomStage=function(){let e=new ho({name:"czm_bloom_contrast_bias",fragmentShader:DF,uniforms:{contrast:128,brightness:-.3}}),t=Fj("czm_bloom_blur"),n=new ed({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new ho({name:"czm_bloom_generate_composite",fragmentShader:kF,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new ed({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Zr.createAmbientOcclusionStage=function(){let e=new ho({name:"czm_ambient_occlusion_generate",fragmentShader:AF,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new ho({name:"czm_ambient_occlusion_composite",fragmentShader:MF,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new ed({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Zr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var Tft=`#define FXAA_QUALITY_PRESET 39 +${eA} +${KF}`;Zr.createFXAAStage=function(){return new ho({name:"czm_FXAA",fragmentShader:Tft,sampleMode:qd.LINEAR})};Zr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=FF,new ho({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=HF,new ho({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=zF,new ho({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=qF,new ho({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Zr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=QF,new ho({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:B.WHITE,autoExposure:void 0,exposure:1}})};Zr.createAutoExposureStage=function(){return new tA};Zr.createBlackAndWhiteStage=function(){return new ho({name:"czm_black_and_white",fragmentShader:NF,uniforms:{gradations:5}})};Zr.createBrightnessStage=function(){return new ho({name:"czm_brightness",fragmentShader:UF,uniforms:{brightness:.5}})};Zr.createNightVisionStage=function(){return new ho({name:"czm_night_vision",fragmentShader:jF})};Zr.createDepthViewStage=function(){return new ho({name:"czm_depth_view",fragmentShader:OF})};Zr.createLensFlareStage=function(){return new ho({name:"czm_lens_flare",fragmentShader:JF,uniforms:{dirtTexture:nn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:nn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ne.WGS84.maximumRadius}})};var $d=Zr;var vNi=T(S(),1);function b0(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function iA(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Aj(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[iA(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let d=0;d<c;++d){let u=s[a[d]];if(typeof u=="string"){let h=e.getStageByName(u);l(h)&&(r[iA(h)]=!0)}}}return i.name}function nA(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let h=0;h<c;++h){let p=i.get(h);l(p.length)?a=nA(e,t,n,p,o):a=Aj(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=iA(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=iA(i.get(d));let h=n[u];for(let p=0;p<d;++p)h[iA(i.get(p))]=!0}return a}function Sft(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=nA(e,t,n,i,void 0);a=nA(e,t,n,o,a),a=Aj(e,t,n,r,a),a=nA(e,t,n,e,a),Aj(e,t,n,s,a)}else nA(e,t,n,e,void 0);return n}function Cft(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,d=o._clearColor,u,h,p=e._framebuffers,g=p.length;for(u=0;u<g;++u){if(h=p[u],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||c!==h.pixelDatatype||!B.equals(d,h.clearColor))continue;let f=h.stages,x=f.length,_=!1;for(let C=0;C<x;++C)if(n[f[C]]){_=!0;break}if(!_)break}return l(h)&&u<g?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new fi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(h),h)}function Vft(e,t){let n=Sft(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Cft(e,i,n[i]))}function Mj(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function Lft(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,d=Math.ceil(n*c),u=Math.ceil(i*c),h=Math.min(d,u);a.forcePowerOfTwo&&(W.isPowerOfTwo(h)||(h=W.nextPowerOfTwo(h)),d=h,u=h),a.buffer.update(t,d,u),a.clear=new ti({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}b0.prototype.updateDependencies=function(){this._updateDependencies=!0};b0.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(Mj(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&Vft(this,e);let c=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==c||this._height!==d;!n&&!u||(this._width=c,this._height=d,this._updateDependencies=!1,Mj(this),Lft(this,e))};b0.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};b0.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};b0.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};b0.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};b0.prototype.isDestroyed=function(){return!1};b0.prototype.destroy=function(){return Mj(this),me(this)};var HT=b0;var FNi=T(S(),1),Rft={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var g0=Object.freeze(Rft);var Nj=[];function fl(){let e=$d.createFXAAStage(),t=$d.createAmbientOcclusionStage(),n=$d.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=$d.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=g0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new HT(this),r={},s=Nj;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let d=c.length;if(l(d))for(let u=0;u<d;++u)s.push(c.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(fl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return kj(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case g0.REINHARD:n=$d.createReinhardTonemappingStage(t);break;case g0.MODIFIED_REINHARD:n=$d.createModifiedReinhardTonemappingStage(t);break;case g0.FILMIC:n=$d.createFilmicTonemappingStage(t);break;case g0.PBR_NEUTRAL:n=$d.createPbrNeutralTonemappingStage(t);break;default:n=$d.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function kj(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}fl.prototype.add=function(e){let t=this._stageNames,n=Nj;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};fl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Nj;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};fl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};fl.prototype.get=function(e){return kj(this),this._stages[e]};fl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};fl.prototype.getStageByName=function(e){return this._stageNames[e]};fl.prototype.update=function(e,t,n){kj(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let C=0;C<r.length;++C){let V=r[C];V.ready&&V.enabled&&V._isSupported(e)&&(o[s++]=V)}o.length=s;let a=s!==i.length;if(!a){for(let C=0;C<s;++C)if(o[C]!==i[C]){a=!0;break}}let c=this._ao,d=this._bloom,u=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let g=c.enabled&&c._isSupported(e),f=d.enabled&&d._isSupported(e),x=h.enabled&&h._isSupported(e),_=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||f!==this._bloomEnabled||x!==this._tonemappingEnabled||_!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=f,this._tonemappingEnabled=x,this._fxaaEnabled=_,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let V=new Uint8Array(196608);for(let L=0;L<196608;L+=3)V[L]=Math.floor(Math.random()*255);this._randomTexture=new Xt({context:e,pixelFormat:nt.RGB,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:V,width:256,height:256},sampler:new qt({wrapS:Vn.REPEAT,wrapT:Vn.REPEAT,minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),d.update(e,t),h.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let C=0;C<r.length;++C)r[C].update(e,t);s=0;for(let C=0;C<r.length;++C){let V=r[C];V.ready&&V.enabled&&V._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};fl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function zT(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}fl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return zT(t)};function ap(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){ap(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)ap(e.get(r),t,zT(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)ap(e.get(r),t,n,i,o)}fl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,d=this._autoExposure,u=this._tonemapping,h=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!h&&!p&&!f&&r===0)return;let _=t;h&&a.ready&&(ap(a,e,_,n,i),_=zT(a)),p&&c.ready&&(ap(c,e,_,n,i),_=zT(c)),g&&d.ready&&ap(d,e,_,n,i),f&&u.ready&&(ap(u,e,_,n,i),_=zT(u));let C=_;if(r>0){ap(o[0],e,_,n,i);for(let V=1;V<r;++V)ap(o[V],e,zT(o[V-1]),n,i);C=zT(o[r-1])}x&&s.ready&&ap(s,e,C,n,i)};fl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand($l,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};fl.prototype.isDestroyed=function(){return!1};fl.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),me(this)};var oA=fl;var X5i=T(S(),1);var h5i=T(S(),1);var e5i=T(S(),1),Zft={SHIFT:0,CTRL:1,ALT:2},ta=Object.freeze(Zft);var n5i=T(S(),1),Gft={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Sn=Object.freeze(Gft);function Wy(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function Hj(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function KT(e){if(e.shiftKey)return ta.SHIFT;if(e.ctrlKey)return ta.CTRL;if(e.altKey)return ta.ALT}var vs={LEFT:0,MIDDLE:1,RIGHT:2};function eu(e,t,n,i){function o(r){i(e,r)}Bt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Eft(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Bt.supportsPointerEvents()?(eu(e,"pointerdown",t,wft),eu(e,"pointerup",t,jxe),eu(e,"pointermove",t,Fft),eu(e,"pointercancel",t,jxe)):(eu(e,"mousedown",t,qxe),eu(e,"mouseup",n,$xe),eu(e,"mousemove",n,e_e),eu(e,"touchstart",t,Pft),eu(e,"touchend",n,Hxe),eu(e,"touchmove",n,vft),eu(e,"touchcancel",n,Hxe)),eu(e,"dblclick",t,Xft);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",eu(e,i,t,Wft)}function Ift(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var Dxe={position:new D};function zj(e){e._lastSeenTouchEvent=Ti()}function Kj(e){return Ti()-e._lastSeenTouchEvent>Mh.mouseEmulationIgnoreMilliseconds}function Yj(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function qxe(e,t){if(!Kj(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===vs.LEFT)i=Sn.LEFT_DOWN;else if(n===vs.MIDDLE)i=Sn.MIDDLE_DOWN;else if(n===vs.RIGHT)i=Sn.RIGHT_DOWN;else return;let o=Wy(e,t,e._primaryPosition);D.clone(o,e._primaryStartPosition),D.clone(o,e._primaryPreviousPosition);let r=KT(t),s=e.getInputAction(i,r);l(s)&&(D.clone(o,Dxe.position),s(Dxe),t.preventDefault())}var Bxe={position:new D},Oxe={position:new D};function Uj(e,t,n,i){let o=KT(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=Wy(e,i,e._primaryPosition);if(l(r)&&(D.clone(a,Bxe.position),r(Bxe)),l(s)){let c=e._primaryStartPosition;Yj(c,a,e._clickPixelTolerance)&&(D.clone(a,Oxe.position),s(Oxe))}}}function $xe(e,t){if(!Kj(e))return;let n=t.button;n!==vs.LEFT&&n!==vs.MIDDLE&&n!==vs.RIGHT||(e._buttonDown[vs.LEFT]&&(Uj(e,Sn.LEFT_UP,Sn.LEFT_CLICK,t),e._buttonDown[vs.LEFT]=!1),e._buttonDown[vs.MIDDLE]&&(Uj(e,Sn.MIDDLE_UP,Sn.MIDDLE_CLICK,t),e._buttonDown[vs.MIDDLE]=!1),e._buttonDown[vs.RIGHT]&&(Uj(e,Sn.RIGHT_UP,Sn.RIGHT_CLICK,t),e._buttonDown[vs.RIGHT]=!1))}var Dj={startPosition:new D,endPosition:new D};function e_e(e,t){if(!Kj(e))return;let n=KT(t),i=Wy(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Sn.MOUSE_MOVE,n);l(r)&&(D.clone(o,Dj.startPosition),D.clone(i,Dj.endPosition),r(Dj)),D.clone(i,o),(e._buttonDown[vs.LEFT]||e._buttonDown[vs.MIDDLE]||e._buttonDown[vs.RIGHT])&&t.preventDefault()}var Yxe={position:new D};function Xft(e,t){let n=t.button,i;if(n===vs.LEFT)i=Sn.LEFT_DOUBLE_CLICK;else return;let o=KT(t),r=e.getInputAction(i,o);l(r)&&(Wy(e,t,Yxe.position),r(Yxe))}function Wft(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=KT(t),o=e.getInputAction(Sn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function Pft(e,t){zj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,Wy(e,r,new D));yB(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,D.clone(a.get(s)))}function Hxe(e,t){zj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);yB(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var zxe={position:new D},Bj={position1:new D,position2:new D},Kxe={position:new D},Jxe={position:new D},Qxe={position:new D};function yB(e,t){let n=KT(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[vs.LEFT]){if(e._buttonDown[vs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Sn.LEFT_UP,n),l(r)&&(D.clone(e._primaryPosition,Kxe.position),r(Kxe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Sn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];Yj(c,d,e._clickPixelTolerance)&&(D.clone(e._primaryPosition,Jxe.position),s(Jxe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Sn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];D.clone(c,e._primaryPosition),D.clone(c,e._primaryStartPosition),D.clone(c,e._primaryPreviousPosition),e._buttonDown[vs.LEFT]=!0,r=e.getInputAction(Sn.LEFT_DOWN,n),l(r)&&(D.clone(c,zxe.position),r(zxe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Sn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];Yj(d,u,e._holdPixelTolerance)&&(D.clone(e._primaryPosition,Qxe.position),s(Qxe))}},Mh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Sn.PINCH_START,n),l(r)&&(D.clone(i.values[0],Bj.position1),D.clone(i.values[1],Bj.position2),r(Bj),t.preventDefault()))}function vft(e,t){zj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let d=a.get(s);l(d)&&Wy(e,r,d)}t_e(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,D.clone(a.get(s),c.get(s))}var Oj={startPosition:new D,endPosition:new D},rA={distance:{startPosition:new D,endPosition:new D},angleAndHeight:{startPosition:new D,endPosition:new D}};function t_e(e,t){let n=KT(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[vs.LEFT]){let a=i.values[0];D.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Sn.MOUSE_MOVE,n),l(s)&&(D.clone(c,Oj.startPosition),D.clone(a,Oj.endPosition),s(Oj)),D.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Sn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],d=o.values[0],u=o.values[1],h=c.x-a.x,p=c.y-a.y,g=Math.sqrt(h*h+p*p)*.25,f=u.x-d.x,x=u.y-d.y,_=Math.sqrt(f*f+x*x)*.25,C=(c.y+a.y)*.125,V=(u.y+d.y)*.125,L=Math.atan2(p,h),Z=Math.atan2(x,f);D.fromElements(0,_,rA.distance.startPosition),D.fromElements(0,g,rA.distance.endPosition),D.fromElements(Z,V,rA.angleAndHeight.startPosition),D.fromElements(L,C,rA.angleAndHeight.endPosition),s(rA)}}function wft(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Wy(e,t,new D)),yB(e,t),e._previousPositions.set(i,D.clone(n.get(i)))}else qxe(e,t)}function jxe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),yB(e,t),e._previousPositions.remove(i)}else $xe(e,t)}function Fft(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;Wy(e,t,o),t_e(e,t);let r=e._previousPositions;D.clone(n.get(i),r.get(i))}else e_e(e,t)}function Mh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Mh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new D,this._primaryPosition=new D,this._primaryPreviousPosition=new D,this._positions=new Rt,this._previousPositions=new Rt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),Eft(this)}Mh.prototype.setInputAction=function(e,t,n){let i=Hj(t,n);this._inputEvents[i]=e};Mh.prototype.getInputAction=function(e,t){let n=Hj(e,t);return this._inputEvents[n]};Mh.prototype.removeInputAction=function(e,t){let n=Hj(e,t);delete this._inputEvents[n]};Mh.prototype.isDestroyed=function(){return!1};Mh.prototype.destroy=function(){return Ift(this),me(this)};Mh.mouseEmulationIgnoreMilliseconds=800;Mh.touchHoldDelayMilliseconds=1500;var tu=Mh;function JT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}JT.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};JT.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof rn,!(this._previousMode===oe.SCENE2D||this._previousMode===oe.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE2D,!0),n._mode=oe.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?ppt(this,e):Spt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Aft=new m,Mft=new m,Nft=new m,kft=new m,Uft=new m,Dft=new m,Bft=new m,Oft=new he,Yft=new M,Hft=new Gi,zft=new rn,Kft={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};JT.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===oe.COLUMBUS_VIEW||this._previousMode===oe.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,oe.COLUMBUS_VIEW,!0),n.camera._setTransform(M.IDENTITY);let i=Aft,o=Mft,r=Nft;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,o),o),m.cross(m.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===oe.SCENE2D)m.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,m.negate(m.UNIT_Z,o),m.clone(m.UNIT_Y,r);else{m.clone(d.positionWC,i),m.clone(d.directionWC,o),m.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,Bft),h=vt.eastNorthUpToFixedFrame(u,t,Yft);M.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,Oft),i),M.multiplyByPointAsVector(h,o,o),M.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=zft,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Hft,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=Kft;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Vpt(a);sA(this,c),this._previousMode===oe.SCENE2D?Cpt(this,e,a,c):(a.position2D=M.multiplyByPoint(ro.TRANSFORM_2D,i,kft),a.direction2D=M.multiplyByPointAsVector(ro.TRANSFORM_2D,o,Uft),a.up2D=M.multiplyByPointAsVector(ro.TRANSFORM_2D,r,Dft),n._mode=oe.MORPHING,m_e(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var jj={position:new m,direction:new m,up:new m,frustum:void 0},i_e=new Gi;JT.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===oe.SCENE3D||this._previousMode===oe.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE3D,!0),n._mode=oe.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===oe.SCENE2D)rpt(this,e,t);else{let i;e>0?(i=jj,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=o_e(this,t);let o,r=n.camera;r.frustum instanceof rn?o=r.frustum.clone():(o=i_e,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=f_e(i);sA(this,s),Qj(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};JT.prototype.isDestroyed=function(){return!1};JT.prototype.destroy=function(){return xB(this),me(this)};function sA(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new tu(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Sn.LEFT_DOWN),e._morphHandler.setInputAction(n,Sn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Sn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Sn.WHEEL)}}function xB(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var Jft=new he,Qft=new m,jft=new M;function o_e(e,t){let n=e._scene,i=n.camera,o=jj,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,Jft);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,Qft),u=vt.eastNorthUpToFixedFrame(d,t,jft);return M.multiplyByPointAsVector(u,i.direction,s),M.multiplyByPointAsVector(u,i.up,a),o}var qft=new m,$ft=new m,ept=new m,tpt=new m,npt=new m,ipt=new m;function Qj(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(r.position,qft),a=m.clone(r.direction,$ft),c=m.clone(r.up,ept),d=M.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,n.position,tpt),u=M.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.direction,npt),h=M.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.up,ipt);function p(f){bm(s,d,f.time,r.position),bm(a,u,f.time,r.direction),bm(c,h,f.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){h_e(e,o,0,1,t,i)}});e._currentTweens.push(g)}var opt=new rn,r_e=new m,s_e=new m,a_e=new m,qj=new m,c_e=new m,l_e=new m;function rpt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=jj,m.fromDegrees(0,0,5*n.maximumRadius,n,r.position),m.negate(r.position,r.direction),m.normalize(r.direction,r.direction),m.clone(m.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=o_e(e,n));let s;e._morphToOrthographic?(s=opt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=i_e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=f_e(r);sA(e,a);let c;e._morphToOrthographic?c=function(){Qj(e,t,r,a)}:c=function(){u_e(e,t,r,function(){Qj(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,qj),complete:function(){i._mode=oe.MORPHING,c()}})):c()}function bm(e,t,n,i){return m.lerp(e,t,n,i)}function d_e(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof rn)return;let a=s.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(c*.5)+1e7;function u(p){s.frustum.fov=W.lerp(a,c,p.time);let g=d/Math.tan(s.frustum.fov*.5);i(s,g)}let h=r.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var spt=new m,apt=new m,cpt=new m,Jj=new m,lpt=new m,dpt=new m,upt=new Pr,mpt=new pn,hpt=new m,fpt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function ppt(e,t){t*=.5;let n=e._scene,i=n.camera,o=m.clone(i.position,spt),r=m.clone(i.direction,apt),s=m.clone(i.up,cpt),a=m.negate(m.UNIT_Z,lpt),c=m.clone(m.UNIT_Y,dpt),d=Jj;if(t>0)m.clone(m.ZERO,Jj),d.z=5*n.ellipsoid.maximumRadius;else{m.clone(o,Jj);let _=mpt;M.multiplyByPoint(ro.TRANSFORM_2D,o,_.origin),M.multiplyByPointAsVector(ro.TRANSFORM_2D,r,_.direction);let C=n.globe;if(l(C)){let V=C.pickWorldCoordinates(_,n,!0,hpt);l(V)&&(M.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,V,d),d.z+=m.distance(o,d))}}let u=upt;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let h=fpt;h.position=d,h.direction=a,h.up=c,h.frustum=u;let p=p_e(h);sA(e,p);function g(_){bm(o,d,_.time,i.position),bm(r,a,_.time,i.direction),bm(s,c,_.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(_,C){_.position.z=C}let x=n.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){d_e(e,t,h,f,p)}});e._currentTweens.push(x)}var n_e=new he,bpt={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new Pr},gpt={position:new m,direction:new m,up:new m,frustum:void 0},ypt=new m,xpt=new pn,_pt=new M,Tpt=new m;function Spt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=bpt;if(t>0)m.clone(m.ZERO,r.position),r.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,n_e),i.mapProjection.project(n_e,r.position),m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);let h=xpt;m.clone(r.position2D,h.origin);let p=m.clone(o.directionWC,h.direction),g=n.scaleToGeodeticSurface(o.positionWC,Tpt),f=vt.eastNorthUpToFixedFrame(g,n,_pt);M.inverseTransformation(f,f),M.multiplyByPointAsVector(f,p,p),M.multiplyByPointAsVector(ro.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let _=x.pickWorldCoordinates(h,i,!0,ypt);if(l(_)){let C=m.distance(r.position2D,_);_.x+=C,m.clone(_,r.position2D)}}}function s(h,p){h.position.x=p}M.multiplyByPoint(ro.TRANSFORM_2D,r.position,r.position2D),M.multiplyByPointAsVector(ro.TRANSFORM_2D,r.direction,r.direction2D),M.multiplyByPointAsVector(ro.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=gpt;M.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,r.position2D,c.position),m.clone(r.direction,c.direction),m.clone(r.up,c.up),c.frustum=a;let d=p_e(c);sA(e,d);function u(){d_e(e,t,r,s,d)}m_e(e,t,r,u)}function u_e(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(c*.5)+1e7,r.frustum.fov=c;function u(p){r.frustum.fov=W.lerp(c,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(h)}function Cpt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(n.position,qj),a=m.clone(n.direction,c_e),c=m.clone(n.up,l_e);o._mode=oe.MORPHING;function d(){r.frustum=n.frustum.clone();let u=m.clone(r.position,r_e),h=m.clone(r.direction,s_e),p=m.clone(r.up,a_e);u.z=s.z;function g(x){bm(u,s,x.time,r.position),bm(h,a,x.time,r.direction),bm(p,c,x.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():u_e(e,0,n,d)}function m_e(e,t,n,i){let o=e._scene,r=o.camera,s=m.clone(r.position,r_e),a=m.clone(r.direction,s_e),c=m.clone(r.up,a_e),d=m.clone(n.position2D,qj),u=m.clone(n.direction2D,c_e),h=m.clone(n.up2D,l_e);function p(f){bm(s,d,f.time,r.position),bm(a,u,f.time,r.direction),bm(c,h,f.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Hr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){h_e(e,o,1,0,t,i)}});e._currentTweens.push(g)}function h_e(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Hr.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function f_e(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),xB(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE3D,r)}}function p_e(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),xB(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE2D,o)}}function Vpt(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),xB(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.COLUMBUS_VIEW,r)}}var aA=JT;var Rki=T(S(),1);var B5i=T(S(),1);var P5i=T(S(),1),Lpt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Ai=Object.freeze(Lpt);function na(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function Rpt(e,t){D.clone(e.distance.startPosition,t.distance.startPosition),D.clone(e.distance.endPosition,t.distance.endPosition),D.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),D.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function b_e(e,t,n){let i=na(Ai.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new D;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new D,endPosition:new D},d.angleAndHeight={startPosition:new D,endPosition:new D},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,D.lerp(u.position1,u.position2,.5,s[i])},Sn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Sn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(Rpt(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(D.clone(u.distance.endPosition,d.distance.endPosition),D.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let h=d.angleAndHeight.endPosition.x,p=d.prevAngle,g=Math.PI*2;for(;h>=p+Math.PI;)h-=g;for(;h<p-Math.PI;)h+=g;d.angleAndHeight.endPosition.x=-h*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Sn.PINCH_MOVE,t)}function g_e(e,t){let n=na(Ai.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new D,endPosition:new D,valid:!1}),s.startPosition=new D,D.clone(D.ZERO,s.startPosition),s.endPosition=new D,e._eventHandler.setInputAction(function(c){let d=7.5*W.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=d,D.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Sn.WHEEL,t)}function nL(e,t,n){let i=na(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new D;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new D,endPosition:new D,valid:!1});let c,d;n===Ai.LEFT_DRAG?(c=Sn.LEFT_DOWN,d=Sn.LEFT_UP):n===Ai.RIGHT_DRAG?(c=Sn.RIGHT_DOWN,d=Sn.RIGHT_UP):n===Ai.MIDDLE_DRAG&&(c=Sn.MIDDLE_DOWN,d=Sn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,D.clone(u.position,r[i])},c,t),e._eventHandler.setInputAction(function(){$j(na(n,void 0),e);for(let u of Object.values(ta)){let h=na(n,u);$j(h,e)}},d,t)}function $j(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function y_e(e,t){D.clone(e.startPosition,t.startPosition),D.clone(e.endPosition,t.endPosition)}function Zpt(e,t,n){let i=n._isDown,o=!1,r=na(e,t);for(let[c,d]of Object.entries(i))c.startsWith(e)&&d&&c!==r&&(o=!0,$j(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new D,endPosition:new D,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function x_e(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Ai)if(Ai.hasOwnProperty(s)){let a=Ai[s];if(l(a)){let c=na(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new D,endPosition:new D,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new D,endPosition:new D})}}e._eventHandler.setInputAction(function(s){for(let a in Ai)if(Ai.hasOwnProperty(a)){let c=Ai[a];if(l(c)){let d=na(c,t);Zpt(c,t,e),r[d]&&(n[d]?(y_e(i[d],o[d]),o[d].valid=!0,y_e(s,i[d]),n[d]=!1):D.clone(s.endPosition,i[d].endPosition))}}D.clone(s.endPosition,e._currentMousePosition)},Sn.MOUSE_MOVE,t)}function gm(e){this._eventHandler=new tu(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new D,g_e(this,void 0),b_e(this,void 0,e),nL(this,void 0,Ai.LEFT_DRAG),nL(this,void 0,Ai.RIGHT_DRAG),nL(this,void 0,Ai.MIDDLE_DRAG),x_e(this,void 0);for(let t in ta)if(ta.hasOwnProperty(t)){let n=ta[t];l(n)&&(g_e(this,n),b_e(this,n,e),nL(this,n,Ai.LEFT_DRAG),nL(this,n,Ai.RIGHT_DRAG),nL(this,n,Ai.MIDDLE_DRAG),x_e(this,n))}}Object.defineProperties(gm.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[na(Ai.WHEEL)]||!this._update[na(Ai.WHEEL,ta.SHIFT)]||!this._update[na(Ai.WHEEL,ta.CTRL)]||!this._update[na(Ai.WHEEL,ta.ALT)];return this._buttonsDown>0||e}}});gm.prototype.isMoving=function(e,t){let n=na(e,t);return!this._update[n]};gm.prototype.getMovement=function(e,t){let n=na(e,t);return this._movement[n]};gm.prototype.getLastMovement=function(e,t){let n=na(e,t),i=this._lastMovement[n];if(i.valid)return i};gm.prototype.isButtonDown=function(e,t){let n=na(e,t);return this._isDown[n]};gm.prototype.getStartMousePosition=function(e,t){if(e===Ai.WHEEL)return this._currentMousePosition;let n=na(e,t);return this._eventStartPosition[n]};gm.prototype.getButtonPressTime=function(e,t){let n=na(e,t);return this._pressTime[n]};gm.prototype.getButtonReleaseTime=function(e,t){let n=na(e,t);return this._releaseTime[n]};gm.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};gm.prototype.isDestroyed=function(){return!1};gm.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),me(this)};var cA=gm;var q5i=T(S(),1);function _B(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(_B.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});_B.prototype.cancelTween=function(){this._tweens.remove(this)};function Nh(){this._tweens=[]}Object.defineProperties(Nh.prototype,{length:{get:function(){return this._tweens.length}}});Nh.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new _B(this);let t=e.duration/Kn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/Kn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,Hr.LINEAR_NONE),r=e.startObject,s=new r0e(r);s.to(Ye(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new _B(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Nh.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Nh.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Nh.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Nh.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Nh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Nh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Nh.prototype.get=function(e){return this._tweens[e]};Nh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Kn.SECONDS_PER_MILLISECOND:Ti();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var QT=Nh;function dA(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=Ai.LEFT_DRAG,this.zoomEventTypes=[Ai.RIGHT_DRAG,Ai.WHEEL,Ai.PINCH],this.rotateEventTypes=Ai.LEFT_DRAG,this.tiltEventTypes=[Ai.MIDDLE_DRAG,Ai.PINCH,{eventType:Ai.LEFT_DRAG,modifier:ta.CTRL},{eventType:Ai.RIGHT_DRAG,modifier:ta.CTRL}],this.lookEventTypes={eventType:Ai.LEFT_DRAG,modifier:ta.SHIFT};let t=y(e.ellipsoid,ne.default);this.minimumPickingTerrainHeight=ne.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ne.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ne.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ne.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new cA(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new QT,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new D(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new D(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new D,this._strafeEndMousePosition=new D,this._zoomMouseStart=new D(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._panLastMousePosition=new D,this._panLastWorldPosition=new m,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,W.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function Gpt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Ept(e){return D.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var Ipt=.4;function Xpt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new D,endPosition:new D,motion:new D,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=c&&d&&(d.getTime()-c.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(c&&d&&u<Ipt){let g=Gpt(p,i),f=e.getLastMovement(t,n);if(!l(f)||Ept(f)||!a.inertiaEnabled||(a.motion.x=(f.endPosition.x-f.startPosition.x)*.5,a.motion.y=(f.endPosition.y-f.startPosition.y)*.5,a.startPosition=D.clone(f.startPosition,a.startPosition),a.endPosition=D.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=D.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||D.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function Wpt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var __e=[];function pl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(__e[0]=n,n=__e);let a=n.length;for(let c=0;c<a;++c){let d=n[c],u=l(d.eventType)?d.eventType:d,h=d.modifier,p=s.isMoving(u,h)&&s.getMovement(u,h),g=s.getStartMousePosition(u,h);e.enableInputs&&t&&(p?(i(e,g,p),Wpt(e,r)):o<1&&Xpt(s,u,h,o,i,e,r))}}var TB=new pn,Ppt=new m,vpt=new D,wpt=new m,Fpt=new D,Apt=new m,Mpt=new m,Npt=new m,kpt=new m,W_e=new m,Upt=new m,Dpt=new m,Bpt=new m,Opt=new m,Ypt=new m,Hpt=new m,zpt=new m,Kpt=new m,Jpt=new m,Qpt=new m,jT=new m,T_e=new m,S_e=new m,e8={orientation:new Ra};function c8(e,t,n,i,o,r){let s=1;l(r)&&(s=W.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,d=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,h=o-d,p=i*h;p=W.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let f=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(f>0&&Math.abs(o-d)<1||f<0&&Math.abs(o-u)<1)return;o-f<d?f=o-d-1:o-f>u&&(f=o-u)}let x=e._scene,_=x.camera,C=x.mode,V=e8.orientation;if(V.heading=_.heading,V.pitch=_.pitch,V.roll=_.roll,_.frustum instanceof rn){Math.abs(f)>0&&(_.zoomIn(f),_._adjustOrthographicFrustum(!0));return}let L=y(n.inertiaEnabled,D.equals(t,e._zoomMouseStart)),Z=e._zoomingOnVector,G=e._rotatingZoom,I;if(L||(e._zoomMouseStart=D.clone(t,e._zoomMouseStart),l(e._globe)&&C===oe.SCENE2D?(I=_.getPickRay(t,TB).origin,I=m.fromElements(I.y,I.z,I.x)):l(e._globe)&&(I=y0(e,t,Ppt)),l(I)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,Z=e._zoomingOnVector=!1,G=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(f);return}let v=C===oe.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(G=!0),!L||G){if(C===oe.SCENE2D){let P=e._zoomWorldPosition,w=_.position;if(!m.equals(P,w)&&_.positionCartographic.height<e._maxCoord.x*2){let F=_.position.x,b=m.subtract(P,w,wpt);m.normalize(b,b);let R=m.distance(P,w)*f/(_.getMagnitude()*.5);_.move(b,R*.5),(_.position.x<0&&F>0||_.position.x>0&&F<0)&&(I=_.getPickRay(t,TB).origin,I=m.fromElements(I.y,I.z,I.x),e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition))}}else if(C===oe.SCENE3D){let P=m.normalize(_.position,W_e);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(m.dot(_.direction,P))<.6)v=!0;else{let w=x.canvas,F=Fpt;F.x=w.clientWidth/2,F.y=w.clientHeight/2;let b=y0(e,F,Apt);if(!l(b))v=!0;else if(_.positionCartographic.height<1e6)if(m.dot(_.direction,P)>=-.5)v=!0;else{let R=Dpt;m.clone(_.position,R);let E=e._zoomWorldPosition,X=Upt;if(X=m.normalize(E,X),m.dot(X,P)<0)return;let A=Qpt,N=Ypt;m.clone(_.direction,N),m.add(R,m.multiplyByScalar(N,1e3,jT),A);let O=Hpt,U=zpt;m.subtract(E,R,O),m.normalize(O,U);let Y=m.dot(P,U);if(Y>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-Y),H=m.magnitude(R),J=m.magnitude(E),te=H-f,z=m.magnitude(O),j=Math.asin(W.clamp(z/J*Math.sin(k),-1,1)),ee=Math.asin(W.clamp(te/J*Math.sin(k),-1,1)),fe=j-ee+k,Te=Bpt;m.normalize(R,Te);let de=Opt;de=m.cross(U,Te,de),de=m.normalize(de,de),m.normalize(m.cross(Te,de,jT),N),m.multiplyByScalar(m.normalize(A,jT),m.magnitude(A)-f,A),m.normalize(R,R),m.multiplyByScalar(R,te,R);let xe=Kpt;m.multiplyByScalar(m.add(m.multiplyByScalar(Te,Math.cos(fe)-1,T_e),m.multiplyByScalar(N,Math.sin(fe),S_e),jT),te,xe),m.add(R,xe,R),m.normalize(A,Te),m.normalize(m.cross(Te,de,jT),N);let Se=Jpt;m.multiplyByScalar(m.add(m.multiplyByScalar(Te,Math.cos(fe)-1,T_e),m.multiplyByScalar(N,Math.sin(fe),S_e),jT),m.magnitude(A),Se),m.add(A,Se,A),m.clone(R,_.position),m.normalize(m.subtract(A,R,jT),_.direction),m.clone(_.direction,_.direction),m.cross(_.direction,_.up,_.right),m.cross(_.right,_.direction,_.up),_.setView(e8);return}else{let R=m.normalize(b,Mpt),E=m.normalize(e._zoomWorldPosition,Npt),X=m.dot(E,R);if(X>0&&X<1){let A=W.acosClamped(X),N=m.cross(E,R,kpt),O=Math.abs(A)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,U=f/O;_.rotate(N,A*U)}}}}e._rotatingZoom=!v}if(!L&&v||Z){let P,w=Ui.worldToWindowCoordinates(x,e._zoomWorldPosition,vpt);C!==oe.COLUMBUS_VIEW&&D.equals(t,e._zoomMouseStart)&&l(w)?P=_.getPickRay(w,TB):P=_.getPickRay(t,TB);let F=P.direction;(C===oe.COLUMBUS_VIEW||C===oe.SCENE2D)&&m.fromElements(F.y,F.z,F.x,F),_.move(F,f),e._zoomingOnVector=!0}else _.zoomIn(f);e._cameraUnderground||_.setView(e8)}var jpt=new pn,qpt=new pn,$pt=new m;function ebt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,jpt).origin,s=o.getPickRay(n.endPosition,qpt).origin;r=m.fromElements(r.y,r.z,r.x,r),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(r,s,$pt),c=m.magnitude(a);c>0&&(m.normalize(a,a),o.move(a,c))}function C_e(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;c8(e,t,n,e.zoomFactor,o.getMagnitude())}var tbt=new D,nbt=new D;function V_e(e,t,n){if(l(n.angleAndHeight)){ibt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=tbt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=D.normalize(c,c);let d=nbt;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=D.normalize(d,d);let u=W.acosClamped(c.x);c.y<0&&(u=W.TWO_PI-u);let h=W.acosClamped(d.x);d.y<0&&(h=W.TWO_PI-h);let p=h-u;o.twistRight(p)}function ibt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function obt(e){let t=e._scene.mapMode2D===ql.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(pl(e,e.enableTranslate,e.translateEventTypes,ebt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),pl(e,e.enableZoom,e.zoomEventTypes,C_e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&pl(e,e.enableRotate,e.tiltEventTypes,V_e,e.inertiaSpin,"_lastInertiaTiltMovement")):(pl(e,e.enableZoom,e.zoomEventTypes,C_e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&pl(e,e.enableRotate,e.translateEventTypes,V_e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var P_e=new pn,rbt=new m,sbt=new m;function y0(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,rbt)),!l(o))return m.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,P_e),d=o.pickWorldCoordinates(c,i,a,sbt),u=l(s)?m.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=l(d)?m.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<h?m.clone(s,n):m.clone(d,n)}var abt=new he;function GB(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let c=t.cartesianToCartographic(i.position,abt);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var cbt=new m;function v_e(e,t){let n=t.origin,i=t.direction,o=GB(e),r=m.normalize(n,cbt),s=Math.abs(m.dot(r,i));return s=Math.max(s,.5)*2,o*s}function w_e(e,t,n,i){let o=m.distance(t.origin,n),r=GB(e),s=W.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),pn.getPoint(t,o,i)}function F_e(e,t,n,i){let o;return l(n)?(o=m.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=GB(e))):o=GB(e),pn.getPoint(t,o,i)}var lbt=new D;function A_e(e,t){let n=t.endPosition,i=D.subtract(t.endPosition,t.startPosition,lbt),o=e._strafeEndMousePosition;D.add(o,i,o),t.endPosition=o,l8(e,t,e._strafeStartPosition),t.endPosition=n}var L_e=new pn,dbt=new pn,t8=new m,ubt=new m,mbt=new m,hbt=new m,fbt=new an(m.UNIT_X,0),pbt=new D,bbt=new D;function gbt(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){iu(e,t,n);return}if(e._strafing){A_e(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=D.clone(n.startPosition,pbt),a=D.clone(n.endPosition,bbt),c=o.getPickRay(s,L_e),d=m.clone(m.ZERO,hbt),u=m.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=y0(e,s,t8),l(h)&&(d.x=h.x)),r||d.x>o.position.z&&l(h)){let L=h;r&&(L=F_e(e,c,h,t8)),D.clone(t,e._strafeMousePosition),D.clone(t,e._strafeEndMousePosition),m.clone(L,e._strafeStartPosition),e._strafing=!0,l8(e,n,e._strafeStartPosition);return}let p=an.fromPointNormal(d,u,fbt);c=o.getPickRay(s,L_e);let g=qn.rayPlane(c,p,t8),f=o.getPickRay(a,dbt),x=qn.rayPlane(f,p,ubt);if(!l(g)||!l(x)){e._looking=!0,iu(e,t,n),D.clone(t,e._translateMousePosition);return}let _=m.subtract(g,x,mbt),C=_.x;_.x=_.y,_.y=_.z,_.z=C;let V=m.magnitude(_);V>W.EPSILON6&&(m.normalize(_,_),o.move(_,V))}var M_e=new D,VB=new pn,LB=new m,ybt=new m,N_e=new M,xbt=new M,_bt=new m,Tbt=new an(m.UNIT_X,0),n8=new m,r8=new he,k_e=new M,Sbt=new ve,Cbt=new $,RB=new m;function Vbt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){iu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Lbt(e,t,n)):Rbt(e,t,n)}function Lbt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=M_e;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,VB),c=m.UNIT_X,d=a.origin,u=a.direction,h,p=m.dot(c,u);if(Math.abs(p)>W.EPSILON6&&(h=-m.dot(c,d)/p),!l(h)||h<=0){e._looking=!0,iu(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}let g=m.multiplyByScalar(u,h,LB);m.add(d,g,g);let f=i.mapProjection,x=f.ellipsoid;m.fromElements(g.y,g.z,g.x,g);let _=f.unproject(g,r8);x.cartographicToCartesian(_,g);let C=vt.eastNorthUpToFixedFrame(g,x,N_e),V=e._globe,L=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let Z=M.clone(o.transform,k_e);o._setTransform(C),nu(e,t,n,m.UNIT_Z),o._setTransform(Z),e._globe=V,e._ellipsoid=L;let G=L.maximumRadius;e._rotateFactor=1/G,e._rotateRateRangeAdjustment=G}function Rbt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=m.UNIT_X;if(D.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,LB);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=y0(e,t,LB)),!l(s)){a=o.getPickRay(t,VB);let b=a.origin,R=a.direction,E,X=m.dot(c,R);if(Math.abs(X)>W.EPSILON6&&(E=-m.dot(c,b)/X),!l(E)||E<=0){e._looking=!0,iu(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(R,E,LB),m.add(b,s,s)}r&&(l(a)||(a=o.getPickRay(t,VB)),w_e(e,a,s,s)),D.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let d=i.canvas,u=M_e;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,VB);let h=m.clone(m.ZERO,_bt);h.x=s.x;let p=an.fromPointNormal(h,c,Tbt),g=qn.rayPlane(a,p,ybt),f=o._projection,x=f.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,r8);x.cartographicToCartesian(_,s);let C=vt.eastNorthUpToFixedFrame(s,x,N_e),V;l(g)?(m.fromElements(g.y,g.z,g.x,g),_=f.unproject(g,r8),x.cartographicToCartesian(_,g),V=vt.eastNorthUpToFixedFrame(g,x,xbt)):V=C;let L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=m.UNIT_Z,I=M.clone(o.transform,k_e);o._setTransform(C);let v=m.cross(m.UNIT_Z,m.normalize(o.position,n8),n8),P=m.dot(o.right,v);if(nu(e,t,n,G,!1,!0),o._setTransform(V),P<0){let b=n.startPosition.y-n.endPosition.y;(r&&b<0||!r&&b>0)&&(G=void 0);let R=o.constrainedAxis;o.constrainedAxis=void 0,nu(e,t,n,G,!0,!1),o.constrainedAxis=R}else nu(e,t,n,G,!0,!1);if(l(o.constrainedAxis)){let b=m.cross(o.direction,o.constrainedAxis,RB);m.equalsEpsilon(b,m.ZERO,W.EPSILON6)||(m.dot(b,o.right)<0&&m.negate(b,b),m.cross(b,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(I),e._globe=L,e._ellipsoid=Z;let w=Z.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w;let F=m.clone(o.positionWC,n8);if(e.enableCollisionDetection&&m8(e,!0),!m.equals(o.positionWC,F)){o._setTransform(V),o.worldToCameraCoordinatesPoint(F,F);let b=m.magnitudeSquared(F);m.magnitudeSquared(o.position)>b&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(b),o.position));let R=m.angleBetween(F,o.position),E=m.cross(F,o.position,F);m.normalize(E,E);let X=ve.fromAxisAngle(E,R,Sbt),A=$.fromQuaternion(X,Cbt);$.multiplyByVector(A,o.direction,o.direction),$.multiplyByVector(A,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(I)}}var U_e=new D,D_e=new pn,B_e=new m;function Zbt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=U_e,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,D_e),d=c.origin,u=c.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=y0(e,a,B_e));let g;if(l(p)&&(g=m.distance(d,p)),s){let f=v_e(e,c,h);l(g)?g=Math.min(g,f):g=f}if(!l(g)){let f=m.UNIT_X;g=-m.dot(f,d)/m.dot(f,u)}c8(e,t,n,e.zoomFactor,g)}function Gbt(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))pl(e,e.enableRotate,e.rotateEventTypes,nu,e.inertiaSpin,"_lastInertiaSpinMovement"),pl(e,e.enableZoom,e.zoomEventTypes,Y_e,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),pl(e,e.enableTilt,e.tiltEventTypes,Vbt,e.inertiaSpin,"_lastInertiaTiltMovement"),pl(e,e.enableTranslate,e.translateEventTypes,gbt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),pl(e,e.enableZoom,e.zoomEventTypes,Zbt,e.inertiaZoom,"_lastInertiaZoomMovement"),pl(e,e.enableLook,e.lookEventTypes,iu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var Ebt=new pn,Ibt=new an(m.UNIT_X,0),Xbt=new m,Wbt=new m;function l8(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Ebt),s=m.clone(o.direction,Wbt);i.mode===oe.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=an.fromPointNormal(n,s,Ibt),c=qn.rayPlane(r,a,Xbt);l(c)&&(s=m.subtract(n,c,s),i.mode===oe.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(o.position,s,o.position))}var R_e=new m,O_e=new he,s8=new m,a8=new ne,Pbt=new m,vbt=new m,wbt=new m;function Fbt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(o.transform,M.IDENTITY)){nu(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,Pbt);if(D.equals(t,e._rotateMousePosition)){if(e._looking)iu(e,t,n,d);else if(e._rotating)nu(e,t,n);else if(e._strafing)A_e(e,n);else{if(m.magnitude(o.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),c=s8,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,a8),o8(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,O_e).height,h=e._globe;if(l(h)&&u<e._minimumPickingTerrainHeight){let p=y0(e,n.startPosition,wbt);if(l(p)){let g=!1,f=o.getPickRay(n.startPosition,P_e);if(r)g=!0,F_e(e,f,p,p);else{let x=s.geodeticSurfaceNormal(p,vbt);Math.abs(m.dot(f.direction,x))<.05?g=!0:g=m.magnitude(o.position)<m.magnitude(p)}g?(D.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,l8(e,n,e._strafeStartPosition)):(a=m.magnitude(p),c=s8,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,a8),o8(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,iu(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,R_e))?(o8(e,t,n,e._ellipsoid),m.clone(R_e,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,nu(e,t,n)):(e._looking=!0,iu(e,t,n,d));D.clone(t,e._rotateMousePosition)}function nu(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,d=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let u=m.magnitude(a.position),h=e._rotateFactor*(u-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let f=h*p*Math.PI*2,x=h*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let _=e.maximumTiltAngle,C=m.dot(a.direction,i),V=Math.PI-Math.acos(C)+x;V>_&&(x-=V-_)}o||a.rotateRight(f),r||a.rotateUp(x),a.constrainedAxis=d}var i8=se.clone(se.UNIT_W),Z_e=se.clone(se.UNIT_W),SB=new m,iL=new m,CB=new m,G_e=new m,Abt=new D,Mbt=new D,Nbt=new D,kbt=new D,Ubt=new pn;function o8(e,t,n,i){let o=e._scene,r=o.camera,s=D.clone(n.startPosition,Abt),a=D.clone(n.endPosition,Mbt),c=i.cartesianToCartographic(r.positionWC,O_e).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=m.clone(e._panLastWorldPosition,i8),!l(e._globe)&&!D.equalsEpsilon(s,e._panLastMousePosition)&&(d=y0(e,s,i8)),!l(e._globe)&&l(d))){let h=m.subtract(d,r.positionWC,iL),p=m.multiplyByScalar(r.directionWC,m.dot(r.directionWC,h),iL),g=m.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,kbt),x=D.subtract(a,s,Nbt),_=m.multiplyByScalar(r.rightWC,x.x*f.x,iL),C=m.normalize(r.positionWC,W_e),V=r.getPickRay(a,Ubt).direction,L=m.subtract(V,m.projectVector(V,r.rightWC,CB),CB),Z=m.angleBetween(L,r.directionWC),G=1;l(r.frustum.fov)&&(G=Math.max(Math.tan(Z),.1));let I=Math.abs(m.dot(r.directionWC,C)),v=-x.y*f.y*2/Math.sqrt(G)*(1-I),P=m.multiplyByScalar(V,v,CB);I=Math.abs(m.dot(r.upWC,C));let w=m.multiplyByScalar(r.upWC,-x.y*(1-I)*f.y,G_e);u=m.add(d,_,Z_e),u=m.add(u,P,u),u=m.add(u,w,u),m.clone(u,e._panLastWorldPosition),D.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,i8),u=r.pickEllipsoid(a,i,Z_e)),!l(d)||!l(u)){e._rotating=!0,nu(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),l(r.constrainedAxis)){let h=r.constrainedAxis,p=m.mostOrthogonalAxis(h,SB);m.cross(p,h,p),m.normalize(p,p);let g=m.cross(h,p,iL),f=m.magnitude(d),x=m.dot(h,d),_=Math.acos(x/f),C=m.multiplyByScalar(h,x,CB);m.subtract(d,C,C),m.normalize(C,C);let V=m.magnitude(u),L=m.dot(h,u),Z=Math.acos(L/V),G=m.multiplyByScalar(h,L,G_e);m.subtract(u,G,G),m.normalize(G,G);let I=Math.acos(m.dot(C,p));m.dot(C,g)<0&&(I=W.TWO_PI-I);let v=Math.acos(m.dot(G,p));m.dot(G,g)<0&&(v=W.TWO_PI-v);let P=I-v,w;m.equalsEpsilon(h,r.position,W.EPSILON2)?w=r.right:w=m.cross(h,r.position,SB);let F=m.cross(h,w,SB),b=m.dot(F,m.subtract(d,h,iL)),R=m.dot(F,m.subtract(u,h,iL)),E;b>0&&R>0?E=Z-_:b>0&&R<=0?m.dot(r.position,h)>0?E=-_-Z:E=_+Z:E=_-Z,r.rotateRight(P),r.rotateUp(E)}else{m.normalize(d,d),m.normalize(u,u);let h=m.dot(d,u),p=m.cross(d,u,SB);if(h<1&&!m.equalsEpsilon(p,m.ZERO,W.EPSILON14)){let g=Math.acos(h);r.rotate(p,g)}}}var Dbt=new m,Bbt=new he,E_e=0;function Y_e(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,d;c?d=t:(d=U_e,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,D_e),h,p=o.cartesianToCartographic(s.position,Bbt).height,g=Math.abs(E_e)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(h=y0(e,d,B_e));let x;if(l(h)&&(x=m.distance(u.origin,h),E_e=x),c){let C=v_e(e,u,p);l(x)?x=Math.min(x,C):x=C}l(x)||(x=p);let _=m.normalize(s.position,Dbt);c8(e,t,n,e.zoomFactor,x,m.dot(_,s.direction))}var H_e=new D,ZB=new pn,lA=new m,Obt=new m,z_e=new M,Ybt=new M,K_e=new M,Hbt=new ve,zbt=new $,d8=new he,u8=new m;function Kbt(e,t,n){let o=e._scene.camera;if(!M.equals(o.transform,M.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,u8);iu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,d8);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Qbt(e,t,n)):jbt(e,t,n)}var Jbt=new he;function Qbt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,Jbt).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=H_e;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,ZB),h,p=qn.rayEllipsoid(u,i);if(l(p))h=pn.getPoint(u,p.start,lA);else if(a>e._minimumTrackBallHeight){let V=qn.grazingAltitudeLocation(u,i);if(!l(V))return;let L=i.cartesianToCartographic(V,d8);L.height=0,h=i.cartographicToCartesian(L,lA)}else{e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,u8);iu(e,t,n,V),D.clone(t,e._tiltCenterMousePosition);return}let g=vt.eastNorthUpToFixedFrame(h,i,z_e),f=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=M.clone(r.transform,K_e);r._setTransform(g),nu(e,t,n,m.UNIT_Z),r._setTransform(_),e._globe=f,e._ellipsoid=x;let C=x.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function jbt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(D.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,lA);else{if(a=y0(e,t,lA),!l(a)){if(c=r.getPickRay(t,ZB),d=qn.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,d8).height<=e._minimumTrackBallHeight){e._looking=!0;let R=e._ellipsoid.geodeticSurfaceNormal(r.position,u8);iu(e,t,n,R),D.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,d.start,lA)}s&&(l(c)||(c=r.getPickRay(t,ZB)),w_e(e,c,a,a)),D.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let u=o.canvas,h=H_e;h.x=u.clientWidth/2,h.y=e._tiltCenterMousePosition.y,c=r.getPickRay(h,ZB);let p=m.magnitude(a),g=m.fromElements(p,p,p,s8),f=ne.fromCartesian3(g,a8);if(d=qn.rayEllipsoid(c,f),!l(d))return;let x=m.magnitude(c.origin)>p?d.start:d.stop,_=pn.getPoint(c,x,Obt),C=vt.eastNorthUpToFixedFrame(a,i,z_e),V=vt.eastNorthUpToFixedFrame(_,f,Ybt),L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=m.UNIT_Z,I=M.clone(r.transform,K_e);r._setTransform(V);let v=m.cross(_,r.positionWC,RB);if(m.dot(r.rightWC,v)<0){let b=n.startPosition.y-n.endPosition.y;(s&&b<0||!s&&b>0)&&(G=void 0);let R=r.constrainedAxis;r.constrainedAxis=void 0,nu(e,t,n,G,!0,!1),r.constrainedAxis=R}else nu(e,t,n,G,!0,!1);if(r._setTransform(C),nu(e,t,n,G,!1,!0),l(r.constrainedAxis)){let b=m.cross(r.direction,r.constrainedAxis,RB);m.equalsEpsilon(b,m.ZERO,W.EPSILON6)||(m.dot(b,r.right)<0&&m.negate(b,b),m.cross(b,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(I),e._globe=L,e._ellipsoid=Z;let w=Z.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w;let F=m.clone(r.positionWC,RB);if(e.enableCollisionDetection&&m8(e,!0),!m.equals(r.positionWC,F)){r._setTransform(V),r.worldToCameraCoordinatesPoint(F,F);let b=m.magnitudeSquared(F);m.magnitudeSquared(r.position)>b&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(b),r.position));let R=m.angleBetween(F,r.position),E=m.cross(F,r.position,F);m.normalize(E,E);let X=ve.fromAxisAngle(E,R,Hbt),A=$.fromQuaternion(X,zbt);$.multiplyByVector(A,r.direction,r.direction),$.multiplyByVector(A,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(I)}}var qbt=new D,$bt=new D,I_e=new pn,X_e=new pn,e0t=new m,t0t=new m;function iu(e,t,n,i){let r=e._scene.camera,s=qbt;s.x=n.startPosition.x,s.y=0;let a=$bt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,I_e),d=r.getPickRay(a,X_e),u=0,h,p;r.frustum instanceof rn?(h=c.origin,p=d.origin,m.add(r.direction,h,h),m.add(r.direction,p,p),m.subtract(h,r.position,h),m.subtract(p,r.position,p),m.normalize(h,h),m.normalize(p,p)):(h=c.direction,p=d.direction);let g=m.dot(h,p);g<1&&(u=Math.acos(g)),u=n.startPosition.x>n.endPosition.x?-u:u;let f=e._horizontalRotationAxis;if(l(i)?r.look(i,-u):l(f)?r.look(f,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,I_e),d=r.getPickRay(a,X_e),u=0,r.frustum instanceof rn?(h=c.origin,p=d.origin,m.add(r.direction,h,h),m.add(r.direction,p,p),m.subtract(h,r.position,h),m.subtract(p,r.position,p),m.normalize(h,h),m.normalize(p,p)):(h=c.direction,p=d.direction),g=m.dot(h,p),g<1&&(u=Math.acos(g)),u=n.startPosition.y>n.endPosition.y?-u:u,i=y(i,f),l(i)){let x=r.direction,_=m.negate(i,e0t),C=m.equalsEpsilon(x,i,W.EPSILON2),V=m.equalsEpsilon(x,_,W.EPSILON2);if(!C&&!V){g=m.dot(x,i);let L=W.acosClamped(g);u>0&&u>L&&(u=L-W.EPSILON4),g=m.dot(x,_),L=W.acosClamped(g),u<0&&-u>L&&(u=-L+W.EPSILON4);let Z=m.cross(i,x,t0t);r.look(Z,u)}else(C&&u<0||V&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function n0t(e){pl(e,e.enableRotate,e.rotateEventTypes,Fbt,e.inertiaSpin,"_lastInertiaSpinMovement"),pl(e,e.enableZoom,e.zoomEventTypes,Y_e,e.inertiaZoom,"_lastInertiaZoomMovement"),pl(e,e.enableTilt,e.tiltEventTypes,Kbt,e.inertiaSpin,"_lastInertiaTiltMovement"),pl(e,e.enableLook,e.lookEventTypes,iu)}var i0t=new M,o0t=new he;function m8(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===oe.SCENE2D||i===oe.MORPHING)return;let o=n.camera,r=y(n.ellipsoid,ne.WGS84),s=n.mapProjection,a,c;M.equals(o.transform,M.IDENTITY)||(a=M.clone(o.transform,i0t),c=m.magnitude(o.position),o._setTransform(M.IDENTITY));let d=o0t;i===oe.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(l(h)){let p=h+e.minimumZoomDistance,g=h-e._lastGlobeHeight,f=g/e._lastGlobeHeight;d.height<p&&(t||Math.abs(f)<=.1)&&(d.height=p,i===oe.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(f)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=g*.1}}l(a)&&(o._setTransform(a),u&&(m.normalize(o.position,o.position),m.negate(o.position,o.direction),m.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),m.normalize(o.direction,o.direction),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up)))}dA.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===oe.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var r0t=new m,s0t=new m;dA.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;M.equals(t.transform,M.IDENTITY)?(this._globe=n,this._ellipsoid=y(e.ellipsoid,ne.default)):(this._globe=void 0,this._ellipsoid=ne.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Tr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Tr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Tr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,r0t),c=m.clone(t.directionWC,s0t);if(i===oe.SCENE2D?obt(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,Gbt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,n0t(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!m.equals(a,t.positionWC)||!m.equals(c,t.directionWC);m8(this,d)}this._aggregator.reset()};dA.prototype.isDestroyed=function(){return!1};dA.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),me(this)};var uA=dA;var Jki=T(S(),1);var Gki=T(S(),1),mA=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; @@ -13843,7 +13125,7 @@ void main() float t = smoothstep(0.5, 0.8, x); out_FragColor = mix(color0 + color1, color1, t); } -`;var jki=T(S(),1),CA=`uniform sampler2D colorTexture; +`;var Iki=T(S(),1),hA=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; @@ -13873,7 +13155,7 @@ void main() xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function y0(){this._sceneFramebuffer=new AT;let e=.125,t=new Array(6);t[0]=new mo({fragmentShader:ql,textureScale:e,forcePowerOfTwo:!0,sampleMode:jd.LINEAR});let n=t[1]=new mo({fragmentShader:CA,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new D,t[2]=new mo({fragmentShader:Xy,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new mo({fragmentShader:Xy,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new mo({fragmentShader:ql,sampleMode:jd.LINEAR}),this._uCenter=new D,this._uRadius=void 0,t[5]=new mo({fragmentShader:SA,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new $l({stages:t});let o=new OT(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}y0.prototype.get=function(e){return this._stages.get(e)};y0.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var i0t=new se,z_e=new D,o0t=new D,K_e=new M;function r0t(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=M.computeViewportTransformation(n,0,1,K_e),d=M.multiplyByPoint(r,o,i0t),u=wt.pointToGLWindowCoordinates(s,c,o,z_e);d.x+=W.SOLAR_RADIUS;let h=wt.pointToGLWindowCoordinates(a,c,d,d),p=D.magnitude(D.subtract(h,u,h))*30*2,g=o0t;g.x=p,g.y=p,e._uCenter=D.clone(u,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let f=t.drawingBufferWidth,x=t.drawingBufferHeight,_=e._stages,C=_.get(0),V=C.outputTexture.width,L=C.outputTexture.height,Z=new ze;Z.width=V,Z.height=L,c=M.computeViewportTransformation(Z,0,1,K_e),u=wt.pointToGLWindowCoordinates(s,c,o,z_e),g.x*=V/f,g.y*=L/x;let G=C.scissorRectangle;G.x=Math.max(u.x-g.x*.5,0),G.y=Math.max(u.y-g.y*.5,0),G.width=Math.min(g.x,f),G.height=Math.min(g.y,x);for(let I=1;I<4;++I)ze.clone(G,_.get(I).scissorRectangle)}y0.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};y0.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),r0t(this,t,n),o};y0.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};y0.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(ql,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};y0.prototype.isDestroyed=function(){return!1};y0.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),me(this)};var VA=y0;var CUi=T(S(),1);function J_e(){this._cachedShowFrustumsShaders={}}function s0t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function a0t(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=De.replaceMain(u,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`;function x0(){this._sceneFramebuffer=new NT;let e=.125,t=new Array(6);t[0]=new ho({fragmentShader:$l,textureScale:e,forcePowerOfTwo:!0,sampleMode:qd.LINEAR});let n=t[1]=new ho({fragmentShader:hA,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new D,t[2]=new ho({fragmentShader:Xy,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new ho({fragmentShader:Xy,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new ho({fragmentShader:$l,sampleMode:qd.LINEAR}),this._uCenter=new D,this._uRadius=void 0,t[5]=new ho({fragmentShader:mA,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new ed({stages:t});let o=new HT(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}x0.prototype.get=function(e){return this._stages.get(e)};x0.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var a0t=new se,J_e=new D,c0t=new D,Q_e=new M;function l0t(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=M.computeViewportTransformation(n,0,1,Q_e),d=M.multiplyByPoint(r,o,a0t),u=vt.pointToGLWindowCoordinates(s,c,o,J_e);d.x+=W.SOLAR_RADIUS;let h=vt.pointToGLWindowCoordinates(a,c,d,d),p=D.magnitude(D.subtract(h,u,h))*30*2,g=c0t;g.x=p,g.y=p,e._uCenter=D.clone(u,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let f=t.drawingBufferWidth,x=t.drawingBufferHeight,_=e._stages,C=_.get(0),V=C.outputTexture.width,L=C.outputTexture.height,Z=new ze;Z.width=V,Z.height=L,c=M.computeViewportTransformation(Z,0,1,Q_e),u=vt.pointToGLWindowCoordinates(s,c,o,J_e),g.x*=V/f,g.y*=L/x;let G=C.scissorRectangle;G.x=Math.max(u.x-g.x*.5,0),G.y=Math.max(u.y-g.y*.5,0),G.width=Math.min(g.x,f),G.height=Math.min(g.y,x);for(let I=1;I<4;++I)ze.clone(G,_.get(I).scissorRectangle)}x0.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};x0.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),l0t(this,t,n),o};x0.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};x0.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand($l,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};x0.prototype.isDestroyed=function(){return!1};x0.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),me(this)};var fA=x0;var nUi=T(S(),1);function j_e(){this._cachedShowFrustumsShaders={}}function d0t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function u0t(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=De.replaceMain(u,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; `,a+=`uniform vec3 debugShowFrustumsColor; `,a+=`void main() { @@ -13882,7 +13164,7 @@ void main() `,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor; `;else a+=` out_FragColor.rgb *= debugShowCommandsColor; `,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",o.sources.push(a);let d=s0t(i);return en.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var LA=new B;function c0t(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=B.fromRandom()),t._debugColor):B.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(LA.red=t.debugOverlappingFrustums&1?1:0,LA.green=t.debugOverlappingFrustums&2?1:0,LA.blue=t.debugOverlappingFrustums&4?1:0,LA.alpha=1,LA):B.WHITE}),n}var l0t=new qe;J_e.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=a0t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=qe.shallowClone(t,l0t);r.shaderProgram=o,r.uniformMap=c0t(e,t),r.execute(e.context,n)};var RA=J_e;var EUi=T(S(),1);function QT(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Gn}QT.fromKeyframeNode=function(e,t,n,i){let o=new QT(e,t,n),{spatialNode:r,metadata:s}=i;return o._metadata=d0t(e,s,n),o._orientedBoundingBox=m0t(e,r,n,o._orientedBoundingBox),o};function d0t(e,t,n){if(!l(t))return;let{names:i,types:o}=e.provider,r={};for(let s=0;s<i.length;s++){let a=i[s],c=ut.getComponentCount(o[s]),d=t[s].slice(n*c,(n+1)*c);r[a]=d}return r}var Q_e=new m,u0t=new m;function m0t(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),d=a-c*o.x,u=m.fromElements(d,c,s,Q_e),h=m.divideComponents(m.subtract(u,e._paddingBefore,Q_e),e.dimensions,u0t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(QT.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});QT.prototype.hasProperty=function(e){return l(this._metadata[e])};QT.prototype.getNames=function(){return Object.keys(this._metadata)};QT.prototype.getProperty=function(e){return this._metadata[e]};var ZA=QT;var IOi=T(S(),1);var KDi=T(S(),1);var IDi=T(S(),1);var XUi=T(S(),1),GA=`struct Ray { +`;a+="}",o.sources.push(a);let d=d0t(i);return $t.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var pA=new B;function m0t(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=B.fromRandom()),t._debugColor):B.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(pA.red=t.debugOverlappingFrustums&1?1:0,pA.green=t.debugOverlappingFrustums&2?1:0,pA.blue=t.debugOverlappingFrustums&4?1:0,pA.alpha=1,pA):B.WHITE}),n}var h0t=new qe;j_e.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=u0t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=qe.shallowClone(t,h0t);r.shaderProgram=o,r.uniformMap=m0t(e,t),r.execute(e.context,n)};var bA=j_e;var cUi=T(S(),1);function qT(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Gn}qT.fromKeyframeNode=function(e,t,n,i){let o=new qT(e,t,n),{spatialNode:r,metadata:s}=i;return o._metadata=f0t(e,s,n),o._orientedBoundingBox=b0t(e,r,n,o._orientedBoundingBox),o};function f0t(e,t,n){if(!l(t))return;let{names:i,types:o}=e.provider,r={};for(let s=0;s<i.length;s++){let a=i[s],c=dt.getComponentCount(o[s]),d=t[s].slice(n*c,(n+1)*c);r[a]=d}return r}var q_e=new m,p0t=new m;function b0t(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),d=a-c*o.x,u=m.fromElements(d,c,s,q_e),h=m.divideComponents(m.subtract(u,e._paddingBefore,q_e),e.dimensions,p0t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(qT.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});qT.prototype.hasProperty=function(e){return l(this._metadata[e])};qT.prototype.getNames=function(){return Object.keys(this._metadata)};qT.prototype.getProperty=function(e){return this._metadata[e]};var gA=qT;var l3i=T(S(),1);var ZDi=T(S(),1);var lDi=T(S(),1);var dUi=T(S(),1),yA=`struct Ray { vec3 pos; vec3 dir; vec3 rawDir; @@ -13913,7 +13195,7 @@ struct PointJacobianT { vec3 point; mat3 jacobianT; }; -`;var PUi=T(S(),1),EA=`// See Intersection.glsl for the definition of intersectScene +`;var mUi=T(S(),1),xA=`// See Intersection.glsl for the definition of intersectScene // See IntersectionUtils.glsl for the definition of nextIntersection // See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl // for the definition of convertUvToShapeUvSpace. The appropriate function is @@ -14171,7 +13453,7 @@ void main() out_FragColor = colorAccum; #endif } -`;var wUi=T(S(),1),IA=`in vec2 position; +`;var fUi=T(S(),1),_A=`in vec2 position; uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; @@ -14182,7 +13464,7 @@ void main() { vec2 scale = 0.5 * (aabbMax - aabbMin); gl_Position = vec4(position * scale + translation, 0.0, 1.0); } -`;var AUi=T(S(),1),XA=`/* Intersection defines +`;var bUi=T(S(),1),TA=`/* Intersection defines #define INTERSECTION_COUNT ### */ @@ -14348,7 +13630,7 @@ RayShapeIntersection nextIntersection(inout Intersections ix) { #endif // NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1 -`;var NUi=T(S(),1),WA=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, +`;var yUi=T(S(),1),SA=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, // setIntersectionPair, INF_HIT, NO_HIT /* intersectDepth defines (set in Scene/VoxelRenderResources.js) @@ -14371,7 +13653,7 @@ void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); } } -`;var UUi=T(S(),1),PA=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, +`;var _Ui=T(S(),1),CA=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, // NO_HIT, setShapeIntersection /* Clipping plane defines (set in Scene/VoxelRenderResources.js) @@ -14449,7 +13731,7 @@ void intersectClippingPlanes(in Ray ray, inout Intersections ix) { setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); #endif } -`;var BUi=T(S(),1),nL=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, +`;var SUi=T(S(),1),oL=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, // RayShapeIntersection vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) { @@ -14551,7 +13833,7 @@ RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) return RayShapeIntersection(miss, miss); } } -`;var YUi=T(S(),1),vA=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection, +`;var VUi=T(S(),1),VA=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection, // NO_HIT, Intersections /* Box defines (set in Scene/VoxelBoxShape.js) @@ -14598,7 +13880,7 @@ void intersectShape(in Ray ray, inout Intersections ix) RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds); setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } -`;var zUi=T(S(),1),wA=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections, +`;var RUi=T(S(),1),LA=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections, // RayShapeIntersection, setSurfaceIntersection, setShapeIntersection, // intersectIntersections // See IntersectLongitude.glsl for the definitions of intersectHalfPlane, @@ -14744,7 +14026,7 @@ void intersectShape(Ray ray, inout Intersections ix) setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]); #endif } -`;var JUi=T(S(),1),FA=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections, +`;var GUi=T(S(),1),RA=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections, // RayShapeIntersection, setSurfaceIntersection, setShapeIntersection // See IntersectLongitude.glsl for the definitions of intersectHalfPlane, // intersectFlippedWedge, intersectRegularWedge @@ -15082,7 +14364,7 @@ void intersectShape(in Ray ray, inout Intersections ix) { setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]); #endif } -`;var jUi=T(S(),1),jT=`// Main intersection function for Voxel scenes. +`;var IUi=T(S(),1),$T=`// Main intersection function for Voxel scenes. // See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl // for the definition of intersectShape. The appropriate function is selected // based on the VoxelPrimitive shape type, and added to the shader in @@ -15134,7 +14416,7 @@ RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Interse return intersection; } -`;var $Ui=T(S(),1),AA=`/* Box defines (set in Scene/VoxelBoxShape.js) +`;var WUi=T(S(),1),ZA=`/* Box defines (set in Scene/VoxelBoxShape.js) #define BOX_HAS_SHAPE_BOUNDS */ @@ -15178,7 +14460,7 @@ vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { #else return shapeUv; #endif -}`;var tDi=T(S(),1),MA=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) +}`;var vUi=T(S(),1),GA=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) #define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS #define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE @@ -15277,7 +14559,7 @@ vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { return vec3(radius, height, angle); } -`;var iDi=T(S(),1),NA=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) +`;var FUi=T(S(),1),EA=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE @@ -15416,7 +14698,7 @@ vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { return vec3(longitude, latitude, height); } -`;var rDi=T(S(),1),kA=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js +`;var MUi=T(S(),1),IA=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js #define OCTREE_FLAG_INTERNAL 0 #define OCTREE_FLAG_LEAF 1 #define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 @@ -15641,7 +14923,7 @@ void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData trave sampleDatas[1].tileUv = getClampedTileUv(shapePosition, sampleDatas[1].tileCoords); #endif } -`;var aDi=T(S(),1),UA=`// See Octree.glsl for the definitions of SampleData and intMod +`;var kUi=T(S(),1),XA=`// See Octree.glsl for the definitions of SampleData and intMod /* Megatexture defines (set in Scene/VoxelRenderResources.js) #define SAMPLE_COUNT ### @@ -15776,11 +15058,292 @@ Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_ return properties; #endif } -`;function h0t(e){let t=new _x;this.shaderBuilder=t;let n=e._customShader,i=St(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,ge.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ge.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([IA]),t.addFragmentLines([n.fragmentShaderText,"#line 0",kA,GA,XA,UA]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ge.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ge.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ge.FRAGMENT),t.addFragmentLines([PA])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ge.FRAGMENT),t.addFragmentLines([WA]));let a=e._provider.shape;a==="BOX"?t.addFragmentLines([AA,vA,jT]):a==="CYLINDER"?t.addFragmentLines([MA,nL,wA,jT]):a==="ELLIPSOID"&&(t.addDefine("SHAPE_ELLIPSOID",void 0,ge.FRAGMENT),t.addFragmentLines([NA,nL,FA,jT])),t.addFragmentLines([EA]);let c=e._shape,d=c.shaderDefines;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,ge.FRAGMENT))}let u=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,ge.FRAGMENT),s===1?u+=1:r.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,ge.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,ge.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,ge.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ge.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ge.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,ge.FRAGMENT)}var DA=h0t;var wDi=T(S(),1);function f0t(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,d=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,ge.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,ge.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=o[P],b=`PropertyStatistics_${w}`,R=`PropertyStatistics_${w}`;n.addStruct(b,R,ge.FRAGMENT);let E=GB(F);n.addStructField(b,E,"min"),n.addStructField(b,E,"max")}let u="Statistics",h="Statistics",p="statistics";n.addStruct(u,h,ge.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=`PropertyStatistics_${w}`,b=w;n.addStructField(u,F,b)}let g="Metadata",f="Metadata",x="metadata";n.addStruct(g,f,ge.FRAGMENT),n.addStructField(g,h,p);for(let P=0;P<c;P++){let w=i[P],F=o[P],b=GB(F);n.addStructField(g,b,w)}for(let P=0;P<c;P++){let w=i[P],F=o[P],b=b0t(F),R=`VoxelProperty_${w}`,E=`VoxelProperty_${w}`;n.addStruct(R,E,ge.FRAGMENT),n.addStructField(R,b,"partialDerivativeLocal"),n.addStructField(R,b,"partialDerivativeWorld"),n.addStructField(R,b,"partialDerivativeView"),n.addStructField(R,b,"partialDerivativeValid")}let _="Voxel",C="Voxel",V="voxel";n.addStruct(_,C,ge.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=`VoxelProperty_${w}`;n.addStructField(_,F,w)}n.addStructField(_,"vec3","positionEC"),n.addStructField(_,"vec3","positionUv"),n.addStructField(_,"vec3","positionShapeUv"),n.addStructField(_,"vec3","positionUvLocal"),n.addStructField(_,"vec3","viewDirUv"),n.addStructField(_,"vec3","viewDirWorld"),n.addStructField(_,"vec3","surfaceNormal"),n.addStructField(_,"float","travelDistance"),n.addStructField(_,"int","stepCount"),n.addStructField(_,"int","tileIndex"),n.addStructField(_,"int","sampleIndex");let L="FragmentInput";n.addStruct(L,"FragmentInput",ge.FRAGMENT),n.addStructField(L,f,x),n.addStructField(L,C,V);let G="Properties",I="Properties",v="properties";n.addStruct(G,I,ge.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=o[P],b=GB(F);n.addStructField(G,b,w)}{let P="clearProperties";n.addFunction(P,`${I} clearProperties()`,ge.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w],b=o[w],R=r[w],E=GB(b,R);n.addFunctionLines(P,[`${v}.${F} = ${E}(0.0);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="sumProperties";n.addFunction(P,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,ge.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`${v}.${F} = propertiesA.${F} + propertiesB.${F};`])}n.addFunctionLines(P,[`return ${v};`])}{let P="scaleProperties";n.addFunction(P,`${I} scaleProperties(${I} ${v}, float scale)`,ge.FRAGMENT),n.addFunctionLines(P,[`${I} scaledProperties = ${v};`]);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`scaledProperties.${F} *= scale;`])}n.addFunctionLines(P,["return scaledProperties;"])}{let P="mixProperties";n.addFunction(P,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,ge.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`${v}.${F} = mix(propertiesA.${F}, propertiesB.${F}, mixFactor);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="copyPropertiesToMetadata";n.addFunction(P,`void copyPropertiesToMetadata(in ${I} ${v}, inout ${f} ${x})`,ge.FRAGMENT);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`${x}.${F} = ${v}.${F};`])}}if(d){let P="setStatistics";n.addFunction(P,`void setStatistics(inout ${h} ${p})`,ge.FRAGMENT);for(let w=0;w<c;w++){let F=i[w],b=o[w],R=ut.getComponentCount(b);for(let E=0;E<R;E++){let X=g0t(b,E),A=s[w][E],N=a[w][E];n.addFunctionLines(P,[`${p}.${F}.min${X} = ${j_e(A)};`,`${p}.${F}.max${X} = ${j_e(N)};`])}}}{let P="getPropertiesFromMegatextureAtUv";n.addFunction(P,`${I} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ge.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w],b=o[w],R=r[w],E=p0t(b,R);n.addFunctionLines(P,[`properties.${F} = texture(u_megatextureTextures[${w}], texcoord)${E};`])}n.addFunctionLines(P,[`return ${v};`])}}function GB(e){if(e===ut.SCALAR)return"float";if(e===ut.VEC2)return"vec2";if(e===ut.VEC3)return"vec3";if(e===ut.VEC4)return"vec4"}function p0t(e){if(e===ut.SCALAR)return".r";if(e===ut.VEC2)return".ra";if(e===ut.VEC3)return".rgb";if(e===ut.VEC4)return""}function b0t(e){if(e===ut.SCALAR)return"vec3";if(e===ut.VEC2)return"mat2";if(e===ut.VEC3)return"mat3";if(e===ut.VEC4)return"mat4"}function j_e(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function g0t(e,t){return e===ut.SCALAR?"":`[${t}]`}var BA=f0t;function y0t(e,t){let n=new DA(e);BA(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let C="getClippingPlane",V=o0(o,t),L=0,Z=V.indexOf(")")+1,G=V.indexOf("{",Z)+1,I=V.indexOf("}",G),v=V.slice(L,Z),P=V.slice(G,I);i.addFunction(C,v,ge.FRAGMENT),i.addFunctionLines(C,[P])}let s=i.clone();s.addDefine("PICKING",void 0,ge.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ge.FRAGMENT);let c=i.buildShaderProgram(t),d=s.buildShaderProgram(t),u=a.buildShaderProgram(t),h=Ue.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,f=new qe({vertexArray:p,primitiveType:we.TRIANGLES,renderState:h,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ee.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),x=qe.shallowClone(f,new qe);x.shaderProgram=d,x.pickOnly=!0;let _=qe.shallowClone(f,new qe);if(_.shaderProgram=u,_.pickOnly=!0,l(e._drawCommand)){let C=e._drawCommand;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPick)){let C=e._drawCommandPick;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let C=e._drawCommandPickVoxel;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}e._drawCommand=f,e._drawCommandPick=x,e._drawCommandPickVoxel=_}var OA=y0t;var XBi=T(S(),1);var iBi=T(S(),1);function ed(){this.orientedBoundingBox=new Gn,this.boundingSphere=new le,this.boundTransform=new M,this.shapeTransform=new M,this._minBounds=m.clone(ed.DefaultMinBounds,new m),this._maxBounds=m.clone(ed.DefaultMaxBounds,new m),this.shaderUniforms={renderMinBounds:new m,renderMaxBounds:new m,boxUvToShapeUvScale:new m,boxUvToShapeUvTranslate:new m},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var x0t=new m,m8=new m,_0t=new $,T0t=new m,S0t=new m,C0t=new m,V0t=new m,q_e=M.fromRotationTranslation($.fromUniformScale(.5,new $),new m(.5,.5,.5),new M);ed.prototype.update=function(e,t,n,i,o){i=y(i,ed.DefaultMinBounds),o=y(o,ed.DefaultMaxBounds);let r=ed.DefaultMinBounds,s=ed.DefaultMaxBounds;t=this._minBounds=m.clamp(t,r,s,this._minBounds),n=this._maxBounds=m.clamp(n,r,s,this._maxBounds),i=m.clamp(i,r,s,T0t),o=m.clamp(o,r,s,S0t);let a=m.clamp(t,i,o,C0t),c=m.clamp(n,i,o,V0t),d=M.getScale(e,m8);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||d.x===0||d.y===0||d.z===0)return!1;this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=f8(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:u,shaderDefines:h}=this;for(let f in h)h.hasOwnProperty(f)&&(h[f]=void 0);let p=!m.equals(t,r)||!m.equals(n,s),g=0;if(h.BOX_INTERSECTION_INDEX=g,g+=1,u.renderMinBounds=M.multiplyByPoint(q_e,a,u.renderMinBounds),u.renderMaxBounds=M.multiplyByPoint(q_e,c,u.renderMaxBounds),p){h.BOX_HAS_SHAPE_BOUNDS=!0;let f=t,x=n;u.boxUvToShapeUvScale=m.fromElements(2/(f.x===x.x?1:x.x-f.x),2/(f.y===x.y?1:x.y-f.y),2/(f.z===x.z?1:x.z-f.z),u.boxUvToShapeUvScale),u.boxUvToShapeUvTranslate=m.fromElements(-u.boxUvToShapeUvScale.x*(f.x*.5+.5),-u.boxUvToShapeUvScale.y*(f.y*.5+.5),-u.boxUvToShapeUvScale.z*(f.z*.5+.5),u.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var EB=new m,h8=new m;ed.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(W.lerp(r.x,s.x,a*t),W.lerp(r.y,s.y,a*n),W.lerp(r.z,s.z,a*i),EB),d=m.fromElements(W.lerp(r.x,s.x,a*(t+1)),W.lerp(r.y,s.y,a*(n+1)),W.lerp(r.z,s.z,a*(i+1)),h8);return f8(c,d,this.shapeTransform,o)};var $_e=new m;ed.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,$_e),s=m.multiplyByScalar(r,o,$_e),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,EB),o,EB),c=m.add(a,s,h8),d=this._minBounds,u=this._maxBounds,h=m.fromElements(W.lerp(d.x,u.x,a.x),W.lerp(d.y,u.y,a.y),W.lerp(d.z,u.z,a.z),EB),p=m.fromElements(W.lerp(d.x,u.x,c.x),W.lerp(d.y,u.y,c.y),W.lerp(d.z,u.z,c.z),h8);return f8(h,p,this.shapeTransform,i)};ed.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));ed.DefaultMaxBounds=Object.freeze(new m(1,1,1));function f8(e,t,n,i){let o=ed.DefaultMinBounds,r=ed.DefaultMaxBounds;if(m.equals(e,o)&&m.equals(t,r))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let a=M.getScale(n,m8),c=m.midpoint(e,t,x0t);i.center=M.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),m8);let d=M.getRotation(n,_0t);i.halfAxes=$.setScale(d,a,i.halfAxes)}return i}var ap=ed;var fBi=T(S(),1);function rs(){this.orientedBoundingBox=new Gn,this.boundingSphere=new le,this.boundTransform=new M,this.shapeTransform=new M,this._minimumRadius=rs.DefaultMinBounds.x,this._maximumRadius=rs.DefaultMaxBounds.x,this._minimumHeight=rs.DefaultMinBounds.y,this._maximumHeight=rs.DefaultMaxBounds.y,this._minimumAngle=rs.DefaultMinBounds.z,this._maximumAngle=rs.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderHeightMinMax:new D,cylinderRenderRadiusMinMax:new D,cylinderRenderAngleMinMax:new D,cylinderUvToShapeUvRadius:new D,cylinderUvToShapeUvHeight:new D,cylinderUvToShapeUvAngle:new D,cylinderShapeUvAngleMinMax:new D,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var iTe=new m;rs.prototype.update=function(e,t,n,i,o){i=y(i,rs.DefaultMinBounds),o=y(o,rs.DefaultMaxBounds);let r=rs.DefaultMinBounds.x,s=rs.DefaultMaxBounds.x,a=rs.DefaultMinBounds.y,c=rs.DefaultMaxBounds.y,d=rs.DefaultMinBounds.z,u=rs.DefaultMaxBounds.z,h=u-d,p=.5*h,g=W.EPSILON10,f=W.EPSILON3,x=W.EPSILON10,_=W.clamp(t.x,r,s),C=W.clamp(n.x,r,s),V=W.clamp(i.x,r,s),L=W.clamp(o.x,r,s),Z=Math.max(_,V),G=Math.min(C,L),I=W.clamp(t.y,a,c),v=W.clamp(n.y,a,c),P=W.clamp(i.y,a,c),w=W.clamp(o.y,a,c),F=Math.max(I,P),b=Math.min(v,w),R=W.negativePiToPi(t.z),E=W.negativePiToPi(n.z),X=W.negativePiToPi(i.z),A=W.negativePiToPi(o.z),N=Math.max(R,X),O=Math.min(E,A),U=M.getScale(e,iTe);if(G===0||Z>G||F>b||W.equalsEpsilon(U.x,0,void 0,g)||W.equalsEpsilon(U.y,0,void 0,g)||W.equalsEpsilon(U.z,0,void 0,g))return!1;this._minimumRadius=_,this._maximumRadius=C,this._minimumHeight=I,this._maximumHeight=v,this._minimumAngle=R,this._maximumAngle=E,this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=b8(Z,G,F,b,N,O,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let H=_===r&&C===s,J=I===a&&v===c,te=E<R,z=E-R+te*h,j=z>p+x&&z<h-x,ee=z<p-x,fe=z>=p-x&&z<=p+x,_e=j||ee||fe,de=W.equalsEpsilon(R,d,void 0,f),ye=W.equalsEpsilon(E,u,void 0,f),Te=Z===r,Ie=O<N,Le=O-N+Ie*h,ke=Le>=p-x&&Le<h-x,Be=Le>x&&Le<p-x,it=Le<=x,Et=ke||Be||it,{shaderUniforms:yt,shaderDefines:Ne}=this;for(let Rt in Ne)Ne.hasOwnProperty(Rt)&&(Ne[Rt]=void 0);let Jt=0;if(Ne.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Jt,Jt+=1,Te||(Ne.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Ne.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Jt,Jt+=1),yt.cylinderRenderRadiusMinMax=D.fromElements(Z,G,yt.cylinderRenderRadiusMinMax),Z===G&&(Ne.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!H){Ne.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Rt=C-_,mt=0,on=1;Rt!==0&&(mt=1/Rt,on=-_/Rt),yt.cylinderUvToShapeUvRadius=D.fromElements(mt,on,yt.cylinderUvToShapeUvRadius)}if(!J){Ne.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Rt=v-I,mt=0,on=1;Rt!==0&&(mt=2/Rt,on=-(I+1)/Rt),yt.cylinderUvToShapeUvHeight=D.fromElements(mt,on,yt.cylinderUvToShapeUvHeight)}if(yt.cylinderRenderHeightMinMax=D.fromElements(F,b,yt.cylinderRenderHeightMinMax),te&&(Ne.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Et&&(Ne.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Ne.CYLINDER_INTERSECTION_INDEX_ANGLE=Jt,ke?(Ne.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Jt+=1):Be?(Ne.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Jt+=2):it&&(Ne.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Jt+=2),yt.cylinderRenderAngleMinMax=D.fromElements(N,O,yt.cylinderRenderAngleMinMax)),_e){Ne.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,de&&(Ne.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),ye&&(Ne.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Rt=(R-d)/h,mt=(E-d)/h,on=1-z/h;if(yt.cylinderShapeUvAngleMinMax=D.fromElements(Rt,mt,yt.cylinderShapeUvAngleMinMax),yt.cylinderShapeUvAngleRangeZeroMid=(mt+.5*on)%1,z<=x)yt.cylinderUvToShapeUvAngle=D.fromElements(0,1,yt.cylinderUvToShapeUvAngle);else{let Ve=h/z,Ce=-(R-d)/z;yt.cylinderUvToShapeUvAngle=D.fromElements(Ve,Ce,yt.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=Jt,!0};rs.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,d=this._minimumAngle,u=this._maximumAngle,h=1/Math.pow(2,e),p=W.lerp(r,s,t*h),g=W.lerp(r,s,(t+1)*h),f=W.lerp(a,c,n*h),x=W.lerp(a,c,(n+1)*h),_=W.lerp(d,u,i*h),C=W.lerp(d,u,(i+1)*h);return b8(p,g,f,x,_,C,this.shapeTransform,o)};var eTe=new m,tTe=new m,L0t=new m;rs.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,eTe),s=m.multiplyByScalar(r,o,eTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,tTe),o,tTe),c=m.add(a,s,L0t),d=this._minimumRadius,u=this._maximumRadius,h=this._minimumHeight,p=this._maximumHeight,g=this._minimumAngle,f=this._maximumAngle,x=W.lerp(d,u,a.x),_=W.lerp(d,u,c.x),C=W.lerp(h,p,a.y),V=W.lerp(h,p,c.y),L=W.lerp(g,f,a.z),Z=W.lerp(g,f,c.z);return b8(x,_,C,V,L,Z,this.shapeTransform,i)};rs.DefaultMinBounds=Object.freeze(new m(0,-1,-W.PI));rs.DefaultMaxBounds=Object.freeze(new m(1,1,+W.PI));var R0t=5,Z0t=new Array(R0t),G0t=new m,E0t=new $,I0t=new M,X0t=new M,W0t=new M,p8=new M,P0t=new m,v0t=new m,w0t=new m,oTe=new Array(8);for(let e=0;e<8;e++)oTe[e]=new m;function nTe(e,t,n){return Math.abs(se.dot(e,t))<n}function F0t(e){let t=M.getColumn(e,0,P0t),n=M.getColumn(e,1,v0t),i=M.getColumn(e,2,w0t),o=W.EPSILON4;return nTe(t,n,o)&&nTe(n,i,o)}function A0t(e,t){let n=oTe;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)M.multiplyByPoint(e,n[i],n[i]);return Gn.fromPoints(n,t)}function b8(e,t,n,i,o,r,s,a){let c=rs.DefaultMinBounds,d=rs.DefaultMaxBounds,u=c.x,h=d.x,p=c.y,g=d.y,f=c.z,x=d.z;if(e===u&&t===h&&n===p&&i===g&&o===f&&r===x)return a.center=M.getTranslation(s,a.center),a.halfAxes=M.getMatrix3(s,a.halfAxes),a;r<o&&(r+=W.TWO_PI);let C=r-o,V=o+C*.5,L=Z0t,Z=0;L[Z++]=o,L[Z++]=r,L[Z++]=V,C>W.PI&&(L[Z++]=V-W.PI_OVER_TWO,L[Z++]=V+W.PI_OVER_TWO);let G=1,I=1,v=-1,P=-1;for(let te=0;te<Z;++te){let z=L[te]-V,j=Math.cos(z),ee=Math.sin(z),fe=j*e,_e=ee*e,de=j*t,ye=ee*t;G=Math.min(G,fe),I=Math.min(I,_e),G=Math.min(G,de),I=Math.min(I,ye),v=Math.max(v,fe),P=Math.max(P,_e),v=Math.max(v,de),P=Math.max(P,ye)}let w=v-G,F=P-I,b=i-n,R=(G+v)*.5,E=(I+P)*.5,X=(n+i)*.5,A=m.fromElements(R,E,X,G0t),N=$.fromRotationZ(V,E0t),O=m.fromElements(w,F,b,iTe),U=M.fromScale(O,W0t),Y=M.fromRotation(N,X0t),k=M.fromTranslation(A,I0t),H=M.multiplyTransformation(Y,M.multiplyTransformation(k,U,p8),p8),J=M.multiplyTransformation(s,H,p8);return F0t(J)?Gn.fromTransformation(J,a):A0t(J,a)}var cp=rs;var RBi=T(S(),1);function x0(){this.orientedBoundingBox=new Gn,this.boundingSphere=new le,this.boundTransform=new M,this.shapeTransform=new M,this._rectangle=new ce,this._minimumHeight=x0.DefaultMinBounds.z,this._maximumHeight=x0.DefaultMaxBounds.z,this._ellipsoid=new ne,this._translation=new m,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new m,eccentricitySquared:0,evoluteScale:new D,ellipsoidInverseRadiiSquaredUv:new m,ellipsoidRenderLongitudeMinMax:new D,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidUvToShapeUvLongitude:new D,ellipsoidUvToShapeUvLatitude:new D,ellipsoidRenderLatitudeSinMinMax:new D,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new D},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var M0t=new m,N0t=new m,k0t=new m,U0t=new m,D0t=new m,B0t=new m,O0t=new m,Y0t=new m,H0t=new $,rTe=new m,sTe=new m,z0t=new ce;x0.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=x0;i=y(i,r),o=y(o,s);let a=W.EPSILON10,c=W.EPSILON3,d=W.EPSILON10,u=W.EPSILON10,h=W.EPSILON3,p=M.getScale(e,Y0t),g=m.clone(r,M0t);g.z=-m.minimumComponent(p);let f=m.clamp(t,g,s,N0t),x=m.clamp(n,g,s,k0t),_=m.clamp(i,g,s,U0t),C=m.clamp(o,g,s,D0t),V=m.maximumByComponent(f,_,B0t),L=m.minimumByComponent(x,C,O0t),Z=m.add(p,m.fromElements(x.z,x.z,x.z,rTe),rTe),G=m.maximumComponent(Z),I=m.add(p,m.fromElements(L.z,L.z,L.z,sTe),sTe);if(V.y>L.y||V.y===s.y||L.y===r.y||V.z>L.z||W.equalsEpsilon(I,m.ZERO,void 0,a))return!1;this._rectangle=ce.fromRadians(f.x,f.y,x.x,x.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=ne.fromCartesian3(p,this._ellipsoid),this._minimumHeight=f.z,this._maximumHeight=x.z;let v=ce.fromRadians(V.x,V.y,L.x,L.y,z0t);this.orientedBoundingBox=g8(v,V.z,L.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=M.fromRotationTranslation($.setScale(this._rotation,Z,H0t),this._translation,this.shapeTransform),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let P=s.x-r.x,w=.5*P,F=L.x<V.x,b=L.x-V.x+F*P,R=b<=d,E=b>=w-d&&b<P-d,X=b>d&&b<w-d,A=R||E||X,N=x.x<f.x,O=x.x-f.x+N*P,U=O>w+d&&O<P-d,Y=O>=w-d&&O<=w+d,k=O<w-d,H=U||Y||k,J=L.y<-h,te=L.y>=-h&&L.y<=+h,z=L.y>+h&&L.y<s.y-u,j=J||te||z,ee=V.y>r.y+u&&V.y<-h,fe=V.y>=-h&&V.y<=+h,_e=V.y>+h,de=ee||fe||_e,ye=j||de,Te=x.y-f.y,Ie=x.y<-h,Le=x.y>=-h&&x.y<=+h,ke=x.y>+h&&x.y<s.y-u,Be=Ie||Le||ke,it=f.y>r.y+u&&f.y<-h,Et=f.y>=-h&&f.y<=+h,yt=f.y>+h,Jt=Be||(it||Et||yt),{shaderUniforms:Rt,shaderDefines:mt}=this;for(let ht in mt)mt.hasOwnProperty(ht)&&(mt[ht]=void 0);Rt.ellipsoidRadiiUv=m.divideByScalar(Z,G,Rt.ellipsoidRadiiUv);let{x:on,z:Ve}=Rt.ellipsoidRadiiUv,Ce=Ve/on;Rt.eccentricitySquared=1-Ce*Ce,Rt.evoluteScale=D.fromElements((on*on-Ve*Ve)/on,(Ve*Ve-on*on)/Ve,Rt.evoluteScale),Rt.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(Rt.ellipsoidRadiiUv,Rt.ellipsoidRadiiUv,Rt.ellipsoidInverseRadiiSquaredUv),Rt.ellipsoidInverseRadiiSquaredUv);let rt=0;mt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=rt,rt+=1,mt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=rt,rt+=1,Rt.clipMinMaxHeight=D.fromElements((V.z-x.z)/G,(L.z-x.z)/G,Rt.clipMinMaxHeight);let Oi=(x.z-f.z)/G;if(Rt.ellipsoidInverseHeightDifferenceUv=1/Oi,f.z===x.z&&(Rt.ellipsoidInverseHeightDifferenceUv=0),A&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,mt.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=rt,E?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,rt+=1):X?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,rt+=2):R&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,rt+=2),Rt.ellipsoidRenderLongitudeMinMax=D.fromElements(V.x,L.x,Rt.ellipsoidRenderLongitudeMinMax)),H)if(mt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,x.x<f.x&&(mt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),O<=d)Rt.ellipsoidUvToShapeUvLongitude=D.fromElements(0,1,Rt.ellipsoidUvToShapeUvLongitude);else{let go=P/O,zo=-(f.x-r.x)/O;Rt.ellipsoidUvToShapeUvLongitude=D.fromElements(go,zo,Rt.ellipsoidUvToShapeUvLongitude)}if(A){let ht=W.equalsEpsilon(V.x,r.x,void 0,c),go=W.equalsEpsilon(L.x,s.x,void 0,c);ht&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),go&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let zo=(f.x-r.x)/P,Ya=(x.x-r.x)/P,Gr=(L.x-r.x)/P,_s=1-b/P,Fe=(Gr+.5*_s)%1;Rt.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(zo,Ya,Fe,Rt.ellipsoidShapeUvLongitudeMinMaxMid)}if(ye&&(de&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,mt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=rt,ee?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,rt+=1):fe?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,rt+=1):_e&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,rt+=2)),j&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,mt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=rt,J?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,rt+=2):te?(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,rt+=1):z&&(mt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,rt+=1)),Rt.ellipsoidRenderLatitudeSinMinMax=D.fromElements(Math.sin(V.y),Math.sin(L.y),Rt.ellipsoidRenderLatitudeSinMinMax)),Jt)if(mt.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Te<u)Rt.ellipsoidUvToShapeUvLatitude=D.fromElements(0,1,Rt.ellipsoidUvToShapeUvLatitude);else{let go=(s.y-r.y)/Te,zo=(r.y-f.y)/Te;Rt.ellipsoidUvToShapeUvLatitude=D.fromElements(go,zo,Rt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=rt,!0};var lTe=new ce;x0.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,d=(n+1)*r,u=i*r,h=(i+1)*r,p=ce.subsection(this._rectangle,s,c,a,d,lTe),g=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,h);return g8(p,g,f,this._ellipsoid,this._translation,this._rotation,o)};var aTe=new m,cTe=new m,K0t=new m;x0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,aTe),s=m.multiplyByScalar(r,o,aTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,cTe),o,cTe),c=m.add(a,s,K0t),d=ce.subsection(this._rectangle,a.x,a.y,c.x,c.y,lTe),u=W.lerp(this._minimumHeight,this._maximumHeight,a.z),h=W.lerp(this._minimumHeight,this._maximumHeight,c.z);return g8(d,u,h,this._ellipsoid,this._translation,this._rotation,i)};function g8(e,t,n,i,o,r,s){return s=Gn.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}x0.DefaultMinBounds=Object.freeze(new m(-W.PI,-W.PI_OVER_TWO,-ne.WGS84.minimumRadius));x0.DefaultMaxBounds=Object.freeze(new m(W.PI,W.PI_OVER_TWO,10*ne.WGS84.maximumRadius));var qT=x0;var iu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};iu.getMinBounds=function(e){switch(e){case iu.BOX:return ap.DefaultMinBounds;case iu.ELLIPSOID:return qT.DefaultMinBounds;case iu.CYLINDER:return cp.DefaultMinBounds}};iu.getMaxBounds=function(e){switch(e){case iu.BOX:return ap.DefaultMaxBounds;case iu.ELLIPSOID:return qT.DefaultMaxBounds;case iu.CYLINDER:return cp.DefaultMaxBounds}};iu.getShapeConstructor=function(e){switch(e){case iu.BOX:return ap;case iu.ELLIPSOID:return qT;case iu.CYLINDER:return cp}};var Ai=Object.freeze(iu);var W3i=T(S(),1);var wBi=T(S(),1);function kh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(kh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});kh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new kh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};kh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};kh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)dTe(this,t)};kh.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,dTe(this,i),t};kh.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],uTe(this,0)),this._array[e-1]=void 0,t};kh.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=y8(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&uTe(this,n)}return this._array[e-1]=void 0,t};kh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};kh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[y8(this,1,2)?1:2]};function IB(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function YA(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function y8(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function dTe(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=YA(e,t,i);for(o!==n&&(IB(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(YA(e,t,r)!==o)break;IB(e,t,r),t=r}}function uTe(e,t){let n=e._length,i=Math.floor(W.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){YA(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let d=0;d<c;d++){let u=a+d;YA(e,u,r)===i&&(r=u)}}if(YA(e,r,t)===i&&(IB(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);y8(e,r,a)===i&&IB(e,r,a)}t=r}}var $T=kh;var ABi=T(S(),1),mTe=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function XB(e,t){this.spatialNode=e,this.keyframe=t,this.state=mTe.UNLOADED,this.metadata=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}XB.priorityComparator=function(e,t){return e.priority-t.priority};XB.searchComparator=function(e,t){return e.keyframe-t.keyframe};XB.LoadState=mTe;var $i=XB;var i3i=T(S(),1);function Py(e,t,n,i,o){i===Ut.UNSIGNED_SHORT&&(i=Ut.FLOAT32);let r=e.floatingPointTexture;if(i===Ut.FLOAT32&&!r)throw new ae("Floating point texture not supported");let s;i===Ut.FLOAT32||i===Ut.FLOAT64?s=je.FLOAT:i===Ut.UINT8&&(s=je.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?nt.RED:nt.LUMINANCE:n===2?a=e.webgl2?nt.RG:nt.LUMINANCE_ALPHA:n===3?a=nt.RGB:n===4&&(a=nt.RGBA);let c=512*1024*1024,d=128*1024*1024;o=Math.min(y(o,d),c);let u=At.maximumTextureSize,h=Ut.getSizeInBytes(i),p=Math.floor(o/(n*h)),g=Math.min(u,W.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),f=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/f),_=f*t.x,C=x*t.y,V=Math.floor(g/_),L=Math.floor(g/C);if(V===0||L===0)throw new ae("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=V*L,this.regionCountPerMegatexture=new D(V,L),this.voxelCountPerRegion=new D(_,C),this.sliceCountPerRegion=new D(f,x),this.voxelSizeUv=new D(1/g,1/g),this.sliceSizeUv=new D(t.x/g,t.y/g),this.regionSizeUv=new D(_/g,C/g),this.texture=new Wt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new $t({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR,magnificationFilter:mi.LINEAR})});let Z=Ut.toComponentDatatype(i);this.tileVoxelDataTemp=Q.createTypedArray(Z,_*C*n),this.nodes=new Array(this.maximumTileCount);for(let G=0;G<this.maximumTileCount;G++)this.nodes[G]=new J0t(G);for(let G=0;G<this.maximumTileCount;G++){let I=this.nodes[G];I.previousNode=G>0?this.nodes[G-1]:void 0,I.nextNode=G<this.maximumTileCount-1?this.nodes[G+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function J0t(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Py.prototype.add=function(e){if(this.isFull())throw new pe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};Py.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new pe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};Py.prototype.isFull=function(){return this.emptyList===void 0};Py.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Ut.UNSIGNED_SHORT&&(i=Ut.FLOAT32);let o=Ut.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,d=a*t.y,u=W.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(u/c),g=Math.floor(u/d);if(p*g>=e)break;u*=2}return u*u*n*o};Py.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let _=x%o.x*i.x,C=Math.floor(x/o.x)*i.y;for(let V=0;V<i.y;V++)for(let L=0;L<i.x;L++){let Z=x*i.y*i.x+V*i.x+L,G=(C+V)*r.x+(_+L);for(let I=0;I<s;I++)a[G*s+I]=n[Z*s+I]}}let c=this.regionCountPerMegatexture,d=r.x,u=r.y,h=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,f={source:{arrayBufferView:a,width:d,height:u},xOffset:h,yOffset:p};this.texture.copyFrom(f)};Py.prototype.isDestroyed=function(){return!1};Py.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),me(this)};var iL=Py;var h3i=T(S(),1);function ym(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=m.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Gn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var Q0t=new m;ym.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,Q0t),n=2*m.maximumComponent(t);this.approximateVoxelSize=n/m.minimumComponent(this.dimensions)};ym.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,d=r+1,u=a+1,h=t+1,p=[[h,r,s,a],[h,d,s,a],[h,r,c,a],[h,d,c,a],[h,r,s,u],[h,d,s,u],[h,r,c,u],[h,d,c,u]];this.children=p.map(([g,f,x,_])=>new ym(g,f,x,_,this,e,this.dimensions))};ym.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};ym.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,W.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var hTe={keyframe:0};function HA(e,t){return hTe.keyframe=e,Io(t,hTe,$i.searchComparator)}ym.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=j0t(i,h),g=h[p],f=o===i||i<g.keyframe?p:Math.min(p+1,h.length-1),x=h[f],_=i-g.keyframe,C=fTe(n-t.level,_);C<a&&(a=C,r=g);let V=x.keyframe-o,L=fTe(n-t.level,V);if(L<c&&(c=L,s=x),_===0&&V===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:W.clamp((e-d)/(u-d),0,1)};function j0t(e,t){let n=HA(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function fTe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}ym.prototype.isVisited=function(e){return this.visitedFrameNumber===e};ym.prototype.createKeyframeNode=function(e){let t=HA(e,this.keyframeNodes);if(t<0){t=~t;let n=new $i(this,e);this.keyframeNodes.splice(t,0,n)}};ym.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=HA(n,this.keyframeNodes);if(i<0)throw new pe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=HA(n,this.renderableKeyframeNodes);if(o<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=$i.LoadState.UNLOADED,e.metadata={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};ym.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==$i.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadata.length!==t.length)throw new pe("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadata[o])}e.state=$i.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=HA(e.keyframe,n);if(i>=0)throw new pe("Keyframe already renderable");i=~i,n.splice(i,0,e)};ym.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var zA=ym;function _0(e,t,n,i,o,r,s){this._primitive=e,this.megatextures=new Array(i.length);for(let f=0;f<i.length;f++){let x=i[f],_=ut.getComponentCount(x),C=o[f];this.megatextures[f]=new iL(t,n,_,C,s)}let a=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let c=e._shape;this.rootNode=new zA(0,0,0,0,void 0,c,n),this._priorityQueue=new $T({maximumLength:a,comparator:$i.priorityComparator}),this._highPriorityKeyframeNodes=new Array(a),this._keyframeNodesInMegatexture=new Array(a),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let d=this._binaryTreeKeyframeWeighting;d[0]=0,d[r-1]=0,x8(d,1,r-2,0);let u=9,h=2048,p=Math.floor(h/u),g=Math.ceil(a/p);this.internalNodeTexture=new Wt({context:t,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:h,height:g,sampler:new $t({minificationFilter:qt.NEAREST,magnificationFilter:mi.NEAREST})}),this.internalNodeTilesPerRow=p,this.internalNodeTexelSizeUv=new D(1/h,1/g),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new D}_0.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function x8(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,x8(e,t,o-1,i+1),x8(e,o+1,n,i+1)}_0.simultaneousRequestCountMaximum=50;_0.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,d=c>0,u=a>1,h=(d?2:1)*(u?2:1);this._sampleCount=h;let p=h>=2;if(p&&!l(this.leafNodeTexture)){let V=Math.floor(512),L=Math.ceil(s/V);this.leafNodeTexture=new Wt({context:r,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:1024,height:L,sampler:new $t({minificationFilter:qt.NEAREST,magnificationFilter:mi.NEAREST})}),this.leafNodeTexelSizeUv=D.fromElements(1/1024,1/L,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=V}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=W.clamp(t,0,a-1),n&&pTe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=_i();egt(this,e);let f=_i();igt(this,h,c);let x=_i();if(this._debugPrint){let _=f-g,C=x-f,V=x-g;ngt(this,_,C,V)}};_0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};_0.prototype.isDestroyed=function(){return!1};_0.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),me(this)};function pTe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];pTe(e,i)}}function q0t(e,t){if(e._simultaneousRequestCount>=_0.simultaneousRequestCountMaximum)return;let n=e._primitive._provider;function i(c){e._simultaneousRequestCount--;let d=n.types.length;if(!l(c))t.state=$i.LoadState.UNAVAILABLE;else if(c===$i.LoadState.FAILED)t.state=$i.LoadState.FAILED;else if(!Array.isArray(c)||c.length!==d)t.state=$i.LoadState.FAILED;else{let u=e.megatextures;for(let h=0;h<d;h++){let{voxelCountPerTile:p,channelCount:g}=u[h],{x:f,y:x,z:_}=p,C=f*x*_,V=c[h],L=C*g;if(V.length===L)t.metadata[h]=V,t.state=$i.LoadState.RECEIVED;else{t.state=$i.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=$i.LoadState.FAILED}let{keyframe:r,spatialNode:s}=t,a=n.requestData({tileLevel:s.level,tileX:s.x,tileY:s.y,tileZ:s.z,keyframe:r});l(a)?(e._simultaneousRequestCount++,t.state=$i.LoadState.RECEIVING,a.then(i).catch(o)):t.state=$i.LoadState.FAILED}function $0t(e){return e/(1+e)}function egt(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,r=i.screenSpaceError,s=e._priorityQueue,a=e._keyframeCount,c=W.clamp(Math.floor(e._keyframeLocation),0,a-2),d=c+1,{camera:u,context:h,pixelRatio:p}=t,{positionWC:g,frustum:f}=u,_=h.drawingBufferHeight/p/f.sseDenominator;function C(F,b){if(F.computeScreenSpaceError(g,_),b=F.visibility(t,b),b===hs.MASK_OUTSIDE)return;if(F.visitedFrameNumber=n,a===1)F.createKeyframeNode(0);else if(F.keyframeNodes.length!==a)for(let N=0;N<a;N++)F.createKeyframeNode(N);let{screenSpaceError:R,keyframeNodes:E}=F,X=$0t(R),A=!1;for(let N=0;N<E.length;N++){let O=E[N];O.priority=10*X+tgt(c,O.keyframe,d,e),O.state!==$i.LoadState.UNAVAILABLE&&O.state!==$i.LoadState.FAILED&&O.priority!==-Number.MAX_VALUE&&s.insert(O),O.state===$i.LoadState.LOADED&&(A=!0)}if(R<r||!A){F.children=void 0;return}l(F.children)||F.constructChildNodes(o);for(let N=0;N<8;N++){let O=F.children[N];C(O,b)}}s.reset(),C(e.rootNode,hs.MASK_INDETERMINATE);let V=e._highPriorityKeyframeNodes,L=0,Z;for(;s.length>0;)Z=s.removeMaximum(),Z.highPriorityFrameNumber=n,V[L]=Z,L++;let G=e._keyframeNodesInMegatexture,I=e.megatextures[0],v=I.occupiedCount;G.length=v,G.sort(function(F,b){return F.highPriorityFrameNumber===b.highPriorityFrameNumber?b.priority-F.priority:b.highPriorityFrameNumber-F.highPriorityFrameNumber});let P=0,w=0;for(let F=0;F<L;F++)if(Z=V[F],!(Z.state===$i.LoadState.LOADED||Z.spatialNode===void 0)&&(Z.state===$i.LoadState.UNLOADED&&q0t(e,Z),Z.state===$i.LoadState.RECEIVED)){let b=0;if(I.isFull()){b=v-1-P,P++;let R=G[b];R.spatialNode.destroyKeyframeNode(R,e.megatextures)}else b=v+w,w++;Z.spatialNode.addKeyframeNodeToMegatextures(Z,e.megatextures),G[b]=Z}}function tgt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return W.lerp(a,s,.15+.85*s)}function ngt(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys($i.LoadState).length,a=new Array(s),c=new Array(s),d=0;for(let C=0;C<s;C++){let V=new Array(o);a[C]=V;for(let L=0;L<o;L++)V[L]=0;c[C]=0}function u(C){let V=C.keyframeNodes;for(let L=0;L<V.length;L++){let Z=V[L],G=Z.keyframe,I=Z.state;a[I][G]+=1,c[I]+=1,d++}if(l(C.children))for(let L=0;L<8;L++){let Z=C.children[L];u(Z)}}u(r);let h=`KEYFRAMES: ${a[$i.LoadState.LOADED]}`,p=`UNLOADED: ${c[$i.LoadState.UNLOADED]} | RECEIVING: ${c[$i.LoadState.RECEIVING]} | RECEIVED: ${c[$i.LoadState.RECEIVED]} | LOADED: ${c[$i.LoadState.LOADED]} | FAILED: ${c[$i.LoadState.FAILED]} | UNAVAILABLE: ${c[$i.LoadState.UNAVAILABLE]} | TOTAL: ${d}`,g=Math.round(t*100)/100,f=Math.round(n*100)/100,x=Math.round(i*100)/100,_=`LOAD: ${g} | OCT: ${f} | ALL: ${x}`;console.log(`${h} || ${p} || ${_}`)}var WB={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function igt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,d=[],u=[];function h(g,f,x,_,C){let V=!1;if(l(g.children))for(let L=0;L<8;L++){let Z=g.children[L];Z.computeSurroundingRenderableKeyframeNodes(o),Z.isRenderable(r)&&(V=!0)}if(V){d[C]=WB.INTERNAL<<16|f,d[x]=_,a++,_=f,C=_*9+1;for(let L=0;L<8;L++){let Z=g.children[L];f=a,x=f*9+0,h(Z,f,x,_,C+L)}}else{if(s){let L=c*5,Z=g.renderableKeyframeNodePrevious,G=g.level-Z.spatialNode.level,I=Z.spatialNode.parent,v=l(I)?I.renderableKeyframeNodePrevious:Z,P=ogt(g,i,n),w=G,F=1,b=Z.megatextureIndex,R=v.megatextureIndex;u[L+0]=P,u[L+1]=w,u[L+2]=F,u[L+3]=b,u[L+4]=R,d[C]=WB.LEAF<<16|c}else{let L=g.renderableKeyframeNodePrevious,G=g.level-L.spatialNode.level===0?WB.LEAF:WB.PACKED_LEAF_FROM_PARENT;d[C]=G<<16|L.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),rgt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&sgt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function ogt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return W.clamp(s,0,1)}function rgt(e,t,n,i){let o=nt.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],g=h*o;for(let f=0;f<o;f++)c[g+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function sgt(e,t,n,i){let o=nt.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let g=e[p*r+0],f=e[p*r+1],x=e[p*r+2],_=e[p*r+3],C=e[p*r+4],V=W.clamp(Math.floor(65536*g),0,65535);d[p*8+0]=V>>>0&255,d[p*8+1]=V>>>8&255,d[p*8+2]=f&255,d[p*8+3]=x&255,d[p*8+4]=_>>>0&255,d[p*8+5]=_>>>8&255,d[p*8+6]=C>>>0&255,d[p*8+7]=C>>>8&255}let h={source:{arrayBufferView:d,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(h)}_0.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],d=ut.getComponentCount(a);o+=iL.getApproximateTextureMemoryByteLength(e,t,d,c)}return o};var oL=_0;var iOi=T(S(),1);var v3i=T(S(),1),agt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},rL=Object.freeze(agt);var z3i=T(S(),1);var F3i=T(S(),1);function cgt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var KA=cgt;function sL(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}sL.prototype.getTexture=function(e){return this._textures[e]};function lgt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}sL.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):lgt(this,e,t)};function dgt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?PB(o,r,n):ugt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function PB(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?gTe(e,n):new Wt({context:n,source:t,sampler:o});return bTe(o)&&r.generateMipmap(),r}function ugt(e,t,n){let{typedArray:i,sampler:o}=e,r=bTe(o),s=o.wrapS===Vn.REPEAT||o.wrapS===Vn.MIRRORED_REPEAT||o.wrapT===Vn.REPEAT||o.wrapT===Vn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,d=[a,c].every(W.isPowerOfTwo);if((r||s)&&!d)if(l(i)){if(e.pixelDatatype===je.UNSIGNED_BYTE){let h=KA(i,a,c),p=dg(h);return PB({sampler:o},p,n)}}else{let h=dg(t);return PB(e,h,n)}else return PB(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),gTe(e,n)}function bTe(e){return[qt.NEAREST_MIPMAP_NEAREST,qt.NEAREST_MIPMAP_LINEAR,qt.LINEAR_MIPMAP_NEAREST,qt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function gTe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Wt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}sL.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];dgt(this,o,t)}n.length=0};sL.prototype.isDestroyed=function(){return!1};sL.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return me(this)};var JA=sL;function QA(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,fb.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,Zg.INHERIT),this._textureManager=new JA,this._defaultTexture=void 0,this.uniformMap=mgt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},pgt(this),bgt(this)}function mgt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===rL.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=hgt(e,i)):n[i]=fgt(e,i)}return n}function hgt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function fgt(e,t){return function(){return e.uniforms[t].value}}function eS(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function pgt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,eS(r,t,o),o=e.usedVariablesVertex.featureIdSet,eS(r,n,o),o=e.usedVariablesVertex.metadataSet,eS(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,eS(s,t,o),o=e.usedVariablesFragment.featureIdSet,eS(s,n,o),o=e.usedVariablesFragment.metadataSet,eS(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;eS(s,a,c)}}function yTe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function Rc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${yTe(t)} is not available in the ${i} shader. Did you mean ${yTe(n)} instead?`;throw new pe(o)}}function bgt(e){let t=e.usedVariablesVertex.attributeSet;Rc(t,"position","positionMC","vertex"),Rc(t,"normal","normalMC","vertex"),Rc(t,"tangent","tangentMC","vertex"),Rc(t,"bitangent","bitangentMC","vertex"),Rc(t,"positionWC","positionMC","vertex"),Rc(t,"positionEC","positionMC","vertex"),Rc(t,"normalEC","normalMC","vertex"),Rc(t,"tangentEC","tangentMC","vertex"),Rc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Rc(n,"position","positionEC","fragment"),Rc(n,"normal","normalEC","fragment"),Rc(n,"tangent","tangentEC","fragment"),Rc(n,"bitangent","bitangentEC","fragment"),Rc(n,"normalMC","normalEC","fragment"),Rc(n,"tangentMC","tangentEC","fragment"),Rc(n,"bitangentMC","bitangentEC","fragment")}QA.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===rL.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};QA.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};QA.prototype.isDestroyed=function(){return!1};QA.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),me(this)};var tS=QA;function lp(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,lp.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._exaggeratedMinBounds=new m,this._exaggeratedMinBoundsOld=new m,this._exaggeratedMaxBounds=new m,this._exaggeratedMaxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._exaggeratedModelMatrix=M.clone(this._modelMatrix),this._compoundModelMatrix=new M,this._compoundModelMatrixOld=new M,this._customShader=y(e.customShader,lp.DefaultCustomShader),this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new M,this._transformPositionUvToWorld=new M,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new sh,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new D,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new D,megatextureTextures:[],megatextureSliceDimensions:new D,megatextureTileDimensions:new D,megatextureVoxelSizeUv:new D,megatextureSliceSizeUv:new D,megatextureTileSizeUv:new D,dimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new M,transformPositionUvToView:new M,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,stepSize:0,pickColor:new B},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;ggt(this,i)}function ggt(e,t){let{shape:n,minBounds:i=Ai.getMinBounds(n),maxBounds:o=Ai.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=Ai.getMinBounds(n),e.maxClippingBounds=Ai.getMaxBounds(n),e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=M.clone(e._modelMatrix,e._exaggeratedModelMatrix),_Te(e,t);let r=Ai.getShapeConstructor(n);e._shape=new r,e._shapeVisible=TTe(e,e._shape,t)}Object.defineProperties(lp.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=W.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){fs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=lp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var ygt=new m,xgt=new se,_gt=new se,Tgt=new m,Sgt=new m,Cgt=new $,Vgt=new $,Lgt=new M,Rgt=new M,Zgt=new M,Ggt=M.fromRotationTranslation($.fromUniformScale(.5,new $),new m(.5,.5,.5),new M),Egt=M.fromRotationTranslation($.fromUniformScale(2,new $),new m(-1,-1,-1),new M);lp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){wgt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}Pgt(this,e);let i=_Te(this,t),o=this._shape;if(i&&(this._shapeVisible=TTe(this,o,t),Mgt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Ngt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&zgt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),kgt(this,e)&&(this._shaderDirty=!0);let d=s.leafNodeTexture,u=this._uniforms;l(d)&&(u.octreeLeafNodeTexture=s.leafNodeTexture,u.octreeLeafNodeTexelSizeUv=D.clone(s.leafNodeTexelSizeUv,u.octreeLeafNodeTexelSizeUv),u.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(OA(this,n),this._shaderDirty=!1);let h=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=Bgt(p,h,_gt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;u.ndcSpaceAxisAlignedBoundingBox=se.clone(g,u.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;u.transformPositionViewToUv=M.multiplyTransformation(this._transformPositionWorldToUv,x,u.transformPositionViewToUv);let _=n.uniformState.view;u.transformPositionUvToView=M.multiplyTransformation(_,this._transformPositionUvToWorld,u.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;u.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,C,u.transformDirectionViewToLocal),u.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,u.transformNormalLocalToWorld);let V=e.camera.positionWC;u.cameraPositionUv=M.multiplyByPoint(this._transformPositionWorldToUv,V,u.cameraPositionUv),u.stepSize=this._stepSizeMultiplier;let L=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;L.boundingVolume=o.boundingSphere,e.commandList.push(L)};var Igt=new m,_8=new m,Xgt=new he,Wgt=new m;function Pgt(e,t){if(e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===Ai.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else if(e.shape===Ai.BOX){let n=m.fromElements(1,1,t.verticalExaggeration,Igt);e._exaggeratedModelMatrix=M.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=M.multiplyByTranslation(e._exaggeratedModelMatrix,vgt(e,t),e._exaggeratedModelMatrix)}}function vgt(e,t){let{shapeTransform:n=M.IDENTITY,globalTransform:i=M.IDENTITY}=e._provider,o=M.getTranslation(n,_8),r=M.multiplyByPoint(e._modelMatrix,o,_8),s=M.multiplyByPoint(i,r,_8),c=ne.WGS84.cartesianToCartographic(s,Xgt),d=0;l(c)&&(d=c.height);let u=Tr.getHeight(d,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return m.fromElements(0,0,(u-d)/t.verticalExaggeration,Wgt)}function wgt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=B.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ye(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=m.clone(t.dimensions,i.dimensions),e._paddingBefore=m.clone(y(t.paddingBefore,m.ZERO),e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(y(t.paddingAfter,m.ZERO),e._paddingBefore),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._traversal=Fgt(e,t,n),Agt(e._traversal,i)}function _Te(e,t){let n=y(t.shapeTransform,M.IDENTITY),i=y(t.globalTransform,M.IDENTITY);return M.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),M.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),nS(e,"_compoundModelMatrix","_compoundModelMatrixOld")+nS(e,"_minBounds","_minBoundsOld")+nS(e,"_maxBounds","_maxBoundsOld")+nS(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+nS(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+nS(e,"_minClippingBounds","_minClippingBoundsOld")+nS(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function nS(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function TTe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=M.inverse(o,Lgt),s=M.getRotation(o,Cgt),a=M.getScale(o,Tgt),c=m.maximumComponent(a),d=m.divideByScalar(a,c,Sgt),u=$.multiplyByScale(s,d,Vgt);return e._transformPositionWorldToUv=M.multiplyTransformation(Ggt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=M.multiplyTransformation(o,Egt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=M.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(u,e._transformNormalLocalToWorld),!0}function Fgt(e,t,n){let i=m.clone(t.dimensions,ygt);m.add(i,e._paddingBefore,i),m.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?oL.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new oL(e,n,i,t.types,t.componentTypes,s,r)}function Agt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=D.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=D.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=D.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=D.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=D.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=D.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function Mgt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ye(n,!0)),i}function Ngt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=q.secondsDifference(i.stop,i.start),a=q.secondsDifference(n,i.start)/r;return o+a}function kgt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=M.transpose(M.multiplyTransformation(M.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),me(this)};var xTe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),Ugt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),Dgt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function Bgt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,Rgt),o=M.multiply(t,i,Zgt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=Dgt,h=xTe.length;for(d=0;d<h;d++)M.multiplyByVector(o,xTe[d],u[d]);for(d=0;d<h;d++){let p=u[d];if(p.z>=-p.w){let g=p.x/p.w,f=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,f),c=Math.max(c,f)}else for(let g=0;g<3;g++){let f=Ugt[d*3+g],x=u[f];if(x.z>=-x.w){let _=p.z+p.w,C=x.z+x.w,V=_/(_-C),L=se.lerp(p,x,V,xgt),Z=L.x/L.w,G=L.y/L.w;r=Math.min(r,Z),s=Math.max(s,Z),a=Math.min(a,G),c=Math.max(c,G)}}}return r=W.clamp(r,-1,1),a=W.clamp(a,-1,1),s=W.clamp(s,-1,1),c=W.clamp(c,-1,1),n=se.fromElements(r,a,s,c,n),n}var T8=3e7,Ogt=new m(T8,0,0),Ygt=new m(0,T8,0),Hgt=new m(0,0,T8);function zgt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,d,u,h){i.add({positions:[c,d],width:h,material:Hi.fromType("Color",{color:u})})}function r(c,d,u){let h=c.computeCorners();o(h[0],h[1],d,u),o(h[2],h[3],d,u),o(h[4],h[5],d,u),o(h[6],h[7],d,u),o(h[0],h[2],d,u),o(h[4],h[6],d,u),o(h[1],h[3],d,u),o(h[5],h[7],d,u),o(h[0],h[4],d,u),o(h[2],h[6],d,u),o(h[1],h[5],d,u),o(h[3],h[7],d,u)}function s(c){if(!n.isRenderable(c))return;let d=c.level,h=Math.max(1,5/Math.pow(2,d)),g=[B.RED,B.LIME,B.BLUE][d%3];if(r(c.orientedBoundingBox,g,h),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,B.WHITE,5),s(n.rootNode);let a=10;o(m.ZERO,Ogt,B.RED,a),o(m.ZERO,Ygt,B.LIME,a),o(m.ZERO,Hgt,B.BLUE,a),i.update(t)}lp.DefaultCustomShader=new tS({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;function g0t(e){let t=new _x;this.shaderBuilder=t;let n=e._customShader,i=Tt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,ye.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ye.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([_A]),t.addFragmentLines([n.fragmentShaderText,"#line 0",IA,yA,TA,XA]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ye.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ye.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ye.FRAGMENT),t.addFragmentLines([CA])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ye.FRAGMENT),t.addFragmentLines([SA]));let a=e._provider.shape;a==="BOX"?t.addFragmentLines([ZA,VA,$T]):a==="CYLINDER"?t.addFragmentLines([GA,oL,LA,$T]):a==="ELLIPSOID"&&(t.addDefine("SHAPE_ELLIPSOID",void 0,ye.FRAGMENT),t.addFragmentLines([EA,oL,RA,$T])),t.addFragmentLines([xA]);let c=e._shape,d=c.shaderDefines;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,ye.FRAGMENT))}let u=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,ye.FRAGMENT),s===1?u+=1:r.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,ye.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,ye.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,ye.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ye.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ye.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,ye.FRAGMENT)}var WA=g0t;var fDi=T(S(),1);function y0t(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,d=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,ye.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,ye.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=o[P],b=`PropertyStatistics_${w}`,R=`PropertyStatistics_${w}`;n.addStruct(b,R,ye.FRAGMENT);let E=EB(F);n.addStructField(b,E,"min"),n.addStructField(b,E,"max")}let u="Statistics",h="Statistics",p="statistics";n.addStruct(u,h,ye.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=`PropertyStatistics_${w}`,b=w;n.addStructField(u,F,b)}let g="Metadata",f="Metadata",x="metadata";n.addStruct(g,f,ye.FRAGMENT),n.addStructField(g,h,p);for(let P=0;P<c;P++){let w=i[P],F=o[P],b=EB(F);n.addStructField(g,b,w)}for(let P=0;P<c;P++){let w=i[P],F=o[P],b=_0t(F),R=`VoxelProperty_${w}`,E=`VoxelProperty_${w}`;n.addStruct(R,E,ye.FRAGMENT),n.addStructField(R,b,"partialDerivativeLocal"),n.addStructField(R,b,"partialDerivativeWorld"),n.addStructField(R,b,"partialDerivativeView"),n.addStructField(R,b,"partialDerivativeValid")}let _="Voxel",C="Voxel",V="voxel";n.addStruct(_,C,ye.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=`VoxelProperty_${w}`;n.addStructField(_,F,w)}n.addStructField(_,"vec3","positionEC"),n.addStructField(_,"vec3","positionUv"),n.addStructField(_,"vec3","positionShapeUv"),n.addStructField(_,"vec3","positionUvLocal"),n.addStructField(_,"vec3","viewDirUv"),n.addStructField(_,"vec3","viewDirWorld"),n.addStructField(_,"vec3","surfaceNormal"),n.addStructField(_,"float","travelDistance"),n.addStructField(_,"int","stepCount"),n.addStructField(_,"int","tileIndex"),n.addStructField(_,"int","sampleIndex");let L="FragmentInput";n.addStruct(L,"FragmentInput",ye.FRAGMENT),n.addStructField(L,f,x),n.addStructField(L,C,V);let G="Properties",I="Properties",v="properties";n.addStruct(G,I,ye.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=o[P],b=EB(F);n.addStructField(G,b,w)}{let P="clearProperties";n.addFunction(P,`${I} clearProperties()`,ye.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w],b=o[w],R=r[w],E=EB(b,R);n.addFunctionLines(P,[`${v}.${F} = ${E}(0.0);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="sumProperties";n.addFunction(P,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,ye.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`${v}.${F} = propertiesA.${F} + propertiesB.${F};`])}n.addFunctionLines(P,[`return ${v};`])}{let P="scaleProperties";n.addFunction(P,`${I} scaleProperties(${I} ${v}, float scale)`,ye.FRAGMENT),n.addFunctionLines(P,[`${I} scaledProperties = ${v};`]);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`scaledProperties.${F} *= scale;`])}n.addFunctionLines(P,["return scaledProperties;"])}{let P="mixProperties";n.addFunction(P,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,ye.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`${v}.${F} = mix(propertiesA.${F}, propertiesB.${F}, mixFactor);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="copyPropertiesToMetadata";n.addFunction(P,`void copyPropertiesToMetadata(in ${I} ${v}, inout ${f} ${x})`,ye.FRAGMENT);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`${x}.${F} = ${v}.${F};`])}}if(d){let P="setStatistics";n.addFunction(P,`void setStatistics(inout ${h} ${p})`,ye.FRAGMENT);for(let w=0;w<c;w++){let F=i[w],b=o[w],R=dt.getComponentCount(b);for(let E=0;E<R;E++){let X=T0t(b,E),A=s[w][E],N=a[w][E];n.addFunctionLines(P,[`${p}.${F}.min${X} = ${$_e(A)};`,`${p}.${F}.max${X} = ${$_e(N)};`])}}}{let P="getPropertiesFromMegatextureAtUv";n.addFunction(P,`${I} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ye.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w],b=o[w],R=r[w],E=x0t(b,R);n.addFunctionLines(P,[`properties.${F} = texture(u_megatextureTextures[${w}], texcoord)${E};`])}n.addFunctionLines(P,[`return ${v};`])}}function EB(e){if(e===dt.SCALAR)return"float";if(e===dt.VEC2)return"vec2";if(e===dt.VEC3)return"vec3";if(e===dt.VEC4)return"vec4"}function x0t(e){if(e===dt.SCALAR)return".r";if(e===dt.VEC2)return".ra";if(e===dt.VEC3)return".rgb";if(e===dt.VEC4)return""}function _0t(e){if(e===dt.SCALAR)return"vec3";if(e===dt.VEC2)return"mat2";if(e===dt.VEC3)return"mat3";if(e===dt.VEC4)return"mat4"}function $_e(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function T0t(e,t){return e===dt.SCALAR?"":`[${t}]`}var PA=y0t;function S0t(e,t){let n=new WA(e);PA(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let C="getClippingPlane",V=r0(o,t),L=0,Z=V.indexOf(")")+1,G=V.indexOf("{",Z)+1,I=V.indexOf("}",G),v=V.slice(L,Z),P=V.slice(G,I);i.addFunction(C,v,ye.FRAGMENT),i.addFunctionLines(C,[P])}let s=i.clone();s.addDefine("PICKING",void 0,ye.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ye.FRAGMENT);let c=i.buildShaderProgram(t),d=s.buildShaderProgram(t),u=a.buildShaderProgram(t),h=Ue.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,f=new qe({vertexArray:p,primitiveType:we.TRIANGLES,renderState:h,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ee.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),x=qe.shallowClone(f,new qe);x.shaderProgram=d,x.pickOnly=!0;let _=qe.shallowClone(f,new qe);if(_.shaderProgram=u,_.pickOnly=!0,l(e._drawCommand)){let C=e._drawCommand;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPick)){let C=e._drawCommandPick;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let C=e._drawCommandPickVoxel;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}e._drawCommand=f,e._drawCommandPick=x,e._drawCommandPickVoxel=_}var vA=S0t;var dBi=T(S(),1);var FDi=T(S(),1);function td(){this.orientedBoundingBox=new Gn,this.boundingSphere=new le,this.boundTransform=new M,this.shapeTransform=new M,this._minBounds=m.clone(td.DefaultMinBounds,new m),this._maxBounds=m.clone(td.DefaultMaxBounds,new m),this.shaderUniforms={renderMinBounds:new m,renderMaxBounds:new m,boxUvToShapeUvScale:new m,boxUvToShapeUvTranslate:new m},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var C0t=new m,h8=new m,V0t=new $,L0t=new m,R0t=new m,Z0t=new m,G0t=new m,eTe=M.fromRotationTranslation($.fromUniformScale(.5,new $),new m(.5,.5,.5),new M);td.prototype.update=function(e,t,n,i,o){i=y(i,td.DefaultMinBounds),o=y(o,td.DefaultMaxBounds);let r=td.DefaultMinBounds,s=td.DefaultMaxBounds;t=this._minBounds=m.clamp(t,r,s,this._minBounds),n=this._maxBounds=m.clamp(n,r,s,this._maxBounds),i=m.clamp(i,r,s,L0t),o=m.clamp(o,r,s,R0t);let a=m.clamp(t,i,o,Z0t),c=m.clamp(n,i,o,G0t),d=M.getScale(e,h8);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||d.x===0||d.y===0||d.z===0)return!1;this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=p8(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:u,shaderDefines:h}=this;for(let f in h)h.hasOwnProperty(f)&&(h[f]=void 0);let p=!m.equals(t,r)||!m.equals(n,s),g=0;if(h.BOX_INTERSECTION_INDEX=g,g+=1,u.renderMinBounds=M.multiplyByPoint(eTe,a,u.renderMinBounds),u.renderMaxBounds=M.multiplyByPoint(eTe,c,u.renderMaxBounds),p){h.BOX_HAS_SHAPE_BOUNDS=!0;let f=t,x=n;u.boxUvToShapeUvScale=m.fromElements(2/(f.x===x.x?1:x.x-f.x),2/(f.y===x.y?1:x.y-f.y),2/(f.z===x.z?1:x.z-f.z),u.boxUvToShapeUvScale),u.boxUvToShapeUvTranslate=m.fromElements(-u.boxUvToShapeUvScale.x*(f.x*.5+.5),-u.boxUvToShapeUvScale.y*(f.y*.5+.5),-u.boxUvToShapeUvScale.z*(f.z*.5+.5),u.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var IB=new m,f8=new m;td.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=m.fromElements(W.lerp(r.x,s.x,a*t),W.lerp(r.y,s.y,a*n),W.lerp(r.z,s.z,a*i),IB),d=m.fromElements(W.lerp(r.x,s.x,a*(t+1)),W.lerp(r.y,s.y,a*(n+1)),W.lerp(r.z,s.z,a*(i+1)),f8);return p8(c,d,this.shapeTransform,o)};var tTe=new m;td.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,tTe),s=m.multiplyByScalar(r,o,tTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,IB),o,IB),c=m.add(a,s,f8),d=this._minBounds,u=this._maxBounds,h=m.fromElements(W.lerp(d.x,u.x,a.x),W.lerp(d.y,u.y,a.y),W.lerp(d.z,u.z,a.z),IB),p=m.fromElements(W.lerp(d.x,u.x,c.x),W.lerp(d.y,u.y,c.y),W.lerp(d.z,u.z,c.z),f8);return p8(h,p,this.shapeTransform,i)};td.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));td.DefaultMaxBounds=Object.freeze(new m(1,1,1));function p8(e,t,n,i){let o=td.DefaultMinBounds,r=td.DefaultMaxBounds;if(m.equals(e,o)&&m.equals(t,r))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let a=M.getScale(n,h8),c=m.midpoint(e,t,C0t);i.center=M.multiplyByPoint(n,c,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),h8);let d=M.getRotation(n,V0t);i.halfAxes=$.setScale(d,a,i.halfAxes)}return i}var cp=td;var zDi=T(S(),1);function rs(){this.orientedBoundingBox=new Gn,this.boundingSphere=new le,this.boundTransform=new M,this.shapeTransform=new M,this._minimumRadius=rs.DefaultMinBounds.x,this._maximumRadius=rs.DefaultMaxBounds.x,this._minimumHeight=rs.DefaultMinBounds.y,this._maximumHeight=rs.DefaultMaxBounds.y,this._minimumAngle=rs.DefaultMinBounds.z,this._maximumAngle=rs.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderHeightMinMax:new D,cylinderRenderRadiusMinMax:new D,cylinderRenderAngleMinMax:new D,cylinderUvToShapeUvRadius:new D,cylinderUvToShapeUvHeight:new D,cylinderUvToShapeUvAngle:new D,cylinderShapeUvAngleMinMax:new D,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var rTe=new m;rs.prototype.update=function(e,t,n,i,o){i=y(i,rs.DefaultMinBounds),o=y(o,rs.DefaultMaxBounds);let r=rs.DefaultMinBounds.x,s=rs.DefaultMaxBounds.x,a=rs.DefaultMinBounds.y,c=rs.DefaultMaxBounds.y,d=rs.DefaultMinBounds.z,u=rs.DefaultMaxBounds.z,h=u-d,p=.5*h,g=W.EPSILON10,f=W.EPSILON3,x=W.EPSILON10,_=W.clamp(t.x,r,s),C=W.clamp(n.x,r,s),V=W.clamp(i.x,r,s),L=W.clamp(o.x,r,s),Z=Math.max(_,V),G=Math.min(C,L),I=W.clamp(t.y,a,c),v=W.clamp(n.y,a,c),P=W.clamp(i.y,a,c),w=W.clamp(o.y,a,c),F=Math.max(I,P),b=Math.min(v,w),R=W.negativePiToPi(t.z),E=W.negativePiToPi(n.z),X=W.negativePiToPi(i.z),A=W.negativePiToPi(o.z),N=Math.max(R,X),O=Math.min(E,A),U=M.getScale(e,rTe);if(G===0||Z>G||F>b||W.equalsEpsilon(U.x,0,void 0,g)||W.equalsEpsilon(U.y,0,void 0,g)||W.equalsEpsilon(U.z,0,void 0,g))return!1;this._minimumRadius=_,this._maximumRadius=C,this._minimumHeight=I,this._maximumHeight=v,this._minimumAngle=R,this._maximumAngle=E,this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=g8(Z,G,F,b,N,O,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let H=_===r&&C===s,J=I===a&&v===c,te=E<R,z=E-R+te*h,j=z>p+x&&z<h-x,ee=z<p-x,fe=z>=p-x&&z<=p+x,Te=j||ee||fe,de=W.equalsEpsilon(R,d,void 0,f),xe=W.equalsEpsilon(E,u,void 0,f),Se=Z===r,Ie=O<N,Le=O-N+Ie*h,ke=Le>=p-x&&Le<h-x,Be=Le>x&&Le<p-x,it=Le<=x,Gt=ke||Be||it,{shaderUniforms:gt,shaderDefines:Ne}=this;for(let Lt in Ne)Ne.hasOwnProperty(Lt)&&(Ne[Lt]=void 0);let Kt=0;if(Ne.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Kt,Kt+=1,Se||(Ne.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Ne.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Kt,Kt+=1),gt.cylinderRenderRadiusMinMax=D.fromElements(Z,G,gt.cylinderRenderRadiusMinMax),Z===G&&(Ne.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!H){Ne.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Lt=C-_,ut=0,zn=1;Lt!==0&&(ut=1/Lt,zn=-_/Lt),gt.cylinderUvToShapeUvRadius=D.fromElements(ut,zn,gt.cylinderUvToShapeUvRadius)}if(!J){Ne.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Lt=v-I,ut=0,zn=1;Lt!==0&&(ut=2/Lt,zn=-(I+1)/Lt),gt.cylinderUvToShapeUvHeight=D.fromElements(ut,zn,gt.cylinderUvToShapeUvHeight)}if(gt.cylinderRenderHeightMinMax=D.fromElements(F,b,gt.cylinderRenderHeightMinMax),te&&(Ne.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Gt&&(Ne.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Ne.CYLINDER_INTERSECTION_INDEX_ANGLE=Kt,ke?(Ne.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Kt+=1):Be?(Ne.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Kt+=2):it&&(Ne.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Kt+=2),gt.cylinderRenderAngleMinMax=D.fromElements(N,O,gt.cylinderRenderAngleMinMax)),Te){Ne.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,de&&(Ne.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),xe&&(Ne.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Lt=(R-d)/h,ut=(E-d)/h,zn=1-z/h;if(gt.cylinderShapeUvAngleMinMax=D.fromElements(Lt,ut,gt.cylinderShapeUvAngleMinMax),gt.cylinderShapeUvAngleRangeZeroMid=(ut+.5*zn)%1,z<=x)gt.cylinderUvToShapeUvAngle=D.fromElements(0,1,gt.cylinderUvToShapeUvAngle);else{let cn=h/z,be=-(R-d)/z;gt.cylinderUvToShapeUvAngle=D.fromElements(cn,be,gt.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=Kt,!0};rs.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,d=this._minimumAngle,u=this._maximumAngle,h=1/Math.pow(2,e),p=W.lerp(r,s,t*h),g=W.lerp(r,s,(t+1)*h),f=W.lerp(a,c,n*h),x=W.lerp(a,c,(n+1)*h),_=W.lerp(d,u,i*h),C=W.lerp(d,u,(i+1)*h);return g8(p,g,f,x,_,C,this.shapeTransform,o)};var nTe=new m,iTe=new m,E0t=new m;rs.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,nTe),s=m.multiplyByScalar(r,o,nTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,iTe),o,iTe),c=m.add(a,s,E0t),d=this._minimumRadius,u=this._maximumRadius,h=this._minimumHeight,p=this._maximumHeight,g=this._minimumAngle,f=this._maximumAngle,x=W.lerp(d,u,a.x),_=W.lerp(d,u,c.x),C=W.lerp(h,p,a.y),V=W.lerp(h,p,c.y),L=W.lerp(g,f,a.z),Z=W.lerp(g,f,c.z);return g8(x,_,C,V,L,Z,this.shapeTransform,i)};rs.DefaultMinBounds=Object.freeze(new m(0,-1,-W.PI));rs.DefaultMaxBounds=Object.freeze(new m(1,1,+W.PI));var I0t=5,X0t=new Array(I0t),W0t=new m,P0t=new $,v0t=new M,w0t=new M,F0t=new M,b8=new M,A0t=new m,M0t=new m,N0t=new m,sTe=new Array(8);for(let e=0;e<8;e++)sTe[e]=new m;function oTe(e,t,n){return Math.abs(se.dot(e,t))<n}function k0t(e){let t=M.getColumn(e,0,A0t),n=M.getColumn(e,1,M0t),i=M.getColumn(e,2,N0t),o=W.EPSILON4;return oTe(t,n,o)&&oTe(n,i,o)}function U0t(e,t){let n=sTe;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)M.multiplyByPoint(e,n[i],n[i]);return Gn.fromPoints(n,t)}function g8(e,t,n,i,o,r,s,a){let c=rs.DefaultMinBounds,d=rs.DefaultMaxBounds,u=c.x,h=d.x,p=c.y,g=d.y,f=c.z,x=d.z;if(e===u&&t===h&&n===p&&i===g&&o===f&&r===x)return a.center=M.getTranslation(s,a.center),a.halfAxes=M.getMatrix3(s,a.halfAxes),a;r<o&&(r+=W.TWO_PI);let C=r-o,V=o+C*.5,L=X0t,Z=0;L[Z++]=o,L[Z++]=r,L[Z++]=V,C>W.PI&&(L[Z++]=V-W.PI_OVER_TWO,L[Z++]=V+W.PI_OVER_TWO);let G=1,I=1,v=-1,P=-1;for(let te=0;te<Z;++te){let z=L[te]-V,j=Math.cos(z),ee=Math.sin(z),fe=j*e,Te=ee*e,de=j*t,xe=ee*t;G=Math.min(G,fe),I=Math.min(I,Te),G=Math.min(G,de),I=Math.min(I,xe),v=Math.max(v,fe),P=Math.max(P,Te),v=Math.max(v,de),P=Math.max(P,xe)}let w=v-G,F=P-I,b=i-n,R=(G+v)*.5,E=(I+P)*.5,X=(n+i)*.5,A=m.fromElements(R,E,X,W0t),N=$.fromRotationZ(V,P0t),O=m.fromElements(w,F,b,rTe),U=M.fromScale(O,F0t),Y=M.fromRotation(N,w0t),k=M.fromTranslation(A,v0t),H=M.multiplyTransformation(Y,M.multiplyTransformation(k,U,b8),b8),J=M.multiplyTransformation(s,H,b8);return k0t(J)?Gn.fromTransformation(J,a):U0t(J,a)}var lp=rs;var rBi=T(S(),1);function _0(){this.orientedBoundingBox=new Gn,this.boundingSphere=new le,this.boundTransform=new M,this.shapeTransform=new M,this._rectangle=new ce,this._minimumHeight=_0.DefaultMinBounds.z,this._maximumHeight=_0.DefaultMaxBounds.z,this._ellipsoid=new ne,this._translation=new m,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new m,eccentricitySquared:0,evoluteScale:new D,ellipsoidInverseRadiiSquaredUv:new m,ellipsoidRenderLongitudeMinMax:new D,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidUvToShapeUvLongitude:new D,ellipsoidUvToShapeUvLatitude:new D,ellipsoidRenderLatitudeSinMinMax:new D,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new D},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var D0t=new m,B0t=new m,O0t=new m,Y0t=new m,H0t=new m,z0t=new m,K0t=new m,J0t=new m,Q0t=new $,aTe=new m,cTe=new m,j0t=new ce;_0.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=_0;i=y(i,r),o=y(o,s);let a=W.EPSILON10,c=W.EPSILON3,d=W.EPSILON10,u=W.EPSILON10,h=W.EPSILON3,p=M.getScale(e,J0t),g=m.clone(r,D0t);g.z=-m.minimumComponent(p);let f=m.clamp(t,g,s,B0t),x=m.clamp(n,g,s,O0t),_=m.clamp(i,g,s,Y0t),C=m.clamp(o,g,s,H0t),V=m.maximumByComponent(f,_,z0t),L=m.minimumByComponent(x,C,K0t),Z=m.add(p,m.fromElements(x.z,x.z,x.z,aTe),aTe),G=m.maximumComponent(Z),I=m.add(p,m.fromElements(L.z,L.z,L.z,cTe),cTe);if(V.y>L.y||V.y===s.y||L.y===r.y||V.z>L.z||W.equalsEpsilon(I,m.ZERO,void 0,a))return!1;this._rectangle=ce.fromRadians(f.x,f.y,x.x,x.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=ne.fromCartesian3(p,this._ellipsoid),this._minimumHeight=f.z,this._maximumHeight=x.z;let v=ce.fromRadians(V.x,V.y,L.x,L.y,j0t);this.orientedBoundingBox=y8(v,V.z,L.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=M.fromRotationTranslation($.setScale(this._rotation,Z,Q0t),this._translation,this.shapeTransform),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let P=s.x-r.x,w=.5*P,F=L.x<V.x,b=L.x-V.x+F*P,R=b<=d,E=b>=w-d&&b<P-d,X=b>d&&b<w-d,A=R||E||X,N=x.x<f.x,O=x.x-f.x+N*P,U=O>w+d&&O<P-d,Y=O>=w-d&&O<=w+d,k=O<w-d,H=U||Y||k,J=L.y<-h,te=L.y>=-h&&L.y<=+h,z=L.y>+h&&L.y<s.y-u,j=J||te||z,ee=V.y>r.y+u&&V.y<-h,fe=V.y>=-h&&V.y<=+h,Te=V.y>+h,de=ee||fe||Te,xe=j||de,Se=x.y-f.y,Ie=x.y<-h,Le=x.y>=-h&&x.y<=+h,ke=x.y>+h&&x.y<s.y-u,Be=Ie||Le||ke,it=f.y>r.y+u&&f.y<-h,Gt=f.y>=-h&&f.y<=+h,gt=f.y>+h,Kt=Be||(it||Gt||gt),{shaderUniforms:Lt,shaderDefines:ut}=this;for(let ht in ut)ut.hasOwnProperty(ht)&&(ut[ht]=void 0);Lt.ellipsoidRadiiUv=m.divideByScalar(Z,G,Lt.ellipsoidRadiiUv);let{x:zn,z:cn}=Lt.ellipsoidRadiiUv,be=cn/zn;Lt.eccentricitySquared=1-be*be,Lt.evoluteScale=D.fromElements((zn*zn-cn*cn)/zn,(cn*cn-zn*zn)/cn,Lt.evoluteScale),Lt.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(Lt.ellipsoidRadiiUv,Lt.ellipsoidRadiiUv,Lt.ellipsoidInverseRadiiSquaredUv),Lt.ellipsoidInverseRadiiSquaredUv);let Ve=0;ut.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ve,Ve+=1,ut.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ve,Ve+=1,Lt.clipMinMaxHeight=D.fromElements((V.z-x.z)/G,(L.z-x.z)/G,Lt.clipMinMaxHeight);let bn=(x.z-f.z)/G;if(Lt.ellipsoidInverseHeightDifferenceUv=1/bn,f.z===x.z&&(Lt.ellipsoidInverseHeightDifferenceUv=0),A&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,ut.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ve,E?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ve+=1):X?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ve+=2):R&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ve+=2),Lt.ellipsoidRenderLongitudeMinMax=D.fromElements(V.x,L.x,Lt.ellipsoidRenderLongitudeMinMax)),H)if(ut.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,x.x<f.x&&(ut.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),O<=d)Lt.ellipsoidUvToShapeUvLongitude=D.fromElements(0,1,Lt.ellipsoidUvToShapeUvLongitude);else{let so=P/O,Eo=-(f.x-r.x)/O;Lt.ellipsoidUvToShapeUvLongitude=D.fromElements(so,Eo,Lt.ellipsoidUvToShapeUvLongitude)}if(A){let ht=W.equalsEpsilon(V.x,r.x,void 0,c),so=W.equalsEpsilon(L.x,s.x,void 0,c);ht&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),so&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Eo=(f.x-r.x)/P,ia=(x.x-r.x)/P,Gr=(L.x-r.x)/P,_s=1-b/P,Fe=(Gr+.5*_s)%1;Lt.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(Eo,ia,Fe,Lt.ellipsoidShapeUvLongitudeMinMaxMid)}if(xe&&(de&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,ut.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ve,ee?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ve+=1):fe?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ve+=1):Te&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ve+=2)),j&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,ut.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ve,J?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ve+=2):te?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ve+=1):z&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ve+=1)),Lt.ellipsoidRenderLatitudeSinMinMax=D.fromElements(Math.sin(V.y),Math.sin(L.y),Lt.ellipsoidRenderLatitudeSinMinMax)),Kt)if(ut.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Se<u)Lt.ellipsoidUvToShapeUvLatitude=D.fromElements(0,1,Lt.ellipsoidUvToShapeUvLatitude);else{let so=(s.y-r.y)/Se,Eo=(r.y-f.y)/Se;Lt.ellipsoidUvToShapeUvLatitude=D.fromElements(so,Eo,Lt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Ve,!0};var uTe=new ce;_0.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,d=(n+1)*r,u=i*r,h=(i+1)*r,p=ce.subsection(this._rectangle,s,c,a,d,uTe),g=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,h);return y8(p,g,f,this._ellipsoid,this._translation,this._rotation,o)};var lTe=new m,dTe=new m,q0t=new m;_0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,lTe),s=m.multiplyByScalar(r,o,lTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,dTe),o,dTe),c=m.add(a,s,q0t),d=ce.subsection(this._rectangle,a.x,a.y,c.x,c.y,uTe),u=W.lerp(this._minimumHeight,this._maximumHeight,a.z),h=W.lerp(this._minimumHeight,this._maximumHeight,c.z);return y8(d,u,h,this._ellipsoid,this._translation,this._rotation,i)};function y8(e,t,n,i,o,r,s){return s=Gn.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}_0.DefaultMinBounds=Object.freeze(new m(-W.PI,-W.PI_OVER_TWO,-ne.WGS84.minimumRadius));_0.DefaultMaxBounds=Object.freeze(new m(W.PI,W.PI_OVER_TWO,10*ne.WGS84.maximumRadius));var eS=_0;var ou={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};ou.getMinBounds=function(e){switch(e){case ou.BOX:return cp.DefaultMinBounds;case ou.ELLIPSOID:return eS.DefaultMinBounds;case ou.CYLINDER:return lp.DefaultMinBounds}};ou.getMaxBounds=function(e){switch(e){case ou.BOX:return cp.DefaultMaxBounds;case ou.ELLIPSOID:return eS.DefaultMaxBounds;case ou.CYLINDER:return lp.DefaultMaxBounds}};ou.getShapeConstructor=function(e){switch(e){case ou.BOX:return cp;case ou.ELLIPSOID:return eS;case ou.CYLINDER:return lp}};var Mi=Object.freeze(ou);var uOi=T(S(),1);var fBi=T(S(),1);function kh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(kh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});kh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new kh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};kh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};kh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)mTe(this,t)};kh.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,mTe(this,i),t};kh.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],hTe(this,0)),this._array[e-1]=void 0,t};kh.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=x8(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&hTe(this,n)}return this._array[e-1]=void 0,t};kh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};kh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[x8(this,1,2)?1:2]};function XB(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function wA(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function x8(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function mTe(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=wA(e,t,i);for(o!==n&&(XB(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(wA(e,t,r)!==o)break;XB(e,t,r),t=r}}function hTe(e,t){let n=e._length,i=Math.floor(W.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){wA(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let d=0;d<c;d++){let u=a+d;wA(e,u,r)===i&&(r=u)}}if(wA(e,r,t)===i&&(XB(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);x8(e,r,a)===i&&XB(e,r,a)}t=r}}var tS=kh;var bBi=T(S(),1),fTe=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function WB(e,t){this.spatialNode=e,this.keyframe=t,this.state=fTe.UNLOADED,this.metadata=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}WB.priorityComparator=function(e,t){return e.priority-t.priority};WB.searchComparator=function(e,t){return e.keyframe-t.keyframe};WB.LoadState=fTe;var $i=WB;var FBi=T(S(),1);function Py(e,t,n,i,o){i===kt.UNSIGNED_SHORT&&(i=kt.FLOAT32);let r=e.floatingPointTexture;if(i===kt.FLOAT32&&!r)throw new ae("Floating point texture not supported");let s;i===kt.FLOAT32||i===kt.FLOAT64?s=je.FLOAT:i===kt.UINT8&&(s=je.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?nt.RED:nt.LUMINANCE:n===2?a=e.webgl2?nt.RG:nt.LUMINANCE_ALPHA:n===3?a=nt.RGB:n===4&&(a=nt.RGBA);let c=512*1024*1024,d=128*1024*1024;o=Math.min(y(o,d),c);let u=Ft.maximumTextureSize,h=kt.getSizeInBytes(i),p=Math.floor(o/(n*h)),g=Math.min(u,W.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),f=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/f),_=f*t.x,C=x*t.y,V=Math.floor(g/_),L=Math.floor(g/C);if(V===0||L===0)throw new ae("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=V*L,this.regionCountPerMegatexture=new D(V,L),this.voxelCountPerRegion=new D(_,C),this.sliceCountPerRegion=new D(f,x),this.voxelSizeUv=new D(1/g,1/g),this.sliceSizeUv=new D(t.x/g,t.y/g),this.regionSizeUv=new D(_/g,C/g),this.texture=new Xt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR,magnificationFilter:hi.LINEAR})});let Z=kt.toComponentDatatype(i);this.tileVoxelDataTemp=Q.createTypedArray(Z,_*C*n),this.nodes=new Array(this.maximumTileCount);for(let G=0;G<this.maximumTileCount;G++)this.nodes[G]=new $0t(G);for(let G=0;G<this.maximumTileCount;G++){let I=this.nodes[G];I.previousNode=G>0?this.nodes[G-1]:void 0,I.nextNode=G<this.maximumTileCount-1?this.nodes[G+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function $0t(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Py.prototype.add=function(e){if(this.isFull())throw new pe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};Py.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new pe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};Py.prototype.isFull=function(){return this.emptyList===void 0};Py.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===kt.UNSIGNED_SHORT&&(i=kt.FLOAT32);let o=kt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,d=a*t.y,u=W.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(u/c),g=Math.floor(u/d);if(p*g>=e)break;u*=2}return u*u*n*o};Py.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let _=x%o.x*i.x,C=Math.floor(x/o.x)*i.y;for(let V=0;V<i.y;V++)for(let L=0;L<i.x;L++){let Z=x*i.y*i.x+V*i.x+L,G=(C+V)*r.x+(_+L);for(let I=0;I<s;I++)a[G*s+I]=n[Z*s+I]}}let c=this.regionCountPerMegatexture,d=r.x,u=r.y,h=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,f={source:{arrayBufferView:a,width:d,height:u},xOffset:h,yOffset:p};this.texture.copyFrom(f)};Py.prototype.isDestroyed=function(){return!1};Py.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),me(this)};var rL=Py;var HBi=T(S(),1);function ym(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=m.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Gn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var egt=new m;ym.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,egt),n=2*m.maximumComponent(t);this.approximateVoxelSize=n/m.minimumComponent(this.dimensions)};ym.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,d=r+1,u=a+1,h=t+1,p=[[h,r,s,a],[h,d,s,a],[h,r,c,a],[h,d,c,a],[h,r,s,u],[h,d,s,u],[h,r,c,u],[h,d,c,u]];this.children=p.map(([g,f,x,_])=>new ym(g,f,x,_,this,e,this.dimensions))};ym.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};ym.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,W.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var pTe={keyframe:0};function FA(e,t){return pTe.keyframe=e,Xo(t,pTe,$i.searchComparator)}ym.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=tgt(i,h),g=h[p],f=o===i||i<g.keyframe?p:Math.min(p+1,h.length-1),x=h[f],_=i-g.keyframe,C=bTe(n-t.level,_);C<a&&(a=C,r=g);let V=x.keyframe-o,L=bTe(n-t.level,V);if(L<c&&(c=L,s=x),_===0&&V===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:W.clamp((e-d)/(u-d),0,1)};function tgt(e,t){let n=FA(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function bTe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}ym.prototype.isVisited=function(e){return this.visitedFrameNumber===e};ym.prototype.createKeyframeNode=function(e){let t=FA(e,this.keyframeNodes);if(t<0){t=~t;let n=new $i(this,e);this.keyframeNodes.splice(t,0,n)}};ym.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=FA(n,this.keyframeNodes);if(i<0)throw new pe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=FA(n,this.renderableKeyframeNodes);if(o<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=$i.LoadState.UNLOADED,e.metadata={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};ym.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==$i.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadata.length!==t.length)throw new pe("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadata[o])}e.state=$i.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=FA(e.keyframe,n);if(i>=0)throw new pe("Keyframe already renderable");i=~i,n.splice(i,0,e)};ym.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var AA=ym;function T0(e,t,n,i,o,r,s){this._primitive=e,this.megatextures=new Array(i.length);for(let f=0;f<i.length;f++){let x=i[f],_=dt.getComponentCount(x),C=o[f];this.megatextures[f]=new rL(t,n,_,C,s)}let a=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let c=e._shape;this.rootNode=new AA(0,0,0,0,void 0,c,n),this._priorityQueue=new tS({maximumLength:a,comparator:$i.priorityComparator}),this._highPriorityKeyframeNodes=new Array(a),this._keyframeNodesInMegatexture=new Array(a),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let d=this._binaryTreeKeyframeWeighting;d[0]=0,d[r-1]=0,_8(d,1,r-2,0);let u=9,h=2048,p=Math.floor(h/u),g=Math.ceil(a/p);this.internalNodeTexture=new Xt({context:t,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:h,height:g,sampler:new qt({minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST})}),this.internalNodeTilesPerRow=p,this.internalNodeTexelSizeUv=new D(1/h,1/g),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new D}T0.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function _8(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,_8(e,t,o-1,i+1),_8(e,o+1,n,i+1)}T0.simultaneousRequestCountMaximum=50;T0.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,d=c>0,u=a>1,h=(d?2:1)*(u?2:1);this._sampleCount=h;let p=h>=2;if(p&&!l(this.leafNodeTexture)){let V=Math.floor(512),L=Math.ceil(s/V);this.leafNodeTexture=new Xt({context:r,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:1024,height:L,sampler:new qt({minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST})}),this.leafNodeTexelSizeUv=D.fromElements(1/1024,1/L,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=V}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=W.clamp(t,0,a-1),n&&gTe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ti();ogt(this,e);let f=Ti();agt(this,h,c);let x=Ti();if(this._debugPrint){let _=f-g,C=x-f,V=x-g;sgt(this,_,C,V)}};T0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};T0.prototype.isDestroyed=function(){return!1};T0.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),me(this)};function gTe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];gTe(e,i)}}function ngt(e,t){if(e._simultaneousRequestCount>=T0.simultaneousRequestCountMaximum)return;let n=e._primitive._provider;function i(c){e._simultaneousRequestCount--;let d=n.types.length;if(!l(c))t.state=$i.LoadState.UNAVAILABLE;else if(c===$i.LoadState.FAILED)t.state=$i.LoadState.FAILED;else if(!Array.isArray(c)||c.length!==d)t.state=$i.LoadState.FAILED;else{let u=e.megatextures;for(let h=0;h<d;h++){let{voxelCountPerTile:p,channelCount:g}=u[h],{x:f,y:x,z:_}=p,C=f*x*_,V=c[h],L=C*g;if(V.length===L)t.metadata[h]=V,t.state=$i.LoadState.RECEIVED;else{t.state=$i.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=$i.LoadState.FAILED}let{keyframe:r,spatialNode:s}=t,a=n.requestData({tileLevel:s.level,tileX:s.x,tileY:s.y,tileZ:s.z,keyframe:r});l(a)?(e._simultaneousRequestCount++,t.state=$i.LoadState.RECEIVING,a.then(i).catch(o)):t.state=$i.LoadState.FAILED}function igt(e){return e/(1+e)}function ogt(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,r=i.screenSpaceError,s=e._priorityQueue,a=e._keyframeCount,c=W.clamp(Math.floor(e._keyframeLocation),0,a-2),d=c+1,{camera:u,context:h,pixelRatio:p}=t,{positionWC:g,frustum:f}=u,_=h.drawingBufferHeight/p/f.sseDenominator;function C(F,b){if(F.computeScreenSpaceError(g,_),b=F.visibility(t,b),b===hs.MASK_OUTSIDE)return;if(F.visitedFrameNumber=n,a===1)F.createKeyframeNode(0);else if(F.keyframeNodes.length!==a)for(let N=0;N<a;N++)F.createKeyframeNode(N);let{screenSpaceError:R,keyframeNodes:E}=F,X=igt(R),A=!1;for(let N=0;N<E.length;N++){let O=E[N];O.priority=10*X+rgt(c,O.keyframe,d,e),O.state!==$i.LoadState.UNAVAILABLE&&O.state!==$i.LoadState.FAILED&&O.priority!==-Number.MAX_VALUE&&s.insert(O),O.state===$i.LoadState.LOADED&&(A=!0)}if(R<r||!A){F.children=void 0;return}l(F.children)||F.constructChildNodes(o);for(let N=0;N<8;N++){let O=F.children[N];C(O,b)}}s.reset(),C(e.rootNode,hs.MASK_INDETERMINATE);let V=e._highPriorityKeyframeNodes,L=0,Z;for(;s.length>0;)Z=s.removeMaximum(),Z.highPriorityFrameNumber=n,V[L]=Z,L++;let G=e._keyframeNodesInMegatexture,I=e.megatextures[0],v=I.occupiedCount;G.length=v,G.sort(function(F,b){return F.highPriorityFrameNumber===b.highPriorityFrameNumber?b.priority-F.priority:b.highPriorityFrameNumber-F.highPriorityFrameNumber});let P=0,w=0;for(let F=0;F<L;F++)if(Z=V[F],!(Z.state===$i.LoadState.LOADED||Z.spatialNode===void 0)&&(Z.state===$i.LoadState.UNLOADED&&ngt(e,Z),Z.state===$i.LoadState.RECEIVED)){let b=0;if(I.isFull()){b=v-1-P,P++;let R=G[b];R.spatialNode.destroyKeyframeNode(R,e.megatextures)}else b=v+w,w++;Z.spatialNode.addKeyframeNodeToMegatextures(Z,e.megatextures),G[b]=Z}}function rgt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return W.lerp(a,s,.15+.85*s)}function sgt(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys($i.LoadState).length,a=new Array(s),c=new Array(s),d=0;for(let C=0;C<s;C++){let V=new Array(o);a[C]=V;for(let L=0;L<o;L++)V[L]=0;c[C]=0}function u(C){let V=C.keyframeNodes;for(let L=0;L<V.length;L++){let Z=V[L],G=Z.keyframe,I=Z.state;a[I][G]+=1,c[I]+=1,d++}if(l(C.children))for(let L=0;L<8;L++){let Z=C.children[L];u(Z)}}u(r);let h=`KEYFRAMES: ${a[$i.LoadState.LOADED]}`,p=`UNLOADED: ${c[$i.LoadState.UNLOADED]} | RECEIVING: ${c[$i.LoadState.RECEIVING]} | RECEIVED: ${c[$i.LoadState.RECEIVED]} | LOADED: ${c[$i.LoadState.LOADED]} | FAILED: ${c[$i.LoadState.FAILED]} | UNAVAILABLE: ${c[$i.LoadState.UNAVAILABLE]} | TOTAL: ${d}`,g=Math.round(t*100)/100,f=Math.round(n*100)/100,x=Math.round(i*100)/100,_=`LOAD: ${g} | OCT: ${f} | ALL: ${x}`;console.log(`${h} || ${p} || ${_}`)}var PB={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function agt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,d=[],u=[];function h(g,f,x,_,C){let V=!1;if(l(g.children))for(let L=0;L<8;L++){let Z=g.children[L];Z.computeSurroundingRenderableKeyframeNodes(o),Z.isRenderable(r)&&(V=!0)}if(V){d[C]=PB.INTERNAL<<16|f,d[x]=_,a++,_=f,C=_*9+1;for(let L=0;L<8;L++){let Z=g.children[L];f=a,x=f*9+0,h(Z,f,x,_,C+L)}}else{if(s){let L=c*5,Z=g.renderableKeyframeNodePrevious,G=g.level-Z.spatialNode.level,I=Z.spatialNode.parent,v=l(I)?I.renderableKeyframeNodePrevious:Z,P=cgt(g,i,n),w=G,F=1,b=Z.megatextureIndex,R=v.megatextureIndex;u[L+0]=P,u[L+1]=w,u[L+2]=F,u[L+3]=b,u[L+4]=R,d[C]=PB.LEAF<<16|c}else{let L=g.renderableKeyframeNodePrevious,G=g.level-L.spatialNode.level===0?PB.LEAF:PB.PACKED_LEAF_FROM_PARENT;d[C]=G<<16|L.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),lgt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&dgt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function cgt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return W.clamp(s,0,1)}function lgt(e,t,n,i){let o=nt.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],g=h*o;for(let f=0;f<o;f++)c[g+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function dgt(e,t,n,i){let o=nt.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let g=e[p*r+0],f=e[p*r+1],x=e[p*r+2],_=e[p*r+3],C=e[p*r+4],V=W.clamp(Math.floor(65536*g),0,65535);d[p*8+0]=V>>>0&255,d[p*8+1]=V>>>8&255,d[p*8+2]=f&255,d[p*8+3]=x&255,d[p*8+4]=_>>>0&255,d[p*8+5]=_>>>8&255,d[p*8+6]=C>>>0&255,d[p*8+7]=C>>>8&255}let h={source:{arrayBufferView:d,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(h)}T0.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],d=dt.getComponentCount(a);o+=rL.getApproximateTextureMemoryByteLength(e,t,d,c)}return o};var sL=T0;var FOi=T(S(),1);var hOi=T(S(),1),ugt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},aL=Object.freeze(ugt);var ROi=T(S(),1);var pOi=T(S(),1);function mgt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var MA=mgt;function cL(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}cL.prototype.getTexture=function(e){return this._textures[e]};function hgt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}cL.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):hgt(this,e,t)};function fgt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?vB(o,r,n):pgt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function vB(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?xTe(e,n):new Xt({context:n,source:t,sampler:o});return yTe(o)&&r.generateMipmap(),r}function pgt(e,t,n){let{typedArray:i,sampler:o}=e,r=yTe(o),s=o.wrapS===Vn.REPEAT||o.wrapS===Vn.MIRRORED_REPEAT||o.wrapT===Vn.REPEAT||o.wrapT===Vn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,d=[a,c].every(W.isPowerOfTwo);if((r||s)&&!d)if(l(i)){if(e.pixelDatatype===je.UNSIGNED_BYTE){let h=MA(i,a,c),p=dg(h);return vB({sampler:o},p,n)}}else{let h=dg(t);return vB(e,h,n)}else return vB(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),xTe(e,n)}function yTe(e){return[jt.NEAREST_MIPMAP_NEAREST,jt.NEAREST_MIPMAP_LINEAR,jt.LINEAR_MIPMAP_NEAREST,jt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function xTe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Xt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}cL.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];fgt(this,o,t)}n.length=0};cL.prototype.isDestroyed=function(){return!1};cL.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return me(this)};var NA=cL;function kA(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,pb.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,Zg.INHERIT),this._textureManager=new NA,this._defaultTexture=void 0,this.uniformMap=bgt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},xgt(this),_gt(this)}function bgt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===aL.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=ggt(e,i)):n[i]=ygt(e,i)}return n}function ggt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function ygt(e,t){return function(){return e.uniforms[t].value}}function nS(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function xgt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,nS(r,t,o),o=e.usedVariablesVertex.featureIdSet,nS(r,n,o),o=e.usedVariablesVertex.metadataSet,nS(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,nS(s,t,o),o=e.usedVariablesFragment.featureIdSet,nS(s,n,o),o=e.usedVariablesFragment.metadataSet,nS(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;nS(s,a,c)}}function _Te(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function Zc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${_Te(t)} is not available in the ${i} shader. Did you mean ${_Te(n)} instead?`;throw new pe(o)}}function _gt(e){let t=e.usedVariablesVertex.attributeSet;Zc(t,"position","positionMC","vertex"),Zc(t,"normal","normalMC","vertex"),Zc(t,"tangent","tangentMC","vertex"),Zc(t,"bitangent","bitangentMC","vertex"),Zc(t,"positionWC","positionMC","vertex"),Zc(t,"positionEC","positionMC","vertex"),Zc(t,"normalEC","normalMC","vertex"),Zc(t,"tangentEC","tangentMC","vertex"),Zc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Zc(n,"position","positionEC","fragment"),Zc(n,"normal","normalEC","fragment"),Zc(n,"tangent","tangentEC","fragment"),Zc(n,"bitangent","bitangentEC","fragment"),Zc(n,"normalMC","normalEC","fragment"),Zc(n,"tangentMC","tangentEC","fragment"),Zc(n,"bitangentMC","bitangentEC","fragment")}kA.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===aL.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};kA.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};kA.prototype.isDestroyed=function(){return!1};kA.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),me(this)};var iS=kA;function dp(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,dp.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._exaggeratedMinBounds=new m,this._exaggeratedMinBoundsOld=new m,this._exaggeratedMaxBounds=new m,this._exaggeratedMaxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._exaggeratedModelMatrix=M.clone(this._modelMatrix),this._compoundModelMatrix=new M,this._compoundModelMatrixOld=new M,this._customShader=y(e.customShader,dp.DefaultCustomShader),this._customShaderCompilationEvent=new ge,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new M,this._transformPositionUvToWorld=new M,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new sh,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new D,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new D,megatextureTextures:[],megatextureSliceDimensions:new D,megatextureTileDimensions:new D,megatextureVoxelSizeUv:new D,megatextureSliceSizeUv:new D,megatextureTileSizeUv:new D,dimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new M,transformPositionUvToView:new M,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,stepSize:0,pickColor:new B},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;Tgt(this,i)}function Tgt(e,t){let{shape:n,minBounds:i=Mi.getMinBounds(n),maxBounds:o=Mi.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=Mi.getMinBounds(n),e.maxClippingBounds=Mi.getMaxBounds(n),e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=M.clone(e._modelMatrix,e._exaggeratedModelMatrix),STe(e,t);let r=Mi.getShapeConstructor(n);e._shape=new r,e._shapeVisible=CTe(e,e._shape,t)}Object.defineProperties(dp.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=W.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){fs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=dp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var Sgt=new m,Cgt=new se,Vgt=new se,Lgt=new m,Rgt=new m,Zgt=new $,Ggt=new $,Egt=new M,Igt=new M,Xgt=new M,Wgt=M.fromRotationTranslation($.fromUniformScale(.5,new $),new m(.5,.5,.5),new M),Pgt=M.fromRotationTranslation($.fromUniformScale(2,new $),new m(-1,-1,-1),new M);dp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Ngt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}Agt(this,e);let i=STe(this,t),o=this._shape;if(i&&(this._shapeVisible=CTe(this,o,t),Dgt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Bgt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&jgt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Ogt(this,e)&&(this._shaderDirty=!0);let d=s.leafNodeTexture,u=this._uniforms;l(d)&&(u.octreeLeafNodeTexture=s.leafNodeTexture,u.octreeLeafNodeTexelSizeUv=D.clone(s.leafNodeTexelSizeUv,u.octreeLeafNodeTexelSizeUv),u.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(vA(this,n),this._shaderDirty=!1);let h=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=zgt(p,h,Vgt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;u.ndcSpaceAxisAlignedBoundingBox=se.clone(g,u.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;u.transformPositionViewToUv=M.multiplyTransformation(this._transformPositionWorldToUv,x,u.transformPositionViewToUv);let _=n.uniformState.view;u.transformPositionUvToView=M.multiplyTransformation(_,this._transformPositionUvToWorld,u.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;u.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,C,u.transformDirectionViewToLocal),u.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,u.transformNormalLocalToWorld);let V=e.camera.positionWC;u.cameraPositionUv=M.multiplyByPoint(this._transformPositionWorldToUv,V,u.cameraPositionUv),u.stepSize=this._stepSizeMultiplier;let L=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;L.boundingVolume=o.boundingSphere,e.commandList.push(L)};var vgt=new m,T8=new m,wgt=new he,Fgt=new m;function Agt(e,t){if(e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===Mi.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else if(e.shape===Mi.BOX){let n=m.fromElements(1,1,t.verticalExaggeration,vgt);e._exaggeratedModelMatrix=M.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=M.multiplyByTranslation(e._exaggeratedModelMatrix,Mgt(e,t),e._exaggeratedModelMatrix)}}function Mgt(e,t){let{shapeTransform:n=M.IDENTITY,globalTransform:i=M.IDENTITY}=e._provider,o=M.getTranslation(n,T8),r=M.multiplyByPoint(e._modelMatrix,o,T8),s=M.multiplyByPoint(i,r,T8),c=ne.WGS84.cartesianToCartographic(s,wgt),d=0;l(c)&&(d=c.height);let u=Tr.getHeight(d,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return m.fromElements(0,0,(u-d)/t.verticalExaggeration,Fgt)}function Ngt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=B.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ye(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=m.clone(t.dimensions,i.dimensions),e._paddingBefore=m.clone(y(t.paddingBefore,m.ZERO),e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(y(t.paddingAfter,m.ZERO),e._paddingBefore),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._traversal=kgt(e,t,n),Ugt(e._traversal,i)}function STe(e,t){let n=y(t.shapeTransform,M.IDENTITY),i=y(t.globalTransform,M.IDENTITY);return M.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),M.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),oS(e,"_compoundModelMatrix","_compoundModelMatrixOld")+oS(e,"_minBounds","_minBoundsOld")+oS(e,"_maxBounds","_maxBoundsOld")+oS(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+oS(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+oS(e,"_minClippingBounds","_minClippingBoundsOld")+oS(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function oS(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function CTe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=M.inverse(o,Egt),s=M.getRotation(o,Zgt),a=M.getScale(o,Lgt),c=m.maximumComponent(a),d=m.divideByScalar(a,c,Rgt),u=$.multiplyByScale(s,d,Ggt);return e._transformPositionWorldToUv=M.multiplyTransformation(Wgt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=M.multiplyTransformation(o,Pgt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=M.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(u,e._transformNormalLocalToWorld),!0}function kgt(e,t,n){let i=m.clone(t.dimensions,Sgt);m.add(i,e._paddingBefore,i),m.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?sL.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new sL(e,n,i,t.types,t.componentTypes,s,r)}function Ugt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=D.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=D.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=D.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=D.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=D.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=D.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function Dgt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ye(n,!0)),i}function Bgt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=q.secondsDifference(i.stop,i.start),a=q.secondsDifference(n,i.start)/r;return o+a}function Ogt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=M.transpose(M.multiplyTransformation(M.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}dp.prototype.isDestroyed=function(){return!1};dp.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),me(this)};var TTe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),Ygt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),Hgt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function zgt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,Igt),o=M.multiply(t,i,Xgt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=Hgt,h=TTe.length;for(d=0;d<h;d++)M.multiplyByVector(o,TTe[d],u[d]);for(d=0;d<h;d++){let p=u[d];if(p.z>=-p.w){let g=p.x/p.w,f=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,f),c=Math.max(c,f)}else for(let g=0;g<3;g++){let f=Ygt[d*3+g],x=u[f];if(x.z>=-x.w){let _=p.z+p.w,C=x.z+x.w,V=_/(_-C),L=se.lerp(p,x,V,Cgt),Z=L.x/L.w,G=L.y/L.w;r=Math.min(r,Z),s=Math.max(s,Z),a=Math.min(a,G),c=Math.max(c,G)}}}return r=W.clamp(r,-1,1),a=W.clamp(a,-1,1),s=W.clamp(s,-1,1),c=W.clamp(c,-1,1),n=se.fromElements(r,a,s,c,n),n}var S8=3e7,Kgt=new m(S8,0,0),Jgt=new m(0,S8,0),Qgt=new m(0,0,S8);function jgt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,d,u,h){i.add({positions:[c,d],width:h,material:Hi.fromType("Color",{color:u})})}function r(c,d,u){let h=c.computeCorners();o(h[0],h[1],d,u),o(h[2],h[3],d,u),o(h[4],h[5],d,u),o(h[6],h[7],d,u),o(h[0],h[2],d,u),o(h[4],h[6],d,u),o(h[1],h[3],d,u),o(h[5],h[7],d,u),o(h[0],h[4],d,u),o(h[2],h[6],d,u),o(h[1],h[5],d,u),o(h[3],h[7],d,u)}function s(c){if(!n.isRenderable(c))return;let d=c.level,h=Math.max(1,5/Math.pow(2,d)),g=[B.RED,B.LIME,B.BLUE][d%3];if(r(c.orientedBoundingBox,g,h),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,B.WHITE,5),s(n.rootNode);let a=10;o(m.ZERO,Kgt,B.RED,a),o(m.ZERO,Jgt,B.LIME,a),o(m.ZERO,Qgt,B.BLUE,a),i.update(t)}dp.DefaultCustomShader=new iS({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = vec3(1.0); material.alpha = 1.0; -}`});function STe(){this.ready=!0,this.shape=Ai.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[ut.SCALAR],this.componentTypes=[Ut.FLOAT32],this.maximumTileCount=1}STe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};lp.DefaultProvider=new STe;var vy=lp;var POi=T(S(),1);function Kgt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var jA=Kgt;var wOi=T(S(),1);function Jgt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var qA=Jgt;var MOi=T(S(),1);function Qgt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var $A=Qgt;var wB=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function ci(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ye(e.contextOptions),r=l(n),s=new QG(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Bn(),this._jobScheduler=new WF,this._frameState=new IF(s,new TF(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new nR(s),this._ellipsoid=y(e.ellipsoid,ne.default),this._globe=void 0,this._globeTranslucencyState=new XF,this._primitives=new Ul,this._groundPrimitives=new Ul,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=ci.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new KT,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new ZF(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new $n({color:new B,stencil:0,owner:this}),this._depthClearCommand=new $n({depth:1,owner:this}),this._stencilClearCommand=new $n({stencil:0}),this._classificationStencilClearCommand=new $n({stencil:0,renderState:Ue.fromCache({stencilMask:Dt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new gA(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._minimumDisableDepthTestDistance=0,this._debugInspector=new RA,this._msaaSamples=y(e.msaaSamples,4),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new be,this.morphComplete=new be,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=B.clone(B.BLACK),this._mode=oe.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Zi(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new g_,this.fog=new EF,this.fog.enabled=ne.WGS84.equals(this._ellipsoid),ne.WGS84.equals(this._ellipsoid)||(ro.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new ro(this),this.shadowMap=new f0({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=B.clone(B.WHITE),this._actualInvertClassificationColor=B.clone(this._invertClassificationColor),this._invertClassification=new jV,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new fA,this._brdfLutGenerator=new pF,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new TA(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,jl.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=$a.requestCompletedEvent.addEventListener(wB(this)),this._removeTaskProcessorListenerCallback=bi.taskCompletedEvent.addEventListener(wB(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new ze(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new ro(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new ro(this),this.preloadFlightCullingVolume=void 0,this._picking=new HF(this),this._defaultView=new kT(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Zp,ZTe(this,0,q.now()),this.updateFrameState(),this.initializeFrame()}ci.defaultLogDepthBuffer=!0;function jgt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(wB(e))),n.push(t.terrainProviderChanged.addEventListener(wB(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(ci.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return At.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return At.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Bm.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,jgt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new ro(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new GF(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,At.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});ci.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function qgt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function CTe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=ep.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=ep.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=ep.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=ep.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=f0.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Ee.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}ci.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,d=l(t.logDepth),u=l(t.hdr),h=l(t.originalCommand),p=o&&!d,g=c&&!u,f=(!o||!c)&&!h,x=n.pickingMetadata&&qgt(e,n);if(e.dirty=e.dirty||p||g||f||x,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:_,shadowMaps:C}=i;_&&e.castShadows&&(t.shadows=f0.createCastDerivedCommand(C,e,s,r,t.shadows)),(d||p)&&(t.logDepth=ep.createLogDepthCommand(e,r,t.logDepth),CTe(this,t.logDepth.command,s)),(h||f)&&CTe(this,e,s)};var $gt=new fm({pass:Fo.RENDER}),S8=new fm({pass:Fo.PRELOAD}),C8=new fm({pass:Fo.PRELOAD_FLIGHT}),eyt=new fm({pass:Fo.REQUEST_RENDER_MODE_DEFER_CHECK}),VTe=new le,V8;function tyt(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return VTe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,V8=hF.fromBoundingSphere(VTe,e.camera.positionWC,V8),V8}ci.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function ZTe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=q.clone(n,i.time)}ci.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=tyt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof an||this.camera.frustum instanceof Pr),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=B.clone(this.invertClassificationColor,this._actualInvertClassificationColor),jV.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};ci.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===zt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var vB=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);vB=M.inverseTransformation(vB,vB);function nyt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=m.clone(s.center);if(o.mode!==oe.SCENE3D){a=M.multiplyByPoint(vB,a,a);let f=o.mapProjection,x=f.unproject(a);a=f.ellipsoid.cartographicToCartesian(x)}let c,d,{radius:u}=s;l(u)?(c=Ks.createGeometry(new Ks({radii:new m(u,u,u),vertexFormat:dn.FLAT_VERTEX_FORMAT})),d=M.fromTranslation(a)):(c=Za.createGeometry(Za.fromDimensions({dimensions:new m(2,2,2),vertexFormat:dn.FLAT_VERTEX_FORMAT})),d=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new In({geometryInstances:new Gt({geometry:Fn.toWireframe(c),modelMatrix:d,attributes:{color:new Ht(1,0,0,1)}}),appearance:new dn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=ep.createLogDepthCommand(e,r).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(g)&&(n.framebuffer=g),o.commandList=h}function dp(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof $n){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&nyt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function LTe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function GTe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function iyt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function oyt(e,t,n,i,o){d0(i,GTe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function ryt(e,t,n,i,o){d0(i,iyt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function syt(e,t,n){e.context.uniformState.updatePass(Ee.VOXELS);let i=n.commands[Ee.VOXELS];i.length=n.indices[Ee.VOXELS],d0(i,GTe,e.camera.positionWC);for(let o=0;o<i.length;++o)dp(i[o],e,t)}var ayt=new Ri,cyt=new ul,lyt=new an,dyt=new Pr;function uyt(e){let{frustum:t}=e;return l(t.fov)?t.clone(ayt):l(t.infiniteProjectionMatrix)?t.clone(cyt):l(t.width)?t.clone(lyt):t.clone(dyt)}function myt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?oyt:ryt}function hyt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let d=myt(e);o.uniformState.updatePass(Ee.TRANSLUCENT);let u=n.commands[Ee.TRANSLUCENT];u.length=n.indices[Ee.TRANSLUCENT],d(e,dp,t,u,c)}function fyt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ee.TRANSLUCENT];i.executeTranslucentCommands(e,dp,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,dp,t,n)}function R8(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=uyt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||pyt(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:f}=e._environmentState,{globeDepth:x,globeTranslucencyFramebuffer:_,sceneFramebuffer:C,frustumCommandsList:V}=e._view,L=V.length,Z=e._globeTranslucencyState,G=e._depthClearCommand,I=e._stencilClearCommand,v=e._classificationStencilClearCommand,P=e._depthPlane,w=n.position.z;function F(R,E){r.updatePass(E);let X=R.commands[E],A=R.indices[E];for(let N=0;N<A;++N)dp(X[N],e,t);return A}function b(R,E){r.updatePass(E);let X=R.commands[E],A=R.indices[E];for(let N=0;N<A;++N)LTe(X[N],e,t)}for(let R=0;R<L;++R){let E=L-R-1,X=V[E];e.mode===oe.SCENE2D?(n.position.z=w-X.near+1,s.far=Math.max(1,X.far-X.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=E!==0?X.near*e.opaqueFrustumNearOffset:X.near,s.far=X.far,r.updateFrustum(s)),G.execute(i,t),i.stencilBuffer&&I.execute(i,t),Z.translucent?(r.updatePass(Ee.GLOBE),Z.executeGlobeCommands(X,dp,_,e,t)):F(X,Ee.GLOBE),p&&x.executeCopyDepth(i,t),u||(Z.translucent?(r.updatePass(Ee.TERRAIN_CLASSIFICATION),Z.executeGlobeClassificationCommands(X,dp,_,e,t)):F(X,Ee.TERRAIN_CLASSIFICATION)),d&&(G.execute(i,t),h&&P.execute(i,t));let A;if(!g||c||u)A=F(X,Ee.CESIUM_3D_TILE),A>0&&(p&&(x.prepareColorTextures(i,d),x.executeUpdateDepth(i,t,x.depthStencilTexture)),u||(A=F(X,Ee.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let O=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,A=F(X,Ee.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),x.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),A=F(X,Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=O,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),A>0&&i.stencilBuffer&&v.execute(i,t),A=F(X,Ee.CESIUM_3D_TILE_CLASSIFICATION)}if(A>0&&i.stencilBuffer&&I.execute(i,t),syt(e,t,X),F(X,Ee.OPAQUE),E!==0&&e.mode!==oe.SCENE2D&&(s.near=X.near,r.updateFrustum(s)),hyt(e,t,X),fyt(e,t,X),i.depthTexture&&e.useDepthPicking&&(p||u)){let O=e._picking.getPickDepth(e,E);O.update(i,x.depthStencilTexture),O.executeCopyDepth(i,t)}if(c||!f)continue;let N=t.framebuffer;t.framebuffer=C.getIdFramebuffer(),s.near=E!==0?X.near*e.opaqueFrustumNearOffset:X.near,s.far=X.far,r.updateFrustum(s),Z.translucent?(r.updatePass(Ee.GLOBE),Z.executeGlobeCommands(X,LTe,_,e,t)):b(X,Ee.GLOBE),d&&(G.framebuffer=t.framebuffer,G.execute(i,t),G.framebuffer=void 0),d&&h&&P.execute(i,t),b(X,Ee.CESIUM_3D_TILE),b(X,Ee.OPAQUE),b(X,Ee.TRANSLUCENT),t.framebuffer=N}}function pyt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Ee.ENVIRONMENT),l(i.skyBoxCommand)&&dp(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&dp(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function ETe(e){e.context.uniformState.updatePass(Ee.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function byt(e,t){e.context.uniformState.updatePass(Ee.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function gyt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Ee.GLOBE,Ee.CESIUM_3D_TILE,Ee.OPAQUE,Ee.TRANSLUCENT];for(let c=0;c<t.length;++c){let d=t[c];if(e.updateDerivedCommands(d),!(!d.castShadows||a.indexOf(d.pass)<0||!e.isVisible(i,d)))if(o)for(let u=0;u<s;++u)r[u].commandList.push(d);else if(s===1)r[0].commandList.push(d);else{let u=!1;for(let h=s-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,d))r[h].commandList.push(d),u=!0;else if(u)break}}}}function ITe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:d}=c;for(let u=0;u<d.length;++u)d[u].commandList.length=0;gyt(e,n,c);for(let u=0;u<d.length;++u){let h=c.passes[u],{camera:p,commandList:g}=h;s.updateCamera(p),c.updatePass(r,u);for(let f=0;f<g.length;++f){let x=g[f];s.updatePass(x.pass);let _=x.derivedCommands.shadows.castCommands[a];dp(_,e,h.passState)}}}}var yyt=new m;ci.prototype.updateAndExecuteCommands=function(e,t){Xyt(this,e,t),this._environmentState.useWebVR?xyt(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===jl.ROTATE?wy(!0,this,e):Gyt(this,e)};function xyt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;XTe(e),n.createPotentiallyVisibleSet(e),ETe(e),r||ITe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=ro.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,d=c*y(e.focalLength,5),u=y(e.eyeSeparation,d/30),h=m.multiplyByScalar(a.right,u*.5,yyt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;m.add(a.position,h,i.position),i.frustum.xOffset=p,R8(e,t),s.x=s.width,m.subtract(a.position,h,i.position),i.frustum.xOffset=-p,R8(e,t),ro.clone(a,i)}var _yt=new he(Math.PI,W.PI_OVER_TWO),Tyt=new m,Syt=new m,Cyt=new M,Vyt=new M,Lyt=new m,Ryt=new m,Zyt=new ze;function Gyt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=ze.clone(r,Zyt);t.viewport=s;let a=_yt,c=Tyt;e.mapProjection.project(a,c);let u=m.clone(i.position,Syt),h=M.clone(i.transform,Vyt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let g=M.computeViewportTransformation(s,0,1,Cyt),f=i.frustum.projectionMatrix,x=i.positionWC.y,_=m.fromElements(W.sign(x)*c.x-x,0,-i.positionWC.x,Lyt),C=wt.pointToGLWindowCoordinates(f,g,_,Ryt);C.x=Math.floor(C.x);let V=s.x,L=s.width;if(x===0||C.x<=V||C.x>=V+L)wy(!0,e,t);else if(Math.abs(V+L*.5-C.x)<1)s.width=C.x-s.x,i.position.x*=W.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!0,e,t),s.x=C.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!1,e,t);else if(C.x>V+L*.5){s.width=C.x-V;let Z=i.frustum.right;i.frustum.right=c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!0,e,t),s.x=C.x,s.width=V+L-C.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=Z-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!1,e,t)}else{s.x=C.x,s.width=V+L-C.x;let Z=i.frustum.left;i.frustum.left=-c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!0,e,t),s.x=V,s.width=C.x-V,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=Z-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!1,e,t)}i._setTransform(h),m.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function wy(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),XTe(t),i.createPotentiallyVisibleSet(t),e&&(ETe(t),o||ITe(t)),R8(t,n)}var RTe=new hs;ci.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof an||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(nb.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let C=r.dynamicLighting;s.setDynamicLighting(C),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let _=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(_)?_.drawCommand:void 0,n.sunComputeCommand=l(_)?_.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=d&&this.mode===oe.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let h=e.mode===oe.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=RTe.planes;for(let _=0;_<5;++_)g[_]=p.planes[_];p=RTe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let f=this.specularEnvironmentMaps,x=this._specularEnvironmentCubeMap;l(f)&&x?.url!==f?(x=x&&x.destroy(),this._specularEnvironmentCubeMap=new Bm(f)):!l(f)&&l(x)&&(x.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function Eyt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new $f({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Iyt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===oe.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function XTe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Eyt(e),Iyt(e),e._globe&&e._globe.render(t)}function Xyt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new VA:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;B.clone(n,u.color),u.execute(i,t);let h=r.useGlobeDepthFramebuffer=l(s.globeDepth);h&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),f.update(i,o.useLogDepth,e._hdr),f.clear(i),x=r.usePostProcess=f.ready,r.usePostProcessSelected=x&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&u.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(o.invertClassificationColor.alpha===1&&h&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let V=e._invertClassification.unclassifiedCommand,L=V.derivedCommands;L.oit=p.createDerivedCommands(V,i,L.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}ci.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:d}=n,u=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?h.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=h;a&&!s&&(g=u);let f=this.postProcessStages,x=g.getColorTexture(0),_=p.getColorTexture(0),C=y(u,h).getDepthStencilTexture();f.execute(t,x,C,_),f.copy(t,d)}!s&&!c&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function Wyt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function Pyt(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}ci.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===Je.CLAMP_TO_TERRAIN||t===Je.RELATIVE_TO_TERRAIN,i=t===Je.CLAMP_TO_3D_TILE||t===Je.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=this.primitives.length;for(let a=0;a<s;++a){let c=this.primitives.get(a);if(!c.isCesium3DTileset||!c.show||!c.enableCollision)continue;let d=c.getHeight(e,this);l(d)&&d>o&&(o=d)}}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var L8=new he;ci.prototype.updateHeight=function(e,t,n){let i=()=>{he.clone(e,L8);let g=this.getHeight(e,n);l(g)&&(L8.height=g,t(L8))},o=n===Je.CLAMP_TO_TERRAIN||n===Je.RELATIVE_TO_TERRAIN,r=n===Je.CLAMP_TO_3D_TILE||n===Je.RELATIVE_TO_3D_TILE,s;!r&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,i));let a={},c=this._ellipsoid,d=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let f=g.updateHeight(e,i,c);a[g.id]=f};if(!o){let g=this.primitives.length;for(let f=0;f<g;++f){let x=this.primitives.get(f);d(x)}}let u=this.primitives.primitiveAdded.addEventListener(d),h=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(a[g.id])&&a[g.id](),delete a[g.id])});return()=>{s=s&&s(),Object.values(a).forEach(g=>g()),a={},u(),h()}};function vyt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===oe.SCENE2D||n===oe.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}ci.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=Pyt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=vyt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function wyt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new u0({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function Fyt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function Ayt(e){e.primitives.postPassesUpdate(e._frameState),$a.update()}var Myt=new B;function Nyt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=$gt;let r=y(e.backgroundColor,B.BLACK);e._hdr&&(r=B.clone(r,Myt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof Zp?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=ze.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,byt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function iS(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function kyt(e){return e._picking.updateMostDetailedRayPicks(e)}ci.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=q.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===oe.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(q.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=q.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=W.incrementWrap(t.frameNumber,15e6,1);ZTe(this,o,e),t.newFrame=!0}iS(this,Fyt),this.primitives.show&&(iS(this,kyt),iS(this,Uyt),iS(this,Dyt),i||iS(this,Byt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),iS(this,Nyt)),wyt(this,i),iS(this,Ayt),Wyt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};ci.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};ci.prototype.requestRender=function(){this._renderRequested=!0};ci.prototype.clampLineWidth=function(e){return Math.max(At.minimumAliasedLineWidth,Math.min(e,At.maximumAliasedLineWidth))};ci.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};ci.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof vy))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return ZA.fromKeyframeNode(o,s,c,a)};ci.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=jA(s,t,n,i);if(!l(a))return;let c=$A(r,n,i);if(!l(c))return;let d=new qA(t,n,i,a,c);return this._picking.pickMetadata(this,e,d)};ci.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};ci.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};ci.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};ci.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Uyt(e){let t=e._frameState;S8.camera=t.camera,S8.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,S8)}function Dyt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;C8.camera=e.preloadFlightCamera,C8.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,C8)}function Byt(e){e.primitives.updateForPass(e._frameState,eyt)}ci.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};ci.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};ci.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};ci.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};ci.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};ci.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};ci.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};ci.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};ci.prototype.cartesianToCanvasCoordinates=function(e,t){return ki.worldToWindowCoordinates(this,e,t)};ci.prototype.completeMorph=function(){this._transitioner.completeMorph()};ci.prototype.morphTo2D=function(e){e=y(e,2),this._transitioner.morphTo2D(e,this._ellipsoid)};ci.prototype.morphToColumbusView=function(e){e=y(e,2),this._transitioner.morphToColumbusView(e,this._ellipsoid)};ci.prototype.morphTo3D=function(e){e=y(e,2),this._transitioner.morphTo3D(e,this._ellipsoid)};function Oyt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}ci.prototype.setTerrain=function(e){return Oyt(this,e),e};ci.prototype.isDestroyed=function(){return!1};ci.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),me(this)};var e9=ci;var MHi=T(S(),1);function aL(e){e=y(e,ne.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=M.fromScale(n),this._modelMatrix=new M,this._command=new qe({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(aL.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});aL.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Z8=new M;aL.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==oe.SCENE3D&&n!==oe.MORPHING||!e.passes.render)return;let i=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,Z8),o=M.multiplyTransformation(i,Wo.Y_UP_TO_Z_UP,Z8),r=M.multiply(this._scaleMatrix,o,Z8);M.clone(r,this._modelMatrix);let s=e.context,a=Yyt(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=Ks.createGeometry(new Ks({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Xe.POSITION_ONLY}));u.vertexArray=ei.fromGeometry({context:s,geometry:p,attributeLocations:Fn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),u.renderState=Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:mn.ALPHA_BLEND,depthMask:!1})}let h=a|d<<2|c<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new De({defines:p,sources:[Pm,eC,XE]}),f=new De({defines:p,sources:[Pm,eC,IE]});this._spSkyAtmosphere=en.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function Yyt(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}aL.prototype.isDestroyed=function(){return!1};aL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),me(this)};var t9=aL;var azi=T(S(),1);function lL(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new qe({modelMatrix:M.clone(M.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}lL.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?tE(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}).catch(c=>{this._hasError=!0,this._error=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new xr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Za.createGeometry(Za.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Xe.POSITION_ONLY})),c=this._attributeLocations=Fn.createAttributeLocations(a);s.vertexArray=ei.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Me.STATIC_DRAW}),s.renderState=Ue.fromCache({blending:mn.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new De({defines:[t?"HDR":""],sources:[WE]});s.shaderProgram=en.fromCache({context:r,vertexShaderSource:PE,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};lL.prototype.isDestroyed=function(){return!1};lL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),me(this)};function cL(e){return rn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}lL.createEarthSkyBox=function(){return new lL({sources:{positiveX:cL("px"),negativeX:cL("mx"),positiveY:cL("py"),negativeY:cL("my"),positiveZ:cL("pz"),negativeZ:cL("mz")}})};var n9=lL;var Fzi=T(S(),1);function o9(){this.show=!0,this._drawCommand=new qe({primitiveType:we.TRIANGLES,boundingVolume:new le,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new le,this._boundingVolume2D=new le,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(o9.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Hyt=new D,zyt=new D,Kyt=new se,i9=new se;o9.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===oe.SCENE2D||i===oe.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let Z=Math.max(r,s);Z=Math.pow(2,Math.ceil(Math.log(Z)/Math.log(2))-2),Z=Math.max(1,Z);let G=n?o.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._texture=new Wt({context:o,width:Z,height:Z,pixelFormat:nt.RGBA,pixelDatatype:G}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let I=this,v={u_radiusTS:function(){return I._radiusTS}};this._commands.computeCommand=new Pc({fragmentShaderSource:wE,outputTexture:this._texture,uniformMap:v,persists:!1,owner:this,postExecute:function(){I._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let Z={direction:0},G=new Uint8Array(4*2);G[0]=0,G[1]=0,G[2]=255,G[3]=0,G[4]=255,G[5]=255,G[6]=0,G[7]=255;let I=xt.createVertexBuffer({context:o,typedArray:G,usage:Me.STATIC_DRAW}),v=[{index:Z.direction,vertexBuffer:I,componentsPerAttribute:2,normalize:!0,componentDatatype:Q.UNSIGNED_BYTE}],P=xt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});a.vertexArray=new ei({context:o,attributes:v,indexBuffer:P}),a.shaderProgram=en.fromCache({context:o,vertexShaderSource:FE,fragmentShaderSource:vE,attributeLocations:Z}),a.renderState=Ue.fromCache({blending:mn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,h=this._boundingVolume2D;m.clone(c,u.center),h.center.x=d.z,h.center.y=d.x,h.center.z=d.y,u.radius=W.SOLAR_RADIUS+W.SOLAR_RADIUS*this._glowLengthTS,h.radius=u.radius,i===oe.SCENE3D?le.clone(u,a.boundingVolume):i===oe.COLUMBUS_VIEW&&le.clone(h,a.boundingVolume);let p=ki.computeActualEllipsoidPosition(e,c,i9),g=m.magnitude(m.subtract(p,e.camera.position,i9)),f=o.uniformState.projection,x=Kyt;x.x=0,x.y=0,x.z=-g,x.w=1;let _=M.multiplyByVector(f,x,i9),C=ki.clipToGLWindowCoordinates(t.viewport,_,Hyt);x.x=W.SOLAR_RADIUS;let V=M.multiplyByVector(f,x,i9),L=ki.clipToGLWindowCoordinates(t.viewport,V,zyt);return this._size=D.magnitude(D.subtract(L,C,i9)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};o9.prototype.isDestroyed=function(){return!1};o9.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),me(this)};var r9=o9;var DKi=T(S(),1);var VKi=T(S(),1);var vTe=T(kM(),1);var Mzi=T(S(),1);function Jyt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); +}`});function VTe(){this.ready=!0,this.shape=Mi.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[dt.SCALAR],this.componentTypes=[kt.FLOAT32],this.maximumTileCount=1}VTe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};dp.DefaultProvider=new VTe;var vy=dp;var m3i=T(S(),1);function qgt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var UA=qgt;var f3i=T(S(),1);function $gt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var DA=$gt;var g3i=T(S(),1);function eyt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var BA=eyt;var FB=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function li(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ye(e.contextOptions),r=l(n),s=new $G(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Bn(),this._jobScheduler=new xF,this._frameState=new gF(s,new sF(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new rR(s),this._ellipsoid=y(e.ellipsoid,ne.default),this._globe=void 0,this._globeTranslucencyState=new yF,this._primitives=new Dl,this._groundPrimitives=new Dl,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=li.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new QT,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new fF(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ti({color:new B,stencil:0,owner:this}),this._depthClearCommand=new ti({depth:1,owner:this}),this._stencilClearCommand=new ti({stencil:0}),this._classificationStencilClearCommand=new ti({stencil:0,renderState:Ue.fromCache({stencilMask:Ut.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new aA(this),this._preUpdate=new ge,this._postUpdate=new ge,this._renderError=new ge,this._preRender=new ge,this._postRender=new ge,this._minimumDisableDepthTestDistance=0,this._debugInspector=new bA,this._msaaSamples=y(e.msaaSamples,4),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new ge,this.morphComplete=new ge,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=B.clone(B.BLACK),this._mode=oe.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Ei(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new g_,this.fog=new bF,this.fog.enabled=ne.WGS84.equals(this._ellipsoid),ne.WGS84.equals(this._ellipsoid)||(ro.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new ro(this),this.shadowMap=new p0({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=B.clone(B.WHITE),this._actualInvertClassificationColor=B.clone(this._invertClassificationColor),this._invertClassification=new qV,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new oA,this._brdfLutGenerator=new eF,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new uA(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,ql.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=ec.requestCompletedEvent.addEventListener(FB(this)),this._removeTaskProcessorListenerCallback=gi.taskCompletedEvent.addEventListener(FB(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new ze(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new ro(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new ro(this),this.preloadFlightCullingVolume=void 0,this._picking=new wF(this),this._defaultView=new DT(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Gp,ETe(this,0,q.now()),this.updateFrameState(),this.initializeFrame()}li.defaultLogDepthBuffer=!0;function tyt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(FB(e))),n.push(t.terrainProviderChanged.addEventListener(FB(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(li.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Ft.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Ft.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Dm.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,tyt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new ro(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new pF(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Ft.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});li.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function nyt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function LTe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=tp.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=tp.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=tp.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=tp.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=p0.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Ee.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}li.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,d=l(t.logDepth),u=l(t.hdr),h=l(t.originalCommand),p=o&&!d,g=c&&!u,f=(!o||!c)&&!h,x=n.pickingMetadata&&nyt(e,n);if(e.dirty=e.dirty||p||g||f||x,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:_,shadowMaps:C}=i;_&&e.castShadows&&(t.shadows=p0.createCastDerivedCommand(C,e,s,r,t.shadows)),(d||p)&&(t.logDepth=tp.createLogDepthCommand(e,r,t.logDepth),LTe(this,t.logDepth.command,s)),(h||f)&<e(this,e,s)};var iyt=new fm({pass:Ao.RENDER}),C8=new fm({pass:Ao.PRELOAD}),V8=new fm({pass:Ao.PRELOAD_FLIGHT}),oyt=new fm({pass:Ao.REQUEST_RENDER_MODE_DEFER_CHECK}),RTe=new le,L8;function ryt(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return RTe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,L8=jw.fromBoundingSphere(RTe,e.camera.positionWC,L8),L8}li.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function ETe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=q.clone(n,i.time)}li.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=ryt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof rn||this.camera.frustum instanceof Pr),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=B.clone(this.invertClassificationColor,this._actualInvertClassificationColor),qV.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};li.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Ht.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var wB=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);wB=M.inverseTransformation(wB,wB);function syt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=m.clone(s.center);if(o.mode!==oe.SCENE3D){a=M.multiplyByPoint(wB,a,a);let f=o.mapProjection,x=f.unproject(a);a=f.ellipsoid.cartographicToCartesian(x)}let c,d,{radius:u}=s;l(u)?(c=Ks.createGeometry(new Ks({radii:new m(u,u,u),vertexFormat:ln.FLAT_VERTEX_FORMAT})),d=M.fromTranslation(a)):(c=Ea.createGeometry(Ea.fromDimensions({dimensions:new m(2,2,2),vertexFormat:ln.FLAT_VERTEX_FORMAT})),d=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new In({geometryInstances:new Zt({geometry:Fn.toWireframe(c),modelMatrix:d,attributes:{color:new Yt(1,0,0,1)}}),appearance:new ln({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=tp.createLogDepthCommand(e,r).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(g)&&(n.framebuffer=g),o.commandList=h}function up(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ti){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&syt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function ZTe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function ITe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function ayt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function cyt(e,t,n,i,o){u0(i,ITe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function lyt(e,t,n,i,o){u0(i,ayt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function dyt(e,t,n){e.context.uniformState.updatePass(Ee.VOXELS);let i=n.commands[Ee.VOXELS];i.length=n.indices[Ee.VOXELS],u0(i,ITe,e.camera.positionWC);for(let o=0;o<i.length;++o)up(i[o],e,t)}var uyt=new Gi,myt=new hl,hyt=new rn,fyt=new Pr;function pyt(e){let{frustum:t}=e;return l(t.fov)?t.clone(uyt):l(t.infiniteProjectionMatrix)?t.clone(myt):l(t.width)?t.clone(hyt):t.clone(fyt)}function byt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?cyt:lyt}function gyt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let d=byt(e);o.uniformState.updatePass(Ee.TRANSLUCENT);let u=n.commands[Ee.TRANSLUCENT];u.length=n.indices[Ee.TRANSLUCENT],d(e,up,t,u,c)}function yyt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Ee.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ee.TRANSLUCENT];i.executeTranslucentCommands(e,up,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,up,t,n)}function Z8(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=pyt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||xyt(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:f}=e._environmentState,{globeDepth:x,globeTranslucencyFramebuffer:_,sceneFramebuffer:C,frustumCommandsList:V}=e._view,L=V.length,Z=e._globeTranslucencyState,G=e._depthClearCommand,I=e._stencilClearCommand,v=e._classificationStencilClearCommand,P=e._depthPlane,w=n.position.z;function F(R,E){r.updatePass(E);let X=R.commands[E],A=R.indices[E];for(let N=0;N<A;++N)up(X[N],e,t);return A}function b(R,E){r.updatePass(E);let X=R.commands[E],A=R.indices[E];for(let N=0;N<A;++N)ZTe(X[N],e,t)}for(let R=0;R<L;++R){let E=L-R-1,X=V[E];e.mode===oe.SCENE2D?(n.position.z=w-X.near+1,s.far=Math.max(1,X.far-X.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=E!==0?X.near*e.opaqueFrustumNearOffset:X.near,s.far=X.far,r.updateFrustum(s)),G.execute(i,t),i.stencilBuffer&&I.execute(i,t),Z.translucent?(r.updatePass(Ee.GLOBE),Z.executeGlobeCommands(X,up,_,e,t)):F(X,Ee.GLOBE),p&&x.executeCopyDepth(i,t),u||(Z.translucent?(r.updatePass(Ee.TERRAIN_CLASSIFICATION),Z.executeGlobeClassificationCommands(X,up,_,e,t)):F(X,Ee.TERRAIN_CLASSIFICATION)),d&&(G.execute(i,t),h&&P.execute(i,t));let A;if(!g||c||u)A=F(X,Ee.CESIUM_3D_TILE),A>0&&(p&&(x.prepareColorTextures(i,d),x.executeUpdateDepth(i,t,x.depthStencilTexture)),u||(A=F(X,Ee.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let O=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,A=F(X,Ee.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),x.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),A=F(X,Ee.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=O,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),A>0&&i.stencilBuffer&&v.execute(i,t),A=F(X,Ee.CESIUM_3D_TILE_CLASSIFICATION)}if(A>0&&i.stencilBuffer&&I.execute(i,t),dyt(e,t,X),F(X,Ee.OPAQUE),E!==0&&e.mode!==oe.SCENE2D&&(s.near=X.near,r.updateFrustum(s)),gyt(e,t,X),yyt(e,t,X),i.depthTexture&&e.useDepthPicking&&(p||u)){let O=e._picking.getPickDepth(e,E);O.update(i,x.depthStencilTexture),O.executeCopyDepth(i,t)}if(c||!f)continue;let N=t.framebuffer;t.framebuffer=C.getIdFramebuffer(),s.near=E!==0?X.near*e.opaqueFrustumNearOffset:X.near,s.far=X.far,r.updateFrustum(s),Z.translucent?(r.updatePass(Ee.GLOBE),Z.executeGlobeCommands(X,ZTe,_,e,t)):b(X,Ee.GLOBE),d&&(G.framebuffer=t.framebuffer,G.execute(i,t),G.framebuffer=void 0),d&&h&&P.execute(i,t),b(X,Ee.CESIUM_3D_TILE),b(X,Ee.OPAQUE),b(X,Ee.TRANSLUCENT),t.framebuffer=N}}function xyt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Ee.ENVIRONMENT),l(i.skyBoxCommand)&&up(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&up(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function XTe(e){e.context.uniformState.updatePass(Ee.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function _yt(e,t){e.context.uniformState.updatePass(Ee.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function Tyt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Ee.GLOBE,Ee.CESIUM_3D_TILE,Ee.OPAQUE,Ee.TRANSLUCENT];for(let c=0;c<t.length;++c){let d=t[c];if(e.updateDerivedCommands(d),!(!d.castShadows||a.indexOf(d.pass)<0||!e.isVisible(i,d)))if(o)for(let u=0;u<s;++u)r[u].commandList.push(d);else if(s===1)r[0].commandList.push(d);else{let u=!1;for(let h=s-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,d))r[h].commandList.push(d),u=!0;else if(u)break}}}}function WTe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:d}=c;for(let u=0;u<d.length;++u)d[u].commandList.length=0;Tyt(e,n,c);for(let u=0;u<d.length;++u){let h=c.passes[u],{camera:p,commandList:g}=h;s.updateCamera(p),c.updatePass(r,u);for(let f=0;f<g.length;++f){let x=g[f];s.updatePass(x.pass);let _=x.derivedCommands.shadows.castCommands[a];up(_,e,h.passState)}}}}var Syt=new m;li.prototype.updateAndExecuteCommands=function(e,t){wyt(this,e,t),this._environmentState.useWebVR?Cyt(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===ql.ROTATE?wy(!0,this,e):Wyt(this,e)};function Cyt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;PTe(e),n.createPotentiallyVisibleSet(e),XTe(e),r||WTe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=ro.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,d=c*y(e.focalLength,5),u=y(e.eyeSeparation,d/30),h=m.multiplyByScalar(a.right,u*.5,Syt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;m.add(a.position,h,i.position),i.frustum.xOffset=p,Z8(e,t),s.x=s.width,m.subtract(a.position,h,i.position),i.frustum.xOffset=-p,Z8(e,t),ro.clone(a,i)}var Vyt=new he(Math.PI,W.PI_OVER_TWO),Lyt=new m,Ryt=new m,Zyt=new M,Gyt=new M,Eyt=new m,Iyt=new m,Xyt=new ze;function Wyt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=ze.clone(r,Xyt);t.viewport=s;let a=Vyt,c=Lyt;e.mapProjection.project(a,c);let u=m.clone(i.position,Ryt),h=M.clone(i.transform,Gyt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let g=M.computeViewportTransformation(s,0,1,Zyt),f=i.frustum.projectionMatrix,x=i.positionWC.y,_=m.fromElements(W.sign(x)*c.x-x,0,-i.positionWC.x,Eyt),C=vt.pointToGLWindowCoordinates(f,g,_,Iyt);C.x=Math.floor(C.x);let V=s.x,L=s.width;if(x===0||C.x<=V||C.x>=V+L)wy(!0,e,t);else if(Math.abs(V+L*.5-C.x)<1)s.width=C.x-s.x,i.position.x*=W.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!0,e,t),s.x=C.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!1,e,t);else if(C.x>V+L*.5){s.width=C.x-V;let Z=i.frustum.right;i.frustum.right=c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!0,e,t),s.x=C.x,s.width=V+L-C.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=Z-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!1,e,t)}else{s.x=C.x,s.width=V+L-C.x;let Z=i.frustum.left;i.frustum.left=-c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!0,e,t),s.x=V,s.width=C.x-V,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=Z-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),wy(!1,e,t)}i._setTransform(h),m.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function wy(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),PTe(t),i.createPotentiallyVisibleSet(t),e&&(XTe(t),o||WTe(t)),Z8(t,n)}var GTe=new hs;li.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof rn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(ib.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let C=r.dynamicLighting;s.setDynamicLighting(C),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let _=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(_)?_.drawCommand:void 0,n.sunComputeCommand=l(_)?_.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=d&&this.mode===oe.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let h=e.mode===oe.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=GTe.planes;for(let _=0;_<5;++_)g[_]=p.planes[_];p=GTe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let f=this.specularEnvironmentMaps,x=this._specularEnvironmentCubeMap;l(f)&&x?.url!==f?(x=x&&x.destroy(),this._specularEnvironmentCubeMap=new Dm(f)):!l(f)&&l(x)&&(x.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function Pyt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new ep({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function vyt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===oe.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function PTe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Pyt(e),vyt(e),e._globe&&e._globe.render(t)}function wyt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new fA:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;B.clone(n,u.color),u.execute(i,t);let h=r.useGlobeDepthFramebuffer=l(s.globeDepth);h&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),f.update(i,o.useLogDepth,e._hdr),f.clear(i),x=r.usePostProcess=f.ready,r.usePostProcessSelected=x&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&u.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(o.invertClassificationColor.alpha===1&&h&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let V=e._invertClassification.unclassifiedCommand,L=V.derivedCommands;L.oit=p.createDerivedCommands(V,i,L.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}li.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:d}=n,u=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?h.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=h;a&&!s&&(g=u);let f=this.postProcessStages,x=g.getColorTexture(0),_=p.getColorTexture(0),C=y(u,h).getDepthStencilTexture();f.execute(t,x,C,_),f.copy(t,d)}!s&&!c&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function Fyt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function Ayt(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}li.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===Je.CLAMP_TO_TERRAIN||t===Je.RELATIVE_TO_TERRAIN,i=t===Je.CLAMP_TO_3D_TILE||t===Je.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=this.primitives.length;for(let a=0;a<s;++a){let c=this.primitives.get(a);if(!c.isCesium3DTileset||!c.show||!c.enableCollision)continue;let d=c.getHeight(e,this);l(d)&&d>o&&(o=d)}}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var R8=new he;li.prototype.updateHeight=function(e,t,n){let i=()=>{he.clone(e,R8);let g=this.getHeight(e,n);l(g)&&(R8.height=g,t(R8))},o=n===Je.CLAMP_TO_TERRAIN||n===Je.RELATIVE_TO_TERRAIN,r=n===Je.CLAMP_TO_3D_TILE||n===Je.RELATIVE_TO_3D_TILE,s;!r&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,i));let a={},c=this._ellipsoid,d=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let f=g.updateHeight(e,i,c);a[g.id]=f};if(!o){let g=this.primitives.length;for(let f=0;f<g;++f){let x=this.primitives.get(f);d(x)}}let u=this.primitives.primitiveAdded.addEventListener(d),h=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(a[g.id])&&a[g.id](),delete a[g.id])});return()=>{s=s&&s(),Object.values(a).forEach(g=>g()),a={},u(),h()}};function Myt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===oe.SCENE2D||n===oe.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}li.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=Ayt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=Myt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function Nyt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new m0({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function kyt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function Uyt(e){e.primitives.postPassesUpdate(e._frameState),ec.update()}var Dyt=new B;function Byt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=iyt;let r=y(e.backgroundColor,B.BLACK);e._hdr&&(r=B.clone(r,Dyt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof Gp?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=ze.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,_yt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function rS(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Oyt(e){return e._picking.updateMostDetailedRayPicks(e)}li.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=q.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===oe.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(q.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=q.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=W.incrementWrap(t.frameNumber,15e6,1);ETe(this,o,e),t.newFrame=!0}rS(this,kyt),this.primitives.show&&(rS(this,Oyt),rS(this,Yyt),rS(this,Hyt),i||rS(this,zyt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),rS(this,Byt)),Nyt(this,i),rS(this,Uyt),Fyt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};li.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};li.prototype.requestRender=function(){this._renderRequested=!0};li.prototype.clampLineWidth=function(e){return Math.max(Ft.minimumAliasedLineWidth,Math.min(e,Ft.maximumAliasedLineWidth))};li.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};li.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof vy))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return gA.fromKeyframeNode(o,s,c,a)};li.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=UA(s,t,n,i);if(!l(a))return;let c=BA(r,n,i);if(!l(c))return;let d=new DA(t,n,i,a,c);return this._picking.pickMetadata(this,e,d)};li.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};li.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};li.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};li.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Yyt(e){let t=e._frameState;C8.camera=t.camera,C8.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,C8)}function Hyt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;V8.camera=e.preloadFlightCamera,V8.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,V8)}function zyt(e){e.primitives.updateForPass(e._frameState,oyt)}li.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};li.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};li.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};li.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};li.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};li.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};li.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};li.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};li.prototype.cartesianToCanvasCoordinates=function(e,t){return Ui.worldToWindowCoordinates(this,e,t)};li.prototype.completeMorph=function(){this._transitioner.completeMorph()};li.prototype.morphTo2D=function(e){e=y(e,2),this._transitioner.morphTo2D(e,this._ellipsoid)};li.prototype.morphToColumbusView=function(e){e=y(e,2),this._transitioner.morphToColumbusView(e,this._ellipsoid)};li.prototype.morphTo3D=function(e){e=y(e,2),this._transitioner.morphTo3D(e,this._ellipsoid)};function Kyt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}li.prototype.setTerrain=function(e){return Kyt(this,e),e};li.prototype.isDestroyed=function(){return!1};li.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),me(this)};var OA=li;var CHi=T(S(),1);var zYi=T(S(),1),lL=`float interpolateByDistance(vec4 nearFarScalar, float distance) +{ + float startDistance = nearFarScalar.x; + float startValue = nearFarScalar.y; + float endDistance = nearFarScalar.z; + float endValue = nearFarScalar.w; + float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); + return mix(startValue, endValue, t); +} + +void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) +{ + float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; + + // Adjustment to the atmosphere radius applied based on the camera height. + float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; + float distanceAdjustMax = czm_ellipsoidRadii.x; + float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; + float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); + + // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit + // for the position on the ellipsoid. + float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; + float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; + + // Setup the primary ray: from the camera position to the vertex position. + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); + czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + + underTranslucentGlobe = 0.0; + + // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. + #if defined(GLOBE_TRANSLUCENT) + + // Check for intersection with the inner radius of the atmopshere. + czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); + if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { + + // Compute position on globe. + vec3 direction = normalize(positionWC); + czm_ray ellipsoidRay = czm_ray(positionWC, -direction); + czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); + vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); + + // Control the color using the camera angle. + float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); + + // Control the opacity using the distance from Earth. + opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); + vec3 horizonColor = vec3(0.1, 0.2, 0.3); + vec3 nearColor = vec3(0.0); + + rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); + + // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. + underTranslucentGlobe = 1.0; + return; + } + #endif + + computeScattering( + primaryRay, + length(cameraToPositionWC), + lightDirection, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); + + // Alter the opacity based on how close the viewer is to the ground. + // (0.0 = At edge of atmosphere, 1.0 = On ground) + float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; + float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; + opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); + + // Alter alpha based on time of day (0.0 = night , 1.0 = day) + float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; + opacity *= pow(nightAlpha, 0.5); +} +`;var JYi=T(S(),1),YA=`in vec3 v_outerPositionWC; + +uniform vec3 u_hsbShift; + +#ifndef PER_FRAGMENT_ATMOSPHERE +in vec3 v_mieColor; +in vec3 v_rayleighColor; +in float v_opacity; +in float v_translucent; +#endif + +void main (void) +{ + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum); + + vec3 mieColor; + vec3 rayleighColor; + float opacity; + float translucent; + + #ifdef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + v_outerPositionWC, + lightDirection, + rayleighColor, + mieColor, + opacity, + translucent + ); + #else + mieColor = v_mieColor; + rayleighColor = v_rayleighColor; + opacity = v_opacity; + translucent = v_translucent; + #endif + + vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); + + #ifndef HDR + color.rgb = czm_pbrNeutralTonemapping(color.rgb); + color.rgb = czm_inverseGamma(color.rgb); + #endif + + #ifdef COLOR_CORRECT + const bool ignoreBlackPixels = true; + color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels); + #endif + + // For the parts of the sky atmosphere that are not behind a translucent globe, + // we mix in the default opacity so that the sky atmosphere still appears at distance. + // This is needed because the opacity in the sky atmosphere is initially adjusted based + // on the camera height. + if (translucent == 0.0) { + color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); + } + + out_FragColor = color; +} +`;var jYi=T(S(),1),HA=`in vec4 position; + +out vec3 v_outerPositionWC; + +#ifndef PER_FRAGMENT_ATMOSPHERE +out vec3 v_mieColor; +out vec3 v_rayleighColor; +out float v_opacity; +out float v_translucent; +#endif + +void main(void) +{ + vec4 positionWC = czm_model * position; + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum); + + #ifndef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + positionWC.xyz, + lightDirection, + v_rayleighColor, + v_mieColor, + v_opacity, + v_translucent + ); + #endif + + v_outerPositionWC = positionWC.xyz; + gl_Position = czm_modelViewProjection * position; +} +`;function dL(e){e=y(e,ne.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=M.fromScale(n),this._modelMatrix=new M,this._command=new qe({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(dL.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});dL.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var G8=new M;dL.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==oe.SCENE3D&&n!==oe.MORPHING||!e.passes.render)return;let i=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,G8),o=M.multiplyTransformation(i,Po.Y_UP_TO_Z_UP,G8),r=M.multiply(this._scaleMatrix,o,G8);M.clone(r,this._modelMatrix);let s=e.context,a=Jyt(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=Ks.createGeometry(new Ks({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Xe.POSITION_ONLY}));u.vertexArray=ni.fromGeometry({context:s,geometry:p,attributeLocations:Fn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),u.renderState=Ue.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:un.ALPHA_BLEND,depthMask:!1})}let h=a|d<<2|c<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new De({defines:p,sources:[jm,lL,HA]}),f=new De({defines:p,sources:[jm,lL,YA]});this._spSkyAtmosphere=$t.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function Jyt(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}dL.prototype.isDestroyed=function(){return!1};dL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),me(this)};var zA=dL;var QHi=T(S(),1);var LHi=T(S(),1),KA=`uniform samplerCube u_cubeMap; + +in vec3 v_texCoord; + +void main() +{ + vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); + out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); +} +`;var ZHi=T(S(),1),JA=`in vec3 position; +out vec3 v_texCoord; + +void main() +{ + vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); + gl_Position = czm_projection * vec4(p, 1.0); + v_texCoord = position.xyz; +} +`;function mL(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new qe({modelMatrix:M.clone(M.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}mL.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?oE(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}).catch(c=>{this._hasError=!0,this._error=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new xr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Ea.createGeometry(Ea.fromDimensions({dimensions:new m(2,2,2),vertexFormat:Xe.POSITION_ONLY})),c=this._attributeLocations=Fn.createAttributeLocations(a);s.vertexArray=ni.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Me.STATIC_DRAW}),s.renderState=Ue.fromCache({blending:un.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new De({defines:[t?"HDR":""],sources:[KA]});s.shaderProgram=$t.fromCache({context:r,vertexShaderSource:JA,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};mL.prototype.isDestroyed=function(){return!1};mL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),me(this)};function uL(e){return nn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}mL.createEarthSkyBox=function(){return new mL({sources:{positiveX:uL("px"),negativeX:uL("mx"),positiveY:uL("py"),negativeY:uL("my"),positiveZ:uL("pz"),negativeZ:uL("mz")}})};var QA=mL;var Xzi=T(S(),1);var qHi=T(S(),1),jA=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 color = texture(u_texture, v_textureCoordinates); + out_FragColor = czm_gammaCorrect(color); +} +`;var ezi=T(S(),1),qA=`uniform float u_radiusTS; + +in vec2 v_textureCoordinates; + +vec2 rotate(vec2 p, vec2 direction) +{ + return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); +} + +vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +{ + vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); + float radius = length(rotatedPosition) * lengthScalar; + float burst = 1.0 - smoothstep(0.0, 0.55, radius); + return vec4(burst); +} + +void main() +{ + float lengthScalar = 2.0 / sqrt(2.0); + vec2 position = v_textureCoordinates - vec2(0.5); + float radius = length(position) * lengthScalar; + float surface = step(radius, u_radiusTS); + vec4 color = vec4(vec2(1.0), surface + 0.2, surface); + + float glow = 1.0 - smoothstep(0.0, 0.55, radius); + color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; + + vec4 burst = vec4(0.0); + + // The following loop has been manually unrolled for speed, to + // avoid sin() and cos(). + // + //for (float i = 0.4; i < 3.2; i += 1.047) { + // vec2 direction = vec2(sin(i), cos(i)); + // burst += 0.4 * addBurst(position, direction, lengthScalar); + // + // direction = vec2(sin(i - 0.08), cos(i - 0.08)); + // burst += 0.3 * addBurst(position, direction, lengthScalar); + //} + + burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 + burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 + burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 + + burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 + + // End of manual loop unrolling. + + color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; + + out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +} +`;var nzi=T(S(),1),$A=`in vec2 direction; + +uniform float u_size; + +out vec2 v_textureCoordinates; + +void main() +{ + vec4 position; + if (czm_morphTime == 1.0) + { + position = vec4(czm_sunPositionWC, 1.0); + } + else + { + position = vec4(czm_sunPositionColumbusView.zxy, 1.0); + } + + vec4 positionEC = czm_view * position; + vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + + vec2 halfSize = vec2(u_size * 0.5); + halfSize *= ((direction * 2.0) - 1.0); + + gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); + + v_textureCoordinates = direction; +} +`;function tM(){this.show=!0,this._drawCommand=new qe({primitiveType:we.TRIANGLES,boundingVolume:new le,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new le,this._boundingVolume2D=new le,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(tM.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Qyt=new D,jyt=new D,qyt=new se,eM=new se;tM.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===oe.SCENE2D||i===oe.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let Z=Math.max(r,s);Z=Math.pow(2,Math.ceil(Math.log(Z)/Math.log(2))-2),Z=Math.max(1,Z);let G=n?o.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._texture=new Xt({context:o,width:Z,height:Z,pixelFormat:nt.RGBA,pixelDatatype:G}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let I=this,v={u_radiusTS:function(){return I._radiusTS}};this._commands.computeCommand=new vc({fragmentShaderSource:qA,outputTexture:this._texture,uniformMap:v,persists:!1,owner:this,postExecute:function(){I._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let Z={direction:0},G=new Uint8Array(4*2);G[0]=0,G[1]=0,G[2]=255,G[3]=0,G[4]=255,G[5]=255,G[6]=0,G[7]=255;let I=yt.createVertexBuffer({context:o,typedArray:G,usage:Me.STATIC_DRAW}),v=[{index:Z.direction,vertexBuffer:I,componentsPerAttribute:2,normalize:!0,componentDatatype:Q.UNSIGNED_BYTE}],P=yt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});a.vertexArray=new ni({context:o,attributes:v,indexBuffer:P}),a.shaderProgram=$t.fromCache({context:o,vertexShaderSource:$A,fragmentShaderSource:jA,attributeLocations:Z}),a.renderState=Ue.fromCache({blending:un.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,h=this._boundingVolume2D;m.clone(c,u.center),h.center.x=d.z,h.center.y=d.x,h.center.z=d.y,u.radius=W.SOLAR_RADIUS+W.SOLAR_RADIUS*this._glowLengthTS,h.radius=u.radius,i===oe.SCENE3D?le.clone(u,a.boundingVolume):i===oe.COLUMBUS_VIEW&&le.clone(h,a.boundingVolume);let p=Ui.computeActualEllipsoidPosition(e,c,eM),g=m.magnitude(m.subtract(p,e.camera.position,eM)),f=o.uniformState.projection,x=qyt;x.x=0,x.y=0,x.z=-g,x.w=1;let _=M.multiplyByVector(f,x,eM),C=Ui.clipToGLWindowCoordinates(t.viewport,_,Qyt);x.x=W.SOLAR_RADIUS;let V=M.multiplyByVector(f,x,eM),L=Ui.clipToGLWindowCoordinates(t.viewport,V,jyt);return this._size=D.magnitude(D.subtract(L,C,eM)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};tM.prototype.isDestroyed=function(){return!1};tM.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),me(this)};var nM=tM;var AKi=T(S(),1);var xKi=T(S(),1);var FTe=T(D9(),1);var Pzi=T(S(),1);function $yt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); vec4 clippingPlanesEdgeColor = vec4(1.0); clippingPlanesEdgeColor.rgb = ${n}.rgb; float clippingPlanesEdgeWidth = ${n}.a; @@ -15788,7 +15351,7 @@ Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_ { out_FragColor = clippingPlanesEdgeColor; } -`}var s9=Jyt;var Uzi=T(S(),1);var Qyt={modifyFragmentShader:function(t){return t=De.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +`}var iM=$yt;var Fzi=T(S(),1);var ext={modifyFragmentShader:function(t){return t=De.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; void main() { #ifndef SHADOW_MAP @@ -15797,9 +15360,9 @@ void main() #endif czm_splitter_main(); } -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},dL=Qyt;var oS={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function a9(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=B.clone(B.DARKGRAY),this._highlightColor=B.clone(B.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=oS.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,Ee.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.time=0,this.shadows=_n.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,vr.NONE),this._splittingEnabled=!1,this._error=void 0,jyt(this,e)}Object.defineProperties(a9.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return B.clone(this._highlightColor)},set:function(e){this._highlightColor=B.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=le.clone(e,this._boundingSphere)}}});function jyt(e,t){let n=L_.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=Op.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=oS.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=B.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var qyt=new m,$yt=new m,ext=new m,WTe,FB;function txt(e){if(!l(FB)){WTe=new vTe.default(0),FB=new Array(e);for(let t=0;t<e;++t)FB[t]=WTe.random()}return FB}function nxt(e){let n=e.length/3,i=Math.min(n,20),o=txt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(r,r,r,qyt),c=m.fromElements(s,s,s,$yt);for(let u=0;u<i;++u){let h=Math.floor(o[u]*n),p=m.unpack(e,h*3,ext);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let d=le.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function PTe(e,t){let n=Q.fromTypedArray(e);return n===Q.INT||n===Q.UNSIGNED_INT||n===Q.DOUBLE?(_t("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var ixt=new se,oxt=new se,rxt=new B,wTe=0,AB=1,W8=2,FTe=3,sxt=4,G8=new M,axt=new M;function cxt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,d=i.styleableProperties,u=l(d),h=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,f=e._isOctEncodedDraco,x=e._quantizedRange,_=e._octEncodedRange,C=e._isRGB565,V=e._isTranslucent,L=e._hasColors,Z=e._hasNormals,G=e._hasBatchIds,I,v,P=[],w={};if(e._styleableShaderAttributes=w,u){let U=sxt;for(let Y in d)if(d.hasOwnProperty(Y)){let k=d[Y],H=PTe(k.typedArray,Y);I=k.componentCount,v=Q.fromTypedArray(H);let J=xt.createVertexBuffer({context:n,typedArray:H,usage:Me.STATIC_DRAW});e._geometryByteLength+=J.sizeInBytes;let te={index:U,vertexBuffer:J,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push(te),w[Y]={location:U,componentCount:I},++U}}let F=xt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=F.sizeInBytes;let b;L&&(b=xt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let R;Z&&(R=xt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=R.sizeInBytes);let E;G&&(c.typedArray=PTe(c.typedArray,"batchIds"),E=xt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let X=[];if(h?v=Q.UNSIGNED_SHORT:p?v=x<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT:v=Q.FLOAT,X.push({index:wTe,vertexBuffer:F,componentsPerAttribute:3,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=le.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=nxt(r.typedArray)),L)if(C)X.push({index:AB,vertexBuffer:b,componentsPerAttribute:1,componentDatatype:Q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let U=V?4:3;X.push({index:AB,vertexBuffer:b,componentsPerAttribute:U,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}Z&&(g?(I=2,v=Q.UNSIGNED_BYTE):f?(I=2,v=_<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT):(I=3,v=Q.FLOAT),X.push({index:W8,vertexBuffer:R,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0})),G&&X.push({index:FTe,vertexBuffer:E,componentsPerAttribute:1,componentDatatype:Q.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(X=X.concat(P));let A=new ei({context:n,attributes:X}),N={depthTest:{enabled:!0}},O={depthTest:{enabled:!0},depthMask:!1,blending:mn.ALPHA_BLEND};e._opaquePass===Ee.CESIUM_3D_TILE&&(N.stencilTest=Dt.setCesium3DTileBit(),N.stencilMask=Dt.CESIUM_3D_TILE_MASK,O.stencilTest=Dt.setCesium3DTileBit(),O.stencilMask=Dt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ue.fromCache(N),e._translucentRenderState=Ue.fromCache(O),e._drawCommand=new qe({boundingVolume:new le,cull:e._cull,modelMatrix:new M,primitiveType:we.POINTS,vertexArray:A,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:V?e._translucentRenderState:e._opaqueRenderState,pass:V?Ee.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function lxt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=ixt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,d;t.mode===oe.SCENE2D||c instanceof an?d=Number.POSITIVE_INFINITY:d=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=d}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return B.TRANSPARENT;let c=B.clone(a.edgeColor,rxt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return M.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);M.multiply(n.uniformState.view3D,c,G8);let d=M.multiply(G8,a.modelMatrix,G8);return M.inverseTranspose(d,axt)}};dL.addUniforms(e,s),(i||o||r)&&(s=St(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=oxt;if(l(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function E8(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function I8(e,t){e=e.slice(e.indexOf(` -`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function X8(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var dxt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function uxt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,f=e._hasColors,x=e._hasNormals,_=e._hasBatchIds,C=e._backFaceCulling,V=e._normalShading,L=e._drawCommand.vertexArray,Z=e.clippingPlanes,G=e._attenuation,I,v,P,w=g,F=Ye(dxt),b={},R=e._styleableShaderAttributes;for(o in R)R.hasOwnProperty(o)&&(r=R[o],F[o]=`czm_3dtiles_property_${r.location}`,b[r.location]=r);if(a){let de={translucent:!1},ye="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";I=n.getColorShaderFunction(`getColorFromStyle${ye}`,F,de),v=n.getShowShaderFunction(`getShowFromStyle${ye}`,F,de),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,F,de),l(I)&&de.translucent&&(w=!0)}e._styleTranslucent=w;let E=l(I),X=l(v),A=l(P),N=e.isClipped,O=[],U=[];E&&(E8(I,O),I8(I,U)),X&&(E8(v,O),I8(v,U)),A&&(E8(P,O),I8(P,U));let Y=U.indexOf("COLOR")>=0,k=U.indexOf("NORMAL")>=0;if(k&&!x)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");for(o in R)if(R.hasOwnProperty(o)){r=R[o];let de=O.indexOf(r.location)>=0,ye=X8(L,r.location);ye.enabled=de}let H=f&&(!E||Y);if(f){let de=X8(L,AB);de.enabled=H}let J=x&&(V||C||k);if(x){let de=X8(L,W8);de.enabled=J}let te={a_position:wTe};H&&(te.a_color=AB),J&&(te.a_normal=W8),_&&(te.a_batchId=FTe);let z="",j=O.length;for(i=0;i<j;++i){let de=O[i];r=b[de];let ye=r.componentCount,Te=`czm_3dtiles_property_${de}`,Ie;ye===1?Ie="float":Ie=`vec${ye}`,z+=`in ${Ie} ${Te}; -`,te[Te]=r.location}lxt(e,t);let ee=`in vec3 a_position; +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},hL=ext;var sS={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function oM(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=B.clone(B.DARKGRAY),this._highlightColor=B.clone(B.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=sS.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,Ee.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.time=0,this.shadows=_n.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,vr.NONE),this._splittingEnabled=!1,this._error=void 0,txt(this,e)}Object.defineProperties(oM.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return B.clone(this._highlightColor)},set:function(e){this._highlightColor=B.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=le.clone(e,this._boundingSphere)}}});function txt(e,t){let n=L_.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=Yp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=sS.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=B.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var nxt=new m,ixt=new m,oxt=new m,vTe,AB;function rxt(e){if(!l(AB)){vTe=new FTe.default(0),AB=new Array(e);for(let t=0;t<e;++t)AB[t]=vTe.random()}return AB}function sxt(e){let n=e.length/3,i=Math.min(n,20),o=rxt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(r,r,r,nxt),c=m.fromElements(s,s,s,ixt);for(let u=0;u<i;++u){let h=Math.floor(o[u]*n),p=m.unpack(e,h*3,oxt);m.minimumByComponent(a,p,a),m.maximumByComponent(c,p,c)}let d=le.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function wTe(e,t){let n=Q.fromTypedArray(e);return n===Q.INT||n===Q.UNSIGNED_INT||n===Q.DOUBLE?(xt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var axt=new se,cxt=new se,lxt=new B,ATe=0,MB=1,P8=2,MTe=3,dxt=4,E8=new M,uxt=new M;function mxt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,d=i.styleableProperties,u=l(d),h=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,f=e._isOctEncodedDraco,x=e._quantizedRange,_=e._octEncodedRange,C=e._isRGB565,V=e._isTranslucent,L=e._hasColors,Z=e._hasNormals,G=e._hasBatchIds,I,v,P=[],w={};if(e._styleableShaderAttributes=w,u){let U=dxt;for(let Y in d)if(d.hasOwnProperty(Y)){let k=d[Y],H=wTe(k.typedArray,Y);I=k.componentCount,v=Q.fromTypedArray(H);let J=yt.createVertexBuffer({context:n,typedArray:H,usage:Me.STATIC_DRAW});e._geometryByteLength+=J.sizeInBytes;let te={index:U,vertexBuffer:J,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push(te),w[Y]={location:U,componentCount:I},++U}}let F=yt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=F.sizeInBytes;let b;L&&(b=yt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let R;Z&&(R=yt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=R.sizeInBytes);let E;G&&(c.typedArray=wTe(c.typedArray,"batchIds"),E=yt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let X=[];if(h?v=Q.UNSIGNED_SHORT:p?v=x<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT:v=Q.FLOAT,X.push({index:ATe,vertexBuffer:F,componentsPerAttribute:3,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=le.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=sxt(r.typedArray)),L)if(C)X.push({index:MB,vertexBuffer:b,componentsPerAttribute:1,componentDatatype:Q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let U=V?4:3;X.push({index:MB,vertexBuffer:b,componentsPerAttribute:U,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}Z&&(g?(I=2,v=Q.UNSIGNED_BYTE):f?(I=2,v=_<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT):(I=3,v=Q.FLOAT),X.push({index:P8,vertexBuffer:R,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0})),G&&X.push({index:MTe,vertexBuffer:E,componentsPerAttribute:1,componentDatatype:Q.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(X=X.concat(P));let A=new ni({context:n,attributes:X}),N={depthTest:{enabled:!0}},O={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===Ee.CESIUM_3D_TILE&&(N.stencilTest=Ut.setCesium3DTileBit(),N.stencilMask=Ut.CESIUM_3D_TILE_MASK,O.stencilTest=Ut.setCesium3DTileBit(),O.stencilMask=Ut.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ue.fromCache(N),e._translucentRenderState=Ue.fromCache(O),e._drawCommand=new qe({boundingVolume:new le,cull:e._cull,modelMatrix:new M,primitiveType:we.POINTS,vertexArray:A,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:V?e._translucentRenderState:e._opaqueRenderState,pass:V?Ee.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function hxt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=axt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,d;t.mode===oe.SCENE2D||c instanceof rn?d=Number.POSITIVE_INFINITY:d=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=d}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return B.TRANSPARENT;let c=B.clone(a.edgeColor,lxt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return M.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);M.multiply(n.uniformState.view3D,c,E8);let d=M.multiply(E8,a.modelMatrix,E8);return M.inverseTranspose(d,uxt)}};hL.addUniforms(e,s),(i||o||r)&&(s=Tt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=cxt;if(l(e._quantizedVolumeScale)){let c=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function I8(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function X8(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function W8(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var fxt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function pxt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,f=e._hasColors,x=e._hasNormals,_=e._hasBatchIds,C=e._backFaceCulling,V=e._normalShading,L=e._drawCommand.vertexArray,Z=e.clippingPlanes,G=e._attenuation,I,v,P,w=g,F=Ye(fxt),b={},R=e._styleableShaderAttributes;for(o in R)R.hasOwnProperty(o)&&(r=R[o],F[o]=`czm_3dtiles_property_${r.location}`,b[r.location]=r);if(a){let de={translucent:!1},xe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";I=n.getColorShaderFunction(`getColorFromStyle${xe}`,F,de),v=n.getShowShaderFunction(`getShowFromStyle${xe}`,F,de),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${xe}`,F,de),l(I)&&de.translucent&&(w=!0)}e._styleTranslucent=w;let E=l(I),X=l(v),A=l(P),N=e.isClipped,O=[],U=[];E&&(I8(I,O),X8(I,U)),X&&(I8(v,O),X8(v,U)),A&&(I8(P,O),X8(P,U));let Y=U.indexOf("COLOR")>=0,k=U.indexOf("NORMAL")>=0;if(k&&!x)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");for(o in R)if(R.hasOwnProperty(o)){r=R[o];let de=O.indexOf(r.location)>=0,xe=W8(L,r.location);xe.enabled=de}let H=f&&(!E||Y);if(f){let de=W8(L,MB);de.enabled=H}let J=x&&(V||C||k);if(x){let de=W8(L,P8);de.enabled=J}let te={a_position:ATe};H&&(te.a_color=MB),J&&(te.a_normal=P8),_&&(te.a_batchId=MTe);let z="",j=O.length;for(i=0;i<j;++i){let de=O[i];r=b[de];let xe=r.componentCount,Se=`czm_3dtiles_property_${de}`,Ie;xe===1?Ie="float":Ie=`vec${xe}`,z+=`in ${Ie} ${Se}; +`,te[Se]=r.location}hxt(e,t);let ee=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; @@ -15870,22 +15433,459 @@ const float NORMALIZE_5 = 1.0 / 32.0; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; `,fe+=` -`,fe+=o0(Z,s),fe+=` +`,fe+=r0(Z,s),fe+=` `),fe+=`void main() { out_FragColor = czm_gammaCorrect(v_color); -`,N&&(fe+=s9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),fe+=`} -`,e.splitDirection!==vr.NONE&&(fe=dL.modifyFragmentShader(fe)),l(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),l(e._fragmentShaderLoaded)&&(fe=e._fragmentShaderLoaded(fe));let _e=e._drawCommand;l(_e.shaderProgram)&&_e.shaderProgram.destroy(),_e.shaderProgram=en.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:fe,attributeLocations:te});try{_e.shaderProgram._bind()}catch{throw new ae("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function mxt(e,t){if(e._decodingState===oS.READY)return!1;if(e._decodingState===oS.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=jp.decodePointCloud(i,t);l(o)&&(e._decodingState=oS.DECODING,o.then(function(r){e._decodingState=oS.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,d=l(r.NORMAL)?r.NORMAL.array:void 0,u=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=l(s)&&l(r.POSITION.data.quantization),p=l(d)&&l(r.NORMAL.data.quantization);if(h){let _=r.POSITION.data.quantization,C=_.range;e._quantizedVolumeScale=m.fromElements(C,C,C),e._quantizedVolumeOffset=m.unpack(_.minValues),e._quantizedRange=(1<<_.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,f=i.batchTableProperties;for(let _ in f)if(f.hasOwnProperty(_)){let C=r[_];l(g)||(g={}),g[_]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=g}).catch(function(r){e._decodingState=oS.FAILED,e._error=r}))}return!0}var hxt=new se,fxt=new m;a9.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(mxt(this,t))return;let i=!1,o=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(cxt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){M.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,d),l(this._rtcCenter)&&M.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&M.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==oe.SCENE3D){let h=e.mapProjection,p=M.getColumn(d,3,hxt);se.equals(p,se.UNIT_W)||wt.basisTo2D(h,d,d)}let u=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,u),this._cull){let h=u.center;M.multiplyByPoint(d,h,h);let p=M.getScale(d,fxt);u.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==vr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&uxt(this,e,this._style),this._drawCommand.castShadows=_n.castShadows(this.shadows),this._drawCommand.receiveShadows=_n.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ee.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};a9.prototype.isDestroyed=function(){return!1};a9.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),me(this)};var c9=a9;function sS(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this.shadows=y(e.shadows,_n.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new xf(e.shading),this.style=e.style,this.frameFailed=new be,this.frameChanged=new be,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new ab,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(sS.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){fs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function pxt(e){return`uniform vec4 czm_pickColor; -${e}`}function bxt(e){return function(t){return St(t,{czm_pickColor:function(){return e._pickId.color}})}}function gxt(){return"czm_pickColor"}sS.prototype.makeStyleDirty=function(){this._styleDirty=!0};sS.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var yxt=new q;function v8(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function rS(e,t){return e._intervals.indexOf(t.start)}function xxt(e,t){let n=e._intervals,i=e._clock,o=v8(e);if(o===0)return;let r=e._getAverageLoadTime(),s=q.addSeconds(i.currentTime,r*o,yxt),a=n.indexOf(s),c=rS(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function _xt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function Txt(e,t,n){let i=v8(e),o=rS(e,t),r=rS(e,n);return i>=0?o>=r:o<=r}function MTe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function Sxt(e,t,n){let i=rS(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?M.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:_i(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Ze.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new c9({arrayBuffer:d,cull:!0,fragmentShaderLoaded:pxt,uniformMapLoaded:bxt(e),pickIdLoaded:gxt})}).catch(MTe(e,c))}return r}function Cxt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function Vxt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(NTe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(_i()-t.timestamp)/1e3;Cxt(e,a)}}t.touchedFrameNumber=i.frameNumber}var Lxt=new M;function Rxt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?W.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function Zxt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var Gxt=new xf;function NTe(e,t,n,i){let o=y(e.shading,Gxt),r=t.pointCloud,s=y(t.transform,M.IDENTITY);r.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,Lxt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=Rxt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=Zxt(e);try{r.update(i)}catch(a){MTe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function P8(e,t,n,i){let o=Sxt(e,t,i);Vxt(e,o,n,i)}function Ext(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function kTe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function Ixt(e,t){let n=rS(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function ATe(e,t,n,i,o){return l(n)?n.ready?!0:(P8(e,t,i,o),n.ready):!1}function Xxt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=rS(e,n),h=rS(e,t);if(u>=h){for(r=u;r>=h;--r)if(s=c.get(r),a=d[r],ATe(e,s,a,i,o))return s}else for(r=u;r<=h;++r)if(s=c.get(r),a=d[r],ATe(e,s,a,i,o))return s;return t}function Wxt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var uL={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};sS.prototype.update=function(e){if(e.mode===oe.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=q.clone(e.time));let t=Math.max(q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&Wxt(this,o,s),uL.timeSinceLoad=t,uL.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,h=this._previousInterval,p=this._nextInterval,g=_xt(this);if(!l(g))return;let f=!1,x=v8(this),_=x===0;x!==this._clockMultiplier&&(f=!0,this._clockMultiplier=x),(!l(h)||_)&&(h=g),(!l(p)||f||Txt(this,g,p))&&(p=xxt(this,g)),h=Xxt(this,h,g,uL,e);let C=Ixt(this,h);l(C)||(P8(this,h,uL,e),C=this._lastRenderedFrame),l(C)&&NTe(this,C,uL,e),l(p)&&P8(this,p,uL,e);let V=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(C)&&C!==this._lastRenderedFrame&&V.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return V.frameChanged.raiseEvent(V),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=C;let L=this._totalMemoryUsageInBytes,Z=this.maximumMemoryUsage*1024*1024;L>Z&&kTe(this,Ext(e));let I=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&I>0&&c.update(e,u,a,this.boundingSphere)};sS.prototype.isDestroyed=function(){return!1};sS.prototype.destroy=function(){return kTe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var mL=sS;function UTe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function Pxt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function DTe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function BTe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=DTe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function OTe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Go(e,t){e=Xn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Ot.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Ot.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Xn(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?Xn(t.creditViewport):n,u=y(t.showRenderLoopErrors,!0),h=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=d,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=h,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new be,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new ph,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),BTe(this);try{let p=y(t.ellipsoid,ne.default),g=new e9({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=m.UNIT_Z,DTe(this),OTe(this);let f=t.globe;l(f)||(f=new sF(p)),f!==!1&&(g.globe=f,g.globe.shadows=y(t.terrainShadows,_n.RECEIVE_ONLY));let x=t.skyBox;!l(x)&&ne.WGS84.equals(p)&&(x=n9.createEarthSkyBox()),x!==!1&&(g.skyBox=x,g.sun=new r9,ne.WGS84.equals(p)&&(g.moon=new mF));let _=t.skyAtmosphere;!l(_)&&ne.WGS84.equals(p)&&(_=new t9(p),_.show=t.globe!==!1&&f.show),_!==!1&&(g.skyAtmosphere=_);let C=t.baseLayer;t.globe!==!1&&C!==!1&&(l(C)||(C=Ua.fromWorldImagery()),g.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new eu(i),l(t.sceneMode)&&(t.sceneMode===oe.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===oe.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let V=this;this._onRenderError=function(P,w){V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors&&V.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,w)},g.renderError.addEventListener(this._onRenderError);let L=t.dataSources,Z=!1;l(L)||(L=new hv,Z=!0);let G=new jv({scene:g,dataSourceCollection:L}),I=new dr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=L,this._destroyDataSourceCollection=Z,this._dataSourceDisplay=G,this._eventHelper=I,this._canAnimateUpdateCallback=this._updateCanAnimate,I.add(this._clock.onTick,Go.prototype._onTick,this),I.add(g.morphStart,Go.prototype._clearTrackedObject,this),I.add(L.dataSourceAdded,Go.prototype._onDataSourceAdded,this),I.add(L.dataSourceRemoved,Go.prototype._onDataSourceRemoved,this),I.add(g.postRender,Go.prototype._postRender,this);let v=L.length;for(let P=0;P<v;P++)this._dataSourceAdded(L,L.get(P));this._dataSourceAdded(void 0,G.defaultDataSource),I.add(L.dataSourceAdded,Go.prototype._dataSourceAdded,this),I.add(L.dataSourceRemoved,Go.prototype._dataSourceRemoved,this)}catch(p){throw u&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Go.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&Pxt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,w8(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===oe.COLUMBUS_VIEW||n===oe.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===oe.COLUMBUS_VIEW||n===oe.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(M.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,UTe(this.clock,e))}}});Go.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let d=l(t),u=l(n);if(d||u){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),u){let f=zf(n);d||(typeof n=="string"&&(n=new Error(n)),t=zf({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e} +`,N&&(fe+=iM("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),fe+=`} +`,e.splitDirection!==vr.NONE&&(fe=hL.modifyFragmentShader(fe)),l(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),l(e._fragmentShaderLoaded)&&(fe=e._fragmentShaderLoaded(fe));let Te=e._drawCommand;l(Te.shaderProgram)&&Te.shaderProgram.destroy(),Te.shaderProgram=$t.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:fe,attributeLocations:te});try{Te.shaderProgram._bind()}catch{throw new ae("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function bxt(e,t){if(e._decodingState===sS.READY)return!1;if(e._decodingState===sS.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=qp.decodePointCloud(i,t);l(o)&&(e._decodingState=sS.DECODING,o.then(function(r){e._decodingState=sS.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,d=l(r.NORMAL)?r.NORMAL.array:void 0,u=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=l(s)&&l(r.POSITION.data.quantization),p=l(d)&&l(r.NORMAL.data.quantization);if(h){let _=r.POSITION.data.quantization,C=_.range;e._quantizedVolumeScale=m.fromElements(C,C,C),e._quantizedVolumeOffset=m.unpack(_.minValues),e._quantizedRange=(1<<_.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,f=i.batchTableProperties;for(let _ in f)if(f.hasOwnProperty(_)){let C=r[_];l(g)||(g={}),g[_]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=g}).catch(function(r){e._decodingState=sS.FAILED,e._error=r}))}return!0}var gxt=new se,yxt=new m;oM.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(bxt(this,t))return;let i=!1,o=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(mxt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){M.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,d),l(this._rtcCenter)&&M.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&M.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==oe.SCENE3D){let h=e.mapProjection,p=M.getColumn(d,3,gxt);se.equals(p,se.UNIT_W)||vt.basisTo2D(h,d,d)}let u=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,u),this._cull){let h=u.center;M.multiplyByPoint(d,h,h);let p=M.getScale(d,yxt);u.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==vr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&pxt(this,e,this._style),this._drawCommand.castShadows=_n.castShadows(this.shadows),this._drawCommand.receiveShadows=_n.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ee.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};oM.prototype.isDestroyed=function(){return!1};oM.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),me(this)};var rM=oM;function cS(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this.shadows=y(e.shadows,_n.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new xf(e.shading),this.style=e.style,this.frameFailed=new ge,this.frameChanged=new ge,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new cb,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(cS.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){fs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function xxt(e){return`uniform vec4 czm_pickColor; +${e}`}function _xt(e){return function(t){return Tt(t,{czm_pickColor:function(){return e._pickId.color}})}}function Txt(){return"czm_pickColor"}cS.prototype.makeStyleDirty=function(){this._styleDirty=!0};cS.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var Sxt=new q;function w8(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function aS(e,t){return e._intervals.indexOf(t.start)}function Cxt(e,t){let n=e._intervals,i=e._clock,o=w8(e);if(o===0)return;let r=e._getAverageLoadTime(),s=q.addSeconds(i.currentTime,r*o,Sxt),a=n.indexOf(s),c=aS(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function Vxt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function Lxt(e,t,n){let i=w8(e),o=aS(e,t),r=aS(e,n);return i>=0?o>=r:o<=r}function kTe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function Rxt(e,t,n){let i=aS(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?M.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ti(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Ze.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new rM({arrayBuffer:d,cull:!0,fragmentShaderLoaded:xxt,uniformMapLoaded:_xt(e),pickIdLoaded:Txt})}).catch(kTe(e,c))}return r}function Zxt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function Gxt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(UTe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ti()-t.timestamp)/1e3;Zxt(e,a)}}t.touchedFrameNumber=i.frameNumber}var Ext=new M;function Ixt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?W.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function Xxt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var Wxt=new xf;function UTe(e,t,n,i){let o=y(e.shading,Wxt),r=t.pointCloud,s=y(t.transform,M.IDENTITY);r.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,Ext),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=Ixt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=Xxt(e);try{r.update(i)}catch(a){kTe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function v8(e,t,n,i){let o=Rxt(e,t,i);Gxt(e,o,n,i)}function Pxt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function DTe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function vxt(e,t){let n=aS(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function NTe(e,t,n,i,o){return l(n)?n.ready?!0:(v8(e,t,i,o),n.ready):!1}function wxt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=aS(e,n),h=aS(e,t);if(u>=h){for(r=u;r>=h;--r)if(s=c.get(r),a=d[r],NTe(e,s,a,i,o))return s}else for(r=u;r<=h;++r)if(s=c.get(r),a=d[r],NTe(e,s,a,i,o))return s;return t}function Fxt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var fL={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};cS.prototype.update=function(e){if(e.mode===oe.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=q.clone(e.time));let t=Math.max(q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&Fxt(this,o,s),fL.timeSinceLoad=t,fL.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,h=this._previousInterval,p=this._nextInterval,g=Vxt(this);if(!l(g))return;let f=!1,x=w8(this),_=x===0;x!==this._clockMultiplier&&(f=!0,this._clockMultiplier=x),(!l(h)||_)&&(h=g),(!l(p)||f||Lxt(this,g,p))&&(p=Cxt(this,g)),h=wxt(this,h,g,fL,e);let C=vxt(this,h);l(C)||(v8(this,h,fL,e),C=this._lastRenderedFrame),l(C)&&UTe(this,C,fL,e),l(p)&&v8(this,p,fL,e);let V=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(C)&&C!==this._lastRenderedFrame&&V.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return V.frameChanged.raiseEvent(V),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=C;let L=this._totalMemoryUsageInBytes,Z=this.maximumMemoryUsage*1024*1024;L>Z&&DTe(this,Pxt(e));let I=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&I>0&&c.update(e,u,a,this.boundingSphere)};cS.prototype.isDestroyed=function(){return!1};cS.prototype.destroy=function(){return DTe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var pL=cS;function BTe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function Axt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function OTe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function YTe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=OTe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function HTe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Go(e,t){e=Xn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Bt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Bt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Xn(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?Xn(t.creditViewport):n,u=y(t.showRenderLoopErrors,!0),h=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=d,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=h,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new ge,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new ph,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),YTe(this);try{let p=y(t.ellipsoid,ne.default),g=new OA({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=m.UNIT_Z,OTe(this),HTe(this);let f=t.globe;l(f)||(f=new Ow(p)),f!==!1&&(g.globe=f,g.globe.shadows=y(t.terrainShadows,_n.RECEIVE_ONLY));let x=t.skyBox;!l(x)&&ne.WGS84.equals(p)&&(x=QA.createEarthSkyBox()),x!==!1&&(g.skyBox=x,g.sun=new nM,ne.WGS84.equals(p)&&(g.moon=new Qw));let _=t.skyAtmosphere;!l(_)&&ne.WGS84.equals(p)&&(_=new zA(p),_.show=t.globe!==!1&&f.show),_!==!1&&(g.skyAtmosphere=_);let C=t.baseLayer;t.globe!==!1&&C!==!1&&(l(C)||(C=Ba.fromWorldImagery()),g.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new tu(i),l(t.sceneMode)&&(t.sceneMode===oe.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===oe.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let V=this;this._onRenderError=function(P,w){V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors&&V.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,w)},g.renderError.addEventListener(this._onRenderError);let L=t.dataSources,Z=!1;l(L)||(L=new JP,Z=!0);let G=new Pv({scene:g,dataSourceCollection:L}),I=new dr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=L,this._destroyDataSourceCollection=Z,this._dataSourceDisplay=G,this._eventHelper=I,this._canAnimateUpdateCallback=this._updateCanAnimate,I.add(this._clock.onTick,Go.prototype._onTick,this),I.add(g.morphStart,Go.prototype._clearTrackedObject,this),I.add(L.dataSourceAdded,Go.prototype._onDataSourceAdded,this),I.add(L.dataSourceRemoved,Go.prototype._onDataSourceRemoved,this),I.add(g.postRender,Go.prototype._postRender,this);let v=L.length;for(let P=0;P<v;P++)this._dataSourceAdded(L,L.get(P));this._dataSourceAdded(void 0,G.defaultDataSource),I.add(L.dataSourceAdded,Go.prototype._dataSourceAdded,this),I.add(L.dataSourceRemoved,Go.prototype._dataSourceRemoved,this)}catch(p){throw u&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Go.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&Axt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,F8(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===oe.COLUMBUS_VIEW||n===oe.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===oe.COLUMBUS_VIEW||n===oe.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(M.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,BTe(this.clock,e))}}});Go.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let d=l(t),u=l(n);if(d||u){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),u){let f=Kf(n);d||(typeof n=="string"&&(n=new Error(n)),t=Kf({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e} ${t} -${f}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let _=document.createElement("span");_.className="cesium-widget-errorPanel-more-details",_.appendChild(document.createTextNode("See more...")),x.appendChild(_),x.onclick=function(C){x.removeChild(_),x.appendChild(document.createTextNode(f)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}g.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Go.prototype.isDestroyed=function(){return!1};Go.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),me(this)};Go.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,BTe(this),OTe(this),this._scene.requestRender())};Go.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Go.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Go.prototype._onEntityCollectionChanged,this)};Go.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Go.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Go.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var hL=new le;Go.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!0,hL)===dt.DONE&&i.update(t,hL)}};Go.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};Go.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Go.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&UTe(this.clock,e)};Go.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Go.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Go.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Go.prototype.zoomTo=function(e,t){return YTe(this,e,{offset:t},!1)};Go.prototype.flyTo=function(e,t){return YTe(this,e,t,!0)};function YTe(e,t,n,i){w8(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof Ua){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return LT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof bs||r instanceof mL||r instanceof vy){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function l9(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function w8(e){let t=e._zoomPromise;l(t)&&(l9(e),e._completeZoom(!1))}Go.prototype._postRender=function(){vxt(this),wxt(this)};function vxt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){l(o.offset)||(o.offset=new rm(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(M.IDENTITY),e._completeZoom(!0)),l9(e)}if(t instanceof mL){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),u()});return}if(t instanceof bs||t instanceof vy){s(t.boundingSphere);return}if(t instanceof he){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),l9(e);return}let a=t,c=[];for(let u=0,h=a.length;u<h;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,hL);if(p===dt.PENDING)return;p!==dt.FAILED&&c.push(le.clone(hL))}if(c.length===0){w8(e);return}e.trackedEntity=void 0;let d=le.fromBoundingSpheres(c);e._zoomIsFlight?(l9(e),i.flyToBoundingSphere(d,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(d,o.offset),i.lookAtTransform(M.IDENTITY),l9(e),e._completeZoom(!0))}function wxt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=K.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,hL);if(r===dt.PENDING)return;let s=o.mode;(s===oe.COLUMBUS_VIEW||s===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===oe.COLUMBUS_VIEW||s===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==dt.FAILED?hL:void 0;e._entityView=new $v(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var d9=Go;var jJi=T(S(),1);var IJi=T(S(),1);function bL(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var aS=new ce;function Fxt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}bL.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)Fxt(e,g,p,s)||s.push(new fL(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,aS);let a=aS.west,c=aS.north;r.tileXYToRectangle(i,o,e,aS);let d=aS.east,u=aS.south,h=new Uxt(e,a,u,d,c);for(let p=0;p<s.length;++p){let g=s[p];F8(g.extent,h)&&Dxt(this._maximumLevel,g,h)}};bL.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(pL(i.extent,e)){t=i;break}}return l(t)?u9(void 0,t,e):-1};var Axt=[],Mxt=[],Nxt=new ce,kxt=new ce;bL.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Axt;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,Nxt)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,kxt))):t.push(e);let n=Mxt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)m9(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var HTe=new he;bL.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,aS);return ce.center(i,HTe),this.computeMaximumLevelAtPosition(HTe)>=e};bL.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function fL(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(fL.prototype,{nw:{get:function(){return this._nw||(this._nw=new fL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new fL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new fL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new fL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Uxt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function F8(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function Dxt(e,t,n){for(;t.level<e;)if(MB(t.nw.extent,n))t=t.nw;else if(MB(t.ne.extent,n))t=t.ne;else if(MB(t.sw.extent,n))t=t.sw;else if(MB(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Io(t.rectangles,n.level,Bxt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Bxt(e,t){return e.level-t}function MB(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function pL(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function u9(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&pL(t._nw.extent,n),s=t._ne&&pL(t._ne.extent,n),a=t._sw&&pL(t._sw.extent,n),c=t._se&&pL(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,u9(t,t._nw,n))),s&&(i=Math.max(i,u9(t,t._ne,n))),a&&(i=Math.max(i,u9(t,t._sw,n))),c&&(i=Math.max(i,u9(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];pL(a,n)&&(i=a.level)}t=t.parent}return i}function m9(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||F8(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=Oxt(e[s.level],s)}m9(e,t._nw,n),m9(e,t._ne,n),m9(e,t._sw,n),m9(e,t._se,n)}function Oxt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];F8(o,t)?(o.west<t.west&&n.push(new ce(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ce(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ce(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ce(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Uh=bL;var Yxt=15;function zTe(e){this.ellipsoid=y(e.ellipsoid,ne.default),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}zTe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function Hxt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Ct(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ce.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new zi(s);else if(o===3857){let d=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>d&&(t.extent.xmax=d),t.extent.ymax>d&&(t.extent.ymax=d),t.extent.xmin<-d&&(t.extent.xmin=-d),t.extent.ymin<-d&&(t.extent.ymin=-d),s.rectangleSouthwestInMeters=new D(r.xmin,r.ymin),s.rectangleNortheastInMeters=new D(r.xmax,r.ymax),e.tilingScheme=new os(s)}else throw new ae("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new ae("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?cm.LERC:cm.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Uh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Uh(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function zxt(e,t,n){try{let i=await t.fetchJson();Hxt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function Fy(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new be}Object.defineProperties(Fy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});Fy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ze.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new zTe(t);await zxt(o,i);let r=new Fy(t);return o.build(r),r._resource=n,r};Fy.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(A8(this,n+1,e*2,t*2))){let h=KTe(this,n+1,e*2,t*2);s=h.promise,a=h.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let d=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(h){return new Na({buffer:h[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):Yxt,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(h){if(l(a)&&a.state===Qn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Qn.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function A8(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}Fy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Fy.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=A8(this,n,e,t);if(l(i))return i;KTe(this,n,e,t)};Fy.prototype.loadTileDataAvailability=function(e,t,n){};function Kxt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},d=new D(e.x+1,e.y+1),u=!1,h=!1;for(;!(u&&h);){let p=d.x,g=h?d.y+1:d.y;if(!u){for(let f=e.y;f<g;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new D(d.x,e.y)),--d.x,--p,c.endX=d.x):d.x===o?(c.endX=d.x,u=!0):++d.x}if(!h){let f=d.y*t;for(let x=e.x;x<=p;++x)if(i[f+x]!==s){h=!0;break}h?(a.push(new D(e.x,d.y)),--d.y,c.endY=d.y):d.y===r?(c.endY=d.y,h=!0):++d.y}}return{endingIndices:a,range:c,value:s}}function Jxt(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new D(0,0)];for(;a.length>0;){let c=a.pop(),d=Kxt(c,n,i,o);if(d.value===1){let h=d.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function KTe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let d=new Ko({throttle:!1,throttleByServer:!0,type:ls.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(h)?(h=h.then(function(p){let g=Jxt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let x=0;x<g.length;++x){let _=g[x];f.addAvailableTileRange(t,_.startX,_.startY,_.endX,_.endY)}return A8(e,t,n,i)}),c[a]={promise:h,request:d},h=h.finally(function(p){return delete c[a],p}),{promise:h,request:d}):{}}var M8=Fy;var oQi=T(S(),1);var JTe="https://dev.virtualearth.net/REST/v1/Locations";function N8(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Ze({url:JTe,queryParameters:n}),this._credit=new Ct('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(N8.prototype,{url:{get:function(){return JTe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});N8.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],d=r[3];return{displayName:o.name,destination:ce.fromDegrees(a,s,d,c)}})})};var k8=N8;var aQi=T(S(),1);function U8(){}Object.defineProperties(U8.prototype,{credit:{get:function(){}}});U8.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:m.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var D8=U8;var bQi=T(S(),1);var Qxt=new se,QTe=new m,gL=new m;function jxt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new m);let d=(a-i)*o;return m.lerp(r,s,d,c)}}return function(i,o){l(o)||(o=new m);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=Qxt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,d,u,h,p;return r===0?(c=t[0],d=t[1],u=e.firstTangent,h=m.subtract(t[2],c,QTe),m.multiplyByScalar(h,.5,h),p=M.multiplyByVector(Cg.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],h=e.lastTangent,u=m.subtract(d,t[r-1],QTe),m.multiplyByScalar(u,.5,u),p=M.multiplyByVector(Cg.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],h=t[r+2],p=M.multiplyByVector(Ay.catmullRomCoefficientMatrix,a,a)),o=m.multiplyByScalar(c,p.x,o),m.multiplyByScalar(d,p.y,gL),m.add(o,gL,o),m.multiplyByScalar(u,p.z,gL),m.add(o,gL,o),m.multiplyByScalar(h,p.w,gL),m.add(o,gL,o)}}var qxt=new m,$xt=new m;function Ay(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=qxt,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=$xt,m.multiplyByScalar(t[r-1],2,o),m.subtract(t[r],o,o),m.add(o,t[r-2],o),m.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(o),this._evaluateFunction=jxt(this),this._lastTimeIndex=0}Object.defineProperties(Ay.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});Ay.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Ay.prototype.findTimeInterval=io.prototype.findTimeInterval;Ay.prototype.wrapTime=io.prototype.wrapTime;Ay.prototype.clampTime=io.prototype.clampTime;Ay.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var B8=Ay;var a4i=T(S(),1);var FQi=T(S(),1);var TQi=T(S(),1);var NB={};NB.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let d=s+a+c,u,h,p,g,f,x;return d===1?s?(u=(e-n)/(i-n),h=(e-n)/(o-n),r.push(1),r.push(2),h!==1&&(r.push(-1),r.push(0),r.push(2),r.push(h)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):d===2?!s&&n!==e?(g=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(x=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(h=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(h),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};NB.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,h=r-a,p=i-a,g=1/(h*d+u*p),f=t-a,x=e-s,_=(h*x+u*f)*g,C=(-p*x+d*f)*g,V=1-_-C;return l(c)?(c.x=_,c.y=C,c.z=V,c):new m(_,C,V)};NB.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=d/h,g=u/h;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new D),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var T0=NB;function My(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=UB(e.westIndices,o,t),this._southIndices=UB(e.southIndices,r,t),this._eastIndices=UB(e.eastIndices,o,t),this._northIndices=UB(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(My.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var kB=[];function UB(e,t,n){kB.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)kB[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(kB.sort(t),Ae.createTypedArray(n,kB)):e}var jTe="createVerticesFromQuantizedTerrainMesh",e_t=new bi(jTe),t_t=new bi(jTe,Xh.maximumAsynchronousTasks);My.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),h=(a?t_t:e_t).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:d,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(h))return;let p=this;return Promise.resolve(h).then(function(g){let f=p._quantizedVertices.length/3,x=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=Ae.createTypedArray(x,g.indices),C=new Float32Array(g.vertices),V=g.center,L=g.minimumHeight,Z=g.maximumHeight,G=p._boundingSphere,I=p._orientedBoundingBox,v=y(m.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),P=g.vertexStride,w=Sc.clone(g.encoding);return p._mesh=new dm(V,C,_,g.indexCountWithoutSkirts,f,L,Z,G,v,P,I,w,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var n_t=new bi("upsampleQuantizedTerrainMesh",Xh.maximumAsynchronousTasks);My.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=n_t.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:h,ellipsoid:u});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let f=c?g*.5:this._westSkirtHeight,x=d?g*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:g*.5,C=d?this._northSkirtHeight:g*.5,V=this._credits;return Promise.resolve(p).then(function(L){let Z=new Uint16Array(L.vertices),G=Ae.createTypedArray(Z.length/3,L.indices),I;return l(L.encodedNormals)&&(I=new Uint8Array(L.encodedNormals)),new My({quantizedVertices:Z,indices:G,encodedNormals:I,minimumHeight:L.minimumHeight,maximumHeight:L.maximumHeight,boundingSphere:le.clone(L.boundingSphere),orientedBoundingBox:Gn.clone(L.orientedBoundingBox),horizonOcclusionPoint:m.clone(L.horizonOcclusionPoint),westIndices:L.westIndices,southIndices:L.southIndices,eastIndices:L.eastIndices,northIndices:L.northIndices,westSkirtHeight:f,southSkirtHeight:x,eastSkirtHeight:_,northSkirtHeight:C,childTileMask:0,credits:V,createdByUpsampling:!0})})};var O8=32767,qTe=new m;My.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=O8;let o=W.clamp((n-e.south)/e.height,0,1);return o*=O8,l(this._mesh)?s_t(this,i,o):a_t(this,i,o)};function $Te(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),h=Math.max(i,r,a);return e>=c&&e<=d&&t>=u&&t<=h}var i_t=new D,o_t=new D,r_t=new D;function s_t(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,d,i_t),g=r.decodeTextureCoordinates(o,u,o_t),f=r.decodeTextureCoordinates(o,h,r_t);if($Te(t,n,p.x,p.y,g.x,g.y,f.x,f.y)){let x=T0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,qTe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,d),C=r.decodeHeight(o,u),V=r.decodeHeight(o,h);return x.x*_+x.y*C+x.z*V}}}}function a_t(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=i[d],g=i[u],f=i[h],x=o[d],_=o[u],C=o[h];if($Te(t,n,p,x,g,_,f,C)){let V=T0.computeBarycentricCoordinates(t,n,p,x,g,_,f,C,qTe);if(V.x>=-1e-15&&V.y>=-1e-15&&V.z>=-1e-15){let L=V.x*r[d]+V.y*r[u]+V.z*r[h];return W.lerp(e._minimumHeight,e._maximumHeight,L/O8)}}}}My.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};My.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var cS=My;function c_t(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function tSe(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=y(e.ellipsoid,ne.default),this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}tSe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function nSe(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}let c=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new zi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new os({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}if(e.levelZeroMaximumGeometricError=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}let u;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(h)){g=new Uh(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let _=p[x],C=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let V=0;V<_.length;++V){let L=_[V],Z=C-L.endY-1,G=C-L.startY-1;e.overallAvailability[x].push([L.startX,Z,L.endX,G]),g.addAvailableTileRange(x,L.startX,Z,L.endX,G)}}}else l(h)&&(u=new Uh(e.tilingScheme,d),g=new Uh(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new c_t({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await z8(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function l_t(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return z8(e,n);throw new ae(i)}async function d_t(e,t,n){await nSe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Uh(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Ct(e.attribution);e.tileCredits.push(o)}return!0}async function z8(e,t){try{let n=await e.layerJsonResource.fetchJson();return d_t(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await nSe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):l_t(e,n,t)}}function Dh(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var Y8={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function eSe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function u_t(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Na({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function m_t(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,d=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,h=Float64Array.BYTES_PER_ELEMENT*d,g=Uint16Array.BYTES_PER_ELEMENT*3,f=3,x=Uint16Array.BYTES_PER_ELEMENT,_=x*f,C=new DataView(t),V=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let L=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let Z=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let G=new le(new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+u,!0));a+=h;let I=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let v=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,a,v*3);a+=v*g,v>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,_=x*f);let w=P.subarray(0,v),F=P.subarray(v,2*v),b=P.subarray(v*2,3*v);wn.zigZagDeltaDecode(w,F,b),a%x!==0&&(a+=x-a%x);let R=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let E=Ae.createTypedArrayFromArrayBuffer(v,t,a,R*f);a+=R*_;let X=0,A=E.length;for(let de=0;de<A;++de){let ye=E[de];E[de]=X-ye,ye===0&&++X}let N=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Ae.createTypedArrayFromArrayBuffer(v,t,a,N);a+=N*x;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Y=Ae.createTypedArrayFromArrayBuffer(v,t,a,U);a+=U*x;let k=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Ae.createTypedArrayFromArrayBuffer(v,t,a,k);a+=k*x;let J=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Ae.createTypedArrayFromArrayBuffer(v,t,a,J);a+=J*x;let z,j;for(;a<C.byteLength;){let de=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ye=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,de===Y8.OCT_VERTEX_NORMALS&&e._requestVertexNormals)z=new Uint8Array(t,a,v*2);else if(de===Y8.WATER_MASK&&e._requestWaterMask)j=new Uint8Array(t,a,ye);else if(de===Y8.METADATA&&e._requestMetadata){let Te=C.getUint32(a,!0);if(Te>0){let Le=Po(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Te).available;if(l(Le))for(let ke=0;ke<Le.length;++ke){let Be=n+ke+1,it=Le[ke],Et=e._tilingScheme.getNumberOfYTilesAtLevel(Be);for(let yt=0;yt<it.length;++yt){let Ne=it[yt],Jt=Et-Ne.endY-1,Rt=Et-Ne.startY-1;e.availability.addAvailableTileRange(Be,Ne.startX,Jt,Ne.endX,Rt),r.availability.addAvailableTileRange(Be,Ne.startX,Jt,Ne.endX,Rt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ye}let ee=e.getLevelMaximumGeometricError(n)*5,fe=e._tilingScheme.tileXYToRectangle(i,o,n),_e=Gn.fromRectangle(fe,L,Z,e._tilingScheme.ellipsoid);return new cS({center:V,minimumHeight:L,maximumHeight:Z,boundingSphere:G,orientedBoundingBox:_e,horizonOcclusionPoint:I,quantizedVertices:P,encodedNormals:z,indices:E,westIndices:O,southIndices:Y,eastIndices:H,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:j,credits:e._tileCredits})}Dh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!l(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let h=K8(this,e,t,n,u,d===0);h.result&&(a=!0,c=c.then(()=>h.promise))}return!l(r)&&a?c.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):iSe(this,e,t,n,r,i)};function iSe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ae("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let d,u,h=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),d=eSe(void 0)):d=eSe(c);let g=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(f){return l(f)?l(e._heightmapStructure)?u_t(e,f,i,t,n):m_t(e,f,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties(Dh.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});Dh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Dh.fromIonAssetId=async function(e,t){let n=await gd.fromAssetId(e);return Dh.fromUrl(n,t)};Dh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ze.createIfNeeded(e);n.appendForwardSlash();let i=new tSe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await z8(i);let o=new Dh(t);return i.build(o),o};Dh.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(K8(this,e,t,n,i[r],r===0).result)return;return!1};Dh.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=K8(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function H8(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function K8(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,d=o.availability,u=H8(o,t,n,i);for(;l(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!c.isTileAvailable(u.level,u.x,u.y)){let h;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,h=o.availabilityPromiseCache[s],!l(h))){let p=new Ko({throttle:!1,throttleByServer:!0,type:ls.TERRAIN});h=iSe(e,u.x,u.y,u.level,o,p),l(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}u=H8(o,u.x,u.y,u.level)}return{result:!1}}Dh._getAvailabilityTile=H8;var lS=Dh;var p4i=T(S(),1);function S0(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new ol(n),this._workerName="createCircleGeometry"}S0.packedLength=ol.packedLength;S0.pack=function(e,t,n){return ol.pack(e._ellipseGeometry,t,n)};var oSe=new ol({center:new m,semiMajorAxis:1,semiMinorAxis:1}),Ba={center:new m,radius:void 0,ellipsoid:ne.clone(ne.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Xe,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};S0.unpack=function(e,t,n){let i=ol.unpack(e,t,oSe);return Ba.center=m.clone(i._center,Ba.center),Ba.ellipsoid=ne.clone(i._ellipsoid,Ba.ellipsoid),Ba.ellipsoid=ne.clone(i._ellipsoid,oSe._ellipsoid),Ba.height=i._height,Ba.extrudedHeight=i._extrudedHeight,Ba.granularity=i._granularity,Ba.vertexFormat=Xe.clone(i._vertexFormat,Ba.vertexFormat),Ba.stRotation=i._stRotation,Ba.shadowVolume=i._shadowVolume,l(n)?(Ba.semiMajorAxis=i._semiMajorAxis,Ba.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new ol(Ba),n):(Ba.radius=i._semiMajorAxis,new S0(Ba))};S0.createGeometry=function(e){return ol.createGeometry(e._ellipseGeometry)};S0.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new S0({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(S0.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var J8=S0;var S4i=T(S(),1);function yL(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new Ad(n),this._workerName="createCircleOutlineGeometry"}yL.packedLength=Ad.packedLength;yL.pack=function(e,t,n){return Ad.pack(e._ellipseGeometry,t,n)};var h_t=new Ad({center:new m,semiMajorAxis:1,semiMinorAxis:1}),ou={center:new m,radius:void 0,ellipsoid:ne.clone(ne.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};yL.unpack=function(e,t,n){let i=Ad.unpack(e,t,h_t);return ou.center=m.clone(i._center,ou.center),ou.ellipsoid=ne.clone(i._ellipsoid,ou.ellipsoid),ou.height=i._height,ou.extrudedHeight=i._extrudedHeight,ou.granularity=i._granularity,ou.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(ou.semiMajorAxis=i._semiMajorAxis,ou.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Ad(ou),n):(ou.radius=i._semiMajorAxis,new yL(ou))};yL.createGeometry=function(e){return Ad.createGeometry(e._ellipseGeometry)};var Q8=yL;var W4i=T(S(),1);function xL(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new zi({ellipsoid:y(e.ellipsoid,ne.default)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new Ct(n)),this._credit=n}Object.defineProperties(xL.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});xL.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Na({buffer:c,width:r,height:s})})};xL.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};xL.prototype.getTileDataAvailable=function(e,t,n){};xL.prototype.loadTileDataAvailability=function(e,t,n){};var j8=xL;var v4i=T(S(),1);function rSe(e){this.proxy=e}rSe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var q8=rSe;var F4i=T(S(),1),f_t={SEARCH:0,AUTOCOMPLETE:1},Ny=Object.freeze(f_t);var U4i=T(S(),1);function DB(){pe.throwInstantiationError()}Object.defineProperties(DB.prototype,{credit:{get:pe.throwInstantiationError}});DB.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Ct.getIonCredit)};DB.prototype.geocode=pe.throwInstantiationError;var _L=DB;var O4i=T(S(),1);function sSe(){pe.throwInstantiationError()}sSe.createGeometry=function(e){pe.throwInstantiationError()};var $8=sSe;var uji=T(S(),1),__t=T(e7(),1);var j4i=T(S(),1);var z4i=T(S(),1);function p_t(e,t){return(e&t)!==0}var Zc=p_t;var b_t=[1,2,4,8],aSe=15,g_t=16,y_t=64,x_t=128;function up(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}up.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new up(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};up.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};up.prototype.hasSubtree=function(){return Zc(this._bits,g_t)};up.prototype.hasImagery=function(){return Zc(this._bits,y_t)};up.prototype.hasTerrain=function(){return Zc(this._bits,x_t)};up.prototype.hasChildren=function(){return Zc(this._bits,aSe)};up.prototype.hasChild=function(e){return Zc(this._bits,b_t[e])};up.prototype.getChildBitmask=function(){return this._bits&aSe};var h9=up;function T_t(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var S_t=T_t(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y +${f}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let _=document.createElement("span");_.className="cesium-widget-errorPanel-more-details",_.appendChild(document.createTextNode("See more...")),x.appendChild(_),x.onclick=function(C){x.removeChild(_),x.appendChild(document.createTextNode(f)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}g.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Go.prototype.isDestroyed=function(){return!1};Go.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),me(this)};Go.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,YTe(this),HTe(this),this._scene.requestRender())};Go.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Go.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Go.prototype._onEntityCollectionChanged,this)};Go.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Go.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Go.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var bL=new le;Go.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!0,bL)===lt.DONE&&i.update(t,bL)}};Go.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};Go.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Go.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&BTe(this.clock,e)};Go.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Go.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Go.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Go.prototype.zoomTo=function(e,t){return zTe(this,e,{offset:t},!1)};Go.prototype.flyTo=function(e,t){return zTe(this,e,t,!0)};function zTe(e,t,n,i){F8(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof Ba){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return ZT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof bs||r instanceof pL||r instanceof vy){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function sM(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function F8(e){let t=e._zoomPromise;l(t)&&(sM(e),e._completeZoom(!1))}Go.prototype._postRender=function(){Mxt(this),Nxt(this)};function Mxt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){l(o.offset)||(o.offset=new rm(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(M.IDENTITY),e._completeZoom(!0)),sM(e)}if(t instanceof pL){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),u()});return}if(t instanceof bs||t instanceof vy){s(t.boundingSphere);return}if(t instanceof he){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),sM(e);return}let a=t,c=[];for(let u=0,h=a.length;u<h;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,bL);if(p===lt.PENDING)return;p!==lt.FAILED&&c.push(le.clone(bL))}if(c.length===0){F8(e);return}e.trackedEntity=void 0;let d=le.fromBoundingSpheres(c);e._zoomIsFlight?(sM(e),i.flyToBoundingSphere(d,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(d,o.offset),i.lookAtTransform(M.IDENTITY),sM(e),e._completeZoom(!0))}function Nxt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=K.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,bL);if(r===lt.PENDING)return;let s=o.mode;(s===oe.COLUMBUS_VIEW||s===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===oe.COLUMBUS_VIEW||s===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==lt.FAILED?bL:void 0;e._entityView=new wv(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var aM=Go;var TJi=T(S(),1),cM=`uniform sampler2D u_noiseTexture; +uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +in vec2 v_offset; +in vec3 v_maximumSize; +in vec4 v_color; +in float v_slice; +in float v_brightness; + +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); + } + return mod(value, rangeLength); +} + +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); +} + +vec2 voxelToUV(vec3 voxelIndex) { + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + + float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; + vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, + inverseNoiseTextureRows / textureSliceWidth); + vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); + float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); + float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); + + float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; + float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; + return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; +} + +// Interpolate a voxel with its neighbor (along the positive X-axis) +vec4 lerpSamplesX(vec3 voxelIndex, float x) { + vec2 uv0 = voxelToUV(voxelIndex); + vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); + vec4 sample0 = texture(u_noiseTexture, uv0); + vec4 sample1 = texture(u_noiseTexture, uv1); + return mix(sample0, sample1, x); +} + +vec4 sampleNoiseTexture(vec3 position) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); + vec3 lerpValue = fract(recenteredPos); + vec3 voxelIndex = floor(recenteredPos); + + vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); + vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); + vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); + vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); + + vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); + vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); + return mix(yLerp0, yLerp1, lerpValue.z); +} + +// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). +bool intersectSphere(vec3 origin, vec3 dir, float slice, + out vec3 point, out vec3 normal) { + float A = dot(dir, dir); + float B = dot(origin, dir); + float C = dot(origin, origin) - 0.25; + float discriminant = (B * B) - (A * C); + if(discriminant < 0.0) { + return false; + } + float root = sqrt(discriminant); + float t = (-B - root) / A; + if(t < 0.0) { + t = (-B + root) / A; + } + point = origin + t * dir; + + if(slice >= 0.0) { + point.z = (slice / 2.0) - 0.5; + if(length(point) > 0.5) { + return false; + } + } + + normal = normalize(point); + point -= czm_epsilon2 * normal; + return true; +} + +// Transforms the ray origin and direction into unit sphere space, +// then transforms the result back into the ellipsoid's space. +bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, + out vec3 point, out vec3 normal) { + if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { + return false; + } + + vec3 o = (origin - center) / scale; + vec3 d = dir / scale; + vec3 p, n; + bool intersected = intersectSphere(o, d, slice, p, n); + if(intersected) { + point = (p * scale) + center; + normal = n; + } + return intersected; +} + +// Assume that if phase shift is being called for octave i, +// the frequency is of i - 1. This saves us from doing extra +// division / multiplication operations. +vec2 phaseShift2D(vec2 p, vec2 freq) { + return (czm_pi / 2.0) * sin(freq.yx * p.yx); +} + +vec2 phaseShift3D(vec3 p, vec2 freq) { + return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); +} + +// The cloud texture function derived from Gardner's 1985 paper, +// "Visual Simulation of Clouds." +// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf +const float T0 = 0.6; // contrast of the texture pattern +const float k = 0.1; // computed to produce a maximum value of 1 +const float C0 = 0.8; // coefficient +const float FX0 = 0.6; // frequency X +const float FY0 = 0.6; // frequency Y +const int octaves = 5; + +float T(vec3 point) { + vec2 sum = vec2(0.0); + float Ci = C0; + vec2 FXY = vec2(FX0, FY0); + vec2 PXY = vec2(0.0); + for(int i = 1; i <= octaves; i++) { + PXY = phaseShift3D(point, FXY); + Ci *= 0.707; + FXY *= 2.0; + vec2 sinTerm = sin(FXY * point.xy + PXY); + sum += Ci * sinTerm + vec2(T0); + } + return k * sum.x * sum.y; +} + +const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, +const float t = 0.4; // fraction of texture shading +const float s = 0.25; // fraction of specular reflection + +float I(float Id, float Is, float It) { + return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; +} + +const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); + +vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, + float brightness) { + vec3 cloudPoint, cloudNormal; + if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, + cloudPoint, cloudNormal)) { + return vec4(0.0); + } + + float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection + float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection + float It = T(cloudPoint); // texture function + float intensity = I(Id, Is, It); + vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); + + vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); + float W = noise.x; + float W2 = noise.y; + float W3 = noise.z; + + // The dot product between the cloud's normal and the ray's direction is greatest + // in the center of the ellipsoid's surface. It decreases towards the edge. + // Thus, it is used to blur the areas leading to the edges of the ellipsoid, + // so that no harsh lines appear. + + // The first (and biggest) layer of worley noise is then subtracted from this. + // The final result is scaled up so that the base cloud is not too translucent. + float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); + float TR = pow(ndDot, 3.0) - W; // translucency + TR *= 1.3; + + // Subtracting the second and third layers of worley noise is more complicated. + // If these layers of noise were simply subtracted from the current translucency, + // the shape derived from the first layer of noise would be completely deleted. + // The erosion of this noise should thus be constricted to the edges of the cloud. + // However, because the edges of the ellipsoid were already blurred away, mapping + // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. + // The value of (0.5 - ndDot) provides the best compromise. + float minusDot = 0.5 - ndDot; + + // Even with the previous calculation, subtracting the second layer of wnoise + // erode too much of the cloud. The addition of it, however, will detailed + // volume to the cloud. As long as the noise is only added and not subtracted, + // the results are aesthetically pleasing. + + // The minusDot product is mapped in a way that it is larger at the edges of + // the ellipsoid, so a subtraction and min operation are used instead of + // an addition and max one. + TR -= min(minusDot * W2, 0.0); + + // The third level of worley noise is subtracted from the result, with some + // modifications. First, a scalar is added to minusDot so that the noise + // starts affecting the shape farther away from the center of the ellipsoid's + // surface. Then, it is scaled down so its impact is not too intense. + TR -= 0.8 * (minusDot + 0.25) * W3; + + // The texture function's shading does not correlate with the shape of the cloud + // produced by the layers of noise, so an extra shading scalar is calculated. + // The darkest areas of the cloud are assigned to be where the noise erodes + // the cloud the most. This is then interpolated based on the translucency + // and the diffuse shading term of that point in the cloud. + float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); + + // To avoid values that are too dark, this scalar is increased by a small amount + // and clamped so it never goes to zero. + shading = clamp(shading + 0.2, 0.3, 1.0); + + // Finally, the contrast of the cloud's color is increased. + vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); + return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; +} + +void main() { +#ifdef DEBUG_BILLBOARDS + out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); +#endif + // To avoid calculations with high values, + // we raycast from an arbitrarily smaller space. + vec2 coordinate = v_maximumSize.xy * v_offset; + + vec3 ellipsoidScale = 0.82 * v_maximumSize; + vec3 ellipsoidCenter = vec3(0.0); + + float zOffset = max(ellipsoidScale.z - 10.0, 0.0); + vec3 eye = vec3(0, 0, -10.0 - zOffset); + vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); + vec3 rayOrigin = eye; +#ifdef DEBUG_ELLIPSOIDS + vec3 point, normal; + if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, + point, normal)) { + out_FragColor = v_brightness * v_color; + } +#else +#ifndef DEBUG_BILLBOARDS + vec4 cloud = drawCloud(rayOrigin, rayDir, + ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); + if(cloud.w < 0.01) { + discard; + } + out_FragColor = cloud; +#endif +#endif +} +`;var CJi=T(S(),1),lM=`#ifdef INSTANCED +in vec2 direction; +#endif +in vec4 positionHighAndScaleX; +in vec4 positionLowAndScaleY; +in vec4 packedAttribute0; +in vec4 packedAttribute1; +in vec4 color; + +out vec2 v_offset; +out vec3 v_maximumSize; +out vec4 v_color; +out float v_slice; +out float v_brightness; + +void main() { + // Unpack attributes. + vec3 positionHigh = positionHighAndScaleX.xyz; + vec3 positionLow = positionLowAndScaleY.xyz; + vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); + + float show = packedAttribute0.x; + float brightness = packedAttribute0.y; + vec2 coordinates = packedAttribute0.wz; + vec3 maximumSize = packedAttribute1.xyz; + float slice = packedAttribute1.w; + +#ifdef INSTANCED + vec2 dir = direction; +#else + vec2 dir = coordinates; +#endif + + vec2 offset = dir - vec2(0.5, 0.5); + vec2 scaledOffset = scale * offset; + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + positionEC.xy += scaledOffset; + + positionEC.xyz *= show; + gl_Position = czm_projection * positionEC; + + v_offset = offset; + v_maximumSize = maximumSize; + v_color = color; + v_slice = slice; + v_brightness = brightness; +} +`;var LJi=T(S(),1),dM=`uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +uniform vec3 u_noiseOffset; +in vec2 v_position; + +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); + } + return mod(value, rangeLength); +} + +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); +} + +vec3 random3(vec3 p) { + float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); + float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); + return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); +} + +// Frequency corresponds to cell size. +// The higher the frequency, the smaller the cell size. +vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 cell = centerCell + offset; + cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); + cell += floor(u_noiseOffset / u_noiseDetail); + vec3 p = offset + random3(cell); + return p; +} + +float worleyNoise(vec3 p, float freq) { + vec3 centerCell = floor(p * freq); + vec3 pointInCell = fract(p * freq); + float shortestDistance = 1000.0; + + for(float z = -1.0; z <= 1.0; z++) { + for(float y = -1.0; y <= 1.0; y++) { + for(float x = -1.0; x <= 1.0; x++) { + vec3 offset = vec3(x, y, z); + vec3 point = getWorleyCellPoint(centerCell, offset, freq); + + float distance = length(pointInCell - point); + if(distance < shortestDistance) { + shortestDistance = distance; + } + } + } + } + + return shortestDistance; +} + +const float MAX_FBM_ITERATIONS = 10.0; + +float worleyFBMNoise(vec3 p, float octaves, float scale) { + float noise = 0.0; + float freq = 1.0; + float persistence = 0.625; + for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { + if(i >= octaves) { + break; + } + + noise += worleyNoise(p * scale, freq * scale) * persistence; + persistence *= 0.5; + freq *= 2.0; + } + return noise; +} + +void main() { + float textureSliceWidth = u_noiseTextureDimensions.x; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + float x = mod(v_position.x, textureSliceWidth); + float y = mod(v_position.y, textureSliceWidth); + float sliceRow = floor(v_position.y / textureSliceWidth); + float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; + + vec3 position = vec3(x, y, z); + position /= u_noiseDetail; + float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); + float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); + float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); + out_FragColor = vec4(worley0, worley1, worley2, 1.0); +} +`;var ZJi=T(S(),1),uM=`uniform vec3 u_noiseTextureDimensions; +in vec2 position; + +out vec2 v_position; + +void main() +{ + gl_Position = vec4(position, 0.1, 1.0); + + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + vec2 transformedPos = (position * 0.5) + vec2(0.5); + transformedPos *= textureSliceWidth; + transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; + transformedPos.y *= noiseTextureRows; + v_position = transformedPos; +} +`;var EJi=T(S(),1),mM=` +in vec2 v_textureCoordinates; + +void main() +{ + czm_materialInput materialInput; + + materialInput.s = v_textureCoordinates.s; + materialInput.st = v_textureCoordinates; + materialInput.str = vec3(v_textureCoordinates, 0.0); + materialInput.normalEC = vec3(0.0, 0.0, -1.0); + + czm_material material = czm_getMaterial(materialInput); + + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +} +`;var nQi=T(S(),1);var wJi=T(S(),1);function xL(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var lS=new ce;function kxt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}xL.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)kxt(e,g,p,s)||s.push(new gL(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,lS);let a=lS.west,c=lS.north;r.tileXYToRectangle(i,o,e,lS);let d=lS.east,u=lS.south,h=new Yxt(e,a,u,d,c);for(let p=0;p<s.length;++p){let g=s[p];A8(g.extent,h)&&Hxt(this._maximumLevel,g,h)}};xL.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(yL(i.extent,e)){t=i;break}}return l(t)?hM(void 0,t,e):-1};var Uxt=[],Dxt=[],Bxt=new ce,Oxt=new ce;xL.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Uxt;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,Bxt)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,Oxt))):t.push(e);let n=Dxt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)fM(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var KTe=new he;xL.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,lS);return ce.center(i,KTe),this.computeMaximumLevelAtPosition(KTe)>=e};xL.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function gL(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(gL.prototype,{nw:{get:function(){return this._nw||(this._nw=new gL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new gL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new gL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new gL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Yxt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function A8(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function Hxt(e,t,n){for(;t.level<e;)if(NB(t.nw.extent,n))t=t.nw;else if(NB(t.ne.extent,n))t=t.ne;else if(NB(t.sw.extent,n))t=t.sw;else if(NB(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Xo(t.rectangles,n.level,zxt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function zxt(e,t){return e.level-t}function NB(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function yL(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function hM(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&yL(t._nw.extent,n),s=t._ne&&yL(t._ne.extent,n),a=t._sw&&yL(t._sw.extent,n),c=t._se&&yL(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,hM(t,t._nw,n))),s&&(i=Math.max(i,hM(t,t._ne,n))),a&&(i=Math.max(i,hM(t,t._sw,n))),c&&(i=Math.max(i,hM(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];yL(a,n)&&(i=a.level)}t=t.parent}return i}function fM(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||A8(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=Kxt(e[s.level],s)}fM(e,t._nw,n),fM(e,t._ne,n),fM(e,t._sw,n),fM(e,t._se,n)}function Kxt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];A8(o,t)?(o.west<t.west&&n.push(new ce(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ce(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ce(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ce(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Uh=xL;var Jxt=15;function JTe(e){this.ellipsoid=y(e.ellipsoid,ne.default),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}JTe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function Qxt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new St(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ce.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new zi(s);else if(o===3857){let d=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>d&&(t.extent.xmax=d),t.extent.ymax>d&&(t.extent.ymax=d),t.extent.xmin<-d&&(t.extent.xmin=-d),t.extent.ymin<-d&&(t.extent.ymin=-d),s.rectangleSouthwestInMeters=new D(r.xmin,r.ymin),s.rectangleNortheastInMeters=new D(r.xmax,r.ymax),e.tilingScheme=new os(s)}else throw new ae("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new ae("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?cm.LERC:cm.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Uh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Uh(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function jxt(e,t,n){try{let i=await t.fetchJson();Qxt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function Fy(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new ge}Object.defineProperties(Fy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});Fy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ze.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new JTe(t);await jxt(o,i);let r=new Fy(t);return o.build(r),r._resource=n,r};Fy.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(M8(this,n+1,e*2,t*2))){let h=QTe(this,n+1,e*2,t*2);s=h.promise,a=h.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let d=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(h){return new Ua({buffer:h[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):Jxt,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(h){if(l(a)&&a.state===jn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=jn.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function M8(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}Fy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Fy.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=M8(this,n,e,t);if(l(i))return i;QTe(this,n,e,t)};Fy.prototype.loadTileDataAvailability=function(e,t,n){};function qxt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},d=new D(e.x+1,e.y+1),u=!1,h=!1;for(;!(u&&h);){let p=d.x,g=h?d.y+1:d.y;if(!u){for(let f=e.y;f<g;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new D(d.x,e.y)),--d.x,--p,c.endX=d.x):d.x===o?(c.endX=d.x,u=!0):++d.x}if(!h){let f=d.y*t;for(let x=e.x;x<=p;++x)if(i[f+x]!==s){h=!0;break}h?(a.push(new D(e.x,d.y)),--d.y,c.endY=d.y):d.y===r?(c.endY=d.y,h=!0):++d.y}}return{endingIndices:a,range:c,value:s}}function $xt(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new D(0,0)];for(;a.length>0;){let c=a.pop(),d=qxt(c,n,i,o);if(d.value===1){let h=d.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function QTe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let d=new Ko({throttle:!1,throttleByServer:!0,type:ls.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(h)?(h=h.then(function(p){let g=$xt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let x=0;x<g.length;++x){let _=g[x];f.addAvailableTileRange(t,_.startX,_.startY,_.endX,_.endY)}return M8(e,t,n,i)}),c[a]={promise:h,request:d},h=h.finally(function(p){return delete c[a],p}),{promise:h,request:d}):{}}var N8=Fy;var lQi=T(S(),1);var jTe="https://dev.virtualearth.net/REST/v1/Locations";function k8(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Ze({url:jTe,queryParameters:n}),this._credit=new St('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(k8.prototype,{url:{get:function(){return jTe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});k8.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],d=r[3];return{displayName:o.name,destination:ce.fromDegrees(a,s,d,c)}})})};var U8=k8;var mQi=T(S(),1);function D8(){}Object.defineProperties(D8.prototype,{credit:{get:function(){}}});D8.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:m.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var B8=D8;var TQi=T(S(),1);var e_t=new se,qTe=new m,_L=new m;function t_t(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new m);let d=(a-i)*o;return m.lerp(r,s,d,c)}}return function(i,o){l(o)||(o=new m);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=e_t;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,d,u,h,p;return r===0?(c=t[0],d=t[1],u=e.firstTangent,h=m.subtract(t[2],c,qTe),m.multiplyByScalar(h,.5,h),p=M.multiplyByVector(Cg.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],h=e.lastTangent,u=m.subtract(d,t[r-1],qTe),m.multiplyByScalar(u,.5,u),p=M.multiplyByVector(Cg.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],h=t[r+2],p=M.multiplyByVector(Ay.catmullRomCoefficientMatrix,a,a)),o=m.multiplyByScalar(c,p.x,o),m.multiplyByScalar(d,p.y,_L),m.add(o,_L,o),m.multiplyByScalar(u,p.z,_L),m.add(o,_L,o),m.multiplyByScalar(h,p.w,_L),m.add(o,_L,o)}}var n_t=new m,i_t=new m;function Ay(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=n_t,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=i_t,m.multiplyByScalar(t[r-1],2,o),m.subtract(t[r],o,o),m.add(o,t[r-2],o),m.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(o),this._evaluateFunction=t_t(this),this._lastTimeIndex=0}Object.defineProperties(Ay.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});Ay.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Ay.prototype.findTimeInterval=io.prototype.findTimeInterval;Ay.prototype.wrapTime=io.prototype.wrapTime;Ay.prototype.clampTime=io.prototype.clampTime;Ay.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var O8=Ay;var m4i=T(S(),1);var UQi=T(S(),1);var RQi=T(S(),1);var kB={};kB.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let d=s+a+c,u,h,p,g,f,x;return d===1?s?(u=(e-n)/(i-n),h=(e-n)/(o-n),r.push(1),r.push(2),h!==1&&(r.push(-1),r.push(0),r.push(2),r.push(h)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):d===2?!s&&n!==e?(g=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(x=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(h=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(h),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};kB.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,h=r-a,p=i-a,g=1/(h*d+u*p),f=t-a,x=e-s,_=(h*x+u*f)*g,C=(-p*x+d*f)*g,V=1-_-C;return l(c)?(c.x=_,c.y=C,c.z=V,c):new m(_,C,V)};kB.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=d/h,g=u/h;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new D),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var S0=kB;function My(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=DB(e.westIndices,o,t),this._southIndices=DB(e.southIndices,r,t),this._eastIndices=DB(e.eastIndices,o,t),this._northIndices=DB(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(My.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var UB=[];function DB(e,t,n){UB.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)UB[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(UB.sort(t),Ae.createTypedArray(n,UB)):e}var $Te="createVerticesFromQuantizedTerrainMesh",o_t=new gi($Te),r_t=new gi($Te,Xh.maximumAsynchronousTasks);My.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),h=(a?r_t:o_t).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:d,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(h))return;let p=this;return Promise.resolve(h).then(function(g){let f=p._quantizedVertices.length/3,x=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=Ae.createTypedArray(x,g.indices),C=new Float32Array(g.vertices),V=g.center,L=g.minimumHeight,Z=g.maximumHeight,G=p._boundingSphere,I=p._orientedBoundingBox,v=y(m.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),P=g.vertexStride,w=Cc.clone(g.encoding);return p._mesh=new dm(V,C,_,g.indexCountWithoutSkirts,f,L,Z,G,v,P,I,w,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var s_t=new gi("upsampleQuantizedTerrainMesh",Xh.maximumAsynchronousTasks);My.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=s_t.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:h,ellipsoid:u});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let f=c?g*.5:this._westSkirtHeight,x=d?g*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:g*.5,C=d?this._northSkirtHeight:g*.5,V=this._credits;return Promise.resolve(p).then(function(L){let Z=new Uint16Array(L.vertices),G=Ae.createTypedArray(Z.length/3,L.indices),I;return l(L.encodedNormals)&&(I=new Uint8Array(L.encodedNormals)),new My({quantizedVertices:Z,indices:G,encodedNormals:I,minimumHeight:L.minimumHeight,maximumHeight:L.maximumHeight,boundingSphere:le.clone(L.boundingSphere),orientedBoundingBox:Gn.clone(L.orientedBoundingBox),horizonOcclusionPoint:m.clone(L.horizonOcclusionPoint),westIndices:L.westIndices,southIndices:L.southIndices,eastIndices:L.eastIndices,northIndices:L.northIndices,westSkirtHeight:f,southSkirtHeight:x,eastSkirtHeight:_,northSkirtHeight:C,childTileMask:0,credits:V,createdByUpsampling:!0})})};var Y8=32767,eSe=new m;My.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=Y8;let o=W.clamp((n-e.south)/e.height,0,1);return o*=Y8,l(this._mesh)?d_t(this,i,o):u_t(this,i,o)};function tSe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),h=Math.max(i,r,a);return e>=c&&e<=d&&t>=u&&t<=h}var a_t=new D,c_t=new D,l_t=new D;function d_t(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,d,a_t),g=r.decodeTextureCoordinates(o,u,c_t),f=r.decodeTextureCoordinates(o,h,l_t);if(tSe(t,n,p.x,p.y,g.x,g.y,f.x,f.y)){let x=S0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,eSe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,d),C=r.decodeHeight(o,u),V=r.decodeHeight(o,h);return x.x*_+x.y*C+x.z*V}}}}function u_t(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=i[d],g=i[u],f=i[h],x=o[d],_=o[u],C=o[h];if(tSe(t,n,p,x,g,_,f,C)){let V=S0.computeBarycentricCoordinates(t,n,p,x,g,_,f,C,eSe);if(V.x>=-1e-15&&V.y>=-1e-15&&V.z>=-1e-15){let L=V.x*r[d]+V.y*r[u]+V.z*r[h];return W.lerp(e._minimumHeight,e._maximumHeight,L/Y8)}}}}My.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};My.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var dS=My;function m_t(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function iSe(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=y(e.ellipsoid,ne.default),this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}iSe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function oSe(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}let c=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new zi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new os({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}if(e.levelZeroMaximumGeometricError=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ae(x)}let u;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(h)){g=new Uh(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let _=p[x],C=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let V=0;V<_.length;++V){let L=_[V],Z=C-L.endY-1,G=C-L.startY-1;e.overallAvailability[x].push([L.startX,Z,L.endX,G]),g.addAvailableTileRange(x,L.startX,Z,L.endX,G)}}}else l(h)&&(u=new Uh(e.tilingScheme,d),g=new Uh(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new m_t({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await K8(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function h_t(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return K8(e,n);throw new ae(i)}async function f_t(e,t,n){await oSe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Uh(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new St(e.attribution);e.tileCredits.push(o)}return!0}async function K8(e,t){try{let n=await e.layerJsonResource.fetchJson();return f_t(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await oSe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):h_t(e,n,t)}}function Dh(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new ge;let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var H8={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function nSe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function p_t(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Ua({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function b_t(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,d=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,h=Float64Array.BYTES_PER_ELEMENT*d,g=Uint16Array.BYTES_PER_ELEMENT*3,f=3,x=Uint16Array.BYTES_PER_ELEMENT,_=x*f,C=new DataView(t),V=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let L=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let Z=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let G=new le(new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+u,!0));a+=h;let I=new m(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let v=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,a,v*3);a+=v*g,v>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,_=x*f);let w=P.subarray(0,v),F=P.subarray(v,2*v),b=P.subarray(v*2,3*v);wn.zigZagDeltaDecode(w,F,b),a%x!==0&&(a+=x-a%x);let R=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let E=Ae.createTypedArrayFromArrayBuffer(v,t,a,R*f);a+=R*_;let X=0,A=E.length;for(let de=0;de<A;++de){let xe=E[de];E[de]=X-xe,xe===0&&++X}let N=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Ae.createTypedArrayFromArrayBuffer(v,t,a,N);a+=N*x;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Y=Ae.createTypedArrayFromArrayBuffer(v,t,a,U);a+=U*x;let k=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Ae.createTypedArrayFromArrayBuffer(v,t,a,k);a+=k*x;let J=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Ae.createTypedArrayFromArrayBuffer(v,t,a,J);a+=J*x;let z,j;for(;a<C.byteLength;){let de=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let xe=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,de===H8.OCT_VERTEX_NORMALS&&e._requestVertexNormals)z=new Uint8Array(t,a,v*2);else if(de===H8.WATER_MASK&&e._requestWaterMask)j=new Uint8Array(t,a,xe);else if(de===H8.METADATA&&e._requestMetadata){let Se=C.getUint32(a,!0);if(Se>0){let Le=vo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Se).available;if(l(Le))for(let ke=0;ke<Le.length;++ke){let Be=n+ke+1,it=Le[ke],Gt=e._tilingScheme.getNumberOfYTilesAtLevel(Be);for(let gt=0;gt<it.length;++gt){let Ne=it[gt],Kt=Gt-Ne.endY-1,Lt=Gt-Ne.startY-1;e.availability.addAvailableTileRange(Be,Ne.startX,Kt,Ne.endX,Lt),r.availability.addAvailableTileRange(Be,Ne.startX,Kt,Ne.endX,Lt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=xe}let ee=e.getLevelMaximumGeometricError(n)*5,fe=e._tilingScheme.tileXYToRectangle(i,o,n),Te=Gn.fromRectangle(fe,L,Z,e._tilingScheme.ellipsoid);return new dS({center:V,minimumHeight:L,maximumHeight:Z,boundingSphere:G,orientedBoundingBox:Te,horizonOcclusionPoint:I,quantizedVertices:P,encodedNormals:z,indices:E,westIndices:O,southIndices:Y,eastIndices:H,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:j,credits:e._tileCredits})}Dh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!l(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let h=J8(this,e,t,n,u,d===0);h.result&&(a=!0,c=c.then(()=>h.promise))}return!l(r)&&a?c.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):rSe(this,e,t,n,r,i)};function rSe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ae("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let d,u,h=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),d=nSe(void 0)):d=nSe(c);let g=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(f){return l(f)?l(e._heightmapStructure)?p_t(e,f,i,t,n):b_t(e,f,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties(Dh.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});Dh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Dh.fromIonAssetId=async function(e,t){let n=await yd.fromAssetId(e);return Dh.fromUrl(n,t)};Dh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ze.createIfNeeded(e);n.appendForwardSlash();let i=new iSe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await K8(i);let o=new Dh(t);return i.build(o),o};Dh.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(J8(this,e,t,n,i[r],r===0).result)return;return!1};Dh.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=J8(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function z8(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function J8(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,d=o.availability,u=z8(o,t,n,i);for(;l(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!c.isTileAvailable(u.level,u.x,u.y)){let h;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,h=o.availabilityPromiseCache[s],!l(h))){let p=new Ko({throttle:!1,throttleByServer:!0,type:ls.TERRAIN});h=rSe(e,u.x,u.y,u.level,o,p),l(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}u=z8(o,u.x,u.y,u.level)}return{result:!1}}Dh._getAvailabilityTile=z8;var uS=Dh;var _4i=T(S(),1);function C0(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new sl(n),this._workerName="createCircleGeometry"}C0.packedLength=sl.packedLength;C0.pack=function(e,t,n){return sl.pack(e._ellipseGeometry,t,n)};var sSe=new sl({center:new m,semiMajorAxis:1,semiMinorAxis:1}),Ya={center:new m,radius:void 0,ellipsoid:ne.clone(ne.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Xe,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};C0.unpack=function(e,t,n){let i=sl.unpack(e,t,sSe);return Ya.center=m.clone(i._center,Ya.center),Ya.ellipsoid=ne.clone(i._ellipsoid,Ya.ellipsoid),Ya.ellipsoid=ne.clone(i._ellipsoid,sSe._ellipsoid),Ya.height=i._height,Ya.extrudedHeight=i._extrudedHeight,Ya.granularity=i._granularity,Ya.vertexFormat=Xe.clone(i._vertexFormat,Ya.vertexFormat),Ya.stRotation=i._stRotation,Ya.shadowVolume=i._shadowVolume,l(n)?(Ya.semiMajorAxis=i._semiMajorAxis,Ya.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new sl(Ya),n):(Ya.radius=i._semiMajorAxis,new C0(Ya))};C0.createGeometry=function(e){return sl.createGeometry(e._ellipseGeometry)};C0.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new C0({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Xe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(C0.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Q8=C0;var Z4i=T(S(),1);function TL(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new Md(n),this._workerName="createCircleOutlineGeometry"}TL.packedLength=Md.packedLength;TL.pack=function(e,t,n){return Md.pack(e._ellipseGeometry,t,n)};var g_t=new Md({center:new m,semiMajorAxis:1,semiMinorAxis:1}),ru={center:new m,radius:void 0,ellipsoid:ne.clone(ne.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};TL.unpack=function(e,t,n){let i=Md.unpack(e,t,g_t);return ru.center=m.clone(i._center,ru.center),ru.ellipsoid=ne.clone(i._ellipsoid,ru.ellipsoid),ru.height=i._height,ru.extrudedHeight=i._extrudedHeight,ru.granularity=i._granularity,ru.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(ru.semiMajorAxis=i._semiMajorAxis,ru.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Md(ru),n):(ru.radius=i._semiMajorAxis,new TL(ru))};TL.createGeometry=function(e){return Md.createGeometry(e._ellipseGeometry)};var j8=TL;var A4i=T(S(),1);function SL(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new zi({ellipsoid:y(e.ellipsoid,ne.default)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ge;let n=e.credit;typeof n=="string"&&(n=new St(n)),this._credit=n}Object.defineProperties(SL.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});SL.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Ua({buffer:c,width:r,height:s})})};SL.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};SL.prototype.getTileDataAvailable=function(e,t,n){};SL.prototype.loadTileDataAvailability=function(e,t,n){};var q8=SL;var N4i=T(S(),1);function aSe(e){this.proxy=e}aSe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var $8=aSe;var U4i=T(S(),1),y_t={SEARCH:0,AUTOCOMPLETE:1},Ny=Object.freeze(y_t);var H4i=T(S(),1);function BB(){pe.throwInstantiationError()}Object.defineProperties(BB.prototype,{credit:{get:pe.throwInstantiationError}});BB.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(St.getIonCredit)};BB.prototype.geocode=pe.throwInstantiationError;var CL=BB;var J4i=T(S(),1);function cSe(){pe.throwInstantiationError()}cSe.createGeometry=function(e){pe.throwInstantiationError()};var e7=cSe;var bji=T(S(),1),V_t=T(t7(),1);var nji=T(S(),1);var q4i=T(S(),1);function x_t(e,t){return(e&t)!==0}var Gc=x_t;var __t=[1,2,4,8],lSe=15,T_t=16,S_t=64,C_t=128;function mp(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}mp.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new mp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};mp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};mp.prototype.hasSubtree=function(){return Gc(this._bits,T_t)};mp.prototype.hasImagery=function(){return Gc(this._bits,S_t)};mp.prototype.hasTerrain=function(){return Gc(this._bits,C_t)};mp.prototype.hasChildren=function(){return Gc(this._bits,lSe)};mp.prototype.hasChild=function(e){return Gc(this._bits,__t[e])};mp.prototype.getChildBitmask=function(){return this._bits&lSe};var pM=mp;function L_t(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var R_t=L_t(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB \f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\x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\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS >\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function ru(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=W.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(ru.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});ru.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Ze)&&(t=e.url);let n=Ze.createIfNeeded(t);n.appendForwardSlash();let i=new ru;i._resource=n;try{await C_t(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${lSe(i,"",1).url}: ${o}`;throw new ae(r)}return i};ru.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Zc(t,r)?Zc(e,r)&&(s|=1):(s|=2,Zc(e,r)||(s|=1)),i+=s}return i};ru.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];Zc(s,2)?Zc(s,1)||(t|=r):(n|=r,Zc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};ru.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var cSe=new bi("decodeGoogleEarthEnterprisePacket");ru.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=lSe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return cSe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,h=-1;if(e!==""){h=e.length+1;let f=d[e];u=r[e],u._bits|=f._bits,delete d[e]}let p=Object.keys(d);p.sort(function(f,x){return f.length-x.length});let g=p.length;for(let f=0;f<g;++f){let x=p[f];if(d[x]!==null){let C=h9.clone(d[x]),V=x.length;if(V===h)C.setParent(u);else if(V>1){let L=r[x.substring(0,x.length-1)];C.setParent(L)}r[x]=C}else r[x]=null}})})};ru.prototype.populateSubtree=function(e,t,n,i){let o=ru.tileXYToQuadKey(e,t,n);return i7(this,o,i)};function i7(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new Ko({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),i7(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new ae(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new Ko({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),i7(e,t,s)}).finally(function(){delete a[o]})}ru.prototype.getTileInformation=function(e,t,n){let i=ru.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};ru.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function lSe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var t7,n7;function C_t(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(n7)){let n=rn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;n7=tx(n).then(function(){t7=window.cesiumGoogleEarthDbRootParser(__t),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return n7.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=t7.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return cSe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=t7.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.copyrightString;l(d)&&(o[c.providerId]=new Ct(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=S_t})}var C0=ru;var Gji=T(S(),1);function dS(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(dS.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var mSe="createVerticesFromGoogleEarthEnterpriseBuffer",V_t=new bi(mSe),L_t=new bi(mSe,Xh.maximumAsynchronousTasks),dSe=new ce,o7=new ce;dS.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,dSe),t.tileXYToRectangle(n,i,o,o7);let d=c.cartographicToCartesian(ce.center(o7)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let g=(a?L_t:V_t).scheduleTask({buffer:this._buffer,nativeRectangle:dSe,rectangle:o7,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let f=this;return g.then(function(x){return f._mesh=new dm(d,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,le.clone(x.boundingSphere3D),m.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,Gn.clone(x.orientedBoundingBox),Sc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),f._minimumHeight=x.minimumHeight,f._maximumHeight=x.maximumHeight,f._buffer=void 0,f._mesh})};dS.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1),o=W.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?I_t(this,i,o):P_t(this,i,o,e)};var R_t=new bi("upsampleQuantizedTerrainMesh",Xh.maximumAsynchronousTasks);dS.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=R_t.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:h,ellipsoid:u});if(!l(p))return;let g=this;return p.then(function(f){let x=new Uint16Array(f.vertices),_=Ae.createTypedArray(x.length/3,f.indices),C=g._skirtHeight;return new cS({quantizedVertices:x,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:le.clone(f.boundingSphere),orientedBoundingBox:Gn.clone(f.orientedBoundingBox),horizonOcclusionPoint:m.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};dS.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};dS.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Z_t=new D,G_t=new D,E_t=new D,hSe=new m;function I_t(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,d,Z_t),g=r.decodeTextureCoordinates(o,u,G_t),f=r.decodeTextureCoordinates(o,h,E_t),x=T0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,hSe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,d),C=r.decodeHeight(o,u),V=r.decodeHeight(o,h);return x.x*_+x.y*C+x.z*V}}}var X_t=Uint16Array.BYTES_PER_ELEMENT,uSe=Uint32Array.BYTES_PER_ELEMENT,r7=Int32Array.BYTES_PER_ELEMENT,W_t=Float32Array.BYTES_PER_ELEMENT,s7=Float64Array.BYTES_PER_ELEMENT;function P_t(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),d=0;for(let G=0;G<r;++G)d+=c.getUint32(d,!0),d+=uSe;d+=uSe,d+=2*s7;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=s7;let h=W.toRadians(c.getFloat64(d,!0)*180);d+=s7;let p=i.width/u/2,g=i.height/h/2,f=c.getInt32(d,!0);d+=r7;let x=c.getInt32(d,!0)*3;d+=r7,d+=r7;let _=new Array(f),C=new Array(f),V=new Array(f),L;for(L=0;L<f;++L)_[L]=s+c.getUint8(d++)*p,C[L]=a+c.getUint8(d++)*g,V[L]=c.getFloat32(d,!0)*6371010,d+=W_t;let Z=new Array(x);for(L=0;L<x;++L)Z[L]=c.getUint16(d,!0),d+=X_t;for(L=0;L<x;L+=3){let G=Z[L],I=Z[L+1],v=Z[L+2],P=_[G],w=_[I],F=_[v],b=C[G],R=C[I],E=C[v],X=T0.computeBarycentricCoordinates(t,n,P,b,w,R,F,E,hSe);if(X.x>=-1e-15&&X.y>=-1e-15&&X.z>=-1e-15)return X.x*V[G]+X.y*V[I]+X.z*V[v]}}var TL=dS;var Hji=T(S(),1);var xm={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},BB=new q;function OB(){this._terrainCache={},this._lastTidy=q.now()}OB.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:q.now()}};OB.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};OB.prototype.tidy=function(){if(q.now(BB),q.secondsDifference(BB,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];q.secondsDifference(BB,r.timestamp)>10&&delete e[o]}q.clone(BB,this._lastTidy)}};function ky(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new zi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new OB,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(ky.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});ky.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new ky(t);return n._metadata=e,n};var v_t=new bi("decodeGoogleEarthEnterprisePacket");function fSe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===xm.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}ky.prototype.requestTileGeometry=function(e,t,n,i){let o=C0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new ae("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=xm.UNKNOWN);let d=r.get(o);if(l(d)){let C=s.providers[a.terrainProvider];return Promise.resolve(new TL({buffer:d,childTileMask:fSe(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===xm.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new Na({buffer:new Uint8Array(16*16),width:16,height:16}));let u,h=o,p=-1;switch(c){case xm.SELF:p=a.terrainVersion;break;case xm.PARENT:h=h.substring(0,h.length-1),u=s.getTileInformationFromQuadKey(h),p=u.terrainVersion;break;case xm.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),u=s.getTileInformationFromQuadKey(h),l(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new ae("Terrain tile doesn't exist"));let g=this._terrainPromises,f=this._terrainRequests,x,_;if(l(g[h]))x=g[h],_=f[h];else{_=i;let C=w_t(this,h,p,_).fetchArrayBuffer();if(!l(C))return;x=C.then(function(V){return l(V)?v_t.scheduleTask({buffer:V,type:"Terrain",key:s.key},[V]).then(function(L){let Z=s.getTileInformationFromQuadKey(h);Z.terrainState=xm.SELF,r.add(h,L[0]);let G=Z.terrainProvider,I=L.length-1;for(let v=0;v<I;++v){let P=h+v.toString(),w=s.getTileInformationFromQuadKey(P);l(w)&&(r.add(P,L[v+1]),w.terrainState=xm.PARENT,w.terrainProvider===0&&(w.terrainProvider=G))}}):Promise.reject(new ae("Failed to load terrain."))}),g[h]=x,f[h]=_,x=x.finally(function(){delete g[h],delete f[h]})}return x.then(function(){let C=r.get(o);if(l(C)){let V=s.providers[a.terrainProvider];return new TL({buffer:C,childTileMask:fSe(o,a,s),credits:l(V)?[V]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ae("Failed to load terrain."))}).catch(function(C){return _.state===Qn.CANCELLED?(i.state=_.state,Promise.reject(C)):(a.terrainState=xm.NONE,Promise.reject(C))})};ky.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ky.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=C0.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===xm.NONE)return!1;if((!l(s)||s===xm.UNKNOWN)&&(r.terrainState=xm.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Ko({throttle:!1,throttleByServer:!0,type:ls.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};ky.prototype.loadTileDataAvailability=function(e,t,n){};function w_t(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var a7=ky;var $ji=T(S(),1);var F_t="https://maps.googleapis.com/maps/api/geocode/json",pSe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function c7(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._resource=new Ze({url:F_t,queryParameters:{key:t}}),this._credit=new Ct(pSe,!0)}Object.defineProperties(c7.prototype,{credit:{get:function(){return this._credit}}});c7.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new ae(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:ce.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:pSe,collapsible:!1}}})};var l7=c7;var i8i=T(S(),1);var YB={};YB.defaultApiKey=void 0;YB.mapTilesApiEndpoint=new Ze({url:"https://tile.googleapis.com/v1/"});YB.getDefaultCredit=function(){return new Ct('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var uS=YB;var a8i=T(S(),1);var Gc={};Gc.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Gc.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Gc.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",OPC:"OPC",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles","3MX":"3MX","3SM":"3SM",CCCloudProject:"CCCloudProject",CCImageCollection:"CCImageCollection",CCOrientations:"CCOrientations",ContextCaptureInputs:"ContextCaptureInputs",ContextDetector:"ContextDetector",ContextScene:"ContextScene",DAE:"DAE",DGN:"DGN",DSM:"DSM",FBX:"FBX",GLB:"GLB",GLTF:"GLTF",KML:"KML",LAS:"LAS",LAZ:"LAZ",LOD:"LOD",LodTree:"LodTree",OBJ:"OBJ",OMI:"OMI",OMR:"OMR",Orthophoto:"Orthophoto",OrthophotoDSM:"OrthophotoDSM",OSGB:"OSGB",OVF:"OVF",OBT:"OBT",PLY:"PLY",PointCloud:"PointCloud",S3C:"S3C",ScanCollection:"ScanCollection",SHP:"SHP",SLPK:"SLPK",SpaceEyes3D:"SpaceEyes3D",STL:"STL",TSM:"TSM",Unstructured:"Unstructured",Other:"Other"});Gc.defaultAccessToken=void 0;Gc.apiEndpoint=new Ze({url:"https://api.bentley.com"});Gc.getExports=async function(e){let t=new Ze({url:`${Gc.apiEndpoint}mesh-export`,headers:{Authorization:`Bearer ${Gc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Gc.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);throw n.statusCode===401?new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${i.error.details[0].code}`):n.statusCode===403?(console.error(i.error.code,i.error.message),new ae("Not allowed, forbidden")):n.statusCode===422?new ae(`Unprocessable Entity:${i.error.code} ${i.error.message}`):n.statusCode===429?new ae("Too many requests"):new ae(`Unknown request failure ${n.statusCode}`)}};Gc.getRealityDataMetadata=async function(e,t){let n=new Ze({url:`${Gc.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:`Bearer ${Gc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);throw i.statusCode===401?new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${o.error.details[0].code}`):i.statusCode===403?(console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden")):i.statusCode===404?new ae(`Reality data not found: ${e}, ${t}`):i.statusCode===422?new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`):i.statusCode===429?new ae("Too many requests"):new ae(`Unknown request failure ${i.statusCode}`)}};Gc.getRealityDataURL=async function(e,t,n){let i=new Ze({url:`${Gc.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:`Bearer ${Gc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);throw o.statusCode===401?new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r.error.details[0].code}`):o.statusCode===403?(console.error(r.error.code,r.error.message),new ae("Not allowed, forbidden")):o.statusCode===404?new ae(`Reality data not found: ${e}, ${t}`):o.statusCode===422?new ae(`Unprocessable Entity:${r.error.code} ${r.error.message}`):o.statusCode===429?new ae("Too many requests"):new ae(`Unknown request failure ${o.statusCode}`)}};var su=Gc;var d8i=T(S(),1);var f9={};f9.type=void 0;f9.getRequiredDataPoints=pe.throwInstantiationError;f9.interpolateOrderZero=pe.throwInstantiationError;f9.interpolate=pe.throwInstantiationError;var d7=f9;var m8i=T(S(),1),A_t={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},V0=Object.freeze(A_t);var E8i=T(S(),1);var x8i=T(S(),1);function u7(e){this._url=Ze.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(u7.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});u7.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Ny.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=m.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var p9=u7;function M_t(e){if(!Object.values(V0).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var bSe=Object.freeze({[V0.GOOGLE]:"google",[V0.BING]:"bing",[V0.DEFAULT]:void 0});function N_t(e){return bSe[e]}function k_t(e){return Object.entries(bSe).find(t=>t[1]===e)[0]}function m7(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.geocodeProviderType,V0.DEFAULT),n=y(e.accessToken,Om.defaultAccessToken),i=Ze.createIfNeeded(y(e.server,Om.defaultServer));i.appendForwardSlash();let o=Om.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Ct.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new p9(r),this.geocodeProviderType=t}Object.defineProperties(m7.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return k_t(this._pelias.url.queryParameters.geocoder)},set:function(e){M_t(e);let t={...this._pelias.url.queryParameters,geocoder:N_t(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});m7.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var mS=m7;var W8i=T(S(),1);function HB(){pe.throwInstantiationError()}Object.defineProperties(HB.prototype,{ellipsoid:{get:pe.throwInstantiationError}});HB.prototype.project=pe.throwInstantiationError;HB.prototype.unproject=pe.throwInstantiationError;var h7=HB;var A8i=T(S(),1);function SL(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(SL.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});SL.prototype.findTimeInterval=io.prototype.findTimeInterval;SL.prototype.wrapTime=io.prototype.wrapTime;SL.prototype.clampTime=io.prototype.clampTime;SL.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var f7=SL;var H8i=T(S(),1);function p7(e,t,n){e=Ze.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new Ct('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(p7.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});p7.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:St(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ce.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var b7=p7;var J8i=T(S(),1);var U_t={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},g7=U_t;var q8i=T(S(),1);var D_t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},y7=D_t;var t7i=T(S(),1);function gSe(){pe.throwInstantiationError()}gSe.prototype.getURL=pe.throwInstantiationError;var x7=gSe;var y7i=T(S(),1);function B_t(e,t,n,i,o,r,s){let a=Xi.numberOfPoints(e,t,o),c,d=n.red,u=n.green,h=n.blue,p=n.alpha,g=i.red,f=i.green,x=i.blue,_=i.alpha;if(B.equals(n,i)){for(c=0;c<a;c++)r[s++]=B.floatToByte(d),r[s++]=B.floatToByte(u),r[s++]=B.floatToByte(h),r[s++]=B.floatToByte(p);return s}let C=(g-d)/a,V=(f-u)/a,L=(x-h)/a,Z=(_-p)/a,G=s;for(c=0;c<a;c++)r[G++]=B.floatToByte(d+c*C),r[G++]=B.floatToByte(u+c*V),r[G++]=B.floatToByte(h+c*L),r[G++]=B.floatToByte(p+c*Z);return G}function b9(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,tn.GEODESIC),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,ne.default),this._workerName="createSimplePolylineGeometry";let o=1+t.length*m.packedLength;o+=l(n)?1+n.length*B.packedLength:1,this.packedLength=o+ne.packedLength+3}b9.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=B.packedLength)B.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};b9.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=B.packedLength)s[i]=B.unpack(e,t);let a=ne.unpack(e,t);t+=ne.packedLength;let c=e[t++]===1,d=e[t++],u=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=d,n._granularity=u,n):new b9({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var zB=new Array(2),KB=new Array(2),O_t={positions:zB,height:KB,ellipsoid:void 0,minDistance:void 0,granularity:void 0};b9.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=W.chordLength(r,s.maximumRadius),c=l(n)&&!i,d,u=t.length,h,p,g,f,x=0;if(o===tn.GEODESIC||o===tn.RHUMB){let Z,G,I;o===tn.GEODESIC?(Z=W.chordLength(r,s.maximumRadius),G=Xi.numberOfPoints,I=Xi.generateArc):(Z=r,G=Xi.numberOfPointsRhumbLine,I=Xi.generateRhumbArc);let v=Xi.extractHeights(t,s),P=O_t;if(o===tn.GEODESIC?P.minDistance=a:P.granularity=r,P.ellipsoid=s,c){let w=0;for(d=0;d<u-1;d++)w+=G(t[d],t[d+1],Z)+1;h=new Float64Array(w*3),g=new Uint8Array(w*4),P.positions=zB,P.height=KB;let F=0;for(d=0;d<u-1;++d){zB[0]=t[d],zB[1]=t[d+1],KB[0]=v[d],KB[1]=v[d+1];let b=I(P);if(l(n)){let R=b.length/3;f=n[d];for(let E=0;E<R;++E)g[F++]=B.floatToByte(f.red),g[F++]=B.floatToByte(f.green),g[F++]=B.floatToByte(f.blue),g[F++]=B.floatToByte(f.alpha)}h.set(b,x),x+=b.length}}else if(P.positions=t,P.height=v,h=new Float64Array(I(P)),l(n)){for(g=new Uint8Array(h.length/3*4),d=0;d<u-1;++d){let F=t[d],b=t[d+1],R=n[d],E=n[d+1];x=B_t(F,b,R,E,a,g,x)}let w=n[u-1];g[x++]=B.floatToByte(w.red),g[x++]=B.floatToByte(w.green),g[x++]=B.floatToByte(w.blue),g[x++]=B.floatToByte(w.alpha)}}else{p=c?u*2-2:u,h=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let Z=0,G=0;for(d=0;d<u;++d){let I=t[d];if(c&&d>0&&(m.pack(I,h,Z),Z+=3,f=n[d-1],g[G++]=B.floatToByte(f.red),g[G++]=B.floatToByte(f.green),g[G++]=B.floatToByte(f.blue),g[G++]=B.floatToByte(f.alpha)),c&&d===u-1)break;m.pack(I,h,Z),Z+=3,l(n)&&(f=n[d],g[G++]=B.floatToByte(f.red),g[G++]=B.floatToByte(f.green),g[G++]=B.floatToByte(f.blue),g[G++]=B.floatToByte(f.alpha))}}let _=new hn;_.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:h}),l(n)&&(_.color=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=h.length/3;let C=(p-1)*2,V=Ae.createTypedArray(p,C),L=0;for(d=0;d<p-1;++d)V[L++]=d,V[L++]=d+1;return new lt({attributes:_,indices:V,primitiveType:we.LINES,boundingSphere:le.fromPoints(t)})};var _7=b9;var L7i=T(S(),1);function CL(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Ks(i),this._workerName="createSphereGeometry"}CL.packedLength=Ks.packedLength;CL.pack=function(e,t,n){return Ks.pack(e._ellipsoidGeometry,t,n)};var Y_t=new Ks,Uy={radius:void 0,radii:new m,vertexFormat:new Xe,stackPartitions:void 0,slicePartitions:void 0};CL.unpack=function(e,t,n){let i=Ks.unpack(e,t,Y_t);return Uy.vertexFormat=Xe.clone(i._vertexFormat,Uy.vertexFormat),Uy.stackPartitions=i._stackPartitions,Uy.slicePartitions=i._slicePartitions,l(n)?(m.clone(i._radii,Uy.radii),n._ellipsoidGeometry=new Ks(Uy),n):(Uy.radius=i._radii.x,new CL(Uy))};CL.createGeometry=function(e){return Ks.createGeometry(e._ellipsoidGeometry)};var T7=CL;var G7i=T(S(),1);function Dy(e){}Object.defineProperties(Dy.prototype,{ellipsoid:{get:pe.throwInstantiationError},rectangle:{get:pe.throwInstantiationError},projection:{get:pe.throwInstantiationError}});Dy.prototype.getNumberOfXTilesAtLevel=pe.throwInstantiationError;Dy.prototype.getNumberOfYTilesAtLevel=pe.throwInstantiationError;Dy.prototype.rectangleToNativeRectangle=pe.throwInstantiationError;Dy.prototype.tileXYToNativeRectangle=pe.throwInstantiationError;Dy.prototype.tileXYToRectangle=pe.throwInstantiationError;Dy.prototype.positionToTileXY=pe.throwInstantiationError;var S7=Dy;var O7i=T(S(),1);function H_t(e,t){this.rectangle=e,this.maxLevel=t}function ySe(e){this.ellipsoid=y(e.ellipsoid,ne.default),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}ySe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function z_t(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new zi({ellipsoid:e.ellipsoid});else throw new ae(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=W.toRadians(parseFloat(s.getAttribute("minx"))),c=W.toRadians(parseFloat(s.getAttribute("miny"))),d=W.toRadians(parseFloat(s.getAttribute("maxx"))),u=W.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new H_t(new ce(a,c,d,u),h))}}function K_t(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function J_t(e,t,n){try{let i=await t.fetchXML();z_t(e,i)}catch(i){K_t(t,i,n)}}function By(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new be,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(By.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});By.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new ySe(t),i=Ze.createIfNeeded(e);await J_t(n,i);let o=new By(t);return n.build(o),o._resource=i,o};By.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Na({buffer:Lm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Q_t(a,e,t,n),structure:a._terrainDataStructure})})};By.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var xSe=new ce;function Q_t(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let d=r[c];if(d.maxLevel<=i)continue;let u=d.rectangle,h=ce.intersection(u,s,xSe);l(h)&&(JB(o,u,t*2,n*2,i+1)&&(a|=4),JB(o,u,t*2+1,n*2,i+1)&&(a|=8),JB(o,u,t*2,n*2+1,i+1)&&(a|=1),JB(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function JB(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ce.intersection(r,t,xSe))}By.prototype.getTileDataAvailable=function(e,t,n){};By.prototype.loadTileDataAvailability=function(e,t,n){};var C7=By;var j7i=T(S(),1);function hS(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,Oe.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(hS.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(hS.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=j_t(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});hS.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,me(this)};hS.prototype.isDestroyed=function(){return!1};hS.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};hS.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=y(this.epoch,Oe.MINIMUM_VALUE),s=q.secondsDifference(o,r),a=t.duration,c,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let u=i?y(this.tolerance,1):.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function j_t(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var V7=hS;var $7i=T(S(),1),q_t={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},L7=Object.freeze(q_t);var i6i=T(S(),1);function $_t(e){return e=y(e,y.EMPTY_OBJECT),lS.fromIonAssetId(2426648,{requestVertexNormals:y(e.requestVertexNormals,!1)})}var g9=$_t;var c6i=T(S(),1);function eTt(e){return e=y(e,y.EMPTY_OBJECT),lS.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1),ellipsoid:ne.WGS84})}var fS=eTt;var u6i=T(S(),1);var tTt=1953029805,nTt=2917034100;function R7(e,t){if(R7.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new ae("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===tTt||o===nTt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,d=n,u,h=8;for(;s<c;)for(h=(h+8)%24,u=h;s<c&&u<d;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=d&&(h=(h+8)%24,u=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}R7.passThroughDataForTesting=!1;var y9=R7;var b6i=T(S(),1);var iTt=new m;function oTt(e,t,n,i){let o=dx(e,t,n,i,iTt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var Z7=oTt;var y6i=T(S(),1);function rTt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var pS=rTt;var T6i=T(S(),1);function sTt(e){switch(e){case ie.FLOAT:return"float";case ie.FLOAT_VEC2:return"vec2";case ie.FLOAT_VEC3:return"vec3";case ie.FLOAT_VEC4:return"vec4";case ie.FLOAT_MAT2:return"mat2";case ie.FLOAT_MAT3:return"mat3";case ie.FLOAT_MAT4:return"mat4";case ie.SAMPLER_2D:return"sampler2D";case ie.BOOL:return"bool"}}var G7=sTt;var C6i=T(S(),1);function aTt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var x9=aTt;var G6i=T(S(),1);var cTt=new m(1,1,1);function E7(e){e=y(e,cTt),this._dimensions=m.clone(e)}Object.defineProperties(E7.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var lTt=new m;E7.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,lTt),i=W.randomBetween(-n.x,n.x),o=W.randomBetween(-n.y,n.y),r=W.randomBetween(-n.z,n.z);e.position=m.fromElements(i,o,r,e.position),e.velocity=m.normalize(e.position,e.velocity)};var I7=E7;var X6i=T(S(),1);function mp(){this.featurePropertiesDirty=!1}Object.defineProperties(mp.prototype,{featuresLength:{get:function(){pe.throwInstantiationError()}},pointsLength:{get:function(){pe.throwInstantiationError()}},trianglesLength:{get:function(){pe.throwInstantiationError()}},geometryByteLength:{get:function(){pe.throwInstantiationError()}},texturesByteLength:{get:function(){pe.throwInstantiationError()}},batchTableByteLength:{get:function(){pe.throwInstantiationError()}},innerContents:{get:function(){pe.throwInstantiationError()}},ready:{get:function(){pe.throwInstantiationError()}},tileset:{get:function(){pe.throwInstantiationError()}},tile:{get:function(){pe.throwInstantiationError()}},url:{get:function(){pe.throwInstantiationError()}},batchTable:{get:function(){pe.throwInstantiationError()}},metadata:{get:function(){pe.throwInstantiationError()},set:function(e){pe.throwInstantiationError()}},group:{get:function(){pe.throwInstantiationError()},set:function(e){pe.throwInstantiationError()}}});mp.prototype.hasProperty=function(e,t){pe.throwInstantiationError()};mp.prototype.getFeature=function(e){pe.throwInstantiationError()};mp.prototype.applyDebugSettings=function(e,t){pe.throwInstantiationError()};mp.prototype.applyStyle=function(e){pe.throwInstantiationError()};mp.prototype.update=function(e,t){pe.throwInstantiationError()};mp.prototype.pick=function(e,t,n){pe.throwInstantiationError()};mp.prototype.isDestroyed=function(){pe.throwInstantiationError()};mp.prototype.destroy=function(){pe.throwInstantiationError()};var X7=mp;var O6i=T(S(),1);var F6i=T(S(),1);function VL(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,uTt(this,t)}Object.defineProperties(VL.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function dTt(e,t){this.condition=e,this.expression=t}function uTt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new dTt(new Eu(a,t),new Eu(c,t)))}e._runtimeConditions=n}VL.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};VL.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};VL.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],d=c.condition.getShaderExpression(t,n),u=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${d}) +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function su(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=W.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(su.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});su.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Ze)&&(t=e.url);let n=Ze.createIfNeeded(t);n.appendForwardSlash();let i=new su;i._resource=n;try{await Z_t(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${uSe(i,"",1).url}: ${o}`;throw new ae(r)}return i};su.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Gc(t,r)?Gc(e,r)&&(s|=1):(s|=2,Gc(e,r)||(s|=1)),i+=s}return i};su.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];Gc(s,2)?Gc(s,1)||(t|=r):(n|=r,Gc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};su.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var dSe=new gi("decodeGoogleEarthEnterprisePacket");su.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=uSe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return dSe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,h=-1;if(e!==""){h=e.length+1;let f=d[e];u=r[e],u._bits|=f._bits,delete d[e]}let p=Object.keys(d);p.sort(function(f,x){return f.length-x.length});let g=p.length;for(let f=0;f<g;++f){let x=p[f];if(d[x]!==null){let C=pM.clone(d[x]),V=x.length;if(V===h)C.setParent(u);else if(V>1){let L=r[x.substring(0,x.length-1)];C.setParent(L)}r[x]=C}else r[x]=null}})})};su.prototype.populateSubtree=function(e,t,n,i){let o=su.tileXYToQuadKey(e,t,n);return o7(this,o,i)};function o7(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new Ko({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),o7(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new ae(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new Ko({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),o7(e,t,s)}).finally(function(){delete a[o]})}su.prototype.getTileInformation=function(e,t,n){let i=su.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};su.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function uSe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var n7,i7;function Z_t(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(i7)){let n=nn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;i7=tx(n).then(function(){n7=window.cesiumGoogleEarthDbRootParser(V_t),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return i7.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=n7.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return dSe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=n7.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.copyrightString;l(d)&&(o[c.providerId]=new St(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=R_t})}var V0=su;var Pji=T(S(),1);function mS(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(mS.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var fSe="createVerticesFromGoogleEarthEnterpriseBuffer",G_t=new gi(fSe),E_t=new gi(fSe,Xh.maximumAsynchronousTasks),mSe=new ce,r7=new ce;mS.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,mSe),t.tileXYToRectangle(n,i,o,r7);let d=c.cartographicToCartesian(ce.center(r7)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let g=(a?E_t:G_t).scheduleTask({buffer:this._buffer,nativeRectangle:mSe,rectangle:r7,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let f=this;return g.then(function(x){return f._mesh=new dm(d,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,le.clone(x.boundingSphere3D),m.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,Gn.clone(x.orientedBoundingBox),Cc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),f._minimumHeight=x.minimumHeight,f._maximumHeight=x.maximumHeight,f._buffer=void 0,f._mesh})};mS.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1),o=W.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?v_t(this,i,o):A_t(this,i,o,e)};var I_t=new gi("upsampleQuantizedTerrainMesh",Xh.maximumAsynchronousTasks);mS.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=I_t.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:h,ellipsoid:u});if(!l(p))return;let g=this;return p.then(function(f){let x=new Uint16Array(f.vertices),_=Ae.createTypedArray(x.length/3,f.indices),C=g._skirtHeight;return new dS({quantizedVertices:x,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:le.clone(f.boundingSphere),orientedBoundingBox:Gn.clone(f.orientedBoundingBox),horizonOcclusionPoint:m.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};mS.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};mS.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var X_t=new D,W_t=new D,P_t=new D,pSe=new m;function v_t(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,d,X_t),g=r.decodeTextureCoordinates(o,u,W_t),f=r.decodeTextureCoordinates(o,h,P_t),x=S0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,pSe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,d),C=r.decodeHeight(o,u),V=r.decodeHeight(o,h);return x.x*_+x.y*C+x.z*V}}}var w_t=Uint16Array.BYTES_PER_ELEMENT,hSe=Uint32Array.BYTES_PER_ELEMENT,s7=Int32Array.BYTES_PER_ELEMENT,F_t=Float32Array.BYTES_PER_ELEMENT,a7=Float64Array.BYTES_PER_ELEMENT;function A_t(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),d=0;for(let G=0;G<r;++G)d+=c.getUint32(d,!0),d+=hSe;d+=hSe,d+=2*a7;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=a7;let h=W.toRadians(c.getFloat64(d,!0)*180);d+=a7;let p=i.width/u/2,g=i.height/h/2,f=c.getInt32(d,!0);d+=s7;let x=c.getInt32(d,!0)*3;d+=s7,d+=s7;let _=new Array(f),C=new Array(f),V=new Array(f),L;for(L=0;L<f;++L)_[L]=s+c.getUint8(d++)*p,C[L]=a+c.getUint8(d++)*g,V[L]=c.getFloat32(d,!0)*6371010,d+=F_t;let Z=new Array(x);for(L=0;L<x;++L)Z[L]=c.getUint16(d,!0),d+=w_t;for(L=0;L<x;L+=3){let G=Z[L],I=Z[L+1],v=Z[L+2],P=_[G],w=_[I],F=_[v],b=C[G],R=C[I],E=C[v],X=S0.computeBarycentricCoordinates(t,n,P,b,w,R,F,E,pSe);if(X.x>=-1e-15&&X.y>=-1e-15&&X.z>=-1e-15)return X.x*V[G]+X.y*V[I]+X.z*V[v]}}var VL=mS;var jji=T(S(),1);var xm={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},OB=new q;function YB(){this._terrainCache={},this._lastTidy=q.now()}YB.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:q.now()}};YB.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};YB.prototype.tidy=function(){if(q.now(OB),q.secondsDifference(OB,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];q.secondsDifference(OB,r.timestamp)>10&&delete e[o]}q.clone(OB,this._lastTidy)}};function ky(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new zi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new YB,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new ge}Object.defineProperties(ky.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});ky.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new ky(t);return n._metadata=e,n};var M_t=new gi("decodeGoogleEarthEnterprisePacket");function bSe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===xm.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}ky.prototype.requestTileGeometry=function(e,t,n,i){let o=V0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new ae("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=xm.UNKNOWN);let d=r.get(o);if(l(d)){let C=s.providers[a.terrainProvider];return Promise.resolve(new VL({buffer:d,childTileMask:bSe(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===xm.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new Ua({buffer:new Uint8Array(16*16),width:16,height:16}));let u,h=o,p=-1;switch(c){case xm.SELF:p=a.terrainVersion;break;case xm.PARENT:h=h.substring(0,h.length-1),u=s.getTileInformationFromQuadKey(h),p=u.terrainVersion;break;case xm.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),u=s.getTileInformationFromQuadKey(h),l(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new ae("Terrain tile doesn't exist"));let g=this._terrainPromises,f=this._terrainRequests,x,_;if(l(g[h]))x=g[h],_=f[h];else{_=i;let C=N_t(this,h,p,_).fetchArrayBuffer();if(!l(C))return;x=C.then(function(V){return l(V)?M_t.scheduleTask({buffer:V,type:"Terrain",key:s.key},[V]).then(function(L){let Z=s.getTileInformationFromQuadKey(h);Z.terrainState=xm.SELF,r.add(h,L[0]);let G=Z.terrainProvider,I=L.length-1;for(let v=0;v<I;++v){let P=h+v.toString(),w=s.getTileInformationFromQuadKey(P);l(w)&&(r.add(P,L[v+1]),w.terrainState=xm.PARENT,w.terrainProvider===0&&(w.terrainProvider=G))}}):Promise.reject(new ae("Failed to load terrain."))}),g[h]=x,f[h]=_,x=x.finally(function(){delete g[h],delete f[h]})}return x.then(function(){let C=r.get(o);if(l(C)){let V=s.providers[a.terrainProvider];return new VL({buffer:C,childTileMask:bSe(o,a,s),credits:l(V)?[V]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ae("Failed to load terrain."))}).catch(function(C){return _.state===jn.CANCELLED?(i.state=_.state,Promise.reject(C)):(a.terrainState=xm.NONE,Promise.reject(C))})};ky.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ky.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=V0.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===xm.NONE)return!1;if((!l(s)||s===xm.UNKNOWN)&&(r.terrainState=xm.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Ko({throttle:!1,throttleByServer:!0,type:ls.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};ky.prototype.loadTileDataAvailability=function(e,t,n){};function N_t(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var c7=ky;var o8i=T(S(),1);var k_t="https://maps.googleapis.com/maps/api/geocode/json",gSe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function l7(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._resource=new Ze({url:k_t,queryParameters:{key:t}}),this._credit=new St(gSe,!0)}Object.defineProperties(l7.prototype,{credit:{get:function(){return this._credit}}});l7.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new ae(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:ce.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:gSe,collapsible:!1}}})};var d7=l7;var c8i=T(S(),1);var HB={};HB.defaultApiKey=void 0;HB.mapTilesApiEndpoint=new Ze({url:"https://tile.googleapis.com/v1/"});HB.getDefaultCredit=function(){return new St('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var hS=HB;var m8i=T(S(),1);var Ec={};Ec.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Ec.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Ec.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Ec.defaultAccessToken=void 0;Ec.apiEndpoint=new Ze({url:"https://api.bentley.com"});Ec.getExports=async function(e){let t=new Ze({url:`${Ec.apiEndpoint}mesh-export`,headers:{Authorization:`Bearer ${Ec.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Ec.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);throw n.statusCode===401?new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${i.error.details[0].code}`):n.statusCode===403?(console.error(i.error.code,i.error.message),new ae("Not allowed, forbidden")):n.statusCode===422?new ae(`Unprocessable Entity:${i.error.code} ${i.error.message}`):n.statusCode===429?new ae("Too many requests"):new ae(`Unknown request failure ${n.statusCode}`)}};Ec.getRealityDataMetadata=async function(e,t){let n=new Ze({url:`${Ec.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:`Bearer ${Ec.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);throw i.statusCode===401?new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${o.error.details[0].code}`):i.statusCode===403?(console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden")):i.statusCode===404?new ae(`Reality data not found: ${e}, ${t}`):i.statusCode===422?new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`):i.statusCode===429?new ae("Too many requests"):new ae(`Unknown request failure ${i.statusCode}`)}};Ec.getRealityDataURL=async function(e,t,n){let i=new Ze({url:`${Ec.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:`Bearer ${Ec.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);throw o.statusCode===401?new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r.error.details[0].code}`):o.statusCode===403?(console.error(r.error.code,r.error.message),new ae("Not allowed, forbidden")):o.statusCode===404?new ae(`Reality data not found: ${e}, ${t}`):o.statusCode===422?new ae(`Unprocessable Entity:${r.error.code} ${r.error.message}`):o.statusCode===429?new ae("Too many requests"):new ae(`Unknown request failure ${o.statusCode}`)}};var Sa=Ec;var p8i=T(S(),1);var bM={};bM.type=void 0;bM.getRequiredDataPoints=pe.throwInstantiationError;bM.interpolateOrderZero=pe.throwInstantiationError;bM.interpolate=pe.throwInstantiationError;var u7=bM;var g8i=T(S(),1),U_t={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},L0=Object.freeze(U_t);var v8i=T(S(),1);var V8i=T(S(),1);function m7(e){this._url=Ze.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(m7.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});m7.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Ny.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=m.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var gM=m7;function D_t(e){if(!Object.values(L0).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var ySe=Object.freeze({[L0.GOOGLE]:"google",[L0.BING]:"bing",[L0.DEFAULT]:void 0});function B_t(e){return ySe[e]}function O_t(e){return Object.entries(ySe).find(t=>t[1]===e)[0]}function h7(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.geocodeProviderType,L0.DEFAULT),n=y(e.accessToken,Bm.defaultAccessToken),i=Ze.createIfNeeded(y(e.server,Bm.defaultServer));i.appendForwardSlash();let o=Bm.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(St.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new gM(r),this.geocodeProviderType=t}Object.defineProperties(h7.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return O_t(this._pelias.url.queryParameters.geocoder)},set:function(e){D_t(e);let t={...this._pelias.url.queryParameters,geocoder:B_t(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});h7.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var fS=h7;var A8i=T(S(),1);function zB(){pe.throwInstantiationError()}Object.defineProperties(zB.prototype,{ellipsoid:{get:pe.throwInstantiationError}});zB.prototype.project=pe.throwInstantiationError;zB.prototype.unproject=pe.throwInstantiationError;var f7=zB;var D8i=T(S(),1);function LL(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(LL.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});LL.prototype.findTimeInterval=io.prototype.findTimeInterval;LL.prototype.wrapTime=io.prototype.wrapTime;LL.prototype.clampTime=io.prototype.clampTime;LL.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var p7=LL;var j8i=T(S(),1);function b7(e,t,n){e=Ze.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new St('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(b7.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});b7.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Tt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ce.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var g7=b7;var e7i=T(S(),1);var Y_t={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},y7=Y_t;var i7i=T(S(),1);var H_t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},x7=H_t;var s7i=T(S(),1);function xSe(){pe.throwInstantiationError()}xSe.prototype.getURL=pe.throwInstantiationError;var _7=xSe;var C7i=T(S(),1);function z_t(e,t,n,i,o,r,s){let a=Pi.numberOfPoints(e,t,o),c,d=n.red,u=n.green,h=n.blue,p=n.alpha,g=i.red,f=i.green,x=i.blue,_=i.alpha;if(B.equals(n,i)){for(c=0;c<a;c++)r[s++]=B.floatToByte(d),r[s++]=B.floatToByte(u),r[s++]=B.floatToByte(h),r[s++]=B.floatToByte(p);return s}let C=(g-d)/a,V=(f-u)/a,L=(x-h)/a,Z=(_-p)/a,G=s;for(c=0;c<a;c++)r[G++]=B.floatToByte(d+c*C),r[G++]=B.floatToByte(u+c*V),r[G++]=B.floatToByte(h+c*L),r[G++]=B.floatToByte(p+c*Z);return G}function yM(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,en.GEODESIC),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,ne.default),this._workerName="createSimplePolylineGeometry";let o=1+t.length*m.packedLength;o+=l(n)?1+n.length*B.packedLength:1,this.packedLength=o+ne.packedLength+3}yM.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=B.packedLength)B.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};yM.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=B.packedLength)s[i]=B.unpack(e,t);let a=ne.unpack(e,t);t+=ne.packedLength;let c=e[t++]===1,d=e[t++],u=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=d,n._granularity=u,n):new yM({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var KB=new Array(2),JB=new Array(2),K_t={positions:KB,height:JB,ellipsoid:void 0,minDistance:void 0,granularity:void 0};yM.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=W.chordLength(r,s.maximumRadius),c=l(n)&&!i,d,u=t.length,h,p,g,f,x=0;if(o===en.GEODESIC||o===en.RHUMB){let Z,G,I;o===en.GEODESIC?(Z=W.chordLength(r,s.maximumRadius),G=Pi.numberOfPoints,I=Pi.generateArc):(Z=r,G=Pi.numberOfPointsRhumbLine,I=Pi.generateRhumbArc);let v=Pi.extractHeights(t,s),P=K_t;if(o===en.GEODESIC?P.minDistance=a:P.granularity=r,P.ellipsoid=s,c){let w=0;for(d=0;d<u-1;d++)w+=G(t[d],t[d+1],Z)+1;h=new Float64Array(w*3),g=new Uint8Array(w*4),P.positions=KB,P.height=JB;let F=0;for(d=0;d<u-1;++d){KB[0]=t[d],KB[1]=t[d+1],JB[0]=v[d],JB[1]=v[d+1];let b=I(P);if(l(n)){let R=b.length/3;f=n[d];for(let E=0;E<R;++E)g[F++]=B.floatToByte(f.red),g[F++]=B.floatToByte(f.green),g[F++]=B.floatToByte(f.blue),g[F++]=B.floatToByte(f.alpha)}h.set(b,x),x+=b.length}}else if(P.positions=t,P.height=v,h=new Float64Array(I(P)),l(n)){for(g=new Uint8Array(h.length/3*4),d=0;d<u-1;++d){let F=t[d],b=t[d+1],R=n[d],E=n[d+1];x=z_t(F,b,R,E,a,g,x)}let w=n[u-1];g[x++]=B.floatToByte(w.red),g[x++]=B.floatToByte(w.green),g[x++]=B.floatToByte(w.blue),g[x++]=B.floatToByte(w.alpha)}}else{p=c?u*2-2:u,h=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let Z=0,G=0;for(d=0;d<u;++d){let I=t[d];if(c&&d>0&&(m.pack(I,h,Z),Z+=3,f=n[d-1],g[G++]=B.floatToByte(f.red),g[G++]=B.floatToByte(f.green),g[G++]=B.floatToByte(f.blue),g[G++]=B.floatToByte(f.alpha)),c&&d===u-1)break;m.pack(I,h,Z),Z+=3,l(n)&&(f=n[d],g[G++]=B.floatToByte(f.red),g[G++]=B.floatToByte(f.green),g[G++]=B.floatToByte(f.blue),g[G++]=B.floatToByte(f.alpha))}}let _=new mn;_.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:h}),l(n)&&(_.color=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=h.length/3;let C=(p-1)*2,V=Ae.createTypedArray(p,C),L=0;for(d=0;d<p-1;++d)V[L++]=d,V[L++]=d+1;return new ct({attributes:_,indices:V,primitiveType:we.LINES,boundingSphere:le.fromPoints(t)})};var T7=yM;var I7i=T(S(),1);function RL(e){let t=y(e.radius,1),i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Ks(i),this._workerName="createSphereGeometry"}RL.packedLength=Ks.packedLength;RL.pack=function(e,t,n){return Ks.pack(e._ellipsoidGeometry,t,n)};var J_t=new Ks,Uy={radius:void 0,radii:new m,vertexFormat:new Xe,stackPartitions:void 0,slicePartitions:void 0};RL.unpack=function(e,t,n){let i=Ks.unpack(e,t,J_t);return Uy.vertexFormat=Xe.clone(i._vertexFormat,Uy.vertexFormat),Uy.stackPartitions=i._stackPartitions,Uy.slicePartitions=i._slicePartitions,l(n)?(m.clone(i._radii,Uy.radii),n._ellipsoidGeometry=new Ks(Uy),n):(Uy.radius=i._radii.x,new RL(Uy))};RL.createGeometry=function(e){return Ks.createGeometry(e._ellipsoidGeometry)};var S7=RL;var P7i=T(S(),1);function Dy(e){}Object.defineProperties(Dy.prototype,{ellipsoid:{get:pe.throwInstantiationError},rectangle:{get:pe.throwInstantiationError},projection:{get:pe.throwInstantiationError}});Dy.prototype.getNumberOfXTilesAtLevel=pe.throwInstantiationError;Dy.prototype.getNumberOfYTilesAtLevel=pe.throwInstantiationError;Dy.prototype.rectangleToNativeRectangle=pe.throwInstantiationError;Dy.prototype.tileXYToNativeRectangle=pe.throwInstantiationError;Dy.prototype.tileXYToRectangle=pe.throwInstantiationError;Dy.prototype.positionToTileXY=pe.throwInstantiationError;var C7=Dy;var J7i=T(S(),1);function Q_t(e,t){this.rectangle=e,this.maxLevel=t}function _Se(e){this.ellipsoid=y(e.ellipsoid,ne.default),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}_Se.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function j_t(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new zi({ellipsoid:e.ellipsoid});else throw new ae(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=is.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=W.toRadians(parseFloat(s.getAttribute("minx"))),c=W.toRadians(parseFloat(s.getAttribute("miny"))),d=W.toRadians(parseFloat(s.getAttribute("maxx"))),u=W.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new Q_t(new ce(a,c,d,u),h))}}function q_t(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function $_t(e,t,n){try{let i=await t.fetchXML();j_t(e,i)}catch(i){q_t(t,i,n)}}function By(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new ge,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(By.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});By.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new _Se(t),i=Ze.createIfNeeded(e);await $_t(n,i);let o=new By(t);return n.build(o),o._resource=i,o};By.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Ua({buffer:Lm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:eTt(a,e,t,n),structure:a._terrainDataStructure})})};By.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var TSe=new ce;function eTt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let d=r[c];if(d.maxLevel<=i)continue;let u=d.rectangle,h=ce.intersection(u,s,TSe);l(h)&&(QB(o,u,t*2,n*2,i+1)&&(a|=4),QB(o,u,t*2+1,n*2,i+1)&&(a|=8),QB(o,u,t*2,n*2+1,i+1)&&(a|=1),QB(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function QB(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ce.intersection(r,t,TSe))}By.prototype.getTileDataAvailable=function(e,t,n){};By.prototype.loadTileDataAvailability=function(e,t,n){};var V7=By;var n6i=T(S(),1);function pS(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,Oe.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(pS.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(pS.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=tTt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});pS.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,me(this)};pS.prototype.isDestroyed=function(){return!1};pS.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};pS.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=y(this.epoch,Oe.MINIMUM_VALUE),s=q.secondsDifference(o,r),a=t.duration,c,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let u=i?y(this.tolerance,1):.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function tTt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var L7=pS;var o6i=T(S(),1),nTt={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},R7=Object.freeze(nTt);var c6i=T(S(),1);function iTt(e){return e=y(e,y.EMPTY_OBJECT),uS.fromIonAssetId(2426648,{requestVertexNormals:y(e.requestVertexNormals,!1)})}var xM=iTt;var h6i=T(S(),1);function oTt(e){return e=y(e,y.EMPTY_OBJECT),uS.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1),ellipsoid:ne.WGS84})}var bS=oTt;var b6i=T(S(),1);var rTt=1953029805,sTt=2917034100;function Z7(e,t){if(Z7.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new ae("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===rTt||o===sTt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,d=n,u,h=8;for(;s<c;)for(h=(h+8)%24,u=h;s<c&&u<d;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=d&&(h=(h+8)%24,u=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}Z7.passThroughDataForTesting=!1;var _M=Z7;var T6i=T(S(),1);var aTt=new m;function cTt(e,t,n,i){let o=dx(e,t,n,i,aTt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var G7=cTt;var C6i=T(S(),1);function lTt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var gS=lTt;var R6i=T(S(),1);function dTt(e){switch(e){case ie.FLOAT:return"float";case ie.FLOAT_VEC2:return"vec2";case ie.FLOAT_VEC3:return"vec3";case ie.FLOAT_VEC4:return"vec4";case ie.FLOAT_MAT2:return"mat2";case ie.FLOAT_MAT3:return"mat3";case ie.FLOAT_MAT4:return"mat4";case ie.SAMPLER_2D:return"sampler2D";case ie.BOOL:return"bool"}}var E7=dTt;var G6i=T(S(),1);function uTt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var TM=uTt;var P6i=T(S(),1);var mTt=new m(1,1,1);function I7(e){e=y(e,mTt),this._dimensions=m.clone(e)}Object.defineProperties(I7.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){m.clone(e,this._dimensions)}}});var hTt=new m;I7.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,hTt),i=W.randomBetween(-n.x,n.x),o=W.randomBetween(-n.y,n.y),r=W.randomBetween(-n.z,n.z);e.position=m.fromElements(i,o,r,e.position),e.velocity=m.normalize(e.position,e.velocity)};var X7=I7;var F6i=T(S(),1);function hp(){this.featurePropertiesDirty=!1}Object.defineProperties(hp.prototype,{featuresLength:{get:function(){pe.throwInstantiationError()}},pointsLength:{get:function(){pe.throwInstantiationError()}},trianglesLength:{get:function(){pe.throwInstantiationError()}},geometryByteLength:{get:function(){pe.throwInstantiationError()}},texturesByteLength:{get:function(){pe.throwInstantiationError()}},batchTableByteLength:{get:function(){pe.throwInstantiationError()}},innerContents:{get:function(){pe.throwInstantiationError()}},ready:{get:function(){pe.throwInstantiationError()}},tileset:{get:function(){pe.throwInstantiationError()}},tile:{get:function(){pe.throwInstantiationError()}},url:{get:function(){pe.throwInstantiationError()}},batchTable:{get:function(){pe.throwInstantiationError()}},metadata:{get:function(){pe.throwInstantiationError()},set:function(e){pe.throwInstantiationError()}},group:{get:function(){pe.throwInstantiationError()},set:function(e){pe.throwInstantiationError()}}});hp.prototype.hasProperty=function(e,t){pe.throwInstantiationError()};hp.prototype.getFeature=function(e){pe.throwInstantiationError()};hp.prototype.applyDebugSettings=function(e,t){pe.throwInstantiationError()};hp.prototype.applyStyle=function(e){pe.throwInstantiationError()};hp.prototype.update=function(e,t){pe.throwInstantiationError()};hp.prototype.pick=function(e,t,n){pe.throwInstantiationError()};hp.prototype.isDestroyed=function(){pe.throwInstantiationError()};hp.prototype.destroy=function(){pe.throwInstantiationError()};var W7=hp;var J6i=T(S(),1);var U6i=T(S(),1);function ZL(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,pTt(this,t)}Object.defineProperties(ZL.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function fTt(e,t){this.condition=e,this.expression=t}function pTt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new fTt(new Eu(a,t),new Eu(c,t)))}e._runtimeConditions=n}ZL.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};ZL.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};ZL.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],d=c.condition.getShaderExpression(t,n),u=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${d}) { return ${u}; } @@ -15893,7 +15893,7 @@ ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS { ${r} return ${i}(1.0); } -`,r};VL.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var _9=VL;function Oy(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,mTt(this,e)}function mTt(e,t){t=y(Ye(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Eu(o[r],i))}e._meta=n,e._ready=!0}function rr(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Eu(String(t));if(typeof t=="string")return new Eu(t,n);if(l(t.conditions))return new _9(t,n)}else return;return t}function sr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ye(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Oy.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=rr(this,e),this._style.show=sr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=rr(this,e),this._style.color=sr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=rr(this,e),this._style.pointSize=sr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=rr(this,e),this._style.pointOutlineColor=sr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=rr(this,e),this._style.pointOutlineWidth=sr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=rr(this,e),this._style.labelColor=sr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=rr(this,e),this._style.labelOutlineColor=sr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=rr(this,e),this._style.labelOutlineWidth=sr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=rr(this,e),this._style.font=sr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=rr(this,e),this._style.labelStyle=sr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=rr(this,e),this._style.labelText=sr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=rr(this,e),this._style.backgroundColor=sr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=rr(this,e),this._style.backgroundPadding=sr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=rr(this,e),this._style.backgroundEnabled=sr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=rr(this,e),this._style.scaleByDistance=sr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=rr(this,e),this._style.translucencyByDistance=sr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=rr(this,e),this._style.distanceDisplayCondition=sr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=rr(this,e),this._style.heightOffset=sr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=rr(this,e),this._style.anchorLineEnabled=sr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=rr(this,e),this._style.anchorLineColor=sr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=rr(this,e),this._style.image=sr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=rr(this,e),this._style.disableDepthTestDistance=sr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=rr(this,e),this._style.horizontalOrigin=sr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=rr(this,e),this._style.verticalOrigin=sr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=rr(this,e),this._style.labelHorizontalOrigin=sr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=rr(this,e),this._style.labelVerticalOrigin=sr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Oy.fromUrl=function(e){return Ze.createIfNeeded(e).fetchJson(e).then(function(n){return new Oy(n)})};Oy.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Oy.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Oy.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Oy.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var bS=Oy;var Cqi=T(S(),1);var K6i=T(S(),1);function T9(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new $T({comparator:T9.comparator})}T9.prototype.addSubtree=function(e){let t=new hTt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};T9.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};T9.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function hTt(e,t){this.subtree=e,this.stamp=t}var S9=T9;var $6i=T(S(),1);function QB(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(QB.prototype,{metadataTable:{get:function(){return this._metadataTable}}});QB.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=pTt(n);let r=await fTt(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let h=0;h<a;++h){let p=o.json.bufferViews[h],g=p.byteOffset,f=g+p.byteLength,_=r[p.buffer].subarray(g,f);s[h]=_}let c=o.json.voxelTable,d=o.json.propertyTables[c],u=new QB(e);return u._metadataTable=new Xl({count:d.count,properties:d.properties,class:i.classes[d.class],bufferViews:s}),u};function fTt(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(d){return new Uint8Array(d)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function pTt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Po(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var C9=QB;function jB(e){e=y(e,y.EMPTY_OBJECT),this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new S9}jB.fromUrl=async function(e){let t=Ze.createIfNeeded(e),n=await t.fetchJson();gTt(n);let i=STt(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=ii(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,d=new U_({metadataJson:a,schema:c}),u=new jB;CTt(u,d,s);let h=new B_(t,o,c),{shape:p,minBounds:g,maxBounds:f,shapeTransform:x,globalTransform:_}=yTt(o);u.shape=p,u.minBounds=g,u.maxBounds=f,u.dimensions=m.unpack(r.dimensions),u.shapeTransform=x,u.globalTransform=_,u.maximumTileCount=bTt(d);let C,V;return l(r.padding)&&(C=m.unpack(r.padding.before),V=m.unpack(r.padding.after)),u.paddingBefore=C,u.paddingAfter=V,u._implicitTileset=h,Vi.unload(i),u};function bTt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(u_.TILESET_TILE_COUNT)}function gTt(e){let t=e.root;if(!l(t.content))throw new ae("Root must have content");if(!ii(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!ii(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ii(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function yTt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=M.unpack(e.transform):n=M.clone(M.IDENTITY),l(t.box))return _Tt(t.box,n);if(l(t.region))return xTt(t.region);if(ii(t,"3DTILES_bounding_volume_cylinder"))return TTt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function xTt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=M.fromScale(ne.WGS84.radii),c=new m(t,n,r),d=new m(i,o,s);return{shape:Ai.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a,globalTransform:M.clone(M.IDENTITY)}}function _Tt(e,t){let n=Gn.unpack(e),i=M.fromRotationTranslation(n.halfAxes,n.center);return{shape:Ai.BOX,minBounds:m.clone(ap.DefaultMinBounds),maxBounds:m.clone(ap.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function TTt(e,t){let n=Gn.unpack(e),i=M.fromRotationTranslation(n.halfAxes,n.center);return{shape:Ai.CYLINDER,minBounds:m.clone(cp.DefaultMinBounds),maxBounds:m.clone(cp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function STt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Vi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Vi.getSchemaLoader({schema:i})}function CTt(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([h,p])=>{let{type:g,componentType:f}=p,x=r?.properties[h].min,_=r?.properties[h].max,C=ut.getComponentCount(g),V=_Se(x,C),L=_Se(_,C);return{id:h,type:g,componentType:f,minValue:V,maxValue:L}});e.names=a.map(h=>h.id),e.types=a.map(h=>h.type),e.componentTypes=a.map(h=>h.componentType);let c=a.map(h=>h.minValue),d=a.map(h=>h.maxValue),u=c.some(l);e.minimumValues=u?c:void 0,e.maximumValues=u?d:void 0}function _Se(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function VTt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=Rf(o);return await C9.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function LTt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=Rf(a);return o=await d_.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}jB.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new O_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),d=c.isSubtreeRoot()&&c.level>0,u=d?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return LTt(this,u).then(function(p){return(d?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?VTt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var W7=jB;var Gqi=T(S(),1);function P7(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(P7.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});P7.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=m.fromElements(i,o,r,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var V9=P7;var y$i=T(S(),1);var Iqi=T(S(),1),v7={CUMULUS:0};v7.validate=function(e){return e===v7.CUMULUS};var LL=Object.freeze(v7);var Aqi=T(S(),1);function Bh(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new D(this._maximumSize.x,this._maximumSize.y);else{this._scale=D.clone(y(e.scale,new D(20,12)));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=B.clone(y(e.color,B.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var RTt=Bh.SHOW_INDEX=0,ZTt=Bh.POSITION_INDEX=1,GTt=Bh.SCALE_INDEX=2,ETt=Bh.MAXIMUM_SIZE_INDEX=3,ITt=Bh.SLICE_INDEX=4,XTt=Bh.BRIGHTNESS_INDEX=5,WTt=Bh.COLOR_INDEX=6;Bh.NUMBER_OF_PROPERTIES=7;function gS(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Bh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,gS(this,RTt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),gS(this,ZTt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;D.equals(t,e)||(D.clone(e,t),gS(this,GTt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),gS(this,ETt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),gS(this,WTt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,gS(this,ITt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,gS(this,XTt))}}});Bh.prototype._destroy=function(){this._cloudCollection=void 0};var au=Bh;var cu,qB=new m,PTt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},vTt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},wTt=au.SHOW_INDEX,FTt=au.POSITION_INDEX,ATt=au.SCALE_INDEX,MTt=au.MAXIMUM_SIZE_INDEX,NTt=au.SLICE_INDEX,kTt=au.BRIGHTNESS_INDEX,UTt=au.NUMBER_OF_PROPERTIES,DTt=au.COLOR_INDEX;function Oh(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(UTt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=m.clone(y(e.noiseOffset,m.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:TSe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function TSe(e){return function(){return qB.x=e._textureSliceWidth,qB.y=e._noiseTextureRows,qB.z=1/e._noiseTextureRows,qB}}Object.defineProperties(Oh.prototype,{length:{get:function(){return F7(this),this._clouds.length}}});function SSe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Oh.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,LL.CUMULUS),n;return t===LL.CUMULUS&&(n=new au(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Oh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Oh.prototype.removeAll=function(){SSe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function F7(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Oh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Oh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Oh.prototype.get=function(e){return F7(this),this._clouds[e]};var BTt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),OTt=new Uint16Array([0,1,2,0,2,3]);function YTt(e){let t=xt.createVertexBuffer({context:e,typedArray:BTt,usage:Me.STATIC_DRAW}),n=xt.createIndexBuffer({context:e,typedArray:OTt,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT}];return new ei({context:e,attributes:i,indexBuffer:n})}var A7;function HTt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=xt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function zTt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=xt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function KTt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=xt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function JTt(e,t,n){let i=[{index:cu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:cu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:cu.packedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:cu.packedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:cu.color,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:cu.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:KTt(e)});let o=n?t:4*t;return new Gp(e,i,o,n)}var w7=new On;function CSe(e,t,n,i){let o,r=n[cu.positionHighAndScaleX],s=n[cu.positionLowAndScaleY],a=i.position;On.fromCartesian(a,w7);let c=i.scale,d=w7.high,u=w7.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,c.x),s(o,u.x,u.y,u.z,c.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,c.x),r(o+1,d.x,d.y,d.z,c.x),r(o+2,d.x,d.y,d.z,c.x),r(o+3,d.x,d.y,d.z,c.x),s(o+0,u.x,u.y,u.z,c.y),s(o+1,u.x,u.y,u.z,c.y),s(o+2,u.x,u.y,u.z,c.y),s(o+3,u.x,u.y,u.z,c.y))}function VSe(e,t,n,i){let o,r=n[cu.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function LSe(e,t,n,i){let o,r=n[cu.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function RSe(e,t,n,i){let o,r=n[cu.color],s=i.color,a=B.floatToByte(s.red),c=B.floatToByte(s.green),d=B.floatToByte(s.blue),u=B.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,d,u)):(o=i._index*4,r(o+0,a,c,d,u),r(o+1,a,c,d,u),r(o+2,a,c,d,u),r(o+3,a,c,d,u))}function QTt(e,t,n,i){CSe(e,t,n,i),VSe(e,t,n,i),LSe(e,t,n,i),RSe(e,t,n,i)}function jTt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=YTt(a),o._spNoise=en.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new Wt({context:a,width:r*r/s,height:r*s,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:nt.RGBA,sampler:new $t({wrapS:Vn.REPEAT,wrapT:Vn.REPEAT,minificationFilter:qt.NEAREST,magnificationFilter:mi.NEAREST})});let u=new Pc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:TSe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function qTt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=JTt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];QTt(e,t,s,c)}n._vaf.commit(A7(i))}}var $Tt=[];function eSt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=$Tt;d.length=0,(c[FTt]||c[ATt])&&d.push(CSe),(c[wTt]||c[kTt])&&d.push(VSe),(c[MTt]||c[NTt])&&d.push(LSe),c[DTt]&&d.push(RSe);let u=d.length,h=i._vaf.writers,p,g,f;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,h,g);i._vaf.commit(A7(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,h,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function tSt(e,t,n,i){let o=t.context,r=e,s=new De({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new De({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=en.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:cu}),r._rs=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!1,blending:mn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function nSt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let d=0;d<c;d++){let u=s[d];l(u)||(u=s[d]=new qe),u.pass=Ee.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[d].indicesCount,u.vertexArray=a[d].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}Oh.prototype.update=function(e){if(F7(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&jTt(this,e,cE,aE),this._instanced=e.context.instancedArrays,cu=this._instanced?vTt:PTt,A7=this._instanced?zTt:HTt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?qTt(this,e):r>0&&eSt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&tSt(this,e,sE,rE),nSt(this,e))};Oh.prototype.isDestroyed=function(){return!1};Oh.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),SSe(this._clouds),me(this)};var M7=Oh;var C$i=T(S(),1);var iSt=W.toRadians(30);function N7(e){this._angle=y(e,iSt)}Object.defineProperties(N7.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});N7.prototype.emit=function(e){let t=Math.tan(this._angle),n=W.randomBetween(0,W.TWO_PI),i=W.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=m.fromElements(o,r,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var k7=N7;var G$i=T(S(),1);function L9(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } +`,r};ZL.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var SM=ZL;function Oy(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,bTt(this,e)}function bTt(e,t){t=y(Ye(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Eu(o[r],i))}e._meta=n,e._ready=!0}function rr(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Eu(String(t));if(typeof t=="string")return new Eu(t,n);if(l(t.conditions))return new SM(t,n)}else return;return t}function sr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ye(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Oy.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=rr(this,e),this._style.show=sr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=rr(this,e),this._style.color=sr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=rr(this,e),this._style.pointSize=sr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=rr(this,e),this._style.pointOutlineColor=sr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=rr(this,e),this._style.pointOutlineWidth=sr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=rr(this,e),this._style.labelColor=sr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=rr(this,e),this._style.labelOutlineColor=sr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=rr(this,e),this._style.labelOutlineWidth=sr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=rr(this,e),this._style.font=sr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=rr(this,e),this._style.labelStyle=sr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=rr(this,e),this._style.labelText=sr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=rr(this,e),this._style.backgroundColor=sr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=rr(this,e),this._style.backgroundPadding=sr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=rr(this,e),this._style.backgroundEnabled=sr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=rr(this,e),this._style.scaleByDistance=sr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=rr(this,e),this._style.translucencyByDistance=sr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=rr(this,e),this._style.distanceDisplayCondition=sr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=rr(this,e),this._style.heightOffset=sr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=rr(this,e),this._style.anchorLineEnabled=sr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=rr(this,e),this._style.anchorLineColor=sr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=rr(this,e),this._style.image=sr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=rr(this,e),this._style.disableDepthTestDistance=sr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=rr(this,e),this._style.horizontalOrigin=sr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=rr(this,e),this._style.verticalOrigin=sr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=rr(this,e),this._style.labelHorizontalOrigin=sr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=rr(this,e),this._style.labelVerticalOrigin=sr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Oy.fromUrl=function(e){return Ze.createIfNeeded(e).fetchJson(e).then(function(n){return new Oy(n)})};Oy.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Oy.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Oy.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Oy.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var yS=Oy;var Gqi=T(S(),1);var $6i=T(S(),1);function CM(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new tS({comparator:CM.comparator})}CM.prototype.addSubtree=function(e){let t=new gTt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};CM.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};CM.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function gTt(e,t){this.subtree=e,this.stamp=t}var VM=CM;var oqi=T(S(),1);function jB(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(jB.prototype,{metadataTable:{get:function(){return this._metadataTable}}});jB.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=xTt(n);let r=await yTt(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let h=0;h<a;++h){let p=o.json.bufferViews[h],g=p.byteOffset,f=g+p.byteLength,_=r[p.buffer].subarray(g,f);s[h]=_}let c=o.json.voxelTable,d=o.json.propertyTables[c],u=new jB(e);return u._metadataTable=new Wl({count:d.count,properties:d.properties,class:i.classes[d.class],bufferViews:s}),u};function yTt(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(d){return new Uint8Array(d)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function xTt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=vo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var LM=jB;function qB(e){e=y(e,y.EMPTY_OBJECT),this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new VM}qB.fromUrl=async function(e){let t=Ze.createIfNeeded(e),n=await t.fetchJson();TTt(n);let i=RTt(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=ri(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,d=new U_({metadataJson:a,schema:c}),u=new qB;ZTt(u,d,s);let h=new B_(t,o,c),{shape:p,minBounds:g,maxBounds:f,shapeTransform:x,globalTransform:_}=STt(o);u.shape=p,u.minBounds=g,u.maxBounds=f,u.dimensions=m.unpack(r.dimensions),u.shapeTransform=x,u.globalTransform=_,u.maximumTileCount=_Tt(d);let C,V;return l(r.padding)&&(C=m.unpack(r.padding.before),V=m.unpack(r.padding.after)),u.paddingBefore=C,u.paddingAfter=V,u._implicitTileset=h,Li.unload(i),u};function _Tt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(u_.TILESET_TILE_COUNT)}function TTt(e){let t=e.root;if(!l(t.content))throw new ae("Root must have content");if(!ri(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!ri(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ri(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function STt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=M.unpack(e.transform):n=M.clone(M.IDENTITY),l(t.box))return VTt(t.box,n);if(l(t.region))return CTt(t.region);if(ri(t,"3DTILES_bounding_volume_cylinder"))return LTt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function CTt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=M.fromScale(ne.WGS84.radii),c=new m(t,n,r),d=new m(i,o,s);return{shape:Mi.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a,globalTransform:M.clone(M.IDENTITY)}}function VTt(e,t){let n=Gn.unpack(e),i=M.fromRotationTranslation(n.halfAxes,n.center);return{shape:Mi.BOX,minBounds:m.clone(cp.DefaultMinBounds),maxBounds:m.clone(cp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function LTt(e,t){let n=Gn.unpack(e),i=M.fromRotationTranslation(n.halfAxes,n.center);return{shape:Mi.CYLINDER,minBounds:m.clone(lp.DefaultMinBounds),maxBounds:m.clone(lp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function RTt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Li.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Li.getSchemaLoader({schema:i})}function ZTt(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([h,p])=>{let{type:g,componentType:f}=p,x=r?.properties[h].min,_=r?.properties[h].max,C=dt.getComponentCount(g),V=SSe(x,C),L=SSe(_,C);return{id:h,type:g,componentType:f,minValue:V,maxValue:L}});e.names=a.map(h=>h.id),e.types=a.map(h=>h.type),e.componentTypes=a.map(h=>h.componentType);let c=a.map(h=>h.minValue),d=a.map(h=>h.maxValue),u=c.some(l);e.minimumValues=u?c:void 0,e.maximumValues=u?d:void 0}function SSe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function GTt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=Rf(o);return await LM.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function ETt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=Rf(a);return o=await d_.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}qB.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new O_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),d=c.isSubtreeRoot()&&c.level>0,u=d?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return ETt(this,u).then(function(p){return(d?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?GTt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var P7=qB;var Pqi=T(S(),1);function v7(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(v7.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});v7.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=m.fromElements(i,o,r,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var RM=v7;var C$i=T(S(),1);var wqi=T(S(),1),w7={CUMULUS:0};w7.validate=function(e){return e===w7.CUMULUS};var GL=Object.freeze(w7);var Dqi=T(S(),1);function Bh(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=m.clone(y(e.position,m.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new D(this._maximumSize.x,this._maximumSize.y);else{this._scale=D.clone(y(e.scale,new D(20,12)));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=B.clone(y(e.color,B.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var ITt=Bh.SHOW_INDEX=0,XTt=Bh.POSITION_INDEX=1,WTt=Bh.SCALE_INDEX=2,PTt=Bh.MAXIMUM_SIZE_INDEX=3,vTt=Bh.SLICE_INDEX=4,wTt=Bh.BRIGHTNESS_INDEX=5,FTt=Bh.COLOR_INDEX=6;Bh.NUMBER_OF_PROPERTIES=7;function xS(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Bh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,xS(this,ITt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;m.equals(t,e)||(m.clone(e,t),xS(this,XTt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;D.equals(t,e)||(D.clone(e,t),xS(this,WTt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),xS(this,PTt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),xS(this,FTt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,xS(this,vTt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,xS(this,wTt))}}});Bh.prototype._destroy=function(){this._cloudCollection=void 0};var au=Bh;var cu,$B=new m,ATt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},MTt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},NTt=au.SHOW_INDEX,kTt=au.POSITION_INDEX,UTt=au.SCALE_INDEX,DTt=au.MAXIMUM_SIZE_INDEX,BTt=au.SLICE_INDEX,OTt=au.BRIGHTNESS_INDEX,YTt=au.NUMBER_OF_PROPERTIES,HTt=au.COLOR_INDEX;function Oh(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(YTt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=m.clone(y(e.noiseOffset,m.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:CSe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function CSe(e){return function(){return $B.x=e._textureSliceWidth,$B.y=e._noiseTextureRows,$B.z=1/e._noiseTextureRows,$B}}Object.defineProperties(Oh.prototype,{length:{get:function(){return A7(this),this._clouds.length}}});function VSe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Oh.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,GL.CUMULUS),n;return t===GL.CUMULUS&&(n=new au(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Oh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Oh.prototype.removeAll=function(){VSe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function A7(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Oh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Oh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Oh.prototype.get=function(e){return A7(this),this._clouds[e]};var zTt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),KTt=new Uint16Array([0,1,2,0,2,3]);function JTt(e){let t=yt.createVertexBuffer({context:e,typedArray:zTt,usage:Me.STATIC_DRAW}),n=yt.createIndexBuffer({context:e,typedArray:KTt,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT}];return new ni({context:e,attributes:i,indexBuffer:n})}var M7;function QTt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=yt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function jTt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=yt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function qTt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=yt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function $Tt(e,t,n){let i=[{index:cu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:cu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:cu.packedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:cu.packedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:cu.color,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:cu.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:qTt(e)});let o=n?t:4*t;return new Ep(e,i,o,n)}var F7=new On;function LSe(e,t,n,i){let o,r=n[cu.positionHighAndScaleX],s=n[cu.positionLowAndScaleY],a=i.position;On.fromCartesian(a,F7);let c=i.scale,d=F7.high,u=F7.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,c.x),s(o,u.x,u.y,u.z,c.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,c.x),r(o+1,d.x,d.y,d.z,c.x),r(o+2,d.x,d.y,d.z,c.x),r(o+3,d.x,d.y,d.z,c.x),s(o+0,u.x,u.y,u.z,c.y),s(o+1,u.x,u.y,u.z,c.y),s(o+2,u.x,u.y,u.z,c.y),s(o+3,u.x,u.y,u.z,c.y))}function RSe(e,t,n,i){let o,r=n[cu.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function ZSe(e,t,n,i){let o,r=n[cu.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function GSe(e,t,n,i){let o,r=n[cu.color],s=i.color,a=B.floatToByte(s.red),c=B.floatToByte(s.green),d=B.floatToByte(s.blue),u=B.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,d,u)):(o=i._index*4,r(o+0,a,c,d,u),r(o+1,a,c,d,u),r(o+2,a,c,d,u),r(o+3,a,c,d,u))}function eSt(e,t,n,i){LSe(e,t,n,i),RSe(e,t,n,i),ZSe(e,t,n,i),GSe(e,t,n,i)}function tSt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=JTt(a),o._spNoise=$t.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new Xt({context:a,width:r*r/s,height:r*s,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:nt.RGBA,sampler:new qt({wrapS:Vn.REPEAT,wrapT:Vn.REPEAT,minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST})});let u=new vc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:CSe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function nSt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=$Tt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];eSt(e,t,s,c)}n._vaf.commit(M7(i))}}var iSt=[];function oSt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=iSt;d.length=0,(c[kTt]||c[UTt])&&d.push(LSe),(c[NTt]||c[OTt])&&d.push(RSe),(c[DTt]||c[BTt])&&d.push(ZSe),c[HTt]&&d.push(GSe);let u=d.length,h=i._vaf.writers,p,g,f;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,h,g);i._vaf.commit(M7(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,h,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function rSt(e,t,n,i){let o=t.context,r=e,s=new De({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new De({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=$t.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:cu}),r._rs=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function sSt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let d=0;d<c;d++){let u=s[d];l(u)||(u=s[d]=new qe),u.pass=Ee.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[d].indicesCount,u.vertexArray=a[d].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}Oh.prototype.update=function(e){if(A7(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&tSt(this,e,uM,dM),this._instanced=e.context.instancedArrays,cu=this._instanced?MTt:ATt,M7=this._instanced?jTt:QTt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?nSt(this,e):r>0&&oSt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&rSt(this,e,lM,cM),sSt(this,e))};Oh.prototype.isDestroyed=function(){return!1};Oh.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),VSe(this._clouds),me(this)};var N7=Oh;var G$i=T(S(),1);var aSt=W.toRadians(30);function k7(e){this._angle=y(e,aSt)}Object.defineProperties(k7.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});k7.prototype.emit=function(e){let t=Math.tan(this._angle),n=W.randomBetween(0,W.TWO_PI),i=W.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=m.fromElements(o,r,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var U7=k7;var P$i=T(S(),1);function ZM(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } `;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); } `;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); } `;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); } @@ -15914,7 +15914,7 @@ ${r} void main() { out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=no.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(L9.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});L9.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;L9.prototype.isTranslucent=no.prototype.isTranslucent;L9.prototype.getRenderState=no.prototype.getRenderState;var U7=L9;var U$i=T(S(),1);function $B(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=new M,this.id=e.id,this._id=void 0,this._primitive=void 0}$B.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!M.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=M.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Gt({geometry:new Qb({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:jr.VERTEX_FORMAT,colors:[B.RED,B.RED],arcType:tn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Gt({geometry:new Qb({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:jr.VERTEX_FORMAT,colors:[B.GREEN,B.GREEN],arcType:tn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Gt({geometry:new Qb({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:jr.VERTEX_FORMAT,colors:[B.BLUE,B.BLUE],arcType:tn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new jr,asynchronous:!1})}this._primitive.update(e)}};$B.prototype.isDestroyed=function(){return!1};$B.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var R9=$B;var H$i=T(S(),1);function oSt(e){this.direction=m.clone(e.direction),this.color=B.clone(y(e.color,B.WHITE)),this.intensity=y(e.intensity,1)}var D7=oSt;var reo=T(S(),1);var K$i=T(S(),1),Z9=`in vec3 v_positionMC; +}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=no.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(ZM.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});ZM.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;ZM.prototype.isTranslucent=no.prototype.isTranslucent;ZM.prototype.getRenderState=no.prototype.getRenderState;var D7=ZM;var H$i=T(S(),1);function eO(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=new M,this.id=e.id,this._id=void 0,this._primitive=void 0}eO.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!M.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=M.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Zt({geometry:new jb({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:jr.VERTEX_FORMAT,colors:[B.RED,B.RED],arcType:en.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Zt({geometry:new jb({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:jr.VERTEX_FORMAT,colors:[B.GREEN,B.GREEN],arcType:en.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Zt({geometry:new jb({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:jr.VERTEX_FORMAT,colors:[B.BLUE,B.BLUE],arcType:en.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new jr,asynchronous:!1})}this._primitive.update(e)}};eO.prototype.isDestroyed=function(){return!1};eO.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var GM=eO;var j$i=T(S(),1);function cSt(e){this.direction=m.clone(e.direction),this.color=B.clone(y(e.color,B.WHITE)),this.intensity=y(e.intensity,1)}var B7=cSt;var deo=T(S(),1);var $$i=T(S(),1),EM=`in vec3 v_positionMC; in vec3 v_positionEC; in vec2 v_st; @@ -15947,7 +15947,7 @@ void main() out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var Q$i=T(S(),1),G9=`in vec3 position3DHigh; +`;var teo=T(S(),1),IM=`in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; @@ -15966,7 +15966,7 @@ void main() gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function yS(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Hi.fromType(Hi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,G9),this._fragmentShaderSource=y(e.fragmentShaderSource,Z9),this._renderState=no.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(yS.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return yS.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});yS.VERTEX_FORMAT=Xe.POSITION_AND_ST;yS.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;yS.prototype.isTranslucent=no.prototype.isTranslucent;yS.prototype.getRenderState=no.prototype.getRenderState;var B7=yS;var heo=T(S(),1);function td(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,td.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,td.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,td.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,td.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,td.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new be,this._nominalFrameRate=new be,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){rSt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){sSt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}td.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};td.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new td({scene:e})),e._frameRateMonitor};Object.defineProperties(td.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});td.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};td.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};td.prototype.isDestroyed=function(){return!1};td.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),me(this)};function rSt(e,t){if(e._pauseCount>0)return;let n=_i();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/zn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/zn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/zn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function sSt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var E9=td;var Zeo=T(S(),1);var ZSe=T(e7(),1);function O7(){this._image=new Image}O7.prototype.isReady=function(){return!0};O7.prototype.shouldDiscardImage=function(e){return e===this._image};function xS(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new zi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new O7),this._errorEvent=new be}Object.defineProperties(xS.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});xS.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new xS(t);return n._metadata=e,n};xS.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};xS.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=C0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new Ko({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,d);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=aSt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){y9(r.key,d);let u=new Uint8Array(d),h,p=r.protoImagery;if((!l(p)||!p)&&(h=cSt(u)),!l(h)&&(!l(p)||p)){let g=lSt(u);h=g.imageType,u=g.imageData}return!l(h)||!l(u)?o:i_({uint8Array:u,format:h,flipY:!0})})};xS.prototype.pickFeatures=function(e,t,n,i,o){};function aSt(e,t,n,i,o,r){let s=C0.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function cSt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function lSt(e){let t=ZSe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ae("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var Y7=xS;var veo=T(S(),1);var dSt=new B(1,1,1,.4),uSt=new B(0,1,0,.05),mSt=new B(0,.5,0,.2);function _S(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new zi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,dSt),this._glowColor=y(e.glowColor,uSt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,mSt),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(_S.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});_S.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};_S.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};_S.prototype.getTileCredits=function(e,t,n){};_S.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};_S.prototype.pickFeatures=function(e,t,n,i,o){};var H7=_S;var bno=T(S(),1);var Uto=T(S(),1);var Cto=T(S(),1);var Oeo=T(S(),1);function Yh(){}Yh._maxDecodingConcurrency=Math.max(Ot.hardwareConcurrency-1,1);Yh._decodeTaskProcessor=new bi("decodeI3S",Yh._maxDecodingConcurrency);Yh._promise=void 0;async function hSt(){if(await Yh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Yh._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}Yh.decode=async function(e,t,n,i,o){return l(Yh._promise)||(Yh._promise=hSt()),Yh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,d=0,u=0;l(s.obb)?(c=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let h=$.fromRotationX(-W.PI_OVER_TWO),p=new $;$.multiply(h,a,p);let g=he.fromDegrees(c,d,u),f=ne.WGS84.cartographicToCartesian(g),x={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ne.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:f,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(x)})};var I9=Yh;var Keo=T(S(),1);function z7(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(z7.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});z7.prototype.load=async function(){return this._data=await Hh.loadJson(this._resource),this._data};var X9=z7;var qeo=T(S(),1);function L0(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(L0.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function e3(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function fSt(e){return e==="String"?1:e3(e)}async function pSt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}L0.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=pSt(this).catch(function(e){console.error(e)}),this._loadPromise)};L0.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};L0.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};L0.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(c+=u.value),t=u.offset}this._values[o].push(c)}}}};L0.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=e3(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=e3(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};L0.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=fSt(i.valueType)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};L0.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new ae(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=e3(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new ae(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new ae(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var W9=L0;var rto=T(S(),1);function P9(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(P9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});P9.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var bSt=new m,gSt=new m,ySt=new m,xSt=new m,_St=new m;function K7(e,t,n,i){let o=m.subtract(i,n,bSt),r=m.cross(o,m.subtract(e,n,gSt),xSt),s=m.cross(o,m.subtract(t,n,ySt),_St);return m.dot(r,s)>=0}var TSt=new m,SSt=new m,CSt=new m,VSt=new m,LSt=new m,RSt=new m,ZSt=new m,GSt=new m,ESt=new m,ISt=new m;P9.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,d=this._customAttributes.positions,u=this._customAttributes.indices,h;l(u)?h=u.length:h=d.length/3;for(let p=0;p<h;p++){let g,f,x;l(u)?(g=u[p],f=u[p+1],x=u[p+2]):(g=p*3,f=p*3+1,x=p*3+2);let _=m.fromElements(d[g*3],d[g*3+1],d[g*3+2],TSt),C=m.fromElements(d[f*3],d[f*3+1],d[f*3+2],SSt),V=new m(d[x*3],d[x*3+1],d[x*3+2],CSt);if(!K7(i,_,C,V)||!K7(i,C,_,V)||!K7(i,V,_,C))continue;let L=m.subtract(C,_,VSt),Z=m.subtract(V,_,LSt),G=m.cross(L,Z,RSt);if(m.magnitude(G)===0)continue;let I=m.normalize(G,ZSt),v=m.subtract(i,_,GSt),P=Math.abs(m.dot(v,I));if(P<o){o=P,r=p;let w=m.magnitudeSquared(m.subtract(i,_,v)),F=m.magnitudeSquared(m.subtract(i,C,ESt)),b=m.magnitudeSquared(m.subtract(i,V,ISt));w<F&&w<b?(a=g,c=_,s=w):F<b?(a=f,c=C,s=F):(a=x,c=V,s=b)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function GSe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(pS(e[i])):t.push(e[i]);return t}P9.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,h="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let L=this._parent._data.mesh.material.definition;if(L>=0&&L<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[L],c=u,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){d=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let Z="0";if(l(this._layer._data.textureSetDefinitions))for(let G=0;G<this._layer._data.textureSetDefinitions.length;G++){let I=this._layer._data.textureSetDefinitions[G];for(let v=0;v<I.formats.length;v++){let P=I.formats[v];if(P.format==="jpg"){Z=P.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(h=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${Z}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=GSe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=GSe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(d=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],f=[];d&&(p=[{sampler:0,source:0}],g=[{uri:h}],f=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let x=[],_=n.length;for(let V=0;V<_;V++){let L=n[V].primitives,Z=L.length;for(let G=0;G<Z;G++){let I=L[G];if(l(I.material)){for(;I.material>=x.length;){let P=Ye(c,!0);x.push(P)}let v=x[I.material];l(I.extra)&&I.extra.isTransparent?l(v.alphaMode)||(v.alphaMode="BLEND"):v.alphaMode==="BLEND"&&(v.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:x,textures:p,images:g,samplers:f,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var RL=P9;function Ec(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(Ec.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Ec.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Ku(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Hh.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function ESe(e,t){let n=new W9(e,t);return e._fields[t.name]=n,n.load()}Ec.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(ESe(this,i))}return Promise.all(t)};Ec.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return ESe(this,o)}return Promise.resolve()};Ec.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Ec.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Ec.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Ec(e,y(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Ec.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new RL(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new RL(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Ec.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new X9(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Ec.prototype._clearGeometryData=function(){this._geometryData=[]};Ec.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let V=this._dataProvider._geoidDataList[C],L=V.projection.project(n);if(L.x>V.nativeExtent.west&&L.x<V.nativeExtent.east&&L.y>V.nativeExtent.south&&L.y<V.nativeExtent.north){n.height+=vSt(L.x,L.y,V);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ne.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ne.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=r/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Va(0,0,0),d=wt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new ve(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=$.fromQuaternion(d),h=$.inverse(u,new $),p=new M(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),g=M.inverse(p,new M),f=M.clone(p);l(this._parent._globalTransform)&&M.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=h;let x=[];for(let C=0;C<this._children.length;C++)x.push(this._children[C]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[f[0],f[4],f[8],f[12],f[1],f[5],f[9],f[13],f[2],f[6],f[10],f[14],f[3],f[7],f[11],f[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Ec.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Ec.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await I9.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function XSt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function WSt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function ISe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await XSt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!WSt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Ec.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=ISe(this,t);e.push(n)}return Promise.all(e)};Ku.prototype._hookedRequestContent=Ku.prototype.requestContent;Ku.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new Ze({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{ISe(e._i3sNode,n)})),e._isLoading=!1,t})}};function PSt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function t3(e,t,n,i){let o=e+t*n;return i[o]}function vSt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,d=a<n.height?a+1:a;a=n.height-1-a,d=n.height-1-d;let u=t3(s,a,n.width,n.buffer),h=t3(c,a,n.width,n.buffer),p=t3(s,d,n.width,n.buffer),g=t3(c,d,n.width,n.buffer),f=PSt(o,r,u,h,p,g);return f=f*n.scale+n.offset,f}Object.defineProperties(Ku.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var ZL=Ec;var Eto=T(S(),1);function n3(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(n3.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function J7(e,t){let n=[];for(let i=0;i<e.length;i++){let o=B.byteToFloat(e[i]);i<3?n.push(pS(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function GL(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=J7(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=J7(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=J7(a.color,a.transparency)))}break}}return n}function wSt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=GL(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let d=a[c],u=n;for(let h=0;h<d.length;h++){let p=d[h];h===d.length-1?u[p]=s:(l(u[p])||(u[p]={}),u=u[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=GL(o.symbol,t)}return n}}function FSt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=y(o.classMaxValue,o.classMinValue),a=y(r.classMaxValue,r.classMinValue);return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(GL(r.symbol,t)))}return i.symbols.push(void 0),i}}n3.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=GL(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=GL(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=wSt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=GL(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=FSt(i,n))}};function XSe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?XSe(s,t,n,i):s}}function ASt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function MSt(e,t,n){let i=t[n],o=ASt(e.ranges,i);return e.symbols[o]}n3.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>XSe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>MSt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var v9=n3;function nd(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Ze({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(nd.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});nd.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ae(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new v9(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};nd.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let d=0;d<c.length;d++)s.push(c[d])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};nd.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};nd.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new ZL(this,t,!0)}else this._rootNode=new ZL(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};nd.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};nd._fetchJson=function(e){return e.fetchJson()};nd.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=nd._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};nd.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};nd.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Ye(e):{},e.outlineColor=B.fromCartesian4(se.fromArray(o))),this._tileset=await bs.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};nd.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};nd.prototype.filterByAttributes=function(e){this._filters=l(e)?Ye(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var TS=nd;var Hto=T(S(),1);function i3(e,t){this._dataProvider=e,this._resource=new Ze({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(i3.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});i3.prototype.load=async function(){return this._data=await Hh.loadJson(this._resource),this._data};i3.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var w9=i3;var $to=T(S(),1);function F9(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=y(n.visibility,!0),this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(F9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});F9._fromData=async function(e,t,n,i){let o=new F9(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let d=F9._fromData(e,t,r[c],o);s.push(d)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let d=a[c];o._sublayers.push(d),o._i3sLayers.push(...d._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Ze({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Hh.loadJson(o._resource),c=new TS(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var A9=F9;var vSe=T(WSe(),1);function xs(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=y(e.showFeatures,!1),this._adjustMaterialAlphaMode=y(e.adjustMaterialAlphaMode,!1),this._applySymbology=y(e.applySymbology,!1),this._calculateNormals=y(e.calculateNormals,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(xs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});xs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return me(this)};xs.prototype.isDestroyed=function(){return!1};xs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};xs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};xs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};xs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function NSt(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function PSe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=NSt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=A9._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new w9(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=ce.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new TS(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}xs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ze.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await xs.loadJson(n),o=new xs(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=PSe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await PSe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};xs._fetchJson=function(e){return e.fetchJson()};xs.loadJson=async function(e){let t=await xs._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new ae(t.error)}return t};xs.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new ae(`Failed to load binary: ${e.url}`);return t};xs.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var kSt=new D;function USt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let h=c.x;h<=d.x;h++)for(let p=c.y;p<=d.y;p++){let g=D.fromElements(h,p,kSt),f=g.toString();if(!o.hasOwnProperty(f)){let x={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=x,i.push(x)}}let u=[];for(let h=0;h<i.length;++h){let p=i[h],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(g)}return Promise.all(u).then(function(h){let p=[];for(let g=0;g<h.length;g++){let f={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},x=h[g],_="Geographic";n._projection instanceof Ei&&(_="WebMercator");let C={projectionType:_,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===cm.LERC){let V=vSe.default.decode(x._buffer);C.buffer=V.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function DSt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await USt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}xs.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=DSt(this),this._geoidDataPromise)};xs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};xs.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};xs.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};xs.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Hh=xs;var Cno=T(S(),1);var Q7={};Q7.createTilesetFromIModelId=async function(e,t){let{exports:n}=await su.getExports(e);if(n.length>0&&n.every(a=>a.status===su.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===su.ExportStatus.Complete);if(!l(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new Ze({url:r});return bs.fromUrl(s,t)};Q7.createTilesetForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await su.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![su.RealityDataType.Cesium3DTiles,su.RealityDataType.PNTS,su.RealityDataType.RealityMesh3DTiles,su.RealityDataType.Terrain3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let r=await su.getRealityDataURL(e,t,i);return bs.fromUrl(r,{maximumScreenSpaceError:4})};var j7=Q7;var Rno=T(S(),1);function wSe(){}Object.defineProperties(wSe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var q7=wSe;var Pno=T(S(),1);var BSt=/\/$/,FSe=new Ct('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function EL(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ze.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();BSt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Ct(c))):c=FSe,this._resource=i,this._imageryProvider=new ka({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(EL.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});EL.prototype.getTileCredits=function(e,t,n){};EL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};EL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};EL._defaultCredit=FSe;var $7=EL;var wno=T(S(),1);function e6(e){}e6.prototype.isReady=function(){return!0};e6.prototype.shouldDiscardImage=function(e){return!1};var t6=e6;var Ono=T(S(),1);var OSt=new Ct("MapQuest, Open Street Map and contributors, CC-BY-SA");function r3(e){e=y(e,y.EMPTY_OBJECT);let t=Ze.createIfNeeded(y(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${y(e.fileExtension,"png")}`;let n=new os({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ce.southwest(a),r),d=n.positionToTileXY(ce.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),h=y(e.credit,OSt);typeof h=="string"&&(h=new Ct(h)),ka.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(r3.prototype=Object.create(ka.prototype),r3.prototype.constructor=r3);var R0=r3;var jno=T(S(),1);var YSt=new D(1,1);function n6(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=m.clone(y(e.position,m.ZERO)),this.velocity=m.clone(y(e.velocity,m.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=B.clone(y(e.startColor,B.WHITE)),this.endColor=B.clone(y(e.endColor,B.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=D.clone(y(e.imageSize,YSt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(n6.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var ASe=new m;n6.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,ASe),m.add(this.position,ASe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var IL=n6;var eio=T(S(),1);function MSe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(MSe.prototype,{complete:{get:function(){return this._complete}}});var i6=MSe;var iio=T(S(),1);function NSe(e){}NSe.prototype.emit=function(e){pe.throwInstantiationError()};var o6=NSe;var yio=T(S(),1);var kSe=new D(1,1);function M9(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new V9(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._emitterModelMatrix=M.clone(y(e.emitterModelMatrix,M.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new M,this._startColor=B.clone(y(e.color,y(e.startColor,B.WHITE))),this._endColor=B.clone(y(e.color,y(e.endColor,B.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=D.clone(y(e.imageSize,y(e.minimumImageSize,kSe))),this._maximumImageSize=D.clone(y(e.imageSize,y(e.maximumImageSize,kSe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new be,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(M9.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){B.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){B.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function HSt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,d=e._particlePool,u=Math.max(a-c.length-d.length,0);for(let h=0;h<u;++h){let p=new IL;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function zSt(e){let t=e._particlePool.pop();return l(t)||(t=new IL),t}function KSt(e,t){e._particlePool.push(t)}function JSt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let d=n[c];i.remove(d._billboard)}n.length=a}function QSt(e){l(e._billboard)&&(e._billboard.show=!1)}function USe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=W.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=W.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=W.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=W.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new B(i,o,r,s),n.scale=W.lerp(t.startScale,t.endScale,t.normalizedAge)}function jSt(e,t){t.startColor=B.clone(e._startColor,t.startColor),t.endColor=B.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=W.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=W.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=W.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=W.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=W.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function qSt(e,t){if(e._isComplete)return 0;t=W.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=W.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var s3=new m;M9.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Rd),this._updateParticlePool&&(HSt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=q.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?USe(this,s):(QSt(s),KSt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=qSt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=zSt(this),this._emitter.emit(s),m.add(s.position,s.velocity,s3),M.multiplyByPoint(d,s3,s3),s.position=M.multiplyByPoint(d,s.position,s.position),m.subtract(s3,s.position,s.velocity),m.normalize(s.velocity,s.velocity),jSt(this,s),USe(this,s)}if(this._billboardCollection.update(e),this._previousTime=q.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=W.mod(this._currentTime,this._lifetime),this.bursts){let d=this.bursts.length;for(r=0;r<d;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&JSt(this)};M9.prototype.isDestroyed=function(){return!1};M9.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),me(this)};var r6=M9;var Tio=T(S(),1);function lu(){pe.throwInstantiationError()}lu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(lu.prototype,{quadtree:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError}});lu.prototype.update=pe.throwInstantiationError;lu.prototype.beginUpdate=pe.throwInstantiationError;lu.prototype.endUpdate=pe.throwInstantiationError;lu.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;lu.prototype.loadTile=pe.throwInstantiationError;lu.prototype.computeTileVisibility=pe.throwInstantiationError;lu.prototype.showTileThisFrame=pe.throwInstantiationError;lu.prototype.computeDistanceToTile=pe.throwInstantiationError;lu.prototype.isDestroyed=pe.throwInstantiationError;lu.prototype.destroy=pe.throwInstantiationError;var s6=lu;var Rio=T(S(),1);function a6(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(a6.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});a6.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,W.PI),i=W.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(o,r,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var c6=a6;var Eio=T(S(),1);function N9(){}N9.prototype.evaluate=function(e,t){pe.throwInstantiationError()};N9.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};N9.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};N9.prototype.getVariables=function(){pe.throwInstantiationError()};var l6=N9;var vio=T(S(),1);function XL(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,eCt(this,e)}Object.defineProperties(XL.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});XL.fromWorldTerrain=function(e){return new XL(fS(e))};XL.fromWorldBathymetry=function(e){return new XL(g9(e))};function $St(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function eCt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){$St(e._errorEvent,i)}}var k9=XL;var Aio=T(S(),1);function WL(){}WL.prototype.boundingVolume=void 0;WL.prototype.boundingSphere=void 0;WL.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};WL.prototype.intersectPlane=function(e){pe.throwInstantiationError()};WL.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var d6=WL;var Oio=T(S(),1);function U9(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new zi({ellipsoid:e.ellipsoid}),this._color=y(e.color,B.YELLOW),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(U9.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});U9.prototype.getTileCredits=function(e,t,n){};U9.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};U9.prototype.pickFeatures=function(e,t,n,i,o){};var D9=U9;var zio=T(S(),1);function u6(e){pe.throwInstantiationError()}u6.prototype.isReady=pe.throwInstantiationError;u6.prototype.shouldDiscardImage=pe.throwInstantiationError;var m6=u6;var Jio=T(S(),1),tCt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},h6=Object.freeze(tCt);var aoo=T(S(),1);function a3(e,t){this.show=!0,l(e)||(e=new ze),this.rectangle=ze.clone(e),l(t)||(t=Hi.fromType(Hi.ColorType,{color:new B(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}a3.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!ze.equals(t.viewport,this.rectangle))&&(this._rs=Ue.fromCache({blending:mn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new De({sources:[this._material.shaderSource,kE]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ee.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};a3.prototype.isDestroyed=function(){return!1};a3.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),me(this)};var f6=a3;var doo=T(S(),1);function p6(){pe.throwInstantiationError()}Object.defineProperties(p6.prototype,{globalTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shape:{get:pe.throwInstantiationError},minBounds:{get:pe.throwInstantiationError},maxBounds:{get:pe.throwInstantiationError},dimensions:{get:pe.throwInstantiationError},paddingBefore:{get:pe.throwInstantiationError},paddingAfter:{get:pe.throwInstantiationError},names:{get:pe.throwInstantiationError},types:{get:pe.throwInstantiationError},componentTypes:{get:pe.throwInstantiationError},minimumValues:{get:pe.throwInstantiationError},maximumValues:{get:pe.throwInstantiationError},maximumTileCount:{get:pe.throwInstantiationError},keyframeCount:{get:pe.throwInstantiationError},timeIntervalCollection:{get:pe.throwInstantiationError}});p6.prototype.requestData=pe.throwInstantiationError;var b6=p6;var hoo=T(S(),1);function SS(){pe.throwInstantiationError()}Object.defineProperties(SS.prototype,{orientedBoundingBox:{get:pe.throwInstantiationError},boundingSphere:{get:pe.throwInstantiationError},boundTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shaderUniforms:{get:pe.throwInstantiationError},shaderDefines:{get:pe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:pe.throwInstantiationError}});SS.prototype.update=pe.throwInstantiationError;SS.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;SS.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;SS.DefaultMinBounds=pe.throwInstantiationError;SS.DefaultMaxBounds=pe.throwInstantiationError;var g6=SS;var Eoo=T(S(),1);var nCt=new B,iCt=new B,oCt=new B,rCt=new B,DSe=new se,B9=new Uint8Array(4);function BSe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return B.lerp(t.color,n.color,o,i)}function c3(e,t){return{height:e,color:B.clone(t)}}function OSe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?B.equals(t.color,i[n-1].color):!1,a=r?B.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?B.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function sCt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],f=W.clamp(g.height,id._minimumHeight,id._maximumHeight),x=B.clone(g.color,nCt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(c3(f,x))}let d=!0,u=!0;for(n=0;n<a-1;n++){let g=c[n+0],f=c[n+1];d=d&&g.height<=f.height,u=u&&g.height>=f.height}u?c=c.reverse():d||d0(c,function(g,f){return W.sign(g.height-f.height)});let h=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!h&&!p&&(h=!0,p=!0),h&&c.splice(0,0,c3(id._minimumHeight,c[0].color)),p&&c.splice(c.length,0,c3(id._maximumHeight,c[c.length-1].color)),c=OSe(c),i.push(c)}return i}function aCt(e){let t=sCt(e),n=[],i=[],o;function r(d,u){n.push(c3(d,u))}function s(d,u,h){let p=B.multiplyByScalar(h,1-u.alpha,rCt);p=B.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,h=0;i=n,n=[];let p=d.length,g=i.length;for(;u<p||h<g;){let f=u<p?d[u]:void 0,x=u>0?d[u-1]:void 0,_=u<p-1?d[u+1]:void 0,C=h<g?i[h]:void 0,V=h>0?i[h-1]:void 0,L=h<g-1?i[h+1]:void 0;if(l(f)&&l(C)&&f.height===C.height){let Z=l(L)&&C.height===L.height,G=!l(V),I=!l(L),v=l(_)&&f.height===_.height,P=!l(x),w=!l(_);Z?v?(s(f.height,f.color,C.color),s(f.height,_.color,L.color)):P?(r(f.height,C.color),s(f.height,f.color,L.color)):w?(s(f.height,f.color,C.color),r(f.height,L.color)):(s(f.height,f.color,C.color),s(f.height,f.color,L.color)):G?v?(r(f.height,f.color),s(f.height,_.color,C.color)):w?(r(f.height,f.color),r(f.height,C.color)):(P||r(f.height,f.color),s(f.height,f.color,C.color)):I?v?(s(f.height,f.color,C.color),r(f.height,_.color)):P?(r(f.height,C.color),r(f.height,f.color)):w?s(f.height,f.color,C.color):(s(f.height,f.color,C.color),r(f.height,f.color)):v?(s(f.height,f.color,C.color),s(f.height,_.color,C.color)):P?(r(f.height,C.color),s(f.height,f.color,C.color)):w?(s(f.height,f.color,C.color),r(f.height,C.color)):s(f.height,f.color,C.color),u+=v?2:1,h+=Z?2:1}else if(l(f)&&l(C)&&l(V)&&f.height<C.height){let Z=BSe(f.height,V,C,oCt);l(x)?l(_)?s(f.height,f.color,Z):(s(f.height,f.color,Z),r(f.height,Z)):(r(f.height,Z),s(f.height,f.color,Z)),u++}else if(l(C)&&l(f)&&l(x)&&C.height<f.height){let Z=BSe(C.height,x,f,iCt);l(V)?l(L)?s(C.height,Z,C.color):(s(C.height,Z,C.color),r(C.height,Z)):(r(C.height,Z),s(C.height,Z,C.color)),h++}else l(f)&&(!l(C)||f.height<C.height)?(l(C)&&!l(V)&&!l(_)?(r(f.height,f.color),r(f.height,id._emptyColor),r(C.height,id._emptyColor)):(!l(C)&&l(V)&&!l(x)&&(r(V.height,id._emptyColor),r(f.height,id._emptyColor)),r(f.height,f.color)),u++):l(C)&&(!l(f)||C.height<f.height)&&(r(C.height,C.color),h++)}}return OSe(n)}function id(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=aCt(n),r=o.length,s,a,c;if(!id._useFloatTexture(i)){a=je.UNSIGNED_BYTE,c=nt.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,DSe),se.pack(DSe,s,g*4)}else{a=je.FLOAT,c=i.webgl2?nt.RED:nt.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let u=Wt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new $t({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:qt.NEAREST,magnificationFilter:mi.NEAREST})}),h=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(B9),h[g*4+0]=B9[0],h[g*4+1]=B9[1],h[g*4+2]=B9[2],h[g*4+3]=B9[3];let p=Wt.create({context:i,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new $t({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR,magnificationFilter:mi.LINEAR})});return Hi.fromType("ElevationBand",{heights:u,colors:p})}id._useFloatTexture=function(e){return e.floatingPointTexture};id._maximumHeight=5906376425472;id._minimumHeight=-5906376425472;id._emptyColor=new B(0,0,0,0);var y6=id;var Noo=T(S(),1);async function cCt(e,t){t=y(t,{}),t.cacheBytes=y(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=y(t.maximumCacheOverflowBytes,1024*1024*1024),t.enableCollision=y(t.enableCollision,!0),e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(us("createGooglePhotorealistic3DTileset(key)","createGooglePhotorealistic3DTileset(key) has been deprecated. It is replaced by createGooglePhotorealistic3DTileset({key}). It will be removed in Cesium 1.126."),e={key:e}),e.onlyUsingWithGoogleGeocoder||_t("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=y(e.key,uS.defaultApiKey);if(!l(n))return lCt(t);let i,o=uS.getDefaultCredit();l(o)&&(i=[o]);let r=new Ze({url:`${uS.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return bs.fromUrl(r,t)}var YSe={};async function lCt(e){let i=YSe[2275207];l(i)||(i=gd.fromAssetId(2275207),YSe[2275207]=i);let o=await i;return bs.fromUrl(o,e)}var x6=cCt;var Hoo=T(S(),1);async function dCt(e){let t=await bs.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,B.WHITE).toCssColorString();n=new bS({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var _6=dCt;var nro=T(S(),1);function uCt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=M.clone(y(e.modelMatrix,M.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new Gt({geometry:Fn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Ht(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Gt({geometry:Fn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Ht(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Gt({geometry:Fn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Ht(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new dn({flat:!0,translucent:!1})})}var T6=uCt;var oro=T(S(),1),S6=`uniform sampler2D u_depthTexture; +`;function _S(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Hi.fromType(Hi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,IM),this._fragmentShaderSource=y(e.fragmentShaderSource,EM),this._renderState=no.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(_S.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return _S.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});_S.VERTEX_FORMAT=Xe.POSITION_AND_ST;_S.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;_S.prototype.isTranslucent=no.prototype.isTranslucent;_S.prototype.getRenderState=no.prototype.getRenderState;var O7=_S;var yeo=T(S(),1);function nd(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,nd.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,nd.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,nd.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,nd.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,nd.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new ge,this._nominalFrameRate=new ge,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){lSt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){dSt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}nd.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};nd.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new nd({scene:e})),e._frameRateMonitor};Object.defineProperties(nd.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});nd.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};nd.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};nd.prototype.isDestroyed=function(){return!1};nd.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),me(this)};function lSt(e,t){if(e._pauseCount>0)return;let n=Ti();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Kn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Kn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Kn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function dSt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var XM=nd;var Weo=T(S(),1);var ESe=T(t7(),1);function Y7(){this._image=new Image}Y7.prototype.isReady=function(){return!0};Y7.prototype.shouldDiscardImage=function(e){return e===this._image};function TS(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new zi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new St(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Y7),this._errorEvent=new ge}Object.defineProperties(TS.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});TS.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new TS(t);return n._metadata=e,n};TS.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};TS.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=V0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new Ko({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,d);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=uSt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){_M(r.key,d);let u=new Uint8Array(d),h,p=r.protoImagery;if((!l(p)||!p)&&(h=mSt(u)),!l(h)&&(!l(p)||p)){let g=hSt(u);h=g.imageType,u=g.imageData}return!l(h)||!l(u)?o:i_({uint8Array:u,format:h,flipY:!0})})};TS.prototype.pickFeatures=function(e,t,n,i,o){};function uSt(e,t,n,i,o,r){let s=V0.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function mSt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function hSt(e){let t=ESe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ae("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var H7=TS;var Neo=T(S(),1);var fSt=new B(1,1,1,.4),pSt=new B(0,1,0,.05),bSt=new B(0,.5,0,.2);function SS(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new zi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,fSt),this._glowColor=y(e.glowColor,pSt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,bSt),this._errorEvent=new ge,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(SS.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});SS.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};SS.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};SS.prototype.getTileCredits=function(e,t,n){};SS.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};SS.prototype.pickFeatures=function(e,t,n,i,o){};var z7=SS;var Tno=T(S(),1);var Hto=T(S(),1);var Gto=T(S(),1);var Jeo=T(S(),1);function Yh(){}Yh._maxDecodingConcurrency=Math.max(Bt.hardwareConcurrency-1,1);Yh._decodeTaskProcessor=new gi("decodeI3S",Yh._maxDecodingConcurrency);Yh._promise=void 0;async function gSt(){if(await Yh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Yh._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}Yh.decode=async function(e,t,n,i,o){return l(Yh._promise)||(Yh._promise=gSt()),Yh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,d=0,u=0;l(s.obb)?(c=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let h=$.fromRotationX(-W.PI_OVER_TWO),p=new $;$.multiply(h,a,p);let g=he.fromDegrees(c,d,u),f=ne.WGS84.cartographicToCartesian(g),x={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ne.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:f,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(x)})};var WM=Yh;var $eo=T(S(),1);function K7(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(K7.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});K7.prototype.load=async function(){return this._data=await Hh.loadJson(this._resource),this._data};var PM=K7;var ito=T(S(),1);function R0(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(R0.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function tO(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function ySt(e){return e==="String"?1:tO(e)}async function xSt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}R0.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=xSt(this).catch(function(e){console.error(e)}),this._loadPromise)};R0.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};R0.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};R0.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(c+=u.value),t=u.offset}this._values[o].push(c)}}}};R0.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=tO(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=tO(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};R0.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=ySt(i.valueType)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};R0.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new ae(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=tO(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new ae(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new ae(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var vM=R0;var dto=T(S(),1);function wM(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(wM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});wM.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var _St=new m,TSt=new m,SSt=new m,CSt=new m,VSt=new m;function J7(e,t,n,i){let o=m.subtract(i,n,_St),r=m.cross(o,m.subtract(e,n,TSt),CSt),s=m.cross(o,m.subtract(t,n,SSt),VSt);return m.dot(r,s)>=0}var LSt=new m,RSt=new m,ZSt=new m,GSt=new m,ESt=new m,ISt=new m,XSt=new m,WSt=new m,PSt=new m,vSt=new m;wM.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,d=this._customAttributes.positions,u=this._customAttributes.indices,h;l(u)?h=u.length:h=d.length/3;for(let p=0;p<h;p++){let g,f,x;l(u)?(g=u[p],f=u[p+1],x=u[p+2]):(g=p*3,f=p*3+1,x=p*3+2);let _=m.fromElements(d[g*3],d[g*3+1],d[g*3+2],LSt),C=m.fromElements(d[f*3],d[f*3+1],d[f*3+2],RSt),V=new m(d[x*3],d[x*3+1],d[x*3+2],ZSt);if(!J7(i,_,C,V)||!J7(i,C,_,V)||!J7(i,V,_,C))continue;let L=m.subtract(C,_,GSt),Z=m.subtract(V,_,ESt),G=m.cross(L,Z,ISt);if(m.magnitude(G)===0)continue;let I=m.normalize(G,XSt),v=m.subtract(i,_,WSt),P=Math.abs(m.dot(v,I));if(P<o){o=P,r=p;let w=m.magnitudeSquared(m.subtract(i,_,v)),F=m.magnitudeSquared(m.subtract(i,C,PSt)),b=m.magnitudeSquared(m.subtract(i,V,vSt));w<F&&w<b?(a=g,c=_,s=w):F<b?(a=f,c=C,s=F):(a=x,c=V,s=b)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function ISe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(gS(e[i])):t.push(e[i]);return t}wM.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,h="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let L=this._parent._data.mesh.material.definition;if(L>=0&&L<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[L],c=u,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){d=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let Z="0";if(l(this._layer._data.textureSetDefinitions))for(let G=0;G<this._layer._data.textureSetDefinitions.length;G++){let I=this._layer._data.textureSetDefinitions[G];for(let v=0;v<I.formats.length;v++){let P=I.formats[v];if(P.format==="jpg"){Z=P.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(h=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${Z}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=ISe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=ISe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(d=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],f=[];d&&(p=[{sampler:0,source:0}],g=[{uri:h}],f=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let x=[],_=n.length;for(let V=0;V<_;V++){let L=n[V].primitives,Z=L.length;for(let G=0;G<Z;G++){let I=L[G];if(l(I.material)){for(;I.material>=x.length;){let P=Ye(c,!0);x.push(P)}let v=x[I.material];l(I.extra)&&I.extra.isTransparent?l(v.alphaMode)||(v.alphaMode="BLEND"):v.alphaMode==="BLEND"&&(v.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:x,textures:p,images:g,samplers:f,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var EL=wM;function Ic(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(Ic.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Ic.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Ku(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Hh.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function XSe(e,t){let n=new vM(e,t);return e._fields[t.name]=n,n.load()}Ic.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(XSe(this,i))}return Promise.all(t)};Ic.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return XSe(this,o)}return Promise.resolve()};Ic.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Ic.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Ic.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Ic(e,y(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Ic.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new EL(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new EL(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Ic.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new PM(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Ic.prototype._clearGeometryData=function(){this._geometryData=[]};Ic.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let V=this._dataProvider._geoidDataList[C],L=V.projection.project(n);if(L.x>V.nativeExtent.west&&L.x<V.nativeExtent.east&&L.y>V.nativeExtent.south&&L.y<V.nativeExtent.north){n.height+=MSt(L.x,L.y,V);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ne.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ne.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=r/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Ra(0,0,0),d=vt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new ve(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=$.fromQuaternion(d),h=$.inverse(u,new $),p=new M(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),g=M.inverse(p,new M),f=M.clone(p);l(this._parent._globalTransform)&&M.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=h;let x=[];for(let C=0;C<this._children.length;C++)x.push(this._children[C]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[f[0],f[4],f[8],f[12],f[1],f[5],f[9],f[13],f[2],f[6],f[10],f[14],f[3],f[7],f[11],f[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Ic.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Ic.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await WM.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function wSt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function FSt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function WSe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await wSt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!FSt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Ic.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=WSe(this,t);e.push(n)}return Promise.all(e)};Ku.prototype._hookedRequestContent=Ku.prototype.requestContent;Ku.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new Ze({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{WSe(e._i3sNode,n)})),e._isLoading=!1,t})}};function ASt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function nO(e,t,n,i){let o=e+t*n;return i[o]}function MSt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,d=a<n.height?a+1:a;a=n.height-1-a,d=n.height-1-d;let u=nO(s,a,n.width,n.buffer),h=nO(c,a,n.width,n.buffer),p=nO(s,d,n.width,n.buffer),g=nO(c,d,n.width,n.buffer),f=ASt(o,r,u,h,p,g);return f=f*n.scale+n.offset,f}Object.defineProperties(Ku.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var IL=Ic;var vto=T(S(),1);function iO(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(iO.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function Q7(e,t){let n=[];for(let i=0;i<e.length;i++){let o=B.byteToFloat(e[i]);i<3?n.push(gS(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function XL(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=Q7(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=Q7(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=Q7(a.color,a.transparency)))}break}}return n}function NSt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=XL(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let d=a[c],u=n;for(let h=0;h<d.length;h++){let p=d[h];h===d.length-1?u[p]=s:(l(u[p])||(u[p]={}),u=u[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=XL(o.symbol,t)}return n}}function kSt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=y(o.classMaxValue,o.classMinValue),a=y(r.classMaxValue,r.classMinValue);return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(XL(r.symbol,t)))}return i.symbols.push(void 0),i}}iO.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=XL(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=XL(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=NSt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=XL(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=kSt(i,n))}};function PSe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?PSe(s,t,n,i):s}}function USt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function DSt(e,t,n){let i=t[n],o=USt(e.ranges,i);return e.symbols[o]}iO.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>PSe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>DSt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var FM=iO;function id(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Ze({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(id.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});id.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ae(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new FM(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};id.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let d=0;d<c.length;d++)s.push(c[d])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};id.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};id.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new IL(this,t,!0)}else this._rootNode=new IL(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};id.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};id._fetchJson=function(e){return e.fetchJson()};id.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=id._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};id.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};id.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Ye(e):{},e.outlineColor=B.fromCartesian4(se.fromArray(o))),this._tileset=await bs.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};id.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};id.prototype.filterByAttributes=function(e){this._filters=l(e)?Ye(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var CS=id;var jto=T(S(),1);function oO(e,t){this._dataProvider=e,this._resource=new Ze({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(oO.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});oO.prototype.load=async function(){return this._data=await Hh.loadJson(this._resource),this._data};oO.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var AM=oO;var ono=T(S(),1);function MM(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=y(n.visibility,!0),this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(MM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});MM._fromData=async function(e,t,n,i){let o=new MM(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let d=MM._fromData(e,t,r[c],o);s.push(d)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let d=a[c];o._sublayers.push(d),o._i3sLayers.push(...d._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Ze({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Hh.loadJson(o._resource),c=new CS(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var NM=MM;var FSe=T(vSe(),1);function xs(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=y(e.showFeatures,!1),this._adjustMaterialAlphaMode=y(e.adjustMaterialAlphaMode,!1),this._applySymbology=y(e.applySymbology,!1),this._calculateNormals=y(e.calculateNormals,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(xs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});xs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return me(this)};xs.prototype.isDestroyed=function(){return!1};xs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};xs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};xs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};xs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function BSt(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function wSe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=BSt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=NM._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new AM(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=ce.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new CS(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}xs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ze.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await xs.loadJson(n),o=new xs(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=wSe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await wSe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};xs._fetchJson=function(e){return e.fetchJson()};xs.loadJson=async function(e){let t=await xs._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new ae(t.error)}return t};xs.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new ae(`Failed to load binary: ${e.url}`);return t};xs.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var OSt=new D;function YSt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let h=c.x;h<=d.x;h++)for(let p=c.y;p<=d.y;p++){let g=D.fromElements(h,p,OSt),f=g.toString();if(!o.hasOwnProperty(f)){let x={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=x,i.push(x)}}let u=[];for(let h=0;h<i.length;++h){let p=i[h],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(g)}return Promise.all(u).then(function(h){let p=[];for(let g=0;g<h.length;g++){let f={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},x=h[g],_="Geographic";n._projection instanceof Xi&&(_="WebMercator");let C={projectionType:_,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===cm.LERC){let V=FSe.default.decode(x._buffer);C.buffer=V.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function HSt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await YSt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}xs.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=HSt(this),this._geoidDataPromise)};xs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};xs.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};xs.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};xs.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Hh=xs;var Ino=T(S(),1);var sO={};sO.createTilesetFromIModelId=async function(e,t){let{exports:n}=await Sa.getExports(e);if(n.length>0&&n.every(a=>a.status===Sa.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===Sa.ExportStatus.Complete);if(!l(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new Ze({url:r});return bs.fromUrl(s,t)};sO.createTilesetForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await Sa.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![Sa.RealityDataType.Cesium3DTiles,Sa.RealityDataType.PNTS,Sa.RealityDataType.RealityMesh3DTiles,Sa.RealityDataType.Terrain3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let r=await Sa.getRealityDataURL(e,t,i);return bs.fromUrl(r,{maximumScreenSpaceError:4})};sO.createDataSourceForRealityDataId=async function(t,n,i,o){if(!l(i)||!l(o)){let a=await Sa.getRealityDataMetadata(t,n);o=a.rootDocument,i=a.type}if(![Sa.RealityDataType.KML,Sa.RealityDataType.GeoJSON].includes(i))throw new ae(`Reality data type is not a data source type: ${i}`);let s=await Sa.getRealityDataURL(t,n,o);return i===Sa.RealityDataType.GeoJSON?bT.load(s):ST.load(s)};var j7=sO;var Pno=T(S(),1);function ASe(){}Object.defineProperties(ASe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var q7=ASe;var kno=T(S(),1);var zSt=/\/$/,MSe=new St('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function WL(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ze.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();zSt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new St(c))):c=MSe,this._resource=i,this._imageryProvider=new Da({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(WL.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});WL.prototype.getTileCredits=function(e,t,n){};WL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};WL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};WL._defaultCredit=MSe;var $7=WL;var Dno=T(S(),1);function e6(e){}e6.prototype.isReady=function(){return!0};e6.prototype.shouldDiscardImage=function(e){return!1};var t6=e6;var jno=T(S(),1);var KSt=new St("MapQuest, Open Street Map and contributors, CC-BY-SA");function aO(e){e=y(e,y.EMPTY_OBJECT);let t=Ze.createIfNeeded(y(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${y(e.fileExtension,"png")}`;let n=new os({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ce.southwest(a),r),d=n.positionToTileXY(ce.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),h=y(e.credit,KSt);typeof h=="string"&&(h=new St(h)),Da.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(aO.prototype=Object.create(Da.prototype),aO.prototype.constructor=aO);var Z0=aO;var oio=T(S(),1);var JSt=new D(1,1);function n6(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=m.clone(y(e.position,m.ZERO)),this.velocity=m.clone(y(e.velocity,m.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=B.clone(y(e.startColor,B.WHITE)),this.endColor=B.clone(y(e.endColor,B.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=D.clone(y(e.imageSize,JSt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(n6.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var NSe=new m;n6.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,NSe),m.add(this.position,NSe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var PL=n6;var aio=T(S(),1);function kSe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(kSe.prototype,{complete:{get:function(){return this._complete}}});var i6=kSe;var dio=T(S(),1);function USe(e){}USe.prototype.emit=function(e){pe.throwInstantiationError()};var o6=USe;var Lio=T(S(),1);var DSe=new D(1,1);function kM(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new RM(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._emitterModelMatrix=M.clone(y(e.emitterModelMatrix,M.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new M,this._startColor=B.clone(y(e.color,y(e.startColor,B.WHITE))),this._endColor=B.clone(y(e.color,y(e.endColor,B.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=D.clone(y(e.imageSize,y(e.minimumImageSize,DSe))),this._maximumImageSize=D.clone(y(e.imageSize,y(e.maximumImageSize,DSe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new ge,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(kM.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){B.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){B.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function QSt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,d=e._particlePool,u=Math.max(a-c.length-d.length,0);for(let h=0;h<u;++h){let p=new PL;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function jSt(e){let t=e._particlePool.pop();return l(t)||(t=new PL),t}function qSt(e,t){e._particlePool.push(t)}function $St(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let d=n[c];i.remove(d._billboard)}n.length=a}function eCt(e){l(e._billboard)&&(e._billboard.show=!1)}function BSe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=W.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=W.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=W.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=W.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new B(i,o,r,s),n.scale=W.lerp(t.startScale,t.endScale,t.normalizedAge)}function tCt(e,t){t.startColor=B.clone(e._startColor,t.startColor),t.endColor=B.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=W.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=W.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=W.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=W.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=W.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function nCt(e,t){if(e._isComplete)return 0;t=W.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=W.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var cO=new m;kM.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Zd),this._updateParticlePool&&(QSt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=q.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?BSe(this,s):(eCt(s),qSt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=nCt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=jSt(this),this._emitter.emit(s),m.add(s.position,s.velocity,cO),M.multiplyByPoint(d,cO,cO),s.position=M.multiplyByPoint(d,s.position,s.position),m.subtract(cO,s.position,s.velocity),m.normalize(s.velocity,s.velocity),tCt(this,s),BSe(this,s)}if(this._billboardCollection.update(e),this._previousTime=q.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=W.mod(this._currentTime,this._lifetime),this.bursts){let d=this.bursts.length;for(r=0;r<d;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&$St(this)};kM.prototype.isDestroyed=function(){return!1};kM.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),me(this)};var r6=kM;var Gio=T(S(),1);function lu(){pe.throwInstantiationError()}lu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(lu.prototype,{quadtree:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError}});lu.prototype.update=pe.throwInstantiationError;lu.prototype.beginUpdate=pe.throwInstantiationError;lu.prototype.endUpdate=pe.throwInstantiationError;lu.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;lu.prototype.loadTile=pe.throwInstantiationError;lu.prototype.computeTileVisibility=pe.throwInstantiationError;lu.prototype.showTileThisFrame=pe.throwInstantiationError;lu.prototype.computeDistanceToTile=pe.throwInstantiationError;lu.prototype.isDestroyed=pe.throwInstantiationError;lu.prototype.destroy=pe.throwInstantiationError;var s6=lu;var Pio=T(S(),1);function a6(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(a6.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});a6.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,W.PI),i=W.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(o,r,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var c6=a6;var Fio=T(S(),1);function UM(){}UM.prototype.evaluate=function(e,t){pe.throwInstantiationError()};UM.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};UM.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};UM.prototype.getVariables=function(){pe.throwInstantiationError()};var l6=UM;var Uio=T(S(),1);function vL(e){this._ready=!1,this._provider=void 0,this._errorEvent=new ge,this._readyEvent=new ge,oCt(this,e)}Object.defineProperties(vL.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});vL.fromWorldTerrain=function(e){return new vL(bS(e))};vL.fromWorldBathymetry=function(e){return new vL(xM(e))};function iCt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function oCt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){iCt(e._errorEvent,i)}}var DM=vL;var Oio=T(S(),1);function wL(){}wL.prototype.boundingVolume=void 0;wL.prototype.boundingSphere=void 0;wL.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};wL.prototype.intersectPlane=function(e){pe.throwInstantiationError()};wL.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var d6=wL;var jio=T(S(),1);function BM(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new zi({ellipsoid:e.ellipsoid}),this._color=y(e.color,B.YELLOW),this._errorEvent=new ge,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(BM.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});BM.prototype.getTileCredits=function(e,t,n){};BM.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};BM.prototype.pickFeatures=function(e,t,n,i,o){};var OM=BM;var eoo=T(S(),1);function u6(e){pe.throwInstantiationError()}u6.prototype.isReady=pe.throwInstantiationError;u6.prototype.shouldDiscardImage=pe.throwInstantiationError;var m6=u6;var noo=T(S(),1),rCt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},h6=Object.freeze(rCt);var foo=T(S(),1);function lO(e,t){this.show=!0,l(e)||(e=new ze),this.rectangle=ze.clone(e),l(t)||(t=Hi.fromType(Hi.ColorType,{color:new B(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}lO.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!ze.equals(t.viewport,this.rectangle))&&(this._rs=Ue.fromCache({blending:un.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new De({sources:[this._material.shaderSource,mM]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ee.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};lO.prototype.isDestroyed=function(){return!1};lO.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),me(this)};var f6=lO;var goo=T(S(),1);function p6(){pe.throwInstantiationError()}Object.defineProperties(p6.prototype,{globalTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shape:{get:pe.throwInstantiationError},minBounds:{get:pe.throwInstantiationError},maxBounds:{get:pe.throwInstantiationError},dimensions:{get:pe.throwInstantiationError},paddingBefore:{get:pe.throwInstantiationError},paddingAfter:{get:pe.throwInstantiationError},names:{get:pe.throwInstantiationError},types:{get:pe.throwInstantiationError},componentTypes:{get:pe.throwInstantiationError},minimumValues:{get:pe.throwInstantiationError},maximumValues:{get:pe.throwInstantiationError},maximumTileCount:{get:pe.throwInstantiationError},keyframeCount:{get:pe.throwInstantiationError},timeIntervalCollection:{get:pe.throwInstantiationError}});p6.prototype.requestData=pe.throwInstantiationError;var b6=p6;var _oo=T(S(),1);function VS(){pe.throwInstantiationError()}Object.defineProperties(VS.prototype,{orientedBoundingBox:{get:pe.throwInstantiationError},boundingSphere:{get:pe.throwInstantiationError},boundTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shaderUniforms:{get:pe.throwInstantiationError},shaderDefines:{get:pe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:pe.throwInstantiationError}});VS.prototype.update=pe.throwInstantiationError;VS.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;VS.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;VS.DefaultMinBounds=pe.throwInstantiationError;VS.DefaultMaxBounds=pe.throwInstantiationError;var g6=VS;var Foo=T(S(),1);var sCt=new B,aCt=new B,cCt=new B,lCt=new B,OSe=new se,YM=new Uint8Array(4);function YSe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return B.lerp(t.color,n.color,o,i)}function dO(e,t){return{height:e,color:B.clone(t)}}function HSe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?B.equals(t.color,i[n-1].color):!1,a=r?B.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?B.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function dCt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],f=W.clamp(g.height,od._minimumHeight,od._maximumHeight),x=B.clone(g.color,sCt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(dO(f,x))}let d=!0,u=!0;for(n=0;n<a-1;n++){let g=c[n+0],f=c[n+1];d=d&&g.height<=f.height,u=u&&g.height>=f.height}u?c=c.reverse():d||u0(c,function(g,f){return W.sign(g.height-f.height)});let h=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!h&&!p&&(h=!0,p=!0),h&&c.splice(0,0,dO(od._minimumHeight,c[0].color)),p&&c.splice(c.length,0,dO(od._maximumHeight,c[c.length-1].color)),c=HSe(c),i.push(c)}return i}function uCt(e){let t=dCt(e),n=[],i=[],o;function r(d,u){n.push(dO(d,u))}function s(d,u,h){let p=B.multiplyByScalar(h,1-u.alpha,lCt);p=B.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,h=0;i=n,n=[];let p=d.length,g=i.length;for(;u<p||h<g;){let f=u<p?d[u]:void 0,x=u>0?d[u-1]:void 0,_=u<p-1?d[u+1]:void 0,C=h<g?i[h]:void 0,V=h>0?i[h-1]:void 0,L=h<g-1?i[h+1]:void 0;if(l(f)&&l(C)&&f.height===C.height){let Z=l(L)&&C.height===L.height,G=!l(V),I=!l(L),v=l(_)&&f.height===_.height,P=!l(x),w=!l(_);Z?v?(s(f.height,f.color,C.color),s(f.height,_.color,L.color)):P?(r(f.height,C.color),s(f.height,f.color,L.color)):w?(s(f.height,f.color,C.color),r(f.height,L.color)):(s(f.height,f.color,C.color),s(f.height,f.color,L.color)):G?v?(r(f.height,f.color),s(f.height,_.color,C.color)):w?(r(f.height,f.color),r(f.height,C.color)):(P||r(f.height,f.color),s(f.height,f.color,C.color)):I?v?(s(f.height,f.color,C.color),r(f.height,_.color)):P?(r(f.height,C.color),r(f.height,f.color)):w?s(f.height,f.color,C.color):(s(f.height,f.color,C.color),r(f.height,f.color)):v?(s(f.height,f.color,C.color),s(f.height,_.color,C.color)):P?(r(f.height,C.color),s(f.height,f.color,C.color)):w?(s(f.height,f.color,C.color),r(f.height,C.color)):s(f.height,f.color,C.color),u+=v?2:1,h+=Z?2:1}else if(l(f)&&l(C)&&l(V)&&f.height<C.height){let Z=YSe(f.height,V,C,cCt);l(x)?l(_)?s(f.height,f.color,Z):(s(f.height,f.color,Z),r(f.height,Z)):(r(f.height,Z),s(f.height,f.color,Z)),u++}else if(l(C)&&l(f)&&l(x)&&C.height<f.height){let Z=YSe(C.height,x,f,aCt);l(V)?l(L)?s(C.height,Z,C.color):(s(C.height,Z,C.color),r(C.height,Z)):(r(C.height,Z),s(C.height,Z,C.color)),h++}else l(f)&&(!l(C)||f.height<C.height)?(l(C)&&!l(V)&&!l(_)?(r(f.height,f.color),r(f.height,od._emptyColor),r(C.height,od._emptyColor)):(!l(C)&&l(V)&&!l(x)&&(r(V.height,od._emptyColor),r(f.height,od._emptyColor)),r(f.height,f.color)),u++):l(C)&&(!l(f)||C.height<f.height)&&(r(C.height,C.color),h++)}}return HSe(n)}function od(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=uCt(n),r=o.length,s,a,c;if(!od._useFloatTexture(i)){a=je.UNSIGNED_BYTE,c=nt.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,OSe),se.pack(OSe,s,g*4)}else{a=je.FLOAT,c=i.webgl2?nt.RED:nt.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let u=Xt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.NEAREST,magnificationFilter:hi.NEAREST})}),h=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(YM),h[g*4+0]=YM[0],h[g*4+1]=YM[1],h[g*4+2]=YM[2],h[g*4+3]=YM[3];let p=Xt.create({context:i,pixelFormat:nt.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new qt({wrapS:Vn.CLAMP_TO_EDGE,wrapT:Vn.CLAMP_TO_EDGE,minificationFilter:jt.LINEAR,magnificationFilter:hi.LINEAR})});return Hi.fromType("ElevationBand",{heights:u,colors:p})}od._useFloatTexture=function(e){return e.floatingPointTexture};od._maximumHeight=5906376425472;od._minimumHeight=-5906376425472;od._emptyColor=new B(0,0,0,0);var y6=od;var Hoo=T(S(),1);async function mCt(e,t){t=y(t,{}),t.cacheBytes=y(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=y(t.maximumCacheOverflowBytes,1024*1024*1024),t.enableCollision=y(t.enableCollision,!0),e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(us("createGooglePhotorealistic3DTileset(key)","createGooglePhotorealistic3DTileset(key) has been deprecated. It is replaced by createGooglePhotorealistic3DTileset({key}). It will be removed in Cesium 1.126."),e={key:e}),e.onlyUsingWithGoogleGeocoder||xt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=y(e.key,hS.defaultApiKey);if(!l(n))return hCt(t);let i,o=hS.getDefaultCredit();l(o)&&(i=[o]);let r=new Ze({url:`${hS.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return bs.fromUrl(r,t)}var zSe={};async function hCt(e){let i=zSe[2275207];l(i)||(i=yd.fromAssetId(2275207),zSe[2275207]=i);let o=await i;return bs.fromUrl(o,e)}var x6=mCt;var $oo=T(S(),1);async function fCt(e){let t=await bs.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,B.WHITE).toCssColorString();n=new yS({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var _6=fCt;var lro=T(S(),1);function pCt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=M.clone(y(e.modelMatrix,M.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new Zt({geometry:Fn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Yt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Zt({geometry:Fn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Yt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Zt({geometry:Fn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Yt(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new ln({flat:!0,translucent:!1})})}var T6=pCt;var uro=T(S(),1),S6=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; @@ -15980,49 +15980,49 @@ void main() float scale = pow(z_ndc * 0.5 + 0.5, 8.0); out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); } -`;var mro=T(S(),1);function mCt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,nt.RGBA),this.pixelDatatype=y(e.pixelDatatype,je.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Ze.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?Vn.REPEAT:Vn.CLAMP_TO_EDGE;this.sampler=new $t({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var C6=mCt;var fro=T(S(),1),hCt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},V6=Object.freeze(hCt);var bro=T(S(),1),fCt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},L6=Object.freeze(fCt);var xro=T(S(),1);function pCt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${zf(s)} - with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var R6=pCt;globalThis.CESIUM_VERSION="1.124";var qIo=T(S(),1);var ELo=T(S(),1);var LLo=T(S(),1);var bLo=T(S(),1),O9;typeof ko<"u"&&(O9=ko);(function(){/*! +`;var xro=T(S(),1);function bCt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,nt.RGBA),this.pixelDatatype=y(e.pixelDatatype,je.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Ze.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?Vn.REPEAT:Vn.CLAMP_TO_EDGE;this.sampler=new qt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var C6=bCt;var Tro=T(S(),1),gCt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},V6=Object.freeze(gCt);var Cro=T(S(),1),yCt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},L6=Object.freeze(yCt);var Rro=T(S(),1);function xCt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${Kf(s)} + with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var R6=xCt;globalThis.CESIUM_VERSION="1.125";var rXo=T(S(),1);var FLo=T(S(),1);var WLo=T(S(),1);var CLo=T(S(),1),HM;typeof ko<"u"&&(HM=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) - */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(b,R){return b===null||typeof b in x?b===R:!1}function d(b,R){var E;return function(){E||(E=f.a.setTimeout(function(){E=e,b()},R))}}function u(b,R){var E;return function(){clearTimeout(E),E=f.a.setTimeout(b,R)}}function h(b,R){R&&R!=="change"?R==="beforeChange"?this.pc(b):this.gb(b,R):this.qc(b)}function p(b,R){R!==null&&R.s&&R.s()}function g(b,R){var E=this.qd,X=E[Z];X.ra||(this.Qb&&this.mb[R]?(E.uc(R,b,this.mb[R]),this.mb[R]=null,--this.Qb):X.I[R]||E.uc(R,b,X.J?{da:b}:E.$c(b)),b.Ja&&b.gd())}var f=typeof s<"u"?s:{};f.b=function(b,R){for(var E=b.split("."),X=f,A=0;A<E.length-1;A++)X=X[E[A]];X[E[E.length-1]]=R},f.L=function(b,R,E){b[R]=E},f.version="3.5.1",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=function(){function b(z,j){for(var ee in z)A.call(z,ee)&&j(ee,z[ee])}function R(z,j){if(j)for(var ee in j)A.call(j,ee)&&(z[ee]=j[ee]);return z}function E(z,j){return z.__proto__=j,z}function X(z,j,ee,fe){var _e=z[j].match(J)||[];f.a.D(ee.match(J),function(de){f.a.Na(_e,de,fe)}),z[j]=_e.join(" ")}var A=Object.prototype.hasOwnProperty,N={__proto__:[]}instanceof Array,O=typeof Symbol=="function",U={},Y={};U[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],U.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),b(U,function(z,j){if(j.length)for(var ee=0,fe=j.length;ee<fe;ee++)Y[j[ee]]=z});var k={propertychange:!0},H=n&&function(){for(var z=3,j=n.createElement("div"),ee=j.getElementsByTagName("i");j.innerHTML="<!--[if gt IE "+ ++z+"]><i></i><![endif]-->",ee[0];);return 4<z?z:e}(),J=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(z,j,ee){for(var fe=0,_e=z.length;fe<_e;fe++)j.call(ee,z[fe],fe,z)},A:typeof Array.prototype.indexOf=="function"?function(z,j){return Array.prototype.indexOf.call(z,j)}:function(z,j){for(var ee=0,fe=z.length;ee<fe;ee++)if(z[ee]===j)return ee;return-1},Lb:function(z,j,ee){for(var fe=0,_e=z.length;fe<_e;fe++)if(j.call(ee,z[fe],fe,z))return z[fe];return e},Pa:function(z,j){var ee=f.a.A(z,j);0<ee?z.splice(ee,1):ee===0&&z.shift()},wc:function(z){var j=[];return z&&f.a.D(z,function(ee){0>f.a.A(j,ee)&&j.push(ee)}),j},Mb:function(z,j,ee){var fe=[];if(z)for(var _e=0,de=z.length;_e<de;_e++)fe.push(j.call(ee,z[_e],_e));return fe},jb:function(z,j,ee){var fe=[];if(z)for(var _e=0,de=z.length;_e<de;_e++)j.call(ee,z[_e],_e)&&fe.push(z[_e]);return fe},Nb:function(z,j){if(j instanceof Array)z.push.apply(z,j);else for(var ee=0,fe=j.length;ee<fe;ee++)z.push(j[ee]);return z},Na:function(z,j,ee){var fe=f.a.A(f.a.bc(z),j);0>fe?ee&&z.push(j):ee||z.splice(fe,1)},Ba:N,extend:R,setPrototypeOf:E,Ab:N?E:R,P:b,Ga:function(z,j,ee){if(!z)return z;var fe={},_e;for(_e in z)A.call(z,_e)&&(fe[_e]=j.call(ee,z[_e],_e,z));return fe},Tb:function(z){for(;z.firstChild;)f.removeNode(z.firstChild)},Yb:function(z){z=f.a.la(z);for(var j=(z[0]&&z[0].ownerDocument||n).createElement("div"),ee=0,fe=z.length;ee<fe;ee++)j.appendChild(f.oa(z[ee]));return j},Ca:function(z,j){for(var ee=0,fe=z.length,_e=[];ee<fe;ee++){var de=z[ee].cloneNode(!0);_e.push(j?f.oa(de):de)}return _e},va:function(z,j){if(f.a.Tb(z),j)for(var ee=0,fe=j.length;ee<fe;ee++)z.appendChild(j[ee])},Xc:function(z,j){var ee=z.nodeType?[z]:z;if(0<ee.length){for(var fe=ee[0],_e=fe.parentNode,de=0,ye=j.length;de<ye;de++)_e.insertBefore(j[de],fe);for(de=0,ye=ee.length;de<ye;de++)f.removeNode(ee[de])}},Ua:function(z,j){if(z.length){for(j=j.nodeType===8&&j.parentNode||j;z.length&&z[0].parentNode!==j;)z.splice(0,1);for(;1<z.length&&z[z.length-1].parentNode!==j;)z.length--;if(1<z.length){var ee=z[0],fe=z[z.length-1];for(z.length=0;ee!==fe;)z.push(ee),ee=ee.nextSibling;z.push(fe)}}return z},Zc:function(z,j){7>H?z.setAttribute("selected",j):z.selected=j},Db:function(z){return z===null||z===e?"":z.trim?z.trim():z.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(z,j){return z=z||"",j.length>z.length?!1:z.substring(0,j.length)===j},vd:function(z,j){if(z===j)return!0;if(z.nodeType===11)return!1;if(j.contains)return j.contains(z.nodeType!==1?z.parentNode:z);if(j.compareDocumentPosition)return(j.compareDocumentPosition(z)&16)==16;for(;z&&z!=j;)z=z.parentNode;return!!z},Sb:function(z){return f.a.vd(z,z.ownerDocument.documentElement)},kd:function(z){return!!f.a.Lb(z,f.a.Sb)},R:function(z){return z&&z.tagName&&z.tagName.toLowerCase()},Ac:function(z){return f.onError?function(){try{return z.apply(this,arguments)}catch(j){throw f.onError&&f.onError(j),j}}:z},setTimeout:function(z,j){return setTimeout(f.a.Ac(z),j)},Gc:function(z){setTimeout(function(){throw f.onError&&f.onError(z),z},0)},B:function(z,j,ee){var fe=f.a.Ac(ee);if(ee=k[j],f.options.useOnlyNativeEvents||ee||!o)if(ee||typeof z.addEventListener!="function")if(typeof z.attachEvent<"u"){var _e=function(ye){fe.call(z,ye)},de="on"+j;z.attachEvent(de,_e),f.a.K.za(z,function(){z.detachEvent(de,_e)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else z.addEventListener(j,fe,!1);else te||(te=typeof o(z).on=="function"?"on":"bind"),o(z)[te](j,fe)},Fb:function(z,j){if(!z||!z.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(f.a.R(z)==="input"&&z.type&&j.toLowerCase()=="click"?(ee=z.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,f.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof z.dispatchEvent=="function")ee=n.createEvent(Y[j]||"HTMLEvents"),ee.initEvent(j,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,z),z.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&z.click)z.click();else if(typeof z.fireEvent<"u")z.fireEvent("on"+j);else throw Error("Browser doesn't support triggering events");else o(z).trigger(j)},f:function(z){return f.O(z)?z():z},bc:function(z){return f.O(z)?z.v():z},Eb:function(z,j,ee){var fe;j&&(typeof z.classList=="object"?(fe=z.classList[ee?"add":"remove"],f.a.D(j.match(J),function(_e){fe.call(z.classList,_e)})):typeof z.className.baseVal=="string"?X(z.className,"baseVal",j,ee):X(z,"className",j,ee))},Bb:function(z,j){var ee=f.a.f(j);(ee===null||ee===e)&&(ee="");var fe=f.h.firstChild(z);!fe||fe.nodeType!=3||f.h.nextSibling(fe)?f.h.va(z,[z.ownerDocument.createTextNode(ee)]):fe.data=ee,f.a.Ad(z)},Yc:function(z,j){if(z.name=j,7>=H)try{var ee=z.name.replace(/[&<>'"]/g,function(fe){return"&#"+fe.charCodeAt(0)+";"});z.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(z){9<=H&&(z=z.nodeType==1?z:z.parentNode,z.style&&(z.style.zoom=z.style.zoom))},wd:function(z){if(H){var j=z.style.width;z.style.width=0,z.style.width=j}},Pd:function(z,j){z=f.a.f(z),j=f.a.f(j);for(var ee=[],fe=z;fe<=j;fe++)ee.push(fe);return ee},la:function(z){for(var j=[],ee=0,fe=z.length;ee<fe;ee++)j.push(z[ee]);return j},Da:function(z){return O?Symbol(z):z},Zd:H===6,$d:H===7,W:H,Lc:function(z,j){for(var ee=f.a.la(z.getElementsByTagName("input")).concat(f.a.la(z.getElementsByTagName("textarea"))),fe=typeof j=="string"?function(ye){return ye.name===j}:function(ye){return j.test(ye.name)},_e=[],de=ee.length-1;0<=de;de--)fe(ee[de])&&_e.push(ee[de]);return _e},Nd:function(z){return typeof z=="string"&&(z=f.a.Db(z))?r&&r.parse?r.parse(z):new Function("return "+z)():null},hc:function(z,j,ee){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(f.a.f(z),j,ee)},Od:function(z,j,ee){ee=ee||{};var fe=ee.params||{},_e=ee.includeFields||this.Jc,de=z;if(typeof z=="object"&&f.a.R(z)==="form")for(var de=z.action,ye=_e.length-1;0<=ye;ye--)for(var Te=f.a.Lc(z,_e[ye]),Ie=Te.length-1;0<=Ie;Ie--)fe[Te[Ie].name]=Te[Ie].value;j=f.a.f(j);var Le=n.createElement("form");Le.style.display="none",Le.action=de,Le.method="post";for(var ke in j)z=n.createElement("input"),z.type="hidden",z.name=ke,z.value=f.a.hc(f.a.f(j[ke])),Le.appendChild(z);b(fe,function(Be,it){var Et=n.createElement("input");Et.type="hidden",Et.name=Be,Et.value=it,Le.appendChild(Et)}),n.body.appendChild(Le),ee.submitter?ee.submitter(Le):Le.submit(),setTimeout(function(){Le.parentNode.removeChild(Le)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.D),f.b("utils.arrayFirst",f.a.Lb),f.b("utils.arrayFilter",f.a.jb),f.b("utils.arrayGetDistinctValues",f.a.wc),f.b("utils.arrayIndexOf",f.a.A),f.b("utils.arrayMap",f.a.Mb),f.b("utils.arrayPushAll",f.a.Nb),f.b("utils.arrayRemoveItem",f.a.Pa),f.b("utils.cloneNodes",f.a.Ca),f.b("utils.createSymbolOrString",f.a.Da),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.Jc),f.b("utils.getFormFields",f.a.Lc),f.b("utils.objectMap",f.a.Ga),f.b("utils.peekObservable",f.a.bc),f.b("utils.postJson",f.a.Od),f.b("utils.parseJson",f.a.Nd),f.b("utils.registerEventHandler",f.a.B),f.b("utils.stringifyJson",f.a.hc),f.b("utils.range",f.a.Pd),f.b("utils.toggleDomNodeCssClass",f.a.Eb),f.b("utils.triggerEvent",f.a.Fb),f.b("utils.unwrapObservable",f.a.f),f.b("utils.objectForEach",f.a.P),f.b("utils.addOrRemoveItem",f.a.Na),f.b("utils.setTextContent",f.a.Bb),f.b("unwrap",f.a.f),Function.prototype.bind||(Function.prototype.bind=function(b){var R=this;if(arguments.length===1)return function(){return R.apply(b,arguments)};var E=Array.prototype.slice.call(arguments,1);return function(){var X=E.slice(0);return X.push.apply(X,arguments),R.apply(b,X)}}),f.a.g=new function(){var b=0,R="__ko__"+new Date().getTime(),E={},X,A;return f.a.W?(X=function(N,O){var U=N[R];if(!U||U==="null"||!E[U]){if(!O)return e;U=N[R]="ko"+b++,E[U]={}}return E[U]},A=function(N){var O=N[R];return O?(delete E[O],N[R]=null,!0):!1}):(X=function(N,O){var U=N[R];return!U&&O&&(U=N[R]={}),U},A=function(N){return N[R]?(delete N[R],!0):!1}),{get:function(N,O){var U=X(N,!1);return U&&U[O]},set:function(N,O,U){(N=X(N,U!==e))&&(N[O]=U)},Ub:function(N,O,U){return N=X(N,!0),N[O]||(N[O]=U)},clear:A,Z:function(){return b+++R}}},f.b("utils.domData",f.a.g),f.b("utils.domData.clear",f.a.g.clear),f.a.K=new function(){function b(O,U){var Y=f.a.g.get(O,X);return Y===e&&U&&(Y=[],f.a.g.set(O,X,Y)),Y}function R(O){var U=b(O,!1);if(U)for(var U=U.slice(0),Y=0;Y<U.length;Y++)U[Y](O);f.a.g.clear(O),f.a.K.cleanExternalData(O),N[O.nodeType]&&E(O.childNodes,!0)}function E(O,U){for(var Y=[],k,H=0;H<O.length;H++)if((!U||O[H].nodeType===8)&&(R(Y[Y.length]=k=O[H]),O[H]!==k))for(;H--&&f.a.A(Y,O[H])==-1;);}var X=f.a.g.Z(),A={1:!0,8:!0,9:!0},N={1:!0,9:!0};return{za:function(O,U){if(typeof U!="function")throw Error("Callback must be a function");b(O,!0).push(U)},yb:function(O,U){var Y=b(O,!1);Y&&(f.a.Pa(Y,U),Y.length==0&&f.a.g.set(O,X,e))},oa:function(O){return f.u.G(function(){A[O.nodeType]&&(R(O),N[O.nodeType]&&E(O.getElementsByTagName("*")))}),O},removeNode:function(O){f.oa(O),O.parentNode&&O.parentNode.removeChild(O)},cleanExternalData:function(O){o&&typeof o.cleanData=="function"&&o.cleanData([O])}}},f.oa=f.a.K.oa,f.removeNode=f.a.K.removeNode,f.b("cleanNode",f.oa),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.K),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.K.za),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.K.yb),function(){var b=[0,"",""],R=[1,"<table>","</table>"],E=[3,"<table><tbody><tr>","</tr></tbody></table>"],X=[1,"<select multiple='multiple'>","</select>"],A={thead:R,tbody:R,tfoot:R,tr:[2,"<table><tbody>","</tbody></table>"],td:E,th:E,option:X,optgroup:X},N=8>=f.a.W;f.a.ua=function(O,U){var Y;if(o){if(o.parseHTML)Y=o.parseHTML(O,U)||[];else if((Y=o.clean([O],U))&&Y[0]){for(var k=Y[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(Y=U)||(Y=n);var k=Y.parentWindow||Y.defaultView||t,H=f.a.Db(O).toLowerCase(),J=Y.createElement("div"),te;for(te=(H=H.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&A[H[1]]||b,H=te[0],te="ignored<div>"+te[1]+O+te[2]+"</div>",typeof k.innerShiv=="function"?J.appendChild(k.innerShiv(te)):(N&&Y.body.appendChild(J),J.innerHTML=te,N&&J.parentNode.removeChild(J));H--;)J=J.lastChild;Y=f.a.la(J.lastChild.childNodes)}return Y},f.a.Md=function(O,U){var Y=f.a.ua(O,U);return Y.length&&Y[0].parentElement||f.a.Yb(Y)},f.a.fc=function(O,U){if(f.a.Tb(O),U=f.a.f(U),U!==null&&U!==e)if(typeof U!="string"&&(U=U.toString()),o)o(O).html(U);else for(var Y=f.a.ua(U,O.ownerDocument),k=0;k<Y.length;k++)O.appendChild(Y[k])}}(),f.b("utils.parseHtmlFragment",f.a.ua),f.b("utils.setHtml",f.a.fc),f.aa=function(){function b(E,X){if(E){if(E.nodeType==8){var A=f.aa.Uc(E.nodeValue);A!=null&&X.push({ud:E,Kd:A})}else if(E.nodeType==1)for(var A=0,N=E.childNodes,O=N.length;A<O;A++)b(N[A],X)}}var R={};return{Xb:function(E){if(typeof E!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var X=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return R[X]=E,"<!--[ko_memo:"+X+"]-->"},bd:function(E,X){var A=R[E];if(A===e)throw Error("Couldn't find any memo with ID "+E+". Perhaps it's already been unmemoized.");try{return A.apply(null,X||[]),!0}finally{delete R[E]}},cd:function(E,X){var A=[];b(E,A);for(var N=0,O=A.length;N<O;N++){var U=A[N].ud,Y=[U];X&&f.a.Nb(Y,X),f.aa.bd(A[N].Kd,Y),U.nodeValue="",U.parentNode&&U.parentNode.removeChild(U)}},Uc:function(E){return(E=E.match(/^\[ko_memo\:(.*?)\]$/))?E[1]:null}}}(),f.b("memoization",f.aa),f.b("memoization.memoize",f.aa.Xb),f.b("memoization.unmemoize",f.aa.bd),f.b("memoization.parseMemoText",f.aa.Uc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.aa.cd),f.na=function(){function b(){if(A){for(var U=A,Y=0,k;O<A;)if(k=X[O++]){if(O>U){if(5e3<=++Y){O=A,f.a.Gc(Error("'Too much recursion' after processing "+Y+" task groups."));break}U=A}try{k()}catch(H){f.a.Gc(H)}}}}function R(){b(),O=A=X.length=0}var E,X=[],A=0,N=1,O=0;return t.MutationObserver?E=function(U){var Y=n.createElement("div");return new MutationObserver(U).observe(Y,{attributes:!0}),function(){Y.classList.toggle("foo")}}(R):E=n&&"onreadystatechange"in n.createElement("script")?function(U){var Y=n.createElement("script");Y.onreadystatechange=function(){Y.onreadystatechange=null,n.documentElement.removeChild(Y),Y=null,U()},n.documentElement.appendChild(Y)}:function(U){setTimeout(U,0)},{scheduler:E,zb:function(U){return A||f.na.scheduler(R),X[A++]=U,N++},cancel:function(U){U=U-(N-A),U>=O&&U<A&&(X[U]=null)},resetForTesting:function(){var U=A-O;return O=A=X.length=0,U},Sd:b}}(),f.b("tasks",f.na),f.b("tasks.schedule",f.na.zb),f.b("tasks.runEarly",f.na.Sd),f.Ta={throttle:function(b,R){b.throttleEvaluation=R;var E=null;return f.$({read:b,write:function(X){clearTimeout(E),E=f.a.setTimeout(function(){b(X)},R)}})},rateLimit:function(b,R){var E,X,A;typeof R=="number"?E=R:(E=R.timeout,X=R.method),b.Hb=!1,A=typeof X=="function"?X:X=="notifyWhenChangesStop"?u:d,b.ub(function(N){return A(N,E,R)})},deferred:function(b,R){if(R!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.ub(function(E){var X,A=!1;return function(){if(!A){f.na.cancel(X),X=f.na.zb(E);try{A=!0,b.notifySubscribers(e,"dirty")}finally{A=!1}}}}))},notify:function(b,R){b.equalityComparer=R=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.Ta),f.ic=function(b,R,E){this.da=b,this.lc=R,this.mc=E,this.Ib=!1,this.fb=this.Jb=null,f.L(this,"dispose",this.s),f.L(this,"disposeWhenNodeIsRemoved",this.l)},f.ic.prototype.s=function(){this.Ib||(this.fb&&f.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},f.ic.prototype.l=function(b){this.Jb=b,f.a.K.za(b,this.fb=this.s.bind(this))},f.T=function(){f.a.Ab(this,_),_.qb(this)};var _={qb:function(b){b.U={change:[]},b.sc=1},subscribe:function(b,R,E){var X=this;E=E||"change";var A=new f.ic(X,R?b.bind(R):b,function(){f.a.Pa(X.U[E],A),X.hb&&X.hb(E)});return X.Qa&&X.Qa(E),X.U[E]||(X.U[E]=[]),X.U[E].push(A),A},notifySubscribers:function(b,R){if(R=R||"change",R==="change"&&this.Gb(),this.Wa(R)){var E=R==="change"&&this.ed||this.U[R].slice(0);try{f.u.xc();for(var X=0,A;A=E[X];++X)A.Ib||A.lc(b)}finally{f.u.end()}}},ob:function(){return this.sc},Dd:function(b){return this.ob()!==b},Gb:function(){++this.sc},ub:function(b){var R=this,E=f.O(R),X,A,N,O,U;R.gb||(R.gb=R.notifySubscribers,R.notifySubscribers=h);var Y=b(function(){R.Ja=!1,E&&O===R&&(O=R.nc?R.nc():R());var k=A||U&&R.sb(N,O);U=A=X=!1,k&&R.gb(N=O)});R.qc=function(k,H){H&&R.Ja||(U=!H),R.ed=R.U.change.slice(0),R.Ja=X=!0,O=k,Y()},R.pc=function(k){X||(N=k,R.gb(k,"beforeChange"))},R.rc=function(){U=!0},R.gd=function(){R.sb(N,R.v(!0))&&(A=!0)}},Wa:function(b){return this.U[b]&&this.U[b].length},Bd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var R=0;return f.a.P(this.U,function(E,X){E!=="dirty"&&(R+=X.length)}),R},sb:function(b,R){return!this.equalityComparer||!this.equalityComparer(b,R)},toString:function(){return"[object Object]"},extend:function(b){var R=this;return b&&f.a.P(b,function(E,X){var A=f.Ta[E];typeof A=="function"&&(R=A(R,X)||R)}),R}};f.L(_,"init",_.qb),f.L(_,"subscribe",_.subscribe),f.L(_,"extend",_.extend),f.L(_,"getSubscriptionsCount",_.Bd),f.a.Ba&&f.a.setPrototypeOf(_,Function.prototype),f.T.fn=_,f.Qc=function(b){return b!=null&&typeof b.subscribe=="function"&&typeof b.notifySubscribers=="function"},f.b("subscribable",f.T),f.b("isSubscribable",f.Qc),f.S=f.u=function(){function b(N){E.push(X),X=N}function R(){X=E.pop()}var E=[],X,A=0;return{xc:b,end:R,cc:function(N){if(X){if(!f.Qc(N))throw Error("Only subscribable things can act as dependencies");X.od.call(X.pd,N,N.fd||(N.fd=++A))}},G:function(N,O,U){try{return b(),N.apply(O,U||[])}finally{R()}},qa:function(){if(X)return X.o.qa()},Va:function(){if(X)return X.o.Va()},Ya:function(){if(X)return X.Ya},o:function(){if(X)return X.o}}}(),f.b("computedContext",f.S),f.b("computedContext.getDependenciesCount",f.S.qa),f.b("computedContext.getDependencies",f.S.Va),f.b("computedContext.isInitial",f.S.Ya),f.b("computedContext.registerDependency",f.S.cc),f.b("ignoreDependencies",f.Yd=f.u.G);var C=f.a.Da("_latestValue");f.ta=function(b){function R(){return 0<arguments.length?(R.sb(R[C],arguments[0])&&(R.ya(),R[C]=arguments[0],R.xa()),this):(f.u.cc(R),R[C])}return R[C]=b,f.a.Ba||f.a.extend(R,f.T.fn),f.T.fn.qb(R),f.a.Ab(R,V),f.options.deferUpdates&&f.Ta.deferred(R,!0),R};var V={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};f.a.Ba&&f.a.setPrototypeOf(V,f.T.fn);var L=f.ta.Ma="__ko_proto__";V[L]=f.ta,f.O=function(b){if((b=typeof b=="function"&&b[L])&&b!==V[L]&&b!==f.o.fn[L])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b},f.Za=function(b){return typeof b=="function"&&(b[L]===V[L]||b[L]===f.o.fn[L]&&b.Nc)},f.b("observable",f.ta),f.b("isObservable",f.O),f.b("isWriteableObservable",f.Za),f.b("isWritableObservable",f.Za),f.b("observable.fn",V),f.L(V,"peek",V.v),f.L(V,"valueHasMutated",V.xa),f.L(V,"valueWillMutate",V.ya),f.Ha=function(b){if(b=b||[],typeof b!="object"||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return b=f.ta(b),f.a.Ab(b,f.Ha.fn),b.extend({trackArrayChanges:!0})},f.Ha.fn={remove:function(b){for(var R=this.v(),E=[],X=typeof b!="function"||f.O(b)?function(O){return O===b}:b,A=0;A<R.length;A++){var N=R[A];if(X(N)){if(E.length===0&&this.ya(),R[A]!==N)throw Error("Array modified during remove; cannot remove item");E.push(N),R.splice(A,1),A--}}return E.length&&this.xa(),E},removeAll:function(b){if(b===e){var R=this.v(),E=R.slice(0);return this.ya(),R.splice(0,R.length),this.xa(),E}return b?this.remove(function(X){return 0<=f.a.A(b,X)}):[]},destroy:function(b){var R=this.v(),E=typeof b!="function"||f.O(b)?function(N){return N===b}:b;this.ya();for(var X=R.length-1;0<=X;X--){var A=R[X];E(A)&&(A._destroy=!0)}this.xa()},destroyAll:function(b){return b===e?this.destroy(function(){return!0}):b?this.destroy(function(R){return 0<=f.a.A(b,R)}):[]},indexOf:function(b){var R=this();return f.a.A(R,b)},replace:function(b,R){var E=this.indexOf(b);0<=E&&(this.ya(),this.v()[E]=R,this.xa())},sorted:function(b){var R=this().slice(0);return b?R.sort(b):R.sort()},reversed:function(){return this().slice(0).reverse()}},f.a.Ba&&f.a.setPrototypeOf(f.Ha.fn,f.ta.fn),f.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){f.Ha.fn[b]=function(){var R=this.v();this.ya(),this.zc(R,b,arguments);var E=R[b].apply(R,arguments);return this.xa(),E===R?this:E}}),f.a.D(["slice"],function(b){f.Ha.fn[b]=function(){var R=this();return R[b].apply(R,arguments)}}),f.Pc=function(b){return f.O(b)&&typeof b.remove=="function"&&typeof b.push=="function"},f.b("observableArray",f.Ha),f.b("isObservableArray",f.Pc),f.Ta.trackArrayChanges=function(b,R){function E(){function J(){if(U){var te=[].concat(b.v()||[]),z;b.Wa("arrayChange")&&((!A||1<U)&&(A=f.a.Pb(Y,te,b.Ob)),z=A),Y=te,A=null,U=0,z&&z.length&&b.notifySubscribers(z,"arrayChange")}}X?J():(X=!0,O=b.subscribe(function(){++U},null,"spectate"),Y=[].concat(b.v()||[]),A=null,N=b.subscribe(J))}if(b.Ob={},R&&typeof R=="object"&&f.a.extend(b.Ob,R),b.Ob.sparse=!0,!b.zc){var X=!1,A=null,N,O,U=0,Y,k=b.Qa,H=b.hb;b.Qa=function(J){k&&k.call(b,J),J==="arrayChange"&&E()},b.hb=function(J){H&&H.call(b,J),J!=="arrayChange"||b.Wa("arrayChange")||(N&&N.s(),O&&O.s(),O=N=null,X=!1,Y=e)},b.zc=function(J,te,z){function j(Le,ke,Be){return ee[ee.length]={status:Le,value:ke,index:Be}}if(X&&!U){var ee=[],fe=J.length,_e=z.length,de=0;switch(te){case"push":de=fe;case"unshift":for(te=0;te<_e;te++)j("added",z[te],de+te);break;case"pop":de=fe-1;case"shift":fe&&j("deleted",J[de],de);break;case"splice":te=Math.min(Math.max(0,0>z[0]?fe+z[0]:z[0]),fe);for(var fe=_e===1?fe:Math.min(te+(z[1]||0),fe),_e=te+_e-2,de=Math.max(fe,_e),ye=[],Te=[],Ie=2;te<de;++te,++Ie)te<fe&&Te.push(j("deleted",J[te],te)),te<_e&&ye.push(j("added",z[Ie],te));f.a.Kc(Te,ye);break;default:return}A=ee}}}};var Z=f.a.Da("_state");f.o=f.$=function(b,R,E){function X(){if(0<arguments.length){if(typeof A=="function")A.apply(N.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return N.ra||f.u.cc(X),(N.ka||N.J&&X.Xa())&&X.ha(),N.X}if(typeof b=="object"?E=b:(E=E||{},b&&(E.read=b)),typeof E.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var A=E.write,N={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:E.read,nb:R||E.owner,l:E.disposeWhenNodeIsRemoved||E.l||null,Sa:E.disposeWhen||E.Sa,Rb:null,I:{},V:0,Ic:null};return X[Z]=N,X.Nc=typeof A=="function",f.a.Ba||f.a.extend(X,f.T.fn),f.T.fn.qb(X),f.a.Ab(X,G),E.pure?(N.wb=!0,N.J=!0,f.a.extend(X,I)):E.deferEvaluation&&f.a.extend(X,v),f.options.deferUpdates&&f.Ta.deferred(X,!0),N.l&&(N.jc=!0,N.l.nodeType||(N.l=null)),N.J||E.deferEvaluation||X.ha(),N.l&&X.ja()&&f.a.K.za(N.l,N.Rb=function(){X.s()}),X};var G={equalityComparer:c,qa:function(){return this[Z].V},Va:function(){var b=[];return f.a.P(this[Z].I,function(R,E){b[E.Ka]=E.da}),b},Vb:function(b){if(!this[Z].V)return!1;var R=this.Va();return f.a.A(R,b)!==-1?!0:!!f.a.Lb(R,function(E){return E.Vb&&E.Vb(b)})},uc:function(b,R,E){if(this[Z].wb&&R===this)throw Error("A 'pure' computed must not be called recursively");this[Z].I[b]=E,E.Ka=this[Z].V++,E.La=R.ob()},Xa:function(){var b,R,E=this[Z].I;for(b in E)if(Object.prototype.hasOwnProperty.call(E,b)&&(R=E[b],this.Ia&&R.da.Ja||R.da.Dd(R.La)))return!0},Jd:function(){this.Ia&&!this[Z].rb&&this.Ia(!1)},ja:function(){var b=this[Z];return b.ka||0<b.V},Rd:function(){this.Ja?this[Z].ka&&(this[Z].sa=!0):this.Hc()},$c:function(b){if(b.Hb){var R=b.subscribe(this.Jd,this,"dirty"),E=b.subscribe(this.Rd,this);return{da:b,s:function(){R.s(),E.s()}}}return b.subscribe(this.Hc,this)},Hc:function(){var b=this,R=b.throttleEvaluation;R&&0<=R?(clearTimeout(this[Z].Ic),this[Z].Ic=f.a.setTimeout(function(){b.ha(!0)},R)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var R=this[Z],E=R.Sa,X=!1;if(!R.rb&&!R.ra){if(R.l&&!f.a.Sb(R.l)||E&&E()){if(!R.jc){this.s();return}}else R.jc=!1;R.rb=!0;try{X=this.zd(b)}finally{R.rb=!1}return X}},zd:function(b){var R=this[Z],X=!1,E=R.wb?e:!R.V,X={qd:this,mb:R.I,Qb:R.V};f.u.xc({pd:X,od:g,o:this,Ya:E}),R.I={},R.V=0;var A=this.yd(R,X);return R.V?X=this.sb(R.X,A):(this.s(),X=!0),X&&(R.J?this.Gb():this.notifySubscribers(R.X,"beforeChange"),R.X=A,this.notifySubscribers(R.X,"spectate"),!R.J&&b&&this.notifySubscribers(R.X),this.rc&&this.rc()),E&&this.notifySubscribers(R.X,"awake"),X},yd:function(b,R){try{var E=b.Wc;return b.nb?E.call(b.nb):E()}finally{f.u.end(),R.Qb&&!b.J&&f.a.P(R.mb,p),b.sa=b.ka=!1}},v:function(b){var R=this[Z];return(R.ka&&(b||!R.V)||R.J&&this.Xa())&&this.ha(),R.X},ub:function(b){f.T.fn.ub.call(this,b),this.nc=function(){return this[Z].J||(this[Z].sa?this.ha():this[Z].ka=!1),this[Z].X},this.Ia=function(R){this.pc(this[Z].X),this[Z].ka=!0,R&&(this[Z].sa=!0),this.qc(this,!R)}},s:function(){var b=this[Z];!b.J&&b.I&&f.a.P(b.I,function(R,E){E.s&&E.s()}),b.l&&b.Rb&&f.a.K.yb(b.l,b.Rb),b.I=e,b.V=0,b.ra=!0,b.sa=!1,b.ka=!1,b.J=!1,b.l=e,b.Sa=e,b.Wc=e,this.Nc||(b.nb=e)}},I={Qa:function(b){var R=this,E=R[Z];if(!E.ra&&E.J&&b=="change"){if(E.J=!1,E.sa||R.Xa())E.I=null,E.V=0,R.ha()&&R.Gb();else{var X=[];f.a.P(E.I,function(A,N){X[N.Ka]=A}),f.a.D(X,function(A,N){var O=E.I[A],U=R.$c(O.da);U.Ka=N,U.La=O.La,E.I[A]=U}),R.Xa()&&R.ha()&&R.Gb()}E.ra||R.notifySubscribers(E.X,"awake")}},hb:function(b){var R=this[Z];R.ra||b!="change"||this.Wa("change")||(f.a.P(R.I,function(E,X){X.s&&(R.I[E]={da:X.da,Ka:X.Ka,La:X.La},X.s())}),R.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var b=this[Z];return b.J&&(b.sa||this.Xa())&&this.ha(),f.T.fn.ob.call(this)}},v={Qa:function(b){b!="change"&&b!="beforeChange"||this.v()}};f.a.Ba&&f.a.setPrototypeOf(G,f.T.fn);var P=f.ta.Ma;G[P]=f.o,f.Oc=function(b){return typeof b=="function"&&b[P]===G[P]},f.Fd=function(b){return f.Oc(b)&&b[Z]&&b[Z].wb},f.b("computed",f.o),f.b("dependentObservable",f.o),f.b("isComputed",f.Oc),f.b("isPureComputed",f.Fd),f.b("computed.fn",G),f.L(G,"peek",G.v),f.L(G,"dispose",G.s),f.L(G,"isActive",G.ja),f.L(G,"getDependenciesCount",G.qa),f.L(G,"getDependencies",G.Va),f.xb=function(b,R){return typeof b=="function"?f.o(b,R,{pure:!0}):(b=f.a.extend({},b),b.pure=!0,f.o(b,R))},f.b("pureComputed",f.xb),function(){function b(X,A,N){if(N=N||new E,X=A(X),typeof X!="object"||X===null||X===e||X instanceof RegExp||X instanceof Date||X instanceof String||X instanceof Number||X instanceof Boolean)return X;var O=X instanceof Array?[]:{};return N.save(X,O),R(X,function(U){var Y=A(X[U]);switch(typeof Y){case"boolean":case"number":case"string":case"function":O[U]=Y;break;case"object":case"undefined":var k=N.get(Y);O[U]=k!==e?k:b(Y,A,N)}}),O}function R(X,A){if(X instanceof Array){for(var N=0;N<X.length;N++)A(N);typeof X.toJSON=="function"&&A("toJSON")}else for(N in X)A(N)}function E(){this.keys=[],this.values=[]}f.ad=function(X){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(X,function(A){for(var N=0;f.O(A)&&10>N;N++)A=A();return A})},f.toJSON=function(X,A,N){return X=f.ad(X),f.a.hc(X,A,N)},E.prototype={constructor:E,save:function(X,A){var N=f.a.A(this.keys,X);0<=N?this.values[N]=A:(this.keys.push(X),this.values.push(A))},get:function(X){return X=f.a.A(this.keys,X),0<=X?this.values[X]:e}}}(),f.b("toJS",f.ad),f.b("toJSON",f.toJSON),f.Wd=function(b,R,E){function X(A){var N=f.xb(b,E).extend({ma:"always"}),O=N.subscribe(function(U){U&&(O.s(),A(U))});return N.notifySubscribers(N.v()),O}return typeof Promise!="function"||R?X(R.bind(E)):new Promise(X)},f.b("when",f.Wd),function(){f.w={M:function(b){switch(f.a.R(b)){case"option":return b.__ko__hasDomDataOptionValue__===!0?f.a.g.get(b,f.c.options.$b):7>=f.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case"select":return 0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex]):e;default:return b.value}},cb:function(b,R,E){switch(f.a.R(b)){case"option":typeof R=="string"?(f.a.g.set(b,f.c.options.$b,e),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=R):(f.a.g.set(b,f.c.options.$b,R),b.__ko__hasDomDataOptionValue__=!0,b.value=typeof R=="number"?R:"");break;case"select":(R===""||R===null)&&(R=e);for(var X=-1,A=0,N=b.options.length,O;A<N;++A)if(O=f.w.M(b.options[A]),O==R||O===""&&R===e){X=A;break}(E||0<=X||R===e&&1<b.size)&&(b.selectedIndex=X,f.a.W===6&&f.a.setTimeout(function(){b.selectedIndex=X},0));break;default:(R===null||R===e)&&(R=""),b.value=R}}}}(),f.b("selectExtensions",f.w),f.b("selectExtensions.readValue",f.w.M),f.b("selectExtensions.writeValue",f.w.cb),f.m=function(){function b(U){U=f.a.Db(U),U.charCodeAt(0)===123&&(U=U.slice(1,-1)),U+=` + */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(b,R){return b===null||typeof b in x?b===R:!1}function d(b,R){var E;return function(){E||(E=f.a.setTimeout(function(){E=e,b()},R))}}function u(b,R){var E;return function(){clearTimeout(E),E=f.a.setTimeout(b,R)}}function h(b,R){R&&R!=="change"?R==="beforeChange"?this.pc(b):this.gb(b,R):this.qc(b)}function p(b,R){R!==null&&R.s&&R.s()}function g(b,R){var E=this.qd,X=E[Z];X.ra||(this.Qb&&this.mb[R]?(E.uc(R,b,this.mb[R]),this.mb[R]=null,--this.Qb):X.I[R]||E.uc(R,b,X.J?{da:b}:E.$c(b)),b.Ja&&b.gd())}var f=typeof s<"u"?s:{};f.b=function(b,R){for(var E=b.split("."),X=f,A=0;A<E.length-1;A++)X=X[E[A]];X[E[E.length-1]]=R},f.L=function(b,R,E){b[R]=E},f.version="3.5.1",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=function(){function b(z,j){for(var ee in z)A.call(z,ee)&&j(ee,z[ee])}function R(z,j){if(j)for(var ee in j)A.call(j,ee)&&(z[ee]=j[ee]);return z}function E(z,j){return z.__proto__=j,z}function X(z,j,ee,fe){var Te=z[j].match(J)||[];f.a.D(ee.match(J),function(de){f.a.Na(Te,de,fe)}),z[j]=Te.join(" ")}var A=Object.prototype.hasOwnProperty,N={__proto__:[]}instanceof Array,O=typeof Symbol=="function",U={},Y={};U[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],U.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),b(U,function(z,j){if(j.length)for(var ee=0,fe=j.length;ee<fe;ee++)Y[j[ee]]=z});var k={propertychange:!0},H=n&&function(){for(var z=3,j=n.createElement("div"),ee=j.getElementsByTagName("i");j.innerHTML="<!--[if gt IE "+ ++z+"]><i></i><![endif]-->",ee[0];);return 4<z?z:e}(),J=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(z,j,ee){for(var fe=0,Te=z.length;fe<Te;fe++)j.call(ee,z[fe],fe,z)},A:typeof Array.prototype.indexOf=="function"?function(z,j){return Array.prototype.indexOf.call(z,j)}:function(z,j){for(var ee=0,fe=z.length;ee<fe;ee++)if(z[ee]===j)return ee;return-1},Lb:function(z,j,ee){for(var fe=0,Te=z.length;fe<Te;fe++)if(j.call(ee,z[fe],fe,z))return z[fe];return e},Pa:function(z,j){var ee=f.a.A(z,j);0<ee?z.splice(ee,1):ee===0&&z.shift()},wc:function(z){var j=[];return z&&f.a.D(z,function(ee){0>f.a.A(j,ee)&&j.push(ee)}),j},Mb:function(z,j,ee){var fe=[];if(z)for(var Te=0,de=z.length;Te<de;Te++)fe.push(j.call(ee,z[Te],Te));return fe},jb:function(z,j,ee){var fe=[];if(z)for(var Te=0,de=z.length;Te<de;Te++)j.call(ee,z[Te],Te)&&fe.push(z[Te]);return fe},Nb:function(z,j){if(j instanceof Array)z.push.apply(z,j);else for(var ee=0,fe=j.length;ee<fe;ee++)z.push(j[ee]);return z},Na:function(z,j,ee){var fe=f.a.A(f.a.bc(z),j);0>fe?ee&&z.push(j):ee||z.splice(fe,1)},Ba:N,extend:R,setPrototypeOf:E,Ab:N?E:R,P:b,Ga:function(z,j,ee){if(!z)return z;var fe={},Te;for(Te in z)A.call(z,Te)&&(fe[Te]=j.call(ee,z[Te],Te,z));return fe},Tb:function(z){for(;z.firstChild;)f.removeNode(z.firstChild)},Yb:function(z){z=f.a.la(z);for(var j=(z[0]&&z[0].ownerDocument||n).createElement("div"),ee=0,fe=z.length;ee<fe;ee++)j.appendChild(f.oa(z[ee]));return j},Ca:function(z,j){for(var ee=0,fe=z.length,Te=[];ee<fe;ee++){var de=z[ee].cloneNode(!0);Te.push(j?f.oa(de):de)}return Te},va:function(z,j){if(f.a.Tb(z),j)for(var ee=0,fe=j.length;ee<fe;ee++)z.appendChild(j[ee])},Xc:function(z,j){var ee=z.nodeType?[z]:z;if(0<ee.length){for(var fe=ee[0],Te=fe.parentNode,de=0,xe=j.length;de<xe;de++)Te.insertBefore(j[de],fe);for(de=0,xe=ee.length;de<xe;de++)f.removeNode(ee[de])}},Ua:function(z,j){if(z.length){for(j=j.nodeType===8&&j.parentNode||j;z.length&&z[0].parentNode!==j;)z.splice(0,1);for(;1<z.length&&z[z.length-1].parentNode!==j;)z.length--;if(1<z.length){var ee=z[0],fe=z[z.length-1];for(z.length=0;ee!==fe;)z.push(ee),ee=ee.nextSibling;z.push(fe)}}return z},Zc:function(z,j){7>H?z.setAttribute("selected",j):z.selected=j},Db:function(z){return z===null||z===e?"":z.trim?z.trim():z.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(z,j){return z=z||"",j.length>z.length?!1:z.substring(0,j.length)===j},vd:function(z,j){if(z===j)return!0;if(z.nodeType===11)return!1;if(j.contains)return j.contains(z.nodeType!==1?z.parentNode:z);if(j.compareDocumentPosition)return(j.compareDocumentPosition(z)&16)==16;for(;z&&z!=j;)z=z.parentNode;return!!z},Sb:function(z){return f.a.vd(z,z.ownerDocument.documentElement)},kd:function(z){return!!f.a.Lb(z,f.a.Sb)},R:function(z){return z&&z.tagName&&z.tagName.toLowerCase()},Ac:function(z){return f.onError?function(){try{return z.apply(this,arguments)}catch(j){throw f.onError&&f.onError(j),j}}:z},setTimeout:function(z,j){return setTimeout(f.a.Ac(z),j)},Gc:function(z){setTimeout(function(){throw f.onError&&f.onError(z),z},0)},B:function(z,j,ee){var fe=f.a.Ac(ee);if(ee=k[j],f.options.useOnlyNativeEvents||ee||!o)if(ee||typeof z.addEventListener!="function")if(typeof z.attachEvent<"u"){var Te=function(xe){fe.call(z,xe)},de="on"+j;z.attachEvent(de,Te),f.a.K.za(z,function(){z.detachEvent(de,Te)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else z.addEventListener(j,fe,!1);else te||(te=typeof o(z).on=="function"?"on":"bind"),o(z)[te](j,fe)},Fb:function(z,j){if(!z||!z.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(f.a.R(z)==="input"&&z.type&&j.toLowerCase()=="click"?(ee=z.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,f.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof z.dispatchEvent=="function")ee=n.createEvent(Y[j]||"HTMLEvents"),ee.initEvent(j,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,z),z.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&z.click)z.click();else if(typeof z.fireEvent<"u")z.fireEvent("on"+j);else throw Error("Browser doesn't support triggering events");else o(z).trigger(j)},f:function(z){return f.O(z)?z():z},bc:function(z){return f.O(z)?z.v():z},Eb:function(z,j,ee){var fe;j&&(typeof z.classList=="object"?(fe=z.classList[ee?"add":"remove"],f.a.D(j.match(J),function(Te){fe.call(z.classList,Te)})):typeof z.className.baseVal=="string"?X(z.className,"baseVal",j,ee):X(z,"className",j,ee))},Bb:function(z,j){var ee=f.a.f(j);(ee===null||ee===e)&&(ee="");var fe=f.h.firstChild(z);!fe||fe.nodeType!=3||f.h.nextSibling(fe)?f.h.va(z,[z.ownerDocument.createTextNode(ee)]):fe.data=ee,f.a.Ad(z)},Yc:function(z,j){if(z.name=j,7>=H)try{var ee=z.name.replace(/[&<>'"]/g,function(fe){return"&#"+fe.charCodeAt(0)+";"});z.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(z){9<=H&&(z=z.nodeType==1?z:z.parentNode,z.style&&(z.style.zoom=z.style.zoom))},wd:function(z){if(H){var j=z.style.width;z.style.width=0,z.style.width=j}},Pd:function(z,j){z=f.a.f(z),j=f.a.f(j);for(var ee=[],fe=z;fe<=j;fe++)ee.push(fe);return ee},la:function(z){for(var j=[],ee=0,fe=z.length;ee<fe;ee++)j.push(z[ee]);return j},Da:function(z){return O?Symbol(z):z},Zd:H===6,$d:H===7,W:H,Lc:function(z,j){for(var ee=f.a.la(z.getElementsByTagName("input")).concat(f.a.la(z.getElementsByTagName("textarea"))),fe=typeof j=="string"?function(xe){return xe.name===j}:function(xe){return j.test(xe.name)},Te=[],de=ee.length-1;0<=de;de--)fe(ee[de])&&Te.push(ee[de]);return Te},Nd:function(z){return typeof z=="string"&&(z=f.a.Db(z))?r&&r.parse?r.parse(z):new Function("return "+z)():null},hc:function(z,j,ee){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(f.a.f(z),j,ee)},Od:function(z,j,ee){ee=ee||{};var fe=ee.params||{},Te=ee.includeFields||this.Jc,de=z;if(typeof z=="object"&&f.a.R(z)==="form")for(var de=z.action,xe=Te.length-1;0<=xe;xe--)for(var Se=f.a.Lc(z,Te[xe]),Ie=Se.length-1;0<=Ie;Ie--)fe[Se[Ie].name]=Se[Ie].value;j=f.a.f(j);var Le=n.createElement("form");Le.style.display="none",Le.action=de,Le.method="post";for(var ke in j)z=n.createElement("input"),z.type="hidden",z.name=ke,z.value=f.a.hc(f.a.f(j[ke])),Le.appendChild(z);b(fe,function(Be,it){var Gt=n.createElement("input");Gt.type="hidden",Gt.name=Be,Gt.value=it,Le.appendChild(Gt)}),n.body.appendChild(Le),ee.submitter?ee.submitter(Le):Le.submit(),setTimeout(function(){Le.parentNode.removeChild(Le)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.D),f.b("utils.arrayFirst",f.a.Lb),f.b("utils.arrayFilter",f.a.jb),f.b("utils.arrayGetDistinctValues",f.a.wc),f.b("utils.arrayIndexOf",f.a.A),f.b("utils.arrayMap",f.a.Mb),f.b("utils.arrayPushAll",f.a.Nb),f.b("utils.arrayRemoveItem",f.a.Pa),f.b("utils.cloneNodes",f.a.Ca),f.b("utils.createSymbolOrString",f.a.Da),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.Jc),f.b("utils.getFormFields",f.a.Lc),f.b("utils.objectMap",f.a.Ga),f.b("utils.peekObservable",f.a.bc),f.b("utils.postJson",f.a.Od),f.b("utils.parseJson",f.a.Nd),f.b("utils.registerEventHandler",f.a.B),f.b("utils.stringifyJson",f.a.hc),f.b("utils.range",f.a.Pd),f.b("utils.toggleDomNodeCssClass",f.a.Eb),f.b("utils.triggerEvent",f.a.Fb),f.b("utils.unwrapObservable",f.a.f),f.b("utils.objectForEach",f.a.P),f.b("utils.addOrRemoveItem",f.a.Na),f.b("utils.setTextContent",f.a.Bb),f.b("unwrap",f.a.f),Function.prototype.bind||(Function.prototype.bind=function(b){var R=this;if(arguments.length===1)return function(){return R.apply(b,arguments)};var E=Array.prototype.slice.call(arguments,1);return function(){var X=E.slice(0);return X.push.apply(X,arguments),R.apply(b,X)}}),f.a.g=new function(){var b=0,R="__ko__"+new Date().getTime(),E={},X,A;return f.a.W?(X=function(N,O){var U=N[R];if(!U||U==="null"||!E[U]){if(!O)return e;U=N[R]="ko"+b++,E[U]={}}return E[U]},A=function(N){var O=N[R];return O?(delete E[O],N[R]=null,!0):!1}):(X=function(N,O){var U=N[R];return!U&&O&&(U=N[R]={}),U},A=function(N){return N[R]?(delete N[R],!0):!1}),{get:function(N,O){var U=X(N,!1);return U&&U[O]},set:function(N,O,U){(N=X(N,U!==e))&&(N[O]=U)},Ub:function(N,O,U){return N=X(N,!0),N[O]||(N[O]=U)},clear:A,Z:function(){return b+++R}}},f.b("utils.domData",f.a.g),f.b("utils.domData.clear",f.a.g.clear),f.a.K=new function(){function b(O,U){var Y=f.a.g.get(O,X);return Y===e&&U&&(Y=[],f.a.g.set(O,X,Y)),Y}function R(O){var U=b(O,!1);if(U)for(var U=U.slice(0),Y=0;Y<U.length;Y++)U[Y](O);f.a.g.clear(O),f.a.K.cleanExternalData(O),N[O.nodeType]&&E(O.childNodes,!0)}function E(O,U){for(var Y=[],k,H=0;H<O.length;H++)if((!U||O[H].nodeType===8)&&(R(Y[Y.length]=k=O[H]),O[H]!==k))for(;H--&&f.a.A(Y,O[H])==-1;);}var X=f.a.g.Z(),A={1:!0,8:!0,9:!0},N={1:!0,9:!0};return{za:function(O,U){if(typeof U!="function")throw Error("Callback must be a function");b(O,!0).push(U)},yb:function(O,U){var Y=b(O,!1);Y&&(f.a.Pa(Y,U),Y.length==0&&f.a.g.set(O,X,e))},oa:function(O){return f.u.G(function(){A[O.nodeType]&&(R(O),N[O.nodeType]&&E(O.getElementsByTagName("*")))}),O},removeNode:function(O){f.oa(O),O.parentNode&&O.parentNode.removeChild(O)},cleanExternalData:function(O){o&&typeof o.cleanData=="function"&&o.cleanData([O])}}},f.oa=f.a.K.oa,f.removeNode=f.a.K.removeNode,f.b("cleanNode",f.oa),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.K),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.K.za),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.K.yb),function(){var b=[0,"",""],R=[1,"<table>","</table>"],E=[3,"<table><tbody><tr>","</tr></tbody></table>"],X=[1,"<select multiple='multiple'>","</select>"],A={thead:R,tbody:R,tfoot:R,tr:[2,"<table><tbody>","</tbody></table>"],td:E,th:E,option:X,optgroup:X},N=8>=f.a.W;f.a.ua=function(O,U){var Y;if(o){if(o.parseHTML)Y=o.parseHTML(O,U)||[];else if((Y=o.clean([O],U))&&Y[0]){for(var k=Y[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(Y=U)||(Y=n);var k=Y.parentWindow||Y.defaultView||t,H=f.a.Db(O).toLowerCase(),J=Y.createElement("div"),te;for(te=(H=H.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&A[H[1]]||b,H=te[0],te="ignored<div>"+te[1]+O+te[2]+"</div>",typeof k.innerShiv=="function"?J.appendChild(k.innerShiv(te)):(N&&Y.body.appendChild(J),J.innerHTML=te,N&&J.parentNode.removeChild(J));H--;)J=J.lastChild;Y=f.a.la(J.lastChild.childNodes)}return Y},f.a.Md=function(O,U){var Y=f.a.ua(O,U);return Y.length&&Y[0].parentElement||f.a.Yb(Y)},f.a.fc=function(O,U){if(f.a.Tb(O),U=f.a.f(U),U!==null&&U!==e)if(typeof U!="string"&&(U=U.toString()),o)o(O).html(U);else for(var Y=f.a.ua(U,O.ownerDocument),k=0;k<Y.length;k++)O.appendChild(Y[k])}}(),f.b("utils.parseHtmlFragment",f.a.ua),f.b("utils.setHtml",f.a.fc),f.aa=function(){function b(E,X){if(E){if(E.nodeType==8){var A=f.aa.Uc(E.nodeValue);A!=null&&X.push({ud:E,Kd:A})}else if(E.nodeType==1)for(var A=0,N=E.childNodes,O=N.length;A<O;A++)b(N[A],X)}}var R={};return{Xb:function(E){if(typeof E!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var X=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return R[X]=E,"<!--[ko_memo:"+X+"]-->"},bd:function(E,X){var A=R[E];if(A===e)throw Error("Couldn't find any memo with ID "+E+". Perhaps it's already been unmemoized.");try{return A.apply(null,X||[]),!0}finally{delete R[E]}},cd:function(E,X){var A=[];b(E,A);for(var N=0,O=A.length;N<O;N++){var U=A[N].ud,Y=[U];X&&f.a.Nb(Y,X),f.aa.bd(A[N].Kd,Y),U.nodeValue="",U.parentNode&&U.parentNode.removeChild(U)}},Uc:function(E){return(E=E.match(/^\[ko_memo\:(.*?)\]$/))?E[1]:null}}}(),f.b("memoization",f.aa),f.b("memoization.memoize",f.aa.Xb),f.b("memoization.unmemoize",f.aa.bd),f.b("memoization.parseMemoText",f.aa.Uc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.aa.cd),f.na=function(){function b(){if(A){for(var U=A,Y=0,k;O<A;)if(k=X[O++]){if(O>U){if(5e3<=++Y){O=A,f.a.Gc(Error("'Too much recursion' after processing "+Y+" task groups."));break}U=A}try{k()}catch(H){f.a.Gc(H)}}}}function R(){b(),O=A=X.length=0}var E,X=[],A=0,N=1,O=0;return t.MutationObserver?E=function(U){var Y=n.createElement("div");return new MutationObserver(U).observe(Y,{attributes:!0}),function(){Y.classList.toggle("foo")}}(R):E=n&&"onreadystatechange"in n.createElement("script")?function(U){var Y=n.createElement("script");Y.onreadystatechange=function(){Y.onreadystatechange=null,n.documentElement.removeChild(Y),Y=null,U()},n.documentElement.appendChild(Y)}:function(U){setTimeout(U,0)},{scheduler:E,zb:function(U){return A||f.na.scheduler(R),X[A++]=U,N++},cancel:function(U){U=U-(N-A),U>=O&&U<A&&(X[U]=null)},resetForTesting:function(){var U=A-O;return O=A=X.length=0,U},Sd:b}}(),f.b("tasks",f.na),f.b("tasks.schedule",f.na.zb),f.b("tasks.runEarly",f.na.Sd),f.Ta={throttle:function(b,R){b.throttleEvaluation=R;var E=null;return f.$({read:b,write:function(X){clearTimeout(E),E=f.a.setTimeout(function(){b(X)},R)}})},rateLimit:function(b,R){var E,X,A;typeof R=="number"?E=R:(E=R.timeout,X=R.method),b.Hb=!1,A=typeof X=="function"?X:X=="notifyWhenChangesStop"?u:d,b.ub(function(N){return A(N,E,R)})},deferred:function(b,R){if(R!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.ub(function(E){var X,A=!1;return function(){if(!A){f.na.cancel(X),X=f.na.zb(E);try{A=!0,b.notifySubscribers(e,"dirty")}finally{A=!1}}}}))},notify:function(b,R){b.equalityComparer=R=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.Ta),f.ic=function(b,R,E){this.da=b,this.lc=R,this.mc=E,this.Ib=!1,this.fb=this.Jb=null,f.L(this,"dispose",this.s),f.L(this,"disposeWhenNodeIsRemoved",this.l)},f.ic.prototype.s=function(){this.Ib||(this.fb&&f.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},f.ic.prototype.l=function(b){this.Jb=b,f.a.K.za(b,this.fb=this.s.bind(this))},f.T=function(){f.a.Ab(this,_),_.qb(this)};var _={qb:function(b){b.U={change:[]},b.sc=1},subscribe:function(b,R,E){var X=this;E=E||"change";var A=new f.ic(X,R?b.bind(R):b,function(){f.a.Pa(X.U[E],A),X.hb&&X.hb(E)});return X.Qa&&X.Qa(E),X.U[E]||(X.U[E]=[]),X.U[E].push(A),A},notifySubscribers:function(b,R){if(R=R||"change",R==="change"&&this.Gb(),this.Wa(R)){var E=R==="change"&&this.ed||this.U[R].slice(0);try{f.u.xc();for(var X=0,A;A=E[X];++X)A.Ib||A.lc(b)}finally{f.u.end()}}},ob:function(){return this.sc},Dd:function(b){return this.ob()!==b},Gb:function(){++this.sc},ub:function(b){var R=this,E=f.O(R),X,A,N,O,U;R.gb||(R.gb=R.notifySubscribers,R.notifySubscribers=h);var Y=b(function(){R.Ja=!1,E&&O===R&&(O=R.nc?R.nc():R());var k=A||U&&R.sb(N,O);U=A=X=!1,k&&R.gb(N=O)});R.qc=function(k,H){H&&R.Ja||(U=!H),R.ed=R.U.change.slice(0),R.Ja=X=!0,O=k,Y()},R.pc=function(k){X||(N=k,R.gb(k,"beforeChange"))},R.rc=function(){U=!0},R.gd=function(){R.sb(N,R.v(!0))&&(A=!0)}},Wa:function(b){return this.U[b]&&this.U[b].length},Bd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var R=0;return f.a.P(this.U,function(E,X){E!=="dirty"&&(R+=X.length)}),R},sb:function(b,R){return!this.equalityComparer||!this.equalityComparer(b,R)},toString:function(){return"[object Object]"},extend:function(b){var R=this;return b&&f.a.P(b,function(E,X){var A=f.Ta[E];typeof A=="function"&&(R=A(R,X)||R)}),R}};f.L(_,"init",_.qb),f.L(_,"subscribe",_.subscribe),f.L(_,"extend",_.extend),f.L(_,"getSubscriptionsCount",_.Bd),f.a.Ba&&f.a.setPrototypeOf(_,Function.prototype),f.T.fn=_,f.Qc=function(b){return b!=null&&typeof b.subscribe=="function"&&typeof b.notifySubscribers=="function"},f.b("subscribable",f.T),f.b("isSubscribable",f.Qc),f.S=f.u=function(){function b(N){E.push(X),X=N}function R(){X=E.pop()}var E=[],X,A=0;return{xc:b,end:R,cc:function(N){if(X){if(!f.Qc(N))throw Error("Only subscribable things can act as dependencies");X.od.call(X.pd,N,N.fd||(N.fd=++A))}},G:function(N,O,U){try{return b(),N.apply(O,U||[])}finally{R()}},qa:function(){if(X)return X.o.qa()},Va:function(){if(X)return X.o.Va()},Ya:function(){if(X)return X.Ya},o:function(){if(X)return X.o}}}(),f.b("computedContext",f.S),f.b("computedContext.getDependenciesCount",f.S.qa),f.b("computedContext.getDependencies",f.S.Va),f.b("computedContext.isInitial",f.S.Ya),f.b("computedContext.registerDependency",f.S.cc),f.b("ignoreDependencies",f.Yd=f.u.G);var C=f.a.Da("_latestValue");f.ta=function(b){function R(){return 0<arguments.length?(R.sb(R[C],arguments[0])&&(R.ya(),R[C]=arguments[0],R.xa()),this):(f.u.cc(R),R[C])}return R[C]=b,f.a.Ba||f.a.extend(R,f.T.fn),f.T.fn.qb(R),f.a.Ab(R,V),f.options.deferUpdates&&f.Ta.deferred(R,!0),R};var V={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};f.a.Ba&&f.a.setPrototypeOf(V,f.T.fn);var L=f.ta.Ma="__ko_proto__";V[L]=f.ta,f.O=function(b){if((b=typeof b=="function"&&b[L])&&b!==V[L]&&b!==f.o.fn[L])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b},f.Za=function(b){return typeof b=="function"&&(b[L]===V[L]||b[L]===f.o.fn[L]&&b.Nc)},f.b("observable",f.ta),f.b("isObservable",f.O),f.b("isWriteableObservable",f.Za),f.b("isWritableObservable",f.Za),f.b("observable.fn",V),f.L(V,"peek",V.v),f.L(V,"valueHasMutated",V.xa),f.L(V,"valueWillMutate",V.ya),f.Ha=function(b){if(b=b||[],typeof b!="object"||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return b=f.ta(b),f.a.Ab(b,f.Ha.fn),b.extend({trackArrayChanges:!0})},f.Ha.fn={remove:function(b){for(var R=this.v(),E=[],X=typeof b!="function"||f.O(b)?function(O){return O===b}:b,A=0;A<R.length;A++){var N=R[A];if(X(N)){if(E.length===0&&this.ya(),R[A]!==N)throw Error("Array modified during remove; cannot remove item");E.push(N),R.splice(A,1),A--}}return E.length&&this.xa(),E},removeAll:function(b){if(b===e){var R=this.v(),E=R.slice(0);return this.ya(),R.splice(0,R.length),this.xa(),E}return b?this.remove(function(X){return 0<=f.a.A(b,X)}):[]},destroy:function(b){var R=this.v(),E=typeof b!="function"||f.O(b)?function(N){return N===b}:b;this.ya();for(var X=R.length-1;0<=X;X--){var A=R[X];E(A)&&(A._destroy=!0)}this.xa()},destroyAll:function(b){return b===e?this.destroy(function(){return!0}):b?this.destroy(function(R){return 0<=f.a.A(b,R)}):[]},indexOf:function(b){var R=this();return f.a.A(R,b)},replace:function(b,R){var E=this.indexOf(b);0<=E&&(this.ya(),this.v()[E]=R,this.xa())},sorted:function(b){var R=this().slice(0);return b?R.sort(b):R.sort()},reversed:function(){return this().slice(0).reverse()}},f.a.Ba&&f.a.setPrototypeOf(f.Ha.fn,f.ta.fn),f.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){f.Ha.fn[b]=function(){var R=this.v();this.ya(),this.zc(R,b,arguments);var E=R[b].apply(R,arguments);return this.xa(),E===R?this:E}}),f.a.D(["slice"],function(b){f.Ha.fn[b]=function(){var R=this();return R[b].apply(R,arguments)}}),f.Pc=function(b){return f.O(b)&&typeof b.remove=="function"&&typeof b.push=="function"},f.b("observableArray",f.Ha),f.b("isObservableArray",f.Pc),f.Ta.trackArrayChanges=function(b,R){function E(){function J(){if(U){var te=[].concat(b.v()||[]),z;b.Wa("arrayChange")&&((!A||1<U)&&(A=f.a.Pb(Y,te,b.Ob)),z=A),Y=te,A=null,U=0,z&&z.length&&b.notifySubscribers(z,"arrayChange")}}X?J():(X=!0,O=b.subscribe(function(){++U},null,"spectate"),Y=[].concat(b.v()||[]),A=null,N=b.subscribe(J))}if(b.Ob={},R&&typeof R=="object"&&f.a.extend(b.Ob,R),b.Ob.sparse=!0,!b.zc){var X=!1,A=null,N,O,U=0,Y,k=b.Qa,H=b.hb;b.Qa=function(J){k&&k.call(b,J),J==="arrayChange"&&E()},b.hb=function(J){H&&H.call(b,J),J!=="arrayChange"||b.Wa("arrayChange")||(N&&N.s(),O&&O.s(),O=N=null,X=!1,Y=e)},b.zc=function(J,te,z){function j(Le,ke,Be){return ee[ee.length]={status:Le,value:ke,index:Be}}if(X&&!U){var ee=[],fe=J.length,Te=z.length,de=0;switch(te){case"push":de=fe;case"unshift":for(te=0;te<Te;te++)j("added",z[te],de+te);break;case"pop":de=fe-1;case"shift":fe&&j("deleted",J[de],de);break;case"splice":te=Math.min(Math.max(0,0>z[0]?fe+z[0]:z[0]),fe);for(var fe=Te===1?fe:Math.min(te+(z[1]||0),fe),Te=te+Te-2,de=Math.max(fe,Te),xe=[],Se=[],Ie=2;te<de;++te,++Ie)te<fe&&Se.push(j("deleted",J[te],te)),te<Te&&xe.push(j("added",z[Ie],te));f.a.Kc(Se,xe);break;default:return}A=ee}}}};var Z=f.a.Da("_state");f.o=f.$=function(b,R,E){function X(){if(0<arguments.length){if(typeof A=="function")A.apply(N.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return N.ra||f.u.cc(X),(N.ka||N.J&&X.Xa())&&X.ha(),N.X}if(typeof b=="object"?E=b:(E=E||{},b&&(E.read=b)),typeof E.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var A=E.write,N={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:E.read,nb:R||E.owner,l:E.disposeWhenNodeIsRemoved||E.l||null,Sa:E.disposeWhen||E.Sa,Rb:null,I:{},V:0,Ic:null};return X[Z]=N,X.Nc=typeof A=="function",f.a.Ba||f.a.extend(X,f.T.fn),f.T.fn.qb(X),f.a.Ab(X,G),E.pure?(N.wb=!0,N.J=!0,f.a.extend(X,I)):E.deferEvaluation&&f.a.extend(X,v),f.options.deferUpdates&&f.Ta.deferred(X,!0),N.l&&(N.jc=!0,N.l.nodeType||(N.l=null)),N.J||E.deferEvaluation||X.ha(),N.l&&X.ja()&&f.a.K.za(N.l,N.Rb=function(){X.s()}),X};var G={equalityComparer:c,qa:function(){return this[Z].V},Va:function(){var b=[];return f.a.P(this[Z].I,function(R,E){b[E.Ka]=E.da}),b},Vb:function(b){if(!this[Z].V)return!1;var R=this.Va();return f.a.A(R,b)!==-1?!0:!!f.a.Lb(R,function(E){return E.Vb&&E.Vb(b)})},uc:function(b,R,E){if(this[Z].wb&&R===this)throw Error("A 'pure' computed must not be called recursively");this[Z].I[b]=E,E.Ka=this[Z].V++,E.La=R.ob()},Xa:function(){var b,R,E=this[Z].I;for(b in E)if(Object.prototype.hasOwnProperty.call(E,b)&&(R=E[b],this.Ia&&R.da.Ja||R.da.Dd(R.La)))return!0},Jd:function(){this.Ia&&!this[Z].rb&&this.Ia(!1)},ja:function(){var b=this[Z];return b.ka||0<b.V},Rd:function(){this.Ja?this[Z].ka&&(this[Z].sa=!0):this.Hc()},$c:function(b){if(b.Hb){var R=b.subscribe(this.Jd,this,"dirty"),E=b.subscribe(this.Rd,this);return{da:b,s:function(){R.s(),E.s()}}}return b.subscribe(this.Hc,this)},Hc:function(){var b=this,R=b.throttleEvaluation;R&&0<=R?(clearTimeout(this[Z].Ic),this[Z].Ic=f.a.setTimeout(function(){b.ha(!0)},R)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var R=this[Z],E=R.Sa,X=!1;if(!R.rb&&!R.ra){if(R.l&&!f.a.Sb(R.l)||E&&E()){if(!R.jc){this.s();return}}else R.jc=!1;R.rb=!0;try{X=this.zd(b)}finally{R.rb=!1}return X}},zd:function(b){var R=this[Z],X=!1,E=R.wb?e:!R.V,X={qd:this,mb:R.I,Qb:R.V};f.u.xc({pd:X,od:g,o:this,Ya:E}),R.I={},R.V=0;var A=this.yd(R,X);return R.V?X=this.sb(R.X,A):(this.s(),X=!0),X&&(R.J?this.Gb():this.notifySubscribers(R.X,"beforeChange"),R.X=A,this.notifySubscribers(R.X,"spectate"),!R.J&&b&&this.notifySubscribers(R.X),this.rc&&this.rc()),E&&this.notifySubscribers(R.X,"awake"),X},yd:function(b,R){try{var E=b.Wc;return b.nb?E.call(b.nb):E()}finally{f.u.end(),R.Qb&&!b.J&&f.a.P(R.mb,p),b.sa=b.ka=!1}},v:function(b){var R=this[Z];return(R.ka&&(b||!R.V)||R.J&&this.Xa())&&this.ha(),R.X},ub:function(b){f.T.fn.ub.call(this,b),this.nc=function(){return this[Z].J||(this[Z].sa?this.ha():this[Z].ka=!1),this[Z].X},this.Ia=function(R){this.pc(this[Z].X),this[Z].ka=!0,R&&(this[Z].sa=!0),this.qc(this,!R)}},s:function(){var b=this[Z];!b.J&&b.I&&f.a.P(b.I,function(R,E){E.s&&E.s()}),b.l&&b.Rb&&f.a.K.yb(b.l,b.Rb),b.I=e,b.V=0,b.ra=!0,b.sa=!1,b.ka=!1,b.J=!1,b.l=e,b.Sa=e,b.Wc=e,this.Nc||(b.nb=e)}},I={Qa:function(b){var R=this,E=R[Z];if(!E.ra&&E.J&&b=="change"){if(E.J=!1,E.sa||R.Xa())E.I=null,E.V=0,R.ha()&&R.Gb();else{var X=[];f.a.P(E.I,function(A,N){X[N.Ka]=A}),f.a.D(X,function(A,N){var O=E.I[A],U=R.$c(O.da);U.Ka=N,U.La=O.La,E.I[A]=U}),R.Xa()&&R.ha()&&R.Gb()}E.ra||R.notifySubscribers(E.X,"awake")}},hb:function(b){var R=this[Z];R.ra||b!="change"||this.Wa("change")||(f.a.P(R.I,function(E,X){X.s&&(R.I[E]={da:X.da,Ka:X.Ka,La:X.La},X.s())}),R.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var b=this[Z];return b.J&&(b.sa||this.Xa())&&this.ha(),f.T.fn.ob.call(this)}},v={Qa:function(b){b!="change"&&b!="beforeChange"||this.v()}};f.a.Ba&&f.a.setPrototypeOf(G,f.T.fn);var P=f.ta.Ma;G[P]=f.o,f.Oc=function(b){return typeof b=="function"&&b[P]===G[P]},f.Fd=function(b){return f.Oc(b)&&b[Z]&&b[Z].wb},f.b("computed",f.o),f.b("dependentObservable",f.o),f.b("isComputed",f.Oc),f.b("isPureComputed",f.Fd),f.b("computed.fn",G),f.L(G,"peek",G.v),f.L(G,"dispose",G.s),f.L(G,"isActive",G.ja),f.L(G,"getDependenciesCount",G.qa),f.L(G,"getDependencies",G.Va),f.xb=function(b,R){return typeof b=="function"?f.o(b,R,{pure:!0}):(b=f.a.extend({},b),b.pure=!0,f.o(b,R))},f.b("pureComputed",f.xb),function(){function b(X,A,N){if(N=N||new E,X=A(X),typeof X!="object"||X===null||X===e||X instanceof RegExp||X instanceof Date||X instanceof String||X instanceof Number||X instanceof Boolean)return X;var O=X instanceof Array?[]:{};return N.save(X,O),R(X,function(U){var Y=A(X[U]);switch(typeof Y){case"boolean":case"number":case"string":case"function":O[U]=Y;break;case"object":case"undefined":var k=N.get(Y);O[U]=k!==e?k:b(Y,A,N)}}),O}function R(X,A){if(X instanceof Array){for(var N=0;N<X.length;N++)A(N);typeof X.toJSON=="function"&&A("toJSON")}else for(N in X)A(N)}function E(){this.keys=[],this.values=[]}f.ad=function(X){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(X,function(A){for(var N=0;f.O(A)&&10>N;N++)A=A();return A})},f.toJSON=function(X,A,N){return X=f.ad(X),f.a.hc(X,A,N)},E.prototype={constructor:E,save:function(X,A){var N=f.a.A(this.keys,X);0<=N?this.values[N]=A:(this.keys.push(X),this.values.push(A))},get:function(X){return X=f.a.A(this.keys,X),0<=X?this.values[X]:e}}}(),f.b("toJS",f.ad),f.b("toJSON",f.toJSON),f.Wd=function(b,R,E){function X(A){var N=f.xb(b,E).extend({ma:"always"}),O=N.subscribe(function(U){U&&(O.s(),A(U))});return N.notifySubscribers(N.v()),O}return typeof Promise!="function"||R?X(R.bind(E)):new Promise(X)},f.b("when",f.Wd),function(){f.w={M:function(b){switch(f.a.R(b)){case"option":return b.__ko__hasDomDataOptionValue__===!0?f.a.g.get(b,f.c.options.$b):7>=f.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case"select":return 0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex]):e;default:return b.value}},cb:function(b,R,E){switch(f.a.R(b)){case"option":typeof R=="string"?(f.a.g.set(b,f.c.options.$b,e),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=R):(f.a.g.set(b,f.c.options.$b,R),b.__ko__hasDomDataOptionValue__=!0,b.value=typeof R=="number"?R:"");break;case"select":(R===""||R===null)&&(R=e);for(var X=-1,A=0,N=b.options.length,O;A<N;++A)if(O=f.w.M(b.options[A]),O==R||O===""&&R===e){X=A;break}(E||0<=X||R===e&&1<b.size)&&(b.selectedIndex=X,f.a.W===6&&f.a.setTimeout(function(){b.selectedIndex=X},0));break;default:(R===null||R===e)&&(R=""),b.value=R}}}}(),f.b("selectExtensions",f.w),f.b("selectExtensions.readValue",f.w.M),f.b("selectExtensions.writeValue",f.w.cb),f.m=function(){function b(U){U=f.a.Db(U),U.charCodeAt(0)===123&&(U=U.slice(1,-1)),U+=` ,`;var Y=[],k=U.match(X),H,J=[],te=0;if(1<k.length){for(var z=0,j;j=k[z];++z){var ee=j.charCodeAt(0);if(ee===44){if(0>=te){Y.push(H&&J.length?{key:H,value:J.join("")}:{unknown:H||J.join("")}),H=te=0,J=[];continue}}else if(ee===58){if(!te&&!H&&J.length===1){H=J.pop();continue}}else{if(ee===47&&1<j.length&&(j.charCodeAt(1)===47||j.charCodeAt(1)===42))continue;ee===47&&z&&1<j.length?(ee=k[z-1].match(A))&&!N[ee[0]]&&(U=U.substr(U.indexOf(j)+1),k=U.match(X),z=-1,j="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:H||J.length||ee!==34&&ee!==39||(j=j.slice(1,-1))}J.push(j)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return Y}var R=["true","false","null","undefined"],E=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,X=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),A=/[\])"'A-Za-z0-9_$]+$/,N={in:1,return:1,typeof:1},O={};return{Ra:[],wa:O,ac:b,vb:function(U,Y){function k(ee,fe){var _e;if(!z){var de=f.getBindingHandler(ee);if(de&&de.preprocess&&!(fe=de.preprocess(fe,ee,k)))return;(de=O[ee])&&(_e=fe,0<=f.a.A(R,_e)?_e=!1:(de=_e.match(E),_e=de===null?!1:de[1]?"Object("+de[1]+")"+de[2]:_e),de=_e),de&&J.push("'"+(typeof O[ee]=="string"?O[ee]:ee)+"':function(_z){"+_e+"=_z}")}te&&(fe="function(){return "+fe+" }"),H.push("'"+ee+"':"+fe)}Y=Y||{};var H=[],J=[],te=Y.valueAccessors,z=Y.bindingParams,j=typeof U=="string"?b(U):U;return f.a.D(j,function(ee){k(ee.key||ee.unknown,ee.value)}),J.length&&k("_ko_property_writers","{"+J.join(",")+" }"),H.join(",")},Id:function(U,Y){for(var k=0;k<U.length;k++)if(U[k].key==Y)return!0;return!1},eb:function(U,Y,k,H,J){U&&f.O(U)?!f.Za(U)||J&&U.v()===H||U(H):(U=Y.get("_ko_property_writers"))&&U[k]&&U[k](H)}}}(),f.b("expressionRewriting",f.m),f.b("expressionRewriting.bindingRewriteValidators",f.m.Ra),f.b("expressionRewriting.parseObjectLiteral",f.m.ac),f.b("expressionRewriting.preProcessBindings",f.m.vb),f.b("expressionRewriting._twoWayBindings",f.m.wa),f.b("jsonExpressionRewriting",f.m),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.m.vb),function(){function b(k){return k.nodeType==8&&N.test(A?k.text:k.nodeValue)}function R(k){return k.nodeType==8&&O.test(A?k.text:k.nodeValue)}function E(k,H){for(var J=k,te=1,z=[];J=J.nextSibling;){if(R(J)&&(f.a.g.set(J,Y,!0),te--,te===0))return z;z.push(J),b(J)&&te++}if(!H)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function X(k,H){var J=E(k,H);return J?0<J.length?J[J.length-1].nextSibling:k.nextSibling:null}var A=n&&n.createComment("test").text==="<!--test-->",N=A?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,O=A?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,U={ul:!0,ol:!0},Y="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(k){return b(k)?E(k):k.childNodes},Ea:function(k){if(b(k)){k=f.h.childNodes(k);for(var H=0,J=k.length;H<J;H++)f.removeNode(k[H])}else f.a.Tb(k)},va:function(k,H){if(b(k)){f.h.Ea(k);for(var J=k.nextSibling,te=0,z=H.length;te<z;te++)J.parentNode.insertBefore(H[te],J)}else f.a.va(k,H)},Vc:function(k,H){var J;b(k)?(J=k.nextSibling,k=k.parentNode):J=k.firstChild,J?H!==J&&k.insertBefore(H,J):k.appendChild(H)},Wb:function(k,H,J){J?(J=J.nextSibling,b(k)&&(k=k.parentNode),J?H!==J&&k.insertBefore(H,J):k.appendChild(H)):f.h.Vc(k,H)},firstChild:function(k){if(b(k))return!k.nextSibling||R(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&R(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(b(k)&&(k=X(k)),k.nextSibling&&R(k.nextSibling)){var H=k.nextSibling;if(R(H)&&!f.a.g.get(H,Y))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:b,Vd:function(k){return(k=(A?k.text:k.nodeValue).match(N))?k[1]:null},Sc:function(k){if(U[f.a.R(k)]){var H=k.firstChild;if(H)do if(H.nodeType===1){var J;J=H.firstChild;var te=null;if(J)do if(te)te.push(J);else if(b(J)){var z=X(J,!0);z?J=z:te=[J]}else R(J)&&(te=[J]);while(J=J.nextSibling);if(J=te)for(te=H.nextSibling,z=0;z<J.length;z++)te?k.insertBefore(J[z],te):k.appendChild(J[z])}while(H=H.nextSibling)}}}}(),f.b("virtualElements",f.h),f.b("virtualElements.allowedBindings",f.h.ea),f.b("virtualElements.emptyNode",f.h.Ea),f.b("virtualElements.insertAfter",f.h.Wb),f.b("virtualElements.prepend",f.h.Vc),f.b("virtualElements.setDomNodeChildren",f.h.va),function(){f.ga=function(){this.nd={}},f.a.extend(f.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind")!=null||f.j.getComponentNameForNode(b);case 8:return f.h.Cd(b);default:return!1}},getBindings:function(b,R){var E=this.getBindingsString(b,R),E=E?this.parseBindingsString(E,R,b):null;return f.j.tc(E,b,R,!1)},getBindingAccessors:function(b,R){var E=this.getBindingsString(b,R),E=E?this.parseBindingsString(E,R,b,{valueAccessors:!0}):null;return f.j.tc(E,b,R,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return f.h.Vd(b);default:return null}},parseBindingsString:function(b,R,E,X){try{var A=this.nd,N=b+(X&&X.valueAccessors||""),O;if(!(O=A[N])){var U,Y="with($context){with($data||{}){return{"+f.m.vb(b,X)+"}}}";U=new Function("$context","$element",Y),O=A[N]=U}return O(R,E)}catch(k){throw k.message=`Unable to parse bindings. +|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),A=/[\])"'A-Za-z0-9_$]+$/,N={in:1,return:1,typeof:1},O={};return{Ra:[],wa:O,ac:b,vb:function(U,Y){function k(ee,fe){var Te;if(!z){var de=f.getBindingHandler(ee);if(de&&de.preprocess&&!(fe=de.preprocess(fe,ee,k)))return;(de=O[ee])&&(Te=fe,0<=f.a.A(R,Te)?Te=!1:(de=Te.match(E),Te=de===null?!1:de[1]?"Object("+de[1]+")"+de[2]:Te),de=Te),de&&J.push("'"+(typeof O[ee]=="string"?O[ee]:ee)+"':function(_z){"+Te+"=_z}")}te&&(fe="function(){return "+fe+" }"),H.push("'"+ee+"':"+fe)}Y=Y||{};var H=[],J=[],te=Y.valueAccessors,z=Y.bindingParams,j=typeof U=="string"?b(U):U;return f.a.D(j,function(ee){k(ee.key||ee.unknown,ee.value)}),J.length&&k("_ko_property_writers","{"+J.join(",")+" }"),H.join(",")},Id:function(U,Y){for(var k=0;k<U.length;k++)if(U[k].key==Y)return!0;return!1},eb:function(U,Y,k,H,J){U&&f.O(U)?!f.Za(U)||J&&U.v()===H||U(H):(U=Y.get("_ko_property_writers"))&&U[k]&&U[k](H)}}}(),f.b("expressionRewriting",f.m),f.b("expressionRewriting.bindingRewriteValidators",f.m.Ra),f.b("expressionRewriting.parseObjectLiteral",f.m.ac),f.b("expressionRewriting.preProcessBindings",f.m.vb),f.b("expressionRewriting._twoWayBindings",f.m.wa),f.b("jsonExpressionRewriting",f.m),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.m.vb),function(){function b(k){return k.nodeType==8&&N.test(A?k.text:k.nodeValue)}function R(k){return k.nodeType==8&&O.test(A?k.text:k.nodeValue)}function E(k,H){for(var J=k,te=1,z=[];J=J.nextSibling;){if(R(J)&&(f.a.g.set(J,Y,!0),te--,te===0))return z;z.push(J),b(J)&&te++}if(!H)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function X(k,H){var J=E(k,H);return J?0<J.length?J[J.length-1].nextSibling:k.nextSibling:null}var A=n&&n.createComment("test").text==="<!--test-->",N=A?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,O=A?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,U={ul:!0,ol:!0},Y="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(k){return b(k)?E(k):k.childNodes},Ea:function(k){if(b(k)){k=f.h.childNodes(k);for(var H=0,J=k.length;H<J;H++)f.removeNode(k[H])}else f.a.Tb(k)},va:function(k,H){if(b(k)){f.h.Ea(k);for(var J=k.nextSibling,te=0,z=H.length;te<z;te++)J.parentNode.insertBefore(H[te],J)}else f.a.va(k,H)},Vc:function(k,H){var J;b(k)?(J=k.nextSibling,k=k.parentNode):J=k.firstChild,J?H!==J&&k.insertBefore(H,J):k.appendChild(H)},Wb:function(k,H,J){J?(J=J.nextSibling,b(k)&&(k=k.parentNode),J?H!==J&&k.insertBefore(H,J):k.appendChild(H)):f.h.Vc(k,H)},firstChild:function(k){if(b(k))return!k.nextSibling||R(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&R(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(b(k)&&(k=X(k)),k.nextSibling&&R(k.nextSibling)){var H=k.nextSibling;if(R(H)&&!f.a.g.get(H,Y))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:b,Vd:function(k){return(k=(A?k.text:k.nodeValue).match(N))?k[1]:null},Sc:function(k){if(U[f.a.R(k)]){var H=k.firstChild;if(H)do if(H.nodeType===1){var J;J=H.firstChild;var te=null;if(J)do if(te)te.push(J);else if(b(J)){var z=X(J,!0);z?J=z:te=[J]}else R(J)&&(te=[J]);while(J=J.nextSibling);if(J=te)for(te=H.nextSibling,z=0;z<J.length;z++)te?k.insertBefore(J[z],te):k.appendChild(J[z])}while(H=H.nextSibling)}}}}(),f.b("virtualElements",f.h),f.b("virtualElements.allowedBindings",f.h.ea),f.b("virtualElements.emptyNode",f.h.Ea),f.b("virtualElements.insertAfter",f.h.Wb),f.b("virtualElements.prepend",f.h.Vc),f.b("virtualElements.setDomNodeChildren",f.h.va),function(){f.ga=function(){this.nd={}},f.a.extend(f.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind")!=null||f.j.getComponentNameForNode(b);case 8:return f.h.Cd(b);default:return!1}},getBindings:function(b,R){var E=this.getBindingsString(b,R),E=E?this.parseBindingsString(E,R,b):null;return f.j.tc(E,b,R,!1)},getBindingAccessors:function(b,R){var E=this.getBindingsString(b,R),E=E?this.parseBindingsString(E,R,b,{valueAccessors:!0}):null;return f.j.tc(E,b,R,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return f.h.Vd(b);default:return null}},parseBindingsString:function(b,R,E,X){try{var A=this.nd,N=b+(X&&X.valueAccessors||""),O;if(!(O=A[N])){var U,Y="with($context){with($data||{}){return{"+f.m.vb(b,X)+"}}}";U=new Function("$context","$element",Y),O=A[N]=U}return O(R,E)}catch(k){throw k.message=`Unable to parse bindings. Bindings value: `+b+` -Message: `+k.message,k}}}),f.ga.instance=new f.ga}(),f.b("bindingProvider",f.ga),function(){function b(de){var ye=(de=f.a.g.get(de,_e))&&de.N;ye&&(de.N=null,ye.Tc())}function R(de,ye,Te){this.node=de,this.yc=ye,this.kb=[],this.H=!1,ye.N||f.a.K.za(de,b),Te&&Te.N&&(Te.N.kb.push(de),this.Kb=Te)}function E(de){return function(){return de}}function X(de){return de()}function A(de){return f.a.Ga(f.u.G(de),function(ye,Te){return function(){return de()[Te]}})}function N(de,ye,Te){return typeof de=="function"?A(de.bind(null,ye,Te)):f.a.Ga(de,E)}function O(de,ye){return A(this.getBindings.bind(this,de,ye))}function U(de,ye){var Te=f.h.firstChild(ye);if(Te){var Ie,Le=f.ga.instance,ke=Le.preprocessNode;if(ke){for(;Ie=Te;)Te=f.h.nextSibling(Ie),ke.call(Le,Ie);Te=f.h.firstChild(ye)}for(;Ie=Te;)Te=f.h.nextSibling(Ie),Y(de,Ie)}f.i.ma(ye,f.i.H)}function Y(de,ye){var Te=de,Ie=ye.nodeType===1;Ie&&f.h.Sc(ye),(Ie||f.ga.instance.nodeHasBindings(ye))&&(Te=H(ye,null,de).bindingContextForDescendants),Te&&!ee[f.a.R(ye)]&&U(Te,ye)}function k(de){var ye=[],Te={},Ie=[];return f.a.P(de,function Le(ke){if(!Te[ke]){var Be=f.getBindingHandler(ke);Be&&(Be.after&&(Ie.push(ke),f.a.D(Be.after,function(it){if(de[it]){if(f.a.A(Ie,it)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ie.join(", "));Le(it)}}),Ie.length--),ye.push({key:ke,Mc:Be})),Te[ke]=!0}}),ye}function H(de,ye,Te){var Ie=f.a.g.Ub(de,_e,{}),Le=Ie.hd;if(!ye){if(Le)throw Error("You cannot apply bindings multiple times to the same element.");Ie.hd=!0}Le||(Ie.context=Te),Ie.Zb||(Ie.Zb={});var ke;if(ye&&typeof ye!="function")ke=ye;else{var Be=f.ga.instance,it=Be.getBindingAccessors||O,Et=f.$(function(){return(ke=ye?ye(Te,de):it.call(Be,de,Te))&&(Te[te]&&Te[te](),Te[j]&&Te[j]()),ke},null,{l:de});ke&&Et.ja()||(Et=null)}var yt=Te,Ne;if(ke){var Jt=function(){return f.a.Ga(Et?Et():ke,X)},Rt=Et?function(mt){return function(){return X(Et()[mt])}}:function(mt){return ke[mt]};Jt.get=function(mt){return ke[mt]&&X(Rt(mt))},Jt.has=function(mt){return mt in ke},f.i.H in ke&&f.i.subscribe(de,f.i.H,function(){var mt=(0,ke[f.i.H])();if(mt){var on=f.h.childNodes(de);on.length&&mt(on,f.Ec(on[0]))}}),f.i.pa in ke&&(yt=f.i.Cb(de,Te),f.i.subscribe(de,f.i.pa,function(){var mt=(0,ke[f.i.pa])();mt&&f.h.firstChild(de)&&mt(de)})),Ie=k(ke),f.a.D(Ie,function(mt){var on=mt.Mc.init,Ve=mt.Mc.update,Ce=mt.key;if(de.nodeType===8&&!f.h.ea[Ce])throw Error("The binding '"+Ce+"' cannot be used with virtual elements");try{typeof on=="function"&&f.u.G(function(){var rt=on(de,Rt(Ce),Jt,yt.$data,yt);if(rt&&rt.controlsDescendantBindings){if(Ne!==e)throw Error("Multiple bindings ("+Ne+" and "+Ce+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Ne=Ce}}),typeof Ve=="function"&&f.$(function(){Ve(de,Rt(Ce),Jt,yt.$data,yt)},null,{l:de})}catch(rt){throw rt.message='Unable to process binding "'+Ce+": "+ke[Ce]+`" -Message: `+rt.message,rt}})}return Ie=Ne===e,{shouldBindDescendants:Ie,bindingContextForDescendants:Ie&&yt}}function J(de,ye){return de&&de instanceof f.fa?de:new f.fa(de,e,e,ye)}var te=f.a.Da("_subscribable"),z=f.a.Da("_ancestorBindingInfo"),j=f.a.Da("_dataDependency");f.c={};var ee={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(de){return f.c[de]};var fe={};f.fa=function(de,ye,Te,Ie,Le){function ke(){var Rt=yt?Et():Et,mt=f.a.f(Rt);return ye?(f.a.extend(Be,ye),z in ye&&(Be[z]=ye[z])):(Be.$parents=[],Be.$root=mt,Be.ko=f),Be[te]=Ne,it?mt=Be.$data:(Be.$rawData=Rt,Be.$data=mt),Te&&(Be[Te]=mt),Ie&&Ie(Be,ye,mt),ye&&ye[te]&&!f.S.o().Vb(ye[te])&&ye[te](),Jt&&(Be[j]=Jt),Be.$data}var Be=this,it=de===fe,Et=it?e:de,yt=typeof Et=="function"&&!f.O(Et),Ne,Jt=Le&&Le.dataDependency;Le&&Le.exportDependencies?ke():(Ne=f.xb(ke),Ne.v(),Ne.ja()?Ne.equalityComparer=null:Be[te]=e)},f.fa.prototype.createChildContext=function(de,ye,Te,Ie){if(!Ie&&ye&&typeof ye=="object"&&(Ie=ye,ye=Ie.as,Te=Ie.extend),ye&&Ie&&Ie.noChildContext){var Le=typeof de=="function"&&!f.O(de);return new f.fa(fe,this,null,function(ke){Te&&Te(ke),ke[ye]=Le?de():de},Ie)}return new f.fa(de,this,ye,function(ke,Be){ke.$parentContext=Be,ke.$parent=Be.$data,ke.$parents=(Be.$parents||[]).slice(0),ke.$parents.unshift(ke.$parent),Te&&Te(ke)},Ie)},f.fa.prototype.extend=function(de,ye){return new f.fa(fe,this,null,function(Te){f.a.extend(Te,typeof de=="function"?de(Te):de)},ye)};var _e=f.a.g.Z();R.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},R.prototype.sd=function(de){f.a.Pa(this.kb,de),!this.kb.length&&this.H&&this.Cc()},R.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,b),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(de,ye,Te,Ie,Le){var ke=f.a.g.Ub(de,_e,{});return ke.Fa||(ke.Fa=new f.T),Le&&Le.notifyImmediately&&ke.Zb[ye]&&f.u.G(Te,Ie,[de]),ke.Fa.subscribe(Te,Ie,ye)},ma:function(de,ye){var Te=f.a.g.get(de,_e);if(Te&&(Te.Zb[ye]=!0,Te.Fa&&Te.Fa.notifySubscribers(de,ye),ye==f.i.H)){if(Te.N)Te.N.Cc();else if(Te.N===e&&Te.Fa&&Te.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(de,ye){var Te=f.a.g.Ub(de,_e,{});return Te.N||(Te.N=new R(de,Te,ye[z])),ye[z]==Te?ye:ye.extend(function(Ie){Ie[z]=Te})}},f.Td=function(de){return(de=f.a.g.get(de,_e))&&de.context},f.ib=function(de,ye,Te){return de.nodeType===1&&f.h.Sc(de),H(de,ye,J(Te))},f.ld=function(de,ye,Te){return Te=J(Te),f.ib(de,N(ye,Te,de),Te)},f.Oa=function(de,ye){ye.nodeType!==1&&ye.nodeType!==8||U(J(de),ye)},f.vc=function(de,ye,Te){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ye=n.body,!ye)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ye||ye.nodeType!==1&&ye.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");Y(J(de,Te),ye)},f.Dc=function(de){return!de||de.nodeType!==1&&de.nodeType!==8?e:f.Td(de)},f.Ec=function(de){return(de=f.Dc(de))?de.$data:e},f.b("bindingHandlers",f.c),f.b("bindingEvent",f.i),f.b("bindingEvent.subscribe",f.i.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.i.Cb),f.b("applyBindings",f.vc),f.b("applyBindingsToDescendants",f.Oa),f.b("applyBindingAccessorsToNode",f.ib),f.b("applyBindingsToNode",f.ld),f.b("contextFor",f.Dc),f.b("dataFor",f.Ec)}(),function(b){function R(O,U){var Y=Object.prototype.hasOwnProperty.call(A,O)?A[O]:b,k;Y?Y.subscribe(U):(Y=A[O]=new f.T,Y.subscribe(U),E(O,function(H,J){var te=!(!J||!J.synchronous);N[O]={definition:H,Gd:te},delete A[O],k||te?Y.notifySubscribers(H):f.na.zb(function(){Y.notifySubscribers(H)})}),k=!0)}function E(O,U){X("getConfig",[O],function(Y){Y?X("loadComponent",[O,Y],function(k){U(k,Y)}):U(null,null)})}function X(O,U,Y,k){k||(k=f.j.loaders.slice(0));var H=k.shift();if(H){var J=H[O];if(J){var te=!1;if(J.apply(H,U.concat(function(z){te?Y(null):z!==null?Y(z):X(O,U,Y,k)}))!==b&&(te=!0,!H.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else X(O,U,Y,k)}else Y(null)}var A={},N={};f.j={get:function(O,U){var Y=Object.prototype.hasOwnProperty.call(N,O)?N[O]:b;Y?Y.Gd?f.u.G(function(){U(Y.definition)}):f.na.zb(function(){U(Y.definition)}):R(O,U)},Bc:function(O){delete N[O]},oc:X},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)}(),function(){function b(Y,k,H,J){function te(){--j===0&&J(z)}var z={},j=2,ee=H.template;H=H.viewModel,ee?A(k,ee,function(fe){f.j.oc("loadTemplate",[Y,fe],function(_e){z.template=_e,te()})}):te(),H?A(k,H,function(fe){f.j.oc("loadViewModel",[Y,fe],function(_e){z[U]=_e,te()})}):te()}function R(Y,k,H){if(typeof k=="function")H(function(te){return new k(te)});else if(typeof k[U]=="function")H(k[U]);else if("instance"in k){var J=k.instance;H(function(){return J})}else"viewModel"in k?R(Y,k.viewModel,H):Y("Unknown viewModel value: "+k)}function E(Y){switch(f.a.R(Y)){case"script":return f.a.ua(Y.text);case"textarea":return f.a.ua(Y.value);case"template":if(X(Y.content))return f.a.Ca(Y.content.childNodes)}return f.a.Ca(Y.childNodes)}function X(Y){return t.DocumentFragment?Y instanceof DocumentFragment:Y&&Y.nodeType===11}function A(Y,k,H){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(J){J&&typeof J=="object"&&J.Xd&&J.default&&(J=J.default),H(J)}):Y("Uses require, but no AMD loader is present"):H(k)}function N(Y){return function(k){throw Error("Component '"+Y+"': "+k)}}var O={};f.j.register=function(Y,k){if(!k)throw Error("Invalid configuration for "+Y);if(f.j.tb(Y))throw Error("Component "+Y+" is already registered");O[Y]=k},f.j.tb=function(Y){return Object.prototype.hasOwnProperty.call(O,Y)},f.j.unregister=function(Y){delete O[Y],f.j.Bc(Y)},f.j.Fc={getConfig:function(Y,k){k(f.j.tb(Y)?O[Y]:null)},loadComponent:function(Y,k,H){var J=N(Y);A(J,k,function(te){b(Y,J,te,H)})},loadTemplate:function(Y,k,H){if(Y=N(Y),typeof k=="string")H(f.a.ua(k));else if(k instanceof Array)H(k);else if(X(k))H(f.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)H(E(k));else if(typeof k=="string"){var J=n.getElementById(k);J?H(E(J)):Y("Cannot find element with ID "+k)}else Y("Unknown element type: "+k);else Y("Unknown template value: "+k)},loadViewModel:function(Y,k,H){R(N(Y),k,H)}};var U="createViewModel";f.b("components.register",f.j.register),f.b("components.isRegistered",f.j.tb),f.b("components.unregister",f.j.unregister),f.b("components.defaultLoader",f.j.Fc),f.j.loaders.push(f.j.Fc),f.j.dd=O}(),function(){function b(E,X){var A=E.getAttribute("params");if(A){var A=R.parseBindingsString(A,X,E,{valueAccessors:!0,bindingParams:!0}),A=f.a.Ga(A,function(U){return f.o(U,null,{l:E})}),N=f.a.Ga(A,function(U){var Y=U.v();return U.ja()?f.o({read:function(){return f.a.f(U())},write:f.Za(Y)&&function(k){U()(k)},l:E}):Y});return Object.prototype.hasOwnProperty.call(N,"$raw")||(N.$raw=A),N}return{$raw:{}}}f.j.getComponentNameForNode=function(E){var X=f.a.R(E);if(f.j.tb(X)&&(X.indexOf("-")!=-1||""+E=="[object HTMLUnknownElement]"||8>=f.a.W&&E.tagName===X))return X},f.j.tc=function(E,X,A,N){if(X.nodeType===1){var O=f.j.getComponentNameForNode(X);if(O){if(E=E||{},E.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var U={name:O,params:b(X,A)};E.component=N?function(){return U}:U}}return E};var R=new f.ga;9>f.a.W&&(f.j.register=function(E){return function(X){return E.apply(this,arguments)}}(f.j.register),n.createDocumentFragment=function(E){return function(){var X=E(),A=f.j.dd,N;for(N in A);return X}}(n.createDocumentFragment))}(),function(){function b(X,A,N){if(A=A.template,!A)throw Error("Component '"+X+"' has no template");X=f.a.Ca(A),f.h.va(N,X)}function R(X,A,N){var O=X.createViewModel;return O?O.call(X,A,N):A}var E=0;f.c.component={init:function(X,A,N,O,U){function Y(){var z=k&&k.dispose;typeof z=="function"&&z.call(k),J&&J.s(),H=k=J=null}var k,H,J,te=f.a.la(f.h.childNodes(X));return f.h.Ea(X),f.a.K.za(X,Y),f.o(function(){var z=f.a.f(A()),j,ee;if(typeof z=="string"?j=z:(j=f.a.f(z.name),ee=f.a.f(z.params)),!j)throw Error("No component name specified");var fe=f.i.Cb(X,U),_e=H=++E;f.j.get(j,function(de){if(H===_e){if(Y(),!de)throw Error("Unknown component '"+j+"'");b(j,de,X);var ye=R(de,ee,{element:X,templateNodes:te});de=fe.createChildContext(ye,{extend:function(Te){Te.$component=ye,Te.$componentTemplateNodes=te}}),ye&&ye.koDescendantsComplete&&(J=f.i.subscribe(X,f.i.pa,ye.koDescendantsComplete,ye)),k=ye,f.Oa(de,X)}})},null,{l:X}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0}();var w={class:"className",for:"htmlFor"};f.c.attr={update:function(b,R){var E=f.a.f(R())||{};f.a.P(E,function(X,A){A=f.a.f(A);var N=X.indexOf(":"),N="lookupNamespaceURI"in b&&0<N&&b.lookupNamespaceURI(X.substr(0,N)),O=A===!1||A===null||A===e;O?N?b.removeAttributeNS(N,X):b.removeAttribute(X):A=A.toString(),8>=f.a.W&&X in w?(X=w[X],O?b.removeAttribute(X):b[X]=A):O||(N?b.setAttributeNS(N,X,A):b.setAttribute(X,A)),X==="name"&&f.a.Yc(b,O?"":A)})}},function(){f.c.checked={after:["value","attr"],init:function(b,R,E){function X(){var z=b.checked,j=N();if(!f.S.Ya()&&(z||!U&&!f.S.qa())){var ee=f.u.G(R);if(k){var fe=H?ee.v():ee,_e=te;te=j,_e!==j?z&&(f.a.Na(fe,j,!0),f.a.Na(fe,_e,!1)):f.a.Na(fe,j,z),H&&f.Za(ee)&&ee(fe)}else O&&(j===e?j=z:z||(j=e)),f.m.eb(ee,E,"checked",j,!0)}}function A(){var z=f.a.f(R()),j=N();k?(b.checked=0<=f.a.A(z,j),te=j):b.checked=O&&j===e?!!z:N()===z}var N=f.xb(function(){if(E.has("checkedValue"))return f.a.f(E.get("checkedValue"));if(J)return E.has("value")?f.a.f(E.get("value")):b.value}),O=b.type=="checkbox",U=b.type=="radio";if(O||U){var Y=R(),k=O&&f.a.f(Y)instanceof Array,H=!(k&&Y.push&&Y.splice),J=U||k,te=k?N():e;U&&!b.name&&f.c.uniqueName.init(b,function(){return!0}),f.o(X,null,{l:b}),f.a.B(b,"click",X),f.o(A,null,{l:b}),Y=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(b,R){b.value=f.a.f(R())}}}(),f.c.class={update:function(b,R){var E=f.a.Db(f.a.f(R()));f.a.Eb(b,b.__ko__cssValue,!1),b.__ko__cssValue=E,f.a.Eb(b,E,!0)}},f.c.css={update:function(b,R){var E=f.a.f(R());E!==null&&typeof E=="object"?f.a.P(E,function(X,A){A=f.a.f(A),f.a.Eb(b,X,A)}):f.c.class.update(b,R)}},f.c.enable={update:function(b,R){var E=f.a.f(R());E&&b.disabled?b.removeAttribute("disabled"):E||b.disabled||(b.disabled=!0)}},f.c.disable={update:function(b,R){f.c.enable.update(b,function(){return!f.a.f(R())})}},f.c.event={init:function(b,R,E,X,A){var N=R()||{};f.a.P(N,function(O){typeof O=="string"&&f.a.B(b,O,function(U){var Y,k=R()[O];if(k){try{var H=f.a.la(arguments);X=A.$data,H.unshift(X),Y=k.apply(X,H)}finally{Y!==!0&&(U.preventDefault?U.preventDefault():U.returnValue=!1)}E.get(O+"Bubble")===!1&&(U.cancelBubble=!0,U.stopPropagation&&U.stopPropagation())}})})}},f.c.foreach={Rc:function(b){return function(){var R=b(),E=f.a.bc(R);return!E||typeof E.length=="number"?{foreach:R,templateEngine:f.ba.Ma}:(f.a.f(R),{foreach:E.data,as:E.as,noChildContext:E.noChildContext,includeDestroyed:E.includeDestroyed,afterAdd:E.afterAdd,beforeRemove:E.beforeRemove,afterRender:E.afterRender,beforeMove:E.beforeMove,afterMove:E.afterMove,templateEngine:f.ba.Ma})}},init:function(b,R){return f.c.template.init(b,f.c.foreach.Rc(R))},update:function(b,R,E,X,A){return f.c.template.update(b,f.c.foreach.Rc(R),E,X,A)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(b,R,E){function X(O){b.__ko_hasfocusUpdating=!0;var U=b.ownerDocument;if("activeElement"in U){var Y;try{Y=U.activeElement}catch{Y=U.body}O=Y===b}U=R(),f.m.eb(U,E,"hasfocus",O,!0),b.__ko_hasfocusLastValue=O,b.__ko_hasfocusUpdating=!1}var A=X.bind(null,!0),N=X.bind(null,!1);f.a.B(b,"focus",A),f.a.B(b,"focusin",A),f.a.B(b,"blur",N),f.a.B(b,"focusout",N),b.__ko_hasfocusLastValue=!1},update:function(b,R){var E=!!f.a.f(R());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===E||(E?b.focus():b.blur(),!E&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[b,E?"focusin":"focusout"]))}},f.m.wa.hasfocus=!0,f.c.hasFocus=f.c.hasfocus,f.m.wa.hasFocus="hasfocus",f.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.fc(b,R())}},function(){function b(R,E,X){f.c[R]={init:function(A,N,O,U,Y){var k,H,J={},te,z,j;if(E){U=O.get("as");var ee=O.get("noChildContext");j=!(U&&ee),J={as:U,noChildContext:ee,exportDependencies:j}}return z=(te=O.get("completeOn")=="render")||O.has(f.i.pa),f.o(function(){var fe=f.a.f(N()),_e=!X!=!fe,de=!H,ye;(j||_e!==k)&&(z&&(Y=f.i.Cb(A,Y)),_e&&((!E||j)&&(J.dataDependency=f.S.o()),ye=E?Y.createChildContext(typeof fe=="function"?fe:N,J):f.S.qa()?Y.extend(null,J):Y),de&&f.S.qa()&&(H=f.a.Ca(f.h.childNodes(A),!0)),_e?(de||f.h.va(A,f.a.Ca(H)),f.Oa(ye,A)):(f.h.Ea(A),te||f.i.ma(A,f.i.H)),k=_e)},null,{l:A}),{controlsDescendantBindings:!0}}},f.m.Ra[R]=!1,f.h.ea[R]=!0}b("if"),b("ifnot",!1,!0),b("with",!0)}(),f.c.let={init:function(b,R,E,X,A){return R=A.extend(R),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var F={};f.c.options={init:function(b){if(f.a.R(b)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,R,E){function X(){return f.a.jb(b.options,function(ee){return ee.selected})}function A(ee,fe,_e){var de=typeof fe;return de=="function"?fe(ee):de=="string"?ee[fe]:_e}function N(ee,fe){if(z&&k)f.i.ma(b,f.i.H);else if(te.length){var _e=0<=f.a.A(te,f.w.M(fe[0]));f.a.Zc(fe[0],_e),z&&!_e&&f.u.G(f.a.Fb,null,[b,"change"])}}var O=b.multiple,U=b.length!=0&&O?b.scrollTop:null,Y=f.a.f(R()),k=E.get("valueAllowUnset")&&E.has("value"),H=E.get("optionsIncludeDestroyed");R={};var J,te=[];k||(O?te=f.a.Mb(X(),f.w.M):0<=b.selectedIndex&&te.push(f.w.M(b.options[b.selectedIndex]))),Y&&(typeof Y.length>"u"&&(Y=[Y]),J=f.a.jb(Y,function(ee){return H||ee===e||ee===null||!f.a.f(ee._destroy)}),E.has("optionsCaption")&&(Y=f.a.f(E.get("optionsCaption")),Y!==null&&Y!==e&&J.unshift(F)));var z=!1;if(R.beforeRemove=function(ee){b.removeChild(ee)},Y=N,E.has("optionsAfterRender")&&typeof E.get("optionsAfterRender")=="function"&&(Y=function(ee,fe){N(0,fe),f.u.G(E.get("optionsAfterRender"),null,[fe[0],ee!==F?ee:e])}),f.a.ec(b,J,function(ee,fe,_e){return _e.length&&(te=!k&&_e[0].selected?[f.w.M(_e[0])]:[],z=!0),fe=b.ownerDocument.createElement("option"),ee===F?(f.a.Bb(fe,E.get("optionsCaption")),f.w.cb(fe,e)):(_e=A(ee,E.get("optionsValue"),ee),f.w.cb(fe,f.a.f(_e)),ee=A(ee,E.get("optionsText"),_e),f.a.Bb(fe,ee)),[fe]},R,Y),!k){var j;O?j=te.length&&X().length<te.length:j=te.length&&0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex])!==te[0]:te.length||0<=b.selectedIndex,j&&f.u.G(f.a.Fb,null,[b,"change"])}(k||f.S.Ya())&&f.i.ma(b,f.i.H),f.a.wd(b),U&&20<Math.abs(U-b.scrollTop)&&(b.scrollTop=U)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(b,R,E){function X(){var O=R(),U=[];f.a.D(b.getElementsByTagName("option"),function(Y){Y.selected&&U.push(f.w.M(Y))}),f.m.eb(O,E,"selectedOptions",U)}function A(){var O=f.a.f(R()),U=b.scrollTop;O&&typeof O.length=="number"&&f.a.D(b.getElementsByTagName("option"),function(Y){var k=0<=f.a.A(O,f.w.M(Y));Y.selected!=k&&f.a.Zc(Y,k)}),b.scrollTop=U}if(f.a.R(b)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var N;f.i.subscribe(b,f.i.H,function(){N?X():(f.a.B(b,"change",X),N=f.o(A,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(b,R){var E=f.a.f(R()||{});f.a.P(E,function(X,A){if(A=f.a.f(A),(A===null||A===e||A===!1)&&(A=""),o)o(b).css(X,A);else if(/^--/.test(X))b.style.setProperty(X,A);else{X=X.replace(/-(\w)/g,function(O,U){return U.toUpperCase()});var N=b.style[X];b.style[X]=A,A===N||b.style[X]!=N||isNaN(A)||(b.style[X]=A+"px")}})}},f.c.submit={init:function(b,R,E,X,A){if(typeof R()!="function")throw Error("The value for a submit binding must be a function");f.a.B(b,"submit",function(N){var O,U=R();try{O=U.call(A.$data,b)}finally{O!==!0&&(N.preventDefault?N.preventDefault():N.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.Bb(b,R())}},f.h.ea.text=!0,function(){if(t&&t.navigator){var b=function(J){if(J)return parseFloat(J[1])},R=t.navigator.userAgent,E,X,A,N,O;(E=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(O=b(R.match(/Edge\/([^ ]+)$/)))||b(R.match(/Chrome\/([^ ]+)/))||(X=b(R.match(/Version\/([^ ]+) Safari/)))||(A=b(R.match(/Firefox\/([^ ]+)/)))||(N=f.a.W||b(R.match(/MSIE ([^ ]+)/)))||(N=b(R.match(/rv:([^ )]+)/)))}if(8<=N&&10>N)var U=f.a.g.Z(),Y=f.a.g.Z(),k=function(J){var te=this.activeElement;(te=te&&f.a.g.get(te,Y))&&te(J)},H=function(J,te){var z=J.ownerDocument;f.a.g.get(z,U)||(f.a.g.set(z,U,!0),f.a.B(z,"selectionchange",k)),f.a.g.set(J,Y,te)};f.c.textInput={init:function(J,te,z){function j(ke,Be){f.a.B(J,ke,Be)}function ee(){var ke=f.a.f(te());(ke===null||ke===e)&&(ke=""),Te!==e&&ke===Te?f.a.setTimeout(ee,4):J.value!==ke&&(Le=!0,J.value=ke,Le=!1,de=J.value)}function fe(){ye||(Te=J.value,ye=f.a.setTimeout(_e,4))}function _e(){clearTimeout(ye),Te=ye=e;var ke=J.value;de!==ke&&(de=ke,f.m.eb(te(),z,"textInput",ke))}var de=J.value,ye,Te,Ie=f.a.W==9?fe:_e,Le=!1;N&&j("keypress",_e),11>N&&j("propertychange",function(ke){Le||ke.propertyName!=="value"||Ie(ke)}),N==8&&(j("keyup",_e),j("keydown",_e)),H&&(H(J,Ie),j("dragend",fe)),(!N||9<=N)&&j("input",Ie),5>X&&f.a.R(J)==="textarea"?(j("keydown",fe),j("paste",fe),j("cut",fe)):11>E?j("keydown",fe):4>A?(j("DOMAutoComplete",_e),j("dragdrop",_e),j("drop",_e)):O&&J.type==="number"&&j("keydown",fe),j("change",_e),j("blur",_e),f.o(ee,null,{l:J})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(J,te,z){z("textInput",J)}}}(),f.c.uniqueName={init:function(b,R){if(R()){var E="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(b,E)}}},f.c.uniqueName.rd=0,f.c.using={init:function(b,R,E,X,A){var N;return E.has("as")&&(N={as:E.get("as"),noChildContext:E.get("noChildContext")}),R=A.createChildContext(R,N),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(b,R,E){var X=f.a.R(b),A=X=="input";if(!A||b.type!="checkbox"&&b.type!="radio"){var N=[],O=E.get("valueUpdate"),U=!1,Y=null;O&&(typeof O=="string"?N=[O]:N=f.a.wc(O),f.a.Pa(N,"change"));var k=function(){Y=null,U=!1;var te=R(),z=f.w.M(b);f.m.eb(te,E,"value",z)};!f.a.W||!A||b.type!="text"||b.autocomplete=="off"||b.form&&b.form.autocomplete=="off"||f.a.A(N,"propertychange")!=-1||(f.a.B(b,"propertychange",function(){U=!0}),f.a.B(b,"focus",function(){U=!1}),f.a.B(b,"blur",function(){U&&k()})),f.a.D(N,function(te){var z=k;f.a.Ud(te,"after")&&(z=function(){Y=f.w.M(b),f.a.setTimeout(k,0)},te=te.substring(5)),f.a.B(b,te,z)});var H;if(H=A&&b.type=="file"?function(){var te=f.a.f(R());te===null||te===e||te===""?b.value="":f.u.G(k)}:function(){var te=f.a.f(R()),z=f.w.M(b);Y!==null&&te===Y?f.a.setTimeout(H,0):(te!==z||z===e)&&(X==="select"?(z=E.get("valueAllowUnset"),f.w.cb(b,te,z),z||te===f.w.M(b)||f.u.G(k)):f.w.cb(b,te))},X==="select"){var J;f.i.subscribe(b,f.i.H,function(){J?E.get("valueAllowUnset")?H():k():(f.a.B(b,"change",k),J=f.o(H,null,{l:b}))},null,{notifyImmediately:!0})}else f.a.B(b,"change",k),f.o(H,null,{l:b})}else f.ib(b,{checkedValue:R})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(b,R){var E=f.a.f(R()),X=b.style.display!="none";E&&!X?b.style.display="":!E&&X&&(b.style.display="none")}},f.c.hidden={update:function(b,R){f.c.visible.update(b,function(){return!f.a.f(R())})}},function(b){f.c[b]={init:function(R,E,X,A,N){return f.c.event.init.call(this,R,function(){var O={};return O[b]=E(),O},X,A,N)}}}("click"),f.ca=function(){},f.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.ca.prototype.makeTemplateSource=function(b,R){if(typeof b=="string"){R=R||n;var E=R.getElementById(b);if(!E)throw Error("Cannot find template with ID "+b);return new f.C.F(E)}if(b.nodeType==1||b.nodeType==8)return new f.C.ia(b);throw Error("Unknown template type: "+b)},f.ca.prototype.renderTemplate=function(b,R,E,X){return b=this.makeTemplateSource(b,X),this.renderTemplateSource(b,R,E,X)},f.ca.prototype.isTemplateRewritten=function(b,R){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(b,R).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(b,R,E){b=this.makeTemplateSource(b,E),R=R(b.text()),b.text(R),b.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=function(){function b(X,A,N,O){X=f.m.ac(X);for(var U=f.m.Ra,Y=0;Y<X.length;Y++){var k=X[Y].key;if(Object.prototype.hasOwnProperty.call(U,k)){var H=U[k];if(typeof H=="function"){if(k=H(X[Y].value))throw Error(k)}else if(!H)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return N="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(X,{valueAccessors:!0})+" } })()},'"+N.toLowerCase()+"')",O.createJavaScriptEvaluatorBlock(N)+A}var R=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,E=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(X,A,N){A.isTemplateRewritten(X,N)||A.rewriteTemplate(X,function(O){return f.kc.Ld(O,A)},N)},Ld:function(X,A){return X.replace(R,function(N,O,U,Y,k){return b(k,O,U,A)}).replace(E,function(N,O){return b(O,"<!-- ko -->","#comment",A)})},md:function(X,A){return f.aa.Xb(function(N,O){var U=N.nextSibling;U&&U.nodeName.toLowerCase()===A&&f.ib(U,X,O)})}}}(),f.b("__tr_ambtns",f.kc.md),function(){f.C={},f.C.F=function(E){if(this.F=E){var X=f.a.R(E);this.ab=X==="script"?1:X==="textarea"?2:X=="template"&&E.content&&E.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var E=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[E];var X=arguments[0];E==="innerHTML"?f.a.fc(this.F,X):this.F[E]=X};var b=f.a.g.Z()+"_";f.C.F.prototype.data=function(E){if(arguments.length===1)return f.a.g.get(this.F,b+E);f.a.g.set(this.F,b+E,arguments[1])};var R=f.a.g.Z();f.C.F.prototype.nodes=function(){var E=this.F;if(arguments.length==0){var X=f.a.g.get(E,R)||{},A=X.lb||(this.ab===3?E.content:this.ab===4?E:e);if(!A||X.jd){var N=this.text();N&&N!==X.bb&&(A=f.a.Md(N,E.ownerDocument),f.a.g.set(E,R,{lb:A,bb:N,jd:!0}))}return A}X=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(E,R,{lb:X})},f.C.ia=function(E){this.F=E},f.C.ia.prototype=new f.C.F,f.C.ia.prototype.constructor=f.C.ia,f.C.ia.prototype.text=function(){if(arguments.length==0){var E=f.a.g.get(this.F,R)||{};return E.bb===e&&E.lb&&(E.bb=E.lb.innerHTML),E.bb}f.a.g.set(this.F,R,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)}(),function(){function b(Y,k,H){var J;for(k=f.h.nextSibling(k);Y&&(J=Y)!==k;)Y=f.h.nextSibling(J),H(J,Y)}function R(Y,k){if(Y.length){var H=Y[0],J=Y[Y.length-1],te=H.parentNode,z=f.ga.instance,j=z.preprocessNode;if(j){if(b(H,J,function(ee,fe){var _e=ee.previousSibling,de=j.call(z,ee);de&&(ee===H&&(H=de[0]||fe),ee===J&&(J=de[de.length-1]||_e))}),Y.length=0,!H)return;H===J?Y.push(H):(Y.push(H,J),f.a.Ua(Y,te))}b(H,J,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.vc(k,ee)}),b(H,J,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[k])}),f.a.Ua(Y,te)}}function E(Y){return Y.nodeType?Y:0<Y.length?Y[0]:null}function X(Y,k,H,J,te){te=te||{};var z=(Y&&E(Y)||H||{}).ownerDocument,j=te.templateEngine||N;if(f.kc.xd(H,j,z),H=j.renderTemplate(H,J,te,z),typeof H.length!="number"||0<H.length&&typeof H[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(z=!1,k){case"replaceChildren":f.h.va(Y,H),z=!0;break;case"replaceNode":f.a.Xc(Y,H),z=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return z&&(R(H,J),te.afterRender&&f.u.G(te.afterRender,null,[H,J[te.as||"$data"]]),k=="replaceChildren"&&f.i.ma(Y,f.i.H)),H}function A(Y,k,H){return f.O(Y)?Y():typeof Y=="function"?Y(k,H):Y}var N;f.gc=function(Y){if(Y!=e&&!(Y instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");N=Y},f.dc=function(Y,k,H,J,te){if(H=H||{},(H.templateEngine||N)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",J){var z=E(J);return f.$(function(){var ee=k&&k instanceof f.fa?k:new f.fa(k,null,null,null,{exportDependencies:!0}),j=A(Y,ee.$data,ee),ee=X(J,te,j,ee,H);te=="replaceNode"&&(J=ee,z=E(J))},null,{Sa:function(){return!z||!f.a.Sb(z)},l:z&&te=="replaceNode"?z.parentNode:z})}return f.aa.Xb(function(j){f.dc(Y,k,H,j,"replaceNode")})},f.Qd=function(Y,k,H,J,te){function z(Te,Ie){f.u.G(f.a.ec,null,[J,Te,ee,H,j,Ie]),f.i.ma(J,f.i.H)}function j(Te,Ie){R(Ie,fe),H.afterRender&&H.afterRender(Ie,Te),fe=null}function ee(Te,Ie){fe=te.createChildContext(Te,{as:_e,noChildContext:H.noChildContext,extend:function(ke){ke.$index=Ie,_e&&(ke[_e+"Index"]=Ie)}});var Le=A(Y,Te,fe);return X(J,"ignoreTargetNode",Le,fe,H)}var fe,_e=H.as,de=H.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!H.includeDestroyed;if(de||H.beforeRemove||!f.Pc(k))return f.$(function(){var Te=f.a.f(k)||[];typeof Te.length>"u"&&(Te=[Te]),de&&(Te=f.a.jb(Te,function(Ie){return Ie===e||Ie===null||!f.a.f(Ie._destroy)})),z(Te)},null,{l:J});z(k.v());var ye=k.subscribe(function(Te){z(k(),Te)},null,"arrayChange");return ye.l(J),ye};var O=f.a.g.Z(),U=f.a.g.Z();f.c.template={init:function(Y,k){var H=f.a.f(k());if(typeof H=="string"||"name"in H)f.h.Ea(Y);else if("nodes"in H){if(H=H.nodes||[],f.O(H))throw Error('The "nodes" option must be a plain, non-observable array.');var J=H[0]&&H[0].parentNode;J&&f.a.g.get(J,U)||(J=f.a.Yb(H),f.a.g.set(J,U,!0)),new f.C.ia(Y).nodes(J)}else if(H=f.h.childNodes(Y),0<H.length)J=f.a.Yb(H),new f.C.ia(Y).nodes(J);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(Y,k,H,J,te){var z=k();k=f.a.f(z),H=!0,J=null,typeof k=="string"?k={}:(z="name"in k?k.name:Y,"if"in k&&(H=f.a.f(k.if)),H&&"ifnot"in k&&(H=!f.a.f(k.ifnot)),H&&!z&&(H=!1)),"foreach"in k?J=f.Qd(z,H&&k.foreach||[],k,Y,te):H?(H=te,"data"in k&&(H=te.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),J=f.dc(z,H,k,Y)):f.h.Ea(Y),te=J,(k=f.a.g.get(Y,O))&&typeof k.s=="function"&&k.s(),f.a.g.set(Y,O,!te||te.ja&&!te.ja()?e:te)}},f.m.Ra.template=function(Y){return Y=f.m.ac(Y),Y.length==1&&Y[0].unknown||f.m.Id(Y,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0}(),f.b("setTemplateEngine",f.gc),f.b("renderTemplate",f.dc),f.a.Kc=function(b,R,E){if(b.length&&R.length){var X,A,N,O,U;for(X=A=0;(!E||X<E)&&(O=b[A]);++A){for(N=0;U=R[N];++N)if(O.value===U.value){O.moved=U.index,U.moved=O.index,R.splice(N,1),X=N=0;break}X+=N}}},f.a.Pb=function(){function b(R,E,X,A,N){var O=Math.min,U=Math.max,Y=[],k,H=R.length,J,te=E.length,z=te-H||1,j=H+te+1,ee,fe,_e;for(k=0;k<=H;k++)for(fe=ee,Y.push(ee=[]),_e=O(te,k+z),J=U(0,k-1);J<=_e;J++)ee[J]=J?k?R[k-1]===E[J-1]?fe[J-1]:O(fe[J]||j,ee[J-1]||j)+1:J+1:k+1;for(O=[],U=[],z=[],k=H,J=te;k||J;)te=Y[k][J]-1,J&&te===Y[k][J-1]?U.push(O[O.length]={status:X,value:E[--J],index:J}):k&&te===Y[k-1][J]?z.push(O[O.length]={status:A,value:R[--k],index:k}):(--J,--k,N.sparse||O.push({status:"retained",value:E[J]}));return f.a.Kc(z,U,!N.dontLimitMoves&&10*H),O.reverse()}return function(R,E,X){return X=typeof X=="boolean"?{dontLimitMoves:X}:X||{},R=R||[],E=E||[],R.length<E.length?b(R,E,"added","deleted",X):b(E,R,"deleted","added",X)}}(),f.b("utils.compareArrays",f.a.Pb),function(){function b(X,A,N,O,U){var Y=[],k=f.$(function(){var H=A(N,U,f.a.Ua(Y,X))||[];0<Y.length&&(f.a.Xc(Y,H),O&&f.u.G(O,null,[N,H,U])),Y.length=0,f.a.Nb(Y,H)},null,{l:X,Sa:function(){return!f.a.kd(Y)}});return{Y,$:k.ja()?k:e}}var R=f.a.g.Z(),E=f.a.g.Z();f.a.ec=function(X,A,N,O,U,Y){function k(mt){Le={Aa:mt,pb:f.ta(fe++)},j.push(Le),z||Ie.push(Le)}function H(mt){Le=te[mt],fe!==Le.pb.v()&&Te.push(Le),Le.pb(fe++),f.a.Ua(Le.Y,X),j.push(Le)}function J(mt,on){if(mt)for(var Ve=0,Ce=on.length;Ve<Ce;Ve++)f.a.D(on[Ve].Y,function(rt){mt(rt,Ve,on[Ve].Aa)})}A=A||[],typeof A.length>"u"&&(A=[A]),O=O||{};var te=f.a.g.get(X,R),z=!te,j=[],ee=0,fe=0,_e=[],de=[],ye=[],Te=[],Ie=[],Le,ke=0;if(z)f.a.D(A,k);else{if(!Y||te&&te._countWaitingForRemove){var Be=f.a.Mb(te,function(mt){return mt.Aa});Y=f.a.Pb(Be,A,{dontLimitMoves:O.dontLimitMoves,sparse:!0})}for(var Be=0,it,Et,yt;it=Y[Be];Be++)switch(Et=it.moved,yt=it.index,it.status){case"deleted":for(;ee<yt;)H(ee++);Et===e&&(Le=te[ee],Le.$&&(Le.$.s(),Le.$=e),f.a.Ua(Le.Y,X).length&&(O.beforeRemove&&(j.push(Le),ke++,Le.Aa===E?Le=null:ye.push(Le)),Le&&_e.push.apply(_e,Le.Y))),ee++;break;case"added":for(;fe<yt;)H(ee++);Et!==e?(de.push(j.length),H(Et)):k(it.value)}for(;fe<A.length;)H(ee++);j._countWaitingForRemove=ke}f.a.g.set(X,R,j),J(O.beforeMove,Te),f.a.D(_e,O.beforeRemove?f.oa:f.removeNode);var Ne,Jt,Rt;try{Rt=X.ownerDocument.activeElement}catch{}if(de.length)for(;(Be=de.shift())!=e;){for(Le=j[Be],Ne=e;Be;)if((Jt=j[--Be].Y)&&Jt.length){Ne=Jt[Jt.length-1];break}for(A=0;ee=Le.Y[A];Ne=ee,A++)f.h.Wb(X,ee,Ne)}for(Be=0;Le=j[Be];Be++){for(Le.Y||f.a.extend(Le,b(X,N,Le.Aa,U,Le.pb)),A=0;ee=Le.Y[A];Ne=ee,A++)f.h.Wb(X,ee,Ne);!Le.Ed&&U&&(U(Le.Aa,Le.Y,Le.pb),Le.Ed=!0,Ne=Le.Y[Le.Y.length-1])}for(Rt&&X.ownerDocument.activeElement!=Rt&&Rt.focus(),J(O.beforeRemove,ye),Be=0;Be<ye.length;++Be)ye[Be].Aa=E;J(O.afterMove,Te),J(O.afterAdd,Ie)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.ec),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(b,R,E,X){return(R=!(9>f.a.W)&&b.nodes?b.nodes():null)?f.a.la(R.cloneNode(!0).childNodes):(b=b.text(),f.a.ua(b,X))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),function(){f.$a=function(){var R=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(E,X,A,N){if(N=N||n,A=A||{},2>R)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var O=E.data("precompiled");return O||(O=E.text()||"",O=o.template(null,"{{ko_with $item.koBindingContext}}"+O+"{{/ko_with}}"),E.data("precompiled",O)),E=[X.$data],X=o.extend({koBindingContext:X},A.templateOptions),X=o.tmpl(O,E,X),X.appendTo(N.createElement("div")),o.fragments={},X},this.createJavaScriptEvaluatorBlock=function(E){return"{{ko_code ((function() { return "+E+" })()) }}"},this.addTemplate=function(E,X){n.write("<script type='text/html' id='"+E+"'>"+X+"<\/script>")},0<R&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.$a.prototype=new f.ca,f.$a.prototype.constructor=f.$a;var b=new f.$a;0<b.Hd&&f.gc(b),f.b("jqueryTmplTemplateEngine",f.$a)}()})})()})()})();var bCt=ko;typeof window<"u"?(ko=window.ko,typeof O9<"u"?window.ko=O9:delete window.ko):(ko=global.ko,typeof O9<"u"?global.ko=O9:delete global.ko);var CS=bCt;var yLo=T(S(),1);/** +Message: `+k.message,k}}}),f.ga.instance=new f.ga}(),f.b("bindingProvider",f.ga),function(){function b(de){var xe=(de=f.a.g.get(de,Te))&&de.N;xe&&(de.N=null,xe.Tc())}function R(de,xe,Se){this.node=de,this.yc=xe,this.kb=[],this.H=!1,xe.N||f.a.K.za(de,b),Se&&Se.N&&(Se.N.kb.push(de),this.Kb=Se)}function E(de){return function(){return de}}function X(de){return de()}function A(de){return f.a.Ga(f.u.G(de),function(xe,Se){return function(){return de()[Se]}})}function N(de,xe,Se){return typeof de=="function"?A(de.bind(null,xe,Se)):f.a.Ga(de,E)}function O(de,xe){return A(this.getBindings.bind(this,de,xe))}function U(de,xe){var Se=f.h.firstChild(xe);if(Se){var Ie,Le=f.ga.instance,ke=Le.preprocessNode;if(ke){for(;Ie=Se;)Se=f.h.nextSibling(Ie),ke.call(Le,Ie);Se=f.h.firstChild(xe)}for(;Ie=Se;)Se=f.h.nextSibling(Ie),Y(de,Ie)}f.i.ma(xe,f.i.H)}function Y(de,xe){var Se=de,Ie=xe.nodeType===1;Ie&&f.h.Sc(xe),(Ie||f.ga.instance.nodeHasBindings(xe))&&(Se=H(xe,null,de).bindingContextForDescendants),Se&&!ee[f.a.R(xe)]&&U(Se,xe)}function k(de){var xe=[],Se={},Ie=[];return f.a.P(de,function Le(ke){if(!Se[ke]){var Be=f.getBindingHandler(ke);Be&&(Be.after&&(Ie.push(ke),f.a.D(Be.after,function(it){if(de[it]){if(f.a.A(Ie,it)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ie.join(", "));Le(it)}}),Ie.length--),xe.push({key:ke,Mc:Be})),Se[ke]=!0}}),xe}function H(de,xe,Se){var Ie=f.a.g.Ub(de,Te,{}),Le=Ie.hd;if(!xe){if(Le)throw Error("You cannot apply bindings multiple times to the same element.");Ie.hd=!0}Le||(Ie.context=Se),Ie.Zb||(Ie.Zb={});var ke;if(xe&&typeof xe!="function")ke=xe;else{var Be=f.ga.instance,it=Be.getBindingAccessors||O,Gt=f.$(function(){return(ke=xe?xe(Se,de):it.call(Be,de,Se))&&(Se[te]&&Se[te](),Se[j]&&Se[j]()),ke},null,{l:de});ke&&Gt.ja()||(Gt=null)}var gt=Se,Ne;if(ke){var Kt=function(){return f.a.Ga(Gt?Gt():ke,X)},Lt=Gt?function(ut){return function(){return X(Gt()[ut])}}:function(ut){return ke[ut]};Kt.get=function(ut){return ke[ut]&&X(Lt(ut))},Kt.has=function(ut){return ut in ke},f.i.H in ke&&f.i.subscribe(de,f.i.H,function(){var ut=(0,ke[f.i.H])();if(ut){var zn=f.h.childNodes(de);zn.length&&ut(zn,f.Ec(zn[0]))}}),f.i.pa in ke&&(gt=f.i.Cb(de,Se),f.i.subscribe(de,f.i.pa,function(){var ut=(0,ke[f.i.pa])();ut&&f.h.firstChild(de)&&ut(de)})),Ie=k(ke),f.a.D(Ie,function(ut){var zn=ut.Mc.init,cn=ut.Mc.update,be=ut.key;if(de.nodeType===8&&!f.h.ea[be])throw Error("The binding '"+be+"' cannot be used with virtual elements");try{typeof zn=="function"&&f.u.G(function(){var Ve=zn(de,Lt(be),Kt,gt.$data,gt);if(Ve&&Ve.controlsDescendantBindings){if(Ne!==e)throw Error("Multiple bindings ("+Ne+" and "+be+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Ne=be}}),typeof cn=="function"&&f.$(function(){cn(de,Lt(be),Kt,gt.$data,gt)},null,{l:de})}catch(Ve){throw Ve.message='Unable to process binding "'+be+": "+ke[be]+`" +Message: `+Ve.message,Ve}})}return Ie=Ne===e,{shouldBindDescendants:Ie,bindingContextForDescendants:Ie&>}}function J(de,xe){return de&&de instanceof f.fa?de:new f.fa(de,e,e,xe)}var te=f.a.Da("_subscribable"),z=f.a.Da("_ancestorBindingInfo"),j=f.a.Da("_dataDependency");f.c={};var ee={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(de){return f.c[de]};var fe={};f.fa=function(de,xe,Se,Ie,Le){function ke(){var Lt=gt?Gt():Gt,ut=f.a.f(Lt);return xe?(f.a.extend(Be,xe),z in xe&&(Be[z]=xe[z])):(Be.$parents=[],Be.$root=ut,Be.ko=f),Be[te]=Ne,it?ut=Be.$data:(Be.$rawData=Lt,Be.$data=ut),Se&&(Be[Se]=ut),Ie&&Ie(Be,xe,ut),xe&&xe[te]&&!f.S.o().Vb(xe[te])&&xe[te](),Kt&&(Be[j]=Kt),Be.$data}var Be=this,it=de===fe,Gt=it?e:de,gt=typeof Gt=="function"&&!f.O(Gt),Ne,Kt=Le&&Le.dataDependency;Le&&Le.exportDependencies?ke():(Ne=f.xb(ke),Ne.v(),Ne.ja()?Ne.equalityComparer=null:Be[te]=e)},f.fa.prototype.createChildContext=function(de,xe,Se,Ie){if(!Ie&&xe&&typeof xe=="object"&&(Ie=xe,xe=Ie.as,Se=Ie.extend),xe&&Ie&&Ie.noChildContext){var Le=typeof de=="function"&&!f.O(de);return new f.fa(fe,this,null,function(ke){Se&&Se(ke),ke[xe]=Le?de():de},Ie)}return new f.fa(de,this,xe,function(ke,Be){ke.$parentContext=Be,ke.$parent=Be.$data,ke.$parents=(Be.$parents||[]).slice(0),ke.$parents.unshift(ke.$parent),Se&&Se(ke)},Ie)},f.fa.prototype.extend=function(de,xe){return new f.fa(fe,this,null,function(Se){f.a.extend(Se,typeof de=="function"?de(Se):de)},xe)};var Te=f.a.g.Z();R.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},R.prototype.sd=function(de){f.a.Pa(this.kb,de),!this.kb.length&&this.H&&this.Cc()},R.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,b),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(de,xe,Se,Ie,Le){var ke=f.a.g.Ub(de,Te,{});return ke.Fa||(ke.Fa=new f.T),Le&&Le.notifyImmediately&&ke.Zb[xe]&&f.u.G(Se,Ie,[de]),ke.Fa.subscribe(Se,Ie,xe)},ma:function(de,xe){var Se=f.a.g.get(de,Te);if(Se&&(Se.Zb[xe]=!0,Se.Fa&&Se.Fa.notifySubscribers(de,xe),xe==f.i.H)){if(Se.N)Se.N.Cc();else if(Se.N===e&&Se.Fa&&Se.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(de,xe){var Se=f.a.g.Ub(de,Te,{});return Se.N||(Se.N=new R(de,Se,xe[z])),xe[z]==Se?xe:xe.extend(function(Ie){Ie[z]=Se})}},f.Td=function(de){return(de=f.a.g.get(de,Te))&&de.context},f.ib=function(de,xe,Se){return de.nodeType===1&&f.h.Sc(de),H(de,xe,J(Se))},f.ld=function(de,xe,Se){return Se=J(Se),f.ib(de,N(xe,Se,de),Se)},f.Oa=function(de,xe){xe.nodeType!==1&&xe.nodeType!==8||U(J(de),xe)},f.vc=function(de,xe,Se){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(xe=n.body,!xe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!xe||xe.nodeType!==1&&xe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");Y(J(de,Se),xe)},f.Dc=function(de){return!de||de.nodeType!==1&&de.nodeType!==8?e:f.Td(de)},f.Ec=function(de){return(de=f.Dc(de))?de.$data:e},f.b("bindingHandlers",f.c),f.b("bindingEvent",f.i),f.b("bindingEvent.subscribe",f.i.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.i.Cb),f.b("applyBindings",f.vc),f.b("applyBindingsToDescendants",f.Oa),f.b("applyBindingAccessorsToNode",f.ib),f.b("applyBindingsToNode",f.ld),f.b("contextFor",f.Dc),f.b("dataFor",f.Ec)}(),function(b){function R(O,U){var Y=Object.prototype.hasOwnProperty.call(A,O)?A[O]:b,k;Y?Y.subscribe(U):(Y=A[O]=new f.T,Y.subscribe(U),E(O,function(H,J){var te=!(!J||!J.synchronous);N[O]={definition:H,Gd:te},delete A[O],k||te?Y.notifySubscribers(H):f.na.zb(function(){Y.notifySubscribers(H)})}),k=!0)}function E(O,U){X("getConfig",[O],function(Y){Y?X("loadComponent",[O,Y],function(k){U(k,Y)}):U(null,null)})}function X(O,U,Y,k){k||(k=f.j.loaders.slice(0));var H=k.shift();if(H){var J=H[O];if(J){var te=!1;if(J.apply(H,U.concat(function(z){te?Y(null):z!==null?Y(z):X(O,U,Y,k)}))!==b&&(te=!0,!H.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else X(O,U,Y,k)}else Y(null)}var A={},N={};f.j={get:function(O,U){var Y=Object.prototype.hasOwnProperty.call(N,O)?N[O]:b;Y?Y.Gd?f.u.G(function(){U(Y.definition)}):f.na.zb(function(){U(Y.definition)}):R(O,U)},Bc:function(O){delete N[O]},oc:X},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)}(),function(){function b(Y,k,H,J){function te(){--j===0&&J(z)}var z={},j=2,ee=H.template;H=H.viewModel,ee?A(k,ee,function(fe){f.j.oc("loadTemplate",[Y,fe],function(Te){z.template=Te,te()})}):te(),H?A(k,H,function(fe){f.j.oc("loadViewModel",[Y,fe],function(Te){z[U]=Te,te()})}):te()}function R(Y,k,H){if(typeof k=="function")H(function(te){return new k(te)});else if(typeof k[U]=="function")H(k[U]);else if("instance"in k){var J=k.instance;H(function(){return J})}else"viewModel"in k?R(Y,k.viewModel,H):Y("Unknown viewModel value: "+k)}function E(Y){switch(f.a.R(Y)){case"script":return f.a.ua(Y.text);case"textarea":return f.a.ua(Y.value);case"template":if(X(Y.content))return f.a.Ca(Y.content.childNodes)}return f.a.Ca(Y.childNodes)}function X(Y){return t.DocumentFragment?Y instanceof DocumentFragment:Y&&Y.nodeType===11}function A(Y,k,H){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(J){J&&typeof J=="object"&&J.Xd&&J.default&&(J=J.default),H(J)}):Y("Uses require, but no AMD loader is present"):H(k)}function N(Y){return function(k){throw Error("Component '"+Y+"': "+k)}}var O={};f.j.register=function(Y,k){if(!k)throw Error("Invalid configuration for "+Y);if(f.j.tb(Y))throw Error("Component "+Y+" is already registered");O[Y]=k},f.j.tb=function(Y){return Object.prototype.hasOwnProperty.call(O,Y)},f.j.unregister=function(Y){delete O[Y],f.j.Bc(Y)},f.j.Fc={getConfig:function(Y,k){k(f.j.tb(Y)?O[Y]:null)},loadComponent:function(Y,k,H){var J=N(Y);A(J,k,function(te){b(Y,J,te,H)})},loadTemplate:function(Y,k,H){if(Y=N(Y),typeof k=="string")H(f.a.ua(k));else if(k instanceof Array)H(k);else if(X(k))H(f.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)H(E(k));else if(typeof k=="string"){var J=n.getElementById(k);J?H(E(J)):Y("Cannot find element with ID "+k)}else Y("Unknown element type: "+k);else Y("Unknown template value: "+k)},loadViewModel:function(Y,k,H){R(N(Y),k,H)}};var U="createViewModel";f.b("components.register",f.j.register),f.b("components.isRegistered",f.j.tb),f.b("components.unregister",f.j.unregister),f.b("components.defaultLoader",f.j.Fc),f.j.loaders.push(f.j.Fc),f.j.dd=O}(),function(){function b(E,X){var A=E.getAttribute("params");if(A){var A=R.parseBindingsString(A,X,E,{valueAccessors:!0,bindingParams:!0}),A=f.a.Ga(A,function(U){return f.o(U,null,{l:E})}),N=f.a.Ga(A,function(U){var Y=U.v();return U.ja()?f.o({read:function(){return f.a.f(U())},write:f.Za(Y)&&function(k){U()(k)},l:E}):Y});return Object.prototype.hasOwnProperty.call(N,"$raw")||(N.$raw=A),N}return{$raw:{}}}f.j.getComponentNameForNode=function(E){var X=f.a.R(E);if(f.j.tb(X)&&(X.indexOf("-")!=-1||""+E=="[object HTMLUnknownElement]"||8>=f.a.W&&E.tagName===X))return X},f.j.tc=function(E,X,A,N){if(X.nodeType===1){var O=f.j.getComponentNameForNode(X);if(O){if(E=E||{},E.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var U={name:O,params:b(X,A)};E.component=N?function(){return U}:U}}return E};var R=new f.ga;9>f.a.W&&(f.j.register=function(E){return function(X){return E.apply(this,arguments)}}(f.j.register),n.createDocumentFragment=function(E){return function(){var X=E(),A=f.j.dd,N;for(N in A);return X}}(n.createDocumentFragment))}(),function(){function b(X,A,N){if(A=A.template,!A)throw Error("Component '"+X+"' has no template");X=f.a.Ca(A),f.h.va(N,X)}function R(X,A,N){var O=X.createViewModel;return O?O.call(X,A,N):A}var E=0;f.c.component={init:function(X,A,N,O,U){function Y(){var z=k&&k.dispose;typeof z=="function"&&z.call(k),J&&J.s(),H=k=J=null}var k,H,J,te=f.a.la(f.h.childNodes(X));return f.h.Ea(X),f.a.K.za(X,Y),f.o(function(){var z=f.a.f(A()),j,ee;if(typeof z=="string"?j=z:(j=f.a.f(z.name),ee=f.a.f(z.params)),!j)throw Error("No component name specified");var fe=f.i.Cb(X,U),Te=H=++E;f.j.get(j,function(de){if(H===Te){if(Y(),!de)throw Error("Unknown component '"+j+"'");b(j,de,X);var xe=R(de,ee,{element:X,templateNodes:te});de=fe.createChildContext(xe,{extend:function(Se){Se.$component=xe,Se.$componentTemplateNodes=te}}),xe&&xe.koDescendantsComplete&&(J=f.i.subscribe(X,f.i.pa,xe.koDescendantsComplete,xe)),k=xe,f.Oa(de,X)}})},null,{l:X}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0}();var w={class:"className",for:"htmlFor"};f.c.attr={update:function(b,R){var E=f.a.f(R())||{};f.a.P(E,function(X,A){A=f.a.f(A);var N=X.indexOf(":"),N="lookupNamespaceURI"in b&&0<N&&b.lookupNamespaceURI(X.substr(0,N)),O=A===!1||A===null||A===e;O?N?b.removeAttributeNS(N,X):b.removeAttribute(X):A=A.toString(),8>=f.a.W&&X in w?(X=w[X],O?b.removeAttribute(X):b[X]=A):O||(N?b.setAttributeNS(N,X,A):b.setAttribute(X,A)),X==="name"&&f.a.Yc(b,O?"":A)})}},function(){f.c.checked={after:["value","attr"],init:function(b,R,E){function X(){var z=b.checked,j=N();if(!f.S.Ya()&&(z||!U&&!f.S.qa())){var ee=f.u.G(R);if(k){var fe=H?ee.v():ee,Te=te;te=j,Te!==j?z&&(f.a.Na(fe,j,!0),f.a.Na(fe,Te,!1)):f.a.Na(fe,j,z),H&&f.Za(ee)&&ee(fe)}else O&&(j===e?j=z:z||(j=e)),f.m.eb(ee,E,"checked",j,!0)}}function A(){var z=f.a.f(R()),j=N();k?(b.checked=0<=f.a.A(z,j),te=j):b.checked=O&&j===e?!!z:N()===z}var N=f.xb(function(){if(E.has("checkedValue"))return f.a.f(E.get("checkedValue"));if(J)return E.has("value")?f.a.f(E.get("value")):b.value}),O=b.type=="checkbox",U=b.type=="radio";if(O||U){var Y=R(),k=O&&f.a.f(Y)instanceof Array,H=!(k&&Y.push&&Y.splice),J=U||k,te=k?N():e;U&&!b.name&&f.c.uniqueName.init(b,function(){return!0}),f.o(X,null,{l:b}),f.a.B(b,"click",X),f.o(A,null,{l:b}),Y=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(b,R){b.value=f.a.f(R())}}}(),f.c.class={update:function(b,R){var E=f.a.Db(f.a.f(R()));f.a.Eb(b,b.__ko__cssValue,!1),b.__ko__cssValue=E,f.a.Eb(b,E,!0)}},f.c.css={update:function(b,R){var E=f.a.f(R());E!==null&&typeof E=="object"?f.a.P(E,function(X,A){A=f.a.f(A),f.a.Eb(b,X,A)}):f.c.class.update(b,R)}},f.c.enable={update:function(b,R){var E=f.a.f(R());E&&b.disabled?b.removeAttribute("disabled"):E||b.disabled||(b.disabled=!0)}},f.c.disable={update:function(b,R){f.c.enable.update(b,function(){return!f.a.f(R())})}},f.c.event={init:function(b,R,E,X,A){var N=R()||{};f.a.P(N,function(O){typeof O=="string"&&f.a.B(b,O,function(U){var Y,k=R()[O];if(k){try{var H=f.a.la(arguments);X=A.$data,H.unshift(X),Y=k.apply(X,H)}finally{Y!==!0&&(U.preventDefault?U.preventDefault():U.returnValue=!1)}E.get(O+"Bubble")===!1&&(U.cancelBubble=!0,U.stopPropagation&&U.stopPropagation())}})})}},f.c.foreach={Rc:function(b){return function(){var R=b(),E=f.a.bc(R);return!E||typeof E.length=="number"?{foreach:R,templateEngine:f.ba.Ma}:(f.a.f(R),{foreach:E.data,as:E.as,noChildContext:E.noChildContext,includeDestroyed:E.includeDestroyed,afterAdd:E.afterAdd,beforeRemove:E.beforeRemove,afterRender:E.afterRender,beforeMove:E.beforeMove,afterMove:E.afterMove,templateEngine:f.ba.Ma})}},init:function(b,R){return f.c.template.init(b,f.c.foreach.Rc(R))},update:function(b,R,E,X,A){return f.c.template.update(b,f.c.foreach.Rc(R),E,X,A)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(b,R,E){function X(O){b.__ko_hasfocusUpdating=!0;var U=b.ownerDocument;if("activeElement"in U){var Y;try{Y=U.activeElement}catch{Y=U.body}O=Y===b}U=R(),f.m.eb(U,E,"hasfocus",O,!0),b.__ko_hasfocusLastValue=O,b.__ko_hasfocusUpdating=!1}var A=X.bind(null,!0),N=X.bind(null,!1);f.a.B(b,"focus",A),f.a.B(b,"focusin",A),f.a.B(b,"blur",N),f.a.B(b,"focusout",N),b.__ko_hasfocusLastValue=!1},update:function(b,R){var E=!!f.a.f(R());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===E||(E?b.focus():b.blur(),!E&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[b,E?"focusin":"focusout"]))}},f.m.wa.hasfocus=!0,f.c.hasFocus=f.c.hasfocus,f.m.wa.hasFocus="hasfocus",f.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.fc(b,R())}},function(){function b(R,E,X){f.c[R]={init:function(A,N,O,U,Y){var k,H,J={},te,z,j;if(E){U=O.get("as");var ee=O.get("noChildContext");j=!(U&&ee),J={as:U,noChildContext:ee,exportDependencies:j}}return z=(te=O.get("completeOn")=="render")||O.has(f.i.pa),f.o(function(){var fe=f.a.f(N()),Te=!X!=!fe,de=!H,xe;(j||Te!==k)&&(z&&(Y=f.i.Cb(A,Y)),Te&&((!E||j)&&(J.dataDependency=f.S.o()),xe=E?Y.createChildContext(typeof fe=="function"?fe:N,J):f.S.qa()?Y.extend(null,J):Y),de&&f.S.qa()&&(H=f.a.Ca(f.h.childNodes(A),!0)),Te?(de||f.h.va(A,f.a.Ca(H)),f.Oa(xe,A)):(f.h.Ea(A),te||f.i.ma(A,f.i.H)),k=Te)},null,{l:A}),{controlsDescendantBindings:!0}}},f.m.Ra[R]=!1,f.h.ea[R]=!0}b("if"),b("ifnot",!1,!0),b("with",!0)}(),f.c.let={init:function(b,R,E,X,A){return R=A.extend(R),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var F={};f.c.options={init:function(b){if(f.a.R(b)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,R,E){function X(){return f.a.jb(b.options,function(ee){return ee.selected})}function A(ee,fe,Te){var de=typeof fe;return de=="function"?fe(ee):de=="string"?ee[fe]:Te}function N(ee,fe){if(z&&k)f.i.ma(b,f.i.H);else if(te.length){var Te=0<=f.a.A(te,f.w.M(fe[0]));f.a.Zc(fe[0],Te),z&&!Te&&f.u.G(f.a.Fb,null,[b,"change"])}}var O=b.multiple,U=b.length!=0&&O?b.scrollTop:null,Y=f.a.f(R()),k=E.get("valueAllowUnset")&&E.has("value"),H=E.get("optionsIncludeDestroyed");R={};var J,te=[];k||(O?te=f.a.Mb(X(),f.w.M):0<=b.selectedIndex&&te.push(f.w.M(b.options[b.selectedIndex]))),Y&&(typeof Y.length>"u"&&(Y=[Y]),J=f.a.jb(Y,function(ee){return H||ee===e||ee===null||!f.a.f(ee._destroy)}),E.has("optionsCaption")&&(Y=f.a.f(E.get("optionsCaption")),Y!==null&&Y!==e&&J.unshift(F)));var z=!1;if(R.beforeRemove=function(ee){b.removeChild(ee)},Y=N,E.has("optionsAfterRender")&&typeof E.get("optionsAfterRender")=="function"&&(Y=function(ee,fe){N(0,fe),f.u.G(E.get("optionsAfterRender"),null,[fe[0],ee!==F?ee:e])}),f.a.ec(b,J,function(ee,fe,Te){return Te.length&&(te=!k&&Te[0].selected?[f.w.M(Te[0])]:[],z=!0),fe=b.ownerDocument.createElement("option"),ee===F?(f.a.Bb(fe,E.get("optionsCaption")),f.w.cb(fe,e)):(Te=A(ee,E.get("optionsValue"),ee),f.w.cb(fe,f.a.f(Te)),ee=A(ee,E.get("optionsText"),Te),f.a.Bb(fe,ee)),[fe]},R,Y),!k){var j;O?j=te.length&&X().length<te.length:j=te.length&&0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex])!==te[0]:te.length||0<=b.selectedIndex,j&&f.u.G(f.a.Fb,null,[b,"change"])}(k||f.S.Ya())&&f.i.ma(b,f.i.H),f.a.wd(b),U&&20<Math.abs(U-b.scrollTop)&&(b.scrollTop=U)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(b,R,E){function X(){var O=R(),U=[];f.a.D(b.getElementsByTagName("option"),function(Y){Y.selected&&U.push(f.w.M(Y))}),f.m.eb(O,E,"selectedOptions",U)}function A(){var O=f.a.f(R()),U=b.scrollTop;O&&typeof O.length=="number"&&f.a.D(b.getElementsByTagName("option"),function(Y){var k=0<=f.a.A(O,f.w.M(Y));Y.selected!=k&&f.a.Zc(Y,k)}),b.scrollTop=U}if(f.a.R(b)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var N;f.i.subscribe(b,f.i.H,function(){N?X():(f.a.B(b,"change",X),N=f.o(A,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(b,R){var E=f.a.f(R()||{});f.a.P(E,function(X,A){if(A=f.a.f(A),(A===null||A===e||A===!1)&&(A=""),o)o(b).css(X,A);else if(/^--/.test(X))b.style.setProperty(X,A);else{X=X.replace(/-(\w)/g,function(O,U){return U.toUpperCase()});var N=b.style[X];b.style[X]=A,A===N||b.style[X]!=N||isNaN(A)||(b.style[X]=A+"px")}})}},f.c.submit={init:function(b,R,E,X,A){if(typeof R()!="function")throw Error("The value for a submit binding must be a function");f.a.B(b,"submit",function(N){var O,U=R();try{O=U.call(A.$data,b)}finally{O!==!0&&(N.preventDefault?N.preventDefault():N.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.Bb(b,R())}},f.h.ea.text=!0,function(){if(t&&t.navigator){var b=function(J){if(J)return parseFloat(J[1])},R=t.navigator.userAgent,E,X,A,N,O;(E=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(O=b(R.match(/Edge\/([^ ]+)$/)))||b(R.match(/Chrome\/([^ ]+)/))||(X=b(R.match(/Version\/([^ ]+) Safari/)))||(A=b(R.match(/Firefox\/([^ ]+)/)))||(N=f.a.W||b(R.match(/MSIE ([^ ]+)/)))||(N=b(R.match(/rv:([^ )]+)/)))}if(8<=N&&10>N)var U=f.a.g.Z(),Y=f.a.g.Z(),k=function(J){var te=this.activeElement;(te=te&&f.a.g.get(te,Y))&&te(J)},H=function(J,te){var z=J.ownerDocument;f.a.g.get(z,U)||(f.a.g.set(z,U,!0),f.a.B(z,"selectionchange",k)),f.a.g.set(J,Y,te)};f.c.textInput={init:function(J,te,z){function j(ke,Be){f.a.B(J,ke,Be)}function ee(){var ke=f.a.f(te());(ke===null||ke===e)&&(ke=""),Se!==e&&ke===Se?f.a.setTimeout(ee,4):J.value!==ke&&(Le=!0,J.value=ke,Le=!1,de=J.value)}function fe(){xe||(Se=J.value,xe=f.a.setTimeout(Te,4))}function Te(){clearTimeout(xe),Se=xe=e;var ke=J.value;de!==ke&&(de=ke,f.m.eb(te(),z,"textInput",ke))}var de=J.value,xe,Se,Ie=f.a.W==9?fe:Te,Le=!1;N&&j("keypress",Te),11>N&&j("propertychange",function(ke){Le||ke.propertyName!=="value"||Ie(ke)}),N==8&&(j("keyup",Te),j("keydown",Te)),H&&(H(J,Ie),j("dragend",fe)),(!N||9<=N)&&j("input",Ie),5>X&&f.a.R(J)==="textarea"?(j("keydown",fe),j("paste",fe),j("cut",fe)):11>E?j("keydown",fe):4>A?(j("DOMAutoComplete",Te),j("dragdrop",Te),j("drop",Te)):O&&J.type==="number"&&j("keydown",fe),j("change",Te),j("blur",Te),f.o(ee,null,{l:J})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(J,te,z){z("textInput",J)}}}(),f.c.uniqueName={init:function(b,R){if(R()){var E="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(b,E)}}},f.c.uniqueName.rd=0,f.c.using={init:function(b,R,E,X,A){var N;return E.has("as")&&(N={as:E.get("as"),noChildContext:E.get("noChildContext")}),R=A.createChildContext(R,N),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(b,R,E){var X=f.a.R(b),A=X=="input";if(!A||b.type!="checkbox"&&b.type!="radio"){var N=[],O=E.get("valueUpdate"),U=!1,Y=null;O&&(typeof O=="string"?N=[O]:N=f.a.wc(O),f.a.Pa(N,"change"));var k=function(){Y=null,U=!1;var te=R(),z=f.w.M(b);f.m.eb(te,E,"value",z)};!f.a.W||!A||b.type!="text"||b.autocomplete=="off"||b.form&&b.form.autocomplete=="off"||f.a.A(N,"propertychange")!=-1||(f.a.B(b,"propertychange",function(){U=!0}),f.a.B(b,"focus",function(){U=!1}),f.a.B(b,"blur",function(){U&&k()})),f.a.D(N,function(te){var z=k;f.a.Ud(te,"after")&&(z=function(){Y=f.w.M(b),f.a.setTimeout(k,0)},te=te.substring(5)),f.a.B(b,te,z)});var H;if(H=A&&b.type=="file"?function(){var te=f.a.f(R());te===null||te===e||te===""?b.value="":f.u.G(k)}:function(){var te=f.a.f(R()),z=f.w.M(b);Y!==null&&te===Y?f.a.setTimeout(H,0):(te!==z||z===e)&&(X==="select"?(z=E.get("valueAllowUnset"),f.w.cb(b,te,z),z||te===f.w.M(b)||f.u.G(k)):f.w.cb(b,te))},X==="select"){var J;f.i.subscribe(b,f.i.H,function(){J?E.get("valueAllowUnset")?H():k():(f.a.B(b,"change",k),J=f.o(H,null,{l:b}))},null,{notifyImmediately:!0})}else f.a.B(b,"change",k),f.o(H,null,{l:b})}else f.ib(b,{checkedValue:R})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(b,R){var E=f.a.f(R()),X=b.style.display!="none";E&&!X?b.style.display="":!E&&X&&(b.style.display="none")}},f.c.hidden={update:function(b,R){f.c.visible.update(b,function(){return!f.a.f(R())})}},function(b){f.c[b]={init:function(R,E,X,A,N){return f.c.event.init.call(this,R,function(){var O={};return O[b]=E(),O},X,A,N)}}}("click"),f.ca=function(){},f.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.ca.prototype.makeTemplateSource=function(b,R){if(typeof b=="string"){R=R||n;var E=R.getElementById(b);if(!E)throw Error("Cannot find template with ID "+b);return new f.C.F(E)}if(b.nodeType==1||b.nodeType==8)return new f.C.ia(b);throw Error("Unknown template type: "+b)},f.ca.prototype.renderTemplate=function(b,R,E,X){return b=this.makeTemplateSource(b,X),this.renderTemplateSource(b,R,E,X)},f.ca.prototype.isTemplateRewritten=function(b,R){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(b,R).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(b,R,E){b=this.makeTemplateSource(b,E),R=R(b.text()),b.text(R),b.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=function(){function b(X,A,N,O){X=f.m.ac(X);for(var U=f.m.Ra,Y=0;Y<X.length;Y++){var k=X[Y].key;if(Object.prototype.hasOwnProperty.call(U,k)){var H=U[k];if(typeof H=="function"){if(k=H(X[Y].value))throw Error(k)}else if(!H)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return N="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(X,{valueAccessors:!0})+" } })()},'"+N.toLowerCase()+"')",O.createJavaScriptEvaluatorBlock(N)+A}var R=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,E=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(X,A,N){A.isTemplateRewritten(X,N)||A.rewriteTemplate(X,function(O){return f.kc.Ld(O,A)},N)},Ld:function(X,A){return X.replace(R,function(N,O,U,Y,k){return b(k,O,U,A)}).replace(E,function(N,O){return b(O,"<!-- ko -->","#comment",A)})},md:function(X,A){return f.aa.Xb(function(N,O){var U=N.nextSibling;U&&U.nodeName.toLowerCase()===A&&f.ib(U,X,O)})}}}(),f.b("__tr_ambtns",f.kc.md),function(){f.C={},f.C.F=function(E){if(this.F=E){var X=f.a.R(E);this.ab=X==="script"?1:X==="textarea"?2:X=="template"&&E.content&&E.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var E=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[E];var X=arguments[0];E==="innerHTML"?f.a.fc(this.F,X):this.F[E]=X};var b=f.a.g.Z()+"_";f.C.F.prototype.data=function(E){if(arguments.length===1)return f.a.g.get(this.F,b+E);f.a.g.set(this.F,b+E,arguments[1])};var R=f.a.g.Z();f.C.F.prototype.nodes=function(){var E=this.F;if(arguments.length==0){var X=f.a.g.get(E,R)||{},A=X.lb||(this.ab===3?E.content:this.ab===4?E:e);if(!A||X.jd){var N=this.text();N&&N!==X.bb&&(A=f.a.Md(N,E.ownerDocument),f.a.g.set(E,R,{lb:A,bb:N,jd:!0}))}return A}X=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(E,R,{lb:X})},f.C.ia=function(E){this.F=E},f.C.ia.prototype=new f.C.F,f.C.ia.prototype.constructor=f.C.ia,f.C.ia.prototype.text=function(){if(arguments.length==0){var E=f.a.g.get(this.F,R)||{};return E.bb===e&&E.lb&&(E.bb=E.lb.innerHTML),E.bb}f.a.g.set(this.F,R,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)}(),function(){function b(Y,k,H){var J;for(k=f.h.nextSibling(k);Y&&(J=Y)!==k;)Y=f.h.nextSibling(J),H(J,Y)}function R(Y,k){if(Y.length){var H=Y[0],J=Y[Y.length-1],te=H.parentNode,z=f.ga.instance,j=z.preprocessNode;if(j){if(b(H,J,function(ee,fe){var Te=ee.previousSibling,de=j.call(z,ee);de&&(ee===H&&(H=de[0]||fe),ee===J&&(J=de[de.length-1]||Te))}),Y.length=0,!H)return;H===J?Y.push(H):(Y.push(H,J),f.a.Ua(Y,te))}b(H,J,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.vc(k,ee)}),b(H,J,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[k])}),f.a.Ua(Y,te)}}function E(Y){return Y.nodeType?Y:0<Y.length?Y[0]:null}function X(Y,k,H,J,te){te=te||{};var z=(Y&&E(Y)||H||{}).ownerDocument,j=te.templateEngine||N;if(f.kc.xd(H,j,z),H=j.renderTemplate(H,J,te,z),typeof H.length!="number"||0<H.length&&typeof H[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(z=!1,k){case"replaceChildren":f.h.va(Y,H),z=!0;break;case"replaceNode":f.a.Xc(Y,H),z=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return z&&(R(H,J),te.afterRender&&f.u.G(te.afterRender,null,[H,J[te.as||"$data"]]),k=="replaceChildren"&&f.i.ma(Y,f.i.H)),H}function A(Y,k,H){return f.O(Y)?Y():typeof Y=="function"?Y(k,H):Y}var N;f.gc=function(Y){if(Y!=e&&!(Y instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");N=Y},f.dc=function(Y,k,H,J,te){if(H=H||{},(H.templateEngine||N)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",J){var z=E(J);return f.$(function(){var ee=k&&k instanceof f.fa?k:new f.fa(k,null,null,null,{exportDependencies:!0}),j=A(Y,ee.$data,ee),ee=X(J,te,j,ee,H);te=="replaceNode"&&(J=ee,z=E(J))},null,{Sa:function(){return!z||!f.a.Sb(z)},l:z&&te=="replaceNode"?z.parentNode:z})}return f.aa.Xb(function(j){f.dc(Y,k,H,j,"replaceNode")})},f.Qd=function(Y,k,H,J,te){function z(Se,Ie){f.u.G(f.a.ec,null,[J,Se,ee,H,j,Ie]),f.i.ma(J,f.i.H)}function j(Se,Ie){R(Ie,fe),H.afterRender&&H.afterRender(Ie,Se),fe=null}function ee(Se,Ie){fe=te.createChildContext(Se,{as:Te,noChildContext:H.noChildContext,extend:function(ke){ke.$index=Ie,Te&&(ke[Te+"Index"]=Ie)}});var Le=A(Y,Se,fe);return X(J,"ignoreTargetNode",Le,fe,H)}var fe,Te=H.as,de=H.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!H.includeDestroyed;if(de||H.beforeRemove||!f.Pc(k))return f.$(function(){var Se=f.a.f(k)||[];typeof Se.length>"u"&&(Se=[Se]),de&&(Se=f.a.jb(Se,function(Ie){return Ie===e||Ie===null||!f.a.f(Ie._destroy)})),z(Se)},null,{l:J});z(k.v());var xe=k.subscribe(function(Se){z(k(),Se)},null,"arrayChange");return xe.l(J),xe};var O=f.a.g.Z(),U=f.a.g.Z();f.c.template={init:function(Y,k){var H=f.a.f(k());if(typeof H=="string"||"name"in H)f.h.Ea(Y);else if("nodes"in H){if(H=H.nodes||[],f.O(H))throw Error('The "nodes" option must be a plain, non-observable array.');var J=H[0]&&H[0].parentNode;J&&f.a.g.get(J,U)||(J=f.a.Yb(H),f.a.g.set(J,U,!0)),new f.C.ia(Y).nodes(J)}else if(H=f.h.childNodes(Y),0<H.length)J=f.a.Yb(H),new f.C.ia(Y).nodes(J);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(Y,k,H,J,te){var z=k();k=f.a.f(z),H=!0,J=null,typeof k=="string"?k={}:(z="name"in k?k.name:Y,"if"in k&&(H=f.a.f(k.if)),H&&"ifnot"in k&&(H=!f.a.f(k.ifnot)),H&&!z&&(H=!1)),"foreach"in k?J=f.Qd(z,H&&k.foreach||[],k,Y,te):H?(H=te,"data"in k&&(H=te.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),J=f.dc(z,H,k,Y)):f.h.Ea(Y),te=J,(k=f.a.g.get(Y,O))&&typeof k.s=="function"&&k.s(),f.a.g.set(Y,O,!te||te.ja&&!te.ja()?e:te)}},f.m.Ra.template=function(Y){return Y=f.m.ac(Y),Y.length==1&&Y[0].unknown||f.m.Id(Y,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0}(),f.b("setTemplateEngine",f.gc),f.b("renderTemplate",f.dc),f.a.Kc=function(b,R,E){if(b.length&&R.length){var X,A,N,O,U;for(X=A=0;(!E||X<E)&&(O=b[A]);++A){for(N=0;U=R[N];++N)if(O.value===U.value){O.moved=U.index,U.moved=O.index,R.splice(N,1),X=N=0;break}X+=N}}},f.a.Pb=function(){function b(R,E,X,A,N){var O=Math.min,U=Math.max,Y=[],k,H=R.length,J,te=E.length,z=te-H||1,j=H+te+1,ee,fe,Te;for(k=0;k<=H;k++)for(fe=ee,Y.push(ee=[]),Te=O(te,k+z),J=U(0,k-1);J<=Te;J++)ee[J]=J?k?R[k-1]===E[J-1]?fe[J-1]:O(fe[J]||j,ee[J-1]||j)+1:J+1:k+1;for(O=[],U=[],z=[],k=H,J=te;k||J;)te=Y[k][J]-1,J&&te===Y[k][J-1]?U.push(O[O.length]={status:X,value:E[--J],index:J}):k&&te===Y[k-1][J]?z.push(O[O.length]={status:A,value:R[--k],index:k}):(--J,--k,N.sparse||O.push({status:"retained",value:E[J]}));return f.a.Kc(z,U,!N.dontLimitMoves&&10*H),O.reverse()}return function(R,E,X){return X=typeof X=="boolean"?{dontLimitMoves:X}:X||{},R=R||[],E=E||[],R.length<E.length?b(R,E,"added","deleted",X):b(E,R,"deleted","added",X)}}(),f.b("utils.compareArrays",f.a.Pb),function(){function b(X,A,N,O,U){var Y=[],k=f.$(function(){var H=A(N,U,f.a.Ua(Y,X))||[];0<Y.length&&(f.a.Xc(Y,H),O&&f.u.G(O,null,[N,H,U])),Y.length=0,f.a.Nb(Y,H)},null,{l:X,Sa:function(){return!f.a.kd(Y)}});return{Y,$:k.ja()?k:e}}var R=f.a.g.Z(),E=f.a.g.Z();f.a.ec=function(X,A,N,O,U,Y){function k(ut){Le={Aa:ut,pb:f.ta(fe++)},j.push(Le),z||Ie.push(Le)}function H(ut){Le=te[ut],fe!==Le.pb.v()&&Se.push(Le),Le.pb(fe++),f.a.Ua(Le.Y,X),j.push(Le)}function J(ut,zn){if(ut)for(var cn=0,be=zn.length;cn<be;cn++)f.a.D(zn[cn].Y,function(Ve){ut(Ve,cn,zn[cn].Aa)})}A=A||[],typeof A.length>"u"&&(A=[A]),O=O||{};var te=f.a.g.get(X,R),z=!te,j=[],ee=0,fe=0,Te=[],de=[],xe=[],Se=[],Ie=[],Le,ke=0;if(z)f.a.D(A,k);else{if(!Y||te&&te._countWaitingForRemove){var Be=f.a.Mb(te,function(ut){return ut.Aa});Y=f.a.Pb(Be,A,{dontLimitMoves:O.dontLimitMoves,sparse:!0})}for(var Be=0,it,Gt,gt;it=Y[Be];Be++)switch(Gt=it.moved,gt=it.index,it.status){case"deleted":for(;ee<gt;)H(ee++);Gt===e&&(Le=te[ee],Le.$&&(Le.$.s(),Le.$=e),f.a.Ua(Le.Y,X).length&&(O.beforeRemove&&(j.push(Le),ke++,Le.Aa===E?Le=null:xe.push(Le)),Le&&Te.push.apply(Te,Le.Y))),ee++;break;case"added":for(;fe<gt;)H(ee++);Gt!==e?(de.push(j.length),H(Gt)):k(it.value)}for(;fe<A.length;)H(ee++);j._countWaitingForRemove=ke}f.a.g.set(X,R,j),J(O.beforeMove,Se),f.a.D(Te,O.beforeRemove?f.oa:f.removeNode);var Ne,Kt,Lt;try{Lt=X.ownerDocument.activeElement}catch{}if(de.length)for(;(Be=de.shift())!=e;){for(Le=j[Be],Ne=e;Be;)if((Kt=j[--Be].Y)&&Kt.length){Ne=Kt[Kt.length-1];break}for(A=0;ee=Le.Y[A];Ne=ee,A++)f.h.Wb(X,ee,Ne)}for(Be=0;Le=j[Be];Be++){for(Le.Y||f.a.extend(Le,b(X,N,Le.Aa,U,Le.pb)),A=0;ee=Le.Y[A];Ne=ee,A++)f.h.Wb(X,ee,Ne);!Le.Ed&&U&&(U(Le.Aa,Le.Y,Le.pb),Le.Ed=!0,Ne=Le.Y[Le.Y.length-1])}for(Lt&&X.ownerDocument.activeElement!=Lt&&Lt.focus(),J(O.beforeRemove,xe),Be=0;Be<xe.length;++Be)xe[Be].Aa=E;J(O.afterMove,Se),J(O.afterAdd,Ie)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.ec),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(b,R,E,X){return(R=!(9>f.a.W)&&b.nodes?b.nodes():null)?f.a.la(R.cloneNode(!0).childNodes):(b=b.text(),f.a.ua(b,X))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),function(){f.$a=function(){var R=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(E,X,A,N){if(N=N||n,A=A||{},2>R)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var O=E.data("precompiled");return O||(O=E.text()||"",O=o.template(null,"{{ko_with $item.koBindingContext}}"+O+"{{/ko_with}}"),E.data("precompiled",O)),E=[X.$data],X=o.extend({koBindingContext:X},A.templateOptions),X=o.tmpl(O,E,X),X.appendTo(N.createElement("div")),o.fragments={},X},this.createJavaScriptEvaluatorBlock=function(E){return"{{ko_code ((function() { return "+E+" })()) }}"},this.addTemplate=function(E,X){n.write("<script type='text/html' id='"+E+"'>"+X+"<\/script>")},0<R&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.$a.prototype=new f.ca,f.$a.prototype.constructor=f.$a;var b=new f.$a;0<b.Hd&&f.gc(b),f.b("jqueryTmplTemplateEngine",f.$a)}()})})()})()})();var _Ct=ko;typeof window<"u"?(ko=window.ko,typeof HM<"u"?window.ko=HM:delete window.ko):(ko=global.ko,typeof HM<"u"?global.ko=HM:delete global.ko);var LS=_Ct;var LLo=T(S(),1);/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var Z6="__knockoutObservables",G6="__knockoutSubscribable";function HSe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=zSe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Z6||o===G6)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&yCt(n,a)}}),e}function zSe(e,t){var n=e[Z6];return!n&&t&&(n={},Object.defineProperty(e,Z6,{value:n})),n}function gCt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),HSe.call(i,e,[t]),e}function yCt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=xCt(e,t,i))})}function xCt(e,t,n){var i=_Ct(e,n);return i.subscribe(t)}function _Ct(e,t){var n=t[G6];if(!n){n=new e.subscribable,Object.defineProperty(t,G6,{value:n});var i={};TCt(t,n,i),SCt(e,t,n,i)}return n}function TCt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function SCt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function KSe(e,t){if(!e)return null;var n=zSe(e,!1);return n&&n[t]||null}function CCt(e,t){var n=KSe(e,t);n&&n.valueHasMutated()}function VCt(e){e.track=HSe,e.getObservable=KSe,e.valueHasMutated=CCt,e.defineProperty=gCt}var Y9={attachToKo:VCt};var _Lo=T(S(),1),JSe="http://www.w3.org/2000/svg",QSe="cesium-svgPath-svg",LCt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(JSe,"svg:svg");i.setAttribute("class",QSe);let o=document.createElementNS(JSe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${QSe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},H9=LCt;Y9.attachToKo(CS);H9.register(CS);var Se=CS;function z9(e){l(e)||(e=new ph),this._clock=e,this._eventHelper=new dr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Se.observable(q.now()),this.systemTime.equalityComparer=q.equals,this.startTime=Se.observable(e.startTime),this.startTime.equalityComparer=q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Se.observable(e.stopTime),this.stopTime.equalityComparer=q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Se.observable(e.currentTime),this.currentTime.equalityComparer=q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Se.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Se.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Se.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Se.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Se.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Se.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(z9.prototype,{clock:{get:function(){return this._clock}}});z9.prototype.synchronize=function(){let e=this._clock;this.systemTime=q.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};z9.prototype.isDestroyed=function(){return!1};z9.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var K9=z9;var WLo=T(S(),1);function RCt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var E6=RCt;var FLo=T(S(),1);var J9={};J9.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};J9.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};J9.createRangeInput=function(e,t,n,i,o,r){r=y(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(c),d};J9.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Oa=J9;var DLo=T(S(),1);function jSe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Se.track(this,["toggled","tooltip"])}Object.defineProperties(jSe.prototype,{command:{get:function(){return this._command}}});var Yy=jSe;var KLo=T(S(),1);function ZCt(e,t){t=y(t,!0);let n=new be,i=new be;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Se.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Rn=ZCt;var jLo=T(S(),1);function GCt(e,t,n,i,o){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,o)}var _a=GCt;var nRo=T(S(),1);var VS="http://www.w3.org/2000/svg",eCe="http://www.w3.org/1999/xlink",l3,Q9=B.fromCssColorString("rgba(247,250,255,0.384)"),d3=B.fromCssColorString("rgba(143,191,255,0.216)"),I6=B.fromCssColorString("rgba(153,197,255,0.098)"),u3=B.fromCssColorString("rgba(255,255,255,0.086)"),ECt=B.fromCssColorString("rgba(255,255,255,0.267)"),ICt=B.fromCssColorString("rgba(255,255,255,0)"),qSe=B.fromCssColorString("rgba(66,67,68,0.3)"),$Se=B.fromCssColorString("rgba(0,0,0,0.5)");function Hy(e){return B.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var j9={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function zh(e){let t=document.createElementNS(VS,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(zh(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(eCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function X6(e,t,n){let i=document.createElementNS(VS,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(VS,"tspan");return o.textContent=n,i.appendChild(o),i}function XCt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var m3=new B;function ss(e,t){let n=t.alpha,i=1-n;return m3.red=e.red*i+t.red*n,m3.green=e.green*i+t.green*n,m3.blue=e.blue*i+t.blue*n,m3.toCssColorString()}function W6(e,t,n){let i=j9[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return zh(o)}function WCt(e,t,n){let i=j9[n],o=j9.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return zh(r)}function PCt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&l3!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,d;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,d=t.touches[0].clientY):(c=t.clientX,d=t.clientY),!i&&(c>a.right||c<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),h=c-o-a.left,p=d-r-a.top,g=Math.atan2(p,h)*180/Math.PI+90;g>180&&(g-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(l3=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<f?n.slower():g>f&&n.faster(),t.preventDefault()}else e===l3&&(l3=void 0),n.shuttleRingDragging=!1}function Z0(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[_a(t,"toggled",this.setToggled,this),_a(t,"tooltip",this.setTooltip,this),_a(t.command,"canExecute",this.setEnabled,this)]}Z0.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();me(this)};Z0.prototype.isDestroyed=function(){return!1};Z0.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Z0.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};Z0.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function PL(e,t){e=Xn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(VS,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",eCe);let s=document.createElementNS(VS,"g");this._topG=s,this._realtimeSVG=new Z0(WCt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Z0(W6(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Z0(W6(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Z0(W6(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(VS,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=zh({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let d=j9.animation_pathSwooshFX,u=j9.animation_pathPointer,h=zh({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:d.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:d.d},{tagName:d.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:d.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=zh({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=zh({tagName:"g",transform:"translate(100,100)"});this._knobOuter=zh({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,f=zh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=X6(0,-24,""),this._knobTime=X6(0,-7,""),this._knobStatus=X6(0,-41,"");let x=zh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),_=document.createElementNS(VS,"g");_.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(_),s.appendChild(p),s.appendChild(a),_.appendChild(c),_.appendChild(h),_.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let C=this;function V(v){PCt(C,v)}this._mouseCallback=V,c.addEventListener("mousedown",V,!0),c.addEventListener("touchstart",V,!0),h.addEventListener("mousedown",V,!0),h.addEventListener("touchstart",V,!0),n.addEventListener("mousemove",V,!0),n.addEventListener("touchmove",V,!0),n.addEventListener("mouseup",V,!0),n.addEventListener("touchend",V,!0),n.addEventListener("touchcancel",V,!0),this._shuttleRingPointer.addEventListener("mousedown",V,!0),this._shuttleRingPointer.addEventListener("touchstart",V,!0),this._knobOuter.addEventListener("mousedown",V,!0),this._knobOuter.addEventListener("touchstart",V,!0);let L=this._knobTime.childNodes[0],Z=this._knobDate.childNodes[0],G=this._knobStatus.childNodes[0],I;this._subscriptions=[_a(t.pauseViewModel,"toggled",function(v){I!==v&&(I=v,I?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),_a(t,"shuttleRingAngle",function(v){XCt(C._shuttleRingPointer,C._knobOuter,v)}),_a(t,"dateLabel",function(v){Z.textContent!==v&&(Z.textContent=v)}),_a(t,"timeLabel",function(v){L.textContent!==v&&(L.textContent=v)}),_a(t,"multiplierLabel",function(v){G.textContent!==v&&(G.textContent=v)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(PL.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});PL.prototype.isDestroyed=function(){return!1};PL.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return me(this)};PL.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};PL.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=Hy(this._themeNormal),n=Hy(this._themeHover),i=Hy(this._themeSelect),o=Hy(this._themeDisabled),r=Hy(this._themeKnob),s=Hy(this._themePointer),a=Hy(this._themeSwoosh),c=Hy(this._themeSwooshHover),d=zh({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ss(t,Q9)},{tagName:"stop",offset:"12%","stop-color":ss(t,d3)},{tagName:"stop",offset:"46%","stop-color":ss(t,I6)},{tagName:"stop",offset:"81%","stop-color":ss(t,u3)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ss(n,Q9)},{tagName:"stop",offset:"12%","stop-color":ss(n,d3)},{tagName:"stop",offset:"46%","stop-color":ss(n,I6)},{tagName:"stop",offset:"81%","stop-color":ss(n,u3)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ss(i,Q9)},{tagName:"stop",offset:"12%","stop-color":ss(i,d3)},{tagName:"stop",offset:"46%","stop-color":ss(i,I6)},{tagName:"stop",offset:"81%","stop-color":ss(i,u3)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ss(o,ECt)},{tagName:"stop",offset:"75%","stop-color":ss(o,ICt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":ss(s,$Se)},{tagName:"stop",offset:"100%","stop-color":ss(s,$Se)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":ss(r,Q9)},{tagName:"stop",offset:"60%","stop-color":ss(r,qSe)},{tagName:"stop",offset:"85%","stop-color":ss(r,d3)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":ss(r,qSe)},{tagName:"stop",offset:"60%","stop-color":ss(r,Q9)},{tagName:"stop",offset:"85%","stop-color":ss(r,u3)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var q9=PL;var dRo=T(S(),1);var vCt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],zy=15,vL=105;function tCe(e,t){return e-t}function P6(e,t){let n=Io(t,e,tCe);return n<0?~n:n}function wCt(e,t){if(Math.abs(e)<=zy)return e/zy;let n=zy,i=vL,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function FCt(e,t,n){if(n.clockStep===fo.SYSTEM_CLOCK)return zy;if(Math.abs(e)<=1)return e*zy;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=zy,r=vL,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function _m(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=_m.defaultDateFormatter,this._timeFormatter=_m.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Se.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(_m.defaultTicks),this.timeLabel=void 0,Se.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Se.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Se.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===fo.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Se.defineProperty(this,"shuttleRingAngle",{get:function(){return FCt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,vL),-vL);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===vL){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=wCt(s,a);if(t.snapToTicks)d=a[P6(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let h=u.toFixed(0).length-2,p=Math.pow(10,h);d=Math.round(d/p)*p|0}else u>zy?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,Se.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Or.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,h=!1;if(a===Or.LOOP_STOP)h=q.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;h=q.greaterThan(d,u)&&q.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,Se.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Or.UNBOUNDED)return!0;let c=s.systemTime;return q.greaterThanOrEquals(c,s.startTime)&&q.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Se.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Rn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Yy(n,{toggled:Se.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Yy(i,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Yy(o,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==fo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Rn(function(){t._clockViewModel.clockStep=fo.SYSTEM_CLOCK},Se.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Yy(r,{toggled:Se.computed(function(){return e.clockStep===fo.SYSTEM_CLOCK}),tooltip:Se.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=P6(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=P6(c,a)+1;d<a.length&&(s.multiplier=a[d])})}_m.defaultDateFormatter=function(e,t){let n=q.toGregorianDate(e);return`${vCt[n.month-1]} ${n.day} ${n.year}`};_m.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];_m.defaultTimeFormatter=function(e,t){let n=q.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};_m.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};_m.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(tCe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(_m.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});_m._maxShuttleRingAngle=vL;_m._realtimeShuttleRingAngle=zy;var $9=_m;var VRo=T(S(),1);var bRo=T(S(),1);function ACt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function v6(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var MCt=new bn,NCt=new m;function eM(e,t){let n=this,i=e.canvas,o=new eu(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Se.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Rn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Rn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Rn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Se.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Se.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Se.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new u0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Rn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Se.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Rn(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new R9({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Se.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Rn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(d){return l(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?d.owner===n._primitive||d.owner===n._primitive._billboardCollection||d.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Se.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Se.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Se.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Rn(function(){let d=n.depthFrustum+1;return n.depthFrustum=v6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let d=n.depthFrustum-1;return n.depthFrustum=v6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Se.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Rn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new D9({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Se.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Se.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Rn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Rn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Se.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(d){let u=n._scene.pick({x:d.position.x,y:d.position.y});l(u)&&(n.primitive=l(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Rn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Se.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)});function c(d){let u,h=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,MCt),g=r.pick(p,n._scene,NCt);if(l(g)){let f=h.cartesianToCartographic(g),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let _=0;!u&&_<x.length;++_){let C=x[_];if(l(C))for(let V=0;!u&&V<C.length;++V){let L=C[V];ce.contains(L.rectangle,f)&&(u=L)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Rn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Se.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(eM.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});eM.prototype._update=function(){this.frustums&&(this.frustumStatisticText=ACt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=v6(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};eM.prototype.isDestroyed=function(){return!1};eM.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),me(this)};var tM=eM;function h3(e,t){e=Xn(e);let n=document.createElement("div"),i=new tM(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=Oa.createSection,c=Oa.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(h),d.appendChild(u),d.appendChild(c("Show Frustum Planes","frustumPlanes")),d.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(p);let g=document.createElement("div");d.appendChild(g);let f=document.createElement("span");f.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(f);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(_);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(C);let V=a(s,"Primitives","primitivesVisible","togglePrimitives"),L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",V.appendChild(L);let Z=document.createElement("input");Z.type="button",Z.value="Pick a primitive",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let G=document.createElement("div");G.className="cesium-cesiumInspector-center",G.appendChild(Z),L.appendChild(G),L.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),L.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),L.appendChild(this._primitiveOnly);let I=a(s,"Terrain","terrainVisible","toggleTerrain"),v=document.createElement("div");v.className="cesium-cesiumInspector-pickSection",I.appendChild(v);let P=document.createElement("input");P.type="button",P.value="Pick a tile",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),G=document.createElement("div"),G.appendChild(P),G.className="cesium-cesiumInspector-center",v.appendChild(G);let w=document.createElement("div");v.appendChild(w);let F=document.createElement("input");F.type="button",F.value="Parent",F.className="cesium-cesiumInspector-pickButton",F.setAttribute("data-bind","click: selectParent");let b=document.createElement("input");b.type="button",b.value="NW",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNW");let R=document.createElement("input");R.type="button",R.value="NE",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind","click: selectNE");let E=document.createElement("input");E.type="button",E.value="SW",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectSW");let X=document.createElement("input");X.type="button",X.value="SE",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSE");let A=document.createElement("div");A.className="cesium-cesiumInspector-tileText",w.className="cesium-cesiumInspector-frustumStatistics",w.appendChild(A),w.setAttribute("data-bind","visible: hasPickedTile"),A.setAttribute("data-bind","html: tileText");let N=document.createElement("div");N.className="cesium-cesiumInspector-relativeText",N.textContent="Select relative:",w.appendChild(N);let O=document.createElement("table"),U=document.createElement("tr"),Y=document.createElement("tr"),k=document.createElement("td");k.appendChild(F);let H=document.createElement("td");H.appendChild(b);let J=document.createElement("td");J.appendChild(R),U.appendChild(k),U.appendChild(H),U.appendChild(J);let te=document.createElement("td"),z=document.createElement("td");z.appendChild(E);let j=document.createElement("td");j.appendChild(X),Y.appendChild(te),Y.appendChild(z),Y.appendChild(j),O.appendChild(U),O.appendChild(Y),w.appendChild(O),v.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),v.appendChild(c("Show only selected","filterTile","hasPickedTile")),I.appendChild(c("Wireframe","wireframe")),I.appendChild(c("Suspend LOD update","suspendUpdates")),I.appendChild(c("Show tile coordinates","tileCoordinates")),Se.applyBindings(i,this._element)}Object.defineProperties(h3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});h3.prototype.isDestroyed=function(){return!1};h3.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var nM=h3;var ARo=T(S(),1);var IRo=T(S(),1);function nCe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Se.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Se.getObservable(this,"imageryProviderViewModels"),r=Se.pureComputed(function(){let h=o(),p={},g;for(g=0;g<h.length;g++){let _=h[g],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(g=0;g<f.length;g++){let _=f[g];x.push({name:_,providers:p[_]})}return x});this._imageryProviders=r;let s=Se.getObservable(this,"terrainProviderViewModels"),a=Se.pureComputed(function(){let h=s(),p={},g;for(g=0;g<h.length;g++){let _=h[g],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(g=0;g<f.length;g++){let _=f[g];x.push({name:_,providers:p[_]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Se.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,g=l(h)?h.name:void 0,f=l(p)?p.name:void 0;return l(g)&&l(f)?`${g} -${f}`:l(g)?g:f}),this.buttonImageUrl=void 0,Se.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(l(h))return h.iconUrl}),this.selectedImagery=void 0;let c=Se.observable();this._currentImageryLayers=[],Se.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(h){if(c()===h){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,f=g.length,x=this._globe.imageryLayers,_=!1;for(p=0;p<f;p++){let C=x.length;for(let V=0;V<C;V++){let L=x.get(V);if(L===g[p]){x.remove(L),_=!0;break}}}if(l(h)){let C=h.creationCommand();if(Array.isArray(C)){let V=C.length;for(this._currentImageryLayers=[],p=V-1;p>=0;p--){let L=Ua.fromProviderAsync(C[p]);x.add(L,0),this._currentImageryLayers.push(L)}}else{this._currentImageryLayers=[];let V=Ua.fromProviderAsync(C);if(V.name=h.name,_)x.add(V,0);else{let L=x.get(0);l(L)&&x.remove(L),x.add(V,0)}this._currentImageryLayers.push(V)}}c(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Se.observable();Se.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(h){if(d()===h){this.dropDownVisible=!1;return}let p;if(l(h)&&(p=h.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof Jf),this._globe.terrainProvider=p;else if(l(p)){let g=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,f()}),_=new k9(p).readyEvent.addEventListener(C=>{g||(this._globe.depthTestAgainstTerrain=!(C instanceof Jf),this._globe.terrainProvider=C,_())})}d(h),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Rn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(nCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var iM=nCe;function f3(e,t){e=Xn(e);let n=new iM(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),c.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),c.appendChild(u);let h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),u.appendChild(h);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),h.appendChild(g);let f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",r.appendChild(f);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let _=document.createElement("div");_.className="cesium-baseLayerPicker-category",x.appendChild(_);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),_.appendChild(C);let V=document.createElement("div");V.className="cesium-baseLayerPicker-choices",V.setAttribute("data-bind","foreach: providers"),_.appendChild(V);let L=document.createElement("div");L.className="cesium-baseLayerPicker-item",L.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),V.appendChild(L);let Z=document.createElement("img");Z.className="cesium-baseLayerPicker-itemIcon",Z.setAttribute("data-bind","attr: { src: iconUrl }"),Z.setAttribute("draggable","false"),L.appendChild(Z);let G=document.createElement("div");G.className="cesium-baseLayerPicker-itemLabel",G.setAttribute("data-bind","text: name"),L.appendChild(G),Se.applyBindings(n,i),Se.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(I){i.contains(I.target)||r.contains(I.target)||(n.dropDownVisible=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(f3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});f3.prototype.isDestroyed=function(){return!1};f3.prototype.destroy=function(){return Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._element),Se.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),me(this)};var oM=f3;var BRo=T(S(),1);function iCe(e){let t=e.creationFunction;l(t.canExecute)||(t=Rn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),Se.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(iCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var as=iCe;var zRo=T(S(),1);function kCt(){let e=[],t=devicePixelRatio>=2;return e.push(new as({name:"Bing Maps Aerial",iconUrl:rn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return c0({style:a0.AERIAL})}})),e.push(new as({name:"Bing Maps Aerial with Labels",iconUrl:rn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return c0({style:a0.AERIAL_WITH_LABELS})}})),e.push(new as({name:"Bing Maps Roads",iconUrl:rn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return c0({style:a0.ROAD})}})),e.push(new as({name:"ArcGIS World Imagery",iconUrl:rn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return r0.fromBasemapType(Ph.SATELLITE,{enablePickFeatures:!1})}})),e.push(new as({name:"ArcGIS World Hillshade",iconUrl:rn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return r0.fromBasemapType(Ph.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new as({name:"Esri World Ocean",iconUrl:rn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return r0.fromBasemapType(Ph.OCEANS,{enablePickFeatures:!1})}})),e.push(new as({name:"Open\xADStreet\xADMap",iconUrl:rn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. -http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new R0({url:"https://tile.openstreetmap.org/"})}})),e.push(new as({name:"Stadia x Stamen Watercolor",iconUrl:rn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. -https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new R0({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + */var Z6="__knockoutObservables",G6="__knockoutSubscribable";function KSe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=JSe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Z6||o===G6)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&SCt(n,a)}}),e}function JSe(e,t){var n=e[Z6];return!n&&t&&(n={},Object.defineProperty(e,Z6,{value:n})),n}function TCt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),KSe.call(i,e,[t]),e}function SCt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=CCt(e,t,i))})}function CCt(e,t,n){var i=VCt(e,n);return i.subscribe(t)}function VCt(e,t){var n=t[G6];if(!n){n=new e.subscribable,Object.defineProperty(t,G6,{value:n});var i={};LCt(t,n,i),RCt(e,t,n,i)}return n}function LCt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function RCt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function QSe(e,t){if(!e)return null;var n=JSe(e,!1);return n&&n[t]||null}function ZCt(e,t){var n=QSe(e,t);n&&n.valueHasMutated()}function GCt(e){e.track=KSe,e.getObservable=QSe,e.valueHasMutated=ZCt,e.defineProperty=TCt}var zM={attachToKo:GCt};var ZLo=T(S(),1),jSe="http://www.w3.org/2000/svg",qSe="cesium-svgPath-svg",ECt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(jSe,"svg:svg");i.setAttribute("class",qSe);let o=document.createElementNS(jSe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${qSe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},KM=ECt;zM.attachToKo(LS);KM.register(LS);var Ce=LS;function JM(e){l(e)||(e=new ph),this._clock=e,this._eventHelper=new dr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ce.observable(q.now()),this.systemTime.equalityComparer=q.equals,this.startTime=Ce.observable(e.startTime),this.startTime.equalityComparer=q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ce.observable(e.stopTime),this.stopTime.equalityComparer=q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ce.observable(e.currentTime),this.currentTime.equalityComparer=q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ce.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ce.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ce.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ce.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ce.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ce.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(JM.prototype,{clock:{get:function(){return this._clock}}});JM.prototype.synchronize=function(){let e=this._clock;this.systemTime=q.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};JM.prototype.isDestroyed=function(){return!1};JM.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var QM=JM;var NLo=T(S(),1);function ICt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var E6=ICt;var BLo=T(S(),1);var jM={};jM.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};jM.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};jM.createRangeInput=function(e,t,n,i,o,r){r=y(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(c),d};jM.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Ha=jM;var JLo=T(S(),1);function $Se(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Ce.track(this,["toggled","tooltip"])}Object.defineProperties($Se.prototype,{command:{get:function(){return this._command}}});var Yy=$Se;var tRo=T(S(),1);function XCt(e,t){t=y(t,!0);let n=new ge,i=new ge;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Ce.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Rn=XCt;var oRo=T(S(),1);function WCt(e,t,n,i,o){return n.call(i,e[t]),Ce.getObservable(e,t).subscribe(n,i,o)}var Ca=WCt;var lRo=T(S(),1);var RS="http://www.w3.org/2000/svg",nCe="http://www.w3.org/1999/xlink",uO,qM=B.fromCssColorString("rgba(247,250,255,0.384)"),mO=B.fromCssColorString("rgba(143,191,255,0.216)"),I6=B.fromCssColorString("rgba(153,197,255,0.098)"),hO=B.fromCssColorString("rgba(255,255,255,0.086)"),PCt=B.fromCssColorString("rgba(255,255,255,0.267)"),vCt=B.fromCssColorString("rgba(255,255,255,0)"),eCe=B.fromCssColorString("rgba(66,67,68,0.3)"),tCe=B.fromCssColorString("rgba(0,0,0,0.5)");function Hy(e){return B.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var $M={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function zh(e){let t=document.createElementNS(RS,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(zh(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(nCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function X6(e,t,n){let i=document.createElementNS(RS,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(RS,"tspan");return o.textContent=n,i.appendChild(o),i}function wCt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var fO=new B;function ss(e,t){let n=t.alpha,i=1-n;return fO.red=e.red*i+t.red*n,fO.green=e.green*i+t.green*n,fO.blue=e.blue*i+t.blue*n,fO.toCssColorString()}function W6(e,t,n){let i=$M[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return zh(o)}function FCt(e,t,n){let i=$M[n],o=$M.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return zh(r)}function ACt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&uO!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,d;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,d=t.touches[0].clientY):(c=t.clientX,d=t.clientY),!i&&(c>a.right||c<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),h=c-o-a.left,p=d-r-a.top,g=Math.atan2(p,h)*180/Math.PI+90;g>180&&(g-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(uO=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<f?n.slower():g>f&&n.faster(),t.preventDefault()}else e===uO&&(uO=void 0),n.shuttleRingDragging=!1}function G0(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Ca(t,"toggled",this.setToggled,this),Ca(t,"tooltip",this.setTooltip,this),Ca(t.command,"canExecute",this.setEnabled,this)]}G0.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();me(this)};G0.prototype.isDestroyed=function(){return!1};G0.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};G0.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};G0.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function FL(e,t){e=Xn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(RS,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",nCe);let s=document.createElementNS(RS,"g");this._topG=s,this._realtimeSVG=new G0(FCt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new G0(W6(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new G0(W6(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new G0(W6(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(RS,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=zh({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let d=$M.animation_pathSwooshFX,u=$M.animation_pathPointer,h=zh({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:d.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:d.d},{tagName:d.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:d.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=zh({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=zh({tagName:"g",transform:"translate(100,100)"});this._knobOuter=zh({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,f=zh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=X6(0,-24,""),this._knobTime=X6(0,-7,""),this._knobStatus=X6(0,-41,"");let x=zh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),_=document.createElementNS(RS,"g");_.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(_),s.appendChild(p),s.appendChild(a),_.appendChild(c),_.appendChild(h),_.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let C=this;function V(v){ACt(C,v)}this._mouseCallback=V,c.addEventListener("mousedown",V,!0),c.addEventListener("touchstart",V,!0),h.addEventListener("mousedown",V,!0),h.addEventListener("touchstart",V,!0),n.addEventListener("mousemove",V,!0),n.addEventListener("touchmove",V,!0),n.addEventListener("mouseup",V,!0),n.addEventListener("touchend",V,!0),n.addEventListener("touchcancel",V,!0),this._shuttleRingPointer.addEventListener("mousedown",V,!0),this._shuttleRingPointer.addEventListener("touchstart",V,!0),this._knobOuter.addEventListener("mousedown",V,!0),this._knobOuter.addEventListener("touchstart",V,!0);let L=this._knobTime.childNodes[0],Z=this._knobDate.childNodes[0],G=this._knobStatus.childNodes[0],I;this._subscriptions=[Ca(t.pauseViewModel,"toggled",function(v){I!==v&&(I=v,I?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Ca(t,"shuttleRingAngle",function(v){wCt(C._shuttleRingPointer,C._knobOuter,v)}),Ca(t,"dateLabel",function(v){Z.textContent!==v&&(Z.textContent=v)}),Ca(t,"timeLabel",function(v){L.textContent!==v&&(L.textContent=v)}),Ca(t,"multiplierLabel",function(v){G.textContent!==v&&(G.textContent=v)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(FL.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});FL.prototype.isDestroyed=function(){return!1};FL.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return me(this)};FL.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};FL.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=Hy(this._themeNormal),n=Hy(this._themeHover),i=Hy(this._themeSelect),o=Hy(this._themeDisabled),r=Hy(this._themeKnob),s=Hy(this._themePointer),a=Hy(this._themeSwoosh),c=Hy(this._themeSwooshHover),d=zh({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ss(t,qM)},{tagName:"stop",offset:"12%","stop-color":ss(t,mO)},{tagName:"stop",offset:"46%","stop-color":ss(t,I6)},{tagName:"stop",offset:"81%","stop-color":ss(t,hO)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ss(n,qM)},{tagName:"stop",offset:"12%","stop-color":ss(n,mO)},{tagName:"stop",offset:"46%","stop-color":ss(n,I6)},{tagName:"stop",offset:"81%","stop-color":ss(n,hO)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ss(i,qM)},{tagName:"stop",offset:"12%","stop-color":ss(i,mO)},{tagName:"stop",offset:"46%","stop-color":ss(i,I6)},{tagName:"stop",offset:"81%","stop-color":ss(i,hO)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ss(o,PCt)},{tagName:"stop",offset:"75%","stop-color":ss(o,vCt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":ss(s,tCe)},{tagName:"stop",offset:"100%","stop-color":ss(s,tCe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":ss(r,qM)},{tagName:"stop",offset:"60%","stop-color":ss(r,eCe)},{tagName:"stop",offset:"85%","stop-color":ss(r,mO)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":ss(r,eCe)},{tagName:"stop",offset:"60%","stop-color":ss(r,qM)},{tagName:"stop",offset:"85%","stop-color":ss(r,hO)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var e9=FL;var gRo=T(S(),1);var MCt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],zy=15,AL=105;function iCe(e,t){return e-t}function P6(e,t){let n=Xo(t,e,iCe);return n<0?~n:n}function NCt(e,t){if(Math.abs(e)<=zy)return e/zy;let n=zy,i=AL,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function kCt(e,t,n){if(n.clockStep===po.SYSTEM_CLOCK)return zy;if(Math.abs(e)<=1)return e*zy;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=zy,r=AL,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function _m(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=_m.defaultDateFormatter,this._timeFormatter=_m.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ce.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(_m.defaultTicks),this.timeLabel=void 0,Ce.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ce.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ce.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===po.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Ce.defineProperty(this,"shuttleRingAngle",{get:function(){return kCt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,AL),-AL);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===AL){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=NCt(s,a);if(t.snapToTicks)d=a[P6(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let h=u.toFixed(0).length-2,p=Math.pow(10,h);d=Math.round(d/p)*p|0}else u>zy?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,Ce.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Or.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,h=!1;if(a===Or.LOOP_STOP)h=q.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;h=q.greaterThan(d,u)&&q.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,Ce.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Or.UNBOUNDED)return!0;let c=s.systemTime;return q.greaterThanOrEquals(c,s.startTime)&&q.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Ce.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Rn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Yy(n,{toggled:Ce.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Yy(i,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Yy(o,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==po.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Rn(function(){t._clockViewModel.clockStep=po.SYSTEM_CLOCK},Ce.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Yy(r,{toggled:Ce.computed(function(){return e.clockStep===po.SYSTEM_CLOCK}),tooltip:Ce.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=P6(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=P6(c,a)+1;d<a.length&&(s.multiplier=a[d])})}_m.defaultDateFormatter=function(e,t){let n=q.toGregorianDate(e);return`${MCt[n.month-1]} ${n.day} ${n.year}`};_m.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];_m.defaultTimeFormatter=function(e,t){let n=q.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};_m.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};_m.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(iCe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(_m.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});_m._maxShuttleRingAngle=AL;_m._realtimeShuttleRingAngle=zy;var t9=_m;var IRo=T(S(),1);var CRo=T(S(),1);function oCe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ce.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Ce.getObservable(this,"imageryProviderViewModels"),r=Ce.pureComputed(function(){let h=o(),p={},g;for(g=0;g<h.length;g++){let _=h[g],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(g=0;g<f.length;g++){let _=f[g];x.push({name:_,providers:p[_]})}return x});this._imageryProviders=r;let s=Ce.getObservable(this,"terrainProviderViewModels"),a=Ce.pureComputed(function(){let h=s(),p={},g;for(g=0;g<h.length;g++){let _=h[g],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(g=0;g<f.length;g++){let _=f[g];x.push({name:_,providers:p[_]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Ce.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,g=l(h)?h.name:void 0,f=l(p)?p.name:void 0;return l(g)&&l(f)?`${g} +${f}`:l(g)?g:f}),this.buttonImageUrl=void 0,Ce.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(l(h))return h.iconUrl}),this.selectedImagery=void 0;let c=Ce.observable();this._currentImageryLayers=[],Ce.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(h){if(c()===h){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,f=g.length,x=this._globe.imageryLayers,_=!1;for(p=0;p<f;p++){let C=x.length;for(let V=0;V<C;V++){let L=x.get(V);if(L===g[p]){x.remove(L),_=!0;break}}}if(l(h)){let C=h.creationCommand();if(Array.isArray(C)){let V=C.length;for(this._currentImageryLayers=[],p=V-1;p>=0;p--){let L=Ba.fromProviderAsync(C[p]);x.add(L,0),this._currentImageryLayers.push(L)}}else{this._currentImageryLayers=[];let V=Ba.fromProviderAsync(C);if(V.name=h.name,_)x.add(V,0);else{let L=x.get(0);l(L)&&x.remove(L),x.add(V,0)}this._currentImageryLayers.push(V)}}c(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Ce.observable();Ce.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(h){if(d()===h){this.dropDownVisible=!1;return}let p;if(l(h)&&(p=h.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof Qf),this._globe.terrainProvider=p;else if(l(p)){let g=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,f()}),_=new DM(p).readyEvent.addEventListener(C=>{g||(this._globe.depthTestAgainstTerrain=!(C instanceof Qf),this._globe.terrainProvider=C,_())})}d(h),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Rn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(oCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var n9=oCe;function pO(e,t){e=Xn(e);let n=new n9(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),c.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),c.appendChild(u);let h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),u.appendChild(h);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),h.appendChild(g);let f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",r.appendChild(f);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let _=document.createElement("div");_.className="cesium-baseLayerPicker-category",x.appendChild(_);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),_.appendChild(C);let V=document.createElement("div");V.className="cesium-baseLayerPicker-choices",V.setAttribute("data-bind","foreach: providers"),_.appendChild(V);let L=document.createElement("div");L.className="cesium-baseLayerPicker-item",L.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),V.appendChild(L);let Z=document.createElement("img");Z.className="cesium-baseLayerPicker-itemIcon",Z.setAttribute("data-bind","attr: { src: iconUrl }"),Z.setAttribute("draggable","false"),L.appendChild(Z);let G=document.createElement("div");G.className="cesium-baseLayerPicker-itemLabel",G.setAttribute("data-bind","text: name"),L.appendChild(G),Ce.applyBindings(n,i),Ce.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(I){i.contains(I.target)||r.contains(I.target)||(n.dropDownVisible=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(pO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});pO.prototype.isDestroyed=function(){return!1};pO.prototype.destroy=function(){return Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._element),Ce.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),me(this)};var i9=pO;var FRo=T(S(),1);function rCe(e){let t=e.creationFunction;l(t.canExecute)||(t=Rn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),Ce.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(rCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var as=rCe;var kRo=T(S(),1);function UCt(){let e=[],t=devicePixelRatio>=2;return e.push(new as({name:"Bing Maps Aerial",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return l0({style:c0.AERIAL})}})),e.push(new as({name:"Bing Maps Aerial with Labels",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return l0({style:c0.AERIAL_WITH_LABELS})}})),e.push(new as({name:"Bing Maps Roads",iconUrl:nn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return l0({style:c0.ROAD})}})),e.push(new as({name:"ArcGIS World Imagery",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return s0.fromBasemapType(Ph.SATELLITE,{enablePickFeatures:!1})}})),e.push(new as({name:"ArcGIS World Hillshade",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return s0.fromBasemapType(Ph.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new as({name:"Esri World Ocean",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return s0.fromBasemapType(Ph.OCEANS,{enablePickFeatures:!1})}})),e.push(new as({name:"Open\xADStreet\xADMap",iconUrl:nn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. +http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new Z0({url:"https://tile.openstreetmap.org/"})}})),e.push(new as({name:"Stadia x Stamen Watercolor",iconUrl:nn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. +https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new Z0({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Stadia x Stamen Toner",iconUrl:rn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays. -https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new R0({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Stadia x Stamen Toner",iconUrl:nn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays. +https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new Z0({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Stadia Alidade Smooth",iconUrl:rn("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine. -https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new R0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Stadia Alidade Smooth",iconUrl:nn("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine. +https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new Z0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Stadia Alidade Smooth Dark",iconUrl:rn("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. -https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new R0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Stadia Alidade Smooth Dark",iconUrl:nn("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. +https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new Z0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Sentinel-2",iconUrl:rn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return s0.fromAssetId(3954)}})),e.push(new as({name:"Blue Marble",iconUrl:rn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return s0.fromAssetId(3845)}})),e.push(new as({name:"Earth at night",iconUrl:rn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return s0.fromAssetId(3812)}})),e.push(new as({name:"Natural Earth\xA0II",iconUrl:rn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Cy.fromUrl(rn("Assets/Textures/NaturalEarthII"))}})),e}var rM=kCt;var jRo=T(S(),1);function UCt(){let e=[];return e.push(new as({name:"WGS84 Ellipsoid",iconUrl:rn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Jf({ellipsoid:ne.WGS84})}})),e.push(new as({name:"Cesium World Terrain",iconUrl:rn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return fS({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var sM=UCt;var lZo=T(S(),1);var nZo=T(S(),1);function DCt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof bs&&(e.tileset=n.primitive),e.pickActive=!1}}function rCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof bs&&(e.tileset=i.primitive)},Sn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Sn.MOUSE_MOVE),e.picking=e.picking)}var BCt={maximumFractionDigits:3};function aM(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,BCt):Math.round(t).toLocaleString()}function cM(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Fo.PICK]:e._statisticsPerPass[Fo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${aM(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${aM(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${aM(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function sCe(){let e=Vi.statistics;return` + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new as({name:"Sentinel-2",iconUrl:nn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return a0.fromAssetId(3954)}})),e.push(new as({name:"Blue Marble",iconUrl:nn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return a0.fromAssetId(3845)}})),e.push(new as({name:"Earth at night",iconUrl:nn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return a0.fromAssetId(3812)}})),e.push(new as({name:"Natural Earth\xA0II",iconUrl:nn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Cy.fromUrl(nn("Assets/Textures/NaturalEarthII"))}})),e}var o9=UCt;var ORo=T(S(),1);function DCt(){let e=[];return e.push(new as({name:"WGS84 Ellipsoid",iconUrl:nn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Qf({ellipsoid:ne.WGS84})}})),e.push(new as({name:"Cesium World Terrain",iconUrl:nn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return bS({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var r9=DCt;var oZo=T(S(),1);var QRo=T(S(),1);function BCt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function v6(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var OCt=new pn,YCt=new m;function s9(e,t){let n=this,i=e.canvas,o=new tu(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Ce.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Rn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Rn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Rn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ce.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Ce.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Ce.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new m0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Rn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ce.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Rn(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new GM({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Ce.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Rn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(d){return l(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?d.owner===n._primitive||d.owner===n._primitive._billboardCollection||d.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Ce.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ce.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Ce.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Rn(function(){let d=n.depthFrustum+1;return n.depthFrustum=v6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let d=n.depthFrustum-1;return n.depthFrustum=v6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ce.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Rn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new OM({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Ce.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ce.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Rn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Rn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Ce.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(d){let u=n._scene.pick({x:d.position.x,y:d.position.y});l(u)&&(n.primitive=l(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Rn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ce.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)});function c(d){let u,h=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,OCt),g=r.pick(p,n._scene,YCt);if(l(g)){let f=h.cartesianToCartographic(g),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let _=0;!u&&_<x.length;++_){let C=x[_];if(l(C))for(let V=0;!u&&V<C.length;++V){let L=C[V];ce.contains(L.rectangle,f)&&(u=L)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Rn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ce.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(s9.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});s9.prototype._update=function(){this.frustums&&(this.frustumStatisticText=BCt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=v6(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};s9.prototype.isDestroyed=function(){return!1};s9.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),me(this)};var a9=s9;function bO(e,t){e=Xn(e);let n=document.createElement("div"),i=new a9(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=Ha.createSection,c=Ha.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(h),d.appendChild(u),d.appendChild(c("Show Frustum Planes","frustumPlanes")),d.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(p);let g=document.createElement("div");d.appendChild(g);let f=document.createElement("span");f.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(f);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(_);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(C);let V=a(s,"Primitives","primitivesVisible","togglePrimitives"),L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",V.appendChild(L);let Z=document.createElement("input");Z.type="button",Z.value="Pick a primitive",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let G=document.createElement("div");G.className="cesium-cesiumInspector-center",G.appendChild(Z),L.appendChild(G),L.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),L.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),L.appendChild(this._primitiveOnly);let I=a(s,"Terrain","terrainVisible","toggleTerrain"),v=document.createElement("div");v.className="cesium-cesiumInspector-pickSection",I.appendChild(v);let P=document.createElement("input");P.type="button",P.value="Pick a tile",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),G=document.createElement("div"),G.appendChild(P),G.className="cesium-cesiumInspector-center",v.appendChild(G);let w=document.createElement("div");v.appendChild(w);let F=document.createElement("input");F.type="button",F.value="Parent",F.className="cesium-cesiumInspector-pickButton",F.setAttribute("data-bind","click: selectParent");let b=document.createElement("input");b.type="button",b.value="NW",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNW");let R=document.createElement("input");R.type="button",R.value="NE",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind","click: selectNE");let E=document.createElement("input");E.type="button",E.value="SW",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectSW");let X=document.createElement("input");X.type="button",X.value="SE",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSE");let A=document.createElement("div");A.className="cesium-cesiumInspector-tileText",w.className="cesium-cesiumInspector-frustumStatistics",w.appendChild(A),w.setAttribute("data-bind","visible: hasPickedTile"),A.setAttribute("data-bind","html: tileText");let N=document.createElement("div");N.className="cesium-cesiumInspector-relativeText",N.textContent="Select relative:",w.appendChild(N);let O=document.createElement("table"),U=document.createElement("tr"),Y=document.createElement("tr"),k=document.createElement("td");k.appendChild(F);let H=document.createElement("td");H.appendChild(b);let J=document.createElement("td");J.appendChild(R),U.appendChild(k),U.appendChild(H),U.appendChild(J);let te=document.createElement("td"),z=document.createElement("td");z.appendChild(E);let j=document.createElement("td");j.appendChild(X),Y.appendChild(te),Y.appendChild(z),Y.appendChild(j),O.appendChild(U),O.appendChild(Y),w.appendChild(O),v.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),v.appendChild(c("Show only selected","filterTile","hasPickedTile")),I.appendChild(c("Wireframe","wireframe")),I.appendChild(c("Suspend LOD update","suspendUpdates")),I.appendChild(c("Show tile coordinates","tileCoordinates")),Ce.applyBindings(i,this._element)}Object.defineProperties(bO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});bO.prototype.isDestroyed=function(){return!1};bO.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var c9=bO;var bZo=T(S(),1);var lZo=T(S(),1);function HCt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof bs&&(e.tileset=n.primitive),e.pickActive=!1}}function aCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof bs&&(e.tileset=i.primitive)},Sn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Sn.MOUSE_MOVE),e.picking=e.picking)}var zCt={maximumFractionDigits:3};function l9(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,zCt):Math.round(t).toLocaleString()}function d9(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Ao.PICK]:e._statisticsPerPass[Ao.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${l9(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${l9(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${l9(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function cCe(){let e=Li.statistics;return` <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${aM(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${aM(e.texturesByteLength)}</li> + <li><strong>Geometry Memory (MB): </strong>${l9(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${l9(e.texturesByteLength)}</li> </ul> - `}var OCt=[{text:"Highlight",value:El.HIGHLIGHT},{text:"Replace",value:El.REPLACE},{text:"Mix",value:El.MIX}],oCe=new B(1,1,0,.4),YCt=new B,p3=new B;function Ta(e,t){let n=this,i=e.canvas;this._eventHandler=new eu(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new u0({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Se.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Se.observable({}),this.properties=[],Se.defineProperty(this,"properties",function(){let k=[],H=n._properties();for(let J in H)H.hasOwnProperty(J)&&k.push(J);return k});let o=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=Se.observable();Se.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=El.HIGHLIGHT;let s=Se.observable(),a=Se.observable();Se.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(H){let J=e.pick(H.endPosition);if(J instanceof ks?(n.feature=J,n.tile=J.content.tile):l(J)&&l(J.content)?(n.feature=void 0,n.tile=J.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(J)&&l(J.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(H.endPosition),l(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=J.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Sn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Sn.MOUSE_MOVE))}}),this.picking=!0;let c=Se.observable();Se.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let d=Se.observable();Se.defineProperty(this,"wireframe",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let u=Se.observable();Se.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=Se.observable();Se.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(k){h(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Se.observable();Se.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Se.observable();Se.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Se.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Se.observable();Se.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Se.observable();Se.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Se.observable();Se.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Se.observable();Se.defineProperty(this,"showUrl",{get:function(){return C()},set:function(k){C(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let V=Se.observable();Se.defineProperty(this,"maximumScreenSpaceError",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let L=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Se.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(L(),1/6)},set:function(k){let H=Math.pow(k,6);L(H),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=H)}});let Z=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return Z()},set:function(k){k=Number(k),isNaN(k)||(Z(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let G=DCt(this),I=Se.observable();Se.defineProperty(this,"pickActive",{get:function(){return I()},set:function(k){I(k),k?n._eventHandler.setInputAction(G,Sn.LEFT_CLICK):n._eventHandler.removeInputAction(Sn.LEFT_CLICK)}});let v=Se.observable();Se.defineProperty(this,"pointCloudShading",{get:function(){return v()},set:function(k){v(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let P=Se.observable();Se.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(k){k=Number(k),isNaN(k)||(P(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let w=Se.observable();Se.defineProperty(this,"maximumAttenuation",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let F=Se.observable();Se.defineProperty(this,"baseResolution",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let b=Se.observable();Se.defineProperty(this,"eyeDomeLighting",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let R=Se.observable();Se.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let E=Se.observable();Se.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let X=Se.observable();Se.defineProperty(this,"skipLevelOfDetail",{get:function(){return X()},set:function(k){X(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let A=Se.observable();Se.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let N=Se.observable();Se.defineProperty(this,"baseScreenSpaceError",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let O=Se.observable();Se.defineProperty(this,"skipLevels",{get:function(){return O()},set:function(k){k=Number(k),isNaN(k)||(O(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let U=Se.observable();Se.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return U()},set:function(k){U(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let Y=Se.observable();Se.defineProperty(this,"loadSiblings",{get:function(){return Y()},set:function(k){Y(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||rCe(this,!0)}Object.defineProperties(Ta.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return OCt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=cM(e,!1),this._pickStatisticsText=cM(e,!0),this._resourceCacheStatisticsText=sCe(),rCe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,YCt):B.WHITE:t.color=p3,this._scene.requestRender()),l(e)&&(B.clone(e.color,p3),e.color=oCe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!w6(t.content)&&(t.color=p3,this._scene.requestRender()),l(e)&&!w6(e.content)&&(B.clone(e.color,p3),e.color=oCe,this._scene.requestRender()),this._tile=e}}});function w6(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!w6(t[i]))return!1;return!0}return!1}Ta.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Ta.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Ta.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Ta.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Ta.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Ta.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Ta.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Ta.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Ta.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Ta.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Ta.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new bS(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Ta.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` + `}var KCt=[{text:"Highlight",value:Il.HIGHLIGHT},{text:"Replace",value:Il.REPLACE},{text:"Mix",value:Il.MIX}],sCe=new B(1,1,0,.4),JCt=new B,gO=new B;function Va(e,t){let n=this,i=e.canvas;this._eventHandler=new tu(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new m0({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Ce.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Ce.observable({}),this.properties=[],Ce.defineProperty(this,"properties",function(){let k=[],H=n._properties();for(let J in H)H.hasOwnProperty(J)&&k.push(J);return k});let o=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=Ce.observable();Ce.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=Il.HIGHLIGHT;let s=Ce.observable(),a=Ce.observable();Ce.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(H){let J=e.pick(H.endPosition);if(J instanceof ks?(n.feature=J,n.tile=J.content.tile):l(J)&&l(J.content)?(n.feature=void 0,n.tile=J.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(J)&&l(J.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(H.endPosition),l(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=J.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Sn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Sn.MOUSE_MOVE))}}),this.picking=!0;let c=Ce.observable();Ce.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let d=Ce.observable();Ce.defineProperty(this,"wireframe",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let u=Ce.observable();Ce.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=Ce.observable();Ce.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(k){h(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ce.observable();Ce.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Ce.observable();Ce.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Ce.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Ce.observable();Ce.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Ce.observable();Ce.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Ce.observable();Ce.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Ce.observable();Ce.defineProperty(this,"showUrl",{get:function(){return C()},set:function(k){C(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let V=Ce.observable();Ce.defineProperty(this,"maximumScreenSpaceError",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let L=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ce.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(L(),1/6)},set:function(k){let H=Math.pow(k,6);L(H),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=H)}});let Z=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return Z()},set:function(k){k=Number(k),isNaN(k)||(Z(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let G=HCt(this),I=Ce.observable();Ce.defineProperty(this,"pickActive",{get:function(){return I()},set:function(k){I(k),k?n._eventHandler.setInputAction(G,Sn.LEFT_CLICK):n._eventHandler.removeInputAction(Sn.LEFT_CLICK)}});let v=Ce.observable();Ce.defineProperty(this,"pointCloudShading",{get:function(){return v()},set:function(k){v(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let P=Ce.observable();Ce.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(k){k=Number(k),isNaN(k)||(P(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let w=Ce.observable();Ce.defineProperty(this,"maximumAttenuation",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let F=Ce.observable();Ce.defineProperty(this,"baseResolution",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let b=Ce.observable();Ce.defineProperty(this,"eyeDomeLighting",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let R=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let E=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let X=Ce.observable();Ce.defineProperty(this,"skipLevelOfDetail",{get:function(){return X()},set:function(k){X(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let A=Ce.observable();Ce.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let N=Ce.observable();Ce.defineProperty(this,"baseScreenSpaceError",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let O=Ce.observable();Ce.defineProperty(this,"skipLevels",{get:function(){return O()},set:function(k){k=Number(k),isNaN(k)||(O(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let U=Ce.observable();Ce.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return U()},set:function(k){U(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let Y=Ce.observable();Ce.defineProperty(this,"loadSiblings",{get:function(){return Y()},set:function(k){Y(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||aCe(this,!0)}Object.defineProperties(Va.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return KCt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=d9(e,!1),this._pickStatisticsText=d9(e,!0),this._resourceCacheStatisticsText=cCe(),aCe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,JCt):B.WHITE:t.color=gO,this._scene.requestRender()),l(e)&&(B.clone(e.color,gO),e.color=sCe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!w6(t.content)&&(t.color=gO,this._scene.requestRender()),l(e)&&!w6(e.content)&&(B.clone(e.color,gO),e.color=sCe,this._scene.requestRender()),this._tile=e}}});function w6(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!w6(t[i]))return!1;return!0}return!1}Va.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Va.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Va.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Va.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Va.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Va.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Va.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Va.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Va.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Va.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Va.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new yS(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Va.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` `),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(` -`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};Ta.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=cM(e,!1),this._pickStatisticsText=cM(e,!0),this._resourceCacheStatisticsText=sCe())};Ta.prototype.isDestroyed=function(){return!1};Ta.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),me(this)};Ta.getStatistics=cM;var lM=Ta;function b3(e,t){e=Xn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new lM(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Oa.createSection,c=Oa.createCheckbox,d=Oa.createRangeInput,u=Oa.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),_=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),V=document.createElement("div");V.className="field-group";let L=document.createElement("label");L.className="field-label",L.appendChild(document.createTextNode("Properties: "));let Z=document.createElement("div");Z.setAttribute("data-bind","text: properties"),V.appendChild(L),V.appendChild(Z),h.appendChild(V),h.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(u("Trim Tiles Cache","trimTilesCache")),h.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let G=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),I=document.createElement("p");I.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),I.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),I.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",G.appendChild(I),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let v=document.createElement("div");v.setAttribute("data-bind","visible: pointCloudShading"),v.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),v.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),v.appendChild(d("Base Resolution","baseResolution",0,1,.01)),v.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(v);let P=document.createElement("div");P.setAttribute("data-bind","visible: eyeDomeLighting"),P.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),P.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),v.appendChild(P),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let w=document.createElement("div");w.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(w);let F=document.createElement("div");F.setAttribute("data-bind","visible: dynamicScreenSpaceError"),F.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),F.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(F),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(b),f.appendChild(c("Pick Statistics","showPickStatistics"));let R=document.createElement("div");R.className="cesium-3dTilesInspector-statistics",R.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(R),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(E);let X=document.createElement("div");_.appendChild(X),X.appendChild(document.createTextNode("Color Blend Mode: "));let A=document.createElement("select");A.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),X.appendChild(A);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),X.className="cesium-cesiumInspector-styleEditor",X.appendChild(N);let O=u("Compile (Ctrl+Enter)","compileStyle");X.appendChild(O);let U=document.createElement("div");U.className="cesium-cesiumInspector-error",U.setAttribute("data-bind","text: editorError"),X.appendChild(U),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let Y=document.createElement("div");Y.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(Y);let k=document.createElement("div");k.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(k);let H=document.createElement("div");H.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(H),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Se.applyBindings(o,n)}Object.defineProperties(b3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});b3.prototype.isDestroyed=function(){return!1};b3.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var dM=b3;var SZo=T(S(),1);var pZo=T(S(),1);function g3(e,t){l(t)||(t=document.body),t=Xn(t);let n=this,i=Se.observable(br.fullscreen),o=Se.observable(br.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Se.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Se.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&br.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Rn(function(){br.fullscreen?br.exitFullscreen():br.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Xn(e),r.body),this._callback=function(){i(br.fullscreen)},r.addEventListener(br.changeEventName,this._callback)}Object.defineProperties(g3.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});g3.prototype.isDestroyed=function(){return!1};g3.prototype.destroy=function(){document.removeEventListener(br.changeEventName,this._callback),me(this)};var uM=g3;var HCt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",zCt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function y3(e,t){e=Xn(e);let n=new uM(t,e);n._exitFullScreenPath=zCt,n._enterFullScreenPath=HCt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Se.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(y3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});y3.prototype.isDestroyed=function(){return!1};y3.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var mM=y3;var wZo=T(S(),1);var GZo=T(S(),1);var aCe=1e3;function Tm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new mS({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new be,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=lCe,this._handleArrowUp=cCe;let t=this;this._suggestionsVisible=Se.pureComputed(function(){let o=Se.getObservable(t,"_suggestions")().length>0,r=Se.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Rn(function(i){if(i=y(i,Ny.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)$Ct(t);else return jCt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?cCe(t):r?lCe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;mCe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Tm.flyToDestination),this._focusTextbox=!1,Se.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Se.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Tm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Se.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Se.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Se.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Tm.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Tm.prototype.destroy=function(){this._suggestionSubscription.dispose()};function cCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Tm._adjustSuggestionsScroll(e,n)}function lCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Tm._adjustSuggestionsScroll(e,i)}function KCt(e,t){let n=l(t)?t.availability:void 0;return l(n)?VT(t,[e]).then(function(i){return e=i[0],e.height+=aCe,e}):(e.height+=aCe,Promise.resolve(e))}function JCt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ce?W.equalsEpsilon(t.south,t.north,W.EPSILON7)&&W.equalsEpsilon(t.east,t.west,W.EPSILON7)?t=ce.center(t):a=LT(t,n):t=i.cartesianToCartographic(t),l(a)||(a=KCt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:M.IDENTITY})})}async function QCt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function jCt(e,t,n){let i=e._searchText;if(uCe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await QCt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,A6(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=dCe(e,_L.getCreditsFromResult(s[0]));l(a)||F6(e,t[o].credit);return}e._searchText=`${i} (not found)`}function F6(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function dCe(e,t){return l(t)&&t.forEach(n=>F6(e,n)),t}function A6(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function qCt(e,t){let n=Xn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function $Ct(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function uCe(e){return/^\s*$/.test(e)}function mCe(e){Se.getObservable(e,"_suggestions").removeAll()}async function e1t(e){if(!e.autoComplete)return;let t=e._searchText;if(mCe(e),A6(e),!uCe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Ny.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=_L.getCreditsFromResult(r);o=o&&!l(s),dCe(e,s)}),o&&F6(e,n.credit)}if(e._suggestions.length>=5)return}}Tm.flyToDestination=JCt;Tm._updateSearchSuggestions=e1t;Tm._adjustSuggestionsScroll=qCt;Tm.prototype.isDestroyed=function(){return!1};Tm.prototype.destroy=function(){return A6(this),me(this)};var hM=Tm;var t1t="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",n1t="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function x3(e){let t=Xn(e.container),n=new hM(e);n._startSearchPath=t1t,n._stopSearchPath=n1t;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Se.applyBindings(n,i),Se.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(d){let u=d.target;typeof d.composedPath=="function"&&(u=d.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(d){n._focusTextbox=!0,n.showSuggestions()},Ot.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(x3.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});x3.prototype.isDestroyed=function(){return!1};x3.prototype.destroy=function(){let e=this._container;return Ot.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Se.cleanNode(this._form),Se.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),me(this)};var fM=x3;var HZo=T(S(),1);var NZo=T(S(),1);function hCe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Rn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Se.track(this,["tooltip"])}Object.defineProperties(hCe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var pM=hCe;function _3(e,t,n){e=Xn(e);let i=new pM(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Se.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(_3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_3.prototype.isDestroyed=function(){return!1};_3.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var bM=_3;var nGo=T(S(),1);var QZo=T(S(),1);function i1t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function pCe(e,t){Se.track(e);for(let n=0;n<e.sublayers.length;n++)pCe(e.sublayers[n],t)}function T3(e){return e.modelName==="FullModel"}function bCe(e){return e.modelName==="Overview"}function gCe(e){return bCe(e)||T3(e)}function fCe(e,t){if(gCe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Se.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function o1t(e,t){if(gCe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");T3(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function r1t(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function s1t(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Se.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Se.observable(!0),index:-1}],currentLayer:Se.observable(),expandClickHandler:i1t,setOptionDisable:function(i,o){Se.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){o1t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){pCe(n[i],this.viewModel);let o=fCe(n[i],this.viewModel);l(o)&&(bCe(o)||!l(this.viewModel.defaultLayer)&&T3(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=fCe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=T3(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return r1t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var gM=s1t;function a1t(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` +`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};Va.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=d9(e,!1),this._pickStatisticsText=d9(e,!0),this._resourceCacheStatisticsText=cCe())};Va.prototype.isDestroyed=function(){return!1};Va.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),me(this)};Va.getStatistics=d9;var u9=Va;function yO(e,t){e=Xn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new u9(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Ha.createSection,c=Ha.createCheckbox,d=Ha.createRangeInput,u=Ha.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),_=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),V=document.createElement("div");V.className="field-group";let L=document.createElement("label");L.className="field-label",L.appendChild(document.createTextNode("Properties: "));let Z=document.createElement("div");Z.setAttribute("data-bind","text: properties"),V.appendChild(L),V.appendChild(Z),h.appendChild(V),h.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(u("Trim Tiles Cache","trimTilesCache")),h.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let G=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),I=document.createElement("p");I.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),I.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),I.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",G.appendChild(I),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let v=document.createElement("div");v.setAttribute("data-bind","visible: pointCloudShading"),v.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),v.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),v.appendChild(d("Base Resolution","baseResolution",0,1,.01)),v.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(v);let P=document.createElement("div");P.setAttribute("data-bind","visible: eyeDomeLighting"),P.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),P.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),v.appendChild(P),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let w=document.createElement("div");w.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(w);let F=document.createElement("div");F.setAttribute("data-bind","visible: dynamicScreenSpaceError"),F.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),F.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(F),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(b),f.appendChild(c("Pick Statistics","showPickStatistics"));let R=document.createElement("div");R.className="cesium-3dTilesInspector-statistics",R.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(R),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(E);let X=document.createElement("div");_.appendChild(X),X.appendChild(document.createTextNode("Color Blend Mode: "));let A=document.createElement("select");A.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),X.appendChild(A);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),X.className="cesium-cesiumInspector-styleEditor",X.appendChild(N);let O=u("Compile (Ctrl+Enter)","compileStyle");X.appendChild(O);let U=document.createElement("div");U.className="cesium-cesiumInspector-error",U.setAttribute("data-bind","text: editorError"),X.appendChild(U),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let Y=document.createElement("div");Y.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(Y);let k=document.createElement("div");k.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(k);let H=document.createElement("div");H.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(H),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ce.applyBindings(o,n)}Object.defineProperties(yO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});yO.prototype.isDestroyed=function(){return!1};yO.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var m9=yO;var EZo=T(S(),1);var SZo=T(S(),1);function xO(e,t){l(t)||(t=document.body),t=Xn(t);let n=this,i=Ce.observable(br.fullscreen),o=Ce.observable(br.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Ce.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ce.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&br.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Rn(function(){br.fullscreen?br.exitFullscreen():br.requestFullscreen(n._fullscreenElement)},Ce.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Xn(e),r.body),this._callback=function(){i(br.fullscreen)},r.addEventListener(br.changeEventName,this._callback)}Object.defineProperties(xO.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});xO.prototype.isDestroyed=function(){return!1};xO.prototype.destroy=function(){document.removeEventListener(br.changeEventName,this._callback),me(this)};var h9=xO;var QCt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",jCt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function _O(e,t){e=Xn(e);let n=new h9(t,e);n._exitFullScreenPath=jCt,n._enterFullScreenPath=QCt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Ce.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(_O.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_O.prototype.isDestroyed=function(){return!1};_O.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var f9=_O;var DZo=T(S(),1);var wZo=T(S(),1);var lCe=1e3;function Tm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new fS({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new ge,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=uCe,this._handleArrowUp=dCe;let t=this;this._suggestionsVisible=Ce.pureComputed(function(){let o=Ce.getObservable(t,"_suggestions")().length>0,r=Ce.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Rn(function(i){if(i=y(i,Ny.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)i1t(t);else return t1t(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?dCe(t):r?uCe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;fCe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Tm.flyToDestination),this._focusTextbox=!1,Ce.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ce.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Tm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ce.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ce.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ce.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Tm.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Tm.prototype.destroy=function(){this._suggestionSubscription.dispose()};function dCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Tm._adjustSuggestionsScroll(e,n)}function uCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Tm._adjustSuggestionsScroll(e,i)}function qCt(e,t){let n=l(t)?t.availability:void 0;return l(n)?RT(t,[e]).then(function(i){return e=i[0],e.height+=lCe,e}):(e.height+=lCe,Promise.resolve(e))}function $Ct(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ce?W.equalsEpsilon(t.south,t.north,W.EPSILON7)&&W.equalsEpsilon(t.east,t.west,W.EPSILON7)?t=ce.center(t):a=ZT(t,n):t=i.cartesianToCartographic(t),l(a)||(a=qCt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:M.IDENTITY})})}async function e1t(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function t1t(e,t,n){let i=e._searchText;if(hCe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await e1t(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,A6(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=mCe(e,CL.getCreditsFromResult(s[0]));l(a)||F6(e,t[o].credit);return}e._searchText=`${i} (not found)`}function F6(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function mCe(e,t){return l(t)&&t.forEach(n=>F6(e,n)),t}function A6(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function n1t(e,t){let n=Xn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function i1t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function hCe(e){return/^\s*$/.test(e)}function fCe(e){Ce.getObservable(e,"_suggestions").removeAll()}async function o1t(e){if(!e.autoComplete)return;let t=e._searchText;if(fCe(e),A6(e),!hCe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Ny.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=CL.getCreditsFromResult(r);o=o&&!l(s),mCe(e,s)}),o&&F6(e,n.credit)}if(e._suggestions.length>=5)return}}Tm.flyToDestination=$Ct;Tm._updateSearchSuggestions=o1t;Tm._adjustSuggestionsScroll=n1t;Tm.prototype.isDestroyed=function(){return!1};Tm.prototype.destroy=function(){return A6(this),me(this)};var p9=Tm;var r1t="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",s1t="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function TO(e){let t=Xn(e.container),n=new p9(e);n._startSearchPath=r1t,n._stopSearchPath=s1t;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Ce.applyBindings(n,i),Ce.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(d){let u=d.target;typeof d.composedPath=="function"&&(u=d.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(d){n._focusTextbox=!0,n.showSuggestions()},Bt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(TO.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});TO.prototype.isDestroyed=function(){return!1};TO.prototype.destroy=function(){let e=this._container;return Bt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Ce.cleanNode(this._form),Ce.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),me(this)};var b9=TO;var $Zo=T(S(),1);var HZo=T(S(),1);function pCe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Rn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ce.track(this,["tooltip"])}Object.defineProperties(pCe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var g9=pCe;function SO(e,t,n){e=Xn(e);let i=new g9(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Ce.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(SO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});SO.prototype.isDestroyed=function(){return!1};SO.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var y9=SO;var lGo=T(S(),1);var iGo=T(S(),1);function a1t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function gCe(e,t){Ce.track(e);for(let n=0;n<e.sublayers.length;n++)gCe(e.sublayers[n],t)}function CO(e){return e.modelName==="FullModel"}function yCe(e){return e.modelName==="Overview"}function xCe(e){return yCe(e)||CO(e)}function bCe(e,t){if(xCe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Ce.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function c1t(e,t){if(xCe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");CO(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function l1t(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function d1t(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Ce.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Ce.observable(!0),index:-1}],currentLayer:Ce.observable(),expandClickHandler:a1t,setOptionDisable:function(i,o){Ce.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){c1t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){gCe(n[i],this.viewModel);let o=bCe(n[i],this.viewModel);l(o)&&(yCe(o)||!l(this.viewModel.defaultLayer)&&CO(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=bCe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=CO(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return l1t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var x9=d1t;function u1t(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` <h3>Building explorer</h3> <select data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer" @@ -16064,8 +16064,8 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let o=new gM(t);Se.track(o),Se.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var M6=a1t;var hGo=T(S(),1);var sGo=T(S(),1);var c1t="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",l1t="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function N6(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Se.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Se.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?l1t:c1t}}),Se.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}N6.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(N6.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var yM=N6;function S3(e){e=Xn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="×",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new yM;Se.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,d=c.createElement("link");d.href=rn("Widgets/InfoBox/InfoBoxDescription.css"),d.rel="stylesheet",d.type="text/css";let u=c.createElement("div");u.className="cesium-infoBox-description",c.head.appendChild(d),c.body.appendChild(u),a._descriptionSubscription=_a(s,"description",function(h){r.style.height="5px",u.innerHTML=h;let p=null,g=u.firstElementChild;if(g!==null&&u.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let _=x["background-color"],C=B.fromCssColorString(_);l(C)&&C.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let f=u.getBoundingClientRect().height;r.style.height=`${f}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(S3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});S3.prototype.isDestroyed=function(){return!1};S3.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),me(this)};var xM=S3;var VGo=T(S(),1);var gGo=T(S(),1);function yCe(){this.showInstructions=!1;let e=this;this._command=Rn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Rn(function(){e._touch=!1}),this._showTouch=Rn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Se.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(yCe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var _M=yCe;function C3(e){let t=Xn(e.container),n=new _M,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=rn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=rn("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",d.appendChild(u),d.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(d);let h=document.createElement("div");h.className="cesium-click-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),h.innerHTML=` <table> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(h);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Se.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(C3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});C3.prototype.isDestroyed=function(){return!1};C3.prototype.destroy=function(){return Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var TM=C3;var MGo=T(S(),1);var XGo=T(S(),1);function k6(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Se.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Rn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=E9.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(k6.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});k6.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),me(this)};var SM=k6;function V3(e){let t=Xn(e.container),n=new SM(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Se.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(V3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});V3.prototype.isDestroyed=function(){return!1};V3.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var CM=V3;var jGo=T(S(),1);var OGo=T(S(),1);function L3(e){this._scene=e,this._orthographic=e.camera.frustum instanceof an,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Se.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Se.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Rn(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new dr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof an}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Rn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Rn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(L3.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});L3.prototype.isDestroyed=function(){return!1};L3.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var VM=L3;var d1t="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",u1t="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function R3(e,t){e=Xn(e);let n=new VM(t);n._perspectivePath=d1t,n._orthographicPath=u1t;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Se.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(R3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});R3.prototype.isDestroyed=function(){return!1};R3.prototype.destroy=function(){return this._viewModel.destroy(),Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var LM=R3;var uEo=T(S(),1);var oEo=T(S(),1);function Z3(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new dr,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Se.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Se.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Rn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Rn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Rn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(Z3.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});Z3.prototype.isDestroyed=function(){return!1};Z3.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var RM=Z3;var m1t="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",h1t="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",f1t="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function G3(e,t,n){e=Xn(e);let i=new RM(t,n);i._globePath=m1t,i._flatMapPath=h1t,i._columbusViewPath=f1t;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Se.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(G3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});G3.prototype.isDestroyed=function(){return!1};G3.prototype.destroy=function(){return this._viewModel.destroy(),Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var ZM=G3;var CEo=T(S(),1);var bEo=T(S(),1);var p1t=new D,E3="-1000px";function GM(e,t,n){this._scene=e,this._screenPositionX=E3,this._screenPositionY=E3,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Se.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Se.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Se.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return ki.worldToWindowCoordinates(e,i,o)}}GM.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,p1t);if(!l(e))this._screenPositionX=E3,this._screenPositionY=E3;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};GM.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Hr.EXPONENTIAL_OUT})};GM.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Hr.EXPONENTIAL_OUT})};Object.defineProperties(GM.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var EM=GM;function I3(e,t){e=Xn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new EM(t,this._element,this._container);this._viewModel=c,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(I3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});I3.prototype.isDestroyed=function(){return!1};I3.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),me(this)};var IM=I3;var wEo=T(S(),1);var REo=T(S(),1);function LS(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}LS.prototype.getHeight=function(){return this._height};LS.prototype.getBase=function(){return this._base};LS.prototype.getStartTime=function(){return this._start};LS.prototype.getStopTime=function(){return this._stop};LS.prototype.setRange=function(e,t){this._start=e,this._stop=t};LS.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=q.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=q.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var XM=LS;var EEo=T(S(),1);function xCe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new B(.5,.5,.5,1),this.backgroundColor=i||new B(0,0,0,0)}xCe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=q.addSeconds(t.startJulian,t.duration,new q);if(q.lessThan(n,o)&&q.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(q.lessThanOrEquals(n,r)&&q.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let d=q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new q);!l(a)&&q.greaterThanOrEquals(d,n)?a=s:!l(c)&&q.greaterThanOrEquals(d,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var WM=xCe;var U6=1e12,Sm={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},fl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Ky=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],b1t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pl(e,t){e=Xn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Sm.none,this._touchMode=fl.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=g1t(this),this._onMouseUp=y1t(this),this._onMouseMove=x1t(this),this._onMouseWheel=_1t(this),this._onTouchStart=T1t(this),this._onTouchMove=C1t(this),this._onTouchEnd=S1t(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}pl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};pl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};pl.prototype.isDestroyed=function(){return!1};pl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),me(this)};pl.prototype.addHighlightRange=function(e,t,n){let i=new XM(e,t,n);return this._highlightRanges.push(i),this.resize(),i};pl.prototype.addTrack=function(e,t,n,i){let o=new WM(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};pl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Or.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=q.secondsDifference(o,i),s=q.secondsDifference(i,this._startJulian),a=q.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=q.addSeconds(this._endJulian,s,new q),this._startJulian=i,this._timeBarSecondsSpan=q.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=q.addSeconds(this._startJulian,a,new q),this._endJulian=o,this._timeBarSecondsSpan=q.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};pl.prototype.zoomFrom=function(e){let t=q.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(q.addSeconds(this._startJulian,t-t*e,new q),q.addSeconds(this._endJulian,n*e-n,new q))};function D6(e){return e<10?`0${e.toString()}`:e.toString()}pl.prototype.makeLabel=function(e){let t=q.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${b1t[t.month-1]} ${t.day} ${t.year} ${D6(t.hour)}:${D6(t.minute)}:${D6(t.second)}${i}`};pl.prototype.smallestTicInPixels=7;pl.prototype._makeTics=function(){let e=this._timeBarEle,t=q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,d=1e-10,u=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=q.addSeconds(this._startJulian,a,new q)):h>c&&(h=c,this._timeBarSecondsSpan=c,this._endJulian=q.addSeconds(this._startJulian,c,new q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,f=Math.min(h/p*1e-5,.4),x,_=q.toGregorianDate(g);h>31536e4?x=q.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):h>31536e3?x=q.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):h>86400?x=q.fromDate(new Date(Date.UTC(_.year,0))):x=q.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let C=q.secondsDifference(this._startJulian,q.addSeconds(x,f,new q)),V=C+h;this._epochJulian=x;function L(k){return Math.floor(C/k)*k}function Z(k,H){return Math.ceil(k/H+.5)*H}function G(k){return(k-C)/h}function I(k,H){return k-H*Math.round(k/H)}this._rulerEle.innerHTML=this.makeLabel(q.addSeconds(this._endJulian,-a,new q));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);let P=u;u-=d;let w={startTime:C,startJulian:g,epochJulian:x,duration:h,timeBarWidth:p,getAlpha:G};this._highlightRanges.forEach(function(k){s+=k.render(w)});let F=0,b=0,R=0,E=v/p;E>1&&(E=1),E*=this._timeBarSecondsSpan;let X=-1,A=-1,N=Ky.length,O;for(O=0;O<N;++O){let k=Ky[O];if(++X,F=k,k>E&&k>u)break;A<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(A=X)}if(X>0){for(;X>0;)if(--X,Math.abs(I(F,Ky[X]))<1e-5){Ky[X]>=u&&(b=Ky[X]);break}if(A>=0)for(;A<X;){if(Math.abs(I(b,Ky[A]))<1e-5&&Ky[A]>=u){R=Ky[A];break}++A}}u=P,u>d&&R<1e-5&&Math.abs(u-F)>d&&(R=u,u<=F+d&&(b=0));let U=-999999,Y;if(p*(R/this._timeBarSecondsSpan)>=3)for(o=L(R);o<=V;o=Z(o,R))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(b/this._timeBarSecondsSpan)>=3)for(o=L(b);o<=V;o=Z(o,b))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(F/this._timeBarSecondsSpan)>=2){this._mainTicSpan=F,V+=F,o=L(F);let k=q.computeTaiMinusUtc(x);for(;o<=V;){let H=q.addSeconds(g,o-C,new q);if(F>2.1){let j=q.computeTaiMinusUtc(H);Math.abs(j-k)>.1&&(o+=j-k,H=q.addSeconds(g,o-C,new q))}let J=Math.round(p*G(o)),te=this.makeLabel(H);this._rulerEle.innerHTML=te,Y=this._rulerEle.offsetWidth,Y<10&&(Y=v);let z=J-(Y/2-1);z>U?(U=z+Y+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${J.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${z.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${J.toString()}px;"></span>`,o=Z(o,F)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),w.y=0,this._trackList.forEach(function(k){k.render(r._context,w),w.y+=k.height})};pl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(q.addSeconds(this._startJulian,this._timelineDrag,new q),q.addSeconds(this._endJulian,this._timelineDrag,new q)))};pl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=q.addSeconds(this._startJulian,t,new q),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function g1t(e){return function(t){e._mouseMode!==Sm.touchOnly&&(t.button===0?(e._mouseMode=Sm.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Sm.zoom:e._mouseMode=Sm.slide)),t.preventDefault()}}function y1t(e){return function(t){e._mouseMode=Sm.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function x1t(e){return function(t){let n;if(e._mouseMode===Sm.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Sm.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(q.addSeconds(e._startJulian,i,new q),q.addSeconds(e._endJulian,i,new q))}}else e._mouseMode===Sm.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function _1t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;U6=Math.max(Math.min(Math.abs(n),U6),1),n/=U6,e.zoomFrom(Math.pow(1.05,-n))}}function T1t(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Sm.touchOnly,n===1?(i=q.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=fl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=fl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=fl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=fl.ignore}}function S1t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===fl.singleTap?(e._touchMode=fl.scrub,e._onTouchMove(t)):e._touchMode===fl.scrub&&e._onTouchMove(t),e._mouseMode=Sm.touchOnly,n!==1?e._touchMode=n>0?fl.ignore:fl.none:e._touchMode===fl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function C1t(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===fl.singleTap&&(e._touchMode=fl.slideZoom),e._mouseMode=Sm.touchOnly,e._touchMode===fl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-d,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===fl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-d,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-d,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new q)):(n=e._touchState.centerX-r,a=q.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new q)),e.zoomTo(a,q.addSeconds(a,e._timeBarSecondsSpan*c,new q)),e._touchState.centerX=r,e._touchState.spanX=s))}}pl.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var PM=pl;var qEo=T(S(),1);var YEo=T(S(),1);var VCe=T(CCe(),1);function R1t(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function LCe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function Z1t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(LCe(),e._locked=!1),e._noSleep.disable(),br.exitFullscreen(),n(!1)):(br.fullscreen||br.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=R1t("landscape")),t.useWebVR=!0,n(!0)))}function X3(e,t){let n=this,i=Se.observable(br.enabled),o=Se.observable(!1);this.isVRMode=void 0,Se.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Se.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&br.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Se.observable(!1);this._isOrthographic=void 0,Se.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new dr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof an)}),this._locked=!1,this._noSleep=new VCe.default,this._command=Rn(function(){Z1t(n,e,o,r)},Se.getObservable(this,"isVREnabled")),this._vrElement=y(Xn(t),document.body),this._callback=function(){!br.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(LCe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(br.changeEventName,this._callback)}Object.defineProperties(X3.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});X3.prototype.isDestroyed=function(){return!1};X3.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(br.changeEventName,this._callback),me(this)};var vM=X3;var G1t="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",E1t="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function W3(e,t,n){e=Xn(e);let i=new vM(t,n);i._exitVRPath=E1t,i._enterVRPath=G1t;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Se.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(W3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});W3.prototype.isDestroyed=function(){return!1};W3.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var wM=W3;var xIo=T(S(),1);var RCe=new le;function ECe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function I1t(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function X1t(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function ZCe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof $o)return i;if(n instanceof ks)return new $o({name:X1t(n),description:I1t(n),feature:n})}if(l(e.scene.globe))return v1t(e,t.position)}var W1t=new q;function H6(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;q.equals(i,o)&&(o=q.addSeconds(i,W.EPSILON2,W1t)),e.updateFromClock(),e.zoomTo(i,o)}}}var P1t=new m;function v1t(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new $o({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=GCe();return}let a=s[0],c=new $o({id:a.name,description:a.description});if(l(a.position)){let d=e.scene.ellipsoid.cartographicToCartesian(a.position,P1t);c.position=new Uc(d)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=GCe())}),r}function GCe(){return new $o({id:"None",description:"No features found."})}function w1t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,d=e._fullscreenButton,u=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),l(u)&&(u.container.style.visibility=p),l(h)&&(h.container.style.visibility=p),e._container){let g=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function ji(e,t){e=Xn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=y(t.scene3DOnly,!1),c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new ph,d=new K9(c),u=!0);let h=new d9(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=h.scene,g=new dr;g.add(c.onTick,ji.prototype._onTick,this);let f;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let H=document.createElement("div");H.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(H),f=new IM(H,p)}let x;if(!l(t.infoBox)||t.infoBox!==!1){let H=document.createElement("div");H.className="cesium-viewer-infoBoxContainer",o.appendChild(H),x=new xM(H);let J=x.viewModel;g.add(J.cameraClicked,ji.prototype._onInfoBoxCameraClicked,this),g.add(J.closeClicked,ji.prototype._onInfoBoxClockClicked,this)}let _=document.createElement("div");_.className="cesium-viewer-toolbar",o.appendChild(_);let C;if(!l(t.geocoder)||t.geocoder!==!1){let H=document.createElement("div");H.className="cesium-viewer-geocoderContainer",_.appendChild(H);let J;typeof t.geocoder=="string"?J=[new mS({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(J=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),C=new fM({container:H,geocoderServices:J,scene:p}),g.add(C.viewModel.search.beforeExecute,ji.prototype._clearObjects,this)}let V;(!l(t.homeButton)||t.homeButton!==!1)&&(V=new bM(_,p),l(C)&&g.add(V.viewModel.command.afterExecute,function(){let H=C.viewModel;H.searchText="",H.isSearchInProgress&&H.search()}),g.add(V.viewModel.command.beforeExecute,ji.prototype._clearTrackedObject,this));let L;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(L=new ZM(_,p));let Z;t.projectionPicker&&(Z=new LM(_,p));let G,I;if(n){let H=y(t.imageryProviderViewModels,rM()),J=y(t.terrainProviderViewModels,sM());G=new oM(_,{globe:p.globe,imageryProviderViewModels:H,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:J,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),I=_.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(G.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(G.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let v;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let H=!0;try{if(l(window.localStorage)){let J=window.localStorage.getItem("cesium-hasSeenNavHelp");l(J)&&J?H=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}v=new TM({container:_,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,H)})}let P;if(!l(t.animation)||t.animation!==!1){let H=document.createElement("div");H.className="cesium-viewer-animationContainer",o.appendChild(H),P=new q9(H,new $9(d))}let w;if(!l(t.timeline)||t.timeline!==!1){let H=document.createElement("div");H.className="cesium-viewer-timelineContainer",o.appendChild(H),w=new PM(H,c),w.addEventListener("settime",ECe,!1),w.zoomTo(c.startTime,c.stopTime)}let F,b,R;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(R=document.createElement("div"),R.className="cesium-viewer-fullscreenContainer",o.appendChild(R),F=new mM(R,t.fullscreenElement),b=_a(F.viewModel,"isFullscreenEnabled",function(H){R.style.display=H?"block":"none",l(w)&&(w.container.style.right=`${R.clientWidth}px`,w.resize())}));let E,X,A;if(t.vrButton){let H=document.createElement("div");H.className="cesium-viewer-vrContainer",o.appendChild(H),E=new wM(H,p,t.fullScreenElement),X=_a(E.viewModel,"isVREnabled",function(J){H.style.display=J?"block":"none",l(F)&&(H.style.right=`${R.clientWidth}px`),l(w)&&(w.container.style.right=`${H.clientWidth}px`,w.resize())}),A=_a(E.viewModel,"isVRMode",function(J){w1t(i,J)})}this._baseLayerPickerDropDown=I,this._fullscreenSubscription=b,this._vrSubscription=X,this._vrModeSubscription=A,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=f,this._infoBox=x,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=_,this._homeButton=V,this._sceneModePicker=L,this._projectionPicker=Z,this._baseLayerPicker=G,this._navigationHelpButton=v,this._animation=P,this._timeline=w,this._fullscreenButton=F,this._vrButton=E,this._geocoder=C,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(x)||l(f),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let N=this._cesiumWidget.dataSources,O=this._cesiumWidget.dataSourceDisplay;g.add(N.dataSourceAdded,ji.prototype._onDataSourceAdded,this),g.add(N.dataSourceRemoved,ji.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,ji.prototype.resize,this);let U=N.length;for(let H=0;H<U;H++)this._dataSourceAdded(N,N.get(H));this._dataSourceAdded(void 0,O.defaultDataSource),g.add(N.dataSourceAdded,ji.prototype._dataSourceAdded,this),g.add(N.dataSourceRemoved,ji.prototype._dataSourceRemoved,this);function Y(H){let J=ZCe(i,H);l(J)?K.getValueOrUndefined(J.position,i.clock.currentTime)?i.trackedEntity=J:i.zoomTo(J):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(H){i.selectedEntity=ZCe(i,H)}h.screenSpaceEventHandler.setInputAction(k,Sn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(Y,Sn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(ji.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,H6(this._timeline,e))}}});ji.prototype.extend=function(e,t){e(this,t)};ji.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let f=this._geocoder.searchSuggestionsContainer;f.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,d,u=0,h=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let f=this._lastWidth;d=this._animation.container,n>900?(u=169,f<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(f<600||f>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(f>600||f===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),h=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let f=this._fullscreenButton,x=this._vrButton,_=c.container,C=_.style;p=_.clientHeight+3,C.left=`${u}px`;let V=0;l(f)&&(V+=f.container.clientWidth),l(x)&&(V+=x.container.clientWidth),C.right=`${V}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};ji.prototype.forceResize=function(){this._lastWidth=0,this.resize()};ji.prototype.render=function(){this._cesiumWidget.render()};ji.prototype.isDestroyed=function(){return!1};ji.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Sn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Sn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",ECe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),me(this)};ji.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(ji.prototype._onEntityCollectionChanged,this)};ji.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(ji.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};ji.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};ji.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,RCe)!==dt.FAILED?n=RCe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=m.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=y(o.name,o.id),a.description=K.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};ji.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};ji.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};ji.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};ji.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};ji.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};ji.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&H6(this.timeline,e)};ji.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&H6(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,ji.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};ji.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};ji.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};ji.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var z6=ji;var SIo=T(S(),1);function F1t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new dM(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var K6=F1t;var LIo=T(S(),1);function A1t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new nM(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var J6=A1t;var EIo=T(S(),1);function M1t(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new be,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Xn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){ICe(s,d),s=u,Q6(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?Q6(s,d):ICe(s,d),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return c},set:function(u){c=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){RS(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=u.dataTransfer.files,p=h.length;for(let g=0;g<p;g++){let f=h[g],x=new FileReader;x.onload=N1t(e,f,c,a),x.onerror=k1t(e,f),x.readAsText(f)}}Q6(s,d),e.destroy=x9(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function RS(e){e.stopPropagation(),e.preventDefault()}function ICe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",RS,!1),n.removeEventListener("dragover",RS,!1),n.removeEventListener("dragexit",RS,!1))}function Q6(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",RS,!1),e.addEventListener("dragover",RS,!1),e.addEventListener("dragexit",RS,!1)}function N1t(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=mv.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=nw.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=Pw.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=sw.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function k1t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var j6=M1t;var wIo=T(S(),1);function U1t(e,t){t=y(t,y.EMPTY_OBJECT);let n=new CM({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var q6=U1t;var QIo=T(S(),1);var zIo=T(S(),1);var kIo=T(S(),1);function XCe(e){let t=e.split(` + </div>`,n.appendChild(i);let o=new x9(t);Ce.track(o),Ce.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var M6=u1t;var _Go=T(S(),1);var hGo=T(S(),1);var m1t="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",h1t="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function N6(){this._cameraClicked=new ge,this._closeClicked=new ge,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ce.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Ce.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?h1t:m1t}}),Ce.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}N6.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(N6.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var _9=N6;function VO(e){e=Xn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="×",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new _9;Ce.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,d=c.createElement("link");d.href=nn("Widgets/InfoBox/InfoBoxDescription.css"),d.rel="stylesheet",d.type="text/css";let u=c.createElement("div");u.className="cesium-infoBox-description",c.head.appendChild(d),c.body.appendChild(u),a._descriptionSubscription=Ca(s,"description",function(h){r.style.height="5px",u.innerHTML=h;let p=null,g=u.firstElementChild;if(g!==null&&u.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let _=x["background-color"],C=B.fromCssColorString(_);l(C)&&C.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let f=u.getBoundingClientRect().height;r.style.height=`${f}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(VO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});VO.prototype.isDestroyed=function(){return!1};VO.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),me(this)};var T9=VO;var vGo=T(S(),1);var ZGo=T(S(),1);function k6(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Ce.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Rn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=XM.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(k6.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});k6.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),me(this)};var S9=k6;function LO(e){let t=Xn(e.container),n=new S9(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Ce.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(LO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});LO.prototype.isDestroyed=function(){return!1};LO.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var C9=LO;var YGo=T(S(),1);var MGo=T(S(),1);function _Ce(){this.showInstructions=!1;let e=this;this._command=Rn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Rn(function(){e._touch=!1}),this._showTouch=Rn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ce.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(_Ce.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var V9=_Ce;function RO(e){let t=Xn(e.container),n=new V9,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=nn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=nn("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",d.appendChild(u),d.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(d);let h=document.createElement("div");h.className="cesium-click-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),h.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(h);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Ce.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(RO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});RO.prototype.isDestroyed=function(){return!1};RO.prototype.destroy=function(){return Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var L9=RO;var oEo=T(S(),1);var jGo=T(S(),1);function ZO(e){this._scene=e,this._orthographic=e.camera.frustum instanceof rn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Ce.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ce.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Rn(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new dr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof rn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Rn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Rn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(ZO.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});ZO.prototype.isDestroyed=function(){return!1};ZO.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var R9=ZO;var f1t="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",p1t="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function GO(e,t){e=Xn(e);let n=new R9(t);n._perspectivePath=f1t,n._orthographicPath=p1t;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Ce.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(GO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});GO.prototype.isDestroyed=function(){return!1};GO.prototype.destroy=function(){return this._viewModel.destroy(),Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var Z9=GO;var yEo=T(S(),1);var uEo=T(S(),1);function EO(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new dr,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Ce.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ce.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Rn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Rn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Rn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(EO.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});EO.prototype.isDestroyed=function(){return!1};EO.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var G9=EO;var b1t="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",g1t="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",y1t="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function IO(e,t,n){e=Xn(e);let i=new G9(t,n);i._globePath=b1t,i._flatMapPath=g1t,i._columbusViewPath=y1t;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Ce.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(IO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});IO.prototype.isDestroyed=function(){return!1};IO.prototype.destroy=function(){return this._viewModel.destroy(),Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var E9=IO;var IEo=T(S(),1);var CEo=T(S(),1);var x1t=new D,XO="-1000px";function I9(e,t,n){this._scene=e,this._screenPositionX=XO,this._screenPositionY=XO,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ce.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ce.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ce.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Ui.worldToWindowCoordinates(e,i,o)}}I9.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,x1t);if(!l(e))this._screenPositionX=XO,this._screenPositionY=XO;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};I9.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Hr.EXPONENTIAL_OUT})};I9.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Hr.EXPONENTIAL_OUT})};Object.defineProperties(I9.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var X9=I9;function WO(e,t){e=Xn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new X9(t,this._element,this._container);this._viewModel=c,Ce.applyBindings(this._viewModel,this._element)}Object.defineProperties(WO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});WO.prototype.isDestroyed=function(){return!1};WO.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),me(this)};var W9=WO;var DEo=T(S(),1);var PEo=T(S(),1);function ZS(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}ZS.prototype.getHeight=function(){return this._height};ZS.prototype.getBase=function(){return this._base};ZS.prototype.getStartTime=function(){return this._start};ZS.prototype.getStopTime=function(){return this._stop};ZS.prototype.setRange=function(e,t){this._start=e,this._stop=t};ZS.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=q.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=q.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var P9=ZS;var FEo=T(S(),1);function TCe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new B(.5,.5,.5,1),this.backgroundColor=i||new B(0,0,0,0)}TCe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=q.addSeconds(t.startJulian,t.duration,new q);if(q.lessThan(n,o)&&q.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(q.lessThanOrEquals(n,r)&&q.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let d=q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new q);!l(a)&&q.greaterThanOrEquals(d,n)?a=s:!l(c)&&q.greaterThanOrEquals(d,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var v9=TCe;var U6=1e12,Sm={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},bl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Ky=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],_1t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gl(e,t){e=Xn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Sm.none,this._touchMode=bl.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=T1t(this),this._onMouseUp=S1t(this),this._onMouseMove=C1t(this),this._onMouseWheel=V1t(this),this._onTouchStart=L1t(this),this._onTouchMove=Z1t(this),this._onTouchEnd=R1t(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}gl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};gl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};gl.prototype.isDestroyed=function(){return!1};gl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),me(this)};gl.prototype.addHighlightRange=function(e,t,n){let i=new P9(e,t,n);return this._highlightRanges.push(i),this.resize(),i};gl.prototype.addTrack=function(e,t,n,i){let o=new v9(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};gl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Or.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=q.secondsDifference(o,i),s=q.secondsDifference(i,this._startJulian),a=q.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=q.addSeconds(this._endJulian,s,new q),this._startJulian=i,this._timeBarSecondsSpan=q.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=q.addSeconds(this._startJulian,a,new q),this._endJulian=o,this._timeBarSecondsSpan=q.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};gl.prototype.zoomFrom=function(e){let t=q.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(q.addSeconds(this._startJulian,t-t*e,new q),q.addSeconds(this._endJulian,n*e-n,new q))};function D6(e){return e<10?`0${e.toString()}`:e.toString()}gl.prototype.makeLabel=function(e){let t=q.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${_1t[t.month-1]} ${t.day} ${t.year} ${D6(t.hour)}:${D6(t.minute)}:${D6(t.second)}${i}`};gl.prototype.smallestTicInPixels=7;gl.prototype._makeTics=function(){let e=this._timeBarEle,t=q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,d=1e-10,u=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=q.addSeconds(this._startJulian,a,new q)):h>c&&(h=c,this._timeBarSecondsSpan=c,this._endJulian=q.addSeconds(this._startJulian,c,new q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,f=Math.min(h/p*1e-5,.4),x,_=q.toGregorianDate(g);h>31536e4?x=q.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):h>31536e3?x=q.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):h>86400?x=q.fromDate(new Date(Date.UTC(_.year,0))):x=q.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let C=q.secondsDifference(this._startJulian,q.addSeconds(x,f,new q)),V=C+h;this._epochJulian=x;function L(k){return Math.floor(C/k)*k}function Z(k,H){return Math.ceil(k/H+.5)*H}function G(k){return(k-C)/h}function I(k,H){return k-H*Math.round(k/H)}this._rulerEle.innerHTML=this.makeLabel(q.addSeconds(this._endJulian,-a,new q));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);let P=u;u-=d;let w={startTime:C,startJulian:g,epochJulian:x,duration:h,timeBarWidth:p,getAlpha:G};this._highlightRanges.forEach(function(k){s+=k.render(w)});let F=0,b=0,R=0,E=v/p;E>1&&(E=1),E*=this._timeBarSecondsSpan;let X=-1,A=-1,N=Ky.length,O;for(O=0;O<N;++O){let k=Ky[O];if(++X,F=k,k>E&&k>u)break;A<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(A=X)}if(X>0){for(;X>0;)if(--X,Math.abs(I(F,Ky[X]))<1e-5){Ky[X]>=u&&(b=Ky[X]);break}if(A>=0)for(;A<X;){if(Math.abs(I(b,Ky[A]))<1e-5&&Ky[A]>=u){R=Ky[A];break}++A}}u=P,u>d&&R<1e-5&&Math.abs(u-F)>d&&(R=u,u<=F+d&&(b=0));let U=-999999,Y;if(p*(R/this._timeBarSecondsSpan)>=3)for(o=L(R);o<=V;o=Z(o,R))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(b/this._timeBarSecondsSpan)>=3)for(o=L(b);o<=V;o=Z(o,b))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(F/this._timeBarSecondsSpan)>=2){this._mainTicSpan=F,V+=F,o=L(F);let k=q.computeTaiMinusUtc(x);for(;o<=V;){let H=q.addSeconds(g,o-C,new q);if(F>2.1){let j=q.computeTaiMinusUtc(H);Math.abs(j-k)>.1&&(o+=j-k,H=q.addSeconds(g,o-C,new q))}let J=Math.round(p*G(o)),te=this.makeLabel(H);this._rulerEle.innerHTML=te,Y=this._rulerEle.offsetWidth,Y<10&&(Y=v);let z=J-(Y/2-1);z>U?(U=z+Y+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${J.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${z.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${J.toString()}px;"></span>`,o=Z(o,F)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),w.y=0,this._trackList.forEach(function(k){k.render(r._context,w),w.y+=k.height})};gl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(q.addSeconds(this._startJulian,this._timelineDrag,new q),q.addSeconds(this._endJulian,this._timelineDrag,new q)))};gl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=q.addSeconds(this._startJulian,t,new q),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function T1t(e){return function(t){e._mouseMode!==Sm.touchOnly&&(t.button===0?(e._mouseMode=Sm.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Sm.zoom:e._mouseMode=Sm.slide)),t.preventDefault()}}function S1t(e){return function(t){e._mouseMode=Sm.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function C1t(e){return function(t){let n;if(e._mouseMode===Sm.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Sm.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(q.addSeconds(e._startJulian,i,new q),q.addSeconds(e._endJulian,i,new q))}}else e._mouseMode===Sm.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function V1t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;U6=Math.max(Math.min(Math.abs(n),U6),1),n/=U6,e.zoomFrom(Math.pow(1.05,-n))}}function L1t(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Sm.touchOnly,n===1?(i=q.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=bl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=bl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=bl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=bl.ignore}}function R1t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===bl.singleTap?(e._touchMode=bl.scrub,e._onTouchMove(t)):e._touchMode===bl.scrub&&e._onTouchMove(t),e._mouseMode=Sm.touchOnly,n!==1?e._touchMode=n>0?bl.ignore:bl.none:e._touchMode===bl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function Z1t(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===bl.singleTap&&(e._touchMode=bl.slideZoom),e._mouseMode=Sm.touchOnly,e._touchMode===bl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-d,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===bl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-d,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-d,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new q)):(n=e._touchState.centerX-r,a=q.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new q)),e.zoomTo(a,q.addSeconds(a,e._timeBarSecondsSpan*c,new q)),e._touchState.centerX=r,e._touchState.spanX=s))}}gl.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var w9=gl;var rIo=T(S(),1);var qEo=T(S(),1);var RCe=T(LCe(),1);function I1t(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function ZCe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function X1t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(ZCe(),e._locked=!1),e._noSleep.disable(),br.exitFullscreen(),n(!1)):(br.fullscreen||br.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=I1t("landscape")),t.useWebVR=!0,n(!0)))}function PO(e,t){let n=this,i=Ce.observable(br.enabled),o=Ce.observable(!1);this.isVRMode=void 0,Ce.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Ce.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&br.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Ce.observable(!1);this._isOrthographic=void 0,Ce.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new dr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof rn)}),this._locked=!1,this._noSleep=new RCe.default,this._command=Rn(function(){X1t(n,e,o,r)},Ce.getObservable(this,"isVREnabled")),this._vrElement=y(Xn(t),document.body),this._callback=function(){!br.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(ZCe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(br.changeEventName,this._callback)}Object.defineProperties(PO.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});PO.prototype.isDestroyed=function(){return!1};PO.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(br.changeEventName,this._callback),me(this)};var F9=PO;var W1t="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",P1t="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function vO(e,t,n){e=Xn(e);let i=new F9(t,n);i._exitVRPath=P1t,i._enterVRPath=W1t;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Ce.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(vO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vO.prototype.isDestroyed=function(){return!1};vO.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var A9=vO;var RIo=T(S(),1);var GCe=new le;function XCe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function v1t(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function w1t(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function ECe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof $o)return i;if(n instanceof ks)return new $o({name:w1t(n),description:v1t(n),feature:n})}if(l(e.scene.globe))return M1t(e,t.position)}var F1t=new q;function H6(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;q.equals(i,o)&&(o=q.addSeconds(i,W.EPSILON2,F1t)),e.updateFromClock(),e.zoomTo(i,o)}}}var A1t=new m;function M1t(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new $o({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=ICe();return}let a=s[0],c=new $o({id:a.name,description:a.description});if(l(a.position)){let d=e.scene.ellipsoid.cartographicToCartesian(a.position,A1t);c.position=new Dc(d)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=ICe())}),r}function ICe(){return new $o({id:"None",description:"No features found."})}function N1t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,d=e._fullscreenButton,u=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),l(u)&&(u.container.style.visibility=p),l(h)&&(h.container.style.visibility=p),e._container){let g=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function ji(e,t){e=Xn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=y(t.scene3DOnly,!1),c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new ph,d=new QM(c),u=!0);let h=new aM(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=h.scene,g=new dr;g.add(c.onTick,ji.prototype._onTick,this);let f;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let H=document.createElement("div");H.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(H),f=new W9(H,p)}let x;if(!l(t.infoBox)||t.infoBox!==!1){let H=document.createElement("div");H.className="cesium-viewer-infoBoxContainer",o.appendChild(H),x=new T9(H);let J=x.viewModel;g.add(J.cameraClicked,ji.prototype._onInfoBoxCameraClicked,this),g.add(J.closeClicked,ji.prototype._onInfoBoxClockClicked,this)}let _=document.createElement("div");_.className="cesium-viewer-toolbar",o.appendChild(_);let C;if(!l(t.geocoder)||t.geocoder!==!1){let H=document.createElement("div");H.className="cesium-viewer-geocoderContainer",_.appendChild(H);let J;typeof t.geocoder=="string"?J=[new fS({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(J=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),C=new b9({container:H,geocoderServices:J,scene:p}),g.add(C.viewModel.search.beforeExecute,ji.prototype._clearObjects,this)}let V;(!l(t.homeButton)||t.homeButton!==!1)&&(V=new y9(_,p),l(C)&&g.add(V.viewModel.command.afterExecute,function(){let H=C.viewModel;H.searchText="",H.isSearchInProgress&&H.search()}),g.add(V.viewModel.command.beforeExecute,ji.prototype._clearTrackedObject,this));let L;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(L=new E9(_,p));let Z;t.projectionPicker&&(Z=new Z9(_,p));let G,I;if(n){let H=y(t.imageryProviderViewModels,o9()),J=y(t.terrainProviderViewModels,r9());G=new i9(_,{globe:p.globe,imageryProviderViewModels:H,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:J,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),I=_.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(G.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(G.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let v;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let H=!0;try{if(l(window.localStorage)){let J=window.localStorage.getItem("cesium-hasSeenNavHelp");l(J)&&J?H=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}v=new L9({container:_,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,H)})}let P;if(!l(t.animation)||t.animation!==!1){let H=document.createElement("div");H.className="cesium-viewer-animationContainer",o.appendChild(H),P=new e9(H,new t9(d))}let w;if(!l(t.timeline)||t.timeline!==!1){let H=document.createElement("div");H.className="cesium-viewer-timelineContainer",o.appendChild(H),w=new w9(H,c),w.addEventListener("settime",XCe,!1),w.zoomTo(c.startTime,c.stopTime)}let F,b,R;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(R=document.createElement("div"),R.className="cesium-viewer-fullscreenContainer",o.appendChild(R),F=new f9(R,t.fullscreenElement),b=Ca(F.viewModel,"isFullscreenEnabled",function(H){R.style.display=H?"block":"none",l(w)&&(w.container.style.right=`${R.clientWidth}px`,w.resize())}));let E,X,A;if(t.vrButton){let H=document.createElement("div");H.className="cesium-viewer-vrContainer",o.appendChild(H),E=new A9(H,p,t.fullScreenElement),X=Ca(E.viewModel,"isVREnabled",function(J){H.style.display=J?"block":"none",l(F)&&(H.style.right=`${R.clientWidth}px`),l(w)&&(w.container.style.right=`${H.clientWidth}px`,w.resize())}),A=Ca(E.viewModel,"isVRMode",function(J){N1t(i,J)})}this._baseLayerPickerDropDown=I,this._fullscreenSubscription=b,this._vrSubscription=X,this._vrModeSubscription=A,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=f,this._infoBox=x,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=_,this._homeButton=V,this._sceneModePicker=L,this._projectionPicker=Z,this._baseLayerPicker=G,this._navigationHelpButton=v,this._animation=P,this._timeline=w,this._fullscreenButton=F,this._vrButton=E,this._geocoder=C,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(x)||l(f),this._selectedEntity=void 0,this._selectedEntityChanged=new ge;let N=this._cesiumWidget.dataSources,O=this._cesiumWidget.dataSourceDisplay;g.add(N.dataSourceAdded,ji.prototype._onDataSourceAdded,this),g.add(N.dataSourceRemoved,ji.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,ji.prototype.resize,this);let U=N.length;for(let H=0;H<U;H++)this._dataSourceAdded(N,N.get(H));this._dataSourceAdded(void 0,O.defaultDataSource),g.add(N.dataSourceAdded,ji.prototype._dataSourceAdded,this),g.add(N.dataSourceRemoved,ji.prototype._dataSourceRemoved,this);function Y(H){let J=ECe(i,H);l(J)?K.getValueOrUndefined(J.position,i.clock.currentTime)?i.trackedEntity=J:i.zoomTo(J):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(H){i.selectedEntity=ECe(i,H)}h.screenSpaceEventHandler.setInputAction(k,Sn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(Y,Sn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(ji.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,H6(this._timeline,e))}}});ji.prototype.extend=function(e,t){e(this,t)};ji.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let f=this._geocoder.searchSuggestionsContainer;f.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,d,u=0,h=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let f=this._lastWidth;d=this._animation.container,n>900?(u=169,f<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(f<600||f>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(f>600||f===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),h=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let f=this._fullscreenButton,x=this._vrButton,_=c.container,C=_.style;p=_.clientHeight+3,C.left=`${u}px`;let V=0;l(f)&&(V+=f.container.clientWidth),l(x)&&(V+=x.container.clientWidth),C.right=`${V}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};ji.prototype.forceResize=function(){this._lastWidth=0,this.resize()};ji.prototype.render=function(){this._cesiumWidget.render()};ji.prototype.isDestroyed=function(){return!1};ji.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Sn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Sn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",XCe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),me(this)};ji.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(ji.prototype._onEntityCollectionChanged,this)};ji.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(ji.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};ji.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};ji.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,GCe)!==lt.FAILED?n=GCe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=m.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=y(o.name,o.id),a.description=K.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};ji.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};ji.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};ji.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};ji.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};ji.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};ji.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&H6(this.timeline,e)};ji.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&H6(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,ji.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};ji.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};ji.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};ji.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var z6=ji;var EIo=T(S(),1);function k1t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new m9(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var K6=k1t;var WIo=T(S(),1);function U1t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new c9(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var J6=U1t;var FIo=T(S(),1);function D1t(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new ge,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Xn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){WCe(s,d),s=u,Q6(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?Q6(s,d):WCe(s,d),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return c},set:function(u){c=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){GS(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=u.dataTransfer.files,p=h.length;for(let g=0;g<p;g++){let f=h[g],x=new FileReader;x.onload=B1t(e,f,c,a),x.onerror=O1t(e,f),x.readAsText(f)}}Q6(s,d),e.destroy=TM(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function GS(e){e.stopPropagation(),e.preventDefault()}function WCe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",GS,!1),n.removeEventListener("dragover",GS,!1),n.removeEventListener("dragexit",GS,!1))}function Q6(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",GS,!1),e.addEventListener("dragover",GS,!1),e.addEventListener("dragexit",GS,!1)}function B1t(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=KP.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=bT.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=ST.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=Uv.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function O1t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var j6=D1t;var DIo=T(S(),1);function Y1t(e,t){t=y(t,y.EMPTY_OBJECT);let n=new C9({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var q6=Y1t;var iXo=T(S(),1);var eXo=T(S(),1);var zIo=T(S(),1);function PCe(e){let t=e.split(` `),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c} -`}return i}function Cm(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let d=Se.observable();return Se.defineProperty(t,r,{get:function(){return d()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),d(u),l(a)&&l(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,d}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=XCe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Ai.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Ai.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Ai.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&hp(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&hp(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&hp(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&hp(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&hp(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&hp(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&hp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&hp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&hp(t)}})}var D1t=new m,B1t=new m,O1t=new Va,Y1t=new $;function hp(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,D1t),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,B1t),i=O1t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,Y1t),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Cm.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=XCe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,hp(t)}}}});Cm.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Cm.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Cm.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Cm.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Cm.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Cm.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Cm.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new tS({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Cm.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` +`}return i}function Cm(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let d=Ce.observable();return Ce.defineProperty(t,r,{get:function(){return d()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),d(u),l(a)&&l(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,d}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=PCe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Mi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Mi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Mi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&fp(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&fp(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&fp(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&fp(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&fp(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&fp(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&fp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&fp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&fp(t)}})}var H1t=new m,z1t=new m,K1t=new Ra,J1t=new $;function fp(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,H1t),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,z1t),i=K1t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,J1t),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Cm.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=PCe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,fp(t)}}}});Cm.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Cm.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Cm.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Cm.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Cm.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Cm.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Cm.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new iS({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Cm.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` `),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(` -`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Cm.prototype.isDestroyed=function(){return!1};Cm.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),me(this)};var FM=Cm;function P3(e,t){e=Xn(e);let n=document.createElement("div"),i=new FM(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=Oa.createSection,a=Oa.createCheckbox,c=Oa.createRangeInput,d=Oa.createButton,u=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),g=s(r,"Clipping","clippingVisible","toggleClipping"),f=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(c("Screen Space Error","screenSpaceError",0,128)),u.appendChild(c("Step Size","stepSize",0,2));let x=10,_=10,C=W.PI;h.appendChild(c("Translation X","translationX",-x,+x)),h.appendChild(c("Translation Y","translationY",-x,+x)),h.appendChild(c("Translation Z","translationZ",-x,+x)),h.appendChild(c("Scale X","scaleX",0,+_)),h.appendChild(c("Scale Y","scaleY",0,+_)),h.appendChild(c("Scale Z","scaleZ",0,+_)),h.appendChild(c("Heading","angleX",-C,+C)),h.appendChild(c("Pitch","angleY",-C,+C)),h.appendChild(c("Roll","angleZ",-C,+C));let V=Ai.getMinBounds(Ai.BOX),L=Ai.getMaxBounds(Ai.BOX),Z=m.fromElements(Ai.getMinBounds(Ai.ELLIPSOID).x,Ai.getMinBounds(Ai.ELLIPSOID).y,-ne.WGS84.maximumRadius,new m),G=m.fromElements(Ai.getMaxBounds(Ai.ELLIPSOID).x,Ai.getMaxBounds(Ai.ELLIPSOID).y,1e7,new m),I=Ai.getMinBounds(Ai.CYLINDER),v=Ai.getMaxBounds(Ai.CYLINDER);wL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",V,L,"shapeIsBox",p),wL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",Z,G,"shapeIsEllipsoid",p),wL("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",I,v,"shapeIsCylinder",p),wL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",V,L,"shapeIsBox",g),wL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",Z,G,"shapeIsEllipsoid",g),wL("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",I,v,"shapeIsCylinder",g);let P=document.createElement("div");f.appendChild(P);let w=document.createElement("textarea");w.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(w);let F=d("Compile (Ctrl+Enter)","compileShader");P.appendChild(F);let b=document.createElement("label");b.style.display="block",b.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),P.appendChild(b),Se.applyBindings(i,n)}Object.defineProperties(P3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});P3.prototype.isDestroyed=function(){return!1};P3.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};function wL(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,x){let _=Oa.createRangeInput,C=p,V=g,L=x.appendChild(document.createElement("div"));L.setAttribute("data-bind",`if: ${f}`),L.appendChild(_(e,s,C.x,V.x)),L.appendChild(_(t,a,C.x,V.x)),L.appendChild(_(n,c,C.y,V.y)),L.appendChild(_(i,d,C.y,V.y)),L.appendChild(_(o,u,C.z,V.z)),L.appendChild(_(r,h,C.z,V.z))}var AM=P3;function H1t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new AM(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var $6=H1t;globalThis.CESIUM_VERSION="1.124";var z1t="1.124";return MCe(K1t);})(); +`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Cm.prototype.isDestroyed=function(){return!1};Cm.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),me(this)};var M9=Cm;function wO(e,t){e=Xn(e);let n=document.createElement("div"),i=new M9(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=Ha.createSection,a=Ha.createCheckbox,c=Ha.createRangeInput,d=Ha.createButton,u=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),g=s(r,"Clipping","clippingVisible","toggleClipping"),f=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(c("Screen Space Error","screenSpaceError",0,128)),u.appendChild(c("Step Size","stepSize",0,2));let x=10,_=10,C=W.PI;h.appendChild(c("Translation X","translationX",-x,+x)),h.appendChild(c("Translation Y","translationY",-x,+x)),h.appendChild(c("Translation Z","translationZ",-x,+x)),h.appendChild(c("Scale X","scaleX",0,+_)),h.appendChild(c("Scale Y","scaleY",0,+_)),h.appendChild(c("Scale Z","scaleZ",0,+_)),h.appendChild(c("Heading","angleX",-C,+C)),h.appendChild(c("Pitch","angleY",-C,+C)),h.appendChild(c("Roll","angleZ",-C,+C));let V=Mi.getMinBounds(Mi.BOX),L=Mi.getMaxBounds(Mi.BOX),Z=m.fromElements(Mi.getMinBounds(Mi.ELLIPSOID).x,Mi.getMinBounds(Mi.ELLIPSOID).y,-ne.WGS84.maximumRadius,new m),G=m.fromElements(Mi.getMaxBounds(Mi.ELLIPSOID).x,Mi.getMaxBounds(Mi.ELLIPSOID).y,1e7,new m),I=Mi.getMinBounds(Mi.CYLINDER),v=Mi.getMaxBounds(Mi.CYLINDER);ML("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",V,L,"shapeIsBox",p),ML("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",Z,G,"shapeIsEllipsoid",p),ML("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",I,v,"shapeIsCylinder",p),ML("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",V,L,"shapeIsBox",g),ML("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",Z,G,"shapeIsEllipsoid",g),ML("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",I,v,"shapeIsCylinder",g);let P=document.createElement("div");f.appendChild(P);let w=document.createElement("textarea");w.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(w);let F=d("Compile (Ctrl+Enter)","compileShader");P.appendChild(F);let b=document.createElement("label");b.style.display="block",b.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),P.appendChild(b),Ce.applyBindings(i,n)}Object.defineProperties(wO.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});wO.prototype.isDestroyed=function(){return!1};wO.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};function ML(e,t,n,i,o,r,s,a,c,d,u,h,p,g,f,x){let _=Ha.createRangeInput,C=p,V=g,L=x.appendChild(document.createElement("div"));L.setAttribute("data-bind",`if: ${f}`),L.appendChild(_(e,s,C.x,V.x)),L.appendChild(_(t,a,C.x,V.x)),L.appendChild(_(n,c,C.y,V.y)),L.appendChild(_(i,d,C.y,V.y)),L.appendChild(_(o,u,C.z,V.z)),L.appendChild(_(r,h,C.z,V.z))}var N9=wO;function Q1t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new N9(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var $6=Q1t;globalThis.CESIUM_VERSION="1.125";var j1t="1.125";return kCe(q1t);})(); diff --git a/public/js/Cesium2/Workers/chunk-42FICTTZ.js b/public/js/Cesium2/Workers/chunk-2GHT2S2L.js similarity index 89% rename from public/js/Cesium2/Workers/chunk-42FICTTZ.js rename to public/js/Cesium2/Workers/chunk-2GHT2S2L.js index 78ef73445..e1ad0d8e1 100644 --- a/public/js/Cesium2/Workers/chunk-42FICTTZ.js +++ b/public/js/Cesium2/Workers/chunk-2GHT2S2L.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as C}from"./chunk-RNF7TLFF.js";import{a as P}from"./chunk-GJI4ZBKE.js";import{a as O,b as L}from"./chunk-S4VBGY2U.js";import{a as y}from"./chunk-UCTPWOTZ.js";import{e as S}from"./chunk-3THTQ4QB.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; +import{a as C}from"./chunk-AKRPIQPN.js";import{a as P}from"./chunk-OKWGJEQO.js";import{a as O,b as L}from"./chunk-RH3GFHG2.js";import{a as y}from"./chunk-FRWNWNYJ.js";import{e as S}from"./chunk-LRNH5AEO.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/public/js/Cesium2/Workers/chunk-K2M3OJ7Z.js b/public/js/Cesium2/Workers/chunk-2NIQ5ECB.js similarity index 97% rename from public/js/Cesium2/Workers/chunk-K2M3OJ7Z.js rename to public/js/Cesium2/Workers/chunk-2NIQ5ECB.js index ea4e6f64d..803d75872 100644 --- a/public/js/Cesium2/Workers/chunk-K2M3OJ7Z.js +++ b/public/js/Cesium2/Workers/chunk-2NIQ5ECB.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{b as _,h as I}from"./chunk-M3A6SPGI.js";import{a as n,b as N,d as Z,e as A}from"./chunk-S4VBGY2U.js";import{a as cn}from"./chunk-UCTPWOTZ.js";import{a as T}from"./chunk-N3A5CZ2S.js";import{a as on,b as h}from"./chunk-G75U3WZT.js";import{e as x}from"./chunk-3THTQ4QB.js";function V(e){this._ellipsoid=T(e,Z.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(V.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});V.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};V.prototype.unproject=function(e,t){if(!x(e))throw new on("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new N(c,r,d)};var k=V;var mn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(mn);function un(e,t){this.start=T(e,0),this.stop=T(t,0)}var rn=un;function a(e,t){this.center=n.clone(T(e,n.ZERO)),this.radius=T(t,0)}var F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,L=new n,b=new n,H=new n,nn=new n,tn=new n,en=new n,xn=4/3*cn.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],L),c=n.clone(o,F),r=n.clone(o,Y),d=n.clone(o,J),f=n.clone(o,K),s=n.clone(o,Q),m=n.clone(o,$),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let R=o.x,M=o.y,w=o.z;R<c.x&&n.clone(o,c),R>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),v=n.magnitudeSquared(n.subtract(m,d,b)),C=c,q=f,O=u;i>O&&(O=i,C=r,q=s),v>O&&(O=v,C=d,q=m);let p=H;p.x=(C.x+q.x)*.5,p.y=(C.y+q.y)*.5,p.z=(C.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=nn;j.x=c.x,j.y=r.y,j.z=d.z;let P=tn;P.x=f.x,P.y=s.y,P.z=m.z;let D=n.midpoint(j,P,en),B=0;for(y=0;y<z;y++){n.clone(e[y],o);let R=n.magnitude(n.subtract(o,D,b));R>B&&(B=R);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<B?(n.clone(p,t.center),t.radius=l):(n.clone(D,t.center),t.radius=B),t};var an=new k,yn=new n,ln=new n,G=new N,X=new N;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;an._ellipsoid=Z.default,t=T(t,an),I.southwest(e,G),G.height=o,I.northeast(e,X),X.height=c;let d=t.project(G,yn),f=t.project(X,ln),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var pn=[];a.fromRectangle3D=function(e,t,o,c){if(t=T(t,Z.default),o=T(o,0),x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=I.subsample(e,t,o,pn);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=T(t,n.ZERO),o=T(o,3),h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=L;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,F),f=n.clone(r,Y),s=n.clone(r,J),m=n.clone(r,K),z=n.clone(r,Q),y=n.clone(r,$),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,E=e[i+2]+t.z;r.x=w,r.y=g,r.z=E,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),E<s.z&&n.clone(r,s),E>y.z&&n.clone(r,y)}let v=n.magnitudeSquared(n.subtract(m,d,b)),C=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=v;C>S&&(S=C,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=H;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),D=nn;D.x=d.x,D.y=f.y,D.z=s.z;let B=tn;B.x=m.x,B.y=z.y,B.z=y.z;let R=n.midpoint(D,B,en),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,R,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let E=Math.sqrt(g);P=(P+E)*.5,j=P*P;let W=E-P;l.x=(P*l.x+W*r.x)/E,l.y=(P*l.y+W*r.y)/E,l.z=(P*l.z+W*r.z)/E}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(R,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=L;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,F),d=n.clone(c,Y),f=n.clone(c,J),s=n.clone(c,K),m=n.clone(c,Q),z=n.clone(c,$),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),v=n.magnitudeSquared(n.subtract(m,d,b)),C=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;v>p&&(p=v,q=d,O=m),C>p&&(p=C,q=f,O=z);let S=H;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=nn;P.x=r.x,P.y=d.y,P.z=f.z;let D=tn;D.x=s.x,D.y=m.y,D.z=z.z;let B=n.midpoint(P,D,en),R=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,B,b));M>R&&(R=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let E=g-j;S.x=(j*S.x+E*c.x)/g,S.y=(j*S.y+E*c.y)/g,S.z=(j*S.z+E*c.z)/g}}return j<R?(n.clone(S,o.center),o.radius=j):(n.clone(B,o.center),o.radius=R),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var hn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,hn)+s.radius)}return t.radius=f,t};var zn=new n,Sn=new n,wn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=A.getColumn(o,0,zn),r=A.getColumn(o,1,Sn),d=A.getColumn(o,2,wn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var Pn=new n,gn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=_.getTranslation(e,Pn),c=_.getScale(e,gn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=T(o,0);let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=T(t,0),x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var On=new n,jn=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,On),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,jn);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var bn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,bn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=_.multiplyByPoint(t,e.center,o.center),o.radius=_.getMaximumScale(t)*e.radius,o};var qn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,qn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=_.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var Mn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new rn);let r=n.subtract(e.center,t,Mn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var dn=new n,Tn=new n,Cn=new n,Rn=new n,En=new n,Dn=new N,sn=new Array(8);for(let e=0;e<8;++e)sn[e]=new n;var fn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),fn._ellipsoid=Z.default,t=T(t,fn);let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,dn):f=c.geodeticSurfaceNormal(r,dn);let s=n.cross(n.UNIT_Z,f,Tn);n.normalize(s,s);let m=n.cross(f,s,Cn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,En),y=n.negate(s,Rn),u=sn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let v=u.length;for(let p=0;p<v;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,Dn);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let C=r.x,q=r.y,O=r.z;return r.x=O,r.y=C,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return xn*e*e*e};var et=a;export{k as a,U as b,rn as c,et as d}; +import{b as _,h as I}from"./chunk-7YEOLR2L.js";import{a as n,b as N,d as Z,e as A}from"./chunk-RH3GFHG2.js";import{a as cn}from"./chunk-FRWNWNYJ.js";import{a as T}from"./chunk-TA3RE4KQ.js";import{a as on,b as h}from"./chunk-RTY3VPG6.js";import{e as x}from"./chunk-LRNH5AEO.js";function V(e){this._ellipsoid=T(e,Z.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(V.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});V.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};V.prototype.unproject=function(e,t){if(!x(e))throw new on("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new N(c,r,d)};var k=V;var mn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(mn);function un(e,t){this.start=T(e,0),this.stop=T(t,0)}var rn=un;function a(e,t){this.center=n.clone(T(e,n.ZERO)),this.radius=T(t,0)}var F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,L=new n,b=new n,H=new n,nn=new n,tn=new n,en=new n,xn=4/3*cn.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],L),c=n.clone(o,F),r=n.clone(o,Y),d=n.clone(o,J),f=n.clone(o,K),s=n.clone(o,Q),m=n.clone(o,$),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let R=o.x,M=o.y,w=o.z;R<c.x&&n.clone(o,c),R>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),v=n.magnitudeSquared(n.subtract(m,d,b)),C=c,q=f,O=u;i>O&&(O=i,C=r,q=s),v>O&&(O=v,C=d,q=m);let p=H;p.x=(C.x+q.x)*.5,p.y=(C.y+q.y)*.5,p.z=(C.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=nn;j.x=c.x,j.y=r.y,j.z=d.z;let P=tn;P.x=f.x,P.y=s.y,P.z=m.z;let D=n.midpoint(j,P,en),B=0;for(y=0;y<z;y++){n.clone(e[y],o);let R=n.magnitude(n.subtract(o,D,b));R>B&&(B=R);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<B?(n.clone(p,t.center),t.radius=l):(n.clone(D,t.center),t.radius=B),t};var an=new k,yn=new n,ln=new n,G=new N,X=new N;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;an._ellipsoid=Z.default,t=T(t,an),I.southwest(e,G),G.height=o,I.northeast(e,X),X.height=c;let d=t.project(G,yn),f=t.project(X,ln),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var pn=[];a.fromRectangle3D=function(e,t,o,c){if(t=T(t,Z.default),o=T(o,0),x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=I.subsample(e,t,o,pn);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=T(t,n.ZERO),o=T(o,3),h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=L;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,F),f=n.clone(r,Y),s=n.clone(r,J),m=n.clone(r,K),z=n.clone(r,Q),y=n.clone(r,$),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,E=e[i+2]+t.z;r.x=w,r.y=g,r.z=E,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),E<s.z&&n.clone(r,s),E>y.z&&n.clone(r,y)}let v=n.magnitudeSquared(n.subtract(m,d,b)),C=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=v;C>S&&(S=C,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=H;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),D=nn;D.x=d.x,D.y=f.y,D.z=s.z;let B=tn;B.x=m.x,B.y=z.y,B.z=y.z;let R=n.midpoint(D,B,en),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,R,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let E=Math.sqrt(g);P=(P+E)*.5,j=P*P;let W=E-P;l.x=(P*l.x+W*r.x)/E,l.y=(P*l.y+W*r.y)/E,l.z=(P*l.z+W*r.z)/E}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(R,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=L;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,F),d=n.clone(c,Y),f=n.clone(c,J),s=n.clone(c,K),m=n.clone(c,Q),z=n.clone(c,$),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),v=n.magnitudeSquared(n.subtract(m,d,b)),C=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;v>p&&(p=v,q=d,O=m),C>p&&(p=C,q=f,O=z);let S=H;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=nn;P.x=r.x,P.y=d.y,P.z=f.z;let D=tn;D.x=s.x,D.y=m.y,D.z=z.z;let B=n.midpoint(P,D,en),R=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,B,b));M>R&&(R=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let E=g-j;S.x=(j*S.x+E*c.x)/g,S.y=(j*S.y+E*c.y)/g,S.z=(j*S.z+E*c.z)/g}}return j<R?(n.clone(S,o.center),o.radius=j):(n.clone(B,o.center),o.radius=R),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var hn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,hn)+s.radius)}return t.radius=f,t};var zn=new n,Sn=new n,wn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=A.getColumn(o,0,zn),r=A.getColumn(o,1,Sn),d=A.getColumn(o,2,wn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var Pn=new n,gn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=_.getTranslation(e,Pn),c=_.getScale(e,gn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=T(o,0);let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=T(t,0),x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var On=new n,jn=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,On),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,jn);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var bn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,bn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=_.multiplyByPoint(t,e.center,o.center),o.radius=_.getMaximumScale(t)*e.radius,o};var qn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,qn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=_.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var Mn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new rn);let r=n.subtract(e.center,t,Mn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var dn=new n,Tn=new n,Cn=new n,Rn=new n,En=new n,Dn=new N,sn=new Array(8);for(let e=0;e<8;++e)sn[e]=new n;var fn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),fn._ellipsoid=Z.default,t=T(t,fn);let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,dn):f=c.geodeticSurfaceNormal(r,dn);let s=n.cross(n.UNIT_Z,f,Tn);n.normalize(s,s);let m=n.cross(f,s,Cn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,En),y=n.negate(s,Rn),u=sn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let v=u.length;for(let p=0;p<v;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,Dn);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let C=r.x,q=r.y,O=r.z;return r.x=O,r.y=C,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return xn*e*e*e};var et=a;export{k as a,U as b,rn as c,et as d}; diff --git a/public/js/Cesium2/Workers/chunk-4BYMTYMT.js b/public/js/Cesium2/Workers/chunk-4E3APMCC.js similarity index 95% rename from public/js/Cesium2/Workers/chunk-4BYMTYMT.js rename to public/js/Cesium2/Workers/chunk-4E3APMCC.js index c7b61f55c..62d8e1156 100644 --- a/public/js/Cesium2/Workers/chunk-4BYMTYMT.js +++ b/public/js/Cesium2/Workers/chunk-4E3APMCC.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,6 +23,6 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{e as f}from"./chunk-3THTQ4QB.js";function c(t){let n,a=t.name,e=t.message;f(a)&&f(e)?n=`${a}: ${e}`:n=t.toString();let o=t.stack;return f(o)&&(n+=` +import{e as f}from"./chunk-LRNH5AEO.js";function c(t){let n,a=t.name,e=t.message;f(a)&&f(e)?n=`${a}: ${e}`:n=t.toString();let o=t.stack;return f(o)&&(n+=` ${o}`),n}var i=c;function l(t){async function n({data:e}){let o=[],s={id:e.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=e.baseUrl;try{let r=await t(e.parameters,o);s.result=r}catch(r){r instanceof Error?s.error={name:r.name,message:r.message,stack:r.stack}:s.error=r}e.canTransferArrayBuffer||(o.length=0);try{postMessage(s,o)}catch(r){s.result=void 0,s.error=`postMessage failed with error: ${i(r)} with responseMessage: ${JSON.stringify(s)}`,postMessage(s)}}function a(e){postMessage({id:e.data?.id,error:`postMessage failed with error: ${JSON.stringify(e)}`})}return self.onmessage=n,self.onmessageerror=a,self}var d=l;export{d as a}; diff --git a/public/js/Cesium2/Workers/chunk-W5MIOKEY.js b/public/js/Cesium2/Workers/chunk-4MYAYFOP.js similarity index 84% rename from public/js/Cesium2/Workers/chunk-W5MIOKEY.js rename to public/js/Cesium2/Workers/chunk-4MYAYFOP.js index 2b0991885..f1bc8d042 100644 --- a/public/js/Cesium2/Workers/chunk-W5MIOKEY.js +++ b/public/js/Cesium2/Workers/chunk-4MYAYFOP.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{b as t}from"./chunk-M3A6SPGI.js";import{a as r}from"./chunk-N3A5CZ2S.js";import{a as m}from"./chunk-G75U3WZT.js";import{e as i}from"./chunk-3THTQ4QB.js";function d(e){if(e=r(e,r.EMPTY_OBJECT),!i(e.geometry))throw new m("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=t.clone(r(e.modelMatrix,t.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=r(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var s=d;export{s as a}; +import{b as t}from"./chunk-7YEOLR2L.js";import{a as r}from"./chunk-TA3RE4KQ.js";import{a as m}from"./chunk-RTY3VPG6.js";import{e as i}from"./chunk-LRNH5AEO.js";function d(e){if(e=r(e,r.EMPTY_OBJECT),!i(e.geometry))throw new m("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=t.clone(r(e.modelMatrix,t.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=r(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var s=d;export{s as a}; diff --git a/public/js/Cesium2/Workers/chunk-6HIVPZ7K.js b/public/js/Cesium2/Workers/chunk-6VK5R74O.js similarity index 93% rename from public/js/Cesium2/Workers/chunk-6HIVPZ7K.js rename to public/js/Cesium2/Workers/chunk-6VK5R74O.js index 73538c96e..b8c60b7a6 100644 --- a/public/js/Cesium2/Workers/chunk-6HIVPZ7K.js +++ b/public/js/Cesium2/Workers/chunk-6VK5R74O.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as t}from"./chunk-N3A5CZ2S.js";import{a as O}from"./chunk-G75U3WZT.js";import{e as f}from"./chunk-3THTQ4QB.js";function n(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}n.POSITION_ONLY=Object.freeze(new n({position:!0}));n.POSITION_AND_NORMAL=Object.freeze(new n({position:!0,normal:!0}));n.POSITION_NORMAL_AND_ST=Object.freeze(new n({position:!0,normal:!0,st:!0}));n.POSITION_AND_ST=Object.freeze(new n({position:!0,st:!0}));n.POSITION_AND_COLOR=Object.freeze(new n({position:!0,color:!0}));n.ALL=Object.freeze(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));n.DEFAULT=n.POSITION_NORMAL_AND_ST;n.packedLength=6;n.pack=function(e,o,i){if(!f(e))throw new O("value is required");if(!f(o))throw new O("array is required");return i=t(i,0),o[i++]=e.position?1:0,o[i++]=e.normal?1:0,o[i++]=e.st?1:0,o[i++]=e.tangent?1:0,o[i++]=e.bitangent?1:0,o[i]=e.color?1:0,o};n.unpack=function(e,o,i){if(!f(e))throw new O("array is required");return o=t(o,0),f(i)||(i=new n),i.position=e[o++]===1,i.normal=e[o++]===1,i.st=e[o++]===1,i.tangent=e[o++]===1,i.bitangent=e[o++]===1,i.color=e[o]===1,i};n.clone=function(e,o){if(f(e))return f(o)||(o=new n),o.position=e.position,o.normal=e.normal,o.st=e.st,o.tangent=e.tangent,o.bitangent=e.bitangent,o.color=e.color,o};var _=n;export{_ as a}; +import{a as t}from"./chunk-TA3RE4KQ.js";import{a as O}from"./chunk-RTY3VPG6.js";import{e as f}from"./chunk-LRNH5AEO.js";function n(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}n.POSITION_ONLY=Object.freeze(new n({position:!0}));n.POSITION_AND_NORMAL=Object.freeze(new n({position:!0,normal:!0}));n.POSITION_NORMAL_AND_ST=Object.freeze(new n({position:!0,normal:!0,st:!0}));n.POSITION_AND_ST=Object.freeze(new n({position:!0,st:!0}));n.POSITION_AND_COLOR=Object.freeze(new n({position:!0,color:!0}));n.ALL=Object.freeze(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));n.DEFAULT=n.POSITION_NORMAL_AND_ST;n.packedLength=6;n.pack=function(e,o,i){if(!f(e))throw new O("value is required");if(!f(o))throw new O("array is required");return i=t(i,0),o[i++]=e.position?1:0,o[i++]=e.normal?1:0,o[i++]=e.st?1:0,o[i++]=e.tangent?1:0,o[i++]=e.bitangent?1:0,o[i]=e.color?1:0,o};n.unpack=function(e,o,i){if(!f(e))throw new O("array is required");return o=t(o,0),f(i)||(i=new n),i.position=e[o++]===1,i.normal=e[o++]===1,i.st=e[o++]===1,i.tangent=e[o++]===1,i.bitangent=e[o++]===1,i.color=e[o]===1,i};n.clone=function(e,o){if(f(e))return f(o)||(o=new n),o.position=e.position,o.normal=e.normal,o.st=e.st,o.tangent=e.tangent,o.bitangent=e.bitangent,o.color=e.color,o};var _=n;export{_ as a}; diff --git a/public/js/Cesium2/Workers/chunk-7YEOLR2L.js b/public/js/Cesium2/Workers/chunk-7YEOLR2L.js new file mode 100644 index 000000000..cb8a88455 --- /dev/null +++ b/public/js/Cesium2/Workers/chunk-7YEOLR2L.js @@ -0,0 +1,66 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.125 + * + * Copyright 2011-2022 Cesium Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Columbus View (Pat. Pend.) + * + * Portions licensed separately. + * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. + */ + +import{a as _,b as Me,c as Oe,d as Ie,e as Q,f as un}from"./chunk-RH3GFHG2.js";import{a as E}from"./chunk-FRWNWNYJ.js";import{a as Se}from"./chunk-UAWOHN7R.js";import{a as O}from"./chunk-TA3RE4KQ.js";import{a as j,b as s}from"./chunk-RTY3VPG6.js";import{a as Sn,c as Rn,d as Ze,e as p}from"./chunk-LRNH5AEO.js";var Pt=Rn((en,nn)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var n=typeof en=="object"&&en&&!en.nodeType&&en,t=typeof nn=="object"&&nn&&!nn.nodeType&&nn,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,a=36,u=1,d=26,m=38,l=700,w=72,T=128,C="-",P=/^xn--/,A=/[^\x20-\x7E]/,q=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=a-u,F=Math.floor,B=String.fromCharCode,W;function H(b){throw new RangeError(k[b])}function ee(b,I){for(var N=b.length,Y=[];N--;)Y[N]=I(b[N]);return Y}function re(b,I){var N=b.split("@"),Y="";N.length>1&&(Y=N[0]+"@",b=N[1]),b=b.replace(q,".");var ie=b.split("."),ae=ee(ie,I).join(".");return Y+ae}function Z(b){for(var I=[],N=0,Y=b.length,ie,ae;N<Y;)ie=b.charCodeAt(N++),ie>=55296&&ie<=56319&&N<Y?(ae=b.charCodeAt(N++),(ae&64512)==56320?I.push(((ie&1023)<<10)+(ae&1023)+65536):(I.push(ie),N--)):I.push(ie);return I}function oe(b){return ee(b,function(I){var N="";return I>65535&&(I-=65536,N+=B(I>>>10&1023|55296),I=56320|I&1023),N+=B(I),N}).join("")}function J(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:a}function c(b,I){return b+22+75*(b<26)-((I!=0)<<5)}function f(b,I,N){var Y=0;for(b=N?F(b/l):b>>1,b+=F(b/I);b>L*d>>1;Y+=a)b=F(b/L);return F(Y+(L+1)*b/(b+m))}function h(b){var I=[],N=b.length,Y,ie=0,ae=T,ne=w,ue,de,ye,me,he,X,_e,Te,je;for(ue=b.lastIndexOf(C),ue<0&&(ue=0),de=0;de<ue;++de)b.charCodeAt(de)>=128&&H("not-basic"),I.push(b.charCodeAt(de));for(ye=ue>0?ue+1:0;ye<N;){for(me=ie,he=1,X=a;ye>=N&&H("invalid-input"),_e=J(b.charCodeAt(ye++)),(_e>=a||_e>F((r-ie)/he))&&H("overflow"),ie+=_e*he,Te=X<=ne?u:X>=ne+d?d:X-ne,!(_e<Te);X+=a)je=a-Te,he>F(r/je)&&H("overflow"),he*=je;Y=I.length+1,ne=f(ie-me,Y,me==0),F(ie/Y)>r-ae&&H("overflow"),ae+=F(ie/Y),ie%=Y,I.splice(ie++,0,ae)}return oe(I)}function y(b){var I,N,Y,ie,ae,ne,ue,de,ye,me,he,X=[],_e,Te,je,fn;for(b=Z(b),_e=b.length,I=T,N=0,ae=w,ne=0;ne<_e;++ne)he=b[ne],he<128&&X.push(B(he));for(Y=ie=X.length,ie&&X.push(C);Y<_e;){for(ue=r,ne=0;ne<_e;++ne)he=b[ne],he>=I&&he<ue&&(ue=he);for(Te=Y+1,ue-I>F((r-N)/Te)&&H("overflow"),N+=(ue-I)*Te,I=ue,ne=0;ne<_e;++ne)if(he=b[ne],he<I&&++N>r&&H("overflow"),he==I){for(de=N,ye=a;me=ye<=ae?u:ye>=ae+d?d:ye-ae,!(de<me);ye+=a)fn=de-me,je=a-me,X.push(B(c(me+fn%je,0))),de=F(fn/je);X.push(B(c(de,0))),ae=f(N,Te,Y==ie),N=0,++Y}++N,++I}return X.join("")}function g(b){return re(b,function(I){return P.test(I)?h(I.slice(4).toLowerCase()):I})}function v(b){return re(b,function(I){return A.test(I)?"xn--"+y(I):I})}if(i={version:"1.3.2",ucs2:{decode:Z,encode:oe},decode:h,encode:y,toASCII:v,toUnicode:g},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(n&&t)if(nn.exports==n)t.exports=i;else for(W in i)i.hasOwnProperty(W)&&(n[W]=i[W]);else e.punycode=i})(en)});var zt=Rn((Ut,Mn)=>{/*! + * URI.js - Mutating URLs + * IPv6 Support + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + */(function(e,n){"use strict";typeof Mn=="object"&&Mn.exports?Mn.exports=n():typeof define=="function"&&define.amd?define(n):e.IPv6=n(e)})(Ut,function(e){"use strict";var n=e&&e.IPv6;function t(i){var r=i.toLowerCase(),a=r.split(":"),u=a.length,d=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[u-1]===""&&a[u-2]===""&&a.pop(),u=a.length,a[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&a[m]!=="";m++);if(m<d)for(a.splice(m,1,"0000");a.length<d;)a.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=a[w].split("");for(var T=0;T<3&&(l[0]==="0"&&l.length>1);T++)l.splice(0,1);a[w]=l.join("")}var C=-1,P=0,A=0,q=-1,k=!1;for(w=0;w<d;w++)k?a[w]==="0"?A+=1:(k=!1,A>P&&(C=q,P=A)):a[w]==="0"&&(k=!0,q=w,A=1);A>P&&(C=q,P=A),P>1&&a.splice(C,P,""),u=a.length;var L="";for(a[0]===""&&(L=":"),w=0;w<u&&(L+=a[w],w!==u-1);w++)L+=":";return a[u-1]===""&&(L+=":"),L}function o(){return e.IPv6===this&&(e.IPv6=n),this}return{best:t,noConflict:o}})});var qt=Rn((It,Pn)=>{/*! + * URI.js - Mutating URLs + * Second Level Domain (SLD) Support + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + */(function(e,n){"use strict";typeof Pn=="object"&&Pn.exports?Pn.exports=n():typeof define=="function"&&define.amd?define(n):e.SecondLevelDomains=n(e)})(It,function(e){"use strict";var n=e&&e.SecondLevelDomains,t={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var a=t.list[o.slice(i+1)];return a?a.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var a=t.list[o.slice(i+1)];return a?a.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var a=t.list[o.slice(i+1)];return!a||a.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=n),this}};return t})});var Qe=Rn((Dt,Un)=>{/*! + * URI.js - Mutating URLs + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + */(function(e,n){"use strict";typeof Un=="object"&&Un.exports?Un.exports=n(Pt(),zt(),qt()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],n):e.URI=n(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Dt,function(e,n,t,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function a(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function T(c,f){var h={},y,g;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,g=f.length;y<g;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,g=c.length;y<g;y++){var v=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);v&&(c.splice(y,1),g--,y--)}return c}function C(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!C(c,f[h]))return!1;return!0}var g=l(f);for(h=0,y=c.length;h<y;h++)if(g==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function P(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function A(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-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])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function q(c){return escape(c)}function k(c){return encodeURIComponent(c).replace(/[!'()*]/g,q).replace(/\*/g,"%2A")}r.encode=k,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=k,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var L={encode:"encode",decode:"decode"},F,B=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(F in L)r[F+"PathSegment"]=B("pathname",L[F]),r[F+"UrnPathSegment"]=B("urnpath",L[F]);var W=function(c,f,h){return function(y){var g;h?g=function(N){return r[f](r[h](N))}:g=r[f];for(var v=(y+"").split(c),b=0,I=v.length;b<I;b++)v[b]=g(v[b]);return v.join(c)}};r.decodePath=W("/","decodePathSegment"),r.decodeUrnPath=W(":","decodeUrnPathSegment"),r.recodePath=W("/","encodePathSegment","decode"),r.recodeUrnPath=W(":","encodeUrnPathSegment","decode"),r.encodeReserved=B("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,g;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var v=c.indexOf(":"),b=c.indexOf("/"),I=c.indexOf(":",v+1);I!==-1&&(b===-1||I<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(g=c.substring(0,h).split(":"),f.hostname=g[0]||null,f.port=g[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var g=c.indexOf("/"),v=c.lastIndexOf("@",g>-1?g:c.length-1),b;return v>-1&&(g===-1||v<g)?(b=c.substring(0,v).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(v+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),g=y.length,v,b,I,N=0;N<g;N++)v=y[N].split("="),b=r.decodeQuery(v.shift(),f),I=v.length?r.decodeQuery(v.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(I)):h[b]=I);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",g,v,b,I;for(v in c)if(v!=="__proto__"&&d.call(c,v))if(w(c[v]))for(g={},b=0,I=c[v].length;b<I;b++)c[v][b]!==void 0&&g[c[v][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(v,c[v][b],h),f!==!0&&(g[c[v][b]+""]=!0));else c[v]!==void 0&&(y+="&"+r.buildQueryParameter(v,c[v],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,g,v;if(w(f))for(y=0,g=f.length;y<g;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(v in c)f.test(v)&&(c[v]=void 0);else if(typeof f=="object")for(v in f)d.call(f,v)&&r.removeQuery(c,v,f[v]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=T(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=T(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var g in c)if(d.call(c,g)&&f.test(g)&&(h===void 0||r.hasQuery(c,g,h)))return!0;return!1;case"Object":for(var v in f)if(d.call(f,v)&&!r.hasQuery(c,v,f[v]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var I=y?C:P;return I(c[f],h);case"RegExp":return w(c[f])?y?C(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?C(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var g=new r(arguments[y]);c.push(g);for(var v=g.segment(),b=0;b<v.length;b++)typeof v[b]=="string"&&f.push(v[b]),v[b]&&h++}if(!f.length||!h)return new r("");var I=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&I.path("/"+I.path()),I.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,g=h.end||r.findUri.end,v=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,I=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var N=y.exec(c);if(!N)break;var Y=N.index;if(h.ignoreHtml){var ie=c.slice(Math.max(Y-3,0),Y);if(ie&&I.test(ie))continue}for(var ae=Y+c.slice(Y).search(g),ne=c.slice(Y,ae),ue=-1;;){var de=b.exec(ne);if(!de)break;var ye=de.index+de[0].length;ue=Math.max(ue,ye)}if(ue>-1?ne=ne.slice(0,ue)+ne.slice(ue).replace(v,""):ne=ne.replace(v,""),!(ne.length<=N[0].length)&&!(h.ignore&&h.ignore.test(ne))){ae=Y+ne.length;var me=f(ne,Y,ae,c);if(me===void 0){y.lastIndex=ae;continue}me=String(me),c=c.slice(0,Y)+me+c.slice(ae),y.lastIndex=Y+me.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,g=!1;if(y&&(g=C(r.hostProtocols,f)),g&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(a(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function H(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function ee(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=H("protocol"),u.username=H("username"),u.password=H("password"),u.hostname=H("hostname"),u.port=H("port"),u.query=ee("query","?"),u.fragment=ee("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,g=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var v=r.getDomAttribute(c);c=c[v]||"",g=!1}if(!y&&g&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||g){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,g=!1,v=!1,b=!1,I=!1,N=!this._parts.urn;switch(this._parts.hostname&&(N=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,g=!f,v=g&&t&&t.has(this._parts.hostname),b=g&&r.idn_expression.test(this._parts.hostname),I=g&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return N;case"absolute":return!N;case"domain":case"name":return g;case"sld":return v;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return I}return null};var re=u.protocol,Z=u.port,oe=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return re.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),Z.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return oe.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var g=r(c);return this.protocol(g.protocol()).authority(g.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,g=this._parts.hostname.substring(0,y),v=new RegExp("^"+m(g));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(v,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var g=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(g,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&t&&t.list[y.toLowerCase()]&&t.get(this._parts.hostname)||y}else{var g;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(t&&t.is(c))g=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(g,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");g=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(g,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var g=this._parts.path.length-this.filename().length,v=this._parts.path.substring(0,g),b=new RegExp("^"+m(v));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var g=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(g=!0);var v=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(v,c),g?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),g,v;return y===-1?"":(g=h.substring(y+1),v=/^[a-z0-9%]+$/i.test(g)?g:"",c?r.decodePathSegment(v):v)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),I;if(b)c?I=new RegExp(m(b)+"$"):I=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return I&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(I,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",g=this.path(),v=g.substring(0,1)==="/",b=g.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(v&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var I=0,N=f.length;I<N;I++)!f[I].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(A(f[I])))}else(f||typeof f=="string")&&(f=A(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=A(f):b.splice(c,1);return v&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,g,v;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(g=0,v=y.length;g<v;g++)y[g]=r.decode(y[g]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(g=0,v=f.length;g<v;g++)f[g]=r.encode(f[g]);return this.segment(c,f,h)};var J=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):J.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var g in c)d.call(c,g)&&(y[g]=c[g]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",g,v;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));g=f.search(/\/\.\.(\/|$)/),g!==-1;){if(g===0){f=f.substring(3);continue}v=f.substring(0,g).lastIndexOf("/"),v===-1&&(v=g),f=f.substring(0,v)+f.substring(g+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=k,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,g=c._parts.query.split("&"),v=g.length;y<v;y++){var b=(g[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,g,v;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(g=0;v=h[g];g++)f._parts[v]=c._parts[v];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,g,v,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,v=f.path(),b=c.path(),v.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(v===b)return h.path="",f.build();if(g=r.commonPath(v,b),!g)return f.build();var I=y.path.substring(g.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=I+h.path.substring(g.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},g={},v={},b,I,N;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),I=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==I.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),g=r.parseQuery(I,this._parts.escapeQuerySpace);for(N in y)if(d.call(y,N)){if(w(y[N])){if(!P(y[N],g[N]))return!1}else if(y[N]!==g[N])return!1;v[N]=!0}for(N in g)if(d.call(g,N)&&!v[N])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function M(e,n,t,o){this.x=O(e,0),this.y=O(n,0),this.z=O(t,0),this.w=O(o,0)}M.fromElements=function(e,n,t,o,i){return p(i)?(i.x=e,i.y=n,i.z=t,i.w=o,i):new M(e,n,t,o)};M.fromColor=function(e,n){return s.typeOf.object("color",e),p(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new M(e.red,e.green,e.blue,e.alpha)};M.clone=function(e,n){if(p(e))return p(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new M(e.x,e.y,e.z,e.w)};M.packedLength=4;M.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=O(t,0),n[t++]=e.x,n[t++]=e.y,n[t++]=e.z,n[t]=e.w,n};M.unpack=function(e,n,t){return s.defined("array",e),n=O(n,0),p(t)||(t=new M),t.x=e[n++],t.y=e[n++],t.z=e[n++],t.w=e[n],t};M.packArray=function(e,n){s.defined("array",e);let t=e.length,o=t*4;if(!p(n))n=new Array(o);else{if(!Array.isArray(n)&&n.length!==o)throw new j("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==o&&(n.length=o)}for(let i=0;i<t;++i)M.pack(e[i],n,i*4);return n};M.unpackArray=function(e,n){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new j("array length must be a multiple of 4.");let t=e.length;p(n)?n.length=t/4:n=new Array(t/4);for(let o=0;o<t;o+=4){let i=o/4;n[i]=M.unpack(e,o,n[i])}return n};M.fromArray=M.unpack;M.maximumComponent=function(e){return s.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};M.minimumComponent=function(e){return s.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};M.minimumByComponent=function(e,n,t){return s.typeOf.object("first",e),s.typeOf.object("second",n),s.typeOf.object("result",t),t.x=Math.min(e.x,n.x),t.y=Math.min(e.y,n.y),t.z=Math.min(e.z,n.z),t.w=Math.min(e.w,n.w),t};M.maximumByComponent=function(e,n,t){return s.typeOf.object("first",e),s.typeOf.object("second",n),s.typeOf.object("result",t),t.x=Math.max(e.x,n.x),t.y=Math.max(e.y,n.y),t.z=Math.max(e.z,n.z),t.w=Math.max(e.w,n.w),t};M.clamp=function(e,n,t,o){s.typeOf.object("value",e),s.typeOf.object("min",n),s.typeOf.object("max",t),s.typeOf.object("result",o);let i=E.clamp(e.x,n.x,t.x),r=E.clamp(e.y,n.y,t.y),a=E.clamp(e.z,n.z,t.z),u=E.clamp(e.w,n.w,t.w);return o.x=i,o.y=r,o.z=a,o.w=u,o};M.magnitudeSquared=function(e){return s.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};M.magnitude=function(e){return Math.sqrt(M.magnitudeSquared(e))};var En=new M;M.distance=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),M.subtract(e,n,En),M.magnitude(En)};M.distanceSquared=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),M.subtract(e,n,En),M.magnitudeSquared(En)};M.normalize=function(e,n){s.typeOf.object("cartesian",e),s.typeOf.object("result",n);let t=M.magnitude(e);if(n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new j("normalized result is not a number");return n};M.dot=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z+e.w*n.w};M.multiplyComponents=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x*n.x,t.y=e.y*n.y,t.z=e.z*n.z,t.w=e.w*n.w,t};M.divideComponents=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x/n.x,t.y=e.y/n.y,t.z=e.z/n.z,t.w=e.w/n.w,t};M.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x+n.x,t.y=e.y+n.y,t.z=e.z+n.z,t.w=e.w+n.w,t};M.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x-n.x,t.y=e.y-n.y,t.z=e.z-n.z,t.w=e.w-n.w,t};M.multiplyByScalar=function(e,n,t){return s.typeOf.object("cartesian",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t.w=e.w*n,t};M.divideByScalar=function(e,n,t){return s.typeOf.object("cartesian",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};M.negate=function(e,n){return s.typeOf.object("cartesian",e),s.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=-e.w,n};M.abs=function(e,n){return s.typeOf.object("cartesian",e),s.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n.z=Math.abs(e.z),n.w=Math.abs(e.w),n};var Et=new M;M.lerp=function(e,n,t,o){return s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o),M.multiplyByScalar(n,t,Et),o=M.multiplyByScalar(e,1-t,o),M.add(Et,o,o)};var zo=new M;M.mostOrthogonalAxis=function(e,n){s.typeOf.object("cartesian",e),s.typeOf.object("result",n);let t=M.normalize(e,zo);return M.abs(t,t),t.x<=t.y?t.x<=t.z?t.x<=t.w?n=M.clone(M.UNIT_X,n):n=M.clone(M.UNIT_W,n):t.z<=t.w?n=M.clone(M.UNIT_Z,n):n=M.clone(M.UNIT_W,n):t.y<=t.z?t.y<=t.w?n=M.clone(M.UNIT_Y,n):n=M.clone(M.UNIT_W,n):t.z<=t.w?n=M.clone(M.UNIT_Z,n):n=M.clone(M.UNIT_W,n),n};M.equals=function(e,n){return e===n||p(e)&&p(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w};M.equalsArray=function(e,n,t){return e.x===n[t]&&e.y===n[t+1]&&e.z===n[t+2]&&e.w===n[t+3]};M.equalsEpsilon=function(e,n,t,o){return e===n||p(e)&&p(n)&&E.equalsEpsilon(e.x,n.x,t,o)&&E.equalsEpsilon(e.y,n.y,t,o)&&E.equalsEpsilon(e.z,n.z,t,o)&&E.equalsEpsilon(e.w,n.w,t,o)};M.ZERO=Object.freeze(new M(0,0,0,0));M.ONE=Object.freeze(new M(1,1,1,1));M.UNIT_X=Object.freeze(new M(1,0,0,0));M.UNIT_Y=Object.freeze(new M(0,1,0,0));M.UNIT_Z=Object.freeze(new M(0,0,1,0));M.UNIT_W=Object.freeze(new M(0,0,0,1));M.prototype.clone=function(e){return M.clone(this,e)};M.prototype.equals=function(e){return M.equals(this,e)};M.prototype.equalsEpsilon=function(e,n,t){return M.equalsEpsilon(this,e,n,t)};M.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Jn=new Float32Array(1),le=new Uint8Array(Jn.buffer),Io=new Uint32Array([287454020]),qo=new Uint8Array(Io.buffer),Tt=qo[0]===68;M.packFloat=function(e,n){return s.typeOf.number("value",e),p(n)||(n=new M),Jn[0]=e,Tt?(n.x=le[0],n.y=le[1],n.z=le[2],n.w=le[3]):(n.x=le[3],n.y=le[2],n.z=le[1],n.w=le[0]),n};M.unpackFloat=function(e){return s.typeOf.object("packedFloat",e),Tt?(le[0]=e.x,le[1]=e.y,le[2]=e.z,le[3]=e.w):(le[0]=e.w,le[1]=e.z,le[2]=e.y,le[3]=e.x),Jn[0]};var qe=M;function S(e,n,t,o,i,r,a,u,d,m,l,w,T,C,P,A){this[0]=O(e,0),this[1]=O(i,0),this[2]=O(d,0),this[3]=O(T,0),this[4]=O(n,0),this[5]=O(r,0),this[6]=O(m,0),this[7]=O(C,0),this[8]=O(t,0),this[9]=O(a,0),this[10]=O(l,0),this[11]=O(P,0),this[12]=O(o,0),this[13]=O(u,0),this[14]=O(w,0),this[15]=O(A,0)}S.packedLength=16;S.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=O(t,0),n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n[t++]=e[3],n[t++]=e[4],n[t++]=e[5],n[t++]=e[6],n[t++]=e[7],n[t++]=e[8],n[t++]=e[9],n[t++]=e[10],n[t++]=e[11],n[t++]=e[12],n[t++]=e[13],n[t++]=e[14],n[t]=e[15],n};S.unpack=function(e,n,t){return s.defined("array",e),n=O(n,0),p(t)||(t=new S),t[0]=e[n++],t[1]=e[n++],t[2]=e[n++],t[3]=e[n++],t[4]=e[n++],t[5]=e[n++],t[6]=e[n++],t[7]=e[n++],t[8]=e[n++],t[9]=e[n++],t[10]=e[n++],t[11]=e[n++],t[12]=e[n++],t[13]=e[n++],t[14]=e[n++],t[15]=e[n],t};S.packArray=function(e,n){s.defined("array",e);let t=e.length,o=t*16;if(!p(n))n=new Array(o);else{if(!Array.isArray(n)&&n.length!==o)throw new j("If result is a typed array, it must have exactly array.length * 16 elements");n.length!==o&&(n.length=o)}for(let i=0;i<t;++i)S.pack(e[i],n,i*16);return n};S.unpackArray=function(e,n){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new j("array length must be a multiple of 16.");let t=e.length;p(n)?n.length=t/16:n=new Array(t/16);for(let o=0;o<t;o+=16){let i=o/16;n[i]=S.unpack(e,o,n[i])}return n};S.clone=function(e,n){if(p(e))return p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n):new S(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};S.fromArray=S.unpack;S.fromColumnMajorArray=function(e,n){return s.defined("values",e),S.clone(e,n)};S.fromRowMajorArray=function(e,n){return s.defined("values",e),p(n)?(n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15],n):new S(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};S.fromRotationTranslation=function(e,n,t){return s.typeOf.object("rotation",e),n=O(n,_.ZERO),p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=n.x,t[13]=n.y,t[14]=n.z,t[15]=1,t):new S(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)};S.fromTranslationQuaternionRotationScale=function(e,n,t,o){s.typeOf.object("translation",e),s.typeOf.object("rotation",n),s.typeOf.object("scale",t),p(o)||(o=new S);let i=t.x,r=t.y,a=t.z,u=n.x*n.x,d=n.x*n.y,m=n.x*n.z,l=n.x*n.w,w=n.y*n.y,T=n.y*n.z,C=n.y*n.w,P=n.z*n.z,A=n.z*n.w,q=n.w*n.w,k=u-w-P+q,L=2*(d-A),F=2*(m+C),B=2*(d+A),W=-u+w-P+q,H=2*(T-l),ee=2*(m-C),re=2*(T+l),Z=-u-w+P+q;return o[0]=k*i,o[1]=B*i,o[2]=ee*i,o[3]=0,o[4]=L*r,o[5]=W*r,o[6]=re*r,o[7]=0,o[8]=F*a,o[9]=H*a,o[10]=Z*a,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};S.fromTranslationRotationScale=function(e,n){return s.typeOf.object("translationRotationScale",e),S.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,n)};S.fromTranslation=function(e,n){return s.typeOf.object("translation",e),S.fromRotationTranslation(Q.IDENTITY,e,n)};S.fromScale=function(e,n){return s.typeOf.object("scale",e),p(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new S(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};S.fromUniformScale=function(e,n){return s.typeOf.number("scale",e),p(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new S(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};S.fromRotation=function(e,n){return s.typeOf.object("rotation",e),p(n)||(n=new S),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n};var Je=new _,Ge=new _,pn=new _;S.fromCamera=function(e,n){s.typeOf.object("camera",e);let t=e.position,o=e.direction,i=e.up;s.typeOf.object("camera.position",t),s.typeOf.object("camera.direction",o),s.typeOf.object("camera.up",i),_.normalize(o,Je),_.normalize(_.cross(Je,i,Ge),Ge),_.normalize(_.cross(Ge,Je,pn),pn);let r=Ge.x,a=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pn.x,T=pn.y,C=pn.z,P=t.x,A=t.y,q=t.z,k=r*-P+a*-A+u*-q,L=w*-P+T*-A+C*-q,F=d*P+m*A+l*q;return p(n)?(n[0]=r,n[1]=w,n[2]=-d,n[3]=0,n[4]=a,n[5]=T,n[6]=-m,n[7]=0,n[8]=u,n[9]=C,n[10]=-l,n[11]=0,n[12]=k,n[13]=L,n[14]=F,n[15]=1,n):new S(r,a,u,k,w,T,C,L,-d,-m,-l,F,0,0,0,1)};S.computePerspectiveFieldOfView=function(e,n,t,o,i){s.typeOf.number.greaterThan("fovY",e,0),s.typeOf.number.lessThan("fovY",e,Math.PI),s.typeOf.number.greaterThan("near",t,0),s.typeOf.number.greaterThan("far",o,0),s.typeOf.object("result",i);let a=1/Math.tan(e*.5),u=a/n,d=(o+t)/(t-o),m=2*o*t/(t-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=a,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};S.computeOrthographicOffCenter=function(e,n,t,o,i,r,a){s.typeOf.number("left",e),s.typeOf.number("right",n),s.typeOf.number("bottom",t),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.number("far",r),s.typeOf.object("result",a);let u=1/(n-e),d=1/(o-t),m=1/(r-i),l=-(n+e)*u,w=-(o+t)*d,T=-(r+i)*m;return u*=2,d*=2,m*=-2,a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=m,a[11]=0,a[12]=l,a[13]=w,a[14]=T,a[15]=1,a};S.computePerspectiveOffCenter=function(e,n,t,o,i,r,a){s.typeOf.number("left",e),s.typeOf.number("right",n),s.typeOf.number("bottom",t),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.number("far",r),s.typeOf.object("result",a);let u=2*i/(n-e),d=2*i/(o-t),m=(n+e)/(n-e),l=(o+t)/(o-t),w=-(r+i)/(r-i),T=-1,C=-2*r*i/(r-i);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=m,a[9]=l,a[10]=w,a[11]=T,a[12]=0,a[13]=0,a[14]=C,a[15]=0,a};S.computeInfinitePerspectiveOffCenter=function(e,n,t,o,i,r){s.typeOf.number("left",e),s.typeOf.number("right",n),s.typeOf.number("bottom",t),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.object("result",r);let a=2*i/(n-e),u=2*i/(o-t),d=(n+e)/(n-e),m=(o+t)/(o-t),l=-1,w=-1,T=-2*i;return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=T,r[15]=0,r};S.computeViewportTransformation=function(e,n,t,o){p(o)||(o=new S),e=O(e,O.EMPTY_OBJECT);let i=O(e.x,0),r=O(e.y,0),a=O(e.width,0),u=O(e.height,0);n=O(n,0),t=O(t,1);let d=a*.5,m=u*.5,l=(t-n)*.5,w=d,T=m,C=l,P=i+d,A=r+m,q=n+l,k=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=T,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=C,o[11]=0,o[12]=P,o[13]=A,o[14]=q,o[15]=k,o};S.computeView=function(e,n,t,o,i){return s.typeOf.object("position",e),s.typeOf.object("direction",n),s.typeOf.object("up",t),s.typeOf.object("right",o),s.typeOf.object("result",i),i[0]=o.x,i[1]=t.x,i[2]=-n.x,i[3]=0,i[4]=o.y,i[5]=t.y,i[6]=-n.y,i[7]=0,i[8]=o.z,i[9]=t.z,i[10]=-n.z,i[11]=0,i[12]=-_.dot(o,e),i[13]=-_.dot(t,e),i[14]=_.dot(n,e),i[15]=1,i};S.toArray=function(e,n){return s.typeOf.object("matrix",e),p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};S.getElementIndex=function(e,n){return s.typeOf.number.greaterThanOrEquals("row",n,0),s.typeOf.number.lessThanOrEquals("row",n,3),s.typeOf.number.greaterThanOrEquals("column",e,0),s.typeOf.number.lessThanOrEquals("column",e,3),e*4+n};S.getColumn=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("result",t);let o=n*4,i=e[o],r=e[o+1],a=e[o+2],u=e[o+3];return t.x=i,t.y=r,t.z=a,t.w=u,t};S.setColumn=function(e,n,t,o){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=S.clone(e,o);let i=n*4;return o[i]=t.x,o[i+1]=t.y,o[i+2]=t.z,o[i+3]=t.w,o};S.getRow=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("result",t);let o=e[n],i=e[n+4],r=e[n+8],a=e[n+12];return t.x=o,t.y=i,t.z=r,t.w=a,t};S.setRow=function(e,n,t,o){return s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=S.clone(e,o),o[n]=t.x,o[n+4]=t.y,o[n+8]=t.z,o[n+12]=t.w,o};S.setTranslation=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.object("translation",n),s.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=n.x,t[13]=n.y,t[14]=n.z,t[15]=e[15],t};var Do=new _;S.setScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t);let o=S.getScale(e,Do),i=n.x/o.x,r=n.y/o.y,a=n.z/o.z;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3],t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7],t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};var No=new _;S.setUniformScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t);let o=S.getScale(e,No),i=n/o.x,r=n/o.y,a=n/o.z;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3],t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7],t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};var Gn=new _;S.getScale=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n.x=_.magnitude(_.fromElements(e[0],e[1],e[2],Gn)),n.y=_.magnitude(_.fromElements(e[4],e[5],e[6],Gn)),n.z=_.magnitude(_.fromElements(e[8],e[9],e[10],Gn)),n};var Ct=new _;S.getMaximumScale=function(e){return S.getScale(e,Ct),_.maximumComponent(Ct)};var ko=new _;S.setRotation=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let o=S.getScale(e,ko);return t[0]=n[0]*o.x,t[1]=n[1]*o.x,t[2]=n[2]*o.x,t[3]=e[3],t[4]=n[3]*o.y,t[5]=n[4]*o.y,t[6]=n[5]*o.y,t[7]=e[7],t[8]=n[6]*o.z,t[9]=n[7]*o.z,t[10]=n[8]*o.z,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};var Fo=new _;S.getRotation=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=S.getScale(e,Fo);return n[0]=e[0]/t.x,n[1]=e[1]/t.x,n[2]=e[2]/t.x,n[3]=e[4]/t.y,n[4]=e[5]/t.y,n[5]=e[6]/t.y,n[6]=e[8]/t.z,n[7]=e[9]/t.z,n[8]=e[10]/t.z,n};S.multiply=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e[0],i=e[1],r=e[2],a=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],T=e[9],C=e[10],P=e[11],A=e[12],q=e[13],k=e[14],L=e[15],F=n[0],B=n[1],W=n[2],H=n[3],ee=n[4],re=n[5],Z=n[6],oe=n[7],J=n[8],c=n[9],f=n[10],h=n[11],y=n[12],g=n[13],v=n[14],b=n[15],I=o*F+u*B+w*W+A*H,N=i*F+d*B+T*W+q*H,Y=r*F+m*B+C*W+k*H,ie=a*F+l*B+P*W+L*H,ae=o*ee+u*re+w*Z+A*oe,ne=i*ee+d*re+T*Z+q*oe,ue=r*ee+m*re+C*Z+k*oe,de=a*ee+l*re+P*Z+L*oe,ye=o*J+u*c+w*f+A*h,me=i*J+d*c+T*f+q*h,he=r*J+m*c+C*f+k*h,X=a*J+l*c+P*f+L*h,_e=o*y+u*g+w*v+A*b,Te=i*y+d*g+T*v+q*b,je=r*y+m*g+C*v+k*b,fn=a*y+l*g+P*v+L*b;return t[0]=I,t[1]=N,t[2]=Y,t[3]=ie,t[4]=ae,t[5]=ne,t[6]=ue,t[7]=de,t[8]=ye,t[9]=me,t[10]=he,t[11]=X,t[12]=_e,t[13]=Te,t[14]=je,t[15]=fn,t};S.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t};S.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t};S.multiplyTransformation=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e[0],i=e[1],r=e[2],a=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],T=e[12],C=e[13],P=e[14],A=n[0],q=n[1],k=n[2],L=n[4],F=n[5],B=n[6],W=n[8],H=n[9],ee=n[10],re=n[12],Z=n[13],oe=n[14],J=o*A+a*q+m*k,c=i*A+u*q+l*k,f=r*A+d*q+w*k,h=o*L+a*F+m*B,y=i*L+u*F+l*B,g=r*L+d*F+w*B,v=o*W+a*H+m*ee,b=i*W+u*H+l*ee,I=r*W+d*H+w*ee,N=o*re+a*Z+m*oe+T,Y=i*re+u*Z+l*oe+C,ie=r*re+d*Z+w*oe+P;return t[0]=J,t[1]=c,t[2]=f,t[3]=0,t[4]=h,t[5]=y,t[6]=g,t[7]=0,t[8]=v,t[9]=b,t[10]=I,t[11]=0,t[12]=N,t[13]=Y,t[14]=ie,t[15]=1,t};S.multiplyByMatrix3=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("rotation",n),s.typeOf.object("result",t);let o=e[0],i=e[1],r=e[2],a=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],T=n[0],C=n[1],P=n[2],A=n[3],q=n[4],k=n[5],L=n[6],F=n[7],B=n[8],W=o*T+a*C+m*P,H=i*T+u*C+l*P,ee=r*T+d*C+w*P,re=o*A+a*q+m*k,Z=i*A+u*q+l*k,oe=r*A+d*q+w*k,J=o*L+a*F+m*B,c=i*L+u*F+l*B,f=r*L+d*F+w*B;return t[0]=W,t[1]=H,t[2]=ee,t[3]=0,t[4]=re,t[5]=Z,t[6]=oe,t[7]=0,t[8]=J,t[9]=c,t[10]=f,t[11]=0,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};S.multiplyByTranslation=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("translation",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*e[6]+r*e[10]+e[14];return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=a,t[13]=u,t[14]=d,t[15]=e[15],t};S.multiplyByScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z;return o===1&&i===1&&r===1?S.clone(e,t):(t[0]=o*e[0],t[1]=o*e[1],t[2]=o*e[2],t[3]=e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=i*e[6],t[7]=e[7],t[8]=r*e[8],t[9]=r*e[9],t[10]=r*e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t)};S.multiplyByUniformScale=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3],t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7],t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};S.multiplyByVector=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=n.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*a,d=e[1]*o+e[5]*i+e[9]*r+e[13]*a,m=e[2]*o+e[6]*i+e[10]*r+e[14]*a,l=e[3]*o+e[7]*i+e[11]*r+e[15]*a;return t.x=u,t.y=d,t.z=m,t.w=l,t};S.multiplyByPointAsVector=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return t.x=a,t.y=u,t.z=d,t};S.multiplyByPoint=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return t.x=a,t.y=u,t.z=d,t};S.multiplyByScalar=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t};S.negate=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n[4]=-e[4],n[5]=-e[5],n[6]=-e[6],n[7]=-e[7],n[8]=-e[8],n[9]=-e[9],n[10]=-e[10],n[11]=-e[11],n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=-e[15],n};S.transpose=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[1],o=e[2],i=e[3],r=e[6],a=e[7],u=e[11];return n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=o,n[9]=r,n[10]=e[10],n[11]=e[14],n[12]=i,n[13]=a,n[14]=u,n[15]=e[15],n};S.abs=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n[9]=Math.abs(e[9]),n[10]=Math.abs(e[10]),n[11]=Math.abs(e[11]),n[12]=Math.abs(e[12]),n[13]=Math.abs(e[13]),n[14]=Math.abs(e[14]),n[15]=Math.abs(e[15]),n};S.equals=function(e,n){return e===n||p(e)&&p(n)&&e[12]===n[12]&&e[13]===n[13]&&e[14]===n[14]&&e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]&&e[4]===n[4]&&e[5]===n[5]&&e[6]===n[6]&&e[8]===n[8]&&e[9]===n[9]&&e[10]===n[10]&&e[3]===n[3]&&e[7]===n[7]&&e[11]===n[11]&&e[15]===n[15]};S.equalsEpsilon=function(e,n,t){return t=O(t,0),e===n||p(e)&&p(n)&&Math.abs(e[0]-n[0])<=t&&Math.abs(e[1]-n[1])<=t&&Math.abs(e[2]-n[2])<=t&&Math.abs(e[3]-n[3])<=t&&Math.abs(e[4]-n[4])<=t&&Math.abs(e[5]-n[5])<=t&&Math.abs(e[6]-n[6])<=t&&Math.abs(e[7]-n[7])<=t&&Math.abs(e[8]-n[8])<=t&&Math.abs(e[9]-n[9])<=t&&Math.abs(e[10]-n[10])<=t&&Math.abs(e[11]-n[11])<=t&&Math.abs(e[12]-n[12])<=t&&Math.abs(e[13]-n[13])<=t&&Math.abs(e[14]-n[14])<=t&&Math.abs(e[15]-n[15])<=t};S.getTranslation=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n.x=e[12],n.y=e[13],n.z=e[14],n};S.getMatrix3=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[8]=e[10],n};var Lo=new Q,xo=new Q,Bo=new qe,Qo=new qe(0,0,0,1);S.inverse=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[0],o=e[4],i=e[8],r=e[12],a=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],T=e[10],C=e[14],P=e[3],A=e[7],q=e[11],k=e[15],L=T*k,F=C*q,B=w*k,W=C*A,H=w*q,ee=T*A,re=l*k,Z=C*P,oe=l*q,J=T*P,c=l*A,f=w*P,h=L*u+W*d+H*m-(F*u+B*d+ee*m),y=F*a+re*d+J*m-(L*a+Z*d+oe*m),g=B*a+Z*u+c*m-(W*a+re*u+f*m),v=ee*a+oe*u+f*d-(H*a+J*u+c*d),b=F*o+B*i+ee*r-(L*o+W*i+H*r),I=L*t+Z*i+oe*r-(F*t+re*i+J*r),N=W*t+re*o+f*r-(B*t+Z*o+c*r),Y=H*t+J*o+c*i-(ee*t+oe*o+f*i);L=i*m,F=r*d,B=o*m,W=r*u,H=o*d,ee=i*u,re=t*m,Z=r*a,oe=t*d,J=i*a,c=t*u,f=o*a;let ie=L*A+W*q+H*k-(F*A+B*q+ee*k),ae=F*P+re*q+J*k-(L*P+Z*q+oe*k),ne=B*P+Z*A+c*k-(W*P+re*A+f*k),ue=ee*P+oe*A+f*q-(H*P+J*A+c*q),de=B*T+ee*C+F*w-(H*C+L*w+W*T),ye=oe*C+L*l+Z*T-(re*T+J*C+F*l),me=re*w+f*C+W*l-(c*C+B*l+Z*w),he=c*T+H*l+J*w-(oe*w+f*T+ee*l),X=t*h+o*y+i*g+r*v;if(Math.abs(X)<E.EPSILON21){if(Q.equalsEpsilon(S.getMatrix3(e,Lo),xo,E.EPSILON7)&&qe.equals(S.getRow(e,3,Bo),Qo))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;throw new Se("matrix is not invertible because its determinate is zero.")}return X=1/X,n[0]=h*X,n[1]=y*X,n[2]=g*X,n[3]=v*X,n[4]=b*X,n[5]=I*X,n[6]=N*X,n[7]=Y*X,n[8]=ie*X,n[9]=ae*X,n[10]=ne*X,n[11]=ue*X,n[12]=de*X,n[13]=ye*X,n[14]=me*X,n[15]=he*X,n};S.inverseTransformation=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[0],o=e[1],i=e[2],r=e[4],a=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],T=e[13],C=e[14],P=-t*w-o*T-i*C,A=-r*w-a*T-u*C,q=-d*w-m*T-l*C;return n[0]=t,n[1]=r,n[2]=d,n[3]=0,n[4]=o,n[5]=a,n[6]=m,n[7]=0,n[8]=i,n[9]=u,n[10]=l,n[11]=0,n[12]=P,n[13]=A,n[14]=q,n[15]=1,n};var Wo=new S;S.inverseTranspose=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),S.inverse(S.transpose(e,Wo),n)};S.IDENTITY=Object.freeze(new S(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));S.ZERO=Object.freeze(new S(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));S.COLUMN0ROW0=0;S.COLUMN0ROW1=1;S.COLUMN0ROW2=2;S.COLUMN0ROW3=3;S.COLUMN1ROW0=4;S.COLUMN1ROW1=5;S.COLUMN1ROW2=6;S.COLUMN1ROW3=7;S.COLUMN2ROW0=8;S.COLUMN2ROW1=9;S.COLUMN2ROW2=10;S.COLUMN2ROW3=11;S.COLUMN3ROW0=12;S.COLUMN3ROW1=13;S.COLUMN3ROW2=14;S.COLUMN3ROW3=15;Object.defineProperties(S.prototype,{length:{get:function(){return S.packedLength}}});S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.equalsArray=function(e,n,t){return e[0]===n[t]&&e[1]===n[t+1]&&e[2]===n[t+2]&&e[3]===n[t+3]&&e[4]===n[t+4]&&e[5]===n[t+5]&&e[6]===n[t+6]&&e[7]===n[t+7]&&e[8]===n[t+8]&&e[9]===n[t+9]&&e[10]===n[t+10]&&e[11]===n[t+11]&&e[12]===n[t+12]&&e[13]===n[t+13]&&e[14]===n[t+14]&&e[15]===n[t+15]};S.prototype.equalsEpsilon=function(e,n){return S.equalsEpsilon(this,e,n)};S.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) +(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]}) +(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]}) +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var G=S;function vt(e,n,t){t=O(t,!1);let o={},i=p(e),r=p(n),a,u,d;if(i)for(a in e)e.hasOwnProperty(a)&&(u=e[a],r&&t&&typeof u=="object"&&n.hasOwnProperty(a)?(d=n[a],typeof d=="object"?o[a]=vt(u,d,t):o[a]=u):o[a]=u);if(r)for(a in n)n.hasOwnProperty(a)&&!o.hasOwnProperty(a)&&(d=n[a],o[a]=d);return o}var De=vt;function Ho(e,n,t){s.defined("array",e),s.defined("itemToFind",n),s.defined("comparator",t);let o=0,i=e.length-1,r,a;for(;o<=i;){if(r=~~((o+i)/2),a=t(e[r],n),a<0){o=r+1;continue}if(a>0){i=r-1;continue}return r}return~(i+1)}var Be=Ho;function $o(e,n,t,o,i){this.xPoleWander=e,this.yPoleWander=n,this.xPoleOffset=t,this.yPoleOffset=o,this.ut1MinusUtc=i}var hn=$o;function Vo(e){if(e===null||isNaN(e))throw new j("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dn=Vo;var At=[31,28,31,30,31,30,31,31,30,31,30,31];function Yo(e,n,t,o,i,r,a,u){e=O(e,1),n=O(n,1),t=O(t,1),o=O(o,0),i=O(i,0),r=O(r,0),a=O(a,0),u=O(u,!1),A(),q(),this.year=e,this.month=n,this.day=t,this.hour=o,this.minute=i,this.second=r,this.millisecond=a,this.isLeapSecond=u;function A(){s.typeOf.number.greaterThanOrEquals("Year",e,1),s.typeOf.number.lessThanOrEquals("Year",e,9999),s.typeOf.number.greaterThanOrEquals("Month",n,1),s.typeOf.number.lessThanOrEquals("Month",n,12),s.typeOf.number.greaterThanOrEquals("Day",t,1),s.typeOf.number.lessThanOrEquals("Day",t,31),s.typeOf.number.greaterThanOrEquals("Hour",o,0),s.typeOf.number.lessThanOrEquals("Hour",o,23),s.typeOf.number.greaterThanOrEquals("Minute",i,0),s.typeOf.number.lessThanOrEquals("Minute",i,59),s.typeOf.bool("IsLeapSecond",u),s.typeOf.number.greaterThanOrEquals("Second",r,0),s.typeOf.number.lessThanOrEquals("Second",r,u?60:59),s.typeOf.number.greaterThanOrEquals("Millisecond",a,0),s.typeOf.number.lessThan("Millisecond",a,1e3)}function q(){let k=n===2&&dn(e)?At[n-1]+1:At[n-1];if(t>k)throw new j("Month and Day represents invalid date")}}var Tn=Yo;function Xo(e,n){this.julianDate=e,this.offset=n}var te=Xo;var Zo={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},ce=Object.freeze(Zo);var Jo={UTC:0,TAI:1},$=Object.freeze(Jo);var Mt=new Tn,Cn=[31,28,31,30,31,30,31,31,30,31,30,31],vn=29;function Kn(e,n){return z.compare(e.julianDate,n.julianDate)}var Ke=new te;function jn(e){Ke.julianDate=e;let n=z.leapSeconds,t=Be(n,Ke,Kn);t<0&&(t=~t),t>=n.length&&(t=n.length-1);let o=n[t].offset;t>0&&z.secondsDifference(n[t].julianDate,e)>o&&(t--,o=n[t].offset),z.addSeconds(e,o,e)}function jt(e,n){Ke.julianDate=e;let t=z.leapSeconds,o=Be(t,Ke,Kn);if(o<0&&(o=~o),o===0)return z.addSeconds(e,-t[0].offset,n);if(o>=t.length)return z.addSeconds(e,-t[o-1].offset,n);let i=z.secondsDifference(t[o].julianDate,e);if(i===0)return z.addSeconds(e,-t[o].offset,n);if(!(i<=1))return z.addSeconds(e,-t[--o].offset,n)}function Ne(e,n,t){let o=n/ce.SECONDS_PER_DAY|0;return e+=o,n-=ce.SECONDS_PER_DAY*o,n<0&&(e--,n+=ce.SECONDS_PER_DAY),t.dayNumber=e,t.secondsOfDay=n,t}function et(e,n,t,o,i,r,a){let u=(n-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(n-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+t-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ce.SECONDS_PER_HOUR+i*ce.SECONDS_PER_MINUTE+a*ce.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var Go=/^(\d{4})$/,Ko=/^(\d{4})-(\d{2})$/,er=/^(\d{4})-?(\d{3})$/,nr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,tr=/^(\d{4})-?(\d{2})-?(\d{2})$/,nt=/([Z+\-])?(\d{2})?:?(\d{2})?$/,or=/^(\d{2})(\.\d+)?/.source+nt.source,rr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+nt.source,ir=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+nt.source,Re="Invalid ISO 8601 date.";function z(e,n,t){this.dayNumber=void 0,this.secondsOfDay=void 0,e=O(e,0),n=O(n,0),t=O(t,$.UTC);let o=e|0;n=n+(e-o)*ce.SECONDS_PER_DAY,Ne(o,n,this),t===$.UTC&&jn(this)}z.fromGregorianDate=function(e,n){if(!(e instanceof Tn))throw new j("date must be a valid GregorianDate.");let t=et(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(n)?(Ne(t[0],t[1],n),jn(n),n):new z(t[0],t[1],$.UTC)};z.fromDate=function(e,n){if(!(e instanceof Date)||isNaN(e.getTime()))throw new j("date must be a valid JavaScript Date.");let t=et(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(n)?(Ne(t[0],t[1],n),jn(n),n):new z(t[0],t[1],$.UTC)};z.fromIso8601=function(e,n){if(typeof e!="string")throw new j(Re);e=e.replace(",",".");let t=e.split("T"),o,i=1,r=1,a=0,u=0,d=0,m=0,l=t[0],w=t[1],T,C;if(!p(l))throw new j(Re);let P;if(t=l.match(tr),t!==null){if(P=l.split("-").length-1,P>0&&P!==2)throw new j(Re);o=+t[1],i=+t[2],r=+t[3]}else if(t=l.match(Ko),t!==null)o=+t[1],i=+t[2];else if(t=l.match(Go),t!==null)o=+t[1];else{let L;if(t=l.match(er),t!==null){if(o=+t[1],L=+t[2],C=dn(o),L<1||C&&L>366||!C&&L>365)throw new j(Re)}else if(t=l.match(nr),t!==null){o=+t[1];let F=+t[2],B=+t[3]||0;if(P=l.split("-").length-1,P>0&&(!p(t[3])&&P!==1||p(t[3])&&P!==2))throw new j(Re);let W=new Date(Date.UTC(o,0,4));L=F*7+B-W.getUTCDay()-3}else throw new j(Re);T=new Date(Date.UTC(o,0,1)),T.setUTCDate(L),i=T.getUTCMonth()+1,r=T.getUTCDate()}if(C=dn(o),i<1||i>12||r<1||(i!==2||!C)&&r>Cn[i-1]||C&&i===2&&r>vn)throw new j(Re);let A;if(p(w)){if(t=w.match(ir),t!==null){if(P=w.split(":").length-1,P>0&&P!==2&&P!==3)throw new j(Re);a=+t[1],u=+t[2],d=+t[3],m=+(t[4]||0)*1e3,A=5}else if(t=w.match(rr),t!==null){if(P=w.split(":").length-1,P>2)throw new j(Re);a=+t[1],u=+t[2],d=+(t[3]||0)*60,A=4}else if(t=w.match(or),t!==null)a=+t[1],u=+(t[2]||0)*60,A=3;else throw new j(Re);if(u>=60||d>=61||a>24||a===24&&(u>0||d>0||m>0))throw new j(Re);let L=t[A],F=+t[A+1],B=+(t[A+2]||0);switch(L){case"+":a=a-F,u=u-B;break;case"-":a=a+F,u=u+B;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,a,u)).getTimezoneOffset();break}}let q=d===60;for(q&&d--;u>=60;)u-=60,a++;for(;a>=24;)a-=24,r++;for(T=C&&i===2?vn:Cn[i-1];r>T;)r-=T,i++,i>12&&(i-=12,o++),T=C&&i===2?vn:Cn[i-1];for(;u<0;)u+=60,a--;for(;a<0;)a+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),T=C&&i===2?vn:Cn[i-1],r+=T;let k=et(o,i,r,a,u,d,m);return p(n)?(Ne(k[0],k[1],n),jn(n)):n=new z(k[0],k[1],$.UTC),q&&z.addSeconds(n,1,n),n};z.now=function(e){return z.fromDate(new Date,e)};var An=new z(0,0,$.TAI);z.toGregorianDate=function(e,n){if(!p(e))throw new j("julianDate is required.");let t=!1,o=jt(e,An);p(o)||(z.addSeconds(e,-1,An),o=jt(An,An),t=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let a=i+68569|0,u=4*a/146097|0;a=a-((146097*u+3)/4|0)|0;let d=4e3*(a+1)/1461001|0;a=a-(1461*d/4|0)+31|0;let m=80*a/2447|0,l=a-(2447*m/80|0)|0;a=m/11|0;let w=m+2-12*a|0,T=100*(u-49)+d+a|0,C=r/ce.SECONDS_PER_HOUR|0,P=r-C*ce.SECONDS_PER_HOUR,A=P/ce.SECONDS_PER_MINUTE|0;P=P-A*ce.SECONDS_PER_MINUTE;let q=P|0,k=(P-q)/ce.SECONDS_PER_MILLISECOND;return C+=12,C>23&&(C-=24),t&&(q+=1),p(n)?(n.year=T,n.month=w,n.day=l,n.hour=C,n.minute=A,n.second=q,n.millisecond=k,n.isLeapSecond=t,n):new Tn(T,w,l,C,A,q,k,t)};z.toDate=function(e){if(!p(e))throw new j("julianDate is required.");let n=z.toGregorianDate(e,Mt),t=n.second;return n.isLeapSecond&&(t-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,t,n.millisecond))};z.toIso8601=function(e,n){if(!p(e))throw new j("julianDate is required.");let t=z.toGregorianDate(e,Mt),o=t.year,i=t.month,r=t.day,a=t.hour,u=t.minute,d=t.second,m=t.millisecond;o===1e4&&i===1&&r===1&&a===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,a=24);let l;if(!p(n)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(n)||n===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(n).replace(".","").slice(0,n),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};z.clone=function(e,n){if(p(e))return p(n)?(n.dayNumber=e.dayNumber,n.secondsOfDay=e.secondsOfDay,n):new z(e.dayNumber,e.secondsOfDay,$.TAI)};z.compare=function(e,n){if(!p(e))throw new j("left is required.");if(!p(n))throw new j("right is required.");let t=e.dayNumber-n.dayNumber;return t!==0?t:e.secondsOfDay-n.secondsOfDay};z.equals=function(e,n){return e===n||p(e)&&p(n)&&e.dayNumber===n.dayNumber&&e.secondsOfDay===n.secondsOfDay};z.equalsEpsilon=function(e,n,t){return t=O(t,0),e===n||p(e)&&p(n)&&Math.abs(z.secondsDifference(e,n))<=t};z.totalDays=function(e){if(!p(e))throw new j("julianDate is required.");return e.dayNumber+e.secondsOfDay/ce.SECONDS_PER_DAY};z.secondsDifference=function(e,n){if(!p(e))throw new j("left is required.");if(!p(n))throw new j("right is required.");return(e.dayNumber-n.dayNumber)*ce.SECONDS_PER_DAY+(e.secondsOfDay-n.secondsOfDay)};z.daysDifference=function(e,n){if(!p(e))throw new j("left is required.");if(!p(n))throw new j("right is required.");let t=e.dayNumber-n.dayNumber,o=(e.secondsOfDay-n.secondsOfDay)/ce.SECONDS_PER_DAY;return t+o};z.computeTaiMinusUtc=function(e){Ke.julianDate=e;let n=z.leapSeconds,t=Be(n,Ke,Kn);return t<0&&(t=~t,--t,t<0&&(t=0)),n[t].offset};z.addSeconds=function(e,n,t){if(!p(e))throw new j("julianDate is required.");if(!p(n))throw new j("seconds is required.");if(!p(t))throw new j("result is required.");return Ne(e.dayNumber,e.secondsOfDay+n,t)};z.addMinutes=function(e,n,t){if(!p(e))throw new j("julianDate is required.");if(!p(n))throw new j("minutes is required.");if(!p(t))throw new j("result is required.");let o=e.secondsOfDay+n*ce.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,t)};z.addHours=function(e,n,t){if(!p(e))throw new j("julianDate is required.");if(!p(n))throw new j("hours is required.");if(!p(t))throw new j("result is required.");let o=e.secondsOfDay+n*ce.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,t)};z.addDays=function(e,n,t){if(!p(e))throw new j("julianDate is required.");if(!p(n))throw new j("days is required.");if(!p(t))throw new j("result is required.");let o=e.dayNumber+n;return Ne(o,e.secondsOfDay,t)};z.lessThan=function(e,n){return z.compare(e,n)<0};z.lessThanOrEquals=function(e,n){return z.compare(e,n)<=0};z.greaterThan=function(e,n){return z.compare(e,n)>0};z.greaterThanOrEquals=function(e,n){return z.compare(e,n)>=0};z.prototype.clone=function(e){return z.clone(this,e)};z.prototype.equals=function(e){return z.equals(this,e)};z.prototype.equalsEpsilon=function(e,n){return z.equalsEpsilon(this,e,n)};z.prototype.toString=function(){return z.toIso8601(this)};z.leapSeconds=[new te(new z(2441317,43210,$.TAI),10),new te(new z(2441499,43211,$.TAI),11),new te(new z(2441683,43212,$.TAI),12),new te(new z(2442048,43213,$.TAI),13),new te(new z(2442413,43214,$.TAI),14),new te(new z(2442778,43215,$.TAI),15),new te(new z(2443144,43216,$.TAI),16),new te(new z(2443509,43217,$.TAI),17),new te(new z(2443874,43218,$.TAI),18),new te(new z(2444239,43219,$.TAI),19),new te(new z(2444786,43220,$.TAI),20),new te(new z(2445151,43221,$.TAI),21),new te(new z(2445516,43222,$.TAI),22),new te(new z(2446247,43223,$.TAI),23),new te(new z(2447161,43224,$.TAI),24),new te(new z(2447892,43225,$.TAI),25),new te(new z(2448257,43226,$.TAI),26),new te(new z(2448804,43227,$.TAI),27),new te(new z(2449169,43228,$.TAI),28),new te(new z(2449534,43229,$.TAI),29),new te(new z(2450083,43230,$.TAI),30),new te(new z(2450630,43231,$.TAI),31),new te(new z(2451179,43232,$.TAI),32),new te(new z(2453736,43233,$.TAI),33),new te(new z(2454832,43234,$.TAI),34),new te(new z(2456109,43235,$.TAI),35),new te(new z(2457204,43236,$.TAI),36),new te(new z(2457754,43237,$.TAI),37)];var pe=z;var co=Ze(Qe(),1);function cr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var Nt=cr;function kt(e,n){if(e===null||typeof e!="object")return e;n=O(n,!1);let t=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];n&&(i=kt(i,n)),t[o]=i}return t}var tn=kt;function sr(){let e,n,t=new Promise(function(o,i){e=o,n=i});return{resolve:e,reject:n,promise:t}}var We=sr;var Ft=Ze(Qe(),1);function tt(e,n){let t;return typeof document<"u"&&(t=document),tt._implementation(e,n,t)}tt._implementation=function(e,n,t){if(!p(e))throw new j("relative uri is required.");if(!p(n)){if(typeof t>"u")return e;n=O(t.baseURI,t.location.href)}let o=new Ft.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(n).toString()};var mn=tt;var Lt=Ze(Qe(),1);function ar(e,n){if(!p(e))throw new j("uri is required.");let t="",o=e.lastIndexOf("/");return o!==-1&&(t=e.substring(0,o+1)),n&&(e=new Lt.default(e),e.query().length!==0&&(t+=`?${e.query()}`),e.fragment().length!==0&&(t+=`#${e.fragment()}`)),t}var xt=ar;var Bt=Ze(Qe(),1);function fr(e){if(!p(e))throw new j("uri is required.");let n=new Bt.default(e);n.normalize();let t=n.path(),o=t.lastIndexOf("/");return o!==-1&&(t=t.substr(o+1)),o=t.lastIndexOf("."),o===-1?t="":t=t.substr(o+1),t}var Qt=fr;var Wt={};function ur(e,n,t){p(n)||(n=e.width),p(t)||(t=e.height);let o=Wt[n];p(o)||(o={},Wt[n]=o);let i=o[t];if(!p(i)){let r=document.createElement("canvas");r.width=n,r.height=t,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[t]=i}return i.drawImage(e,0,0,n,t),i.getImageData(0,0,n,t).data}var ot=ur;var pr=/^blob:/i;function hr(e){return s.typeOf.string("uri",e),pr.test(e)}var zn=hr;var Ce;function dr(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let n=Ce.host,t=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,t!==Ce.protocol||n!==Ce.host}var Ht=dr;var mr=/^data:/i;function yr(e){return s.typeOf.string("uri",e),mr.test(e)}var In=yr;function lr(e){let n=document.createElement("script");return n.async=!0,n.src=e,new Promise((t,o)=>{window.crossOriginIsolated&&n.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];n.onload=function(){n.onload=void 0,i.removeChild(n),t()},n.onerror=function(r){o(r)},i.appendChild(n)})}var $t=lr;function wr(e){if(!p(e))throw new j("obj is required.");let n="";for(let t in e)if(e.hasOwnProperty(t)){let o=e[t],i=`${encodeURIComponent(t)}=`;if(Array.isArray(o))for(let r=0,a=o.length;r<a;++r)n+=`${i+encodeURIComponent(o[r])}&`;else n+=`${i+encodeURIComponent(o)}&`}return n=n.slice(0,-1),n}var Vt=wr;function br(e){if(!p(e))throw new j("queryString is required.");let n={};if(e==="")return n;let t=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=t.length;o<i;++o){let r=t[o].split("="),a=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=n[a];typeof d=="string"?n[a]=[d,u]:Array.isArray(d)?d.push(u):n[a]=u}return n}var Yt=br;var Or={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},fe=Object.freeze(Or);var gr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Xt=Object.freeze(gr);function qn(e){e=O(e,O.EMPTY_OBJECT);let n=O(e.throttleByServer,!1),t=O(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=O(e.priority,0),this.throttle=t,this.throttleByServer=n,this.type=O(e.type,Xt.OTHER),this.serverKey=e.serverKey,this.state=fe.UNISSUED,this.deferred=void 0,this.cancelled=!1}qn.prototype.cancel=function(){this.cancelled=!0};qn.prototype.clone=function(e){return p(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=fe.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new qn(this)};var Zt=qn;function _r(e){let n={};if(!e)return n;let t=e.split(`\r +`);for(let o=0;o<t.length;++o){let i=t[o],r=i.indexOf(": ");if(r>0){let a=i.substring(0,r),u=i.substring(r+2);n[a]=u}}return n}var Jt=_r;function Gt(e,n,t){this.statusCode=e,this.response=n,this.responseHeaders=t,typeof this.responseHeaders=="string"&&(this.responseHeaders=Jt(this.responseHeaders))}Gt.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yn=Gt;var Dn=Ze(Qe(),1);function ln(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(ln.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});ln.prototype.addEventListener=function(e,n){s.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(n);let t=this;return function(){t.removeEventListener(e,n)}};ln.prototype.removeEventListener=function(e,n){s.typeOf.func("listener",e);let t=this._listeners,o=this._scopes,i=-1;for(let r=0;r<t.length;r++)if(t[r]===e&&o[r]===n){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),t[i]=void 0,o[i]=void 0):(t.splice(i,1),o.splice(i,1)),!0):!1};function Sr(e,n){return n-e}ln.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,n=this._listeners,t=this._scopes,o=n.length;for(e=0;e<o;e++){let r=n[e];p(r)&&n[e].apply(t[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(Sr),e=0;e<o;e++){let r=i[e];n.splice(r,1),t.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var Kt=ln;function He(e){s.typeOf.object("options",e),s.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){s.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let n=this._length;if(e<n){let t=this._array;for(let o=e;o<n;++o)t[o]=void 0;this._length=e,t.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function rt(e,n,t){let o=e[n];e[n]=e[t],e[t]=o}He.prototype.reserve=function(e){e=O(e,this._length),this._array.length=e};He.prototype.heapify=function(e){e=O(e,0);let n=this._length,t=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let a=2*(e+1),u=a-1;u<n&&t(o[u],o[e])<0?i=u:i=e,a<n&&t(o[a],o[i])<0&&(i=a),i!==e?(rt(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let n=Math.ceil(e/2);n>=0;--n)this.heapify(n)};He.prototype.insert=function(e){s.defined("element",e);let n=this._array,t=this._comparator,o=this._maximumLength,i=this._length++;for(i<n.length?n[i]=e:n.push(e);i!==0;){let a=Math.floor((i-1)/2);if(t(n[i],n[a])<0)rt(n,i,a),i=a;else break}let r;return p(o)&&this._length>o&&(r=n[o],this._length=o),r};He.prototype.pop=function(e){if(e=O(e,0),this._length===0)return;s.typeOf.number.lessThan("index",e,this._length);let n=this._array,t=n[e];return rt(n,e,--this._length),this.heapify(e),n[this._length]=void 0,t};var eo=He;function Rr(e,n){return e.priority-n.priority}var K={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},on=20,we=new eo({comparator:Rr});we.maximumLength=on;we.reserve(on);var ve=[],Pe={},Er=typeof document<"u"?new Dn.default(document.location.href):new Dn.default,Nn=new Kt;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=Nn;Object.defineProperties(se,{statistics:{get:function(){return K}},priorityHeapLength:{get:function(){return on},set:function(e){if(e<on)for(;we.length>e;){let n=we.pop();$e(n)}on=e,we.maximumLength=e,we.reserve(e)}}});function no(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,n){n=O(n,1);let t=O(se.requestsByServer[e],se.maximumRequestsPerServer);return Pe[e]+n<=t};se.heapHasOpenSlots=function(e){return we.length+e<=on};function to(e){return e.state===fe.UNISSUED&&(e.state=fe.ISSUED,e.deferred=We()),e.deferred.promise}function Tr(e){return function(n){if(e.state===fe.CANCELLED)return;let t=e.deferred;--K.numberOfActiveRequests,--Pe[e.serverKey],Nn.raiseEvent(),e.state=fe.RECEIVED,e.deferred=void 0,t.resolve(n)}}function Cr(e){return function(n){e.state!==fe.CANCELLED&&(++K.numberOfFailedRequests,--K.numberOfActiveRequests,--Pe[e.serverKey],Nn.raiseEvent(n),e.state=fe.FAILED,e.deferred.reject(n))}}function oo(e){let n=to(e);return e.state=fe.ACTIVE,ve.push(e),++K.numberOfActiveRequests,++K.numberOfActiveRequestsEver,++Pe[e.serverKey],e.requestFunction().then(Tr(e)).catch(Cr(e)),n}function $e(e){let n=e.state===fe.ACTIVE;if(e.state=fe.CANCELLED,++K.numberOfCancelledRequests,p(e.deferred)){let t=e.deferred;e.deferred=void 0,t.reject()}n&&(--K.numberOfActiveRequests,--Pe[e.serverKey],++K.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,n,t=0,o=ve.length;for(e=0;e<o;++e){if(n=ve[e],n.cancelled&&$e(n),n.state!==fe.ACTIVE){++t;continue}t>0&&(ve[e-t]=n)}ve.length-=t;let i=we.internalArray,r=we.length;for(e=0;e<r;++e)no(i[e]);we.resort();let a=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<a&&we.length>0;){if(n=we.pop(),n.cancelled){$e(n);continue}if(n.throttleByServer&&!se.serverHasOpenSlots(n.serverKey)){$e(n);continue}oo(n),++u}vr()};se.getServerKey=function(e){s.typeOf.string("url",e);let n=new Dn.default(e);n.scheme()===""&&(n=n.absoluteTo(Er),n.normalize());let t=n.authority();/:/.test(t)||(t=`${t}:${n.scheme()==="https"?"443":"80"}`);let o=Pe[t];return p(o)||(Pe[t]=0),t};se.request=function(e){if(s.typeOf.object("request",e),s.typeOf.string("request.url",e.url),s.typeOf.func("request.requestFunction",e.requestFunction),In(e.url)||zn(e.url))return Nn.raiseEvent(),e.state=fe.RECEIVED,e.requestFunction();if(++K.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return oo(e);if(ve.length>=se.maximumRequests)return;no(e);let n=we.insert(e);if(p(n)){if(n===e)return;$e(n)}return to(e)};function vr(){se.debugShowStatistics&&(K.numberOfActiveRequests===0&&K.lastNumberOfActiveRequests>0&&(K.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${K.numberOfAttemptedRequests}`),K.numberOfAttemptedRequests=0),K.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${K.numberOfCancelledRequests}`),K.numberOfCancelledRequests=0),K.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${K.numberOfCancelledActiveRequests}`),K.numberOfCancelledActiveRequests=0),K.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${K.numberOfFailedRequests}`),K.numberOfFailedRequests=0)),K.lastNumberOfActiveRequests=K.numberOfActiveRequests)}se.clearForSpecs=function(){for(;we.length>0;){let n=we.pop();$e(n)}let e=ve.length;for(let n=0;n<e;++n)$e(ve[n]);ve.length=0,Pe={},K.numberOfAttemptedRequests=0,K.numberOfActiveRequests=0,K.numberOfCancelledRequests=0,K.numberOfCancelledActiveRequests=0,K.numberOfFailedRequests=0,K.numberOfActiveRequestsEver=0,K.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Pe[e]};se.requestHeap=we;var kn=se;var ro=Ze(Qe(),1);var wn={},rn={};wn.add=function(e,n){if(!p(e))throw new j("host is required.");if(!p(n)||n<=0)throw new j("port is required to be greater than 0.");let t=`${e.toLowerCase()}:${n}`;p(rn[t])||(rn[t]=!0)};wn.remove=function(e,n){if(!p(e))throw new j("host is required.");if(!p(n)||n<=0)throw new j("port is required to be greater than 0.");let t=`${e.toLowerCase()}:${n}`;p(rn[t])&&delete rn[t]};function Ar(e){let n=new ro.default(e);n.normalize();let t=n.authority();if(t.length!==0){if(n.authority(t),t.indexOf("@")!==-1&&(t=t.split("@")[1]),t.indexOf(":")===-1){let o=n.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")t+=":80";else if(o==="https")t+=":443";else return}return t}}wn.contains=function(e){if(!p(e))throw new j("url is required.");let n=Ar(e);return!!(p(n)&&p(rn[n]))};wn.clear=function(){rn={}};var it=wn;var so=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function U(e){e=O(e,O.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),s.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=O(e.request,new Zt),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=O(e.retryAttempts,0),this._retryCount=0,O(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Ae(e,n){return p(e)?tn(e):n}U.createIfNeeded=function(e){return e instanceof U?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new U({url:e})};var cn;U.supportsImageBitmapOptions=function(){return p(cn)?cn:typeof createImageBitmap!="function"?(cn=Promise.resolve(!1),cn):(cn=U.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(n){let t={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(n,t),createImageBitmap(n)])}).then(function(n){let t=ot(n[0]),o=ot(n[1]);return t[1]!==o[1]}).catch(function(){return!1}),cn)};Object.defineProperties(U,{isBlobSupported:{get:function(){return so}}});Object.defineProperties(U.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return Qt(this._url)}},isDataUri:{get:function(){return In(this._url)}},isBlobUri:{get:function(){return zn(this._url)}},isCrossOriginUrl:{get:function(){return Ht(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});U.prototype.toString=function(){return this.getUrlComponent(!0,!0)};U.prototype.parseUrl=function(e,n,t,o){let i=new co.default(e),r=jr(i.query());this._queryParameters=n?Ln(r,this.queryParameters,t):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mn(o))),this._url=i.toString()};function jr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Yt(e)}function Ln(e,n,t){if(!t)return De(e,n);let o=tn(e,!0);for(let i in n)if(n.hasOwnProperty(i)){let r=o[i],a=n[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(a)):o[i]=Array.isArray(a)?a.slice():a}return o}U.prototype.getUrlComponent=function(e,n){if(this.isDataUri)return this._url;let t=this._url;e&&(t=`${t}${Mr(this.queryParameters)}`),t=t.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(t=t.replace(/{(.*?)}/g,function(i,r){let a=o[r];return p(a)?encodeURIComponent(a):i})),n&&p(this.proxy)&&(t=this.proxy.getURL(t)),t};function Mr(e){let n=Object.keys(e);return n.length===0?"":n.length===1&&!p(e[n[0]])?`?${n[0]}`:`?${Vt(e)}`}U.prototype.setQueryParameters=function(e,n){n?this._queryParameters=Ln(this._queryParameters,e,!1):this._queryParameters=Ln(e,this._queryParameters,!1)};U.prototype.appendQueryParameters=function(e){this._queryParameters=Ln(e,this._queryParameters,!0)};U.prototype.setTemplateValues=function(e,n){n?this._templateValues=De(this._templateValues,e):this._templateValues=De(e,this._templateValues)};U.prototype.getDerivedResource=function(e){let n=this.clone();if(n._retryCount=0,p(e.url)){let t=O(e.preserveQueryParameters,!1);n.parseUrl(e.url,!0,t,this._url)}return p(e.queryParameters)&&(n._queryParameters=De(e.queryParameters,n.queryParameters)),p(e.templateValues)&&(n._templateValues=De(e.templateValues,n.templateValues)),p(e.headers)&&(n.headers=De(e.headers,n.headers)),p(e.proxy)&&(n.proxy=e.proxy),p(e.request)&&(n.request=e.request),p(e.retryCallback)&&(n.retryCallback=e.retryCallback),p(e.retryAttempts)&&(n.retryAttempts=e.retryAttempts),n};U.prototype.retryOnError=function(e){let n=this.retryCallback;if(typeof n!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let t=this;return Promise.resolve(n(this,e)).then(function(o){return++t._retryCount,o})};U.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=tn(this._queryParameters),e._templateValues=tn(this._templateValues),e.headers=tn(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new U({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:p(this.credits)?this.credits.slice():void 0})};U.prototype.getBaseUri=function(e){return xt(this.getUrlComponent(e),e)};U.prototype.appendForwardSlash=function(){this._url=Nt(this._url)};U.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};U.fetchArrayBuffer=function(e){return new U(e).fetchArrayBuffer()};U.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};U.fetchBlob=function(e){return new U(e).fetchBlob()};U.prototype.fetchImage=function(e){e=O(e,O.EMPTY_OBJECT);let n=O(e.preferImageBitmap,!1),t=O(e.preferBlob,!1),o=O(e.flipY,!1),i=O(e.skipColorSpaceConversion,!1);if(st(this.request),!so||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!t)return ct({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:n});let r=this.fetchBlob();if(!p(r))return;let a,u,d,m;return U.supportsImageBitmapOptions().then(function(l){return a=l,u=a&&n,r}).then(function(l){if(!p(l))return;if(m=l,u)return U.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new U({url:w}),ct({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function ct(e){let n=e.resource,t=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=n.request;r.url=n.url,r.requestFunction=function(){let u=!1;!n.isDataUri&&!n.isBlobUri&&(u=n.isCrossOriginUrl);let d=We();return U._Implementations.createImage(r,u,d,t,o,i),d.promise};let a=kn.request(r);if(p(a))return a.catch(function(u){return r.state!==fe.FAILED?Promise.reject(u):n.retryOnError(u).then(function(d){return d?(r.state=fe.UNISSUED,r.deferred=void 0,ct({resource:n,flipY:t,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}U.fetchImage=function(e){return new U(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};U.prototype.fetchText=function(){return this.fetch({responseType:"text"})};U.fetchText=function(e){return new U(e).fetchText()};U.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(n){if(p(n))return JSON.parse(n)})};U.fetchJson=function(e){return new U(e).fetchJson()};U.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};U.fetchXML=function(e){return new U(e).fetchXML()};U.prototype.fetchJsonp=function(e){e=O(e,"callback"),st(this.request);let n;do n=`loadJsonp${E.nextRandomNumber().toString().substring(2,8)}`;while(p(window[n]));return ao(this,e,n)};function ao(e,n,t){let o={};o[n]=t,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=We();return window[t]=function(d){u.resolve(d);try{delete window[t]}catch{window[t]=void 0}},U._Implementations.loadAndExecuteScript(r,t,u),u.promise};let a=kn.request(i);if(p(a))return a.catch(function(u){return i.state!==fe.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=fe.UNISSUED,i.deferred=void 0,ao(e,n,t)):Promise.reject(u)})})}U.fetchJsonp=function(e){return new U(e).fetchJsonp(e.callbackParameterName)};U.prototype._makeRequest=function(e){let n=this;st(n.request);let t=n.request,o=n.url;t.url=o,t.requestFunction=function(){let r=e.responseType,a=De(e.headers,n.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=We(),w=U._Implementations.loadWithXhr(o,r,d,m,a,l,u);return p(w)&&p(w.abort)&&(t.cancelFunction=function(){w.abort()}),l.promise};let i=kn.request(t);if(p(i))return i.then(function(r){return t.cancelFunction=void 0,r}).catch(function(r){return t.cancelFunction=void 0,t.state!==fe.FAILED?Promise.reject(r):n.retryOnError(r).then(function(a){return a?(t.state=fe.UNISSUED,t.deferred=void 0,n.fetch(e)):Promise.reject(r)})})};function st(e){if(e.state===fe.ISSUED||e.state===fe.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=fe.UNISSUED,e.deferred=void 0}var Pr=/^data:(.*?)(;base64)?,(.*)$/;function Fn(e,n){let t=decodeURIComponent(n);return e?atob(t):t}function io(e,n){let t=Fn(e,n),o=new ArrayBuffer(t.length),i=new Uint8Array(o);for(let r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return o}function Ur(e,n){n=O(n,"");let t=e[1],o=!!e[2],i=e[3],r,a;switch(n){case"":case"text":return Fn(o,i);case"arraybuffer":return io(o,i);case"blob":return r=io(o,i),new Blob([r],{type:t});case"document":return a=new DOMParser,a.parseFromString(Fn(o,i),t);case"json":return JSON.parse(Fn(o,i));default:throw new j(`Unhandled responseType: ${n}`)}}U.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};U.fetch=function(e){return new U(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};U.delete=function(e){return new U(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};U.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};U.head=function(e){return new U(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};U.options=function(e){return new U(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U.prototype.post=function(e,n){return s.defined("data",e),n=Ae(n,{}),n.method="POST",n.data=e,this._makeRequest(n)};U.post=function(e){return new U(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U.prototype.put=function(e,n){return s.defined("data",e),n=Ae(n,{}),n.method="PUT",n.data=e,this._makeRequest(n)};U.put=function(e){return new U(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U.prototype.patch=function(e,n){return s.defined("data",e),n=Ae(n,{}),n.method="PATCH",n.data=e,this._makeRequest(n)};U.patch=function(e){return new U(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U._Implementations={};U._Implementations.loadImageElement=function(e,n,t){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),t.resolve(o)},o.onerror=function(i){t.reject(i)},n&&(it.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};U._Implementations.createImage=function(e,n,t,o,i,r){let a=e.url;U.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){U._Implementations.loadImageElement(a,n,t);return}let d="blob",m="GET",l=We(),w=U._Implementations.loadWithXhr(a,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(T){if(!p(T)){t.reject(new Se(`Successfully retrieved ${a} but it contained no content.`));return}return U.createImageBitmapFromBlob(T,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(T){t.resolve(T)})}).catch(function(u){t.reject(u)})};U.createImageBitmapFromBlob=function(e,n){return s.defined("options",n),s.typeOf.bool("options.flipY",n.flipY),s.typeOf.bool("options.premultiplyAlpha",n.premultiplyAlpha),s.typeOf.bool("options.skipColorSpaceConversion",n.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:n.flipY?"flipY":"none",premultiplyAlpha:n.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:n.skipColorSpaceConversion?"none":"default"})};function zr(e,n,t,o,i,r,a){fetch(e,{method:t,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yn(u.status,u,d));return}switch(n){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yn)})}var Ir=typeof XMLHttpRequest>"u";U._Implementations.loadWithXhr=function(e,n,t,o,i,r,a){let u=Pr.exec(e);if(u!==null){r.resolve(Ur(u,n));return}if(Ir){zr(e,n,t,o,i,r,a);return}let d=new XMLHttpRequest;if(it.contains(e)&&(d.withCredentials=!0),d.open(t,e,!0),p(a)&&p(d.overrideMimeType)&&d.overrideMimeType(a),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(n)&&(d.responseType=n);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yn(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(t==="HEAD"||t==="OPTIONS"){let C=d.getAllResponseHeaders().trim().split(/[\r\n]+/),P={};C.forEach(function(A){let q=A.split(": "),k=q.shift();P[k]=q.join(": ")}),r.resolve(P);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(n)||w===n))r.resolve(l);else if(n==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(T){r.reject(T)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yn)},d.send(o),d};U._Implementations.loadAndExecuteScript=function(e,n,t){return $t(e,n).catch(function(o){t.reject(o)})};U._DefaultImplementations={};U._DefaultImplementations.createImage=U._Implementations.createImage;U._DefaultImplementations.loadWithXhr=U._Implementations.loadWithXhr;U._DefaultImplementations.loadAndExecuteScript=U._Implementations.loadAndExecuteScript;U.DEFAULT=Object.freeze(new U({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ke=U;function On(e){e=O(e,O.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=O(e.addNewLeapSeconds,!0),p(e.data)?fo(this,e.data):fo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}On.fromUrl=async function(e,n){s.defined("url",e),n=O(n,O.EMPTY_OBJECT);let t=ke.createIfNeeded(e),o;try{o=await t.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${t.url}.`)}return new On({addNewLeapSeconds:n.addNewLeapSeconds,data:o})};On.NONE=Object.freeze({compute:function(e,n){return p(n)?(n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0):n=new hn(0,0,0,0,0),n}});On.prototype.compute=function(e,n){if(!p(this._samples))return;if(p(n)||(n=new hn(0,0,0,0,0)),this._samples.length===0)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;let t=this._dates,o=this._lastIndex,i=0,r=0;if(p(o)){let u=t[o],d=t[o+1],m=pe.lessThanOrEquals(u,e),l=!p(d),w=l||pe.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,po(this,t,this._samples,e,i,r,n),n}let a=Be(t,e,pe.compare,this._dateColumn);return a>=0?(a<t.length-1&&t[a+1].equals(e)&&++a,i=a,r=a):(r=~a,i=r-1,i<0&&(i=0)),this._lastIndex=i,po(this,t,this._samples,e,i,r,n),n};function qr(e,n){return pe.compare(e.julianDate,n)}function fo(e,n){if(!p(n.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(n.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let t=n.columnNames.indexOf("modifiedJulianDateUtc"),o=n.columnNames.indexOf("xPoleWanderRadians"),i=n.columnNames.indexOf("yPoleWanderRadians"),r=n.columnNames.indexOf("ut1MinusUtcSeconds"),a=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=n.columnNames.indexOf("taiMinusUtcSeconds");if(t<0||o<0||i<0||r<0||a<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=n.samples,l=e._dates=[];e._dateColumn=t,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=n.columnNames.length,e._lastIndex=void 0;let w,T=e._addNewLeapSeconds;for(let C=0,P=m.length;C<P;C+=e._columnCount){let A=m[C+t],q=m[C+d],k=A+ce.MODIFIED_JULIAN_DATE_DIFFERENCE,L=new pe(k,q,$.TAI);if(l.push(L),T){if(q!==w&&p(w)){let F=pe.leapSeconds,B=Be(F,L,qr);if(B<0){let W=new te(L,q);F.splice(~B,0,W)}}w=q}}}function uo(e,n,t,o,i){let r=t*o;i.xPoleWander=n[r+e._xPoleWanderRadiansColumn],i.yPoleWander=n[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=n[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=n[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=n[r+e._ut1MinusUtcSecondsColumn]}function bn(e,n,t){return n+e*(t-n)}function po(e,n,t,o,i,r,a){let u=e._columnCount;if(r>n.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;let d=n[i],m=n[r];if(d.equals(m)||o.equals(d))return uo(e,t,i,u,a),a;if(o.equals(m))return uo(e,t,r,u,a),a;let l=pe.secondsDifference(o,d)/pe.secondsDifference(m,d),w=i*u,T=r*u,C=t[w+e._ut1MinusUtcSecondsColumn],P=t[T+e._ut1MinusUtcSecondsColumn],A=P-C;if(A>.5||A<-.5){let q=t[w+e._taiMinusUtcSecondsColumn],k=t[T+e._taiMinusUtcSecondsColumn];q!==k&&(m.equals(o)?C=P:P-=k-q)}return a.xPoleWander=bn(l,t[w+e._xPoleWanderRadiansColumn],t[T+e._xPoleWanderRadiansColumn]),a.yPoleWander=bn(l,t[w+e._yPoleWanderRadiansColumn],t[T+e._yPoleWanderRadiansColumn]),a.xPoleOffset=bn(l,t[w+e._xCelestialPoleOffsetRadiansColumn],t[T+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=bn(l,t[w+e._yCelestialPoleOffsetRadiansColumn],t[T+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=bn(l,C,P),a}var ho=On;function be(e,n,t){this.heading=O(e,0),this.pitch=O(n,0),this.roll=O(t,0)}be.fromQuaternion=function(e,n){if(!p(e))throw new j("quaternion is required");p(n)||(n=new be);let t=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),a=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(a,r),n.roll=Math.atan2(i,o),n.pitch=-E.asinClamped(t),n};be.fromDegrees=function(e,n,t,o){if(!p(e))throw new j("heading is required");if(!p(n))throw new j("pitch is required");if(!p(t))throw new j("roll is required");return p(o)||(o=new be),o.heading=e*E.RADIANS_PER_DEGREE,o.pitch=n*E.RADIANS_PER_DEGREE,o.roll=t*E.RADIANS_PER_DEGREE,o};be.clone=function(e,n){if(p(e))return p(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new be(e.heading,e.pitch,e.roll)};be.equals=function(e,n){return e===n||p(e)&&p(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll};be.equalsEpsilon=function(e,n,t,o){return e===n||p(e)&&p(n)&&E.equalsEpsilon(e.heading,n.heading,t,o)&&E.equalsEpsilon(e.pitch,n.pitch,t,o)&&E.equalsEpsilon(e.roll,n.roll,t,o)};be.prototype.clone=function(e){return be.clone(this,e)};be.prototype.equals=function(e){return be.equals(this,e)};be.prototype.equalsEpsilon=function(e,n,t){return be.equalsEpsilon(this,e,n,t)};be.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var xn=be;var mo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Dr(){let e=document.getElementsByTagName("script");for(let n=0,t=e.length;n<t;++n){let o=e[n].getAttribute("src"),i=mo.exec(o);if(i!==null)return i[1]}}var Bn;function yo(e){return typeof document>"u"?e:(p(Bn)||(Bn=document.createElement("a")),Bn.href=e,Bn.href)}var Ve;function lo(){if(p(Ve))return Ve;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mn(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Sn.toUrl)?e=mn("..",Ye("Core/buildModuleUrl.js")):e=Dr(),!p(e))throw new j("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ve=new ke({url:yo(e)}),Ve.appendForwardSlash(),Ve}function Nr(e){return yo(Sn.toUrl(`../${e}`))}function wo(e){return lo().getDerivedResource({url:e}).url}var Qn;function Ye(e){return p(Qn)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Sn.toUrl)?Qn=Nr:Qn=wo),Qn(e)}Ye._cesiumScriptRegex=mo;Ye._buildModuleUrlFromBaseUrl=wo;Ye._clearBaseResource=function(){Ve=void 0};Ye.setBaseUrl=function(e){Ve=ke.DEFAULT.getDerivedResource({url:e})};Ye.getCesiumBaseUrl=lo;var bo=Ye;function kr(e,n,t){this.x=e,this.y=n,this.s=t}var Wn=kr;function ut(e){e=O(e,O.EMPTY_OBJECT),this._xysFileUrlTemplate=ke.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=O(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=O(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new pe(this._sampleZeroJulianEphemerisDate,0,$.TAI),this._stepSizeDays=O(e.stepSizeDays,1),this._samplesPerXysFile=O(e.samplesPerXysFile,1e3),this._totalSamples=O(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let n=this._interpolationOrder,t=this._denominators=new Array(n+1),o=this._xTable=new Array(n+1),i=Math.pow(this._stepSizeDays,n);for(let r=0;r<=n;++r){t[r]=i,o[r]=r*this._stepSizeDays;for(let a=0;a<=n;++a)a!==r&&(t[r]*=r-a);t[r]=1/t[r]}this._work=new Array(n+1),this._coef=new Array(n+1)}var Fr=new pe(0,0,$.TAI);function at(e,n,t){let o=Fr;return o.dayNumber=n,o.secondsOfDay=t,pe.daysDifference(o,e._sampleZeroDateTT)}ut.prototype.preload=function(e,n,t,o){let i=at(this,e,n),r=at(this,t,o),a=i/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=a/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(ft(this,w));return Promise.all(l)};ut.prototype.computeXysRadians=function(e,n,t){let o=at(this,e,n);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,a=i-(r/2|0);a<0&&(a=0);let u=a+r;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-r,a<0&&(a=0));let d=!1,m=this._samples;if(p(m[a*3])||(ft(this,a/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(ft(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(t)?(t.x=0,t.y=0,t.s=0):t=new Wn(0,0,0);let l=o-a*this._stepSizeDays,w=this._work,T=this._denominators,C=this._coef,P=this._xTable,A,q;for(A=0;A<=r;++A)w[A]=l-P[A];for(A=0;A<=r;++A){for(C[A]=1,q=0;q<=r;++q)q!==A&&(C[A]*=w[q]);C[A]*=T[A];let k=(a+A)*3;t.x+=C[A]*m[k++],t.y+=C[A]*m[k++],t.s+=C[A]*m[k]}return t};function ft(e,n){if(e._chunkDownloadsInProgress[n])return e._chunkDownloadsInProgress[n];let t,o=e._xysFileUrlTemplate;p(o)?t=o.getDerivedResource({templateValues:{0:n}}):t=new ke({url:bo(`Assets/IAU2006_XYS/IAU2006_XYS_${n}.json`)});let i=t.fetchJson().then(function(r){e._chunkDownloadsInProgress[n]=!1;let a=e._samples,u=r.samples,d=n*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)a[d+m]=u[m]});return e._chunkDownloadsInProgress[n]=i,i}var Oo=ut;function R(e,n,t,o){this.x=O(e,0),this.y=O(n,0),this.z=O(t,0),this.w=O(o,0)}var gn=new _;R.fromAxisAngle=function(e,n,t){s.typeOf.object("axis",e),s.typeOf.number("angle",n);let o=n/2,i=Math.sin(o);gn=_.normalize(e,gn);let r=gn.x*i,a=gn.y*i,u=gn.z*i,d=Math.cos(o);return p(t)?(t.x=r,t.y=a,t.z=u,t.w=d,t):new R(r,a,u,d)};var Lr=[1,2,0],xr=new Array(3);R.fromRotationMatrix=function(e,n){s.typeOf.object("matrix",e);let t,o,i,r,a,u=e[Q.COLUMN0ROW0],d=e[Q.COLUMN1ROW1],m=e[Q.COLUMN2ROW2],l=u+d+m;if(l>0)t=Math.sqrt(l+1),a=.5*t,t=.5/t,o=(e[Q.COLUMN1ROW2]-e[Q.COLUMN2ROW1])*t,i=(e[Q.COLUMN2ROW0]-e[Q.COLUMN0ROW2])*t,r=(e[Q.COLUMN0ROW1]-e[Q.COLUMN1ROW0])*t;else{let w=Lr,T=0;d>u&&(T=1),m>u&&m>d&&(T=2);let C=w[T],P=w[C];t=Math.sqrt(e[Q.getElementIndex(T,T)]-e[Q.getElementIndex(C,C)]-e[Q.getElementIndex(P,P)]+1);let A=xr;A[T]=.5*t,t=.5/t,a=(e[Q.getElementIndex(P,C)]-e[Q.getElementIndex(C,P)])*t,A[C]=(e[Q.getElementIndex(C,T)]+e[Q.getElementIndex(T,C)])*t,A[P]=(e[Q.getElementIndex(P,T)]+e[Q.getElementIndex(T,P)])*t,o=-A[0],i=-A[1],r=-A[2]}return p(n)?(n.x=o,n.y=i,n.z=r,n.w=a,n):new R(o,i,r,a)};var go=new R,_o=new R,pt=new R,So=new R;R.fromHeadingPitchRoll=function(e,n){return s.typeOf.object("headingPitchRoll",e),So=R.fromAxisAngle(_.UNIT_X,e.roll,go),pt=R.fromAxisAngle(_.UNIT_Y,-e.pitch,n),n=R.multiply(pt,So,pt),_o=R.fromAxisAngle(_.UNIT_Z,-e.heading,go),R.multiply(_o,n,n)};var Hn=new _,ht=new _,Ee=new R,Ro=new R,$n=new R;R.packedLength=4;R.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=O(t,0),n[t++]=e.x,n[t++]=e.y,n[t++]=e.z,n[t]=e.w,n};R.unpack=function(e,n,t){return s.defined("array",e),n=O(n,0),p(t)||(t=new R),t.x=e[n],t.y=e[n+1],t.z=e[n+2],t.w=e[n+3],t};R.packedInterpolationLength=3;R.convertPackedArrayForInterpolation=function(e,n,t,o){R.unpack(e,t*4,$n),R.conjugate($n,$n);for(let i=0,r=t-n+1;i<r;i++){let a=i*3;R.unpack(e,(n+i)*4,Ee),R.multiply(Ee,$n,Ee),Ee.w<0&&R.negate(Ee,Ee),R.computeAxis(Ee,Hn);let u=R.computeAngle(Ee);p(o)||(o=[]),o[a]=Hn.x*u,o[a+1]=Hn.y*u,o[a+2]=Hn.z*u}};R.unpackInterpolationResult=function(e,n,t,o,i){p(i)||(i=new R),_.fromArray(e,0,ht);let r=_.magnitude(ht);return R.unpack(n,o*4,Ro),r===0?R.clone(R.IDENTITY,Ee):R.fromAxisAngle(ht,r,Ee),R.multiply(Ee,Ro,i)};R.clone=function(e,n){if(p(e))return p(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new R(e.x,e.y,e.z,e.w)};R.conjugate=function(e,n){return s.typeOf.object("quaternion",e),s.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=e.w,n};R.magnitudeSquared=function(e){return s.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};R.magnitude=function(e){return Math.sqrt(R.magnitudeSquared(e))};R.normalize=function(e,n){s.typeOf.object("result",n);let t=1/R.magnitude(e),o=e.x*t,i=e.y*t,r=e.z*t,a=e.w*t;return n.x=o,n.y=i,n.z=r,n.w=a,n};R.inverse=function(e,n){s.typeOf.object("result",n);let t=R.magnitudeSquared(e);return n=R.conjugate(e,n),R.multiplyByScalar(n,1/t,n)};R.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x+n.x,t.y=e.y+n.y,t.z=e.z+n.z,t.w=e.w+n.w,t};R.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x-n.x,t.y=e.y-n.y,t.z=e.z-n.z,t.w=e.w-n.w,t};R.negate=function(e,n){return s.typeOf.object("quaternion",e),s.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=-e.w,n};R.dot=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z+e.w*n.w};R.multiply=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e.x,i=e.y,r=e.z,a=e.w,u=n.x,d=n.y,m=n.z,l=n.w,w=a*u+o*l+i*m-r*d,T=a*d-o*m+i*l+r*u,C=a*m+o*d-i*u+r*l,P=a*l-o*u-i*d-r*m;return t.x=w,t.y=T,t.z=C,t.w=P,t};R.multiplyByScalar=function(e,n,t){return s.typeOf.object("quaternion",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t.w=e.w*n,t};R.divideByScalar=function(e,n,t){return s.typeOf.object("quaternion",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};R.computeAxis=function(e,n){s.typeOf.object("quaternion",e),s.typeOf.object("result",n);let t=e.w;if(Math.abs(t-1)<E.EPSILON6||Math.abs(t+1)<E.EPSILON6)return n.x=1,n.y=n.z=0,n;let o=1/Math.sqrt(1-t*t);return n.x=e.x*o,n.y=e.y*o,n.z=e.z*o,n};R.computeAngle=function(e){return s.typeOf.object("quaternion",e),Math.abs(e.w-1)<E.EPSILON6?0:2*Math.acos(e.w)};var dt=new R;R.lerp=function(e,n,t,o){return s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o),dt=R.multiplyByScalar(n,t,dt),o=R.multiplyByScalar(e,1-t,o),R.add(dt,o,o)};var Eo=new R,mt=new R,yt=new R;R.slerp=function(e,n,t,o){s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o);let i=R.dot(e,n),r=n;if(i<0&&(i=-i,r=Eo=R.negate(n,Eo)),1-i<E.EPSILON6)return R.lerp(e,r,t,o);let a=Math.acos(i);return mt=R.multiplyByScalar(e,Math.sin((1-t)*a),mt),yt=R.multiplyByScalar(r,Math.sin(t*a),yt),o=R.add(mt,yt,o),R.multiplyByScalar(o,1/Math.sin(a),o)};R.log=function(e,n){s.typeOf.object("quaternion",e),s.typeOf.object("result",n);let t=E.acosClamped(e.w),o=0;return t!==0&&(o=t/Math.sin(t)),_.multiplyByScalar(e,o,n)};R.exp=function(e,n){s.typeOf.object("cartesian",e),s.typeOf.object("result",n);let t=_.magnitude(e),o=0;return t!==0&&(o=Math.sin(t)/t),n.x=e.x*o,n.y=e.y*o,n.z=e.z*o,n.w=Math.cos(t),n};var Br=new _,Qr=new _,_n=new R,sn=new R;R.computeInnerQuadrangle=function(e,n,t,o){s.typeOf.object("q0",e),s.typeOf.object("q1",n),s.typeOf.object("q2",t),s.typeOf.object("result",o);let i=R.conjugate(n,_n);R.multiply(i,t,sn);let r=R.log(sn,Br);R.multiply(i,e,sn);let a=R.log(sn,Qr);return _.add(r,a,r),_.multiplyByScalar(r,.25,r),_.negate(r,r),R.exp(r,_n),R.multiply(n,_n,o)};R.squad=function(e,n,t,o,i,r){s.typeOf.object("q0",e),s.typeOf.object("q1",n),s.typeOf.object("s0",t),s.typeOf.object("s1",o),s.typeOf.number("t",i),s.typeOf.object("result",r);let a=R.slerp(e,n,i,_n),u=R.slerp(t,o,i,sn);return R.slerp(a,u,2*i*(1-i),r)};var Wr=new R,To=1.9011074535173003,Vn=un.supportsTypedArrays()?new Float32Array(8):[],Yn=un.supportsTypedArrays()?new Float32Array(8):[],Ue=un.supportsTypedArrays()?new Float32Array(8):[],ze=un.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let n=e+1,t=2*n+1;Vn[e]=1/(n*t),Yn[e]=n/t}Vn[7]=To/(8*17);Yn[7]=To*8/17;R.fastSlerp=function(e,n,t,o){s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o);let i=R.dot(e,n),r;i>=0?r=1:(r=-1,i=-i);let a=i-1,u=1-t,d=t*t,m=u*u;for(let C=7;C>=0;--C)Ue[C]=(Vn[C]*d-Yn[C])*a,ze[C]=(Vn[C]*m-Yn[C])*a;let l=r*t*(1+Ue[0]*(1+Ue[1]*(1+Ue[2]*(1+Ue[3]*(1+Ue[4]*(1+Ue[5]*(1+Ue[6]*(1+Ue[7])))))))),w=u*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),T=R.multiplyByScalar(e,w,Wr);return R.multiplyByScalar(n,l,o),R.add(T,o,o)};R.fastSquad=function(e,n,t,o,i,r){s.typeOf.object("q0",e),s.typeOf.object("q1",n),s.typeOf.object("s0",t),s.typeOf.object("s1",o),s.typeOf.number("t",i),s.typeOf.object("result",r);let a=R.fastSlerp(e,n,i,_n),u=R.fastSlerp(t,o,i,sn);return R.fastSlerp(a,u,2*i*(1-i),r)};R.equals=function(e,n){return e===n||p(e)&&p(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w};R.equalsEpsilon=function(e,n,t){return t=O(t,0),e===n||p(e)&&p(n)&&Math.abs(e.x-n.x)<=t&&Math.abs(e.y-n.y)<=t&&Math.abs(e.z-n.z)<=t&&Math.abs(e.w-n.w)<=t};R.ZERO=Object.freeze(new R(0,0,0,0));R.IDENTITY=Object.freeze(new R(0,0,0,1));R.prototype.clone=function(e){return R.clone(this,e)};R.prototype.equals=function(e){return R.equals(this,e)};R.prototype.equalsEpsilon=function(e,n){return R.equalsEpsilon(this,e,n)};R.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=R;var V={},lt={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},an={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},wt={},ge={east:new _,north:new _,up:new _,west:new _,south:new _,down:new _},Fe=new _,Le=new _,xe=new _;V.localFrameToFixedFrameGenerator=function(e,n){if(!lt.hasOwnProperty(e)||!lt[e].hasOwnProperty(n))throw new j("firstAxis and secondAxis must be east, north, up, west, south or down.");let t=lt[e][n],o,i=e+n;return p(wt[i])?o=wt[i]:(o=function(r,a,u){if(!p(r))throw new j("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new j("origin has a NaN component");if(p(u)||(u=new G),_.equalsEpsilon(r,_.ZERO,E.EPSILON14))_.unpack(an[e],0,Fe),_.unpack(an[n],0,Le),_.unpack(an[t],0,xe);else if(E.equalsEpsilon(r.x,0,E.EPSILON14)&&E.equalsEpsilon(r.y,0,E.EPSILON14)){let d=E.sign(r.z);_.unpack(an[e],0,Fe),e!=="east"&&e!=="west"&&_.multiplyByScalar(Fe,d,Fe),_.unpack(an[n],0,Le),n!=="east"&&n!=="west"&&_.multiplyByScalar(Le,d,Le),_.unpack(an[t],0,xe),t!=="east"&&t!=="west"&&_.multiplyByScalar(xe,d,xe)}else{a=O(a,Ie.default),a.geodeticSurfaceNormal(r,ge.up);let d=ge.up,m=ge.east;m.x=-r.y,m.y=r.x,m.z=0,_.normalize(m,ge.east),_.cross(d,m,ge.north),_.multiplyByScalar(ge.up,-1,ge.down),_.multiplyByScalar(ge.east,-1,ge.west),_.multiplyByScalar(ge.north,-1,ge.south),Fe=ge[e],Le=ge[n],xe=ge[t]}return u[0]=Fe.x,u[1]=Fe.y,u[2]=Fe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=xe.x,u[9]=xe.y,u[10]=xe.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},wt[i]=o),o};V.eastNorthUpToFixedFrame=V.localFrameToFixedFrameGenerator("east","north");V.northEastDownToFixedFrame=V.localFrameToFixedFrameGenerator("north","east");V.northUpEastToFixedFrame=V.localFrameToFixedFrameGenerator("north","up");V.northWestUpToFixedFrame=V.localFrameToFixedFrameGenerator("north","west");var Hr=new Xe,$r=new _(1,1,1),Vr=new G;V.headingPitchRollToFixedFrame=function(e,n,t,o,i){s.typeOf.object("HeadingPitchRoll",n),o=O(o,V.eastNorthUpToFixedFrame);let r=Xe.fromHeadingPitchRoll(n,Hr),a=G.fromTranslationQuaternionRotationScale(_.ZERO,r,$r,Vr);return i=o(e,t,i),G.multiply(i,a,i)};var Yr=new G,Xr=new Q;V.headingPitchRollQuaternion=function(e,n,t,o,i){s.typeOf.object("HeadingPitchRoll",n);let r=V.headingPitchRollToFixedFrame(e,n,t,o,Yr),a=G.getMatrix3(r,Xr);return Xe.fromRotationMatrix(a,i)};var Zr=new _(1,1,1),Jr=new _,Co=new G,Gr=new G,Kr=new Q,ei=new Xe;V.fixedFrameToHeadingPitchRoll=function(e,n,t,o){s.defined("transform",e),n=O(n,Ie.default),t=O(t,V.eastNorthUpToFixedFrame),p(o)||(o=new xn);let i=G.getTranslation(e,Jr);if(_.equals(i,_.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=G.inverseTransformation(t(i,n,Co),Co),a=G.setScale(e,Zr,Gr);a=G.setTranslation(a,_.ZERO,a),r=G.multiply(r,a,r);let u=Xe.fromRotationMatrix(G.getMatrix3(r,Kr),ei);return u=Xe.normalize(u,u),xn.fromQuaternion(u,o)};var ni=6*3600+41*60+50.54841,ti=8640184812866e-6,oi=.093104,ri=-62e-7,ii=11772758384668e-32,ci=72921158553e-15,si=E.TWO_PI/86400,Xn=new pe;V.computeIcrfToCentralBodyFixedMatrix=function(e,n){let t=V.computeIcrfToFixedMatrix(e,n);return p(t)||(t=V.computeTemeToPseudoFixedMatrix(e,n)),t};V.computeTemeToPseudoFixedMatrix=function(e,n){if(!p(e))throw new j("date is required.");Xn=pe.addSeconds(e,-pe.computeTaiMinusUtc(e),Xn);let t=Xn.dayNumber,o=Xn.secondsOfDay,i,r=t-2451545;o>=43200?i=(r+.5)/ce.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ce.DAYS_PER_JULIAN_CENTURY;let u=(ni+i*(ti+i*(oi+i*ri)))*si%E.TWO_PI,d=ci+ii*(t-24515455e-1),m=(o+ce.SECONDS_PER_DAY*.5)%ce.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),T=Math.sin(l);return p(n)?(n[0]=w,n[1]=-T,n[2]=0,n[3]=T,n[4]=w,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new Q(w,T,0,-T,w,0,0,0,1)};V.iau2006XysData=new Oo;V.earthOrientationParameters=ho.NONE;var gt=32.184,ai=2451545;V.preloadIcrfFixed=function(e){let n=e.start.dayNumber,t=e.start.secondsOfDay+gt,o=e.stop.dayNumber,i=e.stop.secondsOfDay+gt;return V.iau2006XysData.preload(n,t,o,i)};V.computeIcrfToFixedMatrix=function(e,n){if(!p(e))throw new j("date is required.");p(n)||(n=new Q);let t=V.computeFixedToIcrfMatrix(e,n);if(p(t))return Q.transpose(t,n)};var fi=32.184,ui=2451545,Zn=new xn,pi=new Q,hi=new pe;V.computeMoonFixedToIcrfMatrix=function(e,n){if(!p(e))throw new j("date is required.");p(n)||(n=new Q);let t=pe.addSeconds(e,fi,hi),o=pe.totalDays(t)-ui,i=E.toRadians(12.112)-E.toRadians(.052992)*o,r=E.toRadians(24.224)-E.toRadians(.105984)*o,a=E.toRadians(227.645)+E.toRadians(13.012)*o,u=E.toRadians(261.105)+E.toRadians(13.340716)*o,d=E.toRadians(358)+E.toRadians(.9856)*o;return Zn.pitch=E.toRadians(180)-E.toRadians(3.878)*Math.sin(i)-E.toRadians(.12)*Math.sin(r)+E.toRadians(.07)*Math.sin(a)-E.toRadians(.017)*Math.sin(u),Zn.roll=E.toRadians(66.53-90)+E.toRadians(1.543)*Math.cos(i)+E.toRadians(.24)*Math.cos(r)-E.toRadians(.028)*Math.cos(a)+E.toRadians(.007)*Math.cos(u),Zn.heading=E.toRadians(244.375-90)+E.toRadians(13.17635831)*o+E.toRadians(3.558)*Math.sin(i)+E.toRadians(.121)*Math.sin(r)-E.toRadians(.064)*Math.sin(a)+E.toRadians(.016)*Math.sin(u)+E.toRadians(.025)*Math.sin(d),Q.fromHeadingPitchRoll(Zn,pi)};V.computeIcrfToMoonFixedMatrix=function(e,n){if(!p(e))throw new j("date is required.");p(n)||(n=new Q);let t=V.computeMoonFixedToIcrfMatrix(e,n);if(p(t))return Q.transpose(t,n)};var di=new Wn(0,0,0),mi=new hn(0,0,0,0,0,0),bt=new Q,Ot=new Q;V.computeFixedToIcrfMatrix=function(e,n){if(!p(e))throw new j("date is required.");p(n)||(n=new Q);let t=V.earthOrientationParameters.compute(e,mi);if(!p(t))return;let o=e.dayNumber,i=e.secondsOfDay+gt,r=V.iau2006XysData.computeXysRadians(o,i,di);if(!p(r))return;let a=r.x+t.xPoleOffset,u=r.y+t.yPoleOffset,d=1/(1+Math.sqrt(1-a*a-u*u)),m=bt;m[0]=1-d*a*a,m[3]=-d*a*u,m[6]=a,m[1]=-d*a*u,m[4]=1-d*u*u,m[7]=u,m[2]=-a,m[5]=-u,m[8]=1-d*(a*a+u*u);let l=Q.fromRotationZ(-r.s,Ot),w=Q.multiply(m,l,bt),T=e.dayNumber,C=e.secondsOfDay-pe.computeTaiMinusUtc(e)+t.ut1MinusUtc,P=T-2451545,A=C/ce.SECONDS_PER_DAY,q=.779057273264+A+.00273781191135448*(P+A);q=q%1*E.TWO_PI;let k=Q.fromRotationZ(q,Ot),L=Q.multiply(w,k,bt),F=Math.cos(t.xPoleWander),B=Math.cos(t.yPoleWander),W=Math.sin(t.xPoleWander),H=Math.sin(t.yPoleWander),ee=o-ai+i/ce.SECONDS_PER_DAY;ee/=36525;let re=-47e-6*ee*E.RADIANS_PER_DEGREE/3600,Z=Math.cos(re),oe=Math.sin(re),J=Ot;return J[0]=F*Z,J[1]=F*oe,J[2]=W,J[3]=-B*oe+H*W*Z,J[4]=B*Z+H*W*oe,J[5]=-H*F,J[6]=-H*oe-B*W*Z,J[7]=H*Z-B*W*oe,J[8]=B*F,Q.multiply(L,J,n)};var yi=new qe;V.pointToWindowCoordinates=function(e,n,t,o){return o=V.pointToGLWindowCoordinates(e,n,t,o),o.y=2*n[5]-o.y,o};V.pointToGLWindowCoordinates=function(e,n,t,o){if(!p(e))throw new j("modelViewProjectionMatrix is required.");if(!p(n))throw new j("viewportTransformation is required.");if(!p(t))throw new j("point is required.");p(o)||(o=new Oe);let i=yi;return G.multiplyByVector(e,qe.fromElements(t.x,t.y,t.z,1,i),i),qe.multiplyByScalar(i,1/i.w,i),G.multiplyByVector(n,i,i),Oe.fromCartesian4(i,o)};var li=new _,wi=new _,bi=new _;V.rotationMatrixFromPositionVelocity=function(e,n,t,o){if(!p(e))throw new j("position is required.");if(!p(n))throw new j("velocity is required.");let i=O(t,Ie.default).geodeticSurfaceNormal(e,li),r=_.cross(n,i,wi);_.equalsEpsilon(r,_.ZERO,E.EPSILON6)&&(r=_.clone(_.UNIT_X,r));let a=_.cross(r,n,bi);return _.normalize(a,a),_.cross(n,a,r),_.negate(r,r),_.normalize(r,r),p(o)||(o=new Q),o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=a.x,o[7]=a.y,o[8]=a.z,o};var vo=new G(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Ao=new Me,_t=new _,Oi=new _,gi=new Q,St=new G,jo=new G;V.basisTo2D=function(e,n,t){if(!p(e))throw new j("projection is required.");if(!p(n))throw new j("matrix is required.");if(!p(t))throw new j("result is required.");let o=G.getTranslation(n,Oi),i=e.ellipsoid,r;if(_.equals(o,_.ZERO))r=_.clone(_.ZERO,_t);else{let l=i.cartesianToCartographic(o,Ao);r=e.project(l,_t),_.fromElements(r.z,r.x,r.y,r)}let a=V.eastNorthUpToFixedFrame(o,i,St),u=G.inverseTransformation(a,jo),d=G.getMatrix3(n,gi),m=G.multiplyByMatrix3(u,d,t);return G.multiply(vo,m,t),G.setTranslation(t,r,t),t};V.ellipsoidTo2DModelMatrix=function(e,n,t){if(!p(e))throw new j("projection is required.");if(!p(n))throw new j("center is required.");if(!p(t))throw new j("result is required.");let o=e.ellipsoid,i=V.eastNorthUpToFixedFrame(n,o,St),r=G.inverseTransformation(i,jo),a=o.cartesianToCartographic(n,Ao),u=e.project(a,_t);_.fromElements(u.z,u.x,u.y,u);let d=G.fromTranslation(u,St);return G.multiply(vo,r,t),G.multiply(d,t,t),t};var Mo=V;function x(e,n,t,o){this.west=O(e,0),this.south=O(n,0),this.east=O(t,0),this.north=O(o,0)}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=O(t,0),n[t++]=e.west,n[t++]=e.south,n[t++]=e.east,n[t]=e.north,n};x.unpack=function(e,n,t){return s.defined("array",e),n=O(n,0),p(t)||(t=new x),t.west=e[n++],t.south=e[n++],t.east=e[n++],t.north=e[n],t};x.computeWidth=function(e){s.typeOf.object("rectangle",e);let n=e.east,t=e.west;return n<t&&(n+=E.TWO_PI),n-t};x.computeHeight=function(e){return s.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,n,t,o,i){return e=E.toRadians(O(e,0)),n=E.toRadians(O(n,0)),t=E.toRadians(O(t,0)),o=E.toRadians(O(o,0)),p(i)?(i.west=e,i.south=n,i.east=t,i.north=o,i):new x(e,n,t,o)};x.fromRadians=function(e,n,t,o,i){return p(i)?(i.west=O(e,0),i.south=O(n,0),i.east=O(t,0),i.north=O(o,0),i):new x(e,n,t,o)};x.fromCartographicArray=function(e,n){s.defined("cartographics",e);let t=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];t=Math.min(t,l.longitude),o=Math.max(o,l.longitude),a=Math.min(a,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-t>r-i&&(t=i,o=r,o>E.PI&&(o=o-E.TWO_PI),t>E.PI&&(t=t-E.TWO_PI)),p(n)?(n.west=t,n.south=a,n.east=o,n.north=u,n):new x(t,a,o,u)};x.fromCartesianArray=function(e,n,t){s.defined("cartesians",e),n=O(n,Ie.default);let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=n.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let T=w.longitude>=0?w.longitude:w.longitude+E.TWO_PI;r=Math.min(r,T),a=Math.max(a,T)}return i-o>a-r&&(o=r,i=a,i>E.PI&&(i=i-E.TWO_PI),o>E.PI&&(o=o-E.TWO_PI)),p(t)?(t.west=o,t.south=u,t.east=i,t.north=d,t):new x(o,u,i,d)};var _i=new _,Si=new _,Ri=new _,Ei=new _,Ti=new _,Rt=new Array(5);for(let e=0;e<Rt.length;++e)Rt[e]=new _;x.fromBoundingSphere=function(e,n,t){s.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(n)||(n=Ie.default),p(t)||(t=new x),_.equals(o,_.ZERO))return x.clone(x.MAX_VALUE,t),t;let r=Mo.eastNorthUpToFixedFrame(o,n,_i),a=G.multiplyByPointAsVector(r,_.UNIT_X,Si);_.normalize(a,a);let u=G.multiplyByPointAsVector(r,_.UNIT_Y,Ri);_.normalize(u,u),_.multiplyByScalar(u,i,u),_.multiplyByScalar(a,i,a);let d=_.negate(u,Ti),m=_.negate(a,Ei),l=Rt,w=l[0];return _.add(o,u,w),w=l[1],_.add(o,m,w),w=l[2],_.add(o,d,w),w=l[3],_.add(o,a,w),l[4]=o,x.fromCartesianArray(l,n,t)};x.clone=function(e,n){if(p(e))return p(n)?(n.west=e.west,n.south=e.south,n.east=e.east,n.north=e.north,n):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,n,t){return t=O(t,0),e===n||p(e)&&p(n)&&Math.abs(e.west-n.west)<=t&&Math.abs(e.south-n.south)<=t&&Math.abs(e.east-n.east)<=t&&Math.abs(e.north-n.north)<=t};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,n){return e===n||p(e)&&p(n)&&e.west===n.west&&e.south===n.south&&e.east===n.east&&e.north===n.north};x.prototype.equalsEpsilon=function(e,n){return x.equalsEpsilon(this,e,n)};x._validate=function(e){s.typeOf.object("rectangle",e);let n=e.north;s.typeOf.number.greaterThanOrEquals("north",n,-E.PI_OVER_TWO),s.typeOf.number.lessThanOrEquals("north",n,E.PI_OVER_TWO);let t=e.south;s.typeOf.number.greaterThanOrEquals("south",t,-E.PI_OVER_TWO),s.typeOf.number.lessThanOrEquals("south",t,E.PI_OVER_TWO);let o=e.west;s.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),s.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;s.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),s.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new Me(e.west,e.south)};x.northwest=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new Me(e.west,e.north)};x.northeast=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new Me(e.east,e.north)};x.southeast=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new Me(e.east,e.south)};x.center=function(e,n){s.typeOf.object("rectangle",e);let t=e.east,o=e.west;t<o&&(t+=E.TWO_PI);let i=E.negativePiToPi((o+t)*.5),r=(e.south+e.north)*.5;return p(n)?(n.longitude=i,n.latitude=r,n.height=0,n):new Me(i,r)};x.intersection=function(e,n,t){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",n);let o=e.east,i=e.west,r=n.east,a=n.west;o<i&&r>0?o+=E.TWO_PI:r<a&&o>0&&(r+=E.TWO_PI),o<i&&a<0?a+=E.TWO_PI:r<a&&i<0&&(i+=E.TWO_PI);let u=E.negativePiToPi(Math.max(i,a)),d=E.negativePiToPi(Math.min(o,r));if((e.west<e.east||n.west<n.east)&&d<=u)return;let m=Math.max(e.south,n.south),l=Math.min(e.north,n.north);if(!(m>=l))return p(t)?(t.west=u,t.south=m,t.east=d,t.north=l,t):new x(u,m,d,l)};x.simpleIntersection=function(e,n,t){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",n);let o=Math.max(e.west,n.west),i=Math.max(e.south,n.south),r=Math.min(e.east,n.east),a=Math.min(e.north,n.north);if(!(i>=a||o>=r))return p(t)?(t.west=o,t.south=i,t.east=r,t.north=a,t):new x(o,i,r,a)};x.union=function(e,n,t){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",n),p(t)||(t=new x);let o=e.east,i=e.west,r=n.east,a=n.west;o<i&&r>0?o+=E.TWO_PI:r<a&&o>0&&(r+=E.TWO_PI),o<i&&a<0?a+=E.TWO_PI:r<a&&i<0&&(i+=E.TWO_PI);let u=E.negativePiToPi(Math.min(i,a)),d=E.negativePiToPi(Math.max(o,r));return t.west=u,t.south=Math.min(e.south,n.south),t.east=d,t.north=Math.max(e.north,n.north),t};x.expand=function(e,n,t){return s.typeOf.object("rectangle",e),s.typeOf.object("cartographic",n),p(t)||(t=new x),t.west=Math.min(e.west,n.longitude),t.south=Math.min(e.south,n.latitude),t.east=Math.max(e.east,n.longitude),t.north=Math.max(e.north,n.latitude),t};x.contains=function(e,n){s.typeOf.object("rectangle",e),s.typeOf.object("cartographic",n);let t=n.longitude,o=n.latitude,i=e.west,r=e.east;return r<i&&(r+=E.TWO_PI,t<0&&(t+=E.TWO_PI)),(t>i||E.equalsEpsilon(t,i,E.EPSILON14))&&(t<r||E.equalsEpsilon(t,r,E.EPSILON14))&&o>=e.south&&o<=e.north};var Ci=new Me;x.subsample=function(e,n,t,o){s.typeOf.object("rectangle",e),n=O(n,Ie.default),t=O(t,0),p(o)||(o=[]);let i=0,r=e.north,a=e.south,u=e.east,d=e.west,m=Ci;m.height=t,m.longitude=d,m.latitude=r,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.latitude=a,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=n.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:a>0?m.latitude=a:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*E.PI_OVER_TWO,x.contains(e,m)&&(o[i]=n.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=n.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,n,t,o,i,r){if(s.typeOf.object("rectangle",e),s.typeOf.number.greaterThanOrEquals("westLerp",n,0),s.typeOf.number.lessThanOrEquals("westLerp",n,1),s.typeOf.number.greaterThanOrEquals("southLerp",t,0),s.typeOf.number.lessThanOrEquals("southLerp",t,1),s.typeOf.number.greaterThanOrEquals("eastLerp",o,0),s.typeOf.number.lessThanOrEquals("eastLerp",o,1),s.typeOf.number.greaterThanOrEquals("northLerp",i,0),s.typeOf.number.lessThanOrEquals("northLerp",i,1),s.typeOf.number.lessThanOrEquals("westLerp",n,o),s.typeOf.number.lessThanOrEquals("southLerp",t,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+n*u,r.east=e.west+o*u}else{let u=E.TWO_PI+e.east-e.west;r.west=E.negativePiToPi(e.west+n*u),r.east=E.negativePiToPi(e.west+o*u)}let a=e.north-e.south;return r.south=e.south+t*a,r.north=e.south+i*a,n===1&&(r.west=e.east),o===1&&(r.east=e.east),t===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO));var mf=x;function D(e,n,t,o){this[0]=O(e,0),this[1]=O(t,0),this[2]=O(n,0),this[3]=O(o,0)}D.packedLength=4;D.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=O(t,0),n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n[t++]=e[3],n};D.unpack=function(e,n,t){return s.defined("array",e),n=O(n,0),p(t)||(t=new D),t[0]=e[n++],t[1]=e[n++],t[2]=e[n++],t[3]=e[n++],t};D.packArray=function(e,n){s.defined("array",e);let t=e.length,o=t*4;if(!p(n))n=new Array(o);else{if(!Array.isArray(n)&&n.length!==o)throw new j("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==o&&(n.length=o)}for(let i=0;i<t;++i)D.pack(e[i],n,i*4);return n};D.unpackArray=function(e,n){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new j("array length must be a multiple of 4.");let t=e.length;p(n)?n.length=t/4:n=new Array(t/4);for(let o=0;o<t;o+=4){let i=o/4;n[i]=D.unpack(e,o,n[i])}return n};D.clone=function(e,n){if(p(e))return p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n):new D(e[0],e[2],e[1],e[3])};D.fromArray=D.unpack;D.fromColumnMajorArray=function(e,n){return s.defined("values",e),D.clone(e,n)};D.fromRowMajorArray=function(e,n){return s.defined("values",e),p(n)?(n[0]=e[0],n[1]=e[2],n[2]=e[1],n[3]=e[3],n):new D(e[0],e[1],e[2],e[3])};D.fromScale=function(e,n){return s.typeOf.object("scale",e),p(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=e.y,n):new D(e.x,0,0,e.y)};D.fromUniformScale=function(e,n){return s.typeOf.number("scale",e),p(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=e,n):new D(e,0,0,e)};D.fromRotation=function(e,n){s.typeOf.number("angle",e);let t=Math.cos(e),o=Math.sin(e);return p(n)?(n[0]=t,n[1]=o,n[2]=-o,n[3]=t,n):new D(t,-o,o,t)};D.toArray=function(e,n){return s.typeOf.object("matrix",e),p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n):[e[0],e[1],e[2],e[3]]};D.getElementIndex=function(e,n){return s.typeOf.number.greaterThanOrEquals("row",n,0),s.typeOf.number.lessThanOrEquals("row",n,1),s.typeOf.number.greaterThanOrEquals("column",e,0),s.typeOf.number.lessThanOrEquals("column",e,1),e*2+n};D.getColumn=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("result",t);let o=n*2,i=e[o],r=e[o+1];return t.x=i,t.y=r,t};D.setColumn=function(e,n,t,o){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=D.clone(e,o);let i=n*2;return o[i]=t.x,o[i+1]=t.y,o};D.getRow=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("result",t);let o=e[n],i=e[n+2];return t.x=o,t.y=i,t};D.setRow=function(e,n,t,o){return s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=D.clone(e,o),o[n]=t.x,o[n+2]=t.y,o};var vi=new Oe;D.setScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t);let o=D.getScale(e,vi),i=n.x/o.x,r=n.y/o.y;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*r,t[3]=e[3]*r,t};var Ai=new Oe;D.setUniformScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t);let o=D.getScale(e,Ai),i=n/o.x,r=n/o.y;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*r,t[3]=e[3]*r,t};var Po=new Oe;D.getScale=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n.x=Oe.magnitude(Oe.fromElements(e[0],e[1],Po)),n.y=Oe.magnitude(Oe.fromElements(e[2],e[3],Po)),n};var Uo=new Oe;D.getMaximumScale=function(e){return D.getScale(e,Uo),Oe.maximumComponent(Uo)};var ji=new Oe;D.setRotation=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let o=D.getScale(e,ji);return t[0]=n[0]*o.x,t[1]=n[1]*o.x,t[2]=n[2]*o.y,t[3]=n[3]*o.y,t};var Mi=new Oe;D.getRotation=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=D.getScale(e,Mi);return n[0]=e[0]/t.x,n[1]=e[1]/t.x,n[2]=e[2]/t.y,n[3]=e[3]/t.y,n};D.multiply=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e[0]*n[0]+e[2]*n[1],i=e[0]*n[2]+e[2]*n[3],r=e[1]*n[0]+e[3]*n[1],a=e[1]*n[2]+e[3]*n[3];return t[0]=o,t[1]=r,t[2]=i,t[3]=a,t};D.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t};D.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t};D.multiplyByVector=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=e[0]*n.x+e[2]*n.y,i=e[1]*n.x+e[3]*n.y;return t.x=o,t.y=i,t};D.multiplyByScalar=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t};D.multiplyByScale=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t),t[0]=e[0]*n.x,t[1]=e[1]*n.x,t[2]=e[2]*n.y,t[3]=e[3]*n.y,t};D.multiplyByUniformScale=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t};D.negate=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n};D.transpose=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[0],o=e[2],i=e[1],r=e[3];return n[0]=t,n[1]=o,n[2]=i,n[3]=r,n};D.abs=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n};D.equals=function(e,n){return e===n||p(e)&&p(n)&&e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]&&e[3]===n[3]};D.equalsArray=function(e,n,t){return e[0]===n[t]&&e[1]===n[t+1]&&e[2]===n[t+2]&&e[3]===n[t+3]};D.equalsEpsilon=function(e,n,t){return t=O(t,0),e===n||p(e)&&p(n)&&Math.abs(e[0]-n[0])<=t&&Math.abs(e[1]-n[1])<=t&&Math.abs(e[2]-n[2])<=t&&Math.abs(e[3]-n[3])<=t};D.IDENTITY=Object.freeze(new D(1,0,0,1));D.ZERO=Object.freeze(new D(0,0,0,0));D.COLUMN0ROW0=0;D.COLUMN0ROW1=1;D.COLUMN1ROW0=2;D.COLUMN1ROW1=3;Object.defineProperties(D.prototype,{length:{get:function(){return D.packedLength}}});D.prototype.clone=function(e){return D.clone(this,e)};D.prototype.equals=function(e){return D.equals(this,e)};D.prototype.equalsEpsilon=function(e,n){return D.equalsEpsilon(this,e,n)};D.prototype.toString=function(){return`(${this[0]}, ${this[2]}) +(${this[1]}, ${this[3]})`};var _f=D;export{qe as a,G as b,De as c,ke as d,bo as e,Xe as f,Mo as g,mf as h,_f as i}; diff --git a/public/js/Cesium2/Workers/chunk-RNF7TLFF.js b/public/js/Cesium2/Workers/chunk-AKRPIQPN.js similarity index 91% rename from public/js/Cesium2/Workers/chunk-RNF7TLFF.js rename to public/js/Cesium2/Workers/chunk-AKRPIQPN.js index 30fcf0098..2a86ec4b5 100644 --- a/public/js/Cesium2/Workers/chunk-RNF7TLFF.js +++ b/public/js/Cesium2/Workers/chunk-AKRPIQPN.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as _}from"./chunk-E7HC3VTG.js";import{a as M}from"./chunk-RDAVO5OM.js";import{b as G}from"./chunk-PY4CW263.js";import{a as b}from"./chunk-RRZIPF5C.js";import{b as R}from"./chunk-M3A6SPGI.js";import{a,b as L,d as z}from"./chunk-S4VBGY2U.js";import{a as E}from"./chunk-UCTPWOTZ.js";import{a as C}from"./chunk-N3A5CZ2S.js";import{a as I}from"./chunk-G75U3WZT.js";import{e as T}from"./chunk-3THTQ4QB.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var V=new L;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,V).height}return e};var Y=new R,F=new a,v=new a,j=new b(a.UNIT_X,0),H=new a,J=new b(a.UNIT_X,0),K=new a,Q=new a,k=[];function q(r,n,o){let e=k;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var x=new L,N=new L,D=new a,B=new a,W=new a,O=new _,S=new M;function $(r,n,o,e,t,l,u,d){let i=e.scaleToGeodeticSurface(r,B),w=e.scaleToGeodeticSurface(n,W),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(i,x),y=e.cartesianToCartographic(w,N),g=q(h,t,l);O.setEndPoints(f,y);let P=O.surfaceDistance/h,c=d;f.height=t;let s=e.cartographicToCartesian(f,D);a.pack(s,u,c),c+=3;for(let m=1;m<h;m++){let A=O.interpolateUsingSurfaceDistance(m*P,N);A.height=g[m],s=e.cartographicToCartesian(A,D),a.pack(s,u,c),c+=3}return c}function tt(r,n,o,e,t,l,u,d){let i=e.cartesianToCartographic(r,x),w=e.cartesianToCartographic(n,N),h=p.numberOfPointsRhumbLine(i,w,o);i.height=0,w.height=0;let f=q(h,t,l);S.ellipsoid.equals(e)||(S=new M(void 0,void 0,e)),S.setEndPoints(i,w);let y=S.surfaceDistance/h,g=d;i.height=t;let P=e.cartographicToCartesian(i,D);a.pack(P,u,g),g+=3;for(let c=1;c<h;c++){let s=S.interpolateUsingSurfaceDistance(c*y,N);s.height=f[c],P=e.cartographicToCartesian(s,D),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=C(n,R.IDENTITY);let t=R.inverseTransformation(n,Y),l=R.multiplyByPoint(t,a.ZERO,F),u=a.normalize(R.multiplyByPointAsVector(t,a.UNIT_Y,v),v),d=b.fromPointNormal(l,u,j),i=a.normalize(R.multiplyByPointAsVector(t,a.UNIT_X,H),H),w=b.fromPointNormal(l,i,J),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(b.getPointDistance(w,f)<0||b.getPointDistance(w,P)<0){let c=G.lineSegmentPlane(f,P,d,K);if(T(c)){let s=a.multiplyByScalar(u,5e-9,Q);b.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(c,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(c,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new I("options.positions is required.");let o=n.length,e=C(r.ellipsoid,z.default),t=C(r.height,0),l=Array.isArray(t);if(o<1)return[];if(o===1){let c=e.scaleToGeodeticSurface(n[0],B);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(c,D);a.multiplyByScalar(s,t,s),a.add(c,s,c)}return[c.x,c.y,c.z]}let u=r.minDistance;if(!T(u)){let c=C(r.granularity,E.RADIANS_PER_DEGREE);u=E.chordLength(c,e.maximumRadius)}let d=0,i;for(i=0;i<o-1;i++)d+=p.numberOfPoints(n[i],n[i+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(i=0;i<o-1;i++){let c=n[i],s=n[i+1],m=l?t[i]:t,A=l?t[i+1]:t;f=$(c,s,u,e,m,A,h,f)}k.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,x);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,D);return a.pack(P,h,w-3),h};var U=new L,et=new L;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new I("options.positions is required.");let o=n.length,e=C(r.ellipsoid,z.default),t=C(r.height,0),l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],B);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,D);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=C(r.granularity,E.RADIANS_PER_DEGREE),d=0,i,w=e.cartesianToCartographic(n[0],U),h;for(i=0;i<o-1;i++)h=e.cartesianToCartographic(n[i+1],et),d+=p.numberOfPointsRhumbLine(w,h,u),w=L.clone(h,U);let f=(d+1)*3,y=new Array(f),g=0;for(i=0;i<o-1;i++){let m=n[i],A=n[i+1],X=l?t[i]:t,Z=l?t[i+1]:t;g=tt(m,A,u,e,X,Z,y,g)}k.length=0;let P=n[o-1],c=e.cartesianToCartographic(P,x);c.height=l?t[o-1]:t;let s=e.cartographicToCartesian(c,D);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var mt=p;export{mt as a}; +import{a as _}from"./chunk-NHNM56MI.js";import{a as M}from"./chunk-ZBEWS6NN.js";import{b as G}from"./chunk-V7XARCCV.js";import{a as b}from"./chunk-SACP225T.js";import{b as R}from"./chunk-7YEOLR2L.js";import{a,b as L,d as z}from"./chunk-RH3GFHG2.js";import{a as E}from"./chunk-FRWNWNYJ.js";import{a as C}from"./chunk-TA3RE4KQ.js";import{a as I}from"./chunk-RTY3VPG6.js";import{e as T}from"./chunk-LRNH5AEO.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var V=new L;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,V).height}return e};var Y=new R,F=new a,v=new a,j=new b(a.UNIT_X,0),H=new a,J=new b(a.UNIT_X,0),K=new a,Q=new a,k=[];function q(r,n,o){let e=k;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var x=new L,N=new L,D=new a,B=new a,W=new a,O=new _,S=new M;function $(r,n,o,e,t,l,u,d){let i=e.scaleToGeodeticSurface(r,B),w=e.scaleToGeodeticSurface(n,W),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(i,x),y=e.cartesianToCartographic(w,N),g=q(h,t,l);O.setEndPoints(f,y);let P=O.surfaceDistance/h,c=d;f.height=t;let s=e.cartographicToCartesian(f,D);a.pack(s,u,c),c+=3;for(let m=1;m<h;m++){let A=O.interpolateUsingSurfaceDistance(m*P,N);A.height=g[m],s=e.cartographicToCartesian(A,D),a.pack(s,u,c),c+=3}return c}function tt(r,n,o,e,t,l,u,d){let i=e.cartesianToCartographic(r,x),w=e.cartesianToCartographic(n,N),h=p.numberOfPointsRhumbLine(i,w,o);i.height=0,w.height=0;let f=q(h,t,l);S.ellipsoid.equals(e)||(S=new M(void 0,void 0,e)),S.setEndPoints(i,w);let y=S.surfaceDistance/h,g=d;i.height=t;let P=e.cartographicToCartesian(i,D);a.pack(P,u,g),g+=3;for(let c=1;c<h;c++){let s=S.interpolateUsingSurfaceDistance(c*y,N);s.height=f[c],P=e.cartographicToCartesian(s,D),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=C(n,R.IDENTITY);let t=R.inverseTransformation(n,Y),l=R.multiplyByPoint(t,a.ZERO,F),u=a.normalize(R.multiplyByPointAsVector(t,a.UNIT_Y,v),v),d=b.fromPointNormal(l,u,j),i=a.normalize(R.multiplyByPointAsVector(t,a.UNIT_X,H),H),w=b.fromPointNormal(l,i,J),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(b.getPointDistance(w,f)<0||b.getPointDistance(w,P)<0){let c=G.lineSegmentPlane(f,P,d,K);if(T(c)){let s=a.multiplyByScalar(u,5e-9,Q);b.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(c,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(c,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new I("options.positions is required.");let o=n.length,e=C(r.ellipsoid,z.default),t=C(r.height,0),l=Array.isArray(t);if(o<1)return[];if(o===1){let c=e.scaleToGeodeticSurface(n[0],B);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(c,D);a.multiplyByScalar(s,t,s),a.add(c,s,c)}return[c.x,c.y,c.z]}let u=r.minDistance;if(!T(u)){let c=C(r.granularity,E.RADIANS_PER_DEGREE);u=E.chordLength(c,e.maximumRadius)}let d=0,i;for(i=0;i<o-1;i++)d+=p.numberOfPoints(n[i],n[i+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(i=0;i<o-1;i++){let c=n[i],s=n[i+1],m=l?t[i]:t,A=l?t[i+1]:t;f=$(c,s,u,e,m,A,h,f)}k.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,x);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,D);return a.pack(P,h,w-3),h};var U=new L,et=new L;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new I("options.positions is required.");let o=n.length,e=C(r.ellipsoid,z.default),t=C(r.height,0),l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],B);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,D);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=C(r.granularity,E.RADIANS_PER_DEGREE),d=0,i,w=e.cartesianToCartographic(n[0],U),h;for(i=0;i<o-1;i++)h=e.cartesianToCartographic(n[i+1],et),d+=p.numberOfPointsRhumbLine(w,h,u),w=L.clone(h,U);let f=(d+1)*3,y=new Array(f),g=0;for(i=0;i<o-1;i++){let m=n[i],A=n[i+1],X=l?t[i]:t,Z=l?t[i+1]:t;g=tt(m,A,u,e,X,Z,y,g)}k.length=0;let P=n[o-1],c=e.cartesianToCartographic(P,x);c.height=l?t[o-1]:t;let s=e.cartographicToCartesian(c,D);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var mt=p;export{mt as a}; diff --git a/public/js/Cesium2/Workers/chunk-W7OWWJQT.js b/public/js/Cesium2/Workers/chunk-C37L3XAH.js similarity index 94% rename from public/js/Cesium2/Workers/chunk-W7OWWJQT.js rename to public/js/Cesium2/Workers/chunk-C37L3XAH.js index dec9fa6ea..829597a82 100644 --- a/public/js/Cesium2/Workers/chunk-W7OWWJQT.js +++ b/public/js/Cesium2/Workers/chunk-C37L3XAH.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as z,c as q}from"./chunk-G72WI3OZ.js";import{a as U}from"./chunk-RNF7TLFF.js";import{f as I}from"./chunk-M3A6SPGI.js";import{a as e,e as C}from"./chunk-S4VBGY2U.js";import{a as O}from"./chunk-UCTPWOTZ.js";import{e as j}from"./chunk-3THTQ4QB.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; +import{a as z,c as q}from"./chunk-VMIASSRO.js";import{a as U}from"./chunk-AKRPIQPN.js";import{f as I}from"./chunk-7YEOLR2L.js";import{a as e,e as C}from"./chunk-RH3GFHG2.js";import{a as O}from"./chunk-FRWNWNYJ.js";import{e as j}from"./chunk-LRNH5AEO.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/public/js/Cesium2/Workers/chunk-Q5IXWMLP.js b/public/js/Cesium2/Workers/chunk-C5GNG3FC.js similarity index 97% rename from public/js/Cesium2/Workers/chunk-Q5IXWMLP.js rename to public/js/Cesium2/Workers/chunk-C5GNG3FC.js index 787eec599..09973db86 100644 --- a/public/js/Cesium2/Workers/chunk-Q5IXWMLP.js +++ b/public/js/Cesium2/Workers/chunk-C5GNG3FC.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as E}from"./chunk-6HIVPZ7K.js";import{a as Q}from"./chunk-RRZIPF5C.js";import{a as ae}from"./chunk-24JYWT5N.js";import{b as oe,c as re,d as J}from"./chunk-LH3SUUXG.js";import{b as A,d as ie}from"./chunk-K2M3OJ7Z.js";import{a as b,b as F,f as N}from"./chunk-M3A6SPGI.js";import{a as H}from"./chunk-D5HNP2LB.js";import{a as r,e as G}from"./chunk-S4VBGY2U.js";import{a as P}from"./chunk-UCTPWOTZ.js";import{a as m}from"./chunk-N3A5CZ2S.js";import{a as w,b as O}from"./chunk-G75U3WZT.js";import{e as a}from"./chunk-3THTQ4QB.js";function T(e){this.planes=m(e,[])}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var V=new r,_e=new r,fe=new Q(new r(1,0,0),0);T.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new T);let n=X.length,f=t.planes;f.length=2*n;let p=e.center,d=e.radius,s=0;for(let y=0;y<n;++y){let i=X[y],c=f[s],_=f[s+1];a(c)||(c=f[s]=new b),a(_)||(_=f[s+1]=new b),r.multiplyByScalar(i,-d,V),r.add(p,V,V),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,V),r.multiplyByScalar(i,d,V),r.add(p,V,V),_.x=-i.x,_.y=-i.y,_.z=-i.z,_.w=-r.dot(r.negate(i,_e),V),s+=2}return t};T.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,p=t.length;f<p;++f){let d=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(d===A.OUTSIDE)return A.OUTSIDE;d===A.INTERSECTING&&(n=!0)}return n?A.INTERSECTING:A.INSIDE};T.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===T.MASK_OUTSIDE||t===T.MASK_INSIDE)return t;let n=T.MASK_INSIDE,f=this.planes;for(let p=0,d=f.length;p<d;++p){let s=p<31?1<<p:0;if(p<31&&!(t&s))continue;let y=e.intersectPlane(Q.fromCartesian4(f[p],fe));if(y===A.OUTSIDE)return T.MASK_OUTSIDE;y===A.INTERSECTING&&(n|=s)}return n};T.MASK_OUTSIDE=4294967295;T.MASK_INSIDE=0;T.MASK_INDETERMINATE=2147483647;var $=T;function k(e){e=m(e,m.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far,this._cullingVolume=new $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,p=this.top,d=this.bottom,s=this.right,y=this.left,i=this.near,c=this.far,_=r.cross(t,n,me);r.normalize(_,_);let g=ye;r.multiplyByScalar(t,i,g),r.add(e,g,g);let l=ge;r.multiplyByScalar(_,y,l),r.add(g,l,l);let o=f[0];return a(o)||(o=f[0]=new b),o.x=_.x,o.y=_.y,o.z=_.z,o.w=-r.dot(_,l),r.multiplyByScalar(_,s,l),r.add(g,l,l),o=f[1],a(o)||(o=f[1]=new b),o.x=-_.x,o.y=-_.y,o.z=-_.z,o.w=-r.dot(r.negate(_,ee),l),r.multiplyByScalar(n,d,l),r.add(g,l,l),o=f[2],a(o)||(o=f[2]=new b),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,p,l),r.add(g,l,l),o=f[3],a(o)||(o=f[3]=new b),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new b),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,g),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new b),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,p){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(p))throw new w("A result object is required.");let d=this.right-this.left,s=this.top-this.bottom,y=f*d/e,i=f*s/t;return p.x=y,p.y=i,p};k.prototype.clone=function(e){return a(e)||(e=new k),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var he=k;function z(e){e=m(e,m.EMPTY_OBJECT),this._offCenterFrustum=new he,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far}z.packedLength=4;z.pack=function(e,t,n){return O.typeOf.object("value",e),O.defined("array",t),n=m(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};z.unpack=function(e,t,n){return O.defined("array",e),t=m(t,0),a(n)||(n=new z),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function j(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(z.prototype,{projectionMatrix:{get:function(){return j(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return j(this),this._offCenterFrustum}}});z.prototype.computeCullingVolume=function(e,t,n){return j(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};z.prototype.getPixelDimensions=function(e,t,n,f,p){return j(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,p)};z.prototype.clone=function(e){return a(e)||(e=new z),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};z.prototype.equals=function(e){return!a(e)||!(e instanceof z)?!1:(j(this),j(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};z.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof z)?!1:(j(this),j(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var B=z;function S(e){e=m(e,m.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far,this._cullingVolume=new $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:p,near:d,far:s}=e;if(t!==e._top||n!==e._bottom||p!==e._left||f!==e._right||d!==e._near||s!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=p,e._right=f,e._top=t,e._bottom=n,e._near=d,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(p,f,n,t,d,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(p,f,n,t,d,e._infinitePerspective)}}Object.defineProperties(S.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Pe=new r;S.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,p=this.top,d=this.bottom,s=this.right,y=this.left,i=this.near,c=this.far,_=r.cross(t,n,Ce),g=be;r.multiplyByScalar(t,i,g),r.add(e,g,g);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Pe;r.multiplyByScalar(_,y,o),r.add(g,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new b),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(_,s,o),r.add(g,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new b),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,d,o),r.add(g,o,o),r.subtract(o,e,o),r.cross(_,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new b),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,p,o),r.add(g,o,o),r.subtract(o,e,o),r.cross(o,_,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new b),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new b),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,g),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new b),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};S.prototype.getPixelDimensions=function(e,t,n,f,p){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(p))throw new w("A result object is required.");let d=1/this.near,s=this.top*d,y=2*f*n*s/t;s=this.right*d;let i=2*f*n*s/e;return p.x=i,p.y=y,p};S.prototype.clone=function(e){return a(e)||(e=new S),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};S.prototype.equals=function(e){return a(e)&&e instanceof S&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};S.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof S&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var pe=S;function R(e){e=m(e,m.EMPTY_OBJECT),this._offCenterFrustum=new pe,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far,this.xOffset=m(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=m(e.yOffset,0),this._yOffset=this.yOffset}R.packedLength=6;R.pack=function(e,t,n){return O.typeOf.object("value",e),O.defined("array",t),n=m(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};R.unpack=function(e,t,n){return O.defined("array",e),t=m(t,0),a(n)||(n=new R),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function q(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(O.typeOf.number.greaterThanOrEquals("fov",e.fov,0),O.typeOf.number.lessThan("fov",e.fov,Math.PI),O.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),O.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(R.prototype,{projectionMatrix:{get:function(){return q(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return q(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return q(this),this._fovy}},sseDenominator:{get:function(){return q(this),this._sseDenominator}},offCenterFrustum:{get:function(){return q(this),this._offCenterFrustum}}});R.prototype.computeCullingVolume=function(e,t,n){return q(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};R.prototype.getPixelDimensions=function(e,t,n,f,p){return q(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,p)};R.prototype.clone=function(e){return a(e)||(e=new R),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};R.prototype.equals=function(e){return!a(e)||!(e instanceof R)?!1:(q(this),q(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};R.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof R)?!1:(q(this),q(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=R;var I=0,Fe=1;function U(e){O.typeOf.object("options",e),O.typeOf.object("options.frustum",e.frustum),O.typeOf.object("options.origin",e.origin),O.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,p=m(e.vertexFormat,E.DEFAULT),d=m(e._drawNearPlane,!0),s,y;t instanceof L?(s=I,y=L.packedLength):t instanceof B&&(s=Fe,y=B.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=N.clone(n),this._drawNearPlane=d,this._vertexFormat=p,this._workerName="createFrustumGeometry",this.packedLength=2+y+r.packedLength+N.packedLength+E.packedLength}U.pack=function(e,t,n){O.typeOf.object("value",e),O.defined("array",t),n=m(n,0);let f=e._frustumType,p=e._frustum;return t[n++]=f,f===I?(L.pack(p,t,n),n+=L.packedLength):(B.pack(p,t,n),n+=B.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,N.pack(e._orientation,t,n),n+=N.packedLength,E.pack(e._vertexFormat,t,n),n+=E.packedLength,t[n]=e._drawNearPlane?1:0,t};var xe=new L,ve=new B,ze=new N,Re=new r,Te=new E;U.unpack=function(e,t,n){O.defined("array",e),t=m(t,0);let f=e[t++],p;f===I?(p=L.unpack(e,t,xe),t+=L.packedLength):(p=B.unpack(e,t,ve),t+=B.packedLength);let d=r.unpack(e,t,Re);t+=r.packedLength;let s=N.unpack(e,t,ze);t+=N.packedLength;let y=E.unpack(e,t,Te);t+=E.packedLength;let i=e[t]===1;if(!a(n))return new U({frustum:p,origin:d,orientation:s,vertexFormat:y,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=p.clone(c),n._frustumType=f,n._origin=r.clone(d,n._origin),n._orientation=N.clone(s,n._orientation),n._vertexFormat=E.clone(y,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,p,d,s,y){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=d.x,t[e+1]=d.y,t[e+2]=d.z),a(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),a(f)&&(f[e]=y.x,f[e+1]=y.y,f[e+2]=y.z),e+=3;p[i]=0,p[i+1]=0,p[i+2]=1,p[i+3]=0,p[i+4]=1,p[i+5]=1,p[i+6]=0,p[i+7]=1}var qe=new G,Me=new F,ne=new F,se=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,u=new Array(3),Z=new Array(4);Z[0]=new b(-1,-1,1,1);Z[1]=new b(1,-1,1,1);Z[2]=new b(1,1,1,1);Z[3]=new b(-1,1,1,1);var de=new Array(4);for(let e=0;e<4;++e)de[e]=new b;U._computeNearFarPlanes=function(e,t,n,f,p,d,s,y){let i=G.fromQuaternion(t,qe),c=m(d,se),_=m(s,le),g=m(y,we);c=G.getColumn(i,0,c),_=G.getColumn(i,1,_),g=G.getColumn(i,2,g),r.normalize(c,c),r.normalize(_,_),r.normalize(g,g),r.negate(c,c);let l=F.computeView(e,g,_,c,Me),o,h,M=f.projectionMatrix;if(n===I){let x=F.multiply(M,l,ne);h=F.inverse(x,ne)}else o=F.inverseTransformation(l,ne);a(h)?(u[0]=f.near,u[1]=f.far):(u[0]=0,u[1]=f.near,u[2]=f.far);for(let x=0;x<2;++x)for(let v=0;v<4;++v){let C=b.clone(Z[v],de[v]);if(a(h)){C=F.multiplyByVector(h,C,C);let D=1/C.w;r.multiplyByScalar(C,D,C),r.subtract(C,e,C),r.normalize(C,C);let Y=r.dot(g,C);r.multiplyByScalar(C,u[x]/Y,C),r.add(C,e,C)}else{let D=f.offCenterFrustum;a(D)&&(f=D);let Y=u[x],K=u[x+1];C.x=(C.x*(f.right-f.left)+f.left+f.right)*.5,C.y=(C.y*(f.top-f.bottom)+f.bottom+f.top)*.5,C.z=(C.z*(Y-K)-Y-K)*.5,C.w=1,F.multiplyByVector(o,C,C)}p[12*x+v*3]=C.x,p[12*x+v*3+1]=C.y,p[12*x+v*3+2]=C.z}};U.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,p=e._orientation,d=e._drawNearPlane,s=e._vertexFormat,y=d?6:5,i=new Float64Array(3*4*6);U._computeNearFarPlanes(f,p,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],d||(i=i.subarray(3*4));let _=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(s.normal)||a(s.tangent)||a(s.bitangent)||a(s.st)){let l=a(s.normal)?new Float32Array(12*y):void 0,o=a(s.tangent)?new Float32Array(3*4*y):void 0,h=a(s.bitangent)?new Float32Array(3*4*y):void 0,M=a(s.st)?new Float32Array(2*4*y):void 0,x=se,v=le,C=we,D=r.negate(x,ke),Y=r.negate(v,Se),K=r.negate(C,De);c=0,d&&(W(c,l,o,h,M,K,x,v),c+=3*4),W(c,l,o,h,M,C,D,v),c+=3*4,W(c,l,o,h,M,D,K,v),c+=3*4,W(c,l,o,h,M,Y,K,D),c+=3*4,W(c,l,o,h,M,x,C,v),c+=3*4,W(c,l,o,h,M,v,C,D),a(l)&&(_.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(_.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(_.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(M)&&(_.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:M}))}let g=new Uint16Array(6*y);for(let l=0;l<y;++l){let o=l*6,h=l*4;g[o]=h,g[o+1]=h+1,g[o+2]=h+2,g[o+3]=h,g[o+4]=h+2,g[o+5]=h+3}return new re({attributes:_,indices:g,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Vt=U;export{B as a,L as b,Vt as c}; +import{a as E}from"./chunk-6VK5R74O.js";import{a as Q}from"./chunk-SACP225T.js";import{a as ae}from"./chunk-NT26NNVH.js";import{b as oe,c as re,d as J}from"./chunk-NW2YE576.js";import{b as A,d as ie}from"./chunk-2NIQ5ECB.js";import{a as b,b as F,f as N}from"./chunk-7YEOLR2L.js";import{a as H}from"./chunk-QHHYYTCM.js";import{a as r,e as G}from"./chunk-RH3GFHG2.js";import{a as P}from"./chunk-FRWNWNYJ.js";import{a as m}from"./chunk-TA3RE4KQ.js";import{a as w,b as O}from"./chunk-RTY3VPG6.js";import{e as a}from"./chunk-LRNH5AEO.js";function T(e){this.planes=m(e,[])}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var V=new r,_e=new r,fe=new Q(new r(1,0,0),0);T.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new T);let n=X.length,f=t.planes;f.length=2*n;let p=e.center,d=e.radius,s=0;for(let y=0;y<n;++y){let i=X[y],c=f[s],_=f[s+1];a(c)||(c=f[s]=new b),a(_)||(_=f[s+1]=new b),r.multiplyByScalar(i,-d,V),r.add(p,V,V),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,V),r.multiplyByScalar(i,d,V),r.add(p,V,V),_.x=-i.x,_.y=-i.y,_.z=-i.z,_.w=-r.dot(r.negate(i,_e),V),s+=2}return t};T.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,p=t.length;f<p;++f){let d=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(d===A.OUTSIDE)return A.OUTSIDE;d===A.INTERSECTING&&(n=!0)}return n?A.INTERSECTING:A.INSIDE};T.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===T.MASK_OUTSIDE||t===T.MASK_INSIDE)return t;let n=T.MASK_INSIDE,f=this.planes;for(let p=0,d=f.length;p<d;++p){let s=p<31?1<<p:0;if(p<31&&!(t&s))continue;let y=e.intersectPlane(Q.fromCartesian4(f[p],fe));if(y===A.OUTSIDE)return T.MASK_OUTSIDE;y===A.INTERSECTING&&(n|=s)}return n};T.MASK_OUTSIDE=4294967295;T.MASK_INSIDE=0;T.MASK_INDETERMINATE=2147483647;var $=T;function k(e){e=m(e,m.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far,this._cullingVolume=new $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,p=this.top,d=this.bottom,s=this.right,y=this.left,i=this.near,c=this.far,_=r.cross(t,n,me);r.normalize(_,_);let g=ye;r.multiplyByScalar(t,i,g),r.add(e,g,g);let l=ge;r.multiplyByScalar(_,y,l),r.add(g,l,l);let o=f[0];return a(o)||(o=f[0]=new b),o.x=_.x,o.y=_.y,o.z=_.z,o.w=-r.dot(_,l),r.multiplyByScalar(_,s,l),r.add(g,l,l),o=f[1],a(o)||(o=f[1]=new b),o.x=-_.x,o.y=-_.y,o.z=-_.z,o.w=-r.dot(r.negate(_,ee),l),r.multiplyByScalar(n,d,l),r.add(g,l,l),o=f[2],a(o)||(o=f[2]=new b),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,p,l),r.add(g,l,l),o=f[3],a(o)||(o=f[3]=new b),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new b),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,g),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new b),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,p){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(p))throw new w("A result object is required.");let d=this.right-this.left,s=this.top-this.bottom,y=f*d/e,i=f*s/t;return p.x=y,p.y=i,p};k.prototype.clone=function(e){return a(e)||(e=new k),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var he=k;function z(e){e=m(e,m.EMPTY_OBJECT),this._offCenterFrustum=new he,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far}z.packedLength=4;z.pack=function(e,t,n){return O.typeOf.object("value",e),O.defined("array",t),n=m(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};z.unpack=function(e,t,n){return O.defined("array",e),t=m(t,0),a(n)||(n=new z),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function j(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(z.prototype,{projectionMatrix:{get:function(){return j(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return j(this),this._offCenterFrustum}}});z.prototype.computeCullingVolume=function(e,t,n){return j(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};z.prototype.getPixelDimensions=function(e,t,n,f,p){return j(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,p)};z.prototype.clone=function(e){return a(e)||(e=new z),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};z.prototype.equals=function(e){return!a(e)||!(e instanceof z)?!1:(j(this),j(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};z.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof z)?!1:(j(this),j(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var B=z;function S(e){e=m(e,m.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far,this._cullingVolume=new $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:p,near:d,far:s}=e;if(t!==e._top||n!==e._bottom||p!==e._left||f!==e._right||d!==e._near||s!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=p,e._right=f,e._top=t,e._bottom=n,e._near=d,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(p,f,n,t,d,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(p,f,n,t,d,e._infinitePerspective)}}Object.defineProperties(S.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Pe=new r;S.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,p=this.top,d=this.bottom,s=this.right,y=this.left,i=this.near,c=this.far,_=r.cross(t,n,Ce),g=be;r.multiplyByScalar(t,i,g),r.add(e,g,g);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Pe;r.multiplyByScalar(_,y,o),r.add(g,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new b),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(_,s,o),r.add(g,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new b),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,d,o),r.add(g,o,o),r.subtract(o,e,o),r.cross(_,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new b),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,p,o),r.add(g,o,o),r.subtract(o,e,o),r.cross(o,_,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new b),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new b),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,g),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new b),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};S.prototype.getPixelDimensions=function(e,t,n,f,p){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(p))throw new w("A result object is required.");let d=1/this.near,s=this.top*d,y=2*f*n*s/t;s=this.right*d;let i=2*f*n*s/e;return p.x=i,p.y=y,p};S.prototype.clone=function(e){return a(e)||(e=new S),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};S.prototype.equals=function(e){return a(e)&&e instanceof S&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};S.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof S&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var pe=S;function R(e){e=m(e,m.EMPTY_OBJECT),this._offCenterFrustum=new pe,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=m(e.near,1),this._near=this.near,this.far=m(e.far,5e8),this._far=this.far,this.xOffset=m(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=m(e.yOffset,0),this._yOffset=this.yOffset}R.packedLength=6;R.pack=function(e,t,n){return O.typeOf.object("value",e),O.defined("array",t),n=m(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};R.unpack=function(e,t,n){return O.defined("array",e),t=m(t,0),a(n)||(n=new R),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function q(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(O.typeOf.number.greaterThanOrEquals("fov",e.fov,0),O.typeOf.number.lessThan("fov",e.fov,Math.PI),O.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),O.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(R.prototype,{projectionMatrix:{get:function(){return q(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return q(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return q(this),this._fovy}},sseDenominator:{get:function(){return q(this),this._sseDenominator}},offCenterFrustum:{get:function(){return q(this),this._offCenterFrustum}}});R.prototype.computeCullingVolume=function(e,t,n){return q(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};R.prototype.getPixelDimensions=function(e,t,n,f,p){return q(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,p)};R.prototype.clone=function(e){return a(e)||(e=new R),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};R.prototype.equals=function(e){return!a(e)||!(e instanceof R)?!1:(q(this),q(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};R.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof R)?!1:(q(this),q(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=R;var I=0,Fe=1;function U(e){O.typeOf.object("options",e),O.typeOf.object("options.frustum",e.frustum),O.typeOf.object("options.origin",e.origin),O.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,p=m(e.vertexFormat,E.DEFAULT),d=m(e._drawNearPlane,!0),s,y;t instanceof L?(s=I,y=L.packedLength):t instanceof B&&(s=Fe,y=B.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=N.clone(n),this._drawNearPlane=d,this._vertexFormat=p,this._workerName="createFrustumGeometry",this.packedLength=2+y+r.packedLength+N.packedLength+E.packedLength}U.pack=function(e,t,n){O.typeOf.object("value",e),O.defined("array",t),n=m(n,0);let f=e._frustumType,p=e._frustum;return t[n++]=f,f===I?(L.pack(p,t,n),n+=L.packedLength):(B.pack(p,t,n),n+=B.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,N.pack(e._orientation,t,n),n+=N.packedLength,E.pack(e._vertexFormat,t,n),n+=E.packedLength,t[n]=e._drawNearPlane?1:0,t};var xe=new L,ve=new B,ze=new N,Re=new r,Te=new E;U.unpack=function(e,t,n){O.defined("array",e),t=m(t,0);let f=e[t++],p;f===I?(p=L.unpack(e,t,xe),t+=L.packedLength):(p=B.unpack(e,t,ve),t+=B.packedLength);let d=r.unpack(e,t,Re);t+=r.packedLength;let s=N.unpack(e,t,ze);t+=N.packedLength;let y=E.unpack(e,t,Te);t+=E.packedLength;let i=e[t]===1;if(!a(n))return new U({frustum:p,origin:d,orientation:s,vertexFormat:y,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=p.clone(c),n._frustumType=f,n._origin=r.clone(d,n._origin),n._orientation=N.clone(s,n._orientation),n._vertexFormat=E.clone(y,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,p,d,s,y){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=d.x,t[e+1]=d.y,t[e+2]=d.z),a(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),a(f)&&(f[e]=y.x,f[e+1]=y.y,f[e+2]=y.z),e+=3;p[i]=0,p[i+1]=0,p[i+2]=1,p[i+3]=0,p[i+4]=1,p[i+5]=1,p[i+6]=0,p[i+7]=1}var qe=new G,Me=new F,ne=new F,se=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,u=new Array(3),Z=new Array(4);Z[0]=new b(-1,-1,1,1);Z[1]=new b(1,-1,1,1);Z[2]=new b(1,1,1,1);Z[3]=new b(-1,1,1,1);var de=new Array(4);for(let e=0;e<4;++e)de[e]=new b;U._computeNearFarPlanes=function(e,t,n,f,p,d,s,y){let i=G.fromQuaternion(t,qe),c=m(d,se),_=m(s,le),g=m(y,we);c=G.getColumn(i,0,c),_=G.getColumn(i,1,_),g=G.getColumn(i,2,g),r.normalize(c,c),r.normalize(_,_),r.normalize(g,g),r.negate(c,c);let l=F.computeView(e,g,_,c,Me),o,h,M=f.projectionMatrix;if(n===I){let x=F.multiply(M,l,ne);h=F.inverse(x,ne)}else o=F.inverseTransformation(l,ne);a(h)?(u[0]=f.near,u[1]=f.far):(u[0]=0,u[1]=f.near,u[2]=f.far);for(let x=0;x<2;++x)for(let v=0;v<4;++v){let C=b.clone(Z[v],de[v]);if(a(h)){C=F.multiplyByVector(h,C,C);let D=1/C.w;r.multiplyByScalar(C,D,C),r.subtract(C,e,C),r.normalize(C,C);let Y=r.dot(g,C);r.multiplyByScalar(C,u[x]/Y,C),r.add(C,e,C)}else{let D=f.offCenterFrustum;a(D)&&(f=D);let Y=u[x],K=u[x+1];C.x=(C.x*(f.right-f.left)+f.left+f.right)*.5,C.y=(C.y*(f.top-f.bottom)+f.bottom+f.top)*.5,C.z=(C.z*(Y-K)-Y-K)*.5,C.w=1,F.multiplyByVector(o,C,C)}p[12*x+v*3]=C.x,p[12*x+v*3+1]=C.y,p[12*x+v*3+2]=C.z}};U.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,p=e._orientation,d=e._drawNearPlane,s=e._vertexFormat,y=d?6:5,i=new Float64Array(3*4*6);U._computeNearFarPlanes(f,p,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],d||(i=i.subarray(3*4));let _=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(s.normal)||a(s.tangent)||a(s.bitangent)||a(s.st)){let l=a(s.normal)?new Float32Array(12*y):void 0,o=a(s.tangent)?new Float32Array(3*4*y):void 0,h=a(s.bitangent)?new Float32Array(3*4*y):void 0,M=a(s.st)?new Float32Array(2*4*y):void 0,x=se,v=le,C=we,D=r.negate(x,ke),Y=r.negate(v,Se),K=r.negate(C,De);c=0,d&&(W(c,l,o,h,M,K,x,v),c+=3*4),W(c,l,o,h,M,C,D,v),c+=3*4,W(c,l,o,h,M,D,K,v),c+=3*4,W(c,l,o,h,M,Y,K,D),c+=3*4,W(c,l,o,h,M,x,C,v),c+=3*4,W(c,l,o,h,M,v,C,D),a(l)&&(_.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(_.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(_.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(M)&&(_.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:M}))}let g=new Uint16Array(6*y);for(let l=0;l<y;++l){let o=l*6,h=l*4;g[o]=h,g[o+1]=h+1,g[o+2]=h+2,g[o+3]=h,g[o+4]=h+2,g[o+5]=h+3}return new re({attributes:_,indices:g,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Vt=U;export{B as a,L as b,Vt as c}; diff --git a/public/js/Cesium2/Workers/chunk-SOCYD7RP.js b/public/js/Cesium2/Workers/chunk-DGVML3P5.js similarity index 95% rename from public/js/Cesium2/Workers/chunk-SOCYD7RP.js rename to public/js/Cesium2/Workers/chunk-DGVML3P5.js index e7daeeef3..d7e1b2481 100644 --- a/public/js/Cesium2/Workers/chunk-SOCYD7RP.js +++ b/public/js/Cesium2/Workers/chunk-DGVML3P5.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as K}from"./chunk-CTRWX4F5.js";import{a as L}from"./chunk-RRZIPF5C.js";import{b as v,c as J,d as Z}from"./chunk-K2M3OJ7Z.js";import{b as B,h as k}from"./chunk-M3A6SPGI.js";import{a as t,b as S,c as I,d as G,e as d}from"./chunk-S4VBGY2U.js";import{a as g}from"./chunk-UCTPWOTZ.js";import{a as W}from"./chunk-N3A5CZ2S.js";import{a as b,b as z}from"./chunk-G75U3WZT.js";import{e as p}from"./chunk-3THTQ4QB.js";function m(n,e){this.center=t.clone(W(n,t.ZERO)),this.halfAxes=d.clone(W(e,d.ZERO))}m.packedLength=t.packedLength+d.packedLength;m.pack=function(n,e,c){return z.typeOf.object("value",n),z.defined("array",e),c=W(c,0),t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};m.unpack=function(n,e,c){return z.defined("array",n),e=W(e,0),p(c)||(c=new m),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new t,Nt=new d,Mt={unitary:new d,diagonal:new d};m.fromPoints=function(n,e){if(p(e)||(e=new m),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],Ct);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,w=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,ut),i+=s.x*s.x,C+=s.x*s.y,w+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,w*=o,l*=o,u*=o,a*=o;let f=Nt;f[0]=i,f[1]=C,f[2]=w,f[3]=C,f[4]=l,f[5]=u,f[6]=w,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Mt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,xt),y=d.getColumn(M,1,yt),N=d.getColumn(M,2,At),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,U=-Number.MAX_VALUE,q=Number.MAX_VALUE,R=Number.MAX_VALUE,j=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),U=Math.max(t.dot(N,s),U),q=Math.min(t.dot(x,s),q),R=Math.min(t.dot(y,s),R),j=Math.min(t.dot(N,s),j);x=t.multiplyByScalar(x,.5*(q+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(j+U),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=Pt;return E.x=P-q,E.y=O-R,E.z=U-j,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var nt=new t,Ot=new t;function Q(n,e,c,h,r,o,i,C,w,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(w)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new m);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=nt;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(w+l)/2;let f=Ot;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-w)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var $=new S,bt=new t,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new S,Wt=new t,H=new t,zt=new t,tt=new t,It=new t,Lt=new I,Ut=new I,qt=new I,jt=new I,Bt=new I,vt=new t,Vt=new t,_t=new t,Dt=new t,Xt=new I,kt=new t,Zt=new t,Yt=new t,Ft=new L(t.UNIT_X,0);m.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=W(e,0),c=W(c,0),h=W(h,G.default);let o,i,C,w,l,u,a;if(n.width<=g.PI){let R=k.center(n,$),j=h.cartographicToCartesian(R,bt),T=new K(j,h);a=T.plane;let E=R.longitude,ot=n.south<0&&n.north>0?0:R.latitude,st=S.fromRadians(E,n.north,c,Tt),V=S.fromRadians(n.west,n.north,c,St),it=S.fromRadians(n.west,ot,c,gt),_=S.fromRadians(n.west,n.south,c,Et),ht=S.fromRadians(E,n.south,c,Rt),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(V,H),dt=h.cartographicToCartesian(it,zt),X=h.cartographicToCartesian(_,tt),mt=h.cartographicToCartesian(ht,It),wt=T.projectPointToNearestOnPlane(ft,Lt),Y=T.projectPointToNearestOnPlane(D,Ut),lt=T.projectPointToNearestOnPlane(dt,qt),F=T.projectPointToNearestOnPlane(X,jt),pt=T.projectPointToNearestOnPlane(mt,Bt);return o=Math.min(Y.x,lt.x,F.x),i=-o,w=Math.max(Y.y,wt.y),C=Math.min(F.y,pt.y),V.height=_.height=e,D=h.cartographicToCartesian(V,H),X=h.cartographicToCartesian(_,tt),l=Math.min(L.getPointDistance(a,D),L.getPointDistance(a,X)),u=c,Q(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,w,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=k.center(n,$).longitude,x=t.fromRadians(M,A,c,h,vt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,Vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=L.fromPointNormal(x,N,Ft);let U=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Dt);i=t.dot(L.projectPointOntoPlane(a,U,Xt),O),o=-i,w=t.fromRadians(0,n.north,f?e:c,h,kt).z,C=t.fromRadians(0,n.south,s?e:c,h,Zt).z;let q=t.fromRadians(n.east,A,c,h,Yt);return l=L.getPointDistance(a,q),u=0,Q(x,O,P,N,o,i,C,w,l,u,r)};m.fromTransformation=function(n,e){return z.typeOf.object("transformation",n),p(e)||(e=new m),e.center=B.getTranslation(n,e.center),e.halfAxes=B.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};m.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new m(n.center,n.halfAxes)};m.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,w=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-w?v.OUTSIDE:l>=w?v.INSIDE:v.INTERSECTING};var at=new t,ct=new t,rt=new t,Gt=new t,et=new t,Jt=new t;m.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,nt),h=n.halfAxes,r=d.getColumn(h,0,at),o=d.getColumn(h,1,ct),i=d.getColumn(h,2,rt),C=t.magnitude(r),w=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,w>0?t.divideByScalar(o,w,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,et),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Gt),t.normalize(M,M),x=t.cross(A,M,et),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Jt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-w?(P=y.y+w,N+=P*P):y.y>w&&(P=y.y-w,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Kt=new t,Qt=new t;m.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new J);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,w=d.getColumn(C,0,at),l=d.getColumn(C,1,ct),u=d.getColumn(C,2,rt),a=t.add(w,l,Kt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Qt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,w,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,w,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,w,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,w,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,w,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,w,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,w,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var $t=new t,Ht=new t,te=new t;m.computeCorners=function(n,e){z.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,$t),o=d.getColumn(h,1,Ht),i=d.getColumn(h,2,te);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var ee=new d;m.computeTransformation=function(n,e){z.typeOf.object("box",n),p(e)||(e=new B);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,ee);return B.fromRotationTranslation(h,c,e)};var ne=new Z;m.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=Z.fromOrientedBoundingBox(n,ne);return!e.isBoundingSphereVisible(c)};m.prototype.intersectPlane=function(n){return m.intersectPlane(this,n)};m.prototype.distanceSquaredTo=function(n){return m.distanceSquaredTo(this,n)};m.prototype.computePlaneDistances=function(n,e,c){return m.computePlaneDistances(this,n,e,c)};m.prototype.computeCorners=function(n){return m.computeCorners(this,n)};m.prototype.computeTransformation=function(n){return m.computeTransformation(this,n)};m.prototype.isOccluded=function(n){return m.isOccluded(this,n)};m.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};m.prototype.clone=function(n){return m.clone(this,n)};m.prototype.equals=function(n){return m.equals(this,n)};var ye=m;export{ye as a}; +import{a as K}from"./chunk-P73YILG6.js";import{a as L}from"./chunk-SACP225T.js";import{b as v,c as J,d as Z}from"./chunk-2NIQ5ECB.js";import{b as B,h as k}from"./chunk-7YEOLR2L.js";import{a as t,b as S,c as I,d as G,e as d}from"./chunk-RH3GFHG2.js";import{a as g}from"./chunk-FRWNWNYJ.js";import{a as W}from"./chunk-TA3RE4KQ.js";import{a as b,b as z}from"./chunk-RTY3VPG6.js";import{e as p}from"./chunk-LRNH5AEO.js";function m(n,e){this.center=t.clone(W(n,t.ZERO)),this.halfAxes=d.clone(W(e,d.ZERO))}m.packedLength=t.packedLength+d.packedLength;m.pack=function(n,e,c){return z.typeOf.object("value",n),z.defined("array",e),c=W(c,0),t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};m.unpack=function(n,e,c){return z.defined("array",n),e=W(e,0),p(c)||(c=new m),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new t,Nt=new d,Mt={unitary:new d,diagonal:new d};m.fromPoints=function(n,e){if(p(e)||(e=new m),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],Ct);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,w=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,ut),i+=s.x*s.x,C+=s.x*s.y,w+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,w*=o,l*=o,u*=o,a*=o;let f=Nt;f[0]=i,f[1]=C,f[2]=w,f[3]=C,f[4]=l,f[5]=u,f[6]=w,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Mt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,xt),y=d.getColumn(M,1,yt),N=d.getColumn(M,2,At),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,U=-Number.MAX_VALUE,q=Number.MAX_VALUE,R=Number.MAX_VALUE,j=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),U=Math.max(t.dot(N,s),U),q=Math.min(t.dot(x,s),q),R=Math.min(t.dot(y,s),R),j=Math.min(t.dot(N,s),j);x=t.multiplyByScalar(x,.5*(q+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(j+U),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=Pt;return E.x=P-q,E.y=O-R,E.z=U-j,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var nt=new t,Ot=new t;function Q(n,e,c,h,r,o,i,C,w,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(w)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new m);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=nt;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(w+l)/2;let f=Ot;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-w)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var $=new S,bt=new t,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new S,Wt=new t,H=new t,zt=new t,tt=new t,It=new t,Lt=new I,Ut=new I,qt=new I,jt=new I,Bt=new I,vt=new t,Vt=new t,_t=new t,Dt=new t,Xt=new I,kt=new t,Zt=new t,Yt=new t,Ft=new L(t.UNIT_X,0);m.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=W(e,0),c=W(c,0),h=W(h,G.default);let o,i,C,w,l,u,a;if(n.width<=g.PI){let R=k.center(n,$),j=h.cartographicToCartesian(R,bt),T=new K(j,h);a=T.plane;let E=R.longitude,ot=n.south<0&&n.north>0?0:R.latitude,st=S.fromRadians(E,n.north,c,Tt),V=S.fromRadians(n.west,n.north,c,St),it=S.fromRadians(n.west,ot,c,gt),_=S.fromRadians(n.west,n.south,c,Et),ht=S.fromRadians(E,n.south,c,Rt),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(V,H),dt=h.cartographicToCartesian(it,zt),X=h.cartographicToCartesian(_,tt),mt=h.cartographicToCartesian(ht,It),wt=T.projectPointToNearestOnPlane(ft,Lt),Y=T.projectPointToNearestOnPlane(D,Ut),lt=T.projectPointToNearestOnPlane(dt,qt),F=T.projectPointToNearestOnPlane(X,jt),pt=T.projectPointToNearestOnPlane(mt,Bt);return o=Math.min(Y.x,lt.x,F.x),i=-o,w=Math.max(Y.y,wt.y),C=Math.min(F.y,pt.y),V.height=_.height=e,D=h.cartographicToCartesian(V,H),X=h.cartographicToCartesian(_,tt),l=Math.min(L.getPointDistance(a,D),L.getPointDistance(a,X)),u=c,Q(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,w,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=k.center(n,$).longitude,x=t.fromRadians(M,A,c,h,vt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,Vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=L.fromPointNormal(x,N,Ft);let U=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Dt);i=t.dot(L.projectPointOntoPlane(a,U,Xt),O),o=-i,w=t.fromRadians(0,n.north,f?e:c,h,kt).z,C=t.fromRadians(0,n.south,s?e:c,h,Zt).z;let q=t.fromRadians(n.east,A,c,h,Yt);return l=L.getPointDistance(a,q),u=0,Q(x,O,P,N,o,i,C,w,l,u,r)};m.fromTransformation=function(n,e){return z.typeOf.object("transformation",n),p(e)||(e=new m),e.center=B.getTranslation(n,e.center),e.halfAxes=B.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};m.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new m(n.center,n.halfAxes)};m.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,w=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-w?v.OUTSIDE:l>=w?v.INSIDE:v.INTERSECTING};var at=new t,ct=new t,rt=new t,Gt=new t,et=new t,Jt=new t;m.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,nt),h=n.halfAxes,r=d.getColumn(h,0,at),o=d.getColumn(h,1,ct),i=d.getColumn(h,2,rt),C=t.magnitude(r),w=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,w>0?t.divideByScalar(o,w,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,et),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Gt),t.normalize(M,M),x=t.cross(A,M,et),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Jt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-w?(P=y.y+w,N+=P*P):y.y>w&&(P=y.y-w,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Kt=new t,Qt=new t;m.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new J);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,w=d.getColumn(C,0,at),l=d.getColumn(C,1,ct),u=d.getColumn(C,2,rt),a=t.add(w,l,Kt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Qt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,w,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,w,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,w,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,w,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,w,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,w,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,w,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var $t=new t,Ht=new t,te=new t;m.computeCorners=function(n,e){z.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,$t),o=d.getColumn(h,1,Ht),i=d.getColumn(h,2,te);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var ee=new d;m.computeTransformation=function(n,e){z.typeOf.object("box",n),p(e)||(e=new B);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,ee);return B.fromRotationTranslation(h,c,e)};var ne=new Z;m.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=Z.fromOrientedBoundingBox(n,ne);return!e.isBoundingSphereVisible(c)};m.prototype.intersectPlane=function(n){return m.intersectPlane(this,n)};m.prototype.distanceSquaredTo=function(n){return m.distanceSquaredTo(this,n)};m.prototype.computePlaneDistances=function(n,e,c){return m.computePlaneDistances(this,n,e,c)};m.prototype.computeCorners=function(n){return m.computeCorners(this,n)};m.prototype.computeTransformation=function(n){return m.computeTransformation(this,n)};m.prototype.isOccluded=function(n){return m.isOccluded(this,n)};m.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};m.prototype.clone=function(n){return m.clone(this,n)};m.prototype.equals=function(n){return m.equals(this,n)};var ye=m;export{ye as a}; diff --git a/public/js/Cesium2/Workers/chunk-PJUDOIE3.js b/public/js/Cesium2/Workers/chunk-DKG6YEMN.js similarity index 91% rename from public/js/Cesium2/Workers/chunk-PJUDOIE3.js rename to public/js/Cesium2/Workers/chunk-DKG6YEMN.js index e6e994af2..3a03086a6 100644 --- a/public/js/Cesium2/Workers/chunk-PJUDOIE3.js +++ b/public/js/Cesium2/Workers/chunk-DKG6YEMN.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as L,b as x}from"./chunk-K2M3OJ7Z.js";import{h as R}from"./chunk-M3A6SPGI.js";import{b as d,c as O,d as g}from"./chunk-S4VBGY2U.js";import{a as w}from"./chunk-N3A5CZ2S.js";import{b as m}from"./chunk-G75U3WZT.js";import{e as f}from"./chunk-3THTQ4QB.js";function t(i,h,o,n){this.x=w(i,0),this.y=w(h,0),this.width=w(o,0),this.height=w(n,0)}t.packedLength=4;t.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=w(o,0),h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};t.unpack=function(i,h,o){return m.defined("array",i),h=w(h,0),f(o)||(o=new t),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};t.fromPoints=function(i,h){if(f(h)||(h=new t),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,n=i[0].x,c=i[0].y,e=i[0].x,y=i[0].y;for(let p=1;p<o;p++){let b=i[p],j=b.x,M=b.y;n=Math.min(j,n),e=Math.max(j,e),c=Math.min(M,c),y=Math.max(M,y)}return h.x=n,h.y=c,h.width=e-n,h.height=y-c,h};var X=new L,Y=new d,k=new d;t.fromRectangle=function(i,h,o){if(f(o)||(o=new t),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;X._ellipsoid=g.default,h=w(h,X);let n=h.project(R.southwest(i,Y)),c=h.project(R.northeast(i,k));return O.subtract(c,n,c),o.x=n.x,o.y=n.y,o.width=c.x,o.height=c.y,o};t.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new t(i.x,i.y,i.width,i.height)};t.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new t);let n=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),y=Math.max(i.y+i.height,h.y+h.height);return o.x=n,o.y=c,o.width=e-n,o.height=y-c,o};t.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=t.clone(i,o);let n=h.x-o.x,c=h.y-o.y;return n>o.width?o.width=n:n<0&&(o.width-=n,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};t.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,n=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||n+i.height<e||n>e+h.height?x.OUTSIDE:x.INTERSECTING};t.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};t.prototype.clone=function(i){return t.clone(this,i)};t.prototype.intersect=function(i){return t.intersect(this,i)};t.prototype.equals=function(i){return t.equals(this,i)};var a=t;export{a}; +import{a as L,b as x}from"./chunk-2NIQ5ECB.js";import{h as R}from"./chunk-7YEOLR2L.js";import{b as d,c as O,d as g}from"./chunk-RH3GFHG2.js";import{a as w}from"./chunk-TA3RE4KQ.js";import{b as m}from"./chunk-RTY3VPG6.js";import{e as f}from"./chunk-LRNH5AEO.js";function t(i,h,o,n){this.x=w(i,0),this.y=w(h,0),this.width=w(o,0),this.height=w(n,0)}t.packedLength=4;t.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=w(o,0),h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};t.unpack=function(i,h,o){return m.defined("array",i),h=w(h,0),f(o)||(o=new t),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};t.fromPoints=function(i,h){if(f(h)||(h=new t),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,n=i[0].x,c=i[0].y,e=i[0].x,y=i[0].y;for(let p=1;p<o;p++){let b=i[p],j=b.x,M=b.y;n=Math.min(j,n),e=Math.max(j,e),c=Math.min(M,c),y=Math.max(M,y)}return h.x=n,h.y=c,h.width=e-n,h.height=y-c,h};var X=new L,Y=new d,k=new d;t.fromRectangle=function(i,h,o){if(f(o)||(o=new t),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;X._ellipsoid=g.default,h=w(h,X);let n=h.project(R.southwest(i,Y)),c=h.project(R.northeast(i,k));return O.subtract(c,n,c),o.x=n.x,o.y=n.y,o.width=c.x,o.height=c.y,o};t.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new t(i.x,i.y,i.width,i.height)};t.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new t);let n=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),y=Math.max(i.y+i.height,h.y+h.height);return o.x=n,o.y=c,o.width=e-n,o.height=y-c,o};t.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=t.clone(i,o);let n=h.x-o.x,c=h.y-o.y;return n>o.width?o.width=n:n<0&&(o.width-=n,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};t.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,n=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||n+i.height<e||n>e+h.height?x.OUTSIDE:x.INTERSECTING};t.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};t.prototype.clone=function(i){return t.clone(this,i)};t.prototype.intersect=function(i){return t.intersect(this,i)};t.prototype.equals=function(i){return t.equals(this,i)};var a=t;export{a}; diff --git a/public/js/Cesium2/Workers/chunk-ZHF7X3YD.js b/public/js/Cesium2/Workers/chunk-DTSLUHDY.js similarity index 94% rename from public/js/Cesium2/Workers/chunk-ZHF7X3YD.js rename to public/js/Cesium2/Workers/chunk-DTSLUHDY.js index 81a076710..8e2410ddf 100644 --- a/public/js/Cesium2/Workers/chunk-ZHF7X3YD.js +++ b/public/js/Cesium2/Workers/chunk-DTSLUHDY.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as b}from"./chunk-5CC3QRYS.js";import{a as u}from"./chunk-6HIVPZ7K.js";import{a as O}from"./chunk-24JYWT5N.js";import{b as w,c as h,d as x}from"./chunk-LH3SUUXG.js";import{d}from"./chunk-K2M3OJ7Z.js";import{a as y}from"./chunk-D5HNP2LB.js";import{a as i}from"./chunk-S4VBGY2U.js";import{a as p}from"./chunk-N3A5CZ2S.js";import{a as z,b as c}from"./chunk-G75U3WZT.js";import{e as A}from"./chunk-3THTQ4QB.js";var D=new i;function f(r){r=p(r,p.EMPTY_OBJECT);let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),A(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=p(r.vertexFormat,u.DEFAULT);this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=p(r,p.EMPTY_OBJECT);let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=p(m,0),i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=p(r._offsetAttribute,-1),o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=p(o,0);let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return A(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new x({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new x({componentDatatype:y.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new x({componentDatatype:y.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new x({componentDatatype:y.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new x({componentDatatype:y.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new x({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(A(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new x({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new d(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var l;f.getUnitBox=function(){return A(l)||(l=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),l};var R=f;export{R as a}; +import{a as b}from"./chunk-N5SNKJ43.js";import{a as u}from"./chunk-6VK5R74O.js";import{a as O}from"./chunk-NT26NNVH.js";import{b as w,c as h,d as x}from"./chunk-NW2YE576.js";import{d}from"./chunk-2NIQ5ECB.js";import{a as y}from"./chunk-QHHYYTCM.js";import{a as i}from"./chunk-RH3GFHG2.js";import{a as p}from"./chunk-TA3RE4KQ.js";import{a as z,b as c}from"./chunk-RTY3VPG6.js";import{e as A}from"./chunk-LRNH5AEO.js";var D=new i;function f(r){r=p(r,p.EMPTY_OBJECT);let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),A(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=p(r.vertexFormat,u.DEFAULT);this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=p(r,p.EMPTY_OBJECT);let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=p(m,0),i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=p(r._offsetAttribute,-1),o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=p(o,0);let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return A(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new x({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new x({componentDatatype:y.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new x({componentDatatype:y.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new x({componentDatatype:y.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new x({componentDatatype:y.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new x({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(A(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new x({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new d(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var l;f.getUnitBox=function(){return A(l)||(l=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),l};var R=f;export{R as a}; diff --git a/public/js/Cesium2/Workers/chunk-MWSGYAUE.js b/public/js/Cesium2/Workers/chunk-FAPED76U.js similarity index 95% rename from public/js/Cesium2/Workers/chunk-MWSGYAUE.js rename to public/js/Cesium2/Workers/chunk-FAPED76U.js index 984fa7cb8..a262eec4d 100644 --- a/public/js/Cesium2/Workers/chunk-MWSGYAUE.js +++ b/public/js/Cesium2/Workers/chunk-FAPED76U.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{f as C}from"./chunk-M3A6SPGI.js";import{a as n,e as b}from"./chunk-S4VBGY2U.js";import{a as w}from"./chunk-UCTPWOTZ.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; +import{f as C}from"./chunk-7YEOLR2L.js";import{a as n,e as b}from"./chunk-RH3GFHG2.js";import{a as w}from"./chunk-FRWNWNYJ.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/public/js/Cesium2/Workers/chunk-72CGGEJF.js b/public/js/Cesium2/Workers/chunk-FG3CL3AH.js similarity index 97% rename from public/js/Cesium2/Workers/chunk-72CGGEJF.js rename to public/js/Cesium2/Workers/chunk-FG3CL3AH.js index 7825b60a8..8eaa8c9e1 100644 --- a/public/js/Cesium2/Workers/chunk-72CGGEJF.js +++ b/public/js/Cesium2/Workers/chunk-FG3CL3AH.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as et}from"./chunk-Q5MYX5A2.js";import{a as jt}from"./chunk-OZYLWM74.js";import{b as Lt}from"./chunk-PY4CW263.js";import{a as Et}from"./chunk-RRZIPF5C.js";import{a as j}from"./chunk-34ULWVZF.js";import{a as mt,b as D,c as B,d as U}from"./chunk-LH3SUUXG.js";import{a as _t,b as Ut,d as rt}from"./chunk-K2M3OJ7Z.js";import{a as dt,b as H}from"./chunk-M3A6SPGI.js";import{a as k}from"./chunk-D5HNP2LB.js";import{a as r,b as Mt,c as R,e as Ot}from"./chunk-S4VBGY2U.js";import{a as N}from"./chunk-UCTPWOTZ.js";import{a as K}from"./chunk-N3A5CZ2S.js";import{a as I,b as pt}from"./chunk-G75U3WZT.js";import{e as f}from"./chunk-3THTQ4QB.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){pt.defined("point",t),pt.defined("p0",e),pt.defined("p1",n),pt.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(R.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(R.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(R.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=R.subtract(n,e,Yt),o=R.subtract(s,e,Zt),a=R.subtract(t,e,Xt),p=R.dot(c,c),u=R.dot(c,o),d=R.dot(c,a),m=R.dot(o,o),l=R.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=K(t,K.EMPTY_OBJECT);let e=t.indices,n=t.maximumIndex,s=K(t.cacheSize,24);if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=K(t,K.EMPTY_OBJECT);let e=t.indices,n=t.maximumIndex,s=K(t.cacheSize,24),i;function c(C,z,q,V){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<V;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,V,G,M,J){let Y=-1,_,Pt=-1,gt=0;for(;gt<q.length;){let ft=q[gt];V[ft].numLiveTriangles&&(_=0,G-V[ft].timeStamp+2*V[ft].numLiveTriangles<=z&&(_=G-V[ft].timeStamp),(_>Pt||Pt===-1)&&(Pt=_,Y=ft)),++gt}return Y===-1?c(V,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var F={};function St(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)St(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);St(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)St(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)St(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}F.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};F.createLineSegmentsForVectors=function(t,e,n){if(e=K(e,"normal"),!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=K(n,1e4);let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new rt(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};F.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};F.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=k.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};F.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}F.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;F.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==k.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};F.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==k.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:k.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:k.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),Ot.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var vt=new H,yt=new Ot;F.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,vt),H.transpose(vt,vt),H.getMatrix3(vt,yt),qt(yt,n.normal),qt(yt,n.tangent),qt(yt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=rt.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:k.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Vt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new rt(v,b):void 0})}F.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Vt(e,"geometry")),n.length>0&&(i.push(Vt(n,"westHemisphereGeometry")),i.push(Vt(n,"eastHemisphereGeometry"))),i};var Z=new r,ht=new r,ct=new r,at=new r;F.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;ht.x=s[S],ht.y=s[S+1],ht.z=s[S+2],ct.x=s[x],ct.y=s[x+1],ct.z=s[x+2],at.x=s[w],at.y=s[w+1],at.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(ct,ht,ct),r.subtract(at,ht,at),a[d]=r.cross(ct,at,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:k.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;F.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,V=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=V,p[d+2]+=G,p[m]+=q,p[m+1]+=V,p[m+2]+=G,p[l]+=q,p[l+1]+=V,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:k.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:k.FLOAT,componentsPerAttribute:3,values:y}),t};var bt=new R,W=new r,Qt=new r,te=new r,xt=new R;F.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}xt=et.octEncodeInRange(W,65535,xt),O[L++]=xt.x,O[L++]=xt.y}return t.attributes.compressedAttributes=new U({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(R.fromArray(h,n*2,bt),A[E++]=et.compressTextureCoordinates(bt));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),et.octPack(W,Qt,te,bt),A[E++]=bt.x,A[E++]=bt.y):(o&&(r.fromArray(l,P,W),A[E++]=et.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=et.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=et.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:k.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function tt(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){tt(t,t.y<0),tt(e,e.y<0),tt(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;tt(t,a),tt(e,a),tt(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),tt(n,!0),tt(s,!1)}var nt=new r,it=new r,st=new r,ot=new r,Rt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Rt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,nt,st),X(t,n,it,ot),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,nt,st),X(e,t,it,ot),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,nt,st),X(n,e,it,ot),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,nt,st),X(n,e,it,ot),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,nt,st),X(e,t,it,ot),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,nt,st),X(t,n,it,ot),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Rt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=nt,p[4]=it,p[5]=st,p[6]=ot,p.length=7),Rt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=k.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=rt.fromVertices(n.position.values)),t}function lt(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function kt(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function Ft(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=Ft(dt,4),It=Ft(r,3),ae=Ft(R,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},wt=new r,Gt=new r,Ct=new r,qe=new r;function Tt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,wt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&It(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,wt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=wt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&It(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&It(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Ve(t,e,n,w,v,y[E],m[E])}}}function Ve(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:It(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function Q(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Re={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Re[O]&&f(n[O])&&m.push(O);let l=m.length,h=lt(e),y=lt(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let V=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=V[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=Q(v,b,S,d,Y<3?w+Y:-1,_),Tt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=Q(v,b,S,d,w,T),Tt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=Q(v,b,S,d,w+1,C),Tt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=Q(v,b,S,d,w+2,z),Tt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}kt(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function ut(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,wt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=lt(e),a=lt(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,wt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=Q(S,x,w,c,p,y),ut(l,h,y,s,b,S,i),b=Q(S,x,w,c,-1,g),ut(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=Q(A,E,P,c,-1,g),ut(l,h,g,s,b,A,i),b=Q(A,E,P,c,p+1,v),ut(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=Q(L,g,T,c,p,y),ut(l,h,y,s,b,L,i),b=Q(L,g,T,c,p+1,v),ut(l,h,v,s,b,L,i)}}kt(t,a,o)}var oe=new R,Be=new R,le=new r,fe=new r,Bt=new r,ke=new r,Fe=new r,Me=new r,re=new dt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,At=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=lt(e),d=lt(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<At)for(x.y=At*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<At)for(w.y=At*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,ke);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,Fe);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=R.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let V=dt.fromArray(p,b*4,re),G=dt.fromArray(p,S*4,re),M=N.lerp(V.x,G.x,q),J=N.lerp(V.y,G.y,q),Y=N.lerp(V.z,G.z,q),_=N.lerp(V.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let V=R.fromArray(a,b*2,oe),G=R.fromArray(a,(m+3)*2,Be),M=N.lerp(V.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,V.y),A.st.values.push(M,G.y),P.st.values.push(M,V.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),kt(t,d,u)}F.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||rt.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==mt.NONE)switch(e.geometryType){case mt.POLYLINES:Ue(t);break;case mt.TRIANGLES:ie(t);break;case mt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var gn=F;export{gn as a}; +import{a as et}from"./chunk-VMXXQ6B4.js";import{a as jt}from"./chunk-XCRMBS5M.js";import{b as Lt}from"./chunk-V7XARCCV.js";import{a as Et}from"./chunk-SACP225T.js";import{a as j}from"./chunk-YFQNY2YN.js";import{a as mt,b as D,c as B,d as U}from"./chunk-NW2YE576.js";import{a as _t,b as Ut,d as rt}from"./chunk-2NIQ5ECB.js";import{a as dt,b as H}from"./chunk-7YEOLR2L.js";import{a as k}from"./chunk-QHHYYTCM.js";import{a as r,b as Mt,c as R,e as Ot}from"./chunk-RH3GFHG2.js";import{a as N}from"./chunk-FRWNWNYJ.js";import{a as K}from"./chunk-TA3RE4KQ.js";import{a as I,b as pt}from"./chunk-RTY3VPG6.js";import{e as f}from"./chunk-LRNH5AEO.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){pt.defined("point",t),pt.defined("p0",e),pt.defined("p1",n),pt.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(R.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(R.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(R.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=R.subtract(n,e,Yt),o=R.subtract(s,e,Zt),a=R.subtract(t,e,Xt),p=R.dot(c,c),u=R.dot(c,o),d=R.dot(c,a),m=R.dot(o,o),l=R.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=K(t,K.EMPTY_OBJECT);let e=t.indices,n=t.maximumIndex,s=K(t.cacheSize,24);if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=K(t,K.EMPTY_OBJECT);let e=t.indices,n=t.maximumIndex,s=K(t.cacheSize,24),i;function c(C,z,q,V){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<V;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,V,G,M,J){let Y=-1,_,Pt=-1,gt=0;for(;gt<q.length;){let ft=q[gt];V[ft].numLiveTriangles&&(_=0,G-V[ft].timeStamp+2*V[ft].numLiveTriangles<=z&&(_=G-V[ft].timeStamp),(_>Pt||Pt===-1)&&(Pt=_,Y=ft)),++gt}return Y===-1?c(V,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var F={};function St(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)St(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);St(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)St(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)St(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}F.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};F.createLineSegmentsForVectors=function(t,e,n){if(e=K(e,"normal"),!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=K(n,1e4);let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new rt(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};F.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};F.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=k.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};F.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}F.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;F.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==k.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};F.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==k.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:k.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:k.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),Ot.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var vt=new H,yt=new Ot;F.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,vt),H.transpose(vt,vt),H.getMatrix3(vt,yt),qt(yt,n.normal),qt(yt,n.tangent),qt(yt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=rt.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:k.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Vt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new rt(v,b):void 0})}F.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Vt(e,"geometry")),n.length>0&&(i.push(Vt(n,"westHemisphereGeometry")),i.push(Vt(n,"eastHemisphereGeometry"))),i};var Z=new r,ht=new r,ct=new r,at=new r;F.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;ht.x=s[S],ht.y=s[S+1],ht.z=s[S+2],ct.x=s[x],ct.y=s[x+1],ct.z=s[x+2],at.x=s[w],at.y=s[w+1],at.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(ct,ht,ct),r.subtract(at,ht,at),a[d]=r.cross(ct,at,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:k.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;F.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,V=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=V,p[d+2]+=G,p[m]+=q,p[m+1]+=V,p[m+2]+=G,p[l]+=q,p[l+1]+=V,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:k.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:k.FLOAT,componentsPerAttribute:3,values:y}),t};var bt=new R,W=new r,Qt=new r,te=new r,xt=new R;F.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}xt=et.octEncodeInRange(W,65535,xt),O[L++]=xt.x,O[L++]=xt.y}return t.attributes.compressedAttributes=new U({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(R.fromArray(h,n*2,bt),A[E++]=et.compressTextureCoordinates(bt));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),et.octPack(W,Qt,te,bt),A[E++]=bt.x,A[E++]=bt.y):(o&&(r.fromArray(l,P,W),A[E++]=et.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=et.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=et.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:k.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function tt(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){tt(t,t.y<0),tt(e,e.y<0),tt(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;tt(t,a),tt(e,a),tt(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),tt(n,!0),tt(s,!1)}var nt=new r,it=new r,st=new r,ot=new r,Rt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Rt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,nt,st),X(t,n,it,ot),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,nt,st),X(e,t,it,ot),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,nt,st),X(n,e,it,ot),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,nt,st),X(n,e,it,ot),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,nt,st),X(e,t,it,ot),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,nt,st),X(t,n,it,ot),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Rt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=nt,p[4]=it,p[5]=st,p[6]=ot,p.length=7),Rt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=k.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=rt.fromVertices(n.position.values)),t}function lt(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function kt(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function Ft(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=Ft(dt,4),It=Ft(r,3),ae=Ft(R,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},wt=new r,Gt=new r,Ct=new r,qe=new r;function Tt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,wt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&It(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,wt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=wt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&It(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&It(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Ve(t,e,n,w,v,y[E],m[E])}}}function Ve(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:It(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function Q(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Re={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Re[O]&&f(n[O])&&m.push(O);let l=m.length,h=lt(e),y=lt(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let V=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=V[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=Q(v,b,S,d,Y<3?w+Y:-1,_),Tt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=Q(v,b,S,d,w,T),Tt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=Q(v,b,S,d,w+1,C),Tt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=Q(v,b,S,d,w+2,z),Tt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}kt(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function ut(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,wt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=lt(e),a=lt(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,wt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=Q(S,x,w,c,p,y),ut(l,h,y,s,b,S,i),b=Q(S,x,w,c,-1,g),ut(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=Q(A,E,P,c,-1,g),ut(l,h,g,s,b,A,i),b=Q(A,E,P,c,p+1,v),ut(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=Q(L,g,T,c,p,y),ut(l,h,y,s,b,L,i),b=Q(L,g,T,c,p+1,v),ut(l,h,v,s,b,L,i)}}kt(t,a,o)}var oe=new R,Be=new R,le=new r,fe=new r,Bt=new r,ke=new r,Fe=new r,Me=new r,re=new dt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,At=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=lt(e),d=lt(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<At)for(x.y=At*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<At)for(w.y=At*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,ke);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,Fe);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=R.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let V=dt.fromArray(p,b*4,re),G=dt.fromArray(p,S*4,re),M=N.lerp(V.x,G.x,q),J=N.lerp(V.y,G.y,q),Y=N.lerp(V.z,G.z,q),_=N.lerp(V.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let V=R.fromArray(a,b*2,oe),G=R.fromArray(a,(m+3)*2,Be),M=N.lerp(V.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,V.y),A.st.values.push(M,G.y),P.st.values.push(M,V.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),kt(t,d,u)}F.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||rt.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==mt.NONE)switch(e.geometryType){case mt.POLYLINES:Ue(t);break;case mt.TRIANGLES:ie(t);break;case mt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var gn=F;export{gn as a}; diff --git a/public/js/Cesium2/Workers/chunk-UCTPWOTZ.js b/public/js/Cesium2/Workers/chunk-FRWNWNYJ.js similarity index 97% rename from public/js/Cesium2/Workers/chunk-UCTPWOTZ.js rename to public/js/Cesium2/Workers/chunk-FRWNWNYJ.js index b2d4e8c22..52cf47f42 100644 --- a/public/js/Cesium2/Workers/chunk-UCTPWOTZ.js +++ b/public/js/Cesium2/Workers/chunk-FRWNWNYJ.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as f}from"./chunk-N3A5CZ2S.js";import{a as n,b as c}from"./chunk-G75U3WZT.js";import{c as I,d as _,e as o}from"./chunk-3THTQ4QB.js";var P=I((O,d)=>{var u=function(t){t==null&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};u.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};u.prototype.init_by_array=function(t,i){var e,s,h;for(this.init_seed(19650218),e=1,s=0,h=this.N>i?this.N:i;h;h--){var a=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+t[s]+s,this.mt[e]>>>=0,e++,s++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1),s>=i&&(s=0)}for(h=this.N-1;h;h--){var a=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-e,this.mt[e]>>>=0,e++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1)}this.mt[0]=2147483648};u.prototype.random_int=function(){var t,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var e;for(this.mti==this.N+1&&this.init_seed(5489),e=0;e<this.N-this.M;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+this.M]^t>>>1^i[t&1];for(;e<this.N-1;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+(this.M-this.N)]^t>>>1^i[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^i[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};u.prototype.random_int31=function(){return this.random_int()>>>1};u.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};u.prototype.random=function(){return this.random_int()*(1/4294967296)};u.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};u.prototype.random_long=function(){var t=this.random_int()>>>5,i=this.random_int()>>>6;return(t*67108864+i)*(1/9007199254740992)};d.exports=u});var m=_(P(),1);var r={};r.EPSILON1=.1;r.EPSILON2=.01;r.EPSILON3=.001;r.EPSILON4=1e-4;r.EPSILON5=1e-5;r.EPSILON6=1e-6;r.EPSILON7=1e-7;r.EPSILON8=1e-8;r.EPSILON9=1e-9;r.EPSILON10=1e-10;r.EPSILON11=1e-11;r.EPSILON12=1e-12;r.EPSILON13=1e-13;r.EPSILON14=1e-14;r.EPSILON15=1e-15;r.EPSILON16=1e-16;r.EPSILON17=1e-17;r.EPSILON18=1e-18;r.EPSILON19=1e-19;r.EPSILON20=1e-20;r.EPSILON21=1e-21;r.GRAVITATIONALPARAMETER=3986004418e5;r.SOLAR_RADIUS=6955e5;r.LUNAR_RADIUS=1737400;r.SIXTY_FOUR_KILOBYTES=64*1024;r.FOUR_GIGABYTES=4*1024*1024*1024;r.sign=f(Math.sign,function(i){return i=+i,i===0||i!==i?i:i>0?1:-1});r.signNotZero=function(t){return t<0?-1:1};r.toSNorm=function(t,i){return i=f(i,255),Math.round((r.clamp(t,-1,1)*.5+.5)*i)};r.fromSNorm=function(t,i){return i=f(i,255),r.clamp(t,0,i)/i*2-1};r.normalize=function(t,i,e){return e=Math.max(e-i,0),e===0?0:r.clamp((t-i)/e,0,1)};r.sinh=f(Math.sinh,function(i){return(Math.exp(i)-Math.exp(-i))/2});r.cosh=f(Math.cosh,function(i){return(Math.exp(i)+Math.exp(-i))/2});r.lerp=function(t,i,e){return(1-e)*t+e*i};r.PI=Math.PI;r.ONE_OVER_PI=1/Math.PI;r.PI_OVER_TWO=Math.PI/2;r.PI_OVER_THREE=Math.PI/3;r.PI_OVER_FOUR=Math.PI/4;r.PI_OVER_SIX=Math.PI/6;r.THREE_PI_OVER_TWO=3*Math.PI/2;r.TWO_PI=2*Math.PI;r.ONE_OVER_TWO_PI=1/(2*Math.PI);r.RADIANS_PER_DEGREE=Math.PI/180;r.DEGREES_PER_RADIAN=180/Math.PI;r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600;r.toRadians=function(t){if(!o(t))throw new n("degrees is required.");return t*r.RADIANS_PER_DEGREE};r.toDegrees=function(t){if(!o(t))throw new n("radians is required.");return t*r.DEGREES_PER_RADIAN};r.convertLongitudeRange=function(t){if(!o(t))throw new n("angle is required.");let i=r.TWO_PI,e=t-Math.floor(t/i)*i;return e<-Math.PI?e+i:e>=Math.PI?e-i:e};r.clampToLatitudeRange=function(t){if(!o(t))throw new n("angle is required.");return r.clamp(t,-1*r.PI_OVER_TWO,r.PI_OVER_TWO)};r.negativePiToPi=function(t){if(!o(t))throw new n("angle is required.");return t>=-r.PI&&t<=r.PI?t:r.zeroToTwoPi(t+r.PI)-r.PI};r.zeroToTwoPi=function(t){if(!o(t))throw new n("angle is required.");if(t>=0&&t<=r.TWO_PI)return t;let i=r.mod(t,r.TWO_PI);return Math.abs(i)<r.EPSILON14&&Math.abs(t)>r.EPSILON14?r.TWO_PI:i};r.mod=function(t,i){if(!o(t))throw new n("m is required.");if(!o(i))throw new n("n is required.");if(i===0)throw new n("divisor cannot be 0.");return r.sign(t)===r.sign(i)&&Math.abs(t)<Math.abs(i)?t:(t%i+i)%i};r.equalsEpsilon=function(t,i,e,s){if(!o(t))throw new n("left is required.");if(!o(i))throw new n("right is required.");e=f(e,0),s=f(s,e);let h=Math.abs(t-i);return h<=s||h<=e*Math.max(Math.abs(t),Math.abs(i))};r.lessThan=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i<-e};r.lessThanOrEquals=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i<e};r.greaterThan=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i>e};r.greaterThanOrEquals=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i>-e};var w=[1];r.factorial=function(t){if(typeof t!="number"||t<0)throw new n("A number greater than or equal to 0 is required.");let i=w.length;if(t>=i){let e=w[i-1];for(let s=i;s<=t;s++){let h=e*s;w.push(h),e=h}}return w[t]};r.incrementWrap=function(t,i,e){if(e=f(e,0),!o(t))throw new n("n is required.");if(i<=e)throw new n("maximumValue must be greater than minimumValue.");return++t,t>i&&(t=e),t};r.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new n("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0};r.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new n("A number between 0 and 2^31 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t};r.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new n("A number between 0 and (2^32)-1 is required.");return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t=(t>>>0)-(t>>>1),t};r.clamp=function(t,i,e){return c.typeOf.number("value",t),c.typeOf.number("min",i),c.typeOf.number("max",e),t<i?i:t>e?e:t};var E=new m.default;r.setRandomNumberSeed=function(t){if(!o(t))throw new n("seed is required.");E=new m.default(t)};r.nextRandomNumber=function(){return E.random()};r.randomBetween=function(t,i){return r.nextRandomNumber()*(i-t)+t};r.acosClamped=function(t){if(!o(t))throw new n("value is required.");return Math.acos(r.clamp(t,-1,1))};r.asinClamped=function(t){if(!o(t))throw new n("value is required.");return Math.asin(r.clamp(t,-1,1))};r.chordLength=function(t,i){if(!o(t))throw new n("angle is required.");if(!o(i))throw new n("radius is required.");return 2*i*Math.sin(t*.5)};r.logBase=function(t,i){if(!o(t))throw new n("number is required.");if(!o(i))throw new n("base is required.");return Math.log(t)/Math.log(i)};r.cbrt=f(Math.cbrt,function(i){let e=Math.pow(Math.abs(i),.3333333333333333);return i<0?-e:e});r.log2=f(Math.log2,function(i){return Math.log(i)*Math.LOG2E});r.fog=function(t,i){let e=t*i;return 1-Math.exp(-(e*e))};r.fastApproximateAtan=function(t){return c.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)};r.fastApproximateAtan2=function(t,i){c.typeOf.number("x",t),c.typeOf.number("y",i);let e,s=Math.abs(t);e=Math.abs(i);let h=Math.max(s,e);e=Math.min(s,e);let a=e/h;if(isNaN(a))throw new n("either x or y must be nonzero");return s=r.fastApproximateAtan(a),s=Math.abs(i)>Math.abs(t)?r.PI_OVER_TWO-s:s,s=t<0?r.PI-s:s,s=i<0?-s:s,s};var A=r;export{A as a}; +import{a as f}from"./chunk-TA3RE4KQ.js";import{a as n,b as c}from"./chunk-RTY3VPG6.js";import{c as I,d as _,e as o}from"./chunk-LRNH5AEO.js";var P=I((O,d)=>{var u=function(t){t==null&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};u.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};u.prototype.init_by_array=function(t,i){var e,s,h;for(this.init_seed(19650218),e=1,s=0,h=this.N>i?this.N:i;h;h--){var a=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+t[s]+s,this.mt[e]>>>=0,e++,s++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1),s>=i&&(s=0)}for(h=this.N-1;h;h--){var a=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-e,this.mt[e]>>>=0,e++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1)}this.mt[0]=2147483648};u.prototype.random_int=function(){var t,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var e;for(this.mti==this.N+1&&this.init_seed(5489),e=0;e<this.N-this.M;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+this.M]^t>>>1^i[t&1];for(;e<this.N-1;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+(this.M-this.N)]^t>>>1^i[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^i[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};u.prototype.random_int31=function(){return this.random_int()>>>1};u.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};u.prototype.random=function(){return this.random_int()*(1/4294967296)};u.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};u.prototype.random_long=function(){var t=this.random_int()>>>5,i=this.random_int()>>>6;return(t*67108864+i)*(1/9007199254740992)};d.exports=u});var m=_(P(),1);var r={};r.EPSILON1=.1;r.EPSILON2=.01;r.EPSILON3=.001;r.EPSILON4=1e-4;r.EPSILON5=1e-5;r.EPSILON6=1e-6;r.EPSILON7=1e-7;r.EPSILON8=1e-8;r.EPSILON9=1e-9;r.EPSILON10=1e-10;r.EPSILON11=1e-11;r.EPSILON12=1e-12;r.EPSILON13=1e-13;r.EPSILON14=1e-14;r.EPSILON15=1e-15;r.EPSILON16=1e-16;r.EPSILON17=1e-17;r.EPSILON18=1e-18;r.EPSILON19=1e-19;r.EPSILON20=1e-20;r.EPSILON21=1e-21;r.GRAVITATIONALPARAMETER=3986004418e5;r.SOLAR_RADIUS=6955e5;r.LUNAR_RADIUS=1737400;r.SIXTY_FOUR_KILOBYTES=64*1024;r.FOUR_GIGABYTES=4*1024*1024*1024;r.sign=f(Math.sign,function(i){return i=+i,i===0||i!==i?i:i>0?1:-1});r.signNotZero=function(t){return t<0?-1:1};r.toSNorm=function(t,i){return i=f(i,255),Math.round((r.clamp(t,-1,1)*.5+.5)*i)};r.fromSNorm=function(t,i){return i=f(i,255),r.clamp(t,0,i)/i*2-1};r.normalize=function(t,i,e){return e=Math.max(e-i,0),e===0?0:r.clamp((t-i)/e,0,1)};r.sinh=f(Math.sinh,function(i){return(Math.exp(i)-Math.exp(-i))/2});r.cosh=f(Math.cosh,function(i){return(Math.exp(i)+Math.exp(-i))/2});r.lerp=function(t,i,e){return(1-e)*t+e*i};r.PI=Math.PI;r.ONE_OVER_PI=1/Math.PI;r.PI_OVER_TWO=Math.PI/2;r.PI_OVER_THREE=Math.PI/3;r.PI_OVER_FOUR=Math.PI/4;r.PI_OVER_SIX=Math.PI/6;r.THREE_PI_OVER_TWO=3*Math.PI/2;r.TWO_PI=2*Math.PI;r.ONE_OVER_TWO_PI=1/(2*Math.PI);r.RADIANS_PER_DEGREE=Math.PI/180;r.DEGREES_PER_RADIAN=180/Math.PI;r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600;r.toRadians=function(t){if(!o(t))throw new n("degrees is required.");return t*r.RADIANS_PER_DEGREE};r.toDegrees=function(t){if(!o(t))throw new n("radians is required.");return t*r.DEGREES_PER_RADIAN};r.convertLongitudeRange=function(t){if(!o(t))throw new n("angle is required.");let i=r.TWO_PI,e=t-Math.floor(t/i)*i;return e<-Math.PI?e+i:e>=Math.PI?e-i:e};r.clampToLatitudeRange=function(t){if(!o(t))throw new n("angle is required.");return r.clamp(t,-1*r.PI_OVER_TWO,r.PI_OVER_TWO)};r.negativePiToPi=function(t){if(!o(t))throw new n("angle is required.");return t>=-r.PI&&t<=r.PI?t:r.zeroToTwoPi(t+r.PI)-r.PI};r.zeroToTwoPi=function(t){if(!o(t))throw new n("angle is required.");if(t>=0&&t<=r.TWO_PI)return t;let i=r.mod(t,r.TWO_PI);return Math.abs(i)<r.EPSILON14&&Math.abs(t)>r.EPSILON14?r.TWO_PI:i};r.mod=function(t,i){if(!o(t))throw new n("m is required.");if(!o(i))throw new n("n is required.");if(i===0)throw new n("divisor cannot be 0.");return r.sign(t)===r.sign(i)&&Math.abs(t)<Math.abs(i)?t:(t%i+i)%i};r.equalsEpsilon=function(t,i,e,s){if(!o(t))throw new n("left is required.");if(!o(i))throw new n("right is required.");e=f(e,0),s=f(s,e);let h=Math.abs(t-i);return h<=s||h<=e*Math.max(Math.abs(t),Math.abs(i))};r.lessThan=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i<-e};r.lessThanOrEquals=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i<e};r.greaterThan=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i>e};r.greaterThanOrEquals=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i>-e};var w=[1];r.factorial=function(t){if(typeof t!="number"||t<0)throw new n("A number greater than or equal to 0 is required.");let i=w.length;if(t>=i){let e=w[i-1];for(let s=i;s<=t;s++){let h=e*s;w.push(h),e=h}}return w[t]};r.incrementWrap=function(t,i,e){if(e=f(e,0),!o(t))throw new n("n is required.");if(i<=e)throw new n("maximumValue must be greater than minimumValue.");return++t,t>i&&(t=e),t};r.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new n("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0};r.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new n("A number between 0 and 2^31 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t};r.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new n("A number between 0 and (2^32)-1 is required.");return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t=(t>>>0)-(t>>>1),t};r.clamp=function(t,i,e){return c.typeOf.number("value",t),c.typeOf.number("min",i),c.typeOf.number("max",e),t<i?i:t>e?e:t};var E=new m.default;r.setRandomNumberSeed=function(t){if(!o(t))throw new n("seed is required.");E=new m.default(t)};r.nextRandomNumber=function(){return E.random()};r.randomBetween=function(t,i){return r.nextRandomNumber()*(i-t)+t};r.acosClamped=function(t){if(!o(t))throw new n("value is required.");return Math.acos(r.clamp(t,-1,1))};r.asinClamped=function(t){if(!o(t))throw new n("value is required.");return Math.asin(r.clamp(t,-1,1))};r.chordLength=function(t,i){if(!o(t))throw new n("angle is required.");if(!o(i))throw new n("radius is required.");return 2*i*Math.sin(t*.5)};r.logBase=function(t,i){if(!o(t))throw new n("number is required.");if(!o(i))throw new n("base is required.");return Math.log(t)/Math.log(i)};r.cbrt=f(Math.cbrt,function(i){let e=Math.pow(Math.abs(i),.3333333333333333);return i<0?-e:e});r.log2=f(Math.log2,function(i){return Math.log(i)*Math.LOG2E});r.fog=function(t,i){let e=t*i;return 1-Math.exp(-(e*e))};r.fastApproximateAtan=function(t){return c.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)};r.fastApproximateAtan2=function(t,i){c.typeOf.number("x",t),c.typeOf.number("y",i);let e,s=Math.abs(t);e=Math.abs(i);let h=Math.max(s,e);e=Math.min(s,e);let a=e/h;if(isNaN(a))throw new n("either x or y must be nonzero");return s=r.fastApproximateAtan(a),s=Math.abs(i)>Math.abs(t)?r.PI_OVER_TWO-s:s,s=t<0?r.PI-s:s,s=i<0?-s:s,s};var A=r;export{A as a}; diff --git a/public/js/Cesium2/Workers/chunk-HQ4YU6WD.js b/public/js/Cesium2/Workers/chunk-GMMUK6QU.js similarity index 98% rename from public/js/Cesium2/Workers/chunk-HQ4YU6WD.js rename to public/js/Cesium2/Workers/chunk-GMMUK6QU.js index 17117e56c..15bfe60a4 100644 --- a/public/js/Cesium2/Workers/chunk-HQ4YU6WD.js +++ b/public/js/Cesium2/Workers/chunk-GMMUK6QU.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * diff --git a/public/js/Cesium2/Workers/chunk-JXLT7VPX.js b/public/js/Cesium2/Workers/chunk-H2CDK6OB.js similarity index 98% rename from public/js/Cesium2/Workers/chunk-JXLT7VPX.js rename to public/js/Cesium2/Workers/chunk-H2CDK6OB.js index abe0d9f83..fb5b76515 100644 --- a/public/js/Cesium2/Workers/chunk-JXLT7VPX.js +++ b/public/js/Cesium2/Workers/chunk-H2CDK6OB.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{f as j}from"./chunk-S4VBGY2U.js";import{a as E}from"./chunk-UCTPWOTZ.js";import{a as C}from"./chunk-N3A5CZ2S.js";import{b as n}from"./chunk-G75U3WZT.js";import{e as O}from"./chunk-3THTQ4QB.js";function l(r,o,t){return t<0&&(t+=1),t>1&&(t-=1),t*6<1?r+(o-r)*6*t:t*2<1?o:t*3<2?r+(o-r)*(2/3-t)*6:r}function e(r,o,t,f){this.red=C(r,1),this.green=C(o,1),this.blue=C(t,1),this.alpha=C(f,1)}e.fromCartesian4=function(r,o){return n.typeOf.object("cartesian",r),O(o)?(o.red=r.x,o.green=r.y,o.blue=r.z,o.alpha=r.w,o):new e(r.x,r.y,r.z,r.w)};e.fromBytes=function(r,o,t,f,s){return r=e.byteToFloat(C(r,255)),o=e.byteToFloat(C(o,255)),t=e.byteToFloat(C(t,255)),f=e.byteToFloat(C(f,255)),O(s)?(s.red=r,s.green=o,s.blue=t,s.alpha=f,s):new e(r,o,t,f)};e.fromAlpha=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("alpha",o),O(t)?(t.red=r.red,t.green=r.green,t.blue=r.blue,t.alpha=o,t):new e(r.red,r.green,r.blue,o)};var A,g,m;j.supportsTypedArrays()&&(A=new ArrayBuffer(4),g=new Uint32Array(A),m=new Uint8Array(A));e.fromRgba=function(r,o){return g[0]=r,e.fromBytes(m[0],m[1],m[2],m[3],o)};e.fromHsl=function(r,o,t,f,s){r=C(r,0)%1,o=C(o,0),t=C(t,0),f=C(f,1);let c=t,b=t,i=t;if(o!==0){let S;t<.5?S=t*(1+o):S=t+o-t*o;let F=2*t-S;c=l(F,S,r+1/3),b=l(F,S,r),i=l(F,S,r-1/3)}return O(s)?(s.red=c,s.green=b,s.blue=i,s.alpha=f,s):new e(c,b,i,f)};e.fromRandom=function(r,o){r=C(r,C.EMPTY_OBJECT);let t=r.red;if(!O(t)){let b=C(r.minimumRed,0),i=C(r.maximumRed,1);n.typeOf.number.lessThanOrEquals("minimumRed",b,i),t=b+E.nextRandomNumber()*(i-b)}let f=r.green;if(!O(f)){let b=C(r.minimumGreen,0),i=C(r.maximumGreen,1);n.typeOf.number.lessThanOrEquals("minimumGreen",b,i),f=b+E.nextRandomNumber()*(i-b)}let s=r.blue;if(!O(s)){let b=C(r.minimumBlue,0),i=C(r.maximumBlue,1);n.typeOf.number.lessThanOrEquals("minimumBlue",b,i),s=b+E.nextRandomNumber()*(i-b)}let c=r.alpha;if(!O(c)){let b=C(r.minimumAlpha,0),i=C(r.maximumAlpha,1);n.typeOf.number.lessThanOrEquals("minimumAlpha",b,i),c=b+E.nextRandomNumber()*(i-b)}return O(o)?(o.red=t,o.green=f,o.blue=s,o.alpha=c,o):new e(t,f,s,c)};var a=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,z=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,p=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;e.fromCssColorString=function(r,o){n.typeOf.string("color",r),O(o)||(o=new e),r=r.trim();let t=e[r.toUpperCase()];if(O(t))return e.clone(t,o),o;let f=a.exec(r);return f!==null?(o.red=parseInt(f[1],16)/15,o.green=parseInt(f[2],16)/15,o.blue=parseInt(f[3],16)/15,o.alpha=parseInt(C(f[4],"f"),16)/15,o):(f=z.exec(r),f!==null?(o.red=parseInt(f[1],16)/255,o.green=parseInt(f[2],16)/255,o.blue=parseInt(f[3],16)/255,o.alpha=parseInt(C(f[4],"ff"),16)/255,o):(f=p.exec(r),f!==null?(o.red=parseFloat(f[1])/(f[1].substr(-1)==="%"?100:255),o.green=parseFloat(f[2])/(f[2].substr(-1)==="%"?100:255),o.blue=parseFloat(f[3])/(f[3].substr(-1)==="%"?100:255),o.alpha=parseFloat(C(f[4],"1.0")),o):(f=R.exec(r),f!==null?e.fromHsl(parseFloat(f[1])/360,parseFloat(f[2])/100,parseFloat(f[3])/100,parseFloat(C(f[4],"1.0")),o):(o=void 0,o))))};e.packedLength=4;e.pack=function(r,o,t){return n.typeOf.object("value",r),n.defined("array",o),t=C(t,0),o[t++]=r.red,o[t++]=r.green,o[t++]=r.blue,o[t]=r.alpha,o};e.unpack=function(r,o,t){return n.defined("array",r),o=C(o,0),O(t)||(t=new e),t.red=r[o++],t.green=r[o++],t.blue=r[o++],t.alpha=r[o],t};e.byteToFloat=function(r){return r/255};e.floatToByte=function(r){return r===1?255:r*256|0};e.clone=function(r,o){if(O(r))return O(o)?(o.red=r.red,o.green=r.green,o.blue=r.blue,o.alpha=r.alpha,o):new e(r.red,r.green,r.blue,r.alpha)};e.equals=function(r,o){return r===o||O(r)&&O(o)&&r.red===o.red&&r.green===o.green&&r.blue===o.blue&&r.alpha===o.alpha};e.equalsArray=function(r,o,t){return r.red===o[t]&&r.green===o[t+1]&&r.blue===o[t+2]&&r.alpha===o[t+3]};e.prototype.clone=function(r){return e.clone(this,r)};e.prototype.equals=function(r){return e.equals(this,r)};e.prototype.equalsEpsilon=function(r,o){return this===r||O(r)&&Math.abs(this.red-r.red)<=o&&Math.abs(this.green-r.green)<=o&&Math.abs(this.blue-r.blue)<=o&&Math.abs(this.alpha-r.alpha)<=o};e.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};e.prototype.toCssColorString=function(){let r=e.floatToByte(this.red),o=e.floatToByte(this.green),t=e.floatToByte(this.blue);return this.alpha===1?`rgb(${r},${o},${t})`:`rgba(${r},${o},${t},${this.alpha})`};e.prototype.toCssHexString=function(){let r=e.floatToByte(this.red).toString(16);r.length<2&&(r=`0${r}`);let o=e.floatToByte(this.green).toString(16);o.length<2&&(o=`0${o}`);let t=e.floatToByte(this.blue).toString(16);if(t.length<2&&(t=`0${t}`),this.alpha<1){let f=e.floatToByte(this.alpha).toString(16);return f.length<2&&(f=`0${f}`),`#${r}${o}${t}${f}`}return`#${r}${o}${t}`};e.prototype.toBytes=function(r){let o=e.floatToByte(this.red),t=e.floatToByte(this.green),f=e.floatToByte(this.blue),s=e.floatToByte(this.alpha);return O(r)?(r[0]=o,r[1]=t,r[2]=f,r[3]=s,r):[o,t,f,s]};e.prototype.toRgba=function(){return m[0]=e.floatToByte(this.red),m[1]=e.floatToByte(this.green),m[2]=e.floatToByte(this.blue),m[3]=e.floatToByte(this.alpha),g[0]};e.prototype.brighten=function(r,o){return n.typeOf.number("magnitude",r),n.typeOf.number.greaterThanOrEquals("magnitude",r,0),n.typeOf.object("result",o),r=1-r,o.red=1-(1-this.red)*r,o.green=1-(1-this.green)*r,o.blue=1-(1-this.blue)*r,o.alpha=this.alpha,o};e.prototype.darken=function(r,o){return n.typeOf.number("magnitude",r),n.typeOf.number.greaterThanOrEquals("magnitude",r,0),n.typeOf.object("result",o),r=1-r,o.red=this.red*r,o.green=this.green*r,o.blue=this.blue*r,o.alpha=this.alpha,o};e.prototype.withAlpha=function(r,o){return e.fromAlpha(this,r,o)};e.add=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red+o.red,t.green=r.green+o.green,t.blue=r.blue+o.blue,t.alpha=r.alpha+o.alpha,t};e.subtract=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red-o.red,t.green=r.green-o.green,t.blue=r.blue-o.blue,t.alpha=r.alpha-o.alpha,t};e.multiply=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red*o.red,t.green=r.green*o.green,t.blue=r.blue*o.blue,t.alpha=r.alpha*o.alpha,t};e.divide=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red/o.red,t.green=r.green/o.green,t.blue=r.blue/o.blue,t.alpha=r.alpha/o.alpha,t};e.mod=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red%o.red,t.green=r.green%o.green,t.blue=r.blue%o.blue,t.alpha=r.alpha%o.alpha,t};e.lerp=function(r,o,t,f){return n.typeOf.object("start",r),n.typeOf.object("end",o),n.typeOf.number("t",t),n.typeOf.object("result",f),f.red=E.lerp(r.red,o.red,t),f.green=E.lerp(r.green,o.green,t),f.blue=E.lerp(r.blue,o.blue,t),f.alpha=E.lerp(r.alpha,o.alpha,t),f};e.multiplyByScalar=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("scalar",o),n.typeOf.object("result",t),t.red=r.red*o,t.green=r.green*o,t.blue=r.blue*o,t.alpha=r.alpha*o,t};e.divideByScalar=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("scalar",o),n.typeOf.object("result",t),t.red=r.red/o,t.green=r.green/o,t.blue=r.blue/o,t.alpha=r.alpha/o,t};e.ALICEBLUE=Object.freeze(e.fromCssColorString("#F0F8FF"));e.ANTIQUEWHITE=Object.freeze(e.fromCssColorString("#FAEBD7"));e.AQUA=Object.freeze(e.fromCssColorString("#00FFFF"));e.AQUAMARINE=Object.freeze(e.fromCssColorString("#7FFFD4"));e.AZURE=Object.freeze(e.fromCssColorString("#F0FFFF"));e.BEIGE=Object.freeze(e.fromCssColorString("#F5F5DC"));e.BISQUE=Object.freeze(e.fromCssColorString("#FFE4C4"));e.BLACK=Object.freeze(e.fromCssColorString("#000000"));e.BLANCHEDALMOND=Object.freeze(e.fromCssColorString("#FFEBCD"));e.BLUE=Object.freeze(e.fromCssColorString("#0000FF"));e.BLUEVIOLET=Object.freeze(e.fromCssColorString("#8A2BE2"));e.BROWN=Object.freeze(e.fromCssColorString("#A52A2A"));e.BURLYWOOD=Object.freeze(e.fromCssColorString("#DEB887"));e.CADETBLUE=Object.freeze(e.fromCssColorString("#5F9EA0"));e.CHARTREUSE=Object.freeze(e.fromCssColorString("#7FFF00"));e.CHOCOLATE=Object.freeze(e.fromCssColorString("#D2691E"));e.CORAL=Object.freeze(e.fromCssColorString("#FF7F50"));e.CORNFLOWERBLUE=Object.freeze(e.fromCssColorString("#6495ED"));e.CORNSILK=Object.freeze(e.fromCssColorString("#FFF8DC"));e.CRIMSON=Object.freeze(e.fromCssColorString("#DC143C"));e.CYAN=Object.freeze(e.fromCssColorString("#00FFFF"));e.DARKBLUE=Object.freeze(e.fromCssColorString("#00008B"));e.DARKCYAN=Object.freeze(e.fromCssColorString("#008B8B"));e.DARKGOLDENROD=Object.freeze(e.fromCssColorString("#B8860B"));e.DARKGRAY=Object.freeze(e.fromCssColorString("#A9A9A9"));e.DARKGREEN=Object.freeze(e.fromCssColorString("#006400"));e.DARKGREY=e.DARKGRAY;e.DARKKHAKI=Object.freeze(e.fromCssColorString("#BDB76B"));e.DARKMAGENTA=Object.freeze(e.fromCssColorString("#8B008B"));e.DARKOLIVEGREEN=Object.freeze(e.fromCssColorString("#556B2F"));e.DARKORANGE=Object.freeze(e.fromCssColorString("#FF8C00"));e.DARKORCHID=Object.freeze(e.fromCssColorString("#9932CC"));e.DARKRED=Object.freeze(e.fromCssColorString("#8B0000"));e.DARKSALMON=Object.freeze(e.fromCssColorString("#E9967A"));e.DARKSEAGREEN=Object.freeze(e.fromCssColorString("#8FBC8F"));e.DARKSLATEBLUE=Object.freeze(e.fromCssColorString("#483D8B"));e.DARKSLATEGRAY=Object.freeze(e.fromCssColorString("#2F4F4F"));e.DARKSLATEGREY=e.DARKSLATEGRAY;e.DARKTURQUOISE=Object.freeze(e.fromCssColorString("#00CED1"));e.DARKVIOLET=Object.freeze(e.fromCssColorString("#9400D3"));e.DEEPPINK=Object.freeze(e.fromCssColorString("#FF1493"));e.DEEPSKYBLUE=Object.freeze(e.fromCssColorString("#00BFFF"));e.DIMGRAY=Object.freeze(e.fromCssColorString("#696969"));e.DIMGREY=e.DIMGRAY;e.DODGERBLUE=Object.freeze(e.fromCssColorString("#1E90FF"));e.FIREBRICK=Object.freeze(e.fromCssColorString("#B22222"));e.FLORALWHITE=Object.freeze(e.fromCssColorString("#FFFAF0"));e.FORESTGREEN=Object.freeze(e.fromCssColorString("#228B22"));e.FUCHSIA=Object.freeze(e.fromCssColorString("#FF00FF"));e.GAINSBORO=Object.freeze(e.fromCssColorString("#DCDCDC"));e.GHOSTWHITE=Object.freeze(e.fromCssColorString("#F8F8FF"));e.GOLD=Object.freeze(e.fromCssColorString("#FFD700"));e.GOLDENROD=Object.freeze(e.fromCssColorString("#DAA520"));e.GRAY=Object.freeze(e.fromCssColorString("#808080"));e.GREEN=Object.freeze(e.fromCssColorString("#008000"));e.GREENYELLOW=Object.freeze(e.fromCssColorString("#ADFF2F"));e.GREY=e.GRAY;e.HONEYDEW=Object.freeze(e.fromCssColorString("#F0FFF0"));e.HOTPINK=Object.freeze(e.fromCssColorString("#FF69B4"));e.INDIANRED=Object.freeze(e.fromCssColorString("#CD5C5C"));e.INDIGO=Object.freeze(e.fromCssColorString("#4B0082"));e.IVORY=Object.freeze(e.fromCssColorString("#FFFFF0"));e.KHAKI=Object.freeze(e.fromCssColorString("#F0E68C"));e.LAVENDER=Object.freeze(e.fromCssColorString("#E6E6FA"));e.LAVENDAR_BLUSH=Object.freeze(e.fromCssColorString("#FFF0F5"));e.LAWNGREEN=Object.freeze(e.fromCssColorString("#7CFC00"));e.LEMONCHIFFON=Object.freeze(e.fromCssColorString("#FFFACD"));e.LIGHTBLUE=Object.freeze(e.fromCssColorString("#ADD8E6"));e.LIGHTCORAL=Object.freeze(e.fromCssColorString("#F08080"));e.LIGHTCYAN=Object.freeze(e.fromCssColorString("#E0FFFF"));e.LIGHTGOLDENRODYELLOW=Object.freeze(e.fromCssColorString("#FAFAD2"));e.LIGHTGRAY=Object.freeze(e.fromCssColorString("#D3D3D3"));e.LIGHTGREEN=Object.freeze(e.fromCssColorString("#90EE90"));e.LIGHTGREY=e.LIGHTGRAY;e.LIGHTPINK=Object.freeze(e.fromCssColorString("#FFB6C1"));e.LIGHTSEAGREEN=Object.freeze(e.fromCssColorString("#20B2AA"));e.LIGHTSKYBLUE=Object.freeze(e.fromCssColorString("#87CEFA"));e.LIGHTSLATEGRAY=Object.freeze(e.fromCssColorString("#778899"));e.LIGHTSLATEGREY=e.LIGHTSLATEGRAY;e.LIGHTSTEELBLUE=Object.freeze(e.fromCssColorString("#B0C4DE"));e.LIGHTYELLOW=Object.freeze(e.fromCssColorString("#FFFFE0"));e.LIME=Object.freeze(e.fromCssColorString("#00FF00"));e.LIMEGREEN=Object.freeze(e.fromCssColorString("#32CD32"));e.LINEN=Object.freeze(e.fromCssColorString("#FAF0E6"));e.MAGENTA=Object.freeze(e.fromCssColorString("#FF00FF"));e.MAROON=Object.freeze(e.fromCssColorString("#800000"));e.MEDIUMAQUAMARINE=Object.freeze(e.fromCssColorString("#66CDAA"));e.MEDIUMBLUE=Object.freeze(e.fromCssColorString("#0000CD"));e.MEDIUMORCHID=Object.freeze(e.fromCssColorString("#BA55D3"));e.MEDIUMPURPLE=Object.freeze(e.fromCssColorString("#9370DB"));e.MEDIUMSEAGREEN=Object.freeze(e.fromCssColorString("#3CB371"));e.MEDIUMSLATEBLUE=Object.freeze(e.fromCssColorString("#7B68EE"));e.MEDIUMSPRINGGREEN=Object.freeze(e.fromCssColorString("#00FA9A"));e.MEDIUMTURQUOISE=Object.freeze(e.fromCssColorString("#48D1CC"));e.MEDIUMVIOLETRED=Object.freeze(e.fromCssColorString("#C71585"));e.MIDNIGHTBLUE=Object.freeze(e.fromCssColorString("#191970"));e.MINTCREAM=Object.freeze(e.fromCssColorString("#F5FFFA"));e.MISTYROSE=Object.freeze(e.fromCssColorString("#FFE4E1"));e.MOCCASIN=Object.freeze(e.fromCssColorString("#FFE4B5"));e.NAVAJOWHITE=Object.freeze(e.fromCssColorString("#FFDEAD"));e.NAVY=Object.freeze(e.fromCssColorString("#000080"));e.OLDLACE=Object.freeze(e.fromCssColorString("#FDF5E6"));e.OLIVE=Object.freeze(e.fromCssColorString("#808000"));e.OLIVEDRAB=Object.freeze(e.fromCssColorString("#6B8E23"));e.ORANGE=Object.freeze(e.fromCssColorString("#FFA500"));e.ORANGERED=Object.freeze(e.fromCssColorString("#FF4500"));e.ORCHID=Object.freeze(e.fromCssColorString("#DA70D6"));e.PALEGOLDENROD=Object.freeze(e.fromCssColorString("#EEE8AA"));e.PALEGREEN=Object.freeze(e.fromCssColorString("#98FB98"));e.PALETURQUOISE=Object.freeze(e.fromCssColorString("#AFEEEE"));e.PALEVIOLETRED=Object.freeze(e.fromCssColorString("#DB7093"));e.PAPAYAWHIP=Object.freeze(e.fromCssColorString("#FFEFD5"));e.PEACHPUFF=Object.freeze(e.fromCssColorString("#FFDAB9"));e.PERU=Object.freeze(e.fromCssColorString("#CD853F"));e.PINK=Object.freeze(e.fromCssColorString("#FFC0CB"));e.PLUM=Object.freeze(e.fromCssColorString("#DDA0DD"));e.POWDERBLUE=Object.freeze(e.fromCssColorString("#B0E0E6"));e.PURPLE=Object.freeze(e.fromCssColorString("#800080"));e.RED=Object.freeze(e.fromCssColorString("#FF0000"));e.ROSYBROWN=Object.freeze(e.fromCssColorString("#BC8F8F"));e.ROYALBLUE=Object.freeze(e.fromCssColorString("#4169E1"));e.SADDLEBROWN=Object.freeze(e.fromCssColorString("#8B4513"));e.SALMON=Object.freeze(e.fromCssColorString("#FA8072"));e.SANDYBROWN=Object.freeze(e.fromCssColorString("#F4A460"));e.SEAGREEN=Object.freeze(e.fromCssColorString("#2E8B57"));e.SEASHELL=Object.freeze(e.fromCssColorString("#FFF5EE"));e.SIENNA=Object.freeze(e.fromCssColorString("#A0522D"));e.SILVER=Object.freeze(e.fromCssColorString("#C0C0C0"));e.SKYBLUE=Object.freeze(e.fromCssColorString("#87CEEB"));e.SLATEBLUE=Object.freeze(e.fromCssColorString("#6A5ACD"));e.SLATEGRAY=Object.freeze(e.fromCssColorString("#708090"));e.SLATEGREY=e.SLATEGRAY;e.SNOW=Object.freeze(e.fromCssColorString("#FFFAFA"));e.SPRINGGREEN=Object.freeze(e.fromCssColorString("#00FF7F"));e.STEELBLUE=Object.freeze(e.fromCssColorString("#4682B4"));e.TAN=Object.freeze(e.fromCssColorString("#D2B48C"));e.TEAL=Object.freeze(e.fromCssColorString("#008080"));e.THISTLE=Object.freeze(e.fromCssColorString("#D8BFD8"));e.TOMATO=Object.freeze(e.fromCssColorString("#FF6347"));e.TURQUOISE=Object.freeze(e.fromCssColorString("#40E0D0"));e.VIOLET=Object.freeze(e.fromCssColorString("#EE82EE"));e.WHEAT=Object.freeze(e.fromCssColorString("#F5DEB3"));e.WHITE=Object.freeze(e.fromCssColorString("#FFFFFF"));e.WHITESMOKE=Object.freeze(e.fromCssColorString("#F5F5F5"));e.YELLOW=Object.freeze(e.fromCssColorString("#FFFF00"));e.YELLOWGREEN=Object.freeze(e.fromCssColorString("#9ACD32"));e.TRANSPARENT=Object.freeze(new e(0,0,0,0));var h=e;export{h as a}; +import{f as j}from"./chunk-RH3GFHG2.js";import{a as E}from"./chunk-FRWNWNYJ.js";import{a as C}from"./chunk-TA3RE4KQ.js";import{b as n}from"./chunk-RTY3VPG6.js";import{e as O}from"./chunk-LRNH5AEO.js";function l(r,o,t){return t<0&&(t+=1),t>1&&(t-=1),t*6<1?r+(o-r)*6*t:t*2<1?o:t*3<2?r+(o-r)*(2/3-t)*6:r}function e(r,o,t,f){this.red=C(r,1),this.green=C(o,1),this.blue=C(t,1),this.alpha=C(f,1)}e.fromCartesian4=function(r,o){return n.typeOf.object("cartesian",r),O(o)?(o.red=r.x,o.green=r.y,o.blue=r.z,o.alpha=r.w,o):new e(r.x,r.y,r.z,r.w)};e.fromBytes=function(r,o,t,f,s){return r=e.byteToFloat(C(r,255)),o=e.byteToFloat(C(o,255)),t=e.byteToFloat(C(t,255)),f=e.byteToFloat(C(f,255)),O(s)?(s.red=r,s.green=o,s.blue=t,s.alpha=f,s):new e(r,o,t,f)};e.fromAlpha=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("alpha",o),O(t)?(t.red=r.red,t.green=r.green,t.blue=r.blue,t.alpha=o,t):new e(r.red,r.green,r.blue,o)};var A,g,m;j.supportsTypedArrays()&&(A=new ArrayBuffer(4),g=new Uint32Array(A),m=new Uint8Array(A));e.fromRgba=function(r,o){return g[0]=r,e.fromBytes(m[0],m[1],m[2],m[3],o)};e.fromHsl=function(r,o,t,f,s){r=C(r,0)%1,o=C(o,0),t=C(t,0),f=C(f,1);let c=t,b=t,i=t;if(o!==0){let S;t<.5?S=t*(1+o):S=t+o-t*o;let F=2*t-S;c=l(F,S,r+1/3),b=l(F,S,r),i=l(F,S,r-1/3)}return O(s)?(s.red=c,s.green=b,s.blue=i,s.alpha=f,s):new e(c,b,i,f)};e.fromRandom=function(r,o){r=C(r,C.EMPTY_OBJECT);let t=r.red;if(!O(t)){let b=C(r.minimumRed,0),i=C(r.maximumRed,1);n.typeOf.number.lessThanOrEquals("minimumRed",b,i),t=b+E.nextRandomNumber()*(i-b)}let f=r.green;if(!O(f)){let b=C(r.minimumGreen,0),i=C(r.maximumGreen,1);n.typeOf.number.lessThanOrEquals("minimumGreen",b,i),f=b+E.nextRandomNumber()*(i-b)}let s=r.blue;if(!O(s)){let b=C(r.minimumBlue,0),i=C(r.maximumBlue,1);n.typeOf.number.lessThanOrEquals("minimumBlue",b,i),s=b+E.nextRandomNumber()*(i-b)}let c=r.alpha;if(!O(c)){let b=C(r.minimumAlpha,0),i=C(r.maximumAlpha,1);n.typeOf.number.lessThanOrEquals("minimumAlpha",b,i),c=b+E.nextRandomNumber()*(i-b)}return O(o)?(o.red=t,o.green=f,o.blue=s,o.alpha=c,o):new e(t,f,s,c)};var a=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,z=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,p=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;e.fromCssColorString=function(r,o){n.typeOf.string("color",r),O(o)||(o=new e),r=r.trim();let t=e[r.toUpperCase()];if(O(t))return e.clone(t,o),o;let f=a.exec(r);return f!==null?(o.red=parseInt(f[1],16)/15,o.green=parseInt(f[2],16)/15,o.blue=parseInt(f[3],16)/15,o.alpha=parseInt(C(f[4],"f"),16)/15,o):(f=z.exec(r),f!==null?(o.red=parseInt(f[1],16)/255,o.green=parseInt(f[2],16)/255,o.blue=parseInt(f[3],16)/255,o.alpha=parseInt(C(f[4],"ff"),16)/255,o):(f=p.exec(r),f!==null?(o.red=parseFloat(f[1])/(f[1].substr(-1)==="%"?100:255),o.green=parseFloat(f[2])/(f[2].substr(-1)==="%"?100:255),o.blue=parseFloat(f[3])/(f[3].substr(-1)==="%"?100:255),o.alpha=parseFloat(C(f[4],"1.0")),o):(f=R.exec(r),f!==null?e.fromHsl(parseFloat(f[1])/360,parseFloat(f[2])/100,parseFloat(f[3])/100,parseFloat(C(f[4],"1.0")),o):(o=void 0,o))))};e.packedLength=4;e.pack=function(r,o,t){return n.typeOf.object("value",r),n.defined("array",o),t=C(t,0),o[t++]=r.red,o[t++]=r.green,o[t++]=r.blue,o[t]=r.alpha,o};e.unpack=function(r,o,t){return n.defined("array",r),o=C(o,0),O(t)||(t=new e),t.red=r[o++],t.green=r[o++],t.blue=r[o++],t.alpha=r[o],t};e.byteToFloat=function(r){return r/255};e.floatToByte=function(r){return r===1?255:r*256|0};e.clone=function(r,o){if(O(r))return O(o)?(o.red=r.red,o.green=r.green,o.blue=r.blue,o.alpha=r.alpha,o):new e(r.red,r.green,r.blue,r.alpha)};e.equals=function(r,o){return r===o||O(r)&&O(o)&&r.red===o.red&&r.green===o.green&&r.blue===o.blue&&r.alpha===o.alpha};e.equalsArray=function(r,o,t){return r.red===o[t]&&r.green===o[t+1]&&r.blue===o[t+2]&&r.alpha===o[t+3]};e.prototype.clone=function(r){return e.clone(this,r)};e.prototype.equals=function(r){return e.equals(this,r)};e.prototype.equalsEpsilon=function(r,o){return this===r||O(r)&&Math.abs(this.red-r.red)<=o&&Math.abs(this.green-r.green)<=o&&Math.abs(this.blue-r.blue)<=o&&Math.abs(this.alpha-r.alpha)<=o};e.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};e.prototype.toCssColorString=function(){let r=e.floatToByte(this.red),o=e.floatToByte(this.green),t=e.floatToByte(this.blue);return this.alpha===1?`rgb(${r},${o},${t})`:`rgba(${r},${o},${t},${this.alpha})`};e.prototype.toCssHexString=function(){let r=e.floatToByte(this.red).toString(16);r.length<2&&(r=`0${r}`);let o=e.floatToByte(this.green).toString(16);o.length<2&&(o=`0${o}`);let t=e.floatToByte(this.blue).toString(16);if(t.length<2&&(t=`0${t}`),this.alpha<1){let f=e.floatToByte(this.alpha).toString(16);return f.length<2&&(f=`0${f}`),`#${r}${o}${t}${f}`}return`#${r}${o}${t}`};e.prototype.toBytes=function(r){let o=e.floatToByte(this.red),t=e.floatToByte(this.green),f=e.floatToByte(this.blue),s=e.floatToByte(this.alpha);return O(r)?(r[0]=o,r[1]=t,r[2]=f,r[3]=s,r):[o,t,f,s]};e.prototype.toRgba=function(){return m[0]=e.floatToByte(this.red),m[1]=e.floatToByte(this.green),m[2]=e.floatToByte(this.blue),m[3]=e.floatToByte(this.alpha),g[0]};e.prototype.brighten=function(r,o){return n.typeOf.number("magnitude",r),n.typeOf.number.greaterThanOrEquals("magnitude",r,0),n.typeOf.object("result",o),r=1-r,o.red=1-(1-this.red)*r,o.green=1-(1-this.green)*r,o.blue=1-(1-this.blue)*r,o.alpha=this.alpha,o};e.prototype.darken=function(r,o){return n.typeOf.number("magnitude",r),n.typeOf.number.greaterThanOrEquals("magnitude",r,0),n.typeOf.object("result",o),r=1-r,o.red=this.red*r,o.green=this.green*r,o.blue=this.blue*r,o.alpha=this.alpha,o};e.prototype.withAlpha=function(r,o){return e.fromAlpha(this,r,o)};e.add=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red+o.red,t.green=r.green+o.green,t.blue=r.blue+o.blue,t.alpha=r.alpha+o.alpha,t};e.subtract=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red-o.red,t.green=r.green-o.green,t.blue=r.blue-o.blue,t.alpha=r.alpha-o.alpha,t};e.multiply=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red*o.red,t.green=r.green*o.green,t.blue=r.blue*o.blue,t.alpha=r.alpha*o.alpha,t};e.divide=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red/o.red,t.green=r.green/o.green,t.blue=r.blue/o.blue,t.alpha=r.alpha/o.alpha,t};e.mod=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red%o.red,t.green=r.green%o.green,t.blue=r.blue%o.blue,t.alpha=r.alpha%o.alpha,t};e.lerp=function(r,o,t,f){return n.typeOf.object("start",r),n.typeOf.object("end",o),n.typeOf.number("t",t),n.typeOf.object("result",f),f.red=E.lerp(r.red,o.red,t),f.green=E.lerp(r.green,o.green,t),f.blue=E.lerp(r.blue,o.blue,t),f.alpha=E.lerp(r.alpha,o.alpha,t),f};e.multiplyByScalar=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("scalar",o),n.typeOf.object("result",t),t.red=r.red*o,t.green=r.green*o,t.blue=r.blue*o,t.alpha=r.alpha*o,t};e.divideByScalar=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("scalar",o),n.typeOf.object("result",t),t.red=r.red/o,t.green=r.green/o,t.blue=r.blue/o,t.alpha=r.alpha/o,t};e.ALICEBLUE=Object.freeze(e.fromCssColorString("#F0F8FF"));e.ANTIQUEWHITE=Object.freeze(e.fromCssColorString("#FAEBD7"));e.AQUA=Object.freeze(e.fromCssColorString("#00FFFF"));e.AQUAMARINE=Object.freeze(e.fromCssColorString("#7FFFD4"));e.AZURE=Object.freeze(e.fromCssColorString("#F0FFFF"));e.BEIGE=Object.freeze(e.fromCssColorString("#F5F5DC"));e.BISQUE=Object.freeze(e.fromCssColorString("#FFE4C4"));e.BLACK=Object.freeze(e.fromCssColorString("#000000"));e.BLANCHEDALMOND=Object.freeze(e.fromCssColorString("#FFEBCD"));e.BLUE=Object.freeze(e.fromCssColorString("#0000FF"));e.BLUEVIOLET=Object.freeze(e.fromCssColorString("#8A2BE2"));e.BROWN=Object.freeze(e.fromCssColorString("#A52A2A"));e.BURLYWOOD=Object.freeze(e.fromCssColorString("#DEB887"));e.CADETBLUE=Object.freeze(e.fromCssColorString("#5F9EA0"));e.CHARTREUSE=Object.freeze(e.fromCssColorString("#7FFF00"));e.CHOCOLATE=Object.freeze(e.fromCssColorString("#D2691E"));e.CORAL=Object.freeze(e.fromCssColorString("#FF7F50"));e.CORNFLOWERBLUE=Object.freeze(e.fromCssColorString("#6495ED"));e.CORNSILK=Object.freeze(e.fromCssColorString("#FFF8DC"));e.CRIMSON=Object.freeze(e.fromCssColorString("#DC143C"));e.CYAN=Object.freeze(e.fromCssColorString("#00FFFF"));e.DARKBLUE=Object.freeze(e.fromCssColorString("#00008B"));e.DARKCYAN=Object.freeze(e.fromCssColorString("#008B8B"));e.DARKGOLDENROD=Object.freeze(e.fromCssColorString("#B8860B"));e.DARKGRAY=Object.freeze(e.fromCssColorString("#A9A9A9"));e.DARKGREEN=Object.freeze(e.fromCssColorString("#006400"));e.DARKGREY=e.DARKGRAY;e.DARKKHAKI=Object.freeze(e.fromCssColorString("#BDB76B"));e.DARKMAGENTA=Object.freeze(e.fromCssColorString("#8B008B"));e.DARKOLIVEGREEN=Object.freeze(e.fromCssColorString("#556B2F"));e.DARKORANGE=Object.freeze(e.fromCssColorString("#FF8C00"));e.DARKORCHID=Object.freeze(e.fromCssColorString("#9932CC"));e.DARKRED=Object.freeze(e.fromCssColorString("#8B0000"));e.DARKSALMON=Object.freeze(e.fromCssColorString("#E9967A"));e.DARKSEAGREEN=Object.freeze(e.fromCssColorString("#8FBC8F"));e.DARKSLATEBLUE=Object.freeze(e.fromCssColorString("#483D8B"));e.DARKSLATEGRAY=Object.freeze(e.fromCssColorString("#2F4F4F"));e.DARKSLATEGREY=e.DARKSLATEGRAY;e.DARKTURQUOISE=Object.freeze(e.fromCssColorString("#00CED1"));e.DARKVIOLET=Object.freeze(e.fromCssColorString("#9400D3"));e.DEEPPINK=Object.freeze(e.fromCssColorString("#FF1493"));e.DEEPSKYBLUE=Object.freeze(e.fromCssColorString("#00BFFF"));e.DIMGRAY=Object.freeze(e.fromCssColorString("#696969"));e.DIMGREY=e.DIMGRAY;e.DODGERBLUE=Object.freeze(e.fromCssColorString("#1E90FF"));e.FIREBRICK=Object.freeze(e.fromCssColorString("#B22222"));e.FLORALWHITE=Object.freeze(e.fromCssColorString("#FFFAF0"));e.FORESTGREEN=Object.freeze(e.fromCssColorString("#228B22"));e.FUCHSIA=Object.freeze(e.fromCssColorString("#FF00FF"));e.GAINSBORO=Object.freeze(e.fromCssColorString("#DCDCDC"));e.GHOSTWHITE=Object.freeze(e.fromCssColorString("#F8F8FF"));e.GOLD=Object.freeze(e.fromCssColorString("#FFD700"));e.GOLDENROD=Object.freeze(e.fromCssColorString("#DAA520"));e.GRAY=Object.freeze(e.fromCssColorString("#808080"));e.GREEN=Object.freeze(e.fromCssColorString("#008000"));e.GREENYELLOW=Object.freeze(e.fromCssColorString("#ADFF2F"));e.GREY=e.GRAY;e.HONEYDEW=Object.freeze(e.fromCssColorString("#F0FFF0"));e.HOTPINK=Object.freeze(e.fromCssColorString("#FF69B4"));e.INDIANRED=Object.freeze(e.fromCssColorString("#CD5C5C"));e.INDIGO=Object.freeze(e.fromCssColorString("#4B0082"));e.IVORY=Object.freeze(e.fromCssColorString("#FFFFF0"));e.KHAKI=Object.freeze(e.fromCssColorString("#F0E68C"));e.LAVENDER=Object.freeze(e.fromCssColorString("#E6E6FA"));e.LAVENDAR_BLUSH=Object.freeze(e.fromCssColorString("#FFF0F5"));e.LAWNGREEN=Object.freeze(e.fromCssColorString("#7CFC00"));e.LEMONCHIFFON=Object.freeze(e.fromCssColorString("#FFFACD"));e.LIGHTBLUE=Object.freeze(e.fromCssColorString("#ADD8E6"));e.LIGHTCORAL=Object.freeze(e.fromCssColorString("#F08080"));e.LIGHTCYAN=Object.freeze(e.fromCssColorString("#E0FFFF"));e.LIGHTGOLDENRODYELLOW=Object.freeze(e.fromCssColorString("#FAFAD2"));e.LIGHTGRAY=Object.freeze(e.fromCssColorString("#D3D3D3"));e.LIGHTGREEN=Object.freeze(e.fromCssColorString("#90EE90"));e.LIGHTGREY=e.LIGHTGRAY;e.LIGHTPINK=Object.freeze(e.fromCssColorString("#FFB6C1"));e.LIGHTSEAGREEN=Object.freeze(e.fromCssColorString("#20B2AA"));e.LIGHTSKYBLUE=Object.freeze(e.fromCssColorString("#87CEFA"));e.LIGHTSLATEGRAY=Object.freeze(e.fromCssColorString("#778899"));e.LIGHTSLATEGREY=e.LIGHTSLATEGRAY;e.LIGHTSTEELBLUE=Object.freeze(e.fromCssColorString("#B0C4DE"));e.LIGHTYELLOW=Object.freeze(e.fromCssColorString("#FFFFE0"));e.LIME=Object.freeze(e.fromCssColorString("#00FF00"));e.LIMEGREEN=Object.freeze(e.fromCssColorString("#32CD32"));e.LINEN=Object.freeze(e.fromCssColorString("#FAF0E6"));e.MAGENTA=Object.freeze(e.fromCssColorString("#FF00FF"));e.MAROON=Object.freeze(e.fromCssColorString("#800000"));e.MEDIUMAQUAMARINE=Object.freeze(e.fromCssColorString("#66CDAA"));e.MEDIUMBLUE=Object.freeze(e.fromCssColorString("#0000CD"));e.MEDIUMORCHID=Object.freeze(e.fromCssColorString("#BA55D3"));e.MEDIUMPURPLE=Object.freeze(e.fromCssColorString("#9370DB"));e.MEDIUMSEAGREEN=Object.freeze(e.fromCssColorString("#3CB371"));e.MEDIUMSLATEBLUE=Object.freeze(e.fromCssColorString("#7B68EE"));e.MEDIUMSPRINGGREEN=Object.freeze(e.fromCssColorString("#00FA9A"));e.MEDIUMTURQUOISE=Object.freeze(e.fromCssColorString("#48D1CC"));e.MEDIUMVIOLETRED=Object.freeze(e.fromCssColorString("#C71585"));e.MIDNIGHTBLUE=Object.freeze(e.fromCssColorString("#191970"));e.MINTCREAM=Object.freeze(e.fromCssColorString("#F5FFFA"));e.MISTYROSE=Object.freeze(e.fromCssColorString("#FFE4E1"));e.MOCCASIN=Object.freeze(e.fromCssColorString("#FFE4B5"));e.NAVAJOWHITE=Object.freeze(e.fromCssColorString("#FFDEAD"));e.NAVY=Object.freeze(e.fromCssColorString("#000080"));e.OLDLACE=Object.freeze(e.fromCssColorString("#FDF5E6"));e.OLIVE=Object.freeze(e.fromCssColorString("#808000"));e.OLIVEDRAB=Object.freeze(e.fromCssColorString("#6B8E23"));e.ORANGE=Object.freeze(e.fromCssColorString("#FFA500"));e.ORANGERED=Object.freeze(e.fromCssColorString("#FF4500"));e.ORCHID=Object.freeze(e.fromCssColorString("#DA70D6"));e.PALEGOLDENROD=Object.freeze(e.fromCssColorString("#EEE8AA"));e.PALEGREEN=Object.freeze(e.fromCssColorString("#98FB98"));e.PALETURQUOISE=Object.freeze(e.fromCssColorString("#AFEEEE"));e.PALEVIOLETRED=Object.freeze(e.fromCssColorString("#DB7093"));e.PAPAYAWHIP=Object.freeze(e.fromCssColorString("#FFEFD5"));e.PEACHPUFF=Object.freeze(e.fromCssColorString("#FFDAB9"));e.PERU=Object.freeze(e.fromCssColorString("#CD853F"));e.PINK=Object.freeze(e.fromCssColorString("#FFC0CB"));e.PLUM=Object.freeze(e.fromCssColorString("#DDA0DD"));e.POWDERBLUE=Object.freeze(e.fromCssColorString("#B0E0E6"));e.PURPLE=Object.freeze(e.fromCssColorString("#800080"));e.RED=Object.freeze(e.fromCssColorString("#FF0000"));e.ROSYBROWN=Object.freeze(e.fromCssColorString("#BC8F8F"));e.ROYALBLUE=Object.freeze(e.fromCssColorString("#4169E1"));e.SADDLEBROWN=Object.freeze(e.fromCssColorString("#8B4513"));e.SALMON=Object.freeze(e.fromCssColorString("#FA8072"));e.SANDYBROWN=Object.freeze(e.fromCssColorString("#F4A460"));e.SEAGREEN=Object.freeze(e.fromCssColorString("#2E8B57"));e.SEASHELL=Object.freeze(e.fromCssColorString("#FFF5EE"));e.SIENNA=Object.freeze(e.fromCssColorString("#A0522D"));e.SILVER=Object.freeze(e.fromCssColorString("#C0C0C0"));e.SKYBLUE=Object.freeze(e.fromCssColorString("#87CEEB"));e.SLATEBLUE=Object.freeze(e.fromCssColorString("#6A5ACD"));e.SLATEGRAY=Object.freeze(e.fromCssColorString("#708090"));e.SLATEGREY=e.SLATEGRAY;e.SNOW=Object.freeze(e.fromCssColorString("#FFFAFA"));e.SPRINGGREEN=Object.freeze(e.fromCssColorString("#00FF7F"));e.STEELBLUE=Object.freeze(e.fromCssColorString("#4682B4"));e.TAN=Object.freeze(e.fromCssColorString("#D2B48C"));e.TEAL=Object.freeze(e.fromCssColorString("#008080"));e.THISTLE=Object.freeze(e.fromCssColorString("#D8BFD8"));e.TOMATO=Object.freeze(e.fromCssColorString("#FF6347"));e.TURQUOISE=Object.freeze(e.fromCssColorString("#40E0D0"));e.VIOLET=Object.freeze(e.fromCssColorString("#EE82EE"));e.WHEAT=Object.freeze(e.fromCssColorString("#F5DEB3"));e.WHITE=Object.freeze(e.fromCssColorString("#FFFFFF"));e.WHITESMOKE=Object.freeze(e.fromCssColorString("#F5F5F5"));e.YELLOW=Object.freeze(e.fromCssColorString("#FFFF00"));e.YELLOWGREEN=Object.freeze(e.fromCssColorString("#9ACD32"));e.TRANSPARENT=Object.freeze(new e(0,0,0,0));var h=e;export{h as a}; diff --git a/public/js/Cesium2/Workers/chunk-UJMUN4NO.js b/public/js/Cesium2/Workers/chunk-HMHR6SIB.js similarity index 86% rename from public/js/Cesium2/Workers/chunk-UJMUN4NO.js rename to public/js/Cesium2/Workers/chunk-HMHR6SIB.js index 827546b0c..87995ce5e 100644 --- a/public/js/Cesium2/Workers/chunk-UJMUN4NO.js +++ b/public/js/Cesium2/Workers/chunk-HMHR6SIB.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as c,b as p,d as f}from"./chunk-S4VBGY2U.js";import{a as d}from"./chunk-UCTPWOTZ.js";import{a as u}from"./chunk-N3A5CZ2S.js";import{a as s}from"./chunk-G75U3WZT.js";import{e as a}from"./chunk-3THTQ4QB.js";function e(t){this._ellipsoid=u(t,f.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});e.mercatorAngleToGeodeticLatitude=function(t){return d.PI_OVER_TWO-2*Math.atan(Math.exp(-t))};e.geodeticLatitudeToMercatorAngle=function(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let i=Math.sin(t);return .5*Math.log((1+i)/(1-i))};e.MaximumLatitude=e.mercatorAngleToGeodeticLatitude(Math.PI);e.prototype.project=function(t,i){let o=this._semimajorAxis,r=t.longitude*o,n=e.geodeticLatitudeToMercatorAngle(t.latitude)*o,m=t.height;return a(i)?(i.x=r,i.y=n,i.z=m,i):new c(r,n,m)};e.prototype.unproject=function(t,i){if(!a(t))throw new s("cartesian is required");let o=this._oneOverSemimajorAxis,r=t.x*o,n=e.mercatorAngleToGeodeticLatitude(t.y*o),m=t.z;return a(i)?(i.longitude=r,i.latitude=n,i.height=m,i):new p(r,n,m)};var L=e;export{L as a}; +import{a as c,b as p,d as f}from"./chunk-RH3GFHG2.js";import{a as d}from"./chunk-FRWNWNYJ.js";import{a as u}from"./chunk-TA3RE4KQ.js";import{a as s}from"./chunk-RTY3VPG6.js";import{e as a}from"./chunk-LRNH5AEO.js";function e(t){this._ellipsoid=u(t,f.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});e.mercatorAngleToGeodeticLatitude=function(t){return d.PI_OVER_TWO-2*Math.atan(Math.exp(-t))};e.geodeticLatitudeToMercatorAngle=function(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let i=Math.sin(t);return .5*Math.log((1+i)/(1-i))};e.MaximumLatitude=e.mercatorAngleToGeodeticLatitude(Math.PI);e.prototype.project=function(t,i){let o=this._semimajorAxis,r=t.longitude*o,n=e.geodeticLatitudeToMercatorAngle(t.latitude)*o,m=t.height;return a(i)?(i.x=r,i.y=n,i.z=m,i):new c(r,n,m)};e.prototype.unproject=function(t,i){if(!a(t))throw new s("cartesian is required");let o=this._oneOverSemimajorAxis,r=t.x*o,n=e.mercatorAngleToGeodeticLatitude(t.y*o),m=t.z;return a(i)?(i.longitude=r,i.latitude=n,i.height=m,i):new p(r,n,m)};var L=e;export{L as a}; diff --git a/public/js/Cesium2/Workers/chunk-XSINRSN5.js b/public/js/Cesium2/Workers/chunk-JRKXMAM5.js similarity index 94% rename from public/js/Cesium2/Workers/chunk-XSINRSN5.js rename to public/js/Cesium2/Workers/chunk-JRKXMAM5.js index bb4c5191d..1f4e79499 100644 --- a/public/js/Cesium2/Workers/chunk-XSINRSN5.js +++ b/public/js/Cesium2/Workers/chunk-JRKXMAM5.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as $}from"./chunk-UJMUN4NO.js";import{a as b}from"./chunk-72CGGEJF.js";import{a as U}from"./chunk-34ULWVZF.js";import{a as E}from"./chunk-24JYWT5N.js";import{c as z,d as L}from"./chunk-LH3SUUXG.js";import{a as D,d as y}from"./chunk-K2M3OJ7Z.js";import{b as G}from"./chunk-M3A6SPGI.js";import{a as k}from"./chunk-D5HNP2LB.js";import{d as B}from"./chunk-S4VBGY2U.js";import{a as v}from"./chunk-N3A5CZ2S.js";import{a as F,b as I}from"./chunk-G75U3WZT.js";import{e as a}from"./chunk-3THTQ4QB.js";function w(e,n,t){e=v(e,0),n=v(n,0),t=v(t,0),this.value=new Float32Array([e,n,t])}Object.defineProperties(w.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});w.fromCartesian3=function(e){return I.defined("offset",e),new w(e.x,e.y,e.z)};w.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var j=w;function K(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function P(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new L({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function N(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?P(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(P(i.westHemisphereGeometry,t),P(i.eastHemisphereGeometry,t))}}function Q(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new F("All instance geometries must have the same primitiveType.");if(K(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(N(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function T(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function X(e,n){let t=[];return T(e,"geometry",n,t),T(e,"westHemisphereGeometry",n,t),T(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=Q(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=X(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function Y(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Z(e,n){let t=e.length;for(let i=0;i<t;++i)Y(e[i],n)}function _(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(_(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=v(s.offsetAttribute,-1);let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,H=new E,q=t[o++];for(i=0;i<q;i++){let A=n[t[o++]],M=t[o++];C=t[o++];let J=t[o++]!==0;h=t[o++],x=k.createTypedArray(M,h);for(let O=0;O<h;O++)x[O]=t[o++];H[A]=new L({componentDatatype:M,componentsPerAttribute:C,normalize:J,values:x})}let V;if(h=t[o++],h>0){let A=x.length/C;for(V=U.createTypedArray(A,h),i=0;i<h;i++)V[i]=t[o++]}r[c++]=new z({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:V,attributes:H,offsetAttribute:m})}return r};function ee(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function te(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new j(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:ee(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof D,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=te(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=B.clone(e.ellipsoid),o=e.isGeographic?new D(c):new $(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function R(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function W(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Z(e.geometries,n);let t=R(e.boundingSpheres),i=R(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:W(e.boundingSpheres),boundingSpheresCV:W(e.boundingSpheresCV)}};var Ge=S;export{Ge as a}; +import{a as $}from"./chunk-HMHR6SIB.js";import{a as b}from"./chunk-FG3CL3AH.js";import{a as U}from"./chunk-YFQNY2YN.js";import{a as E}from"./chunk-NT26NNVH.js";import{c as z,d as L}from"./chunk-NW2YE576.js";import{a as D,d as y}from"./chunk-2NIQ5ECB.js";import{b as G}from"./chunk-7YEOLR2L.js";import{a as k}from"./chunk-QHHYYTCM.js";import{d as B}from"./chunk-RH3GFHG2.js";import{a as v}from"./chunk-TA3RE4KQ.js";import{a as F,b as I}from"./chunk-RTY3VPG6.js";import{e as a}from"./chunk-LRNH5AEO.js";function w(e,n,t){e=v(e,0),n=v(n,0),t=v(t,0),this.value=new Float32Array([e,n,t])}Object.defineProperties(w.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});w.fromCartesian3=function(e){return I.defined("offset",e),new w(e.x,e.y,e.z)};w.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var j=w;function K(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function P(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new L({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function N(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?P(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(P(i.westHemisphereGeometry,t),P(i.eastHemisphereGeometry,t))}}function Q(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new F("All instance geometries must have the same primitiveType.");if(K(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(N(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function T(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function X(e,n){let t=[];return T(e,"geometry",n,t),T(e,"westHemisphereGeometry",n,t),T(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=Q(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=X(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function Y(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Z(e,n){let t=e.length;for(let i=0;i<t;++i)Y(e[i],n)}function _(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(_(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=v(s.offsetAttribute,-1);let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,H=new E,q=t[o++];for(i=0;i<q;i++){let A=n[t[o++]],M=t[o++];C=t[o++];let J=t[o++]!==0;h=t[o++],x=k.createTypedArray(M,h);for(let O=0;O<h;O++)x[O]=t[o++];H[A]=new L({componentDatatype:M,componentsPerAttribute:C,normalize:J,values:x})}let V;if(h=t[o++],h>0){let A=x.length/C;for(V=U.createTypedArray(A,h),i=0;i<h;i++)V[i]=t[o++]}r[c++]=new z({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:V,attributes:H,offsetAttribute:m})}return r};function ee(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function te(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new j(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:ee(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof D,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=te(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=B.clone(e.ellipsoid),o=e.isGeographic?new D(c):new $(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function R(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function W(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Z(e.geometries,n);let t=R(e.boundingSpheres),i=R(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:W(e.boundingSpheres),boundingSpheresCV:W(e.boundingSpheresCV)}};var Ge=S;export{Ge as a}; diff --git a/public/js/Cesium2/Workers/chunk-Z6PJ3IIE.js b/public/js/Cesium2/Workers/chunk-JRSUZBXX.js similarity index 91% rename from public/js/Cesium2/Workers/chunk-Z6PJ3IIE.js rename to public/js/Cesium2/Workers/chunk-JRSUZBXX.js index a4a27590b..44a42bafe 100644 --- a/public/js/Cesium2/Workers/chunk-Z6PJ3IIE.js +++ b/public/js/Cesium2/Workers/chunk-JRSUZBXX.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as z}from"./chunk-K2M3OJ7Z.js";import{h as I,i as b}from"./chunk-M3A6SPGI.js";import{a as W,b as O,d as L}from"./chunk-S4VBGY2U.js";import{a as m}from"./chunk-UCTPWOTZ.js";import{a as v}from"./chunk-G75U3WZT.js";import{e as k}from"./chunk-3THTQ4QB.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; +import{a as z}from"./chunk-2NIQ5ECB.js";import{h as I,i as b}from"./chunk-7YEOLR2L.js";import{a as W,b as O,d as L}from"./chunk-RH3GFHG2.js";import{a as m}from"./chunk-FRWNWNYJ.js";import{a as v}from"./chunk-RTY3VPG6.js";import{e as k}from"./chunk-LRNH5AEO.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/public/js/Cesium2/Workers/chunk-3THTQ4QB.js b/public/js/Cesium2/Workers/chunk-LRNH5AEO.js similarity index 99% rename from public/js/Cesium2/Workers/chunk-3THTQ4QB.js rename to public/js/Cesium2/Workers/chunk-LRNH5AEO.js index e239f4fff..796cfe709 100644 --- a/public/js/Cesium2/Workers/chunk-3THTQ4QB.js +++ b/public/js/Cesium2/Workers/chunk-LRNH5AEO.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * diff --git a/public/js/Cesium2/Workers/chunk-M3A6SPGI.js b/public/js/Cesium2/Workers/chunk-M3A6SPGI.js deleted file mode 100644 index 5ef212dfe..000000000 --- a/public/js/Cesium2/Workers/chunk-M3A6SPGI.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as _,b as Me,c as Oe,d as Ie,e as Q,f as ft}from"./chunk-S4VBGY2U.js";import{a as E}from"./chunk-UCTPWOTZ.js";import{a as Se}from"./chunk-R62IKKEC.js";import{a as O}from"./chunk-N3A5CZ2S.js";import{a as j,b as s}from"./chunk-G75U3WZT.js";import{a as _t,c as St,d as Ze,e as p}from"./chunk-3THTQ4QB.js";var Pn=St((et,tt)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof et=="object"&&et&&!et.nodeType&&et,n=typeof tt=="object"&&tt&&!tt.nodeType&&tt,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,a=36,u=1,d=26,m=38,l=700,w=72,T=128,C="-",P=/^xn--/,A=/[^\x20-\x7E]/,q=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=a-u,F=Math.floor,B=String.fromCharCode,W;function H(b){throw new RangeError(k[b])}function ee(b,I){for(var N=b.length,Y=[];N--;)Y[N]=I(b[N]);return Y}function re(b,I){var N=b.split("@"),Y="";N.length>1&&(Y=N[0]+"@",b=N[1]),b=b.replace(q,".");var ie=b.split("."),ae=ee(ie,I).join(".");return Y+ae}function Z(b){for(var I=[],N=0,Y=b.length,ie,ae;N<Y;)ie=b.charCodeAt(N++),ie>=55296&&ie<=56319&&N<Y?(ae=b.charCodeAt(N++),(ae&64512)==56320?I.push(((ie&1023)<<10)+(ae&1023)+65536):(I.push(ie),N--)):I.push(ie);return I}function oe(b){return ee(b,function(I){var N="";return I>65535&&(I-=65536,N+=B(I>>>10&1023|55296),I=56320|I&1023),N+=B(I),N}).join("")}function J(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:a}function c(b,I){return b+22+75*(b<26)-((I!=0)<<5)}function f(b,I,N){var Y=0;for(b=N?F(b/l):b>>1,b+=F(b/I);b>L*d>>1;Y+=a)b=F(b/L);return F(Y+(L+1)*b/(b+m))}function h(b){var I=[],N=b.length,Y,ie=0,ae=T,te=w,ue,de,ye,me,he,X,_e,Te,je;for(ue=b.lastIndexOf(C),ue<0&&(ue=0),de=0;de<ue;++de)b.charCodeAt(de)>=128&&H("not-basic"),I.push(b.charCodeAt(de));for(ye=ue>0?ue+1:0;ye<N;){for(me=ie,he=1,X=a;ye>=N&&H("invalid-input"),_e=J(b.charCodeAt(ye++)),(_e>=a||_e>F((r-ie)/he))&&H("overflow"),ie+=_e*he,Te=X<=te?u:X>=te+d?d:X-te,!(_e<Te);X+=a)je=a-Te,he>F(r/je)&&H("overflow"),he*=je;Y=I.length+1,te=f(ie-me,Y,me==0),F(ie/Y)>r-ae&&H("overflow"),ae+=F(ie/Y),ie%=Y,I.splice(ie++,0,ae)}return oe(I)}function y(b){var I,N,Y,ie,ae,te,ue,de,ye,me,he,X=[],_e,Te,je,at;for(b=Z(b),_e=b.length,I=T,N=0,ae=w,te=0;te<_e;++te)he=b[te],he<128&&X.push(B(he));for(Y=ie=X.length,ie&&X.push(C);Y<_e;){for(ue=r,te=0;te<_e;++te)he=b[te],he>=I&&he<ue&&(ue=he);for(Te=Y+1,ue-I>F((r-N)/Te)&&H("overflow"),N+=(ue-I)*Te,I=ue,te=0;te<_e;++te)if(he=b[te],he<I&&++N>r&&H("overflow"),he==I){for(de=N,ye=a;me=ye<=ae?u:ye>=ae+d?d:ye-ae,!(de<me);ye+=a)at=de-me,je=a-me,X.push(B(c(me+at%je,0))),de=F(at/je);X.push(B(c(de,0))),ae=f(N,Te,Y==ie),N=0,++Y}++N,++I}return X.join("")}function g(b){return re(b,function(I){return P.test(I)?h(I.slice(4).toLowerCase()):I})}function v(b){return re(b,function(I){return A.test(I)?"xn--"+y(I):I})}if(i={version:"1.3.2",ucs2:{decode:Z,encode:oe},decode:h,encode:y,toASCII:v,toUnicode:g},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(t&&n)if(tt.exports==t)n.exports=i;else for(W in i)i.hasOwnProperty(W)&&(t[W]=i[W]);else e.punycode=i})(et)});var zn=St((Un,jt)=>{/*! - * URI.js - Mutating URLs - * IPv6 Support - * - * Version: 1.19.11 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */(function(e,t){"use strict";typeof jt=="object"&&jt.exports?jt.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Un,function(e){"use strict";var t=e&&e.IPv6;function n(i){var r=i.toLowerCase(),a=r.split(":"),u=a.length,d=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[u-1]===""&&a[u-2]===""&&a.pop(),u=a.length,a[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&a[m]!=="";m++);if(m<d)for(a.splice(m,1,"0000");a.length<d;)a.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=a[w].split("");for(var T=0;T<3&&(l[0]==="0"&&l.length>1);T++)l.splice(0,1);a[w]=l.join("")}var C=-1,P=0,A=0,q=-1,k=!1;for(w=0;w<d;w++)k?a[w]==="0"?A+=1:(k=!1,A>P&&(C=q,P=A)):a[w]==="0"&&(k=!0,q=w,A=1);A>P&&(C=q,P=A),P>1&&a.splice(C,P,""),u=a.length;var L="";for(a[0]===""&&(L=":"),w=0;w<u&&(L+=a[w],w!==u-1);w++)L+=":";return a[u-1]===""&&(L+=":"),L}function o(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:o}})});var qn=St((In,Mt)=>{/*! - * URI.js - Mutating URLs - * Second Level Domain (SLD) Support - * - * Version: 1.19.11 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */(function(e,t){"use strict";typeof Mt=="object"&&Mt.exports?Mt.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(In,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var a=n.list[o.slice(i+1)];return a?a.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var a=n.list[o.slice(i+1)];return a?a.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var a=n.list[o.slice(i+1)];return!a||a.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Qe=St((Dn,Pt)=>{/*! - * URI.js - Mutating URLs - * - * Version: 1.19.11 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */(function(e,t){"use strict";typeof Pt=="object"&&Pt.exports?Pt.exports=t(Pn(),zn(),qn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Dn,function(e,t,n,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function a(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function T(c,f){var h={},y,g;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,g=f.length;y<g;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,g=c.length;y<g;y++){var v=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);v&&(c.splice(y,1),g--,y--)}return c}function C(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!C(c,f[h]))return!1;return!0}var g=l(f);for(h=0,y=c.length;h<y;h++)if(g==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function P(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function A(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function q(c){return escape(c)}function k(c){return encodeURIComponent(c).replace(/[!'()*]/g,q).replace(/\*/g,"%2A")}r.encode=k,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=k,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var L={encode:"encode",decode:"decode"},F,B=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(F in L)r[F+"PathSegment"]=B("pathname",L[F]),r[F+"UrnPathSegment"]=B("urnpath",L[F]);var W=function(c,f,h){return function(y){var g;h?g=function(N){return r[f](r[h](N))}:g=r[f];for(var v=(y+"").split(c),b=0,I=v.length;b<I;b++)v[b]=g(v[b]);return v.join(c)}};r.decodePath=W("/","decodePathSegment"),r.decodeUrnPath=W(":","decodeUrnPathSegment"),r.recodePath=W("/","encodePathSegment","decode"),r.recodeUrnPath=W(":","encodeUrnPathSegment","decode"),r.encodeReserved=B("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,g;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var v=c.indexOf(":"),b=c.indexOf("/"),I=c.indexOf(":",v+1);I!==-1&&(b===-1||I<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(g=c.substring(0,h).split(":"),f.hostname=g[0]||null,f.port=g[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var g=c.indexOf("/"),v=c.lastIndexOf("@",g>-1?g:c.length-1),b;return v>-1&&(g===-1||v<g)?(b=c.substring(0,v).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(v+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),g=y.length,v,b,I,N=0;N<g;N++)v=y[N].split("="),b=r.decodeQuery(v.shift(),f),I=v.length?r.decodeQuery(v.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(I)):h[b]=I);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",g,v,b,I;for(v in c)if(v!=="__proto__"&&d.call(c,v))if(w(c[v]))for(g={},b=0,I=c[v].length;b<I;b++)c[v][b]!==void 0&&g[c[v][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(v,c[v][b],h),f!==!0&&(g[c[v][b]+""]=!0));else c[v]!==void 0&&(y+="&"+r.buildQueryParameter(v,c[v],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,g,v;if(w(f))for(y=0,g=f.length;y<g;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(v in c)f.test(v)&&(c[v]=void 0);else if(typeof f=="object")for(v in f)d.call(f,v)&&r.removeQuery(c,v,f[v]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=T(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=T(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var g in c)if(d.call(c,g)&&f.test(g)&&(h===void 0||r.hasQuery(c,g,h)))return!0;return!1;case"Object":for(var v in f)if(d.call(f,v)&&!r.hasQuery(c,v,f[v]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var I=y?C:P;return I(c[f],h);case"RegExp":return w(c[f])?y?C(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?C(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var g=new r(arguments[y]);c.push(g);for(var v=g.segment(),b=0;b<v.length;b++)typeof v[b]=="string"&&f.push(v[b]),v[b]&&h++}if(!f.length||!h)return new r("");var I=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&I.path("/"+I.path()),I.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,g=h.end||r.findUri.end,v=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,I=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var N=y.exec(c);if(!N)break;var Y=N.index;if(h.ignoreHtml){var ie=c.slice(Math.max(Y-3,0),Y);if(ie&&I.test(ie))continue}for(var ae=Y+c.slice(Y).search(g),te=c.slice(Y,ae),ue=-1;;){var de=b.exec(te);if(!de)break;var ye=de.index+de[0].length;ue=Math.max(ue,ye)}if(ue>-1?te=te.slice(0,ue)+te.slice(ue).replace(v,""):te=te.replace(v,""),!(te.length<=N[0].length)&&!(h.ignore&&h.ignore.test(te))){ae=Y+te.length;var me=f(te,Y,ae,c);if(me===void 0){y.lastIndex=ae;continue}me=String(me),c=c.slice(0,Y)+me+c.slice(ae),y.lastIndex=Y+me.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,g=!1;if(y&&(g=C(r.hostProtocols,f)),g&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(a(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function H(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function ee(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=H("protocol"),u.username=H("username"),u.password=H("password"),u.hostname=H("hostname"),u.port=H("port"),u.query=ee("query","?"),u.fragment=ee("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,g=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var v=r.getDomAttribute(c);c=c[v]||"",g=!1}if(!y&&g&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||g){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,g=!1,v=!1,b=!1,I=!1,N=!this._parts.urn;switch(this._parts.hostname&&(N=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,g=!f,v=g&&n&&n.has(this._parts.hostname),b=g&&r.idn_expression.test(this._parts.hostname),I=g&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return N;case"absolute":return!N;case"domain":case"name":return g;case"sld":return v;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return I}return null};var re=u.protocol,Z=u.port,oe=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return re.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),Z.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return oe.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var g=r(c);return this.protocol(g.protocol()).authority(g.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,g=this._parts.hostname.substring(0,y),v=new RegExp("^"+m(g));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(v,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var g=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(g,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&n&&n.list[y.toLowerCase()]&&n.get(this._parts.hostname)||y}else{var g;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(n&&n.is(c))g=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(g,c);else throw new TypeError('TLD "'+c+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");g=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(g,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var g=this._parts.path.length-this.filename().length,v=this._parts.path.substring(0,g),b=new RegExp("^"+m(v));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var g=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(g=!0);var v=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(v,c),g?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),g,v;return y===-1?"":(g=h.substring(y+1),v=/^[a-z0-9%]+$/i.test(g)?g:"",c?r.decodePathSegment(v):v)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),I;if(b)c?I=new RegExp(m(b)+"$"):I=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return I&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(I,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",g=this.path(),v=g.substring(0,1)==="/",b=g.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(v&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var I=0,N=f.length;I<N;I++)!f[I].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(A(f[I])))}else(f||typeof f=="string")&&(f=A(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=A(f):b.splice(c,1);return v&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,g,v;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(g=0,v=y.length;g<v;g++)y[g]=r.decode(y[g]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(g=0,v=f.length;g<v;g++)f[g]=r.encode(f[g]);return this.segment(c,f,h)};var J=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):J.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var g in c)d.call(c,g)&&(y[g]=c[g]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",g,v;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));g=f.search(/\/\.\.(\/|$)/),g!==-1;){if(g===0){f=f.substring(3);continue}v=f.substring(0,g).lastIndexOf("/"),v===-1&&(v=g),f=f.substring(0,v)+f.substring(g+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=k,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,g=c._parts.query.split("&"),v=g.length;y<v;y++){var b=(g[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,g,v;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(g=0;v=h[g];g++)f._parts[v]=c._parts[v];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,g,v,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,v=f.path(),b=c.path(),v.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(v===b)return h.path="",f.build();if(g=r.commonPath(v,b),!g)return f.build();var I=y.path.substring(g.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=I+h.path.substring(g.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},g={},v={},b,I,N;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),I=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==I.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),g=r.parseQuery(I,this._parts.escapeQuerySpace);for(N in y)if(d.call(y,N)){if(w(y[N])){if(!P(y[N],g[N]))return!1}else if(y[N]!==g[N])return!1;v[N]=!0}for(N in g)if(d.call(g,N)&&!v[N])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function M(e,t,n,o){this.x=O(e,0),this.y=O(t,0),this.z=O(n,0),this.w=O(o,0)}M.fromElements=function(e,t,n,o,i){return p(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new M(e,t,n,o)};M.fromColor=function(e,t){return s.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new M(e.red,e.green,e.blue,e.alpha)};M.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new M(e.x,e.y,e.z,e.w)};M.packedLength=4;M.pack=function(e,t,n){return s.typeOf.object("value",e),s.defined("array",t),n=O(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};M.unpack=function(e,t,n){return s.defined("array",e),t=O(t,0),p(n)||(n=new M),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};M.packArray=function(e,t){s.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new j("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)M.pack(e[i],t,i*4);return t};M.unpackArray=function(e,t){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new j("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=M.unpack(e,o,t[i])}return t};M.fromArray=M.unpack;M.maximumComponent=function(e){return s.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};M.minimumComponent=function(e){return s.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};M.minimumByComponent=function(e,t,n){return s.typeOf.object("first",e),s.typeOf.object("second",t),s.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};M.maximumByComponent=function(e,t,n){return s.typeOf.object("first",e),s.typeOf.object("second",t),s.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};M.clamp=function(e,t,n,o){s.typeOf.object("value",e),s.typeOf.object("min",t),s.typeOf.object("max",n),s.typeOf.object("result",o);let i=E.clamp(e.x,t.x,n.x),r=E.clamp(e.y,t.y,n.y),a=E.clamp(e.z,t.z,n.z),u=E.clamp(e.w,t.w,n.w);return o.x=i,o.y=r,o.z=a,o.w=u,o};M.magnitudeSquared=function(e){return s.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};M.magnitude=function(e){return Math.sqrt(M.magnitudeSquared(e))};var Rt=new M;M.distance=function(e,t){return s.typeOf.object("left",e),s.typeOf.object("right",t),M.subtract(e,t,Rt),M.magnitude(Rt)};M.distanceSquared=function(e,t){return s.typeOf.object("left",e),s.typeOf.object("right",t),M.subtract(e,t,Rt),M.magnitudeSquared(Rt)};M.normalize=function(e,t){s.typeOf.object("cartesian",e),s.typeOf.object("result",t);let n=M.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new j("normalized result is not a number");return t};M.dot=function(e,t){return s.typeOf.object("left",e),s.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};M.multiplyComponents=function(e,t,n){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};M.divideComponents=function(e,t,n){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};M.add=function(e,t,n){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};M.subtract=function(e,t,n){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};M.multiplyByScalar=function(e,t,n){return s.typeOf.object("cartesian",e),s.typeOf.number("scalar",t),s.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};M.divideByScalar=function(e,t,n){return s.typeOf.object("cartesian",e),s.typeOf.number("scalar",t),s.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};M.negate=function(e,t){return s.typeOf.object("cartesian",e),s.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};M.abs=function(e,t){return s.typeOf.object("cartesian",e),s.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var En=new M;M.lerp=function(e,t,n,o){return s.typeOf.object("start",e),s.typeOf.object("end",t),s.typeOf.number("t",n),s.typeOf.object("result",o),M.multiplyByScalar(t,n,En),o=M.multiplyByScalar(e,1-n,o),M.add(En,o,o)};var zo=new M;M.mostOrthogonalAxis=function(e,t){s.typeOf.object("cartesian",e),s.typeOf.object("result",t);let n=M.normalize(e,zo);return M.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=M.clone(M.UNIT_X,t):t=M.clone(M.UNIT_W,t):n.z<=n.w?t=M.clone(M.UNIT_Z,t):t=M.clone(M.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=M.clone(M.UNIT_Y,t):t=M.clone(M.UNIT_W,t):n.z<=n.w?t=M.clone(M.UNIT_Z,t):t=M.clone(M.UNIT_W,t),t};M.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};M.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};M.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&E.equalsEpsilon(e.x,t.x,n,o)&&E.equalsEpsilon(e.y,t.y,n,o)&&E.equalsEpsilon(e.z,t.z,n,o)&&E.equalsEpsilon(e.w,t.w,n,o)};M.ZERO=Object.freeze(new M(0,0,0,0));M.ONE=Object.freeze(new M(1,1,1,1));M.UNIT_X=Object.freeze(new M(1,0,0,0));M.UNIT_Y=Object.freeze(new M(0,1,0,0));M.UNIT_Z=Object.freeze(new M(0,0,1,0));M.UNIT_W=Object.freeze(new M(0,0,0,1));M.prototype.clone=function(e){return M.clone(this,e)};M.prototype.equals=function(e){return M.equals(this,e)};M.prototype.equalsEpsilon=function(e,t,n){return M.equalsEpsilon(this,e,t,n)};M.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Zt=new Float32Array(1),le=new Uint8Array(Zt.buffer),Io=new Uint32Array([287454020]),qo=new Uint8Array(Io.buffer),Tn=qo[0]===68;M.packFloat=function(e,t){return s.typeOf.number("value",e),p(t)||(t=new M),Zt[0]=e,Tn?(t.x=le[0],t.y=le[1],t.z=le[2],t.w=le[3]):(t.x=le[3],t.y=le[2],t.z=le[1],t.w=le[0]),t};M.unpackFloat=function(e){return s.typeOf.object("packedFloat",e),Tn?(le[0]=e.x,le[1]=e.y,le[2]=e.z,le[3]=e.w):(le[0]=e.w,le[1]=e.z,le[2]=e.y,le[3]=e.x),Zt[0]};var qe=M;function S(e,t,n,o,i,r,a,u,d,m,l,w,T,C,P,A){this[0]=O(e,0),this[1]=O(i,0),this[2]=O(d,0),this[3]=O(T,0),this[4]=O(t,0),this[5]=O(r,0),this[6]=O(m,0),this[7]=O(C,0),this[8]=O(n,0),this[9]=O(a,0),this[10]=O(l,0),this[11]=O(P,0),this[12]=O(o,0),this[13]=O(u,0),this[14]=O(w,0),this[15]=O(A,0)}S.packedLength=16;S.pack=function(e,t,n){return s.typeOf.object("value",e),s.defined("array",t),n=O(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};S.unpack=function(e,t,n){return s.defined("array",e),t=O(t,0),p(n)||(n=new S),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};S.packArray=function(e,t){s.defined("array",e);let n=e.length,o=n*16;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new j("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)S.pack(e[i],t,i*16);return t};S.unpackArray=function(e,t){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new j("array length must be a multiple of 16.");let n=e.length;p(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){let i=o/16;t[i]=S.unpack(e,o,t[i])}return t};S.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new S(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};S.fromArray=S.unpack;S.fromColumnMajorArray=function(e,t){return s.defined("values",e),S.clone(e,t)};S.fromRowMajorArray=function(e,t){return s.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new S(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};S.fromRotationTranslation=function(e,t,n){return s.typeOf.object("rotation",e),t=O(t,_.ZERO),p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new S(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};S.fromTranslationQuaternionRotationScale=function(e,t,n,o){s.typeOf.object("translation",e),s.typeOf.object("rotation",t),s.typeOf.object("scale",n),p(o)||(o=new S);let i=n.x,r=n.y,a=n.z,u=t.x*t.x,d=t.x*t.y,m=t.x*t.z,l=t.x*t.w,w=t.y*t.y,T=t.y*t.z,C=t.y*t.w,P=t.z*t.z,A=t.z*t.w,q=t.w*t.w,k=u-w-P+q,L=2*(d-A),F=2*(m+C),B=2*(d+A),W=-u+w-P+q,H=2*(T-l),ee=2*(m-C),re=2*(T+l),Z=-u-w+P+q;return o[0]=k*i,o[1]=B*i,o[2]=ee*i,o[3]=0,o[4]=L*r,o[5]=W*r,o[6]=re*r,o[7]=0,o[8]=F*a,o[9]=H*a,o[10]=Z*a,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};S.fromTranslationRotationScale=function(e,t){return s.typeOf.object("translationRotationScale",e),S.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};S.fromTranslation=function(e,t){return s.typeOf.object("translation",e),S.fromRotationTranslation(Q.IDENTITY,e,t)};S.fromScale=function(e,t){return s.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new S(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};S.fromUniformScale=function(e,t){return s.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new S(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};S.fromRotation=function(e,t){return s.typeOf.object("rotation",e),p(t)||(t=new S),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var Je=new _,Ge=new _,ut=new _;S.fromCamera=function(e,t){s.typeOf.object("camera",e);let n=e.position,o=e.direction,i=e.up;s.typeOf.object("camera.position",n),s.typeOf.object("camera.direction",o),s.typeOf.object("camera.up",i),_.normalize(o,Je),_.normalize(_.cross(Je,i,Ge),Ge),_.normalize(_.cross(Ge,Je,ut),ut);let r=Ge.x,a=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=ut.x,T=ut.y,C=ut.z,P=n.x,A=n.y,q=n.z,k=r*-P+a*-A+u*-q,L=w*-P+T*-A+C*-q,F=d*P+m*A+l*q;return p(t)?(t[0]=r,t[1]=w,t[2]=-d,t[3]=0,t[4]=a,t[5]=T,t[6]=-m,t[7]=0,t[8]=u,t[9]=C,t[10]=-l,t[11]=0,t[12]=k,t[13]=L,t[14]=F,t[15]=1,t):new S(r,a,u,k,w,T,C,L,-d,-m,-l,F,0,0,0,1)};S.computePerspectiveFieldOfView=function(e,t,n,o,i){s.typeOf.number.greaterThan("fovY",e,0),s.typeOf.number.lessThan("fovY",e,Math.PI),s.typeOf.number.greaterThan("near",n,0),s.typeOf.number.greaterThan("far",o,0),s.typeOf.object("result",i);let a=1/Math.tan(e*.5),u=a/t,d=(o+n)/(n-o),m=2*o*n/(n-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=a,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};S.computeOrthographicOffCenter=function(e,t,n,o,i,r,a){s.typeOf.number("left",e),s.typeOf.number("right",t),s.typeOf.number("bottom",n),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.number("far",r),s.typeOf.object("result",a);let u=1/(t-e),d=1/(o-n),m=1/(r-i),l=-(t+e)*u,w=-(o+n)*d,T=-(r+i)*m;return u*=2,d*=2,m*=-2,a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=m,a[11]=0,a[12]=l,a[13]=w,a[14]=T,a[15]=1,a};S.computePerspectiveOffCenter=function(e,t,n,o,i,r,a){s.typeOf.number("left",e),s.typeOf.number("right",t),s.typeOf.number("bottom",n),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.number("far",r),s.typeOf.object("result",a);let u=2*i/(t-e),d=2*i/(o-n),m=(t+e)/(t-e),l=(o+n)/(o-n),w=-(r+i)/(r-i),T=-1,C=-2*r*i/(r-i);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=m,a[9]=l,a[10]=w,a[11]=T,a[12]=0,a[13]=0,a[14]=C,a[15]=0,a};S.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,r){s.typeOf.number("left",e),s.typeOf.number("right",t),s.typeOf.number("bottom",n),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.object("result",r);let a=2*i/(t-e),u=2*i/(o-n),d=(t+e)/(t-e),m=(o+n)/(o-n),l=-1,w=-1,T=-2*i;return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=T,r[15]=0,r};S.computeViewportTransformation=function(e,t,n,o){p(o)||(o=new S),e=O(e,O.EMPTY_OBJECT);let i=O(e.x,0),r=O(e.y,0),a=O(e.width,0),u=O(e.height,0);t=O(t,0),n=O(n,1);let d=a*.5,m=u*.5,l=(n-t)*.5,w=d,T=m,C=l,P=i+d,A=r+m,q=t+l,k=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=T,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=C,o[11]=0,o[12]=P,o[13]=A,o[14]=q,o[15]=k,o};S.computeView=function(e,t,n,o,i){return s.typeOf.object("position",e),s.typeOf.object("direction",t),s.typeOf.object("up",n),s.typeOf.object("right",o),s.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-_.dot(o,e),i[13]=-_.dot(n,e),i[14]=_.dot(t,e),i[15]=1,i};S.toArray=function(e,t){return s.typeOf.object("matrix",e),p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};S.getElementIndex=function(e,t){return s.typeOf.number.greaterThanOrEquals("row",t,0),s.typeOf.number.lessThanOrEquals("row",t,3),s.typeOf.number.greaterThanOrEquals("column",e,0),s.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};S.getColumn=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,3),s.typeOf.object("result",n);let o=t*4,i=e[o],r=e[o+1],a=e[o+2],u=e[o+3];return n.x=i,n.y=r,n.z=a,n.w=u,n};S.setColumn=function(e,t,n,o){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,3),s.typeOf.object("cartesian",n),s.typeOf.object("result",o),o=S.clone(e,o);let i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};S.getRow=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,3),s.typeOf.object("result",n);let o=e[t],i=e[t+4],r=e[t+8],a=e[t+12];return n.x=o,n.y=i,n.z=r,n.w=a,n};S.setRow=function(e,t,n,o){return s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,3),s.typeOf.object("cartesian",n),s.typeOf.object("result",o),o=S.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};S.setTranslation=function(e,t,n){return s.typeOf.object("matrix",e),s.typeOf.object("translation",t),s.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Do=new _;S.setScale=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("scale",t),s.typeOf.object("result",n);let o=S.getScale(e,Do),i=t.x/o.x,r=t.y/o.y,a=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*a,n[9]=e[9]*a,n[10]=e[10]*a,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var No=new _;S.setUniformScale=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.number("scale",t),s.typeOf.object("result",n);let o=S.getScale(e,No),i=t/o.x,r=t/o.y,a=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*a,n[9]=e[9]*a,n[10]=e[10]*a,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Jt=new _;S.getScale=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t.x=_.magnitude(_.fromElements(e[0],e[1],e[2],Jt)),t.y=_.magnitude(_.fromElements(e[4],e[5],e[6],Jt)),t.z=_.magnitude(_.fromElements(e[8],e[9],e[10],Jt)),t};var Cn=new _;S.getMaximumScale=function(e){return S.getScale(e,Cn),_.maximumComponent(Cn)};var ko=new _;S.setRotation=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let o=S.getScale(e,ko);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Fo=new _;S.getRotation=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let n=S.getScale(e,Fo);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};S.multiply=function(e,t,n){s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],a=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],T=e[9],C=e[10],P=e[11],A=e[12],q=e[13],k=e[14],L=e[15],F=t[0],B=t[1],W=t[2],H=t[3],ee=t[4],re=t[5],Z=t[6],oe=t[7],J=t[8],c=t[9],f=t[10],h=t[11],y=t[12],g=t[13],v=t[14],b=t[15],I=o*F+u*B+w*W+A*H,N=i*F+d*B+T*W+q*H,Y=r*F+m*B+C*W+k*H,ie=a*F+l*B+P*W+L*H,ae=o*ee+u*re+w*Z+A*oe,te=i*ee+d*re+T*Z+q*oe,ue=r*ee+m*re+C*Z+k*oe,de=a*ee+l*re+P*Z+L*oe,ye=o*J+u*c+w*f+A*h,me=i*J+d*c+T*f+q*h,he=r*J+m*c+C*f+k*h,X=a*J+l*c+P*f+L*h,_e=o*y+u*g+w*v+A*b,Te=i*y+d*g+T*v+q*b,je=r*y+m*g+C*v+k*b,at=a*y+l*g+P*v+L*b;return n[0]=I,n[1]=N,n[2]=Y,n[3]=ie,n[4]=ae,n[5]=te,n[6]=ue,n[7]=de,n[8]=ye,n[9]=me,n[10]=he,n[11]=X,n[12]=_e,n[13]=Te,n[14]=je,n[15]=at,n};S.add=function(e,t,n){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};S.subtract=function(e,t,n){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};S.multiplyTransformation=function(e,t,n){s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],a=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],T=e[12],C=e[13],P=e[14],A=t[0],q=t[1],k=t[2],L=t[4],F=t[5],B=t[6],W=t[8],H=t[9],ee=t[10],re=t[12],Z=t[13],oe=t[14],J=o*A+a*q+m*k,c=i*A+u*q+l*k,f=r*A+d*q+w*k,h=o*L+a*F+m*B,y=i*L+u*F+l*B,g=r*L+d*F+w*B,v=o*W+a*H+m*ee,b=i*W+u*H+l*ee,I=r*W+d*H+w*ee,N=o*re+a*Z+m*oe+T,Y=i*re+u*Z+l*oe+C,ie=r*re+d*Z+w*oe+P;return n[0]=J,n[1]=c,n[2]=f,n[3]=0,n[4]=h,n[5]=y,n[6]=g,n[7]=0,n[8]=v,n[9]=b,n[10]=I,n[11]=0,n[12]=N,n[13]=Y,n[14]=ie,n[15]=1,n};S.multiplyByMatrix3=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("rotation",t),s.typeOf.object("result",n);let o=e[0],i=e[1],r=e[2],a=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],T=t[0],C=t[1],P=t[2],A=t[3],q=t[4],k=t[5],L=t[6],F=t[7],B=t[8],W=o*T+a*C+m*P,H=i*T+u*C+l*P,ee=r*T+d*C+w*P,re=o*A+a*q+m*k,Z=i*A+u*q+l*k,oe=r*A+d*q+w*k,J=o*L+a*F+m*B,c=i*L+u*F+l*B,f=r*L+d*F+w*B;return n[0]=W,n[1]=H,n[2]=ee,n[3]=0,n[4]=re,n[5]=Z,n[6]=oe,n[7]=0,n[8]=J,n[9]=c,n[10]=f,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};S.multiplyByTranslation=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("translation",t),s.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,a=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=a,n[13]=u,n[14]=d,n[15]=e[15],n};S.multiplyByScale=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("scale",t),s.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z;return o===1&&i===1&&r===1?S.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};S.multiplyByUniformScale=function(e,t,n){return s.typeOf.object("matrix",e),s.typeOf.number("scale",t),s.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};S.multiplyByVector=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",t),s.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,a=t.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*a,d=e[1]*o+e[5]*i+e[9]*r+e[13]*a,m=e[2]*o+e[6]*i+e[10]*r+e[14]*a,l=e[3]*o+e[7]*i+e[11]*r+e[15]*a;return n.x=u,n.y=d,n.z=m,n.w=l,n};S.multiplyByPointAsVector=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",t),s.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,a=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return n.x=a,n.y=u,n.z=d,n};S.multiplyByPoint=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",t),s.typeOf.object("result",n);let o=t.x,i=t.y,r=t.z,a=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return n.x=a,n.y=u,n.z=d,n};S.multiplyByScalar=function(e,t,n){return s.typeOf.object("matrix",e),s.typeOf.number("scalar",t),s.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};S.negate=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};S.transpose=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let n=e[1],o=e[2],i=e[3],r=e[6],a=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=o,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=a,t[14]=u,t[15]=e[15],t};S.abs=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};S.equals=function(e,t){return e===t||p(e)&&p(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};S.equalsEpsilon=function(e,t,n){return n=O(n,0),e===t||p(e)&&p(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};S.getTranslation=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};S.getMatrix3=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Lo=new Q,xo=new Q,Bo=new qe,Qo=new qe(0,0,0,1);S.inverse=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let n=e[0],o=e[4],i=e[8],r=e[12],a=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],T=e[10],C=e[14],P=e[3],A=e[7],q=e[11],k=e[15],L=T*k,F=C*q,B=w*k,W=C*A,H=w*q,ee=T*A,re=l*k,Z=C*P,oe=l*q,J=T*P,c=l*A,f=w*P,h=L*u+W*d+H*m-(F*u+B*d+ee*m),y=F*a+re*d+J*m-(L*a+Z*d+oe*m),g=B*a+Z*u+c*m-(W*a+re*u+f*m),v=ee*a+oe*u+f*d-(H*a+J*u+c*d),b=F*o+B*i+ee*r-(L*o+W*i+H*r),I=L*n+Z*i+oe*r-(F*n+re*i+J*r),N=W*n+re*o+f*r-(B*n+Z*o+c*r),Y=H*n+J*o+c*i-(ee*n+oe*o+f*i);L=i*m,F=r*d,B=o*m,W=r*u,H=o*d,ee=i*u,re=n*m,Z=r*a,oe=n*d,J=i*a,c=n*u,f=o*a;let ie=L*A+W*q+H*k-(F*A+B*q+ee*k),ae=F*P+re*q+J*k-(L*P+Z*q+oe*k),te=B*P+Z*A+c*k-(W*P+re*A+f*k),ue=ee*P+oe*A+f*q-(H*P+J*A+c*q),de=B*T+ee*C+F*w-(H*C+L*w+W*T),ye=oe*C+L*l+Z*T-(re*T+J*C+F*l),me=re*w+f*C+W*l-(c*C+B*l+Z*w),he=c*T+H*l+J*w-(oe*w+f*T+ee*l),X=n*h+o*y+i*g+r*v;if(Math.abs(X)<E.EPSILON21){if(Q.equalsEpsilon(S.getMatrix3(e,Lo),xo,E.EPSILON7)&&qe.equals(S.getRow(e,3,Bo),Qo))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new Se("matrix is not invertible because its determinate is zero.")}return X=1/X,t[0]=h*X,t[1]=y*X,t[2]=g*X,t[3]=v*X,t[4]=b*X,t[5]=I*X,t[6]=N*X,t[7]=Y*X,t[8]=ie*X,t[9]=ae*X,t[10]=te*X,t[11]=ue*X,t[12]=de*X,t[13]=ye*X,t[14]=me*X,t[15]=he*X,t};S.inverseTransformation=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let n=e[0],o=e[1],i=e[2],r=e[4],a=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],T=e[13],C=e[14],P=-n*w-o*T-i*C,A=-r*w-a*T-u*C,q=-d*w-m*T-l*C;return t[0]=n,t[1]=r,t[2]=d,t[3]=0,t[4]=o,t[5]=a,t[6]=m,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=P,t[13]=A,t[14]=q,t[15]=1,t};var Wo=new S;S.inverseTranspose=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),S.inverse(S.transpose(e,Wo),t)};S.IDENTITY=Object.freeze(new S(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));S.ZERO=Object.freeze(new S(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));S.COLUMN0ROW0=0;S.COLUMN0ROW1=1;S.COLUMN0ROW2=2;S.COLUMN0ROW3=3;S.COLUMN1ROW0=4;S.COLUMN1ROW1=5;S.COLUMN1ROW2=6;S.COLUMN1ROW3=7;S.COLUMN2ROW0=8;S.COLUMN2ROW1=9;S.COLUMN2ROW2=10;S.COLUMN2ROW3=11;S.COLUMN3ROW0=12;S.COLUMN3ROW1=13;S.COLUMN3ROW2=14;S.COLUMN3ROW3=15;Object.defineProperties(S.prototype,{length:{get:function(){return S.packedLength}}});S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)};S.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) -(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]}) -(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]}) -(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var G=S;function vn(e,t,n){n=O(n,!1);let o={},i=p(e),r=p(t),a,u,d;if(i)for(a in e)e.hasOwnProperty(a)&&(u=e[a],r&&n&&typeof u=="object"&&t.hasOwnProperty(a)?(d=t[a],typeof d=="object"?o[a]=vn(u,d,n):o[a]=u):o[a]=u);if(r)for(a in t)t.hasOwnProperty(a)&&!o.hasOwnProperty(a)&&(d=t[a],o[a]=d);return o}var De=vn;function Ho(e,t,n){s.defined("array",e),s.defined("itemToFind",t),s.defined("comparator",n);let o=0,i=e.length-1,r,a;for(;o<=i;){if(r=~~((o+i)/2),a=n(e[r],t),a<0){o=r+1;continue}if(a>0){i=r-1;continue}return r}return~(i+1)}var Be=Ho;function $o(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}var pt=$o;function Vo(e){if(e===null||isNaN(e))throw new j("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var ht=Vo;var An=[31,28,31,30,31,30,31,31,30,31,30,31];function Yo(e,t,n,o,i,r,a,u){e=O(e,1),t=O(t,1),n=O(n,1),o=O(o,0),i=O(i,0),r=O(r,0),a=O(a,0),u=O(u,!1),A(),q(),this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=r,this.millisecond=a,this.isLeapSecond=u;function A(){s.typeOf.number.greaterThanOrEquals("Year",e,1),s.typeOf.number.lessThanOrEquals("Year",e,9999),s.typeOf.number.greaterThanOrEquals("Month",t,1),s.typeOf.number.lessThanOrEquals("Month",t,12),s.typeOf.number.greaterThanOrEquals("Day",n,1),s.typeOf.number.lessThanOrEquals("Day",n,31),s.typeOf.number.greaterThanOrEquals("Hour",o,0),s.typeOf.number.lessThanOrEquals("Hour",o,23),s.typeOf.number.greaterThanOrEquals("Minute",i,0),s.typeOf.number.lessThanOrEquals("Minute",i,59),s.typeOf.bool("IsLeapSecond",u),s.typeOf.number.greaterThanOrEquals("Second",r,0),s.typeOf.number.lessThanOrEquals("Second",r,u?60:59),s.typeOf.number.greaterThanOrEquals("Millisecond",a,0),s.typeOf.number.lessThan("Millisecond",a,1e3)}function q(){let k=t===2&&ht(e)?An[t-1]+1:An[t-1];if(n>k)throw new j("Month and Day represents invalid date")}}var Et=Yo;function Xo(e,t){this.julianDate=e,this.offset=t}var ne=Xo;var Zo={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},ce=Object.freeze(Zo);var Jo={UTC:0,TAI:1},$=Object.freeze(Jo);var Mn=new Et,Tt=[31,28,31,30,31,30,31,31,30,31,30,31],Ct=29;function Gt(e,t){return z.compare(e.julianDate,t.julianDate)}var Ke=new ne;function At(e){Ke.julianDate=e;let t=z.leapSeconds,n=Be(t,Ke,Gt);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&z.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),z.addSeconds(e,o,e)}function jn(e,t){Ke.julianDate=e;let n=z.leapSeconds,o=Be(n,Ke,Gt);if(o<0&&(o=~o),o===0)return z.addSeconds(e,-n[0].offset,t);if(o>=n.length)return z.addSeconds(e,-n[o-1].offset,t);let i=z.secondsDifference(n[o].julianDate,e);if(i===0)return z.addSeconds(e,-n[o].offset,t);if(!(i<=1))return z.addSeconds(e,-n[--o].offset,t)}function Ne(e,t,n){let o=t/ce.SECONDS_PER_DAY|0;return e+=o,t-=ce.SECONDS_PER_DAY*o,t<0&&(e--,t+=ce.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Kt(e,t,n,o,i,r,a){let u=(t-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(t-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ce.SECONDS_PER_HOUR+i*ce.SECONDS_PER_MINUTE+a*ce.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var Go=/^(\d{4})$/,Ko=/^(\d{4})-(\d{2})$/,er=/^(\d{4})-?(\d{3})$/,tr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,nr=/^(\d{4})-?(\d{2})-?(\d{2})$/,en=/([Z+\-])?(\d{2})?:?(\d{2})?$/,or=/^(\d{2})(\.\d+)?/.source+en.source,rr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+en.source,ir=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+en.source,Re="Invalid ISO 8601 date.";function z(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=O(e,0),t=O(t,0),n=O(n,$.UTC);let o=e|0;t=t+(e-o)*ce.SECONDS_PER_DAY,Ne(o,t,this),n===$.UTC&&At(this)}z.fromGregorianDate=function(e,t){if(!(e instanceof Et))throw new j("date must be a valid GregorianDate.");let n=Kt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(n[0],n[1],t),At(t),t):new z(n[0],n[1],$.UTC)};z.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new j("date must be a valid JavaScript Date.");let n=Kt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(n[0],n[1],t),At(t),t):new z(n[0],n[1],$.UTC)};z.fromIso8601=function(e,t){if(typeof e!="string")throw new j(Re);e=e.replace(",",".");let n=e.split("T"),o,i=1,r=1,a=0,u=0,d=0,m=0,l=n[0],w=n[1],T,C;if(!p(l))throw new j(Re);let P;if(n=l.match(nr),n!==null){if(P=l.split("-").length-1,P>0&&P!==2)throw new j(Re);o=+n[1],i=+n[2],r=+n[3]}else if(n=l.match(Ko),n!==null)o=+n[1],i=+n[2];else if(n=l.match(Go),n!==null)o=+n[1];else{let L;if(n=l.match(er),n!==null){if(o=+n[1],L=+n[2],C=ht(o),L<1||C&&L>366||!C&&L>365)throw new j(Re)}else if(n=l.match(tr),n!==null){o=+n[1];let F=+n[2],B=+n[3]||0;if(P=l.split("-").length-1,P>0&&(!p(n[3])&&P!==1||p(n[3])&&P!==2))throw new j(Re);let W=new Date(Date.UTC(o,0,4));L=F*7+B-W.getUTCDay()-3}else throw new j(Re);T=new Date(Date.UTC(o,0,1)),T.setUTCDate(L),i=T.getUTCMonth()+1,r=T.getUTCDate()}if(C=ht(o),i<1||i>12||r<1||(i!==2||!C)&&r>Tt[i-1]||C&&i===2&&r>Ct)throw new j(Re);let A;if(p(w)){if(n=w.match(ir),n!==null){if(P=w.split(":").length-1,P>0&&P!==2&&P!==3)throw new j(Re);a=+n[1],u=+n[2],d=+n[3],m=+(n[4]||0)*1e3,A=5}else if(n=w.match(rr),n!==null){if(P=w.split(":").length-1,P>2)throw new j(Re);a=+n[1],u=+n[2],d=+(n[3]||0)*60,A=4}else if(n=w.match(or),n!==null)a=+n[1],u=+(n[2]||0)*60,A=3;else throw new j(Re);if(u>=60||d>=61||a>24||a===24&&(u>0||d>0||m>0))throw new j(Re);let L=n[A],F=+n[A+1],B=+(n[A+2]||0);switch(L){case"+":a=a-F,u=u-B;break;case"-":a=a+F,u=u+B;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,a,u)).getTimezoneOffset();break}}let q=d===60;for(q&&d--;u>=60;)u-=60,a++;for(;a>=24;)a-=24,r++;for(T=C&&i===2?Ct:Tt[i-1];r>T;)r-=T,i++,i>12&&(i-=12,o++),T=C&&i===2?Ct:Tt[i-1];for(;u<0;)u+=60,a--;for(;a<0;)a+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),T=C&&i===2?Ct:Tt[i-1],r+=T;let k=Kt(o,i,r,a,u,d,m);return p(t)?(Ne(k[0],k[1],t),At(t)):t=new z(k[0],k[1],$.UTC),q&&z.addSeconds(t,1,t),t};z.now=function(e){return z.fromDate(new Date,e)};var vt=new z(0,0,$.TAI);z.toGregorianDate=function(e,t){if(!p(e))throw new j("julianDate is required.");let n=!1,o=jn(e,vt);p(o)||(z.addSeconds(e,-1,vt),o=jn(vt,vt),n=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let a=i+68569|0,u=4*a/146097|0;a=a-((146097*u+3)/4|0)|0;let d=4e3*(a+1)/1461001|0;a=a-(1461*d/4|0)+31|0;let m=80*a/2447|0,l=a-(2447*m/80|0)|0;a=m/11|0;let w=m+2-12*a|0,T=100*(u-49)+d+a|0,C=r/ce.SECONDS_PER_HOUR|0,P=r-C*ce.SECONDS_PER_HOUR,A=P/ce.SECONDS_PER_MINUTE|0;P=P-A*ce.SECONDS_PER_MINUTE;let q=P|0,k=(P-q)/ce.SECONDS_PER_MILLISECOND;return C+=12,C>23&&(C-=24),n&&(q+=1),p(t)?(t.year=T,t.month=w,t.day=l,t.hour=C,t.minute=A,t.second=q,t.millisecond=k,t.isLeapSecond=n,t):new Et(T,w,l,C,A,q,k,n)};z.toDate=function(e){if(!p(e))throw new j("julianDate is required.");let t=z.toGregorianDate(e,Mn),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};z.toIso8601=function(e,t){if(!p(e))throw new j("julianDate is required.");let n=z.toGregorianDate(e,Mn),o=n.year,i=n.month,r=n.day,a=n.hour,u=n.minute,d=n.second,m=n.millisecond;o===1e4&&i===1&&r===1&&a===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,a=24);let l;return!p(t)&&m!==0?(l=(m*.01).toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`):!p(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};z.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new z(e.dayNumber,e.secondsOfDay,$.TAI)};z.compare=function(e,t){if(!p(e))throw new j("left is required.");if(!p(t))throw new j("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};z.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};z.equalsEpsilon=function(e,t,n){return n=O(n,0),e===t||p(e)&&p(t)&&Math.abs(z.secondsDifference(e,t))<=n};z.totalDays=function(e){if(!p(e))throw new j("julianDate is required.");return e.dayNumber+e.secondsOfDay/ce.SECONDS_PER_DAY};z.secondsDifference=function(e,t){if(!p(e))throw new j("left is required.");if(!p(t))throw new j("right is required.");return(e.dayNumber-t.dayNumber)*ce.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};z.daysDifference=function(e,t){if(!p(e))throw new j("left is required.");if(!p(t))throw new j("right is required.");let n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/ce.SECONDS_PER_DAY;return n+o};z.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=z.leapSeconds,n=Be(t,Ke,Gt);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};z.addSeconds=function(e,t,n){if(!p(e))throw new j("julianDate is required.");if(!p(t))throw new j("seconds is required.");if(!p(n))throw new j("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,n)};z.addMinutes=function(e,t,n){if(!p(e))throw new j("julianDate is required.");if(!p(t))throw new j("minutes is required.");if(!p(n))throw new j("result is required.");let o=e.secondsOfDay+t*ce.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,n)};z.addHours=function(e,t,n){if(!p(e))throw new j("julianDate is required.");if(!p(t))throw new j("hours is required.");if(!p(n))throw new j("result is required.");let o=e.secondsOfDay+t*ce.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,n)};z.addDays=function(e,t,n){if(!p(e))throw new j("julianDate is required.");if(!p(t))throw new j("days is required.");if(!p(n))throw new j("result is required.");let o=e.dayNumber+t;return Ne(o,e.secondsOfDay,n)};z.lessThan=function(e,t){return z.compare(e,t)<0};z.lessThanOrEquals=function(e,t){return z.compare(e,t)<=0};z.greaterThan=function(e,t){return z.compare(e,t)>0};z.greaterThanOrEquals=function(e,t){return z.compare(e,t)>=0};z.prototype.clone=function(e){return z.clone(this,e)};z.prototype.equals=function(e){return z.equals(this,e)};z.prototype.equalsEpsilon=function(e,t){return z.equalsEpsilon(this,e,t)};z.prototype.toString=function(){return z.toIso8601(this)};z.leapSeconds=[new ne(new z(2441317,43210,$.TAI),10),new ne(new z(2441499,43211,$.TAI),11),new ne(new z(2441683,43212,$.TAI),12),new ne(new z(2442048,43213,$.TAI),13),new ne(new z(2442413,43214,$.TAI),14),new ne(new z(2442778,43215,$.TAI),15),new ne(new z(2443144,43216,$.TAI),16),new ne(new z(2443509,43217,$.TAI),17),new ne(new z(2443874,43218,$.TAI),18),new ne(new z(2444239,43219,$.TAI),19),new ne(new z(2444786,43220,$.TAI),20),new ne(new z(2445151,43221,$.TAI),21),new ne(new z(2445516,43222,$.TAI),22),new ne(new z(2446247,43223,$.TAI),23),new ne(new z(2447161,43224,$.TAI),24),new ne(new z(2447892,43225,$.TAI),25),new ne(new z(2448257,43226,$.TAI),26),new ne(new z(2448804,43227,$.TAI),27),new ne(new z(2449169,43228,$.TAI),28),new ne(new z(2449534,43229,$.TAI),29),new ne(new z(2450083,43230,$.TAI),30),new ne(new z(2450630,43231,$.TAI),31),new ne(new z(2451179,43232,$.TAI),32),new ne(new z(2453736,43233,$.TAI),33),new ne(new z(2454832,43234,$.TAI),34),new ne(new z(2456109,43235,$.TAI),35),new ne(new z(2457204,43236,$.TAI),36),new ne(new z(2457754,43237,$.TAI),37)];var pe=z;var co=Ze(Qe(),1);function cr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var Nn=cr;function kn(e,t){if(e===null||typeof e!="object")return e;t=O(t,!1);let n=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=kn(i,t)),n[o]=i}return n}var nt=kn;function sr(){let e,t,n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}var We=sr;var Fn=Ze(Qe(),1);function tn(e,t){let n;return typeof document<"u"&&(n=document),tn._implementation(e,t,n)}tn._implementation=function(e,t,n){if(!p(e))throw new j("relative uri is required.");if(!p(t)){if(typeof n>"u")return e;t=O(n.baseURI,n.location.href)}let o=new Fn.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};var dt=tn;var Ln=Ze(Qe(),1);function ar(e,t){if(!p(e))throw new j("uri is required.");let n="",o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Ln.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var xn=ar;var Bn=Ze(Qe(),1);function fr(e){if(!p(e))throw new j("uri is required.");let t=new Bn.default(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}var Qn=fr;var Wn={};function ur(e,t,n){p(t)||(t=e.width),p(n)||(n=e.height);let o=Wn[t];p(o)||(o={},Wn[t]=o);let i=o[n];if(!p(i)){let r=document.createElement("canvas");r.width=t,r.height=n,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}var nn=ur;var pr=/^blob:/i;function hr(e){return s.typeOf.string("uri",e),pr.test(e)}var Ut=hr;var Ce;function dr(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let t=Ce.host,n=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,n!==Ce.protocol||t!==Ce.host}var Hn=dr;var mr=/^data:/i;function yr(e){return s.typeOf.string("uri",e),mr.test(e)}var zt=yr;function lr(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(r){o(r)},i.appendChild(t)})}var $n=lr;function wr(e){if(!p(e))throw new j("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let r=0,a=o.length;r<a;++r)t+=`${i+encodeURIComponent(o[r])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}var Vn=wr;function br(e){if(!p(e))throw new j("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){let r=n[o].split("="),a=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=t[a];typeof d=="string"?t[a]=[d,u]:Array.isArray(d)?d.push(u):t[a]=u}return t}var Yn=br;var Or={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},fe=Object.freeze(Or);var gr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Xn=Object.freeze(gr);function It(e){e=O(e,O.EMPTY_OBJECT);let t=O(e.throttleByServer,!1),n=O(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=O(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=O(e.type,Xn.OTHER),this.serverKey=e.serverKey,this.state=fe.UNISSUED,this.deferred=void 0,this.cancelled=!1}It.prototype.cancel=function(){this.cancelled=!0};It.prototype.clone=function(e){return p(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=fe.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new It(this)};var Zn=It;function _r(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let o=0;o<n.length;++o){let i=n[o],r=i.indexOf(": ");if(r>0){let a=i.substring(0,r),u=i.substring(r+2);t[a]=u}}return t}var Jn=_r;function Gn(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=Jn(this.responseHeaders))}Gn.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var mt=Gn;var qt=Ze(Qe(),1);function yt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(yt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});yt.prototype.addEventListener=function(e,t){s.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};yt.prototype.removeEventListener=function(e,t){s.typeOf.func("listener",e);let n=this._listeners,o=this._scopes,i=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&o[r]===t){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function Sr(e,t){return t-e}yt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,o=t.length;for(e=0;e<o;e++){let r=t[e];p(r)&&t[e].apply(n[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(Sr),e=0;e<o;e++){let r=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var Kn=yt;function He(e){s.typeOf.object("options",e),s.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){s.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function on(e,t,n){let o=e[t];e[t]=e[n],e[n]=o}He.prototype.reserve=function(e){e=O(e,this._length),this._array.length=e};He.prototype.heapify=function(e){e=O(e,0);let t=this._length,n=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let a=2*(e+1),u=a-1;u<t&&n(o[u],o[e])<0?i=u:i=e,a<t&&n(o[a],o[i])<0&&(i=a),i!==e?(on(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};He.prototype.insert=function(e){s.defined("element",e);let t=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){let a=Math.floor((i-1)/2);if(n(t[i],t[a])<0)on(t,i,a),i=a;else break}let r;return p(o)&&this._length>o&&(r=t[o],this._length=o),r};He.prototype.pop=function(e){if(e=O(e,0),this._length===0)return;s.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return on(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var eo=He;function Rr(e,t){return e.priority-t.priority}var K={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,we=new eo({comparator:Rr});we.maximumLength=ot;we.reserve(ot);var ve=[],Pe={},Er=typeof document<"u"?new qt.default(document.location.href):new qt.default,Dt=new Kn;function se(){}se.maximumRequests=50;se.maximumRequestsPerServer=18;se.requestsByServer={};se.throttleRequests=!0;se.debugShowStatistics=!1;se.requestCompletedEvent=Dt;Object.defineProperties(se,{statistics:{get:function(){return K}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;we.length>e;){let t=we.pop();$e(t)}ot=e,we.maximumLength=e,we.reserve(e)}}});function to(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}se.serverHasOpenSlots=function(e,t){t=O(t,1);let n=O(se.requestsByServer[e],se.maximumRequestsPerServer);return Pe[e]+t<=n};se.heapHasOpenSlots=function(e){return we.length+e<=ot};function no(e){return e.state===fe.UNISSUED&&(e.state=fe.ISSUED,e.deferred=We()),e.deferred.promise}function Tr(e){return function(t){if(e.state===fe.CANCELLED)return;let n=e.deferred;--K.numberOfActiveRequests,--Pe[e.serverKey],Dt.raiseEvent(),e.state=fe.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Cr(e){return function(t){e.state!==fe.CANCELLED&&(++K.numberOfFailedRequests,--K.numberOfActiveRequests,--Pe[e.serverKey],Dt.raiseEvent(t),e.state=fe.FAILED,e.deferred.reject(t))}}function oo(e){let t=no(e);return e.state=fe.ACTIVE,ve.push(e),++K.numberOfActiveRequests,++K.numberOfActiveRequestsEver,++Pe[e.serverKey],e.requestFunction().then(Tr(e)).catch(Cr(e)),t}function $e(e){let t=e.state===fe.ACTIVE;if(e.state=fe.CANCELLED,++K.numberOfCancelledRequests,p(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--K.numberOfActiveRequests,--Pe[e.serverKey],++K.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}se.update=function(){let e,t,n=0,o=ve.length;for(e=0;e<o;++e){if(t=ve[e],t.cancelled&&$e(t),t.state!==fe.ACTIVE){++n;continue}n>0&&(ve[e-n]=t)}ve.length-=n;let i=we.internalArray,r=we.length;for(e=0;e<r;++e)to(i[e]);we.resort();let a=Math.max(se.maximumRequests-ve.length,0),u=0;for(;u<a&&we.length>0;){if(t=we.pop(),t.cancelled){$e(t);continue}if(t.throttleByServer&&!se.serverHasOpenSlots(t.serverKey)){$e(t);continue}oo(t),++u}vr()};se.getServerKey=function(e){s.typeOf.string("url",e);let t=new qt.default(e);t.scheme()===""&&(t=t.absoluteTo(Er),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let o=Pe[n];return p(o)||(Pe[n]=0),n};se.request=function(e){if(s.typeOf.object("request",e),s.typeOf.string("request.url",e.url),s.typeOf.func("request.requestFunction",e.requestFunction),zt(e.url)||Ut(e.url))return Dt.raiseEvent(),e.state=fe.RECEIVED,e.requestFunction();if(++K.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return oo(e);if(ve.length>=se.maximumRequests)return;to(e);let t=we.insert(e);if(p(t)){if(t===e)return;$e(t)}return no(e)};function vr(){se.debugShowStatistics&&(K.numberOfActiveRequests===0&&K.lastNumberOfActiveRequests>0&&(K.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${K.numberOfAttemptedRequests}`),K.numberOfAttemptedRequests=0),K.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${K.numberOfCancelledRequests}`),K.numberOfCancelledRequests=0),K.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${K.numberOfCancelledActiveRequests}`),K.numberOfCancelledActiveRequests=0),K.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${K.numberOfFailedRequests}`),K.numberOfFailedRequests=0)),K.lastNumberOfActiveRequests=K.numberOfActiveRequests)}se.clearForSpecs=function(){for(;we.length>0;){let t=we.pop();$e(t)}let e=ve.length;for(let t=0;t<e;++t)$e(ve[t]);ve.length=0,Pe={},K.numberOfAttemptedRequests=0,K.numberOfActiveRequests=0,K.numberOfCancelledRequests=0,K.numberOfCancelledActiveRequests=0,K.numberOfFailedRequests=0,K.numberOfActiveRequestsEver=0,K.lastNumberOfActiveRequests=0};se.numberOfActiveRequestsByServer=function(e){return Pe[e]};se.requestHeap=we;var Nt=se;var ro=Ze(Qe(),1);var lt={},rt={};lt.add=function(e,t){if(!p(e))throw new j("host is required.");if(!p(t)||t<=0)throw new j("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])||(rt[n]=!0)};lt.remove=function(e,t){if(!p(e))throw new j("host is required.");if(!p(t)||t<=0)throw new j("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;p(rt[n])&&delete rt[n]};function Ar(e){let t=new ro.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}lt.contains=function(e){if(!p(e))throw new j("url is required.");let t=Ar(e);return!!(p(t)&&p(rt[t]))};lt.clear=function(){rt={}};var rn=lt;var so=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function U(e){e=O(e,O.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),s.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=O(e.request,new Zn),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=O(e.retryAttempts,0),this._retryCount=0,O(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Ae(e,t){return p(e)?nt(e):t}U.createIfNeeded=function(e){return e instanceof U?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new U({url:e})};var it;U.supportsImageBitmapOptions=function(){return p(it)?it:typeof createImageBitmap!="function"?(it=Promise.resolve(!1),it):(it=U.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=nn(t[0]),o=nn(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),it)};Object.defineProperties(U,{isBlobSupported:{get:function(){return so}}});Object.defineProperties(U.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return Qn(this._url)}},isDataUri:{get:function(){return zt(this._url)}},isBlobUri:{get:function(){return Ut(this._url)}},isCrossOriginUrl:{get:function(){return Hn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});U.prototype.toString=function(){return this.getUrlComponent(!0,!0)};U.prototype.parseUrl=function(e,t,n,o){let i=new co.default(e),r=jr(i.query());this._queryParameters=t?Ft(r,this.queryParameters,n):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(dt(o))),this._url=i.toString()};function jr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Yn(e)}function Ft(e,t,n){if(!n)return De(e,t);let o=nt(e,!0);for(let i in t)if(t.hasOwnProperty(i)){let r=o[i],a=t[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(a)):o[i]=Array.isArray(a)?a.slice():a}return o}U.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Mr(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,r){let a=o[r];return p(a)?encodeURIComponent(a):i})),t&&p(this.proxy)&&(n=this.proxy.getURL(n)),n};function Mr(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!p(e[t[0]])?`?${t[0]}`:`?${Vn(e)}`}U.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Ft(this._queryParameters,e,!1):this._queryParameters=Ft(e,this._queryParameters,!1)};U.prototype.appendQueryParameters=function(e){this._queryParameters=Ft(e,this._queryParameters,!0)};U.prototype.setTemplateValues=function(e,t){t?this._templateValues=De(this._templateValues,e):this._templateValues=De(e,this._templateValues)};U.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let n=O(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return p(e.queryParameters)&&(t._queryParameters=De(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=De(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=De(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};U.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(o){return++n._retryCount,o})};U.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new U({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:p(this.credits)?this.credits.slice():void 0})};U.prototype.getBaseUri=function(e){return xn(this.getUrlComponent(e),e)};U.prototype.appendForwardSlash=function(){this._url=Nn(this._url)};U.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};U.fetchArrayBuffer=function(e){return new U(e).fetchArrayBuffer()};U.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};U.fetchBlob=function(e){return new U(e).fetchBlob()};U.prototype.fetchImage=function(e){e=O(e,O.EMPTY_OBJECT);let t=O(e.preferImageBitmap,!1),n=O(e.preferBlob,!1),o=O(e.flipY,!1),i=O(e.skipColorSpaceConversion,!1);if(sn(this.request),!so||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return cn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});let r=this.fetchBlob();if(!p(r))return;let a,u,d,m;return U.supportsImageBitmapOptions().then(function(l){return a=l,u=a&&t,r}).then(function(l){if(!p(l))return;if(m=l,u)return U.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new U({url:w}),cn({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function cn(e){let t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let u=!1;!t.isDataUri&&!t.isBlobUri&&(u=t.isCrossOriginUrl);let d=We();return U._Implementations.createImage(r,u,d,n,o,i),d.promise};let a=Nt.request(r);if(p(a))return a.catch(function(u){return r.state!==fe.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(r.state=fe.UNISSUED,r.deferred=void 0,cn({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}U.fetchImage=function(e){return new U(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};U.prototype.fetchText=function(){return this.fetch({responseType:"text"})};U.fetchText=function(e){return new U(e).fetchText()};U.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(t){if(p(t))return JSON.parse(t)})};U.fetchJson=function(e){return new U(e).fetchJson()};U.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};U.fetchXML=function(e){return new U(e).fetchXML()};U.prototype.fetchJsonp=function(e){e=O(e,"callback"),sn(this.request);let t;do t=`loadJsonp${E.nextRandomNumber().toString().substring(2,8)}`;while(p(window[t]));return ao(this,e,t)};function ao(e,t,n){let o={};o[t]=n,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=We();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},U._Implementations.loadAndExecuteScript(r,n,u),u.promise};let a=Nt.request(i);if(p(a))return a.catch(function(u){return i.state!==fe.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=fe.UNISSUED,i.deferred=void 0,ao(e,t,n)):Promise.reject(u)})})}U.fetchJsonp=function(e){return new U(e).fetchJsonp(e.callbackParameterName)};U.prototype._makeRequest=function(e){let t=this;sn(t.request);let n=t.request,o=t.url;n.url=o,n.requestFunction=function(){let r=e.responseType,a=De(e.headers,t.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=We(),w=U._Implementations.loadWithXhr(o,r,d,m,a,l,u);return p(w)&&p(w.abort)&&(n.cancelFunction=function(){w.abort()}),l.promise};let i=Nt.request(n);if(p(i))return i.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==fe.FAILED?Promise.reject(r):t.retryOnError(r).then(function(a){return a?(n.state=fe.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function sn(e){if(e.state===fe.ISSUED||e.state===fe.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=fe.UNISSUED,e.deferred=void 0}var Pr=/^data:(.*?)(;base64)?,(.*)$/;function kt(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function io(e,t){let n=kt(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return o}function Ur(e,t){t=O(t,"");let n=e[1],o=!!e[2],i=e[3],r,a;switch(t){case"":case"text":return kt(o,i);case"arraybuffer":return io(o,i);case"blob":return r=io(o,i),new Blob([r],{type:n});case"document":return a=new DOMParser,a.parseFromString(kt(o,i),n);case"json":return JSON.parse(kt(o,i));default:throw new j(`Unhandled responseType: ${t}`)}}U.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};U.fetch=function(e){return new U(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};U.delete=function(e){return new U(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};U.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};U.head=function(e){return new U(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};U.options=function(e){return new U(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U.prototype.post=function(e,t){return s.defined("data",e),t=Ae(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};U.post=function(e){return new U(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U.prototype.put=function(e,t){return s.defined("data",e),t=Ae(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};U.put=function(e){return new U(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U.prototype.patch=function(e,t){return s.defined("data",e),t=Ae(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};U.patch=function(e){return new U(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};U._Implementations={};U._Implementations.loadImageElement=function(e,t,n){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(rn.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};U._Implementations.createImage=function(e,t,n,o,i,r){let a=e.url;U.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){U._Implementations.loadImageElement(a,t,n);return}let d="blob",m="GET",l=We(),w=U._Implementations.loadWithXhr(a,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(T){if(!p(T)){n.reject(new Se(`Successfully retrieved ${a} but it contained no content.`));return}return U.createImageBitmapFromBlob(T,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(T){n.resolve(T)})}).catch(function(u){n.reject(u)})};U.createImageBitmapFromBlob=function(e,t){return s.defined("options",t),s.typeOf.bool("options.flipY",t.flipY),s.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),s.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function zr(e,t,n,o,i,r,a){fetch(e,{method:n,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new mt(u.status,u,d));return}switch(t){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new mt)})}var Ir=typeof XMLHttpRequest>"u";U._Implementations.loadWithXhr=function(e,t,n,o,i,r,a){let u=Pr.exec(e);if(u!==null){r.resolve(Ur(u,t));return}if(Ir){zr(e,t,n,o,i,r,a);return}let d=new XMLHttpRequest;if(rn.contains(e)&&(d.withCredentials=!0),d.open(n,e,!0),p(a)&&p(d.overrideMimeType)&&d.overrideMimeType(a),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(t)&&(d.responseType=t);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new mt(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let C=d.getAllResponseHeaders().trim().split(/[\r\n]+/),P={};C.forEach(function(A){let q=A.split(": "),k=q.shift();P[k]=q.join(": ")}),r.resolve(P);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(t)||w===t))r.resolve(l);else if(t==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(T){r.reject(T)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new mt)},d.send(o),d};U._Implementations.loadAndExecuteScript=function(e,t,n){return $n(e,t).catch(function(o){n.reject(o)})};U._DefaultImplementations={};U._DefaultImplementations.createImage=U._Implementations.createImage;U._DefaultImplementations.loadWithXhr=U._Implementations.loadWithXhr;U._DefaultImplementations.loadAndExecuteScript=U._Implementations.loadAndExecuteScript;U.DEFAULT=Object.freeze(new U({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ke=U;function bt(e){e=O(e,O.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=O(e.addNewLeapSeconds,!0),p(e.data)?fo(this,e.data):fo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}bt.fromUrl=async function(e,t){s.defined("url",e),t=O(t,O.EMPTY_OBJECT);let n=ke.createIfNeeded(e),o;try{o=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new bt({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};bt.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new pt(0,0,0,0,0),t}});bt.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new pt(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,o=this._lastIndex,i=0,r=0;if(p(o)){let u=n[o],d=n[o+1],m=pe.lessThanOrEquals(u,e),l=!p(d),w=l||pe.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,po(this,n,this._samples,e,i,r,t),t}let a=Be(n,e,pe.compare,this._dateColumn);return a>=0?(a<n.length-1&&n[a+1].equals(e)&&++a,i=a,r=a):(r=~a,i=r-1,i<0&&(i=0)),this._lastIndex=i,po(this,n,this._samples,e,i,r,t),t};function qr(e,t){return pe.compare(e.julianDate,t)}function fo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||r<0||a<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=t.samples,l=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w,T=e._addNewLeapSeconds;for(let C=0,P=m.length;C<P;C+=e._columnCount){let A=m[C+n],q=m[C+d],k=A+ce.MODIFIED_JULIAN_DATE_DIFFERENCE,L=new pe(k,q,$.TAI);if(l.push(L),T){if(q!==w&&p(w)){let F=pe.leapSeconds,B=Be(F,L,qr);if(B<0){let W=new ne(L,q);F.splice(~B,0,W)}}w=q}}}function uo(e,t,n,o,i){let r=n*o;i.xPoleWander=t[r+e._xPoleWanderRadiansColumn],i.yPoleWander=t[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function wt(e,t,n){return t+e*(n-t)}function po(e,t,n,o,i,r,a){let u=e._columnCount;if(r>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;let d=t[i],m=t[r];if(d.equals(m)||o.equals(d))return uo(e,n,i,u,a),a;if(o.equals(m))return uo(e,n,r,u,a),a;let l=pe.secondsDifference(o,d)/pe.secondsDifference(m,d),w=i*u,T=r*u,C=n[w+e._ut1MinusUtcSecondsColumn],P=n[T+e._ut1MinusUtcSecondsColumn],A=P-C;if(A>.5||A<-.5){let q=n[w+e._taiMinusUtcSecondsColumn],k=n[T+e._taiMinusUtcSecondsColumn];q!==k&&(m.equals(o)?C=P:P-=k-q)}return a.xPoleWander=wt(l,n[w+e._xPoleWanderRadiansColumn],n[T+e._xPoleWanderRadiansColumn]),a.yPoleWander=wt(l,n[w+e._yPoleWanderRadiansColumn],n[T+e._yPoleWanderRadiansColumn]),a.xPoleOffset=wt(l,n[w+e._xCelestialPoleOffsetRadiansColumn],n[T+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=wt(l,n[w+e._yCelestialPoleOffsetRadiansColumn],n[T+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=wt(l,C,P),a}var ho=bt;function be(e,t,n){this.heading=O(e,0),this.pitch=O(t,0),this.roll=O(n,0)}be.fromQuaternion=function(e,t){if(!p(e))throw new j("quaternion is required");p(t)||(t=new be);let n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),a=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(a,r),t.roll=Math.atan2(i,o),t.pitch=-E.asinClamped(n),t};be.fromDegrees=function(e,t,n,o){if(!p(e))throw new j("heading is required");if(!p(t))throw new j("pitch is required");if(!p(n))throw new j("roll is required");return p(o)||(o=new be),o.heading=e*E.RADIANS_PER_DEGREE,o.pitch=t*E.RADIANS_PER_DEGREE,o.roll=n*E.RADIANS_PER_DEGREE,o};be.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new be(e.heading,e.pitch,e.roll)};be.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};be.equalsEpsilon=function(e,t,n,o){return e===t||p(e)&&p(t)&&E.equalsEpsilon(e.heading,t.heading,n,o)&&E.equalsEpsilon(e.pitch,t.pitch,n,o)&&E.equalsEpsilon(e.roll,t.roll,n,o)};be.prototype.clone=function(e){return be.clone(this,e)};be.prototype.equals=function(e){return be.equals(this,e)};be.prototype.equalsEpsilon=function(e,t,n){return be.equalsEpsilon(this,e,t,n)};be.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Lt=be;var mo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Dr(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let o=e[t].getAttribute("src"),i=mo.exec(o);if(i!==null)return i[1]}}var xt;function yo(e){return typeof document>"u"?e:(p(xt)||(xt=document.createElement("a")),xt.href=e,xt.href)}var Ve;function lo(){if(p(Ve))return Ve;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=dt(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(_t.toUrl)?e=dt("..",Ye("Core/buildModuleUrl.js")):e=Dr(),!p(e))throw new j("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ve=new ke({url:yo(e)}),Ve.appendForwardSlash(),Ve}function Nr(e){return yo(_t.toUrl(`../${e}`))}function wo(e){return lo().getDerivedResource({url:e}).url}var Bt;function Ye(e){return p(Bt)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(_t.toUrl)?Bt=Nr:Bt=wo),Bt(e)}Ye._cesiumScriptRegex=mo;Ye._buildModuleUrlFromBaseUrl=wo;Ye._clearBaseResource=function(){Ve=void 0};Ye.setBaseUrl=function(e){Ve=ke.DEFAULT.getDerivedResource({url:e})};Ye.getCesiumBaseUrl=lo;var bo=Ye;function kr(e,t,n){this.x=e,this.y=t,this.s=n}var Qt=kr;function un(e){e=O(e,O.EMPTY_OBJECT),this._xysFileUrlTemplate=ke.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=O(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=O(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new pe(this._sampleZeroJulianEphemerisDate,0,$.TAI),this._stepSizeDays=O(e.stepSizeDays,1),this._samplesPerXysFile=O(e.samplesPerXysFile,1e3),this._totalSamples=O(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=i,o[r]=r*this._stepSizeDays;for(let a=0;a<=t;++a)a!==r&&(n[r]*=r-a);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var Fr=new pe(0,0,$.TAI);function an(e,t,n){let o=Fr;return o.dayNumber=t,o.secondsOfDay=n,pe.daysDifference(o,e._sampleZeroDateTT)}un.prototype.preload=function(e,t,n,o){let i=an(this,e,t),r=an(this,n,o),a=i/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=a/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(fn(this,w));return Promise.all(l)};un.prototype.computeXysRadians=function(e,t,n){let o=an(this,e,t);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,a=i-(r/2|0);a<0&&(a=0);let u=a+r;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-r,a<0&&(a=0));let d=!1,m=this._samples;if(p(m[a*3])||(fn(this,a/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(fn(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(n)?(n.x=0,n.y=0,n.s=0):n=new Qt(0,0,0);let l=o-a*this._stepSizeDays,w=this._work,T=this._denominators,C=this._coef,P=this._xTable,A,q;for(A=0;A<=r;++A)w[A]=l-P[A];for(A=0;A<=r;++A){for(C[A]=1,q=0;q<=r;++q)q!==A&&(C[A]*=w[q]);C[A]*=T[A];let k=(a+A)*3;n.x+=C[A]*m[k++],n.y+=C[A]*m[k++],n.s+=C[A]*m[k]}return n};function fn(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,o=e._xysFileUrlTemplate;p(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new ke({url:bo(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let i=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let a=e._samples,u=r.samples,d=t*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)a[d+m]=u[m]});return e._chunkDownloadsInProgress[t]=i,i}var Oo=un;function R(e,t,n,o){this.x=O(e,0),this.y=O(t,0),this.z=O(n,0),this.w=O(o,0)}var Ot=new _;R.fromAxisAngle=function(e,t,n){s.typeOf.object("axis",e),s.typeOf.number("angle",t);let o=t/2,i=Math.sin(o);Ot=_.normalize(e,Ot);let r=Ot.x*i,a=Ot.y*i,u=Ot.z*i,d=Math.cos(o);return p(n)?(n.x=r,n.y=a,n.z=u,n.w=d,n):new R(r,a,u,d)};var Lr=[1,2,0],xr=new Array(3);R.fromRotationMatrix=function(e,t){s.typeOf.object("matrix",e);let n,o,i,r,a,u=e[Q.COLUMN0ROW0],d=e[Q.COLUMN1ROW1],m=e[Q.COLUMN2ROW2],l=u+d+m;if(l>0)n=Math.sqrt(l+1),a=.5*n,n=.5/n,o=(e[Q.COLUMN1ROW2]-e[Q.COLUMN2ROW1])*n,i=(e[Q.COLUMN2ROW0]-e[Q.COLUMN0ROW2])*n,r=(e[Q.COLUMN0ROW1]-e[Q.COLUMN1ROW0])*n;else{let w=Lr,T=0;d>u&&(T=1),m>u&&m>d&&(T=2);let C=w[T],P=w[C];n=Math.sqrt(e[Q.getElementIndex(T,T)]-e[Q.getElementIndex(C,C)]-e[Q.getElementIndex(P,P)]+1);let A=xr;A[T]=.5*n,n=.5/n,a=(e[Q.getElementIndex(P,C)]-e[Q.getElementIndex(C,P)])*n,A[C]=(e[Q.getElementIndex(C,T)]+e[Q.getElementIndex(T,C)])*n,A[P]=(e[Q.getElementIndex(P,T)]+e[Q.getElementIndex(T,P)])*n,o=-A[0],i=-A[1],r=-A[2]}return p(t)?(t.x=o,t.y=i,t.z=r,t.w=a,t):new R(o,i,r,a)};var go=new R,_o=new R,pn=new R,So=new R;R.fromHeadingPitchRoll=function(e,t){return s.typeOf.object("headingPitchRoll",e),So=R.fromAxisAngle(_.UNIT_X,e.roll,go),pn=R.fromAxisAngle(_.UNIT_Y,-e.pitch,t),t=R.multiply(pn,So,pn),_o=R.fromAxisAngle(_.UNIT_Z,-e.heading,go),R.multiply(_o,t,t)};var Wt=new _,hn=new _,Ee=new R,Ro=new R,Ht=new R;R.packedLength=4;R.pack=function(e,t,n){return s.typeOf.object("value",e),s.defined("array",t),n=O(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};R.unpack=function(e,t,n){return s.defined("array",e),t=O(t,0),p(n)||(n=new R),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};R.packedInterpolationLength=3;R.convertPackedArrayForInterpolation=function(e,t,n,o){R.unpack(e,n*4,Ht),R.conjugate(Ht,Ht);for(let i=0,r=n-t+1;i<r;i++){let a=i*3;R.unpack(e,(t+i)*4,Ee),R.multiply(Ee,Ht,Ee),Ee.w<0&&R.negate(Ee,Ee),R.computeAxis(Ee,Wt);let u=R.computeAngle(Ee);p(o)||(o=[]),o[a]=Wt.x*u,o[a+1]=Wt.y*u,o[a+2]=Wt.z*u}};R.unpackInterpolationResult=function(e,t,n,o,i){p(i)||(i=new R),_.fromArray(e,0,hn);let r=_.magnitude(hn);return R.unpack(t,o*4,Ro),r===0?R.clone(R.IDENTITY,Ee):R.fromAxisAngle(hn,r,Ee),R.multiply(Ee,Ro,i)};R.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new R(e.x,e.y,e.z,e.w)};R.conjugate=function(e,t){return s.typeOf.object("quaternion",e),s.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};R.magnitudeSquared=function(e){return s.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};R.magnitude=function(e){return Math.sqrt(R.magnitudeSquared(e))};R.normalize=function(e,t){s.typeOf.object("result",t);let n=1/R.magnitude(e),o=e.x*n,i=e.y*n,r=e.z*n,a=e.w*n;return t.x=o,t.y=i,t.z=r,t.w=a,t};R.inverse=function(e,t){s.typeOf.object("result",t);let n=R.magnitudeSquared(e);return t=R.conjugate(e,t),R.multiplyByScalar(t,1/n,t)};R.add=function(e,t,n){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};R.subtract=function(e,t,n){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};R.negate=function(e,t){return s.typeOf.object("quaternion",e),s.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};R.dot=function(e,t){return s.typeOf.object("left",e),s.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};R.multiply=function(e,t,n){s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n);let o=e.x,i=e.y,r=e.z,a=e.w,u=t.x,d=t.y,m=t.z,l=t.w,w=a*u+o*l+i*m-r*d,T=a*d-o*m+i*l+r*u,C=a*m+o*d-i*u+r*l,P=a*l-o*u-i*d-r*m;return n.x=w,n.y=T,n.z=C,n.w=P,n};R.multiplyByScalar=function(e,t,n){return s.typeOf.object("quaternion",e),s.typeOf.number("scalar",t),s.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};R.divideByScalar=function(e,t,n){return s.typeOf.object("quaternion",e),s.typeOf.number("scalar",t),s.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};R.computeAxis=function(e,t){s.typeOf.object("quaternion",e),s.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<E.EPSILON6||Math.abs(n+1)<E.EPSILON6)return t.x=1,t.y=t.z=0,t;let o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};R.computeAngle=function(e){return s.typeOf.object("quaternion",e),Math.abs(e.w-1)<E.EPSILON6?0:2*Math.acos(e.w)};var dn=new R;R.lerp=function(e,t,n,o){return s.typeOf.object("start",e),s.typeOf.object("end",t),s.typeOf.number("t",n),s.typeOf.object("result",o),dn=R.multiplyByScalar(t,n,dn),o=R.multiplyByScalar(e,1-n,o),R.add(dn,o,o)};var Eo=new R,mn=new R,yn=new R;R.slerp=function(e,t,n,o){s.typeOf.object("start",e),s.typeOf.object("end",t),s.typeOf.number("t",n),s.typeOf.object("result",o);let i=R.dot(e,t),r=t;if(i<0&&(i=-i,r=Eo=R.negate(t,Eo)),1-i<E.EPSILON6)return R.lerp(e,r,n,o);let a=Math.acos(i);return mn=R.multiplyByScalar(e,Math.sin((1-n)*a),mn),yn=R.multiplyByScalar(r,Math.sin(n*a),yn),o=R.add(mn,yn,o),R.multiplyByScalar(o,1/Math.sin(a),o)};R.log=function(e,t){s.typeOf.object("quaternion",e),s.typeOf.object("result",t);let n=E.acosClamped(e.w),o=0;return n!==0&&(o=n/Math.sin(n)),_.multiplyByScalar(e,o,t)};R.exp=function(e,t){s.typeOf.object("cartesian",e),s.typeOf.object("result",t);let n=_.magnitude(e),o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};var Br=new _,Qr=new _,gt=new R,ct=new R;R.computeInnerQuadrangle=function(e,t,n,o){s.typeOf.object("q0",e),s.typeOf.object("q1",t),s.typeOf.object("q2",n),s.typeOf.object("result",o);let i=R.conjugate(t,gt);R.multiply(i,n,ct);let r=R.log(ct,Br);R.multiply(i,e,ct);let a=R.log(ct,Qr);return _.add(r,a,r),_.multiplyByScalar(r,.25,r),_.negate(r,r),R.exp(r,gt),R.multiply(t,gt,o)};R.squad=function(e,t,n,o,i,r){s.typeOf.object("q0",e),s.typeOf.object("q1",t),s.typeOf.object("s0",n),s.typeOf.object("s1",o),s.typeOf.number("t",i),s.typeOf.object("result",r);let a=R.slerp(e,t,i,gt),u=R.slerp(n,o,i,ct);return R.slerp(a,u,2*i*(1-i),r)};var Wr=new R,To=1.9011074535173003,$t=ft.supportsTypedArrays()?new Float32Array(8):[],Vt=ft.supportsTypedArrays()?new Float32Array(8):[],Ue=ft.supportsTypedArrays()?new Float32Array(8):[],ze=ft.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;$t[e]=1/(t*n),Vt[e]=t/n}$t[7]=To/(8*17);Vt[7]=To*8/17;R.fastSlerp=function(e,t,n,o){s.typeOf.object("start",e),s.typeOf.object("end",t),s.typeOf.number("t",n),s.typeOf.object("result",o);let i=R.dot(e,t),r;i>=0?r=1:(r=-1,i=-i);let a=i-1,u=1-n,d=n*n,m=u*u;for(let C=7;C>=0;--C)Ue[C]=($t[C]*d-Vt[C])*a,ze[C]=($t[C]*m-Vt[C])*a;let l=r*n*(1+Ue[0]*(1+Ue[1]*(1+Ue[2]*(1+Ue[3]*(1+Ue[4]*(1+Ue[5]*(1+Ue[6]*(1+Ue[7])))))))),w=u*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),T=R.multiplyByScalar(e,w,Wr);return R.multiplyByScalar(t,l,o),R.add(T,o,o)};R.fastSquad=function(e,t,n,o,i,r){s.typeOf.object("q0",e),s.typeOf.object("q1",t),s.typeOf.object("s0",n),s.typeOf.object("s1",o),s.typeOf.number("t",i),s.typeOf.object("result",r);let a=R.fastSlerp(e,t,i,gt),u=R.fastSlerp(n,o,i,ct);return R.fastSlerp(a,u,2*i*(1-i),r)};R.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};R.equalsEpsilon=function(e,t,n){return n=O(n,0),e===t||p(e)&&p(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};R.ZERO=Object.freeze(new R(0,0,0,0));R.IDENTITY=Object.freeze(new R(0,0,0,1));R.prototype.clone=function(e){return R.clone(this,e)};R.prototype.equals=function(e){return R.equals(this,e)};R.prototype.equalsEpsilon=function(e,t){return R.equalsEpsilon(this,e,t)};R.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=R;var V={},ln={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},st={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},wn={},ge={east:new _,north:new _,up:new _,west:new _,south:new _,down:new _},Fe=new _,Le=new _,xe=new _;V.localFrameToFixedFrameGenerator=function(e,t){if(!ln.hasOwnProperty(e)||!ln[e].hasOwnProperty(t))throw new j("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=ln[e][t],o,i=e+t;return p(wn[i])?o=wn[i]:(o=function(r,a,u){if(!p(r))throw new j("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new j("origin has a NaN component");if(p(u)||(u=new G),_.equalsEpsilon(r,_.ZERO,E.EPSILON14))_.unpack(st[e],0,Fe),_.unpack(st[t],0,Le),_.unpack(st[n],0,xe);else if(E.equalsEpsilon(r.x,0,E.EPSILON14)&&E.equalsEpsilon(r.y,0,E.EPSILON14)){let d=E.sign(r.z);_.unpack(st[e],0,Fe),e!=="east"&&e!=="west"&&_.multiplyByScalar(Fe,d,Fe),_.unpack(st[t],0,Le),t!=="east"&&t!=="west"&&_.multiplyByScalar(Le,d,Le),_.unpack(st[n],0,xe),n!=="east"&&n!=="west"&&_.multiplyByScalar(xe,d,xe)}else{a=O(a,Ie.default),a.geodeticSurfaceNormal(r,ge.up);let d=ge.up,m=ge.east;m.x=-r.y,m.y=r.x,m.z=0,_.normalize(m,ge.east),_.cross(d,m,ge.north),_.multiplyByScalar(ge.up,-1,ge.down),_.multiplyByScalar(ge.east,-1,ge.west),_.multiplyByScalar(ge.north,-1,ge.south),Fe=ge[e],Le=ge[t],xe=ge[n]}return u[0]=Fe.x,u[1]=Fe.y,u[2]=Fe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=xe.x,u[9]=xe.y,u[10]=xe.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},wn[i]=o),o};V.eastNorthUpToFixedFrame=V.localFrameToFixedFrameGenerator("east","north");V.northEastDownToFixedFrame=V.localFrameToFixedFrameGenerator("north","east");V.northUpEastToFixedFrame=V.localFrameToFixedFrameGenerator("north","up");V.northWestUpToFixedFrame=V.localFrameToFixedFrameGenerator("north","west");var Hr=new Xe,$r=new _(1,1,1),Vr=new G;V.headingPitchRollToFixedFrame=function(e,t,n,o,i){s.typeOf.object("HeadingPitchRoll",t),o=O(o,V.eastNorthUpToFixedFrame);let r=Xe.fromHeadingPitchRoll(t,Hr),a=G.fromTranslationQuaternionRotationScale(_.ZERO,r,$r,Vr);return i=o(e,n,i),G.multiply(i,a,i)};var Yr=new G,Xr=new Q;V.headingPitchRollQuaternion=function(e,t,n,o,i){s.typeOf.object("HeadingPitchRoll",t);let r=V.headingPitchRollToFixedFrame(e,t,n,o,Yr),a=G.getMatrix3(r,Xr);return Xe.fromRotationMatrix(a,i)};var Zr=new _(1,1,1),Jr=new _,Co=new G,Gr=new G,Kr=new Q,ei=new Xe;V.fixedFrameToHeadingPitchRoll=function(e,t,n,o){s.defined("transform",e),t=O(t,Ie.default),n=O(n,V.eastNorthUpToFixedFrame),p(o)||(o=new Lt);let i=G.getTranslation(e,Jr);if(_.equals(i,_.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=G.inverseTransformation(n(i,t,Co),Co),a=G.setScale(e,Zr,Gr);a=G.setTranslation(a,_.ZERO,a),r=G.multiply(r,a,r);let u=Xe.fromRotationMatrix(G.getMatrix3(r,Kr),ei);return u=Xe.normalize(u,u),Lt.fromQuaternion(u,o)};var ti=6*3600+41*60+50.54841,ni=8640184812866e-6,oi=.093104,ri=-62e-7,ii=11772758384668e-32,ci=72921158553e-15,si=E.TWO_PI/86400,Yt=new pe;V.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=V.computeIcrfToFixedMatrix(e,t);return p(n)||(n=V.computeTemeToPseudoFixedMatrix(e,t)),n};V.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new j("date is required.");Yt=pe.addSeconds(e,-pe.computeTaiMinusUtc(e),Yt);let n=Yt.dayNumber,o=Yt.secondsOfDay,i,r=n-2451545;o>=43200?i=(r+.5)/ce.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ce.DAYS_PER_JULIAN_CENTURY;let u=(ti+i*(ni+i*(oi+i*ri)))*si%E.TWO_PI,d=ci+ii*(n-24515455e-1),m=(o+ce.SECONDS_PER_DAY*.5)%ce.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),T=Math.sin(l);return p(t)?(t[0]=w,t[1]=-T,t[2]=0,t[3]=T,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Q(w,T,0,-T,w,0,0,0,1)};V.iau2006XysData=new Oo;V.earthOrientationParameters=ho.NONE;var gn=32.184,ai=2451545;V.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+gn,o=e.stop.dayNumber,i=e.stop.secondsOfDay+gn;return V.iau2006XysData.preload(t,n,o,i)};V.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new j("date is required.");p(t)||(t=new Q);let n=V.computeFixedToIcrfMatrix(e,t);if(p(n))return Q.transpose(n,t)};var fi=32.184,ui=2451545,Xt=new Lt,pi=new Q,hi=new pe;V.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new j("date is required.");p(t)||(t=new Q);let n=pe.addSeconds(e,fi,hi),o=pe.totalDays(n)-ui,i=E.toRadians(12.112)-E.toRadians(.052992)*o,r=E.toRadians(24.224)-E.toRadians(.105984)*o,a=E.toRadians(227.645)+E.toRadians(13.012)*o,u=E.toRadians(261.105)+E.toRadians(13.340716)*o,d=E.toRadians(358)+E.toRadians(.9856)*o;return Xt.pitch=E.toRadians(180)-E.toRadians(3.878)*Math.sin(i)-E.toRadians(.12)*Math.sin(r)+E.toRadians(.07)*Math.sin(a)-E.toRadians(.017)*Math.sin(u),Xt.roll=E.toRadians(66.53-90)+E.toRadians(1.543)*Math.cos(i)+E.toRadians(.24)*Math.cos(r)-E.toRadians(.028)*Math.cos(a)+E.toRadians(.007)*Math.cos(u),Xt.heading=E.toRadians(244.375-90)+E.toRadians(13.17635831)*o+E.toRadians(3.558)*Math.sin(i)+E.toRadians(.121)*Math.sin(r)-E.toRadians(.064)*Math.sin(a)+E.toRadians(.016)*Math.sin(u)+E.toRadians(.025)*Math.sin(d),Q.fromHeadingPitchRoll(Xt,pi)};V.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new j("date is required.");p(t)||(t=new Q);let n=V.computeMoonFixedToIcrfMatrix(e,t);if(p(n))return Q.transpose(n,t)};var di=new Qt(0,0,0),mi=new pt(0,0,0,0,0,0),bn=new Q,On=new Q;V.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new j("date is required.");p(t)||(t=new Q);let n=V.earthOrientationParameters.compute(e,mi);if(!p(n))return;let o=e.dayNumber,i=e.secondsOfDay+gn,r=V.iau2006XysData.computeXysRadians(o,i,di);if(!p(r))return;let a=r.x+n.xPoleOffset,u=r.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-a*a-u*u)),m=bn;m[0]=1-d*a*a,m[3]=-d*a*u,m[6]=a,m[1]=-d*a*u,m[4]=1-d*u*u,m[7]=u,m[2]=-a,m[5]=-u,m[8]=1-d*(a*a+u*u);let l=Q.fromRotationZ(-r.s,On),w=Q.multiply(m,l,bn),T=e.dayNumber,C=e.secondsOfDay-pe.computeTaiMinusUtc(e)+n.ut1MinusUtc,P=T-2451545,A=C/ce.SECONDS_PER_DAY,q=.779057273264+A+.00273781191135448*(P+A);q=q%1*E.TWO_PI;let k=Q.fromRotationZ(q,On),L=Q.multiply(w,k,bn),F=Math.cos(n.xPoleWander),B=Math.cos(n.yPoleWander),W=Math.sin(n.xPoleWander),H=Math.sin(n.yPoleWander),ee=o-ai+i/ce.SECONDS_PER_DAY;ee/=36525;let re=-47e-6*ee*E.RADIANS_PER_DEGREE/3600,Z=Math.cos(re),oe=Math.sin(re),J=On;return J[0]=F*Z,J[1]=F*oe,J[2]=W,J[3]=-B*oe+H*W*Z,J[4]=B*Z+H*W*oe,J[5]=-H*F,J[6]=-H*oe-B*W*Z,J[7]=H*Z-B*W*oe,J[8]=B*F,Q.multiply(L,J,t)};var yi=new qe;V.pointToWindowCoordinates=function(e,t,n,o){return o=V.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};V.pointToGLWindowCoordinates=function(e,t,n,o){if(!p(e))throw new j("modelViewProjectionMatrix is required.");if(!p(t))throw new j("viewportTransformation is required.");if(!p(n))throw new j("point is required.");p(o)||(o=new Oe);let i=yi;return G.multiplyByVector(e,qe.fromElements(n.x,n.y,n.z,1,i),i),qe.multiplyByScalar(i,1/i.w,i),G.multiplyByVector(t,i,i),Oe.fromCartesian4(i,o)};var li=new _,wi=new _,bi=new _;V.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!p(e))throw new j("position is required.");if(!p(t))throw new j("velocity is required.");let i=O(n,Ie.default).geodeticSurfaceNormal(e,li),r=_.cross(t,i,wi);_.equalsEpsilon(r,_.ZERO,E.EPSILON6)&&(r=_.clone(_.UNIT_X,r));let a=_.cross(r,t,bi);return _.normalize(a,a),_.cross(t,a,r),_.negate(r,r),_.normalize(r,r),p(o)||(o=new Q),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=a.x,o[7]=a.y,o[8]=a.z,o};var vo=new G(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Ao=new Me,_n=new _,Oi=new _,gi=new Q,Sn=new G,jo=new G;V.basisTo2D=function(e,t,n){if(!p(e))throw new j("projection is required.");if(!p(t))throw new j("matrix is required.");if(!p(n))throw new j("result is required.");let o=G.getTranslation(t,Oi),i=e.ellipsoid,r;if(_.equals(o,_.ZERO))r=_.clone(_.ZERO,_n);else{let l=i.cartesianToCartographic(o,Ao);r=e.project(l,_n),_.fromElements(r.z,r.x,r.y,r)}let a=V.eastNorthUpToFixedFrame(o,i,Sn),u=G.inverseTransformation(a,jo),d=G.getMatrix3(t,gi),m=G.multiplyByMatrix3(u,d,n);return G.multiply(vo,m,n),G.setTranslation(n,r,n),n};V.ellipsoidTo2DModelMatrix=function(e,t,n){if(!p(e))throw new j("projection is required.");if(!p(t))throw new j("center is required.");if(!p(n))throw new j("result is required.");let o=e.ellipsoid,i=V.eastNorthUpToFixedFrame(t,o,Sn),r=G.inverseTransformation(i,jo),a=o.cartesianToCartographic(t,Ao),u=e.project(a,_n);_.fromElements(u.z,u.x,u.y,u);let d=G.fromTranslation(u,Sn);return G.multiply(vo,r,n),G.multiply(d,n,n),n};var Mo=V;function x(e,t,n,o){this.west=O(e,0),this.south=O(t,0),this.east=O(n,0),this.north=O(o,0)}Object.defineProperties(x.prototype,{width:{get:function(){return x.computeWidth(this)}},height:{get:function(){return x.computeHeight(this)}}});x.packedLength=4;x.pack=function(e,t,n){return s.typeOf.object("value",e),s.defined("array",t),n=O(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};x.unpack=function(e,t,n){return s.defined("array",e),t=O(t,0),p(n)||(n=new x),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};x.computeWidth=function(e){s.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=E.TWO_PI),t-n};x.computeHeight=function(e){return s.typeOf.object("rectangle",e),e.north-e.south};x.fromDegrees=function(e,t,n,o,i){return e=E.toRadians(O(e,0)),t=E.toRadians(O(t,0)),n=E.toRadians(O(n,0)),o=E.toRadians(O(o,0)),p(i)?(i.west=e,i.south=t,i.east=n,i.north=o,i):new x(e,t,n,o)};x.fromRadians=function(e,t,n,o,i){return p(i)?(i.west=O(e,0),i.south=O(t,0),i.east=O(n,0),i.north=O(o,0),i):new x(e,t,n,o)};x.fromCartographicArray=function(e,t){s.defined("cartographics",e);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),a=Math.min(a,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-n>r-i&&(n=i,o=r,o>E.PI&&(o=o-E.TWO_PI),n>E.PI&&(n=n-E.TWO_PI)),p(t)?(t.west=n,t.south=a,t.east=o,t.north=u,t):new x(n,a,o,u)};x.fromCartesianArray=function(e,t,n){s.defined("cartesians",e),t=O(t,Ie.default);let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=t.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let T=w.longitude>=0?w.longitude:w.longitude+E.TWO_PI;r=Math.min(r,T),a=Math.max(a,T)}return i-o>a-r&&(o=r,i=a,i>E.PI&&(i=i-E.TWO_PI),o>E.PI&&(o=o-E.TWO_PI)),p(n)?(n.west=o,n.south=u,n.east=i,n.north=d,n):new x(o,u,i,d)};var _i=new _,Si=new _,Ri=new _,Ei=new _,Ti=new _,Rn=new Array(5);for(let e=0;e<Rn.length;++e)Rn[e]=new _;x.fromBoundingSphere=function(e,t,n){s.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(t)||(t=Ie.default),p(n)||(n=new x),_.equals(o,_.ZERO))return x.clone(x.MAX_VALUE,n),n;let r=Mo.eastNorthUpToFixedFrame(o,t,_i),a=G.multiplyByPointAsVector(r,_.UNIT_X,Si);_.normalize(a,a);let u=G.multiplyByPointAsVector(r,_.UNIT_Y,Ri);_.normalize(u,u),_.multiplyByScalar(u,i,u),_.multiplyByScalar(a,i,a);let d=_.negate(u,Ti),m=_.negate(a,Ei),l=Rn,w=l[0];return _.add(o,u,w),w=l[1],_.add(o,m,w),w=l[2],_.add(o,d,w),w=l[3],_.add(o,a,w),l[4]=o,x.fromCartesianArray(l,t,n)};x.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new x(e.west,e.south,e.east,e.north)};x.equalsEpsilon=function(e,t,n){return n=O(n,0),e===t||p(e)&&p(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};x.prototype.clone=function(e){return x.clone(this,e)};x.prototype.equals=function(e){return x.equals(this,e)};x.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};x.prototype.equalsEpsilon=function(e,t){return x.equalsEpsilon(this,e,t)};x._validate=function(e){s.typeOf.object("rectangle",e);let t=e.north;s.typeOf.number.greaterThanOrEquals("north",t,-E.PI_OVER_TWO),s.typeOf.number.lessThanOrEquals("north",t,E.PI_OVER_TWO);let n=e.south;s.typeOf.number.greaterThanOrEquals("south",n,-E.PI_OVER_TWO),s.typeOf.number.lessThanOrEquals("south",n,E.PI_OVER_TWO);let o=e.west;s.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),s.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;s.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),s.typeOf.number.lessThanOrEquals("east",i,Math.PI)};x.southwest=function(e,t){return s.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)};x.northwest=function(e,t){return s.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)};x.northeast=function(e,t){return s.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)};x.southeast=function(e,t){return s.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)};x.center=function(e,t){s.typeOf.object("rectangle",e);let n=e.east,o=e.west;n<o&&(n+=E.TWO_PI);let i=E.negativePiToPi((o+n)*.5),r=(e.south+e.north)*.5;return p(t)?(t.longitude=i,t.latitude=r,t.height=0,t):new Me(i,r)};x.intersection=function(e,t,n){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",t);let o=e.east,i=e.west,r=t.east,a=t.west;o<i&&r>0?o+=E.TWO_PI:r<a&&o>0&&(r+=E.TWO_PI),o<i&&a<0?a+=E.TWO_PI:r<a&&i<0&&(i+=E.TWO_PI);let u=E.negativePiToPi(Math.max(i,a)),d=E.negativePiToPi(Math.min(o,r));if((e.west<e.east||t.west<t.east)&&d<=u)return;let m=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(m>=l))return p(n)?(n.west=u,n.south=m,n.east=d,n.north=l,n):new x(u,m,d,l)};x.simpleIntersection=function(e,t,n){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",t);let o=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),a=Math.min(e.north,t.north);if(!(i>=a||o>=r))return p(n)?(n.west=o,n.south=i,n.east=r,n.north=a,n):new x(o,i,r,a)};x.union=function(e,t,n){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",t),p(n)||(n=new x);let o=e.east,i=e.west,r=t.east,a=t.west;o<i&&r>0?o+=E.TWO_PI:r<a&&o>0&&(r+=E.TWO_PI),o<i&&a<0?a+=E.TWO_PI:r<a&&i<0&&(i+=E.TWO_PI);let u=E.negativePiToPi(Math.min(i,a)),d=E.negativePiToPi(Math.max(o,r));return n.west=u,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n};x.expand=function(e,t,n){return s.typeOf.object("rectangle",e),s.typeOf.object("cartographic",t),p(n)||(n=new x),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};x.contains=function(e,t){s.typeOf.object("rectangle",e),s.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,i=e.west,r=e.east;return r<i&&(r+=E.TWO_PI,n<0&&(n+=E.TWO_PI)),(n>i||E.equalsEpsilon(n,i,E.EPSILON14))&&(n<r||E.equalsEpsilon(n,r,E.EPSILON14))&&o>=e.south&&o<=e.north};var Ci=new Me;x.subsample=function(e,t,n,o){s.typeOf.object("rectangle",e),t=O(t,Ie.default),n=O(n,0),p(o)||(o=[]);let i=0,r=e.north,a=e.south,u=e.east,d=e.west,m=Ci;m.height=n,m.longitude=d,m.latitude=r,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.latitude=a,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:a>0?m.latitude=a:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*E.PI_OVER_TWO,x.contains(e,m)&&(o[i]=t.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=t.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=t.cartographicToCartesian(m,o[i]),i++),o.length=i,o};x.subsection=function(e,t,n,o,i,r){if(s.typeOf.object("rectangle",e),s.typeOf.number.greaterThanOrEquals("westLerp",t,0),s.typeOf.number.lessThanOrEquals("westLerp",t,1),s.typeOf.number.greaterThanOrEquals("southLerp",n,0),s.typeOf.number.lessThanOrEquals("southLerp",n,1),s.typeOf.number.greaterThanOrEquals("eastLerp",o,0),s.typeOf.number.lessThanOrEquals("eastLerp",o,1),s.typeOf.number.greaterThanOrEquals("northLerp",i,0),s.typeOf.number.lessThanOrEquals("northLerp",i,1),s.typeOf.number.lessThanOrEquals("westLerp",t,o),s.typeOf.number.lessThanOrEquals("southLerp",n,i),p(r)||(r=new x),e.west<=e.east){let u=e.east-e.west;r.west=e.west+t*u,r.east=e.west+o*u}else{let u=E.TWO_PI+e.east-e.west;r.west=E.negativePiToPi(e.west+t*u),r.east=E.negativePiToPi(e.west+o*u)}let a=e.north-e.south;return r.south=e.south+n*a,r.north=e.south+i*a,t===1&&(r.west=e.east),o===1&&(r.east=e.east),n===1&&(r.south=e.north),i===1&&(r.north=e.north),r};x.MAX_VALUE=Object.freeze(new x(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO));var mf=x;function D(e,t,n,o){this[0]=O(e,0),this[1]=O(n,0),this[2]=O(t,0),this[3]=O(o,0)}D.packedLength=4;D.pack=function(e,t,n){return s.typeOf.object("value",e),s.defined("array",t),n=O(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};D.unpack=function(e,t,n){return s.defined("array",e),t=O(t,0),p(n)||(n=new D),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};D.packArray=function(e,t){s.defined("array",e);let n=e.length,o=n*4;if(!p(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new j("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)D.pack(e[i],t,i*4);return t};D.unpackArray=function(e,t){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new j("array length must be a multiple of 4.");let n=e.length;p(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){let i=o/4;t[i]=D.unpack(e,o,t[i])}return t};D.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new D(e[0],e[2],e[1],e[3])};D.fromArray=D.unpack;D.fromColumnMajorArray=function(e,t){return s.defined("values",e),D.clone(e,t)};D.fromRowMajorArray=function(e,t){return s.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new D(e[0],e[1],e[2],e[3])};D.fromScale=function(e,t){return s.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new D(e.x,0,0,e.y)};D.fromUniformScale=function(e,t){return s.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new D(e,0,0,e)};D.fromRotation=function(e,t){s.typeOf.number("angle",e);let n=Math.cos(e),o=Math.sin(e);return p(t)?(t[0]=n,t[1]=o,t[2]=-o,t[3]=n,t):new D(n,-o,o,n)};D.toArray=function(e,t){return s.typeOf.object("matrix",e),p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};D.getElementIndex=function(e,t){return s.typeOf.number.greaterThanOrEquals("row",t,0),s.typeOf.number.lessThanOrEquals("row",t,1),s.typeOf.number.greaterThanOrEquals("column",e,0),s.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};D.getColumn=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,1),s.typeOf.object("result",n);let o=t*2,i=e[o],r=e[o+1];return n.x=i,n.y=r,n};D.setColumn=function(e,t,n,o){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,1),s.typeOf.object("cartesian",n),s.typeOf.object("result",o),o=D.clone(e,o);let i=t*2;return o[i]=n.x,o[i+1]=n.y,o};D.getRow=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,1),s.typeOf.object("result",n);let o=e[t],i=e[t+2];return n.x=o,n.y=i,n};D.setRow=function(e,t,n,o){return s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,1),s.typeOf.object("cartesian",n),s.typeOf.object("result",o),o=D.clone(e,o),o[t]=n.x,o[t+2]=n.y,o};var vi=new Oe;D.setScale=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("scale",t),s.typeOf.object("result",n);let o=D.getScale(e,vi),i=t.x/o.x,r=t.y/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ai=new Oe;D.setUniformScale=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.number("scale",t),s.typeOf.object("result",n);let o=D.getScale(e,Ai),i=t/o.x,r=t/o.y;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*r,n[3]=e[3]*r,n};var Po=new Oe;D.getScale=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t.x=Oe.magnitude(Oe.fromElements(e[0],e[1],Po)),t.y=Oe.magnitude(Oe.fromElements(e[2],e[3],Po)),t};var Uo=new Oe;D.getMaximumScale=function(e){return D.getScale(e,Uo),Oe.maximumComponent(Uo)};var ji=new Oe;D.setRotation=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let o=D.getScale(e,ji);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.y,n[3]=t[3]*o.y,n};var Mi=new Oe;D.getRotation=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let n=D.getScale(e,Mi);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};D.multiply=function(e,t,n){s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n);let o=e[0]*t[0]+e[2]*t[1],i=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return n[0]=o,n[1]=r,n[2]=i,n[3]=a,n};D.add=function(e,t,n){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};D.subtract=function(e,t,n){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};D.multiplyByVector=function(e,t,n){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",t),s.typeOf.object("result",n);let o=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=o,n.y=i,n};D.multiplyByScalar=function(e,t,n){return s.typeOf.object("matrix",e),s.typeOf.number("scalar",t),s.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};D.multiplyByScale=function(e,t,n){return s.typeOf.object("matrix",e),s.typeOf.object("scale",t),s.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};D.multiplyByUniformScale=function(e,t,n){return s.typeOf.object("matrix",e),s.typeOf.number("scale",t),s.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};D.negate=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};D.transpose=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let n=e[0],o=e[2],i=e[1],r=e[3];return t[0]=n,t[1]=o,t[2]=i,t[3]=r,t};D.abs=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};D.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};D.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};D.equalsEpsilon=function(e,t,n){return n=O(n,0),e===t||p(e)&&p(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};D.IDENTITY=Object.freeze(new D(1,0,0,1));D.ZERO=Object.freeze(new D(0,0,0,0));D.COLUMN0ROW0=0;D.COLUMN0ROW1=1;D.COLUMN1ROW0=2;D.COLUMN1ROW1=3;Object.defineProperties(D.prototype,{length:{get:function(){return D.packedLength}}});D.prototype.clone=function(e){return D.clone(this,e)};D.prototype.equals=function(e){return D.equals(this,e)};D.prototype.equalsEpsilon=function(e,t){return D.equalsEpsilon(this,e,t)};D.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var _f=D;export{qe as a,G as b,De as c,ke as d,bo as e,Xe as f,Mo as g,mf as h,_f as i}; diff --git a/public/js/Cesium2/Workers/chunk-5CC3QRYS.js b/public/js/Cesium2/Workers/chunk-N5SNKJ43.js similarity index 98% rename from public/js/Cesium2/Workers/chunk-5CC3QRYS.js rename to public/js/Cesium2/Workers/chunk-N5SNKJ43.js index 1bf12f106..aa3bbac8f 100644 --- a/public/js/Cesium2/Workers/chunk-5CC3QRYS.js +++ b/public/js/Cesium2/Workers/chunk-N5SNKJ43.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * diff --git a/public/js/Cesium2/Workers/chunk-E7HC3VTG.js b/public/js/Cesium2/Workers/chunk-NHNM56MI.js similarity index 94% rename from public/js/Cesium2/Workers/chunk-E7HC3VTG.js rename to public/js/Cesium2/Workers/chunk-NHNM56MI.js index ec92d7d48..76710c700 100644 --- a/public/js/Cesium2/Workers/chunk-E7HC3VTG.js +++ b/public/js/Cesium2/Workers/chunk-NHNM56MI.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as y,b as P,d as k}from"./chunk-S4VBGY2U.js";import{a as L}from"./chunk-UCTPWOTZ.js";import{a as B}from"./chunk-N3A5CZ2S.js";import{b as q}from"./chunk-G75U3WZT.js";import{e as T}from"./chunk-3THTQ4QB.js";function Y(n){let a=n._uSquared,t=n._ellipsoid.maximumRadius,e=n._ellipsoid.minimumRadius,f=(t-e)/t,m=Math.cos(n._startHeading),_=Math.sin(n._startHeading),r=(1-f)*Math.tan(n._start.latitude),p=1/Math.sqrt(1+r*r),R=p*r,M=Math.atan2(r,m),l=p*_,U=l*l,i=1-U,A=Math.sqrt(i),c=a/4,o=c*c,h=o*c,S=o*o,u=1+c-3*o/4+5*h/4-175*S/64,C=1-c+15*o/8-35*h/8,d=1-3*c+35*o/4,g=1-5*c,w=u*M-C*Math.sin(2*M)*c/2-d*Math.sin(4*M)*o/16-g*Math.sin(6*M)*h/48-Math.sin(8*M)*5*S/512,s=n._constants;s.a=t,s.b=e,s.f=f,s.cosineHeading=m,s.sineHeading=_,s.tanU=r,s.cosineU=p,s.sineU=R,s.sigma=M,s.sineAlpha=l,s.sineSquaredAlpha=U,s.cosineSquaredAlpha=i,s.cosineAlpha=A,s.u2Over4=c,s.u4Over16=o,s.u6Over64=h,s.u8Over256=S,s.a0=u,s.a1=C,s.a2=d,s.a3=g,s.distanceRatio=w}function Z(n,a){return n*a*(4+n*(4-3*a))/16}function N(n,a,t,e,f,m,_){let r=Z(n,t);return(1-r)*n*a*(e+r*f*(_+r*m*(2*_*_-1)))}function $(n,a,t,e,f,m,_){let r=(a-t)/a,p=m-e,R=Math.atan((1-r)*Math.tan(f)),M=Math.atan((1-r)*Math.tan(_)),l=Math.cos(R),U=Math.sin(R),i=Math.cos(M),A=Math.sin(M),c=l*i,o=l*A,h=U*A,S=U*i,u=p,C=L.TWO_PI,d=Math.cos(u),g=Math.sin(u),w,s,O,H,b;do{d=Math.cos(u),g=Math.sin(u);let z=o-S*d;O=Math.sqrt(i*i*g*g+z*z),s=h+c*d,w=Math.atan2(O,s);let D;O===0?(D=0,H=1):(D=c*g/O,H=1-D*D),C=u,b=s-2*h/H,isFinite(b)||(b=0),u=p+N(r,D,H,w,O,s,b)}while(Math.abs(u-C)>L.EPSILON12);let v=H*(a*a-t*t)/(t*t),W=1+v*(4096+v*(v*(320-175*v)-768))/16384,I=v*(256+v*(v*(74-47*v)-128))/1024,F=b*b,J=I*O*(b+I*(s*(2*F-1)-I*b*(4*O*O-3)*(4*F-3)/6)/4),K=t*W*(w-J),Q=Math.atan2(i*g,o-S*d),X=Math.atan2(l*g,o*d-S);n._distance=K,n._startHeading=Q,n._endHeading=X,n._uSquared=v}var j=new y,x=new y;function V(n,a,t,e){let f=y.normalize(e.cartographicToCartesian(a,x),j),m=y.normalize(e.cartographicToCartesian(t,x),x);q.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(y.angleBetween(f,m))-Math.PI),.0125),$(n,e.maximumRadius,e.minimumRadius,a.longitude,a.latitude,t.longitude,t.latitude),n._start=P.clone(a,n._start),n._end=P.clone(t,n._end),n._start.height=0,n._end.height=0,Y(n)}function E(n,a,t){let e=B(t,k.default);this._ellipsoid=e,this._start=new P,this._end=new P,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,T(n)&&T(a)&&V(this,n,a,e)}Object.defineProperties(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return q.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return q.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return q.defined("distance",this._distance),this._endHeading}}});E.prototype.setEndPoints=function(n,a){q.defined("start",n),q.defined("end",a),V(this,n,a,this._ellipsoid)};E.prototype.interpolateUsingFraction=function(n,a){return this.interpolateUsingSurfaceDistance(this._distance*n,a)};E.prototype.interpolateUsingSurfaceDistance=function(n,a){q.defined("distance",this._distance);let t=this._constants,e=t.distanceRatio+n/t.b,f=Math.cos(2*e),m=Math.cos(4*e),_=Math.cos(6*e),r=Math.sin(2*e),p=Math.sin(4*e),R=Math.sin(6*e),M=Math.sin(8*e),l=e*e,U=e*l,i=t.u8Over256,A=t.u2Over4,c=t.u6Over64,o=t.u4Over16,h=2*U*i*f/3+e*(1-A+7*o/4-15*c/4+579*i/64-(o-15*c/4+187*i/16)*f-(5*c/4-115*i/16)*m-29*i*_/16)+(A/2-o+71*c/32-85*i/16)*r+(5*o/16-5*c/4+383*i/96)*p-l*((c-11*i/2)*r+5*i*p/2)+(29*c/96-29*i/16)*R+539*i*M/1536,S=Math.asin(Math.sin(h)*t.cosineAlpha),u=Math.atan(t.a/t.b*Math.tan(S));h=h-t.sigma;let C=Math.cos(2*t.sigma+h),d=Math.sin(h),g=Math.cos(h),w=t.cosineU*g,s=t.sineU*d,H=Math.atan2(d*t.sineHeading,w-s*t.cosineHeading)-N(t.f,t.sineAlpha,t.cosineSquaredAlpha,h,d,g,C);return T(a)?(a.longitude=this._start.longitude+H,a.latitude=u,a.height=0,a):new P(this._start.longitude+H,u,0)};var ct=E;export{ct as a}; +import{a as y,b as P,d as k}from"./chunk-RH3GFHG2.js";import{a as L}from"./chunk-FRWNWNYJ.js";import{a as B}from"./chunk-TA3RE4KQ.js";import{b as q}from"./chunk-RTY3VPG6.js";import{e as T}from"./chunk-LRNH5AEO.js";function Y(n){let a=n._uSquared,t=n._ellipsoid.maximumRadius,e=n._ellipsoid.minimumRadius,f=(t-e)/t,m=Math.cos(n._startHeading),_=Math.sin(n._startHeading),r=(1-f)*Math.tan(n._start.latitude),p=1/Math.sqrt(1+r*r),R=p*r,M=Math.atan2(r,m),l=p*_,U=l*l,i=1-U,A=Math.sqrt(i),c=a/4,o=c*c,h=o*c,S=o*o,u=1+c-3*o/4+5*h/4-175*S/64,C=1-c+15*o/8-35*h/8,d=1-3*c+35*o/4,g=1-5*c,w=u*M-C*Math.sin(2*M)*c/2-d*Math.sin(4*M)*o/16-g*Math.sin(6*M)*h/48-Math.sin(8*M)*5*S/512,s=n._constants;s.a=t,s.b=e,s.f=f,s.cosineHeading=m,s.sineHeading=_,s.tanU=r,s.cosineU=p,s.sineU=R,s.sigma=M,s.sineAlpha=l,s.sineSquaredAlpha=U,s.cosineSquaredAlpha=i,s.cosineAlpha=A,s.u2Over4=c,s.u4Over16=o,s.u6Over64=h,s.u8Over256=S,s.a0=u,s.a1=C,s.a2=d,s.a3=g,s.distanceRatio=w}function Z(n,a){return n*a*(4+n*(4-3*a))/16}function N(n,a,t,e,f,m,_){let r=Z(n,t);return(1-r)*n*a*(e+r*f*(_+r*m*(2*_*_-1)))}function $(n,a,t,e,f,m,_){let r=(a-t)/a,p=m-e,R=Math.atan((1-r)*Math.tan(f)),M=Math.atan((1-r)*Math.tan(_)),l=Math.cos(R),U=Math.sin(R),i=Math.cos(M),A=Math.sin(M),c=l*i,o=l*A,h=U*A,S=U*i,u=p,C=L.TWO_PI,d=Math.cos(u),g=Math.sin(u),w,s,O,H,b;do{d=Math.cos(u),g=Math.sin(u);let z=o-S*d;O=Math.sqrt(i*i*g*g+z*z),s=h+c*d,w=Math.atan2(O,s);let D;O===0?(D=0,H=1):(D=c*g/O,H=1-D*D),C=u,b=s-2*h/H,isFinite(b)||(b=0),u=p+N(r,D,H,w,O,s,b)}while(Math.abs(u-C)>L.EPSILON12);let v=H*(a*a-t*t)/(t*t),W=1+v*(4096+v*(v*(320-175*v)-768))/16384,I=v*(256+v*(v*(74-47*v)-128))/1024,F=b*b,J=I*O*(b+I*(s*(2*F-1)-I*b*(4*O*O-3)*(4*F-3)/6)/4),K=t*W*(w-J),Q=Math.atan2(i*g,o-S*d),X=Math.atan2(l*g,o*d-S);n._distance=K,n._startHeading=Q,n._endHeading=X,n._uSquared=v}var j=new y,x=new y;function V(n,a,t,e){let f=y.normalize(e.cartographicToCartesian(a,x),j),m=y.normalize(e.cartographicToCartesian(t,x),x);q.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(y.angleBetween(f,m))-Math.PI),.0125),$(n,e.maximumRadius,e.minimumRadius,a.longitude,a.latitude,t.longitude,t.latitude),n._start=P.clone(a,n._start),n._end=P.clone(t,n._end),n._start.height=0,n._end.height=0,Y(n)}function E(n,a,t){let e=B(t,k.default);this._ellipsoid=e,this._start=new P,this._end=new P,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,T(n)&&T(a)&&V(this,n,a,e)}Object.defineProperties(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return q.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return q.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return q.defined("distance",this._distance),this._endHeading}}});E.prototype.setEndPoints=function(n,a){q.defined("start",n),q.defined("end",a),V(this,n,a,this._ellipsoid)};E.prototype.interpolateUsingFraction=function(n,a){return this.interpolateUsingSurfaceDistance(this._distance*n,a)};E.prototype.interpolateUsingSurfaceDistance=function(n,a){q.defined("distance",this._distance);let t=this._constants,e=t.distanceRatio+n/t.b,f=Math.cos(2*e),m=Math.cos(4*e),_=Math.cos(6*e),r=Math.sin(2*e),p=Math.sin(4*e),R=Math.sin(6*e),M=Math.sin(8*e),l=e*e,U=e*l,i=t.u8Over256,A=t.u2Over4,c=t.u6Over64,o=t.u4Over16,h=2*U*i*f/3+e*(1-A+7*o/4-15*c/4+579*i/64-(o-15*c/4+187*i/16)*f-(5*c/4-115*i/16)*m-29*i*_/16)+(A/2-o+71*c/32-85*i/16)*r+(5*o/16-5*c/4+383*i/96)*p-l*((c-11*i/2)*r+5*i*p/2)+(29*c/96-29*i/16)*R+539*i*M/1536,S=Math.asin(Math.sin(h)*t.cosineAlpha),u=Math.atan(t.a/t.b*Math.tan(S));h=h-t.sigma;let C=Math.cos(2*t.sigma+h),d=Math.sin(h),g=Math.cos(h),w=t.cosineU*g,s=t.sineU*d,H=Math.atan2(d*t.sineHeading,w-s*t.cosineHeading)-N(t.f,t.sineAlpha,t.cosineSquaredAlpha,h,d,g,C);return T(a)?(a.longitude=this._start.longitude+H,a.latitude=u,a.height=0,a):new P(this._start.longitude+H,u,0)};var ct=E;export{ct as a}; diff --git a/public/js/Cesium2/Workers/chunk-24JYWT5N.js b/public/js/Cesium2/Workers/chunk-NT26NNVH.js similarity index 92% rename from public/js/Cesium2/Workers/chunk-24JYWT5N.js rename to public/js/Cesium2/Workers/chunk-NT26NNVH.js index f90114c0d..57a634a33 100644 --- a/public/js/Cesium2/Workers/chunk-24JYWT5N.js +++ b/public/js/Cesium2/Workers/chunk-NT26NNVH.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as e}from"./chunk-N3A5CZ2S.js";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}var i=a;export{i as a}; +import{a as e}from"./chunk-TA3RE4KQ.js";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}var i=a;export{i as a}; diff --git a/public/js/Cesium2/Workers/chunk-LH3SUUXG.js b/public/js/Cesium2/Workers/chunk-NW2YE576.js similarity index 91% rename from public/js/Cesium2/Workers/chunk-LH3SUUXG.js rename to public/js/Cesium2/Workers/chunk-NW2YE576.js index 4cd94f6c1..fd9f23b6d 100644 --- a/public/js/Cesium2/Workers/chunk-LH3SUUXG.js +++ b/public/js/Cesium2/Workers/chunk-NW2YE576.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{b as l,f as O,g as R,h as G,i as L}from"./chunk-M3A6SPGI.js";import{a as A,b as h,c as a,e as y}from"./chunk-S4VBGY2U.js";import{a as c}from"./chunk-54PMPXZ4.js";import{a as s}from"./chunk-N3A5CZ2S.js";import{a as N,b as w}from"./chunk-G75U3WZT.js";import{e as I}from"./chunk-3THTQ4QB.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},M=Object.freeze(U);var r={POINTS:c.POINTS,LINES:c.LINES,LINE_LOOP:c.LINE_LOOP,LINE_STRIP:c.LINE_STRIP,TRIANGLES:c.TRIANGLES,TRIANGLE_STRIP:c.TRIANGLE_STRIP,TRIANGLE_FAN:c.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var F=Object.freeze(r);function _(t){t=s(t,s.EMPTY_OBJECT),w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=s(t.primitiveType,F.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=s(t.geometryType,M.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let m=-1;for(let u in t.attributes)if(t.attributes.hasOwnProperty(u)&&I(t.attributes[u])&&I(t.attributes[u].values)){let o=t.attributes[u],e=o.values.length/o.componentsPerAttribute;if(m!==e&&m!==-1)throw new N("All attribute lists must have the same number of attributes.");m=e}return m};var W=new h,H=new A,V=new l,Z=[new h,new h,new h],K=[new a,new a,new a],$=[new a,new a,new a],tt=new A,et=new O,rt=new l,nt=new L;_._textureCoordinateRotationPoints=function(t,m,u,o){let e,g=G.center(o,W),D=h.toCartesian(g,u,H),Y=R.eastNorthUpToFixedFrame(D,u,V),C=l.inverse(Y,V),b=K,f=Z;f[0].longitude=o.west,f[0].latitude=o.south,f[1].longitude=o.west,f[1].latitude=o.north,f[2].longitude=o.east,f[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)h.toCartesian(f[e],u,n),n=l.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let B=O.fromAxisAngle(A.UNIT_Z,-m,et),v=y.fromQuaternion(B,rt),j=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(e=0;e<j;e++)n=l.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(v,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),d=Math.max(d,n.x),x=Math.max(x,n.y);let k=L.fromRotation(m,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=x,i[2].x=d,i[2].y=p;let P=b[0],z=b[2].x-P.x,X=b[1].y-P.y;for(e=0;e<3;e++){let E=i[e];L.multiplyByVector(k,E,E),E.x=(E.x-P.x)/z,E.y=(E.y-P.y)/X}let q=i[0],J=i[1],Q=i[2],S=new Array(6);return a.pack(q,S),a.pack(J,S,2),a.pack(Q,S,4),S};var Lt=_;function ot(t){if(t=s(t,s.EMPTY_OBJECT),!I(t.componentDatatype))throw new N("options.componentDatatype is required.");if(!I(t.componentsPerAttribute))throw new N("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new N("options.componentsPerAttribute must be between 1 and 4.");if(!I(t.values))throw new N("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=s(t.normalize,!1),this.values=t.values}var Ot=ot;export{M as a,F as b,Lt as c,Ot as d}; +import{b as l,f as O,g as R,h as G,i as L}from"./chunk-7YEOLR2L.js";import{a as A,b as h,c as a,e as y}from"./chunk-RH3GFHG2.js";import{a as c}from"./chunk-UKWFHLUK.js";import{a as s}from"./chunk-TA3RE4KQ.js";import{a as N,b as w}from"./chunk-RTY3VPG6.js";import{e as I}from"./chunk-LRNH5AEO.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},M=Object.freeze(U);var r={POINTS:c.POINTS,LINES:c.LINES,LINE_LOOP:c.LINE_LOOP,LINE_STRIP:c.LINE_STRIP,TRIANGLES:c.TRIANGLES,TRIANGLE_STRIP:c.TRIANGLE_STRIP,TRIANGLE_FAN:c.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var F=Object.freeze(r);function _(t){t=s(t,s.EMPTY_OBJECT),w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=s(t.primitiveType,F.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=s(t.geometryType,M.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let m=-1;for(let u in t.attributes)if(t.attributes.hasOwnProperty(u)&&I(t.attributes[u])&&I(t.attributes[u].values)){let o=t.attributes[u],e=o.values.length/o.componentsPerAttribute;if(m!==e&&m!==-1)throw new N("All attribute lists must have the same number of attributes.");m=e}return m};var W=new h,H=new A,V=new l,Z=[new h,new h,new h],K=[new a,new a,new a],$=[new a,new a,new a],tt=new A,et=new O,rt=new l,nt=new L;_._textureCoordinateRotationPoints=function(t,m,u,o){let e,g=G.center(o,W),D=h.toCartesian(g,u,H),Y=R.eastNorthUpToFixedFrame(D,u,V),C=l.inverse(Y,V),b=K,f=Z;f[0].longitude=o.west,f[0].latitude=o.south,f[1].longitude=o.west,f[1].latitude=o.north,f[2].longitude=o.east,f[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)h.toCartesian(f[e],u,n),n=l.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let B=O.fromAxisAngle(A.UNIT_Z,-m,et),v=y.fromQuaternion(B,rt),j=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(e=0;e<j;e++)n=l.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(v,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),d=Math.max(d,n.x),x=Math.max(x,n.y);let k=L.fromRotation(m,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=x,i[2].x=d,i[2].y=p;let P=b[0],z=b[2].x-P.x,X=b[1].y-P.y;for(e=0;e<3;e++){let E=i[e];L.multiplyByVector(k,E,E),E.x=(E.x-P.x)/z,E.y=(E.y-P.y)/X}let q=i[0],J=i[1],Q=i[2],S=new Array(6);return a.pack(q,S),a.pack(J,S,2),a.pack(Q,S,4),S};var Lt=_;function ot(t){if(t=s(t,s.EMPTY_OBJECT),!I(t.componentDatatype))throw new N("options.componentDatatype is required.");if(!I(t.componentsPerAttribute))throw new N("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new N("options.componentsPerAttribute must be between 1 and 4.");if(!I(t.values))throw new N("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=s(t.normalize,!1),this.values=t.values}var Ot=ot;export{M as a,F as b,Lt as c,Ot as d}; diff --git a/public/js/Cesium2/Workers/chunk-SYY6FTAS.js b/public/js/Cesium2/Workers/chunk-OIKPZP2Y.js similarity index 91% rename from public/js/Cesium2/Workers/chunk-SYY6FTAS.js rename to public/js/Cesium2/Workers/chunk-OIKPZP2Y.js index ed924b2a6..cf927370d 100644 --- a/public/js/Cesium2/Workers/chunk-SYY6FTAS.js +++ b/public/js/Cesium2/Workers/chunk-OIKPZP2Y.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as S}from"./chunk-MWSGYAUE.js";import{a as j}from"./chunk-5CC3QRYS.js";import{a as D}from"./chunk-34ULWVZF.js";import{a as V}from"./chunk-24JYWT5N.js";import{b as T,c as B,d as L}from"./chunk-LH3SUUXG.js";import{d as O}from"./chunk-K2M3OJ7Z.js";import{a as x}from"./chunk-D5HNP2LB.js";import{a as c,d as l}from"./chunk-S4VBGY2U.js";import{a as E}from"./chunk-UCTPWOTZ.js";import{a as m}from"./chunk-N3A5CZ2S.js";import{a as _}from"./chunk-G75U3WZT.js";import{e as d}from"./chunk-3THTQ4QB.js";var q=new c,M=new c;function U(e){let t=e.center;M=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,M),e.height,M),M=c.add(t,M,M);let i=new O(M,e.semiMajorAxis),f=S.computeEllipsePositions(e,!1,!0).outerPositions,o=new V({position:new L({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:S.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),h=0;for(let n=0;n<r;++n)u[h++]=n,u[h++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var N=new O,P=new O;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);N.center=c.add(t,o,N.center),N.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),P.center=c.add(t,o,P.center),P.radius=f;let r=S.computeEllipsePositions(e,!1,!0).outerPositions,u=new V({position:new L({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:S.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let h=O.union(N,P),n=r.length/3;if(d(e.offsetAttribute)){let g=new Uint8Array(n);if(e.offsetAttribute===j.TOP)g=g.fill(1,0,n/2);else{let H=e.offsetAttribute===j.NONE?0:1;g=g.fill(H)}u.applyOffset=new L({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let p=m(e.numberOfVerticalLines,16);p=E.clamp(p,0,n/2);let a=D.createTypedArray(n,n*2+p*2);n/=2;let A=0,s;for(s=0;s<n;++s)a[A++]=s,a[A++]=(s+1)%n,a[A++]=s+n,a[A++]=(s+1)%n+n;let k;if(p>0){let g=Math.min(p,n);k=Math.round(n/g);let H=Math.min(k*p,n);for(s=0;s<H;s+=k)a[A++]=s,a[A++]=s+n}return{boundingSphere:h,attributes:u,indices:a}}function w(e){e=m(e,m.EMPTY_OBJECT);let t=e.center,i=m(e.ellipsoid,l.default),f=e.semiMajorAxis,o=e.semiMinorAxis,r=m(e.granularity,E.RADIANS_PER_DEGREE);if(!d(t))throw new _("center is required.");if(!d(f))throw new _("semiMajorAxis is required.");if(!d(o))throw new _("semiMinorAxis is required.");if(f<o)throw new _("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new _("granularity must be greater than zero.");let u=m(e.height,0),h=m(e.extrudedHeight,u);this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=l.clone(i),this._rotation=m(e.rotation,0),this._height=Math.max(h,u),this._granularity=r,this._extrudedHeight=Math.min(h,u),this._numberOfVerticalLines=Math.max(m(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}w.packedLength=c.packedLength+l.packedLength+8;w.pack=function(e,t,i){if(!d(e))throw new _("value is required");if(!d(t))throw new _("array is required");return i=m(i,0),c.pack(e._center,t,i),i+=c.packedLength,l.pack(e._ellipsoid,t,i),i+=l.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=m(e._offsetAttribute,-1),t};var y=new c,C=new l,b={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};w.unpack=function(e,t,i){if(!d(e))throw new _("array is required");t=m(t,0);let f=c.unpack(e,t,y);t+=c.packedLength;let o=l.unpack(e,t,C);t+=l.packedLength;let r=e[t++],u=e[t++],h=e[t++],n=e[t++],p=e[t++],a=e[t++],A=e[t++],s=e[t];return d(i)?(i._center=c.clone(f,i._center),i._ellipsoid=l.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=h,i._height=n,i._granularity=p,i._extrudedHeight=a,i._numberOfVerticalLines=A,i._offsetAttribute=s===-1?void 0:s,i):(b.height=n,b.extrudedHeight=a,b.granularity=p,b.rotation=h,b.semiMajorAxis=r,b.semiMinorAxis=u,b.numberOfVerticalLines=A,b.offsetAttribute=s===-1?void 0:s,new w(b))};w.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!E.equalsEpsilon(t,i,0,E.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),d(e._offsetAttribute)){let u=r.attributes.position.values.length,h=e._offsetAttribute===j.NONE?0:1,n=new Uint8Array(u/3).fill(h);r.attributes.applyOffset=new L({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=w;export{ie as a}; +import{a as S}from"./chunk-FAPED76U.js";import{a as j}from"./chunk-N5SNKJ43.js";import{a as D}from"./chunk-YFQNY2YN.js";import{a as V}from"./chunk-NT26NNVH.js";import{b as T,c as B,d as L}from"./chunk-NW2YE576.js";import{d as O}from"./chunk-2NIQ5ECB.js";import{a as x}from"./chunk-QHHYYTCM.js";import{a as c,d as l}from"./chunk-RH3GFHG2.js";import{a as E}from"./chunk-FRWNWNYJ.js";import{a as m}from"./chunk-TA3RE4KQ.js";import{a as _}from"./chunk-RTY3VPG6.js";import{e as d}from"./chunk-LRNH5AEO.js";var q=new c,M=new c;function U(e){let t=e.center;M=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,M),e.height,M),M=c.add(t,M,M);let i=new O(M,e.semiMajorAxis),f=S.computeEllipsePositions(e,!1,!0).outerPositions,o=new V({position:new L({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:S.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),h=0;for(let n=0;n<r;++n)u[h++]=n,u[h++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var N=new O,P=new O;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);N.center=c.add(t,o,N.center),N.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),P.center=c.add(t,o,P.center),P.radius=f;let r=S.computeEllipsePositions(e,!1,!0).outerPositions,u=new V({position:new L({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:S.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let h=O.union(N,P),n=r.length/3;if(d(e.offsetAttribute)){let g=new Uint8Array(n);if(e.offsetAttribute===j.TOP)g=g.fill(1,0,n/2);else{let H=e.offsetAttribute===j.NONE?0:1;g=g.fill(H)}u.applyOffset=new L({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let p=m(e.numberOfVerticalLines,16);p=E.clamp(p,0,n/2);let a=D.createTypedArray(n,n*2+p*2);n/=2;let A=0,s;for(s=0;s<n;++s)a[A++]=s,a[A++]=(s+1)%n,a[A++]=s+n,a[A++]=(s+1)%n+n;let k;if(p>0){let g=Math.min(p,n);k=Math.round(n/g);let H=Math.min(k*p,n);for(s=0;s<H;s+=k)a[A++]=s,a[A++]=s+n}return{boundingSphere:h,attributes:u,indices:a}}function w(e){e=m(e,m.EMPTY_OBJECT);let t=e.center,i=m(e.ellipsoid,l.default),f=e.semiMajorAxis,o=e.semiMinorAxis,r=m(e.granularity,E.RADIANS_PER_DEGREE);if(!d(t))throw new _("center is required.");if(!d(f))throw new _("semiMajorAxis is required.");if(!d(o))throw new _("semiMinorAxis is required.");if(f<o)throw new _("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new _("granularity must be greater than zero.");let u=m(e.height,0),h=m(e.extrudedHeight,u);this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=l.clone(i),this._rotation=m(e.rotation,0),this._height=Math.max(h,u),this._granularity=r,this._extrudedHeight=Math.min(h,u),this._numberOfVerticalLines=Math.max(m(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}w.packedLength=c.packedLength+l.packedLength+8;w.pack=function(e,t,i){if(!d(e))throw new _("value is required");if(!d(t))throw new _("array is required");return i=m(i,0),c.pack(e._center,t,i),i+=c.packedLength,l.pack(e._ellipsoid,t,i),i+=l.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=m(e._offsetAttribute,-1),t};var y=new c,C=new l,b={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};w.unpack=function(e,t,i){if(!d(e))throw new _("array is required");t=m(t,0);let f=c.unpack(e,t,y);t+=c.packedLength;let o=l.unpack(e,t,C);t+=l.packedLength;let r=e[t++],u=e[t++],h=e[t++],n=e[t++],p=e[t++],a=e[t++],A=e[t++],s=e[t];return d(i)?(i._center=c.clone(f,i._center),i._ellipsoid=l.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=h,i._height=n,i._granularity=p,i._extrudedHeight=a,i._numberOfVerticalLines=A,i._offsetAttribute=s===-1?void 0:s,i):(b.height=n,b.extrudedHeight=a,b.granularity=p,b.rotation=h,b.semiMajorAxis=r,b.semiMinorAxis=u,b.numberOfVerticalLines=A,b.offsetAttribute=s===-1?void 0:s,new w(b))};w.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!E.equalsEpsilon(t,i,0,E.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),d(e._offsetAttribute)){let u=r.attributes.position.values.length,h=e._offsetAttribute===j.NONE?0:1,n=new Uint8Array(u/3).fill(h);r.attributes.applyOffset=new L({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=w;export{ie as a}; diff --git a/public/js/Cesium2/Workers/chunk-GJI4ZBKE.js b/public/js/Cesium2/Workers/chunk-OKWGJEQO.js similarity index 85% rename from public/js/Cesium2/Workers/chunk-GJI4ZBKE.js rename to public/js/Cesium2/Workers/chunk-OKWGJEQO.js index c0a102a2d..a5db317cc 100644 --- a/public/js/Cesium2/Workers/chunk-GJI4ZBKE.js +++ b/public/js/Cesium2/Workers/chunk-OKWGJEQO.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as C}from"./chunk-UCTPWOTZ.js";import{a as g}from"./chunk-N3A5CZ2S.js";import{b as d}from"./chunk-G75U3WZT.js";import{e as i}from"./chunk-3THTQ4QB.js";var u=C.EPSILON10;function x(e,r,h,l){if(d.defined("equalsEpsilon",r),!i(e))return;h=g(h,!1);let m=i(l),n=e.length;if(n<2)return e;let f,s=e[0],o,t,p=0,c=-1;for(f=1;f<n;++f)o=e[f],r(s,o,u)?(i(t)||(t=e.slice(0,f),p=f-1,c=0),m&&l.push(f)):(i(t)&&(t.push(o),p=f,m&&(c=l.length)),s=o);return h&&r(e[0],e[n-1],u)&&(m&&(i(t)?l.splice(c,0,p):l.push(n-1)),i(t)?t.length-=1:t=e.slice(0,-1)),i(t)?t:e}var a=x;export{a}; +import{a as C}from"./chunk-FRWNWNYJ.js";import{a as g}from"./chunk-TA3RE4KQ.js";import{b as d}from"./chunk-RTY3VPG6.js";import{e as i}from"./chunk-LRNH5AEO.js";var u=C.EPSILON10;function x(e,r,h,l){if(d.defined("equalsEpsilon",r),!i(e))return;h=g(h,!1);let m=i(l),n=e.length;if(n<2)return e;let f,s=e[0],o,t,p=0,c=-1;for(f=1;f<n;++f)o=e[f],r(s,o,u)?(i(t)||(t=e.slice(0,f),p=f-1,c=0),m&&l.push(f)):(i(t)&&(t.push(o),p=f,m&&(c=l.length)),s=o);return h&&r(e[0],e[n-1],u)&&(m&&(i(t)?l.splice(c,0,p):l.push(n-1)),i(t)?t.length-=1:t=e.slice(0,-1)),i(t)?t:e}var a=x;export{a}; diff --git a/public/js/Cesium2/Workers/chunk-CTRWX4F5.js b/public/js/Cesium2/Workers/chunk-P73YILG6.js similarity index 89% rename from public/js/Cesium2/Workers/chunk-CTRWX4F5.js rename to public/js/Cesium2/Workers/chunk-P73YILG6.js index c78c5ef91..01ef697c7 100644 --- a/public/js/Cesium2/Workers/chunk-CTRWX4F5.js +++ b/public/js/Cesium2/Workers/chunk-P73YILG6.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as P}from"./chunk-Z7BLUZ7R.js";import{a as j,b as d}from"./chunk-PY4CW263.js";import{a as O}from"./chunk-RRZIPF5C.js";import{a as A,b as m,g as u}from"./chunk-M3A6SPGI.js";import{a as e,c as l,d as _}from"./chunk-S4VBGY2U.js";import{a as g}from"./chunk-N3A5CZ2S.js";import{a as y,b as p}from"./chunk-G75U3WZT.js";import{e as r}from"./chunk-3THTQ4QB.js";var x=new A;function s(n,t){if(p.defined("origin",n),t=g(t,_.default),n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=u.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(m.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(m.getColumn(o,1,x));let i=e.fromCartesian4(m.getColumn(o,2,x));this._plane=O.fromPointNormal(n,i)}Object.defineProperties(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var C=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,C);return new s(o.center,t)};var w=new j,h=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=w;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,h);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,h)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=w;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,h);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,h));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var T=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=T;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var M=s;export{M as a}; +import{a as P}from"./chunk-VYMAIP2A.js";import{a as j,b as d}from"./chunk-V7XARCCV.js";import{a as O}from"./chunk-SACP225T.js";import{a as A,b as m,g as u}from"./chunk-7YEOLR2L.js";import{a as e,c as l,d as _}from"./chunk-RH3GFHG2.js";import{a as g}from"./chunk-TA3RE4KQ.js";import{a as y,b as p}from"./chunk-RTY3VPG6.js";import{e as r}from"./chunk-LRNH5AEO.js";var x=new A;function s(n,t){if(p.defined("origin",n),t=g(t,_.default),n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=u.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(m.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(m.getColumn(o,1,x));let i=e.fromCartesian4(m.getColumn(o,2,x));this._plane=O.fromPointNormal(n,i)}Object.defineProperties(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var C=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,C);return new s(o.center,t)};var w=new j,h=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=w;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,h);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,h)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=w;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,h);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,h));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var T=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=T;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var M=s;export{M as a}; diff --git a/public/js/Cesium2/Workers/chunk-D5HNP2LB.js b/public/js/Cesium2/Workers/chunk-QHHYYTCM.js similarity index 94% rename from public/js/Cesium2/Workers/chunk-D5HNP2LB.js rename to public/js/Cesium2/Workers/chunk-QHHYYTCM.js index c7e62d000..b25d1f628 100644 --- a/public/js/Cesium2/Workers/chunk-D5HNP2LB.js +++ b/public/js/Cesium2/Workers/chunk-QHHYYTCM.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as N}from"./chunk-54PMPXZ4.js";import{a as i}from"./chunk-N3A5CZ2S.js";import{a}from"./chunk-G75U3WZT.js";import{e as T}from"./chunk-3THTQ4QB.js";var r={BYTE:N.BYTE,UNSIGNED_BYTE:N.UNSIGNED_BYTE,SHORT:N.SHORT,UNSIGNED_SHORT:N.UNSIGNED_SHORT,INT:N.INT,UNSIGNED_INT:N.UNSIGNED_INT,FLOAT:N.FLOAT,DOUBLE:N.DOUBLE};r.getSizeInBytes=function(n){if(!T(n))throw new a("value is required.");switch(n){case r.BYTE:return Int8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.SHORT:return Int16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.INT:return Int32Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case r.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case r.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new a("componentDatatype is not a valid value.")}};r.fromTypedArray=function(n){if(n instanceof Int8Array)return r.BYTE;if(n instanceof Uint8Array)return r.UNSIGNED_BYTE;if(n instanceof Int16Array)return r.SHORT;if(n instanceof Uint16Array)return r.UNSIGNED_SHORT;if(n instanceof Int32Array)return r.INT;if(n instanceof Uint32Array)return r.UNSIGNED_INT;if(n instanceof Float32Array)return r.FLOAT;if(n instanceof Float64Array)return r.DOUBLE;throw new a("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")};r.validate=function(n){return T(n)&&(n===r.BYTE||n===r.UNSIGNED_BYTE||n===r.SHORT||n===r.UNSIGNED_SHORT||n===r.INT||n===r.UNSIGNED_INT||n===r.FLOAT||n===r.DOUBLE)};r.createTypedArray=function(n,e){if(!T(n))throw new a("componentDatatype is required.");if(!T(e))throw new a("valuesOrLength is required.");switch(n){case r.BYTE:return new Int8Array(e);case r.UNSIGNED_BYTE:return new Uint8Array(e);case r.SHORT:return new Int16Array(e);case r.UNSIGNED_SHORT:return new Uint16Array(e);case r.INT:return new Int32Array(e);case r.UNSIGNED_INT:return new Uint32Array(e);case r.FLOAT:return new Float32Array(e);case r.DOUBLE:return new Float64Array(e);default:throw new a("componentDatatype is not a valid value.")}};r.createArrayBufferView=function(n,e,E,t){if(!T(n))throw new a("componentDatatype is required.");if(!T(e))throw new a("buffer is required.");switch(E=i(E,0),t=i(t,(e.byteLength-E)/r.getSizeInBytes(n)),n){case r.BYTE:return new Int8Array(e,E,t);case r.UNSIGNED_BYTE:return new Uint8Array(e,E,t);case r.SHORT:return new Int16Array(e,E,t);case r.UNSIGNED_SHORT:return new Uint16Array(e,E,t);case r.INT:return new Int32Array(e,E,t);case r.UNSIGNED_INT:return new Uint32Array(e,E,t);case r.FLOAT:return new Float32Array(e,E,t);case r.DOUBLE:return new Float64Array(e,E,t);default:throw new a("componentDatatype is not a valid value.")}};r.fromName=function(n){switch(n){case"BYTE":return r.BYTE;case"UNSIGNED_BYTE":return r.UNSIGNED_BYTE;case"SHORT":return r.SHORT;case"UNSIGNED_SHORT":return r.UNSIGNED_SHORT;case"INT":return r.INT;case"UNSIGNED_INT":return r.UNSIGNED_INT;case"FLOAT":return r.FLOAT;case"DOUBLE":return r.DOUBLE;default:throw new a("name is not a valid value.")}};var U=Object.freeze(r);export{U as a}; +import{a as N}from"./chunk-UKWFHLUK.js";import{a as i}from"./chunk-TA3RE4KQ.js";import{a}from"./chunk-RTY3VPG6.js";import{e as T}from"./chunk-LRNH5AEO.js";var r={BYTE:N.BYTE,UNSIGNED_BYTE:N.UNSIGNED_BYTE,SHORT:N.SHORT,UNSIGNED_SHORT:N.UNSIGNED_SHORT,INT:N.INT,UNSIGNED_INT:N.UNSIGNED_INT,FLOAT:N.FLOAT,DOUBLE:N.DOUBLE};r.getSizeInBytes=function(n){if(!T(n))throw new a("value is required.");switch(n){case r.BYTE:return Int8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.SHORT:return Int16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.INT:return Int32Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case r.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case r.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new a("componentDatatype is not a valid value.")}};r.fromTypedArray=function(n){if(n instanceof Int8Array)return r.BYTE;if(n instanceof Uint8Array)return r.UNSIGNED_BYTE;if(n instanceof Int16Array)return r.SHORT;if(n instanceof Uint16Array)return r.UNSIGNED_SHORT;if(n instanceof Int32Array)return r.INT;if(n instanceof Uint32Array)return r.UNSIGNED_INT;if(n instanceof Float32Array)return r.FLOAT;if(n instanceof Float64Array)return r.DOUBLE;throw new a("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")};r.validate=function(n){return T(n)&&(n===r.BYTE||n===r.UNSIGNED_BYTE||n===r.SHORT||n===r.UNSIGNED_SHORT||n===r.INT||n===r.UNSIGNED_INT||n===r.FLOAT||n===r.DOUBLE)};r.createTypedArray=function(n,e){if(!T(n))throw new a("componentDatatype is required.");if(!T(e))throw new a("valuesOrLength is required.");switch(n){case r.BYTE:return new Int8Array(e);case r.UNSIGNED_BYTE:return new Uint8Array(e);case r.SHORT:return new Int16Array(e);case r.UNSIGNED_SHORT:return new Uint16Array(e);case r.INT:return new Int32Array(e);case r.UNSIGNED_INT:return new Uint32Array(e);case r.FLOAT:return new Float32Array(e);case r.DOUBLE:return new Float64Array(e);default:throw new a("componentDatatype is not a valid value.")}};r.createArrayBufferView=function(n,e,E,t){if(!T(n))throw new a("componentDatatype is required.");if(!T(e))throw new a("buffer is required.");switch(E=i(E,0),t=i(t,(e.byteLength-E)/r.getSizeInBytes(n)),n){case r.BYTE:return new Int8Array(e,E,t);case r.UNSIGNED_BYTE:return new Uint8Array(e,E,t);case r.SHORT:return new Int16Array(e,E,t);case r.UNSIGNED_SHORT:return new Uint16Array(e,E,t);case r.INT:return new Int32Array(e,E,t);case r.UNSIGNED_INT:return new Uint32Array(e,E,t);case r.FLOAT:return new Float32Array(e,E,t);case r.DOUBLE:return new Float64Array(e,E,t);default:throw new a("componentDatatype is not a valid value.")}};r.fromName=function(n){switch(n){case"BYTE":return r.BYTE;case"UNSIGNED_BYTE":return r.UNSIGNED_BYTE;case"SHORT":return r.SHORT;case"UNSIGNED_SHORT":return r.UNSIGNED_SHORT;case"INT":return r.INT;case"UNSIGNED_INT":return r.UNSIGNED_INT;case"FLOAT":return r.FLOAT;case"DOUBLE":return r.DOUBLE;default:throw new a("name is not a valid value.")}};var U=Object.freeze(r);export{U as a}; diff --git a/public/js/Cesium2/Workers/chunk-OTRIIEF3.js b/public/js/Cesium2/Workers/chunk-QV3DAXWD.js similarity index 93% rename from public/js/Cesium2/Workers/chunk-OTRIIEF3.js rename to public/js/Cesium2/Workers/chunk-QV3DAXWD.js index 4019d7228..de9adce31 100644 --- a/public/js/Cesium2/Workers/chunk-OTRIIEF3.js +++ b/public/js/Cesium2/Workers/chunk-QV3DAXWD.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as w}from"./chunk-UCTPWOTZ.js";var C={};C.computePositions=function(I,f,b,n,e){let m=I*.5,i=-m,s=n+n,P=e?2*s:s,t=new Float64Array(P*3),r,c=0,o=0,p=e?s*3:0,a=e?(s+n)*3:n*3;for(r=0;r<n;r++){let y=r/n*w.TWO_PI,x=Math.cos(y),h=Math.sin(y),u=x*b,M=h*b,O=x*f,d=h*f;t[o+p]=u,t[o+p+1]=M,t[o+p+2]=i,t[o+a]=O,t[o+a+1]=d,t[o+a+2]=m,o+=3,e&&(t[c++]=u,t[c++]=M,t[c++]=i,t[c++]=O,t[c++]=d,t[c++]=m)}return t};var Y=C;export{Y as a}; +import{a as w}from"./chunk-FRWNWNYJ.js";var C={};C.computePositions=function(I,f,b,n,e){let m=I*.5,i=-m,s=n+n,P=e?2*s:s,t=new Float64Array(P*3),r,c=0,o=0,p=e?s*3:0,a=e?(s+n)*3:n*3;for(r=0;r<n;r++){let y=r/n*w.TWO_PI,x=Math.cos(y),h=Math.sin(y),u=x*b,M=h*b,O=x*f,d=h*f;t[o+p]=u,t[o+p+1]=M,t[o+p+2]=i,t[o+a]=O,t[o+a+1]=d,t[o+a+2]=m,o+=3,e&&(t[c++]=u,t[c++]=M,t[c++]=i,t[c++]=O,t[c++]=d,t[c++]=m)}return t};var Y=C;export{Y as a}; diff --git a/public/js/Cesium2/Workers/chunk-S4VBGY2U.js b/public/js/Cesium2/Workers/chunk-RH3GFHG2.js similarity index 99% rename from public/js/Cesium2/Workers/chunk-S4VBGY2U.js rename to public/js/Cesium2/Workers/chunk-RH3GFHG2.js index d5b28895a..ef402b809 100644 --- a/public/js/Cesium2/Workers/chunk-S4VBGY2U.js +++ b/public/js/Cesium2/Workers/chunk-RH3GFHG2.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,6 +23,6 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as w}from"./chunk-UCTPWOTZ.js";import{a as O}from"./chunk-N3A5CZ2S.js";import{a as S,b as c}from"./chunk-G75U3WZT.js";import{e as u}from"./chunk-3THTQ4QB.js";function f(n,e,o){this.x=O(n,0),this.y=O(e,0),this.z=O(o,0)}f.fromSpherical=function(n,e){c.typeOf.object("spherical",n),u(e)||(e=new f);let o=n.clock,t=n.cone,i=O(n.magnitude,1),p=i*Math.sin(t);return e.x=p*Math.cos(o),e.y=p*Math.sin(o),e.z=i*Math.cos(t),e};f.fromElements=function(n,e,o,t){return u(t)?(t.x=n,t.y=e,t.z=o,t):new f(n,e,o)};f.clone=function(n,e){if(u(n))return u(e)?(e.x=n.x,e.y=n.y,e.z=n.z,e):new f(n.x,n.y,n.z)};f.fromCartesian4=f.clone;f.packedLength=3;f.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=O(o,0),e[o++]=n.x,e[o++]=n.y,e[o]=n.z,e};f.unpack=function(n,e,o){return c.defined("array",n),e=O(e,0),u(o)||(o=new f),o.x=n[e++],o.y=n[e++],o.z=n[e],o};f.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*3;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 3 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)f.pack(n[i],e,i*3);return e};f.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,3),n.length%3!==0)throw new S("array length must be a multiple of 3.");let o=n.length;u(e)?e.length=o/3:e=new Array(o/3);for(let t=0;t<o;t+=3){let i=t/3;e[i]=f.unpack(n,t,e[i])}return e};f.fromArray=f.unpack;f.maximumComponent=function(n){return c.typeOf.object("cartesian",n),Math.max(n.x,n.y,n.z)};f.minimumComponent=function(n){return c.typeOf.object("cartesian",n),Math.min(n.x,n.y,n.z)};f.minimumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.min(n.x,e.x),o.y=Math.min(n.y,e.y),o.z=Math.min(n.z,e.z),o};f.maximumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.max(n.x,e.x),o.y=Math.max(n.y,e.y),o.z=Math.max(n.z,e.z),o};f.clamp=function(n,e,o,t){c.typeOf.object("value",n),c.typeOf.object("min",e),c.typeOf.object("max",o),c.typeOf.object("result",t);let i=w.clamp(n.x,e.x,o.x),p=w.clamp(n.y,e.y,o.y),d=w.clamp(n.z,e.z,o.z);return t.x=i,t.y=p,t.z=d,t};f.magnitudeSquared=function(n){return c.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y+n.z*n.z};f.magnitude=function(n){return Math.sqrt(f.magnitudeSquared(n))};var G=new f;f.distance=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),f.subtract(n,e,G),f.magnitude(G)};f.distanceSquared=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),f.subtract(n,e,G),f.magnitudeSquared(G)};f.normalize=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=f.magnitude(n);if(e.x=n.x/o,e.y=n.y/o,e.z=n.z/o,isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new S("normalized result is not a number");return e};f.dot=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.x+n.y*e.y+n.z*e.z};f.multiplyComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x*e.x,o.y=n.y*e.y,o.z=n.z*e.z,o};f.divideComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x/e.x,o.y=n.y/e.y,o.z=n.z/e.z,o};f.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x+e.x,o.y=n.y+e.y,o.z=n.z+e.z,o};f.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x-e.x,o.y=n.y-e.y,o.z=n.z-e.z,o};f.multiplyByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x*e,o.y=n.y*e,o.z=n.z*e,o};f.divideByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x/e,o.y=n.y/e,o.z=n.z/e,o};f.negate=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=-n.x,e.y=-n.y,e.z=-n.z,e};f.abs=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=Math.abs(n.x),e.y=Math.abs(n.y),e.z=Math.abs(n.z),e};var ln=new f;f.lerp=function(n,e,o,t){return c.typeOf.object("start",n),c.typeOf.object("end",e),c.typeOf.number("t",o),c.typeOf.object("result",t),f.multiplyByScalar(e,o,ln),t=f.multiplyByScalar(n,1-o,t),f.add(ln,t,t)};var Y=new f,yn=new f;f.angleBetween=function(n,e){c.typeOf.object("left",n),c.typeOf.object("right",e),f.normalize(n,Y),f.normalize(e,yn);let o=f.dot(Y,yn),t=f.magnitude(f.cross(Y,yn,Y));return Math.atan2(t,o)};var Xn=new f;f.mostOrthogonalAxis=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=f.normalize(n,Xn);return f.abs(o,o),o.x<=o.y?o.x<=o.z?e=f.clone(f.UNIT_X,e):e=f.clone(f.UNIT_Z,e):o.y<=o.z?e=f.clone(f.UNIT_Y,e):e=f.clone(f.UNIT_Z,e),e};f.projectVector=function(n,e,o){c.defined("a",n),c.defined("b",e),c.defined("result",o);let t=f.dot(n,e)/f.dot(e,e);return f.multiplyByScalar(e,t,o)};f.equals=function(n,e){return n===e||u(n)&&u(e)&&n.x===e.x&&n.y===e.y&&n.z===e.z};f.equalsArray=function(n,e,o){return n.x===e[o]&&n.y===e[o+1]&&n.z===e[o+2]};f.equalsEpsilon=function(n,e,o,t){return n===e||u(n)&&u(e)&&w.equalsEpsilon(n.x,e.x,o,t)&&w.equalsEpsilon(n.y,e.y,o,t)&&w.equalsEpsilon(n.z,e.z,o,t)};f.cross=function(n,e,o){c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o);let t=n.x,i=n.y,p=n.z,d=e.x,m=e.y,s=e.z,h=i*s-p*m,j=p*d-t*s,z=t*m-i*d;return o.x=h,o.y=j,o.z=z,o};f.midpoint=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=(n.x+e.x)*.5,o.y=(n.y+e.y)*.5,o.z=(n.z+e.z)*.5,o};f.fromDegrees=function(n,e,o,t,i){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),n=w.toRadians(n),e=w.toRadians(e),f.fromRadians(n,e,o,t,i)};var C=new f,v=new f;f._ellipsoidRadiiSquared=new f(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);f.fromRadians=function(n,e,o,t,i){c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),o=O(o,0);let p=u(t)?t.radiiSquared:f._ellipsoidRadiiSquared,d=Math.cos(e);C.x=d*Math.cos(n),C.y=d*Math.sin(n),C.z=Math.sin(e),C=f.normalize(C,C),f.multiplyComponents(p,C,v);let m=Math.sqrt(f.dot(C,v));return v=f.divideByScalar(v,m,v),C=f.multiplyByScalar(C,o,C),u(i)||(i=new f),f.add(v,C,i)};f.fromDegreesArray=function(n,e,o){if(c.defined("coordinates",n),n.length<2||n.length%2!==0)throw new S("the number of coordinates must be a multiple of 2 and at least 2");let t=n.length;u(o)?o.length=t/2:o=new Array(t/2);for(let i=0;i<t;i+=2){let p=n[i],d=n[i+1],m=i/2;o[m]=f.fromDegrees(p,d,0,e,o[m])}return o};f.fromRadiansArray=function(n,e,o){if(c.defined("coordinates",n),n.length<2||n.length%2!==0)throw new S("the number of coordinates must be a multiple of 2 and at least 2");let t=n.length;u(o)?o.length=t/2:o=new Array(t/2);for(let i=0;i<t;i+=2){let p=n[i],d=n[i+1],m=i/2;o[m]=f.fromRadians(p,d,0,e,o[m])}return o};f.fromDegreesArrayHeights=function(n,e,o){if(c.defined("coordinates",n),n.length<3||n.length%3!==0)throw new S("the number of coordinates must be a multiple of 3 and at least 3");let t=n.length;u(o)?o.length=t/3:o=new Array(t/3);for(let i=0;i<t;i+=3){let p=n[i],d=n[i+1],m=n[i+2],s=i/3;o[s]=f.fromDegrees(p,d,m,e,o[s])}return o};f.fromRadiansArrayHeights=function(n,e,o){if(c.defined("coordinates",n),n.length<3||n.length%3!==0)throw new S("the number of coordinates must be a multiple of 3 and at least 3");let t=n.length;u(o)?o.length=t/3:o=new Array(t/3);for(let i=0;i<t;i+=3){let p=n[i],d=n[i+1],m=n[i+2],s=i/3;o[s]=f.fromRadians(p,d,m,e,o[s])}return o};f.ZERO=Object.freeze(new f(0,0,0));f.ONE=Object.freeze(new f(1,1,1));f.UNIT_X=Object.freeze(new f(1,0,0));f.UNIT_Y=Object.freeze(new f(0,1,0));f.UNIT_Z=Object.freeze(new f(0,0,1));f.prototype.clone=function(n){return f.clone(this,n)};f.prototype.equals=function(n){return f.equals(this,n)};f.prototype.equalsEpsilon=function(n,e,o){return f.equalsEpsilon(this,n,e,o)};f.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var y=f;var Yn=new y,Gn=new y;function Hn(n,e,o,t,i){if(!u(n))throw new S("cartesian is required.");if(!u(e))throw new S("oneOverRadii is required.");if(!u(o))throw new S("oneOverRadiiSquared is required.");if(!u(t))throw new S("centerToleranceSquared is required.");let p=n.x,d=n.y,m=n.z,s=e.x,h=e.y,j=e.z,z=p*p*s*s,M=d*d*h*h,q=m*m*j*j,N=z+M+q,l=Math.sqrt(1/N),x=y.multiplyByScalar(n,l,Yn);if(N<t)return isFinite(l)?y.clone(x,i):void 0;let U=o.x,I=o.y,P=o.z,k=Gn;k.x=x.x*U*2,k.y=x.y*I*2,k.z=x.z*P*2;let X=(1-l)*y.magnitude(n)/(.5*y.magnitude(k)),Mn=0,pn,qn,L,V,W,un,an,dn,En,An,_n;do{X-=Mn,L=1/(1+X*U),V=1/(1+X*I),W=1/(1+X*P),un=L*L,an=V*V,dn=W*W,En=un*L,An=an*V,_n=dn*W,pn=z*un+M*an+q*dn-1,qn=z*En*U+M*An*I+q*_n*P;let Zn=-2*qn;Mn=pn/Zn}while(Math.abs(pn)>w.EPSILON12);return u(i)?(i.x=p*L,i.y=d*V,i.z=m*W,i):new y(p*L,d*V,m*W)}var H=Hn;function g(n,e,o){this.longitude=O(n,0),this.latitude=O(e,0),this.height=O(o,0)}g.fromRadians=function(n,e,o,t){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),o=O(o,0),u(t)?(t.longitude=n,t.latitude=e,t.height=o,t):new g(n,e,o)};g.fromDegrees=function(n,e,o,t){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),n=w.toRadians(n),e=w.toRadians(e),g.fromRadians(n,e,o,t)};var Qn=new y,Kn=new y,Jn=new y;g._ellipsoidOneOverRadii=new y(1/6378137,1/6378137,1/6356752314245179e-9);g._ellipsoidOneOverRadiiSquared=new y(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));g._ellipsoidCenterToleranceSquared=w.EPSILON1;g.fromCartesian=function(n,e,o){let t=u(e)?e.oneOverRadii:g._ellipsoidOneOverRadii,i=u(e)?e.oneOverRadiiSquared:g._ellipsoidOneOverRadiiSquared,p=u(e)?e._centerToleranceSquared:g._ellipsoidCenterToleranceSquared,d=H(n,t,i,p,Kn);if(!u(d))return;let m=y.multiplyComponents(d,i,Qn);m=y.normalize(m,m);let s=y.subtract(n,d,Jn),h=Math.atan2(m.y,m.x),j=Math.asin(m.z),z=w.sign(y.dot(s,n))*y.magnitude(s);return u(o)?(o.longitude=h,o.latitude=j,o.height=z,o):new g(h,j,z)};g.toCartesian=function(n,e,o){return c.defined("cartographic",n),y.fromRadians(n.longitude,n.latitude,n.height,e,o)};g.clone=function(n,e){if(u(n))return u(e)?(e.longitude=n.longitude,e.latitude=n.latitude,e.height=n.height,e):new g(n.longitude,n.latitude,n.height)};g.equals=function(n,e){return n===e||u(n)&&u(e)&&n.longitude===e.longitude&&n.latitude===e.latitude&&n.height===e.height};g.equalsEpsilon=function(n,e,o){return o=O(o,0),n===e||u(n)&&u(e)&&Math.abs(n.longitude-e.longitude)<=o&&Math.abs(n.latitude-e.latitude)<=o&&Math.abs(n.height-e.height)<=o};g.ZERO=Object.freeze(new g(0,0,0));g.prototype.clone=function(n){return g.clone(this,n)};g.prototype.equals=function(n){return g.equals(this,n)};g.prototype.equalsEpsilon=function(n,e){return g.equalsEpsilon(this,n,e)};g.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var D=g;function a(n,e){this.x=O(n,0),this.y=O(e,0)}a.fromElements=function(n,e,o){return u(o)?(o.x=n,o.y=e,o):new a(n,e)};a.clone=function(n,e){if(u(n))return u(e)?(e.x=n.x,e.y=n.y,e):new a(n.x,n.y)};a.fromCartesian3=a.clone;a.fromCartesian4=a.clone;a.packedLength=2;a.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=O(o,0),e[o++]=n.x,e[o]=n.y,e};a.unpack=function(n,e,o){return c.defined("array",n),e=O(e,0),u(o)||(o=new a),o.x=n[e++],o.y=n[e],o};a.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*2;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 2 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)a.pack(n[i],e,i*2);return e};a.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,2),n.length%2!==0)throw new S("array length must be a multiple of 2.");let o=n.length;u(e)?e.length=o/2:e=new Array(o/2);for(let t=0;t<o;t+=2){let i=t/2;e[i]=a.unpack(n,t,e[i])}return e};a.fromArray=a.unpack;a.maximumComponent=function(n){return c.typeOf.object("cartesian",n),Math.max(n.x,n.y)};a.minimumComponent=function(n){return c.typeOf.object("cartesian",n),Math.min(n.x,n.y)};a.minimumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.min(n.x,e.x),o.y=Math.min(n.y,e.y),o};a.maximumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.max(n.x,e.x),o.y=Math.max(n.y,e.y),o};a.clamp=function(n,e,o,t){c.typeOf.object("value",n),c.typeOf.object("min",e),c.typeOf.object("max",o),c.typeOf.object("result",t);let i=w.clamp(n.x,e.x,o.x),p=w.clamp(n.y,e.y,o.y);return t.x=i,t.y=p,t};a.magnitudeSquared=function(n){return c.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y};a.magnitude=function(n){return Math.sqrt(a.magnitudeSquared(n))};var Q=new a;a.distance=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.subtract(n,e,Q),a.magnitude(Q)};a.distanceSquared=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.subtract(n,e,Q),a.magnitudeSquared(Q)};a.normalize=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=a.magnitude(n);if(e.x=n.x/o,e.y=n.y/o,isNaN(e.x)||isNaN(e.y))throw new S("normalized result is not a number");return e};a.dot=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.x+n.y*e.y};a.cross=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.y-n.y*e.x};a.multiplyComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x*e.x,o.y=n.y*e.y,o};a.divideComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x/e.x,o.y=n.y/e.y,o};a.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x+e.x,o.y=n.y+e.y,o};a.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x-e.x,o.y=n.y-e.y,o};a.multiplyByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x*e,o.y=n.y*e,o};a.divideByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x/e,o.y=n.y/e,o};a.negate=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=-n.x,e.y=-n.y,e};a.abs=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=Math.abs(n.x),e.y=Math.abs(n.y),e};var Cn=new a;a.lerp=function(n,e,o,t){return c.typeOf.object("start",n),c.typeOf.object("end",e),c.typeOf.number("t",o),c.typeOf.object("result",t),a.multiplyByScalar(e,o,Cn),t=a.multiplyByScalar(n,1-o,t),a.add(Cn,t,t)};var Tn=new a,Nn=new a;a.angleBetween=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.normalize(n,Tn),a.normalize(e,Nn),w.acosClamped(a.dot(Tn,Nn))};var ne=new a;a.mostOrthogonalAxis=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=a.normalize(n,ne);return a.abs(o,o),o.x<=o.y?e=a.clone(a.UNIT_X,e):e=a.clone(a.UNIT_Y,e),e};a.equals=function(n,e){return n===e||u(n)&&u(e)&&n.x===e.x&&n.y===e.y};a.equalsArray=function(n,e,o){return n.x===e[o]&&n.y===e[o+1]};a.equalsEpsilon=function(n,e,o,t){return n===e||u(n)&&u(e)&&w.equalsEpsilon(n.x,e.x,o,t)&&w.equalsEpsilon(n.y,e.y,o,t)};a.ZERO=Object.freeze(new a(0,0));a.ONE=Object.freeze(new a(1,1));a.UNIT_X=Object.freeze(new a(1,0));a.UNIT_Y=Object.freeze(new a(0,1));a.prototype.clone=function(n){return a.clone(this,n)};a.prototype.equals=function(n){return a.equals(this,n)};a.prototype.equalsEpsilon=function(n,e,o){return a.equalsEpsilon(this,n,e,o)};a.prototype.toString=function(){return`(${this.x}, ${this.y})`};var mn=a;function Fn(n,e,o,t){e=O(e,0),o=O(o,0),t=O(t,0),c.typeOf.number.greaterThanOrEquals("x",e,0),c.typeOf.number.greaterThanOrEquals("y",o,0),c.typeOf.number.greaterThanOrEquals("z",t,0),n._radii=new y(e,o,t),n._radiiSquared=new y(e*e,o*o,t*t),n._radiiToTheFourth=new y(e*e*e*e,o*o*o*o,t*t*t*t),n._oneOverRadii=new y(e===0?0:1/e,o===0?0:1/o,t===0?0:1/t),n._oneOverRadiiSquared=new y(e===0?0:1/(e*e),o===0?0:1/(o*o),t===0?0:1/(t*t)),n._minimumRadius=Math.min(e,o,t),n._maximumRadius=Math.max(e,o,t),n._centerToleranceSquared=w.EPSILON1,n._radiiSquared.z!==0&&(n._squaredXOverSquaredZ=n._radiiSquared.x/n._radiiSquared.z)}function b(n,e,o){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Fn(this,n,e,o)}Object.defineProperties(b.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});b.clone=function(n,e){if(!u(n))return;let o=n._radii;return u(e)?(y.clone(o,e._radii),y.clone(n._radiiSquared,e._radiiSquared),y.clone(n._radiiToTheFourth,e._radiiToTheFourth),y.clone(n._oneOverRadii,e._oneOverRadii),y.clone(n._oneOverRadiiSquared,e._oneOverRadiiSquared),e._minimumRadius=n._minimumRadius,e._maximumRadius=n._maximumRadius,e._centerToleranceSquared=n._centerToleranceSquared,e):new b(o.x,o.y,o.z)};b.fromCartesian3=function(n,e){return u(e)||(e=new b),u(n)&&Fn(e,n.x,n.y,n.z),e};b.WGS84=Object.freeze(new b(6378137,6378137,6356752314245179e-9));b.UNIT_SPHERE=Object.freeze(new b(1,1,1));b.MOON=Object.freeze(new b(w.LUNAR_RADIUS,w.LUNAR_RADIUS,w.LUNAR_RADIUS));b._default=b.WGS84;Object.defineProperties(b,{default:{get:function(){return b._default},set:function(n){c.typeOf.object("value",n),b._default=n,y._ellipsoidRadiiSquared=n.radiiSquared,D._ellipsoidOneOverRadii=n.oneOverRadii,D._ellipsoidOneOverRadiiSquared=n.oneOverRadiiSquared,D._ellipsoidCenterToleranceSquared=n._centerToleranceSquared}}});b.prototype.clone=function(n){return b.clone(this,n)};b.packedLength=y.packedLength;b.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=O(o,0),y.pack(n._radii,e,o),e};b.unpack=function(n,e,o){c.defined("array",n),e=O(e,0);let t=y.unpack(n,e);return b.fromCartesian3(t,o)};b.prototype.geocentricSurfaceNormal=y.normalize;b.prototype.geodeticSurfaceNormalCartographic=function(n,e){c.typeOf.object("cartographic",n);let o=n.longitude,t=n.latitude,i=Math.cos(t),p=i*Math.cos(o),d=i*Math.sin(o),m=Math.sin(t);return u(e)||(e=new y),e.x=p,e.y=d,e.z=m,y.normalize(e,e)};b.prototype.geodeticSurfaceNormal=function(n,e){if(c.typeOf.object("cartesian",n),isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new S("cartesian has a NaN component");if(!y.equalsEpsilon(n,y.ZERO,w.EPSILON14))return u(e)||(e=new y),e=y.multiplyComponents(n,this._oneOverRadiiSquared,e),y.normalize(e,e)};var ee=new y,oe=new y;b.prototype.cartographicToCartesian=function(n,e){let o=ee,t=oe;this.geodeticSurfaceNormalCartographic(n,o),y.multiplyComponents(this._radiiSquared,o,t);let i=Math.sqrt(y.dot(o,t));return y.divideByScalar(t,i,t),y.multiplyByScalar(o,n.height,o),u(e)||(e=new y),y.add(t,o,e)};b.prototype.cartographicArrayToCartesianArray=function(n,e){c.defined("cartographics",n);let o=n.length;u(e)?e.length=o:e=new Array(o);for(let t=0;t<o;t++)e[t]=this.cartographicToCartesian(n[t],e[t]);return e};var te=new y,ce=new y,ie=new y;b.prototype.cartesianToCartographic=function(n,e){let o=this.scaleToGeodeticSurface(n,ce);if(!u(o))return;let t=this.geodeticSurfaceNormal(o,te),i=y.subtract(n,o,ie),p=Math.atan2(t.y,t.x),d=Math.asin(t.z),m=w.sign(y.dot(i,n))*y.magnitude(i);return u(e)?(e.longitude=p,e.latitude=d,e.height=m,e):new D(p,d,m)};b.prototype.cartesianArrayToCartographicArray=function(n,e){c.defined("cartesians",n);let o=n.length;u(e)?e.length=o:e=new Array(o);for(let t=0;t<o;++t)e[t]=this.cartesianToCartographic(n[t],e[t]);return e};b.prototype.scaleToGeodeticSurface=function(n,e){return H(n,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)};b.prototype.scaleToGeocentricSurface=function(n,e){c.typeOf.object("cartesian",n),u(e)||(e=new y);let o=n.x,t=n.y,i=n.z,p=this._oneOverRadiiSquared,d=1/Math.sqrt(o*o*p.x+t*t*p.y+i*i*p.z);return y.multiplyByScalar(n,d,e)};b.prototype.transformPositionToScaledSpace=function(n,e){return u(e)||(e=new y),y.multiplyComponents(n,this._oneOverRadii,e)};b.prototype.transformPositionFromScaledSpace=function(n,e){return u(e)||(e=new y),y.multiplyComponents(n,this._radii,e)};b.prototype.equals=function(n){return this===n||u(n)&&y.equals(this._radii,n._radii)};b.prototype.toString=function(){return this._radii.toString()};b.prototype.getSurfaceNormalIntersectionWithZAxis=function(n,e,o){if(c.typeOf.object("position",n),!w.equalsEpsilon(this._radii.x,this._radii.y,w.EPSILON15))throw new S("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");c.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),e=O(e,0);let t=this._squaredXOverSquaredZ;if(u(o)||(o=new y),o.x=0,o.y=0,o.z=n.z*(1-t),!(Math.abs(o.z)>=this._radii.z-e))return o};var fe=new y;b.prototype.getLocalCurvature=function(n,e){c.typeOf.object("surfacePosition",n),u(e)||(e=new mn);let o=this.getSurfaceNormalIntersectionWithZAxis(n,0,fe),t=y.distance(n,o),i=this.minimumRadius*t/this.maximumRadius**2,p=t*i**2;return mn.fromElements(1/t,1/p,e)};var re=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],pe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function xn(n,e,o){c.typeOf.number("a",n),c.typeOf.number("b",e),c.typeOf.func("func",o);let t=.5*(e+n),i=.5*(e-n),p=0;for(let d=0;d<5;d++){let m=i*re[d];p+=pe[d]*(o(t+m)+o(t-m))}return p*=i,p}b.prototype.surfaceArea=function(n){c.typeOf.object("rectangle",n);let e=n.west,o=n.east,t=n.south,i=n.north;for(;o<e;)o+=w.TWO_PI;let p=this._radiiSquared,d=p.x,m=p.y,s=p.z,h=d*m;return xn(t,i,function(j){let z=Math.cos(j),M=Math.sin(j);return Math.cos(j)*xn(e,o,function(q){let N=Math.cos(q),l=Math.sin(q);return Math.sqrt(h*M*M+s*(m*N*N+d*l*l)*z*z)})})};var fo=b;function r(n,e,o,t,i,p,d,m,s){this[0]=O(n,0),this[1]=O(t,0),this[2]=O(d,0),this[3]=O(e,0),this[4]=O(i,0),this[5]=O(m,0),this[6]=O(o,0),this[7]=O(p,0),this[8]=O(s,0)}r.packedLength=9;r.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=O(o,0),e[o++]=n[0],e[o++]=n[1],e[o++]=n[2],e[o++]=n[3],e[o++]=n[4],e[o++]=n[5],e[o++]=n[6],e[o++]=n[7],e[o++]=n[8],e};r.unpack=function(n,e,o){return c.defined("array",n),e=O(e,0),u(o)||(o=new r),o[0]=n[e++],o[1]=n[e++],o[2]=n[e++],o[3]=n[e++],o[4]=n[e++],o[5]=n[e++],o[6]=n[e++],o[7]=n[e++],o[8]=n[e++],o};r.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*9;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 9 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)r.pack(n[i],e,i*9);return e};r.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,9),n.length%9!==0)throw new S("array length must be a multiple of 9.");let o=n.length;u(e)?e.length=o/9:e=new Array(o/9);for(let t=0;t<o;t+=9){let i=t/9;e[i]=r.unpack(n,t,e[i])}return e};r.clone=function(n,e){if(u(n))return u(e)?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e):new r(n[0],n[3],n[6],n[1],n[4],n[7],n[2],n[5],n[8])};r.fromArray=r.unpack;r.fromColumnMajorArray=function(n,e){return c.defined("values",n),r.clone(n,e)};r.fromRowMajorArray=function(n,e){return c.defined("values",n),u(e)?(e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],e):new r(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])};r.fromQuaternion=function(n,e){c.typeOf.object("quaternion",n);let o=n.x*n.x,t=n.x*n.y,i=n.x*n.z,p=n.x*n.w,d=n.y*n.y,m=n.y*n.z,s=n.y*n.w,h=n.z*n.z,j=n.z*n.w,z=n.w*n.w,M=o-d-h+z,q=2*(t-j),N=2*(i+s),l=2*(t+j),x=-o+d-h+z,U=2*(m-p),I=2*(i-s),P=2*(m+p),k=-o-d+h+z;return u(e)?(e[0]=M,e[1]=l,e[2]=I,e[3]=q,e[4]=x,e[5]=P,e[6]=N,e[7]=U,e[8]=k,e):new r(M,q,N,l,x,U,I,P,k)};r.fromHeadingPitchRoll=function(n,e){c.typeOf.object("headingPitchRoll",n);let o=Math.cos(-n.pitch),t=Math.cos(-n.heading),i=Math.cos(n.roll),p=Math.sin(-n.pitch),d=Math.sin(-n.heading),m=Math.sin(n.roll),s=o*t,h=-i*d+m*p*t,j=m*d+i*p*t,z=o*d,M=i*t+m*p*d,q=-m*t+i*p*d,N=-p,l=m*o,x=i*o;return u(e)?(e[0]=s,e[1]=z,e[2]=N,e[3]=h,e[4]=M,e[5]=l,e[6]=j,e[7]=q,e[8]=x,e):new r(s,h,j,z,M,q,N,l,x)};r.fromScale=function(n,e){return c.typeOf.object("scale",n),u(e)?(e[0]=n.x,e[1]=0,e[2]=0,e[3]=0,e[4]=n.y,e[5]=0,e[6]=0,e[7]=0,e[8]=n.z,e):new r(n.x,0,0,0,n.y,0,0,0,n.z)};r.fromUniformScale=function(n,e){return c.typeOf.number("scale",n),u(e)?(e[0]=n,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=n,e):new r(n,0,0,0,n,0,0,0,n)};r.fromCrossProduct=function(n,e){return c.typeOf.object("vector",n),u(e)?(e[0]=0,e[1]=n.z,e[2]=-n.y,e[3]=-n.z,e[4]=0,e[5]=n.x,e[6]=n.y,e[7]=-n.x,e[8]=0,e):new r(0,-n.z,n.y,n.z,0,-n.x,-n.y,n.x,0)};r.fromRotationX=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=o,e[5]=t,e[6]=0,e[7]=-t,e[8]=o,e):new r(1,0,0,0,o,-t,0,t,o)};r.fromRotationY=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=o,e[1]=0,e[2]=-t,e[3]=0,e[4]=1,e[5]=0,e[6]=t,e[7]=0,e[8]=o,e):new r(o,0,t,0,1,0,-t,0,o)};r.fromRotationZ=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=o,e[1]=t,e[2]=0,e[3]=-t,e[4]=o,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new r(o,-t,0,t,o,0,0,0,1)};r.toArray=function(n,e){return c.typeOf.object("matrix",n),u(e)?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e):[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8]]};r.getElementIndex=function(n,e){return c.typeOf.number.greaterThanOrEquals("row",e,0),c.typeOf.number.lessThanOrEquals("row",e,2),c.typeOf.number.greaterThanOrEquals("column",n,0),c.typeOf.number.lessThanOrEquals("column",n,2),n*3+e};r.getColumn=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("result",o);let t=e*3,i=n[t],p=n[t+1],d=n[t+2];return o.x=i,o.y=p,o.z=d,o};r.setColumn=function(n,e,o,t){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("cartesian",o),c.typeOf.object("result",t),t=r.clone(n,t);let i=e*3;return t[i]=o.x,t[i+1]=o.y,t[i+2]=o.z,t};r.getRow=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("result",o);let t=n[e],i=n[e+3],p=n[e+6];return o.x=t,o.y=i,o.z=p,o};r.setRow=function(n,e,o,t){return c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("cartesian",o),c.typeOf.object("result",t),t=r.clone(n,t),t[e]=o.x,t[e+3]=o.y,t[e+6]=o.z,t};var ue=new y;r.setScale=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("scale",e),c.typeOf.object("result",o);let t=r.getScale(n,ue),i=e.x/t.x,p=e.y/t.y,d=e.z/t.z;return o[0]=n[0]*i,o[1]=n[1]*i,o[2]=n[2]*i,o[3]=n[3]*p,o[4]=n[4]*p,o[5]=n[5]*p,o[6]=n[6]*d,o[7]=n[7]*d,o[8]=n[8]*d,o};var ae=new y;r.setUniformScale=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number("scale",e),c.typeOf.object("result",o);let t=r.getScale(n,ae),i=e/t.x,p=e/t.y,d=e/t.z;return o[0]=n[0]*i,o[1]=n[1]*i,o[2]=n[2]*i,o[3]=n[3]*p,o[4]=n[4]*p,o[5]=n[5]*p,o[6]=n[6]*d,o[7]=n[7]*d,o[8]=n[8]*d,o};var sn=new y;r.getScale=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e.x=y.magnitude(y.fromElements(n[0],n[1],n[2],sn)),e.y=y.magnitude(y.fromElements(n[3],n[4],n[5],sn)),e.z=y.magnitude(y.fromElements(n[6],n[7],n[8],sn)),e};var kn=new y;r.getMaximumScale=function(n){return r.getScale(n,kn),y.maximumComponent(kn)};var de=new y;r.setRotation=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("result",o);let t=r.getScale(n,de);return o[0]=e[0]*t.x,o[1]=e[1]*t.x,o[2]=e[2]*t.x,o[3]=e[3]*t.y,o[4]=e[4]*t.y,o[5]=e[5]*t.y,o[6]=e[6]*t.z,o[7]=e[7]*t.z,o[8]=e[8]*t.z,o};var ye=new y;r.getRotation=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=r.getScale(n,ye);return e[0]=n[0]/o.x,e[1]=n[1]/o.x,e[2]=n[2]/o.x,e[3]=n[3]/o.y,e[4]=n[4]/o.y,e[5]=n[5]/o.y,e[6]=n[6]/o.z,e[7]=n[7]/o.z,e[8]=n[8]/o.z,e};r.multiply=function(n,e,o){c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o);let t=n[0]*e[0]+n[3]*e[1]+n[6]*e[2],i=n[1]*e[0]+n[4]*e[1]+n[7]*e[2],p=n[2]*e[0]+n[5]*e[1]+n[8]*e[2],d=n[0]*e[3]+n[3]*e[4]+n[6]*e[5],m=n[1]*e[3]+n[4]*e[4]+n[7]*e[5],s=n[2]*e[3]+n[5]*e[4]+n[8]*e[5],h=n[0]*e[6]+n[3]*e[7]+n[6]*e[8],j=n[1]*e[6]+n[4]*e[7]+n[7]*e[8],z=n[2]*e[6]+n[5]*e[7]+n[8]*e[8];return o[0]=t,o[1]=i,o[2]=p,o[3]=d,o[4]=m,o[5]=s,o[6]=h,o[7]=j,o[8]=z,o};r.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o[0]=n[0]+e[0],o[1]=n[1]+e[1],o[2]=n[2]+e[2],o[3]=n[3]+e[3],o[4]=n[4]+e[4],o[5]=n[5]+e[5],o[6]=n[6]+e[6],o[7]=n[7]+e[7],o[8]=n[8]+e[8],o};r.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],o[3]=n[3]-e[3],o[4]=n[4]-e[4],o[5]=n[5]-e[5],o[6]=n[6]-e[6],o[7]=n[7]-e[7],o[8]=n[8]-e[8],o};r.multiplyByVector=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("cartesian",e),c.typeOf.object("result",o);let t=e.x,i=e.y,p=e.z,d=n[0]*t+n[3]*i+n[6]*p,m=n[1]*t+n[4]*i+n[7]*p,s=n[2]*t+n[5]*i+n[8]*p;return o.x=d,o.y=m,o.z=s,o};r.multiplyByScalar=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o[0]=n[0]*e,o[1]=n[1]*e,o[2]=n[2]*e,o[3]=n[3]*e,o[4]=n[4]*e,o[5]=n[5]*e,o[6]=n[6]*e,o[7]=n[7]*e,o[8]=n[8]*e,o};r.multiplyByScale=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.object("scale",e),c.typeOf.object("result",o),o[0]=n[0]*e.x,o[1]=n[1]*e.x,o[2]=n[2]*e.x,o[3]=n[3]*e.y,o[4]=n[4]*e.y,o[5]=n[5]*e.y,o[6]=n[6]*e.z,o[7]=n[7]*e.z,o[8]=n[8]*e.z,o};r.multiplyByUniformScale=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.number("scale",e),c.typeOf.object("result",o),o[0]=n[0]*e,o[1]=n[1]*e,o[2]=n[2]*e,o[3]=n[3]*e,o[4]=n[4]*e,o[5]=n[5]*e,o[6]=n[6]*e,o[7]=n[7]*e,o[8]=n[8]*e,o};r.negate=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e[0]=-n[0],e[1]=-n[1],e[2]=-n[2],e[3]=-n[3],e[4]=-n[4],e[5]=-n[5],e[6]=-n[6],e[7]=-n[7],e[8]=-n[8],e};r.transpose=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=n[0],t=n[3],i=n[6],p=n[1],d=n[4],m=n[7],s=n[2],h=n[5],j=n[8];return e[0]=o,e[1]=t,e[2]=i,e[3]=p,e[4]=d,e[5]=m,e[6]=s,e[7]=h,e[8]=j,e};function me(n){let e=0;for(let o=0;o<9;++o){let t=n[o];e+=t*t}return Math.sqrt(e)}var On=[1,0,0],bn=[2,2,1];function se(n){let e=0;for(let o=0;o<3;++o){let t=n[r.getElementIndex(bn[o],On[o])];e+=2*t*t}return Math.sqrt(e)}function Oe(n,e){let o=w.EPSILON15,t=0,i=1;for(let h=0;h<3;++h){let j=Math.abs(n[r.getElementIndex(bn[h],On[h])]);j>t&&(i=h,t=j)}let p=1,d=0,m=On[i],s=bn[i];if(Math.abs(n[r.getElementIndex(s,m)])>o){let h=n[r.getElementIndex(s,s)],j=n[r.getElementIndex(m,m)],z=n[r.getElementIndex(s,m)],M=(h-j)/2/z,q;M<0?q=-1/(-M+Math.sqrt(1+M*M)):q=1/(M+Math.sqrt(1+M*M)),p=1/Math.sqrt(1+q*q),d=q*p}return e=r.clone(r.IDENTITY,e),e[r.getElementIndex(m,m)]=e[r.getElementIndex(s,s)]=p,e[r.getElementIndex(s,m)]=d,e[r.getElementIndex(m,s)]=-d,e}var K=new r,Bn=new r;r.computeEigenDecomposition=function(n,e){c.typeOf.object("matrix",n);let o=w.EPSILON20,t=10,i=0,p=0;u(e)||(e={});let d=e.unitary=r.clone(r.IDENTITY,e.unitary),m=e.diagonal=r.clone(n,e.diagonal),s=o*me(m);for(;p<t&&se(m)>s;)Oe(m,K),r.transpose(K,Bn),r.multiply(m,K,m),r.multiply(Bn,m,m),r.multiply(d,K,d),++i>2&&(++p,i=0);return e};r.abs=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e[0]=Math.abs(n[0]),e[1]=Math.abs(n[1]),e[2]=Math.abs(n[2]),e[3]=Math.abs(n[3]),e[4]=Math.abs(n[4]),e[5]=Math.abs(n[5]),e[6]=Math.abs(n[6]),e[7]=Math.abs(n[7]),e[8]=Math.abs(n[8]),e};r.determinant=function(n){c.typeOf.object("matrix",n);let e=n[0],o=n[3],t=n[6],i=n[1],p=n[4],d=n[7],m=n[2],s=n[5],h=n[8];return e*(p*h-s*d)+i*(s*t-o*h)+m*(o*d-p*t)};r.inverse=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=n[0],t=n[1],i=n[2],p=n[3],d=n[4],m=n[5],s=n[6],h=n[7],j=n[8],z=r.determinant(n);if(Math.abs(z)<=w.EPSILON15)throw new S("matrix is not invertible");e[0]=d*j-h*m,e[1]=h*i-t*j,e[2]=t*m-d*i,e[3]=s*m-p*j,e[4]=o*j-s*i,e[5]=p*i-o*m,e[6]=p*h-s*d,e[7]=s*t-o*h,e[8]=o*d-p*t;let M=1/z;return r.multiplyByScalar(e,M,e)};var be=new r;r.inverseTranspose=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),r.inverse(r.transpose(n,be),e)};r.equals=function(n,e){return n===e||u(n)&&u(e)&&n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]&&n[4]===e[4]&&n[5]===e[5]&&n[6]===e[6]&&n[7]===e[7]&&n[8]===e[8]};r.equalsEpsilon=function(n,e,o){return o=O(o,0),n===e||u(n)&&u(e)&&Math.abs(n[0]-e[0])<=o&&Math.abs(n[1]-e[1])<=o&&Math.abs(n[2]-e[2])<=o&&Math.abs(n[3]-e[3])<=o&&Math.abs(n[4]-e[4])<=o&&Math.abs(n[5]-e[5])<=o&&Math.abs(n[6]-e[6])<=o&&Math.abs(n[7]-e[7])<=o&&Math.abs(n[8]-e[8])<=o};r.IDENTITY=Object.freeze(new r(1,0,0,0,1,0,0,0,1));r.ZERO=Object.freeze(new r(0,0,0,0,0,0,0,0,0));r.COLUMN0ROW0=0;r.COLUMN0ROW1=1;r.COLUMN0ROW2=2;r.COLUMN1ROW0=3;r.COLUMN1ROW1=4;r.COLUMN1ROW2=5;r.COLUMN2ROW0=6;r.COLUMN2ROW1=7;r.COLUMN2ROW2=8;Object.defineProperties(r.prototype,{length:{get:function(){return r.packedLength}}});r.prototype.clone=function(n){return r.clone(this,n)};r.prototype.equals=function(n){return r.equals(this,n)};r.equalsArray=function(n,e,o){return n[0]===e[o]&&n[1]===e[o+1]&&n[2]===e[o+2]&&n[3]===e[o+3]&&n[4]===e[o+4]&&n[5]===e[o+5]&&n[6]===e[o+6]&&n[7]===e[o+7]&&n[8]===e[o+8]};r.prototype.equalsEpsilon=function(n,e){return r.equalsEpsilon(this,n,e)};r.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) +import{a as w}from"./chunk-FRWNWNYJ.js";import{a as O}from"./chunk-TA3RE4KQ.js";import{a as S,b as c}from"./chunk-RTY3VPG6.js";import{e as u}from"./chunk-LRNH5AEO.js";function f(n,e,o){this.x=O(n,0),this.y=O(e,0),this.z=O(o,0)}f.fromSpherical=function(n,e){c.typeOf.object("spherical",n),u(e)||(e=new f);let o=n.clock,t=n.cone,i=O(n.magnitude,1),p=i*Math.sin(t);return e.x=p*Math.cos(o),e.y=p*Math.sin(o),e.z=i*Math.cos(t),e};f.fromElements=function(n,e,o,t){return u(t)?(t.x=n,t.y=e,t.z=o,t):new f(n,e,o)};f.clone=function(n,e){if(u(n))return u(e)?(e.x=n.x,e.y=n.y,e.z=n.z,e):new f(n.x,n.y,n.z)};f.fromCartesian4=f.clone;f.packedLength=3;f.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=O(o,0),e[o++]=n.x,e[o++]=n.y,e[o]=n.z,e};f.unpack=function(n,e,o){return c.defined("array",n),e=O(e,0),u(o)||(o=new f),o.x=n[e++],o.y=n[e++],o.z=n[e],o};f.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*3;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 3 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)f.pack(n[i],e,i*3);return e};f.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,3),n.length%3!==0)throw new S("array length must be a multiple of 3.");let o=n.length;u(e)?e.length=o/3:e=new Array(o/3);for(let t=0;t<o;t+=3){let i=t/3;e[i]=f.unpack(n,t,e[i])}return e};f.fromArray=f.unpack;f.maximumComponent=function(n){return c.typeOf.object("cartesian",n),Math.max(n.x,n.y,n.z)};f.minimumComponent=function(n){return c.typeOf.object("cartesian",n),Math.min(n.x,n.y,n.z)};f.minimumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.min(n.x,e.x),o.y=Math.min(n.y,e.y),o.z=Math.min(n.z,e.z),o};f.maximumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.max(n.x,e.x),o.y=Math.max(n.y,e.y),o.z=Math.max(n.z,e.z),o};f.clamp=function(n,e,o,t){c.typeOf.object("value",n),c.typeOf.object("min",e),c.typeOf.object("max",o),c.typeOf.object("result",t);let i=w.clamp(n.x,e.x,o.x),p=w.clamp(n.y,e.y,o.y),d=w.clamp(n.z,e.z,o.z);return t.x=i,t.y=p,t.z=d,t};f.magnitudeSquared=function(n){return c.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y+n.z*n.z};f.magnitude=function(n){return Math.sqrt(f.magnitudeSquared(n))};var G=new f;f.distance=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),f.subtract(n,e,G),f.magnitude(G)};f.distanceSquared=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),f.subtract(n,e,G),f.magnitudeSquared(G)};f.normalize=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=f.magnitude(n);if(e.x=n.x/o,e.y=n.y/o,e.z=n.z/o,isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new S("normalized result is not a number");return e};f.dot=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.x+n.y*e.y+n.z*e.z};f.multiplyComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x*e.x,o.y=n.y*e.y,o.z=n.z*e.z,o};f.divideComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x/e.x,o.y=n.y/e.y,o.z=n.z/e.z,o};f.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x+e.x,o.y=n.y+e.y,o.z=n.z+e.z,o};f.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x-e.x,o.y=n.y-e.y,o.z=n.z-e.z,o};f.multiplyByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x*e,o.y=n.y*e,o.z=n.z*e,o};f.divideByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x/e,o.y=n.y/e,o.z=n.z/e,o};f.negate=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=-n.x,e.y=-n.y,e.z=-n.z,e};f.abs=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=Math.abs(n.x),e.y=Math.abs(n.y),e.z=Math.abs(n.z),e};var ln=new f;f.lerp=function(n,e,o,t){return c.typeOf.object("start",n),c.typeOf.object("end",e),c.typeOf.number("t",o),c.typeOf.object("result",t),f.multiplyByScalar(e,o,ln),t=f.multiplyByScalar(n,1-o,t),f.add(ln,t,t)};var Y=new f,yn=new f;f.angleBetween=function(n,e){c.typeOf.object("left",n),c.typeOf.object("right",e),f.normalize(n,Y),f.normalize(e,yn);let o=f.dot(Y,yn),t=f.magnitude(f.cross(Y,yn,Y));return Math.atan2(t,o)};var Xn=new f;f.mostOrthogonalAxis=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=f.normalize(n,Xn);return f.abs(o,o),o.x<=o.y?o.x<=o.z?e=f.clone(f.UNIT_X,e):e=f.clone(f.UNIT_Z,e):o.y<=o.z?e=f.clone(f.UNIT_Y,e):e=f.clone(f.UNIT_Z,e),e};f.projectVector=function(n,e,o){c.defined("a",n),c.defined("b",e),c.defined("result",o);let t=f.dot(n,e)/f.dot(e,e);return f.multiplyByScalar(e,t,o)};f.equals=function(n,e){return n===e||u(n)&&u(e)&&n.x===e.x&&n.y===e.y&&n.z===e.z};f.equalsArray=function(n,e,o){return n.x===e[o]&&n.y===e[o+1]&&n.z===e[o+2]};f.equalsEpsilon=function(n,e,o,t){return n===e||u(n)&&u(e)&&w.equalsEpsilon(n.x,e.x,o,t)&&w.equalsEpsilon(n.y,e.y,o,t)&&w.equalsEpsilon(n.z,e.z,o,t)};f.cross=function(n,e,o){c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o);let t=n.x,i=n.y,p=n.z,d=e.x,m=e.y,s=e.z,h=i*s-p*m,j=p*d-t*s,z=t*m-i*d;return o.x=h,o.y=j,o.z=z,o};f.midpoint=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=(n.x+e.x)*.5,o.y=(n.y+e.y)*.5,o.z=(n.z+e.z)*.5,o};f.fromDegrees=function(n,e,o,t,i){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),n=w.toRadians(n),e=w.toRadians(e),f.fromRadians(n,e,o,t,i)};var C=new f,v=new f;f._ellipsoidRadiiSquared=new f(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);f.fromRadians=function(n,e,o,t,i){c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),o=O(o,0);let p=u(t)?t.radiiSquared:f._ellipsoidRadiiSquared,d=Math.cos(e);C.x=d*Math.cos(n),C.y=d*Math.sin(n),C.z=Math.sin(e),C=f.normalize(C,C),f.multiplyComponents(p,C,v);let m=Math.sqrt(f.dot(C,v));return v=f.divideByScalar(v,m,v),C=f.multiplyByScalar(C,o,C),u(i)||(i=new f),f.add(v,C,i)};f.fromDegreesArray=function(n,e,o){if(c.defined("coordinates",n),n.length<2||n.length%2!==0)throw new S("the number of coordinates must be a multiple of 2 and at least 2");let t=n.length;u(o)?o.length=t/2:o=new Array(t/2);for(let i=0;i<t;i+=2){let p=n[i],d=n[i+1],m=i/2;o[m]=f.fromDegrees(p,d,0,e,o[m])}return o};f.fromRadiansArray=function(n,e,o){if(c.defined("coordinates",n),n.length<2||n.length%2!==0)throw new S("the number of coordinates must be a multiple of 2 and at least 2");let t=n.length;u(o)?o.length=t/2:o=new Array(t/2);for(let i=0;i<t;i+=2){let p=n[i],d=n[i+1],m=i/2;o[m]=f.fromRadians(p,d,0,e,o[m])}return o};f.fromDegreesArrayHeights=function(n,e,o){if(c.defined("coordinates",n),n.length<3||n.length%3!==0)throw new S("the number of coordinates must be a multiple of 3 and at least 3");let t=n.length;u(o)?o.length=t/3:o=new Array(t/3);for(let i=0;i<t;i+=3){let p=n[i],d=n[i+1],m=n[i+2],s=i/3;o[s]=f.fromDegrees(p,d,m,e,o[s])}return o};f.fromRadiansArrayHeights=function(n,e,o){if(c.defined("coordinates",n),n.length<3||n.length%3!==0)throw new S("the number of coordinates must be a multiple of 3 and at least 3");let t=n.length;u(o)?o.length=t/3:o=new Array(t/3);for(let i=0;i<t;i+=3){let p=n[i],d=n[i+1],m=n[i+2],s=i/3;o[s]=f.fromRadians(p,d,m,e,o[s])}return o};f.ZERO=Object.freeze(new f(0,0,0));f.ONE=Object.freeze(new f(1,1,1));f.UNIT_X=Object.freeze(new f(1,0,0));f.UNIT_Y=Object.freeze(new f(0,1,0));f.UNIT_Z=Object.freeze(new f(0,0,1));f.prototype.clone=function(n){return f.clone(this,n)};f.prototype.equals=function(n){return f.equals(this,n)};f.prototype.equalsEpsilon=function(n,e,o){return f.equalsEpsilon(this,n,e,o)};f.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var y=f;var Yn=new y,Gn=new y;function Hn(n,e,o,t,i){if(!u(n))throw new S("cartesian is required.");if(!u(e))throw new S("oneOverRadii is required.");if(!u(o))throw new S("oneOverRadiiSquared is required.");if(!u(t))throw new S("centerToleranceSquared is required.");let p=n.x,d=n.y,m=n.z,s=e.x,h=e.y,j=e.z,z=p*p*s*s,M=d*d*h*h,q=m*m*j*j,N=z+M+q,l=Math.sqrt(1/N),x=y.multiplyByScalar(n,l,Yn);if(N<t)return isFinite(l)?y.clone(x,i):void 0;let U=o.x,I=o.y,P=o.z,k=Gn;k.x=x.x*U*2,k.y=x.y*I*2,k.z=x.z*P*2;let X=(1-l)*y.magnitude(n)/(.5*y.magnitude(k)),Mn=0,pn,qn,L,V,W,un,an,dn,En,An,_n;do{X-=Mn,L=1/(1+X*U),V=1/(1+X*I),W=1/(1+X*P),un=L*L,an=V*V,dn=W*W,En=un*L,An=an*V,_n=dn*W,pn=z*un+M*an+q*dn-1,qn=z*En*U+M*An*I+q*_n*P;let Zn=-2*qn;Mn=pn/Zn}while(Math.abs(pn)>w.EPSILON12);return u(i)?(i.x=p*L,i.y=d*V,i.z=m*W,i):new y(p*L,d*V,m*W)}var H=Hn;function g(n,e,o){this.longitude=O(n,0),this.latitude=O(e,0),this.height=O(o,0)}g.fromRadians=function(n,e,o,t){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),o=O(o,0),u(t)?(t.longitude=n,t.latitude=e,t.height=o,t):new g(n,e,o)};g.fromDegrees=function(n,e,o,t){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),n=w.toRadians(n),e=w.toRadians(e),g.fromRadians(n,e,o,t)};var Qn=new y,Kn=new y,Jn=new y;g._ellipsoidOneOverRadii=new y(1/6378137,1/6378137,1/6356752314245179e-9);g._ellipsoidOneOverRadiiSquared=new y(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));g._ellipsoidCenterToleranceSquared=w.EPSILON1;g.fromCartesian=function(n,e,o){let t=u(e)?e.oneOverRadii:g._ellipsoidOneOverRadii,i=u(e)?e.oneOverRadiiSquared:g._ellipsoidOneOverRadiiSquared,p=u(e)?e._centerToleranceSquared:g._ellipsoidCenterToleranceSquared,d=H(n,t,i,p,Kn);if(!u(d))return;let m=y.multiplyComponents(d,i,Qn);m=y.normalize(m,m);let s=y.subtract(n,d,Jn),h=Math.atan2(m.y,m.x),j=Math.asin(m.z),z=w.sign(y.dot(s,n))*y.magnitude(s);return u(o)?(o.longitude=h,o.latitude=j,o.height=z,o):new g(h,j,z)};g.toCartesian=function(n,e,o){return c.defined("cartographic",n),y.fromRadians(n.longitude,n.latitude,n.height,e,o)};g.clone=function(n,e){if(u(n))return u(e)?(e.longitude=n.longitude,e.latitude=n.latitude,e.height=n.height,e):new g(n.longitude,n.latitude,n.height)};g.equals=function(n,e){return n===e||u(n)&&u(e)&&n.longitude===e.longitude&&n.latitude===e.latitude&&n.height===e.height};g.equalsEpsilon=function(n,e,o){return o=O(o,0),n===e||u(n)&&u(e)&&Math.abs(n.longitude-e.longitude)<=o&&Math.abs(n.latitude-e.latitude)<=o&&Math.abs(n.height-e.height)<=o};g.ZERO=Object.freeze(new g(0,0,0));g.prototype.clone=function(n){return g.clone(this,n)};g.prototype.equals=function(n){return g.equals(this,n)};g.prototype.equalsEpsilon=function(n,e){return g.equalsEpsilon(this,n,e)};g.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var D=g;function a(n,e){this.x=O(n,0),this.y=O(e,0)}a.fromElements=function(n,e,o){return u(o)?(o.x=n,o.y=e,o):new a(n,e)};a.clone=function(n,e){if(u(n))return u(e)?(e.x=n.x,e.y=n.y,e):new a(n.x,n.y)};a.fromCartesian3=a.clone;a.fromCartesian4=a.clone;a.packedLength=2;a.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=O(o,0),e[o++]=n.x,e[o]=n.y,e};a.unpack=function(n,e,o){return c.defined("array",n),e=O(e,0),u(o)||(o=new a),o.x=n[e++],o.y=n[e],o};a.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*2;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 2 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)a.pack(n[i],e,i*2);return e};a.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,2),n.length%2!==0)throw new S("array length must be a multiple of 2.");let o=n.length;u(e)?e.length=o/2:e=new Array(o/2);for(let t=0;t<o;t+=2){let i=t/2;e[i]=a.unpack(n,t,e[i])}return e};a.fromArray=a.unpack;a.maximumComponent=function(n){return c.typeOf.object("cartesian",n),Math.max(n.x,n.y)};a.minimumComponent=function(n){return c.typeOf.object("cartesian",n),Math.min(n.x,n.y)};a.minimumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.min(n.x,e.x),o.y=Math.min(n.y,e.y),o};a.maximumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.max(n.x,e.x),o.y=Math.max(n.y,e.y),o};a.clamp=function(n,e,o,t){c.typeOf.object("value",n),c.typeOf.object("min",e),c.typeOf.object("max",o),c.typeOf.object("result",t);let i=w.clamp(n.x,e.x,o.x),p=w.clamp(n.y,e.y,o.y);return t.x=i,t.y=p,t};a.magnitudeSquared=function(n){return c.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y};a.magnitude=function(n){return Math.sqrt(a.magnitudeSquared(n))};var Q=new a;a.distance=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.subtract(n,e,Q),a.magnitude(Q)};a.distanceSquared=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.subtract(n,e,Q),a.magnitudeSquared(Q)};a.normalize=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=a.magnitude(n);if(e.x=n.x/o,e.y=n.y/o,isNaN(e.x)||isNaN(e.y))throw new S("normalized result is not a number");return e};a.dot=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.x+n.y*e.y};a.cross=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.y-n.y*e.x};a.multiplyComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x*e.x,o.y=n.y*e.y,o};a.divideComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x/e.x,o.y=n.y/e.y,o};a.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x+e.x,o.y=n.y+e.y,o};a.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x-e.x,o.y=n.y-e.y,o};a.multiplyByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x*e,o.y=n.y*e,o};a.divideByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x/e,o.y=n.y/e,o};a.negate=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=-n.x,e.y=-n.y,e};a.abs=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=Math.abs(n.x),e.y=Math.abs(n.y),e};var Cn=new a;a.lerp=function(n,e,o,t){return c.typeOf.object("start",n),c.typeOf.object("end",e),c.typeOf.number("t",o),c.typeOf.object("result",t),a.multiplyByScalar(e,o,Cn),t=a.multiplyByScalar(n,1-o,t),a.add(Cn,t,t)};var Tn=new a,Nn=new a;a.angleBetween=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.normalize(n,Tn),a.normalize(e,Nn),w.acosClamped(a.dot(Tn,Nn))};var ne=new a;a.mostOrthogonalAxis=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=a.normalize(n,ne);return a.abs(o,o),o.x<=o.y?e=a.clone(a.UNIT_X,e):e=a.clone(a.UNIT_Y,e),e};a.equals=function(n,e){return n===e||u(n)&&u(e)&&n.x===e.x&&n.y===e.y};a.equalsArray=function(n,e,o){return n.x===e[o]&&n.y===e[o+1]};a.equalsEpsilon=function(n,e,o,t){return n===e||u(n)&&u(e)&&w.equalsEpsilon(n.x,e.x,o,t)&&w.equalsEpsilon(n.y,e.y,o,t)};a.ZERO=Object.freeze(new a(0,0));a.ONE=Object.freeze(new a(1,1));a.UNIT_X=Object.freeze(new a(1,0));a.UNIT_Y=Object.freeze(new a(0,1));a.prototype.clone=function(n){return a.clone(this,n)};a.prototype.equals=function(n){return a.equals(this,n)};a.prototype.equalsEpsilon=function(n,e,o){return a.equalsEpsilon(this,n,e,o)};a.prototype.toString=function(){return`(${this.x}, ${this.y})`};var mn=a;function Fn(n,e,o,t){e=O(e,0),o=O(o,0),t=O(t,0),c.typeOf.number.greaterThanOrEquals("x",e,0),c.typeOf.number.greaterThanOrEquals("y",o,0),c.typeOf.number.greaterThanOrEquals("z",t,0),n._radii=new y(e,o,t),n._radiiSquared=new y(e*e,o*o,t*t),n._radiiToTheFourth=new y(e*e*e*e,o*o*o*o,t*t*t*t),n._oneOverRadii=new y(e===0?0:1/e,o===0?0:1/o,t===0?0:1/t),n._oneOverRadiiSquared=new y(e===0?0:1/(e*e),o===0?0:1/(o*o),t===0?0:1/(t*t)),n._minimumRadius=Math.min(e,o,t),n._maximumRadius=Math.max(e,o,t),n._centerToleranceSquared=w.EPSILON1,n._radiiSquared.z!==0&&(n._squaredXOverSquaredZ=n._radiiSquared.x/n._radiiSquared.z)}function b(n,e,o){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Fn(this,n,e,o)}Object.defineProperties(b.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});b.clone=function(n,e){if(!u(n))return;let o=n._radii;return u(e)?(y.clone(o,e._radii),y.clone(n._radiiSquared,e._radiiSquared),y.clone(n._radiiToTheFourth,e._radiiToTheFourth),y.clone(n._oneOverRadii,e._oneOverRadii),y.clone(n._oneOverRadiiSquared,e._oneOverRadiiSquared),e._minimumRadius=n._minimumRadius,e._maximumRadius=n._maximumRadius,e._centerToleranceSquared=n._centerToleranceSquared,e):new b(o.x,o.y,o.z)};b.fromCartesian3=function(n,e){return u(e)||(e=new b),u(n)&&Fn(e,n.x,n.y,n.z),e};b.WGS84=Object.freeze(new b(6378137,6378137,6356752314245179e-9));b.UNIT_SPHERE=Object.freeze(new b(1,1,1));b.MOON=Object.freeze(new b(w.LUNAR_RADIUS,w.LUNAR_RADIUS,w.LUNAR_RADIUS));b._default=b.WGS84;Object.defineProperties(b,{default:{get:function(){return b._default},set:function(n){c.typeOf.object("value",n),b._default=n,y._ellipsoidRadiiSquared=n.radiiSquared,D._ellipsoidOneOverRadii=n.oneOverRadii,D._ellipsoidOneOverRadiiSquared=n.oneOverRadiiSquared,D._ellipsoidCenterToleranceSquared=n._centerToleranceSquared}}});b.prototype.clone=function(n){return b.clone(this,n)};b.packedLength=y.packedLength;b.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=O(o,0),y.pack(n._radii,e,o),e};b.unpack=function(n,e,o){c.defined("array",n),e=O(e,0);let t=y.unpack(n,e);return b.fromCartesian3(t,o)};b.prototype.geocentricSurfaceNormal=y.normalize;b.prototype.geodeticSurfaceNormalCartographic=function(n,e){c.typeOf.object("cartographic",n);let o=n.longitude,t=n.latitude,i=Math.cos(t),p=i*Math.cos(o),d=i*Math.sin(o),m=Math.sin(t);return u(e)||(e=new y),e.x=p,e.y=d,e.z=m,y.normalize(e,e)};b.prototype.geodeticSurfaceNormal=function(n,e){if(c.typeOf.object("cartesian",n),isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new S("cartesian has a NaN component");if(!y.equalsEpsilon(n,y.ZERO,w.EPSILON14))return u(e)||(e=new y),e=y.multiplyComponents(n,this._oneOverRadiiSquared,e),y.normalize(e,e)};var ee=new y,oe=new y;b.prototype.cartographicToCartesian=function(n,e){let o=ee,t=oe;this.geodeticSurfaceNormalCartographic(n,o),y.multiplyComponents(this._radiiSquared,o,t);let i=Math.sqrt(y.dot(o,t));return y.divideByScalar(t,i,t),y.multiplyByScalar(o,n.height,o),u(e)||(e=new y),y.add(t,o,e)};b.prototype.cartographicArrayToCartesianArray=function(n,e){c.defined("cartographics",n);let o=n.length;u(e)?e.length=o:e=new Array(o);for(let t=0;t<o;t++)e[t]=this.cartographicToCartesian(n[t],e[t]);return e};var te=new y,ce=new y,ie=new y;b.prototype.cartesianToCartographic=function(n,e){let o=this.scaleToGeodeticSurface(n,ce);if(!u(o))return;let t=this.geodeticSurfaceNormal(o,te),i=y.subtract(n,o,ie),p=Math.atan2(t.y,t.x),d=Math.asin(t.z),m=w.sign(y.dot(i,n))*y.magnitude(i);return u(e)?(e.longitude=p,e.latitude=d,e.height=m,e):new D(p,d,m)};b.prototype.cartesianArrayToCartographicArray=function(n,e){c.defined("cartesians",n);let o=n.length;u(e)?e.length=o:e=new Array(o);for(let t=0;t<o;++t)e[t]=this.cartesianToCartographic(n[t],e[t]);return e};b.prototype.scaleToGeodeticSurface=function(n,e){return H(n,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)};b.prototype.scaleToGeocentricSurface=function(n,e){c.typeOf.object("cartesian",n),u(e)||(e=new y);let o=n.x,t=n.y,i=n.z,p=this._oneOverRadiiSquared,d=1/Math.sqrt(o*o*p.x+t*t*p.y+i*i*p.z);return y.multiplyByScalar(n,d,e)};b.prototype.transformPositionToScaledSpace=function(n,e){return u(e)||(e=new y),y.multiplyComponents(n,this._oneOverRadii,e)};b.prototype.transformPositionFromScaledSpace=function(n,e){return u(e)||(e=new y),y.multiplyComponents(n,this._radii,e)};b.prototype.equals=function(n){return this===n||u(n)&&y.equals(this._radii,n._radii)};b.prototype.toString=function(){return this._radii.toString()};b.prototype.getSurfaceNormalIntersectionWithZAxis=function(n,e,o){if(c.typeOf.object("position",n),!w.equalsEpsilon(this._radii.x,this._radii.y,w.EPSILON15))throw new S("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");c.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),e=O(e,0);let t=this._squaredXOverSquaredZ;if(u(o)||(o=new y),o.x=0,o.y=0,o.z=n.z*(1-t),!(Math.abs(o.z)>=this._radii.z-e))return o};var fe=new y;b.prototype.getLocalCurvature=function(n,e){c.typeOf.object("surfacePosition",n),u(e)||(e=new mn);let o=this.getSurfaceNormalIntersectionWithZAxis(n,0,fe),t=y.distance(n,o),i=this.minimumRadius*t/this.maximumRadius**2,p=t*i**2;return mn.fromElements(1/t,1/p,e)};var re=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],pe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function xn(n,e,o){c.typeOf.number("a",n),c.typeOf.number("b",e),c.typeOf.func("func",o);let t=.5*(e+n),i=.5*(e-n),p=0;for(let d=0;d<5;d++){let m=i*re[d];p+=pe[d]*(o(t+m)+o(t-m))}return p*=i,p}b.prototype.surfaceArea=function(n){c.typeOf.object("rectangle",n);let e=n.west,o=n.east,t=n.south,i=n.north;for(;o<e;)o+=w.TWO_PI;let p=this._radiiSquared,d=p.x,m=p.y,s=p.z,h=d*m;return xn(t,i,function(j){let z=Math.cos(j),M=Math.sin(j);return Math.cos(j)*xn(e,o,function(q){let N=Math.cos(q),l=Math.sin(q);return Math.sqrt(h*M*M+s*(m*N*N+d*l*l)*z*z)})})};var fo=b;function r(n,e,o,t,i,p,d,m,s){this[0]=O(n,0),this[1]=O(t,0),this[2]=O(d,0),this[3]=O(e,0),this[4]=O(i,0),this[5]=O(m,0),this[6]=O(o,0),this[7]=O(p,0),this[8]=O(s,0)}r.packedLength=9;r.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=O(o,0),e[o++]=n[0],e[o++]=n[1],e[o++]=n[2],e[o++]=n[3],e[o++]=n[4],e[o++]=n[5],e[o++]=n[6],e[o++]=n[7],e[o++]=n[8],e};r.unpack=function(n,e,o){return c.defined("array",n),e=O(e,0),u(o)||(o=new r),o[0]=n[e++],o[1]=n[e++],o[2]=n[e++],o[3]=n[e++],o[4]=n[e++],o[5]=n[e++],o[6]=n[e++],o[7]=n[e++],o[8]=n[e++],o};r.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*9;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 9 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)r.pack(n[i],e,i*9);return e};r.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,9),n.length%9!==0)throw new S("array length must be a multiple of 9.");let o=n.length;u(e)?e.length=o/9:e=new Array(o/9);for(let t=0;t<o;t+=9){let i=t/9;e[i]=r.unpack(n,t,e[i])}return e};r.clone=function(n,e){if(u(n))return u(e)?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e):new r(n[0],n[3],n[6],n[1],n[4],n[7],n[2],n[5],n[8])};r.fromArray=r.unpack;r.fromColumnMajorArray=function(n,e){return c.defined("values",n),r.clone(n,e)};r.fromRowMajorArray=function(n,e){return c.defined("values",n),u(e)?(e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],e):new r(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])};r.fromQuaternion=function(n,e){c.typeOf.object("quaternion",n);let o=n.x*n.x,t=n.x*n.y,i=n.x*n.z,p=n.x*n.w,d=n.y*n.y,m=n.y*n.z,s=n.y*n.w,h=n.z*n.z,j=n.z*n.w,z=n.w*n.w,M=o-d-h+z,q=2*(t-j),N=2*(i+s),l=2*(t+j),x=-o+d-h+z,U=2*(m-p),I=2*(i-s),P=2*(m+p),k=-o-d+h+z;return u(e)?(e[0]=M,e[1]=l,e[2]=I,e[3]=q,e[4]=x,e[5]=P,e[6]=N,e[7]=U,e[8]=k,e):new r(M,q,N,l,x,U,I,P,k)};r.fromHeadingPitchRoll=function(n,e){c.typeOf.object("headingPitchRoll",n);let o=Math.cos(-n.pitch),t=Math.cos(-n.heading),i=Math.cos(n.roll),p=Math.sin(-n.pitch),d=Math.sin(-n.heading),m=Math.sin(n.roll),s=o*t,h=-i*d+m*p*t,j=m*d+i*p*t,z=o*d,M=i*t+m*p*d,q=-m*t+i*p*d,N=-p,l=m*o,x=i*o;return u(e)?(e[0]=s,e[1]=z,e[2]=N,e[3]=h,e[4]=M,e[5]=l,e[6]=j,e[7]=q,e[8]=x,e):new r(s,h,j,z,M,q,N,l,x)};r.fromScale=function(n,e){return c.typeOf.object("scale",n),u(e)?(e[0]=n.x,e[1]=0,e[2]=0,e[3]=0,e[4]=n.y,e[5]=0,e[6]=0,e[7]=0,e[8]=n.z,e):new r(n.x,0,0,0,n.y,0,0,0,n.z)};r.fromUniformScale=function(n,e){return c.typeOf.number("scale",n),u(e)?(e[0]=n,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=n,e):new r(n,0,0,0,n,0,0,0,n)};r.fromCrossProduct=function(n,e){return c.typeOf.object("vector",n),u(e)?(e[0]=0,e[1]=n.z,e[2]=-n.y,e[3]=-n.z,e[4]=0,e[5]=n.x,e[6]=n.y,e[7]=-n.x,e[8]=0,e):new r(0,-n.z,n.y,n.z,0,-n.x,-n.y,n.x,0)};r.fromRotationX=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=o,e[5]=t,e[6]=0,e[7]=-t,e[8]=o,e):new r(1,0,0,0,o,-t,0,t,o)};r.fromRotationY=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=o,e[1]=0,e[2]=-t,e[3]=0,e[4]=1,e[5]=0,e[6]=t,e[7]=0,e[8]=o,e):new r(o,0,t,0,1,0,-t,0,o)};r.fromRotationZ=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=o,e[1]=t,e[2]=0,e[3]=-t,e[4]=o,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new r(o,-t,0,t,o,0,0,0,1)};r.toArray=function(n,e){return c.typeOf.object("matrix",n),u(e)?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e):[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8]]};r.getElementIndex=function(n,e){return c.typeOf.number.greaterThanOrEquals("row",e,0),c.typeOf.number.lessThanOrEquals("row",e,2),c.typeOf.number.greaterThanOrEquals("column",n,0),c.typeOf.number.lessThanOrEquals("column",n,2),n*3+e};r.getColumn=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("result",o);let t=e*3,i=n[t],p=n[t+1],d=n[t+2];return o.x=i,o.y=p,o.z=d,o};r.setColumn=function(n,e,o,t){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("cartesian",o),c.typeOf.object("result",t),t=r.clone(n,t);let i=e*3;return t[i]=o.x,t[i+1]=o.y,t[i+2]=o.z,t};r.getRow=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("result",o);let t=n[e],i=n[e+3],p=n[e+6];return o.x=t,o.y=i,o.z=p,o};r.setRow=function(n,e,o,t){return c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("cartesian",o),c.typeOf.object("result",t),t=r.clone(n,t),t[e]=o.x,t[e+3]=o.y,t[e+6]=o.z,t};var ue=new y;r.setScale=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("scale",e),c.typeOf.object("result",o);let t=r.getScale(n,ue),i=e.x/t.x,p=e.y/t.y,d=e.z/t.z;return o[0]=n[0]*i,o[1]=n[1]*i,o[2]=n[2]*i,o[3]=n[3]*p,o[4]=n[4]*p,o[5]=n[5]*p,o[6]=n[6]*d,o[7]=n[7]*d,o[8]=n[8]*d,o};var ae=new y;r.setUniformScale=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number("scale",e),c.typeOf.object("result",o);let t=r.getScale(n,ae),i=e/t.x,p=e/t.y,d=e/t.z;return o[0]=n[0]*i,o[1]=n[1]*i,o[2]=n[2]*i,o[3]=n[3]*p,o[4]=n[4]*p,o[5]=n[5]*p,o[6]=n[6]*d,o[7]=n[7]*d,o[8]=n[8]*d,o};var sn=new y;r.getScale=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e.x=y.magnitude(y.fromElements(n[0],n[1],n[2],sn)),e.y=y.magnitude(y.fromElements(n[3],n[4],n[5],sn)),e.z=y.magnitude(y.fromElements(n[6],n[7],n[8],sn)),e};var kn=new y;r.getMaximumScale=function(n){return r.getScale(n,kn),y.maximumComponent(kn)};var de=new y;r.setRotation=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("result",o);let t=r.getScale(n,de);return o[0]=e[0]*t.x,o[1]=e[1]*t.x,o[2]=e[2]*t.x,o[3]=e[3]*t.y,o[4]=e[4]*t.y,o[5]=e[5]*t.y,o[6]=e[6]*t.z,o[7]=e[7]*t.z,o[8]=e[8]*t.z,o};var ye=new y;r.getRotation=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=r.getScale(n,ye);return e[0]=n[0]/o.x,e[1]=n[1]/o.x,e[2]=n[2]/o.x,e[3]=n[3]/o.y,e[4]=n[4]/o.y,e[5]=n[5]/o.y,e[6]=n[6]/o.z,e[7]=n[7]/o.z,e[8]=n[8]/o.z,e};r.multiply=function(n,e,o){c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o);let t=n[0]*e[0]+n[3]*e[1]+n[6]*e[2],i=n[1]*e[0]+n[4]*e[1]+n[7]*e[2],p=n[2]*e[0]+n[5]*e[1]+n[8]*e[2],d=n[0]*e[3]+n[3]*e[4]+n[6]*e[5],m=n[1]*e[3]+n[4]*e[4]+n[7]*e[5],s=n[2]*e[3]+n[5]*e[4]+n[8]*e[5],h=n[0]*e[6]+n[3]*e[7]+n[6]*e[8],j=n[1]*e[6]+n[4]*e[7]+n[7]*e[8],z=n[2]*e[6]+n[5]*e[7]+n[8]*e[8];return o[0]=t,o[1]=i,o[2]=p,o[3]=d,o[4]=m,o[5]=s,o[6]=h,o[7]=j,o[8]=z,o};r.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o[0]=n[0]+e[0],o[1]=n[1]+e[1],o[2]=n[2]+e[2],o[3]=n[3]+e[3],o[4]=n[4]+e[4],o[5]=n[5]+e[5],o[6]=n[6]+e[6],o[7]=n[7]+e[7],o[8]=n[8]+e[8],o};r.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],o[3]=n[3]-e[3],o[4]=n[4]-e[4],o[5]=n[5]-e[5],o[6]=n[6]-e[6],o[7]=n[7]-e[7],o[8]=n[8]-e[8],o};r.multiplyByVector=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("cartesian",e),c.typeOf.object("result",o);let t=e.x,i=e.y,p=e.z,d=n[0]*t+n[3]*i+n[6]*p,m=n[1]*t+n[4]*i+n[7]*p,s=n[2]*t+n[5]*i+n[8]*p;return o.x=d,o.y=m,o.z=s,o};r.multiplyByScalar=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o[0]=n[0]*e,o[1]=n[1]*e,o[2]=n[2]*e,o[3]=n[3]*e,o[4]=n[4]*e,o[5]=n[5]*e,o[6]=n[6]*e,o[7]=n[7]*e,o[8]=n[8]*e,o};r.multiplyByScale=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.object("scale",e),c.typeOf.object("result",o),o[0]=n[0]*e.x,o[1]=n[1]*e.x,o[2]=n[2]*e.x,o[3]=n[3]*e.y,o[4]=n[4]*e.y,o[5]=n[5]*e.y,o[6]=n[6]*e.z,o[7]=n[7]*e.z,o[8]=n[8]*e.z,o};r.multiplyByUniformScale=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.number("scale",e),c.typeOf.object("result",o),o[0]=n[0]*e,o[1]=n[1]*e,o[2]=n[2]*e,o[3]=n[3]*e,o[4]=n[4]*e,o[5]=n[5]*e,o[6]=n[6]*e,o[7]=n[7]*e,o[8]=n[8]*e,o};r.negate=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e[0]=-n[0],e[1]=-n[1],e[2]=-n[2],e[3]=-n[3],e[4]=-n[4],e[5]=-n[5],e[6]=-n[6],e[7]=-n[7],e[8]=-n[8],e};r.transpose=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=n[0],t=n[3],i=n[6],p=n[1],d=n[4],m=n[7],s=n[2],h=n[5],j=n[8];return e[0]=o,e[1]=t,e[2]=i,e[3]=p,e[4]=d,e[5]=m,e[6]=s,e[7]=h,e[8]=j,e};function me(n){let e=0;for(let o=0;o<9;++o){let t=n[o];e+=t*t}return Math.sqrt(e)}var On=[1,0,0],bn=[2,2,1];function se(n){let e=0;for(let o=0;o<3;++o){let t=n[r.getElementIndex(bn[o],On[o])];e+=2*t*t}return Math.sqrt(e)}function Oe(n,e){let o=w.EPSILON15,t=0,i=1;for(let h=0;h<3;++h){let j=Math.abs(n[r.getElementIndex(bn[h],On[h])]);j>t&&(i=h,t=j)}let p=1,d=0,m=On[i],s=bn[i];if(Math.abs(n[r.getElementIndex(s,m)])>o){let h=n[r.getElementIndex(s,s)],j=n[r.getElementIndex(m,m)],z=n[r.getElementIndex(s,m)],M=(h-j)/2/z,q;M<0?q=-1/(-M+Math.sqrt(1+M*M)):q=1/(M+Math.sqrt(1+M*M)),p=1/Math.sqrt(1+q*q),d=q*p}return e=r.clone(r.IDENTITY,e),e[r.getElementIndex(m,m)]=e[r.getElementIndex(s,s)]=p,e[r.getElementIndex(s,m)]=d,e[r.getElementIndex(m,s)]=-d,e}var K=new r,Bn=new r;r.computeEigenDecomposition=function(n,e){c.typeOf.object("matrix",n);let o=w.EPSILON20,t=10,i=0,p=0;u(e)||(e={});let d=e.unitary=r.clone(r.IDENTITY,e.unitary),m=e.diagonal=r.clone(n,e.diagonal),s=o*me(m);for(;p<t&&se(m)>s;)Oe(m,K),r.transpose(K,Bn),r.multiply(m,K,m),r.multiply(Bn,m,m),r.multiply(d,K,d),++i>2&&(++p,i=0);return e};r.abs=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e[0]=Math.abs(n[0]),e[1]=Math.abs(n[1]),e[2]=Math.abs(n[2]),e[3]=Math.abs(n[3]),e[4]=Math.abs(n[4]),e[5]=Math.abs(n[5]),e[6]=Math.abs(n[6]),e[7]=Math.abs(n[7]),e[8]=Math.abs(n[8]),e};r.determinant=function(n){c.typeOf.object("matrix",n);let e=n[0],o=n[3],t=n[6],i=n[1],p=n[4],d=n[7],m=n[2],s=n[5],h=n[8];return e*(p*h-s*d)+i*(s*t-o*h)+m*(o*d-p*t)};r.inverse=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=n[0],t=n[1],i=n[2],p=n[3],d=n[4],m=n[5],s=n[6],h=n[7],j=n[8],z=r.determinant(n);if(Math.abs(z)<=w.EPSILON15)throw new S("matrix is not invertible");e[0]=d*j-h*m,e[1]=h*i-t*j,e[2]=t*m-d*i,e[3]=s*m-p*j,e[4]=o*j-s*i,e[5]=p*i-o*m,e[6]=p*h-s*d,e[7]=s*t-o*h,e[8]=o*d-p*t;let M=1/z;return r.multiplyByScalar(e,M,e)};var be=new r;r.inverseTranspose=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),r.inverse(r.transpose(n,be),e)};r.equals=function(n,e){return n===e||u(n)&&u(e)&&n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]&&n[3]===e[3]&&n[4]===e[4]&&n[5]===e[5]&&n[6]===e[6]&&n[7]===e[7]&&n[8]===e[8]};r.equalsEpsilon=function(n,e,o){return o=O(o,0),n===e||u(n)&&u(e)&&Math.abs(n[0]-e[0])<=o&&Math.abs(n[1]-e[1])<=o&&Math.abs(n[2]-e[2])<=o&&Math.abs(n[3]-e[3])<=o&&Math.abs(n[4]-e[4])<=o&&Math.abs(n[5]-e[5])<=o&&Math.abs(n[6]-e[6])<=o&&Math.abs(n[7]-e[7])<=o&&Math.abs(n[8]-e[8])<=o};r.IDENTITY=Object.freeze(new r(1,0,0,0,1,0,0,0,1));r.ZERO=Object.freeze(new r(0,0,0,0,0,0,0,0,0));r.COLUMN0ROW0=0;r.COLUMN0ROW1=1;r.COLUMN0ROW2=2;r.COLUMN1ROW0=3;r.COLUMN1ROW1=4;r.COLUMN1ROW2=5;r.COLUMN2ROW0=6;r.COLUMN2ROW1=7;r.COLUMN2ROW2=8;Object.defineProperties(r.prototype,{length:{get:function(){return r.packedLength}}});r.prototype.clone=function(n){return r.clone(this,n)};r.prototype.equals=function(n){return r.equals(this,n)};r.equalsArray=function(n,e,o){return n[0]===e[o]&&n[1]===e[o+1]&&n[2]===e[o+2]&&n[3]===e[o+3]&&n[4]===e[o+4]&&n[5]===e[o+5]&&n[6]===e[o+6]&&n[7]===e[o+7]&&n[8]===e[o+8]};r.prototype.equalsEpsilon=function(n,e){return r.equalsEpsilon(this,n,e)};r.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) (${this[2]}, ${this[5]}, ${this[8]})`};var Oo=r;var F,R={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},_={};Object.defineProperties(_,{element:{get:function(){if(_.supportsFullscreen())return document[R.fullscreenElement]}},changeEventName:{get:function(){if(_.supportsFullscreen())return R.fullscreenchange}},errorEventName:{get:function(){if(_.supportsFullscreen())return R.fullscreenerror}},enabled:{get:function(){if(_.supportsFullscreen())return document[R.fullscreenEnabled]}},fullscreen:{get:function(){if(_.supportsFullscreen())return _.element!==null}}});_.supportsFullscreen=function(){if(u(F))return F;F=!1;let n=document.body;if(typeof n.requestFullscreen=="function")return R.requestFullscreen="requestFullscreen",R.exitFullscreen="exitFullscreen",R.fullscreenEnabled="fullscreenEnabled",R.fullscreenElement="fullscreenElement",R.fullscreenchange="fullscreenchange",R.fullscreenerror="fullscreenerror",F=!0,F;let e=["webkit","moz","o","ms","khtml"],o;for(let t=0,i=e.length;t<i;++t){let p=e[t];o=`${p}RequestFullscreen`,typeof n[o]=="function"?(R.requestFullscreen=o,F=!0):(o=`${p}RequestFullScreen`,typeof n[o]=="function"&&(R.requestFullscreen=o,F=!0)),o=`${p}ExitFullscreen`,typeof document[o]=="function"?R.exitFullscreen=o:(o=`${p}CancelFullScreen`,typeof document[o]=="function"&&(R.exitFullscreen=o)),o=`${p}FullscreenEnabled`,document[o]!==void 0?R.fullscreenEnabled=o:(o=`${p}FullScreenEnabled`,document[o]!==void 0&&(R.fullscreenEnabled=o)),o=`${p}FullscreenElement`,document[o]!==void 0?R.fullscreenElement=o:(o=`${p}FullScreenElement`,document[o]!==void 0&&(R.fullscreenElement=o)),o=`${p}fullscreenchange`,document[`on${o}`]!==void 0&&(p==="ms"&&(o="MSFullscreenChange"),R.fullscreenchange=o),o=`${p}fullscreenerror`,document[`on${o}`]!==void 0&&(p==="ms"&&(o="MSFullscreenError"),R.fullscreenerror=o)}return F};_.requestFullscreen=function(n,e){_.supportsFullscreen()&&n[R.requestFullscreen]({vrDisplay:e})};_.exitFullscreen=function(){_.supportsFullscreen()&&document[R.exitFullscreen]()};_._names=R;var Un=_;var A;typeof navigator<"u"?A=navigator:A={};function B(n){let e=n.split(".");for(let o=0,t=e.length;o<t;++o)e[o]=parseInt(e[o],10);return e}var J,In;function zn(){if(!u(J)&&(J=!1,!fn())){let n=/ Chrome\/([\.0-9]+)/.exec(A.userAgent);n!==null&&(J=!0,In=B(n[1]))}return J}function he(){return zn()&&In}var nn,Pn;function Ln(){if(!u(nn)&&(nn=!1,!zn()&&!fn()&&/ Safari\/[\.0-9]+/.test(A.userAgent))){let n=/ Version\/([\.0-9]+)/.exec(A.userAgent);n!==null&&(nn=!0,Pn=B(n[1]))}return nn}function we(){return Ln()&&Pn}var en,gn;function Vn(){if(!u(en)){en=!1;let n=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(A.userAgent);n!==null&&(en=!0,gn=B(n[1]),gn.isNightly=!!n[2])}return en}function je(){return Vn()&&gn}var Z,Sn;function Wn(){if(!u(Z)){Z=!1;let n;A.appName==="Microsoft Internet Explorer"?(n=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(A.userAgent),n!==null&&(Z=!0,Sn=B(n[1]))):A.appName==="Netscape"&&(n=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(A.userAgent),n!==null&&(Z=!0,Sn=B(n[1])))}return Z}function ge(){return Wn()&&Sn}var on,vn;function fn(){if(!u(on)){on=!1;let n=/ Edg\/([\.0-9]+)/.exec(A.userAgent);n!==null&&(on=!0,vn=B(n[1]))}return on}function Se(){return fn()&&vn}var tn,Rn;function rn(){if(!u(tn)){tn=!1;let n=/Firefox\/([\.0-9]+)/.exec(A.userAgent);n!==null&&(tn=!0,Rn=B(n[1]))}return tn}var hn;function ze(){return u(hn)||(hn=/Windows/i.test(A.appVersion)),hn}var wn;function Re(){return u(wn)||(wn=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),wn}function Me(){return rn()&&Rn}var jn;function qe(){return u(jn)||(jn=!rn()&&typeof PointerEvent<"u"&&(!u(A.pointerEnabled)||A.pointerEnabled)),jn}var $n,cn;function Dn(){if(!u(cn)){let n=document.createElement("canvas");n.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let e=n.style.imageRendering;cn=u(e)&&e!=="",cn&&($n=e)}return cn}function Ee(){return Dn()?$n:void 0}function E(){if(!E.initialized)throw new S("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return E._result}E._promise=void 0;E._result=void 0;E.initialize=function(){return u(E._promise)||(E._promise=new Promise(n=>{let e=new Image;e.onload=function(){E._result=e.width>0&&e.height>0,n(E._result)},e.onerror=function(){E._result=!1,n(E._result)},e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),E._promise};Object.defineProperties(E,{initialized:{get:function(){return u(E._result)}}});var $=[];typeof ArrayBuffer<"u"&&($.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&$.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&$.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&$.push(BigInt64Array),typeof BigUint64Array<"u"&&$.push(BigUint64Array));var T={isChrome:zn,chromeVersion:he,isSafari:Ln,safariVersion:we,isWebkit:Vn,webkitVersion:je,isInternetExplorer:Wn,internetExplorerVersion:ge,isEdge:fn,edgeVersion:Se,isFirefox:rn,firefoxVersion:Me,isWindows:ze,isIPadOrIOS:Re,hardwareConcurrency:O(A.hardwareConcurrency,3),supportsPointerEvents:qe,supportsImageRenderingPixelated:Dn,supportsWebP:E,imageRenderingValue:Ee,typedArrayTypes:$};T.supportsBasis=function(n){return T.supportsWebAssembly()&&n.context.supportsBasis};T.supportsFullscreen=function(){return Un.supportsFullscreen()};T.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};T.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};T.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};T.supportsBigInt=function(){return typeof BigInt<"u"};T.supportsWebWorkers=function(){return typeof Worker<"u"};T.supportsWebAssembly=function(){return typeof WebAssembly<"u"};T.supportsWebgl2=function(n){return c.defined("scene",n),n.context.webgl2};T.supportsEsmWebWorkers=function(){return!rn()||parseInt(Rn)>=114};var Mo=T;export{y as a,D as b,mn as c,fo as d,Oo as e,Mo as f}; diff --git a/public/js/Cesium2/Workers/chunk-G75U3WZT.js b/public/js/Cesium2/Workers/chunk-RTY3VPG6.js similarity index 97% rename from public/js/Cesium2/Workers/chunk-G75U3WZT.js rename to public/js/Cesium2/Workers/chunk-RTY3VPG6.js index cb9515d66..7349443a7 100644 --- a/public/js/Cesium2/Workers/chunk-G75U3WZT.js +++ b/public/js/Cesium2/Workers/chunk-RTY3VPG6.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,5 +23,5 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{e as u}from"./chunk-3THTQ4QB.js";function f(t){this.name="DeveloperError",this.message=t;let e;try{throw new Error}catch(o){e=o.stack}this.stack=e}u(Object.create)&&(f.prototype=Object.create(Error.prototype),f.prototype.constructor=f);f.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return u(this.stack)&&(t+=` +import{e as u}from"./chunk-LRNH5AEO.js";function f(t){this.name="DeveloperError",this.message=t;let e;try{throw new Error}catch(o){e=o.stack}this.stack=e}u(Object.create)&&(f.prototype=Object.create(Error.prototype),f.prototype.constructor=f);f.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return u(this.stack)&&(t+=` ${this.stack.toString()}`),t};f.throwInstantiationError=function(){throw new f("This function defines an interface and should not be called directly.")};var r=f;var n={};n.typeOf={};function c(t){return`${t} is required, actual value was undefined`}function a(t,e,o){return`Expected ${o} to be typeof ${e}, actual typeof was ${t}`}n.defined=function(t,e){if(!u(e))throw new r(c(t))};n.typeOf.func=function(t,e){if(typeof e!="function")throw new r(a(typeof e,"function",t))};n.typeOf.string=function(t,e){if(typeof e!="string")throw new r(a(typeof e,"string",t))};n.typeOf.number=function(t,e){if(typeof e!="number")throw new r(a(typeof e,"number",t))};n.typeOf.number.lessThan=function(t,e,o){if(n.typeOf.number(t,e),e>=o)throw new r(`Expected ${t} to be less than ${o}, actual value was ${e}`)};n.typeOf.number.lessThanOrEquals=function(t,e,o){if(n.typeOf.number(t,e),e>o)throw new r(`Expected ${t} to be less than or equal to ${o}, actual value was ${e}`)};n.typeOf.number.greaterThan=function(t,e,o){if(n.typeOf.number(t,e),e<=o)throw new r(`Expected ${t} to be greater than ${o}, actual value was ${e}`)};n.typeOf.number.greaterThanOrEquals=function(t,e,o){if(n.typeOf.number(t,e),e<o)throw new r(`Expected ${t} to be greater than or equal to ${o}, actual value was ${e}`)};n.typeOf.object=function(t,e){if(typeof e!="object")throw new r(a(typeof e,"object",t))};n.typeOf.bool=function(t,e){if(typeof e!="boolean")throw new r(a(typeof e,"boolean",t))};n.typeOf.bigint=function(t,e){if(typeof e!="bigint")throw new r(a(typeof e,"bigint",t))};n.typeOf.number.equals=function(t,e,o,i){if(n.typeOf.number(t,o),n.typeOf.number(e,i),o!==i)throw new r(`${t} must be equal to ${e}, the actual values are ${o} and ${i}`)};var l=n;export{r as a,l as b}; diff --git a/public/js/Cesium2/Workers/chunk-RRZIPF5C.js b/public/js/Cesium2/Workers/chunk-SACP225T.js similarity index 90% rename from public/js/Cesium2/Workers/chunk-RRZIPF5C.js rename to public/js/Cesium2/Workers/chunk-SACP225T.js index a69372c9b..2fe84140d 100644 --- a/public/js/Cesium2/Workers/chunk-RRZIPF5C.js +++ b/public/js/Cesium2/Workers/chunk-SACP225T.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as l,b as d}from"./chunk-M3A6SPGI.js";import{a as t}from"./chunk-S4VBGY2U.js";import{a as s}from"./chunk-UCTPWOTZ.js";import{a as f,b as r}from"./chunk-G75U3WZT.js";import{e as m}from"./chunk-3THTQ4QB.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; +import{a as l,b as d}from"./chunk-7YEOLR2L.js";import{a as t}from"./chunk-RH3GFHG2.js";import{a as s}from"./chunk-FRWNWNYJ.js";import{a as f,b as r}from"./chunk-RTY3VPG6.js";import{e as m}from"./chunk-LRNH5AEO.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/public/js/Cesium2/Workers/chunk-ZFYLUAMF.js b/public/js/Cesium2/Workers/chunk-SN56D5AL.js similarity index 89% rename from public/js/Cesium2/Workers/chunk-ZFYLUAMF.js rename to public/js/Cesium2/Workers/chunk-SN56D5AL.js index 9eda402e6..8c0f05616 100644 --- a/public/js/Cesium2/Workers/chunk-ZFYLUAMF.js +++ b/public/js/Cesium2/Workers/chunk-SN56D5AL.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as Q}from"./chunk-OTRIIEF3.js";import{a as z}from"./chunk-5CC3QRYS.js";import{a as _}from"./chunk-6HIVPZ7K.js";import{a as K}from"./chunk-34ULWVZF.js";import{a as H}from"./chunk-24JYWT5N.js";import{b as J,c as W,d as P}from"./chunk-LH3SUUXG.js";import{d as j}from"./chunk-K2M3OJ7Z.js";import{a as L}from"./chunk-D5HNP2LB.js";import{a as b,c as k}from"./chunk-S4VBGY2U.js";import{a as Z}from"./chunk-UCTPWOTZ.js";import{a as x}from"./chunk-N3A5CZ2S.js";import{a as F}from"./chunk-G75U3WZT.js";import{e as g}from"./chunk-3THTQ4QB.js";var M=new k,ot=new b,nt=new b,it=new b,st=new b;function O(t){t=x(t,x.EMPTY_OBJECT);let n=t.length,e=t.topRadius,h=t.bottomRadius,o=x(t.vertexFormat,_.DEFAULT),r=x(t.slices,128);if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(r<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===z.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=x(e,0),_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=x(t._offsetAttribute,-1),n};var X=new _,C={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=x(n,0);let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],r=t[n++],p=t[n++],D=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=r,e._bottomRadius=p,e._slices=D,e._offsetAttribute=w===-1?void 0:w,e):(C.length=o,C.topRadius=r,C.bottomRadius=p,C.slices=D,C.offsetAttribute=w===-1?void 0:w,new O(C))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,r=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=r+r,D=r+p,w=p+p,E=Q.computePositions(n,e,h,r,!0),N=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,U=o.normal||o.tangent||o.bitangent;if(U){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<r;i++){let Y=i/r*Z.TWO_PI,tt=B*Math.cos(Y),et=B*Math.sin(Y);U&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<r;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<r;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*r-12,s=K.createTypedArray(w,$),a=0,v=0;for(i=0;i<r-1;i++)s[a++]=v,s[a++]=v+2,s[a++]=v+3,s[a++]=v,s[a++]=v+3,s[a++]=v+1,v+=2;for(s[a++]=p-2,s[a++]=0,s[a++]=1,s[a++]=p-2,s[a++]=1,s[a++]=p-1,i=1;i<r-1;i++)s[a++]=p+i+1,s[a++]=p+i,s[a++]=p;for(i=1;i<r-1;i++)s[a++]=D,s[a++]=D+i,s[a++]=D+i+1;let V=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(E,i*3,st);N[V++]=(f.x+T)/(2*T),N[V++]=(f.y+T)/(2*T)}}let S=new H;o.position&&(S.position=new P({componentDatatype:L.DOUBLE,componentsPerAttribute:3,values:E})),o.normal&&(S.normal=new P({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(S.tangent=new P({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(S.bitangent=new P({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(S.st=new P({componentDatatype:L.FLOAT,componentsPerAttribute:2,values:N})),M.x=n*.5,M.y=Math.max(h,e);let I=new j(b.ZERO,k.magnitude(M));if(g(t._offsetAttribute)){n=E.length;let T=t._offsetAttribute===z.NONE?0:1,f=new Uint8Array(n/3).fill(T);S.applyOffset=new P({componentDatatype:L.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:S,indices:s,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var G;O.getUnitCylinder=function(){return g(G)||(G=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),G};var yt=O;export{yt as a}; +import{a as Q}from"./chunk-QV3DAXWD.js";import{a as z}from"./chunk-N5SNKJ43.js";import{a as _}from"./chunk-6VK5R74O.js";import{a as K}from"./chunk-YFQNY2YN.js";import{a as H}from"./chunk-NT26NNVH.js";import{b as J,c as W,d as P}from"./chunk-NW2YE576.js";import{d as j}from"./chunk-2NIQ5ECB.js";import{a as L}from"./chunk-QHHYYTCM.js";import{a as b,c as k}from"./chunk-RH3GFHG2.js";import{a as Z}from"./chunk-FRWNWNYJ.js";import{a as x}from"./chunk-TA3RE4KQ.js";import{a as F}from"./chunk-RTY3VPG6.js";import{e as g}from"./chunk-LRNH5AEO.js";var M=new k,ot=new b,nt=new b,it=new b,st=new b;function O(t){t=x(t,x.EMPTY_OBJECT);let n=t.length,e=t.topRadius,h=t.bottomRadius,o=x(t.vertexFormat,_.DEFAULT),r=x(t.slices,128);if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(r<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===z.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=x(e,0),_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=x(t._offsetAttribute,-1),n};var X=new _,C={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=x(n,0);let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],r=t[n++],p=t[n++],D=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=r,e._bottomRadius=p,e._slices=D,e._offsetAttribute=w===-1?void 0:w,e):(C.length=o,C.topRadius=r,C.bottomRadius=p,C.slices=D,C.offsetAttribute=w===-1?void 0:w,new O(C))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,r=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=r+r,D=r+p,w=p+p,E=Q.computePositions(n,e,h,r,!0),N=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,U=o.normal||o.tangent||o.bitangent;if(U){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<r;i++){let Y=i/r*Z.TWO_PI,tt=B*Math.cos(Y),et=B*Math.sin(Y);U&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<r;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<r;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*r-12,s=K.createTypedArray(w,$),a=0,v=0;for(i=0;i<r-1;i++)s[a++]=v,s[a++]=v+2,s[a++]=v+3,s[a++]=v,s[a++]=v+3,s[a++]=v+1,v+=2;for(s[a++]=p-2,s[a++]=0,s[a++]=1,s[a++]=p-2,s[a++]=1,s[a++]=p-1,i=1;i<r-1;i++)s[a++]=p+i+1,s[a++]=p+i,s[a++]=p;for(i=1;i<r-1;i++)s[a++]=D,s[a++]=D+i,s[a++]=D+i+1;let V=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(E,i*3,st);N[V++]=(f.x+T)/(2*T),N[V++]=(f.y+T)/(2*T)}}let S=new H;o.position&&(S.position=new P({componentDatatype:L.DOUBLE,componentsPerAttribute:3,values:E})),o.normal&&(S.normal=new P({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(S.tangent=new P({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(S.bitangent=new P({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(S.st=new P({componentDatatype:L.FLOAT,componentsPerAttribute:2,values:N})),M.x=n*.5,M.y=Math.max(h,e);let I=new j(b.ZERO,k.magnitude(M));if(g(t._offsetAttribute)){n=E.length;let T=t._offsetAttribute===z.NONE?0:1,f=new Uint8Array(n/3).fill(T);S.applyOffset=new P({componentDatatype:L.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:S,indices:s,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var G;O.getUnitCylinder=function(){return g(G)||(G=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),G};var yt=O;export{yt as a}; diff --git a/public/js/Cesium2/Workers/chunk-N5HLZFHR.js b/public/js/Cesium2/Workers/chunk-SXC2BH5N.js similarity index 90% rename from public/js/Cesium2/Workers/chunk-N5HLZFHR.js rename to public/js/Cesium2/Workers/chunk-SXC2BH5N.js index 4c1b1abe7..f4108444d 100644 --- a/public/js/Cesium2/Workers/chunk-N5HLZFHR.js +++ b/public/js/Cesium2/Workers/chunk-SXC2BH5N.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as W}from"./chunk-5CC3QRYS.js";import{a as Z}from"./chunk-34ULWVZF.js";import{a as X}from"./chunk-24JYWT5N.js";import{b as K,c as Q,d as V}from"./chunk-LH3SUUXG.js";import{d as H}from"./chunk-K2M3OJ7Z.js";import{a as U}from"./chunk-D5HNP2LB.js";import{a as r,d as J}from"./chunk-S4VBGY2U.js";import{a as B}from"./chunk-UCTPWOTZ.js";import{a as u}from"./chunk-N3A5CZ2S.js";import{a as P}from"./chunk-G75U3WZT.js";import{e as T}from"./chunk-3THTQ4QB.js";var ii=new r(1,1,1),S=Math.cos,q=Math.sin;function x(t){t=u(t,u.EMPTY_OBJECT);let o=u(t.radii,ii),n=u(t.innerRadii,o),k=u(t.minimumClock,0),w=u(t.maximumClock,B.TWO_PI),d=u(t.minimumCone,0),l=u(t.maximumCone,B.PI),s=Math.round(u(t.stackPartitions,10)),A=Math.round(u(t.slicePartitions,8)),m=Math.round(u(t.subdivisions,128));if(s<1)throw new P("options.stackPartitions cannot be less than 1");if(A<0)throw new P("options.slicePartitions cannot be less than 0");if(m<0)throw new P("options.subdivisions must be greater than or equal to zero.");if(T(t.offsetAttribute)&&t.offsetAttribute===W.TOP)throw new P("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=k,this._maximumClock=w,this._minimumCone=d,this._maximumCone=l,this._stackPartitions=s,this._slicePartitions=A,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}x.packedLength=2*r.packedLength+8;x.pack=function(t,o,n){if(!T(t))throw new P("value is required");if(!T(o))throw new P("array is required");return n=u(n,0),r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=u(t._offsetAttribute,-1),o};var $=new r,G=new r,b={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};x.unpack=function(t,o,n){if(!T(t))throw new P("array is required");o=u(o,0);let k=r.unpack(t,o,$);o+=r.packedLength;let w=r.unpack(t,o,G);o+=r.packedLength;let d=t[o++],l=t[o++],s=t[o++],A=t[o++],m=t[o++],f=t[o++],E=t[o++],h=t[o];return T(n)?(n._radii=r.clone(k,n._radii),n._innerRadii=r.clone(w,n._innerRadii),n._minimumClock=d,n._maximumClock=l,n._minimumCone=s,n._maximumCone=A,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=E,n._offsetAttribute=h===-1?void 0:h,n):(b.minimumClock=d,b.maximumClock=l,b.minimumCone=s,b.maximumCone=A,b.stackPartitions=m,b.slicePartitions=f,b.subdivisions=E,b.offsetAttribute=h===-1?void 0:h,new x(b))};x.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let k=t._minimumClock,w=t._maximumClock,d=t._minimumCone,l=t._maximumCone,s=t._subdivisions,A=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(w-k)/B.TWO_PI),f=Math.round(f*Math.abs(l-d)/B.PI),m<2&&(m=2),f<2&&(f=2);let E=0,h=1,L=n.x!==o.x||n.y!==o.y||n.z!==o.z,Y=!1,j=!1;L&&(h=2,d>0&&(Y=!0,E+=m),l<Math.PI&&(j=!0,E+=m));let y=s*h*(f+m),a=new Float64Array(y*3),g=2*(y+E-(m+f)*h),_=Z.createTypedArray(y,g),i,e,v,z,c=0,C=new Array(f),O=new Array(f);for(i=0;i<f;i++)z=d+i*(l-d)/(f-1),C[i]=q(z),O[i]=S(z);let M=new Array(s),R=new Array(s);for(i=0;i<s;i++)v=k+i*(w-k)/(s-1),M[i]=q(v),R[i]=S(v);for(i=0;i<f;i++)for(e=0;e<s;e++)a[c++]=o.x*C[i]*R[e],a[c++]=o.y*C[i]*M[e],a[c++]=o.z*O[i];if(L)for(i=0;i<f;i++)for(e=0;e<s;e++)a[c++]=n.x*C[i]*R[e],a[c++]=n.y*C[i]*M[e],a[c++]=n.z*O[i];for(C.length=s,O.length=s,i=0;i<s;i++)z=d+i*(l-d)/(s-1),C[i]=q(z),O[i]=S(z);for(M.length=m,R.length=m,i=0;i<m;i++)v=k+i*(w-k)/(m-1),M[i]=q(v),R[i]=S(v);for(i=0;i<s;i++)for(e=0;e<m;e++)a[c++]=o.x*C[i]*R[e],a[c++]=o.y*C[i]*M[e],a[c++]=o.z*O[i];if(L)for(i=0;i<s;i++)for(e=0;e<m;e++)a[c++]=n.x*C[i]*R[e],a[c++]=n.y*C[i]*M[e],a[c++]=n.z*O[i];for(c=0,i=0;i<f*h;i++){let p=i*s;for(e=0;e<s-1;e++)_[c++]=p+e,_[c++]=p+e+1}let D=f*s*h;for(i=0;i<m;i++)for(e=0;e<s-1;e++)_[c++]=D+i+e*m,_[c++]=D+i+(e+1)*m;if(L)for(D=f*s*h+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)_[c++]=D+i+e*m,_[c++]=D+i+(e+1)*m;if(L){let p=f*s*h,N=p+s*m;if(Y)for(i=0;i<m;i++)_[c++]=p+i,_[c++]=N+i;if(j)for(p+=s*m-m,N+=s*m-m,i=0;i<m;i++)_[c++]=p+i,_[c++]=N+i}let F=new X({position:new V({componentDatatype:U.DOUBLE,componentsPerAttribute:3,values:a})});if(T(t._offsetAttribute)){let p=a.length,N=t._offsetAttribute===W.NONE?0:1,I=new Uint8Array(p/3).fill(N);F.applyOffset=new V({componentDatatype:U.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:F,indices:_,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(A),offsetAttribute:t._offsetAttribute})};var Ci=x;export{Ci as a}; +import{a as W}from"./chunk-N5SNKJ43.js";import{a as Z}from"./chunk-YFQNY2YN.js";import{a as X}from"./chunk-NT26NNVH.js";import{b as K,c as Q,d as V}from"./chunk-NW2YE576.js";import{d as H}from"./chunk-2NIQ5ECB.js";import{a as U}from"./chunk-QHHYYTCM.js";import{a as r,d as J}from"./chunk-RH3GFHG2.js";import{a as B}from"./chunk-FRWNWNYJ.js";import{a as u}from"./chunk-TA3RE4KQ.js";import{a as P}from"./chunk-RTY3VPG6.js";import{e as T}from"./chunk-LRNH5AEO.js";var ii=new r(1,1,1),S=Math.cos,q=Math.sin;function x(t){t=u(t,u.EMPTY_OBJECT);let o=u(t.radii,ii),n=u(t.innerRadii,o),k=u(t.minimumClock,0),w=u(t.maximumClock,B.TWO_PI),d=u(t.minimumCone,0),l=u(t.maximumCone,B.PI),s=Math.round(u(t.stackPartitions,10)),A=Math.round(u(t.slicePartitions,8)),m=Math.round(u(t.subdivisions,128));if(s<1)throw new P("options.stackPartitions cannot be less than 1");if(A<0)throw new P("options.slicePartitions cannot be less than 0");if(m<0)throw new P("options.subdivisions must be greater than or equal to zero.");if(T(t.offsetAttribute)&&t.offsetAttribute===W.TOP)throw new P("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=k,this._maximumClock=w,this._minimumCone=d,this._maximumCone=l,this._stackPartitions=s,this._slicePartitions=A,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}x.packedLength=2*r.packedLength+8;x.pack=function(t,o,n){if(!T(t))throw new P("value is required");if(!T(o))throw new P("array is required");return n=u(n,0),r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=u(t._offsetAttribute,-1),o};var $=new r,G=new r,b={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};x.unpack=function(t,o,n){if(!T(t))throw new P("array is required");o=u(o,0);let k=r.unpack(t,o,$);o+=r.packedLength;let w=r.unpack(t,o,G);o+=r.packedLength;let d=t[o++],l=t[o++],s=t[o++],A=t[o++],m=t[o++],f=t[o++],E=t[o++],h=t[o];return T(n)?(n._radii=r.clone(k,n._radii),n._innerRadii=r.clone(w,n._innerRadii),n._minimumClock=d,n._maximumClock=l,n._minimumCone=s,n._maximumCone=A,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=E,n._offsetAttribute=h===-1?void 0:h,n):(b.minimumClock=d,b.maximumClock=l,b.minimumCone=s,b.maximumCone=A,b.stackPartitions=m,b.slicePartitions=f,b.subdivisions=E,b.offsetAttribute=h===-1?void 0:h,new x(b))};x.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let k=t._minimumClock,w=t._maximumClock,d=t._minimumCone,l=t._maximumCone,s=t._subdivisions,A=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(w-k)/B.TWO_PI),f=Math.round(f*Math.abs(l-d)/B.PI),m<2&&(m=2),f<2&&(f=2);let E=0,h=1,L=n.x!==o.x||n.y!==o.y||n.z!==o.z,Y=!1,j=!1;L&&(h=2,d>0&&(Y=!0,E+=m),l<Math.PI&&(j=!0,E+=m));let y=s*h*(f+m),a=new Float64Array(y*3),g=2*(y+E-(m+f)*h),_=Z.createTypedArray(y,g),i,e,v,z,c=0,C=new Array(f),O=new Array(f);for(i=0;i<f;i++)z=d+i*(l-d)/(f-1),C[i]=q(z),O[i]=S(z);let M=new Array(s),R=new Array(s);for(i=0;i<s;i++)v=k+i*(w-k)/(s-1),M[i]=q(v),R[i]=S(v);for(i=0;i<f;i++)for(e=0;e<s;e++)a[c++]=o.x*C[i]*R[e],a[c++]=o.y*C[i]*M[e],a[c++]=o.z*O[i];if(L)for(i=0;i<f;i++)for(e=0;e<s;e++)a[c++]=n.x*C[i]*R[e],a[c++]=n.y*C[i]*M[e],a[c++]=n.z*O[i];for(C.length=s,O.length=s,i=0;i<s;i++)z=d+i*(l-d)/(s-1),C[i]=q(z),O[i]=S(z);for(M.length=m,R.length=m,i=0;i<m;i++)v=k+i*(w-k)/(m-1),M[i]=q(v),R[i]=S(v);for(i=0;i<s;i++)for(e=0;e<m;e++)a[c++]=o.x*C[i]*R[e],a[c++]=o.y*C[i]*M[e],a[c++]=o.z*O[i];if(L)for(i=0;i<s;i++)for(e=0;e<m;e++)a[c++]=n.x*C[i]*R[e],a[c++]=n.y*C[i]*M[e],a[c++]=n.z*O[i];for(c=0,i=0;i<f*h;i++){let p=i*s;for(e=0;e<s-1;e++)_[c++]=p+e,_[c++]=p+e+1}let D=f*s*h;for(i=0;i<m;i++)for(e=0;e<s-1;e++)_[c++]=D+i+e*m,_[c++]=D+i+(e+1)*m;if(L)for(D=f*s*h+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)_[c++]=D+i+e*m,_[c++]=D+i+(e+1)*m;if(L){let p=f*s*h,N=p+s*m;if(Y)for(i=0;i<m;i++)_[c++]=p+i,_[c++]=N+i;if(j)for(p+=s*m-m,N+=s*m-m,i=0;i<m;i++)_[c++]=p+i,_[c++]=N+i}let F=new X({position:new V({componentDatatype:U.DOUBLE,componentsPerAttribute:3,values:a})});if(T(t._offsetAttribute)){let p=a.length,N=t._offsetAttribute===W.NONE?0:1,I=new Uint8Array(p/3).fill(N);F.applyOffset=new V({componentDatatype:U.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:F,indices:_,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(A),offsetAttribute:t._offsetAttribute})};var Ci=x;export{Ci as a}; diff --git a/public/js/Cesium2/Workers/chunk-HQXG4R4L.js b/public/js/Cesium2/Workers/chunk-T4KTDR3V.js similarity index 92% rename from public/js/Cesium2/Workers/chunk-HQXG4R4L.js rename to public/js/Cesium2/Workers/chunk-T4KTDR3V.js index 62ef47dc7..a7c861159 100644 --- a/public/js/Cesium2/Workers/chunk-HQXG4R4L.js +++ b/public/js/Cesium2/Workers/chunk-T4KTDR3V.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as wt}from"./chunk-5CC3QRYS.js";import{a as k}from"./chunk-6HIVPZ7K.js";import{a as kt}from"./chunk-34ULWVZF.js";import{a as Ct}from"./chunk-24JYWT5N.js";import{b as dt,c as _t,d as R}from"./chunk-LH3SUUXG.js";import{d as ht}from"./chunk-K2M3OJ7Z.js";import{a as N}from"./chunk-D5HNP2LB.js";import{a as s,c as pt,d as ot}from"./chunk-S4VBGY2U.js";import{a as M}from"./chunk-UCTPWOTZ.js";import{a as p}from"./chunk-N3A5CZ2S.js";import{a as z}from"./chunk-G75U3WZT.js";import{e as E}from"./chunk-3THTQ4QB.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function O(n){n=p(n,p.EMPTY_OBJECT);let m=p(n.radii,Rt),i=p(n.innerRadii,m),P=p(n.minimumClock,0),T=p(n.maximumClock,M.TWO_PI),A=p(n.minimumCone,0),b=p(n.maximumCone,M.PI),a=Math.round(p(n.stackPartitions,64)),u=Math.round(p(n.slicePartitions,64)),h=p(n.vertexFormat,k.DEFAULT);if(u<3)throw new z("options.slicePartitions cannot be less than three.");if(a<3)throw new z("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=P,this._maximumClock=T,this._minimumCone=A,this._maximumCone=b,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=k.clone(h),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}O.packedLength=2*s.packedLength+k.packedLength+7;O.pack=function(n,m,i){if(!E(n))throw new z("value is required");if(!E(m))throw new z("array is required");return i=p(i,0),s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,k.pack(n._vertexFormat,m,i),i+=k.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=p(n._offsetAttribute,-1),m};var bt=new s,xt=new s,Ot=new k,y={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};O.unpack=function(n,m,i){if(!E(n))throw new z("array is required");m=p(m,0);let P=s.unpack(n,m,bt);m+=s.packedLength;let T=s.unpack(n,m,xt);m+=s.packedLength;let A=k.unpack(n,m,Ot);m+=k.packedLength;let b=n[m++],a=n[m++],u=n[m++],h=n[m++],t=n[m++],o=n[m++],e=n[m];return E(i)?(i._radii=s.clone(P,i._radii),i._innerRadii=s.clone(T,i._innerRadii),i._vertexFormat=k.clone(A,i._vertexFormat),i._minimumClock=b,i._maximumClock=a,i._minimumCone=u,i._maximumCone=h,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(y.minimumClock=b,y.maximumClock=a,y.minimumCone=u,y.maximumCone=h,y.stackPartitions=t,y.slicePartitions=o,y.offsetAttribute=e===-1?void 0:e,new O(y))};O.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let P=n._minimumClock,T=n._maximumClock,A=n._minimumCone,b=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,h=n._stackPartitions+1;u=Math.round(u*Math.abs(T-P)/M.TWO_PI),h=Math.round(h*Math.abs(b-A)/M.PI),u<2&&(u=2),h<2&&(h=2);let t,o,e=0,D=[A],S=[P];for(t=0;t<h;t++)D.push(A+t*(b-A)/(h-1));for(D.push(b),o=0;o<u;o++)S.push(P+o*(T-P)/(u-1));S.push(T);let f=D.length,c=S.length,U=0,B=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,J=!1,rt=!1,ct=!1;q&&(B=2,A>0&&(J=!0,U+=u-1),b<Math.PI&&(rt=!0,U+=u-1),(T-P)%M.TWO_PI?(ct=!0,U+=(h-1)*2+1):U+=1);let w=c*f*B,x=new Float64Array(w*3),X=new Array(w).fill(!1),st=new Array(w).fill(!1),at=u*h*B,Tt=6*(at+U+1-(u+h)*B),r=kt.createTypedArray(at,Tt),Y=a.normal?new Float32Array(w*3):void 0,j=a.tangent?new Float32Array(w*3):void 0,H=a.bitangent?new Float32Array(w*3):void 0,Z=a.st?new Float32Array(w*2):void 0,V=new Array(f),G=new Array(f);for(t=0;t<f;t++)V[t]=At(D[t]),G[t]=Pt(D[t]);let K=new Array(c),Q=new Array(c);for(o=0;o<c;o++)Q[o]=Pt(S[o]),K[o]=At(S[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)x[e++]=m.x*V[t]*Q[o],x[e++]=m.y*V[t]*K[o],x[e++]=m.z*G[t];let $=w/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)x[e++]=i.x*V[t]*Q[o],x[e++]=i.y*V[t]*K[o],x[e++]=i.z*G[t],X[$]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(st[$]=!0),$++;e=0;let F,L;for(t=1;t<f-2;t++)for(F=t*c,L=(t+1)*c,o=1;o<c-2;o++)r[e++]=L+o,r[e++]=L+o+1,r[e++]=F+o+1,r[e++]=L+o,r[e++]=F+o+1,r[e++]=F+o;if(q){let g=f*c;for(t=1;t<f-2;t++)for(F=g+t*c,L=g+(t+1)*c,o=1;o<c-2;o++)r[e++]=L+o,r[e++]=F+o,r[e++]=F+o+1,r[e++]=L+o,r[e++]=F+o+1,r[e++]=L+o+1}let d,l;if(q){if(J)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(rt)for(d=f*c-c,l=f*c*B-c,t=1;t<c-2;t++)r[e++]=d+t+1,r[e++]=d+t,r[e++]=l+t,r[e++]=d+t+1,r[e++]=l+t,r[e++]=l+t+1}if(ct){for(t=1;t<f-2;t++)l=c*f+c*t,d=c*t,r[e++]=l,r[e++]=d+c,r[e++]=d,r[e++]=l,r[e++]=l+c,r[e++]=d+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,d=c*(t+1)-1,r[e++]=d+c,r[e++]=l,r[e++]=d,r[e++]=d+c,r[e++]=l+c,r[e++]=l}let v=new Ct;a.position&&(v.position=new R({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:x}));let ft=0,I=0,tt=0,nt=0,Ft=w/2,ut,lt=ot.fromCartesian3(m),Lt=ot.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<w;t++){ut=X[t]?Lt:lt;let g=s.fromArray(x,t*3,yt),C=ut.geodeticSurfaceNormal(g,vt);if(st[t]&&s.negate(C,C),a.st){let _=pt.negate(C,Nt);Z[ft++]=Math.atan2(_.y,_.x)/M.TWO_PI+.5,Z[ft++]=Math.asin(C.z)/Math.PI+.5}if(a.normal&&(Y[I++]=C.x,Y[I++]=C.y,Y[I++]=C.z),a.tangent||a.bitangent){let _=Et,et=0,it;if(X[t]&&(et=Ft),!J&&t>=et&&t<et+c*2?it=s.UNIT_X:it=s.UNIT_Z,s.cross(it,C,_),s.normalize(_,_),a.tangent&&(j[tt++]=_.x,j[tt++]=_.y,j[tt++]=_.z),a.bitangent){let W=s.cross(C,_,Mt);s.normalize(W,W),H[nt++]=W.x,H[nt++]=W.y,H[nt++]=W.z}}}a.st&&(v.st=new R({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:Z})),a.normal&&(v.normal=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:Y})),a.tangent&&(v.tangent=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:j})),a.bitangent&&(v.bitangent=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:H}))}if(E(n._offsetAttribute)){let g=x.length,C=n._offsetAttribute===wt.NONE?0:1,_=new Uint8Array(g/3).fill(C);v.applyOffset=new R({componentDatatype:N.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}return new _t({attributes:v,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(lt),offsetAttribute:n._offsetAttribute})};var mt;O.getUnitEllipsoid=function(){return E(mt)||(mt=O.createGeometry(new O({radii:new s(1,1,1),vertexFormat:k.POSITION_ONLY}))),mt};var Kt=O;export{Kt as a}; +import{a as wt}from"./chunk-N5SNKJ43.js";import{a as k}from"./chunk-6VK5R74O.js";import{a as kt}from"./chunk-YFQNY2YN.js";import{a as Ct}from"./chunk-NT26NNVH.js";import{b as dt,c as _t,d as R}from"./chunk-NW2YE576.js";import{d as ht}from"./chunk-2NIQ5ECB.js";import{a as N}from"./chunk-QHHYYTCM.js";import{a as s,c as pt,d as ot}from"./chunk-RH3GFHG2.js";import{a as M}from"./chunk-FRWNWNYJ.js";import{a as p}from"./chunk-TA3RE4KQ.js";import{a as z}from"./chunk-RTY3VPG6.js";import{e as E}from"./chunk-LRNH5AEO.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function O(n){n=p(n,p.EMPTY_OBJECT);let m=p(n.radii,Rt),i=p(n.innerRadii,m),P=p(n.minimumClock,0),T=p(n.maximumClock,M.TWO_PI),A=p(n.minimumCone,0),b=p(n.maximumCone,M.PI),a=Math.round(p(n.stackPartitions,64)),u=Math.round(p(n.slicePartitions,64)),h=p(n.vertexFormat,k.DEFAULT);if(u<3)throw new z("options.slicePartitions cannot be less than three.");if(a<3)throw new z("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=P,this._maximumClock=T,this._minimumCone=A,this._maximumCone=b,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=k.clone(h),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}O.packedLength=2*s.packedLength+k.packedLength+7;O.pack=function(n,m,i){if(!E(n))throw new z("value is required");if(!E(m))throw new z("array is required");return i=p(i,0),s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,k.pack(n._vertexFormat,m,i),i+=k.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=p(n._offsetAttribute,-1),m};var bt=new s,xt=new s,Ot=new k,y={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};O.unpack=function(n,m,i){if(!E(n))throw new z("array is required");m=p(m,0);let P=s.unpack(n,m,bt);m+=s.packedLength;let T=s.unpack(n,m,xt);m+=s.packedLength;let A=k.unpack(n,m,Ot);m+=k.packedLength;let b=n[m++],a=n[m++],u=n[m++],h=n[m++],t=n[m++],o=n[m++],e=n[m];return E(i)?(i._radii=s.clone(P,i._radii),i._innerRadii=s.clone(T,i._innerRadii),i._vertexFormat=k.clone(A,i._vertexFormat),i._minimumClock=b,i._maximumClock=a,i._minimumCone=u,i._maximumCone=h,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(y.minimumClock=b,y.maximumClock=a,y.minimumCone=u,y.maximumCone=h,y.stackPartitions=t,y.slicePartitions=o,y.offsetAttribute=e===-1?void 0:e,new O(y))};O.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let P=n._minimumClock,T=n._maximumClock,A=n._minimumCone,b=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,h=n._stackPartitions+1;u=Math.round(u*Math.abs(T-P)/M.TWO_PI),h=Math.round(h*Math.abs(b-A)/M.PI),u<2&&(u=2),h<2&&(h=2);let t,o,e=0,D=[A],S=[P];for(t=0;t<h;t++)D.push(A+t*(b-A)/(h-1));for(D.push(b),o=0;o<u;o++)S.push(P+o*(T-P)/(u-1));S.push(T);let f=D.length,c=S.length,U=0,B=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,J=!1,rt=!1,ct=!1;q&&(B=2,A>0&&(J=!0,U+=u-1),b<Math.PI&&(rt=!0,U+=u-1),(T-P)%M.TWO_PI?(ct=!0,U+=(h-1)*2+1):U+=1);let w=c*f*B,x=new Float64Array(w*3),X=new Array(w).fill(!1),st=new Array(w).fill(!1),at=u*h*B,Tt=6*(at+U+1-(u+h)*B),r=kt.createTypedArray(at,Tt),Y=a.normal?new Float32Array(w*3):void 0,j=a.tangent?new Float32Array(w*3):void 0,H=a.bitangent?new Float32Array(w*3):void 0,Z=a.st?new Float32Array(w*2):void 0,V=new Array(f),G=new Array(f);for(t=0;t<f;t++)V[t]=At(D[t]),G[t]=Pt(D[t]);let K=new Array(c),Q=new Array(c);for(o=0;o<c;o++)Q[o]=Pt(S[o]),K[o]=At(S[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)x[e++]=m.x*V[t]*Q[o],x[e++]=m.y*V[t]*K[o],x[e++]=m.z*G[t];let $=w/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)x[e++]=i.x*V[t]*Q[o],x[e++]=i.y*V[t]*K[o],x[e++]=i.z*G[t],X[$]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(st[$]=!0),$++;e=0;let F,L;for(t=1;t<f-2;t++)for(F=t*c,L=(t+1)*c,o=1;o<c-2;o++)r[e++]=L+o,r[e++]=L+o+1,r[e++]=F+o+1,r[e++]=L+o,r[e++]=F+o+1,r[e++]=F+o;if(q){let g=f*c;for(t=1;t<f-2;t++)for(F=g+t*c,L=g+(t+1)*c,o=1;o<c-2;o++)r[e++]=L+o,r[e++]=F+o,r[e++]=F+o+1,r[e++]=L+o,r[e++]=F+o+1,r[e++]=L+o+1}let d,l;if(q){if(J)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(rt)for(d=f*c-c,l=f*c*B-c,t=1;t<c-2;t++)r[e++]=d+t+1,r[e++]=d+t,r[e++]=l+t,r[e++]=d+t+1,r[e++]=l+t,r[e++]=l+t+1}if(ct){for(t=1;t<f-2;t++)l=c*f+c*t,d=c*t,r[e++]=l,r[e++]=d+c,r[e++]=d,r[e++]=l,r[e++]=l+c,r[e++]=d+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,d=c*(t+1)-1,r[e++]=d+c,r[e++]=l,r[e++]=d,r[e++]=d+c,r[e++]=l+c,r[e++]=l}let v=new Ct;a.position&&(v.position=new R({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:x}));let ft=0,I=0,tt=0,nt=0,Ft=w/2,ut,lt=ot.fromCartesian3(m),Lt=ot.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<w;t++){ut=X[t]?Lt:lt;let g=s.fromArray(x,t*3,yt),C=ut.geodeticSurfaceNormal(g,vt);if(st[t]&&s.negate(C,C),a.st){let _=pt.negate(C,Nt);Z[ft++]=Math.atan2(_.y,_.x)/M.TWO_PI+.5,Z[ft++]=Math.asin(C.z)/Math.PI+.5}if(a.normal&&(Y[I++]=C.x,Y[I++]=C.y,Y[I++]=C.z),a.tangent||a.bitangent){let _=Et,et=0,it;if(X[t]&&(et=Ft),!J&&t>=et&&t<et+c*2?it=s.UNIT_X:it=s.UNIT_Z,s.cross(it,C,_),s.normalize(_,_),a.tangent&&(j[tt++]=_.x,j[tt++]=_.y,j[tt++]=_.z),a.bitangent){let W=s.cross(C,_,Mt);s.normalize(W,W),H[nt++]=W.x,H[nt++]=W.y,H[nt++]=W.z}}}a.st&&(v.st=new R({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:Z})),a.normal&&(v.normal=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:Y})),a.tangent&&(v.tangent=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:j})),a.bitangent&&(v.bitangent=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:H}))}if(E(n._offsetAttribute)){let g=x.length,C=n._offsetAttribute===wt.NONE?0:1,_=new Uint8Array(g/3).fill(C);v.applyOffset=new R({componentDatatype:N.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}return new _t({attributes:v,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(lt),offsetAttribute:n._offsetAttribute})};var mt;O.getUnitEllipsoid=function(){return E(mt)||(mt=O.createGeometry(new O({radii:new s(1,1,1),vertexFormat:k.POSITION_ONLY}))),mt};var Kt=O;export{Kt as a}; diff --git a/public/js/Cesium2/Workers/chunk-N3A5CZ2S.js b/public/js/Cesium2/Workers/chunk-TA3RE4KQ.js similarity index 98% rename from public/js/Cesium2/Workers/chunk-N3A5CZ2S.js rename to public/js/Cesium2/Workers/chunk-TA3RE4KQ.js index 0c9db7a10..e65f59b62 100644 --- a/public/js/Cesium2/Workers/chunk-N3A5CZ2S.js +++ b/public/js/Cesium2/Workers/chunk-TA3RE4KQ.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * diff --git a/public/js/Cesium2/Workers/chunk-R62IKKEC.js b/public/js/Cesium2/Workers/chunk-UAWOHN7R.js similarity index 93% rename from public/js/Cesium2/Workers/chunk-R62IKKEC.js rename to public/js/Cesium2/Workers/chunk-UAWOHN7R.js index 7f2a7578f..80d08d2f2 100644 --- a/public/js/Cesium2/Workers/chunk-R62IKKEC.js +++ b/public/js/Cesium2/Workers/chunk-UAWOHN7R.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,5 +23,5 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{e}from"./chunk-3THTQ4QB.js";function t(r){this.name="RuntimeError",this.message=r;let o;try{throw new Error}catch(s){o=s.stack}this.stack=o}e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t);t.prototype.toString=function(){let r=`${this.name}: ${this.message}`;return e(this.stack)&&(r+=` +import{e}from"./chunk-LRNH5AEO.js";function t(r){this.name="RuntimeError",this.message=r;let o;try{throw new Error}catch(s){o=s.stack}this.stack=o}e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t);t.prototype.toString=function(){let r=`${this.name}: ${this.message}`;return e(this.stack)&&(r+=` ${this.stack.toString()}`),r};var c=t;export{c as a}; diff --git a/public/js/Cesium2/Workers/chunk-54PMPXZ4.js b/public/js/Cesium2/Workers/chunk-UKWFHLUK.js similarity index 99% rename from public/js/Cesium2/Workers/chunk-54PMPXZ4.js rename to public/js/Cesium2/Workers/chunk-UKWFHLUK.js index 938e025c9..7c3268d28 100644 --- a/public/js/Cesium2/Workers/chunk-54PMPXZ4.js +++ b/public/js/Cesium2/Workers/chunk-UKWFHLUK.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * diff --git a/public/js/Cesium2/Workers/chunk-JR7WFPVR.js b/public/js/Cesium2/Workers/chunk-URBLFZDC.js similarity index 99% rename from public/js/Cesium2/Workers/chunk-JR7WFPVR.js rename to public/js/Cesium2/Workers/chunk-URBLFZDC.js index 3cf4e3522..977d8125d 100644 --- a/public/js/Cesium2/Workers/chunk-JR7WFPVR.js +++ b/public/js/Cesium2/Workers/chunk-URBLFZDC.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as fn,c as Tn}from"./chunk-3THTQ4QB.js";var Dn=Tn((nt,bt)=>{var _=_||{};_.scope={};_.arrayIteratorImpl=function(p){var c=0;return function(){return c<p.length?{done:!1,value:p[c++]}:{done:!0}}};_.arrayIterator=function(p){return{next:_.arrayIteratorImpl(p)}};_.makeIterator=function(p){var c=typeof Symbol<"u"&&Symbol.iterator&&p[Symbol.iterator];return c?c.call(p):_.arrayIterator(p)};_.ASSUME_ES5=!1;_.ASSUME_NO_NATIVE_MAP=!1;_.ASSUME_NO_NATIVE_SET=!1;_.SIMPLE_FROUND_POLYFILL=!1;_.ISOLATE_POLYFILLS=!1;_.FORCE_POLYFILL_PROMISE=!1;_.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;_.getGlobal=function(p){p=[typeof globalThis=="object"&&globalThis,p,typeof window=="object"&&window,typeof self=="object"&&self,typeof global=="object"&&global];for(var c=0;c<p.length;++c){var s=p[c];if(s&&s.Math==Math)return s}throw Error("Cannot find global object")};_.global=_.getGlobal(nt);_.defineProperty=_.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(p,c,s){return p==Array.prototype||p==Object.prototype||(p[c]=s.value),p};_.IS_SYMBOL_NATIVE=typeof Symbol=="function"&&typeof Symbol("x")=="symbol";_.TRUST_ES6_POLYFILLS=!_.ISOLATE_POLYFILLS||_.IS_SYMBOL_NATIVE;_.polyfills={};_.propertyToPolyfillSymbol={};_.POLYFILL_PREFIX="$jscp$";_.polyfill=function(p,c,s,y){c&&(_.ISOLATE_POLYFILLS?_.polyfillIsolated(p,c,s,y):_.polyfillUnisolated(p,c,s,y))};_.polyfillUnisolated=function(p,c,s,y){for(s=_.global,p=p.split("."),y=0;y<p.length-1;y++){var a=p[y];if(!(a in s))return;s=s[a]}p=p[p.length-1],y=s[p],c=c(y),c!=y&&c!=null&&_.defineProperty(s,p,{configurable:!0,writable:!0,value:c})};_.polyfillIsolated=function(p,c,s,y){var a=p.split(".");p=a.length===1,y=a[0],y=!p&&y in _.polyfills?_.polyfills:_.global;for(var g=0;g<a.length-1;g++){var i=a[g];if(!(i in y))return;y=y[i]}a=a[a.length-1],s=_.IS_SYMBOL_NATIVE&&s==="es6"?y[a]:null,c=c(s),c!=null&&(p?_.defineProperty(_.polyfills,a,{configurable:!0,writable:!0,value:c}):c!==s&&(_.propertyToPolyfillSymbol[a]===void 0&&(s=1e9*Math.random()>>>0,_.propertyToPolyfillSymbol[a]=_.IS_SYMBOL_NATIVE?_.global.Symbol(a):_.POLYFILL_PREFIX+s+"$"+a),_.defineProperty(y,_.propertyToPolyfillSymbol[a],{configurable:!0,writable:!0,value:c})))};_.polyfill("Promise",function(p){function c(){this.batch_=null}function s(i){return i instanceof a?i:new a(function(l,h){l(i)})}if(p&&(!(_.FORCE_POLYFILL_PROMISE||_.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&typeof _.global.PromiseRejectionEvent>"u")||!_.global.Promise||_.global.Promise.toString().indexOf("[native code]")===-1))return p;c.prototype.asyncExecute=function(i){if(this.batch_==null){this.batch_=[];var l=this;this.asyncExecuteFunction(function(){l.executeBatch_()})}this.batch_.push(i)};var y=_.global.setTimeout;c.prototype.asyncExecuteFunction=function(i){y(i,0)},c.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var i=this.batch_;this.batch_=[];for(var l=0;l<i.length;++l){var h=i[l];i[l]=null;try{h()}catch(I){this.asyncThrow_(I)}}}this.batch_=null},c.prototype.asyncThrow_=function(i){this.asyncExecuteFunction(function(){throw i})};var a=function(i){this.state_=0,this.result_=void 0,this.onSettledCallbacks_=[],this.isRejectionHandled_=!1;var l=this.createResolveAndReject_();try{i(l.resolve,l.reject)}catch(h){l.reject(h)}};a.prototype.createResolveAndReject_=function(){function i(I){return function(C){h||(h=!0,I.call(l,C))}}var l=this,h=!1;return{resolve:i(this.resolveTo_),reject:i(this.reject_)}},a.prototype.resolveTo_=function(i){if(i===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(i instanceof a)this.settleSameAsPromise_(i);else{t:switch(typeof i){case"object":var l=i!=null;break t;case"function":l=!0;break t;default:l=!1}l?this.resolveToNonPromiseObj_(i):this.fulfill_(i)}},a.prototype.resolveToNonPromiseObj_=function(i){var l=void 0;try{l=i.then}catch(h){this.reject_(h);return}typeof l=="function"?this.settleSameAsThenable_(l,i):this.fulfill_(i)},a.prototype.reject_=function(i){this.settle_(2,i)},a.prototype.fulfill_=function(i){this.settle_(1,i)},a.prototype.settle_=function(i,l){if(this.state_!=0)throw Error("Cannot settle("+i+", "+l+"): Promise already settled in state"+this.state_);this.state_=i,this.result_=l,this.state_===2&&this.scheduleUnhandledRejectionCheck_(),this.executeOnSettledCallbacks_()},a.prototype.scheduleUnhandledRejectionCheck_=function(){var i=this;y(function(){if(i.notifyUnhandledRejection_()){var l=_.global.console;typeof l<"u"&&l.error(i.result_)}},1)},a.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var i=_.global.CustomEvent,l=_.global.Event,h=_.global.dispatchEvent;return typeof h>"u"?!0:(typeof i=="function"?i=new i("unhandledrejection",{cancelable:!0}):typeof l=="function"?i=new l("unhandledrejection",{cancelable:!0}):(i=_.global.document.createEvent("CustomEvent"),i.initCustomEvent("unhandledrejection",!1,!0,i)),i.promise=this,i.reason=this.result_,h(i))},a.prototype.executeOnSettledCallbacks_=function(){if(this.onSettledCallbacks_!=null){for(var i=0;i<this.onSettledCallbacks_.length;++i)g.asyncExecute(this.onSettledCallbacks_[i]);this.onSettledCallbacks_=null}};var g=new c;return a.prototype.settleSameAsPromise_=function(i){var l=this.createResolveAndReject_();i.callWhenSettled_(l.resolve,l.reject)},a.prototype.settleSameAsThenable_=function(i,l){var h=this.createResolveAndReject_();try{i.call(l,h.resolve,h.reject)}catch(I){h.reject(I)}},a.prototype.then=function(i,l){function h(f,T){return typeof f=="function"?function(G){try{I(f(G))}catch(V){C(V)}}:T}var I,C,K=new a(function(f,T){I=f,C=T});return this.callWhenSettled_(h(i,I),h(l,C)),K},a.prototype.catch=function(i){return this.then(void 0,i)},a.prototype.callWhenSettled_=function(i,l){function h(){switch(I.state_){case 1:i(I.result_);break;case 2:l(I.result_);break;default:throw Error("Unexpected state: "+I.state_)}}var I=this;this.onSettledCallbacks_==null?g.asyncExecute(h):this.onSettledCallbacks_.push(h),this.isRejectionHandled_=!0},a.resolve=s,a.reject=function(i){return new a(function(l,h){h(i)})},a.race=function(i){return new a(function(l,h){for(var I=_.makeIterator(i),C=I.next();!C.done;C=I.next())s(C.value).callWhenSettled_(l,h)})},a.all=function(i){var l=_.makeIterator(i),h=l.next();return h.done?s([]):new a(function(I,C){function K(G){return function(V){f[G]=V,T--,T==0&&I(f)}}var f=[],T=0;do f.push(void 0),T++,s(h.value).callWhenSettled_(K(f.length-1),C),h=l.next();while(!h.done)})},a},"es6","es3");_.owns=function(p,c){return Object.prototype.hasOwnProperty.call(p,c)};_.assign=_.TRUST_ES6_POLYFILLS&&typeof Object.assign=="function"?Object.assign:function(p,c){for(var s=1;s<arguments.length;s++){var y=arguments[s];if(y)for(var a in y)_.owns(y,a)&&(p[a]=y[a])}return p};_.polyfill("Object.assign",function(p){return p||_.assign},"es6","es3");_.checkStringArgs=function(p,c,s){if(p==null)throw new TypeError("The 'this' value for String.prototype."+s+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+s+" must not be a regular expression");return p+""};_.polyfill("String.prototype.startsWith",function(p){return p||function(c,s){var y=_.checkStringArgs(this,c,"startsWith");c+="";var a=y.length,g=c.length;s=Math.max(0,Math.min(s|0,y.length));for(var i=0;i<g&&s<a;)if(y[s++]!=c[i++])return!1;return i>=g}},"es6","es3");_.polyfill("Array.prototype.copyWithin",function(p){function c(s){return s=Number(s),s===1/0||s===-1/0?s:s|0}return p||function(s,y,a){var g=this.length;if(s=c(s),y=c(y),a=a===void 0?g:c(a),s=0>s?Math.max(g+s,0):Math.min(s,g),y=0>y?Math.max(g+y,0):Math.min(y,g),a=0>a?Math.max(g+a,0):Math.min(a,g),s<y)for(;y<a;)y in this?this[s++]=this[y++]:(delete this[s++],y++);else for(a=Math.min(a,g+y-s),s+=a-y;a>y;)--a in this?this[--s]=this[a]:delete this[--s];return this}},"es6","es3");_.typedArrayCopyWithin=function(p){return p||Array.prototype.copyWithin};_.polyfill("Int8Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint8Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint8ClampedArray.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Int16Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint16Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Int32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Float32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Float64Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");var dt=function(){var p=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(p=p||__filename),function(c){function s(e){return t.locateFile?t.locateFile(e,Q):Q+e}function y(e,r,n){var o=r+n;for(n=r;e[n]&&!(n>=o);)++n;if(16<n-r&&e.buffer&&Ot)return Ot.decode(e.subarray(r,n));for(o="";r<n;){var m=e[r++];if(m&128){var b=e[r++]&63;if((m&224)==192)o+=String.fromCharCode((m&31)<<6|b);else{var X=e[r++]&63;m=(m&240)==224?(m&15)<<12|b<<6|X:(m&7)<<18|b<<12|X<<6|e[r++]&63,65536>m?o+=String.fromCharCode(m):(m-=65536,o+=String.fromCharCode(55296|m>>10,56320|m&1023))}}else o+=String.fromCharCode(m)}return o}function a(e,r){return e?y(tt,e,r):""}function g(){var e=_t.buffer;t.HEAP8=q=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=et=new Int32Array(e),t.HEAPU8=tt=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=x=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}function i(e){throw t.onAbort&&t.onAbort(e),e="Aborted("+e+")",J(e),Gt=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),ot(e),e}function l(e){try{if(e==z&&Z)return new Uint8Array(Z);if(ut)return ut(e);throw"both async and sync fetching of the wasm failed"}catch(r){i(r)}}function h(){if(!Z&&(It||$)){if(typeof fetch=="function"&&!z.startsWith("file://"))return fetch(z,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+z+"'";return e.arrayBuffer()}).catch(function(){return l(z)});if(st)return new Promise(function(e,r){st(z,function(n){e(new Uint8Array(n))},r)})}return Promise.resolve().then(function(){return l(z)})}function I(e){for(;0<e.length;)e.shift()(t)}function C(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(r){x[this.ptr+4>>2]=r},this.get_type=function(){return x[this.ptr+4>>2]},this.set_destructor=function(r){x[this.ptr+8>>2]=r},this.get_destructor=function(){return x[this.ptr+8>>2]},this.set_refcount=function(r){et[this.ptr>>2]=r},this.set_caught=function(r){q[this.ptr+12>>0]=r?1:0},this.get_caught=function(){return q[this.ptr+12>>0]!=0},this.set_rethrown=function(r){q[this.ptr+13>>0]=r?1:0},this.get_rethrown=function(){return q[this.ptr+13>>0]!=0},this.init=function(r,n){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){et[this.ptr>>2]+=1},this.release_ref=function(){var r=et[this.ptr>>2];return et[this.ptr>>2]=r-1,r===1},this.set_adjusted_ptr=function(r){x[this.ptr+16>>2]=r},this.get_adjusted_ptr=function(){return x[this.ptr+16>>2]},this.get_exception_ptr=function(){if(ln(this.get_type()))return x[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function K(){function e(){if(!it&&(it=!0,t.calledRun=!0,!Gt)){if(Rt=!0,I(ct),ht(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Pt.unshift(t.postRun.shift());I(Pt)}}if(!(0<k)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)jt.unshift(t.preRun.shift());I(jt),0<k||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e())}}function f(){}function T(e){return(e||f).__cache__}function G(e,r){var n=T(r),o=n[e];return o||(o=Object.create((r||f).prototype),o.ptr=e,n[e]=o)}function V(e){if(typeof e=="string"){for(var r=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);127>=o?r++:2047>=o?r+=2:55296<=o&&57343>=o?(r+=4,++n):r+=3}if(r=Array(r+1),n=0,o=r.length,0<o){o=n+o-1;for(var m=0;m<e.length;++m){var b=e.charCodeAt(m);if(55296<=b&&57343>=b){var X=e.charCodeAt(++m);b=65536+((b&1023)<<10)|X&1023}if(127>=b){if(n>=o)break;r[n++]=b}else{if(2047>=b){if(n+1>=o)break;r[n++]=192|b>>6}else{if(65535>=b){if(n+2>=o)break;r[n++]=224|b>>12}else{if(n+3>=o)break;r[n++]=240|b>>18,r[n++]=128|b>>12&63}r[n++]=128|b>>6&63}r[n++]=128|b&63}}r[n]=0}return e=d.alloc(r,q),d.copy(r,q,e),e}return e}function at(e){if(typeof e=="object"){var r=d.alloc(e,q);return d.copy(e,q,r),r}return e}function H(){throw"cannot construct a VoidPtr, no constructor in IDL"}function B(){this.ptr=Mt(),T(B)[this.ptr]=this}function w(){this.ptr=Ft(),T(w)[this.ptr]=this}function Y(){this.ptr=wt(),T(Y)[this.ptr]=this}function A(){this.ptr=Vt(),T(A)[this.ptr]=this}function E(){this.ptr=Jt(),T(E)[this.ptr]=this}function j(){this.ptr=ne(),T(j)[this.ptr]=this}function P(){this.ptr=ae(),T(P)[this.ptr]=this}function O(){this.ptr=ce(),T(O)[this.ptr]=this}function W(){this.ptr=de(),T(W)[this.ptr]=this}function v(){throw"cannot construct a Status, no constructor in IDL"}function R(){this.ptr=Ie(),T(R)[this.ptr]=this}function S(){this.ptr=Ge(),T(S)[this.ptr]=this}function M(){this.ptr=Re(),T(M)[this.ptr]=this}function N(){this.ptr=Ue(),T(N)[this.ptr]=this}function U(){this.ptr=we(),T(U)[this.ptr]=this}function F(){this.ptr=We(),T(F)[this.ptr]=this}function L(){this.ptr=He(),T(L)[this.ptr]=this}function D(){this.ptr=Ke(),T(D)[this.ptr]=this}function u(){this.ptr=_r(),T(u)[this.ptr]=this}c=c===void 0?{}:c;var t=typeof c<"u"?c:{},ht,ot;t.ready=new Promise(function(e,r){ht=e,ot=r});var At=!1,Tt=!1;t.onRuntimeInitialized=function(){At=!0,Tt&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.onModuleParsed=function(){Tt=!0,At&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.isVersionSupported=function(e){return typeof e!="string"?!1:(e=e.split("."),2>e.length||3<e.length?!1:e[0]==1&&0<=e[1]&&5>=e[1]?!0:!(e[0]!=0||10<e[1]))};var Dt=Object.assign({},t),It=typeof window=="object",$=typeof importScripts=="function",gt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Q="";if(gt){var vt=fn("fs"),pt=fn("path");Q=$?pt.dirname(Q)+"/":__dirname+"/";var Et=function(e,r){return e=e.startsWith("file://")?new URL(e):pt.normalize(e),vt.readFileSync(e,r?void 0:"utf8")},ut=function(e){return e=Et(e,!0),e.buffer||(e=new Uint8Array(e)),e},st=function(e,r,n){e=e.startsWith("file://")?new URL(e):pt.normalize(e),vt.readFile(e,function(o,m){o?n(o):r(m.buffer)})};1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),t.inspect=function(){return"[Emscripten Module object]"}}else(It||$)&&($?Q=self.location.href:typeof document<"u"&&document.currentScript&&(Q=document.currentScript.src),p&&(Q=p),Q=Q.indexOf("blob:")!==0?Q.substr(0,Q.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Et=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},$&&(ut=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),st=function(e,r,n){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){o.status==200||o.status==0&&o.response?r(o.response):n()},o.onerror=n,o.send(null)});var dn=t.print||console.log.bind(console),J=t.printErr||console.warn.bind(console);Object.assign(t,Dt),Dt=null;var Z;t.wasmBinary&&(Z=t.wasmBinary),typeof WebAssembly!="object"&&i("no native wasm support detected");var _t,Gt=!1,Ot=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,q,tt,et,x,jt=[],ct=[],Pt=[],Rt=!1,k=0,yt=null,rt=null,z="draco_decoder.wasm";z.startsWith("data:application/octet-stream;base64,")||(z=s(z));var bn=0,hn=[null,[],[]],An={b:function(e,r,n){throw new C(e).init(r,n),bn++,e},a:function(){i("")},g:function(e,r,n){tt.copyWithin(e,r,r+n)},e:function(e){var r=tt.length;if(e>>>=0,2147483648<e)return!1;for(var n=1;4>=n;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var m=Math;o=Math.max(e,o),m=m.min.call(m,2147483648,o+(65536-o%65536)%65536);t:{o=_t.buffer;try{_t.grow(m-o.byteLength+65535>>>16),g();var b=1;break t}catch{}b=void 0}if(b)return!0}return!1},f:function(e){return 52},d:function(e,r,n,o,m){return 70},c:function(e,r,n,o){for(var m=0,b=0;b<n;b++){var X=x[r>>2],mn=x[r+4>>2];r+=8;for(var lt=0;lt<mn;lt++){var mt=tt[X+lt],ft=hn[e];mt===0||mt===10?((e===1?dn:J)(y(ft,0)),ft.length=0):ft.push(mt)}m+=mn}return x[o>>2]=m,0}};(function(){function e(m,b){t.asm=m.exports,_t=t.asm.h,g(),ct.unshift(t.asm.i),k--,t.monitorRunDependencies&&t.monitorRunDependencies(k),k==0&&(yt!==null&&(clearInterval(yt),yt=null),rt&&(m=rt,rt=null,m()))}function r(m){e(m.instance)}function n(m){return h().then(function(b){return WebAssembly.instantiate(b,o)}).then(function(b){return b}).then(m,function(b){J("failed to asynchronously prepare wasm: "+b),i(b)})}var o={a:An};if(k++,t.monitorRunDependencies&&t.monitorRunDependencies(k),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(m){J("Module.instantiateWasm callback failed with error: "+m),ot(m)}return function(){return Z||typeof WebAssembly.instantiateStreaming!="function"||z.startsWith("data:application/octet-stream;base64,")||z.startsWith("file://")||gt||typeof fetch!="function"?n(r):fetch(z,{credentials:"same-origin"}).then(function(m){return WebAssembly.instantiateStreaming(m,o).then(r,function(b){return J("wasm streaming compile failed: "+b),J("falling back to ArrayBuffer instantiation"),n(r)})})}().catch(ot),{}})();var St=t._emscripten_bind_VoidPtr___destroy___0=function(){return(St=t._emscripten_bind_VoidPtr___destroy___0=t.asm.k).apply(null,arguments)},Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return(Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=t.asm.l).apply(null,arguments)},Nt=t._emscripten_bind_DecoderBuffer_Init_2=function(){return(Nt=t._emscripten_bind_DecoderBuffer_Init_2=t.asm.m).apply(null,arguments)},Ut=t._emscripten_bind_DecoderBuffer___destroy___0=function(){return(Ut=t._emscripten_bind_DecoderBuffer___destroy___0=t.asm.n).apply(null,arguments)},Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=function(){return(Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=t.asm.o).apply(null,arguments)},Lt=t._emscripten_bind_AttributeTransformData_transform_type_0=function(){return(Lt=t._emscripten_bind_AttributeTransformData_transform_type_0=t.asm.p).apply(null,arguments)},Ct=t._emscripten_bind_AttributeTransformData___destroy___0=function(){return(Ct=t._emscripten_bind_AttributeTransformData___destroy___0=t.asm.q).apply(null,arguments)},wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return(wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=t.asm.r).apply(null,arguments)},zt=t._emscripten_bind_GeometryAttribute___destroy___0=function(){return(zt=t._emscripten_bind_GeometryAttribute___destroy___0=t.asm.s).apply(null,arguments)},Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=function(){return(Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=t.asm.t).apply(null,arguments)},Bt=t._emscripten_bind_PointAttribute_size_0=function(){return(Bt=t._emscripten_bind_PointAttribute_size_0=t.asm.u).apply(null,arguments)},Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return(Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=t.asm.v).apply(null,arguments)},Qt=t._emscripten_bind_PointAttribute_attribute_type_0=function(){return(Qt=t._emscripten_bind_PointAttribute_attribute_type_0=t.asm.w).apply(null,arguments)},xt=t._emscripten_bind_PointAttribute_data_type_0=function(){return(xt=t._emscripten_bind_PointAttribute_data_type_0=t.asm.x).apply(null,arguments)},Yt=t._emscripten_bind_PointAttribute_num_components_0=function(){return(Yt=t._emscripten_bind_PointAttribute_num_components_0=t.asm.y).apply(null,arguments)},Ht=t._emscripten_bind_PointAttribute_normalized_0=function(){return(Ht=t._emscripten_bind_PointAttribute_normalized_0=t.asm.z).apply(null,arguments)},qt=t._emscripten_bind_PointAttribute_byte_stride_0=function(){return(qt=t._emscripten_bind_PointAttribute_byte_stride_0=t.asm.A).apply(null,arguments)},kt=t._emscripten_bind_PointAttribute_byte_offset_0=function(){return(kt=t._emscripten_bind_PointAttribute_byte_offset_0=t.asm.B).apply(null,arguments)},Xt=t._emscripten_bind_PointAttribute_unique_id_0=function(){return(Xt=t._emscripten_bind_PointAttribute_unique_id_0=t.asm.C).apply(null,arguments)},Kt=t._emscripten_bind_PointAttribute___destroy___0=function(){return(Kt=t._emscripten_bind_PointAttribute___destroy___0=t.asm.D).apply(null,arguments)},Jt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return(Jt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=t.asm.E).apply(null,arguments)},$t=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return($t=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=t.asm.F).apply(null,arguments)},Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return(Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=t.asm.G).apply(null,arguments)},te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return(te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=t.asm.H).apply(null,arguments)},ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return(ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=t.asm.I).apply(null,arguments)},re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return(re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=t.asm.J).apply(null,arguments)},ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return(ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=t.asm.K).apply(null,arguments)},oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return(oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=t.asm.L).apply(null,arguments)},_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return(_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=t.asm.M).apply(null,arguments)},ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return(ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=t.asm.N).apply(null,arguments)},ae=t._emscripten_bind_PointCloud_PointCloud_0=function(){return(ae=t._emscripten_bind_PointCloud_PointCloud_0=t.asm.O).apply(null,arguments)},pe=t._emscripten_bind_PointCloud_num_attributes_0=function(){return(pe=t._emscripten_bind_PointCloud_num_attributes_0=t.asm.P).apply(null,arguments)},ue=t._emscripten_bind_PointCloud_num_points_0=function(){return(ue=t._emscripten_bind_PointCloud_num_points_0=t.asm.Q).apply(null,arguments)},se=t._emscripten_bind_PointCloud___destroy___0=function(){return(se=t._emscripten_bind_PointCloud___destroy___0=t.asm.R).apply(null,arguments)},ce=t._emscripten_bind_Mesh_Mesh_0=function(){return(ce=t._emscripten_bind_Mesh_Mesh_0=t.asm.S).apply(null,arguments)},ye=t._emscripten_bind_Mesh_num_faces_0=function(){return(ye=t._emscripten_bind_Mesh_num_faces_0=t.asm.T).apply(null,arguments)},le=t._emscripten_bind_Mesh_num_attributes_0=function(){return(le=t._emscripten_bind_Mesh_num_attributes_0=t.asm.U).apply(null,arguments)},me=t._emscripten_bind_Mesh_num_points_0=function(){return(me=t._emscripten_bind_Mesh_num_points_0=t.asm.V).apply(null,arguments)},fe=t._emscripten_bind_Mesh___destroy___0=function(){return(fe=t._emscripten_bind_Mesh___destroy___0=t.asm.W).apply(null,arguments)},de=t._emscripten_bind_Metadata_Metadata_0=function(){return(de=t._emscripten_bind_Metadata_Metadata_0=t.asm.X).apply(null,arguments)},be=t._emscripten_bind_Metadata___destroy___0=function(){return(be=t._emscripten_bind_Metadata___destroy___0=t.asm.Y).apply(null,arguments)},he=t._emscripten_bind_Status_code_0=function(){return(he=t._emscripten_bind_Status_code_0=t.asm.Z).apply(null,arguments)},Ae=t._emscripten_bind_Status_ok_0=function(){return(Ae=t._emscripten_bind_Status_ok_0=t.asm._).apply(null,arguments)},Te=t._emscripten_bind_Status_error_msg_0=function(){return(Te=t._emscripten_bind_Status_error_msg_0=t.asm.$).apply(null,arguments)},De=t._emscripten_bind_Status___destroy___0=function(){return(De=t._emscripten_bind_Status___destroy___0=t.asm.aa).apply(null,arguments)},Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return(Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=t.asm.ba).apply(null,arguments)},ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return(ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=t.asm.ca).apply(null,arguments)},ve=t._emscripten_bind_DracoFloat32Array_size_0=function(){return(ve=t._emscripten_bind_DracoFloat32Array_size_0=t.asm.da).apply(null,arguments)},Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=function(){return(Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=t.asm.ea).apply(null,arguments)},Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return(Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=t.asm.fa).apply(null,arguments)},Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=function(){return(Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=t.asm.ga).apply(null,arguments)},je=t._emscripten_bind_DracoInt8Array_size_0=function(){return(je=t._emscripten_bind_DracoInt8Array_size_0=t.asm.ha).apply(null,arguments)},Pe=t._emscripten_bind_DracoInt8Array___destroy___0=function(){return(Pe=t._emscripten_bind_DracoInt8Array___destroy___0=t.asm.ia).apply(null,arguments)},Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return(Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=t.asm.ja).apply(null,arguments)},Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return(Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=t.asm.ka).apply(null,arguments)},Me=t._emscripten_bind_DracoUInt8Array_size_0=function(){return(Me=t._emscripten_bind_DracoUInt8Array_size_0=t.asm.la).apply(null,arguments)},Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=function(){return(Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=t.asm.ma).apply(null,arguments)},Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return(Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=t.asm.na).apply(null,arguments)},Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=function(){return(Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=t.asm.oa).apply(null,arguments)},Le=t._emscripten_bind_DracoInt16Array_size_0=function(){return(Le=t._emscripten_bind_DracoInt16Array_size_0=t.asm.pa).apply(null,arguments)},Ce=t._emscripten_bind_DracoInt16Array___destroy___0=function(){return(Ce=t._emscripten_bind_DracoInt16Array___destroy___0=t.asm.qa).apply(null,arguments)},we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return(we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=t.asm.ra).apply(null,arguments)},ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return(ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=t.asm.sa).apply(null,arguments)},Ve=t._emscripten_bind_DracoUInt16Array_size_0=function(){return(Ve=t._emscripten_bind_DracoUInt16Array_size_0=t.asm.ta).apply(null,arguments)},Be=t._emscripten_bind_DracoUInt16Array___destroy___0=function(){return(Be=t._emscripten_bind_DracoUInt16Array___destroy___0=t.asm.ua).apply(null,arguments)},We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return(We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=t.asm.va).apply(null,arguments)},Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=function(){return(Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=t.asm.wa).apply(null,arguments)},xe=t._emscripten_bind_DracoInt32Array_size_0=function(){return(xe=t._emscripten_bind_DracoInt32Array_size_0=t.asm.xa).apply(null,arguments)},Ye=t._emscripten_bind_DracoInt32Array___destroy___0=function(){return(Ye=t._emscripten_bind_DracoInt32Array___destroy___0=t.asm.ya).apply(null,arguments)},He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return(He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=t.asm.za).apply(null,arguments)},qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return(qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=t.asm.Aa).apply(null,arguments)},ke=t._emscripten_bind_DracoUInt32Array_size_0=function(){return(ke=t._emscripten_bind_DracoUInt32Array_size_0=t.asm.Ba).apply(null,arguments)},Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=function(){return(Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=t.asm.Ca).apply(null,arguments)},Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return(Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=t.asm.Da).apply(null,arguments)},Je=t._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return(Je=t._emscripten_bind_MetadataQuerier_HasEntry_2=t.asm.Ea).apply(null,arguments)},$e=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return($e=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=t.asm.Fa).apply(null,arguments)},Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=function(){return(Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=t.asm.Ga).apply(null,arguments)},tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return(tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=t.asm.Ha).apply(null,arguments)},er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return(er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=t.asm.Ia).apply(null,arguments)},rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return(rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=t.asm.Ja).apply(null,arguments)},nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return(nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=t.asm.Ka).apply(null,arguments)},or=t._emscripten_bind_MetadataQuerier___destroy___0=function(){return(or=t._emscripten_bind_MetadataQuerier___destroy___0=t.asm.La).apply(null,arguments)},_r=t._emscripten_bind_Decoder_Decoder_0=function(){return(_r=t._emscripten_bind_Decoder_Decoder_0=t.asm.Ma).apply(null,arguments)},ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=function(){return(ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=t.asm.Na).apply(null,arguments)},ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=function(){return(ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=t.asm.Oa).apply(null,arguments)},pr=t._emscripten_bind_Decoder_GetAttributeId_2=function(){return(pr=t._emscripten_bind_Decoder_GetAttributeId_2=t.asm.Pa).apply(null,arguments)},ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return(ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=t.asm.Qa).apply(null,arguments)},sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return(sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=t.asm.Ra).apply(null,arguments)},cr=t._emscripten_bind_Decoder_GetAttribute_2=function(){return(cr=t._emscripten_bind_Decoder_GetAttribute_2=t.asm.Sa).apply(null,arguments)},yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return(yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=t.asm.Ta).apply(null,arguments)},lr=t._emscripten_bind_Decoder_GetMetadata_1=function(){return(lr=t._emscripten_bind_Decoder_GetMetadata_1=t.asm.Ua).apply(null,arguments)},mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return(mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=t.asm.Va).apply(null,arguments)},fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return(fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=t.asm.Wa).apply(null,arguments)},dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return(dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=t.asm.Xa).apply(null,arguments)},br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return(br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=t.asm.Ya).apply(null,arguments)},hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=function(){return(hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=t.asm.Za).apply(null,arguments)},Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return(Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=t.asm._a).apply(null,arguments)},Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return(Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=t.asm.$a).apply(null,arguments)},Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return(Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=t.asm.ab).apply(null,arguments)},Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return(Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=t.asm.bb).apply(null,arguments)},gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return(gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=t.asm.cb).apply(null,arguments)},vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return(vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=t.asm.db).apply(null,arguments)},Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return(Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=t.asm.eb).apply(null,arguments)},Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return(Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=t.asm.fb).apply(null,arguments)},Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return(Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=t.asm.gb).apply(null,arguments)},jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return(jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=t.asm.hb).apply(null,arguments)},Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return(Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=t.asm.ib).apply(null,arguments)},Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=function(){return(Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=t.asm.jb).apply(null,arguments)},Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return(Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=t.asm.kb).apply(null,arguments)},Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return(Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=t.asm.lb).apply(null,arguments)},Nr=t._emscripten_bind_Decoder___destroy___0=function(){return(Nr=t._emscripten_bind_Decoder___destroy___0=t.asm.mb).apply(null,arguments)},Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return(Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=t.asm.nb).apply(null,arguments)},Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return(Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=t.asm.ob).apply(null,arguments)},Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return(Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=t.asm.pb).apply(null,arguments)},Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return(Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=t.asm.qb).apply(null,arguments)},wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return(wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=t.asm.rb).apply(null,arguments)},zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return(zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=t.asm.sb).apply(null,arguments)},Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return(Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=t.asm.tb).apply(null,arguments)},Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return(Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=t.asm.ub).apply(null,arguments)},Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return(Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=t.asm.vb).apply(null,arguments)},Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return(Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=t.asm.wb).apply(null,arguments)},xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return(xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=t.asm.xb).apply(null,arguments)},Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return(Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=t.asm.yb).apply(null,arguments)},Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return(Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=t.asm.zb).apply(null,arguments)},qr=t._emscripten_enum_draco_DataType_DT_INVALID=function(){return(qr=t._emscripten_enum_draco_DataType_DT_INVALID=t.asm.Ab).apply(null,arguments)},kr=t._emscripten_enum_draco_DataType_DT_INT8=function(){return(kr=t._emscripten_enum_draco_DataType_DT_INT8=t.asm.Bb).apply(null,arguments)},Xr=t._emscripten_enum_draco_DataType_DT_UINT8=function(){return(Xr=t._emscripten_enum_draco_DataType_DT_UINT8=t.asm.Cb).apply(null,arguments)},Kr=t._emscripten_enum_draco_DataType_DT_INT16=function(){return(Kr=t._emscripten_enum_draco_DataType_DT_INT16=t.asm.Db).apply(null,arguments)},Jr=t._emscripten_enum_draco_DataType_DT_UINT16=function(){return(Jr=t._emscripten_enum_draco_DataType_DT_UINT16=t.asm.Eb).apply(null,arguments)},$r=t._emscripten_enum_draco_DataType_DT_INT32=function(){return($r=t._emscripten_enum_draco_DataType_DT_INT32=t.asm.Fb).apply(null,arguments)},Zr=t._emscripten_enum_draco_DataType_DT_UINT32=function(){return(Zr=t._emscripten_enum_draco_DataType_DT_UINT32=t.asm.Gb).apply(null,arguments)},tn=t._emscripten_enum_draco_DataType_DT_INT64=function(){return(tn=t._emscripten_enum_draco_DataType_DT_INT64=t.asm.Hb).apply(null,arguments)},en=t._emscripten_enum_draco_DataType_DT_UINT64=function(){return(en=t._emscripten_enum_draco_DataType_DT_UINT64=t.asm.Ib).apply(null,arguments)},rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return(rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=t.asm.Jb).apply(null,arguments)},nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return(nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=t.asm.Kb).apply(null,arguments)},on=t._emscripten_enum_draco_DataType_DT_BOOL=function(){return(on=t._emscripten_enum_draco_DataType_DT_BOOL=t.asm.Lb).apply(null,arguments)},_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return(_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=t.asm.Mb).apply(null,arguments)},an=t._emscripten_enum_draco_StatusCode_OK=function(){return(an=t._emscripten_enum_draco_StatusCode_OK=t.asm.Nb).apply(null,arguments)},pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return(pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=t.asm.Ob).apply(null,arguments)},un=t._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return(un=t._emscripten_enum_draco_StatusCode_IO_ERROR=t.asm.Pb).apply(null,arguments)},sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return(sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=t.asm.Qb).apply(null,arguments)},cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return(cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=t.asm.Rb).apply(null,arguments)},yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return(yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=t.asm.Sb).apply(null,arguments)};t._malloc=function(){return(t._malloc=t.asm.Tb).apply(null,arguments)},t._free=function(){return(t._free=t.asm.Ub).apply(null,arguments)};var ln=function(){return(ln=t.asm.Vb).apply(null,arguments)};t.___start_em_js=15856,t.___stop_em_js=15954;var it;if(rt=function e(){it||K(),it||(rt=e)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();K(),f.prototype=Object.create(f.prototype),f.prototype.constructor=f,f.prototype.__class__=f,f.__cache__={},t.WrapperObject=f,t.getCache=T,t.wrapPointer=G,t.castObject=function(e,r){return G(e.ptr,r)},t.NULL=G(0),t.destroy=function(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete T(e.__class__)[e.ptr]},t.compare=function(e,r){return e.ptr===r.ptr},t.getPointer=function(e){return e.ptr},t.getClass=function(e){return e.__class__};var d={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(d.needed){for(var e=0;e<d.temps.length;e++)t._free(d.temps[e]);d.temps.length=0,t._free(d.buffer),d.buffer=0,d.size+=d.needed,d.needed=0}d.buffer||(d.size+=128,d.buffer=t._malloc(d.size),d.buffer||i(void 0)),d.pos=0},alloc:function(e,r){return d.buffer||i(void 0),e=e.length*r.BYTES_PER_ELEMENT,e=e+7&-8,d.pos+e>=d.size?(0<e||i(void 0),d.needed+=e,r=t._malloc(e),d.temps.push(r)):(r=d.buffer+d.pos,d.pos+=e),r},copy:function(e,r,n){switch(n>>>=0,r.BYTES_PER_ELEMENT){case 2:n>>>=1;break;case 4:n>>>=2;break;case 8:n>>>=3}for(var o=0;o<e.length;o++)r[n+o]=e[o]}};return H.prototype=Object.create(f.prototype),H.prototype.constructor=H,H.prototype.__class__=H,H.__cache__={},t.VoidPtr=H,H.prototype.__destroy__=H.prototype.__destroy__=function(){St(this.ptr)},B.prototype=Object.create(f.prototype),B.prototype.constructor=B,B.prototype.__class__=B,B.__cache__={},t.DecoderBuffer=B,B.prototype.Init=B.prototype.Init=function(e,r){var n=this.ptr;d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),Nt(n,e,r)},B.prototype.__destroy__=B.prototype.__destroy__=function(){Ut(this.ptr)},w.prototype=Object.create(f.prototype),w.prototype.constructor=w,w.prototype.__class__=w,w.__cache__={},t.AttributeTransformData=w,w.prototype.transform_type=w.prototype.transform_type=function(){return Lt(this.ptr)},w.prototype.__destroy__=w.prototype.__destroy__=function(){Ct(this.ptr)},Y.prototype=Object.create(f.prototype),Y.prototype.constructor=Y,Y.prototype.__class__=Y,Y.__cache__={},t.GeometryAttribute=Y,Y.prototype.__destroy__=Y.prototype.__destroy__=function(){zt(this.ptr)},A.prototype=Object.create(f.prototype),A.prototype.constructor=A,A.prototype.__class__=A,A.__cache__={},t.PointAttribute=A,A.prototype.size=A.prototype.size=function(){return Bt(this.ptr)},A.prototype.GetAttributeTransformData=A.prototype.GetAttributeTransformData=function(){return G(Wt(this.ptr),w)},A.prototype.attribute_type=A.prototype.attribute_type=function(){return Qt(this.ptr)},A.prototype.data_type=A.prototype.data_type=function(){return xt(this.ptr)},A.prototype.num_components=A.prototype.num_components=function(){return Yt(this.ptr)},A.prototype.normalized=A.prototype.normalized=function(){return!!Ht(this.ptr)},A.prototype.byte_stride=A.prototype.byte_stride=function(){return qt(this.ptr)},A.prototype.byte_offset=A.prototype.byte_offset=function(){return kt(this.ptr)},A.prototype.unique_id=A.prototype.unique_id=function(){return Xt(this.ptr)},A.prototype.__destroy__=A.prototype.__destroy__=function(){Kt(this.ptr)},E.prototype=Object.create(f.prototype),E.prototype.constructor=E,E.prototype.__class__=E,E.__cache__={},t.AttributeQuantizationTransform=E,E.prototype.InitFromAttribute=E.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!$t(r,e)},E.prototype.quantization_bits=E.prototype.quantization_bits=function(){return Zt(this.ptr)},E.prototype.min_value=E.prototype.min_value=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),te(r,e)},E.prototype.range=E.prototype.range=function(){return ee(this.ptr)},E.prototype.__destroy__=E.prototype.__destroy__=function(){re(this.ptr)},j.prototype=Object.create(f.prototype),j.prototype.constructor=j,j.prototype.__class__=j,j.__cache__={},t.AttributeOctahedronTransform=j,j.prototype.InitFromAttribute=j.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!oe(r,e)},j.prototype.quantization_bits=j.prototype.quantization_bits=function(){return _e(this.ptr)},j.prototype.__destroy__=j.prototype.__destroy__=function(){ie(this.ptr)},P.prototype=Object.create(f.prototype),P.prototype.constructor=P,P.prototype.__class__=P,P.__cache__={},t.PointCloud=P,P.prototype.num_attributes=P.prototype.num_attributes=function(){return pe(this.ptr)},P.prototype.num_points=P.prototype.num_points=function(){return ue(this.ptr)},P.prototype.__destroy__=P.prototype.__destroy__=function(){se(this.ptr)},O.prototype=Object.create(f.prototype),O.prototype.constructor=O,O.prototype.__class__=O,O.__cache__={},t.Mesh=O,O.prototype.num_faces=O.prototype.num_faces=function(){return ye(this.ptr)},O.prototype.num_attributes=O.prototype.num_attributes=function(){return le(this.ptr)},O.prototype.num_points=O.prototype.num_points=function(){return me(this.ptr)},O.prototype.__destroy__=O.prototype.__destroy__=function(){fe(this.ptr)},W.prototype=Object.create(f.prototype),W.prototype.constructor=W,W.prototype.__class__=W,W.__cache__={},t.Metadata=W,W.prototype.__destroy__=W.prototype.__destroy__=function(){be(this.ptr)},v.prototype=Object.create(f.prototype),v.prototype.constructor=v,v.prototype.__class__=v,v.__cache__={},t.Status=v,v.prototype.code=v.prototype.code=function(){return he(this.ptr)},v.prototype.ok=v.prototype.ok=function(){return!!Ae(this.ptr)},v.prototype.error_msg=v.prototype.error_msg=function(){return a(Te(this.ptr))},v.prototype.__destroy__=v.prototype.__destroy__=function(){De(this.ptr)},R.prototype=Object.create(f.prototype),R.prototype.constructor=R,R.prototype.__class__=R,R.__cache__={},t.DracoFloat32Array=R,R.prototype.GetValue=R.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ge(r,e)},R.prototype.size=R.prototype.size=function(){return ve(this.ptr)},R.prototype.__destroy__=R.prototype.__destroy__=function(){Ee(this.ptr)},S.prototype=Object.create(f.prototype),S.prototype.constructor=S,S.prototype.__class__=S,S.__cache__={},t.DracoInt8Array=S,S.prototype.GetValue=S.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Oe(r,e)},S.prototype.size=S.prototype.size=function(){return je(this.ptr)},S.prototype.__destroy__=S.prototype.__destroy__=function(){Pe(this.ptr)},M.prototype=Object.create(f.prototype),M.prototype.constructor=M,M.prototype.__class__=M,M.__cache__={},t.DracoUInt8Array=M,M.prototype.GetValue=M.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Se(r,e)},M.prototype.size=M.prototype.size=function(){return Me(this.ptr)},M.prototype.__destroy__=M.prototype.__destroy__=function(){Ne(this.ptr)},N.prototype=Object.create(f.prototype),N.prototype.constructor=N,N.prototype.__class__=N,N.__cache__={},t.DracoInt16Array=N,N.prototype.GetValue=N.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Fe(r,e)},N.prototype.size=N.prototype.size=function(){return Le(this.ptr)},N.prototype.__destroy__=N.prototype.__destroy__=function(){Ce(this.ptr)},U.prototype=Object.create(f.prototype),U.prototype.constructor=U,U.prototype.__class__=U,U.__cache__={},t.DracoUInt16Array=U,U.prototype.GetValue=U.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ze(r,e)},U.prototype.size=U.prototype.size=function(){return Ve(this.ptr)},U.prototype.__destroy__=U.prototype.__destroy__=function(){Be(this.ptr)},F.prototype=Object.create(f.prototype),F.prototype.constructor=F,F.prototype.__class__=F,F.__cache__={},t.DracoInt32Array=F,F.prototype.GetValue=F.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Qe(r,e)},F.prototype.size=F.prototype.size=function(){return xe(this.ptr)},F.prototype.__destroy__=F.prototype.__destroy__=function(){Ye(this.ptr)},L.prototype=Object.create(f.prototype),L.prototype.constructor=L,L.prototype.__class__=L,L.__cache__={},t.DracoUInt32Array=L,L.prototype.GetValue=L.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),qe(r,e)},L.prototype.size=L.prototype.size=function(){return ke(this.ptr)},L.prototype.__destroy__=L.prototype.__destroy__=function(){Xe(this.ptr)},D.prototype=Object.create(f.prototype),D.prototype.constructor=D,D.prototype.__class__=D,D.__cache__={},t.MetadataQuerier=D,D.prototype.HasEntry=D.prototype.HasEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),!!Je(n,e,r)},D.prototype.GetIntEntry=D.prototype.GetIntEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),$e(n,e,r)},D.prototype.GetIntEntryArray=D.prototype.GetIntEntryArray=function(e,r,n){var o=this.ptr;d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),n&&typeof n=="object"&&(n=n.ptr),Ze(o,e,r,n)},D.prototype.GetDoubleEntry=D.prototype.GetDoubleEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),tr(n,e,r)},D.prototype.GetStringEntry=D.prototype.GetStringEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),a(er(n,e,r))},D.prototype.NumEntries=D.prototype.NumEntries=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),rr(r,e)},D.prototype.GetEntryName=D.prototype.GetEntryName=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),a(nr(n,e,r))},D.prototype.__destroy__=D.prototype.__destroy__=function(){or(this.ptr)},u.prototype=Object.create(f.prototype),u.prototype.constructor=u,u.prototype.__class__=u,u.__cache__={},t.Decoder=u,u.prototype.DecodeArrayToPointCloud=u.prototype.DecodeArrayToPointCloud=function(e,r,n){var o=this.ptr;return d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),G(ir(o,e,r,n),v)},u.prototype.DecodeArrayToMesh=u.prototype.DecodeArrayToMesh=function(e,r,n){var o=this.ptr;return d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),G(ar(o,e,r,n),v)},u.prototype.GetAttributeId=u.prototype.GetAttributeId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),pr(n,e,r)},u.prototype.GetAttributeIdByName=u.prototype.GetAttributeIdByName=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),ur(n,e,r)},u.prototype.GetAttributeIdByMetadataEntry=u.prototype.GetAttributeIdByMetadataEntry=function(e,r,n){var o=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),n=n&&typeof n=="object"?n.ptr:V(n),sr(o,e,r,n)},u.prototype.GetAttribute=u.prototype.GetAttribute=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(cr(n,e,r),A)},u.prototype.GetAttributeByUniqueId=u.prototype.GetAttributeByUniqueId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(yr(n,e,r),A)},u.prototype.GetMetadata=u.prototype.GetMetadata=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),G(lr(r,e),W)},u.prototype.GetAttributeMetadata=u.prototype.GetAttributeMetadata=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(mr(n,e,r),W)},u.prototype.GetFaceFromMesh=u.prototype.GetFaceFromMesh=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!fr(o,e,r,n)},u.prototype.GetTriangleStripsFromMesh=u.prototype.GetTriangleStripsFromMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),dr(n,e,r)},u.prototype.GetTrianglesUInt16Array=u.prototype.GetTrianglesUInt16Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!br(o,e,r,n)},u.prototype.GetTrianglesUInt32Array=u.prototype.GetTrianglesUInt32Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!hr(o,e,r,n)},u.prototype.GetAttributeFloat=u.prototype.GetAttributeFloat=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ar(o,e,r,n)},u.prototype.GetAttributeFloatForAllPoints=u.prototype.GetAttributeFloatForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Tr(o,e,r,n)},u.prototype.GetAttributeIntForAllPoints=u.prototype.GetAttributeIntForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Dr(o,e,r,n)},u.prototype.GetAttributeInt8ForAllPoints=u.prototype.GetAttributeInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ir(o,e,r,n)},u.prototype.GetAttributeUInt8ForAllPoints=u.prototype.GetAttributeUInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!gr(o,e,r,n)},u.prototype.GetAttributeInt16ForAllPoints=u.prototype.GetAttributeInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!vr(o,e,r,n)},u.prototype.GetAttributeUInt16ForAllPoints=u.prototype.GetAttributeUInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Er(o,e,r,n)},u.prototype.GetAttributeInt32ForAllPoints=u.prototype.GetAttributeInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Gr(o,e,r,n)},u.prototype.GetAttributeUInt32ForAllPoints=u.prototype.GetAttributeUInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Or(o,e,r,n)},u.prototype.GetAttributeDataArrayForAllPoints=u.prototype.GetAttributeDataArrayForAllPoints=function(e,r,n,o,m){var b=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),o&&typeof o=="object"&&(o=o.ptr),m&&typeof m=="object"&&(m=m.ptr),!!jr(b,e,r,n,o,m)},u.prototype.SkipAttributeTransform=u.prototype.SkipAttributeTransform=function(e){var r=this.ptr;e&&typeof e=="object"&&(e=e.ptr),Pr(r,e)},u.prototype.GetEncodedGeometryType_Deprecated=u.prototype.GetEncodedGeometryType_Deprecated=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Rr(r,e)},u.prototype.DecodeBufferToPointCloud=u.prototype.DecodeBufferToPointCloud=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(Sr(n,e,r),v)},u.prototype.DecodeBufferToMesh=u.prototype.DecodeBufferToMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(Mr(n,e,r),v)},u.prototype.__destroy__=u.prototype.__destroy__=function(){Nr(this.ptr)},function(){function e(){t.ATTRIBUTE_INVALID_TRANSFORM=Ur(),t.ATTRIBUTE_NO_TRANSFORM=Fr(),t.ATTRIBUTE_QUANTIZATION_TRANSFORM=Lr(),t.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Cr(),t.INVALID=wr(),t.POSITION=zr(),t.NORMAL=Vr(),t.COLOR=Br(),t.TEX_COORD=Wr(),t.GENERIC=Qr(),t.INVALID_GEOMETRY_TYPE=xr(),t.POINT_CLOUD=Yr(),t.TRIANGULAR_MESH=Hr(),t.DT_INVALID=qr(),t.DT_INT8=kr(),t.DT_UINT8=Xr(),t.DT_INT16=Kr(),t.DT_UINT16=Jr(),t.DT_INT32=$r(),t.DT_UINT32=Zr(),t.DT_INT64=tn(),t.DT_UINT64=en(),t.DT_FLOAT32=rn(),t.DT_FLOAT64=nn(),t.DT_BOOL=on(),t.DT_TYPES_COUNT=_n(),t.OK=an(),t.DRACO_ERROR=pn(),t.IO_ERROR=un(),t.INVALID_PARAMETER=sn(),t.UNSUPPORTED_VERSION=cn(),t.UNKNOWN_VERSION=yn()}Rt?e():ct.unshift(e)}(),typeof t.onModuleParsed=="function"&&t.onModuleParsed(),t.Decoder.prototype.GetEncodedGeometryType=function(e){if(e.__class__&&e.__class__===t.DecoderBuffer)return t.Decoder.prototype.GetEncodedGeometryType_Deprecated(e);if(8>e.byteLength)return t.INVALID_GEOMETRY_TYPE;switch(e[7]){case 0:return t.POINT_CLOUD;case 1:return t.TRIANGULAR_MESH;default:return t.INVALID_GEOMETRY_TYPE}},c.ready}}();typeof nt=="object"&&typeof bt=="object"?bt.exports=dt:typeof define=="function"&&define.amd?define([],function(){return dt}):typeof nt=="object"&&(nt.DracoDecoderModule=dt)});export{Dn as a}; +import{a as fn,c as Tn}from"./chunk-LRNH5AEO.js";var Dn=Tn((nt,bt)=>{var _=_||{};_.scope={};_.arrayIteratorImpl=function(p){var c=0;return function(){return c<p.length?{done:!1,value:p[c++]}:{done:!0}}};_.arrayIterator=function(p){return{next:_.arrayIteratorImpl(p)}};_.makeIterator=function(p){var c=typeof Symbol<"u"&&Symbol.iterator&&p[Symbol.iterator];return c?c.call(p):_.arrayIterator(p)};_.ASSUME_ES5=!1;_.ASSUME_NO_NATIVE_MAP=!1;_.ASSUME_NO_NATIVE_SET=!1;_.SIMPLE_FROUND_POLYFILL=!1;_.ISOLATE_POLYFILLS=!1;_.FORCE_POLYFILL_PROMISE=!1;_.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;_.getGlobal=function(p){p=[typeof globalThis=="object"&&globalThis,p,typeof window=="object"&&window,typeof self=="object"&&self,typeof global=="object"&&global];for(var c=0;c<p.length;++c){var s=p[c];if(s&&s.Math==Math)return s}throw Error("Cannot find global object")};_.global=_.getGlobal(nt);_.defineProperty=_.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(p,c,s){return p==Array.prototype||p==Object.prototype||(p[c]=s.value),p};_.IS_SYMBOL_NATIVE=typeof Symbol=="function"&&typeof Symbol("x")=="symbol";_.TRUST_ES6_POLYFILLS=!_.ISOLATE_POLYFILLS||_.IS_SYMBOL_NATIVE;_.polyfills={};_.propertyToPolyfillSymbol={};_.POLYFILL_PREFIX="$jscp$";_.polyfill=function(p,c,s,y){c&&(_.ISOLATE_POLYFILLS?_.polyfillIsolated(p,c,s,y):_.polyfillUnisolated(p,c,s,y))};_.polyfillUnisolated=function(p,c,s,y){for(s=_.global,p=p.split("."),y=0;y<p.length-1;y++){var a=p[y];if(!(a in s))return;s=s[a]}p=p[p.length-1],y=s[p],c=c(y),c!=y&&c!=null&&_.defineProperty(s,p,{configurable:!0,writable:!0,value:c})};_.polyfillIsolated=function(p,c,s,y){var a=p.split(".");p=a.length===1,y=a[0],y=!p&&y in _.polyfills?_.polyfills:_.global;for(var g=0;g<a.length-1;g++){var i=a[g];if(!(i in y))return;y=y[i]}a=a[a.length-1],s=_.IS_SYMBOL_NATIVE&&s==="es6"?y[a]:null,c=c(s),c!=null&&(p?_.defineProperty(_.polyfills,a,{configurable:!0,writable:!0,value:c}):c!==s&&(_.propertyToPolyfillSymbol[a]===void 0&&(s=1e9*Math.random()>>>0,_.propertyToPolyfillSymbol[a]=_.IS_SYMBOL_NATIVE?_.global.Symbol(a):_.POLYFILL_PREFIX+s+"$"+a),_.defineProperty(y,_.propertyToPolyfillSymbol[a],{configurable:!0,writable:!0,value:c})))};_.polyfill("Promise",function(p){function c(){this.batch_=null}function s(i){return i instanceof a?i:new a(function(l,h){l(i)})}if(p&&(!(_.FORCE_POLYFILL_PROMISE||_.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&typeof _.global.PromiseRejectionEvent>"u")||!_.global.Promise||_.global.Promise.toString().indexOf("[native code]")===-1))return p;c.prototype.asyncExecute=function(i){if(this.batch_==null){this.batch_=[];var l=this;this.asyncExecuteFunction(function(){l.executeBatch_()})}this.batch_.push(i)};var y=_.global.setTimeout;c.prototype.asyncExecuteFunction=function(i){y(i,0)},c.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var i=this.batch_;this.batch_=[];for(var l=0;l<i.length;++l){var h=i[l];i[l]=null;try{h()}catch(I){this.asyncThrow_(I)}}}this.batch_=null},c.prototype.asyncThrow_=function(i){this.asyncExecuteFunction(function(){throw i})};var a=function(i){this.state_=0,this.result_=void 0,this.onSettledCallbacks_=[],this.isRejectionHandled_=!1;var l=this.createResolveAndReject_();try{i(l.resolve,l.reject)}catch(h){l.reject(h)}};a.prototype.createResolveAndReject_=function(){function i(I){return function(C){h||(h=!0,I.call(l,C))}}var l=this,h=!1;return{resolve:i(this.resolveTo_),reject:i(this.reject_)}},a.prototype.resolveTo_=function(i){if(i===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(i instanceof a)this.settleSameAsPromise_(i);else{t:switch(typeof i){case"object":var l=i!=null;break t;case"function":l=!0;break t;default:l=!1}l?this.resolveToNonPromiseObj_(i):this.fulfill_(i)}},a.prototype.resolveToNonPromiseObj_=function(i){var l=void 0;try{l=i.then}catch(h){this.reject_(h);return}typeof l=="function"?this.settleSameAsThenable_(l,i):this.fulfill_(i)},a.prototype.reject_=function(i){this.settle_(2,i)},a.prototype.fulfill_=function(i){this.settle_(1,i)},a.prototype.settle_=function(i,l){if(this.state_!=0)throw Error("Cannot settle("+i+", "+l+"): Promise already settled in state"+this.state_);this.state_=i,this.result_=l,this.state_===2&&this.scheduleUnhandledRejectionCheck_(),this.executeOnSettledCallbacks_()},a.prototype.scheduleUnhandledRejectionCheck_=function(){var i=this;y(function(){if(i.notifyUnhandledRejection_()){var l=_.global.console;typeof l<"u"&&l.error(i.result_)}},1)},a.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var i=_.global.CustomEvent,l=_.global.Event,h=_.global.dispatchEvent;return typeof h>"u"?!0:(typeof i=="function"?i=new i("unhandledrejection",{cancelable:!0}):typeof l=="function"?i=new l("unhandledrejection",{cancelable:!0}):(i=_.global.document.createEvent("CustomEvent"),i.initCustomEvent("unhandledrejection",!1,!0,i)),i.promise=this,i.reason=this.result_,h(i))},a.prototype.executeOnSettledCallbacks_=function(){if(this.onSettledCallbacks_!=null){for(var i=0;i<this.onSettledCallbacks_.length;++i)g.asyncExecute(this.onSettledCallbacks_[i]);this.onSettledCallbacks_=null}};var g=new c;return a.prototype.settleSameAsPromise_=function(i){var l=this.createResolveAndReject_();i.callWhenSettled_(l.resolve,l.reject)},a.prototype.settleSameAsThenable_=function(i,l){var h=this.createResolveAndReject_();try{i.call(l,h.resolve,h.reject)}catch(I){h.reject(I)}},a.prototype.then=function(i,l){function h(f,T){return typeof f=="function"?function(G){try{I(f(G))}catch(V){C(V)}}:T}var I,C,K=new a(function(f,T){I=f,C=T});return this.callWhenSettled_(h(i,I),h(l,C)),K},a.prototype.catch=function(i){return this.then(void 0,i)},a.prototype.callWhenSettled_=function(i,l){function h(){switch(I.state_){case 1:i(I.result_);break;case 2:l(I.result_);break;default:throw Error("Unexpected state: "+I.state_)}}var I=this;this.onSettledCallbacks_==null?g.asyncExecute(h):this.onSettledCallbacks_.push(h),this.isRejectionHandled_=!0},a.resolve=s,a.reject=function(i){return new a(function(l,h){h(i)})},a.race=function(i){return new a(function(l,h){for(var I=_.makeIterator(i),C=I.next();!C.done;C=I.next())s(C.value).callWhenSettled_(l,h)})},a.all=function(i){var l=_.makeIterator(i),h=l.next();return h.done?s([]):new a(function(I,C){function K(G){return function(V){f[G]=V,T--,T==0&&I(f)}}var f=[],T=0;do f.push(void 0),T++,s(h.value).callWhenSettled_(K(f.length-1),C),h=l.next();while(!h.done)})},a},"es6","es3");_.owns=function(p,c){return Object.prototype.hasOwnProperty.call(p,c)};_.assign=_.TRUST_ES6_POLYFILLS&&typeof Object.assign=="function"?Object.assign:function(p,c){for(var s=1;s<arguments.length;s++){var y=arguments[s];if(y)for(var a in y)_.owns(y,a)&&(p[a]=y[a])}return p};_.polyfill("Object.assign",function(p){return p||_.assign},"es6","es3");_.checkStringArgs=function(p,c,s){if(p==null)throw new TypeError("The 'this' value for String.prototype."+s+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+s+" must not be a regular expression");return p+""};_.polyfill("String.prototype.startsWith",function(p){return p||function(c,s){var y=_.checkStringArgs(this,c,"startsWith");c+="";var a=y.length,g=c.length;s=Math.max(0,Math.min(s|0,y.length));for(var i=0;i<g&&s<a;)if(y[s++]!=c[i++])return!1;return i>=g}},"es6","es3");_.polyfill("Array.prototype.copyWithin",function(p){function c(s){return s=Number(s),s===1/0||s===-1/0?s:s|0}return p||function(s,y,a){var g=this.length;if(s=c(s),y=c(y),a=a===void 0?g:c(a),s=0>s?Math.max(g+s,0):Math.min(s,g),y=0>y?Math.max(g+y,0):Math.min(y,g),a=0>a?Math.max(g+a,0):Math.min(a,g),s<y)for(;y<a;)y in this?this[s++]=this[y++]:(delete this[s++],y++);else for(a=Math.min(a,g+y-s),s+=a-y;a>y;)--a in this?this[--s]=this[a]:delete this[--s];return this}},"es6","es3");_.typedArrayCopyWithin=function(p){return p||Array.prototype.copyWithin};_.polyfill("Int8Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint8Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint8ClampedArray.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Int16Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint16Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Int32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Float32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Float64Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");var dt=function(){var p=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(p=p||__filename),function(c){function s(e){return t.locateFile?t.locateFile(e,Q):Q+e}function y(e,r,n){var o=r+n;for(n=r;e[n]&&!(n>=o);)++n;if(16<n-r&&e.buffer&&Ot)return Ot.decode(e.subarray(r,n));for(o="";r<n;){var m=e[r++];if(m&128){var b=e[r++]&63;if((m&224)==192)o+=String.fromCharCode((m&31)<<6|b);else{var X=e[r++]&63;m=(m&240)==224?(m&15)<<12|b<<6|X:(m&7)<<18|b<<12|X<<6|e[r++]&63,65536>m?o+=String.fromCharCode(m):(m-=65536,o+=String.fromCharCode(55296|m>>10,56320|m&1023))}}else o+=String.fromCharCode(m)}return o}function a(e,r){return e?y(tt,e,r):""}function g(){var e=_t.buffer;t.HEAP8=q=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=et=new Int32Array(e),t.HEAPU8=tt=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=x=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}function i(e){throw t.onAbort&&t.onAbort(e),e="Aborted("+e+")",J(e),Gt=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),ot(e),e}function l(e){try{if(e==z&&Z)return new Uint8Array(Z);if(ut)return ut(e);throw"both async and sync fetching of the wasm failed"}catch(r){i(r)}}function h(){if(!Z&&(It||$)){if(typeof fetch=="function"&&!z.startsWith("file://"))return fetch(z,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+z+"'";return e.arrayBuffer()}).catch(function(){return l(z)});if(st)return new Promise(function(e,r){st(z,function(n){e(new Uint8Array(n))},r)})}return Promise.resolve().then(function(){return l(z)})}function I(e){for(;0<e.length;)e.shift()(t)}function C(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(r){x[this.ptr+4>>2]=r},this.get_type=function(){return x[this.ptr+4>>2]},this.set_destructor=function(r){x[this.ptr+8>>2]=r},this.get_destructor=function(){return x[this.ptr+8>>2]},this.set_refcount=function(r){et[this.ptr>>2]=r},this.set_caught=function(r){q[this.ptr+12>>0]=r?1:0},this.get_caught=function(){return q[this.ptr+12>>0]!=0},this.set_rethrown=function(r){q[this.ptr+13>>0]=r?1:0},this.get_rethrown=function(){return q[this.ptr+13>>0]!=0},this.init=function(r,n){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){et[this.ptr>>2]+=1},this.release_ref=function(){var r=et[this.ptr>>2];return et[this.ptr>>2]=r-1,r===1},this.set_adjusted_ptr=function(r){x[this.ptr+16>>2]=r},this.get_adjusted_ptr=function(){return x[this.ptr+16>>2]},this.get_exception_ptr=function(){if(ln(this.get_type()))return x[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function K(){function e(){if(!it&&(it=!0,t.calledRun=!0,!Gt)){if(Rt=!0,I(ct),ht(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Pt.unshift(t.postRun.shift());I(Pt)}}if(!(0<k)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)jt.unshift(t.preRun.shift());I(jt),0<k||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e())}}function f(){}function T(e){return(e||f).__cache__}function G(e,r){var n=T(r),o=n[e];return o||(o=Object.create((r||f).prototype),o.ptr=e,n[e]=o)}function V(e){if(typeof e=="string"){for(var r=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);127>=o?r++:2047>=o?r+=2:55296<=o&&57343>=o?(r+=4,++n):r+=3}if(r=Array(r+1),n=0,o=r.length,0<o){o=n+o-1;for(var m=0;m<e.length;++m){var b=e.charCodeAt(m);if(55296<=b&&57343>=b){var X=e.charCodeAt(++m);b=65536+((b&1023)<<10)|X&1023}if(127>=b){if(n>=o)break;r[n++]=b}else{if(2047>=b){if(n+1>=o)break;r[n++]=192|b>>6}else{if(65535>=b){if(n+2>=o)break;r[n++]=224|b>>12}else{if(n+3>=o)break;r[n++]=240|b>>18,r[n++]=128|b>>12&63}r[n++]=128|b>>6&63}r[n++]=128|b&63}}r[n]=0}return e=d.alloc(r,q),d.copy(r,q,e),e}return e}function at(e){if(typeof e=="object"){var r=d.alloc(e,q);return d.copy(e,q,r),r}return e}function H(){throw"cannot construct a VoidPtr, no constructor in IDL"}function B(){this.ptr=Mt(),T(B)[this.ptr]=this}function w(){this.ptr=Ft(),T(w)[this.ptr]=this}function Y(){this.ptr=wt(),T(Y)[this.ptr]=this}function A(){this.ptr=Vt(),T(A)[this.ptr]=this}function E(){this.ptr=Jt(),T(E)[this.ptr]=this}function j(){this.ptr=ne(),T(j)[this.ptr]=this}function P(){this.ptr=ae(),T(P)[this.ptr]=this}function O(){this.ptr=ce(),T(O)[this.ptr]=this}function W(){this.ptr=de(),T(W)[this.ptr]=this}function v(){throw"cannot construct a Status, no constructor in IDL"}function R(){this.ptr=Ie(),T(R)[this.ptr]=this}function S(){this.ptr=Ge(),T(S)[this.ptr]=this}function M(){this.ptr=Re(),T(M)[this.ptr]=this}function N(){this.ptr=Ue(),T(N)[this.ptr]=this}function U(){this.ptr=we(),T(U)[this.ptr]=this}function F(){this.ptr=We(),T(F)[this.ptr]=this}function L(){this.ptr=He(),T(L)[this.ptr]=this}function D(){this.ptr=Ke(),T(D)[this.ptr]=this}function u(){this.ptr=_r(),T(u)[this.ptr]=this}c=c===void 0?{}:c;var t=typeof c<"u"?c:{},ht,ot;t.ready=new Promise(function(e,r){ht=e,ot=r});var At=!1,Tt=!1;t.onRuntimeInitialized=function(){At=!0,Tt&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.onModuleParsed=function(){Tt=!0,At&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.isVersionSupported=function(e){return typeof e!="string"?!1:(e=e.split("."),2>e.length||3<e.length?!1:e[0]==1&&0<=e[1]&&5>=e[1]?!0:!(e[0]!=0||10<e[1]))};var Dt=Object.assign({},t),It=typeof window=="object",$=typeof importScripts=="function",gt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Q="";if(gt){var vt=fn("fs"),pt=fn("path");Q=$?pt.dirname(Q)+"/":__dirname+"/";var Et=function(e,r){return e=e.startsWith("file://")?new URL(e):pt.normalize(e),vt.readFileSync(e,r?void 0:"utf8")},ut=function(e){return e=Et(e,!0),e.buffer||(e=new Uint8Array(e)),e},st=function(e,r,n){e=e.startsWith("file://")?new URL(e):pt.normalize(e),vt.readFile(e,function(o,m){o?n(o):r(m.buffer)})};1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),t.inspect=function(){return"[Emscripten Module object]"}}else(It||$)&&($?Q=self.location.href:typeof document<"u"&&document.currentScript&&(Q=document.currentScript.src),p&&(Q=p),Q=Q.indexOf("blob:")!==0?Q.substr(0,Q.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Et=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},$&&(ut=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),st=function(e,r,n){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){o.status==200||o.status==0&&o.response?r(o.response):n()},o.onerror=n,o.send(null)});var dn=t.print||console.log.bind(console),J=t.printErr||console.warn.bind(console);Object.assign(t,Dt),Dt=null;var Z;t.wasmBinary&&(Z=t.wasmBinary),typeof WebAssembly!="object"&&i("no native wasm support detected");var _t,Gt=!1,Ot=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,q,tt,et,x,jt=[],ct=[],Pt=[],Rt=!1,k=0,yt=null,rt=null,z="draco_decoder.wasm";z.startsWith("data:application/octet-stream;base64,")||(z=s(z));var bn=0,hn=[null,[],[]],An={b:function(e,r,n){throw new C(e).init(r,n),bn++,e},a:function(){i("")},g:function(e,r,n){tt.copyWithin(e,r,r+n)},e:function(e){var r=tt.length;if(e>>>=0,2147483648<e)return!1;for(var n=1;4>=n;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var m=Math;o=Math.max(e,o),m=m.min.call(m,2147483648,o+(65536-o%65536)%65536);t:{o=_t.buffer;try{_t.grow(m-o.byteLength+65535>>>16),g();var b=1;break t}catch{}b=void 0}if(b)return!0}return!1},f:function(e){return 52},d:function(e,r,n,o,m){return 70},c:function(e,r,n,o){for(var m=0,b=0;b<n;b++){var X=x[r>>2],mn=x[r+4>>2];r+=8;for(var lt=0;lt<mn;lt++){var mt=tt[X+lt],ft=hn[e];mt===0||mt===10?((e===1?dn:J)(y(ft,0)),ft.length=0):ft.push(mt)}m+=mn}return x[o>>2]=m,0}};(function(){function e(m,b){t.asm=m.exports,_t=t.asm.h,g(),ct.unshift(t.asm.i),k--,t.monitorRunDependencies&&t.monitorRunDependencies(k),k==0&&(yt!==null&&(clearInterval(yt),yt=null),rt&&(m=rt,rt=null,m()))}function r(m){e(m.instance)}function n(m){return h().then(function(b){return WebAssembly.instantiate(b,o)}).then(function(b){return b}).then(m,function(b){J("failed to asynchronously prepare wasm: "+b),i(b)})}var o={a:An};if(k++,t.monitorRunDependencies&&t.monitorRunDependencies(k),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(m){J("Module.instantiateWasm callback failed with error: "+m),ot(m)}return function(){return Z||typeof WebAssembly.instantiateStreaming!="function"||z.startsWith("data:application/octet-stream;base64,")||z.startsWith("file://")||gt||typeof fetch!="function"?n(r):fetch(z,{credentials:"same-origin"}).then(function(m){return WebAssembly.instantiateStreaming(m,o).then(r,function(b){return J("wasm streaming compile failed: "+b),J("falling back to ArrayBuffer instantiation"),n(r)})})}().catch(ot),{}})();var St=t._emscripten_bind_VoidPtr___destroy___0=function(){return(St=t._emscripten_bind_VoidPtr___destroy___0=t.asm.k).apply(null,arguments)},Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return(Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=t.asm.l).apply(null,arguments)},Nt=t._emscripten_bind_DecoderBuffer_Init_2=function(){return(Nt=t._emscripten_bind_DecoderBuffer_Init_2=t.asm.m).apply(null,arguments)},Ut=t._emscripten_bind_DecoderBuffer___destroy___0=function(){return(Ut=t._emscripten_bind_DecoderBuffer___destroy___0=t.asm.n).apply(null,arguments)},Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=function(){return(Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=t.asm.o).apply(null,arguments)},Lt=t._emscripten_bind_AttributeTransformData_transform_type_0=function(){return(Lt=t._emscripten_bind_AttributeTransformData_transform_type_0=t.asm.p).apply(null,arguments)},Ct=t._emscripten_bind_AttributeTransformData___destroy___0=function(){return(Ct=t._emscripten_bind_AttributeTransformData___destroy___0=t.asm.q).apply(null,arguments)},wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return(wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=t.asm.r).apply(null,arguments)},zt=t._emscripten_bind_GeometryAttribute___destroy___0=function(){return(zt=t._emscripten_bind_GeometryAttribute___destroy___0=t.asm.s).apply(null,arguments)},Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=function(){return(Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=t.asm.t).apply(null,arguments)},Bt=t._emscripten_bind_PointAttribute_size_0=function(){return(Bt=t._emscripten_bind_PointAttribute_size_0=t.asm.u).apply(null,arguments)},Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return(Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=t.asm.v).apply(null,arguments)},Qt=t._emscripten_bind_PointAttribute_attribute_type_0=function(){return(Qt=t._emscripten_bind_PointAttribute_attribute_type_0=t.asm.w).apply(null,arguments)},xt=t._emscripten_bind_PointAttribute_data_type_0=function(){return(xt=t._emscripten_bind_PointAttribute_data_type_0=t.asm.x).apply(null,arguments)},Yt=t._emscripten_bind_PointAttribute_num_components_0=function(){return(Yt=t._emscripten_bind_PointAttribute_num_components_0=t.asm.y).apply(null,arguments)},Ht=t._emscripten_bind_PointAttribute_normalized_0=function(){return(Ht=t._emscripten_bind_PointAttribute_normalized_0=t.asm.z).apply(null,arguments)},qt=t._emscripten_bind_PointAttribute_byte_stride_0=function(){return(qt=t._emscripten_bind_PointAttribute_byte_stride_0=t.asm.A).apply(null,arguments)},kt=t._emscripten_bind_PointAttribute_byte_offset_0=function(){return(kt=t._emscripten_bind_PointAttribute_byte_offset_0=t.asm.B).apply(null,arguments)},Xt=t._emscripten_bind_PointAttribute_unique_id_0=function(){return(Xt=t._emscripten_bind_PointAttribute_unique_id_0=t.asm.C).apply(null,arguments)},Kt=t._emscripten_bind_PointAttribute___destroy___0=function(){return(Kt=t._emscripten_bind_PointAttribute___destroy___0=t.asm.D).apply(null,arguments)},Jt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return(Jt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=t.asm.E).apply(null,arguments)},$t=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return($t=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=t.asm.F).apply(null,arguments)},Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return(Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=t.asm.G).apply(null,arguments)},te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return(te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=t.asm.H).apply(null,arguments)},ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return(ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=t.asm.I).apply(null,arguments)},re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return(re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=t.asm.J).apply(null,arguments)},ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return(ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=t.asm.K).apply(null,arguments)},oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return(oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=t.asm.L).apply(null,arguments)},_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return(_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=t.asm.M).apply(null,arguments)},ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return(ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=t.asm.N).apply(null,arguments)},ae=t._emscripten_bind_PointCloud_PointCloud_0=function(){return(ae=t._emscripten_bind_PointCloud_PointCloud_0=t.asm.O).apply(null,arguments)},pe=t._emscripten_bind_PointCloud_num_attributes_0=function(){return(pe=t._emscripten_bind_PointCloud_num_attributes_0=t.asm.P).apply(null,arguments)},ue=t._emscripten_bind_PointCloud_num_points_0=function(){return(ue=t._emscripten_bind_PointCloud_num_points_0=t.asm.Q).apply(null,arguments)},se=t._emscripten_bind_PointCloud___destroy___0=function(){return(se=t._emscripten_bind_PointCloud___destroy___0=t.asm.R).apply(null,arguments)},ce=t._emscripten_bind_Mesh_Mesh_0=function(){return(ce=t._emscripten_bind_Mesh_Mesh_0=t.asm.S).apply(null,arguments)},ye=t._emscripten_bind_Mesh_num_faces_0=function(){return(ye=t._emscripten_bind_Mesh_num_faces_0=t.asm.T).apply(null,arguments)},le=t._emscripten_bind_Mesh_num_attributes_0=function(){return(le=t._emscripten_bind_Mesh_num_attributes_0=t.asm.U).apply(null,arguments)},me=t._emscripten_bind_Mesh_num_points_0=function(){return(me=t._emscripten_bind_Mesh_num_points_0=t.asm.V).apply(null,arguments)},fe=t._emscripten_bind_Mesh___destroy___0=function(){return(fe=t._emscripten_bind_Mesh___destroy___0=t.asm.W).apply(null,arguments)},de=t._emscripten_bind_Metadata_Metadata_0=function(){return(de=t._emscripten_bind_Metadata_Metadata_0=t.asm.X).apply(null,arguments)},be=t._emscripten_bind_Metadata___destroy___0=function(){return(be=t._emscripten_bind_Metadata___destroy___0=t.asm.Y).apply(null,arguments)},he=t._emscripten_bind_Status_code_0=function(){return(he=t._emscripten_bind_Status_code_0=t.asm.Z).apply(null,arguments)},Ae=t._emscripten_bind_Status_ok_0=function(){return(Ae=t._emscripten_bind_Status_ok_0=t.asm._).apply(null,arguments)},Te=t._emscripten_bind_Status_error_msg_0=function(){return(Te=t._emscripten_bind_Status_error_msg_0=t.asm.$).apply(null,arguments)},De=t._emscripten_bind_Status___destroy___0=function(){return(De=t._emscripten_bind_Status___destroy___0=t.asm.aa).apply(null,arguments)},Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return(Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=t.asm.ba).apply(null,arguments)},ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return(ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=t.asm.ca).apply(null,arguments)},ve=t._emscripten_bind_DracoFloat32Array_size_0=function(){return(ve=t._emscripten_bind_DracoFloat32Array_size_0=t.asm.da).apply(null,arguments)},Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=function(){return(Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=t.asm.ea).apply(null,arguments)},Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return(Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=t.asm.fa).apply(null,arguments)},Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=function(){return(Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=t.asm.ga).apply(null,arguments)},je=t._emscripten_bind_DracoInt8Array_size_0=function(){return(je=t._emscripten_bind_DracoInt8Array_size_0=t.asm.ha).apply(null,arguments)},Pe=t._emscripten_bind_DracoInt8Array___destroy___0=function(){return(Pe=t._emscripten_bind_DracoInt8Array___destroy___0=t.asm.ia).apply(null,arguments)},Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return(Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=t.asm.ja).apply(null,arguments)},Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return(Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=t.asm.ka).apply(null,arguments)},Me=t._emscripten_bind_DracoUInt8Array_size_0=function(){return(Me=t._emscripten_bind_DracoUInt8Array_size_0=t.asm.la).apply(null,arguments)},Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=function(){return(Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=t.asm.ma).apply(null,arguments)},Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return(Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=t.asm.na).apply(null,arguments)},Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=function(){return(Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=t.asm.oa).apply(null,arguments)},Le=t._emscripten_bind_DracoInt16Array_size_0=function(){return(Le=t._emscripten_bind_DracoInt16Array_size_0=t.asm.pa).apply(null,arguments)},Ce=t._emscripten_bind_DracoInt16Array___destroy___0=function(){return(Ce=t._emscripten_bind_DracoInt16Array___destroy___0=t.asm.qa).apply(null,arguments)},we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return(we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=t.asm.ra).apply(null,arguments)},ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return(ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=t.asm.sa).apply(null,arguments)},Ve=t._emscripten_bind_DracoUInt16Array_size_0=function(){return(Ve=t._emscripten_bind_DracoUInt16Array_size_0=t.asm.ta).apply(null,arguments)},Be=t._emscripten_bind_DracoUInt16Array___destroy___0=function(){return(Be=t._emscripten_bind_DracoUInt16Array___destroy___0=t.asm.ua).apply(null,arguments)},We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return(We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=t.asm.va).apply(null,arguments)},Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=function(){return(Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=t.asm.wa).apply(null,arguments)},xe=t._emscripten_bind_DracoInt32Array_size_0=function(){return(xe=t._emscripten_bind_DracoInt32Array_size_0=t.asm.xa).apply(null,arguments)},Ye=t._emscripten_bind_DracoInt32Array___destroy___0=function(){return(Ye=t._emscripten_bind_DracoInt32Array___destroy___0=t.asm.ya).apply(null,arguments)},He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return(He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=t.asm.za).apply(null,arguments)},qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return(qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=t.asm.Aa).apply(null,arguments)},ke=t._emscripten_bind_DracoUInt32Array_size_0=function(){return(ke=t._emscripten_bind_DracoUInt32Array_size_0=t.asm.Ba).apply(null,arguments)},Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=function(){return(Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=t.asm.Ca).apply(null,arguments)},Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return(Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=t.asm.Da).apply(null,arguments)},Je=t._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return(Je=t._emscripten_bind_MetadataQuerier_HasEntry_2=t.asm.Ea).apply(null,arguments)},$e=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return($e=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=t.asm.Fa).apply(null,arguments)},Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=function(){return(Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=t.asm.Ga).apply(null,arguments)},tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return(tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=t.asm.Ha).apply(null,arguments)},er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return(er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=t.asm.Ia).apply(null,arguments)},rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return(rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=t.asm.Ja).apply(null,arguments)},nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return(nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=t.asm.Ka).apply(null,arguments)},or=t._emscripten_bind_MetadataQuerier___destroy___0=function(){return(or=t._emscripten_bind_MetadataQuerier___destroy___0=t.asm.La).apply(null,arguments)},_r=t._emscripten_bind_Decoder_Decoder_0=function(){return(_r=t._emscripten_bind_Decoder_Decoder_0=t.asm.Ma).apply(null,arguments)},ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=function(){return(ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=t.asm.Na).apply(null,arguments)},ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=function(){return(ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=t.asm.Oa).apply(null,arguments)},pr=t._emscripten_bind_Decoder_GetAttributeId_2=function(){return(pr=t._emscripten_bind_Decoder_GetAttributeId_2=t.asm.Pa).apply(null,arguments)},ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return(ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=t.asm.Qa).apply(null,arguments)},sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return(sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=t.asm.Ra).apply(null,arguments)},cr=t._emscripten_bind_Decoder_GetAttribute_2=function(){return(cr=t._emscripten_bind_Decoder_GetAttribute_2=t.asm.Sa).apply(null,arguments)},yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return(yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=t.asm.Ta).apply(null,arguments)},lr=t._emscripten_bind_Decoder_GetMetadata_1=function(){return(lr=t._emscripten_bind_Decoder_GetMetadata_1=t.asm.Ua).apply(null,arguments)},mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return(mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=t.asm.Va).apply(null,arguments)},fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return(fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=t.asm.Wa).apply(null,arguments)},dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return(dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=t.asm.Xa).apply(null,arguments)},br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return(br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=t.asm.Ya).apply(null,arguments)},hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=function(){return(hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=t.asm.Za).apply(null,arguments)},Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return(Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=t.asm._a).apply(null,arguments)},Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return(Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=t.asm.$a).apply(null,arguments)},Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return(Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=t.asm.ab).apply(null,arguments)},Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return(Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=t.asm.bb).apply(null,arguments)},gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return(gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=t.asm.cb).apply(null,arguments)},vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return(vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=t.asm.db).apply(null,arguments)},Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return(Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=t.asm.eb).apply(null,arguments)},Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return(Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=t.asm.fb).apply(null,arguments)},Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return(Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=t.asm.gb).apply(null,arguments)},jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return(jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=t.asm.hb).apply(null,arguments)},Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return(Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=t.asm.ib).apply(null,arguments)},Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=function(){return(Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=t.asm.jb).apply(null,arguments)},Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return(Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=t.asm.kb).apply(null,arguments)},Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return(Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=t.asm.lb).apply(null,arguments)},Nr=t._emscripten_bind_Decoder___destroy___0=function(){return(Nr=t._emscripten_bind_Decoder___destroy___0=t.asm.mb).apply(null,arguments)},Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return(Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=t.asm.nb).apply(null,arguments)},Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return(Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=t.asm.ob).apply(null,arguments)},Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return(Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=t.asm.pb).apply(null,arguments)},Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return(Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=t.asm.qb).apply(null,arguments)},wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return(wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=t.asm.rb).apply(null,arguments)},zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return(zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=t.asm.sb).apply(null,arguments)},Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return(Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=t.asm.tb).apply(null,arguments)},Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return(Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=t.asm.ub).apply(null,arguments)},Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return(Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=t.asm.vb).apply(null,arguments)},Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return(Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=t.asm.wb).apply(null,arguments)},xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return(xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=t.asm.xb).apply(null,arguments)},Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return(Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=t.asm.yb).apply(null,arguments)},Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return(Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=t.asm.zb).apply(null,arguments)},qr=t._emscripten_enum_draco_DataType_DT_INVALID=function(){return(qr=t._emscripten_enum_draco_DataType_DT_INVALID=t.asm.Ab).apply(null,arguments)},kr=t._emscripten_enum_draco_DataType_DT_INT8=function(){return(kr=t._emscripten_enum_draco_DataType_DT_INT8=t.asm.Bb).apply(null,arguments)},Xr=t._emscripten_enum_draco_DataType_DT_UINT8=function(){return(Xr=t._emscripten_enum_draco_DataType_DT_UINT8=t.asm.Cb).apply(null,arguments)},Kr=t._emscripten_enum_draco_DataType_DT_INT16=function(){return(Kr=t._emscripten_enum_draco_DataType_DT_INT16=t.asm.Db).apply(null,arguments)},Jr=t._emscripten_enum_draco_DataType_DT_UINT16=function(){return(Jr=t._emscripten_enum_draco_DataType_DT_UINT16=t.asm.Eb).apply(null,arguments)},$r=t._emscripten_enum_draco_DataType_DT_INT32=function(){return($r=t._emscripten_enum_draco_DataType_DT_INT32=t.asm.Fb).apply(null,arguments)},Zr=t._emscripten_enum_draco_DataType_DT_UINT32=function(){return(Zr=t._emscripten_enum_draco_DataType_DT_UINT32=t.asm.Gb).apply(null,arguments)},tn=t._emscripten_enum_draco_DataType_DT_INT64=function(){return(tn=t._emscripten_enum_draco_DataType_DT_INT64=t.asm.Hb).apply(null,arguments)},en=t._emscripten_enum_draco_DataType_DT_UINT64=function(){return(en=t._emscripten_enum_draco_DataType_DT_UINT64=t.asm.Ib).apply(null,arguments)},rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return(rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=t.asm.Jb).apply(null,arguments)},nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return(nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=t.asm.Kb).apply(null,arguments)},on=t._emscripten_enum_draco_DataType_DT_BOOL=function(){return(on=t._emscripten_enum_draco_DataType_DT_BOOL=t.asm.Lb).apply(null,arguments)},_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return(_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=t.asm.Mb).apply(null,arguments)},an=t._emscripten_enum_draco_StatusCode_OK=function(){return(an=t._emscripten_enum_draco_StatusCode_OK=t.asm.Nb).apply(null,arguments)},pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return(pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=t.asm.Ob).apply(null,arguments)},un=t._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return(un=t._emscripten_enum_draco_StatusCode_IO_ERROR=t.asm.Pb).apply(null,arguments)},sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return(sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=t.asm.Qb).apply(null,arguments)},cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return(cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=t.asm.Rb).apply(null,arguments)},yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return(yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=t.asm.Sb).apply(null,arguments)};t._malloc=function(){return(t._malloc=t.asm.Tb).apply(null,arguments)},t._free=function(){return(t._free=t.asm.Ub).apply(null,arguments)};var ln=function(){return(ln=t.asm.Vb).apply(null,arguments)};t.___start_em_js=15856,t.___stop_em_js=15954;var it;if(rt=function e(){it||K(),it||(rt=e)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();K(),f.prototype=Object.create(f.prototype),f.prototype.constructor=f,f.prototype.__class__=f,f.__cache__={},t.WrapperObject=f,t.getCache=T,t.wrapPointer=G,t.castObject=function(e,r){return G(e.ptr,r)},t.NULL=G(0),t.destroy=function(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete T(e.__class__)[e.ptr]},t.compare=function(e,r){return e.ptr===r.ptr},t.getPointer=function(e){return e.ptr},t.getClass=function(e){return e.__class__};var d={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(d.needed){for(var e=0;e<d.temps.length;e++)t._free(d.temps[e]);d.temps.length=0,t._free(d.buffer),d.buffer=0,d.size+=d.needed,d.needed=0}d.buffer||(d.size+=128,d.buffer=t._malloc(d.size),d.buffer||i(void 0)),d.pos=0},alloc:function(e,r){return d.buffer||i(void 0),e=e.length*r.BYTES_PER_ELEMENT,e=e+7&-8,d.pos+e>=d.size?(0<e||i(void 0),d.needed+=e,r=t._malloc(e),d.temps.push(r)):(r=d.buffer+d.pos,d.pos+=e),r},copy:function(e,r,n){switch(n>>>=0,r.BYTES_PER_ELEMENT){case 2:n>>>=1;break;case 4:n>>>=2;break;case 8:n>>>=3}for(var o=0;o<e.length;o++)r[n+o]=e[o]}};return H.prototype=Object.create(f.prototype),H.prototype.constructor=H,H.prototype.__class__=H,H.__cache__={},t.VoidPtr=H,H.prototype.__destroy__=H.prototype.__destroy__=function(){St(this.ptr)},B.prototype=Object.create(f.prototype),B.prototype.constructor=B,B.prototype.__class__=B,B.__cache__={},t.DecoderBuffer=B,B.prototype.Init=B.prototype.Init=function(e,r){var n=this.ptr;d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),Nt(n,e,r)},B.prototype.__destroy__=B.prototype.__destroy__=function(){Ut(this.ptr)},w.prototype=Object.create(f.prototype),w.prototype.constructor=w,w.prototype.__class__=w,w.__cache__={},t.AttributeTransformData=w,w.prototype.transform_type=w.prototype.transform_type=function(){return Lt(this.ptr)},w.prototype.__destroy__=w.prototype.__destroy__=function(){Ct(this.ptr)},Y.prototype=Object.create(f.prototype),Y.prototype.constructor=Y,Y.prototype.__class__=Y,Y.__cache__={},t.GeometryAttribute=Y,Y.prototype.__destroy__=Y.prototype.__destroy__=function(){zt(this.ptr)},A.prototype=Object.create(f.prototype),A.prototype.constructor=A,A.prototype.__class__=A,A.__cache__={},t.PointAttribute=A,A.prototype.size=A.prototype.size=function(){return Bt(this.ptr)},A.prototype.GetAttributeTransformData=A.prototype.GetAttributeTransformData=function(){return G(Wt(this.ptr),w)},A.prototype.attribute_type=A.prototype.attribute_type=function(){return Qt(this.ptr)},A.prototype.data_type=A.prototype.data_type=function(){return xt(this.ptr)},A.prototype.num_components=A.prototype.num_components=function(){return Yt(this.ptr)},A.prototype.normalized=A.prototype.normalized=function(){return!!Ht(this.ptr)},A.prototype.byte_stride=A.prototype.byte_stride=function(){return qt(this.ptr)},A.prototype.byte_offset=A.prototype.byte_offset=function(){return kt(this.ptr)},A.prototype.unique_id=A.prototype.unique_id=function(){return Xt(this.ptr)},A.prototype.__destroy__=A.prototype.__destroy__=function(){Kt(this.ptr)},E.prototype=Object.create(f.prototype),E.prototype.constructor=E,E.prototype.__class__=E,E.__cache__={},t.AttributeQuantizationTransform=E,E.prototype.InitFromAttribute=E.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!$t(r,e)},E.prototype.quantization_bits=E.prototype.quantization_bits=function(){return Zt(this.ptr)},E.prototype.min_value=E.prototype.min_value=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),te(r,e)},E.prototype.range=E.prototype.range=function(){return ee(this.ptr)},E.prototype.__destroy__=E.prototype.__destroy__=function(){re(this.ptr)},j.prototype=Object.create(f.prototype),j.prototype.constructor=j,j.prototype.__class__=j,j.__cache__={},t.AttributeOctahedronTransform=j,j.prototype.InitFromAttribute=j.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!oe(r,e)},j.prototype.quantization_bits=j.prototype.quantization_bits=function(){return _e(this.ptr)},j.prototype.__destroy__=j.prototype.__destroy__=function(){ie(this.ptr)},P.prototype=Object.create(f.prototype),P.prototype.constructor=P,P.prototype.__class__=P,P.__cache__={},t.PointCloud=P,P.prototype.num_attributes=P.prototype.num_attributes=function(){return pe(this.ptr)},P.prototype.num_points=P.prototype.num_points=function(){return ue(this.ptr)},P.prototype.__destroy__=P.prototype.__destroy__=function(){se(this.ptr)},O.prototype=Object.create(f.prototype),O.prototype.constructor=O,O.prototype.__class__=O,O.__cache__={},t.Mesh=O,O.prototype.num_faces=O.prototype.num_faces=function(){return ye(this.ptr)},O.prototype.num_attributes=O.prototype.num_attributes=function(){return le(this.ptr)},O.prototype.num_points=O.prototype.num_points=function(){return me(this.ptr)},O.prototype.__destroy__=O.prototype.__destroy__=function(){fe(this.ptr)},W.prototype=Object.create(f.prototype),W.prototype.constructor=W,W.prototype.__class__=W,W.__cache__={},t.Metadata=W,W.prototype.__destroy__=W.prototype.__destroy__=function(){be(this.ptr)},v.prototype=Object.create(f.prototype),v.prototype.constructor=v,v.prototype.__class__=v,v.__cache__={},t.Status=v,v.prototype.code=v.prototype.code=function(){return he(this.ptr)},v.prototype.ok=v.prototype.ok=function(){return!!Ae(this.ptr)},v.prototype.error_msg=v.prototype.error_msg=function(){return a(Te(this.ptr))},v.prototype.__destroy__=v.prototype.__destroy__=function(){De(this.ptr)},R.prototype=Object.create(f.prototype),R.prototype.constructor=R,R.prototype.__class__=R,R.__cache__={},t.DracoFloat32Array=R,R.prototype.GetValue=R.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ge(r,e)},R.prototype.size=R.prototype.size=function(){return ve(this.ptr)},R.prototype.__destroy__=R.prototype.__destroy__=function(){Ee(this.ptr)},S.prototype=Object.create(f.prototype),S.prototype.constructor=S,S.prototype.__class__=S,S.__cache__={},t.DracoInt8Array=S,S.prototype.GetValue=S.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Oe(r,e)},S.prototype.size=S.prototype.size=function(){return je(this.ptr)},S.prototype.__destroy__=S.prototype.__destroy__=function(){Pe(this.ptr)},M.prototype=Object.create(f.prototype),M.prototype.constructor=M,M.prototype.__class__=M,M.__cache__={},t.DracoUInt8Array=M,M.prototype.GetValue=M.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Se(r,e)},M.prototype.size=M.prototype.size=function(){return Me(this.ptr)},M.prototype.__destroy__=M.prototype.__destroy__=function(){Ne(this.ptr)},N.prototype=Object.create(f.prototype),N.prototype.constructor=N,N.prototype.__class__=N,N.__cache__={},t.DracoInt16Array=N,N.prototype.GetValue=N.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Fe(r,e)},N.prototype.size=N.prototype.size=function(){return Le(this.ptr)},N.prototype.__destroy__=N.prototype.__destroy__=function(){Ce(this.ptr)},U.prototype=Object.create(f.prototype),U.prototype.constructor=U,U.prototype.__class__=U,U.__cache__={},t.DracoUInt16Array=U,U.prototype.GetValue=U.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ze(r,e)},U.prototype.size=U.prototype.size=function(){return Ve(this.ptr)},U.prototype.__destroy__=U.prototype.__destroy__=function(){Be(this.ptr)},F.prototype=Object.create(f.prototype),F.prototype.constructor=F,F.prototype.__class__=F,F.__cache__={},t.DracoInt32Array=F,F.prototype.GetValue=F.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Qe(r,e)},F.prototype.size=F.prototype.size=function(){return xe(this.ptr)},F.prototype.__destroy__=F.prototype.__destroy__=function(){Ye(this.ptr)},L.prototype=Object.create(f.prototype),L.prototype.constructor=L,L.prototype.__class__=L,L.__cache__={},t.DracoUInt32Array=L,L.prototype.GetValue=L.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),qe(r,e)},L.prototype.size=L.prototype.size=function(){return ke(this.ptr)},L.prototype.__destroy__=L.prototype.__destroy__=function(){Xe(this.ptr)},D.prototype=Object.create(f.prototype),D.prototype.constructor=D,D.prototype.__class__=D,D.__cache__={},t.MetadataQuerier=D,D.prototype.HasEntry=D.prototype.HasEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),!!Je(n,e,r)},D.prototype.GetIntEntry=D.prototype.GetIntEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),$e(n,e,r)},D.prototype.GetIntEntryArray=D.prototype.GetIntEntryArray=function(e,r,n){var o=this.ptr;d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),n&&typeof n=="object"&&(n=n.ptr),Ze(o,e,r,n)},D.prototype.GetDoubleEntry=D.prototype.GetDoubleEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),tr(n,e,r)},D.prototype.GetStringEntry=D.prototype.GetStringEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),a(er(n,e,r))},D.prototype.NumEntries=D.prototype.NumEntries=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),rr(r,e)},D.prototype.GetEntryName=D.prototype.GetEntryName=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),a(nr(n,e,r))},D.prototype.__destroy__=D.prototype.__destroy__=function(){or(this.ptr)},u.prototype=Object.create(f.prototype),u.prototype.constructor=u,u.prototype.__class__=u,u.__cache__={},t.Decoder=u,u.prototype.DecodeArrayToPointCloud=u.prototype.DecodeArrayToPointCloud=function(e,r,n){var o=this.ptr;return d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),G(ir(o,e,r,n),v)},u.prototype.DecodeArrayToMesh=u.prototype.DecodeArrayToMesh=function(e,r,n){var o=this.ptr;return d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),G(ar(o,e,r,n),v)},u.prototype.GetAttributeId=u.prototype.GetAttributeId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),pr(n,e,r)},u.prototype.GetAttributeIdByName=u.prototype.GetAttributeIdByName=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),ur(n,e,r)},u.prototype.GetAttributeIdByMetadataEntry=u.prototype.GetAttributeIdByMetadataEntry=function(e,r,n){var o=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),n=n&&typeof n=="object"?n.ptr:V(n),sr(o,e,r,n)},u.prototype.GetAttribute=u.prototype.GetAttribute=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(cr(n,e,r),A)},u.prototype.GetAttributeByUniqueId=u.prototype.GetAttributeByUniqueId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(yr(n,e,r),A)},u.prototype.GetMetadata=u.prototype.GetMetadata=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),G(lr(r,e),W)},u.prototype.GetAttributeMetadata=u.prototype.GetAttributeMetadata=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(mr(n,e,r),W)},u.prototype.GetFaceFromMesh=u.prototype.GetFaceFromMesh=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!fr(o,e,r,n)},u.prototype.GetTriangleStripsFromMesh=u.prototype.GetTriangleStripsFromMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),dr(n,e,r)},u.prototype.GetTrianglesUInt16Array=u.prototype.GetTrianglesUInt16Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!br(o,e,r,n)},u.prototype.GetTrianglesUInt32Array=u.prototype.GetTrianglesUInt32Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!hr(o,e,r,n)},u.prototype.GetAttributeFloat=u.prototype.GetAttributeFloat=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ar(o,e,r,n)},u.prototype.GetAttributeFloatForAllPoints=u.prototype.GetAttributeFloatForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Tr(o,e,r,n)},u.prototype.GetAttributeIntForAllPoints=u.prototype.GetAttributeIntForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Dr(o,e,r,n)},u.prototype.GetAttributeInt8ForAllPoints=u.prototype.GetAttributeInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ir(o,e,r,n)},u.prototype.GetAttributeUInt8ForAllPoints=u.prototype.GetAttributeUInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!gr(o,e,r,n)},u.prototype.GetAttributeInt16ForAllPoints=u.prototype.GetAttributeInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!vr(o,e,r,n)},u.prototype.GetAttributeUInt16ForAllPoints=u.prototype.GetAttributeUInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Er(o,e,r,n)},u.prototype.GetAttributeInt32ForAllPoints=u.prototype.GetAttributeInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Gr(o,e,r,n)},u.prototype.GetAttributeUInt32ForAllPoints=u.prototype.GetAttributeUInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Or(o,e,r,n)},u.prototype.GetAttributeDataArrayForAllPoints=u.prototype.GetAttributeDataArrayForAllPoints=function(e,r,n,o,m){var b=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),o&&typeof o=="object"&&(o=o.ptr),m&&typeof m=="object"&&(m=m.ptr),!!jr(b,e,r,n,o,m)},u.prototype.SkipAttributeTransform=u.prototype.SkipAttributeTransform=function(e){var r=this.ptr;e&&typeof e=="object"&&(e=e.ptr),Pr(r,e)},u.prototype.GetEncodedGeometryType_Deprecated=u.prototype.GetEncodedGeometryType_Deprecated=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Rr(r,e)},u.prototype.DecodeBufferToPointCloud=u.prototype.DecodeBufferToPointCloud=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(Sr(n,e,r),v)},u.prototype.DecodeBufferToMesh=u.prototype.DecodeBufferToMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(Mr(n,e,r),v)},u.prototype.__destroy__=u.prototype.__destroy__=function(){Nr(this.ptr)},function(){function e(){t.ATTRIBUTE_INVALID_TRANSFORM=Ur(),t.ATTRIBUTE_NO_TRANSFORM=Fr(),t.ATTRIBUTE_QUANTIZATION_TRANSFORM=Lr(),t.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Cr(),t.INVALID=wr(),t.POSITION=zr(),t.NORMAL=Vr(),t.COLOR=Br(),t.TEX_COORD=Wr(),t.GENERIC=Qr(),t.INVALID_GEOMETRY_TYPE=xr(),t.POINT_CLOUD=Yr(),t.TRIANGULAR_MESH=Hr(),t.DT_INVALID=qr(),t.DT_INT8=kr(),t.DT_UINT8=Xr(),t.DT_INT16=Kr(),t.DT_UINT16=Jr(),t.DT_INT32=$r(),t.DT_UINT32=Zr(),t.DT_INT64=tn(),t.DT_UINT64=en(),t.DT_FLOAT32=rn(),t.DT_FLOAT64=nn(),t.DT_BOOL=on(),t.DT_TYPES_COUNT=_n(),t.OK=an(),t.DRACO_ERROR=pn(),t.IO_ERROR=un(),t.INVALID_PARAMETER=sn(),t.UNSUPPORTED_VERSION=cn(),t.UNKNOWN_VERSION=yn()}Rt?e():ct.unshift(e)}(),typeof t.onModuleParsed=="function"&&t.onModuleParsed(),t.Decoder.prototype.GetEncodedGeometryType=function(e){if(e.__class__&&e.__class__===t.DecoderBuffer)return t.Decoder.prototype.GetEncodedGeometryType_Deprecated(e);if(8>e.byteLength)return t.INVALID_GEOMETRY_TYPE;switch(e[7]){case 0:return t.POINT_CLOUD;case 1:return t.TRIANGULAR_MESH;default:return t.INVALID_GEOMETRY_TYPE}},c.ready}}();typeof nt=="object"&&typeof bt=="object"?bt.exports=dt:typeof define=="function"&&define.amd?define([],function(){return dt}):typeof nt=="object"&&(nt.DracoDecoderModule=dt)});export{Dn as a}; diff --git a/public/js/Cesium2/Workers/chunk-HTYD62GU.js b/public/js/Cesium2/Workers/chunk-V7BDYEN7.js similarity index 93% rename from public/js/Cesium2/Workers/chunk-HTYD62GU.js rename to public/js/Cesium2/Workers/chunk-V7BDYEN7.js index 77ffa7fc7..2d4906714 100644 --- a/public/js/Cesium2/Workers/chunk-HTYD62GU.js +++ b/public/js/Cesium2/Workers/chunk-V7BDYEN7.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as R}from"./chunk-HQ4YU6WD.js";import{a as st}from"./chunk-72CGGEJF.js";import{a as Z,b as H}from"./chunk-WJYW7YDO.js";import{a as V}from"./chunk-GJI4ZBKE.js";import{a as U}from"./chunk-RDAVO5OM.js";import{b as it}from"./chunk-PY4CW263.js";import{a as ct}from"./chunk-RRZIPF5C.js";import{a as ot}from"./chunk-34ULWVZF.js";import{a as nt}from"./chunk-24JYWT5N.js";import{b as J,c as X,d as z}from"./chunk-LH3SUUXG.js";import{f as K}from"./chunk-M3A6SPGI.js";import{a as k}from"./chunk-D5HNP2LB.js";import{a as w,b as q,c as M,d as et,e as F}from"./chunk-S4VBGY2U.js";import{a as I}from"./chunk-UCTPWOTZ.js";import{a as tt}from"./chunk-N3A5CZ2S.js";import{e as x}from"./chunk-3THTQ4QB.js";function dt(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var rt=dt;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,c=[n];for(;c.length>0;){let r=c.pop();if(!x(r))continue;u+=2;let a=r.positions,t=r.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)c.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,c){let r=[n];for(;r.length>0;){let a=r.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let s=0;s<e;++s,u+=c.packedLength)c.pack(t[s],i,u)}if(x(o)){let e=o.length;for(let s=0;s<e;++s)r.push(o[s])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let c=n[i++],r=n[i++],a=new Array(c),t=r>0?new Array(r):void 0;for(let o=0;o<c;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<r;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function ht(n,i,u,c){return M.subtract(i,n,O),M.multiplyByScalar(O,u/c,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,c){return w.subtract(i,n,G),w.multiplyByScalar(G,u/c,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let r=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(r)));return Math.pow(2,a)};var j=new q,Q=new q,pt=new q,mt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,c){let r=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(r,a,n).surfaceDistance/c,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,c,r,a){let t=b.subdivideLineCount(u,c,r),o=M.distance(n,i),e=o/t,s=a;s.length=t*2;let l=0;for(let h=0;h<t;h++){let f=ht(n,i,h*e,o);s[l++]=f[0],s[l++]=f[1]}return s};b.subdivideLine=function(n,i,u,c){let r=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/r;x(c)||(c=[]);let o=c;o.length=r*3;let e=0;for(let s=0;s<r;s++){let l=gt(n,i,s*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,c,r,a,t){let o=u.cartesianToCartographic(c,j),e=u.cartesianToCartographic(r,Q);Y.setEndPoints(o,e);let s=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(s))),h=Math.pow(2,l),f=M.distance(n,i),g=f/h,m=t;m.length=h*2;let p=0;for(let d=0;d<h;d++){let y=ht(n,i,d*g,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,c,r){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n),e=o.surfaceDistance/c,s=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,s),h=o.surfaceDistance/l;x(r)||(r=[]);let f=r;f.length=l*3;let g=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,pt),d=n.cartographicToCartesian(p,mt);f[g++]=d.x,f[g++]=d.y,f[g++]=d.z}return f};var yt=new w,xt=new w,wt=new w,bt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,c,r){c=tt(c,et.default);let a=yt,t=xt,o=wt,e=bt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let s=n.attributes.position.values,l=s.length/2;for(let h=0;h<l;h+=3)w.fromArray(s,h,o),c.geodeticSurfaceNormal(o,a),e=c.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),s[h+l]=t.x,s[h+1+l]=t.y,s[h+2+l]=t.z,r&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),s[h]=t.x,s[h+1]=t.y,s[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let c=[],r=new $;r.enqueue(n);let a,t,o;for(;r.length!==0;){let e=r.dequeue(),s=e.positions;if(i)for(o=s.length,a=0;a<o;a++)u.scaleToGeodeticSurface(s[a],s[a]);if(s=V(s,w.equalsEpsilon,!0),s.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;c.push(f);let g=0;for(x(h.holes)&&(g=h.holes.length),t=0;t<g;t++)r.enqueue(h.holes[t])}c.push(s)}return c};var Lt=new q;function Tt(n,i,u){let c=u.cartesianToCartographic(n,j),r=u.cartesianToCartographic(i,Q);if(Math.sign(c.latitude)===Math.sign(r.latitude))return;Y.setEndPoints(c,r);let a=Y.findIntersectionWithLatitude(0,Lt);if(!x(a))return;let t=Math.min(c.longitude,r.longitude),o=Math.max(c.longitude,r.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Et(n,i,u,c){if(c===R.RHUMB)return Tt(n,i,u);let r=it.lineSegmentPlane(n,i,ct.ORIGIN_XY_PLANE);if(x(r))return u.scaleToGeodeticSurface(r,r)}var vt=new q;function Ct(n,i,u){let c=[],r,a,t,o,e,s=0;for(;s<n.length;){r=n[s],a=n[(s+1)%n.length],t=I.sign(r.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,vt).longitude;if(t===0)c.push({position:s,type:t,visited:!1,next:o,theta:l(r)});else if(o!==0){if(e=Et(r,a,i,u),++s,!x(e))continue;n.splice(s,0,e),c.push({position:s,type:t,visited:!1,next:o,theta:l(e)})}++s}return c}function lt(n,i,u,c,r,a,t){let o=[],e=a,s=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=c.findIndex(s(e)),g=c[f];if(!x(g)){++e;continue}let{visited:m,type:p,next:d}=g;if(g.visited=!0,p===0){if(d===0){let C=c[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&d>0||a===e&&!t&&d<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=c[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,r,o);for(let h of l)i=lt(n,++i,u,c,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,c){x(c)||(c=[]),c.splice(0,0,...n),c.length=n.length;let r=0;for(;r<c.length;){let a=c[r],t=a.slice();if(a.length<3){c[r]=t,++r;continue}let o=Ct(t,i,u);if(t.length===a.length||o.length<=1){c[r]=t,++r;continue}o.sort((s,l)=>s.theta-l.theta);let e=t[0].z>=0;r=lt(c,r,t,o,1,0,e)}return c};b.polygonsFromHierarchy=function(n,i,u,c,r,a){let t=[],o=[],e=new $;e.enqueue(n);let s=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,g,m;if(c)for(m=h.length,g=0;g<m;g++)r.scaleToGeodeticSurface(h[g],h[g]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let d=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),s){s=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new rt(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(g=0;g<_;g++){let P=f[g],v=P.positions;if(c)for(m=v.length,T=0;T<m;++T)r.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),d.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:d})}return{hierarchy:t,polygons:o}};var Pt=new M,Dt=new w,It=new K,_t=new F;b.computeBoundingRectangle=function(n,i,u,c,r){let a=K.fromAxisAngle(n,c,It),t=F.fromQuaternion(a,_t),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let g=w.clone(u[f],Dt);F.multiplyByVector(t,g,g);let m=i(g,Pt);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),s=Math.min(s,m.y),l=Math.max(l,m.y))}return r.x=o,r.y=s,r.width=e-o,r.height=l-s,r};b.createGeometryFromPositions=function(n,i,u,c,r,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,s=x(u),l=s?u.positions:void 0;if(r){let h=e.length,f=new Array(h*3),g=0;for(let d=0;d<h;d++){let y=e[d];f[g++]=y.x,f[g++]=y.y,f[g++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};s&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?st.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,c);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,c)};var ut=[],at=[],At=new w,Mt=new w;b.computeWallGeometry=function(n,i,u,c,r,a){let t,o,e,s,l,h,f,g,m,p=n.length,d=0,y=0,L=x(i),_=L?i.positions:void 0;if(r)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,g=new Array(m*2)),e=0;e<p;e++)s=n[e],l=n[(e+1)%p],t[d]=t[d+o]=s.x,++d,t[d]=t[d+o]=s.y,++d,t[d]=t[d+o]=s.z,++d,t[d]=t[d+o]=l.x,++d,t[d]=t[d+o]=l.y,++d,t[d]=t[d+o]=l.z,++d,L&&(h=_[e],f=_[(e+1)%p],g[y]=g[y+m]=h.x,++y,g[y]=g[y+m]=h.y,++y,g[y]=g[y+m]=f.x,++y,g[y]=g[y+m]=f.y,++y);else{let E=I.chordLength(c,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,g=new Array(m*2)),e=0;e<p;e++){s=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(s,l,E,at),L&&(N=b.subdivideTexcoordLine(h,f,s,l,E,ut))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,s,l,E,at),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,s,l,E,ut)));let ft=A.length;for(let B=0;B<ft;++B,++d)t[d]=A[B],t[d+o]=A[B];if(t[d]=l.x,t[d+o]=l.x,++d,t[d]=l.y,t[d+o]=l.y,++d,t[d]=l.z,t[d+o]=l.z,++d,L){let B=N.length;for(let W=0;W<B;++W,++y)g[y]=N[W],g[y+m]=N[W];g[y]=f.x,g[y+m]=f.x,++y,g[y]=f.y,g[y+m]=f.y,++y}}}p=t.length;let C=ot.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;s=w.fromArray(t,E*3,At),l=w.fromArray(t,D*3,Mt),!w.equalsEpsilon(s,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new nt({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:g})),new X(P)};var se=b;export{se as a}; +import{a as R}from"./chunk-GMMUK6QU.js";import{a as st}from"./chunk-FG3CL3AH.js";import{a as Z,b as H}from"./chunk-ZMGESOEZ.js";import{a as V}from"./chunk-OKWGJEQO.js";import{a as U}from"./chunk-ZBEWS6NN.js";import{b as it}from"./chunk-V7XARCCV.js";import{a as ct}from"./chunk-SACP225T.js";import{a as ot}from"./chunk-YFQNY2YN.js";import{a as nt}from"./chunk-NT26NNVH.js";import{b as J,c as X,d as z}from"./chunk-NW2YE576.js";import{f as K}from"./chunk-7YEOLR2L.js";import{a as k}from"./chunk-QHHYYTCM.js";import{a as w,b as q,c as M,d as et,e as F}from"./chunk-RH3GFHG2.js";import{a as I}from"./chunk-FRWNWNYJ.js";import{a as tt}from"./chunk-TA3RE4KQ.js";import{e as x}from"./chunk-LRNH5AEO.js";function dt(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var rt=dt;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,c=[n];for(;c.length>0;){let r=c.pop();if(!x(r))continue;u+=2;let a=r.positions,t=r.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)c.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,c){let r=[n];for(;r.length>0;){let a=r.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let s=0;s<e;++s,u+=c.packedLength)c.pack(t[s],i,u)}if(x(o)){let e=o.length;for(let s=0;s<e;++s)r.push(o[s])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let c=n[i++],r=n[i++],a=new Array(c),t=r>0?new Array(r):void 0;for(let o=0;o<c;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<r;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function ht(n,i,u,c){return M.subtract(i,n,O),M.multiplyByScalar(O,u/c,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,c){return w.subtract(i,n,G),w.multiplyByScalar(G,u/c,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let r=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(r)));return Math.pow(2,a)};var j=new q,Q=new q,pt=new q,mt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,c){let r=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(r,a,n).surfaceDistance/c,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,c,r,a){let t=b.subdivideLineCount(u,c,r),o=M.distance(n,i),e=o/t,s=a;s.length=t*2;let l=0;for(let h=0;h<t;h++){let f=ht(n,i,h*e,o);s[l++]=f[0],s[l++]=f[1]}return s};b.subdivideLine=function(n,i,u,c){let r=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/r;x(c)||(c=[]);let o=c;o.length=r*3;let e=0;for(let s=0;s<r;s++){let l=gt(n,i,s*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,c,r,a,t){let o=u.cartesianToCartographic(c,j),e=u.cartesianToCartographic(r,Q);Y.setEndPoints(o,e);let s=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(s))),h=Math.pow(2,l),f=M.distance(n,i),g=f/h,m=t;m.length=h*2;let p=0;for(let d=0;d<h;d++){let y=ht(n,i,d*g,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,c,r){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n),e=o.surfaceDistance/c,s=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,s),h=o.surfaceDistance/l;x(r)||(r=[]);let f=r;f.length=l*3;let g=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,pt),d=n.cartographicToCartesian(p,mt);f[g++]=d.x,f[g++]=d.y,f[g++]=d.z}return f};var yt=new w,xt=new w,wt=new w,bt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,c,r){c=tt(c,et.default);let a=yt,t=xt,o=wt,e=bt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let s=n.attributes.position.values,l=s.length/2;for(let h=0;h<l;h+=3)w.fromArray(s,h,o),c.geodeticSurfaceNormal(o,a),e=c.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),s[h+l]=t.x,s[h+1+l]=t.y,s[h+2+l]=t.z,r&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),s[h]=t.x,s[h+1]=t.y,s[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let c=[],r=new $;r.enqueue(n);let a,t,o;for(;r.length!==0;){let e=r.dequeue(),s=e.positions;if(i)for(o=s.length,a=0;a<o;a++)u.scaleToGeodeticSurface(s[a],s[a]);if(s=V(s,w.equalsEpsilon,!0),s.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;c.push(f);let g=0;for(x(h.holes)&&(g=h.holes.length),t=0;t<g;t++)r.enqueue(h.holes[t])}c.push(s)}return c};var Lt=new q;function Tt(n,i,u){let c=u.cartesianToCartographic(n,j),r=u.cartesianToCartographic(i,Q);if(Math.sign(c.latitude)===Math.sign(r.latitude))return;Y.setEndPoints(c,r);let a=Y.findIntersectionWithLatitude(0,Lt);if(!x(a))return;let t=Math.min(c.longitude,r.longitude),o=Math.max(c.longitude,r.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Et(n,i,u,c){if(c===R.RHUMB)return Tt(n,i,u);let r=it.lineSegmentPlane(n,i,ct.ORIGIN_XY_PLANE);if(x(r))return u.scaleToGeodeticSurface(r,r)}var vt=new q;function Ct(n,i,u){let c=[],r,a,t,o,e,s=0;for(;s<n.length;){r=n[s],a=n[(s+1)%n.length],t=I.sign(r.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,vt).longitude;if(t===0)c.push({position:s,type:t,visited:!1,next:o,theta:l(r)});else if(o!==0){if(e=Et(r,a,i,u),++s,!x(e))continue;n.splice(s,0,e),c.push({position:s,type:t,visited:!1,next:o,theta:l(e)})}++s}return c}function lt(n,i,u,c,r,a,t){let o=[],e=a,s=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=c.findIndex(s(e)),g=c[f];if(!x(g)){++e;continue}let{visited:m,type:p,next:d}=g;if(g.visited=!0,p===0){if(d===0){let C=c[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&d>0||a===e&&!t&&d<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=c[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,r,o);for(let h of l)i=lt(n,++i,u,c,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,c){x(c)||(c=[]),c.splice(0,0,...n),c.length=n.length;let r=0;for(;r<c.length;){let a=c[r],t=a.slice();if(a.length<3){c[r]=t,++r;continue}let o=Ct(t,i,u);if(t.length===a.length||o.length<=1){c[r]=t,++r;continue}o.sort((s,l)=>s.theta-l.theta);let e=t[0].z>=0;r=lt(c,r,t,o,1,0,e)}return c};b.polygonsFromHierarchy=function(n,i,u,c,r,a){let t=[],o=[],e=new $;e.enqueue(n);let s=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,g,m;if(c)for(m=h.length,g=0;g<m;g++)r.scaleToGeodeticSurface(h[g],h[g]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let d=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),s){s=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new rt(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(g=0;g<_;g++){let P=f[g],v=P.positions;if(c)for(m=v.length,T=0;T<m;++T)r.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),d.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:d})}return{hierarchy:t,polygons:o}};var Pt=new M,Dt=new w,It=new K,_t=new F;b.computeBoundingRectangle=function(n,i,u,c,r){let a=K.fromAxisAngle(n,c,It),t=F.fromQuaternion(a,_t),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let g=w.clone(u[f],Dt);F.multiplyByVector(t,g,g);let m=i(g,Pt);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),s=Math.min(s,m.y),l=Math.max(l,m.y))}return r.x=o,r.y=s,r.width=e-o,r.height=l-s,r};b.createGeometryFromPositions=function(n,i,u,c,r,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,s=x(u),l=s?u.positions:void 0;if(r){let h=e.length,f=new Array(h*3),g=0;for(let d=0;d<h;d++){let y=e[d];f[g++]=y.x,f[g++]=y.y,f[g++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};s&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?st.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,c);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,c)};var ut=[],at=[],At=new w,Mt=new w;b.computeWallGeometry=function(n,i,u,c,r,a){let t,o,e,s,l,h,f,g,m,p=n.length,d=0,y=0,L=x(i),_=L?i.positions:void 0;if(r)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,g=new Array(m*2)),e=0;e<p;e++)s=n[e],l=n[(e+1)%p],t[d]=t[d+o]=s.x,++d,t[d]=t[d+o]=s.y,++d,t[d]=t[d+o]=s.z,++d,t[d]=t[d+o]=l.x,++d,t[d]=t[d+o]=l.y,++d,t[d]=t[d+o]=l.z,++d,L&&(h=_[e],f=_[(e+1)%p],g[y]=g[y+m]=h.x,++y,g[y]=g[y+m]=h.y,++y,g[y]=g[y+m]=f.x,++y,g[y]=g[y+m]=f.y,++y);else{let E=I.chordLength(c,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,g=new Array(m*2)),e=0;e<p;e++){s=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(s,l,E,at),L&&(N=b.subdivideTexcoordLine(h,f,s,l,E,ut))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,s,l,E,at),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,s,l,E,ut)));let ft=A.length;for(let B=0;B<ft;++B,++d)t[d]=A[B],t[d+o]=A[B];if(t[d]=l.x,t[d+o]=l.x,++d,t[d]=l.y,t[d+o]=l.y,++d,t[d]=l.z,t[d+o]=l.z,++d,L){let B=N.length;for(let W=0;W<B;++W,++y)g[y]=N[W],g[y+m]=N[W];g[y]=f.x,g[y+m]=f.x,++y,g[y]=f.y,g[y+m]=f.y,++y}}}p=t.length;let C=ot.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;s=w.fromArray(t,E*3,At),l=w.fromArray(t,D*3,Mt),!w.equalsEpsilon(s,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new nt({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:g})),new X(P)};var se=b;export{se as a}; diff --git a/public/js/Cesium2/Workers/chunk-PY4CW263.js b/public/js/Cesium2/Workers/chunk-V7XARCCV.js similarity index 97% rename from public/js/Cesium2/Workers/chunk-PY4CW263.js rename to public/js/Cesium2/Workers/chunk-V7XARCCV.js index c81b83256..6dcb4b8b8 100644 --- a/public/js/Cesium2/Workers/chunk-PY4CW263.js +++ b/public/js/Cesium2/Workers/chunk-V7XARCCV.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{c as Z}from"./chunk-K2M3OJ7Z.js";import{a as o,b as ft,e as b}from"./chunk-S4VBGY2U.js";import{a as R}from"./chunk-UCTPWOTZ.js";import{a as H}from"./chunk-N3A5CZ2S.js";import{a as w,b as et}from"./chunk-G75U3WZT.js";import{e as g}from"./chunk-3THTQ4QB.js";var nt={};nt.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function mt(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}nt.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=mt(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*mt(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=nt;var ot={};ot.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function rt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,d=s*s,p=i*s-l,q=i*u-c*s,m=c*u-d,h=4*p*m-q*q,E,D;if(h<0){let X,k,G;l*f>=a*d?(X=i,k=p,G=-2*c*p+i*q):(X=u,k=m,G=-u*q+2*s*m);let at=-(G<0?-1:1)*Math.abs(X)*Math.sqrt(-h);D=-G+at;let $=D/2,j=$<0?-Math.pow(-$,1/3):Math.pow($,1/3),tt=D===at?-j:-k/j;return E=k<=0?j+tt:-G/(j*j+tt*tt+k),l*f>=a*d?[(E-c)/i]:[-u/(E+s)]}let W=p,V=-2*c*p+i*q,L=m,B=-u*q+2*s*m,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-V)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,v=_/A,yt=N*A,ut=-M*A-N*_,bt=M*_,U=(s*ut-c*bt)/(-c*ut+s*yt);return x<=U?x<=v?U<=v?[x,U,v]:[x,v,U]:[v,x,U]:x<=v?[U,x,v]:U<=v?[U,v,x]:[v,U,x]}ot.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return rt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):rt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return rt(t,e,r,n)};var F=ot;var it={};it.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,d=n*n,p=d*n,q=i*i,m=q*i;return u*f*d-4*a*p-4*t*l*d+18*t*e*r*p-27*c*d*d+256*s*m+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*d+144*c*r*d)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=F.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let d=T.computeRealRoots(1,c,u);if(d.length===2){let p=d[0],q=d[1],m;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return m=Math.sqrt(p),[f-m,f+m];if(p<0&&q>=0)return m=Math.sqrt(q),[f-m,f+m]}}return[]}else if(l>0){let d=Math.sqrt(l),p=(c+l-s/d)/2,q=(c+l+s/d)/2,m=T.computeRealRoots(1,d,p),h=T.computeRealRoots(1,-d,q);return m.length!==0?(m[0]+=f,m[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,m[1]<=h[0]?[m[0],m[1],h[0],h[1]]:h[1]<=m[0]?[h[0],h[1],m[0],m[1]]:m[0]>=h[0]&&m[1]<=h[1]?[h[0],m[0],m[1],h[1]]:h[0]>=m[0]&&h[1]<=m[1]?[m[0],h[0],h[1],m[1]]:m[0]>h[0]&&m[0]<h[1]?[h[0],m[0],h[1],m[1]]:[m[0],h[0],m[1],h[1]]):m):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function Y(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=F.computeRealRoots(1,u,a,f);if(l.length>0){let d=l[0],p=e-d,q=p*p,m=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*d,V=s+4*Math.abs(d),L,B;if(d<0||E*V<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;m===0&&L===0?(I=0,C=0):R.sign(m)===R.sign(L)?(I=m+L,C=d/I):(C=m-L,I=d/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}it.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return F.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return Y(c,s,u,a);case 2:return Y(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return Y(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return Y(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return Y(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=it;function J(t,e){e=o.clone(H(e,o.ZERO)),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(H(t,o.ZERO)),this.direction=e}J.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new J(t.origin,t.direction)};J.getPoint=function(t,e,r){return et.typeOf.object("ray",t),et.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var st=J;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var Ot=new o,Pt=new o,Mt=new o,lt=new o,ht=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=H(i,!1);let c=t.origin,s=t.direction,u=o.subtract(r,e,Ot),a=o.subtract(n,e,Pt),f=o.cross(s,a,Mt),l=o.dot(u,f),d,p,q,m,h;if(i){if(l<R.EPSILON6||(d=o.subtract(c,e,lt),q=o.dot(d,f),q<0||q>l)||(p=o.cross(d,u,ht),m=o.dot(s,p),m<0||q+m>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(d=o.subtract(c,e,lt),q=o.dot(d,f)*E,q<0||q>1||(p=o.cross(d,u,ht),m=o.dot(s,p)*E,m<0||q+m>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Et=new st;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Et;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Ct(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Nt={root0:0,root1:0};function Rt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,Mt),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,d=Ct(a,f,l,Nt);if(g(d))return r.start=d.root0,r.stop=d.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Rt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Lt=new st;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Lt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Rt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var It=new o,Dt=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,It),i=o.multiplyComponents(r,t.direction,Dt),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,d;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,d=-s+Math.sqrt(l);let m=d/a,h=u/d;return m<h?new Z(m,h):{start:h,stop:m}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,d=-s+Math.sqrt(l),new Z(0,d/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),d=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(d===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let m=d*d,h=l*l,E=u*u,D=d*l,W=E+h,V=2*(a*u+D),L=2*f*u+a*a-h+m,B=2*(f*a-D),I=f*f-m;if(W===0&&V===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,V,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,d,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var ct=new o,wt=new o,qt=new o,K=new o,Bt=new o,xt=new b,Tt=new b,zt=new b,Wt=new b,Vt=new b,gt=new b,pt=new b,St=new o,vt=new o,Ut=new ft;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,ct);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,ct),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,K),a=o.normalize(o.cross(u,s,wt),wt),f=o.normalize(o.cross(s,a,qt),qt),l=xt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let d=b.transpose(l,Tt),p=b.fromScale(e.radii,zt),q=b.fromScale(e.oneOverRadii,Wt),m=Vt;m[0]=0,m[1]=-n.z,m[2]=n.y,m[3]=n.z,m[4]=0,m[5]=-n.x,m[6]=-n.y,m[7]=n.x,m[8]=0;let h=b.multiply(b.multiply(d,q,gt),m,gt),E=b.multiply(b.multiply(h,p,pt),l,pt),D=b.multiplyByVector(h,r,Bt),W=O.quadraticVectorExpression(E,o.negate(D,ct),0,0,1),V,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){V=b.multiplyByVector(p,b.multiplyByVector(l,W[y],St),St);let S=o.normalize(o.subtract(V,r,K),K),M=o.dot(S,n);M>C&&(C=M,I=o.clone(V,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,K))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Qt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Qt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,d;if((f===1||f===2)&&(l=new o,d=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,d),{positions:[t,e,r,l,d],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,d),{positions:[t,e,r,l,d],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,d),{positions:[t,e,r,l,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,d),{positions:[t,e,r,l,d],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,d),{positions:[t,e,r,l,d],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,d),{positions:[t,e,r,l,d],indices:[1,2,4,1,4,3,0,3,4]}};var we=O;export{st as a,we as b}; +import{c as Z}from"./chunk-2NIQ5ECB.js";import{a as o,b as ft,e as b}from"./chunk-RH3GFHG2.js";import{a as R}from"./chunk-FRWNWNYJ.js";import{a as H}from"./chunk-TA3RE4KQ.js";import{a as w,b as et}from"./chunk-RTY3VPG6.js";import{e as g}from"./chunk-LRNH5AEO.js";var nt={};nt.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function mt(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}nt.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=mt(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*mt(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=nt;var ot={};ot.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function rt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,d=s*s,p=i*s-l,q=i*u-c*s,m=c*u-d,h=4*p*m-q*q,E,D;if(h<0){let X,k,G;l*f>=a*d?(X=i,k=p,G=-2*c*p+i*q):(X=u,k=m,G=-u*q+2*s*m);let at=-(G<0?-1:1)*Math.abs(X)*Math.sqrt(-h);D=-G+at;let $=D/2,j=$<0?-Math.pow(-$,1/3):Math.pow($,1/3),tt=D===at?-j:-k/j;return E=k<=0?j+tt:-G/(j*j+tt*tt+k),l*f>=a*d?[(E-c)/i]:[-u/(E+s)]}let W=p,V=-2*c*p+i*q,L=m,B=-u*q+2*s*m,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-V)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,v=_/A,yt=N*A,ut=-M*A-N*_,bt=M*_,U=(s*ut-c*bt)/(-c*ut+s*yt);return x<=U?x<=v?U<=v?[x,U,v]:[x,v,U]:[v,x,U]:x<=v?[U,x,v]:U<=v?[U,v,x]:[v,U,x]}ot.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return rt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):rt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return rt(t,e,r,n)};var F=ot;var it={};it.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,d=n*n,p=d*n,q=i*i,m=q*i;return u*f*d-4*a*p-4*t*l*d+18*t*e*r*p-27*c*d*d+256*s*m+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*d+144*c*r*d)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=F.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let d=T.computeRealRoots(1,c,u);if(d.length===2){let p=d[0],q=d[1],m;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return m=Math.sqrt(p),[f-m,f+m];if(p<0&&q>=0)return m=Math.sqrt(q),[f-m,f+m]}}return[]}else if(l>0){let d=Math.sqrt(l),p=(c+l-s/d)/2,q=(c+l+s/d)/2,m=T.computeRealRoots(1,d,p),h=T.computeRealRoots(1,-d,q);return m.length!==0?(m[0]+=f,m[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,m[1]<=h[0]?[m[0],m[1],h[0],h[1]]:h[1]<=m[0]?[h[0],h[1],m[0],m[1]]:m[0]>=h[0]&&m[1]<=h[1]?[h[0],m[0],m[1],h[1]]:h[0]>=m[0]&&h[1]<=m[1]?[m[0],h[0],h[1],m[1]]:m[0]>h[0]&&m[0]<h[1]?[h[0],m[0],h[1],m[1]]:[m[0],h[0],m[1],h[1]]):m):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function Y(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=F.computeRealRoots(1,u,a,f);if(l.length>0){let d=l[0],p=e-d,q=p*p,m=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*d,V=s+4*Math.abs(d),L,B;if(d<0||E*V<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;m===0&&L===0?(I=0,C=0):R.sign(m)===R.sign(L)?(I=m+L,C=d/I):(C=m-L,I=d/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}it.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return F.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return Y(c,s,u,a);case 2:return Y(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return Y(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return Y(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return Y(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=it;function J(t,e){e=o.clone(H(e,o.ZERO)),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(H(t,o.ZERO)),this.direction=e}J.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new J(t.origin,t.direction)};J.getPoint=function(t,e,r){return et.typeOf.object("ray",t),et.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var st=J;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var Ot=new o,Pt=new o,Mt=new o,lt=new o,ht=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=H(i,!1);let c=t.origin,s=t.direction,u=o.subtract(r,e,Ot),a=o.subtract(n,e,Pt),f=o.cross(s,a,Mt),l=o.dot(u,f),d,p,q,m,h;if(i){if(l<R.EPSILON6||(d=o.subtract(c,e,lt),q=o.dot(d,f),q<0||q>l)||(p=o.cross(d,u,ht),m=o.dot(s,p),m<0||q+m>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(d=o.subtract(c,e,lt),q=o.dot(d,f)*E,q<0||q>1||(p=o.cross(d,u,ht),m=o.dot(s,p)*E,m<0||q+m>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Et=new st;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Et;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Ct(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Nt={root0:0,root1:0};function Rt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,Mt),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,d=Ct(a,f,l,Nt);if(g(d))return r.start=d.root0,r.stop=d.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Rt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Lt=new st;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Lt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Rt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var It=new o,Dt=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,It),i=o.multiplyComponents(r,t.direction,Dt),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,d;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,d=-s+Math.sqrt(l);let m=d/a,h=u/d;return m<h?new Z(m,h):{start:h,stop:m}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,d=-s+Math.sqrt(l),new Z(0,d/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),d=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(d===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let m=d*d,h=l*l,E=u*u,D=d*l,W=E+h,V=2*(a*u+D),L=2*f*u+a*a-h+m,B=2*(f*a-D),I=f*f-m;if(W===0&&V===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,V,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,d,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var ct=new o,wt=new o,qt=new o,K=new o,Bt=new o,xt=new b,Tt=new b,zt=new b,Wt=new b,Vt=new b,gt=new b,pt=new b,St=new o,vt=new o,Ut=new ft;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,ct);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,ct),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,K),a=o.normalize(o.cross(u,s,wt),wt),f=o.normalize(o.cross(s,a,qt),qt),l=xt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let d=b.transpose(l,Tt),p=b.fromScale(e.radii,zt),q=b.fromScale(e.oneOverRadii,Wt),m=Vt;m[0]=0,m[1]=-n.z,m[2]=n.y,m[3]=n.z,m[4]=0,m[5]=-n.x,m[6]=-n.y,m[7]=n.x,m[8]=0;let h=b.multiply(b.multiply(d,q,gt),m,gt),E=b.multiply(b.multiply(h,p,pt),l,pt),D=b.multiplyByVector(h,r,Bt),W=O.quadraticVectorExpression(E,o.negate(D,ct),0,0,1),V,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){V=b.multiplyByVector(p,b.multiplyByVector(l,W[y],St),St);let S=o.normalize(o.subtract(V,r,K),K),M=o.dot(S,n);M>C&&(C=M,I=o.clone(V,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,K))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Qt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Qt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,d;if((f===1||f===2)&&(l=new o,d=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,d),{positions:[t,e,r,l,d],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,d),{positions:[t,e,r,l,d],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,d),{positions:[t,e,r,l,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,d),{positions:[t,e,r,l,d],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,d),{positions:[t,e,r,l,d],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,d),{positions:[t,e,r,l,d],indices:[1,2,4,1,4,3,0,3,4]}};var we=O;export{st as a,we as b}; diff --git a/public/js/Cesium2/Workers/chunk-FNTGP2KW.js b/public/js/Cesium2/Workers/chunk-V7ZN4CEP.js similarity index 90% rename from public/js/Cesium2/Workers/chunk-FNTGP2KW.js rename to public/js/Cesium2/Workers/chunk-V7ZN4CEP.js index c3cf2bc6d..f9b216b7d 100644 --- a/public/js/Cesium2/Workers/chunk-FNTGP2KW.js +++ b/public/js/Cesium2/Workers/chunk-V7ZN4CEP.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as h}from"./chunk-SOCYD7RP.js";import{a as n,c as y,e as a}from"./chunk-S4VBGY2U.js";import{b as f}from"./chunk-G75U3WZT.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; +import{a as h}from"./chunk-DGVML3P5.js";import{a as n,c as y,e as a}from"./chunk-RH3GFHG2.js";import{b as f}from"./chunk-RTY3VPG6.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/public/js/Cesium2/Workers/chunk-G72WI3OZ.js b/public/js/Cesium2/Workers/chunk-VMIASSRO.js similarity index 94% rename from public/js/Cesium2/Workers/chunk-G72WI3OZ.js rename to public/js/Cesium2/Workers/chunk-VMIASSRO.js index e61732fbe..d1e6af577 100644 --- a/public/js/Cesium2/Workers/chunk-G72WI3OZ.js +++ b/public/js/Cesium2/Workers/chunk-VMIASSRO.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as _}from"./chunk-RNF7TLFF.js";import{a as te}from"./chunk-CTRWX4F5.js";import{a as fe,b as j,f as Z,g as me}from"./chunk-M3A6SPGI.js";import{a as e,b as ie,c as ee,e as O}from"./chunk-S4VBGY2U.js";import{a as Q}from"./chunk-UCTPWOTZ.js";import{a as se}from"./chunk-N3A5CZ2S.js";import{a as le}from"./chunk-G75U3WZT.js";import{e as $}from"./chunk-3THTQ4QB.js";var Se={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Se);var ue={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(ue[r])||(ue[r]=!0,console.warn(se(n,r)))}P.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var he=P;var w=[new e,new e],Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,De=new e,I=new e,W=new e,R={},re=new ie;function je(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function He(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var Me=new e(-1,0,0),H=new j,Ve=new j,oe=new O,Ne=O.IDENTITY.clone(),Fe=new e,Ge=new fe,de=new e;function v(r,n,a,o,t,c,f,l){let m=Fe,s=Ge;H=me.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,Me,m),m=e.normalize(m,m);let S=He(m,n,r,t);oe=O.fromRotationZ(S,oe),de.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,de,Ve),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ie=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ie);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Le(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function ge(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ye=new Z,we=new e,pe=new O;function xe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ye),pe):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ye),pe);let i,g;if(n=e.clone(n,we),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,we),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var qe=new e,Pe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=je(r,c),l=o._granularity,m=o._cornerType,s=t?Le(n,a):ge(n,a),S=t?ge(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Te,b=Be,h=Ce,E=ze,B=Ae,C=be,z=Oe,u=ve,T=De,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let V=f[0],A=f[1];t&&(D=v(p,u,S,D,c,V+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let N,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){he("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),qe);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),Pe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),N=ne(w,V+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,N,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?xe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),N=ne(w,V+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,N,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?xe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,V+d,1,1),T=p;V=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),N=ne(w,V+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,N,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let Ee=t?i+D.length:i,J=new Float64Array(Ee);return J.set(g),t&&J.set(D,i),J};var lt=R;export{G as a,he as b,lt as c}; +import{a as _}from"./chunk-AKRPIQPN.js";import{a as te}from"./chunk-P73YILG6.js";import{a as fe,b as j,f as Z,g as me}from"./chunk-7YEOLR2L.js";import{a as e,b as ie,c as ee,e as O}from"./chunk-RH3GFHG2.js";import{a as Q}from"./chunk-FRWNWNYJ.js";import{a as se}from"./chunk-TA3RE4KQ.js";import{a as le}from"./chunk-RTY3VPG6.js";import{e as $}from"./chunk-LRNH5AEO.js";var Se={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Se);var ue={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(ue[r])||(ue[r]=!0,console.warn(se(n,r)))}P.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var he=P;var w=[new e,new e],Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,De=new e,I=new e,W=new e,R={},re=new ie;function je(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function He(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var Me=new e(-1,0,0),H=new j,Ve=new j,oe=new O,Ne=O.IDENTITY.clone(),Fe=new e,Ge=new fe,de=new e;function v(r,n,a,o,t,c,f,l){let m=Fe,s=Ge;H=me.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,Me,m),m=e.normalize(m,m);let S=He(m,n,r,t);oe=O.fromRotationZ(S,oe),de.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,de,Ve),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ie=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ie);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Le(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function ge(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ye=new Z,we=new e,pe=new O;function xe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ye),pe):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ye),pe);let i,g;if(n=e.clone(n,we),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,we),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var qe=new e,Pe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=je(r,c),l=o._granularity,m=o._cornerType,s=t?Le(n,a):ge(n,a),S=t?ge(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Te,b=Be,h=Ce,E=ze,B=Ae,C=be,z=Oe,u=ve,T=De,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let V=f[0],A=f[1];t&&(D=v(p,u,S,D,c,V+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let N,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){he("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),qe);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),Pe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),N=ne(w,V+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,N,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?xe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),N=ne(w,V+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,N,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?xe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,V+d,1,1),T=p;V=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),N=ne(w,V+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,N,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let Ee=t?i+D.length:i,J=new Float64Array(Ee);return J.set(g),t&&J.set(D,i),J};var lt=R;export{G as a,he as b,lt as c}; diff --git a/public/js/Cesium2/Workers/chunk-Q5MYX5A2.js b/public/js/Cesium2/Workers/chunk-VMXXQ6B4.js similarity index 94% rename from public/js/Cesium2/Workers/chunk-Q5MYX5A2.js rename to public/js/Cesium2/Workers/chunk-VMXXQ6B4.js index dc0fcbe87..defc8b7ed 100644 --- a/public/js/Cesium2/Workers/chunk-Q5MYX5A2.js +++ b/public/js/Cesium2/Workers/chunk-VMXXQ6B4.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as w,b as z,i as S}from"./chunk-M3A6SPGI.js";import{a as y}from"./chunk-D5HNP2LB.js";import{a as C,c as T,e as x}from"./chunk-S4VBGY2U.js";import{a as h}from"./chunk-UCTPWOTZ.js";import{a as u,b as a}from"./chunk-G75U3WZT.js";import{e as b}from"./chunk-3THTQ4QB.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; +import{a as w,b as z,i as S}from"./chunk-7YEOLR2L.js";import{a as y}from"./chunk-QHHYYTCM.js";import{a as C,c as T,e as x}from"./chunk-RH3GFHG2.js";import{a as h}from"./chunk-FRWNWNYJ.js";import{a as u,b as a}from"./chunk-RTY3VPG6.js";import{e as b}from"./chunk-LRNH5AEO.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/public/js/Cesium2/Workers/chunk-PJQ53UQY.js b/public/js/Cesium2/Workers/chunk-VQ4ICMD3.js similarity index 95% rename from public/js/Cesium2/Workers/chunk-PJQ53UQY.js rename to public/js/Cesium2/Workers/chunk-VQ4ICMD3.js index aaee0ef20..8806cd46c 100644 --- a/public/js/Cesium2/Workers/chunk-PJQ53UQY.js +++ b/public/js/Cesium2/Workers/chunk-VQ4ICMD3.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as y}from"./chunk-Q5MYX5A2.js";import{d as j}from"./chunk-K2M3OJ7Z.js";import{b as d,h as L}from"./chunk-M3A6SPGI.js";import{a as R}from"./chunk-D5HNP2LB.js";import{a as s,b as W,c as T,d as q}from"./chunk-S4VBGY2U.js";import{a as w}from"./chunk-UCTPWOTZ.js";import{a as P}from"./chunk-N3A5CZ2S.js";import{a as A,b as z}from"./chunk-G75U3WZT.js";import{e as l}from"./chunk-3THTQ4QB.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),a=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=a}}});var U=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,U);return F(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return F(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var at=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,a,i;return l(t)&&t<0&&e.minimumRadius>-t?(i=at,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),a=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,a=this._distanceToLimbInScaledSpaceSquared),F(o,i,a)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Q(this._ellipsoid,o,t,e)};var v=q.clone(q.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,a){let i=Z(this._ellipsoid,e,v);return Q(i,o,t,a)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,a,i){return J(this._ellipsoid,o,t,e,a,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,a,i,c){let n=Z(this._ellipsoid,i,v);return J(n,o,t,e,a,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let a=L.subsample(o,t,0,nt),i=j.fromPoints(a);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,a,e)};var st=new s;function Z(o,t,e){if(l(t)&&t<0&&o.minimumRadius>-t){let a=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,st);o=q.fromCartesian3(a,e)}return o}function Q(o,t,e,a){z.typeOf.object("directionToPoint",t),z.defined("positions",e),l(a)||(a=new s);let i=Y(o,t),c=0;for(let n=0,r=e.length;n<r;++n){let m=e[n],h=K(o,m,i);if(h<0)return;c=Math.max(c,h)}return X(i,c,a)}var M=new s;function J(o,t,e,a,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",a),l(c)||(c=new s),a=P(a,3),i=P(i,s.ZERO);let n=Y(o,t),r=0;for(let m=0,h=e.length;m<h;m+=a){M.x=e[m]+i.x,M.y=e[m+1]+i.y,M.z=e[m+2]+i.z;let u=K(o,M,n);if(u<0)return;r=Math.max(r,u)}return X(n,r,c)}function F(o,t,e){let a=t,i=e,c=s.subtract(o,a,U),n=-s.dot(c,a);return!(i<0?n>0:n>i&&n*n/s.magnitudeSquared(c)>i)}var ct=new s,rt=new s;function K(o,t,e){let a=o.transformPositionToScaledSpace(t,ct),i=s.magnitudeSquared(a),c=Math.sqrt(i),n=s.divideByScalar(a,c,rt);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(n,e),m=s.magnitude(s.cross(n,e,n)),h=1/c,u=Math.sqrt(i-1)*h;return 1/(r*h-m*u)}function X(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var D=new s;function Y(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,D),s.normalize(D,D))}var Pt=x;var O={};O.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new A("scale must be a finite number.");if(!Number.isFinite(e))throw new A("relativeHeight must be a finite number.");return(o-e)*t+e};var mt=new W;O.getPosition=function(o,t,e,a,i){let c=t.cartesianToCartographic(o,mt);if(!l(c))return s.clone(o,i);let n=O.getHeight(c.height,e,a);return s.fromRadians(c.longitude,c.latitude,n,t,i)};var $=O;var dt={NONE:0,BITS12:1},S=Object.freeze(dt);var C=new s,lt=new s,f=new T,V=new d,ht=new d,pt=Math.pow(2,12);function p(o,t,e,a,i,c,n,r,m,h){let u=S.NONE,g,N;if(l(t)&&l(e)&&l(a)&&l(i)){let E=t.minimum,I=t.maximum,_=s.subtract(I,E,lt),tt=a-e;Math.max(s.maximumComponent(_),tt)<pt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let ot=s.negate(E,C);d.multiply(d.fromTranslation(ot,V),g,g);let b=C;b.x=1/_.x,b.y=1/_.y,b.z=1/_.z,d.multiply(d.fromScale(b,V),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let et=d.fromTranslation(E,V),it=d.fromScale(_,ht),k=d.multiply(et,it,V);d.multiply(i,k,i),d.multiply(N,k,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=a,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=P(n,!1),this.hasGeodeticSurfaceNormals=P(r,!1),this.exaggeration=P(m,1),this.exaggerationRelativeHeight=P(h,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,a,i,c,n,r){let m=a.x,h=a.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,C),e.x=w.clamp(e.x,0,1),e.y=w.clamp(e.y,0,1),e.z=w.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=w.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let E=y.compressTextureCoordinates(f);T.fromElements(m,h,f);let I=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=E,o[t++]=I,this.hasWebMercatorT){T.fromElements(n,0,f);let _=y.compressTextureCoordinates(f);o[t++]=_}}else s.subtract(e,this.center,C),o[t++]=C.x,o[t++]=C.y,o[t++]=C.z,o[t++]=i,o[t++]=m,o[t++]=h,this.hasWebMercatorT&&(o[t++]=n);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var ut=new s,B=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let a=this.stride,i=o.length/a;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let n=0;n<i;n++){for(let u=0;u<a;u++){let g=n*a+u,N=n*c+u;t[N]=o[g]}let r=this.decodePosition(t,n,ut),m=e.geodeticSurfaceNormal(r,B),h=n*c+this._offsetGeodeticSurfaceNormal;t[h]=m.x,t[h+1]=m.y,t[h+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,a=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<a;c++)for(let n=0;n<i;n++){let r=c*e+n,m=c*i+n;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(l(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let a=y.decompressTextureCoordinates(o[t],f);e.x=a.x,e.y=a.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let a=this.exaggeration,i=this.exaggerationRelativeHeight;if(a!==1&&this.hasGeodeticSurfaceNormals){let n=this.decodeGeodeticSurfaceNormal(o,t,B),r=this.decodeHeight(o,t),m=$.getHeight(r,a,i)-r;e.x+=n.x*m,e.y+=n.y*m,e.z+=n.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return l(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let a=o[t]/256,i=Math.floor(a),c=(a-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=R.FLOAT,e=R.getSizeInBytes(t),a=this.stride*e,i=0,c=[];function n(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:a}),i+=m*e}if(this.quantization===S.NONE){n(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,n(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&n(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;n(H.compressed0,r?4:3),m&&n(H.compressed1,1),this.hasGeodeticSurfaceNormals&&n(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(l(o))return l(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Wt=p;export{Pt as a,Wt as b}; +import{a as y}from"./chunk-VMXXQ6B4.js";import{d as j}from"./chunk-2NIQ5ECB.js";import{b as d,h as L}from"./chunk-7YEOLR2L.js";import{a as R}from"./chunk-QHHYYTCM.js";import{a as s,b as W,c as T,d as q}from"./chunk-RH3GFHG2.js";import{a as w}from"./chunk-FRWNWNYJ.js";import{a as P}from"./chunk-TA3RE4KQ.js";import{a as A,b as z}from"./chunk-RTY3VPG6.js";import{e as l}from"./chunk-LRNH5AEO.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),a=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=a}}});var U=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,U);return F(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return F(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var at=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,a,i;return l(t)&&t<0&&e.minimumRadius>-t?(i=at,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),a=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,a=this._distanceToLimbInScaledSpaceSquared),F(o,i,a)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Q(this._ellipsoid,o,t,e)};var v=q.clone(q.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,a){let i=Z(this._ellipsoid,e,v);return Q(i,o,t,a)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,a,i){return J(this._ellipsoid,o,t,e,a,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,a,i,c){let n=Z(this._ellipsoid,i,v);return J(n,o,t,e,a,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let a=L.subsample(o,t,0,nt),i=j.fromPoints(a);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,a,e)};var st=new s;function Z(o,t,e){if(l(t)&&t<0&&o.minimumRadius>-t){let a=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,st);o=q.fromCartesian3(a,e)}return o}function Q(o,t,e,a){z.typeOf.object("directionToPoint",t),z.defined("positions",e),l(a)||(a=new s);let i=Y(o,t),c=0;for(let n=0,r=e.length;n<r;++n){let m=e[n],h=K(o,m,i);if(h<0)return;c=Math.max(c,h)}return X(i,c,a)}var M=new s;function J(o,t,e,a,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",a),l(c)||(c=new s),a=P(a,3),i=P(i,s.ZERO);let n=Y(o,t),r=0;for(let m=0,h=e.length;m<h;m+=a){M.x=e[m]+i.x,M.y=e[m+1]+i.y,M.z=e[m+2]+i.z;let u=K(o,M,n);if(u<0)return;r=Math.max(r,u)}return X(n,r,c)}function F(o,t,e){let a=t,i=e,c=s.subtract(o,a,U),n=-s.dot(c,a);return!(i<0?n>0:n>i&&n*n/s.magnitudeSquared(c)>i)}var ct=new s,rt=new s;function K(o,t,e){let a=o.transformPositionToScaledSpace(t,ct),i=s.magnitudeSquared(a),c=Math.sqrt(i),n=s.divideByScalar(a,c,rt);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(n,e),m=s.magnitude(s.cross(n,e,n)),h=1/c,u=Math.sqrt(i-1)*h;return 1/(r*h-m*u)}function X(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var D=new s;function Y(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,D),s.normalize(D,D))}var Pt=x;var O={};O.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new A("scale must be a finite number.");if(!Number.isFinite(e))throw new A("relativeHeight must be a finite number.");return(o-e)*t+e};var mt=new W;O.getPosition=function(o,t,e,a,i){let c=t.cartesianToCartographic(o,mt);if(!l(c))return s.clone(o,i);let n=O.getHeight(c.height,e,a);return s.fromRadians(c.longitude,c.latitude,n,t,i)};var $=O;var dt={NONE:0,BITS12:1},S=Object.freeze(dt);var C=new s,lt=new s,f=new T,V=new d,ht=new d,pt=Math.pow(2,12);function p(o,t,e,a,i,c,n,r,m,h){let u=S.NONE,g,N;if(l(t)&&l(e)&&l(a)&&l(i)){let E=t.minimum,I=t.maximum,_=s.subtract(I,E,lt),tt=a-e;Math.max(s.maximumComponent(_),tt)<pt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let ot=s.negate(E,C);d.multiply(d.fromTranslation(ot,V),g,g);let b=C;b.x=1/_.x,b.y=1/_.y,b.z=1/_.z,d.multiply(d.fromScale(b,V),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let et=d.fromTranslation(E,V),it=d.fromScale(_,ht),k=d.multiply(et,it,V);d.multiply(i,k,i),d.multiply(N,k,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=a,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=P(n,!1),this.hasGeodeticSurfaceNormals=P(r,!1),this.exaggeration=P(m,1),this.exaggerationRelativeHeight=P(h,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,a,i,c,n,r){let m=a.x,h=a.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,C),e.x=w.clamp(e.x,0,1),e.y=w.clamp(e.y,0,1),e.z=w.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=w.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let E=y.compressTextureCoordinates(f);T.fromElements(m,h,f);let I=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=E,o[t++]=I,this.hasWebMercatorT){T.fromElements(n,0,f);let _=y.compressTextureCoordinates(f);o[t++]=_}}else s.subtract(e,this.center,C),o[t++]=C.x,o[t++]=C.y,o[t++]=C.z,o[t++]=i,o[t++]=m,o[t++]=h,this.hasWebMercatorT&&(o[t++]=n);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var ut=new s,B=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let a=this.stride,i=o.length/a;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let n=0;n<i;n++){for(let u=0;u<a;u++){let g=n*a+u,N=n*c+u;t[N]=o[g]}let r=this.decodePosition(t,n,ut),m=e.geodeticSurfaceNormal(r,B),h=n*c+this._offsetGeodeticSurfaceNormal;t[h]=m.x,t[h+1]=m.y,t[h+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,a=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<a;c++)for(let n=0;n<i;n++){let r=c*e+n,m=c*i+n;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(l(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let a=y.decompressTextureCoordinates(o[t],f);e.x=a.x,e.y=a.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let a=this.exaggeration,i=this.exaggerationRelativeHeight;if(a!==1&&this.hasGeodeticSurfaceNormals){let n=this.decodeGeodeticSurfaceNormal(o,t,B),r=this.decodeHeight(o,t),m=$.getHeight(r,a,i)-r;e.x+=n.x*m,e.y+=n.y*m,e.z+=n.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return l(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let a=o[t]/256,i=Math.floor(a),c=(a-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=R.FLOAT,e=R.getSizeInBytes(t),a=this.stride*e,i=0,c=[];function n(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:a}),i+=m*e}if(this.quantization===S.NONE){n(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,n(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&n(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;n(H.compressed0,r?4:3),m&&n(H.compressed1,1),this.hasGeodeticSurfaceNormals&&n(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(l(o))return l(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Wt=p;export{Pt as a,Wt as b}; diff --git a/public/js/Cesium2/Workers/chunk-Z7BLUZ7R.js b/public/js/Cesium2/Workers/chunk-VYMAIP2A.js similarity index 90% rename from public/js/Cesium2/Workers/chunk-Z7BLUZ7R.js rename to public/js/Cesium2/Workers/chunk-VYMAIP2A.js index 1f383a2db..2e441371a 100644 --- a/public/js/Cesium2/Workers/chunk-Z7BLUZ7R.js +++ b/public/js/Cesium2/Workers/chunk-VYMAIP2A.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{b as d}from"./chunk-K2M3OJ7Z.js";import{a as i}from"./chunk-S4VBGY2U.js";import{a as z}from"./chunk-N3A5CZ2S.js";import{b as r}from"./chunk-G75U3WZT.js";import{e as c}from"./chunk-3THTQ4QB.js";function t(m,n,e){this.minimum=i.clone(z(m,i.ZERO)),this.maximum=i.clone(z(n,i.ZERO)),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,I=m.length;for(let E=1;E<I;E++){let M=m[E],p=M.x,Z=M.y,q=M.z;e=Math.min(p,e),o=Math.max(p,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(q,u),l=Math.max(q,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var P=t;export{P as a}; +import{b as d}from"./chunk-2NIQ5ECB.js";import{a as i}from"./chunk-RH3GFHG2.js";import{a as z}from"./chunk-TA3RE4KQ.js";import{b as r}from"./chunk-RTY3VPG6.js";import{e as c}from"./chunk-LRNH5AEO.js";function t(m,n,e){this.minimum=i.clone(z(m,i.ZERO)),this.maximum=i.clone(z(n,i.ZERO)),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,I=m.length;for(let E=1;E<I;E++){let M=m[E],p=M.x,Z=M.y,q=M.z;e=Math.min(p,e),o=Math.max(p,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(q,u),l=Math.max(q,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var P=t;export{P as a}; diff --git a/public/js/Cesium2/Workers/chunk-WJYW7YDO.js b/public/js/Cesium2/Workers/chunk-WJYW7YDO.js deleted file mode 100644 index d00a9bf55..000000000 --- a/public/js/Cesium2/Workers/chunk-WJYW7YDO.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 - * - * Copyright 2011-2022 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. - */ - -import{a as st}from"./chunk-RDAVO5OM.js";import{b as at,c as ht,d as nt}from"./chunk-LH3SUUXG.js";import{a as et}from"./chunk-D5HNP2LB.js";import{a as h,b as tt,c as v,d as vt}from"./chunk-S4VBGY2U.js";import{a as Y}from"./chunk-UCTPWOTZ.js";import{a as xt}from"./chunk-54PMPXZ4.js";import{a as K}from"./chunk-N3A5CZ2S.js";import{b as C}from"./chunk-G75U3WZT.js";import{e as D}from"./chunk-3THTQ4QB.js";var ct={CLOCKWISE:xt.CW,COUNTER_CLOCKWISE:xt.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var pt=Object.freeze(ct);function dt(t,n,e=2){let c=n&&n.length,r=c?n[0]*e:t.length,o=bt(t,0,r,e,!0),i=[];if(!o||o.next===o.prev)return i;let s,f,u;if(c&&(o=It(t,n,o,e)),t.length>80*e){s=1/0,f=1/0;let a=-1/0,y=-1/0;for(let d=e;d<r;d+=e){let S=t[d],p=t[d+1];S<s&&(s=S),p<f&&(f=p),S>a&&(a=S),p>y&&(y=p)}u=Math.max(a-s,y-f),u=u!==0?32767/u:0}return rt(o,i,e,s,f,u,0),i}function bt(t,n,e,c,r){let o;if(r===jt(t,n,e,c)>0)for(let i=n;i<e;i+=c)o=wt(i/c|0,t[i],t[i+1],o);else for(let i=e-c;i>=n;i-=c)o=wt(i/c|0,t[i],t[i+1],o);return o&&ft(o,o.next)&&(ot(o),o=o.next),o}function N(t,n){if(!t)return t;n||(n=t);let e=t,c;do if(c=!1,!e.steiner&&(ft(e,e.next)||b(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;c=!0}else e=e.next;while(c||e!==n);return n}function rt(t,n,e,c,r,o,i){if(!t)return;!i&&o&&Nt(t,c,r,o);let s=t;for(;t.prev!==t.next;){let f=t.prev,u=t.next;if(o?Rt(t,c,r,o):Pt(t)){n.push(f.i,t.i,u.i),ot(t),t=u.next,s=u.next;continue}if(t=u,t===s){i?i===1?(t=zt(N(t),n),rt(t,n,e,c,r,o,2)):i===2&&Bt(t,n,e,c,r,o):rt(N(t),n,e,c,r,o,1);break}}}function Pt(t){let n=t.prev,e=t,c=t.next;if(b(n,e,c)>=0)return!1;let r=n.x,o=e.x,i=c.x,s=n.y,f=e.y,u=c.y,a=r<o?r<i?r:i:o<i?o:i,y=s<f?s<u?s:u:f<u?f:u,d=r>o?r>i?r:i:o>i?o:i,S=s>f?s>u?s:u:f>u?f:u,p=c.next;for(;p!==n;){if(p.x>=a&&p.x<=d&&p.y>=y&&p.y<=S&&V(r,s,o,f,i,u,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Rt(t,n,e,c){let r=t.prev,o=t,i=t.next;if(b(r,o,i)>=0)return!1;let s=r.x,f=o.x,u=i.x,a=r.y,y=o.y,d=i.y,S=s<f?s<u?s:u:f<u?f:u,p=a<y?a<d?a:d:y<d?y:d,T=s>f?s>u?s:u:f>u?f:u,L=a>y?a>d?a:d:y>d?y:d,z=yt(S,p,n,e,c),F=yt(T,L,n,e,c),l=t.prevZ,x=t.nextZ;for(;l&&l.z>=z&&x&&x.z<=F;){if(l.x>=S&&l.x<=T&&l.y>=p&&l.y<=L&&l!==r&&l!==i&&V(s,a,f,y,u,d,l.x,l.y)&&b(l.prev,l,l.next)>=0||(l=l.prevZ,x.x>=S&&x.x<=T&&x.y>=p&&x.y<=L&&x!==r&&x!==i&&V(s,a,f,y,u,d,x.x,x.y)&&b(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=p&&l.y<=L&&l!==r&&l!==i&&V(s,a,f,y,u,d,l.x,l.y)&&b(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;x&&x.z<=F;){if(x.x>=S&&x.x<=T&&x.y>=p&&x.y<=L&&x!==r&&x!==i&&V(s,a,f,y,u,d,x.x,x.y)&&b(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function zt(t,n){let e=t;do{let c=e.prev,r=e.next.next;!ft(c,r)&&St(c,e,e.next,r)&&it(c,r)&&it(r,c)&&(n.push(c.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,c,r,o){let i=t;do{let s=i.next.next;for(;s!==i.prev;){if(i.i!==s.i&&_t(i,s)){let f=At(i,s);i=N(i,i.next),f=N(f,f.next),rt(i,n,e,c,r,o,0),rt(f,n,e,c,r,o,0);return}s=s.next}i=i.next}while(i!==t)}function It(t,n,e,c){let r=[];for(let o=0,i=n.length;o<i;o++){let s=n[o]*c,f=o<i-1?n[o+1]*c:t.length,u=bt(t,s,f,c,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let o=0;o<r.length;o++)e=$t(r[o],e);return e}function Wt(t,n){return t.x-n.x}function $t(t,n){let e=Gt(t,n);if(!e)return n;let c=At(e,t);return N(c,c.next),N(e,e.next)}function Gt(t,n){let e=n,c=t.x,r=t.y,o=-1/0,i;do{if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=c&&y>o&&(o=y,i=e.x<e.next.x?e:e.next,y===c))return i}e=e.next}while(e!==n);if(!i)return null;let s=i,f=i.x,u=i.y,a=1/0;e=i;do{if(c>=e.x&&e.x>=f&&c!==e.x&&V(r<u?c:o,r,f,u,r<u?o:c,r,e.x,e.y)){let y=Math.abs(r-e.y)/(c-e.x);it(e,t)&&(y<a||y===a&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,a=y)}e=e.next}while(e!==s);return i}function Ht(t,n){return b(t.prev,t,n.prev)<0&&b(n.next,t,t.next)<0}function Nt(t,n,e,c){let r=t;do r.z===0&&(r.z=yt(r.x,r.y,n,e,c)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let c=t,r;t=null;let o=null;for(n=0;c;){n++;let i=c,s=0;for(let u=0;u<e&&(s++,i=i.nextZ,!!i);u++);let f=e;for(;s>0||f>0&&i;)s!==0&&(f===0||!i||c.z<=i.z)?(r=c,c=c.nextZ,s--):(r=i,i=i.nextZ,f--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;c=i}o.nextZ=null,e*=2}while(n>1);return t}function yt(t,n,e,c,r){return t=(t-e)*r|0,n=(n-c)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function V(t,n,e,c,r,o,i,s){return(r-i)*(n-s)>=(t-i)*(o-s)&&(t-i)*(c-s)>=(e-i)*(n-s)&&(e-i)*(o-s)>=(r-i)*(c-s)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&Vt(t,n)&&(b(t.prev,t,n.prev)||b(t,n.prev,n))||ft(t,n)&&b(t.prev,t,t.next)>0&&b(n.prev,n,n.next)>0)}function b(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function ft(t,n){return t.x===n.x&&t.y===n.y}function St(t,n,e,c){let r=lt(b(t,n,e)),o=lt(b(t,n,c)),i=lt(b(e,c,t)),s=lt(b(e,c,n));return!!(r!==o&&i!==s||r===0&&ut(t,e,n)||o===0&&ut(t,c,n)||i===0&&ut(e,t,c)||s===0&&ut(e,n,c))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&St(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return b(t.prev,t,t.next)<0?b(t,n,t.next)>=0&&b(t,t.prev,n)>=0:b(t,n,t.prev)<0||b(t,t.next,n)<0}function Vt(t,n){let e=t,c=!1,r=(t.x+n.x)/2,o=(t.y+n.y)/2;do e.y>o!=e.next.y>o&&e.next.y!==e.y&&r<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(c=!c),e=e.next;while(e!==t);return c}function At(t,n){let e=mt(t.i,t.x,t.y),c=mt(n.i,n.x,n.y),r=t.next,o=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,c.next=e,e.prev=c,o.next=c,c.prev=o,c}function wt(t,n,e,c){let r=mt(t,n,e);return c?(r.next=c.next,r.prev=c,c.next.prev=r,c.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function mt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function jt(t,n,e,c){let r=0;for(let o=n,i=e-c;o<e;o+=c)r+=(t[i]-t[o])*(t[o+1]+t[i+1]),i=o;return r}var qt=new h,Jt=new h,B={};B.computeArea2D=function(t){C.defined("positions",t),C.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let c=n-1,r=0;r<n;c=r++){let o=t[c],i=t[r];e+=o.x*i.y-i.x*o.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?pt.COUNTER_CLOCKWISE:pt.CLOCKWISE};B.triangulate=function(t,n){C.defined("positions",t);let e=v.packArray(t);return dt(e,n,2)};var Tt=new h,Mt=new h,Zt=new h,Ct=new h,Et=new h,Ot=new h,R=new h,Lt=new v,Dt=new v,Ft=new v,j=new v;B.computeSubdivision=function(t,n,e,c,r){r=K(r,Y.RADIANS_PER_DEGREE);let o=D(c);C.typeOf.object("ellipsoid",t),C.defined("positions",n),C.defined("indices",e),C.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),C.typeOf.number.equals("indices.length % 3","0",e.length%3,0),C.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),s,f=n.length,u=new Array(f*3),a=new Array(f*2),y=0,d=0;for(s=0;s<f;s++){let l=n[s];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,o){let x=c[s];a[d++]=x.x,a[d++]=x.y}}let S=[],p={},T=t.maximumRadius,L=Y.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),x=i.pop(),m=i.pop(),A=h.fromArray(u,m*3,Tt),E=h.fromArray(u,x*3,Mt),q=h.fromArray(u,l*3,Zt),J,Q,I;o&&(J=v.fromArray(a,m*2,Lt),Q=v.fromArray(a,x*2,Dt),I=v.fromArray(a,l*2,Ft));let k=h.multiplyByScalar(h.normalize(A,Ct),T,Ct),U=h.multiplyByScalar(h.normalize(E,Et),T,Et),W=h.multiplyByScalar(h.normalize(q,Ot),T,Ot),$=h.magnitudeSquared(h.subtract(k,U,R)),G=h.magnitudeSquared(h.subtract(U,W,R)),X=h.magnitudeSquared(h.subtract(W,k,R)),H=Math.max($,G,X),M,w,g;H>z?$===H?(M=`${Math.min(m,x)} ${Math.max(m,x)}`,s=p[M],D(s)||(w=h.add(A,E,R),h.multiplyByScalar(w,.5,w),u.push(w.x,w.y,w.z),s=u.length/3-1,p[M]=s,o&&(g=v.add(J,Q,j),v.multiplyByScalar(g,.5,g),a.push(g.x,g.y))),i.push(m,s,l),i.push(s,x,l)):G===H?(M=`${Math.min(x,l)} ${Math.max(x,l)}`,s=p[M],D(s)||(w=h.add(E,q,R),h.multiplyByScalar(w,.5,w),u.push(w.x,w.y,w.z),s=u.length/3-1,p[M]=s,o&&(g=v.add(Q,I,j),v.multiplyByScalar(g,.5,g),a.push(g.x,g.y))),i.push(x,s,m),i.push(s,l,m)):X===H&&(M=`${Math.min(l,m)} ${Math.max(l,m)}`,s=p[M],D(s)||(w=h.add(q,A,R),h.multiplyByScalar(w,.5,w),u.push(w.x,w.y,w.z),s=u.length/3-1,p[M]=s,o&&(g=v.add(I,J,j),v.multiplyByScalar(g,.5,g),a.push(g.x,g.y))),i.push(l,s,x),i.push(s,m,x)):(S.push(m),S.push(x),S.push(l))}let F={attributes:{position:new nt({componentDatatype:et.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:at.TRIANGLES};return o&&(F.attributes.st=new nt({componentDatatype:et.FLOAT,componentsPerAttribute:2,values:a})),new ht(F)};var Qt=new tt,Xt=new tt,Yt=new tt,gt=new tt;B.computeRhumbLineSubdivision=function(t,n,e,c,r){r=K(r,Y.RADIANS_PER_DEGREE);let o=D(c);C.typeOf.object("ellipsoid",t),C.defined("positions",n),C.defined("indices",e),C.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),C.typeOf.number.equals("indices.length % 3","0",e.length%3,0),C.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),s,f=n.length,u=new Array(f*3),a=new Array(f*2),y=0,d=0;for(s=0;s<f;s++){let m=n[s];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,o){let A=c[s];a[d++]=A.x,a[d++]=A.y}}let S=[],p={},T=t.maximumRadius,L=Y.chordLength(r,T),z=new st(void 0,void 0,t),F=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),A=i.pop(),E=i.pop(),q=h.fromArray(u,E*3,Tt),J=h.fromArray(u,A*3,Mt),Q=h.fromArray(u,m*3,Zt),I,k,U;o&&(I=v.fromArray(a,E*2,Lt),k=v.fromArray(a,A*2,Dt),U=v.fromArray(a,m*2,Ft));let W=t.cartesianToCartographic(q,Qt),$=t.cartesianToCartographic(J,Xt),G=t.cartesianToCartographic(Q,Yt);z.setEndPoints(W,$);let X=z.surfaceDistance;F.setEndPoints($,G);let H=F.surfaceDistance;l.setEndPoints(G,W);let M=l.surfaceDistance,w=Math.max(X,H,M),g,P,_,Z,O;w>L?X===w?(g=`${Math.min(E,A)} ${Math.max(E,A)}`,s=p[g],D(s)||(P=z.interpolateUsingFraction(.5,gt),_=(W.height+$.height)*.5,Z=h.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),s=u.length/3-1,p[g]=s,o&&(O=v.add(I,k,j),v.multiplyByScalar(O,.5,O),a.push(O.x,O.y))),i.push(E,s,m),i.push(s,A,m)):H===w?(g=`${Math.min(A,m)} ${Math.max(A,m)}`,s=p[g],D(s)||(P=F.interpolateUsingFraction(.5,gt),_=($.height+G.height)*.5,Z=h.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),s=u.length/3-1,p[g]=s,o&&(O=v.add(k,U,j),v.multiplyByScalar(O,.5,O),a.push(O.x,O.y))),i.push(A,s,E),i.push(s,m,E)):M===w&&(g=`${Math.min(m,E)} ${Math.max(m,E)}`,s=p[g],D(s)||(P=l.interpolateUsingFraction(.5,gt),_=(G.height+W.height)*.5,Z=h.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),s=u.length/3-1,p[g]=s,o&&(O=v.add(U,I,j),v.multiplyByScalar(O,.5,O),a.push(O.x,O.y))),i.push(m,s,A),i.push(s,E,A)):(S.push(E),S.push(A),S.push(m))}let x={attributes:{position:new nt({componentDatatype:et.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:at.TRIANGLES};return o&&(x.attributes.st=new nt({componentDatatype:et.FLOAT,componentsPerAttribute:2,values:a})),new ht(x)};B.scaleToGeodeticHeight=function(t,n,e,c){e=K(e,vt.default);let r=qt,o=Jt;if(n=K(n,0),c=K(c,!0),D(t)){let i=t.length;for(let s=0;s<i;s+=3)h.fromArray(t,s,o),c&&(o=e.scaleToGeodeticSurface(o,o)),n!==0&&(r=e.geodeticSurfaceNormal(o,r),h.multiplyByScalar(r,n,r),h.add(o,r,o)),t[s]=o.x,t[s+1]=o.y,t[s+2]=o.z}return t};var ge=B;export{pt as a,ge as b}; diff --git a/public/js/Cesium2/Workers/chunk-OZYLWM74.js b/public/js/Cesium2/Workers/chunk-XCRMBS5M.js similarity index 91% rename from public/js/Cesium2/Workers/chunk-OZYLWM74.js rename to public/js/Cesium2/Workers/chunk-XCRMBS5M.js index 3b5bdfbef..77fc7a915 100644 --- a/public/js/Cesium2/Workers/chunk-OZYLWM74.js +++ b/public/js/Cesium2/Workers/chunk-XCRMBS5M.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as c}from"./chunk-S4VBGY2U.js";import{b as t}from"./chunk-G75U3WZT.js";import{e as g}from"./chunk-3THTQ4QB.js";function f(){this.high=c.clone(c.ZERO),this.low=c.clone(c.ZERO)}f.encode=function(n,o){t.typeOf.number("value",n),g(o)||(o={high:0,low:0});let h;return n>=0?(h=Math.floor(n/65536)*65536,o.high=h,o.low=n-h):(h=Math.floor(-n/65536)*65536,o.high=-h,o.low=n+h),o};var e={high:0,low:0};f.fromCartesian=function(n,o){t.typeOf.object("cartesian",n),g(o)||(o=new f);let h=o.high,i=o.low;return f.encode(n.x,e),h.x=e.high,i.x=e.low,f.encode(n.y,e),h.y=e.high,i.y=e.low,f.encode(n.z,e),h.z=e.high,i.z=e.low,o};var m=new f;f.writeElements=function(n,o,h){t.defined("cartesianArray",o),t.typeOf.number("index",h),t.typeOf.number.greaterThanOrEquals("index",h,0),f.fromCartesian(n,m);let i=m.high,w=m.low;o[h]=i.x,o[h+1]=i.y,o[h+2]=i.z,o[h+3]=w.x,o[h+4]=w.y,o[h+5]=w.z};var O=f;export{O as a}; +import{a as c}from"./chunk-RH3GFHG2.js";import{b as t}from"./chunk-RTY3VPG6.js";import{e as g}from"./chunk-LRNH5AEO.js";function f(){this.high=c.clone(c.ZERO),this.low=c.clone(c.ZERO)}f.encode=function(n,o){t.typeOf.number("value",n),g(o)||(o={high:0,low:0});let h;return n>=0?(h=Math.floor(n/65536)*65536,o.high=h,o.low=n-h):(h=Math.floor(-n/65536)*65536,o.high=-h,o.low=n+h),o};var e={high:0,low:0};f.fromCartesian=function(n,o){t.typeOf.object("cartesian",n),g(o)||(o=new f);let h=o.high,i=o.low;return f.encode(n.x,e),h.x=e.high,i.x=e.low,f.encode(n.y,e),h.y=e.high,i.y=e.low,f.encode(n.z,e),h.z=e.high,i.z=e.low,o};var m=new f;f.writeElements=function(n,o,h){t.defined("cartesianArray",o),t.typeOf.number("index",h),t.typeOf.number.greaterThanOrEquals("index",h,0),f.fromCartesian(n,m);let i=m.high,w=m.low;o[h]=i.x,o[h+1]=i.y,o[h+2]=i.z,o[h+3]=w.x,o[h+4]=w.y,o[h+5]=w.z};var O=f;export{O as a}; diff --git a/public/js/Cesium2/Workers/chunk-34ULWVZF.js b/public/js/Cesium2/Workers/chunk-YFQNY2YN.js similarity index 91% rename from public/js/Cesium2/Workers/chunk-34ULWVZF.js rename to public/js/Cesium2/Workers/chunk-YFQNY2YN.js index 2ea7a287c..e36bb5f0a 100644 --- a/public/js/Cesium2/Workers/chunk-34ULWVZF.js +++ b/public/js/Cesium2/Workers/chunk-YFQNY2YN.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a}from"./chunk-UCTPWOTZ.js";import{a as N}from"./chunk-54PMPXZ4.js";import{a as t}from"./chunk-G75U3WZT.js";import{e as i}from"./chunk-3THTQ4QB.js";var r={UNSIGNED_BYTE:N.UNSIGNED_BYTE,UNSIGNED_SHORT:N.UNSIGNED_SHORT,UNSIGNED_INT:N.UNSIGNED_INT};r.getSizeInBytes=function(e){switch(e){case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")};r.fromSizeInBytes=function(e){switch(e){case 2:return r.UNSIGNED_SHORT;case 4:return r.UNSIGNED_INT;case 1:return r.UNSIGNED_BYTE;default:throw new t("Size in bytes cannot be mapped to an IndexDatatype")}};r.validate=function(e){return i(e)&&(e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT)};r.createTypedArray=function(e,n){if(!i(e))throw new t("numberOfVertices is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n):new Uint16Array(n)};r.createTypedArrayFromArrayBuffer=function(e,n,E,o){if(!i(e))throw new t("numberOfVertices is required.");if(!i(n))throw new t("sourceArray is required.");if(!i(E))throw new t("byteOffset is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n,E,o):new Uint16Array(n,E,o)};r.fromTypedArray=function(e){if(e instanceof Uint8Array)return r.UNSIGNED_BYTE;if(e instanceof Uint16Array)return r.UNSIGNED_SHORT;if(e instanceof Uint32Array)return r.UNSIGNED_INT;throw new t("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var u=Object.freeze(r);export{u as a}; +import{a}from"./chunk-FRWNWNYJ.js";import{a as N}from"./chunk-UKWFHLUK.js";import{a as t}from"./chunk-RTY3VPG6.js";import{e as i}from"./chunk-LRNH5AEO.js";var r={UNSIGNED_BYTE:N.UNSIGNED_BYTE,UNSIGNED_SHORT:N.UNSIGNED_SHORT,UNSIGNED_INT:N.UNSIGNED_INT};r.getSizeInBytes=function(e){switch(e){case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")};r.fromSizeInBytes=function(e){switch(e){case 2:return r.UNSIGNED_SHORT;case 4:return r.UNSIGNED_INT;case 1:return r.UNSIGNED_BYTE;default:throw new t("Size in bytes cannot be mapped to an IndexDatatype")}};r.validate=function(e){return i(e)&&(e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT)};r.createTypedArray=function(e,n){if(!i(e))throw new t("numberOfVertices is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n):new Uint16Array(n)};r.createTypedArrayFromArrayBuffer=function(e,n,E,o){if(!i(e))throw new t("numberOfVertices is required.");if(!i(n))throw new t("sourceArray is required.");if(!i(E))throw new t("byteOffset is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n,E,o):new Uint16Array(n,E,o)};r.fromTypedArray=function(e){if(e instanceof Uint8Array)return r.UNSIGNED_BYTE;if(e instanceof Uint16Array)return r.UNSIGNED_SHORT;if(e instanceof Uint32Array)return r.UNSIGNED_INT;throw new t("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var u=Object.freeze(r);export{u as a}; diff --git a/public/js/Cesium2/Workers/chunk-IF6EJ7KL.js b/public/js/Cesium2/Workers/chunk-YGBGLFI5.js similarity index 94% rename from public/js/Cesium2/Workers/chunk-IF6EJ7KL.js rename to public/js/Cesium2/Workers/chunk-YGBGLFI5.js index 3a99802ce..dc500e348 100644 --- a/public/js/Cesium2/Workers/chunk-IF6EJ7KL.js +++ b/public/js/Cesium2/Workers/chunk-YGBGLFI5.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as tt}from"./chunk-MWSGYAUE.js";import{a as At}from"./chunk-W5MIOKEY.js";import{a as yt}from"./chunk-72CGGEJF.js";import{a as G}from"./chunk-5CC3QRYS.js";import{a as z}from"./chunk-6HIVPZ7K.js";import{a as at}from"./chunk-34ULWVZF.js";import{a as ht}from"./chunk-24JYWT5N.js";import{b as mt,c as st,d as S}from"./chunk-LH3SUUXG.js";import{a as dt,d as rt}from"./chunk-K2M3OJ7Z.js";import{f as it,h as bt}from"./chunk-M3A6SPGI.js";import{a as F}from"./chunk-D5HNP2LB.js";import{a,b as _t,c as W,d as v,e as R}from"./chunk-S4VBGY2U.js";import{a as I}from"./chunk-UCTPWOTZ.js";import{a as T}from"./chunk-N3A5CZ2S.js";import{a as nt,b as H}from"./chunk-G75U3WZT.js";import{e as K}from"./chunk-3THTQ4QB.js";var et=new a,pt=new a,xt=new a,wt=new a,w=new W,Mt=new R,Vt=new R,gt=new it,Tt=new a,Nt=new a,Et=new a,lt=new _t,Pt=new a,Ft=new W,St=new W;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,E=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(E*2):void 0,l=n.normal?new Float32Array(E*3):void 0,A=n.tangent?new Float32Array(E*3):void 0,x=n.bitangent?new Float32Array(E*3):void 0,O=g?new Float32Array(E*3):void 0,B=0,b=Tt,M=Nt,d=Et,_=new dt(f),L=_.project(f.cartesianToCartographic(s,lt),Pt),J=f.scaleToGeodeticSurface(s,et);f.geodeticSurfaceNormal(J,J);let Z=Mt,q=Vt;if(h!==0){let m=it.fromAxisAngle(J,h,gt);Z=R.fromQuaternion(m,Z),m=it.fromAxisAngle(J,-h,gt),q=R.fromQuaternion(m,q)}else Z=R.clone(R.IDENTITY,Z),q=R.clone(R.IDENTITY,q);let k=W.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),Q=W.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),j=o.length,y=t?j:0,p=y/3*2;for(let m=0;m<j;m+=3){let u=m+1,N=m+2,D=a.fromArray(o,m,et);if(n.st){let P=R.multiplyByVector(Z,D,pt),C=_.project(f.cartesianToCartographic(P,lt),xt);a.subtract(C,L,C),w.x=(C.x+i)/(2*i),w.y=(C.y+r)/(2*r),k.x=Math.min(w.x,k.x),k.y=Math.min(w.y,k.y),Q.x=Math.max(w.x,Q.x),Q.y=Math.max(w.y,Q.y),t&&(c[B+p]=w.x,c[B+1+p]=w.y),c[B++]=w.x,c[B++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(D,b),g&&(O[m+y]=-b.x,O[u+y]=-b.y,O[N+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),R.multiplyByVector(q,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[N]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[N+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[N]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[N+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[N]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[N+y]=d.z))))}if(n.st){j=c.length;for(let m=0;m<j;m+=2)c[m]=(c[m]-k.x)/(Q.x-k.x),c[m+1]=(c[m+1]-k.y)/(Q.y-k.y)}let V=new ht;if(n.position){let m=tt.raisePositionsToHeight(o,e,t);V.position=new S({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(V.st=new S({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(V.normal=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(V.tangent=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(V.bitangent=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:x})),g&&(V.extrudeDirection=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:O})),t&&K(e.offsetAttribute)){let m=new Uint8Array(E);if(e.offsetAttribute===G.TOP)m=m.fill(1,0,E/2);else{let u=e.offsetAttribute===G.NONE?0:1;m=m.fill(u)}V.applyOffset=new S({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return V}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var X=new a;function Dt(o){let e=o.center;X=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,X),o.height,X),X=a.add(e,X,X);let t=new rt(X,o.semiMajorAxis),n=tt.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=at.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,E=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,O=t.bitangent?new Float32Array(g*3):void 0,B=e.shadowVolume,b=B?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,L=Et,J=new dt(r),Z=J.project(r.cartesianToCartographic(n,lt),Pt),q=r.scaleToGeodeticSurface(n,et);r.geodeticSurfaceNormal(q,q);let k=it.fromAxisAngle(q,E,gt),Q=R.fromQuaternion(k,Mt),j=W.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=W.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,V=p/3*2;for(let u=0;u<p;u+=3){let N=u+1,D=u+2,P=a.fromArray(o,u,et),C;if(t.st){let ot=R.multiplyByVector(Q,P,pt),$=J.project(r.cartesianToCartographic(ot,lt),xt);a.subtract($,Z,$),w.x=($.x+s)/(2*s),w.y=($.y+i)/(2*i),j.x=Math.min(w.x,j.x),j.y=Math.min(w.y,j.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+V]=w.x,l[M+1+V]=w.y,l[M++]=w.x,l[M++]=w.y}P=r.scaleToGeodeticSurface(P,P),C=a.clone(P,pt),d=r.geodeticSurfaceNormal(P,d),B&&(b[u+p]=-d.x,b[N+p]=-d.y,b[D+p]=-d.z);let ct=a.multiplyByScalar(d,f,wt);if(P=a.add(P,ct,P),ct=a.multiplyByScalar(d,h,ct),C=a.add(C,ct,C),t.position&&(c[u+p]=C.x,c[N+p]=C.y,c[D+p]=C.z,c[u]=P.x,c[N]=P.y,c[D]=P.z),t.normal||t.tangent||t.bitangent){L=a.clone(d,L);let ot=a.fromArray(o,(u+3)%p,wt);a.subtract(ot,P,ot);let $=a.subtract(C,P,xt);d=a.normalize(a.cross($,ot,d),d),t.normal&&(A[u]=d.x,A[N]=d.y,A[D]=d.z,A[u+p]=d.x,A[N+p]=d.y,A[D+p]=d.z),t.tangent&&(_=a.normalize(a.cross(L,d,_),_),x[u]=_.x,x[N]=_.y,x[D]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(O[u]=L.x,O[N]=L.y,O[D]=L.z,O[u+p]=L.x,O[N+p]=L.y,O[D+p]=L.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-j.x)/(y.x-j.x),l[u+1]=(l[u+1]-j.y)/(y.y-j.y)}let m=new ht;if(t.position&&(m.position=new S({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new S({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:O})),B&&(m.extrudeDirection=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:b})),K(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===G.TOP)u=u.fill(1,0,g/2);else{let N=e.offsetAttribute===G.NONE?0:1;u=u.fill(N)}m.applyOffset=new S({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=at.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var ut=new rt,ft=new rt;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,et),o.height,et);ut.center=a.add(e,s,ut.center),ut.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ft.center=a.add(e,s,ft.center),ft.radius=n;let i=tt.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,E=rt.union(ut,ft),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=at.createTypedArray(A*2/3,c),O=new st({attributes:g,indices:x,primitiveType:mt.TRIANGLES}),B=vt(h,o);c=zt(h);let b=at.createTypedArray(h.length*2/3,c),M=new st({attributes:B,indices:b,primitiveType:mt.TRIANGLES}),d=yt.combineInstances([new At({geometry:O}),new At({geometry:M})]);return{boundingSphere:E,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=tt.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,E=h.length/3,g=new Array(E);for(let l=0;l<E;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>I.PI&&(c.north=c.north>0?I.PI_OVER_TWO-I.EPSILON7:c.north,c.south=c.south<0?I.EPSILON7-I.PI_OVER_TWO:c.south,c.east=I.PI,c.west=-I.PI),c}function U(o){o=T(o,T.EMPTY_OBJECT);let e=o.center,t=T(o.ellipsoid,v.default),n=o.semiMajorAxis,s=o.semiMinorAxis,i=T(o.granularity,I.RADIANS_PER_DEGREE),r=T(o.vertexFormat,z.DEFAULT);if(H.defined("options.center",e),H.typeOf.number("options.semiMajorAxis",n),H.typeOf.number("options.semiMinorAxis",s),n<s)throw new nt("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new nt("granularity must be greater than zero.");let f=T(o.height,0),h=T(o.extrudedHeight,f);this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=v.clone(t),this._rotation=T(o.rotation,0),this._stRotation=T(o.stRotation,0),this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=z.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=T(o.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}U.packedLength=a.packedLength+v.packedLength+z.packedLength+9;U.pack=function(o,e,t){return H.defined("value",o),H.defined("array",e),t=T(t,0),a.pack(o._center,e,t),t+=a.packedLength,v.pack(o._ellipsoid,e,t),t+=v.packedLength,z.pack(o._vertexFormat,e,t),t+=z.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=T(o._offsetAttribute,-1),e};var Rt=new a,It=new v,Lt=new z,Y={center:Rt,ellipsoid:It,vertexFormat:Lt,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};U.unpack=function(o,e,t){H.defined("array",o),e=T(e,0);let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=v.unpack(o,e,It);e+=v.packedLength;let i=z.unpack(o,e,Lt);e+=z.packedLength;let r=o[e++],f=o[e++],h=o[e++],E=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return K(t)?(t._center=a.clone(n,t._center),t._ellipsoid=v.clone(s,t._ellipsoid),t._vertexFormat=z.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=E,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(Y.height=g,Y.extrudedHeight=l,Y.granularity=c,Y.stRotation=E,Y.rotation=h,Y.semiMajorAxis=r,Y.semiMinorAxis=f,Y.shadowVolume=A,Y.offsetAttribute=x===-1?void 0:x,new U(Y))};U.computeRectangle=function(o,e){o=T(o,T.EMPTY_OBJECT);let t=o.center,n=T(o.ellipsoid,v.default),s=o.semiMajorAxis,i=o.semiMinorAxis,r=T(o.granularity,I.RADIANS_PER_DEGREE),f=T(o.rotation,0);if(H.defined("options.center",t),H.typeOf.number("options.semiMajorAxis",s),H.typeOf.number("options.semiMinorAxis",i),s<i)throw new nt("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new nt("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};U.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!I.equalsEpsilon(e,t,0,I.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),K(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===G.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new S({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new st({attributes:i.attributes,indices:i.indices,primitiveType:mt.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};U.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new U({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:z.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=tt.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return st._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(U.prototype,{rectangle:{get:function(){return K(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return K(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=U;export{de as a}; +import{a as tt}from"./chunk-FAPED76U.js";import{a as At}from"./chunk-4MYAYFOP.js";import{a as yt}from"./chunk-FG3CL3AH.js";import{a as G}from"./chunk-N5SNKJ43.js";import{a as z}from"./chunk-6VK5R74O.js";import{a as at}from"./chunk-YFQNY2YN.js";import{a as ht}from"./chunk-NT26NNVH.js";import{b as mt,c as st,d as S}from"./chunk-NW2YE576.js";import{a as dt,d as rt}from"./chunk-2NIQ5ECB.js";import{f as it,h as bt}from"./chunk-7YEOLR2L.js";import{a as F}from"./chunk-QHHYYTCM.js";import{a,b as _t,c as W,d as v,e as R}from"./chunk-RH3GFHG2.js";import{a as I}from"./chunk-FRWNWNYJ.js";import{a as T}from"./chunk-TA3RE4KQ.js";import{a as nt,b as H}from"./chunk-RTY3VPG6.js";import{e as K}from"./chunk-LRNH5AEO.js";var et=new a,pt=new a,xt=new a,wt=new a,w=new W,Mt=new R,Vt=new R,gt=new it,Tt=new a,Nt=new a,Et=new a,lt=new _t,Pt=new a,Ft=new W,St=new W;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,E=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(E*2):void 0,l=n.normal?new Float32Array(E*3):void 0,A=n.tangent?new Float32Array(E*3):void 0,x=n.bitangent?new Float32Array(E*3):void 0,O=g?new Float32Array(E*3):void 0,B=0,b=Tt,M=Nt,d=Et,_=new dt(f),L=_.project(f.cartesianToCartographic(s,lt),Pt),J=f.scaleToGeodeticSurface(s,et);f.geodeticSurfaceNormal(J,J);let Z=Mt,q=Vt;if(h!==0){let m=it.fromAxisAngle(J,h,gt);Z=R.fromQuaternion(m,Z),m=it.fromAxisAngle(J,-h,gt),q=R.fromQuaternion(m,q)}else Z=R.clone(R.IDENTITY,Z),q=R.clone(R.IDENTITY,q);let k=W.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),Q=W.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),j=o.length,y=t?j:0,p=y/3*2;for(let m=0;m<j;m+=3){let u=m+1,N=m+2,D=a.fromArray(o,m,et);if(n.st){let P=R.multiplyByVector(Z,D,pt),C=_.project(f.cartesianToCartographic(P,lt),xt);a.subtract(C,L,C),w.x=(C.x+i)/(2*i),w.y=(C.y+r)/(2*r),k.x=Math.min(w.x,k.x),k.y=Math.min(w.y,k.y),Q.x=Math.max(w.x,Q.x),Q.y=Math.max(w.y,Q.y),t&&(c[B+p]=w.x,c[B+1+p]=w.y),c[B++]=w.x,c[B++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(D,b),g&&(O[m+y]=-b.x,O[u+y]=-b.y,O[N+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),R.multiplyByVector(q,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[N]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[N+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[N]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[N+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[N]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[N+y]=d.z))))}if(n.st){j=c.length;for(let m=0;m<j;m+=2)c[m]=(c[m]-k.x)/(Q.x-k.x),c[m+1]=(c[m+1]-k.y)/(Q.y-k.y)}let V=new ht;if(n.position){let m=tt.raisePositionsToHeight(o,e,t);V.position=new S({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(V.st=new S({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(V.normal=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(V.tangent=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(V.bitangent=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:x})),g&&(V.extrudeDirection=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:O})),t&&K(e.offsetAttribute)){let m=new Uint8Array(E);if(e.offsetAttribute===G.TOP)m=m.fill(1,0,E/2);else{let u=e.offsetAttribute===G.NONE?0:1;m=m.fill(u)}V.applyOffset=new S({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return V}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var X=new a;function Dt(o){let e=o.center;X=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,X),o.height,X),X=a.add(e,X,X);let t=new rt(X,o.semiMajorAxis),n=tt.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=at.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,E=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,O=t.bitangent?new Float32Array(g*3):void 0,B=e.shadowVolume,b=B?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,L=Et,J=new dt(r),Z=J.project(r.cartesianToCartographic(n,lt),Pt),q=r.scaleToGeodeticSurface(n,et);r.geodeticSurfaceNormal(q,q);let k=it.fromAxisAngle(q,E,gt),Q=R.fromQuaternion(k,Mt),j=W.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=W.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,V=p/3*2;for(let u=0;u<p;u+=3){let N=u+1,D=u+2,P=a.fromArray(o,u,et),C;if(t.st){let ot=R.multiplyByVector(Q,P,pt),$=J.project(r.cartesianToCartographic(ot,lt),xt);a.subtract($,Z,$),w.x=($.x+s)/(2*s),w.y=($.y+i)/(2*i),j.x=Math.min(w.x,j.x),j.y=Math.min(w.y,j.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+V]=w.x,l[M+1+V]=w.y,l[M++]=w.x,l[M++]=w.y}P=r.scaleToGeodeticSurface(P,P),C=a.clone(P,pt),d=r.geodeticSurfaceNormal(P,d),B&&(b[u+p]=-d.x,b[N+p]=-d.y,b[D+p]=-d.z);let ct=a.multiplyByScalar(d,f,wt);if(P=a.add(P,ct,P),ct=a.multiplyByScalar(d,h,ct),C=a.add(C,ct,C),t.position&&(c[u+p]=C.x,c[N+p]=C.y,c[D+p]=C.z,c[u]=P.x,c[N]=P.y,c[D]=P.z),t.normal||t.tangent||t.bitangent){L=a.clone(d,L);let ot=a.fromArray(o,(u+3)%p,wt);a.subtract(ot,P,ot);let $=a.subtract(C,P,xt);d=a.normalize(a.cross($,ot,d),d),t.normal&&(A[u]=d.x,A[N]=d.y,A[D]=d.z,A[u+p]=d.x,A[N+p]=d.y,A[D+p]=d.z),t.tangent&&(_=a.normalize(a.cross(L,d,_),_),x[u]=_.x,x[N]=_.y,x[D]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(O[u]=L.x,O[N]=L.y,O[D]=L.z,O[u+p]=L.x,O[N+p]=L.y,O[D+p]=L.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-j.x)/(y.x-j.x),l[u+1]=(l[u+1]-j.y)/(y.y-j.y)}let m=new ht;if(t.position&&(m.position=new S({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new S({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:O})),B&&(m.extrudeDirection=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:b})),K(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===G.TOP)u=u.fill(1,0,g/2);else{let N=e.offsetAttribute===G.NONE?0:1;u=u.fill(N)}m.applyOffset=new S({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=at.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var ut=new rt,ft=new rt;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,et),o.height,et);ut.center=a.add(e,s,ut.center),ut.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ft.center=a.add(e,s,ft.center),ft.radius=n;let i=tt.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,E=rt.union(ut,ft),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=at.createTypedArray(A*2/3,c),O=new st({attributes:g,indices:x,primitiveType:mt.TRIANGLES}),B=vt(h,o);c=zt(h);let b=at.createTypedArray(h.length*2/3,c),M=new st({attributes:B,indices:b,primitiveType:mt.TRIANGLES}),d=yt.combineInstances([new At({geometry:O}),new At({geometry:M})]);return{boundingSphere:E,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=tt.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,E=h.length/3,g=new Array(E);for(let l=0;l<E;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>I.PI&&(c.north=c.north>0?I.PI_OVER_TWO-I.EPSILON7:c.north,c.south=c.south<0?I.EPSILON7-I.PI_OVER_TWO:c.south,c.east=I.PI,c.west=-I.PI),c}function U(o){o=T(o,T.EMPTY_OBJECT);let e=o.center,t=T(o.ellipsoid,v.default),n=o.semiMajorAxis,s=o.semiMinorAxis,i=T(o.granularity,I.RADIANS_PER_DEGREE),r=T(o.vertexFormat,z.DEFAULT);if(H.defined("options.center",e),H.typeOf.number("options.semiMajorAxis",n),H.typeOf.number("options.semiMinorAxis",s),n<s)throw new nt("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new nt("granularity must be greater than zero.");let f=T(o.height,0),h=T(o.extrudedHeight,f);this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=v.clone(t),this._rotation=T(o.rotation,0),this._stRotation=T(o.stRotation,0),this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=z.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=T(o.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}U.packedLength=a.packedLength+v.packedLength+z.packedLength+9;U.pack=function(o,e,t){return H.defined("value",o),H.defined("array",e),t=T(t,0),a.pack(o._center,e,t),t+=a.packedLength,v.pack(o._ellipsoid,e,t),t+=v.packedLength,z.pack(o._vertexFormat,e,t),t+=z.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=T(o._offsetAttribute,-1),e};var Rt=new a,It=new v,Lt=new z,Y={center:Rt,ellipsoid:It,vertexFormat:Lt,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};U.unpack=function(o,e,t){H.defined("array",o),e=T(e,0);let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=v.unpack(o,e,It);e+=v.packedLength;let i=z.unpack(o,e,Lt);e+=z.packedLength;let r=o[e++],f=o[e++],h=o[e++],E=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return K(t)?(t._center=a.clone(n,t._center),t._ellipsoid=v.clone(s,t._ellipsoid),t._vertexFormat=z.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=E,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(Y.height=g,Y.extrudedHeight=l,Y.granularity=c,Y.stRotation=E,Y.rotation=h,Y.semiMajorAxis=r,Y.semiMinorAxis=f,Y.shadowVolume=A,Y.offsetAttribute=x===-1?void 0:x,new U(Y))};U.computeRectangle=function(o,e){o=T(o,T.EMPTY_OBJECT);let t=o.center,n=T(o.ellipsoid,v.default),s=o.semiMajorAxis,i=o.semiMinorAxis,r=T(o.granularity,I.RADIANS_PER_DEGREE),f=T(o.rotation,0);if(H.defined("options.center",t),H.typeOf.number("options.semiMajorAxis",s),H.typeOf.number("options.semiMinorAxis",i),s<i)throw new nt("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new nt("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};U.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!I.equalsEpsilon(e,t,0,I.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),K(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===G.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new S({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new st({attributes:i.attributes,indices:i.indices,primitiveType:mt.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};U.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new U({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:z.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=tt.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return st._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(U.prototype,{rectangle:{get:function(){return K(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return K(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=U;export{de as a}; diff --git a/public/js/Cesium2/Workers/chunk-RDAVO5OM.js b/public/js/Cesium2/Workers/chunk-ZBEWS6NN.js similarity index 96% rename from public/js/Cesium2/Workers/chunk-RDAVO5OM.js rename to public/js/Cesium2/Workers/chunk-ZBEWS6NN.js index 55f599fea..f562d5b96 100644 --- a/public/js/Cesium2/Workers/chunk-RDAVO5OM.js +++ b/public/js/Cesium2/Workers/chunk-ZBEWS6NN.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as p,b as P,d as q}from"./chunk-S4VBGY2U.js";import{a}from"./chunk-UCTPWOTZ.js";import{a as T}from"./chunk-N3A5CZ2S.js";import{a as I,b as g}from"./chunk-G75U3WZT.js";import{e as l}from"./chunk-3THTQ4QB.js";function y(n,i,o){if(n===0)return i*o;let t=n*n,e=t*t,c=e*t,r=c*t,h=r*t,s=h*t,d=o,u=Math.sin(2*d),f=Math.sin(4*d),M=Math.sin(6*d),_=Math.sin(8*d),E=Math.sin(10*d),S=Math.sin(12*d);return i*((1-t/4-3*e/64-5*c/256-175*r/16384-441*h/65536-4851*s/1048576)*d-(3*t/8+3*e/32+45*c/1024+105*r/4096+2205*h/131072+6237*s/524288)*u+(15*e/256+45*c/1024+525*r/16384+1575*h/65536+155925*s/8388608)*f-(35*c/3072+175*r/12288+3675*h/262144+13475*s/1048576)*M+(315*r/131072+2205*h/524288+43659*s/8388608)*_-(693*h/1310720+6237*s/5242880)*E+1001*s/8388608*S)}function z(n,i,o){let t=n/o;if(i===0)return t;let e=t*t,c=e*t,r=c*t,h=i,s=h*h,d=s*s,u=d*s,f=u*s,M=f*s,_=M*s,E=Math.sin(2*t),S=Math.cos(2*t),W=Math.sin(4*t),V=Math.cos(4*t),C=Math.sin(6*t),N=Math.cos(6*t),R=Math.sin(8*t),b=Math.cos(8*t),x=Math.sin(10*t),U=Math.cos(10*t),H=Math.sin(12*t);return t+t*s/4+7*t*d/64+15*t*u/256+579*t*f/16384+1515*t*M/65536+16837*t*_/1048576+(3*t*d/16+45*t*u/256-t*(32*e-561)*f/4096-t*(232*e-1677)*M/16384+t*(399985-90560*e+512*r)*_/5242880)*S+(21*t*u/256+483*t*f/4096-t*(224*e-1969)*M/16384-t*(33152*e-112599)*_/1048576)*V+(151*t*f/4096+4681*t*M/65536+1479*t*_/16384-453*c*_/32768)*N+(1097*t*M/65536+42783*t*_/1048576)*b+8011*t*_/1048576*U+(3*s/8+3*d/16+213*u/2048-3*e*u/64+255*f/4096-33*e*f/512+20861*M/524288-33*e*M/512+r*M/1024+28273*_/1048576-471*e*_/8192+9*r*_/4096)*E+(21*d/256+21*u/256+533*f/8192-21*e*f/512+197*M/4096-315*e*M/4096+584039*_/16777216-12517*e*_/131072+7*r*_/2048)*W+(151*u/6144+151*f/4096+5019*M/131072-453*e*M/16384+26965*_/786432-8607*e*_/131072)*C+(1097*f/131072+1097*M/65536+225797*_/10485760-1097*e*_/65536)*R+(8011*M/2621440+8011*_/1048576)*x+293393*_/251658240*H}function O(n,i){if(n===0)return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)));let o=n*Math.sin(i);return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)))-n/2*Math.log((1+o)/(1-o))}function k(n,i,o,t,e){let c=O(n._ellipticity,o),r=O(n._ellipticity,e);return Math.atan2(a.negativePiToPi(t-i),r-c)}function A(n,i,o,t,e,c,r){let h=n._heading,s=c-t,d=0;if(a.equalsEpsilon(Math.abs(h),a.PI_OVER_TWO,a.EPSILON8))if(i===o)d=i*Math.cos(e)*a.negativePiToPi(s);else{let u=Math.sin(e);d=i*Math.cos(e)*a.negativePiToPi(s)/Math.sqrt(1-n._ellipticitySquared*u*u)}else{let u=y(n._ellipticity,i,e);d=(y(n._ellipticity,i,r)-u)/Math.cos(h)}return Math.abs(d)}var B=new p,w=new p;function D(n,i,o,t){let e=p.normalize(t.cartographicToCartesian(i,w),B),c=p.normalize(t.cartographicToCartesian(o,w),w);g.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(p.angleBetween(e,c))-Math.PI),.0125);let r=t.maximumRadius,h=t.minimumRadius,s=r*r,d=h*h;n._ellipticitySquared=(s-d)/s,n._ellipticity=Math.sqrt(n._ellipticitySquared),n._start=P.clone(i,n._start),n._start.height=0,n._end=P.clone(o,n._end),n._end.height=0,n._heading=k(n,i.longitude,i.latitude,o.longitude,o.latitude),n._distance=A(n,t.maximumRadius,t.minimumRadius,i.longitude,i.latitude,o.longitude,o.latitude)}function v(n,i,o,t,e,c){if(o===0)return P.clone(n,c);let r=e*e,h,s,d;if(Math.abs(a.PI_OVER_TWO-Math.abs(i))>a.EPSILON8){let u=y(e,t,n.latitude),f=o*Math.cos(i),M=u+f;if(s=z(M,e,t),Math.abs(i)<a.EPSILON10)h=a.negativePiToPi(n.longitude);else{let _=O(e,n.latitude),E=O(e,s);d=Math.tan(i)*(E-_),h=a.negativePiToPi(n.longitude+d)}}else{s=n.latitude;let u;if(e===0)u=t*Math.cos(n.latitude);else{let f=Math.sin(n.latitude);u=t*Math.cos(n.latitude)/Math.sqrt(1-r*f*f)}d=o/u,i>0?h=a.negativePiToPi(n.longitude+d):h=a.negativePiToPi(n.longitude-d)}return l(c)?(c.longitude=h,c.latitude=s,c.height=0,c):new P(h,s,0)}function m(n,i,o){let t=T(o,q.default);this._ellipsoid=t,this._start=new P,this._end=new P,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(n)&&l(i)&&D(this,n,i,t)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return g.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return g.defined("distance",this._distance),this._heading}}});m.fromStartHeadingDistance=function(n,i,o,t,e){g.defined("start",n),g.defined("heading",i),g.defined("distance",o),g.typeOf.number.greaterThan("distance",o,0);let c=T(t,q.default),r=c.maximumRadius,h=c.minimumRadius,s=r*r,d=h*h,u=Math.sqrt((s-d)/s);i=a.negativePiToPi(i);let f=v(n,i,o,c.maximumRadius,u);return!l(e)||l(t)&&!t.equals(e.ellipsoid)?new m(n,f,c):(e.setEndPoints(n,f),e)};m.prototype.setEndPoints=function(n,i){g.defined("start",n),g.defined("end",i),D(this,n,i,this._ellipsoid)};m.prototype.interpolateUsingFraction=function(n,i){return this.interpolateUsingSurfaceDistance(n*this._distance,i)};m.prototype.interpolateUsingSurfaceDistance=function(n,i){if(g.typeOf.number("distance",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");return v(this._start,this._heading,n,this._ellipsoid.maximumRadius,this._ellipticity,i)};m.prototype.findIntersectionWithLongitude=function(n,i){if(g.typeOf.number("intersectionLongitude",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");let o=this._ellipticity,t=this._heading,e=Math.abs(t),c=this._start;if(n=a.negativePiToPi(n),a.equalsEpsilon(Math.abs(n),Math.PI,a.EPSILON14)&&(n=a.sign(c.longitude)*Math.PI),l(i)||(i=new P),Math.abs(a.PI_OVER_TWO-e)<=a.EPSILON8)return i.longitude=n,i.latitude=c.latitude,i.height=0,i;if(a.equalsEpsilon(Math.abs(a.PI_OVER_TWO-e),a.PI_OVER_TWO,a.EPSILON8))return a.equalsEpsilon(n,c.longitude,a.EPSILON12)?void 0:(i.longitude=n,i.latitude=a.PI_OVER_TWO*a.sign(a.PI_OVER_TWO-t),i.height=0,i);let r=c.latitude,h=o*Math.sin(r),s=Math.tan(.5*(a.PI_OVER_TWO+r))*Math.exp((n-c.longitude)/Math.tan(t)),d=(1+h)/(1-h),u=c.latitude,f;do{f=u;let M=o*Math.sin(f),_=(1+M)/(1-M);u=2*Math.atan(s*Math.pow(_/d,o/2))-a.PI_OVER_TWO}while(!a.equalsEpsilon(u,f,a.EPSILON12));return i.longitude=n,i.latitude=u,i.height=0,i};m.prototype.findIntersectionWithLatitude=function(n,i){if(g.typeOf.number("intersectionLatitude",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");let o=this._ellipticity,t=this._heading,e=this._start;if(a.equalsEpsilon(Math.abs(t),a.PI_OVER_TWO,a.EPSILON8))return;let c=O(o,e.latitude),r=O(o,n),h=Math.tan(t)*(r-c),s=a.negativePiToPi(e.longitude+h);return l(i)?(i.longitude=s,i.latitude=n,i.height=0,i):new P(s,n,0)};var $=m;export{$ as a}; +import{a as p,b as P,d as q}from"./chunk-RH3GFHG2.js";import{a}from"./chunk-FRWNWNYJ.js";import{a as T}from"./chunk-TA3RE4KQ.js";import{a as I,b as g}from"./chunk-RTY3VPG6.js";import{e as l}from"./chunk-LRNH5AEO.js";function y(n,i,o){if(n===0)return i*o;let t=n*n,e=t*t,c=e*t,r=c*t,h=r*t,s=h*t,d=o,u=Math.sin(2*d),f=Math.sin(4*d),M=Math.sin(6*d),_=Math.sin(8*d),E=Math.sin(10*d),S=Math.sin(12*d);return i*((1-t/4-3*e/64-5*c/256-175*r/16384-441*h/65536-4851*s/1048576)*d-(3*t/8+3*e/32+45*c/1024+105*r/4096+2205*h/131072+6237*s/524288)*u+(15*e/256+45*c/1024+525*r/16384+1575*h/65536+155925*s/8388608)*f-(35*c/3072+175*r/12288+3675*h/262144+13475*s/1048576)*M+(315*r/131072+2205*h/524288+43659*s/8388608)*_-(693*h/1310720+6237*s/5242880)*E+1001*s/8388608*S)}function z(n,i,o){let t=n/o;if(i===0)return t;let e=t*t,c=e*t,r=c*t,h=i,s=h*h,d=s*s,u=d*s,f=u*s,M=f*s,_=M*s,E=Math.sin(2*t),S=Math.cos(2*t),W=Math.sin(4*t),V=Math.cos(4*t),C=Math.sin(6*t),N=Math.cos(6*t),R=Math.sin(8*t),b=Math.cos(8*t),x=Math.sin(10*t),U=Math.cos(10*t),H=Math.sin(12*t);return t+t*s/4+7*t*d/64+15*t*u/256+579*t*f/16384+1515*t*M/65536+16837*t*_/1048576+(3*t*d/16+45*t*u/256-t*(32*e-561)*f/4096-t*(232*e-1677)*M/16384+t*(399985-90560*e+512*r)*_/5242880)*S+(21*t*u/256+483*t*f/4096-t*(224*e-1969)*M/16384-t*(33152*e-112599)*_/1048576)*V+(151*t*f/4096+4681*t*M/65536+1479*t*_/16384-453*c*_/32768)*N+(1097*t*M/65536+42783*t*_/1048576)*b+8011*t*_/1048576*U+(3*s/8+3*d/16+213*u/2048-3*e*u/64+255*f/4096-33*e*f/512+20861*M/524288-33*e*M/512+r*M/1024+28273*_/1048576-471*e*_/8192+9*r*_/4096)*E+(21*d/256+21*u/256+533*f/8192-21*e*f/512+197*M/4096-315*e*M/4096+584039*_/16777216-12517*e*_/131072+7*r*_/2048)*W+(151*u/6144+151*f/4096+5019*M/131072-453*e*M/16384+26965*_/786432-8607*e*_/131072)*C+(1097*f/131072+1097*M/65536+225797*_/10485760-1097*e*_/65536)*R+(8011*M/2621440+8011*_/1048576)*x+293393*_/251658240*H}function O(n,i){if(n===0)return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)));let o=n*Math.sin(i);return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)))-n/2*Math.log((1+o)/(1-o))}function k(n,i,o,t,e){let c=O(n._ellipticity,o),r=O(n._ellipticity,e);return Math.atan2(a.negativePiToPi(t-i),r-c)}function A(n,i,o,t,e,c,r){let h=n._heading,s=c-t,d=0;if(a.equalsEpsilon(Math.abs(h),a.PI_OVER_TWO,a.EPSILON8))if(i===o)d=i*Math.cos(e)*a.negativePiToPi(s);else{let u=Math.sin(e);d=i*Math.cos(e)*a.negativePiToPi(s)/Math.sqrt(1-n._ellipticitySquared*u*u)}else{let u=y(n._ellipticity,i,e);d=(y(n._ellipticity,i,r)-u)/Math.cos(h)}return Math.abs(d)}var B=new p,w=new p;function D(n,i,o,t){let e=p.normalize(t.cartographicToCartesian(i,w),B),c=p.normalize(t.cartographicToCartesian(o,w),w);g.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(p.angleBetween(e,c))-Math.PI),.0125);let r=t.maximumRadius,h=t.minimumRadius,s=r*r,d=h*h;n._ellipticitySquared=(s-d)/s,n._ellipticity=Math.sqrt(n._ellipticitySquared),n._start=P.clone(i,n._start),n._start.height=0,n._end=P.clone(o,n._end),n._end.height=0,n._heading=k(n,i.longitude,i.latitude,o.longitude,o.latitude),n._distance=A(n,t.maximumRadius,t.minimumRadius,i.longitude,i.latitude,o.longitude,o.latitude)}function v(n,i,o,t,e,c){if(o===0)return P.clone(n,c);let r=e*e,h,s,d;if(Math.abs(a.PI_OVER_TWO-Math.abs(i))>a.EPSILON8){let u=y(e,t,n.latitude),f=o*Math.cos(i),M=u+f;if(s=z(M,e,t),Math.abs(i)<a.EPSILON10)h=a.negativePiToPi(n.longitude);else{let _=O(e,n.latitude),E=O(e,s);d=Math.tan(i)*(E-_),h=a.negativePiToPi(n.longitude+d)}}else{s=n.latitude;let u;if(e===0)u=t*Math.cos(n.latitude);else{let f=Math.sin(n.latitude);u=t*Math.cos(n.latitude)/Math.sqrt(1-r*f*f)}d=o/u,i>0?h=a.negativePiToPi(n.longitude+d):h=a.negativePiToPi(n.longitude-d)}return l(c)?(c.longitude=h,c.latitude=s,c.height=0,c):new P(h,s,0)}function m(n,i,o){let t=T(o,q.default);this._ellipsoid=t,this._start=new P,this._end=new P,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(n)&&l(i)&&D(this,n,i,t)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return g.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return g.defined("distance",this._distance),this._heading}}});m.fromStartHeadingDistance=function(n,i,o,t,e){g.defined("start",n),g.defined("heading",i),g.defined("distance",o),g.typeOf.number.greaterThan("distance",o,0);let c=T(t,q.default),r=c.maximumRadius,h=c.minimumRadius,s=r*r,d=h*h,u=Math.sqrt((s-d)/s);i=a.negativePiToPi(i);let f=v(n,i,o,c.maximumRadius,u);return!l(e)||l(t)&&!t.equals(e.ellipsoid)?new m(n,f,c):(e.setEndPoints(n,f),e)};m.prototype.setEndPoints=function(n,i){g.defined("start",n),g.defined("end",i),D(this,n,i,this._ellipsoid)};m.prototype.interpolateUsingFraction=function(n,i){return this.interpolateUsingSurfaceDistance(n*this._distance,i)};m.prototype.interpolateUsingSurfaceDistance=function(n,i){if(g.typeOf.number("distance",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");return v(this._start,this._heading,n,this._ellipsoid.maximumRadius,this._ellipticity,i)};m.prototype.findIntersectionWithLongitude=function(n,i){if(g.typeOf.number("intersectionLongitude",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");let o=this._ellipticity,t=this._heading,e=Math.abs(t),c=this._start;if(n=a.negativePiToPi(n),a.equalsEpsilon(Math.abs(n),Math.PI,a.EPSILON14)&&(n=a.sign(c.longitude)*Math.PI),l(i)||(i=new P),Math.abs(a.PI_OVER_TWO-e)<=a.EPSILON8)return i.longitude=n,i.latitude=c.latitude,i.height=0,i;if(a.equalsEpsilon(Math.abs(a.PI_OVER_TWO-e),a.PI_OVER_TWO,a.EPSILON8))return a.equalsEpsilon(n,c.longitude,a.EPSILON12)?void 0:(i.longitude=n,i.latitude=a.PI_OVER_TWO*a.sign(a.PI_OVER_TWO-t),i.height=0,i);let r=c.latitude,h=o*Math.sin(r),s=Math.tan(.5*(a.PI_OVER_TWO+r))*Math.exp((n-c.longitude)/Math.tan(t)),d=(1+h)/(1-h),u=c.latitude,f;do{f=u;let M=o*Math.sin(f),_=(1+M)/(1-M);u=2*Math.atan(s*Math.pow(_/d,o/2))-a.PI_OVER_TWO}while(!a.equalsEpsilon(u,f,a.EPSILON12));return i.longitude=n,i.latitude=u,i.height=0,i};m.prototype.findIntersectionWithLatitude=function(n,i){if(g.typeOf.number("intersectionLatitude",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");let o=this._ellipticity,t=this._heading,e=this._start;if(a.equalsEpsilon(Math.abs(t),a.PI_OVER_TWO,a.EPSILON8))return;let c=O(o,e.latitude),r=O(o,n),h=Math.tan(t)*(r-c),s=a.negativePiToPi(e.longitude+h);return l(i)?(i.longitude=s,i.latitude=n,i.height=0,i):new P(s,n,0)};var $=m;export{$ as a}; diff --git a/public/js/Cesium2/Workers/chunk-ZMGESOEZ.js b/public/js/Cesium2/Workers/chunk-ZMGESOEZ.js new file mode 100644 index 000000000..595196d61 --- /dev/null +++ b/public/js/Cesium2/Workers/chunk-ZMGESOEZ.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.125 + * + * Copyright 2011-2022 Cesium Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Columbus View (Pat. Pend.) + * + * Portions licensed separately. + * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. + */ + +import{a as ct}from"./chunk-ZBEWS6NN.js";import{b as at,c as ht,d as nt}from"./chunk-NW2YE576.js";import{a as et}from"./chunk-QHHYYTCM.js";import{a,b as tt,c as g,d as vt}from"./chunk-RH3GFHG2.js";import{a as Y}from"./chunk-FRWNWNYJ.js";import{a as xt}from"./chunk-UKWFHLUK.js";import{a as K}from"./chunk-TA3RE4KQ.js";import{b as A}from"./chunk-RTY3VPG6.js";import{e as F}from"./chunk-LRNH5AEO.js";var ut={CLOCKWISE:xt.CW,COUNTER_CLOCKWISE:xt.CCW};ut.validate=function(t){return t===ut.CLOCKWISE||t===ut.COUNTER_CLOCKWISE};var pt=Object.freeze(ut);function dt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=St(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=Wt(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return it(s,i,e,c,x,u,0),i}function St(t,n,e,o,r){let s;if(r===qt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=wt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=wt(i/o|0,t[i],t[i+1],s);return s&&V(s,s.next)&&(st(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(V(e,e.next)||w(e.prev,e,e.next)===0)){if(st(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function it(t,n,e,o,r,s,i){if(!t)return;!i&&s&&kt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?zt(t,o,r,s):Rt(t)){n.push(x.i,t.i,u.i),st(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=Bt(N(t),n),it(t,n,e,o,r,s,2)):i===2&&It(t,n,e,o,r,s):it(N(t),n,e,o,r,s,1);break}}}function Rt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&rt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function zt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=yt(S,h,n,e,o),D=yt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&rt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&rt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&rt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&rt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Bt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!V(o,r)&&Mt(o,e,e.next,r)&&ot(o,r)&&ot(r,o)&&(n.push(o.i,e.i,r.i),st(e),st(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function It(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&Kt(i,c)){let x=At(i,c);i=N(i,i.next),x=N(x,x.next),it(i,n,e,o,r,s,0),it(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function Wt(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=St(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(_t(u))}r.sort($t);for(let s=0;s<r.length;s++)e=Gt(r[s],e);return e}function $t(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function Gt(t,n){let e=Ht(t,n);if(!e)return n;let o=At(e,t);return N(o,o.next),N(e,e.next)}function Ht(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(V(t,e))return e;do{if(V(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&bt(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);ot(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Nt(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Nt(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function kt(t,n,e,o){let r=t;do r.z===0&&(r.z=yt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,Ut(r)}function Ut(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function yt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function _t(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function bt(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function rt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&bt(t,n,e,o,r,s,i,c)}function Kt(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Vt(t,n)&&(ot(t,n)&&ot(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||V(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function V(t,n){return t.x===n.x&&t.y===n.y}function Mt(t,n,e,o){let r=ft(w(t,n,e)),s=ft(w(t,n,o)),i=ft(w(e,o,t)),c=ft(w(e,o,n));return!!(r!==s&&i!==c||r===0&<(t,e,n)||s===0&<(t,o,n)||i===0&<(e,t,o)||c===0&<(e,n,o))}function lt(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function ft(t){return t>0?1:t<0?-1:0}function Vt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&Mt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function ot(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function At(t,n){let e=mt(t.i,t.x,t.y),o=mt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function wt(t,n,e,o){let r=mt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function st(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function mt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function qt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var Jt=new a,Qt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?pt.COUNTER_CLOCKWISE:pt.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return dt(e,n,2)};var Ot=new a,Zt=new a,Lt=new a,Ct=new a,Et=new a,Tt=new a,R=new a,Ft=new g,Dt=new g,Pt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=K(r,Y.RADIANS_PER_DEGREE);let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=Y.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Ot),C=a.fromArray(u,f*3,Zt),q=a.fromArray(u,l*3,Lt),J,Q,I;s&&(J=g.fromArray(p,m*2,Ft),Q=g.fromArray(p,f*2,Dt),I=g.fromArray(p,l*2,Pt));let k=a.multiplyByScalar(a.normalize(M,Ct),T,Ct),U=a.multiplyByScalar(a.normalize(C,Et),T,Et),W=a.multiplyByScalar(a.normalize(q,Tt),T,Tt),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),X=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,X),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,Q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,q,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(Q,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):X===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(q,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new nt({componentDatatype:et.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:at.TRIANGLES};return s&&(D.attributes.st=new nt({componentDatatype:et.FLOAT,componentsPerAttribute:2,values:p})),new ht(D)};var Xt=new tt,Yt=new tt,te=new tt,gt=new tt;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=K(r,Y.RADIANS_PER_DEGREE);let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=Y.chordLength(r,T),z=new ct(void 0,void 0,t),D=new ct(void 0,void 0,t),l=new ct(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),q=a.fromArray(u,C*3,Ot),J=a.fromArray(u,M*3,Zt),Q=a.fromArray(u,m*3,Lt),I,k,U;s&&(I=g.fromArray(p,C*2,Ft),k=g.fromArray(p,M*2,Dt),U=g.fromArray(p,m*2,Pt));let W=t.cartesianToCartographic(q,Xt),$=t.cartesianToCartographic(J,Yt),G=t.cartesianToCartographic(Q,te);z.setEndPoints(W,$);let X=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(X,H,O),d,P,_,Z,E;v>L?X===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,gt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,gt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,gt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new nt({componentDatatype:et.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:at.TRIANGLES};return s&&(f.attributes.st=new nt({componentDatatype:et.FLOAT,componentsPerAttribute:2,values:p})),new ht(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=K(e,vt.default);let r=Jt,s=Qt;if(n=K(n,0),o=K(o,!0),F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var ve=B;export{pt as a,ve as b}; diff --git a/public/js/Cesium2/Workers/combineGeometry.js b/public/js/Cesium2/Workers/combineGeometry.js index 77c299ea3..7fa294221 100644 --- a/public/js/Cesium2/Workers/combineGeometry.js +++ b/public/js/Cesium2/Workers/combineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as e}from"./chunk-XSINRSN5.js";import{a as r}from"./chunk-4BYMTYMT.js";import"./chunk-UJMUN4NO.js";import"./chunk-72CGGEJF.js";import"./chunk-Q5MYX5A2.js";import"./chunk-OZYLWM74.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import"./chunk-3THTQ4QB.js";function n(o,t){let m=e.unpackCombineGeometryParameters(o),i=e.combineGeometry(m);return e.packCombineGeometryResults(i,t)}var c=r(n);export{c as default}; +import{a as e}from"./chunk-JRKXMAM5.js";import{a as r}from"./chunk-4E3APMCC.js";import"./chunk-HMHR6SIB.js";import"./chunk-FG3CL3AH.js";import"./chunk-VMXXQ6B4.js";import"./chunk-XCRMBS5M.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import"./chunk-LRNH5AEO.js";function n(o,t){let m=e.unpackCombineGeometryParameters(o),i=e.combineGeometry(m);return e.packCombineGeometryResults(i,t)}var c=r(n);export{c as default}; diff --git a/public/js/Cesium2/Workers/createBoxGeometry.js b/public/js/Cesium2/Workers/createBoxGeometry.js index 6c08fe497..f994a6743 100644 --- a/public/js/Cesium2/Workers/createBoxGeometry.js +++ b/public/js/Cesium2/Workers/createBoxGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as r}from"./chunk-ZHF7X3YD.js";import"./chunk-5CC3QRYS.js";import"./chunk-6HIVPZ7K.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{e as o}from"./chunk-3THTQ4QB.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; +import{a as r}from"./chunk-DTSLUHDY.js";import"./chunk-N5SNKJ43.js";import"./chunk-6VK5R74O.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{e as o}from"./chunk-LRNH5AEO.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; diff --git a/public/js/Cesium2/Workers/createBoxOutlineGeometry.js b/public/js/Cesium2/Workers/createBoxOutlineGeometry.js index 1404b7e68..738b36b89 100644 --- a/public/js/Cesium2/Workers/createBoxOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createBoxOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as d}from"./chunk-5CC3QRYS.js";import{a as l}from"./chunk-24JYWT5N.js";import{b as O,c as h,d as p}from"./chunk-LH3SUUXG.js";import{d as A}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a}from"./chunk-D5HNP2LB.js";import{a as m}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as u}from"./chunk-N3A5CZ2S.js";import{a as b,b as r}from"./chunk-G75U3WZT.js";import{e as c}from"./chunk-3THTQ4QB.js";var g=new m;function f(e){e=u(e,u.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;if(r.typeOf.object("min",t),r.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===d.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}f.fromDimensions=function(e){e=u(e,u.EMPTY_OBJECT);let t=e.dimensions;r.typeOf.object("dimensions",t),r.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),r.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),r.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=m.multiplyByScalar(t,.5,new m);return new f({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(e){return r.typeOf.object("boundindBox",e),new f({minimum:e.minimum,maximum:e.maximum})};f.packedLength=2*m.packedLength+1;f.pack=function(e,t,n){return r.typeOf.object("value",e),r.defined("array",t),n=u(n,0),m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=u(e._offsetAttribute,-1),t};var w=new m,x=new m,_={minimum:w,maximum:x,offsetAttribute:void 0};f.unpack=function(e,t,n){r.defined("array",e),t=u(t,0);let s=m.unpack(e,t,w),o=m.unpack(e,t+m.packedLength,x),i=e[t+m.packedLength*2];return c(n)?(n._min=m.clone(s,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=i===-1?void 0:i,n):(_.offsetAttribute=i===-1?void 0:i,new f(_))};f.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let s=new l,o=new Uint16Array(12*2),i=new Float64Array(8*3);i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=n.x,i[4]=t.y,i[5]=t.z,i[6]=n.x,i[7]=n.y,i[8]=t.z,i[9]=t.x,i[10]=n.y,i[11]=t.z,i[12]=t.x,i[13]=t.y,i[14]=n.z,i[15]=n.x,i[16]=t.y,i[17]=n.z,i[18]=n.x,i[19]=n.y,i[20]=n.z,i[21]=t.x,i[22]=n.y,i[23]=n.z,s.position=new p({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:i}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let k=m.subtract(n,t,g),E=m.magnitude(k)*.5;if(c(e._offsetAttribute)){let T=i.length,B=e._offsetAttribute===d.NONE?0:1,z=new Uint8Array(T/3).fill(B);s.applyOffset=new p({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:z})}return new h({attributes:s,indices:o,primitiveType:O.LINES,boundingSphere:new A(m.ZERO,E),offsetAttribute:e._offsetAttribute})};var y=f;function L(e,t){return c(t)&&(e=y.unpack(e,t)),y.createGeometry(e)}var R=L;export{R as default}; +import{a as d}from"./chunk-N5SNKJ43.js";import{a as l}from"./chunk-NT26NNVH.js";import{b as O,c as h,d as p}from"./chunk-NW2YE576.js";import{d as A}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a}from"./chunk-QHHYYTCM.js";import{a as m}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as u}from"./chunk-TA3RE4KQ.js";import{a as b,b as r}from"./chunk-RTY3VPG6.js";import{e as c}from"./chunk-LRNH5AEO.js";var g=new m;function f(e){e=u(e,u.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;if(r.typeOf.object("min",t),r.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===d.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}f.fromDimensions=function(e){e=u(e,u.EMPTY_OBJECT);let t=e.dimensions;r.typeOf.object("dimensions",t),r.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),r.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),r.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=m.multiplyByScalar(t,.5,new m);return new f({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(e){return r.typeOf.object("boundindBox",e),new f({minimum:e.minimum,maximum:e.maximum})};f.packedLength=2*m.packedLength+1;f.pack=function(e,t,n){return r.typeOf.object("value",e),r.defined("array",t),n=u(n,0),m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=u(e._offsetAttribute,-1),t};var w=new m,x=new m,_={minimum:w,maximum:x,offsetAttribute:void 0};f.unpack=function(e,t,n){r.defined("array",e),t=u(t,0);let s=m.unpack(e,t,w),o=m.unpack(e,t+m.packedLength,x),i=e[t+m.packedLength*2];return c(n)?(n._min=m.clone(s,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=i===-1?void 0:i,n):(_.offsetAttribute=i===-1?void 0:i,new f(_))};f.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let s=new l,o=new Uint16Array(12*2),i=new Float64Array(8*3);i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=n.x,i[4]=t.y,i[5]=t.z,i[6]=n.x,i[7]=n.y,i[8]=t.z,i[9]=t.x,i[10]=n.y,i[11]=t.z,i[12]=t.x,i[13]=t.y,i[14]=n.z,i[15]=n.x,i[16]=t.y,i[17]=n.z,i[18]=n.x,i[19]=n.y,i[20]=n.z,i[21]=t.x,i[22]=n.y,i[23]=n.z,s.position=new p({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:i}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let k=m.subtract(n,t,g),E=m.magnitude(k)*.5;if(c(e._offsetAttribute)){let T=i.length,B=e._offsetAttribute===d.NONE?0:1,z=new Uint8Array(T/3).fill(B);s.applyOffset=new p({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:z})}return new h({attributes:s,indices:o,primitiveType:O.LINES,boundingSphere:new A(m.ZERO,E),offsetAttribute:e._offsetAttribute})};var y=f;function L(e,t){return c(t)&&(e=y.unpack(e,t)),y.createGeometry(e)}var R=L;export{R as default}; diff --git a/public/js/Cesium2/Workers/createCircleGeometry.js b/public/js/Cesium2/Workers/createCircleGeometry.js index fcdc2d670..85ec44688 100644 --- a/public/js/Cesium2/Workers/createCircleGeometry.js +++ b/public/js/Cesium2/Workers/createCircleGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as l}from"./chunk-IF6EJ7KL.js";import"./chunk-MWSGYAUE.js";import"./chunk-W5MIOKEY.js";import"./chunk-72CGGEJF.js";import"./chunk-Q5MYX5A2.js";import"./chunk-OZYLWM74.js";import"./chunk-5CC3QRYS.js";import{a as m}from"./chunk-6HIVPZ7K.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a,d as s}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as c}from"./chunk-N3A5CZ2S.js";import{b as p}from"./chunk-G75U3WZT.js";import{e as d}from"./chunk-3THTQ4QB.js";function n(e){e=c(e,c.EMPTY_OBJECT);let r=e.radius;p.typeOf.number("radius",r);let o={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new l(o),this._workerName="createCircleGeometry"}n.packedLength=l.packedLength;n.pack=function(e,r,o){return p.typeOf.object("value",e),l.pack(e._ellipseGeometry,r,o)};var f=new l({center:new a,semiMajorAxis:1,semiMinorAxis:1}),t={center:new a,radius:void 0,ellipsoid:s.clone(s.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new m,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};n.unpack=function(e,r,o){let i=l.unpack(e,r,f);return t.center=a.clone(i._center,t.center),t.ellipsoid=s.clone(i._ellipsoid,t.ellipsoid),t.ellipsoid=s.clone(i._ellipsoid,f._ellipsoid),t.height=i._height,t.extrudedHeight=i._extrudedHeight,t.granularity=i._granularity,t.vertexFormat=m.clone(i._vertexFormat,t.vertexFormat),t.stRotation=i._stRotation,t.shadowVolume=i._shadowVolume,d(o)?(t.semiMajorAxis=i._semiMajorAxis,t.semiMinorAxis=i._semiMinorAxis,o._ellipseGeometry=new l(t),o):(t.radius=i._semiMajorAxis,new n(t))};n.createGeometry=function(e){return l.createGeometry(e._ellipseGeometry)};n.createShadowVolume=function(e,r,o){let i=e._ellipseGeometry._granularity,u=e._ellipseGeometry._ellipsoid,h=r(i,u),x=o(i,u);return new n({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:u,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:h,height:x,vertexFormat:m.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(n.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var _=n;function g(e,r){return d(r)&&(e=_.unpack(e,r)),e._ellipseGeometry._center=a.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=s.clone(e._ellipseGeometry._ellipsoid),_.createGeometry(e)}var H=g;export{H as default}; +import{a as l}from"./chunk-YGBGLFI5.js";import"./chunk-FAPED76U.js";import"./chunk-4MYAYFOP.js";import"./chunk-FG3CL3AH.js";import"./chunk-VMXXQ6B4.js";import"./chunk-XCRMBS5M.js";import"./chunk-N5SNKJ43.js";import{a as m}from"./chunk-6VK5R74O.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a,d as s}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as c}from"./chunk-TA3RE4KQ.js";import{b as p}from"./chunk-RTY3VPG6.js";import{e as d}from"./chunk-LRNH5AEO.js";function n(e){e=c(e,c.EMPTY_OBJECT);let r=e.radius;p.typeOf.number("radius",r);let o={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new l(o),this._workerName="createCircleGeometry"}n.packedLength=l.packedLength;n.pack=function(e,r,o){return p.typeOf.object("value",e),l.pack(e._ellipseGeometry,r,o)};var f=new l({center:new a,semiMajorAxis:1,semiMinorAxis:1}),t={center:new a,radius:void 0,ellipsoid:s.clone(s.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new m,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};n.unpack=function(e,r,o){let i=l.unpack(e,r,f);return t.center=a.clone(i._center,t.center),t.ellipsoid=s.clone(i._ellipsoid,t.ellipsoid),t.ellipsoid=s.clone(i._ellipsoid,f._ellipsoid),t.height=i._height,t.extrudedHeight=i._extrudedHeight,t.granularity=i._granularity,t.vertexFormat=m.clone(i._vertexFormat,t.vertexFormat),t.stRotation=i._stRotation,t.shadowVolume=i._shadowVolume,d(o)?(t.semiMajorAxis=i._semiMajorAxis,t.semiMinorAxis=i._semiMinorAxis,o._ellipseGeometry=new l(t),o):(t.radius=i._semiMajorAxis,new n(t))};n.createGeometry=function(e){return l.createGeometry(e._ellipseGeometry)};n.createShadowVolume=function(e,r,o){let i=e._ellipseGeometry._granularity,u=e._ellipseGeometry._ellipsoid,h=r(i,u),x=o(i,u);return new n({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:u,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:h,height:x,vertexFormat:m.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(n.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var _=n;function g(e,r){return d(r)&&(e=_.unpack(e,r)),e._ellipseGeometry._center=a.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=s.clone(e._ellipseGeometry._ellipsoid),_.createGeometry(e)}var H=g;export{H as default}; diff --git a/public/js/Cesium2/Workers/createCircleOutlineGeometry.js b/public/js/Cesium2/Workers/createCircleOutlineGeometry.js index b53dcefc0..a86162aa4 100644 --- a/public/js/Cesium2/Workers/createCircleOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createCircleOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as n}from"./chunk-SYY6FTAS.js";import"./chunk-MWSGYAUE.js";import"./chunk-5CC3QRYS.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as o,d as s}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as u}from"./chunk-N3A5CZ2S.js";import{b as d}from"./chunk-G75U3WZT.js";import{e as a}from"./chunk-3THTQ4QB.js";function m(e){e=u(e,u.EMPTY_OBJECT);let r=e.radius;d.typeOf.number("radius",r);let l={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(l),this._workerName="createCircleOutlineGeometry"}m.packedLength=n.packedLength;m.pack=function(e,r,l){return d.typeOf.object("value",e),n.pack(e._ellipseGeometry,r,l)};var p=new n({center:new o,semiMajorAxis:1,semiMinorAxis:1}),i={center:new o,radius:void 0,ellipsoid:s.clone(s.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};m.unpack=function(e,r,l){let t=n.unpack(e,r,p);return i.center=o.clone(t._center,i.center),i.ellipsoid=s.clone(t._ellipsoid,i.ellipsoid),i.height=t._height,i.extrudedHeight=t._extrudedHeight,i.granularity=t._granularity,i.numberOfVerticalLines=t._numberOfVerticalLines,a(l)?(i.semiMajorAxis=t._semiMajorAxis,i.semiMinorAxis=t._semiMinorAxis,l._ellipseGeometry=new n(i),l):(i.radius=t._semiMajorAxis,new m(i))};m.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)};var c=m;function f(e,r){return a(r)&&(e=c.unpack(e,r)),e._ellipseGeometry._center=o.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=s.clone(e._ellipseGeometry._ellipsoid),c.createGeometry(e)}var E=f;export{E as default}; +import{a as n}from"./chunk-OIKPZP2Y.js";import"./chunk-FAPED76U.js";import"./chunk-N5SNKJ43.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as o,d as s}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as u}from"./chunk-TA3RE4KQ.js";import{b as d}from"./chunk-RTY3VPG6.js";import{e as a}from"./chunk-LRNH5AEO.js";function m(e){e=u(e,u.EMPTY_OBJECT);let r=e.radius;d.typeOf.number("radius",r);let l={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(l),this._workerName="createCircleOutlineGeometry"}m.packedLength=n.packedLength;m.pack=function(e,r,l){return d.typeOf.object("value",e),n.pack(e._ellipseGeometry,r,l)};var p=new n({center:new o,semiMajorAxis:1,semiMinorAxis:1}),i={center:new o,radius:void 0,ellipsoid:s.clone(s.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};m.unpack=function(e,r,l){let t=n.unpack(e,r,p);return i.center=o.clone(t._center,i.center),i.ellipsoid=s.clone(t._ellipsoid,i.ellipsoid),i.height=t._height,i.extrudedHeight=t._extrudedHeight,i.granularity=t._granularity,i.numberOfVerticalLines=t._numberOfVerticalLines,a(l)?(i.semiMajorAxis=t._semiMajorAxis,i.semiMinorAxis=t._semiMinorAxis,l._ellipseGeometry=new n(i),l):(i.radius=t._semiMajorAxis,new m(i))};m.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)};var c=m;function f(e,r){return a(r)&&(e=c.unpack(e,r)),e._ellipseGeometry._center=o.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=s.clone(e._ellipseGeometry._ellipsoid),c.createGeometry(e)}var E=f;export{E as default}; diff --git a/public/js/Cesium2/Workers/createCoplanarPolygonGeometry.js b/public/js/Cesium2/Workers/createCoplanarPolygonGeometry.js index 0d966884f..ca946ab37 100644 --- a/public/js/Cesium2/Workers/createCoplanarPolygonGeometry.js +++ b/public/js/Cesium2/Workers/createCoplanarPolygonGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as et}from"./chunk-PJUDOIE3.js";import{a as U}from"./chunk-FNTGP2KW.js";import"./chunk-SOCYD7RP.js";import{a as y}from"./chunk-HTYD62GU.js";import"./chunk-HQ4YU6WD.js";import{a as I}from"./chunk-W5MIOKEY.js";import{a as $}from"./chunk-72CGGEJF.js";import"./chunk-Q5MYX5A2.js";import"./chunk-OZYLWM74.js";import{a as u}from"./chunk-6HIVPZ7K.js";import"./chunk-CTRWX4F5.js";import"./chunk-Z7BLUZ7R.js";import{b as ot}from"./chunk-WJYW7YDO.js";import{a as tt}from"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as J}from"./chunk-34ULWVZF.js";import{a as X}from"./chunk-24JYWT5N.js";import{b as W,c as Y,d as z}from"./chunk-LH3SUUXG.js";import{d as K}from"./chunk-K2M3OJ7Z.js";import{f as Q}from"./chunk-M3A6SPGI.js";import{a as N}from"./chunk-D5HNP2LB.js";import{a as i,c as x,d as m,e as P}from"./chunk-S4VBGY2U.js";import{a as q}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as f}from"./chunk-N3A5CZ2S.js";import{b as B}from"./chunk-G75U3WZT.js";import{e as g}from"./chunk-3THTQ4QB.js";var st=new i,at=new et,pt=new x,lt=new x,mt=new i,ft=new i,ut=new i,V=new i,yt=new i,ht=new i,nt=new Q,dt=new P,gt=new P,Pt=new i;function wt(e,t,o,a,h,A,r,n,p){let b=e.positions,c=ot.triangulate(e.positions2D,e.holes);c.length<3&&(c=[0,1,2]);let w=J.createTypedArray(b.length,c.length);w.set(c);let D=dt;if(a!==0){let d=Q.fromAxisAngle(r,a,nt);if(D=P.fromQuaternion(d,D),t.tangent||t.bitangent){d=Q.fromAxisAngle(r,-a,nt);let G=P.fromQuaternion(d,gt);n=i.normalize(P.multiplyByVector(G,n,n),n),t.bitangent&&(p=i.normalize(i.cross(r,n,p),p))}}else D=P.clone(P.IDENTITY,D);let j=lt;t.st&&(j.x=o.x,j.y=o.y);let k=b.length,C=k*3,L=new Float64Array(C),T=t.normal?new Float32Array(C):void 0,R=t.tangent?new Float32Array(C):void 0,S=t.bitangent?new Float32Array(C):void 0,H=t.st?new Float32Array(k*2):void 0,M=0,F=0,l=0,O=0,s=0;for(let d=0;d<k;d++){let G=b[d];if(L[M++]=G.x,L[M++]=G.y,L[M++]=G.z,t.st)if(g(h)&&h.positions.length===k)H[s++]=h.positions[d].x,H[s++]=h.positions[d].y;else{let it=P.multiplyByVector(D,G,st),v=A(it,pt);x.subtract(v,j,v);let rt=q.clamp(v.x/o.width,0,1),ct=q.clamp(v.y/o.height,0,1);H[s++]=rt,H[s++]=ct}t.normal&&(T[F++]=r.x,T[F++]=r.y,T[F++]=r.z),t.tangent&&(R[O++]=n.x,R[O++]=n.y,R[O++]=n.z),t.bitangent&&(S[l++]=p.x,S[l++]=p.y,S[l++]=p.z)}let _=new X;return t.position&&(_.position=new z({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:L})),t.normal&&(_.normal=new z({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:T})),t.tangent&&(_.tangent=new z({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:R})),t.bitangent&&(_.bitangent=new z({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:S})),t.st&&(_.st=new z({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:H})),new Y({attributes:_,indices:w,primitiveType:W.TRIANGLES})}function E(e){e=f(e,f.EMPTY_OBJECT);let t=e.polygonHierarchy,o=e.textureCoordinates;B.defined("options.polygonHierarchy",t);let a=f(e.vertexFormat,u.DEFAULT);this._vertexFormat=u.clone(a),this._polygonHierarchy=t,this._stRotation=f(e.stRotation,0),this._ellipsoid=m.clone(f(e.ellipsoid,m.default)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=o,this.packedLength=y.computeHierarchyPackedLength(t,i)+u.packedLength+m.packedLength+(g(o)?y.computeHierarchyPackedLength(o,x):1)+2}E.fromPositions=function(e){e=f(e,f.EMPTY_OBJECT),B.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new E(t)};E.pack=function(e,t,o){return B.typeOf.object("value",e),B.defined("array",t),o=f(o,0),o=y.packPolygonHierarchy(e._polygonHierarchy,t,o,i),m.pack(e._ellipsoid,t,o),o+=m.packedLength,u.pack(e._vertexFormat,t,o),o+=u.packedLength,t[o++]=e._stRotation,g(e._textureCoordinates)?o=y.packPolygonHierarchy(e._textureCoordinates,t,o,x):t[o++]=-1,t[o++]=e.packedLength,t};var _t=m.clone(m.UNIT_SPHERE),At=new u,bt={polygonHierarchy:{}};E.unpack=function(e,t,o){B.defined("array",e),t=f(t,0);let a=y.unpackPolygonHierarchy(e,t,i);t=a.startingIndex,delete a.startingIndex;let h=m.unpack(e,t,_t);t+=m.packedLength;let A=u.unpack(e,t,At);t+=u.packedLength;let r=e[t++],n=e[t]===-1?void 0:y.unpackPolygonHierarchy(e,t,x);g(n)?(t=n.startingIndex,delete n.startingIndex):t++;let p=e[t++];return g(o)||(o=new E(bt)),o._polygonHierarchy=a,o._ellipsoid=m.clone(h,o._ellipsoid),o._vertexFormat=u.clone(A,o._vertexFormat),o._stRotation=r,o._textureCoordinates=n,o.packedLength=p,o};E.createGeometry=function(e){let t=e._vertexFormat,o=e._polygonHierarchy,a=e._stRotation,h=e._textureCoordinates,A=g(h),r=o.positions;if(r=tt(r,i.equalsEpsilon,!0),r.length<3)return;let n=mt,p=ft,b=ut,c=yt,w=ht;if(!U.computeProjectTo2DArguments(r,V,c,w))return;if(n=i.cross(c,w,n),n=i.normalize(n,n),!i.equalsEpsilon(V,i.ZERO,q.EPSILON6)){let s=e._ellipsoid.geodeticSurfaceNormal(V,Pt);i.dot(n,s)<0&&(n=i.negate(n,n),c=i.negate(c,c))}let j=U.createProjectPointsTo2DFunction(V,c,w),k=U.createProjectPointTo2DFunction(V,c,w);t.tangent&&(p=i.clone(c,p)),t.bitangent&&(b=i.clone(w,b));let C=y.polygonsFromHierarchy(o,A,j,!1),L=C.hierarchy,T=C.polygons,R=function(s){return s},S=A?y.polygonsFromHierarchy(h,!0,R,!1).polygons:void 0;if(L.length===0)return;r=L[0].outerRing;let H=K.fromPoints(r),M=y.computeBoundingRectangle(n,k,r,a,at),F=[];for(let s=0;s<T.length;s++){let _=new I({geometry:wt(T[s],t,M,a,A?S[s]:void 0,k,n,p,b)});F.push(_)}let l=$.combineInstances(F)[0];l.attributes.position.values=new Float64Array(l.attributes.position.values),l.indices=J.createTypedArray(l.attributes.position.values.length/3,l.indices);let O=l.attributes;return t.position||delete O.position,new Y({attributes:O,indices:l.indices,primitiveType:l.primitiveType,boundingSphere:H})};var Z=E;function kt(e,t){return g(t)&&(e=Z.unpack(e,t)),Z.createGeometry(e)}var Xt=kt;export{Xt as default}; +import{a as et}from"./chunk-DKG6YEMN.js";import{a as U}from"./chunk-V7ZN4CEP.js";import"./chunk-DGVML3P5.js";import{a as y}from"./chunk-V7BDYEN7.js";import"./chunk-GMMUK6QU.js";import{a as I}from"./chunk-4MYAYFOP.js";import{a as $}from"./chunk-FG3CL3AH.js";import"./chunk-VMXXQ6B4.js";import"./chunk-XCRMBS5M.js";import{a as u}from"./chunk-6VK5R74O.js";import"./chunk-P73YILG6.js";import"./chunk-VYMAIP2A.js";import{b as ot}from"./chunk-ZMGESOEZ.js";import{a as tt}from"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as J}from"./chunk-YFQNY2YN.js";import{a as X}from"./chunk-NT26NNVH.js";import{b as W,c as Y,d as z}from"./chunk-NW2YE576.js";import{d as K}from"./chunk-2NIQ5ECB.js";import{f as Q}from"./chunk-7YEOLR2L.js";import{a as N}from"./chunk-QHHYYTCM.js";import{a as i,c as x,d as m,e as P}from"./chunk-RH3GFHG2.js";import{a as q}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as f}from"./chunk-TA3RE4KQ.js";import{b as B}from"./chunk-RTY3VPG6.js";import{e as g}from"./chunk-LRNH5AEO.js";var st=new i,at=new et,pt=new x,lt=new x,mt=new i,ft=new i,ut=new i,V=new i,yt=new i,ht=new i,nt=new Q,dt=new P,gt=new P,Pt=new i;function wt(e,t,o,a,h,A,r,n,p){let b=e.positions,c=ot.triangulate(e.positions2D,e.holes);c.length<3&&(c=[0,1,2]);let w=J.createTypedArray(b.length,c.length);w.set(c);let D=dt;if(a!==0){let d=Q.fromAxisAngle(r,a,nt);if(D=P.fromQuaternion(d,D),t.tangent||t.bitangent){d=Q.fromAxisAngle(r,-a,nt);let G=P.fromQuaternion(d,gt);n=i.normalize(P.multiplyByVector(G,n,n),n),t.bitangent&&(p=i.normalize(i.cross(r,n,p),p))}}else D=P.clone(P.IDENTITY,D);let j=lt;t.st&&(j.x=o.x,j.y=o.y);let k=b.length,C=k*3,L=new Float64Array(C),T=t.normal?new Float32Array(C):void 0,R=t.tangent?new Float32Array(C):void 0,S=t.bitangent?new Float32Array(C):void 0,H=t.st?new Float32Array(k*2):void 0,M=0,F=0,l=0,O=0,s=0;for(let d=0;d<k;d++){let G=b[d];if(L[M++]=G.x,L[M++]=G.y,L[M++]=G.z,t.st)if(g(h)&&h.positions.length===k)H[s++]=h.positions[d].x,H[s++]=h.positions[d].y;else{let it=P.multiplyByVector(D,G,st),v=A(it,pt);x.subtract(v,j,v);let rt=q.clamp(v.x/o.width,0,1),ct=q.clamp(v.y/o.height,0,1);H[s++]=rt,H[s++]=ct}t.normal&&(T[F++]=r.x,T[F++]=r.y,T[F++]=r.z),t.tangent&&(R[O++]=n.x,R[O++]=n.y,R[O++]=n.z),t.bitangent&&(S[l++]=p.x,S[l++]=p.y,S[l++]=p.z)}let _=new X;return t.position&&(_.position=new z({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:L})),t.normal&&(_.normal=new z({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:T})),t.tangent&&(_.tangent=new z({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:R})),t.bitangent&&(_.bitangent=new z({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:S})),t.st&&(_.st=new z({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:H})),new Y({attributes:_,indices:w,primitiveType:W.TRIANGLES})}function E(e){e=f(e,f.EMPTY_OBJECT);let t=e.polygonHierarchy,o=e.textureCoordinates;B.defined("options.polygonHierarchy",t);let a=f(e.vertexFormat,u.DEFAULT);this._vertexFormat=u.clone(a),this._polygonHierarchy=t,this._stRotation=f(e.stRotation,0),this._ellipsoid=m.clone(f(e.ellipsoid,m.default)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=o,this.packedLength=y.computeHierarchyPackedLength(t,i)+u.packedLength+m.packedLength+(g(o)?y.computeHierarchyPackedLength(o,x):1)+2}E.fromPositions=function(e){e=f(e,f.EMPTY_OBJECT),B.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new E(t)};E.pack=function(e,t,o){return B.typeOf.object("value",e),B.defined("array",t),o=f(o,0),o=y.packPolygonHierarchy(e._polygonHierarchy,t,o,i),m.pack(e._ellipsoid,t,o),o+=m.packedLength,u.pack(e._vertexFormat,t,o),o+=u.packedLength,t[o++]=e._stRotation,g(e._textureCoordinates)?o=y.packPolygonHierarchy(e._textureCoordinates,t,o,x):t[o++]=-1,t[o++]=e.packedLength,t};var _t=m.clone(m.UNIT_SPHERE),At=new u,bt={polygonHierarchy:{}};E.unpack=function(e,t,o){B.defined("array",e),t=f(t,0);let a=y.unpackPolygonHierarchy(e,t,i);t=a.startingIndex,delete a.startingIndex;let h=m.unpack(e,t,_t);t+=m.packedLength;let A=u.unpack(e,t,At);t+=u.packedLength;let r=e[t++],n=e[t]===-1?void 0:y.unpackPolygonHierarchy(e,t,x);g(n)?(t=n.startingIndex,delete n.startingIndex):t++;let p=e[t++];return g(o)||(o=new E(bt)),o._polygonHierarchy=a,o._ellipsoid=m.clone(h,o._ellipsoid),o._vertexFormat=u.clone(A,o._vertexFormat),o._stRotation=r,o._textureCoordinates=n,o.packedLength=p,o};E.createGeometry=function(e){let t=e._vertexFormat,o=e._polygonHierarchy,a=e._stRotation,h=e._textureCoordinates,A=g(h),r=o.positions;if(r=tt(r,i.equalsEpsilon,!0),r.length<3)return;let n=mt,p=ft,b=ut,c=yt,w=ht;if(!U.computeProjectTo2DArguments(r,V,c,w))return;if(n=i.cross(c,w,n),n=i.normalize(n,n),!i.equalsEpsilon(V,i.ZERO,q.EPSILON6)){let s=e._ellipsoid.geodeticSurfaceNormal(V,Pt);i.dot(n,s)<0&&(n=i.negate(n,n),c=i.negate(c,c))}let j=U.createProjectPointsTo2DFunction(V,c,w),k=U.createProjectPointTo2DFunction(V,c,w);t.tangent&&(p=i.clone(c,p)),t.bitangent&&(b=i.clone(w,b));let C=y.polygonsFromHierarchy(o,A,j,!1),L=C.hierarchy,T=C.polygons,R=function(s){return s},S=A?y.polygonsFromHierarchy(h,!0,R,!1).polygons:void 0;if(L.length===0)return;r=L[0].outerRing;let H=K.fromPoints(r),M=y.computeBoundingRectangle(n,k,r,a,at),F=[];for(let s=0;s<T.length;s++){let _=new I({geometry:wt(T[s],t,M,a,A?S[s]:void 0,k,n,p,b)});F.push(_)}let l=$.combineInstances(F)[0];l.attributes.position.values=new Float64Array(l.attributes.position.values),l.indices=J.createTypedArray(l.attributes.position.values.length/3,l.indices);let O=l.attributes;return t.position||delete O.position,new Y({attributes:O,indices:l.indices,primitiveType:l.primitiveType,boundingSphere:H})};var Z=E;function kt(e,t){return g(t)&&(e=Z.unpack(e,t)),Z.createGeometry(e)}var Xt=kt;export{Xt as default}; diff --git a/public/js/Cesium2/Workers/createCoplanarPolygonOutlineGeometry.js b/public/js/Cesium2/Workers/createCoplanarPolygonOutlineGeometry.js index 894cb0f26..90e4918dc 100644 --- a/public/js/Cesium2/Workers/createCoplanarPolygonOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createCoplanarPolygonOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as T}from"./chunk-FNTGP2KW.js";import"./chunk-SOCYD7RP.js";import{a as f}from"./chunk-HTYD62GU.js";import"./chunk-HQ4YU6WD.js";import{a as G}from"./chunk-W5MIOKEY.js";import{a as C}from"./chunk-72CGGEJF.js";import"./chunk-Q5MYX5A2.js";import"./chunk-OZYLWM74.js";import"./chunk-CTRWX4F5.js";import"./chunk-Z7BLUZ7R.js";import"./chunk-WJYW7YDO.js";import{a as L}from"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as w}from"./chunk-34ULWVZF.js";import{a as O}from"./chunk-24JYWT5N.js";import{b,c as d,d as k}from"./chunk-LH3SUUXG.js";import{d as P}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as H}from"./chunk-D5HNP2LB.js";import{a as l,d as g}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as c}from"./chunk-N3A5CZ2S.js";import{b as a}from"./chunk-G75U3WZT.js";import{e as u}from"./chunk-3THTQ4QB.js";function E(o){let e=o.length,t=new Float64Array(e*3),r=w.createTypedArray(e,e*2),i=0,s=0;for(let n=0;n<e;n++){let p=o[n];t[i++]=p.x,t[i++]=p.y,t[i++]=p.z,r[s++]=n,r[s++]=(n+1)%e}let y=new O({position:new k({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:t})});return new d({attributes:y,indices:r,primitiveType:b.LINES})}function m(o){o=c(o,c.EMPTY_OBJECT);let e=o.polygonHierarchy;a.defined("options.polygonHierarchy",e),this._polygonHierarchy=e,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=f.computeHierarchyPackedLength(e,l)+1}m.fromPositions=function(o){o=c(o,c.EMPTY_OBJECT),a.defined("options.positions",o.positions);let e={polygonHierarchy:{positions:o.positions}};return new m(e)};m.pack=function(o,e,t){return a.typeOf.object("value",o),a.defined("array",e),t=c(t,0),t=f.packPolygonHierarchy(o._polygonHierarchy,e,t,l),e[t]=o.packedLength,e};var v={polygonHierarchy:{}};m.unpack=function(o,e,t){a.defined("array",o),e=c(e,0);let r=f.unpackPolygonHierarchy(o,e,l);e=r.startingIndex,delete r.startingIndex;let i=o[e];return u(t)||(t=new m(v)),t._polygonHierarchy=r,t.packedLength=i,t};m.createGeometry=function(o){let e=o._polygonHierarchy,t=e.positions;if(t=L(t,l.equalsEpsilon,!0),t.length<3||!T.validOutline(t))return;let i=f.polygonOutlinesFromHierarchy(e,!1);if(i.length===0)return;let s=[];for(let p=0;p<i.length;p++){let _=new G({geometry:E(i[p])});s.push(_)}let y=C.combineInstances(s)[0],n=P.fromPoints(e.positions);return new d({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:n})};var h=m;function A(o,e){return u(e)&&(o=h.unpack(o,e)),o._ellipsoid=g.clone(o._ellipsoid),h.createGeometry(o)}var Z=A;export{Z as default}; +import{a as T}from"./chunk-V7ZN4CEP.js";import"./chunk-DGVML3P5.js";import{a as f}from"./chunk-V7BDYEN7.js";import"./chunk-GMMUK6QU.js";import{a as G}from"./chunk-4MYAYFOP.js";import{a as C}from"./chunk-FG3CL3AH.js";import"./chunk-VMXXQ6B4.js";import"./chunk-XCRMBS5M.js";import"./chunk-P73YILG6.js";import"./chunk-VYMAIP2A.js";import"./chunk-ZMGESOEZ.js";import{a as L}from"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as w}from"./chunk-YFQNY2YN.js";import{a as O}from"./chunk-NT26NNVH.js";import{b,c as d,d as k}from"./chunk-NW2YE576.js";import{d as P}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as H}from"./chunk-QHHYYTCM.js";import{a as l,d as g}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as c}from"./chunk-TA3RE4KQ.js";import{b as a}from"./chunk-RTY3VPG6.js";import{e as u}from"./chunk-LRNH5AEO.js";function E(o){let e=o.length,t=new Float64Array(e*3),r=w.createTypedArray(e,e*2),i=0,s=0;for(let n=0;n<e;n++){let p=o[n];t[i++]=p.x,t[i++]=p.y,t[i++]=p.z,r[s++]=n,r[s++]=(n+1)%e}let y=new O({position:new k({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:t})});return new d({attributes:y,indices:r,primitiveType:b.LINES})}function m(o){o=c(o,c.EMPTY_OBJECT);let e=o.polygonHierarchy;a.defined("options.polygonHierarchy",e),this._polygonHierarchy=e,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=f.computeHierarchyPackedLength(e,l)+1}m.fromPositions=function(o){o=c(o,c.EMPTY_OBJECT),a.defined("options.positions",o.positions);let e={polygonHierarchy:{positions:o.positions}};return new m(e)};m.pack=function(o,e,t){return a.typeOf.object("value",o),a.defined("array",e),t=c(t,0),t=f.packPolygonHierarchy(o._polygonHierarchy,e,t,l),e[t]=o.packedLength,e};var v={polygonHierarchy:{}};m.unpack=function(o,e,t){a.defined("array",o),e=c(e,0);let r=f.unpackPolygonHierarchy(o,e,l);e=r.startingIndex,delete r.startingIndex;let i=o[e];return u(t)||(t=new m(v)),t._polygonHierarchy=r,t.packedLength=i,t};m.createGeometry=function(o){let e=o._polygonHierarchy,t=e.positions;if(t=L(t,l.equalsEpsilon,!0),t.length<3||!T.validOutline(t))return;let i=f.polygonOutlinesFromHierarchy(e,!1);if(i.length===0)return;let s=[];for(let p=0;p<i.length;p++){let _=new G({geometry:E(i[p])});s.push(_)}let y=C.combineInstances(s)[0],n=P.fromPoints(e.positions);return new d({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:n})};var h=m;function A(o,e){return u(e)&&(o=h.unpack(o,e)),o._ellipsoid=g.clone(o._ellipsoid),h.createGeometry(o)}var Z=A;export{Z as default}; diff --git a/public/js/Cesium2/Workers/createCorridorGeometry.js b/public/js/Cesium2/Workers/createCorridorGeometry.js index 643651585..7bc74122a 100644 --- a/public/js/Cesium2/Workers/createCorridorGeometry.js +++ b/public/js/Cesium2/Workers/createCorridorGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as M}from"./chunk-W7OWWJQT.js";import{a as ht}from"./chunk-G72WI3OZ.js";import"./chunk-RNF7TLFF.js";import"./chunk-E7HC3VTG.js";import{a as _t}from"./chunk-5CC3QRYS.js";import{a as G}from"./chunk-6HIVPZ7K.js";import"./chunk-CTRWX4F5.js";import"./chunk-Z7BLUZ7R.js";import{b as yt}from"./chunk-WJYW7YDO.js";import{a as Pt}from"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as Nt}from"./chunk-34ULWVZF.js";import{a as Ct}from"./chunk-24JYWT5N.js";import{b as Mt,c as Vt,d as x}from"./chunk-LH3SUUXG.js";import{d as St}from"./chunk-K2M3OJ7Z.js";import{h as Et}from"./chunk-M3A6SPGI.js";import{a as F}from"./chunk-D5HNP2LB.js";import{a as o,b as bt,d as I}from"./chunk-S4VBGY2U.js";import{a as st}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as B}from"./chunk-N3A5CZ2S.js";import{b as it}from"./chunk-G75U3WZT.js";import{e as X}from"./chunk-3THTQ4QB.js";var zt=new o,kt=new o,wt=new o,Tt=new o,jt=new o,Ht=new o,at=new o,ft=new o;function Ut(t,e){for(let i=0;i<t.length;i++)t[i]=e.scaleToGeodeticSurface(t[i],t[i]);return t}function Z(t,e,i,l,d,f){let h=t.normals,O=t.tangents,g=t.bitangents,r=o.normalize(o.cross(i,e,at),at);f.normal&&M.addAttribute(h,e,l,d),f.tangent&&M.addAttribute(O,r,l,d),f.bitangent&&M.addAttribute(g,i,l,d)}function Bt(t,e,i){let l=t.positions,d=t.corners,f=t.endPositions,h=t.lefts,O=t.normals,g=new Ct,r,a=0,s=0,n,A=0,u;for(n=0;n<l.length;n+=2)u=l[n].length-3,a+=u,A+=u*2,s+=l[n+1].length-3;for(a+=3,s+=3,n=0;n<d.length;n++){r=d[n];let c=d[n].leftPositions;X(c)?(u=c.length,a+=u,A+=u):(u=d[n].rightPositions.length,s+=u,A+=u)}let b=X(f),p;b&&(p=f[0].length-3,a+=p,s+=p,p/=3,A+=p*6);let R=a+s,m=new Float64Array(R),C=e.normal?new Float32Array(R):void 0,D=e.tangent?new Float32Array(R):void 0,lt=e.bitangent?new Float32Array(R):void 0,z={normals:C,tangents:D,bitangents:lt},y=0,E=R-1,S,V,H,J,P=zt,w=kt,nt,ot,mt=p/2,_=Nt.createTypedArray(R/3,A),T=0;if(b){ot=wt,nt=Tt;let c=f[0];for(P=o.fromArray(O,0,P),w=o.fromArray(h,0,w),n=0;n<mt;n++)ot=o.fromArray(c,(mt-1-n)*3,ot),nt=o.fromArray(c,(mt+n)*3,nt),M.addAttribute(m,nt,y),M.addAttribute(m,ot,void 0,E),Z(z,P,w,y,E,e),V=y/3,J=V+1,S=(E-2)/3,H=S-1,_[T++]=S,_[T++]=V,_[T++]=H,_[T++]=H,_[T++]=V,_[T++]=J,y+=3,E-=3}let At=0,ut=0,rt=l[At++],q=l[At++];m.set(rt,y),m.set(q,E-q.length+1),w=o.fromArray(h,ut,w);let ct,dt;for(u=q.length-3,n=0;n<u;n+=3)ct=i.geodeticSurfaceNormal(o.fromArray(rt,n,at),at),dt=i.geodeticSurfaceNormal(o.fromArray(q,u-n,ft),ft),P=o.normalize(o.add(ct,dt,P),P),Z(z,P,w,y,E,e),V=y/3,J=V+1,S=(E-2)/3,H=S-1,_[T++]=S,_[T++]=V,_[T++]=H,_[T++]=H,_[T++]=V,_[T++]=J,y+=3,E-=3;for(ct=i.geodeticSurfaceNormal(o.fromArray(rt,u,at),at),dt=i.geodeticSurfaceNormal(o.fromArray(q,u,ft),ft),P=o.normalize(o.add(ct,dt,P),P),ut+=3,n=0;n<d.length;n++){let c;r=d[n];let $=r.leftPositions,v=r.rightPositions,L,U,N=Ht,k=wt,Y=Tt;if(P=o.fromArray(O,ut,P),X($)){for(Z(z,P,w,void 0,E,e),E-=3,L=J,U=H,c=0;c<$.length/3;c++)N=o.fromArray($,c*3,N),_[T++]=L,_[T++]=U-c-1,_[T++]=U-c,M.addAttribute(m,N,void 0,E),k=o.fromArray(m,(U-c-1)*3,k),Y=o.fromArray(m,L*3,Y),w=o.normalize(o.subtract(k,Y,w),w),Z(z,P,w,void 0,E,e),E-=3;N=o.fromArray(m,L*3,N),k=o.subtract(o.fromArray(m,U*3,k),N,k),Y=o.subtract(o.fromArray(m,(U-c)*3,Y),N,Y),w=o.normalize(o.add(k,Y,w),w),Z(z,P,w,y,void 0,e),y+=3}else{for(Z(z,P,w,y,void 0,e),y+=3,L=H,U=J,c=0;c<v.length/3;c++)N=o.fromArray(v,c*3,N),_[T++]=L,_[T++]=U+c,_[T++]=U+c+1,M.addAttribute(m,N,y),k=o.fromArray(m,L*3,k),Y=o.fromArray(m,(U+c)*3,Y),w=o.normalize(o.subtract(k,Y,w),w),Z(z,P,w,y,void 0,e),y+=3;N=o.fromArray(m,L*3,N),k=o.subtract(o.fromArray(m,(U+c)*3,k),N,k),Y=o.subtract(o.fromArray(m,U*3,Y),N,Y),w=o.normalize(o.negate(o.add(Y,k,w),w),w),Z(z,P,w,void 0,E,e),E-=3}for(rt=l[At++],q=l[At++],rt.splice(0,3),q.splice(q.length-3,3),m.set(rt,y),m.set(q,E-q.length+1),u=q.length-3,ut+=3,w=o.fromArray(h,ut,w),c=0;c<q.length;c+=3)ct=i.geodeticSurfaceNormal(o.fromArray(rt,c,at),at),dt=i.geodeticSurfaceNormal(o.fromArray(q,u-c,ft),ft),P=o.normalize(o.add(ct,dt,P),P),Z(z,P,w,y,E,e),J=y/3,V=J-1,H=(E-2)/3,S=H+1,_[T++]=S,_[T++]=V,_[T++]=H,_[T++]=H,_[T++]=V,_[T++]=J,y+=3,E-=3;y-=3,E+=3}if(P=o.fromArray(O,O.length-3,P),Z(z,P,w,y,E,e),b){y+=3,E-=3,ot=wt,nt=Tt;let c=f[1];for(n=0;n<mt;n++)ot=o.fromArray(c,(p-n-1)*3,ot),nt=o.fromArray(c,n*3,nt),M.addAttribute(m,ot,void 0,E),M.addAttribute(m,nt,y),Z(z,P,w,y,E,e),J=y/3,V=J-1,H=(E-2)/3,S=H+1,_[T++]=S,_[T++]=V,_[T++]=H,_[T++]=H,_[T++]=V,_[T++]=J,y+=3,E-=3}if(g.position=new x({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:m}),e.st){let c=new Float32Array(R/3*2),$,v,L=0;if(b){a/=3,s/=3;let U=Math.PI/(p+1);v=1/(a-p+1),$=1/(s-p+1);let N,k=p/2;for(n=k+1;n<p+1;n++)N=st.PI_OVER_TWO+U*n,c[L++]=$*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N));for(n=1;n<s-p+1;n++)c[L++]=n*$,c[L++]=0;for(n=p;n>k;n--)N=st.PI_OVER_TWO-n*U,c[L++]=1-$*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N));for(n=k;n>0;n--)N=st.PI_OVER_TWO-U*n,c[L++]=1-v*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N));for(n=a-p;n>0;n--)c[L++]=n*v,c[L++]=1;for(n=1;n<k+1;n++)N=st.PI_OVER_TWO+U*n,c[L++]=v*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N))}else{for(a/=3,s/=3,v=1/(a-1),$=1/(s-1),n=0;n<s;n++)c[L++]=n*$,c[L++]=0;for(n=a;n>0;n--)c[L++]=(n-1)*v,c[L++]=1}g.st=new x({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:c})}return e.normal&&(g.normal=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:z.normals})),e.tangent&&(g.tangent=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:z.tangents})),e.bitangent&&(g.bitangent=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:z.bitangents})),{attributes:g,indices:_}}function qt(t,e){if(!e.normal&&!e.tangent&&!e.bitangent&&!e.st)return t;let i=t.position.values,l,d;(e.normal||e.bitangent)&&(l=t.normal.values,d=t.bitangent.values);let f=t.position.values.length/18,h=f*3,O=f*2,g=h*2,r;if(e.normal||e.bitangent||e.tangent){let a=e.normal?new Float32Array(h*6):void 0,s=e.tangent?new Float32Array(h*6):void 0,n=e.bitangent?new Float32Array(h*6):void 0,A=zt,u=kt,b=wt,p=Tt,R=jt,m=Ht,C=g;for(r=0;r<h;r+=3){let D=C+g;A=o.fromArray(i,r,A),u=o.fromArray(i,r+h,u),b=o.fromArray(i,(r+3)%h,b),u=o.subtract(u,A,u),b=o.subtract(b,A,b),p=o.normalize(o.cross(u,b,p),p),e.normal&&(M.addAttribute(a,p,D),M.addAttribute(a,p,D+3),M.addAttribute(a,p,C),M.addAttribute(a,p,C+3)),(e.tangent||e.bitangent)&&(m=o.fromArray(l,r,m),e.bitangent&&(M.addAttribute(n,m,D),M.addAttribute(n,m,D+3),M.addAttribute(n,m,C),M.addAttribute(n,m,C+3)),e.tangent&&(R=o.normalize(o.cross(m,p,R),R),M.addAttribute(s,R,D),M.addAttribute(s,R,D+3),M.addAttribute(s,R,C),M.addAttribute(s,R,C+3))),C+=6}if(e.normal){for(a.set(l),r=0;r<h;r+=3)a[r+h]=-l[r],a[r+h+1]=-l[r+1],a[r+h+2]=-l[r+2];t.normal.values=a}else t.normal=void 0;if(e.bitangent?(n.set(d),n.set(d,h),t.bitangent.values=n):t.bitangent=void 0,e.tangent){let D=t.tangent.values;s.set(D),s.set(D,h),t.tangent.values=s}}if(e.st){let a=t.st.values,s=new Float32Array(O*6);s.set(a),s.set(a,O);let n=O*2;for(let A=0;A<2;A++){for(s[n++]=a[0],s[n++]=a[1],r=2;r<O;r+=2){let u=a[r],b=a[r+1];s[n++]=u,s[n++]=b,s[n++]=u,s[n++]=b}s[n++]=a[0],s[n++]=a[1]}t.st.values=s}return t}function Ot(t,e,i){i[e++]=t[0],i[e++]=t[1],i[e++]=t[2];for(let l=3;l<t.length;l+=3){let d=t[l],f=t[l+1],h=t[l+2];i[e++]=d,i[e++]=f,i[e++]=h,i[e++]=d,i[e++]=f,i[e++]=h}return i[e++]=t[0],i[e++]=t[1],i[e++]=t[2],i}function Jt(t,e){let i=new G({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),l=t.ellipsoid,d=M.computePositions(t),f=Bt(d,i,l),h=t.height,O=t.extrudedHeight,g=f.attributes,r=f.indices,a=g.position.values,s=a.length,n=new Float64Array(s*6),A=new Float64Array(s);A.set(a);let u=new Float64Array(s*4);a=yt.scaleToGeodeticHeight(a,h,l),u=Ot(a,0,u),A=yt.scaleToGeodeticHeight(A,O,l),u=Ot(A,s*2,u),n.set(a),n.set(A,s),n.set(u,s*2),g.position.values=n,g=qt(g,e);let b,p=s/3;if(t.shadowVolume){let S=g.normal.values;s=S.length;let V=new Float32Array(s*6);for(b=0;b<s;b++)S[b]=-S[b];V.set(S,s),V=Ot(S,s*4,V),g.extrudeDirection=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:V}),e.normal||(g.normal=void 0)}if(X(t.offsetAttribute)){let S=new Uint8Array(p*6);if(t.offsetAttribute===_t.TOP)S=S.fill(1,0,p).fill(1,p*2,p*4);else{let V=t.offsetAttribute===_t.NONE?0:1;S=S.fill(V)}g.applyOffset=new x({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:S})}let R=r.length,m=p+p,C=Nt.createTypedArray(n.length/3,R*2+m*3);C.set(r);let D=R;for(b=0;b<R;b+=3){let S=r[b],V=r[b+1],H=r[b+2];C[D++]=H+p,C[D++]=V+p,C[D++]=S+p}let lt,z,y,E;for(b=0;b<m;b+=2)lt=b+m,z=lt+m,y=lt+1,E=z+1,C[D++]=lt,C[D++]=z,C[D++]=y,C[D++]=y,C[D++]=z,C[D++]=E;return{attributes:g,indices:C}}var Dt=new o,gt=new o,Q=new bt;function Rt(t,e,i,l,d,f){let h=o.subtract(e,t,Dt);o.normalize(h,h);let O=i.geodeticSurfaceNormal(t,gt),g=o.cross(h,O,Dt);o.multiplyByScalar(g,l,g);let r=d.latitude,a=d.longitude,s=f.latitude,n=f.longitude;o.add(t,g,gt),i.cartesianToCartographic(gt,Q);let A=Q.latitude,u=Q.longitude;r=Math.min(r,A),a=Math.min(a,u),s=Math.max(s,A),n=Math.max(n,u),o.subtract(t,g,gt),i.cartesianToCartographic(gt,Q),A=Q.latitude,u=Q.longitude,r=Math.min(r,A),a=Math.min(a,u),s=Math.max(s,A),n=Math.max(n,u),d.latitude=r,d.longitude=a,f.latitude=s,f.longitude=n}var K=new o,pt=new o,W=new bt,j=new bt;function Yt(t,e,i,l,d){t=Ut(t,e);let f=Pt(t,o.equalsEpsilon),h=f.length;if(h<2||i<=0)return new Et;let O=i*.5;W.latitude=Number.POSITIVE_INFINITY,W.longitude=Number.POSITIVE_INFINITY,j.latitude=Number.NEGATIVE_INFINITY,j.longitude=Number.NEGATIVE_INFINITY;let g,r;if(l===ht.ROUNDED){let n=f[0];o.subtract(n,f[1],K),o.normalize(K,K),o.multiplyByScalar(K,O,K),o.add(n,K,pt),e.cartesianToCartographic(pt,Q),g=Q.latitude,r=Q.longitude,W.latitude=Math.min(W.latitude,g),W.longitude=Math.min(W.longitude,r),j.latitude=Math.max(j.latitude,g),j.longitude=Math.max(j.longitude,r)}for(let n=0;n<h-1;++n)Rt(f[n],f[n+1],e,O,W,j);let a=f[h-1];o.subtract(a,f[h-2],K),o.normalize(K,K),o.multiplyByScalar(K,O,K),o.add(a,K,pt),Rt(a,pt,e,O,W,j),l===ht.ROUNDED&&(e.cartesianToCartographic(pt,Q),g=Q.latitude,r=Q.longitude,W.latitude=Math.min(W.latitude,g),W.longitude=Math.min(W.longitude,r),j.latitude=Math.max(j.latitude,g),j.longitude=Math.max(j.longitude,r));let s=X(d)?d:new Et;return s.north=j.latitude,s.south=W.latitude,s.east=j.longitude,s.west=W.longitude,s}function et(t){t=B(t,B.EMPTY_OBJECT);let e=t.positions,i=t.width;it.defined("options.positions",e),it.defined("options.width",i);let l=B(t.height,0),d=B(t.extrudedHeight,l);this._positions=e,this._ellipsoid=I.clone(B(t.ellipsoid,I.default)),this._vertexFormat=G.clone(B(t.vertexFormat,G.DEFAULT)),this._width=i,this._height=Math.max(l,d),this._extrudedHeight=Math.min(l,d),this._cornerType=B(t.cornerType,ht.ROUNDED),this._granularity=B(t.granularity,st.RADIANS_PER_DEGREE),this._shadowVolume=B(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*o.packedLength+I.packedLength+G.packedLength+7}et.pack=function(t,e,i){it.defined("value",t),it.defined("array",e),i=B(i,0);let l=t._positions,d=l.length;e[i++]=d;for(let f=0;f<d;++f,i+=o.packedLength)o.pack(l[f],e,i);return I.pack(t._ellipsoid,e,i),i+=I.packedLength,G.pack(t._vertexFormat,e,i),i+=G.packedLength,e[i++]=t._width,e[i++]=t._height,e[i++]=t._extrudedHeight,e[i++]=t._cornerType,e[i++]=t._granularity,e[i++]=t._shadowVolume?1:0,e[i]=B(t._offsetAttribute,-1),e};var It=I.clone(I.UNIT_SPHERE),Wt=new G,tt={positions:void 0,ellipsoid:It,vertexFormat:Wt,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};et.unpack=function(t,e,i){it.defined("array",t),e=B(e,0);let l=t[e++],d=new Array(l);for(let u=0;u<l;++u,e+=o.packedLength)d[u]=o.unpack(t,e);let f=I.unpack(t,e,It);e+=I.packedLength;let h=G.unpack(t,e,Wt);e+=G.packedLength;let O=t[e++],g=t[e++],r=t[e++],a=t[e++],s=t[e++],n=t[e++]===1,A=t[e];return X(i)?(i._positions=d,i._ellipsoid=I.clone(f,i._ellipsoid),i._vertexFormat=G.clone(h,i._vertexFormat),i._width=O,i._height=g,i._extrudedHeight=r,i._cornerType=a,i._granularity=s,i._shadowVolume=n,i._offsetAttribute=A===-1?void 0:A,i):(tt.positions=d,tt.width=O,tt.height=g,tt.extrudedHeight=r,tt.cornerType=a,tt.granularity=s,tt.shadowVolume=n,tt.offsetAttribute=A===-1?void 0:A,new et(tt))};et.computeRectangle=function(t,e){t=B(t,B.EMPTY_OBJECT);let i=t.positions,l=t.width;it.defined("options.positions",i),it.defined("options.width",l);let d=B(t.ellipsoid,I.default),f=B(t.cornerType,ht.ROUNDED);return Yt(i,d,l,f,e)};et.createGeometry=function(t){let e=t._positions,i=t._width,l=t._ellipsoid;e=Ut(e,l);let d=Pt(e,o.equalsEpsilon);if(d.length<2||i<=0)return;let f=t._height,h=t._extrudedHeight,O=!st.equalsEpsilon(f,h,0,st.EPSILON2),g=t._vertexFormat,r={ellipsoid:l,positions:d,width:i,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0},a;if(O)r.height=f,r.extrudedHeight=h,r.shadowVolume=t._shadowVolume,r.offsetAttribute=t._offsetAttribute,a=Jt(r,g);else{let A=M.computePositions(r);if(a=Bt(A,g,l),a.attributes.position.values=yt.scaleToGeodeticHeight(a.attributes.position.values,f,l),X(t._offsetAttribute)){let u=t._offsetAttribute===_t.NONE?0:1,b=a.attributes.position.values.length,p=new Uint8Array(b/3).fill(u);a.attributes.applyOffset=new x({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})}}let s=a.attributes,n=St.fromVertices(s.position.values,void 0,3);return g.position||(a.attributes.position.values=void 0),new Vt({attributes:s,indices:a.indices,primitiveType:Mt.TRIANGLES,boundingSphere:n,offsetAttribute:t._offsetAttribute})};et.createShadowVolume=function(t,e,i){let l=t._granularity,d=t._ellipsoid,f=e(l,d),h=i(l,d);return new et({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:d,granularity:l,extrudedHeight:f,height:h,vertexFormat:G.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(et.prototype,{rectangle:{get:function(){return X(this._rectangle)||(this._rectangle=Yt(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var Lt=et;function Gt(t,e){return X(e)&&(t=Lt.unpack(t,e)),t._ellipsoid=I.clone(t._ellipsoid),Lt.createGeometry(t)}var Ae=Gt;export{Ae as default}; +import{a as M}from"./chunk-C37L3XAH.js";import{a as ht}from"./chunk-VMIASSRO.js";import"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import{a as _t}from"./chunk-N5SNKJ43.js";import{a as G}from"./chunk-6VK5R74O.js";import"./chunk-P73YILG6.js";import"./chunk-VYMAIP2A.js";import{b as yt}from"./chunk-ZMGESOEZ.js";import{a as Pt}from"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as Nt}from"./chunk-YFQNY2YN.js";import{a as Ct}from"./chunk-NT26NNVH.js";import{b as Mt,c as Vt,d as x}from"./chunk-NW2YE576.js";import{d as St}from"./chunk-2NIQ5ECB.js";import{h as Et}from"./chunk-7YEOLR2L.js";import{a as F}from"./chunk-QHHYYTCM.js";import{a as o,b as bt,d as I}from"./chunk-RH3GFHG2.js";import{a as st}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as B}from"./chunk-TA3RE4KQ.js";import{b as it}from"./chunk-RTY3VPG6.js";import{e as X}from"./chunk-LRNH5AEO.js";var zt=new o,kt=new o,wt=new o,Tt=new o,jt=new o,Ht=new o,at=new o,ft=new o;function Ut(t,e){for(let i=0;i<t.length;i++)t[i]=e.scaleToGeodeticSurface(t[i],t[i]);return t}function Z(t,e,i,l,d,f){let h=t.normals,O=t.tangents,g=t.bitangents,r=o.normalize(o.cross(i,e,at),at);f.normal&&M.addAttribute(h,e,l,d),f.tangent&&M.addAttribute(O,r,l,d),f.bitangent&&M.addAttribute(g,i,l,d)}function Bt(t,e,i){let l=t.positions,d=t.corners,f=t.endPositions,h=t.lefts,O=t.normals,g=new Ct,r,a=0,s=0,n,A=0,u;for(n=0;n<l.length;n+=2)u=l[n].length-3,a+=u,A+=u*2,s+=l[n+1].length-3;for(a+=3,s+=3,n=0;n<d.length;n++){r=d[n];let c=d[n].leftPositions;X(c)?(u=c.length,a+=u,A+=u):(u=d[n].rightPositions.length,s+=u,A+=u)}let b=X(f),p;b&&(p=f[0].length-3,a+=p,s+=p,p/=3,A+=p*6);let R=a+s,m=new Float64Array(R),C=e.normal?new Float32Array(R):void 0,D=e.tangent?new Float32Array(R):void 0,lt=e.bitangent?new Float32Array(R):void 0,z={normals:C,tangents:D,bitangents:lt},y=0,E=R-1,S,V,H,J,P=zt,w=kt,nt,ot,mt=p/2,_=Nt.createTypedArray(R/3,A),T=0;if(b){ot=wt,nt=Tt;let c=f[0];for(P=o.fromArray(O,0,P),w=o.fromArray(h,0,w),n=0;n<mt;n++)ot=o.fromArray(c,(mt-1-n)*3,ot),nt=o.fromArray(c,(mt+n)*3,nt),M.addAttribute(m,nt,y),M.addAttribute(m,ot,void 0,E),Z(z,P,w,y,E,e),V=y/3,J=V+1,S=(E-2)/3,H=S-1,_[T++]=S,_[T++]=V,_[T++]=H,_[T++]=H,_[T++]=V,_[T++]=J,y+=3,E-=3}let At=0,ut=0,rt=l[At++],q=l[At++];m.set(rt,y),m.set(q,E-q.length+1),w=o.fromArray(h,ut,w);let ct,dt;for(u=q.length-3,n=0;n<u;n+=3)ct=i.geodeticSurfaceNormal(o.fromArray(rt,n,at),at),dt=i.geodeticSurfaceNormal(o.fromArray(q,u-n,ft),ft),P=o.normalize(o.add(ct,dt,P),P),Z(z,P,w,y,E,e),V=y/3,J=V+1,S=(E-2)/3,H=S-1,_[T++]=S,_[T++]=V,_[T++]=H,_[T++]=H,_[T++]=V,_[T++]=J,y+=3,E-=3;for(ct=i.geodeticSurfaceNormal(o.fromArray(rt,u,at),at),dt=i.geodeticSurfaceNormal(o.fromArray(q,u,ft),ft),P=o.normalize(o.add(ct,dt,P),P),ut+=3,n=0;n<d.length;n++){let c;r=d[n];let $=r.leftPositions,v=r.rightPositions,L,U,N=Ht,k=wt,Y=Tt;if(P=o.fromArray(O,ut,P),X($)){for(Z(z,P,w,void 0,E,e),E-=3,L=J,U=H,c=0;c<$.length/3;c++)N=o.fromArray($,c*3,N),_[T++]=L,_[T++]=U-c-1,_[T++]=U-c,M.addAttribute(m,N,void 0,E),k=o.fromArray(m,(U-c-1)*3,k),Y=o.fromArray(m,L*3,Y),w=o.normalize(o.subtract(k,Y,w),w),Z(z,P,w,void 0,E,e),E-=3;N=o.fromArray(m,L*3,N),k=o.subtract(o.fromArray(m,U*3,k),N,k),Y=o.subtract(o.fromArray(m,(U-c)*3,Y),N,Y),w=o.normalize(o.add(k,Y,w),w),Z(z,P,w,y,void 0,e),y+=3}else{for(Z(z,P,w,y,void 0,e),y+=3,L=H,U=J,c=0;c<v.length/3;c++)N=o.fromArray(v,c*3,N),_[T++]=L,_[T++]=U+c,_[T++]=U+c+1,M.addAttribute(m,N,y),k=o.fromArray(m,L*3,k),Y=o.fromArray(m,(U+c)*3,Y),w=o.normalize(o.subtract(k,Y,w),w),Z(z,P,w,y,void 0,e),y+=3;N=o.fromArray(m,L*3,N),k=o.subtract(o.fromArray(m,(U+c)*3,k),N,k),Y=o.subtract(o.fromArray(m,U*3,Y),N,Y),w=o.normalize(o.negate(o.add(Y,k,w),w),w),Z(z,P,w,void 0,E,e),E-=3}for(rt=l[At++],q=l[At++],rt.splice(0,3),q.splice(q.length-3,3),m.set(rt,y),m.set(q,E-q.length+1),u=q.length-3,ut+=3,w=o.fromArray(h,ut,w),c=0;c<q.length;c+=3)ct=i.geodeticSurfaceNormal(o.fromArray(rt,c,at),at),dt=i.geodeticSurfaceNormal(o.fromArray(q,u-c,ft),ft),P=o.normalize(o.add(ct,dt,P),P),Z(z,P,w,y,E,e),J=y/3,V=J-1,H=(E-2)/3,S=H+1,_[T++]=S,_[T++]=V,_[T++]=H,_[T++]=H,_[T++]=V,_[T++]=J,y+=3,E-=3;y-=3,E+=3}if(P=o.fromArray(O,O.length-3,P),Z(z,P,w,y,E,e),b){y+=3,E-=3,ot=wt,nt=Tt;let c=f[1];for(n=0;n<mt;n++)ot=o.fromArray(c,(p-n-1)*3,ot),nt=o.fromArray(c,n*3,nt),M.addAttribute(m,ot,void 0,E),M.addAttribute(m,nt,y),Z(z,P,w,y,E,e),J=y/3,V=J-1,H=(E-2)/3,S=H+1,_[T++]=S,_[T++]=V,_[T++]=H,_[T++]=H,_[T++]=V,_[T++]=J,y+=3,E-=3}if(g.position=new x({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:m}),e.st){let c=new Float32Array(R/3*2),$,v,L=0;if(b){a/=3,s/=3;let U=Math.PI/(p+1);v=1/(a-p+1),$=1/(s-p+1);let N,k=p/2;for(n=k+1;n<p+1;n++)N=st.PI_OVER_TWO+U*n,c[L++]=$*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N));for(n=1;n<s-p+1;n++)c[L++]=n*$,c[L++]=0;for(n=p;n>k;n--)N=st.PI_OVER_TWO-n*U,c[L++]=1-$*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N));for(n=k;n>0;n--)N=st.PI_OVER_TWO-U*n,c[L++]=1-v*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N));for(n=a-p;n>0;n--)c[L++]=n*v,c[L++]=1;for(n=1;n<k+1;n++)N=st.PI_OVER_TWO+U*n,c[L++]=v*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N))}else{for(a/=3,s/=3,v=1/(a-1),$=1/(s-1),n=0;n<s;n++)c[L++]=n*$,c[L++]=0;for(n=a;n>0;n--)c[L++]=(n-1)*v,c[L++]=1}g.st=new x({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:c})}return e.normal&&(g.normal=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:z.normals})),e.tangent&&(g.tangent=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:z.tangents})),e.bitangent&&(g.bitangent=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:z.bitangents})),{attributes:g,indices:_}}function qt(t,e){if(!e.normal&&!e.tangent&&!e.bitangent&&!e.st)return t;let i=t.position.values,l,d;(e.normal||e.bitangent)&&(l=t.normal.values,d=t.bitangent.values);let f=t.position.values.length/18,h=f*3,O=f*2,g=h*2,r;if(e.normal||e.bitangent||e.tangent){let a=e.normal?new Float32Array(h*6):void 0,s=e.tangent?new Float32Array(h*6):void 0,n=e.bitangent?new Float32Array(h*6):void 0,A=zt,u=kt,b=wt,p=Tt,R=jt,m=Ht,C=g;for(r=0;r<h;r+=3){let D=C+g;A=o.fromArray(i,r,A),u=o.fromArray(i,r+h,u),b=o.fromArray(i,(r+3)%h,b),u=o.subtract(u,A,u),b=o.subtract(b,A,b),p=o.normalize(o.cross(u,b,p),p),e.normal&&(M.addAttribute(a,p,D),M.addAttribute(a,p,D+3),M.addAttribute(a,p,C),M.addAttribute(a,p,C+3)),(e.tangent||e.bitangent)&&(m=o.fromArray(l,r,m),e.bitangent&&(M.addAttribute(n,m,D),M.addAttribute(n,m,D+3),M.addAttribute(n,m,C),M.addAttribute(n,m,C+3)),e.tangent&&(R=o.normalize(o.cross(m,p,R),R),M.addAttribute(s,R,D),M.addAttribute(s,R,D+3),M.addAttribute(s,R,C),M.addAttribute(s,R,C+3))),C+=6}if(e.normal){for(a.set(l),r=0;r<h;r+=3)a[r+h]=-l[r],a[r+h+1]=-l[r+1],a[r+h+2]=-l[r+2];t.normal.values=a}else t.normal=void 0;if(e.bitangent?(n.set(d),n.set(d,h),t.bitangent.values=n):t.bitangent=void 0,e.tangent){let D=t.tangent.values;s.set(D),s.set(D,h),t.tangent.values=s}}if(e.st){let a=t.st.values,s=new Float32Array(O*6);s.set(a),s.set(a,O);let n=O*2;for(let A=0;A<2;A++){for(s[n++]=a[0],s[n++]=a[1],r=2;r<O;r+=2){let u=a[r],b=a[r+1];s[n++]=u,s[n++]=b,s[n++]=u,s[n++]=b}s[n++]=a[0],s[n++]=a[1]}t.st.values=s}return t}function Ot(t,e,i){i[e++]=t[0],i[e++]=t[1],i[e++]=t[2];for(let l=3;l<t.length;l+=3){let d=t[l],f=t[l+1],h=t[l+2];i[e++]=d,i[e++]=f,i[e++]=h,i[e++]=d,i[e++]=f,i[e++]=h}return i[e++]=t[0],i[e++]=t[1],i[e++]=t[2],i}function Jt(t,e){let i=new G({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),l=t.ellipsoid,d=M.computePositions(t),f=Bt(d,i,l),h=t.height,O=t.extrudedHeight,g=f.attributes,r=f.indices,a=g.position.values,s=a.length,n=new Float64Array(s*6),A=new Float64Array(s);A.set(a);let u=new Float64Array(s*4);a=yt.scaleToGeodeticHeight(a,h,l),u=Ot(a,0,u),A=yt.scaleToGeodeticHeight(A,O,l),u=Ot(A,s*2,u),n.set(a),n.set(A,s),n.set(u,s*2),g.position.values=n,g=qt(g,e);let b,p=s/3;if(t.shadowVolume){let S=g.normal.values;s=S.length;let V=new Float32Array(s*6);for(b=0;b<s;b++)S[b]=-S[b];V.set(S,s),V=Ot(S,s*4,V),g.extrudeDirection=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:V}),e.normal||(g.normal=void 0)}if(X(t.offsetAttribute)){let S=new Uint8Array(p*6);if(t.offsetAttribute===_t.TOP)S=S.fill(1,0,p).fill(1,p*2,p*4);else{let V=t.offsetAttribute===_t.NONE?0:1;S=S.fill(V)}g.applyOffset=new x({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:S})}let R=r.length,m=p+p,C=Nt.createTypedArray(n.length/3,R*2+m*3);C.set(r);let D=R;for(b=0;b<R;b+=3){let S=r[b],V=r[b+1],H=r[b+2];C[D++]=H+p,C[D++]=V+p,C[D++]=S+p}let lt,z,y,E;for(b=0;b<m;b+=2)lt=b+m,z=lt+m,y=lt+1,E=z+1,C[D++]=lt,C[D++]=z,C[D++]=y,C[D++]=y,C[D++]=z,C[D++]=E;return{attributes:g,indices:C}}var Dt=new o,gt=new o,Q=new bt;function Rt(t,e,i,l,d,f){let h=o.subtract(e,t,Dt);o.normalize(h,h);let O=i.geodeticSurfaceNormal(t,gt),g=o.cross(h,O,Dt);o.multiplyByScalar(g,l,g);let r=d.latitude,a=d.longitude,s=f.latitude,n=f.longitude;o.add(t,g,gt),i.cartesianToCartographic(gt,Q);let A=Q.latitude,u=Q.longitude;r=Math.min(r,A),a=Math.min(a,u),s=Math.max(s,A),n=Math.max(n,u),o.subtract(t,g,gt),i.cartesianToCartographic(gt,Q),A=Q.latitude,u=Q.longitude,r=Math.min(r,A),a=Math.min(a,u),s=Math.max(s,A),n=Math.max(n,u),d.latitude=r,d.longitude=a,f.latitude=s,f.longitude=n}var K=new o,pt=new o,W=new bt,j=new bt;function Yt(t,e,i,l,d){t=Ut(t,e);let f=Pt(t,o.equalsEpsilon),h=f.length;if(h<2||i<=0)return new Et;let O=i*.5;W.latitude=Number.POSITIVE_INFINITY,W.longitude=Number.POSITIVE_INFINITY,j.latitude=Number.NEGATIVE_INFINITY,j.longitude=Number.NEGATIVE_INFINITY;let g,r;if(l===ht.ROUNDED){let n=f[0];o.subtract(n,f[1],K),o.normalize(K,K),o.multiplyByScalar(K,O,K),o.add(n,K,pt),e.cartesianToCartographic(pt,Q),g=Q.latitude,r=Q.longitude,W.latitude=Math.min(W.latitude,g),W.longitude=Math.min(W.longitude,r),j.latitude=Math.max(j.latitude,g),j.longitude=Math.max(j.longitude,r)}for(let n=0;n<h-1;++n)Rt(f[n],f[n+1],e,O,W,j);let a=f[h-1];o.subtract(a,f[h-2],K),o.normalize(K,K),o.multiplyByScalar(K,O,K),o.add(a,K,pt),Rt(a,pt,e,O,W,j),l===ht.ROUNDED&&(e.cartesianToCartographic(pt,Q),g=Q.latitude,r=Q.longitude,W.latitude=Math.min(W.latitude,g),W.longitude=Math.min(W.longitude,r),j.latitude=Math.max(j.latitude,g),j.longitude=Math.max(j.longitude,r));let s=X(d)?d:new Et;return s.north=j.latitude,s.south=W.latitude,s.east=j.longitude,s.west=W.longitude,s}function et(t){t=B(t,B.EMPTY_OBJECT);let e=t.positions,i=t.width;it.defined("options.positions",e),it.defined("options.width",i);let l=B(t.height,0),d=B(t.extrudedHeight,l);this._positions=e,this._ellipsoid=I.clone(B(t.ellipsoid,I.default)),this._vertexFormat=G.clone(B(t.vertexFormat,G.DEFAULT)),this._width=i,this._height=Math.max(l,d),this._extrudedHeight=Math.min(l,d),this._cornerType=B(t.cornerType,ht.ROUNDED),this._granularity=B(t.granularity,st.RADIANS_PER_DEGREE),this._shadowVolume=B(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*o.packedLength+I.packedLength+G.packedLength+7}et.pack=function(t,e,i){it.defined("value",t),it.defined("array",e),i=B(i,0);let l=t._positions,d=l.length;e[i++]=d;for(let f=0;f<d;++f,i+=o.packedLength)o.pack(l[f],e,i);return I.pack(t._ellipsoid,e,i),i+=I.packedLength,G.pack(t._vertexFormat,e,i),i+=G.packedLength,e[i++]=t._width,e[i++]=t._height,e[i++]=t._extrudedHeight,e[i++]=t._cornerType,e[i++]=t._granularity,e[i++]=t._shadowVolume?1:0,e[i]=B(t._offsetAttribute,-1),e};var It=I.clone(I.UNIT_SPHERE),Wt=new G,tt={positions:void 0,ellipsoid:It,vertexFormat:Wt,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};et.unpack=function(t,e,i){it.defined("array",t),e=B(e,0);let l=t[e++],d=new Array(l);for(let u=0;u<l;++u,e+=o.packedLength)d[u]=o.unpack(t,e);let f=I.unpack(t,e,It);e+=I.packedLength;let h=G.unpack(t,e,Wt);e+=G.packedLength;let O=t[e++],g=t[e++],r=t[e++],a=t[e++],s=t[e++],n=t[e++]===1,A=t[e];return X(i)?(i._positions=d,i._ellipsoid=I.clone(f,i._ellipsoid),i._vertexFormat=G.clone(h,i._vertexFormat),i._width=O,i._height=g,i._extrudedHeight=r,i._cornerType=a,i._granularity=s,i._shadowVolume=n,i._offsetAttribute=A===-1?void 0:A,i):(tt.positions=d,tt.width=O,tt.height=g,tt.extrudedHeight=r,tt.cornerType=a,tt.granularity=s,tt.shadowVolume=n,tt.offsetAttribute=A===-1?void 0:A,new et(tt))};et.computeRectangle=function(t,e){t=B(t,B.EMPTY_OBJECT);let i=t.positions,l=t.width;it.defined("options.positions",i),it.defined("options.width",l);let d=B(t.ellipsoid,I.default),f=B(t.cornerType,ht.ROUNDED);return Yt(i,d,l,f,e)};et.createGeometry=function(t){let e=t._positions,i=t._width,l=t._ellipsoid;e=Ut(e,l);let d=Pt(e,o.equalsEpsilon);if(d.length<2||i<=0)return;let f=t._height,h=t._extrudedHeight,O=!st.equalsEpsilon(f,h,0,st.EPSILON2),g=t._vertexFormat,r={ellipsoid:l,positions:d,width:i,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0},a;if(O)r.height=f,r.extrudedHeight=h,r.shadowVolume=t._shadowVolume,r.offsetAttribute=t._offsetAttribute,a=Jt(r,g);else{let A=M.computePositions(r);if(a=Bt(A,g,l),a.attributes.position.values=yt.scaleToGeodeticHeight(a.attributes.position.values,f,l),X(t._offsetAttribute)){let u=t._offsetAttribute===_t.NONE?0:1,b=a.attributes.position.values.length,p=new Uint8Array(b/3).fill(u);a.attributes.applyOffset=new x({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})}}let s=a.attributes,n=St.fromVertices(s.position.values,void 0,3);return g.position||(a.attributes.position.values=void 0),new Vt({attributes:s,indices:a.indices,primitiveType:Mt.TRIANGLES,boundingSphere:n,offsetAttribute:t._offsetAttribute})};et.createShadowVolume=function(t,e,i){let l=t._granularity,d=t._ellipsoid,f=e(l,d),h=i(l,d);return new et({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:d,granularity:l,extrudedHeight:f,height:h,vertexFormat:G.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(et.prototype,{rectangle:{get:function(){return X(this._rectangle)||(this._rectangle=Yt(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var Lt=et;function Gt(t,e){return X(e)&&(t=Lt.unpack(t,e)),t._ellipsoid=I.clone(t._ellipsoid),Lt.createGeometry(t)}var Ae=Gt;export{Ae as default}; diff --git a/public/js/Cesium2/Workers/createCorridorOutlineGeometry.js b/public/js/Cesium2/Workers/createCorridorOutlineGeometry.js index 487f0a51d..c5da14967 100644 --- a/public/js/Cesium2/Workers/createCorridorOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createCorridorOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as S}from"./chunk-W7OWWJQT.js";import{a as W}from"./chunk-G72WI3OZ.js";import"./chunk-RNF7TLFF.js";import"./chunk-E7HC3VTG.js";import{a as K}from"./chunk-5CC3QRYS.js";import"./chunk-CTRWX4F5.js";import"./chunk-Z7BLUZ7R.js";import{b as Q}from"./chunk-WJYW7YDO.js";import{a as it}from"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as Z}from"./chunk-34ULWVZF.js";import{a as et}from"./chunk-24JYWT5N.js";import{b as I,c as tt,d as J}from"./chunk-LH3SUUXG.js";import{d as x}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as z}from"./chunk-D5HNP2LB.js";import{a as A,d as P}from"./chunk-S4VBGY2U.js";import{a as q}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as H}from"./chunk-N3A5CZ2S.js";import{b as M}from"./chunk-G75U3WZT.js";import{e as C}from"./chunk-3THTQ4QB.js";var ot=new A,nt=new A,rt=new A;function ft(t,i){for(let e=0;e<t.length;e++)t[e]=i.scaleToGeodeticSurface(t[e],t[e]);return t}function st(t,i){let e=[],l=t.positions,h=t.corners,m=t.endPositions,D=new et,y,u=0,p=0,o,g=0,d;for(o=0;o<l.length;o+=2)d=l[o].length-3,u+=d,g+=d/3*4,p+=l[o+1].length-3;for(u+=3,p+=3,o=0;o<h.length;o++){y=h[o];let c=h[o].leftPositions;C(c)?(d=c.length,u+=d,g+=d/3*2):(d=h[o].rightPositions.length,p+=d,g+=d/3*2)}let _=C(m),w;_&&(w=m[0].length-3,u+=w,p+=w,w/=3,g+=w*4);let T=u+p,b=new Float64Array(T),n=0,s=T-1,a,E,L,k,U,O,j=w/2,r=Z.createTypedArray(T/3,g+4),f=0;if(r[f++]=n/3,r[f++]=(s-2)/3,_){e.push(n/3),O=ot,U=nt;let c=m[0];for(o=0;o<j;o++)O=A.fromArray(c,(j-1-o)*3,O),U=A.fromArray(c,(j+o)*3,U),S.addAttribute(b,U,n),S.addAttribute(b,O,void 0,s),E=n/3,k=E+1,a=(s-2)/3,L=a-1,r[f++]=a,r[f++]=L,r[f++]=E,r[f++]=k,n+=3,s-=3}let G=0,F=l[G++],N=l[G++];for(b.set(F,n),b.set(N,s-N.length+1),d=N.length-3,e.push(n/3,(s-2)/3),o=0;o<d;o+=3)E=n/3,k=E+1,a=(s-2)/3,L=a-1,r[f++]=a,r[f++]=L,r[f++]=E,r[f++]=k,n+=3,s-=3;for(o=0;o<h.length;o++){let c;y=h[o];let Y=y.leftPositions,X=y.rightPositions,v,B=rt;if(C(Y)){for(s-=3,v=L,e.push(k),c=0;c<Y.length/3;c++)B=A.fromArray(Y,c*3,B),r[f++]=v-c-1,r[f++]=v-c,S.addAttribute(b,B,void 0,s),s-=3;e.push(v-Math.floor(Y.length/6)),i===W.BEVELED&&e.push((s-2)/3+1),n+=3}else{for(n+=3,v=k,e.push(L),c=0;c<X.length/3;c++)B=A.fromArray(X,c*3,B),r[f++]=v+c,r[f++]=v+c+1,S.addAttribute(b,B,n),n+=3;e.push(v+Math.floor(X.length/6)),i===W.BEVELED&&e.push(n/3-1),s-=3}for(F=l[G++],N=l[G++],F.splice(0,3),N.splice(N.length-3,3),b.set(F,n),b.set(N,s-N.length+1),d=N.length-3,c=0;c<N.length;c+=3)k=n/3,E=k-1,L=(s-2)/3,a=L+1,r[f++]=a,r[f++]=L,r[f++]=E,r[f++]=k,n+=3,s-=3;n-=3,s+=3,e.push(n/3,(s-2)/3)}if(_){n+=3,s-=3,O=ot,U=nt;let c=m[1];for(o=0;o<j;o++)O=A.fromArray(c,(w-o-1)*3,O),U=A.fromArray(c,o*3,U),S.addAttribute(b,O,void 0,s),S.addAttribute(b,U,n),k=n/3,E=k-1,L=(s-2)/3,a=L+1,r[f++]=a,r[f++]=L,r[f++]=E,r[f++]=k,n+=3,s-=3;e.push(n/3)}else e.push(n/3,(s-2)/3);return r[f++]=n/3,r[f++]=(s-2)/3,D.position=new J({componentDatatype:z.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:D,indices:r,wallIndices:e}}function ct(t){let i=t.ellipsoid,e=S.computePositions(t),l=st(e,t.cornerType),h=l.wallIndices,m=t.height,D=t.extrudedHeight,y=l.attributes,u=l.indices,p=y.position.values,o=p.length,g=new Float64Array(o);g.set(p);let d=new Float64Array(o*2);if(p=Q.scaleToGeodeticHeight(p,m,i),g=Q.scaleToGeodeticHeight(g,D,i),d.set(p),d.set(g,o),y.position.values=d,o/=3,C(t.offsetAttribute)){let a=new Uint8Array(o*2);if(t.offsetAttribute===K.TOP)a=a.fill(1,0,o);else{let E=t.offsetAttribute===K.NONE?0:1;a=a.fill(E)}y.applyOffset=new J({componentDatatype:z.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}let _,w=u.length,T=Z.createTypedArray(d.length/3,(w+h.length)*2);T.set(u);let b=w;for(_=0;_<w;_+=2){let a=u[_],E=u[_+1];T[b++]=a+o,T[b++]=E+o}let n,s;for(_=0;_<h.length;_++)n=h[_],s=n+o,T[b++]=n,T[b++]=s;return{attributes:y,indices:T}}function V(t){t=H(t,H.EMPTY_OBJECT);let i=t.positions,e=t.width;M.typeOf.object("options.positions",i),M.typeOf.number("options.width",e);let l=H(t.height,0),h=H(t.extrudedHeight,l);this._positions=i,this._ellipsoid=P.clone(H(t.ellipsoid,P.default)),this._width=e,this._height=Math.max(l,h),this._extrudedHeight=Math.min(l,h),this._cornerType=H(t.cornerType,W.ROUNDED),this._granularity=H(t.granularity,q.RADIANS_PER_DEGREE),this._offsetAttribute=t.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+i.length*A.packedLength+P.packedLength+6}V.pack=function(t,i,e){M.typeOf.object("value",t),M.typeOf.object("array",i),e=H(e,0);let l=t._positions,h=l.length;i[e++]=h;for(let m=0;m<h;++m,e+=A.packedLength)A.pack(l[m],i,e);return P.pack(t._ellipsoid,i,e),e+=P.packedLength,i[e++]=t._width,i[e++]=t._height,i[e++]=t._extrudedHeight,i[e++]=t._cornerType,i[e++]=t._granularity,i[e]=H(t._offsetAttribute,-1),i};var lt=P.clone(P.UNIT_SPHERE),R={positions:void 0,ellipsoid:lt,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};V.unpack=function(t,i,e){M.typeOf.object("array",t),i=H(i,0);let l=t[i++],h=new Array(l);for(let d=0;d<l;++d,i+=A.packedLength)h[d]=A.unpack(t,i);let m=P.unpack(t,i,lt);i+=P.packedLength;let D=t[i++],y=t[i++],u=t[i++],p=t[i++],o=t[i++],g=t[i];return C(e)?(e._positions=h,e._ellipsoid=P.clone(m,e._ellipsoid),e._width=D,e._height=y,e._extrudedHeight=u,e._cornerType=p,e._granularity=o,e._offsetAttribute=g===-1?void 0:g,e):(R.positions=h,R.width=D,R.height=y,R.extrudedHeight=u,R.cornerType=p,R.granularity=o,R.offsetAttribute=g===-1?void 0:g,new V(R))};V.createGeometry=function(t){let i=t._positions,e=t._width,l=t._ellipsoid;i=ft(i,l);let h=it(i,A.equalsEpsilon);if(h.length<2||e<=0)return;let m=t._height,D=t._extrudedHeight,y=!q.equalsEpsilon(m,D,0,q.EPSILON2),u={ellipsoid:l,positions:h,width:e,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!1},p;if(y)u.height=m,u.extrudedHeight=D,u.offsetAttribute=t._offsetAttribute,p=ct(u);else{let d=S.computePositions(u);if(p=st(d,u.cornerType),p.attributes.position.values=Q.scaleToGeodeticHeight(p.attributes.position.values,m,l),C(t._offsetAttribute)){let _=p.attributes.position.values.length,w=t._offsetAttribute===K.NONE?0:1,T=new Uint8Array(_/3).fill(w);p.attributes.applyOffset=new J({componentDatatype:z.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}}let o=p.attributes,g=x.fromVertices(o.position.values,void 0,3);return new tt({attributes:o,indices:p.indices,primitiveType:I.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})};var $=V;function ht(t,i){return C(i)&&(t=$.unpack(t,i)),t._ellipsoid=P.clone(t._ellipsoid),$.createGeometry(t)}var Ot=ht;export{Ot as default}; +import{a as S}from"./chunk-C37L3XAH.js";import{a as W}from"./chunk-VMIASSRO.js";import"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import{a as K}from"./chunk-N5SNKJ43.js";import"./chunk-P73YILG6.js";import"./chunk-VYMAIP2A.js";import{b as Q}from"./chunk-ZMGESOEZ.js";import{a as it}from"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as Z}from"./chunk-YFQNY2YN.js";import{a as et}from"./chunk-NT26NNVH.js";import{b as I,c as tt,d as J}from"./chunk-NW2YE576.js";import{d as x}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as z}from"./chunk-QHHYYTCM.js";import{a as A,d as P}from"./chunk-RH3GFHG2.js";import{a as q}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as H}from"./chunk-TA3RE4KQ.js";import{b as M}from"./chunk-RTY3VPG6.js";import{e as C}from"./chunk-LRNH5AEO.js";var ot=new A,nt=new A,rt=new A;function ft(t,i){for(let e=0;e<t.length;e++)t[e]=i.scaleToGeodeticSurface(t[e],t[e]);return t}function st(t,i){let e=[],l=t.positions,h=t.corners,m=t.endPositions,D=new et,y,u=0,p=0,o,g=0,d;for(o=0;o<l.length;o+=2)d=l[o].length-3,u+=d,g+=d/3*4,p+=l[o+1].length-3;for(u+=3,p+=3,o=0;o<h.length;o++){y=h[o];let c=h[o].leftPositions;C(c)?(d=c.length,u+=d,g+=d/3*2):(d=h[o].rightPositions.length,p+=d,g+=d/3*2)}let _=C(m),w;_&&(w=m[0].length-3,u+=w,p+=w,w/=3,g+=w*4);let T=u+p,b=new Float64Array(T),n=0,s=T-1,a,E,L,k,U,O,j=w/2,r=Z.createTypedArray(T/3,g+4),f=0;if(r[f++]=n/3,r[f++]=(s-2)/3,_){e.push(n/3),O=ot,U=nt;let c=m[0];for(o=0;o<j;o++)O=A.fromArray(c,(j-1-o)*3,O),U=A.fromArray(c,(j+o)*3,U),S.addAttribute(b,U,n),S.addAttribute(b,O,void 0,s),E=n/3,k=E+1,a=(s-2)/3,L=a-1,r[f++]=a,r[f++]=L,r[f++]=E,r[f++]=k,n+=3,s-=3}let G=0,F=l[G++],N=l[G++];for(b.set(F,n),b.set(N,s-N.length+1),d=N.length-3,e.push(n/3,(s-2)/3),o=0;o<d;o+=3)E=n/3,k=E+1,a=(s-2)/3,L=a-1,r[f++]=a,r[f++]=L,r[f++]=E,r[f++]=k,n+=3,s-=3;for(o=0;o<h.length;o++){let c;y=h[o];let Y=y.leftPositions,X=y.rightPositions,v,B=rt;if(C(Y)){for(s-=3,v=L,e.push(k),c=0;c<Y.length/3;c++)B=A.fromArray(Y,c*3,B),r[f++]=v-c-1,r[f++]=v-c,S.addAttribute(b,B,void 0,s),s-=3;e.push(v-Math.floor(Y.length/6)),i===W.BEVELED&&e.push((s-2)/3+1),n+=3}else{for(n+=3,v=k,e.push(L),c=0;c<X.length/3;c++)B=A.fromArray(X,c*3,B),r[f++]=v+c,r[f++]=v+c+1,S.addAttribute(b,B,n),n+=3;e.push(v+Math.floor(X.length/6)),i===W.BEVELED&&e.push(n/3-1),s-=3}for(F=l[G++],N=l[G++],F.splice(0,3),N.splice(N.length-3,3),b.set(F,n),b.set(N,s-N.length+1),d=N.length-3,c=0;c<N.length;c+=3)k=n/3,E=k-1,L=(s-2)/3,a=L+1,r[f++]=a,r[f++]=L,r[f++]=E,r[f++]=k,n+=3,s-=3;n-=3,s+=3,e.push(n/3,(s-2)/3)}if(_){n+=3,s-=3,O=ot,U=nt;let c=m[1];for(o=0;o<j;o++)O=A.fromArray(c,(w-o-1)*3,O),U=A.fromArray(c,o*3,U),S.addAttribute(b,O,void 0,s),S.addAttribute(b,U,n),k=n/3,E=k-1,L=(s-2)/3,a=L+1,r[f++]=a,r[f++]=L,r[f++]=E,r[f++]=k,n+=3,s-=3;e.push(n/3)}else e.push(n/3,(s-2)/3);return r[f++]=n/3,r[f++]=(s-2)/3,D.position=new J({componentDatatype:z.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:D,indices:r,wallIndices:e}}function ct(t){let i=t.ellipsoid,e=S.computePositions(t),l=st(e,t.cornerType),h=l.wallIndices,m=t.height,D=t.extrudedHeight,y=l.attributes,u=l.indices,p=y.position.values,o=p.length,g=new Float64Array(o);g.set(p);let d=new Float64Array(o*2);if(p=Q.scaleToGeodeticHeight(p,m,i),g=Q.scaleToGeodeticHeight(g,D,i),d.set(p),d.set(g,o),y.position.values=d,o/=3,C(t.offsetAttribute)){let a=new Uint8Array(o*2);if(t.offsetAttribute===K.TOP)a=a.fill(1,0,o);else{let E=t.offsetAttribute===K.NONE?0:1;a=a.fill(E)}y.applyOffset=new J({componentDatatype:z.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}let _,w=u.length,T=Z.createTypedArray(d.length/3,(w+h.length)*2);T.set(u);let b=w;for(_=0;_<w;_+=2){let a=u[_],E=u[_+1];T[b++]=a+o,T[b++]=E+o}let n,s;for(_=0;_<h.length;_++)n=h[_],s=n+o,T[b++]=n,T[b++]=s;return{attributes:y,indices:T}}function V(t){t=H(t,H.EMPTY_OBJECT);let i=t.positions,e=t.width;M.typeOf.object("options.positions",i),M.typeOf.number("options.width",e);let l=H(t.height,0),h=H(t.extrudedHeight,l);this._positions=i,this._ellipsoid=P.clone(H(t.ellipsoid,P.default)),this._width=e,this._height=Math.max(l,h),this._extrudedHeight=Math.min(l,h),this._cornerType=H(t.cornerType,W.ROUNDED),this._granularity=H(t.granularity,q.RADIANS_PER_DEGREE),this._offsetAttribute=t.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+i.length*A.packedLength+P.packedLength+6}V.pack=function(t,i,e){M.typeOf.object("value",t),M.typeOf.object("array",i),e=H(e,0);let l=t._positions,h=l.length;i[e++]=h;for(let m=0;m<h;++m,e+=A.packedLength)A.pack(l[m],i,e);return P.pack(t._ellipsoid,i,e),e+=P.packedLength,i[e++]=t._width,i[e++]=t._height,i[e++]=t._extrudedHeight,i[e++]=t._cornerType,i[e++]=t._granularity,i[e]=H(t._offsetAttribute,-1),i};var lt=P.clone(P.UNIT_SPHERE),R={positions:void 0,ellipsoid:lt,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};V.unpack=function(t,i,e){M.typeOf.object("array",t),i=H(i,0);let l=t[i++],h=new Array(l);for(let d=0;d<l;++d,i+=A.packedLength)h[d]=A.unpack(t,i);let m=P.unpack(t,i,lt);i+=P.packedLength;let D=t[i++],y=t[i++],u=t[i++],p=t[i++],o=t[i++],g=t[i];return C(e)?(e._positions=h,e._ellipsoid=P.clone(m,e._ellipsoid),e._width=D,e._height=y,e._extrudedHeight=u,e._cornerType=p,e._granularity=o,e._offsetAttribute=g===-1?void 0:g,e):(R.positions=h,R.width=D,R.height=y,R.extrudedHeight=u,R.cornerType=p,R.granularity=o,R.offsetAttribute=g===-1?void 0:g,new V(R))};V.createGeometry=function(t){let i=t._positions,e=t._width,l=t._ellipsoid;i=ft(i,l);let h=it(i,A.equalsEpsilon);if(h.length<2||e<=0)return;let m=t._height,D=t._extrudedHeight,y=!q.equalsEpsilon(m,D,0,q.EPSILON2),u={ellipsoid:l,positions:h,width:e,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!1},p;if(y)u.height=m,u.extrudedHeight=D,u.offsetAttribute=t._offsetAttribute,p=ct(u);else{let d=S.computePositions(u);if(p=st(d,u.cornerType),p.attributes.position.values=Q.scaleToGeodeticHeight(p.attributes.position.values,m,l),C(t._offsetAttribute)){let _=p.attributes.position.values.length,w=t._offsetAttribute===K.NONE?0:1,T=new Uint8Array(_/3).fill(w);p.attributes.applyOffset=new J({componentDatatype:z.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}}let o=p.attributes,g=x.fromVertices(o.position.values,void 0,3);return new tt({attributes:o,indices:p.indices,primitiveType:I.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})};var $=V;function ht(t,i){return C(i)&&(t=$.unpack(t,i)),t._ellipsoid=P.clone(t._ellipsoid),$.createGeometry(t)}var Ot=ht;export{Ot as default}; diff --git a/public/js/Cesium2/Workers/createCylinderGeometry.js b/public/js/Cesium2/Workers/createCylinderGeometry.js index 67ce23a93..8499004ca 100644 --- a/public/js/Cesium2/Workers/createCylinderGeometry.js +++ b/public/js/Cesium2/Workers/createCylinderGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as r}from"./chunk-ZFYLUAMF.js";import"./chunk-OTRIIEF3.js";import"./chunk-5CC3QRYS.js";import"./chunk-6HIVPZ7K.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{e as o}from"./chunk-3THTQ4QB.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; +import{a as r}from"./chunk-SN56D5AL.js";import"./chunk-QV3DAXWD.js";import"./chunk-N5SNKJ43.js";import"./chunk-6VK5R74O.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{e as o}from"./chunk-LRNH5AEO.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; diff --git a/public/js/Cesium2/Workers/createCylinderOutlineGeometry.js b/public/js/Cesium2/Workers/createCylinderOutlineGeometry.js index b415777c7..093f2fad7 100644 --- a/public/js/Cesium2/Workers/createCylinderOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createCylinderOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as M}from"./chunk-OTRIIEF3.js";import{a as V}from"./chunk-5CC3QRYS.js";import{a as N}from"./chunk-34ULWVZF.js";import{a as k}from"./chunk-24JYWT5N.js";import{b as D,c as P,d as L}from"./chunk-LH3SUUXG.js";import{d as y}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as A}from"./chunk-D5HNP2LB.js";import{a as S,c as R}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as c}from"./chunk-N3A5CZ2S.js";import{a as T,b as m}from"./chunk-G75U3WZT.js";import{e as d}from"./chunk-3THTQ4QB.js";var w=new R;function a(t){t=c(t,c.EMPTY_OBJECT);let e=t.length,i=t.topRadius,f=t.bottomRadius,o=c(t.slices,128),r=Math.max(c(t.numberOfVerticalLines,16),0);if(m.typeOf.number("options.positions",e),m.typeOf.number("options.topRadius",i),m.typeOf.number("options.bottomRadius",f),m.typeOf.number.greaterThanOrEquals("options.slices",o,3),d(t.offsetAttribute)&&t.offsetAttribute===V.TOP)throw new T("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=e,this._topRadius=i,this._bottomRadius=f,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}a.packedLength=6;a.pack=function(t,e,i){return m.typeOf.object("value",t),m.defined("array",e),i=c(i,0),e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=c(t._offsetAttribute,-1),e};var b={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};a.unpack=function(t,e,i){m.defined("array",t),e=c(e,0);let f=t[e++],o=t[e++],r=t[e++],h=t[e++],l=t[e++],p=t[e];return d(i)?(i._length=f,i._topRadius=o,i._bottomRadius=r,i._slices=h,i._numberOfVerticalLines=l,i._offsetAttribute=p===-1?void 0:p,i):(b.length=f,b.topRadius=o,b.bottomRadius=r,b.slices=h,b.numberOfVerticalLines=l,b.offsetAttribute=p===-1?void 0:p,new a(b))};a.createGeometry=function(t){let e=t._length,i=t._topRadius,f=t._bottomRadius,o=t._slices,r=t._numberOfVerticalLines;if(e<=0||i<0||f<0||i===0&&f===0)return;let h=o*2,l=M.computePositions(e,i,f,o,!1),p=o*2,E;if(r>0){let O=Math.min(r,o);E=Math.round(o/O),p+=O}let s=N.createTypedArray(h,p*2),u=0,n;for(n=0;n<o-1;n++)s[u++]=n,s[u++]=n+1,s[u++]=n+o,s[u++]=n+1+o;if(s[u++]=o-1,s[u++]=0,s[u++]=o+o-1,s[u++]=o,r>0)for(n=0;n<o;n+=E)s[u++]=n,s[u++]=n+o;let _=new k;_.position=new L({componentDatatype:A.DOUBLE,componentsPerAttribute:3,values:l}),w.x=e*.5,w.y=Math.max(f,i);let g=new y(S.ZERO,R.magnitude(w));if(d(t._offsetAttribute)){e=l.length;let O=t._offsetAttribute===V.NONE?0:1,B=new Uint8Array(e/3).fill(O);_.applyOffset=new L({componentDatatype:A.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new P({attributes:_,indices:s,primitiveType:D.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})};var C=a;function G(t,e){return d(e)&&(t=C.unpack(t,e)),C.createGeometry(t)}var et=G;export{et as default}; +import{a as M}from"./chunk-QV3DAXWD.js";import{a as V}from"./chunk-N5SNKJ43.js";import{a as N}from"./chunk-YFQNY2YN.js";import{a as k}from"./chunk-NT26NNVH.js";import{b as D,c as P,d as L}from"./chunk-NW2YE576.js";import{d as y}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as A}from"./chunk-QHHYYTCM.js";import{a as S,c as R}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as c}from"./chunk-TA3RE4KQ.js";import{a as T,b as m}from"./chunk-RTY3VPG6.js";import{e as d}from"./chunk-LRNH5AEO.js";var w=new R;function a(t){t=c(t,c.EMPTY_OBJECT);let e=t.length,i=t.topRadius,f=t.bottomRadius,o=c(t.slices,128),r=Math.max(c(t.numberOfVerticalLines,16),0);if(m.typeOf.number("options.positions",e),m.typeOf.number("options.topRadius",i),m.typeOf.number("options.bottomRadius",f),m.typeOf.number.greaterThanOrEquals("options.slices",o,3),d(t.offsetAttribute)&&t.offsetAttribute===V.TOP)throw new T("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=e,this._topRadius=i,this._bottomRadius=f,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}a.packedLength=6;a.pack=function(t,e,i){return m.typeOf.object("value",t),m.defined("array",e),i=c(i,0),e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=c(t._offsetAttribute,-1),e};var b={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};a.unpack=function(t,e,i){m.defined("array",t),e=c(e,0);let f=t[e++],o=t[e++],r=t[e++],h=t[e++],l=t[e++],p=t[e];return d(i)?(i._length=f,i._topRadius=o,i._bottomRadius=r,i._slices=h,i._numberOfVerticalLines=l,i._offsetAttribute=p===-1?void 0:p,i):(b.length=f,b.topRadius=o,b.bottomRadius=r,b.slices=h,b.numberOfVerticalLines=l,b.offsetAttribute=p===-1?void 0:p,new a(b))};a.createGeometry=function(t){let e=t._length,i=t._topRadius,f=t._bottomRadius,o=t._slices,r=t._numberOfVerticalLines;if(e<=0||i<0||f<0||i===0&&f===0)return;let h=o*2,l=M.computePositions(e,i,f,o,!1),p=o*2,E;if(r>0){let O=Math.min(r,o);E=Math.round(o/O),p+=O}let s=N.createTypedArray(h,p*2),u=0,n;for(n=0;n<o-1;n++)s[u++]=n,s[u++]=n+1,s[u++]=n+o,s[u++]=n+1+o;if(s[u++]=o-1,s[u++]=0,s[u++]=o+o-1,s[u++]=o,r>0)for(n=0;n<o;n+=E)s[u++]=n,s[u++]=n+o;let _=new k;_.position=new L({componentDatatype:A.DOUBLE,componentsPerAttribute:3,values:l}),w.x=e*.5,w.y=Math.max(f,i);let g=new y(S.ZERO,R.magnitude(w));if(d(t._offsetAttribute)){e=l.length;let O=t._offsetAttribute===V.NONE?0:1,B=new Uint8Array(e/3).fill(O);_.applyOffset=new L({componentDatatype:A.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new P({attributes:_,indices:s,primitiveType:D.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})};var C=a;function G(t,e){return d(e)&&(t=C.unpack(t,e)),C.createGeometry(t)}var et=G;export{et as default}; diff --git a/public/js/Cesium2/Workers/createEllipseGeometry.js b/public/js/Cesium2/Workers/createEllipseGeometry.js index 7e76fbd62..968831ca4 100644 --- a/public/js/Cesium2/Workers/createEllipseGeometry.js +++ b/public/js/Cesium2/Workers/createEllipseGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as o}from"./chunk-IF6EJ7KL.js";import"./chunk-MWSGYAUE.js";import"./chunk-W5MIOKEY.js";import"./chunk-72CGGEJF.js";import"./chunk-Q5MYX5A2.js";import"./chunk-OZYLWM74.js";import"./chunk-5CC3QRYS.js";import"./chunk-6HIVPZ7K.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as t,d as c}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{e as n}from"./chunk-3THTQ4QB.js";function a(r,i){return n(i)&&(r=o.unpack(r,i)),r._center=t.clone(r._center),r._ellipsoid=c.clone(r._ellipsoid),o.createGeometry(r)}var u=a;export{u as default}; +import{a as o}from"./chunk-YGBGLFI5.js";import"./chunk-FAPED76U.js";import"./chunk-4MYAYFOP.js";import"./chunk-FG3CL3AH.js";import"./chunk-VMXXQ6B4.js";import"./chunk-XCRMBS5M.js";import"./chunk-N5SNKJ43.js";import"./chunk-6VK5R74O.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as t,d as c}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{e as n}from"./chunk-LRNH5AEO.js";function a(r,i){return n(i)&&(r=o.unpack(r,i)),r._center=t.clone(r._center),r._ellipsoid=c.clone(r._ellipsoid),o.createGeometry(r)}var u=a;export{u as default}; diff --git a/public/js/Cesium2/Workers/createEllipseOutlineGeometry.js b/public/js/Cesium2/Workers/createEllipseOutlineGeometry.js index e981ec03c..01fb313c7 100644 --- a/public/js/Cesium2/Workers/createEllipseOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createEllipseOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as i}from"./chunk-SYY6FTAS.js";import"./chunk-MWSGYAUE.js";import"./chunk-5CC3QRYS.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as t,d as c}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{e as o}from"./chunk-3THTQ4QB.js";function a(r,n){return o(n)&&(r=i.unpack(r,n)),r._center=t.clone(r._center),r._ellipsoid=c.clone(r._ellipsoid),i.createGeometry(r)}var p=a;export{p as default}; +import{a as i}from"./chunk-OIKPZP2Y.js";import"./chunk-FAPED76U.js";import"./chunk-N5SNKJ43.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as t,d as c}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{e as o}from"./chunk-LRNH5AEO.js";function a(r,n){return o(n)&&(r=i.unpack(r,n)),r._center=t.clone(r._center),r._ellipsoid=c.clone(r._ellipsoid),i.createGeometry(r)}var p=a;export{p as default}; diff --git a/public/js/Cesium2/Workers/createEllipsoidGeometry.js b/public/js/Cesium2/Workers/createEllipsoidGeometry.js index a6290323f..40cc3964c 100644 --- a/public/js/Cesium2/Workers/createEllipsoidGeometry.js +++ b/public/js/Cesium2/Workers/createEllipsoidGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as e}from"./chunk-HQXG4R4L.js";import"./chunk-5CC3QRYS.js";import"./chunk-6HIVPZ7K.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{e as o}from"./chunk-3THTQ4QB.js";function i(r,t){return o(t)&&(r=e.unpack(r,t)),e.createGeometry(r)}var a=i;export{a as default}; +import{a as e}from"./chunk-T4KTDR3V.js";import"./chunk-N5SNKJ43.js";import"./chunk-6VK5R74O.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{e as o}from"./chunk-LRNH5AEO.js";function i(r,t){return o(t)&&(r=e.unpack(r,t)),e.createGeometry(r)}var a=i;export{a as default}; diff --git a/public/js/Cesium2/Workers/createEllipsoidOutlineGeometry.js b/public/js/Cesium2/Workers/createEllipsoidOutlineGeometry.js index 8e34b117e..83c629cef 100644 --- a/public/js/Cesium2/Workers/createEllipsoidOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createEllipsoidOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as t}from"./chunk-N5HLZFHR.js";import"./chunk-5CC3QRYS.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{e as n}from"./chunk-3THTQ4QB.js";function u(r,e){return n(r.buffer,e)&&(r=t.unpack(r,e)),t.createGeometry(r)}var a=u;export{a as default}; +import{a as t}from"./chunk-SXC2BH5N.js";import"./chunk-N5SNKJ43.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{e as n}from"./chunk-LRNH5AEO.js";function u(r,e){return n(r.buffer,e)&&(r=t.unpack(r,e)),t.createGeometry(r)}var a=u;export{a as default}; diff --git a/public/js/Cesium2/Workers/createFrustumGeometry.js b/public/js/Cesium2/Workers/createFrustumGeometry.js index ce0e62677..a8272c6a5 100644 --- a/public/js/Cesium2/Workers/createFrustumGeometry.js +++ b/public/js/Cesium2/Workers/createFrustumGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{c as r}from"./chunk-Q5IXWMLP.js";import"./chunk-6HIVPZ7K.js";import"./chunk-RRZIPF5C.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{e as o}from"./chunk-3THTQ4QB.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; +import{c as r}from"./chunk-C5GNG3FC.js";import"./chunk-6VK5R74O.js";import"./chunk-SACP225T.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{e as o}from"./chunk-LRNH5AEO.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; diff --git a/public/js/Cesium2/Workers/createFrustumOutlineGeometry.js b/public/js/Cesium2/Workers/createFrustumOutlineGeometry.js index ecf5f54fb..96d2943df 100644 --- a/public/js/Cesium2/Workers/createFrustumOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createFrustumOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as k,b as _,c as j}from"./chunk-Q5IXWMLP.js";import"./chunk-6HIVPZ7K.js";import"./chunk-RRZIPF5C.js";import{a as A}from"./chunk-24JYWT5N.js";import{b as N,c as g,d as F}from"./chunk-LH3SUUXG.js";import{d as T}from"./chunk-K2M3OJ7Z.js";import{f as s}from"./chunk-M3A6SPGI.js";import{a as b}from"./chunk-D5HNP2LB.js";import{a}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as d}from"./chunk-N3A5CZ2S.js";import{b as h}from"./chunk-G75U3WZT.js";import{e as w}from"./chunk-3THTQ4QB.js";var L=0,C=1;function l(e){h.typeOf.object("options",e),h.typeOf.object("options.frustum",e.frustum),h.typeOf.object("options.origin",e.origin),h.typeOf.object("options.orientation",e.orientation);let t=e.frustum,o=e.orientation,u=e.origin,c=d(e._drawNearPlane,!0),m,p;t instanceof _?(m=L,p=_.packedLength):t instanceof k&&(m=C,p=k.packedLength),this._frustumType=m,this._frustum=t.clone(),this._origin=a.clone(u),this._orientation=s.clone(o),this._drawNearPlane=c,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+p+a.packedLength+s.packedLength}l.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=d(o,0);let u=e._frustumType,c=e._frustum;return t[o++]=u,u===L?(_.pack(c,t,o),o+=_.packedLength):(k.pack(c,t,o),o+=k.packedLength),a.pack(e._origin,t,o),o+=a.packedLength,s.pack(e._orientation,t,o),o+=s.packedLength,t[o]=e._drawNearPlane?1:0,t};var E=new _,G=new k,R=new s,S=new a;l.unpack=function(e,t,o){h.defined("array",e),t=d(t,0);let u=e[t++],c;u===L?(c=_.unpack(e,t,E),t+=_.packedLength):(c=k.unpack(e,t,G),t+=k.packedLength);let m=a.unpack(e,t,S);t+=a.packedLength;let p=s.unpack(e,t,R);t+=s.packedLength;let P=e[t]===1;if(!w(o))return new l({frustum:c,origin:m,orientation:p,_drawNearPlane:P});let n=u===o._frustumType?o._frustum:void 0;return o._frustum=c.clone(n),o._frustumType=u,o._origin=a.clone(m,o._origin),o._orientation=s.clone(p,o._orientation),o._drawNearPlane=P,o};l.createGeometry=function(e){let t=e._frustumType,o=e._frustum,u=e._origin,c=e._orientation,m=e._drawNearPlane,p=new Float64Array(3*4*2);j._computeNearFarPlanes(u,c,t,o,p);let P=new A({position:new F({componentDatatype:b.DOUBLE,componentsPerAttribute:3,values:p})}),n,r,y=m?2:1,i=new Uint16Array(8*(y+1)),f=m?0:1;for(;f<2;++f)n=m?f*8:0,r=f*4,i[n]=r,i[n+1]=r+1,i[n+2]=r+1,i[n+3]=r+2,i[n+4]=r+2,i[n+5]=r+3,i[n+6]=r+3,i[n+7]=r;for(f=0;f<2;++f)n=(y+f)*8,r=f*4,i[n]=r,i[n+1]=r+4,i[n+2]=r+1,i[n+3]=r+5,i[n+4]=r+2,i[n+5]=r+6,i[n+6]=r+3,i[n+7]=r+7;return new g({attributes:P,indices:i,primitiveType:N.LINES,boundingSphere:T.fromVertices(p)})};var O=l;function D(e,t){return w(t)&&(e=O.unpack(e,t)),O.createGeometry(e)}var I=D;export{I as default}; +import{a as k,b as _,c as j}from"./chunk-C5GNG3FC.js";import"./chunk-6VK5R74O.js";import"./chunk-SACP225T.js";import{a as A}from"./chunk-NT26NNVH.js";import{b as N,c as g,d as F}from"./chunk-NW2YE576.js";import{d as T}from"./chunk-2NIQ5ECB.js";import{f as s}from"./chunk-7YEOLR2L.js";import{a as b}from"./chunk-QHHYYTCM.js";import{a}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as d}from"./chunk-TA3RE4KQ.js";import{b as h}from"./chunk-RTY3VPG6.js";import{e as w}from"./chunk-LRNH5AEO.js";var L=0,C=1;function l(e){h.typeOf.object("options",e),h.typeOf.object("options.frustum",e.frustum),h.typeOf.object("options.origin",e.origin),h.typeOf.object("options.orientation",e.orientation);let t=e.frustum,o=e.orientation,u=e.origin,c=d(e._drawNearPlane,!0),m,p;t instanceof _?(m=L,p=_.packedLength):t instanceof k&&(m=C,p=k.packedLength),this._frustumType=m,this._frustum=t.clone(),this._origin=a.clone(u),this._orientation=s.clone(o),this._drawNearPlane=c,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+p+a.packedLength+s.packedLength}l.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=d(o,0);let u=e._frustumType,c=e._frustum;return t[o++]=u,u===L?(_.pack(c,t,o),o+=_.packedLength):(k.pack(c,t,o),o+=k.packedLength),a.pack(e._origin,t,o),o+=a.packedLength,s.pack(e._orientation,t,o),o+=s.packedLength,t[o]=e._drawNearPlane?1:0,t};var E=new _,G=new k,R=new s,S=new a;l.unpack=function(e,t,o){h.defined("array",e),t=d(t,0);let u=e[t++],c;u===L?(c=_.unpack(e,t,E),t+=_.packedLength):(c=k.unpack(e,t,G),t+=k.packedLength);let m=a.unpack(e,t,S);t+=a.packedLength;let p=s.unpack(e,t,R);t+=s.packedLength;let P=e[t]===1;if(!w(o))return new l({frustum:c,origin:m,orientation:p,_drawNearPlane:P});let n=u===o._frustumType?o._frustum:void 0;return o._frustum=c.clone(n),o._frustumType=u,o._origin=a.clone(m,o._origin),o._orientation=s.clone(p,o._orientation),o._drawNearPlane=P,o};l.createGeometry=function(e){let t=e._frustumType,o=e._frustum,u=e._origin,c=e._orientation,m=e._drawNearPlane,p=new Float64Array(3*4*2);j._computeNearFarPlanes(u,c,t,o,p);let P=new A({position:new F({componentDatatype:b.DOUBLE,componentsPerAttribute:3,values:p})}),n,r,y=m?2:1,i=new Uint16Array(8*(y+1)),f=m?0:1;for(;f<2;++f)n=m?f*8:0,r=f*4,i[n]=r,i[n+1]=r+1,i[n+2]=r+1,i[n+3]=r+2,i[n+4]=r+2,i[n+5]=r+3,i[n+6]=r+3,i[n+7]=r;for(f=0;f<2;++f)n=(y+f)*8,r=f*4,i[n]=r,i[n+1]=r+4,i[n+2]=r+1,i[n+3]=r+5,i[n+4]=r+2,i[n+5]=r+6,i[n+6]=r+3,i[n+7]=r+7;return new g({attributes:P,indices:i,primitiveType:N.LINES,boundingSphere:T.fromVertices(p)})};var O=l;function D(e,t){return w(t)&&(e=O.unpack(e,t)),O.createGeometry(e)}var I=D;export{I as default}; diff --git a/public/js/Cesium2/Workers/createGeometry.js b/public/js/Cesium2/Workers/createGeometry.js index 88af44a86..76830b02a 100644 --- a/public/js/Cesium2/Workers/createGeometry.js +++ b/public/js/Cesium2/Workers/createGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as d}from"./chunk-XSINRSN5.js";import{a as w}from"./chunk-4BYMTYMT.js";import"./chunk-UJMUN4NO.js";import"./chunk-72CGGEJF.js";import"./chunk-Q5MYX5A2.js";import"./chunk-OZYLWM74.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as k}from"./chunk-N3A5CZ2S.js";import{a as y}from"./chunk-G75U3WZT.js";import{a,b as p,e as r}from"./chunk-3THTQ4QB.js";var b=p({"./combineGeometry.js":()=>import("./combineGeometry.js"),"./createBoxGeometry.js":()=>import("./createBoxGeometry.js"),"./createBoxOutlineGeometry.js":()=>import("./createBoxOutlineGeometry.js"),"./createCircleGeometry.js":()=>import("./createCircleGeometry.js"),"./createCircleOutlineGeometry.js":()=>import("./createCircleOutlineGeometry.js"),"./createCoplanarPolygonGeometry.js":()=>import("./createCoplanarPolygonGeometry.js"),"./createCoplanarPolygonOutlineGeometry.js":()=>import("./createCoplanarPolygonOutlineGeometry.js"),"./createCorridorGeometry.js":()=>import("./createCorridorGeometry.js"),"./createCorridorOutlineGeometry.js":()=>import("./createCorridorOutlineGeometry.js"),"./createCylinderGeometry.js":()=>import("./createCylinderGeometry.js"),"./createCylinderOutlineGeometry.js":()=>import("./createCylinderOutlineGeometry.js"),"./createEllipseGeometry.js":()=>import("./createEllipseGeometry.js"),"./createEllipseOutlineGeometry.js":()=>import("./createEllipseOutlineGeometry.js"),"./createEllipsoidGeometry.js":()=>import("./createEllipsoidGeometry.js"),"./createEllipsoidOutlineGeometry.js":()=>import("./createEllipsoidOutlineGeometry.js"),"./createFrustumGeometry.js":()=>import("./createFrustumGeometry.js"),"./createFrustumOutlineGeometry.js":()=>import("./createFrustumOutlineGeometry.js"),"./createGeometry.js":()=>import("./createGeometry.js"),"./createGroundPolylineGeometry.js":()=>import("./createGroundPolylineGeometry.js"),"./createPlaneGeometry.js":()=>import("./createPlaneGeometry.js"),"./createPlaneOutlineGeometry.js":()=>import("./createPlaneOutlineGeometry.js"),"./createPolygonGeometry.js":()=>import("./createPolygonGeometry.js"),"./createPolygonOutlineGeometry.js":()=>import("./createPolygonOutlineGeometry.js"),"./createPolylineGeometry.js":()=>import("./createPolylineGeometry.js"),"./createPolylineVolumeGeometry.js":()=>import("./createPolylineVolumeGeometry.js"),"./createPolylineVolumeOutlineGeometry.js":()=>import("./createPolylineVolumeOutlineGeometry.js"),"./createRectangleGeometry.js":()=>import("./createRectangleGeometry.js"),"./createRectangleOutlineGeometry.js":()=>import("./createRectangleOutlineGeometry.js"),"./createSimplePolylineGeometry.js":()=>import("./createSimplePolylineGeometry.js"),"./createSphereGeometry.js":()=>import("./createSphereGeometry.js"),"./createSphereOutlineGeometry.js":()=>import("./createSphereOutlineGeometry.js"),"./createTaskProcessorWorker.js":()=>import("./createTaskProcessorWorker.js"),"./createVectorTileClampedPolylines.js":()=>import("./createVectorTileClampedPolylines.js"),"./createVectorTileGeometries.js":()=>import("./createVectorTileGeometries.js"),"./createVectorTilePoints.js":()=>import("./createVectorTilePoints.js"),"./createVectorTilePolygons.js":()=>import("./createVectorTilePolygons.js"),"./createVectorTilePolylines.js":()=>import("./createVectorTilePolylines.js"),"./createVerticesFromGoogleEarthEnterpriseBuffer.js":()=>import("./createVerticesFromGoogleEarthEnterpriseBuffer.js"),"./createVerticesFromHeightmap.js":()=>import("./createVerticesFromHeightmap.js"),"./createVerticesFromQuantizedTerrainMesh.js":()=>import("./createVerticesFromQuantizedTerrainMesh.js"),"./createWallGeometry.js":()=>import("./createWallGeometry.js"),"./createWallOutlineGeometry.js":()=>import("./createWallOutlineGeometry.js"),"./decodeDraco.js":()=>import("./decodeDraco.js"),"./decodeGoogleEarthEnterprisePacket.js":()=>import("./decodeGoogleEarthEnterprisePacket.js"),"./decodeI3S.js":()=>import("./decodeI3S.js"),"./transcodeKTX2.js":()=>import("./transcodeKTX2.js"),"./transferTypedArrayTest.js":()=>import("./transferTypedArrayTest.js"),"./upsampleQuantizedTerrainMesh.js":()=>import("./upsampleQuantizedTerrainMesh.js")});var f={};async function h(s,t){let e=k(f[t],f[s]);return r(e)?e:r(t)?(typeof exports=="object"?e=a(t):e=(await import(t)).default,f[t]=e,e):(typeof exports=="object"?e=a(`Workers/${s}`):e=(r(t)?await import(t):await b(`./${s}.js`)).default,f[s]=e,e)}async function x(s,t){let e=s.subTasks,n=e.length,u=new Array(n);for(let o=0;o<n;o++){let i=e[o],m=i.geometry,l=i.moduleName,c=i.modulePath;if(r(l)&&r(c))throw new y("Must only set moduleName or modulePath");r(l)||r(c)?u[o]=h(l,c).then(g=>g(m,i.offset)):u[o]=m}return Promise.all(u).then(function(o){return d.packCreateGeometryResults(o,t)})}var P=w(x);export{P as default}; +import{a as d}from"./chunk-JRKXMAM5.js";import{a as w}from"./chunk-4E3APMCC.js";import"./chunk-HMHR6SIB.js";import"./chunk-FG3CL3AH.js";import"./chunk-VMXXQ6B4.js";import"./chunk-XCRMBS5M.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as k}from"./chunk-TA3RE4KQ.js";import{a as y}from"./chunk-RTY3VPG6.js";import{a,b as p,e as r}from"./chunk-LRNH5AEO.js";var b=p({"./combineGeometry.js":()=>import("./combineGeometry.js"),"./createBoxGeometry.js":()=>import("./createBoxGeometry.js"),"./createBoxOutlineGeometry.js":()=>import("./createBoxOutlineGeometry.js"),"./createCircleGeometry.js":()=>import("./createCircleGeometry.js"),"./createCircleOutlineGeometry.js":()=>import("./createCircleOutlineGeometry.js"),"./createCoplanarPolygonGeometry.js":()=>import("./createCoplanarPolygonGeometry.js"),"./createCoplanarPolygonOutlineGeometry.js":()=>import("./createCoplanarPolygonOutlineGeometry.js"),"./createCorridorGeometry.js":()=>import("./createCorridorGeometry.js"),"./createCorridorOutlineGeometry.js":()=>import("./createCorridorOutlineGeometry.js"),"./createCylinderGeometry.js":()=>import("./createCylinderGeometry.js"),"./createCylinderOutlineGeometry.js":()=>import("./createCylinderOutlineGeometry.js"),"./createEllipseGeometry.js":()=>import("./createEllipseGeometry.js"),"./createEllipseOutlineGeometry.js":()=>import("./createEllipseOutlineGeometry.js"),"./createEllipsoidGeometry.js":()=>import("./createEllipsoidGeometry.js"),"./createEllipsoidOutlineGeometry.js":()=>import("./createEllipsoidOutlineGeometry.js"),"./createFrustumGeometry.js":()=>import("./createFrustumGeometry.js"),"./createFrustumOutlineGeometry.js":()=>import("./createFrustumOutlineGeometry.js"),"./createGeometry.js":()=>import("./createGeometry.js"),"./createGroundPolylineGeometry.js":()=>import("./createGroundPolylineGeometry.js"),"./createPlaneGeometry.js":()=>import("./createPlaneGeometry.js"),"./createPlaneOutlineGeometry.js":()=>import("./createPlaneOutlineGeometry.js"),"./createPolygonGeometry.js":()=>import("./createPolygonGeometry.js"),"./createPolygonOutlineGeometry.js":()=>import("./createPolygonOutlineGeometry.js"),"./createPolylineGeometry.js":()=>import("./createPolylineGeometry.js"),"./createPolylineVolumeGeometry.js":()=>import("./createPolylineVolumeGeometry.js"),"./createPolylineVolumeOutlineGeometry.js":()=>import("./createPolylineVolumeOutlineGeometry.js"),"./createRectangleGeometry.js":()=>import("./createRectangleGeometry.js"),"./createRectangleOutlineGeometry.js":()=>import("./createRectangleOutlineGeometry.js"),"./createSimplePolylineGeometry.js":()=>import("./createSimplePolylineGeometry.js"),"./createSphereGeometry.js":()=>import("./createSphereGeometry.js"),"./createSphereOutlineGeometry.js":()=>import("./createSphereOutlineGeometry.js"),"./createTaskProcessorWorker.js":()=>import("./createTaskProcessorWorker.js"),"./createVectorTileClampedPolylines.js":()=>import("./createVectorTileClampedPolylines.js"),"./createVectorTileGeometries.js":()=>import("./createVectorTileGeometries.js"),"./createVectorTilePoints.js":()=>import("./createVectorTilePoints.js"),"./createVectorTilePolygons.js":()=>import("./createVectorTilePolygons.js"),"./createVectorTilePolylines.js":()=>import("./createVectorTilePolylines.js"),"./createVerticesFromGoogleEarthEnterpriseBuffer.js":()=>import("./createVerticesFromGoogleEarthEnterpriseBuffer.js"),"./createVerticesFromHeightmap.js":()=>import("./createVerticesFromHeightmap.js"),"./createVerticesFromQuantizedTerrainMesh.js":()=>import("./createVerticesFromQuantizedTerrainMesh.js"),"./createWallGeometry.js":()=>import("./createWallGeometry.js"),"./createWallOutlineGeometry.js":()=>import("./createWallOutlineGeometry.js"),"./decodeDraco.js":()=>import("./decodeDraco.js"),"./decodeGoogleEarthEnterprisePacket.js":()=>import("./decodeGoogleEarthEnterprisePacket.js"),"./decodeI3S.js":()=>import("./decodeI3S.js"),"./transcodeKTX2.js":()=>import("./transcodeKTX2.js"),"./transferTypedArrayTest.js":()=>import("./transferTypedArrayTest.js"),"./upsampleQuantizedTerrainMesh.js":()=>import("./upsampleQuantizedTerrainMesh.js")});var f={};async function h(s,t){let e=k(f[t],f[s]);return r(e)?e:r(t)?(typeof exports=="object"?e=a(t):e=(await import(t)).default,f[t]=e,e):(typeof exports=="object"?e=a(`Workers/${s}`):e=(r(t)?await import(t):await b(`./${s}.js`)).default,f[s]=e,e)}async function x(s,t){let e=s.subTasks,n=e.length,u=new Array(n);for(let o=0;o<n;o++){let i=e[o],m=i.geometry,l=i.moduleName,c=i.modulePath;if(r(l)&&r(c))throw new y("Must only set moduleName or modulePath");r(l)||r(c)?u[o]=h(l,c).then(g=>g(m,i.offset)):u[o]=m}return Promise.all(u).then(function(o){return d.packCreateGeometryResults(o,t)})}var P=w(x);export{P as default}; diff --git a/public/js/Cesium2/Workers/createGroundPolylineGeometry.js b/public/js/Cesium2/Workers/createGroundPolylineGeometry.js index 076ce16a1..e3d88c394 100644 --- a/public/js/Cesium2/Workers/createGroundPolylineGeometry.js +++ b/public/js/Cesium2/Workers/createGroundPolylineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as _e}from"./chunk-UJMUN4NO.js";import{a as Z}from"./chunk-HQ4YU6WD.js";import{a as _t}from"./chunk-OZYLWM74.js";import{a as Oe}from"./chunk-E7HC3VTG.js";import{a as Le}from"./chunk-GJI4ZBKE.js";import{a as te}from"./chunk-RDAVO5OM.js";import{b as Qt}from"./chunk-PY4CW263.js";import{a as jt}from"./chunk-RRZIPF5C.js";import{c as Ce,d as zt}from"./chunk-LH3SUUXG.js";import{a as bt,d as G}from"./chunk-K2M3OJ7Z.js";import{d as xe,e as Ne,f as Kt,h as U}from"./chunk-M3A6SPGI.js";import{a as Bt}from"./chunk-D5HNP2LB.js";import{a as t,b as u,c as Pt,d as z,e as vt}from"./chunk-S4VBGY2U.js";import{a as p}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as O}from"./chunk-N3A5CZ2S.js";import{a as St,b as et}from"./chunk-G75U3WZT.js";import{e as g}from"./chunk-3THTQ4QB.js";function rt(e){e=O(e,O.EMPTY_OBJECT),this._ellipsoid=O(e.ellipsoid,z.default),this._rectangle=O(e.rectangle,U.MAX_VALUE),this._projection=new bt(this._ellipsoid),this._numberOfLevelZeroTilesX=O(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=O(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(rt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});rt.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};rt.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};rt.prototype.rectangleToNativeRectangle=function(e,i){et.defined("rectangle",e);let r=p.toDegrees(e.west),n=p.toDegrees(e.south),o=p.toDegrees(e.east),a=p.toDegrees(e.north);return g(i)?(i.west=r,i.south=n,i.east=o,i.north=a,i):new U(r,n,o,a)};rt.prototype.tileXYToNativeRectangle=function(e,i,r,n){let o=this.tileXYToRectangle(e,i,r,n);return o.west=p.toDegrees(o.west),o.south=p.toDegrees(o.south),o.east=p.toDegrees(o.east),o.north=p.toDegrees(o.north),o};rt.prototype.tileXYToRectangle=function(e,i,r,n){let o=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),c=this.getNumberOfYTilesAtLevel(r),l=o.width/a,s=e*l+o.west,d=(e+1)*l+o.west,h=o.height/c,N=o.north-i*h,S=o.north-(i+1)*h;return g(n)||(n=new U(s,S,d,N)),n.west=s,n.south=S,n.east=d,n.north=N,n};rt.prototype.positionToTileXY=function(e,i,r){let n=this._rectangle;if(!U.contains(n,e))return;let o=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),c=n.width/o,l=n.height/a,s=e.longitude;n.east<n.west&&(s+=p.TWO_PI);let d=(s-n.west)/c|0;d>=o&&(d=o-1);let h=(n.north-e.latitude)/l|0;return h>=a&&(h=a-1),g(r)?(r.x=d,r.y=h,r):new Pt(d,h)};var De=rt;var Ie=new t,He=new t,ke=new u,ee=new t,hn=new t,ye=new G,pn=new De,Lt=[new u,new u,new u,new u],Ot=new Pt,w={};w.initialize=function(){let e=w._initPromise;return g(e)||(e=xe.fetchJson(Ne("Assets/approximateTerrainHeights.json")).then(function(i){w._terrainHeights=i}),w._initPromise=e),e};w.getMinimumMaximumHeights=function(e,i){if(et.defined("rectangle",e),!g(w._terrainHeights))throw new St("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");i=O(i,z.default);let r=Ae(e),n=w._defaultMinTerrainHeight,o=w._defaultMaxTerrainHeight;if(g(r)){let a=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];g(c)&&(n=c[0],o=c[1]),i.cartographicToCartesian(U.northeast(e,ke),Ie),i.cartographicToCartesian(U.southwest(e,ke),He),t.midpoint(He,Ie,ee);let l=i.scaleToGeodeticSurface(ee,hn);if(g(l)){let s=t.distance(ee,l);n=Math.min(n,-s)}else n=w._defaultMinTerrainHeight}return n=Math.max(w._defaultMinTerrainHeight,n),{minimumTerrainHeight:n,maximumTerrainHeight:o}};w.getBoundingSphere=function(e,i){if(et.defined("rectangle",e),!g(w._terrainHeights))throw new St("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");i=O(i,z.default);let r=Ae(e),n=w._defaultMaxTerrainHeight;if(g(r)){let a=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];g(c)&&(n=c[1])}let o=G.fromRectangle3D(e,i,0);return G.fromRectangle3D(e,i,n,ye),G.union(o,ye,o)};function Ae(e){u.fromRadians(e.east,e.north,0,Lt[0]),u.fromRadians(e.west,e.north,0,Lt[1]),u.fromRadians(e.east,e.south,0,Lt[2]),u.fromRadians(e.west,e.south,0,Lt[3]);let i=0,r=0,n=0,o=0,a=w._terrainHeightsMaxLevel,c;for(c=0;c<=a;++c){let l=!1;for(let s=0;s<4;++s){let d=Lt[s];if(pn.positionToTileXY(d,c,Ot),s===0)n=Ot.x,o=Ot.y;else if(n!==Ot.x||o!==Ot.y){l=!0;break}}if(l)break;i=n,r=o}if(c!==0)return{x:i,y:r,level:c>a?a:c-1}}w._terrainHeightsMaxLevel=6;w._defaultMaxTerrainHeight=9e3;w._defaultMinTerrainHeight=-1e5;w._terrainHeights=void 0;w._initPromise=void 0;Object.defineProperties(w,{initialized:{get:function(){return g(w._terrainHeights)}}});var Xt=w;var le=[bt,_e],dn=le.length,Ke=Math.cos(p.toRadians(30)),Me=Math.cos(p.toRadians(150)),Qe=0,tn=1e3;function ct(e){e=O(e,O.EMPTY_OBJECT);let i=e.positions;if(!g(i)||i.length<2)throw new St("At least two positions are required.");if(g(e.arcType)&&e.arcType!==Z.GEODESIC&&e.arcType!==Z.RHUMB)throw new St("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=O(e.width,1),this._positions=i,this.granularity=O(e.granularity,9999),this.loop=O(e.loop,!1),this.arcType=O(e.arcType,Z.GEODESIC),this._ellipsoid=z.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ct.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+z.packedLength+1+1}}});ct.setProjectionAndEllipsoid=function(e,i){let r=0;for(let n=0;n<dn;n++)if(i instanceof le[n]){r=n;break}e._projectionIndex=r,e._ellipsoid=i.ellipsoid};var fn=new t,Re=new t,Pe=new t;function se(e,i,r,n,o){let a=P(n,e,0,fn),c=P(n,e,r,Re),l=P(n,i,0,Pe),s=nt(c,a,Re),d=nt(l,a,Pe);return t.cross(d,s,o),t.normalize(o,o)}var mn=new u,gn=new t,un=new t,wn=new t;function ne(e,i,r,n,o,a,c,l,s,d,h){if(o===0)return;let N;a===Z.GEODESIC?N=new Oe(e,i,c):a===Z.RHUMB&&(N=new te(e,i,c));let S=N.surfaceDistance;if(S<o)return;let R=se(e,i,n,c,wn),D=Math.ceil(S/o),I=S/D,j=I,q=D-1,f=l.length;for(let X=0;X<q;X++){let v=N.interpolateUsingSurfaceDistance(j,mn),y=P(c,v,r,gn),H=P(c,v,n,un);t.pack(R,l,f),t.pack(y,s,f),t.pack(H,d,f),h.push(v.latitude),h.push(v.longitude),f+=3,j+=I}}var oe=new u;function P(e,i,r,n){return u.clone(i,oe),oe.height=r,u.toCartesian(oe,e,n)}ct.pack=function(e,i,r){et.typeOf.object("value",e),et.defined("array",i);let n=O(r,0),o=e._positions,a=o.length;i[n++]=a;for(let c=0;c<a;++c){let l=o[c];t.pack(l,i,n),n+=3}return i[n++]=e.granularity,i[n++]=e.loop?1:0,i[n++]=e.arcType,z.pack(e._ellipsoid,i,n),n+=z.packedLength,i[n++]=e._projectionIndex,i[n++]=e._scene3DOnly?1:0,i};ct.unpack=function(e,i,r){et.defined("array",e);let n=O(i,0),o=e[n++],a=new Array(o);for(let S=0;S<o;S++)a[S]=t.unpack(e,n),n+=3;let c=e[n++],l=e[n++]===1,s=e[n++],d=z.unpack(e,n);n+=z.packedLength;let h=e[n++],N=e[n++]===1;return g(r)||(r=new ct({positions:a})),r._positions=a,r.granularity=c,r.loop=l,r.arcType=s,r._ellipsoid=d,r._projectionIndex=h,r._scene3DOnly=N,r};function nt(e,i,r){return t.subtract(e,i,r),t.normalize(r,r),r}function be(e,i,r,n){return n=nt(e,i,n),n=t.cross(n,r,n),n=t.normalize(n,n),n=t.cross(r,n,n),n}var Sn=new t,Tn=new t,En=new t,en=new t,xn=0,Nn=-1;function ie(e,i,r,n,o){let a=nt(r,i,en),c=be(e,i,a,Sn),l=be(n,i,a,Tn);if(p.equalsEpsilon(t.dot(c,l),Nn,p.EPSILON5))return o=t.cross(a,c,o),o=t.normalize(o,o),o;o=t.add(l,c,o),o=t.normalize(o,o);let s=t.cross(a,o,En);return t.dot(l,s)<xn&&(o=t.negate(o,o)),o}var Gt=jt.fromPointNormal(t.ZERO,t.UNIT_Y),Cn=new t,_n=new t,Ln=new t,On=new t,Dn=new t,Yt=new t,Ft=new u,ve=new u,Be=new u;ct.createGeometry=function(e){let i=!e._scene3DOnly,r=e.loop,n=e._ellipsoid,o=e.granularity,a=e.arcType,c=new le[e._projectionIndex](n),l=Qe,s=tn,d,h,N=e._positions,S=N.length;S===2&&(r=!1);let R,D,I,j,q=new te(void 0,void 0,n),f,X,v,y=[N[0]];for(h=0;h<S-1;h++)R=N[h],D=N[h+1],f=Qt.lineSegmentPlane(R,D,Gt,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&(e.arcType===Z.GEODESIC?y.push(t.clone(f)):e.arcType===Z.RHUMB&&(v=n.cartesianToCartographic(f,Ft).longitude,I=n.cartesianToCartographic(R,Ft),j=n.cartesianToCartographic(D,ve),q.setEndPoints(I,j),X=q.findIntersectionWithLongitude(v,Be),f=n.cartographicToCartesian(X,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&y.push(t.clone(f)))),y.push(D);r&&(R=N[S-1],D=N[0],f=Qt.lineSegmentPlane(R,D,Gt,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&(e.arcType===Z.GEODESIC?y.push(t.clone(f)):e.arcType===Z.RHUMB&&(v=n.cartesianToCartographic(f,Ft).longitude,I=n.cartesianToCartographic(R,Ft),j=n.cartesianToCartographic(D,ve),q.setEndPoints(I,j),X=q.findIntersectionWithLongitude(v,Be),f=n.cartographicToCartesian(X,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&y.push(t.clone(f)))));let H=y.length,C=new Array(H);for(h=0;h<H;h++){let F=u.fromCartesian(y[h],n);F.height=0,C[h]=F}if(C=Le(C,u.equalsEpsilon),H=C.length,H<2)return;let k=[],b=[],B=[],E=[],x=Cn,L=_n,_=Ln,Y=On,A=Dn,m=C[0],V=C[1],It=C[H-1];for(x=P(n,It,l,x),Y=P(n,V,l,Y),L=P(n,m,l,L),_=P(n,m,s,_),r?A=ie(x,L,_,Y,A):A=se(m,V,s,n,A),t.pack(A,b,0),t.pack(L,B,0),t.pack(_,E,0),k.push(m.latitude),k.push(m.longitude),ne(m,V,l,s,o,a,n,b,B,E,k),h=1;h<H-1;++h){x=t.clone(L,x),L=t.clone(Y,L);let F=C[h];P(n,F,s,_),P(n,C[h+1],l,Y),ie(x,L,_,Y,A),d=b.length,t.pack(A,b,d),t.pack(L,B,d),t.pack(_,E,d),k.push(F.latitude),k.push(F.longitude),ne(C[h],C[h+1],l,s,o,a,n,b,B,E,k)}let M=C[H-1],Tt=C[H-2];if(L=P(n,M,l,L),_=P(n,M,s,_),r){let F=C[0];x=P(n,Tt,l,x),Y=P(n,F,l,Y),A=ie(x,L,_,Y,A)}else A=se(Tt,M,s,n,A);if(d=b.length,t.pack(A,b,d),t.pack(L,B,d),t.pack(_,E,d),k.push(M.latitude),k.push(M.longitude),r){for(ne(M,m,l,s,o,a,n,b,B,E,k),d=b.length,h=0;h<3;++h)b[d+h]=b[h],B[d+h]=B[h],E[d+h]=E[h];k.push(m.latitude),k.push(m.longitude)}return Qn(r,c,B,E,b,k,i)};var In=new t,Hn=new vt,kn=new Kt;function ze(e,i,r,n){let o=nt(r,i,In),a=t.dot(o,e);if(a>Ke||a<Me){let c=nt(n,r,en),l=a<Me?p.PI_OVER_TWO:-p.PI_OVER_TWO,s=Kt.fromAxisAngle(c,l,kn),d=vt.fromQuaternion(s,Hn);return vt.multiplyByVector(d,e,e),!0}return!1}var je=new u,yn=new t,Xe=new t;function Dt(e,i,r,n,o){let a=u.toCartesian(i,e._ellipsoid,yn),c=t.add(a,r,Xe),l=!1,s=e._ellipsoid,d=s.cartesianToCartographic(c,je);Math.abs(i.longitude-d.longitude)>p.PI_OVER_TWO&&(l=!0,c=t.subtract(a,r,Xe),d=s.cartesianToCartographic(c,je)),d.height=0;let h=e.project(d,o);return o=t.subtract(h,n,o),o.z=0,o=t.normalize(o,o),l&&t.negate(o,o),o}var An=new t,Ye=new t;function Fe(e,i,r,n,o,a){let c=t.subtract(i,e,An);t.normalize(c,c);let l=r-Qe,s=t.multiplyByScalar(c,l,Ye);t.add(e,s,o);let d=n-tn;s=t.multiplyByScalar(c,d,Ye),t.add(i,s,a)}var Mn=new t;function Ut(e,i){let r=jt.getPointDistance(Gt,e),n=jt.getPointDistance(Gt,i),o=Mn;p.equalsEpsilon(r,0,p.EPSILON2)?(o=nt(i,e,o),t.multiplyByScalar(o,p.EPSILON2,o),t.add(e,o,e)):p.equalsEpsilon(n,0,p.EPSILON2)&&(o=nt(e,i,o),t.multiplyByScalar(o,p.EPSILON2,o),t.add(i,o,i))}function Rn(e,i){let r=Math.abs(e.longitude),n=Math.abs(i.longitude);if(p.equalsEpsilon(r,p.PI,p.EPSILON11)){let o=p.sign(i.longitude);return e.longitude=o*(r-p.EPSILON11),1}else if(p.equalsEpsilon(n,p.PI,p.EPSILON11)){let o=p.sign(e.longitude);return i.longitude=o*(n-p.EPSILON11),2}return 0}var nn=new u,on=new u,Ue=new t,re=new t,Ge=new t,qe=new t,Pn=new t,We=new t,bn=[nn,on],vn=new U,Bn=new t,zn=new t,jn=new t,Xn=new t,Yn=new t,Fn=new t,ae=new t,ce=new t,Un=new t,Gn=new t,qn=new t,Ze=new t,Wn=new t,Zn=new t,Vn=new _t,$n=new _t,Ve=new t,Jn=new t,$e=new t,Kn=[new G,new G],rn=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Je=rn.length;function Qn(e,i,r,n,o,a,c){let l,s,d=i._ellipsoid,h=r.length/3-1,N=h*8,S=N*4,R=h*36,D=N>65535?new Uint32Array(R):new Uint16Array(R),I=new Float64Array(N*3),j=new Float32Array(S),q=new Float32Array(S),f=new Float32Array(S),X=new Float32Array(S),v=new Float32Array(S),y,H,C,k;c&&(y=new Float32Array(S),H=new Float32Array(S),C=new Float32Array(S),k=new Float32Array(N*2));let b=a.length/2,B=0,E=nn;E.height=0;let x=on;x.height=0;let L=Ue,_=re;if(c)for(s=0,l=1;l<b;l++)E.latitude=a[s],E.longitude=a[s+1],x.latitude=a[s+2],x.longitude=a[s+3],L=i.project(E,L),_=i.project(x,_),B+=t.distance(L,_),s+=2;let Y=n.length/3;_=t.unpack(n,0,_);let A=0;for(s=3,l=1;l<Y;l++)L=t.clone(_,L),_=t.unpack(n,s,_),A+=t.distance(L,_),s+=3;let m;s=3;let V=0,It=0,M=0,Tt=0,F=!1,st=t.unpack(r,0,qe),lt=t.unpack(n,0,re),W=t.unpack(o,0,We);if(e){let ht=t.unpack(r,r.length-6,Ge);ze(W,ht,st,lt)&&(W=t.negate(W,W))}let pe=0,de=0,qt=0;for(l=0;l<h;l++){let ht=t.clone(st,Ge),Zt=t.clone(lt,Ue),mt=t.clone(W,Pn);F&&(mt=t.negate(mt,mt)),st=t.unpack(r,s,qe),lt=t.unpack(n,s,re),W=t.unpack(o,s,We),F=ze(W,ht,st,lt),E.latitude=a[V],E.longitude=a[V+1],x.latitude=a[V+2],x.longitude=a[V+3];let pt,gt,ot,it;if(c){let T=Rn(E,x);pt=i.project(E,Yn),gt=i.project(x,Fn);let wt=nt(gt,pt,Ve);wt.y=Math.abs(wt.y),ot=ae,it=ce,T===0||t.dot(wt,t.UNIT_Y)>Ke?(ot=Dt(i,E,mt,pt,ae),it=Dt(i,x,W,gt,ce)):T===1?(it=Dt(i,x,W,gt,ce),ot.x=0,ot.y=p.sign(E.longitude-Math.abs(x.longitude)),ot.z=0):(ot=Dt(i,E,mt,pt,ae),it.x=0,it.y=p.sign(E.longitude-x.longitude),it.z=0)}let ge=t.distance(Zt,lt),ue=_t.fromCartesian(ht,Vn),Ht=t.subtract(st,ht,Un),an=t.normalize(Ht,Ze),xt=t.subtract(Zt,ht,Gn);xt=t.normalize(xt,xt);let ut=t.cross(an,xt,Ze);ut=t.normalize(ut,ut);let kt=t.cross(xt,mt,Wn);kt=t.normalize(kt,kt);let yt=t.subtract(lt,st,qn);yt=t.normalize(yt,yt);let At=t.cross(W,yt,Zn);At=t.normalize(At,At);let cn=ge/A,sn=pe/A,Vt=0,Nt,Mt,dt,we=0,Se=0;if(c){Vt=t.distance(pt,gt),Nt=_t.fromCartesian(pt,$n),Mt=t.subtract(gt,pt,Ve),dt=t.normalize(Mt,Jn);let T=dt.x;dt.x=dt.y,dt.y=-T,we=Vt/B,Se=de/B}for(m=0;m<8;m++){let T=Tt+m*4,wt=It+m*2,Ct=T+3,Ee=m<4?1:-1,Rt=m===2||m===3||m===6||m===7?1:-1;t.pack(ue.high,j,T),j[Ct]=Ht.x,t.pack(ue.low,q,T),q[Ct]=Ht.y,t.pack(kt,f,T),f[Ct]=Ht.z,t.pack(At,X,T),X[Ct]=cn*Ee,t.pack(ut,v,T);let ft=sn*Rt;ft===0&&Rt<0&&(ft=9),v[Ct]=ft,c&&(y[T]=Nt.high.x,y[T+1]=Nt.high.y,y[T+2]=Nt.low.x,y[T+3]=Nt.low.y,C[T]=-ot.y,C[T+1]=ot.x,C[T+2]=it.y,C[T+3]=-it.x,H[T]=Mt.x,H[T+1]=Mt.y,H[T+2]=dt.x,H[T+3]=dt.y,k[wt]=we*Ee,ft=Se*Rt,ft===0&&Rt<0&&(ft=9),k[wt+1]=ft)}let $=jn,J=Xn,K=Bn,Q=zn,ln=U.fromCartographicArray(bn,vn),Te=Xt.getMinimumMaximumHeights(ln,d),$t=Te.minimumTerrainHeight,Jt=Te.maximumTerrainHeight;qt+=Math.abs($t),qt+=Math.abs(Jt),Fe(ht,Zt,$t,Jt,$,K),Fe(st,lt,$t,Jt,J,Q);let tt=t.multiplyByScalar(ut,p.EPSILON5,$e);t.add($,tt,$),t.add(J,tt,J),t.add(K,tt,K),t.add(Q,tt,Q),Ut($,J),Ut(K,Q),t.pack($,I,M),t.pack(J,I,M+3),t.pack(Q,I,M+6),t.pack(K,I,M+9),tt=t.multiplyByScalar(ut,-2*p.EPSILON5,$e),t.add($,tt,$),t.add(J,tt,J),t.add(K,tt,K),t.add(Q,tt,Q),Ut($,J),Ut(K,Q),t.pack($,I,M+12),t.pack(J,I,M+15),t.pack(Q,I,M+18),t.pack(K,I,M+21),V+=2,s+=3,It+=16,M+=24,Tt+=32,pe+=ge,de+=Vt}s=0;let fe=0;for(l=0;l<h;l++){for(m=0;m<Je;m++)D[s+m]=rn[m]+fe;fe+=8,s+=Je}let Wt=Kn;G.fromVertices(r,t.ZERO,3,Wt[0]),G.fromVertices(n,t.ZERO,3,Wt[1]);let me=G.fromBoundingSpheres(Wt);me.radius+=qt/(h*2);let Et={position:new zt({componentDatatype:Bt.DOUBLE,componentsPerAttribute:3,normalize:!1,values:I}),startHiAndForwardOffsetX:at(j),startLoAndForwardOffsetY:at(q),startNormalAndForwardOffsetZ:at(f),endNormalAndTextureCoordinateNormalizationX:at(X),rightNormalAndTextureCoordinateNormalizationY:at(v)};return c&&(Et.startHiLo2D=at(y),Et.offsetAndRight2D=at(H),Et.startEndNormals2D=at(C),Et.texcoordNormalization2D=new zt({componentDatatype:Bt.FLOAT,componentsPerAttribute:2,normalize:!1,values:k})),new Ce({attributes:Et,indices:D,boundingSphere:me})}function at(e){return new zt({componentDatatype:Bt.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}ct._projectNormal=Dt;var he=ct;function to(e,i){return Xt.initialize().then(function(){return g(i)&&(e=he.unpack(e,i)),he.createGeometry(e)})}var ti=to;export{ti as default}; +import{a as _e}from"./chunk-HMHR6SIB.js";import{a as Z}from"./chunk-GMMUK6QU.js";import{a as _t}from"./chunk-XCRMBS5M.js";import{a as Oe}from"./chunk-NHNM56MI.js";import{a as Le}from"./chunk-OKWGJEQO.js";import{a as te}from"./chunk-ZBEWS6NN.js";import{b as Qt}from"./chunk-V7XARCCV.js";import{a as jt}from"./chunk-SACP225T.js";import{c as Ce,d as zt}from"./chunk-NW2YE576.js";import{a as bt,d as G}from"./chunk-2NIQ5ECB.js";import{d as xe,e as Ne,f as Kt,h as U}from"./chunk-7YEOLR2L.js";import{a as Bt}from"./chunk-QHHYYTCM.js";import{a as t,b as u,c as Pt,d as z,e as vt}from"./chunk-RH3GFHG2.js";import{a as p}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as O}from"./chunk-TA3RE4KQ.js";import{a as St,b as et}from"./chunk-RTY3VPG6.js";import{e as g}from"./chunk-LRNH5AEO.js";function rt(e){e=O(e,O.EMPTY_OBJECT),this._ellipsoid=O(e.ellipsoid,z.default),this._rectangle=O(e.rectangle,U.MAX_VALUE),this._projection=new bt(this._ellipsoid),this._numberOfLevelZeroTilesX=O(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=O(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(rt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});rt.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};rt.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};rt.prototype.rectangleToNativeRectangle=function(e,i){et.defined("rectangle",e);let r=p.toDegrees(e.west),n=p.toDegrees(e.south),o=p.toDegrees(e.east),a=p.toDegrees(e.north);return g(i)?(i.west=r,i.south=n,i.east=o,i.north=a,i):new U(r,n,o,a)};rt.prototype.tileXYToNativeRectangle=function(e,i,r,n){let o=this.tileXYToRectangle(e,i,r,n);return o.west=p.toDegrees(o.west),o.south=p.toDegrees(o.south),o.east=p.toDegrees(o.east),o.north=p.toDegrees(o.north),o};rt.prototype.tileXYToRectangle=function(e,i,r,n){let o=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),c=this.getNumberOfYTilesAtLevel(r),l=o.width/a,s=e*l+o.west,d=(e+1)*l+o.west,h=o.height/c,N=o.north-i*h,S=o.north-(i+1)*h;return g(n)||(n=new U(s,S,d,N)),n.west=s,n.south=S,n.east=d,n.north=N,n};rt.prototype.positionToTileXY=function(e,i,r){let n=this._rectangle;if(!U.contains(n,e))return;let o=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),c=n.width/o,l=n.height/a,s=e.longitude;n.east<n.west&&(s+=p.TWO_PI);let d=(s-n.west)/c|0;d>=o&&(d=o-1);let h=(n.north-e.latitude)/l|0;return h>=a&&(h=a-1),g(r)?(r.x=d,r.y=h,r):new Pt(d,h)};var De=rt;var Ie=new t,He=new t,ke=new u,ee=new t,hn=new t,ye=new G,pn=new De,Lt=[new u,new u,new u,new u],Ot=new Pt,w={};w.initialize=function(){let e=w._initPromise;return g(e)||(e=xe.fetchJson(Ne("Assets/approximateTerrainHeights.json")).then(function(i){w._terrainHeights=i}),w._initPromise=e),e};w.getMinimumMaximumHeights=function(e,i){if(et.defined("rectangle",e),!g(w._terrainHeights))throw new St("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");i=O(i,z.default);let r=Ae(e),n=w._defaultMinTerrainHeight,o=w._defaultMaxTerrainHeight;if(g(r)){let a=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];g(c)&&(n=c[0],o=c[1]),i.cartographicToCartesian(U.northeast(e,ke),Ie),i.cartographicToCartesian(U.southwest(e,ke),He),t.midpoint(He,Ie,ee);let l=i.scaleToGeodeticSurface(ee,hn);if(g(l)){let s=t.distance(ee,l);n=Math.min(n,-s)}else n=w._defaultMinTerrainHeight}return n=Math.max(w._defaultMinTerrainHeight,n),{minimumTerrainHeight:n,maximumTerrainHeight:o}};w.getBoundingSphere=function(e,i){if(et.defined("rectangle",e),!g(w._terrainHeights))throw new St("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");i=O(i,z.default);let r=Ae(e),n=w._defaultMaxTerrainHeight;if(g(r)){let a=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];g(c)&&(n=c[1])}let o=G.fromRectangle3D(e,i,0);return G.fromRectangle3D(e,i,n,ye),G.union(o,ye,o)};function Ae(e){u.fromRadians(e.east,e.north,0,Lt[0]),u.fromRadians(e.west,e.north,0,Lt[1]),u.fromRadians(e.east,e.south,0,Lt[2]),u.fromRadians(e.west,e.south,0,Lt[3]);let i=0,r=0,n=0,o=0,a=w._terrainHeightsMaxLevel,c;for(c=0;c<=a;++c){let l=!1;for(let s=0;s<4;++s){let d=Lt[s];if(pn.positionToTileXY(d,c,Ot),s===0)n=Ot.x,o=Ot.y;else if(n!==Ot.x||o!==Ot.y){l=!0;break}}if(l)break;i=n,r=o}if(c!==0)return{x:i,y:r,level:c>a?a:c-1}}w._terrainHeightsMaxLevel=6;w._defaultMaxTerrainHeight=9e3;w._defaultMinTerrainHeight=-1e5;w._terrainHeights=void 0;w._initPromise=void 0;Object.defineProperties(w,{initialized:{get:function(){return g(w._terrainHeights)}}});var Xt=w;var le=[bt,_e],dn=le.length,Ke=Math.cos(p.toRadians(30)),Me=Math.cos(p.toRadians(150)),Qe=0,tn=1e3;function ct(e){e=O(e,O.EMPTY_OBJECT);let i=e.positions;if(!g(i)||i.length<2)throw new St("At least two positions are required.");if(g(e.arcType)&&e.arcType!==Z.GEODESIC&&e.arcType!==Z.RHUMB)throw new St("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=O(e.width,1),this._positions=i,this.granularity=O(e.granularity,9999),this.loop=O(e.loop,!1),this.arcType=O(e.arcType,Z.GEODESIC),this._ellipsoid=z.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ct.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+z.packedLength+1+1}}});ct.setProjectionAndEllipsoid=function(e,i){let r=0;for(let n=0;n<dn;n++)if(i instanceof le[n]){r=n;break}e._projectionIndex=r,e._ellipsoid=i.ellipsoid};var fn=new t,Re=new t,Pe=new t;function se(e,i,r,n,o){let a=P(n,e,0,fn),c=P(n,e,r,Re),l=P(n,i,0,Pe),s=nt(c,a,Re),d=nt(l,a,Pe);return t.cross(d,s,o),t.normalize(o,o)}var mn=new u,gn=new t,un=new t,wn=new t;function ne(e,i,r,n,o,a,c,l,s,d,h){if(o===0)return;let N;a===Z.GEODESIC?N=new Oe(e,i,c):a===Z.RHUMB&&(N=new te(e,i,c));let S=N.surfaceDistance;if(S<o)return;let R=se(e,i,n,c,wn),D=Math.ceil(S/o),I=S/D,j=I,q=D-1,f=l.length;for(let X=0;X<q;X++){let v=N.interpolateUsingSurfaceDistance(j,mn),y=P(c,v,r,gn),H=P(c,v,n,un);t.pack(R,l,f),t.pack(y,s,f),t.pack(H,d,f),h.push(v.latitude),h.push(v.longitude),f+=3,j+=I}}var oe=new u;function P(e,i,r,n){return u.clone(i,oe),oe.height=r,u.toCartesian(oe,e,n)}ct.pack=function(e,i,r){et.typeOf.object("value",e),et.defined("array",i);let n=O(r,0),o=e._positions,a=o.length;i[n++]=a;for(let c=0;c<a;++c){let l=o[c];t.pack(l,i,n),n+=3}return i[n++]=e.granularity,i[n++]=e.loop?1:0,i[n++]=e.arcType,z.pack(e._ellipsoid,i,n),n+=z.packedLength,i[n++]=e._projectionIndex,i[n++]=e._scene3DOnly?1:0,i};ct.unpack=function(e,i,r){et.defined("array",e);let n=O(i,0),o=e[n++],a=new Array(o);for(let S=0;S<o;S++)a[S]=t.unpack(e,n),n+=3;let c=e[n++],l=e[n++]===1,s=e[n++],d=z.unpack(e,n);n+=z.packedLength;let h=e[n++],N=e[n++]===1;return g(r)||(r=new ct({positions:a})),r._positions=a,r.granularity=c,r.loop=l,r.arcType=s,r._ellipsoid=d,r._projectionIndex=h,r._scene3DOnly=N,r};function nt(e,i,r){return t.subtract(e,i,r),t.normalize(r,r),r}function be(e,i,r,n){return n=nt(e,i,n),n=t.cross(n,r,n),n=t.normalize(n,n),n=t.cross(r,n,n),n}var Sn=new t,Tn=new t,En=new t,en=new t,xn=0,Nn=-1;function ie(e,i,r,n,o){let a=nt(r,i,en),c=be(e,i,a,Sn),l=be(n,i,a,Tn);if(p.equalsEpsilon(t.dot(c,l),Nn,p.EPSILON5))return o=t.cross(a,c,o),o=t.normalize(o,o),o;o=t.add(l,c,o),o=t.normalize(o,o);let s=t.cross(a,o,En);return t.dot(l,s)<xn&&(o=t.negate(o,o)),o}var Gt=jt.fromPointNormal(t.ZERO,t.UNIT_Y),Cn=new t,_n=new t,Ln=new t,On=new t,Dn=new t,Yt=new t,Ft=new u,ve=new u,Be=new u;ct.createGeometry=function(e){let i=!e._scene3DOnly,r=e.loop,n=e._ellipsoid,o=e.granularity,a=e.arcType,c=new le[e._projectionIndex](n),l=Qe,s=tn,d,h,N=e._positions,S=N.length;S===2&&(r=!1);let R,D,I,j,q=new te(void 0,void 0,n),f,X,v,y=[N[0]];for(h=0;h<S-1;h++)R=N[h],D=N[h+1],f=Qt.lineSegmentPlane(R,D,Gt,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&(e.arcType===Z.GEODESIC?y.push(t.clone(f)):e.arcType===Z.RHUMB&&(v=n.cartesianToCartographic(f,Ft).longitude,I=n.cartesianToCartographic(R,Ft),j=n.cartesianToCartographic(D,ve),q.setEndPoints(I,j),X=q.findIntersectionWithLongitude(v,Be),f=n.cartographicToCartesian(X,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&y.push(t.clone(f)))),y.push(D);r&&(R=N[S-1],D=N[0],f=Qt.lineSegmentPlane(R,D,Gt,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&(e.arcType===Z.GEODESIC?y.push(t.clone(f)):e.arcType===Z.RHUMB&&(v=n.cartesianToCartographic(f,Ft).longitude,I=n.cartesianToCartographic(R,Ft),j=n.cartesianToCartographic(D,ve),q.setEndPoints(I,j),X=q.findIntersectionWithLongitude(v,Be),f=n.cartographicToCartesian(X,Yt),g(f)&&!t.equalsEpsilon(f,R,p.EPSILON7)&&!t.equalsEpsilon(f,D,p.EPSILON7)&&y.push(t.clone(f)))));let H=y.length,C=new Array(H);for(h=0;h<H;h++){let F=u.fromCartesian(y[h],n);F.height=0,C[h]=F}if(C=Le(C,u.equalsEpsilon),H=C.length,H<2)return;let k=[],b=[],B=[],E=[],x=Cn,L=_n,_=Ln,Y=On,A=Dn,m=C[0],V=C[1],It=C[H-1];for(x=P(n,It,l,x),Y=P(n,V,l,Y),L=P(n,m,l,L),_=P(n,m,s,_),r?A=ie(x,L,_,Y,A):A=se(m,V,s,n,A),t.pack(A,b,0),t.pack(L,B,0),t.pack(_,E,0),k.push(m.latitude),k.push(m.longitude),ne(m,V,l,s,o,a,n,b,B,E,k),h=1;h<H-1;++h){x=t.clone(L,x),L=t.clone(Y,L);let F=C[h];P(n,F,s,_),P(n,C[h+1],l,Y),ie(x,L,_,Y,A),d=b.length,t.pack(A,b,d),t.pack(L,B,d),t.pack(_,E,d),k.push(F.latitude),k.push(F.longitude),ne(C[h],C[h+1],l,s,o,a,n,b,B,E,k)}let M=C[H-1],Tt=C[H-2];if(L=P(n,M,l,L),_=P(n,M,s,_),r){let F=C[0];x=P(n,Tt,l,x),Y=P(n,F,l,Y),A=ie(x,L,_,Y,A)}else A=se(Tt,M,s,n,A);if(d=b.length,t.pack(A,b,d),t.pack(L,B,d),t.pack(_,E,d),k.push(M.latitude),k.push(M.longitude),r){for(ne(M,m,l,s,o,a,n,b,B,E,k),d=b.length,h=0;h<3;++h)b[d+h]=b[h],B[d+h]=B[h],E[d+h]=E[h];k.push(m.latitude),k.push(m.longitude)}return Qn(r,c,B,E,b,k,i)};var In=new t,Hn=new vt,kn=new Kt;function ze(e,i,r,n){let o=nt(r,i,In),a=t.dot(o,e);if(a>Ke||a<Me){let c=nt(n,r,en),l=a<Me?p.PI_OVER_TWO:-p.PI_OVER_TWO,s=Kt.fromAxisAngle(c,l,kn),d=vt.fromQuaternion(s,Hn);return vt.multiplyByVector(d,e,e),!0}return!1}var je=new u,yn=new t,Xe=new t;function Dt(e,i,r,n,o){let a=u.toCartesian(i,e._ellipsoid,yn),c=t.add(a,r,Xe),l=!1,s=e._ellipsoid,d=s.cartesianToCartographic(c,je);Math.abs(i.longitude-d.longitude)>p.PI_OVER_TWO&&(l=!0,c=t.subtract(a,r,Xe),d=s.cartesianToCartographic(c,je)),d.height=0;let h=e.project(d,o);return o=t.subtract(h,n,o),o.z=0,o=t.normalize(o,o),l&&t.negate(o,o),o}var An=new t,Ye=new t;function Fe(e,i,r,n,o,a){let c=t.subtract(i,e,An);t.normalize(c,c);let l=r-Qe,s=t.multiplyByScalar(c,l,Ye);t.add(e,s,o);let d=n-tn;s=t.multiplyByScalar(c,d,Ye),t.add(i,s,a)}var Mn=new t;function Ut(e,i){let r=jt.getPointDistance(Gt,e),n=jt.getPointDistance(Gt,i),o=Mn;p.equalsEpsilon(r,0,p.EPSILON2)?(o=nt(i,e,o),t.multiplyByScalar(o,p.EPSILON2,o),t.add(e,o,e)):p.equalsEpsilon(n,0,p.EPSILON2)&&(o=nt(e,i,o),t.multiplyByScalar(o,p.EPSILON2,o),t.add(i,o,i))}function Rn(e,i){let r=Math.abs(e.longitude),n=Math.abs(i.longitude);if(p.equalsEpsilon(r,p.PI,p.EPSILON11)){let o=p.sign(i.longitude);return e.longitude=o*(r-p.EPSILON11),1}else if(p.equalsEpsilon(n,p.PI,p.EPSILON11)){let o=p.sign(e.longitude);return i.longitude=o*(n-p.EPSILON11),2}return 0}var nn=new u,on=new u,Ue=new t,re=new t,Ge=new t,qe=new t,Pn=new t,We=new t,bn=[nn,on],vn=new U,Bn=new t,zn=new t,jn=new t,Xn=new t,Yn=new t,Fn=new t,ae=new t,ce=new t,Un=new t,Gn=new t,qn=new t,Ze=new t,Wn=new t,Zn=new t,Vn=new _t,$n=new _t,Ve=new t,Jn=new t,$e=new t,Kn=[new G,new G],rn=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Je=rn.length;function Qn(e,i,r,n,o,a,c){let l,s,d=i._ellipsoid,h=r.length/3-1,N=h*8,S=N*4,R=h*36,D=N>65535?new Uint32Array(R):new Uint16Array(R),I=new Float64Array(N*3),j=new Float32Array(S),q=new Float32Array(S),f=new Float32Array(S),X=new Float32Array(S),v=new Float32Array(S),y,H,C,k;c&&(y=new Float32Array(S),H=new Float32Array(S),C=new Float32Array(S),k=new Float32Array(N*2));let b=a.length/2,B=0,E=nn;E.height=0;let x=on;x.height=0;let L=Ue,_=re;if(c)for(s=0,l=1;l<b;l++)E.latitude=a[s],E.longitude=a[s+1],x.latitude=a[s+2],x.longitude=a[s+3],L=i.project(E,L),_=i.project(x,_),B+=t.distance(L,_),s+=2;let Y=n.length/3;_=t.unpack(n,0,_);let A=0;for(s=3,l=1;l<Y;l++)L=t.clone(_,L),_=t.unpack(n,s,_),A+=t.distance(L,_),s+=3;let m;s=3;let V=0,It=0,M=0,Tt=0,F=!1,st=t.unpack(r,0,qe),lt=t.unpack(n,0,re),W=t.unpack(o,0,We);if(e){let ht=t.unpack(r,r.length-6,Ge);ze(W,ht,st,lt)&&(W=t.negate(W,W))}let pe=0,de=0,qt=0;for(l=0;l<h;l++){let ht=t.clone(st,Ge),Zt=t.clone(lt,Ue),mt=t.clone(W,Pn);F&&(mt=t.negate(mt,mt)),st=t.unpack(r,s,qe),lt=t.unpack(n,s,re),W=t.unpack(o,s,We),F=ze(W,ht,st,lt),E.latitude=a[V],E.longitude=a[V+1],x.latitude=a[V+2],x.longitude=a[V+3];let pt,gt,ot,it;if(c){let T=Rn(E,x);pt=i.project(E,Yn),gt=i.project(x,Fn);let wt=nt(gt,pt,Ve);wt.y=Math.abs(wt.y),ot=ae,it=ce,T===0||t.dot(wt,t.UNIT_Y)>Ke?(ot=Dt(i,E,mt,pt,ae),it=Dt(i,x,W,gt,ce)):T===1?(it=Dt(i,x,W,gt,ce),ot.x=0,ot.y=p.sign(E.longitude-Math.abs(x.longitude)),ot.z=0):(ot=Dt(i,E,mt,pt,ae),it.x=0,it.y=p.sign(E.longitude-x.longitude),it.z=0)}let ge=t.distance(Zt,lt),ue=_t.fromCartesian(ht,Vn),Ht=t.subtract(st,ht,Un),an=t.normalize(Ht,Ze),xt=t.subtract(Zt,ht,Gn);xt=t.normalize(xt,xt);let ut=t.cross(an,xt,Ze);ut=t.normalize(ut,ut);let kt=t.cross(xt,mt,Wn);kt=t.normalize(kt,kt);let yt=t.subtract(lt,st,qn);yt=t.normalize(yt,yt);let At=t.cross(W,yt,Zn);At=t.normalize(At,At);let cn=ge/A,sn=pe/A,Vt=0,Nt,Mt,dt,we=0,Se=0;if(c){Vt=t.distance(pt,gt),Nt=_t.fromCartesian(pt,$n),Mt=t.subtract(gt,pt,Ve),dt=t.normalize(Mt,Jn);let T=dt.x;dt.x=dt.y,dt.y=-T,we=Vt/B,Se=de/B}for(m=0;m<8;m++){let T=Tt+m*4,wt=It+m*2,Ct=T+3,Ee=m<4?1:-1,Rt=m===2||m===3||m===6||m===7?1:-1;t.pack(ue.high,j,T),j[Ct]=Ht.x,t.pack(ue.low,q,T),q[Ct]=Ht.y,t.pack(kt,f,T),f[Ct]=Ht.z,t.pack(At,X,T),X[Ct]=cn*Ee,t.pack(ut,v,T);let ft=sn*Rt;ft===0&&Rt<0&&(ft=9),v[Ct]=ft,c&&(y[T]=Nt.high.x,y[T+1]=Nt.high.y,y[T+2]=Nt.low.x,y[T+3]=Nt.low.y,C[T]=-ot.y,C[T+1]=ot.x,C[T+2]=it.y,C[T+3]=-it.x,H[T]=Mt.x,H[T+1]=Mt.y,H[T+2]=dt.x,H[T+3]=dt.y,k[wt]=we*Ee,ft=Se*Rt,ft===0&&Rt<0&&(ft=9),k[wt+1]=ft)}let $=jn,J=Xn,K=Bn,Q=zn,ln=U.fromCartographicArray(bn,vn),Te=Xt.getMinimumMaximumHeights(ln,d),$t=Te.minimumTerrainHeight,Jt=Te.maximumTerrainHeight;qt+=Math.abs($t),qt+=Math.abs(Jt),Fe(ht,Zt,$t,Jt,$,K),Fe(st,lt,$t,Jt,J,Q);let tt=t.multiplyByScalar(ut,p.EPSILON5,$e);t.add($,tt,$),t.add(J,tt,J),t.add(K,tt,K),t.add(Q,tt,Q),Ut($,J),Ut(K,Q),t.pack($,I,M),t.pack(J,I,M+3),t.pack(Q,I,M+6),t.pack(K,I,M+9),tt=t.multiplyByScalar(ut,-2*p.EPSILON5,$e),t.add($,tt,$),t.add(J,tt,J),t.add(K,tt,K),t.add(Q,tt,Q),Ut($,J),Ut(K,Q),t.pack($,I,M+12),t.pack(J,I,M+15),t.pack(Q,I,M+18),t.pack(K,I,M+21),V+=2,s+=3,It+=16,M+=24,Tt+=32,pe+=ge,de+=Vt}s=0;let fe=0;for(l=0;l<h;l++){for(m=0;m<Je;m++)D[s+m]=rn[m]+fe;fe+=8,s+=Je}let Wt=Kn;G.fromVertices(r,t.ZERO,3,Wt[0]),G.fromVertices(n,t.ZERO,3,Wt[1]);let me=G.fromBoundingSpheres(Wt);me.radius+=qt/(h*2);let Et={position:new zt({componentDatatype:Bt.DOUBLE,componentsPerAttribute:3,normalize:!1,values:I}),startHiAndForwardOffsetX:at(j),startLoAndForwardOffsetY:at(q),startNormalAndForwardOffsetZ:at(f),endNormalAndTextureCoordinateNormalizationX:at(X),rightNormalAndTextureCoordinateNormalizationY:at(v)};return c&&(Et.startHiLo2D=at(y),Et.offsetAndRight2D=at(H),Et.startEndNormals2D=at(C),Et.texcoordNormalization2D=new zt({componentDatatype:Bt.FLOAT,componentsPerAttribute:2,normalize:!1,values:k})),new Ce({attributes:Et,indices:D,boundingSphere:me})}function at(e){return new zt({componentDatatype:Bt.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}ct._projectNormal=Dt;var he=ct;function to(e,i){return Xt.initialize().then(function(){return g(i)&&(e=he.unpack(e,i)),he.createGeometry(e)})}var ti=to;export{ti as default}; diff --git a/public/js/Cesium2/Workers/createPlaneGeometry.js b/public/js/Cesium2/Workers/createPlaneGeometry.js index 286524f0c..a6a5907a6 100644 --- a/public/js/Cesium2/Workers/createPlaneGeometry.js +++ b/public/js/Cesium2/Workers/createPlaneGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as m}from"./chunk-6HIVPZ7K.js";import{a as b}from"./chunk-24JYWT5N.js";import{b as v,c as x,d as p}from"./chunk-LH3SUUXG.js";import{d as A}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as c}from"./chunk-D5HNP2LB.js";import{a as y}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as i}from"./chunk-N3A5CZ2S.js";import{b as u}from"./chunk-G75U3WZT.js";import{e as f}from"./chunk-3THTQ4QB.js";function s(r){r=i(r,i.EMPTY_OBJECT);let e=i(r.vertexFormat,m.DEFAULT);this._vertexFormat=e,this._workerName="createPlaneGeometry"}s.packedLength=m.packedLength;s.pack=function(r,e,o){return u.typeOf.object("value",r),u.defined("array",e),o=i(o,0),m.pack(r._vertexFormat,e,o),e};var d=new m,P={vertexFormat:d};s.unpack=function(r,e,o){u.defined("array",r),e=i(e,0);let a=m.unpack(r,e,d);return f(o)?(o._vertexFormat=m.clone(a,o._vertexFormat),o):new s(P)};var F=new y(-.5,-.5,0),l=new y(.5,.5,0);s.createGeometry=function(r){let e=r._vertexFormat,o=new b,a,n;if(e.position){if(n=new Float64Array(4*3),n[0]=F.x,n[1]=F.y,n[2]=0,n[3]=l.x,n[4]=F.y,n[5]=0,n[6]=l.x,n[7]=l.y,n[8]=0,n[9]=F.x,n[10]=l.y,n[11]=0,o.position=new p({componentDatatype:c.DOUBLE,componentsPerAttribute:3,values:n}),e.normal){let t=new Float32Array(12);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,o.normal=new p({componentDatatype:c.FLOAT,componentsPerAttribute:3,values:t})}if(e.st){let t=new Float32Array(8);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,o.st=new p({componentDatatype:c.FLOAT,componentsPerAttribute:2,values:t})}if(e.tangent){let t=new Float32Array(12);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,o.tangent=new p({componentDatatype:c.FLOAT,componentsPerAttribute:3,values:t})}if(e.bitangent){let t=new Float32Array(12);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,o.bitangent=new p({componentDatatype:c.FLOAT,componentsPerAttribute:3,values:t})}a=new Uint16Array(2*3),a[0]=0,a[1]=1,a[2]=2,a[3]=0,a[4]=2,a[5]=3}return new x({attributes:o,indices:a,primitiveType:v.TRIANGLES,boundingSphere:new A(y.ZERO,Math.sqrt(2))})};var w=s;function h(r,e){return f(e)&&(r=w.unpack(r,e)),w.createGeometry(r)}var M=h;export{M as default}; +import{a as m}from"./chunk-6VK5R74O.js";import{a as b}from"./chunk-NT26NNVH.js";import{b as v,c as x,d as p}from"./chunk-NW2YE576.js";import{d as A}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as c}from"./chunk-QHHYYTCM.js";import{a as y}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as i}from"./chunk-TA3RE4KQ.js";import{b as u}from"./chunk-RTY3VPG6.js";import{e as f}from"./chunk-LRNH5AEO.js";function s(r){r=i(r,i.EMPTY_OBJECT);let e=i(r.vertexFormat,m.DEFAULT);this._vertexFormat=e,this._workerName="createPlaneGeometry"}s.packedLength=m.packedLength;s.pack=function(r,e,o){return u.typeOf.object("value",r),u.defined("array",e),o=i(o,0),m.pack(r._vertexFormat,e,o),e};var d=new m,P={vertexFormat:d};s.unpack=function(r,e,o){u.defined("array",r),e=i(e,0);let a=m.unpack(r,e,d);return f(o)?(o._vertexFormat=m.clone(a,o._vertexFormat),o):new s(P)};var F=new y(-.5,-.5,0),l=new y(.5,.5,0);s.createGeometry=function(r){let e=r._vertexFormat,o=new b,a,n;if(e.position){if(n=new Float64Array(4*3),n[0]=F.x,n[1]=F.y,n[2]=0,n[3]=l.x,n[4]=F.y,n[5]=0,n[6]=l.x,n[7]=l.y,n[8]=0,n[9]=F.x,n[10]=l.y,n[11]=0,o.position=new p({componentDatatype:c.DOUBLE,componentsPerAttribute:3,values:n}),e.normal){let t=new Float32Array(12);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,o.normal=new p({componentDatatype:c.FLOAT,componentsPerAttribute:3,values:t})}if(e.st){let t=new Float32Array(8);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,o.st=new p({componentDatatype:c.FLOAT,componentsPerAttribute:2,values:t})}if(e.tangent){let t=new Float32Array(12);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,o.tangent=new p({componentDatatype:c.FLOAT,componentsPerAttribute:3,values:t})}if(e.bitangent){let t=new Float32Array(12);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,o.bitangent=new p({componentDatatype:c.FLOAT,componentsPerAttribute:3,values:t})}a=new Uint16Array(2*3),a[0]=0,a[1]=1,a[2]=2,a[3]=0,a[4]=2,a[5]=3}return new x({attributes:o,indices:a,primitiveType:v.TRIANGLES,boundingSphere:new A(y.ZERO,Math.sqrt(2))})};var w=s;function h(r,e){return f(e)&&(r=w.unpack(r,e)),w.createGeometry(r)}var M=h;export{M as default}; diff --git a/public/js/Cesium2/Workers/createPlaneOutlineGeometry.js b/public/js/Cesium2/Workers/createPlaneOutlineGeometry.js index 0d480cabd..df7b74852 100644 --- a/public/js/Cesium2/Workers/createPlaneOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createPlaneOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as l}from"./chunk-24JYWT5N.js";import{b as d,c as y,d as s}from"./chunk-LH3SUUXG.js";import{d as c}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as f}from"./chunk-D5HNP2LB.js";import{a}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import{b as m}from"./chunk-G75U3WZT.js";import{e as i}from"./chunk-3THTQ4QB.js";function o(){this._workerName="createPlaneOutlineGeometry"}o.packedLength=0;o.pack=function(r,e){return m.defined("value",r),m.defined("array",e),e};o.unpack=function(r,e,t){return m.defined("array",r),i(t)?t:new o};var n=new a(-.5,-.5,0),p=new a(.5,.5,0);o.createGeometry=function(){let r=new l,e=new Uint16Array(4*2),t=new Float64Array(4*3);return t[0]=n.x,t[1]=n.y,t[2]=n.z,t[3]=p.x,t[4]=n.y,t[5]=n.z,t[6]=p.x,t[7]=p.y,t[8]=n.z,t[9]=n.x,t[10]=p.y,t[11]=n.z,r.position=new s({componentDatatype:f.DOUBLE,componentsPerAttribute:3,values:t}),e[0]=0,e[1]=1,e[2]=1,e[3]=2,e[4]=2,e[5]=3,e[6]=3,e[7]=0,new y({attributes:r,indices:e,primitiveType:d.LINES,boundingSphere:new c(a.ZERO,Math.sqrt(2))})};var u=o;function w(r,e){return i(e)&&(r=u.unpack(r,e)),u.createGeometry(r)}var D=w;export{D as default}; +import{a as l}from"./chunk-NT26NNVH.js";import{b as d,c as y,d as s}from"./chunk-NW2YE576.js";import{d as c}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as f}from"./chunk-QHHYYTCM.js";import{a}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import{b as m}from"./chunk-RTY3VPG6.js";import{e as i}from"./chunk-LRNH5AEO.js";function o(){this._workerName="createPlaneOutlineGeometry"}o.packedLength=0;o.pack=function(r,e){return m.defined("value",r),m.defined("array",e),e};o.unpack=function(r,e,t){return m.defined("array",r),i(t)?t:new o};var n=new a(-.5,-.5,0),p=new a(.5,.5,0);o.createGeometry=function(){let r=new l,e=new Uint16Array(4*2),t=new Float64Array(4*3);return t[0]=n.x,t[1]=n.y,t[2]=n.z,t[3]=p.x,t[4]=n.y,t[5]=n.z,t[6]=p.x,t[7]=p.y,t[8]=n.z,t[9]=n.x,t[10]=p.y,t[11]=n.z,r.position=new s({componentDatatype:f.DOUBLE,componentsPerAttribute:3,values:t}),e[0]=0,e[1]=1,e[2]=1,e[3]=2,e[4]=2,e[5]=3,e[6]=3,e[7]=0,new y({attributes:r,indices:e,primitiveType:d.LINES,boundingSphere:new c(a.ZERO,Math.sqrt(2))})};var u=o;function w(r,e){return i(e)&&(r=u.unpack(r,e)),u.createGeometry(r)}var D=w;export{D as default}; diff --git a/public/js/Cesium2/Workers/createPolygonGeometry.js b/public/js/Cesium2/Workers/createPolygonGeometry.js index 5344c21be..23a83f927 100644 --- a/public/js/Cesium2/Workers/createPolygonGeometry.js +++ b/public/js/Cesium2/Workers/createPolygonGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as dt}from"./chunk-PJUDOIE3.js";import{a as F}from"./chunk-HTYD62GU.js";import{a as at}from"./chunk-HQ4YU6WD.js";import{a as st}from"./chunk-W5MIOKEY.js";import{a as bt}from"./chunk-72CGGEJF.js";import"./chunk-Q5MYX5A2.js";import"./chunk-OZYLWM74.js";import{a as ht}from"./chunk-5CC3QRYS.js";import{a as Q}from"./chunk-6HIVPZ7K.js";import{a as K}from"./chunk-CTRWX4F5.js";import"./chunk-Z7BLUZ7R.js";import{a as gt,b as nt}from"./chunk-WJYW7YDO.js";import"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import{a as wt,b as yt}from"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as lt}from"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import{c as mt,d as tt}from"./chunk-LH3SUUXG.js";import{d as Tt}from"./chunk-K2M3OJ7Z.js";import{f as ct,h as _t}from"./chunk-M3A6SPGI.js";import{a as $}from"./chunk-D5HNP2LB.js";import{a as c,b as ot,c as O,d as V,e as U}from"./chunk-S4VBGY2U.js";import{a as l}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as L}from"./chunk-N3A5CZ2S.js";import{a as ut,b as q}from"./chunk-G75U3WZT.js";import{e as P}from"./chunk-3THTQ4QB.js";function b(t,e){this.position=t,P(this.position)||(this.position=new O),this.tangentPlane=e,P(this.tangentPlane)||(this.tangentPlane=b.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(b.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let t=O.magnitude(this.position),e=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(l.PI_OVER_TWO-2*Math.atan2(t,e))}},longitude:{get:function(){let t=l.PI_OVER_TWO+Math.atan2(this.y,this.x);return t>Math.PI&&(t-=l.TWO_PI),t}}});var it=new ot,Rt=new c;b.prototype.getLatitude=function(t){P(t)||(t=V.default),it.latitude=this.conformalLatitude,it.longitude=this.longitude,it.height=0;let e=this.ellipsoid.cartographicToCartesian(it,Rt);return t.cartesianToCartographic(e,it),it.latitude};var It=new wt,Lt=new c,Ft=new c;b.fromCartesian=function(t,e){q.defined("cartesian",t);let o=l.signNotZero(t.z),n=b.NORTH_POLE_TANGENT_PLANE,s=b.SOUTH_POLE;o<0&&(n=b.SOUTH_POLE_TANGENT_PLANE,s=b.NORTH_POLE);let i=It;i.origin=n.ellipsoid.scaleToGeocentricSurface(t,i.origin),i.direction=c.subtract(i.origin,s,Lt),c.normalize(i.direction,i.direction);let r=yt.rayPlane(i,n.plane,Ft),f=c.subtract(r,s,r),d=c.dot(n.xAxis,f),p=o*c.dot(n.yAxis,f);return P(e)?(e.position=new O(d,p),e.tangentPlane=n,e):new b(new O(d,p),n)};b.fromCartesianArray=function(t,e){q.defined("cartesians",t);let o=t.length;P(e)?e.length=o:e=new Array(o);for(let n=0;n<o;n++)e[n]=b.fromCartesian(t[n],e[n]);return e};b.clone=function(t,e){if(P(t))return P(e)?(e.position=t.position,e.tangentPlane=t.tangentPlane,e):new b(t.position,t.tangentPlane)};b.HALF_UNIT_SPHERE=Object.freeze(new V(.5,.5,.5));b.NORTH_POLE=Object.freeze(new c(0,0,.5));b.SOUTH_POLE=Object.freeze(new c(0,0,-.5));b.NORTH_POLE_TANGENT_PLANE=Object.freeze(new K(b.NORTH_POLE,b.HALF_UNIT_SPHERE));b.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new K(b.SOUTH_POLE,b.HALF_UNIT_SPHERE));var D=b;var vt=new ot,Ot=new ot;function St(t,e,o,n){let i=n.cartesianToCartographic(t,vt).height,r=n.cartesianToCartographic(e,Ot);r.height=i,n.cartographicToCartesian(r,e);let f=n.cartesianToCartographic(o,Ot);f.height=i-100,n.cartographicToCartesian(f,o)}var Et=new dt,Vt=new c,Bt=new c,Mt=new c,jt=new c,kt=new c,zt=new c,ft=new c,Z=new c,rt=new c,Dt=new O,Ut=new O,Wt=new c,At=new ct,Gt=new U,Yt=new U;function pt(t){let e=t.vertexFormat,o=t.geometry,n=t.shadowVolume,s=o.attributes.position.values,i=P(o.attributes.st)?o.attributes.st.values:void 0,r=s.length,f=t.wall,d=t.top||f,p=t.bottom||f;if(e.st||e.normal||e.tangent||e.bitangent||n){let w=t.boundingRectangle,a=t.rotationAxis,H=t.projectTo2d,x=t.ellipsoid,j=t.stRotation,C=t.perPositionHeight,R=Dt;R.x=w.x,R.y=w.y;let B=e.st?new Float32Array(2*(r/3)):void 0,u;e.normal&&(C&&d&&!f?u=o.attributes.normal.values:u=new Float32Array(r));let E=e.tangent?new Float32Array(r):void 0,A=e.bitangent?new Float32Array(r):void 0,v=n?new Float32Array(r):void 0,T=0,y=0,_=Bt,h=Mt,g=jt,k=!0,Y=Gt,J=Yt;if(j!==0){let M=ct.fromAxisAngle(a,j,At);Y=U.fromQuaternion(M,Y),M=ct.fromAxisAngle(a,-j,At),J=U.fromQuaternion(M,J)}else Y=U.clone(U.IDENTITY,Y),J=U.clone(U.IDENTITY,J);let m=0,I=0;d&&p&&(m=r/2,I=r/3,r/=2);for(let M=0;M<r;M+=3){let z=c.fromArray(s,M,Wt);if(e.st&&!P(i)){let N=U.multiplyByVector(Y,z,Vt);N=x.scaleToGeodeticSurface(N,N);let S=H([N],Ut)[0];O.subtract(S,R,S);let X=l.clamp(S.x/w.width,0,1),et=l.clamp(S.y/w.height,0,1);p&&(B[T+I]=X,B[T+1+I]=et),d&&(B[T]=X,B[T+1]=et),T+=2}if(e.normal||e.tangent||e.bitangent||n){let N=y+1,S=y+2;if(f){if(M+3<r){let X=c.fromArray(s,M+3,kt);if(k){let et=c.fromArray(s,M+r,zt);C&&St(z,X,et,x),c.subtract(X,z,X),c.subtract(et,z,et),_=c.normalize(c.cross(et,X,_),_),k=!1}c.equalsEpsilon(X,z,l.EPSILON10)&&(k=!0)}(e.tangent||e.bitangent)&&(g=x.geodeticSurfaceNormal(z,g),e.tangent&&(h=c.normalize(c.cross(g,_,h),h)))}else _=x.geodeticSurfaceNormal(z,_),(e.tangent||e.bitangent)&&(C&&(ft=c.fromArray(u,y,ft),Z=c.cross(c.UNIT_Z,ft,Z),Z=c.normalize(U.multiplyByVector(J,Z,Z),Z),e.bitangent&&(rt=c.normalize(c.cross(ft,Z,rt),rt))),h=c.cross(c.UNIT_Z,_,h),h=c.normalize(U.multiplyByVector(J,h,h),h),e.bitangent&&(g=c.normalize(c.cross(_,h,g),g)));e.normal&&(t.wall?(u[y+m]=_.x,u[N+m]=_.y,u[S+m]=_.z):p&&(u[y+m]=-_.x,u[N+m]=-_.y,u[S+m]=-_.z),(d&&!C||f)&&(u[y]=_.x,u[N]=_.y,u[S]=_.z)),n&&(f&&(_=x.geodeticSurfaceNormal(z,_)),v[y+m]=-_.x,v[N+m]=-_.y,v[S+m]=-_.z),e.tangent&&(t.wall?(E[y+m]=h.x,E[N+m]=h.y,E[S+m]=h.z):p&&(E[y+m]=-h.x,E[N+m]=-h.y,E[S+m]=-h.z),d&&(C?(E[y]=Z.x,E[N]=Z.y,E[S]=Z.z):(E[y]=h.x,E[N]=h.y,E[S]=h.z))),e.bitangent&&(p&&(A[y+m]=g.x,A[N+m]=g.y,A[S+m]=g.z),d&&(C?(A[y]=rt.x,A[N]=rt.y,A[S]=rt.z):(A[y]=g.x,A[N]=g.y,A[S]=g.z))),y+=3}}e.st&&!P(i)&&(o.attributes.st=new tt({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:B})),e.normal&&(o.attributes.normal=new tt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})),e.tangent&&(o.attributes.tangent=new tt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:E})),e.bitangent&&(o.attributes.bitangent=new tt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:A})),n&&(o.attributes.extrudeDirection=new tt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:v}))}if(t.extrude&&P(t.offsetAttribute)){let w=s.length/3,a=new Uint8Array(w);if(t.offsetAttribute===ht.TOP)d&&p||f?a=a.fill(1,0,w/2):d&&(a=a.fill(1));else{let H=t.offsetAttribute===ht.NONE?0:1;a=a.fill(H)}o.attributes.applyOffset=new tt({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}return o}var Ht=[];function qt(t,e,o,n,s,i,r,f,d,p){let w={walls:[]},a;if(r||f){let u=F.createGeometryFromPositions(t,e,o,n,i,d,p),E=u.attributes.position.values,A=u.indices,v,T;if(r&&f){let y=E.concat(E);v=y.length/3,T=lt.createTypedArray(v,A.length*2),T.set(A);let _=A.length,h=v/2;for(a=0;a<_;a+=3){let g=T[a]+h,k=T[a+1]+h,Y=T[a+2]+h;T[a+_]=Y,T[a+1+_]=k,T[a+2+_]=g}if(u.attributes.position.values=y,i&&d.normal){let g=u.attributes.normal.values;u.attributes.normal.values=new Float32Array(y.length),u.attributes.normal.values.set(g)}if(d.st&&P(o)){let g=u.attributes.st.values;u.attributes.st.values=new Float32Array(v*2),u.attributes.st.values=g.concat(g)}u.indices=T}else if(f){for(v=E.length/3,T=lt.createTypedArray(v,A.length),a=0;a<A.length;a+=3)T[a]=A[a+2],T[a+1]=A[a+1],T[a+2]=A[a];u.indices=T}w.topAndBottom=new st({geometry:u})}let H=s.outerRing,x=K.fromPoints(H,t),j=x.projectPointsOntoPlane(H,Ht),C=nt.computeWindingOrder2D(j);C===gt.CLOCKWISE&&(H=H.slice().reverse());let R=F.computeWallGeometry(H,o,t,n,i,p);w.walls.push(new st({geometry:R}));let B=s.holes;for(a=0;a<B.length;a++){let u=B[a];j=x.projectPointsOntoPlane(u,Ht),C=nt.computeWindingOrder2D(j),C===gt.COUNTER_CLOCKWISE&&(u=u.slice().reverse()),R=F.computeWallGeometry(u,o,t,n,i,p),w.walls.push(new st({geometry:R}))}return w}function G(t){if(q.typeOf.object("options",t),q.typeOf.object("options.polygonHierarchy",t.polygonHierarchy),P(t.perPositionHeight)&&t.perPositionHeight&&P(t.height))throw new ut("Cannot use both options.perPositionHeight and options.height");if(P(t.arcType)&&t.arcType!==at.GEODESIC&&t.arcType!==at.RHUMB)throw new ut("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let e=t.polygonHierarchy,o=L(t.vertexFormat,Q.DEFAULT),n=L(t.ellipsoid,V.default),s=L(t.granularity,l.RADIANS_PER_DEGREE),i=L(t.stRotation,0),r=t.textureCoordinates,f=L(t.perPositionHeight,!1),d=f&&P(t.extrudedHeight),p=L(t.height,0),w=L(t.extrudedHeight,p);if(!d){let a=Math.max(p,w);w=Math.min(p,w),p=a}this._vertexFormat=Q.clone(o),this._ellipsoid=V.clone(n),this._granularity=s,this._stRotation=i,this._height=p,this._extrudedHeight=w,this._closeTop=L(t.closeTop,!0),this._closeBottom=L(t.closeBottom,!0),this._polygonHierarchy=e,this._perPositionHeight=f,this._perPositionHeightExtrude=d,this._shadowVolume=L(t.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=t.offsetAttribute,this._arcType=L(t.arcType,at.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=r,this.packedLength=F.computeHierarchyPackedLength(e,c)+V.packedLength+Q.packedLength+(r?F.computeHierarchyPackedLength(r,O):1)+12}G.fromPositions=function(t){t=L(t,L.EMPTY_OBJECT),q.defined("options.positions",t.positions);let e={polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType,textureCoordinates:t.textureCoordinates};return new G(e)};G.pack=function(t,e,o){return q.typeOf.object("value",t),q.defined("array",e),o=L(o,0),o=F.packPolygonHierarchy(t._polygonHierarchy,e,o,c),V.pack(t._ellipsoid,e,o),o+=V.packedLength,Q.pack(t._vertexFormat,e,o),o+=Q.packedLength,e[o++]=t._height,e[o++]=t._extrudedHeight,e[o++]=t._granularity,e[o++]=t._stRotation,e[o++]=t._perPositionHeightExtrude?1:0,e[o++]=t._perPositionHeight?1:0,e[o++]=t._closeTop?1:0,e[o++]=t._closeBottom?1:0,e[o++]=t._shadowVolume?1:0,e[o++]=L(t._offsetAttribute,-1),e[o++]=t._arcType,P(t._textureCoordinates)?o=F.packPolygonHierarchy(t._textureCoordinates,e,o,O):e[o++]=-1,e[o++]=t.packedLength,e};var Qt=V.clone(V.UNIT_SPHERE),Zt=new Q,Kt={polygonHierarchy:{}};G.unpack=function(t,e,o){q.defined("array",t),e=L(e,0);let n=F.unpackPolygonHierarchy(t,e,c);e=n.startingIndex,delete n.startingIndex;let s=V.unpack(t,e,Qt);e+=V.packedLength;let i=Q.unpack(t,e,Zt);e+=Q.packedLength;let r=t[e++],f=t[e++],d=t[e++],p=t[e++],w=t[e++]===1,a=t[e++]===1,H=t[e++]===1,x=t[e++]===1,j=t[e++]===1,C=t[e++],R=t[e++],B=t[e]===-1?void 0:F.unpackPolygonHierarchy(t,e,O);P(B)?(e=B.startingIndex,delete B.startingIndex):e++;let u=t[e++];return P(o)||(o=new G(Kt)),o._polygonHierarchy=n,o._ellipsoid=V.clone(s,o._ellipsoid),o._vertexFormat=Q.clone(i,o._vertexFormat),o._height=r,o._extrudedHeight=f,o._granularity=d,o._stRotation=p,o._perPositionHeightExtrude=w,o._perPositionHeight=a,o._closeTop=H,o._closeBottom=x,o._shadowVolume=j,o._offsetAttribute=C===-1?void 0:C,o._arcType=R,o._textureCoordinates=B,o.packedLength=u,o};var Jt=new O,Xt=new O,$t=new D;function xt(t,e,o,n,s,i){let r=t.longitude,f=r>=0?r:r+l.TWO_PI;s.westOverIdl=Math.min(s.westOverIdl,f),s.eastOverIdl=Math.max(s.eastOverIdl,f),i.west=Math.min(i.west,r),i.east=Math.max(i.east,r);let d=t.getLatitude(o),p=d;if(i.south=Math.min(i.south,d),i.north=Math.max(i.north,d),n!==at.RHUMB){let H=O.subtract(e.position,t.position,Jt),x=O.dot(e.position,H)/O.dot(H,H);if(x>0&&x<1){let j=O.add(e.position,O.multiplyByScalar(H,-x,H),Xt),C=D.clone(e,$t);C.position=j;let R=C.getLatitude(o);i.south=Math.min(i.south,R),i.north=Math.max(i.north,R),Math.abs(d)>Math.abs(R)&&(p=R)}}let w=e.x*t.y-t.x*e.y,a=Math.sign(w);a!==0&&(a*=O.angleBetween(e.position,t.position)),p>=0&&(s.northAngle+=a),p<=0&&(s.southAngle+=a)}var Ct=new D,te=new D,W={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};G.computeRectangleFromPositions=function(t,e,o,n){if(q.defined("positions",t),P(n)||(n=new _t),t.length<3)return n;n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,W.northAngle=0,W.southAngle=0,W.westOverIdl=Number.POSITIVE_INFINITY,W.eastOverIdl=Number.NEGATIVE_INFINITY;let s=t.length,i=D.fromCartesian(t[0],te);for(let r=1;r<s;r++){let f=D.fromCartesian(t[r],Ct);xt(f,i,e,o,W,n),i=D.clone(f,i)}return xt(D.fromCartesian(t[0],Ct),i,e,o,W,n),n.east-n.west>W.eastOverIdl-W.westOverIdl&&(n.west=W.westOverIdl,n.east=W.eastOverIdl,n.east>l.PI&&(n.east=n.east-l.TWO_PI),n.west>l.PI&&(n.west=n.west-l.TWO_PI)),l.equalsEpsilon(Math.abs(W.northAngle),l.TWO_PI,l.EPSILON10)&&(n.north=l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),l.equalsEpsilon(Math.abs(W.southAngle),l.TWO_PI,l.EPSILON10)&&(n.south=-l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),n};var ee=new D;function oe(t,e,o){return t.height>=l.PI||t.width>=l.PI?D.fromCartesian(e[0],ee).tangentPlane:K.fromPoints(e,o)}var Nt=new ot;function ne(t,e,o){return(n,s)=>{if(t.height>=l.PI||t.width>=l.PI){if(t.south<0&&t.north>0){P(s)||(s=[]);for(let r=0;r<n.length;++r){let f=o.cartesianToCartographic(n[r],Nt);s[r]=new O(f.longitude/l.PI,f.latitude/l.PI_OVER_TWO)}return s.length=n.length,s}return D.fromCartesianArray(n,s)}return K.fromPoints(e,o).projectPointsOntoPlane(n,s)}}function ie(t,e,o){if(t.height>=l.PI||t.width>=l.PI)return(s,i)=>{if(t.south<0&&t.north>0){let r=o.cartesianToCartographic(s,Nt);return P(i)||(i=new O),i.x=r.longitude/l.PI,i.y=r.latitude/l.PI_OVER_TWO,i}return D.fromCartesian(s,i)};let n=K.fromPoints(e,o);return(s,i)=>n.projectPointsOntoPlane(s,i)}function re(t,e,o,n){return(s,i)=>!n&&(t.height>=l.PI_OVER_TWO||t.width>=2*l.PI_OVER_THREE)?F.splitPolygonsOnEquator(s,e,o,i):s}function se(t,e,o,n){if(e.height>=l.PI||e.width>=l.PI)return dt.fromRectangle(e,void 0,Et);let s=t,i=K.fromPoints(s,o);return F.computeBoundingRectangle(i.plane.normal,i.projectPointOntoPlane.bind(i),s,n,Et)}G.createGeometry=function(t){let e=t._vertexFormat,o=t._ellipsoid,n=t._granularity,s=t._stRotation,i=t._polygonHierarchy,r=t._perPositionHeight,f=t._closeTop,d=t._closeBottom,p=t._arcType,w=t._textureCoordinates,a=P(w),H=i.positions;if(H.length<3)return;let x=t.rectangle,j=F.polygonsFromHierarchy(i,a,ne(x,H,o),!r,o,re(x,o,p,r)),C=j.hierarchy,R=j.polygons,B=function(m){return m},u=a?F.polygonsFromHierarchy(w,!0,B,!1,o).polygons:void 0;if(C.length===0)return;let E=C[0].outerRing,A=se(E,x,o,s),v=[],T=t._height,y=t._extrudedHeight,_=t._perPositionHeightExtrude||!l.equalsEpsilon(T,y,0,l.EPSILON2),h={perPositionHeight:r,vertexFormat:e,geometry:void 0,rotationAxis:oe(x,E,o).plane.normal,projectTo2d:ie(x,E,o),boundingRectangle:A,ellipsoid:o,stRotation:s,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:p},g;if(_)for(h.extrude=!0,h.top=f,h.bottom=d,h.shadowVolume=t._shadowVolume,h.offsetAttribute=t._offsetAttribute,g=0;g<R.length;g++){let m=qt(o,R[g],a?u[g]:void 0,n,C[g],r,f,d,e,p),I;f&&d?(I=m.topAndBottom,h.geometry=F.scaleToGeodeticHeightExtruded(I.geometry,T,y,o,r)):f?(I=m.topAndBottom,I.geometry.attributes.position.values=nt.scaleToGeodeticHeight(I.geometry.attributes.position.values,T,o,!r),h.geometry=I.geometry):d&&(I=m.topAndBottom,I.geometry.attributes.position.values=nt.scaleToGeodeticHeight(I.geometry.attributes.position.values,y,o,!0),h.geometry=I.geometry),(f||d)&&(h.wall=!1,I.geometry=pt(h),v.push(I));let M=m.walls;h.wall=!0;for(let z=0;z<M.length;z++){let N=M[z];h.geometry=F.scaleToGeodeticHeightExtruded(N.geometry,T,y,o,r),N.geometry=pt(h),v.push(N)}}else for(g=0;g<R.length;g++){let m=new st({geometry:F.createGeometryFromPositions(o,R[g],a?u[g]:void 0,n,r,e,p)});if(m.geometry.attributes.position.values=nt.scaleToGeodeticHeight(m.geometry.attributes.position.values,T,o,!r),h.geometry=m.geometry,m.geometry=pt(h),P(t._offsetAttribute)){let I=m.geometry.attributes.position.values.length,M=t._offsetAttribute===ht.NONE?0:1,z=new Uint8Array(I/3).fill(M);m.geometry.attributes.applyOffset=new tt({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:z})}v.push(m)}let k=bt.combineInstances(v)[0];k.attributes.position.values=new Float64Array(k.attributes.position.values),k.indices=lt.createTypedArray(k.attributes.position.values.length/3,k.indices);let Y=k.attributes,J=Tt.fromVertices(Y.position.values);return e.position||delete Y.position,new mt({attributes:Y,indices:k.indices,primitiveType:k.primitiveType,boundingSphere:J,offsetAttribute:t._offsetAttribute})};G.createShadowVolume=function(t,e,o){let n=t._granularity,s=t._ellipsoid,i=e(n,s),r=o(n,s);return new G({polygonHierarchy:t._polygonHierarchy,ellipsoid:s,stRotation:t._stRotation,granularity:n,perPositionHeight:!1,extrudedHeight:i,height:r,vertexFormat:Q.POSITION_ONLY,shadowVolume:!0,arcType:t._arcType})};function ae(t){let e=-t._stRotation;if(e===0)return[0,0,0,1,1,0];let o=t._ellipsoid,n=t._polygonHierarchy.positions,s=t.rectangle;return mt._textureCoordinateRotationPoints(n,e,o,s)}Object.defineProperties(G.prototype,{rectangle:{get:function(){if(!P(this._rectangle)){let t=this._polygonHierarchy.positions;this._rectangle=G.computeRectangleFromPositions(t,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return P(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=ae(this)),this._textureCoordinateRotationPoints}}});var Pt=G;function ce(t,e){return P(e)&&(t=Pt.unpack(t,e)),t._ellipsoid=V.clone(t._ellipsoid),Pt.createGeometry(t)}var Xe=ce;export{Xe as default}; +import{a as dt}from"./chunk-DKG6YEMN.js";import{a as F}from"./chunk-V7BDYEN7.js";import{a as at}from"./chunk-GMMUK6QU.js";import{a as st}from"./chunk-4MYAYFOP.js";import{a as bt}from"./chunk-FG3CL3AH.js";import"./chunk-VMXXQ6B4.js";import"./chunk-XCRMBS5M.js";import{a as ht}from"./chunk-N5SNKJ43.js";import{a as Q}from"./chunk-6VK5R74O.js";import{a as K}from"./chunk-P73YILG6.js";import"./chunk-VYMAIP2A.js";import{a as gt,b as nt}from"./chunk-ZMGESOEZ.js";import"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import{a as wt,b as yt}from"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as lt}from"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import{c as mt,d as tt}from"./chunk-NW2YE576.js";import{d as Tt}from"./chunk-2NIQ5ECB.js";import{f as ct,h as _t}from"./chunk-7YEOLR2L.js";import{a as $}from"./chunk-QHHYYTCM.js";import{a as c,b as ot,c as O,d as V,e as U}from"./chunk-RH3GFHG2.js";import{a as l}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as L}from"./chunk-TA3RE4KQ.js";import{a as ut,b as q}from"./chunk-RTY3VPG6.js";import{e as P}from"./chunk-LRNH5AEO.js";function b(t,e){this.position=t,P(this.position)||(this.position=new O),this.tangentPlane=e,P(this.tangentPlane)||(this.tangentPlane=b.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(b.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let t=O.magnitude(this.position),e=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(l.PI_OVER_TWO-2*Math.atan2(t,e))}},longitude:{get:function(){let t=l.PI_OVER_TWO+Math.atan2(this.y,this.x);return t>Math.PI&&(t-=l.TWO_PI),t}}});var it=new ot,Rt=new c;b.prototype.getLatitude=function(t){P(t)||(t=V.default),it.latitude=this.conformalLatitude,it.longitude=this.longitude,it.height=0;let e=this.ellipsoid.cartographicToCartesian(it,Rt);return t.cartesianToCartographic(e,it),it.latitude};var It=new wt,Lt=new c,Ft=new c;b.fromCartesian=function(t,e){q.defined("cartesian",t);let o=l.signNotZero(t.z),n=b.NORTH_POLE_TANGENT_PLANE,s=b.SOUTH_POLE;o<0&&(n=b.SOUTH_POLE_TANGENT_PLANE,s=b.NORTH_POLE);let i=It;i.origin=n.ellipsoid.scaleToGeocentricSurface(t,i.origin),i.direction=c.subtract(i.origin,s,Lt),c.normalize(i.direction,i.direction);let r=yt.rayPlane(i,n.plane,Ft),f=c.subtract(r,s,r),d=c.dot(n.xAxis,f),p=o*c.dot(n.yAxis,f);return P(e)?(e.position=new O(d,p),e.tangentPlane=n,e):new b(new O(d,p),n)};b.fromCartesianArray=function(t,e){q.defined("cartesians",t);let o=t.length;P(e)?e.length=o:e=new Array(o);for(let n=0;n<o;n++)e[n]=b.fromCartesian(t[n],e[n]);return e};b.clone=function(t,e){if(P(t))return P(e)?(e.position=t.position,e.tangentPlane=t.tangentPlane,e):new b(t.position,t.tangentPlane)};b.HALF_UNIT_SPHERE=Object.freeze(new V(.5,.5,.5));b.NORTH_POLE=Object.freeze(new c(0,0,.5));b.SOUTH_POLE=Object.freeze(new c(0,0,-.5));b.NORTH_POLE_TANGENT_PLANE=Object.freeze(new K(b.NORTH_POLE,b.HALF_UNIT_SPHERE));b.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new K(b.SOUTH_POLE,b.HALF_UNIT_SPHERE));var D=b;var vt=new ot,Ot=new ot;function St(t,e,o,n){let i=n.cartesianToCartographic(t,vt).height,r=n.cartesianToCartographic(e,Ot);r.height=i,n.cartographicToCartesian(r,e);let f=n.cartesianToCartographic(o,Ot);f.height=i-100,n.cartographicToCartesian(f,o)}var Et=new dt,Vt=new c,Bt=new c,Mt=new c,jt=new c,kt=new c,zt=new c,ft=new c,Z=new c,rt=new c,Dt=new O,Ut=new O,Wt=new c,At=new ct,Gt=new U,Yt=new U;function pt(t){let e=t.vertexFormat,o=t.geometry,n=t.shadowVolume,s=o.attributes.position.values,i=P(o.attributes.st)?o.attributes.st.values:void 0,r=s.length,f=t.wall,d=t.top||f,p=t.bottom||f;if(e.st||e.normal||e.tangent||e.bitangent||n){let w=t.boundingRectangle,a=t.rotationAxis,H=t.projectTo2d,x=t.ellipsoid,j=t.stRotation,C=t.perPositionHeight,R=Dt;R.x=w.x,R.y=w.y;let B=e.st?new Float32Array(2*(r/3)):void 0,u;e.normal&&(C&&d&&!f?u=o.attributes.normal.values:u=new Float32Array(r));let E=e.tangent?new Float32Array(r):void 0,A=e.bitangent?new Float32Array(r):void 0,v=n?new Float32Array(r):void 0,T=0,y=0,_=Bt,h=Mt,g=jt,k=!0,Y=Gt,J=Yt;if(j!==0){let M=ct.fromAxisAngle(a,j,At);Y=U.fromQuaternion(M,Y),M=ct.fromAxisAngle(a,-j,At),J=U.fromQuaternion(M,J)}else Y=U.clone(U.IDENTITY,Y),J=U.clone(U.IDENTITY,J);let m=0,I=0;d&&p&&(m=r/2,I=r/3,r/=2);for(let M=0;M<r;M+=3){let z=c.fromArray(s,M,Wt);if(e.st&&!P(i)){let N=U.multiplyByVector(Y,z,Vt);N=x.scaleToGeodeticSurface(N,N);let S=H([N],Ut)[0];O.subtract(S,R,S);let X=l.clamp(S.x/w.width,0,1),et=l.clamp(S.y/w.height,0,1);p&&(B[T+I]=X,B[T+1+I]=et),d&&(B[T]=X,B[T+1]=et),T+=2}if(e.normal||e.tangent||e.bitangent||n){let N=y+1,S=y+2;if(f){if(M+3<r){let X=c.fromArray(s,M+3,kt);if(k){let et=c.fromArray(s,M+r,zt);C&&St(z,X,et,x),c.subtract(X,z,X),c.subtract(et,z,et),_=c.normalize(c.cross(et,X,_),_),k=!1}c.equalsEpsilon(X,z,l.EPSILON10)&&(k=!0)}(e.tangent||e.bitangent)&&(g=x.geodeticSurfaceNormal(z,g),e.tangent&&(h=c.normalize(c.cross(g,_,h),h)))}else _=x.geodeticSurfaceNormal(z,_),(e.tangent||e.bitangent)&&(C&&(ft=c.fromArray(u,y,ft),Z=c.cross(c.UNIT_Z,ft,Z),Z=c.normalize(U.multiplyByVector(J,Z,Z),Z),e.bitangent&&(rt=c.normalize(c.cross(ft,Z,rt),rt))),h=c.cross(c.UNIT_Z,_,h),h=c.normalize(U.multiplyByVector(J,h,h),h),e.bitangent&&(g=c.normalize(c.cross(_,h,g),g)));e.normal&&(t.wall?(u[y+m]=_.x,u[N+m]=_.y,u[S+m]=_.z):p&&(u[y+m]=-_.x,u[N+m]=-_.y,u[S+m]=-_.z),(d&&!C||f)&&(u[y]=_.x,u[N]=_.y,u[S]=_.z)),n&&(f&&(_=x.geodeticSurfaceNormal(z,_)),v[y+m]=-_.x,v[N+m]=-_.y,v[S+m]=-_.z),e.tangent&&(t.wall?(E[y+m]=h.x,E[N+m]=h.y,E[S+m]=h.z):p&&(E[y+m]=-h.x,E[N+m]=-h.y,E[S+m]=-h.z),d&&(C?(E[y]=Z.x,E[N]=Z.y,E[S]=Z.z):(E[y]=h.x,E[N]=h.y,E[S]=h.z))),e.bitangent&&(p&&(A[y+m]=g.x,A[N+m]=g.y,A[S+m]=g.z),d&&(C?(A[y]=rt.x,A[N]=rt.y,A[S]=rt.z):(A[y]=g.x,A[N]=g.y,A[S]=g.z))),y+=3}}e.st&&!P(i)&&(o.attributes.st=new tt({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:B})),e.normal&&(o.attributes.normal=new tt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})),e.tangent&&(o.attributes.tangent=new tt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:E})),e.bitangent&&(o.attributes.bitangent=new tt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:A})),n&&(o.attributes.extrudeDirection=new tt({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:v}))}if(t.extrude&&P(t.offsetAttribute)){let w=s.length/3,a=new Uint8Array(w);if(t.offsetAttribute===ht.TOP)d&&p||f?a=a.fill(1,0,w/2):d&&(a=a.fill(1));else{let H=t.offsetAttribute===ht.NONE?0:1;a=a.fill(H)}o.attributes.applyOffset=new tt({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}return o}var Ht=[];function qt(t,e,o,n,s,i,r,f,d,p){let w={walls:[]},a;if(r||f){let u=F.createGeometryFromPositions(t,e,o,n,i,d,p),E=u.attributes.position.values,A=u.indices,v,T;if(r&&f){let y=E.concat(E);v=y.length/3,T=lt.createTypedArray(v,A.length*2),T.set(A);let _=A.length,h=v/2;for(a=0;a<_;a+=3){let g=T[a]+h,k=T[a+1]+h,Y=T[a+2]+h;T[a+_]=Y,T[a+1+_]=k,T[a+2+_]=g}if(u.attributes.position.values=y,i&&d.normal){let g=u.attributes.normal.values;u.attributes.normal.values=new Float32Array(y.length),u.attributes.normal.values.set(g)}if(d.st&&P(o)){let g=u.attributes.st.values;u.attributes.st.values=new Float32Array(v*2),u.attributes.st.values=g.concat(g)}u.indices=T}else if(f){for(v=E.length/3,T=lt.createTypedArray(v,A.length),a=0;a<A.length;a+=3)T[a]=A[a+2],T[a+1]=A[a+1],T[a+2]=A[a];u.indices=T}w.topAndBottom=new st({geometry:u})}let H=s.outerRing,x=K.fromPoints(H,t),j=x.projectPointsOntoPlane(H,Ht),C=nt.computeWindingOrder2D(j);C===gt.CLOCKWISE&&(H=H.slice().reverse());let R=F.computeWallGeometry(H,o,t,n,i,p);w.walls.push(new st({geometry:R}));let B=s.holes;for(a=0;a<B.length;a++){let u=B[a];j=x.projectPointsOntoPlane(u,Ht),C=nt.computeWindingOrder2D(j),C===gt.COUNTER_CLOCKWISE&&(u=u.slice().reverse()),R=F.computeWallGeometry(u,o,t,n,i,p),w.walls.push(new st({geometry:R}))}return w}function G(t){if(q.typeOf.object("options",t),q.typeOf.object("options.polygonHierarchy",t.polygonHierarchy),P(t.perPositionHeight)&&t.perPositionHeight&&P(t.height))throw new ut("Cannot use both options.perPositionHeight and options.height");if(P(t.arcType)&&t.arcType!==at.GEODESIC&&t.arcType!==at.RHUMB)throw new ut("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let e=t.polygonHierarchy,o=L(t.vertexFormat,Q.DEFAULT),n=L(t.ellipsoid,V.default),s=L(t.granularity,l.RADIANS_PER_DEGREE),i=L(t.stRotation,0),r=t.textureCoordinates,f=L(t.perPositionHeight,!1),d=f&&P(t.extrudedHeight),p=L(t.height,0),w=L(t.extrudedHeight,p);if(!d){let a=Math.max(p,w);w=Math.min(p,w),p=a}this._vertexFormat=Q.clone(o),this._ellipsoid=V.clone(n),this._granularity=s,this._stRotation=i,this._height=p,this._extrudedHeight=w,this._closeTop=L(t.closeTop,!0),this._closeBottom=L(t.closeBottom,!0),this._polygonHierarchy=e,this._perPositionHeight=f,this._perPositionHeightExtrude=d,this._shadowVolume=L(t.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=t.offsetAttribute,this._arcType=L(t.arcType,at.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=r,this.packedLength=F.computeHierarchyPackedLength(e,c)+V.packedLength+Q.packedLength+(r?F.computeHierarchyPackedLength(r,O):1)+12}G.fromPositions=function(t){t=L(t,L.EMPTY_OBJECT),q.defined("options.positions",t.positions);let e={polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType,textureCoordinates:t.textureCoordinates};return new G(e)};G.pack=function(t,e,o){return q.typeOf.object("value",t),q.defined("array",e),o=L(o,0),o=F.packPolygonHierarchy(t._polygonHierarchy,e,o,c),V.pack(t._ellipsoid,e,o),o+=V.packedLength,Q.pack(t._vertexFormat,e,o),o+=Q.packedLength,e[o++]=t._height,e[o++]=t._extrudedHeight,e[o++]=t._granularity,e[o++]=t._stRotation,e[o++]=t._perPositionHeightExtrude?1:0,e[o++]=t._perPositionHeight?1:0,e[o++]=t._closeTop?1:0,e[o++]=t._closeBottom?1:0,e[o++]=t._shadowVolume?1:0,e[o++]=L(t._offsetAttribute,-1),e[o++]=t._arcType,P(t._textureCoordinates)?o=F.packPolygonHierarchy(t._textureCoordinates,e,o,O):e[o++]=-1,e[o++]=t.packedLength,e};var Qt=V.clone(V.UNIT_SPHERE),Zt=new Q,Kt={polygonHierarchy:{}};G.unpack=function(t,e,o){q.defined("array",t),e=L(e,0);let n=F.unpackPolygonHierarchy(t,e,c);e=n.startingIndex,delete n.startingIndex;let s=V.unpack(t,e,Qt);e+=V.packedLength;let i=Q.unpack(t,e,Zt);e+=Q.packedLength;let r=t[e++],f=t[e++],d=t[e++],p=t[e++],w=t[e++]===1,a=t[e++]===1,H=t[e++]===1,x=t[e++]===1,j=t[e++]===1,C=t[e++],R=t[e++],B=t[e]===-1?void 0:F.unpackPolygonHierarchy(t,e,O);P(B)?(e=B.startingIndex,delete B.startingIndex):e++;let u=t[e++];return P(o)||(o=new G(Kt)),o._polygonHierarchy=n,o._ellipsoid=V.clone(s,o._ellipsoid),o._vertexFormat=Q.clone(i,o._vertexFormat),o._height=r,o._extrudedHeight=f,o._granularity=d,o._stRotation=p,o._perPositionHeightExtrude=w,o._perPositionHeight=a,o._closeTop=H,o._closeBottom=x,o._shadowVolume=j,o._offsetAttribute=C===-1?void 0:C,o._arcType=R,o._textureCoordinates=B,o.packedLength=u,o};var Jt=new O,Xt=new O,$t=new D;function xt(t,e,o,n,s,i){let r=t.longitude,f=r>=0?r:r+l.TWO_PI;s.westOverIdl=Math.min(s.westOverIdl,f),s.eastOverIdl=Math.max(s.eastOverIdl,f),i.west=Math.min(i.west,r),i.east=Math.max(i.east,r);let d=t.getLatitude(o),p=d;if(i.south=Math.min(i.south,d),i.north=Math.max(i.north,d),n!==at.RHUMB){let H=O.subtract(e.position,t.position,Jt),x=O.dot(e.position,H)/O.dot(H,H);if(x>0&&x<1){let j=O.add(e.position,O.multiplyByScalar(H,-x,H),Xt),C=D.clone(e,$t);C.position=j;let R=C.getLatitude(o);i.south=Math.min(i.south,R),i.north=Math.max(i.north,R),Math.abs(d)>Math.abs(R)&&(p=R)}}let w=e.x*t.y-t.x*e.y,a=Math.sign(w);a!==0&&(a*=O.angleBetween(e.position,t.position)),p>=0&&(s.northAngle+=a),p<=0&&(s.southAngle+=a)}var Ct=new D,te=new D,W={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};G.computeRectangleFromPositions=function(t,e,o,n){if(q.defined("positions",t),P(n)||(n=new _t),t.length<3)return n;n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,W.northAngle=0,W.southAngle=0,W.westOverIdl=Number.POSITIVE_INFINITY,W.eastOverIdl=Number.NEGATIVE_INFINITY;let s=t.length,i=D.fromCartesian(t[0],te);for(let r=1;r<s;r++){let f=D.fromCartesian(t[r],Ct);xt(f,i,e,o,W,n),i=D.clone(f,i)}return xt(D.fromCartesian(t[0],Ct),i,e,o,W,n),n.east-n.west>W.eastOverIdl-W.westOverIdl&&(n.west=W.westOverIdl,n.east=W.eastOverIdl,n.east>l.PI&&(n.east=n.east-l.TWO_PI),n.west>l.PI&&(n.west=n.west-l.TWO_PI)),l.equalsEpsilon(Math.abs(W.northAngle),l.TWO_PI,l.EPSILON10)&&(n.north=l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),l.equalsEpsilon(Math.abs(W.southAngle),l.TWO_PI,l.EPSILON10)&&(n.south=-l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),n};var ee=new D;function oe(t,e,o){return t.height>=l.PI||t.width>=l.PI?D.fromCartesian(e[0],ee).tangentPlane:K.fromPoints(e,o)}var Nt=new ot;function ne(t,e,o){return(n,s)=>{if(t.height>=l.PI||t.width>=l.PI){if(t.south<0&&t.north>0){P(s)||(s=[]);for(let r=0;r<n.length;++r){let f=o.cartesianToCartographic(n[r],Nt);s[r]=new O(f.longitude/l.PI,f.latitude/l.PI_OVER_TWO)}return s.length=n.length,s}return D.fromCartesianArray(n,s)}return K.fromPoints(e,o).projectPointsOntoPlane(n,s)}}function ie(t,e,o){if(t.height>=l.PI||t.width>=l.PI)return(s,i)=>{if(t.south<0&&t.north>0){let r=o.cartesianToCartographic(s,Nt);return P(i)||(i=new O),i.x=r.longitude/l.PI,i.y=r.latitude/l.PI_OVER_TWO,i}return D.fromCartesian(s,i)};let n=K.fromPoints(e,o);return(s,i)=>n.projectPointsOntoPlane(s,i)}function re(t,e,o,n){return(s,i)=>!n&&(t.height>=l.PI_OVER_TWO||t.width>=2*l.PI_OVER_THREE)?F.splitPolygonsOnEquator(s,e,o,i):s}function se(t,e,o,n){if(e.height>=l.PI||e.width>=l.PI)return dt.fromRectangle(e,void 0,Et);let s=t,i=K.fromPoints(s,o);return F.computeBoundingRectangle(i.plane.normal,i.projectPointOntoPlane.bind(i),s,n,Et)}G.createGeometry=function(t){let e=t._vertexFormat,o=t._ellipsoid,n=t._granularity,s=t._stRotation,i=t._polygonHierarchy,r=t._perPositionHeight,f=t._closeTop,d=t._closeBottom,p=t._arcType,w=t._textureCoordinates,a=P(w),H=i.positions;if(H.length<3)return;let x=t.rectangle,j=F.polygonsFromHierarchy(i,a,ne(x,H,o),!r,o,re(x,o,p,r)),C=j.hierarchy,R=j.polygons,B=function(m){return m},u=a?F.polygonsFromHierarchy(w,!0,B,!1,o).polygons:void 0;if(C.length===0)return;let E=C[0].outerRing,A=se(E,x,o,s),v=[],T=t._height,y=t._extrudedHeight,_=t._perPositionHeightExtrude||!l.equalsEpsilon(T,y,0,l.EPSILON2),h={perPositionHeight:r,vertexFormat:e,geometry:void 0,rotationAxis:oe(x,E,o).plane.normal,projectTo2d:ie(x,E,o),boundingRectangle:A,ellipsoid:o,stRotation:s,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:p},g;if(_)for(h.extrude=!0,h.top=f,h.bottom=d,h.shadowVolume=t._shadowVolume,h.offsetAttribute=t._offsetAttribute,g=0;g<R.length;g++){let m=qt(o,R[g],a?u[g]:void 0,n,C[g],r,f,d,e,p),I;f&&d?(I=m.topAndBottom,h.geometry=F.scaleToGeodeticHeightExtruded(I.geometry,T,y,o,r)):f?(I=m.topAndBottom,I.geometry.attributes.position.values=nt.scaleToGeodeticHeight(I.geometry.attributes.position.values,T,o,!r),h.geometry=I.geometry):d&&(I=m.topAndBottom,I.geometry.attributes.position.values=nt.scaleToGeodeticHeight(I.geometry.attributes.position.values,y,o,!0),h.geometry=I.geometry),(f||d)&&(h.wall=!1,I.geometry=pt(h),v.push(I));let M=m.walls;h.wall=!0;for(let z=0;z<M.length;z++){let N=M[z];h.geometry=F.scaleToGeodeticHeightExtruded(N.geometry,T,y,o,r),N.geometry=pt(h),v.push(N)}}else for(g=0;g<R.length;g++){let m=new st({geometry:F.createGeometryFromPositions(o,R[g],a?u[g]:void 0,n,r,e,p)});if(m.geometry.attributes.position.values=nt.scaleToGeodeticHeight(m.geometry.attributes.position.values,T,o,!r),h.geometry=m.geometry,m.geometry=pt(h),P(t._offsetAttribute)){let I=m.geometry.attributes.position.values.length,M=t._offsetAttribute===ht.NONE?0:1,z=new Uint8Array(I/3).fill(M);m.geometry.attributes.applyOffset=new tt({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:z})}v.push(m)}let k=bt.combineInstances(v)[0];k.attributes.position.values=new Float64Array(k.attributes.position.values),k.indices=lt.createTypedArray(k.attributes.position.values.length/3,k.indices);let Y=k.attributes,J=Tt.fromVertices(Y.position.values);return e.position||delete Y.position,new mt({attributes:Y,indices:k.indices,primitiveType:k.primitiveType,boundingSphere:J,offsetAttribute:t._offsetAttribute})};G.createShadowVolume=function(t,e,o){let n=t._granularity,s=t._ellipsoid,i=e(n,s),r=o(n,s);return new G({polygonHierarchy:t._polygonHierarchy,ellipsoid:s,stRotation:t._stRotation,granularity:n,perPositionHeight:!1,extrudedHeight:i,height:r,vertexFormat:Q.POSITION_ONLY,shadowVolume:!0,arcType:t._arcType})};function ae(t){let e=-t._stRotation;if(e===0)return[0,0,0,1,1,0];let o=t._ellipsoid,n=t._polygonHierarchy.positions,s=t.rectangle;return mt._textureCoordinateRotationPoints(n,e,o,s)}Object.defineProperties(G.prototype,{rectangle:{get:function(){if(!P(this._rectangle)){let t=this._polygonHierarchy.positions;this._rectangle=G.computeRectangleFromPositions(t,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return P(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=ae(this)),this._textureCoordinateRotationPoints}}});var Pt=G;function ce(t,e){return P(e)&&(t=Pt.unpack(t,e)),t._ellipsoid=V.clone(t._ellipsoid),Pt.createGeometry(t)}var Xe=ce;export{Xe as default}; diff --git a/public/js/Cesium2/Workers/createPolygonOutlineGeometry.js b/public/js/Cesium2/Workers/createPolygonOutlineGeometry.js index a122e4673..a77a1836f 100644 --- a/public/js/Cesium2/Workers/createPolygonOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createPolygonOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a}from"./chunk-HTYD62GU.js";import{a as b}from"./chunk-HQ4YU6WD.js";import{a as F}from"./chunk-W5MIOKEY.js";import{a as V}from"./chunk-72CGGEJF.js";import"./chunk-Q5MYX5A2.js";import"./chunk-OZYLWM74.js";import{a as D}from"./chunk-5CC3QRYS.js";import{a as W}from"./chunk-CTRWX4F5.js";import"./chunk-Z7BLUZ7R.js";import{a as j,b as k}from"./chunk-WJYW7YDO.js";import"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as M}from"./chunk-34ULWVZF.js";import{a as G}from"./chunk-24JYWT5N.js";import{b as B,c as C,d as v}from"./chunk-LH3SUUXG.js";import{d as z}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as w}from"./chunk-D5HNP2LB.js";import{a as S,d as y}from"./chunk-S4VBGY2U.js";import{a as T}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as P}from"./chunk-N3A5CZ2S.js";import{a as U,b as A}from"./chunk-G75U3WZT.js";import{e as O}from"./chunk-3THTQ4QB.js";var Y=[],R=[];function K(e,t,r,H,l){let p=W.fromPoints(t,e).projectPointsOntoPlane(t,Y);k.computeWindingOrder2D(p)===j.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let n,i,o=t.length,c=0;if(H)for(n=new Float64Array(o*2*3),i=0;i<o;i++){let u=t[i],h=t[(i+1)%o];n[c++]=u.x,n[c++]=u.y,n[c++]=u.z,n[c++]=h.x,n[c++]=h.y,n[c++]=h.z}else{let u=0;if(l===b.GEODESIC)for(i=0;i<o;i++)u+=a.subdivideLineCount(t[i],t[(i+1)%o],r);else if(l===b.RHUMB)for(i=0;i<o;i++)u+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=new Float64Array(u*3),i=0;i<o;i++){let h;l===b.GEODESIC?h=a.subdivideLine(t[i],t[(i+1)%o],r,R):l===b.RHUMB&&(h=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,R));let g=h.length;for(let d=0;d<g;++d)n[c++]=h[d]}}o=n.length/3;let f=o*2,m=M.createTypedArray(o,f);for(c=0,i=0;i<o-1;i++)m[c++]=i,m[c++]=i+1;return m[c++]=o-1,m[c++]=0,new F({geometry:new C({attributes:new G({position:new v({componentDatatype:w.DOUBLE,componentsPerAttribute:3,values:n})}),indices:m,primitiveType:B.LINES})})}function q(e,t,r,H,l){let p=W.fromPoints(t,e).projectPointsOntoPlane(t,Y);k.computeWindingOrder2D(p)===j.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let n,i,o=t.length,c=new Array(o),f=0;if(H)for(n=new Float64Array(o*2*3*2),i=0;i<o;++i){c[i]=f/3;let g=t[i],d=t[(i+1)%o];n[f++]=g.x,n[f++]=g.y,n[f++]=g.z,n[f++]=d.x,n[f++]=d.y,n[f++]=d.z}else{let g=0;if(l===b.GEODESIC)for(i=0;i<o;i++)g+=a.subdivideLineCount(t[i],t[(i+1)%o],r);else if(l===b.RHUMB)for(i=0;i<o;i++)g+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=new Float64Array(g*3*2),i=0;i<o;++i){c[i]=f/3;let d;l===b.GEODESIC?d=a.subdivideLine(t[i],t[(i+1)%o],r,R):l===b.RHUMB&&(d=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,R));let E=d.length;for(let N=0;N<E;++N)n[f++]=d[N]}}o=n.length/(3*2);let m=c.length,u=(o*2+m)*2,h=M.createTypedArray(o+m,u);for(f=0,i=0;i<o;++i)h[f++]=i,h[f++]=(i+1)%o,h[f++]=i+o,h[f++]=(i+1)%o+o;for(i=0;i<m;i++){let g=c[i];h[f++]=g,h[f++]=g+o}return new F({geometry:new C({attributes:new G({position:new v({componentDatatype:w.DOUBLE,componentsPerAttribute:3,values:n})}),indices:h,primitiveType:B.LINES})})}function L(e){if(A.typeOf.object("options",e),A.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&O(e.height))throw new U("Cannot use both options.perPositionHeight and options.height");if(O(e.arcType)&&e.arcType!==b.GEODESIC&&e.arcType!==b.RHUMB)throw new U("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,r=P(e.ellipsoid,y.default),H=P(e.granularity,T.RADIANS_PER_DEGREE),l=P(e.perPositionHeight,!1),_=l&&O(e.extrudedHeight),p=P(e.arcType,b.GEODESIC),s=P(e.height,0),n=P(e.extrudedHeight,s);if(!_){let i=Math.max(s,n);n=Math.min(s,n),s=i}this._ellipsoid=y.clone(r),this._granularity=H,this._height=s,this._extrudedHeight=n,this._arcType=p,this._polygonHierarchy=t,this._perPositionHeight=l,this._perPositionHeightExtrude=_,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=a.computeHierarchyPackedLength(t,S)+y.packedLength+8}L.pack=function(e,t,r){return A.typeOf.object("value",e),A.defined("array",t),r=P(r,0),r=a.packPolygonHierarchy(e._polygonHierarchy,t,r,S),y.pack(e._ellipsoid,t,r),r+=y.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._perPositionHeightExtrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._arcType,t[r++]=P(e._offsetAttribute,-1),t[r]=e.packedLength,t};var J=y.clone(y.UNIT_SPHERE),Q={polygonHierarchy:{}};L.unpack=function(e,t,r){A.defined("array",e),t=P(t,0);let H=a.unpackPolygonHierarchy(e,t,S);t=H.startingIndex,delete H.startingIndex;let l=y.unpack(e,t,J);t+=y.packedLength;let _=e[t++],p=e[t++],s=e[t++],n=e[t++]===1,i=e[t++]===1,o=e[t++],c=e[t++],f=e[t];return O(r)||(r=new L(Q)),r._polygonHierarchy=H,r._ellipsoid=y.clone(l,r._ellipsoid),r._height=_,r._extrudedHeight=p,r._granularity=s,r._perPositionHeight=i,r._perPositionHeightExtrude=n,r._arcType=o,r._offsetAttribute=c===-1?void 0:c,r.packedLength=f,r};L.fromPositions=function(e){e=P(e,P.EMPTY_OBJECT),A.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new L(t)};L.createGeometry=function(e){let t=e._ellipsoid,r=e._granularity,H=e._polygonHierarchy,l=e._perPositionHeight,_=e._arcType,p=a.polygonOutlinesFromHierarchy(H,!l,t);if(p.length===0)return;let s,n=[],i=T.chordLength(r,t.maximumRadius),o=e._height,c=e._extrudedHeight,f=e._perPositionHeightExtrude||!T.equalsEpsilon(o,c,0,T.EPSILON2),m,u;if(f)for(u=0;u<p.length;u++){if(s=q(t,p[u],i,l,_),s.geometry=a.scaleToGeodeticHeightExtruded(s.geometry,o,c,t,l),O(e._offsetAttribute)){let d=s.geometry.attributes.position.values.length/3,E=new Uint8Array(d);e._offsetAttribute===D.TOP?E=E.fill(1,0,d/2):(m=e._offsetAttribute===D.NONE?0:1,E=E.fill(m)),s.geometry.attributes.applyOffset=new v({componentDatatype:w.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}n.push(s)}else for(u=0;u<p.length;u++){if(s=K(t,p[u],i,l,_),s.geometry.attributes.position.values=k.scaleToGeodeticHeight(s.geometry.attributes.position.values,o,t,!l),O(e._offsetAttribute)){let d=s.geometry.attributes.position.values.length;m=e._offsetAttribute===D.NONE?0:1;let E=new Uint8Array(d/3).fill(m);s.geometry.attributes.applyOffset=new v({componentDatatype:w.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}n.push(s)}let h=V.combineInstances(n)[0],g=z.fromVertices(h.attributes.position.values);return new C({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:g,offsetAttribute:e._offsetAttribute})};var x=L;function X(e,t){return O(t)&&(e=x.unpack(e,t)),e._ellipsoid=y.clone(e._ellipsoid),x.createGeometry(e)}var Oe=X;export{Oe as default}; +import{a}from"./chunk-V7BDYEN7.js";import{a as b}from"./chunk-GMMUK6QU.js";import{a as F}from"./chunk-4MYAYFOP.js";import{a as V}from"./chunk-FG3CL3AH.js";import"./chunk-VMXXQ6B4.js";import"./chunk-XCRMBS5M.js";import{a as D}from"./chunk-N5SNKJ43.js";import{a as W}from"./chunk-P73YILG6.js";import"./chunk-VYMAIP2A.js";import{a as j,b as k}from"./chunk-ZMGESOEZ.js";import"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as M}from"./chunk-YFQNY2YN.js";import{a as G}from"./chunk-NT26NNVH.js";import{b as B,c as C,d as v}from"./chunk-NW2YE576.js";import{d as z}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as w}from"./chunk-QHHYYTCM.js";import{a as S,d as y}from"./chunk-RH3GFHG2.js";import{a as T}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as P}from"./chunk-TA3RE4KQ.js";import{a as U,b as A}from"./chunk-RTY3VPG6.js";import{e as O}from"./chunk-LRNH5AEO.js";var Y=[],R=[];function K(e,t,r,H,l){let p=W.fromPoints(t,e).projectPointsOntoPlane(t,Y);k.computeWindingOrder2D(p)===j.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let n,i,o=t.length,c=0;if(H)for(n=new Float64Array(o*2*3),i=0;i<o;i++){let u=t[i],h=t[(i+1)%o];n[c++]=u.x,n[c++]=u.y,n[c++]=u.z,n[c++]=h.x,n[c++]=h.y,n[c++]=h.z}else{let u=0;if(l===b.GEODESIC)for(i=0;i<o;i++)u+=a.subdivideLineCount(t[i],t[(i+1)%o],r);else if(l===b.RHUMB)for(i=0;i<o;i++)u+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=new Float64Array(u*3),i=0;i<o;i++){let h;l===b.GEODESIC?h=a.subdivideLine(t[i],t[(i+1)%o],r,R):l===b.RHUMB&&(h=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,R));let g=h.length;for(let d=0;d<g;++d)n[c++]=h[d]}}o=n.length/3;let f=o*2,m=M.createTypedArray(o,f);for(c=0,i=0;i<o-1;i++)m[c++]=i,m[c++]=i+1;return m[c++]=o-1,m[c++]=0,new F({geometry:new C({attributes:new G({position:new v({componentDatatype:w.DOUBLE,componentsPerAttribute:3,values:n})}),indices:m,primitiveType:B.LINES})})}function q(e,t,r,H,l){let p=W.fromPoints(t,e).projectPointsOntoPlane(t,Y);k.computeWindingOrder2D(p)===j.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let n,i,o=t.length,c=new Array(o),f=0;if(H)for(n=new Float64Array(o*2*3*2),i=0;i<o;++i){c[i]=f/3;let g=t[i],d=t[(i+1)%o];n[f++]=g.x,n[f++]=g.y,n[f++]=g.z,n[f++]=d.x,n[f++]=d.y,n[f++]=d.z}else{let g=0;if(l===b.GEODESIC)for(i=0;i<o;i++)g+=a.subdivideLineCount(t[i],t[(i+1)%o],r);else if(l===b.RHUMB)for(i=0;i<o;i++)g+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=new Float64Array(g*3*2),i=0;i<o;++i){c[i]=f/3;let d;l===b.GEODESIC?d=a.subdivideLine(t[i],t[(i+1)%o],r,R):l===b.RHUMB&&(d=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,R));let E=d.length;for(let N=0;N<E;++N)n[f++]=d[N]}}o=n.length/(3*2);let m=c.length,u=(o*2+m)*2,h=M.createTypedArray(o+m,u);for(f=0,i=0;i<o;++i)h[f++]=i,h[f++]=(i+1)%o,h[f++]=i+o,h[f++]=(i+1)%o+o;for(i=0;i<m;i++){let g=c[i];h[f++]=g,h[f++]=g+o}return new F({geometry:new C({attributes:new G({position:new v({componentDatatype:w.DOUBLE,componentsPerAttribute:3,values:n})}),indices:h,primitiveType:B.LINES})})}function L(e){if(A.typeOf.object("options",e),A.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&O(e.height))throw new U("Cannot use both options.perPositionHeight and options.height");if(O(e.arcType)&&e.arcType!==b.GEODESIC&&e.arcType!==b.RHUMB)throw new U("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,r=P(e.ellipsoid,y.default),H=P(e.granularity,T.RADIANS_PER_DEGREE),l=P(e.perPositionHeight,!1),_=l&&O(e.extrudedHeight),p=P(e.arcType,b.GEODESIC),s=P(e.height,0),n=P(e.extrudedHeight,s);if(!_){let i=Math.max(s,n);n=Math.min(s,n),s=i}this._ellipsoid=y.clone(r),this._granularity=H,this._height=s,this._extrudedHeight=n,this._arcType=p,this._polygonHierarchy=t,this._perPositionHeight=l,this._perPositionHeightExtrude=_,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=a.computeHierarchyPackedLength(t,S)+y.packedLength+8}L.pack=function(e,t,r){return A.typeOf.object("value",e),A.defined("array",t),r=P(r,0),r=a.packPolygonHierarchy(e._polygonHierarchy,t,r,S),y.pack(e._ellipsoid,t,r),r+=y.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._perPositionHeightExtrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._arcType,t[r++]=P(e._offsetAttribute,-1),t[r]=e.packedLength,t};var J=y.clone(y.UNIT_SPHERE),Q={polygonHierarchy:{}};L.unpack=function(e,t,r){A.defined("array",e),t=P(t,0);let H=a.unpackPolygonHierarchy(e,t,S);t=H.startingIndex,delete H.startingIndex;let l=y.unpack(e,t,J);t+=y.packedLength;let _=e[t++],p=e[t++],s=e[t++],n=e[t++]===1,i=e[t++]===1,o=e[t++],c=e[t++],f=e[t];return O(r)||(r=new L(Q)),r._polygonHierarchy=H,r._ellipsoid=y.clone(l,r._ellipsoid),r._height=_,r._extrudedHeight=p,r._granularity=s,r._perPositionHeight=i,r._perPositionHeightExtrude=n,r._arcType=o,r._offsetAttribute=c===-1?void 0:c,r.packedLength=f,r};L.fromPositions=function(e){e=P(e,P.EMPTY_OBJECT),A.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new L(t)};L.createGeometry=function(e){let t=e._ellipsoid,r=e._granularity,H=e._polygonHierarchy,l=e._perPositionHeight,_=e._arcType,p=a.polygonOutlinesFromHierarchy(H,!l,t);if(p.length===0)return;let s,n=[],i=T.chordLength(r,t.maximumRadius),o=e._height,c=e._extrudedHeight,f=e._perPositionHeightExtrude||!T.equalsEpsilon(o,c,0,T.EPSILON2),m,u;if(f)for(u=0;u<p.length;u++){if(s=q(t,p[u],i,l,_),s.geometry=a.scaleToGeodeticHeightExtruded(s.geometry,o,c,t,l),O(e._offsetAttribute)){let d=s.geometry.attributes.position.values.length/3,E=new Uint8Array(d);e._offsetAttribute===D.TOP?E=E.fill(1,0,d/2):(m=e._offsetAttribute===D.NONE?0:1,E=E.fill(m)),s.geometry.attributes.applyOffset=new v({componentDatatype:w.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}n.push(s)}else for(u=0;u<p.length;u++){if(s=K(t,p[u],i,l,_),s.geometry.attributes.position.values=k.scaleToGeodeticHeight(s.geometry.attributes.position.values,o,t,!l),O(e._offsetAttribute)){let d=s.geometry.attributes.position.values.length;m=e._offsetAttribute===D.NONE?0:1;let E=new Uint8Array(d/3).fill(m);s.geometry.attributes.applyOffset=new v({componentDatatype:w.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}n.push(s)}let h=V.combineInstances(n)[0],g=z.fromVertices(h.attributes.position.values);return new C({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:g,offsetAttribute:e._offsetAttribute})};var x=L;function X(e,t){return O(t)&&(e=x.unpack(e,t)),e._ellipsoid=y.clone(e._ellipsoid),x.createGeometry(e)}var Oe=X;export{Oe as default}; diff --git a/public/js/Cesium2/Workers/createPolylineGeometry.js b/public/js/Cesium2/Workers/createPolylineGeometry.js index 43442f7a0..79ce1c6b8 100644 --- a/public/js/Cesium2/Workers/createPolylineGeometry.js +++ b/public/js/Cesium2/Workers/createPolylineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as m}from"./chunk-JXLT7VPX.js";import{a as N}from"./chunk-HQ4YU6WD.js";import{a as U}from"./chunk-RNF7TLFF.js";import"./chunk-E7HC3VTG.js";import{a as k}from"./chunk-6HIVPZ7K.js";import{a as le}from"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as se}from"./chunk-34ULWVZF.js";import{a as ce}from"./chunk-24JYWT5N.js";import{a as ne,b as re,c as ie,d as O}from"./chunk-LH3SUUXG.js";import{d as oe}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as x}from"./chunk-D5HNP2LB.js";import{a as p,d as u}from"./chunk-S4VBGY2U.js";import{a as J}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as A}from"./chunk-N3A5CZ2S.js";import{a as V}from"./chunk-G75U3WZT.js";import{e as h}from"./chunk-3THTQ4QB.js";var me=[];function Ae(e,o,t,n,c){let s=me;s.length=c;let l,E=t.red,a=t.green,r=t.blue,w=t.alpha,b=n.red,i=n.green,f=n.blue,L=n.alpha;if(m.equals(t,n)){for(l=0;l<c;l++)s[l]=m.clone(t);return s}let M=(b-E)/c,z=(i-a)/c,H=(f-r)/c,B=(L-w)/c;for(l=0;l<c;l++)s[l]=new m(E+l*M,a+l*z,r+l*H,w+l*B);return s}function G(e){e=A(e,A.EMPTY_OBJECT);let o=e.positions,t=e.colors,n=A(e.width,1),c=A(e.colorsPerVertex,!1);if(!h(o)||o.length<2)throw new V("At least two positions are required.");if(typeof n!="number")throw new V("width must be a number");if(h(t)&&(c&&t.length<o.length||!c&&t.length<o.length-1))throw new V("colors has an invalid length.");this._positions=o,this._colors=t,this._width=n,this._colorsPerVertex=c,this._vertexFormat=k.clone(A(e.vertexFormat,k.DEFAULT)),this._arcType=A(e.arcType,N.GEODESIC),this._granularity=A(e.granularity,J.RADIANS_PER_DEGREE),this._ellipsoid=u.clone(A(e.ellipsoid,u.default)),this._workerName="createPolylineGeometry";let s=1+o.length*p.packedLength;s+=h(t)?1+t.length*m.packedLength:1,this.packedLength=s+u.packedLength+k.packedLength+4}G.pack=function(e,o,t){if(!h(e))throw new V("value is required");if(!h(o))throw new V("array is required");t=A(t,0);let n,c=e._positions,s=c.length;for(o[t++]=s,n=0;n<s;++n,t+=p.packedLength)p.pack(c[n],o,t);let l=e._colors;for(s=h(l)?l.length:0,o[t++]=s,n=0;n<s;++n,t+=m.packedLength)m.pack(l[n],o,t);return u.pack(e._ellipsoid,o,t),t+=u.packedLength,k.pack(e._vertexFormat,o,t),t+=k.packedLength,o[t++]=e._width,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o};var de=u.clone(u.UNIT_SPHERE),ue=new k,S={positions:void 0,colors:void 0,ellipsoid:de,vertexFormat:ue,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};G.unpack=function(e,o,t){if(!h(e))throw new V("array is required");o=A(o,0);let n,c=e[o++],s=new Array(c);for(n=0;n<c;++n,o+=p.packedLength)s[n]=p.unpack(e,o);c=e[o++];let l=c>0?new Array(c):void 0;for(n=0;n<c;++n,o+=m.packedLength)l[n]=m.unpack(e,o);let E=u.unpack(e,o,de);o+=u.packedLength;let a=k.unpack(e,o,ue);o+=k.packedLength;let r=e[o++],w=e[o++]===1,b=e[o++],i=e[o];return h(t)?(t._positions=s,t._colors=l,t._ellipsoid=u.clone(E,t._ellipsoid),t._vertexFormat=k.clone(a,t._vertexFormat),t._width=r,t._colorsPerVertex=w,t._arcType=b,t._granularity=i,t):(S.positions=s,S.colors=l,S.width=r,S.colorsPerVertex=w,S.arcType=b,S.granularity=i,new G(S))};var pe=new p,ae=new p,fe=new p,he=new p;G.createGeometry=function(e){let o=e._width,t=e._vertexFormat,n=e._colors,c=e._colorsPerVertex,s=e._arcType,l=e._granularity,E=e._ellipsoid,a,r,w,b=[],i=le(e._positions,p.equalsEpsilon,!1,b);if(h(n)&&b.length>0){let d=0,P=b[0];n=n.filter(function(q,T){let g=!1;return c?g=T===P||T===0&&P===1:g=T+1===P,g?(d++,P=b[d],!1):!0})}let f=i.length;if(f<2||o<=0)return;if(s===N.GEODESIC||s===N.RHUMB){let d,P;s===N.GEODESIC?(d=J.chordLength(l,E.maximumRadius),P=U.numberOfPoints):(d=l,P=U.numberOfPointsRhumbLine);let q=U.extractHeights(i,E);if(h(n)){let T=1;for(a=0;a<f-1;++a)T+=P(i[a],i[a+1],d);let g=new Array(T),D=0;for(a=0;a<f-1;++a){let Z=i[a],$=i[a+1],I=n[a],ee=P(Z,$,d);if(c&&a<T){let _e=n[a+1],te=Ae(Z,$,I,_e,ee),Pe=te.length;for(r=0;r<Pe;++r)g[D++]=te[r]}else for(r=0;r<ee;++r)g[D++]=m.clone(I)}g[D]=m.clone(n[n.length-1]),n=g,me.length=0}s===N.GEODESIC?i=U.generateCartesianArc({positions:i,minDistance:d,ellipsoid:E,height:q}):i=U.generateCartesianRhumbArc({positions:i,granularity:d,ellipsoid:E,height:q})}f=i.length;let L=f*4-4,M=new Float64Array(L*3),z=new Float64Array(L*3),H=new Float64Array(L*3),B=new Float32Array(L*2),K=t.st?new Float32Array(L*2):void 0,y=h(n)?new Uint8Array(L*4):void 0,W=0,j=0,X=0,Y=0,_;for(r=0;r<f;++r){r===0?(_=pe,p.subtract(i[0],i[1],_),p.add(i[0],_,_)):_=i[r-1],p.clone(_,fe),p.clone(i[r],ae),r===f-1?(_=pe,p.subtract(i[f-1],i[f-2],_),p.add(i[f-1],_,_)):_=i[r+1],p.clone(_,he);let d,P;h(y)&&(r!==0&&!c?d=n[r-1]:d=n[r],r!==f-1&&(P=n[r]));let q=r===0?2:0,T=r===f-1?2:4;for(w=q;w<T;++w){p.pack(ae,M,W),p.pack(fe,z,W),p.pack(he,H,W),W+=3;let g=w-2<0?-1:1;if(B[j++]=2*(w%2)-1,B[j++]=g*o,t.st&&(K[X++]=r/(f-1),K[X++]=Math.max(B[j-2],0)),h(y)){let D=w<2?d:P;y[Y++]=m.floatToByte(D.red),y[Y++]=m.floatToByte(D.green),y[Y++]=m.floatToByte(D.blue),y[Y++]=m.floatToByte(D.alpha)}}}let v=new ce;v.position=new O({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:M}),v.prevPosition=new O({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:z}),v.nextPosition=new O({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:H}),v.expandAndWidth=new O({componentDatatype:x.FLOAT,componentsPerAttribute:2,values:B}),t.st&&(v.st=new O({componentDatatype:x.FLOAT,componentsPerAttribute:2,values:K})),h(y)&&(v.color=new O({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:4,values:y,normalize:!0}));let C=se.createTypedArray(L,f*6-6),F=0,R=0,we=f-1;for(r=0;r<we;++r)C[R++]=F,C[R++]=F+2,C[R++]=F+1,C[R++]=F+1,C[R++]=F+2,C[R++]=F+3,F+=4;return new ie({attributes:v,indices:C,primitiveType:re.TRIANGLES,boundingSphere:oe.fromPoints(i),geometryType:ne.POLYLINES})};var Q=G;function ge(e,o){return h(o)&&(e=Q.unpack(e,o)),e._ellipsoid=u.clone(e._ellipsoid),Q.createGeometry(e)}var We=ge;export{We as default}; +import{a as m}from"./chunk-H2CDK6OB.js";import{a as N}from"./chunk-GMMUK6QU.js";import{a as U}from"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import{a as k}from"./chunk-6VK5R74O.js";import{a as le}from"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as se}from"./chunk-YFQNY2YN.js";import{a as ce}from"./chunk-NT26NNVH.js";import{a as ne,b as re,c as ie,d as O}from"./chunk-NW2YE576.js";import{d as oe}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as x}from"./chunk-QHHYYTCM.js";import{a as p,d as u}from"./chunk-RH3GFHG2.js";import{a as J}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as A}from"./chunk-TA3RE4KQ.js";import{a as V}from"./chunk-RTY3VPG6.js";import{e as h}from"./chunk-LRNH5AEO.js";var me=[];function Ae(e,o,t,n,c){let s=me;s.length=c;let l,E=t.red,a=t.green,r=t.blue,w=t.alpha,b=n.red,i=n.green,f=n.blue,L=n.alpha;if(m.equals(t,n)){for(l=0;l<c;l++)s[l]=m.clone(t);return s}let M=(b-E)/c,z=(i-a)/c,H=(f-r)/c,B=(L-w)/c;for(l=0;l<c;l++)s[l]=new m(E+l*M,a+l*z,r+l*H,w+l*B);return s}function G(e){e=A(e,A.EMPTY_OBJECT);let o=e.positions,t=e.colors,n=A(e.width,1),c=A(e.colorsPerVertex,!1);if(!h(o)||o.length<2)throw new V("At least two positions are required.");if(typeof n!="number")throw new V("width must be a number");if(h(t)&&(c&&t.length<o.length||!c&&t.length<o.length-1))throw new V("colors has an invalid length.");this._positions=o,this._colors=t,this._width=n,this._colorsPerVertex=c,this._vertexFormat=k.clone(A(e.vertexFormat,k.DEFAULT)),this._arcType=A(e.arcType,N.GEODESIC),this._granularity=A(e.granularity,J.RADIANS_PER_DEGREE),this._ellipsoid=u.clone(A(e.ellipsoid,u.default)),this._workerName="createPolylineGeometry";let s=1+o.length*p.packedLength;s+=h(t)?1+t.length*m.packedLength:1,this.packedLength=s+u.packedLength+k.packedLength+4}G.pack=function(e,o,t){if(!h(e))throw new V("value is required");if(!h(o))throw new V("array is required");t=A(t,0);let n,c=e._positions,s=c.length;for(o[t++]=s,n=0;n<s;++n,t+=p.packedLength)p.pack(c[n],o,t);let l=e._colors;for(s=h(l)?l.length:0,o[t++]=s,n=0;n<s;++n,t+=m.packedLength)m.pack(l[n],o,t);return u.pack(e._ellipsoid,o,t),t+=u.packedLength,k.pack(e._vertexFormat,o,t),t+=k.packedLength,o[t++]=e._width,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o};var de=u.clone(u.UNIT_SPHERE),ue=new k,S={positions:void 0,colors:void 0,ellipsoid:de,vertexFormat:ue,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};G.unpack=function(e,o,t){if(!h(e))throw new V("array is required");o=A(o,0);let n,c=e[o++],s=new Array(c);for(n=0;n<c;++n,o+=p.packedLength)s[n]=p.unpack(e,o);c=e[o++];let l=c>0?new Array(c):void 0;for(n=0;n<c;++n,o+=m.packedLength)l[n]=m.unpack(e,o);let E=u.unpack(e,o,de);o+=u.packedLength;let a=k.unpack(e,o,ue);o+=k.packedLength;let r=e[o++],w=e[o++]===1,b=e[o++],i=e[o];return h(t)?(t._positions=s,t._colors=l,t._ellipsoid=u.clone(E,t._ellipsoid),t._vertexFormat=k.clone(a,t._vertexFormat),t._width=r,t._colorsPerVertex=w,t._arcType=b,t._granularity=i,t):(S.positions=s,S.colors=l,S.width=r,S.colorsPerVertex=w,S.arcType=b,S.granularity=i,new G(S))};var pe=new p,ae=new p,fe=new p,he=new p;G.createGeometry=function(e){let o=e._width,t=e._vertexFormat,n=e._colors,c=e._colorsPerVertex,s=e._arcType,l=e._granularity,E=e._ellipsoid,a,r,w,b=[],i=le(e._positions,p.equalsEpsilon,!1,b);if(h(n)&&b.length>0){let d=0,P=b[0];n=n.filter(function(q,T){let g=!1;return c?g=T===P||T===0&&P===1:g=T+1===P,g?(d++,P=b[d],!1):!0})}let f=i.length;if(f<2||o<=0)return;if(s===N.GEODESIC||s===N.RHUMB){let d,P;s===N.GEODESIC?(d=J.chordLength(l,E.maximumRadius),P=U.numberOfPoints):(d=l,P=U.numberOfPointsRhumbLine);let q=U.extractHeights(i,E);if(h(n)){let T=1;for(a=0;a<f-1;++a)T+=P(i[a],i[a+1],d);let g=new Array(T),D=0;for(a=0;a<f-1;++a){let Z=i[a],$=i[a+1],I=n[a],ee=P(Z,$,d);if(c&&a<T){let _e=n[a+1],te=Ae(Z,$,I,_e,ee),Pe=te.length;for(r=0;r<Pe;++r)g[D++]=te[r]}else for(r=0;r<ee;++r)g[D++]=m.clone(I)}g[D]=m.clone(n[n.length-1]),n=g,me.length=0}s===N.GEODESIC?i=U.generateCartesianArc({positions:i,minDistance:d,ellipsoid:E,height:q}):i=U.generateCartesianRhumbArc({positions:i,granularity:d,ellipsoid:E,height:q})}f=i.length;let L=f*4-4,M=new Float64Array(L*3),z=new Float64Array(L*3),H=new Float64Array(L*3),B=new Float32Array(L*2),K=t.st?new Float32Array(L*2):void 0,y=h(n)?new Uint8Array(L*4):void 0,W=0,j=0,X=0,Y=0,_;for(r=0;r<f;++r){r===0?(_=pe,p.subtract(i[0],i[1],_),p.add(i[0],_,_)):_=i[r-1],p.clone(_,fe),p.clone(i[r],ae),r===f-1?(_=pe,p.subtract(i[f-1],i[f-2],_),p.add(i[f-1],_,_)):_=i[r+1],p.clone(_,he);let d,P;h(y)&&(r!==0&&!c?d=n[r-1]:d=n[r],r!==f-1&&(P=n[r]));let q=r===0?2:0,T=r===f-1?2:4;for(w=q;w<T;++w){p.pack(ae,M,W),p.pack(fe,z,W),p.pack(he,H,W),W+=3;let g=w-2<0?-1:1;if(B[j++]=2*(w%2)-1,B[j++]=g*o,t.st&&(K[X++]=r/(f-1),K[X++]=Math.max(B[j-2],0)),h(y)){let D=w<2?d:P;y[Y++]=m.floatToByte(D.red),y[Y++]=m.floatToByte(D.green),y[Y++]=m.floatToByte(D.blue),y[Y++]=m.floatToByte(D.alpha)}}}let v=new ce;v.position=new O({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:M}),v.prevPosition=new O({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:z}),v.nextPosition=new O({componentDatatype:x.DOUBLE,componentsPerAttribute:3,values:H}),v.expandAndWidth=new O({componentDatatype:x.FLOAT,componentsPerAttribute:2,values:B}),t.st&&(v.st=new O({componentDatatype:x.FLOAT,componentsPerAttribute:2,values:K})),h(y)&&(v.color=new O({componentDatatype:x.UNSIGNED_BYTE,componentsPerAttribute:4,values:y,normalize:!0}));let C=se.createTypedArray(L,f*6-6),F=0,R=0,we=f-1;for(r=0;r<we;++r)C[R++]=F,C[R++]=F+2,C[R++]=F+1,C[R++]=F+1,C[R++]=F+2,C[R++]=F+3,F+=4;return new ie({attributes:v,indices:C,primitiveType:re.TRIANGLES,boundingSphere:oe.fromPoints(i),geometryType:ne.POLYLINES})};var Q=G;function ge(e,o){return h(o)&&(e=Q.unpack(e,o)),e._ellipsoid=u.clone(e._ellipsoid),Q.createGeometry(e)}var We=ge;export{We as default}; diff --git a/public/js/Cesium2/Workers/createPolylineVolumeGeometry.js b/public/js/Cesium2/Workers/createPolylineVolumeGeometry.js index f8c71a793..2b33367e0 100644 --- a/public/js/Cesium2/Workers/createPolylineVolumeGeometry.js +++ b/public/js/Cesium2/Workers/createPolylineVolumeGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as M}from"./chunk-PJUDOIE3.js";import{a as W}from"./chunk-72CGGEJF.js";import"./chunk-Q5MYX5A2.js";import"./chunk-OZYLWM74.js";import{a as x,b as I,c as j}from"./chunk-G72WI3OZ.js";import"./chunk-RNF7TLFF.js";import"./chunk-E7HC3VTG.js";import{a as g}from"./chunk-6HIVPZ7K.js";import"./chunk-CTRWX4F5.js";import"./chunk-Z7BLUZ7R.js";import{a as $,b as V}from"./chunk-WJYW7YDO.js";import{a as Z}from"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as X}from"./chunk-34ULWVZF.js";import{a as Q}from"./chunk-24JYWT5N.js";import{b as Y,c as z,d as U}from"./chunk-LH3SUUXG.js";import{d as K}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as B}from"./chunk-D5HNP2LB.js";import{a as T,c as C,d as f}from"./chunk-S4VBGY2U.js";import{a as J}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as k}from"./chunk-N3A5CZ2S.js";import{a as D}from"./chunk-G75U3WZT.js";import{e as _}from"./chunk-3THTQ4QB.js";function oe(t,e,n,o){let l=new Q;o.position&&(l.position=new U({componentDatatype:B.DOUBLE,componentsPerAttribute:3,values:t}));let i=e.length,u=t.length/3,L=(u-i*2)/(i*2),E=V.triangulate(e),q=(L-1)*i*6+E.length*2,r=X.createTypedArray(u,q),m,s,d,b,A,F,G=i*2,p=0;for(m=0;m<L-1;m++){for(s=0;s<i-1;s++)d=s*2+m*i*2,F=d+G,b=d+1,A=b+G,r[p++]=b,r[p++]=d,r[p++]=A,r[p++]=A,r[p++]=d,r[p++]=F;d=i*2-2+m*i*2,b=d+1,A=b+G,F=d+G,r[p++]=b,r[p++]=d,r[p++]=A,r[p++]=A,r[p++]=d,r[p++]=F}if(o.st||o.tangent||o.bitangent){let c=new Float32Array(u*2),O=1/(L-1),w=1/n.height,S=n.height/2,y,a,h=0;for(m=0;m<L;m++){for(y=m*O,a=w*(e[0].y+S),c[h++]=y,c[h++]=a,s=1;s<i;s++)a=w*(e[s].y+S),c[h++]=y,c[h++]=a,c[h++]=y,c[h++]=a;a=w*(e[0].y+S),c[h++]=y,c[h++]=a}for(s=0;s<i;s++)y=0,a=w*(e[s].y+S),c[h++]=y,c[h++]=a;for(s=0;s<i;s++)y=(L-1)*O,a=w*(e[s].y+S),c[h++]=y,c[h++]=a;l.st=new U({componentDatatype:B.FLOAT,componentsPerAttribute:2,values:new Float32Array(c)})}let N=u-i*2;for(m=0;m<E.length;m+=3){let c=E[m]+N,O=E[m+1]+N,w=E[m+2]+N;r[p++]=c,r[p++]=O,r[p++]=w,r[p++]=w+i,r[p++]=O+i,r[p++]=c+i}let P=new z({attributes:l,indices:r,boundingSphere:K.fromVertices(t),primitiveType:Y.TRIANGLES});if(o.normal&&(P=W.computeNormal(P)),o.tangent||o.bitangent){try{P=W.computeTangentAndBitangent(P)}catch{I("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(P.attributes.tangent=void 0),o.bitangent||(P.attributes.bitangent=void 0),o.st||(P.attributes.st=void 0)}return P}function R(t){t=k(t,k.EMPTY_OBJECT);let e=t.polylinePositions,n=t.shapePositions;if(!_(e))throw new D("options.polylinePositions is required.");if(!_(n))throw new D("options.shapePositions is required.");this._positions=e,this._shape=n,this._ellipsoid=f.clone(k(t.ellipsoid,f.default)),this._cornerType=k(t.cornerType,x.ROUNDED),this._vertexFormat=g.clone(k(t.vertexFormat,g.DEFAULT)),this._granularity=k(t.granularity,J.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let o=1+e.length*T.packedLength;o+=1+n.length*C.packedLength,this.packedLength=o+f.packedLength+g.packedLength+2}R.pack=function(t,e,n){if(!_(t))throw new D("value is required");if(!_(e))throw new D("array is required");n=k(n,0);let o,l=t._positions,i=l.length;for(e[n++]=i,o=0;o<i;++o,n+=T.packedLength)T.pack(l[o],e,n);let u=t._shape;for(i=u.length,e[n++]=i,o=0;o<i;++o,n+=C.packedLength)C.pack(u[o],e,n);return f.pack(t._ellipsoid,e,n),n+=f.packedLength,g.pack(t._vertexFormat,e,n),n+=g.packedLength,e[n++]=t._cornerType,e[n]=t._granularity,e};var ee=f.clone(f.UNIT_SPHERE),te=new g,v={polylinePositions:void 0,shapePositions:void 0,ellipsoid:ee,vertexFormat:te,cornerType:void 0,granularity:void 0};R.unpack=function(t,e,n){if(!_(t))throw new D("array is required");e=k(e,0);let o,l=t[e++],i=new Array(l);for(o=0;o<l;++o,e+=T.packedLength)i[o]=T.unpack(t,e);l=t[e++];let u=new Array(l);for(o=0;o<l;++o,e+=C.packedLength)u[o]=C.unpack(t,e);let L=f.unpack(t,e,ee);e+=f.packedLength;let E=g.unpack(t,e,te);e+=g.packedLength;let q=t[e++],r=t[e];return _(n)?(n._positions=i,n._shape=u,n._ellipsoid=f.clone(L,n._ellipsoid),n._vertexFormat=g.clone(E,n._vertexFormat),n._cornerType=q,n._granularity=r,n):(v.polylinePositions=i,v.shapePositions=u,v.cornerType=q,v.granularity=r,new R(v))};var ne=new M;R.createGeometry=function(t){let e=t._positions,n=Z(e,T.equalsEpsilon),o=t._shape;if(o=j.removeDuplicatesFromShape(o),n.length<2||o.length<3)return;V.computeWindingOrder2D(o)===$.CLOCKWISE&&o.reverse();let l=M.fromPoints(o,ne),i=j.computePositions(n,o,l,t,!0);return oe(i,o,l,t._vertexFormat)};var H=R;function ie(t,e){return _(e)&&(t=H.unpack(t,e)),t._ellipsoid=f.clone(t._ellipsoid),H.createGeometry(t)}var Re=ie;export{Re as default}; +import{a as M}from"./chunk-DKG6YEMN.js";import{a as W}from"./chunk-FG3CL3AH.js";import"./chunk-VMXXQ6B4.js";import"./chunk-XCRMBS5M.js";import{a as x,b as I,c as j}from"./chunk-VMIASSRO.js";import"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import{a as g}from"./chunk-6VK5R74O.js";import"./chunk-P73YILG6.js";import"./chunk-VYMAIP2A.js";import{a as $,b as V}from"./chunk-ZMGESOEZ.js";import{a as Z}from"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as X}from"./chunk-YFQNY2YN.js";import{a as Q}from"./chunk-NT26NNVH.js";import{b as Y,c as z,d as U}from"./chunk-NW2YE576.js";import{d as K}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as B}from"./chunk-QHHYYTCM.js";import{a as T,c as C,d as f}from"./chunk-RH3GFHG2.js";import{a as J}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as k}from"./chunk-TA3RE4KQ.js";import{a as D}from"./chunk-RTY3VPG6.js";import{e as _}from"./chunk-LRNH5AEO.js";function oe(t,e,n,o){let l=new Q;o.position&&(l.position=new U({componentDatatype:B.DOUBLE,componentsPerAttribute:3,values:t}));let i=e.length,u=t.length/3,L=(u-i*2)/(i*2),E=V.triangulate(e),q=(L-1)*i*6+E.length*2,r=X.createTypedArray(u,q),m,s,d,b,A,F,G=i*2,p=0;for(m=0;m<L-1;m++){for(s=0;s<i-1;s++)d=s*2+m*i*2,F=d+G,b=d+1,A=b+G,r[p++]=b,r[p++]=d,r[p++]=A,r[p++]=A,r[p++]=d,r[p++]=F;d=i*2-2+m*i*2,b=d+1,A=b+G,F=d+G,r[p++]=b,r[p++]=d,r[p++]=A,r[p++]=A,r[p++]=d,r[p++]=F}if(o.st||o.tangent||o.bitangent){let c=new Float32Array(u*2),O=1/(L-1),w=1/n.height,S=n.height/2,y,a,h=0;for(m=0;m<L;m++){for(y=m*O,a=w*(e[0].y+S),c[h++]=y,c[h++]=a,s=1;s<i;s++)a=w*(e[s].y+S),c[h++]=y,c[h++]=a,c[h++]=y,c[h++]=a;a=w*(e[0].y+S),c[h++]=y,c[h++]=a}for(s=0;s<i;s++)y=0,a=w*(e[s].y+S),c[h++]=y,c[h++]=a;for(s=0;s<i;s++)y=(L-1)*O,a=w*(e[s].y+S),c[h++]=y,c[h++]=a;l.st=new U({componentDatatype:B.FLOAT,componentsPerAttribute:2,values:new Float32Array(c)})}let N=u-i*2;for(m=0;m<E.length;m+=3){let c=E[m]+N,O=E[m+1]+N,w=E[m+2]+N;r[p++]=c,r[p++]=O,r[p++]=w,r[p++]=w+i,r[p++]=O+i,r[p++]=c+i}let P=new z({attributes:l,indices:r,boundingSphere:K.fromVertices(t),primitiveType:Y.TRIANGLES});if(o.normal&&(P=W.computeNormal(P)),o.tangent||o.bitangent){try{P=W.computeTangentAndBitangent(P)}catch{I("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(P.attributes.tangent=void 0),o.bitangent||(P.attributes.bitangent=void 0),o.st||(P.attributes.st=void 0)}return P}function R(t){t=k(t,k.EMPTY_OBJECT);let e=t.polylinePositions,n=t.shapePositions;if(!_(e))throw new D("options.polylinePositions is required.");if(!_(n))throw new D("options.shapePositions is required.");this._positions=e,this._shape=n,this._ellipsoid=f.clone(k(t.ellipsoid,f.default)),this._cornerType=k(t.cornerType,x.ROUNDED),this._vertexFormat=g.clone(k(t.vertexFormat,g.DEFAULT)),this._granularity=k(t.granularity,J.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let o=1+e.length*T.packedLength;o+=1+n.length*C.packedLength,this.packedLength=o+f.packedLength+g.packedLength+2}R.pack=function(t,e,n){if(!_(t))throw new D("value is required");if(!_(e))throw new D("array is required");n=k(n,0);let o,l=t._positions,i=l.length;for(e[n++]=i,o=0;o<i;++o,n+=T.packedLength)T.pack(l[o],e,n);let u=t._shape;for(i=u.length,e[n++]=i,o=0;o<i;++o,n+=C.packedLength)C.pack(u[o],e,n);return f.pack(t._ellipsoid,e,n),n+=f.packedLength,g.pack(t._vertexFormat,e,n),n+=g.packedLength,e[n++]=t._cornerType,e[n]=t._granularity,e};var ee=f.clone(f.UNIT_SPHERE),te=new g,v={polylinePositions:void 0,shapePositions:void 0,ellipsoid:ee,vertexFormat:te,cornerType:void 0,granularity:void 0};R.unpack=function(t,e,n){if(!_(t))throw new D("array is required");e=k(e,0);let o,l=t[e++],i=new Array(l);for(o=0;o<l;++o,e+=T.packedLength)i[o]=T.unpack(t,e);l=t[e++];let u=new Array(l);for(o=0;o<l;++o,e+=C.packedLength)u[o]=C.unpack(t,e);let L=f.unpack(t,e,ee);e+=f.packedLength;let E=g.unpack(t,e,te);e+=g.packedLength;let q=t[e++],r=t[e];return _(n)?(n._positions=i,n._shape=u,n._ellipsoid=f.clone(L,n._ellipsoid),n._vertexFormat=g.clone(E,n._vertexFormat),n._cornerType=q,n._granularity=r,n):(v.polylinePositions=i,v.shapePositions=u,v.cornerType=q,v.granularity=r,new R(v))};var ne=new M;R.createGeometry=function(t){let e=t._positions,n=Z(e,T.equalsEpsilon),o=t._shape;if(o=j.removeDuplicatesFromShape(o),n.length<2||o.length<3)return;V.computeWindingOrder2D(o)===$.CLOCKWISE&&o.reverse();let l=M.fromPoints(o,ne),i=j.computePositions(n,o,l,t,!0);return oe(i,o,l,t._vertexFormat)};var H=R;function ie(t,e){return _(e)&&(t=H.unpack(t,e)),t._ellipsoid=f.clone(t._ellipsoid),H.createGeometry(t)}var Re=ie;export{Re as default}; diff --git a/public/js/Cesium2/Workers/createPolylineVolumeOutlineGeometry.js b/public/js/Cesium2/Workers/createPolylineVolumeOutlineGeometry.js index e42b0e15f..b485572d1 100644 --- a/public/js/Cesium2/Workers/createPolylineVolumeOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createPolylineVolumeOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as w}from"./chunk-PJUDOIE3.js";import{a as N,c as E}from"./chunk-G72WI3OZ.js";import"./chunk-RNF7TLFF.js";import"./chunk-E7HC3VTG.js";import"./chunk-CTRWX4F5.js";import"./chunk-Z7BLUZ7R.js";import{a as v,b as G}from"./chunk-WJYW7YDO.js";import{a as q}from"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as k}from"./chunk-34ULWVZF.js";import{a as O}from"./chunk-24JYWT5N.js";import{b as A,c as R,d as S}from"./chunk-LH3SUUXG.js";import{d as C}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as b}from"./chunk-D5HNP2LB.js";import{a,c as _,d as s}from"./chunk-S4VBGY2U.js";import{a as D}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as d}from"./chunk-N3A5CZ2S.js";import{a as y}from"./chunk-G75U3WZT.js";import{e as u}from"./chunk-3THTQ4QB.js";function W(o,i){let t=new O;t.position=new S({componentDatatype:b.DOUBLE,componentsPerAttribute:3,values:o});let e=i.length,r=t.position.values.length/3,f=o.length/3/e,p=k.createTypedArray(r,2*e*(f+1)),m,n,l=0;m=0;let h=m*e;for(n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=f-1,h=m*e,n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=0;m<f-1;m++){let T=e*m,U=T+e;for(n=0;n<e;n++)p[l++]=n+T,p[l++]=n+U}return new R({attributes:t,indices:k.createTypedArray(r,p),boundingSphere:C.fromVertices(o),primitiveType:A.LINES})}function g(o){o=d(o,d.EMPTY_OBJECT);let i=o.polylinePositions,t=o.shapePositions;if(!u(i))throw new y("options.polylinePositions is required.");if(!u(t))throw new y("options.shapePositions is required.");this._positions=i,this._shape=t,this._ellipsoid=s.clone(d(o.ellipsoid,s.default)),this._cornerType=d(o.cornerType,N.ROUNDED),this._granularity=d(o.granularity,D.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let e=1+i.length*a.packedLength;e+=1+t.length*_.packedLength,this.packedLength=e+s.packedLength+2}g.pack=function(o,i,t){if(!u(o))throw new y("value is required");if(!u(i))throw new y("array is required");t=d(t,0);let e,r=o._positions,c=r.length;for(i[t++]=c,e=0;e<c;++e,t+=a.packedLength)a.pack(r[e],i,t);let f=o._shape;for(c=f.length,i[t++]=c,e=0;e<c;++e,t+=_.packedLength)_.pack(f[e],i,t);return s.pack(o._ellipsoid,i,t),t+=s.packedLength,i[t++]=o._cornerType,i[t]=o._granularity,i};var B=s.clone(s.UNIT_SPHERE),P={polylinePositions:void 0,shapePositions:void 0,ellipsoid:B,height:void 0,cornerType:void 0,granularity:void 0};g.unpack=function(o,i,t){if(!u(o))throw new y("array is required");i=d(i,0);let e,r=o[i++],c=new Array(r);for(e=0;e<r;++e,i+=a.packedLength)c[e]=a.unpack(o,i);r=o[i++];let f=new Array(r);for(e=0;e<r;++e,i+=_.packedLength)f[e]=_.unpack(o,i);let p=s.unpack(o,i,B);i+=s.packedLength;let m=o[i++],n=o[i];return u(t)?(t._positions=c,t._shape=f,t._ellipsoid=s.clone(p,t._ellipsoid),t._cornerType=m,t._granularity=n,t):(P.polylinePositions=c,P.shapePositions=f,P.cornerType=m,P.granularity=n,new g(P))};var M=new w;g.createGeometry=function(o){let i=o._positions,t=q(i,a.equalsEpsilon),e=o._shape;if(e=E.removeDuplicatesFromShape(e),t.length<2||e.length<3)return;G.computeWindingOrder2D(e)===v.CLOCKWISE&&e.reverse();let r=w.fromPoints(e,M),c=E.computePositions(t,e,r,o,!1);return W(c,e)};var L=g;function j(o,i){return u(i)&&(o=L.unpack(o,i)),o._ellipsoid=s.clone(o._ellipsoid),L.createGeometry(o)}var he=j;export{he as default}; +import{a as w}from"./chunk-DKG6YEMN.js";import{a as N,c as E}from"./chunk-VMIASSRO.js";import"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import"./chunk-P73YILG6.js";import"./chunk-VYMAIP2A.js";import{a as v,b as G}from"./chunk-ZMGESOEZ.js";import{a as q}from"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as k}from"./chunk-YFQNY2YN.js";import{a as O}from"./chunk-NT26NNVH.js";import{b as A,c as R,d as S}from"./chunk-NW2YE576.js";import{d as C}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as b}from"./chunk-QHHYYTCM.js";import{a,c as _,d as s}from"./chunk-RH3GFHG2.js";import{a as D}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as d}from"./chunk-TA3RE4KQ.js";import{a as y}from"./chunk-RTY3VPG6.js";import{e as u}from"./chunk-LRNH5AEO.js";function W(o,i){let t=new O;t.position=new S({componentDatatype:b.DOUBLE,componentsPerAttribute:3,values:o});let e=i.length,r=t.position.values.length/3,f=o.length/3/e,p=k.createTypedArray(r,2*e*(f+1)),m,n,l=0;m=0;let h=m*e;for(n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=f-1,h=m*e,n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=0;m<f-1;m++){let T=e*m,U=T+e;for(n=0;n<e;n++)p[l++]=n+T,p[l++]=n+U}return new R({attributes:t,indices:k.createTypedArray(r,p),boundingSphere:C.fromVertices(o),primitiveType:A.LINES})}function g(o){o=d(o,d.EMPTY_OBJECT);let i=o.polylinePositions,t=o.shapePositions;if(!u(i))throw new y("options.polylinePositions is required.");if(!u(t))throw new y("options.shapePositions is required.");this._positions=i,this._shape=t,this._ellipsoid=s.clone(d(o.ellipsoid,s.default)),this._cornerType=d(o.cornerType,N.ROUNDED),this._granularity=d(o.granularity,D.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let e=1+i.length*a.packedLength;e+=1+t.length*_.packedLength,this.packedLength=e+s.packedLength+2}g.pack=function(o,i,t){if(!u(o))throw new y("value is required");if(!u(i))throw new y("array is required");t=d(t,0);let e,r=o._positions,c=r.length;for(i[t++]=c,e=0;e<c;++e,t+=a.packedLength)a.pack(r[e],i,t);let f=o._shape;for(c=f.length,i[t++]=c,e=0;e<c;++e,t+=_.packedLength)_.pack(f[e],i,t);return s.pack(o._ellipsoid,i,t),t+=s.packedLength,i[t++]=o._cornerType,i[t]=o._granularity,i};var B=s.clone(s.UNIT_SPHERE),P={polylinePositions:void 0,shapePositions:void 0,ellipsoid:B,height:void 0,cornerType:void 0,granularity:void 0};g.unpack=function(o,i,t){if(!u(o))throw new y("array is required");i=d(i,0);let e,r=o[i++],c=new Array(r);for(e=0;e<r;++e,i+=a.packedLength)c[e]=a.unpack(o,i);r=o[i++];let f=new Array(r);for(e=0;e<r;++e,i+=_.packedLength)f[e]=_.unpack(o,i);let p=s.unpack(o,i,B);i+=s.packedLength;let m=o[i++],n=o[i];return u(t)?(t._positions=c,t._shape=f,t._ellipsoid=s.clone(p,t._ellipsoid),t._cornerType=m,t._granularity=n,t):(P.polylinePositions=c,P.shapePositions=f,P.cornerType=m,P.granularity=n,new g(P))};var M=new w;g.createGeometry=function(o){let i=o._positions,t=q(i,a.equalsEpsilon),e=o._shape;if(e=E.removeDuplicatesFromShape(e),t.length<2||e.length<3)return;G.computeWindingOrder2D(e)===v.CLOCKWISE&&e.reverse();let r=w.fromPoints(e,M),c=E.computePositions(t,e,r,o,!1);return W(c,e)};var L=g;function j(o,i){return u(i)&&(o=L.unpack(o,i)),o._ellipsoid=s.clone(o._ellipsoid),L.createGeometry(o)}var he=j;export{he as default}; diff --git a/public/js/Cesium2/Workers/createRectangleGeometry.js b/public/js/Cesium2/Workers/createRectangleGeometry.js index 8a26fc585..38a6650ba 100644 --- a/public/js/Cesium2/Workers/createRectangleGeometry.js +++ b/public/js/Cesium2/Workers/createRectangleGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as J}from"./chunk-Z6PJ3IIE.js";import{a as Nt}from"./chunk-W5MIOKEY.js";import{a as zt}from"./chunk-72CGGEJF.js";import"./chunk-Q5MYX5A2.js";import"./chunk-OZYLWM74.js";import{a as ut}from"./chunk-5CC3QRYS.js";import{a as X}from"./chunk-6HIVPZ7K.js";import{b as Rt}from"./chunk-WJYW7YDO.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as yt}from"./chunk-34ULWVZF.js";import{a as Vt}from"./chunk-24JYWT5N.js";import{b as Mt,c as Pt,d as q}from"./chunk-LH3SUUXG.js";import{d as st}from"./chunk-K2M3OJ7Z.js";import{f as Lt,h as E,i as At}from"./chunk-M3A6SPGI.js";import{a as Y}from"./chunk-D5HNP2LB.js";import{a as w,b as _t,c as G,d as H,e as ft}from"./chunk-S4VBGY2U.js";import{a as W}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as L}from"./chunk-N3A5CZ2S.js";import{a as St,b as lt}from"./chunk-G75U3WZT.js";import{e as $}from"./chunk-3THTQ4QB.js";var Tt=new w,Bt=new w,Ut=new w,Yt=new w,qt=new E,Zt=new G,Kt=new st,$t=new st;function Xt(t,e){let n=new Pt({attributes:new Vt,primitiveType:Mt.TRIANGLES});return n.attributes.position=new q({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}function Gt(t,e,n,r){let a=t.length,c=e.normal?new Float32Array(a):void 0,l=e.tangent?new Float32Array(a):void 0,u=e.bitangent?new Float32Array(a):void 0,d=0,p=Yt,o=Ut,i=Bt;if(e.normal||e.tangent||e.bitangent)for(let f=0;f<a;f+=3){let s=w.fromArray(t,f,Tt),h=d+1,g=d+2;i=n.geodeticSurfaceNormal(s,i),(e.tangent||e.bitangent)&&(w.cross(w.UNIT_Z,i,o),ft.multiplyByVector(r,o,o),w.normalize(o,o),e.bitangent&&w.normalize(w.cross(i,o,p),p)),e.normal&&(c[d]=i.x,c[h]=i.y,c[g]=i.z),e.tangent&&(l[d]=o.x,l[h]=o.y,l[g]=o.z),e.bitangent&&(u[d]=p.x,u[h]=p.y,u[g]=p.z),d+=3}return Xt(e,{positions:t,normals:c,tangents:l,bitangents:u})}var Ct=new w,jt=new w;function te(t,e,n){let r=t.length,a=e.normal?new Float32Array(r):void 0,c=e.tangent?new Float32Array(r):void 0,l=e.bitangent?new Float32Array(r):void 0,u=0,d=0,p=0,o=!0,i=Yt,f=Ut,s=Bt;if(e.normal||e.tangent||e.bitangent)for(let h=0;h<r;h+=6){let g=w.fromArray(t,h,Tt),A=w.fromArray(t,(h+6)%r,Ct);if(o){let b=w.fromArray(t,(h+3)%r,jt);w.subtract(A,g,A),w.subtract(b,g,b),s=w.normalize(w.cross(b,A,s),s),o=!1}w.equalsEpsilon(A,g,W.EPSILON10)&&(o=!0),(e.tangent||e.bitangent)&&(i=n.geodeticSurfaceNormal(g,i),e.tangent&&(f=w.normalize(w.cross(i,s,f),f))),e.normal&&(a[u++]=s.x,a[u++]=s.y,a[u++]=s.z,a[u++]=s.x,a[u++]=s.y,a[u++]=s.z),e.tangent&&(c[d++]=f.x,c[d++]=f.y,c[d++]=f.z,c[d++]=f.x,c[d++]=f.y,c[d++]=f.z),e.bitangent&&(l[p++]=i.x,l[p++]=i.y,l[p++]=i.z,l[p++]=i.x,l[p++]=i.y,l[p++]=i.z)}return Xt(e,{positions:t,normals:a,tangents:c,bitangents:l})}function It(t,e){let n=t._vertexFormat,r=t._ellipsoid,a=e.height,c=e.width,l=e.northCap,u=e.southCap,d=0,p=a,o=a,i=0;l&&(d=1,o-=1,i+=1),u&&(p-=1,o-=1,i+=1),i+=c*o;let f=n.position?new Float64Array(i*3):void 0,s=n.st?new Float32Array(i*2):void 0,h=0,g=0,A=Tt,b=Zt,z=Number.MAX_VALUE,F=Number.MAX_VALUE,j=-Number.MAX_VALUE,T=-Number.MAX_VALUE;for(let x=d;x<p;++x)for(let k=0;k<c;++k)J.computePosition(e,r,n.st,x,k,A,b),f[h++]=A.x,f[h++]=A.y,f[h++]=A.z,n.st&&(s[g++]=b.x,s[g++]=b.y,z=Math.min(z,b.x),F=Math.min(F,b.y),j=Math.max(j,b.x),T=Math.max(T,b.y));if(l&&(J.computePosition(e,r,n.st,0,0,A,b),f[h++]=A.x,f[h++]=A.y,f[h++]=A.z,n.st&&(s[g++]=b.x,s[g++]=b.y,z=b.x,F=b.y,j=b.x,T=b.y)),u&&(J.computePosition(e,r,n.st,a-1,0,A,b),f[h++]=A.x,f[h++]=A.y,f[h]=A.z,n.st&&(s[g++]=b.x,s[g]=b.y,z=Math.min(z,b.x),F=Math.min(F,b.y),j=Math.max(j,b.x),T=Math.max(T,b.y))),n.st&&(z<0||F<0||j>1||T>1))for(let x=0;x<s.length;x+=2)s[x]=(s[x]-z)/(j-z),s[x+1]=(s[x+1]-F)/(T-F);let m=Gt(f,n,r,e.tangentRotationMatrix),K=6*(c-1)*(o-1);l&&(K+=3*(c-1)),u&&(K+=3*(c-1));let P=yt.createTypedArray(i,K),D=0,N=0,O;for(O=0;O<o-1;++O){for(let x=0;x<c-1;++x){let k=D,M=k+c,I=M+1,rt=k+1;P[N++]=k,P[N++]=M,P[N++]=rt,P[N++]=rt,P[N++]=M,P[N++]=I,++D}++D}if(l||u){let x=i-1,k=i-1;l&&u&&(x=i-2);let M,I;if(D=0,l)for(O=0;O<c-1;O++)M=D,I=M+1,P[N++]=x,P[N++]=M,P[N++]=I,++D;if(u)for(D=(o-1)*c,O=0;O<c-1;O++)M=D,I=M+1,P[N++]=M,P[N++]=k,P[N++]=I,++D}return m.indices=P,n.st&&(m.attributes.st=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:s})),m}function ht(t,e,n,r,a){return t[e++]=r[n],t[e++]=r[n+1],t[e++]=r[n+2],t[e++]=a[n],t[e++]=a[n+1],t[e]=a[n+2],t}function dt(t,e,n,r){return t[e++]=r[n],t[e++]=r[n+1],t[e++]=r[n],t[e]=r[n+1],t}var Dt=new X;function ee(t,e){let n=t._shadowVolume,r=t._offsetAttribute,a=t._vertexFormat,c=t._extrudedHeight,l=t._surfaceHeight,u=t._ellipsoid,d=e.height,p=e.width,o;if(n){let R=X.clone(a,Dt);R.normal=!0,t._vertexFormat=R}let i=It(t,e);n&&(t._vertexFormat=a);let f=Rt.scaleToGeodeticHeight(i.attributes.position.values,l,u,!1);f=new Float64Array(f);let s=f.length,h=s*2,g=new Float64Array(h);g.set(f);let A=Rt.scaleToGeodeticHeight(i.attributes.position.values,c,u);g.set(A,s),i.attributes.position.values=g;let b=a.normal?new Float32Array(h):void 0,z=a.tangent?new Float32Array(h):void 0,F=a.bitangent?new Float32Array(h):void 0,j=a.st?new Float32Array(h/3*2):void 0,T,m;if(a.normal){for(m=i.attributes.normal.values,b.set(m),o=0;o<s;o++)m[o]=-m[o];b.set(m,s),i.attributes.normal.values=b}if(n){m=i.attributes.normal.values,a.normal||(i.attributes.normal=void 0);let R=new Float32Array(h);for(o=0;o<s;o++)m[o]=-m[o];R.set(m,s),i.attributes.extrudeDirection=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:R})}let K,P=$(r);if(P){let R=s/3*2,at=new Uint8Array(R);r===ut.TOP?at=at.fill(1,0,R/2):(K=r===ut.NONE?0:1,at=at.fill(K)),i.attributes.applyOffset=new q({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:at})}if(a.tangent){let R=i.attributes.tangent.values;for(z.set(R),o=0;o<s;o++)R[o]=-R[o];z.set(R,s),i.attributes.tangent.values=z}if(a.bitangent){let R=i.attributes.bitangent.values;F.set(R),F.set(R,s),i.attributes.bitangent.values=F}a.st&&(T=i.attributes.st.values,j.set(T),j.set(T,s/3*2),i.attributes.st.values=j);let D=i.indices,N=D.length,O=s/3,x=yt.createTypedArray(h/3,N*2);for(x.set(D),o=0;o<N;o+=3)x[o+N]=D[o+2]+O,x[o+1+N]=D[o+1]+O,x[o+2+N]=D[o]+O;i.indices=x;let k=e.northCap,M=e.southCap,I=d,rt=2,pt=0,xt=4,Et=4;k&&(rt-=1,I-=1,pt+=1,xt-=2,Et-=1),M&&(rt-=1,I-=1,pt+=1,xt-=2,Et-=1),pt+=rt*p+2*I-xt;let gt=(pt+Et)*2,C=new Float64Array(gt*3),S=n?new Float32Array(gt*3):void 0,Z=P?new Uint8Array(gt):void 0,V=a.st?new Float32Array(gt*2):void 0,et=r===ut.TOP;P&&!et&&(K=r===ut.ALL?1:0,Z=Z.fill(K));let v=0,B=0,y=0,U=0,nt=p*I,_;for(o=0;o<nt;o+=p)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);if(M){let R=k?nt+1:nt;for(_=R*3,o=0;o<2;o++)C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,R*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1)}else for(o=nt-p;o<nt;o++)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);for(o=nt-1;o>0;o-=p)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);if(k){let R=nt;for(_=R*3,o=0;o<2;o++)C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,R*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1)}else for(o=p-1;o>=0;o--)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);let ot=te(C,a,u);a.st&&(ot.attributes.st=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:V})),n&&(ot.attributes.extrudeDirection=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:S})),P&&(ot.attributes.applyOffset=new q({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Z}));let it=yt.createTypedArray(gt,pt*6),mt,wt,kt,bt;s=C.length/3;let ct=0;for(o=0;o<s-1;o+=2){mt=o,bt=(mt+2)%s;let R=w.fromArray(C,mt*3,Ct),at=w.fromArray(C,bt*3,jt);w.equalsEpsilon(R,at,W.EPSILON10)||(wt=(mt+1)%s,kt=(wt+2)%s,it[ct++]=mt,it[ct++]=wt,it[ct++]=bt,it[ct++]=bt,it[ct++]=wt,it[ct++]=kt)}return ot.indices=it,ot=zt.combineInstances([new Nt({geometry:i}),new Nt({geometry:ot})]),ot[0]}var ne=[new w,new w,new w,new w],Wt=new _t,oe=new _t;function Ht(t,e,n,r,a){if(n===0)return E.clone(t,a);let c=J.computeOptions(t,e,n,0,qt,Wt),l=c.height,u=c.width,d=ne;return J.computePosition(c,r,!1,0,0,d[0]),J.computePosition(c,r,!1,0,u-1,d[1]),J.computePosition(c,r,!1,l-1,0,d[2]),J.computePosition(c,r,!1,l-1,u-1,d[3]),E.fromCartesianArray(d,r,a)}function Q(t){t=L(t,L.EMPTY_OBJECT);let e=t.rectangle;if(lt.typeOf.object("rectangle",e),E._validate(e),e.north<e.south)throw new St("options.rectangle.north must be greater than or equal to options.rectangle.south");let n=L(t.height,0),r=L(t.extrudedHeight,n);this._rectangle=E.clone(e),this._granularity=L(t.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=H.clone(L(t.ellipsoid,H.default)),this._surfaceHeight=Math.max(n,r),this._rotation=L(t.rotation,0),this._stRotation=L(t.stRotation,0),this._vertexFormat=X.clone(L(t.vertexFormat,X.DEFAULT)),this._extrudedHeight=Math.min(n,r),this._shadowVolume=L(t.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=t.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Q.packedLength=E.packedLength+H.packedLength+X.packedLength+7;Q.pack=function(t,e,n){return lt.typeOf.object("value",t),lt.defined("array",e),n=L(n,0),E.pack(t._rectangle,e,n),n+=E.packedLength,H.pack(t._ellipsoid,e,n),n+=H.packedLength,X.pack(t._vertexFormat,e,n),n+=X.packedLength,e[n++]=t._granularity,e[n++]=t._surfaceHeight,e[n++]=t._rotation,e[n++]=t._stRotation,e[n++]=t._extrudedHeight,e[n++]=t._shadowVolume?1:0,e[n]=L(t._offsetAttribute,-1),e};var Jt=new E,Qt=H.clone(H.UNIT_SPHERE),tt={rectangle:Jt,ellipsoid:Qt,vertexFormat:Dt,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Q.unpack=function(t,e,n){lt.defined("array",t),e=L(e,0);let r=E.unpack(t,e,Jt);e+=E.packedLength;let a=H.unpack(t,e,Qt);e+=H.packedLength;let c=X.unpack(t,e,Dt);e+=X.packedLength;let l=t[e++],u=t[e++],d=t[e++],p=t[e++],o=t[e++],i=t[e++]===1,f=t[e];return $(n)?(n._rectangle=E.clone(r,n._rectangle),n._ellipsoid=H.clone(a,n._ellipsoid),n._vertexFormat=X.clone(c,n._vertexFormat),n._granularity=l,n._surfaceHeight=u,n._rotation=d,n._stRotation=p,n._extrudedHeight=o,n._shadowVolume=i,n._offsetAttribute=f===-1?void 0:f,n):(tt.granularity=l,tt.height=u,tt.rotation=d,tt.stRotation=p,tt.extrudedHeight=o,tt.shadowVolume=i,tt.offsetAttribute=f===-1?void 0:f,new Q(tt))};Q.computeRectangle=function(t,e){t=L(t,L.EMPTY_OBJECT);let n=t.rectangle;if(lt.typeOf.object("rectangle",n),E._validate(n),n.north<n.south)throw new St("options.rectangle.north must be greater than or equal to options.rectangle.south");let r=L(t.granularity,W.RADIANS_PER_DEGREE),a=L(t.ellipsoid,H.default),c=L(t.rotation,0);return Ht(n,r,c,a,e)};var ie=new ft,Ft=new Lt,ae=new _t;Q.createGeometry=function(t){if(W.equalsEpsilon(t._rectangle.north,t._rectangle.south,W.EPSILON10)||W.equalsEpsilon(t._rectangle.east,t._rectangle.west,W.EPSILON10))return;let e=t._rectangle,n=t._ellipsoid,r=t._rotation,a=t._stRotation,c=t._vertexFormat,l=J.computeOptions(e,t._granularity,r,a,qt,Wt,oe),u=ie;if(a!==0||r!==0){let s=E.center(e,ae),h=n.geodeticSurfaceNormalCartographic(s,Ct);Lt.fromAxisAngle(h,-a,Ft),ft.fromQuaternion(Ft,u)}else ft.clone(ft.IDENTITY,u);let d=t._surfaceHeight,p=t._extrudedHeight,o=!W.equalsEpsilon(d,p,0,W.EPSILON2);l.lonScalar=1/t._rectangle.width,l.latScalar=1/t._rectangle.height,l.tangentRotationMatrix=u;let i,f;if(e=t._rectangle,o){i=ee(t,l);let s=st.fromRectangle3D(e,n,d,$t),h=st.fromRectangle3D(e,n,p,Kt);f=st.union(s,h)}else{if(i=It(t,l),i.attributes.position.values=Rt.scaleToGeodeticHeight(i.attributes.position.values,d,n,!1),$(t._offsetAttribute)){let s=i.attributes.position.values.length,h=t._offsetAttribute===ut.NONE?0:1,g=new Uint8Array(s/3).fill(h);i.attributes.applyOffset=new q({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}f=st.fromRectangle3D(e,n,d)}return c.position||delete i.attributes.position,new Pt({attributes:i.attributes,indices:i.indices,primitiveType:i.primitiveType,boundingSphere:f,offsetAttribute:t._offsetAttribute})};Q.createShadowVolume=function(t,e,n){let r=t._granularity,a=t._ellipsoid,c=e(r,a),l=n(r,a);return new Q({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:a,stRotation:t._stRotation,granularity:r,extrudedHeight:l,height:c,vertexFormat:X.POSITION_ONLY,shadowVolume:!0})};var vt=new E,se=[new G,new G,new G],re=new At,ce=new _t;function le(t){if(t._stRotation===0)return[0,0,0,1,1,0];let e=E.clone(t._rectangle,vt),n=t._granularity,r=t._ellipsoid,a=t._rotation-t._stRotation,c=Ht(e,n,a,r,vt),l=se;l[0].x=c.west,l[0].y=c.south,l[1].x=c.west,l[1].y=c.north,l[2].x=c.east,l[2].y=c.south;let u=t.rectangle,d=At.fromRotation(t._stRotation,re),p=E.center(u,ce);for(let h=0;h<3;++h){let g=l[h];g.x-=p.longitude,g.y-=p.latitude,At.multiplyByVector(d,g,g),g.x+=p.longitude,g.y+=p.latitude,g.x=(g.x-u.west)/u.width,g.y=(g.y-u.south)/u.height}let o=l[0],i=l[1],f=l[2],s=new Array(6);return G.pack(o,s),G.pack(i,s,2),G.pack(f,s,4),s}Object.defineProperties(Q.prototype,{rectangle:{get:function(){return $(this._rotatedRectangle)||(this._rotatedRectangle=Ht(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return $(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=le(this)),this._textureCoordinateRotationPoints}}});var Ot=Q;function fe(t,e){return $(e)&&(t=Ot.unpack(t,e)),t._ellipsoid=H.clone(t._ellipsoid),t._rectangle=E.clone(t._rectangle),Ot.createGeometry(t)}var Ye=fe;export{Ye as default}; +import{a as J}from"./chunk-JRSUZBXX.js";import{a as Nt}from"./chunk-4MYAYFOP.js";import{a as zt}from"./chunk-FG3CL3AH.js";import"./chunk-VMXXQ6B4.js";import"./chunk-XCRMBS5M.js";import{a as ut}from"./chunk-N5SNKJ43.js";import{a as X}from"./chunk-6VK5R74O.js";import{b as Rt}from"./chunk-ZMGESOEZ.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as yt}from"./chunk-YFQNY2YN.js";import{a as Vt}from"./chunk-NT26NNVH.js";import{b as Mt,c as Pt,d as q}from"./chunk-NW2YE576.js";import{d as st}from"./chunk-2NIQ5ECB.js";import{f as Lt,h as E,i as At}from"./chunk-7YEOLR2L.js";import{a as Y}from"./chunk-QHHYYTCM.js";import{a as w,b as _t,c as G,d as H,e as ft}from"./chunk-RH3GFHG2.js";import{a as W}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as L}from"./chunk-TA3RE4KQ.js";import{a as St,b as lt}from"./chunk-RTY3VPG6.js";import{e as $}from"./chunk-LRNH5AEO.js";var Tt=new w,Bt=new w,Ut=new w,Yt=new w,qt=new E,Zt=new G,Kt=new st,$t=new st;function Xt(t,e){let n=new Pt({attributes:new Vt,primitiveType:Mt.TRIANGLES});return n.attributes.position=new q({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}function Gt(t,e,n,r){let a=t.length,c=e.normal?new Float32Array(a):void 0,l=e.tangent?new Float32Array(a):void 0,u=e.bitangent?new Float32Array(a):void 0,d=0,p=Yt,o=Ut,i=Bt;if(e.normal||e.tangent||e.bitangent)for(let f=0;f<a;f+=3){let s=w.fromArray(t,f,Tt),h=d+1,g=d+2;i=n.geodeticSurfaceNormal(s,i),(e.tangent||e.bitangent)&&(w.cross(w.UNIT_Z,i,o),ft.multiplyByVector(r,o,o),w.normalize(o,o),e.bitangent&&w.normalize(w.cross(i,o,p),p)),e.normal&&(c[d]=i.x,c[h]=i.y,c[g]=i.z),e.tangent&&(l[d]=o.x,l[h]=o.y,l[g]=o.z),e.bitangent&&(u[d]=p.x,u[h]=p.y,u[g]=p.z),d+=3}return Xt(e,{positions:t,normals:c,tangents:l,bitangents:u})}var Ct=new w,jt=new w;function te(t,e,n){let r=t.length,a=e.normal?new Float32Array(r):void 0,c=e.tangent?new Float32Array(r):void 0,l=e.bitangent?new Float32Array(r):void 0,u=0,d=0,p=0,o=!0,i=Yt,f=Ut,s=Bt;if(e.normal||e.tangent||e.bitangent)for(let h=0;h<r;h+=6){let g=w.fromArray(t,h,Tt),A=w.fromArray(t,(h+6)%r,Ct);if(o){let b=w.fromArray(t,(h+3)%r,jt);w.subtract(A,g,A),w.subtract(b,g,b),s=w.normalize(w.cross(b,A,s),s),o=!1}w.equalsEpsilon(A,g,W.EPSILON10)&&(o=!0),(e.tangent||e.bitangent)&&(i=n.geodeticSurfaceNormal(g,i),e.tangent&&(f=w.normalize(w.cross(i,s,f),f))),e.normal&&(a[u++]=s.x,a[u++]=s.y,a[u++]=s.z,a[u++]=s.x,a[u++]=s.y,a[u++]=s.z),e.tangent&&(c[d++]=f.x,c[d++]=f.y,c[d++]=f.z,c[d++]=f.x,c[d++]=f.y,c[d++]=f.z),e.bitangent&&(l[p++]=i.x,l[p++]=i.y,l[p++]=i.z,l[p++]=i.x,l[p++]=i.y,l[p++]=i.z)}return Xt(e,{positions:t,normals:a,tangents:c,bitangents:l})}function It(t,e){let n=t._vertexFormat,r=t._ellipsoid,a=e.height,c=e.width,l=e.northCap,u=e.southCap,d=0,p=a,o=a,i=0;l&&(d=1,o-=1,i+=1),u&&(p-=1,o-=1,i+=1),i+=c*o;let f=n.position?new Float64Array(i*3):void 0,s=n.st?new Float32Array(i*2):void 0,h=0,g=0,A=Tt,b=Zt,z=Number.MAX_VALUE,F=Number.MAX_VALUE,j=-Number.MAX_VALUE,T=-Number.MAX_VALUE;for(let x=d;x<p;++x)for(let k=0;k<c;++k)J.computePosition(e,r,n.st,x,k,A,b),f[h++]=A.x,f[h++]=A.y,f[h++]=A.z,n.st&&(s[g++]=b.x,s[g++]=b.y,z=Math.min(z,b.x),F=Math.min(F,b.y),j=Math.max(j,b.x),T=Math.max(T,b.y));if(l&&(J.computePosition(e,r,n.st,0,0,A,b),f[h++]=A.x,f[h++]=A.y,f[h++]=A.z,n.st&&(s[g++]=b.x,s[g++]=b.y,z=b.x,F=b.y,j=b.x,T=b.y)),u&&(J.computePosition(e,r,n.st,a-1,0,A,b),f[h++]=A.x,f[h++]=A.y,f[h]=A.z,n.st&&(s[g++]=b.x,s[g]=b.y,z=Math.min(z,b.x),F=Math.min(F,b.y),j=Math.max(j,b.x),T=Math.max(T,b.y))),n.st&&(z<0||F<0||j>1||T>1))for(let x=0;x<s.length;x+=2)s[x]=(s[x]-z)/(j-z),s[x+1]=(s[x+1]-F)/(T-F);let m=Gt(f,n,r,e.tangentRotationMatrix),K=6*(c-1)*(o-1);l&&(K+=3*(c-1)),u&&(K+=3*(c-1));let P=yt.createTypedArray(i,K),D=0,N=0,O;for(O=0;O<o-1;++O){for(let x=0;x<c-1;++x){let k=D,M=k+c,I=M+1,rt=k+1;P[N++]=k,P[N++]=M,P[N++]=rt,P[N++]=rt,P[N++]=M,P[N++]=I,++D}++D}if(l||u){let x=i-1,k=i-1;l&&u&&(x=i-2);let M,I;if(D=0,l)for(O=0;O<c-1;O++)M=D,I=M+1,P[N++]=x,P[N++]=M,P[N++]=I,++D;if(u)for(D=(o-1)*c,O=0;O<c-1;O++)M=D,I=M+1,P[N++]=M,P[N++]=k,P[N++]=I,++D}return m.indices=P,n.st&&(m.attributes.st=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:s})),m}function ht(t,e,n,r,a){return t[e++]=r[n],t[e++]=r[n+1],t[e++]=r[n+2],t[e++]=a[n],t[e++]=a[n+1],t[e]=a[n+2],t}function dt(t,e,n,r){return t[e++]=r[n],t[e++]=r[n+1],t[e++]=r[n],t[e]=r[n+1],t}var Dt=new X;function ee(t,e){let n=t._shadowVolume,r=t._offsetAttribute,a=t._vertexFormat,c=t._extrudedHeight,l=t._surfaceHeight,u=t._ellipsoid,d=e.height,p=e.width,o;if(n){let R=X.clone(a,Dt);R.normal=!0,t._vertexFormat=R}let i=It(t,e);n&&(t._vertexFormat=a);let f=Rt.scaleToGeodeticHeight(i.attributes.position.values,l,u,!1);f=new Float64Array(f);let s=f.length,h=s*2,g=new Float64Array(h);g.set(f);let A=Rt.scaleToGeodeticHeight(i.attributes.position.values,c,u);g.set(A,s),i.attributes.position.values=g;let b=a.normal?new Float32Array(h):void 0,z=a.tangent?new Float32Array(h):void 0,F=a.bitangent?new Float32Array(h):void 0,j=a.st?new Float32Array(h/3*2):void 0,T,m;if(a.normal){for(m=i.attributes.normal.values,b.set(m),o=0;o<s;o++)m[o]=-m[o];b.set(m,s),i.attributes.normal.values=b}if(n){m=i.attributes.normal.values,a.normal||(i.attributes.normal=void 0);let R=new Float32Array(h);for(o=0;o<s;o++)m[o]=-m[o];R.set(m,s),i.attributes.extrudeDirection=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:R})}let K,P=$(r);if(P){let R=s/3*2,at=new Uint8Array(R);r===ut.TOP?at=at.fill(1,0,R/2):(K=r===ut.NONE?0:1,at=at.fill(K)),i.attributes.applyOffset=new q({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:at})}if(a.tangent){let R=i.attributes.tangent.values;for(z.set(R),o=0;o<s;o++)R[o]=-R[o];z.set(R,s),i.attributes.tangent.values=z}if(a.bitangent){let R=i.attributes.bitangent.values;F.set(R),F.set(R,s),i.attributes.bitangent.values=F}a.st&&(T=i.attributes.st.values,j.set(T),j.set(T,s/3*2),i.attributes.st.values=j);let D=i.indices,N=D.length,O=s/3,x=yt.createTypedArray(h/3,N*2);for(x.set(D),o=0;o<N;o+=3)x[o+N]=D[o+2]+O,x[o+1+N]=D[o+1]+O,x[o+2+N]=D[o]+O;i.indices=x;let k=e.northCap,M=e.southCap,I=d,rt=2,pt=0,xt=4,Et=4;k&&(rt-=1,I-=1,pt+=1,xt-=2,Et-=1),M&&(rt-=1,I-=1,pt+=1,xt-=2,Et-=1),pt+=rt*p+2*I-xt;let gt=(pt+Et)*2,C=new Float64Array(gt*3),S=n?new Float32Array(gt*3):void 0,Z=P?new Uint8Array(gt):void 0,V=a.st?new Float32Array(gt*2):void 0,et=r===ut.TOP;P&&!et&&(K=r===ut.ALL?1:0,Z=Z.fill(K));let v=0,B=0,y=0,U=0,nt=p*I,_;for(o=0;o<nt;o+=p)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);if(M){let R=k?nt+1:nt;for(_=R*3,o=0;o<2;o++)C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,R*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1)}else for(o=nt-p;o<nt;o++)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);for(o=nt-1;o>0;o-=p)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);if(k){let R=nt;for(_=R*3,o=0;o<2;o++)C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,R*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1)}else for(o=p-1;o>=0;o--)_=o*3,C=ht(C,v,_,f,A),v+=6,a.st&&(V=dt(V,B,o*2,T),B+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),et&&(Z[U++]=1,U+=1);let ot=te(C,a,u);a.st&&(ot.attributes.st=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:V})),n&&(ot.attributes.extrudeDirection=new q({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:S})),P&&(ot.attributes.applyOffset=new q({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Z}));let it=yt.createTypedArray(gt,pt*6),mt,wt,kt,bt;s=C.length/3;let ct=0;for(o=0;o<s-1;o+=2){mt=o,bt=(mt+2)%s;let R=w.fromArray(C,mt*3,Ct),at=w.fromArray(C,bt*3,jt);w.equalsEpsilon(R,at,W.EPSILON10)||(wt=(mt+1)%s,kt=(wt+2)%s,it[ct++]=mt,it[ct++]=wt,it[ct++]=bt,it[ct++]=bt,it[ct++]=wt,it[ct++]=kt)}return ot.indices=it,ot=zt.combineInstances([new Nt({geometry:i}),new Nt({geometry:ot})]),ot[0]}var ne=[new w,new w,new w,new w],Wt=new _t,oe=new _t;function Ht(t,e,n,r,a){if(n===0)return E.clone(t,a);let c=J.computeOptions(t,e,n,0,qt,Wt),l=c.height,u=c.width,d=ne;return J.computePosition(c,r,!1,0,0,d[0]),J.computePosition(c,r,!1,0,u-1,d[1]),J.computePosition(c,r,!1,l-1,0,d[2]),J.computePosition(c,r,!1,l-1,u-1,d[3]),E.fromCartesianArray(d,r,a)}function Q(t){t=L(t,L.EMPTY_OBJECT);let e=t.rectangle;if(lt.typeOf.object("rectangle",e),E._validate(e),e.north<e.south)throw new St("options.rectangle.north must be greater than or equal to options.rectangle.south");let n=L(t.height,0),r=L(t.extrudedHeight,n);this._rectangle=E.clone(e),this._granularity=L(t.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=H.clone(L(t.ellipsoid,H.default)),this._surfaceHeight=Math.max(n,r),this._rotation=L(t.rotation,0),this._stRotation=L(t.stRotation,0),this._vertexFormat=X.clone(L(t.vertexFormat,X.DEFAULT)),this._extrudedHeight=Math.min(n,r),this._shadowVolume=L(t.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=t.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Q.packedLength=E.packedLength+H.packedLength+X.packedLength+7;Q.pack=function(t,e,n){return lt.typeOf.object("value",t),lt.defined("array",e),n=L(n,0),E.pack(t._rectangle,e,n),n+=E.packedLength,H.pack(t._ellipsoid,e,n),n+=H.packedLength,X.pack(t._vertexFormat,e,n),n+=X.packedLength,e[n++]=t._granularity,e[n++]=t._surfaceHeight,e[n++]=t._rotation,e[n++]=t._stRotation,e[n++]=t._extrudedHeight,e[n++]=t._shadowVolume?1:0,e[n]=L(t._offsetAttribute,-1),e};var Jt=new E,Qt=H.clone(H.UNIT_SPHERE),tt={rectangle:Jt,ellipsoid:Qt,vertexFormat:Dt,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Q.unpack=function(t,e,n){lt.defined("array",t),e=L(e,0);let r=E.unpack(t,e,Jt);e+=E.packedLength;let a=H.unpack(t,e,Qt);e+=H.packedLength;let c=X.unpack(t,e,Dt);e+=X.packedLength;let l=t[e++],u=t[e++],d=t[e++],p=t[e++],o=t[e++],i=t[e++]===1,f=t[e];return $(n)?(n._rectangle=E.clone(r,n._rectangle),n._ellipsoid=H.clone(a,n._ellipsoid),n._vertexFormat=X.clone(c,n._vertexFormat),n._granularity=l,n._surfaceHeight=u,n._rotation=d,n._stRotation=p,n._extrudedHeight=o,n._shadowVolume=i,n._offsetAttribute=f===-1?void 0:f,n):(tt.granularity=l,tt.height=u,tt.rotation=d,tt.stRotation=p,tt.extrudedHeight=o,tt.shadowVolume=i,tt.offsetAttribute=f===-1?void 0:f,new Q(tt))};Q.computeRectangle=function(t,e){t=L(t,L.EMPTY_OBJECT);let n=t.rectangle;if(lt.typeOf.object("rectangle",n),E._validate(n),n.north<n.south)throw new St("options.rectangle.north must be greater than or equal to options.rectangle.south");let r=L(t.granularity,W.RADIANS_PER_DEGREE),a=L(t.ellipsoid,H.default),c=L(t.rotation,0);return Ht(n,r,c,a,e)};var ie=new ft,Ft=new Lt,ae=new _t;Q.createGeometry=function(t){if(W.equalsEpsilon(t._rectangle.north,t._rectangle.south,W.EPSILON10)||W.equalsEpsilon(t._rectangle.east,t._rectangle.west,W.EPSILON10))return;let e=t._rectangle,n=t._ellipsoid,r=t._rotation,a=t._stRotation,c=t._vertexFormat,l=J.computeOptions(e,t._granularity,r,a,qt,Wt,oe),u=ie;if(a!==0||r!==0){let s=E.center(e,ae),h=n.geodeticSurfaceNormalCartographic(s,Ct);Lt.fromAxisAngle(h,-a,Ft),ft.fromQuaternion(Ft,u)}else ft.clone(ft.IDENTITY,u);let d=t._surfaceHeight,p=t._extrudedHeight,o=!W.equalsEpsilon(d,p,0,W.EPSILON2);l.lonScalar=1/t._rectangle.width,l.latScalar=1/t._rectangle.height,l.tangentRotationMatrix=u;let i,f;if(e=t._rectangle,o){i=ee(t,l);let s=st.fromRectangle3D(e,n,d,$t),h=st.fromRectangle3D(e,n,p,Kt);f=st.union(s,h)}else{if(i=It(t,l),i.attributes.position.values=Rt.scaleToGeodeticHeight(i.attributes.position.values,d,n,!1),$(t._offsetAttribute)){let s=i.attributes.position.values.length,h=t._offsetAttribute===ut.NONE?0:1,g=new Uint8Array(s/3).fill(h);i.attributes.applyOffset=new q({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}f=st.fromRectangle3D(e,n,d)}return c.position||delete i.attributes.position,new Pt({attributes:i.attributes,indices:i.indices,primitiveType:i.primitiveType,boundingSphere:f,offsetAttribute:t._offsetAttribute})};Q.createShadowVolume=function(t,e,n){let r=t._granularity,a=t._ellipsoid,c=e(r,a),l=n(r,a);return new Q({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:a,stRotation:t._stRotation,granularity:r,extrudedHeight:l,height:c,vertexFormat:X.POSITION_ONLY,shadowVolume:!0})};var vt=new E,se=[new G,new G,new G],re=new At,ce=new _t;function le(t){if(t._stRotation===0)return[0,0,0,1,1,0];let e=E.clone(t._rectangle,vt),n=t._granularity,r=t._ellipsoid,a=t._rotation-t._stRotation,c=Ht(e,n,a,r,vt),l=se;l[0].x=c.west,l[0].y=c.south,l[1].x=c.west,l[1].y=c.north,l[2].x=c.east,l[2].y=c.south;let u=t.rectangle,d=At.fromRotation(t._stRotation,re),p=E.center(u,ce);for(let h=0;h<3;++h){let g=l[h];g.x-=p.longitude,g.y-=p.latitude,At.multiplyByVector(d,g,g),g.x+=p.longitude,g.y+=p.latitude,g.x=(g.x-u.west)/u.width,g.y=(g.y-u.south)/u.height}let o=l[0],i=l[1],f=l[2],s=new Array(6);return G.pack(o,s),G.pack(i,s,2),G.pack(f,s,4),s}Object.defineProperties(Q.prototype,{rectangle:{get:function(){return $(this._rotatedRectangle)||(this._rotatedRectangle=Ht(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return $(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=le(this)),this._textureCoordinateRotationPoints}}});var Ot=Q;function fe(t,e){return $(e)&&(t=Ot.unpack(t,e)),t._ellipsoid=H.clone(t._ellipsoid),t._rectangle=E.clone(t._rectangle),Ot.createGeometry(t)}var Ye=fe;export{Ye as default}; diff --git a/public/js/Cesium2/Workers/createRectangleOutlineGeometry.js b/public/js/Cesium2/Workers/createRectangleOutlineGeometry.js index 10858bd72..7e4042226 100644 --- a/public/js/Cesium2/Workers/createRectangleOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createRectangleOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as C}from"./chunk-Z6PJ3IIE.js";import{a as v}from"./chunk-5CC3QRYS.js";import{b as z}from"./chunk-WJYW7YDO.js";import"./chunk-RDAVO5OM.js";import{a as O}from"./chunk-34ULWVZF.js";import{a as Y}from"./chunk-24JYWT5N.js";import{b as B,c as q,d as y}from"./chunk-LH3SUUXG.js";import{d as R}from"./chunk-K2M3OJ7Z.js";import{h as b}from"./chunk-M3A6SPGI.js";import{a as T}from"./chunk-D5HNP2LB.js";import{a as U,b as M,d as w}from"./chunk-S4VBGY2U.js";import{a as P}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as E}from"./chunk-N3A5CZ2S.js";import{a as N}from"./chunk-G75U3WZT.js";import{e as S}from"./chunk-3THTQ4QB.js";var j=new R,K=new R,Q=new U,W=new b;function F(t,e){let i=t._ellipsoid,m=e.height,s=e.width,h=e.northCap,a=e.southCap,_=m,A=2,o=0,g=4;h&&(A-=1,_-=1,o+=1,g-=2),a&&(A-=1,_-=1,o+=1,g-=2),o+=A*s+2*_-g;let n=new Float64Array(o*3),l=0,f=0,p,r=Q;if(h)C.computePosition(e,i,!1,f,0,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;else for(p=0;p<s;p++)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(p=s-1,f=1;f<m;f++)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;if(f=m-1,!a)for(p=s-2;p>=0;p--)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(p=0,f=m-2;f>0;f--)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;let u=n.length/3*2,c=O.createTypedArray(n.length/3,u),H=0;for(let D=0;D<n.length/3-1;D++)c[H++]=D,c[H++]=D+1;c[H++]=n.length/3-1,c[H++]=0;let d=new q({attributes:new Y,primitiveType:B.LINES});return d.attributes.position=new y({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:n}),d.indices=c,d}function X(t,e){let i=t._surfaceHeight,m=t._extrudedHeight,s=t._ellipsoid,h=F(t,e),a=e.height,_=e.width,A=z.scaleToGeodeticHeight(h.attributes.position.values,i,s,!1),o=A.length,g=new Float64Array(o*2);g.set(A);let n=z.scaleToGeodeticHeight(h.attributes.position.values,m,s);g.set(n,o),h.attributes.position.values=g;let l=e.northCap,f=e.southCap,p=4;l&&(p-=1),f&&(p-=1);let r=(g.length/3+p)*2,u=O.createTypedArray(g.length/3,r);o=g.length/6;let c=0;for(let d=0;d<o-1;d++)u[c++]=d,u[c++]=d+1,u[c++]=d+o,u[c++]=d+o+1;u[c++]=o-1,u[c++]=0,u[c++]=o+o-1,u[c++]=o,u[c++]=0,u[c++]=o;let H;if(l)H=a-1;else{let d=_-1;u[c++]=d,u[c++]=d+o,H=_+a-2}if(u[c++]=H,u[c++]=H+o,!f){let d=_+H-1;u[c++]=d,u[c]=d+o}return h.indices=u,h}function L(t){t=E(t,E.EMPTY_OBJECT);let e=t.rectangle,i=E(t.granularity,P.RADIANS_PER_DEGREE),m=E(t.ellipsoid,w.default),s=E(t.rotation,0);if(!S(e))throw new N("rectangle is required.");if(b._validate(e),e.north<e.south)throw new N("options.rectangle.north must be greater than options.rectangle.south");let h=E(t.height,0),a=E(t.extrudedHeight,h);this._rectangle=b.clone(e),this._granularity=i,this._ellipsoid=m,this._surfaceHeight=Math.max(h,a),this._rotation=s,this._extrudedHeight=Math.min(h,a),this._offsetAttribute=t.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}L.packedLength=b.packedLength+w.packedLength+5;L.pack=function(t,e,i){if(!S(t))throw new N("value is required");if(!S(e))throw new N("array is required");return i=E(i,0),b.pack(t._rectangle,e,i),i+=b.packedLength,w.pack(t._ellipsoid,e,i),i+=w.packedLength,e[i++]=t._granularity,e[i++]=t._surfaceHeight,e[i++]=t._rotation,e[i++]=t._extrudedHeight,e[i]=E(t._offsetAttribute,-1),e};var V=new b,J=w.clone(w.UNIT_SPHERE),k={rectangle:V,ellipsoid:J,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};L.unpack=function(t,e,i){if(!S(t))throw new N("array is required");e=E(e,0);let m=b.unpack(t,e,V);e+=b.packedLength;let s=w.unpack(t,e,J);e+=w.packedLength;let h=t[e++],a=t[e++],_=t[e++],A=t[e++],o=t[e];return S(i)?(i._rectangle=b.clone(m,i._rectangle),i._ellipsoid=w.clone(s,i._ellipsoid),i._surfaceHeight=a,i._rotation=_,i._extrudedHeight=A,i._offsetAttribute=o===-1?void 0:o,i):(k.granularity=h,k.height=a,k.rotation=_,k.extrudedHeight=A,k.offsetAttribute=o===-1?void 0:o,new L(k))};var Z=new M;L.createGeometry=function(t){let e=t._rectangle,i=t._ellipsoid,m=C.computeOptions(e,t._granularity,t._rotation,0,W,Z),s,h;if(P.equalsEpsilon(e.north,e.south,P.EPSILON10)||P.equalsEpsilon(e.east,e.west,P.EPSILON10))return;let a=t._surfaceHeight,_=t._extrudedHeight,A=!P.equalsEpsilon(a,_,0,P.EPSILON2),o;if(A){if(s=X(t,m),S(t._offsetAttribute)){let l=s.attributes.position.values.length/3,f=new Uint8Array(l);t._offsetAttribute===v.TOP?f=f.fill(1,0,l/2):(o=t._offsetAttribute===v.NONE?0:1,f=f.fill(o)),s.attributes.applyOffset=new y({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let g=R.fromRectangle3D(e,i,a,K),n=R.fromRectangle3D(e,i,_,j);h=R.union(g,n)}else{if(s=F(t,m),s.attributes.position.values=z.scaleToGeodeticHeight(s.attributes.position.values,a,i,!1),S(t._offsetAttribute)){let g=s.attributes.position.values.length;o=t._offsetAttribute===v.NONE?0:1;let n=new Uint8Array(g/3).fill(o);s.attributes.applyOffset=new y({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}h=R.fromRectangle3D(e,i,a)}return new q({attributes:s.attributes,indices:s.indices,primitiveType:B.LINES,boundingSphere:h,offsetAttribute:t._offsetAttribute})};var x=L;function $(t,e){return S(e)&&(t=x.unpack(t,e)),t._ellipsoid=w.clone(t._ellipsoid),t._rectangle=b.clone(t._rectangle),x.createGeometry(t)}var Et=$;export{Et as default}; +import{a as C}from"./chunk-JRSUZBXX.js";import{a as v}from"./chunk-N5SNKJ43.js";import{b as z}from"./chunk-ZMGESOEZ.js";import"./chunk-ZBEWS6NN.js";import{a as O}from"./chunk-YFQNY2YN.js";import{a as Y}from"./chunk-NT26NNVH.js";import{b as B,c as q,d as y}from"./chunk-NW2YE576.js";import{d as R}from"./chunk-2NIQ5ECB.js";import{h as b}from"./chunk-7YEOLR2L.js";import{a as T}from"./chunk-QHHYYTCM.js";import{a as U,b as M,d as w}from"./chunk-RH3GFHG2.js";import{a as P}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as E}from"./chunk-TA3RE4KQ.js";import{a as N}from"./chunk-RTY3VPG6.js";import{e as S}from"./chunk-LRNH5AEO.js";var j=new R,K=new R,Q=new U,W=new b;function F(t,e){let i=t._ellipsoid,m=e.height,s=e.width,h=e.northCap,a=e.southCap,_=m,A=2,o=0,g=4;h&&(A-=1,_-=1,o+=1,g-=2),a&&(A-=1,_-=1,o+=1,g-=2),o+=A*s+2*_-g;let n=new Float64Array(o*3),l=0,f=0,p,r=Q;if(h)C.computePosition(e,i,!1,f,0,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;else for(p=0;p<s;p++)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(p=s-1,f=1;f<m;f++)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;if(f=m-1,!a)for(p=s-2;p>=0;p--)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(p=0,f=m-2;f>0;f--)C.computePosition(e,i,!1,f,p,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;let u=n.length/3*2,c=O.createTypedArray(n.length/3,u),H=0;for(let D=0;D<n.length/3-1;D++)c[H++]=D,c[H++]=D+1;c[H++]=n.length/3-1,c[H++]=0;let d=new q({attributes:new Y,primitiveType:B.LINES});return d.attributes.position=new y({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:n}),d.indices=c,d}function X(t,e){let i=t._surfaceHeight,m=t._extrudedHeight,s=t._ellipsoid,h=F(t,e),a=e.height,_=e.width,A=z.scaleToGeodeticHeight(h.attributes.position.values,i,s,!1),o=A.length,g=new Float64Array(o*2);g.set(A);let n=z.scaleToGeodeticHeight(h.attributes.position.values,m,s);g.set(n,o),h.attributes.position.values=g;let l=e.northCap,f=e.southCap,p=4;l&&(p-=1),f&&(p-=1);let r=(g.length/3+p)*2,u=O.createTypedArray(g.length/3,r);o=g.length/6;let c=0;for(let d=0;d<o-1;d++)u[c++]=d,u[c++]=d+1,u[c++]=d+o,u[c++]=d+o+1;u[c++]=o-1,u[c++]=0,u[c++]=o+o-1,u[c++]=o,u[c++]=0,u[c++]=o;let H;if(l)H=a-1;else{let d=_-1;u[c++]=d,u[c++]=d+o,H=_+a-2}if(u[c++]=H,u[c++]=H+o,!f){let d=_+H-1;u[c++]=d,u[c]=d+o}return h.indices=u,h}function L(t){t=E(t,E.EMPTY_OBJECT);let e=t.rectangle,i=E(t.granularity,P.RADIANS_PER_DEGREE),m=E(t.ellipsoid,w.default),s=E(t.rotation,0);if(!S(e))throw new N("rectangle is required.");if(b._validate(e),e.north<e.south)throw new N("options.rectangle.north must be greater than options.rectangle.south");let h=E(t.height,0),a=E(t.extrudedHeight,h);this._rectangle=b.clone(e),this._granularity=i,this._ellipsoid=m,this._surfaceHeight=Math.max(h,a),this._rotation=s,this._extrudedHeight=Math.min(h,a),this._offsetAttribute=t.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}L.packedLength=b.packedLength+w.packedLength+5;L.pack=function(t,e,i){if(!S(t))throw new N("value is required");if(!S(e))throw new N("array is required");return i=E(i,0),b.pack(t._rectangle,e,i),i+=b.packedLength,w.pack(t._ellipsoid,e,i),i+=w.packedLength,e[i++]=t._granularity,e[i++]=t._surfaceHeight,e[i++]=t._rotation,e[i++]=t._extrudedHeight,e[i]=E(t._offsetAttribute,-1),e};var V=new b,J=w.clone(w.UNIT_SPHERE),k={rectangle:V,ellipsoid:J,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};L.unpack=function(t,e,i){if(!S(t))throw new N("array is required");e=E(e,0);let m=b.unpack(t,e,V);e+=b.packedLength;let s=w.unpack(t,e,J);e+=w.packedLength;let h=t[e++],a=t[e++],_=t[e++],A=t[e++],o=t[e];return S(i)?(i._rectangle=b.clone(m,i._rectangle),i._ellipsoid=w.clone(s,i._ellipsoid),i._surfaceHeight=a,i._rotation=_,i._extrudedHeight=A,i._offsetAttribute=o===-1?void 0:o,i):(k.granularity=h,k.height=a,k.rotation=_,k.extrudedHeight=A,k.offsetAttribute=o===-1?void 0:o,new L(k))};var Z=new M;L.createGeometry=function(t){let e=t._rectangle,i=t._ellipsoid,m=C.computeOptions(e,t._granularity,t._rotation,0,W,Z),s,h;if(P.equalsEpsilon(e.north,e.south,P.EPSILON10)||P.equalsEpsilon(e.east,e.west,P.EPSILON10))return;let a=t._surfaceHeight,_=t._extrudedHeight,A=!P.equalsEpsilon(a,_,0,P.EPSILON2),o;if(A){if(s=X(t,m),S(t._offsetAttribute)){let l=s.attributes.position.values.length/3,f=new Uint8Array(l);t._offsetAttribute===v.TOP?f=f.fill(1,0,l/2):(o=t._offsetAttribute===v.NONE?0:1,f=f.fill(o)),s.attributes.applyOffset=new y({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let g=R.fromRectangle3D(e,i,a,K),n=R.fromRectangle3D(e,i,_,j);h=R.union(g,n)}else{if(s=F(t,m),s.attributes.position.values=z.scaleToGeodeticHeight(s.attributes.position.values,a,i,!1),S(t._offsetAttribute)){let g=s.attributes.position.values.length;o=t._offsetAttribute===v.NONE?0:1;let n=new Uint8Array(g/3).fill(o);s.attributes.applyOffset=new y({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}h=R.fromRectangle3D(e,i,a)}return new q({attributes:s.attributes,indices:s.indices,primitiveType:B.LINES,boundingSphere:h,offsetAttribute:t._offsetAttribute})};var x=L;function $(t,e){return S(e)&&(t=x.unpack(t,e)),t._ellipsoid=w.clone(t._ellipsoid),t._rectangle=b.clone(t._rectangle),x.createGeometry(t)}var Et=$;export{Et as default}; diff --git a/public/js/Cesium2/Workers/createSimplePolylineGeometry.js b/public/js/Cesium2/Workers/createSimplePolylineGeometry.js index e194a9250..aa553ce16 100644 --- a/public/js/Cesium2/Workers/createSimplePolylineGeometry.js +++ b/public/js/Cesium2/Workers/createSimplePolylineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as r}from"./chunk-JXLT7VPX.js";import{a as S}from"./chunk-HQ4YU6WD.js";import{a as E}from"./chunk-RNF7TLFF.js";import"./chunk-E7HC3VTG.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as X}from"./chunk-34ULWVZF.js";import{a as W}from"./chunk-24JYWT5N.js";import{b as K,c as Q,d as Y}from"./chunk-LH3SUUXG.js";import{d as j}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as H}from"./chunk-D5HNP2LB.js";import{a as k,d as b}from"./chunk-S4VBGY2U.js";import{a as q}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as w}from"./chunk-N3A5CZ2S.js";import{a as L}from"./chunk-G75U3WZT.js";import{e as u}from"./chunk-3THTQ4QB.js";function Z(t,e,o,i,s,l,p){let g=E.numberOfPoints(t,e,s),f,n=o.red,m=o.green,d=o.blue,T=o.alpha,c=i.red,h=i.green,y=i.blue,V=i.alpha;if(r.equals(o,i)){for(f=0;f<g;f++)l[p++]=r.floatToByte(n),l[p++]=r.floatToByte(m),l[p++]=r.floatToByte(d),l[p++]=r.floatToByte(T);return p}let M=(c-n)/g,C=(h-m)/g,G=(y-d)/g,_=(V-T)/g,a=p;for(f=0;f<g;f++)l[a++]=r.floatToByte(n+f*M),l[a++]=r.floatToByte(m+f*C),l[a++]=r.floatToByte(d+f*G),l[a++]=r.floatToByte(T+f*_);return a}function R(t){t=w(t,w.EMPTY_OBJECT);let e=t.positions,o=t.colors,i=w(t.colorsPerVertex,!1);if(!u(e)||e.length<2)throw new L("At least two positions are required.");if(u(o)&&(i&&o.length<e.length||!i&&o.length<e.length-1))throw new L("colors has an invalid length.");this._positions=e,this._colors=o,this._colorsPerVertex=i,this._arcType=w(t.arcType,S.GEODESIC),this._granularity=w(t.granularity,q.RADIANS_PER_DEGREE),this._ellipsoid=w(t.ellipsoid,b.default),this._workerName="createSimplePolylineGeometry";let s=1+e.length*k.packedLength;s+=u(o)?1+o.length*r.packedLength:1,this.packedLength=s+b.packedLength+3}R.pack=function(t,e,o){if(!u(t))throw new L("value is required");if(!u(e))throw new L("array is required");o=w(o,0);let i,s=t._positions,l=s.length;for(e[o++]=l,i=0;i<l;++i,o+=k.packedLength)k.pack(s[i],e,o);let p=t._colors;for(l=u(p)?p.length:0,e[o++]=l,i=0;i<l;++i,o+=r.packedLength)r.pack(p[i],e,o);return b.pack(t._ellipsoid,e,o),o+=b.packedLength,e[o++]=t._colorsPerVertex?1:0,e[o++]=t._arcType,e[o]=t._granularity,e};R.unpack=function(t,e,o){if(!u(t))throw new L("array is required");e=w(e,0);let i,s=t[e++],l=new Array(s);for(i=0;i<s;++i,e+=k.packedLength)l[i]=k.unpack(t,e);s=t[e++];let p=s>0?new Array(s):void 0;for(i=0;i<s;++i,e+=r.packedLength)p[i]=r.unpack(t,e);let g=b.unpack(t,e);e+=b.packedLength;let f=t[e++]===1,n=t[e++],m=t[e];return u(o)?(o._positions=l,o._colors=p,o._ellipsoid=g,o._colorsPerVertex=f,o._arcType=n,o._granularity=m,o):new R({positions:l,colors:p,ellipsoid:g,colorsPerVertex:f,arcType:n,granularity:m})};var F=new Array(2),N=new Array(2),$={positions:F,height:N,ellipsoid:void 0,minDistance:void 0,granularity:void 0};R.createGeometry=function(t){let e=t._positions,o=t._colors,i=t._colorsPerVertex,s=t._arcType,l=t._granularity,p=t._ellipsoid,g=q.chordLength(l,p.maximumRadius),f=u(o)&&!i,n,m=e.length,d,T,c,h,y=0;if(s===S.GEODESIC||s===S.RHUMB){let _,a,P;s===S.GEODESIC?(_=q.chordLength(l,p.maximumRadius),a=E.numberOfPoints,P=E.generateArc):(_=l,a=E.numberOfPointsRhumbLine,P=E.generateRhumbArc);let v=E.extractHeights(e,p),B=$;if(s===S.GEODESIC?B.minDistance=g:B.granularity=l,B.ellipsoid=p,f){let A=0;for(n=0;n<m-1;n++)A+=a(e[n],e[n+1],_)+1;d=new Float64Array(A*3),c=new Uint8Array(A*4),B.positions=F,B.height=N;let D=0;for(n=0;n<m-1;++n){F[0]=e[n],F[1]=e[n+1],N[0]=v[n],N[1]=v[n+1];let O=P(B);if(u(o)){let z=O.length/3;h=o[n];for(let U=0;U<z;++U)c[D++]=r.floatToByte(h.red),c[D++]=r.floatToByte(h.green),c[D++]=r.floatToByte(h.blue),c[D++]=r.floatToByte(h.alpha)}d.set(O,y),y+=O.length}}else if(B.positions=e,B.height=v,d=new Float64Array(P(B)),u(o)){for(c=new Uint8Array(d.length/3*4),n=0;n<m-1;++n){let D=e[n],O=e[n+1],z=o[n],U=o[n+1];y=Z(D,O,z,U,g,c,y)}let A=o[m-1];c[y++]=r.floatToByte(A.red),c[y++]=r.floatToByte(A.green),c[y++]=r.floatToByte(A.blue),c[y++]=r.floatToByte(A.alpha)}}else{T=f?m*2-2:m,d=new Float64Array(T*3),c=u(o)?new Uint8Array(T*4):void 0;let _=0,a=0;for(n=0;n<m;++n){let P=e[n];if(f&&n>0&&(k.pack(P,d,_),_+=3,h=o[n-1],c[a++]=r.floatToByte(h.red),c[a++]=r.floatToByte(h.green),c[a++]=r.floatToByte(h.blue),c[a++]=r.floatToByte(h.alpha)),f&&n===m-1)break;k.pack(P,d,_),_+=3,u(o)&&(h=o[n],c[a++]=r.floatToByte(h.red),c[a++]=r.floatToByte(h.green),c[a++]=r.floatToByte(h.blue),c[a++]=r.floatToByte(h.alpha))}}let V=new W;V.position=new Y({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:d}),u(o)&&(V.color=new Y({componentDatatype:H.UNSIGNED_BYTE,componentsPerAttribute:4,values:c,normalize:!0})),T=d.length/3;let M=(T-1)*2,C=X.createTypedArray(T,M),G=0;for(n=0;n<T-1;++n)C[G++]=n,C[G++]=n+1;return new Q({attributes:V,indices:C,primitiveType:K.LINES,boundingSphere:j.fromPoints(e)})};var J=R;function x(t,e){return u(e)&&(t=J.unpack(t,e)),t._ellipsoid=b.clone(t._ellipsoid),J.createGeometry(t)}var _e=x;export{_e as default}; +import{a as r}from"./chunk-H2CDK6OB.js";import{a as S}from"./chunk-GMMUK6QU.js";import{a as E}from"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as X}from"./chunk-YFQNY2YN.js";import{a as W}from"./chunk-NT26NNVH.js";import{b as K,c as Q,d as Y}from"./chunk-NW2YE576.js";import{d as j}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as H}from"./chunk-QHHYYTCM.js";import{a as k,d as b}from"./chunk-RH3GFHG2.js";import{a as q}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as w}from"./chunk-TA3RE4KQ.js";import{a as L}from"./chunk-RTY3VPG6.js";import{e as u}from"./chunk-LRNH5AEO.js";function Z(t,e,o,i,s,l,p){let g=E.numberOfPoints(t,e,s),f,n=o.red,m=o.green,d=o.blue,T=o.alpha,c=i.red,h=i.green,y=i.blue,V=i.alpha;if(r.equals(o,i)){for(f=0;f<g;f++)l[p++]=r.floatToByte(n),l[p++]=r.floatToByte(m),l[p++]=r.floatToByte(d),l[p++]=r.floatToByte(T);return p}let M=(c-n)/g,C=(h-m)/g,G=(y-d)/g,_=(V-T)/g,a=p;for(f=0;f<g;f++)l[a++]=r.floatToByte(n+f*M),l[a++]=r.floatToByte(m+f*C),l[a++]=r.floatToByte(d+f*G),l[a++]=r.floatToByte(T+f*_);return a}function R(t){t=w(t,w.EMPTY_OBJECT);let e=t.positions,o=t.colors,i=w(t.colorsPerVertex,!1);if(!u(e)||e.length<2)throw new L("At least two positions are required.");if(u(o)&&(i&&o.length<e.length||!i&&o.length<e.length-1))throw new L("colors has an invalid length.");this._positions=e,this._colors=o,this._colorsPerVertex=i,this._arcType=w(t.arcType,S.GEODESIC),this._granularity=w(t.granularity,q.RADIANS_PER_DEGREE),this._ellipsoid=w(t.ellipsoid,b.default),this._workerName="createSimplePolylineGeometry";let s=1+e.length*k.packedLength;s+=u(o)?1+o.length*r.packedLength:1,this.packedLength=s+b.packedLength+3}R.pack=function(t,e,o){if(!u(t))throw new L("value is required");if(!u(e))throw new L("array is required");o=w(o,0);let i,s=t._positions,l=s.length;for(e[o++]=l,i=0;i<l;++i,o+=k.packedLength)k.pack(s[i],e,o);let p=t._colors;for(l=u(p)?p.length:0,e[o++]=l,i=0;i<l;++i,o+=r.packedLength)r.pack(p[i],e,o);return b.pack(t._ellipsoid,e,o),o+=b.packedLength,e[o++]=t._colorsPerVertex?1:0,e[o++]=t._arcType,e[o]=t._granularity,e};R.unpack=function(t,e,o){if(!u(t))throw new L("array is required");e=w(e,0);let i,s=t[e++],l=new Array(s);for(i=0;i<s;++i,e+=k.packedLength)l[i]=k.unpack(t,e);s=t[e++];let p=s>0?new Array(s):void 0;for(i=0;i<s;++i,e+=r.packedLength)p[i]=r.unpack(t,e);let g=b.unpack(t,e);e+=b.packedLength;let f=t[e++]===1,n=t[e++],m=t[e];return u(o)?(o._positions=l,o._colors=p,o._ellipsoid=g,o._colorsPerVertex=f,o._arcType=n,o._granularity=m,o):new R({positions:l,colors:p,ellipsoid:g,colorsPerVertex:f,arcType:n,granularity:m})};var F=new Array(2),N=new Array(2),$={positions:F,height:N,ellipsoid:void 0,minDistance:void 0,granularity:void 0};R.createGeometry=function(t){let e=t._positions,o=t._colors,i=t._colorsPerVertex,s=t._arcType,l=t._granularity,p=t._ellipsoid,g=q.chordLength(l,p.maximumRadius),f=u(o)&&!i,n,m=e.length,d,T,c,h,y=0;if(s===S.GEODESIC||s===S.RHUMB){let _,a,P;s===S.GEODESIC?(_=q.chordLength(l,p.maximumRadius),a=E.numberOfPoints,P=E.generateArc):(_=l,a=E.numberOfPointsRhumbLine,P=E.generateRhumbArc);let v=E.extractHeights(e,p),B=$;if(s===S.GEODESIC?B.minDistance=g:B.granularity=l,B.ellipsoid=p,f){let A=0;for(n=0;n<m-1;n++)A+=a(e[n],e[n+1],_)+1;d=new Float64Array(A*3),c=new Uint8Array(A*4),B.positions=F,B.height=N;let D=0;for(n=0;n<m-1;++n){F[0]=e[n],F[1]=e[n+1],N[0]=v[n],N[1]=v[n+1];let O=P(B);if(u(o)){let z=O.length/3;h=o[n];for(let U=0;U<z;++U)c[D++]=r.floatToByte(h.red),c[D++]=r.floatToByte(h.green),c[D++]=r.floatToByte(h.blue),c[D++]=r.floatToByte(h.alpha)}d.set(O,y),y+=O.length}}else if(B.positions=e,B.height=v,d=new Float64Array(P(B)),u(o)){for(c=new Uint8Array(d.length/3*4),n=0;n<m-1;++n){let D=e[n],O=e[n+1],z=o[n],U=o[n+1];y=Z(D,O,z,U,g,c,y)}let A=o[m-1];c[y++]=r.floatToByte(A.red),c[y++]=r.floatToByte(A.green),c[y++]=r.floatToByte(A.blue),c[y++]=r.floatToByte(A.alpha)}}else{T=f?m*2-2:m,d=new Float64Array(T*3),c=u(o)?new Uint8Array(T*4):void 0;let _=0,a=0;for(n=0;n<m;++n){let P=e[n];if(f&&n>0&&(k.pack(P,d,_),_+=3,h=o[n-1],c[a++]=r.floatToByte(h.red),c[a++]=r.floatToByte(h.green),c[a++]=r.floatToByte(h.blue),c[a++]=r.floatToByte(h.alpha)),f&&n===m-1)break;k.pack(P,d,_),_+=3,u(o)&&(h=o[n],c[a++]=r.floatToByte(h.red),c[a++]=r.floatToByte(h.green),c[a++]=r.floatToByte(h.blue),c[a++]=r.floatToByte(h.alpha))}}let V=new W;V.position=new Y({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:d}),u(o)&&(V.color=new Y({componentDatatype:H.UNSIGNED_BYTE,componentsPerAttribute:4,values:c,normalize:!0})),T=d.length/3;let M=(T-1)*2,C=X.createTypedArray(T,M),G=0;for(n=0;n<T-1;++n)C[G++]=n,C[G++]=n+1;return new Q({attributes:V,indices:C,primitiveType:K.LINES,boundingSphere:j.fromPoints(e)})};var J=R;function x(t,e){return u(e)&&(t=J.unpack(t,e)),t._ellipsoid=b.clone(t._ellipsoid),J.createGeometry(t)}var _e=x;export{_e as default}; diff --git a/public/js/Cesium2/Workers/createSphereGeometry.js b/public/js/Cesium2/Workers/createSphereGeometry.js index 58c353a4b..740ec7832 100644 --- a/public/js/Cesium2/Workers/createSphereGeometry.js +++ b/public/js/Cesium2/Workers/createSphereGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as r}from"./chunk-HQXG4R4L.js";import"./chunk-5CC3QRYS.js";import{a as m}from"./chunk-6HIVPZ7K.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as s}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as l}from"./chunk-N3A5CZ2S.js";import{b as p}from"./chunk-G75U3WZT.js";import{e as c}from"./chunk-3THTQ4QB.js";function n(e){let t=l(e.radius,1),o={radii:new s(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new r(o),this._workerName="createSphereGeometry"}n.packedLength=r.packedLength;n.pack=function(e,t,a){return p.typeOf.object("value",e),r.pack(e._ellipsoidGeometry,t,a)};var f=new r,i={radius:void 0,radii:new s,vertexFormat:new m,stackPartitions:void 0,slicePartitions:void 0};n.unpack=function(e,t,a){let o=r.unpack(e,t,f);return i.vertexFormat=m.clone(o._vertexFormat,i.vertexFormat),i.stackPartitions=o._stackPartitions,i.slicePartitions=o._slicePartitions,c(a)?(s.clone(o._radii,i.radii),a._ellipsoidGeometry=new r(i),a):(i.radius=o._radii.x,new n(i))};n.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)};var d=n;function u(e,t){return c(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}var v=u;export{v as default}; +import{a as r}from"./chunk-T4KTDR3V.js";import"./chunk-N5SNKJ43.js";import{a as m}from"./chunk-6VK5R74O.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as s}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as l}from"./chunk-TA3RE4KQ.js";import{b as p}from"./chunk-RTY3VPG6.js";import{e as c}from"./chunk-LRNH5AEO.js";function n(e){let t=l(e.radius,1),o={radii:new s(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new r(o),this._workerName="createSphereGeometry"}n.packedLength=r.packedLength;n.pack=function(e,t,a){return p.typeOf.object("value",e),r.pack(e._ellipsoidGeometry,t,a)};var f=new r,i={radius:void 0,radii:new s,vertexFormat:new m,stackPartitions:void 0,slicePartitions:void 0};n.unpack=function(e,t,a){let o=r.unpack(e,t,f);return i.vertexFormat=m.clone(o._vertexFormat,i.vertexFormat),i.stackPartitions=o._stackPartitions,i.slicePartitions=o._slicePartitions,c(a)?(s.clone(o._radii,i.radii),a._ellipsoidGeometry=new r(i),a):(i.radius=o._radii.x,new n(i))};n.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)};var d=n;function u(e,t){return c(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}var v=u;export{v as default}; diff --git a/public/js/Cesium2/Workers/createSphereOutlineGeometry.js b/public/js/Cesium2/Workers/createSphereOutlineGeometry.js index 5e055a4f8..930b33e6f 100644 --- a/public/js/Cesium2/Workers/createSphereOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createSphereOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as t}from"./chunk-N5HLZFHR.js";import"./chunk-5CC3QRYS.js";import"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as d}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as l}from"./chunk-N3A5CZ2S.js";import{b as u}from"./chunk-G75U3WZT.js";import{e as a}from"./chunk-3THTQ4QB.js";function s(i){let e=l(i.radius,1),r={radii:new d(e,e,e),stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new t(r),this._workerName="createSphereOutlineGeometry"}s.packedLength=t.packedLength;s.pack=function(i,e,o){return u.typeOf.object("value",i),t.pack(i._ellipsoidGeometry,e,o)};var m=new t,n={radius:void 0,radii:new d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};s.unpack=function(i,e,o){let r=t.unpack(i,e,m);return n.stackPartitions=r._stackPartitions,n.slicePartitions=r._slicePartitions,n.subdivisions=r._subdivisions,a(o)?(d.clone(r._radii,n.radii),o._ellipsoidGeometry=new t(n),o):(n.radius=r._radii.x,new s(n))};s.createGeometry=function(i){return t.createGeometry(i._ellipsoidGeometry)};var c=s;function p(i,e){return a(e)&&(i=c.unpack(i,e)),c.createGeometry(i)}var w=p;export{w as default}; +import{a as t}from"./chunk-SXC2BH5N.js";import"./chunk-N5SNKJ43.js";import"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as d}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as l}from"./chunk-TA3RE4KQ.js";import{b as u}from"./chunk-RTY3VPG6.js";import{e as a}from"./chunk-LRNH5AEO.js";function s(i){let e=l(i.radius,1),r={radii:new d(e,e,e),stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new t(r),this._workerName="createSphereOutlineGeometry"}s.packedLength=t.packedLength;s.pack=function(i,e,o){return u.typeOf.object("value",i),t.pack(i._ellipsoidGeometry,e,o)};var m=new t,n={radius:void 0,radii:new d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};s.unpack=function(i,e,o){let r=t.unpack(i,e,m);return n.stackPartitions=r._stackPartitions,n.slicePartitions=r._slicePartitions,n.subdivisions=r._subdivisions,a(o)?(d.clone(r._radii,n.radii),o._ellipsoidGeometry=new t(n),o):(n.radius=r._radii.x,new s(n))};s.createGeometry=function(i){return t.createGeometry(i._ellipsoidGeometry)};var c=s;function p(i,e){return a(e)&&(i=c.unpack(i,e)),c.createGeometry(i)}var w=p;export{w as default}; diff --git a/public/js/Cesium2/Workers/createTaskProcessorWorker.js b/public/js/Cesium2/Workers/createTaskProcessorWorker.js index 04a2a6c97..858690ebc 100644 --- a/public/js/Cesium2/Workers/createTaskProcessorWorker.js +++ b/public/js/Cesium2/Workers/createTaskProcessorWorker.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a}from"./chunk-4BYMTYMT.js";import"./chunk-3THTQ4QB.js";export{a as default}; +import{a}from"./chunk-4E3APMCC.js";import"./chunk-LRNH5AEO.js";export{a as default}; diff --git a/public/js/Cesium2/Workers/createVectorTileClampedPolylines.js b/public/js/Cesium2/Workers/createVectorTileClampedPolylines.js index 323aee088..42f0fff8c 100644 --- a/public/js/Cesium2/Workers/createVectorTileClampedPolylines.js +++ b/public/js/Cesium2/Workers/createVectorTileClampedPolylines.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as J}from"./chunk-4BYMTYMT.js";import{a as Y}from"./chunk-Q5MYX5A2.js";import{a as B}from"./chunk-34ULWVZF.js";import{c as X,h as W}from"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as t,b as k,d as _}from"./chunk-S4VBGY2U.js";import{a as v}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import"./chunk-3THTQ4QB.js";var V=32767,it=Math.cos(v.toRadians(150)),ct=new k,rt=new t;function at(e,o,c,i,s,A,h){let g=e.length,f=new Float64Array(g*3);for(let d=0;d<g;++d){let l=e[d],r=o[d],E=c[d],n=v.lerp(i.west,i.east,l/V),p=v.lerp(i.south,i.north,r/V),w=v.lerp(s,A,E/V),x=k.fromRadians(n,p,w,ct),P=h.cartographicToCartesian(x,rt);t.pack(P,f,d*3)}return f}function dt(e){let o=e.length,c=new Uint32Array(o+1),i=0;for(let s=0;s<o;++s)c[s]=i,i+=e[s];return c[o]=i,c}var lt=new k,ht=new k;function ft(e,o,c,i){let s=i.length,A=e.length,h=new Uint8Array(A),g=lt,f=ht,d=0;for(let r=0;r<s;r++){let E=i[r],n=E;for(let p=1;p<E;p++){let w=d+p,x=w-1;f.longitude=e[w],f.latitude=o[w],g.longitude=e[x],g.latitude=o[x],k.equals(f,g)&&(n--,h[x]=1)}i[r]=n,d+=E}let l=0;for(let r=0;r<A;r++)h[r]!==1&&(e[l]=e[r],o[l]=o[r],c[l]=c[r],l++)}function ot(e){let o=e*8,c=o*3,i=o*4;this.startEllipsoidNormals=new Float32Array(c),this.endEllipsoidNormals=new Float32Array(c),this.startPositionAndHeights=new Float32Array(i),this.startFaceNormalAndVertexCornerIds=new Float32Array(i),this.endPositionAndHeights=new Float32Array(i),this.endFaceNormalAndHalfWidths=new Float32Array(i),this.vertexBatchIds=new Uint16Array(o),this.indices=B.createTypedArray(o,36*e),this.vec3Offset=0,this.vec4Offset=0,this.batchIdOffset=0,this.indexOffset=0,this.volumeStartIndex=0}var Q=new t,pt=new t;function $(e,o,c,i,s){let A=t.subtract(c,o,pt),h=t.subtract(o,e,Q);return t.normalize(A,A),t.normalize(h,h),t.dot(A,h)<it&&(h=t.multiplyByScalar(h,-1,Q)),t.add(A,h,s),t.equals(s,t.ZERO)&&(s=t.subtract(e,o)),t.cross(s,i,s),t.cross(i,s,s),t.normalize(s,s),s}var st=[0,2,6,0,6,4,0,1,3,0,3,2,0,4,5,0,5,1,5,3,1,5,7,3,7,5,4,7,4,6,7,6,2,7,2,3],j=st.length,tt=new t,ut=new t,mt=new t,At=new t,Nt=new t;ot.prototype.addVolume=function(e,o,c,i,s,A,h,g,f,d){let l=t.add(o,f,tt),r=d.geodeticSurfaceNormal(l,ut);l=t.add(c,f,tt);let E=d.geodeticSurfaceNormal(l,At),n=$(e,o,c,r,mt),p=$(i,c,o,E,Nt),w=this.startEllipsoidNormals,x=this.endEllipsoidNormals,P=this.startPositionAndHeights,H=this.startFaceNormalAndVertexCornerIds,b=this.endPositionAndHeights,a=this.endFaceNormalAndHalfWidths,F=this.vertexBatchIds,m=this.batchIdOffset,I=this.vec3Offset,u=this.vec4Offset,N;for(N=0;N<8;N++)t.pack(r,w,I),t.pack(E,x,I),t.pack(o,P,u),P[u+3]=s,t.pack(c,b,u),b[u+3]=A,t.pack(n,H,u),H[u+3]=N,t.pack(p,a,u),a[u+3]=h,F[m++]=g,I+=3,u+=4;this.batchIdOffset=m,this.vec3Offset=I,this.vec4Offset=u;let C=this.indices,y=this.volumeStartIndex,z=this.indexOffset;for(N=0;N<j;N++)C[z+N]=st[N]+y;this.volumeStartIndex+=8,this.indexOffset+=j};var gt=new W,Et=new _,wt=new t,M=new t,It=new t,xt=new t,T=new t;function Pt(e,o){let c=new Uint16Array(e.positions),i=new Uint16Array(e.widths),s=new Uint32Array(e.counts),A=new Uint16Array(e.batchIds),h=gt,g=Et,f=wt,d=new Float64Array(e.packedBuffer),l=0,r=d[l++],E=d[l++];W.unpack(d,l,h),l+=W.packedLength,_.unpack(d,l,g),l+=_.packedLength,t.unpack(d,l,f);let n,p=c.length/3,w=c.subarray(0,p),x=c.subarray(p,2*p),P=c.subarray(2*p,3*p);Y.zigZagDeltaDecode(w,x,P),ft(w,x,P,s);let H=s.length,b=0;for(n=0;n<H;n++){let y=s[n];b+=y-1}let a=new ot(b),F=at(w,x,P,h,r,E,g,f);p=w.length;let m=new Float32Array(p*3);for(n=0;n<p;++n)m[n*3]=F[n*3]-f.x,m[n*3+1]=F[n*3+1]-f.y,m[n*3+2]=F[n*3+2]-f.z;let I=0,u=0;for(n=0;n<H;n++){let y=s[n]-1,z=i[n]*.5,et=A[n],q=I;for(let D=0;D<y;D++){let S=t.unpack(m,I,It),O=t.unpack(m,I+3,xt),G=P[u],Z=P[u+1];G=v.lerp(r,E,G/V),Z=v.lerp(r,E,Z/V),u++;let L=M,R=T;if(D===0){let U=q+y*3,K=t.unpack(m,U,M);if(t.equals(K,S))t.unpack(m,U-3,L);else{let nt=t.subtract(S,O,M);L=t.add(nt,S,M)}}else t.unpack(m,I-3,L);if(D===y-1){let U=t.unpack(m,q,T);if(t.equals(U,O))t.unpack(m,q+3,R);else{let K=t.subtract(O,S,T);R=t.add(K,O,T)}}else t.unpack(m,I+6,R);a.addVolume(L,S,O,R,G,Z,z,et,f,g),I+=3}I+=3,u++}let N=a.indices;o.push(a.startEllipsoidNormals.buffer),o.push(a.endEllipsoidNormals.buffer),o.push(a.startPositionAndHeights.buffer),o.push(a.startFaceNormalAndVertexCornerIds.buffer),o.push(a.endPositionAndHeights.buffer),o.push(a.endFaceNormalAndHalfWidths.buffer),o.push(a.vertexBatchIds.buffer),o.push(N.buffer);let C={indexDatatype:N.BYTES_PER_ELEMENT===2?B.UNSIGNED_SHORT:B.UNSIGNED_INT,startEllipsoidNormals:a.startEllipsoidNormals.buffer,endEllipsoidNormals:a.endEllipsoidNormals.buffer,startPositionAndHeights:a.startPositionAndHeights.buffer,startFaceNormalAndVertexCornerIds:a.startFaceNormalAndVertexCornerIds.buffer,endPositionAndHeights:a.endPositionAndHeights.buffer,endFaceNormalAndHalfWidths:a.endFaceNormalAndHalfWidths.buffer,vertexBatchIds:a.vertexBatchIds.buffer,indices:N.buffer};if(e.keepDecodedPositions){let y=dt(s);o.push(F.buffer,y.buffer),C=X(C,{decodedPositions:F.buffer,decodedPositionOffsets:y.buffer})}return C}var Vt=J(Pt);export{Vt as default}; +import{a as J}from"./chunk-4E3APMCC.js";import{a as Y}from"./chunk-VMXXQ6B4.js";import{a as B}from"./chunk-YFQNY2YN.js";import{c as X,h as W}from"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as t,b as k,d as _}from"./chunk-RH3GFHG2.js";import{a as v}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import"./chunk-LRNH5AEO.js";var V=32767,it=Math.cos(v.toRadians(150)),ct=new k,rt=new t;function at(e,o,c,i,s,A,h){let g=e.length,f=new Float64Array(g*3);for(let d=0;d<g;++d){let l=e[d],r=o[d],E=c[d],n=v.lerp(i.west,i.east,l/V),p=v.lerp(i.south,i.north,r/V),w=v.lerp(s,A,E/V),x=k.fromRadians(n,p,w,ct),P=h.cartographicToCartesian(x,rt);t.pack(P,f,d*3)}return f}function dt(e){let o=e.length,c=new Uint32Array(o+1),i=0;for(let s=0;s<o;++s)c[s]=i,i+=e[s];return c[o]=i,c}var lt=new k,ht=new k;function ft(e,o,c,i){let s=i.length,A=e.length,h=new Uint8Array(A),g=lt,f=ht,d=0;for(let r=0;r<s;r++){let E=i[r],n=E;for(let p=1;p<E;p++){let w=d+p,x=w-1;f.longitude=e[w],f.latitude=o[w],g.longitude=e[x],g.latitude=o[x],k.equals(f,g)&&(n--,h[x]=1)}i[r]=n,d+=E}let l=0;for(let r=0;r<A;r++)h[r]!==1&&(e[l]=e[r],o[l]=o[r],c[l]=c[r],l++)}function ot(e){let o=e*8,c=o*3,i=o*4;this.startEllipsoidNormals=new Float32Array(c),this.endEllipsoidNormals=new Float32Array(c),this.startPositionAndHeights=new Float32Array(i),this.startFaceNormalAndVertexCornerIds=new Float32Array(i),this.endPositionAndHeights=new Float32Array(i),this.endFaceNormalAndHalfWidths=new Float32Array(i),this.vertexBatchIds=new Uint16Array(o),this.indices=B.createTypedArray(o,36*e),this.vec3Offset=0,this.vec4Offset=0,this.batchIdOffset=0,this.indexOffset=0,this.volumeStartIndex=0}var Q=new t,pt=new t;function $(e,o,c,i,s){let A=t.subtract(c,o,pt),h=t.subtract(o,e,Q);return t.normalize(A,A),t.normalize(h,h),t.dot(A,h)<it&&(h=t.multiplyByScalar(h,-1,Q)),t.add(A,h,s),t.equals(s,t.ZERO)&&(s=t.subtract(e,o)),t.cross(s,i,s),t.cross(i,s,s),t.normalize(s,s),s}var st=[0,2,6,0,6,4,0,1,3,0,3,2,0,4,5,0,5,1,5,3,1,5,7,3,7,5,4,7,4,6,7,6,2,7,2,3],j=st.length,tt=new t,ut=new t,mt=new t,At=new t,Nt=new t;ot.prototype.addVolume=function(e,o,c,i,s,A,h,g,f,d){let l=t.add(o,f,tt),r=d.geodeticSurfaceNormal(l,ut);l=t.add(c,f,tt);let E=d.geodeticSurfaceNormal(l,At),n=$(e,o,c,r,mt),p=$(i,c,o,E,Nt),w=this.startEllipsoidNormals,x=this.endEllipsoidNormals,P=this.startPositionAndHeights,H=this.startFaceNormalAndVertexCornerIds,b=this.endPositionAndHeights,a=this.endFaceNormalAndHalfWidths,F=this.vertexBatchIds,m=this.batchIdOffset,I=this.vec3Offset,u=this.vec4Offset,N;for(N=0;N<8;N++)t.pack(r,w,I),t.pack(E,x,I),t.pack(o,P,u),P[u+3]=s,t.pack(c,b,u),b[u+3]=A,t.pack(n,H,u),H[u+3]=N,t.pack(p,a,u),a[u+3]=h,F[m++]=g,I+=3,u+=4;this.batchIdOffset=m,this.vec3Offset=I,this.vec4Offset=u;let C=this.indices,y=this.volumeStartIndex,z=this.indexOffset;for(N=0;N<j;N++)C[z+N]=st[N]+y;this.volumeStartIndex+=8,this.indexOffset+=j};var gt=new W,Et=new _,wt=new t,M=new t,It=new t,xt=new t,T=new t;function Pt(e,o){let c=new Uint16Array(e.positions),i=new Uint16Array(e.widths),s=new Uint32Array(e.counts),A=new Uint16Array(e.batchIds),h=gt,g=Et,f=wt,d=new Float64Array(e.packedBuffer),l=0,r=d[l++],E=d[l++];W.unpack(d,l,h),l+=W.packedLength,_.unpack(d,l,g),l+=_.packedLength,t.unpack(d,l,f);let n,p=c.length/3,w=c.subarray(0,p),x=c.subarray(p,2*p),P=c.subarray(2*p,3*p);Y.zigZagDeltaDecode(w,x,P),ft(w,x,P,s);let H=s.length,b=0;for(n=0;n<H;n++){let y=s[n];b+=y-1}let a=new ot(b),F=at(w,x,P,h,r,E,g,f);p=w.length;let m=new Float32Array(p*3);for(n=0;n<p;++n)m[n*3]=F[n*3]-f.x,m[n*3+1]=F[n*3+1]-f.y,m[n*3+2]=F[n*3+2]-f.z;let I=0,u=0;for(n=0;n<H;n++){let y=s[n]-1,z=i[n]*.5,et=A[n],q=I;for(let D=0;D<y;D++){let S=t.unpack(m,I,It),O=t.unpack(m,I+3,xt),G=P[u],Z=P[u+1];G=v.lerp(r,E,G/V),Z=v.lerp(r,E,Z/V),u++;let L=M,R=T;if(D===0){let U=q+y*3,K=t.unpack(m,U,M);if(t.equals(K,S))t.unpack(m,U-3,L);else{let nt=t.subtract(S,O,M);L=t.add(nt,S,M)}}else t.unpack(m,I-3,L);if(D===y-1){let U=t.unpack(m,q,T);if(t.equals(U,O))t.unpack(m,q+3,R);else{let K=t.subtract(O,S,T);R=t.add(K,O,T)}}else t.unpack(m,I+6,R);a.addVolume(L,S,O,R,G,Z,z,et,f,g),I+=3}I+=3,u++}let N=a.indices;o.push(a.startEllipsoidNormals.buffer),o.push(a.endEllipsoidNormals.buffer),o.push(a.startPositionAndHeights.buffer),o.push(a.startFaceNormalAndVertexCornerIds.buffer),o.push(a.endPositionAndHeights.buffer),o.push(a.endFaceNormalAndHalfWidths.buffer),o.push(a.vertexBatchIds.buffer),o.push(N.buffer);let C={indexDatatype:N.BYTES_PER_ELEMENT===2?B.UNSIGNED_SHORT:B.UNSIGNED_INT,startEllipsoidNormals:a.startEllipsoidNormals.buffer,endEllipsoidNormals:a.endEllipsoidNormals.buffer,startPositionAndHeights:a.startPositionAndHeights.buffer,startFaceNormalAndVertexCornerIds:a.startFaceNormalAndVertexCornerIds.buffer,endPositionAndHeights:a.endPositionAndHeights.buffer,endFaceNormalAndHalfWidths:a.endFaceNormalAndHalfWidths.buffer,vertexBatchIds:a.vertexBatchIds.buffer,indices:N.buffer};if(e.keepDecodedPositions){let y=dt(s);o.push(F.buffer,y.buffer),C=X(C,{decodedPositions:F.buffer,decodedPositionOffsets:y.buffer})}return C}var Vt=J(Pt);export{Vt as default}; diff --git a/public/js/Cesium2/Workers/createVectorTileGeometries.js b/public/js/Cesium2/Workers/createVectorTileGeometries.js index d5965dcfa..2e1438b76 100644 --- a/public/js/Cesium2/Workers/createVectorTileGeometries.js +++ b/public/js/Cesium2/Workers/createVectorTileGeometries.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as P}from"./chunk-JXLT7VPX.js";import{a as z}from"./chunk-ZFYLUAMF.js";import"./chunk-OTRIIEF3.js";import{a as H}from"./chunk-HQXG4R4L.js";import{a as Y}from"./chunk-4BYMTYMT.js";import{a as j}from"./chunk-ZHF7X3YD.js";import"./chunk-5CC3QRYS.js";import"./chunk-6HIVPZ7K.js";import{a as W}from"./chunk-34ULWVZF.js";import"./chunk-24JYWT5N.js";import"./chunk-LH3SUUXG.js";import{d as E}from"./chunk-K2M3OJ7Z.js";import{b as d}from"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as o}from"./chunk-S4VBGY2U.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{e as l}from"./chunk-3THTQ4QB.js";function X(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var J=X;var S=new o,$=d.packedLength+o.packedLength,ee=d.packedLength+2,ne=d.packedLength+o.packedLength,te=o.packedLength+1,u={modelMatrix:new d,boundingVolume:new E};function oe(e,c){let n=c*$,i=o.unpack(e,n,S);n+=o.packedLength;let r=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(r,i,r);let t=u.boundingVolume;return o.clone(o.ZERO,t.center),t.radius=Math.sqrt(3),u}function ce(e,c){let n=c*ee,i=e[n++],r=e[n++],t=o.fromElements(i,i,r,S),s=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(s,t,s);let h=u.boundingVolume;return o.clone(o.ZERO,h.center),h.radius=Math.sqrt(2),u}function se(e,c){let n=c*ne,i=o.unpack(e,n,S);n+=o.packedLength;let r=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(r,i,r);let t=u.boundingVolume;return o.clone(o.ZERO,t.center),t.radius=1,u}function ie(e,c){let n=c*te,i=e[n++],r=o.unpack(e,n,S),t=d.fromTranslation(r,u.modelMatrix);d.multiplyByUniformScale(t,i,t);let s=u.boundingVolume;return o.clone(o.ZERO,s.center),s.radius=1,u}var de=new o;function R(e,c,n,i,r){if(!l(c))return;let t=n.length,s=i.attributes.position.values,h=i.indices,a=e.positions,x=e.vertexBatchIds,y=e.indices,I=e.batchIds,p=e.batchTableColors,T=e.batchedIndices,U=e.indexOffsets,v=e.indexCounts,L=e.boundingVolumes,F=e.modelMatrix,Z=e.center,V=e.positionOffset,B=e.batchIdIndex,O=e.indexOffset,D=e.batchedIndicesOffset;for(let w=0;w<t;++w){let C=r(c,w),k=C.modelMatrix;d.multiply(F,k,k);let M=n[w],A=s.length;for(let f=0;f<A;f+=3){let m=o.unpack(s,f,de);d.multiplyByPoint(k,m,m),o.subtract(m,Z,m),o.pack(m,a,V*3+f),x[B++]=M}let b=h.length;for(let f=0;f<b;++f)y[O+f]=h[f]+V;let g=w+D;T[g]=new J({offset:O,count:b,color:P.fromRgba(p[M]),batchIds:[M]}),I[g]=M,U[g]=O,v[g]=b,L[g]=E.transform(C.boundingVolume,k),V+=A/3,O+=b}e.positionOffset=V,e.batchIdIndex=B,e.indexOffset=O,e.batchedIndicesOffset+=t}var K=new o,Q=new d;function re(e){let c=new Float64Array(e),n=0;o.unpack(c,n,K),n+=o.packedLength,d.unpack(c,n,Q)}function le(e){let c=e.length,n=0;for(let i=0;i<c;++i)n+=P.packedLength+3+e[i].batchIds.length;return n}function ae(e,c,n){let i=n.length,r=2+i*E.packedLength+1+le(c),t=new Float64Array(r),s=0;t[s++]=e,t[s++]=i;for(let a=0;a<i;++a)E.pack(n[a],t,s),s+=E.packedLength;let h=c.length;t[s++]=h;for(let a=0;a<h;++a){let x=c[a];P.pack(x.color,t,s),s+=P.packedLength,t[s++]=x.offset,t[s++]=x.count;let y=x.batchIds,I=y.length;t[s++]=I;for(let p=0;p<I;++p)t[s++]=y[p]}return t}function fe(e,c){let n=l(e.boxes)?new Float32Array(e.boxes):void 0,i=l(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,r=l(e.cylinders)?new Float32Array(e.cylinders):void 0,t=l(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,s=l(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,h=l(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,a=l(e.spheres)?new Float32Array(e.spheres):void 0,x=l(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,y=l(n)?i.length:0,I=l(r)?t.length:0,p=l(s)?h.length:0,T=l(a)?x.length:0,U=j.getUnitBox(),v=z.getUnitCylinder(),L=H.getUnitEllipsoid(),F=U.attributes.position.values,Z=v.attributes.position.values,V=L.attributes.position.values,B=F.length*y;B+=Z.length*I,B+=V.length*(p+T);let O=U.indices,D=v.indices,w=L.indices,C=O.length*y;C+=D.length*I,C+=w.length*(p+T);let k=new Float32Array(B),M=new Uint16Array(B/3),A=W.createTypedArray(B/3,C),b=y+I+p+T,g=new Uint16Array(b),f=new Array(b),m=new Uint32Array(b),q=new Uint32Array(b),_=new Array(b);re(e.packedBuffer);let G={batchTableColors:new Uint32Array(e.batchTableColors),positions:k,vertexBatchIds:M,indices:A,batchIds:g,batchedIndices:f,indexOffsets:m,indexCounts:q,boundingVolumes:_,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:Q,center:K};R(G,n,i,U,oe),R(G,r,t,v,ce),R(G,s,h,L,se),R(G,a,x,L,ie);let N=ae(A.BYTES_PER_ELEMENT,f,_);return c.push(k.buffer,M.buffer,A.buffer),c.push(g.buffer,m.buffer,q.buffer),c.push(N.buffer),{positions:k.buffer,vertexBatchIds:M.buffer,indices:A.buffer,indexOffsets:m.buffer,indexCounts:q.buffer,batchIds:g.buffer,packedBuffer:N.buffer}}var Oe=Y(fe);export{Oe as default}; +import{a as P}from"./chunk-H2CDK6OB.js";import{a as z}from"./chunk-SN56D5AL.js";import"./chunk-QV3DAXWD.js";import{a as H}from"./chunk-T4KTDR3V.js";import{a as Y}from"./chunk-4E3APMCC.js";import{a as j}from"./chunk-DTSLUHDY.js";import"./chunk-N5SNKJ43.js";import"./chunk-6VK5R74O.js";import{a as W}from"./chunk-YFQNY2YN.js";import"./chunk-NT26NNVH.js";import"./chunk-NW2YE576.js";import{d as E}from"./chunk-2NIQ5ECB.js";import{b as d}from"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as o}from"./chunk-RH3GFHG2.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{e as l}from"./chunk-LRNH5AEO.js";function X(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var J=X;var S=new o,$=d.packedLength+o.packedLength,ee=d.packedLength+2,ne=d.packedLength+o.packedLength,te=o.packedLength+1,u={modelMatrix:new d,boundingVolume:new E};function oe(e,c){let n=c*$,i=o.unpack(e,n,S);n+=o.packedLength;let r=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(r,i,r);let t=u.boundingVolume;return o.clone(o.ZERO,t.center),t.radius=Math.sqrt(3),u}function ce(e,c){let n=c*ee,i=e[n++],r=e[n++],t=o.fromElements(i,i,r,S),s=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(s,t,s);let h=u.boundingVolume;return o.clone(o.ZERO,h.center),h.radius=Math.sqrt(2),u}function se(e,c){let n=c*ne,i=o.unpack(e,n,S);n+=o.packedLength;let r=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(r,i,r);let t=u.boundingVolume;return o.clone(o.ZERO,t.center),t.radius=1,u}function ie(e,c){let n=c*te,i=e[n++],r=o.unpack(e,n,S),t=d.fromTranslation(r,u.modelMatrix);d.multiplyByUniformScale(t,i,t);let s=u.boundingVolume;return o.clone(o.ZERO,s.center),s.radius=1,u}var de=new o;function R(e,c,n,i,r){if(!l(c))return;let t=n.length,s=i.attributes.position.values,h=i.indices,a=e.positions,x=e.vertexBatchIds,y=e.indices,I=e.batchIds,p=e.batchTableColors,T=e.batchedIndices,U=e.indexOffsets,v=e.indexCounts,L=e.boundingVolumes,F=e.modelMatrix,Z=e.center,V=e.positionOffset,B=e.batchIdIndex,O=e.indexOffset,D=e.batchedIndicesOffset;for(let w=0;w<t;++w){let C=r(c,w),k=C.modelMatrix;d.multiply(F,k,k);let M=n[w],A=s.length;for(let f=0;f<A;f+=3){let m=o.unpack(s,f,de);d.multiplyByPoint(k,m,m),o.subtract(m,Z,m),o.pack(m,a,V*3+f),x[B++]=M}let b=h.length;for(let f=0;f<b;++f)y[O+f]=h[f]+V;let g=w+D;T[g]=new J({offset:O,count:b,color:P.fromRgba(p[M]),batchIds:[M]}),I[g]=M,U[g]=O,v[g]=b,L[g]=E.transform(C.boundingVolume,k),V+=A/3,O+=b}e.positionOffset=V,e.batchIdIndex=B,e.indexOffset=O,e.batchedIndicesOffset+=t}var K=new o,Q=new d;function re(e){let c=new Float64Array(e),n=0;o.unpack(c,n,K),n+=o.packedLength,d.unpack(c,n,Q)}function le(e){let c=e.length,n=0;for(let i=0;i<c;++i)n+=P.packedLength+3+e[i].batchIds.length;return n}function ae(e,c,n){let i=n.length,r=2+i*E.packedLength+1+le(c),t=new Float64Array(r),s=0;t[s++]=e,t[s++]=i;for(let a=0;a<i;++a)E.pack(n[a],t,s),s+=E.packedLength;let h=c.length;t[s++]=h;for(let a=0;a<h;++a){let x=c[a];P.pack(x.color,t,s),s+=P.packedLength,t[s++]=x.offset,t[s++]=x.count;let y=x.batchIds,I=y.length;t[s++]=I;for(let p=0;p<I;++p)t[s++]=y[p]}return t}function fe(e,c){let n=l(e.boxes)?new Float32Array(e.boxes):void 0,i=l(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,r=l(e.cylinders)?new Float32Array(e.cylinders):void 0,t=l(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,s=l(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,h=l(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,a=l(e.spheres)?new Float32Array(e.spheres):void 0,x=l(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,y=l(n)?i.length:0,I=l(r)?t.length:0,p=l(s)?h.length:0,T=l(a)?x.length:0,U=j.getUnitBox(),v=z.getUnitCylinder(),L=H.getUnitEllipsoid(),F=U.attributes.position.values,Z=v.attributes.position.values,V=L.attributes.position.values,B=F.length*y;B+=Z.length*I,B+=V.length*(p+T);let O=U.indices,D=v.indices,w=L.indices,C=O.length*y;C+=D.length*I,C+=w.length*(p+T);let k=new Float32Array(B),M=new Uint16Array(B/3),A=W.createTypedArray(B/3,C),b=y+I+p+T,g=new Uint16Array(b),f=new Array(b),m=new Uint32Array(b),q=new Uint32Array(b),_=new Array(b);re(e.packedBuffer);let G={batchTableColors:new Uint32Array(e.batchTableColors),positions:k,vertexBatchIds:M,indices:A,batchIds:g,batchedIndices:f,indexOffsets:m,indexCounts:q,boundingVolumes:_,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:Q,center:K};R(G,n,i,U,oe),R(G,r,t,v,ce),R(G,s,h,L,se),R(G,a,x,L,ie);let N=ae(A.BYTES_PER_ELEMENT,f,_);return c.push(k.buffer,M.buffer,A.buffer),c.push(g.buffer,m.buffer,q.buffer),c.push(N.buffer),{positions:k.buffer,vertexBatchIds:M.buffer,indices:A.buffer,indexOffsets:m.buffer,indexCounts:q.buffer,batchIds:g.buffer,packedBuffer:N.buffer}}var Oe=Y(fe);export{Oe as default}; diff --git a/public/js/Cesium2/Workers/createVectorTilePoints.js b/public/js/Cesium2/Workers/createVectorTilePoints.js index 6396ef8ca..4b375cc1c 100644 --- a/public/js/Cesium2/Workers/createVectorTilePoints.js +++ b/public/js/Cesium2/Workers/createVectorTilePoints.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as x}from"./chunk-4BYMTYMT.js";import{a as w}from"./chunk-Q5MYX5A2.js";import{h as c}from"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as h,b as l,d as p}from"./chunk-S4VBGY2U.js";import{a as i}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import"./chunk-3THTQ4QB.js";var u=32767,F=new l,L=new h,b=new c,y=new p,a={min:void 0,max:void 0};function V(t){t=new Float64Array(t);let o=0;a.min=t[o++],a.max=t[o++],c.unpack(t,o,b),o+=c.packedLength,p.unpack(t,o,y)}function z(t,o){let s=new Uint16Array(t.positions);V(t.packedBuffer);let e=b,C=y,A=a.min,P=a.max,n=s.length/3,f=s.subarray(0,n),g=s.subarray(n,2*n),d=s.subarray(2*n,3*n);w.zigZagDeltaDecode(f,g,d);let m=new Float64Array(s.length);for(let r=0;r<n;++r){let k=f[r],E=g[r],H=d[r],M=i.lerp(e.west,e.east,k/u),R=i.lerp(e.south,e.north,E/u),T=i.lerp(A,P,H/u),v=l.fromRadians(M,R,T,F),D=C.cartographicToCartesian(v,L);h.pack(D,m,r*3)}return o.push(m.buffer),{positions:m.buffer}}var G=x(z);export{G as default}; +import{a as x}from"./chunk-4E3APMCC.js";import{a as w}from"./chunk-VMXXQ6B4.js";import{h as c}from"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as h,b as l,d as p}from"./chunk-RH3GFHG2.js";import{a as i}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import"./chunk-LRNH5AEO.js";var u=32767,F=new l,L=new h,b=new c,y=new p,a={min:void 0,max:void 0};function V(t){t=new Float64Array(t);let o=0;a.min=t[o++],a.max=t[o++],c.unpack(t,o,b),o+=c.packedLength,p.unpack(t,o,y)}function z(t,o){let s=new Uint16Array(t.positions);V(t.packedBuffer);let e=b,C=y,A=a.min,P=a.max,n=s.length/3,f=s.subarray(0,n),g=s.subarray(n,2*n),d=s.subarray(2*n,3*n);w.zigZagDeltaDecode(f,g,d);let m=new Float64Array(s.length);for(let r=0;r<n;++r){let k=f[r],E=g[r],H=d[r],M=i.lerp(e.west,e.east,k/u),R=i.lerp(e.south,e.north,E/u),T=i.lerp(A,P,H/u),v=l.fromRadians(M,R,T,F),D=C.cartographicToCartesian(v,L);h.pack(D,m,r*3)}return o.push(m.buffer),{positions:m.buffer}}var G=x(z);export{G as default}; diff --git a/public/js/Cesium2/Workers/createVectorTilePolygons.js b/public/js/Cesium2/Workers/createVectorTilePolygons.js index f5cafab35..832e9c7ce 100644 --- a/public/js/Cesium2/Workers/createVectorTilePolygons.js +++ b/public/js/Cesium2/Workers/createVectorTilePolygons.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as R}from"./chunk-JXLT7VPX.js";import{a as It}from"./chunk-4BYMTYMT.js";import{a as M}from"./chunk-SOCYD7RP.js";import{a as bt}from"./chunk-Q5MYX5A2.js";import"./chunk-CTRWX4F5.js";import"./chunk-Z7BLUZ7R.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as W}from"./chunk-34ULWVZF.js";import"./chunk-K2M3OJ7Z.js";import{h as z}from"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as o,b as nt,d as j}from"./chunk-S4VBGY2U.js";import{a as et}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{e as A}from"./chunk-3THTQ4QB.js";var kt=new o,Bt=new j,Nt=new z,E={min:void 0,max:void 0,indexBytesPerElement:void 0};function Pt(s){let u=new Float64Array(s),n=0;E.indexBytesPerElement=u[n++],E.min=u[n++],E.max=u[n++],o.unpack(u,n,kt),n+=o.packedLength,j.unpack(u,n,Bt),n+=j.packedLength,z.unpack(u,n,Nt)}function Tt(s){let u=s.length,n=0;for(let y=0;y<u;++y)n+=R.packedLength+3+s[y].batchIds.length;return n}function Ct(s,u,n){let y=u.length,O=2+y*M.packedLength+1+Tt(n),c=new Float64Array(O),i=0;c[i++]=s,c[i++]=y;for(let x=0;x<y;++x)M.pack(u[x],c,i),i+=M.packedLength;let V=n.length;c[i++]=V;for(let x=0;x<V;++x){let B=n[x];R.pack(B.color,c,i),i+=R.packedLength,c[i++]=B.offset,c[i++]=B.count;let P=B.batchIds,w=P.length;c[i++]=w;for(let h=0;h<w;++h)c[i++]=P[h]}return c}var yt=32767,wt=new o,Ht=new o,St=new o,Ut=new o,Ft=new o,Lt=new nt,Mt=new z;function Rt(s,u){Pt(s.packedBuffer);let n;E.indexBytesPerElement===2?n=new Uint16Array(s.indices):n=new Uint32Array(s.indices);let O=new Uint16Array(s.positions),c=new Uint32Array(s.counts),i=new Uint32Array(s.indexCounts),V=new Uint32Array(s.batchIds),x=new Uint32Array(s.batchTableColors),B=new Array(c.length),P=kt,w=Bt,h=Nt,ot=E.min,st=E.max,T=s.minimumHeights,C=s.maximumHeights;A(T)&&A(C)&&(T=new Float32Array(T),C=new Float32Array(C));let t,f,l,N=O.length/2,ct=O.subarray(0,N),it=O.subarray(N,2*N);bt.zigZagDeltaDecode(ct,it);let rt=new Float64Array(N*3);for(t=0;t<N;++t){let e=ct[t],p=it[t],L=et.lerp(h.west,h.east,e/yt),k=et.lerp(h.south,h.north,p/yt),b=nt.fromRadians(L,k,0,Lt),Y=w.cartographicToCartesian(b,wt);o.pack(Y,rt,t*3)}let H=c.length,at=new Array(H),Z=new Array(H),ft=0,lt=0;for(t=0;t<H;++t)at[t]=ft,Z[t]=lt,ft+=c[t],lt+=i[t];let S=new Float32Array(N*3*2),_=new Uint16Array(N*2),D=new Uint32Array(Z.length),G=new Uint32Array(i.length),r=[],g={};for(t=0;t<H;++t)l=x[t],A(g[l])?(g[l].positionLength+=c[t],g[l].indexLength+=i[t],g[l].batchIds.push(t)):g[l]={positionLength:c[t],indexLength:i[t],offset:0,indexOffset:0,batchIds:[t]};let a,dt=0,ht=0;for(l in g)if(g.hasOwnProperty(l)){a=g[l],a.offset=dt,a.indexOffset=ht;let e=a.positionLength*2,p=a.indexLength*2+a.positionLength*6;dt+=e,ht+=p,a.indexLength=p}let U=[];for(l in g)g.hasOwnProperty(l)&&(a=g[l],U.push({color:R.fromRgba(parseInt(l)),offset:a.indexOffset,count:a.indexLength,batchIds:a.batchIds}));for(t=0;t<H;++t){l=x[t],a=g[l];let e=a.offset,p=e*3,L=e,k=at[t],b=c[t],Y=V[t],mt=ot,gt=st;A(T)&&A(C)&&(mt=T[t],gt=C[t]);let q=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,K=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY;for(f=0;f<b;++f){let m=o.unpack(rt,k*3+f*3,wt);w.scaleToGeodeticSurface(m,m);let I=w.cartesianToCartographic(m,Lt),F=I.latitude,pt=I.longitude;q=Math.min(F,q),J=Math.max(F,J),K=Math.min(pt,K),Q=Math.max(pt,Q);let xt=w.geodeticSurfaceNormal(m,Ht),v=o.multiplyByScalar(xt,mt,St),$=o.add(m,v,Ut);v=o.multiplyByScalar(xt,gt,v);let tt=o.add(m,v,Ft);o.subtract(tt,P,tt),o.subtract($,P,$),o.pack(tt,S,p),o.pack($,S,p+3),_[L]=Y,_[L+1]=Y,p+=6,L+=2}h=Mt,h.west=K,h.east=Q,h.south=q,h.north=J,B[t]=M.fromRectangle(h,ot,st,w);let d=a.indexOffset,X=Z[t],Ot=i[t];for(D[t]=d,f=0;f<Ot;f+=3){let m=n[X+f]-k,I=n[X+f+1]-k,F=n[X+f+2]-k;r[d++]=m*2+e,r[d++]=I*2+e,r[d++]=F*2+e,r[d++]=F*2+1+e,r[d++]=I*2+1+e,r[d++]=m*2+1+e}for(f=0;f<b;++f){let m=f,I=(f+1)%b;r[d++]=m*2+1+e,r[d++]=I*2+e,r[d++]=m*2+e,r[d++]=m*2+1+e,r[d++]=I*2+1+e,r[d++]=I*2+e}a.offset+=b*2,a.indexOffset=d,G[t]=d-D[t]}r=W.createTypedArray(S.length/3,r);let At=U.length;for(let e=0;e<At;++e){let p=U[e].batchIds,L=0,k=p.length;for(let b=0;b<k;++b)L+=G[p[b]];U[e].count=L}let Et=r.BYTES_PER_ELEMENT===2?W.UNSIGNED_SHORT:W.UNSIGNED_INT,ut=Ct(Et,B,U);return u.push(S.buffer,r.buffer,D.buffer,G.buffer,_.buffer,ut.buffer),{positions:S.buffer,indices:r.buffer,indexOffsets:D.buffer,indexCounts:G.buffer,batchIds:_.buffer,packedBuffer:ut.buffer}}var Jt=It(Rt);export{Jt as default}; +import{a as R}from"./chunk-H2CDK6OB.js";import{a as It}from"./chunk-4E3APMCC.js";import{a as M}from"./chunk-DGVML3P5.js";import{a as bt}from"./chunk-VMXXQ6B4.js";import"./chunk-P73YILG6.js";import"./chunk-VYMAIP2A.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as W}from"./chunk-YFQNY2YN.js";import"./chunk-2NIQ5ECB.js";import{h as z}from"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as o,b as nt,d as j}from"./chunk-RH3GFHG2.js";import{a as et}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{e as A}from"./chunk-LRNH5AEO.js";var kt=new o,Bt=new j,Nt=new z,E={min:void 0,max:void 0,indexBytesPerElement:void 0};function Pt(s){let u=new Float64Array(s),n=0;E.indexBytesPerElement=u[n++],E.min=u[n++],E.max=u[n++],o.unpack(u,n,kt),n+=o.packedLength,j.unpack(u,n,Bt),n+=j.packedLength,z.unpack(u,n,Nt)}function Tt(s){let u=s.length,n=0;for(let y=0;y<u;++y)n+=R.packedLength+3+s[y].batchIds.length;return n}function Ct(s,u,n){let y=u.length,O=2+y*M.packedLength+1+Tt(n),c=new Float64Array(O),i=0;c[i++]=s,c[i++]=y;for(let x=0;x<y;++x)M.pack(u[x],c,i),i+=M.packedLength;let V=n.length;c[i++]=V;for(let x=0;x<V;++x){let B=n[x];R.pack(B.color,c,i),i+=R.packedLength,c[i++]=B.offset,c[i++]=B.count;let P=B.batchIds,w=P.length;c[i++]=w;for(let h=0;h<w;++h)c[i++]=P[h]}return c}var yt=32767,wt=new o,Ht=new o,St=new o,Ut=new o,Ft=new o,Lt=new nt,Mt=new z;function Rt(s,u){Pt(s.packedBuffer);let n;E.indexBytesPerElement===2?n=new Uint16Array(s.indices):n=new Uint32Array(s.indices);let O=new Uint16Array(s.positions),c=new Uint32Array(s.counts),i=new Uint32Array(s.indexCounts),V=new Uint32Array(s.batchIds),x=new Uint32Array(s.batchTableColors),B=new Array(c.length),P=kt,w=Bt,h=Nt,ot=E.min,st=E.max,T=s.minimumHeights,C=s.maximumHeights;A(T)&&A(C)&&(T=new Float32Array(T),C=new Float32Array(C));let t,f,l,N=O.length/2,ct=O.subarray(0,N),it=O.subarray(N,2*N);bt.zigZagDeltaDecode(ct,it);let rt=new Float64Array(N*3);for(t=0;t<N;++t){let e=ct[t],p=it[t],L=et.lerp(h.west,h.east,e/yt),k=et.lerp(h.south,h.north,p/yt),b=nt.fromRadians(L,k,0,Lt),Y=w.cartographicToCartesian(b,wt);o.pack(Y,rt,t*3)}let H=c.length,at=new Array(H),Z=new Array(H),ft=0,lt=0;for(t=0;t<H;++t)at[t]=ft,Z[t]=lt,ft+=c[t],lt+=i[t];let S=new Float32Array(N*3*2),_=new Uint16Array(N*2),D=new Uint32Array(Z.length),G=new Uint32Array(i.length),r=[],g={};for(t=0;t<H;++t)l=x[t],A(g[l])?(g[l].positionLength+=c[t],g[l].indexLength+=i[t],g[l].batchIds.push(t)):g[l]={positionLength:c[t],indexLength:i[t],offset:0,indexOffset:0,batchIds:[t]};let a,dt=0,ht=0;for(l in g)if(g.hasOwnProperty(l)){a=g[l],a.offset=dt,a.indexOffset=ht;let e=a.positionLength*2,p=a.indexLength*2+a.positionLength*6;dt+=e,ht+=p,a.indexLength=p}let U=[];for(l in g)g.hasOwnProperty(l)&&(a=g[l],U.push({color:R.fromRgba(parseInt(l)),offset:a.indexOffset,count:a.indexLength,batchIds:a.batchIds}));for(t=0;t<H;++t){l=x[t],a=g[l];let e=a.offset,p=e*3,L=e,k=at[t],b=c[t],Y=V[t],mt=ot,gt=st;A(T)&&A(C)&&(mt=T[t],gt=C[t]);let q=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,K=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY;for(f=0;f<b;++f){let m=o.unpack(rt,k*3+f*3,wt);w.scaleToGeodeticSurface(m,m);let I=w.cartesianToCartographic(m,Lt),F=I.latitude,pt=I.longitude;q=Math.min(F,q),J=Math.max(F,J),K=Math.min(pt,K),Q=Math.max(pt,Q);let xt=w.geodeticSurfaceNormal(m,Ht),v=o.multiplyByScalar(xt,mt,St),$=o.add(m,v,Ut);v=o.multiplyByScalar(xt,gt,v);let tt=o.add(m,v,Ft);o.subtract(tt,P,tt),o.subtract($,P,$),o.pack(tt,S,p),o.pack($,S,p+3),_[L]=Y,_[L+1]=Y,p+=6,L+=2}h=Mt,h.west=K,h.east=Q,h.south=q,h.north=J,B[t]=M.fromRectangle(h,ot,st,w);let d=a.indexOffset,X=Z[t],Ot=i[t];for(D[t]=d,f=0;f<Ot;f+=3){let m=n[X+f]-k,I=n[X+f+1]-k,F=n[X+f+2]-k;r[d++]=m*2+e,r[d++]=I*2+e,r[d++]=F*2+e,r[d++]=F*2+1+e,r[d++]=I*2+1+e,r[d++]=m*2+1+e}for(f=0;f<b;++f){let m=f,I=(f+1)%b;r[d++]=m*2+1+e,r[d++]=I*2+e,r[d++]=m*2+e,r[d++]=m*2+1+e,r[d++]=I*2+1+e,r[d++]=I*2+e}a.offset+=b*2,a.indexOffset=d,G[t]=d-D[t]}r=W.createTypedArray(S.length/3,r);let At=U.length;for(let e=0;e<At;++e){let p=U[e].batchIds,L=0,k=p.length;for(let b=0;b<k;++b)L+=G[p[b]];U[e].count=L}let Et=r.BYTES_PER_ELEMENT===2?W.UNSIGNED_SHORT:W.UNSIGNED_INT,ut=Ct(Et,B,U);return u.push(S.buffer,r.buffer,D.buffer,G.buffer,_.buffer,ut.buffer),{positions:S.buffer,indices:r.buffer,indexOffsets:D.buffer,indexCounts:G.buffer,batchIds:_.buffer,packedBuffer:ut.buffer}}var Jt=It(Rt);export{Jt as default}; diff --git a/public/js/Cesium2/Workers/createVectorTilePolylines.js b/public/js/Cesium2/Workers/createVectorTilePolylines.js index dc32dea75..695834cad 100644 --- a/public/js/Cesium2/Workers/createVectorTilePolylines.js +++ b/public/js/Cesium2/Workers/createVectorTilePolylines.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as K}from"./chunk-4BYMTYMT.js";import{a as G}from"./chunk-Q5MYX5A2.js";import{a as S}from"./chunk-34ULWVZF.js";import{c as B,h as R}from"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as t,b as _,d as L}from"./chunk-S4VBGY2U.js";import{a as F}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import"./chunk-3THTQ4QB.js";var O=32767,ct=new _,rt=new t;function it(n,o,p,m,s){let d=n.length/3,U=n.subarray(0,d),v=n.subarray(d,2*d),P=n.subarray(2*d,3*d);G.zigZagDeltaDecode(U,v,P);let D=new Float64Array(n.length);for(let u=0;u<d;++u){let e=U[u],A=v[u],l=P[u],k=F.lerp(o.west,o.east,e/O),I=F.lerp(o.south,o.north,A/O),E=F.lerp(p,m,l/O),g=_.fromRadians(k,I,E,ct),C=s.cartographicToCartesian(g,rt);t.pack(C,D,u*3)}return D}var Y=it;var X=new R,$=new L,j=new t,H={min:void 0,max:void 0};function at(n){n=new Float64Array(n);let o=0;H.min=n[o++],H.max=n[o++],R.unpack(n,o,X),o+=R.packedLength,L.unpack(n,o,$),o+=L.packedLength,t.unpack(n,o,j)}function ft(n){let o=n.length,p=new Uint32Array(o+1),m=0;for(let s=0;s<o;++s)p[s]=m,m+=n[s];return p[o]=m,p}var Z=new t,q=new t,J=new t,dt=new t,Q=new t;function ut(n,o){let p=new Uint16Array(n.positions),m=new Uint16Array(n.widths),s=new Uint32Array(n.counts),d=new Uint16Array(n.batchIds);at(n.packedBuffer);let U=X,v=$,P=j,D=H.min,u=H.max,e=Y(p,U,D,u,v),A=e.length/3,l=A*4-4,k=new Float32Array(l*3),I=new Float32Array(l*3),E=new Float32Array(l*3),g=new Float32Array(l*2),C=new Uint16Array(l),N=0,z=0,tt=0,r,h=0,M=s.length;for(r=0;r<M;++r){let a=s[r],nt=m[r],ot=d[r];for(let f=0;f<a;++f){let w;if(f===0){let c=t.unpack(e,h*3,Z),T=t.unpack(e,(h+1)*3,q);w=t.subtract(c,T,J),t.add(c,w,w)}else w=t.unpack(e,(h+f-1)*3,J);let W=t.unpack(e,(h+f)*3,dt),x;if(f===a-1){let c=t.unpack(e,(h+a-1)*3,Z),T=t.unpack(e,(h+a-2)*3,q);x=t.subtract(c,T,Q),t.add(c,x,x)}else x=t.unpack(e,(h+f+1)*3,Q);t.subtract(w,P,w),t.subtract(W,P,W),t.subtract(x,P,x);let et=f===0?2:0,st=f===a-1?2:4;for(let c=et;c<st;++c){t.pack(W,k,N),t.pack(w,I,N),t.pack(x,E,N),N+=3;let T=c-2<0?-1:1;g[z++]=2*(c%2)-1,g[z++]=T*nt,C[tt++]=ot}}h+=a}let i=S.createTypedArray(l,A*6-6),b=0,y=0;for(M=A-1,r=0;r<M;++r)i[y++]=b,i[y++]=b+2,i[y++]=b+1,i[y++]=b+1,i[y++]=b+2,i[y++]=b+3,b+=4;o.push(k.buffer,I.buffer,E.buffer),o.push(g.buffer,C.buffer,i.buffer);let V={indexDatatype:i.BYTES_PER_ELEMENT===2?S.UNSIGNED_SHORT:S.UNSIGNED_INT,currentPositions:k.buffer,previousPositions:I.buffer,nextPositions:E.buffer,expandAndWidth:g.buffer,batchIds:C.buffer,indices:i.buffer};if(n.keepDecodedPositions){let a=ft(s);o.push(e.buffer,a.buffer),V=B(V,{decodedPositions:e.buffer,decodedPositionOffsets:a.buffer})}return V}var It=K(ut);export{It as default}; +import{a as K}from"./chunk-4E3APMCC.js";import{a as G}from"./chunk-VMXXQ6B4.js";import{a as S}from"./chunk-YFQNY2YN.js";import{c as B,h as R}from"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as t,b as _,d as L}from"./chunk-RH3GFHG2.js";import{a as F}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import"./chunk-LRNH5AEO.js";var O=32767,ct=new _,rt=new t;function it(n,o,p,m,s){let d=n.length/3,U=n.subarray(0,d),v=n.subarray(d,2*d),P=n.subarray(2*d,3*d);G.zigZagDeltaDecode(U,v,P);let D=new Float64Array(n.length);for(let u=0;u<d;++u){let e=U[u],A=v[u],l=P[u],k=F.lerp(o.west,o.east,e/O),I=F.lerp(o.south,o.north,A/O),E=F.lerp(p,m,l/O),g=_.fromRadians(k,I,E,ct),C=s.cartographicToCartesian(g,rt);t.pack(C,D,u*3)}return D}var Y=it;var X=new R,$=new L,j=new t,H={min:void 0,max:void 0};function at(n){n=new Float64Array(n);let o=0;H.min=n[o++],H.max=n[o++],R.unpack(n,o,X),o+=R.packedLength,L.unpack(n,o,$),o+=L.packedLength,t.unpack(n,o,j)}function ft(n){let o=n.length,p=new Uint32Array(o+1),m=0;for(let s=0;s<o;++s)p[s]=m,m+=n[s];return p[o]=m,p}var Z=new t,q=new t,J=new t,dt=new t,Q=new t;function ut(n,o){let p=new Uint16Array(n.positions),m=new Uint16Array(n.widths),s=new Uint32Array(n.counts),d=new Uint16Array(n.batchIds);at(n.packedBuffer);let U=X,v=$,P=j,D=H.min,u=H.max,e=Y(p,U,D,u,v),A=e.length/3,l=A*4-4,k=new Float32Array(l*3),I=new Float32Array(l*3),E=new Float32Array(l*3),g=new Float32Array(l*2),C=new Uint16Array(l),N=0,z=0,tt=0,r,h=0,M=s.length;for(r=0;r<M;++r){let a=s[r],nt=m[r],ot=d[r];for(let f=0;f<a;++f){let w;if(f===0){let c=t.unpack(e,h*3,Z),T=t.unpack(e,(h+1)*3,q);w=t.subtract(c,T,J),t.add(c,w,w)}else w=t.unpack(e,(h+f-1)*3,J);let W=t.unpack(e,(h+f)*3,dt),x;if(f===a-1){let c=t.unpack(e,(h+a-1)*3,Z),T=t.unpack(e,(h+a-2)*3,q);x=t.subtract(c,T,Q),t.add(c,x,x)}else x=t.unpack(e,(h+f+1)*3,Q);t.subtract(w,P,w),t.subtract(W,P,W),t.subtract(x,P,x);let et=f===0?2:0,st=f===a-1?2:4;for(let c=et;c<st;++c){t.pack(W,k,N),t.pack(w,I,N),t.pack(x,E,N),N+=3;let T=c-2<0?-1:1;g[z++]=2*(c%2)-1,g[z++]=T*nt,C[tt++]=ot}}h+=a}let i=S.createTypedArray(l,A*6-6),b=0,y=0;for(M=A-1,r=0;r<M;++r)i[y++]=b,i[y++]=b+2,i[y++]=b+1,i[y++]=b+1,i[y++]=b+2,i[y++]=b+3,b+=4;o.push(k.buffer,I.buffer,E.buffer),o.push(g.buffer,C.buffer,i.buffer);let V={indexDatatype:i.BYTES_PER_ELEMENT===2?S.UNSIGNED_SHORT:S.UNSIGNED_INT,currentPositions:k.buffer,previousPositions:I.buffer,nextPositions:E.buffer,expandAndWidth:g.buffer,batchIds:C.buffer,indices:i.buffer};if(n.keepDecodedPositions){let a=ft(s);o.push(e.buffer,a.buffer),V=B(V,{decodedPositions:e.buffer,decodedPositionOffsets:a.buffer})}return V}var It=K(ut);export{It as default}; diff --git a/public/js/Cesium2/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js b/public/js/Cesium2/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js index 752fd9969..ce04c4837 100644 --- a/public/js/Cesium2/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +++ b/public/js/Cesium2/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as Gt,b as Xt}from"./chunk-PJQ53UQY.js";import{a as kt}from"./chunk-4BYMTYMT.js";import{a as lt}from"./chunk-UJMUN4NO.js";import{a as Dt}from"./chunk-SOCYD7RP.js";import"./chunk-Q5MYX5A2.js";import"./chunk-CTRWX4F5.js";import{a as qt}from"./chunk-Z7BLUZ7R.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{d as Lt}from"./chunk-K2M3OJ7Z.js";import{b as $,g as Ot,h as zt}from"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as P,b as N,c as wt,d as Ht}from"./chunk-S4VBGY2U.js";import{a as r}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import{a as Vt}from"./chunk-R62IKKEC.js";import{a as Ut}from"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{e as ht}from"./chunk-3THTQ4QB.js";var te=Uint16Array.BYTES_PER_ELEMENT,mt=Int32Array.BYTES_PER_ELEMENT,Pt=Uint32Array.BYTES_PER_ELEMENT,ee=Float32Array.BYTES_PER_ELEMENT,H=Float64Array.BYTES_PER_ELEMENT;function tt(n,l,e){e=Ut(e,r);let i=n.length;for(let c=0;c<i;++c)if(e.equalsEpsilon(n[c],l,r.EPSILON12))return c;return-1}function oe(n,l){n.ellipsoid=Ht.clone(n.ellipsoid),n.rectangle=zt.clone(n.rectangle);let e=se(n.buffer,n.relativeToCenter,n.ellipsoid,n.rectangle,n.nativeRectangle,n.exaggeration,n.exaggerationRelativeHeight,n.skirtHeight,n.includeWebMercatorT,n.negativeAltitudeExponentBias,n.negativeElevationThreshold),i=e.vertices;l.push(i.buffer);let c=e.indices;return l.push(c.buffer),{vertices:i.buffer,indices:c.buffer,numberOfAttributes:e.encoding.stride,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere3D:e.boundingSphere3D,orientedBoundingBox:e.orientedBoundingBox,occludeePointInScaledSpace:e.occludeePointInScaledSpace,encoding:e.encoding,vertexCountWithoutSkirts:e.vertexCountWithoutSkirts,indexCountWithoutSkirts:e.indexCountWithoutSkirts,westIndicesSouthToNorth:e.westIndicesSouthToNorth,southIndicesEastToWest:e.southIndicesEastToWest,eastIndicesNorthToSouth:e.eastIndicesNorthToSouth,northIndicesWestToEast:e.northIndicesWestToEast}}var u=new N,G=new P,ne=new P,ie=new P,re=new $;function se(n,l,e,i,c,et,m,ot,T,nt,it){let I,h,E,f,x,p;ht(i)?(I=i.west,h=i.south,E=i.east,f=i.north,x=i.width,p=i.height):(I=r.toRadians(c.west),h=r.toRadians(c.south),E=r.toRadians(c.east),f=r.toRadians(c.north),x=r.toRadians(i.width),p=r.toRadians(i.height));let X=[h,f],A=[I,E],V=Ot.eastNorthUpToFixedFrame(l,e),j=$.inverseTransformation(V,re),O,Q;T&&(O=lt.geodeticLatitudeToMercatorAngle(h),Q=1/(lt.geodeticLatitudeToMercatorAngle(f)-O));let y=et!==1,a=new DataView(n),z=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,b=ne;b.x=Number.POSITIVE_INFINITY,b.y=Number.POSITIVE_INFINITY,b.z=Number.POSITIVE_INFINITY;let M=ie;M.x=Number.NEGATIVE_INFINITY,M.y=Number.NEGATIVE_INFINITY,M.z=Number.NEGATIVE_INFINITY;let o=0,S=0,At=0,rt,L;for(L=0;L<4;++L){let t=o;rt=a.getUint32(t,!0),t+=Pt;let d=r.toRadians(a.getFloat64(t,!0)*180);t+=H,tt(A,d)===-1&&A.push(d);let Y=r.toRadians(a.getFloat64(t,!0)*180);t+=H,tt(X,Y)===-1&&X.push(Y),t+=2*H;let B=a.getInt32(t,!0);t+=mt,S+=B,B=a.getInt32(t,!0),At+=B*3,o+=rt+Pt}let yt=[],bt=[],g=new Array(S),R=new Array(S),_=new Array(S),C=T?new Array(S):[],F=y?new Array(S):[],v=new Array(At),k=[],st=[],ct=[],W=[],s=0,pt=0;for(o=0,L=0;L<4;++L){rt=a.getUint32(o,!0),o+=Pt;let t=o,d=r.toRadians(a.getFloat64(o,!0)*180);o+=H;let Y=r.toRadians(a.getFloat64(o,!0)*180);o+=H;let B=r.toRadians(a.getFloat64(o,!0)*180),Ft=B*.5;o+=H;let vt=r.toRadians(a.getFloat64(o,!0)*180),Wt=vt*.5;o+=H;let Yt=a.getInt32(o,!0);o+=mt;let Zt=a.getInt32(o,!0);o+=mt,o+=mt;let St=new Array(Yt);for(let U=0;U<Yt;++U){let Z=d+a.getUint8(o++)*B;u.longitude=Z;let D=Y+a.getUint8(o++)*vt;u.latitude=D;let w=a.getFloat32(o,!0);if(o+=ee,w!==0&&w<it&&(w*=-Math.pow(2,nt)),w*=6371010,u.height=w,tt(A,Z)!==-1||tt(X,D)!==-1){let dt=tt(yt,u,N);if(dt===-1)yt.push(N.clone(u)),bt.push(s);else{St[U]=bt[dt];continue}}St[U]=s,Math.abs(Z-I)<Ft?k.push({index:s,cartographic:N.clone(u)}):Math.abs(Z-E)<Ft?ct.push({index:s,cartographic:N.clone(u)}):Math.abs(D-h)<Wt?st.push({index:s,cartographic:N.clone(u)}):Math.abs(D-f)<Wt&&W.push({index:s,cartographic:N.clone(u)}),z=Math.min(w,z),J=Math.max(w,J),_[s]=w;let Nt=e.cartographicToCartesian(u);if(g[s]=Nt,T&&(C[s]=(lt.geodeticLatitudeToMercatorAngle(D)-O)*Q),y){let dt=e.geodeticSurfaceNormal(Nt);F[s]=dt}$.multiplyByPoint(j,Nt,G),P.minimumByComponent(G,b,b),P.maximumByComponent(G,M,M);let Tt=(Z-I)/(E-I);Tt=r.clamp(Tt,0,1);let Bt=(D-h)/(f-h);Bt=r.clamp(Bt,0,1),R[s]=new wt(Tt,Bt),++s}let $t=Zt*3;for(let U=0;U<$t;++U,++pt)v[pt]=St[a.getUint16(o,!0)],o+=te;if(rt!==o-t)throw new Vt("Invalid terrain tile.")}g.length=s,R.length=s,_.length=s,T&&(C.length=s),y&&(F.length=s);let Mt=s,jt=pt,K={hMin:z,lastBorderPoint:void 0,skirtHeight:ot,toENU:j,ellipsoid:e,minimum:b,maximum:M};k.sort(function(t,d){return d.cartographic.latitude-t.cartographic.latitude}),st.sort(function(t,d){return t.cartographic.longitude-d.cartographic.longitude}),ct.sort(function(t,d){return t.cartographic.latitude-d.cartographic.latitude}),W.sort(function(t,d){return d.cartographic.longitude-t.cartographic.longitude});let q=1e-5;if(gt(g,_,R,C,F,v,K,k,-q*x,!0,-q*p),gt(g,_,R,C,F,v,K,st,-q*p,!1),gt(g,_,R,C,F,v,K,ct,q*x,!0,q*p),gt(g,_,R,C,F,v,K,W,q*p,!1),k.length>0&&W.length>0){let t=k[0].index,d=Mt,Y=W[W.length-1].index,B=g.length-1;v.push(Y,B,d,d,t,Y)}S=g.length;let Qt=Lt.fromPoints(g),Rt;ht(i)&&(Rt=Dt.fromRectangle(i,z,J,e));let Jt=new Gt(e).computeHorizonCullingPointPossiblyUnderEllipsoid(l,g,z),Kt=new qt(b,M,l),It=new Xt(l,Kt,K.hMin,J,V,!1,T,y,et,m),_t=new Float32Array(S*It.stride),Ct=0;for(let t=0;t<S;++t)Ct=It.encode(_t,Ct,g[t],R[t],_[t],void 0,C[t],F[t]);let at=k.map(function(t){return t.index}).reverse(),Et=st.map(function(t){return t.index}).reverse(),ut=ct.map(function(t){return t.index}).reverse(),xt=W.map(function(t){return t.index}).reverse();return Et.unshift(ut[ut.length-1]),Et.push(at[0]),xt.unshift(at[at.length-1]),xt.push(ut[0]),{vertices:_t,indices:new Uint16Array(v),maximumHeight:J,minimumHeight:z,encoding:It,boundingSphere3D:Qt,orientedBoundingBox:Rt,occludeePointInScaledSpace:Jt,vertexCountWithoutSkirts:Mt,indexCountWithoutSkirts:jt,westIndicesSouthToNorth:at,southIndicesEastToWest:Et,eastIndicesNorthToSouth:ut,northIndicesWestToEast:xt}}function gt(n,l,e,i,c,et,m,ot,T,nt,it){let I=ot.length;for(let h=0;h<I;++h){let E=ot[h],f=E.cartographic,x=E.index,p=n.length,X=f.longitude,A=f.latitude;A=r.clamp(A,-r.PI_OVER_TWO,r.PI_OVER_TWO);let V=f.height-m.skirtHeight;m.hMin=Math.min(m.hMin,V),N.fromRadians(X,A,V,u),nt&&(u.longitude+=T),nt?h===I-1?u.latitude+=it:h===0&&(u.latitude-=it):u.latitude+=T;let j=m.ellipsoid.cartographicToCartesian(u);n.push(j),l.push(V),e.push(wt.clone(e[x])),i.length>0&&i.push(i[x]),c.length>0&&c.push(c[x]),$.multiplyByPoint(m.toENU,j,G);let O=m.minimum,Q=m.maximum;P.minimumByComponent(G,O,O),P.maximumByComponent(G,Q,Q);let ft=m.lastBorderPoint;if(ht(ft)){let y=ft.index;et.push(y,p-1,p,p,x,y)}m.lastBorderPoint=E}}var Ae=kt(oe);export{Ae as default}; +import{a as Gt,b as Xt}from"./chunk-VQ4ICMD3.js";import{a as kt}from"./chunk-4E3APMCC.js";import{a as lt}from"./chunk-HMHR6SIB.js";import{a as Dt}from"./chunk-DGVML3P5.js";import"./chunk-VMXXQ6B4.js";import"./chunk-P73YILG6.js";import{a as qt}from"./chunk-VYMAIP2A.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{d as Lt}from"./chunk-2NIQ5ECB.js";import{b as $,g as Ot,h as zt}from"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as P,b as N,c as wt,d as Ht}from"./chunk-RH3GFHG2.js";import{a as r}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import{a as Vt}from"./chunk-UAWOHN7R.js";import{a as Ut}from"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{e as ht}from"./chunk-LRNH5AEO.js";var te=Uint16Array.BYTES_PER_ELEMENT,mt=Int32Array.BYTES_PER_ELEMENT,Pt=Uint32Array.BYTES_PER_ELEMENT,ee=Float32Array.BYTES_PER_ELEMENT,H=Float64Array.BYTES_PER_ELEMENT;function tt(n,l,e){e=Ut(e,r);let i=n.length;for(let c=0;c<i;++c)if(e.equalsEpsilon(n[c],l,r.EPSILON12))return c;return-1}function oe(n,l){n.ellipsoid=Ht.clone(n.ellipsoid),n.rectangle=zt.clone(n.rectangle);let e=se(n.buffer,n.relativeToCenter,n.ellipsoid,n.rectangle,n.nativeRectangle,n.exaggeration,n.exaggerationRelativeHeight,n.skirtHeight,n.includeWebMercatorT,n.negativeAltitudeExponentBias,n.negativeElevationThreshold),i=e.vertices;l.push(i.buffer);let c=e.indices;return l.push(c.buffer),{vertices:i.buffer,indices:c.buffer,numberOfAttributes:e.encoding.stride,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere3D:e.boundingSphere3D,orientedBoundingBox:e.orientedBoundingBox,occludeePointInScaledSpace:e.occludeePointInScaledSpace,encoding:e.encoding,vertexCountWithoutSkirts:e.vertexCountWithoutSkirts,indexCountWithoutSkirts:e.indexCountWithoutSkirts,westIndicesSouthToNorth:e.westIndicesSouthToNorth,southIndicesEastToWest:e.southIndicesEastToWest,eastIndicesNorthToSouth:e.eastIndicesNorthToSouth,northIndicesWestToEast:e.northIndicesWestToEast}}var u=new N,G=new P,ne=new P,ie=new P,re=new $;function se(n,l,e,i,c,et,m,ot,T,nt,it){let I,h,E,f,x,p;ht(i)?(I=i.west,h=i.south,E=i.east,f=i.north,x=i.width,p=i.height):(I=r.toRadians(c.west),h=r.toRadians(c.south),E=r.toRadians(c.east),f=r.toRadians(c.north),x=r.toRadians(i.width),p=r.toRadians(i.height));let X=[h,f],A=[I,E],V=Ot.eastNorthUpToFixedFrame(l,e),j=$.inverseTransformation(V,re),O,Q;T&&(O=lt.geodeticLatitudeToMercatorAngle(h),Q=1/(lt.geodeticLatitudeToMercatorAngle(f)-O));let y=et!==1,a=new DataView(n),z=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,b=ne;b.x=Number.POSITIVE_INFINITY,b.y=Number.POSITIVE_INFINITY,b.z=Number.POSITIVE_INFINITY;let M=ie;M.x=Number.NEGATIVE_INFINITY,M.y=Number.NEGATIVE_INFINITY,M.z=Number.NEGATIVE_INFINITY;let o=0,S=0,At=0,rt,L;for(L=0;L<4;++L){let t=o;rt=a.getUint32(t,!0),t+=Pt;let d=r.toRadians(a.getFloat64(t,!0)*180);t+=H,tt(A,d)===-1&&A.push(d);let Y=r.toRadians(a.getFloat64(t,!0)*180);t+=H,tt(X,Y)===-1&&X.push(Y),t+=2*H;let B=a.getInt32(t,!0);t+=mt,S+=B,B=a.getInt32(t,!0),At+=B*3,o+=rt+Pt}let yt=[],bt=[],g=new Array(S),R=new Array(S),_=new Array(S),C=T?new Array(S):[],F=y?new Array(S):[],v=new Array(At),k=[],st=[],ct=[],W=[],s=0,pt=0;for(o=0,L=0;L<4;++L){rt=a.getUint32(o,!0),o+=Pt;let t=o,d=r.toRadians(a.getFloat64(o,!0)*180);o+=H;let Y=r.toRadians(a.getFloat64(o,!0)*180);o+=H;let B=r.toRadians(a.getFloat64(o,!0)*180),Ft=B*.5;o+=H;let vt=r.toRadians(a.getFloat64(o,!0)*180),Wt=vt*.5;o+=H;let Yt=a.getInt32(o,!0);o+=mt;let Zt=a.getInt32(o,!0);o+=mt,o+=mt;let St=new Array(Yt);for(let U=0;U<Yt;++U){let Z=d+a.getUint8(o++)*B;u.longitude=Z;let D=Y+a.getUint8(o++)*vt;u.latitude=D;let w=a.getFloat32(o,!0);if(o+=ee,w!==0&&w<it&&(w*=-Math.pow(2,nt)),w*=6371010,u.height=w,tt(A,Z)!==-1||tt(X,D)!==-1){let dt=tt(yt,u,N);if(dt===-1)yt.push(N.clone(u)),bt.push(s);else{St[U]=bt[dt];continue}}St[U]=s,Math.abs(Z-I)<Ft?k.push({index:s,cartographic:N.clone(u)}):Math.abs(Z-E)<Ft?ct.push({index:s,cartographic:N.clone(u)}):Math.abs(D-h)<Wt?st.push({index:s,cartographic:N.clone(u)}):Math.abs(D-f)<Wt&&W.push({index:s,cartographic:N.clone(u)}),z=Math.min(w,z),J=Math.max(w,J),_[s]=w;let Nt=e.cartographicToCartesian(u);if(g[s]=Nt,T&&(C[s]=(lt.geodeticLatitudeToMercatorAngle(D)-O)*Q),y){let dt=e.geodeticSurfaceNormal(Nt);F[s]=dt}$.multiplyByPoint(j,Nt,G),P.minimumByComponent(G,b,b),P.maximumByComponent(G,M,M);let Tt=(Z-I)/(E-I);Tt=r.clamp(Tt,0,1);let Bt=(D-h)/(f-h);Bt=r.clamp(Bt,0,1),R[s]=new wt(Tt,Bt),++s}let $t=Zt*3;for(let U=0;U<$t;++U,++pt)v[pt]=St[a.getUint16(o,!0)],o+=te;if(rt!==o-t)throw new Vt("Invalid terrain tile.")}g.length=s,R.length=s,_.length=s,T&&(C.length=s),y&&(F.length=s);let Mt=s,jt=pt,K={hMin:z,lastBorderPoint:void 0,skirtHeight:ot,toENU:j,ellipsoid:e,minimum:b,maximum:M};k.sort(function(t,d){return d.cartographic.latitude-t.cartographic.latitude}),st.sort(function(t,d){return t.cartographic.longitude-d.cartographic.longitude}),ct.sort(function(t,d){return t.cartographic.latitude-d.cartographic.latitude}),W.sort(function(t,d){return d.cartographic.longitude-t.cartographic.longitude});let q=1e-5;if(gt(g,_,R,C,F,v,K,k,-q*x,!0,-q*p),gt(g,_,R,C,F,v,K,st,-q*p,!1),gt(g,_,R,C,F,v,K,ct,q*x,!0,q*p),gt(g,_,R,C,F,v,K,W,q*p,!1),k.length>0&&W.length>0){let t=k[0].index,d=Mt,Y=W[W.length-1].index,B=g.length-1;v.push(Y,B,d,d,t,Y)}S=g.length;let Qt=Lt.fromPoints(g),Rt;ht(i)&&(Rt=Dt.fromRectangle(i,z,J,e));let Jt=new Gt(e).computeHorizonCullingPointPossiblyUnderEllipsoid(l,g,z),Kt=new qt(b,M,l),It=new Xt(l,Kt,K.hMin,J,V,!1,T,y,et,m),_t=new Float32Array(S*It.stride),Ct=0;for(let t=0;t<S;++t)Ct=It.encode(_t,Ct,g[t],R[t],_[t],void 0,C[t],F[t]);let at=k.map(function(t){return t.index}).reverse(),Et=st.map(function(t){return t.index}).reverse(),ut=ct.map(function(t){return t.index}).reverse(),xt=W.map(function(t){return t.index}).reverse();return Et.unshift(ut[ut.length-1]),Et.push(at[0]),xt.unshift(at[at.length-1]),xt.push(ut[0]),{vertices:_t,indices:new Uint16Array(v),maximumHeight:J,minimumHeight:z,encoding:It,boundingSphere3D:Qt,orientedBoundingBox:Rt,occludeePointInScaledSpace:Jt,vertexCountWithoutSkirts:Mt,indexCountWithoutSkirts:jt,westIndicesSouthToNorth:at,southIndicesEastToWest:Et,eastIndicesNorthToSouth:ut,northIndicesWestToEast:xt}}function gt(n,l,e,i,c,et,m,ot,T,nt,it){let I=ot.length;for(let h=0;h<I;++h){let E=ot[h],f=E.cartographic,x=E.index,p=n.length,X=f.longitude,A=f.latitude;A=r.clamp(A,-r.PI_OVER_TWO,r.PI_OVER_TWO);let V=f.height-m.skirtHeight;m.hMin=Math.min(m.hMin,V),N.fromRadians(X,A,V,u),nt&&(u.longitude+=T),nt?h===I-1?u.latitude+=it:h===0&&(u.latitude-=it):u.latitude+=T;let j=m.ellipsoid.cartographicToCartesian(u);n.push(j),l.push(V),e.push(wt.clone(e[x])),i.length>0&&i.push(i[x]),c.length>0&&c.push(c[x]),$.multiplyByPoint(m.toENU,j,G);let O=m.minimum,Q=m.maximum;P.minimumByComponent(G,O,O),P.maximumByComponent(G,Q,Q);let ft=m.lastBorderPoint;if(ht(ft)){let y=ft.index;et.push(y,p-1,p,p,x,y)}m.lastBorderPoint=E}}var Ae=kt(oe);export{Ae as default}; diff --git a/public/js/Cesium2/Workers/createVerticesFromHeightmap.js b/public/js/Cesium2/Workers/createVerticesFromHeightmap.js index 61c351b57..fdb5c4f7f 100644 --- a/public/js/Cesium2/Workers/createVerticesFromHeightmap.js +++ b/public/js/Cesium2/Workers/createVerticesFromHeightmap.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as sr,b as fr}from"./chunk-PJQ53UQY.js";import{a as tr}from"./chunk-4BYMTYMT.js";import{a as Ue}from"./chunk-UJMUN4NO.js";import{a as ar}from"./chunk-SOCYD7RP.js";import"./chunk-Q5MYX5A2.js";import"./chunk-CTRWX4F5.js";import{a as nr}from"./chunk-Z7BLUZ7R.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{d as ir}from"./chunk-K2M3OJ7Z.js";import{b as xe,g as rr,h as ae}from"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as ie,c as er,d as Ie}from"./chunk-S4VBGY2U.js";import{a as ge}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import{a as He}from"./chunk-R62IKKEC.js";import{a as Y}from"./chunk-N3A5CZ2S.js";import{a as he}from"./chunk-G75U3WZT.js";import{c as Ir,d as xr,e as G}from"./chunk-3THTQ4QB.js";var ur=Ir((qr,Te)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var D=function(){var A={};A.defaultNoDataValue=-34027999387901484e22,A.decode=function(r,a){a=a||{};var t=a.encodedMaskData||a.encodedMaskData===null,i=n(r,a.inputOffset||0,t),o=a.noDataValue!==null?a.noDataValue:A.defaultNoDataValue,s=V(i,a.pixelType||Float32Array,a.encodedMaskData,o,a.returnMask),u={width:i.width,height:i.height,pixelData:s.resultPixels,minValue:s.minValue,maxValue:i.pixels.maxValue,noDataValue:o};return s.resultMask&&(u.maskData=s.resultMask),a.returnEncodedMask&&i.mask&&(u.encodedMaskData=i.mask.bitset?i.mask.bitset:null),a.returnFileInfo&&(u.fileInfo=b(i),a.computeUsedBitDepths&&(u.fileInfo.bitDepths=X(i))),u};var V=function(r,a,t,i,o){var s=0,u=r.pixels.numBlocksX,m=r.pixels.numBlocksY,l=Math.floor(r.width/u),f=Math.floor(r.height/m),h=2*r.maxZError,c=Number.MAX_VALUE,g;t=t||(r.mask?r.mask.bitset:null);var v,U;v=new a(r.width*r.height),o&&t&&(U=new Uint8Array(r.width*r.height));for(var M=new Float32Array(l*f),S,I,k=0;k<=m;k++){var w=k!==m?f:r.height%m;if(w!==0)for(var d=0;d<=u;d++){var x=d!==u?l:r.width%u;if(x!==0){var T=k*r.width*f+d*l,y=r.width-x,p=r.pixels.blocks[s],L,B,E;p.encoding<2?(p.encoding===0?L=p.rawData:(e(p.stuffedData,p.bitsPerPixel,p.numValidPixels,p.offset,h,M,r.pixels.maxValue),L=M),B=0):p.encoding===2?E=0:E=p.offset;var O;if(t)for(I=0;I<w;I++){for(T&7&&(O=t[T>>3],O<<=T&7),S=0;S<x;S++)T&7||(O=t[T>>3]),O&128?(U&&(U[T]=1),g=p.encoding<2?L[B++]:E,c=c>g?g:c,v[T++]=g):(U&&(U[T]=0),v[T++]=i),O<<=1;T+=y}else if(p.encoding<2)for(I=0;I<w;I++){for(S=0;S<x;S++)g=L[B++],c=c>g?g:c,v[T++]=g;T+=y}else for(c=c>E?E:c,I=0;I<w;I++){for(S=0;S<x;S++)v[T++]=E;T+=y}if(p.encoding===1&&B!==p.numValidPixels)throw"Block and Mask do not match";s++}}}return{resultPixels:v,resultMask:U,minValue:c}},b=function(r){return{fileIdentifierString:r.fileIdentifierString,fileVersion:r.fileVersion,imageType:r.imageType,height:r.height,width:r.width,maxZError:r.maxZError,eofOffset:r.eofOffset,mask:r.mask?{numBlocksX:r.mask.numBlocksX,numBlocksY:r.mask.numBlocksY,numBytes:r.mask.numBytes,maxValue:r.mask.maxValue}:null,pixels:{numBlocksX:r.pixels.numBlocksX,numBlocksY:r.pixels.numBlocksY,numBytes:r.pixels.numBytes,maxValue:r.pixels.maxValue,noDataValue:r.noDataValue}}},X=function(r){for(var a=r.pixels.numBlocksX*r.pixels.numBlocksY,t={},i=0;i<a;i++){var o=r.pixels.blocks[i];o.encoding===0?t.float32=!0:o.encoding===1?t[o.bitsPerPixel]=!0:t[0]=!0}return Object.keys(t)},n=function(r,a,t){var i={},o=new Uint8Array(r,a,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,o),i.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+i.fileIdentifierString;a+=10;var s=new DataView(r,a,24);if(i.fileVersion=s.getInt32(0,!0),i.imageType=s.getInt32(4,!0),i.height=s.getUint32(8,!0),i.width=s.getUint32(12,!0),i.maxZError=s.getFloat64(16,!0),a+=24,!t)if(s=new DataView(r,a,16),i.mask={},i.mask.numBlocksY=s.getUint32(0,!0),i.mask.numBlocksX=s.getUint32(4,!0),i.mask.numBytes=s.getUint32(8,!0),i.mask.maxValue=s.getFloat32(12,!0),a+=16,i.mask.numBytes>0){var u=new Uint8Array(Math.ceil(i.width*i.height/8));s=new DataView(r,a,i.mask.numBytes);var m=s.getInt16(0,!0),l=2,f=0;do{if(m>0)for(;m--;)u[f++]=s.getUint8(l++);else{var h=s.getUint8(l++);for(m=-m;m--;)u[f++]=h}m=s.getInt16(l,!0),l+=2}while(l<i.mask.numBytes);if(m!==-32768||f<u.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=u,a+=i.mask.numBytes}else i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue||(i.mask.bitset=new Uint8Array(Math.ceil(i.width*i.height/8)));s=new DataView(r,a,16),i.pixels={},i.pixels.numBlocksY=s.getUint32(0,!0),i.pixels.numBlocksX=s.getUint32(4,!0),i.pixels.numBytes=s.getUint32(8,!0),i.pixels.maxValue=s.getFloat32(12,!0),a+=16;var c=i.pixels.numBlocksX,g=i.pixels.numBlocksY,v=c+(i.width%c>0?1:0),U=g+(i.height%g>0?1:0);i.pixels.blocks=new Array(v*U);for(var M=0,S=0;S<U;S++)for(var I=0;I<v;I++){var k=0,w=r.byteLength-a;s=new DataView(r,a,Math.min(10,w));var d={};i.pixels.blocks[M++]=d;var x=s.getUint8(0);if(k++,d.encoding=x&63,d.encoding>3)throw"Invalid block encoding ("+d.encoding+")";if(d.encoding===2){a++;continue}if(x!==0&&x!==2){if(x>>=6,d.offsetType=x,x===2)d.offset=s.getInt8(1),k++;else if(x===1)d.offset=s.getInt16(1,!0),k+=2;else if(x===0)d.offset=s.getFloat32(1,!0),k+=4;else throw"Invalid block offset type";if(d.encoding===1)if(x=s.getUint8(k),k++,d.bitsPerPixel=x&63,x>>=6,d.numValidPixelsType=x,x===2)d.numValidPixels=s.getUint8(k),k++;else if(x===1)d.numValidPixels=s.getUint16(k,!0),k+=2;else if(x===0)d.numValidPixels=s.getUint32(k,!0),k+=4;else throw"Invalid valid pixel count type"}if(a+=k,d.encoding!==3){var T,y;if(d.encoding===0){var p=(i.pixels.numBytes-1)/4;if(p!==Math.floor(p))throw"uncompressed block has invalid length";T=new ArrayBuffer(p*4),y=new Uint8Array(T),y.set(new Uint8Array(r,a,p*4));var L=new Float32Array(T);d.rawData=L,a+=p*4}else if(d.encoding===1){var B=Math.ceil(d.numValidPixels*d.bitsPerPixel/8),E=Math.ceil(B/4);T=new ArrayBuffer(E*4),y=new Uint8Array(T),y.set(new Uint8Array(r,a,B)),d.stuffedData=new Uint32Array(T),a+=B}}}return i.eofOffset=a,i},e=function(r,a,t,i,o,s,u){var m=(1<<a)-1,l=0,f,h=0,c,g,v=Math.ceil((u-i)/o),U=r.length*4-Math.ceil(a*t/8);for(r[r.length-1]<<=8*U,f=0;f<t;f++){if(h===0&&(g=r[l++],h=32),h>=a)c=g>>>h-a&m,h-=a;else{var M=a-h;c=(g&m)<<M&m,g=r[l++],h=32-M,c+=g>>>h}s[f]=c<v?i+c*o:u}return s};return A}(),se=function(){"use strict";var A={unstuff:function(n,e,r,a,t,i,o,s){var u=(1<<r)-1,m=0,l,f=0,h,c,g,v,U=n.length*4-Math.ceil(r*a/8);if(n[n.length-1]<<=8*U,t)for(l=0;l<a;l++)f===0&&(c=n[m++],f=32),f>=r?(h=c>>>f-r&u,f-=r):(g=r-f,h=(c&u)<<g&u,c=n[m++],f=32-g,h+=c>>>f),e[l]=t[h];else for(v=Math.ceil((s-i)/o),l=0;l<a;l++)f===0&&(c=n[m++],f=32),f>=r?(h=c>>>f-r&u,f-=r):(g=r-f,h=(c&u)<<g&u,c=n[m++],f=32-g,h+=c>>>f),e[l]=h<v?i+h*o:s},unstuffLUT:function(n,e,r,a,t,i){var o=(1<<e)-1,s=0,u=0,m=0,l=0,f=0,h,c=[],g=n.length*4-Math.ceil(e*r/8);n[n.length-1]<<=8*g;var v=Math.ceil((i-a)/t);for(u=0;u<r;u++)l===0&&(h=n[s++],l=32),l>=e?(f=h>>>l-e&o,l-=e):(m=e-l,f=(h&o)<<m&o,h=n[s++],l=32-m,f+=h>>>l),c[u]=f<v?a+f*t:i;return c.unshift(a),c},unstuff2:function(n,e,r,a,t,i,o,s){var u=(1<<r)-1,m=0,l,f=0,h=0,c,g,v;if(t)for(l=0;l<a;l++)f===0&&(g=n[m++],f=32,h=0),f>=r?(c=g>>>h&u,f-=r,h+=r):(v=r-f,c=g>>>h&u,g=n[m++],f=32-v,c|=(g&(1<<v)-1)<<r-v,h=v),e[l]=t[c];else{var U=Math.ceil((s-i)/o);for(l=0;l<a;l++)f===0&&(g=n[m++],f=32,h=0),f>=r?(c=g>>>h&u,f-=r,h+=r):(v=r-f,c=g>>>h&u,g=n[m++],f=32-v,c|=(g&(1<<v)-1)<<r-v,h=v),e[l]=c<U?i+c*o:s}return e},unstuffLUT2:function(n,e,r,a,t,i){var o=(1<<e)-1,s=0,u=0,m=0,l=0,f=0,h=0,c,g=[],v=Math.ceil((i-a)/t);for(u=0;u<r;u++)l===0&&(c=n[s++],l=32,h=0),l>=e?(f=c>>>h&o,l-=e,h+=e):(m=e-l,f=c>>>h&o,c=n[s++],l=32-m,f|=(c&(1<<m)-1)<<e-m,h=m),g[u]=f<v?a+f*t:i;return g.unshift(a),g},originalUnstuff:function(n,e,r,a){var t=(1<<r)-1,i=0,o,s=0,u,m,l,f=n.length*4-Math.ceil(r*a/8);for(n[n.length-1]<<=8*f,o=0;o<a;o++)s===0&&(m=n[i++],s=32),s>=r?(u=m>>>s-r&t,s-=r):(l=r-s,u=(m&t)<<l&t,m=n[i++],s=32-l,u+=m>>>s),e[o]=u;return e},originalUnstuff2:function(n,e,r,a){var t=(1<<r)-1,i=0,o,s=0,u=0,m,l,f;for(o=0;o<a;o++)s===0&&(l=n[i++],s=32,u=0),s>=r?(m=l>>>u&t,s-=r,u+=r):(f=r-s,m=l>>>u&t,l=n[i++],s=32-f,m|=(l&(1<<f)-1)<<r-f,u=f),e[o]=m;return e}},V={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(n){for(var e=65535,r=65535,a=n.length,t=Math.floor(a/2),i=0;t;){var o=t>=359?359:t;t-=o;do e+=n[i++]<<8,r+=e+=n[i++];while(--o);e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16)}return a&1&&(r+=e+=n[i]<<8),e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16),(r<<16|e)>>>0},readHeaderInfo:function(n,e){var r=e.ptr,a=new Uint8Array(n,r,6),t={};if(t.fileIdentifierString=String.fromCharCode.apply(null,a),t.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+t.fileIdentifierString;r+=6;var i=new DataView(n,r,8),o=i.getInt32(0,!0);t.fileVersion=o,r+=4,o>=3&&(t.checksum=i.getUint32(4,!0),r+=4),i=new DataView(n,r,12),t.height=i.getUint32(0,!0),t.width=i.getUint32(4,!0),r+=8,o>=4?(t.numDims=i.getUint32(8,!0),r+=4):t.numDims=1,i=new DataView(n,r,40),t.numValidPixel=i.getUint32(0,!0),t.microBlockSize=i.getInt32(4,!0),t.blobSize=i.getInt32(8,!0),t.imageType=i.getInt32(12,!0),t.maxZError=i.getFloat64(16,!0),t.zMin=i.getFloat64(24,!0),t.zMax=i.getFloat64(32,!0),r+=40,e.headerInfo=t,e.ptr=r;var s,u;if(o>=3&&(u=o>=4?52:48,s=this.computeChecksumFletcher32(new Uint8Array(n,r-u,t.blobSize-14)),s!==t.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(n,e){var r=e.headerInfo,a=this.getDataTypeArray(r.imageType),t=r.numDims*this.getDataTypeSize(r.imageType),i=this.readSubArray(n,e.ptr,a,t),o=this.readSubArray(n,e.ptr+t,a,t);e.ptr+=2*t;var s,u=!0;for(s=0;s<r.numDims;s++)if(i[s]!==o[s]){u=!1;break}return r.minValues=i,r.maxValues=o,u},readSubArray:function(n,e,r,a){var t;if(r===Uint8Array)t=new Uint8Array(n,e,a);else{var i=new ArrayBuffer(a),o=new Uint8Array(i);o.set(new Uint8Array(n,e,a)),t=new r(i)}return t},readMask:function(n,e){var r=e.ptr,a=e.headerInfo,t=a.width*a.height,i=a.numValidPixel,o=new DataView(n,r,4),s={};if(s.numBytes=o.getUint32(0,!0),r+=4,(i===0||t===i)&&s.numBytes!==0)throw"invalid mask";var u,m;if(i===0)u=new Uint8Array(Math.ceil(t/8)),s.bitset=u,m=new Uint8Array(t),e.pixels.resultMask=m,r+=s.numBytes;else if(s.numBytes>0){u=new Uint8Array(Math.ceil(t/8)),o=new DataView(n,r,s.numBytes);var l=o.getInt16(0,!0),f=2,h=0,c=0;do{if(l>0)for(;l--;)u[h++]=o.getUint8(f++);else for(c=o.getUint8(f++),l=-l;l--;)u[h++]=c;l=o.getInt16(f,!0),f+=2}while(f<s.numBytes);if(l!==-32768||h<u.length)throw"Unexpected end of mask RLE encoding";m=new Uint8Array(t);var g=0,v=0;for(v=0;v<t;v++)v&7?(g=u[v>>3],g<<=v&7):g=u[v>>3],g&128&&(m[v]=1);e.pixels.resultMask=m,s.bitset=u,r+=s.numBytes}return e.ptr=r,e.mask=s,!0},readDataOneSweep:function(n,e,r){var a=e.ptr,t=e.headerInfo,i=t.numDims,o=t.width*t.height,s=t.imageType,u=t.numValidPixel*V.getDataTypeSize(s)*i,m,l=e.pixels.resultMask;if(r===Uint8Array)m=new Uint8Array(n,a,u);else{var f=new ArrayBuffer(u),h=new Uint8Array(f);h.set(new Uint8Array(n,a,u)),m=new r(f)}if(m.length===o*i)e.pixels.resultPixels=m;else{e.pixels.resultPixels=new r(o*i);var c=0,g=0,v=0,U=0;if(i>1)for(v=0;v<i;v++)for(U=v*o,g=0;g<o;g++)l[g]&&(e.pixels.resultPixels[U+g]=m[c++]);else for(g=0;g<o;g++)l[g]&&(e.pixels.resultPixels[g]=m[c++])}return a+=u,e.ptr=a,!0},readHuffmanTree:function(n,e){var r=this.HUFFMAN_LUT_BITS_MAX,a=new DataView(n,e.ptr,16);e.ptr+=16;var t=a.getInt32(0,!0);if(t<2)throw"unsupported Huffman version";var i=a.getInt32(4,!0),o=a.getInt32(8,!0),s=a.getInt32(12,!0);if(o>=s)return!1;var u=new Uint32Array(s-o);V.decodeBits(n,e,u);var m=[],l,f,h,c;for(l=o;l<s;l++)f=l-(l<i?0:i),m[f]={first:u[l-o],second:null};var g=n.byteLength-e.ptr,v=Math.ceil(g/4),U=new ArrayBuffer(v*4),M=new Uint8Array(U);M.set(new Uint8Array(n,e.ptr,g));var S=new Uint32Array(U),I=0,k,w=0;for(k=S[0],l=o;l<s;l++)f=l-(l<i?0:i),c=m[f].first,c>0&&(m[f].second=k<<I>>>32-c,32-I>=c?(I+=c,I===32&&(I=0,w++,k=S[w])):(I+=c-32,w++,k=S[w],m[f].second|=k>>>32-I));var d=0,x=0,T=new b;for(l=0;l<m.length;l++)m[l]!==void 0&&(d=Math.max(d,m[l].first));d>=r?x=r:x=d,d>=30&&console.log("WARning, large NUM LUT BITS IS "+d);var y=[],p,L,B,E,O,F;for(l=o;l<s;l++)if(f=l-(l<i?0:i),c=m[f].first,c>0)if(p=[c,f],c<=x)for(L=m[f].second<<x-c,B=1<<x-c,h=0;h<B;h++)y[L|h]=p;else for(L=m[f].second,F=T,E=c-1;E>=0;E--)O=L>>>E&1,O?(F.right||(F.right=new b),F=F.right):(F.left||(F.left=new b),F=F.left),E===0&&!F.val&&(F.val=p[1]);return{decodeLut:y,numBitsLUTQick:x,numBitsLUT:d,tree:T,stuffedData:S,srcPtr:w,bitPos:I}},readHuffman:function(n,e,r){var a=e.headerInfo,t=a.numDims,i=e.headerInfo.height,o=e.headerInfo.width,s=o*i,u=this.readHuffmanTree(n,e),m=u.decodeLut,l=u.tree,f=u.stuffedData,h=u.srcPtr,c=u.bitPos,g=u.numBitsLUTQick,v=u.numBitsLUT,U=e.headerInfo.imageType===0?128:0,M,S,I,k=e.pixels.resultMask,w,d,x,T,y,p,L,B=0;c>0&&(h++,c=0);var E=f[h],O=e.encodeMode===1,F=new r(s*t),N=F,z;for(z=0;z<a.numDims;z++){if(t>1&&(N=new r(F.buffer,s*z,s),B=0),e.headerInfo.numValidPixel===o*i)for(p=0,T=0;T<i;T++)for(y=0;y<o;y++,p++){if(S=0,w=E<<c>>>32-g,d=w,32-c<g&&(w|=f[h+1]>>>64-c-g,d=w),m[d])S=m[d][1],c+=m[d][0];else for(w=E<<c>>>32-v,d=w,32-c<v&&(w|=f[h+1]>>>64-c-v,d=w),M=l,L=0;L<v;L++)if(x=w>>>v-L-1&1,M=x?M.right:M.left,!(M.left||M.right)){S=M.val,c=c+L+1;break}c>=32&&(c-=32,h++,E=f[h]),I=S-U,O?(y>0?I+=B:T>0?I+=N[p-o]:I+=B,I&=255,N[p]=I,B=I):N[p]=I}else for(p=0,T=0;T<i;T++)for(y=0;y<o;y++,p++)if(k[p]){if(S=0,w=E<<c>>>32-g,d=w,32-c<g&&(w|=f[h+1]>>>64-c-g,d=w),m[d])S=m[d][1],c+=m[d][0];else for(w=E<<c>>>32-v,d=w,32-c<v&&(w|=f[h+1]>>>64-c-v,d=w),M=l,L=0;L<v;L++)if(x=w>>>v-L-1&1,M=x?M.right:M.left,!(M.left||M.right)){S=M.val,c=c+L+1;break}c>=32&&(c-=32,h++,E=f[h]),I=S-U,O?(y>0&&k[p-1]?I+=B:T>0&&k[p-o]?I+=N[p-o]:I+=B,I&=255,N[p]=I,B=I):N[p]=I}e.ptr=e.ptr+(h+1)*4+(c>0?4:0)}e.pixels.resultPixels=F},decodeBits:function(n,e,r,a,t){{var i=e.headerInfo,o=i.fileVersion,s=0,u=new DataView(n,e.ptr,5),m=u.getUint8(0);s++;var l=m>>6,f=l===0?4:3-l,h=(m&32)>0,c=m&31,g=0;if(f===1)g=u.getUint8(s),s++;else if(f===2)g=u.getUint16(s,!0),s+=2;else if(f===4)g=u.getUint32(s,!0),s+=4;else throw"Invalid valid pixel count type";var v=2*i.maxZError,U,M,S,I,k,w,d,x,T,y,p=i.numDims>1?i.maxValues[t]:i.zMax;if(h){for(e.counter.lut++,x=u.getUint8(s),T=c,s++,I=Math.ceil((x-1)*c/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),e.ptr+=s,S.set(new Uint8Array(n,e.ptr,I)),d=new Uint32Array(M),e.ptr+=I,y=0;x-1>>>y;)y++;I=Math.ceil(g*y/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),S.set(new Uint8Array(n,e.ptr,I)),U=new Uint32Array(M),e.ptr+=I,o>=3?w=A.unstuffLUT2(d,c,x-1,a,v,p):w=A.unstuffLUT(d,c,x-1,a,v,p),o>=3?A.unstuff2(U,r,y,g,w):A.unstuff(U,r,y,g,w)}else e.counter.bitstuffer++,y=c,e.ptr+=s,y>0&&(I=Math.ceil(g*y/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),S.set(new Uint8Array(n,e.ptr,I)),U=new Uint32Array(M),e.ptr+=I,o>=3?a==null?A.originalUnstuff2(U,r,y,g):A.unstuff2(U,r,y,g,!1,a,v,p):a==null?A.originalUnstuff(U,r,y,g):A.unstuff(U,r,y,g,!1,a,v,p))}},readTiles:function(n,e,r){var a=e.headerInfo,t=a.width,i=a.height,o=a.microBlockSize,s=a.imageType,u=V.getDataTypeSize(s),m=Math.ceil(t/o),l=Math.ceil(i/o);e.pixels.numBlocksY=l,e.pixels.numBlocksX=m,e.pixels.ptr=0;var f=0,h=0,c=0,g=0,v=0,U=0,M=0,S=0,I=0,k=0,w=0,d=0,x=0,T=0,y=0,p=0,L,B,E,O,F,N,z=new r(o*o),ke=i%o||o,ye=t%o||o,J,Z,ue=a.numDims,te,j=e.pixels.resultMask,q=e.pixels.resultPixels;for(c=0;c<l;c++)for(v=c!==l-1?o:ke,g=0;g<m;g++)for(U=g!==m-1?o:ye,w=c*t*o+g*o,d=t-U,te=0;te<ue;te++){if(ue>1&&(q=new r(e.pixels.resultPixels.buffer,t*i*te*u,t*i)),M=n.byteLength-e.ptr,L=new DataView(n,e.ptr,Math.min(10,M)),B={},p=0,S=L.getUint8(0),p++,I=S>>6&255,k=S>>2&15,k!==(g*o>>3&15))throw"integrity issue";if(N=S&3,N>3)throw e.ptr+=p,"Invalid block encoding ("+N+")";if(N===2){e.counter.constant++,e.ptr+=p;continue}else if(N===0){if(e.counter.uncompressed++,e.ptr+=p,x=v*U*u,T=n.byteLength-e.ptr,x=x<T?x:T,E=new ArrayBuffer(x%u===0?x:x+u-x%u),O=new Uint8Array(E),O.set(new Uint8Array(n,e.ptr,x)),F=new r(E),y=0,j)for(f=0;f<v;f++){for(h=0;h<U;h++)j[w]&&(q[w]=F[y++]),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)q[w++]=F[y++];w+=d}e.ptr+=y*u}else if(J=V.getDataTypeUsed(s,I),Z=V.getOnePixel(B,p,J,L),p+=V.getDataTypeSize(J),N===3)if(e.ptr+=p,e.counter.constantoffset++,j)for(f=0;f<v;f++){for(h=0;h<U;h++)j[w]&&(q[w]=Z),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)q[w++]=Z;w+=d}else if(e.ptr+=p,V.decodeBits(n,e,z,Z,te),p=0,j)for(f=0;f<v;f++){for(h=0;h<U;h++)j[w]&&(q[w]=z[p++]),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)q[w++]=z[p++];w+=d}}},formatFileInfo:function(n){return{fileIdentifierString:n.headerInfo.fileIdentifierString,fileVersion:n.headerInfo.fileVersion,imageType:n.headerInfo.imageType,height:n.headerInfo.height,width:n.headerInfo.width,numValidPixel:n.headerInfo.numValidPixel,microBlockSize:n.headerInfo.microBlockSize,blobSize:n.headerInfo.blobSize,maxZError:n.headerInfo.maxZError,pixelType:V.getPixelType(n.headerInfo.imageType),eofOffset:n.eofOffset,mask:n.mask?{numBytes:n.mask.numBytes}:null,pixels:{numBlocksX:n.pixels.numBlocksX,numBlocksY:n.pixels.numBlocksY,maxValue:n.headerInfo.zMax,minValue:n.headerInfo.zMin,noDataValue:n.noDataValue}}},constructConstantSurface:function(n){var e=n.headerInfo.zMax,r=n.headerInfo.numDims,a=n.headerInfo.height*n.headerInfo.width,t=a*r,i=0,o=0,s=0,u=n.pixels.resultMask;if(u)if(r>1)for(i=0;i<r;i++)for(s=i*a,o=0;o<a;o++)u[o]&&(n.pixels.resultPixels[s+o]=e);else for(o=0;o<a;o++)u[o]&&(n.pixels.resultPixels[o]=e);else if(n.pixels.resultPixels.fill)n.pixels.resultPixels.fill(e);else for(o=0;o<t;o++)n.pixels.resultPixels[o]=e},getDataTypeArray:function(n){var e;switch(n){case 0:e=Int8Array;break;case 1:e=Uint8Array;break;case 2:e=Int16Array;break;case 3:e=Uint16Array;break;case 4:e=Int32Array;break;case 5:e=Uint32Array;break;case 6:e=Float32Array;break;case 7:e=Float64Array;break;default:e=Float32Array}return e},getPixelType:function(n){var e;switch(n){case 0:e="S8";break;case 1:e="U8";break;case 2:e="S16";break;case 3:e="U16";break;case 4:e="S32";break;case 5:e="U32";break;case 6:e="F32";break;case 7:e="F64";break;default:e="F32"}return e},isValidPixelValue:function(n,e){if(e==null)return!1;var r;switch(n){case 0:r=e>=-128&&e<=127;break;case 1:r=e>=0&&e<=255;break;case 2:r=e>=-32768&&e<=32767;break;case 3:r=e>=0&&e<=65536;break;case 4:r=e>=-2147483648&&e<=2147483647;break;case 5:r=e>=0&&e<=4294967296;break;case 6:r=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:r=e>=5e-324&&e<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(n){var e=0;switch(n){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=n}return e},getDataTypeUsed:function(n,e){var r=n;switch(n){case 2:case 4:r=n-e;break;case 3:case 5:r=n-2*e;break;case 6:e===0?r=n:e===1?r=2:r=1;break;case 7:e===0?r=n:r=n-2*e+1;break;default:r=n;break}return r},getOnePixel:function(n,e,r,a){var t=0;switch(r){case 0:t=a.getInt8(e);break;case 1:t=a.getUint8(e);break;case 2:t=a.getInt16(e,!0);break;case 3:t=a.getUint16(e,!0);break;case 4:t=a.getInt32(e,!0);break;case 5:t=a.getUInt32(e,!0);break;case 6:t=a.getFloat32(e,!0);break;case 7:t=a.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return t}},b=function(n,e,r){this.val=n,this.left=e,this.right=r},X={decode:function(n,e){e=e||{};var r=e.noDataValue,a=0,t={};if(t.ptr=e.inputOffset||0,t.pixels={},!!V.readHeaderInfo(n,t)){var i=t.headerInfo,o=i.fileVersion,s=V.getDataTypeArray(i.imageType);V.readMask(n,t),i.numValidPixel!==i.width*i.height&&!t.pixels.resultMask&&(t.pixels.resultMask=e.maskData);var u=i.width*i.height;if(t.pixels.resultPixels=new s(u*i.numDims),t.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},i.numValidPixel!==0)if(i.zMax===i.zMin)V.constructConstantSurface(t);else if(o>=4&&V.checkMinMaxRanges(n,t))V.constructConstantSurface(t);else{var m=new DataView(n,t.ptr,2),l=m.getUint8(0);if(t.ptr++,l)V.readDataOneSweep(n,t,s);else if(o>1&&i.imageType<=1&&Math.abs(i.maxZError-.5)<1e-5){var f=m.getUint8(1);if(t.ptr++,t.encodeMode=f,f>2||o<4&&f>1)throw"Invalid Huffman flag "+f;f?V.readHuffman(n,t,s):V.readTiles(n,t,s)}else V.readTiles(n,t,s)}t.eofOffset=t.ptr;var h;e.inputOffset?(h=t.headerInfo.blobSize+e.inputOffset-t.ptr,Math.abs(h)>=1&&(t.eofOffset=e.inputOffset+t.headerInfo.blobSize)):(h=t.headerInfo.blobSize-t.ptr,Math.abs(h)>=1&&(t.eofOffset=t.headerInfo.blobSize));var c={width:i.width,height:i.height,pixelData:t.pixels.resultPixels,minValue:i.zMin,maxValue:i.zMax,validPixelCount:i.numValidPixel,dimCount:i.numDims,dimStats:{minValues:i.minValues,maxValues:i.maxValues},maskData:t.pixels.resultMask};if(t.pixels.resultMask&&V.isValidPixelValue(i.imageType,r)){var g=t.pixels.resultMask;for(a=0;a<u;a++)g[a]||(c.pixelData[a]=r);c.noDataValue=r}return t.noDataValue=r,e.returnFileInfo&&(c.fileInfo=V.formatFileInfo(t)),c}},getBandCount:function(n){var e=0,r=0,a={};for(a.ptr=0,a.pixels={};r<n.byteLength-58;)V.readHeaderInfo(n,a),r+=a.headerInfo.blobSize,e++,a.ptr=r;return e}};return X}(),C=function(){var A=new ArrayBuffer(4),V=new Uint8Array(A),b=new Uint32Array(A);return b[0]=1,V[0]===1}(),re={decode:function(A,V){if(!C)throw"Big endian system is not supported.";V=V||{};var b=V.inputOffset||0,X=new Uint8Array(A,b,10),n=String.fromCharCode.apply(null,X),e,r;if(n.trim()==="CntZImage")e=D,r=1;else if(n.substring(0,5)==="Lerc2")e=se,r=2;else throw"Unexpected file identifier string: "+n;for(var a=0,t=A.byteLength-10,i,o=[],s,u,m={width:0,height:0,pixels:[],pixelType:V.pixelType,mask:null,statistics:[]};b<t;){var l=e.decode(A,{inputOffset:b,encodedMaskData:i,maskData:u,returnMask:a===0,returnEncodedMask:a===0,returnFileInfo:!0,pixelType:V.pixelType||null,noDataValue:V.noDataValue||null});b=l.fileInfo.eofOffset,a===0&&(i=l.encodedMaskData,u=l.maskData,m.width=l.width,m.height=l.height,m.dimCount=l.dimCount||1,m.pixelType=l.pixelType||l.fileInfo.pixelType,m.mask=l.maskData),r>1&&l.fileInfo.mask&&l.fileInfo.mask.numBytes>0&&o.push(l.maskData),a++,m.pixels.push(l.pixelData),m.statistics.push({minValue:l.minValue,maxValue:l.maxValue,noDataValue:l.noDataValue,dimStats:l.dimStats})}var f,h,c;if(r>1&&o.length>1){for(c=m.width*m.height,m.bandMasks=o,u=new Uint8Array(c),u.set(o[0]),f=1;f<o.length;f++)for(s=o[f],h=0;h<c;h++)u[h]=u[h]&s[h];m.maskData=u}return m}};typeof define=="function"&&define.amd?define([],function(){return re}):typeof Te<"u"&&Te.exports?Te.exports=re:this.Lerc=re})()});var Ur={NONE:0,LERC:1},or=Object.freeze(Ur);var Q={};Q.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Ye=new ie,Tr=new xe,kr=new ie,yr=new ie;Q.computeVertices=function(D){if(!G(D)||!G(D.heightmap))throw new he("options.heightmap is required.");if(!G(D.width)||!G(D.height))throw new he("options.width and options.height are required.");if(!G(D.nativeRectangle))throw new he("options.nativeRectangle is required.");if(!G(D.skirtHeight))throw new he("options.skirtHeight is required.");let se=Math.cos,C=Math.sin,re=Math.sqrt,A=Math.atan,V=Math.exp,b=ge.PI_OVER_TWO,X=ge.toRadians,n=D.heightmap,e=D.width,r=D.height,a=D.skirtHeight,t=a>0,i=Y(D.isGeographic,!0),o=Y(D.ellipsoid,Ie.default),s=1/o.maximumRadius,u=ae.clone(D.nativeRectangle),m=ae.clone(D.rectangle),l,f,h,c;G(m)?(l=m.west,f=m.south,h=m.east,c=m.north):i?(l=X(u.west),f=X(u.south),h=X(u.east),c=X(u.north)):(l=u.west*s,f=b-2*A(V(-u.south*s)),h=u.east*s,c=b-2*A(V(-u.north*s)));let g=D.relativeToCenter,v=G(g);g=v?g:ie.ZERO;let U=Y(D.includeWebMercatorT,!1),M=Y(D.exaggeration,1),S=Y(D.exaggerationRelativeHeight,0),k=M!==1,w=Y(D.structure,Q.DEFAULT_STRUCTURE),d=Y(w.heightScale,Q.DEFAULT_STRUCTURE.heightScale),x=Y(w.heightOffset,Q.DEFAULT_STRUCTURE.heightOffset),T=Y(w.elementsPerHeight,Q.DEFAULT_STRUCTURE.elementsPerHeight),y=Y(w.stride,Q.DEFAULT_STRUCTURE.stride),p=Y(w.elementMultiplier,Q.DEFAULT_STRUCTURE.elementMultiplier),L=Y(w.isBigEndian,Q.DEFAULT_STRUCTURE.isBigEndian),B=ae.computeWidth(u),E=ae.computeHeight(u),O=B/(e-1),F=E/(r-1);i||(B*=s,E*=s);let N=o.radiiSquared,z=N.x,ke=N.y,ye=N.z,J=65536,Z=-65536,ue=rr.eastNorthUpToFixedFrame(g,o),te=xe.inverseTransformation(ue,Tr),j,q;U&&(j=Ue.geodeticLatitudeToMercatorAngle(f),q=1/(Ue.geodeticLatitudeToMercatorAngle(c)-j));let fe=kr;fe.x=Number.POSITIVE_INFINITY,fe.y=Number.POSITIVE_INFINITY,fe.z=Number.POSITIVE_INFINITY;let oe=yr;oe.x=Number.NEGATIVE_INFINITY,oe.y=Number.NEGATIVE_INFINITY,oe.z=Number.NEGATIVE_INFINITY;let Me=Number.POSITIVE_INFINITY,ce=e*r,mr=a>0?e*2+r*2:0,ne=ce+mr,ve=new Array(ne),Xe=new Array(ne),_e=new Array(ne),ze=U?new Array(ne):[],Ze=k?new Array(ne):[],Se=0,Ve=r,De=0,Ae=e;t&&(--Se,++Ve,--De,++Ae);let de=1e-5;for(let H=Se;H<Ve;++H){let K=H;K<0&&(K=0),K>=r&&(K=r-1);let W=u.north-F*K;i?W=X(W):W=b-2*A(V(-W*s));let Le=(W-f)/(c-f);Le=ge.clamp(Le,0,1);let we=H===Se,pe=H===Ve-1;a>0&&(we?W+=de*E:pe&&(W-=de*E));let Qe=se(W),Be=C(W),Je=ye*Be,Ke;U&&(Ke=(Ue.geodeticLatitudeToMercatorAngle(W)-j)*q);for(let me=De;me<Ae;++me){let $=me;$<0&&($=0),$>=e&&($=e-1);let Fe=K*(e*y)+$*y,R;if(T===1)R=n[Fe];else{R=0;let _;if(L)for(_=0;_<T;++_)R=R*p+n[Fe+_];else for(_=T-1;_>=0;--_)R=R*p+n[Fe+_]}R=R*d+x,Z=Math.max(Z,R),J=Math.min(J,R);let P=u.west+O*$;i?P=X(P):P=P*s;let be=(P-l)/(h-l);be=ge.clamp(be,0,1);let ee=K*e+$;if(a>0){let _=me===De,Re=me===Ae-1,pr=we||pe||_||Re;if((we||pe)&&(_||Re))continue;pr&&(R-=a,_?(ee=ce+(r-K-1),P-=de*B):pe?ee=ce+r+(e-$-1):Re?(ee=ce+r+e+K,P+=de*B):we&&(ee=ce+r+e+r+$))}let Ne=Qe*se(P),Ce=Qe*C(P),$e=z*Ne,Pe=ke*Ce,Oe=1/re($e*Ne+Pe*Ce+Je*Be),vr=$e*Oe,dr=Pe*Oe,wr=Je*Oe,le=new ie;le.x=vr+Ne*R,le.y=dr+Ce*R,le.z=wr+Be*R,xe.multiplyByPoint(te,le,Ye),ie.minimumByComponent(Ye,fe,fe),ie.maximumByComponent(Ye,oe,oe),Me=Math.min(Me,R),ve[ee]=le,_e[ee]=new er(be,Le),Xe[ee]=R,U&&(ze[ee]=Ke),k&&(Ze[ee]=o.geodeticSurfaceNormal(le))}}let hr=ir.fromPoints(ve),je;G(m)&&(je=ar.fromRectangle(m,J,Z,o));let qe;v&&(qe=new sr(o).computeHorizonCullingPointPossiblyUnderEllipsoid(g,ve,J));let gr=new nr(fe,oe,g),Ee=new fr(g,gr,Me,Z,ue,!1,U,k,M,S),We=new Float32Array(ne*Ee.stride),Ge=0;for(let H=0;H<ne;++H)Ge=Ee.encode(We,Ge,ve[H],_e[H],Xe[H],void 0,ze[H],Ze[H]);return{vertices:We,maximumHeight:Z,minimumHeight:J,encoding:Ee,boundingSphere3D:hr,orientedBoundingBox:je,occludeePointInScaledSpace:qe}};var lr=Q;var cr=xr(ur(),1);function Mr(D,se){if(D.encoding===or.LERC){let A;try{A=cr.default.decode(D.heightmap)}catch(b){throw new He(b)}if(A.statistics[0].minValue===Number.MAX_VALUE)throw new He("Invalid tile data");D.heightmap=A.pixels[0],D.width=A.width,D.height=A.height}D.ellipsoid=Ie.clone(D.ellipsoid),D.rectangle=ae.clone(D.rectangle);let C=lr.computeVertices(D),re=C.vertices;return se.push(re.buffer),{vertices:re.buffer,numberOfAttributes:C.encoding.stride,minimumHeight:C.minimumHeight,maximumHeight:C.maximumHeight,gridWidth:D.width,gridHeight:D.height,boundingSphere3D:C.boundingSphere3D,orientedBoundingBox:C.orientedBoundingBox,occludeePointInScaledSpace:C.occludeePointInScaledSpace,encoding:C.encoding,westIndicesSouthToNorth:C.westIndicesSouthToNorth,southIndicesEastToWest:C.southIndicesEastToWest,eastIndicesNorthToSouth:C.eastIndicesNorthToSouth,northIndicesWestToEast:C.northIndicesWestToEast}}var Pr=tr(Mr);export{Pr as default}; +import{a as sr,b as fr}from"./chunk-VQ4ICMD3.js";import{a as tr}from"./chunk-4E3APMCC.js";import{a as Ue}from"./chunk-HMHR6SIB.js";import{a as ar}from"./chunk-DGVML3P5.js";import"./chunk-VMXXQ6B4.js";import"./chunk-P73YILG6.js";import{a as nr}from"./chunk-VYMAIP2A.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{d as ir}from"./chunk-2NIQ5ECB.js";import{b as xe,g as rr,h as ae}from"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as ie,c as er,d as Ie}from"./chunk-RH3GFHG2.js";import{a as ge}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import{a as He}from"./chunk-UAWOHN7R.js";import{a as Y}from"./chunk-TA3RE4KQ.js";import{a as he}from"./chunk-RTY3VPG6.js";import{c as Ir,d as xr,e as G}from"./chunk-LRNH5AEO.js";var ur=Ir((qr,Te)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var D=function(){var A={};A.defaultNoDataValue=-34027999387901484e22,A.decode=function(r,a){a=a||{};var t=a.encodedMaskData||a.encodedMaskData===null,i=n(r,a.inputOffset||0,t),o=a.noDataValue!==null?a.noDataValue:A.defaultNoDataValue,s=V(i,a.pixelType||Float32Array,a.encodedMaskData,o,a.returnMask),u={width:i.width,height:i.height,pixelData:s.resultPixels,minValue:s.minValue,maxValue:i.pixels.maxValue,noDataValue:o};return s.resultMask&&(u.maskData=s.resultMask),a.returnEncodedMask&&i.mask&&(u.encodedMaskData=i.mask.bitset?i.mask.bitset:null),a.returnFileInfo&&(u.fileInfo=b(i),a.computeUsedBitDepths&&(u.fileInfo.bitDepths=X(i))),u};var V=function(r,a,t,i,o){var s=0,u=r.pixels.numBlocksX,m=r.pixels.numBlocksY,l=Math.floor(r.width/u),f=Math.floor(r.height/m),h=2*r.maxZError,c=Number.MAX_VALUE,g;t=t||(r.mask?r.mask.bitset:null);var v,U;v=new a(r.width*r.height),o&&t&&(U=new Uint8Array(r.width*r.height));for(var M=new Float32Array(l*f),S,I,k=0;k<=m;k++){var w=k!==m?f:r.height%m;if(w!==0)for(var d=0;d<=u;d++){var x=d!==u?l:r.width%u;if(x!==0){var T=k*r.width*f+d*l,y=r.width-x,p=r.pixels.blocks[s],L,B,E;p.encoding<2?(p.encoding===0?L=p.rawData:(e(p.stuffedData,p.bitsPerPixel,p.numValidPixels,p.offset,h,M,r.pixels.maxValue),L=M),B=0):p.encoding===2?E=0:E=p.offset;var O;if(t)for(I=0;I<w;I++){for(T&7&&(O=t[T>>3],O<<=T&7),S=0;S<x;S++)T&7||(O=t[T>>3]),O&128?(U&&(U[T]=1),g=p.encoding<2?L[B++]:E,c=c>g?g:c,v[T++]=g):(U&&(U[T]=0),v[T++]=i),O<<=1;T+=y}else if(p.encoding<2)for(I=0;I<w;I++){for(S=0;S<x;S++)g=L[B++],c=c>g?g:c,v[T++]=g;T+=y}else for(c=c>E?E:c,I=0;I<w;I++){for(S=0;S<x;S++)v[T++]=E;T+=y}if(p.encoding===1&&B!==p.numValidPixels)throw"Block and Mask do not match";s++}}}return{resultPixels:v,resultMask:U,minValue:c}},b=function(r){return{fileIdentifierString:r.fileIdentifierString,fileVersion:r.fileVersion,imageType:r.imageType,height:r.height,width:r.width,maxZError:r.maxZError,eofOffset:r.eofOffset,mask:r.mask?{numBlocksX:r.mask.numBlocksX,numBlocksY:r.mask.numBlocksY,numBytes:r.mask.numBytes,maxValue:r.mask.maxValue}:null,pixels:{numBlocksX:r.pixels.numBlocksX,numBlocksY:r.pixels.numBlocksY,numBytes:r.pixels.numBytes,maxValue:r.pixels.maxValue,noDataValue:r.noDataValue}}},X=function(r){for(var a=r.pixels.numBlocksX*r.pixels.numBlocksY,t={},i=0;i<a;i++){var o=r.pixels.blocks[i];o.encoding===0?t.float32=!0:o.encoding===1?t[o.bitsPerPixel]=!0:t[0]=!0}return Object.keys(t)},n=function(r,a,t){var i={},o=new Uint8Array(r,a,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,o),i.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+i.fileIdentifierString;a+=10;var s=new DataView(r,a,24);if(i.fileVersion=s.getInt32(0,!0),i.imageType=s.getInt32(4,!0),i.height=s.getUint32(8,!0),i.width=s.getUint32(12,!0),i.maxZError=s.getFloat64(16,!0),a+=24,!t)if(s=new DataView(r,a,16),i.mask={},i.mask.numBlocksY=s.getUint32(0,!0),i.mask.numBlocksX=s.getUint32(4,!0),i.mask.numBytes=s.getUint32(8,!0),i.mask.maxValue=s.getFloat32(12,!0),a+=16,i.mask.numBytes>0){var u=new Uint8Array(Math.ceil(i.width*i.height/8));s=new DataView(r,a,i.mask.numBytes);var m=s.getInt16(0,!0),l=2,f=0;do{if(m>0)for(;m--;)u[f++]=s.getUint8(l++);else{var h=s.getUint8(l++);for(m=-m;m--;)u[f++]=h}m=s.getInt16(l,!0),l+=2}while(l<i.mask.numBytes);if(m!==-32768||f<u.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=u,a+=i.mask.numBytes}else i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue||(i.mask.bitset=new Uint8Array(Math.ceil(i.width*i.height/8)));s=new DataView(r,a,16),i.pixels={},i.pixels.numBlocksY=s.getUint32(0,!0),i.pixels.numBlocksX=s.getUint32(4,!0),i.pixels.numBytes=s.getUint32(8,!0),i.pixels.maxValue=s.getFloat32(12,!0),a+=16;var c=i.pixels.numBlocksX,g=i.pixels.numBlocksY,v=c+(i.width%c>0?1:0),U=g+(i.height%g>0?1:0);i.pixels.blocks=new Array(v*U);for(var M=0,S=0;S<U;S++)for(var I=0;I<v;I++){var k=0,w=r.byteLength-a;s=new DataView(r,a,Math.min(10,w));var d={};i.pixels.blocks[M++]=d;var x=s.getUint8(0);if(k++,d.encoding=x&63,d.encoding>3)throw"Invalid block encoding ("+d.encoding+")";if(d.encoding===2){a++;continue}if(x!==0&&x!==2){if(x>>=6,d.offsetType=x,x===2)d.offset=s.getInt8(1),k++;else if(x===1)d.offset=s.getInt16(1,!0),k+=2;else if(x===0)d.offset=s.getFloat32(1,!0),k+=4;else throw"Invalid block offset type";if(d.encoding===1)if(x=s.getUint8(k),k++,d.bitsPerPixel=x&63,x>>=6,d.numValidPixelsType=x,x===2)d.numValidPixels=s.getUint8(k),k++;else if(x===1)d.numValidPixels=s.getUint16(k,!0),k+=2;else if(x===0)d.numValidPixels=s.getUint32(k,!0),k+=4;else throw"Invalid valid pixel count type"}if(a+=k,d.encoding!==3){var T,y;if(d.encoding===0){var p=(i.pixels.numBytes-1)/4;if(p!==Math.floor(p))throw"uncompressed block has invalid length";T=new ArrayBuffer(p*4),y=new Uint8Array(T),y.set(new Uint8Array(r,a,p*4));var L=new Float32Array(T);d.rawData=L,a+=p*4}else if(d.encoding===1){var B=Math.ceil(d.numValidPixels*d.bitsPerPixel/8),E=Math.ceil(B/4);T=new ArrayBuffer(E*4),y=new Uint8Array(T),y.set(new Uint8Array(r,a,B)),d.stuffedData=new Uint32Array(T),a+=B}}}return i.eofOffset=a,i},e=function(r,a,t,i,o,s,u){var m=(1<<a)-1,l=0,f,h=0,c,g,v=Math.ceil((u-i)/o),U=r.length*4-Math.ceil(a*t/8);for(r[r.length-1]<<=8*U,f=0;f<t;f++){if(h===0&&(g=r[l++],h=32),h>=a)c=g>>>h-a&m,h-=a;else{var M=a-h;c=(g&m)<<M&m,g=r[l++],h=32-M,c+=g>>>h}s[f]=c<v?i+c*o:u}return s};return A}(),se=function(){"use strict";var A={unstuff:function(n,e,r,a,t,i,o,s){var u=(1<<r)-1,m=0,l,f=0,h,c,g,v,U=n.length*4-Math.ceil(r*a/8);if(n[n.length-1]<<=8*U,t)for(l=0;l<a;l++)f===0&&(c=n[m++],f=32),f>=r?(h=c>>>f-r&u,f-=r):(g=r-f,h=(c&u)<<g&u,c=n[m++],f=32-g,h+=c>>>f),e[l]=t[h];else for(v=Math.ceil((s-i)/o),l=0;l<a;l++)f===0&&(c=n[m++],f=32),f>=r?(h=c>>>f-r&u,f-=r):(g=r-f,h=(c&u)<<g&u,c=n[m++],f=32-g,h+=c>>>f),e[l]=h<v?i+h*o:s},unstuffLUT:function(n,e,r,a,t,i){var o=(1<<e)-1,s=0,u=0,m=0,l=0,f=0,h,c=[],g=n.length*4-Math.ceil(e*r/8);n[n.length-1]<<=8*g;var v=Math.ceil((i-a)/t);for(u=0;u<r;u++)l===0&&(h=n[s++],l=32),l>=e?(f=h>>>l-e&o,l-=e):(m=e-l,f=(h&o)<<m&o,h=n[s++],l=32-m,f+=h>>>l),c[u]=f<v?a+f*t:i;return c.unshift(a),c},unstuff2:function(n,e,r,a,t,i,o,s){var u=(1<<r)-1,m=0,l,f=0,h=0,c,g,v;if(t)for(l=0;l<a;l++)f===0&&(g=n[m++],f=32,h=0),f>=r?(c=g>>>h&u,f-=r,h+=r):(v=r-f,c=g>>>h&u,g=n[m++],f=32-v,c|=(g&(1<<v)-1)<<r-v,h=v),e[l]=t[c];else{var U=Math.ceil((s-i)/o);for(l=0;l<a;l++)f===0&&(g=n[m++],f=32,h=0),f>=r?(c=g>>>h&u,f-=r,h+=r):(v=r-f,c=g>>>h&u,g=n[m++],f=32-v,c|=(g&(1<<v)-1)<<r-v,h=v),e[l]=c<U?i+c*o:s}return e},unstuffLUT2:function(n,e,r,a,t,i){var o=(1<<e)-1,s=0,u=0,m=0,l=0,f=0,h=0,c,g=[],v=Math.ceil((i-a)/t);for(u=0;u<r;u++)l===0&&(c=n[s++],l=32,h=0),l>=e?(f=c>>>h&o,l-=e,h+=e):(m=e-l,f=c>>>h&o,c=n[s++],l=32-m,f|=(c&(1<<m)-1)<<e-m,h=m),g[u]=f<v?a+f*t:i;return g.unshift(a),g},originalUnstuff:function(n,e,r,a){var t=(1<<r)-1,i=0,o,s=0,u,m,l,f=n.length*4-Math.ceil(r*a/8);for(n[n.length-1]<<=8*f,o=0;o<a;o++)s===0&&(m=n[i++],s=32),s>=r?(u=m>>>s-r&t,s-=r):(l=r-s,u=(m&t)<<l&t,m=n[i++],s=32-l,u+=m>>>s),e[o]=u;return e},originalUnstuff2:function(n,e,r,a){var t=(1<<r)-1,i=0,o,s=0,u=0,m,l,f;for(o=0;o<a;o++)s===0&&(l=n[i++],s=32,u=0),s>=r?(m=l>>>u&t,s-=r,u+=r):(f=r-s,m=l>>>u&t,l=n[i++],s=32-f,m|=(l&(1<<f)-1)<<r-f,u=f),e[o]=m;return e}},V={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(n){for(var e=65535,r=65535,a=n.length,t=Math.floor(a/2),i=0;t;){var o=t>=359?359:t;t-=o;do e+=n[i++]<<8,r+=e+=n[i++];while(--o);e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16)}return a&1&&(r+=e+=n[i]<<8),e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16),(r<<16|e)>>>0},readHeaderInfo:function(n,e){var r=e.ptr,a=new Uint8Array(n,r,6),t={};if(t.fileIdentifierString=String.fromCharCode.apply(null,a),t.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+t.fileIdentifierString;r+=6;var i=new DataView(n,r,8),o=i.getInt32(0,!0);t.fileVersion=o,r+=4,o>=3&&(t.checksum=i.getUint32(4,!0),r+=4),i=new DataView(n,r,12),t.height=i.getUint32(0,!0),t.width=i.getUint32(4,!0),r+=8,o>=4?(t.numDims=i.getUint32(8,!0),r+=4):t.numDims=1,i=new DataView(n,r,40),t.numValidPixel=i.getUint32(0,!0),t.microBlockSize=i.getInt32(4,!0),t.blobSize=i.getInt32(8,!0),t.imageType=i.getInt32(12,!0),t.maxZError=i.getFloat64(16,!0),t.zMin=i.getFloat64(24,!0),t.zMax=i.getFloat64(32,!0),r+=40,e.headerInfo=t,e.ptr=r;var s,u;if(o>=3&&(u=o>=4?52:48,s=this.computeChecksumFletcher32(new Uint8Array(n,r-u,t.blobSize-14)),s!==t.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(n,e){var r=e.headerInfo,a=this.getDataTypeArray(r.imageType),t=r.numDims*this.getDataTypeSize(r.imageType),i=this.readSubArray(n,e.ptr,a,t),o=this.readSubArray(n,e.ptr+t,a,t);e.ptr+=2*t;var s,u=!0;for(s=0;s<r.numDims;s++)if(i[s]!==o[s]){u=!1;break}return r.minValues=i,r.maxValues=o,u},readSubArray:function(n,e,r,a){var t;if(r===Uint8Array)t=new Uint8Array(n,e,a);else{var i=new ArrayBuffer(a),o=new Uint8Array(i);o.set(new Uint8Array(n,e,a)),t=new r(i)}return t},readMask:function(n,e){var r=e.ptr,a=e.headerInfo,t=a.width*a.height,i=a.numValidPixel,o=new DataView(n,r,4),s={};if(s.numBytes=o.getUint32(0,!0),r+=4,(i===0||t===i)&&s.numBytes!==0)throw"invalid mask";var u,m;if(i===0)u=new Uint8Array(Math.ceil(t/8)),s.bitset=u,m=new Uint8Array(t),e.pixels.resultMask=m,r+=s.numBytes;else if(s.numBytes>0){u=new Uint8Array(Math.ceil(t/8)),o=new DataView(n,r,s.numBytes);var l=o.getInt16(0,!0),f=2,h=0,c=0;do{if(l>0)for(;l--;)u[h++]=o.getUint8(f++);else for(c=o.getUint8(f++),l=-l;l--;)u[h++]=c;l=o.getInt16(f,!0),f+=2}while(f<s.numBytes);if(l!==-32768||h<u.length)throw"Unexpected end of mask RLE encoding";m=new Uint8Array(t);var g=0,v=0;for(v=0;v<t;v++)v&7?(g=u[v>>3],g<<=v&7):g=u[v>>3],g&128&&(m[v]=1);e.pixels.resultMask=m,s.bitset=u,r+=s.numBytes}return e.ptr=r,e.mask=s,!0},readDataOneSweep:function(n,e,r){var a=e.ptr,t=e.headerInfo,i=t.numDims,o=t.width*t.height,s=t.imageType,u=t.numValidPixel*V.getDataTypeSize(s)*i,m,l=e.pixels.resultMask;if(r===Uint8Array)m=new Uint8Array(n,a,u);else{var f=new ArrayBuffer(u),h=new Uint8Array(f);h.set(new Uint8Array(n,a,u)),m=new r(f)}if(m.length===o*i)e.pixels.resultPixels=m;else{e.pixels.resultPixels=new r(o*i);var c=0,g=0,v=0,U=0;if(i>1)for(v=0;v<i;v++)for(U=v*o,g=0;g<o;g++)l[g]&&(e.pixels.resultPixels[U+g]=m[c++]);else for(g=0;g<o;g++)l[g]&&(e.pixels.resultPixels[g]=m[c++])}return a+=u,e.ptr=a,!0},readHuffmanTree:function(n,e){var r=this.HUFFMAN_LUT_BITS_MAX,a=new DataView(n,e.ptr,16);e.ptr+=16;var t=a.getInt32(0,!0);if(t<2)throw"unsupported Huffman version";var i=a.getInt32(4,!0),o=a.getInt32(8,!0),s=a.getInt32(12,!0);if(o>=s)return!1;var u=new Uint32Array(s-o);V.decodeBits(n,e,u);var m=[],l,f,h,c;for(l=o;l<s;l++)f=l-(l<i?0:i),m[f]={first:u[l-o],second:null};var g=n.byteLength-e.ptr,v=Math.ceil(g/4),U=new ArrayBuffer(v*4),M=new Uint8Array(U);M.set(new Uint8Array(n,e.ptr,g));var S=new Uint32Array(U),I=0,k,w=0;for(k=S[0],l=o;l<s;l++)f=l-(l<i?0:i),c=m[f].first,c>0&&(m[f].second=k<<I>>>32-c,32-I>=c?(I+=c,I===32&&(I=0,w++,k=S[w])):(I+=c-32,w++,k=S[w],m[f].second|=k>>>32-I));var d=0,x=0,T=new b;for(l=0;l<m.length;l++)m[l]!==void 0&&(d=Math.max(d,m[l].first));d>=r?x=r:x=d,d>=30&&console.log("WARning, large NUM LUT BITS IS "+d);var y=[],p,L,B,E,O,F;for(l=o;l<s;l++)if(f=l-(l<i?0:i),c=m[f].first,c>0)if(p=[c,f],c<=x)for(L=m[f].second<<x-c,B=1<<x-c,h=0;h<B;h++)y[L|h]=p;else for(L=m[f].second,F=T,E=c-1;E>=0;E--)O=L>>>E&1,O?(F.right||(F.right=new b),F=F.right):(F.left||(F.left=new b),F=F.left),E===0&&!F.val&&(F.val=p[1]);return{decodeLut:y,numBitsLUTQick:x,numBitsLUT:d,tree:T,stuffedData:S,srcPtr:w,bitPos:I}},readHuffman:function(n,e,r){var a=e.headerInfo,t=a.numDims,i=e.headerInfo.height,o=e.headerInfo.width,s=o*i,u=this.readHuffmanTree(n,e),m=u.decodeLut,l=u.tree,f=u.stuffedData,h=u.srcPtr,c=u.bitPos,g=u.numBitsLUTQick,v=u.numBitsLUT,U=e.headerInfo.imageType===0?128:0,M,S,I,k=e.pixels.resultMask,w,d,x,T,y,p,L,B=0;c>0&&(h++,c=0);var E=f[h],O=e.encodeMode===1,F=new r(s*t),N=F,z;for(z=0;z<a.numDims;z++){if(t>1&&(N=new r(F.buffer,s*z,s),B=0),e.headerInfo.numValidPixel===o*i)for(p=0,T=0;T<i;T++)for(y=0;y<o;y++,p++){if(S=0,w=E<<c>>>32-g,d=w,32-c<g&&(w|=f[h+1]>>>64-c-g,d=w),m[d])S=m[d][1],c+=m[d][0];else for(w=E<<c>>>32-v,d=w,32-c<v&&(w|=f[h+1]>>>64-c-v,d=w),M=l,L=0;L<v;L++)if(x=w>>>v-L-1&1,M=x?M.right:M.left,!(M.left||M.right)){S=M.val,c=c+L+1;break}c>=32&&(c-=32,h++,E=f[h]),I=S-U,O?(y>0?I+=B:T>0?I+=N[p-o]:I+=B,I&=255,N[p]=I,B=I):N[p]=I}else for(p=0,T=0;T<i;T++)for(y=0;y<o;y++,p++)if(k[p]){if(S=0,w=E<<c>>>32-g,d=w,32-c<g&&(w|=f[h+1]>>>64-c-g,d=w),m[d])S=m[d][1],c+=m[d][0];else for(w=E<<c>>>32-v,d=w,32-c<v&&(w|=f[h+1]>>>64-c-v,d=w),M=l,L=0;L<v;L++)if(x=w>>>v-L-1&1,M=x?M.right:M.left,!(M.left||M.right)){S=M.val,c=c+L+1;break}c>=32&&(c-=32,h++,E=f[h]),I=S-U,O?(y>0&&k[p-1]?I+=B:T>0&&k[p-o]?I+=N[p-o]:I+=B,I&=255,N[p]=I,B=I):N[p]=I}e.ptr=e.ptr+(h+1)*4+(c>0?4:0)}e.pixels.resultPixels=F},decodeBits:function(n,e,r,a,t){{var i=e.headerInfo,o=i.fileVersion,s=0,u=new DataView(n,e.ptr,5),m=u.getUint8(0);s++;var l=m>>6,f=l===0?4:3-l,h=(m&32)>0,c=m&31,g=0;if(f===1)g=u.getUint8(s),s++;else if(f===2)g=u.getUint16(s,!0),s+=2;else if(f===4)g=u.getUint32(s,!0),s+=4;else throw"Invalid valid pixel count type";var v=2*i.maxZError,U,M,S,I,k,w,d,x,T,y,p=i.numDims>1?i.maxValues[t]:i.zMax;if(h){for(e.counter.lut++,x=u.getUint8(s),T=c,s++,I=Math.ceil((x-1)*c/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),e.ptr+=s,S.set(new Uint8Array(n,e.ptr,I)),d=new Uint32Array(M),e.ptr+=I,y=0;x-1>>>y;)y++;I=Math.ceil(g*y/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),S.set(new Uint8Array(n,e.ptr,I)),U=new Uint32Array(M),e.ptr+=I,o>=3?w=A.unstuffLUT2(d,c,x-1,a,v,p):w=A.unstuffLUT(d,c,x-1,a,v,p),o>=3?A.unstuff2(U,r,y,g,w):A.unstuff(U,r,y,g,w)}else e.counter.bitstuffer++,y=c,e.ptr+=s,y>0&&(I=Math.ceil(g*y/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),S.set(new Uint8Array(n,e.ptr,I)),U=new Uint32Array(M),e.ptr+=I,o>=3?a==null?A.originalUnstuff2(U,r,y,g):A.unstuff2(U,r,y,g,!1,a,v,p):a==null?A.originalUnstuff(U,r,y,g):A.unstuff(U,r,y,g,!1,a,v,p))}},readTiles:function(n,e,r){var a=e.headerInfo,t=a.width,i=a.height,o=a.microBlockSize,s=a.imageType,u=V.getDataTypeSize(s),m=Math.ceil(t/o),l=Math.ceil(i/o);e.pixels.numBlocksY=l,e.pixels.numBlocksX=m,e.pixels.ptr=0;var f=0,h=0,c=0,g=0,v=0,U=0,M=0,S=0,I=0,k=0,w=0,d=0,x=0,T=0,y=0,p=0,L,B,E,O,F,N,z=new r(o*o),ke=i%o||o,ye=t%o||o,J,Z,ue=a.numDims,te,j=e.pixels.resultMask,q=e.pixels.resultPixels;for(c=0;c<l;c++)for(v=c!==l-1?o:ke,g=0;g<m;g++)for(U=g!==m-1?o:ye,w=c*t*o+g*o,d=t-U,te=0;te<ue;te++){if(ue>1&&(q=new r(e.pixels.resultPixels.buffer,t*i*te*u,t*i)),M=n.byteLength-e.ptr,L=new DataView(n,e.ptr,Math.min(10,M)),B={},p=0,S=L.getUint8(0),p++,I=S>>6&255,k=S>>2&15,k!==(g*o>>3&15))throw"integrity issue";if(N=S&3,N>3)throw e.ptr+=p,"Invalid block encoding ("+N+")";if(N===2){e.counter.constant++,e.ptr+=p;continue}else if(N===0){if(e.counter.uncompressed++,e.ptr+=p,x=v*U*u,T=n.byteLength-e.ptr,x=x<T?x:T,E=new ArrayBuffer(x%u===0?x:x+u-x%u),O=new Uint8Array(E),O.set(new Uint8Array(n,e.ptr,x)),F=new r(E),y=0,j)for(f=0;f<v;f++){for(h=0;h<U;h++)j[w]&&(q[w]=F[y++]),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)q[w++]=F[y++];w+=d}e.ptr+=y*u}else if(J=V.getDataTypeUsed(s,I),Z=V.getOnePixel(B,p,J,L),p+=V.getDataTypeSize(J),N===3)if(e.ptr+=p,e.counter.constantoffset++,j)for(f=0;f<v;f++){for(h=0;h<U;h++)j[w]&&(q[w]=Z),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)q[w++]=Z;w+=d}else if(e.ptr+=p,V.decodeBits(n,e,z,Z,te),p=0,j)for(f=0;f<v;f++){for(h=0;h<U;h++)j[w]&&(q[w]=z[p++]),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)q[w++]=z[p++];w+=d}}},formatFileInfo:function(n){return{fileIdentifierString:n.headerInfo.fileIdentifierString,fileVersion:n.headerInfo.fileVersion,imageType:n.headerInfo.imageType,height:n.headerInfo.height,width:n.headerInfo.width,numValidPixel:n.headerInfo.numValidPixel,microBlockSize:n.headerInfo.microBlockSize,blobSize:n.headerInfo.blobSize,maxZError:n.headerInfo.maxZError,pixelType:V.getPixelType(n.headerInfo.imageType),eofOffset:n.eofOffset,mask:n.mask?{numBytes:n.mask.numBytes}:null,pixels:{numBlocksX:n.pixels.numBlocksX,numBlocksY:n.pixels.numBlocksY,maxValue:n.headerInfo.zMax,minValue:n.headerInfo.zMin,noDataValue:n.noDataValue}}},constructConstantSurface:function(n){var e=n.headerInfo.zMax,r=n.headerInfo.numDims,a=n.headerInfo.height*n.headerInfo.width,t=a*r,i=0,o=0,s=0,u=n.pixels.resultMask;if(u)if(r>1)for(i=0;i<r;i++)for(s=i*a,o=0;o<a;o++)u[o]&&(n.pixels.resultPixels[s+o]=e);else for(o=0;o<a;o++)u[o]&&(n.pixels.resultPixels[o]=e);else if(n.pixels.resultPixels.fill)n.pixels.resultPixels.fill(e);else for(o=0;o<t;o++)n.pixels.resultPixels[o]=e},getDataTypeArray:function(n){var e;switch(n){case 0:e=Int8Array;break;case 1:e=Uint8Array;break;case 2:e=Int16Array;break;case 3:e=Uint16Array;break;case 4:e=Int32Array;break;case 5:e=Uint32Array;break;case 6:e=Float32Array;break;case 7:e=Float64Array;break;default:e=Float32Array}return e},getPixelType:function(n){var e;switch(n){case 0:e="S8";break;case 1:e="U8";break;case 2:e="S16";break;case 3:e="U16";break;case 4:e="S32";break;case 5:e="U32";break;case 6:e="F32";break;case 7:e="F64";break;default:e="F32"}return e},isValidPixelValue:function(n,e){if(e==null)return!1;var r;switch(n){case 0:r=e>=-128&&e<=127;break;case 1:r=e>=0&&e<=255;break;case 2:r=e>=-32768&&e<=32767;break;case 3:r=e>=0&&e<=65536;break;case 4:r=e>=-2147483648&&e<=2147483647;break;case 5:r=e>=0&&e<=4294967296;break;case 6:r=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:r=e>=5e-324&&e<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(n){var e=0;switch(n){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=n}return e},getDataTypeUsed:function(n,e){var r=n;switch(n){case 2:case 4:r=n-e;break;case 3:case 5:r=n-2*e;break;case 6:e===0?r=n:e===1?r=2:r=1;break;case 7:e===0?r=n:r=n-2*e+1;break;default:r=n;break}return r},getOnePixel:function(n,e,r,a){var t=0;switch(r){case 0:t=a.getInt8(e);break;case 1:t=a.getUint8(e);break;case 2:t=a.getInt16(e,!0);break;case 3:t=a.getUint16(e,!0);break;case 4:t=a.getInt32(e,!0);break;case 5:t=a.getUInt32(e,!0);break;case 6:t=a.getFloat32(e,!0);break;case 7:t=a.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return t}},b=function(n,e,r){this.val=n,this.left=e,this.right=r},X={decode:function(n,e){e=e||{};var r=e.noDataValue,a=0,t={};if(t.ptr=e.inputOffset||0,t.pixels={},!!V.readHeaderInfo(n,t)){var i=t.headerInfo,o=i.fileVersion,s=V.getDataTypeArray(i.imageType);V.readMask(n,t),i.numValidPixel!==i.width*i.height&&!t.pixels.resultMask&&(t.pixels.resultMask=e.maskData);var u=i.width*i.height;if(t.pixels.resultPixels=new s(u*i.numDims),t.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},i.numValidPixel!==0)if(i.zMax===i.zMin)V.constructConstantSurface(t);else if(o>=4&&V.checkMinMaxRanges(n,t))V.constructConstantSurface(t);else{var m=new DataView(n,t.ptr,2),l=m.getUint8(0);if(t.ptr++,l)V.readDataOneSweep(n,t,s);else if(o>1&&i.imageType<=1&&Math.abs(i.maxZError-.5)<1e-5){var f=m.getUint8(1);if(t.ptr++,t.encodeMode=f,f>2||o<4&&f>1)throw"Invalid Huffman flag "+f;f?V.readHuffman(n,t,s):V.readTiles(n,t,s)}else V.readTiles(n,t,s)}t.eofOffset=t.ptr;var h;e.inputOffset?(h=t.headerInfo.blobSize+e.inputOffset-t.ptr,Math.abs(h)>=1&&(t.eofOffset=e.inputOffset+t.headerInfo.blobSize)):(h=t.headerInfo.blobSize-t.ptr,Math.abs(h)>=1&&(t.eofOffset=t.headerInfo.blobSize));var c={width:i.width,height:i.height,pixelData:t.pixels.resultPixels,minValue:i.zMin,maxValue:i.zMax,validPixelCount:i.numValidPixel,dimCount:i.numDims,dimStats:{minValues:i.minValues,maxValues:i.maxValues},maskData:t.pixels.resultMask};if(t.pixels.resultMask&&V.isValidPixelValue(i.imageType,r)){var g=t.pixels.resultMask;for(a=0;a<u;a++)g[a]||(c.pixelData[a]=r);c.noDataValue=r}return t.noDataValue=r,e.returnFileInfo&&(c.fileInfo=V.formatFileInfo(t)),c}},getBandCount:function(n){var e=0,r=0,a={};for(a.ptr=0,a.pixels={};r<n.byteLength-58;)V.readHeaderInfo(n,a),r+=a.headerInfo.blobSize,e++,a.ptr=r;return e}};return X}(),C=function(){var A=new ArrayBuffer(4),V=new Uint8Array(A),b=new Uint32Array(A);return b[0]=1,V[0]===1}(),re={decode:function(A,V){if(!C)throw"Big endian system is not supported.";V=V||{};var b=V.inputOffset||0,X=new Uint8Array(A,b,10),n=String.fromCharCode.apply(null,X),e,r;if(n.trim()==="CntZImage")e=D,r=1;else if(n.substring(0,5)==="Lerc2")e=se,r=2;else throw"Unexpected file identifier string: "+n;for(var a=0,t=A.byteLength-10,i,o=[],s,u,m={width:0,height:0,pixels:[],pixelType:V.pixelType,mask:null,statistics:[]};b<t;){var l=e.decode(A,{inputOffset:b,encodedMaskData:i,maskData:u,returnMask:a===0,returnEncodedMask:a===0,returnFileInfo:!0,pixelType:V.pixelType||null,noDataValue:V.noDataValue||null});b=l.fileInfo.eofOffset,a===0&&(i=l.encodedMaskData,u=l.maskData,m.width=l.width,m.height=l.height,m.dimCount=l.dimCount||1,m.pixelType=l.pixelType||l.fileInfo.pixelType,m.mask=l.maskData),r>1&&l.fileInfo.mask&&l.fileInfo.mask.numBytes>0&&o.push(l.maskData),a++,m.pixels.push(l.pixelData),m.statistics.push({minValue:l.minValue,maxValue:l.maxValue,noDataValue:l.noDataValue,dimStats:l.dimStats})}var f,h,c;if(r>1&&o.length>1){for(c=m.width*m.height,m.bandMasks=o,u=new Uint8Array(c),u.set(o[0]),f=1;f<o.length;f++)for(s=o[f],h=0;h<c;h++)u[h]=u[h]&s[h];m.maskData=u}return m}};typeof define=="function"&&define.amd?define([],function(){return re}):typeof Te<"u"&&Te.exports?Te.exports=re:this.Lerc=re})()});var Ur={NONE:0,LERC:1},or=Object.freeze(Ur);var Q={};Q.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Ye=new ie,Tr=new xe,kr=new ie,yr=new ie;Q.computeVertices=function(D){if(!G(D)||!G(D.heightmap))throw new he("options.heightmap is required.");if(!G(D.width)||!G(D.height))throw new he("options.width and options.height are required.");if(!G(D.nativeRectangle))throw new he("options.nativeRectangle is required.");if(!G(D.skirtHeight))throw new he("options.skirtHeight is required.");let se=Math.cos,C=Math.sin,re=Math.sqrt,A=Math.atan,V=Math.exp,b=ge.PI_OVER_TWO,X=ge.toRadians,n=D.heightmap,e=D.width,r=D.height,a=D.skirtHeight,t=a>0,i=Y(D.isGeographic,!0),o=Y(D.ellipsoid,Ie.default),s=1/o.maximumRadius,u=ae.clone(D.nativeRectangle),m=ae.clone(D.rectangle),l,f,h,c;G(m)?(l=m.west,f=m.south,h=m.east,c=m.north):i?(l=X(u.west),f=X(u.south),h=X(u.east),c=X(u.north)):(l=u.west*s,f=b-2*A(V(-u.south*s)),h=u.east*s,c=b-2*A(V(-u.north*s)));let g=D.relativeToCenter,v=G(g);g=v?g:ie.ZERO;let U=Y(D.includeWebMercatorT,!1),M=Y(D.exaggeration,1),S=Y(D.exaggerationRelativeHeight,0),k=M!==1,w=Y(D.structure,Q.DEFAULT_STRUCTURE),d=Y(w.heightScale,Q.DEFAULT_STRUCTURE.heightScale),x=Y(w.heightOffset,Q.DEFAULT_STRUCTURE.heightOffset),T=Y(w.elementsPerHeight,Q.DEFAULT_STRUCTURE.elementsPerHeight),y=Y(w.stride,Q.DEFAULT_STRUCTURE.stride),p=Y(w.elementMultiplier,Q.DEFAULT_STRUCTURE.elementMultiplier),L=Y(w.isBigEndian,Q.DEFAULT_STRUCTURE.isBigEndian),B=ae.computeWidth(u),E=ae.computeHeight(u),O=B/(e-1),F=E/(r-1);i||(B*=s,E*=s);let N=o.radiiSquared,z=N.x,ke=N.y,ye=N.z,J=65536,Z=-65536,ue=rr.eastNorthUpToFixedFrame(g,o),te=xe.inverseTransformation(ue,Tr),j,q;U&&(j=Ue.geodeticLatitudeToMercatorAngle(f),q=1/(Ue.geodeticLatitudeToMercatorAngle(c)-j));let fe=kr;fe.x=Number.POSITIVE_INFINITY,fe.y=Number.POSITIVE_INFINITY,fe.z=Number.POSITIVE_INFINITY;let oe=yr;oe.x=Number.NEGATIVE_INFINITY,oe.y=Number.NEGATIVE_INFINITY,oe.z=Number.NEGATIVE_INFINITY;let Me=Number.POSITIVE_INFINITY,ce=e*r,mr=a>0?e*2+r*2:0,ne=ce+mr,ve=new Array(ne),Xe=new Array(ne),_e=new Array(ne),ze=U?new Array(ne):[],Ze=k?new Array(ne):[],Se=0,Ve=r,De=0,Ae=e;t&&(--Se,++Ve,--De,++Ae);let de=1e-5;for(let H=Se;H<Ve;++H){let K=H;K<0&&(K=0),K>=r&&(K=r-1);let W=u.north-F*K;i?W=X(W):W=b-2*A(V(-W*s));let Le=(W-f)/(c-f);Le=ge.clamp(Le,0,1);let we=H===Se,pe=H===Ve-1;a>0&&(we?W+=de*E:pe&&(W-=de*E));let Qe=se(W),Be=C(W),Je=ye*Be,Ke;U&&(Ke=(Ue.geodeticLatitudeToMercatorAngle(W)-j)*q);for(let me=De;me<Ae;++me){let $=me;$<0&&($=0),$>=e&&($=e-1);let Fe=K*(e*y)+$*y,R;if(T===1)R=n[Fe];else{R=0;let _;if(L)for(_=0;_<T;++_)R=R*p+n[Fe+_];else for(_=T-1;_>=0;--_)R=R*p+n[Fe+_]}R=R*d+x,Z=Math.max(Z,R),J=Math.min(J,R);let P=u.west+O*$;i?P=X(P):P=P*s;let be=(P-l)/(h-l);be=ge.clamp(be,0,1);let ee=K*e+$;if(a>0){let _=me===De,Re=me===Ae-1,pr=we||pe||_||Re;if((we||pe)&&(_||Re))continue;pr&&(R-=a,_?(ee=ce+(r-K-1),P-=de*B):pe?ee=ce+r+(e-$-1):Re?(ee=ce+r+e+K,P+=de*B):we&&(ee=ce+r+e+r+$))}let Ne=Qe*se(P),Ce=Qe*C(P),$e=z*Ne,Pe=ke*Ce,Oe=1/re($e*Ne+Pe*Ce+Je*Be),vr=$e*Oe,dr=Pe*Oe,wr=Je*Oe,le=new ie;le.x=vr+Ne*R,le.y=dr+Ce*R,le.z=wr+Be*R,xe.multiplyByPoint(te,le,Ye),ie.minimumByComponent(Ye,fe,fe),ie.maximumByComponent(Ye,oe,oe),Me=Math.min(Me,R),ve[ee]=le,_e[ee]=new er(be,Le),Xe[ee]=R,U&&(ze[ee]=Ke),k&&(Ze[ee]=o.geodeticSurfaceNormal(le))}}let hr=ir.fromPoints(ve),je;G(m)&&(je=ar.fromRectangle(m,J,Z,o));let qe;v&&(qe=new sr(o).computeHorizonCullingPointPossiblyUnderEllipsoid(g,ve,J));let gr=new nr(fe,oe,g),Ee=new fr(g,gr,Me,Z,ue,!1,U,k,M,S),We=new Float32Array(ne*Ee.stride),Ge=0;for(let H=0;H<ne;++H)Ge=Ee.encode(We,Ge,ve[H],_e[H],Xe[H],void 0,ze[H],Ze[H]);return{vertices:We,maximumHeight:Z,minimumHeight:J,encoding:Ee,boundingSphere3D:hr,orientedBoundingBox:je,occludeePointInScaledSpace:qe}};var lr=Q;var cr=xr(ur(),1);function Mr(D,se){if(D.encoding===or.LERC){let A;try{A=cr.default.decode(D.heightmap)}catch(b){throw new He(b)}if(A.statistics[0].minValue===Number.MAX_VALUE)throw new He("Invalid tile data");D.heightmap=A.pixels[0],D.width=A.width,D.height=A.height}D.ellipsoid=Ie.clone(D.ellipsoid),D.rectangle=ae.clone(D.rectangle);let C=lr.computeVertices(D),re=C.vertices;return se.push(re.buffer),{vertices:re.buffer,numberOfAttributes:C.encoding.stride,minimumHeight:C.minimumHeight,maximumHeight:C.maximumHeight,gridWidth:D.width,gridHeight:D.height,boundingSphere3D:C.boundingSphere3D,orientedBoundingBox:C.orientedBoundingBox,occludeePointInScaledSpace:C.occludeePointInScaledSpace,encoding:C.encoding,westIndicesSouthToNorth:C.westIndicesSouthToNorth,southIndicesEastToWest:C.southIndicesEastToWest,eastIndicesNorthToSouth:C.eastIndicesNorthToSouth,northIndicesWestToEast:C.northIndicesWestToEast}}var Pr=tr(Mr);export{Pr as default}; diff --git a/public/js/Cesium2/Workers/createVerticesFromQuantizedTerrainMesh.js b/public/js/Cesium2/Workers/createVerticesFromQuantizedTerrainMesh.js index 6a5984121..556ae291d 100644 --- a/public/js/Cesium2/Workers/createVerticesFromQuantizedTerrainMesh.js +++ b/public/js/Cesium2/Workers/createVerticesFromQuantizedTerrainMesh.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as Ct,b as vt}from"./chunk-PJQ53UQY.js";import{a as Mt}from"./chunk-4BYMTYMT.js";import{a as z}from"./chunk-UJMUN4NO.js";import"./chunk-Q5MYX5A2.js";import{a as Wt}from"./chunk-Z7BLUZ7R.js";import{a as X}from"./chunk-34ULWVZF.js";import"./chunk-K2M3OJ7Z.js";import{b as U,g as bt,h as At}from"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as P,b as wt,c as lt,d as pt}from"./chunk-S4VBGY2U.js";import{a as f}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import{a as m}from"./chunk-G75U3WZT.js";import{e as w}from"./chunk-3THTQ4QB.js";function T(){m.throwInstantiationError()}Object.defineProperties(T.prototype,{errorEvent:{get:m.throwInstantiationError},credit:{get:m.throwInstantiationError},tilingScheme:{get:m.throwInstantiationError},hasWaterMask:{get:m.throwInstantiationError},hasVertexNormals:{get:m.throwInstantiationError},availability:{get:m.throwInstantiationError}});var Ot=[];T.getRegularGridIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)throw new m("The total number of vertices (width * height) must be less than 4,294,967,296.");let o=Ot[t];w(o)||(Ot[t]=o=[]);let e=o[n];return w(e)||(t*n<f.SIXTY_FOUR_KILOBYTES?e=o[n]=new Uint16Array((t-1)*(n-1)*6):e=o[n]=new Uint32Array((t-1)*(n-1)*6),Pt(t,n,e,0)),e};var Gt=[];T.getRegularGridIndicesAndEdgeIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)throw new m("The total number of vertices (width * height) must be less than 4,294,967,296.");let o=Gt[t];w(o)||(Gt[t]=o=[]);let e=o[n];if(!w(e)){let r=T.getRegularGridIndices(t,n),s=Lt(t,n),i=s.westIndicesSouthToNorth,c=s.southIndicesEastToWest,h=s.eastIndicesNorthToSouth,E=s.northIndicesWestToEast;e=o[n]={indices:r,westIndicesSouthToNorth:i,southIndicesEastToWest:c,eastIndicesNorthToSouth:h,northIndicesWestToEast:E}}return e};var kt=[];T.getRegularGridAndSkirtIndicesAndEdgeIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)throw new m("The total number of vertices (width * height) must be less than 4,294,967,296.");let o=kt[t];w(o)||(kt[t]=o=[]);let e=o[n];if(!w(e)){let r=t*n,s=(t-1)*(n-1)*6,i=t*2+n*2,c=Math.max(0,i-4)*6,h=r+i,E=s+c,g=Lt(t,n),d=g.westIndicesSouthToNorth,p=g.southIndicesEastToWest,b=g.eastIndicesNorthToSouth,L=g.northIndicesWestToEast,N=X.createTypedArray(h,E);Pt(t,n,N,0),T.addSkirtIndices(d,p,b,L,r,N,s),e=o[n]={indices:N,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:b,northIndicesWestToEast:L,indexCountWithoutSkirts:s}}return e};T.addSkirtIndices=function(t,n,o,e,r,s,i){let c=r;i=Z(t,c,s,i),c+=t.length,i=Z(n,c,s,i),c+=n.length,i=Z(o,c,s,i),c+=o.length,Z(e,c,s,i)};function Lt(t,n){let o=new Array(n),e=new Array(t),r=new Array(n),s=new Array(t),i;for(i=0;i<t;++i)s[i]=i,e[i]=t*n-1-i;for(i=0;i<n;++i)r[i]=(i+1)*t-1,o[i]=(n-i-1)*t;return{westIndicesSouthToNorth:o,southIndicesEastToWest:e,eastIndicesNorthToSouth:r,northIndicesWestToEast:s}}function Pt(t,n,o,e){let r=0;for(let s=0;s<n-1;++s){for(let i=0;i<t-1;++i){let c=r,h=c+t,E=h+1,g=c+1;o[e++]=c,o[e++]=h,o[e++]=g,o[e++]=g,o[e++]=h,o[e++]=E,++r}++r}}function Z(t,n,o,e){let r=t[0],s=t.length;for(let i=1;i<s;++i){let c=t[i];o[e++]=r,o[e++]=c,o[e++]=n,o[e++]=n,o[e++]=c,o[e++]=n+1,r=c,++n}return e}T.heightmapTerrainQuality=.25;T.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(t,n,o){return t.maximumRadius*2*Math.PI*T.heightmapTerrainQuality/(n*o)};T.prototype.requestTileGeometry=m.throwInstantiationError;T.prototype.getLevelMaximumGeometricError=m.throwInstantiationError;T.prototype.getTileDataAvailable=m.throwInstantiationError;T.prototype.loadTileDataAvailability=m.throwInstantiationError;var Vt=T;var ht=32767,D=new P,Xt=new P,Zt=new P,u=new wt,Y=new lt;function Jt(t,n){let o=t.quantizedVertices,e=o.length/3,r=t.octEncodedNormals,s=t.westIndices.length+t.eastIndices.length+t.southIndices.length+t.northIndices.length,i=t.includeWebMercatorT,c=t.exaggeration,h=t.exaggerationRelativeHeight,g=c!==1,d=At.clone(t.rectangle),p=d.west,b=d.south,L=d.east,N=d.north,I=pt.clone(t.ellipsoid),y=t.minimumHeight,v=t.maximumHeight,S=t.relativeToCenter,_=bt.eastNorthUpToFixedFrame(S,I),O=U.inverseTransformation(_,new U),G,A;i&&(G=z.geodeticLatitudeToMercatorAngle(b),A=1/(z.geodeticLatitudeToMercatorAngle(N)-G));let j=o.subarray(0,e),q=o.subarray(e,2*e),Q=o.subarray(e*2,3*e),R=w(r),l=new Array(e),M=new Array(e),et=new Array(e),It=i?new Array(e):[],gt=g?new Array(e):[],W=Xt;W.x=Number.POSITIVE_INFINITY,W.y=Number.POSITIVE_INFINITY,W.z=Number.POSITIVE_INFINITY;let C=Zt;C.x=Number.NEGATIVE_INFINITY,C.y=Number.NEGATIVE_INFINITY,C.z=Number.NEGATIVE_INFINITY;let ot=Number.POSITIVE_INFINITY,nt=Number.NEGATIVE_INFINITY,it=Number.POSITIVE_INFINITY,rt=Number.NEGATIVE_INFINITY;for(let a=0;a<e;++a){let x=j[a],Kt=q[a],St=x/ht,xt=Kt/ht,yt=f.lerp(y,v,Q[a]/ht);u.longitude=f.lerp(p,L,St),u.latitude=f.lerp(b,N,xt),u.height=yt,ot=Math.min(u.longitude,ot),nt=Math.max(u.longitude,nt),it=Math.min(u.latitude,it),rt=Math.max(u.latitude,rt);let dt=I.cartographicToCartesian(u);l[a]=new lt(St,xt),M[a]=yt,et[a]=dt,i&&(It[a]=(z.geodeticLatitudeToMercatorAngle(u.latitude)-G)*A),g&&(gt[a]=I.geodeticSurfaceNormal(dt)),U.multiplyByPoint(O,dt,D),P.minimumByComponent(D,W,W),P.maximumByComponent(D,C,C)}let st=tt(t.westIndices,function(a,x){return l[a].y-l[x].y}),ct=tt(t.eastIndices,function(a,x){return l[x].y-l[a].y}),at=tt(t.southIndices,function(a,x){return l[x].x-l[a].x}),ut=tt(t.northIndices,function(a,x){return l[a].x-l[x].x}),mt;y<0&&(mt=new Ct(I).computeHorizonCullingPointPossiblyUnderEllipsoid(S,et,y));let k=y;k=Math.min(k,J(t.westIndices,t.westSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.southIndices,t.southSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.eastIndices,t.eastSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.northIndices,t.northSkirtHeight,M,l,d,I,O,W,C));let Ft=new Wt(W,C,S),V=new vt(S,Ft,k,v,_,R,i,g,c,h),F=V.stride,Bt=e*F+s*F,B=new Float32Array(Bt),ft=0;for(let a=0;a<e;++a){if(R){let x=a*2;Y.x=r[x],Y.y=r[x+1]}ft=V.encode(B,ft,et[a],l[a],M[a],Y,It[a],gt[a])}let Ht=Math.max(0,(s-4)*2),_t=t.indices.length+Ht*3,K=X.createTypedArray(e+s,_t);K.set(t.indices,0);let Tt=1e-4,Et=(nt-ot)*Tt,Nt=(rt-it)*Tt,Yt=-Et,Rt=0,Ut=Et,zt=0,Dt=0,jt=Nt,qt=0,Qt=-Nt,H=e*F;return $(B,H,st,V,M,l,r,I,d,t.westSkirtHeight,G,A,Yt,Rt),H+=t.westIndices.length*F,$(B,H,at,V,M,l,r,I,d,t.southSkirtHeight,G,A,qt,Qt),H+=t.southIndices.length*F,$(B,H,ct,V,M,l,r,I,d,t.eastSkirtHeight,G,A,Ut,zt),H+=t.eastIndices.length*F,$(B,H,ut,V,M,l,r,I,d,t.northSkirtHeight,G,A,Dt,jt),Vt.addSkirtIndices(st,at,ct,ut,e,K,t.indices.length),n.push(B.buffer,K.buffer),{vertices:B.buffer,indices:K.buffer,westIndicesSouthToNorth:st,southIndicesEastToWest:at,eastIndicesNorthToSouth:ct,northIndicesWestToEast:ut,vertexStride:F,center:S,minimumHeight:y,maximumHeight:v,occludeePointInScaledSpace:mt,encoding:V,indexCountWithoutSkirts:t.indices.length}}function J(t,n,o,e,r,s,i,c,h){let E=Number.POSITIVE_INFINITY,g=r.north,d=r.south,p=r.east,b=r.west;p<b&&(p+=f.TWO_PI);let L=t.length;for(let N=0;N<L;++N){let I=t[N],y=o[I],v=e[I];u.longitude=f.lerp(b,p,v.x),u.latitude=f.lerp(d,g,v.y),u.height=y-n;let S=s.cartographicToCartesian(u,D);U.multiplyByPoint(i,S,S),P.minimumByComponent(S,c,c),P.maximumByComponent(S,h,h),E=Math.min(E,u.height)}return E}function $(t,n,o,e,r,s,i,c,h,E,g,d,p,b){let L=w(i),N=h.north,I=h.south,y=h.east,v=h.west;y<v&&(y+=f.TWO_PI);let S=o.length;for(let _=0;_<S;++_){let O=o[_],G=r[O],A=s[O];u.longitude=f.lerp(v,y,A.x)+p,u.latitude=f.lerp(I,N,A.y)+b,u.height=G-E;let j=c.cartographicToCartesian(u,D);if(L){let R=O*2;Y.x=i[R],Y.y=i[R+1]}let q;e.hasWebMercatorT&&(q=(z.geodeticLatitudeToMercatorAngle(u.latitude)-g)*d);let Q;e.hasGeodeticSurfaceNormals&&(Q=c.geodeticSurfaceNormal(j)),n=e.encode(t,n,j,A,u.height,Y,q,Q)}}function tt(t,n){let o;return typeof t.slice=="function"&&(o=t.slice(),typeof o.sort!="function"&&(o=void 0)),w(o)||(o=Array.prototype.slice.call(t)),o.sort(n),o}var Se=Mt(Jt);export{Se as default}; +import{a as Ct,b as vt}from"./chunk-VQ4ICMD3.js";import{a as Mt}from"./chunk-4E3APMCC.js";import{a as z}from"./chunk-HMHR6SIB.js";import"./chunk-VMXXQ6B4.js";import{a as Wt}from"./chunk-VYMAIP2A.js";import{a as X}from"./chunk-YFQNY2YN.js";import"./chunk-2NIQ5ECB.js";import{b as U,g as bt,h as At}from"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as P,b as wt,c as lt,d as pt}from"./chunk-RH3GFHG2.js";import{a as f}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import{a as m}from"./chunk-RTY3VPG6.js";import{e as w}from"./chunk-LRNH5AEO.js";function T(){m.throwInstantiationError()}Object.defineProperties(T.prototype,{errorEvent:{get:m.throwInstantiationError},credit:{get:m.throwInstantiationError},tilingScheme:{get:m.throwInstantiationError},hasWaterMask:{get:m.throwInstantiationError},hasVertexNormals:{get:m.throwInstantiationError},availability:{get:m.throwInstantiationError}});var Ot=[];T.getRegularGridIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)throw new m("The total number of vertices (width * height) must be less than 4,294,967,296.");let o=Ot[t];w(o)||(Ot[t]=o=[]);let e=o[n];return w(e)||(t*n<f.SIXTY_FOUR_KILOBYTES?e=o[n]=new Uint16Array((t-1)*(n-1)*6):e=o[n]=new Uint32Array((t-1)*(n-1)*6),Pt(t,n,e,0)),e};var Gt=[];T.getRegularGridIndicesAndEdgeIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)throw new m("The total number of vertices (width * height) must be less than 4,294,967,296.");let o=Gt[t];w(o)||(Gt[t]=o=[]);let e=o[n];if(!w(e)){let r=T.getRegularGridIndices(t,n),s=Lt(t,n),i=s.westIndicesSouthToNorth,c=s.southIndicesEastToWest,h=s.eastIndicesNorthToSouth,E=s.northIndicesWestToEast;e=o[n]={indices:r,westIndicesSouthToNorth:i,southIndicesEastToWest:c,eastIndicesNorthToSouth:h,northIndicesWestToEast:E}}return e};var kt=[];T.getRegularGridAndSkirtIndicesAndEdgeIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)throw new m("The total number of vertices (width * height) must be less than 4,294,967,296.");let o=kt[t];w(o)||(kt[t]=o=[]);let e=o[n];if(!w(e)){let r=t*n,s=(t-1)*(n-1)*6,i=t*2+n*2,c=Math.max(0,i-4)*6,h=r+i,E=s+c,g=Lt(t,n),d=g.westIndicesSouthToNorth,p=g.southIndicesEastToWest,b=g.eastIndicesNorthToSouth,L=g.northIndicesWestToEast,N=X.createTypedArray(h,E);Pt(t,n,N,0),T.addSkirtIndices(d,p,b,L,r,N,s),e=o[n]={indices:N,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:b,northIndicesWestToEast:L,indexCountWithoutSkirts:s}}return e};T.addSkirtIndices=function(t,n,o,e,r,s,i){let c=r;i=Z(t,c,s,i),c+=t.length,i=Z(n,c,s,i),c+=n.length,i=Z(o,c,s,i),c+=o.length,Z(e,c,s,i)};function Lt(t,n){let o=new Array(n),e=new Array(t),r=new Array(n),s=new Array(t),i;for(i=0;i<t;++i)s[i]=i,e[i]=t*n-1-i;for(i=0;i<n;++i)r[i]=(i+1)*t-1,o[i]=(n-i-1)*t;return{westIndicesSouthToNorth:o,southIndicesEastToWest:e,eastIndicesNorthToSouth:r,northIndicesWestToEast:s}}function Pt(t,n,o,e){let r=0;for(let s=0;s<n-1;++s){for(let i=0;i<t-1;++i){let c=r,h=c+t,E=h+1,g=c+1;o[e++]=c,o[e++]=h,o[e++]=g,o[e++]=g,o[e++]=h,o[e++]=E,++r}++r}}function Z(t,n,o,e){let r=t[0],s=t.length;for(let i=1;i<s;++i){let c=t[i];o[e++]=r,o[e++]=c,o[e++]=n,o[e++]=n,o[e++]=c,o[e++]=n+1,r=c,++n}return e}T.heightmapTerrainQuality=.25;T.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(t,n,o){return t.maximumRadius*2*Math.PI*T.heightmapTerrainQuality/(n*o)};T.prototype.requestTileGeometry=m.throwInstantiationError;T.prototype.getLevelMaximumGeometricError=m.throwInstantiationError;T.prototype.getTileDataAvailable=m.throwInstantiationError;T.prototype.loadTileDataAvailability=m.throwInstantiationError;var Vt=T;var ht=32767,D=new P,Xt=new P,Zt=new P,u=new wt,Y=new lt;function Jt(t,n){let o=t.quantizedVertices,e=o.length/3,r=t.octEncodedNormals,s=t.westIndices.length+t.eastIndices.length+t.southIndices.length+t.northIndices.length,i=t.includeWebMercatorT,c=t.exaggeration,h=t.exaggerationRelativeHeight,g=c!==1,d=At.clone(t.rectangle),p=d.west,b=d.south,L=d.east,N=d.north,I=pt.clone(t.ellipsoid),y=t.minimumHeight,v=t.maximumHeight,S=t.relativeToCenter,_=bt.eastNorthUpToFixedFrame(S,I),O=U.inverseTransformation(_,new U),G,A;i&&(G=z.geodeticLatitudeToMercatorAngle(b),A=1/(z.geodeticLatitudeToMercatorAngle(N)-G));let j=o.subarray(0,e),q=o.subarray(e,2*e),Q=o.subarray(e*2,3*e),R=w(r),l=new Array(e),M=new Array(e),et=new Array(e),It=i?new Array(e):[],gt=g?new Array(e):[],W=Xt;W.x=Number.POSITIVE_INFINITY,W.y=Number.POSITIVE_INFINITY,W.z=Number.POSITIVE_INFINITY;let C=Zt;C.x=Number.NEGATIVE_INFINITY,C.y=Number.NEGATIVE_INFINITY,C.z=Number.NEGATIVE_INFINITY;let ot=Number.POSITIVE_INFINITY,nt=Number.NEGATIVE_INFINITY,it=Number.POSITIVE_INFINITY,rt=Number.NEGATIVE_INFINITY;for(let a=0;a<e;++a){let x=j[a],Kt=q[a],St=x/ht,xt=Kt/ht,yt=f.lerp(y,v,Q[a]/ht);u.longitude=f.lerp(p,L,St),u.latitude=f.lerp(b,N,xt),u.height=yt,ot=Math.min(u.longitude,ot),nt=Math.max(u.longitude,nt),it=Math.min(u.latitude,it),rt=Math.max(u.latitude,rt);let dt=I.cartographicToCartesian(u);l[a]=new lt(St,xt),M[a]=yt,et[a]=dt,i&&(It[a]=(z.geodeticLatitudeToMercatorAngle(u.latitude)-G)*A),g&&(gt[a]=I.geodeticSurfaceNormal(dt)),U.multiplyByPoint(O,dt,D),P.minimumByComponent(D,W,W),P.maximumByComponent(D,C,C)}let st=tt(t.westIndices,function(a,x){return l[a].y-l[x].y}),ct=tt(t.eastIndices,function(a,x){return l[x].y-l[a].y}),at=tt(t.southIndices,function(a,x){return l[x].x-l[a].x}),ut=tt(t.northIndices,function(a,x){return l[a].x-l[x].x}),mt;y<0&&(mt=new Ct(I).computeHorizonCullingPointPossiblyUnderEllipsoid(S,et,y));let k=y;k=Math.min(k,J(t.westIndices,t.westSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.southIndices,t.southSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.eastIndices,t.eastSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.northIndices,t.northSkirtHeight,M,l,d,I,O,W,C));let Ft=new Wt(W,C,S),V=new vt(S,Ft,k,v,_,R,i,g,c,h),F=V.stride,Bt=e*F+s*F,B=new Float32Array(Bt),ft=0;for(let a=0;a<e;++a){if(R){let x=a*2;Y.x=r[x],Y.y=r[x+1]}ft=V.encode(B,ft,et[a],l[a],M[a],Y,It[a],gt[a])}let Ht=Math.max(0,(s-4)*2),_t=t.indices.length+Ht*3,K=X.createTypedArray(e+s,_t);K.set(t.indices,0);let Tt=1e-4,Et=(nt-ot)*Tt,Nt=(rt-it)*Tt,Yt=-Et,Rt=0,Ut=Et,zt=0,Dt=0,jt=Nt,qt=0,Qt=-Nt,H=e*F;return $(B,H,st,V,M,l,r,I,d,t.westSkirtHeight,G,A,Yt,Rt),H+=t.westIndices.length*F,$(B,H,at,V,M,l,r,I,d,t.southSkirtHeight,G,A,qt,Qt),H+=t.southIndices.length*F,$(B,H,ct,V,M,l,r,I,d,t.eastSkirtHeight,G,A,Ut,zt),H+=t.eastIndices.length*F,$(B,H,ut,V,M,l,r,I,d,t.northSkirtHeight,G,A,Dt,jt),Vt.addSkirtIndices(st,at,ct,ut,e,K,t.indices.length),n.push(B.buffer,K.buffer),{vertices:B.buffer,indices:K.buffer,westIndicesSouthToNorth:st,southIndicesEastToWest:at,eastIndicesNorthToSouth:ct,northIndicesWestToEast:ut,vertexStride:F,center:S,minimumHeight:y,maximumHeight:v,occludeePointInScaledSpace:mt,encoding:V,indexCountWithoutSkirts:t.indices.length}}function J(t,n,o,e,r,s,i,c,h){let E=Number.POSITIVE_INFINITY,g=r.north,d=r.south,p=r.east,b=r.west;p<b&&(p+=f.TWO_PI);let L=t.length;for(let N=0;N<L;++N){let I=t[N],y=o[I],v=e[I];u.longitude=f.lerp(b,p,v.x),u.latitude=f.lerp(d,g,v.y),u.height=y-n;let S=s.cartographicToCartesian(u,D);U.multiplyByPoint(i,S,S),P.minimumByComponent(S,c,c),P.maximumByComponent(S,h,h),E=Math.min(E,u.height)}return E}function $(t,n,o,e,r,s,i,c,h,E,g,d,p,b){let L=w(i),N=h.north,I=h.south,y=h.east,v=h.west;y<v&&(y+=f.TWO_PI);let S=o.length;for(let _=0;_<S;++_){let O=o[_],G=r[O],A=s[O];u.longitude=f.lerp(v,y,A.x)+p,u.latitude=f.lerp(I,N,A.y)+b,u.height=G-E;let j=c.cartographicToCartesian(u,D);if(L){let R=O*2;Y.x=i[R],Y.y=i[R+1]}let q;e.hasWebMercatorT&&(q=(z.geodeticLatitudeToMercatorAngle(u.latitude)-g)*d);let Q;e.hasGeodeticSurfaceNormals&&(Q=c.geodeticSurfaceNormal(j)),n=e.encode(t,n,j,A,u.height,Y,q,Q)}}function tt(t,n){let o;return typeof t.slice=="function"&&(o=t.slice(),typeof o.sort!="function"&&(o=void 0)),w(o)||(o=Array.prototype.slice.call(t)),o.sort(n),o}var Se=Mt(Jt);export{Se as default}; diff --git a/public/js/Cesium2/Workers/createWallGeometry.js b/public/js/Cesium2/Workers/createWallGeometry.js index 31eaca5eb..f96f4a2bf 100644 --- a/public/js/Cesium2/Workers/createWallGeometry.js +++ b/public/js/Cesium2/Workers/createWallGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as nt}from"./chunk-42FICTTZ.js";import"./chunk-RNF7TLFF.js";import"./chunk-E7HC3VTG.js";import{a as _}from"./chunk-6HIVPZ7K.js";import"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as ot}from"./chunk-34ULWVZF.js";import{a as it}from"./chunk-24JYWT5N.js";import{b as tt,c as et,d as S}from"./chunk-LH3SUUXG.js";import{d as I}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as R}from"./chunk-D5HNP2LB.js";import{a as s,d as l}from"./chunk-S4VBGY2U.js";import{a as J}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as w}from"./chunk-N3A5CZ2S.js";import{a as P}from"./chunk-G75U3WZT.js";import{e as r}from"./chunk-3THTQ4QB.js";var Q=new s,Y=new s,lt=new s,st=new s,pt=new s,ut=new s,ft=new s;function k(t){t=w(t,w.EMPTY_OBJECT);let e=t.positions,o=t.maximumHeights,n=t.minimumHeights;if(!r(e))throw new P("options.positions is required.");if(r(o)&&o.length!==e.length)throw new P("options.positions and options.maximumHeights must have the same length.");if(r(n)&&n.length!==e.length)throw new P("options.positions and options.minimumHeights must have the same length.");let i=w(t.vertexFormat,_.DEFAULT),c=w(t.granularity,J.RADIANS_PER_DEGREE),a=w(t.ellipsoid,l.default);this._positions=e,this._minimumHeights=n,this._maximumHeights=o,this._vertexFormat=_.clone(i),this._granularity=c,this._ellipsoid=l.clone(a),this._workerName="createWallGeometry";let m=1+e.length*s.packedLength+2;r(n)&&(m+=n.length),r(o)&&(m+=o.length),this.packedLength=m+l.packedLength+_.packedLength+1}k.pack=function(t,e,o){if(!r(t))throw new P("value is required");if(!r(e))throw new P("array is required");o=w(o,0);let n,i=t._positions,c=i.length;for(e[o++]=c,n=0;n<c;++n,o+=s.packedLength)s.pack(i[n],e,o);let a=t._minimumHeights;if(c=r(a)?a.length:0,e[o++]=c,r(a))for(n=0;n<c;++n)e[o++]=a[n];let m=t._maximumHeights;if(c=r(m)?m.length:0,e[o++]=c,r(m))for(n=0;n<c;++n)e[o++]=m[n];return l.pack(t._ellipsoid,e,o),o+=l.packedLength,_.pack(t._vertexFormat,e,o),o+=_.packedLength,e[o]=t._granularity,e};var mt=l.clone(l.UNIT_SPHERE),rt=new _,V={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:mt,vertexFormat:rt,granularity:void 0};k.unpack=function(t,e,o){if(!r(t))throw new P("array is required");e=w(e,0);let n,i=t[e++],c=new Array(i);for(n=0;n<i;++n,e+=s.packedLength)c[n]=s.unpack(t,e);i=t[e++];let a;if(i>0)for(a=new Array(i),n=0;n<i;++n)a[n]=t[e++];i=t[e++];let m;if(i>0)for(m=new Array(i),n=0;n<i;++n)m[n]=t[e++];let q=l.unpack(t,e,mt);e+=l.packedLength;let H=_.unpack(t,e,rt);e+=_.packedLength;let f=t[e];return r(o)?(o._positions=c,o._minimumHeights=a,o._maximumHeights=m,o._ellipsoid=l.clone(q,o._ellipsoid),o._vertexFormat=_.clone(H,o._vertexFormat),o._granularity=f,o):(V.positions=c,V.minimumHeights=a,V.maximumHeights=m,V.granularity=f,new k(V))};k.fromConstantHeights=function(t){t=w(t,w.EMPTY_OBJECT);let e=t.positions;if(!r(e))throw new P("options.positions is required.");let o,n,i=t.minimumHeight,c=t.maximumHeight,a=r(i),m=r(c);if(a||m){let H=e.length;o=a?new Array(H):void 0,n=m?new Array(H):void 0;for(let f=0;f<H;++f)a&&(o[f]=i),m&&(n[f]=c)}let q={positions:e,maximumHeights:n,minimumHeights:o,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat};return new k(q)};k.createGeometry=function(t){let e=t._positions,o=t._minimumHeights,n=t._maximumHeights,i=t._vertexFormat,c=t._granularity,a=t._ellipsoid,m=nt.computePositions(a,e,n,o,c,!0);if(!r(m))return;let q=m.bottomPositions,H=m.topPositions,f=m.numCorners,B=H.length,y=B*2,h=i.position?new Float64Array(y):void 0,b=i.normal?new Float32Array(y):void 0,x=i.tangent?new Float32Array(y):void 0,F=i.bitangent?new Float32Array(y):void 0,M=i.st?new Float32Array(y/3*2):void 0,v=0,T=0,C=0,z=0,W=0,g=ft,d=ut,A=pt,Z=!0;B/=3;let p,j=0,ct=1/(B-f-1);for(p=0;p<B;++p){let E=p*3,u=s.fromArray(H,E,Q),U=s.fromArray(q,E,Y);if(i.position&&(h[v++]=U.x,h[v++]=U.y,h[v++]=U.z,h[v++]=u.x,h[v++]=u.y,h[v++]=u.z),i.st&&(M[W++]=j,M[W++]=0,M[W++]=j,M[W++]=1),i.normal||i.tangent||i.bitangent){let N=s.clone(s.ZERO,st),K=s.subtract(u,a.geodeticSurfaceNormal(u,Y),Y);if(p+1<B&&(N=s.fromArray(H,E+3,st)),Z){let G=s.subtract(N,u,lt),at=s.subtract(K,u,Q);g=s.normalize(s.cross(at,G,g),g),Z=!1}s.equalsEpsilon(u,N,J.EPSILON10)?Z=!0:(j+=ct,i.tangent&&(d=s.normalize(s.subtract(N,u,d),d)),i.bitangent&&(A=s.normalize(s.cross(g,d,A),A))),i.normal&&(b[T++]=g.x,b[T++]=g.y,b[T++]=g.z,b[T++]=g.x,b[T++]=g.y,b[T++]=g.z),i.tangent&&(x[z++]=d.x,x[z++]=d.y,x[z++]=d.z,x[z++]=d.x,x[z++]=d.y,x[z++]=d.z),i.bitangent&&(F[C++]=A.x,F[C++]=A.y,F[C++]=A.z,F[C++]=A.x,F[C++]=A.y,F[C++]=A.z)}}let D=new it;i.position&&(D.position=new S({componentDatatype:R.DOUBLE,componentsPerAttribute:3,values:h})),i.normal&&(D.normal=new S({componentDatatype:R.FLOAT,componentsPerAttribute:3,values:b})),i.tangent&&(D.tangent=new S({componentDatatype:R.FLOAT,componentsPerAttribute:3,values:x})),i.bitangent&&(D.bitangent=new S({componentDatatype:R.FLOAT,componentsPerAttribute:3,values:F})),i.st&&(D.st=new S({componentDatatype:R.FLOAT,componentsPerAttribute:2,values:M}));let $=y/3;y-=6*(f+1);let L=ot.createTypedArray($,y),O=0;for(p=0;p<$-2;p+=2){let E=p,u=p+2,U=s.fromArray(h,E*3,Q),N=s.fromArray(h,u*3,Y);if(s.equalsEpsilon(U,N,J.EPSILON10))continue;let K=p+1,G=p+3;L[O++]=K,L[O++]=E,L[O++]=G,L[O++]=G,L[O++]=E,L[O++]=u}return new et({attributes:D,indices:L,primitiveType:tt.TRIANGLES,boundingSphere:new I.fromVertices(h)})};var X=k;function ht(t,e){return r(e)&&(t=X.unpack(t,e)),t._ellipsoid=l.clone(t._ellipsoid),X.createGeometry(t)}var Ot=ht;export{Ot as default}; +import{a as nt}from"./chunk-2GHT2S2L.js";import"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import{a as _}from"./chunk-6VK5R74O.js";import"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as ot}from"./chunk-YFQNY2YN.js";import{a as it}from"./chunk-NT26NNVH.js";import{b as tt,c as et,d as S}from"./chunk-NW2YE576.js";import{d as I}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as R}from"./chunk-QHHYYTCM.js";import{a as s,d as l}from"./chunk-RH3GFHG2.js";import{a as J}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as w}from"./chunk-TA3RE4KQ.js";import{a as P}from"./chunk-RTY3VPG6.js";import{e as r}from"./chunk-LRNH5AEO.js";var Q=new s,Y=new s,lt=new s,st=new s,pt=new s,ut=new s,ft=new s;function k(t){t=w(t,w.EMPTY_OBJECT);let e=t.positions,o=t.maximumHeights,n=t.minimumHeights;if(!r(e))throw new P("options.positions is required.");if(r(o)&&o.length!==e.length)throw new P("options.positions and options.maximumHeights must have the same length.");if(r(n)&&n.length!==e.length)throw new P("options.positions and options.minimumHeights must have the same length.");let i=w(t.vertexFormat,_.DEFAULT),c=w(t.granularity,J.RADIANS_PER_DEGREE),a=w(t.ellipsoid,l.default);this._positions=e,this._minimumHeights=n,this._maximumHeights=o,this._vertexFormat=_.clone(i),this._granularity=c,this._ellipsoid=l.clone(a),this._workerName="createWallGeometry";let m=1+e.length*s.packedLength+2;r(n)&&(m+=n.length),r(o)&&(m+=o.length),this.packedLength=m+l.packedLength+_.packedLength+1}k.pack=function(t,e,o){if(!r(t))throw new P("value is required");if(!r(e))throw new P("array is required");o=w(o,0);let n,i=t._positions,c=i.length;for(e[o++]=c,n=0;n<c;++n,o+=s.packedLength)s.pack(i[n],e,o);let a=t._minimumHeights;if(c=r(a)?a.length:0,e[o++]=c,r(a))for(n=0;n<c;++n)e[o++]=a[n];let m=t._maximumHeights;if(c=r(m)?m.length:0,e[o++]=c,r(m))for(n=0;n<c;++n)e[o++]=m[n];return l.pack(t._ellipsoid,e,o),o+=l.packedLength,_.pack(t._vertexFormat,e,o),o+=_.packedLength,e[o]=t._granularity,e};var mt=l.clone(l.UNIT_SPHERE),rt=new _,V={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:mt,vertexFormat:rt,granularity:void 0};k.unpack=function(t,e,o){if(!r(t))throw new P("array is required");e=w(e,0);let n,i=t[e++],c=new Array(i);for(n=0;n<i;++n,e+=s.packedLength)c[n]=s.unpack(t,e);i=t[e++];let a;if(i>0)for(a=new Array(i),n=0;n<i;++n)a[n]=t[e++];i=t[e++];let m;if(i>0)for(m=new Array(i),n=0;n<i;++n)m[n]=t[e++];let q=l.unpack(t,e,mt);e+=l.packedLength;let H=_.unpack(t,e,rt);e+=_.packedLength;let f=t[e];return r(o)?(o._positions=c,o._minimumHeights=a,o._maximumHeights=m,o._ellipsoid=l.clone(q,o._ellipsoid),o._vertexFormat=_.clone(H,o._vertexFormat),o._granularity=f,o):(V.positions=c,V.minimumHeights=a,V.maximumHeights=m,V.granularity=f,new k(V))};k.fromConstantHeights=function(t){t=w(t,w.EMPTY_OBJECT);let e=t.positions;if(!r(e))throw new P("options.positions is required.");let o,n,i=t.minimumHeight,c=t.maximumHeight,a=r(i),m=r(c);if(a||m){let H=e.length;o=a?new Array(H):void 0,n=m?new Array(H):void 0;for(let f=0;f<H;++f)a&&(o[f]=i),m&&(n[f]=c)}let q={positions:e,maximumHeights:n,minimumHeights:o,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat};return new k(q)};k.createGeometry=function(t){let e=t._positions,o=t._minimumHeights,n=t._maximumHeights,i=t._vertexFormat,c=t._granularity,a=t._ellipsoid,m=nt.computePositions(a,e,n,o,c,!0);if(!r(m))return;let q=m.bottomPositions,H=m.topPositions,f=m.numCorners,B=H.length,y=B*2,h=i.position?new Float64Array(y):void 0,b=i.normal?new Float32Array(y):void 0,x=i.tangent?new Float32Array(y):void 0,F=i.bitangent?new Float32Array(y):void 0,M=i.st?new Float32Array(y/3*2):void 0,v=0,T=0,C=0,z=0,W=0,g=ft,d=ut,A=pt,Z=!0;B/=3;let p,j=0,ct=1/(B-f-1);for(p=0;p<B;++p){let E=p*3,u=s.fromArray(H,E,Q),U=s.fromArray(q,E,Y);if(i.position&&(h[v++]=U.x,h[v++]=U.y,h[v++]=U.z,h[v++]=u.x,h[v++]=u.y,h[v++]=u.z),i.st&&(M[W++]=j,M[W++]=0,M[W++]=j,M[W++]=1),i.normal||i.tangent||i.bitangent){let N=s.clone(s.ZERO,st),K=s.subtract(u,a.geodeticSurfaceNormal(u,Y),Y);if(p+1<B&&(N=s.fromArray(H,E+3,st)),Z){let G=s.subtract(N,u,lt),at=s.subtract(K,u,Q);g=s.normalize(s.cross(at,G,g),g),Z=!1}s.equalsEpsilon(u,N,J.EPSILON10)?Z=!0:(j+=ct,i.tangent&&(d=s.normalize(s.subtract(N,u,d),d)),i.bitangent&&(A=s.normalize(s.cross(g,d,A),A))),i.normal&&(b[T++]=g.x,b[T++]=g.y,b[T++]=g.z,b[T++]=g.x,b[T++]=g.y,b[T++]=g.z),i.tangent&&(x[z++]=d.x,x[z++]=d.y,x[z++]=d.z,x[z++]=d.x,x[z++]=d.y,x[z++]=d.z),i.bitangent&&(F[C++]=A.x,F[C++]=A.y,F[C++]=A.z,F[C++]=A.x,F[C++]=A.y,F[C++]=A.z)}}let D=new it;i.position&&(D.position=new S({componentDatatype:R.DOUBLE,componentsPerAttribute:3,values:h})),i.normal&&(D.normal=new S({componentDatatype:R.FLOAT,componentsPerAttribute:3,values:b})),i.tangent&&(D.tangent=new S({componentDatatype:R.FLOAT,componentsPerAttribute:3,values:x})),i.bitangent&&(D.bitangent=new S({componentDatatype:R.FLOAT,componentsPerAttribute:3,values:F})),i.st&&(D.st=new S({componentDatatype:R.FLOAT,componentsPerAttribute:2,values:M}));let $=y/3;y-=6*(f+1);let L=ot.createTypedArray($,y),O=0;for(p=0;p<$-2;p+=2){let E=p,u=p+2,U=s.fromArray(h,E*3,Q),N=s.fromArray(h,u*3,Y);if(s.equalsEpsilon(U,N,J.EPSILON10))continue;let K=p+1,G=p+3;L[O++]=K,L[O++]=E,L[O++]=G,L[O++]=G,L[O++]=E,L[O++]=u}return new et({attributes:D,indices:L,primitiveType:tt.TRIANGLES,boundingSphere:new I.fromVertices(h)})};var X=k;function ht(t,e){return r(e)&&(t=X.unpack(t,e)),t._ellipsoid=l.clone(t._ellipsoid),X.createGeometry(t)}var Ot=ht;export{Ot as default}; diff --git a/public/js/Cesium2/Workers/createWallOutlineGeometry.js b/public/js/Cesium2/Workers/createWallOutlineGeometry.js index a2639692c..aea1585e1 100644 --- a/public/js/Cesium2/Workers/createWallOutlineGeometry.js +++ b/public/js/Cesium2/Workers/createWallOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as B}from"./chunk-42FICTTZ.js";import"./chunk-RNF7TLFF.js";import"./chunk-E7HC3VTG.js";import"./chunk-GJI4ZBKE.js";import"./chunk-RDAVO5OM.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as W}from"./chunk-34ULWVZF.js";import{a as N}from"./chunk-24JYWT5N.js";import{b as R,c as S,d as M}from"./chunk-LH3SUUXG.js";import{d as D}from"./chunk-K2M3OJ7Z.js";import"./chunk-M3A6SPGI.js";import{a as q}from"./chunk-D5HNP2LB.js";import{a as p,d as l}from"./chunk-S4VBGY2U.js";import{a as O}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import{a as d}from"./chunk-N3A5CZ2S.js";import{a as _}from"./chunk-G75U3WZT.js";import{e as m}from"./chunk-3THTQ4QB.js";var U=new p,z=new p;function w(i){i=d(i,d.EMPTY_OBJECT);let t=i.positions,e=i.maximumHeights,o=i.minimumHeights;if(!m(t))throw new _("options.positions is required.");if(m(e)&&e.length!==t.length)throw new _("options.positions and options.maximumHeights must have the same length.");if(m(o)&&o.length!==t.length)throw new _("options.positions and options.minimumHeights must have the same length.");let s=d(i.granularity,O.RADIANS_PER_DEGREE),r=d(i.ellipsoid,l.default);this._positions=t,this._minimumHeights=o,this._maximumHeights=e,this._granularity=s,this._ellipsoid=l.clone(r),this._workerName="createWallOutlineGeometry";let n=1+t.length*p.packedLength+2;m(o)&&(n+=o.length),m(e)&&(n+=e.length),this.packedLength=n+l.packedLength+1}w.pack=function(i,t,e){if(!m(i))throw new _("value is required");if(!m(t))throw new _("array is required");e=d(e,0);let o,s=i._positions,r=s.length;for(t[e++]=r,o=0;o<r;++o,e+=p.packedLength)p.pack(s[o],t,e);let n=i._minimumHeights;if(r=m(n)?n.length:0,t[e++]=r,m(n))for(o=0;o<r;++o)t[e++]=n[o];let c=i._maximumHeights;if(r=m(c)?c.length:0,t[e++]=r,m(c))for(o=0;o<r;++o)t[e++]=c[o];return l.pack(i._ellipsoid,t,e),e+=l.packedLength,t[e]=i._granularity,t};var G=l.clone(l.UNIT_SPHERE),b={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:G,granularity:void 0};w.unpack=function(i,t,e){if(!m(i))throw new _("array is required");t=d(t,0);let o,s=i[t++],r=new Array(s);for(o=0;o<s;++o,t+=p.packedLength)r[o]=p.unpack(i,t);s=i[t++];let n;if(s>0)for(n=new Array(s),o=0;o<s;++o)n[o]=i[t++];s=i[t++];let c;if(s>0)for(c=new Array(s),o=0;o<s;++o)c[o]=i[t++];let E=l.unpack(i,t,G);t+=l.packedLength;let u=i[t];return m(e)?(e._positions=r,e._minimumHeights=n,e._maximumHeights=c,e._ellipsoid=l.clone(E,e._ellipsoid),e._granularity=u,e):(b.positions=r,b.minimumHeights=n,b.maximumHeights=c,b.granularity=u,new w(b))};w.fromConstantHeights=function(i){i=d(i,d.EMPTY_OBJECT);let t=i.positions;if(!m(t))throw new _("options.positions is required.");let e,o,s=i.minimumHeight,r=i.maximumHeight,n=m(s),c=m(r);if(n||c){let u=t.length;e=n?new Array(u):void 0,o=c?new Array(u):void 0;for(let a=0;a<u;++a)n&&(e[a]=s),c&&(o[a]=r)}let E={positions:t,maximumHeights:o,minimumHeights:e,ellipsoid:i.ellipsoid};return new w(E)};w.createGeometry=function(i){let t=i._positions,e=i._minimumHeights,o=i._maximumHeights,s=i._granularity,r=i._ellipsoid,n=B.computePositions(r,t,o,e,s,!1);if(!m(n))return;let c=n.bottomPositions,E=n.topPositions,u=E.length,a=u*2,f=new Float64Array(a),P=0;u/=3;let h;for(h=0;h<u;++h){let A=h*3,k=p.fromArray(E,A,U),L=p.fromArray(c,A,z);f[P++]=L.x,f[P++]=L.y,f[P++]=L.z,f[P++]=k.x,f[P++]=k.y,f[P++]=k.z}let V=new N({position:new M({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})}),y=a/3;a=2*y-4+y;let g=W.createTypedArray(y,a),H=0;for(h=0;h<y-2;h+=2){let A=h,k=h+2,L=p.fromArray(f,A*3,U),v=p.fromArray(f,k*3,z);if(p.equalsEpsilon(L,v,O.EPSILON10))continue;let T=h+1,x=h+3;g[H++]=T,g[H++]=A,g[H++]=T,g[H++]=x,g[H++]=A,g[H++]=k}return g[H++]=y-2,g[H++]=y-1,new S({attributes:V,indices:g,primitiveType:R.LINES,boundingSphere:new D.fromVertices(f)})};var C=w;function J(i,t){return m(t)&&(i=C.unpack(i,t)),i._ellipsoid=l.clone(i._ellipsoid),C.createGeometry(i)}var pi=J;export{pi as default}; +import{a as B}from"./chunk-2GHT2S2L.js";import"./chunk-AKRPIQPN.js";import"./chunk-NHNM56MI.js";import"./chunk-OKWGJEQO.js";import"./chunk-ZBEWS6NN.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as W}from"./chunk-YFQNY2YN.js";import{a as N}from"./chunk-NT26NNVH.js";import{b as R,c as S,d as M}from"./chunk-NW2YE576.js";import{d as D}from"./chunk-2NIQ5ECB.js";import"./chunk-7YEOLR2L.js";import{a as q}from"./chunk-QHHYYTCM.js";import{a as p,d as l}from"./chunk-RH3GFHG2.js";import{a as O}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import{a as d}from"./chunk-TA3RE4KQ.js";import{a as _}from"./chunk-RTY3VPG6.js";import{e as m}from"./chunk-LRNH5AEO.js";var U=new p,z=new p;function w(i){i=d(i,d.EMPTY_OBJECT);let t=i.positions,e=i.maximumHeights,o=i.minimumHeights;if(!m(t))throw new _("options.positions is required.");if(m(e)&&e.length!==t.length)throw new _("options.positions and options.maximumHeights must have the same length.");if(m(o)&&o.length!==t.length)throw new _("options.positions and options.minimumHeights must have the same length.");let s=d(i.granularity,O.RADIANS_PER_DEGREE),r=d(i.ellipsoid,l.default);this._positions=t,this._minimumHeights=o,this._maximumHeights=e,this._granularity=s,this._ellipsoid=l.clone(r),this._workerName="createWallOutlineGeometry";let n=1+t.length*p.packedLength+2;m(o)&&(n+=o.length),m(e)&&(n+=e.length),this.packedLength=n+l.packedLength+1}w.pack=function(i,t,e){if(!m(i))throw new _("value is required");if(!m(t))throw new _("array is required");e=d(e,0);let o,s=i._positions,r=s.length;for(t[e++]=r,o=0;o<r;++o,e+=p.packedLength)p.pack(s[o],t,e);let n=i._minimumHeights;if(r=m(n)?n.length:0,t[e++]=r,m(n))for(o=0;o<r;++o)t[e++]=n[o];let c=i._maximumHeights;if(r=m(c)?c.length:0,t[e++]=r,m(c))for(o=0;o<r;++o)t[e++]=c[o];return l.pack(i._ellipsoid,t,e),e+=l.packedLength,t[e]=i._granularity,t};var G=l.clone(l.UNIT_SPHERE),b={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:G,granularity:void 0};w.unpack=function(i,t,e){if(!m(i))throw new _("array is required");t=d(t,0);let o,s=i[t++],r=new Array(s);for(o=0;o<s;++o,t+=p.packedLength)r[o]=p.unpack(i,t);s=i[t++];let n;if(s>0)for(n=new Array(s),o=0;o<s;++o)n[o]=i[t++];s=i[t++];let c;if(s>0)for(c=new Array(s),o=0;o<s;++o)c[o]=i[t++];let E=l.unpack(i,t,G);t+=l.packedLength;let u=i[t];return m(e)?(e._positions=r,e._minimumHeights=n,e._maximumHeights=c,e._ellipsoid=l.clone(E,e._ellipsoid),e._granularity=u,e):(b.positions=r,b.minimumHeights=n,b.maximumHeights=c,b.granularity=u,new w(b))};w.fromConstantHeights=function(i){i=d(i,d.EMPTY_OBJECT);let t=i.positions;if(!m(t))throw new _("options.positions is required.");let e,o,s=i.minimumHeight,r=i.maximumHeight,n=m(s),c=m(r);if(n||c){let u=t.length;e=n?new Array(u):void 0,o=c?new Array(u):void 0;for(let a=0;a<u;++a)n&&(e[a]=s),c&&(o[a]=r)}let E={positions:t,maximumHeights:o,minimumHeights:e,ellipsoid:i.ellipsoid};return new w(E)};w.createGeometry=function(i){let t=i._positions,e=i._minimumHeights,o=i._maximumHeights,s=i._granularity,r=i._ellipsoid,n=B.computePositions(r,t,o,e,s,!1);if(!m(n))return;let c=n.bottomPositions,E=n.topPositions,u=E.length,a=u*2,f=new Float64Array(a),P=0;u/=3;let h;for(h=0;h<u;++h){let A=h*3,k=p.fromArray(E,A,U),L=p.fromArray(c,A,z);f[P++]=L.x,f[P++]=L.y,f[P++]=L.z,f[P++]=k.x,f[P++]=k.y,f[P++]=k.z}let V=new N({position:new M({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})}),y=a/3;a=2*y-4+y;let g=W.createTypedArray(y,a),H=0;for(h=0;h<y-2;h+=2){let A=h,k=h+2,L=p.fromArray(f,A*3,U),v=p.fromArray(f,k*3,z);if(p.equalsEpsilon(L,v,O.EPSILON10))continue;let T=h+1,x=h+3;g[H++]=T,g[H++]=A,g[H++]=T,g[H++]=x,g[H++]=A,g[H++]=k}return g[H++]=y-2,g[H++]=y-1,new S({attributes:V,indices:g,primitiveType:R.LINES,boundingSphere:new D.fromVertices(f)})};var C=w;function J(i,t){return m(t)&&(i=C.unpack(i,t)),i._ellipsoid=l.clone(i._ellipsoid),C.createGeometry(i)}var pi=J;export{pi as default}; diff --git a/public/js/Cesium2/Workers/decodeDraco.js b/public/js/Cesium2/Workers/decodeDraco.js index 1d6bccb6a..2cf895ecf 100644 --- a/public/js/Cesium2/Workers/decodeDraco.js +++ b/public/js/Cesium2/Workers/decodeDraco.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as O}from"./chunk-JR7WFPVR.js";import{a as I}from"./chunk-4BYMTYMT.js";import{a as m}from"./chunk-34ULWVZF.js";import{a as w}from"./chunk-D5HNP2LB.js";import"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import{a as A}from"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import"./chunk-G75U3WZT.js";import{d as D,e as d}from"./chunk-3THTQ4QB.js";var b=D(O(),1),o;function F(t,e){let i=t.num_points(),a=t.num_faces(),n=new o.DracoInt32Array,s=a*3,r=m.createTypedArray(i,s),u=0;for(let c=0;c<a;++c)e.GetFaceFromMesh(t,c,n),r[u+0]=n.GetValue(0),r[u+1]=n.GetValue(1),r[u+2]=n.GetValue(2),u+=3;return o.destroy(n),{typedArray:r,numberOfIndices:s}}function U(t,e,i,a,n){let s,r;a.quantizationBits<=8?(r=new o.DracoUInt8Array,s=new Uint8Array(n),e.GetAttributeUInt8ForAllPoints(t,i,r)):a.quantizationBits<=16?(r=new o.DracoUInt16Array,s=new Uint16Array(n),e.GetAttributeUInt16ForAllPoints(t,i,r)):(r=new o.DracoFloat32Array,s=new Float32Array(n),e.GetAttributeFloatForAllPoints(t,i,r));for(let u=0;u<n;++u)s[u]=r.GetValue(u);return o.destroy(r),s}function k(t,e,i,a){let n,s;switch(i.data_type()){case 1:case 11:s=new o.DracoInt8Array,n=new Int8Array(a),e.GetAttributeInt8ForAllPoints(t,i,s);break;case 2:s=new o.DracoUInt8Array,n=new Uint8Array(a),e.GetAttributeUInt8ForAllPoints(t,i,s);break;case 3:s=new o.DracoInt16Array,n=new Int16Array(a),e.GetAttributeInt16ForAllPoints(t,i,s);break;case 4:s=new o.DracoUInt16Array,n=new Uint16Array(a),e.GetAttributeUInt16ForAllPoints(t,i,s);break;case 5:case 7:s=new o.DracoInt32Array,n=new Int32Array(a),e.GetAttributeInt32ForAllPoints(t,i,s);break;case 6:case 8:s=new o.DracoUInt32Array,n=new Uint32Array(a),e.GetAttributeUInt32ForAllPoints(t,i,s);break;case 9:case 10:s=new o.DracoFloat32Array,n=new Float32Array(a),e.GetAttributeFloatForAllPoints(t,i,s);break}for(let r=0;r<a;++r)n[r]=s.GetValue(r);return o.destroy(s),n}function p(t,e,i){let a=t.num_points(),n=i.num_components(),s,r=new o.AttributeQuantizationTransform;if(r.InitFromAttribute(i)){let y=new Array(n);for(let f=0;f<n;++f)y[f]=r.min_value(f);s={quantizationBits:r.quantization_bits(),minValues:y,range:r.range(),octEncoded:!1}}o.destroy(r),r=new o.AttributeOctahedronTransform,r.InitFromAttribute(i)&&(s={quantizationBits:r.quantization_bits(),octEncoded:!0}),o.destroy(r);let u=a*n,c;d(s)?c=U(t,e,i,s,u):c=k(t,e,i,u);let l=w.fromTypedArray(c);return{array:c,data:{componentsPerAttribute:n,componentDatatype:l,byteOffset:i.byte_offset(),byteStride:w.getSizeInBytes(l)*n,normalized:i.normalized(),quantization:s}}}function _(t){let e=new o.Decoder;t.dequantizeInShader&&(e.SkipAttributeTransform(o.POSITION),e.SkipAttributeTransform(o.NORMAL));let i=new o.DecoderBuffer;if(i.Init(t.buffer,t.buffer.length),e.GetEncodedGeometryType(i)!==o.POINT_CLOUD)throw new A("Draco geometry type must be POINT_CLOUD.");let n=new o.PointCloud,s=e.DecodeBufferToPointCloud(i,n);if(!s.ok()||n.ptr===0)throw new A(`Error decoding draco point cloud: ${s.error_msg()}`);o.destroy(i);let r={},u=t.properties;for(let c in u)if(u.hasOwnProperty(c)){let l;if(c==="POSITION"||c==="NORMAL"){let y=e.GetAttributeId(n,o[c]);l=e.GetAttribute(n,y)}else{let y=u[c];l=e.GetAttributeByUniqueId(n,y)}r[c]=p(n,e,l)}return o.destroy(n),o.destroy(e),r}function g(t){let e=new o.Decoder,i=["POSITION","NORMAL","COLOR","TEX_COORD"];if(t.dequantizeInShader)for(let f=0;f<i.length;++f)e.SkipAttributeTransform(o[i[f]]);let a=t.bufferView,n=new o.DecoderBuffer;if(n.Init(t.array,a.byteLength),e.GetEncodedGeometryType(n)!==o.TRIANGULAR_MESH)throw new A("Unsupported draco mesh geometry type.");let r=new o.Mesh,u=e.DecodeBufferToMesh(n,r);if(!u.ok()||r.ptr===0)throw new A(`Error decoding draco mesh geometry: ${u.error_msg()}`);o.destroy(n);let c={},l=t.compressedAttributes;for(let f in l)if(l.hasOwnProperty(f)){let P=l[f],T=e.GetAttributeByUniqueId(r,P);c[f]=p(r,e,T)}let y={indexArray:F(r,e),attributeData:c};return o.destroy(r),o.destroy(e),y}async function z(t,e){return d(t.bufferView)?g(t):_(t)}async function C(t,e){let i=t.webAssemblyConfig;return d(i)&&d(i.wasmBinaryFile)?o=await(0,b.default)(i):o=await(0,b.default)(),!0}async function G(t,e){let i=t.webAssemblyConfig;return d(i)?C(t,e):z(t,e)}var h=I(G);export{h as default}; +import{a as O}from"./chunk-URBLFZDC.js";import{a as I}from"./chunk-4E3APMCC.js";import{a as m}from"./chunk-YFQNY2YN.js";import{a as w}from"./chunk-QHHYYTCM.js";import"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import{a as A}from"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import"./chunk-RTY3VPG6.js";import{d as D,e as d}from"./chunk-LRNH5AEO.js";var b=D(O(),1),o;function F(t,e){let i=t.num_points(),a=t.num_faces(),n=new o.DracoInt32Array,s=a*3,r=m.createTypedArray(i,s),u=0;for(let c=0;c<a;++c)e.GetFaceFromMesh(t,c,n),r[u+0]=n.GetValue(0),r[u+1]=n.GetValue(1),r[u+2]=n.GetValue(2),u+=3;return o.destroy(n),{typedArray:r,numberOfIndices:s}}function U(t,e,i,a,n){let s,r;a.quantizationBits<=8?(r=new o.DracoUInt8Array,s=new Uint8Array(n),e.GetAttributeUInt8ForAllPoints(t,i,r)):a.quantizationBits<=16?(r=new o.DracoUInt16Array,s=new Uint16Array(n),e.GetAttributeUInt16ForAllPoints(t,i,r)):(r=new o.DracoFloat32Array,s=new Float32Array(n),e.GetAttributeFloatForAllPoints(t,i,r));for(let u=0;u<n;++u)s[u]=r.GetValue(u);return o.destroy(r),s}function k(t,e,i,a){let n,s;switch(i.data_type()){case 1:case 11:s=new o.DracoInt8Array,n=new Int8Array(a),e.GetAttributeInt8ForAllPoints(t,i,s);break;case 2:s=new o.DracoUInt8Array,n=new Uint8Array(a),e.GetAttributeUInt8ForAllPoints(t,i,s);break;case 3:s=new o.DracoInt16Array,n=new Int16Array(a),e.GetAttributeInt16ForAllPoints(t,i,s);break;case 4:s=new o.DracoUInt16Array,n=new Uint16Array(a),e.GetAttributeUInt16ForAllPoints(t,i,s);break;case 5:case 7:s=new o.DracoInt32Array,n=new Int32Array(a),e.GetAttributeInt32ForAllPoints(t,i,s);break;case 6:case 8:s=new o.DracoUInt32Array,n=new Uint32Array(a),e.GetAttributeUInt32ForAllPoints(t,i,s);break;case 9:case 10:s=new o.DracoFloat32Array,n=new Float32Array(a),e.GetAttributeFloatForAllPoints(t,i,s);break}for(let r=0;r<a;++r)n[r]=s.GetValue(r);return o.destroy(s),n}function p(t,e,i){let a=t.num_points(),n=i.num_components(),s,r=new o.AttributeQuantizationTransform;if(r.InitFromAttribute(i)){let y=new Array(n);for(let f=0;f<n;++f)y[f]=r.min_value(f);s={quantizationBits:r.quantization_bits(),minValues:y,range:r.range(),octEncoded:!1}}o.destroy(r),r=new o.AttributeOctahedronTransform,r.InitFromAttribute(i)&&(s={quantizationBits:r.quantization_bits(),octEncoded:!0}),o.destroy(r);let u=a*n,c;d(s)?c=U(t,e,i,s,u):c=k(t,e,i,u);let l=w.fromTypedArray(c);return{array:c,data:{componentsPerAttribute:n,componentDatatype:l,byteOffset:i.byte_offset(),byteStride:w.getSizeInBytes(l)*n,normalized:i.normalized(),quantization:s}}}function _(t){let e=new o.Decoder;t.dequantizeInShader&&(e.SkipAttributeTransform(o.POSITION),e.SkipAttributeTransform(o.NORMAL));let i=new o.DecoderBuffer;if(i.Init(t.buffer,t.buffer.length),e.GetEncodedGeometryType(i)!==o.POINT_CLOUD)throw new A("Draco geometry type must be POINT_CLOUD.");let n=new o.PointCloud,s=e.DecodeBufferToPointCloud(i,n);if(!s.ok()||n.ptr===0)throw new A(`Error decoding draco point cloud: ${s.error_msg()}`);o.destroy(i);let r={},u=t.properties;for(let c in u)if(u.hasOwnProperty(c)){let l;if(c==="POSITION"||c==="NORMAL"){let y=e.GetAttributeId(n,o[c]);l=e.GetAttribute(n,y)}else{let y=u[c];l=e.GetAttributeByUniqueId(n,y)}r[c]=p(n,e,l)}return o.destroy(n),o.destroy(e),r}function g(t){let e=new o.Decoder,i=["POSITION","NORMAL","COLOR","TEX_COORD"];if(t.dequantizeInShader)for(let f=0;f<i.length;++f)e.SkipAttributeTransform(o[i[f]]);let a=t.bufferView,n=new o.DecoderBuffer;if(n.Init(t.array,a.byteLength),e.GetEncodedGeometryType(n)!==o.TRIANGULAR_MESH)throw new A("Unsupported draco mesh geometry type.");let r=new o.Mesh,u=e.DecodeBufferToMesh(n,r);if(!u.ok()||r.ptr===0)throw new A(`Error decoding draco mesh geometry: ${u.error_msg()}`);o.destroy(n);let c={},l=t.compressedAttributes;for(let f in l)if(l.hasOwnProperty(f)){let P=l[f],T=e.GetAttributeByUniqueId(r,P);c[f]=p(r,e,T)}let y={indexArray:F(r,e),attributeData:c};return o.destroy(r),o.destroy(e),y}async function z(t,e){return d(t.bufferView)?g(t):_(t)}async function C(t,e){let i=t.webAssemblyConfig;return d(i)&&d(i.wasmBinaryFile)?o=await(0,b.default)(i):o=await(0,b.default)(),!0}async function G(t,e){let i=t.webAssemblyConfig;return d(i)?C(t,e):z(t,e)}var h=I(G);export{h as default}; diff --git a/public/js/Cesium2/Workers/decodeGoogleEarthEnterprisePacket.js b/public/js/Cesium2/Workers/decodeGoogleEarthEnterprisePacket.js index c6e78c2af..f9d2ccbdf 100644 --- a/public/js/Cesium2/Workers/decodeGoogleEarthEnterprisePacket.js +++ b/public/js/Cesium2/Workers/decodeGoogleEarthEnterprisePacket.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as Se}from"./chunk-4BYMTYMT.js";import{a as D}from"./chunk-R62IKKEC.js";import{b as ae}from"./chunk-G75U3WZT.js";import{c as R,d as Ot,e as me}from"./chunk-3THTQ4QB.js";var Ie=R((Li,Ae)=>{"use strict";var zt=(t,i,e,r)=>{let s=t&65535|0,n=t>>>16&65535|0,c=0;for(;e!==0;){c=e>2e3?2e3:e,e-=c;do s=s+i[r++]|0,n=n+s|0;while(--c);s%=65521,n%=65521}return s|n<<16|0};Ae.exports=zt});var De=R((Pi,Re)=>{"use strict";var Ht=()=>{let t,i=[];for(var e=0;e<256;e++){t=e;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;i[e]=t}return i},Ft=new Uint32Array(Ht()),Vt=(t,i,e,r)=>{let s=Ft,n=r+e;t^=-1;for(let c=r;c<n;c++)t=t>>>8^s[(t^i[c])&255];return t^-1};Re.exports=Vt});var Oe=R((zi,Ue)=>{"use strict";Ue.exports=function(i,e){let r,s,n,c,f,_,a,o,v,w,l,u,I,p,x,T,g,d,E,A,h,S,k,b,m=i.state;r=i.next_in,k=i.input,s=r+(i.avail_in-5),n=i.next_out,b=i.output,c=n-(e-i.avail_out),f=n+(i.avail_out-257),_=m.dmax,a=m.wsize,o=m.whave,v=m.wnext,w=m.window,l=m.hold,u=m.bits,I=m.lencode,p=m.distcode,x=(1<<m.lenbits)-1,T=(1<<m.distbits)-1;e:do{u<15&&(l+=k[r++]<<u,u+=8,l+=k[r++]<<u,u+=8),g=I[l&x];t:for(;;){if(d=g>>>24,l>>>=d,u-=d,d=g>>>16&255,d===0)b[n++]=g&65535;else if(d&16){E=g&65535,d&=15,d&&(u<d&&(l+=k[r++]<<u,u+=8),E+=l&(1<<d)-1,l>>>=d,u-=d),u<15&&(l+=k[r++]<<u,u+=8,l+=k[r++]<<u,u+=8),g=p[l&T];i:for(;;){if(d=g>>>24,l>>>=d,u-=d,d=g>>>16&255,d&16){if(A=g&65535,d&=15,u<d&&(l+=k[r++]<<u,u+=8,u<d&&(l+=k[r++]<<u,u+=8)),A+=l&(1<<d)-1,A>_){i.msg="invalid distance too far back",m.mode=16209;break e}if(l>>>=d,u-=d,d=n-c,A>d){if(d=A-d,d>o&&m.sane){i.msg="invalid distance too far back",m.mode=16209;break e}if(h=0,S=w,v===0){if(h+=a-d,d<E){E-=d;do b[n++]=w[h++];while(--d);h=n-A,S=b}}else if(v<d){if(h+=a+v-d,d-=v,d<E){E-=d;do b[n++]=w[h++];while(--d);if(h=0,v<E){d=v,E-=d;do b[n++]=w[h++];while(--d);h=n-A,S=b}}}else if(h+=v-d,d<E){E-=d;do b[n++]=w[h++];while(--d);h=n-A,S=b}for(;E>2;)b[n++]=S[h++],b[n++]=S[h++],b[n++]=S[h++],E-=3;E&&(b[n++]=S[h++],E>1&&(b[n++]=S[h++]))}else{h=n-A;do b[n++]=b[h++],b[n++]=b[h++],b[n++]=b[h++],E-=3;while(E>2);E&&(b[n++]=b[h++],E>1&&(b[n++]=b[h++]))}}else if(d&64){i.msg="invalid distance code",m.mode=16209;break e}else{g=p[(g&65535)+(l&(1<<d)-1)];continue i}break}}else if(d&64)if(d&32){m.mode=16191;break e}else{i.msg="invalid literal/length code",m.mode=16209;break e}else{g=I[(g&65535)+(l&(1<<d)-1)];continue t}break}}while(r<s&&n<f);E=u>>3,r-=E,u-=E<<3,l&=(1<<u)-1,i.next_in=r,i.next_out=n,i.avail_in=r<s?5+(s-r):5-(r-s),i.avail_out=n<f?257+(f-n):257-(n-f),m.hold=l,m.bits=u}});var Me=R((Hi,Ne)=>{"use strict";var Gt=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Yt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Xt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),qt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Kt=(t,i,e,r,s,n,c,f)=>{let _=f.bits,a=0,o=0,v=0,w=0,l=0,u=0,I=0,p=0,x=0,T=0,g,d,E,A,h,S=null,k,b=new Uint16Array(16),m=new Uint16Array(16),L=null,Ee,W,Q;for(a=0;a<=15;a++)b[a]=0;for(o=0;o<r;o++)b[i[e+o]]++;for(l=_,w=15;w>=1&&b[w]===0;w--);if(l>w&&(l=w),w===0)return s[n++]=1<<24|64<<16|0,s[n++]=1<<24|64<<16|0,f.bits=1,0;for(v=1;v<w&&b[v]===0;v++);for(l<v&&(l=v),p=1,a=1;a<=15;a++)if(p<<=1,p-=b[a],p<0)return-1;if(p>0&&(t===0||w!==1))return-1;for(m[1]=0,a=1;a<15;a++)m[a+1]=m[a]+b[a];for(o=0;o<r;o++)i[e+o]!==0&&(c[m[i[e+o]]++]=o);if(t===0?(S=L=c,k=20):t===1?(S=Gt,L=Yt,k=257):(S=Xt,L=qt,k=0),T=0,o=0,a=v,h=n,u=l,I=0,E=-1,x=1<<l,A=x-1,t===1&&x>852||t===2&&x>592)return 1;for(;;){Ee=a-I,c[o]+1<k?(W=0,Q=c[o]):c[o]>=k?(W=L[c[o]-k],Q=S[c[o]-k]):(W=96,Q=0),g=1<<a-I,d=1<<u,v=d;do d-=g,s[h+(T>>I)+d]=Ee<<24|W<<16|Q|0;while(d!==0);for(g=1<<a-1;T&g;)g>>=1;if(g!==0?(T&=g-1,T+=g):T=0,o++,--b[a]===0){if(a===w)break;a=i[e+c[o]]}if(a>l&&(T&A)!==E){for(I===0&&(I=l),h+=v,u=a-I,p=1<<u;u+I<w&&(p-=b[u+I],!(p<=0));)u++,p<<=1;if(x+=1<<u,t===1&&x>852||t===2&&x>592)return 1;E=T&A,s[E]=l<<24|u<<16|h-n|0}}return T!==0&&(s[h+T]=a-I<<24|64<<16|0),f.bits=l,0};Ne.exports=Kt});var J=R((Fi,Ze)=>{"use strict";Ze.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var bt=R((Vi,O)=>{"use strict";var he=Ie(),M=De(),jt=Oe(),X=Me(),Wt=0,st=1,ft=2,{Z_FINISH:Be,Z_BLOCK:Qt,Z_TREES:$,Z_OK:P,Z_STREAM_END:Jt,Z_NEED_DICT:$t,Z_STREAM_ERROR:U,Z_DATA_ERROR:lt,Z_MEM_ERROR:ue,Z_BUF_ERROR:ei,Z_DEFLATED:Ce}=J(),ne=16180,Le=16181,Pe=16182,ze=16183,He=16184,Fe=16185,Ve=16186,Ge=16187,Ye=16188,Xe=16189,ie=16190,Z=16191,se=16192,qe=16193,fe=16194,Ke=16195,je=16196,We=16197,Qe=16198,ee=16199,te=16200,Je=16201,$e=16202,et=16203,tt=16204,it=16205,le=16206,nt=16207,rt=16208,y=16209,we=16210,ct=16211,ti=852,ii=592,ni=15,ri=ni,at=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function ai(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var z=t=>{if(!t)return 1;let i=t.state;return!i||i.strm!==t||i.mode<ne||i.mode>ct?1:0},dt=t=>{if(z(t))return U;let i=t.state;return t.total_in=t.total_out=i.total=0,t.msg="",i.wrap&&(t.adler=i.wrap&1),i.mode=ne,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(ti),i.distcode=i.distdyn=new Int32Array(ii),i.sane=1,i.back=-1,P},ht=t=>{if(z(t))return U;let i=t.state;return i.wsize=0,i.whave=0,i.wnext=0,dt(t)},ut=(t,i)=>{let e;if(z(t))return U;let r=t.state;return i<0?(e=0,i=-i):(e=(i>>4)+5,i<48&&(i&=15)),i&&(i<8||i>15)?U:(r.window!==null&&r.wbits!==i&&(r.window=null),r.wrap=e,r.wbits=i,ht(t))},wt=(t,i)=>{if(!t)return U;let e=new ai;t.state=e,e.strm=t,e.window=null,e.mode=ne;let r=ut(t,i);return r!==P&&(t.state=null),r},oi=t=>wt(t,ri),ot=!0,ce,de,si=t=>{if(ot){ce=new Int32Array(512),de=new Int32Array(32);let i=0;for(;i<144;)t.lens[i++]=8;for(;i<256;)t.lens[i++]=9;for(;i<280;)t.lens[i++]=7;for(;i<288;)t.lens[i++]=8;for(X(st,t.lens,0,288,ce,0,t.work,{bits:9}),i=0;i<32;)t.lens[i++]=5;X(ft,t.lens,0,32,de,0,t.work,{bits:5}),ot=!1}t.lencode=ce,t.lenbits=9,t.distcode=de,t.distbits=5},xt=(t,i,e,r)=>{let s,n=t.state;return n.window===null&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),r>=n.wsize?(n.window.set(i.subarray(e-n.wsize,e),0),n.wnext=0,n.whave=n.wsize):(s=n.wsize-n.wnext,s>r&&(s=r),n.window.set(i.subarray(e-r,e-r+s),n.wnext),r-=s,r?(n.window.set(i.subarray(e-r,e),0),n.wnext=r,n.whave=n.wsize):(n.wnext+=s,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=s))),0},fi=(t,i)=>{let e,r,s,n,c,f,_,a,o,v,w,l,u,I,p=0,x,T,g,d,E,A,h,S,k=new Uint8Array(4),b,m,L=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(z(t)||!t.output||!t.input&&t.avail_in!==0)return U;e=t.state,e.mode===Z&&(e.mode=se),c=t.next_out,s=t.output,_=t.avail_out,n=t.next_in,r=t.input,f=t.avail_in,a=e.hold,o=e.bits,v=f,w=_,S=P;e:for(;;)switch(e.mode){case ne:if(e.wrap===0){e.mode=se;break}for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.wrap&2&&a===35615){e.wbits===0&&(e.wbits=15),e.check=0,k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0),a=0,o=0,e.mode=Le;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((a&255)<<8)+(a>>8))%31){t.msg="incorrect header check",e.mode=y;break}if((a&15)!==Ce){t.msg="unknown compression method",e.mode=y;break}if(a>>>=4,o-=4,h=(a&15)+8,e.wbits===0&&(e.wbits=h),h>15||h>e.wbits){t.msg="invalid window size",e.mode=y;break}e.dmax=1<<e.wbits,e.flags=0,t.adler=e.check=1,e.mode=a&512?Xe:Z,a=0,o=0;break;case Le:for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.flags=a,(e.flags&255)!==Ce){t.msg="unknown compression method",e.mode=y;break}if(e.flags&57344){t.msg="unknown header flags set",e.mode=y;break}e.head&&(e.head.text=a>>8&1),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0,e.mode=Pe;case Pe:for(;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.head&&(e.head.time=a),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,k[2]=a>>>16&255,k[3]=a>>>24&255,e.check=M(e.check,k,4,0)),a=0,o=0,e.mode=ze;case ze:for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.head&&(e.head.xflags=a&255,e.head.os=a>>8),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0,e.mode=He;case He:if(e.flags&1024){for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.length=a,e.head&&(e.head.extra_len=a),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0}else e.head&&(e.head.extra=null);e.mode=Fe;case Fe:if(e.flags&1024&&(l=e.length,l>f&&(l=f),l&&(e.head&&(h=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(r.subarray(n,n+l),h)),e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,e.length-=l),e.length))break e;e.length=0,e.mode=Ve;case Ve:if(e.flags&2048){if(f===0)break e;l=0;do h=r[n+l++],e.head&&h&&e.length<65536&&(e.head.name+=String.fromCharCode(h));while(h&&l<f);if(e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,h)break e}else e.head&&(e.head.name=null);e.length=0,e.mode=Ge;case Ge:if(e.flags&4096){if(f===0)break e;l=0;do h=r[n+l++],e.head&&h&&e.length<65536&&(e.head.comment+=String.fromCharCode(h));while(h&&l<f);if(e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,h)break e}else e.head&&(e.head.comment=null);e.mode=Ye;case Ye:if(e.flags&512){for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.wrap&4&&a!==(e.check&65535)){t.msg="header crc mismatch",e.mode=y;break}a=0,o=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),t.adler=e.check=0,e.mode=Z;break;case Xe:for(;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}t.adler=e.check=at(a),a=0,o=0,e.mode=ie;case ie:if(e.havedict===0)return t.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,$t;t.adler=e.check=1,e.mode=Z;case Z:if(i===Qt||i===$)break e;case se:if(e.last){a>>>=o&7,o-=o&7,e.mode=le;break}for(;o<3;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}switch(e.last=a&1,a>>>=1,o-=1,a&3){case 0:e.mode=qe;break;case 1:if(si(e),e.mode=ee,i===$){a>>>=2,o-=2;break e}break;case 2:e.mode=je;break;case 3:t.msg="invalid block type",e.mode=y}a>>>=2,o-=2;break;case qe:for(a>>>=o&7,o-=o&7;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if((a&65535)!==(a>>>16^65535)){t.msg="invalid stored block lengths",e.mode=y;break}if(e.length=a&65535,a=0,o=0,e.mode=fe,i===$)break e;case fe:e.mode=Ke;case Ke:if(l=e.length,l){if(l>f&&(l=f),l>_&&(l=_),l===0)break e;s.set(r.subarray(n,n+l),c),f-=l,n+=l,_-=l,c+=l,e.length-=l;break}e.mode=Z;break;case je:for(;o<14;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.nlen=(a&31)+257,a>>>=5,o-=5,e.ndist=(a&31)+1,a>>>=5,o-=5,e.ncode=(a&15)+4,a>>>=4,o-=4,e.nlen>286||e.ndist>30){t.msg="too many length or distance symbols",e.mode=y;break}e.have=0,e.mode=We;case We:for(;e.have<e.ncode;){for(;o<3;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.lens[L[e.have++]]=a&7,a>>>=3,o-=3}for(;e.have<19;)e.lens[L[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,b={bits:e.lenbits},S=X(Wt,e.lens,0,19,e.lencode,0,e.work,b),e.lenbits=b.bits,S){t.msg="invalid code lengths set",e.mode=y;break}e.have=0,e.mode=Qe;case Qe:for(;e.have<e.nlen+e.ndist;){for(;p=e.lencode[a&(1<<e.lenbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(g<16)a>>>=x,o-=x,e.lens[e.have++]=g;else{if(g===16){for(m=x+2;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(a>>>=x,o-=x,e.have===0){t.msg="invalid bit length repeat",e.mode=y;break}h=e.lens[e.have-1],l=3+(a&3),a>>>=2,o-=2}else if(g===17){for(m=x+3;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=x,o-=x,h=0,l=3+(a&7),a>>>=3,o-=3}else{for(m=x+7;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=x,o-=x,h=0,l=11+(a&127),a>>>=7,o-=7}if(e.have+l>e.nlen+e.ndist){t.msg="invalid bit length repeat",e.mode=y;break}for(;l--;)e.lens[e.have++]=h}}if(e.mode===y)break;if(e.lens[256]===0){t.msg="invalid code -- missing end-of-block",e.mode=y;break}if(e.lenbits=9,b={bits:e.lenbits},S=X(st,e.lens,0,e.nlen,e.lencode,0,e.work,b),e.lenbits=b.bits,S){t.msg="invalid literal/lengths set",e.mode=y;break}if(e.distbits=6,e.distcode=e.distdyn,b={bits:e.distbits},S=X(ft,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,b),e.distbits=b.bits,S){t.msg="invalid distances set",e.mode=y;break}if(e.mode=ee,i===$)break e;case ee:e.mode=te;case te:if(f>=6&&_>=258){t.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,jt(t,w),c=t.next_out,s=t.output,_=t.avail_out,n=t.next_in,r=t.input,f=t.avail_in,a=e.hold,o=e.bits,e.mode===Z&&(e.back=-1);break}for(e.back=0;p=e.lencode[a&(1<<e.lenbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(T&&!(T&240)){for(d=x,E=T,A=g;p=e.lencode[A+((a&(1<<d+E)-1)>>d)],x=p>>>24,T=p>>>16&255,g=p&65535,!(d+x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=d,o-=d,e.back+=d}if(a>>>=x,o-=x,e.back+=x,e.length=g,T===0){e.mode=it;break}if(T&32){e.back=-1,e.mode=Z;break}if(T&64){t.msg="invalid literal/length code",e.mode=y;break}e.extra=T&15,e.mode=Je;case Je:if(e.extra){for(m=e.extra;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.length+=a&(1<<e.extra)-1,a>>>=e.extra,o-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=$e;case $e:for(;p=e.distcode[a&(1<<e.distbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(!(T&240)){for(d=x,E=T,A=g;p=e.distcode[A+((a&(1<<d+E)-1)>>d)],x=p>>>24,T=p>>>16&255,g=p&65535,!(d+x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=d,o-=d,e.back+=d}if(a>>>=x,o-=x,e.back+=x,T&64){t.msg="invalid distance code",e.mode=y;break}e.offset=g,e.extra=T&15,e.mode=et;case et:if(e.extra){for(m=e.extra;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.offset+=a&(1<<e.extra)-1,a>>>=e.extra,o-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){t.msg="invalid distance too far back",e.mode=y;break}e.mode=tt;case tt:if(_===0)break e;if(l=w-_,e.offset>l){if(l=e.offset-l,l>e.whave&&e.sane){t.msg="invalid distance too far back",e.mode=y;break}l>e.wnext?(l-=e.wnext,u=e.wsize-l):u=e.wnext-l,l>e.length&&(l=e.length),I=e.window}else I=s,u=c-e.offset,l=e.length;l>_&&(l=_),_-=l,e.length-=l;do s[c++]=I[u++];while(--l);e.length===0&&(e.mode=te);break;case it:if(_===0)break e;s[c++]=e.length,_--,e.mode=te;break;case le:if(e.wrap){for(;o<32;){if(f===0)break e;f--,a|=r[n++]<<o,o+=8}if(w-=_,t.total_out+=w,e.total+=w,e.wrap&4&&w&&(t.adler=e.check=e.flags?M(e.check,s,w,c-w):he(e.check,s,w,c-w)),w=_,e.wrap&4&&(e.flags?a:at(a))!==e.check){t.msg="incorrect data check",e.mode=y;break}a=0,o=0}e.mode=nt;case nt:if(e.wrap&&e.flags){for(;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.wrap&4&&a!==(e.total&4294967295)){t.msg="incorrect length check",e.mode=y;break}a=0,o=0}e.mode=rt;case rt:S=Jt;break e;case y:S=lt;break e;case we:return ue;case ct:default:return U}return t.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,(e.wsize||w!==t.avail_out&&e.mode<y&&(e.mode<le||i!==Be))&&xt(t,t.output,t.next_out,w-t.avail_out)?(e.mode=we,ue):(v-=t.avail_in,w-=t.avail_out,t.total_in+=v,t.total_out+=w,e.total+=w,e.wrap&4&&w&&(t.adler=e.check=e.flags?M(e.check,s,w,t.next_out-w):he(e.check,s,w,t.next_out-w)),t.data_type=e.bits+(e.last?64:0)+(e.mode===Z?128:0)+(e.mode===ee||e.mode===fe?256:0),(v===0&&w===0||i===Be)&&S===P&&(S=ei),S)},li=t=>{if(z(t))return U;let i=t.state;return i.window&&(i.window=null),t.state=null,P},ci=(t,i)=>{if(z(t))return U;let e=t.state;return e.wrap&2?(e.head=i,i.done=!1,P):U},di=(t,i)=>{let e=i.length,r,s,n;return z(t)||(r=t.state,r.wrap!==0&&r.mode!==ie)?U:r.mode===ie&&(s=1,s=he(s,i,e,0),s!==r.check)?lt:(n=xt(t,i,e,e),n?(r.mode=we,ue):(r.havedict=1,P))};O.exports.inflateReset=ht;O.exports.inflateReset2=ut;O.exports.inflateResetKeep=dt;O.exports.inflateInit=oi;O.exports.inflateInit2=wt;O.exports.inflate=fi;O.exports.inflateEnd=li;O.exports.inflateGetHeader=ci;O.exports.inflateSetDictionary=di;O.exports.inflateInfo="pako inflate (from Nodeca project)"});var _t=R((Gi,xe)=>{"use strict";var hi=(t,i)=>Object.prototype.hasOwnProperty.call(t,i);xe.exports.assign=function(t){let i=Array.prototype.slice.call(arguments,1);for(;i.length;){let e=i.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(let r in e)hi(e,r)&&(t[r]=e[r])}}return t};xe.exports.flattenChunks=t=>{let i=0;for(let r=0,s=t.length;r<s;r++)i+=t[r].length;let e=new Uint8Array(i);for(let r=0,s=0,n=t.length;r<n;r++){let c=t[r];e.set(c,s),s+=c.length}return e}});var kt=R((Yi,re)=>{"use strict";var gt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{gt=!1}var q=new Uint8Array(256);for(let t=0;t<256;t++)q[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;q[254]=q[254]=1;re.exports.string2buf=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let i,e,r,s,n,c=t.length,f=0;for(s=0;s<c;s++)e=t.charCodeAt(s),(e&64512)===55296&&s+1<c&&(r=t.charCodeAt(s+1),(r&64512)===56320&&(e=65536+(e-55296<<10)+(r-56320),s++)),f+=e<128?1:e<2048?2:e<65536?3:4;for(i=new Uint8Array(f),n=0,s=0;n<f;s++)e=t.charCodeAt(s),(e&64512)===55296&&s+1<c&&(r=t.charCodeAt(s+1),(r&64512)===56320&&(e=65536+(e-55296<<10)+(r-56320),s++)),e<128?i[n++]=e:e<2048?(i[n++]=192|e>>>6,i[n++]=128|e&63):e<65536?(i[n++]=224|e>>>12,i[n++]=128|e>>>6&63,i[n++]=128|e&63):(i[n++]=240|e>>>18,i[n++]=128|e>>>12&63,i[n++]=128|e>>>6&63,i[n++]=128|e&63);return i};var ui=(t,i)=>{if(i<65534&&t.subarray&>)return String.fromCharCode.apply(null,t.length===i?t:t.subarray(0,i));let e="";for(let r=0;r<i;r++)e+=String.fromCharCode(t[r]);return e};re.exports.buf2string=(t,i)=>{let e=i||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,i));let r,s,n=new Array(e*2);for(s=0,r=0;r<e;){let c=t[r++];if(c<128){n[s++]=c;continue}let f=q[c];if(f>4){n[s++]=65533,r+=f-1;continue}for(c&=f===2?31:f===3?15:7;f>1&&r<e;)c=c<<6|t[r++]&63,f--;if(f>1){n[s++]=65533;continue}c<65536?n[s++]=c:(c-=65536,n[s++]=55296|c>>10&1023,n[s++]=56320|c&1023)}return ui(n,s)};re.exports.utf8border=(t,i)=>{i=i||t.length,i>t.length&&(i=t.length);let e=i-1;for(;e>=0&&(t[e]&192)===128;)e--;return e<0||e===0?i:e+q[t[e]]>i?e:i}});var Et=R((Xi,pt)=>{"use strict";pt.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var St=R((qi,mt)=>{"use strict";function wi(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}mt.exports=wi});var vt=R((Ki,Tt)=>{"use strict";function xi(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Tt.exports=xi});var Rt=R((ji,V)=>{"use strict";var B=bt(),At=_t(),ge=kt(),ke=Et(),bi=St(),_i=vt(),It=Object.prototype.toString,{Z_NO_FLUSH:gi,Z_FINISH:ki,Z_OK:K,Z_STREAM_END:be,Z_NEED_DICT:_e,Z_STREAM_ERROR:pi,Z_DATA_ERROR:yt,Z_MEM_ERROR:Ei}=J();function j(t){this.options=At.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(t&&t.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15||(i.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bi,this.strm.avail_out=0;let e=B.inflateInit2(this.strm,i.windowBits);if(e!==K)throw new Error(ke[e]);if(this.header=new _i,B.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=ge.string2buf(i.dictionary):It.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(e=B.inflateSetDictionary(this.strm,i.dictionary),e!==K)))throw new Error(ke[e])}j.prototype.push=function(t,i){let e=this.strm,r=this.options.chunkSize,s=this.options.dictionary,n,c,f;if(this.ended)return!1;for(i===~~i?c=i:c=i===!0?ki:gi,It.call(t)==="[object ArrayBuffer]"?e.input=new Uint8Array(t):e.input=t,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(r),e.next_out=0,e.avail_out=r),n=B.inflate(e,c),n===_e&&s&&(n=B.inflateSetDictionary(e,s),n===K?n=B.inflate(e,c):n===yt&&(n=_e));e.avail_in>0&&n===be&&e.state.wrap>0&&t[e.next_in]!==0;)B.inflateReset(e),n=B.inflate(e,c);switch(n){case pi:case yt:case _e:case Ei:return this.onEnd(n),this.ended=!0,!1}if(f=e.avail_out,e.next_out&&(e.avail_out===0||n===be))if(this.options.to==="string"){let _=ge.utf8border(e.output,e.next_out),a=e.next_out-_,o=ge.buf2string(e.output,_);e.next_out=a,e.avail_out=r-a,a&&e.output.set(e.output.subarray(_,_+a),0),this.onData(o)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(n===K&&f===0)){if(n===be)return n=B.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};j.prototype.onData=function(t){this.chunks.push(t)};j.prototype.onEnd=function(t){t===K&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=At.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function pe(t,i){let e=new j(i);if(e.push(t),e.err)throw e.msg||ke[e.err];return e.result}function mi(t,i){return i=i||{},i.raw=!0,pe(t,i)}V.exports.Inflate=j;V.exports.inflate=pe;V.exports.inflateRaw=mi;V.exports.ungzip=pe;V.exports.constants=J()});var Nt=1953029805,Mt=2917034100;function oe(t,i){if(oe.passThroughDataForTesting)return i;ae.typeOf.object("key",t),ae.typeOf.object("data",i);let e=t.byteLength;if(e===0||e%4!==0)throw new D("The length of key must be greater than 0 and a multiple of 4.");let r=new DataView(i),s=r.getUint32(0,!0);if(s===Nt||s===Mt)return i;let n=new DataView(t),c=0,f=i.byteLength,_=f-f%8,a=e,o,v=8;for(;c<_;)for(v=(v+8)%24,o=v;c<_&&o<a;)r.setUint32(c,r.getUint32(c,!0)^n.getUint32(o,!0),!0),r.setUint32(c+4,r.getUint32(c+4,!0)^n.getUint32(o+4,!0),!0),c+=8,o+=24;if(c<f)for(o>=a&&(v=(v+8)%24,o=v);c<f;)r.setUint8(c,r.getUint8(c)^n.getUint8(o)),c++,o++}oe.passThroughDataForTesting=!1;var Te=oe;function Zt(t,i){return(t&i)!==0}var F=Zt;var Bt=[1,2,4,8],ve=15,Ct=16,Lt=64,Pt=128;function N(t,i,e,r,s,n){this._bits=t,this.cnodeVersion=i,this.imageryVersion=e,this.terrainVersion=r,this.imageryProvider=s,this.terrainProvider=n,this.ancestorHasTerrain=!1,this.terrainState=void 0}N.clone=function(t,i){return me(i)?(i._bits=t._bits,i.cnodeVersion=t.cnodeVersion,i.imageryVersion=t.imageryVersion,i.terrainVersion=t.terrainVersion,i.imageryProvider=t.imageryProvider,i.terrainProvider=t.terrainProvider):i=new N(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),i.ancestorHasTerrain=t.ancestorHasTerrain,i.terrainState=t.terrainState,i};N.prototype.setParent=function(t){this.ancestorHasTerrain=t.ancestorHasTerrain||this.hasTerrain()};N.prototype.hasSubtree=function(){return F(this._bits,Ct)};N.prototype.hasImagery=function(){return F(this._bits,Lt)};N.prototype.hasTerrain=function(){return F(this._bits,Pt)};N.prototype.hasChildren=function(){return F(this._bits,ve)};N.prototype.hasChild=function(t){return F(this._bits,Bt[t])};N.prototype.getChildBitmask=function(){return this._bits&ve};var ye=N;var Ut=Ot(Rt(),1);var G=Uint16Array.BYTES_PER_ELEMENT,H=Int32Array.BYTES_PER_ELEMENT,Y=Uint32Array.BYTES_PER_ELEMENT,C={METADATA:0,TERRAIN:1,DBROOT:2};C.fromString=function(t){if(t==="Metadata")return C.METADATA;if(t==="Terrain")return C.TERRAIN;if(t==="DbRoot")return C.DBROOT};function Si(t,i){let e=C.fromString(t.type),r=t.buffer;Te(t.key,r);let s=Di(r);r=s.buffer;let n=s.length;switch(e){case C.METADATA:return vi(r,n,t.quadKey);case C.TERRAIN:return Ii(r,n,i);case C.DBROOT:return i.push(r),{buffer:r}}}var Ti=32301;function vi(t,i,e){let r=new DataView(t),s=0,n=r.getUint32(s,!0);if(s+=Y,n!==Ti)throw new D("Invalid magic");let c=r.getUint32(s,!0);if(s+=Y,c!==1)throw new D("Invalid data type. Must be 1 for QuadTreePacket");let f=r.getUint32(s,!0);if(s+=Y,f!==2)throw new D("Invalid QuadTreePacket version. Only version 2 is supported.");let _=r.getInt32(s,!0);s+=H;let a=r.getInt32(s,!0);if(s+=H,a!==32)throw new D("Invalid instance size.");let o=r.getInt32(s,!0);s+=H;let v=r.getInt32(s,!0);s+=H;let w=r.getInt32(s,!0);if(s+=H,o!==_*a+s)throw new D("Invalid dataBufferOffset");if(o+v+w!==i)throw new D("Invalid packet offsets");let l=[];for(let g=0;g<_;++g){let d=r.getUint8(s);++s,++s;let E=r.getUint16(s,!0);s+=G;let A=r.getUint16(s,!0);s+=G;let h=r.getUint16(s,!0);s+=G,s+=G,s+=G,s+=H,s+=H,s+=8;let S=r.getUint8(s++),k=r.getUint8(s++);s+=G,l.push(new ye(d,E,A,h,S,k))}let u=[],I=0;function p(g,d,E){let A=!1;if(E===4){if(d.hasSubtree())return;A=!0}for(let h=0;h<4;++h){let S=g+h.toString();if(A)u[S]=null;else if(E<4)if(!d.hasChild(h))u[S]=null;else{if(I===_){console.log("Incorrect number of instances");return}let k=l[I++];u[S]=k,p(S,k,E+1)}}}let x=0,T=l[I++];return e===""?++x:u[e]=T,p(e,T,x),u}var yi=5,Ai=4;function Ii(t,i,e){let r=new DataView(t),s=function(f){for(let _=0;_<Ai;++_){let a=r.getUint32(f,!0);if(f+=Y,f+=a,f>i)throw new D("Malformed terrain packet found.")}return f},n=0,c=[];for(;c.length<yi;){let f=n;n=s(n);let _=t.slice(f,n);e.push(_),c.push(_)}return c}var Dt=1953029805,Ri=2917034100;function Di(t){let i=new DataView(t),e=0,r=i.getUint32(e,!0);if(e+=Y,r!==Dt&&r!==Ri)throw new D("Invalid magic");let s=i.getUint32(e,r===Dt);e+=Y;let n=new Uint8Array(t,e),c=Ut.default.inflate(n);if(c.length!==s)throw new D("Size of packet doesn't match header");return c}var en=Se(Si);export{en as default}; +import{a as Se}from"./chunk-4E3APMCC.js";import{a as D}from"./chunk-UAWOHN7R.js";import{b as ae}from"./chunk-RTY3VPG6.js";import{c as R,d as Ot,e as me}from"./chunk-LRNH5AEO.js";var Ie=R((Li,Ae)=>{"use strict";var zt=(t,i,e,r)=>{let s=t&65535|0,n=t>>>16&65535|0,c=0;for(;e!==0;){c=e>2e3?2e3:e,e-=c;do s=s+i[r++]|0,n=n+s|0;while(--c);s%=65521,n%=65521}return s|n<<16|0};Ae.exports=zt});var De=R((Pi,Re)=>{"use strict";var Ht=()=>{let t,i=[];for(var e=0;e<256;e++){t=e;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;i[e]=t}return i},Ft=new Uint32Array(Ht()),Vt=(t,i,e,r)=>{let s=Ft,n=r+e;t^=-1;for(let c=r;c<n;c++)t=t>>>8^s[(t^i[c])&255];return t^-1};Re.exports=Vt});var Oe=R((zi,Ue)=>{"use strict";Ue.exports=function(i,e){let r,s,n,c,f,_,a,o,v,w,l,u,I,p,x,T,g,d,E,A,h,S,k,b,m=i.state;r=i.next_in,k=i.input,s=r+(i.avail_in-5),n=i.next_out,b=i.output,c=n-(e-i.avail_out),f=n+(i.avail_out-257),_=m.dmax,a=m.wsize,o=m.whave,v=m.wnext,w=m.window,l=m.hold,u=m.bits,I=m.lencode,p=m.distcode,x=(1<<m.lenbits)-1,T=(1<<m.distbits)-1;e:do{u<15&&(l+=k[r++]<<u,u+=8,l+=k[r++]<<u,u+=8),g=I[l&x];t:for(;;){if(d=g>>>24,l>>>=d,u-=d,d=g>>>16&255,d===0)b[n++]=g&65535;else if(d&16){E=g&65535,d&=15,d&&(u<d&&(l+=k[r++]<<u,u+=8),E+=l&(1<<d)-1,l>>>=d,u-=d),u<15&&(l+=k[r++]<<u,u+=8,l+=k[r++]<<u,u+=8),g=p[l&T];i:for(;;){if(d=g>>>24,l>>>=d,u-=d,d=g>>>16&255,d&16){if(A=g&65535,d&=15,u<d&&(l+=k[r++]<<u,u+=8,u<d&&(l+=k[r++]<<u,u+=8)),A+=l&(1<<d)-1,A>_){i.msg="invalid distance too far back",m.mode=16209;break e}if(l>>>=d,u-=d,d=n-c,A>d){if(d=A-d,d>o&&m.sane){i.msg="invalid distance too far back",m.mode=16209;break e}if(h=0,S=w,v===0){if(h+=a-d,d<E){E-=d;do b[n++]=w[h++];while(--d);h=n-A,S=b}}else if(v<d){if(h+=a+v-d,d-=v,d<E){E-=d;do b[n++]=w[h++];while(--d);if(h=0,v<E){d=v,E-=d;do b[n++]=w[h++];while(--d);h=n-A,S=b}}}else if(h+=v-d,d<E){E-=d;do b[n++]=w[h++];while(--d);h=n-A,S=b}for(;E>2;)b[n++]=S[h++],b[n++]=S[h++],b[n++]=S[h++],E-=3;E&&(b[n++]=S[h++],E>1&&(b[n++]=S[h++]))}else{h=n-A;do b[n++]=b[h++],b[n++]=b[h++],b[n++]=b[h++],E-=3;while(E>2);E&&(b[n++]=b[h++],E>1&&(b[n++]=b[h++]))}}else if(d&64){i.msg="invalid distance code",m.mode=16209;break e}else{g=p[(g&65535)+(l&(1<<d)-1)];continue i}break}}else if(d&64)if(d&32){m.mode=16191;break e}else{i.msg="invalid literal/length code",m.mode=16209;break e}else{g=I[(g&65535)+(l&(1<<d)-1)];continue t}break}}while(r<s&&n<f);E=u>>3,r-=E,u-=E<<3,l&=(1<<u)-1,i.next_in=r,i.next_out=n,i.avail_in=r<s?5+(s-r):5-(r-s),i.avail_out=n<f?257+(f-n):257-(n-f),m.hold=l,m.bits=u}});var Me=R((Hi,Ne)=>{"use strict";var Gt=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Yt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Xt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),qt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Kt=(t,i,e,r,s,n,c,f)=>{let _=f.bits,a=0,o=0,v=0,w=0,l=0,u=0,I=0,p=0,x=0,T=0,g,d,E,A,h,S=null,k,b=new Uint16Array(16),m=new Uint16Array(16),L=null,Ee,W,Q;for(a=0;a<=15;a++)b[a]=0;for(o=0;o<r;o++)b[i[e+o]]++;for(l=_,w=15;w>=1&&b[w]===0;w--);if(l>w&&(l=w),w===0)return s[n++]=1<<24|64<<16|0,s[n++]=1<<24|64<<16|0,f.bits=1,0;for(v=1;v<w&&b[v]===0;v++);for(l<v&&(l=v),p=1,a=1;a<=15;a++)if(p<<=1,p-=b[a],p<0)return-1;if(p>0&&(t===0||w!==1))return-1;for(m[1]=0,a=1;a<15;a++)m[a+1]=m[a]+b[a];for(o=0;o<r;o++)i[e+o]!==0&&(c[m[i[e+o]]++]=o);if(t===0?(S=L=c,k=20):t===1?(S=Gt,L=Yt,k=257):(S=Xt,L=qt,k=0),T=0,o=0,a=v,h=n,u=l,I=0,E=-1,x=1<<l,A=x-1,t===1&&x>852||t===2&&x>592)return 1;for(;;){Ee=a-I,c[o]+1<k?(W=0,Q=c[o]):c[o]>=k?(W=L[c[o]-k],Q=S[c[o]-k]):(W=96,Q=0),g=1<<a-I,d=1<<u,v=d;do d-=g,s[h+(T>>I)+d]=Ee<<24|W<<16|Q|0;while(d!==0);for(g=1<<a-1;T&g;)g>>=1;if(g!==0?(T&=g-1,T+=g):T=0,o++,--b[a]===0){if(a===w)break;a=i[e+c[o]]}if(a>l&&(T&A)!==E){for(I===0&&(I=l),h+=v,u=a-I,p=1<<u;u+I<w&&(p-=b[u+I],!(p<=0));)u++,p<<=1;if(x+=1<<u,t===1&&x>852||t===2&&x>592)return 1;E=T&A,s[E]=l<<24|u<<16|h-n|0}}return T!==0&&(s[h+T]=a-I<<24|64<<16|0),f.bits=l,0};Ne.exports=Kt});var J=R((Fi,Ze)=>{"use strict";Ze.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var bt=R((Vi,O)=>{"use strict";var he=Ie(),M=De(),jt=Oe(),X=Me(),Wt=0,st=1,ft=2,{Z_FINISH:Be,Z_BLOCK:Qt,Z_TREES:$,Z_OK:P,Z_STREAM_END:Jt,Z_NEED_DICT:$t,Z_STREAM_ERROR:U,Z_DATA_ERROR:lt,Z_MEM_ERROR:ue,Z_BUF_ERROR:ei,Z_DEFLATED:Ce}=J(),ne=16180,Le=16181,Pe=16182,ze=16183,He=16184,Fe=16185,Ve=16186,Ge=16187,Ye=16188,Xe=16189,ie=16190,Z=16191,se=16192,qe=16193,fe=16194,Ke=16195,je=16196,We=16197,Qe=16198,ee=16199,te=16200,Je=16201,$e=16202,et=16203,tt=16204,it=16205,le=16206,nt=16207,rt=16208,y=16209,we=16210,ct=16211,ti=852,ii=592,ni=15,ri=ni,at=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function ai(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var z=t=>{if(!t)return 1;let i=t.state;return!i||i.strm!==t||i.mode<ne||i.mode>ct?1:0},dt=t=>{if(z(t))return U;let i=t.state;return t.total_in=t.total_out=i.total=0,t.msg="",i.wrap&&(t.adler=i.wrap&1),i.mode=ne,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(ti),i.distcode=i.distdyn=new Int32Array(ii),i.sane=1,i.back=-1,P},ht=t=>{if(z(t))return U;let i=t.state;return i.wsize=0,i.whave=0,i.wnext=0,dt(t)},ut=(t,i)=>{let e;if(z(t))return U;let r=t.state;return i<0?(e=0,i=-i):(e=(i>>4)+5,i<48&&(i&=15)),i&&(i<8||i>15)?U:(r.window!==null&&r.wbits!==i&&(r.window=null),r.wrap=e,r.wbits=i,ht(t))},wt=(t,i)=>{if(!t)return U;let e=new ai;t.state=e,e.strm=t,e.window=null,e.mode=ne;let r=ut(t,i);return r!==P&&(t.state=null),r},oi=t=>wt(t,ri),ot=!0,ce,de,si=t=>{if(ot){ce=new Int32Array(512),de=new Int32Array(32);let i=0;for(;i<144;)t.lens[i++]=8;for(;i<256;)t.lens[i++]=9;for(;i<280;)t.lens[i++]=7;for(;i<288;)t.lens[i++]=8;for(X(st,t.lens,0,288,ce,0,t.work,{bits:9}),i=0;i<32;)t.lens[i++]=5;X(ft,t.lens,0,32,de,0,t.work,{bits:5}),ot=!1}t.lencode=ce,t.lenbits=9,t.distcode=de,t.distbits=5},xt=(t,i,e,r)=>{let s,n=t.state;return n.window===null&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),r>=n.wsize?(n.window.set(i.subarray(e-n.wsize,e),0),n.wnext=0,n.whave=n.wsize):(s=n.wsize-n.wnext,s>r&&(s=r),n.window.set(i.subarray(e-r,e-r+s),n.wnext),r-=s,r?(n.window.set(i.subarray(e-r,e),0),n.wnext=r,n.whave=n.wsize):(n.wnext+=s,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=s))),0},fi=(t,i)=>{let e,r,s,n,c,f,_,a,o,v,w,l,u,I,p=0,x,T,g,d,E,A,h,S,k=new Uint8Array(4),b,m,L=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(z(t)||!t.output||!t.input&&t.avail_in!==0)return U;e=t.state,e.mode===Z&&(e.mode=se),c=t.next_out,s=t.output,_=t.avail_out,n=t.next_in,r=t.input,f=t.avail_in,a=e.hold,o=e.bits,v=f,w=_,S=P;e:for(;;)switch(e.mode){case ne:if(e.wrap===0){e.mode=se;break}for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.wrap&2&&a===35615){e.wbits===0&&(e.wbits=15),e.check=0,k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0),a=0,o=0,e.mode=Le;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((a&255)<<8)+(a>>8))%31){t.msg="incorrect header check",e.mode=y;break}if((a&15)!==Ce){t.msg="unknown compression method",e.mode=y;break}if(a>>>=4,o-=4,h=(a&15)+8,e.wbits===0&&(e.wbits=h),h>15||h>e.wbits){t.msg="invalid window size",e.mode=y;break}e.dmax=1<<e.wbits,e.flags=0,t.adler=e.check=1,e.mode=a&512?Xe:Z,a=0,o=0;break;case Le:for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.flags=a,(e.flags&255)!==Ce){t.msg="unknown compression method",e.mode=y;break}if(e.flags&57344){t.msg="unknown header flags set",e.mode=y;break}e.head&&(e.head.text=a>>8&1),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0,e.mode=Pe;case Pe:for(;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.head&&(e.head.time=a),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,k[2]=a>>>16&255,k[3]=a>>>24&255,e.check=M(e.check,k,4,0)),a=0,o=0,e.mode=ze;case ze:for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.head&&(e.head.xflags=a&255,e.head.os=a>>8),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0,e.mode=He;case He:if(e.flags&1024){for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.length=a,e.head&&(e.head.extra_len=a),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0}else e.head&&(e.head.extra=null);e.mode=Fe;case Fe:if(e.flags&1024&&(l=e.length,l>f&&(l=f),l&&(e.head&&(h=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(r.subarray(n,n+l),h)),e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,e.length-=l),e.length))break e;e.length=0,e.mode=Ve;case Ve:if(e.flags&2048){if(f===0)break e;l=0;do h=r[n+l++],e.head&&h&&e.length<65536&&(e.head.name+=String.fromCharCode(h));while(h&&l<f);if(e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,h)break e}else e.head&&(e.head.name=null);e.length=0,e.mode=Ge;case Ge:if(e.flags&4096){if(f===0)break e;l=0;do h=r[n+l++],e.head&&h&&e.length<65536&&(e.head.comment+=String.fromCharCode(h));while(h&&l<f);if(e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,h)break e}else e.head&&(e.head.comment=null);e.mode=Ye;case Ye:if(e.flags&512){for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.wrap&4&&a!==(e.check&65535)){t.msg="header crc mismatch",e.mode=y;break}a=0,o=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),t.adler=e.check=0,e.mode=Z;break;case Xe:for(;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}t.adler=e.check=at(a),a=0,o=0,e.mode=ie;case ie:if(e.havedict===0)return t.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,$t;t.adler=e.check=1,e.mode=Z;case Z:if(i===Qt||i===$)break e;case se:if(e.last){a>>>=o&7,o-=o&7,e.mode=le;break}for(;o<3;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}switch(e.last=a&1,a>>>=1,o-=1,a&3){case 0:e.mode=qe;break;case 1:if(si(e),e.mode=ee,i===$){a>>>=2,o-=2;break e}break;case 2:e.mode=je;break;case 3:t.msg="invalid block type",e.mode=y}a>>>=2,o-=2;break;case qe:for(a>>>=o&7,o-=o&7;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if((a&65535)!==(a>>>16^65535)){t.msg="invalid stored block lengths",e.mode=y;break}if(e.length=a&65535,a=0,o=0,e.mode=fe,i===$)break e;case fe:e.mode=Ke;case Ke:if(l=e.length,l){if(l>f&&(l=f),l>_&&(l=_),l===0)break e;s.set(r.subarray(n,n+l),c),f-=l,n+=l,_-=l,c+=l,e.length-=l;break}e.mode=Z;break;case je:for(;o<14;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.nlen=(a&31)+257,a>>>=5,o-=5,e.ndist=(a&31)+1,a>>>=5,o-=5,e.ncode=(a&15)+4,a>>>=4,o-=4,e.nlen>286||e.ndist>30){t.msg="too many length or distance symbols",e.mode=y;break}e.have=0,e.mode=We;case We:for(;e.have<e.ncode;){for(;o<3;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.lens[L[e.have++]]=a&7,a>>>=3,o-=3}for(;e.have<19;)e.lens[L[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,b={bits:e.lenbits},S=X(Wt,e.lens,0,19,e.lencode,0,e.work,b),e.lenbits=b.bits,S){t.msg="invalid code lengths set",e.mode=y;break}e.have=0,e.mode=Qe;case Qe:for(;e.have<e.nlen+e.ndist;){for(;p=e.lencode[a&(1<<e.lenbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(g<16)a>>>=x,o-=x,e.lens[e.have++]=g;else{if(g===16){for(m=x+2;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(a>>>=x,o-=x,e.have===0){t.msg="invalid bit length repeat",e.mode=y;break}h=e.lens[e.have-1],l=3+(a&3),a>>>=2,o-=2}else if(g===17){for(m=x+3;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=x,o-=x,h=0,l=3+(a&7),a>>>=3,o-=3}else{for(m=x+7;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=x,o-=x,h=0,l=11+(a&127),a>>>=7,o-=7}if(e.have+l>e.nlen+e.ndist){t.msg="invalid bit length repeat",e.mode=y;break}for(;l--;)e.lens[e.have++]=h}}if(e.mode===y)break;if(e.lens[256]===0){t.msg="invalid code -- missing end-of-block",e.mode=y;break}if(e.lenbits=9,b={bits:e.lenbits},S=X(st,e.lens,0,e.nlen,e.lencode,0,e.work,b),e.lenbits=b.bits,S){t.msg="invalid literal/lengths set",e.mode=y;break}if(e.distbits=6,e.distcode=e.distdyn,b={bits:e.distbits},S=X(ft,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,b),e.distbits=b.bits,S){t.msg="invalid distances set",e.mode=y;break}if(e.mode=ee,i===$)break e;case ee:e.mode=te;case te:if(f>=6&&_>=258){t.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,jt(t,w),c=t.next_out,s=t.output,_=t.avail_out,n=t.next_in,r=t.input,f=t.avail_in,a=e.hold,o=e.bits,e.mode===Z&&(e.back=-1);break}for(e.back=0;p=e.lencode[a&(1<<e.lenbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(T&&!(T&240)){for(d=x,E=T,A=g;p=e.lencode[A+((a&(1<<d+E)-1)>>d)],x=p>>>24,T=p>>>16&255,g=p&65535,!(d+x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=d,o-=d,e.back+=d}if(a>>>=x,o-=x,e.back+=x,e.length=g,T===0){e.mode=it;break}if(T&32){e.back=-1,e.mode=Z;break}if(T&64){t.msg="invalid literal/length code",e.mode=y;break}e.extra=T&15,e.mode=Je;case Je:if(e.extra){for(m=e.extra;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.length+=a&(1<<e.extra)-1,a>>>=e.extra,o-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=$e;case $e:for(;p=e.distcode[a&(1<<e.distbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(!(T&240)){for(d=x,E=T,A=g;p=e.distcode[A+((a&(1<<d+E)-1)>>d)],x=p>>>24,T=p>>>16&255,g=p&65535,!(d+x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=d,o-=d,e.back+=d}if(a>>>=x,o-=x,e.back+=x,T&64){t.msg="invalid distance code",e.mode=y;break}e.offset=g,e.extra=T&15,e.mode=et;case et:if(e.extra){for(m=e.extra;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.offset+=a&(1<<e.extra)-1,a>>>=e.extra,o-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){t.msg="invalid distance too far back",e.mode=y;break}e.mode=tt;case tt:if(_===0)break e;if(l=w-_,e.offset>l){if(l=e.offset-l,l>e.whave&&e.sane){t.msg="invalid distance too far back",e.mode=y;break}l>e.wnext?(l-=e.wnext,u=e.wsize-l):u=e.wnext-l,l>e.length&&(l=e.length),I=e.window}else I=s,u=c-e.offset,l=e.length;l>_&&(l=_),_-=l,e.length-=l;do s[c++]=I[u++];while(--l);e.length===0&&(e.mode=te);break;case it:if(_===0)break e;s[c++]=e.length,_--,e.mode=te;break;case le:if(e.wrap){for(;o<32;){if(f===0)break e;f--,a|=r[n++]<<o,o+=8}if(w-=_,t.total_out+=w,e.total+=w,e.wrap&4&&w&&(t.adler=e.check=e.flags?M(e.check,s,w,c-w):he(e.check,s,w,c-w)),w=_,e.wrap&4&&(e.flags?a:at(a))!==e.check){t.msg="incorrect data check",e.mode=y;break}a=0,o=0}e.mode=nt;case nt:if(e.wrap&&e.flags){for(;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.wrap&4&&a!==(e.total&4294967295)){t.msg="incorrect length check",e.mode=y;break}a=0,o=0}e.mode=rt;case rt:S=Jt;break e;case y:S=lt;break e;case we:return ue;case ct:default:return U}return t.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,(e.wsize||w!==t.avail_out&&e.mode<y&&(e.mode<le||i!==Be))&&xt(t,t.output,t.next_out,w-t.avail_out)?(e.mode=we,ue):(v-=t.avail_in,w-=t.avail_out,t.total_in+=v,t.total_out+=w,e.total+=w,e.wrap&4&&w&&(t.adler=e.check=e.flags?M(e.check,s,w,t.next_out-w):he(e.check,s,w,t.next_out-w)),t.data_type=e.bits+(e.last?64:0)+(e.mode===Z?128:0)+(e.mode===ee||e.mode===fe?256:0),(v===0&&w===0||i===Be)&&S===P&&(S=ei),S)},li=t=>{if(z(t))return U;let i=t.state;return i.window&&(i.window=null),t.state=null,P},ci=(t,i)=>{if(z(t))return U;let e=t.state;return e.wrap&2?(e.head=i,i.done=!1,P):U},di=(t,i)=>{let e=i.length,r,s,n;return z(t)||(r=t.state,r.wrap!==0&&r.mode!==ie)?U:r.mode===ie&&(s=1,s=he(s,i,e,0),s!==r.check)?lt:(n=xt(t,i,e,e),n?(r.mode=we,ue):(r.havedict=1,P))};O.exports.inflateReset=ht;O.exports.inflateReset2=ut;O.exports.inflateResetKeep=dt;O.exports.inflateInit=oi;O.exports.inflateInit2=wt;O.exports.inflate=fi;O.exports.inflateEnd=li;O.exports.inflateGetHeader=ci;O.exports.inflateSetDictionary=di;O.exports.inflateInfo="pako inflate (from Nodeca project)"});var _t=R((Gi,xe)=>{"use strict";var hi=(t,i)=>Object.prototype.hasOwnProperty.call(t,i);xe.exports.assign=function(t){let i=Array.prototype.slice.call(arguments,1);for(;i.length;){let e=i.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(let r in e)hi(e,r)&&(t[r]=e[r])}}return t};xe.exports.flattenChunks=t=>{let i=0;for(let r=0,s=t.length;r<s;r++)i+=t[r].length;let e=new Uint8Array(i);for(let r=0,s=0,n=t.length;r<n;r++){let c=t[r];e.set(c,s),s+=c.length}return e}});var kt=R((Yi,re)=>{"use strict";var gt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{gt=!1}var q=new Uint8Array(256);for(let t=0;t<256;t++)q[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;q[254]=q[254]=1;re.exports.string2buf=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let i,e,r,s,n,c=t.length,f=0;for(s=0;s<c;s++)e=t.charCodeAt(s),(e&64512)===55296&&s+1<c&&(r=t.charCodeAt(s+1),(r&64512)===56320&&(e=65536+(e-55296<<10)+(r-56320),s++)),f+=e<128?1:e<2048?2:e<65536?3:4;for(i=new Uint8Array(f),n=0,s=0;n<f;s++)e=t.charCodeAt(s),(e&64512)===55296&&s+1<c&&(r=t.charCodeAt(s+1),(r&64512)===56320&&(e=65536+(e-55296<<10)+(r-56320),s++)),e<128?i[n++]=e:e<2048?(i[n++]=192|e>>>6,i[n++]=128|e&63):e<65536?(i[n++]=224|e>>>12,i[n++]=128|e>>>6&63,i[n++]=128|e&63):(i[n++]=240|e>>>18,i[n++]=128|e>>>12&63,i[n++]=128|e>>>6&63,i[n++]=128|e&63);return i};var ui=(t,i)=>{if(i<65534&&t.subarray&>)return String.fromCharCode.apply(null,t.length===i?t:t.subarray(0,i));let e="";for(let r=0;r<i;r++)e+=String.fromCharCode(t[r]);return e};re.exports.buf2string=(t,i)=>{let e=i||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,i));let r,s,n=new Array(e*2);for(s=0,r=0;r<e;){let c=t[r++];if(c<128){n[s++]=c;continue}let f=q[c];if(f>4){n[s++]=65533,r+=f-1;continue}for(c&=f===2?31:f===3?15:7;f>1&&r<e;)c=c<<6|t[r++]&63,f--;if(f>1){n[s++]=65533;continue}c<65536?n[s++]=c:(c-=65536,n[s++]=55296|c>>10&1023,n[s++]=56320|c&1023)}return ui(n,s)};re.exports.utf8border=(t,i)=>{i=i||t.length,i>t.length&&(i=t.length);let e=i-1;for(;e>=0&&(t[e]&192)===128;)e--;return e<0||e===0?i:e+q[t[e]]>i?e:i}});var Et=R((Xi,pt)=>{"use strict";pt.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var St=R((qi,mt)=>{"use strict";function wi(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}mt.exports=wi});var vt=R((Ki,Tt)=>{"use strict";function xi(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Tt.exports=xi});var Rt=R((ji,V)=>{"use strict";var B=bt(),At=_t(),ge=kt(),ke=Et(),bi=St(),_i=vt(),It=Object.prototype.toString,{Z_NO_FLUSH:gi,Z_FINISH:ki,Z_OK:K,Z_STREAM_END:be,Z_NEED_DICT:_e,Z_STREAM_ERROR:pi,Z_DATA_ERROR:yt,Z_MEM_ERROR:Ei}=J();function j(t){this.options=At.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(t&&t.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15||(i.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bi,this.strm.avail_out=0;let e=B.inflateInit2(this.strm,i.windowBits);if(e!==K)throw new Error(ke[e]);if(this.header=new _i,B.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=ge.string2buf(i.dictionary):It.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(e=B.inflateSetDictionary(this.strm,i.dictionary),e!==K)))throw new Error(ke[e])}j.prototype.push=function(t,i){let e=this.strm,r=this.options.chunkSize,s=this.options.dictionary,n,c,f;if(this.ended)return!1;for(i===~~i?c=i:c=i===!0?ki:gi,It.call(t)==="[object ArrayBuffer]"?e.input=new Uint8Array(t):e.input=t,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(r),e.next_out=0,e.avail_out=r),n=B.inflate(e,c),n===_e&&s&&(n=B.inflateSetDictionary(e,s),n===K?n=B.inflate(e,c):n===yt&&(n=_e));e.avail_in>0&&n===be&&e.state.wrap>0&&t[e.next_in]!==0;)B.inflateReset(e),n=B.inflate(e,c);switch(n){case pi:case yt:case _e:case Ei:return this.onEnd(n),this.ended=!0,!1}if(f=e.avail_out,e.next_out&&(e.avail_out===0||n===be))if(this.options.to==="string"){let _=ge.utf8border(e.output,e.next_out),a=e.next_out-_,o=ge.buf2string(e.output,_);e.next_out=a,e.avail_out=r-a,a&&e.output.set(e.output.subarray(_,_+a),0),this.onData(o)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(n===K&&f===0)){if(n===be)return n=B.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};j.prototype.onData=function(t){this.chunks.push(t)};j.prototype.onEnd=function(t){t===K&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=At.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function pe(t,i){let e=new j(i);if(e.push(t),e.err)throw e.msg||ke[e.err];return e.result}function mi(t,i){return i=i||{},i.raw=!0,pe(t,i)}V.exports.Inflate=j;V.exports.inflate=pe;V.exports.inflateRaw=mi;V.exports.ungzip=pe;V.exports.constants=J()});var Nt=1953029805,Mt=2917034100;function oe(t,i){if(oe.passThroughDataForTesting)return i;ae.typeOf.object("key",t),ae.typeOf.object("data",i);let e=t.byteLength;if(e===0||e%4!==0)throw new D("The length of key must be greater than 0 and a multiple of 4.");let r=new DataView(i),s=r.getUint32(0,!0);if(s===Nt||s===Mt)return i;let n=new DataView(t),c=0,f=i.byteLength,_=f-f%8,a=e,o,v=8;for(;c<_;)for(v=(v+8)%24,o=v;c<_&&o<a;)r.setUint32(c,r.getUint32(c,!0)^n.getUint32(o,!0),!0),r.setUint32(c+4,r.getUint32(c+4,!0)^n.getUint32(o+4,!0),!0),c+=8,o+=24;if(c<f)for(o>=a&&(v=(v+8)%24,o=v);c<f;)r.setUint8(c,r.getUint8(c)^n.getUint8(o)),c++,o++}oe.passThroughDataForTesting=!1;var Te=oe;function Zt(t,i){return(t&i)!==0}var F=Zt;var Bt=[1,2,4,8],ve=15,Ct=16,Lt=64,Pt=128;function N(t,i,e,r,s,n){this._bits=t,this.cnodeVersion=i,this.imageryVersion=e,this.terrainVersion=r,this.imageryProvider=s,this.terrainProvider=n,this.ancestorHasTerrain=!1,this.terrainState=void 0}N.clone=function(t,i){return me(i)?(i._bits=t._bits,i.cnodeVersion=t.cnodeVersion,i.imageryVersion=t.imageryVersion,i.terrainVersion=t.terrainVersion,i.imageryProvider=t.imageryProvider,i.terrainProvider=t.terrainProvider):i=new N(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),i.ancestorHasTerrain=t.ancestorHasTerrain,i.terrainState=t.terrainState,i};N.prototype.setParent=function(t){this.ancestorHasTerrain=t.ancestorHasTerrain||this.hasTerrain()};N.prototype.hasSubtree=function(){return F(this._bits,Ct)};N.prototype.hasImagery=function(){return F(this._bits,Lt)};N.prototype.hasTerrain=function(){return F(this._bits,Pt)};N.prototype.hasChildren=function(){return F(this._bits,ve)};N.prototype.hasChild=function(t){return F(this._bits,Bt[t])};N.prototype.getChildBitmask=function(){return this._bits&ve};var ye=N;var Ut=Ot(Rt(),1);var G=Uint16Array.BYTES_PER_ELEMENT,H=Int32Array.BYTES_PER_ELEMENT,Y=Uint32Array.BYTES_PER_ELEMENT,C={METADATA:0,TERRAIN:1,DBROOT:2};C.fromString=function(t){if(t==="Metadata")return C.METADATA;if(t==="Terrain")return C.TERRAIN;if(t==="DbRoot")return C.DBROOT};function Si(t,i){let e=C.fromString(t.type),r=t.buffer;Te(t.key,r);let s=Di(r);r=s.buffer;let n=s.length;switch(e){case C.METADATA:return vi(r,n,t.quadKey);case C.TERRAIN:return Ii(r,n,i);case C.DBROOT:return i.push(r),{buffer:r}}}var Ti=32301;function vi(t,i,e){let r=new DataView(t),s=0,n=r.getUint32(s,!0);if(s+=Y,n!==Ti)throw new D("Invalid magic");let c=r.getUint32(s,!0);if(s+=Y,c!==1)throw new D("Invalid data type. Must be 1 for QuadTreePacket");let f=r.getUint32(s,!0);if(s+=Y,f!==2)throw new D("Invalid QuadTreePacket version. Only version 2 is supported.");let _=r.getInt32(s,!0);s+=H;let a=r.getInt32(s,!0);if(s+=H,a!==32)throw new D("Invalid instance size.");let o=r.getInt32(s,!0);s+=H;let v=r.getInt32(s,!0);s+=H;let w=r.getInt32(s,!0);if(s+=H,o!==_*a+s)throw new D("Invalid dataBufferOffset");if(o+v+w!==i)throw new D("Invalid packet offsets");let l=[];for(let g=0;g<_;++g){let d=r.getUint8(s);++s,++s;let E=r.getUint16(s,!0);s+=G;let A=r.getUint16(s,!0);s+=G;let h=r.getUint16(s,!0);s+=G,s+=G,s+=G,s+=H,s+=H,s+=8;let S=r.getUint8(s++),k=r.getUint8(s++);s+=G,l.push(new ye(d,E,A,h,S,k))}let u=[],I=0;function p(g,d,E){let A=!1;if(E===4){if(d.hasSubtree())return;A=!0}for(let h=0;h<4;++h){let S=g+h.toString();if(A)u[S]=null;else if(E<4)if(!d.hasChild(h))u[S]=null;else{if(I===_){console.log("Incorrect number of instances");return}let k=l[I++];u[S]=k,p(S,k,E+1)}}}let x=0,T=l[I++];return e===""?++x:u[e]=T,p(e,T,x),u}var yi=5,Ai=4;function Ii(t,i,e){let r=new DataView(t),s=function(f){for(let _=0;_<Ai;++_){let a=r.getUint32(f,!0);if(f+=Y,f+=a,f>i)throw new D("Malformed terrain packet found.")}return f},n=0,c=[];for(;c.length<yi;){let f=n;n=s(n);let _=t.slice(f,n);e.push(_),c.push(_)}return c}var Dt=1953029805,Ri=2917034100;function Di(t){let i=new DataView(t),e=0,r=i.getUint32(e,!0);if(e+=Y,r!==Dt&&r!==Ri)throw new D("Invalid magic");let s=i.getUint32(e,r===Dt);e+=Y;let n=new Uint8Array(t,e),c=Ut.default.inflate(n);if(c.length!==s)throw new D("Size of packet doesn't match header");return c}var en=Se(Si);export{en as default}; diff --git a/public/js/Cesium2/Workers/decodeI3S.js b/public/js/Cesium2/Workers/decodeI3S.js index e22e973f8..a2b613cc9 100644 --- a/public/js/Cesium2/Workers/decodeI3S.js +++ b/public/js/Cesium2/Workers/decodeI3S.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as xt}from"./chunk-JR7WFPVR.js";import{a as P}from"./chunk-JXLT7VPX.js";import{a as yt}from"./chunk-4BYMTYMT.js";import{a as ht}from"./chunk-UJMUN4NO.js";import{a as g,b as ot,d as st,e as it}from"./chunk-S4VBGY2U.js";import{a as M}from"./chunk-UCTPWOTZ.js";import{a as ft}from"./chunk-N3A5CZ2S.js";import{b as lt}from"./chunk-G75U3WZT.js";import{d as mt,e as h}from"./chunk-3THTQ4QB.js";var at=mt(xt(),1);function wt(n){return lt.defined("value",n),n<=.04045?n*.07739938080495357:Math.pow((n+.055)*.9478672985781991,2.4)}var k=wt;var ut;function It(n,t,e,o,a,i){let r=e*(1-n)+o*n,s=a*(1-n)+i*n;return r*(1-t)+s*t}function H(n,t,e,o){let a=n+t*e;return o[a]}function At(n,t,e){let o=e.nativeExtent,a=(n-o.west)/(o.east-o.west)*(e.width-1),i=(t-o.south)/(o.north-o.south)*(e.height-1),r=Math.floor(a),s=Math.floor(i);a-=r,i-=s;let c=r<e.width?r+1:r,u=s<e.height?s+1:s;s=e.height-1-s,u=e.height-1-u;let l=H(r,s,e.width,e.buffer),f=H(c,s,e.width,e.buffer),p=H(r,u,e.width,e.buffer),m=H(c,u,e.width,e.buffer),d=It(a,i,l,f,p,m);return d=d*e.scale+e.offset,d}function bt(n,t,e){for(let o=0;o<e.length;o++){let a=e[o].nativeExtent,i=new g;if(e[o].projectionType==="WebMercator"){let r=e[o].projection._ellipsoid._radii;i=new ht(new st(r.x,r.y,r.z)).project(new ot(n,t,0))}else i.x=n,i.y=t;if(i.x>a.west&&i.x<a.east&&i.y>a.south&&i.y<a.north)return At(i.x,i.y,e[o])}return 0}function Lt(n,t,e,o,a,i,r){if(r)return;let s=bt(a.longitude,a.latitude,i);for(let c=0;c<n;++c){let u=bt(a.longitude+M.toRadians(e*t[c*3]),a.latitude+M.toRadians(o*t[c*3+1]),i);t[c*3+2]+=u-s}}function Ot(n,t,e,o,a,i,r,s,c){if(n===0||!h(t)||t.length===0)return;let u=new st(Math.sqrt(r.x),Math.sqrt(r.y),Math.sqrt(r.z));for(let l=0;l<n;++l){let f=l*3,p=f+1,m=f+2,d=new ot;d.longitude=o.longitude+M.toRadians(s*t[f]),d.latitude=o.latitude+M.toRadians(c*t[p]),d.height=o.height+t[m];let b={};u.cartographicToCartesian(d,b),b.x-=a.x,b.y-=a.y,b.z-=a.z;let x={};if(it.multiplyByVector(i,b,x),t[f]=x.x,t[p]=x.y,t[m]=x.z,h(e)){let T=new g(e[f],e[p],e[m]),I={};it.multiplyByVector(i,T,I),e[f]=I.x,e[p]=I.y,e[m]=I.z}}}function Tt(n,t,e){for(let o=0;o<n;++o){let a=e[o*4]/65535,i=e[o*4+1]/65535,r=(e[o*4+2]-e[o*4])/65535,s=(e[o*4+3]-e[o*4+1])/65535;t[o*2]*=r,t[o*2]+=a,t[o*2+1]*=s,t[o*2+1]+=i}}function Ct(n,t,e,o){let a=new Uint32Array(n),i=h(t)?s=>t[s]:s=>s,r=0;if(o&&h(e)){let s=c=>e[i(c)*4+3]<255;for(let c=0;c<n;c+=3)!s(c)&&!s(c+1)&&!s(c+2)&&(a[r++]=i(c),a[r++]=i(c+1),a[r++]=i(c+2));if(r>0){let c=r;for(let u=0;u<n;u+=3)(s(u)||s(u+1)||s(u+2))&&(a[c++]=i(u),a[c++]=i(u+1),a[c++]=i(u+2))}else for(let c=0;c<n;++c)a[c]=i(c)}else{r=n;for(let s=0;s<n;++s)a[s]=i(s)}return{indexArray:a,transparentVertexOffset:r}}function Ft(n,t,e){let o=t[e];if(h(o))return o;let a=t[e]={positions:{},indices:{},edges:{}},i=ft(n[e],n.default);return a.hasOutline=h(i?.edges),a}function Ut(n,t,e,o){if(!h(n[e])){let a=e*3,i=t;for(let r=0;r<3;r++){let s=o[a+r];h(i[s])||(i[s]={}),i=i[s]}h(i.index)||(i.index=e),n[e]=i.index}}function Vt(n,t,e,o,a,i){let r,s;o<a?(r=o,s=a):(r=a,s=o);let c=n[r];h(c)||(c=n[r]={});let u=c[s];h(u)||(u=c[s]={normalsIndex:[],outlines:[]}),u.normalsIndex.push(i),(u.outlines.length===0||t!==o||e!==a)&&u.outlines.push(t,e)}function Et(n,t,e,o){let a=[];for(let i=0;i<e.length;i+=3){let r=h(t)?t[e[i]]:"default",s=Ft(n,a,r);if(!s.hasOutline)continue;let c=s.indices,u=s.positions;for(let f=0;f<3;f++){let p=e[i+f];Ut(c,u,p,o)}let l=s.edges;for(let f=0;f<3;f++){let p=e[i+f],m=e[i+(f+1)%3],d=c[p],b=c[m];Vt(l,p,m,d,b,i)}}return a}var O=new g,X=new g,Y=new g;function gt(n,t,e,o){let a=e[t]*3,i=e[t+1]*3,r=e[t+2]*3;g.fromArray(o,a,O),g.fromArray(o,i,X),g.fromArray(o,r,Y),g.subtract(X,O,X),g.subtract(Y,O,Y),g.cross(X,Y,O);let s=g.magnitude(O);s!==0&&g.divideByScalar(O,s,O);let c=t*3,u=(t+1)*3,l=(t+2)*3;g.pack(O,n,c),g.pack(O,n,u),g.pack(O,n,l)}var z=new g,ct=new g;function _t(n,t,e){g.fromArray(n,t,z),g.fromArray(n,e,ct);let o=g.dot(z,ct),a=g.magnitude(g.cross(z,ct,z));return Math.atan2(a,o)<.25}function Rt(n,t,e,o,a){if(t.normalsIndex.length>1){let i=o.length===a.length;for(let r=0;r<t.normalsIndex.length;r++){let s=t.normalsIndex[r];if(h(a[s*3])||gt(a,s,e,o),r!==0)for(let c=0;c<r;c++){let u=t.normalsIndex[c],l=i?e[s]*3:s*3,f=i?e[u]*3:u*3;if(_t(a,l,f))return}}}n.push(...t.outlines)}function Nt(n,t,e,o,a){let i=Object.keys(t);for(let r=0;r<i.length;r++){let s=t[i[r]],c=Object.keys(s);for(let u=0;u<c.length;u++){let l=s[c[u]];Rt(n,l,e,o,a)}}}function Bt(n,t,e,o){let a=[],i=Object.keys(n);for(let r=0;r<i.length;r++){let s=n[i[r]].edges;Nt(a,s,t,e,o)}return a}function Gt(n,t,e,o,a){if(!h(n)||Object.keys(n).length===0)return;let i=Et(n,t,e,o);(!h(a)||e.length*3!==a.length)&&(a=[]);let r=Bt(i,e,o,a);return r.length>0?new Uint32Array(r):void 0}function St(n){let t=new Float32Array(n.length);for(let e=0;e<n.length;e+=4)t[e]=k(P.byteToFloat(n[e])),t[e+1]=k(P.byteToFloat(n[e+1])),t[e+2]=k(P.byteToFloat(n[e+2])),t[e+3]=P.byteToFloat(n[e+3]);return t}function vt(n,t,e,o,a,i,r){let s={normals:void 0,positions:void 0,uv0s:void 0,colors:void 0,featureIndex:void 0,vertexCount:void 0};if(n===0||!h(e)||e.length===0||h(o))return s;if(h(t)){s.vertexCount=t.length,s.positions=new Float32Array(t.length*3),s.uv0s=h(a)?new Float32Array(t.length*2):void 0,s.colors=h(i)?new Uint8Array(t.length*4):void 0,s.featureIndex=h(r)?new Array(t.length):void 0;for(let c=0;c<t.length;c++){let u=t[c];s.positions[c*3]=e[u*3],s.positions[c*3+1]=e[u*3+1],s.positions[c*3+2]=e[u*3+2],h(s.uv0s)&&(s.uv0s[c*2]=a[u*2],s.uv0s[c*2+1]=a[u*2+1]),h(s.colors)&&(s.colors[c*4]=i[u*4],s.colors[c*4+1]=i[u*4+1],s.colors[c*4+2]=i[u*4+2],s.colors[c*4+3]=i[u*4+3]),h(s.featureIndex)&&(s.featureIndex[c]=r[u])}n=t.length,e=s.positions}t=new Array(n);for(let c=0;c<n;c++)t[c]=c;s.normals=new Float32Array(t.length*3);for(let c=0;c<t.length;c+=3)gt(s.normals,c,t,e);return s}function Mt(n,t,e,o,a,i,r,s){if(n===0||!h(e)||e.length===0)return{buffers:[],bufferViews:[],accessors:[],meshes:[],nodes:[],nodesInScene:[]};let c=[],u=[],l=[],f=[],p=[],m=[],d={},b=[];h(t)&&(n=t.length);let{indexArray:x,transparentVertexOffset:T}=Ct(n,t,i,s.splitGeometryByColorTransparency),I=new Blob([x],{type:"application/binary"}),A=URL.createObjectURL(I),w=n,F=s.enableFeatures&&h(r)?new Float32Array(r.length):void 0,C=0;if(h(F))for(let y=0;y<r.length;++y){F[y]=r[y];let E=r[y]+1;C<E&&(C=E)}let U,R=Gt(s.symbologyData,r,x,e,o);if(h(R)){let y=new Blob([R],{type:"application/binary"});U=URL.createObjectURL(y)}let L=e.subarray(0,w*3),dt=new Blob([L],{type:"application/binary"}),pt=URL.createObjectURL(dt),D=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,Q=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,J=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY;for(let y=0;y<L.length/3;y++)D=Math.min(D,L[y*3+0]),K=Math.max(K,L[y*3+0]),Q=Math.min(Q,L[y*3+1]),Z=Math.max(Z,L[y*3+1]),J=Math.min(J,L[y*3+2]),$=Math.max($,L[y*3+2]);let N=o?o.subarray(0,w*3):void 0,q;if(h(N)){let y=new Blob([N],{type:"application/binary"});q=URL.createObjectURL(y)}let B=a?a.subarray(0,w*2):void 0,tt;if(h(B)){let y=new Blob([B],{type:"application/binary"});tt=URL.createObjectURL(y)}let G=h(i)?St(i.subarray(0,w*4)):void 0,et;if(h(G)){let y=new Blob([G],{type:"application/binary"});et=URL.createObjectURL(y)}let S=h(F)?F.subarray(0,w):void 0,nt;if(h(S)){let y=new Blob([S],{type:"application/binary"});nt=URL.createObjectURL(y)}let _=h(F)?new Float32Array(C):void 0,rt;if(h(_)){for(let E=0;E<_.length;++E)_[E]=E;let y=new Blob([_],{type:"application/binary"});rt=URL.createObjectURL(y)}let V={},j={};V.POSITION=l.length,c.push({uri:pt,byteLength:L.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:L.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:L.length/3,type:"VEC3",max:[D,Q,J],min:[K,Z,$]}),h(q)&&(V.NORMAL=l.length,c.push({uri:q,byteLength:N.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:N.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:N.length/3,type:"VEC3"})),h(tt)&&(V.TEXCOORD_0=l.length,c.push({uri:tt,byteLength:B.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:B.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:B.length/2,type:"VEC2"})),h(et)&&(V.COLOR_0=l.length,c.push({uri:et,byteLength:G.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:G.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:G.length/4,type:"VEC4"})),h(nt)&&(V._FEATURE_ID_0=l.length,c.push({uri:nt,byteLength:S.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:S.byteLength,target:34963}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:S.length,type:"SCALAR"}),j.EXT_mesh_features={featureIds:[{attribute:0,propertyTable:0,featureCount:C}]},b.push("EXT_mesh_features")),h(rt)&&(c.push({uri:rt,byteLength:_.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:_.byteLength,target:34963}),d.EXT_structural_metadata={schema:{id:"i3s-metadata-schema-001",name:"I3S metadata schema 001",description:"The schema for I3S metadata",version:"1.0",classes:{feature:{name:"feature",description:"Feature metadata",properties:{index:{description:"The feature index",type:"SCALAR",componentType:"FLOAT32",required:!0}}}}},propertyTables:[{name:"feature-indices-mapping",class:"feature",count:C,properties:{index:{values:u.length-1}}}]},b.push("EXT_structural_metadata")),h(U)&&(c.push({uri:U,byteLength:R.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:R.byteLength,target:34963}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5125,count:R.length,type:"SCALAR"}),j.CESIUM_primitive_outline={indices:l.length-1},b.push("CESIUM_primitive_outline")),c.push({uri:A,byteLength:x.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:x.byteLength,target:34963});let v=[];return T>0&&(l.push({bufferView:u.length-1,byteOffset:0,componentType:5125,count:T,type:"SCALAR"}),v.push({attributes:V,indices:l.length-1,material:v.length,extensions:j})),T<n&&(l.push({bufferView:u.length-1,byteOffset:4*T,componentType:5125,count:n-T,type:"SCALAR"}),v.push({attributes:V,indices:l.length-1,material:v.length,extensions:j,extra:{isTransparent:!0}})),f.push({primitives:v}),m.push(0),p.push({mesh:0}),{buffers:c,bufferViews:u,accessors:l,meshes:f,nodes:p,nodesInScene:m,rootExtensions:d,extensionsUsed:b}}function Pt(n,t,e,o){let a=new Uint8Array(n,0,5);return a[0]===68&&a[1]===82&&a[2]===65&&a[3]===67&&a[4]===79?jt(n,e):Ht(n,t,e,o)}function jt(n){let t=ut,e=new t.DecoderBuffer,o=new Uint8Array(n);e.Init(o,o.length);let a=new t.Decoder,i=a.GetEncodedGeometryType(e),r=new t.MetadataQuerier,s,c;i===t.TRIANGULAR_MESH&&(s=new t.Mesh,c=a.DecodeBufferToMesh(e,s));let u={vertexCount:[0],featureCount:0};if(h(c)&&c.ok()&&s.ptr!==0){let l=s.num_faces(),f=s.num_attributes(),p=s.num_points();u.indices=new Uint32Array(l*3);let m=u.indices;u.vertexCount[0]=p,u.scale_x=1,u.scale_y=1;let d=new t.DracoInt32Array(3);for(let b=0;b<l;++b)a.GetFaceFromMesh(s,b,d),m[b*3]=d.GetValue(0),m[b*3+1]=d.GetValue(1),m[b*3+2]=d.GetValue(2);t.destroy(d);for(let b=0;b<f;++b){let x=a.GetAttribute(s,b),T=kt(t,a,s,x,p),I=x.attribute_type(),A="unknown";I===t.POSITION?A="positions":I===t.NORMAL?A="normals":I===t.COLOR?A="colors":I===t.TEX_COORD&&(A="uv0s");let w=a.GetAttributeMetadata(s,b);if(w.ptr!==0){let F=r.NumEntries(w);for(let C=0;C<F;++C){let U=r.GetEntryName(w,C);U==="i3s-scale_x"?u.scale_x=r.GetDoubleEntry(w,"i3s-scale_x"):U==="i3s-scale_y"?u.scale_y=r.GetDoubleEntry(w,"i3s-scale_y"):U==="i3s-attribute-type"&&(A=r.GetStringEntry(w,"i3s-attribute-type"))}}h(u[A])&&console.log("Attribute already exists",A),u[A]=T,A==="feature-index"&&u.featureCount++}t.destroy(s)}return t.destroy(r),t.destroy(a),u}function kt(n,t,e,o,a){let i=o.num_components()*a,r,c=[function(){},function(){r=new n.DracoInt8Array(i),t.GetAttributeInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt8Array(i),t.GetAttributeUInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt16Array(i),t.GetAttributeInt16ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int16Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt16Array(i),t.GetAttributeUInt16ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint16Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt32Array(i),t.GetAttributeInt32ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt32Array(i),t.GetAttributeUInt32ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){},function(){},function(){r=new n.DracoFloat32Array(i),t.GetAttributeFloatForAllPoints(e,o,r)||console.error("Bad stream");let l=new Float32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){},function(){r=new n.DracoUInt8Array(i),t.GetAttributeUInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l}][o.data_type()]();return h(r)&&n.destroy(r),c}var W={position:function(n,t,e){let o=n.vertexCount*3;return n.positions=new Float32Array(t,e,o),e+=o*4,e},normal:function(n,t,e){let o=n.vertexCount*3;return n.normals=new Float32Array(t,e,o),e+=o*4,e},uv0:function(n,t,e){let o=n.vertexCount*2;return n.uv0s=new Float32Array(t,e,o),e+=o*4,e},color:function(n,t,e){let o=n.vertexCount*4;return n.colors=new Uint8Array(t,e,o),e+=o,e},featureId:function(n,t,e){let o=n.featureCount;return e+=o*8,e},id:function(n,t,e){let o=n.featureCount;return e+=o*8,e},faceRange:function(n,t,e){let o=n.featureCount*2;return n.faceRange=new Uint32Array(t,e,o),e+=o*4,e},uvRegion:function(n,t,e){let o=n.vertexCount*4;return n["uv-region"]=new Uint16Array(t,e,o),e+=o*2,e},region:function(n,t,e){let o=n.vertexCount*4;return n["uv-region"]=new Uint16Array(t,e,o),e+=o*2,e}};function Ht(n,t,e,o){let a={vertexCount:0},i=new DataView(n);try{let r=0;if(a.vertexCount=i.getUint32(r,1),r+=4,a.featureCount=i.getUint32(r,1),r+=4,h(e))for(let s=0;s<e.attributes.length;s++)h(W[e.attributes[s]])?r=W[e.attributes[s]](a,n,r):console.error("Unknown decoder for",e.attributes[s]);else{let s=t.ordering,c=t.featureAttributeOrder;h(o)&&h(o.geometryData)&&h(o.geometryData[0])&&h(o.geometryData[0].params)&&(s=Object.keys(o.geometryData[0].params.vertexAttributes),c=Object.keys(o.geometryData[0].params.featureAttributes));for(let u=0;u<s.length;u++){let l=W[s[u]];r=l(a,n,r)}for(let u=0;u<c.length;u++){let l=W[c[u]];r=l(a,n,r)}}}catch(r){console.error(r)}return a.scale_x=1,a.scale_y=1,a}function Xt(n){let t=Pt(n.binaryData,n.schema,n.bufferInfo,n.featureData);h(n.geoidDataList)&&n.geoidDataList.length>0&&Lt(t.vertexCount,t.positions,t.scale_x,t.scale_y,n.cartographicCenter,n.geoidDataList,!1),Ot(t.vertexCount,t.positions,t.normals,n.cartographicCenter,n.cartesianCenter,n.parentRotation,n.ellipsoidRadiiSquare,t.scale_x,t.scale_y),h(t.uv0s)&&h(t["uv-region"])&&Tt(t.vertexCount,t.uv0s,t["uv-region"]);let e;if(h(t["feature-index"]))e=t["feature-index"];else if(h(t.faceRange)){e=new Array(t.vertexCount);for(let r=0;r<t.faceRange.length-1;r+=2){let s=r/2,c=t.faceRange[r],u=t.faceRange[r+1];for(let l=c;l<=u;l++)e[l*3]=s,e[l*3+1]=s,e[l*3+2]=s}}if(n.calculateNormals){let r=vt(t.vertexCount,t.indices,t.positions,t.normals,t.uv0s,t.colors,e);h(r.normals)&&(t.normals=r.normals,h(r.vertexCount)&&(t.vertexCount=r.vertexCount,t.indices=r.indices,t.positions=r.positions,t.uv0s=r.uv0s,t.colors=r.colors,e=r.featureIndex))}let o=Mt(t.vertexCount,t.indices,t.positions,t.normals,t.uv0s,t.colors,e,n),a={positions:t.positions,indices:t.indices,featureIndex:e,sourceURL:n.url,cartesianCenter:n.cartesianCenter,parentRotation:n.parentRotation};return o._customAttributes=a,{meshData:o}}async function Yt(n,t){let e=n.webAssemblyConfig;return h(e)&&h(e.wasmBinaryFile)?ut=await(0,at.default)(e):ut=await(0,at.default)(),!0}function zt(n,t){let e=n.webAssemblyConfig;return h(e)?Yt(n,t):Xt(n,t)}var se=yt(zt);export{se as default}; +import{a as xt}from"./chunk-URBLFZDC.js";import{a as P}from"./chunk-H2CDK6OB.js";import{a as yt}from"./chunk-4E3APMCC.js";import{a as ht}from"./chunk-HMHR6SIB.js";import{a as g,b as ot,d as st,e as it}from"./chunk-RH3GFHG2.js";import{a as M}from"./chunk-FRWNWNYJ.js";import{a as ft}from"./chunk-TA3RE4KQ.js";import{b as lt}from"./chunk-RTY3VPG6.js";import{d as mt,e as h}from"./chunk-LRNH5AEO.js";var at=mt(xt(),1);function wt(n){return lt.defined("value",n),n<=.04045?n*.07739938080495357:Math.pow((n+.055)*.9478672985781991,2.4)}var k=wt;var ut;function It(n,t,e,o,a,i){let r=e*(1-n)+o*n,s=a*(1-n)+i*n;return r*(1-t)+s*t}function H(n,t,e,o){let a=n+t*e;return o[a]}function At(n,t,e){let o=e.nativeExtent,a=(n-o.west)/(o.east-o.west)*(e.width-1),i=(t-o.south)/(o.north-o.south)*(e.height-1),r=Math.floor(a),s=Math.floor(i);a-=r,i-=s;let c=r<e.width?r+1:r,u=s<e.height?s+1:s;s=e.height-1-s,u=e.height-1-u;let l=H(r,s,e.width,e.buffer),f=H(c,s,e.width,e.buffer),p=H(r,u,e.width,e.buffer),m=H(c,u,e.width,e.buffer),d=It(a,i,l,f,p,m);return d=d*e.scale+e.offset,d}function bt(n,t,e){for(let o=0;o<e.length;o++){let a=e[o].nativeExtent,i=new g;if(e[o].projectionType==="WebMercator"){let r=e[o].projection._ellipsoid._radii;i=new ht(new st(r.x,r.y,r.z)).project(new ot(n,t,0))}else i.x=n,i.y=t;if(i.x>a.west&&i.x<a.east&&i.y>a.south&&i.y<a.north)return At(i.x,i.y,e[o])}return 0}function Lt(n,t,e,o,a,i,r){if(r)return;let s=bt(a.longitude,a.latitude,i);for(let c=0;c<n;++c){let u=bt(a.longitude+M.toRadians(e*t[c*3]),a.latitude+M.toRadians(o*t[c*3+1]),i);t[c*3+2]+=u-s}}function Ot(n,t,e,o,a,i,r,s,c){if(n===0||!h(t)||t.length===0)return;let u=new st(Math.sqrt(r.x),Math.sqrt(r.y),Math.sqrt(r.z));for(let l=0;l<n;++l){let f=l*3,p=f+1,m=f+2,d=new ot;d.longitude=o.longitude+M.toRadians(s*t[f]),d.latitude=o.latitude+M.toRadians(c*t[p]),d.height=o.height+t[m];let b={};u.cartographicToCartesian(d,b),b.x-=a.x,b.y-=a.y,b.z-=a.z;let x={};if(it.multiplyByVector(i,b,x),t[f]=x.x,t[p]=x.y,t[m]=x.z,h(e)){let T=new g(e[f],e[p],e[m]),I={};it.multiplyByVector(i,T,I),e[f]=I.x,e[p]=I.y,e[m]=I.z}}}function Tt(n,t,e){for(let o=0;o<n;++o){let a=e[o*4]/65535,i=e[o*4+1]/65535,r=(e[o*4+2]-e[o*4])/65535,s=(e[o*4+3]-e[o*4+1])/65535;t[o*2]*=r,t[o*2]+=a,t[o*2+1]*=s,t[o*2+1]+=i}}function Ct(n,t,e,o){let a=new Uint32Array(n),i=h(t)?s=>t[s]:s=>s,r=0;if(o&&h(e)){let s=c=>e[i(c)*4+3]<255;for(let c=0;c<n;c+=3)!s(c)&&!s(c+1)&&!s(c+2)&&(a[r++]=i(c),a[r++]=i(c+1),a[r++]=i(c+2));if(r>0){let c=r;for(let u=0;u<n;u+=3)(s(u)||s(u+1)||s(u+2))&&(a[c++]=i(u),a[c++]=i(u+1),a[c++]=i(u+2))}else for(let c=0;c<n;++c)a[c]=i(c)}else{r=n;for(let s=0;s<n;++s)a[s]=i(s)}return{indexArray:a,transparentVertexOffset:r}}function Ft(n,t,e){let o=t[e];if(h(o))return o;let a=t[e]={positions:{},indices:{},edges:{}},i=ft(n[e],n.default);return a.hasOutline=h(i?.edges),a}function Ut(n,t,e,o){if(!h(n[e])){let a=e*3,i=t;for(let r=0;r<3;r++){let s=o[a+r];h(i[s])||(i[s]={}),i=i[s]}h(i.index)||(i.index=e),n[e]=i.index}}function Vt(n,t,e,o,a,i){let r,s;o<a?(r=o,s=a):(r=a,s=o);let c=n[r];h(c)||(c=n[r]={});let u=c[s];h(u)||(u=c[s]={normalsIndex:[],outlines:[]}),u.normalsIndex.push(i),(u.outlines.length===0||t!==o||e!==a)&&u.outlines.push(t,e)}function Et(n,t,e,o){let a=[];for(let i=0;i<e.length;i+=3){let r=h(t)?t[e[i]]:"default",s=Ft(n,a,r);if(!s.hasOutline)continue;let c=s.indices,u=s.positions;for(let f=0;f<3;f++){let p=e[i+f];Ut(c,u,p,o)}let l=s.edges;for(let f=0;f<3;f++){let p=e[i+f],m=e[i+(f+1)%3],d=c[p],b=c[m];Vt(l,p,m,d,b,i)}}return a}var O=new g,X=new g,Y=new g;function gt(n,t,e,o){let a=e[t]*3,i=e[t+1]*3,r=e[t+2]*3;g.fromArray(o,a,O),g.fromArray(o,i,X),g.fromArray(o,r,Y),g.subtract(X,O,X),g.subtract(Y,O,Y),g.cross(X,Y,O);let s=g.magnitude(O);s!==0&&g.divideByScalar(O,s,O);let c=t*3,u=(t+1)*3,l=(t+2)*3;g.pack(O,n,c),g.pack(O,n,u),g.pack(O,n,l)}var z=new g,ct=new g;function _t(n,t,e){g.fromArray(n,t,z),g.fromArray(n,e,ct);let o=g.dot(z,ct),a=g.magnitude(g.cross(z,ct,z));return Math.atan2(a,o)<.25}function Rt(n,t,e,o,a){if(t.normalsIndex.length>1){let i=o.length===a.length;for(let r=0;r<t.normalsIndex.length;r++){let s=t.normalsIndex[r];if(h(a[s*3])||gt(a,s,e,o),r!==0)for(let c=0;c<r;c++){let u=t.normalsIndex[c],l=i?e[s]*3:s*3,f=i?e[u]*3:u*3;if(_t(a,l,f))return}}}n.push(...t.outlines)}function Nt(n,t,e,o,a){let i=Object.keys(t);for(let r=0;r<i.length;r++){let s=t[i[r]],c=Object.keys(s);for(let u=0;u<c.length;u++){let l=s[c[u]];Rt(n,l,e,o,a)}}}function Bt(n,t,e,o){let a=[],i=Object.keys(n);for(let r=0;r<i.length;r++){let s=n[i[r]].edges;Nt(a,s,t,e,o)}return a}function Gt(n,t,e,o,a){if(!h(n)||Object.keys(n).length===0)return;let i=Et(n,t,e,o);(!h(a)||e.length*3!==a.length)&&(a=[]);let r=Bt(i,e,o,a);return r.length>0?new Uint32Array(r):void 0}function St(n){let t=new Float32Array(n.length);for(let e=0;e<n.length;e+=4)t[e]=k(P.byteToFloat(n[e])),t[e+1]=k(P.byteToFloat(n[e+1])),t[e+2]=k(P.byteToFloat(n[e+2])),t[e+3]=P.byteToFloat(n[e+3]);return t}function vt(n,t,e,o,a,i,r){let s={normals:void 0,positions:void 0,uv0s:void 0,colors:void 0,featureIndex:void 0,vertexCount:void 0};if(n===0||!h(e)||e.length===0||h(o))return s;if(h(t)){s.vertexCount=t.length,s.positions=new Float32Array(t.length*3),s.uv0s=h(a)?new Float32Array(t.length*2):void 0,s.colors=h(i)?new Uint8Array(t.length*4):void 0,s.featureIndex=h(r)?new Array(t.length):void 0;for(let c=0;c<t.length;c++){let u=t[c];s.positions[c*3]=e[u*3],s.positions[c*3+1]=e[u*3+1],s.positions[c*3+2]=e[u*3+2],h(s.uv0s)&&(s.uv0s[c*2]=a[u*2],s.uv0s[c*2+1]=a[u*2+1]),h(s.colors)&&(s.colors[c*4]=i[u*4],s.colors[c*4+1]=i[u*4+1],s.colors[c*4+2]=i[u*4+2],s.colors[c*4+3]=i[u*4+3]),h(s.featureIndex)&&(s.featureIndex[c]=r[u])}n=t.length,e=s.positions}t=new Array(n);for(let c=0;c<n;c++)t[c]=c;s.normals=new Float32Array(t.length*3);for(let c=0;c<t.length;c+=3)gt(s.normals,c,t,e);return s}function Mt(n,t,e,o,a,i,r,s){if(n===0||!h(e)||e.length===0)return{buffers:[],bufferViews:[],accessors:[],meshes:[],nodes:[],nodesInScene:[]};let c=[],u=[],l=[],f=[],p=[],m=[],d={},b=[];h(t)&&(n=t.length);let{indexArray:x,transparentVertexOffset:T}=Ct(n,t,i,s.splitGeometryByColorTransparency),I=new Blob([x],{type:"application/binary"}),A=URL.createObjectURL(I),w=n,F=s.enableFeatures&&h(r)?new Float32Array(r.length):void 0,C=0;if(h(F))for(let y=0;y<r.length;++y){F[y]=r[y];let E=r[y]+1;C<E&&(C=E)}let U,R=Gt(s.symbologyData,r,x,e,o);if(h(R)){let y=new Blob([R],{type:"application/binary"});U=URL.createObjectURL(y)}let L=e.subarray(0,w*3),dt=new Blob([L],{type:"application/binary"}),pt=URL.createObjectURL(dt),D=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,Q=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,J=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY;for(let y=0;y<L.length/3;y++)D=Math.min(D,L[y*3+0]),K=Math.max(K,L[y*3+0]),Q=Math.min(Q,L[y*3+1]),Z=Math.max(Z,L[y*3+1]),J=Math.min(J,L[y*3+2]),$=Math.max($,L[y*3+2]);let N=o?o.subarray(0,w*3):void 0,q;if(h(N)){let y=new Blob([N],{type:"application/binary"});q=URL.createObjectURL(y)}let B=a?a.subarray(0,w*2):void 0,tt;if(h(B)){let y=new Blob([B],{type:"application/binary"});tt=URL.createObjectURL(y)}let G=h(i)?St(i.subarray(0,w*4)):void 0,et;if(h(G)){let y=new Blob([G],{type:"application/binary"});et=URL.createObjectURL(y)}let S=h(F)?F.subarray(0,w):void 0,nt;if(h(S)){let y=new Blob([S],{type:"application/binary"});nt=URL.createObjectURL(y)}let _=h(F)?new Float32Array(C):void 0,rt;if(h(_)){for(let E=0;E<_.length;++E)_[E]=E;let y=new Blob([_],{type:"application/binary"});rt=URL.createObjectURL(y)}let V={},j={};V.POSITION=l.length,c.push({uri:pt,byteLength:L.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:L.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:L.length/3,type:"VEC3",max:[D,Q,J],min:[K,Z,$]}),h(q)&&(V.NORMAL=l.length,c.push({uri:q,byteLength:N.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:N.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:N.length/3,type:"VEC3"})),h(tt)&&(V.TEXCOORD_0=l.length,c.push({uri:tt,byteLength:B.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:B.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:B.length/2,type:"VEC2"})),h(et)&&(V.COLOR_0=l.length,c.push({uri:et,byteLength:G.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:G.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:G.length/4,type:"VEC4"})),h(nt)&&(V._FEATURE_ID_0=l.length,c.push({uri:nt,byteLength:S.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:S.byteLength,target:34963}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:S.length,type:"SCALAR"}),j.EXT_mesh_features={featureIds:[{attribute:0,propertyTable:0,featureCount:C}]},b.push("EXT_mesh_features")),h(rt)&&(c.push({uri:rt,byteLength:_.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:_.byteLength,target:34963}),d.EXT_structural_metadata={schema:{id:"i3s-metadata-schema-001",name:"I3S metadata schema 001",description:"The schema for I3S metadata",version:"1.0",classes:{feature:{name:"feature",description:"Feature metadata",properties:{index:{description:"The feature index",type:"SCALAR",componentType:"FLOAT32",required:!0}}}}},propertyTables:[{name:"feature-indices-mapping",class:"feature",count:C,properties:{index:{values:u.length-1}}}]},b.push("EXT_structural_metadata")),h(U)&&(c.push({uri:U,byteLength:R.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:R.byteLength,target:34963}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5125,count:R.length,type:"SCALAR"}),j.CESIUM_primitive_outline={indices:l.length-1},b.push("CESIUM_primitive_outline")),c.push({uri:A,byteLength:x.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:x.byteLength,target:34963});let v=[];return T>0&&(l.push({bufferView:u.length-1,byteOffset:0,componentType:5125,count:T,type:"SCALAR"}),v.push({attributes:V,indices:l.length-1,material:v.length,extensions:j})),T<n&&(l.push({bufferView:u.length-1,byteOffset:4*T,componentType:5125,count:n-T,type:"SCALAR"}),v.push({attributes:V,indices:l.length-1,material:v.length,extensions:j,extra:{isTransparent:!0}})),f.push({primitives:v}),m.push(0),p.push({mesh:0}),{buffers:c,bufferViews:u,accessors:l,meshes:f,nodes:p,nodesInScene:m,rootExtensions:d,extensionsUsed:b}}function Pt(n,t,e,o){let a=new Uint8Array(n,0,5);return a[0]===68&&a[1]===82&&a[2]===65&&a[3]===67&&a[4]===79?jt(n,e):Ht(n,t,e,o)}function jt(n){let t=ut,e=new t.DecoderBuffer,o=new Uint8Array(n);e.Init(o,o.length);let a=new t.Decoder,i=a.GetEncodedGeometryType(e),r=new t.MetadataQuerier,s,c;i===t.TRIANGULAR_MESH&&(s=new t.Mesh,c=a.DecodeBufferToMesh(e,s));let u={vertexCount:[0],featureCount:0};if(h(c)&&c.ok()&&s.ptr!==0){let l=s.num_faces(),f=s.num_attributes(),p=s.num_points();u.indices=new Uint32Array(l*3);let m=u.indices;u.vertexCount[0]=p,u.scale_x=1,u.scale_y=1;let d=new t.DracoInt32Array(3);for(let b=0;b<l;++b)a.GetFaceFromMesh(s,b,d),m[b*3]=d.GetValue(0),m[b*3+1]=d.GetValue(1),m[b*3+2]=d.GetValue(2);t.destroy(d);for(let b=0;b<f;++b){let x=a.GetAttribute(s,b),T=kt(t,a,s,x,p),I=x.attribute_type(),A="unknown";I===t.POSITION?A="positions":I===t.NORMAL?A="normals":I===t.COLOR?A="colors":I===t.TEX_COORD&&(A="uv0s");let w=a.GetAttributeMetadata(s,b);if(w.ptr!==0){let F=r.NumEntries(w);for(let C=0;C<F;++C){let U=r.GetEntryName(w,C);U==="i3s-scale_x"?u.scale_x=r.GetDoubleEntry(w,"i3s-scale_x"):U==="i3s-scale_y"?u.scale_y=r.GetDoubleEntry(w,"i3s-scale_y"):U==="i3s-attribute-type"&&(A=r.GetStringEntry(w,"i3s-attribute-type"))}}h(u[A])&&console.log("Attribute already exists",A),u[A]=T,A==="feature-index"&&u.featureCount++}t.destroy(s)}return t.destroy(r),t.destroy(a),u}function kt(n,t,e,o,a){let i=o.num_components()*a,r,c=[function(){},function(){r=new n.DracoInt8Array(i),t.GetAttributeInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt8Array(i),t.GetAttributeUInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt16Array(i),t.GetAttributeInt16ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int16Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt16Array(i),t.GetAttributeUInt16ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint16Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt32Array(i),t.GetAttributeInt32ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt32Array(i),t.GetAttributeUInt32ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){},function(){},function(){r=new n.DracoFloat32Array(i),t.GetAttributeFloatForAllPoints(e,o,r)||console.error("Bad stream");let l=new Float32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){},function(){r=new n.DracoUInt8Array(i),t.GetAttributeUInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l}][o.data_type()]();return h(r)&&n.destroy(r),c}var W={position:function(n,t,e){let o=n.vertexCount*3;return n.positions=new Float32Array(t,e,o),e+=o*4,e},normal:function(n,t,e){let o=n.vertexCount*3;return n.normals=new Float32Array(t,e,o),e+=o*4,e},uv0:function(n,t,e){let o=n.vertexCount*2;return n.uv0s=new Float32Array(t,e,o),e+=o*4,e},color:function(n,t,e){let o=n.vertexCount*4;return n.colors=new Uint8Array(t,e,o),e+=o,e},featureId:function(n,t,e){let o=n.featureCount;return e+=o*8,e},id:function(n,t,e){let o=n.featureCount;return e+=o*8,e},faceRange:function(n,t,e){let o=n.featureCount*2;return n.faceRange=new Uint32Array(t,e,o),e+=o*4,e},uvRegion:function(n,t,e){let o=n.vertexCount*4;return n["uv-region"]=new Uint16Array(t,e,o),e+=o*2,e},region:function(n,t,e){let o=n.vertexCount*4;return n["uv-region"]=new Uint16Array(t,e,o),e+=o*2,e}};function Ht(n,t,e,o){let a={vertexCount:0},i=new DataView(n);try{let r=0;if(a.vertexCount=i.getUint32(r,1),r+=4,a.featureCount=i.getUint32(r,1),r+=4,h(e))for(let s=0;s<e.attributes.length;s++)h(W[e.attributes[s]])?r=W[e.attributes[s]](a,n,r):console.error("Unknown decoder for",e.attributes[s]);else{let s=t.ordering,c=t.featureAttributeOrder;h(o)&&h(o.geometryData)&&h(o.geometryData[0])&&h(o.geometryData[0].params)&&(s=Object.keys(o.geometryData[0].params.vertexAttributes),c=Object.keys(o.geometryData[0].params.featureAttributes));for(let u=0;u<s.length;u++){let l=W[s[u]];r=l(a,n,r)}for(let u=0;u<c.length;u++){let l=W[c[u]];r=l(a,n,r)}}}catch(r){console.error(r)}return a.scale_x=1,a.scale_y=1,a}function Xt(n){let t=Pt(n.binaryData,n.schema,n.bufferInfo,n.featureData);h(n.geoidDataList)&&n.geoidDataList.length>0&&Lt(t.vertexCount,t.positions,t.scale_x,t.scale_y,n.cartographicCenter,n.geoidDataList,!1),Ot(t.vertexCount,t.positions,t.normals,n.cartographicCenter,n.cartesianCenter,n.parentRotation,n.ellipsoidRadiiSquare,t.scale_x,t.scale_y),h(t.uv0s)&&h(t["uv-region"])&&Tt(t.vertexCount,t.uv0s,t["uv-region"]);let e;if(h(t["feature-index"]))e=t["feature-index"];else if(h(t.faceRange)){e=new Array(t.vertexCount);for(let r=0;r<t.faceRange.length-1;r+=2){let s=r/2,c=t.faceRange[r],u=t.faceRange[r+1];for(let l=c;l<=u;l++)e[l*3]=s,e[l*3+1]=s,e[l*3+2]=s}}if(n.calculateNormals){let r=vt(t.vertexCount,t.indices,t.positions,t.normals,t.uv0s,t.colors,e);h(r.normals)&&(t.normals=r.normals,h(r.vertexCount)&&(t.vertexCount=r.vertexCount,t.indices=r.indices,t.positions=r.positions,t.uv0s=r.uv0s,t.colors=r.colors,e=r.featureIndex))}let o=Mt(t.vertexCount,t.indices,t.positions,t.normals,t.uv0s,t.colors,e,n),a={positions:t.positions,indices:t.indices,featureIndex:e,sourceURL:n.url,cartesianCenter:n.cartesianCenter,parentRotation:n.parentRotation};return o._customAttributes=a,{meshData:o}}async function Yt(n,t){let e=n.webAssemblyConfig;return h(e)&&h(e.wasmBinaryFile)?ut=await(0,at.default)(e):ut=await(0,at.default)(),!0}function zt(n,t){let e=n.webAssemblyConfig;return h(e)?Yt(n,t):Xt(n,t)}var se=yt(zt);export{se as default}; diff --git a/public/js/Cesium2/Workers/transcodeKTX2.js b/public/js/Cesium2/Workers/transcodeKTX2.js index 4ec3043ca..5e7cfa47c 100644 --- a/public/js/Cesium2/Workers/transcodeKTX2.js +++ b/public/js/Cesium2/Workers/transcodeKTX2.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as rn}from"./chunk-4BYMTYMT.js";import{a as M}from"./chunk-54PMPXZ4.js";import{a as ie}from"./chunk-R62IKKEC.js";import{a as _n}from"./chunk-N3A5CZ2S.js";import{b as nn}from"./chunk-G75U3WZT.js";import{a as Gt,c as sr,d as or,e as ge}from"./chunk-3THTQ4QB.js";var Rn=sr((it,pt)=>{var Nt=function(){var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(i=i||__filename),function(f){f=f||{};var r=typeof f<"u"?f:{},C,l;r.ready=new Promise(function(e,t){C=e,l=t});var P={},F;for(F in r)r.hasOwnProperty(F)&&(P[F]=r[F]);var U=[],y="./this.program",m=function(e,t){throw t},V=!1,d=!1,p=!1,Q=!1;V=typeof window=="object",d=typeof importScripts=="function",p=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Q=!V&&!p&&!d;var u="";function X(e){return r.locateFile?r.locateFile(e,u):u+e}var se,le,W,J,g,Fe;p?(d?u=Gt("path").dirname(u)+"/":u=__dirname+"/",se=function(t,n){return g||(g=Gt("fs")),Fe||(Fe=Gt("path")),t=Fe.normalize(t),g.readFileSync(t,n?null:"utf8")},W=function(t){var n=se(t,!0);return n.buffer||(n=new Uint8Array(n)),Se(n.buffer),n},process.argv.length>1&&(y=process.argv[1].replace(/\\/g,"/")),U=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof rr))throw e}),process.on("unhandledRejection",Me),m=function(e){process.exit(e)},r.inspect=function(){return"[Emscripten Module object]"}):Q?(typeof read<"u"&&(se=function(t){return read(t)}),W=function(t){var n;return typeof readbuffer=="function"?new Uint8Array(readbuffer(t)):(n=read(t,"binary"),Se(typeof n=="object"),n)},typeof scriptArgs<"u"?U=scriptArgs:typeof arguments<"u"&&(U=arguments),typeof quit=="function"&&(m=function(e){quit(e)}),typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(V||d)&&(d?u=self.location.href:typeof document<"u"&&document.currentScript&&(u=document.currentScript.src),i&&(u=i),u.indexOf("blob:")!==0?u=u.substr(0,u.lastIndexOf("/")+1):u="",se=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(W=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),le=function(e,t,n){var _=new XMLHttpRequest;_.open("GET",e,!0),_.responseType="arraybuffer",_.onload=function(){if(_.status==200||_.status==0&&_.response){t(_.response);return}n()},_.onerror=n,_.send(null)},J=function(e){document.title=e});var st=r.print||console.log.bind(console),ee=r.printErr||console.warn.bind(console);for(F in P)P.hasOwnProperty(F)&&(r[F]=P[F]);P=null,r.arguments&&(U=r.arguments),r.thisProgram&&(y=r.thisProgram),r.quit&&(m=r.quit);var De=0,Ie=function(e){De=e},ae;r.wasmBinary&&(ae=r.wasmBinary);var ot=r.noExitRuntime||!0;typeof WebAssembly!="object"&&Me("no native wasm support detected");var ce,de=!1,be;function Se(e,t){e||Me("Assertion failed: "+t)}var we=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function He(e,t,n){for(var _=t+n,s=t;e[s]&&!(s>=_);)++s;if(s-t>16&&e.subarray&&we)return we.decode(e.subarray(t,s));for(var a="";t<s;){var c=e[t++];if(!(c&128)){a+=String.fromCharCode(c);continue}var o=e[t++]&63;if((c&224)==192){a+=String.fromCharCode((c&31)<<6|o);continue}var R=e[t++]&63;if((c&240)==224?c=(c&15)<<12|o<<6|R:c=(c&7)<<18|o<<12|R<<6|e[t++]&63,c<65536)a+=String.fromCharCode(c);else{var T=c-65536;a+=String.fromCharCode(55296|T>>10,56320|T&1023)}}return a}function Xe(e,t){return e?He(D,e,t):""}function Rt(e,t,n,_){if(!(_>0))return 0;for(var s=n,a=n+_-1,c=0;c<e.length;++c){var o=e.charCodeAt(c);if(o>=55296&&o<=57343){var R=e.charCodeAt(++c);o=65536+((o&1023)<<10)|R&1023}if(o<=127){if(n>=a)break;t[n++]=o}else if(o<=2047){if(n+1>=a)break;t[n++]=192|o>>6,t[n++]=128|o&63}else if(o<=65535){if(n+2>=a)break;t[n++]=224|o>>12,t[n++]=128|o>>6&63,t[n++]=128|o&63}else{if(n+3>=a)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63,t[n++]=128|o>>6&63,t[n++]=128|o&63}}return t[n]=0,n-s}function L(e,t,n){return Rt(e,D,t,n)}function j(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&(_=65536+((_&1023)<<10)|e.charCodeAt(++n)&1023),_<=127?++t:_<=2047?t+=2:_<=65535?t+=3:t+=4}return t}var Ae=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function at(e,t){for(var n=e,_=n>>1,s=_+t/2;!(_>=s)&&Ge[_];)++_;if(n=_<<1,n-e>32&&Ae)return Ae.decode(D.subarray(e,n));for(var a="",c=0;!(c>=t/2);++c){var o=fe[e+c*2>>1];if(o==0)break;a+=String.fromCharCode(o)}return a}function xe(e,t,n){if(n===void 0&&(n=2147483647),n<2)return 0;n-=2;for(var _=t,s=n<e.length*2?n/2:e.length,a=0;a<s;++a){var c=e.charCodeAt(a);fe[t>>1]=c,t+=2}return fe[t>>1]=0,t-_}function Tn(e){return e.length*2}function un(e,t){for(var n=0,_="";!(n>=t/4);){var s=w[e+n*4>>2];if(s==0)break;if(++n,s>=65536){var a=s-65536;_+=String.fromCharCode(55296|a>>10,56320|a&1023)}else _+=String.fromCharCode(s)}return _}function On(e,t,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var _=t,s=_+n-4,a=0;a<e.length;++a){var c=e.charCodeAt(a);if(c>=55296&&c<=57343){var o=e.charCodeAt(++a);c=65536+((c&1023)<<10)|o&1023}if(w[t>>2]=c,t+=4,t+4>s)break}return w[t>>2]=0,t-_}function ln(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&++n,t+=4}return t}function Mn(e,t){return e%t>0&&(e+=t-e%t),e}var ct,ke,D,fe,Ge,w,Y,Pt,Et;function vt(e){ct=e,r.HEAP8=ke=new Int8Array(e),r.HEAP16=fe=new Int16Array(e),r.HEAP32=w=new Int32Array(e),r.HEAPU8=D=new Uint8Array(e),r.HEAPU16=Ge=new Uint16Array(e),r.HEAPU32=Y=new Uint32Array(e),r.HEAPF32=Pt=new Float32Array(e),r.HEAPF64=Et=new Float64Array(e)}var ur=r.INITIAL_MEMORY||16777216,Ve,ht=[],Ut=[],Kn=[],yt=[],Bn=!1;function Cn(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Gn(r.preRun.shift());$e(ht)}function Fn(){Bn=!0,$e(Ut)}function dn(){$e(Kn)}function Sn(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)Nn(r.postRun.shift());$e(yt)}function Gn(e){ht.unshift(e)}function Vn(e){Ut.unshift(e)}function Nn(e){yt.unshift(e)}var Te=0,At=null,Ne=null;function pn(e){Te++,r.monitorRunDependencies&&r.monitorRunDependencies(Te)}function Pn(e){if(Te--,r.monitorRunDependencies&&r.monitorRunDependencies(Te),Te==0&&(At!==null&&(clearInterval(At),At=null),Ne)){var t=Ne;Ne=null,t()}}r.preloadedImages={},r.preloadedAudios={};function Me(e){r.onAbort&&r.onAbort(e),e+="",ee(e),de=!0,be=1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw l(t),t}function gt(e,t){return String.prototype.startsWith?e.startsWith(t):e.indexOf(t)===0}var En="data:application/octet-stream;base64,";function Lt(e){return gt(e,En)}var vn="file://";function mt(e){return gt(e,vn)}var x="basis_transcoder.wasm";Lt(x)||(x=X(x));function Dt(e){try{if(e==x&&ae)return new Uint8Array(ae);if(W)return W(e);throw"both async and sync fetching of the wasm failed"}catch(t){Me(t)}}function hn(){if(!ae&&(V||d)){if(typeof fetch=="function"&&!mt(x))return fetch(x,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+x+"'";return e.arrayBuffer()}).catch(function(){return Dt(x)});if(le)return new Promise(function(e,t){le(x,function(n){e(new Uint8Array(n))},t)})}return Promise.resolve().then(function(){return Dt(x)})}function Un(){var e={a:er};function t(c,o){var R=c.exports;r.asm=R,ce=r.asm.K,vt(ce.buffer),Ve=r.asm.O,Vn(r.asm.L),Pn("wasm-instantiate")}pn("wasm-instantiate");function n(c){t(c.instance)}function _(c){return hn().then(function(o){var R=WebAssembly.instantiate(o,e);return R}).then(c,function(o){ee("failed to asynchronously prepare wasm: "+o),Me(o)})}function s(){return!ae&&typeof WebAssembly.instantiateStreaming=="function"&&!Lt(x)&&!mt(x)&&typeof fetch=="function"?fetch(x,{credentials:"same-origin"}).then(function(c){var o=WebAssembly.instantiateStreaming(c,e);return o.then(n,function(R){return ee("wasm streaming compile failed: "+R),ee("falling back to ArrayBuffer instantiation"),_(n)})}):_(n)}if(r.instantiateWasm)try{var a=r.instantiateWasm(e,t);return a}catch(c){return ee("Module.instantiateWasm callback failed with error: "+c),!1}return s().catch(l),{}}function $e(e){for(;e.length>0;){var t=e.shift();if(typeof t=="function"){t(r);continue}var n=t.func;typeof n=="number"?t.arg===void 0?Ve.get(n)():Ve.get(n)(t.arg):n(t.arg===void 0?null:t.arg)}}var We={};function je(e){for(;e.length;){var t=e.pop(),n=e.pop();n(t)}}function pe(e){return this.fromWireType(Y[e>>2])}var Ke={},ue={},ze={},yn=48,gn=57;function Ye(e){if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=yn&&t<=gn?"_"+e:e}function qe(e,t){return e=Ye(e),new Function("body","return function "+e+`() { +import{a as rn}from"./chunk-4E3APMCC.js";import{a as M}from"./chunk-UKWFHLUK.js";import{a as ie}from"./chunk-UAWOHN7R.js";import{a as _n}from"./chunk-TA3RE4KQ.js";import{b as nn}from"./chunk-RTY3VPG6.js";import{a as Gt,c as sr,d as or,e as ge}from"./chunk-LRNH5AEO.js";var Rn=sr((it,pt)=>{var Nt=function(){var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(i=i||__filename),function(f){f=f||{};var r=typeof f<"u"?f:{},C,l;r.ready=new Promise(function(e,t){C=e,l=t});var P={},F;for(F in r)r.hasOwnProperty(F)&&(P[F]=r[F]);var U=[],y="./this.program",m=function(e,t){throw t},V=!1,d=!1,p=!1,Q=!1;V=typeof window=="object",d=typeof importScripts=="function",p=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Q=!V&&!p&&!d;var u="";function X(e){return r.locateFile?r.locateFile(e,u):u+e}var se,le,W,J,g,Fe;p?(d?u=Gt("path").dirname(u)+"/":u=__dirname+"/",se=function(t,n){return g||(g=Gt("fs")),Fe||(Fe=Gt("path")),t=Fe.normalize(t),g.readFileSync(t,n?null:"utf8")},W=function(t){var n=se(t,!0);return n.buffer||(n=new Uint8Array(n)),Se(n.buffer),n},process.argv.length>1&&(y=process.argv[1].replace(/\\/g,"/")),U=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof rr))throw e}),process.on("unhandledRejection",Me),m=function(e){process.exit(e)},r.inspect=function(){return"[Emscripten Module object]"}):Q?(typeof read<"u"&&(se=function(t){return read(t)}),W=function(t){var n;return typeof readbuffer=="function"?new Uint8Array(readbuffer(t)):(n=read(t,"binary"),Se(typeof n=="object"),n)},typeof scriptArgs<"u"?U=scriptArgs:typeof arguments<"u"&&(U=arguments),typeof quit=="function"&&(m=function(e){quit(e)}),typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(V||d)&&(d?u=self.location.href:typeof document<"u"&&document.currentScript&&(u=document.currentScript.src),i&&(u=i),u.indexOf("blob:")!==0?u=u.substr(0,u.lastIndexOf("/")+1):u="",se=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(W=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),le=function(e,t,n){var _=new XMLHttpRequest;_.open("GET",e,!0),_.responseType="arraybuffer",_.onload=function(){if(_.status==200||_.status==0&&_.response){t(_.response);return}n()},_.onerror=n,_.send(null)},J=function(e){document.title=e});var st=r.print||console.log.bind(console),ee=r.printErr||console.warn.bind(console);for(F in P)P.hasOwnProperty(F)&&(r[F]=P[F]);P=null,r.arguments&&(U=r.arguments),r.thisProgram&&(y=r.thisProgram),r.quit&&(m=r.quit);var De=0,Ie=function(e){De=e},ae;r.wasmBinary&&(ae=r.wasmBinary);var ot=r.noExitRuntime||!0;typeof WebAssembly!="object"&&Me("no native wasm support detected");var ce,de=!1,be;function Se(e,t){e||Me("Assertion failed: "+t)}var we=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function He(e,t,n){for(var _=t+n,s=t;e[s]&&!(s>=_);)++s;if(s-t>16&&e.subarray&&we)return we.decode(e.subarray(t,s));for(var a="";t<s;){var c=e[t++];if(!(c&128)){a+=String.fromCharCode(c);continue}var o=e[t++]&63;if((c&224)==192){a+=String.fromCharCode((c&31)<<6|o);continue}var R=e[t++]&63;if((c&240)==224?c=(c&15)<<12|o<<6|R:c=(c&7)<<18|o<<12|R<<6|e[t++]&63,c<65536)a+=String.fromCharCode(c);else{var T=c-65536;a+=String.fromCharCode(55296|T>>10,56320|T&1023)}}return a}function Xe(e,t){return e?He(D,e,t):""}function Rt(e,t,n,_){if(!(_>0))return 0;for(var s=n,a=n+_-1,c=0;c<e.length;++c){var o=e.charCodeAt(c);if(o>=55296&&o<=57343){var R=e.charCodeAt(++c);o=65536+((o&1023)<<10)|R&1023}if(o<=127){if(n>=a)break;t[n++]=o}else if(o<=2047){if(n+1>=a)break;t[n++]=192|o>>6,t[n++]=128|o&63}else if(o<=65535){if(n+2>=a)break;t[n++]=224|o>>12,t[n++]=128|o>>6&63,t[n++]=128|o&63}else{if(n+3>=a)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63,t[n++]=128|o>>6&63,t[n++]=128|o&63}}return t[n]=0,n-s}function L(e,t,n){return Rt(e,D,t,n)}function j(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&(_=65536+((_&1023)<<10)|e.charCodeAt(++n)&1023),_<=127?++t:_<=2047?t+=2:_<=65535?t+=3:t+=4}return t}var Ae=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function at(e,t){for(var n=e,_=n>>1,s=_+t/2;!(_>=s)&&Ge[_];)++_;if(n=_<<1,n-e>32&&Ae)return Ae.decode(D.subarray(e,n));for(var a="",c=0;!(c>=t/2);++c){var o=fe[e+c*2>>1];if(o==0)break;a+=String.fromCharCode(o)}return a}function xe(e,t,n){if(n===void 0&&(n=2147483647),n<2)return 0;n-=2;for(var _=t,s=n<e.length*2?n/2:e.length,a=0;a<s;++a){var c=e.charCodeAt(a);fe[t>>1]=c,t+=2}return fe[t>>1]=0,t-_}function Tn(e){return e.length*2}function un(e,t){for(var n=0,_="";!(n>=t/4);){var s=w[e+n*4>>2];if(s==0)break;if(++n,s>=65536){var a=s-65536;_+=String.fromCharCode(55296|a>>10,56320|a&1023)}else _+=String.fromCharCode(s)}return _}function On(e,t,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var _=t,s=_+n-4,a=0;a<e.length;++a){var c=e.charCodeAt(a);if(c>=55296&&c<=57343){var o=e.charCodeAt(++a);c=65536+((c&1023)<<10)|o&1023}if(w[t>>2]=c,t+=4,t+4>s)break}return w[t>>2]=0,t-_}function ln(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&++n,t+=4}return t}function Mn(e,t){return e%t>0&&(e+=t-e%t),e}var ct,ke,D,fe,Ge,w,Y,Pt,Et;function vt(e){ct=e,r.HEAP8=ke=new Int8Array(e),r.HEAP16=fe=new Int16Array(e),r.HEAP32=w=new Int32Array(e),r.HEAPU8=D=new Uint8Array(e),r.HEAPU16=Ge=new Uint16Array(e),r.HEAPU32=Y=new Uint32Array(e),r.HEAPF32=Pt=new Float32Array(e),r.HEAPF64=Et=new Float64Array(e)}var ur=r.INITIAL_MEMORY||16777216,Ve,ht=[],Ut=[],Kn=[],yt=[],Bn=!1;function Cn(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Gn(r.preRun.shift());$e(ht)}function Fn(){Bn=!0,$e(Ut)}function dn(){$e(Kn)}function Sn(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)Nn(r.postRun.shift());$e(yt)}function Gn(e){ht.unshift(e)}function Vn(e){Ut.unshift(e)}function Nn(e){yt.unshift(e)}var Te=0,At=null,Ne=null;function pn(e){Te++,r.monitorRunDependencies&&r.monitorRunDependencies(Te)}function Pn(e){if(Te--,r.monitorRunDependencies&&r.monitorRunDependencies(Te),Te==0&&(At!==null&&(clearInterval(At),At=null),Ne)){var t=Ne;Ne=null,t()}}r.preloadedImages={},r.preloadedAudios={};function Me(e){r.onAbort&&r.onAbort(e),e+="",ee(e),de=!0,be=1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw l(t),t}function gt(e,t){return String.prototype.startsWith?e.startsWith(t):e.indexOf(t)===0}var En="data:application/octet-stream;base64,";function Lt(e){return gt(e,En)}var vn="file://";function mt(e){return gt(e,vn)}var x="basis_transcoder.wasm";Lt(x)||(x=X(x));function Dt(e){try{if(e==x&&ae)return new Uint8Array(ae);if(W)return W(e);throw"both async and sync fetching of the wasm failed"}catch(t){Me(t)}}function hn(){if(!ae&&(V||d)){if(typeof fetch=="function"&&!mt(x))return fetch(x,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+x+"'";return e.arrayBuffer()}).catch(function(){return Dt(x)});if(le)return new Promise(function(e,t){le(x,function(n){e(new Uint8Array(n))},t)})}return Promise.resolve().then(function(){return Dt(x)})}function Un(){var e={a:er};function t(c,o){var R=c.exports;r.asm=R,ce=r.asm.K,vt(ce.buffer),Ve=r.asm.O,Vn(r.asm.L),Pn("wasm-instantiate")}pn("wasm-instantiate");function n(c){t(c.instance)}function _(c){return hn().then(function(o){var R=WebAssembly.instantiate(o,e);return R}).then(c,function(o){ee("failed to asynchronously prepare wasm: "+o),Me(o)})}function s(){return!ae&&typeof WebAssembly.instantiateStreaming=="function"&&!Lt(x)&&!mt(x)&&typeof fetch=="function"?fetch(x,{credentials:"same-origin"}).then(function(c){var o=WebAssembly.instantiateStreaming(c,e);return o.then(n,function(R){return ee("wasm streaming compile failed: "+R),ee("falling back to ArrayBuffer instantiation"),_(n)})}):_(n)}if(r.instantiateWasm)try{var a=r.instantiateWasm(e,t);return a}catch(c){return ee("Module.instantiateWasm callback failed with error: "+c),!1}return s().catch(l),{}}function $e(e){for(;e.length>0;){var t=e.shift();if(typeof t=="function"){t(r);continue}var n=t.func;typeof n=="number"?t.arg===void 0?Ve.get(n)():Ve.get(n)(t.arg):n(t.arg===void 0?null:t.arg)}}var We={};function je(e){for(;e.length;){var t=e.pop(),n=e.pop();n(t)}}function pe(e){return this.fromWireType(Y[e>>2])}var Ke={},ue={},ze={},yn=48,gn=57;function Ye(e){if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=yn&&t<=gn?"_"+e:e}function qe(e,t){return e=Ye(e),new Function("body","return function "+e+`() { "use strict"; return body.apply(this, arguments); }; `)(t)}function ft(e,t){var n=qe(t,function(_){this.name=t,this.message=_;var s=new Error(_).stack;s!==void 0&&(this.stack=this.toString()+` diff --git a/public/js/Cesium2/Workers/transferTypedArrayTest.js b/public/js/Cesium2/Workers/transferTypedArrayTest.js index beeacd97e..3be11cbfd 100644 --- a/public/js/Cesium2/Workers/transferTypedArrayTest.js +++ b/public/js/Cesium2/Workers/transferTypedArrayTest.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * diff --git a/public/js/Cesium2/Workers/upsampleQuantizedTerrainMesh.js b/public/js/Cesium2/Workers/upsampleQuantizedTerrainMesh.js index 5564be5e0..ba7605fe0 100644 --- a/public/js/Cesium2/Workers/upsampleQuantizedTerrainMesh.js +++ b/public/js/Cesium2/Workers/upsampleQuantizedTerrainMesh.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as be,b as Ne}from"./chunk-PJQ53UQY.js";import{a as Ae}from"./chunk-4BYMTYMT.js";import{a as ue}from"./chunk-SOCYD7RP.js";import{a as ee}from"./chunk-Q5MYX5A2.js";import"./chunk-CTRWX4F5.js";import"./chunk-Z7BLUZ7R.js";import"./chunk-PY4CW263.js";import"./chunk-RRZIPF5C.js";import{a as Ve}from"./chunk-34ULWVZF.js";import{d as de}from"./chunk-K2M3OJ7Z.js";import{h as Se}from"./chunk-M3A6SPGI.js";import"./chunk-D5HNP2LB.js";import{a as A,b as Ie,c as Z,d as Ce}from"./chunk-S4VBGY2U.js";import{a as N}from"./chunk-UCTPWOTZ.js";import"./chunk-54PMPXZ4.js";import"./chunk-R62IKKEC.js";import"./chunk-N3A5CZ2S.js";import{a as V,b as q}from"./chunk-G75U3WZT.js";import{e as f}from"./chunk-3THTQ4QB.js";var ne={};ne.clipTriangleAtAxisAlignedThreshold=function(n,h,o,i,s,e){if(!f(n))throw new V("threshold is required.");if(!f(h))throw new V("keepAbove is required.");if(!f(o))throw new V("u0 is required.");if(!f(i))throw new V("u1 is required.");if(!f(s))throw new V("u2 is required.");f(e)?e.length=0:e=[];let g,w,c;h?(g=o<n,w=i<n,c=s<n):(g=o>n,w=i>n,c=s>n);let p=g+w+c,d,u,r,l,I,C;return p===1?g?(d=(n-o)/(i-o),u=(n-o)/(s-o),e.push(1),e.push(2),u!==1&&(e.push(-1),e.push(0),e.push(2),e.push(u)),d!==1&&(e.push(-1),e.push(0),e.push(1),e.push(d))):w?(r=(n-i)/(s-i),l=(n-i)/(o-i),e.push(2),e.push(0),l!==1&&(e.push(-1),e.push(1),e.push(0),e.push(l)),r!==1&&(e.push(-1),e.push(1),e.push(2),e.push(r))):c&&(I=(n-s)/(o-s),C=(n-s)/(i-s),e.push(0),e.push(1),C!==1&&(e.push(-1),e.push(2),e.push(1),e.push(C)),I!==1&&(e.push(-1),e.push(2),e.push(0),e.push(I))):p===2?!g&&o!==n?(l=(n-i)/(o-i),I=(n-s)/(o-s),e.push(0),e.push(-1),e.push(1),e.push(0),e.push(l),e.push(-1),e.push(2),e.push(0),e.push(I)):!w&&i!==n?(C=(n-s)/(i-s),d=(n-o)/(i-o),e.push(1),e.push(-1),e.push(2),e.push(1),e.push(C),e.push(-1),e.push(0),e.push(1),e.push(d)):!c&&s!==n&&(u=(n-o)/(s-o),r=(n-i)/(s-i),e.push(2),e.push(-1),e.push(0),e.push(2),e.push(u),e.push(-1),e.push(1),e.push(2),e.push(r)):p!==3&&(e.push(0),e.push(1),e.push(2)),e};ne.computeBarycentricCoordinates=function(n,h,o,i,s,e,g,w,c){if(!f(n))throw new V("x is required.");if(!f(h))throw new V("y is required.");if(!f(o))throw new V("x1 is required.");if(!f(i))throw new V("y1 is required.");if(!f(s))throw new V("x2 is required.");if(!f(e))throw new V("y2 is required.");if(!f(g))throw new V("x3 is required.");if(!f(w))throw new V("y3 is required.");let p=o-g,d=g-s,u=e-w,r=i-w,l=1/(u*p+d*r),I=h-w,C=n-g,R=(u*C+d*I)*l,O=(-r*C+p*I)*l,W=1-R-O;return f(c)?(c.x=R,c.y=O,c.z=W,c):new A(R,O,W)};ne.computeLineSegmentLineSegmentIntersection=function(n,h,o,i,s,e,g,w,c){q.typeOf.number("x00",n),q.typeOf.number("y00",h),q.typeOf.number("x01",o),q.typeOf.number("y01",i),q.typeOf.number("x10",s),q.typeOf.number("y10",e),q.typeOf.number("x11",g),q.typeOf.number("y11",w);let p=(g-s)*(h-e)-(w-e)*(n-s),d=(o-n)*(h-e)-(i-h)*(n-s),u=(w-e)*(o-n)-(g-s)*(i-h);if(u===0)return;let r=p/u,l=d/u;if(r>=0&&r<=1&&l>=0&&l<=1)return f(c)||(c=new Z),c.x=n+r*(o-n),c.y=h+r*(i-h),c};var ie=ne;var a=32767,z=a/2|0,Me=[],ze=[],Xe=[],te=new Ie,E=new A,Ke=[],We=[],Ye=[],Le=[],_e=[],Je=new A,Qe=new de,Ze=new ue,Ge=new Z,$e=new A;function je(n,h){let o=n.isEastChild,i=n.isNorthChild,s=o?z:0,e=o?a:z,g=i?z:0,w=i?a:z,c=Ke,p=We,d=Ye,u=_e;c.length=0,p.length=0,d.length=0,u.length=0;let r=Le;r.length=0;let l={},I=n.vertices,C=n.indices;C=C.subarray(0,n.indexCountWithoutSkirts);let R=Ne.clone(n.encoding),O=R.hasVertexNormals,W=0,Y=n.vertexCountWithoutSkirts,se=n.minimumHeight,ae=n.maximumHeight,D=new Array(Y),G=new Array(Y),L=new Array(Y),F=O?new Array(Y*2):void 0,$=20,H,t,k,x,y;for(t=0,k=0;t<Y;++t,k+=2){let v=R.decodeTextureCoordinates(I,t,Ge);if(H=R.decodeHeight(I,t),x=N.clamp(v.x*a|0,0,a),y=N.clamp(v.y*a|0,0,a),L[t]=N.clamp((H-se)/(ae-se)*a|0,0,a),x<$&&(x=0),y<$&&(y=0),a-x<$&&(x=a),a-y<$&&(y=a),D[t]=x,G[t]=y,O){let Q=R.getOctEncodedNormal(I,t,$e);F[k]=Q.x,F[k+1]=Q.y}(o&&x>=z||!o&&x<=z)&&(i&&y>=z||!i&&y<=z)&&(l[t]=W,c.push(x),p.push(y),d.push(L[t]),O&&(u.push(F[k]),u.push(F[k+1])),++W)}let T=[];T.push(new m),T.push(new m),T.push(new m);let B=[];B.push(new m),B.push(new m),B.push(new m);let b,j;for(t=0;t<C.length;t+=3){let v=C[t],Q=C[t+1],Be=C[t+2],De=D[v],Fe=D[Q],ke=D[Be];T[0].initializeIndexed(D,G,L,F,v),T[1].initializeIndexed(D,G,L,F,Q),T[2].initializeIndexed(D,G,L,F,Be);let P=ie.clipTriangleAtAxisAlignedThreshold(z,o,De,Fe,ke,Me);b=0,!(b>=P.length)&&(b=B[0].initializeFromClipResult(P,b,T),!(b>=P.length)&&(b=B[1].initializeFromClipResult(P,b,T),!(b>=P.length)&&(b=B[2].initializeFromClipResult(P,b,T),j=ie.clipTriangleAtAxisAlignedThreshold(z,i,B[0].getV(),B[1].getV(),B[2].getV(),ze),Oe(c,p,d,u,r,l,j,B,O),b<P.length&&(B[2].clone(B[1]),B[2].initializeFromClipResult(P,b,T),j=ie.clipTriangleAtAxisAlignedThreshold(z,i,B[0].getV(),B[1].getV(),B[2].getV(),ze),Oe(c,p,d,u,r,l,j,B,O)))))}let He=o?-a:0,qe=i?-a:0,me=[],ge=[],le=[],we=[],U=Number.MAX_VALUE,_=-U,M=Xe;M.length=0;let re=Ce.clone(n.ellipsoid),J=Se.clone(n.childRectangle),Ee=J.north,Re=J.south,ce=J.east,xe=J.west;for(ce<xe&&(ce+=N.TWO_PI),t=0;t<c.length;++t)x=Math.round(c[t]),x<=s?(me.push(t),x=0):x>=e?(le.push(t),x=a):x=x*2+He,c[t]=x,y=Math.round(p[t]),y<=g?(ge.push(t),y=0):y>=w?(we.push(t),y=a):y=y*2+qe,p[t]=y,H=N.lerp(se,ae,d[t]/a),H<U&&(U=H),H>_&&(_=H),d[t]=H,te.longitude=N.lerp(xe,ce,x/a),te.latitude=N.lerp(Re,Ee,y/a),te.height=H,re.cartographicToCartesian(te,E),M.push(E.x),M.push(E.y),M.push(E.z);let he=de.fromVertices(M,A.ZERO,3,Qe),Ue=ue.fromRectangle(J,U,_,re,Ze),ve=new be(re).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(he.center,M,3,he.center,U,Je),Pe=_-U,X=new Uint16Array(c.length+p.length+d.length);for(t=0;t<c.length;++t)X[t]=c[t];let fe=c.length;for(t=0;t<p.length;++t)X[fe+t]=p[t];for(fe+=p.length,t=0;t<d.length;++t)X[fe+t]=a*(d[t]-U)/Pe;let pe=Ve.createTypedArray(c.length,r),ye;if(O){let v=new Uint8Array(u);h.push(X.buffer,pe.buffer,v.buffer),ye=v.buffer}else h.push(X.buffer,pe.buffer);return{vertices:X.buffer,encodedNormals:ye,indices:pe.buffer,minimumHeight:U,maximumHeight:_,westIndices:me,southIndices:ge,eastIndices:le,northIndices:we,boundingSphere:he,orientedBoundingBox:Ue,horizonOcclusionPoint:ve}}function m(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}m.prototype.clone=function(n){return f(n)||(n=new m),n.uBuffer=this.uBuffer,n.vBuffer=this.vBuffer,n.heightBuffer=this.heightBuffer,n.normalBuffer=this.normalBuffer,n.index=this.index,n.first=this.first,n.second=this.second,n.ratio=this.ratio,n};m.prototype.initializeIndexed=function(n,h,o,i,s){this.uBuffer=n,this.vBuffer=h,this.heightBuffer=o,this.normalBuffer=i,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0};m.prototype.initializeFromClipResult=function(n,h,o){let i=h+1;return n[h]!==-1?o[n[h]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=o[n[i]],++i,this.second=o[n[i]],++i,this.ratio=n[i],++i),i};m.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})};m.prototype.isIndexed=function(){return f(this.index)};m.prototype.getH=function(){return f(this.index)?this.heightBuffer[this.index]:N.lerp(this.first.getH(),this.second.getH(),this.ratio)};m.prototype.getU=function(){return f(this.index)?this.uBuffer[this.index]:N.lerp(this.first.getU(),this.second.getU(),this.ratio)};m.prototype.getV=function(){return f(this.index)?this.vBuffer[this.index]:N.lerp(this.first.getV(),this.second.getV(),this.ratio)};var K=new Z,oe=-1,en=[new A,new A],nn=[new A,new A];function Te(n,h){++oe;let o=en[oe],i=nn[oe];return o=ee.octDecode(n.first.getNormalX(),n.first.getNormalY(),o),i=ee.octDecode(n.second.getNormalX(),n.second.getNormalY(),i),E=A.lerp(o,i,n.ratio,E),A.normalize(E,E),ee.octEncode(E,h),--oe,h}m.prototype.getNormalX=function(){return f(this.index)?this.normalBuffer[this.index*2]:(K=Te(this,K),K.x)};m.prototype.getNormalY=function(){return f(this.index)?this.normalBuffer[this.index*2+1]:(K=Te(this,K),K.y)};var S=[];S.push(new m);S.push(new m);S.push(new m);S.push(new m);function Oe(n,h,o,i,s,e,g,w,c){if(g.length===0)return;let p=0,d=0;for(;d<g.length;)d=S[p++].initializeFromClipResult(g,d,w);for(let u=0;u<p;++u){let r=S[u];if(r.isIndexed())r.newIndex=e[r.index],r.uBuffer=n,r.vBuffer=h,r.heightBuffer=o,c&&(r.normalBuffer=i);else{let l=r.getKey();if(f(e[l]))r.newIndex=e[l];else{let I=n.length;n.push(r.getU()),h.push(r.getV()),o.push(r.getH()),c&&(i.push(r.getNormalX()),i.push(r.getNormalY())),r.newIndex=I,e[l]=I}}}p===3?(s.push(S[0].newIndex),s.push(S[1].newIndex),s.push(S[2].newIndex)):p===4&&(s.push(S[0].newIndex),s.push(S[1].newIndex),s.push(S[2].newIndex),s.push(S[0].newIndex),s.push(S[2].newIndex),s.push(S[3].newIndex))}var An=Ae(je);export{An as default}; +import{a as be,b as Ne}from"./chunk-VQ4ICMD3.js";import{a as Ae}from"./chunk-4E3APMCC.js";import{a as ue}from"./chunk-DGVML3P5.js";import{a as ee}from"./chunk-VMXXQ6B4.js";import"./chunk-P73YILG6.js";import"./chunk-VYMAIP2A.js";import"./chunk-V7XARCCV.js";import"./chunk-SACP225T.js";import{a as Ve}from"./chunk-YFQNY2YN.js";import{d as de}from"./chunk-2NIQ5ECB.js";import{h as Se}from"./chunk-7YEOLR2L.js";import"./chunk-QHHYYTCM.js";import{a as A,b as Ie,c as Z,d as Ce}from"./chunk-RH3GFHG2.js";import{a as N}from"./chunk-FRWNWNYJ.js";import"./chunk-UKWFHLUK.js";import"./chunk-UAWOHN7R.js";import"./chunk-TA3RE4KQ.js";import{a as V,b as q}from"./chunk-RTY3VPG6.js";import{e as f}from"./chunk-LRNH5AEO.js";var ne={};ne.clipTriangleAtAxisAlignedThreshold=function(n,h,o,i,s,e){if(!f(n))throw new V("threshold is required.");if(!f(h))throw new V("keepAbove is required.");if(!f(o))throw new V("u0 is required.");if(!f(i))throw new V("u1 is required.");if(!f(s))throw new V("u2 is required.");f(e)?e.length=0:e=[];let g,w,c;h?(g=o<n,w=i<n,c=s<n):(g=o>n,w=i>n,c=s>n);let p=g+w+c,d,u,r,l,I,C;return p===1?g?(d=(n-o)/(i-o),u=(n-o)/(s-o),e.push(1),e.push(2),u!==1&&(e.push(-1),e.push(0),e.push(2),e.push(u)),d!==1&&(e.push(-1),e.push(0),e.push(1),e.push(d))):w?(r=(n-i)/(s-i),l=(n-i)/(o-i),e.push(2),e.push(0),l!==1&&(e.push(-1),e.push(1),e.push(0),e.push(l)),r!==1&&(e.push(-1),e.push(1),e.push(2),e.push(r))):c&&(I=(n-s)/(o-s),C=(n-s)/(i-s),e.push(0),e.push(1),C!==1&&(e.push(-1),e.push(2),e.push(1),e.push(C)),I!==1&&(e.push(-1),e.push(2),e.push(0),e.push(I))):p===2?!g&&o!==n?(l=(n-i)/(o-i),I=(n-s)/(o-s),e.push(0),e.push(-1),e.push(1),e.push(0),e.push(l),e.push(-1),e.push(2),e.push(0),e.push(I)):!w&&i!==n?(C=(n-s)/(i-s),d=(n-o)/(i-o),e.push(1),e.push(-1),e.push(2),e.push(1),e.push(C),e.push(-1),e.push(0),e.push(1),e.push(d)):!c&&s!==n&&(u=(n-o)/(s-o),r=(n-i)/(s-i),e.push(2),e.push(-1),e.push(0),e.push(2),e.push(u),e.push(-1),e.push(1),e.push(2),e.push(r)):p!==3&&(e.push(0),e.push(1),e.push(2)),e};ne.computeBarycentricCoordinates=function(n,h,o,i,s,e,g,w,c){if(!f(n))throw new V("x is required.");if(!f(h))throw new V("y is required.");if(!f(o))throw new V("x1 is required.");if(!f(i))throw new V("y1 is required.");if(!f(s))throw new V("x2 is required.");if(!f(e))throw new V("y2 is required.");if(!f(g))throw new V("x3 is required.");if(!f(w))throw new V("y3 is required.");let p=o-g,d=g-s,u=e-w,r=i-w,l=1/(u*p+d*r),I=h-w,C=n-g,R=(u*C+d*I)*l,O=(-r*C+p*I)*l,W=1-R-O;return f(c)?(c.x=R,c.y=O,c.z=W,c):new A(R,O,W)};ne.computeLineSegmentLineSegmentIntersection=function(n,h,o,i,s,e,g,w,c){q.typeOf.number("x00",n),q.typeOf.number("y00",h),q.typeOf.number("x01",o),q.typeOf.number("y01",i),q.typeOf.number("x10",s),q.typeOf.number("y10",e),q.typeOf.number("x11",g),q.typeOf.number("y11",w);let p=(g-s)*(h-e)-(w-e)*(n-s),d=(o-n)*(h-e)-(i-h)*(n-s),u=(w-e)*(o-n)-(g-s)*(i-h);if(u===0)return;let r=p/u,l=d/u;if(r>=0&&r<=1&&l>=0&&l<=1)return f(c)||(c=new Z),c.x=n+r*(o-n),c.y=h+r*(i-h),c};var ie=ne;var a=32767,z=a/2|0,Me=[],ze=[],Xe=[],te=new Ie,E=new A,Ke=[],We=[],Ye=[],Le=[],_e=[],Je=new A,Qe=new de,Ze=new ue,Ge=new Z,$e=new A;function je(n,h){let o=n.isEastChild,i=n.isNorthChild,s=o?z:0,e=o?a:z,g=i?z:0,w=i?a:z,c=Ke,p=We,d=Ye,u=_e;c.length=0,p.length=0,d.length=0,u.length=0;let r=Le;r.length=0;let l={},I=n.vertices,C=n.indices;C=C.subarray(0,n.indexCountWithoutSkirts);let R=Ne.clone(n.encoding),O=R.hasVertexNormals,W=0,Y=n.vertexCountWithoutSkirts,se=n.minimumHeight,ae=n.maximumHeight,D=new Array(Y),G=new Array(Y),L=new Array(Y),F=O?new Array(Y*2):void 0,$=20,H,t,k,x,y;for(t=0,k=0;t<Y;++t,k+=2){let v=R.decodeTextureCoordinates(I,t,Ge);if(H=R.decodeHeight(I,t),x=N.clamp(v.x*a|0,0,a),y=N.clamp(v.y*a|0,0,a),L[t]=N.clamp((H-se)/(ae-se)*a|0,0,a),x<$&&(x=0),y<$&&(y=0),a-x<$&&(x=a),a-y<$&&(y=a),D[t]=x,G[t]=y,O){let Q=R.getOctEncodedNormal(I,t,$e);F[k]=Q.x,F[k+1]=Q.y}(o&&x>=z||!o&&x<=z)&&(i&&y>=z||!i&&y<=z)&&(l[t]=W,c.push(x),p.push(y),d.push(L[t]),O&&(u.push(F[k]),u.push(F[k+1])),++W)}let T=[];T.push(new m),T.push(new m),T.push(new m);let B=[];B.push(new m),B.push(new m),B.push(new m);let b,j;for(t=0;t<C.length;t+=3){let v=C[t],Q=C[t+1],Be=C[t+2],De=D[v],Fe=D[Q],ke=D[Be];T[0].initializeIndexed(D,G,L,F,v),T[1].initializeIndexed(D,G,L,F,Q),T[2].initializeIndexed(D,G,L,F,Be);let P=ie.clipTriangleAtAxisAlignedThreshold(z,o,De,Fe,ke,Me);b=0,!(b>=P.length)&&(b=B[0].initializeFromClipResult(P,b,T),!(b>=P.length)&&(b=B[1].initializeFromClipResult(P,b,T),!(b>=P.length)&&(b=B[2].initializeFromClipResult(P,b,T),j=ie.clipTriangleAtAxisAlignedThreshold(z,i,B[0].getV(),B[1].getV(),B[2].getV(),ze),Oe(c,p,d,u,r,l,j,B,O),b<P.length&&(B[2].clone(B[1]),B[2].initializeFromClipResult(P,b,T),j=ie.clipTriangleAtAxisAlignedThreshold(z,i,B[0].getV(),B[1].getV(),B[2].getV(),ze),Oe(c,p,d,u,r,l,j,B,O)))))}let He=o?-a:0,qe=i?-a:0,me=[],ge=[],le=[],we=[],U=Number.MAX_VALUE,_=-U,M=Xe;M.length=0;let re=Ce.clone(n.ellipsoid),J=Se.clone(n.childRectangle),Ee=J.north,Re=J.south,ce=J.east,xe=J.west;for(ce<xe&&(ce+=N.TWO_PI),t=0;t<c.length;++t)x=Math.round(c[t]),x<=s?(me.push(t),x=0):x>=e?(le.push(t),x=a):x=x*2+He,c[t]=x,y=Math.round(p[t]),y<=g?(ge.push(t),y=0):y>=w?(we.push(t),y=a):y=y*2+qe,p[t]=y,H=N.lerp(se,ae,d[t]/a),H<U&&(U=H),H>_&&(_=H),d[t]=H,te.longitude=N.lerp(xe,ce,x/a),te.latitude=N.lerp(Re,Ee,y/a),te.height=H,re.cartographicToCartesian(te,E),M.push(E.x),M.push(E.y),M.push(E.z);let he=de.fromVertices(M,A.ZERO,3,Qe),Ue=ue.fromRectangle(J,U,_,re,Ze),ve=new be(re).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(he.center,M,3,he.center,U,Je),Pe=_-U,X=new Uint16Array(c.length+p.length+d.length);for(t=0;t<c.length;++t)X[t]=c[t];let fe=c.length;for(t=0;t<p.length;++t)X[fe+t]=p[t];for(fe+=p.length,t=0;t<d.length;++t)X[fe+t]=a*(d[t]-U)/Pe;let pe=Ve.createTypedArray(c.length,r),ye;if(O){let v=new Uint8Array(u);h.push(X.buffer,pe.buffer,v.buffer),ye=v.buffer}else h.push(X.buffer,pe.buffer);return{vertices:X.buffer,encodedNormals:ye,indices:pe.buffer,minimumHeight:U,maximumHeight:_,westIndices:me,southIndices:ge,eastIndices:le,northIndices:we,boundingSphere:he,orientedBoundingBox:Ue,horizonOcclusionPoint:ve}}function m(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}m.prototype.clone=function(n){return f(n)||(n=new m),n.uBuffer=this.uBuffer,n.vBuffer=this.vBuffer,n.heightBuffer=this.heightBuffer,n.normalBuffer=this.normalBuffer,n.index=this.index,n.first=this.first,n.second=this.second,n.ratio=this.ratio,n};m.prototype.initializeIndexed=function(n,h,o,i,s){this.uBuffer=n,this.vBuffer=h,this.heightBuffer=o,this.normalBuffer=i,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0};m.prototype.initializeFromClipResult=function(n,h,o){let i=h+1;return n[h]!==-1?o[n[h]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=o[n[i]],++i,this.second=o[n[i]],++i,this.ratio=n[i],++i),i};m.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})};m.prototype.isIndexed=function(){return f(this.index)};m.prototype.getH=function(){return f(this.index)?this.heightBuffer[this.index]:N.lerp(this.first.getH(),this.second.getH(),this.ratio)};m.prototype.getU=function(){return f(this.index)?this.uBuffer[this.index]:N.lerp(this.first.getU(),this.second.getU(),this.ratio)};m.prototype.getV=function(){return f(this.index)?this.vBuffer[this.index]:N.lerp(this.first.getV(),this.second.getV(),this.ratio)};var K=new Z,oe=-1,en=[new A,new A],nn=[new A,new A];function Te(n,h){++oe;let o=en[oe],i=nn[oe];return o=ee.octDecode(n.first.getNormalX(),n.first.getNormalY(),o),i=ee.octDecode(n.second.getNormalX(),n.second.getNormalY(),i),E=A.lerp(o,i,n.ratio,E),A.normalize(E,E),ee.octEncode(E,h),--oe,h}m.prototype.getNormalX=function(){return f(this.index)?this.normalBuffer[this.index*2]:(K=Te(this,K),K.x)};m.prototype.getNormalY=function(){return f(this.index)?this.normalBuffer[this.index*2+1]:(K=Te(this,K),K.y)};var S=[];S.push(new m);S.push(new m);S.push(new m);S.push(new m);function Oe(n,h,o,i,s,e,g,w,c){if(g.length===0)return;let p=0,d=0;for(;d<g.length;)d=S[p++].initializeFromClipResult(g,d,w);for(let u=0;u<p;++u){let r=S[u];if(r.isIndexed())r.newIndex=e[r.index],r.uBuffer=n,r.vBuffer=h,r.heightBuffer=o,c&&(r.normalBuffer=i);else{let l=r.getKey();if(f(e[l]))r.newIndex=e[l];else{let I=n.length;n.push(r.getU()),h.push(r.getV()),o.push(r.getH()),c&&(i.push(r.getNormalX()),i.push(r.getNormalY())),r.newIndex=I,e[l]=I}}}p===3?(s.push(S[0].newIndex),s.push(S[1].newIndex),s.push(S[2].newIndex)):p===4&&(s.push(S[0].newIndex),s.push(S[1].newIndex),s.push(S[2].newIndex),s.push(S[0].newIndex),s.push(S[2].newIndex),s.push(S[3].newIndex))}var An=Ae(je);export{An as default}; diff --git a/public/js/Cesium2/index.cjs b/public/js/Cesium2/index.cjs index 4702d9a47..ade72ee43 100644 --- a/public/js/Cesium2/index.cjs +++ b/public/js/Cesium2/index.cjs @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var zEe=Object.create;var rV=Object.defineProperty;var HEe=Object.getOwnPropertyDescriptor;var GEe=Object.getOwnPropertyNames;var WEe=Object.getPrototypeOf,jEe=Object.prototype.hasOwnProperty;var qEe=(e,t)=>()=>(e&&(t=e(e=0)),t);var Xn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),jQ=(e,t)=>{for(var n in t)rV(e,n,{get:t[n],enumerable:!0})},qQ=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of GEe(t))!jEe.call(e,o)&&o!==n&&rV(e,o,{get:()=>t[o],enumerable:!(i=HEe(t,o))||i.enumerable});return e};var Ko=(e,t,n)=>(n=e!=null?zEe(WEe(e)):{},qQ(t||!e||!e.__esModule?rV(n,"default",{value:e,enumerable:!0}):n,e)),Jh=e=>qQ(rV({},"__esModule",{value:!0}),e);var sV=Xn((ywt,XQ)=>{var bp=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};bp.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};bp.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};bp.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};bp.prototype.random_int31=function(){return this.random_int()>>>1};bp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};bp.prototype.random=function(){return this.random_int()*(1/4294967296)};bp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};bp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};XQ.exports=bp});var xJ=Xn((GC,WC)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof GC=="object"&&GC&&!GC.nodeType&&GC,n=typeof WC=="object"&&WC&&!WC.nodeType&&WC,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,x=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,T={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=s-a,A=Math.floor,E=String.fromCharCode,v;function D(V){throw new RangeError(T[V])}function O(V,G){for(var k=V.length,W=[];k--;)W[k]=G(V[k]);return W}function R(V,G){var k=V.split("@"),W="";k.length>1&&(W=k[0]+"@",V=k[1]),V=V.replace(b,".");var j=V.split("."),J=O(j,G).join(".");return W+J}function M(V){for(var G=[],k=0,W=V.length,j,J;k<W;)j=V.charCodeAt(k++),j>=55296&&j<=56319&&k<W?(J=V.charCodeAt(k++),(J&64512)==56320?G.push(((j&1023)<<10)+(J&1023)+65536):(G.push(j),k--)):G.push(j);return G}function N(V){return O(V,function(G){var k="";return G>65535&&(G-=65536,k+=E(G>>>10&1023|55296),G=56320|G&1023),k+=E(G),k}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function S(V,G){return V+22+75*(V<26)-((G!=0)<<5)}function w(V,G,k){var W=0;for(V=k?A(V/f):V>>1,V+=A(V/G);V>C*c>>1;W+=s)V=A(V/C);return A(W+(C+1)*V/(V+u))}function I(V){var G=[],k=V.length,W,j=0,J=p,q=d,K,Q,de,ye,ce,_e,xe,De,Ae;for(K=V.lastIndexOf(g),K<0&&(K=0),Q=0;Q<K;++Q)V.charCodeAt(Q)>=128&&D("not-basic"),G.push(V.charCodeAt(Q));for(de=K>0?K+1:0;de<k;){for(ye=j,ce=1,_e=s;de>=k&&D("invalid-input"),xe=_(V.charCodeAt(de++)),(xe>=s||xe>A((r-j)/ce))&&D("overflow"),j+=xe*ce,De=_e<=q?a:_e>=q+c?c:_e-q,!(xe<De);_e+=s)Ae=s-De,ce>A(r/Ae)&&D("overflow"),ce*=Ae;W=G.length+1,q=w(j-ye,W,ye==0),A(j/W)>r-J&&D("overflow"),J+=A(j/W),j%=W,G.splice(j++,0,J)}return N(G)}function L(V){var G,k,W,j,J,q,K,Q,de,ye,ce,_e=[],xe,De,Ae,ke;for(V=M(V),xe=V.length,G=p,k=0,J=d,q=0;q<xe;++q)ce=V[q],ce<128&&_e.push(E(ce));for(W=j=_e.length,j&&_e.push(g);W<xe;){for(K=r,q=0;q<xe;++q)ce=V[q],ce>=G&&ce<K&&(K=ce);for(De=W+1,K-G>A((r-k)/De)&&D("overflow"),k+=(K-G)*De,G=K,q=0;q<xe;++q)if(ce=V[q],ce<G&&++k>r&&D("overflow"),ce==G){for(Q=k,de=s;ye=de<=J?a:de>=J+c?c:de-J,!(Q<ye);de+=s)ke=Q-ye,Ae=s-ye,_e.push(E(S(ye+ke%Ae,0))),Q=A(ke/Ae);_e.push(E(S(Q,0))),J=w(k,De,W==j),k=0,++W}++k,++G}return _e.join("")}function B(V){return R(V,function(G){return m.test(G)?I(G.slice(4).toLowerCase()):G})}function U(V){return R(V,function(G){return x.test(G)?"xn--"+L(G):G})}if(o={version:"1.3.2",ucs2:{decode:M,encode:N},decode:I,encode:L,toASCII:U,toUnicode:B},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(WC.exports==t)n.exports=o;else for(v in o)o.hasOwnProperty(v)&&(t[v]=o[v]);else e.punycode=o})(GC)});var TJ=Xn((bJ,vV)=>{/*! +var GEe=Object.create;var rV=Object.defineProperty;var WEe=Object.getOwnPropertyDescriptor;var jEe=Object.getOwnPropertyNames;var qEe=Object.getPrototypeOf,YEe=Object.prototype.hasOwnProperty;var XEe=(e,t)=>()=>(e&&(t=e(e=0)),t);var Xn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),jQ=(e,t)=>{for(var n in t)rV(e,n,{get:t[n],enumerable:!0})},qQ=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of jEe(t))!YEe.call(e,o)&&o!==n&&rV(e,o,{get:()=>t[o],enumerable:!(i=WEe(t,o))||i.enumerable});return e};var Zo=(e,t,n)=>(n=e!=null?GEe(qEe(e)):{},qQ(t||!e||!e.__esModule?rV(n,"default",{value:e,enumerable:!0}):n,e)),Qh=e=>qQ(rV({},"__esModule",{value:!0}),e);var sV=Xn((Awt,XQ)=>{var yp=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};yp.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};yp.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};yp.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};yp.prototype.random_int31=function(){return this.random_int()>>>1};yp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};yp.prototype.random=function(){return this.random_int()*(1/4294967296)};yp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};yp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};XQ.exports=yp});var xJ=Xn((GC,WC)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof GC=="object"&&GC&&!GC.nodeType&&GC,n=typeof WC=="object"&&WC&&!WC.nodeType&&WC,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,x=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,T={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=s-a,A=Math.floor,E=String.fromCharCode,v;function D(V){throw new RangeError(T[V])}function O(V,G){for(var k=V.length,W=[];k--;)W[k]=G(V[k]);return W}function R(V,G){var k=V.split("@"),W="";k.length>1&&(W=k[0]+"@",V=k[1]),V=V.replace(b,".");var q=V.split("."),J=O(q,G).join(".");return W+J}function M(V){for(var G=[],k=0,W=V.length,q,J;k<W;)q=V.charCodeAt(k++),q>=55296&&q<=56319&&k<W?(J=V.charCodeAt(k++),(J&64512)==56320?G.push(((q&1023)<<10)+(J&1023)+65536):(G.push(q),k--)):G.push(q);return G}function N(V){return O(V,function(G){var k="";return G>65535&&(G-=65536,k+=E(G>>>10&1023|55296),G=56320|G&1023),k+=E(G),k}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function S(V,G){return V+22+75*(V<26)-((G!=0)<<5)}function w(V,G,k){var W=0;for(V=k?A(V/f):V>>1,V+=A(V/G);V>C*c>>1;W+=s)V=A(V/C);return A(W+(C+1)*V/(V+u))}function I(V){var G=[],k=V.length,W,q=0,J=p,j=d,K,Q,de,xe,ce,ge,be,De,Ae;for(K=V.lastIndexOf(g),K<0&&(K=0),Q=0;Q<K;++Q)V.charCodeAt(Q)>=128&&D("not-basic"),G.push(V.charCodeAt(Q));for(de=K>0?K+1:0;de<k;){for(xe=q,ce=1,ge=s;de>=k&&D("invalid-input"),be=_(V.charCodeAt(de++)),(be>=s||be>A((r-q)/ce))&&D("overflow"),q+=be*ce,De=ge<=j?a:ge>=j+c?c:ge-j,!(be<De);ge+=s)Ae=s-De,ce>A(r/Ae)&&D("overflow"),ce*=Ae;W=G.length+1,j=w(q-xe,W,xe==0),A(q/W)>r-J&&D("overflow"),J+=A(q/W),q%=W,G.splice(q++,0,J)}return N(G)}function L(V){var G,k,W,q,J,j,K,Q,de,xe,ce,ge=[],be,De,Ae,ke;for(V=M(V),be=V.length,G=p,k=0,J=d,j=0;j<be;++j)ce=V[j],ce<128&&ge.push(E(ce));for(W=q=ge.length,q&&ge.push(g);W<be;){for(K=r,j=0;j<be;++j)ce=V[j],ce>=G&&ce<K&&(K=ce);for(De=W+1,K-G>A((r-k)/De)&&D("overflow"),k+=(K-G)*De,G=K,j=0;j<be;++j)if(ce=V[j],ce<G&&++k>r&&D("overflow"),ce==G){for(Q=k,de=s;xe=de<=J?a:de>=J+c?c:de-J,!(Q<xe);de+=s)ke=Q-xe,Ae=s-xe,ge.push(E(S(xe+ke%Ae,0))),Q=A(ke/Ae);ge.push(E(S(Q,0))),J=w(k,De,W==q),k=0,++W}++k,++G}return ge.join("")}function B(V){return R(V,function(G){return m.test(G)?I(G.slice(4).toLowerCase()):G})}function U(V){return R(V,function(G){return x.test(G)?"xn--"+L(G):G})}if(o={version:"1.3.2",ucs2:{decode:M,encode:N},decode:I,encode:L,toASCII:U,toUnicode:B},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(WC.exports==t)n.exports=o;else for(v in o)o.hasOwnProperty(v)&&(t[v]=o[v]);else e.punycode=o})(GC)});var TJ=Xn((bJ,vV)=>{/*! * URI.js - Mutating URLs * IPv6 Support * @@ -58,26 +58,26 @@ var zEe=Object.create;var rV=Object.defineProperty;var HEe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof DV=="object"&&DV.exports?DV.exports=t(xJ(),TJ(),AJ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(EJ,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(S,w){var I=arguments.length>=1,L=arguments.length>=2;if(!(this instanceof r))return I?L?new r(S,w):new r(S):new r;if(S===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?S=location.href+"":S=""}if(S===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(S),w!==void 0?this.absoluteTo(w):this}function s(S){return/^[0-9]+$/.test(S)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(S){return S.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(S){return S===void 0?"Undefined":String(Object.prototype.toString.call(S)).slice(8,-1)}function d(S){return f(S)==="Array"}function p(S,w){var I={},L,B;if(f(w)==="RegExp")I=null;else if(d(w))for(L=0,B=w.length;L<B;L++)I[w[L]]=!0;else I[w]=!0;for(L=0,B=S.length;L<B;L++){var U=I&&I[S[L]]!==void 0||!I&&w.test(S[L]);U&&(S.splice(L,1),B--,L--)}return S}function g(S,w){var I,L;if(d(w)){for(I=0,L=w.length;I<L;I++)if(!g(S,w[I]))return!1;return!0}var B=f(w);for(I=0,L=S.length;I<L;I++)if(B==="RegExp"){if(typeof S[I]=="string"&&S[I].match(w))return!0}else if(S[I]===w)return!0;return!1}function m(S,w){if(!d(S)||!d(w)||S.length!==w.length)return!1;S.sort(),w.sort();for(var I=0,L=S.length;I<L;I++)if(S[I]!==w[I])return!1;return!0}function x(S){var w=/^\/+|\/+$/g;return S.replace(w,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(S){if(!(!S||!S.nodeName)){var w=S.nodeName.toLowerCase();if(!(w==="input"&&S.type!=="image"))return r.domAttributes[w]}};function b(S){return escape(S)}function T(S){return encodeURIComponent(S).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=T,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=T,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(S,w){var I=r.encode(S+"");return w===void 0&&(w=r.escapeQuerySpace),w?I.replace(/%20/g,"+"):I},r.decodeQuery=function(S,w){S+="",w===void 0&&(w=r.escapeQuerySpace);try{return r.decode(w?S.replace(/\+/g,"%20"):S)}catch{return S}};var C={encode:"encode",decode:"decode"},A,E=function(S,w){return function(I){try{return r[w](I+"").replace(r.characters[S][w].expression,function(L){return r.characters[S][w].map[L]})}catch{return I}}};for(A in C)r[A+"PathSegment"]=E("pathname",C[A]),r[A+"UrnPathSegment"]=E("urnpath",C[A]);var v=function(S,w,I){return function(L){var B;I?B=function(k){return r[w](r[I](k))}:B=r[w];for(var U=(L+"").split(S),V=0,G=U.length;V<G;V++)U[V]=B(U[V]);return U.join(S)}};r.decodePath=v("/","decodePathSegment"),r.decodeUrnPath=v(":","decodeUrnPathSegment"),r.recodePath=v("/","encodePathSegment","decode"),r.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),r.encodeReserved=E("reserved","encode"),r.parse=function(S,w){var I;return w||(w={preventInvalidHostname:r.preventInvalidHostname}),S=S.replace(r.leading_whitespace_expression,""),S=S.replace(r.ascii_tab_whitespace,""),I=S.indexOf("#"),I>-1&&(w.fragment=S.substring(I+1)||null,S=S.substring(0,I)),I=S.indexOf("?"),I>-1&&(w.query=S.substring(I+1)||null,S=S.substring(0,I)),S=S.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),S=S.replace(/^[/\\]{2,}/i,"//"),S.substring(0,2)==="//"?(w.protocol=null,S=S.substring(2),S=r.parseAuthority(S,w)):(I=S.indexOf(":"),I>-1&&(w.protocol=S.substring(0,I)||null,w.protocol&&!w.protocol.match(r.protocol_expression)?w.protocol=void 0:S.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(S=S.substring(I+3),S=r.parseAuthority(S,w)):(S=S.substring(I+1),w.urn=!0))),w.path=S,w},r.parseHost=function(S,w){S||(S=""),S=S.replace(/\\/g,"/");var I=S.indexOf("/"),L,B;if(I===-1&&(I=S.length),S.charAt(0)==="[")L=S.indexOf("]"),w.hostname=S.substring(1,L)||null,w.port=S.substring(L+2,I)||null,w.port==="/"&&(w.port=null);else{var U=S.indexOf(":"),V=S.indexOf("/"),G=S.indexOf(":",U+1);G!==-1&&(V===-1||G<V)?(w.hostname=S.substring(0,I)||null,w.port=null):(B=S.substring(0,I).split(":"),w.hostname=B[0]||null,w.port=B[1]||null)}return w.hostname&&S.substring(I).charAt(0)!=="/"&&(I++,S="/"+S),w.preventInvalidHostname&&r.ensureValidHostname(w.hostname,w.protocol),w.port&&r.ensureValidPort(w.port),S.substring(I)||"/"},r.parseAuthority=function(S,w){return S=r.parseUserinfo(S,w),r.parseHost(S,w)},r.parseUserinfo=function(S,w){var I=S,L=S.indexOf("\\");L!==-1&&(S=S.replace(/\\/g,"/"));var B=S.indexOf("/"),U=S.lastIndexOf("@",B>-1?B:S.length-1),V;return U>-1&&(B===-1||U<B)?(V=S.substring(0,U).split(":"),w.username=V[0]?r.decode(V[0]):null,V.shift(),w.password=V[0]?r.decode(V.join(":")):null,S=I.substring(U+1)):(w.username=null,w.password=null),S},r.parseQuery=function(S,w){if(!S)return{};if(S=S.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!S)return{};for(var I={},L=S.split("&"),B=L.length,U,V,G,k=0;k<B;k++)U=L[k].split("="),V=r.decodeQuery(U.shift(),w),G=U.length?r.decodeQuery(U.join("="),w):null,V!=="__proto__"&&(c.call(I,V)?((typeof I[V]=="string"||I[V]===null)&&(I[V]=[I[V]]),I[V].push(G)):I[V]=G);return I},r.build=function(S){var w="",I=!1;return S.protocol&&(w+=S.protocol+":"),!S.urn&&(w||S.hostname)&&(w+="//",I=!0),w+=r.buildAuthority(S)||"",typeof S.path=="string"&&(S.path.charAt(0)!=="/"&&I&&(w+="/"),w+=S.path),typeof S.query=="string"&&S.query&&(w+="?"+S.query),typeof S.fragment=="string"&&S.fragment&&(w+="#"+S.fragment),w},r.buildHost=function(S){var w="";if(S.hostname)r.ip6_expression.test(S.hostname)?w+="["+S.hostname+"]":w+=S.hostname;else return"";return S.port&&(w+=":"+S.port),w},r.buildAuthority=function(S){return r.buildUserinfo(S)+r.buildHost(S)},r.buildUserinfo=function(S){var w="";return S.username&&(w+=r.encode(S.username)),S.password&&(w+=":"+r.encode(S.password)),w&&(w+="@"),w},r.buildQuery=function(S,w,I){var L="",B,U,V,G;for(U in S)if(U!=="__proto__"&&c.call(S,U))if(d(S[U]))for(B={},V=0,G=S[U].length;V<G;V++)S[U][V]!==void 0&&B[S[U][V]+""]===void 0&&(L+="&"+r.buildQueryParameter(U,S[U][V],I),w!==!0&&(B[S[U][V]+""]=!0));else S[U]!==void 0&&(L+="&"+r.buildQueryParameter(U,S[U],I));return L.substring(1)},r.buildQueryParameter=function(S,w,I){return r.encodeQuery(S,I)+(w!==null?"="+r.encodeQuery(w,I):"")},r.addQuery=function(S,w,I){if(typeof w=="object")for(var L in w)c.call(w,L)&&r.addQuery(S,L,w[L]);else if(typeof w=="string"){if(S[w]===void 0){S[w]=I;return}else typeof S[w]=="string"&&(S[w]=[S[w]]);d(I)||(I=[I]),S[w]=(S[w]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(S,w,I){if(typeof w=="object")for(var L in w)c.call(w,L)&&r.setQuery(S,L,w[L]);else if(typeof w=="string")S[w]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(S,w,I){var L,B,U;if(d(w))for(L=0,B=w.length;L<B;L++)S[w[L]]=void 0;else if(f(w)==="RegExp")for(U in S)w.test(U)&&(S[U]=void 0);else if(typeof w=="object")for(U in w)c.call(w,U)&&r.removeQuery(S,U,w[U]);else if(typeof w=="string")I!==void 0?f(I)==="RegExp"?!d(S[w])&&I.test(S[w])?S[w]=void 0:S[w]=p(S[w],I):S[w]===String(I)&&(!d(I)||I.length===1)?S[w]=void 0:d(S[w])&&(S[w]=p(S[w],I)):S[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(S,w,I,L){switch(f(w)){case"String":break;case"RegExp":for(var B in S)if(c.call(S,B)&&w.test(B)&&(I===void 0||r.hasQuery(S,B,I)))return!0;return!1;case"Object":for(var U in w)if(c.call(w,U)&&!r.hasQuery(S,U,w[U]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return w in S;case"Boolean":var V=!!(d(S[w])?S[w].length:S[w]);return I===V;case"Function":return!!I(S[w],w,S);case"Array":if(!d(S[w]))return!1;var G=L?g:m;return G(S[w],I);case"RegExp":return d(S[w])?L?g(S[w],I):!1:!!(S[w]&&S[w].match(I));case"Number":I=String(I);case"String":return d(S[w])?L?g(S[w],I):!1:S[w]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var S=[],w=[],I=0,L=0;L<arguments.length;L++){var B=new r(arguments[L]);S.push(B);for(var U=B.segment(),V=0;V<U.length;V++)typeof U[V]=="string"&&w.push(U[V]),U[V]&&I++}if(!w.length||!I)return new r("");var G=new r("").segment(w);return(S[0].path()===""||S[0].path().slice(0,1)==="/")&&G.path("/"+G.path()),G.normalize()},r.commonPath=function(S,w){var I=Math.min(S.length,w.length),L;for(L=0;L<I;L++)if(S.charAt(L)!==w.charAt(L)){L--;break}return L<1?S.charAt(0)===w.charAt(0)&&S.charAt(0)==="/"?"/":"":((S.charAt(L)!=="/"||w.charAt(L)!=="/")&&(L=S.substring(0,L).lastIndexOf("/")),S.substring(0,L+1))},r.withinString=function(S,w,I){I||(I={});var L=I.start||r.findUri.start,B=I.end||r.findUri.end,U=I.trim||r.findUri.trim,V=I.parens||r.findUri.parens,G=/[a-z0-9-]=["']?$/i;for(L.lastIndex=0;;){var k=L.exec(S);if(!k)break;var W=k.index;if(I.ignoreHtml){var j=S.slice(Math.max(W-3,0),W);if(j&&G.test(j))continue}for(var J=W+S.slice(W).search(B),q=S.slice(W,J),K=-1;;){var Q=V.exec(q);if(!Q)break;var de=Q.index+Q[0].length;K=Math.max(K,de)}if(K>-1?q=q.slice(0,K)+q.slice(K).replace(U,""):q=q.replace(U,""),!(q.length<=k[0].length)&&!(I.ignore&&I.ignore.test(q))){J=W+q.length;var ye=w(q,W,J,S);if(ye===void 0){L.lastIndex=J;continue}ye=String(ye),S=S.slice(0,W)+ye+S.slice(J),L.lastIndex=W+ye.length}}return L.lastIndex=0,S},r.ensureValidHostname=function(S,w){var I=!!S,L=!!w,B=!1;if(L&&(B=g(r.hostProtocols,w)),B&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(S&&S.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(S).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(S){if(S){var w=Number(S);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+S+'" is not a valid port')}},r.noConflict=function(S){if(S){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=o);return this},a.build=function(S){return S===!0?this._deferred_build=!0:(S===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function D(S){return function(w,I){return w===void 0?this._parts[S]||"":(this._parts[S]=w||null,this.build(!I),this)}}function O(S,w){return function(I,L){return I===void 0?this._parts[S]||"":(I!==null&&(I=I+"",I.charAt(0)===w&&(I=I.substring(1))),this._parts[S]=I,this.build(!L),this)}}a.protocol=D("protocol"),a.username=D("username"),a.password=D("password"),a.hostname=D("hostname"),a.port=D("port"),a.query=O("query","?"),a.fragment=O("fragment","#"),a.search=function(S,w){var I=this.query(S,w);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(S,w){var I=this.fragment(S,w);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(S,w){if(S===void 0||S===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return S?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=S?r.recodeUrnPath(S):"":this._parts.path=S?r.recodePath(S):"/",this.build(!w),this},a.path=a.pathname,a.href=function(S,w){var I;if(S===void 0)return this.toString();this._string="",this._parts=r._parts();var L=S instanceof r,B=typeof S=="object"&&(S.hostname||S.path||S.pathname);if(S.nodeName){var U=r.getDomAttribute(S);S=S[U]||"",B=!1}if(!L&&B&&S.pathname!==void 0&&(S=S.toString()),typeof S=="string"||S instanceof String)this._parts=r.parse(String(S),this._parts);else if(L||B){var V=L?S._parts:S;for(I in V)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(S){var w=!1,I=!1,L=!1,B=!1,U=!1,V=!1,G=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,I=r.ip4_expression.test(this._parts.hostname),L=r.ip6_expression.test(this._parts.hostname),w=I||L,B=!w,U=B&&n&&n.has(this._parts.hostname),V=B&&r.idn_expression.test(this._parts.hostname),G=B&&r.punycode_expression.test(this._parts.hostname)),S.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return B;case"sld":return U;case"ip":return w;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return L;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var R=a.protocol,M=a.port,N=a.hostname;a.protocol=function(S,w){if(S&&(S=S.replace(/:(\/\/)?$/,""),!S.match(r.protocol_expression)))throw new TypeError('Protocol "'+S+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,S,w)},a.scheme=a.protocol,a.port=function(S,w){return this._parts.urn?S===void 0?"":this:(S!==void 0&&(S===0&&(S=null),S&&(S+="",S.charAt(0)===":"&&(S=S.substring(1)),r.ensureValidPort(S))),M.call(this,S,w))},a.hostname=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},L=r.parseHost(S,I);if(L!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');S=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(S,this._parts.protocol)}return N.call(this,S,w)},a.origin=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){var I=this.protocol(),L=this.authority();return L?(I?I+"://":"")+this.authority():""}else{var B=r(S);return this.protocol(B.protocol()).authority(B.authority()).build(!w),this}},a.host=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(S,this._parts);if(I!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(S,this._parts);if(I!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return S[S.length-1]!=="@"&&(S+="@"),r.parseUserinfo(S,this._parts),this.build(!w),this},a.resource=function(S,w){var I;return S===void 0?this.path()+this.search()+this.hash():(I=r.parse(S),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!w),this)},a.subdomain=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var L=this._parts.hostname.length-this.domain().length,B=this._parts.hostname.substring(0,L),U=new RegExp("^"+u(B));if(S&&S.charAt(S.length-1)!=="."&&(S+="."),S.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return S&&r.ensureValidHostname(S,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(U,S),this.build(!w),this}},a.domain=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(typeof S=="boolean"&&(w=S,S=void 0),S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var L=this._parts.hostname.length-this.tld(w).length-1;return L=this._parts.hostname.lastIndexOf(".",L-1)+1,this._parts.hostname.substring(L)||""}else{if(!S)throw new TypeError("cannot set domain empty");if(S.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(S,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=S;else{var B=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(B,S)}return this.build(!w),this}},a.tld=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(typeof S=="boolean"&&(w=S,S=void 0),S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),L=this._parts.hostname.substring(I+1);return w!==!0&&n&&n.list[L.toLowerCase()]&&n.get(this._parts.hostname)||L}else{var B;if(S)if(S.match(/[^a-zA-Z0-9-]/))if(n&&n.is(S))B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,S);else throw new TypeError('TLD "'+S+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,S)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0||S===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,L=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return S?r.decodePath(L):L}else{var B=this._parts.path.length-this.filename().length,U=this._parts.path.substring(0,B),V=new RegExp("^"+u(U));return this.is("relative")||(S||(S="/"),S.charAt(0)!=="/"&&(S="/"+S)),S&&S.charAt(S.length-1)!=="/"&&(S+="/"),S=r.recodePath(S),this._parts.path=this._parts.path.replace(V,S),this.build(!w),this}},a.filename=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(typeof S!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),L=this._parts.path.substring(I+1);return S?r.decodePathSegment(L):L}else{var B=!1;S.charAt(0)==="/"&&(S=S.substring(1)),S.match(/\.?\//)&&(B=!0);var U=new RegExp(u(this.filename())+"$");return S=r.recodePath(S),this._parts.path=this._parts.path.replace(U,S),B?this.normalizePath(w):this.build(!w),this}},a.suffix=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0||S===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),L=I.lastIndexOf("."),B,U;return L===-1?"":(B=I.substring(L+1),U=/^[a-z0-9%]+$/i.test(B)?B:"",S?r.decodePathSegment(U):U)}else{S.charAt(0)==="."&&(S=S.substring(1));var V=this.suffix(),G;if(V)S?G=new RegExp(u(V)+"$"):G=new RegExp(u("."+V)+"$");else{if(!S)return this;this._parts.path+="."+r.recodePath(S)}return G&&(S=r.recodePath(S),this._parts.path=this._parts.path.replace(G,S)),this.build(!w),this}},a.segment=function(S,w,I){var L=this._parts.urn?":":"/",B=this.path(),U=B.substring(0,1)==="/",V=B.split(L);if(S!==void 0&&typeof S!="number"&&(I=w,w=S,S=void 0),S!==void 0&&typeof S!="number")throw new Error('Bad segment "'+S+'", must be 0-based integer');if(U&&V.shift(),S<0&&(S=Math.max(V.length+S,0)),w===void 0)return S===void 0?V:V[S];if(S===null||V[S]===void 0)if(d(w)){V=[];for(var G=0,k=w.length;G<k;G++)!w[G].length&&(!V.length||!V[V.length-1].length)||(V.length&&!V[V.length-1].length&&V.pop(),V.push(x(w[G])))}else(w||typeof w=="string")&&(w=x(w),V[V.length-1]===""?V[V.length-1]=w:V.push(w));else w?V[S]=x(w):V.splice(S,1);return U&&V.unshift(""),this.path(V.join(L),I)},a.segmentCoded=function(S,w,I){var L,B,U;if(typeof S!="number"&&(I=w,w=S,S=void 0),w===void 0){if(L=this.segment(S,w,I),!d(L))L=L!==void 0?r.decode(L):void 0;else for(B=0,U=L.length;B<U;B++)L[B]=r.decode(L[B]);return L}if(!d(w))w=typeof w=="string"||w instanceof String?r.encode(w):w;else for(B=0,U=w.length;B<U;B++)w[B]=r.encode(w[B]);return this.segment(S,w,I)};var _=a.query;return a.query=function(S,w){if(S===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof S=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),L=S.call(this,I);return this._parts.query=r.buildQuery(L||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return S!==void 0&&typeof S!="string"?(this._parts.query=r.buildQuery(S,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):_.call(this,S,w)},a.setQuery=function(S,w,I){var L=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof S=="string"||S instanceof String)L[S]=w!==void 0?w:null;else if(typeof S=="object")for(var B in S)c.call(S,B)&&(L[B]=S[B]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(L,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(I=w),this.build(!I),this},a.addQuery=function(S,w,I){var L=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(L,S,w===void 0?null:w),this._parts.query=r.buildQuery(L,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(I=w),this.build(!I),this},a.removeQuery=function(S,w,I){var L=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(L,S,w),this._parts.query=r.buildQuery(L,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(I=w),this.build(!I),this},a.hasQuery=function(S,w,I){var L=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(L,S,w,I)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(S){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!S)),this},a.normalizeHostname=function(S){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!S)),this},a.normalizePort=function(S){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!S)),this},a.normalizePath=function(S){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!S),this;if(this._parts.path==="/")return this;w=r.recodePath(w);var I,L="",B,U;for(w.charAt(0)!=="/"&&(I=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(L=w.substring(1).match(/^(\.\.\/)+/)||"",L&&(L=L[0]));B=w.search(/\/\.\.(\/|$)/),B!==-1;){if(B===0){w=w.substring(3);continue}U=w.substring(0,B).lastIndexOf("/"),U===-1&&(U=B),w=w.substring(0,U)+w.substring(B+3)}return I&&this.is("relative")&&(w=L+w.substring(1)),this._parts.path=w,this.build(!S),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(S){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!S)),this},a.normalizeFragment=function(S){return this._parts.fragment||(this._parts.fragment=null,this.build(!S)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var S=r.encode,w=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=S,r.decode=w}return this},a.unicode=function(){var S=r.encode,w=r.decode;r.encode=T,r.decode=unescape;try{this.normalize()}finally{r.encode=S,r.decode=w}return this},a.readable=function(){var S=this.clone();S.username("").password("").normalize();var w="";if(S._parts.protocol&&(w+=S._parts.protocol+"://"),S._parts.hostname&&(S.is("punycode")&&e?(w+=e.toUnicode(S._parts.hostname),S._parts.port&&(w+=":"+S._parts.port)):w+=S.host()),S._parts.hostname&&S._parts.path&&S._parts.path.charAt(0)!=="/"&&(w+="/"),w+=S.path(!0),S._parts.query){for(var I="",L=0,B=S._parts.query.split("&"),U=B.length;L<U;L++){var V=(B[L]||"").split("=");I+="&"+r.decodeQuery(V[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),V[1]!==void 0&&(I+="="+r.decodeQuery(V[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+I.substring(1)}return w+=r.decodeQuery(S.hash(),!0),w},a.absoluteTo=function(S){var w=this.clone(),I=["protocol","username","password","hostname","port"],L,B,U;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(S instanceof r||(S=new r(S)),w._parts.protocol||(w._parts.protocol=S._parts.protocol,this._parts.hostname))return w;for(B=0;U=I[B];B++)w._parts[U]=S._parts[U];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(L=S.directory(),L=L||(S.path().indexOf("/")===0?"/":""),w._parts.path=(L?L+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=S._parts.path,w._parts.query||(w._parts.query=S._parts.query)),w.build(),w},a.relativeTo=function(S){var w=this.clone().normalize(),I,L,B,U,V;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(S=new r(S).normalize(),I=w._parts,L=S._parts,U=w.path(),V=S.path(),U.charAt(0)!=="/")throw new Error("URI is already relative");if(V.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===L.protocol&&(I.protocol=null),I.username!==L.username||I.password!==L.password||I.protocol!==null||I.username!==null||I.password!==null)return w.build();if(I.hostname===L.hostname&&I.port===L.port)I.hostname=null,I.port=null;else return w.build();if(U===V)return I.path="",w.build();if(B=r.commonPath(U,V),!B)return w.build();var G=L.path.substring(B.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=G+I.path.substring(B.length)||"./",w.build()},a.equals=function(S){var w=this.clone(),I=new r(S),L={},B={},U={},V,G,k;if(w.normalize(),I.normalize(),w.toString()===I.toString())return!0;if(V=w.query(),G=I.query(),w.query(""),I.query(""),w.toString()!==I.toString()||V.length!==G.length)return!1;L=r.parseQuery(V,this._parts.escapeQuerySpace),B=r.parseQuery(G,this._parts.escapeQuerySpace);for(k in L)if(c.call(L,k)){if(d(L[k])){if(!m(L[k],B[k]))return!1}else if(L[k]!==B[k])return!1;U[k]=!0}for(k in B)if(c.call(B,k)&&!U[k])return!1;return!0},a.preventInvalidHostname=function(S){return this._parts.preventInvalidHostname=!!S,this},a.duplicateQueryParameters=function(S){return this._parts.duplicateQueryParameters=!!S,this},a.escapeQuerySpace=function(S){return this._parts.escapeQuerySpace=!!S,this},r})});var bre=Xn((vR,iW)=>{var NU=function(){"use strict";var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9Giuu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ndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbba:vbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var m=new Uint8Array(g.length),x=0;x<g.length;++x){var b=g.charCodeAt(x);m[x]=b>96?b-97:b>64?b-39:b+4}for(var T=0,x=0;x<g.length;++x)m[T++]=m[x]<60?t[m[x]]:(m[x]-60)*64+m[++x];return m.buffer.slice(0,T)}function r(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,m,x,b){var T=n.exports.sbrk,C=T(m.length*4),A=T(x*4),E=new Uint8Array(n.exports.memory.buffer),v=s(m);E.set(v,C),b&&b(C,C,m.length,x);var D=g(A,C,m.length,x);E=new Uint8Array(n.exports.memory.buffer);var O=new Uint32Array(x);new Uint8Array(O.buffer).set(E.subarray(A,A+x*4)),v.set(E.subarray(C,C+m.length*4)),T(C-T(0));for(var R=0;R<m.length;++R)m[R]=O[m[R]];return[O,D]}function c(g,m,x,b){var T=n.exports.sbrk,C=T(x*4),A=T(x*b),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),A),g(C,A,x,b),E=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(x);return new Uint8Array(v.buffer).set(E.subarray(C,C+x*4)),T(C-T(0)),v}function u(g,m,x,b,T){var C=n.exports.sbrk,A=C(m),E=C(b*T),v=new Uint8Array(n.exports.memory.buffer);v.set(s(x),E);var D=g(A,m,E,b,T),O=new Uint8Array(D);return O.set(v.subarray(A,A+D)),C(A-C(0)),O}function f(g){for(var m=0,x=0;x<g.length;++x){var b=g[x];m=m<b?b:m}return m}function d(g,m){if(r(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var x=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(x)}function p(g,m,x,b,T,C,A){var E=n.exports.sbrk,v=E(x*b),D=E(x*C),O=new Uint8Array(n.exports.memory.buffer);O.set(s(m),D),g(v,x,b,T,D,A);var R=new Uint8Array(x*b);return R.set(O.subarray(v,v+x*b)),E(v-E(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,x){var b=m?x?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,b)},reorderPoints:function(g,m){return r(g instanceof Float32Array),r(g.length%m==0),r(m>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,x){r(x>0&&x<=256),r(x%4==0);var b=n.exports.meshopt_encodeVertexBufferBound(m,x);return u(n.exports.meshopt_encodeVertexBuffer,b,g,m,x)},encodeIndexBuffer:function(g,m,x){r(x==2||x==4),r(m%3==0);var b=d(g,x),T=n.exports.meshopt_encodeIndexBufferBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexBuffer,T,b,m,4)},encodeIndexSequence:function(g,m,x){r(x==2||x==4);var b=d(g,x),T=n.exports.meshopt_encodeIndexSequenceBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexSequence,T,b,m,4)},encodeGltfBuffer:function(g,m,x,b){var T={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(T[b]),T[b](g,m,x)},encodeFilterOct:function(g,m,x,b){return r(x==4||x==8),r(b>=1&&b<=16),p(n.exports.meshopt_encodeFilterOct,g,m,x,b,16)},encodeFilterQuat:function(g,m,x,b){return r(x==8),r(b>=4&&b<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,x,b,16)},encodeFilterExp:function(g,m,x,b,T){r(x>0&&x%4==0),r(b>=1&&b<=24);var C={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,m,x,b,x,T?C[T]:1)}}}();typeof vR=="object"&&typeof iW=="object"?iW.exports=NU:typeof define=="function"&&define.amd?define([],function(){return NU}):typeof vR=="object"?vR.MeshoptEncoder=NU:(typeof self<"u"?self:vR).MeshoptEncoder=NU});var Tre=Xn((wR,oW)=>{var FU=function(){"use strict";var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbiba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vorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(T){r=T.instance,r.exports.__wasm_call_ctors()});function a(T){for(var C=new Uint8Array(T.length),A=0;A<T.length;++A){var E=T.charCodeAt(A);C[A]=E>96?E-97:E>64?E-39:E+4}for(var v=0,A=0;A<T.length;++A)C[v++]=C[A]<60?i[C[A]]:(C[A]-60)*64+C[++A];return C.buffer.slice(0,v)}function c(T,C,A,E,v,D,O){var R=T.exports.sbrk,M=E+3&-4,N=R(M*v),_=R(D.length),S=new Uint8Array(T.exports.memory.buffer);S.set(D,_);var w=C(N,E,v,_,D.length);if(w==0&&O&&O(N,M,v),A.set(S.subarray(N,N+E*v)),R(N-R(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(T){var C={object:new Worker(T),pending:0,requests:{}};return C.object.onmessage=function(A){var E=A.data;C.pending-=E.count,C.requests[E.id][E.action](E.value),delete C.requests[E.id]},C}function m(T){for(var C="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+b.name+";"+c.toString()+b.toString(),A=new Blob([C],{type:"text/javascript"}),E=URL.createObjectURL(A),v=d.length;v<T;++v)d[v]=g(E);for(var v=T;v<d.length;++v)d[v].object.postMessage({});d.length=T,URL.revokeObjectURL(E)}function x(T,C,A,E,v){for(var D=d[0],O=1;O<d.length;++O)d[O].pending<D.pending&&(D=d[O]);return new Promise(function(R,M){var N=new Uint8Array(A),_=++p;D.pending+=T,D.requests[_]={resolve:R,reject:M},D.object.postMessage({id:_,count:T,size:C,source:N,mode:E,filter:v},[N.buffer])})}function b(T){var C=T.data;if(!C.id)return self.close();self.ready.then(function(A){try{var E=new Uint8Array(C.count*C.size);c(A,A.exports[C.mode],E,C.count,C.size,C.source,A.exports[C.filter]),self.postMessage({id:C.id,count:C.count,action:"resolve",value:E},[E.buffer])}catch(v){self.postMessage({id:C.id,count:C.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(T){m(T)},decodeVertexBuffer:function(T,C,A,E,v){c(r,r.exports.meshopt_decodeVertexBuffer,T,C,A,E,r.exports[u[v]])},decodeIndexBuffer:function(T,C,A,E){c(r,r.exports.meshopt_decodeIndexBuffer,T,C,A,E)},decodeIndexSequence:function(T,C,A,E){c(r,r.exports.meshopt_decodeIndexSequence,T,C,A,E)},decodeGltfBuffer:function(T,C,A,E,v,D){c(r,r.exports[f[v]],T,C,A,E,r.exports[u[D]])},decodeGltfBufferAsync:function(T,C,A,E,v){return d.length>0?x(T,C,A,f[E],u[v]):s.then(function(){var D=new Uint8Array(T*C);return c(r,r.exports[f[E]],D,T,C,A,r.exports[u[v]]),D})}}}();typeof wR=="object"&&typeof oW=="object"?oW.exports=FU:typeof define=="function"&&define.amd?define([],function(){return FU}):typeof wR=="object"?wR.MeshoptDecoder=FU:(typeof self<"u"?self:wR).MeshoptDecoder=FU});var Cre=Xn((DR,rW)=>{var BU=function(){"use strict";var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd;S1jjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgYcx2fgeIdbaaaHydbgKcx2fgOIdbg8P:tgIaaaHcwfydbgLc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aeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyara3cltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkara8LcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkarawcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8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3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9iaO2hLarhHa8JhAinaHaLfgeaHaKfgOIdbaeIdbMUdbaeclfgYaOclfIdbaYIdbMUdbaecwfgYaOcwfIdbaYIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbka3mbJbbbbJbbjZaqawfgeIdyg8S:va8SJbbbb9BEaeIdwaaa8Fcx2fgHIdwg8SNaeIdzaHIdbgINaeIdaMg8Va8VMMa8SNaeIdlaHIdlg8VNaeIdCa8SNaeId3Mg8Sa8SMMa8VNaeIdbaINaeIdxa8VNaeIdKMg8Sa8SMMaINaeId8KMMM:lNg8SaBaBa8S9DEhBkaKa9ifhKaicefgial9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var x=new Uint8Array(m.length),b=0;b<m.length;++b){var T=m.charCodeAt(b);x[b]=T>96?T-97:T>64?T-39:T+4}for(var C=0,b=0;b<m.length;++b)x[C++]=x[b]<60?t[x[b]]:(x[b]-60)*64+x[++b];return x.buffer.slice(0,C)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}function a(m,x,b){var T=n.exports.sbrk,C=T(x.length*4),A=T(b*4),E=new Uint8Array(n.exports.memory.buffer),v=s(x);E.set(v,C);var D=m(A,C,x.length,b);E=new Uint8Array(n.exports.memory.buffer);var O=new Uint32Array(b);new Uint8Array(O.buffer).set(E.subarray(A,A+b*4)),v.set(E.subarray(C,C+x.length*4)),T(C-T(0));for(var R=0;R<x.length;++R)x[R]=O[x[R]];return[O,D]}function c(m){for(var x=0,b=0;b<m.length;++b){var T=m[b];x=x<T?T:x}return x}function u(m,x,b,T,C,A,E,v,D){var O=n.exports.sbrk,R=O(4),M=O(b*4),N=O(C*A),_=O(b*4),S=new Uint8Array(n.exports.memory.buffer);S.set(s(T),N),S.set(s(x),_);var w=m(M,_,b,N,C,A,E,v,D,R);S=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(w);s(I).set(S.subarray(M,M+w*4));var L=new Float32Array(1);return s(L).set(S.subarray(R,R+4)),O(R-O(0)),[I,L[0]]}function f(m,x,b,T,C,A,E,v,D,O,R,M,N){var _=n.exports.sbrk,S=_(4),w=_(b*4),I=_(C*A),L=_(C*v),B=_(D.length*4),U=_(b*4),V=O?_(C):0,G=new Uint8Array(n.exports.memory.buffer);G.set(s(T),I),G.set(s(E),L),G.set(s(D),B),G.set(s(x),U),O&&G.set(s(O),V);var k=m(w,U,b,I,C,A,L,v,B,D.length,V,R,M,N,S);G=new Uint8Array(n.exports.memory.buffer);var W=new Uint32Array(k);s(W).set(G.subarray(w,w+k*4));var j=new Float32Array(1);return s(j).set(G.subarray(S,S+4)),_(S-_(0)),[W,j[0]]}function d(m,x,b,T){var C=n.exports.sbrk,A=C(b*T),E=new Uint8Array(n.exports.memory.buffer);E.set(s(x),A);var v=m(A,b,T);return C(A-C(0)),v}function p(m,x,b,T,C,A,E,v){var D=n.exports.sbrk,O=D(v*4),R=D(b*T),M=D(b*A),N=new Uint8Array(n.exports.memory.buffer);N.set(s(x),R),C&&N.set(s(C),M);var _=m(O,R,b,T,M,A,E,v);N=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(_);return s(S).set(N.subarray(O,O+_*4)),D(O-D(0)),S}var g={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(m){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0);var x=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return a(n.exports.meshopt_optimizeVertexFetchRemap,x,c(m)+1)},simplify:function(m,x,b,T,C,A){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T>=0&&T<=m.length),r(T%3==0),r(C>=0);for(var E=0,v=0;v<(A?A.length:0);++v)r(A[v]in g),r(this.useExperimentalFeatures||A[v]!="Prune"),E|=g[A[v]];var D=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),O=u(n.exports.meshopt_simplify,D,m.length,x,x.length/b,b*4,T,C,E);return O[0]=m instanceof Uint32Array?O[0]:new m.constructor(O[0]),O},simplifyWithAttributes:function(m,x,b,T,C,A,E,v,D,O){r(this.useExperimentalFeatures),r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T instanceof Float32Array),r(T.length%C==0),r(C>=0),r(E==null||E instanceof Uint8Array),r(E==null||E.length==x.length/b),r(v>=0&&v<=m.length),r(v%3==0),r(D>=0),r(Array.isArray(A)),r(C>=A.length),r(A.length<=32);for(var R=0;R<A.length;++R)r(A[R]>=0);for(var M=0,R=0;R<(O?O.length:0);++R)r(O[R]in g),M|=g[O[R]];var N=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),_=f(n.exports.meshopt_simplifyWithAttributes,N,m.length,x,x.length/b,b*4,T,C*4,new Float32Array(A),E?new Uint8Array(E):null,v,D,M);return _[0]=m instanceof Uint32Array?_[0]:new m.constructor(_[0]),_},getScale:function(m,x){return r(m instanceof Float32Array),r(m.length%x==0),r(x>=3),d(n.exports.meshopt_simplifyScale,m,m.length/x,x*4)},simplifyPoints:function(m,x,b,T,C,A){return r(this.useExperimentalFeatures),r(m instanceof Float32Array),r(m.length%x==0),r(x>=3),r(b>=0&&b<=m.length/x),T?(r(T instanceof Float32Array),r(T.length%C==0),r(C>=3),r(m.length/x==T.length/C),p(n.exports.meshopt_simplifyPoints,m,m.length/x,x*4,T,C*4,A,b)):p(n.exports.meshopt_simplifyPoints,m,m.length/x,x*4,void 0,0,0,b)}}}();typeof DR=="object"&&typeof rW=="object"?rW.exports=BU:typeof define=="function"&&define.amd?define([],function(){return BU}):typeof DR=="object"?DR.MeshoptSimplifier=BU:(typeof self<"u"?self:DR).MeshoptSimplifier=BU});var Are=Xn((IR,sW)=>{var kU=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbb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clfhAaOaPcefgP9hmbkkaYJbbbZNh8MakcuaOcltalcFFFFd0Ecbyd:e1jjbHjjjjbbg8ABd9OakcwBd:Secba8AaKaCaOz:djjjb8Aakaocbyd:e1jjbHjjjjbbgPBd2aPcFeaoz:njjjbhrakc8Wfcwf9cb83ibak9cb83i8WcbhPJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgcbhlinJbbbbh3dnaPTmbJbbjZaP:Z:vh3kaka8Ea3NgaUdaaka5a3NghUd3akaEa3Ng8JUdKJbbbbh3dnagagNaYaYNa8Fa8FNMMg8KJbbbb9BmbJbbjZa8K:r:vh3kakaga3NUd8Saka8Fa3NUdyakaYa3NUd8Kdndndnakyd8WgQakydUgAakcKfaeaiakc;abfaKamara8Maqz:ejjjbgCcuSmbdnaPaD9pmbaAaraiaCcx2fgXydbfRbbcFeSfaraXclfydbfRbbcFeSfaraXcwfydbfRbbcFeSfaw9nmdkaQaAcbaeaiakc;abfaKamara8MJbbbbz:ejjjbgCcu9hmekakaaUdCakahUdzaka8JUdxakcuBdwakcFFF;7rBdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var x=new Uint8Array(m.length),b=0;b<m.length;++b){var T=m.charCodeAt(b);x[b]=T>96?T-97:T>64?T-39:T+4}for(var C=0,b=0;b<m.length;++b)x[C++]=x[b]<60?t[x[b]]:(x[b]-60)*64+x[++b];return x.buffer.slice(0,C)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}var a=48,c=16;function u(m,x){var b=m.meshlets[x*4+0],T=m.meshlets[x*4+1],C=m.meshlets[x*4+2],A=m.meshlets[x*4+3];return{vertices:m.vertices.subarray(b,b+C),triangles:m.triangles.subarray(T,T+A*3)}}function f(m,x,b,T,C,A,E){var v=n.exports.sbrk,D=n.exports.meshopt_buildMeshletsBound(m.length,C,A),O=v(D*c),R=v(D*C*4),M=v(D*A*3),N=v(m.byteLength),_=v(x.byteLength),S=new Uint8Array(n.exports.memory.buffer);S.set(s(m),N),S.set(s(x),_);var w=n.exports.meshopt_buildMeshlets(O,R,M,N,m.length,_,b,T,C,A,E);S=new Uint8Array(n.exports.memory.buffer);for(var I=S.subarray(O,O+w*c),L=new Uint32Array(I.buffer,I.byteOffset,I.byteLength/4).slice(),B=0;B<w;++B){var U=L[B*4+0],V=L[B*4+1],b=L[B*4+2],G=L[B*4+3];n.exports.meshopt_optimizeMeshlet(R+U*4,M+V,G,b)}var k=L[(w-1)*4+0],W=L[(w-1)*4+1],j=L[(w-1)*4+2],J=L[(w-1)*4+3],q=k+j,K=W+(J*3+3&-4),Q={meshlets:L,vertices:new Uint32Array(S.buffer,R,q).slice(),triangles:new Uint8Array(S.buffer,M,K*3).slice(),meshletCount:w};return v(O-v(0)),Q}function d(m){var x=new Float32Array(n.exports.memory.buffer,m,a/4);return{centerX:x[0],centerY:x[1],centerZ:x[2],radius:x[3],coneApexX:x[4],coneApexY:x[5],coneApexZ:x[6],coneAxisX:x[7],coneAxisY:x[8],coneAxisZ:x[9],coneCutoff:x[10]}}function p(m,x,b,T){var C=n.exports.sbrk,A=[],E=C(x.byteLength),v=C(m.vertices.byteLength),D=C(m.triangles.byteLength),O=C(a),R=new Uint8Array(n.exports.memory.buffer);R.set(s(x),E),R.set(s(m.vertices),v),R.set(s(m.triangles),D);for(var M=0;M<m.meshletCount;++M){var N=m.meshlets[M*4+0],_=m.meshlets[M*4+0+1],S=m.meshlets[M*4+0+3];n.exports.meshopt_computeMeshletBounds(O,v+N*4,D+_,S,E,b,T),A.push(d(O))}return C(E-C(0)),A}function g(m,x,b,T){var C=n.exports.sbrk,A=C(a),E=C(m.byteLength),v=C(x.byteLength),D=new Uint8Array(n.exports.memory.buffer);D.set(s(m),E),D.set(s(x),v),n.exports.meshopt_computeClusterBounds(A,E,m.length,v,b,T);var O=d(A);return C(A-C(0)),O}return{ready:i,supported:!0,buildMeshlets:function(m,x,b,T,C,A){r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T<=255||T>0),r(C<=512),r(C%4==0),A=A||0;var E=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return f(E,x,x.length/b,b*4,T,C,A)},computeClusterBounds:function(m,x,b){r(m.length%3==0),r(m.length/3<=512),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3);var T=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return g(T,x,x.length/b,b*4)},computeMeshletBounds:function(m,x,b){return r(m.meshletCount!=0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),p(m,x,x.length/b,b*4)},extractMeshlet:function(m,x){return r(x>=0&&x<m.meshletCount),u(m,x)}}}();typeof IR=="object"&&typeof sW=="object"?sW.exports=kU:typeof define=="function"&&define.amd?define([],function(){return kU}):typeof IR=="object"?IR.MeshoptClusterizer=kU:(typeof self<"u"?self:IR).MeshoptClusterizer=kU});var Sre=Xn((lnn,Ere)=>{var w3e=bre(),D3e=Tre(),I3e=Cre(),P3e=Are();Ere.exports={MeshoptEncoder:w3e,MeshoptDecoder:D3e,MeshoptSimplifier:I3e,MeshoptClusterizer:P3e}});var Ble=Xn((TDn,Fle)=>{"use strict";Fle.exports=kje;var yL=1e20;function kje(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,u,f,d,p,g,m,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),r=p.width,s=p.height,g=d.getImageData(0,0,r,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,r=p.width,s=p.height,g=d.getImageData(0,0,r,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),m=0,x=Math.floor(u.length/f);m<x;m++)c[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*s),T=Array(r*s),C=Array(a),A=Array(a),E=Array(a+1),v=Array(a);for(m=0,x=r*s;m<x;m++){var D=c[m];b[m]=D===1?0:D===0?yL:Math.pow(Math.max(0,.5-D),2),T[m]=D===1?yL:D===0?0:Math.pow(Math.max(0,D-.5),2)}Lle(b,r,s,C,A,v,E),Lle(T,r,s,C,A,v,E);var O=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(m=0,x=r*s;m<x;m++)O[m]=Math.min(Math.max(1-((b[m]-T[m])/i+n),0),1);return O}function Lle(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(Nle(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(Nle(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function Nle(e,t,n,i,o){n[0]=0,i[0]=-yL,i[1]=+yL;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+yL}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var Hle=Xn((kDn,Ez)=>{function Kje(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,x=15,b=16,T=17,C=0,A=1,E=2,v=3,D=4;function O(_,S){return 55296<=_.charCodeAt(S)&&_.charCodeAt(S)<=56319&&56320<=_.charCodeAt(S+1)&&_.charCodeAt(S+1)<=57343}function R(_,S){S===void 0&&(S=0);var w=_.charCodeAt(S);if(55296<=w&&w<=56319&&S<_.length-1){var I=w,L=_.charCodeAt(S+1);return 56320<=L&&L<=57343?(I-55296)*1024+(L-56320)+65536:I}if(56320<=w&&w<=57343&&S>=1){var I=_.charCodeAt(S-1),L=w;return 55296<=I&&I<=56319?(I-55296)*1024+(L-56320)+65536:L}return w}function M(_,S,w){var I=[_].concat(S).concat([w]),L=I[I.length-2],B=w,U=I.lastIndexOf(m);if(U>1&&I.slice(1,U).every(function(k){return k==i})&&[i,g,T].indexOf(_)==-1)return E;var V=I.lastIndexOf(o);if(V>0&&I.slice(1,V).every(function(k){return k==o})&&[p,o].indexOf(L)==-1)return I.filter(function(k){return k==o}).length%2==1?v:D;if(L==e&&B==t)return C;if(L==n||L==e||L==t)return B==m&&S.every(function(k){return k==i})?E:A;if(B==n||B==e||B==t)return A;if(L==s&&(B==s||B==a||B==u||B==f))return C;if((L==u||L==a)&&(B==a||B==c))return C;if((L==f||L==c)&&B==c)return C;if(B==i||B==x)return C;if(B==r)return C;if(L==p)return C;var G=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,T].indexOf(I[G])!=-1&&I.slice(G+1,-1).every(function(k){return k==i})&&B==m||L==x&&[b,T].indexOf(B)!=-1?C:S.indexOf(o)!=-1?E:L==o&&B==o?C:A}this.nextBreak=function(_,S){if(S===void 0&&(S=0),S<0)return 0;if(S>=_.length-1)return _.length;for(var w=N(R(_,S)),I=[],L=S+1;L<_.length;L++)if(!O(_,L-1)){var B=N(R(_,L));if(M(w,I,B))return L;I.push(B)}return _.length},this.splitGraphemes=function(_){for(var S=[],w=0,I;(I=this.nextBreak(_,w))<_.length;)S.push(_.slice(w,I)),w=I;return w<_.length&&S.push(_.slice(w)),S},this.iterateGraphemes=function(_){var S=0,w={next:function(){var I,L;return(L=this.nextBreak(_,S))<_.length?(I=_.slice(S,L),S=L,{value:I,done:!1}):S<_.length?(I=_.slice(S),S=_.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var S=0,w=0,I;(I=this.nextBreak(_,w))<_.length;)w=I,S++;return w<_.length&&S++,S};function N(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?o:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?r:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?x:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?b:128102<=_&&_<=128105?T:d}return this}typeof Ez<"u"&&Ez.exports&&(Ez.exports=Kje)});var Ime=Xn((cq,lq)=>{(function(e,t){typeof cq=="object"&&typeof lq<"u"?lq.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.RBush=t())})(cq,function(){"use strict";function e(A,E,v,D,O){t(A,E,v||0,D||A.length-1,O||i)}function t(A,E,v,D,O){for(;D>v;){if(D-v>600){var R=D-v+1,M=E-v+1,N=Math.log(R),_=.5*Math.exp(2*N/3),S=.5*Math.sqrt(N*_*(R-_)/R)*(M-R/2<0?-1:1),w=Math.max(v,Math.floor(E-M*_/R+S)),I=Math.min(D,Math.floor(E+(R-M)*_/R+S));t(A,E,w,I,O)}var L=A[E],B=v,U=D;for(n(A,v,E),O(A[D],L)>0&&n(A,v,D);B<U;){for(n(A,B,U),B++,U--;O(A[B],L)<0;)B++;for(;O(A[U],L)>0;)U--}O(A[v],L)===0?n(A,v,U):(U++,n(A,U,D)),U<=E&&(v=U+1),E<=U&&(D=U-1)}}function n(A,E,v){var D=A[E];A[E]=A[v],A[v]=D}function i(A,E){return A<E?-1:A>E?1:0}var o=function(E){E===void 0&&(E=9),this._maxEntries=Math.max(4,E),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(E){var v=this.data,D=[];if(!b(E,v))return D;for(var O=this.toBBox,R=[];v;){for(var M=0;M<v.children.length;M++){var N=v.children[M],_=v.leaf?O(N):N;b(E,_)&&(v.leaf?D.push(N):x(E,_)?this._all(N,D):R.push(N))}v=R.pop()}return D},o.prototype.collides=function(E){var v=this.data;if(!b(E,v))return!1;for(var D=[];v;){for(var O=0;O<v.children.length;O++){var R=v.children[O],M=v.leaf?this.toBBox(R):R;if(b(E,M)){if(v.leaf||x(E,M))return!0;D.push(R)}}v=D.pop()}return!1},o.prototype.load=function(E){if(!(E&&E.length))return this;if(E.length<this._minEntries){for(var v=0;v<E.length;v++)this.insert(E[v]);return this}var D=this._build(E.slice(),0,E.length-1,0);if(!this.data.children.length)this.data=D;else if(this.data.height===D.height)this._splitRoot(this.data,D);else{if(this.data.height<D.height){var O=this.data;this.data=D,D=O}this._insert(D,this.data.height-D.height-1,!0)}return this},o.prototype.insert=function(E){return E&&this._insert(E,this.data.height-1),this},o.prototype.clear=function(){return this.data=T([]),this},o.prototype.remove=function(E,v){if(!E)return this;for(var D=this.data,O=this.toBBox(E),R=[],M=[],N,_,S;D||R.length;){if(D||(D=R.pop(),_=R[R.length-1],N=M.pop(),S=!0),D.leaf){var w=r(E,D.children,v);if(w!==-1)return D.children.splice(w,1),R.push(D),this._condense(R),this}!S&&!D.leaf&&x(D,O)?(R.push(D),M.push(N),N=0,_=D,D=D.children[0]):_?(N++,D=_.children[N],S=!1):D=null}return this},o.prototype.toBBox=function(E){return E},o.prototype.compareMinX=function(E,v){return E.minX-v.minX},o.prototype.compareMinY=function(E,v){return E.minY-v.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(E){return this.data=E,this},o.prototype._all=function(E,v){for(var D=[];E;)E.leaf?v.push.apply(v,E.children):D.push.apply(D,E.children),E=D.pop();return v},o.prototype._build=function(E,v,D,O){var R=D-v+1,M=this._maxEntries,N;if(R<=M)return N=T(E.slice(v,D+1)),s(N,this.toBBox),N;O||(O=Math.ceil(Math.log(R)/Math.log(M)),M=Math.ceil(R/Math.pow(M,O-1))),N=T([]),N.leaf=!1,N.height=O;var _=Math.ceil(R/M),S=_*Math.ceil(Math.sqrt(M));C(E,v,D,S,this.compareMinX);for(var w=v;w<=D;w+=S){var I=Math.min(w+S-1,D);C(E,w,I,_,this.compareMinY);for(var L=w;L<=I;L+=_){var B=Math.min(L+_-1,I);N.children.push(this._build(E,L,B,O-1))}}return s(N,this.toBBox),N},o.prototype._chooseSubtree=function(E,v,D,O){for(;O.push(v),!(v.leaf||O.length-1===D);){for(var R=1/0,M=1/0,N=void 0,_=0;_<v.children.length;_++){var S=v.children[_],w=d(S),I=g(E,S)-w;I<M?(M=I,R=w<R?w:R,N=S):I===M&&w<R&&(R=w,N=S)}v=N||v.children[0]}return v},o.prototype._insert=function(E,v,D){var O=D?E:this.toBBox(E),R=[],M=this._chooseSubtree(O,this.data,v,R);for(M.children.push(E),c(M,O);v>=0&&R[v].children.length>this._maxEntries;)this._split(R,v),v--;this._adjustParentBBoxes(O,R,v)},o.prototype._split=function(E,v){var D=E[v],O=D.children.length,R=this._minEntries;this._chooseSplitAxis(D,R,O);var M=this._chooseSplitIndex(D,R,O),N=T(D.children.splice(M,D.children.length-M));N.height=D.height,N.leaf=D.leaf,s(D,this.toBBox),s(N,this.toBBox),v?E[v-1].children.push(N):this._splitRoot(D,N)},o.prototype._splitRoot=function(E,v){this.data=T([E,v]),this.data.height=E.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(E,v,D){for(var O,R=1/0,M=1/0,N=v;N<=D-v;N++){var _=a(E,0,N,this.toBBox),S=a(E,N,D,this.toBBox),w=m(_,S),I=d(_)+d(S);w<R?(R=w,O=N,M=I<M?I:M):w===R&&I<M&&(M=I,O=N)}return O||D-v},o.prototype._chooseSplitAxis=function(E,v,D){var O=E.leaf?this.compareMinX:u,R=E.leaf?this.compareMinY:f,M=this._allDistMargin(E,v,D,O),N=this._allDistMargin(E,v,D,R);M<N&&E.children.sort(O)},o.prototype._allDistMargin=function(E,v,D,O){E.children.sort(O);for(var R=this.toBBox,M=a(E,0,v,R),N=a(E,D-v,D,R),_=p(M)+p(N),S=v;S<D-v;S++){var w=E.children[S];c(M,E.leaf?R(w):w),_+=p(M)}for(var I=D-v-1;I>=v;I--){var L=E.children[I];c(N,E.leaf?R(L):L),_+=p(N)}return _},o.prototype._adjustParentBBoxes=function(E,v,D){for(var O=D;O>=0;O--)c(v[O],E)},o.prototype._condense=function(E){for(var v=E.length-1,D=void 0;v>=0;v--)E[v].children.length===0?v>0?(D=E[v-1].children,D.splice(D.indexOf(E[v]),1)):this.clear():s(E[v],this.toBBox)};function r(A,E,v){if(!v)return E.indexOf(A);for(var D=0;D<E.length;D++)if(v(A,E[D]))return D;return-1}function s(A,E){a(A,0,A.children.length,E,A)}function a(A,E,v,D,O){O||(O=T(null)),O.minX=1/0,O.minY=1/0,O.maxX=-1/0,O.maxY=-1/0;for(var R=E;R<v;R++){var M=A.children[R];c(O,A.leaf?D(M):M)}return O}function c(A,E){return A.minX=Math.min(A.minX,E.minX),A.minY=Math.min(A.minY,E.minY),A.maxX=Math.max(A.maxX,E.maxX),A.maxY=Math.max(A.maxY,E.maxY),A}function u(A,E){return A.minX-E.minX}function f(A,E){return A.minY-E.minY}function d(A){return(A.maxX-A.minX)*(A.maxY-A.minY)}function p(A){return A.maxX-A.minX+(A.maxY-A.minY)}function g(A,E){return(Math.max(E.maxX,A.maxX)-Math.min(E.minX,A.minX))*(Math.max(E.maxY,A.maxY)-Math.min(E.minY,A.minY))}function m(A,E){var v=Math.max(A.minX,E.minX),D=Math.max(A.minY,E.minY),O=Math.min(A.maxX,E.maxX),R=Math.min(A.maxY,E.maxY);return Math.max(0,O-v)*Math.max(0,R-D)}function x(A,E){return A.minX<=E.minX&&A.minY<=E.minY&&E.maxX<=A.maxX&&E.maxY<=A.maxY}function b(A,E){return E.minX<=A.maxX&&E.minY<=A.maxY&&E.maxX>=A.minX&&E.maxY>=A.minY}function T(A){return{children:A,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function C(A,E,v,D,O){for(var R=[E,v];R.length;)if(v=R.pop(),E=R.pop(),!(v-E<=D)){var M=E+Math.ceil((v-E)/D/2)*D;e(A,M,E,v,O),R.push(E,M,M,v)}}return o})});var ppe=Xn((T4,mpe)=>{(function(e,t){typeof T4=="object"&&typeof mpe<"u"?t(T4):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(T4,function(e){"use strict";function t(A){return A}function n(A){if(A==null)return t;var E,v,D=A.scale[0],O=A.scale[1],R=A.translate[0],M=A.translate[1];return function(N,_){_||(E=v=0);var S=2,w=N.length,I=new Array(w);for(I[0]=(E+=N[0])*D+R,I[1]=(v+=N[1])*O+M;S<w;)I[S]=N[S],++S;return I}}function i(A){var E=n(A.transform),v,D=1/0,O=D,R=-D,M=-D;function N(S){S=E(S),S[0]<D&&(D=S[0]),S[0]>R&&(R=S[0]),S[1]<O&&(O=S[1]),S[1]>M&&(M=S[1])}function _(S){switch(S.type){case"GeometryCollection":S.geometries.forEach(_);break;case"Point":N(S.coordinates);break;case"MultiPoint":S.coordinates.forEach(N);break}}A.arcs.forEach(function(S){for(var w=-1,I=S.length,L;++w<I;)L=E(S[w],w),L[0]<D&&(D=L[0]),L[0]>R&&(R=L[0]),L[1]<O&&(O=L[1]),L[1]>M&&(M=L[1])});for(v in A.objects)_(A.objects[v]);return[D,O,R,M]}function o(A,E){for(var v,D=A.length,O=D-E;O<--D;)v=A[O],A[O++]=A[D],A[D]=v}function r(A,E){return typeof E=="string"&&(E=A.objects[E]),E.type==="GeometryCollection"?{type:"FeatureCollection",features:E.geometries.map(function(v){return s(A,v)})}:s(A,E)}function s(A,E){var v=E.id,D=E.bbox,O=E.properties==null?{}:E.properties,R=a(A,E);return v==null&&D==null?{type:"Feature",properties:O,geometry:R}:D==null?{type:"Feature",id:v,properties:O,geometry:R}:{type:"Feature",id:v,bbox:D,properties:O,geometry:R}}function a(A,E){var v=n(A.transform),D=A.arcs;function O(w,I){I.length&&I.pop();for(var L=D[w<0?~w:w],B=0,U=L.length;B<U;++B)I.push(v(L[B],B));w<0&&o(I,U)}function R(w){return v(w)}function M(w){for(var I=[],L=0,B=w.length;L<B;++L)O(w[L],I);return I.length<2&&I.push(I[0]),I}function N(w){for(var I=M(w);I.length<4;)I.push(I[0]);return I}function _(w){return w.map(N)}function S(w){var I=w.type,L;switch(I){case"GeometryCollection":return{type:I,geometries:w.geometries.map(S)};case"Point":L=R(w.coordinates);break;case"MultiPoint":L=w.coordinates.map(R);break;case"LineString":L=M(w.arcs);break;case"MultiLineString":L=w.arcs.map(M);break;case"Polygon":L=_(w.arcs);break;case"MultiPolygon":L=w.arcs.map(_);break;default:return null}return{type:I,coordinates:L}}return S(E)}function c(A,E){var v={},D={},O={},R=[],M=-1;E.forEach(function(S,w){var I=A.arcs[S<0?~S:S],L;I.length<3&&!I[1][0]&&!I[1][1]&&(L=E[++M],E[M]=S,E[w]=L)}),E.forEach(function(S){var w=N(S),I=w[0],L=w[1],B,U;if(B=O[I])if(delete O[B.end],B.push(S),B.end=L,U=D[L]){delete D[U.start];var V=U===B?B:B.concat(U);D[V.start=B.start]=O[V.end=U.end]=V}else D[B.start]=O[B.end]=B;else if(B=D[L])if(delete D[B.start],B.unshift(S),B.start=I,U=O[I]){delete O[U.end];var G=U===B?B:U.concat(B);D[G.start=U.start]=O[G.end=B.end]=G}else D[B.start]=O[B.end]=B;else B=[S],D[B.start=I]=O[B.end=L]=B});function N(S){var w=A.arcs[S<0?~S:S],I=w[0],L;return A.transform?(L=[0,0],w.forEach(function(B){L[0]+=B[0],L[1]+=B[1]})):L=w[w.length-1],S<0?[L,I]:[I,L]}function _(S,w){for(var I in S){var L=S[I];delete w[L.start],delete L.start,delete L.end,L.forEach(function(B){v[B<0?~B:B]=1}),R.push(L)}}return _(O,D),_(D,O),E.forEach(function(S){v[S<0?~S:S]||R.push([S])}),R}function u(A){return a(A,f.apply(this,arguments))}function f(A,E,v){var D,O,R;if(arguments.length>1)D=d(A,E,v);else for(O=0,D=new Array(R=A.arcs.length);O<R;++O)D[O]=O;return{type:"MultiLineString",arcs:c(A,D)}}function d(A,E,v){var D=[],O=[],R;function M(I){var L=I<0?~I:I;(O[L]||(O[L]=[])).push({i:I,g:R})}function N(I){I.forEach(M)}function _(I){I.forEach(N)}function S(I){I.forEach(_)}function w(I){switch(R=I,I.type){case"GeometryCollection":I.geometries.forEach(w);break;case"LineString":N(I.arcs);break;case"MultiLineString":case"Polygon":_(I.arcs);break;case"MultiPolygon":S(I.arcs);break}}return w(E),O.forEach(v==null?function(I){D.push(I[0].i)}:function(I){v(I[0].g,I[I.length-1].g)&&D.push(I[0].i)}),D}function p(A){for(var E=-1,v=A.length,D,O=A[v-1],R=0;++E<v;)D=O,O=A[E],R+=D[0]*O[1]-D[1]*O[0];return Math.abs(R)}function g(A){return a(A,m.apply(this,arguments))}function m(A,E){var v={},D=[],O=[];E.forEach(R);function R(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(R);break;case"Polygon":M(_.arcs);break;case"MultiPolygon":_.arcs.forEach(M);break}}function M(_){_.forEach(function(S){S.forEach(function(w){(v[w=w<0?~w:w]||(v[w]=[])).push(_)})}),D.push(_)}function N(_){return p(a(A,{type:"Polygon",arcs:[_]}).coordinates[0])}return D.forEach(function(_){if(!_._){var S=[],w=[_];for(_._=1,O.push(S);_=w.pop();)S.push(_),_.forEach(function(I){I.forEach(function(L){v[L<0?~L:L].forEach(function(B){B._||(B._=1,w.push(B))})})})}}),D.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:O.map(function(_){var S=[],w;if(_.forEach(function(V){V.forEach(function(G){G.forEach(function(k){v[k<0?~k:k].length<2&&S.push(k)})})}),S=c(A,S),(w=S.length)>1)for(var I=1,L=N(S[0]),B,U;I<w;++I)(B=N(S[I]))>L&&(U=S[0],S[0]=S[I],S[I]=U,L=B);return S}).filter(function(_){return _.length>0})}}function x(A,E){for(var v=0,D=A.length;v<D;){var O=v+D>>>1;A[O]<E?v=O+1:D=O}return v}function b(A){var E={},v=A.map(function(){return[]});function D(V,G){V.forEach(function(k){k<0&&(k=~k);var W=E[k];W?W.push(G):E[k]=[G]})}function O(V,G){V.forEach(function(k){D(k,G)})}function R(V,G){V.type==="GeometryCollection"?V.geometries.forEach(function(k){R(k,G)}):V.type in M&&M[V.type](V.arcs,G)}var M={LineString:D,MultiLineString:O,Polygon:O,MultiPolygon:function(V,G){V.forEach(function(k){O(k,G)})}};A.forEach(R);for(var N in E)for(var _=E[N],S=_.length,w=0;w<S;++w)for(var I=w+1;I<S;++I){var L=_[w],B=_[I],U;(U=v[L])[N=x(U,B)]!==B&&U.splice(N,0,B),(U=v[B])[N=x(U,L)]!==L&&U.splice(N,0,L)}return v}function T(A){if(A==null)return t;var E,v,D=A.scale[0],O=A.scale[1],R=A.translate[0],M=A.translate[1];return function(N,_){_||(E=v=0);var S=2,w=N.length,I=new Array(w),L=Math.round((N[0]-R)/D),B=Math.round((N[1]-M)/O);for(I[0]=L-E,E=L,I[1]=B-v,v=B;S<w;)I[S]=N[S],++S;return I}}function C(A,E){if(A.transform)throw new Error("already quantized");if(!E||!E.scale){if(!((M=Math.floor(E))>=2))throw new Error("n must be \u22652");_=A.bbox||i(A);var v=_[0],D=_[1],O=_[2],R=_[3],M;E={scale:[O-v?(O-v)/(M-1):1,R-D?(R-D)/(M-1):1],translate:[v,D]}}else _=A.bbox;var N=T(E),_,S,w=A.objects,I={};function L(V){return N(V)}function B(V){var G;switch(V.type){case"GeometryCollection":G={type:"GeometryCollection",geometries:V.geometries.map(B)};break;case"Point":G={type:"Point",coordinates:L(V.coordinates)};break;case"MultiPoint":G={type:"MultiPoint",coordinates:V.coordinates.map(L)};break;default:return V}return V.id!=null&&(G.id=V.id),V.bbox!=null&&(G.bbox=V.bbox),V.properties!=null&&(G.properties=V.properties),G}function U(V){var G=0,k=1,W=V.length,j,J=new Array(W);for(J[0]=N(V[0],0);++G<W;)((j=N(V[G],G))[0]||j[1])&&(J[k++]=j);return k===1&&(J[k++]=[0,0]),J.length=k,J}for(S in w)I[S]=B(w[S]);return{type:"Topology",bbox:_,transform:E,objects:I,arcs:A.arcs.map(U)}}e.bbox=i,e.feature=r,e.merge=g,e.mergeArcs=m,e.mesh=u,e.meshArcs=f,e.neighbors=b,e.quantize=C,e.transform=n,e.untransform=T,Object.defineProperty(e,"__esModule",{value:!0})})});var Npe=Xn(E4=>{"use strict";Object.defineProperty(E4,"__esModule",{value:!0});E4.version=void 0;E4.version="4.0.0"});var vS=Xn(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.assertNever=Ec.removeWithPredicate=Ec.remove=Ec.ellipsis=Ec.defaults=Ec.isBoolean=Ec.isUndefined=void 0;function Fpe(e){return e===void 0}Ec.isUndefined=Fpe;function gnt(e){return typeof e=="boolean"}Ec.isBoolean=gnt;function ynt(e,t){for(var n in t)t.hasOwnProperty(n)&&Fpe(e[n])&&(e[n]=t[n]);return e}Ec.defaults=ynt;function xnt(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}Ec.ellipsis=xnt;function bnt(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}Ec.remove=bnt;function Tnt(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}Ec.removeWithPredicate=Tnt;function Cnt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}Ec.assertNever=Cnt});var TT=Xn(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.alphaNumericAndMarksRe=vi.alphaNumericAndMarksCharsStr=vi.alphaNumericCharsRe=vi.decimalNumbersStr=vi.alphaCharsAndMarksStr=vi.marksStr=vi.emojiStr=vi.alphaCharsStr=vi.controlCharsRe=vi.quoteRe=vi.whitespaceRe=vi.nonDigitRe=vi.digitRe=vi.letterRe=void 0;vi.letterRe=/[A-Za-z]/;vi.digitRe=/[\d]/;vi.nonDigitRe=/[\D]/;vi.whitespaceRe=/\s/;vi.quoteRe=/['"]/;vi.controlCharsRe=/[\x00-\x1F\x7F]/;vi.alphaCharsStr=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source;vi.emojiStr=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source;vi.marksStr=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source;vi.alphaCharsAndMarksStr=vi.alphaCharsStr+vi.emojiStr+vi.marksStr;vi.decimalNumbersStr=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source;vi.alphaNumericCharsRe=new RegExp("[".concat(vi.alphaCharsStr+vi.decimalNumbersStr,"]"));vi.alphaNumericAndMarksCharsStr=vi.alphaCharsAndMarksStr+vi.decimalNumbersStr;vi.alphaNumericAndMarksRe=new RegExp("[".concat(vi.alphaNumericAndMarksCharsStr,"]"))});var w4=Xn(v4=>{"use strict";Object.defineProperty(v4,"__esModule",{value:!0});v4.HtmlTag=void 0;var S4=TT(),Ant=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(S4.whitespaceRe):[],o=t.split(S4.whitespaceRe),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(S4.whitespaceRe):[],o=t.split(S4.whitespaceRe),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();v4.HtmlTag=Ant});var Bpe=Xn(D4=>{"use strict";Object.defineProperty(D4,"__esModule",{value:!0});D4.truncateSmart=void 0;function Ent(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(C){var A={},E=C,v=E.match(/^([a-z]+):\/\//i);return v&&(A.scheme=v[1],E=E.substr(v[0].length)),v=E.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(A.host=v[1],E=E.substr(v[0].length)),v=E.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(A.path=v[1],E=E.substr(v[0].length)),v=E.match(/^\?(.*?)(?=(#|$))/i),v&&(A.query=v[1],E=E.substr(v[0].length)),v=E.match(/^#(.*?)$/i),v&&(A.fragment=v[1]),A},s=function(C){var A="";return C.scheme&&C.host&&(A+=C.scheme+"://"),C.host&&(A+=C.host),C.path&&(A+="/"+C.path),C.query&&(A+="?"+C.query),C.fragment&&(A+="#"+C.fragment),A},a=function(C,A){var E=A/2,v=Math.ceil(E),D=-1*Math.floor(E),O="";return D<0&&(O=C.substr(D)),C.substr(0,v)+n+O};if(e.length<=t)return e;var c=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var d="";if(u.host&&(d+=u.host),d.length>=c)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,c+i):a(d,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((d+p).length>=c){if((d+p).length==t)return(d+p).substr(0,t);var g=c-d.length;return(d+a(p,g)).substr(0,c+i)}else d+=p;if(u.fragment){var m="#"+u.fragment;if((d+m).length>=c){if((d+m).length==t)return(d+m).substr(0,t);var x=c-d.length;return(d+a(m,x)).substr(0,c+i)}else d+=m}if(u.scheme&&u.host){var b=u.scheme+"://";if((d+b).length<c)return(b+d).substr(0,t)}if(d.length<=t)return d;var T="";return c>0&&(T=d.substr(-1*Math.floor(c/2))),(d.substr(0,Math.ceil(c/2))+n+T).substr(0,c+i)}D4.truncateSmart=Ent});var kpe=Xn(I4=>{"use strict";Object.defineProperty(I4,"__esModule",{value:!0});I4.truncateMiddle=void 0;function Snt(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}I4.truncateMiddle=Snt});var Vpe=Xn(P4=>{"use strict";Object.defineProperty(P4,"__esModule",{value:!0});P4.truncateEnd=void 0;var vnt=vS();function wnt(e,t,n){return(0,vnt.ellipsis)(e,t,n)}P4.truncateEnd=wnt});var vq=Xn(R4=>{"use strict";Object.defineProperty(R4,"__esModule",{value:!0});R4.AnchorTagBuilder=void 0;var Dnt=w4(),Int=Bpe(),Pnt=kpe(),Rnt=Vpe(),Ont=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new Dnt.HtmlTag({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?(0,Int.truncateSmart)(t,i):o==="middle"?(0,Pnt.truncateMiddle)(t,i):(0,Rnt.truncateEnd)(t,i)},e}();R4.AnchorTagBuilder=Ont});var Um={};jQ(Um,{__addDisposableResource:()=>u_e,__assign:()=>O4,__asyncDelegator:()=>n_e,__asyncGenerator:()=>t_e,__asyncValues:()=>i_e,__await:()=>wS,__awaiter:()=>Kpe,__classPrivateFieldGet:()=>a_e,__classPrivateFieldIn:()=>l_e,__classPrivateFieldSet:()=>c_e,__createBinding:()=>L4,__decorate:()=>Hpe,__disposeResources:()=>f_e,__esDecorate:()=>Wpe,__exportStar:()=>$pe,__extends:()=>Upe,__generator:()=>Zpe,__importDefault:()=>s_e,__importStar:()=>r_e,__makeTemplateObject:()=>o_e,__metadata:()=>Xpe,__param:()=>Gpe,__propKey:()=>qpe,__read:()=>Iq,__rest:()=>zpe,__rewriteRelativeImportExtension:()=>d_e,__runInitializers:()=>jpe,__setFunctionName:()=>Ype,__spread:()=>Qpe,__spreadArray:()=>e_e,__spreadArrays:()=>Jpe,__values:()=>M4,default:()=>Nnt});function Upe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");wq(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function zpe(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n}function Hpe(e,t,n,i){var o=arguments.length,r=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function Gpe(e,t){return function(n,i){t(n,i,e)}}function Wpe(e,t,n,i,o,r){function s(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,p=!1,g=n.length-1;g>=0;g--){var m={};for(var x in i)m[x]=x==="access"?{}:i[x];for(var x in i.access)m.access[x]=i.access[x];m.addInitializer=function(T){if(p)throw new TypeError("Cannot add initializers after decoration has completed");r.push(s(T||null))};var b=(0,n[g])(a==="accessor"?{get:f.get,set:f.set}:f[c],m);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(d=s(b.get))&&(f.get=d),(d=s(b.set))&&(f.set=d),(d=s(b.init))&&o.unshift(d)}else(d=s(b))&&(a==="field"?o.unshift(d):f[c]=d)}u&&Object.defineProperty(u,i.name,f),p=!0}function jpe(e,t,n){for(var i=arguments.length>2,o=0;o<t.length;o++)n=i?t[o].call(e,n):t[o].call(e);return i?n:void 0}function qpe(e){return typeof e=="symbol"?e:"".concat(e)}function Ype(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function Xpe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Kpe(e,t,n,i){function o(r){return r instanceof n?r:new n(function(s){s(r)})}return new(n||(n=Promise))(function(r,s){function a(f){try{u(i.next(f))}catch(d){s(d)}}function c(f){try{u(i.throw(f))}catch(d){s(d)}}function u(f){f.done?r(f.value):o(f.value).then(a,c)}u((i=i.apply(e,t||[])).next())})}function Zpe(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){n.label=u[1];break}if(u[0]===6&&n.label<r[1]){n.label=r[1],r=u;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(u);break}r[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function $pe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&L4(t,e,n)}function M4(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Iq(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],s;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function Qpe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Iq(arguments[t]));return e}function Jpe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),o=0,t=0;t<n;t++)for(var r=arguments[t],s=0,a=r.length;s<a;s++,o++)i[o]=r[s];return i}function e_e(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function wS(e){return this instanceof wS?(this.v=e,this):new wS(e)}function t_e(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),o,r=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(g){return function(m){return Promise.resolve(m).then(g,d)}}function a(g,m){i[g]&&(o[g]=function(x){return new Promise(function(b,T){r.push([g,x,b,T])>1||c(g,x)})},m&&(o[g]=m(o[g])))}function c(g,m){try{u(i[g](m))}catch(x){p(r[0][3],x)}}function u(g){g.value instanceof wS?Promise.resolve(g.value.v).then(f,d):p(r[0][2],g)}function f(g){c("next",g)}function d(g){c("throw",g)}function p(g,m){g(m),r.shift(),r.length&&c(r[0][0],r[0][1])}}function n_e(e){var t,n;return t={},i("next"),i("throw",function(o){throw o}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(o,r){t[o]=e[o]?function(s){return(n=!n)?{value:wS(e[o](s)),done:!1}:r?r(s):s}:r}}function i_e(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof M4=="function"?M4(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=e[r]&&function(s){return new Promise(function(a,c){s=e[r](s),o(a,c,s.done,s.value)})}}function o(r,s,a,c){Promise.resolve(c).then(function(u){r({value:u,done:a})},s)}}function o_e(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function r_e(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=Dq(e),i=0;i<n.length;i++)n[i]!=="default"&&L4(t,e,n[i]);return Mnt(t,e),t}function s_e(e){return e&&e.__esModule?e:{default:e}}function a_e(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function c_e(e,t,n,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function l_e(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function u_e(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(o=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");o&&(i=function(){try{o.call(this)}catch(r){return Promise.reject(r)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}function f_e(e){function t(r){e.error=e.hasError?new Lnt(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}var n,i=0;function o(){for(;n=e.stack.pop();)try{if(!n.async&&i===1)return i=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var r=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(r).then(o,function(s){return t(s),o()})}else i|=1}catch(s){t(s)}if(i===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function d_e(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,o,r,s){return i?t?".jsx":".js":o&&(!r||!s)?n:o+r+"."+s.toLowerCase()+"js"}):e}var wq,O4,L4,Mnt,Dq,Lnt,Nnt,zm=qEe(()=>{wq=function(e,t){return wq=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},wq(e,t)};O4=function(){return O4=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},O4.apply(this,arguments)};L4=Object.create?function(e,t,n,i){i===void 0&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]};Mnt=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},Dq=function(e){return Dq=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},Dq(e)};Lnt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};Nnt={__extends:Upe,__assign:O4,__rest:zpe,__decorate:Hpe,__param:Gpe,__esDecorate:Wpe,__runInitializers:jpe,__propKey:qpe,__setFunctionName:Ype,__metadata:Xpe,__awaiter:Kpe,__generator:Zpe,__createBinding:L4,__exportStar:$pe,__values:M4,__read:Iq,__spread:Qpe,__spreadArrays:Jpe,__spreadArray:e_e,__await:wS,__asyncGenerator:t_e,__asyncDelegator:n_e,__asyncValues:i_e,__makeTemplateObject:o_e,__importStar:r_e,__importDefault:s_e,__classPrivateFieldGet:a_e,__classPrivateFieldSet:c_e,__classPrivateFieldIn:l_e,__addDisposableResource:u_e,__disposeResources:f_e,__rewriteRelativeImportExtension:d_e}});var CT=Xn(N4=>{"use strict";Object.defineProperty(N4,"__esModule",{value:!0});N4.AbstractMatch=void 0;var Fnt=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();N4.AbstractMatch=Fnt});var h_e=Xn(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});AT.tldRegex=AT.tldRegexStr=void 0;AT.tldRegexStr="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u062A\u0635\u0627\u0644\u0627\u062A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u8BFA\u57FA\u4E9A|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)";AT.tldRegex=new RegExp("^"+AT.tldRegexStr+"$")});var F4=Xn(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.isValidIpV4Address=Bn.isValidTldMatch=Bn.isValidSchemeUrl=Bn.isKnownTld=Bn.isUrlSuffixStartChar=Bn.isPathChar=Bn.isDomainLabelChar=Bn.isDomainLabelStartChar=Bn.isSchemeChar=Bn.isSchemeStartChar=Bn.tldUrlHostRe=Bn.schemeUrlRe=Bn.invalidSchemeRe=Bn.urlSuffixedCharsNotAllowedAtEndRe=Bn.httpSchemePrefixRe=Bn.httpSchemeRe=Bn.urlSuffixNotAllowedAsLastCharRe=Bn.urlSuffixAllowedSpecialCharsRe=Bn.urlSuffixStartCharsRe=Bn.domainNameCharRegex=void 0;var ET=TT(),Bnt=h_e();Bn.domainNameCharRegex=ET.alphaNumericAndMarksRe;Bn.urlSuffixStartCharsRe=/[\/?#]/;Bn.urlSuffixAllowedSpecialCharsRe=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/;Bn.urlSuffixNotAllowedAsLastCharRe=/[?!:,.;^]/;Bn.httpSchemeRe=/https?:\/\//i;Bn.httpSchemePrefixRe=new RegExp("^"+Bn.httpSchemeRe.source,"i");Bn.urlSuffixedCharsNotAllowedAtEndRe=new RegExp(Bn.urlSuffixNotAllowedAsLastCharRe.source+"$");Bn.invalidSchemeRe=/^(javascript|vbscript):/i;Bn.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;Bn.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;function knt(e){return ET.letterRe.test(e)}Bn.isSchemeStartChar=knt;function Vnt(e){return ET.letterRe.test(e)||ET.digitRe.test(e)||e==="+"||e==="-"||e==="."}Bn.isSchemeChar=Vnt;function m_e(e){return ET.alphaNumericAndMarksRe.test(e)}Bn.isDomainLabelStartChar=m_e;function Unt(e){return e==="_"||m_e(e)}Bn.isDomainLabelChar=Unt;function znt(e){return ET.alphaNumericAndMarksRe.test(e)||Bn.urlSuffixAllowedSpecialCharsRe.test(e)||Bn.urlSuffixNotAllowedAsLastCharRe.test(e)}Bn.isPathChar=znt;function Hnt(e){return Bn.urlSuffixStartCharsRe.test(e)}Bn.isUrlSuffixStartChar=Hnt;function p_e(e){return Bnt.tldRegex.test(e.toLowerCase())}Bn.isKnownTld=p_e;function Gnt(e){if(Bn.invalidSchemeRe.test(e))return!1;var t=e.match(Bn.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!ET.letterRe.test(i))}Bn.isValidSchemeUrl=Gnt;function Wnt(e){var t=e.match(Bn.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!p_e(o)}Bn.isValidTldMatch=Wnt;var jnt=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,qnt=/[:/?#]/;function Ynt(e){var t=e.split(qnt,1)[0];return jnt.test(t)}Bn.isValidIpV4Address=Ynt});var Pq=Xn(B4=>{"use strict";Object.defineProperty(B4,"__esModule",{value:!0});B4.UrlMatch=void 0;var Xnt=(zm(),Jh(Um)),Knt=CT(),Znt=F4(),$nt=/^(https?:\/\/)?(www\.)?/i,Qnt=/^\/\//,Jnt=function(e){(0,Xnt.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=nit(n)),this.stripPrefix.scheme&&(n=eit(n)),this.stripPrefix.www&&(n=tit(n)),this.stripTrailingSlash&&(n=iit(n)),this.decodePercentEncoding&&(n=oit(n)),n},t}(Knt.AbstractMatch);B4.UrlMatch=Jnt;function eit(e){return e.replace(Znt.httpSchemePrefixRe,"")}function tit(e){return e.replace($nt,"$1")}function nit(e){return e.replace(Qnt,"")}function iit(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function oit(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}});var g_e=Xn(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.isValidEmail=Hm.isEmailLocalPartChar=Hm.isEmailLocalPartStartChar=Hm.mailtoSchemePrefixRe=void 0;var __e=TT(),rit=F4();Hm.mailtoSchemePrefixRe=/^mailto:/i;var sit=new RegExp("[".concat(__e.alphaNumericAndMarksCharsStr,"!#$%&'*+/=?^_`{|}~-]"));function ait(e){return __e.alphaNumericAndMarksRe.test(e)}Hm.isEmailLocalPartStartChar=ait;function cit(e){return sit.test(e)}Hm.isEmailLocalPartChar=cit;function lit(e){var t=e.split(".").pop()||"";return(0,rit.isKnownTld)(t)}Hm.isValidEmail=lit});var Rq=Xn(k4=>{"use strict";Object.defineProperty(k4,"__esModule",{value:!0});k4.EmailMatch=void 0;var uit=(zm(),Jh(Um)),fit=CT(),dit=function(e){(0,uit.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(fit.AbstractMatch);k4.EmailMatch=dit});var Oq=Xn(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});f0.hashtagServices=f0.isValidHashtag=f0.isHashtagTextChar=void 0;var hit=TT();function mit(e){return e==="_"||hit.alphaNumericAndMarksRe.test(e)}f0.isHashtagTextChar=mit;function pit(e){return e.length<=140}f0.isValidHashtag=pit;f0.hashtagServices=["twitter","facebook","instagram","tiktok"]});var Mq=Xn(V4=>{"use strict";Object.defineProperty(V4,"__esModule",{value:!0});V4.HashtagMatch=void 0;var _it=(zm(),Jh(Um)),git=vS(),yit=CT(),xit=function(e){(0,_it.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;default:throw(0,git.assertNever)(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(yit.AbstractMatch);V4.HashtagMatch=xit});var Lq=Xn(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});d0.mentionServices=d0.isValidMention=d0.isMentionTextChar=void 0;var bit={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},Tit=/[-\w.]/;function Cit(e){return Tit.test(e)}d0.isMentionTextChar=Cit;function Ait(e,t){var n=bit[t];return n.test(e)}d0.isValidMention=Ait;d0.mentionServices=["twitter","instagram","soundcloud","tiktok"]});var Nq=Xn(U4=>{"use strict";Object.defineProperty(U4,"__esModule",{value:!0});U4.MentionMatch=void 0;var Eit=(zm(),Jh(Um)),Sit=CT(),vit=function(e){(0,Eit.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Sit.AbstractMatch);U4.MentionMatch=vit});var y_e=Xn(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});h0.isValidPhoneNumber=h0.isPhoneNumberControlChar=h0.isPhoneNumberSeparatorChar=void 0;var wit=/[-. ]/,Dit=/[-. ()]/,Iit=/[,;]/,Pit=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,Rit=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,Oit=new RegExp("^".concat(Pit.source,"|").concat(Rit.source,"$"));function Mit(e){return wit.test(e)}h0.isPhoneNumberSeparatorChar=Mit;function Lit(e){return Iit.test(e)}h0.isPhoneNumberControlChar=Lit;function Nit(e){var t=e.charAt(0)==="+"||Dit.test(e);return t&&Oit.test(e)}h0.isValidPhoneNumber=Nit});var Fq=Xn(z4=>{"use strict";Object.defineProperty(z4,"__esModule",{value:!0});z4.PhoneMatch=void 0;var Fit=(zm(),Jh(Um)),Bit=CT(),kit=function(e){(0,Fit.__extends)(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Bit.AbstractMatch);z4.PhoneMatch=kit});var Hq=Xn(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});PS.excludeUnbalancedTrailingBracesAndPunctuation=PS.parseMatches=void 0;var ka=TT(),Vit=Pq(),wo=vS(),mr=F4(),DS=g_e(),Uit=Rq(),Bq=Oq(),zit=Mq(),kq=Lq(),Hit=Nq(),IS=y_e(),Git=Fq();function Wit(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],u=e.length,f=[],d=0;d<u;d++){var p=e.charAt(d);if(f.length===0)b(p);else for(var g=f.length-1;g>=0;g--){var m=f[g];switch(m.state){case 11:D(m,p);break;case 12:O(m,p);break;case 0:T(m,p);break;case 1:C(m,p);break;case 2:A(m,p);break;case 3:E(m,p);break;case 4:v(m,p);break;case 5:R(m,p);break;case 6:M(m,p);break;case 7:N(m,p);break;case 13:_(m,p);break;case 14:S(m,p);break;case 8:w(m,p);break;case 9:I(m,p);break;case 10:L(m,p);break;case 15:B(m,p);break;case 16:U(m,p);break;case 17:V(m,p);break;case 18:G(m,p);break;case 19:k(m,p);break;case 20:W(m,p);break;case 21:j(m,p);break;case 22:J(m,p);break;case 23:q(m,p);break;case 24:K(m,p);break;case 25:Q(m,p);break;case 26:de(m,p);break;case 27:ye(m,p);break;case 28:ce(m,p);break;case 29:_e(m,p);break;case 30:xe(m,p);break;case 31:De(m,p);break;case 32:ke(m,p);break;case 33:ze(m,p);break;case 34:tt(m,p);break;case 35:wt(m,p);break;case 36:_t(m,p);break;case 37:Ae(m,p);break;case 38:Be(m,p);break;case 39:Yt(m,p);break;case 40:Et(m,p);break;case 41:ut(m,p);break;default:(0,wo.assertNever)(m.state)}}}for(var x=f.length-1;x>=0;x--)f.forEach(function(Ce){return tn(Ce)});return c;function b(Ce){if(Ce==="#")f.push(Xit(d,28));else if(Ce==="@")f.push(Kit(d,30));else if(Ce==="/")f.push(Uq(d,11));else if(Ce==="+")f.push(zq(d,37));else if(Ce==="(")f.push(zq(d,32));else{if(ka.digitRe.test(Ce)&&(f.push(zq(d,38)),f.push(qit(d,13))),(0,DS.isEmailLocalPartStartChar)(Ce)){var Te=Ce.toLowerCase()==="m"?15:22;f.push(Yit(d,Te))}(0,mr.isSchemeStartChar)(Ce)&&f.push(Vq(d,0)),ka.alphaNumericAndMarksRe.test(Ce)&&f.push(Uq(d,5))}}function T(Ce,Te){Te===":"?Ce.state=2:Te==="-"?Ce.state=1:(0,mr.isSchemeChar)(Te)||(0,wo.remove)(f,Ce)}function C(Ce,Te){Te==="-"||(Te==="/"?((0,wo.remove)(f,Ce),f.push(Uq(d,11))):(0,mr.isSchemeChar)(Te)?Ce.state=0:(0,wo.remove)(f,Ce))}function A(Ce,Te){Te==="/"?Ce.state=3:Te==="."?(0,wo.remove)(f,Ce):(0,mr.isDomainLabelStartChar)(Te)?(Ce.state=5,(0,mr.isSchemeStartChar)(Te)&&f.push(Vq(d,0))):(0,wo.remove)(f,Ce)}function E(Ce,Te){Te==="/"?Ce.state=4:(0,mr.isPathChar)(Te)?(Ce.state=10,Ce.acceptStateReached=!0):tn(Ce)}function v(Ce,Te){Te==="/"?Ce.state=10:(0,mr.isDomainLabelStartChar)(Te)?(Ce.state=5,Ce.acceptStateReached=!0):(0,wo.remove)(f,Ce)}function D(Ce,Te){Te==="/"?Ce.state=12:(0,wo.remove)(f,Ce)}function O(Ce,Te){(0,mr.isDomainLabelStartChar)(Te)?Ce.state=5:(0,wo.remove)(f,Ce)}function R(Ce,Te){Te==="."?Ce.state=7:Te==="-"?Ce.state=6:Te===":"?Ce.state=8:(0,mr.isUrlSuffixStartChar)(Te)?Ce.state=10:(0,mr.isDomainLabelChar)(Te)||tn(Ce)}function M(Ce,Te){Te==="-"||(Te==="."?tn(Ce):(0,mr.isDomainLabelStartChar)(Te)?Ce.state=5:tn(Ce))}function N(Ce,Te){Te==="."?tn(Ce):(0,mr.isDomainLabelStartChar)(Te)?(Ce.state=5,Ce.acceptStateReached=!0):tn(Ce)}function _(Ce,Te){Te==="."?Ce.state=14:Te===":"?Ce.state=8:ka.digitRe.test(Te)||((0,mr.isUrlSuffixStartChar)(Te)?Ce.state=10:ka.alphaNumericAndMarksRe.test(Te)?(0,wo.remove)(f,Ce):tn(Ce))}function S(Ce,Te){ka.digitRe.test(Te)?(Ce.octetsEncountered++,Ce.octetsEncountered===4&&(Ce.acceptStateReached=!0),Ce.state=13):tn(Ce)}function w(Ce,Te){ka.digitRe.test(Te)?Ce.state=9:tn(Ce)}function I(Ce,Te){ka.digitRe.test(Te)||((0,mr.isUrlSuffixStartChar)(Te)?Ce.state=10:tn(Ce))}function L(Ce,Te){(0,mr.isPathChar)(Te)||tn(Ce)}function B(Ce,Te){Te.toLowerCase()==="a"?Ce.state=16:J(Ce,Te)}function U(Ce,Te){Te.toLowerCase()==="i"?Ce.state=17:J(Ce,Te)}function V(Ce,Te){Te.toLowerCase()==="l"?Ce.state=18:J(Ce,Te)}function G(Ce,Te){Te.toLowerCase()==="t"?Ce.state=19:J(Ce,Te)}function k(Ce,Te){Te.toLowerCase()==="o"?Ce.state=20:J(Ce,Te)}function W(Ce,Te){Te.toLowerCase()===":"?Ce.state=21:J(Ce,Te)}function j(Ce,Te){(0,DS.isEmailLocalPartChar)(Te)?Ce.state=22:(0,wo.remove)(f,Ce)}function J(Ce,Te){Te==="."?Ce.state=23:Te==="@"?Ce.state=24:(0,DS.isEmailLocalPartChar)(Te)?Ce.state=22:(0,wo.remove)(f,Ce)}function q(Ce,Te){Te==="."||Te==="@"?(0,wo.remove)(f,Ce):(0,DS.isEmailLocalPartChar)(Te)?Ce.state=22:(0,wo.remove)(f,Ce)}function K(Ce,Te){(0,mr.isDomainLabelStartChar)(Te)?Ce.state=25:(0,wo.remove)(f,Ce)}function Q(Ce,Te){Te==="."?Ce.state=27:Te==="-"?Ce.state=26:(0,mr.isDomainLabelChar)(Te)||tn(Ce)}function de(Ce,Te){Te==="-"||Te==="."?tn(Ce):(0,mr.isDomainLabelChar)(Te)?Ce.state=25:tn(Ce)}function ye(Ce,Te){Te==="."||Te==="-"?tn(Ce):(0,mr.isDomainLabelStartChar)(Te)?(Ce.state=25,Ce.acceptStateReached=!0):tn(Ce)}function ce(Ce,Te){(0,Bq.isHashtagTextChar)(Te)?(Ce.state=29,Ce.acceptStateReached=!0):(0,wo.remove)(f,Ce)}function _e(Ce,Te){(0,Bq.isHashtagTextChar)(Te)||tn(Ce)}function xe(Ce,Te){(0,kq.isMentionTextChar)(Te)?(Ce.state=31,Ce.acceptStateReached=!0):(0,wo.remove)(f,Ce)}function De(Ce,Te){(0,kq.isMentionTextChar)(Te)||(ka.alphaNumericAndMarksRe.test(Te)?(0,wo.remove)(f,Ce):tn(Ce))}function Ae(Ce,Te){ka.digitRe.test(Te)?Ce.state=38:((0,wo.remove)(f,Ce),b(Te))}function ke(Ce,Te){ka.digitRe.test(Te)?Ce.state=33:(0,wo.remove)(f,Ce),b(Te)}function ze(Ce,Te){ka.digitRe.test(Te)?Ce.state=34:(0,wo.remove)(f,Ce)}function tt(Ce,Te){ka.digitRe.test(Te)?Ce.state=35:(0,wo.remove)(f,Ce)}function wt(Ce,Te){Te===")"?Ce.state=36:(0,wo.remove)(f,Ce)}function _t(Ce,Te){ka.digitRe.test(Te)?Ce.state=38:(0,IS.isPhoneNumberSeparatorChar)(Te)?Ce.state=39:(0,wo.remove)(f,Ce)}function Be(Ce,Te){Ce.acceptStateReached=!0,(0,IS.isPhoneNumberControlChar)(Te)?Ce.state=40:Te==="#"?Ce.state=41:ka.digitRe.test(Te)||(Te==="("?Ce.state=32:(0,IS.isPhoneNumberSeparatorChar)(Te)?Ce.state=39:(tn(Ce),(0,mr.isSchemeStartChar)(Te)&&f.push(Vq(d,0))))}function Yt(Ce,Te){ka.digitRe.test(Te)?Ce.state=38:Te==="("?Ce.state=32:(tn(Ce),b(Te))}function Et(Ce,Te){(0,IS.isPhoneNumberControlChar)(Te)||(Te==="#"?Ce.state=41:ka.digitRe.test(Te)?Ce.state=38:tn(Ce))}function ut(Ce,Te){(0,IS.isPhoneNumberControlChar)(Te)?Ce.state=40:ka.digitRe.test(Te)?(0,wo.remove)(f,Ce):tn(Ce)}function tn(Ce){if((0,wo.remove)(f,Ce),!!Ce.acceptStateReached){var Te=Ce.startIdx,it=e.slice(Ce.startIdx,d);if(it=T_e(it),Ce.type==="url"){var ji=e.charAt(Ce.startIdx-1);if(ji==="@")return;var ft=Ce.matchType;if(ft==="scheme"){var yo=mr.httpSchemeRe.exec(it);if(yo&&(Te=Te+yo.index,it=it.slice(yo.index)),!(0,mr.isValidSchemeUrl)(it))return}else if(ft==="tld"){if(!(0,mr.isValidTldMatch)(it))return}else if(ft==="ipV4"){if(!(0,mr.isValidIpV4Address)(it))return}else(0,wo.assertNever)(ft);c.push(new Vit.UrlMatch({tagBuilder:n,matchedText:it,offset:Te,urlMatchType:ft,url:it,protocolRelativeMatch:it.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(Ce.type==="email")(0,DS.isValidEmail)(it)&&c.push(new Uit.EmailMatch({tagBuilder:n,matchedText:it,offset:Te,email:it.replace(DS.mailtoSchemePrefixRe,"")}));else if(Ce.type==="hashtag")(0,Bq.isValidHashtag)(it)&&c.push(new zit.HashtagMatch({tagBuilder:n,matchedText:it,offset:Te,serviceName:s,hashtag:it.slice(1)}));else if(Ce.type==="mention")(0,kq.isValidMention)(it,a)&&c.push(new Hit.MentionMatch({tagBuilder:n,matchedText:it,offset:Te,serviceName:a,mention:it.slice(1)}));else if(Ce.type==="phone"){if(it=it.replace(/ +$/g,""),(0,IS.isValidPhoneNumber)(it)){var Xo=it.replace(/[^0-9,;#]/g,"");c.push(new Git.PhoneMatch({tagBuilder:n,matchedText:it,offset:Te,number:Xo,plusSign:it.charAt(0)==="+"}))}}else(0,wo.assertNever)(Ce)}}}PS.parseMatches=Wit;var jit=/[\(\{\[]/,x_e=/[\)\}\]]/,b_e={")":"(","}":"{","]":"["};function T_e(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);jit.test(i)?t[i]++:x_e.test(i)&&t[b_e[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),x_e.test(r)){var s=b_e[r];if(t[s]<0)t[s]++,o--;else break}else if(mr.urlSuffixedCharsNotAllowedAtEndRe.test(r))o--;else break;return e.slice(0,o+1)}PS.excludeUnbalancedTrailingBracesAndPunctuation=T_e;function Vq(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function Uq(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function qit(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Yit(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Xit(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Kit(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function zq(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}});var C_e=Xn(H4=>{"use strict";Object.defineProperty(H4,"__esModule",{value:!0});H4.parseHtml=void 0;var Sc=(zm(),Jh(Um)),ul=TT(),Zit=vS();function $it(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Gm,c=0,u=e.length,f=0,d=0,p=a;c<u;){var g=e.charAt(c);switch(f){case 0:m(g);break;case 1:x(g);break;case 2:T(g);break;case 3:b(g);break;case 4:C(g);break;case 5:A(g);break;case 6:E(g);break;case 7:v(g);break;case 8:D(g);break;case 9:O(g);break;case 10:R(g);break;case 11:M(g);break;case 12:N(g);break;case 13:_(g);break;case 14:S(g);break;case 15:w(g);break;case 16:I(g);break;case 17:L(g);break;case 18:B(g);break;case 19:U(g);break;case 20:V(g);break;default:(0,Zit.assertNever)(f)}c++}d<c&&j();function m(K){K==="<"&&k()}function x(K){K==="!"?f=13:K==="/"?(f=2,p=new Gm((0,Sc.__assign)((0,Sc.__assign)({},p),{isClosing:!0}))):K==="<"?k():ul.letterRe.test(K)?(f=3,p=new Gm((0,Sc.__assign)((0,Sc.__assign)({},p),{isOpening:!0}))):(f=0,p=a)}function b(K){ul.whitespaceRe.test(K)?(p=new Gm((0,Sc.__assign)((0,Sc.__assign)({},p),{name:J()})),f=4):K==="<"?k():K==="/"?(p=new Gm((0,Sc.__assign)((0,Sc.__assign)({},p),{name:J()})),f=12):K===">"?(p=new Gm((0,Sc.__assign)((0,Sc.__assign)({},p),{name:J()})),W()):!ul.letterRe.test(K)&&!ul.digitRe.test(K)&&K!==":"&&G()}function T(K){K===">"?G():ul.letterRe.test(K)?f=3:G()}function C(K){ul.whitespaceRe.test(K)||(K==="/"?f=12:K===">"?W():K==="<"?k():K==="="||ul.quoteRe.test(K)||ul.controlCharsRe.test(K)?G():f=5)}function A(K){ul.whitespaceRe.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?W():K==="<"?k():ul.quoteRe.test(K)&&G()}function E(K){ul.whitespaceRe.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?W():K==="<"?k():ul.quoteRe.test(K)?G():f=5)}function v(K){ul.whitespaceRe.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?G():K==="<"?k():f=10)}function D(K){K==='"'&&(f=11)}function O(K){K==="'"&&(f=11)}function R(K){ul.whitespaceRe.test(K)?f=4:K===">"?W():K==="<"&&k()}function M(K){ul.whitespaceRe.test(K)?f=4:K==="/"?f=12:K===">"?W():K==="<"?k():(f=4,q())}function N(K){K===">"?(p=new Gm((0,Sc.__assign)((0,Sc.__assign)({},p),{isClosing:!0})),W()):f=4}function _(K){e.substr(c,2)==="--"?(c+=2,p=new Gm((0,Sc.__assign)((0,Sc.__assign)({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Gm((0,Sc.__assign)((0,Sc.__assign)({},p),{type:"doctype"})),f=20):G()}function S(K){K==="-"?f=15:K===">"?G():f=16}function w(K){K==="-"?f=18:K===">"?G():f=16}function I(K){K==="-"&&(f=17)}function L(K){K==="-"?f=18:f=16}function B(K){K===">"?W():K==="!"?f=19:K==="-"||(f=16)}function U(K){K==="-"?f=17:K===">"?W():f=16}function V(K){K===">"?W():K==="<"&&k()}function G(){f=0,p=a}function k(){f=1,p=new Gm({idx:c})}function W(){var K=e.slice(d,p.idx);K&&o(K,d),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),G(),d=c+1}function j(){var K=e.slice(d,c);o(K,d),d=c+1}function J(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function q(){c--}}H4.parseHtml=$it;var Gm=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}()});var G4=Xn(Gq=>{"use strict";Object.defineProperty(Gq,"__esModule",{value:!0});var Qit=Npe(),Os=vS(),Jit=vq(),eot=w4(),tot=Hq(),not=C_e(),iot=Lq(),oot=Oq(),rot=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=sot(t.urls),this.email=(0,Os.isBoolean)(t.email)?t.email:this.email,this.phone=(0,Os.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,Os.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=aot(t.stripPrefix),this.stripTrailingSlash=(0,Os.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,Os.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&iot.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&oot.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=cot(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return(0,not.parseHtml)(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);r.push.apply(r,g)}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=(0,tot.parseMatches)(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof eot.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Jit.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Qit.version,e}();Gq.default=rot;function sot(e){return e==null&&(e=!0),(0,Os.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,Os.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,Os.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,Os.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function aot(e){return e==null&&(e=!0),(0,Os.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,Os.isBoolean)(e.scheme)?e.scheme:!0,www:(0,Os.isBoolean)(e.www)?e.www:!0}}function cot(e){return typeof e=="number"?{length:e,location:"end"}:(0,Os.defaults)(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}});var E_e=Xn(A_e=>{"use strict";Object.defineProperty(A_e,"__esModule",{value:!0})});var S_e=Xn(ig=>{"use strict";Object.defineProperty(ig,"__esModule",{value:!0});var ST=(zm(),Jh(Um));(0,ST.__exportStar)(E_e(),ig);(0,ST.__exportStar)(Rq(),ig);(0,ST.__exportStar)(Mq(),ig);(0,ST.__exportStar)(CT(),ig);(0,ST.__exportStar)(Nq(),ig);(0,ST.__exportStar)(Fq(),ig);(0,ST.__exportStar)(Pq(),ig)});var v_e=Xn(Wq=>{"use strict";Object.defineProperty(Wq,"__esModule",{value:!0});var lot=(zm(),Jh(Um));(0,lot.__exportStar)(Hq(),Wq)});var jq=Xn((Ih,D_e)=>{"use strict";Ih=D_e.exports=G4().default;Object.defineProperty(Ih,"__esModule",{value:!0});Ih.Autolinker=void 0;var RS=(zm(),Jh(Um)),w_e=(0,RS.__importDefault)(G4());Ih.Autolinker=w_e.default;Ih.default=w_e.default;(0,RS.__exportStar)(G4(),Ih);(0,RS.__exportStar)(vq(),Ih);(0,RS.__exportStar)(w4(),Ih);(0,RS.__exportStar)(S_e(),Ih);(0,RS.__exportStar)(v_e(),Ih)});var jZ=Xn((exports,module)=>{/*! + */(function(e,t){"use strict";typeof DV=="object"&&DV.exports?DV.exports=t(xJ(),TJ(),AJ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(EJ,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(S,w){var I=arguments.length>=1,L=arguments.length>=2;if(!(this instanceof r))return I?L?new r(S,w):new r(S):new r;if(S===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?S=location.href+"":S=""}if(S===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(S),w!==void 0?this.absoluteTo(w):this}function s(S){return/^[0-9]+$/.test(S)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(S){return S.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(S){return S===void 0?"Undefined":String(Object.prototype.toString.call(S)).slice(8,-1)}function d(S){return f(S)==="Array"}function p(S,w){var I={},L,B;if(f(w)==="RegExp")I=null;else if(d(w))for(L=0,B=w.length;L<B;L++)I[w[L]]=!0;else I[w]=!0;for(L=0,B=S.length;L<B;L++){var U=I&&I[S[L]]!==void 0||!I&&w.test(S[L]);U&&(S.splice(L,1),B--,L--)}return S}function g(S,w){var I,L;if(d(w)){for(I=0,L=w.length;I<L;I++)if(!g(S,w[I]))return!1;return!0}var B=f(w);for(I=0,L=S.length;I<L;I++)if(B==="RegExp"){if(typeof S[I]=="string"&&S[I].match(w))return!0}else if(S[I]===w)return!0;return!1}function m(S,w){if(!d(S)||!d(w)||S.length!==w.length)return!1;S.sort(),w.sort();for(var I=0,L=S.length;I<L;I++)if(S[I]!==w[I])return!1;return!0}function x(S){var w=/^\/+|\/+$/g;return S.replace(w,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(S){if(!(!S||!S.nodeName)){var w=S.nodeName.toLowerCase();if(!(w==="input"&&S.type!=="image"))return r.domAttributes[w]}};function b(S){return escape(S)}function T(S){return encodeURIComponent(S).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=T,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=T,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(S,w){var I=r.encode(S+"");return w===void 0&&(w=r.escapeQuerySpace),w?I.replace(/%20/g,"+"):I},r.decodeQuery=function(S,w){S+="",w===void 0&&(w=r.escapeQuerySpace);try{return r.decode(w?S.replace(/\+/g,"%20"):S)}catch{return S}};var C={encode:"encode",decode:"decode"},A,E=function(S,w){return function(I){try{return r[w](I+"").replace(r.characters[S][w].expression,function(L){return r.characters[S][w].map[L]})}catch{return I}}};for(A in C)r[A+"PathSegment"]=E("pathname",C[A]),r[A+"UrnPathSegment"]=E("urnpath",C[A]);var v=function(S,w,I){return function(L){var B;I?B=function(k){return r[w](r[I](k))}:B=r[w];for(var U=(L+"").split(S),V=0,G=U.length;V<G;V++)U[V]=B(U[V]);return U.join(S)}};r.decodePath=v("/","decodePathSegment"),r.decodeUrnPath=v(":","decodeUrnPathSegment"),r.recodePath=v("/","encodePathSegment","decode"),r.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),r.encodeReserved=E("reserved","encode"),r.parse=function(S,w){var I;return w||(w={preventInvalidHostname:r.preventInvalidHostname}),S=S.replace(r.leading_whitespace_expression,""),S=S.replace(r.ascii_tab_whitespace,""),I=S.indexOf("#"),I>-1&&(w.fragment=S.substring(I+1)||null,S=S.substring(0,I)),I=S.indexOf("?"),I>-1&&(w.query=S.substring(I+1)||null,S=S.substring(0,I)),S=S.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),S=S.replace(/^[/\\]{2,}/i,"//"),S.substring(0,2)==="//"?(w.protocol=null,S=S.substring(2),S=r.parseAuthority(S,w)):(I=S.indexOf(":"),I>-1&&(w.protocol=S.substring(0,I)||null,w.protocol&&!w.protocol.match(r.protocol_expression)?w.protocol=void 0:S.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(S=S.substring(I+3),S=r.parseAuthority(S,w)):(S=S.substring(I+1),w.urn=!0))),w.path=S,w},r.parseHost=function(S,w){S||(S=""),S=S.replace(/\\/g,"/");var I=S.indexOf("/"),L,B;if(I===-1&&(I=S.length),S.charAt(0)==="[")L=S.indexOf("]"),w.hostname=S.substring(1,L)||null,w.port=S.substring(L+2,I)||null,w.port==="/"&&(w.port=null);else{var U=S.indexOf(":"),V=S.indexOf("/"),G=S.indexOf(":",U+1);G!==-1&&(V===-1||G<V)?(w.hostname=S.substring(0,I)||null,w.port=null):(B=S.substring(0,I).split(":"),w.hostname=B[0]||null,w.port=B[1]||null)}return w.hostname&&S.substring(I).charAt(0)!=="/"&&(I++,S="/"+S),w.preventInvalidHostname&&r.ensureValidHostname(w.hostname,w.protocol),w.port&&r.ensureValidPort(w.port),S.substring(I)||"/"},r.parseAuthority=function(S,w){return S=r.parseUserinfo(S,w),r.parseHost(S,w)},r.parseUserinfo=function(S,w){var I=S,L=S.indexOf("\\");L!==-1&&(S=S.replace(/\\/g,"/"));var B=S.indexOf("/"),U=S.lastIndexOf("@",B>-1?B:S.length-1),V;return U>-1&&(B===-1||U<B)?(V=S.substring(0,U).split(":"),w.username=V[0]?r.decode(V[0]):null,V.shift(),w.password=V[0]?r.decode(V.join(":")):null,S=I.substring(U+1)):(w.username=null,w.password=null),S},r.parseQuery=function(S,w){if(!S)return{};if(S=S.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!S)return{};for(var I={},L=S.split("&"),B=L.length,U,V,G,k=0;k<B;k++)U=L[k].split("="),V=r.decodeQuery(U.shift(),w),G=U.length?r.decodeQuery(U.join("="),w):null,V!=="__proto__"&&(c.call(I,V)?((typeof I[V]=="string"||I[V]===null)&&(I[V]=[I[V]]),I[V].push(G)):I[V]=G);return I},r.build=function(S){var w="",I=!1;return S.protocol&&(w+=S.protocol+":"),!S.urn&&(w||S.hostname)&&(w+="//",I=!0),w+=r.buildAuthority(S)||"",typeof S.path=="string"&&(S.path.charAt(0)!=="/"&&I&&(w+="/"),w+=S.path),typeof S.query=="string"&&S.query&&(w+="?"+S.query),typeof S.fragment=="string"&&S.fragment&&(w+="#"+S.fragment),w},r.buildHost=function(S){var w="";if(S.hostname)r.ip6_expression.test(S.hostname)?w+="["+S.hostname+"]":w+=S.hostname;else return"";return S.port&&(w+=":"+S.port),w},r.buildAuthority=function(S){return r.buildUserinfo(S)+r.buildHost(S)},r.buildUserinfo=function(S){var w="";return S.username&&(w+=r.encode(S.username)),S.password&&(w+=":"+r.encode(S.password)),w&&(w+="@"),w},r.buildQuery=function(S,w,I){var L="",B,U,V,G;for(U in S)if(U!=="__proto__"&&c.call(S,U))if(d(S[U]))for(B={},V=0,G=S[U].length;V<G;V++)S[U][V]!==void 0&&B[S[U][V]+""]===void 0&&(L+="&"+r.buildQueryParameter(U,S[U][V],I),w!==!0&&(B[S[U][V]+""]=!0));else S[U]!==void 0&&(L+="&"+r.buildQueryParameter(U,S[U],I));return L.substring(1)},r.buildQueryParameter=function(S,w,I){return r.encodeQuery(S,I)+(w!==null?"="+r.encodeQuery(w,I):"")},r.addQuery=function(S,w,I){if(typeof w=="object")for(var L in w)c.call(w,L)&&r.addQuery(S,L,w[L]);else if(typeof w=="string"){if(S[w]===void 0){S[w]=I;return}else typeof S[w]=="string"&&(S[w]=[S[w]]);d(I)||(I=[I]),S[w]=(S[w]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(S,w,I){if(typeof w=="object")for(var L in w)c.call(w,L)&&r.setQuery(S,L,w[L]);else if(typeof w=="string")S[w]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(S,w,I){var L,B,U;if(d(w))for(L=0,B=w.length;L<B;L++)S[w[L]]=void 0;else if(f(w)==="RegExp")for(U in S)w.test(U)&&(S[U]=void 0);else if(typeof w=="object")for(U in w)c.call(w,U)&&r.removeQuery(S,U,w[U]);else if(typeof w=="string")I!==void 0?f(I)==="RegExp"?!d(S[w])&&I.test(S[w])?S[w]=void 0:S[w]=p(S[w],I):S[w]===String(I)&&(!d(I)||I.length===1)?S[w]=void 0:d(S[w])&&(S[w]=p(S[w],I)):S[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(S,w,I,L){switch(f(w)){case"String":break;case"RegExp":for(var B in S)if(c.call(S,B)&&w.test(B)&&(I===void 0||r.hasQuery(S,B,I)))return!0;return!1;case"Object":for(var U in w)if(c.call(w,U)&&!r.hasQuery(S,U,w[U]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return w in S;case"Boolean":var V=!!(d(S[w])?S[w].length:S[w]);return I===V;case"Function":return!!I(S[w],w,S);case"Array":if(!d(S[w]))return!1;var G=L?g:m;return G(S[w],I);case"RegExp":return d(S[w])?L?g(S[w],I):!1:!!(S[w]&&S[w].match(I));case"Number":I=String(I);case"String":return d(S[w])?L?g(S[w],I):!1:S[w]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var S=[],w=[],I=0,L=0;L<arguments.length;L++){var B=new r(arguments[L]);S.push(B);for(var U=B.segment(),V=0;V<U.length;V++)typeof U[V]=="string"&&w.push(U[V]),U[V]&&I++}if(!w.length||!I)return new r("");var G=new r("").segment(w);return(S[0].path()===""||S[0].path().slice(0,1)==="/")&&G.path("/"+G.path()),G.normalize()},r.commonPath=function(S,w){var I=Math.min(S.length,w.length),L;for(L=0;L<I;L++)if(S.charAt(L)!==w.charAt(L)){L--;break}return L<1?S.charAt(0)===w.charAt(0)&&S.charAt(0)==="/"?"/":"":((S.charAt(L)!=="/"||w.charAt(L)!=="/")&&(L=S.substring(0,L).lastIndexOf("/")),S.substring(0,L+1))},r.withinString=function(S,w,I){I||(I={});var L=I.start||r.findUri.start,B=I.end||r.findUri.end,U=I.trim||r.findUri.trim,V=I.parens||r.findUri.parens,G=/[a-z0-9-]=["']?$/i;for(L.lastIndex=0;;){var k=L.exec(S);if(!k)break;var W=k.index;if(I.ignoreHtml){var q=S.slice(Math.max(W-3,0),W);if(q&&G.test(q))continue}for(var J=W+S.slice(W).search(B),j=S.slice(W,J),K=-1;;){var Q=V.exec(j);if(!Q)break;var de=Q.index+Q[0].length;K=Math.max(K,de)}if(K>-1?j=j.slice(0,K)+j.slice(K).replace(U,""):j=j.replace(U,""),!(j.length<=k[0].length)&&!(I.ignore&&I.ignore.test(j))){J=W+j.length;var xe=w(j,W,J,S);if(xe===void 0){L.lastIndex=J;continue}xe=String(xe),S=S.slice(0,W)+xe+S.slice(J),L.lastIndex=W+xe.length}}return L.lastIndex=0,S},r.ensureValidHostname=function(S,w){var I=!!S,L=!!w,B=!1;if(L&&(B=g(r.hostProtocols,w)),B&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(S&&S.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(S).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(S){if(S){var w=Number(S);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+S+'" is not a valid port')}},r.noConflict=function(S){if(S){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=o);return this},a.build=function(S){return S===!0?this._deferred_build=!0:(S===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function D(S){return function(w,I){return w===void 0?this._parts[S]||"":(this._parts[S]=w||null,this.build(!I),this)}}function O(S,w){return function(I,L){return I===void 0?this._parts[S]||"":(I!==null&&(I=I+"",I.charAt(0)===w&&(I=I.substring(1))),this._parts[S]=I,this.build(!L),this)}}a.protocol=D("protocol"),a.username=D("username"),a.password=D("password"),a.hostname=D("hostname"),a.port=D("port"),a.query=O("query","?"),a.fragment=O("fragment","#"),a.search=function(S,w){var I=this.query(S,w);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(S,w){var I=this.fragment(S,w);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(S,w){if(S===void 0||S===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return S?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=S?r.recodeUrnPath(S):"":this._parts.path=S?r.recodePath(S):"/",this.build(!w),this},a.path=a.pathname,a.href=function(S,w){var I;if(S===void 0)return this.toString();this._string="",this._parts=r._parts();var L=S instanceof r,B=typeof S=="object"&&(S.hostname||S.path||S.pathname);if(S.nodeName){var U=r.getDomAttribute(S);S=S[U]||"",B=!1}if(!L&&B&&S.pathname!==void 0&&(S=S.toString()),typeof S=="string"||S instanceof String)this._parts=r.parse(String(S),this._parts);else if(L||B){var V=L?S._parts:S;for(I in V)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(S){var w=!1,I=!1,L=!1,B=!1,U=!1,V=!1,G=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,I=r.ip4_expression.test(this._parts.hostname),L=r.ip6_expression.test(this._parts.hostname),w=I||L,B=!w,U=B&&n&&n.has(this._parts.hostname),V=B&&r.idn_expression.test(this._parts.hostname),G=B&&r.punycode_expression.test(this._parts.hostname)),S.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return B;case"sld":return U;case"ip":return w;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return L;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var R=a.protocol,M=a.port,N=a.hostname;a.protocol=function(S,w){if(S&&(S=S.replace(/:(\/\/)?$/,""),!S.match(r.protocol_expression)))throw new TypeError('Protocol "'+S+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,S,w)},a.scheme=a.protocol,a.port=function(S,w){return this._parts.urn?S===void 0?"":this:(S!==void 0&&(S===0&&(S=null),S&&(S+="",S.charAt(0)===":"&&(S=S.substring(1)),r.ensureValidPort(S))),M.call(this,S,w))},a.hostname=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},L=r.parseHost(S,I);if(L!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');S=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(S,this._parts.protocol)}return N.call(this,S,w)},a.origin=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){var I=this.protocol(),L=this.authority();return L?(I?I+"://":"")+this.authority():""}else{var B=r(S);return this.protocol(B.protocol()).authority(B.authority()).build(!w),this}},a.host=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(S,this._parts);if(I!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(S,this._parts);if(I!=="/")throw new TypeError('Hostname "'+S+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return S[S.length-1]!=="@"&&(S+="@"),r.parseUserinfo(S,this._parts),this.build(!w),this},a.resource=function(S,w){var I;return S===void 0?this.path()+this.search()+this.hash():(I=r.parse(S),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!w),this)},a.subdomain=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var L=this._parts.hostname.length-this.domain().length,B=this._parts.hostname.substring(0,L),U=new RegExp("^"+u(B));if(S&&S.charAt(S.length-1)!=="."&&(S+="."),S.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return S&&r.ensureValidHostname(S,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(U,S),this.build(!w),this}},a.domain=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(typeof S=="boolean"&&(w=S,S=void 0),S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var L=this._parts.hostname.length-this.tld(w).length-1;return L=this._parts.hostname.lastIndexOf(".",L-1)+1,this._parts.hostname.substring(L)||""}else{if(!S)throw new TypeError("cannot set domain empty");if(S.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(S,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=S;else{var B=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(B,S)}return this.build(!w),this}},a.tld=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(typeof S=="boolean"&&(w=S,S=void 0),S===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),L=this._parts.hostname.substring(I+1);return w!==!0&&n&&n.list[L.toLowerCase()]&&n.get(this._parts.hostname)||L}else{var B;if(S)if(S.match(/[^a-zA-Z0-9-]/))if(n&&n.is(S))B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,S);else throw new TypeError('TLD "'+S+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,S)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0||S===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,L=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return S?r.decodePath(L):L}else{var B=this._parts.path.length-this.filename().length,U=this._parts.path.substring(0,B),V=new RegExp("^"+u(U));return this.is("relative")||(S||(S="/"),S.charAt(0)!=="/"&&(S="/"+S)),S&&S.charAt(S.length-1)!=="/"&&(S+="/"),S=r.recodePath(S),this._parts.path=this._parts.path.replace(V,S),this.build(!w),this}},a.filename=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(typeof S!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),L=this._parts.path.substring(I+1);return S?r.decodePathSegment(L):L}else{var B=!1;S.charAt(0)==="/"&&(S=S.substring(1)),S.match(/\.?\//)&&(B=!0);var U=new RegExp(u(this.filename())+"$");return S=r.recodePath(S),this._parts.path=this._parts.path.replace(U,S),B?this.normalizePath(w):this.build(!w),this}},a.suffix=function(S,w){if(this._parts.urn)return S===void 0?"":this;if(S===void 0||S===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),L=I.lastIndexOf("."),B,U;return L===-1?"":(B=I.substring(L+1),U=/^[a-z0-9%]+$/i.test(B)?B:"",S?r.decodePathSegment(U):U)}else{S.charAt(0)==="."&&(S=S.substring(1));var V=this.suffix(),G;if(V)S?G=new RegExp(u(V)+"$"):G=new RegExp(u("."+V)+"$");else{if(!S)return this;this._parts.path+="."+r.recodePath(S)}return G&&(S=r.recodePath(S),this._parts.path=this._parts.path.replace(G,S)),this.build(!w),this}},a.segment=function(S,w,I){var L=this._parts.urn?":":"/",B=this.path(),U=B.substring(0,1)==="/",V=B.split(L);if(S!==void 0&&typeof S!="number"&&(I=w,w=S,S=void 0),S!==void 0&&typeof S!="number")throw new Error('Bad segment "'+S+'", must be 0-based integer');if(U&&V.shift(),S<0&&(S=Math.max(V.length+S,0)),w===void 0)return S===void 0?V:V[S];if(S===null||V[S]===void 0)if(d(w)){V=[];for(var G=0,k=w.length;G<k;G++)!w[G].length&&(!V.length||!V[V.length-1].length)||(V.length&&!V[V.length-1].length&&V.pop(),V.push(x(w[G])))}else(w||typeof w=="string")&&(w=x(w),V[V.length-1]===""?V[V.length-1]=w:V.push(w));else w?V[S]=x(w):V.splice(S,1);return U&&V.unshift(""),this.path(V.join(L),I)},a.segmentCoded=function(S,w,I){var L,B,U;if(typeof S!="number"&&(I=w,w=S,S=void 0),w===void 0){if(L=this.segment(S,w,I),!d(L))L=L!==void 0?r.decode(L):void 0;else for(B=0,U=L.length;B<U;B++)L[B]=r.decode(L[B]);return L}if(!d(w))w=typeof w=="string"||w instanceof String?r.encode(w):w;else for(B=0,U=w.length;B<U;B++)w[B]=r.encode(w[B]);return this.segment(S,w,I)};var _=a.query;return a.query=function(S,w){if(S===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof S=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),L=S.call(this,I);return this._parts.query=r.buildQuery(L||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return S!==void 0&&typeof S!="string"?(this._parts.query=r.buildQuery(S,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):_.call(this,S,w)},a.setQuery=function(S,w,I){var L=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof S=="string"||S instanceof String)L[S]=w!==void 0?w:null;else if(typeof S=="object")for(var B in S)c.call(S,B)&&(L[B]=S[B]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(L,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(I=w),this.build(!I),this},a.addQuery=function(S,w,I){var L=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(L,S,w===void 0?null:w),this._parts.query=r.buildQuery(L,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(I=w),this.build(!I),this},a.removeQuery=function(S,w,I){var L=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(L,S,w),this._parts.query=r.buildQuery(L,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof S!="string"&&(I=w),this.build(!I),this},a.hasQuery=function(S,w,I){var L=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(L,S,w,I)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(S){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!S)),this},a.normalizeHostname=function(S){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!S)),this},a.normalizePort=function(S){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!S)),this},a.normalizePath=function(S){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!S),this;if(this._parts.path==="/")return this;w=r.recodePath(w);var I,L="",B,U;for(w.charAt(0)!=="/"&&(I=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(L=w.substring(1).match(/^(\.\.\/)+/)||"",L&&(L=L[0]));B=w.search(/\/\.\.(\/|$)/),B!==-1;){if(B===0){w=w.substring(3);continue}U=w.substring(0,B).lastIndexOf("/"),U===-1&&(U=B),w=w.substring(0,U)+w.substring(B+3)}return I&&this.is("relative")&&(w=L+w.substring(1)),this._parts.path=w,this.build(!S),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(S){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!S)),this},a.normalizeFragment=function(S){return this._parts.fragment||(this._parts.fragment=null,this.build(!S)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var S=r.encode,w=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=S,r.decode=w}return this},a.unicode=function(){var S=r.encode,w=r.decode;r.encode=T,r.decode=unescape;try{this.normalize()}finally{r.encode=S,r.decode=w}return this},a.readable=function(){var S=this.clone();S.username("").password("").normalize();var w="";if(S._parts.protocol&&(w+=S._parts.protocol+"://"),S._parts.hostname&&(S.is("punycode")&&e?(w+=e.toUnicode(S._parts.hostname),S._parts.port&&(w+=":"+S._parts.port)):w+=S.host()),S._parts.hostname&&S._parts.path&&S._parts.path.charAt(0)!=="/"&&(w+="/"),w+=S.path(!0),S._parts.query){for(var I="",L=0,B=S._parts.query.split("&"),U=B.length;L<U;L++){var V=(B[L]||"").split("=");I+="&"+r.decodeQuery(V[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),V[1]!==void 0&&(I+="="+r.decodeQuery(V[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+I.substring(1)}return w+=r.decodeQuery(S.hash(),!0),w},a.absoluteTo=function(S){var w=this.clone(),I=["protocol","username","password","hostname","port"],L,B,U;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(S instanceof r||(S=new r(S)),w._parts.protocol||(w._parts.protocol=S._parts.protocol,this._parts.hostname))return w;for(B=0;U=I[B];B++)w._parts[U]=S._parts[U];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(L=S.directory(),L=L||(S.path().indexOf("/")===0?"/":""),w._parts.path=(L?L+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=S._parts.path,w._parts.query||(w._parts.query=S._parts.query)),w.build(),w},a.relativeTo=function(S){var w=this.clone().normalize(),I,L,B,U,V;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(S=new r(S).normalize(),I=w._parts,L=S._parts,U=w.path(),V=S.path(),U.charAt(0)!=="/")throw new Error("URI is already relative");if(V.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===L.protocol&&(I.protocol=null),I.username!==L.username||I.password!==L.password||I.protocol!==null||I.username!==null||I.password!==null)return w.build();if(I.hostname===L.hostname&&I.port===L.port)I.hostname=null,I.port=null;else return w.build();if(U===V)return I.path="",w.build();if(B=r.commonPath(U,V),!B)return w.build();var G=L.path.substring(B.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=G+I.path.substring(B.length)||"./",w.build()},a.equals=function(S){var w=this.clone(),I=new r(S),L={},B={},U={},V,G,k;if(w.normalize(),I.normalize(),w.toString()===I.toString())return!0;if(V=w.query(),G=I.query(),w.query(""),I.query(""),w.toString()!==I.toString()||V.length!==G.length)return!1;L=r.parseQuery(V,this._parts.escapeQuerySpace),B=r.parseQuery(G,this._parts.escapeQuerySpace);for(k in L)if(c.call(L,k)){if(d(L[k])){if(!m(L[k],B[k]))return!1}else if(L[k]!==B[k])return!1;U[k]=!0}for(k in B)if(c.call(B,k)&&!U[k])return!1;return!0},a.preventInvalidHostname=function(S){return this._parts.preventInvalidHostname=!!S,this},a.duplicateQueryParameters=function(S){return this._parts.duplicateQueryParameters=!!S,this},a.escapeQuerySpace=function(S){return this._parts.escapeQuerySpace=!!S,this},r})});var bre=Xn((q1,tW)=>{var NU=function(){"use strict";var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G:Qdkr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;A9pLdbk;QqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbba:vbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var m=new Uint8Array(g.length),x=0;x<g.length;++x){var b=g.charCodeAt(x);m[x]=b>96?b-97:b>64?b-39:b+4}for(var T=0,x=0;x<g.length;++x)m[T++]=m[x]<60?t[m[x]]:(m[x]-60)*64+m[++x];return m.buffer.slice(0,T)}function r(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,m,x,b){var T=n.exports.sbrk,C=T(m.length*4),A=T(x*4),E=new Uint8Array(n.exports.memory.buffer),v=s(m);E.set(v,C),b&&b(C,C,m.length,x);var D=g(A,C,m.length,x);E=new Uint8Array(n.exports.memory.buffer);var O=new Uint32Array(x);new Uint8Array(O.buffer).set(E.subarray(A,A+x*4)),v.set(E.subarray(C,C+m.length*4)),T(C-T(0));for(var R=0;R<m.length;++R)m[R]=O[m[R]];return[O,D]}function c(g,m,x,b){var T=n.exports.sbrk,C=T(x*4),A=T(x*b),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),A),g(C,A,x,b),E=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(x);return new Uint8Array(v.buffer).set(E.subarray(C,C+x*4)),T(C-T(0)),v}function u(g,m,x,b,T){var C=n.exports.sbrk,A=C(m),E=C(b*T),v=new Uint8Array(n.exports.memory.buffer);v.set(s(x),E);var D=g(A,m,E,b,T),O=new Uint8Array(D);return O.set(v.subarray(A,A+D)),C(A-C(0)),O}function f(g){for(var m=0,x=0;x<g.length;++x){var b=g[x];m=m<b?b:m}return m}function d(g,m){if(r(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var x=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(x)}function p(g,m,x,b,T,C,A){var E=n.exports.sbrk,v=E(x*b),D=E(x*C),O=new Uint8Array(n.exports.memory.buffer);O.set(s(m),D),g(v,x,b,T,D,A);var R=new Uint8Array(x*b);return R.set(O.subarray(v,v+x*b)),E(v-E(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,x){var b=m?x?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,b)},reorderPoints:function(g,m){return r(g instanceof Float32Array),r(g.length%m==0),r(m>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,x){r(x>0&&x<=256),r(x%4==0);var b=n.exports.meshopt_encodeVertexBufferBound(m,x);return u(n.exports.meshopt_encodeVertexBuffer,b,g,m,x)},encodeIndexBuffer:function(g,m,x){r(x==2||x==4),r(m%3==0);var b=d(g,x),T=n.exports.meshopt_encodeIndexBufferBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexBuffer,T,b,m,4)},encodeIndexSequence:function(g,m,x){r(x==2||x==4);var b=d(g,x),T=n.exports.meshopt_encodeIndexSequenceBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexSequence,T,b,m,4)},encodeGltfBuffer:function(g,m,x,b){var T={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(T[b]),T[b](g,m,x)},encodeFilterOct:function(g,m,x,b){return r(x==4||x==8),r(b>=1&&b<=16),p(n.exports.meshopt_encodeFilterOct,g,m,x,b,16)},encodeFilterQuat:function(g,m,x,b){return r(x==8),r(b>=4&&b<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,x,b,16)},encodeFilterExp:function(g,m,x,b,T){r(x>0&&x%4==0),r(b>=1&&b<=24);var C={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,m,x,b,x,T?C[T]:1)}}}();typeof q1=="object"&&typeof tW=="object"?tW.exports=NU:typeof define=="function"&&define.amd?define([],function(){return NU}):typeof q1=="object"?q1.MeshoptEncoder=NU:(typeof self<"u"?self:q1).MeshoptEncoder=NU});var Tre=Xn((Y1,nW)=>{var FU=function(){"use strict";var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQcl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4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(T){r=T.instance,r.exports.__wasm_call_ctors()});function a(T){for(var C=new Uint8Array(T.length),A=0;A<T.length;++A){var E=T.charCodeAt(A);C[A]=E>96?E-97:E>64?E-39:E+4}for(var v=0,A=0;A<T.length;++A)C[v++]=C[A]<60?i[C[A]]:(C[A]-60)*64+C[++A];return C.buffer.slice(0,v)}function c(T,C,A,E,v,D,O){var R=T.exports.sbrk,M=E+3&-4,N=R(M*v),_=R(D.length),S=new Uint8Array(T.exports.memory.buffer);S.set(D,_);var w=C(N,E,v,_,D.length);if(w==0&&O&&O(N,M,v),A.set(S.subarray(N,N+E*v)),R(N-R(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(T){var C={object:new Worker(T),pending:0,requests:{}};return C.object.onmessage=function(A){var E=A.data;C.pending-=E.count,C.requests[E.id][E.action](E.value),delete C.requests[E.id]},C}function m(T){for(var C="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+b.name+";"+c.toString()+b.toString(),A=new Blob([C],{type:"text/javascript"}),E=URL.createObjectURL(A),v=d.length;v<T;++v)d[v]=g(E);for(var v=T;v<d.length;++v)d[v].object.postMessage({});d.length=T,URL.revokeObjectURL(E)}function x(T,C,A,E,v){for(var D=d[0],O=1;O<d.length;++O)d[O].pending<D.pending&&(D=d[O]);return new Promise(function(R,M){var N=new Uint8Array(A),_=++p;D.pending+=T,D.requests[_]={resolve:R,reject:M},D.object.postMessage({id:_,count:T,size:C,source:N,mode:E,filter:v},[N.buffer])})}function b(T){var C=T.data;if(!C.id)return self.close();self.ready.then(function(A){try{var E=new Uint8Array(C.count*C.size);c(A,A.exports[C.mode],E,C.count,C.size,C.source,A.exports[C.filter]),self.postMessage({id:C.id,count:C.count,action:"resolve",value:E},[E.buffer])}catch(v){self.postMessage({id:C.id,count:C.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(T){m(T)},decodeVertexBuffer:function(T,C,A,E,v){c(r,r.exports.meshopt_decodeVertexBuffer,T,C,A,E,r.exports[u[v]])},decodeIndexBuffer:function(T,C,A,E){c(r,r.exports.meshopt_decodeIndexBuffer,T,C,A,E)},decodeIndexSequence:function(T,C,A,E){c(r,r.exports.meshopt_decodeIndexSequence,T,C,A,E)},decodeGltfBuffer:function(T,C,A,E,v,D){c(r,r.exports[f[v]],T,C,A,E,r.exports[u[D]])},decodeGltfBufferAsync:function(T,C,A,E,v){return d.length>0?x(T,C,A,f[E],u[v]):s.then(function(){var D=new Uint8Array(T*C);return c(r,r.exports[f[E]],D,T,C,A,r.exports[u[v]]),D})}}}();typeof Y1=="object"&&typeof nW=="object"?nW.exports=FU:typeof define=="function"&&define.amd?define([],function(){return FU}):typeof Y1=="object"?Y1.MeshoptDecoder=FU:(typeof self<"u"?self:Y1).MeshoptDecoder=FU});var Cre=Xn((X1,iW)=>{var BU=function(){"use strict";var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd;S1jjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgYcx2fgeIdbaaaHydbgKcx2fgOIdbg8P:tgIaaaHcwfydbgLcx2fgCIdlaOIdlg8R:tg8SNaCIdba8P:tgRaeIdla8R:tg8UN:tg8Va8VNa8UaCIdwaOIdwg8W:tg8XNa8SaeIdwa8W:tg8UN:tg8Sa8SNa8UaRNa8XaIN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaKcdtfydbc8S2fgea8SaR:rgRa8SNNg8UaeIdb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JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkarawcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nm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bbb9BEaeIdwaaa8Fcx2fgHIdwg8SNaeIdzaHIdbgINaeIdaMg8Va8VMMa8SNaeIdlaHIdlg8VNaeIdCa8SNaeId3Mg8Sa8SMMa8VNaeIdbaINaeIdxa8VNaeIdKMg8Sa8SMMaINaeId8KMMM:lNg8SaBaBa8S9DEhBkaKa9ifhKaicefgial9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var x=new Uint8Array(m.length),b=0;b<m.length;++b){var T=m.charCodeAt(b);x[b]=T>96?T-97:T>64?T-39:T+4}for(var C=0,b=0;b<m.length;++b)x[C++]=x[b]<60?t[x[b]]:(x[b]-60)*64+x[++b];return x.buffer.slice(0,C)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}function a(m,x,b){var T=n.exports.sbrk,C=T(x.length*4),A=T(b*4),E=new Uint8Array(n.exports.memory.buffer),v=s(x);E.set(v,C);var D=m(A,C,x.length,b);E=new Uint8Array(n.exports.memory.buffer);var O=new Uint32Array(b);new Uint8Array(O.buffer).set(E.subarray(A,A+b*4)),v.set(E.subarray(C,C+x.length*4)),T(C-T(0));for(var R=0;R<x.length;++R)x[R]=O[x[R]];return[O,D]}function c(m){for(var x=0,b=0;b<m.length;++b){var T=m[b];x=x<T?T:x}return x}function u(m,x,b,T,C,A,E,v,D){var O=n.exports.sbrk,R=O(4),M=O(b*4),N=O(C*A),_=O(b*4),S=new Uint8Array(n.exports.memory.buffer);S.set(s(T),N),S.set(s(x),_);var w=m(M,_,b,N,C,A,E,v,D,R);S=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(w);s(I).set(S.subarray(M,M+w*4));var L=new Float32Array(1);return s(L).set(S.subarray(R,R+4)),O(R-O(0)),[I,L[0]]}function f(m,x,b,T,C,A,E,v,D,O,R,M,N){var _=n.exports.sbrk,S=_(4),w=_(b*4),I=_(C*A),L=_(C*v),B=_(D.length*4),U=_(b*4),V=O?_(C):0,G=new Uint8Array(n.exports.memory.buffer);G.set(s(T),I),G.set(s(E),L),G.set(s(D),B),G.set(s(x),U),O&&G.set(s(O),V);var k=m(w,U,b,I,C,A,L,v,B,D.length,V,R,M,N,S);G=new Uint8Array(n.exports.memory.buffer);var W=new Uint32Array(k);s(W).set(G.subarray(w,w+k*4));var q=new Float32Array(1);return s(q).set(G.subarray(S,S+4)),_(S-_(0)),[W,q[0]]}function d(m,x,b,T){var C=n.exports.sbrk,A=C(b*T),E=new Uint8Array(n.exports.memory.buffer);E.set(s(x),A);var v=m(A,b,T);return C(A-C(0)),v}function p(m,x,b,T,C,A,E,v){var D=n.exports.sbrk,O=D(v*4),R=D(b*T),M=D(b*A),N=new Uint8Array(n.exports.memory.buffer);N.set(s(x),R),C&&N.set(s(C),M);var _=m(O,R,b,T,M,A,E,v);N=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(_);return s(S).set(N.subarray(O,O+_*4)),D(O-D(0)),S}var g={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(m){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0);var x=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return a(n.exports.meshopt_optimizeVertexFetchRemap,x,c(m)+1)},simplify:function(m,x,b,T,C,A){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T>=0&&T<=m.length),r(T%3==0),r(C>=0);for(var E=0,v=0;v<(A?A.length:0);++v)r(A[v]in g),r(this.useExperimentalFeatures||A[v]!="Prune"),E|=g[A[v]];var D=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),O=u(n.exports.meshopt_simplify,D,m.length,x,x.length/b,b*4,T,C,E);return O[0]=m instanceof Uint32Array?O[0]:new m.constructor(O[0]),O},simplifyWithAttributes:function(m,x,b,T,C,A,E,v,D,O){r(this.useExperimentalFeatures),r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T instanceof Float32Array),r(T.length%C==0),r(C>=0),r(E==null||E instanceof Uint8Array),r(E==null||E.length==x.length/b),r(v>=0&&v<=m.length),r(v%3==0),r(D>=0),r(Array.isArray(A)),r(C>=A.length),r(A.length<=32);for(var R=0;R<A.length;++R)r(A[R]>=0);for(var M=0,R=0;R<(O?O.length:0);++R)r(O[R]in g),M|=g[O[R]];var N=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),_=f(n.exports.meshopt_simplifyWithAttributes,N,m.length,x,x.length/b,b*4,T,C*4,new Float32Array(A),E?new Uint8Array(E):null,v,D,M);return _[0]=m instanceof Uint32Array?_[0]:new m.constructor(_[0]),_},getScale:function(m,x){return r(m instanceof Float32Array),r(m.length%x==0),r(x>=3),d(n.exports.meshopt_simplifyScale,m,m.length/x,x*4)},simplifyPoints:function(m,x,b,T,C,A){return r(this.useExperimentalFeatures),r(m instanceof Float32Array),r(m.length%x==0),r(x>=3),r(b>=0&&b<=m.length/x),T?(r(T instanceof Float32Array),r(T.length%C==0),r(C>=3),r(m.length/x==T.length/C),p(n.exports.meshopt_simplifyPoints,m,m.length/x,x*4,T,C*4,A,b)):p(n.exports.meshopt_simplifyPoints,m,m.length/x,x*4,void 0,0,0,b)}}}();typeof X1=="object"&&typeof iW=="object"?iW.exports=BU:typeof define=="function"&&define.amd?define([],function(){return BU}):typeof X1=="object"?X1.MeshoptSimplifier=BU:(typeof self<"u"?self:X1).MeshoptSimplifier=BU});var Are=Xn((K1,oW)=>{var kU=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQc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gcbhlinJbbbbh3dnaPTmbJbbjZaP:Z:vh3kaka8Ea3NgaUdaaka5a3NghUd3akaEa3Ng8JUdKJbbbbh3dnagagNaYaYNa8Fa8FNMMg8KJbbbb9BmbJbbjZa8K:r:vh3kakaga3NUd8Saka8Fa3NUdyakaYa3NUd8Kdndndnakyd8WgQakydUgAakcKfaeaiakc;abfaKamara8Maqz:ejjjbgCcuSmbdnaPaD9pmbaAaraiaCcx2fgXydbfRbbcFeSfaraXclfydbfRbbcFeSfaraXcwfydbfRbbcFeSfaw9nmdkaQaAcbaeaiakc;abfaKamara8MJbbbbz:ejjjbgCcu9hmekakaaUdCakahUdzaka8JUdxakcuBdwakcFFF;7rBdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var x=new Uint8Array(m.length),b=0;b<m.length;++b){var T=m.charCodeAt(b);x[b]=T>96?T-97:T>64?T-39:T+4}for(var C=0,b=0;b<m.length;++b)x[C++]=x[b]<60?t[x[b]]:(x[b]-60)*64+x[++b];return x.buffer.slice(0,C)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}var a=48,c=16;function u(m,x){var b=m.meshlets[x*4+0],T=m.meshlets[x*4+1],C=m.meshlets[x*4+2],A=m.meshlets[x*4+3];return{vertices:m.vertices.subarray(b,b+C),triangles:m.triangles.subarray(T,T+A*3)}}function f(m,x,b,T,C,A,E){var v=n.exports.sbrk,D=n.exports.meshopt_buildMeshletsBound(m.length,C,A),O=v(D*c),R=v(D*C*4),M=v(D*A*3),N=v(m.byteLength),_=v(x.byteLength),S=new Uint8Array(n.exports.memory.buffer);S.set(s(m),N),S.set(s(x),_);var w=n.exports.meshopt_buildMeshlets(O,R,M,N,m.length,_,b,T,C,A,E);S=new Uint8Array(n.exports.memory.buffer);for(var I=S.subarray(O,O+w*c),L=new Uint32Array(I.buffer,I.byteOffset,I.byteLength/4).slice(),B=0;B<w;++B){var U=L[B*4+0],V=L[B*4+1],b=L[B*4+2],G=L[B*4+3];n.exports.meshopt_optimizeMeshlet(R+U*4,M+V,G,b)}var k=L[(w-1)*4+0],W=L[(w-1)*4+1],q=L[(w-1)*4+2],J=L[(w-1)*4+3],j=k+q,K=W+(J*3+3&-4),Q={meshlets:L,vertices:new Uint32Array(S.buffer,R,j).slice(),triangles:new Uint8Array(S.buffer,M,K*3).slice(),meshletCount:w};return v(O-v(0)),Q}function d(m){var x=new Float32Array(n.exports.memory.buffer,m,a/4);return{centerX:x[0],centerY:x[1],centerZ:x[2],radius:x[3],coneApexX:x[4],coneApexY:x[5],coneApexZ:x[6],coneAxisX:x[7],coneAxisY:x[8],coneAxisZ:x[9],coneCutoff:x[10]}}function p(m,x,b,T){var C=n.exports.sbrk,A=[],E=C(x.byteLength),v=C(m.vertices.byteLength),D=C(m.triangles.byteLength),O=C(a),R=new Uint8Array(n.exports.memory.buffer);R.set(s(x),E),R.set(s(m.vertices),v),R.set(s(m.triangles),D);for(var M=0;M<m.meshletCount;++M){var N=m.meshlets[M*4+0],_=m.meshlets[M*4+0+1],S=m.meshlets[M*4+0+3];n.exports.meshopt_computeMeshletBounds(O,v+N*4,D+_,S,E,b,T),A.push(d(O))}return C(E-C(0)),A}function g(m,x,b,T){var C=n.exports.sbrk,A=C(a),E=C(m.byteLength),v=C(x.byteLength),D=new Uint8Array(n.exports.memory.buffer);D.set(s(m),E),D.set(s(x),v),n.exports.meshopt_computeClusterBounds(A,E,m.length,v,b,T);var O=d(A);return C(A-C(0)),O}return{ready:i,supported:!0,buildMeshlets:function(m,x,b,T,C,A){r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T<=255||T>0),r(C<=512),r(C%4==0),A=A||0;var E=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return f(E,x,x.length/b,b*4,T,C,A)},computeClusterBounds:function(m,x,b){r(m.length%3==0),r(m.length/3<=512),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3);var T=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return g(T,x,x.length/b,b*4)},computeMeshletBounds:function(m,x,b){return r(m.meshletCount!=0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),p(m,x,x.length/b,b*4)},extractMeshlet:function(m,x){return r(x>=0&&x<m.meshletCount),u(m,x)}}}();typeof K1=="object"&&typeof oW=="object"?oW.exports=kU:typeof define=="function"&&define.amd?define([],function(){return kU}):typeof K1=="object"?K1.MeshoptClusterizer=kU:(typeof self<"u"?self:K1).MeshoptClusterizer=kU});var Sre=Xn((wtn,Ere)=>{var P3e=bre(),R3e=Tre(),O3e=Cre(),M3e=Are();Ere.exports={MeshoptEncoder:P3e,MeshoptDecoder:R3e,MeshoptSimplifier:O3e,MeshoptClusterizer:M3e}});var kle=Xn((Ywn,Ble)=>{"use strict";Ble.exports=zje;var qM=1e20;function zje(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,u,f,d,p,g,m,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),r=p.width,s=p.height,g=d.getImageData(0,0,r,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,r=p.width,s=p.height,g=d.getImageData(0,0,r,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),m=0,x=Math.floor(u.length/f);m<x;m++)c[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*s),T=Array(r*s),C=Array(a),A=Array(a),E=Array(a+1),v=Array(a);for(m=0,x=r*s;m<x;m++){var D=c[m];b[m]=D===1?0:D===0?qM:Math.pow(Math.max(0,.5-D),2),T[m]=D===1?qM:D===0?0:Math.pow(Math.max(0,D-.5),2)}Nle(b,r,s,C,A,v,E),Nle(T,r,s,C,A,v,E);var O=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(m=0,x=r*s;m<x;m++)O[m]=Math.min(Math.max(1-((b[m]-T[m])/i+n),0),1);return O}function Nle(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(Fle(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(Fle(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function Fle(e,t,n,i,o){n[0]=0,i[0]=-qM,i[1]=+qM;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+qM}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var Gle=Xn((uDn,Az)=>{function Qje(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,x=15,b=16,T=17,C=0,A=1,E=2,v=3,D=4;function O(_,S){return 55296<=_.charCodeAt(S)&&_.charCodeAt(S)<=56319&&56320<=_.charCodeAt(S+1)&&_.charCodeAt(S+1)<=57343}function R(_,S){S===void 0&&(S=0);var w=_.charCodeAt(S);if(55296<=w&&w<=56319&&S<_.length-1){var I=w,L=_.charCodeAt(S+1);return 56320<=L&&L<=57343?(I-55296)*1024+(L-56320)+65536:I}if(56320<=w&&w<=57343&&S>=1){var I=_.charCodeAt(S-1),L=w;return 55296<=I&&I<=56319?(I-55296)*1024+(L-56320)+65536:L}return w}function M(_,S,w){var I=[_].concat(S).concat([w]),L=I[I.length-2],B=w,U=I.lastIndexOf(m);if(U>1&&I.slice(1,U).every(function(k){return k==i})&&[i,g,T].indexOf(_)==-1)return E;var V=I.lastIndexOf(o);if(V>0&&I.slice(1,V).every(function(k){return k==o})&&[p,o].indexOf(L)==-1)return I.filter(function(k){return k==o}).length%2==1?v:D;if(L==e&&B==t)return C;if(L==n||L==e||L==t)return B==m&&S.every(function(k){return k==i})?E:A;if(B==n||B==e||B==t)return A;if(L==s&&(B==s||B==a||B==u||B==f))return C;if((L==u||L==a)&&(B==a||B==c))return C;if((L==f||L==c)&&B==c)return C;if(B==i||B==x)return C;if(B==r)return C;if(L==p)return C;var G=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,T].indexOf(I[G])!=-1&&I.slice(G+1,-1).every(function(k){return k==i})&&B==m||L==x&&[b,T].indexOf(B)!=-1?C:S.indexOf(o)!=-1?E:L==o&&B==o?C:A}this.nextBreak=function(_,S){if(S===void 0&&(S=0),S<0)return 0;if(S>=_.length-1)return _.length;for(var w=N(R(_,S)),I=[],L=S+1;L<_.length;L++)if(!O(_,L-1)){var B=N(R(_,L));if(M(w,I,B))return L;I.push(B)}return _.length},this.splitGraphemes=function(_){for(var S=[],w=0,I;(I=this.nextBreak(_,w))<_.length;)S.push(_.slice(w,I)),w=I;return w<_.length&&S.push(_.slice(w)),S},this.iterateGraphemes=function(_){var S=0,w={next:function(){var I,L;return(L=this.nextBreak(_,S))<_.length?(I=_.slice(S,L),S=L,{value:I,done:!1}):S<_.length?(I=_.slice(S),S=_.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var S=0,w=0,I;(I=this.nextBreak(_,w))<_.length;)w=I,S++;return w<_.length&&S++,S};function N(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?o:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?r:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?x:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?b:128102<=_&&_<=128105?T:d}return this}typeof Az<"u"&&Az.exports&&(Az.exports=Qje)});var Pme=Xn((sq,aq)=>{(function(e,t){typeof sq=="object"&&typeof aq<"u"?aq.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.RBush=t())})(sq,function(){"use strict";function e(A,E,v,D,O){t(A,E,v||0,D||A.length-1,O||i)}function t(A,E,v,D,O){for(;D>v;){if(D-v>600){var R=D-v+1,M=E-v+1,N=Math.log(R),_=.5*Math.exp(2*N/3),S=.5*Math.sqrt(N*_*(R-_)/R)*(M-R/2<0?-1:1),w=Math.max(v,Math.floor(E-M*_/R+S)),I=Math.min(D,Math.floor(E+(R-M)*_/R+S));t(A,E,w,I,O)}var L=A[E],B=v,U=D;for(n(A,v,E),O(A[D],L)>0&&n(A,v,D);B<U;){for(n(A,B,U),B++,U--;O(A[B],L)<0;)B++;for(;O(A[U],L)>0;)U--}O(A[v],L)===0?n(A,v,U):(U++,n(A,U,D)),U<=E&&(v=U+1),E<=U&&(D=U-1)}}function n(A,E,v){var D=A[E];A[E]=A[v],A[v]=D}function i(A,E){return A<E?-1:A>E?1:0}var o=function(E){E===void 0&&(E=9),this._maxEntries=Math.max(4,E),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(E){var v=this.data,D=[];if(!b(E,v))return D;for(var O=this.toBBox,R=[];v;){for(var M=0;M<v.children.length;M++){var N=v.children[M],_=v.leaf?O(N):N;b(E,_)&&(v.leaf?D.push(N):x(E,_)?this._all(N,D):R.push(N))}v=R.pop()}return D},o.prototype.collides=function(E){var v=this.data;if(!b(E,v))return!1;for(var D=[];v;){for(var O=0;O<v.children.length;O++){var R=v.children[O],M=v.leaf?this.toBBox(R):R;if(b(E,M)){if(v.leaf||x(E,M))return!0;D.push(R)}}v=D.pop()}return!1},o.prototype.load=function(E){if(!(E&&E.length))return this;if(E.length<this._minEntries){for(var v=0;v<E.length;v++)this.insert(E[v]);return this}var D=this._build(E.slice(),0,E.length-1,0);if(!this.data.children.length)this.data=D;else if(this.data.height===D.height)this._splitRoot(this.data,D);else{if(this.data.height<D.height){var O=this.data;this.data=D,D=O}this._insert(D,this.data.height-D.height-1,!0)}return this},o.prototype.insert=function(E){return E&&this._insert(E,this.data.height-1),this},o.prototype.clear=function(){return this.data=T([]),this},o.prototype.remove=function(E,v){if(!E)return this;for(var D=this.data,O=this.toBBox(E),R=[],M=[],N,_,S;D||R.length;){if(D||(D=R.pop(),_=R[R.length-1],N=M.pop(),S=!0),D.leaf){var w=r(E,D.children,v);if(w!==-1)return D.children.splice(w,1),R.push(D),this._condense(R),this}!S&&!D.leaf&&x(D,O)?(R.push(D),M.push(N),N=0,_=D,D=D.children[0]):_?(N++,D=_.children[N],S=!1):D=null}return this},o.prototype.toBBox=function(E){return E},o.prototype.compareMinX=function(E,v){return E.minX-v.minX},o.prototype.compareMinY=function(E,v){return E.minY-v.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(E){return this.data=E,this},o.prototype._all=function(E,v){for(var D=[];E;)E.leaf?v.push.apply(v,E.children):D.push.apply(D,E.children),E=D.pop();return v},o.prototype._build=function(E,v,D,O){var R=D-v+1,M=this._maxEntries,N;if(R<=M)return N=T(E.slice(v,D+1)),s(N,this.toBBox),N;O||(O=Math.ceil(Math.log(R)/Math.log(M)),M=Math.ceil(R/Math.pow(M,O-1))),N=T([]),N.leaf=!1,N.height=O;var _=Math.ceil(R/M),S=_*Math.ceil(Math.sqrt(M));C(E,v,D,S,this.compareMinX);for(var w=v;w<=D;w+=S){var I=Math.min(w+S-1,D);C(E,w,I,_,this.compareMinY);for(var L=w;L<=I;L+=_){var B=Math.min(L+_-1,I);N.children.push(this._build(E,L,B,O-1))}}return s(N,this.toBBox),N},o.prototype._chooseSubtree=function(E,v,D,O){for(;O.push(v),!(v.leaf||O.length-1===D);){for(var R=1/0,M=1/0,N=void 0,_=0;_<v.children.length;_++){var S=v.children[_],w=d(S),I=g(E,S)-w;I<M?(M=I,R=w<R?w:R,N=S):I===M&&w<R&&(R=w,N=S)}v=N||v.children[0]}return v},o.prototype._insert=function(E,v,D){var O=D?E:this.toBBox(E),R=[],M=this._chooseSubtree(O,this.data,v,R);for(M.children.push(E),c(M,O);v>=0&&R[v].children.length>this._maxEntries;)this._split(R,v),v--;this._adjustParentBBoxes(O,R,v)},o.prototype._split=function(E,v){var D=E[v],O=D.children.length,R=this._minEntries;this._chooseSplitAxis(D,R,O);var M=this._chooseSplitIndex(D,R,O),N=T(D.children.splice(M,D.children.length-M));N.height=D.height,N.leaf=D.leaf,s(D,this.toBBox),s(N,this.toBBox),v?E[v-1].children.push(N):this._splitRoot(D,N)},o.prototype._splitRoot=function(E,v){this.data=T([E,v]),this.data.height=E.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(E,v,D){for(var O,R=1/0,M=1/0,N=v;N<=D-v;N++){var _=a(E,0,N,this.toBBox),S=a(E,N,D,this.toBBox),w=m(_,S),I=d(_)+d(S);w<R?(R=w,O=N,M=I<M?I:M):w===R&&I<M&&(M=I,O=N)}return O||D-v},o.prototype._chooseSplitAxis=function(E,v,D){var O=E.leaf?this.compareMinX:u,R=E.leaf?this.compareMinY:f,M=this._allDistMargin(E,v,D,O),N=this._allDistMargin(E,v,D,R);M<N&&E.children.sort(O)},o.prototype._allDistMargin=function(E,v,D,O){E.children.sort(O);for(var R=this.toBBox,M=a(E,0,v,R),N=a(E,D-v,D,R),_=p(M)+p(N),S=v;S<D-v;S++){var w=E.children[S];c(M,E.leaf?R(w):w),_+=p(M)}for(var I=D-v-1;I>=v;I--){var L=E.children[I];c(N,E.leaf?R(L):L),_+=p(N)}return _},o.prototype._adjustParentBBoxes=function(E,v,D){for(var O=D;O>=0;O--)c(v[O],E)},o.prototype._condense=function(E){for(var v=E.length-1,D=void 0;v>=0;v--)E[v].children.length===0?v>0?(D=E[v-1].children,D.splice(D.indexOf(E[v]),1)):this.clear():s(E[v],this.toBBox)};function r(A,E,v){if(!v)return E.indexOf(A);for(var D=0;D<E.length;D++)if(v(A,E[D]))return D;return-1}function s(A,E){a(A,0,A.children.length,E,A)}function a(A,E,v,D,O){O||(O=T(null)),O.minX=1/0,O.minY=1/0,O.maxX=-1/0,O.maxY=-1/0;for(var R=E;R<v;R++){var M=A.children[R];c(O,A.leaf?D(M):M)}return O}function c(A,E){return A.minX=Math.min(A.minX,E.minX),A.minY=Math.min(A.minY,E.minY),A.maxX=Math.max(A.maxX,E.maxX),A.maxY=Math.max(A.maxY,E.maxY),A}function u(A,E){return A.minX-E.minX}function f(A,E){return A.minY-E.minY}function d(A){return(A.maxX-A.minX)*(A.maxY-A.minY)}function p(A){return A.maxX-A.minX+(A.maxY-A.minY)}function g(A,E){return(Math.max(E.maxX,A.maxX)-Math.min(E.minX,A.minX))*(Math.max(E.maxY,A.maxY)-Math.min(E.minY,A.minY))}function m(A,E){var v=Math.max(A.minX,E.minX),D=Math.max(A.minY,E.minY),O=Math.min(A.maxX,E.maxX),R=Math.min(A.maxY,E.maxY);return Math.max(0,O-v)*Math.max(0,R-D)}function x(A,E){return A.minX<=E.minX&&A.minY<=E.minY&&E.maxX<=A.maxX&&E.maxY<=A.maxY}function b(A,E){return E.minX<=A.maxX&&E.minY<=A.maxY&&E.maxX>=A.minX&&E.maxY>=A.minY}function T(A){return{children:A,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function C(A,E,v,D,O){for(var R=[E,v];R.length;)if(v=R.pop(),E=R.pop(),!(v-E<=D)){var M=E+Math.ceil((v-E)/D/2)*D;e(A,M,E,v,O),R.push(E,M,M,v)}}return o})});var gpe=Xn((b4,_pe)=>{(function(e,t){typeof b4=="object"&&typeof _pe<"u"?t(b4):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(b4,function(e){"use strict";function t(A){return A}function n(A){if(A==null)return t;var E,v,D=A.scale[0],O=A.scale[1],R=A.translate[0],M=A.translate[1];return function(N,_){_||(E=v=0);var S=2,w=N.length,I=new Array(w);for(I[0]=(E+=N[0])*D+R,I[1]=(v+=N[1])*O+M;S<w;)I[S]=N[S],++S;return I}}function i(A){var E=n(A.transform),v,D=1/0,O=D,R=-D,M=-D;function N(S){S=E(S),S[0]<D&&(D=S[0]),S[0]>R&&(R=S[0]),S[1]<O&&(O=S[1]),S[1]>M&&(M=S[1])}function _(S){switch(S.type){case"GeometryCollection":S.geometries.forEach(_);break;case"Point":N(S.coordinates);break;case"MultiPoint":S.coordinates.forEach(N);break}}A.arcs.forEach(function(S){for(var w=-1,I=S.length,L;++w<I;)L=E(S[w],w),L[0]<D&&(D=L[0]),L[0]>R&&(R=L[0]),L[1]<O&&(O=L[1]),L[1]>M&&(M=L[1])});for(v in A.objects)_(A.objects[v]);return[D,O,R,M]}function o(A,E){for(var v,D=A.length,O=D-E;O<--D;)v=A[O],A[O++]=A[D],A[D]=v}function r(A,E){return typeof E=="string"&&(E=A.objects[E]),E.type==="GeometryCollection"?{type:"FeatureCollection",features:E.geometries.map(function(v){return s(A,v)})}:s(A,E)}function s(A,E){var v=E.id,D=E.bbox,O=E.properties==null?{}:E.properties,R=a(A,E);return v==null&&D==null?{type:"Feature",properties:O,geometry:R}:D==null?{type:"Feature",id:v,properties:O,geometry:R}:{type:"Feature",id:v,bbox:D,properties:O,geometry:R}}function a(A,E){var v=n(A.transform),D=A.arcs;function O(w,I){I.length&&I.pop();for(var L=D[w<0?~w:w],B=0,U=L.length;B<U;++B)I.push(v(L[B],B));w<0&&o(I,U)}function R(w){return v(w)}function M(w){for(var I=[],L=0,B=w.length;L<B;++L)O(w[L],I);return I.length<2&&I.push(I[0]),I}function N(w){for(var I=M(w);I.length<4;)I.push(I[0]);return I}function _(w){return w.map(N)}function S(w){var I=w.type,L;switch(I){case"GeometryCollection":return{type:I,geometries:w.geometries.map(S)};case"Point":L=R(w.coordinates);break;case"MultiPoint":L=w.coordinates.map(R);break;case"LineString":L=M(w.arcs);break;case"MultiLineString":L=w.arcs.map(M);break;case"Polygon":L=_(w.arcs);break;case"MultiPolygon":L=w.arcs.map(_);break;default:return null}return{type:I,coordinates:L}}return S(E)}function c(A,E){var v={},D={},O={},R=[],M=-1;E.forEach(function(S,w){var I=A.arcs[S<0?~S:S],L;I.length<3&&!I[1][0]&&!I[1][1]&&(L=E[++M],E[M]=S,E[w]=L)}),E.forEach(function(S){var w=N(S),I=w[0],L=w[1],B,U;if(B=O[I])if(delete O[B.end],B.push(S),B.end=L,U=D[L]){delete D[U.start];var V=U===B?B:B.concat(U);D[V.start=B.start]=O[V.end=U.end]=V}else D[B.start]=O[B.end]=B;else if(B=D[L])if(delete D[B.start],B.unshift(S),B.start=I,U=O[I]){delete O[U.end];var G=U===B?B:U.concat(B);D[G.start=U.start]=O[G.end=B.end]=G}else D[B.start]=O[B.end]=B;else B=[S],D[B.start=I]=O[B.end=L]=B});function N(S){var w=A.arcs[S<0?~S:S],I=w[0],L;return A.transform?(L=[0,0],w.forEach(function(B){L[0]+=B[0],L[1]+=B[1]})):L=w[w.length-1],S<0?[L,I]:[I,L]}function _(S,w){for(var I in S){var L=S[I];delete w[L.start],delete L.start,delete L.end,L.forEach(function(B){v[B<0?~B:B]=1}),R.push(L)}}return _(O,D),_(D,O),E.forEach(function(S){v[S<0?~S:S]||R.push([S])}),R}function u(A){return a(A,f.apply(this,arguments))}function f(A,E,v){var D,O,R;if(arguments.length>1)D=d(A,E,v);else for(O=0,D=new Array(R=A.arcs.length);O<R;++O)D[O]=O;return{type:"MultiLineString",arcs:c(A,D)}}function d(A,E,v){var D=[],O=[],R;function M(I){var L=I<0?~I:I;(O[L]||(O[L]=[])).push({i:I,g:R})}function N(I){I.forEach(M)}function _(I){I.forEach(N)}function S(I){I.forEach(_)}function w(I){switch(R=I,I.type){case"GeometryCollection":I.geometries.forEach(w);break;case"LineString":N(I.arcs);break;case"MultiLineString":case"Polygon":_(I.arcs);break;case"MultiPolygon":S(I.arcs);break}}return w(E),O.forEach(v==null?function(I){D.push(I[0].i)}:function(I){v(I[0].g,I[I.length-1].g)&&D.push(I[0].i)}),D}function p(A){for(var E=-1,v=A.length,D,O=A[v-1],R=0;++E<v;)D=O,O=A[E],R+=D[0]*O[1]-D[1]*O[0];return Math.abs(R)}function g(A){return a(A,m.apply(this,arguments))}function m(A,E){var v={},D=[],O=[];E.forEach(R);function R(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(R);break;case"Polygon":M(_.arcs);break;case"MultiPolygon":_.arcs.forEach(M);break}}function M(_){_.forEach(function(S){S.forEach(function(w){(v[w=w<0?~w:w]||(v[w]=[])).push(_)})}),D.push(_)}function N(_){return p(a(A,{type:"Polygon",arcs:[_]}).coordinates[0])}return D.forEach(function(_){if(!_._){var S=[],w=[_];for(_._=1,O.push(S);_=w.pop();)S.push(_),_.forEach(function(I){I.forEach(function(L){v[L<0?~L:L].forEach(function(B){B._||(B._=1,w.push(B))})})})}}),D.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:O.map(function(_){var S=[],w;if(_.forEach(function(V){V.forEach(function(G){G.forEach(function(k){v[k<0?~k:k].length<2&&S.push(k)})})}),S=c(A,S),(w=S.length)>1)for(var I=1,L=N(S[0]),B,U;I<w;++I)(B=N(S[I]))>L&&(U=S[0],S[0]=S[I],S[I]=U,L=B);return S}).filter(function(_){return _.length>0})}}function x(A,E){for(var v=0,D=A.length;v<D;){var O=v+D>>>1;A[O]<E?v=O+1:D=O}return v}function b(A){var E={},v=A.map(function(){return[]});function D(V,G){V.forEach(function(k){k<0&&(k=~k);var W=E[k];W?W.push(G):E[k]=[G]})}function O(V,G){V.forEach(function(k){D(k,G)})}function R(V,G){V.type==="GeometryCollection"?V.geometries.forEach(function(k){R(k,G)}):V.type in M&&M[V.type](V.arcs,G)}var M={LineString:D,MultiLineString:O,Polygon:O,MultiPolygon:function(V,G){V.forEach(function(k){O(k,G)})}};A.forEach(R);for(var N in E)for(var _=E[N],S=_.length,w=0;w<S;++w)for(var I=w+1;I<S;++I){var L=_[w],B=_[I],U;(U=v[L])[N=x(U,B)]!==B&&U.splice(N,0,B),(U=v[B])[N=x(U,L)]!==L&&U.splice(N,0,L)}return v}function T(A){if(A==null)return t;var E,v,D=A.scale[0],O=A.scale[1],R=A.translate[0],M=A.translate[1];return function(N,_){_||(E=v=0);var S=2,w=N.length,I=new Array(w),L=Math.round((N[0]-R)/D),B=Math.round((N[1]-M)/O);for(I[0]=L-E,E=L,I[1]=B-v,v=B;S<w;)I[S]=N[S],++S;return I}}function C(A,E){if(A.transform)throw new Error("already quantized");if(!E||!E.scale){if(!((M=Math.floor(E))>=2))throw new Error("n must be \u22652");_=A.bbox||i(A);var v=_[0],D=_[1],O=_[2],R=_[3],M;E={scale:[O-v?(O-v)/(M-1):1,R-D?(R-D)/(M-1):1],translate:[v,D]}}else _=A.bbox;var N=T(E),_,S,w=A.objects,I={};function L(V){return N(V)}function B(V){var G;switch(V.type){case"GeometryCollection":G={type:"GeometryCollection",geometries:V.geometries.map(B)};break;case"Point":G={type:"Point",coordinates:L(V.coordinates)};break;case"MultiPoint":G={type:"MultiPoint",coordinates:V.coordinates.map(L)};break;default:return V}return V.id!=null&&(G.id=V.id),V.bbox!=null&&(G.bbox=V.bbox),V.properties!=null&&(G.properties=V.properties),G}function U(V){var G=0,k=1,W=V.length,q,J=new Array(W);for(J[0]=N(V[0],0);++G<W;)((q=N(V[G],G))[0]||q[1])&&(J[k++]=q);return k===1&&(J[k++]=[0,0]),J.length=k,J}for(S in w)I[S]=B(w[S]);return{type:"Topology",bbox:_,transform:E,objects:I,arcs:A.arcs.map(U)}}e.bbox=i,e.feature=r,e.merge=g,e.mergeArcs=m,e.mesh=u,e.meshArcs=f,e.neighbors=b,e.quantize=C,e.transform=n,e.untransform=T,Object.defineProperty(e,"__esModule",{value:!0})})});var Bpe=Xn(A4=>{"use strict";Object.defineProperty(A4,"__esModule",{value:!0});A4.version=void 0;A4.version="4.1.0"});var yT=Xn(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.isUndefined=kpe;tg.isBoolean=bnt;tg.defaults=Tnt;tg.ellipsis=Cnt;tg.remove=Ant;tg.removeWithPredicate=Ent;tg.assertNever=Snt;function kpe(e){return e===void 0}function bnt(e){return typeof e=="boolean"}function Tnt(e,t){for(var n in t)t.hasOwnProperty(n)&&kpe(e[n])&&(e[n]=t[n]);return e}function Cnt(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Ant(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function Ent(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Snt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var xT=Xn(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.alphaNumericAndMarksRe=wi.alphaNumericAndMarksCharsStr=wi.alphaNumericCharsRe=wi.decimalNumbersStr=wi.alphaCharsAndMarksStr=wi.marksStr=wi.emojiStr=wi.alphaCharsStr=wi.controlCharsRe=wi.quoteRe=wi.whitespaceRe=wi.nonDigitRe=wi.digitRe=wi.letterRe=void 0;wi.letterRe=/[A-Za-z]/;wi.digitRe=/[\d]/;wi.nonDigitRe=/[\D]/;wi.whitespaceRe=/\s/;wi.quoteRe=/['"]/;wi.controlCharsRe=/[\x00-\x1F\x7F]/;wi.alphaCharsStr=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source;wi.emojiStr=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source;wi.marksStr=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source;wi.alphaCharsAndMarksStr=wi.alphaCharsStr+wi.emojiStr+wi.marksStr;wi.decimalNumbersStr=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source;wi.alphaNumericCharsRe=new RegExp("[".concat(wi.alphaCharsStr+wi.decimalNumbersStr,"]"));wi.alphaNumericAndMarksCharsStr=wi.alphaCharsAndMarksStr+wi.decimalNumbersStr;wi.alphaNumericAndMarksRe=new RegExp("[".concat(wi.alphaNumericAndMarksCharsStr,"]"))});var v4=Xn(S4=>{"use strict";Object.defineProperty(S4,"__esModule",{value:!0});S4.HtmlTag=void 0;var E4=xT(),vnt=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(E4.whitespaceRe):[],o=t.split(E4.whitespaceRe),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(E4.whitespaceRe):[],o=t.split(E4.whitespaceRe),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();S4.HtmlTag=vnt});var Vpe=Xn(Eq=>{"use strict";Object.defineProperty(Eq,"__esModule",{value:!0});Eq.truncateSmart=wnt;function wnt(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(C){var A={},E=C,v=E.match(/^([a-z]+):\/\//i);return v&&(A.scheme=v[1],E=E.substr(v[0].length)),v=E.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(A.host=v[1],E=E.substr(v[0].length)),v=E.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(A.path=v[1],E=E.substr(v[0].length)),v=E.match(/^\?(.*?)(?=(#|$))/i),v&&(A.query=v[1],E=E.substr(v[0].length)),v=E.match(/^#(.*?)$/i),v&&(A.fragment=v[1]),A},s=function(C){var A="";return C.scheme&&C.host&&(A+=C.scheme+"://"),C.host&&(A+=C.host),C.path&&(A+="/"+C.path),C.query&&(A+="?"+C.query),C.fragment&&(A+="#"+C.fragment),A},a=function(C,A){var E=A/2,v=Math.ceil(E),D=-1*Math.floor(E),O="";return D<0&&(O=C.substr(D)),C.substr(0,v)+n+O};if(e.length<=t)return e;var c=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var d="";if(u.host&&(d+=u.host),d.length>=c)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,c+i):a(d,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((d+p).length>=c){if((d+p).length==t)return(d+p).substr(0,t);var g=c-d.length;return(d+a(p,g)).substr(0,c+i)}else d+=p;if(u.fragment){var m="#"+u.fragment;if((d+m).length>=c){if((d+m).length==t)return(d+m).substr(0,t);var x=c-d.length;return(d+a(m,x)).substr(0,c+i)}else d+=m}if(u.scheme&&u.host){var b=u.scheme+"://";if((d+b).length<c)return(b+d).substr(0,t)}if(d.length<=t)return d;var T="";return c>0&&(T=d.substr(-1*Math.floor(c/2))),(d.substr(0,Math.ceil(c/2))+n+T).substr(0,c+i)}});var Upe=Xn(Sq=>{"use strict";Object.defineProperty(Sq,"__esModule",{value:!0});Sq.truncateMiddle=Dnt;function Dnt(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}});var zpe=Xn(vq=>{"use strict";Object.defineProperty(vq,"__esModule",{value:!0});vq.truncateEnd=Pnt;var Int=yT();function Pnt(e,t,n){return(0,Int.ellipsis)(e,t,n)}});var wq=Xn(w4=>{"use strict";Object.defineProperty(w4,"__esModule",{value:!0});w4.AnchorTagBuilder=void 0;var Rnt=v4(),Ont=Vpe(),Mnt=Upe(),Lnt=zpe(),Nnt=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new Rnt.HtmlTag({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?(0,Ont.truncateSmart)(t,i):o==="middle"?(0,Mnt.truncateMiddle)(t,i):(0,Lnt.truncateEnd)(t,i)},e}();w4.AnchorTagBuilder=Nnt});var Vm={};jQ(Vm,{__addDisposableResource:()=>d_e,__assign:()=>D4,__asyncDelegator:()=>o_e,__asyncGenerator:()=>i_e,__asyncValues:()=>r_e,__await:()=>TS,__awaiter:()=>$pe,__classPrivateFieldGet:()=>l_e,__classPrivateFieldIn:()=>f_e,__classPrivateFieldSet:()=>u_e,__createBinding:()=>P4,__decorate:()=>Wpe,__disposeResources:()=>h_e,__esDecorate:()=>qpe,__exportStar:()=>Jpe,__extends:()=>Hpe,__generator:()=>Qpe,__importDefault:()=>c_e,__importStar:()=>a_e,__makeTemplateObject:()=>s_e,__metadata:()=>Zpe,__param:()=>jpe,__propKey:()=>Xpe,__read:()=>Pq,__rest:()=>Gpe,__rewriteRelativeImportExtension:()=>m_e,__runInitializers:()=>Ype,__setFunctionName:()=>Kpe,__spread:()=>e_e,__spreadArray:()=>n_e,__spreadArrays:()=>t_e,__values:()=>I4,default:()=>knt});function Hpe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Dq(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function Gpe(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n}function Wpe(e,t,n,i){var o=arguments.length,r=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function jpe(e,t){return function(n,i){t(n,i,e)}}function qpe(e,t,n,i,o,r){function s(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,p=!1,g=n.length-1;g>=0;g--){var m={};for(var x in i)m[x]=x==="access"?{}:i[x];for(var x in i.access)m.access[x]=i.access[x];m.addInitializer=function(T){if(p)throw new TypeError("Cannot add initializers after decoration has completed");r.push(s(T||null))};var b=(0,n[g])(a==="accessor"?{get:f.get,set:f.set}:f[c],m);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(d=s(b.get))&&(f.get=d),(d=s(b.set))&&(f.set=d),(d=s(b.init))&&o.unshift(d)}else(d=s(b))&&(a==="field"?o.unshift(d):f[c]=d)}u&&Object.defineProperty(u,i.name,f),p=!0}function Ype(e,t,n){for(var i=arguments.length>2,o=0;o<t.length;o++)n=i?t[o].call(e,n):t[o].call(e);return i?n:void 0}function Xpe(e){return typeof e=="symbol"?e:"".concat(e)}function Kpe(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function Zpe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function $pe(e,t,n,i){function o(r){return r instanceof n?r:new n(function(s){s(r)})}return new(n||(n=Promise))(function(r,s){function a(f){try{u(i.next(f))}catch(d){s(d)}}function c(f){try{u(i.throw(f))}catch(d){s(d)}}function u(f){f.done?r(f.value):o(f.value).then(a,c)}u((i=i.apply(e,t||[])).next())})}function Qpe(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){n.label=u[1];break}if(u[0]===6&&n.label<r[1]){n.label=r[1],r=u;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(u);break}r[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Jpe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&P4(t,e,n)}function I4(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pq(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],s;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function e_e(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Pq(arguments[t]));return e}function t_e(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),o=0,t=0;t<n;t++)for(var r=arguments[t],s=0,a=r.length;s<a;s++,o++)i[o]=r[s];return i}function n_e(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function TS(e){return this instanceof TS?(this.v=e,this):new TS(e)}function i_e(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),o,r=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(g){return function(m){return Promise.resolve(m).then(g,d)}}function a(g,m){i[g]&&(o[g]=function(x){return new Promise(function(b,T){r.push([g,x,b,T])>1||c(g,x)})},m&&(o[g]=m(o[g])))}function c(g,m){try{u(i[g](m))}catch(x){p(r[0][3],x)}}function u(g){g.value instanceof TS?Promise.resolve(g.value.v).then(f,d):p(r[0][2],g)}function f(g){c("next",g)}function d(g){c("throw",g)}function p(g,m){g(m),r.shift(),r.length&&c(r[0][0],r[0][1])}}function o_e(e){var t,n;return t={},i("next"),i("throw",function(o){throw o}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(o,r){t[o]=e[o]?function(s){return(n=!n)?{value:TS(e[o](s)),done:!1}:r?r(s):s}:r}}function r_e(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof I4=="function"?I4(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=e[r]&&function(s){return new Promise(function(a,c){s=e[r](s),o(a,c,s.done,s.value)})}}function o(r,s,a,c){Promise.resolve(c).then(function(u){r({value:u,done:a})},s)}}function s_e(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function a_e(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=Iq(e),i=0;i<n.length;i++)n[i]!=="default"&&P4(t,e,n[i]);return Fnt(t,e),t}function c_e(e){return e&&e.__esModule?e:{default:e}}function l_e(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function u_e(e,t,n,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function f_e(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function d_e(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(o=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");o&&(i=function(){try{o.call(this)}catch(r){return Promise.reject(r)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}function h_e(e){function t(r){e.error=e.hasError?new Bnt(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}var n,i=0;function o(){for(;n=e.stack.pop();)try{if(!n.async&&i===1)return i=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var r=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(r).then(o,function(s){return t(s),o()})}else i|=1}catch(s){t(s)}if(i===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function m_e(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,o,r,s){return i?t?".jsx":".js":o&&(!r||!s)?n:o+r+"."+s.toLowerCase()+"js"}):e}var Dq,D4,P4,Fnt,Iq,Bnt,knt,Um=XEe(()=>{Dq=function(e,t){return Dq=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},Dq(e,t)};D4=function(){return D4=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},D4.apply(this,arguments)};P4=Object.create?function(e,t,n,i){i===void 0&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]};Fnt=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},Iq=function(e){return Iq=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},Iq(e)};Bnt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};knt={__extends:Hpe,__assign:D4,__rest:Gpe,__decorate:Wpe,__param:jpe,__esDecorate:qpe,__runInitializers:Ype,__propKey:Xpe,__setFunctionName:Kpe,__metadata:Zpe,__awaiter:$pe,__generator:Qpe,__createBinding:P4,__exportStar:Jpe,__values:I4,__read:Pq,__spread:e_e,__spreadArrays:t_e,__spreadArray:n_e,__await:TS,__asyncGenerator:i_e,__asyncDelegator:o_e,__asyncValues:r_e,__makeTemplateObject:s_e,__importStar:a_e,__importDefault:c_e,__classPrivateFieldGet:l_e,__classPrivateFieldSet:u_e,__classPrivateFieldIn:f_e,__addDisposableResource:d_e,__disposeResources:h_e,__rewriteRelativeImportExtension:m_e}});var bT=Xn(R4=>{"use strict";Object.defineProperty(R4,"__esModule",{value:!0});R4.AbstractMatch=void 0;var Vnt=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();R4.AbstractMatch=Vnt});var p_e=Xn(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:!0});TT.tldRegex=TT.tldRegexStr=void 0;TT.tldRegexStr="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bentley|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|lipsy|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)";TT.tldRegex=new RegExp("^"+TT.tldRegexStr+"$")});var O4=Xn(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.tldUrlHostRe=mi.schemeUrlRe=mi.invalidSchemeRe=mi.urlSuffixedCharsNotAllowedAtEndRe=mi.httpSchemePrefixRe=mi.httpSchemeRe=mi.urlSuffixNotAllowedAsLastCharRe=mi.urlSuffixAllowedSpecialCharsRe=mi.urlSuffixStartCharsRe=mi.domainNameCharRegex=void 0;mi.isSchemeStartChar=znt;mi.isSchemeChar=Hnt;mi.isDomainLabelStartChar=__e;mi.isDomainLabelChar=Gnt;mi.isPathChar=Wnt;mi.isUrlSuffixStartChar=jnt;mi.isKnownTld=g_e;mi.isValidSchemeUrl=qnt;mi.isValidTldMatch=Ynt;mi.isValidIpV4Address=Znt;var CT=xT(),Unt=p_e();mi.domainNameCharRegex=CT.alphaNumericAndMarksRe;mi.urlSuffixStartCharsRe=/[\/?#]/;mi.urlSuffixAllowedSpecialCharsRe=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/;mi.urlSuffixNotAllowedAsLastCharRe=/[?!:,.;^]/;mi.httpSchemeRe=/https?:\/\//i;mi.httpSchemePrefixRe=new RegExp("^"+mi.httpSchemeRe.source,"i");mi.urlSuffixedCharsNotAllowedAtEndRe=new RegExp(mi.urlSuffixNotAllowedAsLastCharRe.source+"$");mi.invalidSchemeRe=/^(javascript|vbscript):/i;mi.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;mi.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;function znt(e){return CT.letterRe.test(e)}function Hnt(e){return CT.letterRe.test(e)||CT.digitRe.test(e)||e==="+"||e==="-"||e==="."}function __e(e){return CT.alphaNumericAndMarksRe.test(e)}function Gnt(e){return e==="_"||__e(e)}function Wnt(e){return CT.alphaNumericAndMarksRe.test(e)||mi.urlSuffixAllowedSpecialCharsRe.test(e)||mi.urlSuffixNotAllowedAsLastCharRe.test(e)}function jnt(e){return mi.urlSuffixStartCharsRe.test(e)}function g_e(e){return Unt.tldRegex.test(e.toLowerCase())}function qnt(e){if(mi.invalidSchemeRe.test(e))return!1;var t=e.match(mi.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!CT.letterRe.test(i))}function Ynt(e){var t=e.match(mi.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!g_e(o)}var Xnt=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,Knt=/[:/?#]/;function Znt(e){var t=e.split(Knt,1)[0];return Xnt.test(t)}});var Rq=Xn(M4=>{"use strict";Object.defineProperty(M4,"__esModule",{value:!0});M4.UrlMatch=void 0;var $nt=(Um(),Qh(Vm)),Qnt=bT(),Jnt=O4(),eit=/^(https?:\/\/)?(www\.)?/i,tit=/^\/\//,nit=function(e){$nt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=rit(n)),this.stripPrefix.scheme&&(n=iit(n)),this.stripPrefix.www&&(n=oit(n)),this.stripTrailingSlash&&(n=sit(n)),this.decodePercentEncoding&&(n=ait(n)),n},t}(Qnt.AbstractMatch);M4.UrlMatch=nit;function iit(e){return e.replace(Jnt.httpSchemePrefixRe,"")}function oit(e){return e.replace(eit,"$1")}function rit(e){return e.replace(tit,"")}function sit(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function ait(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}});var x_e=Xn(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});AT.mailtoSchemePrefixRe=void 0;AT.isEmailLocalPartStartChar=uit;AT.isEmailLocalPartChar=fit;AT.isValidEmail=dit;var y_e=xT(),cit=O4();AT.mailtoSchemePrefixRe=/^mailto:/i;var lit=new RegExp("[".concat(y_e.alphaNumericAndMarksCharsStr,"!#$%&'*+/=?^_`{|}~-]"));function uit(e){return y_e.alphaNumericAndMarksRe.test(e)}function fit(e){return lit.test(e)}function dit(e){var t=e.split(".").pop()||"";return(0,cit.isKnownTld)(t)}});var Oq=Xn(L4=>{"use strict";Object.defineProperty(L4,"__esModule",{value:!0});L4.EmailMatch=void 0;var hit=(Um(),Qh(Vm)),mit=bT(),pit=function(e){hit.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(mit.AbstractMatch);L4.EmailMatch=pit});var Mq=Xn(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});CS.hashtagServices=void 0;CS.isHashtagTextChar=git;CS.isValidHashtag=yit;var _it=xT();function git(e){return e==="_"||_it.alphaNumericAndMarksRe.test(e)}function yit(e){return e.length<=140}CS.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var Lq=Xn(N4=>{"use strict";Object.defineProperty(N4,"__esModule",{value:!0});N4.HashtagMatch=void 0;var xit=(Um(),Qh(Vm)),bit=yT(),Tit=bT(),Cit=function(e){xit.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:throw(0,bit.assertNever)(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Tit.AbstractMatch);N4.HashtagMatch=Cit});var Nq=Xn(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});AS.mentionServices=void 0;AS.isMentionTextChar=Sit;AS.isValidMention=vit;var Ait={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/},Eit=/[-\w.]/;function Sit(e){return Eit.test(e)}function vit(e,t){var n=Ait[t];return n.test(e)}AS.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var Fq=Xn(F4=>{"use strict";Object.defineProperty(F4,"__esModule",{value:!0});F4.MentionMatch=void 0;var wit=(Um(),Qh(Vm)),Dit=yT(),Iit=bT(),Pit=function(e){wit.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:throw(0,Dit.assertNever)(this.serviceName),new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Iit.AbstractMatch);F4.MentionMatch=Pit});var b_e=Xn(tF=>{"use strict";Object.defineProperty(tF,"__esModule",{value:!0});tF.isPhoneNumberSeparatorChar=Bit;tF.isPhoneNumberControlChar=kit;tF.isValidPhoneNumber=Vit;var Rit=/[-. ]/,Oit=/[-. ()]/,Mit=/[,;]/,Lit=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,Nit=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,Fit=new RegExp("^".concat(Lit.source,"|").concat(Nit.source,"$"));function Bit(e){return Rit.test(e)}function kit(e){return Mit.test(e)}function Vit(e){var t=e.charAt(0)==="+"||Oit.test(e);return t&&Fit.test(e)}});var Bq=Xn(B4=>{"use strict";Object.defineProperty(B4,"__esModule",{value:!0});B4.PhoneMatch=void 0;var Uit=(Um(),Qh(Vm)),zit=bT(),Hit=function(e){Uit.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(zit.AbstractMatch);B4.PhoneMatch=Hit});var Hq=Xn(V4=>{"use strict";Object.defineProperty(V4,"__esModule",{value:!0});V4.parseMatches=Xit;V4.excludeUnbalancedTrailingBracesAndPunctuation=A_e;var Ua=xT(),Git=Rq(),wo=yT(),Ko=O4(),ES=x_e(),Wit=Oq(),kq=Mq(),jit=Lq(),Vq=Nq(),qit=Fq(),SS=b_e(),Yit=Bq();function Xit(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],u=e.length,f=[],d=0;d<u;d++){var p=e.charAt(d);if(f.length===0)T(p);else{for(var g=f.length-1;g>=0;g--){var m=f[g];switch(m.state){case 11:O(m,p);break;case 12:R(m,p);break;case 0:C(m,p);break;case 1:A(m,p);break;case 2:E(m,p);break;case 3:v(m,p);break;case 4:D(m,p);break;case 5:M(m,p);break;case 6:N(m,p);break;case 7:_(m,p);break;case 13:S(m,p);break;case 14:w(m,p);break;case 8:I(m,p);break;case 9:L(m,p);break;case 10:B(m,p);break;case 15:U(m,p);break;case 16:V(m,p);break;case 17:G(m,p);break;case 18:k(m,p);break;case 19:W(m,p);break;case 20:q(m,p);break;case 21:J(m,p);break;case 22:j(m,p);break;case 23:K(m,p);break;case 24:Q(m,p);break;case 25:de(m,p);break;case 26:xe(m,p);break;case 27:ce(m,p);break;case 28:ge(m,p);break;case 29:be(m,p);break;case 30:De(m,p);break;case 31:Ae(m,p);break;case 32:ze(m,p);break;case 33:tt(m,p);break;case 34:vt(m,p);break;case 35:pt(m,p);break;case 36:Be(m,p);break;case 37:ke(m,p);break;case 38:qt(m,p);break;case 39:At(m,p);break;case 40:lt(m,p);break;case 41:jn(m,p);break;default:(0,wo.assertNever)(m.state)}}if(d>0&&(0,Ko.isSchemeStartChar)(p)){var x=e.charAt(d-1);!(0,Ko.isSchemeStartChar)(x)&&!f.some(eot)&&f.push(k4(d,0))}}}for(var b=f.length-1;b>=0;b--)f.forEach(function(me){return sn(me)});return c;function T(me){if(me==="#")f.push(Qit(d,28));else if(me==="@")f.push(Jit(d,30));else if(me==="/")f.push(Uq(d,11));else if(me==="+")f.push(zq(d,37));else if(me==="(")f.push(zq(d,32));else{if(Ua.digitRe.test(me)&&(f.push(zq(d,38)),f.push(Zit(d,13))),(0,ES.isEmailLocalPartStartChar)(me)){var Ce=me.toLowerCase()==="m"?15:22;f.push($it(d,Ce))}(0,Ko.isSchemeStartChar)(me)&&f.push(k4(d,0)),Ua.alphaNumericAndMarksRe.test(me)&&f.push(Uq(d,5))}}function C(me,Ce){Ce===":"?me.state=2:Ce==="-"?me.state=1:(0,Ko.isSchemeChar)(Ce)||(0,wo.remove)(f,me)}function A(me,Ce){Ce==="-"||(Ce==="/"?((0,wo.remove)(f,me),f.push(Uq(d,11))):(0,Ko.isSchemeChar)(Ce)?me.state=0:(0,wo.remove)(f,me))}function E(me,Ce){Ce==="/"?me.state=3:Ce==="."?(0,wo.remove)(f,me):(0,Ko.isDomainLabelStartChar)(Ce)?(me.state=5,(0,Ko.isSchemeStartChar)(Ce)&&f.push(k4(d,0))):(0,wo.remove)(f,me)}function v(me,Ce){Ce==="/"?me.state=4:(0,Ko.isPathChar)(Ce)?(me.state=10,me.acceptStateReached=!0):sn(me)}function D(me,Ce){Ce==="/"?me.state=10:(0,Ko.isDomainLabelStartChar)(Ce)?(me.state=5,me.acceptStateReached=!0):(0,wo.remove)(f,me)}function O(me,Ce){Ce==="/"?me.state=12:(0,wo.remove)(f,me)}function R(me,Ce){(0,Ko.isDomainLabelStartChar)(Ce)?me.state=5:(0,wo.remove)(f,me)}function M(me,Ce){Ce==="."?me.state=7:Ce==="-"?me.state=6:Ce===":"?me.state=8:(0,Ko.isUrlSuffixStartChar)(Ce)?me.state=10:(0,Ko.isDomainLabelChar)(Ce)||sn(me)}function N(me,Ce){Ce==="-"||(Ce==="."?sn(me):(0,Ko.isDomainLabelStartChar)(Ce)?me.state=5:sn(me))}function _(me,Ce){Ce==="."?sn(me):(0,Ko.isDomainLabelStartChar)(Ce)?(me.state=5,me.acceptStateReached=!0):sn(me)}function S(me,Ce){Ce==="."?me.state=14:Ce===":"?me.state=8:Ua.digitRe.test(Ce)||((0,Ko.isUrlSuffixStartChar)(Ce)?me.state=10:Ua.alphaNumericAndMarksRe.test(Ce)?(0,wo.remove)(f,me):sn(me))}function w(me,Ce){Ua.digitRe.test(Ce)?(me.octetsEncountered++,me.octetsEncountered===4&&(me.acceptStateReached=!0),me.state=13):sn(me)}function I(me,Ce){Ua.digitRe.test(Ce)?me.state=9:sn(me)}function L(me,Ce){Ua.digitRe.test(Ce)||((0,Ko.isUrlSuffixStartChar)(Ce)?me.state=10:sn(me))}function B(me,Ce){(0,Ko.isPathChar)(Ce)||sn(me)}function U(me,Ce){Ce.toLowerCase()==="a"?me.state=16:j(me,Ce)}function V(me,Ce){Ce.toLowerCase()==="i"?me.state=17:j(me,Ce)}function G(me,Ce){Ce.toLowerCase()==="l"?me.state=18:j(me,Ce)}function k(me,Ce){Ce.toLowerCase()==="t"?me.state=19:j(me,Ce)}function W(me,Ce){Ce.toLowerCase()==="o"?me.state=20:j(me,Ce)}function q(me,Ce){Ce.toLowerCase()===":"?me.state=21:j(me,Ce)}function J(me,Ce){(0,ES.isEmailLocalPartChar)(Ce)?me.state=22:(0,wo.remove)(f,me)}function j(me,Ce){Ce==="."?me.state=23:Ce==="@"?me.state=24:(0,ES.isEmailLocalPartChar)(Ce)?me.state=22:(0,wo.remove)(f,me)}function K(me,Ce){Ce==="."||Ce==="@"?(0,wo.remove)(f,me):(0,ES.isEmailLocalPartChar)(Ce)?me.state=22:(0,wo.remove)(f,me)}function Q(me,Ce){(0,Ko.isDomainLabelStartChar)(Ce)?me.state=25:(0,wo.remove)(f,me)}function de(me,Ce){Ce==="."?me.state=27:Ce==="-"?me.state=26:(0,Ko.isDomainLabelChar)(Ce)||sn(me)}function xe(me,Ce){Ce==="-"||Ce==="."?sn(me):(0,Ko.isDomainLabelChar)(Ce)?me.state=25:sn(me)}function ce(me,Ce){Ce==="."||Ce==="-"?sn(me):(0,Ko.isDomainLabelStartChar)(Ce)?(me.state=25,me.acceptStateReached=!0):sn(me)}function ge(me,Ce){(0,kq.isHashtagTextChar)(Ce)?(me.state=29,me.acceptStateReached=!0):(0,wo.remove)(f,me)}function be(me,Ce){(0,kq.isHashtagTextChar)(Ce)||sn(me)}function De(me,Ce){(0,Vq.isMentionTextChar)(Ce)?(me.state=31,me.acceptStateReached=!0):(0,wo.remove)(f,me)}function Ae(me,Ce){(0,Vq.isMentionTextChar)(Ce)||(Ua.alphaNumericAndMarksRe.test(Ce)?(0,wo.remove)(f,me):sn(me))}function ke(me,Ce){Ua.digitRe.test(Ce)?me.state=38:((0,wo.remove)(f,me),T(Ce))}function ze(me,Ce){Ua.digitRe.test(Ce)?me.state=33:(0,wo.remove)(f,me),T(Ce)}function tt(me,Ce){Ua.digitRe.test(Ce)?me.state=34:(0,wo.remove)(f,me)}function vt(me,Ce){Ua.digitRe.test(Ce)?me.state=35:(0,wo.remove)(f,me)}function pt(me,Ce){Ce===")"?me.state=36:(0,wo.remove)(f,me)}function Be(me,Ce){Ua.digitRe.test(Ce)?me.state=38:(0,SS.isPhoneNumberSeparatorChar)(Ce)?me.state=39:(0,wo.remove)(f,me)}function qt(me,Ce){me.acceptStateReached=!0,(0,SS.isPhoneNumberControlChar)(Ce)?me.state=40:Ce==="#"?me.state=41:Ua.digitRe.test(Ce)||(Ce==="("?me.state=32:(0,SS.isPhoneNumberSeparatorChar)(Ce)?me.state=39:(sn(me),(0,Ko.isSchemeStartChar)(Ce)&&f.push(k4(d,0))))}function At(me,Ce){Ua.digitRe.test(Ce)?me.state=38:Ce==="("?me.state=32:(sn(me),T(Ce))}function lt(me,Ce){(0,SS.isPhoneNumberControlChar)(Ce)||(Ce==="#"?me.state=41:Ua.digitRe.test(Ce)?me.state=38:sn(me))}function jn(me,Ce){(0,SS.isPhoneNumberControlChar)(Ce)?me.state=40:Ua.digitRe.test(Ce)?(0,wo.remove)(f,me):sn(me)}function sn(me){if((0,wo.remove)(f,me),!!me.acceptStateReached){var Ce=me.startIdx,mn=e.slice(me.startIdx,d);if(mn=A_e(mn),me.type==="url"){var ft=e.charAt(me.startIdx-1);if(ft==="@")return;var ao=me.matchType;if(ao==="scheme"){var Ro=Ko.httpSchemeRe.exec(mn);if(Ro&&(Ce=Ce+Ro.index,mn=mn.slice(Ro.index)),!(0,Ko.isValidSchemeUrl)(mn))return}else if(ao==="tld"){if(!(0,Ko.isValidTldMatch)(mn))return}else if(ao==="ipV4"){if(!(0,Ko.isValidIpV4Address)(mn))return}else(0,wo.assertNever)(ao);c.push(new Git.UrlMatch({tagBuilder:n,matchedText:mn,offset:Ce,urlMatchType:ao,url:mn,protocolRelativeMatch:mn.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(me.type==="email")(0,ES.isValidEmail)(mn)&&c.push(new Wit.EmailMatch({tagBuilder:n,matchedText:mn,offset:Ce,email:mn.replace(ES.mailtoSchemePrefixRe,"")}));else if(me.type==="hashtag")(0,kq.isValidHashtag)(mn)&&c.push(new jit.HashtagMatch({tagBuilder:n,matchedText:mn,offset:Ce,serviceName:s,hashtag:mn.slice(1)}));else if(me.type==="mention")(0,Vq.isValidMention)(mn,a)&&c.push(new qit.MentionMatch({tagBuilder:n,matchedText:mn,offset:Ce,serviceName:a,mention:mn.slice(1)}));else if(me.type==="phone"){if(mn=mn.replace(/ +$/g,""),(0,SS.isValidPhoneNumber)(mn)){var ra=mn.replace(/[^0-9,;#]/g,"");c.push(new Yit.PhoneMatch({tagBuilder:n,matchedText:mn,offset:Ce,number:ra,plusSign:mn.charAt(0)==="+"}))}}else(0,wo.assertNever)(me)}}}var Kit=/[\(\{\[]/,T_e=/[\)\}\]]/,C_e={")":"(","}":"{","]":"["};function A_e(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Kit.test(i)?t[i]++:T_e.test(i)&&t[C_e[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),T_e.test(r)){var s=C_e[r];if(t[s]<0)t[s]++,o--;else break}else if(Ko.urlSuffixedCharsNotAllowedAtEndRe.test(r))o--;else break;return e.slice(0,o+1)}function k4(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function Uq(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Zit(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function $it(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Qit(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Jit(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function zq(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function eot(e){return e.type==="url"&&e.matchType==="scheme"}});var E_e=Xn(Gq=>{"use strict";Object.defineProperty(Gq,"__esModule",{value:!0});Gq.parseHtml=not;var Sc=(Um(),Qh(Vm)),fl=xT(),tot=yT();function not(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new zm,c=0,u=e.length,f=0,d=0,p=a;c<u;){var g=e.charAt(c);switch(f){case 0:m(g);break;case 1:x(g);break;case 2:T(g);break;case 3:b(g);break;case 4:C(g);break;case 5:A(g);break;case 6:E(g);break;case 7:v(g);break;case 8:D(g);break;case 9:O(g);break;case 10:R(g);break;case 11:M(g);break;case 12:N(g);break;case 13:_(g);break;case 14:S(g);break;case 15:w(g);break;case 16:I(g);break;case 17:L(g);break;case 18:B(g);break;case 19:U(g);break;case 20:V(g);break;default:(0,tot.assertNever)(f)}c++}d<c&&q();function m(K){K==="<"&&k()}function x(K){K==="!"?f=13:K==="/"?(f=2,p=new zm(Sc.__assign(Sc.__assign({},p),{isClosing:!0}))):K==="<"?k():fl.letterRe.test(K)?(f=3,p=new zm(Sc.__assign(Sc.__assign({},p),{isOpening:!0}))):(f=0,p=a)}function b(K){fl.whitespaceRe.test(K)?(p=new zm(Sc.__assign(Sc.__assign({},p),{name:J()})),f=4):K==="<"?k():K==="/"?(p=new zm(Sc.__assign(Sc.__assign({},p),{name:J()})),f=12):K===">"?(p=new zm(Sc.__assign(Sc.__assign({},p),{name:J()})),W()):!fl.letterRe.test(K)&&!fl.digitRe.test(K)&&K!==":"&&G()}function T(K){K===">"?G():fl.letterRe.test(K)?f=3:G()}function C(K){fl.whitespaceRe.test(K)||(K==="/"?f=12:K===">"?W():K==="<"?k():K==="="||fl.quoteRe.test(K)||fl.controlCharsRe.test(K)?G():f=5)}function A(K){fl.whitespaceRe.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?W():K==="<"?k():fl.quoteRe.test(K)&&G()}function E(K){fl.whitespaceRe.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?W():K==="<"?k():fl.quoteRe.test(K)?G():f=5)}function v(K){fl.whitespaceRe.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?G():K==="<"?k():f=10)}function D(K){K==='"'&&(f=11)}function O(K){K==="'"&&(f=11)}function R(K){fl.whitespaceRe.test(K)?f=4:K===">"?W():K==="<"&&k()}function M(K){fl.whitespaceRe.test(K)?f=4:K==="/"?f=12:K===">"?W():K==="<"?k():(f=4,j())}function N(K){K===">"?(p=new zm(Sc.__assign(Sc.__assign({},p),{isClosing:!0})),W()):f=4}function _(K){e.substr(c,2)==="--"?(c+=2,p=new zm(Sc.__assign(Sc.__assign({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new zm(Sc.__assign(Sc.__assign({},p),{type:"doctype"})),f=20):G()}function S(K){K==="-"?f=15:K===">"?G():f=16}function w(K){K==="-"?f=18:K===">"?G():f=16}function I(K){K==="-"&&(f=17)}function L(K){K==="-"?f=18:f=16}function B(K){K===">"?W():K==="!"?f=19:K==="-"||(f=16)}function U(K){K==="-"?f=17:K===">"?W():f=16}function V(K){K===">"?W():K==="<"&&k()}function G(){f=0,p=a}function k(){f=1,p=new zm({idx:c})}function W(){var K=e.slice(d,p.idx);K&&o(K,d),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),G(),d=c+1}function q(){var K=e.slice(d,c);o(K,d),d=c+1}function J(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function j(){c--}}var zm=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}()});var U4=Xn(Wq=>{"use strict";Object.defineProperty(Wq,"__esModule",{value:!0});var iot=Bpe(),Os=yT(),oot=wq(),rot=v4(),sot=Hq(),aot=E_e(),cot=Nq(),lot=Mq(),uot=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=fot(t.urls),this.email=(0,Os.isBoolean)(t.email)?t.email:this.email,this.phone=(0,Os.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,Os.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=dot(t.stripPrefix),this.stripTrailingSlash=(0,Os.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,Os.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&cot.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&lot.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=hot(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return(0,aot.parseHtml)(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);r.push.apply(r,g)}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,Os.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=(0,sot.parseMatches)(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof rot.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new oot.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=iot.version,e}();Wq.default=uot;function fot(e){return e==null&&(e=!0),(0,Os.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,Os.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,Os.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,Os.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function dot(e){return e==null&&(e=!0),(0,Os.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,Os.isBoolean)(e.scheme)?e.scheme:!0,www:(0,Os.isBoolean)(e.www)?e.www:!0}}function hot(e){return typeof e=="number"?{length:e,location:"end"}:(0,Os.defaults)(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}});var v_e=Xn(S_e=>{"use strict";Object.defineProperty(S_e,"__esModule",{value:!0})});var w_e=Xn(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});var ET=(Um(),Qh(Vm));ET.__exportStar(v_e(),ng);ET.__exportStar(Oq(),ng);ET.__exportStar(Lq(),ng);ET.__exportStar(bT(),ng);ET.__exportStar(Fq(),ng);ET.__exportStar(Bq(),ng);ET.__exportStar(Rq(),ng)});var D_e=Xn(jq=>{"use strict";Object.defineProperty(jq,"__esModule",{value:!0});var mot=(Um(),Qh(Vm));mot.__exportStar(Hq(),jq)});var qq=Xn((Dh,P_e)=>{"use strict";Dh=P_e.exports=U4().default;Object.defineProperty(Dh,"__esModule",{value:!0});Dh.Autolinker=void 0;var vS=(Um(),Qh(Vm)),I_e=vS.__importDefault(U4());Dh.Autolinker=I_e.default;Dh.default=I_e.default;vS.__exportStar(U4(),Dh);vS.__exportStar(wq(),Dh);vS.__exportStar(v4(),Dh);vS.__exportStar(w_e(),Dh);vS.__exportStar(D_e(),Dh)});var qZ=Xn((exports,module)=>{/*! * protobuf.js v7.4.0 (c) 2016, daniel wirtz * compiled thu, 22 aug 2024 20:30:39 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details - */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(d,p){s[a]=function(m){if(u)if(u=!1,m)p(m);else{for(var x=new Array(arguments.length-1),b=0;b<x.length;)x[b++]=arguments[b];d.apply(null,x)}};try{o.apply(r||null,s)}catch(g){u&&(u=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var d=0;--f%4>1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,d){for(var p=null,g=[],m=0,x=0,b;f<d;){var T=u[f++];switch(x){case 0:g[m++]=o[T>>2],b=(T&3)<<4,x=1;break;case 1:g[m++]=o[b|T>>4],b=(T&15)<<2,x=2;break;case 2:g[m++]=o[b|T>>6],g[m++]=o[T&63],x=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),m=0)}return x&&(g[m++]=o[b],g[m++]=61,x===1&&(g[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,g.slice(0,m))),p.join("")):String.fromCharCode.apply(String,g.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,g=0,m,x=0;x<u.length;){var b=u.charCodeAt(x++);if(b===61&&g>1)break;if((b=r[b])===undefined)throw Error(a);switch(g){case 0:m=b,g=1;break;case 1:f[d++]=m<<2|(b&48)>>4,m=b,g=2;break;case 2:f[d++]=(m&15)<<4|(b&60)>>2,m=b,g=3;break;case 3:f[d++]=(m&3)<<6|b,g=0;break}}if(g===1)throw Error(a);return d-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),d=f[3]===128;function p(b,T,C){u[0]=b,T[C]=f[0],T[C+1]=f[1],T[C+2]=f[2],T[C+3]=f[3]}function g(b,T,C){u[0]=b,T[C]=f[3],T[C+1]=f[2],T[C+2]=f[1],T[C+3]=f[0]}c.writeFloatLE=d?p:g,c.writeFloatBE=d?g:p;function m(b,T){return f[0]=b[T],f[1]=b[T+1],f[2]=b[T+2],f[3]=b[T+3],u[0]}function x(b,T){return f[3]=b[T],f[2]=b[T+1],f[1]=b[T+2],f[0]=b[T+3],u[0]}c.readFloatLE=d?m:x,c.readFloatBE=d?x:m}():function(){function u(d,p,g,m){var x=p<0?1:0;if(x&&(p=-p),p===0)d(1/p>0?0:2147483648,g,m);else if(isNaN(p))d(2143289344,g,m);else if(p>34028234663852886e22)d((x<<31|2139095040)>>>0,g,m);else if(p<11754943508222875e-54)d((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,m);else{var b=Math.floor(Math.log(p)/Math.LN2),T=Math.round(p*Math.pow(2,-b)*8388608)&8388607;d((x<<31|b+127<<23|T)>>>0,g,m)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(d,p,g){var m=d(p,g),x=(m>>31)*2+1,b=m>>>23&255,T=m&8388607;return b===255?T?NaN:x*(1/0):b===0?x*1401298464324817e-60*T:x*Math.pow(2,b-150)*(T+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(b,T,C){u[0]=b,T[C]=f[0],T[C+1]=f[1],T[C+2]=f[2],T[C+3]=f[3],T[C+4]=f[4],T[C+5]=f[5],T[C+6]=f[6],T[C+7]=f[7]}function g(b,T,C){u[0]=b,T[C]=f[7],T[C+1]=f[6],T[C+2]=f[5],T[C+3]=f[4],T[C+4]=f[3],T[C+5]=f[2],T[C+6]=f[1],T[C+7]=f[0]}c.writeDoubleLE=d?p:g,c.writeDoubleBE=d?g:p;function m(b,T){return f[0]=b[T],f[1]=b[T+1],f[2]=b[T+2],f[3]=b[T+3],f[4]=b[T+4],f[5]=b[T+5],f[6]=b[T+6],f[7]=b[T+7],u[0]}function x(b,T){return f[7]=b[T],f[6]=b[T+1],f[5]=b[T+2],f[4]=b[T+3],f[3]=b[T+4],f[2]=b[T+5],f[1]=b[T+6],f[0]=b[T+7],u[0]}c.readDoubleLE=d?m:x,c.readDoubleBE=d?x:m}():function(){function u(d,p,g,m,x,b){var T=m<0?1:0;if(T&&(m=-m),m===0)d(0,x,b+p),d(1/m>0?0:2147483648,x,b+g);else if(isNaN(m))d(0,x,b+p),d(2146959360,x,b+g);else if(m>17976931348623157e292)d(0,x,b+p),d((T<<31|2146435072)>>>0,x,b+g);else{var C;if(m<22250738585072014e-324)C=m/5e-324,d(C>>>0,x,b+p),d((T<<31|C/4294967296)>>>0,x,b+g);else{var A=Math.floor(Math.log(m)/Math.LN2);A===1024&&(A=1023),C=m*Math.pow(2,-A),d(C*4503599627370496>>>0,x,b+p),d((T<<31|A+1023<<20|C*1048576&1048575)>>>0,x,b+g)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(d,p,g,m,x){var b=d(m,x+p),T=d(m,x+g),C=(T>>31)*2+1,A=T>>>20&2047,E=4294967296*(T&1048575)+b;return A===2047?E?NaN:C*(1/0):A===0?C*5e-324*E:C*Math.pow(2,A-1075)*(E+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return o(p);f+p>a&&(u=o(a),f=0);var g=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var u=null,f=[],d=0,p;s<a;)p=r[s++],p<128?f[d++]=p:p>191&&p<224?f[d++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(r,s,a){for(var c=a,u,f,d=0;d<r.length;++d)u=r.charCodeAt(d),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(m,x){return RangeError("index out of range: "+m.pos+" + "+(x||1)+" > "+m.len)}function c(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(c.create=function(C){return i.Buffer.isBuffer(C)?new o(C):u(C)})(b)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function d(){var m=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,m}if(this.len-this.pos>4){for(;x<5;++x)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(m,x){return(m[x-4]|m[x-3]<<8|m[x-2]<<16|m[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),b=this.pos,T=this.pos+x;if(T>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(b,T);if(b===T){var C=i.Buffer;return C?C.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,b,T)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},c._configure=function(m){o=m,c.create=f(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[x](!1)},uint64:function(){return d.call(this)[x](!0)},sint64:function(){return d.call(this).zzDecode()[x](!1)},fixed64:function(){return g.call(this)[x](!0)},sfixed64:function(){return g.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(r,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,m){if(g)return d.emit("error",g,s),f(g);if(m===null)return d.end(!0),undefined;if(!(m instanceof c))try{m=c[d.responseDelimited?"decodeDelimited":"decode"](m)}catch(x){return d.emit("error",x,s),f(x)}return d.emit("data",m,s),f(null,m)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new o(d,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),d=f.length-1;d>-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,u){return new s(c,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=d;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(A,E,v){this.fn=A,this.len=E,this.next=undefined,this.val=v}function u(){}function f(A){this.head=A.head,this.tail=A.tail,this.len=A.len,this.next=A.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new o})()}:function(){return new d}};d.create=p(),d.alloc=function(E){return new i.Array(E)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(E,v,D){return this.tail=this.tail.next=new c(E,v,D),this.len+=v,this};function g(A,E,v){E[v]=A&255}function m(A,E,v){for(;A>127;)E[v++]=A&127|128,A>>>=7;E[v]=A}function x(A,E){this.len=A,this.next=undefined,this.val=E}x.prototype=Object.create(c.prototype),x.prototype.fn=m,d.prototype.uint32=function(E){return this.len+=(this.tail=this.tail.next=new x((E=E>>>0)<128?1:E<16384?2:E<2097152?3:E<268435456?4:5,E)).len,this},d.prototype.int32=function(E){return E<0?this._push(b,10,r.fromNumber(E)):this.uint32(E)},d.prototype.sint32=function(E){return this.uint32((E<<1^E>>31)>>>0)};function b(A,E,v){for(;A.hi;)E[v++]=A.lo&127|128,A.lo=(A.lo>>>7|A.hi<<25)>>>0,A.hi>>>=7;for(;A.lo>127;)E[v++]=A.lo&127|128,A.lo=A.lo>>>7;E[v++]=A.lo}d.prototype.uint64=function(E){var v=r.from(E);return this._push(b,v.length(),v)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(E){var v=r.from(E).zzEncode();return this._push(b,v.length(),v)},d.prototype.bool=function(E){return this._push(g,1,E?1:0)};function T(A,E,v){E[v]=A&255,E[v+1]=A>>>8&255,E[v+2]=A>>>16&255,E[v+3]=A>>>24}d.prototype.fixed32=function(E){return this._push(T,4,E>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(E){var v=r.from(E);return this._push(T,4,v.lo)._push(T,4,v.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(E){return this._push(i.float.writeFloatLE,4,E)},d.prototype.double=function(E){return this._push(i.float.writeDoubleLE,8,E)};var C=i.Array.prototype.set?function(E,v,D){v.set(E,D)}:function(E,v,D){for(var O=0;O<E.length;++O)v[D+O]=E[O]};d.prototype.bytes=function(E){var v=E.length>>>0;if(!v)return this._push(g,1,0);if(i.isString(E)){var D=d.alloc(v=s.length(E));s.decode(E,D,0),E=D}return this.uint32(v)._push(C,v,E)},d.prototype.string=function(E){var v=a.length(E);return v?this.uint32(v)._push(a.write,v,E):this._push(g,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var E=this.head,v=this.tail,D=this.len;return this.reset().uint32(D),D&&(this.tail.next=E.next,this.tail=v,this.len+=D),this},d.prototype.finish=function(){for(var E=this.head.next,v=this.constructor.alloc(this.len),D=0;E;)E.fn(E.val,v,D),D+=E.len,E=E.next;return v},d._configure=function(A){o=A,d.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d<c.length;)u[f++]=c[d++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var WAe=Xn((dVi,UG)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:o.defaultNoDataValue,x=r(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),b={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return x.resultMask&&(b.maskData=x.resultMask),d.returnEncodedMask&&g.mask&&(b.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(b.fileInfo=s(g),d.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(g))),b};var r=function(f,d,p,g,m){var x=0,b=f.pixels.numBlocksX,T=f.pixels.numBlocksY,C=Math.floor(f.width/b),A=Math.floor(f.height/T),E=2*f.maxZError,v=Number.MAX_VALUE,D;p=p||(f.mask?f.mask.bitset:null);var O,R;O=new d(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var M=new Float32Array(C*A),N,_,S=0;S<=T;S++){var w=S!==T?A:f.height%T;if(w!==0)for(var I=0;I<=b;I++){var L=I!==b?C:f.width%b;if(L!==0){var B=S*f.width*A+I*C,U=f.width-L,V=f.pixels.blocks[x],G,k,W;V.encoding<2?(V.encoding===0?G=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,E,M,f.pixels.maxValue),G=M),k=0):V.encoding===2?W=0:W=V.offset;var j;if(p)for(_=0;_<w;_++){for(B&7&&(j=p[B>>3],j<<=B&7),N=0;N<L;N++)B&7||(j=p[B>>3]),j&128?(R&&(R[B]=1),D=V.encoding<2?G[k++]:W,v=v>D?D:v,O[B++]=D):(R&&(R[B]=0),O[B++]=g),j<<=1;B+=U}else if(V.encoding<2)for(_=0;_<w;_++){for(N=0;N<L;N++)D=G[k++],v=v>D?D:v,O[B++]=D;B+=U}else for(v=v>W?W:v,_=0;_<w;_++){for(N=0;N<L;N++)O[B++]=W;B+=U}if(V.encoding===1&&k!==V.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:O,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var x=new DataView(f,d,24);if(g.fileVersion=x.getInt32(0,!0),g.imageType=x.getInt32(4,!0),g.height=x.getUint32(8,!0),g.width=x.getUint32(12,!0),g.maxZError=x.getFloat64(16,!0),d+=24,!p)if(x=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=x.getUint32(0,!0),g.mask.numBlocksX=x.getUint32(4,!0),g.mask.numBytes=x.getUint32(8,!0),g.mask.maxValue=x.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var b=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(f,d,g.mask.numBytes);var T=x.getInt16(0,!0),C=2,A=0;do{if(T>0)for(;T--;)b[A++]=x.getUint8(C++);else{var E=x.getUint8(C++);for(T=-T;T--;)b[A++]=E}T=x.getInt16(C,!0),C+=2}while(C<g.mask.numBytes);if(T!==-32768||A<b.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=b,d+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));x=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=x.getUint32(0,!0),g.pixels.numBlocksX=x.getUint32(4,!0),g.pixels.numBytes=x.getUint32(8,!0),g.pixels.maxValue=x.getFloat32(12,!0),d+=16;var v=g.pixels.numBlocksX,D=g.pixels.numBlocksY,O=v+(g.width%v>0?1:0),R=D+(g.height%D>0?1:0);g.pixels.blocks=new Array(O*R);for(var M=0,N=0;N<R;N++)for(var _=0;_<O;_++){var S=0,w=f.byteLength-d;x=new DataView(f,d,Math.min(10,w));var I={};g.pixels.blocks[M++]=I;var L=x.getUint8(0);if(S++,I.encoding=L&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){d++;continue}if(L!==0&&L!==2){if(L>>=6,I.offsetType=L,L===2)I.offset=x.getInt8(1),S++;else if(L===1)I.offset=x.getInt16(1,!0),S+=2;else if(L===0)I.offset=x.getFloat32(1,!0),S+=4;else throw"Invalid block offset type";if(I.encoding===1)if(L=x.getUint8(S),S++,I.bitsPerPixel=L&63,L>>=6,I.numValidPixelsType=L,L===2)I.numValidPixels=x.getUint8(S),S++;else if(L===1)I.numValidPixels=x.getUint16(S,!0),S+=2;else if(L===0)I.numValidPixels=x.getUint32(S,!0),S+=4;else throw"Invalid valid pixel count type"}if(d+=S,I.encoding!==3){var B,U;if(I.encoding===0){var V=(g.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";B=new ArrayBuffer(V*4),U=new Uint8Array(B),U.set(new Uint8Array(f,d,V*4));var G=new Float32Array(B);I.rawData=G,d+=V*4}else if(I.encoding===1){var k=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),W=Math.ceil(k/4);B=new ArrayBuffer(W*4),U=new Uint8Array(B),U.set(new Uint8Array(f,d,k)),I.stuffedData=new Uint32Array(B),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,x,b){var T=(1<<d)-1,C=0,A,E=0,v,D,O=Math.ceil((b-g)/m),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,A=0;A<p;A++){if(E===0&&(D=f[C++],E=32),E>=d)v=D>>>E-d&T,E-=d;else{var M=d-E;v=(D&T)<<M&T,D=f[C++],E=32-M,v+=D>>>E}x[A]=v<O?g+v*m:b}return x};return o}(),t=function(){"use strict";var o={unstuff:function(c,u,f,d,p,g,m,x){var b=(1<<f)-1,T=0,C,A=0,E,v,D,O,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(C=0;C<d;C++)A===0&&(v=c[T++],A=32),A>=f?(E=v>>>A-f&b,A-=f):(D=f-A,E=(v&b)<<D&b,v=c[T++],A=32-D,E+=v>>>A),u[C]=p[E];else for(O=Math.ceil((x-g)/m),C=0;C<d;C++)A===0&&(v=c[T++],A=32),A>=f?(E=v>>>A-f&b,A-=f):(D=f-A,E=(v&b)<<D&b,v=c[T++],A=32-D,E+=v>>>A),u[C]=E<O?g+E*m:x},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,x=0,b=0,T=0,C=0,A=0,E,v=[],D=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*D;var O=Math.ceil((g-d)/p);for(b=0;b<f;b++)C===0&&(E=c[x++],C=32),C>=u?(A=E>>>C-u&m,C-=u):(T=u-C,A=(E&m)<<T&m,E=c[x++],C=32-T,A+=E>>>C),v[b]=A<O?d+A*p:g;return v.unshift(d),v},unstuff2:function(c,u,f,d,p,g,m,x){var b=(1<<f)-1,T=0,C,A=0,E=0,v,D,O;if(p)for(C=0;C<d;C++)A===0&&(D=c[T++],A=32,E=0),A>=f?(v=D>>>E&b,A-=f,E+=f):(O=f-A,v=D>>>E&b,D=c[T++],A=32-O,v|=(D&(1<<O)-1)<<f-O,E=O),u[C]=p[v];else{var R=Math.ceil((x-g)/m);for(C=0;C<d;C++)A===0&&(D=c[T++],A=32,E=0),A>=f?(v=D>>>E&b,A-=f,E+=f):(O=f-A,v=D>>>E&b,D=c[T++],A=32-O,v|=(D&(1<<O)-1)<<f-O,E=O),u[C]=v<R?g+v*m:x}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,x=0,b=0,T=0,C=0,A=0,E=0,v,D=[],O=Math.ceil((g-d)/p);for(b=0;b<f;b++)C===0&&(v=c[x++],C=32,E=0),C>=u?(A=v>>>E&m,C-=u,E+=u):(T=u-C,A=v>>>E&m,v=c[x++],C=32-T,A|=(v&(1<<T)-1)<<u-T,E=T),D[b]=A<O?d+A*p:g;return D.unshift(d),D},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,x=0,b,T,C,A=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*A,m=0;m<d;m++)x===0&&(T=c[g++],x=32),x>=f?(b=T>>>x-f&p,x-=f):(C=f-x,b=(T&p)<<C&p,T=c[g++],x=32-C,b+=T>>>x),u[m]=b;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,x=0,b=0,T,C,A;for(m=0;m<d;m++)x===0&&(C=c[g++],x=32,b=0),x>=f?(T=C>>>b&p,x-=f,b+=f):(A=f-x,T=C>>>b&p,C=c[g++],x=32-A,T|=(C&(1<<A)-1)<<f-A,b=A),u[m]=T;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var x,b;if(m>=3&&(b=m>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,f-b,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var x,b=!0;for(x=0;x<f.numDims;x++)if(g[x]!==m[x]){b=!1;break}return f.minValues=g,f.maxValues=m,b},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),x={};if(x.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&x.numBytes!==0)throw"invalid mask";var b,T;if(g===0)b=new Uint8Array(Math.ceil(p/8)),x.bitset=b,T=new Uint8Array(p),u.pixels.resultMask=T,f+=x.numBytes;else if(x.numBytes>0){b=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,x.numBytes);var C=m.getInt16(0,!0),A=2,E=0,v=0;do{if(C>0)for(;C--;)b[E++]=m.getUint8(A++);else for(v=m.getUint8(A++),C=-C;C--;)b[E++]=v;C=m.getInt16(A,!0),A+=2}while(A<x.numBytes);if(C!==-32768||E<b.length)throw"Unexpected end of mask RLE encoding";T=new Uint8Array(p);var D=0,O=0;for(O=0;O<p;O++)O&7?(D=b[O>>3],D<<=O&7):D=b[O>>3],D&128&&(T[O]=1);u.pixels.resultMask=T,x.bitset=b,f+=x.numBytes}return u.ptr=f,u.mask=x,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,x=p.imageType,b=p.numValidPixel*r.getDataTypeSize(x)*g,T,C=u.pixels.resultMask;if(f===Uint8Array)T=new Uint8Array(c,d,b);else{var A=new ArrayBuffer(b),E=new Uint8Array(A);E.set(new Uint8Array(c,d,b)),T=new f(A)}if(T.length===m*g)u.pixels.resultPixels=T;else{u.pixels.resultPixels=new f(m*g);var v=0,D=0,O=0,R=0;if(g>1)for(O=0;O<g;O++)for(R=O*m,D=0;D<m;D++)C[D]&&(u.pixels.resultPixels[R+D]=T[v++]);else for(D=0;D<m;D++)C[D]&&(u.pixels.resultPixels[D]=T[v++])}return d+=b,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),x=d.getInt32(12,!0);if(m>=x)return!1;var b=new Uint32Array(x-m);r.decodeBits(c,u,b);var T=[],C,A,E,v;for(C=m;C<x;C++)A=C-(C<g?0:g),T[A]={first:b[C-m],second:null};var D=c.byteLength-u.ptr,O=Math.ceil(D/4),R=new ArrayBuffer(O*4),M=new Uint8Array(R);M.set(new Uint8Array(c,u.ptr,D));var N=new Uint32Array(R),_=0,S,w=0;for(S=N[0],C=m;C<x;C++)A=C-(C<g?0:g),v=T[A].first,v>0&&(T[A].second=S<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,S=N[w])):(_+=v-32,w++,S=N[w],T[A].second|=S>>>32-_));var I=0,L=0,B=new s;for(C=0;C<T.length;C++)T[C]!==void 0&&(I=Math.max(I,T[C].first));I>=f?L=f:L=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var U=[],V,G,k,W,j,J;for(C=m;C<x;C++)if(A=C-(C<g?0:g),v=T[A].first,v>0)if(V=[v,A],v<=L)for(G=T[A].second<<L-v,k=1<<L-v,E=0;E<k;E++)U[G|E]=V;else for(G=T[A].second,J=B,W=v-1;W>=0;W--)j=G>>>W&1,j?(J.right||(J.right=new s),J=J.right):(J.left||(J.left=new s),J=J.left),W===0&&!J.val&&(J.val=V[1]);return{decodeLut:U,numBitsLUTQick:L,numBitsLUT:I,tree:B,stuffedData:N,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,x=m*g,b=this.readHuffmanTree(c,u),T=b.decodeLut,C=b.tree,A=b.stuffedData,E=b.srcPtr,v=b.bitPos,D=b.numBitsLUTQick,O=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,M,N,_,S=u.pixels.resultMask,w,I,L,B,U,V,G,k=0;v>0&&(E++,v=0);var W=A[E],j=u.encodeMode===1,J=new f(x*p),q=J,K;for(K=0;K<d.numDims;K++){if(p>1&&(q=new f(J.buffer,x*K,x),k=0),u.headerInfo.numValidPixel===m*g)for(V=0,B=0;B<g;B++)for(U=0;U<m;U++,V++){if(N=0,w=W<<v>>>32-D,I=w,32-v<D&&(w|=A[E+1]>>>64-v-D,I=w),T[I])N=T[I][1],v+=T[I][0];else for(w=W<<v>>>32-O,I=w,32-v<O&&(w|=A[E+1]>>>64-v-O,I=w),M=C,G=0;G<O;G++)if(L=w>>>O-G-1&1,M=L?M.right:M.left,!(M.left||M.right)){N=M.val,v=v+G+1;break}v>=32&&(v-=32,E++,W=A[E]),_=N-R,j?(U>0?_+=k:B>0?_+=q[V-m]:_+=k,_&=255,q[V]=_,k=_):q[V]=_}else for(V=0,B=0;B<g;B++)for(U=0;U<m;U++,V++)if(S[V]){if(N=0,w=W<<v>>>32-D,I=w,32-v<D&&(w|=A[E+1]>>>64-v-D,I=w),T[I])N=T[I][1],v+=T[I][0];else for(w=W<<v>>>32-O,I=w,32-v<O&&(w|=A[E+1]>>>64-v-O,I=w),M=C,G=0;G<O;G++)if(L=w>>>O-G-1&1,M=L?M.right:M.left,!(M.left||M.right)){N=M.val,v=v+G+1;break}v>=32&&(v-=32,E++,W=A[E]),_=N-R,j?(U>0&&S[V-1]?_+=k:B>0&&S[V-m]?_+=q[V-m]:_+=k,_&=255,q[V]=_,k=_):q[V]=_}u.ptr=u.ptr+(E+1)*4+(v>0?4:0)}u.pixels.resultPixels=J},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,x=0,b=new DataView(c,u.ptr,5),T=b.getUint8(0);x++;var C=T>>6,A=C===0?4:3-C,E=(T&32)>0,v=T&31,D=0;if(A===1)D=b.getUint8(x),x++;else if(A===2)D=b.getUint16(x,!0),x+=2;else if(A===4)D=b.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var O=2*g.maxZError,R,M,N,_,S,w,I,L,B,U,V=g.numDims>1?g.maxValues[p]:g.zMax;if(E){for(u.counter.lut++,L=b.getUint8(x),B=v,x++,_=Math.ceil((L-1)*v/8),S=Math.ceil(_/4),M=new ArrayBuffer(S*4),N=new Uint8Array(M),u.ptr+=x,N.set(new Uint8Array(c,u.ptr,_)),I=new Uint32Array(M),u.ptr+=_,U=0;L-1>>>U;)U++;_=Math.ceil(D*U/8),S=Math.ceil(_/4),M=new ArrayBuffer(S*4),N=new Uint8Array(M),N.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(M),u.ptr+=_,m>=3?w=o.unstuffLUT2(I,v,L-1,d,O,V):w=o.unstuffLUT(I,v,L-1,d,O,V),m>=3?o.unstuff2(R,f,U,D,w):o.unstuff(R,f,U,D,w)}else u.counter.bitstuffer++,U=v,u.ptr+=x,U>0&&(_=Math.ceil(D*U/8),S=Math.ceil(_/4),M=new ArrayBuffer(S*4),N=new Uint8Array(M),N.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(M),u.ptr+=_,m>=3?d==null?o.originalUnstuff2(R,f,U,D):o.unstuff2(R,f,U,D,!1,d,O,V):d==null?o.originalUnstuff(R,f,U,D):o.unstuff(R,f,U,D,!1,d,O,V))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,x=d.imageType,b=r.getDataTypeSize(x),T=Math.ceil(p/m),C=Math.ceil(g/m);u.pixels.numBlocksY=C,u.pixels.numBlocksX=T,u.pixels.ptr=0;var A=0,E=0,v=0,D=0,O=0,R=0,M=0,N=0,_=0,S=0,w=0,I=0,L=0,B=0,U=0,V=0,G,k,W,j,J,q,K=new f(m*m),Q=g%m||m,de=p%m||m,ye,ce,_e=d.numDims,xe,De=u.pixels.resultMask,Ae=u.pixels.resultPixels;for(v=0;v<C;v++)for(O=v!==C-1?m:Q,D=0;D<T;D++)for(R=D!==T-1?m:de,w=v*p*m+D*m,I=p-R,xe=0;xe<_e;xe++){if(_e>1&&(Ae=new f(u.pixels.resultPixels.buffer,p*g*xe*b,p*g)),M=c.byteLength-u.ptr,G=new DataView(c,u.ptr,Math.min(10,M)),k={},V=0,N=G.getUint8(0),V++,_=N>>6&255,S=N>>2&15,S!==(D*m>>3&15))throw"integrity issue";if(q=N&3,q>3)throw u.ptr+=V,"Invalid block encoding ("+q+")";if(q===2){u.counter.constant++,u.ptr+=V;continue}else if(q===0){if(u.counter.uncompressed++,u.ptr+=V,L=O*R*b,B=c.byteLength-u.ptr,L=L<B?L:B,W=new ArrayBuffer(L%b===0?L:L+b-L%b),j=new Uint8Array(W),j.set(new Uint8Array(c,u.ptr,L)),J=new f(W),U=0,De)for(A=0;A<O;A++){for(E=0;E<R;E++)De[w]&&(Ae[w]=J[U++]),w++;w+=I}else for(A=0;A<O;A++){for(E=0;E<R;E++)Ae[w++]=J[U++];w+=I}u.ptr+=U*b}else if(ye=r.getDataTypeUsed(x,_),ce=r.getOnePixel(k,V,ye,G),V+=r.getDataTypeSize(ye),q===3)if(u.ptr+=V,u.counter.constantoffset++,De)for(A=0;A<O;A++){for(E=0;E<R;E++)De[w]&&(Ae[w]=ce),w++;w+=I}else for(A=0;A<O;A++){for(E=0;E<R;E++)Ae[w++]=ce;w+=I}else if(u.ptr+=V,r.decodeBits(c,u,K,ce,xe),V=0,De)for(A=0;A<O;A++){for(E=0;E<R;E++)De[w]&&(Ae[w]=K[V++]),w++;w+=I}else for(A=0;A<O;A++){for(E=0;E<R;E++)Ae[w++]=K[V++];w+=I}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,x=0,b=c.pixels.resultMask;if(b)if(f>1)for(g=0;g<f;g++)for(x=g*d,m=0;m<d;m++)b[m]&&(c.pixels.resultPixels[x+m]=u);else for(m=0;m<d;m++)b[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,x=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=g.width*g.height;if(p.pixels.resultPixels=new x(b*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(m>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var T=new DataView(c,p.ptr,2),C=T.getUint8(0);if(p.ptr++,C)r.readDataOneSweep(c,p,x);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var A=T.getUint8(1);if(p.ptr++,p.encodeMode=A,A>2||m<4&&A>1)throw"Invalid Huffman flag "+A;A?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var E;u.inputOffset?(E=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(E)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(E=p.headerInfo.blobSize-p.ptr,Math.abs(E)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,f)){var D=p.pixels.resultMask;for(d=0;d<b;d++)D[d]||(v.pixelData[d]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=r.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=o.byteLength-10,g,m=[],x,b,T={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var C=u.decode(o,{inputOffset:s,encodedMaskData:g,maskData:b,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=C.fileInfo.eofOffset,d===0&&(g=C.encodedMaskData,b=C.maskData,T.width=C.width,T.height=C.height,T.dimCount=C.dimCount||1,T.pixelType=C.pixelType||C.fileInfo.pixelType,T.mask=C.maskData),f>1&&C.fileInfo.mask&&C.fileInfo.mask.numBytes>0&&m.push(C.maskData),d++,T.pixels.push(C.pixelData),T.statistics.push({minValue:C.minValue,maxValue:C.maxValue,noDataValue:C.noDataValue,dimStats:C.dimStats})}var A,E,v;if(f>1&&m.length>1){for(v=T.width*T.height,T.bandMasks=m,b=new Uint8Array(v),b.set(m[0]),A=1;A<m.length;A++)for(x=m[A],E=0;E<v;E++)b[E]=b[E]&x[E];T.maskData=b}return T}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof UG<"u"&&UG.exports?UG.exports=i:this.Lerc=i})()});var OEe=Xn((eV,LQ)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof eV=="object"&&typeof LQ=="object"?LQ.exports=t():typeof define=="function"&&define.amd?define([],t):typeof eV=="object"?eV.NoSleep=t():e.NoSleep=t()})(eV,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(i,o,r){n.o(i,o)||Object.defineProperty(i,o,{enumerable:!0,get:r})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,o){if(1&o&&(i=n(i)),8&o||4&o&&typeof i=="object"&&i&&i.__esModule)return i;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:i}),2&o&&typeof i!="string")for(var s in i)n.d(r,s,function(a){return i[a]}.bind(null,s));return r},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var i=function(){function f(d,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}return function(d,p,g){return p&&f(d.prototype,p),g&&f(d,g),d}}(),o=n(1),r=o.webm,s=o.mp4,a=function(){return typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream},c=function(){return"wakeLock"in navigator},u=function(){function f(){var d=this;if(function(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}(this,f),this.enabled=!1,c()){this._wakeLock=null;var p=function(){d._wakeLock!==null&&document.visibilityState==="visible"&&d.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",r),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",function(){d.noSleepVideo.duration<=1?d.noSleepVideo.setAttribute("loop",""):d.noSleepVideo.addEventListener("timeupdate",function(){d.noSleepVideo.currentTime>.5&&(d.noSleepVideo.currentTime=Math.random())})}))}return i(f,[{key:"_addSourceToVideo",value:function(d,p,g){var m=document.createElement("source");m.src=g,m.type="video/"+p,d.appendChild(m)}},{key:"enable",value:function(){var d=this;return c()?navigator.wakeLock.request("screen").then(function(p){d._wakeLock=p,d.enabled=!0,console.log("Wake Lock active."),d._wakeLock.addEventListener("release",function(){console.log("Wake Lock released.")})}).catch(function(p){throw d.enabled=!1,console.error(p.name+", "+p.message),p}):a()?(this.disable(),console.warn(` + */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(d,p){s[a]=function(m){if(u)if(u=!1,m)p(m);else{for(var x=new Array(arguments.length-1),b=0;b<x.length;)x[b++]=arguments[b];d.apply(null,x)}};try{o.apply(r||null,s)}catch(g){u&&(u=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var d=0;--f%4>1&&u.charAt(f)==="=";)++d;return Math.ceil(u.length*3)/4-d};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,d){for(var p=null,g=[],m=0,x=0,b;f<d;){var T=u[f++];switch(x){case 0:g[m++]=o[T>>2],b=(T&3)<<4,x=1;break;case 1:g[m++]=o[b|T>>4],b=(T&15)<<2,x=2;break;case 2:g[m++]=o[b|T>>6],g[m++]=o[T&63],x=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),m=0)}return x&&(g[m++]=o[b],g[m++]=61,x===1&&(g[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,g.slice(0,m))),p.join("")):String.fromCharCode.apply(String,g.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,d){for(var p=d,g=0,m,x=0;x<u.length;){var b=u.charCodeAt(x++);if(b===61&&g>1)break;if((b=r[b])===undefined)throw Error(a);switch(g){case 0:m=b,g=1;break;case 1:f[d++]=m<<2|(b&48)>>4,m=b,g=2;break;case 2:f[d++]=(m&15)<<4|(b&60)>>2,m=b,g=3;break;case 3:f[d++]=(m&3)<<6|b,g=0;break}}if(g===1)throw Error(a);return d-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),d=f[3]===128;function p(b,T,C){u[0]=b,T[C]=f[0],T[C+1]=f[1],T[C+2]=f[2],T[C+3]=f[3]}function g(b,T,C){u[0]=b,T[C]=f[3],T[C+1]=f[2],T[C+2]=f[1],T[C+3]=f[0]}c.writeFloatLE=d?p:g,c.writeFloatBE=d?g:p;function m(b,T){return f[0]=b[T],f[1]=b[T+1],f[2]=b[T+2],f[3]=b[T+3],u[0]}function x(b,T){return f[3]=b[T],f[2]=b[T+1],f[1]=b[T+2],f[0]=b[T+3],u[0]}c.readFloatLE=d?m:x,c.readFloatBE=d?x:m}():function(){function u(d,p,g,m){var x=p<0?1:0;if(x&&(p=-p),p===0)d(1/p>0?0:2147483648,g,m);else if(isNaN(p))d(2143289344,g,m);else if(p>34028234663852886e22)d((x<<31|2139095040)>>>0,g,m);else if(p<11754943508222875e-54)d((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,m);else{var b=Math.floor(Math.log(p)/Math.LN2),T=Math.round(p*Math.pow(2,-b)*8388608)&8388607;d((x<<31|b+127<<23|T)>>>0,g,m)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(d,p,g){var m=d(p,g),x=(m>>31)*2+1,b=m>>>23&255,T=m&8388607;return b===255?T?NaN:x*(1/0):b===0?x*1401298464324817e-60*T:x*Math.pow(2,b-150)*(T+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),d=f[7]===128;function p(b,T,C){u[0]=b,T[C]=f[0],T[C+1]=f[1],T[C+2]=f[2],T[C+3]=f[3],T[C+4]=f[4],T[C+5]=f[5],T[C+6]=f[6],T[C+7]=f[7]}function g(b,T,C){u[0]=b,T[C]=f[7],T[C+1]=f[6],T[C+2]=f[5],T[C+3]=f[4],T[C+4]=f[3],T[C+5]=f[2],T[C+6]=f[1],T[C+7]=f[0]}c.writeDoubleLE=d?p:g,c.writeDoubleBE=d?g:p;function m(b,T){return f[0]=b[T],f[1]=b[T+1],f[2]=b[T+2],f[3]=b[T+3],f[4]=b[T+4],f[5]=b[T+5],f[6]=b[T+6],f[7]=b[T+7],u[0]}function x(b,T){return f[7]=b[T],f[6]=b[T+1],f[5]=b[T+2],f[4]=b[T+3],f[3]=b[T+4],f[2]=b[T+5],f[1]=b[T+6],f[0]=b[T+7],u[0]}c.readDoubleLE=d?m:x,c.readDoubleBE=d?x:m}():function(){function u(d,p,g,m,x,b){var T=m<0?1:0;if(T&&(m=-m),m===0)d(0,x,b+p),d(1/m>0?0:2147483648,x,b+g);else if(isNaN(m))d(0,x,b+p),d(2146959360,x,b+g);else if(m>17976931348623157e292)d(0,x,b+p),d((T<<31|2146435072)>>>0,x,b+g);else{var C;if(m<22250738585072014e-324)C=m/5e-324,d(C>>>0,x,b+p),d((T<<31|C/4294967296)>>>0,x,b+g);else{var A=Math.floor(Math.log(m)/Math.LN2);A===1024&&(A=1023),C=m*Math.pow(2,-A),d(C*4503599627370496>>>0,x,b+p),d((T<<31|A+1023<<20|C*1048576&1048575)>>>0,x,b+g)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(d,p,g,m,x){var b=d(m,x+p),T=d(m,x+g),C=(T>>31)*2+1,A=T>>>20&2047,E=4294967296*(T&1048575)+b;return A===2047?E?NaN:C*(1/0):A===0?C*5e-324*E:C*Math.pow(2,A-1075)*(E+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return o(p);f+p>a&&(u=o(a),f=0);var g=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var u=null,f=[],d=0,p;s<a;)p=r[s++],p<128?f[d++]=p:p>191&&p<224?f[d++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,f[d++]=55296+(p>>10),f[d++]=56320+(p&1023)):f[d++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,d>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),d=0);return u?(d&&u.push(String.fromCharCode.apply(String,f.slice(0,d))),u.join("")):String.fromCharCode.apply(String,f.slice(0,d))},i.write=function(r,s,a){for(var c=a,u,f,d=0;d<r.length;++d)u=r.charCodeAt(d),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(d+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++d,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(m,x){return RangeError("index out of range: "+m.pos+" + "+(x||1)+" > "+m.len)}function c(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(c.create=function(C){return i.Buffer.isBuffer(C)?new o(C):u(C)})(b)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function d(){var m=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,m}if(this.len-this.pos>4){for(;x<5;++x)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(m,x){return(m[x-4]|m[x-3]<<8|m[x-2]<<16|m[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),b=this.pos,T=this.pos+x;if(T>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(b,T);if(b===T){var C=i.Buffer;return C?C.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,b,T)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},c._configure=function(m){o=m,c.create=f(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return d.call(this)[x](!1)},uint64:function(){return d.call(this)[x](!0)},sint64:function(){return d.call(this).zzDecode()[x](!1)},fixed64:function(){return g.call(this)[x](!0)},sfixed64:function(){return g.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var d=this;if(!f)return i.asPromise(r,d,s,a,c,u);if(!d.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return d.rpcImpl(s,a[d.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,m){if(g)return d.emit("error",g,s),f(g);if(m===null)return d.end(!0),undefined;if(!(m instanceof c))try{m=c[d.responseDelimited?"decodeDelimited":"decode"](m)}catch(x){return d.emit("error",x,s),f(x)}return d.emit("data",m,s),f(null,m)})}catch(p){return d.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var d=u>>>0,p=(u-d)/4294967296>>>0;return f&&(p=~p>>>0,d=~d>>>0,++d>4294967295&&(d=0,++p>4294967295&&(p=0))),new o(d,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,d=~this.hi>>>0;return f||(d=d+1>>>0),-(f+d*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,d=this.hi>>>24;return d===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:d<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),d=f.length-1;d>-1;--d)if(c[f[d]]===1&&this[f[d]]!==undefined&&this[f[d]]!==null)return f[d]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,u){return new s(c,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=d;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(A,E,v){this.fn=A,this.len=E,this.next=undefined,this.val=v}function u(){}function f(A){this.head=A.head,this.tail=A.tail,this.len=A.len,this.next=A.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(d.create=function(){return new o})()}:function(){return new d}};d.create=p(),d.alloc=function(E){return new i.Array(E)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(E,v,D){return this.tail=this.tail.next=new c(E,v,D),this.len+=v,this};function g(A,E,v){E[v]=A&255}function m(A,E,v){for(;A>127;)E[v++]=A&127|128,A>>>=7;E[v]=A}function x(A,E){this.len=A,this.next=undefined,this.val=E}x.prototype=Object.create(c.prototype),x.prototype.fn=m,d.prototype.uint32=function(E){return this.len+=(this.tail=this.tail.next=new x((E=E>>>0)<128?1:E<16384?2:E<2097152?3:E<268435456?4:5,E)).len,this},d.prototype.int32=function(E){return E<0?this._push(b,10,r.fromNumber(E)):this.uint32(E)},d.prototype.sint32=function(E){return this.uint32((E<<1^E>>31)>>>0)};function b(A,E,v){for(;A.hi;)E[v++]=A.lo&127|128,A.lo=(A.lo>>>7|A.hi<<25)>>>0,A.hi>>>=7;for(;A.lo>127;)E[v++]=A.lo&127|128,A.lo=A.lo>>>7;E[v++]=A.lo}d.prototype.uint64=function(E){var v=r.from(E);return this._push(b,v.length(),v)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(E){var v=r.from(E).zzEncode();return this._push(b,v.length(),v)},d.prototype.bool=function(E){return this._push(g,1,E?1:0)};function T(A,E,v){E[v]=A&255,E[v+1]=A>>>8&255,E[v+2]=A>>>16&255,E[v+3]=A>>>24}d.prototype.fixed32=function(E){return this._push(T,4,E>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(E){var v=r.from(E);return this._push(T,4,v.lo)._push(T,4,v.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(E){return this._push(i.float.writeFloatLE,4,E)},d.prototype.double=function(E){return this._push(i.float.writeDoubleLE,8,E)};var C=i.Array.prototype.set?function(E,v,D){v.set(E,D)}:function(E,v,D){for(var O=0;O<E.length;++O)v[D+O]=E[O]};d.prototype.bytes=function(E){var v=E.length>>>0;if(!v)return this._push(g,1,0);if(i.isString(E)){var D=d.alloc(v=s.length(E));s.decode(E,D,0),E=D}return this.uint32(v)._push(C,v,E)},d.prototype.string=function(E){var v=a.length(E);return v?this.uint32(v)._push(a.write,v,E):this._push(g,1,0)},d.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var E=this.head,v=this.tail,D=this.len;return this.reset().uint32(D),D&&(this.tail.next=E.next,this.tail=v,this.len+=D),this},d.prototype.finish=function(){for(var E=this.head.next,v=this.constructor.alloc(this.len),D=0;E;)E.fn(E.val,v,D),D+=E.len,E=E.next;return v},d._configure=function(A){o=A,d.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var d=0;d<c.length;)u[f++]=c[d++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var qAe=Xn((gVi,BG)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:o.defaultNoDataValue,x=r(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),b={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return x.resultMask&&(b.maskData=x.resultMask),d.returnEncodedMask&&g.mask&&(b.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(b.fileInfo=s(g),d.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(g))),b};var r=function(f,d,p,g,m){var x=0,b=f.pixels.numBlocksX,T=f.pixels.numBlocksY,C=Math.floor(f.width/b),A=Math.floor(f.height/T),E=2*f.maxZError,v=Number.MAX_VALUE,D;p=p||(f.mask?f.mask.bitset:null);var O,R;O=new d(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var M=new Float32Array(C*A),N,_,S=0;S<=T;S++){var w=S!==T?A:f.height%T;if(w!==0)for(var I=0;I<=b;I++){var L=I!==b?C:f.width%b;if(L!==0){var B=S*f.width*A+I*C,U=f.width-L,V=f.pixels.blocks[x],G,k,W;V.encoding<2?(V.encoding===0?G=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,E,M,f.pixels.maxValue),G=M),k=0):V.encoding===2?W=0:W=V.offset;var q;if(p)for(_=0;_<w;_++){for(B&7&&(q=p[B>>3],q<<=B&7),N=0;N<L;N++)B&7||(q=p[B>>3]),q&128?(R&&(R[B]=1),D=V.encoding<2?G[k++]:W,v=v>D?D:v,O[B++]=D):(R&&(R[B]=0),O[B++]=g),q<<=1;B+=U}else if(V.encoding<2)for(_=0;_<w;_++){for(N=0;N<L;N++)D=G[k++],v=v>D?D:v,O[B++]=D;B+=U}else for(v=v>W?W:v,_=0;_<w;_++){for(N=0;N<L;N++)O[B++]=W;B+=U}if(V.encoding===1&&k!==V.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:O,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var x=new DataView(f,d,24);if(g.fileVersion=x.getInt32(0,!0),g.imageType=x.getInt32(4,!0),g.height=x.getUint32(8,!0),g.width=x.getUint32(12,!0),g.maxZError=x.getFloat64(16,!0),d+=24,!p)if(x=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=x.getUint32(0,!0),g.mask.numBlocksX=x.getUint32(4,!0),g.mask.numBytes=x.getUint32(8,!0),g.mask.maxValue=x.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var b=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(f,d,g.mask.numBytes);var T=x.getInt16(0,!0),C=2,A=0;do{if(T>0)for(;T--;)b[A++]=x.getUint8(C++);else{var E=x.getUint8(C++);for(T=-T;T--;)b[A++]=E}T=x.getInt16(C,!0),C+=2}while(C<g.mask.numBytes);if(T!==-32768||A<b.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=b,d+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));x=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=x.getUint32(0,!0),g.pixels.numBlocksX=x.getUint32(4,!0),g.pixels.numBytes=x.getUint32(8,!0),g.pixels.maxValue=x.getFloat32(12,!0),d+=16;var v=g.pixels.numBlocksX,D=g.pixels.numBlocksY,O=v+(g.width%v>0?1:0),R=D+(g.height%D>0?1:0);g.pixels.blocks=new Array(O*R);for(var M=0,N=0;N<R;N++)for(var _=0;_<O;_++){var S=0,w=f.byteLength-d;x=new DataView(f,d,Math.min(10,w));var I={};g.pixels.blocks[M++]=I;var L=x.getUint8(0);if(S++,I.encoding=L&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){d++;continue}if(L!==0&&L!==2){if(L>>=6,I.offsetType=L,L===2)I.offset=x.getInt8(1),S++;else if(L===1)I.offset=x.getInt16(1,!0),S+=2;else if(L===0)I.offset=x.getFloat32(1,!0),S+=4;else throw"Invalid block offset type";if(I.encoding===1)if(L=x.getUint8(S),S++,I.bitsPerPixel=L&63,L>>=6,I.numValidPixelsType=L,L===2)I.numValidPixels=x.getUint8(S),S++;else if(L===1)I.numValidPixels=x.getUint16(S,!0),S+=2;else if(L===0)I.numValidPixels=x.getUint32(S,!0),S+=4;else throw"Invalid valid pixel count type"}if(d+=S,I.encoding!==3){var B,U;if(I.encoding===0){var V=(g.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";B=new ArrayBuffer(V*4),U=new Uint8Array(B),U.set(new Uint8Array(f,d,V*4));var G=new Float32Array(B);I.rawData=G,d+=V*4}else if(I.encoding===1){var k=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),W=Math.ceil(k/4);B=new ArrayBuffer(W*4),U=new Uint8Array(B),U.set(new Uint8Array(f,d,k)),I.stuffedData=new Uint32Array(B),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,x,b){var T=(1<<d)-1,C=0,A,E=0,v,D,O=Math.ceil((b-g)/m),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,A=0;A<p;A++){if(E===0&&(D=f[C++],E=32),E>=d)v=D>>>E-d&T,E-=d;else{var M=d-E;v=(D&T)<<M&T,D=f[C++],E=32-M,v+=D>>>E}x[A]=v<O?g+v*m:b}return x};return o}(),t=function(){"use strict";var o={unstuff:function(c,u,f,d,p,g,m,x){var b=(1<<f)-1,T=0,C,A=0,E,v,D,O,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(C=0;C<d;C++)A===0&&(v=c[T++],A=32),A>=f?(E=v>>>A-f&b,A-=f):(D=f-A,E=(v&b)<<D&b,v=c[T++],A=32-D,E+=v>>>A),u[C]=p[E];else for(O=Math.ceil((x-g)/m),C=0;C<d;C++)A===0&&(v=c[T++],A=32),A>=f?(E=v>>>A-f&b,A-=f):(D=f-A,E=(v&b)<<D&b,v=c[T++],A=32-D,E+=v>>>A),u[C]=E<O?g+E*m:x},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,x=0,b=0,T=0,C=0,A=0,E,v=[],D=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*D;var O=Math.ceil((g-d)/p);for(b=0;b<f;b++)C===0&&(E=c[x++],C=32),C>=u?(A=E>>>C-u&m,C-=u):(T=u-C,A=(E&m)<<T&m,E=c[x++],C=32-T,A+=E>>>C),v[b]=A<O?d+A*p:g;return v.unshift(d),v},unstuff2:function(c,u,f,d,p,g,m,x){var b=(1<<f)-1,T=0,C,A=0,E=0,v,D,O;if(p)for(C=0;C<d;C++)A===0&&(D=c[T++],A=32,E=0),A>=f?(v=D>>>E&b,A-=f,E+=f):(O=f-A,v=D>>>E&b,D=c[T++],A=32-O,v|=(D&(1<<O)-1)<<f-O,E=O),u[C]=p[v];else{var R=Math.ceil((x-g)/m);for(C=0;C<d;C++)A===0&&(D=c[T++],A=32,E=0),A>=f?(v=D>>>E&b,A-=f,E+=f):(O=f-A,v=D>>>E&b,D=c[T++],A=32-O,v|=(D&(1<<O)-1)<<f-O,E=O),u[C]=v<R?g+v*m:x}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,x=0,b=0,T=0,C=0,A=0,E=0,v,D=[],O=Math.ceil((g-d)/p);for(b=0;b<f;b++)C===0&&(v=c[x++],C=32,E=0),C>=u?(A=v>>>E&m,C-=u,E+=u):(T=u-C,A=v>>>E&m,v=c[x++],C=32-T,A|=(v&(1<<T)-1)<<u-T,E=T),D[b]=A<O?d+A*p:g;return D.unshift(d),D},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,x=0,b,T,C,A=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*A,m=0;m<d;m++)x===0&&(T=c[g++],x=32),x>=f?(b=T>>>x-f&p,x-=f):(C=f-x,b=(T&p)<<C&p,T=c[g++],x=32-C,b+=T>>>x),u[m]=b;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,x=0,b=0,T,C,A;for(m=0;m<d;m++)x===0&&(C=c[g++],x=32,b=0),x>=f?(T=C>>>b&p,x-=f,b+=f):(A=f-x,T=C>>>b&p,C=c[g++],x=32-A,T|=(C&(1<<A)-1)<<f-A,b=A),u[m]=T;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var x,b;if(m>=3&&(b=m>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,f-b,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var x,b=!0;for(x=0;x<f.numDims;x++)if(g[x]!==m[x]){b=!1;break}return f.minValues=g,f.maxValues=m,b},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),x={};if(x.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&x.numBytes!==0)throw"invalid mask";var b,T;if(g===0)b=new Uint8Array(Math.ceil(p/8)),x.bitset=b,T=new Uint8Array(p),u.pixels.resultMask=T,f+=x.numBytes;else if(x.numBytes>0){b=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,x.numBytes);var C=m.getInt16(0,!0),A=2,E=0,v=0;do{if(C>0)for(;C--;)b[E++]=m.getUint8(A++);else for(v=m.getUint8(A++),C=-C;C--;)b[E++]=v;C=m.getInt16(A,!0),A+=2}while(A<x.numBytes);if(C!==-32768||E<b.length)throw"Unexpected end of mask RLE encoding";T=new Uint8Array(p);var D=0,O=0;for(O=0;O<p;O++)O&7?(D=b[O>>3],D<<=O&7):D=b[O>>3],D&128&&(T[O]=1);u.pixels.resultMask=T,x.bitset=b,f+=x.numBytes}return u.ptr=f,u.mask=x,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,x=p.imageType,b=p.numValidPixel*r.getDataTypeSize(x)*g,T,C=u.pixels.resultMask;if(f===Uint8Array)T=new Uint8Array(c,d,b);else{var A=new ArrayBuffer(b),E=new Uint8Array(A);E.set(new Uint8Array(c,d,b)),T=new f(A)}if(T.length===m*g)u.pixels.resultPixels=T;else{u.pixels.resultPixels=new f(m*g);var v=0,D=0,O=0,R=0;if(g>1)for(O=0;O<g;O++)for(R=O*m,D=0;D<m;D++)C[D]&&(u.pixels.resultPixels[R+D]=T[v++]);else for(D=0;D<m;D++)C[D]&&(u.pixels.resultPixels[D]=T[v++])}return d+=b,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),x=d.getInt32(12,!0);if(m>=x)return!1;var b=new Uint32Array(x-m);r.decodeBits(c,u,b);var T=[],C,A,E,v;for(C=m;C<x;C++)A=C-(C<g?0:g),T[A]={first:b[C-m],second:null};var D=c.byteLength-u.ptr,O=Math.ceil(D/4),R=new ArrayBuffer(O*4),M=new Uint8Array(R);M.set(new Uint8Array(c,u.ptr,D));var N=new Uint32Array(R),_=0,S,w=0;for(S=N[0],C=m;C<x;C++)A=C-(C<g?0:g),v=T[A].first,v>0&&(T[A].second=S<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,S=N[w])):(_+=v-32,w++,S=N[w],T[A].second|=S>>>32-_));var I=0,L=0,B=new s;for(C=0;C<T.length;C++)T[C]!==void 0&&(I=Math.max(I,T[C].first));I>=f?L=f:L=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var U=[],V,G,k,W,q,J;for(C=m;C<x;C++)if(A=C-(C<g?0:g),v=T[A].first,v>0)if(V=[v,A],v<=L)for(G=T[A].second<<L-v,k=1<<L-v,E=0;E<k;E++)U[G|E]=V;else for(G=T[A].second,J=B,W=v-1;W>=0;W--)q=G>>>W&1,q?(J.right||(J.right=new s),J=J.right):(J.left||(J.left=new s),J=J.left),W===0&&!J.val&&(J.val=V[1]);return{decodeLut:U,numBitsLUTQick:L,numBitsLUT:I,tree:B,stuffedData:N,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,x=m*g,b=this.readHuffmanTree(c,u),T=b.decodeLut,C=b.tree,A=b.stuffedData,E=b.srcPtr,v=b.bitPos,D=b.numBitsLUTQick,O=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,M,N,_,S=u.pixels.resultMask,w,I,L,B,U,V,G,k=0;v>0&&(E++,v=0);var W=A[E],q=u.encodeMode===1,J=new f(x*p),j=J,K;for(K=0;K<d.numDims;K++){if(p>1&&(j=new f(J.buffer,x*K,x),k=0),u.headerInfo.numValidPixel===m*g)for(V=0,B=0;B<g;B++)for(U=0;U<m;U++,V++){if(N=0,w=W<<v>>>32-D,I=w,32-v<D&&(w|=A[E+1]>>>64-v-D,I=w),T[I])N=T[I][1],v+=T[I][0];else for(w=W<<v>>>32-O,I=w,32-v<O&&(w|=A[E+1]>>>64-v-O,I=w),M=C,G=0;G<O;G++)if(L=w>>>O-G-1&1,M=L?M.right:M.left,!(M.left||M.right)){N=M.val,v=v+G+1;break}v>=32&&(v-=32,E++,W=A[E]),_=N-R,q?(U>0?_+=k:B>0?_+=j[V-m]:_+=k,_&=255,j[V]=_,k=_):j[V]=_}else for(V=0,B=0;B<g;B++)for(U=0;U<m;U++,V++)if(S[V]){if(N=0,w=W<<v>>>32-D,I=w,32-v<D&&(w|=A[E+1]>>>64-v-D,I=w),T[I])N=T[I][1],v+=T[I][0];else for(w=W<<v>>>32-O,I=w,32-v<O&&(w|=A[E+1]>>>64-v-O,I=w),M=C,G=0;G<O;G++)if(L=w>>>O-G-1&1,M=L?M.right:M.left,!(M.left||M.right)){N=M.val,v=v+G+1;break}v>=32&&(v-=32,E++,W=A[E]),_=N-R,q?(U>0&&S[V-1]?_+=k:B>0&&S[V-m]?_+=j[V-m]:_+=k,_&=255,j[V]=_,k=_):j[V]=_}u.ptr=u.ptr+(E+1)*4+(v>0?4:0)}u.pixels.resultPixels=J},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,x=0,b=new DataView(c,u.ptr,5),T=b.getUint8(0);x++;var C=T>>6,A=C===0?4:3-C,E=(T&32)>0,v=T&31,D=0;if(A===1)D=b.getUint8(x),x++;else if(A===2)D=b.getUint16(x,!0),x+=2;else if(A===4)D=b.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var O=2*g.maxZError,R,M,N,_,S,w,I,L,B,U,V=g.numDims>1?g.maxValues[p]:g.zMax;if(E){for(u.counter.lut++,L=b.getUint8(x),B=v,x++,_=Math.ceil((L-1)*v/8),S=Math.ceil(_/4),M=new ArrayBuffer(S*4),N=new Uint8Array(M),u.ptr+=x,N.set(new Uint8Array(c,u.ptr,_)),I=new Uint32Array(M),u.ptr+=_,U=0;L-1>>>U;)U++;_=Math.ceil(D*U/8),S=Math.ceil(_/4),M=new ArrayBuffer(S*4),N=new Uint8Array(M),N.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(M),u.ptr+=_,m>=3?w=o.unstuffLUT2(I,v,L-1,d,O,V):w=o.unstuffLUT(I,v,L-1,d,O,V),m>=3?o.unstuff2(R,f,U,D,w):o.unstuff(R,f,U,D,w)}else u.counter.bitstuffer++,U=v,u.ptr+=x,U>0&&(_=Math.ceil(D*U/8),S=Math.ceil(_/4),M=new ArrayBuffer(S*4),N=new Uint8Array(M),N.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(M),u.ptr+=_,m>=3?d==null?o.originalUnstuff2(R,f,U,D):o.unstuff2(R,f,U,D,!1,d,O,V):d==null?o.originalUnstuff(R,f,U,D):o.unstuff(R,f,U,D,!1,d,O,V))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,x=d.imageType,b=r.getDataTypeSize(x),T=Math.ceil(p/m),C=Math.ceil(g/m);u.pixels.numBlocksY=C,u.pixels.numBlocksX=T,u.pixels.ptr=0;var A=0,E=0,v=0,D=0,O=0,R=0,M=0,N=0,_=0,S=0,w=0,I=0,L=0,B=0,U=0,V=0,G,k,W,q,J,j,K=new f(m*m),Q=g%m||m,de=p%m||m,xe,ce,ge=d.numDims,be,De=u.pixels.resultMask,Ae=u.pixels.resultPixels;for(v=0;v<C;v++)for(O=v!==C-1?m:Q,D=0;D<T;D++)for(R=D!==T-1?m:de,w=v*p*m+D*m,I=p-R,be=0;be<ge;be++){if(ge>1&&(Ae=new f(u.pixels.resultPixels.buffer,p*g*be*b,p*g)),M=c.byteLength-u.ptr,G=new DataView(c,u.ptr,Math.min(10,M)),k={},V=0,N=G.getUint8(0),V++,_=N>>6&255,S=N>>2&15,S!==(D*m>>3&15))throw"integrity issue";if(j=N&3,j>3)throw u.ptr+=V,"Invalid block encoding ("+j+")";if(j===2){u.counter.constant++,u.ptr+=V;continue}else if(j===0){if(u.counter.uncompressed++,u.ptr+=V,L=O*R*b,B=c.byteLength-u.ptr,L=L<B?L:B,W=new ArrayBuffer(L%b===0?L:L+b-L%b),q=new Uint8Array(W),q.set(new Uint8Array(c,u.ptr,L)),J=new f(W),U=0,De)for(A=0;A<O;A++){for(E=0;E<R;E++)De[w]&&(Ae[w]=J[U++]),w++;w+=I}else for(A=0;A<O;A++){for(E=0;E<R;E++)Ae[w++]=J[U++];w+=I}u.ptr+=U*b}else if(xe=r.getDataTypeUsed(x,_),ce=r.getOnePixel(k,V,xe,G),V+=r.getDataTypeSize(xe),j===3)if(u.ptr+=V,u.counter.constantoffset++,De)for(A=0;A<O;A++){for(E=0;E<R;E++)De[w]&&(Ae[w]=ce),w++;w+=I}else for(A=0;A<O;A++){for(E=0;E<R;E++)Ae[w++]=ce;w+=I}else if(u.ptr+=V,r.decodeBits(c,u,K,ce,be),V=0,De)for(A=0;A<O;A++){for(E=0;E<R;E++)De[w]&&(Ae[w]=K[V++]),w++;w+=I}else for(A=0;A<O;A++){for(E=0;E<R;E++)Ae[w++]=K[V++];w+=I}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,x=0,b=c.pixels.resultMask;if(b)if(f>1)for(g=0;g<f;g++)for(x=g*d,m=0;m<d;m++)b[m]&&(c.pixels.resultPixels[x+m]=u);else for(m=0;m<d;m++)b[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,x=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=g.width*g.height;if(p.pixels.resultPixels=new x(b*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(m>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var T=new DataView(c,p.ptr,2),C=T.getUint8(0);if(p.ptr++,C)r.readDataOneSweep(c,p,x);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var A=T.getUint8(1);if(p.ptr++,p.encodeMode=A,A>2||m<4&&A>1)throw"Invalid Huffman flag "+A;A?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var E;u.inputOffset?(E=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(E)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(E=p.headerInfo.blobSize-p.ptr,Math.abs(E)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,f)){var D=p.pixels.resultMask;for(d=0;d<b;d++)D[d]||(v.pixelData[d]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=r.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=o.byteLength-10,g,m=[],x,b,T={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var C=u.decode(o,{inputOffset:s,encodedMaskData:g,maskData:b,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=C.fileInfo.eofOffset,d===0&&(g=C.encodedMaskData,b=C.maskData,T.width=C.width,T.height=C.height,T.dimCount=C.dimCount||1,T.pixelType=C.pixelType||C.fileInfo.pixelType,T.mask=C.maskData),f>1&&C.fileInfo.mask&&C.fileInfo.mask.numBytes>0&&m.push(C.maskData),d++,T.pixels.push(C.pixelData),T.statistics.push({minValue:C.minValue,maxValue:C.maxValue,noDataValue:C.noDataValue,dimStats:C.dimStats})}var A,E,v;if(f>1&&m.length>1){for(v=T.width*T.height,T.bandMasks=m,b=new Uint8Array(v),b.set(m[0]),A=1;A<m.length;A++)for(x=m[A],E=0;E<v;E++)b[E]=b[E]&x[E];T.maskData=b}return T}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof BG<"u"&&BG.exports?BG.exports=i:this.Lerc=i})()});var LEe=Xn((eV,LQ)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof eV=="object"&&typeof LQ=="object"?LQ.exports=t():typeof define=="function"&&define.amd?define([],t):typeof eV=="object"?eV.NoSleep=t():e.NoSleep=t()})(eV,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(i,o,r){n.o(i,o)||Object.defineProperty(i,o,{enumerable:!0,get:r})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,o){if(1&o&&(i=n(i)),8&o||4&o&&typeof i=="object"&&i&&i.__esModule)return i;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:i}),2&o&&typeof i!="string")for(var s in i)n.d(r,s,function(a){return i[a]}.bind(null,s));return r},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var i=function(){function f(d,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}return function(d,p,g){return p&&f(d.prototype,p),g&&f(d,g),d}}(),o=n(1),r=o.webm,s=o.mp4,a=function(){return typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream},c=function(){return"wakeLock"in navigator},u=function(){function f(){var d=this;if(function(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}(this,f),this.enabled=!1,c()){this._wakeLock=null;var p=function(){d._wakeLock!==null&&document.visibilityState==="visible"&&d.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",r),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",function(){d.noSleepVideo.duration<=1?d.noSleepVideo.setAttribute("loop",""):d.noSleepVideo.addEventListener("timeupdate",function(){d.noSleepVideo.currentTime>.5&&(d.noSleepVideo.currentTime=Math.random())})}))}return i(f,[{key:"_addSourceToVideo",value:function(d,p,g){var m=document.createElement("source");m.src=g,m.type="video/"+p,d.appendChild(m)}},{key:"enable",value:function(){var d=this;return c()?navigator.wakeLock.request("screen").then(function(p){d._wakeLock=p,d.enabled=!0,console.log("Wake Lock active."),d._wakeLock.addEventListener("release",function(){console.log("Wake Lock released.")})}).catch(function(p){throw d.enabled=!1,console.error(p.name+", "+p.message),p}):a()?(this.disable(),console.warn(` NoSleep enabled for older iOS devices. This can interrupt active or long-running network requests from completing successfully. See https://github.com/richtr/NoSleep.js/issues/15 for more details. `),this.noSleepTimer=window.setInterval(function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(function(p){return d.enabled=!0,p}).catch(function(p){throw d.enabled=!1,p})}},{key:"disable",value:function(){c()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f}();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIc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FEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRY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GgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}])})});var lwt={};jQ(lwt,{AlphaMode:()=>Tm,AlphaPipelineStage:()=>aM,AnchorPointDirect:()=>fO,AnchorPointIndirect:()=>dO,Animation:()=>yk,AnimationViewModel:()=>xk,Appearance:()=>io,ApproximateTerrainHeights:()=>li,ArcGISTiledElevationTerrainProvider:()=>IZ,ArcGisBaseMapType:()=>Bh,ArcGisMapServerImageryProvider:()=>ug,ArcGisMapService:()=>$u,ArcType:()=>Jt,ArticulationStageType:()=>pc,AssociativeArray:()=>St,Atmosphere:()=>Cb,AtmospherePipelineStage:()=>zO,AttributeCompression:()=>Mn,AttributeType:()=>on,AutoExposure:()=>RB,AutomaticUniforms:()=>Tp,Axis:()=>Lo,AxisAlignedBoundingBox:()=>$g,B3dmLoader:()=>SO,B3dmParser:()=>CO,BaseLayerPicker:()=>Ek,BaseLayerPickerViewModel:()=>Ak,BatchTable:()=>Rx,BatchTableHierarchy:()=>eb,BatchTexture:()=>Jc,BatchTexturePipelineStage:()=>cM,Billboard:()=>lo,BillboardCollection:()=>Ru,BillboardGraphics:()=>sc,BillboardVisualizer:()=>o1,BingMapsGeocoderService:()=>RZ,BingMapsImageryProvider:()=>r2,BingMapsStyle:()=>KS,BlendEquation:()=>Ra,BlendFunction:()=>Eo,BlendOption:()=>vo,BlendingState:()=>un,BoundingRectangle:()=>je,BoundingSphere:()=>ae,BoundingSphereState:()=>ct,BoundingVolumeSemantics:()=>gb,BoxEmitter:()=>T$,BoxGeometry:()=>Ia,BoxGeometryUpdater:()=>uR,BoxGraphics:()=>kx,BoxOutlineGeometry:()=>Vd,BrdfLutGenerator:()=>N2,Buffer:()=>gt,BufferLoader:()=>sb,BufferUsage:()=>Fe,CPUStylingPipelineStage:()=>dM,CallbackPositionProperty:()=>fR,CallbackProperty:()=>jd,Camera:()=>so,CameraEventAggregator:()=>kB,CameraEventType:()=>Bi,CameraFlightPath:()=>B2,Cartesian2:()=>z,Cartesian3:()=>h,Cartesian4:()=>oe,Cartographic:()=>fe,CartographicGeocoderService:()=>MZ,CatmullRomSpline:()=>LZ,Cesium3DContentGroup:()=>Jx,Cesium3DTile:()=>Qf,Cesium3DTileBatchTable:()=>Kp,Cesium3DTileColorBlendMode:()=>Nl,Cesium3DTileContent:()=>C$,Cesium3DTileContentFactory:()=>Fb,Cesium3DTileContentState:()=>qo,Cesium3DTileContentType:()=>Ds,Cesium3DTileFeature:()=>Ws,Cesium3DTileFeatureTable:()=>oh,Cesium3DTileOptimizationHint:()=>qf,Cesium3DTileOptimizations:()=>GL,Cesium3DTilePass:()=>Vo,Cesium3DTilePassState:()=>yd,Cesium3DTilePointFeature:()=>C_,Cesium3DTileRefine:()=>Wo,Cesium3DTileStyle:()=>vC,Cesium3DTileStyleEngine:()=>KL,Cesium3DTilesInspector:()=>Pk,Cesium3DTilesInspectorViewModel:()=>Ik,Cesium3DTilesVoxelProvider:()=>A$,Cesium3DTileset:()=>xs,Cesium3DTilesetBaseTraversal:()=>tN,Cesium3DTilesetCache:()=>qL,Cesium3DTilesetGraphics:()=>jx,Cesium3DTilesetHeatmap:()=>YL,Cesium3DTilesetMetadata:()=>qb,Cesium3DTilesetMostDetailedTraversal:()=>QL,Cesium3DTilesetSkipTraversal:()=>oN,Cesium3DTilesetStatistics:()=>N_,Cesium3DTilesetTraversal:()=>Zs,Cesium3DTilesetVisualizer:()=>rN,CesiumInspector:()=>Ck,CesiumInspectorViewModel:()=>Tk,CesiumTerrainProvider:()=>xC,CesiumWidget:()=>P3,Check:()=>bo,CheckerboardMaterialProperty:()=>PE,CircleEmitter:()=>W3,CircleGeometry:()=>UZ,CircleOutlineGeometry:()=>zZ,ClassificationModelDrawCommand:()=>oL,ClassificationPipelineStage:()=>lM,ClassificationPrimitive:()=>yA,ClassificationType:()=>Vn,ClearCommand:()=>Jn,ClippingPlane:()=>yb,ClippingPlaneCollection:()=>gs,ClippingPolygon:()=>qA,ClippingPolygonCollection:()=>th,Clock:()=>xh,ClockRange:()=>Yr,ClockStep:()=>po,ClockViewModel:()=>mk,CloudCollection:()=>I$,CloudType:()=>zv,Color:()=>H,ColorBlendMode:()=>mc,ColorGeometryInstanceAttribute:()=>Wt,ColorMaterialProperty:()=>zt,Command:()=>bQ,ComponentDatatype:()=>X,Composite3DTileContent:()=>bR,CompositeEntityCollection:()=>s7,CompositeMaterialProperty:()=>OE,CompositePositionProperty:()=>ma,CompositeProperty:()=>bc,CompressedTextureBuffer:()=>bw,ComputeCommand:()=>kc,ComputeEngine:()=>yw,ConditionsExpression:()=>U3,ConeEmitter:()=>R$,ConstantPositionProperty:()=>qc,ConstantProperty:()=>Kn,ConstantSpline:()=>IO,ContentMetadata:()=>LL,Context:()=>dP,ContextLimits:()=>Nt,CoplanarPolygonGeometry:()=>HN,CoplanarPolygonGeometryLibrary:()=>I_,CoplanarPolygonOutlineGeometry:()=>$f,CornerType:()=>Mi,CorrelationGroup:()=>hO,CorridorGeometry:()=>Qb,CorridorGeometryLibrary:()=>Gi,CorridorGeometryUpdater:()=>mN,CorridorGraphics:()=>Ux,CorridorOutlineGeometry:()=>hN,Credit:()=>Tt,CreditDisplay:()=>z2,CubeMap:()=>Cr,CubeMapFace:()=>Pw,CubicRealPolynomial:()=>_x,CullFace:()=>yi,CullingVolume:()=>_s,CumulusCloud:()=>ff,CustomDataSource:()=>xN,CustomHeightmapTerrainProvider:()=>HZ,CustomShader:()=>fC,CustomShaderMode:()=>x_,CustomShaderPipelineStage:()=>xM,CustomShaderTranslucencyMode:()=>Oy,CylinderGeometry:()=>bN,CylinderGeometryLibrary:()=>Jb,CylinderGeometryUpdater:()=>CN,CylinderGraphics:()=>zx,CylinderOutlineGeometry:()=>TN,CzmlDataSource:()=>ON,DataSource:()=>qr,DataSourceClock:()=>bh,DataSourceCollection:()=>MN,DataSourceDisplay:()=>gF,DebugAppearance:()=>O$,DebugCameraPrimitive:()=>op,DebugInspector:()=>qB,DebugModelMatrixPrimitive:()=>q3,DefaultProxy:()=>GZ,DepthFunction:()=>ac,DepthPlane:()=>Y2,DequantizationPipelineStage:()=>TM,DerivedCommand:()=>rp,DeveloperError:()=>he,DeviceOrientationCameraController:()=>X2,DirectionalLight:()=>M$,DiscardEmptyTileImagePolicy:()=>ZS,DiscardMissingTileImagePolicy:()=>i2,DistanceDisplayCondition:()=>Lt,DistanceDisplayConditionGeometryInstanceAttribute:()=>kn,DoubleEndedPriorityQueue:()=>lC,DoublyLinkedList:()=>jL,DracoLoader:()=>n_,DrawCommand:()=>Ze,DynamicAtmosphereLightingType:()=>a_,DynamicEnvironmentMapManager:()=>c_,DynamicGeometryBatch:()=>sT,DynamicGeometryUpdater:()=>ti,EarthOrientationParameters:()=>uw,EarthOrientationParametersSample:()=>Lg,EasingFunction:()=>Kr,EllipseGeometry:()=>ll,EllipseGeometryLibrary:()=>Xl,EllipseGeometryUpdater:()=>NN,EllipseGraphics:()=>Hx,EllipseOutlineGeometry:()=>Hu,Ellipsoid:()=>ee,EllipsoidGeodesic:()=>kp,EllipsoidGeometry:()=>Qs,EllipsoidGeometryUpdater:()=>BN,EllipsoidGraphics:()=>Gx,EllipsoidOutlineGeometry:()=>Mu,EllipsoidPrimitive:()=>P2,EllipsoidRhumbLine:()=>Oa,EllipsoidSurfaceAppearance:()=>L$,EllipsoidTangentPlane:()=>Jr,EllipsoidTerrainProvider:()=>ep,EllipsoidalOccluder:()=>z_,Empty3DTileContent:()=>gE,EncodedCartesian3:()=>Gn,Entity:()=>tr,EntityCluster:()=>Fu,EntityCollection:()=>$s,EntityView:()=>xF,Event:()=>me,EventHelper:()=>dr,Expression:()=>Mf,ExpressionNodeType:()=>mt,ExtrapolationType:()=>ku,FeatureDetection:()=>Ht,FeatureIdPipelineStage:()=>Ry,Fog:()=>K2,ForEach:()=>Pe,FrameRateMonitor:()=>K3,FrameState:()=>Z2,Framebuffer:()=>Nr,FramebufferManager:()=>hi,FrustumCommands:()=>tB,FrustumGeometry:()=>HT,FrustumOutlineGeometry:()=>W2,Fullscreen:()=>xr,FullscreenButton:()=>Ok,FullscreenButtonViewModel:()=>Rk,GeoJsonDataSource:()=>CF,GeoJsonLoader:()=>vO,GeocodeType:()=>W0,Geocoder:()=>Lk,GeocoderService:()=>Fv,GeocoderViewModel:()=>Mk,GeographicProjection:()=>Di,GeographicTilingScheme:()=>Xi,Geometry:()=>at,Geometry3DTileContent:()=>CR,GeometryAttribute:()=>ve,GeometryAttributes:()=>fn,GeometryFactory:()=>WZ,GeometryInstance:()=>vt,GeometryInstanceAttribute:()=>cc,GeometryOffsetAttribute:()=>sn,GeometryPipeline:()=>Ln,GeometryPipelineStage:()=>SM,GeometryType:()=>Tf,GeometryUpdater:()=>ni,GeometryUpdaterSet:()=>gT,GeometryVisualizer:()=>rF,GetFeatureInfoFormat:()=>kT,Globe:()=>v2,GlobeDepth:()=>nB,GlobeSurfaceShaderSet:()=>n2,GlobeSurfaceTile:()=>pd,GlobeSurfaceTileProvider:()=>_2,GlobeTranslucency:()=>g2,GlobeTranslucencyFramebuffer:()=>iB,GlobeTranslucencyState:()=>$2,GltfBufferViewLoader:()=>PA,GltfDracoLoader:()=>RA,GltfGpmLoader:()=>pO,GltfGpmLocal:()=>XA,GltfImageLoader:()=>OA,GltfIndexBufferLoader:()=>MA,GltfJsonLoader:()=>NA,GltfLoader:()=>f_,GltfLoaderUtil:()=>Vl,GltfMeshPrimitiveGpmLoader:()=>xO,GltfStructuralMetadataLoader:()=>lO,GltfTextureLoader:()=>FA,GltfVertexBufferLoader:()=>BA,GoogleEarthEnterpriseImageryProvider:()=>F$,GoogleEarthEnterpriseMapsProvider:()=>c2,GoogleEarthEnterpriseMetadata:()=>Dg,GoogleEarthEnterpriseTerrainData:()=>Bv,GoogleEarthEnterpriseTerrainProvider:()=>QZ,GoogleEarthEnterpriseTileInformation:()=>M3,GoogleGeocoderService:()=>e$,GoogleMaps:()=>TC,GpxDataSource:()=>vF,GregorianDate:()=>Ap,GridImageryProvider:()=>B$,GridMaterialProperty:()=>HE,GroundGeometryUpdater:()=>Wn,GroundPolylineGeometry:()=>Nx,GroundPolylinePrimitive:()=>Ud,GroundPrimitive:()=>Wc,GroupMetadata:()=>wE,HeadingPitchRange:()=>ld,HeadingPitchRoll:()=>va,Heap:()=>sw,HeightReference:()=>Ye,HeightmapEncoding:()=>dd,HeightmapTerrainData:()=>Ha,HeightmapTessellator:()=>jS,HermitePolynomialApproximation:()=>AN,HermiteSpline:()=>Dy,HilbertOrder:()=>vA,HomeButton:()=>Fk,HomeButtonViewModel:()=>Nk,HorizontalOrigin:()=>gi,I3SBuildingSceneLayerExplorer:()=>IQ,I3SBuildingSceneLayerExplorerViewModel:()=>Bk,I3SDataProvider:()=>Zh,I3SDecoder:()=>Z3,I3SFeature:()=>$3,I3SField:()=>Q3,I3SGeometry:()=>Hv,I3SLayer:()=>RC,I3SNode:()=>Gv,I3SStatistics:()=>tk,I3SSublayer:()=>ik,I3SSymbology:()=>ek,I3dmLoader:()=>DO,I3dmParser:()=>wO,ITwinData:()=>H$,ITwinPlatform:()=>uf,Iau2000Orientation:()=>D2,Iau2006XysData:()=>fw,Iau2006XysSample:()=>dx,IauOrientationAxes:()=>I2,IauOrientationParameters:()=>w2,ImageBasedLighting:()=>Qx,ImageBasedLightingPipelineStage:()=>GO,ImageMaterialProperty:()=>ey,Imagery:()=>nv,ImageryLayer:()=>Wa,ImageryLayerCollection:()=>y2,ImageryLayerFeatureInfo:()=>Fh,ImageryProvider:()=>pl,ImageryState:()=>ai,Implicit3DTileContent:()=>UA,ImplicitAvailabilityBitstream:()=>DA,ImplicitMetadataView:()=>IA,ImplicitSubdivisionScheme:()=>ns,ImplicitSubtree:()=>pb,ImplicitSubtreeCache:()=>H3,ImplicitSubtreeMetadata:()=>AR,ImplicitTileCoordinates:()=>Kb,ImplicitTileset:()=>Xb,IndexDatatype:()=>Ne,InfoBox:()=>Vk,InfoBoxViewModel:()=>kk,InspectorShared:()=>Ya,InstanceAttributeSemantic:()=>os,InstancingPipelineStage:()=>iM,InterpolationAlgorithm:()=>t$,InterpolationType:()=>nh,Intersect:()=>jt,IntersectionTests:()=>$n,Intersections2D:()=>vg,Interval:()=>Da,InvertClassification:()=>hv,Ion:()=>Xd,IonGeocodeProviderType:()=>Ig,IonGeocoderService:()=>CC,IonImageryProvider:()=>fg,IonResource:()=>Cu,IonWorldImageryStyle:()=>dg,Iso8601:()=>He,JobScheduler:()=>Q2,JobType:()=>Na,JsonMetadataTable:()=>l_,JulianDate:()=>Z,KTX2Transcoder:()=>Tw,KeyboardEventModifier:()=>ia,KeyframeNode:()=>eo,KmlCamera:()=>wF,KmlDataSource:()=>JF,KmlLookAt:()=>qF,KmlTour:()=>YF,KmlTourFlyTo:()=>KF,KmlTourWait:()=>ZF,Label:()=>Vy,LabelCollection:()=>wm,LabelGraphics:()=>Hd,LabelStyle:()=>jo,LabelVisualizer:()=>sF,LagrangePolynomialApproximation:()=>EN,LeapSecond:()=>qi,Light:()=>G$,LightingModel:()=>Em,LightingPipelineStage:()=>wM,LinearApproximation:()=>tT,LinearSpline:()=>wy,ManagedArray:()=>Qc,MapMode2D:()=>iu,MapProjection:()=>o$,MapboxImageryProvider:()=>l2,MapboxStyleImageryProvider:()=>W$,Material:()=>Yi,MaterialAppearance:()=>ao,MaterialPipelineStage:()=>IM,MaterialProperty:()=>er,Math:()=>P,Matrix2:()=>Ii,Matrix3:()=>$,Matrix4:()=>F,Megatexture:()=>xv,MeshPrimitiveGpmLocal:()=>yO,MetadataClass:()=>Qd,MetadataClassProperty:()=>ym,MetadataComponentType:()=>Vt,MetadataEntity:()=>Fn,MetadataEnum:()=>YR,MetadataEnumValue:()=>qR,MetadataPicking:()=>J2,MetadataPickingPipelineStage:()=>Du,MetadataPipelineStage:()=>Bf,MetadataSchema:()=>vu,MetadataSchemaLoader:()=>kA,MetadataSemantic:()=>_b,MetadataTable:()=>Bl,MetadataTableProperty:()=>SR,MetadataType:()=>lt,MipmapHint:()=>um,Model:()=>ah,Model3DTileContent:()=>Pu,ModelAlphaOptions:()=>YM,ModelAnimation:()=>MO,ModelAnimationChannel:()=>OO,ModelAnimationCollection:()=>LO,ModelAnimationLoop:()=>zl,ModelAnimationState:()=>rh,ModelArticulation:()=>jO,ModelArticulationStage:()=>WO,ModelClippingPlanesPipelineStage:()=>XO,ModelClippingPolygonsPipelineStage:()=>$O,ModelColorPipelineStage:()=>Py,ModelComponents:()=>xn,ModelDrawCommand:()=>rL,ModelDrawCommands:()=>cL,ModelFeature:()=>NO,ModelFeatureTable:()=>BO,ModelGraphics:()=>Gp,ModelLightingOptions:()=>tL,ModelMatrixUpdateStage:()=>oM,ModelNode:()=>QO,ModelRenderResources:()=>XM,ModelRuntimeNode:()=>sM,ModelRuntimePrimitive:()=>jM,ModelSceneGraph:()=>lL,ModelSilhouettePipelineStage:()=>$M,ModelSkin:()=>qM,ModelSplitterPipelineStage:()=>JM,ModelStatistics:()=>uL,ModelType:()=>ur,ModelUtility:()=>Kt,ModelVisualizer:()=>aF,Moon:()=>O2,MorphTargetsPipelineStage:()=>RM,MorphWeightSpline:()=>r$,MortonOrder:()=>jy,Multiple3DTileContent:()=>BL,MultisampleFramebuffer:()=>hP,NavigationHelpButton:()=>zk,NavigationHelpButtonViewModel:()=>Uk,NearFarScalar:()=>kt,NeverTileDiscardPolicy:()=>q$,NodeRenderResources:()=>eL,NodeStatisticsPipelineStage:()=>rM,NodeTransformationProperty:()=>Wx,OIT:()=>oB,Occluder:()=>M2,OffsetGeometryInstanceAttribute:()=>Ji,OpenCageGeocoderService:()=>a$,OpenStreetMapImageryProvider:()=>Rg,OrderedGroundPrimitiveCollection:()=>LN,OrientedBoundingBox:()=>vn,OrthographicFrustum:()=>rn,OrthographicOffCenterFrustum:()=>Fr,Packable:()=>c$,PackableForInterpolation:()=>l$,Particle:()=>qv,ParticleBurst:()=>X$,ParticleEmitter:()=>K$,ParticleSystem:()=>Z$,Pass:()=>we,PassState:()=>rc,PathGraphics:()=>Wp,PathVisualizer:()=>lF,PeliasGeocoderService:()=>N3,PerInstanceColorAppearance:()=>cn,PerformanceDisplay:()=>_g,PerformanceWatchdog:()=>Gk,PerformanceWatchdogViewModel:()=>Hk,PerspectiveFrustum:()=>wi,PerspectiveOffCenterFrustum:()=>gl,PickDepth:()=>eB,PickDepthFramebuffer:()=>sB,PickFramebuffer:()=>cB,PickedMetadataInfo:()=>y3,Picking:()=>dB,PickingPipelineStage:()=>OM,PinBuilder:()=>ng,PixelDatatype:()=>Ke,PixelFormat:()=>et,Plane:()=>an,PlaneGeometry:()=>kN,PlaneGeometryUpdater:()=>UN,PlaneGraphics:()=>iR,PlaneOutlineGeometry:()=>VN,PntsLoader:()=>dL,PntsParser:()=>Pb,PointCloud:()=>D3,PointCloudEyeDomeLighting:()=>d_,PointCloudShading:()=>Am,PointCloudStylingPipelineStage:()=>LM,PointGraphics:()=>qx,PointPrimitive:()=>Ps,PointPrimitiveCollection:()=>BE,PointVisualizer:()=>fF,PolygonGeometry:()=>s_,PolygonGeometryLibrary:()=>zn,PolygonGeometryUpdater:()=>WN,PolygonGraphics:()=>Gd,PolygonHierarchy:()=>Ma,PolygonOutlineGeometry:()=>GN,PolygonPipeline:()=>ri,Polyline:()=>Gf,PolylineArrowMaterialProperty:()=>WE,PolylineCollection:()=>uh,PolylineColorAppearance:()=>es,PolylineDashMaterialProperty:()=>qE,PolylineGeometry:()=>tg,PolylineGeometryUpdater:()=>mF,PolylineGlowMaterialProperty:()=>XE,PolylineGraphics:()=>lc,PolylineMaterialAppearance:()=>la,PolylineOutlineMaterialProperty:()=>Qy,PolylinePipeline:()=>Oi,PolylineVisualizer:()=>_F,PolylineVolumeGeometry:()=>YN,PolylineVolumeGeometryLibrary:()=>ph,PolylineVolumeGeometryUpdater:()=>$N,PolylineVolumeGraphics:()=>Yx,PolylineVolumeOutlineGeometry:()=>ZN,PositionProperty:()=>zd,PositionPropertyArray:()=>j_,PostProcessStage:()=>ho,PostProcessStageCollection:()=>LB,PostProcessStageComposite:()=>ru,PostProcessStageLibrary:()=>tf,PostProcessStageSampleMode:()=>ef,PostProcessStageTextureCache:()=>eC,PpeMetadata:()=>gO,PpeSource:()=>_Q,PpeTexture:()=>_O,Primitive:()=>Dn,PrimitiveCollection:()=>Yl,PrimitiveLoadPlan:()=>Sb,PrimitiveOutlineGenerator:()=>Eb,PrimitiveOutlinePipelineStage:()=>BM,PrimitivePipeline:()=>Ox,PrimitiveRenderResources:()=>nL,PrimitiveState:()=>Sr,PrimitiveStatisticsPipelineStage:()=>kM,PrimitiveType:()=>Me,ProjectionPicker:()=>jk,ProjectionPickerViewModel:()=>Wk,Property:()=>Y,PropertyArray:()=>ZE,PropertyAttribute:()=>Ab,PropertyAttributeProperty:()=>rO,PropertyBag:()=>Ml,PropertyTable:()=>tl,PropertyTexture:()=>u_,PropertyTextureProperty:()=>oO,ProviderViewModel:()=>us,Proxy:()=>u$,QuadraticRealPolynomial:()=>Vc,QuadtreeOccluders:()=>x2,QuadtreePrimitive:()=>S2,QuadtreeTile:()=>b2,QuadtreeTileLoadState:()=>ea,QuadtreeTileProvider:()=>$$,QuantizedMeshTerrainData:()=>yC,QuarticRealPolynomial:()=>Ew,Quaternion:()=>Oe,QuaternionSpline:()=>RO,Queue:()=>by,Ray:()=>mn,Rectangle:()=>se,RectangleCollisionChecker:()=>xT,RectangleGeometry:()=>fT,RectangleGeometryLibrary:()=>Is,RectangleGeometryUpdater:()=>QN,RectangleGraphics:()=>Wd,RectangleOutlineGeometry:()=>Vb,ReferenceFrame:()=>Ui,ReferenceProperty:()=>q_,RenderState:()=>Ve,Renderbuffer:()=>pu,RenderbufferFormat:()=>zc,Request:()=>Zo,RequestErrorEvent:()=>nm,RequestScheduler:()=>nc,RequestState:()=>Zn,RequestType:()=>ds,Resource:()=>Se,ResourceCache:()=>Ei,ResourceCacheKey:()=>Ul,ResourceCacheStatistics:()=>ZR,ResourceLoader:()=>Ki,ResourceLoaderState:()=>pt,Rotation:()=>nd,RuntimeError:()=>re,S2Cell:()=>Qp,SDFSettings:()=>Xs,SampledPositionProperty:()=>_a,SampledProperty:()=>Uu,Sampler:()=>$t,ScaledPositionProperty:()=>km,Scene:()=>b3,SceneFramebuffer:()=>YT,SceneMode:()=>ne,SceneMode2DPipelineStage:()=>VM,SceneModePicker:()=>Yk,SceneModePickerViewModel:()=>qk,SceneTransforms:()=>zi,SceneTransitioner:()=>BB,ScreenSpaceCameraController:()=>zB,ScreenSpaceEventHandler:()=>of,ScreenSpaceEventType:()=>bn,SelectedFeatureIdPipelineStage:()=>My,SelectionIndicator:()=>Zk,SelectionIndicatorViewModel:()=>Kk,SensorVolumePortionToDisplay:()=>eS,ShaderBuilder:()=>Sx,ShaderCache:()=>aP,ShaderDestination:()=>pe,ShaderFunction:()=>_P,ShaderProgram:()=>Qt,ShaderSource:()=>Ue,ShaderStruct:()=>pP,ShadowMap:()=>xg,ShadowMapShader:()=>cp,ShadowMode:()=>yn,ShadowVolumeAppearance:()=>xu,ShowGeometryInstanceAttribute:()=>gn,Simon1994PlanetaryPositions:()=>jg,SimplePolylineGeometry:()=>f$,SingleTileImageryProvider:()=>u2,SkinningPipelineStage:()=>zM,SkyAtmosphere:()=>T3,SkyBox:()=>C3,SpatialNode:()=>h3,Spdcf:()=>mO,SpecularEnvironmentCubeMap:()=>Yd,SphereEmitter:()=>J$,SphereGeometry:()=>d$,SphereOutlineGeometry:()=>R_,Spherical:()=>SN,Spline:()=>oo,SplitDirection:()=>Br,Splitter:()=>vv,StaticGeometryColorBatch:()=>sd,StaticGeometryPerMaterialBatch:()=>ad,StaticGroundGeometryColorBatch:()=>yS,StaticGroundGeometryPerMaterialBatch:()=>oF,StaticGroundPolylinePerMaterialBatch:()=>pF,StaticOutlineGeometryBatch:()=>TS,StencilConstants:()=>Ut,StencilFunction:()=>Un,StencilOperation:()=>dt,SteppedSpline:()=>PO,Stereographic:()=>hc,StorageType:()=>Ay,StripeMaterialProperty:()=>QE,StripeOrientation:()=>Th,StructuralMetadata:()=>qs,StyleCommandsNeeded:()=>sh,StyleExpression:()=>eQ,Sun:()=>S3,SunLight:()=>Op,SunPostProcess:()=>WB,SupportedImageFormats:()=>uO,SvgPathBindingHandler:()=>dk,TaskProcessor:()=>_i,Terrain:()=>sk,TerrainData:()=>Nh,TerrainEncoding:()=>wc,TerrainFillMesh:()=>sv,TerrainMesh:()=>md,TerrainOffsetProperty:()=>Xx,TerrainProvider:()=>ss,TerrainQuantization:()=>Js,TerrainState:()=>fo,Texture:()=>Pt,TextureAtlas:()=>ky,TextureCache:()=>cP,TextureMagnificationFilter:()=>di,TextureManager:()=>p3,TextureMinificationFilter:()=>Zt,TextureUniform:()=>mQ,TextureWrap:()=>Cn,TileAvailability:()=>jh,TileBoundingRegion:()=>Zf,TileBoundingS2Cell:()=>zL,TileBoundingSphere:()=>O_,TileBoundingVolume:()=>tQ,TileCoordinatesImageryProvider:()=>ck,TileDiscardPolicy:()=>iQ,TileEdge:()=>_n,TileImagery:()=>iv,TileMapServiceImageryProvider:()=>D0,TileMetadata:()=>NL,TileOrientedBoundingBox:()=>Lu,TileProviderError:()=>Io,TileReplacementQueue:()=>T2,TileSelectionResult:()=>Yn,TileState:()=>oQ,Tileset3DTileContent:()=>pL,TilesetMetadata:()=>HL,TilesetPipelineStage:()=>kO,TilingScheme:()=>h$,TimeConstants:()=>qn,TimeDynamicImagery:()=>VT,TimeDynamicPointCloud:()=>Dv,TimeInterval:()=>An,TimeIntervalCollection:()=>jr,TimeIntervalCollectionPositionProperty:()=>Y_,TimeIntervalCollectionProperty:()=>X_,TimeStandard:()=>jn,Timeline:()=>Jk,TimelineHighlightRange:()=>$k,TimelineTrack:()=>Qk,Tipsify:()=>Sw,ToggleButtonViewModel:()=>Z0,Tonemapper:()=>Tg,TrackingReferenceFrame:()=>Bp,Transforms:()=>Mt,TranslationRotationScale:()=>ty,TranslucentTileClassification:()=>lB,TridiagonalSystemSolver:()=>tE,TrustedServers:()=>YC,TweenCollection:()=>oC,UniformState:()=>fP,UniformType:()=>Tv,UrlTemplateImageryProvider:()=>Ga,VERSION:()=>cwt,VRButton:()=>nV,VRButtonViewModel:()=>tV,VRTheWorldTerrainProvider:()=>m$,VaryingType:()=>pQ,Vector3DTileBatch:()=>_m,Vector3DTileClampedPolylines:()=>RL,Vector3DTileContent:()=>ML,Vector3DTileGeometry:()=>$p,Vector3DTilePoints:()=>wL,Vector3DTilePolygons:()=>DL,Vector3DTilePolylines:()=>Nb,Vector3DTilePrimitive:()=>ib,VelocityOrientationProperty:()=>wN,VelocityVectorProperty:()=>K_,VertexArray:()=>ei,VertexArrayFacade:()=>Mp,VertexAttributeSemantic:()=>At,VertexFormat:()=>Ie,VerticalExaggeration:()=>Er,VerticalExaggerationPipelineStage:()=>GM,VerticalOrigin:()=>Rn,VideoSynchronizer:()=>p$,View:()=>ZT,Viewer:()=>FQ,ViewportQuad:()=>rQ,Visibility:()=>_r,Visualizer:()=>dX,VoxelBoxShape:()=>dp,VoxelCell:()=>YB,VoxelContent:()=>G3,VoxelCylinderShape:()=>hp,VoxelEllipsoidShape:()=>cC,VoxelInspector:()=>oV,VoxelInspectorViewModel:()=>iV,VoxelPrimitive:()=>V0,VoxelProvider:()=>aQ,VoxelRenderResources:()=>c3,VoxelShape:()=>cQ,VoxelShapeType:()=>ki,VoxelTraversal:()=>bv,VulkanConstants:()=>_$,WallGeometry:()=>eF,WallGeometryLibrary:()=>dT,WallGeometryUpdater:()=>iF,WallGraphics:()=>jp,WallOutlineGeometry:()=>nF,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>d2,WebMapTileServiceImageryProvider:()=>m2,WebMercatorProjection:()=>Pi,WebMercatorTilingScheme:()=>as,WindingOrder:()=>hs,WireframeIndexGenerator:()=>lE,WireframePipelineStage:()=>WM,_shadersAcesTonemappingStage:()=>hB,_shadersAdditiveBlend:()=>HB,_shadersAdjustTranslucentFS:()=>rA,_shadersAllMaterialAppearanceFS:()=>a1,_shadersAllMaterialAppearanceVS:()=>c1,_shadersAmbientOcclusionGenerate:()=>mB,_shadersAmbientOcclusionModulate:()=>pB,_shadersAspectRampMaterial:()=>h1,_shadersAtmosphereCommon:()=>Bd,_shadersAtmosphereStageFS:()=>VO,_shadersAtmosphereStageVS:()=>UO,_shadersBasicMaterialAppearanceFS:()=>l1,_shadersBasicMaterialAppearanceVS:()=>u1,_shadersBillboardCollectionFS:()=>yP,_shadersBillboardCollectionVS:()=>xP,_shadersBlackAndWhite:()=>_B,_shadersBloomComposite:()=>gB,_shadersBrdfLutGeneratorFS:()=>bP,_shadersBrightPass:()=>GB,_shadersBrightness:()=>yB,_shadersBumpMapMaterial:()=>m1,_shadersCPUStylingStageFS:()=>fM,_shadersCPUStylingStageVS:()=>uM,_shadersCheckerboardMaterial:()=>p1,_shadersCloudCollectionFS:()=>TP,_shadersCloudCollectionVS:()=>CP,_shadersCloudNoiseFS:()=>AP,_shadersCloudNoiseVS:()=>EP,_shadersCompareAndPackTranslucentDepth:()=>SP,_shadersCompositeOITFS:()=>vP,_shadersCompositeTranslucentClassification:()=>KT,_shadersComputeIrradianceFS:()=>wP,_shadersComputeRadianceMapFS:()=>DP,_shadersContrastBias:()=>xB,_shadersConvolveSpecularMapFS:()=>IP,_shadersConvolveSpecularMapVS:()=>PP,_shadersCustomShaderStageFS:()=>mM,_shadersCustomShaderStageVS:()=>hM,_shadersCzmBuiltins:()=>Cx,_shadersDepthOfField:()=>bB,_shadersDepthPlaneFS:()=>RP,_shadersDepthPlaneVS:()=>OP,_shadersDepthView:()=>TB,_shadersDepthViewPacked:()=>hQ,_shadersDotMaterial:()=>_1,_shadersEdgeDetection:()=>CB,_shadersElevationBandMaterial:()=>g1,_shadersElevationContourMaterial:()=>y1,_shadersElevationRampMaterial:()=>x1,_shadersEllipsoidFS:()=>sA,_shadersEllipsoidSurfaceAppearanceFS:()=>Y3,_shadersEllipsoidSurfaceAppearanceVS:()=>X3,_shadersEllipsoidVS:()=>aA,_shadersFXAA:()=>SB,_shadersFXAA3_11:()=>MP,_shadersFadeMaterial:()=>b1,_shadersFeatureIdStageFS:()=>pM,_shadersFeatureIdStageVS:()=>_M,_shadersFilmicTonemapping:()=>AB,_shadersGaussianBlur1D:()=>F0,_shadersGeometryStageFS:()=>CM,_shadersGeometryStageVS:()=>AM,_shadersGlobeFS:()=>LP,_shadersGlobeVS:()=>NP,_shadersGridMaterial:()=>T1,_shadersGroundAtmosphere:()=>cA,_shadersHSBToRGB:()=>ED,_shadersHSLToRGB:()=>SD,_shadersImageBasedLightingStageFS:()=>HO,_shadersInstancingStageCommon:()=>JO,_shadersInstancingStageVS:()=>eM,_shadersIntersectBox:()=>e3,_shadersIntersectClippingPlanes:()=>JB,_shadersIntersectCylinder:()=>t3,_shadersIntersectDepth:()=>QB,_shadersIntersectEllipsoid:()=>n3,_shadersIntersectLongitude:()=>yv,_shadersIntersection:()=>aC,_shadersIntersectionUtils:()=>$B,_shadersLegacyInstancingStageVS:()=>tM,_shadersLensFlare:()=>vB,_shadersLightingStageFS:()=>vM,_shadersMaterialStageFS:()=>DM,_shadersMegatexture:()=>a3,_shadersMetadataStageFS:()=>gM,_shadersMetadataStageVS:()=>yM,_shadersModelClippingPlanesStageFS:()=>YO,_shadersModelClippingPolygonsStageFS:()=>ZO,_shadersModelClippingPolygonsStageVS:()=>KO,_shadersModelColorStageFS:()=>qO,_shadersModelFS:()=>aL,_shadersModelSilhouetteStageFS:()=>KM,_shadersModelSilhouetteStageVS:()=>ZM,_shadersModelSplitterStageFS:()=>QM,_shadersModelVS:()=>sL,_shadersModifiedReinhardTonemapping:()=>wB,_shadersMorphTargetsStageVS:()=>PM,_shadersNightVision:()=>DB,_shadersNormalMapMaterial:()=>C1,_shadersOctree:()=>s3,_shadersPassThrough:()=>ou,_shadersPassThroughDepth:()=>M0,_shadersPbrNeutralTonemapping:()=>EB,_shadersPerInstanceColorAppearanceFS:()=>M1,_shadersPerInstanceColorAppearanceVS:()=>L1,_shadersPerInstanceFlatColorAppearanceFS:()=>Px,_shadersPerInstanceFlatColorAppearanceVS:()=>N1,_shadersPointCloudEyeDomeLighting:()=>bO,_shadersPointCloudStylingStageVS:()=>MM,_shadersPointPrimitiveCollectionFS:()=>qg,_shadersPointPrimitiveCollectionVS:()=>FP,_shadersPolygonSignedDistanceFS:()=>BP,_shadersPolylineArrowMaterial:()=>A1,_shadersPolylineColorAppearanceVS:()=>W1,_shadersPolylineCommon:()=>_u,_shadersPolylineDashMaterial:()=>E1,_shadersPolylineFS:()=>vx,_shadersPolylineGlowMaterial:()=>S1,_shadersPolylineMaterialAppearanceVS:()=>j1,_shadersPolylineOutlineMaterial:()=>v1,_shadersPolylineShadowVolumeFS:()=>kP,_shadersPolylineShadowVolumeMorphFS:()=>VP,_shadersPolylineShadowVolumeMorphVS:()=>UP,_shadersPolylineShadowVolumeVS:()=>zP,_shadersPolylineVS:()=>HP,_shadersPrimitiveOutlineStageFS:()=>FM,_shadersPrimitiveOutlineStageVS:()=>NM,_shadersRGBToHSB:()=>vD,_shadersRGBToHSL:()=>wD,_shadersRGBToXYZ:()=>DD,_shadersReinhardTonemapping:()=>IB,_shadersReprojectWebMercatorFS:()=>GP,_shadersReprojectWebMercatorVS:()=>WP,_shadersRimLightingMaterial:()=>w1,_shadersSelectedFeatureIdStageCommon:()=>cE,_shadersShadowVolumeAppearanceFS:()=>lA,_shadersShadowVolumeAppearanceVS:()=>jP,_shadersShadowVolumeFS:()=>Yg,_shadersSilhouette:()=>PB,_shadersSkinningStageVS:()=>UM,_shadersSkyAtmosphereCommon:()=>uA,_shadersSkyAtmosphereFS:()=>qP,_shadersSkyAtmosphereVS:()=>YP,_shadersSkyBoxFS:()=>XP,_shadersSkyBoxVS:()=>KP,_shadersSlopeRampMaterial:()=>D1,_shadersStripeMaterial:()=>I1,_shadersSunFS:()=>ZP,_shadersSunTextureFS:()=>$P,_shadersSunVS:()=>QP,_shadersTexturedMaterialAppearanceFS:()=>f1,_shadersTexturedMaterialAppearanceVS:()=>d1,_shadersVector3DTileClampedPolylinesFS:()=>JP,_shadersVector3DTileClampedPolylinesVS:()=>e1,_shadersVector3DTilePolylinesVS:()=>t1,_shadersVectorTileVS:()=>fA,_shadersVerticalExaggerationStageVS:()=>HM,_shadersViewportQuadFS:()=>n1,_shadersViewportQuadVS:()=>hx,_shadersVoxelFS:()=>KB,_shadersVoxelUtils:()=>XB,_shadersVoxelVS:()=>ZB,_shadersWater:()=>R1,_shadersWaterMaskMaterial:()=>P1,_shadersXYZToRGB:()=>ID,_shadersacesTonemapping:()=>PD,_shadersalphaWeight:()=>RD,_shadersantialias:()=>OD,_shadersapplyHSBShift:()=>MD,_shadersapproximateSphericalCoordinates:()=>LD,_shadersapproximateTanh:()=>ND,_shadersbackFacing:()=>FD,_shadersbranchFreeTernary:()=>BD,_shaderscascadeColor:()=>kD,_shaderscascadeDistance:()=>VD,_shaderscascadeMatrix:()=>UD,_shaderscascadeWeights:()=>zD,_shadersclipPolygons:()=>HD,_shaderscolumbusViewMorph:()=>GD,_shaderscomputeAtmosphereColor:()=>WD,_shaderscomputeGroundAtmosphereScattering:()=>jD,_shaderscomputePosition:()=>qD,_shaderscomputeScattering:()=>YD,_shadersconvertUvToBox:()=>i3,_shadersconvertUvToCylinder:()=>o3,_shadersconvertUvToEllipsoid:()=>r3,_shaderscosineAndSine:()=>XD,_shadersdecompressTextureCoordinates:()=>KD,_shadersdegreesPerRadian:()=>Ow,_shadersdepthClamp:()=>ZD,_shadersdepthRange:()=>Mw,_shadersdepthRangeStruct:()=>_D,_shaderseastNorthUpToEyeCoordinates:()=>$D,_shadersellipsoidContainsPoint:()=>QD,_shadersellipsoidTextureCoordinates:()=>JD,_shadersepsilon1:()=>Lw,_shadersepsilon2:()=>Nw,_shadersepsilon3:()=>Fw,_shadersepsilon4:()=>Bw,_shadersepsilon5:()=>kw,_shadersepsilon6:()=>Vw,_shadersepsilon7:()=>Uw,_shadersequalsEpsilon:()=>eI,_shaderseyeOffset:()=>tI,_shaderseyeToWindowCoordinates:()=>nI,_shadersfastApproximateAtan:()=>iI,_shadersfog:()=>oI,_shadersgammaCorrect:()=>rI,_shadersgeodeticSurfaceNormal:()=>sI,_shadersgetDefaultMaterial:()=>aI,_shadersgetDynamicAtmosphereLightDirection:()=>cI,_shadersgetLambertDiffuse:()=>lI,_shadersgetSpecular:()=>uI,_shadersgetWaterNoise:()=>fI,_shadershue:()=>dI,_shadersinfinity:()=>zw,_shadersinverseGamma:()=>hI,_shadersisEmpty:()=>mI,_shadersisFull:()=>pI,_shaderslatitudeToWebMercatorFraction:()=>_I,_shaderslineDistance:()=>gI,_shaderslinearToSrgb:()=>yI,_shadersluminance:()=>xI,_shadersmaterial:()=>gD,_shadersmaterialInput:()=>yD,_shadersmaximumComponent:()=>bI,_shadersmetersPerPixel:()=>TI,_shadersmodelMaterial:()=>xD,_shadersmodelToWindowCoordinates:()=>CI,_shadersmodelVertexOutput:()=>bD,_shadersmultiplyWithColorBalance:()=>AI,_shadersnearFarScalar:()=>EI,_shadersoctDecode:()=>SI,_shadersoneOverPi:()=>Hw,_shadersoneOverTwoPi:()=>Gw,_shaderspackDepth:()=>vI,_shaderspassCesium3DTile:()=>Ww,_shaderspassCesium3DTileClassification:()=>jw,_shaderspassCesium3DTileClassificationIgnoreShow:()=>qw,_shaderspassClassification:()=>Yw,_shaderspassCompute:()=>Xw,_shaderspassEnvironment:()=>Kw,_shaderspassGlobe:()=>Zw,_shaderspassOpaque:()=>$w,_shaderspassOverlay:()=>Qw,_shaderspassTerrainClassification:()=>Jw,_shaderspassTranslucent:()=>eD,_shaderspassVoxels:()=>tD,_shaderspbrLighting:()=>wI,_shaderspbrNeutralTonemapping:()=>DI,_shadersphong:()=>II,_shaderspi:()=>nD,_shaderspiOverFour:()=>iD,_shaderspiOverSix:()=>oD,_shaderspiOverThree:()=>rD,_shaderspiOverTwo:()=>sD,_shadersplaneDistance:()=>PI,_shaderspointAlongRay:()=>RI,_shadersradiansPerDegree:()=>aD,_shadersray:()=>TD,_shadersrayEllipsoidIntersectionInterval:()=>OI,_shadersraySegment:()=>CD,_shadersraySphereIntersectionInterval:()=>MI,_shadersreadDepth:()=>LI,_shadersreadNonPerspective:()=>NI,_shadersreverseLogDepth:()=>FI,_shadersround:()=>BI,_shaderssaturation:()=>kI,_shaderssceneMode2D:()=>cD,_shaderssceneMode3D:()=>lD,_shaderssceneModeColumbusView:()=>uD,_shaderssceneModeMorphing:()=>fD,_shadersshadowDepthCompare:()=>VI,_shadersshadowParameters:()=>AD,_shadersshadowVisibility:()=>UI,_shaderssignNotZero:()=>zI,_shaderssolarRadius:()=>dD,_shaderssphericalHarmonics:()=>HI,_shaderssrgbToLinear:()=>GI,_shaderstangentToEyeSpaceMatrix:()=>WI,_shaderstextureCube:()=>jI,_shadersthreePiOver2:()=>hD,_shaderstransformPlane:()=>qI,_shaderstranslateRelativeToEye:()=>YI,_shaderstranslucentPhong:()=>XI,_shaderstranspose:()=>KI,_shaderstwoPi:()=>mD,_shadersunpackClippingExtents:()=>ZI,_shadersunpackDepth:()=>$I,_shadersunpackFloat:()=>QI,_shadersunpackUint:()=>JI,_shadersvalueTransform:()=>eP,_shadersvertexLogDepth:()=>tP,_shaderswebMercatorMaxLatitude:()=>pD,_shaderswindowToEyeCoordinates:()=>nP,_shaderswriteDepthClamp:()=>iP,_shaderswriteLogDepth:()=>oP,_shaderswriteNonPerspective:()=>rP,addBuffer:()=>kR,addDefaults:()=>PR,addExtensionsRequired:()=>NR,addExtensionsUsed:()=>Lf,addPipelineExtras:()=>dy,addToArray:()=>vs,appendForwardSlash:()=>nw,arrayRemoveDuplicates:()=>Co,barycentricCoordinates:()=>px,binarySearch:()=>Oo,buildModuleUrl:()=>nn,buildVoxelDrawCommands:()=>u3,clone:()=>Ge,combine:()=>bt,computeFlyToLocationForRectangle:()=>NT,createBillboardPointCallback:()=>Rb,createCommand:()=>En,createDefaultImageryProviderViewModels:()=>Sk,createDefaultTerrainProviderViewModels:()=>vk,createElevationBandMaterial:()=>lQ,createGooglePhotorealistic3DTileset:()=>uQ,createGuid:()=>Hn,createMaterialPropertyDescriptor:()=>Mo,createOsmBuildingsAsync:()=>fQ,createPropertyDescriptor:()=>le,createRawPropertyDescriptor:()=>Yc,createTangentSpaceDebugPrimitive:()=>dQ,createTaskProcessorWorker:()=>gQ,createUniform:()=>pw,createUniformArray:()=>_w,createWorldBathymetryAsync:()=>B3,createWorldImageryAsync:()=>hg,createWorldTerrainAsync:()=>EC,decodeGoogleEarthEnterpriseData:()=>k3,decodeVectorPolylinePositions:()=>OL,defaultValue:()=>y,defer:()=>vl,defined:()=>l,demodernizeShader:()=>sP,deprecationWarning:()=>ms,destroyObject:()=>ue,exportKml:()=>gX,findAccessorMinMax:()=>fb,findContentMetadata:()=>Bb,findGroupMetadata:()=>kb,findTileMetadata:()=>FL,forEachTextureInMaterial:()=>LA,formatError:()=>Qm,freezeRenderState:()=>r6,getAbsoluteUri:()=>em,getAccessorByteStride:()=>kl,getBaseUri:()=>iw,getBinaryAccessor:()=>Au,getClipAndStyleCode:()=>v3,getClippingFunction:()=>lg,getComponentReader:()=>o_,getElement:()=>In,getExtensionFromUri:()=>ox,getFilenameFromUri:()=>G_,getImageFromTypedArray:()=>m3,getImagePixels:()=>Id,getJsonFromTypedArray:()=>No,getMagic:()=>Kd,getMetadataClassProperty:()=>g3,getMetadataProperty:()=>x3,getStringFromTypedArray:()=>Ll,getTimestamp:()=>bi,hasExtension:()=>ii,heightReferenceOnEntityPropertyChanged:()=>qp,isBitSet:()=>Oc,isBlobUri:()=>rx,isCrossOriginUrl:()=>Fg,isDataUri:()=>Ep,isLeapYear:()=>Dd,knockout:()=>be,knockout_3_5_1:()=>MC,knockout_es5:()=>fk,loadAndExecuteScript:()=>sx,loadCubeMap:()=>gP,loadImageFromTypedArray:()=>cb,loadKTX2:()=>Dl,mergeSort:()=>pg,moveTechniqueRenderStates:()=>LR,moveTechniquesToExtension:()=>FR,numberOfComponentsForType:()=>Su,objectToQuery:()=>ax,oneTimeWarning:()=>yt,parseBatchTable:()=>p_,parseFeatureMetadataLegacy:()=>cO,parseGlb:()=>OR,parseResponseHeaders:()=>ow,parseStructuralMetadata:()=>aO,pickModel:()=>dE,pointInsideTriangle:()=>y$,preprocess3DTileContent:()=>Pm,processVoxelProperties:()=>l3,queryToObject:()=>fu,readAccessorPacked:()=>VR,removeExtension:()=>db,removeExtensionsRequired:()=>RR,removeExtensionsUsed:()=>ub,removePipelineExtras:()=>MR,removeUnusedElements:()=>BR,resizeImageToNextPowerOfTwo:()=>py,sampleTerrain:()=>t2,sampleTerrainMostDetailed:()=>LT,scaleToGeodeticSurface:()=>ix,srgbToLinear:()=>SC,subdivideArray:()=>k1,subscribeAndEvaluate:()=>Ca,updateAccessorComponentTypes:()=>UR,updateVersion:()=>zR,usesExtension:()=>lr,viewerCesium3DTilesInspectorMixin:()=>BQ,viewerCesiumInspectorMixin:()=>kQ,viewerDragDropMixin:()=>UQ,viewerPerformanceWatchdogMixin:()=>zQ,viewerVoxelInspectorMixin:()=>HQ,webGLConstantToGlslType:()=>x$,wrapFunction:()=>V3,writeTextToCanvas:()=>Mb});module.exports=Jh(lwt);function YEe(e){return e!=null}var l=YEe;function tx(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(tx.prototype=Object.create(Error.prototype),tx.prototype.constructor=tx);tx.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};tx.throwInstantiationError=function(){throw new tx("This function defines an interface and should not be called directly.")};var he=tx;var Es={};Es.typeOf={};function XEe(e){return`${e} is required, actual value was undefined`}function BC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Es.defined=function(e,t){if(!l(t))throw new he(XEe(e))};Es.typeOf.func=function(e,t){if(typeof t!="function")throw new he(BC(typeof t,"function",e))};Es.typeOf.string=function(e,t){if(typeof t!="string")throw new he(BC(typeof t,"string",e))};Es.typeOf.number=function(e,t){if(typeof t!="number")throw new he(BC(typeof t,"number",e))};Es.typeOf.number.lessThan=function(e,t,n){if(Es.typeOf.number(e,t),t>=n)throw new he(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Es.typeOf.number.lessThanOrEquals=function(e,t,n){if(Es.typeOf.number(e,t),t>n)throw new he(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Es.typeOf.number.greaterThan=function(e,t,n){if(Es.typeOf.number(e,t),t<=n)throw new he(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Es.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Es.typeOf.number(e,t),t<n)throw new he(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};Es.typeOf.object=function(e,t){if(typeof t!="object")throw new he(BC(typeof t,"object",e))};Es.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new he(BC(typeof t,"boolean",e))};Es.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new he(BC(typeof t,"bigint",e))};Es.typeOf.number.equals=function(e,t,n,i){if(Es.typeOf.number(e,n),Es.typeOf.number(t,i),n!==i)throw new he(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var bo=Es;function YQ(e,t){return e??t}YQ.EMPTY_OBJECT=Object.freeze({});var y=YQ;var _5=Ko(sV(),1);var st={};st.EPSILON1=.1;st.EPSILON2=.01;st.EPSILON3=.001;st.EPSILON4=1e-4;st.EPSILON5=1e-5;st.EPSILON6=1e-6;st.EPSILON7=1e-7;st.EPSILON8=1e-8;st.EPSILON9=1e-9;st.EPSILON10=1e-10;st.EPSILON11=1e-11;st.EPSILON12=1e-12;st.EPSILON13=1e-13;st.EPSILON14=1e-14;st.EPSILON15=1e-15;st.EPSILON16=1e-16;st.EPSILON17=1e-17;st.EPSILON18=1e-18;st.EPSILON19=1e-19;st.EPSILON20=1e-20;st.EPSILON21=1e-21;st.GRAVITATIONALPARAMETER=3986004418e5;st.SOLAR_RADIUS=6955e5;st.LUNAR_RADIUS=1737400;st.SIXTY_FOUR_KILOBYTES=64*1024;st.FOUR_GIGABYTES=4*1024*1024*1024;st.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});st.signNotZero=function(e){return e<0?-1:1};st.toSNorm=function(e,t){return t=y(t,255),Math.round((st.clamp(e,-1,1)*.5+.5)*t)};st.fromSNorm=function(e,t){return t=y(t,255),st.clamp(e,0,t)/t*2-1};st.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:st.clamp((e-t)/n,0,1)};st.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});st.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});st.lerp=function(e,t,n){return(1-n)*e+n*t};st.PI=Math.PI;st.ONE_OVER_PI=1/Math.PI;st.PI_OVER_TWO=Math.PI/2;st.PI_OVER_THREE=Math.PI/3;st.PI_OVER_FOUR=Math.PI/4;st.PI_OVER_SIX=Math.PI/6;st.THREE_PI_OVER_TWO=3*Math.PI/2;st.TWO_PI=2*Math.PI;st.ONE_OVER_TWO_PI=1/(2*Math.PI);st.RADIANS_PER_DEGREE=Math.PI/180;st.DEGREES_PER_RADIAN=180/Math.PI;st.RADIANS_PER_ARCSECOND=st.RADIANS_PER_DEGREE/3600;st.toRadians=function(e){return e*st.RADIANS_PER_DEGREE};st.toDegrees=function(e){return e*st.DEGREES_PER_RADIAN};st.convertLongitudeRange=function(e){let t=st.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};st.clampToLatitudeRange=function(e){return st.clamp(e,-1*st.PI_OVER_TWO,st.PI_OVER_TWO)};st.negativePiToPi=function(e){return e>=-st.PI&&e<=st.PI?e:st.zeroToTwoPi(e+st.PI)-st.PI};st.zeroToTwoPi=function(e){if(e>=0&&e<=st.TWO_PI)return e;let t=st.mod(e,st.TWO_PI);return Math.abs(t)<st.EPSILON14&&Math.abs(e)>st.EPSILON14?st.TWO_PI:t};st.mod=function(e,t){return st.sign(e)===st.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};st.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};st.lessThan=function(e,t,n){return e-t<-n};st.lessThanOrEquals=function(e,t,n){return e-t<n};st.greaterThan=function(e,t,n){return e-t>n};st.greaterThanOrEquals=function(e,t,n){return e-t>-n};var aV=[1];st.factorial=function(e){let t=aV.length;if(e>=t){let n=aV[t-1];for(let i=t;i<=e;i++){let o=n*i;aV.push(o),n=o}}return aV[e]};st.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};st.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};st.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};st.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};st.clamp=function(e,t,n){return e<t?t:e>n?n:e};var KQ=new _5.default;st.setRandomNumberSeed=function(e){KQ=new _5.default(e)};st.nextRandomNumber=function(){return KQ.random()};st.randomBetween=function(e,t){return st.nextRandomNumber()*(t-e)+e};st.acosClamped=function(e){return Math.acos(st.clamp(e,-1,1))};st.asinClamped=function(e){return Math.asin(st.clamp(e,-1,1))};st.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};st.logBase=function(e,t){return Math.log(e)/Math.log(t)};st.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});st.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});st.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};st.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};st.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=st.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?st.PI_OVER_TWO-i:i,i=e<0?st.PI-i:i,i=t<0?-i:i,i};var P=st;function $e(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}$e.fromSpherical=function(e,t){l(t)||(t=new $e);let n=e.clock,i=e.cone,o=y(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};$e.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new $e(e,t,n)};$e.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new $e(e.x,e.y,e.z)};$e.fromCartesian4=$e.clone;$e.packedLength=3;$e.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};$e.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new $e),n.x=e[t++],n.y=e[t++],n.z=e[t],n};$e.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)$e.pack(e[o],t,o*3);return t};$e.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=$e.unpack(e,i,t[o])}return t};$e.fromArray=$e.unpack;$e.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};$e.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};$e.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};$e.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};$e.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};$e.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};$e.magnitude=function(e){return Math.sqrt($e.magnitudeSquared(e))};var lV=new $e;$e.distance=function(e,t){return $e.subtract(e,t,lV),$e.magnitude(lV)};$e.distanceSquared=function(e,t){return $e.subtract(e,t,lV),$e.magnitudeSquared(lV)};$e.normalize=function(e,t){let n=$e.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};$e.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};$e.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};$e.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};$e.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};$e.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};$e.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};$e.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};$e.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};$e.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var ZQ=new $e;$e.lerp=function(e,t,n,i){return $e.multiplyByScalar(t,n,ZQ),i=$e.multiplyByScalar(e,1-n,i),$e.add(ZQ,i,i)};var cV=new $e,g5=new $e;$e.angleBetween=function(e,t){$e.normalize(e,cV),$e.normalize(t,g5);let n=$e.dot(cV,g5),i=$e.magnitude($e.cross(cV,g5,cV));return Math.atan2(i,n)};var KEe=new $e;$e.mostOrthogonalAxis=function(e,t){let n=$e.normalize(e,KEe);return $e.abs(n,n),n.x<=n.y?n.x<=n.z?t=$e.clone($e.UNIT_X,t):t=$e.clone($e.UNIT_Z,t):n.y<=n.z?t=$e.clone($e.UNIT_Y,t):t=$e.clone($e.UNIT_Z,t),t};$e.projectVector=function(e,t,n){let i=$e.dot(e,t)/$e.dot(t,t);return $e.multiplyByScalar(t,i,n)};$e.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};$e.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};$e.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)};$e.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,u=o*c-r*a,f=r*s-i*c,d=i*a-o*s;return n.x=u,n.y=f,n.z=d,n};$e.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};$e.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(e),t=P.toRadians(t),$e.fromRadians(e,t,n,i,o)};var yf=new $e,kC=new $e;$e._ellipsoidRadiiSquared=new $e(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);$e.fromRadians=function(e,t,n,i,o){n=y(n,0);let r=l(i)?i.radiiSquared:$e._ellipsoidRadiiSquared,s=Math.cos(t);yf.x=s*Math.cos(e),yf.y=s*Math.sin(e),yf.z=Math.sin(t),yf=$e.normalize(yf,yf),$e.multiplyComponents(r,yf,kC);let a=Math.sqrt($e.dot(yf,kC));return kC=$e.divideByScalar(kC,a,kC),yf=$e.multiplyByScalar(yf,n,yf),l(o)||(o=new $e),$e.add(kC,yf,o)};$e.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=$e.fromDegrees(r,s,0,t,n[a])}return n};$e.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=$e.fromRadians(r,s,0,t,n[a])}return n};$e.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=$e.fromDegrees(r,s,a,t,n[c])}return n};$e.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=$e.fromRadians(r,s,a,t,n[c])}return n};$e.ZERO=Object.freeze(new $e(0,0,0));$e.ONE=Object.freeze(new $e(1,1,1));$e.UNIT_X=Object.freeze(new $e(1,0,0));$e.UNIT_Y=Object.freeze(new $e(0,1,0));$e.UNIT_Z=Object.freeze(new $e(0,0,1));$e.prototype.clone=function(e){return $e.clone(this,e)};$e.prototype.equals=function(e){return $e.equals(this,e)};$e.prototype.equalsEpsilon=function(e,t,n){return $e.equalsEpsilon(this,e,t,n)};$e.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var h=$e;function xt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}xt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new xt(e,t,n,i)};xt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new xt(e.red,e.green,e.blue,e.alpha)};xt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new xt(e.x,e.y,e.z,e.w)};xt.packedLength=4;xt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};xt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new xt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};xt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)xt.pack(e[o],t,o*4);return t};xt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=xt.unpack(e,i,t[o])}return t};xt.fromArray=xt.unpack;xt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};xt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};xt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};xt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};xt.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z),a=P.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};xt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};xt.magnitude=function(e){return Math.sqrt(xt.magnitudeSquared(e))};var uV=new xt;xt.distance=function(e,t){return xt.subtract(e,t,uV),xt.magnitude(uV)};xt.distanceSquared=function(e,t){return xt.subtract(e,t,uV),xt.magnitudeSquared(uV)};xt.normalize=function(e,t){let n=xt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};xt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};xt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};xt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};xt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};xt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};xt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};xt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};xt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};xt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var $Q=new xt;xt.lerp=function(e,t,n,i){return xt.multiplyByScalar(t,n,$Q),i=xt.multiplyByScalar(e,1-n,i),xt.add($Q,i,i)};var ZEe=new xt;xt.mostOrthogonalAxis=function(e,t){let n=xt.normalize(e,ZEe);return xt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=xt.clone(xt.UNIT_X,t):t=xt.clone(xt.UNIT_W,t):n.z<=n.w?t=xt.clone(xt.UNIT_Z,t):t=xt.clone(xt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=xt.clone(xt.UNIT_Y,t):t=xt.clone(xt.UNIT_W,t):n.z<=n.w?t=xt.clone(xt.UNIT_Z,t):t=xt.clone(xt.UNIT_W,t),t};xt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};xt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};xt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)&&P.equalsEpsilon(e.w,t.w,n,i)};xt.ZERO=Object.freeze(new xt(0,0,0,0));xt.ONE=Object.freeze(new xt(1,1,1,1));xt.UNIT_X=Object.freeze(new xt(1,0,0,0));xt.UNIT_Y=Object.freeze(new xt(0,1,0,0));xt.UNIT_Z=Object.freeze(new xt(0,0,1,0));xt.UNIT_W=Object.freeze(new xt(0,0,0,1));xt.prototype.clone=function(e){return xt.clone(this,e)};xt.prototype.equals=function(e){return xt.equals(this,e)};xt.prototype.equalsEpsilon=function(e,t,n){return xt.equalsEpsilon(this,e,t,n)};xt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var y5=new Float32Array(1),Ja=new Uint8Array(y5.buffer),$Ee=new Uint32Array([287454020]),QEe=new Uint8Array($Ee.buffer),QQ=QEe[0]===68;xt.packFloat=function(e,t){return l(t)||(t=new xt),y5[0]=e,QQ?(t.x=Ja[0],t.y=Ja[1],t.z=Ja[2],t.w=Ja[3]):(t.x=Ja[3],t.y=Ja[2],t.z=Ja[1],t.w=Ja[0]),t};xt.unpackFloat=function(e){return QQ?(Ja[0]=e.x,Ja[1]=e.y,Ja[2]=e.z,Ja[3]=e.w):(Ja[0]=e.w,Ja[1]=e.z,Ja[2]=e.y,Ja[3]=e.x),y5[0]};var oe=xt;function Je(e,t,n,i,o,r,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(o,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(r,0),this[8]=y(c,0)}Je.packedLength=9;Je.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};Je.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Je),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};Je.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Je.pack(e[o],t,o*9);return t};Je.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=Je.unpack(e,i,t[o])}return t};Je.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new Je(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};Je.fromArray=Je.unpack;Je.fromColumnMajorArray=function(e,t){return Je.clone(e,t)};Je.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new Je(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Je.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,d=e.w*e.w,p=n-s-u+d,g=2*(i-f),m=2*(o+c),x=2*(i+f),b=-n+s-u+d,T=2*(a-r),C=2*(o-c),A=2*(a+r),E=-n-s+u+d;return l(t)?(t[0]=p,t[1]=x,t[2]=C,t[3]=g,t[4]=b,t[5]=A,t[6]=m,t[7]=T,t[8]=E,t):new Je(p,g,m,x,b,T,C,A,E)};Je.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,u=-o*s+a*r*i,f=a*s+o*r*i,d=n*s,p=o*i+a*r*s,g=-a*i+o*r*s,m=-r,x=a*n,b=o*n;return l(t)?(t[0]=c,t[1]=d,t[2]=m,t[3]=u,t[4]=p,t[5]=x,t[6]=f,t[7]=g,t[8]=b,t):new Je(c,u,f,d,p,g,m,x,b)};Je.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new Je(e.x,0,0,0,e.y,0,0,0,e.z)};Je.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new Je(e,0,0,0,e,0,0,0,e)};Je.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new Je(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};Je.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new Je(1,0,0,0,n,-i,0,i,n)};Je.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new Je(n,0,i,0,1,0,-i,0,n)};Je.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Je(n,-i,0,i,n,0,0,0,1)};Je.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};Je.getElementIndex=function(e,t){return e*3+t};Je.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};Je.setColumn=function(e,t,n,i){i=Je.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};Je.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};Je.setRow=function(e,t,n,i){return i=Je.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var JEe=new h;Je.setScale=function(e,t,n){let i=Je.getScale(e,JEe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var eSe=new h;Je.setUniformScale=function(e,t,n){let i=Je.getScale(e,eSe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var x5=new h;Je.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],x5)),t.y=h.magnitude(h.fromElements(e[3],e[4],e[5],x5)),t.z=h.magnitude(h.fromElements(e[6],e[7],e[8],x5)),t};var JQ=new h;Je.getMaximumScale=function(e){return Je.getScale(e,JQ),h.maximumComponent(JQ)};var tSe=new h;Je.setRotation=function(e,t,n){let i=Je.getScale(e,tSe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var nSe=new h;Je.getRotation=function(e,t){let n=Je.getScale(e,nSe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};Je.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n};Je.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};Je.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};Je.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};Je.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};Je.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};Je.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};Je.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};Je.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=f,t};function iSe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var b5=[1,0,0],T5=[2,2,1];function oSe(e){let t=0;for(let n=0;n<3;++n){let i=e[Je.getElementIndex(T5[n],b5[n])];t+=2*i*i}return Math.sqrt(t)}function rSe(e,t){let n=P.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[Je.getElementIndex(T5[u],b5[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=b5[o],c=T5[o];if(Math.abs(e[Je.getElementIndex(c,a)])>n){let u=e[Je.getElementIndex(c,c)],f=e[Je.getElementIndex(a,a)],d=e[Je.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=Je.clone(Je.IDENTITY,t),t[Je.getElementIndex(a,a)]=t[Je.getElementIndex(c,c)]=r,t[Je.getElementIndex(c,a)]=s,t[Je.getElementIndex(a,c)]=-s,t}var fV=new Je,eJ=new Je;Je.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=Je.clone(Je.IDENTITY,t.unitary),a=t.diagonal=Je.clone(e,t.diagonal),c=n*iSe(a);for(;r<i&&oSe(a)>c;)rSe(a,fV),Je.transpose(fV,eJ),Je.multiply(a,fV,a),Je.multiply(eJ,a,a),Je.multiply(s,fV,s),++o>2&&(++r,o=0);return t};Je.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};Je.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};Je.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=Je.determinant(e);t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=c*a-r*f,t[4]=n*f-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let p=1/d;return Je.multiplyByScalar(t,p,t)};var sSe=new Je;Je.inverseTranspose=function(e,t){return Je.inverse(Je.transpose(e,sSe),t)};Je.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};Je.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};Je.IDENTITY=Object.freeze(new Je(1,0,0,0,1,0,0,0,1));Je.ZERO=Object.freeze(new Je(0,0,0,0,0,0,0,0,0));Je.COLUMN0ROW0=0;Je.COLUMN0ROW1=1;Je.COLUMN0ROW2=2;Je.COLUMN1ROW0=3;Je.COLUMN1ROW1=4;Je.COLUMN1ROW2=5;Je.COLUMN2ROW0=6;Je.COLUMN2ROW1=7;Je.COLUMN2ROW2=8;Object.defineProperties(Je.prototype,{length:{get:function(){return Je.packedLength}}});Je.prototype.clone=function(e){return Je.clone(this,e)};Je.prototype.equals=function(e){return Je.equals(this,e)};Je.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};Je.prototype.equalsEpsilon=function(e,t){return Je.equalsEpsilon(this,e,t)};Je.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f}();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIE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AAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}])})});var mwt={};jQ(mwt,{AlphaMode:()=>bm,AlphaPipelineStage:()=>MO,AnchorPointDirect:()=>BR,AnchorPointIndirect:()=>kR,Animation:()=>yk,AnimationViewModel:()=>xk,Appearance:()=>io,ApproximateTerrainHeights:()=>li,ArcGISTiledElevationTerrainProvider:()=>PZ,ArcGisBaseMapType:()=>Fh,ArcGisMapServerImageryProvider:()=>lg,ArcGisMapService:()=>$u,ArcType:()=>Qt,ArticulationStageType:()=>_c,AssociativeArray:()=>Et,Atmosphere:()=>yb,AtmospherePipelineStage:()=>hO,AttributeCompression:()=>Mn,AttributeType:()=>tn,AutoExposure:()=>xB,AutomaticUniforms:()=>xp,Axis:()=>No,AxisAlignedBoundingBox:()=>Xg,B3dmLoader:()=>$R,B3dmParser:()=>XR,BaseLayerPicker:()=>Tk,BaseLayerPickerViewModel:()=>bk,BatchTable:()=>vx,BatchTableHierarchy:()=>Zx,BatchTexture:()=>el,BatchTexturePipelineStage:()=>LO,Billboard:()=>uo,BillboardCollection:()=>Ru,BillboardGraphics:()=>ac,BillboardVisualizer:()=>xP,BingMapsGeocoderService:()=>OZ,BingMapsImageryProvider:()=>VF,BingMapsStyle:()=>jS,BlendEquation:()=>Ma,BlendFunction:()=>Eo,BlendOption:()=>vo,BlendingState:()=>ln,BoundingRectangle:()=>je,BoundingSphere:()=>ae,BoundingSphereState:()=>at,BoundingVolumeSemantics:()=>hb,BoxEmitter:()=>C$,BoxGeometry:()=>Ra,BoxGeometryUpdater:()=>P1,BoxGraphics:()=>Lx,BoxOutlineGeometry:()=>Bd,BrdfLutGenerator:()=>y2,Buffer:()=>_t,BufferLoader:()=>nb,BufferUsage:()=>Fe,CPUStylingPipelineStage:()=>kO,CallbackPositionProperty:()=>R1,CallbackProperty:()=>Gd,Camera:()=>so,CameraEventAggregator:()=>vB,CameraEventType:()=>ki,CameraFlightPath:()=>b2,Cartesian2:()=>z,Cartesian3:()=>h,Cartesian4:()=>oe,Cartographic:()=>fe,CartographicGeocoderService:()=>LZ,CatmullRomSpline:()=>NZ,Cesium3DContentGroup:()=>Kx,Cesium3DTile:()=>$f,Cesium3DTileBatchTable:()=>Yp,Cesium3DTileColorBlendMode:()=>Nl,Cesium3DTileContent:()=>A$,Cesium3DTileContentFactory:()=>Ob,Cesium3DTileContentState:()=>Yo,Cesium3DTileContentType:()=>Ds,Cesium3DTileFeature:()=>Ws,Cesium3DTileFeatureTable:()=>ih,Cesium3DTileOptimizationHint:()=>jf,Cesium3DTileOptimizations:()=>TL,Cesium3DTilePass:()=>Uo,Cesium3DTilePassState:()=>gd,Cesium3DTilePointFeature:()=>b_,Cesium3DTileRefine:()=>jo,Cesium3DTileStyle:()=>vC,Cesium3DTileStyleEngine:()=>wL,Cesium3DTilesInspector:()=>Pk,Cesium3DTilesInspectorViewModel:()=>Ik,Cesium3DTilesVoxelProvider:()=>E$,Cesium3DTileset:()=>xs,Cesium3DTilesetBaseTraversal:()=>ML,Cesium3DTilesetCache:()=>EL,Cesium3DTilesetGraphics:()=>zx,Cesium3DTilesetHeatmap:()=>SL,Cesium3DTilesetMetadata:()=>Hb,Cesium3DTilesetMostDetailedTraversal:()=>PL,Cesium3DTilesetSkipTraversal:()=>FL,Cesium3DTilesetStatistics:()=>M_,Cesium3DTilesetTraversal:()=>Zs,Cesium3DTilesetVisualizer:()=>BL,CesiumInspector:()=>vk,CesiumInspectorViewModel:()=>Sk,CesiumTerrainProvider:()=>xC,CesiumWidget:()=>S3,Check:()=>bo,CheckerboardMaterialProperty:()=>SE,CircleEmitter:()=>W3,CircleGeometry:()=>zZ,CircleOutlineGeometry:()=>HZ,ClassificationModelDrawCommand:()=>PM,ClassificationPipelineStage:()=>NO,ClassificationPrimitive:()=>dA,ClassificationType:()=>kn,ClearCommand:()=>ei,ClippingPlane:()=>mb,ClippingPlaneCollection:()=>gs,ClippingPolygon:()=>zA,ClippingPolygonCollection:()=>Jd,Clock:()=>yh,ClockRange:()=>Yr,ClockStep:()=>_o,ClockViewModel:()=>mk,CloudCollection:()=>P$,CloudType:()=>zv,Color:()=>H,ColorBlendMode:()=>pc,ColorGeometryInstanceAttribute:()=>Gt,ColorMaterialProperty:()=>Ut,Command:()=>bQ,ComponentDatatype:()=>X,Composite3DTileContent:()=>U1,CompositeEntityCollection:()=>o7,CompositeMaterialProperty:()=>wE,CompositePositionProperty:()=>_a,CompositeProperty:()=>Tc,CompressedTextureBuffer:()=>bw,ComputeCommand:()=>kc,ComputeEngine:()=>yw,ConditionsExpression:()=>U3,ConeEmitter:()=>O$,ConstantPositionProperty:()=>qc,ConstantProperty:()=>Kn,ConstantSpline:()=>tO,ContentMetadata:()=>dL,Context:()=>dP,ContextLimits:()=>Lt,CoplanarPolygonGeometry:()=>TN,CoplanarPolygonGeometryLibrary:()=>w_,CoplanarPolygonOutlineGeometry:()=>Zf,CornerType:()=>Ni,CorrelationGroup:()=>VR,CorridorGeometry:()=>Xb,CorridorGeometryLibrary:()=>Wi,CorridorGeometryUpdater:()=>qL,CorridorGraphics:()=>Fx,CorridorOutlineGeometry:()=>jL,Credit:()=>bt,CreditDisplay:()=>E2,CubeMap:()=>Cr,CubeMapFace:()=>Pw,CubicRealPolynomial:()=>dx,CullFace:()=>xi,CullingVolume:()=>_s,CumulusCloud:()=>uf,CustomDataSource:()=>QL,CustomHeightmapTerrainProvider:()=>GZ,CustomShader:()=>fC,CustomShaderMode:()=>g_,CustomShaderPipelineStage:()=>jO,CustomShaderTranslucencyMode:()=>Py,CylinderGeometry:()=>JL,CylinderGeometryLibrary:()=>Kb,CylinderGeometryUpdater:()=>tN,CylinderGraphics:()=>Bx,CylinderOutlineGeometry:()=>eN,CzmlDataSource:()=>fN,DataSource:()=>qr,DataSourceClock:()=>xh,DataSourceCollection:()=>dN,DataSourceDisplay:()=>ZN,DebugAppearance:()=>M$,DebugCameraPrimitive:()=>np,DebugInspector:()=>LB,DebugModelMatrixPrimitive:()=>q3,DefaultProxy:()=>WZ,DepthFunction:()=>cc,DepthPlane:()=>O2,DequantizationPipelineStage:()=>YO,DerivedCommand:()=>ip,DeveloperError:()=>he,DeviceOrientationCameraController:()=>M2,DirectionalLight:()=>L$,DiscardEmptyTileImagePolicy:()=>qS,DiscardMissingTileImagePolicy:()=>BF,DistanceDisplayCondition:()=>Mt,DistanceDisplayConditionGeometryInstanceAttribute:()=>Bn,DoubleEndedPriorityQueue:()=>lC,DoublyLinkedList:()=>AL,DracoLoader:()=>e_,DrawCommand:()=>Ze,DynamicAtmosphereLightingType:()=>r_,DynamicEnvironmentMapManager:()=>s_,DynamicGeometryBatch:()=>nT,DynamicGeometryUpdater:()=>ni,EarthOrientationParameters:()=>uw,EarthOrientationParametersSample:()=>Mg,EasingFunction:()=>Kr,EllipseGeometry:()=>ul,EllipseGeometryLibrary:()=>Xl,EllipseGeometryUpdater:()=>mN,EllipseGraphics:()=>kx,EllipseOutlineGeometry:()=>Hu,Ellipsoid:()=>ee,EllipsoidGeodesic:()=>Fp,EllipsoidGeometry:()=>Qs,EllipsoidGeometryUpdater:()=>_N,EllipsoidGraphics:()=>Vx,EllipsoidOutlineGeometry:()=>Mu,EllipsoidPrimitive:()=>d2,EllipsoidRhumbLine:()=>La,EllipsoidSurfaceAppearance:()=>N$,EllipsoidTangentPlane:()=>Jr,EllipsoidTerrainProvider:()=>Qm,EllipsoidalOccluder:()=>V_,Empty3DTileContent:()=>dE,EncodedCartesian3:()=>Hn,Entity:()=>nr,EntityCluster:()=>Fu,EntityCollection:()=>$s,EntityView:()=>QN,Event:()=>pe,EventHelper:()=>hr,Expression:()=>Of,ExpressionNodeType:()=>ht,ExtrapolationType:()=>ku,FeatureDetection:()=>zt,FeatureIdPipelineStage:()=>Iy,Fog:()=>L2,ForEach:()=>Pe,FrameRateMonitor:()=>K3,FrameState:()=>N2,Framebuffer:()=>Nr,FramebufferManager:()=>hi,FrustumCommands:()=>U2,FrustumGeometry:()=>HT,FrustumOutlineGeometry:()=>w2,Fullscreen:()=>xr,FullscreenButton:()=>Ok,FullscreenButtonViewModel:()=>Rk,GeoJsonDataSource:()=>gT,GeoJsonLoader:()=>QR,GeocodeType:()=>U0,Geocoder:()=>Lk,GeocoderService:()=>Fv,GeocoderViewModel:()=>Mk,GeographicProjection:()=>Pi,GeographicTilingScheme:()=>Xi,Geometry:()=>st,Geometry3DTileContent:()=>H1,GeometryAttribute:()=>ve,GeometryAttributes:()=>un,GeometryFactory:()=>jZ,GeometryInstance:()=>St,GeometryInstanceAttribute:()=>lc,GeometryOffsetAttribute:()=>on,GeometryPipeline:()=>Ln,GeometryPipelineStage:()=>$O,GeometryType:()=>bf,GeometryUpdater:()=>ii,GeometryUpdaterSet:()=>hT,GeometryVisualizer:()=>kN,GetFeatureInfoFormat:()=>kT,Globe:()=>c2,GlobeDepth:()=>z2,GlobeSurfaceShaderSet:()=>FF,GlobeSurfaceTile:()=>md,GlobeSurfaceTileProvider:()=>QF,GlobeTranslucency:()=>JF,GlobeTranslucencyFramebuffer:()=>H2,GlobeTranslucencyState:()=>F2,GltfBufferViewLoader:()=>SA,GltfDracoLoader:()=>vA,GltfGpmLoader:()=>zR,GltfGpmLocal:()=>GA,GltfImageLoader:()=>wA,GltfIndexBufferLoader:()=>DA,GltfJsonLoader:()=>PA,GltfLoader:()=>l_,GltfLoaderUtil:()=>Vl,GltfMeshPrimitiveGpmLoader:()=>jR,GltfStructuralMetadataLoader:()=>NR,GltfTextureLoader:()=>RA,GltfVertexBufferLoader:()=>OA,GoogleEarthEnterpriseImageryProvider:()=>B$,GoogleEarthEnterpriseMapsProvider:()=>HF,GoogleEarthEnterpriseMetadata:()=>wg,GoogleEarthEnterpriseTerrainData:()=>Bv,GoogleEarthEnterpriseTerrainProvider:()=>JZ,GoogleEarthEnterpriseTileInformation:()=>M3,GoogleGeocoderService:()=>t$,GoogleMaps:()=>TC,GpxDataSource:()=>rF,GregorianDate:()=>Tp,GridImageryProvider:()=>k$,GridMaterialProperty:()=>BE,GroundGeometryUpdater:()=>Gn,GroundPolylineGeometry:()=>Px,GroundPolylinePrimitive:()=>kd,GroundPrimitive:()=>Wc,GroupMetadata:()=>CE,HeadingPitchRange:()=>cd,HeadingPitchRoll:()=>Da,Heap:()=>sw,HeightReference:()=>Ye,HeightmapEncoding:()=>fd,HeightmapTerrainData:()=>Wa,HeightmapTessellator:()=>US,HermitePolynomialApproximation:()=>nN,HermiteSpline:()=>vy,HilbertOrder:()=>TA,HomeButton:()=>Fk,HomeButtonViewModel:()=>Nk,HorizontalOrigin:()=>yi,I3SBuildingSceneLayerExplorer:()=>IQ,I3SBuildingSceneLayerExplorerViewModel:()=>Bk,I3SDataProvider:()=>Kh,I3SDecoder:()=>Z3,I3SFeature:()=>$3,I3SField:()=>Q3,I3SGeometry:()=>Hv,I3SLayer:()=>RC,I3SNode:()=>Gv,I3SStatistics:()=>tk,I3SSublayer:()=>ik,I3SSymbology:()=>ek,I3dmLoader:()=>eO,I3dmParser:()=>JR,ITwinData:()=>H$,ITwinPlatform:()=>Ea,Iau2000Orientation:()=>u2,Iau2006XysData:()=>fw,Iau2006XysSample:()=>cx,IauOrientationAxes:()=>f2,IauOrientationParameters:()=>l2,ImageBasedLighting:()=>Xx,ImageBasedLightingPipelineStage:()=>pO,ImageMaterialProperty:()=>Qg,Imagery:()=>QS,ImageryLayer:()=>qa,ImageryLayerCollection:()=>e2,ImageryLayerFeatureInfo:()=>Nh,ImageryProvider:()=>_l,ImageryState:()=>ai,Implicit3DTileContent:()=>NA,ImplicitAvailabilityBitstream:()=>AA,ImplicitMetadataView:()=>EA,ImplicitSubdivisionScheme:()=>ns,ImplicitSubtree:()=>fb,ImplicitSubtreeCache:()=>H3,ImplicitSubtreeMetadata:()=>G1,ImplicitTileCoordinates:()=>jb,ImplicitTileset:()=>Wb,IndexDatatype:()=>Ne,InfoBox:()=>Vk,InfoBoxViewModel:()=>kk,InspectorShared:()=>Ka,InstanceAttributeSemantic:()=>os,InstancingPipelineStage:()=>IO,InterpolationAlgorithm:()=>n$,InterpolationType:()=>th,Intersect:()=>Wt,IntersectionTests:()=>$n,Intersections2D:()=>Sg,Interval:()=>Pa,InvertClassification:()=>fv,Ion:()=>qd,IonGeocodeProviderType:()=>Dg,IonGeocoderService:()=>CC,IonImageryProvider:()=>ug,IonResource:()=>Cu,IonWorldImageryStyle:()=>fg,Iso8601:()=>He,JobScheduler:()=>B2,JobType:()=>Ba,JsonMetadataTable:()=>a_,JulianDate:()=>Z,KTX2Transcoder:()=>Tw,KeyboardEventModifier:()=>ia,KeyframeNode:()=>eo,KmlCamera:()=>sF,KmlDataSource:()=>PT,KmlLookAt:()=>SF,KmlTour:()=>vF,KmlTourFlyTo:()=>DF,KmlTourWait:()=>IF,Label:()=>By,LabelCollection:()=>vm,LabelGraphics:()=>Ud,LabelStyle:()=>qo,LabelVisualizer:()=>VN,LagrangePolynomialApproximation:()=>iN,LeapSecond:()=>qi,Light:()=>G$,LightingModel:()=>Am,LightingPipelineStage:()=>JO,LinearApproximation:()=>$b,LinearSpline:()=>Sy,ManagedArray:()=>Jc,MapMode2D:()=>iu,MapProjection:()=>r$,MapboxImageryProvider:()=>GF,MapboxStyleImageryProvider:()=>W$,Material:()=>Yi,MaterialAppearance:()=>co,MaterialPipelineStage:()=>tM,MaterialProperty:()=>tr,Math:()=>P,Matrix2:()=>Ri,Matrix3:()=>$,Matrix4:()=>F,Megatexture:()=>yv,MeshPrimitiveGpmLocal:()=>WR,MetadataClass:()=>Zd,MetadataClassProperty:()=>gm,MetadataComponentType:()=>kt,MetadataEntity:()=>Fn,MetadataEnum:()=>hR,MetadataEnumValue:()=>dR,MetadataPicking:()=>k2,MetadataPickingPipelineStage:()=>Du,MetadataPipelineStage:()=>Ff,MetadataSchema:()=>vu,MetadataSchemaLoader:()=>MA,MetadataSemantic:()=>db,MetadataTable:()=>Bl,MetadataTableProperty:()=>j1,MetadataType:()=>ct,MipmapHint:()=>lm,Model:()=>sh,Model3DTileContent:()=>Pu,ModelAlphaOptions:()=>xM,ModelAnimation:()=>rO,ModelAnimationChannel:()=>oO,ModelAnimationCollection:()=>sO,ModelAnimationLoop:()=>zl,ModelAnimationState:()=>oh,ModelArticulation:()=>gO,ModelArticulationStage:()=>_O,ModelClippingPlanesPipelineStage:()=>bO,ModelClippingPolygonsPipelineStage:()=>AO,ModelColorPipelineStage:()=>Dy,ModelComponents:()=>xn,ModelDrawCommand:()=>RM,ModelDrawCommands:()=>LM,ModelFeature:()=>aO,ModelFeatureTable:()=>lO,ModelGraphics:()=>zp,ModelLightingOptions:()=>wM,ModelMatrixUpdateStage:()=>PO,ModelNode:()=>EO,ModelRenderResources:()=>bM,ModelRuntimeNode:()=>OO,ModelRuntimePrimitive:()=>gM,ModelSceneGraph:()=>NM,ModelSilhouettePipelineStage:()=>AM,ModelSkin:()=>yM,ModelSplitterPipelineStage:()=>SM,ModelStatistics:()=>FM,ModelType:()=>fr,ModelUtility:()=>Xt,ModelVisualizer:()=>UN,Moon:()=>m2,MorphTargetsPipelineStage:()=>iM,MorphWeightSpline:()=>s$,MortonOrder:()=>Gy,Multiple3DTileContent:()=>pL,MultisampleFramebuffer:()=>hP,NavigationHelpButton:()=>Gk,NavigationHelpButtonViewModel:()=>Hk,NearFarScalar:()=>Bt,NeverTileDiscardPolicy:()=>q$,NodeRenderResources:()=>vM,NodeStatisticsPipelineStage:()=>RO,NodeTransformationProperty:()=>Ux,OIT:()=>W2,Occluder:()=>p2,OffsetGeometryInstanceAttribute:()=>Ji,OpenCageGeocoderService:()=>c$,OpenStreetMapImageryProvider:()=>Pg,OrderedGroundPrimitiveCollection:()=>hN,OrientedBoundingBox:()=>vn,OrthographicFrustum:()=>nn,OrthographicOffCenterFrustum:()=>Fr,Packable:()=>l$,PackableForInterpolation:()=>u$,Particle:()=>qv,ParticleBurst:()=>X$,ParticleEmitter:()=>K$,ParticleSystem:()=>Z$,Pass:()=>we,PassState:()=>sc,PathGraphics:()=>Hp,PathVisualizer:()=>HN,PeliasGeocoderService:()=>N3,PerInstanceColorAppearance:()=>an,PerformanceDisplay:()=>pg,PerformanceWatchdog:()=>zk,PerformanceWatchdogViewModel:()=>Uk,PerspectiveFrustum:()=>Ii,PerspectiveOffCenterFrustum:()=>yl,PickDepth:()=>V2,PickDepthFramebuffer:()=>q2,PickFramebuffer:()=>X2,PickedMetadataInfo:()=>s3,Picking:()=>J2,PickingPipelineStage:()=>oM,PinBuilder:()=>eg,PixelDatatype:()=>Ke,PixelFormat:()=>et,Plane:()=>rn,PlaneGeometry:()=>gN,PlaneGeometryUpdater:()=>xN,PlaneGraphics:()=>A1,PlaneOutlineGeometry:()=>yN,PntsLoader:()=>kM,PntsParser:()=>vb,PointCloud:()=>A3,PointCloudEyeDomeLighting:()=>u_,PointCloudShading:()=>Cm,PointCloudStylingPipelineStage:()=>sM,PointGraphics:()=>Hx,PointPrimitive:()=>Ps,PointPrimitiveCollection:()=>OE,PointVisualizer:()=>WN,PolygonGeometry:()=>o_,PolygonGeometryLibrary:()=>Un,PolygonGeometryUpdater:()=>AN,PolygonGraphics:()=>zd,PolygonHierarchy:()=>Na,PolygonOutlineGeometry:()=>CN,PolygonPipeline:()=>si,Polyline:()=>Hf,PolylineArrowMaterialProperty:()=>VE,PolylineCollection:()=>lh,PolylineColorAppearance:()=>es,PolylineDashMaterialProperty:()=>zE,PolylineGeometry:()=>J_,PolylineGeometryUpdater:()=>YN,PolylineGlowMaterialProperty:()=>GE,PolylineGraphics:()=>uc,PolylineMaterialAppearance:()=>fa,PolylineOutlineMaterialProperty:()=>$y,PolylinePipeline:()=>Li,PolylineVisualizer:()=>KN,PolylineVolumeGeometry:()=>vN,PolylineVolumeGeometryLibrary:()=>mh,PolylineVolumeGeometryUpdater:()=>PN,PolylineVolumeGraphics:()=>Gx,PolylineVolumeOutlineGeometry:()=>IN,PositionProperty:()=>Vd,PositionPropertyArray:()=>G_,PostProcessStage:()=>mo,PostProcessStageCollection:()=>CB,PostProcessStageComposite:()=>ru,PostProcessStageLibrary:()=>tf,PostProcessStageSampleMode:()=>ef,PostProcessStageTextureCache:()=>eC,PpeMetadata:()=>GR,PpeSource:()=>_Q,PpeTexture:()=>HR,Primitive:()=>Dn,PrimitiveCollection:()=>Yl,PrimitiveLoadPlan:()=>Tb,PrimitiveOutlineGenerator:()=>bb,PrimitiveOutlinePipelineStage:()=>lM,PrimitivePipeline:()=>wx,PrimitiveRenderResources:()=>DM,PrimitiveState:()=>Sr,PrimitiveStatisticsPipelineStage:()=>uM,PrimitiveType:()=>Me,ProjectionPicker:()=>jk,ProjectionPickerViewModel:()=>Wk,Property:()=>Y,PropertyArray:()=>jE,PropertyAttribute:()=>xb,PropertyAttributeProperty:()=>RR,PropertyBag:()=>Xc,PropertyTable:()=>nl,PropertyTexture:()=>c_,PropertyTextureProperty:()=>PR,ProviderViewModel:()=>us,Proxy:()=>f$,QuadraticRealPolynomial:()=>Vc,QuadtreeOccluders:()=>t2,QuadtreePrimitive:()=>a2,QuadtreeTile:()=>n2,QuadtreeTileLoadState:()=>ea,QuadtreeTileProvider:()=>$$,QuantizedMeshTerrainData:()=>yC,QuarticRealPolynomial:()=>Ew,Quaternion:()=>Oe,QuaternionSpline:()=>iO,Queue:()=>yy,Ray:()=>hn,Rectangle:()=>se,RectangleCollisionChecker:()=>pT,RectangleGeometry:()=>aT,RectangleGeometryLibrary:()=>Is,RectangleGeometryUpdater:()=>RN,RectangleGraphics:()=>Hd,RectangleOutlineGeometry:()=>Nb,ReferenceFrame:()=>zi,ReferenceProperty:()=>W_,RenderState:()=>Ve,Renderbuffer:()=>pu,RenderbufferFormat:()=>zc,Request:()=>$o,RequestErrorEvent:()=>tm,RequestScheduler:()=>ic,RequestState:()=>Zn,RequestType:()=>ds,Resource:()=>Se,ResourceCache:()=>Si,ResourceCacheKey:()=>Ul,ResourceCacheStatistics:()=>_R,ResourceLoader:()=>Ki,ResourceLoaderState:()=>mt,Rotation:()=>td,RuntimeError:()=>re,S2Cell:()=>Zp,SDFSettings:()=>Xs,SampledPositionProperty:()=>ya,SampledProperty:()=>Uu,Sampler:()=>Zt,ScaledPositionProperty:()=>Bm,Scene:()=>c3,SceneFramebuffer:()=>YT,SceneMode:()=>ne,SceneMode2DPipelineStage:()=>fM,SceneModePicker:()=>Yk,SceneModePickerViewModel:()=>qk,SceneTransforms:()=>Hi,SceneTransitioner:()=>SB,ScreenSpaceCameraController:()=>IB,ScreenSpaceEventHandler:()=>of,ScreenSpaceEventType:()=>bn,SelectedFeatureIdPipelineStage:()=>Ry,SelectionIndicator:()=>Zk,SelectionIndicatorViewModel:()=>Kk,SensorVolumePortionToDisplay:()=>KE,ShaderBuilder:()=>Tx,ShaderCache:()=>aP,ShaderDestination:()=>_e,ShaderFunction:()=>_P,ShaderProgram:()=>$t,ShaderSource:()=>Ue,ShaderStruct:()=>pP,ShadowMap:()=>yg,ShadowMapShader:()=>sp,ShadowMode:()=>yn,ShadowVolumeAppearance:()=>yu,ShowGeometryInstanceAttribute:()=>gn,Simon1994PlanetaryPositions:()=>Wg,SimplePolylineGeometry:()=>d$,SingleTileImageryProvider:()=>WF,SkinningPipelineStage:()=>hM,SkyAtmosphere:()=>f3,SkyBox:()=>m3,SpatialNode:()=>t3,Spdcf:()=>UR,SpecularEnvironmentCubeMap:()=>jd,SphereEmitter:()=>J$,SphereGeometry:()=>h$,SphereOutlineGeometry:()=>I_,Spherical:()=>oN,Spline:()=>oo,SplitDirection:()=>Br,Splitter:()=>vv,StaticGeometryColorBatch:()=>rd,StaticGeometryPerMaterialBatch:()=>sd,StaticGroundGeometryColorBatch:()=>hS,StaticGroundGeometryPerMaterialBatch:()=>BN,StaticGroundPolylinePerMaterialBatch:()=>XN,StaticOutlineGeometryBatch:()=>_S,StencilConstants:()=>Vt,StencilFunction:()=>Vn,StencilOperation:()=>ut,SteppedSpline:()=>nO,Stereographic:()=>mc,StorageType:()=>Ty,StripeMaterialProperty:()=>YE,StripeOrientation:()=>bh,StructuralMetadata:()=>qs,StyleCommandsNeeded:()=>rh,StyleExpression:()=>eQ,Sun:()=>b3,SunLight:()=>Pp,SunPostProcess:()=>OB,SupportedImageFormats:()=>FR,SvgPathBindingHandler:()=>dk,TaskProcessor:()=>gi,Terrain:()=>sk,TerrainData:()=>Lh,TerrainEncoding:()=>wc,TerrainFillMesh:()=>nv,TerrainMesh:()=>hd,TerrainOffsetProperty:()=>Wx,TerrainProvider:()=>ss,TerrainQuantization:()=>Js,TerrainState:()=>ho,Texture:()=>It,TextureAtlas:()=>Fy,TextureCache:()=>cP,TextureMagnificationFilter:()=>di,TextureManager:()=>i3,TextureMinificationFilter:()=>Kt,TextureUniform:()=>mQ,TextureWrap:()=>Cn,TileAvailability:()=>Wh,TileBoundingRegion:()=>Kf,TileBoundingS2Cell:()=>xL,TileBoundingSphere:()=>P_,TileBoundingVolume:()=>tQ,TileCoordinatesImageryProvider:()=>ck,TileDiscardPolicy:()=>iQ,TileEdge:()=>_n,TileImagery:()=>JS,TileMapServiceImageryProvider:()=>E0,TileMetadata:()=>hL,TileOrientedBoundingBox:()=>Lu,TileProviderError:()=>Io,TileReplacementQueue:()=>i2,TileSelectionResult:()=>Yn,TileState:()=>oQ,Tileset3DTileContent:()=>zM,TilesetMetadata:()=>bL,TilesetPipelineStage:()=>uO,TilingScheme:()=>m$,TimeConstants:()=>qn,TimeDynamicImagery:()=>VT,TimeDynamicPointCloud:()=>Dv,TimeInterval:()=>An,TimeIntervalCollection:()=>jr,TimeIntervalCollectionPositionProperty:()=>j_,TimeIntervalCollectionProperty:()=>q_,TimeStandard:()=>Wn,Timeline:()=>Jk,TimelineHighlightRange:()=>$k,TimelineTrack:()=>Qk,Tipsify:()=>Sw,ToggleButtonViewModel:()=>q0,Tonemapper:()=>bg,TrackingReferenceFrame:()=>Np,Transforms:()=>Ot,TranslationRotationScale:()=>Jg,TranslucentTileClassification:()=>Z2,TridiagonalSystemSolver:()=>ZA,TrustedServers:()=>YC,TweenCollection:()=>oC,UniformState:()=>fP,UniformType:()=>bv,UrlTemplateImageryProvider:()=>ja,VERSION:()=>hwt,VRButton:()=>nV,VRButtonViewModel:()=>tV,VRTheWorldTerrainProvider:()=>p$,VaryingType:()=>pQ,Vector3DTileBatch:()=>pm,Vector3DTileClampedPolylines:()=>lL,Vector3DTileContent:()=>fL,Vector3DTileGeometry:()=>Kp,Vector3DTilePoints:()=>nL,Vector3DTilePolygons:()=>iL,Vector3DTilePolylines:()=>Rb,Vector3DTilePrimitive:()=>Jx,VelocityOrientationProperty:()=>sN,VelocityVectorProperty:()=>Y_,VertexArray:()=>ti,VertexArrayFacade:()=>Rp,VertexAttributeSemantic:()=>Ct,VertexFormat:()=>Ie,VerticalExaggeration:()=>Er,VerticalExaggerationPipelineStage:()=>pM,VerticalOrigin:()=>Rn,VideoSynchronizer:()=>_$,View:()=>ZT,Viewer:()=>FQ,ViewportQuad:()=>rQ,Visibility:()=>_r,Visualizer:()=>hX,VoxelBoxShape:()=>up,VoxelCell:()=>NB,VoxelContent:()=>G3,VoxelCylinderShape:()=>fp,VoxelEllipsoidShape:()=>cC,VoxelInspector:()=>oV,VoxelInspectorViewModel:()=>iV,VoxelPrimitive:()=>N0,VoxelProvider:()=>aQ,VoxelRenderResources:()=>ZB,VoxelShape:()=>cQ,VoxelShapeType:()=>Vi,VoxelTraversal:()=>xv,VulkanConstants:()=>g$,WallGeometry:()=>MN,WallGeometryLibrary:()=>cT,WallGeometryUpdater:()=>FN,WallGraphics:()=>Gp,WallOutlineGeometry:()=>NN,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>qF,WebMapTileServiceImageryProvider:()=>XF,WebMercatorProjection:()=>Oi,WebMercatorTilingScheme:()=>as,WindingOrder:()=>hs,WireframeIndexGenerator:()=>oE,WireframePipelineStage:()=>_M,_shadersAcesTonemappingStage:()=>eB,_shadersAdditiveBlend:()=>PB,_shadersAdjustTranslucentFS:()=>dv,_shadersAllMaterialAppearanceFS:()=>CP,_shadersAllMaterialAppearanceVS:()=>AP,_shadersAmbientOcclusionGenerate:()=>tB,_shadersAmbientOcclusionModulate:()=>nB,_shadersAspectRampMaterial:()=>DP,_shadersAtmosphereCommon:()=>eh,_shadersAtmosphereStageFS:()=>fO,_shadersAtmosphereStageVS:()=>dO,_shadersBasicMaterialAppearanceFS:()=>EP,_shadersBasicMaterialAppearanceVS:()=>SP,_shadersBillboardCollectionFS:()=>HM,_shadersBillboardCollectionVS:()=>GM,_shadersBlackAndWhite:()=>iB,_shadersBloomComposite:()=>oB,_shadersBrdfLutGeneratorFS:()=>_2,_shadersBrightPass:()=>RB,_shadersBrightness:()=>rB,_shadersBumpMapMaterial:()=>IP,_shadersCPUStylingStageFS:()=>BO,_shadersCPUStylingStageVS:()=>FO,_shadersCheckerboardMaterial:()=>PP,_shadersCloudCollectionFS:()=>v3,_shadersCloudCollectionVS:()=>w3,_shadersCloudNoiseFS:()=>D3,_shadersCloudNoiseVS:()=>I3,_shadersCompareAndPackTranslucentDepth:()=>K2,_shadersCompositeOITFS:()=>G2,_shadersCompositeTranslucentClassification:()=>KT,_shadersComputeIrradianceFS:()=>AR,_shadersComputeRadianceMapFS:()=>ER,_shadersContrastBias:()=>sB,_shadersConvolveSpecularMapFS:()=>SR,_shadersConvolveSpecularMapVS:()=>vR,_shadersCustomShaderStageFS:()=>UO,_shadersCustomShaderStageVS:()=>VO,_shadersCzmBuiltins:()=>yx,_shadersDepthOfField:()=>aB,_shadersDepthPlaneFS:()=>D2,_shadersDepthPlaneVS:()=>I2,_shadersDepthView:()=>cB,_shadersDepthViewPacked:()=>hQ,_shadersDotMaterial:()=>RP,_shadersEdgeDetection:()=>lB,_shadersElevationBandMaterial:()=>OP,_shadersElevationContourMaterial:()=>MP,_shadersElevationRampMaterial:()=>LP,_shadersEllipsoidFS:()=>ov,_shadersEllipsoidSurfaceAppearanceFS:()=>Y3,_shadersEllipsoidSurfaceAppearanceVS:()=>X3,_shadersEllipsoidVS:()=>rv,_shadersFXAA:()=>dB,_shadersFXAA3_11:()=>yB,_shadersFadeMaterial:()=>NP,_shadersFeatureIdStageFS:()=>zO,_shadersFeatureIdStageVS:()=>HO,_shadersFilmicTonemapping:()=>uB,_shadersGaussianBlur1D:()=>O0,_shadersGeometryStageFS:()=>XO,_shadersGeometryStageVS:()=>KO,_shadersGlobeFS:()=>LF,_shadersGlobeVS:()=>NF,_shadersGridMaterial:()=>FP,_shadersGroundAtmosphere:()=>HS,_shadersHSBToRGB:()=>ED,_shadersHSLToRGB:()=>SD,_shadersImageBasedLightingStageFS:()=>mO,_shadersInstancingStageCommon:()=>SO,_shadersInstancingStageVS:()=>vO,_shadersIntersectBox:()=>HB,_shadersIntersectClippingPlanes:()=>zB,_shadersIntersectCylinder:()=>GB,_shadersIntersectDepth:()=>UB,_shadersIntersectEllipsoid:()=>WB,_shadersIntersectLongitude:()=>gv,_shadersIntersection:()=>aC,_shadersIntersectionUtils:()=>VB,_shadersLegacyInstancingStageVS:()=>wO,_shadersLensFlare:()=>hB,_shadersLightingStageFS:()=>QO,_shadersMaterialStageFS:()=>eM,_shadersMegatexture:()=>KB,_shadersMetadataStageFS:()=>GO,_shadersMetadataStageVS:()=>WO,_shadersModelClippingPlanesStageFS:()=>xO,_shadersModelClippingPolygonsStageFS:()=>CO,_shadersModelClippingPolygonsStageVS:()=>TO,_shadersModelColorStageFS:()=>yO,_shadersModelFS:()=>MM,_shadersModelSilhouetteStageFS:()=>TM,_shadersModelSilhouetteStageVS:()=>CM,_shadersModelSplitterStageFS:()=>EM,_shadersModelVS:()=>OM,_shadersModifiedReinhardTonemapping:()=>mB,_shadersMorphTargetsStageVS:()=>nM,_shadersNightVision:()=>pB,_shadersNormalMapMaterial:()=>BP,_shadersOctree:()=>XB,_shadersPassThrough:()=>ou,_shadersPassThroughDepth:()=>I0,_shadersPbrNeutralTonemapping:()=>fB,_shadersPerInstanceColorAppearanceFS:()=>XP,_shadersPerInstanceColorAppearanceVS:()=>KP,_shadersPerInstanceFlatColorAppearanceFS:()=>Sx,_shadersPerInstanceFlatColorAppearanceVS:()=>ZP,_shadersPointCloudEyeDomeLighting:()=>qR,_shadersPointCloudStylingStageVS:()=>rM,_shadersPointPrimitiveCollectionFS:()=>Zy,_shadersPointPrimitiveCollectionVS:()=>YL,_shadersPolygonSignedDistanceFS:()=>TR,_shadersPolylineArrowMaterial:()=>kP,_shadersPolylineColorAppearanceVS:()=>u1,_shadersPolylineCommon:()=>xu,_shadersPolylineDashMaterial:()=>VP,_shadersPolylineFS:()=>Ox,_shadersPolylineGlowMaterial:()=>UP,_shadersPolylineMaterialAppearanceVS:()=>f1,_shadersPolylineOutlineMaterial:()=>zP,_shadersPolylineShadowVolumeFS:()=>s1,_shadersPolylineShadowVolumeMorphFS:()=>a1,_shadersPolylineShadowVolumeMorphVS:()=>c1,_shadersPolylineShadowVolumeVS:()=>l1,_shadersPolylineVS:()=>ZM,_shadersPrimitiveOutlineStageFS:()=>cM,_shadersPrimitiveOutlineStageVS:()=>aM,_shadersRGBToHSB:()=>vD,_shadersRGBToHSL:()=>wD,_shadersRGBToXYZ:()=>DD,_shadersReinhardTonemapping:()=>_B,_shadersReprojectWebMercatorFS:()=>KF,_shadersReprojectWebMercatorVS:()=>ZF,_shadersRimLightingMaterial:()=>HP,_shadersSelectedFeatureIdStageCommon:()=>iE,_shadersShadowVolumeAppearanceFS:()=>uA,_shadersShadowVolumeAppearanceVS:()=>JP,_shadersShadowVolumeFS:()=>Kg,_shadersSilhouette:()=>gB,_shadersSkinningStageVS:()=>dM,_shadersSkyAtmosphereCommon:()=>Cv,_shadersSkyAtmosphereFS:()=>l3,_shadersSkyAtmosphereVS:()=>u3,_shadersSkyBoxFS:()=>d3,_shadersSkyBoxVS:()=>h3,_shadersSlopeRampMaterial:()=>GP,_shadersStripeMaterial:()=>WP,_shadersSunFS:()=>p3,_shadersSunTextureFS:()=>_3,_shadersSunVS:()=>g3,_shadersTexturedMaterialAppearanceFS:()=>vP,_shadersTexturedMaterialAppearanceVS:()=>wP,_shadersVector3DTileClampedPolylinesFS:()=>aL,_shadersVector3DTileClampedPolylinesVS:()=>sL,_shadersVector3DTilePolylinesVS:()=>oL,_shadersVectorTileVS:()=>bA,_shadersVerticalExaggerationStageVS:()=>mM,_shadersViewportQuadFS:()=>P3,_shadersViewportQuadVS:()=>lx,_shadersVoxelFS:()=>BB,_shadersVoxelUtils:()=>FB,_shadersVoxelVS:()=>kB,_shadersWater:()=>qP,_shadersWaterMaskMaterial:()=>jP,_shadersXYZToRGB:()=>ID,_shadersacesTonemapping:()=>PD,_shadersalphaWeight:()=>RD,_shadersantialias:()=>OD,_shadersapplyHSBShift:()=>MD,_shadersapproximateSphericalCoordinates:()=>LD,_shadersapproximateTanh:()=>ND,_shadersbackFacing:()=>FD,_shadersbranchFreeTernary:()=>BD,_shaderscascadeColor:()=>kD,_shaderscascadeDistance:()=>VD,_shaderscascadeMatrix:()=>UD,_shaderscascadeWeights:()=>zD,_shadersclipPolygons:()=>HD,_shaderscolumbusViewMorph:()=>GD,_shaderscomputeAtmosphereColor:()=>WD,_shaderscomputeGroundAtmosphereScattering:()=>jD,_shaderscomputePosition:()=>qD,_shaderscomputeScattering:()=>YD,_shadersconvertUvToBox:()=>jB,_shadersconvertUvToCylinder:()=>qB,_shadersconvertUvToEllipsoid:()=>YB,_shaderscosineAndSine:()=>XD,_shadersdecompressTextureCoordinates:()=>KD,_shadersdegreesPerRadian:()=>Ow,_shadersdepthClamp:()=>ZD,_shadersdepthRange:()=>Mw,_shadersdepthRangeStruct:()=>_D,_shaderseastNorthUpToEyeCoordinates:()=>$D,_shadersellipsoidContainsPoint:()=>QD,_shadersellipsoidTextureCoordinates:()=>JD,_shadersepsilon1:()=>Lw,_shadersepsilon2:()=>Nw,_shadersepsilon3:()=>Fw,_shadersepsilon4:()=>Bw,_shadersepsilon5:()=>kw,_shadersepsilon6:()=>Vw,_shadersepsilon7:()=>Uw,_shadersequalsEpsilon:()=>eI,_shaderseyeOffset:()=>tI,_shaderseyeToWindowCoordinates:()=>nI,_shadersfastApproximateAtan:()=>iI,_shadersfog:()=>oI,_shadersgammaCorrect:()=>rI,_shadersgeodeticSurfaceNormal:()=>sI,_shadersgetDefaultMaterial:()=>aI,_shadersgetDynamicAtmosphereLightDirection:()=>cI,_shadersgetLambertDiffuse:()=>lI,_shadersgetSpecular:()=>uI,_shadersgetWaterNoise:()=>fI,_shadershue:()=>dI,_shadersinfinity:()=>zw,_shadersinverseGamma:()=>hI,_shadersisEmpty:()=>mI,_shadersisFull:()=>pI,_shaderslatitudeToWebMercatorFraction:()=>_I,_shaderslineDistance:()=>gI,_shaderslinearToSrgb:()=>yI,_shadersluminance:()=>xI,_shadersmaterial:()=>gD,_shadersmaterialInput:()=>yD,_shadersmaximumComponent:()=>bI,_shadersmetersPerPixel:()=>TI,_shadersmodelMaterial:()=>xD,_shadersmodelToWindowCoordinates:()=>CI,_shadersmodelVertexOutput:()=>bD,_shadersmultiplyWithColorBalance:()=>AI,_shadersnearFarScalar:()=>EI,_shadersoctDecode:()=>SI,_shadersoneOverPi:()=>Hw,_shadersoneOverTwoPi:()=>Gw,_shaderspackDepth:()=>vI,_shaderspassCesium3DTile:()=>Ww,_shaderspassCesium3DTileClassification:()=>jw,_shaderspassCesium3DTileClassificationIgnoreShow:()=>qw,_shaderspassClassification:()=>Yw,_shaderspassCompute:()=>Xw,_shaderspassEnvironment:()=>Kw,_shaderspassGlobe:()=>Zw,_shaderspassOpaque:()=>$w,_shaderspassOverlay:()=>Qw,_shaderspassTerrainClassification:()=>Jw,_shaderspassTranslucent:()=>eD,_shaderspassVoxels:()=>tD,_shaderspbrLighting:()=>wI,_shaderspbrNeutralTonemapping:()=>DI,_shadersphong:()=>II,_shaderspi:()=>nD,_shaderspiOverFour:()=>iD,_shaderspiOverSix:()=>oD,_shaderspiOverThree:()=>rD,_shaderspiOverTwo:()=>sD,_shadersplaneDistance:()=>PI,_shaderspointAlongRay:()=>RI,_shadersradiansPerDegree:()=>aD,_shadersray:()=>TD,_shadersrayEllipsoidIntersectionInterval:()=>OI,_shadersraySegment:()=>CD,_shadersraySphereIntersectionInterval:()=>MI,_shadersreadDepth:()=>LI,_shadersreadNonPerspective:()=>NI,_shadersreverseLogDepth:()=>FI,_shadersround:()=>BI,_shaderssaturation:()=>kI,_shaderssceneMode2D:()=>cD,_shaderssceneMode3D:()=>lD,_shaderssceneModeColumbusView:()=>uD,_shaderssceneModeMorphing:()=>fD,_shadersshadowDepthCompare:()=>VI,_shadersshadowParameters:()=>AD,_shadersshadowVisibility:()=>UI,_shaderssignNotZero:()=>zI,_shaderssolarRadius:()=>dD,_shaderssphericalHarmonics:()=>HI,_shaderssrgbToLinear:()=>GI,_shaderstangentToEyeSpaceMatrix:()=>WI,_shaderstextureCube:()=>jI,_shadersthreePiOver2:()=>hD,_shaderstransformPlane:()=>qI,_shaderstranslateRelativeToEye:()=>YI,_shaderstranslucentPhong:()=>XI,_shaderstranspose:()=>KI,_shaderstwoPi:()=>mD,_shadersunpackClippingExtents:()=>ZI,_shadersunpackDepth:()=>$I,_shadersunpackFloat:()=>QI,_shadersunpackUint:()=>JI,_shadersvalueTransform:()=>eP,_shadersvertexLogDepth:()=>tP,_shaderswebMercatorMaxLatitude:()=>pD,_shaderswindowToEyeCoordinates:()=>nP,_shaderswriteDepthClamp:()=>iP,_shaderswriteLogDepth:()=>oP,_shaderswriteNonPerspective:()=>rP,addBuffer:()=>oR,addDefaults:()=>Z1,addExtensionsRequired:()=>tR,addExtensionsUsed:()=>Mf,addPipelineExtras:()=>uy,addToArray:()=>vs,appendForwardSlash:()=>nw,arrayRemoveDuplicates:()=>Co,barycentricCoordinates:()=>fx,binarySearch:()=>Mo,buildModuleUrl:()=>en,buildVoxelDrawCommands:()=>QB,clone:()=>Ge,combine:()=>xt,computeFlyToLocationForRectangle:()=>NT,createBillboardPointCallback:()=>wb,createCommand:()=>En,createDefaultImageryProviderViewModels:()=>Ck,createDefaultTerrainProviderViewModels:()=>Ak,createElevationBandMaterial:()=>lQ,createGooglePhotorealistic3DTileset:()=>uQ,createGuid:()=>zn,createMaterialPropertyDescriptor:()=>Lo,createOsmBuildingsAsync:()=>fQ,createPropertyDescriptor:()=>le,createRawPropertyDescriptor:()=>Yc,createTangentSpaceDebugPrimitive:()=>dQ,createTaskProcessorWorker:()=>gQ,createUniform:()=>pw,createUniformArray:()=>_w,createWorldBathymetryAsync:()=>B3,createWorldImageryAsync:()=>dg,createWorldTerrainAsync:()=>EC,decodeGoogleEarthEnterpriseData:()=>k3,decodeVectorPolylinePositions:()=>uL,defaultValue:()=>y,defer:()=>wl,defined:()=>l,demodernizeShader:()=>sP,deprecationWarning:()=>ms,destroyObject:()=>ue,exportKml:()=>yX,findAccessorMinMax:()=>ab,findContentMetadata:()=>Mb,findGroupMetadata:()=>Lb,findTileMetadata:()=>mL,forEachTextureInMaterial:()=>IA,formatError:()=>Zm,freezeRenderState:()=>i6,getAbsoluteUri:()=>Jh,getAccessorByteStride:()=>kl,getBaseUri:()=>iw,getBinaryAccessor:()=>Au,getClipAndStyleCode:()=>T3,getClippingFunction:()=>cg,getComponentReader:()=>n_,getElement:()=>In,getExtensionFromUri:()=>ex,getFilenameFromUri:()=>z_,getImageFromTypedArray:()=>n3,getImagePixels:()=>Dd,getJsonFromTypedArray:()=>Fo,getMagic:()=>Yd,getMetadataClassProperty:()=>r3,getMetadataProperty:()=>a3,getStringFromTypedArray:()=>Ll,getTimestamp:()=>Ti,hasExtension:()=>oi,heightReferenceOnEntityPropertyChanged:()=>Wp,isBitSet:()=>Oc,isBlobUri:()=>tx,isCrossOriginUrl:()=>Ng,isDataUri:()=>Cp,isLeapYear:()=>wd,knockout:()=>Te,knockout_3_5_1:()=>MC,knockout_es5:()=>fk,loadAndExecuteScript:()=>nx,loadCubeMap:()=>gP,loadImageFromTypedArray:()=>ob,loadKTX2:()=>Il,mergeSort:()=>mg,moveTechniqueRenderStates:()=>eR,moveTechniquesToExtension:()=>nR,numberOfComponentsForType:()=>Su,objectToQuery:()=>ix,oneTimeWarning:()=>gt,parseBatchTable:()=>h_,parseFeatureMetadataLegacy:()=>LR,parseGlb:()=>Q1,parseResponseHeaders:()=>ow,parseStructuralMetadata:()=>MR,pickModel:()=>aE,pointInsideTriangle:()=>x$,preprocess3DTileContent:()=>Im,processVoxelProperties:()=>$B,queryToObject:()=>fu,readAccessorPacked:()=>rR,removeExtension:()=>cb,removeExtensionsRequired:()=>$1,removeExtensionsUsed:()=>sb,removePipelineExtras:()=>J1,removeUnusedElements:()=>iR,resizeImageToNextPowerOfTwo:()=>hy,sampleTerrain:()=>MF,sampleTerrainMostDetailed:()=>LT,scaleToGeodeticSurface:()=>J0,srgbToLinear:()=>SC,subdivideArray:()=>e1,subscribeAndEvaluate:()=>Sa,updateAccessorComponentTypes:()=>sR,updateVersion:()=>aR,usesExtension:()=>ur,viewerCesium3DTilesInspectorMixin:()=>BQ,viewerCesiumInspectorMixin:()=>kQ,viewerDragDropMixin:()=>UQ,viewerPerformanceWatchdogMixin:()=>zQ,viewerVoxelInspectorMixin:()=>HQ,webGLConstantToGlslType:()=>b$,wrapFunction:()=>V3,writeTextToCanvas:()=>Ib});module.exports=Qh(mwt);function KEe(e){return e!=null}var l=KEe;function $0(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&($0.prototype=Object.create(Error.prototype),$0.prototype.constructor=$0);$0.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};$0.throwInstantiationError=function(){throw new $0("This function defines an interface and should not be called directly.")};var he=$0;var Es={};Es.typeOf={};function ZEe(e){return`${e} is required, actual value was undefined`}function BC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Es.defined=function(e,t){if(!l(t))throw new he(ZEe(e))};Es.typeOf.func=function(e,t){if(typeof t!="function")throw new he(BC(typeof t,"function",e))};Es.typeOf.string=function(e,t){if(typeof t!="string")throw new he(BC(typeof t,"string",e))};Es.typeOf.number=function(e,t){if(typeof t!="number")throw new he(BC(typeof t,"number",e))};Es.typeOf.number.lessThan=function(e,t,n){if(Es.typeOf.number(e,t),t>=n)throw new he(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Es.typeOf.number.lessThanOrEquals=function(e,t,n){if(Es.typeOf.number(e,t),t>n)throw new he(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Es.typeOf.number.greaterThan=function(e,t,n){if(Es.typeOf.number(e,t),t<=n)throw new he(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Es.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Es.typeOf.number(e,t),t<n)throw new he(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};Es.typeOf.object=function(e,t){if(typeof t!="object")throw new he(BC(typeof t,"object",e))};Es.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new he(BC(typeof t,"boolean",e))};Es.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new he(BC(typeof t,"bigint",e))};Es.typeOf.number.equals=function(e,t,n,i){if(Es.typeOf.number(e,n),Es.typeOf.number(t,i),n!==i)throw new he(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var bo=Es;function YQ(e,t){return e??t}YQ.EMPTY_OBJECT=Object.freeze({});var y=YQ;var m5=Zo(sV(),1);var rt={};rt.EPSILON1=.1;rt.EPSILON2=.01;rt.EPSILON3=.001;rt.EPSILON4=1e-4;rt.EPSILON5=1e-5;rt.EPSILON6=1e-6;rt.EPSILON7=1e-7;rt.EPSILON8=1e-8;rt.EPSILON9=1e-9;rt.EPSILON10=1e-10;rt.EPSILON11=1e-11;rt.EPSILON12=1e-12;rt.EPSILON13=1e-13;rt.EPSILON14=1e-14;rt.EPSILON15=1e-15;rt.EPSILON16=1e-16;rt.EPSILON17=1e-17;rt.EPSILON18=1e-18;rt.EPSILON19=1e-19;rt.EPSILON20=1e-20;rt.EPSILON21=1e-21;rt.GRAVITATIONALPARAMETER=3986004418e5;rt.SOLAR_RADIUS=6955e5;rt.LUNAR_RADIUS=1737400;rt.SIXTY_FOUR_KILOBYTES=64*1024;rt.FOUR_GIGABYTES=4*1024*1024*1024;rt.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});rt.signNotZero=function(e){return e<0?-1:1};rt.toSNorm=function(e,t){return t=y(t,255),Math.round((rt.clamp(e,-1,1)*.5+.5)*t)};rt.fromSNorm=function(e,t){return t=y(t,255),rt.clamp(e,0,t)/t*2-1};rt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:rt.clamp((e-t)/n,0,1)};rt.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});rt.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});rt.lerp=function(e,t,n){return(1-n)*e+n*t};rt.PI=Math.PI;rt.ONE_OVER_PI=1/Math.PI;rt.PI_OVER_TWO=Math.PI/2;rt.PI_OVER_THREE=Math.PI/3;rt.PI_OVER_FOUR=Math.PI/4;rt.PI_OVER_SIX=Math.PI/6;rt.THREE_PI_OVER_TWO=3*Math.PI/2;rt.TWO_PI=2*Math.PI;rt.ONE_OVER_TWO_PI=1/(2*Math.PI);rt.RADIANS_PER_DEGREE=Math.PI/180;rt.DEGREES_PER_RADIAN=180/Math.PI;rt.RADIANS_PER_ARCSECOND=rt.RADIANS_PER_DEGREE/3600;rt.toRadians=function(e){return e*rt.RADIANS_PER_DEGREE};rt.toDegrees=function(e){return e*rt.DEGREES_PER_RADIAN};rt.convertLongitudeRange=function(e){let t=rt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};rt.clampToLatitudeRange=function(e){return rt.clamp(e,-1*rt.PI_OVER_TWO,rt.PI_OVER_TWO)};rt.negativePiToPi=function(e){return e>=-rt.PI&&e<=rt.PI?e:rt.zeroToTwoPi(e+rt.PI)-rt.PI};rt.zeroToTwoPi=function(e){if(e>=0&&e<=rt.TWO_PI)return e;let t=rt.mod(e,rt.TWO_PI);return Math.abs(t)<rt.EPSILON14&&Math.abs(e)>rt.EPSILON14?rt.TWO_PI:t};rt.mod=function(e,t){return rt.sign(e)===rt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};rt.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};rt.lessThan=function(e,t,n){return e-t<-n};rt.lessThanOrEquals=function(e,t,n){return e-t<n};rt.greaterThan=function(e,t,n){return e-t>n};rt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var aV=[1];rt.factorial=function(e){let t=aV.length;if(e>=t){let n=aV[t-1];for(let i=t;i<=e;i++){let o=n*i;aV.push(o),n=o}}return aV[e]};rt.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};rt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};rt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};rt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};rt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var KQ=new m5.default;rt.setRandomNumberSeed=function(e){KQ=new m5.default(e)};rt.nextRandomNumber=function(){return KQ.random()};rt.randomBetween=function(e,t){return rt.nextRandomNumber()*(t-e)+e};rt.acosClamped=function(e){return Math.acos(rt.clamp(e,-1,1))};rt.asinClamped=function(e){return Math.asin(rt.clamp(e,-1,1))};rt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};rt.logBase=function(e,t){return Math.log(e)/Math.log(t)};rt.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});rt.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});rt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};rt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};rt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=rt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?rt.PI_OVER_TWO-i:i,i=e<0?rt.PI-i:i,i=t<0?-i:i,i};var P=rt;function $e(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}$e.fromSpherical=function(e,t){l(t)||(t=new $e);let n=e.clock,i=e.cone,o=y(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};$e.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new $e(e,t,n)};$e.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new $e(e.x,e.y,e.z)};$e.fromCartesian4=$e.clone;$e.packedLength=3;$e.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};$e.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new $e),n.x=e[t++],n.y=e[t++],n.z=e[t],n};$e.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)$e.pack(e[o],t,o*3);return t};$e.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=$e.unpack(e,i,t[o])}return t};$e.fromArray=$e.unpack;$e.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};$e.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};$e.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};$e.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};$e.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};$e.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};$e.magnitude=function(e){return Math.sqrt($e.magnitudeSquared(e))};var lV=new $e;$e.distance=function(e,t){return $e.subtract(e,t,lV),$e.magnitude(lV)};$e.distanceSquared=function(e,t){return $e.subtract(e,t,lV),$e.magnitudeSquared(lV)};$e.normalize=function(e,t){let n=$e.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};$e.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};$e.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};$e.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};$e.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};$e.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};$e.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};$e.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};$e.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};$e.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var ZQ=new $e;$e.lerp=function(e,t,n,i){return $e.multiplyByScalar(t,n,ZQ),i=$e.multiplyByScalar(e,1-n,i),$e.add(ZQ,i,i)};var cV=new $e,p5=new $e;$e.angleBetween=function(e,t){$e.normalize(e,cV),$e.normalize(t,p5);let n=$e.dot(cV,p5),i=$e.magnitude($e.cross(cV,p5,cV));return Math.atan2(i,n)};var $Ee=new $e;$e.mostOrthogonalAxis=function(e,t){let n=$e.normalize(e,$Ee);return $e.abs(n,n),n.x<=n.y?n.x<=n.z?t=$e.clone($e.UNIT_X,t):t=$e.clone($e.UNIT_Z,t):n.y<=n.z?t=$e.clone($e.UNIT_Y,t):t=$e.clone($e.UNIT_Z,t),t};$e.projectVector=function(e,t,n){let i=$e.dot(e,t)/$e.dot(t,t);return $e.multiplyByScalar(t,i,n)};$e.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};$e.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};$e.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)};$e.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,u=o*c-r*a,f=r*s-i*c,d=i*a-o*s;return n.x=u,n.y=f,n.z=d,n};$e.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};$e.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(e),t=P.toRadians(t),$e.fromRadians(e,t,n,i,o)};var gf=new $e,kC=new $e;$e._ellipsoidRadiiSquared=new $e(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);$e.fromRadians=function(e,t,n,i,o){n=y(n,0);let r=l(i)?i.radiiSquared:$e._ellipsoidRadiiSquared,s=Math.cos(t);gf.x=s*Math.cos(e),gf.y=s*Math.sin(e),gf.z=Math.sin(t),gf=$e.normalize(gf,gf),$e.multiplyComponents(r,gf,kC);let a=Math.sqrt($e.dot(gf,kC));return kC=$e.divideByScalar(kC,a,kC),gf=$e.multiplyByScalar(gf,n,gf),l(o)||(o=new $e),$e.add(kC,gf,o)};$e.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=$e.fromDegrees(r,s,0,t,n[a])}return n};$e.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=$e.fromRadians(r,s,0,t,n[a])}return n};$e.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=$e.fromDegrees(r,s,a,t,n[c])}return n};$e.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=$e.fromRadians(r,s,a,t,n[c])}return n};$e.ZERO=Object.freeze(new $e(0,0,0));$e.ONE=Object.freeze(new $e(1,1,1));$e.UNIT_X=Object.freeze(new $e(1,0,0));$e.UNIT_Y=Object.freeze(new $e(0,1,0));$e.UNIT_Z=Object.freeze(new $e(0,0,1));$e.prototype.clone=function(e){return $e.clone(this,e)};$e.prototype.equals=function(e){return $e.equals(this,e)};$e.prototype.equalsEpsilon=function(e,t,n){return $e.equalsEpsilon(this,e,t,n)};$e.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var h=$e;function yt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}yt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new yt(e,t,n,i)};yt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new yt(e.red,e.green,e.blue,e.alpha)};yt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new yt(e.x,e.y,e.z,e.w)};yt.packedLength=4;yt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};yt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new yt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};yt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)yt.pack(e[o],t,o*4);return t};yt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=yt.unpack(e,i,t[o])}return t};yt.fromArray=yt.unpack;yt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};yt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};yt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};yt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};yt.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z),a=P.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};yt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};yt.magnitude=function(e){return Math.sqrt(yt.magnitudeSquared(e))};var uV=new yt;yt.distance=function(e,t){return yt.subtract(e,t,uV),yt.magnitude(uV)};yt.distanceSquared=function(e,t){return yt.subtract(e,t,uV),yt.magnitudeSquared(uV)};yt.normalize=function(e,t){let n=yt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};yt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};yt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};yt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};yt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};yt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};yt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};yt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};yt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};yt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var $Q=new yt;yt.lerp=function(e,t,n,i){return yt.multiplyByScalar(t,n,$Q),i=yt.multiplyByScalar(e,1-n,i),yt.add($Q,i,i)};var QEe=new yt;yt.mostOrthogonalAxis=function(e,t){let n=yt.normalize(e,QEe);return yt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=yt.clone(yt.UNIT_X,t):t=yt.clone(yt.UNIT_W,t):n.z<=n.w?t=yt.clone(yt.UNIT_Z,t):t=yt.clone(yt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=yt.clone(yt.UNIT_Y,t):t=yt.clone(yt.UNIT_W,t):n.z<=n.w?t=yt.clone(yt.UNIT_Z,t):t=yt.clone(yt.UNIT_W,t),t};yt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};yt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};yt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)&&P.equalsEpsilon(e.w,t.w,n,i)};yt.ZERO=Object.freeze(new yt(0,0,0,0));yt.ONE=Object.freeze(new yt(1,1,1,1));yt.UNIT_X=Object.freeze(new yt(1,0,0,0));yt.UNIT_Y=Object.freeze(new yt(0,1,0,0));yt.UNIT_Z=Object.freeze(new yt(0,0,1,0));yt.UNIT_W=Object.freeze(new yt(0,0,0,1));yt.prototype.clone=function(e){return yt.clone(this,e)};yt.prototype.equals=function(e){return yt.equals(this,e)};yt.prototype.equalsEpsilon=function(e,t,n){return yt.equalsEpsilon(this,e,t,n)};yt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var _5=new Float32Array(1),ec=new Uint8Array(_5.buffer),JEe=new Uint32Array([287454020]),eSe=new Uint8Array(JEe.buffer),QQ=eSe[0]===68;yt.packFloat=function(e,t){return l(t)||(t=new yt),_5[0]=e,QQ?(t.x=ec[0],t.y=ec[1],t.z=ec[2],t.w=ec[3]):(t.x=ec[3],t.y=ec[2],t.z=ec[1],t.w=ec[0]),t};yt.unpackFloat=function(e){return QQ?(ec[0]=e.x,ec[1]=e.y,ec[2]=e.z,ec[3]=e.w):(ec[0]=e.w,ec[1]=e.z,ec[2]=e.y,ec[3]=e.x),_5[0]};var oe=yt;function Je(e,t,n,i,o,r,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(o,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(r,0),this[8]=y(c,0)}Je.packedLength=9;Je.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};Je.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Je),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};Je.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Je.pack(e[o],t,o*9);return t};Je.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=Je.unpack(e,i,t[o])}return t};Je.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new Je(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};Je.fromArray=Je.unpack;Je.fromColumnMajorArray=function(e,t){return Je.clone(e,t)};Je.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new Je(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Je.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,d=e.w*e.w,p=n-s-u+d,g=2*(i-f),m=2*(o+c),x=2*(i+f),b=-n+s-u+d,T=2*(a-r),C=2*(o-c),A=2*(a+r),E=-n-s+u+d;return l(t)?(t[0]=p,t[1]=x,t[2]=C,t[3]=g,t[4]=b,t[5]=A,t[6]=m,t[7]=T,t[8]=E,t):new Je(p,g,m,x,b,T,C,A,E)};Je.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,u=-o*s+a*r*i,f=a*s+o*r*i,d=n*s,p=o*i+a*r*s,g=-a*i+o*r*s,m=-r,x=a*n,b=o*n;return l(t)?(t[0]=c,t[1]=d,t[2]=m,t[3]=u,t[4]=p,t[5]=x,t[6]=f,t[7]=g,t[8]=b,t):new Je(c,u,f,d,p,g,m,x,b)};Je.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new Je(e.x,0,0,0,e.y,0,0,0,e.z)};Je.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new Je(e,0,0,0,e,0,0,0,e)};Je.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new Je(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};Je.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new Je(1,0,0,0,n,-i,0,i,n)};Je.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new Je(n,0,i,0,1,0,-i,0,n)};Je.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Je(n,-i,0,i,n,0,0,0,1)};Je.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};Je.getElementIndex=function(e,t){return e*3+t};Je.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};Je.setColumn=function(e,t,n,i){i=Je.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};Je.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};Je.setRow=function(e,t,n,i){return i=Je.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var tSe=new h;Je.setScale=function(e,t,n){let i=Je.getScale(e,tSe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var nSe=new h;Je.setUniformScale=function(e,t,n){let i=Je.getScale(e,nSe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var g5=new h;Je.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],g5)),t.y=h.magnitude(h.fromElements(e[3],e[4],e[5],g5)),t.z=h.magnitude(h.fromElements(e[6],e[7],e[8],g5)),t};var JQ=new h;Je.getMaximumScale=function(e){return Je.getScale(e,JQ),h.maximumComponent(JQ)};var iSe=new h;Je.setRotation=function(e,t,n){let i=Je.getScale(e,iSe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var oSe=new h;Je.getRotation=function(e,t){let n=Je.getScale(e,oSe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};Je.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n};Je.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};Je.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};Je.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};Je.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};Je.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};Je.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};Je.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};Je.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=f,t};function rSe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var y5=[1,0,0],x5=[2,2,1];function sSe(e){let t=0;for(let n=0;n<3;++n){let i=e[Je.getElementIndex(x5[n],y5[n])];t+=2*i*i}return Math.sqrt(t)}function aSe(e,t){let n=P.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[Je.getElementIndex(x5[u],y5[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=y5[o],c=x5[o];if(Math.abs(e[Je.getElementIndex(c,a)])>n){let u=e[Je.getElementIndex(c,c)],f=e[Je.getElementIndex(a,a)],d=e[Je.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=Je.clone(Je.IDENTITY,t),t[Je.getElementIndex(a,a)]=t[Je.getElementIndex(c,c)]=r,t[Je.getElementIndex(c,a)]=s,t[Je.getElementIndex(a,c)]=-s,t}var fV=new Je,eJ=new Je;Je.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=Je.clone(Je.IDENTITY,t.unitary),a=t.diagonal=Je.clone(e,t.diagonal),c=n*rSe(a);for(;r<i&&sSe(a)>c;)aSe(a,fV),Je.transpose(fV,eJ),Je.multiply(a,fV,a),Je.multiply(eJ,a,a),Je.multiply(s,fV,s),++o>2&&(++r,o=0);return t};Je.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};Je.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};Je.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],d=Je.determinant(e);t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=c*a-r*f,t[4]=n*f-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let p=1/d;return Je.multiplyByScalar(t,p,t)};var cSe=new Je;Je.inverseTranspose=function(e,t){return Je.inverse(Je.transpose(e,cSe),t)};Je.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};Je.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};Je.IDENTITY=Object.freeze(new Je(1,0,0,0,1,0,0,0,1));Je.ZERO=Object.freeze(new Je(0,0,0,0,0,0,0,0,0));Je.COLUMN0ROW0=0;Je.COLUMN0ROW1=1;Je.COLUMN0ROW2=2;Je.COLUMN1ROW0=3;Je.COLUMN1ROW1=4;Je.COLUMN1ROW2=5;Je.COLUMN2ROW0=6;Je.COLUMN2ROW1=7;Je.COLUMN2ROW2=8;Object.defineProperties(Je.prototype,{length:{get:function(){return Je.packedLength}}});Je.prototype.clone=function(e){return Je.clone(this,e)};Je.prototype.equals=function(e){return Je.equals(this,e)};Je.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};Je.prototype.equalsEpsilon=function(e,t){return Je.equalsEpsilon(this,e,t)};Je.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) (${this[2]}, ${this[5]}, ${this[8]})`};var $=Je;function Jv(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Jv.prototype=Object.create(Error.prototype),Jv.prototype.constructor=Jv);Jv.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var re=Jv;function Qe(e,t,n,i,o,r,s,a,c,u,f,d,p,g,m,x){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(u,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(m,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(d,0),this[15]=y(x,0)}Qe.packedLength=16;Qe.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};Qe.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Qe),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};Qe.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Qe.pack(e[o],t,o*16);return t};Qe.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=Qe.unpack(e,i,t[o])}return t};Qe.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new Qe(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};Qe.fromArray=Qe.unpack;Qe.fromColumnMajorArray=function(e,t){return Qe.clone(e,t)};Qe.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new Qe(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};Qe.fromRotationTranslation=function(e,t,n){return t=y(t,h.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new Qe(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};Qe.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new Qe);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,d=t.y*t.y,p=t.y*t.z,g=t.y*t.w,m=t.z*t.z,x=t.z*t.w,b=t.w*t.w,T=a-d-m+b,C=2*(c-x),A=2*(u+g),E=2*(c+x),v=-a+d-m+b,D=2*(p-f),O=2*(u-g),R=2*(p+f),M=-a-d+m+b;return i[0]=T*o,i[1]=E*o,i[2]=O*o,i[3]=0,i[4]=C*r,i[5]=v*r,i[6]=R*r,i[7]=0,i[8]=A*s,i[9]=D*s,i[10]=M*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};Qe.fromTranslationRotationScale=function(e,t){return Qe.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};Qe.fromTranslation=function(e,t){return Qe.fromRotationTranslation($.IDENTITY,e,t)};Qe.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Qe(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};Qe.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Qe(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};Qe.fromRotation=function(e,t){return l(t)||(t=new Qe),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var VC=new h,UC=new h,ew=new h;Qe.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;h.normalize(i,VC),h.normalize(h.cross(VC,o,UC),UC),h.normalize(h.cross(UC,VC,ew),ew);let r=UC.x,s=UC.y,a=UC.z,c=VC.x,u=VC.y,f=VC.z,d=ew.x,p=ew.y,g=ew.z,m=n.x,x=n.y,b=n.z,T=r*-m+s*-x+a*-b,C=d*-m+p*-x+g*-b,A=c*m+u*x+f*b;return l(t)?(t[0]=r,t[1]=d,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=T,t[13]=C,t[14]=A,t[15]=1,t):new Qe(r,s,a,T,d,p,g,C,-c,-u,-f,A,0,0,0,1)};Qe.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};Qe.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),u=1/(r-o),f=-(t+e)*a,d=-(i+n)*c,p=-(r+o)*u;return a*=2,c*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=d,s[14]=p,s[15]=1,s};Qe.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),d=-(r+o)/(r-o),p=-1,g=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};Qe.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,d=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=u,r[10]=f,r[11]=d,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};Qe.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new Qe),e=y(e,y.EMPTY_OBJECT);let o=y(e.x,0),r=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,u=a*.5,f=(n-t)*.5,d=c,p=u,g=f,m=o+c,x=r+u,b=t+f,T=1;return i[0]=d,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=m,i[13]=x,i[14]=b,i[15]=T,i};Qe.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-h.dot(i,e),o[13]=-h.dot(n,e),o[14]=h.dot(t,e),o[15]=1,o};Qe.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};Qe.getElementIndex=function(e,t){return e*4+t};Qe.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};Qe.setColumn=function(e,t,n,i){i=Qe.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};Qe.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};Qe.setRow=function(e,t,n,i){return i=Qe.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};Qe.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var aSe=new h;Qe.setScale=function(e,t,n){let i=Qe.getScale(e,aSe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var cSe=new h;Qe.setUniformScale=function(e,t,n){let i=Qe.getScale(e,cSe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var C5=new h;Qe.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],C5)),t.y=h.magnitude(h.fromElements(e[4],e[5],e[6],C5)),t.z=h.magnitude(h.fromElements(e[8],e[9],e[10],C5)),t};var tJ=new h;Qe.getMaximumScale=function(e){return Qe.getScale(e,tJ),h.maximumComponent(tJ)};var lSe=new h;Qe.setRotation=function(e,t,n){let i=Qe.getScale(e,lSe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var uSe=new h;Qe.getRotation=function(e,t){let n=Qe.getScale(e,uSe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};Qe.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],d=e[8],p=e[9],g=e[10],m=e[11],x=e[12],b=e[13],T=e[14],C=e[15],A=t[0],E=t[1],v=t[2],D=t[3],O=t[4],R=t[5],M=t[6],N=t[7],_=t[8],S=t[9],w=t[10],I=t[11],L=t[12],B=t[13],U=t[14],V=t[15],G=i*A+a*E+d*v+x*D,k=o*A+c*E+p*v+b*D,W=r*A+u*E+g*v+T*D,j=s*A+f*E+m*v+C*D,J=i*O+a*R+d*M+x*N,q=o*O+c*R+p*M+b*N,K=r*O+u*R+g*M+T*N,Q=s*O+f*R+m*M+C*N,de=i*_+a*S+d*w+x*I,ye=o*_+c*S+p*w+b*I,ce=r*_+u*S+g*w+T*I,_e=s*_+f*S+m*w+C*I,xe=i*L+a*B+d*U+x*V,De=o*L+c*B+p*U+b*V,Ae=r*L+u*B+g*U+T*V,ke=s*L+f*B+m*U+C*V;return n[0]=G,n[1]=k,n[2]=W,n[3]=j,n[4]=J,n[5]=q,n[6]=K,n[7]=Q,n[8]=de,n[9]=ye,n[10]=ce,n[11]=_e,n[12]=xe,n[13]=De,n[14]=Ae,n[15]=ke,n};Qe.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};Qe.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};Qe.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=e[12],g=e[13],m=e[14],x=t[0],b=t[1],T=t[2],C=t[4],A=t[5],E=t[6],v=t[8],D=t[9],O=t[10],R=t[12],M=t[13],N=t[14],_=i*x+s*b+u*T,S=o*x+a*b+f*T,w=r*x+c*b+d*T,I=i*C+s*A+u*E,L=o*C+a*A+f*E,B=r*C+c*A+d*E,U=i*v+s*D+u*O,V=o*v+a*D+f*O,G=r*v+c*D+d*O,k=i*R+s*M+u*N+p,W=o*R+a*M+f*N+g,j=r*R+c*M+d*N+m;return n[0]=_,n[1]=S,n[2]=w,n[3]=0,n[4]=I,n[5]=L,n[6]=B,n[7]=0,n[8]=U,n[9]=V,n[10]=G,n[11]=0,n[12]=k,n[13]=W,n[14]=j,n[15]=1,n};Qe.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=t[0],g=t[1],m=t[2],x=t[3],b=t[4],T=t[5],C=t[6],A=t[7],E=t[8],v=i*p+s*g+u*m,D=o*p+a*g+f*m,O=r*p+c*g+d*m,R=i*x+s*b+u*T,M=o*x+a*b+f*T,N=r*x+c*b+d*T,_=i*C+s*A+u*E,S=o*C+a*A+f*E,w=r*C+c*A+d*E;return n[0]=v,n[1]=D,n[2]=O,n[3]=0,n[4]=R,n[5]=M,n[6]=N,n[7]=0,n[8]=_,n[9]=S,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Qe.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};Qe.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?Qe.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};Qe.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Qe.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};Qe.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};Qe.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};Qe.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};Qe.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};Qe.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};Qe.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};Qe.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};Qe.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};Qe.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};Qe.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var fSe=new $,dSe=new $,hSe=new oe,mSe=new oe(0,0,0,1);Qe.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],u=e[13],f=e[2],d=e[6],p=e[10],g=e[14],m=e[3],x=e[7],b=e[11],T=e[15],C=p*T,A=g*b,E=d*T,v=g*x,D=d*b,O=p*x,R=f*T,M=g*m,N=f*b,_=p*m,S=f*x,w=d*m,I=C*a+v*c+D*u-(A*a+E*c+O*u),L=A*s+R*c+_*u-(C*s+M*c+N*u),B=E*s+M*a+S*u-(v*s+R*a+w*u),U=O*s+N*a+w*c-(D*s+_*a+S*c),V=A*i+E*o+O*r-(C*i+v*o+D*r),G=C*n+M*o+N*r-(A*n+R*o+_*r),k=v*n+R*i+w*r-(E*n+M*i+S*r),W=D*n+_*i+S*o-(O*n+N*i+w*o);C=o*u,A=r*c,E=i*u,v=r*a,D=i*c,O=o*a,R=n*u,M=r*s,N=n*c,_=o*s,S=n*a,w=i*s;let j=C*x+v*b+D*T-(A*x+E*b+O*T),J=A*m+R*b+_*T-(C*m+M*b+N*T),q=E*m+M*x+S*T-(v*m+R*x+w*T),K=O*m+N*x+w*b-(D*m+_*x+S*b),Q=E*p+O*g+A*d-(D*g+C*d+v*p),de=N*g+C*f+M*p-(R*p+_*g+A*f),ye=R*d+w*g+v*f-(S*g+E*f+M*d),ce=S*p+D*f+_*d-(N*d+w*p+O*f),_e=n*I+i*L+o*B+r*U;if(Math.abs(_e)<P.EPSILON21){if($.equalsEpsilon(Qe.getMatrix3(e,fSe),dSe,P.EPSILON7)&&oe.equals(Qe.getRow(e,3,hSe),mSe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new re("matrix is not invertible because its determinate is zero.")}return _e=1/_e,t[0]=I*_e,t[1]=L*_e,t[2]=B*_e,t[3]=U*_e,t[4]=V*_e,t[5]=G*_e,t[6]=k*_e,t[7]=W*_e,t[8]=j*_e,t[9]=J*_e,t[10]=q*_e,t[11]=K*_e,t[12]=Q*_e,t[13]=de*_e,t[14]=ye*_e,t[15]=ce*_e,t};Qe.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],u=e[9],f=e[10],d=e[12],p=e[13],g=e[14],m=-n*d-i*p-o*g,x=-r*d-s*p-a*g,b=-c*d-u*p-f*g;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=m,t[13]=x,t[14]=b,t[15]=1,t};var pSe=new Qe;Qe.inverseTranspose=function(e,t){return Qe.inverse(Qe.transpose(e,pSe),t)};Qe.IDENTITY=Object.freeze(new Qe(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));Qe.ZERO=Object.freeze(new Qe(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));Qe.COLUMN0ROW0=0;Qe.COLUMN0ROW1=1;Qe.COLUMN0ROW2=2;Qe.COLUMN0ROW3=3;Qe.COLUMN1ROW0=4;Qe.COLUMN1ROW1=5;Qe.COLUMN1ROW2=6;Qe.COLUMN1ROW3=7;Qe.COLUMN2ROW0=8;Qe.COLUMN2ROW1=9;Qe.COLUMN2ROW2=10;Qe.COLUMN2ROW3=11;Qe.COLUMN3ROW0=12;Qe.COLUMN3ROW1=13;Qe.COLUMN3ROW2=14;Qe.COLUMN3ROW3=15;Object.defineProperties(Qe.prototype,{length:{get:function(){return Qe.packedLength}}});Qe.prototype.clone=function(e){return Qe.clone(this,e)};Qe.prototype.equals=function(e){return Qe.equals(this,e)};Qe.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};Qe.prototype.equalsEpsilon=function(e,t){return Qe.equalsEpsilon(this,e,t)};Qe.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) +${this.stack.toString()}`),e};var re=Jv;function Qe(e,t,n,i,o,r,s,a,c,u,f,d,p,g,m,x){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(u,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(m,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(d,0),this[15]=y(x,0)}Qe.packedLength=16;Qe.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};Qe.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Qe),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};Qe.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Qe.pack(e[o],t,o*16);return t};Qe.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=Qe.unpack(e,i,t[o])}return t};Qe.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new Qe(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};Qe.fromArray=Qe.unpack;Qe.fromColumnMajorArray=function(e,t){return Qe.clone(e,t)};Qe.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new Qe(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};Qe.fromRotationTranslation=function(e,t,n){return t=y(t,h.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new Qe(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};Qe.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new Qe);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,d=t.y*t.y,p=t.y*t.z,g=t.y*t.w,m=t.z*t.z,x=t.z*t.w,b=t.w*t.w,T=a-d-m+b,C=2*(c-x),A=2*(u+g),E=2*(c+x),v=-a+d-m+b,D=2*(p-f),O=2*(u-g),R=2*(p+f),M=-a-d+m+b;return i[0]=T*o,i[1]=E*o,i[2]=O*o,i[3]=0,i[4]=C*r,i[5]=v*r,i[6]=R*r,i[7]=0,i[8]=A*s,i[9]=D*s,i[10]=M*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};Qe.fromTranslationRotationScale=function(e,t){return Qe.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};Qe.fromTranslation=function(e,t){return Qe.fromRotationTranslation($.IDENTITY,e,t)};Qe.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Qe(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};Qe.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Qe(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};Qe.fromRotation=function(e,t){return l(t)||(t=new Qe),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var VC=new h,UC=new h,ew=new h;Qe.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;h.normalize(i,VC),h.normalize(h.cross(VC,o,UC),UC),h.normalize(h.cross(UC,VC,ew),ew);let r=UC.x,s=UC.y,a=UC.z,c=VC.x,u=VC.y,f=VC.z,d=ew.x,p=ew.y,g=ew.z,m=n.x,x=n.y,b=n.z,T=r*-m+s*-x+a*-b,C=d*-m+p*-x+g*-b,A=c*m+u*x+f*b;return l(t)?(t[0]=r,t[1]=d,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=T,t[13]=C,t[14]=A,t[15]=1,t):new Qe(r,s,a,T,d,p,g,C,-c,-u,-f,A,0,0,0,1)};Qe.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};Qe.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),u=1/(r-o),f=-(t+e)*a,d=-(i+n)*c,p=-(r+o)*u;return a*=2,c*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=d,s[14]=p,s[15]=1,s};Qe.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),d=-(r+o)/(r-o),p=-1,g=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};Qe.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,d=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=u,r[10]=f,r[11]=d,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};Qe.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new Qe),e=y(e,y.EMPTY_OBJECT);let o=y(e.x,0),r=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,u=a*.5,f=(n-t)*.5,d=c,p=u,g=f,m=o+c,x=r+u,b=t+f,T=1;return i[0]=d,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=m,i[13]=x,i[14]=b,i[15]=T,i};Qe.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-h.dot(i,e),o[13]=-h.dot(n,e),o[14]=h.dot(t,e),o[15]=1,o};Qe.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};Qe.getElementIndex=function(e,t){return e*4+t};Qe.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};Qe.setColumn=function(e,t,n,i){i=Qe.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};Qe.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};Qe.setRow=function(e,t,n,i){return i=Qe.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};Qe.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var lSe=new h;Qe.setScale=function(e,t,n){let i=Qe.getScale(e,lSe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var uSe=new h;Qe.setUniformScale=function(e,t,n){let i=Qe.getScale(e,uSe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var b5=new h;Qe.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],b5)),t.y=h.magnitude(h.fromElements(e[4],e[5],e[6],b5)),t.z=h.magnitude(h.fromElements(e[8],e[9],e[10],b5)),t};var tJ=new h;Qe.getMaximumScale=function(e){return Qe.getScale(e,tJ),h.maximumComponent(tJ)};var fSe=new h;Qe.setRotation=function(e,t,n){let i=Qe.getScale(e,fSe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var dSe=new h;Qe.getRotation=function(e,t){let n=Qe.getScale(e,dSe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};Qe.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],d=e[8],p=e[9],g=e[10],m=e[11],x=e[12],b=e[13],T=e[14],C=e[15],A=t[0],E=t[1],v=t[2],D=t[3],O=t[4],R=t[5],M=t[6],N=t[7],_=t[8],S=t[9],w=t[10],I=t[11],L=t[12],B=t[13],U=t[14],V=t[15],G=i*A+a*E+d*v+x*D,k=o*A+c*E+p*v+b*D,W=r*A+u*E+g*v+T*D,q=s*A+f*E+m*v+C*D,J=i*O+a*R+d*M+x*N,j=o*O+c*R+p*M+b*N,K=r*O+u*R+g*M+T*N,Q=s*O+f*R+m*M+C*N,de=i*_+a*S+d*w+x*I,xe=o*_+c*S+p*w+b*I,ce=r*_+u*S+g*w+T*I,ge=s*_+f*S+m*w+C*I,be=i*L+a*B+d*U+x*V,De=o*L+c*B+p*U+b*V,Ae=r*L+u*B+g*U+T*V,ke=s*L+f*B+m*U+C*V;return n[0]=G,n[1]=k,n[2]=W,n[3]=q,n[4]=J,n[5]=j,n[6]=K,n[7]=Q,n[8]=de,n[9]=xe,n[10]=ce,n[11]=ge,n[12]=be,n[13]=De,n[14]=Ae,n[15]=ke,n};Qe.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};Qe.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};Qe.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=e[12],g=e[13],m=e[14],x=t[0],b=t[1],T=t[2],C=t[4],A=t[5],E=t[6],v=t[8],D=t[9],O=t[10],R=t[12],M=t[13],N=t[14],_=i*x+s*b+u*T,S=o*x+a*b+f*T,w=r*x+c*b+d*T,I=i*C+s*A+u*E,L=o*C+a*A+f*E,B=r*C+c*A+d*E,U=i*v+s*D+u*O,V=o*v+a*D+f*O,G=r*v+c*D+d*O,k=i*R+s*M+u*N+p,W=o*R+a*M+f*N+g,q=r*R+c*M+d*N+m;return n[0]=_,n[1]=S,n[2]=w,n[3]=0,n[4]=I,n[5]=L,n[6]=B,n[7]=0,n[8]=U,n[9]=V,n[10]=G,n[11]=0,n[12]=k,n[13]=W,n[14]=q,n[15]=1,n};Qe.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],d=e[10],p=t[0],g=t[1],m=t[2],x=t[3],b=t[4],T=t[5],C=t[6],A=t[7],E=t[8],v=i*p+s*g+u*m,D=o*p+a*g+f*m,O=r*p+c*g+d*m,R=i*x+s*b+u*T,M=o*x+a*b+f*T,N=r*x+c*b+d*T,_=i*C+s*A+u*E,S=o*C+a*A+f*E,w=r*C+c*A+d*E;return n[0]=v,n[1]=D,n[2]=O,n[3]=0,n[4]=R,n[5]=M,n[6]=N,n[7]=0,n[8]=_,n[9]=S,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Qe.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};Qe.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?Qe.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};Qe.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Qe.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};Qe.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};Qe.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};Qe.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};Qe.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};Qe.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};Qe.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};Qe.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};Qe.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};Qe.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};Qe.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var hSe=new $,mSe=new $,pSe=new oe,_Se=new oe(0,0,0,1);Qe.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],u=e[13],f=e[2],d=e[6],p=e[10],g=e[14],m=e[3],x=e[7],b=e[11],T=e[15],C=p*T,A=g*b,E=d*T,v=g*x,D=d*b,O=p*x,R=f*T,M=g*m,N=f*b,_=p*m,S=f*x,w=d*m,I=C*a+v*c+D*u-(A*a+E*c+O*u),L=A*s+R*c+_*u-(C*s+M*c+N*u),B=E*s+M*a+S*u-(v*s+R*a+w*u),U=O*s+N*a+w*c-(D*s+_*a+S*c),V=A*i+E*o+O*r-(C*i+v*o+D*r),G=C*n+M*o+N*r-(A*n+R*o+_*r),k=v*n+R*i+w*r-(E*n+M*i+S*r),W=D*n+_*i+S*o-(O*n+N*i+w*o);C=o*u,A=r*c,E=i*u,v=r*a,D=i*c,O=o*a,R=n*u,M=r*s,N=n*c,_=o*s,S=n*a,w=i*s;let q=C*x+v*b+D*T-(A*x+E*b+O*T),J=A*m+R*b+_*T-(C*m+M*b+N*T),j=E*m+M*x+S*T-(v*m+R*x+w*T),K=O*m+N*x+w*b-(D*m+_*x+S*b),Q=E*p+O*g+A*d-(D*g+C*d+v*p),de=N*g+C*f+M*p-(R*p+_*g+A*f),xe=R*d+w*g+v*f-(S*g+E*f+M*d),ce=S*p+D*f+_*d-(N*d+w*p+O*f),ge=n*I+i*L+o*B+r*U;if(Math.abs(ge)<P.EPSILON21){if($.equalsEpsilon(Qe.getMatrix3(e,hSe),mSe,P.EPSILON7)&&oe.equals(Qe.getRow(e,3,pSe),_Se))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new re("matrix is not invertible because its determinate is zero.")}return ge=1/ge,t[0]=I*ge,t[1]=L*ge,t[2]=B*ge,t[3]=U*ge,t[4]=V*ge,t[5]=G*ge,t[6]=k*ge,t[7]=W*ge,t[8]=q*ge,t[9]=J*ge,t[10]=j*ge,t[11]=K*ge,t[12]=Q*ge,t[13]=de*ge,t[14]=xe*ge,t[15]=ce*ge,t};Qe.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],u=e[9],f=e[10],d=e[12],p=e[13],g=e[14],m=-n*d-i*p-o*g,x=-r*d-s*p-a*g,b=-c*d-u*p-f*g;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=m,t[13]=x,t[14]=b,t[15]=1,t};var gSe=new Qe;Qe.inverseTranspose=function(e,t){return Qe.inverse(Qe.transpose(e,gSe),t)};Qe.IDENTITY=Object.freeze(new Qe(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));Qe.ZERO=Object.freeze(new Qe(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));Qe.COLUMN0ROW0=0;Qe.COLUMN0ROW1=1;Qe.COLUMN0ROW2=2;Qe.COLUMN0ROW3=3;Qe.COLUMN1ROW0=4;Qe.COLUMN1ROW1=5;Qe.COLUMN1ROW2=6;Qe.COLUMN1ROW3=7;Qe.COLUMN2ROW0=8;Qe.COLUMN2ROW1=9;Qe.COLUMN2ROW2=10;Qe.COLUMN2ROW3=11;Qe.COLUMN3ROW0=12;Qe.COLUMN3ROW1=13;Qe.COLUMN3ROW2=14;Qe.COLUMN3ROW3=15;Object.defineProperties(Qe.prototype,{length:{get:function(){return Qe.packedLength}}});Qe.prototype.clone=function(e){return Qe.clone(this,e)};Qe.prototype.equals=function(e){return Qe.equals(this,e)};Qe.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};Qe.prototype.equalsEpsilon=function(e,t){return Qe.equalsEpsilon(this,e,t)};Qe.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]}) (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]}) -(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var F=Qe;var _Se={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},te=Object.freeze(_Se);var gSe=new h;function Dt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var sa={};sa[te.FLOAT]="float";sa[te.FLOAT_VEC2]="vec2";sa[te.FLOAT_VEC3]="vec3";sa[te.FLOAT_VEC4]="vec4";sa[te.INT]="int";sa[te.INT_VEC2]="ivec2";sa[te.INT_VEC3]="ivec3";sa[te.INT_VEC4]="ivec4";sa[te.BOOL]="bool";sa[te.BOOL_VEC2]="bvec2";sa[te.BOOL_VEC3]="bvec3";sa[te.BOOL_VEC4]="bvec4";sa[te.FLOAT_MAT2]="mat2";sa[te.FLOAT_MAT3]="mat3";sa[te.FLOAT_MAT4]="mat4";sa[te.SAMPLER_2D]="sampler2D";sa[te.SAMPLER_CUBE]="samplerCube";Dt.prototype.getDeclaration=function(e){let t=`uniform ${sa[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var ySe={czm_viewport:new Dt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Dt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Dt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Dt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Dt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Dt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Dt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,gSe)}}),czm_frameNumber:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Dt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Dt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Dt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Dt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Dt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Dt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Tp=ySe;function xSe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Hn=xSe;function bSe(){return!0}function TSe(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=bSe}var ue=TSe;var Vs={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};Vs.getSizeInBytes=function(e){switch(e){case Vs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Vs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Vs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Vs.fromSizeInBytes=function(e){switch(e){case 2:return Vs.UNSIGNED_SHORT;case 4:return Vs.UNSIGNED_INT;case 1:return Vs.UNSIGNED_BYTE}};Vs.validate=function(e){return l(e)&&(e===Vs.UNSIGNED_BYTE||e===Vs.UNSIGNED_SHORT||e===Vs.UNSIGNED_INT)};Vs.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Vs.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Vs.fromTypedArray=function(e){if(e instanceof Uint8Array)return Vs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Vs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Vs.UNSIGNED_INT};var Ne=Object.freeze(Vs);var dV={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,validate:function(e){return e===dV.STREAM_DRAW||e===dV.STATIC_DRAW||e===dV.DYNAMIC_DRAW}},Fe=Object.freeze(dV);function xf(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Hn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}xf.createVertexBuffer=function(e){return new xf({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};xf.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ne.getSizeInBytes(n),o=new xf({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(xf.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});xf.prototype._getBuffer=function(){return this._buffer};xf.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};xf.prototype.copyFromBuffer=function(e,t,n,i){let o=te.COPY_READ_BUFFER,r=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};xf.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=te.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};xf.prototype.isDestroyed=function(){return!1};xf.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var gt=xf;var Mg,Mr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Sl={};Object.defineProperties(Sl,{element:{get:function(){if(Sl.supportsFullscreen())return document[Mr.fullscreenElement]}},changeEventName:{get:function(){if(Sl.supportsFullscreen())return Mr.fullscreenchange}},errorEventName:{get:function(){if(Sl.supportsFullscreen())return Mr.fullscreenerror}},enabled:{get:function(){if(Sl.supportsFullscreen())return document[Mr.fullscreenEnabled]}},fullscreen:{get:function(){if(Sl.supportsFullscreen())return Sl.element!==null}}});Sl.supportsFullscreen=function(){if(l(Mg))return Mg;Mg=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Mr.requestFullscreen="requestFullscreen",Mr.exitFullscreen="exitFullscreen",Mr.fullscreenEnabled="fullscreenEnabled",Mr.fullscreenElement="fullscreenElement",Mr.fullscreenchange="fullscreenchange",Mr.fullscreenerror="fullscreenerror",Mg=!0,Mg;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(Mr.requestFullscreen=n,Mg=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Mr.requestFullscreen=n,Mg=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Mr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Mr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Mr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Mr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Mr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Mr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Mr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Mr.fullscreenerror=n)}return Mg};Sl.requestFullscreen=function(e,t){Sl.supportsFullscreen()&&e[Mr.requestFullscreen]({vrDisplay:t})};Sl.exitFullscreen=function(){Sl.supportsFullscreen()&&document[Mr.exitFullscreen]()};Sl._names=Mr;var xr=Sl;var ec;typeof navigator<"u"?ec=navigator:ec={};function nx(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var hV,nJ;function D5(){if(!l(hV)&&(hV=!1,!xV())){let e=/ Chrome\/([\.0-9]+)/.exec(ec.userAgent);e!==null&&(hV=!0,nJ=nx(e[1]))}return hV}function CSe(){return D5()&&nJ}var mV,iJ;function oJ(){if(!l(mV)&&(mV=!1,!D5()&&!xV()&&/ Safari\/[\.0-9]+/.test(ec.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(ec.userAgent);e!==null&&(mV=!0,iJ=nx(e[1]))}return mV}function ASe(){return oJ()&&iJ}var pV,v5;function rJ(){if(!l(pV)){pV=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(ec.userAgent);e!==null&&(pV=!0,v5=nx(e[1]),v5.isNightly=!!e[2])}return pV}function ESe(){return rJ()&&v5}var tw,w5;function sJ(){if(!l(tw)){tw=!1;let e;ec.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(ec.userAgent),e!==null&&(tw=!0,w5=nx(e[1]))):ec.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(ec.userAgent),e!==null&&(tw=!0,w5=nx(e[1])))}return tw}function SSe(){return sJ()&&w5}var _V,aJ;function xV(){if(!l(_V)){_V=!1;let e=/ Edg\/([\.0-9]+)/.exec(ec.userAgent);e!==null&&(_V=!0,aJ=nx(e[1]))}return _V}function vSe(){return xV()&&aJ}var gV,I5;function bV(){if(!l(gV)){gV=!1;let e=/Firefox\/([\.0-9]+)/.exec(ec.userAgent);e!==null&&(gV=!0,I5=nx(e[1]))}return gV}var A5;function wSe(){return l(A5)||(A5=/Windows/i.test(ec.appVersion)),A5}var E5;function DSe(){return l(E5)||(E5=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),E5}function ISe(){return bV()&&I5}var S5;function PSe(){return l(S5)||(S5=!bV()&&typeof PointerEvent<"u"&&(!l(ec.pointerEnabled)||ec.pointerEnabled)),S5}var cJ,yV;function lJ(){if(!l(yV)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;yV=l(t)&&t!=="",yV&&(cJ=t)}return yV}function RSe(){return lJ()?cJ:void 0}function Bc(){return Bc._result}Bc._promise=void 0;Bc._result=void 0;Bc.initialize=function(){return l(Bc._promise)||(Bc._promise=new Promise(e=>{let t=new Image;t.onload=function(){Bc._result=t.width>0&&t.height>0,e(Bc._result)},t.onerror=function(){Bc._result=!1,e(Bc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Bc._promise};Object.defineProperties(Bc,{initialized:{get:function(){return l(Bc._result)}}});var zC=[];typeof ArrayBuffer<"u"&&(zC.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&zC.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&zC.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&zC.push(BigInt64Array),typeof BigUint64Array<"u"&&zC.push(BigUint64Array));var bf={isChrome:D5,chromeVersion:CSe,isSafari:oJ,safariVersion:ASe,isWebkit:rJ,webkitVersion:ESe,isInternetExplorer:sJ,internetExplorerVersion:SSe,isEdge:xV,edgeVersion:vSe,isFirefox:bV,firefoxVersion:ISe,isWindows:wSe,isIPadOrIOS:DSe,hardwareConcurrency:y(ec.hardwareConcurrency,3),supportsPointerEvents:PSe,supportsImageRenderingPixelated:lJ,supportsWebP:Bc,imageRenderingValue:RSe,typedArrayTypes:zC};bf.supportsBasis=function(e){return bf.supportsWebAssembly()&&e.context.supportsBasis};bf.supportsFullscreen=function(){return xr.supportsFullscreen()};bf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};bf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};bf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};bf.supportsBigInt=function(){return typeof BigInt<"u"};bf.supportsWebWorkers=function(){return typeof Worker<"u"};bf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};bf.supportsWebgl2=function(e){return e.context.webgl2};bf.supportsEsmWebWorkers=function(){return!bV()||parseInt(I5)>=114};var Ht=bf;function P5(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,o){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var R5,O5,Cp;Ht.supportsTypedArrays()&&(R5=new ArrayBuffer(4),O5=new Uint32Array(R5),Cp=new Uint8Array(R5));ie.fromRgba=function(e,t){return O5[0]=e,ie.fromBytes(Cp[0],Cp[1],Cp[2],Cp[3],t)};ie.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=P5(u,c,e+1/3),s=P5(u,c,e),a=P5(u,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new ie(r,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+P.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+P.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+P.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new ie(n,i,o,r)};var OSe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,MSe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,LSe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,NSe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){l(t)||(t=new ie),e=e.trim();let n=ie[e.toUpperCase()];if(l(n))return ie.clone(n,t),t;let i=OSe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=MSe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=LSe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=NSe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),o=ie.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};ie.prototype.toRgba=function(){return Cp[0]=ie.floatToByte(this.red),Cp[1]=ie.floatToByte(this.green),Cp[2]=ie.floatToByte(this.blue),Cp[3]=ie.floatToByte(this.alpha),O5[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var H=ie;function TV(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}TV.ALL=Object.freeze(new TV({color:new H(0,0,0,0),depth:1,stencil:0}));TV.prototype.execute=function(e,t){e.clear(this,t)};var Jn=TV;var FSe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},we=Object.freeze(FSe);function uJ(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=we.COMPUTE,this.owner=e.owner}uJ.prototype.execute=function(e){e.execute(this)};var kc=uJ;function Bt(e,t){this.x=y(e,0),this.y=y(t,0)}Bt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Bt(e,t)};Bt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Bt(e.x,e.y)};Bt.fromCartesian3=Bt.clone;Bt.fromCartesian4=Bt.clone;Bt.packedLength=2;Bt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Bt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Bt),n.x=e[t++],n.y=e[t],n};Bt.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Bt.pack(e[o],t,o*2);return t};Bt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Bt.unpack(e,i,t[o])}return t};Bt.fromArray=Bt.unpack;Bt.maximumComponent=function(e){return Math.max(e.x,e.y)};Bt.minimumComponent=function(e){return Math.min(e.x,e.y)};Bt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Bt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Bt.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Bt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Bt.magnitude=function(e){return Math.sqrt(Bt.magnitudeSquared(e))};var CV=new Bt;Bt.distance=function(e,t){return Bt.subtract(e,t,CV),Bt.magnitude(CV)};Bt.distanceSquared=function(e,t){return Bt.subtract(e,t,CV),Bt.magnitudeSquared(CV)};Bt.normalize=function(e,t){let n=Bt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Bt.dot=function(e,t){return e.x*t.x+e.y*t.y};Bt.cross=function(e,t){return e.x*t.y-e.y*t.x};Bt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Bt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Bt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Bt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Bt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Bt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Bt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Bt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var fJ=new Bt;Bt.lerp=function(e,t,n,i){return Bt.multiplyByScalar(t,n,fJ),i=Bt.multiplyByScalar(e,1-n,i),Bt.add(fJ,i,i)};var dJ=new Bt,hJ=new Bt;Bt.angleBetween=function(e,t){return Bt.normalize(e,dJ),Bt.normalize(t,hJ),P.acosClamped(Bt.dot(dJ,hJ))};var BSe=new Bt;Bt.mostOrthogonalAxis=function(e,t){let n=Bt.normalize(e,BSe);return Bt.abs(n,n),n.x<=n.y?t=Bt.clone(Bt.UNIT_X,t):t=Bt.clone(Bt.UNIT_Y,t),t};Bt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Bt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Bt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)};Bt.ZERO=Object.freeze(new Bt(0,0));Bt.ONE=Object.freeze(new Bt(1,1));Bt.UNIT_X=Object.freeze(new Bt(1,0));Bt.UNIT_Y=Object.freeze(new Bt(0,1));Bt.prototype.clone=function(e){return Bt.clone(this,e)};Bt.prototype.equals=function(e){return Bt.equals(this,e)};Bt.prototype.equalsEpsilon=function(e,t,n){return Bt.equalsEpsilon(this,e,t,n)};Bt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var z=Bt;var kSe=new h,VSe=new h;function USe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=r*r*c*c,p=s*s*u*u,g=a*a*f*f,m=d+p+g,x=Math.sqrt(1/m),b=h.multiplyByScalar(e,x,kSe);if(m<i)return isFinite(x)?h.clone(b,o):void 0;let T=n.x,C=n.y,A=n.z,E=VSe;E.x=b.x*T*2,E.y=b.y*C*2,E.z=b.z*A*2;let v=(1-x)*h.magnitude(e)/(.5*h.magnitude(E)),D=0,O,R,M,N,_,S,w,I,L,B,U;do{v-=D,M=1/(1+v*T),N=1/(1+v*C),_=1/(1+v*A),S=M*M,w=N*N,I=_*_,L=S*M,B=w*N,U=I*_,O=d*S+p*w+g*I-1,R=d*L*T+p*B*C+g*U*A;let V=-2*R;D=O/V}while(Math.abs(O)>P.EPSILON12);return l(o)?(o.x=r*M,o.y=s*N,o.z=a*_,o):new h(r*M,s*N,a*_)}var ix=USe;function zo(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}zo.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new zo(e,t,n)};zo.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),zo.fromRadians(e,t,n,i)};var zSe=new h,HSe=new h,GSe=new h;zo._ellipsoidOneOverRadii=new h(1/6378137,1/6378137,1/6356752314245179e-9);zo._ellipsoidOneOverRadiiSquared=new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));zo._ellipsoidCenterToleranceSquared=P.EPSILON1;zo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:zo._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:zo._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:zo._ellipsoidCenterToleranceSquared,s=ix(e,i,o,r,HSe);if(!l(s))return;let a=h.multiplyComponents(s,o,zSe);a=h.normalize(a,a);let c=h.subtract(e,s,GSe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=P.sign(h.dot(c,e))*h.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new zo(u,f,d)};zo.toCartesian=function(e,t,n){return h.fromRadians(e.longitude,e.latitude,e.height,t,n)};zo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new zo(e.longitude,e.latitude,e.height)};zo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};zo.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};zo.ZERO=Object.freeze(new zo(0,0,0));zo.prototype.clone=function(e){return zo.clone(this,e)};zo.prototype.equals=function(e){return zo.equals(this,e)};zo.prototype.equalsEpsilon=function(e,t){return zo.equalsEpsilon(this,e,t)};zo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var fe=zo;function pJ(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function pi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,pJ(this,e,t,n)}Object.defineProperties(pi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});pi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(h.clone(n,t._radii),h.clone(e._radiiSquared,t._radiiSquared),h.clone(e._radiiToTheFourth,t._radiiToTheFourth),h.clone(e._oneOverRadii,t._oneOverRadii),h.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new pi(n.x,n.y,n.z)};pi.fromCartesian3=function(e,t){return l(t)||(t=new pi),l(e)&&pJ(t,e.x,e.y,e.z),t};pi.WGS84=Object.freeze(new pi(6378137,6378137,6356752314245179e-9));pi.UNIT_SPHERE=Object.freeze(new pi(1,1,1));pi.MOON=Object.freeze(new pi(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));pi._default=pi.WGS84;Object.defineProperties(pi,{default:{get:function(){return pi._default},set:function(e){pi._default=e,h._ellipsoidRadiiSquared=e.radiiSquared,fe._ellipsoidOneOverRadii=e.oneOverRadii,fe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,fe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});pi.prototype.clone=function(e){return pi.clone(this,e)};pi.packedLength=h.packedLength;pi.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),t};pi.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t);return pi.fromCartesian3(i,n)};pi.prototype.geocentricSurfaceNormal=h.normalize;pi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new h),t.x=r,t.y=s,t.z=a,h.normalize(t,t)};pi.prototype.geodeticSurfaceNormal=function(e,t){if(!h.equalsEpsilon(e,h.ZERO,P.EPSILON14))return l(t)||(t=new h),t=h.multiplyComponents(e,this._oneOverRadiiSquared,t),h.normalize(t,t)};var WSe=new h,jSe=new h;pi.prototype.cartographicToCartesian=function(e,t){let n=WSe,i=jSe;this.geodeticSurfaceNormalCartographic(e,n),h.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(h.dot(n,i));return h.divideByScalar(i,o,i),h.multiplyByScalar(n,e.height,n),l(t)||(t=new h),h.add(i,n,t)};pi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var qSe=new h,YSe=new h,XSe=new h;pi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,YSe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,qSe),o=h.subtract(e,n,XSe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=P.sign(h.dot(o,e))*h.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new fe(r,s,a)};pi.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};pi.prototype.scaleToGeodeticSurface=function(e,t){return ix(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};pi.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new h);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return h.multiplyByScalar(e,s,t)};pi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._oneOverRadii,t)};pi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._radii,t)};pi.prototype.equals=function(e){return this===e||l(e)&&h.equals(this._radii,e._radii)};pi.prototype.toString=function(){return this._radii.toString()};pi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new h),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var KSe=new h;pi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new z);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,KSe),i=h.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return z.fromElements(1/i,1/r,t)};var ZSe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],$Se=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function mJ(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*ZSe[s];r+=$Se[s]*(n(i+a)+n(i-a))}return r*=o,r}pi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=P.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,u=s*a;return mJ(i,o,function(f){let d=Math.cos(f),p=Math.sin(f);return Math.cos(f)*mJ(t,n,function(g){let m=Math.cos(g),x=Math.sin(g);return Math.sqrt(u*p*p+c*(a*m*m+s*x*x)*d*d)})})};var ee=pi;function AV(e){this._ellipsoid=y(e,ee.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(AV.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});AV.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};AV.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var Di=AV;var QSe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},jt=Object.freeze(QSe);function JSe(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Oo=JSe;function eve(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Lg=eve;function tve(e){return e%4===0&&e%100!==0||e%400===0}var Dd=tve;var _J=[31,28,31,30,31,30,31,31,30,31,30,31];function nve(e,t,n,i,o,r,s,a){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,0),o=y(o,0),r=y(r,0),s=y(s,0),a=y(a,!1),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function x(){bo.typeOf.number.greaterThanOrEquals("Year",e,1),bo.typeOf.number.lessThanOrEquals("Year",e,9999),bo.typeOf.number.greaterThanOrEquals("Month",t,1),bo.typeOf.number.lessThanOrEquals("Month",t,12),bo.typeOf.number.greaterThanOrEquals("Day",n,1),bo.typeOf.number.lessThanOrEquals("Day",n,31),bo.typeOf.number.greaterThanOrEquals("Hour",i,0),bo.typeOf.number.lessThanOrEquals("Hour",i,23),bo.typeOf.number.greaterThanOrEquals("Minute",o,0),bo.typeOf.number.lessThanOrEquals("Minute",o,59),bo.typeOf.bool("IsLeapSecond",a),bo.typeOf.number.greaterThanOrEquals("Second",r,0),bo.typeOf.number.lessThanOrEquals("Second",r,a?60:59),bo.typeOf.number.greaterThanOrEquals("Millisecond",s,0),bo.typeOf.number.lessThan("Millisecond",s,1e3)}function b(){let T=t===2&&Dd(e)?_J[t-1]+1:_J[t-1];if(n>T)throw new he("Month and Day represents invalid date")}}var Ap=nve;function ive(e,t){this.julianDate=e,this.offset=t}var qi=ive;var ove={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},qn=Object.freeze(ove);var rve={UTC:0,TAI:1},jn=Object.freeze(rve);var yJ=new Ap,M5=[31,28,31,30,31,30,31,31,30,31,30,31],L5=29;function N5(e,t){return Ot.compare(e.julianDate,t.julianDate)}var HC=new qi;function SV(e){HC.julianDate=e;let t=Ot.leapSeconds,n=Oo(t,HC,N5);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Ot.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Ot.addSeconds(e,i,e)}function gJ(e,t){HC.julianDate=e;let n=Ot.leapSeconds,i=Oo(n,HC,N5);if(i<0&&(i=~i),i===0)return Ot.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Ot.addSeconds(e,-n[i-1].offset,t);let o=Ot.secondsDifference(n[i].julianDate,e);if(o===0)return Ot.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Ot.addSeconds(e,-n[--i].offset,t)}function Ng(e,t,n){let i=t/qn.SECONDS_PER_DAY|0;return e+=i,t-=qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function F5(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*qn.SECONDS_PER_HOUR+o*qn.SECONDS_PER_MINUTE+s*qn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var sve=/^(\d{4})$/,ave=/^(\d{4})-(\d{2})$/,cve=/^(\d{4})-?(\d{3})$/,lve=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,uve=/^(\d{4})-?(\d{2})-?(\d{2})$/,B5=/([Z+\-])?(\d{2})?:?(\d{2})?$/,fve=/^(\d{2})(\.\d+)?/.source+B5.source,dve=/^(\d{2}):?(\d{2})(\.\d+)?/.source+B5.source,hve=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+B5.source;function Ot(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,jn.UTC);let i=e|0;t=t+(e-i)*qn.SECONDS_PER_DAY,Ng(i,t,this),n===jn.UTC&&SV(this)}Ot.fromGregorianDate=function(e,t){let n=F5(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(Ng(n[0],n[1],t),SV(t),t):new Ot(n[0],n[1],jn.UTC)};Ot.fromDate=function(e,t){let n=F5(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(Ng(n[0],n[1],t),SV(t),t):new Ot(n[0],n[1],jn.UTC)};Ot.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,g;if(n=f.match(uve),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(ave),n!==null)i=+n[1],o=+n[2];else if(n=f.match(sve),n!==null)i=+n[1];else{let T;if(n=f.match(cve),n!==null)i=+n[1],T=+n[2],g=Dd(i);else if(n=f.match(lve),n!==null){i=+n[1];let C=+n[2],A=+n[3]||0,E=new Date(Date.UTC(i,0,4));T=C*7+A-E.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(T),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=Dd(i);let m;if(l(d)){n=d.match(hve),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,m=5):(n=d.match(dve),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,m=4):(n=d.match(fve),n!==null&&(s=+n[1],a=+(n[2]||0)*60,m=3)));let T=n[m],C=+n[m+1],A=+(n[m+2]||0);switch(T){case"+":s=s-C,a=a-A;break;case"-":s=s+C,a=a+A;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?L5:M5[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?L5:M5[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?L5:M5[o-1],r+=p;let b=F5(i,o,r,s,a,c,u);return l(t)?(Ng(b[0],b[1],t),SV(t)):t=new Ot(b[0],b[1],jn.UTC),x&&Ot.addSeconds(t,1,t),t};Ot.now=function(e){return Ot.fromDate(new Date,e)};var EV=new Ot(0,0,jn.TAI);Ot.toGregorianDate=function(e,t){let n=!1,i=gJ(e,EV);l(i)||(Ot.addSeconds(e,-1,EV),i=gJ(EV,EV),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,g=r/qn.SECONDS_PER_HOUR|0,m=r-g*qn.SECONDS_PER_HOUR,x=m/qn.SECONDS_PER_MINUTE|0;m=m-x*qn.SECONDS_PER_MINUTE;let b=m|0,T=(m-b)/qn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(b+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=g,t.minute=x,t.second=b,t.millisecond=T,t.isLeapSecond=n,t):new Ap(p,d,f,g,x,b,T,n)};Ot.toDate=function(e){let t=Ot.toGregorianDate(e,yJ),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Ot.toIso8601=function(e,t){let n=Ot.toGregorianDate(e,yJ),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;return!l(t)&&u!==0?(f=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};Ot.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Ot(e.dayNumber,e.secondsOfDay,jn.TAI)};Ot.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Ot.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(Ot.secondsDifference(e,t))<=n};Ot.totalDays=function(e){return e.dayNumber+e.secondsOfDay/qn.SECONDS_PER_DAY};Ot.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Ot.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/qn.SECONDS_PER_DAY;return n+i};Ot.computeTaiMinusUtc=function(e){HC.julianDate=e;let t=Ot.leapSeconds,n=Oo(t,HC,N5);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Ot.addSeconds=function(e,t,n){return Ng(e.dayNumber,e.secondsOfDay+t,n)};Ot.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*qn.SECONDS_PER_MINUTE;return Ng(e.dayNumber,i,n)};Ot.addHours=function(e,t,n){let i=e.secondsOfDay+t*qn.SECONDS_PER_HOUR;return Ng(e.dayNumber,i,n)};Ot.addDays=function(e,t,n){let i=e.dayNumber+t;return Ng(i,e.secondsOfDay,n)};Ot.lessThan=function(e,t){return Ot.compare(e,t)<0};Ot.lessThanOrEquals=function(e,t){return Ot.compare(e,t)<=0};Ot.greaterThan=function(e,t){return Ot.compare(e,t)>0};Ot.greaterThanOrEquals=function(e,t){return Ot.compare(e,t)>=0};Ot.prototype.clone=function(e){return Ot.clone(this,e)};Ot.prototype.equals=function(e){return Ot.equals(this,e)};Ot.prototype.equalsEpsilon=function(e,t){return Ot.equalsEpsilon(this,e,t)};Ot.prototype.toString=function(){return Ot.toIso8601(this)};Ot.leapSeconds=[new qi(new Ot(2441317,43210,jn.TAI),10),new qi(new Ot(2441499,43211,jn.TAI),11),new qi(new Ot(2441683,43212,jn.TAI),12),new qi(new Ot(2442048,43213,jn.TAI),13),new qi(new Ot(2442413,43214,jn.TAI),14),new qi(new Ot(2442778,43215,jn.TAI),15),new qi(new Ot(2443144,43216,jn.TAI),16),new qi(new Ot(2443509,43217,jn.TAI),17),new qi(new Ot(2443874,43218,jn.TAI),18),new qi(new Ot(2444239,43219,jn.TAI),19),new qi(new Ot(2444786,43220,jn.TAI),20),new qi(new Ot(2445151,43221,jn.TAI),21),new qi(new Ot(2445516,43222,jn.TAI),22),new qi(new Ot(2446247,43223,jn.TAI),23),new qi(new Ot(2447161,43224,jn.TAI),24),new qi(new Ot(2447892,43225,jn.TAI),25),new qi(new Ot(2448257,43226,jn.TAI),26),new qi(new Ot(2448804,43227,jn.TAI),27),new qi(new Ot(2449169,43228,jn.TAI),28),new qi(new Ot(2449534,43229,jn.TAI),29),new qi(new Ot(2450083,43230,jn.TAI),30),new qi(new Ot(2450630,43231,jn.TAI),31),new qi(new Ot(2451179,43232,jn.TAI),32),new qi(new Ot(2453736,43233,jn.TAI),33),new qi(new Ot(2454832,43234,jn.TAI),34),new qi(new Ot(2456109,43235,jn.TAI),35),new qi(new Ot(2457204,43236,jn.TAI),36),new qi(new Ot(2457754,43237,jn.TAI),37)];var Z=Ot;var BJ=Ko(uu(),1);function mve(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var nw=mve;function SJ(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=SJ(o,t)),n[i]=o}return n}var Ge=SJ;function vJ(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=vJ(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var bt=vJ;function pve(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var vl=pve;var wJ=Ko(uu(),1);function k5(e,t){let n;return typeof document<"u"&&(n=document),k5._implementation(e,t,n)}k5._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new wJ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var em=k5;var DJ=Ko(uu(),1);function _ve(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new DJ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var iw=_ve;var IJ=Ko(uu(),1);function gve(e){let t=new IJ.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var ox=gve;var PJ={};function yve(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=PJ[t];l(i)||(i={},PJ[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var Id=yve;var xve=/^blob:/i;function bve(e){return xve.test(e)}var rx=bve;var tm;function Tve(e){l(tm)||(tm=document.createElement("a")),tm.href=window.location.href;let t=tm.host,n=tm.protocol;return tm.href=e,tm.href=tm.href,n!==tm.protocol||t!==tm.host}var Fg=Tve;var Cve=/^data:/i;function Ave(e){return Cve.test(e)}var Ep=Ave;function Eve(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var sx=Eve;function Sve(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var ax=Sve;function vve(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var fu=vve;var wve={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},Zn=Object.freeze(wve);var Dve={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ds=Object.freeze(Dve);function IV(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,ds.OTHER),this.serverKey=e.serverKey,this.state=Zn.UNISSUED,this.deferred=void 0,this.cancelled=!1}IV.prototype.cancel=function(){this.cancelled=!0};IV.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=Zn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new IV(this)};var Zo=IV;function Ive(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var ow=Ive;function RJ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=ow(this.responseHeaders))}RJ.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var nm=RJ;var PV=Ko(uu(),1);function rw(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(rw.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});rw.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};rw.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function Pve(e,t){return t-e}rw.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];l(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(Pve),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var me=rw;function cx(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(cx.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function V5(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}cx.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};cx.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(V5(i,o,e),e=o):r=!1}};cx.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};cx.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)V5(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};cx.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return V5(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var sw=cx;function Rve(e,t){return e.priority-t.priority}var to={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},jC=20,tc=new sw({comparator:Rve});tc.maximumLength=jC;tc.reserve(jC);var im=[],Sp={},Ove=typeof document<"u"?new PV.default(document.location.href):new PV.default,RV=new me;function $o(){}$o.maximumRequests=50;$o.maximumRequestsPerServer=18;$o.requestsByServer={};$o.throttleRequests=!0;$o.debugShowStatistics=!1;$o.requestCompletedEvent=RV;Object.defineProperties($o,{statistics:{get:function(){return to}},priorityHeapLength:{get:function(){return jC},set:function(e){if(e<jC)for(;tc.length>e;){let t=tc.pop();lx(t)}jC=e,tc.maximumLength=e,tc.reserve(e)}}});function OJ(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}$o.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y($o.requestsByServer[e],$o.maximumRequestsPerServer);return Sp[e]+t<=n};$o.heapHasOpenSlots=function(e){return tc.length+e<=jC};function MJ(e){return e.state===Zn.UNISSUED&&(e.state=Zn.ISSUED,e.deferred=vl()),e.deferred.promise}function Mve(e){return function(t){if(e.state===Zn.CANCELLED)return;let n=e.deferred;--to.numberOfActiveRequests,--Sp[e.serverKey],RV.raiseEvent(),e.state=Zn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Lve(e){return function(t){e.state!==Zn.CANCELLED&&(++to.numberOfFailedRequests,--to.numberOfActiveRequests,--Sp[e.serverKey],RV.raiseEvent(t),e.state=Zn.FAILED,e.deferred.reject(t))}}function LJ(e){let t=MJ(e);return e.state=Zn.ACTIVE,im.push(e),++to.numberOfActiveRequests,++to.numberOfActiveRequestsEver,++Sp[e.serverKey],e.requestFunction().then(Mve(e)).catch(Lve(e)),t}function lx(e){let t=e.state===Zn.ACTIVE;if(e.state=Zn.CANCELLED,++to.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--to.numberOfActiveRequests,--Sp[e.serverKey],++to.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}$o.update=function(){let e,t,n=0,i=im.length;for(e=0;e<i;++e){if(t=im[e],t.cancelled&&lx(t),t.state!==Zn.ACTIVE){++n;continue}n>0&&(im[e-n]=t)}im.length-=n;let o=tc.internalArray,r=tc.length;for(e=0;e<r;++e)OJ(o[e]);tc.resort();let s=Math.max($o.maximumRequests-im.length,0),a=0;for(;a<s&&tc.length>0;){if(t=tc.pop(),t.cancelled){lx(t);continue}if(t.throttleByServer&&!$o.serverHasOpenSlots(t.serverKey)){lx(t);continue}LJ(t),++a}Nve()};$o.getServerKey=function(e){let t=new PV.default(e);t.scheme()===""&&(t=t.absoluteTo(Ove),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Sp[n];return l(i)||(Sp[n]=0),n};$o.request=function(e){if(Ep(e.url)||rx(e.url))return RV.raiseEvent(),e.state=Zn.RECEIVED,e.requestFunction();if(++to.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=$o.getServerKey(e.url)),$o.throttleRequests&&e.throttleByServer&&!$o.serverHasOpenSlots(e.serverKey))return;if(!$o.throttleRequests||!e.throttle)return LJ(e);if(im.length>=$o.maximumRequests)return;OJ(e);let t=tc.insert(e);if(l(t)){if(t===e)return;lx(t)}return MJ(e)};function Nve(){$o.debugShowStatistics&&(to.numberOfActiveRequests===0&&to.lastNumberOfActiveRequests>0&&(to.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${to.numberOfAttemptedRequests}`),to.numberOfAttemptedRequests=0),to.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${to.numberOfCancelledRequests}`),to.numberOfCancelledRequests=0),to.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${to.numberOfCancelledActiveRequests}`),to.numberOfCancelledActiveRequests=0),to.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${to.numberOfFailedRequests}`),to.numberOfFailedRequests=0)),to.lastNumberOfActiveRequests=to.numberOfActiveRequests)}$o.clearForSpecs=function(){for(;tc.length>0;){let t=tc.pop();lx(t)}let e=im.length;for(let t=0;t<e;++t)lx(im[t]);im.length=0,Sp={},to.numberOfAttemptedRequests=0,to.numberOfActiveRequests=0,to.numberOfCancelledRequests=0,to.numberOfCancelledActiveRequests=0,to.numberOfFailedRequests=0,to.numberOfActiveRequestsEver=0,to.lastNumberOfActiveRequests=0};$o.numberOfActiveRequestsByServer=function(e){return Sp[e]};$o.requestHeap=tc;var nc=$o;var NJ=Ko(uu(),1);var aw={},qC={};aw.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(qC[n])||(qC[n]=!0)};aw.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(qC[n])&&delete qC[n]};function Fve(e){let t=new NJ.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}aw.contains=function(e){let t=Fve(e);return!!(l(t)&&l(qC[t]))};aw.clear=function(){qC={}};var YC=aw;var kJ=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function It(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=om(e.templateValues,{}),this._queryParameters=om(e.queryParameters,{}),this.headers=om(e.headers,{}),this.request=y(e.request,new Zo),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function om(e,t){return l(e)?Ge(e):t}It.createIfNeeded=function(e){return e instanceof It?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new It({url:e})};var XC;It.supportsImageBitmapOptions=function(){return l(XC)?XC:typeof createImageBitmap!="function"?(XC=Promise.resolve(!1),XC):(XC=It.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=Id(t[0]),i=Id(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),XC)};Object.defineProperties(It,{isBlobSupported:{get:function(){return kJ}}});Object.defineProperties(It.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return ox(this._url)}},isDataUri:{get:function(){return Ep(this._url)}},isBlobUri:{get:function(){return rx(this._url)}},isCrossOriginUrl:{get:function(){return Fg(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});It.prototype.toString=function(){return this.getUrlComponent(!0,!0)};It.prototype.parseUrl=function(e,t,n,i){let o=new BJ.default(e),r=Bve(o.query());this._queryParameters=t?MV(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(em(i))),this._url=o.toString()};function Bve(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:fu(e)}function MV(e,t,n){if(!n)return bt(e,t);let i=Ge(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}It.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${kve(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function kve(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${ax(e)}`}It.prototype.setQueryParameters=function(e,t){t?this._queryParameters=MV(this._queryParameters,e,!1):this._queryParameters=MV(e,this._queryParameters,!1)};It.prototype.appendQueryParameters=function(e){this._queryParameters=MV(e,this._queryParameters,!0)};It.prototype.setTemplateValues=function(e,t){t?this._templateValues=bt(this._templateValues,e):this._templateValues=bt(e,this._templateValues)};It.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=bt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=bt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=bt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};It.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};It.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ge(this._queryParameters),e._templateValues=Ge(this._templateValues),e.headers=Ge(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new It({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};It.prototype.getBaseUri=function(e){return iw(this.getUrlComponent(e),e)};It.prototype.appendForwardSlash=function(){this._url=nw(this._url)};It.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};It.fetchArrayBuffer=function(e){return new It(e).fetchArrayBuffer()};It.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};It.fetchBlob=function(e){return new It(e).fetchBlob()};It.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(z5(this.request),!kJ||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return U5({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,u;return It.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!l(f))return;if(u=f,a)return It.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let d=window.URL.createObjectURL(f);return c=new It({url:d}),U5({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function U5(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=vl();return It._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=nc.request(r);if(l(s))return s.catch(function(a){return r.state!==Zn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=Zn.UNISSUED,r.deferred=void 0,U5({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}It.fetchImage=function(e){return new It(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};It.prototype.fetchText=function(){return this.fetch({responseType:"text"})};It.fetchText=function(e){return new It(e).fetchText()};It.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};It.fetchJson=function(e){return new It(e).fetchJson()};It.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};It.fetchXML=function(e){return new It(e).fetchXML()};It.prototype.fetchJsonp=function(e){e=y(e,"callback"),z5(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return VJ(this,e,t)};function VJ(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=vl();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},It._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=nc.request(o);if(l(s))return s.catch(function(a){return o.state!==Zn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=Zn.UNISSUED,o.deferred=void 0,VJ(e,t,n)):Promise.reject(a)})})}It.fetchJsonp=function(e){return new It(e).fetchJsonp(e.callbackParameterName)};It.prototype._makeRequest=function(e){let t=this;z5(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=bt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=vl(),d=It._Implementations.loadWithXhr(i,r,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let o=nc.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Zn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Zn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function z5(e){if(e.state===Zn.ISSUED||e.state===Zn.ACTIVE)throw new re("The Resource is already being fetched.");e.state=Zn.UNISSUED,e.deferred=void 0}var Vve=/^data:(.*?)(;base64)?,(.*)$/;function OV(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function FJ(e,t){let n=OV(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function Uve(e,t){t=y(t,"");let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return OV(i,o);case"arraybuffer":return FJ(i,o);case"blob":return r=FJ(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(OV(i,o),n);case"json":return JSON.parse(OV(i,o));default:}}It.prototype.fetch=function(e){return e=om(e,{}),e.method="GET",this._makeRequest(e)};It.fetch=function(e){return new It(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It.prototype.delete=function(e){return e=om(e,{}),e.method="DELETE",this._makeRequest(e)};It.delete=function(e){return new It(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};It.prototype.head=function(e){return e=om(e,{}),e.method="HEAD",this._makeRequest(e)};It.head=function(e){return new It(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It.prototype.options=function(e){return e=om(e,{}),e.method="OPTIONS",this._makeRequest(e)};It.options=function(e){return new It(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It.prototype.post=function(e,t){return bo.defined("data",e),t=om(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};It.post=function(e){return new It(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It.prototype.put=function(e,t){return bo.defined("data",e),t=om(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};It.put=function(e){return new It(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It.prototype.patch=function(e,t){return bo.defined("data",e),t=om(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};It.patch=function(e){return new It(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It._Implementations={};It._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(YC.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};It._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;It.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){It._Implementations.loadImageElement(s,t,n);return}let c="blob",u="GET",f=vl(),d=It._Implementations.loadWithXhr(s,c,u,void 0,void 0,f,void 0,void 0,void 0);return l(d)&&l(d.abort)&&(e.cancelFunction=function(){d.abort()}),f.promise.then(function(p){if(!l(p)){n.reject(new re(`Successfully retrieved ${s} but it contained no content.`));return}return It.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};It.createImageBitmapFromBlob=function(e,t){return bo.defined("options",t),bo.typeOf.bool("options.flipY",t.flipY),bo.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),bo.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function zve(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),r.reject(new nm(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new nm)})}var Hve=typeof XMLHttpRequest>"u";It._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=Vve.exec(e);if(a!==null){r.resolve(Uve(a,t));return}if(Hve){zve(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(YC.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new nm(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(x){let b=x.split(": "),T=b.shift();m[T]=b.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(l(f)&&(!l(t)||d===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new re("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new nm)},c.send(i),c};It._Implementations.loadAndExecuteScript=function(e,t,n){return sx(e,t).catch(function(i){n.reject(i)})};It._DefaultImplementations={};It._DefaultImplementations.createImage=It._Implementations.createImage;It._DefaultImplementations.loadWithXhr=It._Implementations.loadWithXhr;It._DefaultImplementations.loadAndExecuteScript=It._Implementations.loadAndExecuteScript;It.DEFAULT=Object.freeze(new It({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Se=It;function lw(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?UJ(this,e.data):UJ(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}lw.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new re(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new lw({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};lw.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Lg(0,0,0,0,0),t}});lw.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Lg(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],u=Z.lessThanOrEquals(a,e),f=!l(c),d=f||Z.greaterThanOrEquals(c,e);if(u&&d)return o=i,!f&&c.equals(e)&&++o,r=o+1,HJ(this,n,this._samples,e,o,r,t),t}let s=Oo(n,e,Z.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,HJ(this,n,this._samples,e,o,r,t),t};function Gve(e,t){return Z.compare(e.julianDate,t)}function UJ(e,t){if(!l(t.columnNames))throw new re("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new re("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new re("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let x=u[g+n],b=u[g+c],T=x+qn.MODIFIED_JULIAN_DATE_DIFFERENCE,C=new Z(T,b,jn.TAI);if(f.push(C),p){if(b!==d&&l(d)){let A=Z.leapSeconds,E=Oo(A,C,Gve);if(E<0){let v=new qi(C,b);A.splice(~E,0,v)}}d=b}}}function zJ(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function cw(e,t,n){return t+e*(n-t)}function HJ(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return zJ(e,n,o,a,s),s;if(i.equals(u))return zJ(e,n,r,a,s),s;let f=Z.secondsDifference(i,c)/Z.secondsDifference(u,c),d=o*a,p=r*a,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],x=m-g;if(x>.5||x<-.5){let b=n[d+e._taiMinusUtcSecondsColumn],T=n[p+e._taiMinusUtcSecondsColumn];b!==T&&(u.equals(i)?g=m:m-=T-b)}return s.xPoleWander=cw(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=cw(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=cw(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=cw(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=cw(f,g,m),s}var uw=lw;function ic(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}ic.fromQuaternion=function(e,t){l(t)||(t=new ic);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-P.asinClamped(n),t};ic.fromDegrees=function(e,t,n,i){return l(i)||(i=new ic),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};ic.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new ic(e.heading,e.pitch,e.roll)};ic.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};ic.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};ic.prototype.clone=function(e){return ic.clone(this,e)};ic.prototype.equals=function(e){return ic.equals(this,e)};ic.prototype.equalsEpsilon=function(e,t,n){return ic.equalsEpsilon(this,e,t,n)};ic.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var va=ic;var GJ={},WJ=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Wve(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=WJ.exec(i);if(o!==null)return o[1]}}var LV;function jJ(e){return typeof document>"u"?e:(l(LV)||(LV=document.createElement("a")),LV.href=e,LV.href)}var ux;function qJ(){if(l(ux))return ux;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(GJ?.url)?e=em(".",GJ.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=em("..",fx("Core/buildModuleUrl.js")):e=Wve(),ux=new Se({url:jJ(e)}),ux.appendForwardSlash(),ux}function jve(e){return jJ(require.toUrl(`../${e}`))}function YJ(e){return qJ().getDerivedResource({url:e}).url}var NV;function fx(e){return l(NV)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?NV=jve:NV=YJ),NV(e)}fx._cesiumScriptRegex=WJ;fx._buildModuleUrlFromBaseUrl=YJ;fx._clearBaseResource=function(){ux=void 0};fx.setBaseUrl=function(e){ux=Se.DEFAULT.getDerivedResource({url:e})};fx.getCesiumBaseUrl=qJ;var nn=fx;function qve(e,t,n){this.x=e,this.y=t,this.s=n}var dx=qve;function W5(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Se.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new Z(this._sampleZeroJulianEphemerisDate,0,jn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var Yve=new Z(0,0,jn.TAI);function H5(e,t,n){let i=Yve;return i.dayNumber=t,i.secondsOfDay=n,Z.daysDifference(i,e._sampleZeroDateTT)}W5.prototype.preload=function(e,t,n,i){let o=H5(this,e,t),r=H5(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(G5(this,d));return Promise.all(f)};W5.prototype.computeXysRadians=function(e,t,n){let i=H5(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(G5(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(G5(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new dx(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,x,b;for(x=0;x<=r;++x)d[x]=f-m[x];for(x=0;x<=r;++x){for(g[x]=1,b=0;b<=r;++b)b!==x&&(g[x]*=d[b]);g[x]*=p[x];let T=(s+x)*3;n.x+=g[x]*u[T++],n.y+=g[x]*u[T++],n.s+=g[x]*u[T]}return n};function G5(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Se({url:nn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var fw=W5;function nt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var dw=new h;nt.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);dw=h.normalize(e,dw);let r=dw.x*o,s=dw.y*o,a=dw.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new nt(r,s,a,c)};var Xve=[1,2,0],Kve=new Array(3);nt.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let d=Xve,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(m,m)]+1);let x=Kve;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(m,g)]-e[$.getElementIndex(g,m)])*n,x[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,x[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new nt(i,o,r,s)};var XJ=new nt,KJ=new nt,j5=new nt,ZJ=new nt;nt.fromHeadingPitchRoll=function(e,t){return ZJ=nt.fromAxisAngle(h.UNIT_X,e.roll,XJ),j5=nt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=nt.multiply(j5,ZJ,j5),KJ=nt.fromAxisAngle(h.UNIT_Z,-e.heading,XJ),nt.multiply(KJ,t,t)};var FV=new h,q5=new h,Pd=new nt,$J=new nt,BV=new nt;nt.packedLength=4;nt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};nt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new nt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};nt.packedInterpolationLength=3;nt.convertPackedArrayForInterpolation=function(e,t,n,i){nt.unpack(e,n*4,BV),nt.conjugate(BV,BV);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;nt.unpack(e,(t+o)*4,Pd),nt.multiply(Pd,BV,Pd),Pd.w<0&&nt.negate(Pd,Pd),nt.computeAxis(Pd,FV);let a=nt.computeAngle(Pd);l(i)||(i=[]),i[s]=FV.x*a,i[s+1]=FV.y*a,i[s+2]=FV.z*a}};nt.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new nt),h.fromArray(e,0,q5);let r=h.magnitude(q5);return nt.unpack(t,i*4,$J),r===0?nt.clone(nt.IDENTITY,Pd):nt.fromAxisAngle(q5,r,Pd),nt.multiply(Pd,$J,o)};nt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new nt(e.x,e.y,e.z,e.w)};nt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};nt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};nt.magnitude=function(e){return Math.sqrt(nt.magnitudeSquared(e))};nt.normalize=function(e,t){let n=1/nt.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};nt.inverse=function(e,t){let n=nt.magnitudeSquared(e);return t=nt.conjugate(e,t),nt.multiplyByScalar(t,1/n,t)};nt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};nt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};nt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};nt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};nt.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+o*u-r*c,p=s*c-i*u+o*f+r*a,g=s*u+i*c-o*a+r*f,m=s*f-i*a-o*c-r*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};nt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};nt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};nt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6||Math.abs(n+1)<P.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};nt.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var Y5=new nt;nt.lerp=function(e,t,n,i){return Y5=nt.multiplyByScalar(t,n,Y5),i=nt.multiplyByScalar(e,1-n,i),nt.add(Y5,i,i)};var QJ=new nt,X5=new nt,K5=new nt;nt.slerp=function(e,t,n,i){let o=nt.dot(e,t),r=t;if(o<0&&(o=-o,r=QJ=nt.negate(t,QJ)),1-o<P.EPSILON6)return nt.lerp(e,r,n,i);let s=Math.acos(o);return X5=nt.multiplyByScalar(e,Math.sin((1-n)*s),X5),K5=nt.multiplyByScalar(r,Math.sin(n*s),K5),i=nt.add(X5,K5,i),nt.multiplyByScalar(i,1/Math.sin(s),i)};nt.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};nt.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var Zve=new h,$ve=new h,hw=new nt,KC=new nt;nt.computeInnerQuadrangle=function(e,t,n,i){let o=nt.conjugate(t,hw);nt.multiply(o,n,KC);let r=nt.log(KC,Zve);nt.multiply(o,e,KC);let s=nt.log(KC,$ve);return h.add(r,s,r),h.multiplyByScalar(r,.25,r),h.negate(r,r),nt.exp(r,hw),nt.multiply(t,hw,i)};nt.squad=function(e,t,n,i,o,r){let s=nt.slerp(e,t,o,hw),a=nt.slerp(n,i,o,KC);return nt.slerp(s,a,2*o*(1-o),r)};var Qve=new nt,JJ=1.9011074535173003,kV=Ht.supportsTypedArrays()?new Float32Array(8):[],VV=Ht.supportsTypedArrays()?new Float32Array(8):[],vp=Ht.supportsTypedArrays()?new Float32Array(8):[],wp=Ht.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;kV[e]=1/(t*n),VV[e]=t/n}kV[7]=JJ/(8*17);VV[7]=JJ*8/17;nt.fastSlerp=function(e,t,n,i){let o=nt.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)vp[g]=(kV[g]*c-VV[g])*s,wp[g]=(kV[g]*u-VV[g])*s;let f=r*n*(1+vp[0]*(1+vp[1]*(1+vp[2]*(1+vp[3]*(1+vp[4]*(1+vp[5]*(1+vp[6]*(1+vp[7])))))))),d=a*(1+wp[0]*(1+wp[1]*(1+wp[2]*(1+wp[3]*(1+wp[4]*(1+wp[5]*(1+wp[6]*(1+wp[7])))))))),p=nt.multiplyByScalar(e,d,Qve);return nt.multiplyByScalar(t,f,i),nt.add(p,i,i)};nt.fastSquad=function(e,t,n,i,o,r){let s=nt.fastSlerp(e,t,o,hw),a=nt.fastSlerp(n,i,o,KC);return nt.fastSlerp(s,a,2*o*(1-o),r)};nt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};nt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};nt.ZERO=Object.freeze(new nt(0,0,0,0));nt.IDENTITY=Object.freeze(new nt(0,0,0,1));nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.prototype.equalsEpsilon=function(e,t){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Oe=nt;var ui={},Z5={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},ZC={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},$5={},wl={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Bg=new h,kg=new h,Vg=new h;ui.localFrameToFixedFrameGenerator=function(e,t){if(!Z5.hasOwnProperty(e)||!Z5[e].hasOwnProperty(t))throw new he("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=Z5[e][t],i,o=e+t;return l($5[o])?i=$5[o]:(i=function(r,s,a){if(l(a)||(a=new F),h.equalsEpsilon(r,h.ZERO,P.EPSILON14))h.unpack(ZC[e],0,Bg),h.unpack(ZC[t],0,kg),h.unpack(ZC[n],0,Vg);else if(P.equalsEpsilon(r.x,0,P.EPSILON14)&&P.equalsEpsilon(r.y,0,P.EPSILON14)){let c=P.sign(r.z);h.unpack(ZC[e],0,Bg),e!=="east"&&e!=="west"&&h.multiplyByScalar(Bg,c,Bg),h.unpack(ZC[t],0,kg),t!=="east"&&t!=="west"&&h.multiplyByScalar(kg,c,kg),h.unpack(ZC[n],0,Vg),n!=="east"&&n!=="west"&&h.multiplyByScalar(Vg,c,Vg)}else{s=y(s,ee.default),s.geodeticSurfaceNormal(r,wl.up);let c=wl.up,u=wl.east;u.x=-r.y,u.y=r.x,u.z=0,h.normalize(u,wl.east),h.cross(c,u,wl.north),h.multiplyByScalar(wl.up,-1,wl.down),h.multiplyByScalar(wl.east,-1,wl.west),h.multiplyByScalar(wl.north,-1,wl.south),Bg=wl[e],kg=wl[t],Vg=wl[n]}return a[0]=Bg.x,a[1]=Bg.y,a[2]=Bg.z,a[3]=0,a[4]=kg.x,a[5]=kg.y,a[6]=kg.z,a[7]=0,a[8]=Vg.x,a[9]=Vg.y,a[10]=Vg.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},$5[o]=i),i};ui.eastNorthUpToFixedFrame=ui.localFrameToFixedFrameGenerator("east","north");ui.northEastDownToFixedFrame=ui.localFrameToFixedFrameGenerator("north","east");ui.northUpEastToFixedFrame=ui.localFrameToFixedFrameGenerator("north","up");ui.northWestUpToFixedFrame=ui.localFrameToFixedFrameGenerator("north","west");var Jve=new Oe,ewe=new h(1,1,1),twe=new F;ui.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,ui.eastNorthUpToFixedFrame);let r=Oe.fromHeadingPitchRoll(t,Jve),s=F.fromTranslationQuaternionRotationScale(h.ZERO,r,ewe,twe);return o=i(e,n,o),F.multiply(o,s,o)};var nwe=new F,iwe=new $;ui.headingPitchRollQuaternion=function(e,t,n,i,o){let r=ui.headingPitchRollToFixedFrame(e,t,n,i,nwe),s=F.getMatrix3(r,iwe);return Oe.fromRotationMatrix(s,o)};var owe=new h(1,1,1),rwe=new h,eee=new F,swe=new F,awe=new $,cwe=new Oe;ui.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,ee.default),n=y(n,ui.eastNorthUpToFixedFrame),l(i)||(i=new va);let o=F.getTranslation(e,rwe);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=F.inverseTransformation(n(o,t,eee),eee),s=F.setScale(e,owe,swe);s=F.setTranslation(s,h.ZERO,s),r=F.multiply(r,s,r);let a=Oe.fromRotationMatrix(F.getMatrix3(r,awe),cwe);return a=Oe.normalize(a,a),va.fromQuaternion(a,i)};var lwe=6*3600+41*60+50.54841,uwe=8640184812866e-6,fwe=.093104,dwe=-62e-7,hwe=11772758384668e-32,mwe=72921158553e-15,pwe=P.TWO_PI/86400,UV=new Z;ui.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=ui.computeIcrfToFixedMatrix(e,t);return l(n)||(n=ui.computeTemeToPseudoFixedMatrix(e,t)),n};ui.computeTemeToPseudoFixedMatrix=function(e,t){UV=Z.addSeconds(e,-Z.computeTaiMinusUtc(e),UV);let n=UV.dayNumber,i=UV.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/qn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/qn.DAYS_PER_JULIAN_CENTURY;let a=(lwe+o*(uwe+o*(fwe+o*dwe)))*pwe%P.TWO_PI,c=mwe+hwe*(n-24515455e-1),u=(i+qn.SECONDS_PER_DAY*.5)%qn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};ui.iau2006XysData=new fw;ui.earthOrientationParameters=uw.NONE;var e6=32.184,_we=2451545;ui.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+e6,i=e.stop.dayNumber,o=e.stop.secondsOfDay+e6;return ui.iau2006XysData.preload(t,n,i,o)};ui.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=ui.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var gwe=32.184,ywe=2451545,zV=new va,xwe=new $,bwe=new Z;ui.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Z.addSeconds(e,gwe,bwe),i=Z.totalDays(n)-ywe,o=P.toRadians(12.112)-P.toRadians(.052992)*i,r=P.toRadians(24.224)-P.toRadians(.105984)*i,s=P.toRadians(227.645)+P.toRadians(13.012)*i,a=P.toRadians(261.105)+P.toRadians(13.340716)*i,c=P.toRadians(358)+P.toRadians(.9856)*i;return zV.pitch=P.toRadians(180)-P.toRadians(3.878)*Math.sin(o)-P.toRadians(.12)*Math.sin(r)+P.toRadians(.07)*Math.sin(s)-P.toRadians(.017)*Math.sin(a),zV.roll=P.toRadians(66.53-90)+P.toRadians(1.543)*Math.cos(o)+P.toRadians(.24)*Math.cos(r)-P.toRadians(.028)*Math.cos(s)+P.toRadians(.007)*Math.cos(a),zV.heading=P.toRadians(244.375-90)+P.toRadians(13.17635831)*i+P.toRadians(3.558)*Math.sin(o)+P.toRadians(.121)*Math.sin(r)-P.toRadians(.064)*Math.sin(s)+P.toRadians(.016)*Math.sin(a)+P.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(zV,xwe)};ui.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=ui.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var Twe=new dx(0,0,0),Cwe=new Lg(0,0,0,0,0,0),Q5=new $,J5=new $;ui.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=ui.earthOrientationParameters.compute(e,Cwe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+e6,r=ui.iau2006XysData.computeXysRadians(i,o,Twe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=Q5;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-r.s,J5),d=$.multiply(u,f,Q5),p=e.dayNumber,g=e.secondsOfDay-Z.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,x=g/qn.SECONDS_PER_DAY,b=.779057273264+x+.00273781191135448*(m+x);b=b%1*P.TWO_PI;let T=$.fromRotationZ(b,J5),C=$.multiply(d,T,Q5),A=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),D=Math.sin(n.yPoleWander),O=i-_we+o/qn.SECONDS_PER_DAY;O/=36525;let R=-47e-6*O*P.RADIANS_PER_DEGREE/3600,M=Math.cos(R),N=Math.sin(R),_=J5;return _[0]=A*M,_[1]=A*N,_[2]=v,_[3]=-E*N+D*v*M,_[4]=E*M+D*v*N,_[5]=-D*A,_[6]=-D*N-E*v*M,_[7]=D*M-E*v*N,_[8]=E*A,$.multiply(C,_,t)};var Awe=new oe;ui.pointToWindowCoordinates=function(e,t,n,i){return i=ui.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ui.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new z);let o=Awe;return F.multiplyByVector(e,oe.fromElements(n.x,n.y,n.z,1,o),o),oe.multiplyByScalar(o,1/o.w,o),F.multiplyByVector(t,o,o),z.fromCartesian4(o,i)};var Ewe=new h,Swe=new h,vwe=new h;ui.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,ee.default).geodeticSurfaceNormal(e,Ewe),r=h.cross(t,o,Swe);h.equalsEpsilon(r,h.ZERO,P.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,vwe);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var tee=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),nee=new fe,t6=new h,wwe=new h,Dwe=new $,n6=new F,iee=new F;ui.basisTo2D=function(e,t,n){let i=F.getTranslation(t,wwe),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,t6);else{let f=o.cartesianToCartographic(i,nee);r=e.project(f,t6),h.fromElements(r.z,r.x,r.y,r)}let s=ui.eastNorthUpToFixedFrame(i,o,n6),a=F.inverseTransformation(s,iee),c=F.getMatrix3(t,Dwe),u=F.multiplyByMatrix3(a,c,n);return F.multiply(tee,u,n),F.setTranslation(n,r,n),n};ui.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=ui.eastNorthUpToFixedFrame(t,i,n6),r=F.inverseTransformation(o,iee),s=i.cartesianToCartographic(t,nee),a=e.project(s,t6);h.fromElements(a.z,a.x,a.y,a);let c=F.fromTranslation(a,n6);return F.multiply(tee,r,n),F.multiply(c,n,n),n};var Mt=ui;function wn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(wn.prototype,{width:{get:function(){return wn.computeWidth(this)}},height:{get:function(){return wn.computeHeight(this)}}});wn.packedLength=4;wn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};wn.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new wn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};wn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=P.TWO_PI),t-n};wn.computeHeight=function(e){return e.north-e.south};wn.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(y(e,0)),t=P.toRadians(y(t,0)),n=P.toRadians(y(n,0)),i=P.toRadians(y(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new wn(e,t,n,i)};wn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=y(e,0),o.south=y(t,0),o.east=y(n,0),o.north=y(i,0),o):new wn(e,t,n,i)};wn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let d=f.longitude>=0?f.longitude:f.longitude+P.TWO_PI;o=Math.min(o,d),r=Math.max(r,d)}return i-n>r-o&&(n=o,i=r,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new wn(n,s,i,a)};wn.fromCartesianArray=function(e,t,n){t=y(t,ee.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let d=t.cartesianToCartographic(e[u]);i=Math.min(i,d.longitude),o=Math.max(o,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+P.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>P.PI&&(o=o-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new wn(i,a,o,c)};var Iwe=new h,Pwe=new h,Rwe=new h,Owe=new h,Mwe=new h,i6=new Array(5);for(let e=0;e<i6.length;++e)i6[e]=new h;wn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=ee.default),l(n)||(n=new wn),h.equals(i,h.ZERO))return wn.clone(wn.MAX_VALUE,n),n;let r=Mt.eastNorthUpToFixedFrame(i,t,Iwe),s=F.multiplyByPointAsVector(r,h.UNIT_X,Pwe);h.normalize(s,s);let a=F.multiplyByPointAsVector(r,h.UNIT_Y,Rwe);h.normalize(a,a),h.multiplyByScalar(a,o,a),h.multiplyByScalar(s,o,s);let c=h.negate(a,Mwe),u=h.negate(s,Owe),f=i6,d=f[0];return h.add(i,a,d),d=f[1],h.add(i,u,d),d=f[2],h.add(i,c,d),d=f[3],h.add(i,s,d),f[4]=i,wn.fromCartesianArray(f,t,n)};wn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new wn(e.west,e.south,e.east,e.north)};wn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};wn.prototype.clone=function(e){return wn.clone(this,e)};wn.prototype.equals=function(e){return wn.equals(this,e)};wn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};wn.prototype.equalsEpsilon=function(e,t){return wn.equalsEpsilon(this,e,t)};wn._validate=function(e){};wn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new fe(e.west,e.south)};wn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new fe(e.west,e.north)};wn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new fe(e.east,e.north)};wn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new fe(e.east,e.south)};wn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=P.TWO_PI);let o=P.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new fe(o,r)};wn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.max(o,s)),c=P.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new wn(a,u,c,f)};wn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new wn(i,o,r,s)};wn.union=function(e,t,n){l(n)||(n=new wn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.min(o,s)),c=P.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};wn.expand=function(e,t,n){return l(n)||(n=new wn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};wn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=P.TWO_PI,n<0&&(n+=P.TWO_PI)),(n>o||P.equalsEpsilon(n,o,P.EPSILON14))&&(n<r||P.equalsEpsilon(n,r,P.EPSILON14))&&i>=e.south&&i<=e.north};var Lwe=new fe;wn.subsample=function(e,t,n,i){t=y(t,ee.default),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=Lwe;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*P.PI_OVER_TWO,wn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};wn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new wn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=P.TWO_PI+e.east-e.west;r.west=P.negativePiToPi(e.west+t*a),r.east=P.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};wn.MAX_VALUE=Object.freeze(new wn(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var se=wn;function Lr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Lr.packedLength=4;Lr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Lr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Lr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Lr.fromPoints=function(e,t){if(l(t)||(t=new Lr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var oee=new Di,Nwe=new fe,Fwe=new fe;Lr.fromRectangle=function(e,t,n){if(l(n)||(n=new Lr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;oee._ellipsoid=ee.default,t=y(t,oee);let i=t.project(se.southwest(e,Nwe)),o=t.project(se.northeast(e,Fwe));return z.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};Lr.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Lr(e.x,e.y,e.width,e.height)};Lr.union=function(e,t,n){l(n)||(n=new Lr);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};Lr.expand=function(e,t,n){n=Lr.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};Lr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?jt.OUTSIDE:jt.INTERSECTING};Lr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Lr.prototype.clone=function(e){return Lr.clone(this,e)};Lr.prototype.intersect=function(e){return Lr.intersect(this,e)};Lr.prototype.equals=function(e){return Lr.equals(this,e)};var je=Lr;var wa={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};wa.isLines=function(e){return e===wa.LINES||e===wa.LINE_LOOP||e===wa.LINE_STRIP};wa.isTriangles=function(e){return e===wa.TRIANGLES||e===wa.TRIANGLE_STRIP||e===wa.TRIANGLE_FAN};wa.validate=function(e){return e===wa.POINTS||e===wa.LINES||e===wa.LINE_LOOP||e===wa.LINE_STRIP||e===wa.TRIANGLES||e===wa.TRIANGLE_STRIP||e===wa.TRIANGLE_FAN};var Me=Object.freeze(wa);var hx=`in vec4 position; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var F=Qe;var ySe={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},te=Object.freeze(ySe);var xSe=new h;function wt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var ca={};ca[te.FLOAT]="float";ca[te.FLOAT_VEC2]="vec2";ca[te.FLOAT_VEC3]="vec3";ca[te.FLOAT_VEC4]="vec4";ca[te.INT]="int";ca[te.INT_VEC2]="ivec2";ca[te.INT_VEC3]="ivec3";ca[te.INT_VEC4]="ivec4";ca[te.BOOL]="bool";ca[te.BOOL_VEC2]="bvec2";ca[te.BOOL_VEC3]="bvec3";ca[te.BOOL_VEC4]="bvec4";ca[te.FLOAT_MAT2]="mat2";ca[te.FLOAT_MAT3]="mat3";ca[te.FLOAT_MAT4]="mat4";ca[te.SAMPLER_2D]="sampler2D";ca[te.SAMPLER_CUBE]="samplerCube";wt.prototype.getDeclaration=function(e){let t=`uniform ${ca[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var bSe={czm_viewport:new wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new wt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,xSe)}}),czm_frameNumber:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new wt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new wt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new wt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new wt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},xp=bSe;function TSe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var zn=TSe;function CSe(){return!0}function ASe(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=CSe}var ue=ASe;var Vs={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};Vs.getSizeInBytes=function(e){switch(e){case Vs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Vs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Vs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Vs.fromSizeInBytes=function(e){switch(e){case 2:return Vs.UNSIGNED_SHORT;case 4:return Vs.UNSIGNED_INT;case 1:return Vs.UNSIGNED_BYTE}};Vs.validate=function(e){return l(e)&&(e===Vs.UNSIGNED_BYTE||e===Vs.UNSIGNED_SHORT||e===Vs.UNSIGNED_INT)};Vs.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Vs.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Vs.fromTypedArray=function(e){if(e instanceof Uint8Array)return Vs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Vs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Vs.UNSIGNED_INT};var Ne=Object.freeze(Vs);var dV={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,validate:function(e){return e===dV.STREAM_DRAW||e===dV.STATIC_DRAW||e===dV.DYNAMIC_DRAW}},Fe=Object.freeze(dV);function yf(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=zn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}yf.createVertexBuffer=function(e){return new yf({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};yf.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ne.getSizeInBytes(n),o=new yf({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(yf.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});yf.prototype._getBuffer=function(){return this._buffer};yf.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};yf.prototype.copyFromBuffer=function(e,t,n,i){let o=te.COPY_READ_BUFFER,r=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};yf.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=te.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};yf.prototype.isDestroyed=function(){return!1};yf.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var _t=yf;var Og,Mr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},vl={};Object.defineProperties(vl,{element:{get:function(){if(vl.supportsFullscreen())return document[Mr.fullscreenElement]}},changeEventName:{get:function(){if(vl.supportsFullscreen())return Mr.fullscreenchange}},errorEventName:{get:function(){if(vl.supportsFullscreen())return Mr.fullscreenerror}},enabled:{get:function(){if(vl.supportsFullscreen())return document[Mr.fullscreenEnabled]}},fullscreen:{get:function(){if(vl.supportsFullscreen())return vl.element!==null}}});vl.supportsFullscreen=function(){if(l(Og))return Og;Og=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Mr.requestFullscreen="requestFullscreen",Mr.exitFullscreen="exitFullscreen",Mr.fullscreenEnabled="fullscreenEnabled",Mr.fullscreenElement="fullscreenElement",Mr.fullscreenchange="fullscreenchange",Mr.fullscreenerror="fullscreenerror",Og=!0,Og;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(Mr.requestFullscreen=n,Og=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Mr.requestFullscreen=n,Og=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Mr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Mr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Mr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Mr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Mr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Mr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Mr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Mr.fullscreenerror=n)}return Og};vl.requestFullscreen=function(e,t){vl.supportsFullscreen()&&e[Mr.requestFullscreen]({vrDisplay:t})};vl.exitFullscreen=function(){vl.supportsFullscreen()&&document[Mr.exitFullscreen]()};vl._names=Mr;var xr=vl;var tc;typeof navigator<"u"?tc=navigator:tc={};function Q0(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var hV,nJ;function v5(){if(!l(hV)&&(hV=!1,!xV())){let e=/ Chrome\/([\.0-9]+)/.exec(tc.userAgent);e!==null&&(hV=!0,nJ=Q0(e[1]))}return hV}function ESe(){return v5()&&nJ}var mV,iJ;function oJ(){if(!l(mV)&&(mV=!1,!v5()&&!xV()&&/ Safari\/[\.0-9]+/.test(tc.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(tc.userAgent);e!==null&&(mV=!0,iJ=Q0(e[1]))}return mV}function SSe(){return oJ()&&iJ}var pV,E5;function rJ(){if(!l(pV)){pV=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(tc.userAgent);e!==null&&(pV=!0,E5=Q0(e[1]),E5.isNightly=!!e[2])}return pV}function vSe(){return rJ()&&E5}var tw,S5;function sJ(){if(!l(tw)){tw=!1;let e;tc.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(tc.userAgent),e!==null&&(tw=!0,S5=Q0(e[1]))):tc.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(tc.userAgent),e!==null&&(tw=!0,S5=Q0(e[1])))}return tw}function wSe(){return sJ()&&S5}var _V,aJ;function xV(){if(!l(_V)){_V=!1;let e=/ Edg\/([\.0-9]+)/.exec(tc.userAgent);e!==null&&(_V=!0,aJ=Q0(e[1]))}return _V}function DSe(){return xV()&&aJ}var gV,w5;function bV(){if(!l(gV)){gV=!1;let e=/Firefox\/([\.0-9]+)/.exec(tc.userAgent);e!==null&&(gV=!0,w5=Q0(e[1]))}return gV}var T5;function ISe(){return l(T5)||(T5=/Windows/i.test(tc.appVersion)),T5}var C5;function PSe(){return l(C5)||(C5=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),C5}function RSe(){return bV()&&w5}var A5;function OSe(){return l(A5)||(A5=!bV()&&typeof PointerEvent<"u"&&(!l(tc.pointerEnabled)||tc.pointerEnabled)),A5}var cJ,yV;function lJ(){if(!l(yV)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;yV=l(t)&&t!=="",yV&&(cJ=t)}return yV}function MSe(){return lJ()?cJ:void 0}function Bc(){return Bc._result}Bc._promise=void 0;Bc._result=void 0;Bc.initialize=function(){return l(Bc._promise)||(Bc._promise=new Promise(e=>{let t=new Image;t.onload=function(){Bc._result=t.width>0&&t.height>0,e(Bc._result)},t.onerror=function(){Bc._result=!1,e(Bc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Bc._promise};Object.defineProperties(Bc,{initialized:{get:function(){return l(Bc._result)}}});var zC=[];typeof ArrayBuffer<"u"&&(zC.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&zC.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&zC.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&zC.push(BigInt64Array),typeof BigUint64Array<"u"&&zC.push(BigUint64Array));var xf={isChrome:v5,chromeVersion:ESe,isSafari:oJ,safariVersion:SSe,isWebkit:rJ,webkitVersion:vSe,isInternetExplorer:sJ,internetExplorerVersion:wSe,isEdge:xV,edgeVersion:DSe,isFirefox:bV,firefoxVersion:RSe,isWindows:ISe,isIPadOrIOS:PSe,hardwareConcurrency:y(tc.hardwareConcurrency,3),supportsPointerEvents:OSe,supportsImageRenderingPixelated:lJ,supportsWebP:Bc,imageRenderingValue:MSe,typedArrayTypes:zC};xf.supportsBasis=function(e){return xf.supportsWebAssembly()&&e.context.supportsBasis};xf.supportsFullscreen=function(){return xr.supportsFullscreen()};xf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};xf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};xf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};xf.supportsBigInt=function(){return typeof BigInt<"u"};xf.supportsWebWorkers=function(){return typeof Worker<"u"};xf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};xf.supportsWebgl2=function(e){return e.context.webgl2};xf.supportsEsmWebWorkers=function(){return!bV()||parseInt(w5)>=114};var zt=xf;function D5(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,o){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var I5,P5,bp;zt.supportsTypedArrays()&&(I5=new ArrayBuffer(4),P5=new Uint32Array(I5),bp=new Uint8Array(I5));ie.fromRgba=function(e,t){return P5[0]=e,ie.fromBytes(bp[0],bp[1],bp[2],bp[3],t)};ie.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=D5(u,c,e+1/3),s=D5(u,c,e),a=D5(u,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new ie(r,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+P.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+P.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+P.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new ie(n,i,o,r)};var LSe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,NSe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,FSe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,BSe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){l(t)||(t=new ie),e=e.trim();let n=ie[e.toUpperCase()];if(l(n))return ie.clone(n,t),t;let i=LSe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=NSe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=FSe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=BSe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),o=ie.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};ie.prototype.toRgba=function(){return bp[0]=ie.floatToByte(this.red),bp[1]=ie.floatToByte(this.green),bp[2]=ie.floatToByte(this.blue),bp[3]=ie.floatToByte(this.alpha),P5[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var H=ie;function TV(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}TV.ALL=Object.freeze(new TV({color:new H(0,0,0,0),depth:1,stencil:0}));TV.prototype.execute=function(e,t){e.clear(this,t)};var ei=TV;var kSe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},we=Object.freeze(kSe);function uJ(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=we.COMPUTE,this.owner=e.owner}uJ.prototype.execute=function(e){e.execute(this)};var kc=uJ;function Ft(e,t){this.x=y(e,0),this.y=y(t,0)}Ft.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Ft(e,t)};Ft.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Ft(e.x,e.y)};Ft.fromCartesian3=Ft.clone;Ft.fromCartesian4=Ft.clone;Ft.packedLength=2;Ft.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Ft.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ft),n.x=e[t++],n.y=e[t],n};Ft.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Ft.pack(e[o],t,o*2);return t};Ft.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Ft.unpack(e,i,t[o])}return t};Ft.fromArray=Ft.unpack;Ft.maximumComponent=function(e){return Math.max(e.x,e.y)};Ft.minimumComponent=function(e){return Math.min(e.x,e.y)};Ft.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Ft.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Ft.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Ft.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Ft.magnitude=function(e){return Math.sqrt(Ft.magnitudeSquared(e))};var CV=new Ft;Ft.distance=function(e,t){return Ft.subtract(e,t,CV),Ft.magnitude(CV)};Ft.distanceSquared=function(e,t){return Ft.subtract(e,t,CV),Ft.magnitudeSquared(CV)};Ft.normalize=function(e,t){let n=Ft.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Ft.dot=function(e,t){return e.x*t.x+e.y*t.y};Ft.cross=function(e,t){return e.x*t.y-e.y*t.x};Ft.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Ft.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Ft.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Ft.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Ft.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Ft.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Ft.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Ft.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var fJ=new Ft;Ft.lerp=function(e,t,n,i){return Ft.multiplyByScalar(t,n,fJ),i=Ft.multiplyByScalar(e,1-n,i),Ft.add(fJ,i,i)};var dJ=new Ft,hJ=new Ft;Ft.angleBetween=function(e,t){return Ft.normalize(e,dJ),Ft.normalize(t,hJ),P.acosClamped(Ft.dot(dJ,hJ))};var VSe=new Ft;Ft.mostOrthogonalAxis=function(e,t){let n=Ft.normalize(e,VSe);return Ft.abs(n,n),n.x<=n.y?t=Ft.clone(Ft.UNIT_X,t):t=Ft.clone(Ft.UNIT_Y,t),t};Ft.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Ft.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Ft.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)};Ft.ZERO=Object.freeze(new Ft(0,0));Ft.ONE=Object.freeze(new Ft(1,1));Ft.UNIT_X=Object.freeze(new Ft(1,0));Ft.UNIT_Y=Object.freeze(new Ft(0,1));Ft.prototype.clone=function(e){return Ft.clone(this,e)};Ft.prototype.equals=function(e){return Ft.equals(this,e)};Ft.prototype.equalsEpsilon=function(e,t,n){return Ft.equalsEpsilon(this,e,t,n)};Ft.prototype.toString=function(){return`(${this.x}, ${this.y})`};var z=Ft;var USe=new h,zSe=new h;function HSe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=r*r*c*c,p=s*s*u*u,g=a*a*f*f,m=d+p+g,x=Math.sqrt(1/m),b=h.multiplyByScalar(e,x,USe);if(m<i)return isFinite(x)?h.clone(b,o):void 0;let T=n.x,C=n.y,A=n.z,E=zSe;E.x=b.x*T*2,E.y=b.y*C*2,E.z=b.z*A*2;let v=(1-x)*h.magnitude(e)/(.5*h.magnitude(E)),D=0,O,R,M,N,_,S,w,I,L,B,U;do{v-=D,M=1/(1+v*T),N=1/(1+v*C),_=1/(1+v*A),S=M*M,w=N*N,I=_*_,L=S*M,B=w*N,U=I*_,O=d*S+p*w+g*I-1,R=d*L*T+p*B*C+g*U*A;let V=-2*R;D=O/V}while(Math.abs(O)>P.EPSILON12);return l(o)?(o.x=r*M,o.y=s*N,o.z=a*_,o):new h(r*M,s*N,a*_)}var J0=HSe;function Ho(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Ho.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Ho(e,t,n)};Ho.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),Ho.fromRadians(e,t,n,i)};var GSe=new h,WSe=new h,jSe=new h;Ho._ellipsoidOneOverRadii=new h(1/6378137,1/6378137,1/6356752314245179e-9);Ho._ellipsoidOneOverRadiiSquared=new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Ho._ellipsoidCenterToleranceSquared=P.EPSILON1;Ho.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:Ho._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:Ho._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:Ho._ellipsoidCenterToleranceSquared,s=J0(e,i,o,r,WSe);if(!l(s))return;let a=h.multiplyComponents(s,o,GSe);a=h.normalize(a,a);let c=h.subtract(e,s,jSe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),d=P.sign(h.dot(c,e))*h.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=d,n):new Ho(u,f,d)};Ho.toCartesian=function(e,t,n){return h.fromRadians(e.longitude,e.latitude,e.height,t,n)};Ho.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Ho(e.longitude,e.latitude,e.height)};Ho.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Ho.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Ho.ZERO=Object.freeze(new Ho(0,0,0));Ho.prototype.clone=function(e){return Ho.clone(this,e)};Ho.prototype.equals=function(e){return Ho.equals(this,e)};Ho.prototype.equalsEpsilon=function(e,t){return Ho.equalsEpsilon(this,e,t)};Ho.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var fe=Ho;function pJ(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function _i(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,pJ(this,e,t,n)}Object.defineProperties(_i.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});_i.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(h.clone(n,t._radii),h.clone(e._radiiSquared,t._radiiSquared),h.clone(e._radiiToTheFourth,t._radiiToTheFourth),h.clone(e._oneOverRadii,t._oneOverRadii),h.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new _i(n.x,n.y,n.z)};_i.fromCartesian3=function(e,t){return l(t)||(t=new _i),l(e)&&pJ(t,e.x,e.y,e.z),t};_i.WGS84=Object.freeze(new _i(6378137,6378137,6356752314245179e-9));_i.UNIT_SPHERE=Object.freeze(new _i(1,1,1));_i.MOON=Object.freeze(new _i(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));_i._default=_i.WGS84;Object.defineProperties(_i,{default:{get:function(){return _i._default},set:function(e){_i._default=e,h._ellipsoidRadiiSquared=e.radiiSquared,fe._ellipsoidOneOverRadii=e.oneOverRadii,fe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,fe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});_i.prototype.clone=function(e){return _i.clone(this,e)};_i.packedLength=h.packedLength;_i.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),t};_i.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t);return _i.fromCartesian3(i,n)};_i.prototype.geocentricSurfaceNormal=h.normalize;_i.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new h),t.x=r,t.y=s,t.z=a,h.normalize(t,t)};_i.prototype.geodeticSurfaceNormal=function(e,t){if(!h.equalsEpsilon(e,h.ZERO,P.EPSILON14))return l(t)||(t=new h),t=h.multiplyComponents(e,this._oneOverRadiiSquared,t),h.normalize(t,t)};var qSe=new h,YSe=new h;_i.prototype.cartographicToCartesian=function(e,t){let n=qSe,i=YSe;this.geodeticSurfaceNormalCartographic(e,n),h.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(h.dot(n,i));return h.divideByScalar(i,o,i),h.multiplyByScalar(n,e.height,n),l(t)||(t=new h),h.add(i,n,t)};_i.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var XSe=new h,KSe=new h,ZSe=new h;_i.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,KSe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,XSe),o=h.subtract(e,n,ZSe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=P.sign(h.dot(o,e))*h.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new fe(r,s,a)};_i.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};_i.prototype.scaleToGeodeticSurface=function(e,t){return J0(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};_i.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new h);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return h.multiplyByScalar(e,s,t)};_i.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._oneOverRadii,t)};_i.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._radii,t)};_i.prototype.equals=function(e){return this===e||l(e)&&h.equals(this._radii,e._radii)};_i.prototype.toString=function(){return this._radii.toString()};_i.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new h),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var $Se=new h;_i.prototype.getLocalCurvature=function(e,t){l(t)||(t=new z);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,$Se),i=h.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return z.fromElements(1/i,1/r,t)};var QSe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],JSe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function mJ(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*QSe[s];r+=JSe[s]*(n(i+a)+n(i-a))}return r*=o,r}_i.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=P.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,u=s*a;return mJ(i,o,function(f){let d=Math.cos(f),p=Math.sin(f);return Math.cos(f)*mJ(t,n,function(g){let m=Math.cos(g),x=Math.sin(g);return Math.sqrt(u*p*p+c*(a*m*m+s*x*x)*d*d)})})};var ee=_i;function AV(e){this._ellipsoid=y(e,ee.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(AV.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});AV.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};AV.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var Pi=AV;var eve={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Wt=Object.freeze(eve);function tve(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Mo=tve;function nve(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Mg=nve;function ive(e){return e%4===0&&e%100!==0||e%400===0}var wd=ive;var _J=[31,28,31,30,31,30,31,31,30,31,30,31];function ove(e,t,n,i,o,r,s,a){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,0),o=y(o,0),r=y(r,0),s=y(s,0),a=y(a,!1),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function x(){bo.typeOf.number.greaterThanOrEquals("Year",e,1),bo.typeOf.number.lessThanOrEquals("Year",e,9999),bo.typeOf.number.greaterThanOrEquals("Month",t,1),bo.typeOf.number.lessThanOrEquals("Month",t,12),bo.typeOf.number.greaterThanOrEquals("Day",n,1),bo.typeOf.number.lessThanOrEquals("Day",n,31),bo.typeOf.number.greaterThanOrEquals("Hour",i,0),bo.typeOf.number.lessThanOrEquals("Hour",i,23),bo.typeOf.number.greaterThanOrEquals("Minute",o,0),bo.typeOf.number.lessThanOrEquals("Minute",o,59),bo.typeOf.bool("IsLeapSecond",a),bo.typeOf.number.greaterThanOrEquals("Second",r,0),bo.typeOf.number.lessThanOrEquals("Second",r,a?60:59),bo.typeOf.number.greaterThanOrEquals("Millisecond",s,0),bo.typeOf.number.lessThan("Millisecond",s,1e3)}function b(){let T=t===2&&wd(e)?_J[t-1]+1:_J[t-1];if(n>T)throw new he("Month and Day represents invalid date")}}var Tp=ove;function rve(e,t){this.julianDate=e,this.offset=t}var qi=rve;var sve={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},qn=Object.freeze(sve);var ave={UTC:0,TAI:1},Wn=Object.freeze(ave);var yJ=new Tp,R5=[31,28,31,30,31,30,31,31,30,31,30,31],O5=29;function M5(e,t){return Rt.compare(e.julianDate,t.julianDate)}var HC=new qi;function SV(e){HC.julianDate=e;let t=Rt.leapSeconds,n=Mo(t,HC,M5);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Rt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Rt.addSeconds(e,i,e)}function gJ(e,t){HC.julianDate=e;let n=Rt.leapSeconds,i=Mo(n,HC,M5);if(i<0&&(i=~i),i===0)return Rt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Rt.addSeconds(e,-n[i-1].offset,t);let o=Rt.secondsDifference(n[i].julianDate,e);if(o===0)return Rt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Rt.addSeconds(e,-n[--i].offset,t)}function Lg(e,t,n){let i=t/qn.SECONDS_PER_DAY|0;return e+=i,t-=qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function L5(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*qn.SECONDS_PER_HOUR+o*qn.SECONDS_PER_MINUTE+s*qn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var cve=/^(\d{4})$/,lve=/^(\d{4})-(\d{2})$/,uve=/^(\d{4})-?(\d{3})$/,fve=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,dve=/^(\d{4})-?(\d{2})-?(\d{2})$/,N5=/([Z+\-])?(\d{2})?:?(\d{2})?$/,hve=/^(\d{2})(\.\d+)?/.source+N5.source,mve=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N5.source,pve=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N5.source;function Rt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Wn.UTC);let i=e|0;t=t+(e-i)*qn.SECONDS_PER_DAY,Lg(i,t,this),n===Wn.UTC&&SV(this)}Rt.fromGregorianDate=function(e,t){let n=L5(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(Lg(n[0],n[1],t),SV(t),t):new Rt(n[0],n[1],Wn.UTC)};Rt.fromDate=function(e,t){let n=L5(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(Lg(n[0],n[1],t),SV(t),t):new Rt(n[0],n[1],Wn.UTC)};Rt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,f=n[0],d=n[1],p,g;if(n=f.match(dve),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(lve),n!==null)i=+n[1],o=+n[2];else if(n=f.match(cve),n!==null)i=+n[1];else{let T;if(n=f.match(uve),n!==null)i=+n[1],T=+n[2],g=wd(i);else if(n=f.match(fve),n!==null){i=+n[1];let C=+n[2],A=+n[3]||0,E=new Date(Date.UTC(i,0,4));T=C*7+A-E.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(T),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=wd(i);let m;if(l(d)){n=d.match(pve),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,m=5):(n=d.match(mve),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,m=4):(n=d.match(hve),n!==null&&(s=+n[1],a=+(n[2]||0)*60,m=3)));let T=n[m],C=+n[m+1],A=+(n[m+2]||0);switch(T){case"+":s=s-C,a=a-A;break;case"-":s=s+C,a=a+A;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?O5:R5[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?O5:R5[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?O5:R5[o-1],r+=p;let b=L5(i,o,r,s,a,c,u);return l(t)?(Lg(b[0],b[1],t),SV(t)):t=new Rt(b[0],b[1],Wn.UTC),x&&Rt.addSeconds(t,1,t),t};Rt.now=function(e){return Rt.fromDate(new Date,e)};var EV=new Rt(0,0,Wn.TAI);Rt.toGregorianDate=function(e,t){let n=!1,i=gJ(e,EV);l(i)||(Rt.addSeconds(e,-1,EV),i=gJ(EV,EV),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let d=u+2-12*s|0,p=100*(a-49)+c+s|0,g=r/qn.SECONDS_PER_HOUR|0,m=r-g*qn.SECONDS_PER_HOUR,x=m/qn.SECONDS_PER_MINUTE|0;m=m-x*qn.SECONDS_PER_MINUTE;let b=m|0,T=(m-b)/qn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(b+=1),l(t)?(t.year=p,t.month=d,t.day=f,t.hour=g,t.minute=x,t.second=b,t.millisecond=T,t.isLeapSecond=n,t):new Tp(p,d,f,g,x,b,T,n)};Rt.toDate=function(e){let t=Rt.toGregorianDate(e,yJ),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Rt.toIso8601=function(e,t){let n=Rt.toGregorianDate(e,yJ),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;if(!l(t)&&u!==0){let d=u*.01;return f=d<1e-6?d.toFixed(20).replace(".","").replace(/0+$/,""):d.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`}return!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};Rt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Rt(e.dayNumber,e.secondsOfDay,Wn.TAI)};Rt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Rt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Rt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(Rt.secondsDifference(e,t))<=n};Rt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/qn.SECONDS_PER_DAY};Rt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Rt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/qn.SECONDS_PER_DAY;return n+i};Rt.computeTaiMinusUtc=function(e){HC.julianDate=e;let t=Rt.leapSeconds,n=Mo(t,HC,M5);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Rt.addSeconds=function(e,t,n){return Lg(e.dayNumber,e.secondsOfDay+t,n)};Rt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*qn.SECONDS_PER_MINUTE;return Lg(e.dayNumber,i,n)};Rt.addHours=function(e,t,n){let i=e.secondsOfDay+t*qn.SECONDS_PER_HOUR;return Lg(e.dayNumber,i,n)};Rt.addDays=function(e,t,n){let i=e.dayNumber+t;return Lg(i,e.secondsOfDay,n)};Rt.lessThan=function(e,t){return Rt.compare(e,t)<0};Rt.lessThanOrEquals=function(e,t){return Rt.compare(e,t)<=0};Rt.greaterThan=function(e,t){return Rt.compare(e,t)>0};Rt.greaterThanOrEquals=function(e,t){return Rt.compare(e,t)>=0};Rt.prototype.clone=function(e){return Rt.clone(this,e)};Rt.prototype.equals=function(e){return Rt.equals(this,e)};Rt.prototype.equalsEpsilon=function(e,t){return Rt.equalsEpsilon(this,e,t)};Rt.prototype.toString=function(){return Rt.toIso8601(this)};Rt.leapSeconds=[new qi(new Rt(2441317,43210,Wn.TAI),10),new qi(new Rt(2441499,43211,Wn.TAI),11),new qi(new Rt(2441683,43212,Wn.TAI),12),new qi(new Rt(2442048,43213,Wn.TAI),13),new qi(new Rt(2442413,43214,Wn.TAI),14),new qi(new Rt(2442778,43215,Wn.TAI),15),new qi(new Rt(2443144,43216,Wn.TAI),16),new qi(new Rt(2443509,43217,Wn.TAI),17),new qi(new Rt(2443874,43218,Wn.TAI),18),new qi(new Rt(2444239,43219,Wn.TAI),19),new qi(new Rt(2444786,43220,Wn.TAI),20),new qi(new Rt(2445151,43221,Wn.TAI),21),new qi(new Rt(2445516,43222,Wn.TAI),22),new qi(new Rt(2446247,43223,Wn.TAI),23),new qi(new Rt(2447161,43224,Wn.TAI),24),new qi(new Rt(2447892,43225,Wn.TAI),25),new qi(new Rt(2448257,43226,Wn.TAI),26),new qi(new Rt(2448804,43227,Wn.TAI),27),new qi(new Rt(2449169,43228,Wn.TAI),28),new qi(new Rt(2449534,43229,Wn.TAI),29),new qi(new Rt(2450083,43230,Wn.TAI),30),new qi(new Rt(2450630,43231,Wn.TAI),31),new qi(new Rt(2451179,43232,Wn.TAI),32),new qi(new Rt(2453736,43233,Wn.TAI),33),new qi(new Rt(2454832,43234,Wn.TAI),34),new qi(new Rt(2456109,43235,Wn.TAI),35),new qi(new Rt(2457204,43236,Wn.TAI),36),new qi(new Rt(2457754,43237,Wn.TAI),37)];var Z=Rt;var BJ=Zo(uu(),1);function _ve(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var nw=_ve;function SJ(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=SJ(o,t)),n[i]=o}return n}var Ge=SJ;function vJ(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=vJ(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var xt=vJ;function gve(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var wl=gve;var wJ=Zo(uu(),1);function F5(e,t){let n;return typeof document<"u"&&(n=document),F5._implementation(e,t,n)}F5._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new wJ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Jh=F5;var DJ=Zo(uu(),1);function yve(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new DJ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var iw=yve;var IJ=Zo(uu(),1);function xve(e){let t=new IJ.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var ex=xve;var PJ={};function bve(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=PJ[t];l(i)||(i={},PJ[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var Dd=bve;var Tve=/^blob:/i;function Cve(e){return Tve.test(e)}var tx=Cve;var em;function Ave(e){l(em)||(em=document.createElement("a")),em.href=window.location.href;let t=em.host,n=em.protocol;return em.href=e,em.href=em.href,n!==em.protocol||t!==em.host}var Ng=Ave;var Eve=/^data:/i;function Sve(e){return Eve.test(e)}var Cp=Sve;function vve(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var nx=vve;function wve(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var ix=wve;function Dve(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var fu=Dve;var Ive={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},Zn=Object.freeze(Ive);var Pve={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ds=Object.freeze(Pve);function IV(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,ds.OTHER),this.serverKey=e.serverKey,this.state=Zn.UNISSUED,this.deferred=void 0,this.cancelled=!1}IV.prototype.cancel=function(){this.cancelled=!0};IV.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=Zn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new IV(this)};var $o=IV;function Rve(e){let t={};if(!e)return t;let n=e.split(`\r +`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var ow=Rve;function RJ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=ow(this.responseHeaders))}RJ.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var tm=RJ;var PV=Zo(uu(),1);function rw(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(rw.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});rw.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};rw.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function Ove(e,t){return t-e}rw.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];l(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(Ove),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var pe=rw;function ox(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(ox.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function B5(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}ox.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};ox.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(B5(i,o,e),e=o):r=!1}};ox.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};ox.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)B5(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};ox.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return B5(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var sw=ox;function Mve(e,t){return e.priority-t.priority}var to={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},jC=20,nc=new sw({comparator:Mve});nc.maximumLength=jC;nc.reserve(jC);var nm=[],Ap={},Lve=typeof document<"u"?new PV.default(document.location.href):new PV.default,RV=new pe;function Qo(){}Qo.maximumRequests=50;Qo.maximumRequestsPerServer=18;Qo.requestsByServer={};Qo.throttleRequests=!0;Qo.debugShowStatistics=!1;Qo.requestCompletedEvent=RV;Object.defineProperties(Qo,{statistics:{get:function(){return to}},priorityHeapLength:{get:function(){return jC},set:function(e){if(e<jC)for(;nc.length>e;){let t=nc.pop();rx(t)}jC=e,nc.maximumLength=e,nc.reserve(e)}}});function OJ(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Qo.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(Qo.requestsByServer[e],Qo.maximumRequestsPerServer);return Ap[e]+t<=n};Qo.heapHasOpenSlots=function(e){return nc.length+e<=jC};function MJ(e){return e.state===Zn.UNISSUED&&(e.state=Zn.ISSUED,e.deferred=wl()),e.deferred.promise}function Nve(e){return function(t){if(e.state===Zn.CANCELLED)return;let n=e.deferred;--to.numberOfActiveRequests,--Ap[e.serverKey],RV.raiseEvent(),e.state=Zn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Fve(e){return function(t){e.state!==Zn.CANCELLED&&(++to.numberOfFailedRequests,--to.numberOfActiveRequests,--Ap[e.serverKey],RV.raiseEvent(t),e.state=Zn.FAILED,e.deferred.reject(t))}}function LJ(e){let t=MJ(e);return e.state=Zn.ACTIVE,nm.push(e),++to.numberOfActiveRequests,++to.numberOfActiveRequestsEver,++Ap[e.serverKey],e.requestFunction().then(Nve(e)).catch(Fve(e)),t}function rx(e){let t=e.state===Zn.ACTIVE;if(e.state=Zn.CANCELLED,++to.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--to.numberOfActiveRequests,--Ap[e.serverKey],++to.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Qo.update=function(){let e,t,n=0,i=nm.length;for(e=0;e<i;++e){if(t=nm[e],t.cancelled&&rx(t),t.state!==Zn.ACTIVE){++n;continue}n>0&&(nm[e-n]=t)}nm.length-=n;let o=nc.internalArray,r=nc.length;for(e=0;e<r;++e)OJ(o[e]);nc.resort();let s=Math.max(Qo.maximumRequests-nm.length,0),a=0;for(;a<s&&nc.length>0;){if(t=nc.pop(),t.cancelled){rx(t);continue}if(t.throttleByServer&&!Qo.serverHasOpenSlots(t.serverKey)){rx(t);continue}LJ(t),++a}Bve()};Qo.getServerKey=function(e){let t=new PV.default(e);t.scheme()===""&&(t=t.absoluteTo(Lve),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Ap[n];return l(i)||(Ap[n]=0),n};Qo.request=function(e){if(Cp(e.url)||tx(e.url))return RV.raiseEvent(),e.state=Zn.RECEIVED,e.requestFunction();if(++to.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Qo.getServerKey(e.url)),Qo.throttleRequests&&e.throttleByServer&&!Qo.serverHasOpenSlots(e.serverKey))return;if(!Qo.throttleRequests||!e.throttle)return LJ(e);if(nm.length>=Qo.maximumRequests)return;OJ(e);let t=nc.insert(e);if(l(t)){if(t===e)return;rx(t)}return MJ(e)};function Bve(){Qo.debugShowStatistics&&(to.numberOfActiveRequests===0&&to.lastNumberOfActiveRequests>0&&(to.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${to.numberOfAttemptedRequests}`),to.numberOfAttemptedRequests=0),to.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${to.numberOfCancelledRequests}`),to.numberOfCancelledRequests=0),to.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${to.numberOfCancelledActiveRequests}`),to.numberOfCancelledActiveRequests=0),to.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${to.numberOfFailedRequests}`),to.numberOfFailedRequests=0)),to.lastNumberOfActiveRequests=to.numberOfActiveRequests)}Qo.clearForSpecs=function(){for(;nc.length>0;){let t=nc.pop();rx(t)}let e=nm.length;for(let t=0;t<e;++t)rx(nm[t]);nm.length=0,Ap={},to.numberOfAttemptedRequests=0,to.numberOfActiveRequests=0,to.numberOfCancelledRequests=0,to.numberOfCancelledActiveRequests=0,to.numberOfFailedRequests=0,to.numberOfActiveRequestsEver=0,to.lastNumberOfActiveRequests=0};Qo.numberOfActiveRequestsByServer=function(e){return Ap[e]};Qo.requestHeap=nc;var ic=Qo;var NJ=Zo(uu(),1);var aw={},qC={};aw.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(qC[n])||(qC[n]=!0)};aw.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(qC[n])&&delete qC[n]};function kve(e){let t=new NJ.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}aw.contains=function(e){let t=kve(e);return!!(l(t)&&l(qC[t]))};aw.clear=function(){qC={}};var YC=aw;var kJ=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function Dt(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=im(e.templateValues,{}),this._queryParameters=im(e.queryParameters,{}),this.headers=im(e.headers,{}),this.request=y(e.request,new $o),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function im(e,t){return l(e)?Ge(e):t}Dt.createIfNeeded=function(e){return e instanceof Dt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Dt({url:e})};var XC;Dt.supportsImageBitmapOptions=function(){return l(XC)?XC:typeof createImageBitmap!="function"?(XC=Promise.resolve(!1),XC):(XC=Dt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=Dd(t[0]),i=Dd(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),XC)};Object.defineProperties(Dt,{isBlobSupported:{get:function(){return kJ}}});Object.defineProperties(Dt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return ex(this._url)}},isDataUri:{get:function(){return Cp(this._url)}},isBlobUri:{get:function(){return tx(this._url)}},isCrossOriginUrl:{get:function(){return Ng(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Dt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Dt.prototype.parseUrl=function(e,t,n,i){let o=new BJ.default(e),r=Vve(o.query());this._queryParameters=t?MV(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Jh(i))),this._url=o.toString()};function Vve(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:fu(e)}function MV(e,t,n){if(!n)return xt(e,t);let i=Ge(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Dt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Uve(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function Uve(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${ix(e)}`}Dt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=MV(this._queryParameters,e,!1):this._queryParameters=MV(e,this._queryParameters,!1)};Dt.prototype.appendQueryParameters=function(e){this._queryParameters=MV(e,this._queryParameters,!0)};Dt.prototype.setTemplateValues=function(e,t){t?this._templateValues=xt(this._templateValues,e):this._templateValues=xt(e,this._templateValues)};Dt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=xt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=xt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=xt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Dt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Dt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ge(this._queryParameters),e._templateValues=Ge(this._templateValues),e.headers=Ge(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Dt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};Dt.prototype.getBaseUri=function(e){return iw(this.getUrlComponent(e),e)};Dt.prototype.appendForwardSlash=function(){this._url=nw(this._url)};Dt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Dt.fetchArrayBuffer=function(e){return new Dt(e).fetchArrayBuffer()};Dt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Dt.fetchBlob=function(e){return new Dt(e).fetchBlob()};Dt.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(V5(this.request),!kJ||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return k5({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,u;return Dt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!l(f))return;if(u=f,a)return Dt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let d=window.URL.createObjectURL(f);return c=new Dt({url:d}),k5({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function k5(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=wl();return Dt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=ic.request(r);if(l(s))return s.catch(function(a){return r.state!==Zn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=Zn.UNISSUED,r.deferred=void 0,k5({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Dt.fetchImage=function(e){return new Dt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Dt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Dt.fetchText=function(e){return new Dt(e).fetchText()};Dt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Dt.fetchJson=function(e){return new Dt(e).fetchJson()};Dt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Dt.fetchXML=function(e){return new Dt(e).fetchXML()};Dt.prototype.fetchJsonp=function(e){e=y(e,"callback"),V5(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return VJ(this,e,t)};function VJ(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=wl();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Dt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=ic.request(o);if(l(s))return s.catch(function(a){return o.state!==Zn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=Zn.UNISSUED,o.deferred=void 0,VJ(e,t,n)):Promise.reject(a)})})}Dt.fetchJsonp=function(e){return new Dt(e).fetchJsonp(e.callbackParameterName)};Dt.prototype._makeRequest=function(e){let t=this;V5(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=xt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=wl(),d=Dt._Implementations.loadWithXhr(i,r,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let o=ic.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Zn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Zn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function V5(e){if(e.state===Zn.ISSUED||e.state===Zn.ACTIVE)throw new re("The Resource is already being fetched.");e.state=Zn.UNISSUED,e.deferred=void 0}var zve=/^data:(.*?)(;base64)?,(.*)$/;function OV(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function FJ(e,t){let n=OV(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function Hve(e,t){t=y(t,"");let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return OV(i,o);case"arraybuffer":return FJ(i,o);case"blob":return r=FJ(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(OV(i,o),n);case"json":return JSON.parse(OV(i,o));default:}}Dt.prototype.fetch=function(e){return e=im(e,{}),e.method="GET",this._makeRequest(e)};Dt.fetch=function(e){return new Dt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt.prototype.delete=function(e){return e=im(e,{}),e.method="DELETE",this._makeRequest(e)};Dt.delete=function(e){return new Dt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Dt.prototype.head=function(e){return e=im(e,{}),e.method="HEAD",this._makeRequest(e)};Dt.head=function(e){return new Dt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt.prototype.options=function(e){return e=im(e,{}),e.method="OPTIONS",this._makeRequest(e)};Dt.options=function(e){return new Dt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt.prototype.post=function(e,t){return bo.defined("data",e),t=im(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Dt.post=function(e){return new Dt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt.prototype.put=function(e,t){return bo.defined("data",e),t=im(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Dt.put=function(e){return new Dt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt.prototype.patch=function(e,t){return bo.defined("data",e),t=im(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Dt.patch=function(e){return new Dt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt._Implementations={};Dt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(YC.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Dt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;Dt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){Dt._Implementations.loadImageElement(s,t,n);return}let c="blob",u="GET",f=wl(),d=Dt._Implementations.loadWithXhr(s,c,u,void 0,void 0,f,void 0,void 0,void 0);return l(d)&&l(d.abort)&&(e.cancelFunction=function(){d.abort()}),f.promise.then(function(p){if(!l(p)){n.reject(new re(`Successfully retrieved ${s} but it contained no content.`));return}return Dt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Dt.createImageBitmapFromBlob=function(e,t){return bo.defined("options",t),bo.typeOf.bool("options.flipY",t.flipY),bo.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),bo.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Gve(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),r.reject(new tm(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new tm)})}var Wve=typeof XMLHttpRequest>"u";Dt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=zve.exec(e);if(a!==null){r.resolve(Hve(a,t));return}if(Wve){Gve(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(YC.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new tm(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(x){let b=x.split(": "),T=b.shift();m[T]=b.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(l(f)&&(!l(t)||d===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new re("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new tm)},c.send(i),c};Dt._Implementations.loadAndExecuteScript=function(e,t,n){return nx(e,t).catch(function(i){n.reject(i)})};Dt._DefaultImplementations={};Dt._DefaultImplementations.createImage=Dt._Implementations.createImage;Dt._DefaultImplementations.loadWithXhr=Dt._Implementations.loadWithXhr;Dt._DefaultImplementations.loadAndExecuteScript=Dt._Implementations.loadAndExecuteScript;Dt.DEFAULT=Object.freeze(new Dt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Se=Dt;function lw(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?UJ(this,e.data):UJ(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}lw.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new re(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new lw({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};lw.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Mg(0,0,0,0,0),t}});lw.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Mg(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],u=Z.lessThanOrEquals(a,e),f=!l(c),d=f||Z.greaterThanOrEquals(c,e);if(u&&d)return o=i,!f&&c.equals(e)&&++o,r=o+1,HJ(this,n,this._samples,e,o,r,t),t}let s=Mo(n,e,Z.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,HJ(this,n,this._samples,e,o,r,t),t};function jve(e,t){return Z.compare(e.julianDate,t)}function UJ(e,t){if(!l(t.columnNames))throw new re("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new re("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new re("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let x=u[g+n],b=u[g+c],T=x+qn.MODIFIED_JULIAN_DATE_DIFFERENCE,C=new Z(T,b,Wn.TAI);if(f.push(C),p){if(b!==d&&l(d)){let A=Z.leapSeconds,E=Mo(A,C,jve);if(E<0){let v=new qi(C,b);A.splice(~E,0,v)}}d=b}}}function zJ(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function cw(e,t,n){return t+e*(n-t)}function HJ(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return zJ(e,n,o,a,s),s;if(i.equals(u))return zJ(e,n,r,a,s),s;let f=Z.secondsDifference(i,c)/Z.secondsDifference(u,c),d=o*a,p=r*a,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],x=m-g;if(x>.5||x<-.5){let b=n[d+e._taiMinusUtcSecondsColumn],T=n[p+e._taiMinusUtcSecondsColumn];b!==T&&(u.equals(i)?g=m:m-=T-b)}return s.xPoleWander=cw(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=cw(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=cw(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=cw(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=cw(f,g,m),s}var uw=lw;function oc(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}oc.fromQuaternion=function(e,t){l(t)||(t=new oc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-P.asinClamped(n),t};oc.fromDegrees=function(e,t,n,i){return l(i)||(i=new oc),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};oc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new oc(e.heading,e.pitch,e.roll)};oc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};oc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};oc.prototype.clone=function(e){return oc.clone(this,e)};oc.prototype.equals=function(e){return oc.equals(this,e)};oc.prototype.equalsEpsilon=function(e,t,n){return oc.equalsEpsilon(this,e,t,n)};oc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Da=oc;var GJ={},WJ=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function qve(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=WJ.exec(i);if(o!==null)return o[1]}}var LV;function jJ(e){return typeof document>"u"?e:(l(LV)||(LV=document.createElement("a")),LV.href=e,LV.href)}var sx;function qJ(){if(l(sx))return sx;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(GJ?.url)?e=Jh(".",GJ.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=Jh("..",ax("Core/buildModuleUrl.js")):e=qve(),sx=new Se({url:jJ(e)}),sx.appendForwardSlash(),sx}function Yve(e){return jJ(require.toUrl(`../${e}`))}function YJ(e){return qJ().getDerivedResource({url:e}).url}var NV;function ax(e){return l(NV)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?NV=Yve:NV=YJ),NV(e)}ax._cesiumScriptRegex=WJ;ax._buildModuleUrlFromBaseUrl=YJ;ax._clearBaseResource=function(){sx=void 0};ax.setBaseUrl=function(e){sx=Se.DEFAULT.getDerivedResource({url:e})};ax.getCesiumBaseUrl=qJ;var en=ax;function Xve(e,t,n){this.x=e,this.y=t,this.s=n}var cx=Xve;function H5(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Se.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new Z(this._sampleZeroJulianEphemerisDate,0,Wn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var Kve=new Z(0,0,Wn.TAI);function U5(e,t,n){let i=Kve;return i.dayNumber=t,i.secondsOfDay=n,Z.daysDifference(i,e._sampleZeroDateTT)}H5.prototype.preload=function(e,t,n,i){let o=U5(this,e,t),r=U5(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(z5(this,d));return Promise.all(f)};H5.prototype.computeXysRadians=function(e,t,n){let i=U5(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(z5(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(z5(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new cx(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,x,b;for(x=0;x<=r;++x)d[x]=f-m[x];for(x=0;x<=r;++x){for(g[x]=1,b=0;b<=r;++b)b!==x&&(g[x]*=d[b]);g[x]*=p[x];let T=(s+x)*3;n.x+=g[x]*u[T++],n.y+=g[x]*u[T++],n.s+=g[x]*u[T]}return n};function z5(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Se({url:en(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var fw=H5;function nt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var dw=new h;nt.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);dw=h.normalize(e,dw);let r=dw.x*o,s=dw.y*o,a=dw.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new nt(r,s,a,c)};var Zve=[1,2,0],$ve=new Array(3);nt.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let d=Zve,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(m,m)]+1);let x=$ve;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(m,g)]-e[$.getElementIndex(g,m)])*n,x[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,x[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new nt(i,o,r,s)};var XJ=new nt,KJ=new nt,G5=new nt,ZJ=new nt;nt.fromHeadingPitchRoll=function(e,t){return ZJ=nt.fromAxisAngle(h.UNIT_X,e.roll,XJ),G5=nt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=nt.multiply(G5,ZJ,G5),KJ=nt.fromAxisAngle(h.UNIT_Z,-e.heading,XJ),nt.multiply(KJ,t,t)};var FV=new h,W5=new h,Id=new nt,$J=new nt,BV=new nt;nt.packedLength=4;nt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};nt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new nt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};nt.packedInterpolationLength=3;nt.convertPackedArrayForInterpolation=function(e,t,n,i){nt.unpack(e,n*4,BV),nt.conjugate(BV,BV);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;nt.unpack(e,(t+o)*4,Id),nt.multiply(Id,BV,Id),Id.w<0&&nt.negate(Id,Id),nt.computeAxis(Id,FV);let a=nt.computeAngle(Id);l(i)||(i=[]),i[s]=FV.x*a,i[s+1]=FV.y*a,i[s+2]=FV.z*a}};nt.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new nt),h.fromArray(e,0,W5);let r=h.magnitude(W5);return nt.unpack(t,i*4,$J),r===0?nt.clone(nt.IDENTITY,Id):nt.fromAxisAngle(W5,r,Id),nt.multiply(Id,$J,o)};nt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new nt(e.x,e.y,e.z,e.w)};nt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};nt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};nt.magnitude=function(e){return Math.sqrt(nt.magnitudeSquared(e))};nt.normalize=function(e,t){let n=1/nt.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};nt.inverse=function(e,t){let n=nt.magnitudeSquared(e);return t=nt.conjugate(e,t),nt.multiplyByScalar(t,1/n,t)};nt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};nt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};nt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};nt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};nt.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+o*u-r*c,p=s*c-i*u+o*f+r*a,g=s*u+i*c-o*a+r*f,m=s*f-i*a-o*c-r*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};nt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};nt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};nt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6||Math.abs(n+1)<P.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};nt.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var j5=new nt;nt.lerp=function(e,t,n,i){return j5=nt.multiplyByScalar(t,n,j5),i=nt.multiplyByScalar(e,1-n,i),nt.add(j5,i,i)};var QJ=new nt,q5=new nt,Y5=new nt;nt.slerp=function(e,t,n,i){let o=nt.dot(e,t),r=t;if(o<0&&(o=-o,r=QJ=nt.negate(t,QJ)),1-o<P.EPSILON6)return nt.lerp(e,r,n,i);let s=Math.acos(o);return q5=nt.multiplyByScalar(e,Math.sin((1-n)*s),q5),Y5=nt.multiplyByScalar(r,Math.sin(n*s),Y5),i=nt.add(q5,Y5,i),nt.multiplyByScalar(i,1/Math.sin(s),i)};nt.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};nt.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var Qve=new h,Jve=new h,hw=new nt,KC=new nt;nt.computeInnerQuadrangle=function(e,t,n,i){let o=nt.conjugate(t,hw);nt.multiply(o,n,KC);let r=nt.log(KC,Qve);nt.multiply(o,e,KC);let s=nt.log(KC,Jve);return h.add(r,s,r),h.multiplyByScalar(r,.25,r),h.negate(r,r),nt.exp(r,hw),nt.multiply(t,hw,i)};nt.squad=function(e,t,n,i,o,r){let s=nt.slerp(e,t,o,hw),a=nt.slerp(n,i,o,KC);return nt.slerp(s,a,2*o*(1-o),r)};var ewe=new nt,JJ=1.9011074535173003,kV=zt.supportsTypedArrays()?new Float32Array(8):[],VV=zt.supportsTypedArrays()?new Float32Array(8):[],Ep=zt.supportsTypedArrays()?new Float32Array(8):[],Sp=zt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;kV[e]=1/(t*n),VV[e]=t/n}kV[7]=JJ/(8*17);VV[7]=JJ*8/17;nt.fastSlerp=function(e,t,n,i){let o=nt.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)Ep[g]=(kV[g]*c-VV[g])*s,Sp[g]=(kV[g]*u-VV[g])*s;let f=r*n*(1+Ep[0]*(1+Ep[1]*(1+Ep[2]*(1+Ep[3]*(1+Ep[4]*(1+Ep[5]*(1+Ep[6]*(1+Ep[7])))))))),d=a*(1+Sp[0]*(1+Sp[1]*(1+Sp[2]*(1+Sp[3]*(1+Sp[4]*(1+Sp[5]*(1+Sp[6]*(1+Sp[7])))))))),p=nt.multiplyByScalar(e,d,ewe);return nt.multiplyByScalar(t,f,i),nt.add(p,i,i)};nt.fastSquad=function(e,t,n,i,o,r){let s=nt.fastSlerp(e,t,o,hw),a=nt.fastSlerp(n,i,o,KC);return nt.fastSlerp(s,a,2*o*(1-o),r)};nt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};nt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};nt.ZERO=Object.freeze(new nt(0,0,0,0));nt.IDENTITY=Object.freeze(new nt(0,0,0,1));nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.prototype.equalsEpsilon=function(e,t){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Oe=nt;var ui={},X5={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},ZC={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},K5={},Dl={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Fg=new h,Bg=new h,kg=new h;ui.localFrameToFixedFrameGenerator=function(e,t){if(!X5.hasOwnProperty(e)||!X5[e].hasOwnProperty(t))throw new he("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=X5[e][t],i,o=e+t;return l(K5[o])?i=K5[o]:(i=function(r,s,a){if(l(a)||(a=new F),h.equalsEpsilon(r,h.ZERO,P.EPSILON14))h.unpack(ZC[e],0,Fg),h.unpack(ZC[t],0,Bg),h.unpack(ZC[n],0,kg);else if(P.equalsEpsilon(r.x,0,P.EPSILON14)&&P.equalsEpsilon(r.y,0,P.EPSILON14)){let c=P.sign(r.z);h.unpack(ZC[e],0,Fg),e!=="east"&&e!=="west"&&h.multiplyByScalar(Fg,c,Fg),h.unpack(ZC[t],0,Bg),t!=="east"&&t!=="west"&&h.multiplyByScalar(Bg,c,Bg),h.unpack(ZC[n],0,kg),n!=="east"&&n!=="west"&&h.multiplyByScalar(kg,c,kg)}else{s=y(s,ee.default),s.geodeticSurfaceNormal(r,Dl.up);let c=Dl.up,u=Dl.east;u.x=-r.y,u.y=r.x,u.z=0,h.normalize(u,Dl.east),h.cross(c,u,Dl.north),h.multiplyByScalar(Dl.up,-1,Dl.down),h.multiplyByScalar(Dl.east,-1,Dl.west),h.multiplyByScalar(Dl.north,-1,Dl.south),Fg=Dl[e],Bg=Dl[t],kg=Dl[n]}return a[0]=Fg.x,a[1]=Fg.y,a[2]=Fg.z,a[3]=0,a[4]=Bg.x,a[5]=Bg.y,a[6]=Bg.z,a[7]=0,a[8]=kg.x,a[9]=kg.y,a[10]=kg.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},K5[o]=i),i};ui.eastNorthUpToFixedFrame=ui.localFrameToFixedFrameGenerator("east","north");ui.northEastDownToFixedFrame=ui.localFrameToFixedFrameGenerator("north","east");ui.northUpEastToFixedFrame=ui.localFrameToFixedFrameGenerator("north","up");ui.northWestUpToFixedFrame=ui.localFrameToFixedFrameGenerator("north","west");var twe=new Oe,nwe=new h(1,1,1),iwe=new F;ui.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,ui.eastNorthUpToFixedFrame);let r=Oe.fromHeadingPitchRoll(t,twe),s=F.fromTranslationQuaternionRotationScale(h.ZERO,r,nwe,iwe);return o=i(e,n,o),F.multiply(o,s,o)};var owe=new F,rwe=new $;ui.headingPitchRollQuaternion=function(e,t,n,i,o){let r=ui.headingPitchRollToFixedFrame(e,t,n,i,owe),s=F.getMatrix3(r,rwe);return Oe.fromRotationMatrix(s,o)};var swe=new h(1,1,1),awe=new h,eee=new F,cwe=new F,lwe=new $,uwe=new Oe;ui.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,ee.default),n=y(n,ui.eastNorthUpToFixedFrame),l(i)||(i=new Da);let o=F.getTranslation(e,awe);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=F.inverseTransformation(n(o,t,eee),eee),s=F.setScale(e,swe,cwe);s=F.setTranslation(s,h.ZERO,s),r=F.multiply(r,s,r);let a=Oe.fromRotationMatrix(F.getMatrix3(r,lwe),uwe);return a=Oe.normalize(a,a),Da.fromQuaternion(a,i)};var fwe=6*3600+41*60+50.54841,dwe=8640184812866e-6,hwe=.093104,mwe=-62e-7,pwe=11772758384668e-32,_we=72921158553e-15,gwe=P.TWO_PI/86400,UV=new Z;ui.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=ui.computeIcrfToFixedMatrix(e,t);return l(n)||(n=ui.computeTemeToPseudoFixedMatrix(e,t)),n};ui.computeTemeToPseudoFixedMatrix=function(e,t){UV=Z.addSeconds(e,-Z.computeTaiMinusUtc(e),UV);let n=UV.dayNumber,i=UV.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/qn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/qn.DAYS_PER_JULIAN_CENTURY;let a=(fwe+o*(dwe+o*(hwe+o*mwe)))*gwe%P.TWO_PI,c=_we+pwe*(n-24515455e-1),u=(i+qn.SECONDS_PER_DAY*.5)%qn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};ui.iau2006XysData=new fw;ui.earthOrientationParameters=uw.NONE;var Q5=32.184,ywe=2451545;ui.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Q5,i=e.stop.dayNumber,o=e.stop.secondsOfDay+Q5;return ui.iau2006XysData.preload(t,n,i,o)};ui.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=ui.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var xwe=32.184,bwe=2451545,zV=new Da,Twe=new $,Cwe=new Z;ui.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Z.addSeconds(e,xwe,Cwe),i=Z.totalDays(n)-bwe,o=P.toRadians(12.112)-P.toRadians(.052992)*i,r=P.toRadians(24.224)-P.toRadians(.105984)*i,s=P.toRadians(227.645)+P.toRadians(13.012)*i,a=P.toRadians(261.105)+P.toRadians(13.340716)*i,c=P.toRadians(358)+P.toRadians(.9856)*i;return zV.pitch=P.toRadians(180)-P.toRadians(3.878)*Math.sin(o)-P.toRadians(.12)*Math.sin(r)+P.toRadians(.07)*Math.sin(s)-P.toRadians(.017)*Math.sin(a),zV.roll=P.toRadians(66.53-90)+P.toRadians(1.543)*Math.cos(o)+P.toRadians(.24)*Math.cos(r)-P.toRadians(.028)*Math.cos(s)+P.toRadians(.007)*Math.cos(a),zV.heading=P.toRadians(244.375-90)+P.toRadians(13.17635831)*i+P.toRadians(3.558)*Math.sin(o)+P.toRadians(.121)*Math.sin(r)-P.toRadians(.064)*Math.sin(s)+P.toRadians(.016)*Math.sin(a)+P.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(zV,Twe)};ui.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=ui.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var Awe=new cx(0,0,0),Ewe=new Mg(0,0,0,0,0,0),Z5=new $,$5=new $;ui.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=ui.earthOrientationParameters.compute(e,Ewe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+Q5,r=ui.iau2006XysData.computeXysRadians(i,o,Awe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=Z5;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-r.s,$5),d=$.multiply(u,f,Z5),p=e.dayNumber,g=e.secondsOfDay-Z.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,x=g/qn.SECONDS_PER_DAY,b=.779057273264+x+.00273781191135448*(m+x);b=b%1*P.TWO_PI;let T=$.fromRotationZ(b,$5),C=$.multiply(d,T,Z5),A=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),D=Math.sin(n.yPoleWander),O=i-ywe+o/qn.SECONDS_PER_DAY;O/=36525;let R=-47e-6*O*P.RADIANS_PER_DEGREE/3600,M=Math.cos(R),N=Math.sin(R),_=$5;return _[0]=A*M,_[1]=A*N,_[2]=v,_[3]=-E*N+D*v*M,_[4]=E*M+D*v*N,_[5]=-D*A,_[6]=-D*N-E*v*M,_[7]=D*M-E*v*N,_[8]=E*A,$.multiply(C,_,t)};var Swe=new oe;ui.pointToWindowCoordinates=function(e,t,n,i){return i=ui.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ui.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new z);let o=Swe;return F.multiplyByVector(e,oe.fromElements(n.x,n.y,n.z,1,o),o),oe.multiplyByScalar(o,1/o.w,o),F.multiplyByVector(t,o,o),z.fromCartesian4(o,i)};var vwe=new h,wwe=new h,Dwe=new h;ui.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,ee.default).geodeticSurfaceNormal(e,vwe),r=h.cross(t,o,wwe);h.equalsEpsilon(r,h.ZERO,P.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,Dwe);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var tee=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),nee=new fe,J5=new h,Iwe=new h,Pwe=new $,e6=new F,iee=new F;ui.basisTo2D=function(e,t,n){let i=F.getTranslation(t,Iwe),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,J5);else{let f=o.cartesianToCartographic(i,nee);r=e.project(f,J5),h.fromElements(r.z,r.x,r.y,r)}let s=ui.eastNorthUpToFixedFrame(i,o,e6),a=F.inverseTransformation(s,iee),c=F.getMatrix3(t,Pwe),u=F.multiplyByMatrix3(a,c,n);return F.multiply(tee,u,n),F.setTranslation(n,r,n),n};ui.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=ui.eastNorthUpToFixedFrame(t,i,e6),r=F.inverseTransformation(o,iee),s=i.cartesianToCartographic(t,nee),a=e.project(s,J5);h.fromElements(a.z,a.x,a.y,a);let c=F.fromTranslation(a,e6);return F.multiply(tee,r,n),F.multiply(c,n,n),n};var Ot=ui;function wn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(wn.prototype,{width:{get:function(){return wn.computeWidth(this)}},height:{get:function(){return wn.computeHeight(this)}}});wn.packedLength=4;wn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};wn.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new wn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};wn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=P.TWO_PI),t-n};wn.computeHeight=function(e){return e.north-e.south};wn.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(y(e,0)),t=P.toRadians(y(t,0)),n=P.toRadians(y(n,0)),i=P.toRadians(y(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new wn(e,t,n,i)};wn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=y(e,0),o.south=y(t,0),o.east=y(n,0),o.north=y(i,0),o):new wn(e,t,n,i)};wn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let d=f.longitude>=0?f.longitude:f.longitude+P.TWO_PI;o=Math.min(o,d),r=Math.max(r,d)}return i-n>r-o&&(n=o,i=r,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new wn(n,s,i,a)};wn.fromCartesianArray=function(e,t,n){t=y(t,ee.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let d=t.cartesianToCartographic(e[u]);i=Math.min(i,d.longitude),o=Math.max(o,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+P.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>P.PI&&(o=o-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new wn(i,a,o,c)};var Rwe=new h,Owe=new h,Mwe=new h,Lwe=new h,Nwe=new h,t6=new Array(5);for(let e=0;e<t6.length;++e)t6[e]=new h;wn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=ee.default),l(n)||(n=new wn),h.equals(i,h.ZERO))return wn.clone(wn.MAX_VALUE,n),n;let r=Ot.eastNorthUpToFixedFrame(i,t,Rwe),s=F.multiplyByPointAsVector(r,h.UNIT_X,Owe);h.normalize(s,s);let a=F.multiplyByPointAsVector(r,h.UNIT_Y,Mwe);h.normalize(a,a),h.multiplyByScalar(a,o,a),h.multiplyByScalar(s,o,s);let c=h.negate(a,Nwe),u=h.negate(s,Lwe),f=t6,d=f[0];return h.add(i,a,d),d=f[1],h.add(i,u,d),d=f[2],h.add(i,c,d),d=f[3],h.add(i,s,d),f[4]=i,wn.fromCartesianArray(f,t,n)};wn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new wn(e.west,e.south,e.east,e.north)};wn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};wn.prototype.clone=function(e){return wn.clone(this,e)};wn.prototype.equals=function(e){return wn.equals(this,e)};wn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};wn.prototype.equalsEpsilon=function(e,t){return wn.equalsEpsilon(this,e,t)};wn._validate=function(e){};wn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new fe(e.west,e.south)};wn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new fe(e.west,e.north)};wn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new fe(e.east,e.north)};wn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new fe(e.east,e.south)};wn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=P.TWO_PI);let o=P.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new fe(o,r)};wn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.max(o,s)),c=P.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new wn(a,u,c,f)};wn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new wn(i,o,r,s)};wn.union=function(e,t,n){l(n)||(n=new wn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.min(o,s)),c=P.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};wn.expand=function(e,t,n){return l(n)||(n=new wn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};wn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=P.TWO_PI,n<0&&(n+=P.TWO_PI)),(n>o||P.equalsEpsilon(n,o,P.EPSILON14))&&(n<r||P.equalsEpsilon(n,r,P.EPSILON14))&&i>=e.south&&i<=e.north};var Fwe=new fe;wn.subsample=function(e,t,n,i){t=y(t,ee.default),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=Fwe;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*P.PI_OVER_TWO,wn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};wn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new wn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=P.TWO_PI+e.east-e.west;r.west=P.negativePiToPi(e.west+t*a),r.east=P.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};wn.MAX_VALUE=Object.freeze(new wn(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var se=wn;function Lr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Lr.packedLength=4;Lr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Lr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Lr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Lr.fromPoints=function(e,t){if(l(t)||(t=new Lr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var oee=new Pi,Bwe=new fe,kwe=new fe;Lr.fromRectangle=function(e,t,n){if(l(n)||(n=new Lr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;oee._ellipsoid=ee.default,t=y(t,oee);let i=t.project(se.southwest(e,Bwe)),o=t.project(se.northeast(e,kwe));return z.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};Lr.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Lr(e.x,e.y,e.width,e.height)};Lr.union=function(e,t,n){l(n)||(n=new Lr);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};Lr.expand=function(e,t,n){n=Lr.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};Lr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?Wt.OUTSIDE:Wt.INTERSECTING};Lr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Lr.prototype.clone=function(e){return Lr.clone(this,e)};Lr.prototype.intersect=function(e){return Lr.intersect(this,e)};Lr.prototype.equals=function(e){return Lr.equals(this,e)};var je=Lr;var Ia={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};Ia.isLines=function(e){return e===Ia.LINES||e===Ia.LINE_LOOP||e===Ia.LINE_STRIP};Ia.isTriangles=function(e){return e===Ia.TRIANGLES||e===Ia.TRIANGLE_STRIP||e===Ia.TRIANGLE_FAN};Ia.validate=function(e){return e===Ia.POINTS||e===Ia.LINES||e===Ia.LINE_LOOP||e===Ia.LINE_STRIP||e===Ia.TRIANGLES||e===Ia.TRIANGLE_STRIP||e===Ia.TRIANGLE_FAN};var Me=Object.freeze(Ia);var lx=`in vec4 position; in vec2 textureCoordinates; out vec2 v_textureCoordinates; @@ -87,14 +87,14 @@ void main() gl_Position = position; v_textureCoordinates = textureCoordinates; } -`;var br={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function mw(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Me.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function oc(e,t){return(e._flags&t)===t}function Ug(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(mw.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return oc(this,br.CULL)},set:function(e){oc(this,br.CULL)!==e&&(Ug(this,br.CULL,e),this.dirty=!0)}},occlude:{get:function(){return oc(this,br.OCCLUDE)},set:function(e){oc(this,br.OCCLUDE)!==e&&(Ug(this,br.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return oc(this,br.CAST_SHADOWS)},set:function(e){oc(this,br.CAST_SHADOWS)!==e&&(Ug(this,br.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return oc(this,br.RECEIVE_SHADOWS)},set:function(e){oc(this,br.RECEIVE_SHADOWS)!==e&&(Ug(this,br.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return oc(this,br.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){oc(this,br.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Ug(this,br.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return oc(this,br.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){oc(this,br.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Ug(this,br.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return oc(this,br.PICK_ONLY)},set:function(e){oc(this,br.PICK_ONLY)!==e&&(Ug(this,br.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return oc(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){oc(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Ug(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});mw.shallowClone=function(e,t){if(l(e))return l(t)||(t=new mw),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};mw.prototype.execute=function(e,t){e.draw(this,t)};var Ze=mw;var fi={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};fi.toWebGLConstant=function(e,t){switch(e){case fi.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case fi.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case fi.UNSIGNED_INT:return te.UNSIGNED_INT;case fi.FLOAT:return te.FLOAT;case fi.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case fi.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case fi.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case fi.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case fi.UNSIGNED_SHORT_5_6_5:return fi.UNSIGNED_SHORT_5_6_5}};fi.isPacked=function(e){return e===fi.UNSIGNED_INT_24_8||e===fi.UNSIGNED_SHORT_4_4_4_4||e===fi.UNSIGNED_SHORT_5_5_5_1||e===fi.UNSIGNED_SHORT_5_6_5};fi.sizeInBytes=function(e){switch(e){case fi.UNSIGNED_BYTE:return 1;case fi.UNSIGNED_SHORT:case fi.UNSIGNED_SHORT_4_4_4_4:case fi.UNSIGNED_SHORT_5_5_5_1:case fi.UNSIGNED_SHORT_5_6_5:case fi.HALF_FLOAT:return 2;case fi.UNSIGNED_INT:case fi.FLOAT:case fi.UNSIGNED_INT_24_8:return 4}};fi.validate=function(e){return e===fi.UNSIGNED_BYTE||e===fi.UNSIGNED_SHORT||e===fi.UNSIGNED_INT||e===fi.FLOAT||e===fi.HALF_FLOAT||e===fi.UNSIGNED_INT_24_8||e===fi.UNSIGNED_SHORT_4_4_4_4||e===fi.UNSIGNED_SHORT_5_5_5_1||e===fi.UNSIGNED_SHORT_5_6_5};fi.getTypedArrayConstructor=function(e){let t=fi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===fi.FLOAT?Float32Array:Uint32Array};var Ke=Object.freeze(fi);var rt={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};rt.componentsLength=function(e){switch(e){case rt.RGB:return 3;case rt.RGBA:return 4;case rt.LUMINANCE_ALPHA:case rt.RG:return 2;case rt.ALPHA:case rt.RED:case rt.LUMINANCE:return 1;default:return 1}};rt.validate=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL||e===rt.ALPHA||e===rt.RED||e===rt.RG||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA||e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isColorFormat=function(e){return e===rt.RED||e===rt.ALPHA||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA};rt.isDepthFormat=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL};rt.isCompressedFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isDXTFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5};rt.isPVRTCFormat=function(e){return e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1};rt.isASTCFormat=function(e){return e===rt.RGBA_ASTC};rt.isETC1Format=function(e){return e===rt.RGB_ETC1};rt.isETC2Format=function(e){return e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC};rt.isBC7Format=function(e){return e===rt.RGBA_BC7};rt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case rt.RGB_DXT1:case rt.RGBA_DXT1:case rt.RGB_ETC1:case rt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case rt.RGBA_DXT3:case rt.RGBA_DXT5:case rt.RGBA_ASTC:case rt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case rt.RGB_PVRTC_4BPPV1:case rt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case rt.RGB_PVRTC_2BPPV1:case rt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case rt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};rt.textureSizeInBytes=function(e,t,n,i){let o=rt.componentsLength(e);return Ke.isPacked(t)&&(o=1),o*Ke.sizeInBytes(t)*n*i};rt.alignmentInBytes=function(e,t,n){let i=rt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};rt.createTypedArray=function(e,t,n,i){let o=Ke.getTypedArrayConstructor(t),r=rt.componentsLength(e)*n*i;return new o(r)};rt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=rt.createTypedArray(t,n,i,o),s=rt.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let u=c*i*s,f=(o-c-1)*i*s;for(let d=0;d<a;++d)r[f+d]=e[u+d]}return r};rt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===rt.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===rt.DEPTH_COMPONENT){if(t===Ke.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===Ke.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===Ke.FLOAT)switch(e){case rt.RGBA:return te.RGBA32F;case rt.RGB:return te.RGB32F;case rt.RG:return te.RG32F;case rt.RED:return te.R32F}if(t===Ke.HALF_FLOAT)switch(e){case rt.RGBA:return te.RGBA16F;case rt.RGB:return te.RGB16F;case rt.RG:return te.RG16F;case rt.RED:return te.R16F}return e};var et=Object.freeze(rt);var Tr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Tr,{maximumCombinedTextureImageUnits:{get:function(){return Tr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Tr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Tr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Tr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Tr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Tr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Tr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Tr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Tr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Tr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Tr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Tr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Tr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Tr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Tr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Tr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Tr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Tr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Tr._maximumColorAttachments}},maximumSamples:{get:function(){return Tr._maximumSamples}},highpFloatSupported:{get:function(){return Tr._highpFloatSupported}},highpIntSupported:{get:function(){return Tr._highpIntSupported}}});var Nt=Tr;function o6(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function HV(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Rd(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Nt.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0),this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;o6(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;HV(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;o6(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;HV(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;HV(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;o6(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;HV(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(Rd.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});Rd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Rd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Rd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Rd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Rd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Rd.prototype.getColorTexture=function(e){return this._colorTextures[e]};Rd.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Rd.prototype.isDestroyed=function(){return!1};Rd.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var Nr=Rd;var GV={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};GV.validate=function(e){return e===GV.CLOCKWISE||e===GV.COUNTER_CLOCKWISE};var hs=Object.freeze(GV);function ree(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=ree(e[t]));return Object.freeze(e)}var r6=ree;function sm(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),o=y(t.scissorTest,y.EMPTY_OBJECT),r=y(o.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),u=y(t.blending,y.EMPTY_OBJECT),f=y(u.color,y.EMPTY_OBJECT),d=y(t.stencilTest,y.EMPTY_OBJECT),p=y(d.frontOperation,y.EMPTY_OBJECT),g=y(d.backOperation,y.EMPTY_OBJECT),m=y(t.sampleCoverage,y.EMPTY_OBJECT),x=t.viewport;this.frontFace=y(t.frontFace,hs.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,te.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(o.enabled,!1),rectangle:je.clone(r)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,te.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(u.enabled,!1),color:new H(y(f.red,0),y(f.green,0),y(f.blue,0),y(f.alpha,0)),equationRgb:y(u.equationRgb,te.FUNC_ADD),equationAlpha:y(u.equationAlpha,te.FUNC_ADD),functionSourceRgb:y(u.functionSourceRgb,te.ONE),functionSourceAlpha:y(u.functionSourceAlpha,te.ONE),functionDestinationRgb:y(u.functionDestinationRgb,te.ZERO),functionDestinationAlpha:y(u.functionDestinationAlpha,te.ZERO)},this.stencilTest={enabled:y(d.enabled,!1),frontFunction:y(d.frontFunction,te.ALWAYS),backFunction:y(d.backFunction,te.ALWAYS),reference:y(d.reference,0),mask:y(d.mask,-1),frontOperation:{fail:y(p.fail,te.KEEP),zFail:y(p.zFail,te.KEEP),zPass:y(p.zPass,te.KEEP)},backOperation:{fail:y(g.fail,te.KEEP),zFail:y(g.zFail,te.KEEP),zPass:y(g.zPass,te.KEEP)}},this.sampleCoverage={enabled:y(m.enabled,!1),value:y(m.value,1),invert:y(m.invert,!1)},this.viewport=l(x)?new je(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var Bwe=0,rm={};sm.fromCache=function(e){let t=JSON.stringify(e),n=rm[t];if(l(n))return++n.referenceCount,n.state;let i=new sm(e),o=JSON.stringify(i);return n=rm[o],l(n)||(i.id=Bwe++,n={referenceCount:0,state:i},rm[o]=n),++n.referenceCount,rm[t]={referenceCount:1,state:n.state},n.state};sm.removeFromCache=function(e){let t=new sm(e),n=JSON.stringify(t),i=rm[n],o=JSON.stringify(e),r=rm[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete rm[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete rm[n]};sm.getCache=function(){return rm};sm.clearCache=function(){rm={}};function mx(e,t,n){n?e.enable(t):e.disable(t)}function see(e,t){e.frontFace(t.frontFace)}function aee(e,t){let n=t.cull,i=n.enabled;mx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function cee(e,t){e.lineWidth(t.lineWidth)}function lee(e,t){let n=t.polygonOffset,i=n.enabled;mx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function uee(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(mx(e,e.SCISSOR_TEST,o),o){let r=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function fee(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function dee(e,t){let n=t.depthTest,i=n.enabled;mx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function hee(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function mee(e,t){e.depthMask(t.depthMask)}function pee(e,t){e.stencilMask(t.stencilMask)}function kwe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function _ee(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;mx(e,e.BLEND,o),o&&(kwe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function gee(e,t){let n=t.stencilTest,i=n.enabled;if(mx(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,g,m,x)}}function yee(e,t){let n=t.sampleCoverage,i=n.enabled;mx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var Vwe=new je;function xee(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=Vwe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}sm.apply=function(e,t,n){see(e,t),aee(e,t),cee(e,t),lee(e,t),fee(e,t),dee(e,t),hee(e,t),mee(e,t),pee(e,t),gee(e,t),yee(e,t),uee(e,t,n),_ee(e,t,n),xee(e,t,n)};function Uwe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(see),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(aee),e.lineWidth!==t.lineWidth&&n.push(cee),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(lee),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(fee),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(dee),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(hee),e.depthMask!==t.depthMask&&n.push(mee),e.stencilMask!==t.stencilMask&&n.push(pee),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(gee),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(yee),n}sm.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=Uwe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&uee(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&_ee(e,n,o),(t!==n||i!==o||i.context!==o.context)&&xee(e,n,o)};sm.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:je.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:H.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?je.clone(e.viewport):void 0}};var Ve=sm;function Xt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Xt.packedLength=4;Xt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Xt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Xt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Xt.pack(e[o],t,o*4);return t};Xt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Xt.unpack(e,i,t[o])}return t};Xt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Xt(e[0],e[2],e[1],e[3])};Xt.fromArray=Xt.unpack;Xt.fromColumnMajorArray=function(e,t){return Xt.clone(e,t)};Xt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Xt(e[0],e[1],e[2],e[3])};Xt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Xt(e.x,0,0,e.y)};Xt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Xt(e,0,0,e)};Xt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Xt(n,-i,i,n)};Xt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Xt.getElementIndex=function(e,t){return e*2+t};Xt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Xt.setColumn=function(e,t,n,i){i=Xt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Xt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Xt.setRow=function(e,t,n,i){return i=Xt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var zwe=new z;Xt.setScale=function(e,t,n){let i=Xt.getScale(e,zwe),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var Hwe=new z;Xt.setUniformScale=function(e,t,n){let i=Xt.getScale(e,Hwe),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var bee=new z;Xt.getScale=function(e,t){return t.x=z.magnitude(z.fromElements(e[0],e[1],bee)),t.y=z.magnitude(z.fromElements(e[2],e[3],bee)),t};var Tee=new z;Xt.getMaximumScale=function(e){return Xt.getScale(e,Tee),z.maximumComponent(Tee)};var Gwe=new z;Xt.setRotation=function(e,t,n){let i=Xt.getScale(e,Gwe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var Wwe=new z;Xt.getRotation=function(e,t){let n=Xt.getScale(e,Wwe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Xt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};Xt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Xt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Xt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};Xt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Xt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Xt.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};Xt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Xt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Xt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Xt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Xt.IDENTITY=Object.freeze(new Xt(1,0,0,1));Xt.ZERO=Object.freeze(new Xt(0,0,0,0));Xt.COLUMN0ROW0=0;Xt.COLUMN0ROW1=1;Xt.COLUMN1ROW0=2;Xt.COLUMN1ROW1=3;Object.defineProperties(Xt.prototype,{length:{get:function(){return Xt.packedLength}}});Xt.prototype.clone=function(e){return Xt.clone(this,e)};Xt.prototype.equals=function(e){return Xt.equals(this,e)};Xt.prototype.equalsEpsilon=function(e,t){return Xt.equalsEpsilon(this,e,t)};Xt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var Ii=Xt;function jwe(e,t,n,i){switch(t.type){case e.FLOAT:return new Cee(e,t,n,i);case e.FLOAT_VEC2:return new Aee(e,t,n,i);case e.FLOAT_VEC3:return new Eee(e,t,n,i);case e.FLOAT_VEC4:return new See(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new s6(e,t,n,i);case e.INT:case e.BOOL:return new vee(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new wee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Dee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Iee(e,t,n,i);case e.FLOAT_MAT2:return new Pee(e,t,n,i);case e.FLOAT_MAT3:return new Ree(e,t,n,i);case e.FLOAT_MAT4:return new Oee(e,t,n,i);default:throw new re(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Cee(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Cee.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Aee(e,t,n,i){this.name=n,this.value=void 0,this._value=new z,this._gl=e,this._location=i}Aee.prototype.set=function(){let e=this.value;z.equals(e,this._value)||(z.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function Eee(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Eee.prototype.set=function(){let e=this.value;l(e.red)?H.equals(e,this._value)||(this._value=H.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(h.equals(e,this._value)||(this._value=h.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function See(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}See.prototype.set=function(){let e=this.value;l(e.red)?H.equals(e,this._value)||(this._value=H.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(oe.equals(e,this._value)||(this._value=oe.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function s6(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}s6.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};s6.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function vee(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}vee.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function wee(e,t,n,i){this.name=n,this.value=void 0,this._value=new z,this._gl=e,this._location=i}wee.prototype.set=function(){let e=this.value;z.equals(e,this._value)||(z.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Dee(e,t,n,i){this.name=n,this.value=void 0,this._value=new h,this._gl=e,this._location=i}Dee.prototype.set=function(){let e=this.value;h.equals(e,this._value)||(h.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Iee(e,t,n,i){this.name=n,this.value=void 0,this._value=new oe,this._gl=e,this._location=i}Iee.prototype.set=function(){let e=this.value;oe.equals(e,this._value)||(oe.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var qwe=new Float32Array(4);function Pee(e,t,n,i){this.name=n,this.value=void 0,this._value=new Ii,this._gl=e,this._location=i}Pee.prototype.set=function(){if(!Ii.equalsArray(this.value,this._value,0)){Ii.clone(this.value,this._value);let e=Ii.toArray(this.value,qwe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var Ywe=new Float32Array(9);function Ree(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}Ree.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,Ywe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var Xwe=new Float32Array(16);function Oee(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}Oee.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,Xwe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var pw=jwe;function Kwe(e,t,n,i){switch(t.type){case e.FLOAT:return new Mee(e,t,n,i);case e.FLOAT_VEC2:return new Lee(e,t,n,i);case e.FLOAT_VEC3:return new Nee(e,t,n,i);case e.FLOAT_VEC4:return new Fee(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new a6(e,t,n,i);case e.INT:case e.BOOL:return new Bee(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new kee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Vee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Uee(e,t,n,i);case e.FLOAT_MAT2:return new zee(e,t,n,i);case e.FLOAT_MAT3:return new Hee(e,t,n,i);case e.FLOAT_MAT4:return new Gee(e,t,n,i);default:throw new re(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Mee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}Mee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function Lee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}Lee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function Nee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}Nee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):l(s.x)&&(h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function Fee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}Fee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?H.equalsArray(s,n,o)||(H.pack(s,n,o),i=!0):l(s.x)&&(oe.equalsArray(s,n,o)||(oe.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function a6(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}a6.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};a6.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function Bee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}Bee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function kee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}kee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function Vee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}Vee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function Uee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}Uee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];oe.equalsArray(s,n,o)||(oe.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function zee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}zee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];Ii.equalsArray(s,n,o)||(Ii.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function Hee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}Hee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];$.equalsArray(s,n,o)||($.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function Gee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}Gee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];F.equalsArray(s,n,o)||(F.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var _w=Kwe;var Zwe=0;function Dp(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=$we(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=Zwe++}Dp.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};Dp.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Dp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return WV(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return WV(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return WV(this),this._uniformsByName}}});function Wee(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function $we(e,t){let n={};if(!Nt.highpFloatSupported||!Nt.highpIntSupported){let i,o,r,s,a=Wee(e),c=Wee(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let d=new RegExp(`${r}\\b`,"g");t=t.replace(d,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var am="[Cesium WebGL] ";function Qwe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${am}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${am}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${am}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${am}Shader program link log: ${c}`),d(o,"vertex"),d(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${am}Vertex shader compile log: ${c}`),console.error(`${am} Vertex shader source: -${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${am}Fragment shader compile log: ${c}`),console.error(`${am} Fragment shader source: -${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new re(u);function d(p,g){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${am}${g} shader translation failed.`);return}console.error(`${am}Translated ${g} shaderSource: -${m}`)}}function Jwe(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function eDe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=pw(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&o.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let x=0;x<a.size;++x)g=e.getUniformLocation(t,`${u}[${x}]`),g!==null&&d.push(g);f=_w(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function tDe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];l(a)&&(r.name=a,s=a);let c=Tp[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function nDe(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function WV(e){l(e._program)||jee(e)}function jee(e){let t=e._program,n=e._gl,i=Qwe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=eDe(n,i),s=tDe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=Jwe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=nDe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{jee(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let b=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(b?b[1]:m.message)}})}Dp.prototype._bind=function(){WV(this),this._gl.useProgram(this._program)};Dp.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};Dp.prototype.isDestroyed=function(){return!1};Dp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Dp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Qt=Dp;function jV(e){this._context=e}var gw,iDe=new Ze({primitiveType:Me.TRIANGLES}),oDe=new Jn({color:new H(0,0,0,0)});function rDe(e,t){return new Nr({context:e,colorTextures:[t],destroyAttachments:!1})}function sDe(e,t){return Qt.fromCache({context:e,vertexShaderSource:hx,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function aDe(e,t){return(!l(gw)||gw.viewport.width!==e||gw.viewport.height!==t)&&(gw=Ve.fromCache({viewport:new je(0,0,e,t)})),gw}jV.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:sDe(o,e.fragmentShaderSource),a=rDe(o,t),c=aDe(n,i),u=e.uniformMap,f=oDe;f.framebuffer=a,f.renderState=c,f.execute(o);let d=iDe;d.vertexArray=r,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};jV.prototype.isDestroyed=function(){return!1};jV.prototype.destroy=function(){return ue(this)};var yw=jV;var Sn={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};Sn.getSizeInBytes=function(e){switch(e){case Sn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Sn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Sn.INT:return Int32Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Sn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Sn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Sn.fromTypedArray=function(e){if(e instanceof Int8Array)return Sn.BYTE;if(e instanceof Uint8Array)return Sn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Sn.SHORT;if(e instanceof Uint16Array)return Sn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Sn.INT;if(e instanceof Uint32Array)return Sn.UNSIGNED_INT;if(e instanceof Float32Array)return Sn.FLOAT;if(e instanceof Float64Array)return Sn.DOUBLE};Sn.validate=function(e){return l(e)&&(e===Sn.BYTE||e===Sn.UNSIGNED_BYTE||e===Sn.SHORT||e===Sn.UNSIGNED_SHORT||e===Sn.INT||e===Sn.UNSIGNED_INT||e===Sn.FLOAT||e===Sn.DOUBLE)};Sn.createTypedArray=function(e,t){switch(e){case Sn.BYTE:return new Int8Array(t);case Sn.UNSIGNED_BYTE:return new Uint8Array(t);case Sn.SHORT:return new Int16Array(t);case Sn.UNSIGNED_SHORT:return new Uint16Array(t);case Sn.INT:return new Int32Array(t);case Sn.UNSIGNED_INT:return new Uint32Array(t);case Sn.FLOAT:return new Float32Array(t);case Sn.DOUBLE:return new Float64Array(t)}};Sn.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/Sn.getSizeInBytes(e)),e){case Sn.BYTE:return new Int8Array(t,n,i);case Sn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Sn.SHORT:return new Int16Array(t,n,i);case Sn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Sn.INT:return new Int32Array(t,n,i);case Sn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Sn.FLOAT:return new Float32Array(t,n,i);case Sn.DOUBLE:return new Float64Array(t,n,i)}};Sn.fromName=function(e){switch(e){case"BYTE":return Sn.BYTE;case"UNSIGNED_BYTE":return Sn.UNSIGNED_BYTE;case"SHORT":return Sn.SHORT;case"UNSIGNED_SHORT":return Sn.UNSIGNED_SHORT;case"INT":return Sn.INT;case"UNSIGNED_INT":return Sn.UNSIGNED_INT;case"FLOAT":return Sn.FLOAT;case"DOUBLE":return Sn.DOUBLE}};var X=Object.freeze(Sn);var qee={};function xw(e,t){l(qee[e])||(qee[e]=!0,console.warn(y(t,e)))}xw.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";xw.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";xw.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";xw.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var yt=xw;function cDe(e,t){yt(e,t)}var ms=cDe;var lDe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},Tf=Object.freeze(lDe);function c6(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Me.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,Tf.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}c6.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var uDe=new fe,fDe=new h,Yee=new F,dDe=[new fe,new fe,new fe],hDe=[new z,new z,new z],mDe=[new z,new z,new z],pDe=new h,_De=new Oe,gDe=new F,yDe=new Ii;c6._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=se.center(i,uDe),s=fe.toCartesian(r,n,fDe),a=Mt.eastNorthUpToFixedFrame(s,n,Yee),c=F.inverse(a,Yee),u=hDe,f=dDe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=pDe;for(o=0;o<3;o++)fe.toCartesian(f[o],n,d),d=F.multiplyByPointAsVector(c,d,d),u[o].x=d.x,u[o].y=d.y;let p=Oe.fromAxisAngle(h.UNIT_Z,-t,_De),g=$.fromQuaternion(p,gDe),m=e.length,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)d=F.multiplyByPointAsVector(c,e[o],d),d=$.multiplyByVector(g,d,d),x=Math.min(x,d.x),b=Math.min(b,d.y),T=Math.max(T,d.x),C=Math.max(C,d.y);let A=Ii.fromRotation(t,yDe),E=mDe;E[0].x=x,E[0].y=b,E[1].x=x,E[1].y=C,E[2].x=T,E[2].y=b;let v=u[0],D=u[2].x-v.x,O=u[1].y-v.y;for(o=0;o<3;o++){let S=E[o];Ii.multiplyByVector(A,S,S),S.x=(S.x-v.x)/D,S.y=(S.y-v.y)/O}let R=E[0],M=E[1],N=E[2],_=new Array(6);return z.pack(R,_),z.pack(M,_,2),z.pack(N,_,4),_};var at=c6;function xDe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var ve=xDe;function $C(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties($C.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});$C.clone=function(e){if(l(e))return new $C(e._format,e._datatype,e._width,e._height,e._buffer)};$C.prototype.clone=function(){return $C.clone(this)};var bw=$C;var Xee=Ko(uu(),1);function Kee(){if(!l(aa._canTransferArrayBuffer)){let e=f6("transferTypedArrayTest");e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return aa._canTransferArrayBuffer=!1,aa._canTransferArrayBuffer}aa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),aa._canTransferArrayBuffer=s}})}return aa._canTransferArrayBuffer}var u6=new me;function l6(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function f6(e){let t=new Xee.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Fg(e))s=e;else if(!n){let a=nn(`${aa._workerModulePrefix}/${i}.js`);Fg(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=l6(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${l6(CESIUM_WORKERS)}"); +`;var br={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function mw(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Me.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function rc(e,t){return(e._flags&t)===t}function Vg(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(mw.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return rc(this,br.CULL)},set:function(e){rc(this,br.CULL)!==e&&(Vg(this,br.CULL,e),this.dirty=!0)}},occlude:{get:function(){return rc(this,br.OCCLUDE)},set:function(e){rc(this,br.OCCLUDE)!==e&&(Vg(this,br.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return rc(this,br.CAST_SHADOWS)},set:function(e){rc(this,br.CAST_SHADOWS)!==e&&(Vg(this,br.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return rc(this,br.RECEIVE_SHADOWS)},set:function(e){rc(this,br.RECEIVE_SHADOWS)!==e&&(Vg(this,br.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return rc(this,br.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){rc(this,br.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Vg(this,br.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return rc(this,br.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){rc(this,br.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Vg(this,br.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return rc(this,br.PICK_ONLY)},set:function(e){rc(this,br.PICK_ONLY)!==e&&(Vg(this,br.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return rc(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){rc(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Vg(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});mw.shallowClone=function(e,t){if(l(e))return l(t)||(t=new mw),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};mw.prototype.execute=function(e,t){e.draw(this,t)};var Ze=mw;var fi={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};fi.toWebGLConstant=function(e,t){switch(e){case fi.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case fi.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case fi.UNSIGNED_INT:return te.UNSIGNED_INT;case fi.FLOAT:return te.FLOAT;case fi.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case fi.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case fi.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case fi.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case fi.UNSIGNED_SHORT_5_6_5:return fi.UNSIGNED_SHORT_5_6_5}};fi.isPacked=function(e){return e===fi.UNSIGNED_INT_24_8||e===fi.UNSIGNED_SHORT_4_4_4_4||e===fi.UNSIGNED_SHORT_5_5_5_1||e===fi.UNSIGNED_SHORT_5_6_5};fi.sizeInBytes=function(e){switch(e){case fi.UNSIGNED_BYTE:return 1;case fi.UNSIGNED_SHORT:case fi.UNSIGNED_SHORT_4_4_4_4:case fi.UNSIGNED_SHORT_5_5_5_1:case fi.UNSIGNED_SHORT_5_6_5:case fi.HALF_FLOAT:return 2;case fi.UNSIGNED_INT:case fi.FLOAT:case fi.UNSIGNED_INT_24_8:return 4}};fi.validate=function(e){return e===fi.UNSIGNED_BYTE||e===fi.UNSIGNED_SHORT||e===fi.UNSIGNED_INT||e===fi.FLOAT||e===fi.HALF_FLOAT||e===fi.UNSIGNED_INT_24_8||e===fi.UNSIGNED_SHORT_4_4_4_4||e===fi.UNSIGNED_SHORT_5_5_5_1||e===fi.UNSIGNED_SHORT_5_6_5};fi.getTypedArrayConstructor=function(e){let t=fi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===fi.FLOAT?Float32Array:Uint32Array};var Ke=Object.freeze(fi);var ot={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};ot.componentsLength=function(e){switch(e){case ot.RGB:return 3;case ot.RGBA:return 4;case ot.LUMINANCE_ALPHA:case ot.RG:return 2;case ot.ALPHA:case ot.RED:case ot.LUMINANCE:return 1;default:return 1}};ot.validate=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL||e===ot.ALPHA||e===ot.RED||e===ot.RG||e===ot.RGB||e===ot.RGBA||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA||e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isColorFormat=function(e){return e===ot.RED||e===ot.ALPHA||e===ot.RGB||e===ot.RGBA||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA};ot.isDepthFormat=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL};ot.isCompressedFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isDXTFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5};ot.isPVRTCFormat=function(e){return e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1};ot.isASTCFormat=function(e){return e===ot.RGBA_ASTC};ot.isETC1Format=function(e){return e===ot.RGB_ETC1};ot.isETC2Format=function(e){return e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC};ot.isBC7Format=function(e){return e===ot.RGBA_BC7};ot.compressedTextureSizeInBytes=function(e,t,n){switch(e){case ot.RGB_DXT1:case ot.RGBA_DXT1:case ot.RGB_ETC1:case ot.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case ot.RGBA_DXT3:case ot.RGBA_DXT5:case ot.RGBA_ASTC:case ot.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case ot.RGB_PVRTC_4BPPV1:case ot.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case ot.RGB_PVRTC_2BPPV1:case ot.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case ot.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};ot.textureSizeInBytes=function(e,t,n,i){let o=ot.componentsLength(e);return Ke.isPacked(t)&&(o=1),o*Ke.sizeInBytes(t)*n*i};ot.alignmentInBytes=function(e,t,n){let i=ot.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};ot.createTypedArray=function(e,t,n,i){let o=Ke.getTypedArrayConstructor(t),r=ot.componentsLength(e)*n*i;return new o(r)};ot.flipY=function(e,t,n,i,o){if(o===1)return e;let r=ot.createTypedArray(t,n,i,o),s=ot.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let u=c*i*s,f=(o-c-1)*i*s;for(let d=0;d<a;++d)r[f+d]=e[u+d]}return r};ot.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===ot.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===ot.DEPTH_COMPONENT){if(t===Ke.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===Ke.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===Ke.FLOAT)switch(e){case ot.RGBA:return te.RGBA32F;case ot.RGB:return te.RGB32F;case ot.RG:return te.RG32F;case ot.RED:return te.R32F}if(t===Ke.HALF_FLOAT)switch(e){case ot.RGBA:return te.RGBA16F;case ot.RGB:return te.RGB16F;case ot.RG:return te.RG16F;case ot.RED:return te.R16F}return e};var et=Object.freeze(ot);var Tr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Tr,{maximumCombinedTextureImageUnits:{get:function(){return Tr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Tr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Tr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Tr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Tr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Tr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Tr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Tr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Tr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Tr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Tr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Tr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Tr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Tr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Tr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Tr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Tr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Tr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Tr._maximumColorAttachments}},maximumSamples:{get:function(){return Tr._maximumSamples}},highpFloatSupported:{get:function(){return Tr._highpFloatSupported}},highpIntSupported:{get:function(){return Tr._highpIntSupported}}});var Lt=Tr;function n6(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function HV(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Pd(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Lt.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0),this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;n6(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;HV(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;n6(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;HV(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;HV(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;n6(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;HV(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(Pd.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});Pd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Pd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Pd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Pd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Pd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Pd.prototype.getColorTexture=function(e){return this._colorTextures[e]};Pd.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Pd.prototype.isDestroyed=function(){return!1};Pd.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var Nr=Pd;var GV={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};GV.validate=function(e){return e===GV.CLOCKWISE||e===GV.COUNTER_CLOCKWISE};var hs=Object.freeze(GV);function ree(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=ree(e[t]));return Object.freeze(e)}var i6=ree;function rm(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),o=y(t.scissorTest,y.EMPTY_OBJECT),r=y(o.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),u=y(t.blending,y.EMPTY_OBJECT),f=y(u.color,y.EMPTY_OBJECT),d=y(t.stencilTest,y.EMPTY_OBJECT),p=y(d.frontOperation,y.EMPTY_OBJECT),g=y(d.backOperation,y.EMPTY_OBJECT),m=y(t.sampleCoverage,y.EMPTY_OBJECT),x=t.viewport;this.frontFace=y(t.frontFace,hs.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,te.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(o.enabled,!1),rectangle:je.clone(r)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,te.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(u.enabled,!1),color:new H(y(f.red,0),y(f.green,0),y(f.blue,0),y(f.alpha,0)),equationRgb:y(u.equationRgb,te.FUNC_ADD),equationAlpha:y(u.equationAlpha,te.FUNC_ADD),functionSourceRgb:y(u.functionSourceRgb,te.ONE),functionSourceAlpha:y(u.functionSourceAlpha,te.ONE),functionDestinationRgb:y(u.functionDestinationRgb,te.ZERO),functionDestinationAlpha:y(u.functionDestinationAlpha,te.ZERO)},this.stencilTest={enabled:y(d.enabled,!1),frontFunction:y(d.frontFunction,te.ALWAYS),backFunction:y(d.backFunction,te.ALWAYS),reference:y(d.reference,0),mask:y(d.mask,-1),frontOperation:{fail:y(p.fail,te.KEEP),zFail:y(p.zFail,te.KEEP),zPass:y(p.zPass,te.KEEP)},backOperation:{fail:y(g.fail,te.KEEP),zFail:y(g.zFail,te.KEEP),zPass:y(g.zPass,te.KEEP)}},this.sampleCoverage={enabled:y(m.enabled,!1),value:y(m.value,1),invert:y(m.invert,!1)},this.viewport=l(x)?new je(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var Vwe=0,om={};rm.fromCache=function(e){let t=JSON.stringify(e),n=om[t];if(l(n))return++n.referenceCount,n.state;let i=new rm(e),o=JSON.stringify(i);return n=om[o],l(n)||(i.id=Vwe++,n={referenceCount:0,state:i},om[o]=n),++n.referenceCount,om[t]={referenceCount:1,state:n.state},n.state};rm.removeFromCache=function(e){let t=new rm(e),n=JSON.stringify(t),i=om[n],o=JSON.stringify(e),r=om[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete om[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete om[n]};rm.getCache=function(){return om};rm.clearCache=function(){om={}};function ux(e,t,n){n?e.enable(t):e.disable(t)}function see(e,t){e.frontFace(t.frontFace)}function aee(e,t){let n=t.cull,i=n.enabled;ux(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function cee(e,t){e.lineWidth(t.lineWidth)}function lee(e,t){let n=t.polygonOffset,i=n.enabled;ux(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function uee(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(ux(e,e.SCISSOR_TEST,o),o){let r=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function fee(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function dee(e,t){let n=t.depthTest,i=n.enabled;ux(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function hee(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function mee(e,t){e.depthMask(t.depthMask)}function pee(e,t){e.stencilMask(t.stencilMask)}function Uwe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function _ee(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;ux(e,e.BLEND,o),o&&(Uwe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function gee(e,t){let n=t.stencilTest,i=n.enabled;if(ux(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,g,m,x)}}function yee(e,t){let n=t.sampleCoverage,i=n.enabled;ux(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var zwe=new je;function xee(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=zwe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}rm.apply=function(e,t,n){see(e,t),aee(e,t),cee(e,t),lee(e,t),fee(e,t),dee(e,t),hee(e,t),mee(e,t),pee(e,t),gee(e,t),yee(e,t),uee(e,t,n),_ee(e,t,n),xee(e,t,n)};function Hwe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(see),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(aee),e.lineWidth!==t.lineWidth&&n.push(cee),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(lee),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(fee),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(dee),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(hee),e.depthMask!==t.depthMask&&n.push(mee),e.stencilMask!==t.stencilMask&&n.push(pee),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(gee),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(yee),n}rm.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=Hwe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&uee(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&_ee(e,n,o),(t!==n||i!==o||i.context!==o.context)&&xee(e,n,o)};rm.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:je.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:H.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?je.clone(e.viewport):void 0}};var Ve=rm;function Yt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Yt.packedLength=4;Yt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Yt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Yt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Yt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Yt.pack(e[o],t,o*4);return t};Yt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Yt.unpack(e,i,t[o])}return t};Yt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Yt(e[0],e[2],e[1],e[3])};Yt.fromArray=Yt.unpack;Yt.fromColumnMajorArray=function(e,t){return Yt.clone(e,t)};Yt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Yt(e[0],e[1],e[2],e[3])};Yt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Yt(e.x,0,0,e.y)};Yt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Yt(e,0,0,e)};Yt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Yt(n,-i,i,n)};Yt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Yt.getElementIndex=function(e,t){return e*2+t};Yt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Yt.setColumn=function(e,t,n,i){i=Yt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Yt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Yt.setRow=function(e,t,n,i){return i=Yt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var Gwe=new z;Yt.setScale=function(e,t,n){let i=Yt.getScale(e,Gwe),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var Wwe=new z;Yt.setUniformScale=function(e,t,n){let i=Yt.getScale(e,Wwe),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var bee=new z;Yt.getScale=function(e,t){return t.x=z.magnitude(z.fromElements(e[0],e[1],bee)),t.y=z.magnitude(z.fromElements(e[2],e[3],bee)),t};var Tee=new z;Yt.getMaximumScale=function(e){return Yt.getScale(e,Tee),z.maximumComponent(Tee)};var jwe=new z;Yt.setRotation=function(e,t,n){let i=Yt.getScale(e,jwe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var qwe=new z;Yt.getRotation=function(e,t){let n=Yt.getScale(e,qwe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Yt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};Yt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Yt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Yt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};Yt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Yt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Yt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Yt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Yt.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};Yt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Yt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Yt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Yt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Yt.IDENTITY=Object.freeze(new Yt(1,0,0,1));Yt.ZERO=Object.freeze(new Yt(0,0,0,0));Yt.COLUMN0ROW0=0;Yt.COLUMN0ROW1=1;Yt.COLUMN1ROW0=2;Yt.COLUMN1ROW1=3;Object.defineProperties(Yt.prototype,{length:{get:function(){return Yt.packedLength}}});Yt.prototype.clone=function(e){return Yt.clone(this,e)};Yt.prototype.equals=function(e){return Yt.equals(this,e)};Yt.prototype.equalsEpsilon=function(e,t){return Yt.equalsEpsilon(this,e,t)};Yt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) +(${this[1]}, ${this[3]})`};var Ri=Yt;function Ywe(e,t,n,i){switch(t.type){case e.FLOAT:return new Cee(e,t,n,i);case e.FLOAT_VEC2:return new Aee(e,t,n,i);case e.FLOAT_VEC3:return new Eee(e,t,n,i);case e.FLOAT_VEC4:return new See(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new o6(e,t,n,i);case e.INT:case e.BOOL:return new vee(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new wee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Dee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Iee(e,t,n,i);case e.FLOAT_MAT2:return new Pee(e,t,n,i);case e.FLOAT_MAT3:return new Ree(e,t,n,i);case e.FLOAT_MAT4:return new Oee(e,t,n,i);default:throw new re(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Cee(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Cee.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Aee(e,t,n,i){this.name=n,this.value=void 0,this._value=new z,this._gl=e,this._location=i}Aee.prototype.set=function(){let e=this.value;z.equals(e,this._value)||(z.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function Eee(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Eee.prototype.set=function(){let e=this.value;l(e.red)?H.equals(e,this._value)||(this._value=H.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(h.equals(e,this._value)||(this._value=h.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function See(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}See.prototype.set=function(){let e=this.value;l(e.red)?H.equals(e,this._value)||(this._value=H.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(oe.equals(e,this._value)||(this._value=oe.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function o6(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}o6.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};o6.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function vee(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}vee.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function wee(e,t,n,i){this.name=n,this.value=void 0,this._value=new z,this._gl=e,this._location=i}wee.prototype.set=function(){let e=this.value;z.equals(e,this._value)||(z.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Dee(e,t,n,i){this.name=n,this.value=void 0,this._value=new h,this._gl=e,this._location=i}Dee.prototype.set=function(){let e=this.value;h.equals(e,this._value)||(h.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Iee(e,t,n,i){this.name=n,this.value=void 0,this._value=new oe,this._gl=e,this._location=i}Iee.prototype.set=function(){let e=this.value;oe.equals(e,this._value)||(oe.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var Xwe=new Float32Array(4);function Pee(e,t,n,i){this.name=n,this.value=void 0,this._value=new Ri,this._gl=e,this._location=i}Pee.prototype.set=function(){if(!Ri.equalsArray(this.value,this._value,0)){Ri.clone(this.value,this._value);let e=Ri.toArray(this.value,Xwe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var Kwe=new Float32Array(9);function Ree(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}Ree.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,Kwe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var Zwe=new Float32Array(16);function Oee(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}Oee.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,Zwe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var pw=Ywe;function $we(e,t,n,i){switch(t.type){case e.FLOAT:return new Mee(e,t,n,i);case e.FLOAT_VEC2:return new Lee(e,t,n,i);case e.FLOAT_VEC3:return new Nee(e,t,n,i);case e.FLOAT_VEC4:return new Fee(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new r6(e,t,n,i);case e.INT:case e.BOOL:return new Bee(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new kee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Vee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Uee(e,t,n,i);case e.FLOAT_MAT2:return new zee(e,t,n,i);case e.FLOAT_MAT3:return new Hee(e,t,n,i);case e.FLOAT_MAT4:return new Gee(e,t,n,i);default:throw new re(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Mee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}Mee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function Lee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}Lee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function Nee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}Nee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):l(s.x)&&(h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function Fee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}Fee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?H.equalsArray(s,n,o)||(H.pack(s,n,o),i=!0):l(s.x)&&(oe.equalsArray(s,n,o)||(oe.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function r6(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}r6.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};r6.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function Bee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}Bee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function kee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}kee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function Vee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}Vee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function Uee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}Uee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];oe.equalsArray(s,n,o)||(oe.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function zee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}zee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];Ri.equalsArray(s,n,o)||(Ri.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function Hee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}Hee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];$.equalsArray(s,n,o)||($.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function Gee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}Gee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];F.equalsArray(s,n,o)||(F.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var _w=$we;var Qwe=0;function vp(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=Jwe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=Qwe++}vp.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};vp.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(vp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return WV(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return WV(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return WV(this),this._uniformsByName}}});function Wee(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function Jwe(e,t){let n={};if(!Lt.highpFloatSupported||!Lt.highpIntSupported){let i,o,r,s,a=Wee(e),c=Wee(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let d=new RegExp(`${r}\\b`,"g");t=t.replace(d,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var sm="[Cesium WebGL] ";function eDe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${sm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${sm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${sm}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${sm}Shader program link log: ${c}`),d(o,"vertex"),d(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${sm}Vertex shader compile log: ${c}`),console.error(`${sm} Vertex shader source: +${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${sm}Fragment shader compile log: ${c}`),console.error(`${sm} Fragment shader source: +${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new re(u);function d(p,g){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${sm}${g} shader translation failed.`);return}console.error(`${sm}Translated ${g} shaderSource: +${m}`)}}function tDe(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function nDe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=pw(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&o.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let x=0;x<a.size;++x)g=e.getUniformLocation(t,`${u}[${x}]`),g!==null&&d.push(g);f=_w(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function iDe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];l(a)&&(r.name=a,s=a);let c=xp[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function oDe(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function WV(e){l(e._program)||jee(e)}function jee(e){let t=e._program,n=e._gl,i=eDe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=nDe(n,i),s=iDe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=tDe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=oDe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{jee(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let b=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(b?b[1]:m.message)}})}vp.prototype._bind=function(){WV(this),this._gl.useProgram(this._program)};vp.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};vp.prototype.isDestroyed=function(){return!1};vp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};vp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var $t=vp;function jV(e){this._context=e}var gw,rDe=new Ze({primitiveType:Me.TRIANGLES}),sDe=new ei({color:new H(0,0,0,0)});function aDe(e,t){return new Nr({context:e,colorTextures:[t],destroyAttachments:!1})}function cDe(e,t){return $t.fromCache({context:e,vertexShaderSource:lx,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function lDe(e,t){return(!l(gw)||gw.viewport.width!==e||gw.viewport.height!==t)&&(gw=Ve.fromCache({viewport:new je(0,0,e,t)})),gw}jV.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:cDe(o,e.fragmentShaderSource),a=aDe(o,t),c=lDe(n,i),u=e.uniformMap,f=sDe;f.framebuffer=a,f.renderState=c,f.execute(o);let d=rDe;d.vertexArray=r,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};jV.prototype.isDestroyed=function(){return!1};jV.prototype.destroy=function(){return ue(this)};var yw=jV;var Sn={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};Sn.getSizeInBytes=function(e){switch(e){case Sn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Sn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Sn.INT:return Int32Array.BYTES_PER_ELEMENT;case Sn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Sn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Sn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Sn.fromTypedArray=function(e){if(e instanceof Int8Array)return Sn.BYTE;if(e instanceof Uint8Array)return Sn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Sn.SHORT;if(e instanceof Uint16Array)return Sn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Sn.INT;if(e instanceof Uint32Array)return Sn.UNSIGNED_INT;if(e instanceof Float32Array)return Sn.FLOAT;if(e instanceof Float64Array)return Sn.DOUBLE};Sn.validate=function(e){return l(e)&&(e===Sn.BYTE||e===Sn.UNSIGNED_BYTE||e===Sn.SHORT||e===Sn.UNSIGNED_SHORT||e===Sn.INT||e===Sn.UNSIGNED_INT||e===Sn.FLOAT||e===Sn.DOUBLE)};Sn.createTypedArray=function(e,t){switch(e){case Sn.BYTE:return new Int8Array(t);case Sn.UNSIGNED_BYTE:return new Uint8Array(t);case Sn.SHORT:return new Int16Array(t);case Sn.UNSIGNED_SHORT:return new Uint16Array(t);case Sn.INT:return new Int32Array(t);case Sn.UNSIGNED_INT:return new Uint32Array(t);case Sn.FLOAT:return new Float32Array(t);case Sn.DOUBLE:return new Float64Array(t)}};Sn.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/Sn.getSizeInBytes(e)),e){case Sn.BYTE:return new Int8Array(t,n,i);case Sn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Sn.SHORT:return new Int16Array(t,n,i);case Sn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Sn.INT:return new Int32Array(t,n,i);case Sn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Sn.FLOAT:return new Float32Array(t,n,i);case Sn.DOUBLE:return new Float64Array(t,n,i)}};Sn.fromName=function(e){switch(e){case"BYTE":return Sn.BYTE;case"UNSIGNED_BYTE":return Sn.UNSIGNED_BYTE;case"SHORT":return Sn.SHORT;case"UNSIGNED_SHORT":return Sn.UNSIGNED_SHORT;case"INT":return Sn.INT;case"UNSIGNED_INT":return Sn.UNSIGNED_INT;case"FLOAT":return Sn.FLOAT;case"DOUBLE":return Sn.DOUBLE}};var X=Object.freeze(Sn);var qee={};function xw(e,t){l(qee[e])||(qee[e]=!0,console.warn(y(t,e)))}xw.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";xw.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";xw.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";xw.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var gt=xw;function uDe(e,t){gt(e,t)}var ms=uDe;var fDe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},bf=Object.freeze(fDe);function s6(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Me.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,bf.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}s6.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var dDe=new fe,hDe=new h,Yee=new F,mDe=[new fe,new fe,new fe],pDe=[new z,new z,new z],_De=[new z,new z,new z],gDe=new h,yDe=new Oe,xDe=new F,bDe=new Ri;s6._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=se.center(i,dDe),s=fe.toCartesian(r,n,hDe),a=Ot.eastNorthUpToFixedFrame(s,n,Yee),c=F.inverse(a,Yee),u=pDe,f=mDe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=gDe;for(o=0;o<3;o++)fe.toCartesian(f[o],n,d),d=F.multiplyByPointAsVector(c,d,d),u[o].x=d.x,u[o].y=d.y;let p=Oe.fromAxisAngle(h.UNIT_Z,-t,yDe),g=$.fromQuaternion(p,xDe),m=e.length,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)d=F.multiplyByPointAsVector(c,e[o],d),d=$.multiplyByVector(g,d,d),x=Math.min(x,d.x),b=Math.min(b,d.y),T=Math.max(T,d.x),C=Math.max(C,d.y);let A=Ri.fromRotation(t,bDe),E=_De;E[0].x=x,E[0].y=b,E[1].x=x,E[1].y=C,E[2].x=T,E[2].y=b;let v=u[0],D=u[2].x-v.x,O=u[1].y-v.y;for(o=0;o<3;o++){let S=E[o];Ri.multiplyByVector(A,S,S),S.x=(S.x-v.x)/D,S.y=(S.y-v.y)/O}let R=E[0],M=E[1],N=E[2],_=new Array(6);return z.pack(R,_),z.pack(M,_,2),z.pack(N,_,4),_};var st=s6;function TDe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var ve=TDe;function $C(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties($C.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});$C.clone=function(e){if(l(e))return new $C(e._format,e._datatype,e._width,e._height,e._buffer)};$C.prototype.clone=function(){return $C.clone(this)};var bw=$C;var Xee=Zo(uu(),1);function Kee(){if(!l(la._canTransferArrayBuffer)){let e=l6("transferTypedArrayTest");e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return la._canTransferArrayBuffer=!1,la._canTransferArrayBuffer}la._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),la._canTransferArrayBuffer=s}})}return la._canTransferArrayBuffer}var c6=new pe;function a6(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function l6(e){let t=new Xee.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Ng(e))s=e;else if(!n){let a=en(`${la._workerModulePrefix}/${i}.js`);Ng(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=a6(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` + importScripts("${a6(CESIUM_WORKERS)}"); CesiumWorkers["${i}"](); - `;return r=l6(a),new Worker(r,o)}if(r=e,n||(r=nn(`${aa._workerModulePrefix+i}.js`)),!Ht.supportsEsmWebWorkers())throw new re("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function bDe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ht.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new re(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=nn(t.fallbackModulePath),n}n.wasmBinaryFile=nn(t.wasmBinaryFile);let i=await Se.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function aa(e,t){this._workerPath=e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var TDe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new re(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new he(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),u6.raiseEvent(s),i(s)}else u6.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},CDe=[];async function ADe(e,t,n){let i=await Promise.resolve(Kee());l(n)?i||(n.length=0):n=CDe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",TDe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:nn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function EDe(e,t,n){++e._activeTasks;try{let i=await ADe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}aa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=f6(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return EDe(this,e,t)};aa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=f6(this._workerPath),i=await bDe(this,e),o=await Promise.resolve(Kee()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new re("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};aa.prototype.isDestroyed=function(){return!1};aa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};aa.taskCompletedEvent=u6;aa._defaultWorkerModulePrefix="Workers/";aa._workerModulePrefix=aa._defaultWorkerModulePrefix;aa._canTransferArrayBuffer=void 0;var _i=aa;function Ip(){}Ip._transcodeTaskProcessor=new _i("transcodeKTX2",Number.POSITIVE_INFINITY);Ip._readyPromise=void 0;function SDe(){let e=Ip._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return Ip._transcodeTaskProcessor;throw new re("KTX2 transcoder could not be initialized.")});Ip._readyPromise=e}Ip.transcode=function(e,t){return l(Ip._readyPromise)||SDe(),Ip._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;r<i;r++){let s=n[r];for(let a=0;a<o.length;a++){let c=s[o[a]];s[o[a]]=new bw(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)n[r]=n[r][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var Tw=Ip;var Zee;$ee.setKTX2SupportedFormats=function(e,t,n,i,o,r){Zee={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function $ee(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Se.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return Tw.transcode(n,Zee)})}var Dl=$ee;function vDe(e,t){this.start=y(e,0),this.stop=y(t,0)}var Da=vDe;function hn(e,t){this.center=h.clone(y(e,h.ZERO)),this.radius=y(t,0)}var m6=new h,p6=new h,_6=new h,g6=new h,y6=new h,x6=new h,b6=new h,ca=new h,T6=new h,C6=new h,A6=new h,E6=new h,wDe=4/3*P.PI;hn.fromPoints=function(e,t){if(l(t)||(t=new hn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=h.clone(e[0],b6),i=h.clone(n,m6),o=h.clone(n,p6),r=h.clone(n,_6),s=h.clone(n,g6),a=h.clone(n,y6),c=h.clone(n,x6),u=e.length,f;for(f=1;f<u;f++){h.clone(e[f],n);let R=n.x,M=n.y,N=n.z;R<i.x&&h.clone(n,i),R>s.x&&h.clone(n,s),M<o.y&&h.clone(n,o),M>a.y&&h.clone(n,a),N<r.z&&h.clone(n,r),N>c.z&&h.clone(n,c)}let d=h.magnitudeSquared(h.subtract(s,i,ca)),p=h.magnitudeSquared(h.subtract(a,o,ca)),g=h.magnitudeSquared(h.subtract(c,r,ca)),m=i,x=s,b=d;p>b&&(b=p,m=o,x=a),g>b&&(b=g,m=r,x=c);let T=T6;T.x=(m.x+x.x)*.5,T.y=(m.y+x.y)*.5,T.z=(m.z+x.z)*.5;let C=h.magnitudeSquared(h.subtract(x,T,ca)),A=Math.sqrt(C),E=C6;E.x=i.x,E.y=o.y,E.z=r.z;let v=A6;v.x=s.x,v.y=a.y,v.z=c.z;let D=h.midpoint(E,v,E6),O=0;for(f=0;f<u;f++){h.clone(e[f],n);let R=h.magnitude(h.subtract(n,D,ca));R>O&&(O=R);let M=h.magnitudeSquared(h.subtract(n,T,ca));if(M>C){let N=Math.sqrt(M);A=(A+N)*.5,C=A*A;let _=N-A;T.x=(A*T.x+_*n.x)/N,T.y=(A*T.y+_*n.y)/N,T.z=(A*T.z+_*n.z)/N}}return A<O?(h.clone(T,t.center),t.radius=A):(h.clone(D,t.center),t.radius=O),t};var Qee=new Di,DDe=new h,IDe=new h,d6=new fe,h6=new fe;hn.fromRectangle2D=function(e,t,n){return hn.fromRectangleWithHeights2D(e,t,0,0,n)};hn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new hn),!l(e))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;Qee._ellipsoid=ee.default,t=y(t,Qee),se.southwest(e,d6),d6.height=n,se.northeast(e,h6),h6.height=i;let r=t.project(d6,DDe),s=t.project(h6,IDe),a=s.x-r.x,c=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+c*.5,f.z=r.z+u*.5,o};var PDe=[];hn.fromRectangle3D=function(e,t,n,i){if(t=y(t,ee.default),n=y(n,0),l(i)||(i=new hn),!l(e))return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let o=se.subsample(e,t,n,PDe);return hn.fromPoints(o,i)};hn.fromVertices=function(e,t,n,i){if(l(i)||(i=new hn),!l(e)||e.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;t=y(t,h.ZERO),n=y(n,3);let o=b6;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=h.clone(o,m6),s=h.clone(o,p6),a=h.clone(o,_6),c=h.clone(o,g6),u=h.clone(o,y6),f=h.clone(o,x6),d=e.length,p;for(p=0;p<d;p+=n){let N=e[p]+t.x,_=e[p+1]+t.y,S=e[p+2]+t.z;o.x=N,o.y=_,o.z=S,N<r.x&&h.clone(o,r),N>c.x&&h.clone(o,c),_<s.y&&h.clone(o,s),_>u.y&&h.clone(o,u),S<a.z&&h.clone(o,a),S>f.z&&h.clone(o,f)}let g=h.magnitudeSquared(h.subtract(c,r,ca)),m=h.magnitudeSquared(h.subtract(u,s,ca)),x=h.magnitudeSquared(h.subtract(f,a,ca)),b=r,T=c,C=g;m>C&&(C=m,b=s,T=u),x>C&&(C=x,b=a,T=f);let A=T6;A.x=(b.x+T.x)*.5,A.y=(b.y+T.y)*.5,A.z=(b.z+T.z)*.5;let E=h.magnitudeSquared(h.subtract(T,A,ca)),v=Math.sqrt(E),D=C6;D.x=r.x,D.y=s.y,D.z=a.z;let O=A6;O.x=c.x,O.y=u.y,O.z=f.z;let R=h.midpoint(D,O,E6),M=0;for(p=0;p<d;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let N=h.magnitude(h.subtract(o,R,ca));N>M&&(M=N);let _=h.magnitudeSquared(h.subtract(o,A,ca));if(_>E){let S=Math.sqrt(_);v=(v+S)*.5,E=v*v;let w=S-v;A.x=(v*A.x+w*o.x)/S,A.y=(v*A.y+w*o.y)/S,A.z=(v*A.z+w*o.z)/S}}return v<M?(h.clone(A,i.center),i.radius=v):(h.clone(R,i.center),i.radius=M),i};hn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new hn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=b6;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=h.clone(i,m6),r=h.clone(i,p6),s=h.clone(i,_6),a=h.clone(i,g6),c=h.clone(i,y6),u=h.clone(i,x6),f=e.length,d;for(d=0;d<f;d+=3){let M=e[d]+t[d],N=e[d+1]+t[d+1],_=e[d+2]+t[d+2];i.x=M,i.y=N,i.z=_,M<o.x&&h.clone(i,o),M>a.x&&h.clone(i,a),N<r.y&&h.clone(i,r),N>c.y&&h.clone(i,c),_<s.z&&h.clone(i,s),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,o,ca)),g=h.magnitudeSquared(h.subtract(c,r,ca)),m=h.magnitudeSquared(h.subtract(u,s,ca)),x=o,b=a,T=p;g>T&&(T=g,x=r,b=c),m>T&&(T=m,x=s,b=u);let C=T6;C.x=(x.x+b.x)*.5,C.y=(x.y+b.y)*.5,C.z=(x.z+b.z)*.5;let A=h.magnitudeSquared(h.subtract(b,C,ca)),E=Math.sqrt(A),v=C6;v.x=o.x,v.y=r.y,v.z=s.z;let D=A6;D.x=a.x,D.y=c.y,D.z=u.z;let O=h.midpoint(v,D,E6),R=0;for(d=0;d<f;d+=3){i.x=e[d]+t[d],i.y=e[d+1]+t[d+1],i.z=e[d+2]+t[d+2];let M=h.magnitude(h.subtract(i,O,ca));M>R&&(R=M);let N=h.magnitudeSquared(h.subtract(i,C,ca));if(N>A){let _=Math.sqrt(N);E=(E+_)*.5,A=E*E;let S=_-E;C.x=(E*C.x+S*i.x)/_,C.y=(E*C.y+S*i.y)/_,C.z=(E*C.z+S*i.z)/_}}return E<R?(h.clone(C,n.center),n.radius=E):(h.clone(O,n.center),n.radius=R),n};hn.fromCornerPoints=function(e,t,n){l(n)||(n=new hn);let i=h.midpoint(e,t,n.center);return n.radius=h.distance(i,t),n};hn.fromEllipsoid=function(e,t){return l(t)||(t=new hn),h.clone(h.ZERO,t.center),t.radius=e.maximumRadius,t};var RDe=new h;hn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new hn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return hn.clone(e[0],t);if(n===2)return hn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=hn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,h.distance(r,a.center,RDe)+a.radius)}return t.radius=s,t};var ODe=new h,MDe=new h,LDe=new h;hn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new hn);let n=e.halfAxes,i=$.getColumn(n,0,ODe),o=$.getColumn(n,1,MDe),r=$.getColumn(n,2,LDe);return h.add(i,o,i),h.add(i,r,i),t.center=h.clone(e.center,t.center),t.radius=h.magnitude(i),t};var NDe=new h,FDe=new h;hn.fromTransformation=function(e,t){l(t)||(t=new hn);let n=F.getTranslation(e,NDe),i=F.getScale(e,FDe),o=.5*h.magnitude(i);return t.center=h.clone(n,t.center),t.radius=o,t};hn.clone=function(e,t){if(l(e))return l(t)?(t.center=h.clone(e.center,t.center),t.radius=e.radius,t):new hn(e.center,e.radius)};hn.packedLength=4;hn.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};hn.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new hn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var BDe=new h,kDe=new h;hn.union=function(e,t,n){l(n)||(n=new hn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=h.subtract(r,i,BDe),c=h.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,f=h.multiplyByScalar(a,(-o+u)/c,kDe);return h.add(f,i,f),h.clone(f,n.center),n.radius=u,n};var VDe=new h;hn.expand=function(e,t,n){n=hn.clone(e,n);let i=h.magnitude(h.subtract(t,n.center,VDe));return i>n.radius&&(n.radius=i),n};hn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=h.dot(o,n)+t.distance;return r<-i?jt.OUTSIDE:r<i?jt.INTERSECTING:jt.INSIDE};hn.transform=function(e,t,n){return l(n)||(n=new hn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var UDe=new h;hn.distanceSquaredTo=function(e,t){let n=h.subtract(e.center,t,UDe),i=h.magnitude(n)-e.radius;return i<=0?0:i*i};hn.transformWithoutScale=function(e,t,n){return l(n)||(n=new hn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var zDe=new h;hn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Da);let o=h.subtract(e.center,t,zDe),r=h.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var Jee=new h,HDe=new h,GDe=new h,WDe=new h,jDe=new h,qDe=new fe,tte=new Array(8);for(let e=0;e<8;++e)tte[e]=new h;var ete=new Di;hn.projectTo2D=function(e,t,n){ete._ellipsoid=ee.default,t=y(t,ete);let i=t.ellipsoid,o=e.center,r=e.radius,s;h.equals(o,h.ZERO)?s=h.clone(h.UNIT_X,Jee):s=i.geodeticSurfaceNormal(o,Jee);let a=h.cross(h.UNIT_Z,s,HDe);h.normalize(a,a);let c=h.cross(s,a,GDe);h.normalize(c,c),h.multiplyByScalar(s,r,s),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let u=h.negate(c,jDe),f=h.negate(a,WDe),d=tte,p=d[0];h.add(s,c,p),h.add(p,a,p),p=d[1],h.add(s,c,p),h.add(p,f,p),p=d[2],h.add(s,u,p),h.add(p,f,p),p=d[3],h.add(s,u,p),h.add(p,a,p),h.negate(s,s),p=d[4],h.add(s,c,p),h.add(p,a,p),p=d[5],h.add(s,c,p),h.add(p,f,p),p=d[6],h.add(s,u,p),h.add(p,f,p),p=d[7],h.add(s,u,p),h.add(p,a,p);let g=d.length;for(let T=0;T<g;++T){let C=d[T];h.add(o,C,C);let A=i.cartesianToCartographic(C,qDe);t.project(A,C)}n=hn.fromPoints(d,n),o=n.center;let m=o.x,x=o.y,b=o.z;return o.x=b,o.y=m,o.z=x,n};hn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};hn.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&e.radius===t.radius};hn.prototype.intersectPlane=function(e){return hn.intersectPlane(this,e)};hn.prototype.distanceSquaredTo=function(e){return hn.distanceSquaredTo(this,e)};hn.prototype.computePlaneDistances=function(e,t,n){return hn.computePlaneDistances(this,e,t,n)};hn.prototype.isOccluded=function(e){return hn.isOccluded(this,e)};hn.prototype.equals=function(e){return hn.equals(this,e)};hn.prototype.clone=function(e){return hn.clone(this,e)};hn.prototype.volume=function(){let e=this.radius;return wDe*e*e*e};var ae=hn;function YDe(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var fn=YDe;var XDe={NONE:0,TOP:1,ALL:2},sn=Object.freeze(XDe);function ps(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}ps.POSITION_ONLY=Object.freeze(new ps({position:!0}));ps.POSITION_AND_NORMAL=Object.freeze(new ps({position:!0,normal:!0}));ps.POSITION_NORMAL_AND_ST=Object.freeze(new ps({position:!0,normal:!0,st:!0}));ps.POSITION_AND_ST=Object.freeze(new ps({position:!0,st:!0}));ps.POSITION_AND_COLOR=Object.freeze(new ps({position:!0,color:!0}));ps.ALL=Object.freeze(new ps({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ps.DEFAULT=ps.POSITION_NORMAL_AND_ST;ps.packedLength=6;ps.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};ps.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ps),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};ps.clone=function(e,t){if(l(e))return l(t)||(t=new ps),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Ie=ps;var KDe=new h;function du(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Ie.DEFAULT);this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}du.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new du({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};du.fromAxisAlignedBoundingBox=function(e){return new du({minimum:e.minimum,maximum:e.maximum})};du.packedLength=2*h.packedLength+Ie.packedLength+1;du.pack=function(e,t,n){return n=y(n,0),h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Ie.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Ie.packedLength]=y(e._offsetAttribute,-1),t};var ite=new h,ote=new h,rte=new Ie,nte={minimum:ite,maximum:ote,vertexFormat:rte,offsetAttribute:void 0};du.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,ite),o=h.unpack(e,t+h.packedLength,ote),r=Ie.unpack(e,t+2*h.packedLength,rte),s=e[t+2*h.packedLength+Ie.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(o,n._maximum),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(nte.offsetAttribute=s===-1?void 0:s,new du(nte))};du.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let o=new fn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=h.subtract(n,t,KDe),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===sn.NONE?0:1,d=new Uint8Array(u/3).fill(f);o.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new at({attributes:o,indices:r,primitiveType:Me.TRIANGLES,boundingSphere:new ae(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var S6;du.getUnitBox=function(){return l(S6)||(S6=du.createGeometry(du.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),S6};var Ia=du;var no={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};no.getMathType=function(e){switch(e){case no.SCALAR:return Number;case no.VEC2:return z;case no.VEC3:return h;case no.VEC4:return oe;case no.MAT2:return Ii;case no.MAT3:return $;case no.MAT4:return F}};no.getNumberOfComponents=function(e){switch(e){case no.SCALAR:return 1;case no.VEC2:return 2;case no.VEC3:return 3;case no.VEC4:case no.MAT2:return 4;case no.MAT3:return 9;case no.MAT4:return 16}};no.getAttributeLocationCount=function(e){switch(e){case no.SCALAR:case no.VEC2:case no.VEC3:case no.VEC4:return 1;case no.MAT2:return 2;case no.MAT3:return 3;case no.MAT4:return 4}};no.getGlslType=function(e){switch(e){case no.SCALAR:return"float";case no.VEC2:return"vec2";case no.VEC3:return"vec3";case no.VEC4:return"vec4";case no.MAT2:return"mat2";case no.MAT3:return"mat3";case no.MAT4:return"mat4"}};var on=Object.freeze(no);var ste=1/256,ate=256,To={};To.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(o)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};To.octEncode=function(e,t){return To.octEncodeInRange(e,255,t)};var Cw=new z,cte=new Uint8Array(1);function qV(e){return cte[0]=e,cte[0]}To.octEncodeToCartesian4=function(e,t){return To.octEncodeInRange(e,65535,Cw),t.x=qV(Cw.x*ste),t.y=qV(Cw.x),t.z=qV(Cw.y*ste),t.w=qV(Cw.y),t};To.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*P.signNotZero(o),i.y=(1-Math.abs(o))*P.signNotZero(i.y)}return h.normalize(i,i)};To.octDecode=function(e,t,n){return To.octDecodeInRange(e,t,255,n)};To.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*ate+i,a=o*ate+r;return To.octDecodeInRange(s,a,65535,t)};To.octPackFloat=function(e){return 256*e.x+e.y};var w6=new z;To.octEncodeFloat=function(e){return To.octEncode(e,w6),To.octPackFloat(w6)};To.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return To.octDecode(i,o,t)};To.octPack=function(e,t,n,i){let o=To.octEncodeFloat(e),r=To.octEncodeFloat(t),s=To.octEncode(n,w6);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};To.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;To.octDecodeFloat(s,t),To.octDecodeFloat(c,n),To.octDecode(r,a,i)};To.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};To.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function v6(e){return e>>1^-(e&1)}To.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=v6(e[a]),r+=v6(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=v6(n[a]),n[a]=s)};To.dequantize=function(e,t,n,i){let o=on.getNumberOfComponents(n),r;switch(t){case X.BYTE:r=127;break;case X.UNSIGNED_BYTE:r=255;break;case X.SHORT:r=32767;break;case X.UNSIGNED_SHORT:r=65535;break;case X.INT:r=2147483647;break;case X.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let u=a*o+c;s[u]=Math.max(e[u]/r,-1)}return s};To.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&o,d=c&i,p=3*a;t[p]=u*r,t[p+1]=f*s,t[p+2]=d*r}return t};var Mn=To;var lte=new h,ute=new h,fte=new h;function ZDe(e,t,n,i,o){l(o)||(o=new h);let r,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,lte),s=h.subtract(i,t,ute),a=h.subtract(e,t,fte),c=h.dot(r,r),u=h.dot(r,s),f=h.dot(r,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(z.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,o);if(z.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,o);if(z.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,o);r=z.subtract(n,t,lte),s=z.subtract(i,t,ute),a=z.subtract(e,t,fte),c=z.dot(r,r),u=z.dot(r,s),f=z.dot(r,a),d=z.dot(s,s),p=z.dot(s,a)}o.y=d*f-u*p,o.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var px=ZDe;function cm(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}cm.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var Pp={high:0,low:0};cm.fromCartesian=function(e,t){l(t)||(t=new cm);let n=t.high,i=t.low;return cm.encode(e.x,Pp),n.x=Pp.high,i.x=Pp.low,cm.encode(e.y,Pp),n.y=Pp.high,i.y=Pp.low,cm.encode(e.z,Pp),n.z=Pp.high,i.z=Pp.low,t};var D6=new cm;cm.writeElements=function(e,t,n){cm.fromCartesian(e,D6);let i=D6.high,o=D6.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var Gn=cm;var I6={};I6.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function dte(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}I6.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<P.EPSILON14)return[0,0];if(c>u&&u/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=dte(o,-r,P.EPSILON14);if(s<0)return[];let a=-.5*dte(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Vc=I6;var R6={};R6.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function P6(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,f=r*r,d=s*s,p=o*s-f,g=o*a-r*s,m=r*a-d,x=4*p*m-g*g,b,T;if(x<0){let W,j,J;f*u>=c*d?(W=o,j=p,J=-2*r*p+o*g):(W=a,j=m,J=-a*g+2*s*m);let K=-(J<0?-1:1)*Math.abs(W)*Math.sqrt(-x);T=-J+K;let Q=T/2,de=Q<0?-Math.pow(-Q,1/3):Math.pow(Q,1/3),ye=T===K?-de:-j/de;return b=j<=0?de+ye:-J/(de*de+ye*ye+j),f*u>=c*d?[(b-r)/o]:[-a/(b+s)]}let C=p,A=-2*r*p+o*g,E=m,v=-a*g+2*s*m,D=Math.sqrt(x),O=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*D,-A)/3);b=2*Math.sqrt(-C);let M=Math.cos(R);T=b*M;let N=b*(-M/2-O*Math.sin(R)),_=T+N>2*r?T-r:N-r,S=o,w=_/S;R=Math.abs(Math.atan2(a*D,-v)/3),b=2*Math.sqrt(-E),M=Math.cos(R),T=b*M,N=b*(-M/2-O*Math.sin(R));let I=-a,L=T+N<2*s?T+s:N+s,B=I/L,U=S*L,V=-_*L-S*I,G=_*I,k=(s*V-r*G)/(-r*V+s*U);return w<=k?w<=B?k<=B?[w,k,B]:[w,B,k]:[B,w,k]:w<=B?[k,w,B]:k<=B?[k,B,w]:[B,k,w]}R6.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Vc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Vc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return P6(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):P6(e,t,0,i);if(i===0)return o=Vc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return P6(e,t,n,i)};var _x=R6;var O6={};O6.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=o*o,m=g*o;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*r*d*d+256*s*m+o*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*r*n*d)+g*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function Od(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=_x.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let d=Vc.computeRealRoots(1,r,a);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let x=Math.sqrt(p),b=Math.sqrt(g);return[u-b,u-x,u+x,u+b]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(r+f-s/d)/2,g=(r+f+s/d)/2,m=Vc.computeRealRoots(1,d,p),x=Vc.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,x.length!==0?(x[0]+=u,x[1]+=u,m[1]<=x[0]?[m[0],m[1],x[0],x[1]]:x[1]<=m[0]?[x[0],x[1],m[0],m[1]]:m[0]>=x[0]&&m[1]<=x[1]?[x[0],m[0],m[1],x[1]]:x[0]>=m[0]&&x[1]<=m[1]?[m[0],x[0],x[1],m[1]]:m[0]>x[0]&&m[0]<x[1]?[x[0],m[0],x[1],m[1]]:[m[0],x[0],m[1],x[1]]):m):x.length!==0?(x[0]+=u,x[1]+=u,x):[]}}return[]}function Aw(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,u=s*i-n*t*e+o,f=_x.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,x=p/2,b=g-4*i,T=g+4*Math.abs(i),C=s-4*d,A=s+4*Math.abs(d),E,v;if(d<0||b*A<C*T){let S=Math.sqrt(C);E=S/2,v=S===0?0:(e*x-n)/S}else{let S=Math.sqrt(b);E=S===0?0:(e*x-n)/S,v=S/2}let D,O;m===0&&E===0?(D=0,O=0):P.sign(m)===P.sign(E)?(D=m+E,O=d/D):(O=m-E,D=d/O);let R,M;x===0&&v===0?(R=0,M=0):P.sign(x)===P.sign(v)?(R=x+v,M=i/R):(M=x-v,R=i/M);let N=Vc.computeRealRoots(1,D,R),_=Vc.computeRealRoots(1,O,M);if(N.length!==0)return _.length!==0?N[1]<=_[0]?[N[0],N[1],_[0],_[1]]:_[1]<=N[0]?[_[0],_[1],N[0],N[1]]:N[0]>=_[0]&&N[1]<=_[1]?[_[0],N[0],N[1],_[1]]:_[0]>=N[0]&&_[1]<=N[1]?[N[0],_[0],_[1],N[1]]:N[0]>_[0]&&N[0]<_[1]?[_[0],N[0],_[1],N[1]]:[N[0],_[0],N[1],_[1]]:N;if(_.length!==0)return _}return[]}O6.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<P.EPSILON15)return _x.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return Od(r,s,a,c);case 1:return Aw(r,s,a,c);case 2:return Aw(r,s,a,c);case 3:return Od(r,s,a,c);case 4:return Od(r,s,a,c);case 5:return Aw(r,s,a,c);case 6:return Od(r,s,a,c);case 7:return Od(r,s,a,c);case 8:return Aw(r,s,a,c);case 9:return Od(r,s,a,c);case 10:return Od(r,s,a,c);case 11:return Aw(r,s,a,c);case 12:return Od(r,s,a,c);case 13:return Od(r,s,a,c);case 14:return Od(r,s,a,c);case 15:return Od(r,s,a,c);default:return}};var Ew=O6;function YV(e,t){t=h.clone(y(t,h.ZERO)),h.equals(t,h.ZERO)||h.normalize(t,t),this.origin=h.clone(y(e,h.ZERO)),this.direction=t}YV.clone=function(e,t){if(l(e))return l(t)?(t.origin=h.clone(e.origin),t.direction=h.clone(e.direction),t):new YV(e.origin,e.direction)};YV.getPoint=function(e,t,n){return l(n)||(n=new h),n=h.multiplyByScalar(e.direction,t,n),h.add(e.origin,n,n)};var mn=YV;var Ho={};Ho.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,o=e.direction,r=t.normal,s=h.dot(r,o);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-h.dot(r,i))/s;if(!(a<0))return n=h.multiplyByScalar(o,a,n),h.add(i,n,n)};var $De=new h,QDe=new h,bte=new h,hte=new h,mte=new h;Ho.rayTriangleParametric=function(e,t,n,i,o){o=y(o,!1);let r=e.origin,s=e.direction,a=h.subtract(n,t,$De),c=h.subtract(i,t,QDe),u=h.cross(s,c,bte),f=h.dot(a,u),d,p,g,m,x;if(o){if(f<P.EPSILON6||(d=h.subtract(r,t,hte),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,mte),m=h.dot(s,p),m<0||g+m>f))return;x=h.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let b=1/f;if(d=h.subtract(r,t,hte),g=h.dot(d,u)*b,g<0||g>1||(p=h.cross(d,a,mte),m=h.dot(s,p)*b,m<0||g+m>1))return;x=h.dot(c,p)*b}return x};Ho.rayTriangle=function(e,t,n,i,o,r){let s=Ho.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new h),h.multiplyByScalar(e.direction,s,r),h.add(e.origin,r,r)};var JDe=new mn;Ho.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=JDe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=Ho.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function eIe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var tIe={root0:0,root1:0};function Tte(e,t,n){l(n)||(n=new Da);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=h.subtract(i,r,bte),c=h.dot(o,o),u=2*h.dot(o,a),f=h.magnitudeSquared(a)-s,d=eIe(c,u,f,tIe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Ho.raySphere=function(e,t,n){if(n=Tte(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var nIe=new mn;Ho.lineSegmentSphere=function(e,t,n,i){let o=nIe;h.clone(e,o.origin);let r=h.subtract(t,e,o.direction),s=h.magnitude(r);if(h.normalize(r,r),i=Tte(o,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var iIe=new h,oIe=new h;Ho.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,iIe),o=h.multiplyComponents(n,e.direction,oIe),r=h.magnitudeSquared(i),s=h.dot(i,o),a,c,u,f,d;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=h.magnitudeSquared(o),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,x=a/d;return m<x?new Da(m,x):{start:x,stop:m}}let g=Math.sqrt(a/c);return new Da(g,g)}else if(r<1)return a=r-1,c=h.magnitudeSquared(o),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Da(0,d/c);if(s<0)return c=h.magnitudeSquared(o),new Da(0,-s/c)};function gx(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Ho.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=o*(i*gx(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*gx(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],P.EPSILON15),d=o*(i*gx(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Vc.computeRealRoots(a,c,u),p.length===0)return g;let R=p[0],M=Math.sqrt(Math.max(1-R*R,0));if(g.push(new h(i,o*R,o*-M)),g.push(new h(i,o*R,o*M)),p.length===2){let N=p[1],_=Math.sqrt(Math.max(1-N*N,0));g.push(new h(i,o*N,o*-_)),g.push(new h(i,o*N,o*_))}return g}let m=d*d,x=f*f,b=a*a,T=d*f,C=b+x,A=2*(c*a+T),E=2*u*a+c*c-x+m,v=2*(u*c-T),D=u*u-m;if(C===0&&A===0&&E===0&&v===0)return g;p=Ew.computeRealRoots(C,A,E,v,D);let O=p.length;if(O===0)return g;for(let R=0;R<O;++R){let M=p[R],N=M*M,_=Math.max(1-N,0),S=Math.sqrt(_),w;P.sign(a)===P.sign(u)?w=gx(a*N+u,c*M,P.EPSILON12):P.sign(u)===P.sign(c*M)?w=gx(a*N,c*M+u,P.EPSILON12):w=gx(a*N+c*M,u,P.EPSILON12);let I=gx(f*M,d,P.EPSILON15),L=w*I;L<0?g.push(new h(i,o*M,o*S)):L>0?g.push(new h(i,o*M,o*-S)):S!==0?(g.push(new h(i,o*M,o*-S)),g.push(new h(i,o*M,o*S)),++R):g.push(new h(i,o*M,o*S))}return g};var M6=new h,pte=new h,_te=new h,XV=new h,rIe=new h,sIe=new $,aIe=new $,cIe=new $,lIe=new $,uIe=new $,gte=new $,yte=new $,xte=new h,fIe=new h,dIe=new fe;Ho.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let D=t.geodeticSurfaceNormal(n,M6);if(h.dot(i,D)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,M6),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,XV),c=h.normalize(h.cross(a,s,pte),pte),u=h.normalize(h.cross(s,c,_te),_te),f=sIe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,aIe),p=$.fromScale(t.radii,cIe),g=$.fromScale(t.oneOverRadii,lIe),m=uIe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let x=$.multiply($.multiply(d,g,gte),m,gte),b=$.multiply($.multiply(x,p,yte),f,yte),T=$.multiplyByVector(x,n,rIe),C=Ho.quadraticVectorExpression(b,h.negate(T,M6),0,0,1),A,E,v=C.length;if(v>0){let D=h.clone(h.ZERO,fIe),O=Number.NEGATIVE_INFINITY;for(let M=0;M<v;++M){A=$.multiplyByVector(p,$.multiplyByVector(f,C[M],xte),xte);let N=h.normalize(h.subtract(A,n,XV),XV),_=h.dot(N,i);_>O&&(O=_,D=h.clone(A,D))}let R=t.cartesianToCartographic(D,dIe);return O=P.clamp(O,0,1),E=h.magnitude(h.subtract(D,n,XV))*Math.sqrt(1-O*O),E=o?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var hIe=new h;Ho.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,hIe),r=n.normal,s=h.dot(r,o);if(Math.abs(s)<P.EPSILON6)return;let a=h.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};Ho.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=h.dot(o,e)+r<0,a=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return Ho.lineSegmentPlane(e,t,i,f),Ho.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Ho.lineSegmentPlane(t,n,i,f),Ho.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Ho.lineSegmentPlane(n,e,i,f),Ho.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return Ho.lineSegmentPlane(e,n,i,f),Ho.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Ho.lineSegmentPlane(n,t,i,f),Ho.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Ho.lineSegmentPlane(t,e,i,f),Ho.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var $n=Ho;function Us(e,t){this.normal=h.clone(e),this.distance=t}Us.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Us(t,i)};var mIe=new h;Us.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,mIe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Us(n,i)};Us.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var pIe=new h;Us.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Us.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,pIe);return h.subtract(t,o,n)};var _Ie=new F,gIe=new oe,yIe=new h;Us.transform=function(e,t,n){let i=e.normal,o=e.distance,r=F.inverseTranspose(t,_Ie),s=oe.fromElements(i.x,i.y,i.z,o,gIe);s=F.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,yIe);return s=oe.divideByScalar(s,h.magnitude(a),s),Us.fromCartesian4(s,n)};Us.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Us(e.normal,e.distance)};Us.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Us.ORIGIN_XY_PLANE=Object.freeze(new Us(h.UNIT_Z,0));Us.ORIGIN_YZ_PLANE=Object.freeze(new Us(h.UNIT_X,0));Us.ORIGIN_ZX_PLANE=Object.freeze(new Us(h.UNIT_Y,0));var an=Us;var L6={};L6.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};L6.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(_,S,w,I){for(;S.length>=1;){let L=S[S.length-1];if(S.splice(S.length-1,1),_[L].numLiveTriangles>0)return L}for(;o<I;){if(_[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(_,S,w,I,L,B,U){let V=-1,G,k=-1,W=0;for(;W<w.length;){let j=w[W];I[j].numLiveTriangles&&(G=0,L-I[j].timeStamp+2*I[j].numLiveTriangles<=S&&(G=L-I[j].timeStamp),(G>k||k===-1)&&(k=G,V=j)),++W}return V===-1?r(I,B,_,U):V}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let x=0,b=i+1;o=1;let T=[],C=[],A,E,v=0,D=[],O=a/3,R=[];for(g=0;g<O;g++)R[g]=!1;let M,N;for(;x!==-1;){T=[],E=p[x],N=E.vertexTriangles.length;for(let _=0;_<N;++_)if(m=E.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let S=0;S<3;++S)M=t[u],T.push(M),C.push(M),D[v]=M,++v,A=p[M],--A.numLiveTriangles,b-A.timeStamp>i&&(A.timeStamp=b,++b),++u}x=s(t,i,T,p,b,C,c)}return D};var Sw=L6;var Uc={};function tU(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function xIe(e){let t=e.length,n=t/3*6,i=Ne.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)tU(i,o,e[r],e[r+1],e[r+2]);return i}function bIe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ne.createTypedArray(t,n);tU(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)tU(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function TIe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ne.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)tU(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Uc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Me.TRIANGLES:e.indices=xIe(t);break;case Me.TRIANGLE_STRIP:e.indices=bIe(t);break;case Me.TRIANGLE_FAN:e.indices=TIe(t);break}e.primitiveType=Me.LINES}return e};Uc.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ae(u.center,u.radius+n)),new at({attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Me.LINES,boundingSphere:c})};Uc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];l(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=o++);return i};Uc.reorderForPreVertexCache=function(e){let t=at.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Ne.createTypedArray(t,r),a=0,c=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[c]=f:(f=o[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,x=0,b=g.componentsPerAttribute,T=X.createTypedArray(g.componentDatatype,u*b);for(;x<t;){let C=i[x];if(C!==-1)for(let A=0;A<b;A++)T[b*C+A]=m[b*x+A];++x}g.values=T}}return e};Uc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Me.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=Sw.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Cte(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new ve({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function CIe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}Uc.fitToUnsignedShortIndices=function(e){let t=[],n=at.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Cte(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Me.TRIANGLES?u=3:e.primitiveType===Me.LINES?u=2:e.primitiveType===Me.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=r++,i[p]=g,CIe(s,e.attributes,p)),o.push(g)}r+u>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new at({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Cte(e.attributes))}o.length!==0&&t.push(new at({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Ate=new h,AIe=new fe;Uc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Di;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,Ate),p=s.cartesianToCartographic(d,AIe),g=o.project(p,Ate);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=r,e.attributes[i]=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var N6={high:0,low:0};Uc.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Gn.encode(r[f],N6),a[f]=N6.high,c[f]=N6.low;let u=o.componentsPerAttribute;return e.attributes[n]=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var Ld=new h;function F6(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,Ld),F.multiplyByPoint(e,Ld,Ld),h.pack(Ld,n,o)}}function B6(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,Ld),$.multiplyByVector(e,Ld,Ld),Ld=h.normalize(Ld,Ld),h.pack(Ld,n,o)}}var KV=new F,ZV=new $;Uc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;F6(t,n.position),F6(t,n.prevPosition),F6(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(F.inverse(t,KV),F.transpose(KV,KV),F.getMatrix3(KV,ZV),B6(ZV,n.normal),B6(ZV,n.tangent),B6(ZV,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ae.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function EIe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[r]=new ve({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:X.createTypedArray(s.componentDatatype,a)}))}return i}var SIe=new h;function k6(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=EIe(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,g=p.length,r=0;r<g;++r)d[s++]=p[r];let m;if(c){let C=0;for(o=0;o<n;++o)C+=e[o][t].indices.length;let A=at.computeNumberOfVertices(new at({attributes:f,primitiveType:Me.POINTS})),E=Ne.createTypedArray(A,C),v=0,D=0;for(o=0;o<n;++o){let O=e[o][t].indices,R=O.length;for(s=0;s<R;++s)E[v++]=D+O[s];D+=at.computeNumberOfVertices(e[o][t])}m=E}let x=new h,b=0,T;for(o=0;o<n;++o){if(T=e[o][t].boundingSphere,!l(T)){x=void 0;break}h.add(T.center,x,x)}if(l(x))for(h.divideByScalar(x,n,x),o=0;o<n;++o){T=e[o][t].boundingSphere;let C=h.magnitude(h.subtract(T.center,x,SIe))+T.radius;C>b&&(b=C)}return new at({attributes:f,indices:m,primitiveType:u,boundingSphere:l(x)?new ae(x,b):void 0})}Uc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(k6(t,"geometry")),n.length>0&&(o.push(k6(n,"westHemisphereGeometry")),o.push(k6(n,"eastHemisphereGeometry"))),o};var Cf=new h,vw=new h,QC=new h,JC=new h;Uc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],x=t[u+1],b=t[u+2],T=m*3,C=x*3,A=b*3;vw.x=i[T],vw.y=i[T+1],vw.z=i[T+2],QC.x=i[C],QC.y=i[C+1],QC.z=i[C+2],JC.x=i[A],JC.y=i[A+1],JC.z=i[A+2],s[m].count++,s[x].count++,s[b].count++,h.subtract(QC,vw,QC),h.subtract(JC,vw,JC),a[f]=h.cross(QC,JC,new h),f++}let d=0;for(u=0;u<o;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<r;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,Cf),p.count>0){for(f=0;f<p.count;f++)h.add(Cf,a[c[p.indexOffset+f]],Cf);h.equalsEpsilon(h.ZERO,Cf,P.EPSILON10)&&h.clone(a[c[p.indexOffset]],Cf)}h.equalsEpsilon(h.ZERO,Cf,P.EPSILON10)&&(Cf.z=1),h.normalize(Cf,Cf),g[m]=Cf.x,g[m+1]=Cf.y,g[m+2]=Cf.z}return e.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e};var vIe=new h,Ete=new h,wIe=new h;Uc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let x=n[u],b=n[u+1],T=n[u+2];f=x*3,d=b*3,p=T*3;let C=x*2,A=b*2,E=T*2,v=i[f],D=i[f+1],O=i[f+2],R=r[C],M=r[C+1],N=r[A+1]-M,_=r[E+1]-M,S=1/((r[A]-R)*_-(r[E]-R)*N),w=(_*(i[d]-v)-N*(i[p]-v))*S,I=(_*(i[d+1]-D)-N*(i[p+1]-D))*S,L=(_*(i[d+2]-O)-N*(i[p+2]-O))*S;c[f]+=w,c[f+1]+=I,c[f+2]+=L,c[d]+=w,c[d+1]+=I,c[d+2]+=L,c[p]+=w,c[p+1]+=I,c[p+2]+=L}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let x=h.fromArray(o,f,vIe),b=h.fromArray(c,f,wIe),T=h.dot(x,b);h.multiplyByScalar(x,T,Ete),h.normalize(h.subtract(b,Ete,b),b),g[f]=b.x,g[d]=b.y,g[p]=b.z,h.normalize(h.cross(x,b,b),b),m[f]=b.x,m[d]=b.y,m[p]=b.z}return e.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m}),e};var ww=new z,Md=new h,Ste=new h,vte=new h,$V=new z;Uc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let D=t.values;i=D.length/3;let O=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(h.fromArray(D,n*3,Md),h.equals(Md,h.ZERO)){R+=2;continue}$V=Mn.octEncodeInRange(Md,65535,$V),O[R++]=$V.x,O[R++]=$V.y}return e.attributes.compressedAttributes=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:O}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,x;s&&(p=o.values),a&&(g=r.values),f&&(m=c.values),d&&(x=u.values),i=(s?p.length:g.length)/(s?3:2);let C=i,A=a&&s?2:1;A+=f||d?1:0,C*=A;let E=new Float32Array(C),v=0;for(n=0;n<i;++n){a&&(z.fromArray(g,n*2,ww),E[v++]=Mn.compressTextureCoordinates(ww));let D=n*3;s&&l(m)&&l(x)?(h.fromArray(p,D,Md),h.fromArray(m,D,Ste),h.fromArray(x,D,vte),Mn.octPack(Md,Ste,vte,ww),E[v++]=ww.x,E[v++]=ww.y):(s&&(h.fromArray(p,D,Md),E[v++]=Mn.octEncodeFloat(Md)),f&&(h.fromArray(m,D,Md),E[v++]=Mn.octEncodeFloat(Md)),d&&(h.fromArray(x,D,Md),E[v++]=Mn.octEncodeFloat(Md)))}return e.attributes.compressedAttributes=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:A,values:E}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function DIe(e){if(l(e.indices))return e;let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function IIe(e){let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function PIe(e){let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function RIe(e){if(l(e.indices))return e;let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function OIe(e){let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Me.LINES,e}function MIe(e){let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Me.LINES,e}function LIe(e){switch(e.primitiveType){case Me.TRIANGLE_FAN:return IIe(e);case Me.TRIANGLE_STRIP:return PIe(e);case Me.TRIANGLES:return DIe(e);case Me.LINE_STRIP:return OIe(e);case Me.LINE_LOOP:return MIe(e);case Me.LINES:return RIe(e)}return e}function zg(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function NIe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){zg(e,e.y<0),zg(t,t.y<0),zg(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=P.sign(e.y):s=P.sign(n.y):o>r?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;zg(e,a),zg(t,a),zg(n,a)}var wte=new h;function Af(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,wte),e.y/(e.y-t.y),wte),n),h.clone(n,i),zg(n,!0),zg(i,!1)}var yx=new h,xx=new h,bx=new h,Tx=new h,V6={positions:new Array(7),indices:new Array(3*3)};function FIe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;NIe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=V6.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Af(e,t,yx,bx),Af(e,n,xx,Tx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Af(t,n,yx,bx),Af(t,e,xx,Tx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Af(n,e,yx,bx),Af(n,t,xx,Tx),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Af(n,e,yx,bx),Af(n,t,xx,Tx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Af(t,n,yx,bx),Af(t,e,xx,Tx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Af(e,t,yx,bx),Af(e,n,xx,Tx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=V6.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=yx,c[4]=xx,c[5]=bx,c[6]=Tx,c.length=7),V6}function Dte(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=X.createTypedArray(r.componentDatatype,r.values)}let i=at.computeNumberOfVertices(e);return e.indices=Ne.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function tA(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new ve({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new at({attributes:n,indices:[],primitiveType:e.primitiveType})}function G6(e,t,n){let i=l(e.geometry.boundingSphere);t=Dte(t,i),n=Dte(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function W6(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,f,d,p){let g=e.fromArray(u,r*t,n),m=e.fromArray(u,s*t,i),x=e.fromArray(u,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(x,c.z,x);let b=e.add(g,m,g);e.add(b,x,b),p&&e.normalize(b,b),e.pack(b,f,d*t)}}var BIe=W6(oe,4),eU=W6(h,3),Lte=W6(z,2),kIe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>P.EPSILON6?1:0},Dw=new h,U6=new h,z6=new h,VIe=new h;function QV(e,t,n,i,o,r,s,a,c,u,f,d,p,g,m,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let b=h.fromArray(o,e*3,Dw),T=h.fromArray(o,t*3,U6),C=h.fromArray(o,n*3,z6),A=px(i,b,T,C,VIe);if(l(A)){if(l(r)&&eU(e,t,n,A,r,d.normal.values,x,!0),l(u)){let E=h.fromArray(u,e*3,Dw),v=h.fromArray(u,t*3,U6),D=h.fromArray(u,n*3,z6);h.multiplyByScalar(E,A.x,E),h.multiplyByScalar(v,A.y,v),h.multiplyByScalar(D,A.z,D);let O;!h.equals(E,h.ZERO)||!h.equals(v,h.ZERO)||!h.equals(D,h.ZERO)?(O=h.add(E,v,E),h.add(O,D,O),h.normalize(O,O)):(O=Dw,O.x=0,O.y=0,O.z=0),h.pack(O,d.extrudeDirection.values,x*3)}if(l(f)&&kIe(e,t,n,A,f,d.applyOffset.values,x),l(s)&&eU(e,t,n,A,s,d.tangent.values,x,!0),l(a)&&eU(e,t,n,A,a,d.bitangent.values,x,!0),l(c)&&Lte(e,t,n,A,c,d.st.values,x),g>0)for(let E=0;E<g;E++){let v=p[E];UIe(e,t,n,A,x,m[v],d[v])}}}function UIe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,u=s.values;switch(a){case 4:BIe(e,t,n,i,c,u,o,!1);break;case 3:eU(e,t,n,i,c,u,o,!1);break;case 2:Lte(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function lm(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var zIe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Ite(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let O in n)n.hasOwnProperty(O)&&!zIe[O]&&l(n[O])&&d.push(O);let p=d.length,g=tA(t),m=tA(t),x,b,T,C,A,E=[];E.length=i.length/3;let v=[];for(v.length=i.length/3,A=0;A<E.length;++A)E[A]=-1,v[A]=-1;let D=f.length;for(A=0;A<D;A+=3){let O=f[A],R=f[A+1],M=f[A+2],N=h.fromArray(i,O*3),_=h.fromArray(i,R*3),S=h.fromArray(i,M*3),w=FIe(N,_,S);if(l(w)&&w.positions.length>3){let I=w.positions,L=w.indices,B=L.length;for(let U=0;U<B;++U){let V=L[U],G=I[V];G.y<0?(x=m.attributes,b=m.indices,T=E):(x=g.attributes,b=g.indices,T=v),C=lm(x,b,T,f,V<3?A+V:-1,G),QV(O,R,M,G,i,o,s,r,a,c,u,x,d,p,n,C)}}else l(w)&&(N=w.positions[0],_=w.positions[1],S=w.positions[2]),N.y<0?(x=m.attributes,b=m.indices,T=E):(x=g.attributes,b=g.indices,T=v),C=lm(x,b,T,f,A,N),QV(O,R,M,N,i,o,s,r,a,c,u,x,d,p,n,C),C=lm(x,b,T,f,A+1,_),QV(O,R,M,_,i,o,s,r,a,c,u,x,d,p,n,C),C=lm(x,b,T,f,A+2,S),QV(O,R,M,S,i,o,s,r,a,c,u,x,d,p,n,C)}G6(e,m,g)}var Nte=an.fromPointNormal(h.ZERO,h.UNIT_Y),HIe=new h,GIe=new h;function eA(e,t,n,i,o,r,s){if(!l(s))return;let a=h.fromArray(i,e*3,Dw);h.equalsEpsilon(a,n,P.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function Pte(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=tA(t),a=tA(t),c,u=r.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=r[c],g=r[c+1],m=h.fromArray(i,p*3,Dw),x=h.fromArray(i,g*3,U6),b;Math.abs(m.y)<P.EPSILON6&&(m.y<0?m.y=-P.EPSILON6:m.y=P.EPSILON6),Math.abs(x.y)<P.EPSILON6&&(x.y<0?x.y=-P.EPSILON6:x.y=P.EPSILON6);let T=s.attributes,C=s.indices,A=d,E=a.attributes,v=a.indices,D=f,O=$n.lineSegmentPlane(m,x,Nte,z6);if(l(O)){let R=h.multiplyByScalar(h.UNIT_Y,5*P.EPSILON9,HIe);m.y<0&&(h.negate(R,R),T=a.attributes,C=a.indices,A=f,E=s.attributes,v=s.indices,D=d);let M=h.add(O,R,GIe);b=lm(T,C,A,r,c,m),eA(p,g,m,i,b,T,o),b=lm(T,C,A,r,-1,M),eA(p,g,M,i,b,T,o),h.negate(R,R),h.add(O,R,M),b=lm(E,v,D,r,-1,M),eA(p,g,M,i,b,E,o),b=lm(E,v,D,r,c+1,x),eA(p,g,x,i,b,E,o)}else{let R,M,N;m.y<0?(R=a.attributes,M=a.indices,N=f):(R=s.attributes,M=s.indices,N=d),b=lm(R,M,N,r,c,m),eA(p,g,m,i,b,R,o),b=lm(R,M,N,r,c+1,x),eA(p,g,x,i,b,R,o)}}G6(e,a,s)}var Rte=new z,WIe=new z,Fte=new h,Bte=new h,H6=new h,jIe=new h,qIe=new h,YIe=new h,Ote=new oe;function Mte(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=h.unpack(n,s,Fte);if(a.x>0)continue;let c=h.unpack(i,s,Bte);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let u=h.unpack(o,s,H6);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):h.pack(a,o,s))}}var XIe=5*P.EPSILON9,JV=P.EPSILON6;function KIe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=tA(t),f=tA(t),d,p,g,m=!1,x=i.length/3;for(d=0;d<x;d+=4){let b=d,T=d+2,C=h.fromArray(i,b*3,Fte),A=h.fromArray(i,T*3,Bte);if(Math.abs(C.y)<JV)for(C.y=JV*(A.y<0?-1:1),i[d*3+1]=C.y,i[(d+1)*3+1]=C.y,p=b*3;p<b*3+4*3;p+=3)o[p]=i[d*3],o[p+1]=i[d*3+1],o[p+2]=i[d*3+2];if(Math.abs(A.y)<JV)for(A.y=JV*(C.y<0?-1:1),i[(d+2)*3+1]=A.y,i[(d+3)*3+1]=A.y,p=b*3;p<b*3+4*3;p+=3)r[p]=i[(d+2)*3],r[p+1]=i[(d+2)*3+1],r[p+2]=i[(d+2)*3+2];let E=u.attributes,v=u.indices,D=f.attributes,O=f.indices,R=$n.lineSegmentPlane(C,A,Nte,jIe);if(l(R)){m=!0;let M=h.multiplyByScalar(h.UNIT_Y,XIe,qIe);C.y<0&&(h.negate(M,M),E=f.attributes,v=f.indices,D=u.attributes,O=u.indices);let N=h.add(R,M,YIe);E.position.values.push(C.x,C.y,C.z,C.x,C.y,C.z),E.position.values.push(N.x,N.y,N.z),E.position.values.push(N.x,N.y,N.z),E.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),E.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),E.prevPosition.values.push(C.x,C.y,C.z,C.x,C.y,C.z),E.nextPosition.values.push(N.x,N.y,N.z),E.nextPosition.values.push(N.x,N.y,N.z),E.nextPosition.values.push(N.x,N.y,N.z),E.nextPosition.values.push(N.x,N.y,N.z),h.negate(M,M),h.add(R,M,N),D.position.values.push(N.x,N.y,N.z),D.position.values.push(N.x,N.y,N.z),D.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.prevPosition.values.push(N.x,N.y,N.z),D.prevPosition.values.push(N.x,N.y,N.z),D.prevPosition.values.push(N.x,N.y,N.z),D.prevPosition.values.push(N.x,N.y,N.z),D.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.nextPosition.values.push(r[T*3],r[T*3+1],r[T*3+2]),D.nextPosition.values.push(r[T*3+3],r[T*3+4],r[T*3+5]);let _=z.fromArray(s,b*2,Rte),S=Math.abs(_.y);E.expandAndWidth.values.push(-1,S,1,S),E.expandAndWidth.values.push(-1,-S,1,-S),D.expandAndWidth.values.push(-1,S,1,S),D.expandAndWidth.values.push(-1,-S,1,-S);let w=h.magnitudeSquared(h.subtract(R,C,H6));if(w/=h.magnitudeSquared(h.subtract(A,C,H6)),l(c)){let I=oe.fromArray(c,b*4,Ote),L=oe.fromArray(c,T*4,Ote),B=P.lerp(I.x,L.x,w),U=P.lerp(I.y,L.y,w),V=P.lerp(I.z,L.z,w),G=P.lerp(I.w,L.w,w);for(p=b*4;p<b*4+2*4;++p)E.color.values.push(c[p]);for(E.color.values.push(B,U,V,G),E.color.values.push(B,U,V,G),D.color.values.push(B,U,V,G),D.color.values.push(B,U,V,G),p=T*4;p<T*4+2*4;++p)D.color.values.push(c[p])}if(l(a)){let I=z.fromArray(a,b*2,Rte),L=z.fromArray(a,(d+3)*2,WIe),B=P.lerp(I.x,L.x,w);for(p=b*2;p<b*2+2*2;++p)E.st.values.push(a[p]);for(E.st.values.push(B,I.y),E.st.values.push(B,L.y),D.st.values.push(B,I.y),D.st.values.push(B,L.y),p=T*2;p<T*2+2*2;++p)D.st.values.push(a[p])}g=E.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=D.position.values.length/3-4,O.push(g,g+2,g+1),O.push(g+1,g+2,g+3)}else{let M,N;for(C.y<0?(M=f.attributes,N=f.indices):(M=u.attributes,N=u.indices),M.position.values.push(C.x,C.y,C.z),M.position.values.push(C.x,C.y,C.z),M.position.values.push(A.x,A.y,A.z),M.position.values.push(A.x,A.y,A.z),p=d*3;p<d*3+4*3;++p)M.prevPosition.values.push(o[p]),M.nextPosition.values.push(r[p]);for(p=d*2;p<d*2+4*2;++p)M.expandAndWidth.values.push(s[p]),l(a)&&M.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+4*4;++p)M.color.values.push(c[p]);g=M.position.values.length/3-4,N.push(g,g+2,g+1),N.push(g+1,g+2,g+3)}}m&&(Mte(f),Mte(u)),G6(e,f,u)}Uc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ae.intersectPlane(n,an.ORIGIN_ZX_PLANE)!==jt.INTERSECTING))return e;if(t.geometryType!==Tf.NONE)switch(t.geometryType){case Tf.POLYLINES:KIe(e);break;case Tf.TRIANGLES:Ite(e);break;case Tf.LINES:Pte(e);break}else LIe(t),t.primitiveType===Me.TRIANGLES?Ite(e):t.primitiveType===Me.LINES&&Pte(e);return e};var Ln=Uc;function Iw(e,t,n,i,o,r,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(Iw.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});Iw.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,x=this._preMultiplyAlpha,b=this._flipY,T=4;l(f)&&(T=et.alignmentInBytes(p,m,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,T),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let C=!1;if(!this._initialized){let A;t===0&&n===0&&r===d&&s===d?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=et.flipY(f,p,m,d,d)),A=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),A=i),C=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A=et.createTypedArray(p,m,d,d)),a.texImage2D(u,0,g,d,d,0,p,Ke.toWebGLConstant(m,this._context),A),this._initialized=!0}C||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=et.flipY(f,p,m,r,s)),a.texSubImage2D(u,0,t,n,r,s,p,Ke.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),a.texSubImage2D(u,0,t,n,p,Ke.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};Iw.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._size),r=y(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};Iw.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=y(e,0),t=y(t,0),n=y(n,this._size),i=y(i,this._size),o=y(o,0);let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var Pw=Iw;var nU={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===nU.DONT_CARE||e===nU.FASTEST||e===nU.NICEST}},um=Object.freeze(nU);var iU={NEAREST:te.NEAREST,LINEAR:te.LINEAR};iU.validate=function(e){return e===iU.NEAREST||e===iU.LINEAR};var di=Object.freeze(iU);var Hg={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};Hg.validate=function(e){return e===Hg.NEAREST||e===Hg.LINEAR||e===Hg.NEAREST_MIPMAP_NEAREST||e===Hg.LINEAR_MIPMAP_NEAREST||e===Hg.NEAREST_MIPMAP_LINEAR||e===Hg.LINEAR_MIPMAP_LINEAR};var Zt=Object.freeze(Hg);var oU={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===oU.CLAMP_TO_EDGE||e===oU.REPEAT||e===oU.MIRRORED_REPEAT}},Cn=Object.freeze(oU);function Rw(e){e=y(e,y.EMPTY_OBJECT);let{wrapS:t=Cn.CLAMP_TO_EDGE,wrapT:n=Cn.CLAMP_TO_EDGE,minificationFilter:i=Zt.LINEAR,magnificationFilter:o=di.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(Rw.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});Rw.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};Rw.NEAREST=Object.freeze(new Rw({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST}));var $t=Rw;function ZIe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Vte(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Rp(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)ZIe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*X.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),Vte(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=o}function kte(e){return e.values.length/e.componentsPerAttribute}function $Ie(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function QIe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=kte(e[o[0]]),t=1;t<s;++t){let u=kte(e[o[t]]);if(u!==r)throw new re(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return X.getSizeInBytes(e[f].componentDatatype)-X.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=$Ie(i);if(a>0){let u=X.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=r*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=o[t];let m=X.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:X.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<r;++t)for(let m=0;m<s;++m){n=o[m],i=e[n];let x=i.values,b=g[n],T=b.pointer,C=i.componentsPerAttribute;for(let A=0;A<C;++A)T[b.index+A]=x[t*C+A];b.index+=b.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Rp.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Fe.DYNAMIC_DRAW),o=y(e.attributeLocations,y.EMPTY_OBJECT),r=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(r){let m=QIe(d);if(l(m)){u=gt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let x=m.offsetsInBytes,b=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:b}):f.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===X.DOUBLE&&(m=X.FLOAT),u=void 0,l(c.values)&&(u=gt.createVertexBuffer({context:t,typedArray:X.createTypedArray(m,c.values),usage:i})),f.push({index:o[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,g=n.indices;return l(g)&&(at.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=gt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ne.UNSIGNED_INT}):p=gt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ne.UNSIGNED_SHORT})),new Rp({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Rp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Rp.prototype.getAttribute=function(e){return this._attributes[e]};function JIe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Nt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function ePe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&l(r.value)&&r.vertexAttrib(t)}}Rp.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&JIe(this),this._hasConstantAttributes&&ePe(this,this._gl)):Vte(this._gl,this._attributes,this._indexBuffer)};Rp.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};Rp.prototype.isDestroyed=function(){return!1};Rp.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var ei=Rp;function Qo(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=et.RGBA,pixelDatatype:o=Ke.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new $t}=e,c=e.preMultiplyAlpha||i===et.RGB||i===et.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=et.textureSizeInBytes(i,o,d,d)*6,g=et.toInternalFormat(i,o,t),m=t._gl,x=m.TEXTURE_CUBE_MAP,b=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=x,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let T=l(n);function C(A){return new Pw(t,b,x,A,g,i,o,d,c,r,T)}this._positiveX=C(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=C(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=C(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=C(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=C(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=C(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,Ute(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(x,b),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let A of Qo.faceNames())j6(this[A],n?.[A],0);m.bindTexture(x,null)}Qo.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Nr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,y(i,0)),r._unBind(),r.destroy()};Qo.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*tPe(){yield Qo.FaceName.POSITIVEX,yield Qo.FaceName.NEGATIVEX,yield Qo.FaceName.POSITIVEY,yield Qo.FaceName.NEGATIVEY,yield Qo.FaceName.POSITIVEZ,yield Qo.FaceName.NEGATIVEZ}Qo.faceNames=function(){return tPe()};function j6(e,t,n){n=y(n,0);let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,a,o,o,0,r,Ke.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=et.alignmentInBytes(r,s,o)),d.pixelStorei(d.UNPACK_ALIGNMENT,g),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=et.flipY(p,r,s,o,o)),d.texImage2D(i,n,a,o,o,0,r,Ke.toWebGLConstant(s,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,a,r,Ke.toWebGLConstant(s,f),t))}Qo.loadFace=j6;Object.defineProperties(Qo.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){Ute(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});Qo.getDirection=function(e,t){switch(e){case Qo.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case Qo.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case Qo.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case Qo.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case Qo.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case Qo.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function Ute(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Zt.NEAREST_MIPMAP_NEAREST,Zt.NEAREST_MIPMAP_LINEAR,Zt.LINEAR_MIPMAP_NEAREST,Zt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===Ke.FLOAT&&!r.textureFloatLinear||s===Ke.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Zt.NEAREST_MIPMAP_NEAREST:Zt.NEAREST,i=di.NEAREST);let a=r._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}Qo.prototype.loadMipmaps=function(e,t){t=y(t,!1);let n=this._context._gl,i=this._texture,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){let s=e[r],a=r+1;for(let c of Qo.faceNames())j6(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};Qo.prototype.generateMipmap=function(e){e=y(e,um.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Qo.createVertexArray=function(e){let t=Ia.createGeometry(Ia.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Ie.POSITION_ONLY})),n=this._attributeLocations=Ln.createAttributeLocations(t);return ei.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Fe.STATIC_DRAW})};Qo.prototype.isDestroyed=function(){return!1};Qo.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var Cr=Qo;function nPe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var rc=nPe;var Ow=`/** + `;return r=a6(a),new Worker(r,o)}if(r=e,n||(r=en(`${la._workerModulePrefix+i}.js`)),!zt.supportsEsmWebWorkers())throw new re("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function CDe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!zt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new re(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=en(t.fallbackModulePath),n}n.wasmBinaryFile=en(t.wasmBinaryFile);let i=await Se.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function la(e,t){this._workerPath=e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var ADe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new re(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new he(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),c6.raiseEvent(s),i(s)}else c6.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},EDe=[];async function SDe(e,t,n){let i=await Promise.resolve(Kee());l(n)?i||(n.length=0):n=EDe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",ADe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:en.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function vDe(e,t,n){++e._activeTasks;try{let i=await SDe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}la.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=l6(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return vDe(this,e,t)};la.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=l6(this._workerPath),i=await CDe(this,e),o=await Promise.resolve(Kee()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new re("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};la.prototype.isDestroyed=function(){return!1};la.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};la.taskCompletedEvent=c6;la._defaultWorkerModulePrefix="Workers/";la._workerModulePrefix=la._defaultWorkerModulePrefix;la._canTransferArrayBuffer=void 0;var gi=la;function wp(){}wp._transcodeTaskProcessor=new gi("transcodeKTX2",Number.POSITIVE_INFINITY);wp._readyPromise=void 0;function wDe(){let e=wp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return wp._transcodeTaskProcessor;throw new re("KTX2 transcoder could not be initialized.")});wp._readyPromise=e}wp.transcode=function(e,t){return l(wp._readyPromise)||wDe(),wp._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;r<i;r++){let s=n[r];for(let a=0;a<o.length;a++){let c=s[o[a]];s[o[a]]=new bw(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)n[r]=n[r][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var Tw=wp;var Zee;$ee.setKTX2SupportedFormats=function(e,t,n,i,o,r){Zee={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function $ee(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Se.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return Tw.transcode(n,Zee)})}var Il=$ee;function DDe(e,t){this.start=y(e,0),this.stop=y(t,0)}var Pa=DDe;function dn(e,t){this.center=h.clone(y(e,h.ZERO)),this.radius=y(t,0)}var d6=new h,h6=new h,m6=new h,p6=new h,_6=new h,g6=new h,y6=new h,ua=new h,x6=new h,b6=new h,T6=new h,C6=new h,IDe=4/3*P.PI;dn.fromPoints=function(e,t){if(l(t)||(t=new dn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=h.clone(e[0],y6),i=h.clone(n,d6),o=h.clone(n,h6),r=h.clone(n,m6),s=h.clone(n,p6),a=h.clone(n,_6),c=h.clone(n,g6),u=e.length,f;for(f=1;f<u;f++){h.clone(e[f],n);let R=n.x,M=n.y,N=n.z;R<i.x&&h.clone(n,i),R>s.x&&h.clone(n,s),M<o.y&&h.clone(n,o),M>a.y&&h.clone(n,a),N<r.z&&h.clone(n,r),N>c.z&&h.clone(n,c)}let d=h.magnitudeSquared(h.subtract(s,i,ua)),p=h.magnitudeSquared(h.subtract(a,o,ua)),g=h.magnitudeSquared(h.subtract(c,r,ua)),m=i,x=s,b=d;p>b&&(b=p,m=o,x=a),g>b&&(b=g,m=r,x=c);let T=x6;T.x=(m.x+x.x)*.5,T.y=(m.y+x.y)*.5,T.z=(m.z+x.z)*.5;let C=h.magnitudeSquared(h.subtract(x,T,ua)),A=Math.sqrt(C),E=b6;E.x=i.x,E.y=o.y,E.z=r.z;let v=T6;v.x=s.x,v.y=a.y,v.z=c.z;let D=h.midpoint(E,v,C6),O=0;for(f=0;f<u;f++){h.clone(e[f],n);let R=h.magnitude(h.subtract(n,D,ua));R>O&&(O=R);let M=h.magnitudeSquared(h.subtract(n,T,ua));if(M>C){let N=Math.sqrt(M);A=(A+N)*.5,C=A*A;let _=N-A;T.x=(A*T.x+_*n.x)/N,T.y=(A*T.y+_*n.y)/N,T.z=(A*T.z+_*n.z)/N}}return A<O?(h.clone(T,t.center),t.radius=A):(h.clone(D,t.center),t.radius=O),t};var Qee=new Pi,PDe=new h,RDe=new h,u6=new fe,f6=new fe;dn.fromRectangle2D=function(e,t,n){return dn.fromRectangleWithHeights2D(e,t,0,0,n)};dn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new dn),!l(e))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;Qee._ellipsoid=ee.default,t=y(t,Qee),se.southwest(e,u6),u6.height=n,se.northeast(e,f6),f6.height=i;let r=t.project(u6,PDe),s=t.project(f6,RDe),a=s.x-r.x,c=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+c*.5,f.z=r.z+u*.5,o};var ODe=[];dn.fromRectangle3D=function(e,t,n,i){if(t=y(t,ee.default),n=y(n,0),l(i)||(i=new dn),!l(e))return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let o=se.subsample(e,t,n,ODe);return dn.fromPoints(o,i)};dn.fromVertices=function(e,t,n,i){if(l(i)||(i=new dn),!l(e)||e.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;t=y(t,h.ZERO),n=y(n,3);let o=y6;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=h.clone(o,d6),s=h.clone(o,h6),a=h.clone(o,m6),c=h.clone(o,p6),u=h.clone(o,_6),f=h.clone(o,g6),d=e.length,p;for(p=0;p<d;p+=n){let N=e[p]+t.x,_=e[p+1]+t.y,S=e[p+2]+t.z;o.x=N,o.y=_,o.z=S,N<r.x&&h.clone(o,r),N>c.x&&h.clone(o,c),_<s.y&&h.clone(o,s),_>u.y&&h.clone(o,u),S<a.z&&h.clone(o,a),S>f.z&&h.clone(o,f)}let g=h.magnitudeSquared(h.subtract(c,r,ua)),m=h.magnitudeSquared(h.subtract(u,s,ua)),x=h.magnitudeSquared(h.subtract(f,a,ua)),b=r,T=c,C=g;m>C&&(C=m,b=s,T=u),x>C&&(C=x,b=a,T=f);let A=x6;A.x=(b.x+T.x)*.5,A.y=(b.y+T.y)*.5,A.z=(b.z+T.z)*.5;let E=h.magnitudeSquared(h.subtract(T,A,ua)),v=Math.sqrt(E),D=b6;D.x=r.x,D.y=s.y,D.z=a.z;let O=T6;O.x=c.x,O.y=u.y,O.z=f.z;let R=h.midpoint(D,O,C6),M=0;for(p=0;p<d;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let N=h.magnitude(h.subtract(o,R,ua));N>M&&(M=N);let _=h.magnitudeSquared(h.subtract(o,A,ua));if(_>E){let S=Math.sqrt(_);v=(v+S)*.5,E=v*v;let w=S-v;A.x=(v*A.x+w*o.x)/S,A.y=(v*A.y+w*o.y)/S,A.z=(v*A.z+w*o.z)/S}}return v<M?(h.clone(A,i.center),i.radius=v):(h.clone(R,i.center),i.radius=M),i};dn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new dn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=y6;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=h.clone(i,d6),r=h.clone(i,h6),s=h.clone(i,m6),a=h.clone(i,p6),c=h.clone(i,_6),u=h.clone(i,g6),f=e.length,d;for(d=0;d<f;d+=3){let M=e[d]+t[d],N=e[d+1]+t[d+1],_=e[d+2]+t[d+2];i.x=M,i.y=N,i.z=_,M<o.x&&h.clone(i,o),M>a.x&&h.clone(i,a),N<r.y&&h.clone(i,r),N>c.y&&h.clone(i,c),_<s.z&&h.clone(i,s),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,o,ua)),g=h.magnitudeSquared(h.subtract(c,r,ua)),m=h.magnitudeSquared(h.subtract(u,s,ua)),x=o,b=a,T=p;g>T&&(T=g,x=r,b=c),m>T&&(T=m,x=s,b=u);let C=x6;C.x=(x.x+b.x)*.5,C.y=(x.y+b.y)*.5,C.z=(x.z+b.z)*.5;let A=h.magnitudeSquared(h.subtract(b,C,ua)),E=Math.sqrt(A),v=b6;v.x=o.x,v.y=r.y,v.z=s.z;let D=T6;D.x=a.x,D.y=c.y,D.z=u.z;let O=h.midpoint(v,D,C6),R=0;for(d=0;d<f;d+=3){i.x=e[d]+t[d],i.y=e[d+1]+t[d+1],i.z=e[d+2]+t[d+2];let M=h.magnitude(h.subtract(i,O,ua));M>R&&(R=M);let N=h.magnitudeSquared(h.subtract(i,C,ua));if(N>A){let _=Math.sqrt(N);E=(E+_)*.5,A=E*E;let S=_-E;C.x=(E*C.x+S*i.x)/_,C.y=(E*C.y+S*i.y)/_,C.z=(E*C.z+S*i.z)/_}}return E<R?(h.clone(C,n.center),n.radius=E):(h.clone(O,n.center),n.radius=R),n};dn.fromCornerPoints=function(e,t,n){l(n)||(n=new dn);let i=h.midpoint(e,t,n.center);return n.radius=h.distance(i,t),n};dn.fromEllipsoid=function(e,t){return l(t)||(t=new dn),h.clone(h.ZERO,t.center),t.radius=e.maximumRadius,t};var MDe=new h;dn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new dn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return dn.clone(e[0],t);if(n===2)return dn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=dn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,h.distance(r,a.center,MDe)+a.radius)}return t.radius=s,t};var LDe=new h,NDe=new h,FDe=new h;dn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new dn);let n=e.halfAxes,i=$.getColumn(n,0,LDe),o=$.getColumn(n,1,NDe),r=$.getColumn(n,2,FDe);return h.add(i,o,i),h.add(i,r,i),t.center=h.clone(e.center,t.center),t.radius=h.magnitude(i),t};var BDe=new h,kDe=new h;dn.fromTransformation=function(e,t){l(t)||(t=new dn);let n=F.getTranslation(e,BDe),i=F.getScale(e,kDe),o=.5*h.magnitude(i);return t.center=h.clone(n,t.center),t.radius=o,t};dn.clone=function(e,t){if(l(e))return l(t)?(t.center=h.clone(e.center,t.center),t.radius=e.radius,t):new dn(e.center,e.radius)};dn.packedLength=4;dn.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};dn.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new dn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var VDe=new h,UDe=new h;dn.union=function(e,t,n){l(n)||(n=new dn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=h.subtract(r,i,VDe),c=h.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,f=h.multiplyByScalar(a,(-o+u)/c,UDe);return h.add(f,i,f),h.clone(f,n.center),n.radius=u,n};var zDe=new h;dn.expand=function(e,t,n){n=dn.clone(e,n);let i=h.magnitude(h.subtract(t,n.center,zDe));return i>n.radius&&(n.radius=i),n};dn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=h.dot(o,n)+t.distance;return r<-i?Wt.OUTSIDE:r<i?Wt.INTERSECTING:Wt.INSIDE};dn.transform=function(e,t,n){return l(n)||(n=new dn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var HDe=new h;dn.distanceSquaredTo=function(e,t){let n=h.subtract(e.center,t,HDe),i=h.magnitude(n)-e.radius;return i<=0?0:i*i};dn.transformWithoutScale=function(e,t,n){return l(n)||(n=new dn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var GDe=new h;dn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Pa);let o=h.subtract(e.center,t,GDe),r=h.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var Jee=new h,WDe=new h,jDe=new h,qDe=new h,YDe=new h,XDe=new fe,tte=new Array(8);for(let e=0;e<8;++e)tte[e]=new h;var ete=new Pi;dn.projectTo2D=function(e,t,n){ete._ellipsoid=ee.default,t=y(t,ete);let i=t.ellipsoid,o=e.center,r=e.radius,s;h.equals(o,h.ZERO)?s=h.clone(h.UNIT_X,Jee):s=i.geodeticSurfaceNormal(o,Jee);let a=h.cross(h.UNIT_Z,s,WDe);h.normalize(a,a);let c=h.cross(s,a,jDe);h.normalize(c,c),h.multiplyByScalar(s,r,s),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let u=h.negate(c,YDe),f=h.negate(a,qDe),d=tte,p=d[0];h.add(s,c,p),h.add(p,a,p),p=d[1],h.add(s,c,p),h.add(p,f,p),p=d[2],h.add(s,u,p),h.add(p,f,p),p=d[3],h.add(s,u,p),h.add(p,a,p),h.negate(s,s),p=d[4],h.add(s,c,p),h.add(p,a,p),p=d[5],h.add(s,c,p),h.add(p,f,p),p=d[6],h.add(s,u,p),h.add(p,f,p),p=d[7],h.add(s,u,p),h.add(p,a,p);let g=d.length;for(let T=0;T<g;++T){let C=d[T];h.add(o,C,C);let A=i.cartesianToCartographic(C,XDe);t.project(A,C)}n=dn.fromPoints(d,n),o=n.center;let m=o.x,x=o.y,b=o.z;return o.x=b,o.y=m,o.z=x,n};dn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};dn.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&e.radius===t.radius};dn.prototype.intersectPlane=function(e){return dn.intersectPlane(this,e)};dn.prototype.distanceSquaredTo=function(e){return dn.distanceSquaredTo(this,e)};dn.prototype.computePlaneDistances=function(e,t,n){return dn.computePlaneDistances(this,e,t,n)};dn.prototype.isOccluded=function(e){return dn.isOccluded(this,e)};dn.prototype.equals=function(e){return dn.equals(this,e)};dn.prototype.clone=function(e){return dn.clone(this,e)};dn.prototype.volume=function(){let e=this.radius;return IDe*e*e*e};var ae=dn;function KDe(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var un=KDe;var ZDe={NONE:0,TOP:1,ALL:2},on=Object.freeze(ZDe);function ps(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}ps.POSITION_ONLY=Object.freeze(new ps({position:!0}));ps.POSITION_AND_NORMAL=Object.freeze(new ps({position:!0,normal:!0}));ps.POSITION_NORMAL_AND_ST=Object.freeze(new ps({position:!0,normal:!0,st:!0}));ps.POSITION_AND_ST=Object.freeze(new ps({position:!0,st:!0}));ps.POSITION_AND_COLOR=Object.freeze(new ps({position:!0,color:!0}));ps.ALL=Object.freeze(new ps({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ps.DEFAULT=ps.POSITION_NORMAL_AND_ST;ps.packedLength=6;ps.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};ps.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ps),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};ps.clone=function(e,t){if(l(e))return l(t)||(t=new ps),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Ie=ps;var $De=new h;function du(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Ie.DEFAULT);this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}du.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new du({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};du.fromAxisAlignedBoundingBox=function(e){return new du({minimum:e.minimum,maximum:e.maximum})};du.packedLength=2*h.packedLength+Ie.packedLength+1;du.pack=function(e,t,n){return n=y(n,0),h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Ie.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Ie.packedLength]=y(e._offsetAttribute,-1),t};var ite=new h,ote=new h,rte=new Ie,nte={minimum:ite,maximum:ote,vertexFormat:rte,offsetAttribute:void 0};du.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,ite),o=h.unpack(e,t+h.packedLength,ote),r=Ie.unpack(e,t+2*h.packedLength,rte),s=e[t+2*h.packedLength+Ie.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(o,n._maximum),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(nte.offsetAttribute=s===-1?void 0:s,new du(nte))};du.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let o=new un,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=h.subtract(n,t,$De),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===on.NONE?0:1,d=new Uint8Array(u/3).fill(f);o.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new st({attributes:o,indices:r,primitiveType:Me.TRIANGLES,boundingSphere:new ae(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var A6;du.getUnitBox=function(){return l(A6)||(A6=du.createGeometry(du.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),A6};var Ra=du;var no={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};no.getMathType=function(e){switch(e){case no.SCALAR:return Number;case no.VEC2:return z;case no.VEC3:return h;case no.VEC4:return oe;case no.MAT2:return Ri;case no.MAT3:return $;case no.MAT4:return F}};no.getNumberOfComponents=function(e){switch(e){case no.SCALAR:return 1;case no.VEC2:return 2;case no.VEC3:return 3;case no.VEC4:case no.MAT2:return 4;case no.MAT3:return 9;case no.MAT4:return 16}};no.getAttributeLocationCount=function(e){switch(e){case no.SCALAR:case no.VEC2:case no.VEC3:case no.VEC4:return 1;case no.MAT2:return 2;case no.MAT3:return 3;case no.MAT4:return 4}};no.getGlslType=function(e){switch(e){case no.SCALAR:return"float";case no.VEC2:return"vec2";case no.VEC3:return"vec3";case no.VEC4:return"vec4";case no.MAT2:return"mat2";case no.MAT3:return"mat3";case no.MAT4:return"mat4"}};var tn=Object.freeze(no);var ste=1/256,ate=256,To={};To.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(o)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};To.octEncode=function(e,t){return To.octEncodeInRange(e,255,t)};var Cw=new z,cte=new Uint8Array(1);function qV(e){return cte[0]=e,cte[0]}To.octEncodeToCartesian4=function(e,t){return To.octEncodeInRange(e,65535,Cw),t.x=qV(Cw.x*ste),t.y=qV(Cw.x),t.z=qV(Cw.y*ste),t.w=qV(Cw.y),t};To.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*P.signNotZero(o),i.y=(1-Math.abs(o))*P.signNotZero(i.y)}return h.normalize(i,i)};To.octDecode=function(e,t,n){return To.octDecodeInRange(e,t,255,n)};To.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*ate+i,a=o*ate+r;return To.octDecodeInRange(s,a,65535,t)};To.octPackFloat=function(e){return 256*e.x+e.y};var S6=new z;To.octEncodeFloat=function(e){return To.octEncode(e,S6),To.octPackFloat(S6)};To.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return To.octDecode(i,o,t)};To.octPack=function(e,t,n,i){let o=To.octEncodeFloat(e),r=To.octEncodeFloat(t),s=To.octEncode(n,S6);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};To.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;To.octDecodeFloat(s,t),To.octDecodeFloat(c,n),To.octDecode(r,a,i)};To.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};To.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function E6(e){return e>>1^-(e&1)}To.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=E6(e[a]),r+=E6(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=E6(n[a]),n[a]=s)};To.dequantize=function(e,t,n,i){let o=tn.getNumberOfComponents(n),r;switch(t){case X.BYTE:r=127;break;case X.UNSIGNED_BYTE:r=255;break;case X.SHORT:r=32767;break;case X.UNSIGNED_SHORT:r=65535;break;case X.INT:r=2147483647;break;case X.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let u=a*o+c;s[u]=Math.max(e[u]/r,-1)}return s};To.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&o,d=c&i,p=3*a;t[p]=u*r,t[p+1]=f*s,t[p+2]=d*r}return t};var Mn=To;var lte=new h,ute=new h,fte=new h;function QDe(e,t,n,i,o){l(o)||(o=new h);let r,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,lte),s=h.subtract(i,t,ute),a=h.subtract(e,t,fte),c=h.dot(r,r),u=h.dot(r,s),f=h.dot(r,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(z.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,o);if(z.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,o);if(z.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,o);r=z.subtract(n,t,lte),s=z.subtract(i,t,ute),a=z.subtract(e,t,fte),c=z.dot(r,r),u=z.dot(r,s),f=z.dot(r,a),d=z.dot(s,s),p=z.dot(s,a)}o.y=d*f-u*p,o.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var fx=QDe;function am(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}am.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var Dp={high:0,low:0};am.fromCartesian=function(e,t){l(t)||(t=new am);let n=t.high,i=t.low;return am.encode(e.x,Dp),n.x=Dp.high,i.x=Dp.low,am.encode(e.y,Dp),n.y=Dp.high,i.y=Dp.low,am.encode(e.z,Dp),n.z=Dp.high,i.z=Dp.low,t};var v6=new am;am.writeElements=function(e,t,n){am.fromCartesian(e,v6);let i=v6.high,o=v6.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var Hn=am;var w6={};w6.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function dte(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}w6.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<P.EPSILON14)return[0,0];if(c>u&&u/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=dte(o,-r,P.EPSILON14);if(s<0)return[];let a=-.5*dte(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Vc=w6;var I6={};I6.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function D6(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,f=r*r,d=s*s,p=o*s-f,g=o*a-r*s,m=r*a-d,x=4*p*m-g*g,b,T;if(x<0){let W,q,J;f*u>=c*d?(W=o,q=p,J=-2*r*p+o*g):(W=a,q=m,J=-a*g+2*s*m);let K=-(J<0?-1:1)*Math.abs(W)*Math.sqrt(-x);T=-J+K;let Q=T/2,de=Q<0?-Math.pow(-Q,1/3):Math.pow(Q,1/3),xe=T===K?-de:-q/de;return b=q<=0?de+xe:-J/(de*de+xe*xe+q),f*u>=c*d?[(b-r)/o]:[-a/(b+s)]}let C=p,A=-2*r*p+o*g,E=m,v=-a*g+2*s*m,D=Math.sqrt(x),O=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*D,-A)/3);b=2*Math.sqrt(-C);let M=Math.cos(R);T=b*M;let N=b*(-M/2-O*Math.sin(R)),_=T+N>2*r?T-r:N-r,S=o,w=_/S;R=Math.abs(Math.atan2(a*D,-v)/3),b=2*Math.sqrt(-E),M=Math.cos(R),T=b*M,N=b*(-M/2-O*Math.sin(R));let I=-a,L=T+N<2*s?T+s:N+s,B=I/L,U=S*L,V=-_*L-S*I,G=_*I,k=(s*V-r*G)/(-r*V+s*U);return w<=k?w<=B?k<=B?[w,k,B]:[w,B,k]:[B,w,k]:w<=B?[k,w,B]:k<=B?[k,B,w]:[B,k,w]}I6.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Vc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Vc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return D6(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):D6(e,t,0,i);if(i===0)return o=Vc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return D6(e,t,n,i)};var dx=I6;var P6={};P6.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=o*o,m=g*o;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*r*d*d+256*s*m+o*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*r*n*d)+g*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function Rd(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=dx.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let d=Vc.computeRealRoots(1,r,a);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let x=Math.sqrt(p),b=Math.sqrt(g);return[u-b,u-x,u+x,u+b]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(r+f-s/d)/2,g=(r+f+s/d)/2,m=Vc.computeRealRoots(1,d,p),x=Vc.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,x.length!==0?(x[0]+=u,x[1]+=u,m[1]<=x[0]?[m[0],m[1],x[0],x[1]]:x[1]<=m[0]?[x[0],x[1],m[0],m[1]]:m[0]>=x[0]&&m[1]<=x[1]?[x[0],m[0],m[1],x[1]]:x[0]>=m[0]&&x[1]<=m[1]?[m[0],x[0],x[1],m[1]]:m[0]>x[0]&&m[0]<x[1]?[x[0],m[0],x[1],m[1]]:[m[0],x[0],m[1],x[1]]):m):x.length!==0?(x[0]+=u,x[1]+=u,x):[]}}return[]}function Aw(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,u=s*i-n*t*e+o,f=dx.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,x=p/2,b=g-4*i,T=g+4*Math.abs(i),C=s-4*d,A=s+4*Math.abs(d),E,v;if(d<0||b*A<C*T){let S=Math.sqrt(C);E=S/2,v=S===0?0:(e*x-n)/S}else{let S=Math.sqrt(b);E=S===0?0:(e*x-n)/S,v=S/2}let D,O;m===0&&E===0?(D=0,O=0):P.sign(m)===P.sign(E)?(D=m+E,O=d/D):(O=m-E,D=d/O);let R,M;x===0&&v===0?(R=0,M=0):P.sign(x)===P.sign(v)?(R=x+v,M=i/R):(M=x-v,R=i/M);let N=Vc.computeRealRoots(1,D,R),_=Vc.computeRealRoots(1,O,M);if(N.length!==0)return _.length!==0?N[1]<=_[0]?[N[0],N[1],_[0],_[1]]:_[1]<=N[0]?[_[0],_[1],N[0],N[1]]:N[0]>=_[0]&&N[1]<=_[1]?[_[0],N[0],N[1],_[1]]:_[0]>=N[0]&&_[1]<=N[1]?[N[0],_[0],_[1],N[1]]:N[0]>_[0]&&N[0]<_[1]?[_[0],N[0],_[1],N[1]]:[N[0],_[0],N[1],_[1]]:N;if(_.length!==0)return _}return[]}P6.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<P.EPSILON15)return dx.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return Rd(r,s,a,c);case 1:return Aw(r,s,a,c);case 2:return Aw(r,s,a,c);case 3:return Rd(r,s,a,c);case 4:return Rd(r,s,a,c);case 5:return Aw(r,s,a,c);case 6:return Rd(r,s,a,c);case 7:return Rd(r,s,a,c);case 8:return Aw(r,s,a,c);case 9:return Rd(r,s,a,c);case 10:return Rd(r,s,a,c);case 11:return Aw(r,s,a,c);case 12:return Rd(r,s,a,c);case 13:return Rd(r,s,a,c);case 14:return Rd(r,s,a,c);case 15:return Rd(r,s,a,c);default:return}};var Ew=P6;function YV(e,t){t=h.clone(y(t,h.ZERO)),h.equals(t,h.ZERO)||h.normalize(t,t),this.origin=h.clone(y(e,h.ZERO)),this.direction=t}YV.clone=function(e,t){if(l(e))return l(t)?(t.origin=h.clone(e.origin),t.direction=h.clone(e.direction),t):new YV(e.origin,e.direction)};YV.getPoint=function(e,t,n){return l(n)||(n=new h),n=h.multiplyByScalar(e.direction,t,n),h.add(e.origin,n,n)};var hn=YV;var Go={};Go.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,o=e.direction,r=t.normal,s=h.dot(r,o);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-h.dot(r,i))/s;if(!(a<0))return n=h.multiplyByScalar(o,a,n),h.add(i,n,n)};var JDe=new h,eIe=new h,bte=new h,hte=new h,mte=new h;Go.rayTriangleParametric=function(e,t,n,i,o){o=y(o,!1);let r=e.origin,s=e.direction,a=h.subtract(n,t,JDe),c=h.subtract(i,t,eIe),u=h.cross(s,c,bte),f=h.dot(a,u),d,p,g,m,x;if(o){if(f<P.EPSILON6||(d=h.subtract(r,t,hte),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,mte),m=h.dot(s,p),m<0||g+m>f))return;x=h.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let b=1/f;if(d=h.subtract(r,t,hte),g=h.dot(d,u)*b,g<0||g>1||(p=h.cross(d,a,mte),m=h.dot(s,p)*b,m<0||g+m>1))return;x=h.dot(c,p)*b}return x};Go.rayTriangle=function(e,t,n,i,o,r){let s=Go.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new h),h.multiplyByScalar(e.direction,s,r),h.add(e.origin,r,r)};var tIe=new hn;Go.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=tIe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=Go.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function nIe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var iIe={root0:0,root1:0};function Tte(e,t,n){l(n)||(n=new Pa);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=h.subtract(i,r,bte),c=h.dot(o,o),u=2*h.dot(o,a),f=h.magnitudeSquared(a)-s,d=nIe(c,u,f,iIe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Go.raySphere=function(e,t,n){if(n=Tte(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var oIe=new hn;Go.lineSegmentSphere=function(e,t,n,i){let o=oIe;h.clone(e,o.origin);let r=h.subtract(t,e,o.direction),s=h.magnitude(r);if(h.normalize(r,r),i=Tte(o,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var rIe=new h,sIe=new h;Go.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,rIe),o=h.multiplyComponents(n,e.direction,sIe),r=h.magnitudeSquared(i),s=h.dot(i,o),a,c,u,f,d;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=h.magnitudeSquared(o),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,x=a/d;return m<x?new Pa(m,x):{start:x,stop:m}}let g=Math.sqrt(a/c);return new Pa(g,g)}else if(r<1)return a=r-1,c=h.magnitudeSquared(o),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Pa(0,d/c);if(s<0)return c=h.magnitudeSquared(o),new Pa(0,-s/c)};function hx(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Go.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=o*(i*hx(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*hx(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],P.EPSILON15),d=o*(i*hx(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Vc.computeRealRoots(a,c,u),p.length===0)return g;let R=p[0],M=Math.sqrt(Math.max(1-R*R,0));if(g.push(new h(i,o*R,o*-M)),g.push(new h(i,o*R,o*M)),p.length===2){let N=p[1],_=Math.sqrt(Math.max(1-N*N,0));g.push(new h(i,o*N,o*-_)),g.push(new h(i,o*N,o*_))}return g}let m=d*d,x=f*f,b=a*a,T=d*f,C=b+x,A=2*(c*a+T),E=2*u*a+c*c-x+m,v=2*(u*c-T),D=u*u-m;if(C===0&&A===0&&E===0&&v===0)return g;p=Ew.computeRealRoots(C,A,E,v,D);let O=p.length;if(O===0)return g;for(let R=0;R<O;++R){let M=p[R],N=M*M,_=Math.max(1-N,0),S=Math.sqrt(_),w;P.sign(a)===P.sign(u)?w=hx(a*N+u,c*M,P.EPSILON12):P.sign(u)===P.sign(c*M)?w=hx(a*N,c*M+u,P.EPSILON12):w=hx(a*N+c*M,u,P.EPSILON12);let I=hx(f*M,d,P.EPSILON15),L=w*I;L<0?g.push(new h(i,o*M,o*S)):L>0?g.push(new h(i,o*M,o*-S)):S!==0?(g.push(new h(i,o*M,o*-S)),g.push(new h(i,o*M,o*S)),++R):g.push(new h(i,o*M,o*S))}return g};var R6=new h,pte=new h,_te=new h,XV=new h,aIe=new h,cIe=new $,lIe=new $,uIe=new $,fIe=new $,dIe=new $,gte=new $,yte=new $,xte=new h,hIe=new h,mIe=new fe;Go.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let D=t.geodeticSurfaceNormal(n,R6);if(h.dot(i,D)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,R6),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,XV),c=h.normalize(h.cross(a,s,pte),pte),u=h.normalize(h.cross(s,c,_te),_te),f=cIe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,lIe),p=$.fromScale(t.radii,uIe),g=$.fromScale(t.oneOverRadii,fIe),m=dIe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let x=$.multiply($.multiply(d,g,gte),m,gte),b=$.multiply($.multiply(x,p,yte),f,yte),T=$.multiplyByVector(x,n,aIe),C=Go.quadraticVectorExpression(b,h.negate(T,R6),0,0,1),A,E,v=C.length;if(v>0){let D=h.clone(h.ZERO,hIe),O=Number.NEGATIVE_INFINITY;for(let M=0;M<v;++M){A=$.multiplyByVector(p,$.multiplyByVector(f,C[M],xte),xte);let N=h.normalize(h.subtract(A,n,XV),XV),_=h.dot(N,i);_>O&&(O=_,D=h.clone(A,D))}let R=t.cartesianToCartographic(D,mIe);return O=P.clamp(O,0,1),E=h.magnitude(h.subtract(D,n,XV))*Math.sqrt(1-O*O),E=o?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var pIe=new h;Go.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,pIe),r=n.normal,s=h.dot(r,o);if(Math.abs(s)<P.EPSILON6)return;let a=h.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};Go.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=h.dot(o,e)+r<0,a=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return Go.lineSegmentPlane(e,t,i,f),Go.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Go.lineSegmentPlane(t,n,i,f),Go.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Go.lineSegmentPlane(n,e,i,f),Go.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return Go.lineSegmentPlane(e,n,i,f),Go.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Go.lineSegmentPlane(n,t,i,f),Go.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Go.lineSegmentPlane(t,e,i,f),Go.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var $n=Go;function Us(e,t){this.normal=h.clone(e),this.distance=t}Us.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Us(t,i)};var _Ie=new h;Us.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,_Ie),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Us(n,i)};Us.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var gIe=new h;Us.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Us.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,gIe);return h.subtract(t,o,n)};var yIe=new F,xIe=new oe,bIe=new h;Us.transform=function(e,t,n){let i=e.normal,o=e.distance,r=F.inverseTranspose(t,yIe),s=oe.fromElements(i.x,i.y,i.z,o,xIe);s=F.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,bIe);return s=oe.divideByScalar(s,h.magnitude(a),s),Us.fromCartesian4(s,n)};Us.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Us(e.normal,e.distance)};Us.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Us.ORIGIN_XY_PLANE=Object.freeze(new Us(h.UNIT_Z,0));Us.ORIGIN_YZ_PLANE=Object.freeze(new Us(h.UNIT_X,0));Us.ORIGIN_ZX_PLANE=Object.freeze(new Us(h.UNIT_Y,0));var rn=Us;var O6={};O6.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};O6.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(_,S,w,I){for(;S.length>=1;){let L=S[S.length-1];if(S.splice(S.length-1,1),_[L].numLiveTriangles>0)return L}for(;o<I;){if(_[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(_,S,w,I,L,B,U){let V=-1,G,k=-1,W=0;for(;W<w.length;){let q=w[W];I[q].numLiveTriangles&&(G=0,L-I[q].timeStamp+2*I[q].numLiveTriangles<=S&&(G=L-I[q].timeStamp),(G>k||k===-1)&&(k=G,V=q)),++W}return V===-1?r(I,B,_,U):V}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let x=0,b=i+1;o=1;let T=[],C=[],A,E,v=0,D=[],O=a/3,R=[];for(g=0;g<O;g++)R[g]=!1;let M,N;for(;x!==-1;){T=[],E=p[x],N=E.vertexTriangles.length;for(let _=0;_<N;++_)if(m=E.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let S=0;S<3;++S)M=t[u],T.push(M),C.push(M),D[v]=M,++v,A=p[M],--A.numLiveTriangles,b-A.timeStamp>i&&(A.timeStamp=b,++b),++u}x=s(t,i,T,p,b,C,c)}return D};var Sw=O6;var Uc={};function tU(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function TIe(e){let t=e.length,n=t/3*6,i=Ne.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)tU(i,o,e[r],e[r+1],e[r+2]);return i}function CIe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ne.createTypedArray(t,n);tU(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)tU(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function AIe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ne.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)tU(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Uc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Me.TRIANGLES:e.indices=TIe(t);break;case Me.TRIANGLE_STRIP:e.indices=CIe(t);break;case Me.TRIANGLE_FAN:e.indices=AIe(t);break}e.primitiveType=Me.LINES}return e};Uc.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ae(u.center,u.radius+n)),new st({attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Me.LINES,boundingSphere:c})};Uc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];l(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=o++);return i};Uc.reorderForPreVertexCache=function(e){let t=st.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Ne.createTypedArray(t,r),a=0,c=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[c]=f:(f=o[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,x=0,b=g.componentsPerAttribute,T=X.createTypedArray(g.componentDatatype,u*b);for(;x<t;){let C=i[x];if(C!==-1)for(let A=0;A<b;A++)T[b*C+A]=m[b*x+A];++x}g.values=T}}return e};Uc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Me.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=Sw.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Cte(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new ve({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function EIe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}Uc.fitToUnsignedShortIndices=function(e){let t=[],n=st.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Cte(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Me.TRIANGLES?u=3:e.primitiveType===Me.LINES?u=2:e.primitiveType===Me.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=r++,i[p]=g,EIe(s,e.attributes,p)),o.push(g)}r+u>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new st({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Cte(e.attributes))}o.length!==0&&t.push(new st({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Ate=new h,SIe=new fe;Uc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Pi;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,Ate),p=s.cartesianToCartographic(d,SIe),g=o.project(p,Ate);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=r,e.attributes[i]=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var M6={high:0,low:0};Uc.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Hn.encode(r[f],M6),a[f]=M6.high,c[f]=M6.low;let u=o.componentsPerAttribute;return e.attributes[n]=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var Md=new h;function L6(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,Md),F.multiplyByPoint(e,Md,Md),h.pack(Md,n,o)}}function N6(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,Md),$.multiplyByVector(e,Md,Md),Md=h.normalize(Md,Md),h.pack(Md,n,o)}}var KV=new F,ZV=new $;Uc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;L6(t,n.position),L6(t,n.prevPosition),L6(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(F.inverse(t,KV),F.transpose(KV,KV),F.getMatrix3(KV,ZV),N6(ZV,n.normal),N6(ZV,n.tangent),N6(ZV,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ae.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function vIe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[r]=new ve({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:X.createTypedArray(s.componentDatatype,a)}))}return i}var wIe=new h;function F6(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=vIe(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,g=p.length,r=0;r<g;++r)d[s++]=p[r];let m;if(c){let C=0;for(o=0;o<n;++o)C+=e[o][t].indices.length;let A=st.computeNumberOfVertices(new st({attributes:f,primitiveType:Me.POINTS})),E=Ne.createTypedArray(A,C),v=0,D=0;for(o=0;o<n;++o){let O=e[o][t].indices,R=O.length;for(s=0;s<R;++s)E[v++]=D+O[s];D+=st.computeNumberOfVertices(e[o][t])}m=E}let x=new h,b=0,T;for(o=0;o<n;++o){if(T=e[o][t].boundingSphere,!l(T)){x=void 0;break}h.add(T.center,x,x)}if(l(x))for(h.divideByScalar(x,n,x),o=0;o<n;++o){T=e[o][t].boundingSphere;let C=h.magnitude(h.subtract(T.center,x,wIe))+T.radius;C>b&&(b=C)}return new st({attributes:f,indices:m,primitiveType:u,boundingSphere:l(x)?new ae(x,b):void 0})}Uc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(F6(t,"geometry")),n.length>0&&(o.push(F6(n,"westHemisphereGeometry")),o.push(F6(n,"eastHemisphereGeometry"))),o};var Tf=new h,vw=new h,QC=new h,JC=new h;Uc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],x=t[u+1],b=t[u+2],T=m*3,C=x*3,A=b*3;vw.x=i[T],vw.y=i[T+1],vw.z=i[T+2],QC.x=i[C],QC.y=i[C+1],QC.z=i[C+2],JC.x=i[A],JC.y=i[A+1],JC.z=i[A+2],s[m].count++,s[x].count++,s[b].count++,h.subtract(QC,vw,QC),h.subtract(JC,vw,JC),a[f]=h.cross(QC,JC,new h),f++}let d=0;for(u=0;u<o;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<r;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,Tf),p.count>0){for(f=0;f<p.count;f++)h.add(Tf,a[c[p.indexOffset+f]],Tf);h.equalsEpsilon(h.ZERO,Tf,P.EPSILON10)&&h.clone(a[c[p.indexOffset]],Tf)}h.equalsEpsilon(h.ZERO,Tf,P.EPSILON10)&&(Tf.z=1),h.normalize(Tf,Tf),g[m]=Tf.x,g[m+1]=Tf.y,g[m+2]=Tf.z}return e.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e};var DIe=new h,Ete=new h,IIe=new h;Uc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let x=n[u],b=n[u+1],T=n[u+2];f=x*3,d=b*3,p=T*3;let C=x*2,A=b*2,E=T*2,v=i[f],D=i[f+1],O=i[f+2],R=r[C],M=r[C+1],N=r[A+1]-M,_=r[E+1]-M,S=1/((r[A]-R)*_-(r[E]-R)*N),w=(_*(i[d]-v)-N*(i[p]-v))*S,I=(_*(i[d+1]-D)-N*(i[p+1]-D))*S,L=(_*(i[d+2]-O)-N*(i[p+2]-O))*S;c[f]+=w,c[f+1]+=I,c[f+2]+=L,c[d]+=w,c[d+1]+=I,c[d+2]+=L,c[p]+=w,c[p+1]+=I,c[p+2]+=L}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let x=h.fromArray(o,f,DIe),b=h.fromArray(c,f,IIe),T=h.dot(x,b);h.multiplyByScalar(x,T,Ete),h.normalize(h.subtract(b,Ete,b),b),g[f]=b.x,g[d]=b.y,g[p]=b.z,h.normalize(h.cross(x,b,b),b),m[f]=b.x,m[d]=b.y,m[p]=b.z}return e.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m}),e};var ww=new z,Od=new h,Ste=new h,vte=new h,$V=new z;Uc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let D=t.values;i=D.length/3;let O=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(h.fromArray(D,n*3,Od),h.equals(Od,h.ZERO)){R+=2;continue}$V=Mn.octEncodeInRange(Od,65535,$V),O[R++]=$V.x,O[R++]=$V.y}return e.attributes.compressedAttributes=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:O}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,x;s&&(p=o.values),a&&(g=r.values),f&&(m=c.values),d&&(x=u.values),i=(s?p.length:g.length)/(s?3:2);let C=i,A=a&&s?2:1;A+=f||d?1:0,C*=A;let E=new Float32Array(C),v=0;for(n=0;n<i;++n){a&&(z.fromArray(g,n*2,ww),E[v++]=Mn.compressTextureCoordinates(ww));let D=n*3;s&&l(m)&&l(x)?(h.fromArray(p,D,Od),h.fromArray(m,D,Ste),h.fromArray(x,D,vte),Mn.octPack(Od,Ste,vte,ww),E[v++]=ww.x,E[v++]=ww.y):(s&&(h.fromArray(p,D,Od),E[v++]=Mn.octEncodeFloat(Od)),f&&(h.fromArray(m,D,Od),E[v++]=Mn.octEncodeFloat(Od)),d&&(h.fromArray(x,D,Od),E[v++]=Mn.octEncodeFloat(Od)))}return e.attributes.compressedAttributes=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:A,values:E}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function PIe(e){if(l(e.indices))return e;let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function RIe(e){let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function OIe(e){let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function MIe(e){if(l(e.indices))return e;let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function LIe(e){let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Me.LINES,e}function NIe(e){let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Me.LINES,e}function FIe(e){switch(e.primitiveType){case Me.TRIANGLE_FAN:return RIe(e);case Me.TRIANGLE_STRIP:return OIe(e);case Me.TRIANGLES:return PIe(e);case Me.LINE_STRIP:return LIe(e);case Me.LINE_LOOP:return NIe(e);case Me.LINES:return MIe(e)}return e}function Ug(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function BIe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Ug(e,e.y<0),Ug(t,t.y<0),Ug(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=P.sign(e.y):s=P.sign(n.y):o>r?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;Ug(e,a),Ug(t,a),Ug(n,a)}var wte=new h;function Cf(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,wte),e.y/(e.y-t.y),wte),n),h.clone(n,i),Ug(n,!0),Ug(i,!1)}var mx=new h,px=new h,_x=new h,gx=new h,B6={positions:new Array(7),indices:new Array(3*3)};function kIe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;BIe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=B6.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Cf(e,t,mx,_x),Cf(e,n,px,gx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Cf(t,n,mx,_x),Cf(t,e,px,gx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Cf(n,e,mx,_x),Cf(n,t,px,gx),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Cf(n,e,mx,_x),Cf(n,t,px,gx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Cf(t,n,mx,_x),Cf(t,e,px,gx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Cf(e,t,mx,_x),Cf(e,n,px,gx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=B6.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=mx,c[4]=px,c[5]=_x,c[6]=gx,c.length=7),B6}function Dte(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=X.createTypedArray(r.componentDatatype,r.values)}let i=st.computeNumberOfVertices(e);return e.indices=Ne.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function tA(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new ve({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new st({attributes:n,indices:[],primitiveType:e.primitiveType})}function z6(e,t,n){let i=l(e.geometry.boundingSphere);t=Dte(t,i),n=Dte(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function H6(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,f,d,p){let g=e.fromArray(u,r*t,n),m=e.fromArray(u,s*t,i),x=e.fromArray(u,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(x,c.z,x);let b=e.add(g,m,g);e.add(b,x,b),p&&e.normalize(b,b),e.pack(b,f,d*t)}}var VIe=H6(oe,4),eU=H6(h,3),Lte=H6(z,2),UIe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>P.EPSILON6?1:0},Dw=new h,k6=new h,V6=new h,zIe=new h;function QV(e,t,n,i,o,r,s,a,c,u,f,d,p,g,m,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let b=h.fromArray(o,e*3,Dw),T=h.fromArray(o,t*3,k6),C=h.fromArray(o,n*3,V6),A=fx(i,b,T,C,zIe);if(l(A)){if(l(r)&&eU(e,t,n,A,r,d.normal.values,x,!0),l(u)){let E=h.fromArray(u,e*3,Dw),v=h.fromArray(u,t*3,k6),D=h.fromArray(u,n*3,V6);h.multiplyByScalar(E,A.x,E),h.multiplyByScalar(v,A.y,v),h.multiplyByScalar(D,A.z,D);let O;!h.equals(E,h.ZERO)||!h.equals(v,h.ZERO)||!h.equals(D,h.ZERO)?(O=h.add(E,v,E),h.add(O,D,O),h.normalize(O,O)):(O=Dw,O.x=0,O.y=0,O.z=0),h.pack(O,d.extrudeDirection.values,x*3)}if(l(f)&&UIe(e,t,n,A,f,d.applyOffset.values,x),l(s)&&eU(e,t,n,A,s,d.tangent.values,x,!0),l(a)&&eU(e,t,n,A,a,d.bitangent.values,x,!0),l(c)&&Lte(e,t,n,A,c,d.st.values,x),g>0)for(let E=0;E<g;E++){let v=p[E];HIe(e,t,n,A,x,m[v],d[v])}}}function HIe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,u=s.values;switch(a){case 4:VIe(e,t,n,i,c,u,o,!1);break;case 3:eU(e,t,n,i,c,u,o,!1);break;case 2:Lte(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function cm(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var GIe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Ite(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let O in n)n.hasOwnProperty(O)&&!GIe[O]&&l(n[O])&&d.push(O);let p=d.length,g=tA(t),m=tA(t),x,b,T,C,A,E=[];E.length=i.length/3;let v=[];for(v.length=i.length/3,A=0;A<E.length;++A)E[A]=-1,v[A]=-1;let D=f.length;for(A=0;A<D;A+=3){let O=f[A],R=f[A+1],M=f[A+2],N=h.fromArray(i,O*3),_=h.fromArray(i,R*3),S=h.fromArray(i,M*3),w=kIe(N,_,S);if(l(w)&&w.positions.length>3){let I=w.positions,L=w.indices,B=L.length;for(let U=0;U<B;++U){let V=L[U],G=I[V];G.y<0?(x=m.attributes,b=m.indices,T=E):(x=g.attributes,b=g.indices,T=v),C=cm(x,b,T,f,V<3?A+V:-1,G),QV(O,R,M,G,i,o,s,r,a,c,u,x,d,p,n,C)}}else l(w)&&(N=w.positions[0],_=w.positions[1],S=w.positions[2]),N.y<0?(x=m.attributes,b=m.indices,T=E):(x=g.attributes,b=g.indices,T=v),C=cm(x,b,T,f,A,N),QV(O,R,M,N,i,o,s,r,a,c,u,x,d,p,n,C),C=cm(x,b,T,f,A+1,_),QV(O,R,M,_,i,o,s,r,a,c,u,x,d,p,n,C),C=cm(x,b,T,f,A+2,S),QV(O,R,M,S,i,o,s,r,a,c,u,x,d,p,n,C)}z6(e,m,g)}var Nte=rn.fromPointNormal(h.ZERO,h.UNIT_Y),WIe=new h,jIe=new h;function eA(e,t,n,i,o,r,s){if(!l(s))return;let a=h.fromArray(i,e*3,Dw);h.equalsEpsilon(a,n,P.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function Pte(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=tA(t),a=tA(t),c,u=r.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=r[c],g=r[c+1],m=h.fromArray(i,p*3,Dw),x=h.fromArray(i,g*3,k6),b;Math.abs(m.y)<P.EPSILON6&&(m.y<0?m.y=-P.EPSILON6:m.y=P.EPSILON6),Math.abs(x.y)<P.EPSILON6&&(x.y<0?x.y=-P.EPSILON6:x.y=P.EPSILON6);let T=s.attributes,C=s.indices,A=d,E=a.attributes,v=a.indices,D=f,O=$n.lineSegmentPlane(m,x,Nte,V6);if(l(O)){let R=h.multiplyByScalar(h.UNIT_Y,5*P.EPSILON9,WIe);m.y<0&&(h.negate(R,R),T=a.attributes,C=a.indices,A=f,E=s.attributes,v=s.indices,D=d);let M=h.add(O,R,jIe);b=cm(T,C,A,r,c,m),eA(p,g,m,i,b,T,o),b=cm(T,C,A,r,-1,M),eA(p,g,M,i,b,T,o),h.negate(R,R),h.add(O,R,M),b=cm(E,v,D,r,-1,M),eA(p,g,M,i,b,E,o),b=cm(E,v,D,r,c+1,x),eA(p,g,x,i,b,E,o)}else{let R,M,N;m.y<0?(R=a.attributes,M=a.indices,N=f):(R=s.attributes,M=s.indices,N=d),b=cm(R,M,N,r,c,m),eA(p,g,m,i,b,R,o),b=cm(R,M,N,r,c+1,x),eA(p,g,x,i,b,R,o)}}z6(e,a,s)}var Rte=new z,qIe=new z,Fte=new h,Bte=new h,U6=new h,YIe=new h,XIe=new h,KIe=new h,Ote=new oe;function Mte(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=h.unpack(n,s,Fte);if(a.x>0)continue;let c=h.unpack(i,s,Bte);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let u=h.unpack(o,s,U6);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):h.pack(a,o,s))}}var ZIe=5*P.EPSILON9,JV=P.EPSILON6;function $Ie(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=tA(t),f=tA(t),d,p,g,m=!1,x=i.length/3;for(d=0;d<x;d+=4){let b=d,T=d+2,C=h.fromArray(i,b*3,Fte),A=h.fromArray(i,T*3,Bte);if(Math.abs(C.y)<JV)for(C.y=JV*(A.y<0?-1:1),i[d*3+1]=C.y,i[(d+1)*3+1]=C.y,p=b*3;p<b*3+4*3;p+=3)o[p]=i[d*3],o[p+1]=i[d*3+1],o[p+2]=i[d*3+2];if(Math.abs(A.y)<JV)for(A.y=JV*(C.y<0?-1:1),i[(d+2)*3+1]=A.y,i[(d+3)*3+1]=A.y,p=b*3;p<b*3+4*3;p+=3)r[p]=i[(d+2)*3],r[p+1]=i[(d+2)*3+1],r[p+2]=i[(d+2)*3+2];let E=u.attributes,v=u.indices,D=f.attributes,O=f.indices,R=$n.lineSegmentPlane(C,A,Nte,YIe);if(l(R)){m=!0;let M=h.multiplyByScalar(h.UNIT_Y,ZIe,XIe);C.y<0&&(h.negate(M,M),E=f.attributes,v=f.indices,D=u.attributes,O=u.indices);let N=h.add(R,M,KIe);E.position.values.push(C.x,C.y,C.z,C.x,C.y,C.z),E.position.values.push(N.x,N.y,N.z),E.position.values.push(N.x,N.y,N.z),E.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),E.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),E.prevPosition.values.push(C.x,C.y,C.z,C.x,C.y,C.z),E.nextPosition.values.push(N.x,N.y,N.z),E.nextPosition.values.push(N.x,N.y,N.z),E.nextPosition.values.push(N.x,N.y,N.z),E.nextPosition.values.push(N.x,N.y,N.z),h.negate(M,M),h.add(R,M,N),D.position.values.push(N.x,N.y,N.z),D.position.values.push(N.x,N.y,N.z),D.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.prevPosition.values.push(N.x,N.y,N.z),D.prevPosition.values.push(N.x,N.y,N.z),D.prevPosition.values.push(N.x,N.y,N.z),D.prevPosition.values.push(N.x,N.y,N.z),D.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.nextPosition.values.push(r[T*3],r[T*3+1],r[T*3+2]),D.nextPosition.values.push(r[T*3+3],r[T*3+4],r[T*3+5]);let _=z.fromArray(s,b*2,Rte),S=Math.abs(_.y);E.expandAndWidth.values.push(-1,S,1,S),E.expandAndWidth.values.push(-1,-S,1,-S),D.expandAndWidth.values.push(-1,S,1,S),D.expandAndWidth.values.push(-1,-S,1,-S);let w=h.magnitudeSquared(h.subtract(R,C,U6));if(w/=h.magnitudeSquared(h.subtract(A,C,U6)),l(c)){let I=oe.fromArray(c,b*4,Ote),L=oe.fromArray(c,T*4,Ote),B=P.lerp(I.x,L.x,w),U=P.lerp(I.y,L.y,w),V=P.lerp(I.z,L.z,w),G=P.lerp(I.w,L.w,w);for(p=b*4;p<b*4+2*4;++p)E.color.values.push(c[p]);for(E.color.values.push(B,U,V,G),E.color.values.push(B,U,V,G),D.color.values.push(B,U,V,G),D.color.values.push(B,U,V,G),p=T*4;p<T*4+2*4;++p)D.color.values.push(c[p])}if(l(a)){let I=z.fromArray(a,b*2,Rte),L=z.fromArray(a,(d+3)*2,qIe),B=P.lerp(I.x,L.x,w);for(p=b*2;p<b*2+2*2;++p)E.st.values.push(a[p]);for(E.st.values.push(B,I.y),E.st.values.push(B,L.y),D.st.values.push(B,I.y),D.st.values.push(B,L.y),p=T*2;p<T*2+2*2;++p)D.st.values.push(a[p])}g=E.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=D.position.values.length/3-4,O.push(g,g+2,g+1),O.push(g+1,g+2,g+3)}else{let M,N;for(C.y<0?(M=f.attributes,N=f.indices):(M=u.attributes,N=u.indices),M.position.values.push(C.x,C.y,C.z),M.position.values.push(C.x,C.y,C.z),M.position.values.push(A.x,A.y,A.z),M.position.values.push(A.x,A.y,A.z),p=d*3;p<d*3+4*3;++p)M.prevPosition.values.push(o[p]),M.nextPosition.values.push(r[p]);for(p=d*2;p<d*2+4*2;++p)M.expandAndWidth.values.push(s[p]),l(a)&&M.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+4*4;++p)M.color.values.push(c[p]);g=M.position.values.length/3-4,N.push(g,g+2,g+1),N.push(g+1,g+2,g+3)}}m&&(Mte(f),Mte(u)),z6(e,f,u)}Uc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ae.intersectPlane(n,rn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING))return e;if(t.geometryType!==bf.NONE)switch(t.geometryType){case bf.POLYLINES:$Ie(e);break;case bf.TRIANGLES:Ite(e);break;case bf.LINES:Pte(e);break}else FIe(t),t.primitiveType===Me.TRIANGLES?Ite(e):t.primitiveType===Me.LINES&&Pte(e);return e};var Ln=Uc;function Iw(e,t,n,i,o,r,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(Iw.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});Iw.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,x=this._preMultiplyAlpha,b=this._flipY,T=4;l(f)&&(T=et.alignmentInBytes(p,m,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,T),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let C=!1;if(!this._initialized){let A;t===0&&n===0&&r===d&&s===d?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=et.flipY(f,p,m,d,d)),A=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),A=i),C=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A=et.createTypedArray(p,m,d,d)),a.texImage2D(u,0,g,d,d,0,p,Ke.toWebGLConstant(m,this._context),A),this._initialized=!0}C||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=et.flipY(f,p,m,r,s)),a.texSubImage2D(u,0,t,n,r,s,p,Ke.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),a.texSubImage2D(u,0,t,n,p,Ke.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};Iw.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._size),r=y(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};Iw.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=y(e,0),t=y(t,0),n=y(n,this._size),i=y(i,this._size),o=y(o,0);let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var Pw=Iw;var nU={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===nU.DONT_CARE||e===nU.FASTEST||e===nU.NICEST}},lm=Object.freeze(nU);var iU={NEAREST:te.NEAREST,LINEAR:te.LINEAR};iU.validate=function(e){return e===iU.NEAREST||e===iU.LINEAR};var di=Object.freeze(iU);var zg={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};zg.validate=function(e){return e===zg.NEAREST||e===zg.LINEAR||e===zg.NEAREST_MIPMAP_NEAREST||e===zg.LINEAR_MIPMAP_NEAREST||e===zg.NEAREST_MIPMAP_LINEAR||e===zg.LINEAR_MIPMAP_LINEAR};var Kt=Object.freeze(zg);var oU={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===oU.CLAMP_TO_EDGE||e===oU.REPEAT||e===oU.MIRRORED_REPEAT}},Cn=Object.freeze(oU);function Rw(e){e=y(e,y.EMPTY_OBJECT);let{wrapS:t=Cn.CLAMP_TO_EDGE,wrapT:n=Cn.CLAMP_TO_EDGE,minificationFilter:i=Kt.LINEAR,magnificationFilter:o=di.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(Rw.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});Rw.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};Rw.NEAREST=Object.freeze(new Rw({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Kt.NEAREST,magnificationFilter:di.NEAREST}));var Zt=Rw;function QIe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Vte(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Ip(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)QIe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*X.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),Vte(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=o}function kte(e){return e.values.length/e.componentsPerAttribute}function JIe(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function ePe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=kte(e[o[0]]),t=1;t<s;++t){let u=kte(e[o[t]]);if(u!==r)throw new re(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return X.getSizeInBytes(e[f].componentDatatype)-X.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=JIe(i);if(a>0){let u=X.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=r*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=o[t];let m=X.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:X.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<r;++t)for(let m=0;m<s;++m){n=o[m],i=e[n];let x=i.values,b=g[n],T=b.pointer,C=i.componentsPerAttribute;for(let A=0;A<C;++A)T[b.index+A]=x[t*C+A];b.index+=b.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Ip.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Fe.DYNAMIC_DRAW),o=y(e.attributeLocations,y.EMPTY_OBJECT),r=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(r){let m=ePe(d);if(l(m)){u=_t.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let x=m.offsetsInBytes,b=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:b}):f.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===X.DOUBLE&&(m=X.FLOAT),u=void 0,l(c.values)&&(u=_t.createVertexBuffer({context:t,typedArray:X.createTypedArray(m,c.values),usage:i})),f.push({index:o[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,g=n.indices;return l(g)&&(st.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=_t.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ne.UNSIGNED_INT}):p=_t.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ne.UNSIGNED_SHORT})),new Ip({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Ip.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Ip.prototype.getAttribute=function(e){return this._attributes[e]};function tPe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Lt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function nPe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&l(r.value)&&r.vertexAttrib(t)}}Ip.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&tPe(this),this._hasConstantAttributes&&nPe(this,this._gl)):Vte(this._gl,this._attributes,this._indexBuffer)};Ip.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};Ip.prototype.isDestroyed=function(){return!1};Ip.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var ti=Ip;function Jo(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=et.RGBA,pixelDatatype:o=Ke.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Zt}=e,c=e.preMultiplyAlpha||i===et.RGB||i===et.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=et.textureSizeInBytes(i,o,d,d)*6,g=et.toInternalFormat(i,o,t),m=t._gl,x=m.TEXTURE_CUBE_MAP,b=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=x,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let T=l(n);function C(A){return new Pw(t,b,x,A,g,i,o,d,c,r,T)}this._positiveX=C(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=C(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=C(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=C(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=C(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=C(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,Ute(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(x,b),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let A of Jo.faceNames())G6(this[A],n?.[A],0);m.bindTexture(x,null)}Jo.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Nr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,y(i,0)),r._unBind(),r.destroy()};Jo.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*iPe(){yield Jo.FaceName.POSITIVEX,yield Jo.FaceName.NEGATIVEX,yield Jo.FaceName.POSITIVEY,yield Jo.FaceName.NEGATIVEY,yield Jo.FaceName.POSITIVEZ,yield Jo.FaceName.NEGATIVEZ}Jo.faceNames=function(){return iPe()};function G6(e,t,n){n=y(n,0);let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,a,o,o,0,r,Ke.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=et.alignmentInBytes(r,s,o)),d.pixelStorei(d.UNPACK_ALIGNMENT,g),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=et.flipY(p,r,s,o,o)),d.texImage2D(i,n,a,o,o,0,r,Ke.toWebGLConstant(s,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,a,r,Ke.toWebGLConstant(s,f),t))}Jo.loadFace=G6;Object.defineProperties(Jo.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){Ute(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});Jo.getDirection=function(e,t){switch(e){case Jo.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case Jo.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case Jo.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case Jo.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case Jo.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case Jo.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function Ute(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Kt.NEAREST_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===Ke.FLOAT&&!r.textureFloatLinear||s===Ke.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Kt.NEAREST_MIPMAP_NEAREST:Kt.NEAREST,i=di.NEAREST);let a=r._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}Jo.prototype.loadMipmaps=function(e,t){t=y(t,!1);let n=this._context._gl,i=this._texture,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){let s=e[r],a=r+1;for(let c of Jo.faceNames())G6(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};Jo.prototype.generateMipmap=function(e){e=y(e,lm.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Jo.createVertexArray=function(e){let t=Ra.createGeometry(Ra.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Ie.POSITION_ONLY})),n=this._attributeLocations=Ln.createAttributeLocations(t);return ti.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Fe.STATIC_DRAW})};Jo.prototype.isDestroyed=function(){return!1};Jo.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var Cr=Jo;function oPe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var sc=oPe;var Ow=`/** * A built-in GLSL floating-point constant for converting radians to degrees. * * @alias czm_degreesPerRadian @@ -3865,7 +3865,7 @@ vec3 czm_writeNonPerspective(vec3 value, float w) { vec4 czm_writeNonPerspective(vec4 value, float w) { return value * w; } -`;var Cx={czm_degreesPerRadian:Ow,czm_depthRange:Mw,czm_epsilon1:Lw,czm_epsilon2:Nw,czm_epsilon3:Fw,czm_epsilon4:Bw,czm_epsilon5:kw,czm_epsilon6:Vw,czm_epsilon7:Uw,czm_infinity:zw,czm_oneOverPi:Hw,czm_oneOverTwoPi:Gw,czm_passCesium3DTile:Ww,czm_passCesium3DTileClassification:jw,czm_passCesium3DTileClassificationIgnoreShow:qw,czm_passClassification:Yw,czm_passCompute:Xw,czm_passEnvironment:Kw,czm_passGlobe:Zw,czm_passOpaque:$w,czm_passOverlay:Qw,czm_passTerrainClassification:Jw,czm_passTranslucent:eD,czm_passVoxels:tD,czm_pi:nD,czm_piOverFour:iD,czm_piOverSix:oD,czm_piOverThree:rD,czm_piOverTwo:sD,czm_radiansPerDegree:aD,czm_sceneMode2D:cD,czm_sceneMode3D:lD,czm_sceneModeColumbusView:uD,czm_sceneModeMorphing:fD,czm_solarRadius:dD,czm_threePiOver2:hD,czm_twoPi:mD,czm_webMercatorMaxLatitude:pD,czm_depthRangeStruct:_D,czm_material:gD,czm_materialInput:yD,czm_modelMaterial:xD,czm_modelVertexOutput:bD,czm_ray:TD,czm_raySegment:CD,czm_shadowParameters:AD,czm_HSBToRGB:ED,czm_HSLToRGB:SD,czm_RGBToHSB:vD,czm_RGBToHSL:wD,czm_RGBToXYZ:DD,czm_XYZToRGB:ID,czm_acesTonemapping:PD,czm_alphaWeight:RD,czm_antialias:OD,czm_applyHSBShift:MD,czm_approximateSphericalCoordinates:LD,czm_approximateTanh:ND,czm_backFacing:FD,czm_branchFreeTernary:BD,czm_cascadeColor:kD,czm_cascadeDistance:VD,czm_cascadeMatrix:UD,czm_cascadeWeights:zD,czm_clipPolygons:HD,czm_columbusViewMorph:GD,czm_computeAtmosphereColor:WD,czm_computeGroundAtmosphereScattering:jD,czm_computePosition:qD,czm_computeScattering:YD,czm_cosineAndSine:XD,czm_decompressTextureCoordinates:KD,czm_depthClamp:ZD,czm_eastNorthUpToEyeCoordinates:$D,czm_ellipsoidContainsPoint:QD,czm_ellipsoidTextureCoordinates:JD,czm_equalsEpsilon:eI,czm_eyeOffset:tI,czm_eyeToWindowCoordinates:nI,czm_fastApproximateAtan:iI,czm_fog:oI,czm_gammaCorrect:rI,czm_geodeticSurfaceNormal:sI,czm_getDefaultMaterial:aI,czm_getDynamicAtmosphereLightDirection:cI,czm_getLambertDiffuse:lI,czm_getSpecular:uI,czm_getWaterNoise:fI,czm_hue:dI,czm_inverseGamma:hI,czm_isEmpty:mI,czm_isFull:pI,czm_latitudeToWebMercatorFraction:_I,czm_lineDistance:gI,czm_linearToSrgb:yI,czm_luminance:xI,czm_maximumComponent:bI,czm_metersPerPixel:TI,czm_modelToWindowCoordinates:CI,czm_multiplyWithColorBalance:AI,czm_nearFarScalar:EI,czm_octDecode:SI,czm_packDepth:vI,czm_pbrLighting:wI,czm_pbrNeutralTonemapping:DI,czm_phong:II,czm_planeDistance:PI,czm_pointAlongRay:RI,czm_rayEllipsoidIntersectionInterval:OI,czm_raySphereIntersectionInterval:MI,czm_readDepth:LI,czm_readNonPerspective:NI,czm_reverseLogDepth:FI,czm_round:BI,czm_saturation:kI,czm_shadowDepthCompare:VI,czm_shadowVisibility:UI,czm_signNotZero:zI,czm_sphericalHarmonics:HI,czm_srgbToLinear:GI,czm_tangentToEyeSpaceMatrix:WI,czm_textureCube:jI,czm_transformPlane:qI,czm_translateRelativeToEye:YI,czm_translucentPhong:XI,czm_transpose:KI,czm_unpackClippingExtents:ZI,czm_unpackDepth:$I,czm_unpackFloat:QI,czm_unpackUint:JI,czm_valueTransform:eP,czm_vertexLogDepth:tP,czm_windowToEyeCoordinates:nP,czm_writeDepthClamp:iP,czm_writeLogDepth:oP,czm_writeNonPerspective:rP};function iPe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` +`;var yx={czm_degreesPerRadian:Ow,czm_depthRange:Mw,czm_epsilon1:Lw,czm_epsilon2:Nw,czm_epsilon3:Fw,czm_epsilon4:Bw,czm_epsilon5:kw,czm_epsilon6:Vw,czm_epsilon7:Uw,czm_infinity:zw,czm_oneOverPi:Hw,czm_oneOverTwoPi:Gw,czm_passCesium3DTile:Ww,czm_passCesium3DTileClassification:jw,czm_passCesium3DTileClassificationIgnoreShow:qw,czm_passClassification:Yw,czm_passCompute:Xw,czm_passEnvironment:Kw,czm_passGlobe:Zw,czm_passOpaque:$w,czm_passOverlay:Qw,czm_passTerrainClassification:Jw,czm_passTranslucent:eD,czm_passVoxels:tD,czm_pi:nD,czm_piOverFour:iD,czm_piOverSix:oD,czm_piOverThree:rD,czm_piOverTwo:sD,czm_radiansPerDegree:aD,czm_sceneMode2D:cD,czm_sceneMode3D:lD,czm_sceneModeColumbusView:uD,czm_sceneModeMorphing:fD,czm_solarRadius:dD,czm_threePiOver2:hD,czm_twoPi:mD,czm_webMercatorMaxLatitude:pD,czm_depthRangeStruct:_D,czm_material:gD,czm_materialInput:yD,czm_modelMaterial:xD,czm_modelVertexOutput:bD,czm_ray:TD,czm_raySegment:CD,czm_shadowParameters:AD,czm_HSBToRGB:ED,czm_HSLToRGB:SD,czm_RGBToHSB:vD,czm_RGBToHSL:wD,czm_RGBToXYZ:DD,czm_XYZToRGB:ID,czm_acesTonemapping:PD,czm_alphaWeight:RD,czm_antialias:OD,czm_applyHSBShift:MD,czm_approximateSphericalCoordinates:LD,czm_approximateTanh:ND,czm_backFacing:FD,czm_branchFreeTernary:BD,czm_cascadeColor:kD,czm_cascadeDistance:VD,czm_cascadeMatrix:UD,czm_cascadeWeights:zD,czm_clipPolygons:HD,czm_columbusViewMorph:GD,czm_computeAtmosphereColor:WD,czm_computeGroundAtmosphereScattering:jD,czm_computePosition:qD,czm_computeScattering:YD,czm_cosineAndSine:XD,czm_decompressTextureCoordinates:KD,czm_depthClamp:ZD,czm_eastNorthUpToEyeCoordinates:$D,czm_ellipsoidContainsPoint:QD,czm_ellipsoidTextureCoordinates:JD,czm_equalsEpsilon:eI,czm_eyeOffset:tI,czm_eyeToWindowCoordinates:nI,czm_fastApproximateAtan:iI,czm_fog:oI,czm_gammaCorrect:rI,czm_geodeticSurfaceNormal:sI,czm_getDefaultMaterial:aI,czm_getDynamicAtmosphereLightDirection:cI,czm_getLambertDiffuse:lI,czm_getSpecular:uI,czm_getWaterNoise:fI,czm_hue:dI,czm_inverseGamma:hI,czm_isEmpty:mI,czm_isFull:pI,czm_latitudeToWebMercatorFraction:_I,czm_lineDistance:gI,czm_linearToSrgb:yI,czm_luminance:xI,czm_maximumComponent:bI,czm_metersPerPixel:TI,czm_modelToWindowCoordinates:CI,czm_multiplyWithColorBalance:AI,czm_nearFarScalar:EI,czm_octDecode:SI,czm_packDepth:vI,czm_pbrLighting:wI,czm_pbrNeutralTonemapping:DI,czm_phong:II,czm_planeDistance:PI,czm_pointAlongRay:RI,czm_rayEllipsoidIntersectionInterval:OI,czm_raySphereIntersectionInterval:MI,czm_readDepth:LI,czm_readNonPerspective:NI,czm_reverseLogDepth:FI,czm_round:BI,czm_saturation:kI,czm_shadowDepthCompare:VI,czm_shadowVisibility:UI,czm_signNotZero:zI,czm_sphericalHarmonics:HI,czm_srgbToLinear:GI,czm_tangentToEyeSpaceMatrix:WI,czm_textureCube:jI,czm_transformPlane:qI,czm_translateRelativeToEye:YI,czm_translucentPhong:XI,czm_transpose:KI,czm_unpackClippingExtents:ZI,czm_unpackDepth:$I,czm_unpackFloat:QI,czm_unpackUint:JI,czm_valueTransform:eP,czm_vertexLogDepth:tP,czm_windowToEyeCoordinates:nP,czm_writeDepthClamp:iP,czm_writeLogDepth:oP,czm_writeNonPerspective:rP};function rPe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable ${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable ${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod @@ -3875,8 +3875,8 @@ ${n}`,n=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif ${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 -${n}`,n}var sP=iPe;function zte(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=` -`;return i})}function Hte(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=zte(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function Gte(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&zs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=Hte(i,zs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),Gte(o,t)}}))}function oPe(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function rPe(e){let t=[],n=Hte("main",e,t);Gte(n,t),oPe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource} +${n}`,n}var sP=rPe;function zte(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=` +`;return i})}function Hte(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=zte(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function Gte(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&zs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=Hte(i,zs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),Gte(o,t)}}))}function sPe(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function aPe(e){let t=[],n=Hte("main",e,t);Gte(n,t),sPe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource} `;return i.replace(n.glslSource,"")}function Wte(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i<o;++i)r+=` #line 0 ${s[i]}`;r=zte(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(x,b){return a=b,` @@ -3895,13 +3895,13 @@ ${s[i]}`;r=zte(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(x,b){return `),n.floatingPointTexture&&(f+=`#define OES_texture_float -`);let g="";e.includeBuiltIns&&(g=rPe(r)),f+=` +`);let g="";e.includeBuiltIns&&(g=aPe(r)),f+=` #line 0 `;let m=g+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(m)&&!/czm_out_FragColor/g.test(m)&&/out_FragColor/g.test(m)&&(f+=`layout(location = 0) out vec4 out_FragColor; `),f+=g,f+=r,n.webgl2?f=`#version 300 es ${f}`:f=sP(f,t),f}function zs(e){e=y(e,y.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=y(e.includeBuiltIns,!0)}zs.prototype.clone=function(){return new zs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};zs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};zs.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(` -`);return`${t}:${n}:${i}:${o}`};zs.prototype.createCombinedVertexShader=function(e){return Wte(this,!1,e)};zs.prototype.createCombinedFragmentShader=function(e){return Wte(this,!0,e)};zs._czmBuiltinsAndUniforms={};for(let e in Cx)Cx.hasOwnProperty(e)&&(zs._czmBuiltinsAndUniforms[e]=Cx[e]);for(let e in Tp)if(Tp.hasOwnProperty(e)){let t=Tp[e];typeof t.getDeclaration=="function"&&(zs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}zs.createPickVertexShaderSource=function(e){return`${zs.replaceMain(e,"czm_old_main")} +`);return`${t}:${n}:${i}:${o}`};zs.prototype.createCombinedVertexShader=function(e){return Wte(this,!1,e)};zs.prototype.createCombinedFragmentShader=function(e){return Wte(this,!0,e)};zs._czmBuiltinsAndUniforms={};for(let e in yx)yx.hasOwnProperty(e)&&(zs._czmBuiltinsAndUniforms[e]=yx[e]);for(let e in xp)if(xp.hasOwnProperty(e)){let t=xp[e];typeof t.getDeclaration=="function"&&(zs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}zs.createPickVertexShaderSource=function(e){return`${zs.replaceMain(e,"czm_old_main")} in vec4 pickColor; out vec4 czm_pickColor; void main() @@ -3917,36 +3917,2295 @@ void main() } out_FragColor = czm_pickColor; }`;return`${n} -${i}`};function sPe(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function jte(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function qte(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(jte(e,o))return o}}var aPe=["v_normalEC","v_normal"];zs.findNormalVarying=function(e){return jte(e,"#ifdef HAS_NORMALS")?sPe(e,"HAS_NORMALS")?"v_normalEC":void 0:qte(e,aPe)};var cPe=["v_positionEC"];zs.findPositionVarying=function(e){return qte(e,cPe)};var Ue=zs;function Nd(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Nd.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Nd.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function lPe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Nd.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Ue({sources:[t]})),typeof n=="string"&&(n=new Ue({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?lPe(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};Nd.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){q6(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Nd.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Nd.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Ue({sources:[r]})),typeof s=="string"&&(s=new Ue({sources:[s]}));let c=this._context,u=r.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[o]=p,d};function q6(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];q6(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Nd.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];q6(this,n),--this._numberOfShaders}this._shadersToRelease={}};Nd.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Nd.prototype.isDestroyed=function(){return!1};Nd.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var aP=Nd;function Fd(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=et.RGBA,pixelDatatype:o=Ke.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new $t}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===et.RGB||i===et.LUMINANCE,d=et.toInternalFormat(i,o,t),p=et.isCompressedFormat(d),g=t._gl,m=p?et.compressedTextureSizeInBytes(i,c,u):et.textureSizeInBytes(i,o,c,u);this._id=e.id??Hn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._dimensions=new z(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,Zte(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?et.isCompressedFormat(d)?uPe(this,n):Yte(this,n):l(n.framebuffer)?dPe(this,n):Xte(this,n),this._initialized=!0):Kte(this),g.bindTexture(this._textureTarget,null)}function uPe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=rU(c),u=rU(u),i.compressedTexImage2D(o,f+1,r,c,u,0,t.mipLevels[f])}}function Yte(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=et.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=et.flipY(p,c,u,s,a)),i.texImage2D(o,0,r,s,a,0,c,Ke.toWebGLConstant(u,n),p),l(t.mipLevels)){let g=s,m=a;for(let x=0;x<t.mipLevels.length;++x)g=rU(g),m=rU(m),i.texImage2D(o,x+1,r,g,m,0,c,Ke.toWebGLConstant(u,n),t.mipLevels[x])}}function fPe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=et.alignmentInBytes(c,u,o);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=et.flipY(t,c,u,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,c,Ke.toWebGLConstant(u,s),t)}function dPe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function Xte(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,Ke.toWebGLConstant(e.pixelDatatype,n),t)}function hPe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,Ke.toWebGLConstant(e.pixelDatatype,o),t)}function rU(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Kte(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Ke.toWebGLConstant(e._pixelDatatype,t),null)}Fd.create=function(e){return new Fd(e)};Fd.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,{pixelFormat:i=et.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:c}=e;return new Fd({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(Fd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Zte(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Zte(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Zt.NEAREST_MIPMAP_NEAREST,Zt.NEAREST_MIPMAP_LINEAR,Zt.LINEAR_MIPMAP_NEAREST,Zt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ke.FLOAT&&!r.textureFloatLinear||a===Ke.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Zt.NEAREST_MIPMAP_NEAREST:Zt.NEAREST,i=di.NEAREST),r.webgl2&&et.isDepthFormat(s)&&(n=Zt.NEAREST,i=di.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}Fd.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?Yte(this,i):Xte(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Kte(this)),this._initialized=!0),f||(l(i.arrayBufferView)?fPe(this,i.arrayBufferView,t,n,c,u):hPe(this,i,t,n)),s.bindTexture(a,null)};Fd.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._width),r=y(r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};Fd.prototype.generateMipmap=function(e){e=y(e,um.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Fd.prototype.isDestroyed=function(){return!1};Fd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var Pt=Fd;function Ax(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Ax.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Ax.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Ax.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};Ax.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};Ax.prototype.isDestroyed=function(){return!1};Ax.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var cP=Ax;function Ef(e){this.planes=y(e,[])}var lP=[new h,new h,new h];h.clone(h.UNIT_X,lP[0]);h.clone(h.UNIT_Y,lP[1]);h.clone(h.UNIT_Z,lP[2]);var Gg=new h,mPe=new h,$te=new an(new h(1,0,0),0);Ef.fromBoundingSphere=function(e,t){l(t)||(t=new Ef);let n=lP.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=lP[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new oe),l(f)||(f=i[s+1]=new oe),h.multiplyByScalar(c,-r,Gg),h.add(o,Gg,Gg),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,Gg),h.multiplyByScalar(c,r,Gg),h.add(o,Gg,Gg),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,mPe),Gg),s+=2}return t};Ef.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(an.fromCartesian4(t[i],$te));if(r===jt.OUTSIDE)return jt.OUTSIDE;r===jt.INTERSECTING&&(n=!0)}return n?jt.INTERSECTING:jt.INSIDE};Ef.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Ef.MASK_OUTSIDE||t===Ef.MASK_INSIDE)return t;let n=Ef.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&!(t&s))continue;let a=e.intersectPlane(an.fromCartesian4(i[o],$te));if(a===jt.OUTSIDE)return Ef.MASK_OUTSIDE;a===jt.INTERSECTING&&(n|=s)}return n};Ef.MASK_OUTSIDE=4294967295;Ef.MASK_INSIDE=0;Ef.MASK_INDETERMINATE=2147483647;var _s=Ef;function fm(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new _s,this._orthographicMatrix=new F}function Qte(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(fm.prototype,{projectionMatrix:{get:function(){return Qte(this),this._orthographicMatrix}}});var pPe=new h,_Pe=new h,gPe=new h,Y6=new h;fm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,pPe);h.normalize(f,f);let d=_Pe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=gPe;h.multiplyByScalar(f,a,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new oe),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new oe),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,Y6),p),h.multiplyByScalar(n,r,p),h.add(d,p,p),g=i[2],l(g)||(g=i[2]=new oe),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-h.dot(n,p),h.multiplyByScalar(n,o,p),h.add(d,p,p),g=i[3],l(g)||(g=i[3]=new oe),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-h.dot(h.negate(n,Y6),p),g=i[4],l(g)||(g=i[4]=new oe),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.add(e,p,p),g=i[5],l(g)||(g=i[5]=new oe),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-h.dot(h.negate(t,Y6),p),this._cullingVolume};fm.prototype.getPixelDimensions=function(e,t,n,i,o){Qte(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};fm.prototype.clone=function(e){return l(e)||(e=new fm),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};fm.prototype.equals=function(e){return l(e)&&e instanceof fm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};fm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof fm&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Fr=fm;function Il(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Fr,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}Il.packedLength=4;Il.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Il.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Il),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Wg(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(Il.prototype,{projectionMatrix:{get:function(){return Wg(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Wg(this),this._offCenterFrustum}}});Il.prototype.computeCullingVolume=function(e,t,n){return Wg(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Il.prototype.getPixelDimensions=function(e,t,n,i,o){return Wg(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Il.prototype.clone=function(e){return l(e)||(e=new Il),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Il.prototype.equals=function(e){return!l(e)||!(e instanceof Il)?!1:(Wg(this),Wg(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Il.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Il)?!1:(Wg(this),Wg(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var rn=Il;var X6={};function yPe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var xPe=32.184,bPe=2451545;function gne(e,t){t=Z.addSeconds(e,xPe,t);let n=Z.totalDays(t)-bPe;return t=Z.addSeconds(t,yPe(n),t),t}var sU=new Z(2451545,0,jn.TAI),TPe=1e3,Sf=P.RADIANS_PER_DEGREE,hu=P.RADIANS_PER_ARCSECOND,Pa=14959787e4,Jte=new $;function yne(e,t,n,i,o,r,s){n<0&&(n=-n,o+=P.PI);let a=e*(1-t),c=i-o,u=o,f=APe(r-i,t),d=CPe(t,0);DPe(c,n,u,Jte);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),x=1+t*g,b=p/x;return l(s)?(s.x=b*g,s.y=b*m,s.z=0):s=new h(b*g,b*m,0),$.multiplyByVector(Jte,s,s)}function CPe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function APe(e,t){let n=vPe(e,t);return wPe(n,t)}var EPe=50,SPe=P.EPSILON8;function vPe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<EPe&&Math.abs(o-i)>SPe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*P.TWO_PI,o}function wPe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=P.zeroToTwoPi(r),e<0&&(r-=P.TWO_PI),r+=n*P.TWO_PI,r}function DPe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var IPe=1.0000010178*Pa,PPe=100.46645683*Sf,RPe=129597742283429e-5*hu,ene=16002,tne=21863,nne=32004,ine=10931,one=14529,rne=16368,sne=15318,ane=32794,OPe=64*1e-7*Pa,MPe=-152*1e-7*Pa,LPe=62*1e-7*Pa,NPe=-8*1e-7*Pa,FPe=32*1e-7*Pa,BPe=-41*1e-7*Pa,kPe=19*1e-7*Pa,VPe=-11*1e-7*Pa,UPe=-150*1e-7*Pa,zPe=-46*1e-7*Pa,HPe=68*1e-7*Pa,GPe=54*1e-7*Pa,WPe=14*1e-7*Pa,jPe=24*1e-7*Pa,qPe=-28*1e-7*Pa,YPe=22*1e-7*Pa,cne=10,lne=16002,une=21863,fne=10931,dne=1473,hne=32004,mne=4387,pne=73,XPe=-325*1e-7,KPe=-322*1e-7,ZPe=-79*1e-7,$Pe=232*1e-7,QPe=-52*1e-7,JPe=97*1e-7,e1e=55*1e-7,t1e=-41*1e-7,n1e=-105*1e-7,i1e=-137*1e-7,o1e=258*1e-7,r1e=35*1e-7,s1e=-116*1e-7,a1e=-88*1e-7,c1e=-112*1e-7,l1e=-80*1e-7,nA=new Z(0,0,jn.TAI);function u1e(e,t){gne(e,nA);let i=(nA.dayNumber-sU.dayNumber+(nA.secondsOfDay-sU.secondsOfDay)/qn.SECONDS_PER_DAY)/(qn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=IPe+OPe*Math.cos(ene*o)+UPe*Math.sin(ene*o)+MPe*Math.cos(tne*o)+zPe*Math.sin(tne*o)+LPe*Math.cos(nne*o)+HPe*Math.sin(nne*o)+NPe*Math.cos(ine*o)+GPe*Math.sin(ine*o)+FPe*Math.cos(one*o)+WPe*Math.sin(one*o)+BPe*Math.cos(rne*o)+jPe*Math.sin(rne*o)+kPe*Math.cos(sne*o)+qPe*Math.sin(sne*o)+VPe*Math.cos(ane*o)+YPe*Math.sin(ane*o),s=PPe+RPe*i+XPe*Math.cos(cne*o)+n1e*Math.sin(cne*o)+KPe*Math.cos(lne*o)+i1e*Math.sin(lne*o)+ZPe*Math.cos(une*o)+o1e*Math.sin(une*o)+$Pe*Math.cos(fne*o)+r1e*Math.sin(fne*o)+QPe*Math.cos(dne*o)+s1e*Math.sin(dne*o)+JPe*Math.cos(hne*o)+a1e*Math.sin(hne*o)+e1e*Math.cos(mne*o)+c1e*Math.sin(mne*o)+t1e*Math.cos(pne*o)+l1e*Math.sin(pne*o),a=.0167086342-.0004203654*i,c=102.93734808*Sf+11612.3529*hu*i,u=469.97289*hu*i,f=174.87317577*Sf-8679.27034*hu*i;return yne(r,a,u,c,f,s,t)}function xne(e,t){gne(e,nA);let i=(nA.dayNumber-sU.dayNumber+(nA.secondsOfDay-sU.secondsOfDay)/qn.SECONDS_PER_DAY)/qn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Sf,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,d=83.35324312*Sf,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Sf,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*Sf,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,T=297.85019547*Sf+hu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),C=93.27209062*Sf+hu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),A=134.96340251*Sf+hu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),E=357.52910918*Sf+hu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*Sf-hu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),D=2*T,O=4*T,R=6*T,M=2*A,N=3*A,_=4*A,S=2*C;a+=3400.4*Math.cos(D)-635.6*Math.cos(D-A)-235.6*Math.cos(A)+218.1*Math.cos(D-E)+181*Math.cos(D+A),c+=.014216*Math.cos(D-A)+.008551*Math.cos(D-M)-.001383*Math.cos(A)+.001356*Math.cos(D+A)-.001147*Math.cos(O-N)-914e-6*Math.cos(O-M)+869e-6*Math.cos(D-E-A)-627e-6*Math.cos(D)-394e-6*Math.cos(O-_)+282e-6*Math.cos(D-E-M)-279e-6*Math.cos(T-A)-236e-6*Math.cos(M)+231e-6*Math.cos(O)+229e-6*Math.cos(R-_)-201e-6*Math.cos(M-S),f+=486.26*Math.cos(D-S)-40.13*Math.cos(D)+37.51*Math.cos(S)+25.73*Math.cos(M-S)+19.97*Math.cos(D-E-S),p+=-55609*Math.sin(D-A)-34711*Math.sin(D-M)-9792*Math.sin(A)+9385*Math.sin(O-N)+7505*Math.sin(O-M)+5318*Math.sin(D+A)+3484*Math.sin(O-_)-3417*Math.sin(D-E-A)-2530*Math.sin(R-_)-2376*Math.sin(D)-2075*Math.sin(D-N)-1883*Math.sin(M)-1736*Math.sin(R-5*A)+1626*Math.sin(E)-1370*Math.sin(R-N),m+=-5392*Math.sin(D-S)-540*Math.sin(E)-441*Math.sin(D)+423*Math.sin(S)-288*Math.sin(M-S),b+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-A)-662.5*Math.sin(E)+396.3*Math.sin(A)-218*Math.sin(D-E);let w=2*v,I=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(D-S+v)*i+.614*Math.cos(D-S-v)*i-.0297*Math.cos(w)*o-.0335*Math.cos(v)*o+.0012*Math.cos(D-S+w)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(w)*r;let L=2.116*Math.sin(v)*i-.111*Math.sin(D-S-v)*i-.0015*Math.sin(v)*o;p+=L,b+=L,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(D-S+v)*i+1.12*Math.sin(D-v)*i-1.06*Math.sin(S-v)*i+.66*Math.sin(w)*o+.371*Math.sin(v)*o-.035*Math.sin(D-S+w)*o-.015*Math.sin(D-S+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(w)*r,a*=TPe;let B=u+f*hu,U=d+p*hu,V=x+b*hu,G=g+m*hu;return yne(a,c,B,U,G,V,t)}var _ne=.012300034,f1e=_ne/(_ne+1)*-1;function d1e(e,t){return t=xne(e,t),h.multiplyByScalar(t,f1e,t)}var bne=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),uP=new h;X6.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Z.now()),l(t)||(t=new h),uP=u1e(e,uP),t=h.negate(uP,t),d1e(e,uP),h.subtract(t,uP,t),$.multiplyByVector(bne,t,t),t};X6.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Z.now()),t=xne(e,t),$.multiplyByVector(bne,t,t),t};var jg=X6;var aU={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};aU.getMorphTime=function(e){return e===aU.SCENE3D?1:e===aU.MORPHING?void 0:0};var ne=Object.freeze(aU);function h1e(e){e=y(e,y.EMPTY_OBJECT),this.color=H.clone(y(e.color,H.WHITE)),this.intensity=y(e.intensity,2)}var Op=h1e;function iA(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new je,this._viewportCartesian4=new oe,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new z,this._currentFrustum=new z,this._frustumPlanes=new oe,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Gn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new z,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new z,this._modelToEnu=new F,this._enuToModel=new F,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new H,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(iA.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!je.equals(e,this._viewport)){je.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Cne(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Cne(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return Z6(this),this._view3D}},viewRotation:{get:function(){return Z6(this),this._viewRotation}},viewRotation3D:{get:function(){return Z6(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Sne(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Sne(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return E1e(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return S1e(this),this._modelView}},modelView3D:{get:function(){return v1e(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return O1e(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return w1e(this),this._inverseModelView}},inverseModelView3D:{get:function(){return D1e(this),this._inverseModelView3D}},viewProjection:{get:function(){return I1e(this),this._viewProjection}},inverseViewProjection:{get:function(){return P1e(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return R1e(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return M1e(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return L1e(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return N1e(this),this._modelViewInfiniteProjection}},normal:{get:function(){return F1e(this),this._normal}},normal3D:{get:function(){return B1e(this),this._normal3D}},inverseNormal:{get:function(){return k1e(this),this._inverseNormal}},inverseNormal3D:{get:function(){return V1e(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return Ene(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Ene(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,ee.default)}}});function m1e(e,t){F.clone(t,e._view),F.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function p1e(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function _1e(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function g1e(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Tne=new h,y1e=new F;function x1e(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=h.fromRadians(o.longitude,o.latitude,0,n,Tne)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Tne)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Mt.eastNorthUpToFixedFrame(i,n,y1e);e._enuToModel=F.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=F.inverseTransformation(e._enuToModel,e._modelToEnu),P.equalsEpsilon(n._radii.x,n._radii.y,P.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var K6=new $,b1e=new fe;function T1e(e,t){Mt.computeIcrfToCentralBodyFixedMatrix(t.time,K6);let n=jg.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(K6,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=jg.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(K6,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,b1e);i.project(r,e._sunPositionColumbusView)}iA.prototype.updateCamera=function(e){m1e(this,e.viewMatrix),p1e(this,e.inverseViewMatrix),x1e(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof rn};iA.prototype.updateFrustum=function(e){_1e(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&g1e(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};iA.prototype.updatePass=function(e){this._pass=e};var C1e=[],A1e=new Op;iA.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ne.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),T1e(this,e);let n=y(e.light,A1e);n instanceof Op?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=h.multiplyByScalar(o,n.intensity,o);let r=h.maximumComponent(o);r>1?h.divideByScalar(o,r,this._lightColor):h.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,C1e),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Mt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,H.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Cne(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function E1e(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function S1e(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function v1e(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function w1e(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function D1e(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function I1e(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function P1e(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function R1e(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function O1e(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function M1e(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function L1e(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function N1e(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function F1e(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function B1e(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function k1e(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;F.getMatrix3(e.modelView,t),$.transpose(t,t)}}function V1e(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;F.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var Ane=new h;function Ene(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,Ane),Gn.fromCartesian(Ane,e._encodedCameraPositionMC))}var U1e=new h,z1e=new h,H1e=new h,G1e=new h,W1e=new fe,j1e=new h,q1e=new F;function Y1e(e,t,n,i,o,r,s,a){let c=U1e;c.x=e.y,c.y=e.z,c.z=e.x;let u=z1e;u.x=n.y,u.y=n.z,u.z=n.x;let f=H1e;f.x=i.y,f.y=i.z,f.z=i.x;let d=G1e;d.x=t.y,d.y=t.z,d.z=t.x,r===ne.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,W1e);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,j1e),x=Mt.eastNorthUpToFixedFrame(m,g,q1e);return F.multiplyByPointAsVector(x,u,u),F.multiplyByPointAsVector(x,f,f),F.multiplyByPointAsVector(x,d,d),l(a)||(a=new F),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function Z6(e){e._view3DDirty&&(e._mode===ne.SCENE3D?F.clone(e._view,e._view3D):Y1e(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Sne(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var fP=iA;function mu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):X1e(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Hn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new aP(this),this._textureCache=new cP;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Nt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Nt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Nt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Nt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Nt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Nt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Nt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Nt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Nt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Nt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Nt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Nt._minimumAliasedLineWidth=f[0],Nt._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Nt._minimumAliasedPointSize=d[0],Nt._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Nt._maximumViewportWidth=p[0],Nt._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Nt._highpFloatSupported=g.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Nt._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Ar(u,["OES_standard_derivatives"]),this._blendMinmax=!!Ar(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Ar(u,["OES_element_index_uint"]),this._depthTexture=!!Ar(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Ar(u,["EXT_frag_depth"]),this._debugShaders=Ar(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Ar(u,["OES_texture_float"]),this._textureHalfFloat=!!Ar(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Ar(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Ar(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Ar(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Ar(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Ar(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Ar(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Ar(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Ar(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Ar(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Ar(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Ar(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Ar(u,["EXT_texture_compression_bptc"]),Dl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?Ar(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Nt._maximumTextureFilterAnisotropy=l(x)?u.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,T,C,A,E,v,D,O,R,M;if(c){let w=this;b=function(){return w._gl.createVertexArray()},T=function(I){w._gl.bindVertexArray(I)},C=function(I){w._gl.deleteVertexArray(I)},A=function(I,L,B,U,V){u.drawElementsInstanced(I,L,B,U,V)},E=function(I,L,B,U){u.drawArraysInstanced(I,L,B,U)},v=function(I,L){u.vertexAttribDivisor(I,L)},D=function(I){u.drawBuffers(I)}}else O=Ar(u,["OES_vertex_array_object"]),l(O)&&(b=function(){return O.createVertexArrayOES()},T=function(w){O.bindVertexArrayOES(w)},C=function(w){O.deleteVertexArrayOES(w)}),R=Ar(u,["ANGLE_instanced_arrays"]),l(R)&&(A=function(w,I,L,B,U){R.drawElementsInstancedANGLE(w,I,L,B,U)},E=function(w,I,L,B){R.drawArraysInstancedANGLE(w,I,L,B)},v=function(w,I){R.vertexAttribDivisorANGLE(w,I)}),M=Ar(u,["WEBGL_draw_buffers"]),l(M)&&(D=function(w){M.drawBuffersWEBGL(w)});this.glCreateVertexArray=b,this.glBindVertexArray=T,this.glDeleteVertexArray=C,this.glDrawElementsInstanced=A,this.glDrawArraysInstanced=E,this.glVertexAttribDivisor=v,this.glDrawBuffers=D,this._vertexArrayObject=!!O,this._instancedArrays=!!R,this._drawBuffers=!!M,Nt._maximumDrawBuffers=this.drawBuffers?u.getParameter(te.MAX_DRAW_BUFFERS):1,Nt._maximumColorAttachments=this.drawBuffers?u.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new H(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let N=new fP,_=new rc(this),S=Ve.fromCache();this._defaultPassState=_,this._defaultRenderState=S,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=N,this._currentRenderState=S,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let w=0;w<Nt._maximumVertexAttributes;w++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ve.apply(u,S,_)}function X1e(e,t,n){if(typeof WebGLRenderingContext>"u")throw new re("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new re("The browser supports WebGL, but initialization failed.");return r}function K1e(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function Z1e(e,t,n,i){let o=`${K1e(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function $1e(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new re(Z1e(e,t,n,i))}function Q1e(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function J1e(e,t){if(!l(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,Q1e(e,o,t))}return i}function Ar(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var eRe={};Object.defineProperties(mu.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=J1e(this._originalGLContext,e?$1e:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Pt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Pt({context:this,pixelFormat:et.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Pt({context:this,pixelFormat:et.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new Cr({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return eRe}}});function vne(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,o,t,r,n,i)}var $6;typeof WebGLRenderingContext<"u"&&($6=[te.BACK]);function Q6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=$6;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var tRe=new Jn;mu.prototype.clear=function(e,t){e=y(e,tRe),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(H.equals(this._clearColor,o)||(H.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);vne(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);Q6(this,c),n.clear(i)};function nRe(e,t,n,i,o){Q6(e,t),vne(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function iRe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,F.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}mu.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),nRe(this,o,t,n,r),iRe(this,e,n,i)};mu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=$6;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};mu.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),o=y(e.width,t.drawingBufferWidth),r=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=Ke.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=et.createTypedArray(et.RGBA,a,o,r);return Q6(this,s),t.readPixels(n,i,o,r,et.RGBA,Ke.toWebGLConstant(a,this),c),c};var wne={position:0,textureCoordinates:1};mu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new at({attributes:{position:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Me.TRIANGLES});e=ei.fromGeometry({context:this,geometry:t,attributeLocations:wne,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};mu.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new Ze({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Me.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:hx,fragmentShaderSource:e,attributeLocations:wne}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};mu.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function J6(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(J6.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});J6.prototype.destroy=function(){delete this._pickObjects[this.key]};mu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new re("Out of unique Pick IDs.");return this._pickObjects[t]=e,new J6(this._pickObjects,t,H.fromRgba(t))};mu.prototype.isDestroyed=function(){return!1};mu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};mu._deprecationWarning=ms;var dP=mu;function oA(e){e=y(e,y.EMPTY_OBJECT);let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new he("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new he("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Nr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new Nr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}oA.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};oA.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};oA.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};oA.prototype.isDestroyed=function(){return!1};oA.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var hP=oA;var Pl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===Pl.RGBA4||e===Pl.RGBA8||e===Pl.RGBA16F||e===Pl.RGBA32F||e===Pl.RGB5_A1||e===Pl.RGB565||e===Pl.DEPTH_COMPONENT16||e===Pl.STENCIL_INDEX8||e===Pl.DEPTH_STENCIL||e===Pl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?Pl.RGBA32F:e===te.HALF_FLOAT_OES?Pl.RGBA16F:Pl.RGBA8}},zc=Object.freeze(Pl);function mP(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Nt.maximumRenderbufferSize,o=y(e.format,zc.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(mP.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});mP.prototype._getRenderbuffer=function(){return this._renderbuffer};mP.prototype.isDestroyed=function(){return!1};mP.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var pu=mP;function Ss(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(Ss.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});Ss.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};Ss.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,Ke.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,et.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Pt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:$t.NEAREST}),this._numSamples>1){let a=zc.getColorFormat(o);this._colorRenderbuffers[s]=new pu({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Pt({context:e,width:t,height:n,pixelFormat:et.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:$t.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new pu({context:e,width:t,height:n,format:zc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new pu({context:e,width:t,height:n,format:zc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Pt({context:e,width:t,height:n,pixelFormat:et.DEPTH_COMPONENT,pixelDatatype:Ke.UNSIGNED_INT,sampler:$t.NEAREST}):this._depthRenderbuffer=new pu({context:e,width:t,height:n,format:zc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new hP({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Nr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ss.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};Ss.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ss.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};Ss.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ss.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ss.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ss.prototype.getDepthTexture=function(){return this._depthTexture};Ss.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ss.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ss.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ss.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ss.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Ss.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Ss.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Ss.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Ss.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&l(o)&&!o.isDestroyed()&&o.destroy(),l(o)&&o.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var hi=Ss;var Ex={VERTEX:0,FRAGMENT:1,BOTH:2};Ex.includesVertexShader=function(e){return e===Ex.VERTEX||e===Ex.BOTH};Ex.includesFragmentShader=function(e){return e===Ex.FRAGMENT||e===Ex.BOTH};var pe=Object.freeze(Ex);function e9(e){this.name=e,this.fields=[]}e9.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};e9.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var pP=e9;function t9(e){this.signature=e,this.body=[]}t9.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};t9.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var _P=t9;function Hc(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Hc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Hc.prototype.addDefine=function(e,t,n){n=y(n,pe.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),pe.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),pe.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Hc.prototype.addStruct=function(e,t,n){this._structs[e]=new pP(t),pe.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),pe.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Hc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Hc.prototype.addFunction=function(e,t,n){this._functions[e]=new _P(t),pe.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),pe.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Hc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Hc.prototype.addUniform=function(e,t,n){n=y(n,pe.BOTH);let i=`uniform ${e} ${t};`;pe.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),pe.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Hc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Hc.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=rRe(e),i};Hc.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Hc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Hc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Hc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=oRe(this),i=sRe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` +${i}`};function cPe(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function jte(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function qte(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(jte(e,o))return o}}var lPe=["v_normalEC","v_normal"];zs.findNormalVarying=function(e){return jte(e,"#ifdef HAS_NORMALS")?cPe(e,"HAS_NORMALS")?"v_normalEC":void 0:qte(e,lPe)};var uPe=["v_positionEC"];zs.findPositionVarying=function(e){return qte(e,uPe)};var Ue=zs;function Ld(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Ld.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Ld.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function fPe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Ld.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Ue({sources:[t]})),typeof n=="string"&&(n=new Ue({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?fPe(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new $t({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};Ld.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){W6(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Ld.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Ld.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Ue({sources:[r]})),typeof s=="string"&&(s=new Ue({sources:[s]}));let c=this._context,u=r.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new $t({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[o]=p,d};function W6(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];W6(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Ld.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];W6(this,n),--this._numberOfShaders}this._shadersToRelease={}};Ld.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Ld.prototype.isDestroyed=function(){return!1};Ld.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var aP=Ld;function Nd(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=et.RGBA,pixelDatatype:o=Ke.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Zt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===et.RGB||i===et.LUMINANCE,d=et.toInternalFormat(i,o,t),p=et.isCompressedFormat(d),g=t._gl,m=p?et.compressedTextureSizeInBytes(i,c,u):et.textureSizeInBytes(i,o,c,u);this._id=e.id??zn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._dimensions=new z(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,Zte(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?et.isCompressedFormat(d)?dPe(this,n):Yte(this,n):l(n.framebuffer)?mPe(this,n):Xte(this,n),this._initialized=!0):Kte(this),g.bindTexture(this._textureTarget,null)}function dPe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=rU(c),u=rU(u),i.compressedTexImage2D(o,f+1,r,c,u,0,t.mipLevels[f])}}function Yte(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=et.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=et.flipY(p,c,u,s,a)),i.texImage2D(o,0,r,s,a,0,c,Ke.toWebGLConstant(u,n),p),l(t.mipLevels)){let g=s,m=a;for(let x=0;x<t.mipLevels.length;++x)g=rU(g),m=rU(m),i.texImage2D(o,x+1,r,g,m,0,c,Ke.toWebGLConstant(u,n),t.mipLevels[x])}}function hPe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=et.alignmentInBytes(c,u,o);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=et.flipY(t,c,u,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,c,Ke.toWebGLConstant(u,s),t)}function mPe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function Xte(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,Ke.toWebGLConstant(e.pixelDatatype,n),t)}function pPe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,Ke.toWebGLConstant(e.pixelDatatype,o),t)}function rU(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Kte(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Ke.toWebGLConstant(e._pixelDatatype,t),null)}Nd.create=function(e){return new Nd(e)};Nd.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,{pixelFormat:i=et.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:c}=e;return new Nd({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(Nd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Zte(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Zte(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Kt.NEAREST_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ke.FLOAT&&!r.textureFloatLinear||a===Ke.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Kt.NEAREST_MIPMAP_NEAREST:Kt.NEAREST,i=di.NEAREST),r.webgl2&&et.isDepthFormat(s)&&(n=Kt.NEAREST,i=di.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}Nd.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?Yte(this,i):Xte(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Kte(this)),this._initialized=!0),f||(l(i.arrayBufferView)?hPe(this,i.arrayBufferView,t,n,c,u):pPe(this,i,t,n)),s.bindTexture(a,null)};Nd.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._width),r=y(r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};Nd.prototype.generateMipmap=function(e){e=y(e,lm.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Nd.prototype.isDestroyed=function(){return!1};Nd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var It=Nd;function xx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(xx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});xx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};xx.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};xx.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};xx.prototype.isDestroyed=function(){return!1};xx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var cP=xx;function Af(e){this.planes=y(e,[])}var lP=[new h,new h,new h];h.clone(h.UNIT_X,lP[0]);h.clone(h.UNIT_Y,lP[1]);h.clone(h.UNIT_Z,lP[2]);var Hg=new h,_Pe=new h,$te=new rn(new h(1,0,0),0);Af.fromBoundingSphere=function(e,t){l(t)||(t=new Af);let n=lP.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=lP[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new oe),l(f)||(f=i[s+1]=new oe),h.multiplyByScalar(c,-r,Hg),h.add(o,Hg,Hg),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,Hg),h.multiplyByScalar(c,r,Hg),h.add(o,Hg,Hg),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,_Pe),Hg),s+=2}return t};Af.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(rn.fromCartesian4(t[i],$te));if(r===Wt.OUTSIDE)return Wt.OUTSIDE;r===Wt.INTERSECTING&&(n=!0)}return n?Wt.INTERSECTING:Wt.INSIDE};Af.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Af.MASK_OUTSIDE||t===Af.MASK_INSIDE)return t;let n=Af.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&!(t&s))continue;let a=e.intersectPlane(rn.fromCartesian4(i[o],$te));if(a===Wt.OUTSIDE)return Af.MASK_OUTSIDE;a===Wt.INTERSECTING&&(n|=s)}return n};Af.MASK_OUTSIDE=4294967295;Af.MASK_INSIDE=0;Af.MASK_INDETERMINATE=2147483647;var _s=Af;function um(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new _s,this._orthographicMatrix=new F}function Qte(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(um.prototype,{projectionMatrix:{get:function(){return Qte(this),this._orthographicMatrix}}});var gPe=new h,yPe=new h,xPe=new h,j6=new h;um.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,gPe);h.normalize(f,f);let d=yPe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=xPe;h.multiplyByScalar(f,a,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new oe),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new oe),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,j6),p),h.multiplyByScalar(n,r,p),h.add(d,p,p),g=i[2],l(g)||(g=i[2]=new oe),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-h.dot(n,p),h.multiplyByScalar(n,o,p),h.add(d,p,p),g=i[3],l(g)||(g=i[3]=new oe),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-h.dot(h.negate(n,j6),p),g=i[4],l(g)||(g=i[4]=new oe),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.add(e,p,p),g=i[5],l(g)||(g=i[5]=new oe),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-h.dot(h.negate(t,j6),p),this._cullingVolume};um.prototype.getPixelDimensions=function(e,t,n,i,o){Qte(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};um.prototype.clone=function(e){return l(e)||(e=new um),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};um.prototype.equals=function(e){return l(e)&&e instanceof um&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};um.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof um&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Fr=um;function Pl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Fr,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}Pl.packedLength=4;Pl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Pl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Pl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Gg(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(Pl.prototype,{projectionMatrix:{get:function(){return Gg(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Gg(this),this._offCenterFrustum}}});Pl.prototype.computeCullingVolume=function(e,t,n){return Gg(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Pl.prototype.getPixelDimensions=function(e,t,n,i,o){return Gg(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Pl.prototype.clone=function(e){return l(e)||(e=new Pl),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Pl.prototype.equals=function(e){return!l(e)||!(e instanceof Pl)?!1:(Gg(this),Gg(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Pl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Pl)?!1:(Gg(this),Gg(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var nn=Pl;var q6={};function bPe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var TPe=32.184,CPe=2451545;function gne(e,t){t=Z.addSeconds(e,TPe,t);let n=Z.totalDays(t)-CPe;return t=Z.addSeconds(t,bPe(n),t),t}var sU=new Z(2451545,0,Wn.TAI),APe=1e3,Ef=P.RADIANS_PER_DEGREE,hu=P.RADIANS_PER_ARCSECOND,Oa=14959787e4,Jte=new $;function yne(e,t,n,i,o,r,s){n<0&&(n=-n,o+=P.PI);let a=e*(1-t),c=i-o,u=o,f=SPe(r-i,t),d=EPe(t,0);PPe(c,n,u,Jte);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),x=1+t*g,b=p/x;return l(s)?(s.x=b*g,s.y=b*m,s.z=0):s=new h(b*g,b*m,0),$.multiplyByVector(Jte,s,s)}function EPe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function SPe(e,t){let n=DPe(e,t);return IPe(n,t)}var vPe=50,wPe=P.EPSILON8;function DPe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<vPe&&Math.abs(o-i)>wPe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*P.TWO_PI,o}function IPe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=P.zeroToTwoPi(r),e<0&&(r-=P.TWO_PI),r+=n*P.TWO_PI,r}function PPe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var RPe=1.0000010178*Oa,OPe=100.46645683*Ef,MPe=129597742283429e-5*hu,ene=16002,tne=21863,nne=32004,ine=10931,one=14529,rne=16368,sne=15318,ane=32794,LPe=64*1e-7*Oa,NPe=-152*1e-7*Oa,FPe=62*1e-7*Oa,BPe=-8*1e-7*Oa,kPe=32*1e-7*Oa,VPe=-41*1e-7*Oa,UPe=19*1e-7*Oa,zPe=-11*1e-7*Oa,HPe=-150*1e-7*Oa,GPe=-46*1e-7*Oa,WPe=68*1e-7*Oa,jPe=54*1e-7*Oa,qPe=14*1e-7*Oa,YPe=24*1e-7*Oa,XPe=-28*1e-7*Oa,KPe=22*1e-7*Oa,cne=10,lne=16002,une=21863,fne=10931,dne=1473,hne=32004,mne=4387,pne=73,ZPe=-325*1e-7,$Pe=-322*1e-7,QPe=-79*1e-7,JPe=232*1e-7,e1e=-52*1e-7,t1e=97*1e-7,n1e=55*1e-7,i1e=-41*1e-7,o1e=-105*1e-7,r1e=-137*1e-7,s1e=258*1e-7,a1e=35*1e-7,c1e=-116*1e-7,l1e=-88*1e-7,u1e=-112*1e-7,f1e=-80*1e-7,nA=new Z(0,0,Wn.TAI);function d1e(e,t){gne(e,nA);let i=(nA.dayNumber-sU.dayNumber+(nA.secondsOfDay-sU.secondsOfDay)/qn.SECONDS_PER_DAY)/(qn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=RPe+LPe*Math.cos(ene*o)+HPe*Math.sin(ene*o)+NPe*Math.cos(tne*o)+GPe*Math.sin(tne*o)+FPe*Math.cos(nne*o)+WPe*Math.sin(nne*o)+BPe*Math.cos(ine*o)+jPe*Math.sin(ine*o)+kPe*Math.cos(one*o)+qPe*Math.sin(one*o)+VPe*Math.cos(rne*o)+YPe*Math.sin(rne*o)+UPe*Math.cos(sne*o)+XPe*Math.sin(sne*o)+zPe*Math.cos(ane*o)+KPe*Math.sin(ane*o),s=OPe+MPe*i+ZPe*Math.cos(cne*o)+o1e*Math.sin(cne*o)+$Pe*Math.cos(lne*o)+r1e*Math.sin(lne*o)+QPe*Math.cos(une*o)+s1e*Math.sin(une*o)+JPe*Math.cos(fne*o)+a1e*Math.sin(fne*o)+e1e*Math.cos(dne*o)+c1e*Math.sin(dne*o)+t1e*Math.cos(hne*o)+l1e*Math.sin(hne*o)+n1e*Math.cos(mne*o)+u1e*Math.sin(mne*o)+i1e*Math.cos(pne*o)+f1e*Math.sin(pne*o),a=.0167086342-.0004203654*i,c=102.93734808*Ef+11612.3529*hu*i,u=469.97289*hu*i,f=174.87317577*Ef-8679.27034*hu*i;return yne(r,a,u,c,f,s,t)}function xne(e,t){gne(e,nA);let i=(nA.dayNumber-sU.dayNumber+(nA.secondsOfDay-sU.secondsOfDay)/qn.SECONDS_PER_DAY)/qn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Ef,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,d=83.35324312*Ef,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Ef,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*Ef,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,T=297.85019547*Ef+hu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),C=93.27209062*Ef+hu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),A=134.96340251*Ef+hu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),E=357.52910918*Ef+hu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*Ef-hu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),D=2*T,O=4*T,R=6*T,M=2*A,N=3*A,_=4*A,S=2*C;a+=3400.4*Math.cos(D)-635.6*Math.cos(D-A)-235.6*Math.cos(A)+218.1*Math.cos(D-E)+181*Math.cos(D+A),c+=.014216*Math.cos(D-A)+.008551*Math.cos(D-M)-.001383*Math.cos(A)+.001356*Math.cos(D+A)-.001147*Math.cos(O-N)-914e-6*Math.cos(O-M)+869e-6*Math.cos(D-E-A)-627e-6*Math.cos(D)-394e-6*Math.cos(O-_)+282e-6*Math.cos(D-E-M)-279e-6*Math.cos(T-A)-236e-6*Math.cos(M)+231e-6*Math.cos(O)+229e-6*Math.cos(R-_)-201e-6*Math.cos(M-S),f+=486.26*Math.cos(D-S)-40.13*Math.cos(D)+37.51*Math.cos(S)+25.73*Math.cos(M-S)+19.97*Math.cos(D-E-S),p+=-55609*Math.sin(D-A)-34711*Math.sin(D-M)-9792*Math.sin(A)+9385*Math.sin(O-N)+7505*Math.sin(O-M)+5318*Math.sin(D+A)+3484*Math.sin(O-_)-3417*Math.sin(D-E-A)-2530*Math.sin(R-_)-2376*Math.sin(D)-2075*Math.sin(D-N)-1883*Math.sin(M)-1736*Math.sin(R-5*A)+1626*Math.sin(E)-1370*Math.sin(R-N),m+=-5392*Math.sin(D-S)-540*Math.sin(E)-441*Math.sin(D)+423*Math.sin(S)-288*Math.sin(M-S),b+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-A)-662.5*Math.sin(E)+396.3*Math.sin(A)-218*Math.sin(D-E);let w=2*v,I=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(D-S+v)*i+.614*Math.cos(D-S-v)*i-.0297*Math.cos(w)*o-.0335*Math.cos(v)*o+.0012*Math.cos(D-S+w)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(w)*r;let L=2.116*Math.sin(v)*i-.111*Math.sin(D-S-v)*i-.0015*Math.sin(v)*o;p+=L,b+=L,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(D-S+v)*i+1.12*Math.sin(D-v)*i-1.06*Math.sin(S-v)*i+.66*Math.sin(w)*o+.371*Math.sin(v)*o-.035*Math.sin(D-S+w)*o-.015*Math.sin(D-S+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(w)*r,a*=APe;let B=u+f*hu,U=d+p*hu,V=x+b*hu,G=g+m*hu;return yne(a,c,B,U,G,V,t)}var _ne=.012300034,h1e=_ne/(_ne+1)*-1;function m1e(e,t){return t=xne(e,t),h.multiplyByScalar(t,h1e,t)}var bne=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),uP=new h;q6.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Z.now()),l(t)||(t=new h),uP=d1e(e,uP),t=h.negate(uP,t),m1e(e,uP),h.subtract(t,uP,t),$.multiplyByVector(bne,t,t),t};q6.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Z.now()),t=xne(e,t),$.multiplyByVector(bne,t,t),t};var Wg=q6;var aU={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};aU.getMorphTime=function(e){return e===aU.SCENE3D?1:e===aU.MORPHING?void 0:0};var ne=Object.freeze(aU);function p1e(e){e=y(e,y.EMPTY_OBJECT),this.color=H.clone(y(e.color,H.WHITE)),this.intensity=y(e.intensity,2)}var Pp=p1e;function iA(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new je,this._viewportCartesian4=new oe,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new z,this._currentFrustum=new z,this._frustumPlanes=new oe,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Hn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new z,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new z,this._modelToEnu=new F,this._enuToModel=new F,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new H,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(iA.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!je.equals(e,this._viewport)){je.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Cne(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Cne(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return X6(this),this._view3D}},viewRotation:{get:function(){return X6(this),this._viewRotation}},viewRotation3D:{get:function(){return X6(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Sne(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Sne(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return v1e(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return w1e(this),this._modelView}},modelView3D:{get:function(){return D1e(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return L1e(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return I1e(this),this._inverseModelView}},inverseModelView3D:{get:function(){return P1e(this),this._inverseModelView3D}},viewProjection:{get:function(){return R1e(this),this._viewProjection}},inverseViewProjection:{get:function(){return O1e(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return M1e(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return N1e(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return F1e(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return B1e(this),this._modelViewInfiniteProjection}},normal:{get:function(){return k1e(this),this._normal}},normal3D:{get:function(){return V1e(this),this._normal3D}},inverseNormal:{get:function(){return U1e(this),this._inverseNormal}},inverseNormal3D:{get:function(){return z1e(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return Ene(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Ene(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,ee.default)}}});function _1e(e,t){F.clone(t,e._view),F.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function g1e(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function y1e(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function x1e(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Tne=new h,b1e=new F;function T1e(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=h.fromRadians(o.longitude,o.latitude,0,n,Tne)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Tne)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Ot.eastNorthUpToFixedFrame(i,n,b1e);e._enuToModel=F.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=F.inverseTransformation(e._enuToModel,e._modelToEnu),P.equalsEpsilon(n._radii.x,n._radii.y,P.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var Y6=new $,C1e=new fe;function A1e(e,t){Ot.computeIcrfToCentralBodyFixedMatrix(t.time,Y6);let n=Wg.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(Y6,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Wg.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(Y6,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,C1e);i.project(r,e._sunPositionColumbusView)}iA.prototype.updateCamera=function(e){_1e(this,e.viewMatrix),g1e(this,e.inverseViewMatrix),T1e(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof nn};iA.prototype.updateFrustum=function(e){y1e(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&x1e(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};iA.prototype.updatePass=function(e){this._pass=e};var E1e=[],S1e=new Pp;iA.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ne.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),A1e(this,e);let n=y(e.light,S1e);n instanceof Pp?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=h.multiplyByScalar(o,n.intensity,o);let r=h.maximumComponent(o);r>1?h.divideByScalar(o,r,this._lightColor):h.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,E1e),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Ot.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,H.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Cne(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function v1e(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function w1e(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function D1e(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function I1e(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function P1e(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function R1e(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function O1e(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function M1e(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function L1e(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function N1e(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function F1e(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function B1e(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function k1e(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function V1e(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function U1e(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;F.getMatrix3(e.modelView,t),$.transpose(t,t)}}function z1e(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;F.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var Ane=new h;function Ene(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,Ane),Hn.fromCartesian(Ane,e._encodedCameraPositionMC))}var H1e=new h,G1e=new h,W1e=new h,j1e=new h,q1e=new fe,Y1e=new h,X1e=new F;function K1e(e,t,n,i,o,r,s,a){let c=H1e;c.x=e.y,c.y=e.z,c.z=e.x;let u=G1e;u.x=n.y,u.y=n.z,u.z=n.x;let f=W1e;f.x=i.y,f.y=i.z,f.z=i.x;let d=j1e;d.x=t.y,d.y=t.z,d.z=t.x,r===ne.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,q1e);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,Y1e),x=Ot.eastNorthUpToFixedFrame(m,g,X1e);return F.multiplyByPointAsVector(x,u,u),F.multiplyByPointAsVector(x,f,f),F.multiplyByPointAsVector(x,d,d),l(a)||(a=new F),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function X6(e){e._view3DDirty&&(e._mode===ne.SCENE3D?F.clone(e._view,e._view3D):K1e(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Sne(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var fP=iA;function mu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):Z1e(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=zn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new aP(this),this._textureCache=new cP;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Lt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Lt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Lt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Lt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Lt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Lt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Lt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Lt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Lt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Lt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Lt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Lt._minimumAliasedLineWidth=f[0],Lt._maximumAliasedLineWidth=f[1];let d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Lt._minimumAliasedPointSize=d[0],Lt._maximumAliasedPointSize=d[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Lt._maximumViewportWidth=p[0],Lt._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Lt._highpFloatSupported=g.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Lt._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Ar(u,["OES_standard_derivatives"]),this._blendMinmax=!!Ar(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Ar(u,["OES_element_index_uint"]),this._depthTexture=!!Ar(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Ar(u,["EXT_frag_depth"]),this._debugShaders=Ar(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Ar(u,["OES_texture_float"]),this._textureHalfFloat=!!Ar(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Ar(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Ar(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Ar(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Ar(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Ar(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Ar(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Ar(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Ar(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Ar(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Ar(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Ar(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Ar(u,["EXT_texture_compression_bptc"]),Il.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?Ar(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Lt._maximumTextureFilterAnisotropy=l(x)?u.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,T,C,A,E,v,D,O,R,M;if(c){let w=this;b=function(){return w._gl.createVertexArray()},T=function(I){w._gl.bindVertexArray(I)},C=function(I){w._gl.deleteVertexArray(I)},A=function(I,L,B,U,V){u.drawElementsInstanced(I,L,B,U,V)},E=function(I,L,B,U){u.drawArraysInstanced(I,L,B,U)},v=function(I,L){u.vertexAttribDivisor(I,L)},D=function(I){u.drawBuffers(I)}}else O=Ar(u,["OES_vertex_array_object"]),l(O)&&(b=function(){return O.createVertexArrayOES()},T=function(w){O.bindVertexArrayOES(w)},C=function(w){O.deleteVertexArrayOES(w)}),R=Ar(u,["ANGLE_instanced_arrays"]),l(R)&&(A=function(w,I,L,B,U){R.drawElementsInstancedANGLE(w,I,L,B,U)},E=function(w,I,L,B){R.drawArraysInstancedANGLE(w,I,L,B)},v=function(w,I){R.vertexAttribDivisorANGLE(w,I)}),M=Ar(u,["WEBGL_draw_buffers"]),l(M)&&(D=function(w){M.drawBuffersWEBGL(w)});this.glCreateVertexArray=b,this.glBindVertexArray=T,this.glDeleteVertexArray=C,this.glDrawElementsInstanced=A,this.glDrawArraysInstanced=E,this.glVertexAttribDivisor=v,this.glDrawBuffers=D,this._vertexArrayObject=!!O,this._instancedArrays=!!R,this._drawBuffers=!!M,Lt._maximumDrawBuffers=this.drawBuffers?u.getParameter(te.MAX_DRAW_BUFFERS):1,Lt._maximumColorAttachments=this.drawBuffers?u.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new H(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let N=new fP,_=new sc(this),S=Ve.fromCache();this._defaultPassState=_,this._defaultRenderState=S,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=N,this._currentRenderState=S,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let w=0;w<Lt._maximumVertexAttributes;w++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ve.apply(u,S,_)}function Z1e(e,t,n){if(typeof WebGLRenderingContext>"u")throw new re("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new re("The browser supports WebGL, but initialization failed.");return r}function $1e(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function Q1e(e,t,n,i){let o=`${$1e(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function J1e(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new re(Q1e(e,t,n,i))}function eRe(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function tRe(e,t){if(!l(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,eRe(e,o,t))}return i}function Ar(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var nRe={};Object.defineProperties(mu.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=tRe(this._originalGLContext,e?J1e:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new It({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new It({context:this,pixelFormat:et.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new It({context:this,pixelFormat:et.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new Cr({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return nRe}}});function vne(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,o,t,r,n,i)}var K6;typeof WebGLRenderingContext<"u"&&(K6=[te.BACK]);function Z6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=K6;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var iRe=new ei;mu.prototype.clear=function(e,t){e=y(e,iRe),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(H.equals(this._clearColor,o)||(H.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);vne(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);Z6(this,c),n.clear(i)};function oRe(e,t,n,i,o){Z6(e,t),vne(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function rRe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,F.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}mu.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),oRe(this,o,t,n,r),rRe(this,e,n,i)};mu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=K6;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};mu.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),o=y(e.width,t.drawingBufferWidth),r=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=Ke.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=et.createTypedArray(et.RGBA,a,o,r);return Z6(this,s),t.readPixels(n,i,o,r,et.RGBA,Ke.toWebGLConstant(a,this),c),c};var wne={position:0,textureCoordinates:1};mu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new st({attributes:{position:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Me.TRIANGLES});e=ti.fromGeometry({context:this,geometry:t,attributeLocations:wne,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};mu.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new Ze({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Me.TRIANGLES,renderState:t.renderState,shaderProgram:$t.fromCache({context:this,vertexShaderSource:lx,fragmentShaderSource:e,attributeLocations:wne}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};mu.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function $6(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties($6.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});$6.prototype.destroy=function(){delete this._pickObjects[this.key]};mu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new re("Out of unique Pick IDs.");return this._pickObjects[t]=e,new $6(this._pickObjects,t,H.fromRgba(t))};mu.prototype.isDestroyed=function(){return!1};mu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};mu._deprecationWarning=ms;var dP=mu;function oA(e){e=y(e,y.EMPTY_OBJECT);let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new he("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new he("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Nr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new Nr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}oA.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};oA.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};oA.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};oA.prototype.isDestroyed=function(){return!1};oA.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var hP=oA;var Rl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===Rl.RGBA4||e===Rl.RGBA8||e===Rl.RGBA16F||e===Rl.RGBA32F||e===Rl.RGB5_A1||e===Rl.RGB565||e===Rl.DEPTH_COMPONENT16||e===Rl.STENCIL_INDEX8||e===Rl.DEPTH_STENCIL||e===Rl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?Rl.RGBA32F:e===te.HALF_FLOAT_OES?Rl.RGBA16F:Rl.RGBA8}},zc=Object.freeze(Rl);function mP(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Lt.maximumRenderbufferSize,o=y(e.format,zc.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(mP.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});mP.prototype._getRenderbuffer=function(){return this._renderbuffer};mP.prototype.isDestroyed=function(){return!1};mP.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var pu=mP;function Ss(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(Ss.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});Ss.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};Ss.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,Ke.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,et.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new It({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:Zt.NEAREST}),this._numSamples>1){let a=zc.getColorFormat(o);this._colorRenderbuffers[s]=new pu({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new It({context:e,width:t,height:n,pixelFormat:et.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:Zt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new pu({context:e,width:t,height:n,format:zc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new pu({context:e,width:t,height:n,format:zc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new It({context:e,width:t,height:n,pixelFormat:et.DEPTH_COMPONENT,pixelDatatype:Ke.UNSIGNED_INT,sampler:Zt.NEAREST}):this._depthRenderbuffer=new pu({context:e,width:t,height:n,format:zc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new hP({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Nr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ss.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};Ss.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ss.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};Ss.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ss.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ss.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ss.prototype.getDepthTexture=function(){return this._depthTexture};Ss.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ss.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ss.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ss.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ss.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Ss.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Ss.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Ss.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Ss.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&l(o)&&!o.isDestroyed()&&o.destroy(),l(o)&&o.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var hi=Ss;var bx={VERTEX:0,FRAGMENT:1,BOTH:2};bx.includesVertexShader=function(e){return e===bx.VERTEX||e===bx.BOTH};bx.includesFragmentShader=function(e){return e===bx.FRAGMENT||e===bx.BOTH};var _e=Object.freeze(bx);function Q6(e){this.name=e,this.fields=[]}Q6.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};Q6.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var pP=Q6;function J6(e){this.signature=e,this.body=[]}J6.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};J6.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var _P=J6;function Hc(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Hc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Hc.prototype.addDefine=function(e,t,n){n=y(n,_e.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),_e.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),_e.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Hc.prototype.addStruct=function(e,t,n){this._structs[e]=new pP(t),_e.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),_e.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Hc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Hc.prototype.addFunction=function(e,t,n){this._functions[e]=new _P(t),_e.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),_e.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Hc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Hc.prototype.addUniform=function(e,t,n){n=y(n,_e.BOTH);let i=`uniform ${e} ${t};`;_e.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),_e.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Hc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Hc.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=aRe(e),i};Hc.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Hc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Hc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Hc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=sRe(this),i=cRe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` `),r=new Ue({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` -`),a=new Ue({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Hc.prototype.clone=function(){return Ge(this,!0)};function oRe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function rRe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function sRe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var Sx=Hc;function Hs(e,t,n,i){let o=Hs._verifyAttributes(t);n=y(n,0);let r=[],s={},a,c,u=o.length;for(let d=0;d<u;++d){let p=o[d];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return X.getSizeInBytes(p.componentDatatype)-X.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=Hs._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Hs._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=y(i,!1),this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Hs._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:y(o.index,i),enabled:y(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:y(o.componentDatatype,X.FLOAT),normalize:y(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:y(o.usage,Fe.STATIC_DRAW)};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};Hs._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*X.getSizeInBytes(a.componentDatatype)}let i=n>0?X.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Hs._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/X.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*X.getSizeInBytes(a)}return n};Hs.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];Hs._resize(o,this._size),Hs._appendWriters(this.writers,o)}n9(this)};Hs._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=X.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var aRe=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Hs._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=aRe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Hs.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=cRe(this,i)||t;if(t||!l(this.va)){n9(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let d=u*(i.vertexSizeInBytes*a);Hs._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new ei({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function cRe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=gt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Hs._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Hs.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)lRe(n[i],e,t)};function lRe(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Hs.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function n9(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Hs.prototype.isDestroyed=function(){return!1};Hs.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return n9(this),ue(this)};var Mp=Hs;function uRe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Se.createIfNeeded(t.positiveX).fetchImage(i),Se.createIfNeeded(t.negativeX).fetchImage(i),Se.createIfNeeded(t.positiveY).fetchImage(i),Se.createIfNeeded(t.negativeY).fetchImage(i),Se.createIfNeeded(t.positiveZ).fetchImage(i),Se.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Cr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var gP=uRe;var rA=`#ifdef MRT -layout (location = 0) out vec4 out_FragData_0; -layout (location = 1) out vec4 out_FragData_1; -#else -layout (location = 0) out vec4 out_FragColor; -#endif - -uniform vec4 u_bgColor; -uniform sampler2D u_depthTexture; - -in vec2 v_textureCoordinates; +`),a=new Ue({defines:this._fragmentShaderParts.defineLines,sources:[s]});return $t.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Hc.prototype.clone=function(){return Ge(this,!0)};function sRe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function aRe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function cRe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var Tx=Hc;function Hs(e,t,n,i){let o=Hs._verifyAttributes(t);n=y(n,0);let r=[],s={},a,c,u=o.length;for(let d=0;d<u;++d){let p=o[d];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return X.getSizeInBytes(p.componentDatatype)-X.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=Hs._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Hs._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=y(i,!1),this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Hs._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:y(o.index,i),enabled:y(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:y(o.componentDatatype,X.FLOAT),normalize:y(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:y(o.usage,Fe.STATIC_DRAW)};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};Hs._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*X.getSizeInBytes(a.componentDatatype)}let i=n>0?X.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Hs._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/X.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*X.getSizeInBytes(a)}return n};Hs.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];Hs._resize(o,this._size),Hs._appendWriters(this.writers,o)}e9(this)};Hs._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=X.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var lRe=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Hs._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=lRe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Hs.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=uRe(this,i)||t;if(t||!l(this.va)){e9(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let d=u*(i.vertexSizeInBytes*a);Hs._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new ti({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function uRe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=_t.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Hs._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Hs.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)fRe(n[i],e,t)};function fRe(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Hs.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function e9(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Hs.prototype.isDestroyed=function(){return!1};Hs.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return e9(this),ue(this)};var Rp=Hs;function dRe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Se.createIfNeeded(t.positiveX).fetchImage(i),Se.createIfNeeded(t.negativeX).fetchImage(i),Se.createIfNeeded(t.positiveY).fetchImage(i),Se.createIfNeeded(t.negativeY).fetchImage(i),Se.createIfNeeded(t.positiveZ).fetchImage(i),Se.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Cr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var gP=dRe;function jg(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new pe,this.setValue(e)}Object.defineProperties(jg.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});jg.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};jg.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};jg.prototype.equals=function(e){return this===e||e instanceof jg&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};jg.prototype.valueOf=function(){return this._value};jg.prototype.toString=function(){return String(this._value)};var Kn=jg;function hRe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function mRe(e){return new Kn(e)}function pRe(e,t,n){return hRe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,mRe))}var le=pRe;function yP(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(yP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance"),splitDirection:le("splitDirection")});yP.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new yP(this)};yP.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var ac=yP;function Cx(){this._array=[],this._hash={}}Object.defineProperties(Cx.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Cx.prototype.contains=function(e){return l(this._hash[e])};Cx.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Cx.prototype.get=function(e){return this._hash[e]};Cx.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};Cx.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Et=Cx;function _u(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(_u.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});_u.packedLength=2;_u.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};_u.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new _u),n.near=e[t++],n.far=e[t],n};_u.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};_u.clone=function(e,t){if(l(e))return l(t)||(t=new _u),t.near=e.near,t.far=e.far,t};_u.prototype.clone=function(e){return _u.clone(this,e)};_u.prototype.equals=function(e){return _u.equals(this,e)};var Mt=_u;function Sf(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}Sf.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Sf(e.near,e.nearValue,e.far,e.farValue)};Sf.packedLength=4;Sf.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Sf.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Sf),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Sf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Sf.prototype.clone=function(e){return Sf.clone(this,e)};Sf.prototype.equals=function(e){return Sf.equals(this,e)};var Bt=Sf;var Ax={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},Ye=Object.freeze(Ax);function vf(e){return e===Ax.CLAMP_TO_GROUND||e===Ax.CLAMP_TO_3D_TILE||e===Ax.CLAMP_TO_TERRAIN}function rA(e){return e===Ax.RELATIVE_TO_GROUND||e===Ax.RELATIVE_TO_3D_TILE||e===Ax.RELATIVE_TO_TERRAIN}var _Re={CENTER:0,LEFT:1,RIGHT:-1},yi=Object.freeze(_Re);var gRe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Rn=Object.freeze(gRe);var yRe={DONE:0,PENDING:1,FAILED:2},at=Object.freeze(yRe);function Fd(){he.throwInstantiationError()}Object.defineProperties(Fd.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});Fd.prototype.getValue=he.throwInstantiationError;Fd.prototype.equals=he.throwInstantiationError;Fd.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Fd.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!Fd.equals(e[i],t[i]))return!1;return!0};Fd.isConstant=function(e){return!l(e)||e.isConstant};Fd.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Fd.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};Fd.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var Y=Fd;var xRe={LEFT:-1,NONE:0,RIGHT:1},Br=Object.freeze(xRe);var bRe=H.WHITE,TRe=h.ZERO,CRe=Ye.NONE,ARe=z.ZERO,ERe=1,SRe=0,vRe=h.ZERO,wRe=yi.CENTER,DRe=Rn.CENTER,IRe=!1,PRe=Br.NONE,RRe=new h,ORe=new H,MRe=new h,LRe=new z,NRe=new Bt,FRe=new Bt,BRe=new Bt,kRe=new je,VRe=new Mt;function Dne(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function qg(e,t){t.collectionChanged.addEventListener(qg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}qg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;if(f&&(d=Y.getValueOrUndefined(s._position,e,RRe),c=Y.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){t9(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u),u.show=f,(!l(u.image)||r.textureValue!==c)&&(u.image=c,r.textureValue=c),u.position=d,u.color=Y.getValueOrDefault(a._color,e,bRe,ORe),u.eyeOffset=Y.getValueOrDefault(a._eyeOffset,e,TRe,MRe),u.heightReference=Y.getValueOrDefault(a._heightReference,e,CRe),u.pixelOffset=Y.getValueOrDefault(a._pixelOffset,e,ARe,LRe),u.scale=Y.getValueOrDefault(a._scale,e,ERe),u.rotation=Y.getValueOrDefault(a._rotation,e,SRe),u.alignedAxis=Y.getValueOrDefault(a._alignedAxis,e,vRe),u.horizontalOrigin=Y.getValueOrDefault(a._horizontalOrigin,e,wRe),u.verticalOrigin=Y.getValueOrDefault(a._verticalOrigin,e,DRe),u.width=Y.getValueOrUndefined(a._width,e),u.height=Y.getValueOrUndefined(a._height,e),u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,NRe),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,FRe),u.pixelOffsetScaleByDistance=Y.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,BRe),u.sizeInMeters=Y.getValueOrDefault(a._sizeInMeters,e,IRe),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,VRe),u.disableDepthTestDistance=Y.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=Y.getValueOrDefault(a._splitDirection,e,PRe);let p=Y.getValueOrUndefined(a._imageSubRegion,e,kRe);l(p)&&u.setImageSubRegion(u._imageId,p)}return!0};qg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return at.FAILED;let i=n.billboard;if(i.heightReference===Ye.NONE)t.center=h.clone(i.position,t.center);else{if(!l(i._clampedPosition))return at.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,at.DONE};qg.prototype.isDestroyed=function(){return!1};qg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};qg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new Dne(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Dne(r)):(t9(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],t9(s.get(r.id),r,a),s.remove(r.id)};function t9(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var xP=qg;var URe=new h;function fm(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}fm.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new fm({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};fm.fromAxisAlignedBoundingBox=function(e){return new fm({minimum:e.minimum,maximum:e.maximum})};fm.packedLength=2*h.packedLength+1;fm.pack=function(e,t,n){return n=y(n,0),h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=y(e._offsetAttribute,-1),t};var Pne=new h,Rne=new h,Ine={minimum:Pne,maximum:Rne,offsetAttribute:void 0};fm.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Pne),o=h.unpack(e,t+h.packedLength,Rne),r=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Ine.offsetAttribute=r===-1?void 0:r,new fm(Ine))};fm.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new un,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=h.subtract(n,t,URe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===on.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new st({attributes:i,indices:o,primitiveType:Me.LINES,boundingSphere:new ae(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var Bd=fm;function sA(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([H.floatToByte(e),H.floatToByte(t),H.floatToByte(n),H.floatToByte(i)])}Object.defineProperties(sA.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});sA.fromColor=function(e){return new sA(e.red,e.green,e.blue,e.alpha)};sA.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};sA.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Gt=sA;function bP(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(bP.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});bP.fromDistanceDisplayCondition=function(e){return new bP(e.near,e.far)};bP.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Bn=bP;function zRe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var St=zRe;function er(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?Z.clone(e.start):new Z,this.stop=l(e.stop)?Z.clone(e.stop):new Z,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(er.prototype,{isEmpty:{get:function(){let e=Z.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var aA={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};er.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new he("options.iso8601 is an invalid ISO 8601 interval.");let i=Z.fromIso8601(n[0]),o=Z.fromIso8601(n[1]),r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(aA.start=i,aA.stop=o,aA.isStartIncluded=r,aA.isStopIncluded=s,aA.data=a,new er(aA))};er.toIso8601=function(e,t){return`${Z.toIso8601(e.start,t)}/${Z.toIso8601(e.stop,t)}`};er.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new er(e)};er.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Z.equals(e.start,t.start)&&Z.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};er.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Z.equalsEpsilon(e.start,t.start,n)&&Z.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};er.intersect=function(e,t,n,i){if(!l(t))return er.clone(er.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=Z.greaterThanOrEquals(s,o)&&Z.greaterThanOrEquals(r,s),u=!c&&Z.lessThanOrEquals(s,o)&&Z.lessThanOrEquals(o,a);if(!c&&!u)return er.clone(er.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=Z.lessThan(r,a);return l(n)||(n=new er),n.start=c?s:o,n.isStartIncluded=f&&p||!Z.equals(s,o)&&(c&&p||u&&f),n.stop=m?r:a,n.isStopIncluded=m?d:d&&g||!Z.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};er.contains=function(e,t){if(e.isEmpty)return!1;let n=Z.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=Z.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};er.prototype.clone=function(e){return er.clone(this,e)};er.prototype.equals=function(e,t){return er.equals(this,e,t)};er.prototype.equalsEpsilon=function(e,t,n){return er.equalsEpsilon(this,e,t,n)};er.prototype.toString=function(){return er.toIso8601(this)};er.EMPTY=Object.freeze(new er({start:new Z,stop:new Z,isStartIncluded:!1,isStopIncluded:!1}));var An=er;var One=Object.freeze(Z.fromIso8601("0000-01-01T00:00:00Z")),Mne=Object.freeze(Z.fromIso8601("9999-12-31T24:00:00Z")),HRe=Object.freeze(new An({start:One,stop:Mne})),GRe={MINIMUM_VALUE:One,MAXIMUM_VALUE:Mne,MAXIMUM_INTERVAL:HRe},He=GRe;function TP(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(TP.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});TP.fromCartesian3=function(e){return new TP(e.x,e.y,e.z)};TP.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Ji=TP;function cU(e){e=y(e,!0),this.value=cU.toValue(e)}Object.defineProperties(cU.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});cU.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var gn=cU;var CP=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec3 v_tangentEC; +in vec3 v_bitangentEC; +in vec2 v_st; void main() { - if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) - { -#ifdef MRT - out_FragData_0 = u_bgColor; - out_FragData_1 = vec4(u_bgColor.a); -#else - out_FragColor = u_bgColor; + vec3 positionToEyeEC = -v_positionEC; + mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); #endif - return; + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = tangentToEyeMatrix; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var AP=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec3 tangent; +in vec3 bitangent; +in vec2 st; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec3 v_tangentEC; +out vec3 v_bitangentEC; +out vec2 v_st; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_tangentEC = czm_normal * tangent; // tangent in eye coordinates + v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var EP=`in vec3 v_positionEC; +in vec3 v_normalEC; + +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var SP=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var vP=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; + +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var wP=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec2 st; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec2 v_st; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var WRe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX},Ma=Object.freeze(WRe);var jRe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE},Eo=Object.freeze(jRe);var qRe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ma.ADD,equationAlpha:Ma.ADD,functionSourceRgb:Eo.SOURCE_ALPHA,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ma.ADD,equationAlpha:Ma.ADD,functionSourceRgb:Eo.ONE,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Ma.ADD,equationAlpha:Ma.ADD,functionSourceRgb:Eo.SOURCE_ALPHA,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE,functionDestinationAlpha:Eo.ONE})},ln=Object.freeze(qRe);var YRe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK},xi=Object.freeze(YRe);function cA(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(cA.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});cA.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` +`)};cA.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};cA.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ge(this.renderState,!1);return e?(t.depthMask=!1,t.blending=ln.ALPHA_BLEND):t.depthMask=!0,t};cA.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=ln.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:xi.BACK}),l(n)&&(i=xt(n,i,!0)),i};var io=cA;var DP=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; +} +`;var IP=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + vec2 centerPixel = fract(repeat * st); + float centerBump = texture(image, centerPixel).channel; + + float imageWidth = float(imageDimensions.x); + vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); + float rightBump = texture(image, rightPixel).channel; + + float imageHeight = float(imageDimensions.y); + vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); + float topBump = texture(image, leftPixel).channel; + + vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + material.diffuse = vec3(0.01); + + return material; +} +`;var PP=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 + + // Find the distance from the closest separator (region between two colors) + float scaledWidth = fract(repeat.s * st.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(repeat.t * st.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + float value = min(scaledWidth, scaledHeight); + + vec4 currentColor = mix(lightColor, darkColor, b); + vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); + + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; +} +`;var RP=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 + + vec4 color = mix(lightColor, darkColor, b); + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; +} +`;var OP=`uniform sampler2D heights; +uniform sampler2D colors; + +// This material expects heights to be sorted from lowest to highest. + +float getHeight(int idx, float invTexSize) +{ + vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); +#ifdef OES_texture_float + return texture(heights, uv).x; +#else + return czm_unpackFloat(texture(heights, uv)); +#endif +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float height = materialInput.height; + float invTexSize = 1.0 / float(heightsDimensions.x); + + float minHeight = getHeight(0, invTexSize); + float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); + + // early-out when outside the height range + if (height < minHeight || height > maxHeight) { + material.diffuse = vec3(0.0); + material.alpha = 0.0; + return material; + } + + // Binary search to find heights above and below. + int idxBelow = 0; + int idxAbove = heightsDimensions.x; + float heightBelow = minHeight; + float heightAbove = maxHeight; + + // while loop not allowed, so use for loop with max iterations. + // maxIterations of 16 supports a texture size up to 65536 (2^16). + const int maxIterations = 16; + for (int i = 0; i < maxIterations; i++) { + if (idxBelow >= idxAbove - 1) { + break; + } + + int idxMid = (idxBelow + idxAbove) / 2; + float heightTex = getHeight(idxMid, invTexSize); + + if (height > heightTex) { + idxBelow = idxMid; + heightBelow = heightTex; + } else { + idxAbove = idxMid; + heightAbove = heightTex; + } + } + + float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); + vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); + vec4 color = texture(colors, colorUv); + + // undo preumultiplied alpha + if (color.a > 0.0) + { + color.rgb /= color.a; } - discard; + color.rgb = czm_gammaCorrect(color.rgb); + + material.diffuse = color.rgb; + material.alpha = color.a; + return material; } -`;var Bd=`uniform vec3 u_radiiAndDynamicAtmosphereColor; +`;var MP=`uniform vec4 color; +uniform float spacing; +uniform float width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float distanceToContour = mod(materialInput.height, spacing); + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float dxc = abs(dFdx(materialInput.height)); + float dyc = abs(dFdy(materialInput.height)); + float dF = max(dxc, dyc) * czm_pixelRatio * width; + float alpha = (distanceToContour < dF) ? 1.0 : 0.0; +#else + // If no derivatives available (IE 10?), use pixel ratio + float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; +#endif + + vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var LP=`uniform sampler2D image; +uniform float minimumHeight; +uniform float maximumHeight; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); + vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; +} +`;var NP=`uniform vec4 fadeInColor; +uniform vec4 fadeOutColor; +uniform float maximumDistance; +uniform bool repeat; +uniform vec2 fadeDirection; +uniform vec2 time; + +float getTime(float t, float coord) +{ + float scalar = 1.0 / maximumDistance; + float q = distance(t, coord) * scalar; + if (repeat) + { + float r = distance(t, coord + 1.0) * scalar; + float s = distance(t, coord - 1.0) * scalar; + q = min(min(r, s), q); + } + return clamp(q, 0.0, 1.0); +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float s = getTime(time.x, st.s) * fadeDirection.s; + float t = getTime(time.y, st.t) * fadeDirection.t; + + float u = length(vec2(s, t)); + vec4 color = mix(fadeInColor, fadeOutColor, u); + + color = czm_gammaCorrect(color); + material.emission = color.rgb; + material.alpha = color.a; + + return material; +} +`;var FP=`uniform vec4 color; +uniform float cellAlpha; +uniform vec2 lineCount; +uniform vec2 lineThickness; +uniform vec2 lineOffset; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + + float value; + + // Fuzz Factor - Controls blurriness of lines +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + const float fuzz = 1.2; + vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; + + // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. + vec2 dx = abs(dFdx(st)); + vec2 dy = abs(dFdy(st)); + vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; + value = min( + smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), + smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); +#else + // If no derivatives available (IE 10?), revert to view-dependent fuzz + const float fuzz = 0.05; + + vec2 range = 0.5 - (lineThickness * 0.05); + value = min( + 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), + 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); +#endif + + // Edges taken from RimLightingMaterial.glsl + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); + float sRim = smoothstep(0.8, 1.0, dRim); + value *= (1.0 - sRim); + + vec4 halfColor; + halfColor.rgb = color.rgb * 0.5; + halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); + halfColor = czm_gammaCorrect(halfColor); + material.diffuse = halfColor.rgb; + material.emission = halfColor.rgb; + material.alpha = halfColor.a; + + return material; +} +`;var BP=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec4 textureValue = texture(image, fract(repeat * materialInput.st)); + vec3 normalTangentSpace = textureValue.channels; + normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; + normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); + normalTangentSpace = normalize(normalTangentSpace); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + + return material; +} +`;var kP=`uniform vec4 color; + +float getPointOnLine(vec2 p0, vec2 p1, float x) +{ + float slope = (p0.y - p1.y) / (p0.x - p1.x); + return slope * (x - p0.x) + p0.y; +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; +#else + // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head + float base = 0.975; +#endif + + vec2 center = vec2(1.0, 0.5); + float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); + float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); + + float halfWidth = 0.15; + float s = step(0.5 - halfWidth, st.t); + s *= 1.0 - step(0.5 + halfWidth, st.t); + s *= 1.0 - step(base, st.s); + + float t = step(base, materialInput.st.s); + t *= 1.0 - step(ptOnUpperLine, st.t); + t *= step(ptOnLowerLine, st.t); + + // Find the distance from the closest separator (region between two colors) + float dist; + if (st.s < base) + { + float d1 = abs(st.t - (0.5 - halfWidth)); + float d2 = abs(st.t - (0.5 + halfWidth)); + dist = min(d1, d2); + } + else + { + float d1 = czm_infinity; + if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) + { + d1 = abs(st.s - base); + } + float d2 = abs(st.t - ptOnUpperLine); + float d3 = abs(st.t - ptOnLowerLine); + dist = min(min(d1, d2), d3); + } + + vec4 outsideColor = vec4(0.0); + vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); + vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); + + outColor = czm_gammaCorrect(outColor); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + return material; +} +`;var VP=`uniform vec4 color; +uniform vec4 gapColor; +uniform float dashLength; +uniform float dashPattern; +in float v_polylineAngle; + +const float maskLength = 16.0; + +mat2 rotate(float rad) { + float c = cos(rad); + float s = sin(rad); + return mat2( + c, s, + -s, c + ); +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; + + // Get the relative position within the dash from 0 to 1 + float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); + // Figure out the mask index. + float maskIndex = floor(dashPosition * maskLength); + // Test the bit mask. + float maskTest = floor(dashPattern / pow(2.0, maskIndex)); + vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; + if (fragColor.a < 0.005) { // matches 0/255 and 1/255 + discard; + } + + fragColor = czm_gammaCorrect(fragColor); + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + return material; +} +`;var UP=`uniform vec4 color; +uniform float glowPower; +uniform float taperPower; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); + + if (taperPower <= 0.99999) { + glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); + } + + vec4 fragColor; + fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); + fragColor.a = clamp(0.0, 1.0, glow) * color.a; + fragColor = czm_gammaCorrect(fragColor); + + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + + return material; +} +`;var zP=`uniform vec4 color; +uniform vec4 outlineColor; +uniform float outlineWidth; + +in float v_width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; + float b = step(0.5 - halfInteriorWidth, st.t); + b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); + + // Find the distance from the closest separator (region between two colors) + float d1 = abs(st.t - (0.5 - halfInteriorWidth)); + float d2 = abs(st.t - (0.5 + halfInteriorWidth)); + float dist = min(d1, d2); + + vec4 currentColor = mix(outlineColor, color, b); + vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); + outColor = czm_gammaCorrect(outColor); + + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var HP=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); + float s = smoothstep(1.0 - width, 1.0, d); + + vec4 outColor = czm_gammaCorrect(color); + vec4 outRimColor = czm_gammaCorrect(rimColor); + + material.diffuse = outColor.rgb; + material.emission = outRimColor.rgb * s; + material.alpha = mix(outColor.a, outRimColor.a, s); + + return material; +} +`;var GP=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; +} +`;var WP=`uniform vec4 evenColor; +uniform vec4 oddColor; +uniform float offset; +uniform float repeat; +uniform bool horizontal; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) + float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); + float value = fract((coord - offset) * (repeat * 0.5)); + float dist = min(value, min(abs(value - 0.5), 1.0 - value)); + + vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); + vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); + color = czm_gammaCorrect(color); + + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; +} +`;var jP=`uniform vec4 waterColor; +uniform vec4 landColor; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); + outColor = czm_gammaCorrect(outColor); + + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var qP=`// Thanks for the contribution Jonas +// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + +uniform sampler2D specularMap; +uniform sampler2D normalMap; +uniform vec4 baseWaterColor; +uniform vec4 blendColor; +uniform float frequency; +uniform float animationSpeed; +uniform float amplitude; +uniform float specularIntensity; +uniform float fadeFactor; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float time = czm_frameNumber * animationSpeed; + + // fade is a function of the distance from the fragment and the frequency of the waves + float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); + + float specularMapValue = texture(specularMap, materialInput.st).r; + + // note: not using directional motion at this time, just set the angle to 0.0; + vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); + vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); + + // fade out the normal perturbation as we move further from the water surface + normalTangentSpace.xy /= fade; + + // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) + normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); + + normalTangentSpace = normalize(normalTangentSpace); + + // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane + float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); + + // fade out water effect as specular map value decreases + material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; + + // base color is a blend of the water and non-water color based on the value from the specular map + // may need a uniform blend factor to better control this + material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); + + // diffuse highlights are based on how perturbed the normal is + material.diffuse += (0.1 * tsPerturbationRatio); + + material.diffuse = material.diffuse; + + material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); + + material.specular = specularIntensity; + material.shininess = 10.0; + + return material; +} +`;function We(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,Kt.LINEAR),this._magnificationFilter=y(e.magnificationFilter,di.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,XRe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(We._uniformList[this.type])||(We._uniformList[this.type]=Object.keys(this._uniforms))}We._uniformList={};We.fromType=function(e,t){let n=new We({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};We.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};We.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(x){return x.bufferView}),u=u[0]);let d=new Zt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new It({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new It({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let x=this.uniforms[m];x.x=p._width,x.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let u=c.images,f=new Cr({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Zt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};We.prototype.isDestroyed=function(){return!1};We.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function XRe(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=Ge(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=Ge(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=Ge(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:zn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=We._materialCache.getMaterial(t.type);if(l(i)){let r=Ge(i.fabric,!0);t._template=xt(t._template,r,!0),n=i.translucent}QRe(t),l(i)||We._materialCache.addMaterial(t.type,t),eOe(t),oOe(t),sOe(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,o),n=y(e.translucent,n),l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function n9(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function Lne(e,t){}function KRe(e,t){}var ZRe=["type","materials","uniforms","components","source"],$Re=["diffuse","specular","shininess","normal","emission","alpha"];function QRe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;n9(t,ZRe,Lne,!0),n9(o,$Re,Lne,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);n9(n,r,KRe,!1)}function JRe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function eOe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} +`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) +{ +`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&JRe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; +`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; +`:e.shaderSource+=`material.${o} = ${t[o]}; +`}e.shaderSource+=`return material; +} +`}}var Nne={mat2:Ri,mat3:$,mat4:F},tOe=/\.ktx2$/i;function nOe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===We.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new Zt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new It({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof It&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),a)return;let d=r instanceof Se;if(!l(n._texturePaths[e])||d&&r.url!==n._texturePaths[e].url||!d&&r!==n._texturePaths[e]){if(typeof r=="string"||d){let p=d?r:Se.createIfNeeded(r),g;tOe.test(p.url)?g=Il(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(m){n._loadedImages.push({id:e,image:m})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function iOe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Cr){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===We.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Se.createIfNeeded(i.positiveX).fetchImage(),Se.createIfNeeded(i.negativeX).fetchImage(),Se.createIfNeeded(i.positiveY).fetchImage(),Se.createIfNeeded(i.negativeY).fetchImage(),Se.createIfNeeded(i.positiveZ).fetchImage(),Se.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function oOe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Fne(e,n)}function Fne(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=rOe(o),s;if(r==="channels")s=YP(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;aOe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Fne(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=YP(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(nOe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(iOe(t));else if(r.indexOf("mat")!==-1){let u=new Nne[r];e._uniforms[c]=function(){return Nne[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function rOe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Se||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===We.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function sOe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new We({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=xt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;YP(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=YP(e,i,a)}}function YP(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(o+=1,n)}),o}function aOe(e,t,n){return YP(e,t,t,n)}We._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};We.DefaultImageId="czm_defaultImage";We.DefaultCubeMapId="czm_defaultCubeMap";We.ColorType="Color";We._materialCache.addMaterial(We.ColorType,{fabric:{type:We.ColorType,uniforms:{color:new H(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});We.ImageType="Image";We._materialCache.addMaterial(We.ImageType,{fabric:{type:We.ImageType,uniforms:{image:We.DefaultImageId,repeat:new z(1,1),color:new H(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});We.DiffuseMapType="DiffuseMap";We._materialCache.addMaterial(We.DiffuseMapType,{fabric:{type:We.DiffuseMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new z(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.AlphaMapType="AlphaMap";We._materialCache.addMaterial(We.AlphaMapType,{fabric:{type:We.AlphaMapType,uniforms:{image:We.DefaultImageId,channel:"a",repeat:new z(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});We.SpecularMapType="SpecularMap";We._materialCache.addMaterial(We.SpecularMapType,{fabric:{type:We.SpecularMapType,uniforms:{image:We.DefaultImageId,channel:"r",repeat:new z(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});We.EmissionMapType="EmissionMap";We._materialCache.addMaterial(We.EmissionMapType,{fabric:{type:We.EmissionMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new z(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.BumpMapType="BumpMap";We._materialCache.addMaterial(We.BumpMapType,{fabric:{type:We.BumpMapType,uniforms:{image:We.DefaultImageId,channel:"r",strength:.8,repeat:new z(1,1)},source:IP},translucent:!1});We.NormalMapType="NormalMap";We._materialCache.addMaterial(We.NormalMapType,{fabric:{type:We.NormalMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",strength:.8,repeat:new z(1,1)},source:BP},translucent:!1});We.GridType="Grid";We._materialCache.addMaterial(We.GridType,{fabric:{type:We.GridType,uniforms:{color:new H(0,1,0,1),cellAlpha:.1,lineCount:new z(8,8),lineThickness:new z(1,1),lineOffset:new z(0,0)},source:FP},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});We.StripeType="Stripe";We._materialCache.addMaterial(We.StripeType,{fabric:{type:We.StripeType,uniforms:{horizontal:!0,evenColor:new H(1,1,1,.5),oddColor:new H(0,0,1,.5),offset:0,repeat:5},source:WP},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});We.CheckerboardType="Checkerboard";We._materialCache.addMaterial(We.CheckerboardType,{fabric:{type:We.CheckerboardType,uniforms:{lightColor:new H(1,1,1,.5),darkColor:new H(0,0,0,.5),repeat:new z(5,5)},source:PP},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.DotType="Dot";We._materialCache.addMaterial(We.DotType,{fabric:{type:We.DotType,uniforms:{lightColor:new H(1,1,0,.75),darkColor:new H(0,1,1,.75),repeat:new z(5,5)},source:RP},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.WaterType="Water";We._materialCache.addMaterial(We.WaterType,{fabric:{type:We.WaterType,uniforms:{baseWaterColor:new H(.2,.3,.6,1),blendColor:new H(0,1,.699,1),specularMap:We.DefaultImageId,normalMap:We.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:qP},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});We.RimLightingType="RimLighting";We._materialCache.addMaterial(We.RimLightingType,{fabric:{type:We.RimLightingType,uniforms:{color:new H(1,0,0,.7),rimColor:new H(1,1,1,.4),width:.3},source:HP},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});We.FadeType="Fade";We._materialCache.addMaterial(We.FadeType,{fabric:{type:We.FadeType,uniforms:{fadeInColor:new H(1,0,0,1),fadeOutColor:new H(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new z(.5,.5)},source:NP},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});We.PolylineArrowType="PolylineArrow";We._materialCache.addMaterial(We.PolylineArrowType,{fabric:{type:We.PolylineArrowType,uniforms:{color:new H(1,1,1,1)},source:kP},translucent:!0});We.PolylineDashType="PolylineDash";We._materialCache.addMaterial(We.PolylineDashType,{fabric:{type:We.PolylineDashType,uniforms:{color:new H(1,0,1,1),gapColor:new H(0,0,0,0),dashLength:16,dashPattern:255},source:VP},translucent:!0});We.PolylineGlowType="PolylineGlow";We._materialCache.addMaterial(We.PolylineGlowType,{fabric:{type:We.PolylineGlowType,uniforms:{color:new H(0,.5,1,1),glowPower:.25,taperPower:1},source:UP},translucent:!0});We.PolylineOutlineType="PolylineOutline";We._materialCache.addMaterial(We.PolylineOutlineType,{fabric:{type:We.PolylineOutlineType,uniforms:{color:new H(1,1,1,1),outlineColor:new H(1,0,0,1),outlineWidth:1},source:zP},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});We.ElevationContourType="ElevationContour";We._materialCache.addMaterial(We.ElevationContourType,{fabric:{type:We.ElevationContourType,uniforms:{spacing:100,color:new H(1,0,0,1),width:1},source:MP},translucent:!1});We.ElevationRampType="ElevationRamp";We._materialCache.addMaterial(We.ElevationRampType,{fabric:{type:We.ElevationRampType,uniforms:{image:We.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:LP},translucent:!1});We.SlopeRampMaterialType="SlopeRamp";We._materialCache.addMaterial(We.SlopeRampMaterialType,{fabric:{type:We.SlopeRampMaterialType,uniforms:{image:We.DefaultImageId},source:GP},translucent:!1});We.AspectRampMaterialType="AspectRamp";We._materialCache.addMaterial(We.AspectRampMaterialType,{fabric:{type:We.AspectRampMaterialType,uniforms:{image:We.DefaultImageId},source:DP},translucent:!1});We.ElevationBandType="ElevationBand";We._materialCache.addMaterial(We.ElevationBandType,{fabric:{type:We.ElevationBandType,uniforms:{heights:We.DefaultImageId,colors:We.DefaultImageId},source:OP},translucent:!0});We.WaterMaskType="WaterMask";We._materialCache.addMaterial(We.WaterMaskType,{fabric:{type:We.WaterMaskType,source:jP,uniforms:{waterColor:new H(1,1,1,1),landColor:new H(0,0,0,0)}},translucent:!1});var Yi=We;function Ex(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,Ex.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Ex.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Ex.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Ex.prototype.isTranslucent=io.prototype.isTranslucent;Ex.prototype.getRenderState=io.prototype.getRenderState;Ex.MaterialSupport={BASIC:Object.freeze({vertexFormat:Ie.POSITION_AND_NORMAL,vertexShaderSource:SP,fragmentShaderSource:EP}),TEXTURED:Object.freeze({vertexFormat:Ie.POSITION_NORMAL_AND_ST,vertexShaderSource:wP,fragmentShaderSource:vP}),ALL:Object.freeze({vertexFormat:Ie.ALL,vertexShaderSource:AP,fragmentShaderSource:CP})};var co=Ex;var XP=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec4 v_color; + +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + vec4 color = czm_gammaCorrect(v_color); + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; + + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +} +`;var KP=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec4 color; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec4 v_color; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var Sx=`in vec4 v_color; + +void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +} +`;var ZP=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 color; +in float batchId; + +out vec4 v_color; + +void main() +{ + vec4 p = czm_computePosition(); + + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;function Op(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?ZP:KP,r=i?Sx:XP,s=i?Op.FLAT_VERTEX_FORMAT:Op.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Op.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Op.VERTEX_FORMAT=Ie.POSITION_AND_NORMAL;Op.FLAT_VERTEX_FORMAT=Ie.POSITION_ONLY;Op.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Op.prototype.isTranslucent=io.prototype.isTranslucent;Op.prototype.getRenderState=io.prototype.getRenderState;var an=Op;function lA(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(lA.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});lA.prototype.getType=function(e){return"Color"};var cOe=new Z;lA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(cOe)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,H.WHITE,t.color),t};lA.prototype.equals=function(e){return this===e||e instanceof lA&&Y.equals(this._color,e._color)};var Ut=lA;function Yg(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ee.default),this._rectangle=y(e.rectangle,se.MAX_VALUE),this._projection=new Pi(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(Yg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Yg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Yg.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Yg.prototype.rectangleToNativeRectangle=function(e,t){let n=P.toDegrees(e.west),i=P.toDegrees(e.south),o=P.toDegrees(e.east),r=P.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new se(n,i,o,r)};Yg.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=P.toDegrees(o.west),o.south=P.toDegrees(o.south),o.east=P.toDegrees(o.east),o.north=P.toDegrees(o.north),o};Yg.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,u=(e+1)*a+o.west,f=o.height/s,d=o.north-t*f,p=o.north-(t+1)*f;return l(i)||(i=new se(c,p,u,d)),i.west=c,i.south=p,i.east=u,i.north=d,i};Yg.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!se.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=P.TWO_PI);let u=(c-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new z(u,f)};var Xi=Yg;var Bne=new h,kne=new h,Vne=new fe,i9=new h,lOe=new h,Une=new ae,uOe=new Xi,$P=[new fe,new fe,new fe,new fe],QP=new z,Qr={};Qr.initialize=function(){let e=Qr._initPromise;return l(e)||(e=Se.fetchJson(en("Assets/approximateTerrainHeights.json")).then(function(t){Qr._terrainHeights=t}),Qr._initPromise=e),e};Qr.getMinimumMaximumHeights=function(e,t){t=y(t,ee.default);let n=zne(e),i=Qr._defaultMinTerrainHeight,o=Qr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Qr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(se.northeast(e,Vne),Bne),t.cartographicToCartesian(se.southwest(e,Vne),kne),h.midpoint(kne,Bne,i9);let a=t.scaleToGeodeticSurface(i9,lOe);if(l(a)){let c=h.distance(i9,a);i=Math.min(i,-c)}else i=Qr._defaultMinTerrainHeight}return i=Math.max(Qr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Qr.getBoundingSphere=function(e,t){t=y(t,ee.default);let n=zne(e),i=Qr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Qr._terrainHeights[r];l(s)&&(i=s[1])}let o=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,Une),ae.union(o,Une,o)};function zne(e){fe.fromRadians(e.east,e.north,0,$P[0]),fe.fromRadians(e.west,e.north,0,$P[1]),fe.fromRadians(e.east,e.south,0,$P[2]),fe.fromRadians(e.west,e.south,0,$P[3]);let t=0,n=0,i=0,o=0,r=Qr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let u=$P[c];if(uOe.positionToTileXY(u,s,QP),c===0)i=QP.x,o=QP.y;else if(i!==QP.x||o!==QP.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Qr._terrainHeightsMaxLevel=6;Qr._defaultMaxTerrainHeight=9e3;Qr._defaultMinTerrainHeight=-1e5;Qr._terrainHeights=void 0;Qr._initPromise=void 0;Object.defineProperties(Qr,{initialized:{get:function(){return l(Qr._terrainHeights)}}});var li=Qr;function Gc(e,t,n){this.minimum=h.clone(y(e,h.ZERO)),this.maximum=h.clone(y(t,h.ZERO)),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Gc.fromCorners=function(e,t,n){return l(n)||(n=new Gc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Gc.fromPoints=function(e,t){if(l(t)||(t=new Gc),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,x=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(m,i),s=Math.max(m,s),o=Math.min(x,o),a=Math.max(x,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};Gc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new Gc(e.minimum,e.maximum,e.center)};Gc.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var lU=new h;Gc.intersectPlane=function(e,t){lU=h.subtract(e.maximum,e.minimum,lU);let n=h.multiplyByScalar(lU,.5,lU),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=h.dot(e.center,i)+t.distance;return r-o>0?Wt.INSIDE:r+o<0?Wt.OUTSIDE:Wt.INTERSECTING};Gc.prototype.clone=function(e){return Gc.clone(this,e)};Gc.prototype.intersectPlane=function(e){return Gc.intersectPlane(this,e)};Gc.prototype.equals=function(e){return Gc.equals(this,e)};var Xg=Gc;var o9=new oe;function dm(e,t){t=y(t,ee.default),e=t.scaleToGeodeticSurface(e);let n=Ot.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(F.getColumn(n,0,o9)),this._yAxis=h.fromCartesian4(F.getColumn(n,1,o9));let i=h.fromCartesian4(F.getColumn(n,2,o9));this._plane=rn.fromPointNormal(e,i)}Object.defineProperties(dm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var fOe=new Xg;dm.fromPoints=function(e,t){let n=Xg.fromPoints(e,fOe);return new dm(n.center,t)};var Hne=new hn,uU=new h;dm.prototype.projectPointOntoPlane=function(e,t){let n=Hne;n.origin=e,h.normalize(e,n.direction);let i=$n.rayPlane(n,this._plane,uU);if(l(i)||(h.negate(n.direction,n.direction),i=$n.rayPlane(n,this._plane,uU)),l(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new z(r,s)}};dm.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);l(r)&&(t[n]=r,n++)}return t.length=n,t};dm.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new z);let n=Hne;n.origin=e,h.clone(this._plane.normal,n.direction);let i=$n.rayPlane(n,this._plane,uU);l(i)||(h.negate(n.direction,n.direction),i=$n.rayPlane(n,this._plane,uU));let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return t.x=r,t.y=s,t};dm.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var dOe=new h;dm.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=dOe;return h.multiplyByScalar(o,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(r,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};dm.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Jr=dm;function Ui(e,t){this.center=h.clone(y(e,h.ZERO)),this.halfAxes=$.clone(y(t,$.ZERO))}Ui.packedLength=h.packedLength+$.packedLength;Ui.pack=function(e,t,n){return n=y(n,0),h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};Ui.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ui),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var hOe=new h,mOe=new h,pOe=new h,_Oe=new h,gOe=new h,yOe=new h,xOe=new $,bOe={unitary:new $,diagonal:new $};Ui.fromPoints=function(e,t){if(l(t)||(t=new Ui),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,o=h.clone(e[0],hOe);for(n=1;n<i;n++)h.add(o,e[n],o);let r=1/i;h.multiplyByScalar(o,r,o);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],o,mOe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=r,a*=r,c*=r,u*=r,f*=r,d*=r;let g=xOe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=$.computeEigenDecomposition(g,bOe),x=$.clone(m.unitary,t.halfAxes),b=$.getColumn(x,0,_Oe),T=$.getColumn(x,1,gOe),C=$.getColumn(x,2,yOe),A=-Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE,D=Number.MAX_VALUE,O=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],A=Math.max(h.dot(b,p),A),E=Math.max(h.dot(T,p),E),v=Math.max(h.dot(C,p),v),D=Math.min(h.dot(b,p),D),O=Math.min(h.dot(T,p),O),R=Math.min(h.dot(C,p),R);b=h.multiplyByScalar(b,.5*(D+A),b),T=h.multiplyByScalar(T,.5*(O+E),T),C=h.multiplyByScalar(C,.5*(R+v),C);let M=h.add(b,T,t.center);h.add(M,C,M);let N=pOe;return N.x=A-D,N.y=E-O,N.z=v-R,h.multiplyByScalar(N,.5,N),$.multiplyByScale(t.halfAxes,N,t.halfAxes),t};var Xne=new h,TOe=new h;function Gne(e,t,n,i,o,r,s,a,c,u,f){l(f)||(f=new Ui);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=Xne;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=TOe;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(d,p,p),h.add(e,p,m),$.multiplyByScale(d,g,d),f}var Wne=new fe,COe=new h,AOe=new fe,EOe=new fe,SOe=new fe,vOe=new fe,wOe=new fe,DOe=new h,jne=new h,IOe=new h,qne=new h,POe=new h,ROe=new z,OOe=new z,MOe=new z,LOe=new z,NOe=new z,FOe=new h,BOe=new h,kOe=new h,VOe=new h,UOe=new z,zOe=new h,HOe=new h,GOe=new h,WOe=new rn(h.UNIT_X,0);Ui.fromRectangle=function(e,t,n,i,o){t=y(t,0),n=y(n,0),i=y(i,ee.default);let r,s,a,c,u,f,d;if(e.width<=P.PI){let O=se.center(e,Wne),R=i.cartographicToCartesian(O,COe),M=new Jr(R,i);d=M.plane;let N=O.longitude,_=e.south<0&&e.north>0?0:O.latitude,S=fe.fromRadians(N,e.north,n,AOe),w=fe.fromRadians(e.west,e.north,n,EOe),I=fe.fromRadians(e.west,_,n,SOe),L=fe.fromRadians(e.west,e.south,n,vOe),B=fe.fromRadians(N,e.south,n,wOe),U=i.cartographicToCartesian(S,DOe),V=i.cartographicToCartesian(w,jne),G=i.cartographicToCartesian(I,IOe),k=i.cartographicToCartesian(L,qne),W=i.cartographicToCartesian(B,POe),q=M.projectPointToNearestOnPlane(U,ROe),J=M.projectPointToNearestOnPlane(V,OOe),j=M.projectPointToNearestOnPlane(G,MOe),K=M.projectPointToNearestOnPlane(k,LOe),Q=M.projectPointToNearestOnPlane(W,NOe);return r=Math.min(J.x,j.x,K.x),s=-r,c=Math.max(J.y,q.y),a=Math.min(K.y,Q.y),w.height=L.height=t,V=i.cartographicToCartesian(w,jne),k=i.cartographicToCartesian(L,qne),u=Math.min(rn.getPointDistance(d,V),rn.getPointDistance(d,k)),f=n,Gne(M.origin,M.xAxis,M.yAxis,M.zAxis,r,s,a,c,u,f,o)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,x=se.center(e,Wne).longitude,b=h.fromRadians(x,m,n,i,FOe);b.z=0;let C=Math.abs(b.x)<P.EPSILON10&&Math.abs(b.y)<P.EPSILON10?h.UNIT_X:h.normalize(b,BOe),A=h.UNIT_Z,E=h.cross(C,A,kOe);d=rn.fromPointNormal(b,C,WOe);let v=h.fromRadians(x+P.PI_OVER_TWO,m,n,i,VOe);s=h.dot(rn.projectPointOntoPlane(d,v,UOe),E),r=-s,c=h.fromRadians(0,e.north,g?t:n,i,zOe).z,a=h.fromRadians(0,e.south,p?t:n,i,HOe).z;let D=h.fromRadians(e.east,m,n,i,GOe);return u=rn.getPointDistance(d,D),f=0,Gne(b,E,A,C,r,s,a,c,u,f,o)};Ui.fromTransformation=function(e,t){return l(t)||(t=new Ui),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Ui.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new Ui(e.center,e.halfAxes)};Ui.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[$.COLUMN0ROW0]+s*o[$.COLUMN0ROW1]+a*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+s*o[$.COLUMN1ROW1]+a*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+s*o[$.COLUMN2ROW1]+a*o[$.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?Wt.OUTSIDE:u>=c?Wt.INSIDE:Wt.INTERSECTING};var Kne=new h,Zne=new h,$ne=new h,jOe=new h,Yne=new h,qOe=new h;Ui.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Xne),i=e.halfAxes,o=$.getColumn(i,0,Kne),r=$.getColumn(i,1,Zne),s=$.getColumn(i,2,$ne),a=h.magnitude(o),c=h.magnitude(r),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(o,a,o):f=!1,c>0?h.divideByScalar(r,c,r):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,m,x,b;if(g===1){let E=o;m=r,x=s,d?p||(E=s,x=o):(E=r,m=o),b=h.cross(m,x,Yne),E===o?o=b:E===r?r=b:E===s&&(s=b)}else if(g===2){m=o,d?m=r:p&&(m=s);let E=h.UNIT_Y;E.equalsEpsilon(m,P.EPSILON3)&&(E=h.UNIT_X),x=h.cross(m,E,jOe),h.normalize(x,x),b=h.cross(m,x,Yne),h.normalize(b,b),m===o?(r=x,s=b):m===r?(s=x,o=b):m===s&&(o=x,r=b)}else g===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let T=qOe;T.x=h.dot(n,o),T.y=h.dot(n,r),T.z=h.dot(n,s);let C=0,A;return T.x<-a?(A=T.x+a,C+=A*A):T.x>a&&(A=T.x-a,C+=A*A),T.y<-c?(A=T.y+c,C+=A*A):T.y>c&&(A=T.y-c,C+=A*A),T.z<-u?(A=T.z+u,C+=A*A):T.z>u&&(A=T.z-u,C+=A*A),C};var YOe=new h,XOe=new h;Ui.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Pa);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,Kne),u=$.getColumn(a,1,Zne),f=$.getColumn(a,2,$ne),d=h.add(c,u,YOe);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,XOe),g=h.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var KOe=new h,ZOe=new h,$Oe=new h;Ui.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,KOe),r=$.getColumn(i,1,ZOe),s=$.getColumn(i,2,$Oe);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],o,t[1]),h.subtract(t[1],r,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],o,t[2]),h.add(t[2],r,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],o,t[3]),h.add(t[3],r,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],o,t[4]),h.subtract(t[4],r,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],o,t[5]),h.subtract(t[5],r,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],o,t[6]),h.add(t[6],r,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],o,t[7]),h.add(t[7],r,t[7]),h.add(t[7],s,t[7]),t};var QOe=new $;Ui.computeTransformation=function(e,t){l(t)||(t=new F);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,QOe);return F.fromRotationTranslation(i,n,t)};var JOe=new ae;Ui.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,JOe);return!t.isBoundingSphereVisible(n)};Ui.prototype.intersectPlane=function(e){return Ui.intersectPlane(this,e)};Ui.prototype.distanceSquaredTo=function(e){return Ui.distanceSquaredTo(this,e)};Ui.prototype.computePlaneDistances=function(e,t,n){return Ui.computePlaneDistances(this,e,t,n)};Ui.prototype.computeCorners=function(e){return Ui.computeCorners(this,e)};Ui.prototype.computeTransformation=function(e){return Ui.computeTransformation(this,e)};Ui.prototype.isOccluded=function(e){return Ui.isOccluded(this,e)};Ui.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Ui.prototype.clone=function(e){return Ui.clone(this,e)};Ui.prototype.equals=function(e){return Ui.equals(this,e)};var vn=Ui;var fU={};fU.getHeight=function(e,t,n){return(e-n)*t+n};var eMe=new fe;fU.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,eMe);if(!l(r))return h.clone(e,o);let s=fU.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var Er=fU;var JP=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; + +#ifdef EXTRUDED_GEOMETRY +in vec3 extrudeDirection; + +uniform float u_globeMinimumAltitude; +#endif // EXTRUDED_GEOMETRY + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif // PER_INSTANCE_COLOR + +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +out vec4 v_sphericalExtents; +#else // SPHERICAL +out vec2 v_inversePlaneExtents; +out vec4 v_westPlane; +out vec4 v_southPlane; +#endif // SPHERICAL +out vec3 v_uvMinAndSphericalLongitudeRotation; +out vec3 v_uMaxAndInverseDistance; +out vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES + +void main() +{ + vec4 position = czm_computePosition(); + +#ifdef EXTRUDED_GEOMETRY + float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); + delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; + + //extrudeDirection is zero for the top layer + position = position + vec4(extrudeDirection * delta, 0.0); +#endif + +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL + v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); + v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); +#else // SPHERICAL +#ifdef COLUMBUS_VIEW_2D + vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); + vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); + + // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): + // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) + // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) + // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) + vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); + bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; + planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); + planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); + + // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) + // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) + // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) + idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; + idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); + planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); + planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); + + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; + vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; + vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; +#else // COLUMBUS_VIEW_2D + // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; + vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; + vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; +#endif // COLUMBUS_VIEW_2D + + vec3 eastWard = southEastCorner - southWestCorner; + float eastExtent = length(eastWard); + eastWard /= eastExtent; + + vec3 northWard = northWestCorner - southWestCorner; + float northExtent = length(northWard); + northWard /= northExtent; + + v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); + v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); + v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); +#endif // SPHERICAL + vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); + vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); + + v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); + v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); + v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; +#endif // TEXTURE_COORDINATES + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif + + gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); +} +`;var Kg=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif + +void main(void) +{ +#ifdef VECTOR_TILE + out_FragColor = czm_gammaCorrect(u_highlightColor); +#else + out_FragColor = vec4(1.0); +#endif + czm_writeDepthClamp(); +} +`;var Qne={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};Qne.NUMBER_OF_CLASSIFICATION_TYPES=3;var kn=Object.freeze(Qne);var tMe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},cc=Object.freeze(tMe);function nMe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var e1=nMe;function Mp(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=iMe(t),o=e.floatingPointTexture,r=i===Ke.FLOAT&&!o,s=oMe(t,r),a=rMe(s,t,r),c=Math.floor(Lt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,x=m*.5;this._textureDimensions=new z(f,d),this._textureStep=new oe(p,g,m,x),this._pixelDatatype=r?Ke.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let b=4*f*d;this._batchValues=i===Ke.FLOAT&&!r?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(Mp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function iMe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==X.UNSIGNED_BYTE){t=!0;break}return t?Ke.FLOAT:Ke.UNSIGNED_BYTE}function eie(e,t){let n=e[t].componentsPerAttribute;return n===2?z:n===3?h:n===4?oe:Number}function oMe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==X.UNSIGNED_BYTE&&t?i+=4:++i}return n}function rMe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==X.UNSIGNED_BYTE&&n?o+4:o+1}var t1=new oe;function sMe(e,t,n){let i=oe.unpack(e,t,t1),o=oe.unpackFloat(i);i=oe.unpack(e,t+4,t1);let r=oe.unpackFloat(i);i=oe.unpack(e,t+8,t1);let s=oe.unpackFloat(i);i=oe.unpack(e,t+12,t1);let a=oe.unpackFloat(i);return oe.fromElements(o,r,s,a,n)}function aMe(e,t,n){let i=oe.packFloat(e.x,t1);oe.pack(i,t,n),i=oe.packFloat(e.y,i),oe.pack(i,t,n+4),i=oe.packFloat(e.z,i),oe.pack(i,t,n+8),i=oe.packFloat(e.w,i),oe.pack(i,t,n+12)}var Jne=new oe;Mp.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Ke.UNSIGNED_BYTE?a=sMe(this._batchValues,s,Jne):a=oe.unpack(this._batchValues,s,Jne);let c=eie(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var cMe=[void 0,void 0,new z,new h,new oe],lMe=new oe;Mp.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=cMe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=eie(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=lMe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Ke.UNSIGNED_BYTE?aMe(c,this._batchValues,d):oe.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function uMe(e,t){let n=e._textureDimensions;e._texture=new It({context:t,pixelFormat:et.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Zt.NEAREST,flipY:!1})}function fMe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Mp.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||uMe(this,e.context),fMe(this))};Mp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:xt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function dMe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float numberOfAttributes = float(${t}); + return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); +} +`:`uniform vec4 batchTextureStep; +uniform vec2 batchTextureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float stepY = batchTextureStep.z; + float centerY = batchTextureStep.w; + float numberOfAttributes = float(${t}); + float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); + float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}function hMe(e){return e===1?"float":`vec${e}`}function mMe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function pMe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=hMe(o),a=mMe(o),c=e._offsets[t],u=`${s} ${r}(float batchId) +{ + vec2 st = computeSt(batchId); + st.x += batchTextureStep.x * float(${c}); +`;return e._packFloats&&i.componentDatatype!==Ke.UNSIGNED_BYTE?u+=`vec4 textureValue; +textureValue.x = czm_unpackFloat(texture(batchTexture, st)); +textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); +textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); +textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); +`:u+=` vec4 textureValue = texture(batchTexture, st); +`,u+=` ${s} value = textureValue${a}; +`,e._pixelDatatype===Ke.UNSIGNED_BYTE&&i.componentDatatype===X.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; +`:e._pixelDatatype===Ke.FLOAT&&i.componentDatatype===X.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; +`),u+=` return value; +} +`,u}Mp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; +`;t+=`${dMe(this)} +`;let n=e.length;for(let i=0;i<n;++i)t+=pMe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r} +${t} +${s}`}};Mp.prototype.isDestroyed=function(){return!1};Mp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var vx=Mp;function Ol(e){this._ellipsoid=y(e,ee.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Ol.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Ol.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};Ol.geodeticLatitudeToMercatorAngle=function(e){e>Ol.MaximumLatitude?e=Ol.MaximumLatitude:e<-Ol.MaximumLatitude&&(e=-Ol.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Ol.MaximumLatitude=Ol.mercatorAngleToGeodeticLatitude(Math.PI);Ol.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Ol.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};Ol.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=Ol.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var Oi=Ol;function _Me(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!F.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Ln.transformToWorldCoordinates(e[r]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function r9(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function gMe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?r9(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(r9(i.westHemisphereGeometry,n),r9(i.eastHemisphereGeometry,n))}}function yMe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(_Me(t,a,o),!o)for(c=0;c<d;++c)l(t[c].geometry)&&Ln.splitLongitude(t[c]);if(gMe(t),r)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Ln.reorderForPostVertexCache(g.geometry),Ln.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Ln.reorderForPostVertexCache(g.westHemisphereGeometry),Ln.reorderForPreVertexCache(g.westHemisphereGeometry),Ln.reorderForPostVertexCache(g.eastHemisphereGeometry),Ln.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Ln.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(o)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===X.DOUBLE&&Ln.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===X.DOUBLE){let x=`${m}3D`,b=`${m}2D`;Ln.projectTo2D(u,m,x,b,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ae.fromVertices(u.attributes.position2D.values)),Ln.encodeAttribute(u,x,`${x}High`,`${x}Low`),Ln.encodeAttribute(u,b,`${b}High`,`${b}Low`)}s&&Ln.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Ln.fitToUnsignedShortIndices(u));p=g}return p}function s9(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function xMe(e,t){let n=[];return s9(e,"geometry",t,n),s9(e,"westHemisphereGeometry",t,n),s9(e,"eastHemisphereGeometry",t,n),n}var Lp={};Lp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=yMe(e),t.length>0&&(n=Ln.createAttributeLocations(t[0]),e.createPickOffsets&&(r=xMe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=ae.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ae.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function bMe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function TMe(e,t){let n=e.length;for(let i=0;i<n;++i)bMe(e[i],t)}function CMe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*ae.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}Lp.packCreateGeometryResults=function(e,t){let n=new Float64Array(CMe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ae.pack(c.boundingSphere,n,s),s+=ae.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ae.pack(c.boundingSphereCV,n,s),s+=ae.packedLength;let p=c.attributes,g=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(g.push(x),l(o[x])||(o[x]=i.length,i.push(x)));n[s++]=g.length;for(let x=0;x<g.length;x++){let b=g[x],T=p[b];n[s++]=o[b],n[s++]=T.componentDatatype,n[s++]=T.componentsPerAttribute,n[s++]=T.normalize?1:0,n[s++]=T.values.length,n.set(T.values,s),s+=T.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};Lp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ae.unpack(n,s)),s+=ae.packedLength,n[s++]===1&&(p=ae.unpack(n,s)),s+=ae.packedLength;let x,b,T,C=new un,A=n[s++];for(i=0;i<A;i++){let v=t[n[s++]],D=n[s++];T=n[s++];let O=n[s++]!==0;x=n[s++],b=X.createTypedArray(D,x);for(let R=0;R<x;R++)b[R]=n[s++];C[v]=new ve({componentDatatype:D,componentsPerAttribute:T,normalize:O,values:b})}let E;if(x=n[s++],x>0){let v=b.length/T;for(E=Ne.createTypedArray(v,x),i=0;i<x;i++)E[i]=n[s++]}o[r++]=new st({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:E,attributes:C,offsetAttribute:f})}return o};function AMe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(F.pack(s.modelMatrix,i,o),o+=F.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function EMe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=F.unpack(t,o),s;o+=F.packedLength,l(t[o])&&(s={offset:new Ji(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}Lp.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:AMe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Pi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Lp.unpackCombineGeometryParameters=function(e){let t=EMe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=Lp.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[o];p.geometry=d,++o}}let r=ee.clone(e.ellipsoid),s=e.isGeographic?new Pi(r):new Oi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function tie(e){let t=e.length,n=1+(ae.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,ae.pack(e[r],i,o)):i[o++]=0,o+=ae.packedLength}return i}function nie(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ae.unpack(e,i)),++n,i+=ae.packedLength;return t}Lp.packCombineGeometryResults=function(e,t){l(e.geometries)&&TMe(e.geometries,t);let n=tie(e.boundingSpheres),i=tie(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};Lp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:nie(e.boundingSpheres),boundingSpheresCV:nie(e.boundingSpheresCV)}};var wx=Lp;var SMe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Sr=Object.freeze(SMe);var gu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};gu.NUMBER_OF_SHADOW_MODES=4;gu.castShadows=function(e){return e===gu.ENABLED||e===gu.CAST_ONLY};gu.receiveShadows=function(e){return e===gu.ENABLED||e===gu.RECEIVE_ONLY};gu.fromCastReceive=function(e,t){return e&&t?gu.ENABLED:e?gu.CAST_ONLY:t?gu.RECEIVE_ONLY:gu.DISABLED};var yn=Object.freeze(gu);function vr(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,yn.DISABLED),this._translucent=void 0,this._state=Sr.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(vr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function vMe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var wMe=new z,DMe=new h,fie=new oe;function die(e){let t=e.length;if(t===1)return e[0];if(t===2)return z.unpack(e,0,wMe);if(t===3)return h.unpack(e,0,DMe);if(t===4)return oe.unpack(e,0,fie)}function IMe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=vMe(i),s=r.length,a=[],c={},u={},f,p=i[0].attributes,g,m,x;for(g=0;g<s;++g)m=r[g],x=p[m],c[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:X.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:X.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let b=a.length,T=new vx(t,a,o);for(g=0;g<o;++g){let C=i[g];p=C.attributes;for(let O=0;O<s;++O){m=r[O],x=p[m];let R=die(x.value),M=c[m];T.setBatchedAttribute(g,M,R)}let A={primitive:y(C.pickPrimitive,e)};l(C.id)&&(A.id=C.id);let E=t.createPickId(A);e._pickIds.push(E);let v=E.color,D=fie;D.x=H.floatToByte(v.red),D.y=H.floatToByte(v.green),D.z=H.floatToByte(v.blue),D.w=H.floatToByte(v.alpha),T.setBatchedAttribute(g,b-1,D)}e._batchTable=T,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function PMe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new ve({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function RMe(e){let t=e.attributes,n=new un;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=PMe(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new st({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ae.clone(e.boundingSphere)})}function OMe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var MMe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;vr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=MMe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c}; +`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView; +`,r+=`in vec4 position; +`,s+=`${c} +{ + return u_modifiedModelView * position; +} + +`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} +{ + return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); +} + +`:(r+=`in vec3 ${a}2DHigh; +in vec3 ${a}2DLow; +`,s+=`${c} +{ + vec4 p; + if (czm_morphTime == 1.0) + { + p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); + } + else + { + p = czm_columbusViewMorph( + czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), + czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), + czm_morphTime); + } + return p; +} + +`)}return[o,r,t,s].join(` +`)};vr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Ue.replaceMain(t,"czm_non_show_main")} +void main() +{ + czm_non_show_main(); + gl_Position *= czm_batchTable_show(batchId); +}`:t};vr._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function iie(e){return`${Ue.replaceMain(e,"czm_non_pick_main")} +out vec4 v_pickColor; +void main() +{ + czm_non_pick_main(); + v_pickColor = czm_batchTable_pickColor(batchId); +}`}function oie(e){return`in vec4 v_pickColor; +${e}`}vr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};vr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; +`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition(); +`;return o+=` if (czm_sceneMode == czm_sceneMode3D) +`,o+=` { +`,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` } +`,o+=` else +`,o+=` { +`,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` } +`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};vr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Ue.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() +{ + czm_non_distanceDisplayCondition_main(); + vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); + vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); + vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); + float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); +`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); +`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); + vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); + vec4 centerRTE; + if (czm_morphTime == 1.0) + { + centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); + } + else if (czm_morphTime == 0.0) + { + centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); + } + else + { + centerRTE = czm_columbusViewMorph( + czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), + czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), + czm_morphTime); + } +`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; + float distanceSq; + if (czm_sceneMode == czm_sceneMode2D) + { + distanceSq = czm_eyeHeight2D.y - radiusSq; + } + else + { + distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; + } + distanceSq = max(distanceSq, 0.0); + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; + gl_Position *= show; +}`,`${i} +${o}`};function rie(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; +`;let m=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${m}); +`}n&&o&&r?(f+=`vec3 normal; +vec3 tangent; +vec3 bitangent; +`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); +`):(n&&(f+=`vec3 normal; +`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); +`),o&&(f+=`vec3 tangent; +`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`),r&&(f+=`vec3 bitangent; +`,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=Ue.replaceMain(p,"czm_non_compressed_main");let g=`void main() +{ +${d} czm_non_compressed_main(); +}`;return[u,f,p,g].join(` +`)}function LMe(e){let t=Ue.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + gl_Position = czm_depthClamp(gl_Position);} +`,t}function NMe(e){let t=Ue.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + #if defined(LOG_DEPTH) + czm_writeLogDepth(); + #else + czm_writeDepthClamp(); + #endif +} +`,t}function sie(e,t){let n=e.vertexAttributes}function FMe(e,t){return function(){return e[t]}}var a9=Math.max(zt.hardwareConcurrency-1,1),dU,BMe=new gi("combineGeometry");function kMe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Sr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(dU))for(dU=new Array(a9),o=0;o<a9;o++)dU[o]=new gi("createGeometry");let f;for(u=e1(u,a9),o=0;o<u.length;o++){let d=0,p=u[o],g=p.length;for(r=0;r<g;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=y(i.constructor.packedLength,i.packedLength));let m;if(d>0){let x=new Float64Array(d);for(m=[x.buffer],r=0;r<g;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,f.offset),f.geometry=x)}c.push(dU[o].scheduleTask({subTasks:u[o]},m))}e._state=Sr.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=Sr.CREATED}).catch(function(d){i1(e,t,Sr.FAILED,d)})}else if(e._state===Sr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=BMe.scheduleTask(wx.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Sr.COMBINING,Promise.resolve(f).then(function(d){let p=wx.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Sr.COMBINED):i1(e,t,Sr.FAILED,void 0)}).catch(function(d){i1(e,t,Sr.FAILED,d)})}}function VMe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=RMe(p):g=p.constructor.createGeometry(p),o[c++]=OMe(s,g),r.push(s.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=wx.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=F.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Sr.COMBINED):i1(e,t,Sr.FAILED,void 0)}function UMe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ae;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],b=e._batchTable.getBatchedAttribute(i,n,new h);x=r[i].clone(x),_ie(x,b,o[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||ae.intersectPlane(x,rn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING?c.push(x):(u.push(x),f.push(x))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ae.union(d,c[i]);for(i=1;i<f.length;i++)p=ae.union(p,f[i]);for(i=1;i<u.length;i++)g=ae.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let x=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=ae.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}vr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var aie=new Hn,hie=new fe,mie=new h,pie=new ae;function zMe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let x=p[m];if(!l(x))continue;let b=e.modelMatrix;l(b)&&(x=ae.transform(x,b,pie));let T=x.center,C=x.radius,A=Hn.fromCartesian(T,aie);if(d.setBatchedAttribute(m,o,A.high),d.setBatchedAttribute(m,r,A.low),!t.scene3DOnly){let E=f.cartesianToCartographic(T,hie),v=u.project(E,mie);A=Hn.fromCartesian(v,aie),d.setBatchedAttribute(m,s,A.high),d.setBatchedAttribute(m,a,A.low)}d.setBatchedAttribute(m,c,C)}e._batchTableBoundingSpheresUpdated=!0}var c9=new h,HMe=new h;function cie(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ae.transform(f,p,pie));let g=f.center;g=r.scaleToGeodeticSurface(g,HMe);let m=r.cartesianToCartographic(g,hie),x=o.project(m,mie),b=h.add(d,g,c9);m=r.cartesianToCartographic(b,m);let T=o.project(m,c9),C=h.subtract(T,x,c9),A=C.x;C.x=C.z,C.z=C.y,C.y=A,s.setBatchedAttribute(u,i,C)}e._batchTableOffsetsUpdated=!0}function GMe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(ti.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Fe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ae.clone(u.boundingSphere)),e._boundingSphereWC.push(new ae),!o){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ae.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ae),e._boundingSphereMorph.push(new ae)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,i1(e,t,Sr.COMPLETE,void 0)}function WMe(e,t,n,i){let o=n.getRenderState(),r;i?(r=Ge(o,!1),r.cull={enabled:!0,face:xi.BACK},e._frontFaceRS=Ve.fromCache(r),r.cull.face=xi.FRONT,e._backFaceRS=Ve.fromCache(r)):(e._frontFaceRS=Ve.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Ge(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Ge(o,!1),r.depthTest.func=cc.GREATER,i?(r.cull={enabled:!0,face:xi.BACK},e._frontFaceDepthFailRS=Ve.fromCache(r),r.cull.face=xi.FRONT,e._backFaceDepthFailRS=Ve.fromCache(r)):(e._frontFaceDepthFailRS=Ve.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function jMe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=vr._appendOffsetToShader(e,r),r=vr._appendShowToShader(e,r),r=vr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=iie(r),r=vr._updateColorAttribute(e,r,!1),r=rie(e,r),r=vr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=oie(s),e._sp=$t.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),sie(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=vr._appendShowToShader(e,r),r=vr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=iie(r),r=vr._updateColorAttribute(e,r,!0),r=rie(e,r),r=vr._modifyShaderPosition(e,r,t.scene3DOnly),r=LMe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=oie(s),s=NMe(s),e._spDepthFail=$t.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),sie(e._spDepthFail,o))}var n1=new F,lie=new h;function uie(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=FMe(s,c));let a=xt(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return F.multiply(c,e._modelMatrix,n1),F.multiplyByPoint(n1,e.rtcCenter,lie),F.setTranslation(n1,lie,n1),n1}),a}function qMe(e,t,n,i,o,r,s,a){let c=uie(e,t,n,a),u;l(e._depthFailAppearance)&&(u=uie(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?we.TRANSLUCENT:we.OPAQUE,d=o?2:1;d*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*d;let p=r.length,g=0;for(let m=0;m<p;++m){let x;o&&(x=r[m],l(x)||(x=r[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,++m),x=r[m],l(x)||(x=r[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,l(e._depthFailAppearance)&&(o&&(++m,x=r[m],l(x)||(x=r[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++m,x=r[m],l(x)||(x=r[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++g}}vr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!F.equals(n,e._modelMatrix))for(F.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=ae.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ae.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=ae.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function YMe(e,t,n,i,o,r,s,a){vr._updateBoundingVolumes(e,t,o);let c;t.mode===ne.SCENE3D?c=e._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ne.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=yn.castShadows(e.shadows),g=yn.receiveShadows(e.shadows),m=n.length,x=a?2:1;x*=l(e._depthFailAppearance)?2:1;for(let b=0;b<m;++b){let T=Math.floor(b/x),C=n[b];C.modelMatrix=o,C.boundingVolume=c[T],C.cull=r,C.debugShowBoundingVolume=s,C.castShadows=p,C.receiveShadows=g,d?C.pickId="v_pickColor":C.pickId=void 0,u.push(C)}}}vr.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==ne.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Sr.FAILED)return;let t=e.context;if(l(this._batchTable)||IMe(this,t),this._batchTable.attributes.length>0){if(Lt.maximumVertexTextureImageUnits===0)throw new re("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Sr.COMPLETE&&this._state!==Sr.COMBINED&&(this.asynchronous?kMe(this,e):VMe(this,e)),this._state===Sr.COMBINED&&(zMe(this,e),cie(this,e),GMe(this,e)),!this.show||this._state!==Sr.COMPLETE)return;this._batchTableOffsetsUpdated||cie(this,e),this._recomputeBoundingSpheres&&UMe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&y(this._createRenderStatesFunction,WMe)(this,t,n,u),r&&y(this._createShaderProgramFunction,jMe)(this,e,n),(o||r)&&y(this._createCommandsFunction,qMe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,YMe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var XMe=new ae,KMe=new ae;function _ie(e,t,n){if(n===on.TOP){let i=ae.clone(e,XMe),o=ae.clone(e,KMe);o.center=h.add(o.center,t,o.center),e=ae.union(i,o,e)}else n===on.ALL&&(e.center=h.add(e.center,t,e.center));return e}function ZMe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=X.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function $Me(e,t,n,i,o){return function(r){let s=die(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var QMe=new h;function JMe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&_ie(i,h.fromArray(r.get(),0,QMe),e._offsetInstanceExtend[n]),l(o)&&(i=ae.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function eLe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}vr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:ZMe(s,n,f),set:$Me(s,n,f,this,u)}}return JMe(this,c,n),eLe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};vr.prototype.isDestroyed=function(){return!1};vr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function i1(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Sr.COMPLETE||e._state===Sr.FAILED})}var Dn=vr;function tLe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var lc=tLe;var uA=`#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +in vec4 v_sphericalExtents; +#else // SPHERICAL +in vec2 v_inversePlaneExtents; +in vec4 v_westPlane; +in vec4 v_southPlane; +#endif // SPHERICAL +in vec3 v_uvMinAndSphericalLongitudeRotation; +in vec3 v_uMaxAndInverseDistance; +in vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES + +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#endif + +#ifdef NORMAL_EC +vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { + vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); + return eyeCoordinate.xyz / eyeCoordinate.w; +} + +vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { + vec2 glFragCoordXY = gl_FragCoord.xy; + // Sample depths at both offset and negative offset + float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); + float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); + // Explicitly evaluate both paths + // Necessary for multifrustum and for edges of the screen + bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); + float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); + float useDownOrLeft = float(useUpOrRight == 0.0); + vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); + vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); + return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; +} +#endif // NORMAL_EC + +void main(void) +{ +#ifdef REQUIRES_EC + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +#endif + +#ifdef REQUIRES_WC + vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; + vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +#endif + +#ifdef TEXTURE_COORDINATES + vec2 uv; +#ifdef SPHERICAL + // Treat world coords as a sphere normal for spherical coordinates + vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); + sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; + sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); + uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; + uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; +#else // SPHERICAL + // Unpack planes and transform to eye space + uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; + uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; +#endif // SPHERICAL +#endif // TEXTURE_COORDINATES + +#ifdef PICK +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + // Check for logDepthOrDepth != 0.0 to make sure this should be classified. + if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { + out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource + czm_writeDepthClamp(); + } +#else // CULL_FRAGMENTS + out_FragColor.a = 1.0; +#endif // CULL_FRAGMENTS +#else // PICK + +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { + discard; + } +#endif + +#ifdef NORMAL_EC + // Compute normal by sampling adjacent pixels in 2x2 block in screen space + vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); + vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); + vec3 normalEC = normalize(cross(leftRight, downUp)); +#endif + + +#ifdef PER_INSTANCE_COLOR + + vec4 color = czm_gammaCorrect(v_color); +#ifdef FLAT + out_FragColor = color; +#else // FLAT + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = -eyeCoordinate.xyz; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; + + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + +#else // PER_INSTANCE_COLOR + + // Material support. + // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or + // dependencies for culling but might not actually be used by the material. + + czm_materialInput materialInput; + +#ifdef USES_NORMAL_EC + materialInput.normalEC = normalEC; +#endif + +#ifdef USES_POSITION_TO_EYE_EC + materialInput.positionToEyeEC = -eyeCoordinate.xyz; +#endif + +#ifdef USES_TANGENT_TO_EYE + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +#endif + +#ifdef USES_ST + // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired + // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. + // Shader is provided a set of reference points for remapping. + materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; + materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +#endif + + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else // FLAT + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + +#endif // PER_INSTANCE_COLOR + czm_writeDepthClamp(); +#endif // PICK +} +`;function wf(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new l9;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new l9;if(o.requiresTextureCoordinates=e,n instanceof an)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}wf.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof an&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof an||(o=t.material.shaderSource),new Ue({defines:i,sources:[o,uA]})};wf.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Ue({defines:n,sources:[uA],pickColorQualifier:"in"})};wf.prototype.createVertexShader=function(e,t,n,i){return Eie(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};wf.prototype.createPickVertexShader=function(e,t,n,i){return Eie(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var gie=new h,yie=new fe,xie={high:0,low:0};function Eie(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=yie;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,gie),d=Hn.encode(f.x,xie);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=yie;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,gie);d=Hn.encode(g.x,xie),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof an&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ue({defines:c,sources:[o]})}function l9(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(l9.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function bie(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/z.distance(t,e)}var nLe=[new z,new z,new z,new z];function Sie(e,t){let n=nLe,i=z.unpack(t,0,n[0]),o=z.unpack(t,2,n[1]),r=z.unpack(t,4,n[2]);e.uMaxVmax=new lc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/bie(i,o,r),a=1/bie(i,r,o);e.uvMinAndExtents=new lc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var vie=new fe,wie=new h,iLe=new h,oLe=new h,hU={high:0,low:0};function Die(e,t,n){let i=vie;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,wie);i.latitude=e.north;let r=t.project(i,iLe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,oLe),a=[0,0,0,0],c=[0,0,0,0],u=Hn.encode(o.x,hU);a[0]=u.high,c[0]=u.low,u=Hn.encode(o.y,hU),a[1]=u.high,c[1]=u.low,u=Hn.encode(r.y,hU),a[2]=u.high,c[2]=u.low,u=Hn.encode(s.x,hU),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new lc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new lc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var rLe=new F,sLe=new F,Tie=new h,aLe=new fe,cLe=[new fe,new fe,new fe,new fe,new fe,new fe,new fe,new fe];function lLe(e,t,n,i,o,r){let s=se.center(e,aLe);s.height=n;let a=fe.toCartesian(s,t,Tie),c=Ot.eastNorthUpToFixedFrame(a,t,rLe),u=F.inverse(c,sLe),f=e.west,d=e.east,p=e.north,g=e.south,m=cLe;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let x=(f+d)*.5,b=(p+g)*.5;m[4].latitude=g,m[4].longitude=x,m[5].latitude=p,m[5].longitude=x,m[6].latitude=b,m[6].longitude=f,m[7].latitude=b,m[7].longitude=d;let T=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let M=fe.toCartesian(m[R],t,Tie);F.multiplyByPoint(u,M,M),M.z=0,T=Math.min(T,M.x),C=Math.max(C,M.x),A=Math.min(A,M.y),E=Math.max(E,M.y)}let v=i;v.x=T,v.y=A,v.z=0,F.multiplyByPoint(c,v,v);let D=o;D.x=C,D.y=A,D.z=0,F.multiplyByPoint(c,D,D),h.subtract(D,v,o);let O=r;O.x=T,O.y=E,O.z=0,F.multiplyByPoint(c,O,O),h.subtract(O,v,r)}var uLe=new h,fLe=new h,dLe=new Hn;wf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=wie,s=uLe,a=fLe;lLe(e,n,y(o,0),r,s,a);let c={};Sie(c,t);let u=Hn.fromCartesian(r,dLe);return c.southWest_HIGH=new lc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new lc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new lc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new lc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Die(e,i,c),c};var hLe=new h;function Cie(e,t,n,i){let o=vie;o.latitude=e,o.longitude=t,o.height=0;let r=fe.toCartesian(o,n,hLe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=P.fastApproximateAtan2(s,r.z),c=P.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var Aie=new z;wf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=Cie(e.south,e.west,n,Aie),r=o.x,s=o.y,a=Cie(e.north,e.east,n,Aie),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),r-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-r),g={sphericalExtents:new lc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,d]}),longitudeRotation:new lc({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Sie(g,t),Die(e,i,g),g};wf.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};wf.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function mLe(e){return Math.max(e.width,e.height)>wf.MAX_WIDTH_FOR_PLANAR_EXTENTS}wf.shouldUseSphericalCoordinates=function(e){return mLe(e)};wf.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var yu=wf;var pLe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Vn=Object.freeze(pLe);var _Le={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},ut=Object.freeze(_Le);var mU={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};mU.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Vn.ALWAYS,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.REPLACE},backFunction:Vn.ALWAYS,backOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.REPLACE},reference:mU.CESIUM_3D_TILE_MASK,mask:mU.CESIUM_3D_TILE_MASK}};var Vt=Object.freeze(mU);function Dx(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Dx.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Dx.isSupported=function(e){return e.context.stencilBuffer};function fA(e,t){let n=t?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ut.KEEP,zFail:ut.DECREMENT_WRAP,zPass:ut.KEEP},backFunction:n,backOperation:{fail:ut.KEEP,zFail:ut.INCREMENT_WRAP,zPass:ut.KEEP},reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},depthMask:!1}}function f9(e){return{stencilTest:{enabled:e,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND}}var gLe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function yLe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(fA(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(fA(o,!0)),e._rsColorPass=Ve.fromCache(f9(o,!1)),e._rsPickPass=Ve.fromCache(gLe)}function xLe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; +`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Ue.replaceMain(s,"czm_non_compressed_main");let a=`void main() +{ +${r} czm_non_compressed_main(); +}`;return[i,o,s,a].join(` +`)}}function bLe(e,t){let n=t.context,i=e._primitive,o=JP;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Dn._appendDistanceDisplayConditionToShader(i,o),o=Dn._modifyShaderPosition(e,o,t.scene3DOnly),o=Dn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=xLe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ue({defines:[a],sources:[o]}),u=new Ue({sources:[Kg]}),f=e._primitive._attributeLocations,d=new yu(s,r,e.appearance);if(e._spStencil=$t.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Ue.createPickVertexShaderSource(o);m=Dn._appendShowToShader(i,m),m=Dn._updatePickColorAttribute(m);let x=d.createPickFragmentShader(!1),b=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=$t.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f}),s){let T=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(T)){let C=d.createPickFragmentShader(!0),A=d.createPickVertexShader([a],m,!0,t.mapProjection);T=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:A,fragmentShaderSource:C,attributeLocations:f})}e._spPick2D=T}}else e._spPick=$t.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=Dn._appendShowToShader(i,o),c=new Ue({defines:[a],sources:[o]}),e._sp=$t.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=$t.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let x=d.createFragmentShader(!0),b=d.createVertexShader([a],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f})}e._spColor2D=m}}function TLe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],l(r)||(r=t[o]=new Ze({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=we.TERRAIN_CLASSIFICATION,s=Ze.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=we.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new Ze({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=we.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=xt(c,x._uniforms)),r.uniformMap=c,s=Ze.shallowClone(r,r.derivedCommands.tileset),s.pass=we.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let b=Ze.shallowClone(r,r.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=b,b=Ze.shallowClone(s,s.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=Ze.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function CLe(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<o;c+=2){let m=i._va[d++];if(n&&(a=r[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new Ze({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=we.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Ze.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=we.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new Ze({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=we.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Ze.shallowClone(u,u.derivedCommands.tileset),f.pass=we.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let x=Ze.shallowClone(u,u.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x,x=Ze.shallowClone(f,f.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=x}}}function ALe(e,t,n,i,o,r,s){TLe(e,r),CLe(e,s)}function Iie(e,t){return Math.floor(e%t/2)}function u9(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Pie(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function ELe(e,t,n,i,o,r,s,a){let c=e._primitive;Dn._updateBoundingVolumes(c,t,o);let u;t.mode===ne.SCENE3D?u=c._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===ne.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==kn.CESIUM_3D_TILE,p=f!==kn.TERRAIN,g=t.passes,m,x,b;if(g.render){let T=n.length;for(m=0;m<T;++m)x=u[Iie(m,T)],d&&(b=n[m],u9(b,t,o,r,x,s)),p&&(b=n[m].derivedCommands.tileset,u9(b,t,o,r,x,s));if(t.invertClassification){let C=e._commandsIgnoreShow,A=C.length;for(m=0;m<A;++m)x=u[m],b=C[m],u9(b,t,o,r,x,s)}}if(g.pick){let T=i.length,C=c._pickOffsets;for(m=0;m<T;++m){let A=C[Iie(m,T)];x=u[A.index],d&&(b=i[m],Pie(b,t,o,r,x)),p&&(b=i[m].derivedCommands.tileset,Pie(b,t,o,r,x))}}}Dx.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(r>0&&(c=o[0].attributes,p=yu.hasAttributesForSphericalExtents(c),g=yu.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<r;s++){a=o[s];let x=a.attributes.color;l(x)&&(u=!0),f=f&&l(x)&&Gt.equals(d,x)}if(!f&&!p&&!g)throw new he("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new an({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(r);for(s=0;s<r;++s)a=o[s],m[s]=new St({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,b){n._createBoundingVolumeFunction(x,b)}),i._createRenderStatesFunction=function(x,b,T,C){yLe(n,b)},i._createShaderProgramFunction=function(x,b,T){bLe(n,b)},i._createCommandsFunction=function(x,b,T,C,A,E,v){ALe(n,void 0,void 0,!0,!1,E,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,b,T,C,A,E,v,D){n._updateAndQueueCommandsFunction(x,b,T,C,A,E,v,D)}:i._updateAndQueueCommandsFunction=function(x,b,T,C,A,E,v,D){ELe(n,b,T,C,A,E,v,D)},this._primitive=new Dn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(fA(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(fA(!1,!0)),this._rsColorPass=Ve.fromCache(f9(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(fA(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(fA(!0,!0)),this._rsColorPass=Ve.fromCache(f9(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Dx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Dx.prototype.isDestroyed=function(){return!1};Dx.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var dA=Dx;var SLe={u_globeMinimumAltitude:function(){return 55e3}};function Ml(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(l(a)&&l(a.color)){t=new an({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=li._defaultMaxTerrainHeight,this._minTerrainHeight=li._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:SLe}}Object.defineProperties(Ml.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});Ml.isSupported=dA.isSupported;function Rie(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Oie(e){return function(t,n){return e._minHeight}}var vLe=new h,wLe=new h,DLe=new h,ILe=new fe,PLe=new se;function pU(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<r;d+=3){let p=h.unpack(i,d,vLe),g=h.unpack(o,d,wLe),m=h.add(p,g,DLe),x=n.cartesianToCartographic(m,ILe),b=x.latitude,T=x.longitude;s=Math.min(s,b),a=Math.min(a,T),c=Math.max(c,b),u=Math.max(u,T)}let f=PLe;return f.north=c,f.south=s,f.east=u,f.west=a,f}function RLe(e,t,n){let i=li.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function OLe(e,t,n){let i=t.mapProjection.ellipsoid,o=pU(t,n),r=vn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=ae.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function d9(e,t){return Math.floor(e%t/2)}function h9(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Mie(e,t,n,i,o,r){let s=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function MLe(e,t,n,i,o,r,s,a){let c;t.mode===ne.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==kn.CESIUM_3D_TILE,d=u!==kn.TERRAIN,p=t.passes,g=e._primitive,m,x,b;if(p.render){let T=n.length;for(m=0;m<T;++m)x=c[d9(m,T)],f&&(b=n[m],h9(e,b,t,o,r,x,s)),d&&(b=n[m].derivedCommands.tileset,h9(e,b,t,o,r,x,s));if(t.invertClassification){let C=g._commandsIgnoreShow,A=C.length;for(m=0;m<A;++m)x=c[m],b=C[m],h9(e,b,t,o,r,x,s)}}if(p.pick){let T=i.length,C;for(e._useFragmentCulling||(C=g._primitive._pickOffsets),m=0;m<T;++m){if(x=c[d9(m,T)],!e._useFragmentCulling){let A=C[d9(m,T)];x=c[A.index]}f&&(b=i[m],Mie(e,b,t,o,r,x)),d&&(b=i[m].derivedCommands.tileset,Mie(e,b,t,o,r,x))}}}Ml.initializeTerrainHeights=function(){return li.initialize()};Ml.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!li.initialized){Ml.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){o=a[f],r=o.geometry;let x=pU(e,r);l(d)?l(x)&&se.union(d,x,d):d=se.clone(x);let b=o.id;if(l(b)&&l(x)){let T=li.getBoundingSphere(x,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(T)}s=r.constructor,!l(s)||l(s.createShadowVolume)}RLe(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Er.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Er.getHeight(this._maxTerrainHeight,p,g);let m=Ml._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let x,b=!0;for(f=0;f<c;++f)if(o=a[f],r=o.geometry,d=pU(e,r),yu.shouldUseSphericalCoordinates(d)){b=!1;break}for(f=0;f<c;++f){o=a[f],r=o.geometry,s=r.constructor;let T=pU(e,r),C=r.textureCoordinateRotationPoints;b?x=yu.getPlanarTextureCoordinateAttributes(T,C,i,e.mapProjection,this._maxHeight):x=yu.getSphericalExtentGeometryInstanceAttributes(T,C,i,e.mapProjection);let A=o.attributes;for(let E in A)A.hasOwnProperty(E)&&(x[E]=A[E]);u[f]=new St({geometry:s.createShadowVolume(r,Oie(this),Rie(this)),attributes:x,id:o.id})}}else for(f=0;f<c;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new St({geometry:s.createShadowVolume(r,Oie(this),Rie(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,b){OLe(t,x,b)},n._updateAndQueueCommandsFunction=function(x,b,T,C,A,E,v,D){MLe(t,b,T,C,A,E,v,D)},this._primitive=new dA(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Ml.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Ml.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Ml.prototype.isDestroyed=function(){return!1};Ml.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};Ml._supportsMaterials=function(e){return e.depthTexture};Ml.supportsMaterials=function(e){return Ml._supportsMaterials(e.frameState.context)};var Wc=Ml;function hA(){he.throwInstantiationError()}Object.defineProperties(hA.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});hA.prototype.getType=he.throwInstantiationError;hA.prototype.getValue=he.throwInstantiationError;hA.prototype.equals=he.throwInstantiationError;var LLe=new Z;hA.getValue=function(e,t,n){let i;return l(e)||(e=Z.now(LLe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Yi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Yi.ColorType)&&(n=Yi.fromType(Yi.ColorType)),H.clone(H.WHITE,n.uniforms.color),n)};var tr=hA;function Ix(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Ix.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!Y.getValueOrDefault(t.show,n,!0)};Ix.prototype._setOptions=he.throwInstantiationError;Ix.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Ut,d,p=t._getIsClosed(c);if(f)d=new an({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=tr.getValue(e,u,this._material);this._material=g,d=new co({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=an.VERTEX_FORMAT,this._primitive=o.add(new Wc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),Y.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Dn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=Y.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Dn({geometryInstances:u,appearance:new an({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Ix.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),at.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),at.DONE):l(n)&&!n.ready||l(i)&&!i.ready?at.PENDING:at.FAILED};Ix.prototype.isDestroyed=function(){return!1};Ix.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ni=Ix;var NLe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Np=Object.freeze(NLe);var FLe={NONE:0,GEODESIC:1,RHUMB:2},Qt=Object.freeze(FLe);var Lie=P.EPSILON10;function BLe(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<r;++s)c=e[s],t(a,c,Lie)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),o&&i.push(s)):(l(u)&&(u.push(c),f=s,o&&(d=i.length)),a=c);return n&&t(e[0],e[r-1],Lie)&&(o&&(l(u)?i.splice(d,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Co=BLe;function kLe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,r),d=c*s,p=d*d,g=1-p,m=Math.sqrt(g),x=t/4,b=x*x,T=b*x,C=b*b,A=1+x-3*b/4+5*T/4-175*C/64,E=1-x+15*b/8-35*T/8,v=1-3*x+35*b/4,D=1-5*x,O=A*f-E*Math.sin(2*f)*x/2-v*Math.sin(4*f)*b/16-D*Math.sin(6*f)*T/48-Math.sin(8*f)*5*C/512,R=e._constants;R.a=n,R.b=i,R.f=o,R.cosineHeading=r,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=x,R.u4Over16=b,R.u6Over64=T,R.u8Over256=C,R.a0=A,R.a1=E,R.a2=v,R.a3=D,R.distanceRatio=O}function VLe(e,t){return e*t*(4+e*(4-3*t))/16}function Nie(e,t,n,i,o,r,s){let a=VLe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function ULe(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),x=d*g,b=d*m,T=p*m,C=p*g,A=c,E=P.TWO_PI,v=Math.cos(A),D=Math.sin(A),O,R,M,N,_;do{v=Math.cos(A),D=Math.sin(A);let k=b-C*v;M=Math.sqrt(g*g*D*D+k*k),R=T+x*v,O=Math.atan2(M,R);let W;M===0?(W=0,N=1):(W=x*D/M,N=1-W*W),E=A,_=R-2*T/N,isFinite(_)||(_=0),A=c+Nie(a,W,N,O,M,R,_)}while(Math.abs(A-E)>P.EPSILON12);let S=N*(t*t-n*n)/(n*n),w=1+S*(4096+S*(S*(320-175*S)-768))/16384,I=S*(256+S*(S*(74-47*S)-128))/1024,L=_*_,B=I*M*(_+I*(R*(2*L-1)-I*_*(4*M*M-3)*(4*L-3)/6)/4),U=n*w*(O-B),V=Math.atan2(g*D,b-C*v),G=Math.atan2(d*D,b*v-C);e._distance=U,e._startHeading=V,e._endHeading=G,e._uSquared=S}var zLe=new h,m9=new h;function Fie(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,m9),zLe),r=h.normalize(i.cartographicToCartesian(n,m9),m9);ULe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=fe.clone(t,e._start),e._end=fe.clone(n,e._end),e._start.height=0,e._end.height=0,kLe(e)}function o1(e,t,n){let i=y(n,ee.default);this._ellipsoid=i,this._start=new fe,this._end=new fe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Fie(this,e,t,i)}Object.defineProperties(o1.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});o1.prototype.setEndPoints=function(e,t){Fie(this,e,t,this._ellipsoid)};o1.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};o1.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,x=n.u6Over64,b=n.u4Over16,T=2*p*g*o/3+i*(1-m+7*b/4-15*x/4+579*g/64-(b-15*x/4+187*g/16)*o-(5*x/4-115*g/16)*r-29*g*s/16)+(m/2-b+71*x/32-85*g/16)*a+(5*b/16-5*x/4+383*g/96)*c-d*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*u+539*g*f/1536,C=Math.asin(Math.sin(T)*n.cosineAlpha),A=Math.atan(n.a/n.b*Math.tan(C));T=T-n.sigma;let E=Math.cos(2*n.sigma+T),v=Math.sin(T),D=Math.cos(T),O=n.cosineU*D,R=n.sineU*v,N=Math.atan2(v*n.sineHeading,O-R*n.cosineHeading)-Nie(n.f,n.sineAlpha,n.cosineSquaredAlpha,T,v,D,E);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=A,t.height=0,t):new fe(this._start.longitude+N,A,0)};var Fp=o1;function _9(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),x=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*x)}function HLe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),x=Math.cos(2*i),b=Math.sin(4*i),T=Math.cos(4*i),C=Math.sin(6*i),A=Math.cos(6*i),E=Math.sin(8*i),v=Math.cos(8*i),D=Math.sin(10*i),O=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*d/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*x+(21*i*f/256+483*i*d/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*T+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*A+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*O+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*d/4096-33*o*d/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*o*d/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*b+(151*f/6144+151*d/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*C+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*E+(8011*p/2621440+8011*g/1048576)*D+293393*g/251658240*R}function mA(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function GLe(e,t,n,i,o){let r=mA(e._ellipticity,n),s=mA(e._ellipticity,o);return Math.atan2(P.negativePiToPi(i-t),s-r)}function WLe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(o)*P.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=_9(e._ellipticity,t,o);u=(_9(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var jLe=new h,p9=new h;function Bie(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,p9),jLe),r=h.normalize(i.cartographicToCartesian(n,p9),p9),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=fe.clone(t,e._start),e._start.height=0,e._end=fe.clone(n,e._end),e._end.height=0,e._heading=GLe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=WLe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function kie(e,t,n,i,o,r){if(n===0)return fe.clone(e,r);let s=o*o,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=_9(o,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=HLe(p,o,i),Math.abs(t)<P.EPSILON10)a=P.negativePiToPi(e.longitude);else{let g=mA(o,e.latitude),m=mA(o,c);u=Math.tan(t)*(m-g),a=P.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new fe(a,c,0)}function Bp(e,t,n){let i=y(n,ee.default);this._ellipsoid=i,this._start=new fe,this._end=new fe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Bie(this,e,t,i)}Object.defineProperties(Bp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});Bp.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,ee.default),s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=kie(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new Bp(e,d,r):(o.setEndPoints(e,d),o)};Bp.prototype.setEndPoints=function(e,t){Bie(this,e,t,this._ellipsoid)};Bp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Bp.prototype.interpolateUsingSurfaceDistance=function(e,t){return kie(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Bp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(r.longitude)*Math.PI),l(t)||(t=new fe),Math.abs(P.PI_OVER_TWO-o)<=P.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-o),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,r.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};Bp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let r=mA(n,o.latitude),s=mA(n,e),a=Math.tan(i)*(s-r),c=P.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new fe(c,e,0)};var La=Bp;var E9=[Pi,Oi],qLe=E9.length,ooe=Math.cos(P.toRadians(30)),Vie=Math.cos(P.toRadians(150)),roe=0,soe=1e3;function $g(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,Qt.GEODESIC),this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties($g.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});$g.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<qLe;i++)if(t instanceof E9[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var YLe=new h,Uie=new h,zie=new h;function A9(e,t,n,i,o){let r=jc(i,e,0,YLe),s=jc(i,e,n,Uie),a=jc(i,t,0,zie),c=kp(s,r,Uie),u=kp(a,r,zie);return h.cross(u,c,o),h.normalize(o,o)}var XLe=new fe,KLe=new h,ZLe=new h,$Le=new h;function g9(e,t,n,i,o,r,s,a,c,u,f){if(o===0)return;let d;r===Qt.GEODESIC?d=new Fp(e,t,s):r===Qt.RHUMB&&(d=new La(e,t,s));let p=d.surfaceDistance;if(p<o)return;let g=A9(e,t,i,s,$Le),m=Math.ceil(p/o),x=p/m,b=x,T=m-1,C=a.length;for(let A=0;A<T;A++){let E=d.interpolateUsingSurfaceDistance(b,XLe),v=jc(s,E,n,KLe),D=jc(s,E,i,ZLe);h.pack(g,a,C),h.pack(v,c,C),h.pack(D,u,C),f.push(E.latitude),f.push(E.longitude),C+=3,b+=x}}var y9=new fe;function jc(e,t,n,i){return fe.clone(t,y9),y9.height=n,fe.toCartesian(y9,e,i)}$g.pack=function(e,t,n){let i=y(n,0),o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ee.pack(e._ellipsoid,t,i),i+=ee.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};$g.unpack=function(e,t,n){let i=y(t,0),o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=ee.unpack(e,i);i+=ee.packedLength;let f=e[i++],d=e[i++]===1;return l(n)||(n=new $g({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function kp(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function Hie(e,t,n,i){return i=kp(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var QLe=new h,JLe=new h,eNe=new h,aoe=new h,tNe=0,nNe=-1;function x9(e,t,n,i,o){let r=kp(n,t,aoe),s=Hie(e,t,r,QLe),a=Hie(i,t,r,JLe);if(P.equalsEpsilon(h.dot(s,a),nNe,P.EPSILON5))return o=h.cross(r,s,o),o=h.normalize(o,o),o;o=h.add(a,s,o),o=h.normalize(o,o);let c=h.cross(r,o,eNe);return h.dot(a,c)<tNe&&(o=h.negate(o,o)),o}var xU=rn.fromPointNormal(h.ZERO,h.UNIT_Y),iNe=new h,oNe=new h,rNe=new h,sNe=new h,aNe=new h,_U=new h,gU=new fe,Gie=new fe,Wie=new fe;$g.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new E9[e._projectionIndex](i),a=roe,c=soe,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,x,b,T=new La(void 0,void 0,i),C,A,E,v=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],C=$n.lineSegmentPlane(g,m,xU,_U),l(C)&&!h.equalsEpsilon(C,g,P.EPSILON7)&&!h.equalsEpsilon(C,m,P.EPSILON7)&&(e.arcType===Qt.GEODESIC?v.push(h.clone(C)):e.arcType===Qt.RHUMB&&(E=i.cartesianToCartographic(C,gU).longitude,x=i.cartesianToCartographic(g,gU),b=i.cartesianToCartographic(m,Gie),T.setEndPoints(x,b),A=T.findIntersectionWithLongitude(E,Wie),C=i.cartographicToCartesian(A,_U),l(C)&&!h.equalsEpsilon(C,g,P.EPSILON7)&&!h.equalsEpsilon(C,m,P.EPSILON7)&&v.push(h.clone(C)))),v.push(m);n&&(g=d[p-1],m=d[0],C=$n.lineSegmentPlane(g,m,xU,_U),l(C)&&!h.equalsEpsilon(C,g,P.EPSILON7)&&!h.equalsEpsilon(C,m,P.EPSILON7)&&(e.arcType===Qt.GEODESIC?v.push(h.clone(C)):e.arcType===Qt.RHUMB&&(E=i.cartesianToCartographic(C,gU).longitude,x=i.cartesianToCartographic(g,gU),b=i.cartesianToCartographic(m,Gie),T.setEndPoints(x,b),A=T.findIntersectionWithLongitude(E,Wie),C=i.cartographicToCartesian(A,_U),l(C)&&!h.equalsEpsilon(C,g,P.EPSILON7)&&!h.equalsEpsilon(C,m,P.EPSILON7)&&v.push(h.clone(C)))));let D=v.length,O=new Array(D);for(f=0;f<D;f++){let q=fe.fromCartesian(v[f],i);q.height=0,O[f]=q}if(O=Co(O,fe.equalsEpsilon),D=O.length,D<2)return;let R=[],M=[],N=[],_=[],S=iNe,w=oNe,I=rNe,L=sNe,B=aNe,U=O[0],V=O[1],G=O[D-1];for(S=jc(i,G,a,S),L=jc(i,V,a,L),w=jc(i,U,a,w),I=jc(i,U,c,I),n?B=x9(S,w,I,L,B):B=A9(U,V,c,i,B),h.pack(B,M,0),h.pack(w,N,0),h.pack(I,_,0),R.push(U.latitude),R.push(U.longitude),g9(U,V,a,c,o,r,i,M,N,_,R),f=1;f<D-1;++f){S=h.clone(w,S),w=h.clone(L,w);let q=O[f];jc(i,q,c,I),jc(i,O[f+1],a,L),x9(S,w,I,L,B),u=M.length,h.pack(B,M,u),h.pack(w,N,u),h.pack(I,_,u),R.push(q.latitude),R.push(q.longitude),g9(O[f],O[f+1],a,c,o,r,i,M,N,_,R)}let k=O[D-1],W=O[D-2];if(w=jc(i,k,a,w),I=jc(i,k,c,I),n){let q=O[0];S=jc(i,W,a,S),L=jc(i,q,a,L),B=x9(S,w,I,L,B)}else B=A9(W,k,c,i,B);if(u=M.length,h.pack(B,M,u),h.pack(w,N,u),h.pack(I,_,u),R.push(k.latitude),R.push(k.longitude),n){for(g9(k,U,a,c,o,r,i,M,N,_,R),u=M.length,f=0;f<3;++f)M[u+f]=M[f],N[u+f]=N[f],_[u+f]=_[f];R.push(U.latitude),R.push(U.longitude)}return MNe(n,s,N,_,M,R,t)};var cNe=new h,lNe=new $,uNe=new Oe;function jie(e,t,n,i){let o=kp(n,t,cNe),r=h.dot(o,e);if(r>ooe||r<Vie){let s=kp(i,n,aoe),a=r<Vie?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Oe.fromAxisAngle(s,a,uNe),u=$.fromQuaternion(c,lNe);return $.multiplyByVector(u,e,e),!0}return!1}var qie=new fe,fNe=new h,Yie=new h;function r1(e,t,n,i,o){let r=fe.toCartesian(t,e._ellipsoid,fNe),s=h.add(r,n,Yie),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,qie);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,Yie),u=c.cartesianToCartographic(s,qie)),u.height=0;let f=e.project(u,o);return o=h.subtract(f,i,o),o.z=0,o=h.normalize(o,o),a&&h.negate(o,o),o}var dNe=new h,Xie=new h;function Kie(e,t,n,i,o,r){let s=h.subtract(t,e,dNe);h.normalize(s,s);let a=n-roe,c=h.multiplyByScalar(s,a,Xie);h.add(e,c,o);let u=i-soe;c=h.multiplyByScalar(s,u,Xie),h.add(t,c,r)}var hNe=new h;function yU(e,t){let n=rn.getPointDistance(xU,e),i=rn.getPointDistance(xU,t),o=hNe;P.equalsEpsilon(n,0,P.EPSILON2)?(o=kp(t,e,o),h.multiplyByScalar(o,P.EPSILON2,o),h.add(e,o,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(o=kp(e,t,o),h.multiplyByScalar(o,P.EPSILON2,o),h.add(t,o,t))}function mNe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let o=P.sign(t.longitude);return e.longitude=o*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let o=P.sign(e.longitude);return t.longitude=o*(i-P.EPSILON11),2}return 0}var coe=new fe,loe=new fe,Zie=new h,b9=new h,$ie=new h,Qie=new h,pNe=new h,Jie=new h,_Ne=[coe,loe],gNe=new se,yNe=new h,xNe=new h,bNe=new h,TNe=new h,CNe=new h,ANe=new h,T9=new h,C9=new h,ENe=new h,SNe=new h,vNe=new h,eoe=new h,wNe=new h,DNe=new h,INe=new Hn,PNe=new Hn,toe=new h,RNe=new h,noe=new h,ONe=[new ae,new ae],uoe=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],ioe=uoe.length;function MNe(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(d*3),b=new Float32Array(p),T=new Float32Array(p),C=new Float32Array(p),A=new Float32Array(p),E=new Float32Array(p),v,D,O,R;s&&(v=new Float32Array(p),D=new Float32Array(p),O=new Float32Array(p),R=new Float32Array(d*2));let M=r.length/2,N=0,_=coe;_.height=0;let S=loe;S.height=0;let w=Zie,I=b9;if(s)for(c=0,a=1;a<M;a++)_.latitude=r[c],_.longitude=r[c+1],S.latitude=r[c+2],S.longitude=r[c+3],w=t.project(_,w),I=t.project(S,I),N+=h.distance(w,I),c+=2;let L=i.length/3;I=h.unpack(i,0,I);let B=0;for(c=3,a=1;a<L;a++)w=h.clone(I,w),I=h.unpack(i,c,I),B+=h.distance(w,I),c+=3;let U;c=3;let V=0,G=0,k=0,W=0,q=!1,J=h.unpack(n,0,Qie),j=h.unpack(i,0,b9),K=h.unpack(o,0,Jie);if(e){let Ae=h.unpack(n,n.length-6,$ie);jie(K,Ae,J,j)&&(K=h.negate(K,K))}let Q=0,de=0,xe=0;for(a=0;a<f;a++){let Ae=h.clone(J,$ie),ke=h.clone(j,Zie),ze=h.clone(K,pNe);q&&(ze=h.negate(ze,ze)),J=h.unpack(n,c,Qie),j=h.unpack(i,c,b9),K=h.unpack(o,c,Jie),q=jie(K,Ae,J,j),_.latitude=r[V],_.longitude=r[V+1],S.latitude=r[V+2],S.longitude=r[V+3];let tt,vt,pt,Be;if(s){let pi=mNe(_,S);tt=t.project(_,CNe),vt=t.project(S,ANe);let sa=kp(vt,tt,toe);sa.y=Math.abs(sa.y),pt=T9,Be=C9,pi===0||h.dot(sa,h.UNIT_Y)>ooe?(pt=r1(t,_,ze,tt,T9),Be=r1(t,S,K,vt,C9)):pi===1?(Be=r1(t,S,K,vt,C9),pt.x=0,pt.y=P.sign(_.longitude-Math.abs(S.longitude)),pt.z=0):(pt=r1(t,_,ze,tt,T9),Be.x=0,Be.y=P.sign(_.longitude-S.longitude),Be.z=0)}let qt=h.distance(ke,j),At=Hn.fromCartesian(Ae,INe),lt=h.subtract(J,Ae,ENe),jn=h.normalize(lt,eoe),sn=h.subtract(ke,Ae,SNe);sn=h.normalize(sn,sn);let me=h.cross(jn,sn,eoe);me=h.normalize(me,me);let Ce=h.cross(sn,ze,wNe);Ce=h.normalize(Ce,Ce);let mn=h.subtract(j,J,vNe);mn=h.normalize(mn,mn);let ft=h.cross(K,mn,DNe);ft=h.normalize(ft,ft);let ao=qt/B,Ro=Q/B,ra=0,Rr,As,Le,it=0,qe=0;if(s){ra=h.distance(tt,vt),Rr=Hn.fromCartesian(tt,PNe),As=h.subtract(vt,tt,toe),Le=h.normalize(As,RNe);let pi=Le.x;Le.x=Le.y,Le.y=-pi,it=ra/N,qe=de/N}for(U=0;U<8;U++){let pi=W+U*4,sa=G+U*2,Zr=pi+3,Al=U<4?1:-1,xo=U===2||U===3||U===6||U===7?1:-1;h.pack(At.high,b,pi),b[Zr]=lt.x,h.pack(At.low,T,pi),T[Zr]=lt.y,h.pack(Ce,C,pi),C[Zr]=lt.z,h.pack(ft,A,pi),A[Zr]=ao*Al,h.pack(me,E,pi);let Or=Ro*xo;Or===0&&xo<0&&(Or=9),E[Zr]=Or,s&&(v[pi]=Rr.high.x,v[pi+1]=Rr.high.y,v[pi+2]=Rr.low.x,v[pi+3]=Rr.low.y,O[pi]=-pt.y,O[pi+1]=pt.x,O[pi+2]=Be.y,O[pi+3]=-Be.x,D[pi]=As.x,D[pi+1]=As.y,D[pi+2]=Le.x,D[pi+3]=Le.y,R[sa]=it*Al,Or=qe*xo,Or===0&&xo<0&&(Or=9),R[sa+1]=Or)}let Xe=bNe,dt=TNe,Ht=yNe,Tn=xNe,Oo=se.fromCartographicArray(_Ne,gNe),Ao=li.getMinimumMaximumHeights(Oo,u),Za=Ao.minimumTerrainHeight,$a=Ao.maximumTerrainHeight;xe+=Math.abs(Za),xe+=Math.abs($a),Kie(Ae,ke,Za,$a,Xe,Ht),Kie(J,j,Za,$a,dt,Tn);let Ai=h.multiplyByScalar(me,P.EPSILON5,noe);h.add(Xe,Ai,Xe),h.add(dt,Ai,dt),h.add(Ht,Ai,Ht),h.add(Tn,Ai,Tn),yU(Xe,dt),yU(Ht,Tn),h.pack(Xe,x,k),h.pack(dt,x,k+3),h.pack(Tn,x,k+6),h.pack(Ht,x,k+9),Ai=h.multiplyByScalar(me,-2*P.EPSILON5,noe),h.add(Xe,Ai,Xe),h.add(dt,Ai,dt),h.add(Ht,Ai,Ht),h.add(Tn,Ai,Tn),yU(Xe,dt),yU(Ht,Tn),h.pack(Xe,x,k+12),h.pack(dt,x,k+15),h.pack(Tn,x,k+18),h.pack(Ht,x,k+21),V+=2,c+=3,G+=16,k+=24,W+=32,Q+=qt,de+=ra}c=0;let ce=0;for(a=0;a<f;a++){for(U=0;U<ioe;U++)m[c+U]=uoe[U]+ce;ce+=8,c+=ioe}let ge=ONe;ae.fromVertices(n,h.ZERO,3,ge[0]),ae.fromVertices(i,h.ZERO,3,ge[1]);let be=ae.fromBoundingSpheres(ge);be.radius+=xe/(f*2);let De={position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:Zg(b),startLoAndForwardOffsetY:Zg(T),startNormalAndForwardOffsetZ:Zg(C),endNormalAndTextureCoordinateNormalizationX:Zg(A),rightNormalAndTextureCoordinateNormalizationY:Zg(E)};return s&&(De.startHiLo2D=Zg(v),De.offsetAndRight2D=Zg(D),De.startEndNormals2D=Zg(O),De.texcoordNormalization2D=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new st({attributes:De,indices:m,boundingSphere:be})}function Zg(e){return new ve({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}$g._projectNormal=r1;var Px=$g;var s1=`in vec4 v_startPlaneNormalEcAndHalfWidth; +in vec4 v_endPlaneNormalEcAndBatchId; +in vec4 v_rightPlaneEC; // Technically can compute distance for this here +in vec4 v_endEcAndStartEcX; +in vec4 v_texcoordNormalizationAndStartEcYZ; + +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#endif + +void main(void) +{ + float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); + vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); + + // Discard for sky + if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } + + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + eyeCoordinate /= eyeCoordinate.w; + + float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); + // Check distance of the eye coordinate against the right-facing plane + float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); + + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); + + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } + + // Check distance of the eye coordinate against start and end planes with normals in the right plane. + // For computing unskewed lengthwise texture coordinate. + // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. + + // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" + vec3 alignedPlaneNormal; + + // start aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); + + // end aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); + +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Clamp - distance to aligned planes may be negative due to mitering, + // so fragment texture coordinate might be out-of-bounds. + float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); + s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; + float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); + + czm_materialInput materialInput; + + materialInput.s = s; + materialInput.st = vec2(s, t); + materialInput.str = vec3(s, t, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + + czm_writeDepthClamp(); +} +`;var a1=`in vec3 v_forwardDirectionEC; +in vec3 v_texcoordNormalizationAndHalfWidth; +in float v_batchId; + +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#else +in vec2 v_alignedPlaneDistances; +in float v_texcoordT; +#endif + +float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { + // We don't expect the ray to ever be parallel to the plane + return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); +} + +void main(void) +{ + vec4 eyeCoordinate = gl_FragCoord; + eyeCoordinate /= eyeCoordinate.w; + +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Use distances for planes aligned with segment to prevent skew in dashing + float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); + float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); + + // Clamp - distance to aligned planes may be negative due to mitering + distanceFromStart = max(0.0, distanceFromStart); + distanceFromEnd = max(0.0, distanceFromEnd); + + float s = distanceFromStart / (distanceFromStart + distanceFromEnd); + s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; + + czm_materialInput materialInput; + + materialInput.s = s; + materialInput.st = vec2(s, v_texcoordT); + materialInput.str = vec3(s, v_texcoordT, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR +} +`;var c1=`in vec3 position3DHigh; +in vec3 position3DLow; + +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; + +in float batchId; + +out vec3 v_forwardDirectionEC; +out vec3 v_texcoordNormalizationAndHalfWidth; +out float v_batchId; + +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#else +out vec2 v_alignedPlaneDistances; +out float v_texcoordT; +#endif + +// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. +// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. +void main() +{ + v_batchId = batchId; + + // Start position + vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); + vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); + vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; + + // Start plane + vec4 startPlane2D; + vec4 startPlane3D; + startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); + startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); + + // Right plane + vec4 rightPlane2D; + vec4 rightPlane3D; + rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); + rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); + + // End position + posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); + posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); + posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; + vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); + vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); + + // End plane + vec4 endPlane2D; + vec4 endPlane3D; + endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); + endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); + + // Forward direction + v_forwardDirectionEC = normalize(endEC - startEC); + + vec2 cleanTexcoordNormalization2D; + cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); + cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); + vec2 cleanTexcoordNormalization3D; + cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; + cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); + + v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#else // PER_INSTANCE_COLOR + // For computing texture coordinates + + v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); + v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); +#endif // PER_INSTANCE_COLOR + +#ifdef WIDTH_VARYING + float width = czm_batchTable_width(batchId); + float halfWidth = width * 0.5; + v_width = width; + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#else + float halfWidth = 0.5 * czm_batchTable_width(batchId); + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#endif + + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + // Since this is morphing, compute both 3D and 2D positions and then blend. + + // ****** 3D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); + vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Nudge the top vertex upwards to prevent flickering + vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); + geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc3D.xyz += geodeticSurfaceNormal; + + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); + + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + + // ****** 2D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition + absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); + absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); + planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); + upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Nudge the top vertex upwards to prevent flickering + geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); + geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc2D.xyz += geodeticSurfaceNormal; + + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(texcoordNormalization2D.x); +#ifndef PER_INSTANCE_COLOR + // Use vertex's sidedness to compute its texture coordinate. + v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); +#endif + + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + + // Blend for actual position + gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); + +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif +} +`;var l1=`in vec3 position3DHigh; +in vec3 position3DLow; + +// In 2D and in 3D, texture coordinate normalization component signs encodes: +// * X sign - sidedness relative to right plane +// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume +#ifndef COLUMBUS_VIEW_2D +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +#else +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +#endif + +in float batchId; + +out vec4 v_startPlaneNormalEcAndHalfWidth; +out vec4 v_endPlaneNormalEcAndBatchId; +out vec4 v_rightPlaneEC; +out vec4 v_endEcAndStartEcX; +out vec4 v_texcoordNormalizationAndStartEcYZ; + +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif + +void main() +{ +#ifdef COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; + + vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); + vec3 ecEnd = forwardDirectionEC + ecStart; + forwardDirectionEC = normalize(forwardDirectionEC); + + // Right plane + v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + + v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); + v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; + +#else // COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; + vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); + vec3 ecEnd = ecStart + offset; + + vec3 forwardDirectionEC = normalize(offset); + + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + + // Right plane + v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + + v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; + +#endif // COLUMBUS_VIEW_2D + + v_endEcAndStartEcX.xyz = ecEnd; + v_endEcAndStartEcX.w = ecStart.x; + v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif // PER_INSTANCE_COLOR + + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + vec4 positionRelativeToEye = czm_computePosition(); + + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); + vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Extrude bottom vertices downward for far view distances, like for GroundPrimitives + upOrDown = cross(forwardDirectionEC, normalEC); + upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; + upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; + upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; + positionEC.xyz += upOrDown; + + v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); + + // Determine distance along normalEC to push for a volume of appropriate width. + // Make volumes about double pixel width for a conservative fit - in practice the + // extra cost here is minimal compared to the loose volume heights. + // + // N = normalEC (guaranteed "right-facing") + // R = rightEC + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + float width = czm_batchTable_width(batchId); +#ifdef WIDTH_VARYING + v_width = width; +#endif + + v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; + v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; + + v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; + v_endPlaneNormalEcAndBatchId.w = batchId; + + width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R + width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N + + // Determine if this vertex is on the "left" or "right" +#ifdef COLUMBUS_VIEW_2D + normalEC *= sign(texcoordNormalization2D.x); +#else + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +#endif + + positionEC.xyz += width * normalEC; + gl_Position = czm_depthClamp(czm_projection * positionEC); + +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif +} +`;var u1=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec4 color; +in float batchId; + +out vec4 v_color; + +void main() +{ + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; + + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); + + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; + + v_color = color; +} +`;var xu=`void clipLineSegmentToNearPlane( + vec3 p0, + vec3 p1, + out vec4 positionWC, + out bool clipped, + out bool culledByNearPlane, + out vec4 clippedPositionEC) +{ + culledByNearPlane = false; + clipped = false; + + vec3 p0ToP1 = p1 - p0; + float magnitude = length(p0ToP1); + vec3 direction = normalize(p0ToP1); + + // Distance that p0 is behind the near plane. Negative means p0 is + // in front of the near plane. + float endPoint0Distance = czm_currentFrustum.x + p0.z; + + // Camera looks down -Z. + // When moving a point along +Z: LESS VISIBLE + // * Points in front of the camera move closer to the camera. + // * Points behind the camrea move farther away from the camera. + // When moving a point along -Z: MORE VISIBLE + // * Points in front of the camera move farther away from the camera. + // * Points behind the camera move closer to the camera. + + // Positive denominator: -Z, becoming more visible + // Negative denominator: +Z, becoming less visible + // Nearly zero: parallel to near plane + float denominator = -direction.z; + + if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) + { + // p0 is behind the near plane and the line to p1 is nearly parallel to + // the near plane, so cull the segment completely. + culledByNearPlane = true; + } + else if (endPoint0Distance > 0.0) + { + // p0 is behind the near plane, and the line to p1 is moving distinctly + // toward or away from it. + + // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) + float t = endPoint0Distance / denominator; + if (t < 0.0 || t > magnitude) + { + // Near plane intersection is not between the two points. + // We already confirmed p0 is behind the naer plane, so now + // we know the entire segment is behind it. + culledByNearPlane = true; + } + else + { + // Segment crosses the near plane, update p0 to lie exactly on it. + p0 = p0 + t * direction; + + // Numerical noise might put us a bit on the wrong side of the near plane. + // Don't let that happen. + p0.z = min(p0.z, -czm_currentFrustum.x); + + clipped = true; + } + } + + clippedPositionEC = vec4(p0, 1.0); + positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); +} + +vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) +{ + // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. + +#ifdef POLYLINE_DASH + // Compute the window coordinates of the points. + vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); + vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); + vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); + + // Determine the relative screen space direction of the line. + vec2 lineDir; + if (usePrevious) { + lineDir = normalize(positionWindow.xy - previousWindow.xy); + } + else { + lineDir = normalize(nextWindow.xy - positionWindow.xy); + } + angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) + + // Quantize the angle so it doesn't change rapidly between segments. + angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +#endif + + vec4 clippedPrevWC, clippedPrevEC; + bool prevSegmentClipped, prevSegmentCulled; + clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); + + vec4 clippedNextWC, clippedNextEC; + bool nextSegmentClipped, nextSegmentCulled; + clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); + + bool segmentClipped, segmentCulled; + vec4 clippedPositionWC, clippedPositionEC; + clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); + + if (segmentCulled) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + + vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); + vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); + + // If a segment was culled, we can't use the corresponding direction + // computed above. We should never see both of these be true without + // \`segmentCulled\` above also being true. + if (prevSegmentCulled) + { + directionToPrevWC = -directionToNextWC; + } + else if (nextSegmentCulled) + { + directionToNextWC = -directionToPrevWC; + } + + vec2 thisSegmentForwardWC, otherSegmentForwardWC; + if (usePrevious) + { + thisSegmentForwardWC = -directionToPrevWC; + otherSegmentForwardWC = directionToNextWC; + } + else + { + thisSegmentForwardWC = directionToNextWC; + otherSegmentForwardWC = -directionToPrevWC; + } + + vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); + + vec2 leftWC = thisSegmentLeftWC; + float expandWidth = width * 0.5; + + // When lines are split at the anti-meridian, the position may be at the + // same location as the next or previous position, and we need to handle + // that to avoid producing NaNs. + if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) + { + vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); + + vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; + float leftSumLength = length(leftSumWC); + leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); + + // The sine of the angle between the two vectors is given by the formula + // |a x b| = |a||b|sin(theta) + // which is + // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); + // Because the z components of both vectors are zero, the x and y coordinate will be zero. + // Therefore, the sine of the angle is just the z component of the cross product. + vec2 u = -thisSegmentForwardWC; + vec2 v = leftWC; + float sinAngle = abs(u.x * v.y - u.y * v.x); + expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); + } + + vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; + return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; +} + +vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) +{ + vec4 positionEC = czm_modelViewRelativeToEye * position; + vec4 prevEC = czm_modelViewRelativeToEye * previous; + vec4 nextEC = czm_modelViewRelativeToEye * next; + return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); +} +`;var S9=`${xu} +${u1}`,LNe=Sx;zt.isInternetExplorer()||(S9=`#define CLIP_POLYLINE +${S9}`);function Rx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Rx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,S9),this._fragmentShaderSource=y(e.fragmentShaderSource,LNe),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Rx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Rx.VERTEX_FORMAT=Ie.POSITION_ONLY;Rx.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Rx.prototype.isTranslucent=io.prototype.isTranslucent;Rx.prototype.getRenderState=io.prototype.getRenderState;var es=Rx;var f1=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec2 st; +in float batchId; + +out float v_width; +out vec2 v_st; +out float v_polylineAngle; + +void main() +{ + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; + + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); + + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; + + v_width = width; + v_st.s = st.s; + v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); + v_polylineAngle = angle; +} +`;var Ox=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif + +in vec2 v_st; + +void main() +{ + czm_materialInput materialInput; + + vec2 st = v_st; + st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); + + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = vec3(st, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#ifdef VECTOR_TILE + out_FragColor *= u_highlightColor; +#endif + + czm_writeLogDepth(); +} +`;var v9=`${xu} +${f1}`,NNe=Ox;zt.isInternetExplorer()||(v9=`#define CLIP_POLYLINE +${v9}`);function Mx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Mx.VERTEX_FORMAT;this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,v9),this._fragmentShaderSource=y(e.fragmentShaderSource,NNe),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Mx.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH +${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Mx.VERTEX_FORMAT=Ie.POSITION_AND_ST;Mx.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Mx.prototype.isTranslucent=io.prototype.isTranslucent;Mx.prototype.getRenderState=io.prototype.getRenderState;var fa=Mx;function Vp(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new fa),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=foe(!1),this._renderState3DTiles=foe(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:!0},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Vp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});Vp.initializeTerrainHeights=function(){return li.initialize()};function FNe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(l1);s=Dn._appendShowToShader(o,s),s=Dn._appendDistanceDisplayConditionToShader(o,s),s=Dn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(c1);a=Dn._appendShowToShader(o,a),a=Dn._appendDistanceDisplayConditionToShader(o,a),a=Dn._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(s1),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new Ue({defines:u,sources:[s]}),m=new Ue({defines:p,sources:[d,c]});e._sp=$t.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let T=new Ue({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:T,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=x;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(b)){let T=new Ue({defines:u.concat([`MAX_TERRAIN_HEIGHT ${li._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(a1);let C=new Ue({defines:p,sources:[d,c]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:r})}e._spMorph=b}function foe(e){return Ve.fromCache({cull:{enabled:!0},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK}})}function BNe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof es?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=o[d];l(g)||(g=o[d]=new Ze({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=we.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=Ze.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=we.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let x=Ze.shallowClone(g,g.derivedCommands.color2D);x.shaderProgram=e._sp2D,g.derivedCommands.color2D=x;let b=Ze.shallowClone(m,m.derivedCommands.color2D);b.shaderProgram=e._sp2D,m.derivedCommands.color2D=b;let T=Ze.shallowClone(g,g.derivedCommands.colorMorph);T.renderState=e._renderStateMorph,T.shaderProgram=e._spMorph,T.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=T}}function doe(e,t,n,i,o,r,s){n.mode===ne.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ne.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function kNe(e,t,n,i,o,r,s){let a=e._primitive;Dn._updateBoundingVolumes(a,t,o);let c;t.mode===ne.SCENE3D?c=a._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ne.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===ne.MORPHING,f=e.classificationType,d=f!==kn.CESIUM_3D_TILE,p=f!==kn.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let x=n.length;for(let b=0;b<x;++b){let T=c[b];d&&(g=n[b],doe(e,g,t,o,r,T,s)),p&&(g=n[b].derivedCommands.tileset,doe(e,g,t,o,r,T,s))}}}Vp.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!li.initialized){Vp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new lc({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,Px.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new St({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){FNe(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){BNe(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,x){kNe(n,u,f,d,p,g,m)},this._primitive=new Dn(i)}if(this.appearance instanceof es&&!this._hasPerInstanceColors)throw new he("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Vp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Vp.isSupported=function(e){return e.frameState.context.depthTexture};Vp.prototype.isDestroyed=function(){return!1};Vp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var kd=Vp;var VNe=new z(1,1),UNe=!1,zNe=H.WHITE;function pA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(pA.prototype,{isConstant:{get:function(){return Y.isConstant(this._image)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});pA.prototype.getType=function(e){return"Image"};var HNe=new Z;pA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(HNe)),l(t)||(t={}),t.image=Y.getValueOrUndefined(this._image,e),t.repeat=Y.getValueOrClonedDefault(this._repeat,e,VNe,t.repeat),t.color=Y.getValueOrClonedDefault(this._color,e,zNe,t.color),Y.getValueOrDefault(this._transparent,e,UNe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};pA.prototype.equals=function(e){return this===e||e instanceof pA&&Y.equals(this._image,e._image)&&Y.equals(this._repeat,e._repeat)&&Y.equals(this._color,e._color)&&Y.equals(this._transparent,e._transparent)};var Qg=pA;function GNe(e){if(e instanceof H)return new Ut(e);if(typeof e=="string"||e instanceof Se||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Qg;return t.image=e,t}}function WNe(e,t){return le(e,t,GNe)}var Lo=WNe;function d1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(d1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});d1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new d1(this)};d1.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Lx=d1;var jNe={FIXED:0,INERTIAL:1},zi=Object.freeze(jNe);function _A(){he.throwInstantiationError()}Object.defineProperties(_A.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError},referenceFrame:{get:he.throwInstantiationError}});_A.prototype.getValue=he.throwInstantiationError;_A.prototype.getValueInReferenceFrame=he.throwInstantiationError;_A.prototype.equals=he.throwInstantiationError;var hoe=new $;_A.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new h),n===i)return h.clone(t,o);let r=Ot.computeIcrfToCentralBodyFixedMatrix(e,hoe);if(n===zi.INERTIAL)return $.multiplyByVector(r,t,o);if(n===zi.FIXED)return $.multiplyByVector($.transpose(r,hoe),t,o)};var Vd=_A;function Nx(e,t){this._definitionChanged=new pe,this._value=h.clone(e),this._referenceFrame=y(t,zi.FIXED)}Object.defineProperties(Nx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===zi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var qNe=new Z;Nx.prototype.getValue=function(e,t){return l(e)||(e=Z.now(qNe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};Nx.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Nx.prototype.getValueInReferenceFrame=function(e,t,n){return Vd.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Nx.prototype.equals=function(e){return this===e||e instanceof Nx&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var qc=Nx;function h1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(h1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});h1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new h1(this)};h1.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Fx=h1;function YNe(e){return e}function XNe(e,t){return le(e,t,YNe)}var Yc=XNe;function m1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(m1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});m1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new m1(this)};m1.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Bx=m1;function p1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(p1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});p1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new p1(this)};p1.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var kx=p1;function _1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(_1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});_1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new _1(this)};_1.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Vx=_1;function g1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(g1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});g1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new g1(this)};g1.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Ud=g1;var KNe=new h(1,1,1),ZNe=h.ZERO,$Ne=Oe.IDENTITY;function moe(e,t,n){this.translation=h.clone(y(e,ZNe)),this.rotation=Oe.clone(y(t,$Ne)),this.scale=h.clone(y(n,KNe))}moe.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Oe.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var Jg=moe;var w9=new Jg;function y1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(y1.prototype,{isConstant:{get:function(){return Y.isConstant(this._translation)&&Y.isConstant(this._rotation)&&Y.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});var QNe=new Z;y1.prototype.getValue=function(e,t){return l(e)||(e=Z.now(QNe)),l(t)||(t=new Jg),t.translation=Y.getValueOrClonedDefault(this._translation,e,w9.translation,t.translation),t.rotation=Y.getValueOrClonedDefault(this._rotation,e,w9.rotation,t.rotation),t.scale=Y.getValueOrClonedDefault(this._scale,e,w9.scale,t.scale),t};y1.prototype.equals=function(e){return this===e||e instanceof y1&&Y.equals(this._translation,e._translation)&&Y.equals(this._rotation,e._rotation)&&Y.equals(this._scale,e._scale)};var Ux=y1;function Up(e,t){this._propertyNames=[],this._definitionChanged=new pe,l(e)&&this.merge(e,t)}Object.defineProperties(Up.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!Y.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Up.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function JNe(e){return new Kn(e)}Up.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,y(n,JNe))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Up.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var eFe=new Z;Up.prototype.getValue=function(e,t){l(e)||(e=Z.now(eFe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=Y.getValueOrUndefined(this[r],e,t[r])}return t};Up.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function tFe(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!Y.equals(e[s],t[s]))return!1}return!0}Up.prototype.equals=function(e){return this===e||e instanceof Up&&tFe(this,e)};var Xc=Up;function poe(e){return new Ux(e)}function nFe(e){return new Xc(e,poe)}function iFe(e){return new Xc(e)}function oFe(e){return new Xc(e)}function x1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(x1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),enableVerticalExaggeration:le("enableVerticalExaggeration"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),environmentMapOptions:le("environmentMapOptions",void 0,oFe),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,nFe),articulations:le("articulations",void 0,iFe),clippingPlanes:le("clippingPlanes"),customShader:le("customShader")});x1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new x1(this)};x1.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.enableVerticalExaggeration=y(this.enableVerticalExaggeration,e.enableVerticalExaggeration),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.environmentMapOptions=y(this.environmentMapOptions,e.environmentMapOptions),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Xc(t,poe)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Xc(n)}};var zp=x1;function b1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(b1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});b1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new b1(this)};b1.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var zx=b1;function T1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(T1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:Lo("material"),distanceDisplayCondition:le("distanceDisplayCondition")});T1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new T1(this)};T1.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Hp=T1;function C1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(C1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});C1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new C1(this)};C1.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var A1=C1;function E1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(E1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance"),splitDirection:le("splitDirection")});E1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new E1(this)};E1.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var Hx=E1;function rFe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Na=rFe;function sFe(e){return Array.isArray(e)&&(e=new Na(e)),new Kn(e)}function S1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(S1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,sFe),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});S1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new S1(this)};S1.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var zd=S1;function v1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(v1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:Lo("material"),depthFailMaterial:Lo("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});v1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new v1(this)};v1.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var uc=v1;function w1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(w1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});w1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new w1(this)};w1.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Gx=w1;function D1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(D1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});D1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new D1(this)};D1.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Hd=D1;function I1(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(I1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});I1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new I1(this)};I1.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Gp=I1;var aFe=new fe,D9=[];function cFe(e){return new qc(e)}function lFe(e){return le(e,void 0,cFe)}function Gs(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Df(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=zn()),this._availability=void 0,this._id=t,this._definitionChanged=new pe,this._name=e.name,this._show=y(e.show,!0),this._trackingReferenceFrame=y(e.trackingReferenceFrame,Np.AUTODETECT),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...D9],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function I9(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&I9(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Df.prototype,{availability:Yc("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Yc("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&I9(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:Yc("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&I9(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Gs("billboard",ac),box:Gs("box",Lx),corridor:Gs("corridor",Fx),cylinder:Gs("cylinder",Bx),description:le("description"),ellipse:Gs("ellipse",kx),ellipsoid:Gs("ellipsoid",Vx),label:Gs("label",Ud),model:Gs("model",zp),tileset:Gs("tileset",zx),orientation:le("orientation"),path:Gs("path",Hp),plane:Gs("plane",A1),point:Gs("point",Hx),polygon:Gs("polygon",zd),polyline:Gs("polyline",uc),polylineVolume:Gs("polylineVolume",Gx),properties:Gs("properties",Xc),position:lFe("position"),rectangle:Gs("rectangle",Hd),viewFrom:le("viewFrom"),wall:Gs("wall",Gp)});Df.registerEntityType=function(e,t){Object.defineProperties(Df.prototype,{[e]:Gs(e,t)}),D9.includes(e)||D9.push(e)};Df.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};Df.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Yc(e,!0))};Df.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};Df.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var _oe=new $,goe=new h,yoe=new Oe;Df.prototype.computeModelMatrix=function(e,t){let n=Y.getValueOrUndefined(this._position,e,goe);if(!l(n))return;let i=Y.getValueOrUndefined(this._orientation,e,yoe);return l(i)?t=F.fromRotationTranslation($.fromQuaternion(i,_oe),n,t):t=Ot.eastNorthUpToFixedFrame(n,void 0,t),t};Df.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=Y.getValueOrDefault(t,e,Ye.NONE),s=Y.getValueOrUndefined(this._position,e,goe);if(r===Ye.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,P.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,aFe);vf(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=Y.getValueOrUndefined(this._orientation,e,yoe);return l(c)?o=F.fromRotationTranslation($.fromQuaternion(c,_oe),s,o):o=Ot.eastNorthUpToFixedFrame(s,void 0,o),o};Df.supportsMaterialsforEntitiesOnTerrain=function(e){return Wc.supportsMaterials(e)};Df.supportsPolylinesOnTerrain=function(e){return kd.isSupported(e)};var nr=Df;var uFe=new Ut(H.WHITE),fFe=new Kn(!0),dFe=new Kn(!0),hFe=new Kn(!1),mFe=new Kn(H.BLACK),pFe=new Kn(yn.DISABLED),_Fe=new Kn(new Mt),gFe=new Kn(kn.BOTH);function Kc(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new pe,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=nr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Kc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&Y.isConstant(this._showProperty)&&Y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&Y.isConstant(this._showProperty)&&Y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Kc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};Kc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};Kc.prototype.createFillGeometryInstance=he.throwInstantiationError;Kc.prototype.createOutlineGeometryInstance=he.throwInstantiationError;Kc.prototype.isDestroyed=function(){return!1};Kc.prototype.destroy=function(){ue(this)};Kc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(He.MINIMUM_VALUE)};Kc.prototype._isOnTerrain=function(e,t){return!1};Kc.prototype._getIsClosed=function(e){return!0};Kc.prototype._isDynamic=he.throwInstantiationError;Kc.prototype._setStaticOptions=he.throwInstantiationError;Kc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(He.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(He.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(o.material,uFe),this._fillProperty=y(r,dFe),this._showProperty=y(u,fFe),this._showOutlineProperty=y(o.outline,hFe),this._outlineColorProperty=c?y(o.outlineColor,mFe):void 0,this._shadowsProperty=y(o.shadows,pFe),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,_Fe),this._classificationTypeProperty=y(o.classificationType,gFe),this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Ut);if(c&&f&&(gt(gt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let d=o.outlineWidth;this._outlineWidth=l(d)?d.getValue(He.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Kc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ii=Kc;function gA(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties(gA.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var yFe=new Z;gA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(yFe)),this._callback(e,t)};gA.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};gA.prototype.equals=function(e){return this===e||e instanceof gA&&this._callback===e._callback&&this._isConstant===e._isConstant};var Gd=gA;var xoe=new h;function yA(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new fe,this._normal=new h,this._definitionChanged=new pe,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(He.MINIMUM_VALUE,xoe);if(!l(r)||h.equals(r,h.ZERO)||!l(e.globe))return;this._position=h.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(yA.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});yA.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var xFe=new Z;yA.prototype.getValue=function(e,t){l(e)||(e=Z.now(xFe));let n=Y.getValueOrDefault(this._heightReference,e,Ye.NONE),i=Y.getValueOrDefault(this._extrudedHeightReference,e,Ye.NONE);if(n===Ye.NONE&&!rA(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,xoe);if(!l(r)||h.equals(r,h.ZERO)||!l(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,P.EPSILON10))return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return h.multiplyByScalar(s,this._terrainHeight,t)};yA.prototype.isDestroyed=function(){return!1};yA.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var Wx=yA;function bFe(e,t,n,i){if(ii.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new Gd(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Wx(this._scene,s,r)}}var Wp=bFe;var boe=h.ZERO,Toe=new h,TFe=new h,Coe=new H;function CFe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function bu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new CFe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(bu.prototype=Object.create(ii.prototype),bu.prototype.constructor=bu);Object.defineProperties(bu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});bu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Bn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Coe)),l(a)||(a=H.WHITE),s.color=Gt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,boe,Toe))),new St({id:t,geometry:Ra.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};bu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Coe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,boe,Toe))),new St({id:t,geometry:Bd.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};bu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};bu.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ii.prototype._isHidden.call(this,e,t)};bu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.dimensions.isConstant||!Y.isConstant(t.outlineWidth)};bu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(He.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Ye.NONE?on.ALL:void 0};bu.prototype._onEntityPropertyChanged=Wp;bu.DynamicGeometryUpdater=xA;function xA(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(xA.prototype=Object.create(ni.prototype),xA.prototype.constructor=xA);xA.prototype._isHidden=function(e,t,n){let i=Y.getValueOrUndefined(e.position,n,TFe),o=this._options.dimensions;return!l(i)||!l(o)||ni.prototype._isHidden.call(this,e,t,n)};xA.prototype._setOptions=function(e,t,n){let i=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),o=this._options;o.dimensions=Y.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Ye.NONE?on.ALL:void 0};var P1=bu;function jx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=y(n,zi.FIXED),this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties(jx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var AFe=new Z;jx.prototype.getValue=function(e,t){return l(e)||(e=Z.now(AFe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};jx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};jx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Vd.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};jx.prototype.equals=function(e){return this===e||e instanceof jx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var R1=jx;/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */var{entries:Ooe,setPrototypeOf:Aoe,isFrozen:EFe,getPrototypeOf:SFe,getOwnPropertyDescriptor:vFe}=Object,{freeze:$c,seal:If,create:Moe}=Object,{apply:N9,construct:F9}=typeof Reflect<"u"&&Reflect;$c||($c=function(t){return t});If||(If=function(t){return t});N9||(N9=function(t,n,i){return t.apply(n,i)});F9||(F9=function(t,n){return new t(...n)});var bU=Tu(Array.prototype.forEach),Eoe=Tu(Array.prototype.pop),O1=Tu(Array.prototype.push),CU=Tu(String.prototype.toLowerCase),P9=Tu(String.prototype.toString),Soe=Tu(String.prototype.match),M1=Tu(String.prototype.replace),wFe=Tu(String.prototype.indexOf),DFe=Tu(String.prototype.trim),Wd=Tu(Object.prototype.hasOwnProperty),Zc=Tu(RegExp.prototype.test),L1=IFe(TypeError);function Tu(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return N9(e,t,i)}}function IFe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return F9(e,n)}}function Mi(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:CU;Aoe&&Aoe(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(EFe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function PFe(e){for(let t=0;t<e.length;t++)Wd(e,t)||(e[t]=null);return e}function qx(e){let t=Moe(null);for(let[n,i]of Ooe(e))Wd(e,n)&&(Array.isArray(i)?t[n]=PFe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=qx(i):t[n]=i);return t}function N1(e,t){for(;e!==null;){let i=vFe(e,t);if(i){if(i.get)return Tu(i.get);if(typeof i.value=="function")return Tu(i.value)}e=SFe(e)}function n(){return null}return n}var voe=$c(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),R9=$c(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),O9=$c(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),RFe=$c(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M9=$c(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),OFe=$c(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),woe=$c(["#text"]),Doe=$c(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),L9=$c(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ioe=$c(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),TU=$c(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MFe=If(/\{\{[\w\W]*|[\w\W]*\}\}/gm),LFe=If(/<%[\w\W]*|[\w\W]*%>/gm),NFe=If(/\$\{[\w\W]*}/gm),FFe=If(/^data-[\-\w.\u00B7-\uFFFF]+$/),BFe=If(/^aria-[\-\w]+$/),Loe=If(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kFe=If(/^(?:\w+script|data):/i),VFe=If(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Noe=If(/^html$/i),UFe=If(/^[a-z][.\w]*(-[.\w]+)+$/i),Poe=Object.freeze({__proto__:null,ARIA_ATTR:BFe,ATTR_WHITESPACE:VFe,CUSTOM_ELEMENT:UFe,DATA_ATTR:FFe,DOCTYPE_NAME:Noe,ERB_EXPR:LFe,IS_ALLOWED_URI:Loe,IS_SCRIPT_OR_DATA:kFe,MUSTACHE_EXPR:MFe,TMPLIT_EXPR:NFe}),F1={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},zFe=function(){return typeof window>"u"?null:window},HFe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Roe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Foe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zFe(),t=cn=>Foe(cn);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==F1.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:g}=e,m=c.prototype,x=N1(m,"cloneNode"),b=N1(m,"remove"),T=N1(m,"nextSibling"),C=N1(m,"childNodes"),A=N1(m,"parentNode");if(typeof s=="function"){let cn=n.createElement("template");cn.content&&cn.content.ownerDocument&&(n=cn.content.ownerDocument)}let E,v="",{implementation:D,createNodeIterator:O,createDocumentFragment:R,getElementsByTagName:M}=n,{importNode:N}=i,_=Roe();t.isSupported=typeof Ooe=="function"&&typeof A=="function"&&D&&D.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:S,ERB_EXPR:w,TMPLIT_EXPR:I,DATA_ATTR:L,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:G}=Poe,{IS_ALLOWED_URI:k}=Poe,W=null,q=Mi({},[...voe,...R9,...O9,...M9,...woe]),J=null,j=Mi({},[...Doe,...L9,...Ioe,...TU]),K=Object.seal(Moe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Q=null,de=null,xe=!0,ce=!0,ge=!1,be=!0,De=!1,Ae=!0,ke=!1,ze=!1,tt=!1,vt=!1,pt=!1,Be=!1,qt=!0,At=!1,lt="user-content-",jn=!0,sn=!1,me={},Ce=null,mn=Mi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ft=null,ao=Mi({},["audio","video","img","source","image","track"]),Ro=null,ra=Mi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Rr="http://www.w3.org/1998/Math/MathML",As="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml",it=Le,qe=!1,Xe=null,dt=Mi({},[Rr,As,Le],P9),Ht=Mi({},["mi","mo","mn","ms","mtext"]),Tn=Mi({},["annotation-xml"]),Oo=Mi({},["title","style","font","a","script"]),Ao=null,Za=["application/xhtml+xml","text/html"],$a="text/html",Ai=null,pi=null,sa=n.createElement("form"),Zr=function(Ee){return Ee instanceof RegExp||Ee instanceof Function},Al=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(pi&&pi===Ee)){if((!Ee||typeof Ee!="object")&&(Ee={}),Ee=qx(Ee),Ao=Za.indexOf(Ee.PARSER_MEDIA_TYPE)===-1?$a:Ee.PARSER_MEDIA_TYPE,Ai=Ao==="application/xhtml+xml"?P9:CU,W=Wd(Ee,"ALLOWED_TAGS")?Mi({},Ee.ALLOWED_TAGS,Ai):q,J=Wd(Ee,"ALLOWED_ATTR")?Mi({},Ee.ALLOWED_ATTR,Ai):j,Xe=Wd(Ee,"ALLOWED_NAMESPACES")?Mi({},Ee.ALLOWED_NAMESPACES,P9):dt,Ro=Wd(Ee,"ADD_URI_SAFE_ATTR")?Mi(qx(ra),Ee.ADD_URI_SAFE_ATTR,Ai):ra,ft=Wd(Ee,"ADD_DATA_URI_TAGS")?Mi(qx(ao),Ee.ADD_DATA_URI_TAGS,Ai):ao,Ce=Wd(Ee,"FORBID_CONTENTS")?Mi({},Ee.FORBID_CONTENTS,Ai):mn,Q=Wd(Ee,"FORBID_TAGS")?Mi({},Ee.FORBID_TAGS,Ai):{},de=Wd(Ee,"FORBID_ATTR")?Mi({},Ee.FORBID_ATTR,Ai):{},me=Wd(Ee,"USE_PROFILES")?Ee.USE_PROFILES:!1,xe=Ee.ALLOW_ARIA_ATTR!==!1,ce=Ee.ALLOW_DATA_ATTR!==!1,ge=Ee.ALLOW_UNKNOWN_PROTOCOLS||!1,be=Ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=Ee.SAFE_FOR_TEMPLATES||!1,Ae=Ee.SAFE_FOR_XML!==!1,ke=Ee.WHOLE_DOCUMENT||!1,vt=Ee.RETURN_DOM||!1,pt=Ee.RETURN_DOM_FRAGMENT||!1,Be=Ee.RETURN_TRUSTED_TYPE||!1,tt=Ee.FORCE_BODY||!1,qt=Ee.SANITIZE_DOM!==!1,At=Ee.SANITIZE_NAMED_PROPS||!1,jn=Ee.KEEP_CONTENT!==!1,sn=Ee.IN_PLACE||!1,k=Ee.ALLOWED_URI_REGEXP||Loe,it=Ee.NAMESPACE||Le,Ht=Ee.MATHML_TEXT_INTEGRATION_POINTS||Ht,Tn=Ee.HTML_INTEGRATION_POINTS||Tn,K=Ee.CUSTOM_ELEMENT_HANDLING||{},Ee.CUSTOM_ELEMENT_HANDLING&&Zr(Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&Zr(Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&typeof Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(ce=!1),pt&&(vt=!0),me&&(W=Mi({},woe),J=[],me.html===!0&&(Mi(W,voe),Mi(J,Doe)),me.svg===!0&&(Mi(W,R9),Mi(J,L9),Mi(J,TU)),me.svgFilters===!0&&(Mi(W,O9),Mi(J,L9),Mi(J,TU)),me.mathMl===!0&&(Mi(W,M9),Mi(J,Ioe),Mi(J,TU))),Ee.ADD_TAGS&&(W===q&&(W=qx(W)),Mi(W,Ee.ADD_TAGS,Ai)),Ee.ADD_ATTR&&(J===j&&(J=qx(J)),Mi(J,Ee.ADD_ATTR,Ai)),Ee.ADD_URI_SAFE_ATTR&&Mi(Ro,Ee.ADD_URI_SAFE_ATTR,Ai),Ee.FORBID_CONTENTS&&(Ce===mn&&(Ce=qx(Ce)),Mi(Ce,Ee.FORBID_CONTENTS,Ai)),jn&&(W["#text"]=!0),ke&&Mi(W,["html","head","body"]),W.table&&(Mi(W,["tbody"]),delete Q.tbody),Ee.TRUSTED_TYPES_POLICY){if(typeof Ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw L1('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw L1('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=Ee.TRUSTED_TYPES_POLICY,v=E.createHTML("")}else E===void 0&&(E=HFe(g,o)),E!==null&&typeof v=="string"&&(v=E.createHTML(""));$c&&$c(Ee),pi=Ee}},xo=Mi({},[...R9,...O9,...RFe]),Or=Mi({},[...M9,...OFe]),gp=function(Ee){let Pt=A(Ee);(!Pt||!Pt.tagName)&&(Pt={namespaceURI:it,tagName:"template"});let pn=CU(Ee.tagName),yr=CU(Pt.tagName);return Xe[Ee.namespaceURI]?Ee.namespaceURI===As?Pt.namespaceURI===Le?pn==="svg":Pt.namespaceURI===Rr?pn==="svg"&&(yr==="annotation-xml"||Ht[yr]):!!xo[pn]:Ee.namespaceURI===Rr?Pt.namespaceURI===Le?pn==="math":Pt.namespaceURI===As?pn==="math"&&Tn[yr]:!!Or[pn]:Ee.namespaceURI===Le?Pt.namespaceURI===As&&!Tn[yr]||Pt.namespaceURI===Rr&&!Ht[yr]?!1:!Or[pn]&&(Oo[pn]||!xo[pn]):!!(Ao==="application/xhtml+xml"&&Xe[Ee.namespaceURI]):!1},$r=function(Ee){O1(t.removed,{element:Ee});try{A(Ee).removeChild(Ee)}catch{b(Ee)}},hf=function(Ee,Pt){try{O1(t.removed,{attribute:Pt.getAttributeNode(Ee),from:Pt})}catch{O1(t.removed,{attribute:null,from:Pt})}if(Pt.removeAttribute(Ee),Ee==="is")if(vt||pt)try{$r(Pt)}catch{}else try{Pt.setAttribute(Ee,"")}catch{}},Qa=function(Ee){let Pt=null,pn=null;if(tt)Ee="<remove></remove>"+Ee;else{let wa=Soe(Ee,/^[\r\n\t ]+/);pn=wa&&wa[0]}Ao==="application/xhtml+xml"&&it===Le&&(Ee='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ee+"</body></html>");let yr=E?E.createHTML(Ee):Ee;if(it===Le)try{Pt=new p().parseFromString(yr,Ao)}catch{}if(!Pt||!Pt.documentElement){Pt=D.createDocument(it,"template",null);try{Pt.documentElement.innerHTML=qe?v:yr}catch{}}let Ja=Pt.body||Pt.documentElement;return Ee&&pn&&Ja.insertBefore(n.createTextNode(pn),Ja.childNodes[0]||null),it===Le?M.call(Pt,ke?"html":"body")[0]:ke?Pt.documentElement:Ja},Z0=function(Ee){return O.call(Ee.ownerDocument||Ee,Ee,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},aa=function(Ee){return Ee instanceof d&&(typeof Ee.nodeName!="string"||typeof Ee.textContent!="string"||typeof Ee.removeChild!="function"||!(Ee.attributes instanceof f)||typeof Ee.removeAttribute!="function"||typeof Ee.setAttribute!="function"||typeof Ee.namespaceURI!="string"||typeof Ee.insertBefore!="function"||typeof Ee.hasChildNodes!="function")},El=function(Ee){return typeof a=="function"&&Ee instanceof a};function Nc(cn,Ee,Pt){bU(cn,pn=>{pn.call(t,Ee,Pt,pi)})}let fs=function(Ee){let Pt=null;if(Nc(_.beforeSanitizeElements,Ee,null),aa(Ee))return $r(Ee),!0;let pn=Ai(Ee.nodeName);if(Nc(_.uponSanitizeElement,Ee,{tagName:pn,allowedTags:W}),Ee.hasChildNodes()&&!El(Ee.firstElementChild)&&Zc(/<[/\w]/g,Ee.innerHTML)&&Zc(/<[/\w]/g,Ee.textContent)||Ee.nodeType===F1.progressingInstruction||Ae&&Ee.nodeType===F1.comment&&Zc(/<[/\w]/g,Ee.data))return $r(Ee),!0;if(!W[pn]||Q[pn]){if(!Q[pn]&&pf(pn)&&(K.tagNameCheck instanceof RegExp&&Zc(K.tagNameCheck,pn)||K.tagNameCheck instanceof Function&&K.tagNameCheck(pn)))return!1;if(jn&&!Ce[pn]){let yr=A(Ee)||Ee.parentNode,Ja=C(Ee)||Ee.childNodes;if(Ja&&yr){let wa=Ja.length;for(let Sl=wa-1;Sl>=0;--Sl){let $h=x(Ja[Sl],!0);$h.__removalCount=(Ee.__removalCount||0)+1,yr.insertBefore($h,T(Ee))}}}return $r(Ee),!0}return Ee instanceof c&&!gp(Ee)||(pn==="noscript"||pn==="noembed"||pn==="noframes")&&Zc(/<\/no(script|embed|frames)/i,Ee.innerHTML)?($r(Ee),!0):(De&&Ee.nodeType===F1.text&&(Pt=Ee.textContent,bU([S,w,I],yr=>{Pt=M1(Pt,yr," ")}),Ee.textContent!==Pt&&(O1(t.removed,{element:Ee.cloneNode()}),Ee.textContent=Pt)),Nc(_.afterSanitizeElements,Ee,null),!1)},mf=function(Ee,Pt,pn){if(qt&&(Pt==="id"||Pt==="name")&&(pn in n||pn in sa))return!1;if(!(ce&&!de[Pt]&&Zc(L,Pt))){if(!(xe&&Zc(B,Pt))){if(!J[Pt]||de[Pt]){if(!(pf(Ee)&&(K.tagNameCheck instanceof RegExp&&Zc(K.tagNameCheck,Ee)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Ee))&&(K.attributeNameCheck instanceof RegExp&&Zc(K.attributeNameCheck,Pt)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(Pt))||Pt==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&Zc(K.tagNameCheck,pn)||K.tagNameCheck instanceof Function&&K.tagNameCheck(pn))))return!1}else if(!Ro[Pt]){if(!Zc(k,M1(pn,V,""))){if(!((Pt==="src"||Pt==="xlink:href"||Pt==="href")&&Ee!=="script"&&wFe(pn,"data:")===0&&ft[Ee])){if(!(ge&&!Zc(U,M1(pn,V,"")))){if(pn)return!1}}}}}}return!0},pf=function(Ee){return Ee!=="annotation-xml"&&Soe(Ee,G)},_f=function(Ee){Nc(_.beforeSanitizeAttributes,Ee,null);let{attributes:Pt}=Ee;if(!Pt||aa(Ee))return;let pn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0},yr=Pt.length;for(;yr--;){let Ja=Pt[yr],{name:wa,namespaceURI:Sl,value:$h}=Ja,Qv=Ai(wa),Fc=wa==="value"?$h:DFe($h);if(pn.attrName=Qv,pn.attrValue=Fc,pn.keepAttr=!0,pn.forceKeepAttr=void 0,Nc(_.uponSanitizeAttribute,Ee,pn),Fc=pn.attrValue,At&&(Qv==="id"||Qv==="name")&&(hf(wa,Ee),Fc=lt+Fc),Ae&&Zc(/((--!?|])>)|<\/(style|title)/i,Fc)){hf(wa,Ee);continue}if(pn.forceKeepAttr||(hf(wa,Ee),!pn.keepAttr))continue;if(!be&&Zc(/\/>/i,Fc)){hf(wa,Ee);continue}De&&bU([S,w,I],WQ=>{Fc=M1(Fc,WQ," ")});let GQ=Ai(Ee.nodeName);if(mf(GQ,Qv,Fc)){if(E&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Sl)switch(g.getAttributeType(GQ,Qv)){case"TrustedHTML":{Fc=E.createHTML(Fc);break}case"TrustedScriptURL":{Fc=E.createScriptURL(Fc);break}}try{Sl?Ee.setAttributeNS(Sl,wa,Fc):Ee.setAttribute(wa,Fc),aa(Ee)?$r(Ee):Eoe(t.removed)}catch{}}}Nc(_.afterSanitizeAttributes,Ee,null)},zo=function cn(Ee){let Pt=null,pn=Z0(Ee);for(Nc(_.beforeSanitizeShadowDOM,Ee,null);Pt=pn.nextNode();)Nc(_.uponSanitizeShadowNode,Pt,null),fs(Pt),_f(Pt),Pt.content instanceof r&&cn(Pt.content);Nc(_.afterSanitizeShadowDOM,Ee,null)};return t.sanitize=function(cn){let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Pt=null,pn=null,yr=null,Ja=null;if(qe=!cn,qe&&(cn="<!-->"),typeof cn!="string"&&!El(cn))if(typeof cn.toString=="function"){if(cn=cn.toString(),typeof cn!="string")throw L1("dirty is not a string, aborting")}else throw L1("toString is not a function");if(!t.isSupported)return cn;if(ze||Al(Ee),t.removed=[],typeof cn=="string"&&(sn=!1),sn){if(cn.nodeName){let $h=Ai(cn.nodeName);if(!W[$h]||Q[$h])throw L1("root node is forbidden and cannot be sanitized in-place")}}else if(cn instanceof a)Pt=Qa("<!---->"),pn=Pt.ownerDocument.importNode(cn,!0),pn.nodeType===F1.element&&pn.nodeName==="BODY"||pn.nodeName==="HTML"?Pt=pn:Pt.appendChild(pn);else{if(!vt&&!De&&!ke&&cn.indexOf("<")===-1)return E&&Be?E.createHTML(cn):cn;if(Pt=Qa(cn),!Pt)return vt?null:Be?v:""}Pt&&tt&&$r(Pt.firstChild);let wa=Z0(sn?cn:Pt);for(;yr=wa.nextNode();)fs(yr),_f(yr),yr.content instanceof r&&zo(yr.content);if(sn)return cn;if(vt){if(pt)for(Ja=R.call(Pt.ownerDocument);Pt.firstChild;)Ja.appendChild(Pt.firstChild);else Ja=Pt;return(J.shadowroot||J.shadowrootmode)&&(Ja=N.call(i,Ja,!0)),Ja}let Sl=ke?Pt.outerHTML:Pt.innerHTML;return ke&&W["!doctype"]&&Pt.ownerDocument&&Pt.ownerDocument.doctype&&Pt.ownerDocument.doctype.name&&Zc(Noe,Pt.ownerDocument.doctype.name)&&(Sl="<!DOCTYPE "+Pt.ownerDocument.doctype.name+`> +`+Sl),De&&bU([S,w,I],$h=>{Sl=M1(Sl,$h," ")}),E&&Be?E.createHTML(Sl):Sl},t.setConfig=function(){let cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Al(cn),ze=!0},t.clearConfig=function(){pi=null,ze=!1},t.isValidAttribute=function(cn,Ee,Pt){pi||Al({});let pn=Ai(cn),yr=Ai(Ee);return mf(pn,yr,Pt)},t.addHook=function(cn,Ee){typeof Ee=="function"&&O1(_[cn],Ee)},t.removeHook=function(cn){return Eoe(_[cn])},t.removeHooks=function(cn){_[cn]=[]},t.removeAllHooks=function(){_=Roe()},t}var Boe=Foe();var GFe=0,B9={};function hm(e,t){let n,i=e;l(B9[i])?n=B9[i]:(n=GFe++,B9[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(hm.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=Boe.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});hm.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};hm.prototype.equals=function(e){return hm.equals(this,e)};hm.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};hm.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new hm(e.html,t)};hm.clone=function(e){if(l(e))return new hm(e.html,e.showOnScreen)};var bt=hm;function Yx(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new pe}Object.defineProperties(Yx.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});Yx.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function k9(e){e._cubeMapBuffers=void 0}Yx.prototype.update=function(e){let{context:t}=e;if(!Yx.isSupported(t))return;if(l(this._texture)){k9(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(k9(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;Il(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT);let o=et.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let f={};Object.values(Cr.FaceName).forEach(d=>{f[d]=void 0});for(let d=r;d<a;d++)n.push(f)}let c=new Zt({minificationFilter:Kt.LINEAR_MIPMAP_LINEAR}),u=new Cr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};Yx.prototype.isDestroyed=function(){return!1};Yx.prototype.destroy=function(){return k9(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var jd=Yx;function B1(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?z.clone(e.imageBasedLightingFactor):new z(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=z.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(B1.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=z.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function WFe(e,t){if(jd.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new jd(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}B1.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;z.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(WFe(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};B1.prototype.isDestroyed=function(){return!1};B1.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var Xx=B1;var U9=Zo(uu(),1);var V9,koe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzYTBjYzY2NC0yMGEyLTQxZDYtYmI2MC1hMWE4ZTBlMGNlNjciLCJpZCI6MjU5LCJpYXQiOjE3MzU4NTEwMzF9.nshpaoC5qpRD4F5diwcjwJ3tddp1OjCSXoMrv37Ales",AU={};AU.defaultAccessToken=koe;AU.defaultServer=new Se({url:"https://api.cesium.com/"});AU.getDefaultTokenCredit=function(e){if(e===koe){if(!l(V9)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;V9=new bt(t,!0)}return V9}};var qd=AU;function Qc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:jFe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new re("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Se.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new U9.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(Qc.prototype=Object.create(Se.prototype),Qc.prototype.constructor=Qc);Qc.fromAssetId=function(e,t){let n=Qc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Qc(i,n)})};Object.defineProperties(Qc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Qc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Qc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(bt.getIonCredit),i=qd.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(bt.clone(i)),n};Qc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Qc(t._ionEndpoint,t._ionEndpointResource)),e=Se.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Qc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Se.prototype.fetchImage.call(this,e)};Qc.prototype._makeRequest=function(e){return this._isExternal||new U9.default(this.url).authority()!==this._ionEndpointDomain?Se.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Se.prototype._makeRequest.call(this,e))};Qc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,qd.defaultServer),i=y(t.accessToken,qd.defaultAccessToken);n=Se.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function jFe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var Cu=Qc;function mm(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(mm.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});mm.prototype.get=function(e){return this._array[e]};mm.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};mm.prototype.peek=function(){return this._array[this._length-1]};mm.prototype.push=function(e){let t=this.length++;this._array[t]=e};mm.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};mm.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};mm.prototype.resize=function(e){this.length=e};mm.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Jc=mm;var jp={X:0,Y:1,Z:2};jp.Y_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));jp.Z_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));jp.X_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));jp.Z_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));jp.X_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));jp.Y_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));jp.fromName=function(e){return jp[e]};var No=Object.freeze(jp);function Voe(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(Voe.prototype,{metadata:{get:function(){return this._metadata}}});var Kx=Voe;function ey(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),ey.decode(e)}ey.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};ey.decodeWithFromCharCode=function(e){let t="",n=qFe(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function k1(e,t,n){return t<=e&&e<=n}function qFe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(k1(u,0,127)){s.push(u);continue}if(k1(u,194,223)){i=1,t=u&31;continue}if(k1(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(k1(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new re("String decoding failed.")}if(!k1(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?ey.decode=ey.decodeWithTextDecoder:ey.decode=ey.decodeWithFromCharCode;var Ll=ey;function YFe(e,t){return t=y(t,0),Ll(e,t,Math.min(4,e.length))}var Yd=YFe;function Pf(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Pf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var V1=Uint32Array.BYTES_PER_ELEMENT;Pf.fromTileType=async function(e,t,n,i,o,r){o=y(o,0);let s=new Uint8Array(i),a=new DataView(i);o+=V1;let c=a.getUint32(o,!0);if(c!==1)throw new re(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=V1,o+=V1;let u=a.getUint32(o,!0);o+=V1;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let d=[];d.length=u;for(let m=0;m<u;++m){let x=Yd(s,o),b=a.getUint32(o+V1*2,!0),T=r[x],C=`${f}${m}`,A=n.getDerivedResource({queryParameters:{compositeIndex:C}});if(l(T))d[m]=Promise.resolve(T(e,t,A,i,o));else throw new re(`Unknown tile content type, ${x}, inside Composite tile`);o+=b}let p=await Promise.all(d);return new Pf(e,t,n,p)};Pf.prototype.hasProperty=function(e,t){return!1};Pf.prototype.getFeature=function(e){};Pf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Pf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Pf.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};Pf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=h.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};Pf.prototype.isDestroyed=function(){return!1};Pf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var U1=Pf;function XFe(e,t,n){return JSON.parse(Ll(e,t,n))}var Fo=XFe;function fc(e){this._id=zn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,Lt.maximumTextureSize),r=Math.ceil(t/Lt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new z(o,r),i=new oe(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(fc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});fc.DEFAULT_COLOR_VALUE=H.WHITE;fc.DEFAULT_SHOW_VALUE=!0;function Uoe(e){let t=e._textureDimensions;return t.x*t.y*4}function zoe(e){if(!l(e._batchValues)){let t=Uoe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Hoe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}fc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Hoe(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=zoe(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};fc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};fc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var KFe=new Array(4);fc.prototype.setColor=function(e,t){if(H.equals(t,fc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(KFe),i=n[3],o=zoe(this),r=e*4,s=Hoe(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};fc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};fc.prototype.getColor=function(e,t){if(!l(this._batchValues))return H.clone(fc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return H.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};fc.prototype.getPickColor=function(e){return this._pickIds[e]};function Goe(e,t,n){let i=e._textureDimensions;return new It({context:t,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Zt.NEAREST})}function ZFe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=Uoe(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;r[d]=H.floatToByte(f.red),r[d+1]=H.floatToByte(f.green),r[d+2]=H.floatToByte(f.blue),r[d+3]=H.floatToByte(f.alpha)}e._pickTexture=Goe(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function $Fe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}fc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&ZFe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Goe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),$Fe(this))};fc.prototype.isDestroyed=function(){return!1};fc.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var el=fc;var QFe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},JFe={SCALAR:void 0,VEC2:z,VEC3:h,VEC4:oe,MAT2:Ri,MAT3:$,MAT4:F};function e2e(e){let t=e.componentType,n;typeof t=="string"?n=X.fromName(t):n=t;let i=QFe[e.type],o=JFe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return X.createArrayBufferView(n,r,s,i*a)}}}var Au=e2e;function qp(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,t2e(this,e.extension,e.binaryBody)}Object.defineProperties(qp.prototype,{byteLength:{get:function(){return this._byteLength}}});function t2e(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=y(c.componentType,X.UNSIGNED_SHORT),c.type=tn.SCALAR,r=Au(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=y(u.componentType,X.UNSIGNED_SHORT),u.type=tn.SCALAR,r=Au(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=y(f.componentType,X.UNSIGNED_SHORT),f.type=tn.SCALAR,r=Au(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let T=a[i].length,C=a[i].instances,A=n2e(T,C,n);p+=i2e(A),a[i].instances=xt(A,C)}let x=new Array(m).fill(0),b=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],b[i]=x[o],++x[o];p+=b.byteLength,e._classes=a,e._classIds=c,e._classIndexes=b,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function n2e(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new re("componentType is required.");if(!l(c))throw new re("type is required.");if(!l(n))throw new re(`Property ${o} requires a batch table binary.`);let u=Au(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function i2e(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var o2e=[],r2e=[],s2e=0;function a2e(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=o2e;c.length=Math.max(c.length,a);let u=++s2e,f=r2e;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=o[t],g=s[t];for(let m=0;m<p;++m){let x=r[g+m];x!==t&&f.push(x)}}}function c2e(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(l(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function z1(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return a2e(e,t,n)}else return n(e,t);return c2e(e,t,n)}qp.prototype.hasProperty=function(e,t){let n=z1(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};qp.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(l(o[e]))return!0}return!1};qp.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,z1(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};qp.prototype.getProperty=function(e,t){return z1(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(l(a))return l(a.typedArray)?l2e(a,s):Ge(a[s],!0)})};function l2e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}qp.prototype.setProperty=function(e,t,n){let i=z1(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],u=a.instances[t];if(l(u))return l(u.typedArray)?u2e(u,c,n):u[c]=Ge(n,!0),!0});return l(i)};function u2e(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}qp.prototype.isClass=function(e,t){let n=z1(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};qp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var Zx=qp;var f2e={HIGHLIGHT:0,REPLACE:1,MIX:2},Nl=Object.freeze(f2e);var z9=el.DEFAULT_COLOR_VALUE,H9=el.DEFAULT_SHOW_VALUE;function po(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=y(r,{});let s=d2e(n);this._properties=s,this._batchTableHierarchy=h2e(this,n,i);let a=joe(t,s,i);this._binaryPropertiesByteLength=m2e(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new el({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}po._deprecationWarning=ms;Object.defineProperties(po.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function d2e(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ge(e[n],!0));return t}function h2e(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(po._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=o,i=o),!!l(i))return new Zx({extension:i,binaryBody:n})}function joe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new re("componentType is required.");if(!l(c))throw new re("type is required.");if(!l(n))throw new re(`Property ${o} requires a batch table binary.`);let u=Au(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function m2e(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}po.getBinaryProperties=function(e,t,n){return joe(e,t,n)};po.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};po.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};po.prototype.getShow=function(e){return this._batchTexture.getShow(e)};po.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};po.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};po.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};po.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var p2e=new H;po.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(z9),this.setAllShow(H9);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?y(e.color.evaluateColor(o,p2e),z9):z9,s=l(e.show)?y(e.show.evaluate(o),H9):H9;this.setColor(i,r),this.setShow(i,s)}};function _2e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function g2e(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}po.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};po.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};po.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};po.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};po.prototype.hasPropertyBySemantic=function(){return!1};po.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};po.prototype.getPropertyBySemantic=function(e,t){};po.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return _2e(i,e)}let n=this._properties[t];if(l(n))return Ge(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};po.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){g2e(r,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];l(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=Ge(n,!0)};function y2e(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + return vec2(centerX + (batchId * stepX), 0.5); +} +`:`uniform vec4 tile_textureStep; +uniform vec2 tile_textureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + float stepY = tile_textureStep.z; + float centerY = tile_textureStep.w; + float xId = mod(batchId, tile_textureDimensions.x); + float yId = floor(batchId / tile_textureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}po.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=qoe(o,n,!1),s;return Lt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${r} +${y2e(i)}${s}`}};function Woe(e,t){return e=Ue.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function x2e(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function qoe(e,t,n){if(!l(t))return Woe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return Woe(e,n);let r=o[0],s=o[2];e=Ue.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) +{ + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +} +vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) +{ + vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); + vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; + return vec4(diffuse.rgb, sourceDiffuse.a); +} +`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; + tile_diffuse = tile_diffuse_final(source, tile_featureColor); + tile_main(); +`}else s==="sampler2D"&&(e=x2e(e,t),u=` tile_diffuse = tile_featureColor; + tile_main(); +`);return e=`uniform float tile_colorBlend; +vec4 tile_diffuse = vec4(1.0); +${a}${r} +${e} +void tile_color(vec4 tile_featureColor) +{ +${u}`,n&&(e+=c),e+=`} +`,e}po.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=qoe(i,t,!0),Lt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};po.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=Ue.replaceMain(e,"tile_main"),Lt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_main(); + out_FragColor = tile_featureColor; + out_FragColor.rgb *= out_FragColor.a; +}`:e+=`uniform sampler2D tile_batchTexture; +uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +void main() +{ + tile_main(); + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } + out_FragColor = featureProperties; + out_FragColor.rgb *= out_FragColor.a; +} +`,e}};function b2e(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Nl.HIGHLIGHT)return 0;if(n===Nl.REPLACE)return 1;if(n===Nl.MIX)return P.clamp(i,P.EPSILON4,1)}po.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return xt(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return b2e(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};po.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var ty={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};po.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=T2e(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===we.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=C2e(f),f.dirty=!1);let p=d.originalCommand;c!==ty.ALL_OPAQUE&&f.pass!==we.TRANSLUCENT&&(l(d.translucent)||(d.translucent=A2e(p))),c!==ty.ALL_TRANSLUCENT&&f.pass!==we.TRANSLUCENT&&(l(d.opaque)||(d.opaque=E2e(p)),a&&(r||(l(d.zback)||(d.zback=v2e(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||o._selectionDepth!==D2e(d.stencil))&&(f.renderState.depthMask?d.stencil=w2e(p,o._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==we.TRANSLUCENT?(c===ty.ALL_OPAQUE&&(n[u]=g),c===ty.ALL_TRANSLUCENT&&(n[u]=m),c===ty.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function T2e(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?ty.ALL_OPAQUE:t===e.featuresLength?ty.ALL_TRANSLUCENT:ty.OPAQUE_AND_TRANSLUCENT}function C2e(e){let t=Ze.shallowClone(e),n=t.pass===we.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function A2e(e){let t=Ze.shallowClone(e);return t.pass=we.TRANSLUCENT,t.renderState=I2e(e.renderState),t}function E2e(e){let t=Ze.shallowClone(e);return t.renderState=P2e(e.renderState),t}function S2e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function v2e(e,t){let n=Ze.shallowClone(t),i=Ge(n.renderState,!0);i.cull.enabled=!0,i.cull.face=xi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Vt.setCesium3DTileBit(),i.stencilMask=Vt.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ge(t.uniformMap);let o=new z(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=S2e(e,t.shaderProgram),n}function w2e(e,t){let n=Ze.shallowClone(e),i=Ge(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Vt.SKIP_LOD_MASK,i.stencilTest.reference=Vt.CESIUM_3D_TILE_MASK|t<<Vt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ut.REPLACE,i.stencilTest.backFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ut.REPLACE,i.stencilMask=Vt.CESIUM_3D_TILE_MASK|Vt.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function D2e(e){return(e.renderState.stencilTest.reference&Vt.SKIP_LOD_MASK)>>>Vt.SKIP_LOD_BIT_SHIFT}function I2e(e){let t=Ge(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=ln.ALPHA_BLEND,t.stencilTest=Vt.setCesium3DTileBit(),t.stencilMask=Vt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function P2e(e){let t=Ge(e,!0);return t.stencilTest=Vt.setCesium3DTileBit(),t.stencilMask=Vt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}po.prototype.update=function(e,t){this._batchTexture.update(e,t)};po.prototype.isDestroyed=function(){return!1};po.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var Yp=po;function R2e(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var pm=R2e;var bA=`in vec3 position; +in float a_batchId; + +uniform mat4 u_modifiedModelViewProjection; + +void main() +{ + gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); +} +`;function Rf(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Rf.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new H),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Rf.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Rf.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Rf.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Rf.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};Rf.prototype.getPropertyInherited=function(e){return Rf.getPropertyInherited(this._content,this._batchId,e)};Rf.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Rf.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Rf.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Rf.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ws=Rf;var G9=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},W9=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Fl=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>r.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=` +`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},O2e=new G9;Object.assign(Fl,{hooks:O2e,plugins:new W9(Fl),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Fl.max_unop_len=Fl.getMaxKeyLen(Fl.unary_ops);Fl.max_binop_len=Fl.getMaxKeyLen(Fl.binary_ops);var ny=e=>new Fl(e).parse(),M2e=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Fl).filter(e=>!M2e.includes(e)&&ny[e]===void 0).forEach(e=>{ny[e]=Fl[e]});ny.Jsep=Fl;var L2e="ConditionalExpression",N2e={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:L2e,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};ny.plugins.register(N2e);var F2e={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},ht=Object.freeze(F2e);function Xd(e,t){this._expression=e,e=K2e(e,t),e=$2e(Z2e(e)),ny.addBinaryOp("=~",0),ny.addBinaryOp("!~",0);let n;try{n=ny(e)}catch(i){throw new re(i)}this._runtimeAst=Ei(this,n)}Object.defineProperties(Xd.prototype,{expression:{get:function(){return this._expression}}});var On={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new z],cartesian3Array:[new h],cartesian4Array:[new oe],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new z),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new oe),this.cartesian4Array[this.cartesian4Index++]}};Xd.prototype.evaluate=function(e,t){On.reset();let n=this._runtimeAst.evaluate(e);return t instanceof H&&n instanceof oe?H.fromCartesian4(n,t):n instanceof z||n instanceof h||n instanceof oe?n.clone(t):n};Xd.prototype.evaluateColor=function(e,t){On.reset();let n=this._runtimeAst.evaluate(e);return H.fromCartesian4(n,t)};Xd.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} +{ + return ${o}; +} +`,o};Xd.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Xd.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var B2e=["!","-","+"],Yoe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],vU=/\${(.*?)}/g,k2e=/\\/g,V2e="@#%",U2e=/@#%/g,wU=new H,DU={abs:js(Math.abs),sqrt:js(Math.sqrt),cos:js(Math.cos),sin:js(Math.sin),tan:js(Math.tan),acos:js(Math.acos),asin:js(Math.asin),atan:js(Math.atan),radians:js(P.toRadians),degrees:js(P.toDegrees),sign:js(P.sign),floor:js(Math.floor),ceil:js(Math.ceil),round:js(Math.round),exp:js(Math.exp),exp2:js(H2e),log:js(Math.log),log2:js(G2e),fract:js(z2e),length:W2e,normalize:j2e},IU={atan2:EU(Math.atan2,!1),pow:EU(Math.pow,!1),min:EU(Math.min,!0),max:EU(Math.max,!0),distance:q2e,dot:Y2e,cross:X2e},Y9={clamp:Xoe(P.clamp,!0),mix:Xoe(P.lerp,!0)};function z2e(e){return e-Math.floor(e)}function H2e(e){return Math.pow(2,e)}function G2e(e){return P.log2(e)}function js(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof z)return z.fromElements(e(n.x),e(n.y),On.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),On.getCartesian3());if(n instanceof oe)return oe.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),On.getCartesian4());throw new re(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function EU(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof z)return z.fromElements(e(i.x,o),e(i.y,o),On.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),On.getCartesian3());if(i instanceof oe)return oe.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),On.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof z&&o instanceof z)return z.fromElements(e(i.x,o.x),e(i.y,o.y),On.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),On.getCartesian3());if(i instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),On.getCartesian4());throw new re(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Xoe(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof z&&o instanceof z)return z.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),On.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),On.getCartesian3());if(i instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),On.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof z&&o instanceof z&&r instanceof z)return z.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),On.getCartesian2());if(i instanceof h&&o instanceof h&&r instanceof h)return h.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),On.getCartesian3());if(i instanceof oe&&o instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),On.getCartesian4());throw new re(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function W2e(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof z)return z.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof oe)return oe.magnitude(t);throw new re(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function j2e(e,t){if(typeof t=="number")return 1;if(t instanceof z)return z.normalize(t,On.getCartesian2());if(t instanceof h)return h.normalize(t,On.getCartesian3());if(t instanceof oe)return oe.normalize(t,On.getCartesian4());throw new re(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function q2e(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof z&&n instanceof z)return z.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof oe&&n instanceof oe)return oe.distance(t,n);throw new re(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Y2e(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof z&&n instanceof z)return z.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof oe&&n instanceof oe)return oe.dot(t,n);throw new re(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function X2e(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,On.getCartesian3());throw new re(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Tt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,aBe(this)}function K2e(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function Z2e(e){return e.replace(k2e,V2e)}function q9(e){return e.replace(U2e,"\\")}function $2e(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new re("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function Q2e(e){let t=typeof e.value;if(e.value===null)return new Tt(ht.LITERAL_NULL,null);if(t==="boolean")return new Tt(ht.LITERAL_BOOLEAN,e.value);if(t==="number")return new Tt(ht.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Tt(ht.VARIABLE_IN_STRING,e.value):new Tt(ht.LITERAL_STRING,q9(e.value))}function J2e(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new re(`${o} is not a function.`);return i===0?o==="test"?new Tt(ht.LITERAL_BOOLEAN,!1):new Tt(ht.LITERAL_NULL,null):(s=Ei(e,c),a=Ei(e,n[0]),new Tt(ht.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Ei(e,c),new Tt(ht.FUNCTION_CALL,o,r);throw new re(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Tt(ht.LITERAL_COLOR,o);if(r=Ei(e,n[0]),l(n[1])){let c=Ei(e,n[1]);return new Tt(ht.LITERAL_COLOR,o,[r,c])}return new Tt(ht.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new re(`${o} requires three arguments.`);return r=[Ei(e,n[0]),Ei(e,n[1]),Ei(e,n[2])],new Tt(ht.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new re(`${o} requires four arguments.`);return r=[Ei(e,n[0]),Ei(e,n[1]),Ei(e,n[2]),Ei(e,n[3])],new Tt(ht.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=Ei(e,n[c]);return new Tt(ht.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Tt(ht.LITERAL_BOOLEAN,!0):new Tt(ht.LITERAL_BOOLEAN,!1):(r=Ei(e,n[0]),new Tt(ht.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new re(`${o} requires exactly one argument.`);return r=Ei(e,n[0]),new Tt(ht.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new re(`${o} does not take any argument.`);return new Tt(ht.UNARY,o)}else if(l(DU[o])){if(i!==1)throw new re(`${o} requires exactly one argument.`);return r=Ei(e,n[0]),new Tt(ht.UNARY,o,r)}else if(l(IU[o])){if(i!==2)throw new re(`${o} requires exactly two arguments.`);return s=Ei(e,n[0]),a=Ei(e,n[1]),new Tt(ht.BINARY,o,s,a)}else if(l(Y9[o])){if(i!==3)throw new re(`${o} requires exactly three arguments.`);s=Ei(e,n[0]),a=Ei(e,n[1]);let c=Ei(e,n[2]);return new Tt(ht.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Tt(ht.LITERAL_BOOLEAN,!1):(r=Ei(e,n[0]),new Tt(ht.UNARY,o,r));if(o==="Number")return i===0?new Tt(ht.LITERAL_NUMBER,0):(r=Ei(e,n[0]),new Tt(ht.UNARY,o,r));if(o==="String")return i===0?new Tt(ht.LITERAL_STRING,""):(r=Ei(e,n[0]),new Tt(ht.UNARY,o,r));if(o==="regExp")return eBe(e,t)}}throw new re(`Unexpected function call "${o}".`)}function eBe(e,t){let n=t.arguments;if(n.length===0)return new Tt(ht.LITERAL_REGEX,new RegExp);let i=Ei(e,n[0]),o;if(n.length>1){let r=Ei(e,n[1]);if(j9(i)&&j9(r)){try{o=new RegExp(q9(String(i._value)),r._value)}catch(s){throw new re(s)}return new Tt(ht.LITERAL_REGEX,o)}return new Tt(ht.REGEX,i,r)}if(j9(i)){try{o=new RegExp(q9(String(i._value)))}catch(r){throw new re(r)}return new Tt(ht.LITERAL_REGEX,o)}return new Tt(ht.REGEX,i)}function tBe(e){if(rBe(e.name)){let t=sBe(e.name);return t.substr(0,8)==="tiles3d_"?new Tt(ht.BUILTIN_VARIABLE,t):new Tt(ht.VARIABLE,t)}else{if(e.name==="NaN")return new Tt(ht.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Tt(ht.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Tt(ht.LITERAL_UNDEFINED,void 0)}throw new re(`${e.name} is not defined.`)}function nBe(e){let t=e.property.name;if(t==="PI")return new Tt(ht.LITERAL_NUMBER,Math.PI);if(t==="E")return new Tt(ht.LITERAL_NUMBER,Math.E)}function iBe(e){if(e.property.name==="POSITIVE_INFINITY")return new Tt(ht.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function oBe(e,t){if(t.object.name==="Math")return nBe(t);if(t.object.name==="Number")return iBe(t);let n,i=Ei(e,t.object);return t.computed?(n=Ei(e,t.property),new Tt(ht.MEMBER,"brackets",i,n)):(n=new Tt(ht.LITERAL_STRING,t.property.name),new Tt(ht.MEMBER,"dot",i,n))}function j9(e){return e._type>=ht.LITERAL_NULL}function rBe(e){return e.substr(0,4)==="czm_"}function sBe(e){return e.substr(4)}function Ei(e,t){let n,i,o,r;if(t.type==="Literal")n=Q2e(t);else if(t.type==="CallExpression")n=J2e(e,t);else if(t.type==="Identifier")n=tBe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ei(e,t.argument);if(B2e.indexOf(i)>-1)n=new Tt(ht.UNARY,i,s);else throw new re(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Ei(e,t.left),r=Ei(e,t.right),Yoe.indexOf(i)>-1)n=new Tt(ht.BINARY,i,o,r);else throw new re(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Ei(e,t.left),r=Ei(e,t.right),Yoe.indexOf(i)>-1&&(n=new Tt(ht.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Ei(e,t.test);o=Ei(e,t.consequent),r=Ei(e,t.alternate),n=new Tt(ht.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=oBe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ei(e,t.elements[a]);n=new Tt(ht.ARRAY,s)}else throw t.type==="Compound"?new re("Provide exactly one expression."):new re("Cannot parse expression.");return n}function aBe(e){e._type===ht.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===ht.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===ht.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(DU[e._value])&&(e.evaluate=lBe(e._value)):e._type===ht.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(IU[e._value])&&(e.evaluate=uBe(e._value)):e._type===ht.TERNARY?e.evaluate=fBe(e._value):e._type===ht.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===ht.ARRAY?e.evaluate=e._evaluateArray:e._type===ht.VARIABLE?e.evaluate=e._evaluateVariable:e._type===ht.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===ht.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===ht.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===ht.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===ht.REGEX?e.evaluate=e._evaluateRegExp:e._type===ht.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=cBe):e.evaluate=e._evaluateLiteral}function cBe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function lBe(e){let t=DU[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function uBe(e){let t=IU[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function fBe(e){let t=Y9[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function PU(e,t){if(l(e))return e.getPropertyInherited(t)}Tt.prototype._evaluateLiteral=function(){return this._value};Tt.prototype._evaluateLiteralColor=function(e){let t=wU,n=this._left;if(this._value==="color")l(n)?n.length>1?(H.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):H.fromCssColorString(n[0].evaluate(e),t):H.fromBytes(255,255,255,255,t);else if(this._value==="rgb")H.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;H.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?H.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&H.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return oe.fromColor(t,On.getCartesian4())};Tt.prototype._evaluateLiteralVector=function(e){let t=On.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof z)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof oe)t.push(c.x,c.y,c.z,c.w);else throw new re(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new re(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new re(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new re(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return z.fromArray(t,0,On.getCartesian2());if(n==="vec3")return h.fromArray(t,0,On.getCartesian3());if(n==="vec4")return oe.fromArray(t,0,On.getCartesian4())};Tt.prototype._evaluateLiteralString=function(){return this._value};Tt.prototype._evaluateVariableString=function(e){let t=this._value,n=vU.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=PU(e,o);l(r)||(r=""),t=t.replace(i,r),n=vU.exec(t)}return t};Tt.prototype._evaluateVariable=function(e){return PU(e,this._value)};function $x(e){return e._value==="feature"}Tt.prototype._evaluateMemberDot=function(e){if($x(this._left))return PU(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof z||t instanceof h||t instanceof oe){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Tt.prototype._evaluateMemberBrackets=function(e){if($x(this._left))return PU(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof z||t instanceof h||t instanceof oe){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Tt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Tt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Tt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof z)return z.negate(t,On.getCartesian2());if(t instanceof h)return h.negate(t,On.getCartesian3());if(t instanceof oe)return oe.negate(t,On.getCartesian4());if(typeof t=="number")return-t;throw new re(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Tt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof z||t instanceof h||t instanceof oe||typeof t=="number"))throw new re(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Tt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Tt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Tt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Tt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Tt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new re(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Tt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new re(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Tt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.add(t,n,On.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,On.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.add(t,n,On.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new re(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.subtract(t,n,On.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,On.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.subtract(t,n,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new re(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.multiplyComponents(t,n,On.getCartesian2());if(n instanceof z&&typeof t=="number")return z.multiplyByScalar(n,t,On.getCartesian2());if(t instanceof z&&typeof n=="number")return z.multiplyByScalar(t,n,On.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,On.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,On.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,On.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.multiplyComponents(t,n,On.getCartesian4());if(n instanceof oe&&typeof t=="number")return oe.multiplyByScalar(n,t,On.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.multiplyByScalar(t,n,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new re(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.divideComponents(t,n,On.getCartesian2());if(t instanceof z&&typeof n=="number")return z.divideByScalar(t,n,On.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,On.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,On.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.divideComponents(t,n,On.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.divideByScalar(t,n,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new re(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.fromElements(t.x%n.x,t.y%n.y,On.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,On.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new re(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof h&&t instanceof h||n instanceof oe&&t instanceof oe?t.equals(n):t===n};Tt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof h&&t instanceof h||n instanceof oe&&t instanceof oe?!t.equals(n):t!==n};Tt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new re(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Tt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Tt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Tt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Tt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Tt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Tt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Tt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Tt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Tt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new re(o)}return i};Tt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new re(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Tt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new re(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new re(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new re(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Tt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof z||t instanceof h||t instanceof oe)return String(t);throw new re(`Unexpected function call "${this._value}".`)};function Koe(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==ht.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return H.fromHsl(i,o,r,s,wU)}function Zoe(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==ht.LITERAL_NUMBER)return;let i=wU;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function iy(e){return e%1===0?e.toFixed(1):e.toString()}function dBe(e){let t=iy(e.red),n=iy(e.green),i=iy(e.blue);return`vec3(${t}, ${n}, ${i})`}function SU(e){let t=iy(e.red),n=iy(e.green),i=iy(e.blue),o=iy(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function $oe(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function Qoe(e,t){return l(t[e])?t[e]:Xd.NULL_SENTINEL}Xd.NULL_SENTINEL="czm_infinity";Tt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=$oe(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=$oe(this._value,e,t,this));let u,f,d;switch(a){case ht.VARIABLE:return $x(this)?void 0:Qoe(c,e);case ht.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(DU[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new re(`Error generating style shader: "${c}" is not supported.`);return c+o;case ht.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(IU[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case ht.TERNARY:if(l(Y9[c]))return`${c}(${o}, ${r}, ${s})`;break;case ht.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case ht.MEMBER:return $x(this._left)?Qoe(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case ht.FUNCTION_CALL:throw new re(`Error generating style shader: "${c}" is not supported.`);case ht.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new re("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case ht.REGEX:throw new re("Error generating style shader: Regular expressions are not supported.");case ht.VARIABLE_IN_STRING:throw new re("Error generating style shader: Converting a variable to a string is not supported.");case ht.LITERAL_NULL:return Xd.NULL_SENTINEL;case ht.LITERAL_BOOLEAN:return c?"true":"false";case ht.LITERAL_NUMBER:return iy(c);case ht.LITERAL_STRING:if(l(n)&&n._type===ht.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||$x(n._left)))return c;if(i=H.fromCssColorString(c,wU),l(i))return dBe(i);throw new re("Error generating style shader: String literals are not supported.");case ht.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Zoe(this),l(i)?SU(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Zoe(this),l(i)?SU(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=Koe(this),l(i)?SU(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=Koe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),SU(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case ht.LITERAL_VECTOR:f=o.length,d=`${c}(`;for(let p=0;p<f;++p)d+=o[p],p<f-1&&(d+=", ");return d+=")",d;case ht.LITERAL_REGEX:throw new re("Error generating style shader: Regular expressions are not supported.");case ht.LITERAL_UNDEFINED:return Xd.NULL_SENTINEL;case ht.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Tt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case ht.VARIABLE:$x(this)||e.push(s);break;case ht.VARIABLE_IN_STRING:for(a=vU.exec(s);a!==null;)e.push(a[1]),a=vU.exec(s);break;case ht.LITERAL_STRING:l(t)&&t._type===ht.MEMBER&&$x(t._left)&&e.push(s);break}};var Of=Xd;function Xp(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,h.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=H.clone(H.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,kn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(Xp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var hBe={position:0,a_batchId:1};function mBe(e,t){if(l(e._va))return;let n=_t.createVertexBuffer({context:t,typedArray:e._positions,usage:Fe.STATIC_DRAW}),i=_t.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Fe.STATIC_DRAW}),o=_t.createIndexBuffer({context:t,typedArray:e._indices,usage:Fe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:X.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:X.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new ti({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ti({context:t,attributes:r,indexBuffer:_t.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Fe.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function pBe(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,hBe),o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Ue.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() +{ + czm_non_pick_main(); + out_FragColor = ${o}; +} +`,e._spPick=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(bA),c=n.getFragmentShaderCallback(!1,void 0,!0)(Kg);o=n.getPickId();let u=new Ue({sources:[a]}),f=new Ue({defines:["VECTOR_TILE"],sources:[c]});e._sp=$t.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Ue({sources:[bA]}),f=new Ue({defines:["VECTOR_TILE"],sources:[Kg]}),e._spStencil=$t.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Ue.replaceMain(c,"czm_non_pick_main"),c=`${c} +void main() +{ + czm_non_pick_main(); + out_FragColor = ${o}; +} +`;let d=new Ue({sources:[a]}),p=new Ue({defines:["VECTOR_TILE"],sources:[c]});e._spPick=$t.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function Joe(e){let t=e?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ut.KEEP,zFail:ut.DECREMENT_WRAP,zPass:ut.KEEP},backFunction:t,backOperation:{fail:ut.KEEP,zFail:ut.INCREMENT_WRAP,zPass:ut.KEEP},reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},depthMask:!1}}var _Be={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND},gBe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function yBe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(Joe(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(Joe(!0)),e._rsColorPass=Ve.fromCache(_Be),e._rsPickPass=Ve.fromCache(gBe))}var Qx=new F,ere=new h;function xBe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return F.clone(i,Qx),F.multiplyByPoint(Qx,e._center,ere),F.setTranslation(Qx,ere,Qx),F.multiply(o,Qx,Qx),Qx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function X9(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=s[f],p=i[d],g=o[d],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[d]=n,n+=g}return n}function bBe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=X9(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(H.equals(f.color,a.color))u=X9(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=X9(n,s,u,i,o,f.batchIds,r),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function K9(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=s[f],p=i[d],g=o[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function TBe(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=K9(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let d=t.pop();if(H.equals(d.color,r.color))u=K9(a,c,u,n,i,d.batchIds,o),r.batchIds=r.batchIds.concat(d.batchIds),r.count=u-r.offset;else{let p=u;u=K9(a,c,u,n,i,d.batchIds,o),d.offset=p,d.count=u-p,s.push(d),r=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function CBe(e,t){return t.color.toRgba()-e.color.toRgba()}function ABe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(CBe),t.webgl2?TBe(e,n):bBe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function EBe(e,t){let n=ABe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=y(e._modelMatrix,F.IDENTITY),f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,m=o[p].count,x=i[p*2];l(x)||(x=i[p*2]=new Ze({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=g,x.count=m,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=f,x.boundingVolume=d,x.cull=!1,x.pass=we.TERRAIN_CLASSIFICATION;let b=Ze.shallowClone(x,x.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=we.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=b;let T=i[p*2+1];l(T)||(T=i[p*2+1]=new Ze({owner:e})),T.vertexArray=a,T.modelMatrix=u,T.offset=g,T.count=m,T.renderState=e._rsColorPass,T.shaderProgram=c,T.uniformMap=f,T.boundingVolume=d,T.cull=!1,T.pass=we.TERRAIN_CLASSIFICATION;let C=Ze.shallowClone(T,T.derivedCommands.tileset);C.pass=we.CESIUM_3D_TILE_CLASSIFICATION,T.derivedCommands.tileset=C}e._commandsDirty=!0}function SBe(e,t){if(e.classificationType===kn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let u=i[c]=Ze.shallowClone(n[a],i[c]);u.shaderProgram=o,u.pass=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function vBe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=y(e._modelMatrix,F.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new Ze({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=d,p.pass=we.TERRAIN_CLASSIFICATION;let g=Ze.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=we.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new Ze({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=a,m.boundingVolume=d,m.pass=we.TERRAIN_CLASSIFICATION;let x=Ze.shallowClone(m,m.derivedCommands.tileset);x.pass=we.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=x}e._pickCommandsDirty=!1}Xp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ws(e,r)}};Xp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function wBe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=H.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=H.clone(H.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var DBe=new H,IBe=H.WHITE,PBe=!0,RBe=/\$/;Xp.prototype.applyStyle=function(e,t){if(!l(e)){wBe(this,t);return}let n=e.color,i=n instanceof Of&&!RBe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,DBe):IBe,c.show=l(e.show)?e.show.evaluate(c):PBe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=H.clone(H.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Xp.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let x=c[f].offset,b=c[f].count;if(s>=x&&s<x+b)break}c.push(new pm({color:H.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let x=0;x<m;++x){let b=g[x];if(b===e)continue;let T=n[b];o[T]<s?d.push(b):p.push(b)}p.length!==0&&c.push(new pm({color:H.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function tre(e,t,n,i){let o=e.classificationType,r=o!==kn.CESIUM_3D_TILE,s=o!==kn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=we.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=we.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function OBe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=we.OPAQUE,n.push(r)}}function MBe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Me.LINES):(n=e._rsColorPass,i=Me.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}Xp.prototype.update=function(e){let t=e.context;mBe(this,t),pBe(this,t),yBe(this),xBe(this,t);let n=e.passes;n.render&&(EBe(this,t),SBe(this,e),MBe(this),this._debugWireframe?OBe(e,this._commands):tre(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(vBe(this),tre(this,e,this._pickCommands))};Xp.prototype.isDestroyed=function(){return!1};Xp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var Jx=Xp;function Eu(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=kn.BOTH}Object.defineProperties(Eu.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});Eu.packedBoxLength=F.packedLength+h.packedLength;Eu.packedCylinderLength=F.packedLength+2;Eu.packedEllipsoidLength=F.packedLength+h.packedLength;Eu.packedSphereLength=h.packedLength+1;function LBe(e){let t=new Float64Array(F.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,F.pack(e._modelMatrix,t,n),t}function NBe(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=ae.unpack(t,n),n+=ae.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=H.unpack(t,n);n+=H.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[c]=new pm({color:u,offset:f,count:d,batchIds:g})}return i}var FBe=new gi("createVectorTileGeometries",5),BBe=new H;function kBe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let x=e._batchTable;for(let b=0;b<m;++b){let T=x.getColor(b,BBe);u[b]=T.toRgba()}f=e._packedBuffer=LBe(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,o.buffer),l(r)&&d.push(r.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=FBe.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let x=new Float64Array(m.packedBuffer);NBe(e,x)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),VBe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function VBe(e){l(e._primitive)||(e._primitive=new Jx({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}Eu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Eu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Eu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Eu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Eu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=kBe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Eu.prototype.isDestroyed=function(){return!1};Eu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var Kp=Eu;function _m(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,HBe(this,i,o)}Object.defineProperties(_m.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function UBe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function zBe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(d&&p)throw new re("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=m++;if(!l(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var eb=Uint32Array.BYTES_PER_ELEMENT;function HBe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=eb;let r=o.getUint32(n,!0);if(r!==1)throw new re(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=eb;let s=o.getUint32(n,!0);if(n+=eb,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=eb,a===0)throw new re("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=eb;let u=o.getUint32(n,!0);n+=eb;let f=o.getUint32(n,!0);n+=eb;let d=Fo(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=Fo(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let x=y(d.BOXES_LENGTH,0),b=y(d.CYLINDERS_LENGTH,0),T=y(d.ELLIPSOIDS_LENGTH,0),C=y(d.SPHERES_LENGTH,0),A=x+b+T+C,E=new Yp(e,A,g,m,UBe(e));if(e._batchTable=E,A===0)return;let v=e.tile.computedTransform,D;l(d.RTC_CENTER)&&(D=h.unpack(d.RTC_CENTER),F.multiplyByPoint(v,D,D));let O=zBe(d,p);if(x>0||b>0||T>0||C>0){let R,M,N,_;if(x>0){let S=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,S,Kp.packedBoxLength*x)}if(b>0){let S=p.byteOffset+d.CYLINDERS.byteOffset;M=new Float32Array(p.buffer,S,Kp.packedCylinderLength*b)}if(T>0){let S=p.byteOffset+d.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,S,Kp.packedEllipsoidLength*T)}if(C>0){let S=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,S,Kp.packedSphereLength*C)}return e._geometries=new Kp({boxes:R,boxBatchIds:O.boxes,cylinders:M,cylinderBatchIds:O.cylinders,ellipsoids:N,ellipsoidBatchIds:O.ellipsoids,spheres:_,sphereBatchIds:O.spheres,center:D,modelMatrix:v,batchTable:E,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function nre(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}_m.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};_m.prototype.getFeature=function(e){return nre(this),this._features[e]};_m.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};_m.prototype.applyStyle=function(e){nre(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};_m.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};_m.prototype.pick=function(e,t,n){};_m.prototype.isDestroyed=function(){return!1};_m.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var H1=_m;var Z9={};Z9.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),ire(i,o,r,s);return c};Z9.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),ire(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function ire(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var TA=Z9;var tb=30,GBe=1<<tb,WBe=1<<tb+1>>>0,$9=2*tb+1,oy=4,sre=[],are=[],jBe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],ry=1,CA=2,RU=[ry,0,0,ry|CA];function ts(e){if(!zt.supportsBigInt())throw new re("S2 required BigInt support");this._cellId=e,this._level=ts.getLevel(e)}ts.fromToken=function(e){return new ts(ts.getIdFromToken(e))};ts.isValidId=function(e){return!(e<=0||e>>BigInt($9)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ts.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?ts.isValidId(ts.getIdFromToken(e)):!1};ts.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};ts.getTokenFromId=function(e){let t=Math.floor(t3e(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ts.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return tb-(t>>1)};ts.prototype.getChild=function(e){let t=ure(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ts(n)};ts.prototype.getParent=function(){let e=ure(this._cellId)<<BigInt(2);return new ts(this._cellId&~e+BigInt(1)|e)};ts.prototype.getParentAtLevel=function(e){let t=JBe(e);return new ts(this._cellId&-t|t)};ts.prototype.getCenter=function(e){e=y(e,ee.WGS84);let t=qBe(this._cellId,this._level);t=h.normalize(t,t);let n=new fe.fromCartesian(t,ee.UNIT_SPHERE);return fe.toCartesian(n,e,new h)};ts.prototype.getVertex=function(e,t){t=y(t,ee.WGS84);let n=YBe(this._cellId,this._level,e);n=h.normalize(n,n);let i=new fe.fromCartesian(n,ee.UNIT_SPHERE);return fe.toCartesian(i,t,new h)};ts.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array($9-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new ts(a)};function qBe(e,t){let n=XBe(e,t);return KBe(n[0],n[1],n[2])}function YBe(e,t,n){let i=cre(e,t),o=ZBe([i[1],i[2]],t),r=n>>1&1;return lre(i[0],o[0][r^n&1],o[1][r])}function XBe(e,t){let n=cre(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function cre(e){sre.length===0&&QBe();let t=Number(e>>BigInt($9)),n=t&ry,i=(1<<oy)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?tb-7*oy:oy))-1;n+=Number(e>>BigInt(s*2*oy+1)&BigInt(c))<<2,n=are[n];let u=s*oy;o+=n>>oy+2<<u,r+=(n>>2&i)<<u,n&=ry|CA}return[t,o,r]}function KBe(e,t,n){let i=ore(t),o=ore(n),r=OU(i),s=OU(o);return lre(e,r,s)}function lre(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function OU(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function ore(e){return 1/WBe*e}function ZBe(e,t){let n=[[],[]],i=$Be(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=OU(rre(r)),n[o][1]=OU(rre(s))}return n}function $Be(e){return 1<<tb-e>>>0}function rre(e){return 1/GBe*e}function sy(e,t,n,i,o,r){if(e===oy){let s=(t<<oy)+n;sre[(s<<2)+i]=(o<<2)+r,are[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=jBe[r];sy(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^RU[0]),sy(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^RU[1]),sy(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^RU[2]),sy(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^RU[3])}}function QBe(){sy(0,0,0,0,0,0),sy(0,0,0,ry,0,ry),sy(0,0,0,CA,0,CA),sy(0,0,0,ry|CA,0,ry|CA)}function ure(e){return e&~e+BigInt(1)}function JBe(e){return BigInt(1)<<BigInt(2*(tb-e))}var e3e=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function t3e(e){return e3e[(-e&e)%BigInt(67)]}var Zp=ts;function n3e(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var oi=n3e;function Q9(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new re(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=i3e(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function i3e(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(Q9.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});Q9.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var AA=Q9;function $p(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties($p.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});$p.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};$p.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};$p.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};$p.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};$p.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};$p.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};$p.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var EA=$p;var MU={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};MU.getBranchingFactor=function(e){switch(e){case MU.OCTREE:return 8;case MU.QUADTREE:return 4}};var ns=Object.freeze(MU);function da(){}Object.defineProperties(da.prototype,{class:{get:function(){he.throwInstantiationError()}}});da.prototype.hasProperty=function(e){he.throwInstantiationError()};da.prototype.hasPropertyBySemantic=function(e){he.throwInstantiationError()};da.prototype.getPropertyIds=function(e){he.throwInstantiationError()};da.prototype.getProperty=function(e){he.throwInstantiationError()};da.prototype.setProperty=function(e,t){he.throwInstantiationError()};da.prototype.getPropertyBySemantic=function(e){he.throwInstantiationError()};da.prototype.setPropertyBySemantic=function(e,t){he.throwInstantiationError()};da.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};da.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};da.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};da.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ge(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};da.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};da.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return da.getProperty(o.id,t,n)};da.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?da.setProperty(r.id,t,n,i):!1};var Fn=da;function Qp(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Qp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Qp.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};Qp.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};Qp.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};Qp.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};Qp.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var G1=Qp;var Nt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Nt.getMinimum=function(e){switch(e){case Nt.INT8:return-128;case Nt.UINT8:return 0;case Nt.INT16:return-32768;case Nt.UINT16:return 0;case Nt.INT32:return-2147483648;case Nt.UINT32:return 0;case Nt.INT64:return zt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Nt.UINT64:return zt.supportsBigInt()?BigInt(0):0;case Nt.FLOAT32:return-34028234663852886e22;case Nt.FLOAT64:return-Number.MAX_VALUE}};Nt.getMaximum=function(e){switch(e){case Nt.INT8:return 127;case Nt.UINT8:return 255;case Nt.INT16:return 32767;case Nt.UINT16:return 65535;case Nt.INT32:return 2147483647;case Nt.UINT32:return 4294967295;case Nt.INT64:return zt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Nt.UINT64:return zt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Nt.FLOAT32:return 34028234663852886e22;case Nt.FLOAT64:return Number.MAX_VALUE}};Nt.isIntegerType=function(e){switch(e){case Nt.INT8:case Nt.UINT8:case Nt.INT16:case Nt.UINT16:case Nt.INT32:case Nt.UINT32:case Nt.INT64:case Nt.UINT64:return!0;default:return!1}};Nt.isUnsignedIntegerType=function(e){switch(e){case Nt.UINT8:case Nt.UINT16:case Nt.UINT32:case Nt.UINT64:return!0;default:return!1}};Nt.isVectorCompatible=function(e){switch(e){case Nt.INT8:case Nt.UINT8:case Nt.INT16:case Nt.UINT16:case Nt.INT32:case Nt.UINT32:case Nt.FLOAT32:case Nt.FLOAT64:return!0;default:return!1}};Nt.normalize=function(e,t){return Math.max(Number(e)/Number(Nt.getMaximum(t)),-1)};Nt.unnormalize=function(e,t){let n=Nt.getMaximum(t),i=Nt.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Nt.INT64||t===Nt.UINT64)&&zt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Nt.applyValueTransform=function(e,t,n){return n*e+t};Nt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Nt.getSizeInBytes=function(e){switch(e){case Nt.INT8:case Nt.UINT8:return 1;case Nt.INT16:case Nt.UINT16:return 2;case Nt.INT32:case Nt.UINT32:return 4;case Nt.INT64:case Nt.UINT64:return 8;case Nt.FLOAT32:return 4;case Nt.FLOAT64:return 8}};Nt.fromComponentDatatype=function(e){switch(e){case X.BYTE:return Nt.INT8;case X.UNSIGNED_BYTE:return Nt.UINT8;case X.SHORT:return Nt.INT16;case X.UNSIGNED_SHORT:return Nt.UINT16;case X.INT:return Nt.INT32;case X.UNSIGNED_INT:return Nt.UINT32;case X.FLOAT:return Nt.FLOAT32;case X.DOUBLE:return Nt.FLOAT64}};Nt.toComponentDatatype=function(e){switch(e){case Nt.INT8:return X.BYTE;case Nt.UINT8:return X.UNSIGNED_BYTE;case Nt.INT16:return X.SHORT;case Nt.UINT16:return X.UNSIGNED_SHORT;case Nt.INT32:return X.INT;case Nt.UINT32:return X.UNSIGNED_INT;case Nt.FLOAT32:return X.FLOAT;case Nt.FLOAT64:return X.DOUBLE}};var kt=Object.freeze(Nt);var Wo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Wo.isVectorType=function(e){switch(e){case Wo.VEC2:case Wo.VEC3:case Wo.VEC4:return!0;default:return!1}};Wo.isMatrixType=function(e){switch(e){case Wo.MAT2:case Wo.MAT3:case Wo.MAT4:return!0;default:return!1}};Wo.getComponentCount=function(e){switch(e){case Wo.SCALAR:case Wo.STRING:case Wo.ENUM:case Wo.BOOLEAN:return 1;case Wo.VEC2:return 2;case Wo.VEC3:return 3;case Wo.VEC4:return 4;case Wo.MAT2:return 4;case Wo.MAT3:return 9;case Wo.MAT4:return 16}};Wo.getMathType=function(e){switch(e){case Wo.VEC2:return z;case Wo.VEC3:return h;case Wo.VEC4:return oe;case Wo.MAT2:return Ri;case Wo.MAT3:return $;case Wo.MAT4:return F;default:return}};var ct=Object.freeze(Wo);function Fa(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&kt.isIntegerType(i)&&y(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=Ge(e.min,!0),this._max=Ge(e.max,!0),this._normalized=r;let s=Ge(e.offset,!0),a=Ge(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ge(e.noData,!0),this._default=Ge(e.default,!0),this._required=y(e.required,!0),this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}Fa.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=o3e(n),o=r3e(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=y(n.required,!1):r=!1,new Fa({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(Fa.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function o3e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===ct.SCALAR||ct.isMatrixType(t)||ct.isVectorType(t))return!1;if(l(kt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function r3e(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===ct.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===ct.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===ct.SCALAR||ct.isMatrixType(n)||ct.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===ct.BOOLEAN||n===ct.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===ct.BOOLEAN||i===ct.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(kt[i]))return{type:ct.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(kt[n]))return{type:ct.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}Fa.prototype.normalize=function(e){return this._normalized?J9(e,this._valueType,kt.normalize):e};Fa.prototype.unnormalize=function(e){return this._normalized?J9(e,this._valueType,kt.unnormalize):e};Fa.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Fa.valueTransformInPlace(e,this._offset,this._scale,kt.applyValueTransform)};Fa.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Fa.valueTransformInPlace(e,this._offset,this._scale,kt.unapplyValueTransform)};Fa.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,o=ct.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};Fa.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!mre(e,t))return e};function mre(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!mre(e[n],t[n]))return!1;return!0}Fa.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=ct.getMathType(this._type),i=this._isArray,o=ct.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Fa.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=ct.getMathType(this._type),i=this._isArray,o=ct.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Fa.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?s3e(this,e):pre(this,e)};function s3e(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=pre(e,t[i]);if(l(o))return o}}function pre(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return ct.isVectorType(n)?a3e(t,n,i):ct.isMatrixType(n)?c3e(t,n,i):n===ct.STRING?l3e(t):n===ct.BOOLEAN?u3e(t):n===ct.ENUM?f3e(t,o):d3e(t,i,r)}function a3e(e,t,n){if(!kt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===ct.VEC2&&!(e instanceof z))return`vector value ${e} must be a Cartesian2`;if(t===ct.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===ct.VEC4&&!(e instanceof oe))return`vector value ${e} must be a Cartesian4`}function c3e(e,t,n){if(!kt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===ct.MAT2&&!(e instanceof Ri))return`matrix value ${e} must be a Matrix2`;if(t===ct.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===ct.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function l3e(e){if(typeof e!="string")return LU(e,ct.STRING)}function u3e(e){if(typeof e!="boolean")return LU(e,ct.BOOLEAN)}function f3e(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function d3e(e,t,n){let i=typeof e;switch(t){case kt.INT8:case kt.UINT8:case kt.INT16:case kt.UINT16:case kt.INT32:case kt.UINT32:case kt.FLOAT32:case kt.FLOAT64:return i!=="number"?LU(e,t):isFinite(e)?dre(e,t,n):hre(e,t);case kt.INT64:case kt.UINT64:return i!=="number"&&i!=="bigint"?LU(e,t):i==="number"&&!isFinite(e)?hre(e,t):dre(e,t,n)}}function LU(e,t){return`value ${e} does not match type ${t}`}function fre(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function dre(e,t,n){if(n){let i=kt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?fre(e,t,n):void 0}if(e<kt.getMinimum(t)||e>kt.getMaximum(t))return fre(e,t,n)}function hre(e,t){return`value ${e} of type ${t} must be finite`}function J9(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=J9(e[i],t,n);return e}Fa.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=Fa.valueTransformInPlace(e[o],t[o],n[o],i);return e};var gm=Fa;function W1(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=r===ct.STRING,d=r===ct.BOOLEAN,p=0,g;if(a){let _=y(n.arrayOffsetType,n.offsetType);_=y(kt[_],kt.UINT32);let S=y(n.arrayOffsets,n.arrayOffsetBufferView);g=new eW(o[S],_,t+1),p+=g.typedArray.byteLength}let m=ct.getComponentCount(r),x;a?x=g.get(t)-g.get(0):s?x=t*i.arrayLength:x=t;let b=m*x,T;if(f){let _=y(n.stringOffsetType,n.offsetType);_=y(kt[_],kt.UINT32);let S=y(n.stringOffsets,n.stringOffsetBufferView);T=new eW(o[S],_,b+1),p+=T.typedArray.byteLength}(f||d)&&(c=kt.UINT8);let C;f?C=T.get(b)-T.get(0):d?C=Math.ceil(b/8):C=b;let A=y(n.values,n.bufferView),E=new eW(o[A],c,C);p+=E.typedArray.byteLength;let v=n.offset,D=n.scale,O=i.hasValueTransform||l(v)||l(D);v=y(v,i.offset),D=y(D,i.scale),v=_re(v),D=_re(D);let R,M,N=this;f?R=function(_){return p3e(_,N._values,N._stringOffsets)}:d?(R=function(_){return _3e(_,N._values)},M=function(_,S){g3e(_,N._values,S)}):l(u)?(R=function(_){let S=N._values.get(_);return u.namesByValue[S]},M=function(_,S){let w=u.valuesByName[S];N._values.set(_,w)}):(R=function(_){return N._values.get(_)},M=function(_,S){N._values.set(_,S)}),this._arrayOffsets=g,this._stringOffsets=T,this._values=E,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=D,this._hasValueTransform=O,this._getValue=R,this._setValue=M,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(W1.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});W1.prototype.get=function(e){let t=h3e(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=S3e(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};W1.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=v3e(this,t),t=n.unnormalize(t),m3e(this,e,t)};W1.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function _re(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function h3e(e,t){yre(e)&&xre(e);let n=e._classProperty,i=n.isArray,o=n.type,r=ct.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ge(s,!0):s}return!i&&r===1?e._getValue(t):gre(e,n,t)}function gre(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=ct.getComponentCount(t.type);i*=s,o*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function m3e(e,t,n){A3e(e,t,n)&&xre(e);let i=e._classProperty,o=i.isArray,r=i.type,s=ct.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Ge(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=y(i.arrayLength,1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function p3e(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Ll(t.typedArray,i,o)}function _3e(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function g3e(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function y3e(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function x3e(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function b3e(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function T3e(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function C3e(e){switch(e){case kt.INT8:return X.BYTE;case kt.UINT8:return X.UNSIGNED_BYTE;case kt.INT16:return X.SHORT;case kt.UINT16:return X.UNSIGNED_SHORT;case kt.INT32:return X.INT;case kt.UINT32:return X.UNSIGNED_INT;case kt.FLOAT32:return X.FLOAT;case kt.FLOAT64:return X.DOUBLE}}function yre(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===ct.STRING||i===kt.INT64&&!zt.supportsBigInt64Array()||i===kt.UINT64&&!zt.supportsBigUint64Array()}function A3e(e,t,n){if(yre(e))return!0;let i=e._arrayOffsets;if(l(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function xre(e){e._unpackedValues=E3e(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function E3e(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=ct.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=gre(e,i,a);return n}function S3e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:gm.valueTransformInPlace(t,e._offset,e._scale,kt.applyValueTransform)}function v3e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:gm.valueTransformInPlace(t,e._offset,e._scale,kt.unapplyValueTransform)}function eW(e,t,n){let i=this,o,r,s;if(t===kt.INT64)zt.supportsBigInt()?zt.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return x3e(a,i)}):(gt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return y3e(a,i)});else if(t===kt.UINT64)zt.supportsBigInt()?zt.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return T3e(a,i)}):(gt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return b3e(a,i)});else{let a=C3e(t);o=X.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var j1=W1;function Kd(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new j1({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(Kd.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Kd.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};Kd.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};Kd.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};Kd.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=w3e(this._class,t),i};Kd.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Kd.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};Kd.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return l(o)&&(i=o[t]),l(i)?this.setProperty(e,i.id,n):!1};Kd.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Kd.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function w3e(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let o=i.default;return i.isArray&&(o=Ge(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Bl=Kd;function ay(){}Object.defineProperties(ay.prototype,{cacheKey:{get:function(){he.throwInstantiationError()}}});ay.prototype.load=function(){he.throwInstantiationError()};ay.prototype.unload=function(){};ay.prototype.process=function(e){return!1};ay.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=` +${t.message}`);let n=new re(e);return l(t)&&(n.stack=`Original stack: +${t.stack} +Handler stack: +${n.stack}`),n};ay.prototype.isDestroyed=function(){return!1};ay.prototype.destroy=function(){return this.unload(),ue(this)};var Ki=ay;var D3e={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},mt=Object.freeze(D3e);function Jp(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=mt.UNLOADED,this._promise=void 0}l(Object.create)&&(Jp.prototype=Object.create(Ki.prototype),Jp.prototype.constructor=Jp);Object.defineProperties(Jp.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Jp.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=I3e(this),this._promise)};async function I3e(e){let t=e._resource;e._state=mt.LOADING;try{let n=await Jp._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=mt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=mt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Jp._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Jp.prototype.unload=function(){this._typedArray=void 0};var nb=Jp;var vre=Zo(Sre(),1);function ib(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,d=!1,p,g,m,x;if(oi(a,"EXT_meshopt_compression")){let T=a.extensions.EXT_meshopt_compression;c=T.buffer,u=y(T.byteOffset,0),f=T.byteLength,d=!0,p=T.byteStride,g=T.count,m=T.mode,x=y(T.filter,"NONE")}let b=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=m,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=b,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=mt.UNLOADED,this._promise=void 0}l(Object.create)&&(ib.prototype=Object.create(Ki.prototype),ib.prototype.constructor=ib);Object.defineProperties(ib.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function L3e(e){try{let t=N3e(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);vre.MeshoptDecoder.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=mt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=mt.FAILED,e.getError("Failed to load buffer view",t)}}ib.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=mt.LOADING,this._promise=L3e(this),this._promise)};function N3e(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}ib.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var SA=ib;function kr(){}kr._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);kr._decoderTaskProcessor=void 0;kr._taskProcessorReady=!1;kr._error=void 0;kr._getDecoderTaskProcessor=function(){if(!l(kr._decoderTaskProcessor)){let e=new gi("decodeDraco",kr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?kr._taskProcessorReady=!0:kr._error=new re("Draco decoder could not be initialized.")}).catch(t=>{kr._error=t}),kr._decoderTaskProcessor=e}return kr._decoderTaskProcessor};kr.decodePointCloud=function(e){let t=kr._getDecoderTaskProcessor();if(l(kr._error))throw kr._error;if(kr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};kr.decodeBufferView=function(e){let t=kr._getDecoderTaskProcessor();if(l(kr._error))throw kr._error;if(kr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var e_=kr;function cy(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=mt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(cy.prototype=Object.create(Ki.prototype),cy.prototype.constructor=cy);Object.defineProperties(cy.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function F3e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=mt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;wre(e,n)}}cy.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=mt.LOADING,this._promise=F3e(this),this._promise)};function wre(e,t){throw e.unload(),e._state=mt.FAILED,e.getError("Failed to load Draco",t)}async function B3e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=mt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}cy.prototype.process=function(e){if(this._state===mt.READY)return!0;if(this._state!==mt.PROCESSING||(l(this._dracoError)&&wre(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=e_.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=B3e(this,c)};cy.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var vA=cy;function k3e(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Se.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Se.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Se({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var ob=k3e;function t_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=mt.UNLOADED,this._promise=void 0}l(Object.create)&&(t_.prototype=Object.create(Ki.prototype),t_.prototype.constructor=t_);Object.defineProperties(t_.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});t_.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=V3e(this),this._promise):(this._promise=U3e(this),this._promise)};function Dre(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function V3e(e){e._state=mt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await H3e(i);if(e.isDestroyed())return;let r=Dre(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=mt.READY,e}catch(n){return e.isDestroyed()?void 0:Ire(e,n,"Failed to load embedded image")}}async function U3e(e){e._state=mt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await W3e(i);if(e.isDestroyed())return;let r=Dre(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=mt.READY,e}catch(o){return e.isDestroyed()?void 0:Ire(e,o,`Failed to load image: ${n}`)}}function Ire(e,t,n){return e.unload(),e._state=mt.FAILED,Promise.reject(e.getError(n,t))}function z3e(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new re("Image format is not recognized")}async function H3e(e){let t=z3e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Il(n)}return t_._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var G3e=/(^data:image\/ktx2)|(\.ktx2$)/i;function W3e(e){let t=e.getUrlComponent(!1,!0);return G3e.test(t)?Il(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}t_.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};t_._loadImageFromTypedArray=ob;var wA=t_;var j3e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Ba=Object.freeze(j3e);function ly(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=d,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=mt.UNLOADED,this._promise=void 0}l(Object.create)&&(ly.prototype=Object.create(Ki.prototype),ly.prototype.constructor=ly);Object.defineProperties(ly.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var q3e=new sW;ly.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=Y3e(this),this._promise):(this._promise=X3e(this),this._promise)};async function Y3e(e){e._state=mt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=mt.LOADED,e)}catch(n){if(e.isDestroyed())return;rW(e,n)}}async function X3e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=mt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=K3e(e,a),e._state=mt.PROCESSING,e}catch(s){if(e.isDestroyed())return;rW(e,s)}}function K3e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ne.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let d=r*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,ms("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Ne.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):s===Ne.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):s===Ne.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function rW(e,t){throw e.unload(),e._state=mt.FAILED,e.getError("Failed to load index buffer",t)}function sW(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}sW.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};sW.prototype.execute=function(){this.buffer=Pre(this.typedArray,this.indexDatatype,this.context)};function Pre(e,t,n){let i=_t.createIndexBuffer({typedArray:e,context:n,usage:Fe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}ly.prototype.process=function(e){if(this._state===mt.READY)return!0;if(this._state!==mt.LOADED&&this._state!==mt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=X.fromTypedArray(t),this._indexDatatype=n)}catch(o){rW(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=q3e;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Ba.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=Pre(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=mt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};ly.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var DA=ly;function Z3e(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var vs=Z3e;function $3e(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var ur=$3e;function jt(){}jt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};jt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(l(r))return r}}};jt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?jt.objectLegacy(i,n):jt.object(i,n)};jt.accessor=function(e,t){return jt.topLevel(e,"accessors",t)};jt.accessorWithSemantic=function(e,t,n){let i={};return jt.mesh(e,function(o){return jt.meshPrimitive(o,function(r){let s=jt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:jt.meshPrimitiveTarget(r,function(a){return jt.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};jt.accessorContainingVertexAttributeData=function(e,t){let n={};return jt.mesh(e,function(i){return jt.meshPrimitive(i,function(o){let r=jt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:jt.meshPrimitiveTarget(o,function(s){return jt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};jt.accessorContainingIndexData=function(e,t){let n={};return jt.mesh(e,function(i){return jt.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let s=t(r);if(l(s))return s}})})};jt.animation=function(e,t){return jt.topLevel(e,"animations",t)};jt.animationChannel=function(e,t){let n=e.channels;return jt.object(n,t)};jt.animationSampler=function(e,t){let n=e.samplers;return jt.object(n,t)};jt.buffer=function(e,t){return jt.topLevel(e,"buffers",t)};jt.bufferView=function(e,t){return jt.topLevel(e,"bufferViews",t)};jt.camera=function(e,t){return jt.topLevel(e,"cameras",t)};jt.image=function(e,t){return jt.topLevel(e,"images",t)};jt.material=function(e,t){return jt.topLevel(e,"materials",t)};jt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};jt.mesh=function(e,t){return jt.topLevel(e,"meshes",t)};jt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(l(s))return s}}};jt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};jt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(l(r))return r}}};jt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};jt.node=function(e,t){return jt.topLevel(e,"nodes",t)};jt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=jt.nodeInTree(e,u,n),l(c)))return c}}}};jt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return jt.nodeInTree(e,i,n)};jt.program=function(e,t){return ur(e,"KHR_techniques_webgl")?jt.object(e.extensions.KHR_techniques_webgl.programs,t):jt.topLevel(e,"programs",t)};jt.sampler=function(e,t){return jt.topLevel(e,"samplers",t)};jt.scene=function(e,t){return jt.topLevel(e,"scenes",t)};jt.shader=function(e,t){return ur(e,"KHR_techniques_webgl")?jt.object(e.extensions.KHR_techniques_webgl.shaders,t):jt.topLevel(e,"shaders",t)};jt.skin=function(e,t){return jt.topLevel(e,"skins",t)};jt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(l(s))return s}}};jt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};jt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};jt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};jt.technique=function(e,t){return ur(e,"KHR_techniques_webgl")?jt.object(e.extensions.KHR_techniques_webgl.techniques,t):jt.topLevel(e,"techniques",t)};jt.texture=function(e,t){return jt.topLevel(e,"textures",t)};var Pe=jt;function Q3e(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var Su=Q3e;function J3e(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return X.getSizeInBytes(t.componentType)*Su(t.type)}var kl=J3e;function eke(e){Pe.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Pe.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){if(i.mode=y(i.mode,te.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=vs(e.materials,o)}})}),Pe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=kl(e,i),r.target=te.ARRAY_BUFFER}}),Pe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=te.ELEMENT_ARRAY_BUFFER}}),Pe.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&Pe.materialValue(n,function(c){l(c.index)&&rb(c)}),rb(n.emissiveTexture),rb(n.normalTexture),rb(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),rb(s.baseColorTexture),rb(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),rb(a.specularGlossinessTexture))}),Pe.animation(e,function(n){Pe.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=tke(e);return Pe.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Pe.sampler(e,function(n){n.wrapS=y(n.wrapS,te.REPEAT),n.wrapT=y(n.wrapT,te.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function tke(e){let t={};return Pe.animation(e,function(n){Pe.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function rb(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var Z1=eke;function nke(e){return Pe.shader(e,function(t){VU(t)}),Pe.buffer(e,function(t){VU(t)}),Pe.image(e,function(t){VU(t)}),VU(e),e}function VU(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var uy=nke;function ike(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var $1=ike;function oke(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),$1(e,t),n.length===0&&delete e.extensionsUsed}}var sb=oke;var rke=4;function ske(e){if(Yd(e)!=="glTF")throw new re("File is not valid binary glTF");let n=Rre(e,0,5),i=n[1];if(i!==1&&i!==2)throw new re("Binary glTF version is not 1 or 2");return i===1?ake(e,n):cke(e,n)}function Rre(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*rke,!0);return o}function ake(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new re("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Ll(e,r,i),c=JSON.parse(a);uy(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=y(f.binary_glTF,f.KHR_binary_glTF);l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return sb(c,"KHR_binary_glTF"),c}function cke(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=Rre(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=Ll(u);o=JSON.parse(f),uy(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var Q1=ske;function lke(e){return Pe.shader(e,function(t){UU(t)}),Pe.buffer(e,function(t){UU(t)}),Pe.image(e,function(t){UU(t)}),UU(e),e}function UU(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var J1=lke;function uke(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),vs(n,t,!0)}var Mf=uke;function fke(e){switch(e){case X.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case X.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case X.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case X.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case X.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case X.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case X.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case X.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var n_=fke;function dke(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Su(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=kl(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,x=t.componentType,b=X.getSizeInBytes(x),T=new DataView(d.buffer),C=new Array(r),A=n_(x);for(let E=0;E<p;E++){A(T,m,r,b,C);for(let v=0;v<r;v++){let D=C[v];s[v]=Math.min(s[v],D),a[v]=Math.max(a[v],D)}m+=g}return{min:s,max:a}}var ab=dke;var hke=[te.FUNC_ADD,te.FUNC_ADD],mke=[te.ONE,te.ZERO,te.ONE,te.ZERO];function Ore(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var pke=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function _ke(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(pke.indexOf(e[n])===-1)return t;return e}function gke(e){let t={},n={},i=e.techniques;return l(i)&&(Pe.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Ore(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,hke),blendFactors:_ke(c.blendFuncSeparate,mke)})}Ore(s,te.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Mf(e,"KHR_blend")),Pe.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Pe.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var eR=gke;function yke(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),vs(n,t,!0),Mf(e,t)}var tR=yke;function xke(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Pe.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Pe.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Pe.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(o[a.program]))u.program=o[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=vs(r.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=vs(r.shaders,m,!0),u.program=vs(r.programs,p),o[a.program]=u.program}i[c]=vs(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Mf(e,"KHR_techniques_webgl"),tR(e,"KHR_techniques_webgl"))}return Pe.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Pe.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var nR=xke;function bke(e,t){bo.typeOf.object("material",e),bo.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:u}=s;if(l(c)){let f=t(c.index,c);if(l(f))return f}if(l(u)){let f=t(u.index,u);if(l(f))return f}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:u,emission:f,specular:d}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(f)&&l(f.index)){let p=t(f.index,f);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}}}let o=Pe.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var IA=bke;var Mre=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function Tke(e,t){return t=y(t,Mre),Mre.forEach(function(n){t.indexOf(n)>-1&&Ake(e,n)}),e}var Cke={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function Ake(e,t){let n=Cke[t],i=e[n];if(l(i)){let o=0,r=xm[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(ym[t](e,a-o),o++)}}function ym(){}ym.accessor=function(e,t){e.accessors.splice(t,1),Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){Pe.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Pe.meshPrimitiveTarget(o,function(a){Pe.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Pe.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Pe.animation(e,function(i){Pe.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};ym.buffer=function(e,t){e.buffers.splice(t,1),Pe.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};ym.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Pe.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Pe.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Pe.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ur(e,"KHR_draco_mesh_compression")&&Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),ur(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(ur(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};ym.image=function(e,t){e.images.splice(t,1),Pe.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};ym.mesh=function(e,t){e.meshes.splice(t,1),Pe.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};ym.node=function(e,t){e.nodes.splice(t,1),Pe.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Pe.animation(e,function(i){Pe.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Pe.technique(e,function(i){Pe.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Pe.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Pe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};ym.material=function(e,t){e.materials.splice(t,1),Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};ym.sampler=function(e,t){e.samplers.splice(t,1),Pe.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};ym.texture=function(e,t){if(e.textures.splice(t,1),Pe.material(e,function(i){IA(i,function(o,r){r.index>t&&--r.index})}),ur(e,"EXT_feature_metadata")){Pe.mesh(e,function(r){Pe.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(ur(e,"EXT_mesh_features")&&Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),ur(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function xm(){}xm.accessor=function(e){let t={};return Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){Pe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Pe.meshPrimitiveTarget(i,function(r){Pe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Pe.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Pe.animation(e,function(n){Pe.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),ur(e,"EXT_mesh_gpu_instancing")&&Pe.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),ur(e,"CESIUM_primitive_outline")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};xm.buffer=function(e){let t={};return Pe.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};xm.bufferView=function(e){let t={};if(Pe.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Pe.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Pe.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ur(e,"KHR_draco_mesh_compression")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),ur(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(ur(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};xm.image=function(e){let t={};return Pe.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};xm.mesh=function(e){let t={};return Pe.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function Lre(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!Lre(e,o,n)}).length===0}xm.node=function(e){let t={};return Pe.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Pe.skinJoint(n,function(i){t[i]=!0})}),Pe.animation(e,function(n){Pe.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Pe.technique(e,function(n){Pe.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Pe.node(e,function(n,i){Lre(e,i,t)||(t[i]=!0)}),t};xm.material=function(e){let t={};return Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};xm.texture=function(e){let t={};if(Pe.material(e,function(n){IA(n,function(i){t[i]=!0})}),ur(e,"EXT_feature_metadata")){Pe.mesh(e,function(o){Pe.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(ur(e,"EXT_mesh_features")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),ur(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};xm.sampler=function(e){let t={};return Pe.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var iR=Tke;function Eke(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:vs(e.buffers,n),byteOffset:0,byteLength:t.length};return vs(e.bufferViews,o)}var oR=Eke;function Ske(e,t){let n=kl(e,t),i=X.getSizeInBytes(t.componentType),o=Su(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(o),p=n_(t.componentType);for(let g=0;g<r;++g){p(f,u,o,i,d);for(let m=0;m<o;++m)s[g*o+m]=d[m];u+=n}return s}var rR=Ske;function vke(e){let t;return Pe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?zU(e,i,X.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&zU(e,i,X.UNSIGNED_SHORT)}),Pe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?zU(e,i,X.UNSIGNED_BYTE):t===te.SHORT&&zU(e,i,X.UNSIGNED_SHORT)}),e}function zU(e,t,n){let i=X.createTypedArray(n,rR(e,t)),o=new Uint8Array(i.buffer);t.bufferView=oR(e,o),t.componentType=n,t.byteOffset=0}var sR=vke;function wke(e,t){return sb(e,t),t==="CESIUM_RTC"&&Dke(e),aW(e,t)}function Dke(e){Pe.technique(e,function(t){Pe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function aW(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)aW(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&aW(e[o],t);return i}}var cb=wke;var HU={.8:Lke,"1.0":tVe,"2.0":void 0};function Ike(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(HU,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(HU,i)||(i="1.0"));let o=HU[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=HU[i];return t.keepLegacyExtensions||(oVe(e,t),rVe(e)),e}function Bre(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;l(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function Pke(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=y(a.primitive,te.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function Rke(e){let t=e.nodes,n=new h,i=new Oe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;h.fromArray(a,0,n),Oe.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;l(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function Oke(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new h,a=new Oe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let x=f[m];if(x.target.path==="rotation"){let b=d[p[x.sampler].output];if(l(r[b]))continue;r[b]=!0;let T=n[b],C=i[T.bufferView],E=o[C.buffer].extras._pipeline.source,v=E.byteOffset+C.byteOffset+T.byteOffset,D=T.componentType,O=T.count,R=Su(T.type),M=T.count*R,N=X.createArrayBufferView(D,E.buffer,v,M);for(let _=0;_<O;_++){let S=_*R;h.unpack(N,S,s);let w=N[S+3];Oe.fromAxisAngle(s,w,a),Oe.pack(a,N,S)}}}}}}function Mke(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function Lke(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,Bre(e),Pke(e),Rke(e),Oke(e),Mke(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Mf(e,"KHR_materials_common")}}function Nke(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function Nre(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),l(o.name)||(o.name=i)}return n}function Fke(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,l(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=Nre(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Pe.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Pe.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Pe.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Pe.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Pe.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Pe.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Pe.mesh(e,function(s){Pe.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Pe.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Pe.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=vs(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Pe.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Pe.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Pe.animation(e,function(s){let a={};s.samplers=Nre(s.samplers,a),Pe.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Pe.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Pe.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Pe.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Pe.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Pe.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Pe.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function Bke(e){Pe.animation(e,function(t){Pe.animationSampler(t,function(n){delete n.name})})}function kke(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Pe.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function Vke(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var Uke={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function zke(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(Uke[o])&&e.extensionsRequired.push(o)}}}function Hke(e){Pe.buffer(e,function(t){delete t.type})}function Gke(e){Pe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function Wke(e){Pe.mesh(e,function(t){Pe.meshPrimitive(t,function(n){Pe.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Pe.technique(e,function(t){Pe.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var jke={POSITION:!0,NORMAL:!0,TANGENT:!0},qke={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function Yke(e){let t={};Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){Pe.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let u,f=qke[a];l(f)?(u=f+c,t[r]=u):l(jke[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Pe.technique(e,function(n){Pe.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function Xke(e){Pe.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function lW(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:kl(e,t)}function Kke(e){Pe.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Pe.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=lW(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function Zke(e){let t,n,i,o=e.bufferViews,r={};Pe.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Pe.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=lW(e,p),m=p.byteOffset,x=p.count*g;delete p.byteStride;let b=t<d-1,T=b?lW(e,c[t+1]):void 0;if(g!==T){let C=Ge(i,!0);r[a]&&(C.byteStride=g),C.byteOffset+=u,C.byteLength=m+x-u;let A=vs(o,C);for(n=f;n<=t;++n)p=c[n],p.bufferView=A,p.byteOffset=p.byteOffset-u;u=b?c[t+1].byteOffset:void 0,f=t+1}}}iR(e,["accessor","bufferView","buffer"])}function $ke(e){Pe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=ab(e,n);n.min=i.min,n.max=i.max}})}function kre(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||oe.fromArray(e.rotation).equals(new oe(0,0,0,1)))&&(!l(e.matrix)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Vre(e,t){Pe.scene(e,function(n){let i=n.nodes;if(l(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Pe.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),kre(n)&&Vre(e,i))}}),delete e.nodes[t]}function Qke(e){return Pe.node(e,function(t,n){kre(t)&&Vre(e,n)}),e}function Jke(e){Pe.animation(e,function(t){Pe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=ab(e,i);i.min=o.min,i.max=o.max}})})}function eVe(e){Pe.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=ab(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function tVe(e){e.asset=y(e.asset,{}),e.asset.version="2.0",Bre(e),Nke(e),Qke(e),Fke(e),Bke(e),Vke(e),zke(e),Kke(e),Zke(e),$ke(e),Jke(e),eVe(e),Hke(e),Gke(e),Wke(e),Yke(e),sR(e),Xke(e),eR(e),nR(e),kke(e)}var nVe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],iVe=["u_diffuse","u_diffuse_mat"];function uW(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function fW(e){return l(e.index)}function dW(e){return Array.isArray(e)&&e.length===4}function Ure(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function oVe(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,nVe),i=y(t.baseColorFactorNames,iVe);Pe.material(e,function(o){Pe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&fW(r)?(uW(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&dW(r)&&(uW(o),o.pbrMetallicRoughness.baseColorFactor=Ure(r))})}),cb(e,"KHR_techniques_webgl"),cb(e,"KHR_blend")}function cW(e,t){l(t)&&(dW(t)?e.pbrMetallicRoughness.baseColorFactor=Ure(t):fW(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Fre(e,t){l(t)&&(dW(t)?e.emissiveFactor=t.slice(0,3):fW(t)&&(e.emissiveTexture=t))}function rVe(e){Pe.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=y(n.values,{}),o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;uW(t),n.technique==="CONSTANT"?(Mf(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},cW(t,s),cW(t,o)):(cW(t,r),Fre(t,o),Fre(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),cb(e,"KHR_materials_common")}var aR=Ike;var ri={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function sVe(e){switch(e){case ri.POSITION:return"positionMC";case ri.NORMAL:return"normalMC";case ri.TANGENT:return"tangentMC";case ri.TEXCOORD:return"texCoord";case ri.COLOR:return"color";case ri.JOINTS:return"joints";case ri.WEIGHTS:return"weights";case ri.FEATURE_ID:return"featureId"}}ri.hasSetIndex=function(e){switch(e){case ri.POSITION:case ri.NORMAL:case ri.TANGENT:return!1;case ri.TEXCOORD:case ri.COLOR:case ri.JOINTS:case ri.WEIGHTS:case ri.FEATURE_ID:return!0}};ri.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ri.POSITION;case"NORMAL":return ri.NORMAL;case"TANGENT":return ri.TANGENT;case"TEXCOORD":return ri.TEXCOORD;case"COLOR":return ri.COLOR;case"JOINTS":return ri.JOINTS;case"WEIGHTS":return ri.WEIGHTS;case"_FEATURE_ID":return ri.FEATURE_ID}};ri.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return ri.POSITION;case"RGBA":case"RGB":case"RGB565":return ri.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ri.NORMAL;case"BATCH_ID":return ri.FEATURE_ID}};ri.getGlslType=function(e){switch(e){case ri.POSITION:case ri.NORMAL:case ri.TANGENT:return"vec3";case ri.TEXCOORD:return"vec2";case ri.COLOR:return"vec4";case ri.JOINTS:return"ivec4";case ri.WEIGHTS:return"vec4";case ri.FEATURE_ID:return"int"}};ri.getVariableName=function(e,t){let n=sVe(e);return l(t)&&(n+=`_${t}`),n};var Ct=Object.freeze(ri);function dc(){}dc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${n.message}`);let o=new re(i);return l(n)&&(o.stack=`Original stack: +${n.stack} +Handler stack: +${o.stack}`),o};dc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Oe.IDENTITY,l(e.scale)?e.scale:h.ONE)};dc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};dc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};dc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};dc.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};dc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=Ct.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=tn.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),u;return c&&(u=r?"vec4":tn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var aVe=new h,cVe=new h;dc.getPositionMinMax=function(e,t,n){let i=dc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=h.add(r,t,cVe),o=h.add(o,n,aVe)),{min:r,max:o}};dc.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===No.Y?n=F.clone(No.Y_UP_TO_Z_UP,n):e===No.X&&(n=F.clone(No.X_UP_TO_Z_UP,n)),t===No.Z&&(n=F.multiplyTransformation(n,No.Z_UP_TO_X_UP,n)),n};var lVe=new $;dc.getCullFace=function(e,t){if(!Me.isTriangles(t))return xi.BACK;let n=F.getMatrix3(e,lVe);return $.determinant(n)<0?xi.FRONT:xi.BACK};dc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};dc.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};dc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!dc.supportedExtensions[i])throw new re(`Unsupported glTF Extension: ${i}`)}};var Xt=dc;function fy(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=mt.UNLOADED,this._promise=void 0}l(Object.create)&&(fy.prototype=Object.create(Ki.prototype),fy.prototype.constructor=fy);Object.defineProperties(fy.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});fy.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=mt.LOADING,l(this._gltfJson)?(this._promise=zre(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Hre(this,this._typedArray),this._promise):(this._promise=uVe(this),this._promise))};async function uVe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;hW(e,n)}return Hre(e,t)}function hW(e,t){e.unload(),e._state=mt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function fVe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!ur(t,"KHR_techniques_webgl")&&!ur(t,"KHR_materials_common"))return Promise.resolve();let n=[];Pe.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),aR(t)}function dVe(e){let t=[];return Pe.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Cp(i)&&(delete n.uri,t.push(Se.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function hVe(e,t){let n=[];return Pe.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function zre(e,t){try{uy(t),await dVe(t),await fVe(e,t),Z1(t),await hVe(e,t),J1(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new re(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&Xt.checkSupportedExtensions(i),e._gltf=t,e._state=mt.READY,e}catch(n){if(e.isDestroyed())return;hW(e,n)}}async function Hre(e,t){let n;try{Yd(t)==="glTF"?n=Q1(t):n=Fo(t)}catch(i){if(e.isDestroyed())return;hW(e,i)}return zre(e,n)}fy.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};fy.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var PA=fy;var mVe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},bm=Object.freeze(mVe);var So={};function pVe(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function _Ve(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function gVe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function yVe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function xVe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function bVe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function TVe(){this.attributes=[]}function CVe(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function AVe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function EVe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function SVe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function vVe(){this.nodes=[]}var wVe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function DVe(){this.input=[],this.interpolation=void 0,this.output=[]}function IVe(){this.node=void 0,this.path=void 0}function PVe(){this.sampler=void 0,this.target=void 0}function RVe(){this.name=void 0,this.samplers=[],this.channels=[]}function OVe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function MVe(){this.name=void 0,this.stages=[]}function Gre(){this.credits=[]}function LVe(){this.asset=new Gre,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=F.clone(F.IDENTITY),this.extensions={}}function NVe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0}function dy(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=oe.clone(dy.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=dy.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=dy.DEFAULT_ROUGHNESS_FACTOR}dy.DEFAULT_BASE_COLOR_FACTOR=oe.ONE;dy.DEFAULT_METALLIC_FACTOR=1;dy.DEFAULT_ROUGHNESS_FACTOR=1;function lb(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=oe.clone(lb.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(lb.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=lb.DEFAULT_GLOSSINESS_FACTOR}lb.DEFAULT_DIFFUSE_FACTOR=oe.ONE;lb.DEFAULT_SPECULAR_FACTOR=h.ONE;lb.DEFAULT_GLOSSINESS_FACTOR=1;function cR(){this.specularFactor=cR.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(cR.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}cR.DEFAULT_SPECULAR_FACTOR=1;cR.DEFAULT_SPECULAR_COLOR_FACTOR=h.ONE;function lR(){this.anisotropyStrength=lR.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=lR.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}lR.DEFAULT_ANISOTROPY_STRENGTH=0;lR.DEFAULT_ANISOTROPY_ROTATION=0;function uR(){this.clearcoatFactor=uR.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=uR.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}uR.DEFAULT_CLEARCOAT_FACTOR=0;uR.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function mW(){this.metallicRoughness=new dy,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(mW.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=bm.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}mW.DEFAULT_EMISSIVE_FACTOR=h.ZERO;So.Quantization=pVe;So.Attribute=_Ve;So.Indices=gVe;So.FeatureIdAttribute=yVe;So.FeatureIdTexture=bVe;So.FeatureIdImplicitRange=xVe;So.MorphTarget=TVe;So.Primitive=CVe;So.Instances=AVe;So.Skin=EVe;So.Node=SVe;So.Scene=vVe;So.AnimatedPropertyType=Object.freeze(wVe);So.AnimationSampler=DVe;So.AnimationTarget=IVe;So.AnimationChannel=PVe;So.Animation=RVe;So.ArticulationStage=OVe;So.Articulation=MVe;So.Asset=Gre;So.Components=LVe;So.TextureReader=NVe;So.MetallicRoughness=dy;So.SpecularGlossiness=lb;So.Specular=cR;So.Anisotropy=lR;So.Clearcoat=uR;So.Material=mW;var xn=So;var GU={};GU.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureId:n,supportedImageFormats:i}=e,o=t.textures[n],r=o.extensions;if(l(r)){if(i.webp&&l(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&l(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};GU.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=Cn.REPEAT,r=Cn.REPEAT,s=Kt.LINEAR,a=di.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];o=y(d.wrapS,o),r=y(d.wrapT,r),s=y(d.minFilter,s),a=y(d.magFilter,a)}return i&&s!==Kt.LINEAR&&s!==Kt.NEAREST&&(s===Kt.NEAREST_MIPMAP_NEAREST||s===Kt.NEAREST_MIPMAP_LINEAR?s=Kt.NEAREST:s=Kt.LINEAR),new Zt({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var FVe=new z(1,1);GU.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let{textureInfo:t,channels:n,texture:i}=e,o=y(t.texCoord,0),r,s=t.extensions?.KHR_texture_transform;if(l(s)){o=y(s.texCoord,o);let c=l(s.offset)?z.unpack(s.offset):z.ZERO,u=y(s.rotation,0),f=l(s.scale)?z.unpack(s.scale):FVe;u=-u,r=new $(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new xn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var Vl=GU;function BVe(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var hy=BVe;function my(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),u=i.index,f=Vl.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=mt.UNLOADED,this._promise=void 0}l(Object.create)&&(my.prototype=Object.create(Ki.prototype),my.prototype.constructor=my);Object.defineProperties(my.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var kVe=new pW;async function VVe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=mt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=mt.FAILED,e.getError("Failed to load texture",n)}}my.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=mt.LOADING,this._promise=VVe(this),this._promise)};function pW(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}pW.prototype.set=function(e,t,n,i,o,r){this.gltf=e,this.textureInfo=t,this.textureId=n,this.image=i,this.mipLevels=o,this.context=r};pW.prototype.execute=function(){this.texture=Wre(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function Wre(e,t,n,i,o,r){let s=i.internalFormat,a=!1;et.isCompressedFormat(s)&&!l(o)&&(a=!0);let c=Vl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===Kt.NEAREST_MIPMAP_NEAREST||u===Kt.NEAREST_MIPMAP_LINEAR||u===Kt.LINEAR_MIPMAP_NEAREST||u===Kt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,m=g||f===Cn.REPEAT||f===Cn.MIRRORED_REPEAT||d===Cn.REPEAT||d===Cn.MIRRORED_REPEAT,x=!P.isPowerOfTwo(i.width)||!P.isPowerOfTwo(i.height),b=m&&x,T;return l(s)?(!r.webgl2&&et.isCompressedFormat(s)&&x&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),T=It.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(b&&(i=hy(i)),T=It.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&T.generateMipmap(),T}my.prototype.process=function(e){if(this._state===mt.READY)return!0;if(this._state!==mt.LOADED&&this._state!==mt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=mt.PROCESSING;let t;if(this._asynchronous){let n=kVe;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Ba.TEXTURE))return;t=n.texture}else t=Wre(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=mt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};my.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var RA=my;function py(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=e.cacheKey,f=y(e.asynchronous,!0),d=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=mt.UNLOADED,this._promise=void 0}l(Object.create)&&(py.prototype=Object.create(Ki.prototype),py.prototype.constructor=py);Object.defineProperties(py.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function UVe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}py.prototype.load=async function(){return l(this._promise)?this._promise:UVe(this._draco,this._attributeSemantic)?(this._promise=HVe(this),this._promise):(this._promise=WVe(this),this._promise)};function zVe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new xn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=tn.VEC2,a.normalizationRange=r;else{let c=tn.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function HVe(e){e._state=mt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=mt.LOADED,e)}catch{if(e.isDestroyed())return;_W(e)}}function GVe(e){e._state=mt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,u=o.data.quantization;l(u)&&(e._quantization=zVe(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function WVe(e){e._state=mt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=mt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;_W(e,n)}}function _W(e,t){throw e.unload(),e._state=mt.FAILED,e.getError("Failed to load vertex buffer",t)}function gW(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}gW.prototype.set=function(e,t){this.typedArray=e,this.context=t};gW.prototype.execute=function(){this.buffer=jre(this.typedArray,this.context)};function jre(e,t){let n=_t.createVertexBuffer({typedArray:e,context:t,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var jVe=new gW;py.prototype.process=function(e){if(this._state===mt.READY)return!0;if(this._state!==mt.LOADED&&this._state!==mt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){_W(this,i)}GVe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=jVe;if(i.set(n,e.context),!e.jobScheduler.execute(i,Ba.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=jre(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=mt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};py.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var OA=py;function fR(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(e.properties,{}),i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}fR.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=gm.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new fR({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(fR.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});fR.BATCH_TABLE_CLASS_NAME="_batchTable";var Zd=fR;function WU(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}WU.fromJson=function(e){return new WU({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(WU.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var dR=WU;function jU(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=y(e.valueType,kt.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}jU.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(o){return dR.fromJson(o)});return new jU({id:t,values:i,valueType:kt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(jU.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var hR=jU;function qU(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}qU.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=hR.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Zd.fromJson({id:i,class:e.classes[i],enums:t}));return new qU({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(qU.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var vu=qU;function ub(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?vu.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=mt.UNLOADED,this._promise=void 0}l(Object.create)&&(ub.prototype=Object.create(Ki.prototype),ub.prototype.constructor=ub);Object.defineProperties(ub.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});ub.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=qVe(this),this._promise)};async function qVe(e){let t=e._resource;e._state=mt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=vu.fromJson(n),e._state=mt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=mt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}ub.prototype.unload=function(){this._schema=void 0};var MA=ub;var $d={};function LA(e){return Jh(e.url)}function YU(e){let{byteOffset:t,byteLength:n}=e;if(oi(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function YVe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function qre(e,t){return`${LA(e)}-buffer-id-${t}`}function mR(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return LA(o)}return qre(n,t)}function yW(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=mR(a,s,n,i),u=YU(r);return`${c}-range-${u}`}function Yre(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let p=i.getDerivedResource({url:s});return LA(p)}let a=e.bufferViews[r],c=a.buffer,u=e.buffers[c],f=mR(u,c,n,i),d=YU(a);return`${f}-range-${d}`}function XVe(e,t){let n=Vl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}$d.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${LA(n)}`};$d.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e;return`external-buffer:${LA(t)}`};$d.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${qre(t,n)}`};$d.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t}=e;return`gltf:${LA(t)}`};$d.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];oi(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=mR(a,s,i,o),u=YU(r);return`buffer-view:${c}-range-${u}`};$d.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${yW(t,n,i,o)}`};$d.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:c=!1,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d="";if(c&&(d+="-dequantize"),u&&(d+="-buffer",d+=`-context-${o.context.id}`),f&&(d+="-typed-array"),l(s))return`vertex-buffer:${yW(t,s,n,i)}-draco-${a}${d}`;let p=t.bufferViews[r],g=p.buffer,m=t.buffers[g],x=mR(m,g,n,i),b=YU(p);return`vertex-buffer:${x}-range-${b}${d}`};$d.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${yW(t,s,i,o)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,m=t.buffers[g],x=mR(m,g,i,o),b=YVe(f,p);return`index-buffer:${x}-accessor-${b}${u}`};$d.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${Yre(t,n,i,o)}`};$d.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=Vl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=Yre(t,c,i,o),f=XVe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var Ul=$d;function pR(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}pR.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};pR.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;l(n)&&(o+=n.sizeInBytes),l(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};pR.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};pR.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var _R=pR;function Nn(){}Nn.cacheEntries={};Nn.statistics=new _R;function KVe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new KVe(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{schema:t,resource:n}=e,i=Ul.getSchemaCacheKey({schema:t,resource:n}),o=Nn.get(i);return l(o)?o:(o=new MA({schema:t,resource:n,cacheKey:i}),Nn.add(o))};Nn.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n,typedArray:i}=e,o=Ul.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Nn.get(o);return l(r)?r:(r=new nb({typedArray:i,cacheKey:o}),Nn.add(r))};Nn.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e,n=Ul.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new nb({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=Ul.getGltfCacheKey({gltfResource:t}),s=Nn.get(r);return l(s)?s:(s=new PA({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Nn.add(s))};Nn.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=Ul.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Nn.get(r);return l(s)?s:(s=new SA({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Nn.add(s))};Nn.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e,r=Ul.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:o}),s=Nn.get(r);return l(s)?s:(s=new vA({resourceCache:Nn,gltf:t,draco:n,gltfResource:i,baseResource:o,cacheKey:r}),Nn.add(s))};Nn.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,asynchronous:u=!0,dequantize:f=!1,loadBuffer:d=!1,loadTypedArray:p=!1}=e,g=Ul.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:f,loadBuffer:d,loadTypedArray:p}),m=Nn.get(g);return l(m)?m:(m=new OA({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,cacheKey:g,asynchronous:u,dequantize:f,loadBuffer:d,loadTypedArray:p}),Nn.add(m))};Nn.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,asynchronous:a=!0,loadBuffer:c=!1,loadTypedArray:u=!1}=e,f=Ul.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:c,loadTypedArray:u}),d=Nn.get(f);return l(d)?d:(d=new DA({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,draco:s,cacheKey:f,asynchronous:a,loadBuffer:c,loadTypedArray:u}),Nn.add(d))};Nn.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=Ul.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Nn.get(r);return l(s)?s:(s=new wA({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Nn.add(s))};Nn.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=Ul.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new RA({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[OA,DA,vA,RA,wA,SA,nb,MA,PA],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var Si=Nn;function ha(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(ha.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});ha.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};ha.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};ha.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};ha.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};ha.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};ha.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};ha.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};ha.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===ns.OCTREE&&(t=3),e>>t};ha.fromSubtreeJson=async function(e,t,n,i,o){let r=new ha(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=ZVe(n);let a=s.json;r._subtreeJson=a;let c;if(oi(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let C=a.tileMetadata;c=a.propertyTables[C]}let u=[];if(l(a.contentMetadata)){let C=a.contentMetadata.length;for(let A=0;A<C;A++){let E=a.contentMetadata[A];u.push(a.propertyTables[E])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let C=p.class,A=d.classes[C];f=new G1({subtreeMetadata:p,class:A})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],oi(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,g));let m=$Ve(a.buffers),x=QVe(a.bufferViews,m);JVe(a,x),l(c)&&Xre(c,x);for(let C=0;C<u.length;C++){let A=u[C];Xre(A,x)}let b=await eUe(r,m,s.binary),T=nUe(x,b);return iUe(r,a,i,T),l(c)&&(oUe(r,i,T),sUe(r)),rUe(r,i,T),aUe(r),r._ready=!0,r};function ZVe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Fo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function $Ve(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function QVe(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function JVe(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function Xre(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=y(r.values,r.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(r.stringOffsets,r.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(r.arrayOffsets,r.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function eUe(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=tUe(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function tUe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Si.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function nUe(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function iUe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=oi(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=xW(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=xW(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=xW(t.childSubtreeAvailability,i,a)}function xW(e,t,n,i){if(l(e.constant))return new AA({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new AA({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function oUe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Bl({class:a,count:o,properties:i.properties,bufferViews:n})}function rUe(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=o[a].availableCount,d=c.class,p=r.classes[d],g=new Bl({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function Kre(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function sUe(e){let t=Kre(e._tileAvailability);e._tileJumpBuffer=t}function aUe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Kre(o);t.push(r)}}ha.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new re("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};ha.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new re("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function cUe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function lUe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}ha.prototype.getTileMetadataView=function(e){let t=cUe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new EA({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};ha.prototype.getContentMetadataView=function(e,t){let n=lUe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new EA({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};ha.prototype.isDestroyed=function(){return!1};ha.prototype.destroy=function(){return l(this._bufferLoader)&&Si.unload(this._bufferLoader),ue(this)};var fb=ha;var uUe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},db=Object.freeze(uUe);var Qd={};Qd.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:Qd.parseBoundingVolumeSemantic("TILE",e),minimumHeight:Qd._parseMinimumHeight("TILE",e),maximumHeight:Qd._parseMaximumHeight("TILE",e)},content:{boundingVolume:Qd.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:Qd._parseMinimumHeight("CONTENT",e),maximumHeight:Qd._parseMaximumHeight("CONTENT",e)}}};Qd.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};Qd._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Qd._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var hb=Qd;function tl(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(tl.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});tl.fromSubtreeJson=async function(e,t,n,i,o,r){r=y(r,0);let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,u=await fb.fromSubtreeJson(n,i,s,a,c),f=new tl(e,t,n);return f._implicitSubtree=u,fUe(f,u),f._ready=!0,f};function fUe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=hUe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=dUe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=CUe(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function dUe(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function hUe(e,t,n,i){let s=Zre(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let x=p+m;if(!t.tileIsAvailableAtIndex(x)){u.push(void 0);continue}let b=t.getParentMortonIndex(m),T=c[b],C=m%f.branchingFactor,A=Zre(e,t,T,C,x);T.children.push(A),a.numberOfTilesTotal++,u.push(A)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function $re(e,t,n){let i=db.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Zre(e,t,n,i,o,r){let s=e._implicitTileset,a;y(r,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u,f;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let D=hb.parseAllBoundingVolumeSemantics(c);u=D.tile,f=D.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let D=0;D<p;D++)if(t.contentIsAvailableAtCoordinates(a,D)){g=!0;break}let m=_Ue(s,a,i,r,n,u),x=[];for(let D=0;D<s.contentCount;D++){if(!t.contentIsAvailableAtIndex(o,D))continue;let M={uri:s.contentUriTemplates[D].getDerivedResource({templateValues:a.getTemplateValues()}).url},N=gUe(m,f);l(N)&&(M.boundingVolume=N),x.push(xt(M,s.contentHeaders[D]))}let b=$re(c,s,a),T={boundingVolume:m,geometricError:b,refine:s.refine,contents:x},C=!0,A=Ge(s.tileHeader,C);delete A.boundingVolume,delete A.transform,delete A.metadata;let E=xt(T,A,C),v=nse(e,s.baseResource,E,n);return v.implicitCoordinates=a,v.implicitSubtree=t,v.metadata=c,v.hasImplicitContentMetadata=g,v}function XU(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(oi(e,"3DTILES_bounding_volume_S2")||l(e.region))}function TW(e,t){l(t)&&(oi(e,"3DTILES_bounding_volume_S2")?pUe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&mUe(e.region,t.minimumHeight,t.maximumHeight))}function mUe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function pUe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function _Ue(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!XU(r.boundingVolume,r)&&XU(e.boundingVolume,r)?s=Qre(e,t,n,y(i,!1),o):s=r.boundingVolume,TW(s,r),s}function gUe(e,t){let n;return l(t)&&(n=t.boundingVolume),XU(n,t)?TW(n,t):XU(e,t)&&(n=Ge(e,!0),TW(n,t)),n}function Qre(e,t,n,i,o){let r=e.boundingVolume;return oi(r,"3DTILES_bounding_volume_S2")?Jre(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:tse(r.region,t.level,t.x,t.y,t.z)}:{box:ese(r.box,t.level,t.x,t.y,t.z)}}function Jre(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Zp.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?TA.encode2D(i,o,r):TA.encode2D(i,r,o),f=Zp.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Zp.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var yUe=new h,xUe=new h,bW=new h,bUe=new $;function ese(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,xUe),s=$.unpack(e,3,bUe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,yUe);l(o)&&(f=-1+(2*o+1)*a,d.z=a);let p=h.fromElements(c,u,f,bW);p=$.multiplyByVector(s,p,bW),p=h.add(p,r,bW);let g=$.clone(s);g=$.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),$.pack(g,m,3),m}var TUe=new se;function tse(e,t,n,i,o){if(t===0)return e.slice();let r=se.unpack(e,0,TUe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*r.width,f=P.negativePiToPi(r.west+n*u),d=P.negativePiToPi(f+u),p=c*r.height,g=P.negativePiToPi(r.south+i*p),m=P.negativePiToPi(g+p),x=s,b=a;if(l(o)){let T=c*(a-s);x+=o*T,b=x+T}return[f,g,d,m,x,b]}function CUe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Qre(i,o,n,!1,t),s=$re(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=nse(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function nse(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}tl.prototype.hasProperty=function(e,t){return!1};tl.prototype.getFeature=function(e){};tl.prototype.applyDebugSettings=function(e,t){};tl.prototype.applyStyle=function(e){};tl.prototype.update=function(e,t){};tl.prototype.pick=function(e,t,n){};tl.prototype.isDestroyed=function(){return!1};tl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};tl._deriveBoundingBox=ese;tl._deriveBoundingRegion=tse;tl._deriveBoundingVolumeS2=Jre;var NA=tl;var AUe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},zl=Object.freeze(AUe);function FA(e,t){this._distance=t,this._normal=new ise(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(FA.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});FA.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new FA(e.normal,e.distance),t};FA.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new FA(e.normal,e.distance)};function ise(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(ise.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var mb=FA;function hc(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.edgeColor=H.clone(y(e.edgeColor,H.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new pe,this.planeRemoved=new pe,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?cse:lse,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function cse(e){return e===Wt.OUTSIDE}function lse(e){return e===Wt.INSIDE}Object.defineProperties(hc.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?cse:lse)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function ose(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}hc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){ose(n,i)},e.index=t,ose(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};hc.prototype.get=function(e){return this._planes[e]};function use(e,t){let n=e.length;for(let i=0;i<n;++i)if(rn.equals(e[i],t))return i;return-1}hc.prototype.contains=function(e){return use(this._planes,e)!==-1};hc.prototype.remove=function(e){let t=this._planes,n=use(t,e);if(n===-1)return!1;e instanceof mb&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof mb&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};hc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof mb&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var EUe=new oe,SUe=new oe;function rse(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=Mn.octEncodeToCartesian4(a.normal,SUe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=oe.packFloat(a.distance,EUe);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function sse(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function fse(e,t){let n=Lt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var vUe=new z;hc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=hc.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=fse(o,vUe);s.y*=2,i?(t=new It({context:n,width:s.x,height:s.y,pixelFormat:et.RGBA,pixelDatatype:Ke.FLOAT,sampler:Zt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new It({context:n,width:s.x,height:s.y,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:Zt.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(sse(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(rse(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),sse(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),rse(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var wUe=new F,ase=new rn(h.UNIT_X,0);hc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=F.multiply(t,o,wUe));let r=Wt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Wt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];rn.transform(a,o,ase);let c=e.intersectPlane(ase);if(c===Wt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};hc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};hc.useFloatTexture=function(e){return e.floatingPointTexture};hc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=hc.useFloatTexture(t)?e.length:e.length*2,r=fse(o,n);return r.y*=2,r};hc.prototype.isDestroyed=function(){return!1};hc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var gs=hc;function EW(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=hse(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,u;if(i&&(r=OUe(e,t,r,n)),e.length>80*n){a=1/0,c=1/0;let f=-1/0,d=-1/0;for(let p=n;p<o;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<c&&(c=m),g>f&&(f=g),m>d&&(d=m)}u=Math.max(f-a,d-c),u=u!==0?32767/u:0}return yR(r,s,n,a,c,u,0),s}function hse(e,t,n,i,o){let r;if(o===GUe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=dse(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=dse(s/i|0,e[s],e[s+1],r);return r&&BA(r,r.next)&&(bR(r),r=r.next),r}function pb(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(BA(n,n.next)||Vr(n.prev,n,n.next)===0)){if(bR(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function yR(e,t,n,i,o,r,s){if(!e)return;!s&&r&&BUe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(r?IUe(e,i,o,r):DUe(e)){t.push(c.i,e.i,u.i),bR(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=PUe(pb(e),t),yR(e,t,n,i,o,r,2)):s===2&&RUe(e,t,n,i,o,r):yR(pb(e),t,n,i,o,r,1);break}}}function DUe(e){let t=e.prev,n=e,i=e.next;if(Vr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(o,r,s),d=Math.min(a,c,u),p=Math.max(o,r,s),g=Math.max(a,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&gR(o,a,r,c,s,u,m.x,m.y)&&Vr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function IUe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Vr(o,r,s)>=0)return!1;let a=o.x,c=r.x,u=s.x,f=o.y,d=r.y,p=s.y,g=Math.min(a,c,u),m=Math.min(f,d,p),x=Math.max(a,c,u),b=Math.max(f,d,p),T=CW(g,m,t,n,i),C=CW(x,b,t,n,i),A=e.prevZ,E=e.nextZ;for(;A&&A.z>=T&&E&&E.z<=C;){if(A.x>=g&&A.x<=x&&A.y>=m&&A.y<=b&&A!==o&&A!==s&&gR(a,f,c,d,u,p,A.x,A.y)&&Vr(A.prev,A,A.next)>=0||(A=A.prevZ,E.x>=g&&E.x<=x&&E.y>=m&&E.y<=b&&E!==o&&E!==s&&gR(a,f,c,d,u,p,E.x,E.y)&&Vr(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;A&&A.z>=T;){if(A.x>=g&&A.x<=x&&A.y>=m&&A.y<=b&&A!==o&&A!==s&&gR(a,f,c,d,u,p,A.x,A.y)&&Vr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;E&&E.z<=C;){if(E.x>=g&&E.x<=x&&E.y>=m&&E.y<=b&&E!==o&&E!==s&&gR(a,f,c,d,u,p,E.x,E.y)&&Vr(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function PUe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!BA(i,o)&&pse(i,n,n.next,o)&&xR(i,o)&&xR(o,i)&&(t.push(i.i,n.i,o.i),bR(n),bR(n.next),n=e=o),n=n.next}while(n!==e);return pb(n)}function RUe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&UUe(s,a)){let c=_se(s,a);s=pb(s,s.next),c=pb(c,c.next),yR(s,t,n,i,o,r,0),yR(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function OUe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,u=hse(e,a,c,i,!1);u===u.next&&(u.steiner=!0),o.push(VUe(u))}o.sort(MUe);for(let r=0;r<o.length;r++)n=LUe(o[r],n);return n}function MUe(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),o=(t.next.y-t.y)/(t.next.x-t.x);n=i-o}return n}function LUe(e,t){let n=NUe(e,t);if(!n)return t;let i=_se(n,e);return pb(i,i.next),pb(n,n.next)}function NUe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(BA(e,n))return n;do{if(BA(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let d=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>r&&(r=d,s=n.x<n.next.x?n:n.next,d===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&mse(o<u?i:r,o,c,u,o<u?r:i,o,n.x,n.y)){let d=Math.abs(o-n.y)/(i-n.x);xR(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&FUe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function FUe(e,t){return Vr(e.prev,e,t.prev)<0&&Vr(t.next,e,e.next)<0}function BUe(e,t,n,i){let o=e;do o.z===0&&(o.z=CW(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,kUe(o)}function kUe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function CW(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function VUe(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function mse(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function gR(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&mse(e,t,n,i,o,r,s,a)}function UUe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!zUe(e,t)&&(xR(e,t)&&xR(t,e)&&HUe(e,t)&&(Vr(e.prev,e,t.prev)||Vr(e,t.prev,t))||BA(e,t)&&Vr(e.prev,e,e.next)>0&&Vr(t.prev,t,t.next)>0)}function Vr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function BA(e,t){return e.x===t.x&&e.y===t.y}function pse(e,t,n,i){let o=ZU(Vr(e,t,n)),r=ZU(Vr(e,t,i)),s=ZU(Vr(n,i,e)),a=ZU(Vr(n,i,t));return!!(o!==r&&s!==a||o===0&&KU(e,n,t)||r===0&&KU(e,i,t)||s===0&&KU(n,e,i)||a===0&&KU(n,t,i))}function KU(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function ZU(e){return e>0?1:e<0?-1:0}function zUe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&pse(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function xR(e,t){return Vr(e.prev,e,e.next)<0?Vr(e,t,e.next)>=0&&Vr(e,e.prev,t)>=0:Vr(e,t,e.prev)<0||Vr(e,e.next,t)<0}function HUe(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function _se(e,t){let n=AW(e.i,e.x,e.y),i=AW(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function dse(e,t,n,i){let o=AW(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function bR(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function AW(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function GUe(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var WUe=new h,jUe=new h,_y={};_y.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};_y.computeWindingOrder2D=function(e){return _y.computeArea2D(e)>0?hs.COUNTER_CLOCKWISE:hs.CLOCKWISE};_y.triangulate=function(e,t){let n=z.packArray(e);return EW(n,t,2)};var bse=new h,Tse=new h,Cse=new h,gse=new h,yse=new h,xse=new h,i_=new h,Ase=new z,Ese=new z,Sse=new z,kA=new z;_y.computeSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let A=t[a];if(u[d++]=A.x,u[d++]=A.y,u[d++]=A.z,r){let E=i[a];f[p++]=E.x,f[p++]=E.y}}let g=[],m={},x=e.maximumRadius,b=P.chordLength(o,x),T=b*b;for(;s.length>0;){let A=s.pop(),E=s.pop(),v=s.pop(),D=h.fromArray(u,v*3,bse),O=h.fromArray(u,E*3,Tse),R=h.fromArray(u,A*3,Cse),M,N,_;r&&(M=z.fromArray(f,v*2,Ase),N=z.fromArray(f,E*2,Ese),_=z.fromArray(f,A*2,Sse));let S=h.multiplyByScalar(h.normalize(D,gse),x,gse),w=h.multiplyByScalar(h.normalize(O,yse),x,yse),I=h.multiplyByScalar(h.normalize(R,xse),x,xse),L=h.magnitudeSquared(h.subtract(S,w,i_)),B=h.magnitudeSquared(h.subtract(w,I,i_)),U=h.magnitudeSquared(h.subtract(I,S,i_)),V=Math.max(L,B,U),G,k,W;V>T?L===V?(G=`${Math.min(v,E)} ${Math.max(v,E)}`,a=m[G],l(a)||(k=h.add(D,O,i_),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=z.add(M,N,kA),z.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(v,a,A),s.push(a,E,A)):B===V?(G=`${Math.min(E,A)} ${Math.max(E,A)}`,a=m[G],l(a)||(k=h.add(O,R,i_),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=z.add(N,_,kA),z.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(E,a,v),s.push(a,A,v)):U===V&&(G=`${Math.min(A,v)} ${Math.max(A,v)}`,a=m[G],l(a)||(k=h.add(R,D,i_),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=z.add(_,M,kA),z.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(A,a,E),s.push(a,v,E)):(g.push(v),g.push(E),g.push(A))}let C={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(C.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new st(C)};var qUe=new fe,YUe=new fe,XUe=new fe,SW=new fe;_y.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[d++]=v.x,u[d++]=v.y,u[d++]=v.z,r){let D=i[a];f[p++]=D.x,f[p++]=D.y}}let g=[],m={},x=e.maximumRadius,b=P.chordLength(o,x),T=new La(void 0,void 0,e),C=new La(void 0,void 0,e),A=new La(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),D=s.pop(),O=s.pop(),R=h.fromArray(u,O*3,bse),M=h.fromArray(u,D*3,Tse),N=h.fromArray(u,v*3,Cse),_,S,w;r&&(_=z.fromArray(f,O*2,Ase),S=z.fromArray(f,D*2,Ese),w=z.fromArray(f,v*2,Sse));let I=e.cartesianToCartographic(R,qUe),L=e.cartesianToCartographic(M,YUe),B=e.cartesianToCartographic(N,XUe);T.setEndPoints(I,L);let U=T.surfaceDistance;C.setEndPoints(L,B);let V=C.surfaceDistance;A.setEndPoints(B,I);let G=A.surfaceDistance,k=Math.max(U,V,G),W,q,J,j,K;k>b?U===k?(W=`${Math.min(O,D)} ${Math.max(O,D)}`,a=m[W],l(a)||(q=T.interpolateUsingFraction(.5,SW),J=(I.height+L.height)*.5,j=h.fromRadians(q.longitude,q.latitude,J,e,i_),u.push(j.x,j.y,j.z),a=u.length/3-1,m[W]=a,r&&(K=z.add(_,S,kA),z.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(O,a,v),s.push(a,D,v)):V===k?(W=`${Math.min(D,v)} ${Math.max(D,v)}`,a=m[W],l(a)||(q=C.interpolateUsingFraction(.5,SW),J=(L.height+B.height)*.5,j=h.fromRadians(q.longitude,q.latitude,J,e,i_),u.push(j.x,j.y,j.z),a=u.length/3-1,m[W]=a,r&&(K=z.add(S,w,kA),z.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(D,a,O),s.push(a,v,O)):G===k&&(W=`${Math.min(v,O)} ${Math.max(v,O)}`,a=m[W],l(a)||(q=A.interpolateUsingFraction(.5,SW),J=(B.height+I.height)*.5,j=h.fromRadians(q.longitude,q.latitude,J,e,i_),u.push(j.x,j.y,j.z),a=u.length/3-1,m[W]=a,r&&(K=z.add(w,_,kA),z.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(v,a,D),s.push(a,O,D)):(g.push(O),g.push(D),g.push(v))}let E={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(E.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new st(E)};_y.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,ee.default);let o=WUe,r=jUe;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),h.multiplyByScalar(o,t,o),h.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var si=_y;function gy(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(gy.prototype,{length:{get:function(){return this._length}}});gy.prototype.enqueue=function(e){this._array.push(e),this._length++};gy.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};gy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};gy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};gy.prototype.clear=function(){this._array.length=this._offset=this._length=0};gy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var yy=gy;var ir={};ir.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};ir.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)o.push(a[u])}}return n};ir.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=ir.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var _b=new z;function Dse(e,t,n,i){return z.subtract(t,e,_b),z.multiplyByScalar(_b,n/i,_b),z.add(e,_b,_b),[_b.x,_b.y]}var xy=new h;function KUe(e,t,n,i){return h.subtract(t,e,xy),h.multiplyByScalar(xy,n/i,xy),h.add(e,xy,xy),[xy.x,xy.y,xy.z]}ir.subdivideLineCount=function(e,t,n){let o=h.distance(e,t)/n,r=Math.max(0,Math.ceil(P.log2(o)));return Math.pow(2,r)};var QU=new fe,JU=new fe,ZUe=new fe,$Ue=new h,$U=new La;ir.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,QU),r=e.cartesianToCartographic(n,JU),a=new La(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};ir.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=ir.subdivideLineCount(n,i,o),a=z.distance(e,t),c=a/s,u=r;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=Dse(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};ir.subdivideLine=function(e,t,n,i){let o=ir.subdivideLineCount(e,t,n),r=h.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let u=0;u<o;u++){let f=KUe(e,t,u*s,r);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};ir.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,QU),c=n.cartesianToCartographic(o,JU);$U.setEndPoints(a,c);let u=$U.surfaceDistance/r,f=Math.max(0,Math.ceil(P.log2(u))),d=Math.pow(2,f),p=z.distance(e,t),g=p/d,m=s;m.length=d*2;let x=0;for(let b=0;b<d;b++){let T=Dse(e,t,b*g,p);m[x++]=T[0],m[x++]=T[1]}return m};ir.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,QU),s=e.cartesianToCartographic(n,JU),a=new La(r,s,e),c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f;l(o)||(o=[]);let p=o;p.length=f*3;let g=0;for(let m=0;m<f;m++){let x=a.interpolateUsingSurfaceDistance(m*d,ZUe),b=e.cartographicToCartesian(x,$Ue);p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}return p};var QUe=new h,JUe=new h,eze=new h,tze=new h;ir.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=y(i,ee.default);let r=QUe,s=JUe,a=eze,c=tze;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(r,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,o&&(c=h.clone(a,c)),s=h.multiplyByScalar(r,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};ir.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new yy;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=Co(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let d=c.holes[r],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Co(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)o.enqueue(d.holes[s])}i.push(u)}return i};var nze=new fe;function ize(e,t,n){let i=n.cartesianToCartographic(e,QU),o=n.cartesianToCartographic(t,JU);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;$U.setEndPoints(i,o);let r=$U.findIntersectionWithLatitude(0,nze);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>P.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function oze(e,t,n,i){if(i===Qt.RHUMB)return ize(e,t,n);let o=$n.lineSegmentPlane(e,t,rn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var rze=new fe;function sze(e,t,n){let i=[],o,r,s,a,c,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],s=P.sign(o.z),a=P.sign(r.z);let f=d=>t.cartesianToCartographic(d,rze).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(c=oze(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function Ise(e,t,n,i,o,r,s){let a=[],c=r,u=d=>p=>p.position===d,f=[];do{let d=n[c];a.push(d);let p=i.findIndex(u(c)),g=i[p];if(!l(g)){++c;continue}let{visited:m,type:x,next:b}=g;if(g.visited=!0,x===0){if(b===0){let E=i[p-(s?1:-1)];if(E?.position===c+1)E.visited=!0;else{++c;continue}}if(!m&&s&&b>0||r===c&&!s&&b<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}m||f.push(c);let C=p+(s?1:-1),A=i[C];if(!l(A)){++c;continue}c=A.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let d of f)t=Ise(e,++t,n,i,0,d,!s);return t}ir.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=sze(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;o=Ise(i,o,s,a,1,0,c)}return i};ir.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new yy;c.enqueue(e);let u=l(r);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,g,m;if(i)for(m=d.length,g=0;g<m;g++)o.scaleToGeodeticSurface(d[g],d[g]);if(t||(d=Co(d,h.equalsEpsilon,!0)),d.length<3)continue;let x=n(d);if(!l(x))continue;let b=[],T=si.computeWindingOrder2D(x);if(T===hs.CLOCKWISE&&(x.reverse(),d=d.slice().reverse()),u){u=!1;let D=[d];if(D=r(D,D),D.length>1){for(let O of D)c.enqueue(new Na(O,p));continue}}let C=d.slice(),A=l(p)?p.length:0,E=[],v;for(g=0;g<A;g++){let D=p[g],O=D.positions;if(i)for(m=O.length,v=0;v<m;++v)o.scaleToGeodeticSurface(O[v],O[v]);if(t||(O=Co(O,h.equalsEpsilon,!0)),O.length<3)continue;let R=n(O);if(!l(R))continue;T=si.computeWindingOrder2D(R),T===hs.CLOCKWISE&&(R.reverse(),O=O.slice().reverse()),E.push(O),b.push(C.length),C=C.concat(O),x=x.concat(R);let M=0;for(l(D.holes)&&(M=D.holes.length),v=0;v<M;v++)c.enqueue(D.holes[v])}s.push({outerRing:d,holes:E}),a.push({positions:C,positions2D:x,holes:b})}return{hierarchy:s,polygons:a}};var aze=new z,cze=new h,lze=new Oe,uze=new $;ir.computeBoundingRectangle=function(e,t,n,i,o){let r=Oe.fromAxisAngle(e,i,lze),s=$.fromQuaternion(r,uze),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],cze);$.multiplyByVector(s,g,g);let m=t(g,aze);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=a,o.y=u,o.width=c-a,o.height=f-u,o};ir.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=si.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let d=c.length,p=new Array(d*3),g=0;for(let b=0;b<d;b++){let T=c[b];p[g++]=T.x,p[g++]=T.y,p[g++]=T.z}let m={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Me.TRIANGLES};u&&(m.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:z.packArray(f)}));let x=new st(m);return r.normal?Ln.computeNormal(x):x}if(s===Qt.GEODESIC)return si.computeSubdivision(e,c,a,f,i);if(s===Qt.RHUMB)return si.computeRhumbLineSubdivision(e,c,a,f,i)};var vse=[],wse=[],fze=new h,dze=new h;ir.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,u,f,d,p,g,m,x=e.length,b=0,T=0,C=l(t),A=C?t.positions:void 0;if(o)for(a=x*3*2,s=new Array(a*2),C&&(m=x*2*2,g=new Array(m*2)),c=0;c<x;c++)u=e[c],f=e[(c+1)%x],s[b]=s[b+a]=u.x,++b,s[b]=s[b+a]=u.y,++b,s[b]=s[b+a]=u.z,++b,s[b]=s[b+a]=f.x,++b,s[b]=s[b+a]=f.y,++b,s[b]=s[b+a]=f.z,++b,C&&(d=A[c],p=A[(c+1)%x],g[T]=g[T+m]=d.x,++T,g[T]=g[T+m]=d.y,++T,g[T]=g[T+m]=p.x,++T,g[T]=g[T+m]=p.y,++T);else{let R=P.chordLength(i,n.maximumRadius),M=0;if(r===Qt.GEODESIC)for(c=0;c<x;c++)M+=ir.subdivideLineCount(e[c],e[(c+1)%x],R);else if(r===Qt.RHUMB)for(c=0;c<x;c++)M+=ir.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],R);for(a=(M+x)*3,s=new Array(a*2),C&&(m=(M+x)*2,g=new Array(m*2)),c=0;c<x;c++){u=e[c],f=e[(c+1)%x];let N,_;C&&(d=A[c],p=A[(c+1)%x]),r===Qt.GEODESIC?(N=ir.subdivideLine(u,f,R,wse),C&&(_=ir.subdivideTexcoordLine(d,p,u,f,R,vse))):r===Qt.RHUMB&&(N=ir.subdivideRhumbLine(n,u,f,R,wse),C&&(_=ir.subdivideTexcoordRhumbLine(d,p,n,u,f,R,vse)));let S=N.length;for(let w=0;w<S;++w,++b)s[b]=N[w],s[b+a]=N[w];if(s[b]=f.x,s[b+a]=f.x,++b,s[b]=f.y,s[b+a]=f.y,++b,s[b]=f.z,s[b+a]=f.z,++b,C){let w=_.length;for(let I=0;I<w;++I,++T)g[T]=_[I],g[T+m]=_[I];g[T]=p.x,g[T+m]=p.x,++T,g[T]=p.y,g[T+m]=p.y,++T}}}x=s.length;let E=Ne.createTypedArray(x/3,x-e.length*6),v=0;for(x/=6,c=0;c<x;c++){let R=c,M=R+1,N=R+x,_=N+1;u=h.fromArray(s,R*3,fze),f=h.fromArray(s,M*3,dze),!h.equalsEpsilon(u,f,P.EPSILON10,P.EPSILON10)&&(E[v++]=R,E[v++]=N,E[v++]=M,E[v++]=M,E[v++]=N,E[v++]=_)}let D={attributes:new un({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),indices:E,primitiveType:Me.TRIANGLES};return C&&(D.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),new st(D)};var Un=ir;function Ur(e,t){this.position=e,l(this.position)||(this.position=new z),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Ur.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Ur.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=z.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(P.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=P.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=P.TWO_PI),e}}});var VA=new fe,hze=new h;Ur.prototype.getLatitude=function(e){l(e)||(e=ee.default),VA.latitude=this.conformalLatitude,VA.longitude=this.longitude,VA.height=0;let t=this.ellipsoid.cartographicToCartesian(VA,hze);return e.cartesianToCartographic(t,VA),VA.latitude};var mze=new hn,pze=new h,_ze=new h;Ur.fromCartesian=function(e,t){let n=P.signNotZero(e.z),i=Ur.NORTH_POLE_TANGENT_PLANE,o=Ur.SOUTH_POLE;n<0&&(i=Ur.SOUTH_POLE_TANGENT_PLANE,o=Ur.NORTH_POLE);let r=mze;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,pze),h.normalize(r.direction,r.direction);let s=$n.rayPlane(r,i.plane,_ze),a=h.subtract(s,o,s),c=h.dot(i.xAxis,a),u=n*h.dot(i.yAxis,a);return l(t)?(t.position=new z(c,u),t.tangentPlane=i,t):new Ur(new z(c,u),i)};Ur.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Ur.fromCartesian(e[i],t[i]);return t};Ur.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Ur(e.position,e.tangentPlane)};Ur.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));Ur.NORTH_POLE=Object.freeze(new h(0,0,.5));Ur.SOUTH_POLE=Object.freeze(new h(0,0,-.5));Ur.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Jr(Ur.NORTH_POLE,Ur.HALF_UNIT_SPHERE));Ur.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Jr(Ur.SOUTH_POLE,Ur.HALF_UNIT_SPHERE));var mc=Ur;var gze=new fe,Pse=new fe;function yze(e,t,n,i){let r=i.cartesianToCartographic(e,gze).height,s=i.cartesianToCartographic(t,Pse);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,Pse);a.height=r-100,i.cartographicToCartesian(a,n)}var Rse=new je,xze=new h,bze=new h,Tze=new h,Cze=new h,Aze=new h,Eze=new h,ez=new h,Tm=new h,UA=new h,Sze=new z,vze=new z,wze=new h,Ose=new Oe,Dze=new $,Ize=new $;function vW(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,x=e.perPositionHeight,b=Sze;b.x=f.x,b.y=f.y;let T=t.st?new Float32Array(2*(s/3)):void 0,C;t.normal&&(x&&c&&!a?C=n.attributes.normal.values:C=new Float32Array(s));let A=t.tangent?new Float32Array(s):void 0,E=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,D=0,O=0,R=bze,M=Tze,N=Cze,_=!0,S=Dze,w=Ize;if(m!==0){let B=Oe.fromAxisAngle(d,m,Ose);S=$.fromQuaternion(B,S),B=Oe.fromAxisAngle(d,-m,Ose),w=$.fromQuaternion(B,w)}else S=$.clone($.IDENTITY,S),w=$.clone($.IDENTITY,w);let I=0,L=0;c&&u&&(I=s/2,L=s/3,s/=2);for(let B=0;B<s;B+=3){let U=h.fromArray(o,B,wze);if(t.st&&!l(r)){let V=$.multiplyByVector(S,U,xze);V=g.scaleToGeodeticSurface(V,V);let G=p([V],vze)[0];z.subtract(G,b,G);let k=P.clamp(G.x/f.width,0,1),W=P.clamp(G.y/f.height,0,1);u&&(T[D+L]=k,T[D+1+L]=W),c&&(T[D]=k,T[D+1]=W),D+=2}if(t.normal||t.tangent||t.bitangent||i){let V=O+1,G=O+2;if(a){if(B+3<s){let k=h.fromArray(o,B+3,Aze);if(_){let W=h.fromArray(o,B+s,Eze);x&&yze(U,k,W,g),h.subtract(k,U,k),h.subtract(W,U,W),R=h.normalize(h.cross(W,k,R),R),_=!1}h.equalsEpsilon(k,U,P.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(N=g.geodeticSurfaceNormal(U,N),t.tangent&&(M=h.normalize(h.cross(N,R,M),M)))}else R=g.geodeticSurfaceNormal(U,R),(t.tangent||t.bitangent)&&(x&&(ez=h.fromArray(C,O,ez),Tm=h.cross(h.UNIT_Z,ez,Tm),Tm=h.normalize($.multiplyByVector(w,Tm,Tm),Tm),t.bitangent&&(UA=h.normalize(h.cross(ez,Tm,UA),UA))),M=h.cross(h.UNIT_Z,R,M),M=h.normalize($.multiplyByVector(w,M,M),M),t.bitangent&&(N=h.normalize(h.cross(R,M,N),N)));t.normal&&(e.wall?(C[O+I]=R.x,C[V+I]=R.y,C[G+I]=R.z):u&&(C[O+I]=-R.x,C[V+I]=-R.y,C[G+I]=-R.z),(c&&!x||a)&&(C[O]=R.x,C[V]=R.y,C[G]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(U,R)),v[O+I]=-R.x,v[V+I]=-R.y,v[G+I]=-R.z),t.tangent&&(e.wall?(A[O+I]=M.x,A[V+I]=M.y,A[G+I]=M.z):u&&(A[O+I]=-M.x,A[V+I]=-M.y,A[G+I]=-M.z),c&&(x?(A[O]=Tm.x,A[V]=Tm.y,A[G]=Tm.z):(A[O]=M.x,A[V]=M.y,A[G]=M.z))),t.bitangent&&(u&&(E[O+I]=N.x,E[V+I]=N.y,E[G+I]=N.z),c&&(x?(E[O]=UA.x,E[V]=UA.y,E[G]=UA.z):(E[O]=N.x,E[V]=N.y,E[G]=N.z))),O+=3}}t.st&&!l(r)&&(n.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T})),t.normal&&(n.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(n.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,d=new Uint8Array(f);if(e.offsetAttribute===on.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===on.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var Mse=[];function Pze(e,t,n,i,o,r,s,a,c,u){let f={walls:[]},d;if(s||a){let C=Un.createGeometryFromPositions(e,t,n,i,r,c,u),A=C.attributes.position.values,E=C.indices,v,D;if(s&&a){let O=A.concat(A);v=O.length/3,D=Ne.createTypedArray(v,E.length*2),D.set(E);let R=E.length,M=v/2;for(d=0;d<R;d+=3){let N=D[d]+M,_=D[d+1]+M,S=D[d+2]+M;D[d+R]=S,D[d+1+R]=_,D[d+2+R]=N}if(C.attributes.position.values=O,r&&c.normal){let N=C.attributes.normal.values;C.attributes.normal.values=new Float32Array(O.length),C.attributes.normal.values.set(N)}if(c.st&&l(n)){let N=C.attributes.st.values;C.attributes.st.values=new Float32Array(v*2),C.attributes.st.values=N.concat(N)}C.indices=D}else if(a){for(v=A.length/3,D=Ne.createTypedArray(v,E.length),d=0;d<E.length;d+=3)D[d]=E[d+2],D[d+1]=E[d+1],D[d+2]=E[d];C.indices=D}f.topAndBottom=new St({geometry:C})}let p=o.outerRing,g=Jr.fromPoints(p,e),m=g.projectPointsOntoPlane(p,Mse),x=si.computeWindingOrder2D(m);x===hs.CLOCKWISE&&(p=p.slice().reverse());let b=Un.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new St({geometry:b}));let T=o.holes;for(d=0;d<T.length;d++){let C=T[d];m=g.projectPointsOntoPlane(C,Mse),x=si.computeWindingOrder2D(m),x===hs.COUNTER_CLOCKWISE&&(C=C.slice().reverse()),b=Un.computeWallGeometry(C,n,e,i,r,u),f.walls.push(new St({geometry:b}))}return f}function Nf(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Ie.DEFAULT),i=y(e.ellipsoid,ee.default),o=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),u=y(e.height,0),f=y(e.extrudedHeight,u);if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Ie.clone(n),this._ellipsoid=ee.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,Qt.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Un.computeHierarchyPackedLength(t,h)+ee.packedLength+Ie.packedLength+(s?Un.computeHierarchyPackedLength(s,z):1)+12}Nf.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new Nf(t)};Nf.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=Un.packPolygonHierarchy(e._textureCoordinates,t,n,z):t[n++]=-1,t[n++]=e.packedLength,t};var Rze=ee.clone(ee.UNIT_SPHERE),Oze=new Ie,Mze={polygonHierarchy:{}};Nf.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,Rze);t+=ee.packedLength;let r=Ie.unpack(e,t,Oze);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,x=e[t++],b=e[t++],T=e[t]===-1?void 0:Un.unpackPolygonHierarchy(e,t,z);l(T)?(t=T.startingIndex,delete T.startingIndex):t++;let C=e[t++];return l(n)||(n=new Nf(Mze)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=x===-1?void 0:x,n._arcType=b,n._textureCoordinates=T,n.packedLength=C,n};var Lze=new z,Nze=new z,Fze=new mc;function Lse(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+P.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==Qt.RHUMB){let p=z.subtract(t.position,e.position,Lze),g=z.dot(t.position,p)/z.dot(p,p);if(g>0&&g<1){let m=z.add(t.position,z.multiplyByScalar(p,-g,p),Nze),x=mc.clone(t,Fze);x.position=m;let b=x.getLatitude(n);r.south=Math.min(r.south,b),r.north=Math.max(r.north,b),Math.abs(c)>Math.abs(b)&&(u=b)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=z.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=d),u<=0&&(o.southAngle+=d)}var Nse=new mc,Bze=new mc,Lf={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Nf.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new se),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Lf.northAngle=0,Lf.southAngle=0,Lf.westOverIdl=Number.POSITIVE_INFINITY,Lf.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=mc.fromCartesian(e[0],Bze);for(let s=1;s<o;s++){let a=mc.fromCartesian(e[s],Nse);Lse(a,r,t,n,Lf,i),r=mc.clone(a,r)}return Lse(mc.fromCartesian(e[0],Nse),r,t,n,Lf,i),i.east-i.west>Lf.eastOverIdl-Lf.westOverIdl&&(i.west=Lf.westOverIdl,i.east=Lf.eastOverIdl,i.east>P.PI&&(i.east=i.east-P.TWO_PI),i.west>P.PI&&(i.west=i.west-P.TWO_PI)),P.equalsEpsilon(Math.abs(Lf.northAngle),P.TWO_PI,P.EPSILON10)&&(i.north=P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),P.equalsEpsilon(Math.abs(Lf.southAngle),P.TWO_PI,P.EPSILON10)&&(i.south=-P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),i};var kze=new mc;function Vze(e,t,n){return e.height>=P.PI||e.width>=P.PI?mc.fromCartesian(t[0],kze).tangentPlane:Jr.fromPoints(t,n)}var Fse=new fe;function Uze(e,t,n){return(i,o)=>{if(e.height>=P.PI||e.width>=P.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],Fse);o[s]=new z(a.longitude/P.PI,a.latitude/P.PI_OVER_TWO)}return o.length=i.length,o}return mc.fromCartesianArray(i,o)}return Jr.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function zze(e,t,n){if(e.height>=P.PI||e.width>=P.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,Fse);return l(r)||(r=new z),r.x=s.longitude/P.PI,r.y=s.latitude/P.PI_OVER_TWO,r}return mc.fromCartesian(o,r)};let i=Jr.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function Hze(e,t,n,i){return(o,r)=>!i&&(e.height>=P.PI_OVER_TWO||e.width>=2*P.PI_OVER_THREE)?Un.splitPolygonsOnEquator(o,t,n,r):o}function Gze(e,t,n,i){if(t.height>=P.PI||t.width>=P.PI)return je.fromRectangle(t,void 0,Rse);let o=e,r=Jr.fromPoints(o,n);return Un.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Rse)}Nf.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=r.positions;if(p.length<3)return;let g=e.rectangle,m=Un.polygonsFromHierarchy(r,d,Uze(g,p,n),!s,n,Hze(g,n,u,s)),x=m.hierarchy,b=m.polygons,T=function(I){return I},C=d?Un.polygonsFromHierarchy(f,!0,T,!1,n).polygons:void 0;if(x.length===0)return;let A=x[0].outerRing,E=Gze(A,g,n,o),v=[],D=e._height,O=e._extrudedHeight,R=e._perPositionHeightExtrude||!P.equalsEpsilon(D,O,0,P.EPSILON2),M={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:Vze(g,A,n).plane.normal,projectTo2d:zze(g,A,n),boundingRectangle:E,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},N;if(R)for(M.extrude=!0,M.top=a,M.bottom=c,M.shadowVolume=e._shadowVolume,M.offsetAttribute=e._offsetAttribute,N=0;N<b.length;N++){let I=Pze(n,b[N],d?C[N]:void 0,i,x[N],s,a,c,t,u),L;a&&c?(L=I.topAndBottom,M.geometry=Un.scaleToGeodeticHeightExtruded(L.geometry,D,O,n,s)):a?(L=I.topAndBottom,L.geometry.attributes.position.values=si.scaleToGeodeticHeight(L.geometry.attributes.position.values,D,n,!s),M.geometry=L.geometry):c&&(L=I.topAndBottom,L.geometry.attributes.position.values=si.scaleToGeodeticHeight(L.geometry.attributes.position.values,O,n,!0),M.geometry=L.geometry),(a||c)&&(M.wall=!1,L.geometry=vW(M),v.push(L));let B=I.walls;M.wall=!0;for(let U=0;U<B.length;U++){let V=B[U];M.geometry=Un.scaleToGeodeticHeightExtruded(V.geometry,D,O,n,s),V.geometry=vW(M),v.push(V)}}else for(N=0;N<b.length;N++){let I=new St({geometry:Un.createGeometryFromPositions(n,b[N],d?C[N]:void 0,i,s,t,u)});if(I.geometry.attributes.position.values=si.scaleToGeodeticHeight(I.geometry.attributes.position.values,D,n,!s),M.geometry=I.geometry,I.geometry=vW(M),l(e._offsetAttribute)){let L=I.geometry.attributes.position.values.length,B=e._offsetAttribute===on.NONE?0:1,U=new Uint8Array(L/3).fill(B);I.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}v.push(I)}let _=Ln.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=Ne.createTypedArray(_.attributes.position.values.length/3,_.indices);let S=_.attributes,w=ae.fromVertices(S.position.values);return t.position||delete S.position,new st({attributes:S,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};Nf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Nf({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function Wze(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return st._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(Nf.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Nf.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Wze(this)),this._textureCoordinateRotationPoints}}});var o_=Nf;function gb(e){this._ellipsoid=y(e.ellipsoid,ee.default),this._positions=[...e.positions]}Object.defineProperties(gb.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});gb.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new gb({positions:e.positions,ellipsoid:e.ellipsoid})};gb.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};gb.prototype.computeRectangle=function(e){return o_.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var jze=new se,Bse=new h;gb.prototype.computeSphericalExtents=function(e){l(e)||(e=new se);let t=this.computeRectangle(jze),n=fe.toCartesian(se.southwest(t),this.ellipsoid,Bse),i=Math.sqrt(n.x*n.x+n.y*n.y),o=P.fastApproximateAtan2(i,n.z),r=P.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=fe.toCartesian(se.northeast(t),this.ellipsoid,Bse),i=Math.sqrt(n.x*n.x+n.y*n.y),o=P.fastApproximateAtan2(i,n.z),r=P.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var zA=gb;var TR=`in vec2 v_textureCoordinates; + +uniform int u_polygonsLength; +uniform int u_extentsLength; +uniform highp sampler2D u_polygonTexture; +uniform highp sampler2D u_extentsTexture; + +int getPolygonIndex(float dimension, vec2 coord) { + vec2 uv = coord.xy * dimension; + return int(floor(uv.y) * dimension + floor(uv.x)); +} + +vec2 getLookupUv(ivec2 dimensions, int i) { + int pixY = i / dimensions.x; + int pixX = i - (pixY * dimensions.x); + float pixelWidth = 1.0 / float(dimensions.x); + float pixelHeight = 1.0 / float(dimensions.y); + float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel + float v = (float(pixY) + 0.5) * pixelHeight; + return vec2(u, v); +} + +vec4 getExtents(int i) { + return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i)); +} + +ivec2 getPositionsLengthAndExtentsIndex(int i) { + vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i); + vec4 value = texture(u_polygonTexture, uv); + return ivec2(int(value.x), int(value.y)); +} + +vec2 getPolygonPosition(int i) { + vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i); + return texture(u_polygonTexture, uv).xy; +} + +vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) { + float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y); + float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x); + return vec2(latitude, longitude); +} + +void main() { + int lastPolygonIndex = 0; + out_FragColor = vec4(1.0); + + // Get the relevant region of the texture + float dimension = float(u_extentsLength); + if (u_extentsLength > 2) { + dimension = ceil(log2(float(u_extentsLength))); + } + int regionIndex = getPolygonIndex(dimension, v_textureCoordinates); + + for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) { + ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex); + int positionsLength = positionsLengthAndExtents.x; + int polygonExtentsIndex = positionsLengthAndExtents.y; + lastPolygonIndex += 1; + + // Only compute signed distance for the relevant part of the atlas + if (polygonExtentsIndex == regionIndex) { + float clipAmount = czm_infinity; + vec4 extents = getExtents(polygonExtentsIndex); + vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension; + vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents); + float s = 1.0; + + // Check each edge for absolute distance + for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) { + vec2 a = getPolygonPosition(lastPolygonIndex + i); + vec2 b = getPolygonPosition(lastPolygonIndex + j); + + vec2 ab = b - a; + vec2 pa = p - a; + float t = dot(pa, ab) / dot(ab, ab); + t = clamp(t, 0.0, 1.0); + + vec2 pq = pa - t * ab; + float d = length(pq); + + // Inside / outside computation to determine sign + bvec3 cond = bvec3(p.y >= a.y, + p.y < b.y, + ab.x * pa.y > ab.y * pa.x); + if (all(cond) || all(not(cond))) s = -s; + if (abs(d) < abs(clipAmount)) { + clipAmount = d; + } + } + + // Normalize the range to [0,1] + vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; + // In the case where we've iterated through multiple polygons, take the minimum + out_FragColor = min(out_FragColor, result); + } + + lastPolygonIndex += positionsLength; + } +}`;function is(e){e=y(e,y.EMPTY_OBJECT),this._polygons=[],this._totalPositions=0,this.enabled=y(e.enabled,!0),this.inverse=y(e.inverse,!1),this.polygonAdded=new pe,this.polygonRemoved=new pe,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(is.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});is.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};is.prototype.get=function(e){return this._polygons[e]};is.prototype.contains=function(e){return this._polygons.some(t=>zA.equals(t,e))};is.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>zA.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var qze=new se;function Yze(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=se.clone(a);f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI);let d=[r];for(let p=0;p<t.length;++p){let g=t[p];if(l(g)&&l(se.simpleIntersection(g,f))&&!se.equals(g,f)){let m=n[p];d.push(...m),m.reduce((x,b)=>se.union(e[b].computeSphericalExtents(qze),x,x),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=se.clone(a,f),f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),p=-1}}t.push(f),n.push(d)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}is.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function Xze(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=Yze(i),s=0;for(let[c,u]of i.entries()){let f=u.length;t[s++]=f,t[s++]=r.get(c);for(let d=0;d<f;++d){let p=u.positions[d],g=Math.hypot(p.x,p.y),m=P.fastApproximateAtan2(g,p.z),x=P.fastApproximateAtan2(p.x,p.y);t[s++]=m,t[s++]=x}}let a=0;for(let c of o){let u=1/(c.east-c.west),f=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=f,n[a++]=u}e._extentsCount=o.length}var wW=new z;is.prototype.update=function(e){let t=e.context;if(!is.isSupported(e))throw new re("ClippingPolygonCollections are only supported for WebGL 2.");let n=this._polygons.reduce((s,a)=>s+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let s=is.getTextureResolution(i,this.pixelsNeededForPolygonPositions,wW);i=new It({context:t,width:s.x,height:s.y,pixelFormat:et.RG,pixelDatatype:Ke.FLOAT,sampler:Zt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(l(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let s=is.getTextureResolution(o,this.pixelsNeededForExtents,wW);o=new It({context:t,width:s.x,height:s.y,pixelFormat:et.RGBA,pixelDatatype:Ke.FLOAT,sampler:Zt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(Xze(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(r)){let s=is.getClippingDistanceTextureResolution(this,wW);r=new It({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?et.RED:et.LUMINANCE,pixelDatatype:Ke.FLOAT,sampler:new Zt({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:di.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=Kze(this)};is.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function Kze(e){let t=e._polygonsTexture,n=e._extentsTexture;return new kc({fragmentShaderSource:TR,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var kse=new se,Zze=new se;is.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Wt.OUTSIDE;this.inverse&&(o=Wt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let f=e.boundingVolume.computeCorners();c=se.fromCartesianArray(f,t,kse)}l(c)||(c=se.fromBoundingSphere(e.boundingSphere,t,kse));let u=se.simpleIntersection(c,a,Zze);l(u)&&(o=Wt.INTERSECTING)}return o};is.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};is.isSupported=function(e){return e?.context.webgl2};is.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Lt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};is.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Lt.maximumTextureSize,4096),t.y=Math.min(Lt.maximumTextureSize,4096),t)};is.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):is.getTextureResolution(n,e.pixelsNeededForExtents,t)};is.prototype.isDestroyed=function(){return!1};is.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),ue(this)};var Jd=is;var CR={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};CR.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?CR.SUNLIGHT:CR.SCENE_LIGHT:CR.NONE};var r_=Object.freeze(CR);function Vse(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=r_.NONE}Vse.requiresColorCorrect=function(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))};var yb=Vse;var eh=`uniform vec3 u_radiiAndDynamicAtmosphereColor; uniform float u_atmosphereLightIntensity; uniform float u_atmosphereRayleighScaleHeight; @@ -4133,7 +6392,2151 @@ vec4 computeAtmosphereColor( return vec4(color, opacity); } -`;var yP=`uniform sampler2D u_atlas; +`;var AR=`uniform samplerCube u_radianceMap; + +in vec2 v_textureCoordinates; + + +const float twoSqrtPi = 2.0 * sqrt(czm_pi); + +// Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf +float computeShBasis(int index, vec3 s) { + if (index == 0) { // l = 0, m = 0 + return 1.0 / twoSqrtPi; + } + + if (index == 1) { // l = 1, m = -1 + return -sqrt(3.0) * s.y / twoSqrtPi; + } + + if (index == 2) { // l = 1, m = 0 + return sqrt(3.0) * s.z / twoSqrtPi; + } + + if (index == 3) { // l = 1, m = 1 + return -sqrt(3.0) * s.x / twoSqrtPi; + } + + if (index == 4) { // l = 2, m = -2 + return sqrt(15.0) * s.y * s.x / twoSqrtPi; + } + + if (index == 5) { // l = 2, m = -1 + return -sqrt(15.0) * s.y * s.z / twoSqrtPi; + } + + if (index == 6) { // l = 2, m = 0 + return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; + } + + if (index == 7) { // l = 2, m = 1 + return -sqrt(15.0) * s.x * s.z / twoSqrtPi; + } + + if (index == 8) { // l = 2, m = 2 + return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; + } + + return 0.0; +} + +float vdcRadicalInverse(int i) +{ + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) + { + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); + } + return value; +} + +vec2 hammersley2D(int i, int N) +{ + return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} + +// Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics +const int samples = 256; +const float solidAngle = 1.0 / float(samples); + +void main() { + // Get the current coefficient based on the uv + vec2 uv = v_textureCoordinates.xy * 3.0; + int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); + + for (int i = 0; i < samples; ++i) { + vec2 xi = hammersley2D(i, samples); + float phi = czm_twoPi * xi.x; + float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); + + // Generate the spherical harmonics basis from the direction + float Ylm = computeShBasis(coefficientIndex, direction); + + vec3 lookupDirection = -direction.xyz; + lookupDirection.z = -lookupDirection.z; + + vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); + + // Use the relevant function for this coefficient + out_FragColor += Ylm * color * solidAngle * sinTheta; + } + +} +`;var ER=`precision highp float; + +in vec2 v_textureCoordinates; + +uniform vec3 u_faceDirection; // Current cubemap face +uniform vec3 u_positionWC; +uniform mat4 u_enuToFixedFrame; +uniform vec4 u_brightnessSaturationGammaIntensity; +uniform vec4 u_groundColor; // alpha component represent albedo + +vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { + vec2 scaledUV = uv * 2.0 - 1.0; + + if (faceDir.x != 0.0) { + return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); + } else if (faceDir.y != 0.0) { + return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); + } else { + return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); + } +} + +void main() { + float height = length(u_positionWC); + float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; + float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); + + // Scale the position to ensure the sky color is present, even when underground. + vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); + + float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; + float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; + + vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; + vec3 normalizedDirection = normalize(direction); + + czm_ray ray = czm_ray(positionWC, normalizedDirection); + czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); + if (!czm_isEmpty(intersection)) { + intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); + } + + bool onEllipsoid = intersection.start >= 0.0; + float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); + + // Compute sky color for each position on a sphere at radius centered around the provided position's origin + vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; + + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); + vec3 mieColor; + vec3 rayleighColor; + float opacity; + czm_computeScattering( + ray, + rayLength, + lightDirectionWC, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); + + vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); + +#ifdef ATMOSPHERE_COLOR_CORRECT + const bool ignoreBlackPixels = true; + atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); +#endif + + vec3 lookupDirection = -normalizedDirection; + // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. + lookupDirection.x = -lookupDirection.x; + lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); + lookupDirection.x = -lookupDirection.x; + + // Values outside the atmopshere are rendered as black, when they should be treated as transparent + float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); + skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent + + // Blend starmap with atmopshere scattering + float intensity = u_brightnessSaturationGammaIntensity.w; + vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); + vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); + vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); + + // Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height + vec3 up = normalize(positionWC); + float occlusion = max(dot(lightDirectionWC, up), 0.05); + vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); + vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); + + vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); + + float brightness = u_brightnessSaturationGammaIntensity.x; + float saturation = u_brightnessSaturationGammaIntensity.y; + float gamma = u_brightnessSaturationGammaIntensity.z; + +#ifdef ENVIRONMENT_COLOR_CORRECT + color.rgb = mix(vec3(0.0), color.rgb, brightness); + color.rgb = czm_saturation(color.rgb, saturation); +#endif + color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0. + color.rgb = czm_gammaCorrect(color.rgb); + + out_FragColor = color; +} +`;var SR=`precision highp float; + +in vec3 v_textureCoordinates; + +uniform float u_roughness; +uniform samplerCube u_radianceTexture; +uniform vec3 u_faceDirection; + +float vdcRadicalInverse(int i) +{ + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) + { + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); + } + return value; +} + +vec2 hammersley2D(int i, int N) +{ + return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} + +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ + float alphaRoughnessSquared = alphaRoughness * alphaRoughness; + float phi = czm_twoPi * xi.x; + float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); + vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangentX = normalize(cross(upVector, N)); + vec3 tangentY = cross(N, tangentX); + return tangentX * H.x + tangentY * H.y + N * H.z; +} + +// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses +const int samples = 128; + +void main() { + vec3 normal = u_faceDirection; + vec3 V = normalize(v_textureCoordinates); + float roughness = u_roughness; + + vec4 color = vec4(0.0); + float weight = 0.0; + for (int i = 0; i < samples; ++i) { + vec2 xi = hammersley2D(i, samples); + vec3 H = importanceSampleGGX(xi, roughness, V); + vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector + + float NdotL = max(dot(V, L), 0.0); + if (NdotL > 0.0) { + color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; + weight += NdotL; + } + } + out_FragColor = color / weight; +} +`;var vR=`in vec3 position; +out vec3 v_textureCoordinates; + +uniform vec3 u_faceDirection; + +vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { + vec2 scaledUV = uv; + + if (faceDir.x != 0.0) { + return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); + } else if (faceDir.y != 0.0) { + return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); + } else { + return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); + } +} + +void main() +{ + v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); + v_textureCoordinates.y = -v_textureCoordinates.y; + v_textureCoordinates.z = -v_textureCoordinates.z; + gl_Position = vec4(position, 1.0); +} +`;function Qn(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=y(e,y.EMPTY_OBJECT);let t=Math.min(y(e.mipmapLevels,7),Math.log2(Lt.maximumCubeMapSize));this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Qn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Z;let n=Math.pow(2,t-1);this._textureDimensions=new z(n,n),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=y(e.enabled,!0),this.shouldUpdate=!0,this.maximumSecondsDifference=y(e.maximumSecondsDifference,60*60),this.maximumPositionEpsilon=y(e.maximumPositionEpsilon,1e3),this.atmosphereScatteringIntensity=y(e.atmosphereScatteringIntensity,2),this.gamma=y(e.gamma,1),this.brightness=y(e.brightness,1),this.saturation=y(e.saturation,1),this.groundColor=y(e.groundColor,Qn.AVERAGE_EARTH_GROUND_COLOR),this.groundAlbedo=y(e.groundAlbedo,.31)}Object.defineProperties(Qn.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});Qn._maximumComputeCommandCount=8;Qn._activeComputeCommandCount=0;Qn._nextFrameCommandQueue=[];Qn._queueCommand=(e,t)=>{if(Qn._activeComputeCommandCount>=Qn._maximumComputeCommandCount){Qn._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Qn._activeComputeCommandCount++};Qn._updateCommandQueue=e=>{if(Qn._maximumComputeCommandCount=Math.log2(Lt.maximumCubeMapSize),Qn._nextFrameCommandQueue.length>0&&Qn._activeComputeCommandCount<Qn._maximumComputeCommandCount){let t=Qn._nextFrameCommandQueue.shift();for(;l(t)&&Qn._activeComputeCommandCount<Qn._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Qn._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Qn._activeComputeCommandCount++,t=Qn._nextFrameCommandQueue.shift()}l(t)&&Qn._nextFrameCommandQueue.push(t)}};Qn.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Qn.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var $ze=new h,Qze=new h;function Jze(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,Qze),s=1.025,a=$ze,c=l(r)?h.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Use=new h,e4e=new F,t4e=new oe,n4e=new H;function i4e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new Cr({context:n,width:i.x,height:i.y,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:et.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new Ue({sources:[eh,ER]}),e._radianceMapFS=o),yb.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=Ot.eastNorthUpToFixedFrame(r,a,e4e),u=t4e;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of Cr.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new It({context:n,width:i.x,height:i.y,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:et.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new kc({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>Cr.getDirection(d,Use),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,n4e)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Qn._activeComputeCommandCount--;return}let x=e._radianceMapComputeCommands;x[g]=void 0;let b=new Nr({context:n,colorTextures:[e._radianceMapTextures[g]]});b._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),b._unBind(),b.destroy(),Qn._activeComputeCommandCount--,x.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Qn._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function o4e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,u=(d,p,g,m,x)=>()=>{if(e.isDestroyed()||d.canceled){Qn._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[p]=void 0,n.copyFace(t,g,m,x),c++,Qn._activeComputeCommandCount--,g.destroy(),e._specularMapTextures[p]=void 0;let T=e._specularMapTextures.length;c>=T&&(e._irradianceCommandDirty=!0,n.sampler=new Zt({minificationFilter:Kt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},f=0;for(let d=1;d<i;++d){for(let p of Cr.faceNames()){l(e._specularMapTextures[f])&&e._specularMapTextures[f].destroy();let g=e._specularMapTextures[f]=new It({context:a,width:r,height:s,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:et.RGBA}),m=e._va;l(m)||(m=Cr.createVertexArray(a,p),e._va=m);let x=e._convolveSP;l(x)||(x=$t.fromCache({context:a,vertexShaderSource:vR,fragmentShaderSource:SR,attributeLocations:{positions:0}}),e._convolveSP=x);let b=new kc({shaderProgram:x,vertexArray:m,outputTexture:g,persists:!0,owner:e,uniformMap:{u_roughness:()=>d/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>Cr.getDirection(p,Use)}});b.postExecute=u(b,f,g,p,d),e._convolutionComputeCommands[f]=b,Qn._queueCommand(b,t),++f}r/=2,s/=2}}var zse=new z(3,3);function r4e(e,t){let n=t.context,i=zse,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new It({context:n,width:i.x,height:i.y,pixelDatatype:Ke.FLOAT,pixelFormat:et.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new Ue({sources:[AR]}),e._irradianceMapFS=r);let s=new kc({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Qn._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Qn._activeComputeCommandCount--},e._irradianceComputeCommand=s,Qn._queueCommand(s,t),e._irradianceTextureDirty=!0}function s4e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new Nr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=zse,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(r,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Qn.prototype.update=function(e){let t=e.mode;if(!Qn.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===ne.MORPHING){this._shouldRegenerateShaders=!1;return}Qn._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=Jze(this,e)||i===r_.SUNLIGHT&&!Z.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=Z.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(i4e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(o4e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(r4e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){s4e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Qn.prototype.isDestroyed=function(){return!1};Qn.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),ue(this)};Qn.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Qn.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(H.fromCssColorString("#717145"));Qn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var s_=Qn;var wR={HIGHLIGHT:0,REPLACE:1,MIX:2};wR.getColorBlend=function(e,t){if(e===wR.HIGHLIGHT)return 0;if(e===wR.REPLACE)return 1;if(e===wR.MIX)return P.clamp(t,P.EPSILON4,1)};var pc=Object.freeze(wR);var a4e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},_c=Object.freeze(a4e);var c4e={STEP:0,LINEAR:1,CUBICSPLINE:2},th=Object.freeze(c4e);var Hse={};function DR(e){this._count=e.count,this._properties=Ge(e.properties,!0)}DR.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,Hse)};DR.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,Hse,e)};DR.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ge(n[e],!0)};DR.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ge(n,!0)};var a_=DR;function gc(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(gc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});gc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};gc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};gc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};gc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var DW=[];gc.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(DW)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,DW)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(DW)),t};gc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};gc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new a_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};gc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};gc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};gc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};gc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};gc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};gc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};gc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var nl=gc;function IR(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=Vl.createModelTextureReader({textureInfo:r,channels:f4e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(IR.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});IR.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(gt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(gt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==ct.SCALAR?(gt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==kt.UINT8?(gt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:ct.isVectorType(t)||t===ct.SCALAR?n!==kt.UINT8?(gt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(gt(`Property texture property ${e.id} has an unsupported type`),!1)};var l4e=[void 0,"float","vec2","vec3","vec4"],u4e=[void 0,"int","ivec2","ivec3","ivec4"];IR.prototype.getGlslType=function(){let e=this._classProperty,t=ct.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?l4e[t]:u4e[t]};IR.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function f4e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var PR=IR;function IW(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new PR({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(IW.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});IW.prototype.getProperty=function(e){return this._properties[e]};var c_=IW;function Gse(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=y(i,n.offset),o=y(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Gse.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var RR=Gse;function PW(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new RR({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(PW.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});PW.prototype.getProperty=function(e){return this._properties[e]};var xb=PW;function OR(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(OR.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});OR.prototype.getPropertyTable=function(e){return this._propertyTables[e]};OR.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};OR.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var qs=OR;function d4e(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=new Bl({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new nl({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new c_({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new xb({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new qs({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var MR=d4e;function h4e(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],u=n.classes[c.class],f=new Bl({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new nl({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new c_({id:a,propertyTexture:m4e(c),class:n.classes[c.class],textures:e.textures}))}return new qs({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function m4e(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:p4e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=xt(o.texture,r,!0)}return t}function p4e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var LR=h4e;function by(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:u=!0}=e;this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=mt.UNLOADED,this._promise=void 0}l(Object.create)&&(by.prototype=Object.create(Ki.prototype),by.prototype.constructor=by);Object.defineProperties(by.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function _4e(e){try{let t=T4e(e),n=v4e(e),i=w4e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=mt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=mt.FAILED,e.getError("Failed to load structural metadata",t)}}by.prototype.load=function(){return l(this._promise)?this._promise:(this._state=mt.LOADING,this._promise=_4e(this),this._promise)};function g4e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function y4e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function x4e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];g4e(o.properties,n)}return n}function b4e(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&y4e(r,n)}}return n}async function T4e(e){let t;l(e._extension)?t=x4e(e._extension):t=b4e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Si.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function C4e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&A4e(r,t)}return t}function A4e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function E4e(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&S4e(r,t)}}return t}function S4e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function v4e(e){let t;l(e._extension)?t=C4e(e._extension):t=E4e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Si.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function w4e(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Si.getSchemaLoader({resource:i})}else n=Si.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}by.prototype.process=function(e){if(this._state===mt.READY)return!0;if(this._state!==mt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],u=t[a];u.isDestroyed()||(s[c]=u.texture)}return l(this._extension)?this._structuralMetadata=MR({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=LR({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),Wse(this),this._state=mt.READY,!0};function Wse(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Si.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function D4e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Si.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}by.prototype.unload=function(){Wse(this),D4e(this),l(this._schemaLoader)&&Si.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var NR=by;var HA={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};HA.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return HA.TRANSLATION;case"ROTATION":return HA.ROTATION;case"SCALE":return HA.SCALE;case"_FEATURE_ID":return HA.FEATURE_ID}};var os=Object.freeze(HA);var I4e=65534,P4e=255;function tz(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Yse(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],R4e(this)}Object.defineProperties(tz.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function R4e(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),x=jse(i,c,u,f,p,g,m);for(;l(x);){let b=s[x];if(!l(b)){b=r+o.length;let T=x;for(;T>=r;)T=o[T-r];o.push(T),s[x]=b}b>I4e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>P4e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=b,t[a]=b):x===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),x=jse(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function jse(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=RW(e,t,a,c,u);if(f===0)return t;let d=0,p=o?1:0,g=r?1:0,m=RW(e,n,d,p,g);if(m===0)return n;let x=s?1:0,b=0,T=r?1:0,C=RW(e,i,x,b,T);if(C===0)return i;let A=f&m&C,E,v,D;if(A&1)E=0,v=1,D=2;else if(A&2)E=0,D=1,v=2;else if(A&4)v=0,E=1,D=2;else if(A&8)v=0,D=1,E=2;else if(A&16)D=0,E=1,v=2;else if(A&32)D=0,v=1,E=2;else{let N=OW(f),_=OW(m),S=OW(C);return N<_&&N<S?t:_<S?n:i}let O=t*3;e[O+E]=a,e[O+v]=c,e[O+D]=u;let R=n*3;e[R+E]=d,e[R+v]=p,e[R+D]=g;let M=i*3;e[M+E]=x,e[M+v]=b,e[M+D]=T}function RW(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function OW(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}tz.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};tz.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Lt.maximumTextureSize),i=n,o=qse(i),r=[];for(;i>1;)i>>=1,r.push(qse(i));let s=new It({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:et.LUMINANCE,sampler:new Zt({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR_MIPMAP_LINEAR,magnificationFilter:di.LINEAR})});return t.outlineTexture=s,s};function qse(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Yse(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}Yse.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var bb=tz;function Xse(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function O4e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function nz(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}nz.prototype.postProcess=function(e){this.needsOutlines&&(M4e(this),N4e(this,e))};function M4e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new bb({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ne.fromTypedArray(n.typedArray);let r=L4e(o.outlineCoordinates),s=new Xse(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function L4e(e){let t=new xn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=X.FLOAT,t.type=tn.VEC3,t.normalized=!1,t.count=e.length/3,t}function N4e(e,t){F4e(e.attributePlans,t),l(e.indicesPlan)&&B4e(e.indicesPlan,t)}function F4e(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=_t.createVertexBuffer({typedArray:s,context:t,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function B4e(e,t){let n=e.indices;if(e.loadBuffer){let i=_t.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Fe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}nz.AttributeLoadPlan=Xse;nz.IndicesLoadPlan=O4e;var Tb=nz;function k4e(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var FR=k4e;function Kse(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Kse.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var BR=Kse;function Zse(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(Zse.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var kR=Zse;function $se(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties($se.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var VR=$se;var V4e={Direct:"Direct",Indirect:"Indirect"},Ty=Object.freeze(V4e);function Qse(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(Qse.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var GA=Qse;function Jse(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Jse.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var UR=Jse;function WA(){}function eae(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function U4e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new BR({position:t,adjustmentParams:n})}function z4e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=eae(e.covarianceMatrix);return new kR({position:t,adjustmentParams:n,covarianceMatrix:i})}function H4e(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let r of e.params){let s=new UR({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new VR({groupFlags:t,rotationThetas:n,params:i})}WA.load=function(e){let t=e.storageType;if(t===Ty.Direct)return WA.loadDirect(e);if(t===Ty.Indirect)return WA.loadIndirect(e);throw new re(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};WA.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=U4e(r);t.push(s)}let i=eae(e.covarianceDirectUpperTriangle);return new GA({storageType:Ty.Direct,anchorPointsDirect:t,covarianceDirect:i})};WA.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=z4e(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=H4e(s);o.push(a)}return new GA({storageType:Ty.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var zR=WA;function tae(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(tae.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var HR=tae;function nae(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(nae.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var GR=nae;function iae(e){this._ppeTextures=e}Object.defineProperties(iae.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var WR=iae;function wr(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=y(e.asynchronous,!0);this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=mt.UNLOADED,this._promise=void 0}l(Object.create)&&(wr.prototype=Object.create(Ki.prototype),wr.prototype.constructor=wr);Object.defineProperties(wr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});wr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=mt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=mt.FAILED,this.getError("Failed to load GPM data",e)}};wr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=mt.LOADING,this._promise=this._loadResources(this),this._promise)};function G4e(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}wr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=G4e(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Si.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};wr.ppeTexturesMetadataSchemaCache=new Map;wr._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,o=e.offset??0,r=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:o,scale:r,min:n.min,max:n.max}}}};wr._obtainPpeTexturesMetadataSchema=function(e){let n=wr._collectPpeTexturePropertyIdentifiers(e).toString(),i=wr.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${wr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=wr._createPpeTextureClassJson(c,a);r.classes[u]=f}return i=vu.fromJson(r),wr.ppeTexturesMetadataSchemaCache.set(n,i),i};wr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=wr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};wr._convertToStructuralMetadata=function(e,t){let n=[],i=wr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,f=a.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new c_({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new qs({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};wr.prototype.process=function(e){if(this._state===mt.READY)return!0;if(this._state!==mt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(o[f]=d.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let d=f.traits,p=new GR({min:d.min,max:d.max,source:d.source}),g=new HR({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(g)}}let a=new WR(r);this._meshPrimitiveGpmLocal=a;let c=wr._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=mt.READY,!0};wr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Si.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};wr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var jR=wr;var{Attribute:W4e,Indices:j4e,FeatureIdAttribute:oae,FeatureIdTexture:rae,FeatureIdImplicitRange:sae,MorphTarget:q4e,Primitive:Y4e,Instances:X4e,Skin:K4e,Node:Z4e,AnimatedPropertyType:$4e,AnimationSampler:Q4e,AnimationTarget:J4e,AnimationChannel:eHe,Animation:tHe,ArticulationStage:nHe,Articulation:iHe,Asset:oHe,Scene:rHe,Components:sHe,MetallicRoughness:aHe,SpecularGlossiness:cHe,Specular:lHe,Anisotropy:MW,Clearcoat:LW,Material:uHe}=xn,Bo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function nh(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=No.Y,forwardAxis:a=No.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:u=!1,enablePick:f=!1,loadIndicesForWireframe:d=!1,loadPrimitiveOutline:p=!0,loadForClassification:g=!1,renameBatchIdSemantic:m=!1}=e,{baseResource:x=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=x,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=c,this._loadAttributesFor2D=u,this._enablePick=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=m,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Bo.NOT_LOADED,this._textureState=Bo.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(nh.prototype=Object.create(Ki.prototype),nh.prototype.constructor=nh);Object.defineProperties(nh.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function fHe(e){e._state=Bo.LOADING,e._textureState=Bo.LOADING;try{let t=Si.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Bo.LOADED,e._textureState=Bo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Bo.FAILED,e._textureState=Bo.FAILED,iz(e,t)}}async function dHe(e,t){zt.supportsWebP.initialized||await zt.supportsWebP.initialize(),e._supportedImageFormats=new FR({webp:zt.supportsWebP(),basis:t.context.supportsBasis});let n=p8e(e,t);return e._state=Bo.PROCESSING,e._textureState=Bo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Si.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}nh.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=fHe(this),this._promise)};function iz(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function hHe(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(l(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(l(r)){let s=r.process(t);s&&(l(e._components.structuralMetadata)&>("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&s}n&&(e._state=Bo.POST_PROCESSING)}function mHe(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&pHe(e,o)}}function pHe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let c=r[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}nh.prototype._process=function(e){return this._state===Bo.READY?!0:(this._state===Bo.PROCESSING&&hHe(this,e),this._resourcesLoaded&&this._state===Bo.POST_PROCESSING&&(mHe(this,e.context),this._state=Bo.PROCESSED),this._resourcesLoaded&&this._state===Bo.PROCESSED?(pae(this),this._typedArray=void 0,this._state=Bo.READY,!0):!1)};nh.prototype._processTextures=function(e){if(this._textureState===Bo.READY)return!0;if(this._textureState!==Bo.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&l(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=Bo.READY,this._texturesLoaded=!0,!0):!1};nh.prototype.process=function(e){if(this._state===Bo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=dHe(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=Bo.FAILED;let o=this._processError;this._processError=void 0,iz(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===Bo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Bo.FAILED,iz(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Bo.FAILED,iz(this,o)}return this._incrementallyLoadTextures?n:n&&i};function _He(e,t,n,i,o,r,s){let a=e.gltfJson,u=a.accessors[t].bufferView;return Si.getVertexBufferLoader({gltf:a,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,bufferViewId:u,draco:i,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function gHe(e,t,n,i,o,r){return Si.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:r,draco:n,asynchronous:e._asynchronous,loadBuffer:i,loadTypedArray:o})}function yHe(e,t){let n=Si.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function aae(e,t,n){let i=t.byteOffset,o=kl(e,t),r=t.count,s=Su(t.type),a=t.componentType,c=X.getSizeInBytes(a),u=c*s,f=r*s;if(o===u)return n=new Uint8Array(n),X.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=X.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=n_(t.componentType);i=n.byteOffset+i;for(let x=0;x<r;++x){m(p,i,s,c,g);for(let b=0;b<s;++b)d[x*s+b]=g[b];i+=o}return d}function xHe(e,t){let n=e.type;if(n===tn.SCALAR)return t.fill(0);let i=tn.getMathType(n);return t.fill(i.clone(i.ZERO))}function bHe(e,t,n,i){let o=e.type,r=e.count;if(o===tn.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===tn.VEC4&&i)for(let s=0;s<r;s++)n[s]=Oe.unpack(t,s*4);else{let s=tn.getMathType(o),a=tn.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function THe(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=aae(r,n,t.typedArray);i=y(i,!1),bHe(n,s,o,i)}function oz(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=yHe(e,o),s=THe(e,r,t,n,i);return e._loaderPromises.push(s),i}return xHe(t,i)}function wu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function CHe(e){return e===Number?0:new e}function AHe(e){switch(e){case X.BYTE:return 127;case X.UNSIGNED_BYTE:return 255;case X.SHORT:return 32767;case X.UNSIGNED_SHORT:return 65535;default:return 1}}var EHe={VEC2:new z(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new oe(-1,-1,-1,-1)};function SHe(e,t){let n=AHe(e.componentDatatype),i=EHe[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function vHe(e,t,n){let i=e.decodeMatrix,o=wu(n,e.decodedMin),r=wu(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new xn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new z(i[6],i[7]),s.quantizedVolumeStepSize=new z(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new oe(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new oe(i[0],i[6],i[12],i[18])),t.quantization=s}function wHe(e,t,n,i,o){let r=e.accessors[t],s=tn.getMathType(r.type),a=y(r.normalized,!1),c=new W4e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=CHe(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=wu(s,r.min),c.max=wu(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=kl(e,r),oi(r,"WEB3D_quantized_attributes")&&vHe(r.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===Ct.POSITION||c.semantic===Ct.NORMAL||c.semantic===Ct.TANGENT||c.semantic===Ct.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&SHe(c,s),c}function cae(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var DHe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function NW(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=DHe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function IHe(e){let t=e===Ct.POSITION,n=e===Ct.FEATURE_ID,i=e===Ct.TEXCOORD;return t||n||i}function PHe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=X.createArrayBufferView(o,t.typedArray.buffer)}}function RHe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=aae(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function lae(e,t,n,i,o,r,s){let a=e.gltfJson,c=a.accessors[t],u=c.bufferView,f=n.gltfSemantic,d=n.renamedSemantic,p=n.modelSemantic,g=l(p)?cae(d):void 0,x=wHe(a,t,f,p,g);if(!l(i)&&!l(u))return x;let b=_He(e,t,f,i,o,r,s),T=e._geometryLoaders.length;e._geometryLoaders.push(b);let C=b.load();return e._loaderPromises.push(C),e._geometryCallbacks[T]=()=>{l(i)&&l(i.attributes)&&l(i.attributes[f])?PHe(x,b,o,r):RHe(a,c,x,b,o,r)},x}function uae(e,t,n,i,o,r,s){let a=n.modelSemantic,c=a===Ct.POSITION,u=a===Ct.FEATURE_ID,f=c&&!o&&e._loadAttributesFor2D&&!s.scene3DOnly,d=c&&e._enablePick&&!s.context.webgl2,p=e._loadForClassification&&u,g=e._loadAttributesAsTypedArray,m=!g,x=g||f||d||p,C=lae(e,t,n,i,r?!1:m,r?!0:x,s),A=new Tb.AttributeLoadPlan(C);return A.loadBuffer=m,A.loadTypedArray=x,A}function OHe(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=NW(e,os,i),u=c.modelSemantic,f=u===os.TRANSLATION||u===os.ROTATION||u===os.SCALE,d=u===os.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,m=!p,x=e._loadAttributesFor2D&&!o.scene3DOnly;return lae(e,t,c,void 0,m,p||d&&(!a||x||g),o)}function MHe(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView;if(!l(n)&&!l(a))return;let c=new j4e;c.count=s.count;let u=e._loadAttributesAsTypedArray,f=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,d=e._loadForClassification&&i,g=!u,m=u||f||d,T=gHe(e,t,n,o?!1:g,o?!0:m,r),C=e._geometryLoaders.length;e._geometryLoaders.push(T);let A=T.load();e._loaderPromises.push(A),e._geometryCallbacks[C]=()=>{c.indexDatatype=T.indexDatatype,c.buffer=T.buffer,c.typedArray=T.typedArray};let E=new Tb.IndicesLoadPlan(c);return E.loadBuffer=g,E.loadTypedArray=m,E}function il(e,t,n,i){let o=e.gltfJson,r=Vl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Si.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=Vl.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=Bo.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function LHe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new cHe;return l(i)&&(c.diffuseTexture=il(e,i,n)),l(o)&&(c.specularGlossinessTexture=il(e,o,n)),c.diffuseFactor=wu(oe,r),c.specularFactor=wu(h,s),c.glossinessFactor=a,c}function NHe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new aHe;return l(i)&&(c.baseColorTexture=il(e,i,n)),l(o)&&(c.metallicRoughnessTexture=il(e,o,n)),c.baseColorFactor=wu(oe,r),c.metallicFactor=s,c.roughnessFactor=a,c}function FHe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new lHe;return l(o)&&(a.specularTexture=il(e,o,n)),l(s)&&(a.specularColorTexture=il(e,s,n)),a.specularFactor=i,a.specularColorFactor=wu(h,r),a}function BHe(e,t,n){let{anisotropyStrength:i=MW.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=MW.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new MW;return l(r)&&(s.anisotropyTexture=il(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function kHe(e,t,n){let{clearcoatFactor:i=LW.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=LW.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new LW;return l(o)&&(c.clearcoatTexture=il(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=il(e,s,n)),l(a)&&(c.clearcoatNormalTexture=il(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function VHe(e,t,n){let i=new uHe,o=y(t.extensions,y.EMPTY_OBJECT),r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=LHe(e,r,n):(l(u)&&(i.metallicRoughness=NHe(e,u,n)),l(s)&&!i.unlit&&(i.specular=FHe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=BHe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=kHe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=il(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=il(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=il(e,t.occlusionTexture,n)),i.emissiveFactor=wu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function fae(e,t){let n=new oae;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function dae(e,t,n,i){let o=new oae,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=cae(r.attribute),o.positionalLabel=i,o}function hae(e,t){let n=new sae;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function mae(e,t,n,i){let o=new sae,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function UHe(e,t,n,i){let o=new rae;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=il(e,r,n,Zt.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function zHe(e,t,n,i,o,r){let s=new rae,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=il(e,c,i,Zt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function HHe(e,t,n,i,o){let r=new q4e,s=void 0,a=!1;for(let c in t){if(!t.hasOwnProperty(c))continue;let u=t[c],f=NW(e,Ct,c),d=uae(e,u,f,s,a,n,o);r.attributes.push(d.attribute),i.attributePlans.push(d)}return r}function GHe(e,t,n,i){let o=new Y4e,r=new Tb(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=VHe(e,e.gltfJson.materials[s],i));let a=y(t.extensions,y.EMPTY_OBJECT),c=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(u)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=WHe(e,u,r));let f=e._loadForClassification,d=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(l(g))for(let v in g){if(!g.hasOwnProperty(v))continue;let D=g[v],O=NW(e,Ct,v),R=O.modelSemantic;if(f&&!IHe(R))continue;R===Ct.FEATURE_ID&&(p=!0);let M=uae(e,D,O,d,n,c,i);r.attributePlans.push(M),o.attributes.push(M.attribute)}let m=t.targets;if(l(m)&&!f)for(let v=0;v<m.length;++v)o.morphTargets.push(HHe(e,m[v],c,r,i));let x=t.indices;if(l(x)){let v=MHe(e,x,d,p,c,i);l(v)&&(r.indicesPlan=v,o.indices=v.indices)}let b=a.EXT_structural_metadata,T=a.EXT_mesh_features,C=a.EXT_feature_metadata,A=l(C);l(T)?jHe(e,o,T,i):A&&qHe(e,o,C,i),l(b)?YHe(o,b):A&&XHe(e,o,C);let E=t.mode;if(f&&E!==Me.TRIANGLES)throw new re("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function WHe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return oz(e,i,!1)}function jHe(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,c;l(s.texture)?c=UHe(e,s,i,a):l(s.attribute)?c=fae(s,a):c=hae(s,a),t.featureIds.push(c)}}function qHe(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m;l(u.featureIds.attribute)?m=dae(u,d,p,g):m=mae(u,d,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m=zHe(e,u,d,i,p,g);t.featureIds.push(m)}}function YHe(e,t){l(t)&&(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function XHe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function KHe(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new X4e,r=i.attributes;if(l(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(OHe(e,f,r,u,n))}let s=y(i.extensions,y.EMPTY_OBJECT),a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?ZHe(o,a):l(c)&&$He(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function ZHe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=fae(o,r):s=hae(o,r),e.featureIds.push(s)}}function $He(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,u=i.indexOf(c),f=o[c].count,d=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=dae(a,u,f,d):p=mae(a,u,f,d),t.featureIds.push(p)}}function QHe(e,t,n){let i=new Z4e;i.name=t.name,i.matrix=wu(F,t.matrix),i.translation=wu(h,t.translation),i.rotation=wu(Oe,t.rotation),i.scale=wu(h,t.scale);let o=y(t.extensions,y.EMPTY_OBJECT),r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new re("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=KHe(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],u=c.primitives;for(let p=0;p<u.length;++p)i.primitives.push(GHe(e,u[p],l(i.instances),n));let f=y(t.weights,c.weights),d=i.primitives[0].morphTargets;i.morphWeights=l(f)?f.slice():new Array(d.length).fill(0)}return i}function JHe(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=QHe(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function e8e(e,t,n){let i=new K4e,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=oz(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(F.IDENTITY);return i}function t8e(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=e8e(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;l(s)&&(t[r].skin=i[s])}return i}async function n8e(e,t,n,i){let o=new NR({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=o,o.load()}async function i8e(e,t,n,i){let o=new jR({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=o,o.load()}function o8e(e,t){let n=new Q4e,i=e.gltfJson.accessors,o=i[t.input];n.input=oz(e,o);let r=t.interpolation;n.interpolation=y(th[r],th.LINEAR);let s=i[t.output];return n.output=oz(e,s,!0),n}function r8e(e,t){let n=new J4e,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=$4e[o],n}function s8e(e,t,n){let i=new eHe,o=e.sampler;return i.sampler=t[o],i.target=r8e(e.target,n),i}function a8e(e,t,n){let i=new tHe;i.name=t.name;let o=t.samplers.map(function(s,a){let c=o8e(e,s);return c.index=a,c}),r=t.channels.map(function(s){return s8e(s,o,n)});return i.samplers=o,i.channels=r,i}function c8e(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=a8e(e,o,t);return s.index=r,s})}function l8e(e){let t=new nHe;t.name=e.name;let n=e.type.toUpperCase();return t.type=_c[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function u8e(e){let t=new iHe;return t.name=e.name,t.stages=e.stages.map(l8e),t}function f8e(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(u8e):[]}function d8e(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function h8e(e,t){let n=new rHe,i=d8e(e);return n.nodes=i.map(function(o){return t[o]}),n}var m8e=new h;function p8e(e,t){let n=e.gltfJson,i=y(n.extensions,y.EMPTY_OBJECT),o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let C=r.featureTables,A=r.featureTextures,E=l(C)?C:[],v=l(A)?A:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=JHe(e,t),c=t8e(e,a),u=c8e(e,a),f=f8e(n),d=h8e(n,a),p=new sHe,g=new oHe,m=n.asset.copyright;if(l(m)){let C=m.split(";").map(function(A){return new bt(A.trim())});g.credits=C}if(p.asset=g,p.scene=d,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let C=h.fromArray(s.center,0,m8e);p.transform=F.fromTranslation(C,p.transform)}if(e._components=p,l(o)||l(r)){let C=n8e(e,o,r,t);e._loaderPromises.push(C)}let x=i.NGA_gpm_local;if(l(x)){let C=zR.load(x);e._components.extensions.NGA_gpm_local=C}let b=n.meshes;if(l(b))for(let C of b){let A=C.primitives;if(l(A))for(let E of A){let v=E.extensions;if(l(v)){let D=v.NGA_gpm_local;if(l(D)){let O=i8e(e,n,D,t);e._loaderPromises.push(O)}}}}let T=[];return T.push.apply(T,e._loaderPromises),e._incrementallyLoadTextures||T.push.apply(T,e._texturesPromises),Promise.all(T)}function _8e(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Si.unload(t[n]);e._textureLoaders.length=0}function pae(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Si.unload(t[n]);e._bufferViewLoaders.length=0}function g8e(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Si.unload(t[n]);e._geometryLoaders.length=0}function y8e(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function x8e(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function b8e(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}nh.prototype.isUnloaded=function(){return this._state===Bo.UNLOADED};nh.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Si.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,_8e(this),pae(this),g8e(this),y8e(this),x8e(this),b8e(this),this._components=void 0,this._typedArray=void 0,this._state=Bo.UNLOADED};var l_=nh;var qR=`uniform sampler2D u_pointCloud_colorGBuffer; +uniform sampler2D u_pointCloud_depthGBuffer; +uniform vec2 u_distanceAndEdlStrength; +in vec2 v_textureCoordinates; + +vec2 neighborContribution(float log2Depth, vec2 offset) +{ + float dist = u_distanceAndEdlStrength.x; + vec2 texCoordOrig = v_textureCoordinates + offset * dist; + vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); + vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); + + float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); + float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); + + // ignore depth values that are the clear depth + if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { + return vec2(0.0); + } + + // interpolate the two adjacent depth values + float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); + return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); +} + +void main() +{ + float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); + + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); + eyeCoordinate /= eyeCoordinate.w; + + float log2Depth = log2(-eyeCoordinate.z); + + if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer + { + discard; + } + + vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); + + // sample from neighbors left, right, down, up + vec2 texelSize = 1.0 / czm_viewport.zw; + + vec2 responseAndCount = vec2(0.0); + + responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); + responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); + responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); + responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); + + float response = responseAndCount.x / responseAndCount.y; + float strength = u_distanceAndEdlStrength.y; + float shade = exp(-response * 300.0 * strength); + color.rgb *= shade; + out_FragColor = vec4(color); + + // Input and output depth are the same. + gl_FragDepth = depthOrLogDepth; +} +`;function jA(){this._framebuffer=new hi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(jA.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function T8e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var FW=new z;function C8e(e,t){let n=new Ue({defines:["LOG_DEPTH_WRITE"],sources:[qR]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return FW.x=e._radius,FW.y=e._strength,FW}},o=Ve.fromCache({blending:ln.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Vt.setCesium3DTileBit(),stencilMask:Vt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:we.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ei({framebuffer:e.framebuffer,color:new H(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:we.CESIUM_3D_TILE,owner:e})}function A8e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),C8e(e,t)}function _ae(e){return e.drawBuffers&&e.fragmentDepth}jA.isSupported=_ae;function E8e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=Ue.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() +{ + czm_point_cloud_post_process_main(); +#ifdef LOG_DEPTH + czm_writeLogDepth(); + out_FragData_1 = czm_packDepth(gl_FragDepth); +#else + out_FragData_1 = czm_packDepth(gl_FragCoord.z); +#endif +}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}jA.prototype.update=function(e,t,n,i){if(!_ae(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,A8e(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Me.POINTS||u.pass===we.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=Ze.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=E8e(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};jA.prototype.isDestroyed=function(){return!1};jA.prototype.destroy=function(){return T8e(this),ue(this)};var u_=jA;function gae(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}gae.isSupported=function(e){return u_.isSupported(e.context)};var Cm=gae;var ka={},S8e=new oe(0,0,0,1),yc=new oe,v8e=new je,BW=new z,kW=new z;ka.worldToWindowCoordinates=function(e,t,n){return ka.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var yae=new oe,xae=new h;function YR(e,t,n,i){let o=n.viewMatrix,r=F.multiplyByVector(o,oe.fromElements(e.x,e.y,e.z,1,yae),yae),s=h.multiplyComponents(t,h.normalize(r,xae),xae);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,r,i)}var w8e=new fe(Math.PI,P.PI_OVER_TWO),D8e=new h,I8e=new h;ka.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=ka.computeActualEllipsoidPosition(o,t,S8e);if(!l(r))return;let s=e.canvas,a=v8e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(o.mode===ne.SCENE2D){let f=e.mapProjection,d=w8e,p=f.project(d,D8e),g=h.clone(c.position,I8e),m=c.frustum.clone(),x=F.computeViewportTransformation(a,0,1,new F),b=c.frustum.projectionMatrix,T=c.positionWC.y,C=h.fromElements(P.sign(T)*p.x-T,0,-c.positionWC.x),A=Ot.pointToGLWindowCoordinates(b,x,C);if(T===0||A.x<=0||A.x>=s.clientWidth)u=!0;else{if(A.x>s.clientWidth*.5){a.width=A.x,c.frustum.right=p.x-T,yc=YR(r,n,c,yc),ka.clipToGLWindowCoordinates(a,yc,BW),a.x+=A.x,c.position.x=-c.position.x;let E=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-E,yc=YR(r,n,c,yc),ka.clipToGLWindowCoordinates(a,yc,kW)}else{a.x+=A.x,a.width-=A.x,c.frustum.left=-p.x-T,yc=YR(r,n,c,yc),ka.clipToGLWindowCoordinates(a,yc,BW),a.x=a.x-a.width,c.position.x=-c.position.x;let E=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-E,yc=YR(r,n,c,yc),ka.clipToGLWindowCoordinates(a,yc,kW)}h.clone(g,c.position),c.frustum=m.clone(),i=z.clone(BW,i),(i.x<0||i.x>s.clientWidth)&&(i.x=kW.x)}}if(o.mode!==ne.SCENE2D||u){if(yc=YR(r,n,c,yc),yc.z<0&&!(c.frustum instanceof nn)&&!(c.frustum instanceof Fr))return;i=ka.clipToGLWindowCoordinates(a,yc,i)}return i.y=s.clientHeight-i.y,i};ka.worldToDrawingBufferCoordinates=function(e,t,n){if(n=ka.worldToWindowCoordinates(e,t,n),!!l(n))return ka.transformWindowToDrawingBuffer(e,n,n)};var f_=new h,P8e=new fe;ka.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,P8e);if(!l(r))return;if(o.project(r,f_),i===ne.COLUMBUS_VIEW)return h.fromElements(f_.z,f_.x,f_.y,n);if(i===ne.SCENE2D)return h.fromElements(0,f_.x,f_.y,n);let s=e.morphTime;return h.fromElements(P.lerp(f_.z,t.x,s),P.lerp(f_.x,t.y,s),P.lerp(f_.y,t.z,s),n)};var bae=new h,Tae=new h,Cae=new F;ka.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,bae),F.computeViewportTransformation(e,0,1,Cae),F.multiplyByPoint(Cae,bae,Tae),z.fromCartesian3(Tae,n)};ka.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return z.fromElements(t.x*o,t.y*r,n)};var R8e=new oe,Aae=new oe;ka.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=oe.clone(oe.UNIT_W,R8e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=F.multiplyByVector(r.inverseViewProjection,f,Aae);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=Aae,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=F.multiplyByVector(r.inverseView,d,d)}return h.fromCartesian4(d,i)};var Hi=ka;var qA={};qA._deprecationWarning=ms;var d_=Uint32Array.BYTES_PER_ELEMENT;qA.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=d_;let r=o.getUint32(t,!0);if(r!==1)throw new re(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=d_;let s=o.getUint32(t,!0);t+=d_;let a=o.getUint32(t,!0);t+=d_;let c=o.getUint32(t,!0);t+=d_;let u=o.getUint32(t,!0);t+=d_;let f=o.getUint32(t,!0);t+=d_;let d;u>=570425344?(t-=d_*2,d=a,u=c,f=0,a=0,c=0,qA._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=d_,d=u,u=a,f=c,a=0,c=0,qA._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(d,0)}:(p=Fo(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,x;u>0&&(m=Fo(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new re("glTF byte length must be greater than 0.");let T;return t%4===0?T=new Uint8Array(e,t,b):(qA._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),T=new Uint8Array(i.subarray(t,t+b))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:x,gltf:T}};var XR=qA;function KR(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Eae(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=X.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function O8e(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=X.createTypedArray(n,i),o[t]=r),r}KR.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,X.UNSIGNED_INT),n=y(n,1),Eae(this,e,t,n,1,i.byteOffset)):i};KR.prototype.hasProperty=function(e){return l(this.json[e])};KR.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=X.fromName(i.componentType)),Eae(this,e,t,n,this.featuresLength,i.byteOffset)):O8e(this,e,t,i)};KR.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var ih=KR;function ZR(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=y(e.parseAsPropertyAttributes,!1),r=e.customAttributeOutput,s=M8e(n),a;l(s.jsonProperties)&&(a=new a_({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new Zx({extension:s.hierarchy,binaryBody:i}));let u=Zd.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(o){let b=N8e(t,u,f,i,r);g=b.transcodedSchema,p=[new xb({propertyAttribute:b.propertyAttributeJson,class:b.transcodedClass})]}else{let b=L8e(t,u,f,i);g=b.transcodedSchema;let T=b.featureTableJson;d=new Bl({count:T.count,properties:T.properties,class:b.transcodedClass,bufferViews:b.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(a)||l(c)){let b=new nl({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});m.push(b)}let x={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new qs(x)}function M8e(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(ZR._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function L8e(e,t,n,i){let o={},r={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new re(`Property ${d} requires a batch table binary.`);let p=n[d],g=Au(p);r[d]={bufferView:a},o[d]=Sae(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let u=vu.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function N8e(e,t,n,i,o){let r={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new re(`Property ${d} requires a batch table binary.`);let g=Xt.sanitizeGlslIdentifier(d);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=Sae(p);m.name=d,r[g]=m;let x=g.toUpperCase();x.startsWith("_")||(x=`_${x}`);let b=p.typedArray;l(b)||(b=Au(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let T=new xn.Attribute;T.name=x,T.count=e,T.type=p.type;let C=X.fromTypedArray(b);(C===X.INT||C===X.UNSIGNED_INT||C===X.DOUBLE)&&(ZR._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${x}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),b=new Float32Array(b)),T.componentDatatype=X.fromTypedArray(b),T.typedArray=b,o.push(T),s[g]={attribute:x}}let c={classes:{}};c.classes[t]={properties:r};let u=vu.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function Sae(e){let t=F8e(e.componentType);return{type:e.type,componentType:t}}function F8e(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}ZR._deprecationWarning=ms;ZR._oneTimeWarning=gt;var h_=ZR;var Cb={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},B8e=xn.FeatureIdAttribute;function Cy(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,No.Y),u=y(e.forwardAxis,No.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadAttributesFor2D,!1),p=y(e.enablePick,!1),g=y(e.loadIndicesForWireframe,!1),m=y(e.loadPrimitiveOutline,!0),x=y(e.loadForClassification,!1);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=d,this._enablePick=p,this._loadIndicesForWireframe=g,this._loadPrimitiveOutline=m,this._loadForClassification=x,this._state=Cb.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(Cy.prototype=Object.create(Ki.prototype),Cy.prototype.constructor=Cy);Object.defineProperties(Cy.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Cy.prototype.load=function(){if(l(this._promise))return this._promise;let e=XR.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new ih(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(a)&&(this._transform=F.fromTranslation(h.fromArray(a))),this._batchTable={json:o,binary:r};let c=new l_({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=Cb.LOADING;let u=this;return this._promise=c.load().then(function(){if(!u.isDestroyed())return u._state=Cb.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return k8e(u,f)}),this._promise};function k8e(e,t){return e.unload(),e._state=Cb.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}Cy.prototype.process=function(e){if(this._state===Cb.READY)return!0;if(this._state!==Cb.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),V8e(this,n),this._components=n,this._arrayBuffer=void 0,this._state=Cb.READY,!0};function V8e(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=h_({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new nl({name:Zd.BATCH_TABLE_CLASS_NAME,count:i});o=new qs({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)vae(r[a]);t.structuralMetadata=o}function vae(e){let t=e.children.length;for(let i=0;i<t;i++)vae(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Xt.getAttributeBySemantic(o,Ct.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new B8e;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}Cy.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var $R=Cy;function Ay(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(Ay.prototype=Object.create(Ki.prototype),Ay.prototype.constructor=Ay);Object.defineProperties(Ay.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Ay.prototype.load=function(){return Promise.resolve(this)};Ay.prototype.process=function(e){return l(this._components)||(this._components=Q8e(this._geoJson,e),this._geoJson=void 0),!0};function U8e(){this.lines=void 0,this.points=void 0,this.properties=void 0}function z8e(){this.features=[]}function VW(e){let t=e[0],n=e[1],i=y(e[2],0);return new h(t,n,i)}function UW(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=VW(e[o]);return[n]}function H8e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=UW(e[i])[0];return n}function wae(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=UW(e[i])[0];return n}function G8e(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,wae(e[i]));return n}function W8e(e){return[VW(e)]}function j8e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=VW(e[i]);return n}var q8e={LineString:UW,MultiLineString:H8e,MultiPolygon:G8e,Polygon:wae,MultiPoint:j8e,Point:W8e},Y8e={LineString:Me.LINES,MultiLineString:Me.LINES,MultiPolygon:Me.LINES,Polygon:Me.LINES,MultiPoint:Me.POINTS,Point:Me.POINTS};function Dae(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=q8e[n],o=Y8e[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new U8e;o===Me.LINES?s.lines=i(r):o===Me.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function X8e(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Dae(n[o],t)}var K8e={FeatureCollection:X8e,Feature:Dae},rz=new h;function Z8e(e,t,n){let i=0,o=0,r=e.length;for(let M=0;M<r;M++){let N=e[M];if(l(N.lines)){let _=N.lines.length;for(let S=0;S<_;S++){let w=N.lines[S];i+=w.length,o+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ne.createTypedArray(i,o),u=Ne.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let M=0;M<r;M++){let N=e[M];if(!l(N.lines))continue;let _=N.lines.length;for(let S=0;S<_;S++){let w=N.lines[S],I=w.length;for(let L=0;L<I;L++){let B=w[L],U=h.fromDegrees(B.x,B.y,B.z,ee.WGS84,rz),V=F.multiplyByPoint(t,U,rz);h.minimumByComponent(f,V,f),h.maximumByComponent(d,V,d),h.pack(V,s,p*3),a[p]=M,L<I-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let m=_t.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});m.vertexArrayDestroyable=!1;let x=_t.createVertexBuffer({typedArray:a,context:n.context,usage:Fe.STATIC_DRAW});x.vertexArrayDestroyable=!1;let b=_t.createIndexBuffer({typedArray:c,context:n.context,usage:Fe.STATIC_DRAW,indexDatatype:u});b.vertexArrayDestroyable=!1;let T=new xn.Attribute;T.semantic=Ct.POSITION,T.componentDatatype=X.FLOAT,T.type=tn.VEC3,T.count=i,T.min=f,T.max=d,T.buffer=m;let C=new xn.Attribute;C.semantic=Ct.FEATURE_ID,C.setIndex=0,C.componentDatatype=X.FLOAT,C.type=tn.SCALAR,C.count=i,C.buffer=x;let A=[T,C],E=new xn.Material;E.unlit=!0;let v=new xn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=b;let D=new xn.FeatureIdAttribute;D.featureCount=r,D.propertyTableId=0,D.setIndex=0,D.positionalLabel="featureId_0";let O=[D],R=new xn.Primitive;return R.attributes=A,R.indices=v,R.featureIds=O,R.primitiveType=Me.LINES,R.material=E,R}function $8e(e,t,n){let i=0,o=e.length;for(let A=0;A<o;A++){let E=e[A];l(E.points)&&(i+=E.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let A=0;A<o;A++){let E=e[A];if(!l(E.points))continue;let v=E.points.length;for(let D=0;D<v;D++){let O=E.points[D],R=h.fromDegrees(O.x,O.y,O.z,ee.WGS84,rz),M=F.multiplyByPoint(t,R,rz);h.minimumByComponent(a,M,a),h.maximumByComponent(c,M,c),h.pack(M,r,u*3),s[u]=A,u++}}let f=_t.createVertexBuffer({typedArray:r,context:n.context,usage:Fe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=_t.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new xn.Attribute;p.semantic=Ct.POSITION,p.componentDatatype=X.FLOAT,p.type=tn.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new xn.Attribute;g.semantic=Ct.FEATURE_ID,g.setIndex=0,g.componentDatatype=X.FLOAT,g.type=tn.SCALAR,g.count=i,g.buffer=d;let m=[p,g],x=new xn.Material;x.unlit=!0;let b=new xn.FeatureIdAttribute;b.featureCount=o,b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0";let T=[b],C=new xn.Primitive;return C.attributes=m,C.featureIds=T,C.primitiveType=Me.POINTS,C.material=x,C}function Q8e(e,t){let n=new z8e,i=K8e[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new re("GeoJSON must have at least one feature");let s={};for(let M=0;M<r;M++){let N=o[M],_=y(N.properties,y.EMPTY_OBJECT);for(let S in _)_.hasOwnProperty(S)&&(l(s[S])||(s[S]=new Array(r)))}for(let M=0;M<r;M++){let N=o[M];for(let _ in s)if(s.hasOwnProperty(_)){let S=y(N.properties[_],"");s[_][M]=S}}let a=new a_({count:r,properties:s}),u=[new nl({id:0,count:r,jsonMetadataTable:a})],f=vu.fromJson({}),d=new qs({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,x=!1;for(let M=0;M<r;M++){let N=o[M];if(l(N.lines)){m=!0;let _=N.lines.length;for(let S=0;S<_;S++){let w=N.lines[S],I=w.length;for(let L=0;L<I;L++)h.minimumByComponent(p,w[L],p),h.maximumByComponent(g,w[L],g)}}if(l(N.points)){x=!0;let _=N.points.length;for(let S=0;S<_;S++){let w=N.points[S];h.minimumByComponent(p,w,p),h.maximumByComponent(g,w,g)}}}let b=h.midpoint(p,g,new h),T=h.fromDegrees(b.x,b.y,b.z,ee.WGS84,new h),C=Ot.eastNorthUpToFixedFrame(T,ee.WGS84,new F),A=F.inverseTransformation(C,new F),E=[];m&&E.push(Z8e(o,A,t)),x&&E.push($8e(o,A,t));let v=new xn.Node;v.index=0,v.primitives=E;let D=[v],O=new xn.Scene;O.nodes=D;let R=new xn.Components;return R.scene=O,R.nodes=D,R.transform=C,R.structuralMetadata=d,R}Ay.prototype.unload=function(){this._components=void 0};var QR=Ay;var sz={};sz._deprecationWarning=ms;var Ey=Uint32Array.BYTES_PER_ELEMENT;sz.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Ey;let r=o.getUint32(t,!0);if(r!==1)throw new re(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=Ey;let s=o.getUint32(t,!0);t+=Ey;let a=o.getUint32(t,!0);if(a===0)throw new re("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Ey;let c=o.getUint32(t,!0);t+=Ey;let u=o.getUint32(t,!0);t+=Ey;let f=o.getUint32(t,!0);t+=Ey;let d=o.getUint32(t,!0);if(d!==1&&d!==0)throw new re(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=Ey;let p=Fo(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,x;u>0&&(m=Fo(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new re("glTF byte length must be greater than 0.");let T;return t%4===0?T=new Uint8Array(e,t,b):(sz._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),T=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:x,gltf:T}};var JR=sz;var m_={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},az=xn.Attribute,J8e=xn.FeatureIdAttribute,Pae=xn.Instances;function p_(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,No.Y),u=y(e.forwardAxis,No.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.enablePick,!1);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=m_.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(p_.prototype=Object.create(Ki.prototype),p_.prototype.constructor=p_);Object.defineProperties(p_.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});p_.prototype.load=function(){if(l(this._promise))return this._promise;let e=JR.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new ih(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new re("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(c)&&(this._transform=F.fromTranslation(h.fromArray(c))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let d=Ll(e.gltf);d=d.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:d});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new l_(u);return this._gltfLoader=f,this._state=m_.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=m_.PROCESSING,this}).catch(d=>{if(!this.isDestroyed())throw eGe(this,d)}),this._promise};function eGe(e,t){return e.unload(),e._state=m_.FAILED,e.getError("Failed to load i3dm",t)}p_.prototype.process=function(e){if(this._state===m_.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===m_.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),iGe(this,i,e),tGe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=m_.READY,!0};function tGe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=h_({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new nl({name:Zd.BATCH_TABLE_CLASS_NAME,count:i});o=new qs({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var cz=new h,zW=new Array(4),nGe=new F;function iGe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",X.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=rGe(o,r),d;c&&(d=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let g=new Float32Array(r),m=h.unpackArray(f),x=new h,b=new h,T=new h,C=new h,A=new $,E=new Oe,v=new Array(4),D=new h,O=new Array(3),R=new F;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let V=ae.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],V.center,cz),f[3*i+0]=cz.x,f[3*i+1]=cz.y,f[3*i+2]=cz.z;let G=F.fromTranslation(V.center,nGe);t.transform=F.multiplyTransformation(G,t.transform,t.transform)}for(i=0;i<r;i++){x=h.clone(m[i]),l(s)&&h.add(x,h.unpack(s),x),c&&(sGe(o,a,i,E,x,T,b,C,A,R),Oe.pack(E,v,0),d[4*i+0]=v[0],d[4*i+1]=v[1],d[4*i+2]=v[2],d[4*i+3]=v[3]),u&&(aGe(o,i,D),h.pack(D,O,0),p[3*i+0]=O[0],p[3*i+1]=O[1],p[3*i+2]=O[2]);let V=o.getProperty("BATCH_ID",X.UNSIGNED_SHORT,1,i);l(V)||(V=i),g[i]=V}let M=new Pae;M.transformInWorldSpace=!0;let N=e._buffers,_=new az;if(_.name="Instance Translation",_.semantic=os.TRANSLATION,_.componentDatatype=X.FLOAT,_.type=tn.VEC3,_.count=r,_.typedArray=f,!c){let V=_t.createVertexBuffer({context:n.context,typedArray:f,usage:Fe.STATIC_DRAW});V.vertexArrayDestroyable=!1,N.push(V),_.buffer=V}if(M.attributes.push(_),c){let V=new az;V.name="Instance Rotation",V.semantic=os.ROTATION,V.componentDatatype=X.FLOAT,V.type=tn.VEC4,V.count=r,V.typedArray=d,M.attributes.push(V)}if(u){let V=new az;if(V.name="Instance Scale",V.semantic=os.SCALE,V.componentDatatype=X.FLOAT,V.type=tn.VEC3,V.count=r,c)V.typedArray=p;else{let G=_t.createVertexBuffer({context:n.context,typedArray:p,usage:Fe.STATIC_DRAW});G.vertexArrayDestroyable=!1,N.push(G),V.buffer=G}M.attributes.push(V)}let S=new az;S.name="Instance Feature ID",S.setIndex=0,S.semantic=os.FEATURE_ID,S.componentDatatype=X.FLOAT,S.type=tn.SCALAR,S.count=r;let w=_t.createVertexBuffer({context:n.context,typedArray:g,usage:Fe.STATIC_DRAW});w.vertexArrayDestroyable=!1,N.push(w),S.buffer=w,M.attributes.push(S);let I=new J8e;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",M.featureIds.push(I);let L=t.nodes,B=L.length,U=!1;for(i=0;i<B;i++){let V=L[i];V.primitives.length>0&&(V.instances=U?oGe(M):M,U=!0)}}function oGe(e){let t=new Pae;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Ge(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function rGe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",X.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(i))throw new re("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(o))throw new re("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new re("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Iae=new Array(4);function sGe(e,t,n,i,o,r,s,a,c,u){let f=e.getProperty("NORMAL_UP",X.FLOAT,3,n,zW),d=e.getProperty("NORMAL_RIGHT",X.FLOAT,3,n,Iae),p=!1;if(l(f)){if(!l(d))throw new re("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,r),h.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",X.UNSIGNED_SHORT,2,n,zW),m=e.getProperty("NORMAL_RIGHT_OCT32P",X.UNSIGNED_SHORT,2,n,Iae);if(l(g)){if(!l(m))throw new re("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Mn.octDecodeInRange(g[0],g[1],65535,r),Mn.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(Ot.eastNorthUpToFixedFrame(o,ee.WGS84,u),F.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,r,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,r,c),$.setColumn(c,2,a,c)),Oe.fromRotationMatrix(c,i)}function aGe(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",X.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",X.FLOAT,3,t,zW);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function cGe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}p_.prototype.isUnloaded=function(){return this._state===m_.UNLOADED};p_.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),cGe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=m_.UNLOADED};var eO=p_;var lGe={STOPPED:0,ANIMATING:1},oh=Object.freeze(lGe);function YA(){this.times=void 0,this.points=void 0,he.throwInstantiationError()}YA.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Oe)return Oe};YA.prototype.evaluate=he.throwInstantiationError;YA.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};YA.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};YA.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var oo=YA;function XA(e){this._value=e,this._valueType=oo.getPointType(e)}Object.defineProperties(XA.prototype,{value:{get:function(){return this._value}}});XA.prototype.findTimeInterval=function(e){};XA.prototype.wrapTime=function(e){return 0};XA.prototype.clampTime=function(e){return 0};XA.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var tO=XA;function KA(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=oo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(KA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});KA.prototype.findTimeInterval=oo.prototype.findTimeInterval;KA.prototype.wrapTime=oo.prototype.wrapTime;KA.prototype.clampTime=oo.prototype.clampTime;KA.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new h),h.lerp(n[o],n[o+1],r,t))};var Sy=KA;var Rae={};Rae.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new h,s[a]=new h;o[0]=n[0]/t[0],r[0]=h.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var ZA=Rae;var Oae=[],Mae=[],Lae=[],Nae=[];function uGe(e,t,n){let i=Oae,o=Lae,r=Mae,s=Nae;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),ZA.solve(i,r,o,s)}function fGe(e){let t=Oae,n=Lae,i=Mae,o=Nae;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r+1],e[r-1],s),h.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r],e[r-1],s),h.multiplyByScalar(s,3,s),ZA.solve(t,i,n,o)}function Hl(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=oo.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Hl.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});Hl.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Hl({times:t,points:n,inTangents:r,outTangents:o})};Hl.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new Sy({points:n,times:t});let i=fGe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Hl({times:t,points:n,inTangents:r,outTangents:o})};Hl.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=oo.getPointType(n[0]);if(n.length<3)return new Sy({points:n,times:t});let s=uGe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Hl({times:t,points:n,inTangents:c,outTangents:a})};Hl.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Hl.prototype.findTimeInterval=oo.prototype.findTimeInterval;var dGe=new oe,$A=new h;Hl.prototype.wrapTime=oo.prototype.wrapTime;Hl.prototype.clampTime=oo.prototype.clampTime;Hl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=dGe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=F.multiplyByVector(Hl.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,$A),d.add(t,$A,t),d.multiplyByScalar(r[s],f.z,$A),d.add(t,$A,t),d.multiplyByScalar(o[s],f.w,$A),d.add(t,$A,t))};var vy=Hl;function QA(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=oo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(QA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});QA.prototype.findTimeInterval=oo.prototype.findTimeInterval;QA.prototype.wrapTime=oo.prototype.wrapTime;QA.prototype.clampTime=oo.prototype.clampTime;QA.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var nO=QA;function hGe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Oe);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return Oe.fastSlerp(a,c,s,o)}}function JA(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=hGe(this),this._lastTimeIndex=0}Object.defineProperties(JA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});JA.prototype.findTimeInterval=oo.prototype.findTimeInterval;JA.prototype.wrapTime=oo.prototype.wrapTime;JA.prototype.clampTime=oo.prototype.clampTime;JA.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var iO=JA;var eE=xn.AnimatedPropertyType;function HW(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,yGe(this)}Object.defineProperties(HW.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function mGe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new vy({times:e,points:n,inTangents:i,outTangents:o})}function Fae(e,t,n,i){if(e.length===1&&t.length===1)return new tO(t[0]);switch(n){case th.STEP:return new nO({times:e,points:t});case th.CUBICSPLINE:return mGe(e,t);case th.LINEAR:return i===eE.ROTATION?new iO({times:e,points:t}):new Sy({times:e,points:t})}}function pGe(e,t,n,i,o){let r=[];if(i===eE.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(a),d=c;if(n===th.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+o],f[u+2]=t[d+2*o],d+=o*3;else for(u=0;u<a;u++)f[u]=t[d],d+=o;r.push(Fae(e,f,n,i))}}else r.push(Fae(e,t,n,i));return r}var _Ge=new h,gGe=new Oe;function yGe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=pGe(i,o,r,a,u);e._splines=f,e._path=a}HW.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===eE.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===eE.TRANSLATION||n===eE.SCALE?o[n]=r.evaluate(s,_Ge):n===eE.ROTATION&&(o[n]=r.evaluate(s,gGe))}}};var oO=HW;function GW(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=Z.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=Z.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,zl.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new pe,this.update=new pe,this.stop=new pe,this._state=oh.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,xGe(this)}Object.defineProperties(GW.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function xGe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let u=r[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new oO({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}GW.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var rO=GW;function __(e){this.animationAdded=new pe,this.animationRemoved=new pe,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(__.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function WW(e,t,n){let i=e._model,o=new rO(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}__.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return WW(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return WW(this,n[i],e)};__.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=WW(this,n[r],e);i.push(s)}return i};__.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};__.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};__.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};__.prototype.get=function(e){return this._runtimeAnimations[e]};var lz=[];function bGe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}__.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&Z.equals(e.time,this._previousTime))return!1;this._previousTime=Z.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=Z.addSeconds(y(a.startTime,o),a.delay,new Z)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=Z.lessThanOrEquals(c,o),p=l(f)&&Z.greaterThan(o,f),g=0;if(u!==0){let b=Z.secondsDifference(p?f:o,c);g=l(a._animationTime)?a._animationTime(u,b):b/u}let m=a.loop===zl.REPEAT||a.loop===zl.MIRRORED_REPEAT,x=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let b=a._state===oh.STOPPED;if(x!==b)continue}if(a._prevAnimationDelta=g,x||a._state===oh.ANIMATING){if(x&&a._state===oh.STOPPED&&(a._state=oh.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===zl.REPEAT)g=g-Math.floor(g);else if(a.loop===zl.MIRRORED_REPEAT){let T=Math.floor(g),C=g-T;g=T%2===1?1-C:C}a.reverse&&(g=1-g);let b=g*u*a.multiplier;b=P.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=oh.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&lz.push(a))}}n=lz.length;for(let s=0;s<n;++s){let a=lz[s];t.splice(t.indexOf(a),1),e.afterRender.push(bGe(this,r,a))}return lz.length=0,i};var sO=__;function Ab(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(Ab.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new H),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});Ab.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};Ab.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};Ab.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};Ab.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};Ab.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var aO=Ab;var cO={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};cO.getStyleCommandsNeeded=function(e,t){return t===0?cO.ALL_OPAQUE:t===e?cO.ALL_TRANSLUCENT:cO.OPAQUE_AND_TRANSLUCENT};var rh=Object.freeze(cO);var wy={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};wy.is3DTiles=function(e){switch(e){case wy.TILE_GLTF:case wy.TILE_B3DM:case wy.TILE_I3DM:case wy.TILE_PNTS:case wy.TILE_GEOJSON:return!0;case wy.GLTF:return!1}};var fr=Object.freeze(wy);function zr(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=rh.ALL_OPAQUE,TGe(this)}Object.defineProperties(zr.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function TGe(e){let t=e._model,n=fr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new Ws(s,o)}else for(o=0;o<i;o++)r[o]=new aO({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new el({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}zr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=rh.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};zr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};zr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};zr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};zr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};zr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};zr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};zr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};zr.prototype.getFeature=function(e){return this._features[e]};zr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};zr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};zr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};zr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};zr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};zr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};zr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};zr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};zr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var CGe=new H;zr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(el.DEFAULT_COLOR_VALUE),this.setAllShow(el.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,CGe),el.DEFAULT_COLOR_VALUE):el.DEFAULT_COLOR_VALUE,o=l(e.show)?y(e.show.evaluate(n),el.DEFAULT_SHOW_VALUE):el.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};zr.prototype.isDestroyed=function(){return!1};zr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var lO=zr;var Bae={name:"TilesetPipelineStage"};Bae.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,_e.FRAGMENT);let r={u_polygonOffset:function(){return z.ZERO}};e.uniformMap=xt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Vt.setCesium3DTileBit(),i.stencilMask=Vt.CESIUM_3D_TILE_MASK};var uO=Bae;var fO=`// robust iterative solution without trig functions +// https://github.com/0xfaded/ellipse_demo/issues/1 +// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse +// +// This version uses only a single iteration for best performance. For fog +// rendering, the difference is negligible. +vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) { + vec2 p = abs(pos); + vec2 inverseRadii = 1.0 / radii; + vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii; + + // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t)) + // but store the cos and sin of t in a vec2 for efficiency. + // Initial guess: t = cos(pi/4) + vec2 tTrigs = vec2(0.70710678118); + vec2 v = radii * tTrigs; + + // Find the evolute of the ellipse (center of curvature) at v. + vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs; + // Find the (approximate) intersection of p - evolute with the ellipsoid. + vec2 q = normalize(p - evolute) * length(v - evolute); + // Update the estimate of t. + tTrigs = (q + evolute) * inverseRadii; + tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); + v = radii * tTrigs; + + return v * sign(pos); +} + +vec3 computeEllipsoidPositionWC(vec3 positionMC) { + // Get the world-space position and project onto a meridian plane of + // the ellipsoid + vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; + + vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z); + vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz); + + // Reconstruct a 3D point in world space + return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y); +} + +void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) { + + vec3 fogColor = groundAtmosphereColor.rgb; + + // If there is dynamic lighting, apply that to the fog. + const float NONE = 0.0; + if (czm_atmosphereDynamicLighting != NONE) { + float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0); + fogColor *= darken; + } + + // Tonemap if HDR rendering is disabled + #ifndef HDR + fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); + fogColor.rgb = czm_inverseGamma(fogColor.rgb); + #endif + + vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar); + color = vec4(withFog, color.a); +} + +void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) { + vec3 rayleighColor; + vec3 mieColor; + float opacity; + + vec3 positionWC; + vec3 lightDirection; + + // When the camera is in space, compute the position per-fragment for + // more accurate ground atmosphere. All other cases will use + // + // The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717 + if (false) { + positionWC = computeEllipsoidPositionWC(attributes.positionMC); + lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); + + // The fog color is derived from the ground atmosphere color + czm_computeGroundAtmosphereScattering( + positionWC, + lightDirection, + rayleighColor, + mieColor, + opacity + ); + } else { + positionWC = attributes.positionWC; + lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); + rayleighColor = v_atmosphereRayleighColor; + mieColor = v_atmosphereMieColor; + opacity = v_atmosphereOpacity; + } + + //color correct rayleigh and mie colors + const bool ignoreBlackPixels = true; + rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels); + mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels); + + vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); + + if (u_isInFog) { + float distanceToCamera = length(attributes.positionEC); + applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); + } else { + // Ground atmosphere + } +} +`;var dO=`void atmosphereStage(ProcessedAttributes attributes) { + vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); + + czm_computeGroundAtmosphereScattering( + // This assumes the geometry stage came before this. + v_positionWC, + lightDirection, + v_atmosphereRayleighColor, + v_atmosphereMieColor, + v_atmosphereOpacity + ); +} +`;var kae={name:"AtmospherePipelineStage"};kae.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,_e.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,_e.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([dO]),i.addFragmentLines([fO]),i.addUniform("bool","u_isInFog",_e.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=h.distance(n.camera.positionWC,t.boundingSphere.center);return P.fog(o,n.fog.density)>P.EPSILON3}};var hO=kae;var mO=`#ifdef DIFFUSE_IBL +vec3 sampleDiffuseEnvironment(vec3 cubeDir) +{ + #ifdef CUSTOM_SPHERICAL_HARMONICS + return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); + #else + return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); + #endif +} +#endif + +#ifdef SPECULAR_IBL +vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) +{ + #ifdef CUSTOM_SPECULAR_IBL + float lod = roughness * model_specularEnvironmentMapsMaximumLOD; + return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; + #else + float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; + return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; + #endif +} +vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) +{ + // see https://bruop.github.io/ibl/ at Single Scattering Results + // Roughness dependent fresnel, from Fdez-Aguera + vec3 f90 = max(vec3(1.0 - roughness), f0); + vec3 F = fresnelSchlick2(f0, f90, NdotV); + + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); + + return specularSample * (F * brdfLut.x + brdfLut.y); +} +#endif + +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +/** + * Compute the light contributions from environment maps and spherical harmonic coefficients. + * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation + * of the single- and multi-scattering terms. + * + * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position. + * @param {vec3} normalEC The surface normal in eye coordinates. + * @param {czm_modelMaterial} The material properties. + * @return {vec3} The computed HDR color. + */ +vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { + vec3 f0 = material.specular; + float roughness = material.roughness; + float specularWeight = 1.0; + #ifdef USE_SPECULAR + specularWeight = material.specularWeight; + #endif + float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); + + // see https://bruop.github.io/ibl/ at Single Scattering Results + // Roughness dependent fresnel, from Fdez-Aguera + vec3 f90 = max(vec3(1.0 - roughness), f0); + vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); + + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); + + #ifdef DIFFUSE_IBL + vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); + vec3 irradiance = sampleDiffuseEnvironment(normalMC); + + vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; + float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); + vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); + vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; + vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; + #else + vec3 diffuseContribution = vec3(0.0); + #endif + + #ifdef USE_ANISOTROPY + // Bend normal to account for anisotropic distortion of specular reflection + vec3 anisotropyDirection = material.anisotropicB; + vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); + vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); + float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); + float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; + vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); + vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); + #else + vec3 reflectEC = reflect(-viewDirectionEC, normalEC); + #endif + + #ifdef SPECULAR_IBL + vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); + vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); + vec3 specularContribution = radiance * FssEss * model_iblFactor.y; + #else + vec3 specularContribution = vec3(0.0); + #endif + + return diffuseContribution + specularContribution; +} +#endif +`;var Vae={name:"ImageBasedLightingPipelineStage"},AGe=new z;Vae.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,_e.FRAGMENT),r.addUniform("vec2","model_iblFactor",_e.FRAGMENT),jd.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",_e.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,_e.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,_e.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,_e.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",_e.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,_e.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,_e.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,_e.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",_e.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",_e.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,_e.FRAGMENT)),r.addFragmentLines(mO);let c={model_iblFactor:function(){return z.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,AGe)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=xt(c,e.uniformMap)};var pO=Vae;var EGe=P.EPSILON16;function qW(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(qW.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,EGe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var SGe=new h,jW=new $;qW.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=SGe,o;switch(t){case _c.XROTATE:o=$.fromRotationX(P.toRadians(n),jW),e=F.multiplyByMatrix3(e,o,e);break;case _c.YROTATE:o=$.fromRotationY(P.toRadians(n),jW),e=F.multiplyByMatrix3(e,o,e);break;case _c.ZROTATE:o=$.fromRotationZ(P.toRadians(n),jW),e=F.multiplyByMatrix3(e,o,e);break;case _c.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case _c.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case _c.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case _c.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case _c.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case _c.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case _c.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var _O=qW;function uz(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,vGe(this)}Object.defineProperties(uz.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function vGe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new _O({stage:a,runtimeArticulation:e});o.push(c);let u=a.name;r[u]=c}}uz.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var wGe=new F,DGe=new F;uz.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,wGe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=F.multiplyTransformation(s.originalTransform,e,DGe);s.transform=a}};var gO=uz;var yO=`void modelColorStage(inout czm_modelMaterial material) +{ + material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend); + float highlight = ceil(model_colorBlend); + material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight); + material.alpha *= model_color.a; +} +`;var tE={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};tE.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,_e.FRAGMENT),i.addFragmentLines(yO);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=we.TRANSLUCENT),i.addUniform("vec4",tE.COLOR_UNIFORM_NAME,_e.FRAGMENT),o[tE.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",tE.COLOR_BLEND_UNIFORM_NAME,_e.FRAGMENT),o[tE.COLOR_BLEND_UNIFORM_NAME]=function(){return pc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=xt(o,e.uniformMap)};var Dy=tE;var xO=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE +vec4 getClippingPlane( + highp sampler2D packedClippingPlanes, + int clippingPlaneNumber, + mat4 transform +) { + int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; + int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); + float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel + float v = (float(pixY) + 0.5) * pixelHeight; + vec4 plane = texture(packedClippingPlanes, vec2(u, v)); + return czm_transformPlane(plane, transform); +} +#else +// Handle uint8 clipping texture instead +vec4 getClippingPlane( + highp sampler2D packedClippingPlanes, + int clippingPlaneNumber, + mat4 transform +) { + int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each + int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; + int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); + float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel + float v = (float(pixY) + 0.5) * pixelHeight; + vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; + vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); + vec4 plane; + plane.xyz = czm_octDecode(oct, 65535.0); + plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); + return czm_transformPlane(plane, transform); +} +#endif + +float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { + vec4 position = czm_windowToEyeCoordinates(fragCoord); + vec3 clipNormal = vec3(0.0); + vec3 clipPosition = vec3(0.0); + float pixelWidth = czm_metersPerPixel(position); + + #ifdef UNION_CLIPPING_REGIONS + float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below. + #else + float clipAmount = 0.0; + bool clipped = true; + #endif + + for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { + vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); + clipNormal = clippingPlane.xyz; + clipPosition = -clippingPlane.w * clipNormal; + float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; + + #ifdef UNION_CLIPPING_REGIONS + clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); + if (amount <= 0.0) { + discard; + } + #else + clipAmount = max(amount, clipAmount); + clipped = clipped && (amount <= 0.0); + #endif + } + + #ifndef UNION_CLIPPING_REGIONS + if (clipped) { + discard; + } + #endif + + return clipAmount; +} + +void modelClippingPlanesStage(inout vec4 color) +{ + float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); + vec4 clippingPlanesEdgeColor = vec4(1.0); + clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; + float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; + + if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { + color = clippingPlanesEdgeColor; + } +} +`;var Uae={name:"ModelClippingPlanesPipelineStage"},IGe=new z;Uae.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,_e.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,_e.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,_e.FRAGMENT),gs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,_e.FRAGMENT);let s=gs.getTextureResolution(i,o,IGe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,_e.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,_e.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",_e.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",_e.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",_e.FRAGMENT),r.addFragmentLines(xO);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=H.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=xt(a,e.uniformMap)};var bO=Uae;var TO=`void modelClippingPolygonsStage(ProcessedAttributes attributes) +{ + vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC); + sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); + + vec2 minDistance = vec2(czm_infinity); + v_regionIndex = -1; + v_clippingPosition = vec2(czm_infinity); + + for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) { + vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex); + vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz; + + vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0)); + vec2 distance = abs(rectUv - clamped) * extents.wz; + + if (minDistance.x > distance.x || minDistance.y > distance.y) { + minDistance = distance; + v_clippingPosition = rectUv; + } + + float threshold = 0.01; + if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) { + v_regionIndex = regionIndex; + } + } +} +`;var CO=`void modelClippingPolygonsStage() +{ + vec2 clippingPosition = v_clippingPosition; + int regionIndex = v_regionIndex; + czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); +} +`;var zae={name:"ModelClippingPolygonsPipelineStage"};zae.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,_e.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,_e.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,_e.BOTH),o.addUniform("sampler2D","model_clippingDistance",_e.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",_e.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(TO),o.addFragmentLines(CO);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=xt(r,e.uniformMap)};var AO=zae;function Hae(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Hae.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var EO=Hae;var SO=`mat4 getInstancingTransform() +{ + mat4 instancingTransform; + + #ifdef HAS_INSTANCE_MATRICES + instancingTransform = mat4( + a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 + a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 + a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 + a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation = a_instanceTranslation; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif + + instancingTransform = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation.x, translation.y, translation.z, 1.0 + ); + #endif + + return instancingTransform; +} + +#ifdef USE_2D_INSTANCING +mat4 getInstancingTransform2D() +{ + mat4 instancingTransform2D; + + #ifdef HAS_INSTANCE_MATRICES + instancingTransform2D = mat4( + a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 + a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 + a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 + a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation2D = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation2D = a_instanceTranslation2D; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif + + instancingTransform2D = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation2D.x, translation2D.y, translation2D.z, 1.0 + ); + #endif + + return instancingTransform2D; +} +#endif +`;var vO=`void instancingStage(inout ProcessedAttributes attributes) +{ + vec3 positionMC = attributes.positionMC; + + mat4 instancingTransform = getInstancingTransform(); + + attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; + + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; + #endif + + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var wO=`void legacyInstancingStage( + inout ProcessedAttributes attributes, + out mat4 instanceModelView, + out mat3 instanceModelViewInverseTranspose) +{ + vec3 positionMC = attributes.positionMC; + + mat4 instancingTransform = getInstancingTransform(); + + mat4 instanceModel = instancingTransform * u_instance_nodeTransform; + instanceModelView = u_instance_modifiedModelView; + instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); + + attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; + + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var fz=new F,PGe=new F,RGe=new F,Wae={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Kae,_transformsToTypedArray:XW};Wae.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(SO);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,d=[];qGe(e,n,i,d,u,f),KGe(e,n,i,d);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,_e.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",_e.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",_e.VERTEX),p.u_instance_modifiedModelView=function(){let g=F.multiplyTransformation(s.modelMatrix,a.components.transform,fz);return u?F.multiplyTransformation(n.context.uniformState.view3D,g,fz):(n.mode!==ne.SCENE3D&&(g=Ot.basisTo2D(n.mapProjection,g,fz)),F.multiplyTransformation(n.context.uniformState.view,g,fz))},p.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,PGe)},r.addVertexLines(wO)):r.addVertexLines(vO),u){r.addDefine("USE_2D_INSTANCING",void 0,_e.VERTEX),r.addUniform("mat4","u_modelView2D",_e.VERTEX);let g=n.context,m=F.fromTranslation(c.instancingReferencePoint2D,new F);p.u_modelView2D=function(){return F.multiplyTransformation(g.uniformState.view,m,RGe)}}e.uniformMap=xt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,d)};var DO=new F,OGe=new h;function MGe(e,t,n,i,o){let r=F.multiplyTransformation(t,e,DO);return r=F.multiplyTransformation(r,n,DO),o=Ot.basisTo2D(i.mapProjection,r,o),o}function LGe(e,t,n,i,o){let r=F.fromTranslation(e,DO),s=F.multiplyTransformation(t,r,DO);s=F.multiplyTransformation(s,n,DO);let a=F.getTranslation(s,OGe);return o=Hi.computeActualEllipsoidPosition(i,a,o),o}function jae(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=F.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(o.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var qae=new F,Yae=new F,NGe=new F,FGe=new h;function BGe(e,t,n,i){let o=qae,r=Yae;jae(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=MGe(f,o,r,n,NGe),p=F.getTranslation(d,FGe),g=h.subtract(p,a,p);i[u]=F.setTranslation(d,g,i[u])}return i}function kGe(e,t,n,i){let o=qae,r=Yae;jae(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=LGe(f,o,r,n,f);i[u]=h.subtract(d,a,i[u])}return i}var VGe=new h,UGe=new h;function Xae(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=F.multiplyByPoint(i,n.instancingTranslationMin,VGe),r=Hi.computeActualEllipsoidPosition(t,o,o),s=F.multiplyByPoint(i,n.instancingTranslationMax,UGe),a=Hi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(r,a,.5,new h)}function XW(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function zGe(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var HGe=new h,GGe=new Oe,WGe=new h;function Kae(e,t,n){let i=new Array(t),o=Xt.getAttributeBySemantic(e,os.TRANSLATION),r=Xt.getAttributeBySemantic(e,os.ROTATION),s=Xt.getAttributeBySemantic(e,os.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),d=l(s),p=u?o.typedArray:new Float32Array(t*3),g=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(g=Mn.dequantize(g,r.componentDatatype,r.type,t));let m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let b=0;b<t;b++){let T=new h(p[b*3],p[b*3+1],p[b*3+2],HGe);h.maximumByComponent(a,T,a),h.minimumByComponent(c,T,c);let C=new Oe(g[b*4],g[b*4+1],g[b*4+2],f?g[b*4+3]:1,GGe),A=new h(m[b*3],m[b*3+1],m[b*3+2],WGe),E=F.fromTranslationQuaternionRotationScale(T,C,A,new F);i[b]=E}let x=n.runtimeNode;return x.instancingTranslationMin=c,x.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),d&&(s.typedArray=void 0),i}function jGe(e,t,n){let i=new Array(t),o=e.typedArray,r=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,h.minimumByComponent(r,u,r),h.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function KW(e,t){let n=_t.createVertexBuffer({context:t.context,typedArray:e,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function qGe(e,t,n,i,o,r){let s=Xt.getAttributeBySemantic(n,os.ROTATION);l(s)?YGe(e,n,i,t,o,r):XGe(e,n,i,t,o)}function YGe(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=Kae(t,a,e);let b=XW(d);p=KW(b,i),c._modelResources.push(p),r&&(u.transformsTypedArray=b),u.instancingTransformsBuffer=p}if(Gae(e,p,n,f),!o)return;let g=Ge(i);g.mode=ne.COLUMBUS_VIEW,Xae(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let b=BGe(d,e,g,d),T=XW(b);m=KW(T,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}Gae(e,m,n,"Transform2D")}function XGe(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=Xt.getAttributeBySemantic(t,os.TRANSLATION),u=Xt.getAttributeBySemantic(t,os.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),YW(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=jGe(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),YW(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let g=Ge(i);g.mode=ne.COLUMBUS_VIEW,Xae(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let C=kGe(f,e,g,f),A=zGe(C);r&&(a.transformsTypedArray=A),m=KW(A,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!o)return;YW(e,m,0,void 0,n,"Translation2D")}function Gae(e,t,n,i){let r=X.getSizeInBytes(X.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function YW(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function KGe(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===os.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:tn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var IO=Wae;var ZW={};ZW.name="ModelMatrixUpdateStage";ZW.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Zae(e,t,o,e.transformToRoot),e._transformDirty=!1}};function ZGe(e,t,n){e.modelMatrix=F.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Xt.getCullFace(e.modelMatrix,e.primitiveType)}function Zae(e,t,n,i){let o;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];ZGe(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=F.clone(i,a._transformToRoot),Zae(a,t,n,i),a._transformDirty=!1}}var PO=ZW;var $ae={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Qae,_countGeneratedBuffers:Jae};$ae.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;Qae(i,o),Jae(i,r)};function Qae(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function Jae(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var RO=$ae;function nE(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,$Ge(this)}Object.defineProperties(nE.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=F.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),$W(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Oe.equals(n,e)||(t.rotation=Oe.clone(e,t.rotation),$W(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),$W(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function $Ge(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new Jg(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function $W(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}nE.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};nE.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(IO),t.push(RO),n.push(PO)};nE.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};nE.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new F);let r=F.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=F.inverseTransformation(r,t[o]);t[o]=F.multiplyTransformation(s,n[o],t[o])}};var OO=nE;var ece={name:"AlphaPipelineStage"};ece.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=y(i.pass,o.opaquePass);let r=e.renderStateOptions;i.pass===we.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=ln.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,_e.FRAGMENT),s.addUniform("float","u_alphaCutoff",_e.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var MO=ece;var tce={name:"BatchTexturePipelineStage"};tce.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=xt(o,e.uniformMap)};var LO=tce;var nce={name:"ClassificationPipelineStage"};nce.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,_e.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||QGe(t,o)};function QGe(e,t){let n=Xt.getAttributeBySemantic(e,Ct.POSITION);if(!l(n))throw new re("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=Xt.getAttributeBySemantic(e,Ct.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=r?i[0]:0,p=c[d],g=0;for(let x=1;x<s;x++){let b=r?i[x]:x,T=c[b];if(T!==p){let C=x-g,A=x;u.push(C),f.push(A),g=A,p=T}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var NO=nce;var FO=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +{ + bool styleTranslucent = (featureColor.a != 1.0); + // Only render translucent features in the translucent pass (if the style or the original command has translucency). + if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) + { + // If the model has a translucent silhouette, it needs to render during the silhouette color command, + // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. + #ifdef HAS_SILHOUETTE + positionMC *= float(model_silhouettePass); + #else + positionMC *= 0.0; + #endif + } + // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. + else if (czm_pass != czm_passTranslucent && styleTranslucent) + { + positionMC *= 0.0; + } +} + +void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) +{ + float show = ceil(feature.color.a); + positionMC *= show; + + #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) + filterByPassType(positionMC, feature.color); + #endif +} +`;var BO=`void filterByPassType(vec4 featureColor) +{ + bool styleTranslucent = (featureColor.a != 1.0); + // Only render translucent features in the translucent pass (if the style or the original command has translucency). + if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) + { + // If the model has a translucent silhouette, it needs to render during the silhouette color command, + // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. + #ifdef HAS_SILHOUETTE + if(!model_silhouettePass) { + discard; + } + #else + discard; + #endif + } + // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. + else if (czm_pass != czm_passTranslucent && styleTranslucent) + { + discard; + } +} + +void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) +{ + vec4 featureColor = feature.color; + if (featureColor.a == 0.0) + { + discard; + } + + // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader. + // So, we only apply in in the fragment shader if the feature ID texture is used. + #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) + filterByPassType(featureColor); + #endif + + featureColor = czm_gammaCorrect(featureColor); + + // Classification models compute the diffuse differently. + #ifdef HAS_CLASSIFICATION + material.diffuse = featureColor.rgb * featureColor.a; + #else + float highlight = ceil(model_colorBlend); + material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); + #endif + + material.alpha *= featureColor.a; +} +`;var ice={name:"CPUStylingPipelineStage"};ice.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(FO),o.addFragmentLines(BO),o.addDefine("USE_CPU_STYLING",void 0,_e.BOTH),l(i.color)||(o.addUniform("float",Dy.COLOR_BLEND_UNIFORM_NAME,_e.FRAGMENT),e.uniformMap[Dy.COLOR_BLEND_UNIFORM_NAME]=function(){return pc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",_e.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===we.TRANSLUCENT}};var kO=ice;var oce={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};oce.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var g_=Object.freeze(oce);var VO=`void customShaderStage( + inout czm_modelVertexOutput vsOutput, + inout ProcessedAttributes attributes, + FeatureIds featureIds, + Metadata metadata, + MetadataClass metadataClass, + MetadataStatistics metadataStatistics +) { + // VertexInput and initializeInputStruct() are dynamically generated in JS, + // see CustomShaderPipelineStage.js + VertexInput vsInput; + initializeInputStruct(vsInput, attributes); + vsInput.featureIds = featureIds; + vsInput.metadata = metadata; + vsInput.metadataClass = metadataClass; + vsInput.metadataStatistics = metadataStatistics; + vertexMain(vsInput, vsOutput); + attributes.positionMC = vsOutput.positionMC; +} +`;var UO=`void customShaderStage( + inout czm_modelMaterial material, + ProcessedAttributes attributes, + FeatureIds featureIds, + Metadata metadata, + MetadataClass metadataClass, + MetadataStatistics metadataStatistics +) { + // FragmentInput and initializeInputStruct() are dynamically generated in JS, + // see CustomShaderPipelineStage.js + FragmentInput fsInput; + initializeInputStruct(fsInput, attributes); + fsInput.featureIds = featureIds; + fsInput.metadata = metadata; + fsInput.metadataClass = metadataClass; + fsInput.metadataStatistics = metadataStatistics; + fragmentMain(fsInput, material); +} +`;var zO=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { + initializeFeatureIds(featureIds, attributes); + initializeFeatureIdAliases(featureIds); +} +`;var HO=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +{ + initializeFeatureIds(featureIds, attributes); + initializeFeatureIdAliases(featureIds); + setFeatureIdVaryings(); +} +`;var Gi={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Gi.process=function(e,t,n){let i=e.shaderBuilder;JGe(i);let o=e.runtimeNode.node.instances;l(o)&&e5e(e,o,n),t5e(e,t,n),i.addVertexLines(HO),i.addFragmentLines(zO)};function JGe(e){e.addStruct(Gi.STRUCT_ID_FEATURE_IDS_VS,Gi.STRUCT_NAME_FEATURE_IDS,_e.VERTEX),e.addStruct(Gi.STRUCT_ID_FEATURE_IDS_FS,Gi.STRUCT_NAME_FEATURE_IDS,_e.FRAGMENT),e.addFunction(Gi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Gi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,_e.VERTEX),e.addFunction(Gi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Gi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,_e.FRAGMENT),e.addFunction(Gi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Gi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,_e.VERTEX),e.addFunction(Gi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Gi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,_e.FRAGMENT),e.addFunction(Gi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Gi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,_e.VERTEX)}function e5e(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof xn.FeatureIdAttribute?n5e(e,s,a):rce(e,s,a,o,1,n);let c=s.label;l(c)&&sce(e,a,c,_e.BOTH)}}function t5e(e,t,n){let i=t.featureIds,r=Xt.getAttributeBySemantic(t,Ct.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=_e.BOTH;a instanceof xn.FeatureIdAttribute?i5e(e,a,c):a instanceof xn.FeatureIdImplicitRange?rce(e,a,c,r,void 0,n):(o5e(e,a,c,s,n),u=_e.FRAGMENT);let f=a.label;l(f)&&sce(e,c,f,u)}}function n5e(e,t,n){let i=e.shaderBuilder;i.addStructField(Gi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Gi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Gi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function i5e(e,t,n){let i=e.shaderBuilder;i.addStructField(Gi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Gi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function rce(e,t,n,i,o,r){r5e(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Gi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Gi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Gi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function o5e(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return y(a.texture,o.context.defaultTexture)};let c=a.channels,u=e.shaderBuilder;u.addStructField(Gi.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,_e.FRAGMENT);let d=`v_texCoord_${a.texCoord}`,p=d,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let b=`${r}Transform`;u.addUniform("mat3",b,_e.FRAGMENT),s[b]=function(){return g},p=`vec2(${b} * vec3(${d}, 1.0))`}let m=`texture(${r}, ${p}).${c}`,x=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[x])}function sce(e,t,n,i){let o=e.shaderBuilder,r=_e.includesVertexShader(i);r&&o.addStructField(Gi.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Gi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function r5e(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let u=s5e(t,n);s=_t.createVertexBuffer({context:o.context,typedArray:u,usage:Fe.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:X.FLOAT,strideInBytes:X.getSizeInBytes(X.FLOAT),offsetInBytes:0};e.attributes.push(c)}function s5e(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var Iy=Gi;var GO=`void metadataStage( + out Metadata metadata, + out MetadataClass metadataClass, + out MetadataStatistics metadataStatistics, + ProcessedAttributes attributes + ) +{ + initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); +} +`;var WO=`void metadataStage( + out Metadata metadata, + out MetadataClass metadataClass, + out MetadataStatistics metadataStatistics, + ProcessedAttributes attributes + ) +{ + initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); + setMetadataVaryings(); +} +`;var vi={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};vi.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=a5e(r.propertyAttributes,t,a),u=l5e(r.propertyTextures,a),f=c.concat(u);f5e(i,f),m5e(i),i.addVertexLines(WO),i.addFragmentLines(GO);for(let d=0;d<c.length;d++){let p=c[d];p5e(e,p)}for(let d=0;d<u.length;d++){let p=u[d];g5e(e,p)}};function a5e(e,t,n){return l(e)?e.flatMap(i=>c5e(i,t,n)):[]}function c5e(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Xt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:m,variableName:x}=o(g);u[f]={metadataVariable:r(d),property:p,type:p.classProperty.type,glslType:m,variableName:x,propertyStatistics:a?.properties[d],shaderDestination:_e.BOTH}}return u}function l5e(e,t){return l(e)?e.flatMap(n=>u5e(n,t)):[]}function u5e(e,t){let{sanitizeGlslIdentifier:n}=Xt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,u]=r[a];s[a]={metadataVariable:n(c),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:_e.FRAGMENT}}return s}function f5e(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==ct.ENUM&&i.add(u)}let o=vi.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=vi.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,u){e.addStruct(a,a,_e.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?h5e(c):c;e.addStructField(a,p,d)}}}var d5e={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function h5e(e){let t=d5e[e];return l(t)?t:e}function m5e(e){e.addStruct(vi.STRUCT_ID_METADATA_VS,vi.STRUCT_NAME_METADATA,_e.VERTEX),e.addStruct(vi.STRUCT_ID_METADATA_FS,vi.STRUCT_NAME_METADATA,_e.FRAGMENT),e.addStruct(vi.STRUCT_ID_METADATA_CLASS_VS,vi.STRUCT_NAME_METADATA_CLASS,_e.VERTEX),e.addStruct(vi.STRUCT_ID_METADATA_CLASS_FS,vi.STRUCT_NAME_METADATA_CLASS,_e.FRAGMENT),e.addStruct(vi.STRUCT_ID_METADATA_STATISTICS_VS,vi.STRUCT_NAME_METADATA_STATISTICS,_e.VERTEX),e.addStruct(vi.STRUCT_ID_METADATA_STATISTICS_FS,vi.STRUCT_NAME_METADATA_STATISTICS,_e.FRAGMENT),e.addFunction(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,vi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,_e.VERTEX),e.addFunction(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,vi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,_e.FRAGMENT),e.addFunction(vi.FUNCTION_ID_SET_METADATA_VARYINGS,vi.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,_e.VERTEX)}function p5e(e,t){_5e(e,t),ace(e.shaderBuilder,t),cce(e.shaderBuilder,t)}function _5e(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=uce({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:_e.BOTH,property:o});n.addStructField(vi.STRUCT_ID_METADATA_VS,r,i),n.addStructField(vi.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function g5e(e,t){y5e(e,t),ace(e.shaderBuilder,t),cce(e.shaderBuilder,t)}function y5e(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:u,texture:f,transform:d}=s.textureReader,p=`u_propertyTexture_${u}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,_e.FRAGMENT),i[p]=()=>f),n.addStructField(vi.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,m=g;if(l(d)&&!$.equals(d,$.IDENTITY)){let A=`${p}Transform`;n.addUniform("mat3",A,_e.FRAGMENT),i[A]=function(){return d},m=`vec2(${A} * vec3(${g}, 1.0))`}let x=`texture(${p}, ${m}).${c}`,b=s.unpackInShader(x),T=uce({valueExpression:b,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:_e.FRAGMENT,property:s}),C=`metadata.${o} = ${T};`;n.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,[C])}function ace(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=lce(vi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(vi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),_e.includesVertexShader(r)&&(e.addStructField(vi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function cce(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===ct.ENUM)return;let s=vi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=lce(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(vi.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),_e.includesVertexShader(t.shaderDestination)&&(e.addStructField(vi.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function lce(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function uce(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,o,u),s.addUniform(c,r,u);let{offset:f,scale:d}=n;return a[o]=()=>f,a[r]=()=>d,`czm_valueTransform(${o}, ${r}, ${t})`}var Ff=vi;var x5e={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Py=Object.freeze(x5e);var ma={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:gt};ma.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Py.TRANSLUCENT?r.pass=we.TRANSLUCENT:c===Py.OPAQUE&&(r.pass=void 0);let u=w5e(s,t);if(!u.customShaderEnabled)return;if(R5e(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,_e.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,_e.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,_e.FRAGMENT);let p=g_.getDefineName(s.mode);i.addDefine(p,void 0,_e.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let d=s.varyings;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];i.addVarying(g,p)}e.uniformMap=xt(e.uniformMap,s.uniformMap)};function b5e(e){let t={};for(let n=0;n<e.length;n++){let i=Xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var T5e={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},C5e={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function fce(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=T5e[t],i=C5e[t];if(l(n))return{attributeField:[n,e],value:i}}function A5e(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=dce(t,n,!1),o=hce(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let f=[i[c].glslType,c];s.push(f),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let u=o[c],f=fce(u);if(!l(f))return ma._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${u}, disabling custom vertex shader`),{enabled:!1};s.push(f.attributeField),r=`vsInput.attributes.${u} = ${f.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function E5e(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function S5e(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=dce(t,n,!0),o=hce(t,n,!0),r,s=[],a=[];for(let u in i){if(!i.hasOwnProperty(u))continue;let d=[i[u].glslType,u];s.push(d),r=`fsInput.attributes.${u} = attributes.${u};`,a.push(r)}for(let u=0;u<o.length;u++){let f=o[u],d=fce(f);if(!l(d))return ma._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${f}, disabling custom fragment shader.`),{enabled:!1};s.push(d.attributeField),r=`fsInput.attributes.${f} = ${d.value};`,a.push(r)}let c=E5e(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var v5e={positionWC:!0,positionEC:!0};function dce(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function hce(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||v5e.hasOwnProperty(o))continue;let r=o;n&&o==="normalEC"?r="normalMC":n&&o==="tangentEC"&&(r="tangentMC"),e.hasOwnProperty(r)||i.push(o)}return i}function w5e(e,t){let n=b5e(t.attributes),i=A5e(e,n),o=S5e(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function D5e(e,t){let n=ma.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ma.STRUCT_NAME_ATTRIBUTES,_e.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=ma.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ma.STRUCT_NAME_VERTEX_INPUT,_e.VERTEX),e.addStructField(n,ma.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Iy.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Ff.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Ff.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Ff.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ma.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,ma.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,_e.VERTEX),e.addFunctionLines(r,o)}function I5e(e,t){let n=ma.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ma.STRUCT_NAME_ATTRIBUTES,_e.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=ma.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ma.STRUCT_NAME_FRAGMENT_INPUT,_e.FRAGMENT),e.addStructField(n,ma.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Iy.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Ff.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Ff.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Ff.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ma.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,ma.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,_e.FRAGMENT),e.addFunctionLines(r,o)}var P5e=[];function R5e(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=P5e;i.enabled&&(D5e(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,VO),e.addVertexLines(r)),o.enabled&&(I5e(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,UO),e.addFragmentLines(r))}var jO=ma;var qO={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};qO.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,_e.VERTEX),i.addFunction(qO.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,qO.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,_e.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===Ct.POSITION,d=c.semantic===Ct.TEXCOORD;if(r&&!f&&!d)continue;let p=Xt.getAttributeInfo(c);M5e(i,p),O5e(e,p)}};function O5e(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,_e.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,_e.VERTEX),n.addUniform(c,a,_e.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=mce(u,0),f=mce(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function mce(e,t){return e instanceof oe?e:new oe(e.x,e.y,e.z,t)}function M5e(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=L5e(n,i):o=N5e(n),e.addFunctionLines(qO.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function L5e(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function N5e(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var YO=qO;var XO=`void geometryStage(out ProcessedAttributes attributes) +{ + attributes.positionMC = v_positionMC; + attributes.positionEC = v_positionEC; + + #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) + attributes.positionWC = v_positionWC; + #endif + + #ifdef HAS_NORMALS + // renormalize after interpolation + attributes.normalEC = normalize(v_normalEC); + #endif + + #ifdef HAS_TANGENTS + attributes.tangentEC = normalize(v_tangentEC); + #endif + + #ifdef HAS_BITANGENTS + attributes.bitangentEC = normalize(v_bitangentEC); + #endif + + // Everything else is dynamically generated in GeometryPipelineStage + setDynamicVaryings(attributes); +} +`;var KO=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +{ + vec4 computedPosition; + + // Compute positions in different coordinate systems + vec3 positionMC = attributes.positionMC; + v_positionMC = positionMC; + v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; + + #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) + vec3 position2D = attributes.position2D; + vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; + computedPosition = czm_projection * vec4(positionEC, 1.0); + #else + computedPosition = czm_projection * vec4(v_positionEC, 1.0); + #endif + + // Sometimes the custom shader and/or style needs this + #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS) + // Note that this is a 32-bit position which may result in jitter on small + // scales. + v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; + #endif + + #ifdef HAS_NORMALS + v_normalEC = normalize(normal * attributes.normalMC); + #endif + + #ifdef HAS_TANGENTS + v_tangentEC = normalize(normal * attributes.tangentMC); + #endif + + #ifdef HAS_BITANGENTS + v_bitangentEC = normalize(normal * attributes.bitangentMC); + #endif + + // All other varyings need to be dynamically generated in + // GeometryPipelineStage + setDynamicVaryings(attributes); + + return computedPosition; +} +`;var iE=`vec2 computeSt(float featureId) +{ + float stepX = model_textureStep.x; + float centerX = model_textureStep.y; + + #ifdef MULTILINE_BATCH_TEXTURE + float stepY = model_textureStep.z; + float centerY = model_textureStep.w; + + float xId = mod(featureId, model_textureDimensions.x); + float yId = floor(featureId / model_textureDimensions.x); + + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); + #else + return vec2(centerX + (featureId * stepX), 0.5); + #endif +} + +void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) +{ + int featureId = featureIds.SELECTED_FEATURE_ID; + + + if (featureId < model_featuresLength) + { + vec2 featureSt = computeSt(float(featureId)); + + feature.id = featureId; + feature.st = featureSt; + feature.color = texture(model_batchTexture, featureSt); + } + // Floating point comparisons can be unreliable in GLSL, so we + // increment the feature ID to make sure it's always greater + // then the model_featuresLength - a condition we check for in the + // pick ID, to avoid sampling the pick texture if the feature ID is + // greater than the number of features. + else + { + feature.id = model_featuresLength + 1; + feature.st = vec2(0.0); + feature.color = vec4(1.0); + } + + #ifdef HAS_NULL_FEATURE_ID + if (featureId == model_nullFeatureId) { + feature.id = featureId; + feature.st = vec2(0.0); + feature.color = vec4(1.0); + } + #endif +} +`;var ZO={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};ZO.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=F5e(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),B5e(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===_e.BOTH&&i.addVertexLines(iE),i.addFragmentLines(iE)};function pce(e){return e instanceof xn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function _ce(e){return e instanceof xn.FeatureIdTexture?_e.FRAGMENT:_e.BOTH}function F5e(e,t,n){let i,o;return l(t.instances)&&(o=Xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:_ce(o),featureIdDefine:pce(o)}):(o=Xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:_ce(o),featureIdDefine:pce(o)})}function B5e(e){e.addStructField(ZO.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(ZO.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(ZO.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Ry=ZO;var Ys={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Ys.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",_e.VERTEX),i.addStruct(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",_e.FRAGMENT),i.addStruct(Ry.STRUCT_ID_SELECTED_FEATURE,Ry.STRUCT_NAME_SELECTED_FEATURE,_e.BOTH),i.addFunction(Ys.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ys.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,_e.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ys.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ys.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,_e.VERTEX),i.addFunction(Ys.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ys.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,_e.FRAGMENT),o.type===fr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,_e.FRAGMENT);let r=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=tn.getAttributeLocationCount(f.type),p=f.semantic===Ct.POSITION,g;d>1?(g=e.attributeIndex,e.attributeIndex+=d):p&&!a?g=0:g=e.attributeIndex++,k5e(e,f,g,d,r,s)}Y5e(i,t.attributes),t.primitiveType===Me.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(KO),i.addFragmentLines(XO)};function k5e(e,t,n,i,o,r){let s=e.shaderBuilder,a=Xt.getAttributeInfo(t),c=o&&!r;i>1?z5e(e,t,n,i):U5e(e,t,n,c),G5e(s,a,c),H5e(s,a),l(t.semantic)&&V5e(s,t),W5e(s,a,o),j5e(s,a,c),q5e(s,a)}function V5e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case Ct.NORMAL:e.addDefine("HAS_NORMALS");break;case Ct.TANGENT:e.addDefine("HAS_TANGENTS");break;case Ct.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case Ct.TEXCOORD:case Ct.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function U5e(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===Ct.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===Ct.POSITION,f=u?0:n,d=tn.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:X.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function z5e(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,u=tn.getNumberOfComponents(s)/i,f=X.getSizeInBytes(a),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,x={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(x)}}function H5e(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function G5e(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===Ct.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function W5e(e,t,n){let i=Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function j5e(e,t,n){let i=Ys.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function q5e(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=Ys.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Ys.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function Y5e(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===Ct.NORMAL?n=!0:r.semantic===Ct.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var $O=Ys;var QO=`#ifdef USE_IBL_LIGHTING +vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +{ + #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) + // Environment maps were provided, use them for IBL + vec3 viewDirection = -normalize(position); + vec3 iblColor = textureIBL(viewDirection, normal, material); + return iblColor; + #endif + + return vec3(0.0); +} +#endif + +#ifdef USE_CLEARCOAT +vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +{ + vec3 viewDirection = -normalize(position); + vec3 halfwayDirection = normalize(viewDirection + lightDirection); + vec3 normal = material.clearcoatNormal; + float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0); + + // clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5. + vec3 f0 = vec3(0.04); + vec3 f90 = vec3(1.0); + // Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h). + // This is to make it energy conserving with a simple layering function. + float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); + vec3 F = fresnelSchlick2(f0, f90, NdotV); + + // compute specular reflection from direct lighting + float roughness = material.clearcoatRoughness; + float alphaRoughness = roughness * roughness; + float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness); + vec3 directReflection = F * directStrength * NdotL; + vec3 color = lightColorHdr * directReflection; + + #ifdef SPECULAR_IBL + // Find the direction in which to sample the environment map + vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal)); + vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness); + color += iblColor * material.occlusion; + #endif + + float clearcoatFactor = material.clearcoatFactor; + vec3 clearcoatColor = color * clearcoatFactor; + + // Dim base layer based on transmission loss through clearcoat + return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor; +} +#endif + +#if defined(LIGHTING_PBR) && defined(HAS_NORMALS) +vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position) +{ + #ifdef USE_CUSTOM_LIGHT_COLOR + vec3 lightColorHdr = model_lightColorHdr; + #else + vec3 lightColorHdr = czm_lightColorHdr; + #endif + + vec3 viewDirection = -normalize(position); + vec3 normal = material.normalEC; + vec3 lightDirection = normalize(czm_lightDirectionEC); + + vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material); + vec3 directColor = lightColorHdr * directLighting; + + // Accumulate colors from base layer + vec3 color = directColor + material.emissive; + #ifdef USE_IBL_LIGHTING + color += computeIBL(position, normal, lightDirection, lightColorHdr, material); + #endif + + #ifdef USE_CLEARCOAT + color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material); + #endif + + return color; +} +#endif + +/** + * Compute the material color under the current lighting conditions. + * All other material properties are passed through so further stages + * have access to them. + * + * @param {czm_modelMaterial} material The material properties from {@MaterialStageFS} + * @param {ProcessedAttributes} attributes + */ +void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) +{ + #ifdef LIGHTING_PBR + #ifdef HAS_NORMALS + vec3 color = computePbrLighting(material, attributes.positionEC); + #else + vec3 color = material.diffuse * material.occlusion + material.emissive; + #endif + // In HDR mode, the frame buffer is in linear color space. The + // post-processing stages (see PostProcessStageCollection) will handle + // tonemapping. However, if HDR is not enabled, we must tonemap else large + // values may be clamped to 1.0 + #ifndef HDR + color = czm_pbrNeutralTonemapping(color); + #endif + #else // unlit + vec3 color = material.diffuse; + #endif + + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + // The colors resulting from point cloud styles are adjusted differently. + color = czm_gammaCorrect(color); + #elif !defined(HDR) + // If HDR is not enabled, the frame buffer stores sRGB colors rather than + // linear colors so the linear value must be converted. + color = czm_linearToSrgb(color); + #endif + + material.diffuse = color; +} +`;var X5e={UNLIT:0,PBR:1},Am=Object.freeze(X5e);var gce={name:"LightingPipelineStage"};gce.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,_e.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",_e.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Am.PBR?o.addDefine("LIGHTING_PBR",void 0,_e.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,_e.FRAGMENT),o.addFragmentLines(QO)};var JO=gce;var eM=`// If the style color is white, it implies the feature has not been styled. +bool isDefaultStyleColor(vec3 color) +{ + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +} + +vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) +{ + vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); + vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; + return color; +} + +vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform) +{ + return vec2(textureTransform * vec3(texCoord, 1.0)); +} + +#ifdef HAS_NORMAL_TEXTURE +vec2 getNormalTexCoords() +{ + vec2 texCoord = TEXCOORD_NORMAL; + #ifdef HAS_NORMAL_TEXTURE_TRANSFORM + texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0)); + #endif + return texCoord; +} +#endif + +#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE) +vec3 computeTangent(in vec3 position, in vec2 normalTexCoords) +{ + vec2 tex_dx = dFdx(normalTexCoords); + vec2 tex_dy = dFdy(normalTexCoords); + float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y; + vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position); + return tangent / determinant; +} +#endif + +#ifdef USE_ANISOTROPY +struct NormalInfo { + vec3 tangent; + vec3 bitangent; + vec3 normal; + vec3 geometryNormal; +}; + +NormalInfo getNormalInfo(ProcessedAttributes attributes) +{ + vec3 geometryNormal = attributes.normalEC; + #ifdef HAS_NORMAL_TEXTURE + vec2 normalTexCoords = getNormalTexCoords(); + #endif + + #ifdef HAS_BITANGENTS + vec3 tangent = attributes.tangentEC; + vec3 bitangent = attributes.bitangentEC; + #else // Assume HAS_NORMAL_TEXTURE + vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords); + tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent)); + vec3 bitangent = normalize(cross(geometryNormal, tangent)); + #endif + + #ifdef HAS_NORMAL_TEXTURE + mat3 tbn = mat3(tangent, bitangent, geometryNormal); + vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; + normalSample = 2.0 * normalSample - 1.0; + #ifdef HAS_NORMAL_TEXTURE_SCALE + normalSample.xy *= u_normalTextureScale; + #endif + vec3 normal = normalize(tbn * normalSample); + #else + vec3 normal = geometryNormal; + #endif + + #ifdef HAS_DOUBLE_SIDED_MATERIAL + if (czm_backFacing()) { + tangent *= -1.0; + bitangent *= -1.0; + normal *= -1.0; + geometryNormal *= -1.0; + } + #endif + + NormalInfo normalInfo; + normalInfo.tangent = tangent; + normalInfo.bitangent = bitangent; + normalInfo.normal = normal; + normalInfo.geometryNormal = geometryNormal; + + return normalInfo; +} +#endif + +#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) +vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) +{ + vec2 normalTexCoords = getNormalTexCoords(); + + // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set + #ifdef HAS_BITANGENTS + vec3 t = attributes.tangentEC; + vec3 b = attributes.bitangentEC; + #else + vec3 t = computeTangent(attributes.positionEC, normalTexCoords); + t = normalize(t - geometryNormal * dot(geometryNormal, t)); + vec3 b = normalize(cross(geometryNormal, t)); + #endif + + mat3 tbn = mat3(t, b, geometryNormal); + vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; + normalSample = 2.0 * normalSample - 1.0; + #ifdef HAS_NORMAL_TEXTURE_SCALE + normalSample.xy *= u_normalTextureScale; + #endif + return normalize(tbn * normalSample); +} +#endif + +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE +vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) +{ + vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL; + #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM + normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0)); + #endif + + // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set + #ifdef HAS_BITANGENTS + vec3 t = attributes.tangentEC; + vec3 b = attributes.bitangentEC; + #else + vec3 t = computeTangent(attributes.positionEC, normalTexCoords); + t = normalize(t - geometryNormal * dot(geometryNormal, t)); + vec3 b = normalize(cross(geometryNormal, t)); + #endif + + mat3 tbn = mat3(t, b, geometryNormal); + vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb; + normalSample = 2.0 * normalSample - 1.0; + #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE + normalSample.xy *= u_clearcoatNormalTextureScale; + #endif + return normalize(tbn * normalSample); +} +#endif + +#ifdef HAS_NORMALS +vec3 computeNormal(ProcessedAttributes attributes) +{ + // Geometry normal. This is already normalized + vec3 normal = attributes.normalEC; + + #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) + normal = getNormalFromTexture(attributes, normal); + #endif + + #ifdef HAS_DOUBLE_SIDED_MATERIAL + if (czm_backFacing()) { + normal = -normal; + } + #endif + + return normal; +} +#endif + +#ifdef HAS_BASE_COLOR_TEXTURE +vec4 getBaseColorFromTexture() +{ + vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; + #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM + baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); + #endif + + vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); + + #ifdef HAS_BASE_COLOR_FACTOR + baseColorWithAlpha *= u_baseColorFactor; + #endif + + return baseColorWithAlpha; +} +#endif + +#ifdef HAS_EMISSIVE_TEXTURE +vec3 getEmissiveFromTexture() +{ + vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; + #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM + emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); + #endif + + vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); + #ifdef HAS_EMISSIVE_FACTOR + emissive *= u_emissiveFactor; + #endif + + return emissive; +} +#endif + +#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) +void setSpecularGlossiness(inout czm_modelMaterial material) +{ + #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE + vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; + #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM + specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); + #endif + + vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); + vec3 specular = specularGlossiness.rgb; + float glossiness = specularGlossiness.a; + #ifdef HAS_LEGACY_SPECULAR_FACTOR + specular *= u_legacySpecularFactor; + #endif + + #ifdef HAS_GLOSSINESS_FACTOR + glossiness *= u_glossinessFactor; + #endif + #else + #ifdef HAS_LEGACY_SPECULAR_FACTOR + vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0)); + #else + vec3 specular = vec3(1.0); + #endif + + #ifdef HAS_GLOSSINESS_FACTOR + float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); + #else + float glossiness = 1.0; + #endif + #endif + + #ifdef HAS_DIFFUSE_TEXTURE + vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; + #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM + diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); + #endif + + vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); + #ifdef HAS_DIFFUSE_FACTOR + diffuse *= u_diffuseFactor; + #endif + #elif defined(HAS_DIFFUSE_FACTOR) + vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); + #else + vec4 diffuse = vec4(1.0); + #endif + + material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular)); + // the specular glossiness extension's alpha overrides anything set + // by the base material. + material.alpha = diffuse.a; + + material.specular = specular; + + // glossiness is the opposite of roughness, but easier for artists to use. + material.roughness = 1.0 - glossiness; +} +#elif defined(LIGHTING_PBR) +float setMetallicRoughness(inout czm_modelMaterial material) +{ + #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE + vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; + #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM + metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); + #endif + + vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; + float metalness = clamp(metallicRoughness.b, 0.0, 1.0); + float roughness = clamp(metallicRoughness.g, 0.0, 1.0); + #ifdef HAS_METALLIC_FACTOR + metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0); + #endif + + #ifdef HAS_ROUGHNESS_FACTOR + roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0); + #endif + #else + #ifdef HAS_METALLIC_FACTOR + float metalness = clamp(u_metallicFactor, 0.0, 1.0); + #else + float metalness = 1.0; + #endif + + #ifdef HAS_ROUGHNESS_FACTOR + float roughness = clamp(u_roughnessFactor, 0.0, 1.0); + #else + float roughness = 1.0; + #endif + #endif + + // dielectrics use f0 = 0.04, metals use albedo as f0 + const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); + vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness); + + material.specular = f0; + + // diffuse only applies to dielectrics. + material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness); + + // This is perceptual roughness. The square of this value is used for direct lighting + material.roughness = roughness; + + return metalness; +} +#ifdef USE_SPECULAR +void setSpecular(inout czm_modelMaterial material, in float metalness) +{ + #ifdef HAS_SPECULAR_TEXTURE + vec2 specularTexCoords = TEXCOORD_SPECULAR; + #ifdef HAS_SPECULAR_TEXTURE_TRANSFORM + specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform); + #endif + float specularWeight = texture(u_specularTexture, specularTexCoords).a; + #ifdef HAS_SPECULAR_FACTOR + specularWeight *= u_specularFactor; + #endif + #else + #ifdef HAS_SPECULAR_FACTOR + float specularWeight = u_specularFactor; + #else + float specularWeight = 1.0; + #endif + #endif + + #ifdef HAS_SPECULAR_COLOR_TEXTURE + vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; + #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM + specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); + #endif + vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; + vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); + #ifdef HAS_SPECULAR_COLOR_FACTOR + specularColorFactor *= u_specularColorFactor; + #endif + #else + #ifdef HAS_SPECULAR_COLOR_FACTOR + vec3 specularColorFactor = u_specularColorFactor; + #else + vec3 specularColorFactor = vec3(1.0); + #endif + #endif + material.specularWeight = specularWeight; + vec3 f0 = material.specular; + vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0)); + material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness); +} +#endif +#ifdef USE_ANISOTROPY +void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo) +{ + mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x); + float anisotropyStrength = u_anisotropy.z; + + vec2 direction = vec2(1.0, 0.0); + #ifdef HAS_ANISOTROPY_TEXTURE + vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY; + #ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM + anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); + #endif + vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; + direction = anisotropySample.rg * 2.0 - vec2(1.0); + anisotropyStrength *= anisotropySample.b; + #endif + + direction = rotation * direction; + mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal); + vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0)); + vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT); + + material.anisotropicT = anisotropicT; + material.anisotropicB = anisotropicB; + material.anisotropyStrength = anisotropyStrength; +} +#endif +#ifdef USE_CLEARCOAT +void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes) +{ + #ifdef HAS_CLEARCOAT_TEXTURE + vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; + #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM + clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); + #endif + float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; + #ifdef HAS_CLEARCOAT_FACTOR + clearcoatFactor *= u_clearcoatFactor; + #endif + #else + #ifdef HAS_CLEARCOAT_FACTOR + float clearcoatFactor = u_clearcoatFactor; + #else + // PERFORMANCE_IDEA: this case should turn the whole extension off + float clearcoatFactor = 0.0; + #endif + #endif + + #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE + vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; + #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM + clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); + #endif + float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; + #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR + clearcoatRoughness *= u_clearcoatRoughnessFactor; + #endif + #else + #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR + float clearcoatRoughness = u_clearcoatRoughnessFactor; + #else + float clearcoatRoughness = 0.0; + #endif + #endif + + material.clearcoatFactor = clearcoatFactor; + // This is perceptual roughness. The square of this value is used for direct lighting + material.clearcoatRoughness = clearcoatRoughness; + #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE + material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC); + #else + material.clearcoatNormal = attributes.normalEC; + #endif +} +#endif +#endif + +void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) +{ + #ifdef USE_ANISOTROPY + NormalInfo normalInfo = getNormalInfo(attributes); + material.normalEC = normalInfo.normal; + #elif defined(HAS_NORMALS) + material.normalEC = computeNormal(attributes); + #endif + + vec4 baseColorWithAlpha = vec4(1.0); + // Regardless of whether we use PBR, set a base color + #ifdef HAS_BASE_COLOR_TEXTURE + baseColorWithAlpha = getBaseColorFromTexture(); + #elif defined(HAS_BASE_COLOR_FACTOR) + baseColorWithAlpha = u_baseColorFactor; + #endif + + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + baseColorWithAlpha = v_pointCloudColor; + #elif defined(HAS_COLOR_0) + vec4 color = attributes.color_0; + // .pnts files store colors in the sRGB color space + #ifdef HAS_SRGB_COLOR + color = czm_srgbToLinear(color); + #endif + baseColorWithAlpha *= color; + #endif + + #ifdef USE_CPU_STYLING + baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend); + #endif + material.baseColor = baseColorWithAlpha; + material.diffuse = baseColorWithAlpha.rgb; + material.alpha = baseColorWithAlpha.a; + + #ifdef HAS_OCCLUSION_TEXTURE + vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; + #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM + occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); + #endif + material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; + #endif + + #ifdef HAS_EMISSIVE_TEXTURE + material.emissive = getEmissiveFromTexture(); + #elif defined(HAS_EMISSIVE_FACTOR) + material.emissive = u_emissiveFactor; + #endif + + #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) + setSpecularGlossiness(material); + #elif defined(LIGHTING_PBR) + float metalness = setMetallicRoughness(material); + #ifdef USE_SPECULAR + setSpecular(material, metalness); + #endif + #ifdef USE_ANISOTROPY + setAnisotropy(material, normalInfo); + #endif + #ifdef USE_CLEARCOAT + setClearcoat(material, attributes); + #endif + #endif +} +`;var{Material:K5e,MetallicRoughness:QW,SpecularGlossiness:JW,Specular:yce,Clearcoat:xce}=xn,bce={name:"MaterialPipelineStage",_processTexture:Gl,_processTextureTransform:Tce};bce.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;$5e(i,r,s,u,f,d,c),l(i.specularGlossiness)?Q5e(i.specularGlossiness,r,s,u,c):(l(i.specular)&&Xt.supportedExtensions.KHR_materials_specular&&J5e(i.specular,r,s,u,c),l(i.anisotropy)&&Xt.supportedExtensions.KHR_materials_anisotropy&&t6e(i.anisotropy,r,s,u,c),l(i.clearcoat)&&Xt.supportedExtensions.KHR_materials_clearcoat&&n6e(i.clearcoat,r,s,u,c),i6e(i.metallicRoughness,r,s,u,c));let p=Xt.getAttributeBySemantic(t,Ct.NORMAL),g=e.lightingOptions;i.unlit||!p||a?g.lightingModel=Am.UNLIT:g.lightingModel=Am.PBR;let m=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=m;let x=e.alphaOptions;i.alphaMode===bm.BLEND?x.pass=we.TRANSLUCENT:i.alphaMode===bm.MASK&&(x.alphaCutoff=i.alphaCutoff),s.addFragmentLines(eM),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,_e.BOTH)};function Tce(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,_e.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,_e.FRAGMENT),t[s]=function(){return n.transform}}function Z5e(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,_e.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,_e.FRAGMENT),t[s]=function(){return n.scale}}function Gl(e,t,n,i,o,r){e.addUniform("sampler2D",i,_e.FRAGMENT),t[i]=function(){return y(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,_e.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,c,_e.FRAGMENT);let f=n.transform;l(f)&&!$.equals(f,$.IDENTITY)&&Tce(e,t,n,i,o);let{scale:d}=n;l(d)&&d!==1&&Z5e(e,t,n,i,o)}function $5e(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:u,occlusionTexture:f}=e;l(a)&&!h.equals(a,K5e.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",_e.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,_e.FRAGMENT),l(c)&&!s&&Gl(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(u)&&!s&&Gl(n,t,u,"u_normalTexture","NORMAL",o),l(f)&&!s&&Gl(n,t,f,"u_occlusionTexture","OCCLUSION",i)}function Q5e(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,_e.FRAGMENT),l(r)&&!o&&Gl(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!oe.equals(s,JW.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",_e.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,_e.FRAGMENT)),l(a)&&!o&&Gl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!h.equals(c,JW.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",_e.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,_e.FRAGMENT)),l(u)&&u!==JW.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",_e.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,_e.FRAGMENT))}function J5e(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,_e.FRAGMENT),l(r)&&!o&&Gl(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==yce.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",_e.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,_e.FRAGMENT)),l(a)&&!o&&Gl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,yce.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",_e.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,_e.FRAGMENT))}var e6e=new h;function t6e(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,_e.FRAGMENT),l(a)&&!o&&Gl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",_e.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,r,e6e)}}function n6e(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,_e.FRAGMENT),l(r)&&r!==xce.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",_e.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,_e.FRAGMENT)),l(s)&&!o&&Gl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==xce.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",_e.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,_e.FRAGMENT)),l(c)&&!o&&Gl(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!o&&Gl(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function i6e(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,_e.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&Gl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!oe.equals(s,QW.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",_e.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,_e.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&Gl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==QW.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",_e.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,_e.FRAGMENT));let u=e.roughnessFactor;l(u)&&u!==QW.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",_e.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,_e.FRAGMENT))}var tM=bce;var ol={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};ol.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(ol.METADATA_PICKING_VALUE_TYPE,"float",_e.FRAGMENT),i.addDefine(ol.METADATA_PICKING_VALUE_STRING,"0.0",_e.FRAGMENT),i.addDefine(ol.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",_e.FRAGMENT),i.addDefine(ol.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",_e.FRAGMENT),i.addDefine(ol.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",_e.FRAGMENT),i.addDefine(ol.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",_e.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",_e.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${ol.METADATA_PICKING_VALUE_TYPE} value = ${ol.METADATA_PICKING_VALUE_TYPE}(${ol.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${ol.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${ol.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${ol.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${ol.METADATA_PICKING_VALUE_COMPONENT_W};`],_e.FRAGMENT)};var Du=ol;var nM=`void morphTargetsStage(inout ProcessedAttributes attributes) +{ + vec3 positionMC = attributes.positionMC; + attributes.positionMC = getMorphedPosition(positionMC); + + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = getMorphedNormal(normalMC); + #endif + + #ifdef HAS_TANGENTS + vec3 tangentMC = attributes.tangentMC; + attributes.tangentMC = getMorphedTangent(tangentMC); + #endif +}`;var Va={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Va.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,_e.VERTEX),l6e(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==Ct.POSITION&&p!==Ct.NORMAL&&p!==Ct.TANGENT||(r6e(e,d,e.attributeIndex,a),e.attributeIndex++)}}u6e(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,_e.VERTEX),n.addVertexLines(nM);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=xt(s,e.uniformMap)};var o6e={attributeString:void 0,functionId:void 0};function r6e(e,t,n,i){let o=e.shaderBuilder;s6e(e,t,n);let r=a6e(t,o6e);c6e(o,r,i)}function s6e(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:tn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function a6e(e,t){switch(e.semantic){case Ct.POSITION:t.attributeString="Position",t.functionId=Va.FUNCTION_ID_GET_MORPHED_POSITION;break;case Ct.NORMAL:t.attributeString="Normal",t.functionId=Va.FUNCTION_ID_GET_MORPHED_NORMAL;break;case Ct.TANGENT:t.attributeString="Tangent",t.functionId=Va.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function c6e(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function l6e(e){e.addFunction(Va.FUNCTION_ID_GET_MORPHED_POSITION,Va.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,_e.VERTEX),e.addFunctionLines(Va.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Va.FUNCTION_ID_GET_MORPHED_NORMAL,Va.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,_e.VERTEX),e.addFunctionLines(Va.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Va.FUNCTION_ID_GET_MORPHED_TANGENT,Va.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,_e.VERTEX),e.addFunctionLines(Va.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function u6e(e){e.addFunctionLines(Va.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Va.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Va.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var iM=Va;var Cce={name:"PickingPipelineStage"};Cce.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)f6e(e,t,a,i);else if(l(a))d6e(e,i);else{let c=Ace(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",_e.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function Ace(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(fr.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function f6e(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Xt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Xt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",_e.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(f.pickTexture,f.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function d6e(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let d=0;d<n;d++){let p=Ace(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let m=g.color;o[d*4+0]=H.floatToByte(m.red),o[d*4+1]=H.floatToByte(m.green),o[d*4+2]=H.floatToByte(m.blue),o[d*4+3]=H.floatToByte(m.alpha)}r._pickIds=i;let a=_t.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,_e.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var oM=Cce;var h6e={ADD:0,REPLACE:1},jo=Object.freeze(h6e);var rM=`float getPointSizeFromAttenuation(vec3 positionEC) { + // Variables are packed into a single vector to minimize gl.uniformXXX() calls + float pointSize = model_pointCloudParameters.x; + float geometricError = model_pointCloudParameters.y; + float depthMultiplier = model_pointCloudParameters.z; + + float depth = -positionEC.z; + return min((geometricError / depth) * depthMultiplier, pointSize); +} + +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); +} +#endif + +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); +} +#endif + +#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); +} +#elif defined(HAS_POINT_CLOUD_ATTENUATION) +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + return getPointSizeFromAttenuation(v_positionEC); +} +#endif + +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +float pointCloudBackFaceCullingStage() { + #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) + // This needs to be computed in eye coordinates so we can't use attributes.normalMC + return step(-v_normalEC.z, 0.0); + #else + return 1.0; + #endif +} +#endif`;var m6e=new oe,Sce={name:"PointCloudStylingPipelineStage"};Sce.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(r)&&!u){let x=y6e(a),b=x6e(r,x);b6e(i,b);let C=T6e(b).indexOf("normalMC")>=0,A=Xt.getAttributeBySemantic(t,Ct.NORMAL);if(C&&!A)throw new re("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,_e.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=we.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,_e.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,_e.VERTEX);let d,p,g;fr.is3DTiles(o.type)&&(p=!0,d=o.content,g=d.tile.refine===jo.ADD),i.addUniform("vec4","model_pointCloudParameters",_e.VERTEX),i.addVertexLines(rM);let m=e.uniformMap;m.model_pointCloudParameters=function(){let x=m6e,b=1;p&&(b=g?5:d.tileset.memoryAdjustedScreenSpaceError),x.x=y(f.maximumAttenuation,b),x.x*=n.pixelRatio;let T=p6e(e,t,f,d);x.y=T*f.geometricErrorScale;let C=n.context,A=n.camera.frustum,E;return n.mode===ne.SCENE2D||A instanceof nn?E=Number.POSITIVE_INFINITY:E=C.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=E,p&&(x.w=d.tileset.timeSinceLoad),x}};var Ece=new h;function p6e(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=Xt.getAttributeBySemantic(t,Ct.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,Ece);a=F.multiplyByPointAsVector(s,a,Ece);let c=a.x*a.y*a.z;return P.cbrt(c/r)}var _6e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},g6e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function y6e(e){let t=Ge(g6e);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var ej="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function x6e(e,t){let n=_6e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${ej})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${ej})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${ej})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function b6e(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,_e.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,_e.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,_e.VERTEX),e.addVertexLines(o))}function tj(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function T6e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&tj(t,o),l(n)&&tj(n,o),l(i)&&tj(i,o),o}var sM=Sce;var aM=`void primitiveOutlineStage() { + v_outlineCoordinates = a_outlineCoordinates; +} +`;var cM=`void primitiveOutlineStage(inout czm_modelMaterial material) { + if (!model_showOutline) { + return; + } + + float outlineX = + texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; + float outlineY = + texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; + float outlineZ = + texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; + float outlineness = max(outlineX, max(outlineY, outlineZ)); + + material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +} + +`;var vce={name:"PrimitiveOutlinePipelineStage"};vce.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,_e.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:tn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",_e.FRAGMENT);let a=bb.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",_e.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",_e.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(aM),i.addFragmentLines(cM)};var lM=vce;var wce={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Dce,_count2DPositions:Ice,_countMorphTargetAttributes:Pce,_countMaterialTextures:Rce,_countFeatureIdTextures:Oce,_countBinaryMetadata:Mce};wce.process=function(e,t,n){let i=e.model,o=i.statistics;Dce(o,t),Ice(o,e.runtimePrimitive),Pce(o,t),Rce(o,t.material),Oce(o,t.featureIds),Mce(o,i)};function Dce(e,t){let n=l(t.indices)?t.indices.count:Xt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Me.POINTS?e.pointsLength+=n:Me.isTriangles(i)&&(e.trianglesLength+=C6e(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function C6e(e,t){switch(e){case Me.TRIANGLES:return t/3;case Me.TRIANGLE_STRIP:case Me.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Ice(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Pce(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function Rce(e,t){let n=A6e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function A6e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function Oce(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof xn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Mce(e,t){let n=t.structuralMetadata;l(n)&&(E6e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function E6e(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var uM=wce;var S6e=new F,v6e=new F,Lce={name:"SceneMode2DPipelineStage"};Lce.process=function(e,t,n){let i=Xt.getAttributeBySemantic(t,Ct.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=F.multiplyTransformation(s,a,S6e),u=I6e(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let x=O6e(i,c,u,n);f.positionBuffer2D=x,r._modelResources.push(x),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,_e.VERTEX),o.addUniform("mat4","u_modelView2D",_e.VERTEX);let p=F.fromTranslation(u.center,new F),g=n.context,m={u_modelView2D:function(){return F.multiplyTransformation(g.uniformState.view,p,v6e)}};e.uniformMap=xt(m,e.uniformMap)};var w6e=new h,D6e=new h;function I6e(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,w6e),o=Hi.computeActualEllipsoidPosition(n,i,i),r=F.multiplyByPoint(t,e.positionMax,D6e),s=Hi.computeActualEllipsoidPosition(n,r,r);return ae.fromCornerPoints(o,s,new ae)}var Nce=new h;function P6e(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,Nce),c=h.multiplyComponents(a,r,a),u=h.add(c,o,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function R6e(e,t,n,i){let o;l(e.quantization)?o=P6e(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let u=h.fromArray(o,c,Nce);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=F.multiplyByPoint(t,u,u),d=Hi.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function O6e(e,t,n,i){let o=Ge(i);o.mode=ne.COLUMBUS_VIEW;let r=n.center,s=R6e(e,t,r,o),a=_t.createVertexBuffer({context:i.context,typedArray:s,usage:Fe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var fM=Lce;var dM=`void skinningStage(inout ProcessedAttributes attributes) +{ + mat4 skinningMatrix = getSkinningMatrix(); + mat3 skinningMatrixMat3 = mat3(skinningMatrix); + + vec4 positionMC = vec4(attributes.positionMC, 1.0); + attributes.positionMC = vec3(skinningMatrix * positionMC); + + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = skinningMatrixMat3 * normalMC; + #endif + + #ifdef HAS_TANGENTS + vec3 tangentMC = attributes.tangentMC; + attributes.tangentMC = skinningMatrixMat3 * tangentMC; + #endif +}`;var Eb={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};Eb.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,_e.VERTEX),L6e(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,_e.VERTEX),n.addVertexLines(dM);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=xt(r,e.uniformMap)};function M6e(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===Ct.JOINTS||r.semantic===Ct.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function L6e(e,t){e.addFunction(Eb.FUNCTION_ID_GET_SKINNING_MATRIX,Eb.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,_e.VERTEX),e.addFunctionLines(Eb.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=M6e(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(Eb.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(Eb.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var hM=Eb;var mM=`void verticalExaggerationStage( + inout ProcessedAttributes attributes +) { + // Compute the distance from the camera to the local center of curvature. + vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); + vec2 vertexAzimuth = normalize(vertexPositionENU.xy); + // Curvature = 1 / radius of curvature. + float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature); + float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; + + // Compute the approximate ellipsoid normal at the vertex position. + // Uses a circular approximation for the Earth curvature along the geodesic. + vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; + vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; + vec3 vertexNormal = normalize(centerToVertex); + + // Estimate the (sine of the) angle between the camera direction and the vertex normal + float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC); + float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC); + float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance); + bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta; + + // Approximate the change in height above the ellipsoid, from camera to vertex position. + float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal); + float smallAngleVersine = 0.5 * sinTheta * sinTheta; + float versine = isSmallAngle ? smallAngleVersine : exactVersine; + float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine; + float vertexHeight = czm_eyeHeight + dHeight; + + // Transform the approximate vertex normal to model coordinates. + vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz; + vertexNormalMC = normalize(vertexNormalMC); + + // Compute the exaggeration and apply it along the approximate vertex normal. + float stretch = u_verticalExaggerationAndRelativeHeight.x; + float shift = u_verticalExaggerationAndRelativeHeight.y; + float exaggeration = (vertexHeight - shift) * (stretch - 1.0); + attributes.positionMC += exaggeration * vertexNormalMC; +} +`;var Fce={name:"VerticalExaggerationPipelineStage"},N6e=new z;Fce.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(mM),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,_e.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",_e.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return z.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,N6e)}};var pM=Fce;var nj={};function F6e(e){let t=Ne.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function B6e(e,t){let n=t.length,i=Ne.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function k6e(e){let t=e-2,n=2+t*4,i=Ne.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function V6e(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=c}return r}function U6e(e){let t=e-2,n=2+t*4,i=Ne.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function z6e(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}nj.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Me.TRIANGLES)return i?B6e(t,n):F6e(t);if(e===Me.TRIANGLE_STRIP)return i?V6e(t,n):k6e(t);if(e===Me.TRIANGLE_FAN)return i?z6e(t,n):U6e(t)};nj.getWireframeIndicesCount=function(e,t){return e===Me.TRIANGLES?t*2:e===Me.TRIANGLE_STRIP||e===Me.TRIANGLE_FAN?2+(t-2)*4:t};var oE=nj;var Bce={name:"WireframePipelineStage"};Bce.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,_e.FRAGMENT);let o=e.model,r=H6e(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Me.LINES,e.count=oE.getWireframeIndicesCount(a,c)};function H6e(e,t,n){let o=Xt.getAttributeBySemantic(e,Ct.POSITION).count,r=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&r?(s=f.sizeInBytes===d?new Uint8Array(d):Ne.createTypedArray(o,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=oE.createWireframeIndices(a,o,s),u=Ne.fromSizeInBytes(c.BYTES_PER_ELEMENT);return _t.createIndexBuffer({context:n.context,typedArray:c,usage:Fe.STATIC_DRAW,indexDatatype:u})}var _M=Bce;function kce(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}kce.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,u=e.mode!==ne.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r),x=!(g&&l(r.fragmentShaderText))||r.mode!==g_.REPLACE_MATERIAL,b=Xt.hasQuantizedAttributes(n.attributes),T=o.debugWireframe&&Me.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),C=o.pointCloudShading,A=l(C)&&C.attenuation,E=l(C)&&C.backFaceCulling,v=n.primitiveType===Me.POINTS&&(l(s)||A||E),D=o._enableShowOutline&&l(n.outlineCoordinates),O=G6e(o,i,n),R=l(o.classificationType);u&&t.push(fM),t.push($O),T&&t.push(_M),R&&t.push(NO),d&&t.push(iM),p&&t.push(hM),v&&t.push(sM),b&&t.push(YO),x&&t.push(tM),t.push(Iy),t.push(Ff),t.push(Du),O.hasPropertyTable&&(t.push(Ry),t.push(LO),t.push(kO)),f&&t.push(pM),g&&t.push(jO),t.push(JO),o.allowPicking&&t.push(oM),D&&t.push(lM),t.push(MO),t.push(uM)};function G6e(e,t,n){let i;return l(t.instances)&&(i=Xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var gM=kce;function ij(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],W6e(this)}Object.defineProperties(ij.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function W6e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let u=i[c].index,f=r[u];s.push(f);let d=n[c],p=Vce(f,d,new F);a.push(p)}}function Vce(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}ij.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=Vce(i,o,e[n])}};var yM=ij;function j6e(){this.pass=void 0,this.alphaCutoff=void 0}var xM=j6e;function q6e(e){this.shaderBuilder=new Tx,this.model=e,this.uniformMap={},this.alphaOptions=new xM,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var bM=q6e;var TM=`void silhouetteStage(inout vec4 color) { + if(model_silhouettePass) { + color = czm_gammaCorrect(model_silhouetteColor); + } +}`;var CM=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { + #ifdef HAS_NORMALS + if(model_silhouettePass) { + vec3 normal = normalize(czm_normal3D * attributes.normalMC); + normal.x *= czm_projection[0][0]; + normal.y *= czm_projection[1][1]; + positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; + } + #endif +} +`;var dz={name:"ModelSilhouettePipelineStage"};dz.silhouettesLength=0;dz.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++dz.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,_e.BOTH),i.addVertexLines(CM),i.addFragmentLines(TM),i.addUniform("vec4","model_silhouetteColor",_e.FRAGMENT),i.addUniform("float","model_silhouetteSize",_e.VERTEX),i.addUniform("bool","model_silhouettePass",_e.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=xt(o,e.uniformMap),e.hasSilhouette=!0};var AM=dz;var EM=`void modelSplitterStage() +{ + // Don't split when rendering the shadow map, because it is rendered from + // the perspective of a totally different camera. +#ifndef SHADOW_MAP + if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; + if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +#endif +} +`;var hz={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};hz.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,_e.FRAGMENT),i.addFragmentLines(EM);let o={};i.addUniform("float",hz.SPLIT_DIRECTION_UNIFORM_NAME,_e.FRAGMENT),o[hz.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=xt(o,e.uniformMap)};var SM=hz;function Y6e(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ge(e.uniformMap),this.alphaOptions=Ge(e.alphaOptions),this.renderStateOptions=Ge(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var vM=Y6e;function X6e(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,Am.UNLIT)}var wM=X6e;function K6e(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ge(e.uniformMap),this.alphaOptions=Ge(e.alphaOptions),this.renderStateOptions=Ge(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Xt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Xt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new wM,this.pickId=void 0}var DM=K6e;function rj(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==kn.CESIUM_3D_TILE,this._classifies3DTiles=o!==kn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],J6e(this)}function Z6e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ut.KEEP,zFail:ut.DECREMENT_WRAP,zPass:ut.KEEP},backFunction:e,backOperation:{fail:ut.KEEP,zFail:ut.INCREMENT_WRAP,zPass:ut.KEEP},reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},depthMask:!1}}var $6e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND},Q6e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Hce=[];function J6e(e){let t=e._command,n=Hce;if(e._useDebugWireframe){t.pass=we.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=IM(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=we.TERRAIN_CLASSIFICATION,s=oj(t,r),a=Uce(t,r);n.length=0,n.push(s,a),e._commandListTerrain=IM(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=zce(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=we.CESIUM_3D_TILE_CLASSIFICATION,s=oj(t,r),a=Uce(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=IM(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=zce(e,n,e._commandList3DTilesPicking))}}function IM(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let u=o[c],f=r[c];for(let d=0;d<a;d++){let p=t[d],g=Ze.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function oj(e,t){let n=Ze.shallowClone(e);n.cull=!1,n.pass=t;let i=t===we.TERRAIN_CLASSIFICATION?Vn.ALWAYS:Vn.EQUAL,o=Z6e(i);return n.renderState=Ve.fromCache(o),n}function Uce(e,t){let n=Ze.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ve.fromCache($6e),n}var e9e=[];function zce(e,t,n){let i=Ve.fromCache(Q6e),o=t[0],r=t[1],s=Ze.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=Ze.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=e9e;return c.length=0,c.push(s,a),IM(e,c,n)}Object.defineProperties(rj.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ae.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});rj.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=oj(this._command,o),s=Hce;s.length=0,s.push(r),this._commandListIgnoreShow=IM(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var PM=rj;function mz(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===we.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,d=c;this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=ae.clone(t.boundingVolume),this._modelMatrix2D=new F,this._boundingVolume2D=new ae,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,t9e(this)}function y_(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}y_.clone=function(e){return new y_({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function t9e(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new y_({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new y_({command:c9e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new y_({command:m9e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new y_({command:p9e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new y_({command:l9e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new y_({command:u9e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(mz.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ae.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,i9e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,o9e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,r9e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,s9e(this))}}});function n9e(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ae.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function i9e(e){let t=e.shadows,n=yn.castShadows(t),i=yn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function o9e(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=Ge(r.renderState,!0);s.cull.enabled=t,r.renderState=Ve.fromCache(s)}}}function r9e(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=Ge(r.renderState,!0);s.cull.face=t,r.renderState=Ve.fromCache(s)}}}function s9e(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}mz.prototype.pushCommands=function(e,t){let n=Gce(this,e);n&&!this._has2DCommands&&(a9e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(n9e(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==rh.ALL_OPAQUE&&sE(t,this._translucentCommand,n),i===rh.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||sE(o._backfaceCommands,this._skipLodBackfaceCommand,n),f9e(this,r,n),sE(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){sE(t,this._silhouetteModelCommand,n);return}return sE(t,this._originalCommand,n),t}};mz.prototype.pushSilhouetteCommands=function(e,t){let n=Gce(this,e);return sE(t,this._silhouetteColorCommand,n),t};function sE(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function Gce(e,t){if(t.mode!==ne.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*P.PI;return o<s&&r>s||o<-s&&r>-s}function rE(e,t){if(!l(t))return;let n=y_.clone(t),i=Ze.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function a9e(e){rE(e,e._originalCommand),rE(e,e._translucentCommand),rE(e,e._skipLodBackfaceCommand),rE(e,e._skipLodStencilCommand),rE(e,e._silhouetteModelCommand),rE(e,e._silhouetteColorCommand)}function c9e(e){let t=Ze.shallowClone(e);t.pass=we.TRANSLUCENT;let n=Ge(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=ln.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function l9e(e,t){let n=t._silhouetteId%255,i=Ze.shallowClone(e),o=Ge(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function u9e(e,t){let n=t._silhouetteId%255,i=Ze.shallowClone(e),o=Ge(e.renderState,!0);o.cull.enabled=!1,(e.pass===we.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=we.TRANSLUCENT,o.depthMask=!1,o.blending=ln.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ge(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function f9e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=d9e(o);if(r!==s){let a=h9e(r),c=Ge(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ve.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function d9e(e){return(e.renderState.stencilTest.reference&Vt.SKIP_LOD_MASK)>>>Vt.SKIP_LOD_BIT_SHIFT}function h9e(e){return Vt.CESIUM_3D_TILE_MASK|e<<Vt.SKIP_LOD_BIT_SHIFT}function m9e(e){let t=Ze.shallowClone(e),n=Ge(e.renderState,!0);n.cull.enabled=!0,n.cull.face=xi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ge(t.uniformMap),o=new z(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ve.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function p9e(e){let t=Ze.shallowClone(e),n=Ge(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Vt.SKIP_LOD_MASK,i.reference=Vt.CESIUM_3D_TILE_MASK,i.frontFunction=Vn.GREATER_OR_EQUAL,i.frontOperation.zPass=ut.REPLACE,i.backFunction=Vn.GREATER_OR_EQUAL,i.backOperation.zPass=ut.REPLACE,n.stencilMask=Vt.CESIUM_3D_TILE_MASK|Vt.SKIP_LOD_MASK,t.renderState=Ve.fromCache(n),t}var RM=mz;var OM=`precision highp float; + +czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { + czm_modelVertexOutput vsOutput; + vsOutput.positionMC = positionMC; + vsOutput.pointSize = 1.0; + return vsOutput; +} + +void main() +{ + // Initialize the attributes struct with all + // attributes except quantized ones. + ProcessedAttributes attributes; + initializeAttributes(attributes); + + // Dequantize the quantized ones and add them to the + // attributes struct. + #ifdef USE_DEQUANTIZATION + dequantizationStage(attributes); + #endif + + #ifdef HAS_MORPH_TARGETS + morphTargetsStage(attributes); + #endif + + #ifdef HAS_SKINNING + skinningStage(attributes); + #endif + + #ifdef HAS_PRIMITIVE_OUTLINE + primitiveOutlineStage(); + #endif + + // Compute the bitangent according to the formula in the glTF spec. + // Normal and tangents can be affected by morphing and skinning, so + // the bitangent should not be computed until their values are finalized. + #ifdef HAS_BITANGENTS + attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); + #endif + + FeatureIds featureIds; + featureIdStage(featureIds, attributes); + + #ifdef HAS_SELECTED_FEATURE_ID + SelectedFeature feature; + selectedFeatureIdStage(feature, featureIds); + // Handle any show properties that come from the style. + cpuStylingStage(attributes.positionMC, feature); + #endif + + #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) + // The scene mode 2D pipeline stage and instancing stage add a different + // model view matrix to accurately project the model to 2D. However, the + // output positions and normals should be transformed by the 3D matrices + // to keep the data the same for the fragment shader. + mat4 modelView = czm_modelView3D; + mat3 normal = czm_normal3D; + #else + // These are used for individual model projection because they will + // automatically change based on the scene mode. + mat4 modelView = czm_modelView; + mat3 normal = czm_normal; + #endif + + // Update the position for this instance in place + #ifdef HAS_INSTANCING + + // The legacy instance stage is used when rendering i3dm models that + // encode instances transforms in world space, as opposed to glTF models + // that use EXT_mesh_gpu_instancing, where instance transforms are encoded + // in object space. + #ifdef USE_LEGACY_INSTANCING + mat4 instanceModelView; + mat3 instanceModelViewInverseTranspose; + + legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); + + modelView = instanceModelView; + normal = instanceModelViewInverseTranspose; + #else + instancingStage(attributes); + #endif + + #ifdef USE_PICKING + v_pickColor = a_pickColor; + #endif + + #endif + + Metadata metadata; + MetadataClass metadataClass; + MetadataStatistics metadataStatistics; + metadataStage(metadata, metadataClass, metadataStatistics, attributes); + + #ifdef HAS_VERTICAL_EXAGGERATION + verticalExaggerationStage(attributes); + #endif + + #ifdef HAS_CUSTOM_VERTEX_SHADER + czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); + customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); + #endif + + // Compute the final position in each coordinate system needed. + // This returns the value that will be assigned to gl_Position. + vec4 positionClip = geometryStage(attributes, modelView, normal); + + // This must go after the geometry stage as it needs v_positionWC + #ifdef HAS_ATMOSPHERE + atmosphereStage(attributes); + #endif + + #ifdef ENABLE_CLIPPING_POLYGONS + modelClippingPolygonsStage(attributes); + #endif + + #ifdef HAS_SILHOUETTE + silhouetteStage(attributes, positionClip); + #endif + + #ifdef HAS_POINT_CLOUD_SHOW_STYLE + float show = pointCloudShowStylingStage(attributes, metadata); + #else + float show = 1.0; + #endif + + #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING + show *= pointCloudBackFaceCullingStage(); + #endif + + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); + #endif + + #ifdef PRIMITIVE_TYPE_POINTS + #ifdef HAS_CUSTOM_VERTEX_SHADER + gl_PointSize = vsOutput.pointSize; + #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) + gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); + #else + gl_PointSize = 1.0; + #endif + + gl_PointSize *= show; + #endif + + // Important NOT to compute gl_Position = show * positionClip or we hit: + // https://github.com/CesiumGS/cesium/issues/11270 + // + // We will discard points with v_pointCloudShow == 0 in the fragment shader. + gl_Position = positionClip; + + #ifdef HAS_POINT_CLOUD_SHOW_STYLE + v_pointCloudShow = show; + #endif +} +`;var MM=` +precision highp float; +czm_modelMaterial defaultModelMaterial() +{ + czm_modelMaterial material; + material.diffuse = vec3(0.0); + material.specular = vec3(1.0); + material.roughness = 1.0; + material.occlusion = 1.0; + material.normalEC = vec3(0.0, 0.0, 1.0); + material.emissive = vec3(0.0); + material.alpha = 1.0; + return material; +} + +vec4 handleAlpha(vec3 color, float alpha) +{ + #ifdef ALPHA_MODE_MASK + if (alpha < u_alphaCutoff) { + discard; + } + #endif + + return vec4(color, alpha); +} + +SelectedFeature selectedFeature; + +void main() +{ + #ifdef HAS_POINT_CLOUD_SHOW_STYLE + if (v_pointCloudShow == 0.0) + { + discard; + } + #endif + + #ifdef HAS_MODEL_SPLITTER + modelSplitterStage(); + #endif + + czm_modelMaterial material = defaultModelMaterial(); + + ProcessedAttributes attributes; + geometryStage(attributes); + + FeatureIds featureIds; + featureIdStage(featureIds, attributes); + + Metadata metadata; + MetadataClass metadataClass; + MetadataStatistics metadataStatistics; + metadataStage(metadata, metadataClass, metadataStatistics, attributes); + + //======================================================================== + // When not picking metadata START + #ifndef METADATA_PICKING_ENABLED + + #ifdef HAS_SELECTED_FEATURE_ID + selectedFeatureIdStage(selectedFeature, featureIds); + #endif + + #ifndef CUSTOM_SHADER_REPLACE_MATERIAL + materialStage(material, attributes, selectedFeature); + #endif + + #ifdef HAS_CUSTOM_FRAGMENT_SHADER + customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); + #endif + + lightingStage(material, attributes); + + #ifdef HAS_SELECTED_FEATURE_ID + cpuStylingStage(material, selectedFeature); + #endif + + #ifdef HAS_MODEL_COLOR + modelColorStage(material); + #endif + + #ifdef HAS_PRIMITIVE_OUTLINE + primitiveOutlineStage(material); + #endif + + vec4 color = handleAlpha(material.diffuse, material.alpha); + + // When not picking metadata END + //======================================================================== + #else + //======================================================================== + // When picking metadata START + + vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0); + metadataPickingStage(metadata, metadataClass, metadataValues); + vec4 color = metadataValues; + + #endif + // When picking metadata END + //======================================================================== + + #ifdef HAS_CLIPPING_PLANES + modelClippingPlanesStage(color); + #endif + + #ifdef ENABLE_CLIPPING_POLYGONS + modelClippingPolygonsStage(); + #endif + + //======================================================================== + // When not picking metadata START + #ifndef METADATA_PICKING_ENABLED + + #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) + silhouetteStage(color); + #endif + + #ifdef HAS_ATMOSPHERE + atmosphereStage(color, attributes); + #endif + + #endif + // When not picking metadata END + //======================================================================== + + out_FragColor = color; +} +`;function Wce(){}Wce.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=_9e(e,n,t),o=g9e(e,i,t),r=e.model;return l(r.classificationType)?new PM({primitiveRenderResources:e,command:o}):new RM({primitiveRenderResources:e,command:o})};function _9e(e,t,n){t.addVertexLines(OM),t.addFragmentLines(MM);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function g9e(e,t,n){let i=y9e(e),o=new ti({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,c=n.mode===ne.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&r._projectTo2D)u=F.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new F),f=e.runtimePrimitive.boundingSphere2D;else{let T=c?a._computedModelMatrix:a._computedModelMatrix2D;u=F.multiplyTransformation(T,e.runtimeNode.computedTransform,new F),f=ae.transform(e.boundingSphere,u)}let d=Ge(Ve.fromCache(e.renderStateOptions),!0);d.cull.face=Xt.getCullFace(u,e.primitiveType),d=Ve.fromCache(d);let p=l(r.classificationType),g=p?!1:yn.castShadows(r.shadows),m=p?!1:yn.receiveShadows(r.shadows),x=p?void 0:e.pickId;return new Ze({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:x,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function y9e(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var LM=Wce;function Iu(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=Xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},x9e(this)}Object.defineProperties(Iu.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function x9e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;jce(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let C=0;C<s;C++){let A=r[C],E=new gO({articulation:A,sceneGraph:e}),v=E.name;a[v]=E}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=F.IDENTITY;for(let C=0;C<d;C++){let A=n.nodes[C],E=qce(e,A,p);e._rootNodes.push(E)}let g=t.skins,m=e._runtimeSkins,x=g.length;for(let C=0;C<x;C++){let A=g[C];m.push(new yM({skin:A,sceneGraph:e}))}let b=e._skinnedNodes,T=b.length;for(let C=0;C<T;C++){let A=b[C],E=e._runtimeNodes[A],D=c[A].skin.index;E._runtimeSkin=m[D],E.updateJointMatrices()}e.applyArticulations()}function jce(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var b9e=new h;function T9e(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,b9e);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=Ot.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Ot.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ae.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function qce(e,t,n){let i=[],o=Xt.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let d=t.children[f],p=F.multiplyTransformation(n,o,new F),g=qce(e,d,p);i.push(g)}let s=new OO({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new gM({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new EO(f,s);f._nodesByName[u]=d}return c}var C9e=new h,A9e=new h,E9e=new h,S9e=new h;Iu.prototype.buildDrawCommands=function(e){let t=this._model,n=new bM(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,C9e),c=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,A9e);for(o=0;o<this._runtimeNodes.length;o++){let u=this._runtimeNodes[o];if(!l(u))continue;u.configurePipeline();let f=u.pipelineStages,d=new vM(n,u);for(r=0;r<f.length;r++)f[r].process(d,u.node,e);let p=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){let g=u.runtimePrimitives[r];g.configurePipeline(e);let m=g.pipelineStages,x=new DM(d,g);for(s=0;s<m.length;s++)m[s].process(x,g.primitive,e);g.boundingSphere=ae.clone(x.boundingSphere,new ae);let b=F.multiplyByPoint(p,x.positionMin,E9e),T=F.multiplyByPoint(p,x.positionMax,S9e);h.minimumByComponent(a,b,a),h.maximumByComponent(c,T,c);let C=LM.buildModelDrawCommand(x,e);g.drawCommand=C}}this._boundingSphere=ae.fromCornerPoints(a,c,new ae),this._boundingSphere=ae.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ae.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ae.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Iu.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;l(n.color)&&t.push(Dy),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(pO),n.isClippingEnabled()&&t.push(bO),n.isClippingPolygonsEnabled()&&t.push(AO),n.hasSilhouette(e)&&t.push(AM),l(n.splitDirection)&&n.splitDirection!==Br.NONE&&t.push(SM),fr.is3DTiles(n.type)&&t.push(uO),i&&t.push(hO))};Iu.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==ne.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};Iu.prototype.updateModelMatrix=function(e,t){jce(this,e),t.mode!==ne.SCENE3D&&T9e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Iu.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function Yce(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);Yce(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,o)}}function pz(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];Yce(e,c,t,n,i)}}var v9e={backFaceCulling:void 0};Iu.prototype.updateBackFaceCulling=function(e){let t=v9e;t.backFaceCulling=e,pz(this,!1,w9e,t)};function w9e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var D9e={shadowMode:void 0};Iu.prototype.updateShadows=function(e){let t=D9e;t.shadowMode=e,pz(this,!1,I9e,t)};function I9e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var P9e={debugShowBoundingVolume:void 0};Iu.prototype.updateShowBoundingVolume=function(e){let t=P9e;t.debugShowBoundingVolume=e,pz(this,!1,R9e,t)};function R9e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Xce=[],O9e={frameState:void 0,hasSilhouette:void 0};Iu.prototype.pushDrawCommands=function(e){let t=Xce;t.length=0;let n=O9e;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,pz(this,!0,M9e,n),e.commandList.push.apply(e.commandList,t)};function M9e(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Xce,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}Iu.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};Iu.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var NM=Iu;function Oy(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Et}Object.defineProperties(Oy.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});Oy.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};Oy.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};Oy.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Oy.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Oy.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Oy.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var FM=Oy;var Qce=Zo(sV(),1);var Kce={},Sb=Uint32Array.BYTES_PER_ELEMENT;Kce.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=Sb;let o=i.getUint32(t,!0);if(o!==1)throw new re(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=Sb,t+=Sb;let r=i.getUint32(t,!0);if(r===0)throw new re("Feature table must have a byte length greater than zero");t+=Sb;let s=i.getUint32(t,!0);t+=Sb;let a=i.getUint32(t,!0);t+=Sb;let c=i.getUint32(t,!0);t+=Sb;let u=Fo(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Fo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new ih(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new re("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(x)&&(x=h.unpack(x));let b=L9e(g,d);if(b.rtcCenter=x,b.pointsLength=m,!b.hasPositions){let T=N9e(g);b.positions=T,b.hasPositions=b.hasPositions||l(T)}if(!b.hasPositions)throw new re("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let T=B9e(g);b.normals=T,b.hasNormals=b.hasNormals||l(T)}if(!b.hasColors){let T=F9e(g);b.colors=T,b.hasColors=b.hasColors||l(T),b.hasConstantColor=l(b.constantColor),b.isTranslucent=l(T)&&T.isTranslucent}if(!b.hasBatchIds){let T=k9e(g);b.batchIds=T,b.hasBatchIds=b.hasBatchIds||l(T)}if(b.hasBatchIds){let T=g.getGlobalProperty("BATCH_LENGTH");if(!l(T))throw new re("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=T}return l(p)&&(p=new Uint8Array(p),b.batchTableJson=d,b.batchTableBinary=p),b};function L9e(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,u,f,d,p;if(l(s)){o=s.properties;let m=s.byteOffset,x=s.byteLength;if(!l(o)||!l(m)||!l(x))throw new re("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+x),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),d=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:xt(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function N9e(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",X.FLOAT,3),{name:Ct.POSITION,semantic:Ct.POSITION,typedArray:n,isQuantized:!1,componentDatatype:X.FLOAT,type:tn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(i))throw new re("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(r))throw new re("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:Ct.POSITION,semantic:Ct.POSITION,typedArray:n,isQuantized:!0,componentDatatype:X.FLOAT,type:tn.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:X.UNSIGNED_SHORT,quantizedType:tn.VEC3}}}function F9e(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",X.UNSIGNED_BYTE,4),{name:Ct.COLOR,semantic:Ct.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:tn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",X.UNSIGNED_BYTE,3),{name:"COLOR",semantic:Ct.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:tn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",X.UNSIGNED_SHORT,1),{name:"COLOR",semantic:Ct.COLOR,setIndex:0,typedArray:n,componentDatatype:X.FLOAT,type:tn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",X.UNSIGNED_BYTE,4),o=i[3],r=H.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:Ct.COLOR,semantic:Ct.COLOR,setIndex:0,constantColor:r,componentDatatype:X.FLOAT,type:tn.VEC4,isQuantized:!1,isTranslucent:s}}}function B9e(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",X.FLOAT,3),{name:Ct.NORMAL,semantic:Ct.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:X.FLOAT,type:tn.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",X.UNSIGNED_BYTE,2),{name:Ct.NORMAL,semantic:Ct.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:tn.VEC2,quantizedComponentDatatype:X.UNSIGNED_BYTE,componentDatatype:X.FLOAT,type:tn.VEC3}}function k9e(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",X.UNSIGNED_SHORT,1);return{name:Ct.FEATURE_ID,semantic:Ct.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:X.fromTypedArray(n),type:tn.SCALAR}}}var vb=Kce;var V9e=xn.Components,U9e=xn.Scene,z9e=xn.Node,H9e=xn.Primitive,G9e=xn.Attribute,Zce=xn.Quantization,W9e=xn.FeatureIdAttribute,j9e=xn.Material,q9e=xn.MetallicRoughness;function My(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=mt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(My.prototype=Object.create(Ki.prototype),My.prototype.constructor=My);Object.defineProperties(My.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});My.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=vb.parse(this._arrayBuffer,this._byteOffset),this._state=mt.PROCESSING,this._promise=Promise.resolve(this)};My.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===mt.READY)return!0;if(this._state===mt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=Y9e(this,e.context)}return!1};function Y9e(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=e_.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&X9e(e,i,r),rWe(e,t),e._state=mt.READY,e}).catch(function(r){e.unload(),e._state=mt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function X9e(e,t,n){e._state=mt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:Ct.POSITION,typedArray:n.POSITION.array,componentDatatype:X.FLOAT,type:tn.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=d,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=d<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT,o.quantizedType=tn.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:Ct.NORMAL,typedArray:n.NORMAL.array,componentDatatype:X.FLOAT,type:tn.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=X.UNSIGNED_BYTE,o.quantizedType=tn.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:Ct.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:X.UNSIGNED_BYTE,type:tn.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:Ct.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:X.UNSIGNED_BYTE,type:tn.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:Ct.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:X.fromTypedArray(a),type:tn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let u=c.data;r[a]={byteOffset:u.byteOffset,type:K9e(u.componentsPerAttribute),componentType:Z9e(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function K9e(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Z9e(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function BM(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Zce,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Zce;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new G9e;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=y(t.normalized,!1),r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Mn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=H.pack(t.constantColor,a)}else{let a=_t.createVertexBuffer({typedArray:i,context:n,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===Ct.POSITION&&s&&(r.typedArray=i),r}var $ce,_z;function $9e(e){if(!l(_z)){$ce=new Qce.default(0),_z=new Array(e);for(let t=0;t<e;++t)_z[t]=$ce.random()}return _z}var Q9e=new h,J9e=new h,eWe=new h;function tWe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=$9e(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Q9e),u=h.fromElements(a,a,a,J9e),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)d=Math.floor(r[f]*i),p=h.unpack(t,d*3,eWe),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var nWe={name:Ct.COLOR,semantic:Ct.COLOR,setIndex:0,constantColor:H.DARKGRAY,componentDatatype:X.FLOAT,type:tn.VEC4,isQuantized:!1,isTranslucent:!1};function iWe(e,t,n){let i=[],o,r=t.positions;return l(r)&&(tWe(r),o=BM(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=BM(e,t.normals,n),i.push(o)),l(t.colors)?(o=BM(e,t.colors,n),i.push(o)):(o=BM(e,nWe,n),i.push(o)),l(t.batchIds)&&(o=BM(e,t.batchIds,n),i.push(o)),i}function oWe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);if(l(o)||e.hasDracoBatchTable){let s=y(n,i);return h_({count:s,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t})}return new qs({schema:{},propertyTables:[]})}function rWe(e,t){let n=e._parsedContent,i=new q9e;i.metallicFactor=0,i.roughnessFactor=.9;let o=new j9e;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=bm.BLEND);let s=!l(n.normals);o.unlit=s;let a=new H9e;if(a.attributes=iWe(e,n,t),a.primitiveType=Me.POINTS,a.material=o,l(n.batchIds)){let g=new W9e;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new z9e;c.index=0,c.primitives=[a];let u=new U9e;u.nodes=[c],u.upAxis=No.Z,u.forwardAxis=No.X;let f=new V9e;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=oWe(n,d),d.length>0&&sWe(e,a,d,t),l(n.rtcCenter)&&(f.transform=F.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=F.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function sWe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=_t.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Fe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}My.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var kM=My;var aWe=new h,cWe=new h,lWe=new h,uWe=new F,fWe=new F,dWe=new F,hWe=new fe,mWe=new ae;function aE(e,t,n,i,o,r,s){if(!e._ready||n.mode===ne.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,u=c._runtimeNodes;for(let f=0;f<u.length;f++){let d=u[f],p=d.node,g=F.clone(d.computedTransform,uWe),m=F.clone(c.computedModelMatrix,fWe),x=p.instances;l(x)&&x.transformInWorldSpace&&(m=F.multiplyTransformation(e.modelMatrix,c.components.transform,m),g=F.multiplyTransformation(c.axisCorrectionMatrix,d.computedTransform,g));let b=F.multiplyTransformation(m,g,dWe);n.mode!==ne.SCENE3D&&(b=Ot.basisTo2D(n.mapProjection,b,b));let T=[];if(l(x)){let A=x.attributes[0].count,E=x.attributes[0].componentDatatype,v=12,D=d.transformsTypedArray;if(!l(D)){let O=d.instancingTransformsBuffer;l(O)&&n.context.webgl2&&(D=X.createTypedArray(E,A*v),O.getBufferData(D))}if(l(D))for(let O=0;O<A;O++){let R=O*v,M=new F(D[R],D[R+1],D[R+2],D[R+3],D[R+4],D[R+5],D[R+6],D[R+7],D[R+8],D[R+9],D[R+10],D[R+11],0,0,0,1);x.transformInWorldSpace?(F.multiplyTransformation(M,g,M),F.multiplyTransformation(m,M,M)):F.multiplyTransformation(M,b,M),T.push(M)}}T.length===0&&T.push(b);let C=d.runtimePrimitives.length;for(let A=0;A<C;A++){let E=d.runtimePrimitives[A],v=E.primitive;if(l(E.boundingSphere)&&!l(x)){let q=ae.transform(E.boundingSphere,b,mWe),J=$n.raySphere(t,q);if(!l(J))continue}let D=Xt.getAttributeBySemantic(v,Ct.POSITION),O=D.byteOffset,R=D.byteStride,M=D.count;if(!l(v.indices))continue;let N=v.indices.typedArray;if(!l(N)){let q=v.indices.buffer,J=v.indices.count,j=v.indices.indexDatatype;l(q)&&n.context.webgl2&&(j===Ne.UNSIGNED_BYTE?N=new Uint8Array(J):j===Ne.UNSIGNED_SHORT?N=new Uint16Array(J):j===Ne.UNSIGNED_INT&&(N=new Uint32Array(J)),q.getBufferData(N))}let _=D.typedArray,S=D.componentDatatype,w=D.type,I=D.quantization;l(I)&&(S=D.quantization.componentDatatype,w=D.quantization.type);let L=tn.getNumberOfComponents(w),B=X.getSizeInBytes(S),U=!l(_)&&l(R)&&R!==L*B,V=L,G=0;U&&(V=R/B,G=O/B);let k=M*V;if(!l(_)){let q=D.buffer;l(q)&&n.context.webgl2&&(_=X.createTypedArray(S,k),q.getBufferData(_,U?0:O,0,k)),I&&D.normalized&&(_=Mn.dequantize(_,S,w,M))}if(!l(N)||!l(_))return;r=y(r,ee.default),i=y(i,1),o=y(o,0);let W=N.length;for(let q=0;q<W;q+=3){let J=N[q],j=N[q+1],K=N[q+2];for(let Q of T){let de=sj(_,J,G,V,I,Q,i,o,r,aWe),xe=sj(_,j,G,V,I,Q,i,o,r,cWe),ce=sj(_,K,G,V,I,Q,i,o,r,lWe),ge=$n.rayTriangleParametric(t,de,xe,ce,y(e.backFaceCulling,!0));l(ge)&&ge<a&&ge>=0&&(a=ge)}}}}if(a!==Number.MAX_VALUE){if(s=hn.getPoint(t,a,s),n.mode!==ne.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,d=f.ellipsoid,p=f.unproject(s,hWe);d.cartographicToCartesian(p,s)}return s}}function sj(e,t,n,i,o,r,s,a,c,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],l(o))if(o.octEncoded){if(u=Mn.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let d=u.x;u.x=u.z,u.z=u.y,u.y=d}}else u=h.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=h.add(u,o.quantizedVolumeOffset,u);return u=F.multiplyByPoint(r,u,u),s!==1&&Er.getPosition(u,c,s,a,u),u}function lo(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,fr.GLTF),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new sO(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=H.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,pc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,H.RED);this._silhouetteColor=H.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,we.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ae,this._initialRadius=void 0,this._heightReference=y(e.heightReference,Ye.NONE),this._heightDirty=this._heightReference!==Ye.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=y(e.enableVerticalExaggeration,!0),this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new Cm(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?gs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?Jd.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Xx,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new s_(e.environmentMapOptions);s_.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,yn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===fr.GLTF&>("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new bt(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,Br.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,H.BLACK),this._classificationType=e.classificationType,this._statistics=new FM,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._errorEvent=new pe,this._readyEvent=new pe,this._texturesReadyEvent=new pe,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function aj(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function pWe(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new lO({model:e,propertyTable:s});n.push(a)}return n}function _We(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=Xt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],u=Xt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function uj(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(lo.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){uj(e,this._color)&&this.resetDrawCommands(),this._color=H.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!H.equals(e,this._silhouetteColor)){let t=uj(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=H.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return tle(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===fr.GLTF&>("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(gs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Jd.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(s_.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});lo.prototype.getNode=function(e){return this._nodesByName[e]};lo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};lo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};lo.prototype.getExtension=function(e){return this._loader.components.extensions[e]};lo.prototype.makeStyleDirty=function(){this._styleDirty=!0};lo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var gWe=new F,yWe=new $,xWe=new F;lo.prototype.update=function(e){let t=!1;try{t=bWe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")aj(this,n);else{let i=Xt.getError("model",this._resource,n);aj(this,i)}}if(TWe(this,e),CWe(this,e),AWe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=Xt.getError("model",this._resource,new re("Failed to load model."));aj(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&pWe(this,i);let o=new NM({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(EWe(this),SWe(this),vWe(this,e),wWe(this),DWe(this,e),IWe(this,e),PWe(this,e),RWe(this,e),OWe(this,e),MWe(this,e),LWe(this,e),this._defaultTexture=e.context.defaultTexture,NWe(this,e),FWe(this,e),BWe(this),kWe(this,e),HWe(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),UWe(this),GWe(this,e),WWe(this),jWe(this,e)}};function bWe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function TWe(e,t){l(e._customShader)&&e._customShader.update(t)}function CWe(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function AWe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function EWe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=_We(t,e),e._styleDirty=!0,e.resetDrawCommands())}function SWe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function vWe(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&ele(e)}function ele(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=rh.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function wWe(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function DWe(e,t){e._silhouetteDirty&&(nle(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function IWe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function PWe(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function RWe(e,t){let n=0;e.isClippingPolygonsEnabled()&&(e._clippingPolygons.owner===e&&(e._clippingPolygons.update(t),e._clippingPolygons.queueCommands(t)),n=e._clippingPolygons.clippingPolygonsState),n!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=n)}function OWe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function MWe(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function LWe(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function NWe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function FWe(e,t){F.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix))}var Ly=new h,cj=new fe;function BWe(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===Ye.NONE){e._clampedModelMatrix=void 0;return}let n=y(t.ellipsoid,ee.default),i=e.modelMatrix;Ly.x=i[12],Ly.y=i[13],Ly.z=i[14];let o=n.cartesianToCartographic(Ly);l(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(i,new F)),e._removeUpdateHeightCallback=t.updateHeight(o,Jce(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=Jce(e,n,o);fe.clone(o,cj),cj.height=r,s(cj)}e._heightDirty=!1,e._updateModelMatrix=!0}function kWe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;tle(e,n),VWe(e,n,t)}function tle(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ae.transform(e._boundingSphere,t,e._boundingSphere)}function VWe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);F.getTranslation(t,Ly),e._sceneMode!==ne.SCENE3D&&Hi.computeActualEllipsoidPosition(n,Ly,Ly);let s=e._boundingSphere.radius,a=qWe(Ly,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function UWe(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}var zWe=new $(1,0,0,0,0,1,0,-1,0);function HWe(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),o=t.context,r=yWe,s=gWe;if(s=F.multiply(o.uniformState.view3D,i,s),r=F.getRotation(s,r),r=$.transpose(r,r),e._iblReferenceFrameMatrix=$.multiply(zWe,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=xWe;a=F.multiply(o.uniformState.view3D,i,a),a=F.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=F.inverseTranspose(a,e._clippingPlanesMatrix)}}function GWe(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function WWe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=bt.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=bt.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=bt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function jWe(e,t){let n=XWe(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(KWe(e,t),e._sceneGraph.pushDrawCommands(t))}var lj=new ae;function qWe(e,t,n){return lj.center=e,lj.radius=t,n.camera.getPixelSize(lj,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var gz=new h;function Jce(e,t,n){return function(i){rA(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,gz);let o=e._clampedModelMatrix;F.clone(e.modelMatrix,o),o[12]=gz.x,o[13]=gz.y,o[14]=gz.z,e._heightDirty=!0}}var YWe=new h;function XWe(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===ne.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=F.getTranslation(e.modelMatrix,YWe);Hi.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function KWe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}lo.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};lo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function nle(e){return e.context.stencilBuffer}lo.prototype.hasSilhouette=function(e){return nle(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};lo.prototype.hasSkipLevelOfDetail=function(e){if(!fr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};lo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};lo.prototype.pick=function(e,t,n,i,o){return aE(this,e,t,n,i,o)};lo.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};lo.prototype.isDestroyed=function(){return!1};lo.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,ue(this)};lo.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};lo.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};lo.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),o=Se.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=Se.createIfNeeded(t);let r=new l_(n),a=l(e.content)?fr.TILE_GLTF:fr.GLTF,c=n.gltfResource,u=VM(r,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),Xt.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let d=new lo(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(bt.clone(p[m]))}return d};lo.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new $R(t);try{await n.load();let i=VM(n,fr.TILE_B3DM,e);return new lo(i)}catch(i){throw n.destroy(),i}};lo.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new kM(t);try{await n.load();let i=VM(n,fr.TILE_PNTS,e);return new lo(i)}catch(i){throw n.destroy(),i}};lo.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new eO(t);try{await n.load();let i=VM(n,fr.TILE_I3DM,e);return new lo(i)}catch(i){throw n.destroy(),i}};lo.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new QR(t),i=VM(n,fr.TILE_GEOJSON,e);return new lo(i)};var ZWe=new H;lo.prototype.applyColorAndShow=function(e){let t=H.clone(this._color,ZWe),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):H.clone(H.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,uj(t,this._color)&&this.resetDrawCommands()};lo.prototype.applyStyle=function(e){let t=this.type===fr.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),ele(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function VM(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var sh=lo;function Hr(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Hr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Hr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Hr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Hr.prototype.getExtension=function(e){return this._model.getExtension(e)};Hr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Hr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Hr.prototype.applyDebugSettings=function(e,t){t=e?t:H.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Hr.prototype.applyStyle=function(e){this._model.style=e};Hr.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;l(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),l(s)&&l(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:zl.REPEAT}),this._ready=!0)};Hr.prototype.isDestroyed=function(){return!1};Hr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Hr.fromGltf=async function(e,t,n,i){let o=new Hr(e,t,n),s=UM(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await sh.fromGltfAsync(s);return o._model=c,o};Hr.fromB3dm=async function(e,t,n,i,o){let r=new Hr(e,t,n),a=UM(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await sh.fromB3dm(a);return r._model=u,r};Hr.fromI3dm=async function(e,t,n,i,o){let r=new Hr(e,t,n),a=UM(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await sh.fromI3dm(a);return r._model=c,r};Hr.fromPnts=async function(e,t,n,i,o){let r=new Hr(e,t,n),a=UM(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await sh.fromPnts(a);return r._model=c,r};Hr.fromGeoJson=async function(e,t,n,i){let o=new Hr(e,t,n),s=UM(e,t,o,{geoJson:i,resource:n}),a=await sh.fromGeoJson(s);return o._model=a,o};Hr.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ee.WGS84,n)};function UM(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:we.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return xt(i,o)}var Pu=Hr;function Bf(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Bf.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Bf.fromJson=function(e,t,n,i){let o=new Bf(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Bf.prototype.hasProperty=function(e,t){return!1};Bf.prototype.getFeature=function(e){};Bf.prototype.applyDebugSettings=function(e,t){};Bf.prototype.applyStyle=function(e){};Bf.prototype.update=function(e,t){};Bf.prototype.pick=function(e,t,n){};Bf.prototype.isDestroyed=function(){return!1};Bf.prototype.destroy=function(){return ue(this)};var zM=Bf;var HM=`uniform sampler2D u_atlas; #ifdef VECTOR_TILE uniform vec4 u_highlightColor; @@ -4341,7 +8744,7 @@ void main() #endif } -`;var xP=`#ifdef INSTANCED +`;var GM=`#ifdef INSTANCED in vec2 direction; #endif in vec4 positionHighAndScale; @@ -4777,1729 +9180,526 @@ if (lengthSq < disableDepthTestDistance) { v_color.a *= translucency; v_splitDirection = splitDirection; } -`;var bP=`in vec2 v_textureCoordinates; -const float M_PI = 3.141592653589793; - -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) - { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); - } - return value; -} - -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); -} - -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) -{ - float alphaRoughnessSquared = alphaRoughness * alphaRoughness; - float phi = 2.0 * M_PI * xi.x; - float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(upVector, N)); - vec3 tangentY = cross(N, tangentX); - return tangentX * H.x + tangentY * H.y + N * H.z; -} - -/** - * Estimate the geometric self-shadowing of the microfacets in a surface, - * using the Smith Joint GGX visibility function. - * Note: Vis = G / (4 * NdotL * NdotV) - * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3 - * see Real-Time Rendering. Page 331 to 336. - * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg) - * - * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness. - * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source. - * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera. - */ -float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) -{ - float alphaRoughnessSq = alphaRoughness * alphaRoughness; - - float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); - float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); - - float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0 - if (GGX > 0.0) - { - return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0 - } - return 0.0; -} - -vec2 integrateBrdf(float roughness, float NdotV) -{ - vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); - float A = 0.0; - float B = 0.0; - const int NumSamples = 1024; - float alphaRoughness = roughness * roughness; - for (int i = 0; i < NumSamples; i++) - { - vec2 xi = hammersley2D(i, NumSamples); - vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); - vec3 L = 2.0 * dot(V, H) * H - V; - float NdotL = clamp(L.z, 0.0, 1.0); - float NdotH = clamp(H.z, 0.0, 1.0); - float VdotH = clamp(dot(V, H), 0.0, 1.0); - if (NdotL > 0.0) - { - float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); - float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; - float Fc = pow(1.0 - VdotH, 5.0); - A += (1.0 - Fc) * G_Vis; - B += Fc * G_Vis; - } - } - return vec2(A, B) / float(NumSamples); -} - -void main() -{ - out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); -} -`;var TP=`uniform sampler2D u_noiseTexture; -uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -in vec2 v_offset; -in vec3 v_maximumSize; -in vec4 v_color; -in float v_slice; -in float v_brightness; - -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); - } - return mod(value, rangeLength); -} - -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); -} - -vec2 voxelToUV(vec3 voxelIndex) { - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - - float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; - vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, - inverseNoiseTextureRows / textureSliceWidth); - vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); - float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); - float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); - - float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; - float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; - return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; -} - -// Interpolate a voxel with its neighbor (along the positive X-axis) -vec4 lerpSamplesX(vec3 voxelIndex, float x) { - vec2 uv0 = voxelToUV(voxelIndex); - vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); - vec4 sample0 = texture(u_noiseTexture, uv0); - vec4 sample1 = texture(u_noiseTexture, uv1); - return mix(sample0, sample1, x); -} - -vec4 sampleNoiseTexture(vec3 position) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); - vec3 lerpValue = fract(recenteredPos); - vec3 voxelIndex = floor(recenteredPos); - - vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); - vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); - vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); - vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); - - vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); - vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); - return mix(yLerp0, yLerp1, lerpValue.z); -} - -// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). -bool intersectSphere(vec3 origin, vec3 dir, float slice, - out vec3 point, out vec3 normal) { - float A = dot(dir, dir); - float B = dot(origin, dir); - float C = dot(origin, origin) - 0.25; - float discriminant = (B * B) - (A * C); - if(discriminant < 0.0) { - return false; - } - float root = sqrt(discriminant); - float t = (-B - root) / A; - if(t < 0.0) { - t = (-B + root) / A; - } - point = origin + t * dir; - - if(slice >= 0.0) { - point.z = (slice / 2.0) - 0.5; - if(length(point) > 0.5) { - return false; - } - } - - normal = normalize(point); - point -= czm_epsilon2 * normal; - return true; -} - -// Transforms the ray origin and direction into unit sphere space, -// then transforms the result back into the ellipsoid's space. -bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, - out vec3 point, out vec3 normal) { - if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { - return false; - } - - vec3 o = (origin - center) / scale; - vec3 d = dir / scale; - vec3 p, n; - bool intersected = intersectSphere(o, d, slice, p, n); - if(intersected) { - point = (p * scale) + center; - normal = n; - } - return intersected; -} - -// Assume that if phase shift is being called for octave i, -// the frequency is of i - 1. This saves us from doing extra -// division / multiplication operations. -vec2 phaseShift2D(vec2 p, vec2 freq) { - return (czm_pi / 2.0) * sin(freq.yx * p.yx); -} - -vec2 phaseShift3D(vec3 p, vec2 freq) { - return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); -} - -// The cloud texture function derived from Gardner's 1985 paper, -// "Visual Simulation of Clouds." -// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf -const float T0 = 0.6; // contrast of the texture pattern -const float k = 0.1; // computed to produce a maximum value of 1 -const float C0 = 0.8; // coefficient -const float FX0 = 0.6; // frequency X -const float FY0 = 0.6; // frequency Y -const int octaves = 5; - -float T(vec3 point) { - vec2 sum = vec2(0.0); - float Ci = C0; - vec2 FXY = vec2(FX0, FY0); - vec2 PXY = vec2(0.0); - for(int i = 1; i <= octaves; i++) { - PXY = phaseShift3D(point, FXY); - Ci *= 0.707; - FXY *= 2.0; - vec2 sinTerm = sin(FXY * point.xy + PXY); - sum += Ci * sinTerm + vec2(T0); - } - return k * sum.x * sum.y; -} - -const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, -const float t = 0.4; // fraction of texture shading -const float s = 0.25; // fraction of specular reflection - -float I(float Id, float Is, float It) { - return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; -} - -const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); - -vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, - float brightness) { - vec3 cloudPoint, cloudNormal; - if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, - cloudPoint, cloudNormal)) { - return vec4(0.0); - } - - float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection - float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection - float It = T(cloudPoint); // texture function - float intensity = I(Id, Is, It); - vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); - - vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); - float W = noise.x; - float W2 = noise.y; - float W3 = noise.z; - - // The dot product between the cloud's normal and the ray's direction is greatest - // in the center of the ellipsoid's surface. It decreases towards the edge. - // Thus, it is used to blur the areas leading to the edges of the ellipsoid, - // so that no harsh lines appear. - - // The first (and biggest) layer of worley noise is then subtracted from this. - // The final result is scaled up so that the base cloud is not too translucent. - float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); - float TR = pow(ndDot, 3.0) - W; // translucency - TR *= 1.3; - - // Subtracting the second and third layers of worley noise is more complicated. - // If these layers of noise were simply subtracted from the current translucency, - // the shape derived from the first layer of noise would be completely deleted. - // The erosion of this noise should thus be constricted to the edges of the cloud. - // However, because the edges of the ellipsoid were already blurred away, mapping - // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. - // The value of (0.5 - ndDot) provides the best compromise. - float minusDot = 0.5 - ndDot; - - // Even with the previous calculation, subtracting the second layer of wnoise - // erode too much of the cloud. The addition of it, however, will detailed - // volume to the cloud. As long as the noise is only added and not subtracted, - // the results are aesthetically pleasing. - - // The minusDot product is mapped in a way that it is larger at the edges of - // the ellipsoid, so a subtraction and min operation are used instead of - // an addition and max one. - TR -= min(minusDot * W2, 0.0); - - // The third level of worley noise is subtracted from the result, with some - // modifications. First, a scalar is added to minusDot so that the noise - // starts affecting the shape farther away from the center of the ellipsoid's - // surface. Then, it is scaled down so its impact is not too intense. - TR -= 0.8 * (minusDot + 0.25) * W3; - - // The texture function's shading does not correlate with the shape of the cloud - // produced by the layers of noise, so an extra shading scalar is calculated. - // The darkest areas of the cloud are assigned to be where the noise erodes - // the cloud the most. This is then interpolated based on the translucency - // and the diffuse shading term of that point in the cloud. - float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); - - // To avoid values that are too dark, this scalar is increased by a small amount - // and clamped so it never goes to zero. - shading = clamp(shading + 0.2, 0.3, 1.0); - - // Finally, the contrast of the cloud's color is increased. - vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); - return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; -} - -void main() { -#ifdef DEBUG_BILLBOARDS - out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); -#endif - // To avoid calculations with high values, - // we raycast from an arbitrarily smaller space. - vec2 coordinate = v_maximumSize.xy * v_offset; - - vec3 ellipsoidScale = 0.82 * v_maximumSize; - vec3 ellipsoidCenter = vec3(0.0); - - float zOffset = max(ellipsoidScale.z - 10.0, 0.0); - vec3 eye = vec3(0, 0, -10.0 - zOffset); - vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); - vec3 rayOrigin = eye; -#ifdef DEBUG_ELLIPSOIDS - vec3 point, normal; - if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, - point, normal)) { - out_FragColor = v_brightness * v_color; - } -#else -#ifndef DEBUG_BILLBOARDS - vec4 cloud = drawCloud(rayOrigin, rayDir, - ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); - if(cloud.w < 0.01) { - discard; - } - out_FragColor = cloud; -#endif -#endif -} -`;var CP=`#ifdef INSTANCED -in vec2 direction; -#endif -in vec4 positionHighAndScaleX; -in vec4 positionLowAndScaleY; -in vec4 packedAttribute0; -in vec4 packedAttribute1; -in vec4 color; - -out vec2 v_offset; -out vec3 v_maximumSize; -out vec4 v_color; -out float v_slice; -out float v_brightness; - -void main() { - // Unpack attributes. - vec3 positionHigh = positionHighAndScaleX.xyz; - vec3 positionLow = positionLowAndScaleY.xyz; - vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); - - float show = packedAttribute0.x; - float brightness = packedAttribute0.y; - vec2 coordinates = packedAttribute0.wz; - vec3 maximumSize = packedAttribute1.xyz; - float slice = packedAttribute1.w; - -#ifdef INSTANCED - vec2 dir = direction; -#else - vec2 dir = coordinates; -#endif - - vec2 offset = dir - vec2(0.5, 0.5); - vec2 scaledOffset = scale * offset; - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - positionEC.xy += scaledOffset; - - positionEC.xyz *= show; - gl_Position = czm_projection * positionEC; - - v_offset = offset; - v_maximumSize = maximumSize; - v_color = color; - v_slice = slice; - v_brightness = brightness; -} -`;var AP=`uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -uniform vec3 u_noiseOffset; -in vec2 v_position; - -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); - } - return mod(value, rangeLength); -} - -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); -} - -vec3 random3(vec3 p) { - float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); - float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); - return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); -} - -// Frequency corresponds to cell size. -// The higher the frequency, the smaller the cell size. -vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 cell = centerCell + offset; - cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); - cell += floor(u_noiseOffset / u_noiseDetail); - vec3 p = offset + random3(cell); - return p; -} - -float worleyNoise(vec3 p, float freq) { - vec3 centerCell = floor(p * freq); - vec3 pointInCell = fract(p * freq); - float shortestDistance = 1000.0; - - for(float z = -1.0; z <= 1.0; z++) { - for(float y = -1.0; y <= 1.0; y++) { - for(float x = -1.0; x <= 1.0; x++) { - vec3 offset = vec3(x, y, z); - vec3 point = getWorleyCellPoint(centerCell, offset, freq); - - float distance = length(pointInCell - point); - if(distance < shortestDistance) { - shortestDistance = distance; - } - } - } - } - - return shortestDistance; -} - -const float MAX_FBM_ITERATIONS = 10.0; - -float worleyFBMNoise(vec3 p, float octaves, float scale) { - float noise = 0.0; - float freq = 1.0; - float persistence = 0.625; - for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { - if(i >= octaves) { - break; - } - - noise += worleyNoise(p * scale, freq * scale) * persistence; - persistence *= 0.5; - freq *= 2.0; - } - return noise; -} - -void main() { - float textureSliceWidth = u_noiseTextureDimensions.x; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - float x = mod(v_position.x, textureSliceWidth); - float y = mod(v_position.y, textureSliceWidth); - float sliceRow = floor(v_position.y / textureSliceWidth); - float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; - - vec3 position = vec3(x, y, z); - position /= u_noiseDetail; - float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); - float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); - float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); - out_FragColor = vec4(worley0, worley1, worley2, 1.0); -} -`;var EP=`uniform vec3 u_noiseTextureDimensions; -in vec2 position; - -out vec2 v_position; - -void main() -{ - gl_Position = vec4(position, 0.1, 1.0); - - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - vec2 transformedPos = (position * 0.5) + vec2(0.5); - transformedPos *= textureSliceWidth; - transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; - transformedPos.y *= noiseTextureRows; - v_position = transformedPos; -} -`;var SP=`uniform sampler2D u_opaqueDepthTexture; -uniform sampler2D u_translucentDepthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; - float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; - translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); - out_FragColor = czm_packDepth(translucentDepth); -} -`;var vP=`/** - * Compositing for Weighted Blended Order-Independent Transparency. See: - * - http://jcgt.org/published/0002/02/09/ - * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html - */ - -uniform sampler2D u_opaque; -uniform sampler2D u_accumulation; -uniform sampler2D u_revealage; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 opaque = texture(u_opaque, v_textureCoordinates); - vec4 accum = texture(u_accumulation, v_textureCoordinates); - float r = texture(u_revealage, v_textureCoordinates).r; - -#ifdef MRT - vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); -#else - vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); -#endif - - out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; - - if (opaque != czm_backgroundColor) - { - out_FragColor.a = 1.0; - } -} -`;var wP=`uniform samplerCube u_radianceMap; - -in vec2 v_textureCoordinates; - - -const float twoSqrtPi = 2.0 * sqrt(czm_pi); - -// Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf -float computeShBasis(int index, vec3 s) { - if (index == 0) { // l = 0, m = 0 - return 1.0 / twoSqrtPi; - } - - if (index == 1) { // l = 1, m = -1 - return -sqrt(3.0) * s.y / twoSqrtPi; - } - - if (index == 2) { // l = 1, m = 0 - return sqrt(3.0) * s.z / twoSqrtPi; - } - - if (index == 3) { // l = 1, m = 1 - return -sqrt(3.0) * s.x / twoSqrtPi; - } - - if (index == 4) { // l = 2, m = -2 - return sqrt(15.0) * s.y * s.x / twoSqrtPi; - } - - if (index == 5) { // l = 2, m = -1 - return -sqrt(15.0) * s.y * s.z / twoSqrtPi; - } - - if (index == 6) { // l = 2, m = 0 - return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; - } - - if (index == 7) { // l = 2, m = 1 - return -sqrt(15.0) * s.x * s.z / twoSqrtPi; - } - - if (index == 8) { // l = 2, m = 2 - return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; - } - - return 0.0; -} - -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) - { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); - } - return value; -} - -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); -} - -// Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics -const int samples = 256; -const float solidAngle = 1.0 / float(samples); - -void main() { - // Get the current coefficient based on the uv - vec2 uv = v_textureCoordinates.xy * 3.0; - int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); - - for (int i = 0; i < samples; ++i) { - vec2 xi = hammersley2D(i, samples); - float phi = czm_twoPi * xi.x; - float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); - - // Generate the spherical harmonics basis from the direction - float Ylm = computeShBasis(coefficientIndex, direction); - - vec3 lookupDirection = -direction.xyz; - lookupDirection.z = -lookupDirection.z; - - vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); - - // Use the relevant function for this coefficient - out_FragColor += Ylm * color * solidAngle * sinTheta; - } - -} -`;var DP=`precision highp float; - -in vec2 v_textureCoordinates; - -uniform vec3 u_faceDirection; // Current cubemap face -uniform vec3 u_positionWC; -uniform mat4 u_enuToFixedFrame; -uniform vec4 u_brightnessSaturationGammaIntensity; -uniform vec4 u_groundColor; // alpha component represent albedo - -vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { - vec2 scaledUV = uv * 2.0 - 1.0; - - if (faceDir.x != 0.0) { - return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); - } else if (faceDir.y != 0.0) { - return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); - } else { - return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); - } -} - -void main() { - float height = length(u_positionWC); - float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; - float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); - - // Scale the position to ensure the sky color is present, even when underground. - vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); - - float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; - float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; - - vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; - vec3 normalizedDirection = normalize(direction); - - czm_ray ray = czm_ray(positionWC, normalizedDirection); - czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); - if (!czm_isEmpty(intersection)) { - intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); - } - - bool onEllipsoid = intersection.start >= 0.0; - float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); - - // Compute sky color for each position on a sphere at radius centered around the provided position's origin - vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; - - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); - vec3 mieColor; - vec3 rayleighColor; - float opacity; - czm_computeScattering( - ray, - rayLength, - lightDirectionWC, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); - - vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); - -#ifdef ATMOSPHERE_COLOR_CORRECT - const bool ignoreBlackPixels = true; - atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); -#endif - - vec3 lookupDirection = -normalizedDirection; - // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. - lookupDirection.x = -lookupDirection.x; - lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); - lookupDirection.x = -lookupDirection.x; - - // Values outside the atmopshere are rendered as black, when they should be treated as transparent - float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); - skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent - - // Blend starmap with atmopshere scattering - float intensity = u_brightnessSaturationGammaIntensity.w; - vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); - vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); - vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); - - // Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height - vec3 up = normalize(positionWC); - float occlusion = max(dot(lightDirectionWC, up), 0.05); - vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); - vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); - - vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); - - float brightness = u_brightnessSaturationGammaIntensity.x; - float saturation = u_brightnessSaturationGammaIntensity.y; - float gamma = u_brightnessSaturationGammaIntensity.z; - -#ifdef ENVIRONMENT_COLOR_CORRECT - color.rgb = mix(vec3(0.0), color.rgb, brightness); - color.rgb = czm_saturation(color.rgb, saturation); -#endif - color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0. - color.rgb = czm_gammaCorrect(color.rgb); - - out_FragColor = color; -} -`;var IP=`precision highp float; - -in vec3 v_textureCoordinates; - -uniform float u_roughness; -uniform samplerCube u_radianceTexture; -uniform vec3 u_faceDirection; - -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) - { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); - } - return value; -} - -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); -} - -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) -{ - float alphaRoughnessSquared = alphaRoughness * alphaRoughness; - float phi = czm_twoPi * xi.x; - float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(upVector, N)); - vec3 tangentY = cross(N, tangentX); - return tangentX * H.x + tangentY * H.y + N * H.z; -} - -// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses -const int samples = 128; - -void main() { - vec3 normal = u_faceDirection; - vec3 V = normalize(v_textureCoordinates); - float roughness = u_roughness; - - vec4 color = vec4(0.0); - float weight = 0.0; - for (int i = 0; i < samples; ++i) { - vec2 xi = hammersley2D(i, samples); - vec3 H = importanceSampleGGX(xi, roughness, V); - vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector - - float NdotL = max(dot(V, L), 0.0); - if (NdotL > 0.0) { - color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; - weight += NdotL; - } - } - out_FragColor = color / weight; -} -`;var PP=`in vec3 position; -out vec3 v_textureCoordinates; - -uniform vec3 u_faceDirection; - -vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { - vec2 scaledUV = uv; - - if (faceDir.x != 0.0) { - return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); - } else if (faceDir.y != 0.0) { - return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); - } else { - return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); - } -} - +`;function bi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Bt.clone(n)),l(i)&&(i=Bt.clone(i)),l(o)&&(o=Bt.clone(o)),l(r)&&(r=Mt.clone(r)),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._pixelOffset=z.clone(y(e.pixelOffset,z.ZERO)),this._translate=new z(0,0),this._eyeOffset=h.clone(y(e.eyeOffset,h.ZERO)),this._heightReference=y(e.heightReference,Ye.NONE),this._verticalOrigin=y(e.verticalOrigin,Rn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,yi.CENTER),this._scale=y(e.scale,1),this._color=H.clone(y(e.color,H.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=h.clone(y(e.alignedAxis,h.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=zn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=H.clone(y(e.outlineColor,H.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping(),this._splitDirection=y(e.splitDirection,Br.NONE)}var ile=bi.SHOW_INDEX=0,xz=bi.POSITION_INDEX=1,ale=bi.PIXEL_OFFSET_INDEX=2,$We=bi.EYE_OFFSET_INDEX=3,QWe=bi.HORIZONTAL_ORIGIN_INDEX=4,JWe=bi.VERTICAL_ORIGIN_INDEX=5,eje=bi.SCALE_INDEX=6,bz=bi.IMAGE_INDEX_INDEX=7,ole=bi.COLOR_INDEX=8,tje=bi.ROTATION_INDEX=9,nje=bi.ALIGNED_AXIS_INDEX=10,ije=bi.SCALE_BY_DISTANCE_INDEX=11,oje=bi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,rje=bi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,sje=bi.DISTANCE_DISPLAY_CONDITION=14,aje=bi.DISABLE_DEPTH_DISTANCE=15;bi.TEXTURE_COORDINATE_BOUNDS=16;var rle=bi.SDF_INDEX=17,cje=bi.SPLIT_DIRECTION_INDEX=18;bi.NUMBER_OF_PROPERTIES=19;function Vo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(bi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Vo(this,ile))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),Vo(this,xz))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Vo(this,xz))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;z.equals(t,e)||(z.clone(e,t),Vo(this,ale))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),Vo(this,ije))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),Vo(this,oje))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Bt.equals(t,e)||(this._pixelOffsetScaleByDistance=Bt.clone(e,t),Vo(this,rje))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Vo(this,$We))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Vo(this,QWe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Vo(this,JWe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Vo(this,eje))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),Vo(this,ole))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Vo(this,tje))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Vo(this,nje))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Vo(this,bz))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Vo(this,bz))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Vo(this,ole))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),Vo(this,sje))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Vo(this,aje))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof Se?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(zn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Vo(this,bz))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition),Vo(this,xz)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Vo(this,ile))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),Vo(this,rle))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Vo(this,rle))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Vo(this,cje))}}});bi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};bi.prototype._updateClamping=function(){bi._updateClamping(this._billboardCollection,this)};var Tz=new fe;bi._updateClamping=function(e,t){let n=e._scene;if(!l(n))return;let i=y(n.ellipsoid,ee.default),o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===Ye.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Ye.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(u){let f=i.cartographicToCartesian(u,t._clampedPosition);rA(t._heightReference)&&(t._mode===ne.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),fe.clone(s,Tz);let c=n.getHeight(s,t._heightReference);l(c)&&(Tz.height=c),a(Tz)};bi.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(c){if(r._imageId!==t||r._image!==n||!je.equals(r._imageSubRegion,i))return;let u=e.textureCoordinates[c];r._imageWidth=e.texture.width*u.width,r._imageHeight=e.texture.height*u.height,r._imageIndex=c,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,Vo(r,bz);let f=r._billboardCollection._scene;l(f)&&f.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;let a=e.getImageIndex(t);if(l(a)&&!l(i)){s(a);return}o.then(s).catch(function(c){console.error(`Error loading image for billboard: ${c}`),r._imageIndexPromise=void 0})};bi.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};bi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&je.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=je.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};bi.prototype._setTranslate=function(e){let t=this._translate;z.equals(t,e)||(z.clone(e,t),Vo(this,ale))};bi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};bi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Vo(this,xz)};var sle=new oe;bi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(F.multiplyByPoint(i,t,sle),Hi.computeActualEllipsoidPosition(n,sle))};var cle=new h;bi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=F.multiplyByPoint(e,t,cle),a=Hi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return z.add(a,i,a),a};var yz=new z(0,0);bi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new z),z.clone(this._pixelOffset,yz),z.add(yz,this._translate,yz);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,Tz);o=a.cartographicToCartesian(c,cle),i=F.IDENTITY}return bi._computeScreenSpacePosition(i,o,this._eyeOffset,yz,e,t)};bi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===yi.RIGHT?s-=i:e.horizontalOrigin===yi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Rn.BOTTOM||e.verticalOrigin===Rn.BASELINE?a-=o:e.verticalOrigin===Rn.CENTER&&(a-=o*.5),l(n)||(n=new je),n.x=s,n.y=a,n.width=i,n.height=o,n};bi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&je.equals(this._imageSubRegion,e._imageSubRegion)&&H.equals(this._color,e._color)&&z.equals(this._pixelOffset,e._pixelOffset)&&z.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};bi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var uo=bi;var lje={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},vo=Object.freeze(lje);var uje={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Xs=Object.freeze(uje);function x_(e,t,n,i,o){this.bottomLeft=y(e,z.ZERO),this.topRight=y(t,z.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var fje=new z(16,16);function Ny(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,fje);this._context=e.context,this._pixelFormat=y(e.pixelFormat,et.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=zn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(Ny.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new It({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function dje(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),u=o*(a+t.height+r),f=s/c,d=a/u,p=new x_(new z(s+r,r),new z(c,a)),g=new x_(new z,new z(c,a),e._root,p),m=new x_(new z(r,a+r),new z(c,u)),x=new x_(new z,new z(c,u),g,m);for(let C=0;C<e._textureCoordinates.length;C++){let A=e._textureCoordinates[C];l(A)&&(A.x*=f,A.y*=d,A.width*=f,A.height*=d)}let b=new It({context:e._context,width:c,height:u,pixelFormat:e._pixelFormat}),T=new Nr({context:n,colorTextures:[e._texture],destroyAttachments:!1});T._bind(),b.copyFromFramebuffer(0,0,0,0,c,u),T._unBind(),T.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=b,e._root=x}else{let s=o*(t.width+2*r),a=o*(t.height+2*r);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new It({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new x_(new z(r,r),new z(s,a))}}function Cz(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,r=i-n.width,s=o-n.height;if(r<0||s<0)return;if(r===0&&s===0)return t;if(r>s){t.childNode1=new x_(new z(t.bottomLeft.x,t.bottomLeft.y),new z(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new x_(new z(a,t.bottomLeft.y),new z(t.topRight.x,t.topRight.y)))}else{t.childNode1=new x_(new z(t.bottomLeft.x,t.bottomLeft.y),new z(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new x_(new z(t.bottomLeft.x,a),new z(t.topRight.x,t.topRight.y)))}return Cz(e,t.childNode1,n)}return Cz(e,t.childNode1,n)||Cz(e,t.childNode2,n)}}function lle(e,t,n){let i=Cz(e,e._root,t);if(l(i)){i.imageIndex=n;let o=e._texture.width,r=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/o,u=i.bottomLeft.y/r,f=s/o,d=a/r;e._textureCoordinates[n]=new je(c,u,f,d),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else dje(e,t),lle(e,t,n);e._guid=zn()}function ule(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return lle(e,t,n),n}Ny.prototype.getImageIndex=function(e){return this._indexHash[e]};Ny.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=ule(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};Ny.prototype.addImage=function(e,t){let n=this._idHash[e];if(l(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof Se)&&(t=Se.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(o){let r=ule(i,o);return i._indexHash[e]=r,r}),this._idHash[e]=n,n};Ny.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new re(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;let r=i._texture.width,s=i._texture.height,a=i._textureCoordinates[o],c=a.x+t.x/r,u=a.y+t.y/s,f=t.width/r,d=t.height/s,p=i._textureCoordinates.push(new je(c,u,f,d))-1;return i._indexHash[e]=p,i._guid=zn(),p})};Ny.prototype.isDestroyed=function(){return!1};Ny.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Fy=Ny;var hje=uo.SHOW_INDEX,jM=uo.POSITION_INDEX,fle=uo.PIXEL_OFFSET_INDEX,dle=uo.EYE_OFFSET_INDEX,mje=uo.HORIZONTAL_ORIGIN_INDEX,pje=uo.VERTICAL_ORIGIN_INDEX,_je=uo.SCALE_INDEX,WM=uo.IMAGE_INDEX_INDEX,hle=uo.COLOR_INDEX,gje=uo.ROTATION_INDEX,yje=uo.ALIGNED_AXIS_INDEX,mle=uo.SCALE_BY_DISTANCE_INDEX,ple=uo.TRANSLUCENCY_BY_DISTANCE_INDEX,_le=uo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,gle=uo.DISTANCE_DISPLAY_CONDITION,xje=uo.DISABLE_DEPTH_DISTANCE,bje=uo.TEXTURE_COORDINATE_BOUNDS,yle=uo.SDF_INDEX,xle=uo.SPLIT_DIRECTION_INDEX,gj=uo.NUMBER_OF_PROPERTIES,fo,Tje={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},Cje={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function Uf(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(gj),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,vo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW],this._highlightColor=H.clone(H.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(Uf.prototype,{length:{get:function(){return yj(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function ble(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Uf.prototype.add=function(e){let t=new uo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Uf.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Uf.prototype.removeAll=function(){ble(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function yj(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Uf.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Uf.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Uf.prototype.get=function(e){return yj(this),this._billboards[e]};var fj;function Aje(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=_t.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function Eje(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=_t.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function Sje(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=_t.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Uf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<gj;++i){let o=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function vje(e,t,n,i,o,r){let s=[{index:fo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[jM]},{index:fo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[jM]},{index:fo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[fle]},{index:fo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[ple]},{index:fo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[hle]},{index:fo.eyeOffset,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[dle]},{index:fo.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[mle]},{index:fo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[_le]},{index:fo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[gle]},{index:fo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[bje]},{index:fo.splitDirection,componentsPerAttribute:1,componentDatatype:X.FLOAT,usage:n[xle]}];i&&s.push({index:fo.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:Sje(e)}),l(o)&&s.push({index:fo.a_batchId,componentsPerAttribute:1,componentDatatype:X.FLOAT,bufferUsage:Fe.STATIC_DRAW}),r&&s.push({index:fo.sdf,componentsPerAttribute:2,componentDatatype:X.FLOAT,usage:n[yle]});let a=i?t:4*t;return new Rp(e,s,a,i)}var dj=new Hn;function Tle(e,t,n,i,o){let r,s=i[fo.positionHighAndScale],a=i[fo.positionLowAndRotation],c=o._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Hn.fromCartesian(c,dj);let u=o.scale,f=o.rotation;f!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);let d=dj.high,p=dj.low;e._instanced?(r=o._index,s(r,d.x,d.y,d.z,u),a(r,p.x,p.y,p.z,f)):(r=o._index*4,s(r+0,d.x,d.y,d.z,u),s(r+1,d.x,d.y,d.z,u),s(r+2,d.x,d.y,d.z,u),s(r+3,d.x,d.y,d.z,u),a(r+0,p.x,p.y,p.z,f),a(r+1,p.x,p.y,p.z,f),a(r+2,p.x,p.y,p.z,f),a(r+3,p.x,p.y,p.z,f))}var Vf=new z,kf=32768,cE=65536,hj=4096,Em=256,wje=128,Dje=32,Ije=8,Cle=4,Pje=1/256,Ale=0,Ele=2,Sle=3,vle=1;function wle(e,t,n,i,o){let r,s=i[fo.compressedAttribute0],a=o.pixelOffset,c=a.x,u=a.y,f=o._translate,d=f.x,p=f.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+d),Math.abs(-u+p));let g=o.horizontalOrigin,m=o._verticalOrigin,x=o.show&&o.clusterShow;o.color.alpha===0&&(x=!1),m===Rn.BASELINE&&(m=Rn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&g===yi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&m===Rn.CENTER;let b=0,T=0,C=0,A=0,E=o._imageIndex;if(E!==-1){let U=n[E];b=U.x,T=U.y,C=U.width,A=U.height}let v=b+C,D=T+A,O=Math.floor(P.clamp(c,-kf,kf)+kf)*wje;O+=(g+1)*Dje,O+=(m+1)*Ije,O+=(x?1:0)*Cle;let R=Math.floor(P.clamp(u,-kf,kf)+kf)*Em,M=Math.floor(P.clamp(d,-kf,kf)+kf)*Em,N=(P.clamp(p,-kf,kf)+kf)*Pje,_=Math.floor(N),S=Math.floor((N-_)*Em);R+=_,M+=S,Vf.x=b,Vf.y=T;let w=Mn.compressTextureCoordinates(Vf);Vf.x=v;let I=Mn.compressTextureCoordinates(Vf);Vf.y=D;let L=Mn.compressTextureCoordinates(Vf);Vf.x=b;let B=Mn.compressTextureCoordinates(Vf);e._instanced?(r=o._index,s(r,O,R,M,w)):(r=o._index*4,s(r+0,O+Ale,R,M,w),s(r+1,O+Ele,R,M,I),s(r+2,O+Sle,R,M,L),s(r+3,O+vle,R,M,B))}function Dle(e,t,n,i,o){let r,s=i[fo.compressedAttribute1],a=o.alignedAxis;h.equals(a,h.ZERO)||(e._shaderAlignedAxis=!0);let c=0,u=1,f=1,d=1,p=o.translucencyByDistance;l(p)&&(c=p.near,u=p.nearValue,f=p.far,d=p.farValue,(u!==1||d!==1)&&(e._shaderTranslucencyByDistance=!0));let g=0,m=o._imageIndex;m!==-1&&(g=n[m].width);let x=e._textureAtlas.texture.width,b=Math.round(y(o.width,x*g));e._maxSize=Math.max(e._maxSize,b);let T=P.clamp(b,0,cE),C=0;Math.abs(h.magnitudeSquared(a)-1)<P.EPSILON6&&(C=Mn.octEncodeFloat(a)),u=P.clamp(u,0,1),u=u===1?255:u*255|0,T=T*Em+u,d=P.clamp(d,0,1),d=d===1?255:d*255|0,C=C*Em+d,e._instanced?(r=o._index,s(r,T,C,c,f)):(r=o._index*4,s(r+0,T,C,c,f),s(r+1,T,C,c,f),s(r+2,T,C,c,f),s(r+3,T,C,c,f))}function pj(e,t,n,i,o){let r,s=i[fo.compressedAttribute2],a=o.color,c=l(e._batchTable)?H.WHITE:o.getPickId(t.context).color,u=o.sizeInMeters?1:0,f=Math.abs(h.magnitudeSquared(o.alignedAxis)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&u===1;let d=0,p=o._imageIndex;p!==-1&&(d=n[p].height);let g=e._textureAtlas.texture.dimensions,m=Math.round(y(o.height,g.y*d));e._maxSize=Math.max(e._maxSize,m);let x=y(o._labelHorizontalOrigin,-2);x+=2;let b=m*Cle+x,T=H.floatToByte(a.red),C=H.floatToByte(a.green),A=H.floatToByte(a.blue),E=T*cE+C*Em+A;T=H.floatToByte(c.red),C=H.floatToByte(c.green),A=H.floatToByte(c.blue);let v=T*cE+C*Em+A,D=H.floatToByte(a.alpha)*cE+H.floatToByte(c.alpha)*Em;D+=u*2+f,e._instanced?(r=o._index,s(r,E,v,D,b)):(r=o._index*4,s(r+0,E,v,D,b),s(r+1,E,v,D,b),s(r+2,E,v,D,b),s(r+3,E,v,D,b))}function _j(e,t,n,i,o){let r,s=i[fo.eyeOffset],a=o.eyeOffset,c=a.z;if(o._heightReference!==Ye.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let u=0,f=0,d=o._imageIndex;if(d!==-1){let g=n[d];u=g.width,f=g.height}Vf.x=u,Vf.y=f;let p=Mn.compressTextureCoordinates(Vf);r=o._index,s(r,a.x,a.y,c,p)}else r=o._index*4,s(r+0,a.x,a.y,c,0),s(r+1,a.x,a.y,c,0),s(r+2,a.x,a.y,c,0),s(r+3,a.x,a.y,c,0)}function Ile(e,t,n,i,o){let r,s=i[fo.scaleByDistance],a=0,c=1,u=1,f=1,d=o.scaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,u,f)):(r=o._index*4,s(r+0,a,c,u,f),s(r+1,a,c,u,f),s(r+2,a,c,u,f),s(r+3,a,c,u,f))}function Ple(e,t,n,i,o){let r,s=i[fo.pixelOffsetScaleByDistance],a=0,c=1,u=1,f=1,d=o.pixelOffsetScaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,u,f)):(r=o._index*4,s(r+0,a,c,u,f),s(r+1,a,c,u,f),s(r+2,a,c,u,f),s(r+3,a,c,u,f))}function Rle(e,t,n,i,o){let r,s=i[fo.compressedAttribute3],a=0,c=Number.MAX_VALUE,u=o.distanceDisplayCondition;l(u)&&(a=u.near,c=u.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let f=o.disableDepthTestDistance,d=vf(o.heightReference)&&t.context.depthTexture;l(f)||(f=d?5e3:0),f*=f,(d||f>0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,g;if(l(o._labelDimensions))g=o._labelDimensions.x,p=o._labelDimensions.y;else{let T=0,C=0,A=o._imageIndex;if(A!==-1){let v=n[A];T=v.height,C=v.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*T));let E=e._textureAtlas.texture.width;g=Math.round(y(o.width,E*C))}let m=Math.floor(P.clamp(g,0,hj)),x=Math.floor(P.clamp(p,0,hj)),b=m*hj+x;e._instanced?(r=o._index,s(r,a,c,f,b)):(r=o._index*4,s(r+0,a,c,f,b),s(r+1,a,c,f,b),s(r+2,a,c,f,b),s(r+3,a,c,f,b))}function Ole(e,t,n,i,o){if(vf(o.heightReference)){let m=e._scene,x=t.context,b=t.globeTranslucencyState.translucent,T=l(m.globe)&&m.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!b&&T}let r,s=i[fo.textureCoordinateBoundsOrLabelTranslate];if(Lt.maximumVertexTextureImageUnits>0){let m=0,x=0;l(o._labelTranslate)&&(m=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,m,x,0,0)):(r=o._index*4,s(r+0,m,x,0,0),s(r+1,m,x,0,0),s(r+2,m,x,0,0),s(r+3,m,x,0,0));return}let a=0,c=0,u=0,f=0,d=o._imageIndex;if(d!==-1){let m=n[d];a=m.x,c=m.y,u=m.width,f=m.height}let p=a+u,g=c+f;e._instanced?(r=o._index,s(r,a,c,p,g)):(r=o._index*4,s(r+0,a,c,p,g),s(r+1,a,c,p,g),s(r+2,a,c,p,g),s(r+3,a,c,p,g))}function Rje(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[fo.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function Mle(e,t,n,i,o){if(!e._sdf)return;let r,s=i[fo.sdf],a=o.outlineColor,c=o.outlineWidth,u=H.floatToByte(a.red),f=H.floatToByte(a.green),d=H.floatToByte(a.blue),p=u*cE+f*Em+d,g=c/Xs.RADIUS,m=H.floatToByte(a.alpha)*cE+H.floatToByte(g)*Em;e._instanced?(r=o._index,s(r,p,m)):(r=o._index*4,s(r+0,p+Ale,m),s(r+1,p+Ele,m),s(r+2,p+Sle,m),s(r+3,p+vle,m))}function Lle(e,t,n,i,o){let r=i[fo.splitDirection],s=0,a=o.splitDirection;l(a)&&(s=a);let c;e._instanced?(c=o._index,r(c,s)):(c=o._index*4,r(c+0,s),r(c+1,s),r(c+2,s),r(c+3,s))}function Oje(e,t,n,i,o){Tle(e,t,n,i,o),wle(e,t,n,i,o),Dle(e,t,n,i,o),pj(e,t,n,i,o),_j(e,t,n,i,o),Ile(e,t,n,i,o),Ple(e,t,n,i,o),Rle(e,t,n,i,o),Ole(e,t,n,i,o),Rje(e,t,n,i,o),Mle(e,t,n,i,o),Lle(e,t,n,i,o)}function mj(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=uo._computeActualPosition(u,f,i,o);l(d)&&(u._setActualPosition(d),r?a.push(d):ae.expand(s,d,s))}r&&ae.fromPoints(a,s)}function Mje(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&mj(e,i,i.length,t,r,!0)):n===ne.MORPHING?mj(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&mj(e,o,e._billboardsToUpdateIndex,t,r,!1)}function Lje(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function Nje(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; +in vec2 v_textureCoordinates; void main() -{ - v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); - v_textureCoordinates.y = -v_textureCoordinates.y; - v_textureCoordinates.z = -v_textureCoordinates.z; - gl_Position = vec4(position, 1.0); -} -`;var RP=`in vec4 positionEC; +{ + out_FragColor = texture(billboard_texture, v_textureCoordinates); +} +`,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=we.OVERLAY,i}var Fje=[];Uf.prototype.update=function(e){if(yj(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,fo=this._instanced?Cje:Tje,fj=this._instanced?Eje:Aje;let o=this._textureAtlas;if(!l(o)){o=this._textureAtlas=new Fy({context:i});for(let R=0;R<n;++R)t[R]._loadImage()}let r=o.textureCoordinates;if(r.length===0)return;Mje(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R<gj;++R)c[R]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=vje(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let R=0;R<n;++R){let M=this._billboards[R];M._dirty=!1,Oje(this,e,r,d,M)}this._vaf.commit(fj(i))}this._billboardsToUpdateIndex=0}else if(a>0){let R=Fje;R.length=0,(c[jM]||c[gje]||c[_je])&&R.push(Tle),(c[WM]||c[fle]||c[mje]||c[pje]||c[hje])&&(R.push(wle),this._instanced&&R.push(_j)),(c[WM]||c[yje]||c[ple])&&(R.push(Dle),R.push(pj)),(c[WM]||c[hle])&&R.push(pj),c[dle]&&R.push(_j),c[mle]&&R.push(Ile),c[_le]&&R.push(Ple),(c[gle]||c[xje]||c[WM]||c[jM])&&R.push(Rle),(c[WM]||c[jM])&&R.push(Ole),c[yle]&&R.push(Mle),c[xle]&&R.push(Lle);let M=R.length;if(d=this._vaf.writers,a/n>.1){for(let N=0;N<a;++N){let _=s[N];_._dirty=!1;for(let S=0;S<M;++S)R[S](this,e,r,d,_)}this._vaf.commit(fj(i))}else{for(let N=0;N<a;++N){let _=s[N];_._dirty=!1;for(let S=0;S<M;++S)R[S](this,e,r,d,_);this._instanced?this._vaf.subCommit(_._index,1):this._vaf.subCommit(_._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,x=F.IDENTITY;e.mode===ne.SCENE3D?(x=this.modelMatrix,m=ae.clone(this._baseVolumeWC,this._boundingVolume)):m=ae.clone(this._baseVolume2D,this._boundingVolume),Lje(this,e,m);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===vo.OPAQUE||this._blendOption===vo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===vo.TRANSLUCENT;this._blendOption===vo.TRANSLUCENT||this._blendOption===vo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:R?te.LEQUAL:te.LESS},depthMask:R,blending:ln.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let T,C,A,E,v,D=Lt.maximumVertexTextureImageUnits>0;if(b||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){T=GM,C=HM,v=[],l(this._batchTable)&&(v.push("VECTOR_TILE"),T=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(T),C=this._batchTable.getFragmentShaderCallback(!1,void 0)(C)),A=new Ue({defines:v,sources:[T]}),this._instanced&&A.defines.push("INSTANCED"),this._shaderRotation&&A.defines.push("ROTATION"),this._shaderAlignedAxis&&A.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&A.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&A.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&A.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&A.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&A.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(D?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-Xs.CUTOFF;this._sdf&&A.defines.push("SDF");let M=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===vo.OPAQUE_AND_TRANSLUCENT&&(E=new Ue({defines:["OPAQUE",M],sources:[C]}),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${R}`)),this._sp=$t.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:fo}),E=new Ue({defines:["TRANSLUCENT",M],sources:[C]}),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=$t.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:fo})),this._blendOption===vo.OPAQUE&&(E=new Ue({defines:[M],sources:[C]}),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${R}`)),this._sp=$t.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:fo})),this._blendOption===vo.TRANSLUCENT&&(E=new Ue({defines:[M],sources:[C]}),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=$t.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:fo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let O=e.commandList;if(p.render||p.pick){let R=this._colorCommands,M=this._blendOption===vo.OPAQUE,N=this._blendOption===vo.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,S=_.length,w=this._uniforms,I;l(this._batchTable)?(w=this._batchTable.getUniformMapCallback()(w),I=this._batchTable.getPickId()):I="v_pickColor",R.length=S;let L=N?S*2:S;for(let B=0;B<L;++B){let U=R[B];l(U)||(U=R[B]=new Ze);let V=M||N&&B%2===0;U.pass=V||!N?we.OPAQUE:we.TRANSLUCENT,U.owner=this;let G=N?Math.floor(B/2):B;U.boundingVolume=m,U.modelMatrix=x,U.count=_[G].indicesCount,U.shaderProgram=V?this._sp:this._spTranslucent,U.uniformMap=w,U.vertexArray=_[G].va,U.renderState=V?this._rsOpaque:this._rsTranslucent,U.debugShowBoundingVolume=this.debugShowBoundingVolume,U.pickId=I,this._instanced&&(U.count=6,U.instanceCount=n),O.push(U)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=Nje(this,e.context)),O.push(this.debugCommand))}};Uf.prototype.isDestroyed=function(){return!1};Uf.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),ble(this._billboards),ue(this)};var Ru=Uf;function Bje(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var wb=Bje;function pa(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),lE(this)}var kje=new fe;Object.defineProperties(pa.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=H.clone(e,this._color),lE(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,lE(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=H.clone(e,this._pointOutlineColor),lE(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,lE(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,kje);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=H.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&lE(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});pa.defaultColor=H.WHITE;pa.defaultPointOutlineColor=H.BLACK;pa.defaultPointOutlineWidth=0;pa.defaultPointSize=8;function lE(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,pa.defaultColor),i=y(e._pointOutlineColor,pa.defaultPointOutlineColor),o=y(e._pointOutlineWidth,pa.defaultPointOutlineWidth),r=y(e._pointSize,pa.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(H.equals(n,s)&&H.equals(i,a)&&o===c&&r===u)return;e._billboardColor=H.clone(n,e._billboardColor),e._billboardOutlineColor=H.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,r,p,o]);t.setImage(g,wb(f,d,p,o,r))}pa.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};pa.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};pa.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};pa.prototype.getPropertyInherited=function(e){return Ws.getPropertyInherited(this._content,this._batchId,e)};pa.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};pa.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};pa.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};pa.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var b_=pa;function Vje(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=r.width+u|0,d=3*a,p=d/2;c.width=f,c.height=d;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),o&&(g.fillStyle="black",g.fillText(t,u/2,p));let m=g.getImageData(0,0,f,d).data,x=m.length,b=f*4,T,C,A,E;for(T=0;T<x;++T)if(m[T]!==255){A=T/b|0;break}for(T=x-1;T>=0;--T)if(m[T]!==255){E=T/b|0;break}let v=-1;for(T=0;T<f&&v===-1;++T)for(C=0;C<d;++C){let D=T*4+C*b;if(m[D]!==255||m[D+1]!==255||m[D+2]!==255||m[D+3]!==255){v=T;break}}return{width:r.width,height:E-A,ascent:p-A,descent:E-p,minx:v-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var Db;function Uje(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),o=y(t.fill,!0),r=y(t.strokeWidth,1),s=y(t.backgroundColor,H.TRANSPARENT),a=y(t.padding,0),c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(Db)||(l(f.imageSmoothingEnabled)?Db="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?Db="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?Db="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(Db="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[Db]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=Vje(f,e,n,i,o);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=-d.minx,g=Math.ceil(d.width)+p+c,m=d.height+c,x=m-d.ascent+a,b=m-x+c;if(u.width=g,u.height=m,f.font=n,f.lineJoin="round",f.lineWidth=r,f[Db]=!1,s!==H.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=y(t.strokeColor,H.BLACK);f.strokeStyle=T.toCssColorString(),f.strokeText(e,p+a,b)}if(o){let T=y(t.fillColor,H.WHITE);f.fillStyle=T.toCssColorString(),f.fillText(e,p+a,b)}return u}var Ib=Uje;var jle=Zo(kle(),1);var Hje={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},qo=Object.freeze(Hje);var Vle={},Ule=0,Gje=256,Wje=new H(.165,.165,.165,.8),jje=new z(7,5),ys=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Pb(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function YM(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function XM(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Hle(e){let t=Vle[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(XM(n,"line-height"));isNaN(i)&&(i=void 0),t={family:XM(n,"font-family"),size:XM(n,"font-size").replace("px",""),style:XM(n,"font-style"),weight:XM(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Ule<Gje&&(Vle[e._font]=t,Ule++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function ah(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Bt.clone(n)),l(i)&&(i=Bt.clone(i)),l(o)&&(o=Bt.clone(o)),l(r)&&(r=Mt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=H.clone(y(e.fillColor,H.WHITE)),this._outlineColor=H.clone(y(e.outlineColor,H.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=H.clone(y(e.backgroundColor,Wje)),this._backgroundPadding=z.clone(y(e.backgroundPadding,jje)),this._style=y(e.style,qo.FILL),this._verticalOrigin=y(e.verticalOrigin,Rn.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,yi.LEFT),this._pixelOffset=z.clone(y(e.pixelOffset,z.ZERO)),this._eyeOffset=h.clone(y(e.eyeOffset,h.ZERO)),this._position=h.clone(y(e.position,h.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=y(e.heightReference,Ye.NONE),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,Hle(this),this._updateClamping()}Object.defineProperties(ah.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),YM(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=ah.filterUnsupportedCharacters(e);this._renderedText=ah.enableRightToLeftDetection?$je(t):t,Pb(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,Pb(this),Hle(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;H.equals(t,e)||(H.clone(e,t),Pb(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),Pb(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Pb(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,Pb(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!H.equals(t,e)){H.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;z.equals(t,e)||(z.clone(e,t),YM(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,Pb(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!z.equals(t,e)){z.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Bt.equals(t,e)){this._translucencyByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Bt.equals(t,e)){this._pixelOffsetScaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Bt.equals(t,e)){this._scaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,YM(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),YM(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),YM(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Mt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});ah.prototype._updateClamping=function(){uo._updateClamping(this._labelCollection,this)};ah.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new z);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return uo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};ah.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===Rn.BOTTOM||e.verticalOrigin===Rn.BASELINE?o-=s:e.verticalOrigin===Rn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],x=m.billboard;if(!l(x))continue;let b=t.x+x._translate.x,T=t.y-x._translate.y,C=m.dimensions.width*a,A=m.dimensions.height*a;e.verticalOrigin===Rn.BOTTOM||e.verticalOrigin===Rn.BASELINE?T-=A:e.verticalOrigin===Rn.CENTER&&(T-=A*.5),e._verticalOrigin===Rn.TOP?T+=Xs.PADDING*a:(e._verticalOrigin===Rn.BOTTOM||e._verticalOrigin===Rn.BASELINE)&&(T-=Xs.PADDING*a),i=Math.min(i,b),o=Math.min(o,T),u=Math.max(u,b+C),f=Math.max(f,T+A)}r=u-i,s=f-o}return l(n)||(n=new je),n.x=i,n.y=o,n.width=r,n.height=s,n};ah.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};ah.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&H.equals(this._fillColor,e._fillColor)&&H.equals(this._outlineColor,e._outlineColor)&&H.equals(this._backgroundColor,e._backgroundColor)&&z.equals(this._backgroundPadding,e._backgroundPadding)&&z.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};ah.prototype.isDestroyed=function(){return!1};ah.enableRightToLeftDetection=!1;function qje(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ys.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=ys.RTL:n.test(f)?a=ys.LTR:i.test(f)?a=ys.BRACKETS:a=ys.WEAK,u===0&&(s=a),s===a&&a!==ys.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function Yje(e){return e.split("").reverse().join("")}function KM(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Xje(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Kje="\u05D0-\u05EA",Zje="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",zle=new RegExp(`[${Kje}${Zje}]`);function $je(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=zle.test(o.charAt(0)),s=qje(o,zle),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===ys.BRACKETS?Xje(f.Word):Yje(f.Word);r?f.Type===ys.RTL?(c=d+c,a=0):f.Type===ys.LTR?(c=KM(c,a,f.Word),a+=f.Word.length):(f.Type===ys.WEAK||f.Type===ys.BRACKETS)&&(f.Type===ys.WEAK&&s[u-1].Type===ys.BRACKETS?c=d+c:s[u-1].Type===ys.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===ys.RTL?(c=d+c,a=0):(c=KM(c,a,f.Word),a+=f.Word.length):c=KM(c,0,d)):f.Type===ys.RTL?c=KM(c,a,d):f.Type===ys.LTR?(c+=f.Word,a=c.length):(f.Type===ys.WEAK||f.Type===ys.BRACKETS)&&(u>0&&s[u-1].Type===ys.RTL?s.length>u+1?s[u+1].Type===ys.RTL?c=KM(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` +`)}return n}var By=ah;var qle=Zo(Gle(),1);function Jje(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function e7e(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var t7e=1.2,Yle="ID_WHITE_PIXEL",xj=new z(4,4),n7e=new je(1,1,1,1);function i7e(e){let t=document.createElement("canvas");t.width=xj.x,t.height=xj.y;let n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Yle,t)}var zf={};function o7e(e,t,n,i,o,r,s){return zf.font=t,zf.fillColor=n,zf.strokeColor=i,zf.strokeWidth=o,zf.padding=Xs.PADDING,s===Rn.CENTER?zf.textBaseline="middle":s===Rn.TOP?zf.textBaseline="top":zf.textBaseline="bottom",zf.fill=r===qo.FILL||r===qo.FILL_AND_OUTLINE,zf.stroke=r===qo.OUTLINE||r===qo.FILL_AND_OUTLINE,zf.backgroundColor=H.BLACK,Ib(e,zf)}function bj(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function r7e(e,t,n,i){i.index=e.addImageSync(t,n)}var s7e=new qle.default;function a7e(e,t){let n=t._renderedText,i=s7e.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length,a,c,u;if(t._relativeSize=t._fontSize/Xs.FONT_SIZE,o<s)for(c=o;c<s;++c)bj(e,r[c]);r.length=o;let f=t.show&&t._showBackground&&n.split(` +`).join("").length>0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(l(d)||(d=p.add({collection:e,image:Yle,imageSubRegion:n7e}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=yi.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t.totalScale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance,d.clusterShow=t.clusterShow):l(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);let g=e._glyphTextureCache;for(u=0;u<o;++u){let m=i[u],x=t._verticalOrigin,b=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+x]),T=g[b];if(!l(T)){let C=`${t._fontStyle} ${t._fontWeight} ${Xs.FONT_SIZE}px ${t._fontFamily}`,A=o7e(m,C,H.WHITE,H.WHITE,0,qo.FILL,x);if(T=new e7e(e,-1,A.dimensions),g[b]=T,A.width>0&&A.height>0){let E=(0,jle.default)(A,{cutoff:Xs.CUTOFF,radius:Xs.RADIUS}),v=A.getContext("2d"),D=A.width,O=A.height,R=v.getImageData(0,0,D,O);for(let M=0;M<D;M++)for(let N=0;N<O;N++){let _=N*D+M,S=E[_]*255,w=_*4;R.data[w+0]=S,R.data[w+1]=S,R.data[w+2]=S,R.data[w+3]=S}v.putImageData(R,0,0),m!==" "&&r7e(e._textureAtlas,b,A,T)}}if(a=r[u],l(a)?T.index===-1?bj(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new Jje,r[u]=a),a.textureInfo=T,a.dimensions=T.dimensions,T.index!==-1){let C=a.billboard,A=e._spareBillboards;l(C)||(A.length>0?C=A.pop():(C=e._billboardCollection.add({collection:e}),C._labelDimensions=new z,C._labelTranslate=new z),a.billboard=C),C.show=t._show,C.position=t._position,C.eyeOffset=t._eyeOffset,C.pixelOffset=t._pixelOffset,C.horizontalOrigin=yi.LEFT,C.verticalOrigin=t._verticalOrigin,C.heightReference=t._heightReference,C.scale=t.totalScale,C.pickPrimitive=t,C.id=t._id,C.image=b,C.translucencyByDistance=t._translucencyByDistance,C.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,C.scaleByDistance=t._scaleByDistance,C.distanceDisplayCondition=t._distanceDisplayCondition,C.disableDepthTestDistance=t._disableDepthTestDistance,C._batchIndex=t._batchIndex,C.outlineColor=t.outlineColor,t.style===qo.FILL_AND_OUTLINE?(C.color=t._fillColor,C.outlineWidth=t.outlineWidth):t.style===qo.FILL?(C.color=t._fillColor,C.outlineWidth=0):t.style===qo.OUTLINE&&(C.color=H.TRANSPARENT,C.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function Wle(e,t,n){return t===yi.CENTER?-e/2:t===yi.RIGHT?-(e+n.x):n.x}var dr=new z,c7e=new z;function l7e(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,f=1,d,p=t.length,g=e._backgroundBillboard,m=z.clone(l(g)?e._backgroundPadding:z.ZERO,c7e);for(m.x/=e._relativeSize,m.y/=e._relativeSize,d=0;d<p;++d)n.charAt(d)===` +`?(a.push(r),++f,r=0):(i=t[d],o=i.dimensions,u=Math.max(u,o.height-o.descent),c=Math.max(c,o.descent),r+=o.width-o.minx,d<p-1&&(r+=t[d+1].dimensions.minx),s=Math.max(s,r));a.push(r);let x=u+c,b=e.totalScale,T=e._horizontalOrigin,C=e._verticalOrigin,A=0,E=a[A],v=Wle(E,T,m),D=(l(e._lineHeight)?e._lineHeight:t7e*e._fontSize)/e._relativeSize,O=D*(f-1),R=s,M=x+O;l(g)&&(R+=m.x*2,M+=m.y*2,g._labelHorizontalOrigin=T),dr.x=v*b,dr.y=0;let N=!0,_=0;for(d=0;d<p;++d)if(n.charAt(d)===` +`)++A,_+=D,E=a[A],v=Wle(E,T,m),dr.x=v*b,N=!0;else if(i=t[d],o=i.dimensions,C===Rn.TOP?(dr.y=o.height-u-m.y,dr.y+=Xs.PADDING):C===Rn.CENTER?dr.y=(O+o.height-u)/2:C===Rn.BASELINE?(dr.y=O,dr.y-=Xs.PADDING):(dr.y=O+c+m.y,dr.y-=Xs.PADDING),dr.y=(dr.y-o.descent-_)*b,N&&(dr.x-=Xs.PADDING*b,N=!1),l(i.billboard)&&(i.billboard._setTranslate(dr),i.billboard._labelDimensions.x=R,i.billboard._labelDimensions.y=M,i.billboard._labelHorizontalOrigin=T),d<p-1){let S=t[d+1];dr.x+=(o.width-o.minx+S.dimensions.minx)*b}if(l(g)&&n.split(` +`).join("").length>0&&(T===yi.CENTER?v=-s/2-m.x:T===yi.RIGHT?v=-(s+m.x*2):v=0,dr.x=v*b,C===Rn.TOP?dr.y=x-u-c:C===Rn.CENTER?dr.y=(x-u)/2-c:C===Rn.BASELINE?dr.y=-m.y-c:dr.y=0,dr.y=dr.y*b,g.width=R,g.height=M,g._setTranslate(dr),g._labelTranslate=z.clone(dr,g._labelTranslate)),vf(e.heightReference))for(d=0;d<p;++d){i=t[d];let S=i.billboard;l(S)&&(S._labelTranslate=z.clone(dr,S._labelTranslate))}}function Xle(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)bj(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function Sm(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new Ru({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new Ru({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=H.clone(H.WHITE),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,vo.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(Sm.prototype,{length:{get:function(){return this._labels.length}}});Sm.prototype.add=function(e){let t=new By(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Sm.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Xle(this,e),!0}return!1};Sm.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Xle(this,e[t]);e.length=0};Sm.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Sm.prototype.get=function(e){return this._labels[e]};Sm.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;l(this._textureAtlas)||(this._textureAtlas=new Fy({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new Fy({context:i,initialSize:xj}),n.textureAtlas=this._backgroundTextureAtlas,i7e(this._backgroundTextureAtlas));let o=this._labelsToUpdate.length;for(let s=0;s<o;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(a7e(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(l7e(a),a._repositionAllGlyphs=!1);let u=a._glyphs.length-c;this._totalGlyphCount+=u}let r=n.length>0?vo.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Sm.prototype.isDestroyed=function(){return!1};Sm.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var vm=Sm;var ZM=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 position2DHigh; +in vec3 position2DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 prevPosition2DHigh; +in vec3 prevPosition2DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec3 nextPosition2DHigh; +in vec3 nextPosition2DLow; +in vec4 texCoordExpandAndBatchIndex; + +out vec2 v_st; +out float v_width; +out vec4 v_pickColor; +out float v_polylineAngle; void main() { - vec3 position; - vec3 direction; - if (czm_orthographicIn3D == 1.0) + float texCoord = texCoordExpandAndBatchIndex.x; + float expandDir = texCoordExpandAndBatchIndex.y; + bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; + float batchTableIndex = texCoordExpandAndBatchIndex.w; + + vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); + float width = widthAndShow.x + 0.5; + float show = widthAndShow.y; + + if (width < 1.0) { - vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; - vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom - vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top - position = vec3(mix(minPlane, maxPlane, uv), 0.0); - direction = vec3(0.0, 0.0, -1.0); - } - else - { - position = vec3(0.0); - direction = normalize(positionEC.xyz); + show = 0.0; } - czm_ray ray = czm_ray(position, direction); + vec4 pickColor = batchTable_getPickColor(batchTableIndex); - vec3 ellipsoid_center = czm_view[3].xyz; - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); - if (!czm_isEmpty(intersection)) + vec4 p, prev, next; + if (czm_morphTime == 1.0) { - out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); + p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); + prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); + next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); + prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); + next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); } else { - discard; + p = czm_columbusViewMorph( + czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), + czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), + czm_morphTime); + prev = czm_columbusViewMorph( + czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), + czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), + czm_morphTime); + next = czm_columbusViewMorph( + czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), + czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), + czm_morphTime); } - czm_writeLogDepth(); -} -`;var OP=`in vec4 position; + #ifdef DISTANCE_DISPLAY_CONDITION + vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); + vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); + vec3 centerLow = centerLowAndRadius.xyz; + float radius = centerLowAndRadius.w; + vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); -out vec4 positionEC; + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + lengthSq = czm_eyeHeight2D.y; + } + else + { + vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); + lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); + } + + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + if (lengthSq < nearSq || lengthSq > farSq) + { + show = 0.0; + } + #endif + + float polylineAngle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); + gl_Position = czm_viewportOrthographic * positionWC * show; + + v_st.s = texCoord; + v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); + + v_width = width; + v_pickColor = pickColor; + v_polylineAngle = polylineAngle; +} +`;var rl={};rl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};rl.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var u7e=new fe;rl.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,u7e).height}return i};var f7e=new F,d7e=new h,Kle=new h,h7e=new rn(h.UNIT_X,0),Zle=new h,m7e=new rn(h.UNIT_X,0),p7e=new h,_7e=new h,Cj=[];function Qle(e,t,n){let i=Cj;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var Sz=new fe,Ez=new fe,ky=new h,Aj=new h,g7e=new h,Tj=new Fp,$M=new La;function y7e(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,Aj),u=i.scaleToGeodeticSurface(t,g7e),f=rl.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,Sz),p=i.cartesianToCartographic(u,Ez),g=Qle(f,o,r);Tj.setEndPoints(d,p);let m=Tj.surfaceDistance/f,x=a;d.height=o;let b=i.cartographicToCartesian(d,ky);h.pack(b,s,x),x+=3;for(let T=1;T<f;T++){let C=Tj.interpolateUsingSurfaceDistance(T*m,Ez);C.height=g[T],b=i.cartographicToCartesian(C,ky),h.pack(b,s,x),x+=3}return x}function x7e(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,Sz),u=i.cartesianToCartographic(t,Ez),f=rl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=Qle(f,o,r);$M.ellipsoid.equals(i)||($M=new La(void 0,void 0,i)),$M.setEndPoints(c,u);let p=$M.surfaceDistance/f,g=a;c.height=o;let m=i.cartographicToCartesian(c,ky);h.pack(m,s,g),g+=3;for(let x=1;x<f;x++){let b=$M.interpolateUsingSurfaceDistance(x*p,Ez);b.height=d[x],m=i.cartographicToCartesian(b,ky),h.pack(m,s,g),g+=3}return g}rl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,F.IDENTITY);let o=F.inverseTransformation(t,f7e),r=F.multiplyByPoint(o,h.ZERO,d7e),s=h.normalize(F.multiplyByPointAsVector(o,h.UNIT_Y,Kle),Kle),a=rn.fromPointNormal(r,s,h7e),c=h.normalize(F.multiplyByPointAsVector(o,h.UNIT_X,Zle),Zle),u=rn.fromPointNormal(r,c,m7e),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(rn.getPointDistance(u,d)<0||rn.getPointDistance(u,m)<0){let x=$n.lineSegmentPlane(d,m,a,p7e);if(l(x)){let b=h.multiplyByScalar(s,5e-9,_7e);rn.getPointDistance(a,d)<0&&h.negate(b,b),n.push(h.add(x,b,new h)),i.push(f+1),h.negate(b,b),n.push(h.add(x,b,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};rl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ee.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],Aj);if(o=r?o[0]:o,o!==0){let b=i.geodeticSurfaceNormal(x,ky);h.multiplyByScalar(b,o,b),h.add(x,b,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=y(e.granularity,P.RADIANS_PER_DEGREE);s=P.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=rl.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let x=t[c],b=t[c+1],T=r?o[c]:o,C=r?o[c+1]:o;d=y7e(x,b,s,i,T,C,f,d)}Cj.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,Sz);g.height=r?o[n-1]:o;let m=i.cartographicToCartesian(g,ky);return h.pack(m,f,u-3),f};var $le=new fe,b7e=new fe;rl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ee.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let T=i.scaleToGeodeticSurface(t[0],Aj);if(o=r?o[0]:o,o!==0){let C=i.geodeticSurfaceNormal(T,ky);h.multiplyByScalar(C,o,C),h.add(T,C,T)}return[T.x,T.y,T.z]}let s=y(e.granularity,P.RADIANS_PER_DEGREE),a=0,c,u=i.cartesianToCartographic(t[0],$le),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],b7e),a+=rl.numberOfPointsRhumbLine(u,f,s),u=fe.clone(f,$le);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let T=t[c],C=t[c+1],A=r?o[c]:o,E=r?o[c+1]:o;g=x7e(T,C,s,i,A,E,p,g)}Cj.length=0;let m=t[n-1],x=i.cartesianToCartographic(m,Sz);x.height=r?o[n-1]:o;let b=i.cartographicToCartesian(x,ky);return h.pack(b,p,d-3),p};rl.generateCartesianArc=function(e){let t=rl.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};rl.generateCartesianRhumbArc=function(e){let t=rl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};var Li=rl;function Ou(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Yi.fromType(Yi.ColorType,{color:new H(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Co(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Li.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(eue),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var Jle=Ou.POSITION_INDEX=0,T7e=Ou.SHOW_INDEX=1,C7e=Ou.WIDTH_INDEX=2,A7e=Ou.MATERIAL_INDEX=3,QM=Ou.POSITION_SIZE_INDEX=4,E7e=Ou.DISTANCE_DISPLAY_CONDITION=5,eue=Ou.NUMBER_OF_PROPERTIES=6;function T_(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Ou.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,T_(this,T7e))}},positions:{get:function(){return this._positions},set:function(e){let t=Co(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&T_(this,QM),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),T_(this,Jle),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,T_(this,A7e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,T_(this,C7e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,T_(this,QM)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),T_(this,E7e))}}});Ou.prototype.update=function(){let e=F.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Jle]>0||this._propertiesChanged[QM]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=Li.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)T_(this,QM);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){T_(this,QM);break}}};Ou.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Ou.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<eue-1;++t)e[t]=0};Ou.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Hf=Ou;var S7e=Hf.SHOW_INDEX,v7e=Hf.WIDTH_INDEX,Sj=Hf.POSITION_INDEX,w7e=Hf.MATERIAL_INDEX,tue=Hf.POSITION_SIZE_INDEX,D7e=Hf.DISTANCE_DISPLAY_CONDITION,cue=Hf.NUMBER_OF_PROPERTIES,Wl={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function ch(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(cue),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Fe.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=H.clone(H.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(ch.prototype,{length:{get:function(){return vj(this),this._polylines.length}}});ch.prototype.add=function(e){let t=new Hf(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};ch.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};ch.prototype.removeAll=function(){wj(this),hue(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};ch.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};ch.prototype.get=function(e){return vj(this),this._polylines[e]};function I7e(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:X.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:X.FLOAT,componentsPerAttribute:2}];e._batchTable=new vx(t,n,e._polylines.length)}var lue=new Hn,uue=new oe,fue=new z;ch.prototype.update=function(e){if(vj(this),this._polylines.length===0||!this.show)return;N7e(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Lt.maximumVertexTextureImageUnits===0)throw new re("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");I7e(this,t),this._createBatchTable=!1}if(this._createVertexArray||R7e(this))oue(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ne.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[tue]||o[w7e])oue(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],o=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[Sj]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((o[S7e]||o[v7e])&&this._batchTable.setBatchedAttribute(i._index,0,new z(i._width,i._show)),this._batchTable.attributes.length>2){if(o[Sj]||o[tue]){let m=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=Hn.fromCartesian(m.center,lue),b=oe.fromElements(x.low.x,x.low.y,x.low.z,m.radius,uue);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[D7e]){let m=fue;m.x=0,m.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(m.x=x.near,m.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<cue;++c)o[c]=0;let r=F.IDENTITY;e.mode===ne.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ve.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ve.fromCache({blending:ln.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;P7e(this,e,c,r)}};var JM=new ae,nue=new ae;function P7e(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let x=u[m],b=x.buckets,T=b.length;for(let C=0;C<T;++C){let A=b[C],E=A.offset,v=A.bucket.shaderProgram,D=A.bucket.polylines,O=D.length,R,M,N=0,_,S;for(let w=0;w<O;++w){let I=D[w],L=M7e(I._material);if(L!==R){if(l(R)&&N>0){let G=M.isTranslucent();a>=s?(_=new Ze({owner:e}),n.push(_)):_=n[a],++a,S=xt(p(M._uniforms),e._uniformMap),_.boundingVolume=ae.clone(JM,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=x.va,_.renderState=G?e._translucentRS:e._opaqueRS,_.pass=G?we.TRANSLUCENT:we.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=S,_.count=N,_.offset=E,E+=N,N=0,c=!0,r.push(_)}M=I._material,M.update(o),R=L}let B=I._locatorBuckets,U=B.length;for(let G=0;G<U;++G){let k=B[G];k.locator===A&&(N+=k.count)}let V;t.mode===ne.SCENE3D?V=I._boundingVolumeWC:t.mode===ne.COLUMBUS_VIEW?V=I._boundingVolume2D:t.mode===ne.SCENE2D?l(I._boundingVolume2D)&&(V=ae.clone(I._boundingVolume2D,nue),V.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(V=ae.union(I._boundingVolumeWC,I._boundingVolume2D,nue)),c?(c=!1,ae.clone(V,JM)):ae.union(V,JM,JM)}l(R)&&N>0&&(a>=s?(_=new Ze({owner:e}),n.push(_)):_=n[a],++a,S=xt(p(M._uniforms),e._uniformMap),_.boundingVolume=ae.clone(JM,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=x.va,_.renderState=M.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=M.isTranslucent()?we.TRANSLUCENT:we.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=S,_.count=N,_.offset=E,c=!0,r.push(_)),R=void 0}}n.length=a}ch.prototype.isDestroyed=function(){return!1};ch.prototype.destroy=function(){return due(this),wj(this),hue(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function R7e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Sj]?(i.bufferUsage!==Fe.STREAM_DRAW&&(t=!0,i.bufferUsage=Fe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Fe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Fe.STATIC_DRAW):i.frameCount--),t}var iue=[0,0,0];function oue(e,t,n){e._createVertexArray=!1,wj(e),due(e),L7e(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,r,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,x=new Float32Array(6*f*3),b=new Float32Array(f*4),T,C=0,A=0,E=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(x,b,C,A,E,r,t,n),m===ne.MORPHING&&(l(T)||(T=new Float32Array(6*f*3)),g.writeForMorph(T,C));let S=g.lengthOfPositions;C+=6*S*3,A+=S*4,E+=S*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,D=Fe.STATIC_DRAW;e._positionBuffer=_t.createVertexBuffer({context:t,typedArray:x,usage:v});let O;l(T)&&(O=_t.createVertexBuffer({context:t,typedArray:T,usage:v})),e._texCoordExpandAndBatchIndexBuffer=_t.createVertexBuffer({context:t,typedArray:b,usage:D});let R=3*Float32Array.BYTES_PER_ELEMENT,M=4*Float32Array.BYTES_PER_ELEMENT,N=0,_=i.length;for(let S=0;S<_;++S)if(o=i[S],o.length>0){let w=new Uint16Array(o),I=_t.createIndexBuffer({context:t,typedArray:w,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});N+=a[S];let L=6*(S*(R*P.SIXTY_FOUR_KILOBYTES)-N*R),B=R+L,U=R+B,V=R+U,G=R+V,k=R+G,W=S*(M*P.SIXTY_FOUR_KILOBYTES)-N*M,q=[{index:Wl.position3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:L,strideInBytes:6*R},{index:Wl.position3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Wl.position2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:L,strideInBytes:6*R},{index:Wl.position2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Wl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:Wl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Wl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:Wl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Wl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:Wl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Wl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:Wl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Wl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:X.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:W}],J,j,K,Q;m===ne.SCENE3D?(j=e._positionBuffer,J="vertexBuffer",K=iue,Q="value"):m===ne.SCENE2D||m===ne.COLUMBUS_VIEW?(j=iue,J="value",K=e._positionBuffer,Q="vertexBuffer"):(j=O,J="vertexBuffer",K=e._positionBuffer,Q="vertexBuffer"),q[0][J]=j,q[1][J]=j,q[2][Q]=K,q[3][Q]=K,q[4][J]=j,q[5][J]=j,q[6][Q]=K,q[7][Q]=K,q[8][J]=j,q[9][J]=j,q[10][Q]=K,q[11][Q]=K;let de=new ti({context:t,attributes:q,indexBuffer:I});e._vertexArrays.push({va:de,buckets:u[S]})}}}function O7e(e,t){return t instanceof It?t.id:t}var vz=[];function M7e(e){let t=Yi._uniformList[e.type],n=t.length;vz.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];vz[i]=r,vz[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(vz,O7e)}`}function L7e(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new wm(c,t,n)),u.addPolyline(a)}}}function N7e(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function vj(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function wj(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function due(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}ch.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function hue(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function Ej(e,t,n){this.count=e,this.offset=t,this.bucket=n}function wm(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}wm.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};wm.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),zt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Ue({defines:i,sources:[`in vec4 v_pickColor; +`,this.material.shaderSource,Ox]}),r=t.getVertexShaderCallback()(ZM),s=new Ue({defines:i,sources:[xu,r]});this.shaderProgram=$t.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Wl})};function mue(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(rn.ORIGIN_ZX_PLANE)===Wt.INTERSECTING}wm.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ne.SCENE3D||!mue(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var ws=new h,Gf=new h,Wf=new h,wz=new h,F7e=new oe,B7e=new z;wm.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,x=g.show&&m>0,b=g._index,T=this.getSegments(g,a),C=T.positions,A=T.lengths,E=C.length,v=g.getPickId(s).color,D=0,O=0,R;for(let U=0;U<E;++U){U===0?g._loop?R=C[E-2]:(R=wz,h.subtract(C[0],C[1],R),h.add(C[0],R,R)):R=C[U-1],h.clone(R,Gf),h.clone(C[U],ws),U===E-1?g._loop?R=C[1]:(R=wz,h.subtract(C[E-1],C[E-2],R),h.add(C[E-1],R,R)):R=C[U+1],h.clone(R,Wf);let V=A[D];U===O+V&&(O+=V,++D);let G=U-O===0,k=U===O+A[D]-1;c===ne.SCENE2D&&(Gf.z=0,ws.z=0,Wf.z=0),(c===ne.SCENE2D||c===ne.MORPHING)&&(G||k)&&u-Math.abs(ws.x)<1&&((ws.x<0&&Gf.x>0||ws.x>0&&Gf.x<0)&&h.clone(ws,Gf),(ws.x<0&&Wf.x>0||ws.x>0&&Wf.x<0)&&h.clone(ws,Wf));let W=G?2:0,q=k?2:4;for(let J=W;J<q;++J){Hn.writeElements(ws,e,n),Hn.writeElements(Gf,e,n+6),Hn.writeElements(Wf,e,n+12);let j=J-2<0?-1:1;t[o]=U/(E-1),t[o+1]=2*(J%2)-1,t[o+2]=j,t[o+3]=b,n+=6*3,o+=4}}let M=F7e;M.x=H.floatToByte(v.red),M.y=H.floatToByte(v.green),M.z=H.floatToByte(v.blue),M.w=H.floatToByte(v.alpha);let N=B7e;N.x=m,N.y=x?1:0;let _=c===ne.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,S=Hn.fromCartesian(_.center,lue),w=S.high,I=oe.fromElements(S.low.x,S.low.y,S.low.z,_.radius,uue),L=fue;L.x=0,L.y=Number.MAX_VALUE;let B=g.distanceDisplayCondition;l(B)&&(L.x=B.near,L.y=B.far),r.setBatchedAttribute(b,0,N),r.setBatchedAttribute(b,1,M),r.attributes.length>2&&(r.setBatchedAttribute(b,2,w),r.setBatchedAttribute(b,3,I),r.setBatchedAttribute(b,4,L))}};var k7e=new h,V7e=new h,U7e=new h,rue=new h;wm.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=rue,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=F.multiplyByPoint(n,g,V7e);let m=F.multiplyByPoint(n,a[p],k7e),x;p===u-1?s._loop?x=a[1]:(x=rue,h.subtract(a[u-1],a[u-2],x),h.add(a[u-1],x,x)):x=a[p+1],x=F.multiplyByPoint(n,x,U7e);let b=c[f];p===d+b&&(d+=b,++f);let T=p-d===0,C=p===d+c[f]-1,A=T?2:0,E=C?2:4;for(let v=A;v<E;++v)Hn.writeElements(m,e,t),Hn.writeElements(g,e,t+6),Hn.writeElements(x,e,t+12),t+=6*3}}};var z7e=new Array(1);wm.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new Ej(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===ne.SCENE3D){g=z7e;let x=p._actualPositions.length;if(x>0)g[0]=x;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let x=0;for(let b=0;b<m;++b){let T=g[b]-1;for(let C=0;C<T;++C)c+4>P.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new Ej(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new Ej(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};wm.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var uE={positions:void 0,lengths:void 0},sue=new Array(1),H7e=new h,G7e=new fe;wm.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ne.SCENE3D)return sue[0]=n.length,uE.positions=n,uE.lengths=sue,uE;mue(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=H7e;for(let u=0;u<s;++u)a=n[u],c=F.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,G7e)));if(o.length>0){e._boundingVolume2D=ae.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return uE.positions=o,uE.lengths=e._segments.lengths,uE};var aue;wm.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=aue,c=6*s*3;!l(a)||a.length<c?a=aue=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,x;s=f.length;for(let b=0;b<s;++b){b===0?t._loop?x=f[s-2]:(x=wz,h.subtract(f[0],f[1],x),h.add(f[0],x,x)):x=f[b-1],h.clone(x,Gf),h.clone(f[b],ws),b===s-1?t._loop?x=f[1]:(x=wz,h.subtract(f[s-1],f[s-2],x),h.add(f[s-1],x,x)):x=f[b+1],h.clone(x,Wf);let T=d[g];b===m+T&&(m+=T,++g);let C=b-m===0,A=b===m+d[g]-1;o===ne.SCENE2D&&(Gf.z=0,ws.z=0,Wf.z=0),(o===ne.SCENE2D||o===ne.MORPHING)&&(C||A)&&r-Math.abs(ws.x)<1&&((ws.x<0&&Gf.x>0||ws.x>0&&Gf.x<0)&&h.clone(ws,Gf),(ws.x<0&&Wf.x>0||ws.x>0&&Wf.x<0)&&h.clone(ws,Wf));let E=C?2:0,v=A?2:4;for(let D=E;D<v;++D)Hn.writeElements(ws,a,p),Hn.writeElements(Gf,a,p+6),Hn.writeElements(Wf,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var lh=ch;function Vy(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new Ru({batchTable:e.batchTable}),this._labelCollection=new vm({batchTable:e.batchTable}),this._polylineCollection=new lh,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Vy.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function W7e(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+se.packedLength+ee.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,se.pack(n,s,a),a+=se.packedLength,ee.pack(t,s,a),s}var j7e=new gi("createVectorTilePoints",5),q7e=new h;function Y7e(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=W7e(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=j7e.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let m=d[g],x=h.unpack(n,g*3,q7e),b=c.add();b.position=x,b._batchIndex=m;let T=u.add();T.text=" ",T.position=x,T._batchIndex=m;let C=f.add();C.positions=[h.clone(x),h.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}Vy.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],u=n.get(a),f=i.get(a),d=o.get(a);t[c]=new b_(e,c,u,f,d)}};Vy.prototype.applyDebugSettings=function(e,t){e?(H.clone(t,this._billboardCollection._highlightColor),H.clone(t,this._labelCollection._highlightColor),H.clone(t,this._polylineCollection._highlightColor)):(H.clone(H.WHITE,this._billboardCollection._highlightColor),H.clone(H.WHITE,this._labelCollection._highlightColor),H.clone(H.WHITE,this._polylineCollection._highlightColor))};function X7e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=b_.defaultPointSize,s.color=b_.defaultColor,s.pointOutlineColor=b_.defaultPointOutlineColor,s.pointOutlineWidth=b_.defaultPointOutlineWidth,s.labelColor=H.WHITE,s.labelOutlineColor=H.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=qo.FILL,s.labelText=void 0,s.backgroundColor=new H(.165,.165,.165,.8),s.backgroundPadding=new z(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=H.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=yi.CENTER,s.verticalOrigin=Rn.CENTER,s.labelHorizontalOrigin=yi.RIGHT,s.labelVerticalOrigin=Rn.BASELINE}}var K7e=new H,Z7e=new H,$7e=new H,Q7e=new H,J7e=new H,eqe=new H,eL=new Bt,tL=new Bt,Dj=new Mt;Vy.prototype.applyStyle=function(e,t){if(!l(e)){X7e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,K7e)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Z7e)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,$7e)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Q7e)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,J7e)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(eL.near=a.x,eL.nearValue=a.y,eL.far=a.z,eL.farValue=a.w,s.scaleByDistance=eL):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(tL.near=a.x,tL.nearValue=a.y,tL.far=a.z,tL.farValue=a.w,s.translucencyByDistance=tL):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(Dj.near=a.x,Dj.far=a.y,s.distanceDisplayCondition=Dj):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,eqe)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};Vy.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Y7e(this,e.mapProjection.ellipsoid)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};Vy.prototype.isDestroyed=function(){return!1};Vy.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var nL=Vy;function C_(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,h.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=kn.BOTH}Object.defineProperties(C_.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function tqe(e){let t=new Float64Array(3+h.packedLength+ee.packedLength+se.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,se.pack(e._rectangle,t,n),t}function nqe(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=vn.unpack(t,n),n+=vn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=H.unpack(t,n);n+=H.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new pm({color:c,offset:u,count:f,batchIds:p})}}var iqe=new gi("createVectorTilePolygons",5),oqe=new H;function rqe(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(se.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,m=s.length;for(let x=0;x<m;++x){let b=g.getColor(x,oqe);s[x]=b.toRgba()}a=e._packedBuffer=tqe(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=iqe.scheduleTask(u,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(g.packedBuffer),x=m[0];nqe(e,m),e._indices=Ne.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),sqe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function sqe(e){l(e._primitive)||(e._primitive=new Jx({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}C_.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};C_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};C_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};C_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};C_.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=rqe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};C_.prototype.isDestroyed=function(){return!1};C_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var iL=C_;var oL=`in vec4 currentPosition; +in vec4 previousPosition; +in vec4 nextPosition; +in vec2 expandAndWidth; +in float a_batchId; + +uniform mat4 u_modifiedModelView; void main() { - positionEC = czm_modelView * position; - gl_Position = czm_modelViewProjection * position; + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; - czm_vertexLogDepth(); + vec4 p = u_modifiedModelView * currentPosition; + vec4 prev = u_modifiedModelView * previousPosition; + vec4 next = u_modifiedModelView * nextPosition; + + float angle; + vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; } -`;var sA=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; - -in vec3 v_positionEC; - -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +`;function uh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=H.clone(H.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(uh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function aqe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+se.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,se.pack(t,a,c),c+=se.packedLength,ee.pack(o,a,c),c+=ee.packedLength,h.pack(r,a,c),a}var cqe=new gi("createVectorTilePolylines",5),fE={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function lqe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=aqe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=cqe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===Ne.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),uqe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function uqe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=_t.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),f=_t.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),d=_t.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),p=_t.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),g=_t.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),m=_t.createIndexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),x=[{index:fE.previousPosition,vertexBuffer:u,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:fE.currentPosition,vertexBuffer:f,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:fE.nextPosition,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:fE.expandAndWidth,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:2},{index:fE.a_batchId,vertexBuffer:g,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ti({context:t,attributes:x,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var rL=new F,pue=new h;function fqe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,rL),F.multiplyByPoint(rL,e._center,pue),F.setTranslation(rL,pue,rL),rL},u_highlightColor:function(){return e._highlightColor}})}function dqe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:ln.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var hqe=`uniform vec4 u_highlightColor; +void main() { - vec3 positionEC = czm_pointAlongRay(ray, intersection); - vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; - vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); - vec3 sphericalNormal = normalize(positionMC / u_radii); - vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates - vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates - - vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal); - vec3 positionToEyeEC = -positionEC; - - czm_materialInput materialInput; - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = (positionMC + u_radii) / u_radii; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef ONLY_SUN_LIGHTING - return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); -#else - return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif + out_FragColor = u_highlightColor; } +`;function mqe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(oL),o=n.getFragmentShaderCallback(!1,void 0,!1)(hqe),r=new Ue({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[xu,i]}),s=new Ue({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:fE})}function pqe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new Ze({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:we.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}uh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,u=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let d=o[r],p=o[r+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};uh.prototype.getPositions=function(e){return uh.getPolylinePositions(this,e)};uh.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ws(e,r)}};uh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function _qe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=H.WHITE}}var gqe=new H,yqe=H.WHITE,xqe=!0;uh.prototype.applyStyle=function(e,t){if(!l(e)){_qe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,gqe):yqe,s.show=l(e.show)?e.show.evaluate(s):xqe}};uh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=lqe(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}fqe(this,t),mqe(this,t),dqe(this);let n=e.passes;(n.render||n.pick)&&pqe(this,e)};uh.prototype.isDestroyed=function(){return!1};uh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var Rb=uh;var sL=`in vec3 startEllipsoidNormal; +in vec3 endEllipsoidNormal; +in vec4 startPositionAndHeight; +in vec4 endPositionAndHeight; +in vec4 startFaceNormalAndVertexCorner; +in vec4 endFaceNormalAndHalfWidth; +in float a_batchId; + +uniform mat4 u_modifiedModelView; +uniform vec2 u_minimumMaximumVectorHeights; + +out vec4 v_startPlaneEC; +out vec4 v_endPlaneEC; +out vec4 v_rightPlaneEC; +out float v_halfWidth; +out vec3 v_volumeUpEC; void main() { - // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii - // in the vertex shader. Only when it is larger than some constant, march along the ray. - // Otherwise perform one intersection test which will be the common case. + // vertex corner IDs + // 3-----------7 + // /| left /| + // / | 1 / | + // 2-----------6 5 end + // | / | / + // start |/ right |/ + // 0-----------4 + // + float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end + float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top - // Test if the ray intersects a sphere with the ellipsoid's maximum radius. - // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test - // may cause false negatives. This will discard fragments before marching the ray forward. - float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; - vec3 direction = normalize(v_positionEC); - vec3 ellipsoidCenter = czm_modelView[3].xyz; + vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; + vec3 right = normalize(cross(forward, startEllipsoidNormal)); - float t1 = -1.0; - float t2 = -1.0; + vec4 position = vec4(startPositionAndHeight.xyz, 1.0); + position.xyz += forward * isEnd; - float b = -2.0 * dot(direction, ellipsoidCenter); - float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; + v_volumeUpEC = czm_normal * normalize(cross(right, forward)); - float discriminant = b * b - 4.0 * c; - if (discriminant >= 0.0) { - t1 = (-b - sqrt(discriminant)) * 0.5; - t2 = (-b + sqrt(discriminant)) * 0.5; - } + // Push for volume height + float offset; + vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); - if (t1 < 0.0 && t2 < 0.0) { + // offset height to create volume + offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); + offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; + position.xyz += offset * ellipsoidNormal; + + // move from RTC to EC + position = u_modifiedModelView * position; + right = czm_normal * right; + + // Push for width in a direction that is in the start or end plane and in a plane with right + // N = normalEC ("right-facing" direction for push) + // R = right + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); + scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); + vec3 miterPushNormal = czm_normal * normalize(scratchNormal); + + offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC + offset = offset / dot(miterPushNormal, right); + position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); + + gl_Position = czm_depthClamp(czm_projection * position); + + position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); + vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; + v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); + v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); + + position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); + vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; + v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); + v_halfWidth = endFaceNormalAndHalfWidth.w; +} +`;var aL=`in vec4 v_startPlaneEC; +in vec4 v_endPlaneEC; +in vec4 v_rightPlaneEC; +in float v_halfWidth; +in vec3 v_volumeUpEC; + +uniform vec4 u_highlightColor; +void main() +{ + float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); + + // Discard for sky + if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME discard; +#endif // DEBUG_SHOW_VOLUME } - float t = min(t1, t2); - if (t < 0.0) { - t = 0.0; + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + eyeCoordinate /= eyeCoordinate.w; + + float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); + + // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction + halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); + + // Check distance of the eye coordinate against the right-facing plane + float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); + + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); + + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME } + out_FragColor = u_highlightColor; - // March ray forward to intersection with larger sphere and find - czm_ray ray = czm_ray(t * direction, direction); + czm_writeDepthClamp(); +} +`;function A_(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new z(li._defaultMinTerrainHeight,li._defaultMaxTerrainHeight),this._boundingVolume=vn.fromRectangle(e.rectangle,li._defaultMinTerrainHeight,li._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=H.clone(H.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(A_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function bqe(e,t,n){let i=li.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;vn.fromRectangle(c,o,r,n,a)}function Tqe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+se.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,se.pack(t,a,c),c+=se.packedLength,ee.pack(o,a,c),c+=ee.packedLength,h.pack(r,a,c),a}var Cqe=new gi("createVectorTileClampedPolylines"),Uy={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function Aqe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=Tqe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Cqe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===Ne.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Eqe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Eqe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=_t.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),p=_t.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),g=_t.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),m=_t.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),x=_t.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),b=_t.createVertexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW}),T=_t.createVertexBuffer({context:t,typedArray:c,usage:Fe.STATIC_DRAW}),C=_t.createIndexBuffer({context:t,typedArray:u,usage:Fe.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),A=[{index:Uy.startEllipsoidNormal,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:Uy.endEllipsoidNormal,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:Uy.startPositionAndHeight,vertexBuffer:g,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Uy.endPositionAndHeight,vertexBuffer:m,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Uy.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Uy.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Uy.a_batchId,vertexBuffer:T,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ti({context:t,attributes:A,indexBuffer:C}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var cL=new F,_ue=new h;function Sqe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,cL),F.multiplyByPoint(cL,e._center,_ue),F.setTranslation(cL,_ue,cL),cL},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function gue(e){return Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK}})}function vqe(e){l(e._rs)||(e._rs=gue(!1),e._rs3DTiles=gue(!0))}function wqe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(sL),o=n.getFragmentShaderCallback(!1,void 0,!0)(aL),r=new Ue({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[xu,i]}),s=new Ue({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Uy})}function Dqe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new Ze({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:we.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=Ze.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=we.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===kn.TERRAIN||i===kn.BOTH)&&t.commandList.push(n),(i===kn.CESIUM_3D_TILE||i===kn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}A_.prototype.getPositions=function(e){return Rb.getPolylinePositions(this,e)};A_.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ws(e,r)}};A_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Iqe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=H.WHITE}}var Pqe=new H,Rqe=H.WHITE,Oqe=!0;A_.prototype.applyStyle=function(e,t){if(!l(e)){Iqe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,Pqe):Rqe,s.show=l(e.show)?e.show.evaluate(s):Oqe}};function Mqe(e){return li.initialize().then(function(){bqe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}A_.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Mqe(this).then(Aqe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Sqe(this,t),wqe(this,t),vqe(this);let n=e.passes;(n.render||n.pick)&&Dqe(this,e)};A_.prototype.isDestroyed=function(){return!1};A_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var lL=A_;var Ij=32767,Lqe=new fe,Nqe=new h;function Fqe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);Mn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let d=s[f],p=a[f],g=c[f],m=P.lerp(t.west,t.east,d/Ij),x=P.lerp(t.south,t.north,p/Ij),b=P.lerp(n,i,g/Ij),T=fe.fromRadians(m,x,b,Lqe),C=o.cartographicToCartesian(T,Nqe);h.pack(C,u,f*3)}return u}var uL=Fqe;function dh(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,zqe(this,i,o)}Object.defineProperties(dh.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function Bqe(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function kqe(e,t){let n,i,o,r,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(o),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new re("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var fh=Uint32Array.BYTES_PER_ELEMENT;function Vqe(e){return new Rb(e)}function Uqe(e){return new lL(e)}function zqe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=fh;let r=o.getUint32(n,!0);if(r!==1)throw new re(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=fh;let s=o.getUint32(n,!0);if(n+=fh,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=fh,a===0)throw new re("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=fh;let u=o.getUint32(n,!0);n+=fh;let f=o.getUint32(n,!0);n+=fh;let d=o.getUint32(n,!0);n+=fh;let p=o.getUint32(n,!0);n+=fh;let g=o.getUint32(n,!0);n+=fh;let m=o.getUint32(n,!0);n+=fh;let x=Fo(i,n,a);n+=a;let b=new Uint8Array(t,n,c);n+=c;let T,C;u>0&&(T=Fo(i,n,u),n+=u,f>0&&(C=new Uint8Array(t,n,f),C=new Uint8Array(C),n+=f));let A=y(x.POLYGONS_LENGTH,0),E=y(x.POLYLINES_LENGTH,0),v=y(x.POINTS_LENGTH,0),D=A+E+v,O=new Yp(e,D,T,C,Bqe(e));if(e._batchTable=O,D===0)return;let R=new ih(x,b),M=R.getGlobalProperty("REGION");if(!l(M))throw new re("Feature table global property: REGION must be defined");let N=se.unpack(M),_=M[4],S=M[5],w=e._tile.computedTransform,I=R.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(I)?(I=h.unpack(I),F.multiplyByPoint(w,I,I)):(I=se.center(N),I.height=P.lerp(_,S,.5),I=ee.WGS84.cartographicToCartesian(I));let L=kqe(x,b);if(n+=(4-n%4)%4,A>0){R.featuresLength=A;let B=y(R.getPropertyArray("POLYGON_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new re("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=y(R.getPropertyArray("POLYGON_INDEX_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_INDEX_COUNT",X.UNSIGNED_INT,1));if(!l(U))throw new re("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=B.reduce(function(j,K){return j+K*2},0),G=U.reduce(function(j,K){return j+K},0),k=new Uint32Array(t,n,G);n+=d;let W=new Uint16Array(t,n,V);n+=p;let q,J;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(q=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",X.FLOAT,1),J=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",X.FLOAT,1)),e._polygons=new iL({positions:W,counts:B,indexCounts:U,indices:k,minimumHeight:_,maximumHeight:S,polygonMinimumHeights:q,polygonMaximumHeights:J,center:I,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,batchIds:L.polygons,modelMatrix:w})}if(E>0){R.featuresLength=E;let B=y(R.getPropertyArray("POLYLINE_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYLINE_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new re("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let U=R.getPropertyArray("POLYLINE_WIDTHS",X.UNSIGNED_SHORT,1);if(!l(U)){U=new Uint16Array(E);for(let J=0;J<E;++J)U[J]=2}let V=B.reduce(function(J,j){return J+j*3},0),G=new Uint16Array(t,n,V);n+=g;let k=e._tileset,W=k.examineVectorLinesFunction;if(l(W)){let J=uL(new Uint16Array(G),N,_,S,ee.WGS84);Hqe(J,B,L.polylines,O,e.url,W)}let q=Vqe;l(k.classificationType)&&(q=Uqe),e._polylines=q({positions:G,widths:U,counts:B,batchIds:L.polylines,minimumHeight:_,maximumHeight:S,center:I,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,classificationType:k.classificationType,keepDecodedPositions:k.vectorKeepDecodedPositions})}if(v>0){let B=new Uint16Array(t,n,v*3);n+=m,e._points=new nL({positions:B,batchIds:L.points,minimumHeight:_,maximumHeight:S,rectangle:N,batchTable:O})}}function Pj(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}dh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};dh.prototype.getFeature=function(e){return l(this._features)||Pj(this),this._features[e]};dh.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};dh.prototype.applyStyle=function(e){l(this._features)||Pj(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};dh.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||Pj(this),this._batchTable.update(e,t),this._ready=!0)};dh.prototype.pick=function(e,t,n){};dh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};dh.prototype.isDestroyed=function(){return!1};dh.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function Hqe(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,r(f,n[c],o,i)}}var fL=dh;var yue={b3dm:function(e,t,n,i,o){return Pu.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Pu.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Pu.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return U1.fromTileType(e,t,n,i,o,yue)},externalTileset:function(e,t,n,i){return zM.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new H1(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new fL(e,t,n,i,o)},subt:function(e,t,n,i,o){return NA.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return NA.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new re("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return Pu.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Pu.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Pu.fromGeoJson(e,t,n,i)}},Ob=yue;var Gqe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Yo=Object.freeze(Gqe);var hh={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};hh.isBinaryFormat=function(e){switch(e){case hh.BATCHED_3D_MODEL:case hh.INSTANCED_3D_MODEL:case hh.COMPOSITE:case hh.POINT_CLOUD:case hh.VECTOR:case hh.GEOMETRY:case hh.IMPLICIT_SUBTREE:case hh.VOXEL_BINARY:case hh.GLTF_BINARY:return!0;default:return!1}};var Ds=Object.freeze(hh);var Wqe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},jf=Object.freeze(Wqe);var Ks={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},E_=new Array(Ks.NUMBER_OF_PASSES);E_[Ks.RENDER]=Object.freeze({pass:Ks.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});E_[Ks.PICK]=Object.freeze({pass:Ks.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});E_[Ks.SHADOW]=Object.freeze({pass:Ks.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});E_[Ks.PRELOAD]=Object.freeze({pass:Ks.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});E_[Ks.PRELOAD_FLIGHT]=Object.freeze({pass:Ks.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});E_[Ks.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ks.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});E_[Ks.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ks.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});E_[Ks.MOST_DETAILED_PICK]=Object.freeze({pass:Ks.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ks.getPassOptions=function(e){return E_[e]};var Uo=Object.freeze(Ks);function Dm(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Dm.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});Dm.prototype.hasProperty=function(e,t){return!1};Dm.prototype.getFeature=function(e){};Dm.prototype.applyDebugSettings=function(e,t){};Dm.prototype.applyStyle=function(e){};Dm.prototype.update=function(e,t){};Dm.prototype.pick=function(e,t,n){};Dm.prototype.isDestroyed=function(){return!1};Dm.prototype.destroy=function(){return ue(this)};var dE=Dm;function S_(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(S_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});S_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};S_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};S_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};S_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};S_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};S_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};S_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var dL=S_;function Rj(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Rj._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new dL({content:n,class:o})}}Rj._oneTimeWarning=gt;var Mb=Rj;function jqe(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var Lb=jqe;function v_(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(v_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});v_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};v_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};v_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};v_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};v_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};v_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};v_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var hL=v_;function Oj(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Oj._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new hL({tile:n,class:o})}}Oj._oneTimeWarning=gt;var mL=Oj;function qqe(e){let t=new Uint8Array(e),n=Yd(t);if(n==="glTF"&&(n="glb"),Ds.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Yqe(t);if(l(i.root))return{contentType:Ds.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ds.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ds.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ds.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ds.VOXEL_JSON,jsonPayload:i};throw new re("Invalid tile content.")}function Yqe(e){let t;try{t=Fo(e)}catch{throw new re("Invalid tile content.")}return t}var Im=qqe;function qf(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=ic.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(qf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function Mj(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function xue(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}qf.prototype.requestInnerContents=function(){if(!Xqe(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;Mj(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=Kqe(this,n,t,this._tile._contentState);return Zqe(this)};function Xqe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!ic.serverHasOpenSlots(n,t[n]))return!1;return ic.heapHasOpenSlots(e.length)}function Kqe(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new $o({throttle:!0,throttleByServer:!0,type:ds.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Zn.CANCELLED){xue(e,i);return}return Mj(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Zn.CANCELLED){xue(e,i);return}Mj(e,-1),bue(e,t,f)}})}async function Zqe(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>$qe(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function $qe(e,t,n){if(l(t))try{let i=Im(t);if(i.contentType===Ds.EXTERNAL_TILESET)throw new re("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ds.GEOMETRY||i.contentType===Ds.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=Ob[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=Mb(o,u));let f=Lb(o,u);return l(f)&&(a.group=new Kx({metadata:f})),a}catch(i){bue(e,n,i)}}function bue(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}qf.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};qf.prototype.hasProperty=function(e,t){return!1};qf.prototype.getFeature=function(e){};qf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};qf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};qf.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};qf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=h.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};qf.prototype.isDestroyed=function(){return!1};qf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var pL=qf;var Tue=Math.cos,Cue=Math.sin,Qqe=Math.sqrt,Lj={};Lj.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,d=Tue(f),p=Cue(f),g=a.z*p,m=c.longitude+i*e.granYSin+o*e.granXCos,x=d*Tue(m),b=d*Cue(m),T=a.x*x,C=a.y*b,A=Qqe(T*x+C*b+g*p);if(r.x=T/A,r.y=C/A,r.z=g/A,n){let E=e.stNwCorner;l(E)?(f=E.latitude-e.stGranYCos*i+o*e.stGranXSin,m=E.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var Jqe=new Ri,Yf=new h,eYe=new fe,Dz=new h,_L=new Pi;function Aue(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;_L._ellipsoid=ee.default,Yf=_L.project(e,Yf),Yf=h.subtract(Yf,Dz,Yf);let g=Ri.fromRotation(t,Jqe);Yf=Ri.multiplyByVector(g,Yf,Yf),Yf=h.add(Yf,Dz,Yf),e=_L.unproject(Yf,e),r-=1,s-=1;let m=e.latitude,x=m+r*p,b=m-c*s,T=m-c*s+r*p,C=Math.max(m,x,b,T),A=Math.min(m,x,b,T),E=e.longitude,v=E+r*u,D=E+s*d,O=E+s*d+r*u,R=Math.max(E,v,D,O),M=Math.min(E,v,D,O);return{north:C,south:A,east:R,west:M,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}Lj.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===P.PI_OVER_TWO&&(d=!0),f===-P.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>a?g=P.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,b=Math.ceil(m/t)+1,T=g/(x-1),C=m/(b-1),A=se.northwest(e,r),E=se.center(e,eYe);(n!==0||i!==0)&&(E.longitude<A.longitude&&(E.longitude+=P.TWO_PI),_L._ellipsoid=ee.default,Dz=_L.project(E,Dz));let v=C,D=T,O=0,R=0,M=se.clone(e,o),N={granYCos:v,granYSin:O,granXCos:D,granXSin:R,nwCorner:A,boundingRectangle:M,width:x,height:b,northCap:d,southCap:p};if(n!==0){let _=Aue(A,n,T,C,E,x,b);u=_.north,f=_.south,a=_.east,c=_.west,N.granYCos=_.granYCos,N.granYSin=_.granYSin,N.granXCos=_.granXCos,N.granXSin=_.granXSin,M.north=u,M.south=f,M.east=a,M.west=c}if(i!==0){n=n-i;let _=se.northwest(M,s),S=Aue(_,n,T,C,E,x,b);N.stGranYCos=S.granYCos,N.stGranXCos=S.granXCos,N.stGranYSin=S.granYSin,N.stGranXSin=S.granXSin,N.stNwCorner=_,N.stWest=S.west,N.stSouth=S.south}return N};var Is=Lj;var tYe=new ae,nYe=new ae,iYe=new h,oYe=new se;function Eue(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;r&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*o+2*a-f;let d=new Float64Array(u*3),p=0,g=0,m,x=iYe;if(r)Is.computePosition(t,n,!1,g,0,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;else for(m=0;m<o;m++)Is.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(m=o-1,g=1;g<i;g++)Is.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;if(g=i-1,!s)for(m=o-2;m>=0;m--)Is.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(m=0,g=i-2;g>0;g--)Is.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;let b=d.length/3*2,T=Ne.createTypedArray(d.length/3,b),C=0;for(let E=0;E<d.length/3-1;E++)T[C++]=E,T[C++]=E+1;T[C++]=d.length/3-1,T[C++]=0;let A=new st({attributes:new un,primitiveType:Me.LINES});return A.attributes.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),A.indices=T,A}function rYe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=Eue(e,t),s=t.height,a=t.width,c=si.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=si.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(d,u),r.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let x=(f.length/3+m)*2,b=Ne.createTypedArray(f.length/3,x);u=f.length/6;let T=0;for(let A=0;A<u-1;A++)b[T++]=A,b[T++]=A+1,b[T++]=A+u,b[T++]=A+u+1;b[T++]=u-1,b[T++]=0,b[T++]=u+u-1,b[T++]=u,b[T++]=0,b[T++]=u;let C;if(p)C=s-1;else{let A=a-1;b[T++]=A,b[T++]=A+u,C=a+s-2}if(b[T++]=C,b[T++]=C+u,!g){let A=a+C-1;b[T++]=A,b[T]=A+u}return r.indices=b,r}function mE(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,P.RADIANS_PER_DEGREE),i=y(e.ellipsoid,ee.default),o=y(e.rotation,0),r=y(e.height,0),s=y(e.extrudedHeight,r);this._rectangle=se.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}mE.packedLength=se.packedLength+ee.packedLength+5;mE.pack=function(e,t,n){return n=y(n,0),se.pack(e._rectangle,t,n),n+=se.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var Sue=new se,vue=ee.clone(ee.UNIT_SPHERE),hE={rectangle:Sue,ellipsoid:vue,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};mE.unpack=function(e,t,n){t=y(t,0);let i=se.unpack(e,t,Sue);t+=se.packedLength;let o=ee.unpack(e,t,vue);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=se.clone(i,n._rectangle),n._ellipsoid=ee.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(hE.granularity=r,hE.height=s,hE.rotation=a,hE.extrudedHeight=c,hE.offsetAttribute=u===-1?void 0:u,new mE(hE))};var sYe=new fe;mE.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Is.computeOptions(t,e._granularity,e._rotation,0,oYe,sYe),o,r;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),u;if(c){if(o=rYe(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===on.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===on.NONE?0:1,g=g.fill(u)),o.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ae.fromRectangle3D(t,n,s,nYe),d=ae.fromRectangle3D(t,n,a,tYe);r=ae.union(f,d)}else{if(o=Eue(e,i),o.attributes.position.values=si.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===on.NONE?0:1;let d=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}r=ae.fromRectangle3D(t,n,s)}return new st({attributes:o.attributes,indices:o.indices,primitiveType:Me.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var Nb=mE;function _E(e){this.rectangle=se.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=y(e.ellipsoid,ee.WGS84);fYe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(_E.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});_E.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=vn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)};var wue=new h,Iz=new h,Due=new h,aYe=new h,cYe=new h,lYe=new h,uYe=new h,Xf=new fe,Iue=new rn(h.UNIT_X,0),pE=new hn;function fYe(e,t,n){n.cartographicToCartesian(se.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(se.northeast(t),e.northeastCornerCartesian),Xf.longitude=t.west,Xf.latitude=(t.south+t.north)*.5,Xf.height=0;let i=n.cartographicToCartesian(Xf,lYe),o=h.cross(i,h.UNIT_Z,aYe);h.normalize(o,e.westNormal),Xf.longitude=t.east;let r=n.cartographicToCartesian(Xf,uYe),s=h.cross(h.UNIT_Z,r,wue);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,wue);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,cYe),u=t.south,f;if(u>0){Xf.longitude=(t.west+t.east)*.5,Xf.latitude=u;let x=n.cartographicToCartesian(Xf,pE.origin);h.clone(c,pE.direction);let b=rn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Iue);$n.rayPlane(pE,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(x,Iz)}else f=n.geodeticSurfaceNormalCartographic(se.southeast(t),Iz);let d=h.cross(f,a,Due);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){Xf.longitude=(t.west+t.east)*.5,Xf.latitude=p;let x=n.cartographicToCartesian(Xf,pE.origin);h.negate(c,pE.direction);let b=rn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Iue);$n.rayPlane(pE,b,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,Iz)}else g=n.geodeticSurfaceNormalCartographic(se.northwest(t),Iz);let m=h.cross(a,g,Due);h.normalize(m,e.northNormal)}var dYe=new h,hYe=new h,mYe=new h(0,-1,0),pYe=new h(0,0,-1),Pue=new h;function _Ye(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!se.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(se.southwest(e.rectangle),dYe),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(se.northeast(e.rectangle),hYe),f.z=f.y,f.y=f.x,f.x=0,d=mYe,g=h.UNIT_Y,p=pYe,m=h.UNIT_Z);let x=h.subtract(i,u,Pue),b=h.dot(x,d),T=h.dot(x,p),C=h.subtract(i,f,Pue),A=h.dot(C,g),E=h.dot(C,m);b>0?r+=b*b:A>0&&(r+=A*A),T>0?r+=T*T:E>0&&(r+=E*E)}let s,a,c;if(t.mode===ne.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}_E.prototype.distanceToCamera=function(e){let t=_Ye(this,e);if(e.mode===ne.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};_E.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};_E.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new Nb({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new St({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var Kf=_E;var gL={},gYe=new h,Rue=new h,Oue=new h,Mue=new h,Lue=new vn;gL.validOutline=function(e){let n=vn.fromPoints(e,Lue).halfAxes,i=$.getColumn(n,0,Rue),o=$.getColumn(n,1,Oue),r=$.getColumn(n,2,Mue),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};gL.computeProjectTo2DArguments=function(e,t,n,i){let o=vn.fromPoints(e,Lue),r=o.halfAxes,s=$.getColumn(r,0,Rue),a=$.getColumn(r,1,Oue),c=$.getColumn(r,2,Mue),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(o.center,t),!0};function Nue(e,t,n,i,o){let r=h.subtract(e,t,gYe),s=h.dot(n,r),a=h.dot(i,r);return z.fromElements(s,a,o)}gL.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Nue(i[r],e,t,n);return o}};gL.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Nue(i,e,t,n,o)}};var w_=gL;function yYe(e){let t=e.length,n=new Float64Array(t*3),i=Ne.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new un({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n})});return new st({attributes:s,indices:i,primitiveType:Me.LINES})}function Fb(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Un.computeHierarchyPackedLength(t,h)+1}Fb.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new Fb(t)};Fb.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var xYe={polygonHierarchy:{}};Fb.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new Fb(xYe)),n._polygonHierarchy=i,n.packedLength=o,n};Fb.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Co(n,h.equalsEpsilon,!0),n.length<3||!w_.validOutline(n))return;let o=Un.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new St({geometry:yYe(o[c])});r.push(u)}let s=Ln.combineInstances(r)[0],a=ae.fromPoints(t.positions);return new st({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Zf=Fb;var Pz=new fe;function yL(e){let t=Zp.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),o=y(e.ellipsoid,ee.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=DYe(t,n,i,o);this._boundingPlanes=r;let s=OYe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=Hj(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=Hj(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=Hj(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();Pz=o.cartesianToCartographic(c,Pz),Pz.height=(i+n)/2,this.center=o.cartographicToCartesian(Pz,c),this._boundingSphere=ae.fromPoints(s)}var bYe=new h,TYe=new fe,CYe=new h,AYe=new fe,EYe=new h,SYe=new h,vYe=new h,wYe=new h;function DYe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,bYe),a=i.cartesianToCartographic(r,TYe);a.height=n;let c=i.cartographicToCartesian(a,CYe),u=rn.fromPointNormal(c,s);o[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,AYe),m.height=t;let b=rn.getPointDistance(u,i.cartographicToCartesian(m,EYe));b<f&&(f=b)}let x=rn.clone(u);for(x.normal=h.negate(x.normal,x.normal),x.distance=x.distance*-1+f,o[1]=x,d=0;d<4;d++){g=p[d];let b=p[(d+1)%4],T=i.geodeticSurfaceNormal(g,SYe),C=h.subtract(b,g,wYe),A=h.cross(C,T,vYe);A=h.normalize(A,A),o[2+d]=rn.fromPointNormal(g,A)}return o}var Bb=new h,kb=new h,Vb=new h,Nj=new h,Fj=new h,Bj=new h,IYe=new h,PYe=new h,RYe=new h,kj=new h,Vj=new h,Uj=new h,zy=new h,Pm=new $;function Fue(e,t,n){Bb=e.normal,kb=t.normal,Vb=n.normal,Nj=h.multiplyByScalar(e.normal,-e.distance,Nj),Fj=h.multiplyByScalar(t.normal,-t.distance,Fj),Bj=h.multiplyByScalar(n.normal,-n.distance,Bj),kj=h.multiplyByScalar(h.cross(kb,Vb,IYe),h.dot(Nj,Bb),kj),Vj=h.multiplyByScalar(h.cross(Vb,Bb,PYe),h.dot(Fj,kb),Vj),Uj=h.multiplyByScalar(h.cross(Bb,kb,RYe),h.dot(Bj,Vb),Uj),Pm[0]=Bb.x,Pm[1]=kb.x,Pm[2]=Vb.x,Pm[3]=Bb.y,Pm[4]=kb.y,Pm[5]=Vb.y,Pm[6]=Bb.z,Pm[7]=kb.z,Pm[8]=Vb.z;let i=$.determinant(Pm);return zy=h.add(kj,Vj,zy),zy=h.add(zy,Uj,zy),new h(zy.x/i,zy.y/i,zy.z/i)}function OYe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Fue(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Fue(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var zj=new h,gE=new h;function Hj(e,t){let n=[];for(let i=0;i<4;i++)zj=h.subtract(t[(i+1)%4],t[i],zj),gE=h.cross(e.normal,zj,gE),gE=h.normalize(gE,gE),n[i]=h.clone(gE);return n}Object.defineProperties(yL.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var Gj=new h;yL.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;rn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):rn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,rn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=Wj(rn.projectPointOntoPlane(c,t,Gj),i[0],c,o),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Bue(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=Wj(rn.projectPointOntoPlane(c,t,Gj),i[r],c,this._edgeNormals[n[r]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=Wj(rn.projectPointOntoPlane(this._boundingPlanes[1],t,Gj),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var MYe=new h,LYe=new h;function Bue(e,t,n){let i=h.subtract(n,t,MYe),o=h.subtract(e,t,LYe),r=h.dot(i,o);if(r<=0)return t;let s=h.dot(i,i);return r>=s?n:(r=r/s,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var NYe=new rn(h.UNIT_X,0);function Wj(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let u=rn.fromPointNormal(t[c],i[c],NYe);rn.getPointDistance(u,e)<0||(a=Bue(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}yL.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Wt.INSIDE:n===this._vertices.length?Wt.OUTSIDE:Wt.INTERSECTING};yL.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new Zf({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Zf.createGeometry(n),o=new St({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}}),r=new Zf({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Zf.createGeometry(r),a=new St({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Zf({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=Zf.createGeometry(f);c[u]=new St({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}})}return new Dn({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var xL=yL;var FYe=new h(1,1,1),Rz=Math.cos,Oz=Math.sin;function yE(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,FYe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,P.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),u=Math.round(y(e.subdivisions,128));this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}yE.packedLength=2*h.packedLength+8;yE.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var kue=new h,Vue=new h,D_={radii:kue,innerRadii:Vue,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};yE.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,kue);t+=h.packedLength;let o=h.unpack(e,t,Vue);t+=h.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(D_.minimumClock=r,D_.maximumClock=s,D_.minimumCone=a,D_.maximumCone=c,D_.stackPartitions=u,D_.slicePartitions=f,D_.subdivisions=d,D_.offsetAttribute=p===-1?void 0:p,new yE(D_))};yE.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ee.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-r)/P.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,x=!1;g&&(p=2,r>0&&(m=!0,d+=u),s<Math.PI&&(x=!0,d+=u));let b=a*p*(f+u),T=new Float64Array(b*3),C=2*(b+d-(u+f)*p),A=Ne.createTypedArray(b,C),E,v,D,O,R=0,M=new Array(f),N=new Array(f);for(E=0;E<f;E++)O=r+E*(s-r)/(f-1),M[E]=Oz(O),N[E]=Rz(O);let _=new Array(a),S=new Array(a);for(E=0;E<a;E++)D=i+E*(o-i)/(a-1),_[E]=Oz(D),S[E]=Rz(D);for(E=0;E<f;E++)for(v=0;v<a;v++)T[R++]=t.x*M[E]*S[v],T[R++]=t.y*M[E]*_[v],T[R++]=t.z*N[E];if(g)for(E=0;E<f;E++)for(v=0;v<a;v++)T[R++]=n.x*M[E]*S[v],T[R++]=n.y*M[E]*_[v],T[R++]=n.z*N[E];for(M.length=a,N.length=a,E=0;E<a;E++)O=r+E*(s-r)/(a-1),M[E]=Oz(O),N[E]=Rz(O);for(_.length=u,S.length=u,E=0;E<u;E++)D=i+E*(o-i)/(u-1),_[E]=Oz(D),S[E]=Rz(D);for(E=0;E<a;E++)for(v=0;v<u;v++)T[R++]=t.x*M[E]*S[v],T[R++]=t.y*M[E]*_[v],T[R++]=t.z*N[E];if(g)for(E=0;E<a;E++)for(v=0;v<u;v++)T[R++]=n.x*M[E]*S[v],T[R++]=n.y*M[E]*_[v],T[R++]=n.z*N[E];for(R=0,E=0;E<f*p;E++){let L=E*a;for(v=0;v<a-1;v++)A[R++]=L+v,A[R++]=L+v+1}let w=f*a*p;for(E=0;E<u;E++)for(v=0;v<a-1;v++)A[R++]=w+E+v*u,A[R++]=w+E+(v+1)*u;if(g)for(w=f*a*p+u*a,E=0;E<u;E++)for(v=0;v<a-1;v++)A[R++]=w+E+v*u,A[R++]=w+E+(v+1)*u;if(g){let L=f*a*p,B=L+a*u;if(m)for(E=0;E<u;E++)A[R++]=L+E,A[R++]=B+E;if(x)for(L+=a*u-u,B+=a*u-u,E=0;E<u;E++)A[R++]=L+E,A[R++]=B+E}let I=new un({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T})});if(l(e._offsetAttribute)){let L=T.length,B=e._offsetAttribute===on.NONE?0:1,U=new Uint8Array(L/3).fill(B);I.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}return new st({attributes:I,indices:A,primitiveType:Me.LINES,boundingSphere:ae.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Mu=yE;function xE(e){let t=y(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Mu(i),this._workerName="createSphereOutlineGeometry"}xE.packedLength=Mu.packedLength;xE.pack=function(e,t,n){return Mu.pack(e._ellipsoidGeometry,t,n)};var BYe=new Mu,Ub={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};xE.unpack=function(e,t,n){let i=Mu.unpack(e,t,BYe);return Ub.stackPartitions=i._stackPartitions,Ub.slicePartitions=i._slicePartitions,Ub.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,Ub.radii),n._ellipsoidGeometry=new Mu(Ub),n):(Ub.radius=i._radii.x,new xE(Ub))};xE.createGeometry=function(e){return Mu.createGeometry(e._ellipsoidGeometry)};var I_=xE;function bE(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ae(e,t)}Object.defineProperties(bE.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});bE.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};bE.prototype.intersectPlane=function(e){return ae.intersectPlane(this._boundingSphere,e)};bE.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};bE.prototype.createDebugVolume=function(e){let t=new I_({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new St({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Gt.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var P_=bE;var kYe=new h,VYe=new h,UYe=new h,zYe=new h;function zb(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,P.EPSILON7/i,n)}function jj(e,t){let n=h.normalize(e,zYe),i=h.equalsEpsilon(n,h.UNIT_X,P.EPSILON6)?h.UNIT_Y:h.UNIT_X;return zb(e,i,t)}function Uue(e){let t=$.getColumn(e,0,kYe),n=$.getColumn(e,1,VYe),i=$.getColumn(e,2,UYe),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(o&&!r&&!s?t=zb(n,i,t):!o&&r&&!s?n=zb(t,i,n):!o&&!r&&s?i=zb(n,t,i):o?r?s||(t=jj(i,t),n=zb(i,t,n)):(t=jj(n,t),i=zb(n,t,i)):(n=jj(t,n),i=zb(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function TE(e,t){t=Uue(t),this._orientedBoundingBox=new vn(e,t),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(TE.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});TE.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};TE.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};TE.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=Uue(t),$.clone(t,this._orientedBoundingBox.halfAxes),ae.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};TE.prototype.createDebugVolume=function(e){let t=new Bd({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new St({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Gt.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var Lu=TE;function or(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||oi(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=F.multiply(a,this.transform,new F),u=l(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(u,this.transform,new F),this.computedTransform=c,this.metadata=mL(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,or._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&or._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?jo.REPLACE:jo.ADD):l(i)?p=i.refine:p=jo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,x,b,T;if(t=Se.createIfNeeded(t),r)x=Yo.UNLOADED,b=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(or._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(or._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new dE(e,this),m=!0,x=Yo.READY):(x=Yo.UNLOADED,b=t.getDerivedResource({url:v}),T=ic.getServerKey(b.getUrlComponent()))}else g=new dE(e,this),m=!0,x=Yo.READY;this._content=g,this._contentResource=b,this._contentState=x,this._expiredContent=void 0,this._serverKey=T,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let C=n.expire,A,E;l(C)&&(A=C.duration,l(C.date)&&(E=Z.fromIso8601(C.date))),this.expireDuration=A,this.expireDate=E,this.lastStyleTime=0,this._optimChildrenWithinParent=jf.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=H.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new Z,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}or._deprecationWarning=ms;Object.defineProperties(or.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new H),H.clone(this._color)},set:function(e){this._color=H.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Yo.READY}},contentUnloaded:{get:function(){return this._contentState===Yo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Yo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Yo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Hy=new h;function HYe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,Hy),c=h.add(s.positionWC,a,Hy),u=h.subtract(c,r,Hy);if(h.magnitude(u)>o){let E=h.normalize(u,Hy),v=h.multiplyByScalar(E,o,Hy),D=h.add(r,v,Hy),O=h.subtract(D,s.positionWC,Hy),R=h.normalize(O,Hy);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===jo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Uo.PRELOAD_FLIGHT||n._pass===Uo.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*m;if(e._foveatedFactor<=x)return!1;let b=m-x,T=P.clamp((e._foveatedFactor-x)/b,0,1),C=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,T),A=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-C<=A}var Wue=new Z;or.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*o,p;if(e.mode===ne.SCENE2D||u instanceof nn){let g=u.offCenterFrustum;l(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/m}else{let g=Math.max(this._distanceToCamera,P.EPSILON7),m=u.sseDenominator;if(p=s*d/(g*m),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,T=P.fog(g,x)*b;p-=T}}return p/=e.pixelRatio,p};function GYe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function WYe(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}or.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:_s.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==_s.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=WYe(n,this),this._priorityProgressiveResolution=GYe(n,this),this.priorityDeferred=HYe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};or.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Z.now(Wue);Z.lessThan(this.expireDate,e)&&(this._contentState=Yo.EXPIRED,this._expiredContent=this._content)}};function jYe(e){if(!l(e.expireDuration))return;let t=Z.now(Wue);Z.addSeconds(t,e.expireDuration,t),l(e.expireDate)?Z.lessThan(e.expireDate,t)&&Z.clone(t,e.expireDate):e.expireDate=Z.clone(t)}function qYe(e){return function(){return e._priority}}or.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?YYe(this):KYe(this)};function YYe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=oi(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new pL(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Yo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Yo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Yo.FAILED,o})}async function XYe(e,t,n,i,o){let r=e._contentState;e._contentState=Yo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Zn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Yo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Zn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await ZYe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Yo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Yo.FAILED,a}}function KYe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new $o({throttle:!0,throttleByServer:!0,type:ds.TILES3D,priorityFunction:qYe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return XYe(e,o,i,n,r)}async function ZYe(e,t){let n=Im(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Ds.GEOMETRY||n.contentType===Ds.VECTOR,(n.contentType===Ds.IMPLICIT_SUBTREE||n.contentType===Ds.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===Ds.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=Ob[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=Mb(i,s));let a=Lb(i,s);return l(a)&&(o.group=new Kx({metadata:a})),o}or.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};or.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Yo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var jue=new ae;function Yj(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,jue);e._boundingVolume2D=new P_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function $Ye(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,jue);e._contentBoundingVolume2D=new P_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}or.prototype.visibility=function(e,t){let n=e.cullingVolume,i=Yj(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Wt.INSIDE,a===Wt.OUTSIDE)return _s.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Wt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};or.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Wt.INSIDE;if(this._visibilityPlaneMask===_s.MASK_INSIDE)return Wt.INSIDE;let t=e.cullingVolume,n=$Ye(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Wt.INSIDE,s===Wt.OUTSIDE)return Wt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Wt.OUTSIDE,s===Wt.INSIDE)return Wt.OUTSIDE}return t.computeVisibility(n)};or.prototype.distanceToTile=function(e){return Yj(this,e).distanceToCamera(e)};var QYe=new h;or.prototype.distanceToTileCenter=function(e){let n=Yj(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,QYe);return h.dot(e.camera.directionWC,i)};or.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var que=new $,Yue=new h,JYe=new $,Xj=new h,Xue=new se,Kue=new vn,qj=new F;function eXe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],Xj),o=$.fromArray(e,3,JYe);i=F.multiplyByPoint(t,i,i);let r=F.getMatrix3(t,que);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new Lu(i,o)}function tXe(e,t,n,i){let o=se.unpack(e,0,Xue),r=e[4],s=e[5],a=vn.fromRectangle(o,r,s,ee.WGS84,Kue),c=a.center,u=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,qj),qj),c=F.multiplyByPoint(t,c,c);let f=F.getMatrix3(t,que);return u=$.multiply(f,u,u),l(i)&&i instanceof Lu?(i.update(c,u),i):new Lu(c,u)}function nXe(e,t,n,i){if(!F.equalsEpsilon(t,n,P.EPSILON8))return tXe(e,t,n,i);let o=se.unpack(e,0,Xue);return l(i)?(i.rectangle=se.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Kf({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function iXe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],Xj),o=e[3];i=F.multiplyByPoint(t,i,i);let r=F.getScale(t,Yue),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new P_(i,o)}or.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=hb.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new re("boundingVolume must be defined");if(oi(e,"3DTILES_bounding_volume_S2"))return new xL(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=eXe(r,t,n);return this._verticalExaggeration!==1&&zue(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=nXe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Lu?zue(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Er.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Er.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ee.WGS84))),c}if(l(a)){let c=iXe(a,t,n);if(this._verticalExaggeration!==1){let u=Er.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,Xj),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new re("boundingVolume must contain a sphere, region, or box")};var oXe=h.unpackArray(new Array(8*3).fill(0));function zue(e,t,n){let i=e.boundingVolume.computeCorners(oXe).map(r=>Er.getPosition(r,ee.WGS84,t,n,r)),o=vn.fromPoints(i,Kue);e.update(o.center,o.halfAxes)}or.prototype.updateTransform=function(e,t){e=y(e,F.IDENTITY);let n=F.multiplyTransformation(e,this.transform,qj),i=!F.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&F.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};or.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,Yue),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function rXe(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=H.WHITE:c=H.DARKGRAY:c=H.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Gt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(H.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(H.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=H.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function sXe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Yo.FAILED,o}}function aXe(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function cXe(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}or.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;aXe(this,e),cXe(this,e),rXe(this,e,t,n),sXe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===we.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var Hue=[];or.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(jYe(this),this._selectedFrame=0,this.lastStyleTime=0,Z.now(this._loadTimestamp),this._contentState=Yo.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Hue;try{this._content.update(e,t)}catch(i){throw this._contentState=Yo.FAILED,i}Hue.length=0,t.commandList=n};function Gue(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function Mz(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}or.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,u=o,f=c+u,d=r,p=Math.pow(10,f),g=f+d,m=r,x=Math.pow(10,g),b=g+m,T=Math.pow(10,b),C=Mz(this._depth,n.depth,i.depth);C=t?1-C:C;let E=!e.isSkippingLevelOfDetail&&this.refine===jo.REPLACE?Mz(this._priorityHolder._distanceToCamera,n.distance,i.distance):Mz(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=Gue(E,a,s),D=this._priorityProgressiveResolution?0:p,O=Mz(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=Gue(O,u,c),M=this.priorityDeferred?x:0,N=e._pass===Uo.PRELOAD_FLIGHT?0:T;this._priority=C+v+D+R+M+N};or.prototype.isDestroyed=function(){return!1};or.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var $f=or;function R_(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(R_.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});R_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};R_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};R_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};R_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};R_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};R_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};R_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var CE=R_;function O_(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(O_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});O_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};O_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};O_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};O_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};O_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};O_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};O_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var bL=O_;function Zue(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),o;l(i)&&(o=new bL({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new CE({group:f,class:n.classes[f.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new CE({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Zue.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Hb=Zue;var $ue={},lXe=new h;$ue.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Lu||i instanceof Kf){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=jf.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Lu||a instanceof Kf)){e._optimChildrenWithinParent=jf.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,o.center,lXe),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=jf.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===jf.USE_OPTIMIZATION};var TL=$ue;function CL(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(CL.prototype,{length:{get:function(){return this._length}}});function uXe(e,t,n){this.item=e,this.previous=t,this.next=n}CL.prototype.add=function(e){let t=new uXe(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Que(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}CL.prototype.remove=function(e){l(e)&&(Que(this,e),--this._length)};CL.prototype.splice=function(e,t){if(e===t)return;Que(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var AL=CL;function Gb(){this._list=new AL,this._sentinel=this._list.add(),this._trimTiles=!1}Gb.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Gb.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Gb.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Gb.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Gb.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};Gb.prototype.trim=function(){this._trimTiles=!0};var EL=Gb;function Lz(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function Zj(e,t){let n;return t==="_loadTimestamp"?n=Z.toDate(e).getTime():n=e,n}Lz.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=Zj(e,n),this._referenceMaximum[n]=Zj(t,n)};function fXe(e,t){let n=e.tilePropertyName;if(l(n)){let i=Zj(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var Kj=[new H(.1,.1,.1,1),new H(.153,.278,.878,1),new H(.827,.231,.49,1),new H(.827,.188,.22,1),new H(1,.592,.259,1),new H(1,.843,0,1)];Lz.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=fXe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+P.EPSILON7,c=P.clamp(i-o,0,s)/s,u=Kj.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=Kj[d],x=Kj[p],b=H.clone(H.WHITE);b.red=P.lerp(m.red,x.red,g),b.green=P.lerp(m.green,x.green,g),b.blue=P.lerp(m.blue,x.blue,g),e._debugColor=b};Lz.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var SL=Lz;function AE(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}AE.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};AE.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};AE.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Pu))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};AE.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Pu))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};AE.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.texturesReferenceCounterById={...e.texturesReferenceCounterById},t.batchTableByteLength=e.batchTableByteLength};var M_=AE;function vL(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(vL.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});vL.prototype.makeDirty=function(){this._styleDirty=!0};vL.prototype.resetDirty=function(){this._styleDirty=!1};vL.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var wL=vL;function dXe(e,t,n){let i=oi(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!oi(o,"3DTILES_bounding_volume_S2")&&!oi(o,"3DTILES_bounding_volume_cylinder"))throw new re("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new Se({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=hXe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Ge(a,!0));let c=new Se({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=mXe(t),this.subdivisionScheme=ns[i.subdivisionScheme],this.branchingFactor=ns.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function hXe(e){if(oi(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function mXe(e){let t=Ge(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var Wb=dXe;var DL={};function Jue(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function $j(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function efe(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function Qj(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}DL.encode2D=function(e,t){return(Jue(e)|Jue(t)<<1)>>>0};DL.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=efe(e),t[1]=efe(e>>1),t};DL.encode3D=function(e,t,n){return $j(e)|$j(t)<<1|$j(n)<<2};DL.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=Qj(e),t[1]=Qj(e>>1),t[2]=Qj(e>>2),t};var Gy=DL;function Xo(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===ns.OCTREE&&(this.z=e.z)}Object.defineProperties(Xo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===ns.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===ns.OCTREE?Gy.encode3D(this.x,this.y,this.z):Gy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===ns.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Xo.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===ns.OCTREE){let o=(this.z<<e.level)+e.z;return new Xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Xo.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===ns.OCTREE){let r=Math.floor(this.z/t);return new Xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Xo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===ns.OCTREE){let r=e.z%n;return new Xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Xo.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===ns.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Xo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Xo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Xo.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===ns.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Xo.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===ns.OCTREE?this.z===e.z:!0)};Xo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Xo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Xo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Xo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===ns.OCTREE&&(e.z=this.z),e};var tfe=[0,0,0];Xo.fromMortonIndex=function(e,t,n,i){let o;return e===ns.OCTREE?(o=Gy.decode3D(i,tfe),new Xo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Gy.decode2D(i,tfe),new Xo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Xo.fromTileIndex=function(e,t,n){let i,o,r;return e===ns.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(P.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Xo.fromMortonIndex(e,t,i,r)};var jb=Xo;function L_(){}L_.selectTiles=function(e,t){he.throwInstantiationError()};L_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};L_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};L_.selectTile=function(e,t){if(e.contentVisibility(t)===Wt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};L_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};L_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};L_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!pXe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function pXe(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}L_.updateTile=function(e,t){nfe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,yXe(e),e._shouldSelect=!1,e._finalResolution=!0};function nfe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];nfe(r,t),e._visible=r._visible;return}if(_Xe(e,t)){e._visible=!1;return}let i=e.refine===jo.REPLACE,o=e._optimChildrenWithinParent===jf.USE_OPTIMIZATION;if(i&&o&&n&&!gXe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function _Xe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==jo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function gXe(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function yXe(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Zs=L_;function ife(){}var IL={stack:new Jc,stackMaximumLength:0};ife.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=Zs,s=IL.stack;for(s.push(i);s.length>0;){IL.stackMaximumLength=Math.max(IL.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===jo.ADD,u=a.refine===jo.REPLACE,f=xXe(a);f&&bXe(a,s,t),(c||u&&!f)&&(TXe(e,a),o(a,t),CXe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return IL.stack.trim(IL.stackMaximumLength),n};function xXe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function bXe(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function TXe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function CXe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Wt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var PL=ife;function ofe(){}var RL={stack:new Jc,stackMaximumLength:0},OL={stack:new Jc,stackMaximumLength:0};ofe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Zs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;EXe(n,t),RL.stack.trim(RL.stackMaximumLength),OL.stack.trim(OL.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Jj(e,t){e.contentAvailable&&Zs.selectTile(e,t)}function AXe(e,t,n){let i=e.refine===jo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Zs;for(let m=0;m<r.length;++m)s(r[m],n);r.sort(Zs.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let x=r[m];if(x.isVisible?(t.push(x),x._foveatedFactor<g&&(p=m,g=x._foveatedFactor),d=!0):(u||o.loadSiblings)&&(x._foveatedFactor<g&&(p=m,g=x._foveatedFactor),a(x,n),c(x,n)),u){let b;x._inRequestVolume?x.hasRenderableContent?b=x.contentAvailable:b=SXe(x,n):b=!1,f=f&&b}}if(d||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let x=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;x._foveatedFactor=Math.min(m._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(m._distanceToCamera,x._distanceToCamera);for(let b=0;b<r.length;++b)r[b]._priorityHolder=x}return f}function EXe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Zs,a=RL.stack;for(a.push(e);a.length>0;){RL.stackMaximumLength=Math.max(RL.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?AXe(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===jo.ADD?(Jj(c,t),o(c,t)):c.refine===jo.REPLACE&&(o(c,t),d&&Jj(c,t)):(n._emptyTiles.push(c),o(c,t),d&&Jj(c,t)),r(c,t),s(c,t)}}function SXe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Zs,s=!0,a=OL.stack;for(a.push(e);a.length>0;){OL.stackMaximumLength=Math.max(OL.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c);if(!d&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),d)for(let p=0;p<f;++p){let g=u[p];a.push(g)}}return e.hasEmptyContent||s}var ML=ofe;function rfe(){}var LL={stack:new Jc,stackMaximumLength:0},NL={stack:new Jc,stackMaximumLength:0},N_={stack:new Jc,stackMaximumLength:0,ancestorStack:new Jc,ancestorStackMaximumLength:0},vXe=2;rfe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Zs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;OXe(n,t),MXe(n,t),LL.stack.trim(LL.stackMaximumLength),NL.stack.trim(NL.stackMaximumLength),N_.stack.trim(N_.stackMaximumLength),N_.ancestorStack.trim(N_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function wXe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Zs,r=NL.stack;for(r.push(e);r.length>0;){NL.stackMaximumLength=Math.max(NL.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<vXe&&r.push(u))}}}function Nz(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:wXe(e,t)}function DXe(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function IXe(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function PXe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Zs;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(Zs.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function RXe(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function OXe(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Zs,c=LL.stack;for(c.push(e);c.length>0;){LL.stackMaximumLength=Math.max(LL.stackMaximumLength,c.length);let u=c.pop();DXe(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=o(u)?PXe(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===jo.ADD?(Nz(u,t),r(u,t)):u.refine===jo.REPLACE&&(RXe(u,i)?(r(u,t),p&&Nz(u,t)):p?(Nz(u,t),r(u,t)):IXe(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&Nz(u,t)),s(u,t),a(u,t)}}function MXe(e,t){let{selectTile:n,canTraverse:i}=Zs,{stack:o,ancestorStack:r}=N_,s;for(o.push(e);o.length>0||r.length>0;){if(N_.stackMaximumLength=Math.max(N_.stackMaximumLength,o.length),N_.ancestorStackMaximumLength=Math.max(N_.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===jo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&o.push(d)}}}}var FL=rfe;function rr(e){e=y(e,y.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new EL,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Jc,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=y(e.cacheBytes,512*1024*1024);let t=y(e.maximumCacheOverflowBytes,512*1024*1024);this._maximumCacheOverflowBytes=t,this._styleEngine=new wL,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._addHeightCallbacks=[],this._statistics=new M_,this._statisticsLast=new M_,this._statisticsPerPass=new Array(Uo.NUMBER_OF_PASSES);for(let o=0;o<Uo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new M_;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new SL(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=P.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!0),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,P.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=y(e.dynamicScreenSpaceErrorDensity,2e-4),this.dynamicScreenSpaceErrorFactor=y(e.dynamicScreenSpaceErrorFactor,24),this.dynamicScreenSpaceErrorHeightFalloff=y(e.dynamicScreenSpaceErrorHeightFalloff,.25),this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,yn.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=Nl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Cm(e.pointCloudShading),this._pointCloudEyeDomeLighting=new u_,this.loadProgress=new pe,this.allTilesLoaded=new pe,this.initialTilesLoaded=new pe,this.tileLoad=new pe,this.tileUnload=new pe,this.tileFailed=new pe,this.tileVisible=new pe,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,l(e.clippingPlanes)&&gs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&Jd.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Xx,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new s_(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,H.BLACK),this.splitDirection=y(e.splitDirection,Br.NONE),this.enableCollision=y(e.enableCollision,!1),this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&>("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(rr.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Jd.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return ms("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,hfe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});rr.fromIonAssetId=async function(e,t){let n=await Cu.fromAssetId(e);return rr.fromUrl(n,t)};rr.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await rr.loadJson(n),r=await LXe(n,o),s=new rr(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,hfe(s);let c=l(o.asset.gltfUpAxis)?No.fromName(o.asset.gltfUpAxis):No.Y,u=y(t.modelUpAxis,c),f=y(t.modelForwardAxis,No.X);s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,F.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>li._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Ot.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s};rr.loadJson=function(e){return Se.createIfNeeded(e).fetchJson()};rr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};rr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new re("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new re("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&rr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=sfe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===jo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=sfe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&TL.checkChildrenWithinParent(c)}return s};function sfe(e,t,n,i){if(!(l(n.implicitTiling)||oi(n,"3DTILES_implicit_tiling")))return new $f(e,t,n,i);let r=e.schema,s=new Wb(t,n,r),a=new jb({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Ge(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new $f(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function LXe(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Si.getSchemaLoader({resource:e});else if(l(n.schema))i=Si.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new Hb({schema:i.schema,metadataJson:n});return Si.unload(i),o}var afe=new h,NXe=new fe,FXe=new F,BXe=new h,kXe=new h,VXe=new h,UXe=new h;function zXe(e,t){let n,i,o,r,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Kf)n=h.normalize(a.positionWC,afe),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let x=F.inverseTransformation(c.computedTransform,FXe),b=t.mapProjection.ellipsoid,T=u.boundingVolume,C=F.multiplyByPoint(x,T.center,BXe);if(h.magnitude(C)>b.minimumRadius){let A=fe.fromCartesian(C,b,NXe);n=h.normalize(a.positionWC,afe),i=a.directionWC,o=a.positionCartographic.height,r=0,s=A.height*2}else{let A=F.multiplyByPoint(x,a.positionWC,kXe);if(n=h.UNIT_Z,i=F.multiplyByPointAsVector(x,a.directionWC,VXe),i=h.normalize(i,i),o=A.z,u instanceof Lu){let E=$.getColumn(T.halfAxes,2,UXe),v=h.magnitude(E);r=C.z-v,s=C.z+v}else if(u instanceof P_){let E=T.radius;r=C.z-E,s=C.z+E}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=r+(s-r)*f,p=s,g=P.clamp((o-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function HXe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{ufe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?nKe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function lfe(e,t){return e._priority-t._priority}rr.prototype.postPassesUpdate=function(e){l(this._root)&&(GXe(this,e),oKe(this,e),this._cache.unloadTiles(this,dfe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};rr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;ZXe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=Z.clone(e.time)),this._timeSinceLoad=Math.max(Z.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&zXe(this,e),e.newFrame&&this._cache.reset()};function GXe(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==Yo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function WXe(e){let t=e._requestedTiles;t.sort(lfe);for(let n=0;n<t.length;++n)HXe(e,t[n])}function ufe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function jXe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Yo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var qXe=new fe,YXe=new fe,XXe=new h;function KXe(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=fe.clone(r.positionCartographic,qXe),c=fe.fromCartesian(o.center,s,YXe);l(c)&&(a.height=c.height);let u=fe.toCartesian(a,s,XXe);h.distance(u,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function ZXe(e,t){jXe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,ufe(f,e,u)}}e.totalMemoryUsageInBytes<i?QXe(e):a&&n.length>0&&$Xe(e)}function $Xe(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(lfe)}function QXe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var Fz=new h,JXe={maximumFractionDigits:3};function cfe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,JXe):Math.round(t).toLocaleString()}function e7(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,Fz);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=h.normalize(i,Fz);r=h.multiplyByScalar(r,.75*n,Fz),o=h.add(r,i,Fz)}return o}function t7(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=` +Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=` +Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=` +Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=` +Triangles: ${e.content.trianglesLength}`,o++),i+=` +Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=` +Texture Memory: ${cfe(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${cfe(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` +- ${s[a]}`;o+=s.length}else i+=` +Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function eKe(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:e7(e.debugPickedTile),a=t7(e.debugPickedTile,e,s);a.pixelOffset=new z(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];t7(a,e,e7(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&t7(a,e,e7(a))}}e._tileDebugLabels.update(t)}function tKe(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ei({stencil:0,pass:we.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:Vt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<s.length;++m){let x=s[m];f&&u.raiseEvent(x),KXe(e,x,t),x.update(e,t,n),c.incrementSelectionCounts(x.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,x=m.length;i.length+=x;for(let b=g-1;b>=0;--b)i[d+x+b]=i[d+b];for(let b=0;b<x;++b)i[d+b]=m[b]}g=i.length-r,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new vm),eKe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var ffe=[];function nKe(e,t){let n=t,i=ffe;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(iKe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function dfe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function iKe(e,t){e._cache.unloadTile(e,t,dfe),t.destroy()}rr.prototype.trimLoadedTiles=function(){this._cache.trim()};function oKe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;M_.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function rKe(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function sKe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function aKe(e,t,n,i){if(t.mode===ne.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,rKe(e),sKe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&WXe(e),tKe(e,t,i),M_.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function hfe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(bt.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new bt(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}rr.prototype.getTraversal=function(e){let{pass:t}=e;return t===Uo.MOST_DETAILED_PRELOAD||t===Uo.MOST_DETAILED_PICK?PL:this.isSkippingLevelOfDetail?FL:ML};rr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};rr.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Uo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Uo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Uo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Uo.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),u=c.length;if(e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r),s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let d=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=aKe(this,e,d,s)),a&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};rr.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};rr.prototype.isDestroyed=function(){return!1};rr.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=ffe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,ue(this)};rr.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};rr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!rr.supportedExtensions[e[t]])throw new re(`Unsupported 3D Tiles Extension: ${e[t]}`)};var cKe=new hn,lKe=new h,uKe=new fe;rr.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=cKe,o=n.cartographicToCartesian(e,i.direction);h.normalize(i.direction,i.direction),i.direction=h.normalize(o,i.direction),i.direction=h.negate(o,i.direction),i.origin=h.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,lKe);if(l(r))return n.cartesianToCartographic(r,uKe)?.height};rr.prototype.updateHeight=function(e,t,n){n=y(n,ee.WGS84);let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var fKe=new Pa,dKe=new h;rr.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let u=i[c],f=$n.raySphere(e,u.contentBoundingVolume.boundingSphere,fKe);!l(f)||!l(u.content)||r.push(u)}let s=r.length;r.sort((c,u)=>{let f=ae.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),d=ae.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-d});let a;for(let c=0;c<s;++c){let f=r[c].content.pick(e,t,dKe);if(l(f))return a=h.clone(f,n),a}};var xs=rr;var hKe=new F;function Wy(e,t){t.collectionChanged.addEventListener(Wy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}Wy.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;f&&(d=s.computeModelMatrix(e,hKe),c=Se.createIfNeeded(Y.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],mKe(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=Y.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};Wy.prototype.isDestroyed=function(){return!1};Wy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Wy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)n7(this,e[i],t,n);return ue(this)};Wy.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return at.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ae.clone(i.boundingSphere,t),at.DONE):at.FAILED:at.PENDING};Wy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(n7(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],n7(this,r,a,c),s.remove(r.id)};function n7(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function mKe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await xs.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var BL=Wy;var pKe=H.WHITE,_Ke=H.BLACK,gKe=new z(2,2);function EE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(EE.prototype,{isConstant:{get:function(){return Y.isConstant(this._evenColor)&&Y.isConstant(this._oddColor)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});EE.prototype.getType=function(e){return"Checkerboard"};var yKe=new Z;EE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(yKe)),l(t)||(t={}),t.lightColor=Y.getValueOrClonedDefault(this._evenColor,e,pKe,t.lightColor),t.darkColor=Y.getValueOrClonedDefault(this._oddColor,e,_Ke,t.darkColor),t.repeat=Y.getValueOrDefault(this._repeat,e,gKe),t};EE.prototype.equals=function(e){return this===e||e instanceof EE&&Y.equals(this._evenColor,e._evenColor)&&Y.equals(this._oddColor,e._oddColor)&&Y.equals(this._repeat,e._repeat)};var SE=EE;var mfe={id:void 0};function kL(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function xc(e){this._owner=e,this._entities=new Et,this._addedEntities=new Et,this._removedEntities=new Et,this._changedEntities=new Et,this._suspendCount=0,this._collectionChanged=new pe,this._id=zn(),this._show=!0,this._firing=!1,this._refire=!1}xc.prototype.suspendEvents=function(){this._suspendCount++};xc.prototype.resumeEvents=function(){this._suspendCount--,kL(this)};Object.defineProperties(xc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});xc.prototype.computeAvailability=function(){let e=He.MAXIMUM_VALUE,t=He.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;Z.lessThan(a,e)&&!a.equals(He.MINIMUM_VALUE)&&(e=a),Z.greaterThan(c,t)&&!c.equals(He.MAXIMUM_VALUE)&&(t=c)}}return He.MAXIMUM_VALUE.equals(e)&&(e=He.MINIMUM_VALUE),He.MINIMUM_VALUE.equals(t)&&(t=He.MAXIMUM_VALUE),new An({start:e,stop:t})};xc.prototype.add=function(e){e instanceof nr||(e=new nr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new he(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(xc.prototype._onEntityDefinitionChanged,this),kL(this),e};xc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};xc.prototype.contains=function(e){return this._entities.get(e.id)===e};xc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(xc.prototype._onEntityDefinitionChanged,this),kL(this),!0):!1};xc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(xc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),kL(this)};xc.prototype.getById=function(e){return this._entities.get(e)};xc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(mfe.id=e,t=new nr(mfe),this.add(t)),t};xc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),kL(this)};var $s=xc;var Bz={id:void 0},vE=new Array(2);function i7(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function pfe(e,t,n,i){vE[0]=n,vE[1]=i.id,t[JSON.stringify(vE)]=i.definitionChanged.addEventListener(Gr.prototype._onDefinitionChanged,e)}function _fe(e,t,n,i){vE[0]=n,vE[1]=i.id;let o=JSON.stringify(vE);t[o](),t[o]=void 0}function jy(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,u,f=e._composite,d=new $s(e),p=e._eventHash,g;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(Gr.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],_fe(e,p,g,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(Gr.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],pfe(e,p,g,s);let x=d.getById(s.id);l(x)||(x=f.getById(s.id),l(x)?i7(x):(Bz.id=s.id,x=new nr(Bz)),d.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function Gr(e,t){this._owner=t,this._composite=new $s(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=zn(),this._eventHash={},jy(this),this._shouldRecomposite=!1}Object.defineProperties(Gr.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Gr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),jy(this)};Gr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),jy(this),!0):!1};Gr.prototype.removeAllCollections=function(){this._collections.length=0,jy(this)};Gr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Gr.prototype.contains=function(e){return this._composite.contains(e)};Gr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Gr.prototype.getCollection=function(e){return this._collections[e]};Gr.prototype.getCollectionsLength=function(){return this._collections.length};function kz(e,t){return e.indexOf(t)}function gfe(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,jy(e)}Gr.prototype.raiseCollection=function(e){let t=kz(this._collections,e);gfe(this,t,t+1)};Gr.prototype.lowerCollection=function(e){let t=kz(this._collections,e);gfe(this,t,t-1)};Gr.prototype.raiseCollectionToTop=function(e){let t=kz(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),jy(this))};Gr.prototype.lowerCollectionToBottom=function(e){let t=kz(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),jy(this))};Gr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Gr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(jy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Gr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Gr.prototype.getById=function(e){return this._composite.getById(e)};Gr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];_fe(this,d,p,m);let x=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),i7(u)),u.merge(c));l(u)||r.removeById(x),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];pfe(this,d,p,m);let x=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),l(u)?i7(u):(Bz.id=x,u=new nr(Bz),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};Gr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var o7=Gr;function r7(){this._removalFunctions=[]}r7.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};r7.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var hr=r7;function c7(e,t){return Z.compare(e.start,t.start)}function Wr(e){if(this._intervals=[],this._changedEvent=new pe,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Wr.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Wr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Wr))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!An.equals(n[r],i[r],t))return!1;return!0};Wr.prototype.get=function(e){return this._intervals[e]};Wr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Wr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Wr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Wr.prototype.contains=function(e){return this.indexOf(e)>=0};var s7=new An;Wr.prototype.indexOf=function(e){let t=this._intervals;s7.start=e,s7.stop=e;let n=Mo(t,s7,c7);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&An.contains(t[n-1],e)?n-1:~n)};Wr.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};Wr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||Z.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Mo(n,e,c7);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=Z.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(Z.greaterThan(e.stop,n[i-1].stop)?e=new An({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new An({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=Z.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new An({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new An({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=Z.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new An({start:e.start,stop:Z.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:Z.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new An({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Wr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Mo(t,e,c7);n<0&&(n=~n);let i=!1;for(n>0&&(Z.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(Z.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new An({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new An({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new An({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&Z.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new An({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new An({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(Z.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new An({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Wr.prototype.intersect=function(e,t,n){let i=new Wr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],u=a[r];if(Z.lessThan(c.stop,u.start))++o;else if(Z.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=An.intersect(c,u,new An,n);f.isEmpty||i.addInterval(f,t)}Z.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};Wr.fromJulianDateArray=function(e,t){l(t)||(t=new Wr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),u,f=0;a&&(++f,u=new An({start:He.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new An({start:p,stop:g,isStartIncluded:t.length===f?r:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),p=g}return c&&(u=new An({start:n[i-1],stop:He.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var bc=new Tp,VL=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a7(e,t,n){l(n)||(n=new Z),Z.toGregorianDate(e,bc);let i=bc.millisecond+t.millisecond,o=bc.second+t.second,r=bc.minute+t.minute,s=bc.hour+t.hour,a=bc.day+t.day,c=bc.month+t.month,u=bc.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),VL[2]=wd(u)?29:28;a>VL[c]||c>=13;)a>VL[c]&&(a-=VL[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),VL[2]=wd(u)?29:28;return bc.millisecond=i,bc.second=o,bc.minute=r,bc.hour=s,bc.day=a,bc.month=c,bc.year=u,Z.fromGregorianDate(bc,n)}var xKe=new Z,bKe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function yfe(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(bKe);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),Z.toGregorianDate(Z.fromIso8601(e,xKe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var UL=new Tp;Wr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=Z.fromIso8601(n[0]),o=Z.fromIso8601(n[1]),r=[];if(!yfe(n[2],UL))r.push(i,o);else{let s=Z.clone(i);for(r.push(s);Z.compare(s,o)<0;)s=a7(s,UL),Z.compare(o,s)<=0&&Z.clone(o,s),r.push(s)}return Wr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Wr.fromIso8601DateArray=function(e,t){return Wr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return Z.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Wr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let u=0;u<c;++u)(yfe(i[u],UL)||u===0)&&(o&&l(a)?s=a7(a,UL):s=a7(n,UL),r.push(s),a=s);return Wr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var jr=Wr;function TKe(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function qb(){this._eventHelper=new hr,this._definitionChanged=new pe,this._intervals=new jr,this._intervals.changedEvent.addEventListener(qb.prototype._intervalsChanged,this)}Object.defineProperties(qb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var CKe=new Z;qb.prototype.getValue=function(e,t){l(e)||(e=Z.now(CKe));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};qb.prototype.equals=function(e){return this===e||e instanceof qb&&this._intervals.equals(e._intervals,Y.equals)};qb.prototype._intervalsChanged=function(){TKe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Tc=qb;function qy(){this._definitionChanged=new pe,this._composite=new Tc,this._composite.definitionChanged.addEventListener(qy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(qy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});qy.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var AKe=new Z;qy.prototype.getValue=function(e,t){l(e)||(e=Z.now(AKe));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};qy.prototype.equals=function(e){return this===e||e instanceof qy&&this._composite.equals(e._composite,Y.equals)};qy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var wE=qy;function Yy(e){this._referenceFrame=y(e,zi.FIXED),this._definitionChanged=new pe,this._composite=new Tc,this._composite.definitionChanged.addEventListener(Yy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Yy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var EKe=new Z;Yy.prototype.getValue=function(e,t){return l(e)||(e=Z.now(EKe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};Yy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Yy.prototype.equals=function(e){return this===e||e instanceof Yy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,Y.equals)};Yy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var _a=Yy;var SKe={ROUNDED:0,MITERED:1,BEVELED:2},Ni=Object.freeze(SKe);var ga=[new h,new h],vKe=new h,wKe=new h,DKe=new h,IKe=new h,PKe=new h,RKe=new h,OKe=new h,MKe=new h,LKe=new h,DE=new h,Vz=new h,zL={},l7=new fe;function NKe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];l7=t.cartesianToCartographic(o,l7),n[i]=l7.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function u7(e,t,n,i){let o=e[0],r=e[1],s=h.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var Uz=new h,zz=new h;function FKe(e,t,n,i){let o=new Jr(n,i),r=o.projectPointOntoPlane(h.add(n,e,Uz),Uz),s=o.projectPointOntoPlane(h.add(n,t,zz),zz),a=z.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var BKe=new h(-1,0,0),Yb=new F,kKe=new F,f7=new $,VKe=$.IDENTITY.clone(),UKe=new h,zKe=new oe,xfe=new h;function F_(e,t,n,i,o,r,s,a){let c=UKe,u=zKe;Yb=Ot.eastNorthUpToFixedFrame(e,o,Yb),c=F.multiplyByPointAsVector(Yb,BKe,c),c=h.normalize(c,c);let f=FKe(c,t,e,o);f7=$.fromRotationZ(f,f7),xfe.z=r,Yb=F.multiplyTransformation(Yb,F.fromRotationTranslation(f7,xfe,kKe),Yb);let d=VKe;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=F.multiplyByPoint(Yb,u,u),i.push(u.x,u.y,u.z);return i}var HKe=new h;function d7(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,HKe);i=F_(c,t,n,i,o,r[a/3],s,1)}return i}function GKe(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function bfe(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var Tfe=new Oe,Cfe=new h,Afe=new $;function Efe(e,t,n,i,o,r,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,DE),h.subtract(n,e,Vz)),d=i===Ni.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;o?p=$.fromQuaternion(Oe.fromAxisAngle(h.negate(e,DE),f/(d+1),Tfe),Afe):p=$.fromQuaternion(Oe.fromAxisAngle(e,f/(d+1),Tfe),Afe);let g,m;if(t=h.clone(t,Cfe),d>0){let x=u?2:1;for(let b=0;b<d;b++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,DE),g=h.normalize(g,g),o||(g=h.negate(g,g)),m=r.scaleToGeodeticSurface(t,Vz),s=F_(m,g,a,s,r,c,1,x)}else g=h.subtract(t,e,DE),g=h.normalize(g,g),o||(g=h.negate(g,g)),m=r.scaleToGeodeticSurface(t,Vz),s=F_(m,g,a,s,r,c,1,1),n=h.clone(n,Cfe),g=h.subtract(n,e,DE),g=h.normalize(g,g),o||(g=h.negate(g,g)),m=r.scaleToGeodeticSurface(n,Vz),s=F_(m,g,a,s,r,c,1,1);return s}zL.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];z.equals(r,s)||n.push(s)}return n};zL.angleIsGreaterThanPi=function(e,t,n,i){let o=new Jr(n,i),r=o.projectPointOntoPlane(h.add(n,e,Uz),Uz),s=o.projectPointOntoPlane(h.add(n,t,zz),zz);return s.x*r.y-s.y*r.x>=0};var WKe=new h,jKe=new h;zL.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=NKe(e,r),a=i._granularity,c=i._cornerType,u=o?GKe(t,n):bfe(t,n),f=o?bfe(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],x=o?[]:void 0,b=vKe,T=wKe,C=DKe,A=IKe,E=PKe,v=RKe,D=OKe,O=MKe,R=LKe,M=e[0],N=e[1];A=r.geodeticSurfaceNormal(M,A),b=h.subtract(N,M,b),b=h.normalize(b,b),O=h.cross(A,b,O),O=h.normalize(O,O);let _=s[0],S=s[1];o&&(x=F_(M,O,f,x,r,_+d,1,1)),R=h.clone(M,R),M=N,T=h.negate(b,T);let w,I;for(let U=1;U<g-1;U++){let V=o?2:1;if(N=e[U+1],M.equals(N)){gt("Positions are too close and are considered equivalent with rounding error.");continue}b=h.subtract(N,M,b),b=h.normalize(b,b),A=r.geodeticSurfaceNormal(M,A);let G=h.multiplyByScalar(A,h.dot(b,A),WKe);h.subtract(b,G,G),h.normalize(G,G);let k=h.multiplyByScalar(A,h.dot(T,A),jKe);if(h.subtract(T,k,k),h.normalize(k,k),!P.equalsEpsilon(Math.abs(h.dot(G,k)),1,P.EPSILON7)){C=h.add(b,T,C),C=h.normalize(C,C),C=h.cross(C,A,C),C=h.cross(A,C,C),C=h.normalize(C,C);let q=1/Math.max(.25,h.magnitude(h.cross(C,T,DE))),J=zL.angleIsGreaterThanPi(b,T,M,r);J?(E=h.add(M,h.multiplyByScalar(C,q*p,C),E),v=h.add(E,h.multiplyByScalar(O,p,v),v),ga[0]=h.clone(R,ga[0]),ga[1]=h.clone(v,ga[1]),w=u7(ga,_+d,S+d,a),I=Li.generateArc({positions:ga,granularity:a,ellipsoid:r}),m=d7(I,O,u,m,r,w,1),O=h.cross(A,b,O),O=h.normalize(O,O),D=h.add(E,h.multiplyByScalar(O,p,D),D),c===Ni.ROUNDED||c===Ni.BEVELED?Efe(E,v,D,c,J,r,m,u,S+d,o):(C=h.negate(C,C),m=F_(M,C,u,m,r,S+d,q,V)),R=h.clone(D,R)):(E=h.add(M,h.multiplyByScalar(C,q*p,C),E),v=h.add(E,h.multiplyByScalar(O,-p,v),v),ga[0]=h.clone(R,ga[0]),ga[1]=h.clone(v,ga[1]),w=u7(ga,_+d,S+d,a),I=Li.generateArc({positions:ga,granularity:a,ellipsoid:r}),m=d7(I,O,u,m,r,w,1),O=h.cross(A,b,O),O=h.normalize(O,O),D=h.add(E,h.multiplyByScalar(O,-p,D),D),c===Ni.ROUNDED||c===Ni.BEVELED?Efe(E,v,D,c,J,r,m,u,S+d,o):m=F_(M,C,u,m,r,S+d,q,V),R=h.clone(D,R)),T=h.negate(b,T)}else m=F_(R,O,u,m,r,_+d,1,1),R=M;_=S,S=s[U+1],M=N}ga[0]=h.clone(R,ga[0]),ga[1]=h.clone(M,ga[1]),w=u7(ga,_+d,S+d,a),I=Li.generateArc({positions:ga,granularity:a,ellipsoid:r}),m=d7(I,O,u,m,r,w,1),o&&(x=F_(M,O,f,x,r,S+d,1,1)),g=m.length;let L=o?g+x.length:g,B=new Float64Array(L);return B.set(m),o&&B.set(x,g),B};var mh=zL;var m7={},IE=new h,Ife=new h,qKe=new h,Sfe=new h,sl=[new h,new h],Pfe=new h,Rfe=new h,Ofe=new h,YKe=new h,XKe=new h,KKe=new h,ZKe=new h,$Ke=new h,QKe=new h,JKe=new h,vfe=new Oe,wfe=new $;function Hz(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,IE),h.subtract(n,e,Ife)),s=i===Ni.BEVELED?1:Math.ceil(r/P.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;o?u=$.fromQuaternion(Oe.fromAxisAngle(h.negate(e,IE),r/s,vfe),wfe):u=$.fromQuaternion(Oe.fromAxisAngle(e,r/s,vfe),wfe);let f=0;t=h.clone(t,IE);for(let d=0;d<s;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function eZe(e){let t=Pfe,n=Rfe,i=Ofe,o=e[1];n=h.fromArray(e[1],o.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let r=Hz(t,n,i,Ni.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(o,0,i),t=h.midpoint(n,i,t);let c=Hz(t,n,i,Ni.ROUNDED,!1);return[r,c]}function Dfe(e,t,n,i){let o=IE;return i?o=h.add(e,t,o):(t=h.negate(t,t),o=h.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function h7(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,IE),a=h.negate(s,Ife),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,qKe),p=h.add(d,a,Sfe);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let g=h.add(d,s,Sfe);r[u--]=g.z,r[u--]=g.y,r[u--]=g.x}return i.push(o,r),i}m7.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var tZe=new h,nZe=new h;m7.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Pfe,c=Rfe,u=Ofe,f=YKe,d=XKe,p=KKe,g=ZKe,m=$Ke,x=QKe,b=JKe,T=[],C=s?[]:void 0,A=s?[]:void 0,E=n[0],v=n[1];c=h.normalize(h.subtract(v,E,c),c),a=i.geodeticSurfaceNormal(E,a),f=h.normalize(h.cross(a,c,f),f),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),g=h.clone(E,g),E=v,u=h.negate(c,u);let D,O=[],R,M=n.length;for(R=1;R<M-1;R++){a=i.geodeticSurfaceNormal(E,a),v=n[R+1],c=h.normalize(h.subtract(v,E,c),c);let _=h.multiplyByScalar(a,h.dot(c,a),tZe);h.subtract(c,_,_),h.normalize(_,_);let S=h.multiplyByScalar(a,h.dot(u,a),nZe);if(h.subtract(u,S,S),h.normalize(S,S),!P.equalsEpsilon(Math.abs(h.dot(_,S)),1,P.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let I=o/Math.max(.25,h.magnitude(h.cross(d,u,IE))),L=mh.angleIsGreaterThanPi(c,u,E,i);d=h.multiplyByScalar(d,I,d),L?(m=h.add(E,d,m),b=h.add(m,h.multiplyByScalar(f,o,b),b),x=h.add(m,h.multiplyByScalar(f,o*2,x),x),sl[0]=h.clone(g,sl[0]),sl[1]=h.clone(b,sl[1]),D=Li.generateArc({positions:sl,granularity:t,ellipsoid:i}),T=h7(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),p=h.clone(x,p),f=h.normalize(h.cross(a,c,f),f),x=h.add(m,h.multiplyByScalar(f,o*2,x),x),g=h.add(m,h.multiplyByScalar(f,o,g),g),r===Ni.ROUNDED||r===Ni.BEVELED?O.push({leftPositions:Hz(m,p,x,r,L)}):O.push({leftPositions:Dfe(E,h.negate(d,d),x,L)})):(x=h.add(E,d,x),b=h.add(x,h.negate(h.multiplyByScalar(f,o,b),b),b),m=h.add(x,h.negate(h.multiplyByScalar(f,o*2,m),m),m),sl[0]=h.clone(g,sl[0]),sl[1]=h.clone(b,sl[1]),D=Li.generateArc({positions:sl,granularity:t,ellipsoid:i}),T=h7(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(x,h.negate(h.multiplyByScalar(f,o*2,m),m),m),g=h.add(x,h.negate(h.multiplyByScalar(f,o,g),g),g),r===Ni.ROUNDED||r===Ni.BEVELED?O.push({rightPositions:Hz(x,p,m,r,L)}):O.push({rightPositions:Dfe(E,d,m,L)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),sl[0]=h.clone(g,sl[0]),sl[1]=h.clone(E,sl[1]),D=Li.generateArc({positions:sl,granularity:t,ellipsoid:i}),T=h7(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z));let N;return r===Ni.ROUNDED&&(N=eZe(T)),{positions:T,corners:O,lefts:C,normals:A,endPositions:N}};var Wi=m7;var Nfe=new h,Ffe=new h,Gz=new h,Wz=new h,iZe=new h,Bfe=new h,Xy=new h,PE=new h;function kfe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function ph(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,Xy),Xy);r.normal&&Wi.addAttribute(s,t,i,o),r.tangent&&Wi.addAttribute(a,u,i,o),r.bitangent&&Wi.addAttribute(c,n,i,o)}function Vfe(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new un,u,f=0,d=0,p,g=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,g+=m*2,d+=i[p+1].length-3;for(f+=3,d+=3,p=0;p<o.length;p++){u=o[p];let Q=o[p].leftPositions;l(Q)?(m=Q.length,f+=m,g+=m):(m=o[p].rightPositions.length,d+=m,g+=m)}let x=l(r),b;x&&(b=r[0].length-3,f+=b,d+=b,b/=3,g+=b*6);let T=f+d,C=new Float64Array(T),A=t.normal?new Float32Array(T):void 0,E=t.tangent?new Float32Array(T):void 0,v=t.bitangent?new Float32Array(T):void 0,D={normals:A,tangents:E,bitangents:v},O=0,R=T-1,M,N,_,S,w=Nfe,I=Ffe,L,B,U=b/2,V=Ne.createTypedArray(T/3,g),G=0;if(x){B=Gz,L=Wz;let Q=r[0];for(w=h.fromArray(a,0,w),I=h.fromArray(s,0,I),p=0;p<U;p++)B=h.fromArray(Q,(U-1-p)*3,B),L=h.fromArray(Q,(U+p)*3,L),Wi.addAttribute(C,L,O),Wi.addAttribute(C,B,void 0,R),ph(D,w,I,O,R,t),N=O/3,S=N+1,M=(R-2)/3,_=M-1,V[G++]=M,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=S,O+=3,R-=3}let k=0,W=0,q=i[k++],J=i[k++];C.set(q,O),C.set(J,R-J.length+1),I=h.fromArray(s,W,I);let j,K;for(m=J.length-3,p=0;p<m;p+=3)j=n.geodeticSurfaceNormal(h.fromArray(q,p,Xy),Xy),K=n.geodeticSurfaceNormal(h.fromArray(J,m-p,PE),PE),w=h.normalize(h.add(j,K,w),w),ph(D,w,I,O,R,t),N=O/3,S=N+1,M=(R-2)/3,_=M-1,V[G++]=M,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=S,O+=3,R-=3;for(j=n.geodeticSurfaceNormal(h.fromArray(q,m,Xy),Xy),K=n.geodeticSurfaceNormal(h.fromArray(J,m,PE),PE),w=h.normalize(h.add(j,K,w),w),W+=3,p=0;p<o.length;p++){let Q;u=o[p];let de=u.leftPositions,xe=u.rightPositions,ce,ge,be=Bfe,De=Gz,Ae=Wz;if(w=h.fromArray(a,W,w),l(de)){for(ph(D,w,I,void 0,R,t),R-=3,ce=S,ge=_,Q=0;Q<de.length/3;Q++)be=h.fromArray(de,Q*3,be),V[G++]=ce,V[G++]=ge-Q-1,V[G++]=ge-Q,Wi.addAttribute(C,be,void 0,R),De=h.fromArray(C,(ge-Q-1)*3,De),Ae=h.fromArray(C,ce*3,Ae),I=h.normalize(h.subtract(De,Ae,I),I),ph(D,w,I,void 0,R,t),R-=3;be=h.fromArray(C,ce*3,be),De=h.subtract(h.fromArray(C,ge*3,De),be,De),Ae=h.subtract(h.fromArray(C,(ge-Q)*3,Ae),be,Ae),I=h.normalize(h.add(De,Ae,I),I),ph(D,w,I,O,void 0,t),O+=3}else{for(ph(D,w,I,O,void 0,t),O+=3,ce=_,ge=S,Q=0;Q<xe.length/3;Q++)be=h.fromArray(xe,Q*3,be),V[G++]=ce,V[G++]=ge+Q,V[G++]=ge+Q+1,Wi.addAttribute(C,be,O),De=h.fromArray(C,ce*3,De),Ae=h.fromArray(C,(ge+Q)*3,Ae),I=h.normalize(h.subtract(De,Ae,I),I),ph(D,w,I,O,void 0,t),O+=3;be=h.fromArray(C,ce*3,be),De=h.subtract(h.fromArray(C,(ge+Q)*3,De),be,De),Ae=h.subtract(h.fromArray(C,ge*3,Ae),be,Ae),I=h.normalize(h.negate(h.add(Ae,De,I),I),I),ph(D,w,I,void 0,R,t),R-=3}for(q=i[k++],J=i[k++],q.splice(0,3),J.splice(J.length-3,3),C.set(q,O),C.set(J,R-J.length+1),m=J.length-3,W+=3,I=h.fromArray(s,W,I),Q=0;Q<J.length;Q+=3)j=n.geodeticSurfaceNormal(h.fromArray(q,Q,Xy),Xy),K=n.geodeticSurfaceNormal(h.fromArray(J,m-Q,PE),PE),w=h.normalize(h.add(j,K,w),w),ph(D,w,I,O,R,t),S=O/3,N=S-1,_=(R-2)/3,M=_+1,V[G++]=M,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=S,O+=3,R-=3;O-=3,R+=3}if(w=h.fromArray(a,a.length-3,w),ph(D,w,I,O,R,t),x){O+=3,R-=3,B=Gz,L=Wz;let Q=r[1];for(p=0;p<U;p++)B=h.fromArray(Q,(b-p-1)*3,B),L=h.fromArray(Q,p*3,L),Wi.addAttribute(C,B,void 0,R),Wi.addAttribute(C,L,O),ph(D,w,I,O,R,t),S=O/3,N=S-1,_=(R-2)/3,M=_+1,V[G++]=M,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=S,O+=3,R-=3}if(c.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C}),t.st){let Q=new Float32Array(T/3*2),de,xe,ce=0;if(x){f/=3,d/=3;let ge=Math.PI/(b+1);xe=1/(f-b+1),de=1/(d-b+1);let be,De=b/2;for(p=De+1;p<b+1;p++)be=P.PI_OVER_TWO+ge*p,Q[ce++]=de*(1+Math.cos(be)),Q[ce++]=.5*(1+Math.sin(be));for(p=1;p<d-b+1;p++)Q[ce++]=p*de,Q[ce++]=0;for(p=b;p>De;p--)be=P.PI_OVER_TWO-p*ge,Q[ce++]=1-de*(1+Math.cos(be)),Q[ce++]=.5*(1+Math.sin(be));for(p=De;p>0;p--)be=P.PI_OVER_TWO-ge*p,Q[ce++]=1-xe*(1+Math.cos(be)),Q[ce++]=.5*(1+Math.sin(be));for(p=f-b;p>0;p--)Q[ce++]=p*xe,Q[ce++]=1;for(p=1;p<De+1;p++)be=P.PI_OVER_TWO+ge*p,Q[ce++]=xe*(1+Math.cos(be)),Q[ce++]=.5*(1+Math.sin(be))}else{for(f/=3,d/=3,xe=1/(f-1),de=1/(d-1),p=0;p<d;p++)Q[ce++]=p*de,Q[ce++]=0;for(p=f;p>0;p--)Q[ce++]=(p-1)*xe,Q[ce++]=1}c.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:Q})}return t.normal&&(c.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.normals})),t.tangent&&(c.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.tangents})),t.bitangent&&(c.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.bitangents})),{attributes:c,indices:V}}function oZe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Nfe,m=Ffe,x=Gz,b=Wz,T=iZe,C=Bfe,A=c;for(u=0;u<s;u+=3){let E=A+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+s,m),x=h.fromArray(n,(u+3)%s,x),m=h.subtract(m,g,m),x=h.subtract(x,g,x),b=h.normalize(h.cross(m,x,b),b),t.normal&&(Wi.addAttribute(f,b,E),Wi.addAttribute(f,b,E+3),Wi.addAttribute(f,b,A),Wi.addAttribute(f,b,A+3)),(t.tangent||t.bitangent)&&(C=h.fromArray(i,u,C),t.bitangent&&(Wi.addAttribute(p,C,E),Wi.addAttribute(p,C,E+3),Wi.addAttribute(p,C,A),Wi.addAttribute(p,C,A+3)),t.tangent&&(T=h.normalize(h.cross(C,b,T),T),Wi.addAttribute(d,T,E),Wi.addAttribute(d,T,E+3),Wi.addAttribute(d,T,A),Wi.addAttribute(d,T,A+3))),A+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let E=e.tangent.values;d.set(E),d.set(E,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],x=f[u+1];d[p++]=m,d[p++]=x,d[p++]=m,d[p++]=x}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function p7(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function rZe(e,t){let n=new Ie({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=Wi.computePositions(e),r=Vfe(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=si.scaleToGeodeticHeight(f,s,i),m=p7(f,0,m),g=si.scaleToGeodeticHeight(g,a,i),m=p7(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=oZe(c,t);let x,b=d/3;if(e.shadowVolume){let M=c.normal.values;d=M.length;let N=new Float32Array(d*6);for(x=0;x<d;x++)M[x]=-M[x];N.set(M,d),N=p7(M,d*4,N),c.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:N}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let M=new Uint8Array(b*6);if(e.offsetAttribute===on.TOP)M=M.fill(1,0,b).fill(1,b*2,b*4);else{let N=e.offsetAttribute===on.NONE?0:1;M=M.fill(N)}c.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}let T=u.length,C=b+b,A=Ne.createTypedArray(p.length/3,T*2+C*3);A.set(u);let E=T;for(x=0;x<T;x+=3){let M=u[x],N=u[x+1],_=u[x+2];A[E++]=_+b,A[E++]=N+b,A[E++]=M+b}let v,D,O,R;for(x=0;x<C;x+=2)v=x+C,D=v+C,O=v+1,R=D+1,A[E++]=v,A[E++]=D,A[E++]=O,A[E++]=O,A[E++]=D,A[E++]=R;return{attributes:c,indices:A}}var Mfe=new h,HL=new h,Jf=new fe;function Lfe(e,t,n,i,o,r){let s=h.subtract(t,e,Mfe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,HL),c=h.cross(s,a,Mfe);h.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,d=r.latitude,p=r.longitude;h.add(e,c,HL),n.cartesianToCartographic(HL,Jf);let g=Jf.latitude,m=Jf.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,HL),n.cartesianToCartographic(HL,Jf),g=Jf.latitude,m=Jf.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=d,r.longitude=p}var Qf=new h,GL=new h,jl=new fe,ql=new fe;function Ufe(e,t,n,i,o){e=kfe(e,t);let r=Co(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new se;let a=n*.5;jl.latitude=Number.POSITIVE_INFINITY,jl.longitude=Number.POSITIVE_INFINITY,ql.latitude=Number.NEGATIVE_INFINITY,ql.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Ni.ROUNDED){let p=r[0];h.subtract(p,r[1],Qf),h.normalize(Qf,Qf),h.multiplyByScalar(Qf,a,Qf),h.add(p,Qf,GL),t.cartesianToCartographic(GL,Jf),c=Jf.latitude,u=Jf.longitude,jl.latitude=Math.min(jl.latitude,c),jl.longitude=Math.min(jl.longitude,u),ql.latitude=Math.max(ql.latitude,c),ql.longitude=Math.max(ql.longitude,u)}for(let p=0;p<s-1;++p)Lfe(r[p],r[p+1],t,a,jl,ql);let f=r[s-1];h.subtract(f,r[s-2],Qf),h.normalize(Qf,Qf),h.multiplyByScalar(Qf,a,Qf),h.add(f,Qf,GL),Lfe(f,GL,t,a,jl,ql),i===Ni.ROUNDED&&(t.cartesianToCartographic(GL,Jf),c=Jf.latitude,u=Jf.longitude,jl.latitude=Math.min(jl.latitude,c),jl.longitude=Math.min(jl.longitude,u),ql.latitude=Math.max(ql.latitude,c),ql.longitude=Math.max(ql.longitude,u));let d=l(o)?o:new se;return d.north=ql.latitude,d.south=jl.latitude,d.east=ql.longitude,d.west=jl.longitude,d}function k_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Ni.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ee.packedLength+Ie.packedLength+7}k_.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var zfe=ee.clone(ee.UNIT_SPHERE),Hfe=new Ie,B_={positions:void 0,ellipsoid:zfe,vertexFormat:Hfe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};k_.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)o[m]=h.unpack(e,t);let r=ee.unpack(e,t,zfe);t+=ee.packedLength;let s=Ie.unpack(e,t,Hfe);t+=Ie.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=o,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Ie.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(B_.positions=o,B_.width=a,B_.height=c,B_.extrudedHeight=u,B_.cornerType=f,B_.granularity=d,B_.shadowVolume=p,B_.offsetAttribute=g===-1?void 0:g,new k_(B_))};k_.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,o=y(e.ellipsoid,ee.default),r=y(e.cornerType,Ni.ROUNDED);return Ufe(n,o,i,r,t)};k_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=kfe(t,i);let o=Co(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=rZe(u,c);else{let g=Wi.computePositions(u);if(f=Vfe(g,c,i),f.attributes.position.values=si.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let m=e._offsetAttribute===on.NONE?0:1,x=f.attributes.position.values.length,b=new Uint8Array(x/3).fill(m);f.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let d=f.attributes,p=ae.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new st({attributes:d,indices:f.indices,primitiveType:Me.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};k_.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new k_({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(k_.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Ufe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var Xb=k_;var Gfe=new h,Wfe=new h,sZe=new h;function aZe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function jfe(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new un,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){a=o[f];let L=o[f].leftPositions;l(L)?(p=L.length,c+=p,d+=p/3*2):(p=o[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(r),m;g&&(m=r[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let x=c+u,b=new Float64Array(x),T=0,C=x-1,A,E,v,D,O,R,M=m/2,N=Ne.createTypedArray(x/3,d+4),_=0;if(N[_++]=T/3,N[_++]=(C-2)/3,g){n.push(T/3),R=Gfe,O=Wfe;let L=r[0];for(f=0;f<M;f++)R=h.fromArray(L,(M-1-f)*3,R),O=h.fromArray(L,(M+f)*3,O),Wi.addAttribute(b,O,T),Wi.addAttribute(b,R,void 0,C),E=T/3,D=E+1,A=(C-2)/3,v=A-1,N[_++]=A,N[_++]=v,N[_++]=E,N[_++]=D,T+=3,C-=3}let S=0,w=i[S++],I=i[S++];for(b.set(w,T),b.set(I,C-I.length+1),p=I.length-3,n.push(T/3,(C-2)/3),f=0;f<p;f+=3)E=T/3,D=E+1,A=(C-2)/3,v=A-1,N[_++]=A,N[_++]=v,N[_++]=E,N[_++]=D,T+=3,C-=3;for(f=0;f<o.length;f++){let L;a=o[f];let B=a.leftPositions,U=a.rightPositions,V,G=sZe;if(l(B)){for(C-=3,V=v,n.push(D),L=0;L<B.length/3;L++)G=h.fromArray(B,L*3,G),N[_++]=V-L-1,N[_++]=V-L,Wi.addAttribute(b,G,void 0,C),C-=3;n.push(V-Math.floor(B.length/6)),t===Ni.BEVELED&&n.push((C-2)/3+1),T+=3}else{for(T+=3,V=D,n.push(v),L=0;L<U.length/3;L++)G=h.fromArray(U,L*3,G),N[_++]=V+L,N[_++]=V+L+1,Wi.addAttribute(b,G,T),T+=3;n.push(V+Math.floor(U.length/6)),t===Ni.BEVELED&&n.push(T/3-1),C-=3}for(w=i[S++],I=i[S++],w.splice(0,3),I.splice(I.length-3,3),b.set(w,T),b.set(I,C-I.length+1),p=I.length-3,L=0;L<I.length;L+=3)D=T/3,E=D-1,v=(C-2)/3,A=v+1,N[_++]=A,N[_++]=v,N[_++]=E,N[_++]=D,T+=3,C-=3;T-=3,C+=3,n.push(T/3,(C-2)/3)}if(g){T+=3,C-=3,R=Gfe,O=Wfe;let L=r[1];for(f=0;f<M;f++)R=h.fromArray(L,(m-f-1)*3,R),O=h.fromArray(L,f*3,O),Wi.addAttribute(b,R,void 0,C),Wi.addAttribute(b,O,T),D=T/3,E=D-1,v=(C-2)/3,A=v+1,N[_++]=A,N[_++]=v,N[_++]=E,N[_++]=D,T+=3,C-=3;n.push(T/3)}else n.push(T/3,(C-2)/3);return N[_++]=T/3,N[_++]=(C-2)/3,s.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:s,indices:N,wallIndices:n}}function cZe(e){let t=e.ellipsoid,n=Wi.computePositions(e),i=jfe(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=si.scaleToGeodeticHeight(u,r,t),d=si.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let A=new Uint8Array(f*2);if(e.offsetAttribute===on.TOP)A=A.fill(1,0,f);else{let E=e.offsetAttribute===on.NONE?0:1;A=A.fill(E)}a.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}let g,m=c.length,x=Ne.createTypedArray(p.length/3,(m+o.length)*2);x.set(c);let b=m;for(g=0;g<m;g+=2){let A=c[g],E=c[g+1];x[b++]=A+f,x[b++]=E+f}let T,C;for(g=0;g<o.length;g++)T=o[g],C=T+f,x[b++]=T,x[b++]=C;return{attributes:a,indices:x}}function WL(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Ni.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ee.packedLength+6}WL.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var qfe=ee.clone(ee.UNIT_SPHERE),Ky={positions:void 0,ellipsoid:qfe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};WL.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)o[p]=h.unpack(e,t);let r=ee.unpack(e,t,qfe);t+=ee.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=o,n._ellipsoid=ee.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(Ky.positions=o,Ky.width=s,Ky.height=a,Ky.extrudedHeight=c,Ky.cornerType=u,Ky.granularity=f,Ky.offsetAttribute=d===-1?void 0:d,new WL(Ky))};WL.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=aZe(t,i);let o=Co(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=cZe(c);else{let p=Wi.computePositions(c);if(u=jfe(p,c.cornerType),u.attributes.position.values=si.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===on.NONE?0:1,x=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let f=u.attributes,d=ae.fromVertices(f.position.values,void 0,3);return new st({attributes:f,indices:u.indices,primitiveType:Me.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var jL=WL;var lZe=new Kn(0);function al(e){ii.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(al.prototype=Object.create(ii.prototype),al.prototype.constructor=al);Object.defineProperties(al.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});al.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Wc.isSupported(this._scene)};al.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};al.prototype._computeCenter=he.throwInstantiationError;al.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ii.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&>(gt.geometryZIndex),this._zIndex=y(o.zIndex,lZe),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new Gd(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Wx(this._scene,a,r,s)}};al.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ii.prototype.destroy.call(this)};al.getGeometryHeight=function(e,t){if(!l(e)){t!==Ye.NONE&>(gt.geometryHeightReference);return}return vf(t)?0:e};al.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==Ye.NONE&>(gt.geometryExtrudedHeightReference);return}return vf(t)?al.CLAMP_TO_GROUND:e};al.CLAMP_TO_GROUND="clamp";al.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=Ye.NONE),(!l(n)||!l(i))&&(i=Ye.NONE);let o=0;if(t!==Ye.NONE&&o++,i===Ye.RELATIVE_TO_GROUND&&o++,o===2)return on.ALL;if(o===1)return on.TOP};var Gn=al;var Yfe=new H,Xfe=h.ZERO,Kfe=new h,Zfe=new se;function uZe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function _h(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new uZe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(_h.prototype=Object.create(Gn.prototype),_h.prototype.constructor=_h);_h.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Yfe)),l(o)||(o=H.WHITE),i.color=Gt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Xfe,Kfe))),new St({id:t,geometry:new Xb(this._options),attributes:i})};_h.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Yfe),o={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Xfe,Kfe))),new St({id:t,geometry:new jL(this._options),attributes:o})};_h.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};_h.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||ii.prototype._isHidden.call(this,e,t)};_h.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.width)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.cornerType)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};_h.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrUndefined(t.height,He.MINIMUM_VALUE),i=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),o=Y.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),r=Y.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(He.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(He.MINIMUM_VALUE),s.granularity=Y.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),s.cornerType=Y.getValueOrUndefined(t.cornerType,He.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=li.getMinimumMaximumHeights(Xb.computeRectangle(s,Zfe)).minimumTerrainHeight),s.extrudedHeight=o};_h.DynamicGeometryUpdater=RE;function RE(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(RE.prototype=Object.create(ni.prototype),RE.prototype.constructor=RE);RE.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ni.prototype._isHidden.call(this,e,t,n)};RE.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.positions=Y.getValueOrUndefined(t.positions,n),i.width=Y.getValueOrUndefined(t.width,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.cornerType=Y.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(Xb.computeRectangle(i,Zfe)).minimumTerrainHeight),i.extrudedHeight=s};var qL=_h;function jz(){he.throwInstantiationError()}Object.defineProperties(jz.prototype,{name:{get:he.throwInstantiationError},clock:{get:he.throwInstantiationError},entities:{get:he.throwInstantiationError},isLoading:{get:he.throwInstantiationError},changedEvent:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},loadingEvent:{get:he.throwInstantiationError},show:{get:he.throwInstantiationError},clustering:{get:he.throwInstantiationError}});jz.prototype.update=function(e){he.throwInstantiationError()};jz.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var qr=jz;function Rm(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Rm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var $fe=new h;Rm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,$fe);return g7(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Rm.prototype.isScaledSpacePointVisible=function(e){return g7(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var fZe=new h;Rm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=fZe,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),g7(e,o,i)};Rm.prototype.computeHorizonCullingPoint=function(e,t,n){return ede(this._ellipsoid,e,t,n)};var Qfe=ee.clone(ee.UNIT_SPHERE);Rm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Jfe(this._ellipsoid,n,Qfe);return ede(o,e,t,i)};Rm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return tde(this._ellipsoid,e,t,n,i,o)};Rm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Jfe(this._ellipsoid,o,Qfe);return tde(s,e,t,n,i,r)};var dZe=[];Rm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=se.subsample(e,t,0,dZe),o=ae.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var hZe=new h;function Jfe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,hZe);e=ee.fromCartesian3(i,n)}return e}function ede(e,t,n,i){l(i)||(i=new h);let o=ode(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=nde(e,c,o);if(u<0)return;r=Math.max(r,u)}return ide(o,r,i)}var qz=new h;function tde(e,t,n,i,o,r){l(r)||(r=new h),i=y(i,3),o=y(o,h.ZERO);let s=ode(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){qz.x=n[c]+o.x,qz.y=n[c+1]+o.y,qz.z=n[c+2]+o.z;let f=nde(e,qz,s);if(f<0)return;a=Math.max(a,f)}return ide(s,a,r)}function g7(e,t,n){let i=t,o=n,r=h.subtract(e,i,$fe),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var mZe=new h,pZe=new h;function nde(e,t,n){let i=e.transformPositionToScaledSpace(t,mZe),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,pZe);o=Math.max(1,o),r=Math.max(1,r);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-c*f)}function ide(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var _7=new h;function ode(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,_7),h.normalize(_7,_7))}var V_=Rm;function Dr(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Bt.clone(n)),l(i)&&(i=Bt.clone(i)),l(o)&&(o=Mt.clone(o)),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._color=H.clone(y(e.color,H.WHITE)),this._outlineColor=H.clone(y(e.outlineColor,H.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=y(e.splitDirection,Br.NONE)}var rde=Dr.SHOW_INDEX=0,cde=Dr.POSITION_INDEX=1,_Ze=Dr.COLOR_INDEX=2,gZe=Dr.OUTLINE_COLOR_INDEX=3,yZe=Dr.OUTLINE_WIDTH_INDEX=4,xZe=Dr.PIXEL_SIZE_INDEX=5,bZe=Dr.SCALE_BY_DISTANCE_INDEX=6,TZe=Dr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,CZe=Dr.DISTANCE_DISPLAY_CONDITION_INDEX=8,AZe=Dr.DISABLE_DEPTH_DISTANCE_INDEX=9,EZe=Dr.SPLIT_DIRECTION_INDEX=10;Dr.NUMBER_OF_PROPERTIES=11;function Nu(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Dr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Nu(this,rde))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Nu(this,cde))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),Nu(this,bZe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),Nu(this,TZe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Nu(this,xZe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),Nu(this,_Ze))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),Nu(this,gZe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Nu(this,yZe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),Nu(this,CZe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Nu(this,AZe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Nu(this,rde))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Nu(this,EZe))}}});Dr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Dr.prototype._getActualPosition=function(){return this._actualPosition};Dr.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Nu(this,cde)};var sde=new oe;Dr._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(F.multiplyByPoint(n,e,sde),Hi.computeActualEllipsoidPosition(t,sde))};var ade=new oe;Dr._computeScreenSpacePosition=function(e,t,n,i){let o=F.multiplyByVector(e,oe.fromElements(t.x,t.y,t.z,1,ade),ade);return Hi.worldToWindowCoordinates(n,o,i)};Dr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new z);let i=n.modelMatrix,o=Dr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Dr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new je),n.x=r,n.y=s,n.width=a,n.height=c,n};Dr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&H.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&H.equals(this._outlineColor,e._outlineColor)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Dr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ps=Dr;var Zy=`in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerPercent; +in float v_pixelDistance; +in vec4 v_pickColor; +in float v_splitDirection; - vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); +void main() +{ + if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; + if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); + // The distance in UV space from this fragment to the center of the point, at most 0.5. + float distanceToCenter = length(gl_PointCoord - vec2(0.5)); + // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. + float maxDistance = max(0.0, 0.5 - v_pixelDistance); + float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); + float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); - if (czm_isEmpty(intersection)) + vec4 color = mix(v_outlineColor, v_color, innerAlpha); + color.a *= wholeAlpha; + +// Fully transparent parts of the billboard are not pickable. +#if !defined(OPAQUE) && !defined(TRANSLUCENT) + if (color.a < 0.005) // matches 0/255 and 1/255 { discard; } - - // If the viewer is outside, compute outsideFaceColor, with normals facing outward. - vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); - - // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. - vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); - - out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); - out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); - -#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - t = (intersection.start != 0.0) ? intersection.start : intersection.stop; - vec3 positionEC = czm_pointAlongRay(ray, t); - vec4 positionCC = czm_projection * vec4(positionEC, 1.0); -#ifdef LOG_DEPTH - czm_writeLogDepth(1.0 + positionCC.w); #else - float z = positionCC.z / positionCC.w; - - float n = czm_depthRange.near; - float f = czm_depthRange.far; - - gl_FragDepth = (z * (f - n) + f + n) * 0.5; +// The billboard is rendered twice. The opaque pass discards translucent fragments +// and the translucent pass discards opaque fragments. +#ifdef OPAQUE + if (color.a < 0.995) // matches < 254/255 + { + discard; + } +#else + if (color.a >= 0.995) // matches 254/255 and 255/255 + { + discard; + } #endif #endif + + out_FragColor = czm_gammaCorrect(color); + czm_writeLogDepth(); } -`;var aA=`in vec3 position; +`;var YL=`uniform float u_maxTotalPointSize; -uniform vec3 u_radii; +in vec4 positionHighAndSize; +in vec4 positionLowAndOutline; +in vec4 compressedAttribute0; // color, outlineColor, pick color +in vec4 compressedAttribute1; // show, translucency by distance, some free space +in vec4 scaleByDistance; // near, nearScale, far, farScale +in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection -out vec3 v_positionEC; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerPercent; +out float v_pixelDistance; +out vec4 v_pickColor; +out float v_splitDirection; + +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; void main() { - // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. - // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, - // but doing it here allows us to change the radii without rewriting the vertex data, and - // allows all ellipsoids to reuse the same vertex data. - vec4 p = vec4(u_radii * position, 1.0); + // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates - gl_Position = czm_modelViewProjection * p; // position in clip coordinates + // unpack attributes + vec3 positionHigh = positionHighAndSize.xyz; + vec3 positionLow = positionLowAndOutline.xyz; + float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; + float totalSize = positionHighAndSize.w + outlineWidthBothSides; + float outlinePercent = outlineWidthBothSides / totalSize; + // Scale in response to browser-zoom. + totalSize *= czm_pixelRatio; - // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums - // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the - // ellipsoid (does not write depth) that was rendered in the farther frustum. - // - // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates - // artifacts since some fragments can be alpha blended twice. This is solved by only rendering - // the ellipsoid in the closest frustum to the viewer. - gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); + float temp = compressedAttribute1.x * SHIFT_RIGHT8; + float show = floor(temp); +#ifdef EYE_DISTANCE_TRANSLUCENCY + vec4 translucencyByDistance; + translucencyByDistance.x = compressedAttribute1.z; + translucencyByDistance.z = compressedAttribute1.w; + + translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; + + temp = compressedAttribute1.y * SHIFT_RIGHT8; + translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +#endif + + /////////////////////////////////////////////////////////////////////////// + + vec4 color; + vec4 outlineColor; + vec4 pickColor; + + // compressedAttribute0.z => pickColor.rgb + + temp = compressedAttribute0.z * SHIFT_RIGHT8; + pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor.r = floor(temp); + + // compressedAttribute0.x => color.rgb + + temp = compressedAttribute0.x * SHIFT_RIGHT8; + color.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + color.g = (temp - floor(temp)) * SHIFT_LEFT8; + color.r = floor(temp); + + // compressedAttribute0.y => outlineColor.rgb + + temp = compressedAttribute0.y * SHIFT_RIGHT8; + outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.r = floor(temp); + + // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a + + temp = compressedAttribute0.w * SHIFT_RIGHT8; + pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor = pickColor / 255.0; + + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor /= 255.0; + color.a = floor(temp); + color /= 255.0; + + /////////////////////////////////////////////////////////////////////////// + + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + + /////////////////////////////////////////////////////////////////////////// + +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + // 2D camera distance is a special case + // treat all billboards as flattened to the z=0.0 plane + lengthSq = czm_eyeHeight2D.y; + } + else + { + lengthSq = dot(positionEC.xyz, positionEC.xyz); + } +#endif + +#ifdef EYE_DISTANCE_SCALING + totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); +#endif + if (totalSize > 0.0) { + // Add padding for anti-aliasing on both sides. + totalSize += 3.0; + } + + // Clamp to max point size. + totalSize = min(totalSize, u_maxTotalPointSize); + // If size is too small, push vertex behind near plane for clipping. + // Note that context.minimumAliasedPointSize "will be at most 1.0". + if (totalSize < 1.0) + { + positionEC.xyz = vec3(0.0); + totalSize = 1.0; + } + + float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY + translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); + // push vertex behind near plane for clipping + if (translucency < 0.004) + { + positionEC.xyz = vec3(0.0); + } +#endif + +#ifdef DISTANCE_DISPLAY_CONDITION + float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; + float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; + if (lengthSq < nearSq || lengthSq > farSq) { + // push vertex behind camera to force it to be clipped + positionEC.xyz = vec3(0.0, 0.0, 1.0); + } +#endif + + gl_Position = czm_projection * positionEC; czm_vertexLogDepth(); -} -`;/** - * @license - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */var MP=`/** - * @license - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples -// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h - -// Steps used to integrate into Cesium: -// * The following defines are set: -// #define FXAA_PC 1 -// #define FXAA_WEBGL_1 1 -// #define FXAA_GREEN_AS_LUMA 1 -// #define FXAA_EARLY_EXIT 1 -// #define FXAA_GLSL_120 1 -// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. -// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace -// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. -// * There are no implicit conversions from ivec* to vec* so replace: -// #define FxaaInt2 ivec2 -// with -// #define FxaaInt2 vec2 -// * The texture2DLod function is only available in vertex shaders so replace: -// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) -// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) -// with -// #define FxaaTexTop(t, p) texture(t, p) -// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) -// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. -// * The following parameters to FxaaPixelShader are unused and can be removed: -// fxaaConsolePosPos -// fxaaConsoleRcpFrameOpt -// fxaaConsoleRcpFrameOpt2 -// fxaaConsole360RcpFrameOpt2 -// fxaaConsoleEdgeSharpness -// fxaaConsoleEdgeThreshold -// fxaaConsoleEdgeThresholdMi -// fxaaConsole360ConstDir - -// -// Choose the quality preset. -// This needs to be compiled into the shader as it effects code. -// Best option to include multiple presets is to -// in each shader define the preset, then include this file. -// -// OPTIONS -// ----------------------------------------------------------------------- -// 10 to 15 - default medium dither (10=fastest, 15=highest quality) -// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) -// 39 - no dither, very expensive -// -// NOTES -// ----------------------------------------------------------------------- -// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) -// 13 = about same speed as FXAA 3.9 and better than 12 -// 23 = closest to FXAA 3.9 visually and performance wise -// _ = the lowest digit is directly related to performance -// _ = the highest digit is directly related to style -// -//#define FXAA_QUALITY_PRESET 12 - - -#if (FXAA_QUALITY_PRESET == 10) - #define FXAA_QUALITY_PS 3 - #define FXAA_QUALITY_P0 1.5 - #define FXAA_QUALITY_P1 3.0 - #define FXAA_QUALITY_P2 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 11) - #define FXAA_QUALITY_PS 4 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 3.0 - #define FXAA_QUALITY_P3 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 12) - #define FXAA_QUALITY_PS 5 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 4.0 - #define FXAA_QUALITY_P4 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 13) - #define FXAA_QUALITY_PS 6 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 4.0 - #define FXAA_QUALITY_P5 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 14) - #define FXAA_QUALITY_PS 7 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 4.0 - #define FXAA_QUALITY_P6 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 15) - #define FXAA_QUALITY_PS 8 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 4.0 - #define FXAA_QUALITY_P7 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 20) - #define FXAA_QUALITY_PS 3 - #define FXAA_QUALITY_P0 1.5 - #define FXAA_QUALITY_P1 2.0 - #define FXAA_QUALITY_P2 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 21) - #define FXAA_QUALITY_PS 4 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 22) - #define FXAA_QUALITY_PS 5 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 23) - #define FXAA_QUALITY_PS 6 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 24) - #define FXAA_QUALITY_PS 7 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 3.0 - #define FXAA_QUALITY_P6 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 25) - #define FXAA_QUALITY_PS 8 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 4.0 - #define FXAA_QUALITY_P7 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 26) - #define FXAA_QUALITY_PS 9 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 4.0 - #define FXAA_QUALITY_P8 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 27) - #define FXAA_QUALITY_PS 10 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 4.0 - #define FXAA_QUALITY_P9 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 28) - #define FXAA_QUALITY_PS 11 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 4.0 - #define FXAA_QUALITY_P10 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 29) - #define FXAA_QUALITY_PS 12 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 2.0 - #define FXAA_QUALITY_P10 4.0 - #define FXAA_QUALITY_P11 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 39) - #define FXAA_QUALITY_PS 12 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.0 - #define FXAA_QUALITY_P2 1.0 - #define FXAA_QUALITY_P3 1.0 - #define FXAA_QUALITY_P4 1.0 - #define FXAA_QUALITY_P5 1.5 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 2.0 - #define FXAA_QUALITY_P10 4.0 - #define FXAA_QUALITY_P11 8.0 -#endif - -#define FxaaBool bool -#define FxaaFloat float -#define FxaaFloat2 vec2 -#define FxaaFloat3 vec3 -#define FxaaFloat4 vec4 -#define FxaaHalf float -#define FxaaHalf2 vec2 -#define FxaaHalf3 vec3 -#define FxaaHalf4 vec4 -#define FxaaInt2 vec2 -#define FxaaTex sampler2D - -#define FxaaSat(x) clamp(x, 0.0, 1.0) -#define FxaaTexTop(t, p) texture(t, p) -#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) - -FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } - -FxaaFloat4 FxaaPixelShader( - // - // Use noperspective interpolation here (turn off perspective interpolation). - // {xy} = center of pixel - FxaaFloat2 pos, - // - // Input color texture. - // {rgb_} = color in linear or perceptual color space - // if (FXAA_GREEN_AS_LUMA == 0) - // {___a} = luma in perceptual color space (not linear) - FxaaTex tex, - // - // Only used on FXAA Quality. - // This must be from a constant/uniform. - // {x_} = 1.0/screenWidthInPixels - // {_y} = 1.0/screenHeightInPixels - FxaaFloat2 fxaaQualityRcpFrame, - // - // Only used on FXAA Quality. - // This used to be the FXAA_QUALITY_SUBPIX define. - // It is here now to allow easier tuning. - // Choose the amount of sub-pixel aliasing removal. - // This can effect sharpness. - // 1.00 - upper limit (softer) - // 0.75 - default amount of filtering - // 0.50 - lower limit (sharper, less sub-pixel aliasing removal) - // 0.25 - almost off - // 0.00 - completely off - FxaaFloat fxaaQualitySubpix, - // - // Only used on FXAA Quality. - // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define. - // It is here now to allow easier tuning. - // The minimum amount of local contrast required to apply algorithm. - // 0.333 - too little (faster) - // 0.250 - low quality - // 0.166 - default - // 0.125 - high quality - // 0.063 - overkill (slower) - FxaaFloat fxaaQualityEdgeThreshold, - // - // Only used on FXAA Quality. - // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define. - // It is here now to allow easier tuning. - // Trims the algorithm from processing darks. - // 0.0833 - upper limit (default, the start of visible unfiltered edges) - // 0.0625 - high quality (faster) - // 0.0312 - visible limit (slower) - // Special notes when using FXAA_GREEN_AS_LUMA, - // Likely want to set this to zero. - // As colors that are mostly not-green - // will appear very dark in the green channel! - // Tune by looking at mostly non-green content, - // then start at zero and increase until aliasing is a problem. - FxaaFloat fxaaQualityEdgeThresholdMin -) { -/*--------------------------------------------------------------------------*/ - FxaaFloat2 posM; - posM.x = pos.x; - posM.y = pos.y; - FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); - #define lumaM rgbyM.y - FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); -/*--------------------------------------------------------------------------*/ - FxaaFloat maxSM = max(lumaS, lumaM); - FxaaFloat minSM = min(lumaS, lumaM); - FxaaFloat maxESM = max(lumaE, maxSM); - FxaaFloat minESM = min(lumaE, minSM); - FxaaFloat maxWN = max(lumaN, lumaW); - FxaaFloat minWN = min(lumaN, lumaW); - FxaaFloat rangeMax = max(maxWN, maxESM); - FxaaFloat rangeMin = min(minWN, minESM); - FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; - FxaaFloat range = rangeMax - rangeMin; - FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); - FxaaBool earlyExit = range < rangeMaxClamped; -/*--------------------------------------------------------------------------*/ - if(earlyExit) - return rgbyM; -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNS = lumaN + lumaS; - FxaaFloat lumaWE = lumaW + lumaE; - FxaaFloat subpixRcpRange = 1.0/range; - FxaaFloat subpixNSWE = lumaNS + lumaWE; - FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; - FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNESE = lumaNE + lumaSE; - FxaaFloat lumaNWNE = lumaNW + lumaNE; - FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; - FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNWSW = lumaNW + lumaSW; - FxaaFloat lumaSWSE = lumaSW + lumaSE; - FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); - FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); - FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; - FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; - FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; - FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; -/*--------------------------------------------------------------------------*/ - FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; - FxaaFloat lengthSign = fxaaQualityRcpFrame.x; - FxaaBool horzSpan = edgeHorz >= edgeVert; - FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; -/*--------------------------------------------------------------------------*/ - if(!horzSpan) lumaN = lumaW; - if(!horzSpan) lumaS = lumaE; - if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; - FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; -/*--------------------------------------------------------------------------*/ - FxaaFloat gradientN = lumaN - lumaM; - FxaaFloat gradientS = lumaS - lumaM; - FxaaFloat lumaNN = lumaN + lumaM; - FxaaFloat lumaSS = lumaS + lumaM; - FxaaBool pairN = abs(gradientN) >= abs(gradientS); - FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); - if(pairN) lengthSign = -lengthSign; - FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); -/*--------------------------------------------------------------------------*/ - FxaaFloat2 posB; - posB.x = posM.x; - posB.y = posM.y; - FxaaFloat2 offNP; - offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; - offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; - if(!horzSpan) posB.x += lengthSign * 0.5; - if( horzSpan) posB.y += lengthSign * 0.5; -/*--------------------------------------------------------------------------*/ - FxaaFloat2 posN; - posN.x = posB.x - offNP.x * FXAA_QUALITY_P0; - posN.y = posB.y - offNP.y * FXAA_QUALITY_P0; - FxaaFloat2 posP; - posP.x = posB.x + offNP.x * FXAA_QUALITY_P0; - posP.y = posB.y + offNP.y * FXAA_QUALITY_P0; - FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; - FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); - FxaaFloat subpixE = subpixC * subpixC; - FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); -/*--------------------------------------------------------------------------*/ - if(!pairN) lumaNN = lumaSS; - FxaaFloat gradientScaled = gradient * 1.0/4.0; - FxaaFloat lumaMM = lumaM - lumaNN * 0.5; - FxaaFloat subpixF = subpixD * subpixE; - FxaaBool lumaMLTZero = lumaMM < 0.0; -/*--------------------------------------------------------------------------*/ - lumaEndN -= lumaNN * 0.5; - lumaEndP -= lumaNN * 0.5; - FxaaBool doneN = abs(lumaEndN) >= gradientScaled; - FxaaBool doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1; - FxaaBool doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1; -/*--------------------------------------------------------------------------*/ - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 3) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 4) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 5) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 6) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 7) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 8) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 9) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 10) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 11) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 12) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ +#ifdef DISABLE_DEPTH_DISTANCE + float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; + if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) + { + disableDepthTestDistance = czm_minimumDisableDepthTestDistance; } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ + + if (disableDepthTestDistance != 0.0) + { + // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. + float zclip = gl_Position.z / gl_Position.w; + bool clipped = (zclip < -1.0 || zclip > 1.0); + if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) + { + // Position z on the near plane. + gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH + czm_vertexLogDepth(vec4(czm_currentFrustum.x)); +#endif } - #endif -/*--------------------------------------------------------------------------*/ } -/*--------------------------------------------------------------------------*/ - FxaaFloat dstN = posM.x - posN.x; - FxaaFloat dstP = posP.x - posM.x; - if(!horzSpan) dstN = posM.y - posN.y; - if(!horzSpan) dstP = posP.y - posM.y; -/*--------------------------------------------------------------------------*/ - FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; - FxaaFloat spanLength = (dstP + dstN); - FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; - FxaaFloat spanLengthRcp = 1.0/spanLength; -/*--------------------------------------------------------------------------*/ - FxaaBool directionN = dstN < dstP; - FxaaFloat dst = min(dstN, dstP); - FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; - FxaaFloat subpixG = subpixF * subpixF; - FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; - FxaaFloat subpixH = subpixG * fxaaQualitySubpix; -/*--------------------------------------------------------------------------*/ - FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; - FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); - if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; - if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; - return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); +#endif + + v_color = color; + v_color.a *= translucency * show; + v_outlineColor = outlineColor; + v_outlineColor.a *= translucency * show; + + v_innerPercent = 1.0 - outlinePercent; + v_pixelDistance = 2.0 / totalSize; + gl_PointSize = totalSize * show; + gl_Position *= show; + + v_pickColor = pickColor; + v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; } -`;var LP=`uniform vec4 u_initialColor; +`;var SZe=Ps.SHOW_INDEX,b7=Ps.POSITION_INDEX,lde=Ps.COLOR_INDEX,vZe=Ps.OUTLINE_COLOR_INDEX,wZe=Ps.OUTLINE_WIDTH_INDEX,DZe=Ps.PIXEL_SIZE_INDEX,ude=Ps.SCALE_BY_DISTANCE_INDEX,fde=Ps.TRANSLUCENCY_BY_DISTANCE_INDEX,dde=Ps.DISTANCE_DISPLAY_CONDITION_INDEX,IZe=Ps.DISABLE_DEPTH_DISTANCE_INDEX,PZe=Ps.SPLIT_DIRECTION_INDEX,T7=Ps.NUMBER_OF_PROPERTIES,Cc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function ed(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(T7),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,vo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ed.prototype,{length:{get:function(){return C7(this),this._pointPrimitives.length}}});function hde(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ed.prototype.add=function(e){let t=new Ps(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};ed.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ed.prototype.removeAll=function(){hde(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function C7(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}ed.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};ed.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};ed.prototype.get=function(e){return C7(this),this._pointPrimitives[e]};ed.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<T7;++i){let o=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function RZe(e,t,n){return new Rp(e,[{index:Cc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[b7]},{index:Cc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[b7]},{index:Cc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[lde]},{index:Cc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[fde]},{index:Cc.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[ude]},{index:Cc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[dde]}],t)}var y7=new Hn;function mde(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Hn.fromCartesian(r,y7);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[Cc.positionHighAndSize],u=y7.high;c(o,u.x,u.y,u.z,s);let f=n[Cc.positionLowAndOutline],d=y7.low;f(o,d.x,d.y,d.z,a)}var Yz=65536,XL=256;function pde(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=H.floatToByte(r.red),u=H.floatToByte(r.green),f=H.floatToByte(r.blue),d=c*Yz+u*XL+f;c=H.floatToByte(a.red),u=H.floatToByte(a.green),f=H.floatToByte(a.blue);let p=c*Yz+u*XL+f;c=H.floatToByte(s.red),u=H.floatToByte(s.green),f=H.floatToByte(s.blue);let g=c*Yz+u*XL+f,m=H.floatToByte(r.alpha)*Yz+H.floatToByte(a.alpha)*XL+H.floatToByte(s.alpha),x=n[Cc.compressedAttribute0];x(o,d,p,g,m)}function _de(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*XL+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[Cc.compressedAttribute1];g(o,d,p,r,a)}function gde(e,t,n,i){let o=i._index,r=n[Cc.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,u)}function yde(e,t,n,i){let o=i._index,r=n[Cc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),r(o,s,a,u,f)}function OZe(e,t,n,i){mde(e,t,n,i),pde(e,t,n,i),_de(e,t,n,i),gde(e,t,n,i),yde(e,t,n,i)}function x7(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Ps._computeActualPosition(f,i,o);l(d)&&(u._setActualPosition(d),r?a.push(d):ae.expand(s,d,s))}r&&ae.fromPoints(a,s)}function MZe(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&x7(e,i,i.length,t,r,!0)):n===ne.MORPHING?x7(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&x7(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function LZe(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var NZe=[];ed.prototype.update=function(e){if(C7(this),!this.show)return;this._maxTotalPointSize=Lt.maximumAliasedPointSize,MZe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<T7;++v)r[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=RZe(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let D=this._pointPrimitives[v];D._dirty=!1,OZe(this,c,a,D)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let v=NZe;v.length=0,(r[b7]||r[wZe]||r[DZe])&&v.push(mde),(r[lde]||r[vZe])&&v.push(pde),(r[SZe]||r[fde])&&v.push(_de),r[ude]&&v.push(gde),(r[dde]||r[IZe]||r[PZe])&&v.push(yde);let D=v.length;if(a=this._vaf.writers,o/n>.1){for(let O=0;O<o;++O){let R=i[O];R._dirty=!1;for(let M=0;M<D;++M)v[M](this,c,a,R)}this._vaf.commit()}else{for(let O=0;O<o;++O){let R=i[O];R._dirty=!1;for(let M=0;M<D;++M)v[M](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=F.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,d=ae.clone(this._baseVolumeWC,this._boundingVolume)):d=ae.clone(this._baseVolume2D,this._boundingVolume),LZe(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===vo.OPAQUE||this._blendOption===vo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===vo.TRANSLUCENT||this._blendOption===vo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:ln.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Ue({sources:[YL]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===vo.OPAQUE_AND_TRANSLUCENT&&(x=new Ue({defines:["OPAQUE"],sources:[Zy]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Cc}),x=new Ue({defines:["TRANSLUCENT"],sources:[Zy]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Cc})),this._blendOption===vo.OPAQUE&&(x=new Ue({sources:[Zy]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Cc})),this._blendOption===vo.TRANSLUCENT&&(x=new Ue({sources:[Zy]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Cc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,T,C,A,E=e.commandList;if(u.render||f){let v=this._colorCommands,D=this._blendOption===vo.OPAQUE,O=this._blendOption===vo.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,T=b.length,v.length=T;let R=O?T*2:T;for(A=0;A<R;++A){let M=D||O&&A%2===0;C=v[A],l(C)||(C=v[A]=new Ze),C.primitiveType=Me.POINTS,C.pass=M||!O?we.OPAQUE:we.TRANSLUCENT,C.owner=this;let N=O?Math.floor(A/2):A;C.boundingVolume=d,C.modelMatrix=p,C.shaderProgram=M?this._sp:this._spTranslucent,C.uniformMap=this._uniforms,C.vertexArray=b[N].va,C.renderState=M?this._rsOpaque:this._rsTranslucent,C.debugShowBoundingVolume=this.debugShowBoundingVolume,C.pickId="v_pickColor",E.push(C)}}};ed.prototype.isDestroyed=function(){return!1};ed.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),hde(this._pointPrimitives),ue(this)};var OE=ed;var xde=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],A7=1,KL=8,$L=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==A7)throw new Error(`Got v${o} data when expected v${A7}.`);let r=xde[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=xde.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,KL,t),this.coords=new this.ArrayType(this.data,KL+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(KL+s+a+c),this.ids=new this.IndexArrayType(this.data,KL,t),this.coords=new this.ArrayType(this.data,KL+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(A7<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return S7(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,d=c.pop()||0,p=c.pop()||0;if(d-p<=a){for(let b=p;b<=d;b++){let T=s[2*b],C=s[2*b+1];T>=t&&T<=i&&C>=n&&C<=o&&u.push(r[b])}continue}let g=p+d>>1,m=s[2*g],x=s[2*g+1];m>=t&&m<=i&&x>=n&&x<=o&&u.push(r[g]),(f===0?t<=m:n<=x)&&(c.push(p),c.push(g-1),c.push(1-f)),(f===0?i>=m:o>=x)&&(c.push(g+1),c.push(d),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let b=p;b<=d;b++)bde(r[2*b],r[2*b+1],t,n)<=u&&c.push(o[b]);continue}let g=p+d>>1,m=r[2*g],x=r[2*g+1];bde(m,x,t,n)<=u&&c.push(o[g]),(f===0?t-i<=m:n-i<=x)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=m:n+i>=x)&&(a.push(g+1),a.push(d),a.push(1-f))}return c}};function S7(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Tde(e,t,s,i,o,r),S7(e,t,n,i,s-1,1-r),S7(e,t,n,s+1,o,1-r)}function Tde(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),x=Math.min(o,Math.floor(n+(u-f)*p/u+g));Tde(e,t,n,m,x,r)}let s=t[2*n+r],a=i,c=o;for(ZL(e,t,i,n),t[2*o+r]>s&&ZL(e,t,i,o);a<c;){for(ZL(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?ZL(e,t,i,c):(c++,ZL(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function ZL(e,t,n,i){E7(e,n,i),E7(t,2*n,2*i),E7(t,2*n+1,2*i+1)}function E7(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function bde(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function gh(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new pe,this.show=y(e.show,!0)}function Cde(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var FZe=new je;function Ade(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=By.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=uo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ps.getScreenSpaceBoundingBox(e,t,o)),Cde(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Sde(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=By.getScreenSpaceBoundingBox(s,t,FZe);Cde(a,n),o=je.union(o,a,o)}return o}function BZe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Sde(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Ede(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function Sde(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function v7(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===ne.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),u=o._clusterBillboards&&l(a.id._billboard),f=o._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var kZe=new je,VZe=new je,UZe=new je;function zZe(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new vm({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Ru({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new OE;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,x=n.ellipsoid,b=n.camera.positionWC,T=new V_(x,b),C=[];e._clusterLabels&&v7(i,C,n,T,e),e._clusterBillboards&&v7(o,C,n,T,e),e._clusterPoints&&v7(r,C,n,T,e);let A,E,v,D,O,R,M,N,_,S,w,I;if(C.length>0){let L=new $L(C.length,64,Uint32Array);for(let B=0;B<C.length;++B)L.add(C[B].coord.x,C[B].coord.y);if(L.finish(),m<g)for(v=d.length,A=0;A<v;++A){let B=d[A];if(!T.isPointVisible(B.position))continue;let U=uo._computeScreenSpacePosition(F.IDENTITY,B.position,h.ZERO,z.ZERO,n);if(!l(U))continue;let V=1-m/g,G=B.width=B.width*V,k=B.height=B.height*V;G=Math.max(G,B.minimumWidth),k=Math.max(k,B.minimumHeight);let W=U.x-G*.5,q=U.y-k*.5,J=U.x+G,j=U.y+k;for(O=L.range(W,q,J,j),R=O.length,S=0,_=[],E=0;E<R;++E)M=O[E],N=C[M],N.clustered||(++S,w=N.collection,I=N.index,_.push(w.get(I).id));if(S>=f)for(Ede(B.position,S,_,e),p.push(B),E=0;E<R;++E)C[O[E]].clustered=!0}for(v=C.length,A=0;A<v;++A){let B=C[A];if(B.clustered)continue;B.clustered=!0,w=B.collection,I=B.index;let U=w.get(I);D=Ade(U,B.coord,u,e,kZe);let V=je.clone(D,VZe);O=L.range(D.x,D.y,D.x+D.width,D.y+D.height),R=O.length;let G=h.clone(U.position);for(S=1,_=[U.id],E=0;E<R;++E)if(M=O[E],N=C[M],!N.clustered){let k=N.collection.get(N.index),W=Ade(k,N.coord,u,e,UZe);h.add(k.position,G,G),je.union(V,W,V),++S,_.push(k.id)}if(S>=f){let k=h.multiplyByScalar(G,1/S,G);for(Ede(k,S,_,e),p.push({position:k,width:V.width,height:V.height,minimumWidth:D.width,minimumHeight:D.height}),E=0;E<R;++E)C[O[E]].clustered=!0}else BZe(U,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}gh.prototype._initialize=function(e){this._scene=e;let t=zZe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(gh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function D7(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function I7(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}gh.prototype.getLabel=D7("_labelCollection",vm,"_unusedLabelIndices","labelIndex");gh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,I7(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};gh.prototype.getBillboard=D7("_billboardCollection",Ru,"_unusedBillboardIndices","billboardIndex");gh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,I7(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};gh.prototype.getPoint=D7("_pointCollection",OE,"_unusedPointIndices","pointIndex");gh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,I7(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function w7(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function HZe(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,w7(e._labelCollection),w7(e._billboardCollection),w7(e._pointCollection))}gh.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,HZe(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};gh.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Fu=gh;function P7(e){this._name=e,this._clock=void 0,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new $s(this),this._entityCluster=new Fu}Object.defineProperties(P7.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){qr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});P7.prototype.update=function(e){return!0};var QL=P7;var vde={};vde.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=o?a*3:0,m=o?(a+i)*3:i*3;for(f=0;f<i;f++){let x=f/i*P.TWO_PI,b=Math.cos(x),T=Math.sin(x),C=b*n,A=T*n,E=b*t,v=T*t;u[p+g]=C,u[p+g+1]=A,u[p+g+2]=s,u[p+m]=E,u[p+m+1]=v,u[p+m+2]=r,p+=3,o&&(u[d++]=C,u[d++]=A,u[d++]=s,u[d++]=E,u[d++]=v,u[d++]=r)}return u};var Kb=vde;var R7=new z,GZe=new h,WZe=new h,jZe=new h,qZe=new h;function U_(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Ie.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}U_.packedLength=Ie.packedLength+5;U_.pack=function(e,t,n){return n=y(n,0),Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var wde=new Ie,ME={vertexFormat:wde,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};U_.unpack=function(e,t,n){t=y(t,0);let i=Ie.unpack(e,t,wde);t+=Ie.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(ME.length=o,ME.topRadius=r,ME.bottomRadius=s,ME.slices=a,ME.offsetAttribute=c===-1?void 0:c,new U_(ME))};U_.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,u=Kb.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,d=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,g=o.bitangent?new Float32Array(c*3):void 0,m,x=o.normal||o.tangent||o.bitangent;if(x){let O=o.tangent||o.bitangent,R=0,M=0,N=0,_=Math.atan2(i-n,t),S=GZe;S.z=Math.sin(_);let w=Math.cos(_),I=jZe,L=WZe;for(m=0;m<r;m++){let B=m/r*P.TWO_PI,U=w*Math.cos(B),V=w*Math.sin(B);x&&(S.x=U,S.y=V,O&&(I=h.normalize(h.cross(h.UNIT_Z,S,I),I)),o.normal&&(d[R++]=S.x,d[R++]=S.y,d[R++]=S.z,d[R++]=S.x,d[R++]=S.y,d[R++]=S.z),o.tangent&&(p[M++]=I.x,p[M++]=I.y,p[M++]=I.z,p[M++]=I.x,p[M++]=I.y,p[M++]=I.z),o.bitangent&&(L=h.normalize(h.cross(S,I,L),L),g[N++]=L.x,g[N++]=L.y,g[N++]=L.z,g[N++]=L.x,g[N++]=L.y,g[N++]=L.z))}for(m=0;m<r;m++)o.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),o.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),o.bitangent&&(g[N++]=0,g[N++]=-1,g[N++]=0);for(m=0;m<r;m++)o.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),o.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),o.bitangent&&(g[N++]=0,g[N++]=1,g[N++]=0)}let b=12*r-12,T=Ne.createTypedArray(c,b),C=0,A=0;for(m=0;m<r-1;m++)T[C++]=A,T[C++]=A+2,T[C++]=A+3,T[C++]=A,T[C++]=A+3,T[C++]=A+1,A+=2;for(T[C++]=s-2,T[C++]=0,T[C++]=1,T[C++]=s-2,T[C++]=1,T[C++]=s-1,m=1;m<r-1;m++)T[C++]=s+m+1,T[C++]=s+m,T[C++]=s;for(m=1;m<r-1;m++)T[C++]=a,T[C++]=a+m,T[C++]=a+m+1;let E=0;if(o.st){let O=Math.max(n,i);for(m=0;m<c;m++){let R=h.fromArray(u,m*3,qZe);f[E++]=(R.x+O)/(2*O),f[E++]=(R.y+O)/(2*O)}}let v=new un;o.position&&(v.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(v.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:d})),o.tangent&&(v.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(v.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(v.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),R7.x=t*.5,R7.y=Math.max(i,n);let D=new ae(h.ZERO,z.magnitude(R7));if(l(e._offsetAttribute)){t=u.length;let O=e._offsetAttribute===on.NONE?0:1,R=new Uint8Array(t/3).fill(O);v.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new st({attributes:v,indices:T,primitiveType:Me.TRIANGLES,boundingSphere:D,offsetAttribute:e._offsetAttribute})};var O7;U_.getUnitCylinder=function(){return l(O7)||(O7=U_.createGeometry(new U_({topRadius:1,bottomRadius:1,length:1,vertexFormat:Ie.POSITION_ONLY}))),O7};var JL=U_;var M7=new z;function LE(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.slices,128),r=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}LE.packedLength=6;LE.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Zb={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};LE.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(Zb.length=i,Zb.topRadius=o,Zb.bottomRadius=r,Zb.slices=s,Zb.numberOfVerticalLines=a,Zb.offsetAttribute=c===-1?void 0:c,new LE(Zb))};LE.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=Kb.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let x=Math.min(r,o);u=Math.round(o/x),c+=x}let f=Ne.createTypedArray(s,c*2),d=0,p;for(p=0;p<o-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+o,f[d++]=p+1+o;if(f[d++]=o-1,f[d++]=0,f[d++]=o+o-1,f[d++]=o,r>0)for(p=0;p<o;p+=u)f[d++]=p,f[d++]=p+o;let g=new un;g.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:a}),M7.x=t*.5,M7.y=Math.max(i,n);let m=new ae(h.ZERO,z.magnitude(M7));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===on.NONE?0:1,b=new Uint8Array(t/3).fill(x);g.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}return new st({attributes:g,indices:f,primitiveType:Me.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var eN=LE;var Dde=h.ZERO,Ide=new h,YZe=new h,Pde=new H;function XZe(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Bu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new XZe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Bu.prototype=Object.create(ii.prototype),Bu.prototype.constructor=Bu);Object.defineProperties(Bu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Bu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Bn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Pde)),l(a)||(a=H.WHITE),s.color=Gt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Dde,Ide))),new St({id:t,geometry:new JL(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Bu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Pde),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Dde,Ide))),new St({id:t,geometry:new eN(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Bu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};Bu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||ii.prototype._isHidden.call(this,e,t)};Bu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!Y.isConstant(t.slices)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.numberOfVerticalLines)};Bu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(He.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(He.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(He.MINIMUM_VALUE),i.slices=Y.getValueOrUndefined(t.slices,He.MINIMUM_VALUE),i.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,He.MINIMUM_VALUE),i.offsetAttribute=n!==Ye.NONE?on.ALL:void 0};Bu.prototype._onEntityPropertyChanged=Wp;Bu.DynamicGeometryUpdater=NE;function NE(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(NE.prototype=Object.create(ni.prototype),NE.prototype.constructor=NE);NE.prototype._isHidden=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(e.position,n,YZe);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ni.prototype._isHidden.call(this,e,t,n)};NE.prototype._setOptions=function(e,t,n){let i=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),o=this._options;o.length=Y.getValueOrUndefined(t.length,n),o.topRadius=Y.getValueOrUndefined(t.topRadius,n),o.bottomRadius=Y.getValueOrUndefined(t.bottomRadius,n),o.slices=Y.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Ye.NONE?on.ALL:void 0};var tN=Bu;var KZe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Yr=Object.freeze(KZe);var ZZe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},_o=Object.freeze(ZZe);var $Ze={NONE:0,HOLD:1,EXTRAPOLATE:2},ku=Object.freeze($Ze);var Rde=Zo(uu(),1);function QZe(e){let t=new Rde.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var z_=QZe;var JZe=P.factorial;function L7(e,t,n,i,o,r){let s=0,a,c,u;if(i>0){for(c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(r.push(c),s+=L7(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var Xz={type:"Hermite"};Xz.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};Xz.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,u,f,d=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let b=new Array(d);for(p[r]=b,s=0;s<d;s++)b[s]=[]}let g=d,m=new Array(g);for(r=0;r<g;r++)m[r]=r;let x=d-1;for(c=0;c<i;c++){for(s=0;s<g;s++)f=m[s]*i+c,p[c][0].push(n[f]);for(r=1;r<g;r++){let b=!1;for(s=0;s<g-r;s++){let T=t[m[s]],C=t[m[s+r]],A;C-T<=0?(f=m[s]*i+i*r+c,A=n[f],p[c][r].push(A/JZe(r))):(A=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(A/(C-T))),b=b||A!==0}b||(x=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=x;r++){let b=L7(e,m,t,a,r,[]);for(c=0;c<i;c++){let T=p[c][r][0];o[c+a*i]+=T*b}}return o};var e$e=[];Xz.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let T=0;T<a;T++)s[T]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let T=0;T<o+1;T++)u[f*(o+1)+T]=f;let d=u.length,p=e$e,g=t$e(p,u,t,n,i,o),m=[],x=d*(d+1)/2,b=Math.min(g,r);for(let T=0;T<=b;T++)for(f=T;f<=g;f++){m.length=0;let C=L7(e,u,t,T,f,m),A=Math.floor(f*(1-f)/2)+d*f;for(let E=0;E<i;E++){let v=Math.floor(E*x),D=p[v+A];s[E+T*i]+=D*C}}return s};function t$e(e,t,n,i,o,r){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<o;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,x=Math.floor(g*(1-g)/2)+u*g,b=!1;for(s=0;s<u-g;s++){let T=n[t[s]],C=n[t[s+g]],A,E;if(C-T<=0)a=t[s]*o*(r+1)+o*g+d,A=i[a],E=A/P.factorial(g),e[p+x+m]=E,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);A=e[p+v+s+1]-e[p+v+s],E=A/(C-T),e[p+x+m]=E,m++}b=b||A!==0}b&&(c=Math.max(c,g))}}return c}var nN=Xz;var N7={type:"Lagrange"};N7.getRequiredDataPoints=function(e){return Math.max(e+1,2)};N7.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let u=t[r]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var iN=N7;var F7={type:"Linear"};F7.getRequiredDataPoints=function(e){return 2};F7.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],u=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-c*a)/(u-c);return o};var $b=F7;function Ac(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}Ac.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new Ac),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};Ac.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Ac(e.clock,e.cone,e.magnitude)};Ac.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Ac(e.clock,e.cone,1)};Ac.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Ac.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};Ac.prototype.equals=function(e){return Ac.equals(this,e)};Ac.prototype.clone=function(e){return Ac.clone(this,e)};Ac.prototype.equalsEpsilon=function(e,t){return Ac.equalsEpsilon(this,e,t)};Ac.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var oN=Ac;var lN=Zo(uu(),1);var B7;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?B7=function(){return performance.now()}:B7=function(){return Date.now()};var Ti=B7;function k7(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=Z.clone(t):l(n)?t=Z.clone(n):l(i)?t=Z.addDays(i,-1,new Z):t=Z.now(),l(n)?n=Z.clone(n):n=Z.clone(t),l(i)?i=Z.clone(i):i=Z.addDays(n,1,new Z),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,Yr.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new pe,this.onStop=new pe,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ti(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,_o.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(k7.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Z.equals(this._currentTime,e)||(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===_o.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=Z.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});k7.prototype.tick=function(){let e=Ti(),t=Z.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===_o.SYSTEM_CLOCK)t=Z.now(t);else{let i=this._multiplier;if(n===_o.TICK_DEPENDENT)t=Z.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=Z.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===Yr.CLAMPED)Z.lessThan(t,r)?t=Z.clone(r,t):Z.greaterThan(t,s)&&(t=Z.clone(s,t),this.onStop.raiseEvent(this));else if(o===Yr.LOOP_STOP)for(Z.lessThan(t,r)&&(t=Z.clone(r,t));Z.greaterThan(t,s);)t=Z.addSeconds(r,Z.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var yh=k7;function Qb(){this._definitionChanged=new pe,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(Qb.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Yc("startTime"),stopTime:Yc("stopTime"),currentTime:Yc("currentTime"),clockRange:Yc("clockRange"),clockStep:Yc("clockStep"),multiplier:Yc("multiplier")});Qb.prototype.clone=function(e){return l(e)||(e=new Qb),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};Qb.prototype.equals=function(e){return this===e||l(e)&&Z.equals(this.startTime,e.startTime)&&Z.equals(this.stopTime,e.stopTime)&&Z.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};Qb.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};Qb.prototype.getValue=function(e){return l(e)||(e=new yh),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var xh=Qb;var n$e=H.WHITE,i$e=.1,o$e=new z(8,8),r$e=new z(0,0),s$e=new z(1,1);function FE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(FE.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._cellAlpha)&&Y.isConstant(this._lineCount)&&Y.isConstant(this._lineThickness)&&Y.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});FE.prototype.getType=function(e){return"Grid"};var a$e=new Z;FE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(a$e)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,n$e,t.color),t.cellAlpha=Y.getValueOrDefault(this._cellAlpha,e,i$e),t.lineCount=Y.getValueOrClonedDefault(this._lineCount,e,o$e,t.lineCount),t.lineThickness=Y.getValueOrClonedDefault(this._lineThickness,e,s$e,t.lineThickness),t.lineOffset=Y.getValueOrClonedDefault(this._lineOffset,e,r$e,t.lineOffset),t};FE.prototype.equals=function(e){return this===e||e instanceof FE&&Y.equals(this._color,e._color)&&Y.equals(this._cellAlpha,e._cellAlpha)&&Y.equals(this._lineCount,e._lineCount)&&Y.equals(this._lineThickness,e._lineThickness)&&Y.equals(this._lineOffset,e._lineOffset)};var BE=FE;function kE(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(kE.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});kE.prototype.getType=function(e){return"PolylineArrow"};var c$e=new Z;kE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(c$e)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,H.WHITE,t.color),t};kE.prototype.equals=function(e){return this===e||e instanceof kE&&Y.equals(this._color,e._color)};var VE=kE;var l$e=H.WHITE,u$e=H.TRANSPARENT,f$e=16,d$e=255;function UE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(UE.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._gapColor)&&Y.isConstant(this._dashLength)&&Y.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});UE.prototype.getType=function(e){return"PolylineDash"};var h$e=new Z;UE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(h$e)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,l$e,t.color),t.gapColor=Y.getValueOrClonedDefault(this._gapColor,e,u$e,t.gapColor),t.dashLength=Y.getValueOrDefault(this._dashLength,e,f$e,t.dashLength),t.dashPattern=Y.getValueOrDefault(this._dashPattern,e,d$e,t.dashPattern),t};UE.prototype.equals=function(e){return this===e||e instanceof UE&&Y.equals(this._color,e._color)&&Y.equals(this._gapColor,e._gapColor)&&Y.equals(this._dashLength,e._dashLength)&&Y.equals(this._dashPattern,e._dashPattern)};var zE=UE;var m$e=H.WHITE,p$e=.25,_$e=1;function HE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(HE.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});HE.prototype.getType=function(e){return"PolylineGlow"};var g$e=new Z;HE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(g$e)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,m$e,t.color),t.glowPower=Y.getValueOrDefault(this._glowPower,e,p$e,t.glowPower),t.taperPower=Y.getValueOrDefault(this._taperPower,e,_$e,t.taperPower),t};HE.prototype.equals=function(e){return this===e||e instanceof HE&&Y.equals(this._color,e._color)&&Y.equals(this._glowPower,e._glowPower)&&Y.equals(this._taperPower,e._taperPower)};var GE=HE;var y$e=H.WHITE,x$e=H.BLACK,b$e=1;function WE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(WE.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._outlineColor)&&Y.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});WE.prototype.getType=function(e){return"PolylineOutline"};var T$e=new Z;WE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(T$e)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,y$e,t.color),t.outlineColor=Y.getValueOrClonedDefault(this._outlineColor,e,x$e,t.outlineColor),t.outlineWidth=Y.getValueOrDefault(this._outlineWidth,e,b$e),t};WE.prototype.equals=function(e){return this===e||e instanceof WE&&Y.equals(this._color,e._color)&&Y.equals(this._outlineColor,e._outlineColor)&&Y.equals(this._outlineWidth,e._outlineWidth)};var $y=WE;function H_(e,t){this._value=void 0,this._definitionChanged=new pe,this._eventHelper=new hr,this._referenceFrame=y(t,zi.FIXED),this.setValue(e)}Object.defineProperties(H_.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!Y.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var C$e=new Z;H_.prototype.getValue=function(e,t){return l(e)||(e=Z.now(C$e)),this.getValueInReferenceFrame(e,zi.FIXED,t)};H_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};H_.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,H_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};H_.prototype.equals=function(e){return this===e||e instanceof H_&&this._referenceFrame===e._referenceFrame&&Y.arrayEquals(this._value,e._value)};H_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var G_=H_;function Qy(e){this._value=void 0,this._definitionChanged=new pe,this._eventHelper=new hr,this.setValue(e)}Object.defineProperties(Qy.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!Y.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var A$e=new Z;Qy.prototype.getValue=function(e,t){l(e)||(e=Z.now(A$e));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};Qy.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Qy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Qy.prototype.equals=function(e){return this===e||e instanceof Qy&&Y.arrayEquals(this._value,e._value)};Qy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var jE=Qy;function Jb(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(Vu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function Vu(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new pe,e.collectionChanged.addEventListener(Vu.prototype._onCollectionChanged,this)}Object.defineProperties(Vu.prototype,{isConstant:{get:function(){return Y.isConstant(Jb(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Jb(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return Jb(this)}}});Vu.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new Vu(e,n,i)};var E$e=new Z;Vu.prototype.getValue=function(e,t){let n=Jb(this);return l(e)||(e=Z.now(E$e)),l(n)?n.getValue(e,t):void 0};Vu.prototype.getValueInReferenceFrame=function(e,t,n){let i=Jb(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Vu.prototype.getType=function(e){let t=Jb(this);return l(t)?t.getType(e):void 0};Vu.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};Vu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Vu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Vu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=Jb(this),l(i)&&this._definitionChanged.raiseEvent(this))};var W_=Vu;var S$e={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(n,e.length);let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-P.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+P.TWO_PI:o}},td=S$e;var Ode={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function Mde(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function Lde(e,t){return e instanceof Z?e:typeof e=="string"?Z.fromIso8601(e):Z.addSeconds(t,e,new Z)}var V7=[],U7=[];function Kz(e,t,n,i,o){let r=0,s,a,c,u,f,d;for(;r<i.length;){f=Lde(i[r],e),c=Mo(t,f,Z.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*o,a=void 0,d=t[c];r<i.length&&(f=Lde(i[r],e),!(l(a)&&Z.compare(a,f)>=0||l(d)&&Z.compare(f,d)>=0));){for(V7[p++]=f,r=r+1,s=0;s<o;s++)U7[g++]=i[r],r=r+1;a=f}p>0&&(U7.length=g,Mde(n,u,U7),V7.length=p,Mde(t,c,V7))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function nd(e,t){let n=e;n===Number&&(n=Ode);let i=n.packedLength,o=y(n.packedInterpolationLength,i),r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=Ode);let f=u.packedLength;i+=f,o+=y(u.packedInterpolationLength,f),s[c]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=$b,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new pe,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=ku.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=ku.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(nd.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var v$e=new Z;nd.prototype.getValue=function(e,t){l(e)||(e=Z.now(v$e));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Mo(n,e,Z.compare);if(a<0){if(a=~a,a===0){let E=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===ku.NONE||o!==0&&Z.secondsDifference(E,e)>o)return;if(this._backwardExtrapolationType===ku.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let E=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===ku.NONE||o!==0&&Z.secondsDifference(e,E)>o)return;if(this._forwardExtrapolationType===ku.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let E=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);E!==this._numberOfPoints&&(this._numberOfPoints=E,c.length=E,u.length=E*d)}let g=this._numberOfPoints-1;if(g<1)return;let m=0,x=i-1;if(x-m+1>=g+1){let E=a-(g/2|0)-1;E<m&&(E=m);let v=E+g;v>x&&(v=x,E=v-g,E<m&&(E=m)),m=E,x=v}let T=x-m+1;for(let E=0;E<T;++E)c[E]=Z.secondsDifference(n[m+E],n[x]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,m,x,u);else{let E=0,v=this._packedLength,D=m*v,O=(x+1)*v;for(;D<O;)u[E]=s[D],D++,E++}let C=Z.secondsDifference(e,n[x]),A;if(p===0||!l(f.interpolate))A=f.interpolateOrderZero(C,c,u,d,this._interpolationResult);else{let E=Math.floor(d/(p+1));A=f.interpolate(C,c,u,E,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(A,s,m,x,t):r.unpack(A,0,t)}return r.unpack(s,a*this._packedLength,t)};nd.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};nd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}Kz(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}Kz(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nd.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};nd.prototype.addSamplesPackedArray=function(e,t){Kz(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nd.prototype.removeSample=function(e){let t=Mo(this._times,e,Z.compare);return t<0?!1:(Nde(this,t,1),!0)};function Nde(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}nd.prototype.removeSamples=function(e){let t=this._times,n=Mo(t,e.start,Z.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Mo(t,e.stop,Z.compare);i<0?i=~i:e.isStopIncluded&&++i,Nde(this,n,i-n)};nd.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!Z.equals(a[r],c[r]))return!1;let u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};nd._mergeNewSamples=Kz;var Uu=nd;function id(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new Uu(h,n),this._definitionChanged=new pe,this._referenceFrame=y(e,zi.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(id.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var w$e=new Z;id.prototype.getValue=function(e,t){return l(e)||(e=Z.now(w$e)),this.getValueInReferenceFrame(e,zi.FIXED,t)};id.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Vd.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};id.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};id.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};id.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};id.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};id.prototype.removeSample=function(e){return this._property.removeSample(e)};id.prototype.removeSamples=function(e){this._property.removeSamples(e)};id.prototype.equals=function(e){return this===e||e instanceof id&&Y.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var ya=id;var D$e={HORIZONTAL:0,VERTICAL:1},bh=Object.freeze(D$e);var I$e=bh.HORIZONTAL,P$e=H.WHITE,R$e=H.BLACK,O$e=0,M$e=1;function qE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(qE.prototype,{isConstant:{get:function(){return Y.isConstant(this._orientation)&&Y.isConstant(this._evenColor)&&Y.isConstant(this._oddColor)&&Y.isConstant(this._offset)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});qE.prototype.getType=function(e){return"Stripe"};var L$e=new Z;qE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(L$e)),l(t)||(t={}),t.horizontal=Y.getValueOrDefault(this._orientation,e,I$e)===bh.HORIZONTAL,t.evenColor=Y.getValueOrClonedDefault(this._evenColor,e,P$e,t.evenColor),t.oddColor=Y.getValueOrClonedDefault(this._oddColor,e,R$e,t.oddColor),t.offset=Y.getValueOrDefault(this._offset,e,O$e),t.repeat=Y.getValueOrDefault(this._repeat,e,M$e),t};qE.prototype.equals=function(e){return this===e||e instanceof qE&&Y.equals(this._orientation,e._orientation)&&Y.equals(this._evenColor,e._evenColor)&&Y.equals(this._oddColor,e._oddColor)&&Y.equals(this._offset,e._offset)&&Y.equals(this._repeat,e._repeat)};var YE=qE;function Jy(e){this._definitionChanged=new pe,this._intervals=new jr,this._intervals.changedEvent.addEventListener(Jy.prototype._intervalsChanged,this),this._referenceFrame=y(e,zi.FIXED)}Object.defineProperties(Jy.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var N$e=new Z;Jy.prototype.getValue=function(e,t){return l(e)||(e=Z.now(N$e)),this.getValueInReferenceFrame(e,zi.FIXED,t)};Jy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Vd.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Jy.prototype.equals=function(e){return this===e||e instanceof Jy&&this._intervals.equals(e._intervals,Y.equals)&&this._referenceFrame===e._referenceFrame};Jy.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var j_=Jy;function eT(){this._definitionChanged=new pe,this._intervals=new jr,this._intervals.changedEvent.addEventListener(eT.prototype._intervalsChanged,this)}Object.defineProperties(eT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var F$e=new Z;eT.prototype.getValue=function(e,t){l(e)||(e=Z.now(F$e));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};eT.prototype.equals=function(e){return this===e||e instanceof eT&&this._intervals.equals(e._intervals,Y.equals)};eT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var q_=eT;function XE(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new pe,this._normalize=y(t,!0),this.position=e}Object.defineProperties(XE.prototype,{isConstant:{get:function(){return Y.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var B$e=new h,Fde=new h,Bde=new Z,k$e=new Z,z7=1/60;XE.prototype.getValue=function(e,t){return this._getValue(e,t)};XE.prototype._getValue=function(e,t,n){l(e)||(e=Z.now(k$e)),l(t)||(t=new h);let i=this._position;if(Y.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,B$e),r=i.getValue(Z.addSeconds(e,z7,Bde),Fde);if(!l(o)||!l(r)&&(r=o,o=i.getValue(Z.addSeconds(e,-z7,Bde),Fde),!l(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&o.clone(n);let s=h.subtract(r,o,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,z7,t)};XE.prototype.equals=function(e){return this===e||e instanceof XE&&Y.equals(this._position,e._position)};var Y_=XE;function rN(e,t){this._velocityVectorProperty=new Y_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new pe,this.ellipsoid=y(t,ee.default);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(rN.prototype,{isConstant:{get:function(){return Y.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var kde=new h,V$e=new h,Vde=new $,U$e=new Z;rN.prototype.getValue=function(e,t){l(e)||(e=Z.now(U$e));let n=this._velocityVectorProperty._getValue(e,V$e,kde);if(l(n))return Ot.rotationMatrixFromPositionVelocity(kde,n,this._ellipsoid,Vde),Oe.fromRotationMatrix(Vde,t)};rN.prototype.equals=function(e){return this===e||e instanceof rN&&Y.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var sN=rN;var X_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};X_.validate=function(e){return e===X_.COMPLETE||e===X_.BELOW_ELLIPSOID_HORIZON||e===X_.ABOVE_ELLIPSOID_HORIZON};X_.toString=function(e){switch(e){case X_.COMPLETE:return"COMPLETE";case X_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case X_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new he("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var KE=X_;function e0(){}e0.packedLength=h.packedLength;e0.unpack=h.unpack;e0.pack=h.pack;var H7;function aN(e,t){return t[0]==="#"&&(t=H7+t),W_.fromString(e,t)}function Ude(e,t,n){if(l(n.reference))return aN(t,n.reference);if(l(n.velocityReference)){let i=aN(t,n.velocityReference);switch(e){case h:case e0:return new Y_(i,e===e0);case Oe:return new sN(i)}}throw new re(`${JSON.stringify(n)} is not valid CZML.`)}function z$e(e,t){return new Gd(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var ji=new h,cl=new oN,Ec=new fe,tT=new An,Zz=new Oe;function H$e(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===H.packedLength)return[H.byteToFloat(n[0]),H.byteToFloat(n[1]),H.byteToFloat(n[2]),H.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=H.byteToFloat(n[o+1]),t[o+2]=H.byteToFloat(n[o+2]),t[o+3]=H.byteToFloat(n[o+3]),t[o+4]=H.byteToFloat(n[o+4]);return t}function zde(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):Se.createIfNeeded(n)}function G$e(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===se.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=P.toRadians(n[o+1]),t[o+2]=P.toRadians(n[o+2]),t[o+3]=P.toRadians(n[o+3]),t[o+4]=P.toRadians(n[o+4]);return t}function W$e(e){let t=e.length;if(cl.magnitude=1,t===2)return cl.clock=e[0],cl.cone=e[1],h.fromSpherical(cl,ji),[ji.x,ji.y,ji.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],cl.clock=e[i+1],cl.cone=e[i+2],h.fromSpherical(cl,ji),n[o+1]=ji.x,n[o+2]=ji.y,n[o+3]=ji.z;return n}function j$e(e){let t=e.length;if(t===3)return cl.clock=e[0],cl.cone=e[1],cl.magnitude=e[2],h.fromSpherical(cl,ji),[ji.x,ji.y,ji.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],cl.clock=e[i+1],cl.cone=e[i+2],cl.magnitude=e[i+3],h.fromSpherical(cl,ji),n[i+1]=ji.x,n[i+2]=ji.y,n[i+3]=ji.z;return n}function q$e(e){let t=e.length;if(t===3)return Ec.longitude=e[0],Ec.latitude=e[1],Ec.height=e[2],ee.default.cartographicToCartesian(Ec,ji),[ji.x,ji.y,ji.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ec.longitude=e[i+1],Ec.latitude=e[i+2],Ec.height=e[i+3],ee.default.cartographicToCartesian(Ec,ji),n[i+1]=ji.x,n[i+2]=ji.y,n[i+3]=ji.z;return n}function Y$e(e){let t=e.length;if(t===3)return Ec.longitude=P.toRadians(e[0]),Ec.latitude=P.toRadians(e[1]),Ec.height=e[2],ee.default.cartographicToCartesian(Ec,ji),[ji.x,ji.y,ji.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ec.longitude=P.toRadians(e[i+1]),Ec.latitude=P.toRadians(e[i+2]),Ec.height=e[i+3],ee.default.cartographicToCartesian(Ec,ji),n[i+1]=ji.x,n[i+2]=ji.y,n[i+3]=ji.z;return n}function G7(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return W$e(o);let r=e.spherical;if(l(r))return j$e(r);let s=e.cartographicRadians;if(l(s))return q$e(s);let a=e.cartographicDegrees;if(l(a))return Y$e(a);throw new re(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Hde(e,t){h.unpack(e,t,ji),h.normalize(ji,ji),h.pack(ji,e,t)}function X$e(e){let t=G7(e);if(t.length===3)return Hde(t,0),t;for(let n=1;n<t.length;n+=4)Hde(t,n);return t}function Gde(e,t){Oe.unpack(e,t,Zz),Oe.normalize(Zz,Zz),Oe.pack(Zz,e,t)}function K$e(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return Gde(t,0),t;for(let n=1;n<t.length;n+=5)Gde(t,n)}return t}function Wde(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?je:e.hasOwnProperty("cartesian2")?z:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?e0:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?H:e.hasOwnProperty("arcType")?Qt:e.hasOwnProperty("classificationType")?kn:e.hasOwnProperty("colorBlendMode")?pc:e.hasOwnProperty("cornerType")?Ni:e.hasOwnProperty("heightReference")?Ye:e.hasOwnProperty("horizontalOrigin")?yi:e.hasOwnProperty("date")?Z:e.hasOwnProperty("labelStyle")?qo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Bt:e.hasOwnProperty("distanceDisplayCondition")?Mt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Oe:e.hasOwnProperty("shadowMode")?yn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?bh:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?se:e.hasOwnProperty("uri")?lN.default:e.hasOwnProperty("verticalOrigin")?Rn:Object}function Z$e(e,t,n){switch(e){case Qt:return Qt[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case je:return t.boundingRectangle;case z:return t.cartesian2;case h:return G7(t);case e0:return X$e(t);case H:return H$e(t);case kn:return kn[y(t.classificationType,t)];case pc:return pc[y(t.colorBlendMode,t)];case Ni:return Ni[y(t.cornerType,t)];case Ye:return Ye[y(t.heightReference,t)];case yi:return yi[y(t.horizontalOrigin,t)];case Image:return zde(t,n);case Z:return Z.fromIso8601(y(t.date,t));case qo:return qo[y(t.labelStyle,t)];case Number:return y(t.number,t);case Bt:return t.nearFarScalar;case Mt:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case Oe:return K$e(t);case td:return y(t.number,t);case KE:return KE[y(t.portionToDisplay,t)];case yn:return yn[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case bh:return bh[y(t.stripeOrientation,t)];case se:return G$e(t);case lN.default:return zde(t,n);case Rn:return Rn[y(t.verticalOrigin,t)];default:throw new re(`Unknown CzmlDataSource interval type: ${e}`)}}var $$e={HERMITE:nN,LAGRANGE:iN,LINEAR:$b};function $z(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:$$e[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=ku[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=ku[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var jde={iso8601:void 0};function mr(e){if(l(e))return jde.iso8601=e,An.fromIso8601(jde)}function W7(e){let t=He.MAXIMUM_INTERVAL.clone();return t.data=e,t}function qde(e){let t=new Tc;return t.intervals.addInterval(W7(e)),t}function Yde(e){let t=new _a(e.referenceFrame);return t.intervals.addInterval(W7(e)),t}function Qz(e,t,n,i,o,r,s){let a=mr(i.interval);l(o)&&(l(a)?a=An.intersect(a,o,tT):a=o);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(He.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return ohe(t[n],a)}let g=!1;if(d){if(u=Z$e(e,i,r),!l(u))return;c=y(e.packedLength,1),f=y(u.length,1),g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==td;if(!g&&!p){d?t[n]=new Kn(m?e.unpack(u,0):u):t[n]=Ude(e,s,i);return}let x=t[n],b,T=i.epoch;if(l(T)&&(b=Z.fromIso8601(T)),g&&!p){x instanceof Uu||(t[n]=x=new Uu(e)),x.addSamplesPackedArray(u,b),$z(i,x);return}let C;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=Ude(e,s,i),l(x)||(t[n]=x=d?new q_:new Tc),d&&x instanceof q_?x.intervals.addInterval(a):x instanceof Tc?(d&&(a.data=new Kn(a.data)),x.intervals.addInterval(a)):(t[n]=x=qde(x),d&&(a.data=new Kn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new Tc),x instanceof Tc||(t[n]=x=qde(x));let A=x.intervals;C=A.findInterval(a),(!l(C)||!(C.data instanceof Uu))&&(C=a.clone(),C.data=new Uu(e),A.addInterval(C)),C.data.addSamplesPackedArray(u,b),$z(i,C.data)}function ohe(e,t){if(e instanceof Uu){e.removeSamples(t);return}else if(e instanceof q_){e.intervals.removeInterval(t);return}else if(e instanceof Tc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=An.intersect(n.get(i),t,tT);o.isEmpty||ohe(o.data,t)}n.removeInterval(t);return}}function ye(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)Qz(e,t,n,i[a],o,r,s);else Qz(e,t,n,i,o,r,s)}function Xde(e,t,n,i,o,r){let s=mr(n.interval);l(i)&&(l(s)?s=An.intersect(s,i,tT):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(He.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return rhe(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=zi[n.referenceFrame]),g=y(g,zi.FIXED),u=G7(n),f=y(u.length,1),m=f>c),!m&&!p){d?e[t]=new qc(h.unpack(u),g):e[t]=aN(r,n.reference);return}let x=e[t],b,T=n.epoch;if(l(T)&&(b=Z.fromIso8601(T)),m&&!p){(!(x instanceof ya)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new ya(g,a)),x.addSamplesPackedArray(u,b),$z(n,x);return}let C;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=aN(r,n.reference),l(x)||(d?x=new j_(g):x=new _a(g),e[t]=x),d&&x instanceof j_&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof _a?(d&&(s.data=new qc(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=Yde(x),d&&(s.data=new qc(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof _a||(e[t]=x=Yde(x)):e[t]=x=new _a(g);let A=x.intervals;C=A.findInterval(s),(!l(C)||!(C.data instanceof ya)||l(g)&&C.data.referenceFrame!==g)&&(C=s.clone(),C.data=new ya(g,a),A.addInterval(C)),C.data.addSamplesPackedArray(u,b),$z(n,C.data)}function rhe(e,t){if(e instanceof ya){e.removeSamples(t);return}else if(e instanceof j_){e.intervals.removeInterval(t);return}else if(e instanceof _a){let n=e.intervals;for(let i=0;i<n.length;++i){let o=An.intersect(n.get(i),t,tT);o.isEmpty||rhe(o.data,t)}n.removeInterval(t);return}}function she(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Xde(e,t,n[s],i,o,r);else Xde(e,t,n,i,o,r)}function Kde(e,t,n,i){l(n.references)?Jz(e,t,n.references,n.interval,i,jE,Tc):(l(n.cartesian2)?n.array=z.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=z.unpackArray(n.cartesian)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i))}function Zde(e,t,n,i,o,r){let s=mr(n.interval);l(i)&&(l(s)?s=An.intersect(s,i,tT):s=i);let a=e[t],c,u;if(l(s)){a instanceof wE||(a=new wE,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Ut||(c=new Ut),f=n.solidColor,ye(H,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof BE||(c=new BE),f=n.grid,ye(H,c,"color",f.color,void 0,o,r),ye(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),ye(z,c,"lineCount",f.lineCount,void 0,o,r),ye(z,c,"lineThickness",f.lineThickness,void 0,o,r),ye(z,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Qg||(c=new Qg),f=n.image,ye(Image,c,"image",f.image,void 0,o,r),ye(z,c,"repeat",f.repeat,void 0,o,r),ye(H,c,"color",f.color,void 0,o,r),ye(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof YE||(c=new YE),f=n.stripe,ye(bh,c,"orientation",f.orientation,void 0,o,r),ye(H,c,"evenColor",f.evenColor,void 0,o,r),ye(H,c,"oddColor",f.oddColor,void 0,o,r),ye(Number,c,"offset",f.offset,void 0,o,r),ye(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof $y||(c=new $y),f=n.polylineOutline,ye(H,c,"color",f.color,void 0,o,r),ye(H,c,"outlineColor",f.outlineColor,void 0,o,r),ye(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof GE||(c=new GE),f=n.polylineGlow,ye(H,c,"color",f.color,void 0,o,r),ye(Number,c,"glowPower",f.glowPower,void 0,o,r),ye(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof VE||(c=new VE),f=n.polylineArrow,ye(H,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof zE||(c=new zE),f=n.polylineDash,ye(H,c,"color",f.color,void 0,void 0,r),ye(H,c,"gapColor",f.gapColor,void 0,void 0,r),ye(Number,c,"dashLength",f.dashLength,void 0,o,r),ye(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof SE||(c=new SE),f=n.checkerboard,ye(H,c,"evenColor",f.evenColor,void 0,o,r),ye(H,c,"oddColor",f.oddColor,void 0,o,r),ye(z,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function zu(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Zde(e,t,n[s],i,o,r);else Zde(e,t,n,i,o,r)}function Q$e(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function J$e(e,t,n,i){let o=t.description;l(o)&&ye(String,e,"description",o,void 0,i,n)}function eQe(e,t,n,i){let o=t.position;l(o)&&she(e,"position",o,void 0,i,n)}function tQe(e,t,n,i){let o=t.viewFrom;l(o)&&ye(h,e,"viewFrom",o,void 0,i,n)}function nQe(e,t,n,i){let o=t.orientation;l(o)&&ye(Oe,e,"orientation",o,void 0,i,n)}function iQe(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Xc);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)Qz(Wde(s[a]),e.properties,r,s[a],void 0,i,n);else Qz(Wde(s),e.properties,r,s,void 0,i,n)}}}function Jz(e,t,n,i,o,r,s){let a=n.map(function(c){return aN(o,c)});if(l(i)){i=mr(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(W7(c)),e[t]=c=u}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function $de(e,t,n,i){let o=n.references;l(o)?Jz(e,t,o,n.interval,i,jE,Tc):ye(Array,e,t,n,void 0,void 0,i)}function Qde(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)$de(e,t,n[o],i);else $de(e,t,n,i)}function Jde(e,t,n,i){let o=n.references;l(o)?Jz(e,t,o,n.interval,i,G_,_a):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ee.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ee.default)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i))}function uN(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Jde(e,t,n[o],i);else Jde(e,t,n,i)}function oQe(e){return h.unpackArray(e)}function rQe(e){return h.fromRadiansArrayHeights(e,ee.default)}function sQe(e){return h.fromDegreesArrayHeights(e,ee.default)}function ehe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return Jz(a,"positions",s,n.interval,i,G_,_a),a.positions});e[t]=new G_(r)}else l(n.cartesian)?n.array=n.cartesian.map(oQe):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(rQe):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(sQe)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i)}function aQe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)ehe(e,t,n[o],i);else ehe(e,t,n,i)}function cQe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Kde(e,t,n[o],i);else Kde(e,t,n,i)}function lQe(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new jr),r.addInterval(mr(o[s]));else r=new jr,r.addInterval(mr(o));e.availability=r}function uQe(e,t,n,i,o){l(t)&&ye(e0,e,"alignedAxis",t,n,i,o)}function fQe(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=mr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new ac),ye(Boolean,s,"show",o.show,r,i,n),ye(Image,s,"image",o.image,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(z,s,"pixelOffset",o.pixelOffset,r,i,n),ye(h,s,"eyeOffset",o.eyeOffset,r,i,n),ye(yi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ye(Rn,s,"verticalOrigin",o.verticalOrigin,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(H,s,"color",o.color,r,i,n),ye(td,s,"rotation",o.rotation,r,i,n),uQe(s,o.alignedAxis,r,i,n),ye(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ye(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ye(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ye(je,s,"imageSubRegion",o.imageSubRegion,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function dQe(e,t,n,i){let o=t.box;if(!l(o))return;let r=mr(o.interval),s=e.box;l(s)||(e.box=s=new Lx),ye(Boolean,s,"show",o.show,r,i,n),ye(h,s,"dimensions",o.dimensions,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function hQe(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=mr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new Fx),ye(Boolean,s,"show",o.show,r,i,n),uN(s,"positions",o.positions,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(Ni,s,"cornerType",o.cornerType,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(kn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function mQe(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=mr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new Bx),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"length",o.length,r,i,n),ye(Number,s,"topRadius",o.topRadius,r,i,n),ye(Number,s,"bottomRadius",o.bottomRadius,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ye(Number,s,"slices",o.slices,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function pQe(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new re("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new re("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function _Qe(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=mr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new kx),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),ye(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(td,s,"rotation",o.rotation,r,i,n),ye(td,s,"stRotation",o.stRotation,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(kn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function gQe(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=mr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Vx),ye(Boolean,s,"show",o.show,r,i,n),ye(h,s,"radii",o.radii,r,i,n),ye(h,s,"innerRadii",o.innerRadii,r,i,n),ye(Number,s,"minimumClock",o.minimumClock,r,i,n),ye(Number,s,"maximumClock",o.maximumClock,r,i,n),ye(Number,s,"minimumCone",o.minimumCone,r,i,n),ye(Number,s,"maximumCone",o.maximumCone,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"stackPartitions",o.stackPartitions,r,i,n),ye(Number,s,"slicePartitions",o.slicePartitions,r,i,n),ye(Number,s,"subdivisions",o.subdivisions,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function yQe(e,t,n,i){let o=t.label;if(!l(o))return;let r=mr(o.interval),s=e.label;l(s)||(e.label=s=new Ud),ye(Boolean,s,"show",o.show,r,i,n),ye(String,s,"text",o.text,r,i,n),ye(String,s,"font",o.font,r,i,n),ye(qo,s,"style",o.style,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(Boolean,s,"showBackground",o.showBackground,r,i,n),ye(H,s,"backgroundColor",o.backgroundColor,r,i,n),ye(z,s,"backgroundPadding",o.backgroundPadding,r,i,n),ye(z,s,"pixelOffset",o.pixelOffset,r,i,n),ye(h,s,"eyeOffset",o.eyeOffset,r,i,n),ye(yi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ye(Rn,s,"verticalOrigin",o.verticalOrigin,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(H,s,"fillColor",o.fillColor,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ye(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ye(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function xQe(e,t,n,i){let o=t.model;if(!l(o))return;let r=mr(o.interval),s=e.model;l(s)||(e.model=s=new zp),ye(Boolean,s,"show",o.show,r,i,n),ye(lN.default,s,"uri",o.gltf,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),ye(Number,s,"maximumScale",o.maximumScale,r,i,n),ye(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),ye(Boolean,s,"runAnimations",o.runAnimations,r,i,n),ye(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(H,s,"silhouetteColor",o.silhouetteColor,r,i,n),ye(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),ye(H,s,"color",o.color,r,i,n),ye(pc,s,"colorBlendMode",o.colorBlendMode,r,i,n),ye(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)the(s,u[a],r,i,n);else the(s,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)nhe(s,f[a],r,i,n);else nhe(s,f,r,i,n)}function the(e,t,n,i,o){let r=mr(t.interval);l(n)&&(l(r)?r=An.intersect(r,n,tT):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new Xc),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new Ux),ye(h,p,"translation",d.translation,r,i,o),ye(Oe,p,"rotation",d.rotation,r,i,o),ye(h,p,"scale",d.scale,r,i,o)}}function nhe(e,t,n,i,o){let r=mr(t.interval);l(n)&&(l(r)?r=An.intersect(r,n,tT):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new Xc),s.hasProperty(f)||s.addProperty(f),ye(Number,s,f,d,r,i,o))}}function bQe(e,t,n,i){let o=t.path;if(!l(o))return;let r=mr(o.interval),s=e.path;l(s)||(e.path=s=new Hp),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"leadTime",o.leadTime,r,i,n),ye(Number,s,"trailTime",o.trailTime,r,i,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"resolution",o.resolution,r,i,n),zu(s,"material",o.material,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function TQe(e,t,n,i){let o=t.point;if(!l(o))return;let r=mr(o.interval),s=e.point;l(s)||(e.point=s=new Hx),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"pixelSize",o.pixelSize,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(H,s,"color",o.color,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ye(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function cN(e){this.polygon=e,this._definitionChanged=new pe}Object.defineProperties(cN.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});cN.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new Na(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Na(n,i)};cN.prototype.equals=function(e){return this===e||e instanceof cN&&Y.equals(this.polygon._positions,e.polygon._positions)&&Y.equals(this.polygon._holes,e.polygon._holes)};function CQe(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=mr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new zd),ye(Boolean,s,"show",o.show,r,i,n),uN(s,"_positions",o.positions,n),aQe(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new cN(s)),ye(Number,s,"height",o.height,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(td,s,"stRotation",o.stRotation,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),ye(Boolean,s,"closeTop",o.closeTop,r,i,n),ye(Boolean,s,"closeBottom",o.closeBottom,r,i,n),ye(Qt,s,"arcType",o.arcType,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(kn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function AQe(e){return e?Qt.GEODESIC:Qt.NONE}function EQe(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=mr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new uc),ye(Boolean,s,"show",o.show,r,i,n),uN(s,"positions",o.positions,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),zu(s,"material",o.material,r,i,n),zu(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),ye(Qt,s,"arcType",o.arcType,r,i,n),ye(Boolean,s,"clampToGround",o.clampToGround,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(kn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};ye(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=z$e(a.followSurface,AQe)}}function SQe(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=mr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new Gx),uN(s,"positions",o.positions,n),cQe(s,"shape",o.shape,n),ye(Boolean,s,"show",o.show,r,i,n),ye(Ni,s,"cornerType",o.cornerType,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function vQe(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=mr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Hd),ye(Boolean,s,"show",o.show,r,i,n),ye(se,s,"coordinates",o.coordinates,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(td,s,"rotation",o.rotation,r,i,n),ye(td,s,"stRotation",o.stRotation,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(kn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function wQe(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=mr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new zx),ye(Boolean,s,"show",o.show,r,i,n),ye(lN.default,s,"uri",o.uri,r,i,n),ye(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function DQe(e,t,n,i){let o=t.wall;if(!l(o))return;let r=mr(o.interval),s=e.wall;l(s)||(e.wall=s=new Gp),ye(Boolean,s,"show",o.show,r,i,n),uN(s,"positions",o.positions,n),Qde(s,"minimumHeights",o.minimumHeights,n),Qde(s,"maximumHeights",o.maximumHeights,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(H,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(yn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function ihe(e,t,n,i,o){let r=e.id;if(l(r)||(r=zn()),H7=r,!l(o._version)&&r!=="document")throw new re("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")pQe(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}H7=void 0}function IQe(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(He.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Z.secondsDifference(s,r),c=Math.round(a/120);return t=new xh,t.startTime=Z.clone(r),t.stopTime=Z.clone(s),t.clockRange=Yr.LOOP_STOP,t.multiplier=c,t.currentTime=Z.clone(r),t.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new xh,t.startTime=He.MINIMUM_VALUE.clone(),t.stopTime=He.MAXIMUM_VALUE.clone(),t.currentTime=He.MINIMUM_VALUE.clone(),t.clockRange=Yr.LOOP_STOP,t.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=mr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=Z.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Yr[n.range],Yr.LOOP_STOP)),l(n.step)&&(t.clockStep=y(_o[n.step],_o.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function ahe(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new bt(s)),e._credit=s,typeof t=="string"||t instanceof Se){t=Se.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return r=Se.createIfNeeded(r),qr.setLoading(e,!0),Promise.resolve(o).then(function(a){return PQe(e,a,r,i)}).catch(function(a){return qr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function PQe(e,t,n,i){qr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new che,o.removeAll()),bs._processCzml(t,o,n,void 0,e);let r=IQe(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=z_(n.getUrlComponent()),r=!0),qr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function che(){this.name=void 0,this.clock=void 0}function bs(e){this._name=e,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._clock=void 0,this._documentPacket=new che,this._version=void 0,this._entityCollection=new $s(this),this._entityCluster=new Fu,this._credit=void 0,this._resourceCredits=[]}bs.load=function(e,t){return new bs().load(e,t)};Object.defineProperties(bs.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});bs.updaters=[fQe,dQe,hQe,mQe,_Qe,gQe,yQe,xQe,Q$e,J$e,bQe,TQe,CQe,EQe,SQe,iQe,vQe,eQe,wQe,tQe,DQe,nQe,lQe];bs.registerUpdater=function(e){bs.updaters.includes(e)||bs.updaters.push(e)};bs.unregisterUpdater=function(e){if(bs.updaters.includes(e)){let t=bs.updaters.indexOf(e);bs.updaters.splice(t,1)}};bs.prototype.process=function(e,t){return ahe(this,e,t,!1)};bs.prototype.load=function(e,t){return ahe(this,e,t,!0)};bs.prototype.update=function(e){return!0};bs.processPacketData=ye;bs.processPositionPacketData=she;bs.processMaterialPacketData=zu;bs._processCzml=function(e,t,n,i,o){if(i=y(i,bs.updaters),Array.isArray(e))for(let r=0,s=e.length;r<s;++r)ihe(e[r],t,i,n,o);else ihe(e,t,i,n,o)};var fN=bs;function ll(){this._dataSources=[],this._dataSourceAdded=new pe,this._dataSourceRemoved=new pe,this._dataSourceMoved=new pe}Object.defineProperties(ll.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});ll.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};ll.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};ll.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};ll.prototype.contains=function(e){return this.indexOf(e)!==-1};ll.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};ll.prototype.get=function(e){return this._dataSources[e]};ll.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function e4(e,t){return e.indexOf(t)}function lhe(e,t,n){let i=e._dataSources,o=i.length-1;if(t=P.clamp(t,0,o),n=P.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}ll.prototype.raise=function(e){let t=e4(this._dataSources,e);lhe(this,t,t+1)};ll.prototype.lower=function(e){let t=e4(this._dataSources,e);lhe(this,t,t-1)};ll.prototype.raiseToTop=function(e){let t=e4(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};ll.prototype.lowerToBottom=function(e){let t=e4(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};ll.prototype.isDestroyed=function(){return!1};ll.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var dN=ll;function xa(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=zn(),this._primitiveAdded=new pe,this._primitiveRemoved=new pe,this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(xa.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});xa.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e};xa.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};xa.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};xa.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};xa.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function t4(e,t){return e._primitives.indexOf(t)}xa.prototype.raise=function(e){if(l(e)){let t=t4(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};xa.prototype.raiseToTop=function(e){if(l(e)){let t=t4(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};xa.prototype.lower=function(e){if(l(e)){let t=t4(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};xa.prototype.lowerToBottom=function(e){if(l(e)){let t=t4(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};xa.prototype.get=function(e){return this._primitives[e]};xa.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};xa.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};xa.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};xa.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};xa.prototype.isDestroyed=function(){return!1};xa.prototype.destroy=function(){return this.removeAll(),ue(this)};var Yl=xa;function Om(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Om.prototype,{length:{get:function(){return this._length}}});Om.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new Yl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};Om.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Om.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};Om.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};Om.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Om.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Om.prototype.isDestroyed=function(){return!1};Om.prototype.destroy=function(){return this.removeAll(),ue(this)};var hN=Om;function ZE(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Et}ZE.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};ZE.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};ZE.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};ZE.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};ZE.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):at.FAILED};var nT=ZE;var q7={},n4=new h,uhe=new h,fhe=new Oe,dhe=new $;function $E(e,t,n,i,o,r,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),n4),h.multiplyByScalar(n,Math.sin(f),uhe),h.add(n4,uhe,n4);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(s*d+o*p)/a;return Oe.fromAxisAngle(n4,m,fhe),$.fromQuaternion(fhe,dhe),$.multiplyByVector(dhe,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var hhe=new h,mhe=new h,j7=new h,RQe=new h;q7.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,hhe);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,mhe),x=i.geodeticSurfaceNormal(g,RQe),b=h.multiplyByScalar(x,o,j7);h.add(g,b,g),n&&(h.multiplyByScalar(x,r,b),h.add(m,b,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var OQe=new h,MQe=new h,LQe=new h;q7.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=o*o,f=o*i,d=h.magnitude(s),p=h.normalize(s,OQe),g=h.cross(h.UNIT_Z,s,MQe);g=h.normalize(g,g);let m=h.cross(p,g,LQe),x=1+Math.ceil(P.PI_OVER_TWO/a),b=P.PI_OVER_TWO/(x-1),T=P.PI_OVER_TWO-x*b;T<0&&(x-=Math.ceil(Math.abs(T)/b));let C=2*(x*(x+2)),A=t?new Array(C*3):void 0,E=0,v=hhe,D=mhe,O=x*4*3,R=O-1,M=0,N=n?new Array(O):void 0,_,S,w,I,L;for(T=P.PI_OVER_TWO,v=$E(T,r,m,g,c,f,u,d,p,v),t&&(A[E++]=v.x,A[E++]=v.y,A[E++]=v.z),n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x),T=P.PI_OVER_TWO-b,_=1;_<x+1;++_){if(v=$E(T,r,m,g,c,f,u,d,p,v),D=$E(Math.PI-T,r,m,g,c,f,u,d,p,D),t){for(A[E++]=v.x,A[E++]=v.y,A[E++]=v.z,w=2*_+2,S=1;S<w-1;++S)I=S/(w-1),L=h.lerp(v,D,I,j7),A[E++]=L.x,A[E++]=L.y,A[E++]=L.z;A[E++]=D.x,A[E++]=D.y,A[E++]=D.z}n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x,N[M++]=D.x,N[M++]=D.y,N[M++]=D.z),T=P.PI_OVER_TWO-(_+1)*b}for(_=x;_>1;--_){if(T=P.PI_OVER_TWO-(_-1)*b,v=$E(-T,r,m,g,c,f,u,d,p,v),D=$E(T+Math.PI,r,m,g,c,f,u,d,p,D),t){for(A[E++]=v.x,A[E++]=v.y,A[E++]=v.z,w=2*(_-1)+2,S=1;S<w-1;++S)I=S/(w-1),L=h.lerp(v,D,I,j7),A[E++]=L.x,A[E++]=L.y,A[E++]=L.z;A[E++]=D.x,A[E++]=D.y,A[E++]=D.z}n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x,N[M++]=D.x,N[M++]=D.y,N[M++]=D.z)}T=P.PI_OVER_TWO,v=$E(-T,r,m,g,c,f,u,d,p,v);let B={};return t&&(A[E++]=v.x,A[E++]=v.y,A[E++]=v.z,B.positions=A,B.numPts=x),n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x,B.outerPositions=N),B};var Xl=q7;var QE=new h,Y7=new h,X7=new h,phe=new h,Rs=new z,_he=new $,NQe=new $,K7=new Oe,ghe=new h,yhe=new h,xhe=new h,r4=new fe,bhe=new h,The=new z,Che=new z;function Ahe(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,x=f?new Float32Array(u*3):void 0,b=0,T=ghe,C=yhe,A=xhe,E=new Pi(a),v=E.project(a.cartesianToCartographic(o,r4),bhe),D=a.scaleToGeodeticSurface(o,QE);a.geodeticSurfaceNormal(D,D);let O=_he,R=NQe;if(c!==0){let L=Oe.fromAxisAngle(D,c,K7);O=$.fromQuaternion(L,O),L=Oe.fromAxisAngle(D,-c,K7),R=$.fromQuaternion(L,R)}else O=$.clone($.IDENTITY,O),R=$.clone($.IDENTITY,R);let M=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,The),N=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Che),_=e.length,S=n?_:0,w=S/3*2;for(let L=0;L<_;L+=3){let B=L+1,U=L+2,V=h.fromArray(e,L,QE);if(i.st){let G=$.multiplyByVector(O,V,Y7),k=E.project(a.cartesianToCartographic(G,r4),X7);h.subtract(k,v,k),Rs.x=(k.x+r)/(2*r),Rs.y=(k.y+s)/(2*s),M.x=Math.min(Rs.x,M.x),M.y=Math.min(Rs.y,M.y),N.x=Math.max(Rs.x,N.x),N.y=Math.max(Rs.y,N.y),n&&(d[b+w]=Rs.x,d[b+1+w]=Rs.y),d[b++]=Rs.x,d[b++]=Rs.y}(i.normal||i.tangent||i.bitangent||f)&&(T=a.geodeticSurfaceNormal(V,T),f&&(x[L+S]=-T.x,x[B+S]=-T.y,x[U+S]=-T.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(C=h.normalize(h.cross(h.UNIT_Z,T,C),C),$.multiplyByVector(R,C,C)),i.normal&&(p[L]=T.x,p[B]=T.y,p[U]=T.z,n&&(p[L+S]=-T.x,p[B+S]=-T.y,p[U+S]=-T.z)),i.tangent&&(g[L]=C.x,g[B]=C.y,g[U]=C.z,n&&(g[L+S]=-C.x,g[B+S]=-C.y,g[U+S]=-C.z)),i.bitangent&&(A=h.normalize(h.cross(T,C,A),A),m[L]=A.x,m[B]=A.y,m[U]=A.z,n&&(m[L+S]=A.x,m[B+S]=A.y,m[U+S]=A.z))))}if(i.st){_=d.length;for(let L=0;L<_;L+=2)d[L]=(d[L]-M.x)/(N.x-M.x),d[L+1]=(d[L+1]-M.y)/(N.y-M.y)}let I=new un;if(i.position){let L=Xl.raisePositionsToHeight(e,t,n);I.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:L})}if(i.st&&(I.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(I.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let L=new Uint8Array(u);if(t.offsetAttribute===on.TOP)L=L.fill(1,0,u/2);else{let B=t.offsetAttribute===on.NONE?0:1;L=L.fill(B)}I.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}return I}function Ehe(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var iT=new h;function FQe(e){let t=e.center;iT=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,iT),e.height,iT),iT=h.add(t,iT,iT);let n=new ae(iT,e.semiMajorAxis),i=Xl.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Ahe(o,e,!1),a=Ehe(r);return a=Ne.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function BQe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,x=n.bitangent?new Float32Array(f*3):void 0,b=t.shadowVolume,T=b?new Float32Array(f*3):void 0,C=0,A=ghe,E=yhe,v=xhe,D=new Pi(s),O=D.project(s.cartesianToCartographic(i,r4),bhe),R=s.scaleToGeodeticSurface(i,QE);s.geodeticSurfaceNormal(R,R);let M=Oe.fromAxisAngle(R,u,K7),N=$.fromQuaternion(M,_he),_=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,The),S=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Che),w=e.length,I=w/3*2;for(let B=0;B<w;B+=3){let U=B+1,V=B+2,G=h.fromArray(e,B,QE),k;if(n.st){let q=$.multiplyByVector(N,G,Y7),J=D.project(s.cartesianToCartographic(q,r4),X7);h.subtract(J,O,J),Rs.x=(J.x+o)/(2*o),Rs.y=(J.y+r)/(2*r),_.x=Math.min(Rs.x,_.x),_.y=Math.min(Rs.y,_.y),S.x=Math.max(Rs.x,S.x),S.y=Math.max(Rs.y,S.y),p[C+I]=Rs.x,p[C+1+I]=Rs.y,p[C++]=Rs.x,p[C++]=Rs.y}G=s.scaleToGeodeticSurface(G,G),k=h.clone(G,Y7),A=s.geodeticSurfaceNormal(G,A),b&&(T[B+w]=-A.x,T[U+w]=-A.y,T[V+w]=-A.z);let W=h.multiplyByScalar(A,a,phe);if(G=h.add(G,W,G),W=h.multiplyByScalar(A,c,W),k=h.add(k,W,k),n.position&&(d[B+w]=k.x,d[U+w]=k.y,d[V+w]=k.z,d[B]=G.x,d[U]=G.y,d[V]=G.z),n.normal||n.tangent||n.bitangent){v=h.clone(A,v);let q=h.fromArray(e,(B+3)%w,phe);h.subtract(q,G,q);let J=h.subtract(k,G,X7);A=h.normalize(h.cross(J,q,A),A),n.normal&&(g[B]=A.x,g[U]=A.y,g[V]=A.z,g[B+w]=A.x,g[U+w]=A.y,g[V+w]=A.z),n.tangent&&(E=h.normalize(h.cross(v,A,E),E),m[B]=E.x,m[U]=E.y,m[V]=E.z,m[B+w]=E.x,m[B+1+w]=E.y,m[B+2+w]=E.z),n.bitangent&&(x[B]=v.x,x[U]=v.y,x[V]=v.z,x[B+w]=v.x,x[U+w]=v.y,x[V+w]=v.z)}}if(n.st){w=p.length;for(let B=0;B<w;B+=2)p[B]=(p[B]-_.x)/(S.x-_.x),p[B+1]=(p[B+1]-_.y)/(S.y-_.y)}let L=new un;if(n.position&&(L.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(L.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(L.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(L.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(L.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),b&&(L.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),l(t.offsetAttribute)){let B=new Uint8Array(f);if(t.offsetAttribute===on.TOP)B=B.fill(1,0,f/2);else{let U=t.offsetAttribute===on.NONE?0:1;B=B.fill(U)}L.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return L}function kQe(e){let t=e.length/3,n=Ne.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var i4=new ae,o4=new ae;function VQe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,QE),e.height,QE);i4.center=h.add(t,o,i4.center),i4.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),o4.center=h.add(t,o,o4.center),o4.radius=i;let r=Xl.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,u=ae.union(i4,o4),f=Ahe(s,e,!0),d=Ehe(a),p=d.length;d.length=p*2;let g=s.length/3;for(let E=0;E<p;E+=3)d[E+p]=d[E+2]+g,d[E+1+p]=d[E+1]+g,d[E+2+p]=d[E]+g;let m=Ne.createTypedArray(g*2/3,d),x=new st({attributes:f,indices:m,primitiveType:Me.TRIANGLES}),b=BQe(c,e);d=kQe(c);let T=Ne.createTypedArray(c.length*2/3,d),C=new st({attributes:b,indices:T,primitiveType:Me.TRIANGLES}),A=Ln.combineInstances([new St({geometry:x}),new St({geometry:C})]);return{boundingSphere:u,attributes:A[0].attributes,indices:A[0].indices}}function She(e,t,n,i,o,r,s){let c=Xl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=se.fromCartesianArray(f,r,s);return d.width>P.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function Lm(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ee.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Ie.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ee.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Ie.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Lm.packedLength=h.packedLength+ee.packedLength+Ie.packedLength+9;Lm.pack=function(e,t,n){return n=y(n,0),h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var vhe=new h,whe=new ee,Dhe=new Ie,Mm={center:vhe,ellipsoid:whe,vertexFormat:Dhe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Lm.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,vhe);t+=h.packedLength;let o=ee.unpack(e,t,whe);t+=ee.packedLength;let r=Ie.unpack(e,t,Dhe);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(Mm.height=f,Mm.extrudedHeight=p,Mm.granularity=d,Mm.stRotation=u,Mm.rotation=c,Mm.semiMajorAxis=s,Mm.semiMinorAxis=a,Mm.shadowVolume=g,Mm.offsetAttribute=m===-1?void 0:m,new Lm(Mm))};Lm.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,ee.default),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,P.RADIANS_PER_DEGREE),a=y(e.rotation,0);return She(n,o,r,a,s,i,t)};Lm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=VQe(o);else if(r=FQe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===on.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new st({attributes:r.attributes,indices:r.indices,primitiveType:Me.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Lm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Lm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};function UQe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Xl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return st._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(Lm.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=She(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=UQe(this)),this._textureCoordinateRotationPoints}}});var ul=Lm;var Ihe=new h,oT=new h;function zQe(e){let t=e.center;oT=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,oT),e.height,oT),oT=h.add(t,oT,oT);let n=new ae(oT,e.semiMajorAxis),i=Xl.computeEllipsePositions(e,!1,!0).outerPositions,o=new un({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Xl.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ne.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var s4=new ae,a4=new ae;function HQe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,Ihe),e.height,Ihe);s4.center=h.add(t,o,s4.center),s4.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),a4.center=h.add(t,o,a4.center),a4.radius=i;let r=Xl.computeEllipsePositions(e,!1,!0).outerPositions,s=new un({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Xl.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ae.union(s4,a4),c=r.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===on.TOP)m=m.fill(1,0,c/2);else{let x=e.offsetAttribute===on.NONE?0:1;m=m.fill(x)}s.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=y(e.numberOfVerticalLines,16);u=P.clamp(u,0,c/2);let f=Ne.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let x=Math.min(g*u,c);for(p=0;p<x;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function JE(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ee.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ee.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}JE.packedLength=h.packedLength+ee.packedLength+8;JE.pack=function(e,t,n){return n=y(n,0),h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Phe=new h,Rhe=new ee,K_={center:Phe,ellipsoid:Rhe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};JE.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Phe);t+=h.packedLength;let o=ee.unpack(e,t,Rhe);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(K_.height=c,K_.extrudedHeight=f,K_.granularity=u,K_.rotation=a,K_.semiMajorAxis=r,K_.semiMinorAxis=s,K_.numberOfVerticalLines=d,K_.offsetAttribute=p===-1?void 0:p,new JE(K_))};JE.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=HQe(o);else if(r=zQe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===on.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new st({attributes:r.attributes,indices:r.indices,primitiveType:Me.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Hu=JE;var Ohe=new H,Mhe=h.ZERO,Lhe=new h,Nhe=new se;function GQe(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Th(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new GQe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Th.prototype=Object.create(Gn.prototype),Th.prototype.constructor=Th);Th.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Ohe)),l(o)||(o=H.WHITE),i.color=Gt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Mhe,Lhe))),new St({id:t,geometry:new ul(this._options),attributes:i})};Th.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Ohe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Mhe,Lhe))),new St({id:t,geometry:new Hu(this._options),attributes:r})};Th.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};Th.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||ii.prototype._isHidden.call(this,e,t)};Th.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!Y.isConstant(t.rotation)||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.numberOfVerticalLines)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};Th.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrUndefined(t.height,He.MINIMUM_VALUE),i=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),o=Y.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),r=Y.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(He.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(He.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(He.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=Y.getValueOrUndefined(t.rotation,He.MINIMUM_VALUE),s.granularity=Y.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),s.stRotation=Y.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),s.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,He.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=li.getMinimumMaximumHeights(ul.computeRectangle(s,Nhe)).minimumTerrainHeight),s.extrudedHeight=o};Th.DynamicGeometryUpdater=eS;function eS(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(eS.prototype=Object.create(ni.prototype),eS.prototype.constructor=eS);eS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ni.prototype._isHidden.call(this,e,t,n)};eS.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.center=Y.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=Y.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=Y.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=Y.getValueOrUndefined(t.rotation,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(ul.computeRectangle(i,Nhe)).minimumTerrainHeight),i.extrudedHeight=s};var mN=Th;var WQe=new h,jQe=new h,qQe=new h,YQe=new h,XQe=new h,KQe=new h(1,1,1),Fhe=Math.cos,Bhe=Math.sin;function Z_(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,KQe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,P.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),u=y(e.vertexFormat,Ie.DEFAULT);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Ie.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Z_.packedLength=2*h.packedLength+Ie.packedLength+7;Z_.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var khe=new h,Vhe=new h,Uhe=new Ie,t0={radii:khe,innerRadii:Vhe,vertexFormat:Uhe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Z_.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,khe);t+=h.packedLength;let o=h.unpack(e,t,Vhe);t+=h.packedLength;let r=Ie.unpack(e,t,Uhe);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(t0.minimumClock=s,t0.maximumClock=a,t0.minimumCone=c,t0.maximumCone=u,t0.stackPartitions=f,t0.slicePartitions=d,t0.offsetAttribute=p===-1?void 0:p,new Z_(t0))};Z_.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/P.TWO_PI),u=Math.round(u*Math.abs(s-r)/P.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[r],m=[i];for(f=0;f<u;f++)g.push(r+f*(s-r)/(u-1));for(g.push(s),d=0;d<c;d++)m.push(i+d*(o-i)/(c-1));m.push(o);let x=g.length,b=m.length,T=0,C=1,A=n.x!==t.x||n.y!==t.y||n.z!==t.z,E=!1,v=!1,D=!1;A&&(C=2,r>0&&(E=!0,T+=c-1),s<Math.PI&&(v=!0,T+=c-1),(o-i)%P.TWO_PI?(D=!0,T+=(u-1)*2+1):T+=1);let O=b*x*C,R=new Float64Array(O*3),M=new Array(O).fill(!1),N=new Array(O).fill(!1),_=c*u*C,S=6*(_+T+1-(c+u)*C),w=Ne.createTypedArray(_,S),I=a.normal?new Float32Array(O*3):void 0,L=a.tangent?new Float32Array(O*3):void 0,B=a.bitangent?new Float32Array(O*3):void 0,U=a.st?new Float32Array(O*2):void 0,V=new Array(x),G=new Array(x);for(f=0;f<x;f++)V[f]=Bhe(g[f]),G[f]=Fhe(g[f]);let k=new Array(b),W=new Array(b);for(d=0;d<b;d++)W[d]=Fhe(m[d]),k[d]=Bhe(m[d]);for(f=0;f<x;f++)for(d=0;d<b;d++)R[p++]=t.x*V[f]*W[d],R[p++]=t.y*V[f]*k[d],R[p++]=t.z*G[f];let q=O/2;if(A)for(f=0;f<x;f++)for(d=0;d<b;d++)R[p++]=n.x*V[f]*W[d],R[p++]=n.y*V[f]*k[d],R[p++]=n.z*G[f],M[q]=!0,f>0&&f!==x-1&&d!==0&&d!==b-1&&(N[q]=!0),q++;p=0;let J,j;for(f=1;f<x-2;f++)for(J=f*b,j=(f+1)*b,d=1;d<b-2;d++)w[p++]=j+d,w[p++]=j+d+1,w[p++]=J+d+1,w[p++]=j+d,w[p++]=J+d+1,w[p++]=J+d;if(A){let tt=x*b;for(f=1;f<x-2;f++)for(J=tt+f*b,j=tt+(f+1)*b,d=1;d<b-2;d++)w[p++]=j+d,w[p++]=J+d,w[p++]=J+d+1,w[p++]=j+d,w[p++]=J+d+1,w[p++]=j+d+1}let K,Q;if(A){if(E)for(Q=x*b,f=1;f<b-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Q+f+1,w[p++]=f,w[p++]=Q+f+1,w[p++]=Q+f;if(v)for(K=x*b-b,Q=x*b*C-b,f=1;f<b-2;f++)w[p++]=K+f+1,w[p++]=K+f,w[p++]=Q+f,w[p++]=K+f+1,w[p++]=Q+f,w[p++]=Q+f+1}if(D){for(f=1;f<x-2;f++)Q=b*x+b*f,K=b*f,w[p++]=Q,w[p++]=K+b,w[p++]=K,w[p++]=Q,w[p++]=Q+b,w[p++]=K+b;for(f=1;f<x-2;f++)Q=b*x+b*(f+1)-1,K=b*(f+1)-1,w[p++]=K+b,w[p++]=Q,w[p++]=K,w[p++]=K+b,w[p++]=Q+b,w[p++]=Q}let de=new un;a.position&&(de.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:R}));let xe=0,ce=0,ge=0,be=0,De=O/2,Ae,ke=ee.fromCartesian3(t),ze=ee.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<O;f++){Ae=M[f]?ze:ke;let tt=h.fromArray(R,f*3,WQe),vt=Ae.geodeticSurfaceNormal(tt,jQe);if(N[f]&&h.negate(vt,vt),a.st){let pt=z.negate(vt,XQe);U[xe++]=Math.atan2(pt.y,pt.x)/P.TWO_PI+.5,U[xe++]=Math.asin(vt.z)/Math.PI+.5}if(a.normal&&(I[ce++]=vt.x,I[ce++]=vt.y,I[ce++]=vt.z),a.tangent||a.bitangent){let pt=qQe,Be=0,qt;if(M[f]&&(Be=De),!E&&f>=Be&&f<Be+b*2?qt=h.UNIT_X:qt=h.UNIT_Z,h.cross(qt,vt,pt),h.normalize(pt,pt),a.tangent&&(L[ge++]=pt.x,L[ge++]=pt.y,L[ge++]=pt.z),a.bitangent){let At=h.cross(vt,pt,YQe);h.normalize(At,At),B[be++]=At.x,B[be++]=At.y,B[be++]=At.z}}}a.st&&(de.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:U})),a.normal&&(de.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(de.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:L})),a.bitangent&&(de.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:B}))}if(l(e._offsetAttribute)){let tt=R.length,vt=e._offsetAttribute===on.NONE?0:1,pt=new Uint8Array(tt/3).fill(vt);de.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:pt})}return new st({attributes:de,indices:w,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromEllipsoid(ke),offsetAttribute:e._offsetAttribute})};var Z7;Z_.getUnitEllipsoid=function(){return l(Z7)||(Z7=Z_.createGeometry(new Z_({radii:new h(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),Z7};var Qs=Z_;var ZQe=new Ut(H.WHITE),$7=h.ZERO,Q7=new h,$Qe=new h,QQe=new h,J7=new H,JQe=new h(1,1,1);function eJe(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function Gu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new eJe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Gu.prototype=Object.create(ii.prototype),Gu.prototype.constructor=Gu);Object.defineProperties(Gu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Gu.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new gn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Bn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,J7)),l(f)||(f=H.WHITE),r=Gt.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,$7,Q7))),new St({id:i,geometry:new Qs(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};Gu.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,J7),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new gn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(r),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,$7,Q7))),new St({id:i,geometry:new Mu(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Gu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};Gu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||ii.prototype._isHidden.call(this,e,t)};Gu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.radii.isConstant||!Y.isConstant(t.innerRadii)||!Y.isConstant(t.stackPartitions)||!Y.isConstant(t.slicePartitions)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.minimumClock)||!Y.isConstant(t.maximumClock)||!Y.isConstant(t.minimumCone)||!Y.isConstant(t.maximumCone)||!Y.isConstant(t.subdivisions)};Gu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(He.MINIMUM_VALUE,i.radii),i.innerRadii=Y.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=Y.getValueOrUndefined(t.minimumClock,He.MINIMUM_VALUE),i.maximumClock=Y.getValueOrUndefined(t.maximumClock,He.MINIMUM_VALUE),i.minimumCone=Y.getValueOrUndefined(t.minimumCone,He.MINIMUM_VALUE),i.maximumCone=Y.getValueOrUndefined(t.maximumCone,He.MINIMUM_VALUE),i.stackPartitions=Y.getValueOrUndefined(t.stackPartitions,He.MINIMUM_VALUE),i.slicePartitions=Y.getValueOrUndefined(t.slicePartitions,He.MINIMUM_VALUE),i.subdivisions=Y.getValueOrUndefined(t.subdivisions,He.MINIMUM_VALUE),i.offsetAttribute=n!==Ye.NONE?on.ALL:void 0};Gu.prototype._onEntityPropertyChanged=Wp;Gu.DynamicGeometryUpdater=pN;function pN(e,t,n){ni.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}l(Object.create)&&(pN.prototype=Object.create(ni.prototype),pN.prototype.constructor=pN);pN.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!Y.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=Y.getValueOrUndefined(n.radii,e,$Qe),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=Y.getValueOrDefault(n.fill,e,!0),s=Y.getValueOrDefault(n.outline,e,!1),a=Y.getValueOrClonedDefault(n.outlineColor,e,H.BLACK,J7),c=tr.getValue(e,y(n.material,ZQe),this._material),u=Y.getValueOrUndefined(n.innerRadii,e,QQe),f=Y.getValueOrUndefined(n.minimumClock,e),d=Y.getValueOrUndefined(n.maximumClock,e),p=Y.getValueOrUndefined(n.minimumCone,e),g=Y.getValueOrUndefined(n.maximumCone,e),m=Y.getValueOrUndefined(n.stackPartitions,e),x=Y.getValueOrUndefined(n.slicePartitions,e),b=Y.getValueOrUndefined(n.subdivisions,e),T=Y.getValueOrDefault(n.outlineWidth,e,1),C=Y.getValueOrDefault(n.heightReference,e,Ye.NONE),A=C!==Ye.NONE?on.ALL:void 0,E=this._scene.mode,v=E===ne.SCENE3D&&C===Ye.NONE,D=this._options,O=this._geometryUpdater.shadowsProperty.getValue(e),M=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=Y.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,$7,Q7);if(!v||this._lastSceneMode!==E||!l(this._primitive)||D.stackPartitions!==m||D.slicePartitions!==x||l(u)&&!h.equals(D.innerRadii!==u)||D.minimumClock!==f||D.maximumClock!==d||D.minimumCone!==p||D.maximumCone!==g||D.subdivisions!==b||this._lastOutlineWidth!==T||D.offsetAttribute!==A){let S=this._primitives;S.removeAndDestroy(this._primitive),S.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=T,D.stackPartitions=m,D.slicePartitions=x,D.subdivisions=b,D.offsetAttribute=A,D.radii=h.clone(v?JQe:i,D.radii),l(u)?v?D.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,D.innerRadii):D.innerRadii=h.clone(u,D.innerRadii):D.innerRadii=void 0,D.minimumClock=f,D.maximumClock=d,D.minimumCone=p,D.maximumCone=g;let w=new co({material:c,translucent:c.isTranslucent(),closed:!0});D.vertexFormat=w.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=S.add(new Dn({geometryInstances:I,appearance:w,asynchronous:!1,shadows:O}));let L=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=S.add(new Dn({geometryInstances:L,appearance:new an({flat:!0,translucent:L.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(T)}}),asynchronous:!1,shadows:O})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=H.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=M,this._lastOffset=h.clone(N,this._lastOffset)}else if(this._primitive.ready){let S=this._primitive,w=this._outlinePrimitive;S.show=!0,w.show=!0,S.appearance.material=c;let I=this._attributes;l(I)||(I=S.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=gn.toValue(r,I.show),this._lastShow=r);let L=this._outlineAttributes;l(L)||(L=w.getGeometryInstanceAttributes(t),this._outlineAttributes=L),s!==this._lastOutlineShow&&(L.show=gn.toValue(s,L.show),this._lastOutlineShow=s),H.equals(a,this._lastOutlineColor)||(L.color=Gt.toValue(a,L.color),H.clone(a,this._lastOutlineColor)),Mt.equals(M,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=Bn.toValue(M,I.distanceDisplayCondition),L.distanceDisplayCondition=Bn.toValue(M,L.distanceDisplayCondition),Mt.clone(M,this._lastDistanceDisplayCondition)),h.equals(N,this._lastOffset)||(I.offset=Ji.toValue(N,I.offset),L.offset=Ji.toValue(N,I.offset),h.clone(N,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=F.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var _N=Gu;function tS(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Ie.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}tS.packedLength=Ie.packedLength;tS.pack=function(e,t,n){return n=y(n,0),Ie.pack(e._vertexFormat,t,n),t};var zhe=new Ie,tJe={vertexFormat:zhe};tS.unpack=function(e,t,n){t=y(t,0);let i=Ie.unpack(e,t,zhe);return l(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n):new tS(tJe)};var c4=new h(-.5,-.5,0),l4=new h(.5,.5,0);tS.createGeometry=function(e){let t=e._vertexFormat,n=new un,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=c4.x,o[1]=c4.y,o[2]=0,o[3]=l4.x,o[4]=c4.y,o[5]=0,o[6]=l4.x,o[7]=l4.y,o[8]=0,o[9]=c4.x,o[10]=l4.y,o[11]=0,n.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new st({attributes:n,indices:i,primitiveType:Me.TRIANGLES,boundingSphere:new ae(h.ZERO,Math.sqrt(2))})};var gN=tS;function nS(){this._workerName="createPlaneOutlineGeometry"}nS.packedLength=0;nS.pack=function(e,t){return t};nS.unpack=function(e,t,n){return l(n)?n:new nS};var n0=new h(-.5,-.5,0),u4=new h(.5,.5,0);nS.createGeometry=function(){let e=new un,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=n0.x,n[1]=n0.y,n[2]=n0.z,n[3]=u4.x,n[4]=n0.y,n[5]=n0.z,n[6]=u4.x,n[7]=u4.y,n[8]=n0.z,n[9]=n0.x,n[10]=u4.y,n[11]=n0.z,e.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new st({attributes:e,indices:t,primitiveType:Me.LINES,boundingSphere:new ae(h.ZERO,Math.sqrt(2))})};var yN=nS;var nJe=new h,Hhe=new H;function iJe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function od(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new iJe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(od.prototype=Object.create(ii.prototype),od.prototype.constructor=od);od.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Bn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,Hhe)),l(g)||(g=H.WHITE),o=Gt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=Y.getValueOrDefault(c.plane,e,u.plane),p=Y.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=eq(d,p,f,f),new St({id:t,geometry:new gN(this._options),modelMatrix:f,attributes:i})};od.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Hhe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=Y.getValueOrDefault(r.plane,e,s.plane),u=Y.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=eq(c,u,a,a),new St({id:t,geometry:new yN,modelMatrix:a,attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o)}})};od.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||ii.prototype._isHidden.call(this,e,t)};od.prototype._getIsClosed=function(e){return!1};od.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!Y.isConstant(t.outlineWidth)};od.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?an.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(He.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(He.MINIMUM_VALUE,i.dimensions)};od.DynamicGeometryUpdater=iS;function iS(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(iS.prototype=Object.create(ni.prototype),iS.prototype.constructor=iS);iS.prototype._isHidden=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(e.position,n,nJe);return!l(o)||!l(i.plane)||!l(i.dimensions)||ni.prototype._isHidden.call(this,e,t,n)};iS.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=Y.getValueOrDefault(t.plane,n,i.plane),i.dimensions=Y.getValueOrUndefined(t.dimensions,n,i.dimensions)};var oJe=new h,rJe=new h,sJe=new h,aJe=new h,cJe=new $,lJe=new $,uJe=new F;function eq(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,sJe),a=h.clone(h.UNIT_Z,rJe);P.equalsEpsilon(Math.abs(h.dot(a,o)),1,P.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,oJe);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let u=cJe;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,o,u);let f=h.fromElements(t.x,t.y,1,aJe),d=$.multiplyByScale(u,f,lJe),p=F.fromRotationTranslation(d,s,uJe);return F.multiplyTransformation(n,p,i)}od.createPrimitiveMatrix=eq;var xN=od;var fJe=new h,dJe=new je,hJe=new z,mJe=new z,pJe=new h,_Je=new h,gJe=new h,bN=new h,yJe=new h,xJe=new h,Ghe=new Oe,bJe=new $,TJe=new $,CJe=new h;function AJe(e,t,n,i,o,r,s,a,c){let u=e.positions,f=si.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=Ne.createTypedArray(u.length,f.length);d.set(f);let p=bJe;if(i!==0){let _=Oe.fromAxisAngle(s,i,Ghe);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Oe.fromAxisAngle(s,-i,Ghe);let S=$.fromQuaternion(_,TJe);a=h.normalize($.multiplyByVector(S,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=mJe;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,x=m*3,b=new Float64Array(x),T=t.normal?new Float32Array(x):void 0,C=t.tangent?new Float32Array(x):void 0,A=t.bitangent?new Float32Array(x):void 0,E=t.st?new Float32Array(m*2):void 0,v=0,D=0,O=0,R=0,M=0;for(let _=0;_<m;_++){let S=u[_];if(b[v++]=S.x,b[v++]=S.y,b[v++]=S.z,t.st)if(l(o)&&o.positions.length===m)E[M++]=o.positions[_].x,E[M++]=o.positions[_].y;else{let w=$.multiplyByVector(p,S,fJe),I=r(w,hJe);z.subtract(I,g,I);let L=P.clamp(I.x/n.width,0,1),B=P.clamp(I.y/n.height,0,1);E[M++]=L,E[M++]=B}t.normal&&(T[D++]=s.x,T[D++]=s.y,T[D++]=s.z),t.tangent&&(C[R++]=a.x,C[R++]=a.y,C[R++]=a.z),t.bitangent&&(A[O++]=c.x,A[O++]=c.y,A[O++]=c.z)}let N=new un;return t.position&&(N.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b})),t.normal&&(N.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.tangent&&(N.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.bitangent&&(N.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.st&&(N.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:E})),new st({attributes:N,indices:d,primitiveType:Me.TRIANGLES})}function rT(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Ie.DEFAULT);this._vertexFormat=Ie.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Un.computeHierarchyPackedLength(t,h)+Ie.packedLength+ee.packedLength+(l(n)?Un.computeHierarchyPackedLength(n,z):1)+2}rT.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new rT(t)};rT.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Un.packPolygonHierarchy(e._textureCoordinates,t,n,z):t[n++]=-1,t[n++]=e.packedLength,t};var EJe=ee.clone(ee.UNIT_SPHERE),SJe=new Ie,vJe={polygonHierarchy:{}};rT.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,EJe);t+=ee.packedLength;let r=Ie.unpack(e,t,SJe);t+=Ie.packedLength;let s=e[t++],a=e[t]===-1?void 0:Un.unpackPolygonHierarchy(e,t,z);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new rT(vJe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};rT.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=Co(s,h.equalsEpsilon,!0),s.length<3)return;let a=pJe,c=_Je,u=gJe,f=yJe,d=xJe;if(!w_.computeProjectTo2DArguments(s,bN,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(bN,h.ZERO,P.EPSILON6)){let M=e._ellipsoid.geodeticSurfaceNormal(bN,CJe);h.dot(a,M)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=w_.createProjectPointsTo2DFunction(bN,f,d),m=w_.createProjectPointTo2DFunction(bN,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let x=Un.polygonsFromHierarchy(n,r,g,!1),b=x.hierarchy,T=x.polygons,C=function(M){return M},A=r?Un.polygonsFromHierarchy(o,!0,C,!1).polygons:void 0;if(b.length===0)return;s=b[0].outerRing;let E=ae.fromPoints(s),v=Un.computeBoundingRectangle(a,m,s,i,dJe),D=[];for(let M=0;M<T.length;M++){let N=new St({geometry:AJe(T[M],t,v,i,r?A[M]:void 0,m,a,c,u)});D.push(N)}let O=Ln.combineInstances(D)[0];O.attributes.position.values=new Float64Array(O.attributes.position.values),O.indices=Ne.createTypedArray(O.attributes.position.values.length/3,O.indices);let R=O.attributes;return t.position||delete R.position,new st({attributes:R,indices:O.indices,primitiveType:O.primitiveType,boundingSphere:E})};var TN=rT;var Whe=[],f4=[];function wJe(e,t,n,i,o){let s=Jr.fromPoints(t,e).projectPointsOntoPlane(t,Whe);si.computeWindingOrder2D(s)===hs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],x=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=x.x,c[d++]=x.y,c[d++]=x.z}else{let m=0;if(o===Qt.GEODESIC)for(u=0;u<f;u++)m+=Un.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===Qt.RHUMB)for(u=0;u<f;u++)m+=Un.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let x;o===Qt.GEODESIC?x=Un.subdivideLine(t[u],t[(u+1)%f],n,f4):o===Qt.RHUMB&&(x=Un.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,f4));let b=x.length;for(let T=0;T<b;++T)c[d++]=x[T]}}f=c.length/3;let p=f*2,g=Ne.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d++]=0,new St({geometry:new st({attributes:new un({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Me.LINES})})}function DJe(e,t,n,i,o){let s=Jr.fromPoints(t,e).projectPointsOntoPlane(t,Whe);si.computeWindingOrder2D(s)===hs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let b=t[u],T=t[(u+1)%f];c[p++]=b.x,c[p++]=b.y,c[p++]=b.z,c[p++]=T.x,c[p++]=T.y,c[p++]=T.z}else{let b=0;if(o===Qt.GEODESIC)for(u=0;u<f;u++)b+=Un.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===Qt.RHUMB)for(u=0;u<f;u++)b+=Un.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(b*3*2),u=0;u<f;++u){d[u]=p/3;let T;o===Qt.GEODESIC?T=Un.subdivideLine(t[u],t[(u+1)%f],n,f4):o===Qt.RHUMB&&(T=Un.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,f4));let C=T.length;for(let A=0;A<C;++A)c[p++]=T[A]}}f=c.length/(3*2);let g=d.length,m=(f*2+g)*2,x=Ne.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)x[p++]=u,x[p++]=(u+1)%f,x[p++]=u+f,x[p++]=(u+1)%f+f;for(u=0;u<g;u++){let b=d[u];x[p++]=b,x[p++]=b+f}return new St({geometry:new st({attributes:new un({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Me.LINES})})}function sT(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,ee.default),i=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.perPositionHeight,!1),r=o&&l(e.extrudedHeight),s=y(e.arcType,Qt.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!r){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=ee.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Un.computeHierarchyPackedLength(t,h)+ee.packedLength+8}sT.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var IJe=ee.clone(ee.UNIT_SPHERE),PJe={polygonHierarchy:{}};sT.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,IJe);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new sT(PJe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};sT.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new sT(t)};sT.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Un.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],u=P.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,d,0,P.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=DJe(t,s[m],u,o,r),a.geometry=Un.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,o),l(e._offsetAttribute)){let T=a.geometry.attributes.position.values.length/3,C=new Uint8Array(T);e._offsetAttribute===on.TOP?C=C.fill(1,0,T/2):(g=e._offsetAttribute===on.NONE?0:1,C=C.fill(g)),a.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}c.push(a)}else for(m=0;m<s.length;m++){if(a=wJe(t,s[m],u,o,r),a.geometry.attributes.position.values=si.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let T=a.geometry.attributes.position.values.length;g=e._offsetAttribute===on.NONE?0:1;let C=new Uint8Array(T/3).fill(g);a.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}c.push(a)}let x=Ln.combineInstances(c)[0],b=ae.fromVertices(x.attributes.position.values);return new st({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};var CN=sT;var jhe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",qhe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Yhe=new H,Xhe=h.ZERO,Khe=new h,Zhe=new se,RJe=[],OJe=new z;function MJe(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function Wu(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new MJe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Wu.prototype=Object.create(Gn.prototype),Wu.prototype.constructor=Wu);Wu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Yhe)),l(s)||(s=H.WHITE),o.color=Gt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Xhe,Khe)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new TN(i):r=new o_(i),new St({id:t,geometry:r,attributes:o})};Wu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Yhe),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(o),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Xhe,Khe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Zf(i):a=new CN(i),new St({id:t,geometry:a,attributes:s})};Wu.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=Jr.fromPoints(i,o),s=r.projectPointsOntoPlane(i,RJe),a=s.length,c=0,u=a-1,f=new z;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],x=g.x*m.y-m.x*g.y,b=z.add(g,m,OJe);b=z.multiplyByScalar(b,x,b),f=z.add(f,b,f),c+=x}let d=1/(c*3);return f=z.multiplyByScalar(f,d,f),r.projectPointOntoEllipsoid(f,t)};Wu.prototype._isHidden=function(e,t){return!l(t.hierarchy)||ii.prototype._isHidden.call(this,e,t)};Wu.prototype._isOnTerrain=function(e,t){let n=Gn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(He.MINIMUM_VALUE):!0);return n&&!o};Wu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.textureCoordinates)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.perPositionHeight)||!Y.isConstant(t.closeTop)||!Y.isConstant(t.closeBottom)||!Y.isConstant(t.zIndex)||!Y.isConstant(t.arcType)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};Wu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?an.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(He.MINIMUM_VALUE),r=Y.getValueOrUndefined(t.height,He.MINIMUM_VALUE),s=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),a=Y.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),c=Y.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE),u=Y.getValueOrDefault(t.perPositionHeight,He.MINIMUM_VALUE,!1);r=Gn.getGeometryHeight(r,s);let f;if(u?(l(r)&&(r=void 0,gt(jhe)),s!==Ye.NONE&&u&&(r=void 0,gt(qhe))):(l(a)&&!l(r)&&(r=0),f=Gn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=Y.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),i.stRotation=Y.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=Y.getValueOrDefault(t.closeTop,He.MINIMUM_VALUE,!0),i.closeBottom=Y.getValueOrDefault(t.closeBottom,He.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=Y.getValueOrDefault(t.arcType,He.MINIMUM_VALUE,Qt.GEODESIC),i.textureCoordinates=Y.getValueOrUndefined(t.textureCoordinates,He.MINIMUM_VALUE),a=Gn.getGeometryExtrudedHeight(a,c),a===Gn.CLAMP_TO_GROUND){let d=o_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Zhe);a=li.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};Wu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};Wu.DynamicGeometryUpdater=oS;function oS(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(oS.prototype=Object.create(ni.prototype),oS.prototype.constructor=oS);oS.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ni.prototype._isHidden.call(this,e,t,n)};oS.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=Y.getValueOrUndefined(t.hierarchy,n);let o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),s=Y.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE),a=Y.getValueOrUndefined(t.extrudedHeight,n),c=Y.getValueOrUndefined(t.perPositionHeight,n);o=Gn.getGeometryHeight(o,s);let u;if(c?(l(o)&&(o=void 0,gt(jhe)),r!==Ye.NONE&&c&&(o=void 0,gt(qhe))):(l(a)&&!l(o)&&(o=0),u=Gn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=Y.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=Y.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=Y.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=Y.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=Y.getValueOrDefault(t.arcType,n,Qt.GEODESIC),a=Gn.getGeometryExtrudedHeight(a,s),a===Gn.CLAMP_TO_GROUND){let f=o_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Zhe);a=li.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var AN=Wu;function LJe(e,t,n,i){let o=new un;i.position&&(o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=si.triangulate(t),u=(a-1)*r*6+c.length*2,f=Ne.createTypedArray(s,u),d,p,g,m,x,b,T=r*2,C=0;for(d=0;d<a-1;d++){for(p=0;p<r-1;p++)g=p*2+d*r*2,b=g+T,m=g+1,x=m+T,f[C++]=m,f[C++]=g,f[C++]=x,f[C++]=x,f[C++]=g,f[C++]=b;g=r*2-2+d*r*2,m=g+1,x=m+T,b=g+T,f[C++]=m,f[C++]=g,f[C++]=x,f[C++]=x,f[C++]=g,f[C++]=b}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),D=1/(a-1),O=1/n.height,R=n.height/2,M,N,_=0;for(d=0;d<a;d++){for(M=d*D,N=O*(t[0].y+R),v[_++]=M,v[_++]=N,p=1;p<r;p++)N=O*(t[p].y+R),v[_++]=M,v[_++]=N,v[_++]=M,v[_++]=N;N=O*(t[0].y+R),v[_++]=M,v[_++]=N}for(p=0;p<r;p++)M=0,N=O*(t[p].y+R),v[_++]=M,v[_++]=N;for(p=0;p<r;p++)M=(a-1)*D,N=O*(t[p].y+R),v[_++]=M,v[_++]=N;o.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let A=s-r*2;for(d=0;d<c.length;d+=3){let v=c[d]+A,D=c[d+1]+A,O=c[d+2]+A;f[C++]=v,f[C++]=D,f[C++]=O,f[C++]=O+r,f[C++]=D+r,f[C++]=v+r}let E=new st({attributes:o,indices:f,boundingSphere:ae.fromVertices(e),primitiveType:Me.TRIANGLES});if(i.normal&&(E=Ln.computeNormal(E)),i.tangent||i.bitangent){try{E=Ln.computeTangentAndBitangent(E)}catch{gt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(E.attributes.tangent=void 0),i.bitangent||(E.attributes.bitangent=void 0),i.st||(E.attributes.st=void 0)}return E}function SN(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._cornerType=y(e.cornerType,Ni.ROUNDED),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+ee.packedLength+Ie.packedLength+2}SN.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var $he=ee.clone(ee.UNIT_SPHERE),Qhe=new Ie,EN={polylinePositions:void 0,shapePositions:void 0,ellipsoid:$he,vertexFormat:Qhe,cornerType:void 0,granularity:void 0};SN.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,$he);t+=ee.packedLength;let c=Ie.unpack(e,t,Qhe);t+=Ie.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(EN.polylinePositions=r,EN.shapePositions=s,EN.cornerType=u,EN.granularity=f,new SN(EN))};var NJe=new je;SN.createGeometry=function(e){let t=e._positions,n=Co(t,h.equalsEpsilon),i=e._shape;if(i=mh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===hs.CLOCKWISE&&i.reverse();let o=je.fromPoints(i,NJe),r=mh.computePositions(n,i,o,e,!0);return LJe(r,i,o,e._vertexFormat)};var vN=SN;function FJe(e,t){let n=new un;n.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Ne.createTypedArray(o,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new st({attributes:n,indices:Ne.createTypedArray(o,a),boundingSphere:ae.fromVertices(e),primitiveType:Me.LINES})}function DN(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._cornerType=y(e.cornerType,Ni.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+ee.packedLength+2}DN.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Jhe=ee.clone(ee.UNIT_SPHERE),wN={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Jhe,height:void 0,cornerType:void 0,granularity:void 0};DN.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,Jhe);t+=ee.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(wN.polylinePositions=r,wN.shapePositions=s,wN.cornerType=c,wN.granularity=u,new DN(wN))};var BJe=new je;DN.createGeometry=function(e){let t=e._positions,n=Co(t,h.equalsEpsilon),i=e._shape;if(i=mh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===hs.CLOCKWISE&&i.reverse();let o=je.fromPoints(i,BJe),r=mh.computePositions(n,i,o,e,!1);return FJe(r,i)};var IN=DN;var eme=new H;function kJe(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function Nm(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new kJe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Nm.prototype=Object.create(ii.prototype),Nm.prototype.constructor=Nm);Nm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Bn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,eme)),l(c)||(c=H.WHITE),o=Gt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new St({id:t,geometry:new vN(this._options),attributes:i})};Nm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,eme),o=this._distanceDisplayConditionProperty.getValue(e);return new St({id:t,geometry:new IN(this._options),attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o)}})};Nm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||ii.prototype._isHidden.call(this,e,t)};Nm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!Y.isConstant(t.granularity)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.cornerType)};Nm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Ut;o.vertexFormat=r?an.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(He.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(He.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(He.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(He.MINIMUM_VALUE):void 0};Nm.DynamicGeometryUpdater=rS;function rS(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(rS.prototype=Object.create(ni.prototype),rS.prototype.constructor=rS);rS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ni.prototype._isHidden.call(this,e,t,n)};rS.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=Y.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=Y.getValueOrUndefined(t.shape,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.cornerType=Y.getValueOrUndefined(t.cornerType,n)};var PN=Nm;var tq=new h,ime=new h,ome=new h,rme=new h,sme=new se,VJe=new z,UJe=new ae,zJe=new ae;function ame(e,t){let n=new st({attributes:new un,primitiveType:Me.TRIANGLES});return n.attributes.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function HJe(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,u=rme,f=ome,d=ime;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=h.fromArray(e,p,tq),m=c+1,x=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),$.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(r[c]=d.x,r[m]=d.y,r[x]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[x]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[x]=u.z),c+=3}return ame(t,{positions:e,normals:r,tangents:s,bitangents:a})}var nq=new h,cme=new h;function GJe(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=rme,p=ome,g=ime;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let x=h.fromArray(e,m,tq),b=h.fromArray(e,(m+6)%i,nq);if(f){let T=h.fromArray(e,(m+3)%i,cme);h.subtract(b,x,b),h.subtract(T,x,T),g=h.normalize(h.cross(T,b,g),g),f=!1}h.equalsEpsilon(b,x,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(x,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(o[a++]=g.x,o[a++]=g.y,o[a++]=g.z,o[a++]=g.x,o[a++]=g.y,o[a++]=g.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return ame(t,{positions:e,normals:o,tangents:r,bitangents:s})}function lme(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,u=o,f=o,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=r*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,x=0,b=tq,T=VJe,C=Number.MAX_VALUE,A=Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let S=c;S<u;++S)for(let w=0;w<r;++w)Is.computePosition(t,i,n.st,S,w,b,T),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(g[x++]=T.x,g[x++]=T.y,C=Math.min(C,T.x),A=Math.min(A,T.y),E=Math.max(E,T.x),v=Math.max(v,T.y));if(s&&(Is.computePosition(t,i,n.st,0,0,b,T),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(g[x++]=T.x,g[x++]=T.y,C=T.x,A=T.y,E=T.x,v=T.y)),a&&(Is.computePosition(t,i,n.st,o-1,0,b,T),p[m++]=b.x,p[m++]=b.y,p[m]=b.z,n.st&&(g[x++]=T.x,g[x]=T.y,C=Math.min(C,T.x),A=Math.min(A,T.y),E=Math.max(E,T.x),v=Math.max(v,T.y))),n.st&&(C<0||A<0||E>1||v>1))for(let S=0;S<g.length;S+=2)g[S]=(g[S]-C)/(E-C),g[S+1]=(g[S+1]-A)/(v-A);let D=HJe(p,n,i,t.tangentRotationMatrix),O=6*(r-1)*(f-1);s&&(O+=3*(r-1)),a&&(O+=3*(r-1));let R=Ne.createTypedArray(d,O),M=0,N=0,_;for(_=0;_<f-1;++_){for(let S=0;S<r-1;++S){let w=M,I=w+r,L=I+1,B=w+1;R[N++]=w,R[N++]=I,R[N++]=B,R[N++]=B,R[N++]=I,R[N++]=L,++M}++M}if(s||a){let S=d-1,w=d-1;s&&a&&(S=d-2);let I,L;if(M=0,s)for(_=0;_<r-1;_++)I=M,L=I+1,R[N++]=S,R[N++]=I,R[N++]=L,++M;if(a)for(M=(f-1)*r,_=0;_<r-1;_++)I=M,L=I+1,R[N++]=I,R[N++]=w,R[N++]=L,++M}return D.indices=R,n.st&&(D.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),D}function sS(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function aS(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var iq=new Ie;function WJe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Be=Ie.clone(o,iq);Be.normal=!0,e._vertexFormat=Be}let d=lme(e,t);n&&(e._vertexFormat=o);let p=si.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,x=new Float64Array(m);x.set(p);let b=si.scaleToGeodeticHeight(d.attributes.position.values,r,a);x.set(b,g),d.attributes.position.values=x;let T=o.normal?new Float32Array(m):void 0,C=o.tangent?new Float32Array(m):void 0,A=o.bitangent?new Float32Array(m):void 0,E=o.st?new Float32Array(m/3*2):void 0,v,D;if(o.normal){for(D=d.attributes.normal.values,T.set(D),f=0;f<g;f++)D[f]=-D[f];T.set(D,g),d.attributes.normal.values=T}if(n){D=d.attributes.normal.values,o.normal||(d.attributes.normal=void 0);let Be=new Float32Array(m);for(f=0;f<g;f++)D[f]=-D[f];Be.set(D,g),d.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:Be})}let O,R=l(i);if(R){let Be=g/3*2,qt=new Uint8Array(Be);i===on.TOP?qt=qt.fill(1,0,Be/2):(O=i===on.NONE?0:1,qt=qt.fill(O)),d.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:qt})}if(o.tangent){let Be=d.attributes.tangent.values;for(C.set(Be),f=0;f<g;f++)Be[f]=-Be[f];C.set(Be,g),d.attributes.tangent.values=C}if(o.bitangent){let Be=d.attributes.bitangent.values;A.set(Be),A.set(Be,g),d.attributes.bitangent.values=A}o.st&&(v=d.attributes.st.values,E.set(v),E.set(v,g/3*2),d.attributes.st.values=E);let M=d.indices,N=M.length,_=g/3,S=Ne.createTypedArray(m/3,N*2);for(S.set(M),f=0;f<N;f+=3)S[f+N]=M[f+2]+_,S[f+1+N]=M[f+1]+_,S[f+2+N]=M[f]+_;d.indices=S;let w=t.northCap,I=t.southCap,L=c,B=2,U=0,V=4,G=4;w&&(B-=1,L-=1,U+=1,V-=2,G-=1),I&&(B-=1,L-=1,U+=1,V-=2,G-=1),U+=B*u+2*L-V;let k=(U+G)*2,W=new Float64Array(k*3),q=n?new Float32Array(k*3):void 0,J=R?new Uint8Array(k):void 0,j=o.st?new Float32Array(k*2):void 0,K=i===on.TOP;R&&!K&&(O=i===on.ALL?1:0,J=J.fill(O));let Q=0,de=0,xe=0,ce=0,ge=u*L,be;for(f=0;f<ge;f+=u)be=f*3,W=sS(W,Q,be,p,b),Q+=6,o.st&&(j=aS(j,de,f*2,v),de+=4),n&&(xe+=3,q[xe++]=D[be],q[xe++]=D[be+1],q[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1);if(I){let Be=w?ge+1:ge;for(be=Be*3,f=0;f<2;f++)W=sS(W,Q,be,p,b),Q+=6,o.st&&(j=aS(j,de,Be*2,v),de+=4),n&&(xe+=3,q[xe++]=D[be],q[xe++]=D[be+1],q[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1)}else for(f=ge-u;f<ge;f++)be=f*3,W=sS(W,Q,be,p,b),Q+=6,o.st&&(j=aS(j,de,f*2,v),de+=4),n&&(xe+=3,q[xe++]=D[be],q[xe++]=D[be+1],q[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1);for(f=ge-1;f>0;f-=u)be=f*3,W=sS(W,Q,be,p,b),Q+=6,o.st&&(j=aS(j,de,f*2,v),de+=4),n&&(xe+=3,q[xe++]=D[be],q[xe++]=D[be+1],q[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1);if(w){let Be=ge;for(be=Be*3,f=0;f<2;f++)W=sS(W,Q,be,p,b),Q+=6,o.st&&(j=aS(j,de,Be*2,v),de+=4),n&&(xe+=3,q[xe++]=D[be],q[xe++]=D[be+1],q[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1)}else for(f=u-1;f>=0;f--)be=f*3,W=sS(W,Q,be,p,b),Q+=6,o.st&&(j=aS(j,de,f*2,v),de+=4),n&&(xe+=3,q[xe++]=D[be],q[xe++]=D[be+1],q[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1);let De=GJe(W,o,a);o.st&&(De.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:j})),n&&(De.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:q})),R&&(De.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:J}));let Ae=Ne.createTypedArray(k,U*6),ke,ze,tt,vt;g=W.length/3;let pt=0;for(f=0;f<g-1;f+=2){ke=f,vt=(ke+2)%g;let Be=h.fromArray(W,ke*3,nq),qt=h.fromArray(W,vt*3,cme);h.equalsEpsilon(Be,qt,P.EPSILON10)||(ze=(ke+1)%g,tt=(ze+2)%g,Ae[pt++]=ke,Ae[pt++]=ze,Ae[pt++]=vt,Ae[pt++]=vt,Ae[pt++]=ze,Ae[pt++]=tt)}return De.indices=Ae,De=Ln.combineInstances([new St({geometry:d}),new St({geometry:De})]),De[0]}var jJe=[new h,new h,new h,new h],ume=new fe,qJe=new fe;function oq(e,t,n,i,o){if(n===0)return se.clone(e,o);let r=Is.computeOptions(e,t,n,0,sme,ume),s=r.height,a=r.width,c=jJe;return Is.computePosition(r,i,!1,0,0,c[0]),Is.computePosition(r,i,!1,0,a-1,c[1]),Is.computePosition(r,i,!1,s-1,0,c[2]),Is.computePosition(r,i,!1,s-1,a-1,c[3]),se.fromCartesianArray(c,i,o)}function Fm(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=se.clone(t),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Fm.packedLength=se.packedLength+ee.packedLength+Ie.packedLength+7;Fm.pack=function(e,t,n){return n=y(n,0),se.pack(e._rectangle,t,n),n+=se.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var fme=new se,dme=ee.clone(ee.UNIT_SPHERE),i0={rectangle:fme,ellipsoid:dme,vertexFormat:iq,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Fm.unpack=function(e,t,n){t=y(t,0);let i=se.unpack(e,t,fme);t+=se.packedLength;let o=ee.unpack(e,t,dme);t+=ee.packedLength;let r=Ie.unpack(e,t,iq);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=se.clone(i,n._rectangle),n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(i0.granularity=s,i0.height=a,i0.rotation=c,i0.stRotation=u,i0.extrudedHeight=f,i0.shadowVolume=d,i0.offsetAttribute=p===-1?void 0:p,new Fm(i0))};Fm.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.ellipsoid,ee.default),r=y(e.rotation,0);return oq(n,i,r,o,t)};var YJe=new $,tme=new Oe,XJe=new fe;Fm.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Is.computeOptions(t,e._granularity,i,o,sme,ume,qJe),a=YJe;if(o!==0||i!==0){let g=se.center(t,XJe),m=n.geodeticSurfaceNormalCartographic(g,nq);Oe.fromAxisAngle(m,-o,tme),$.fromQuaternion(tme,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!P.equalsEpsilon(c,u,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=WJe(e,s);let g=ae.fromRectangle3D(t,n,c,zJe),m=ae.fromRectangle3D(t,n,u,UJe);p=ae.union(g,m)}else{if(d=lme(e,s),d.attributes.position.values=si.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===on.NONE?0:1,x=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=ae.fromRectangle3D(t,n,c)}return r.position||delete d.attributes.position,new st({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Fm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Fm({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};var nme=new se,KJe=[new z,new z,new z],ZJe=new Ri,$Je=new fe;function QJe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=se.clone(e._rectangle,nme),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=oq(t,n,o,i,nme),s=KJe;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=Ri.fromRotation(e._stRotation,ZJe),u=se.center(a,$Je);for(let m=0;m<3;++m){let x=s[m];x.x-=u.longitude,x.y-=u.latitude,Ri.multiplyByVector(c,x,x),x.x+=u.longitude,x.y+=u.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return z.pack(f,g),z.pack(d,g,2),z.pack(p,g,4),g}Object.defineProperties(Fm.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=oq(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=QJe(this)),this._textureCoordinateRotationPoints}}});var aT=Fm;var hme=new H,mme=h.ZERO,pme=new h,_me=new se,JJe=new se,eet=new fe;function tet(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Ch(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new tet(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Ch.prototype=Object.create(Gn.prototype),Ch.prototype.constructor=Ch);Ch.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,hme)),l(o)||(o=H.WHITE),i.color=Gt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,mme,pme))),new St({id:t,geometry:new aT(this._options),attributes:i})};Ch.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,hme),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,mme,pme))),new St({id:t,geometry:new Nb(this._options),attributes:r})};Ch.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.rectangle.coordinates,e,JJe);if(!l(n))return;let i=se.center(n,eet);return fe.toCartesian(i,ee.default,t)};Ch.prototype._isHidden=function(e,t){return!l(t.coordinates)||ii.prototype._isHidden.call(this,e,t)};Ch.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.rotation)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};Ch.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=Y.getValueOrUndefined(t.height,He.MINIMUM_VALUE),o=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),r=Y.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),s=Y.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?an.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(He.MINIMUM_VALUE,a.rectangle),a.granularity=Y.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),a.stRotation=Y.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),a.rotation=Y.getValueOrUndefined(t.rotation,He.MINIMUM_VALUE),a.offsetAttribute=Gn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Gn.getGeometryHeight(i,o),r=Gn.getGeometryExtrudedHeight(r,s),r===Gn.CLAMP_TO_GROUND&&(r=li.getMinimumMaximumHeights(aT.computeRectangle(a,_me)).minimumTerrainHeight),a.extrudedHeight=r};Ch.DynamicGeometryUpdater=cS;function cS(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(cS.prototype=Object.create(ni.prototype),cS.prototype.constructor=cS);cS.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ni.prototype._isHidden.call(this,e,t,n)};cS.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=Y.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.rotation=Y.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(aT.computeRectangle(i,_me)).minimumTerrainHeight),i.extrudedHeight=s};var RN=Ch;var gme={};function net(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var iet=new fe,oet=new fe;function ret(e,t,n,i){t=Co(t,h.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),u=new Array(o),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,iet);s&&(d.height=n[0]),c[0]=d.height,r?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,x=1;for(let b=1;b<o;++b){let T=t[b],C=e.cartesianToCartographic(T,oet);s&&(C.height=n[b]),m=m&&C.height===0,net(d,C)?d.height<C.height&&(c[x-1]=C.height):(a[x]=T,c[x]=C.height,r?u[x]=i[b]:u[x]=0,m=m&&c[x]===u[x],fe.clone(C,d),++x)}if(!(m||x<2))return a.length=x,c.length=x,u.length=x,{positions:a,topHeights:c,bottomHeights:u}}var set=new Array(2),aet=new Array(2),cet={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};gme.computePositions=function(e,t,n,i,o,r){let s=ret(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=P.chordLength(o,e.maximumRadius),p=cet;if(p.minDistance=d,p.ellipsoid=e,r){let g=0,m;for(m=0;m<a-1;m++)g+=Li.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let x=set,b=aet;p.positions=x,p.height=b;let T=0;for(m=0;m<a-1;m++){x[0]=t[m],x[1]=t[m+1],b[0]=n[m],b[1]=n[m+1];let C=Li.generateArc(p);u.set(C,T),b[0]=i[m],b[1]=i[m+1],f.set(Li.generateArc(p),T),T+=C.length}}else p.positions=t,p.height=n,u=new Float64Array(Li.generateArc(p)),p.height=i,f=new Float64Array(Li.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var cT=gme;var rq=new h,d4=new h,uet=new h,yme=new h,fet=new h,det=new h,het=new h;function lT(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.ellipsoid,ee.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Ie.clone(o),this._granularity=r,this._ellipsoid=ee.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ee.packedLength+Ie.packedLength+1}lT.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._granularity,t};var xme=ee.clone(ee.UNIT_SPHERE),bme=new Ie,ON={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:xme,vertexFormat:bme,granularity:void 0};lT.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ee.unpack(e,t,xme);t+=ee.packedLength;let u=Ie.unpack(e,t,bme);t+=Ie.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._vertexFormat=Ie.clone(u,n._vertexFormat),n._granularity=f,n):(ON.positions=r,ON.minimumHeights=s,ON.maximumHeights=a,ON.granularity=f,new lT(ON))};lT.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new lT(c)};lT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=cT.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,x=o.tangent?new Float32Array(p):void 0,b=o.bitangent?new Float32Array(p):void 0,T=o.st?new Float32Array(p/3*2):void 0,C=0,A=0,E=0,v=0,D=0,O=het,R=det,M=fet,N=!0;d/=3;let _,S=0,w=1/(d-f-1);for(_=0;_<d;++_){let V=_*3,G=h.fromArray(u,V,rq),k=h.fromArray(c,V,d4);if(o.position&&(g[C++]=k.x,g[C++]=k.y,g[C++]=k.z,g[C++]=G.x,g[C++]=G.y,g[C++]=G.z),o.st&&(T[D++]=S,T[D++]=0,T[D++]=S,T[D++]=1),o.normal||o.tangent||o.bitangent){let W=h.clone(h.ZERO,yme),q=h.subtract(G,s.geodeticSurfaceNormal(G,d4),d4);if(_+1<d&&(W=h.fromArray(u,V+3,yme)),N){let J=h.subtract(W,G,uet),j=h.subtract(q,G,rq);O=h.normalize(h.cross(j,J,O),O),N=!1}h.equalsEpsilon(G,W,P.EPSILON10)?N=!0:(S+=w,o.tangent&&(R=h.normalize(h.subtract(W,G,R),R)),o.bitangent&&(M=h.normalize(h.cross(O,R,M),M))),o.normal&&(m[A++]=O.x,m[A++]=O.y,m[A++]=O.z,m[A++]=O.x,m[A++]=O.y,m[A++]=O.z),o.tangent&&(x[v++]=R.x,x[v++]=R.y,x[v++]=R.z,x[v++]=R.x,x[v++]=R.y,x[v++]=R.z),o.bitangent&&(b[E++]=M.x,b[E++]=M.y,b[E++]=M.z,b[E++]=M.x,b[E++]=M.y,b[E++]=M.z)}}let I=new un;o.position&&(I.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(I.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(I.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),o.bitangent&&(I.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(I.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T}));let L=p/3;p-=6*(f+1);let B=Ne.createTypedArray(L,p),U=0;for(_=0;_<L-2;_+=2){let V=_,G=_+2,k=h.fromArray(g,V*3,rq),W=h.fromArray(g,G*3,d4);if(h.equalsEpsilon(k,W,P.EPSILON10))continue;let q=_+1,J=_+3;B[U++]=q,B[U++]=V,B[U++]=J,B[U++]=J,B[U++]=V,B[U++]=G}return new st({attributes:I,indices:B,primitiveType:Me.TRIANGLES,boundingSphere:new ae.fromVertices(g)})};var MN=lT;var Tme=new h,Cme=new h;function uT(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.ellipsoid,ee.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ee.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ee.packedLength+1}uT.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n]=e._granularity,t};var Ame=ee.clone(ee.UNIT_SPHERE),LN={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Ame,granularity:void 0};uT.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ee.unpack(e,t,Ame);t+=ee.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._granularity=u,n):(LN.positions=r,LN.minimumHeights=s,LN.maximumHeights=a,LN.granularity=u,new uT(LN))};uT.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new uT(c)};uT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=cT.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let C=g*3,A=h.fromArray(c,C,Tme),E=h.fromArray(a,C,Cme);d[p++]=E.x,d[p++]=E.y,d[p++]=E.z,d[p++]=A.x,d[p++]=A.y,d[p++]=A.z}let m=new un({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})}),x=f/3;f=2*x-4+x;let b=Ne.createTypedArray(x,f),T=0;for(g=0;g<x-2;g+=2){let C=g,A=g+2,E=h.fromArray(d,C*3,Tme),v=h.fromArray(d,A*3,Cme);if(h.equalsEpsilon(E,v,P.EPSILON10))continue;let D=g+1,O=g+3;b[T++]=D,b[T++]=C,b[T++]=D,b[T++]=O,b[T++]=C,b[T++]=A}return b[T++]=x-2,b[T++]=x-1,new st({attributes:m,indices:b,primitiveType:Me.LINES,boundingSphere:new ae.fromVertices(d)})};var NN=uT;var Eme=new H;function met(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Ah(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new met(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Ah.prototype=Object.create(ii.prototype),Ah.prototype.constructor=Ah);Ah.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Bn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Eme)),l(c)||(c=H.WHITE),o=Gt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new St({id:t,geometry:new MN(this._options),attributes:i})};Ah.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Eme),o=this._distanceDisplayConditionProperty.getValue(e);return new St({id:t,geometry:new NN(this._options),attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o)}})};Ah.prototype._isHidden=function(e,t){return!l(t.positions)||ii.prototype._isHidden.call(this,e,t)};Ah.prototype._getIsClosed=function(e){return!1};Ah.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Y.isConstant(t.minimumHeights)||!Y.isConstant(t.maximumHeights)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.granularity)};Ah.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Ut,s=this._options;s.vertexFormat=r?an.VERTEX_FORMAT:co.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(He.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(He.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(He.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(He.MINIMUM_VALUE):void 0};Ah.DynamicGeometryUpdater=lS;function lS(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(lS.prototype=Object.create(ni.prototype),lS.prototype.constructor=lS);lS.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ni.prototype._isHidden.call(this,e,t,n)};lS.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=Y.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=Y.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=Y.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=Y.getValueOrUndefined(t.granularity,n)};var FN=Ah;var fT=[P1,tN,qL,mN,_N,xN,AN,PN,RN,FN];function dT(e,t){this.entity=e,this.scene=t;let n=new Array(fT.length),i=new pe,o=new hr;for(let r=0;r<n.length;r++){let s=new fT[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(dT.prototype._onEntityPropertyChanged,this)}dT.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};dT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};dT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};dT.registerUpdater=function(e){fT.includes(e)||fT.push(e)};dT.unregisterUpdater=function(e){if(fT.includes(e)){let t=fT.indexOf(e);fT.splice(t,1)}};var hT=dT;var Sme=new H,pet=new Mt,_et=new Mt,get=h.ZERO,yet=new h;function Eh(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.subscriptions=new Et,this.showsUpdated=new Et,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(Eh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Eh.prototype.onMaterialChanged=function(){this.invalidated=!0};Eh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Eh.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty)||!Y.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Eh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Eh.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Dn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let b=u.fillMaterialProperty.color,T=Y.getValueOrDefault(b,e,H.WHITE,Sme);H.equals(d._lastColor,T)||(d._lastColor=H.clone(T,d._lastColor),d.color=Gt.toValue(T,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Ut&&(!u.depthFailMaterialProperty.isConstant||c)){let b=u.depthFailMaterialProperty.color,T=Y.getValueOrDefault(b,e,H.WHITE,Sme);H.equals(d._lastDepthFailColor,T)||(d._lastDepthFailColor=H.clone(T,d._lastDepthFailColor),d.depthFailColor=Gt.toValue(T,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,_et,pet);Mt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Bn.toValue(b,d.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!Y.isConstant(x)){let b=Y.getValueOrDefault(x,e,get,yet);h.equals(b,d._lastOffset)||(d._lastOffset=h.clone(b,d._lastOffset),d.offset=Ji.toValue(b,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Eh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Eh.prototype.contains=function(e){return this.updaters.contains(e.id)};Eh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?at.FAILED:(i.boundingSphere.clone(t),at.DONE)};Eh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function uS(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}uS.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new Eh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function vme(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}uS.prototype.remove=function(e){vme(this._solidItems,e)||vme(this._translucentItems,e)};function wme(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function h4(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}uS.prototype.update=function(e){let t=h4(this,this._solidItems,e,!0);t=h4(this,this._translucentItems,e,t)&&t;let n=wme(this,this._solidItems,e),i=wme(this,this._translucentItems,e);return(n||i)&&(t=h4(this,this._solidItems,e,t)&&t,t=h4(this,this._translucentItems,e,t)&&t),t};function Dme(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return at.FAILED}uS.prototype.getBoundingSphere=function(e,t){let n=Dme(this._solidItems,e,t);return n===at.FAILED?Dme(this._translucentItems,e,t):n};function Ime(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}uS.prototype.removeAllPrimitives=function(){Ime(this._solidItems),Ime(this._translucentItems)};var rd=uS;var xet=new Mt,bet=new Mt,Tet=h.ZERO,Cet=new h;function Sh(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Sh.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et}Sh.prototype.onMaterialChanged=function(){this.invalidated=!0};Sh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};Sh.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty)||!Y.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Sh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var Aet=new H;Sh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=tr.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Dn({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=tr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Ut&&!c.depthFailMaterialProperty.isConstant){let b=c.depthFailMaterialProperty.color,T=Y.getValueOrDefault(b,e,H.WHITE,Aet);H.equals(d._lastDepthFailColor,T)||(d._lastDepthFailColor=H.clone(T,d._lastDepthFailColor),d.depthFailColor=Gt.toValue(T,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,bet,xet);Mt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Bn.toValue(b,d.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!Y.isConstant(x)){let b=Y.getValueOrDefault(x,e,Tet,Cet);h.equals(b,d._lastOffset)||(d._lastOffset=h.clone(b,d._lastOffset),d.offset=Ji.toValue(b,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Sh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Sh.prototype.contains=function(e){return this.updaters.contains(e.id)};Sh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?at.FAILED:(i.boundingSphere.clone(t),at.DONE)};Sh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function fS(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}fS.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new Sh(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};fS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};fS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};fS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return at.FAILED};fS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var sd=fS;var Rme=Zo(Pme(),1);function m4(){this._tree=new Rme.default}function mT(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}mT.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};m4.prototype.insert=function(e,t){let n=mT.fromRectangleAndId(e,t,new mT);this._tree.insert(n)};function Eet(e,t){return e.id===t.id}var vet=new mT;m4.prototype.remove=function(e,t){let n=mT.fromRectangleAndId(e,t,vet);this._tree.remove(n,Eet)};var wet=new mT;m4.prototype.collides=function(e){let t=mT.fromRectangleAndId("",e,wet);return this._tree.collides(t)};var pT=m4;var Det=new H,Iet=new Mt,Pet=new Mt;function $_(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.subscriptions=new Et,this.showsUpdated=new Et,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new pT}$_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};$_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};$_.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};$_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Wc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let x=u.fillMaterialProperty.color,b=Y.getValueOrDefault(x,e,H.WHITE,Det);H.equals(d._lastColor,b)||(d._lastColor=H.clone(b,d._lastColor),d.color=Gt.toValue(b,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let x=Y.getValueOrDefault(m,e,Pet,Iet);Mt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Bn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};$_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};$_.prototype.contains=function(e){return this.updaters.contains(e.id)};$_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),at.DONE):at.FAILED};$_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function dS(e,t){this._batches=[],this._primitives=e,this._classificationType=t}dS.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=Y.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new $_(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};dS.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};dS.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};dS.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return at.FAILED};dS.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var hS=dS;var Ret=new Mt,Oet=new Mt;function ad(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(ad.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new pT}ad.prototype.onMaterialChanged=function(){this.invalidated=!0};ad.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};ad.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:l(t)&&t.equals(n)};ad.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};ad.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};ad.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=tr.getValue(e,this.materialProperty,this.material),n=new Wc({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=tr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let x=Y.getValueOrDefault(m,e,Oet,Ret);Mt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Bn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};ad.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};ad.prototype.contains=function(e){return this.updaters.contains(e.id)};ad.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?at.FAILED:(i.boundingSphere.clone(t),at.DONE)};ad.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function mS(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}mS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=yu.shouldUseSphericalCoordinates(o.geometry.rectangle),s=Y.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new ad(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};mS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};mS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};mS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return at.FAILED};mS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var BN=mS;var Met=new H,Let=new Mt,Net=new Mt,Fet=h.ZERO,Bet=new h;function Q_(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.itemsToRemove=[],this.subscriptions=new Et,this.showsUpdated=new Et}Q_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty)||!Y.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Q_.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Q_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Dn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new an({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let b=u.outlineColorProperty,T=Y.getValueOrDefault(b,e,H.WHITE,Met);H.equals(d._lastColor,T)||(d._lastColor=H.clone(T,d._lastColor),d.color=Gt.toValue(T,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,Net,Let);Mt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Bn.toValue(b,d.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!Y.isConstant(x)){let b=Y.getValueOrDefault(x,e,Fet,Bet);h.equals(b,d._lastOffset)||(d._lastOffset=h.clone(b,d._lastOffset),d.offset=Ji.toValue(b,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Q_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Q_.prototype.contains=function(e){return this.updaters.contains(e.id)};Q_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?at.FAILED:(i.boundingSphere.clone(t),at.DONE)};Q_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function pS(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Et,this._translucentBatches=new Et}pS.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new Q_(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new Q_(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};pS.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};pS.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d=!1;do{for(d=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(d);return f};pS.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return at.FAILED};pS.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var _S=pS;var ket=[];function Kl(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Et,this._removedObjects=new Et,this._changedObjects=new Et;let o=yn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=nr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new _S(n,e,s,!1),this._outlineBatches[o+s]=new _S(n,e,s,!0),this._closedColorBatches[s]=new rd(n,an,void 0,!0,s,!0),this._closedColorBatches[o+s]=new rd(n,an,void 0,!0,s,!1),this._closedMaterialBatches[s]=new sd(n,co,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new sd(n,co,void 0,!0,s,!1),this._openColorBatches[s]=new rd(n,an,void 0,!1,s,!0),this._openColorBatches[o+s]=new rd(n,an,void 0,!1,s,!1),this._openMaterialBatches[s]=new sd(n,co,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new sd(n,co,void 0,!1,s,!1);let a=kn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new BN(i,s,co)),c[s]=new hS(i,s);else for(s=0;s<a;++s)c[s]=new hS(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new nT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Et,this._updaterSets=new Et,this._entityCollection=t,t.collectionChanged.addEventListener(Kl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,ket)}Kl.registerUpdater=function(e){hT.registerUpdater(e)};Kl.unregisterUpdater=function(e){hT.unregisterUpdater(e)};Kl.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(x){d._removeUpdater(x),d._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new hT(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(x){d._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Kl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var Vet=[],Uet=new ae;Kl.prototype.getBoundingSphere=function(e,t){let n=Vet,i=Uet,o=0,r=at.DONE,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(d,i),r===at.PENDING)return at.PENDING;r===at.DONE&&(n[o]=ae.clone(i,n[o]),o++)}}return o===0?at.FAILED:(n.length=o,ae.fromBoundingSpheres(n,t),at.DONE)};Kl.prototype.isDestroyed=function(){return!1};Kl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Kl.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),ue(this)};Kl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Kl.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=yn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Ut?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Ut?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Ut?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Kl._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Kl.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var kN=Kl;var zet=1,Het="30px sans-serif",Get=qo.FILL,Wet=H.WHITE,jet=H.BLACK,qet=1,Yet=!1,Xet=new H(.165,.165,.165,.8),Ket=new z(7,5),Zet=z.ZERO,$et=h.ZERO,Qet=Ye.NONE,Jet=yi.CENTER,ett=Rn.CENTER,ttt=new h,ntt=new H,itt=new H,ott=new H,rtt=new z,stt=new h,att=new z,ctt=new Bt,ltt=new Bt,utt=new Bt,ftt=new Mt;function Ome(e){this.entity=e,this.label=void 0,this.index=void 0}function o0(e,t){t.collectionChanged.addEventListener(o0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}o0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,u=r.label,f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;if(f&&(d=Y.getValueOrUndefined(s._position,e,ttt),c=Y.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){cq(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=Y.getValueOrDefault(a._heightReference,e,Qet);l(u)||(u=n.getLabel(s),u.id=s,r.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=Y.getValueOrDefault(a._scale,e,zet),u.font=Y.getValueOrDefault(a._font,e,Het),u.style=Y.getValueOrDefault(a._style,e,Get),u.fillColor=Y.getValueOrDefault(a._fillColor,e,Wet,ntt),u.outlineColor=Y.getValueOrDefault(a._outlineColor,e,jet,itt),u.outlineWidth=Y.getValueOrDefault(a._outlineWidth,e,qet),u.showBackground=Y.getValueOrDefault(a._showBackground,e,Yet),u.backgroundColor=Y.getValueOrDefault(a._backgroundColor,e,Xet,ott),u.backgroundPadding=Y.getValueOrDefault(a._backgroundPadding,e,Ket,rtt),u.pixelOffset=Y.getValueOrDefault(a._pixelOffset,e,Zet,att),u.eyeOffset=Y.getValueOrDefault(a._eyeOffset,e,$et,stt),u.heightReference=g,u.horizontalOrigin=Y.getValueOrDefault(a._horizontalOrigin,e,Jet),u.verticalOrigin=Y.getValueOrDefault(a._verticalOrigin,e,ett),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,ctt),u.pixelOffsetScaleByDistance=Y.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,ltt),u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,utt),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,ftt),u.disableDepthTestDistance=Y.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};o0.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return at.FAILED;let i=n.label;return t.center=h.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,at.DONE};o0.prototype.isDestroyed=function(){return!1};o0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(o0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};o0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new Ome(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Ome(r)):(cq(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],cq(s.get(r.id),r,a),s.remove(r.id)};function cq(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var VN=o0;var dtt=1,htt=!0,mtt=0,ptt=!0,_tt=!0,gtt=yn.ENABLED,ytt=Ye.NONE,xtt=H.RED,btt=0,Ttt=H.WHITE,Ctt=pc.HIGHLIGHT,Att=.5,Ett=new z(1,1),Mme={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Stt=new F,vtt=new F,Lme=new H,Nme=new Array(4),wtt=new h;function r0(e,t){t.collectionChanged.addEventListener(r0.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}async function Dtt(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await sh.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}r0.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,Stt),c=Se.createIfNeeded(Y.getValueOrUndefined(a._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...Mme}},n[s.id]=u;let m=Y.getValueOrDefault(a._incrementallyLoadTextures,e,ptt),x=Y.getValueOrDefault(a._environmentMapOptions,e,Mme,u.environmentMapOptionsScratch);Dtt(this,s,c,m,x)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=Y.getValueOrDefault(a._scale,e,dtt),p.enableVerticalExaggeration=Y.getValueOrDefault(a._enableVerticalExaggeration,e,htt),p.minimumPixelSize=Y.getValueOrDefault(a._minimumPixelSize,e,mtt),p.maximumScale=Y.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(d,p.modelMatrix),p.shadows=Y.getValueOrDefault(a._shadows,e,gtt),p.heightReference=Y.getValueOrDefault(a._heightReference,e,ytt),p.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=Y.getValueOrDefault(a._silhouetteColor,e,xtt,Lme),p.silhouetteSize=Y.getValueOrDefault(a._silhouetteSize,e,btt),p.color=Y.getValueOrDefault(a._color,e,Ttt,Lme),p.colorBlendMode=Y.getValueOrDefault(a._colorBlendMode,e,Ctt),p.colorBlendAmount=Y.getValueOrDefault(a._colorBlendAmount,e,Att),p.clippingPlanes=Y.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=Y.getValueOrDefault(a._clampAnimations,e,_tt),p.imageBasedLighting.imageBasedLightingFactor=Y.getValueOrDefault(a._imageBasedLightingFactor,e,Ett);let g=Y.getValueOrUndefined(a._lightColor,e);if(l(g)&&(H.pack(g,Nme,0),g=h.unpack(Nme,0,wtt)),p.lightColor=g,p.customShader=Y.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=Y.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:zl.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let x=Y.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(x)){let C=Object.keys(x);for(let A=0,E=C.length;A<E;++A){let v=C[A],D=x[v];if(!l(D))continue;let O=p.getNode(v);if(!l(O))continue;let R=F.fromTranslationRotationScale(D,vtt);O.matrix=F.multiply(O.originalMatrix,R,R)}}let b=!1,T=Y.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(T)){let C=Object.keys(T);for(let A=0,E=C.length;A<E;++A){let v=C[A],D=T[v];l(D)&&(b=!0,p.setArticulationStage(v,D))}}b&&p.applyArticulations()}}return!0};r0.prototype.isDestroyed=function(){return!1};r0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(r0.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)lq(this,e[i],t,n);return ue(this)};var p4=new h,Itt=new fe;r0.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return at.FAILED;if(n.loadFailed)return at.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return at.PENDING;if(!i.ready||!n.modelUpdated)return at.PENDING;let o=this._scene,r=y(o.ellipsoid,ee.default);if(i.heightReference!==Ye.NONE){let a=i.modelMatrix;p4.x=a[12],p4.y=a[13],p4.z=a[14];let c=r.cartesianToCartographic(p4,Itt),u=o.getHeight(c,i.heightReference);return l(u)&&(vf(i.heightReference)?c.height=u:c.height+=u),ae.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),at.DONE}return ae.clone(i.boundingSphere,t),at.DONE};r0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(Ptt(r,a),s.set(r.id,r)):(lq(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],lq(this,r,a,c),s.remove(r.id)};function lq(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Ptt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var UN=r0;function s0(e){this._definitionChanged=new pe,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(s0.prototype,{isConstant:{get:function(){return Y.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:zi.FIXED}}});var Rtt=new Z;s0.prototype.getValue=function(e,t){return l(e)||(e=Z.now(Rtt)),this.getValueInReferenceFrame(e,zi.FIXED,t)};s0.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};s0.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ee.default.scaleToGeodeticSurface(n,n):void 0};s0.prototype.equals=function(e){return this===e||e instanceof s0&&this._value===e._value};s0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Bm=s0;var Ott=60,Mtt=1,Bme=new An,uq=new An,fq=new An;function Fme(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function Ltt(e,t,n,i,o,r,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,r,c[u]),l(f)&&(c[u++]=f);let d=!l(o)||Z.lessThanOrEquals(o,t)||Z.greaterThanOrEquals(o,n),p=0,g=i.length,m=i[p],x=n,b=!1,T,C,A;for(;p<g;){if(!d&&Z.greaterThanOrEquals(m,o)&&(f=e.getValueInReferenceFrame(o,r,c[u]),l(f)&&(c[u++]=f),d=!0),Z.greaterThan(m,t)&&Z.lessThan(m,x)&&!m.equals(o)&&(f=e.getValueInReferenceFrame(m,r,c[u]),l(f)&&(c[u++]=f)),p<g-1){if(s>0&&!b){let E=i[p+1],v=Z.secondsDifference(E,m);b=v>s,b&&(T=Math.ceil(v/s),C=0,A=v/Math.max(T,2),T=Math.max(T-1,1))}if(b&&C<T){m=Z.addSeconds(m,A,new Z),C++;continue}}b=!1,p++,m=i[p]}return f=e.getValueInReferenceFrame(n,r,c[u]),l(f)&&(c[u++]=f),u}function Ntt(e,t,n,i,o,r,s,a){let c,u=0,f=s,d=t,p=!l(i)||Z.lessThanOrEquals(i,t)||Z.greaterThanOrEquals(i,n);for(;Z.lessThan(d,n);)!p&&Z.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,a[f]),l(c)&&(a[f]=c,f++),u++,d=Z.addSeconds(t,r*u,new Z);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function Ftt(e,t,n,i,o,r,s,a){let c,u=0,f=s,d=t,p=Math.max(r,60),g=!l(i)||Z.lessThanOrEquals(i,t)||Z.greaterThanOrEquals(i,n);for(;Z.lessThan(d,n);)!g&&Z.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,a[f]),l(c)&&(a[f]=c,f++),u++,d=Z.addSeconds(t,p*u,new Z);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function Btt(e,t,n,i,o,r,s,a){fq.start=t,fq.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!An.intersect(d,fq,Bme).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=Z.addSeconds(d.start,Z.secondsDifference(d.stop,d.start)/2,new Z));let g=e.getValueInReferenceFrame(p,o,a[c]);l(g)&&(a[c]=g,c++)}}return c}function ktt(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function Vtt(e,t,n,i,o,r,s,a){uq.start=t,uq.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!An.intersect(d,uq,Bme).isEmpty){let p=d.start,g=d.stop,m=t;Z.greaterThan(p,m)&&(m=p);let x=n;Z.lessThan(g,x)&&(x=g),c=kme(d.data,m,x,i,o,r,c,a)}}return c}function kme(e,t,n,i,o,r,s,a){for(;e instanceof W_;)e=e.resolvedProperty;if(e instanceof ya){let c=e._property._times;s=Ltt(e,t,n,c,i,o,r,s,a)}else e instanceof R1?s=Ntt(e,t,n,i,o,r,s,a):e instanceof _a?s=Vtt(e,t,n,i,o,r,s,a):e instanceof j_?s=Btt(e,t,n,i,o,r,s,a):e instanceof qc||e instanceof Bm&&Y.isConstant(e)?s=ktt(e,t,n,i,o,r,s,a):s=Ftt(e,t,n,i,o,r,s,a);return s}function Vme(e,t,n,i,o,r,s){l(s)||(s=[]);let a=kme(e,t,n,i,o,r,0,s);return s.length=a,s}var Utt=new $;function zN(e,t){this._unusedIndexes=[],this._polylineCollection=new lh,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}zN.prototype.update=function(e){if(this._referenceFrame===zi.INERTIAL){let t=Ot.computeIcrfToCentralBodyFixedMatrix(e,Utt);F.fromRotationTranslation(t,h.ZERO,this._polylineCollection.modelMatrix)}};zN.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let d=Y.getValueOrUndefined(i._leadTime,e),p=Y.getValueOrUndefined(i._trailTime,e),g=n._availability,m=l(g),x=l(d),b=l(p);if(u=m||x&&b,u){if(b&&(r=Z.addSeconds(e,-p,new Z)),x&&(s=Z.addSeconds(e,d,new Z)),m){let T=g.start,C=g.stop;(!b||Z.greaterThan(T,r))&&(r=T),(!x||Z.lessThan(C,s))&&(s=C)}u=Z.lessThan(r,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let d=this._unusedIndexes;if(d.length>0){let g=d.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=Y.getValueOrDefault(i._resolution,e,Ott);c.show=!0,c.positions=Vme(o,r,s,e,this._referenceFrame,f,c.positions.slice()),c.material=tr.getValue(e,i._material,c.material),c.width=Y.getValueOrDefault(i._width,e,Mtt),c.distanceDisplayCondition=Y.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};zN.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};zN.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function a0(e,t){t.collectionChanged.addEventListener(a0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}a0.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,u=zi.FIXED;this._scene.mode===ne.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(f)||(f=new zN(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,l(f)&&f.updateObject(e,r)}return!0};a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(a0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};a0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new Fme(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Fme(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};a0._subSample=Vme;var HN=a0;var Ume=H.WHITE,zme=H.BLACK,Hme=0,Gme=1,Wme=0,jme=Br.NONE,qme=new H,ztt=new h,Yme=new H,Xme=new Bt,Kme=new Bt,Zme=new Mt;function $me(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function c0(e,t){t.collectionChanged.addEventListener(c0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}c0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,u=r.billboard,f=Y.getValueOrDefault(a._heightReference,e,Ye.NONE),d=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),p;if(d&&(p=Y.getValueOrUndefined(s._position,e,ztt),d=l(p)),!d){GN(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==Ye.NONE&&!l(u)?(l(c)&&(GN(r,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===Ye.NONE&&!l(c)&&(l(u)&&(GN(r,s,n),u=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,Xme),c.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,Kme),c.color=Y.getValueOrDefault(a._color,e,Ume,qme),c.outlineColor=Y.getValueOrDefault(a._outlineColor,e,zme,Yme),c.outlineWidth=Y.getValueOrDefault(a._outlineWidth,e,Hme),c.pixelSize=Y.getValueOrDefault(a._pixelSize,e,Gme),c.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,Zme),c.disableDepthTestDistance=Y.getValueOrDefault(a._disableDepthTestDistance,e,Wme),c.splitDirection=Y.getValueOrDefault(a._splitDirection,e,jme);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,Xme),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,Kme),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,Zme),u.disableDepthTestDistance=Y.getValueOrDefault(a._disableDepthTestDistance,e,Wme),u.splitDirection=Y.getValueOrDefault(a._splitDirection,e,jme),u.heightReference=f;let x=Y.getValueOrDefault(a._color,e,Ume,qme),b=Y.getValueOrDefault(a._outlineColor,e,zme,Yme),T=Math.round(Y.getValueOrDefault(a._outlineWidth,e,Hme)),C=Math.max(1,Math.round(Y.getValueOrDefault(a._pixelSize,e,Gme)));if(T>0?(u.scale=1,g=g||T!==r.outlineWidth||C!==r.pixelSize||!H.equals(x,r.color)||!H.equals(b,r.outlineColor)):(u.scale=C/50,C=50,g=g||T!==r.outlineWidth||!H.equals(x,r.color)||!H.equals(b,r.outlineColor)),g){r.color=H.clone(x,r.color),r.outlineColor=H.clone(b,r.outlineColor),r.pixelSize=C,r.outlineWidth=T;let A=x.alpha,E=x.toCssColorString(),v=b.toCssColorString(),D=JSON.stringify([E,C,v,T]);u.setImage(D,wb(A,E,v,T,C))}m&&u._updateClamping()}}return!0};c0.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return at.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return at.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,at.DONE};c0.prototype.isDestroyed=function(){return!1};c0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(c0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};c0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new $me(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new $me(r)):(GN(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],GN(s.get(r.id),r,a),s.remove(r.id)};function GN(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var WN=c0;var npe=[];function Htt(e,t,n,i,o){let r=npe;r.length=o;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(H.equals(n,i)){for(s=0;s<o;s++)r[s]=H.clone(n);return r}let x=(d-a)/o,b=(p-c)/o,T=(g-u)/o,C=(m-f)/o;for(s=0;s<o;s++)r[s]=new H(a+s*x,c+s*b,u+s*T,f+s*C);return r}function jN(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),o=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._arcType=y(e.arcType,Qt.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*H.packedLength:1,this.packedLength=r+ee.packedLength+Ie.packedLength+4}jN.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=H.packedLength)H.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var ipe=ee.clone(ee.UNIT_SPHERE),ope=new Ie,_T={positions:void 0,colors:void 0,ellipsoid:ipe,vertexFormat:ope,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};jN.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=ee.unpack(e,t,ipe);t+=ee.packedLength;let c=Ie.unpack(e,t,ope);t+=Ie.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(_T.positions=r,_T.colors=s,_T.width=u,_T.colorsPerVertex=f,_T.arcType=d,_T.granularity=p,new jN(_T))};var Qme=new h,Jme=new h,epe=new h,tpe=new h;jN.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Co(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let L=0,B=d[0];i=i.filter(function(U,V){let G=!1;return o?G=V===B||V===0&&B===1:G=V+1===B,G?(L++,B=d[L],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===Qt.GEODESIC||r===Qt.RHUMB){let L,B;r===Qt.GEODESIC?(L=P.chordLength(s,a.maximumRadius),B=Li.numberOfPoints):(L=s,B=Li.numberOfPointsRhumbLine);let U=Li.extractHeights(p,a);if(l(i)){let V=1;for(c=0;c<g-1;++c)V+=B(p[c],p[c+1],L);let G=new Array(V),k=0;for(c=0;c<g-1;++c){let W=p[c],q=p[c+1],J=i[c],j=B(W,q,L);if(o&&c<V){let K=i[c+1],Q=Htt(W,q,J,K,j),de=Q.length;for(u=0;u<de;++u)G[k++]=Q[u]}else for(u=0;u<j;++u)G[k++]=H.clone(J)}G[k]=H.clone(i[i.length-1]),i=G,npe.length=0}r===Qt.GEODESIC?p=Li.generateCartesianArc({positions:p,minDistance:L,ellipsoid:a,height:U}):p=Li.generateCartesianRhumbArc({positions:p,granularity:L,ellipsoid:a,height:U})}g=p.length;let m=g*4-4,x=new Float64Array(m*3),b=new Float64Array(m*3),T=new Float64Array(m*3),C=new Float32Array(m*2),A=n.st?new Float32Array(m*2):void 0,E=l(i)?new Uint8Array(m*4):void 0,v=0,D=0,O=0,R=0,M;for(u=0;u<g;++u){u===0?(M=Qme,h.subtract(p[0],p[1],M),h.add(p[0],M,M)):M=p[u-1],h.clone(M,epe),h.clone(p[u],Jme),u===g-1?(M=Qme,h.subtract(p[g-1],p[g-2],M),h.add(p[g-1],M,M)):M=p[u+1],h.clone(M,tpe);let L,B;l(E)&&(u!==0&&!o?L=i[u-1]:L=i[u],u!==g-1&&(B=i[u]));let U=u===0?2:0,V=u===g-1?2:4;for(f=U;f<V;++f){h.pack(Jme,x,v),h.pack(epe,b,v),h.pack(tpe,T,v),v+=3;let G=f-2<0?-1:1;if(C[D++]=2*(f%2)-1,C[D++]=G*t,n.st&&(A[O++]=u/(g-1),A[O++]=Math.max(C[D-2],0)),l(E)){let k=f<2?L:B;E[R++]=H.floatToByte(k.red),E[R++]=H.floatToByte(k.green),E[R++]=H.floatToByte(k.blue),E[R++]=H.floatToByte(k.alpha)}}}let N=new un;N.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x}),N.prevPosition=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),N.nextPosition=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T}),N.expandAndWidth=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:C}),n.st&&(N.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:A})),l(E)&&(N.color=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0}));let _=Ne.createTypedArray(m,g*6-6),S=0,w=0,I=g-1;for(u=0;u<I;++u)_[w++]=S,_[w++]=S+2,_[w++]=S+1,_[w++]=S+1,_[w++]=S+2,_[w++]=S+3,S+=4;return new st({attributes:N,indices:_,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromPoints(p),geometryType:bf.POLYLINES})};var J_=jN;var Gtt=new Kn(0),_4={},rpe=new H,Wtt=new Ut(H.WHITE),jtt=new Kn(!0),qtt=new Kn(yn.DISABLED),Ytt=new Kn(new Mt),Xtt=new Kn(kn.BOTH);function Ktt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Ztt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function vh(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(vh.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new pe,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new Ktt,this._groundGeometryOptions=new Ztt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=nr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(vh.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&Y.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});vh.prototype.isOutlineVisible=function(e){return!1};vh.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};vh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Bn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Ut&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,rpe)),l(a)||(a=H.WHITE),s.color=Gt.fromColor(a)),this.clampToGround?new St({id:t,geometry:new Px(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Ut&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,rpe)),l(a)||(a=H.WHITE),s.depthFailColor=Gt.fromColor(a)),new St({id:t,geometry:new J_(this._geometryOptions),attributes:s}))};vh.prototype.createOutlineGeometryInstance=function(e){};vh.prototype.isDestroyed=function(){return!1};vh.prototype.destroy=function(){this._entitySubscription(),ue(this)};vh.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(He.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=y(o.material,Wtt),u=c instanceof Ut;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=y(s,jtt),this._shadowsProperty=y(o.shadows,qtt),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,Ytt),this._classificationTypeProperty=y(o.classificationType,Xtt),this._fillEnabled=!0,this._zIndex=y(a,Gtt);let f=o.width,d=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!Y.isConstant(f)||!Y.isConstant(d)||!Y.isConstant(g)||!Y.isConstant(p)||!Y.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,x=r.getValue(He.MINIMUM_VALUE,m.positions);if(!l(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let b;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Ut)?b=es.VERTEX_FORMAT:b=fa.VERTEX_FORMAT,m.vertexFormat=b,m.positions=x,m.width=l(f)?f.getValue(He.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(He.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(He.MINIMUM_VALUE):void 0;let T=this._groundGeometryOptions;T.positions=x,T.width=m.width,T.arcType=m.arcType,T.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(He.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&>("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};vh.prototype.createDynamicUpdater=function(e,t){return new qN(e,t,this)};var gS={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function qN(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function spe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=_4[n];!l(i)||i.isDestroyed()?(i=new lh,_4[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}qN.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=Y.getValueOrUndefined(o,e,this._positions);t._clampToGround=Y.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=Y.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=Y.getValueOrDefault(i._arcType,e,Qt.GEODESIC),t._groundGeometryOptions.granularity=Y.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!Y.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Ut)p=new es;else{let g=tr.getValue(e,d,this._material);p=new fa({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new kd({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),Y.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=spe(this);if(!n.isShowing||!n.isAvailable(e)||!Y.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=Qt.GEODESIC;c=Y.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==Qt.NONE&&l(u)&&(gS.ellipsoid=f,gS.positions=r,gS.granularity=Y.getValueOrUndefined(i._granularity,e),gS.height=Li.extractHeights(r,f),c===Qt.GEODESIC?r=Li.generateCartesianArc(gS):r=Li.generateCartesianRhumbArc(gS)),a.show=!0,a.positions=r.slice(),a.material=tr.getValue(e,t.fillMaterialProperty,a.material),a.width=Y.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=Y.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};qN.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ae.clone(n.boundingSphere,e),at.DONE}return l(t)&&!t.ready?at.PENDING:at.DONE}else{let t=spe(this);if(t.show&&t.positions.length>0)return ae.fromPoints(t.positions,e),at.DONE}return at.FAILED};qN.prototype.isDestroyed=function(){return!1};qN.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=_4[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete _4[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var YN=vh;var $tt=new H,Qtt=new Mt,Jtt=new Mt;function wh(e,t,n,i,o){let r;n instanceof Ut?r=es:r=fa,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(wh.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.zIndex=i,this._asynchronous=o}wh.prototype.onMaterialChanged=function(){this.invalidated=!0};wh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:l(t)&&t.equals(n)};wh.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};wh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};wh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new kd({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===fa&&(this.material=tr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===fa&&(this.material=tr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,b=Y.getValueOrDefault(x,e,H.WHITE,$tt);H.equals(d._lastColor,b)||(d._lastColor=H.clone(b,d._lastColor),d.color=Gt.toValue(b,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let x=Y.getValueOrDefault(m,e,Jtt,Qtt);Mt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Mt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Bn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};wh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};wh.prototype.contains=function(e){return this.updaters.contains(e.id)};wh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?at.FAILED:(i.boundingSphere.clone(t),at.DONE)};wh.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function yS(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}yS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Y.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new wh(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};yS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};yS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};yS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return at.FAILED};yS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var XN=yS;var ent=[];function ape(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function cpe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Ut?1:2);let r;l(i)&&(r=i+o*yn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Ut?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function km(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Et,this._removedObjects=new Et,this._changedObjects=new Et;let o,r=yn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new rd(n,es,void 0,!1,o),this._materialBatches[o]=new sd(n,fa,void 0,!1,o),this._colorBatches[o+r]=new rd(n,es,es,!1,o),this._materialBatches[o+r]=new sd(n,fa,es,!1,o),this._colorBatches[o+r*2]=new rd(n,es,fa,!1,o),this._materialBatches[o+r*2]=new sd(n,fa,fa,!1,o);this._dynamicBatch=new nT(n,i);let s=kn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new XN(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Et,this._updaters=new Et,this._entityCollection=t,t.collectionChanged.addEventListener(km.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,ent)}km.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(ape(this,f),cpe(this,e,f)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaters.get(u),ape(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new YN(c,this._scene),this._updaters.set(u,f),cpe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(km._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var tnt=[],nnt=new ae;km.prototype.getBoundingSphere=function(e,t){let n=tnt,i=nnt,o=0,r=at.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(c,i),r===at.PENDING)return at.PENDING;r===at.DONE&&(n[o]=ae.clone(i,n[o]),o++)}return o===0?at.FAILED:(n.length=o,ae.fromBoundingSpheres(n,t),at.DONE)};km.prototype.isDestroyed=function(){return!1};km.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(km.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};km._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};km.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var KN=km;function Zl(e){Wc.initializeTerrainHeights(),kd.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new hr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Zl.defaultVisualizersCallback);let i=!1,o=new Yl,r=new Yl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new QL;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var xS=[];Zl.registerVisualizer=function(e){xS.includes(e)||xS.push(e)};Zl.unregisterVisualizer=function(e){if(xS.includes(e)){let t=xS.indexOf(e);xS.splice(t,1)}};Zl.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new xP(t,i),new kN(e,i,n._primitives,n._groundPrimitives),new VN(t,i),new UN(e,i),new BL(e,i),new WN(t,i),new HN(e,i),new KN(e,i,n._primitives,n._groundPrimitives),...xS.map(o=>new o(e,i))]};Object.defineProperties(Zl.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Zl.prototype.isDestroyed=function(){return!1};Zl.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};Zl.prototype.update=function(e){if(!li.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=t,t};Zl.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var int=[],ont=new ae;Zl.prototype.getBoundingSphere=function(e,t,n){if(!this._ready&&!t)return at.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let g=p.get(i);if(g.entities.contains(e)){r=g;break}}}if(!l(r))return at.FAILED;let s=int,a=ont,c=0,u=at.DONE,f=r._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===at.PENDING)return at.PENDING;u===at.DONE&&(s[c]=ae.clone(a,s[c]),c++)}}return c===0?at.FAILED:(s.length=c,ae.fromBoundingSpheres(s,n),at.DONE)};Zl.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Yl),s=o.add(new hN);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Zl.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Zl.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var ZN=Zl;function dq(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}dq.clone=function(e,t){if(l(e))return l(t)||(t=new dq),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var cd=dq;var lpe=new $,upe=new $,fpe=new $,rnt=new F,g4=new h,dpe=new h,hq=new h,mq=new h,hpe=new h,mpe=new h,snt=new Oe,ant=new h,cnt=new $,bS=new Z,lnt=1.25;function unt(e,t,n,i,o,r,s,a,c,u){let f=e.scene.mode,d=o.getValue(c,e._lastCartesian);if(l(d)){let p=!1,g=!1,m,x,b;if(f===ne.SCENE3D){Z.addSeconds(c,.001,bS);let O=o.getValue(bS,g4);if(l(O)||(Z.addSeconds(c,-.001,bS),O=o.getValue(bS,g4),g=!0),l(O)){let R=Ot.computeFixedToIcrfMatrix(c,lpe),M=Ot.computeFixedToIcrfMatrix(bS,upe),N;!l(R)||!l(M)?(N=Ot.computeTemeToPseudoFixedMatrix(c,fpe),R=$.transpose(N,lpe),M=Ot.computeTemeToPseudoFixedMatrix(bS,upe),$.transpose(M,M)):N=$.transpose(R,fpe);let _=$.multiplyByVector(R,d,hpe),S=$.multiplyByVector(M,O,mpe);h.subtract(_,S,mq);let w=h.magnitude(mq)*1e3,I=P.GRAVITATIONALPARAMETER,L=-I/(w*w-2*I/h.magnitude(_));L<0||L>lnt*u.maximumRadius?(m=dpe,h.normalize(d,m),h.negate(m,m),b=h.clone(h.UNIT_Z,hq),x=h.cross(b,m,g4),h.magnitude(x)>P.EPSILON7&&(h.normalize(m,m),h.normalize(x,x),b=h.cross(m,x,hq),h.normalize(b,b),p=!0)):h.equalsEpsilon(d,O,P.EPSILON7)||(b=dpe,h.normalize(_,b),h.normalize(S,S),x=h.cross(b,S,hq),g&&(x=h.multiplyByScalar(x,-1,x)),h.equalsEpsilon(x,h.ZERO,P.EPSILON7)||(m=h.cross(x,b,g4),$.multiplyByVector(N,m,m),$.multiplyByVector(N,x,x),$.multiplyByVector(N,b,b),h.normalize(m,m),h.normalize(x,x),h.normalize(b,b),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let T,C,A;i&&(T=h.clone(t.position,mq),C=h.clone(t.direction,hpe),A=h.clone(t.up,mpe));let E=rnt,v;l(s)&&(v=s.getValue(c,snt));let D=r.getValue(c,ant);if(a===Np.INERTIAL&&l(v))F.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===Np.VELOCITY&&l(D)){let O=Ot.rotationMatrixFromPositionVelocity(d,D,u,cnt);F.fromRotationTranslation(O,d,E)}else a===Np.ENU||!p?Ot.eastNorthUpToFixedFrame(d,u,E):(E[0]=m.x,E[1]=m.y,E[2]=m.z,E[3]=0,E[4]=x.x,E[5]=x.y,E[6]=x.z,E[7]=0,E[8]=b.x,E[9]=b.y,E[10]=b.z,E[11]=0,E[12]=d.x,E[13]=d.y,E[14]=d.z,E[15]=0);t._setTransform(E),i&&(h.clone(T,t.position),h.clone(C,t.direction),h.clone(A,t.up),h.cross(C,A,t.right))}if(n){let p=f===ne.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function $N(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,ee.default),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new Y_(e.position,!0),this._offset3D=new h}Object.defineProperties($N,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});$N.defaultOffset3D=new h(-14e3,3500,3500);var y4=new cd,fnt=new h;$N.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ne.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,d=o!==this._mode,p=n.camera,g=f||d,m=!0;if(f){let x=r.viewFrom,b=l(x);if(!b&&l(t)){y4.pitch=-P.PI_OVER_FOUR,y4.range=0;let T=a.getValue(e,fnt);if(l(T)){let C=2-1/Math.max(1,h.magnitude(T)/i.maximumRadius);y4.pitch*=C}p.viewBoundingSphere(t,y4),this.boundingSphere=t,g=!1,m=!1}else(!b||!l(x.getValue(e,this._offset3D)))&&h.clone($N._defaultOffset3D,this._offset3D)}else!d&&this._mode!==ne.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,unt(this,p,g,m,a,c,u,s,e,i)};var QN=$N;function eF(){this._cache={}}eF.prototype.fromColor=function(e,t){return x4(void 0,void 0,e,t,this._cache)};eF.prototype.fromUrl=function(e,t,n){return x4(e,void 0,t,n,this._cache)};eF.prototype.fromMakiIconId=function(e,t,n){return x4(en(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};eF.prototype.fromText=function(e,t,n){return x4(void 0,e,t,n,this._cache)};var dnt=new H;function hnt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,dnt).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function ppe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=H.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=H.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var JN=new Array(4);function x4(e,t,n,i,o){JN[0]=e,JN[1]=t,JN[2]=n,JN[3]=i;let r=JSON.stringify(JN),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(hnt(c,n,i),l(e)){let f=Se.createIfNeeded(e).fetchImage().then(function(d){return ppe(c,d,i),o[r]=a,a});return o[r]=f,f}else if(l(t)){let u=Ib(t,{font:`bold ${i}px sans-serif`});ppe(c,u,i)}return o[r]=a,a}var eg=eF;var ype=Zo(gpe(),1);function T4(e){return h.fromDegrees(e[0],e[1],e[2])}var pq={"urn:ogc:def:crs:OGC:1.3:CRS84":T4,"EPSG:4326":T4,"urn:ogc:def:crs:EPSG::4326":T4},xpe={},bpe={},_q=48,gq,yq=H.ROYALBLUE,xq=H.YELLOW,bq=2,Tq=H.fromBytes(255,255,0,100),Cq=!1,mnt={small:24,medium:48,large:64},pnt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Tpe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||pnt.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Tpe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function _nt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function gnt(e,t){return new Gd(_nt(Tpe,e,t),!0)}function C4(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=zn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new Kn(c):n(r,s))}return o}function Aq(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Cpe={Feature:Epe,FeatureCollection:ynt,GeometryCollection:Spe,LineString:Ppe,MultiLineString:Rpe,MultiPoint:Dpe,MultiPolygon:Lpe,Point:wpe,Polygon:Mpe,Topology:Npe},Ape={GeometryCollection:Spe,LineString:Ppe,MultiLineString:Rpe,MultiPoint:Dpe,MultiPolygon:Lpe,Point:wpe,Polygon:Mpe,Topology:Npe};function Epe(e,t,n,i,o){if(t.geometry===null){C4(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new re("feature.geometry is required.");let r=t.geometry.type,s=Ape[r];if(!l(s))throw new re(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function ynt(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)Epe(e,r[s],void 0,i,o)}function Spe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],u=c.type,f=Ape[u];if(!l(f))throw new re(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function vpe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=H.fromCssColorString(g)),a=y(mnt[c["marker-size"]],a);let m=c["marker-symbol"];l(m)&&(r=m)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new ac;f.verticalOrigin=new Kn(Rn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=Ye.CLAMP_TO_GROUND);let d=C4(t,e._entityCollection,o.describe);d.billboard=f,d.position=new qc(n(i));let p=Promise.resolve(u).then(function(g){f.image=new Kn(g)}).catch(function(){f.image=new Kn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function wpe(e,t,n,i,o){vpe(e,t,i,n.coordinates,o)}function Dpe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)vpe(e,t,i,r[s],o)}function Ipe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new Kn(f));let d,p=a.stroke;l(p)&&(d=H.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=r.color.getValue().clone()),d.alpha=g),l(d)&&(r=new Ut(d))}let c=C4(t,e._entityCollection,o.describe),u=new uc;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new Kn(Aq(i,n)),u.arcType=Qt.RHUMB}function Ppe(e,t,n,i,o){Ipe(e,t,i,n.coordinates,o)}function Rpe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Ipe(e,t,i,r[s],o)}function Ope(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new Kn(g));let m,x=c.stroke;l(x)&&(m=H.fromCssColorString(x));let b=c["stroke-opacity"];l(b)&&b!==1&&(l(m)||(m=r.getValue().clone()),m.alpha=b),l(m)&&(r=new Kn(m));let T,C=c.fill,A=s.color.getValue();l(C)&&(T=H.fromCssColorString(C),T.alpha=A.alpha),b=c["fill-opacity"],l(b)&&b!==A.alpha&&(l(T)||(T=A.clone()),T.alpha=b),l(T)&&(s=new Ut(T))}let u=new zd;u.outline=new Kn(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=Qt.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Na(Aq(i[g],n)));let d=i[0];u.hierarchy=new Kn(new Na(Aq(d,n),f)),d[0].length>2?u.perPositionHeight=new Kn(!0):o.clampToGround||(u.height=0);let p=C4(t,e._entityCollection,o.describe);p.polygon=u}function Mpe(e,t,n,i,o){Ope(e,t,i,n.coordinates,o)}function Lpe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Ope(e,t,i,r[s],o)}function Npe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=ype.feature(n,n.objects[r]),a=Cpe[s.type];a(e,s,s,i,o)}}function l0(e){this._name=e,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new $s(this),this._promises=[],this._pinBuilder=new eg,this._entityCluster=new Fu,this._credit=void 0,this._resourceCredits=[]}l0.load=function(e,t){return new l0().load(e,t)};Object.defineProperties(l0,{markerSize:{get:function(){return _q},set:function(e){_q=e}},markerSymbol:{get:function(){return gq},set:function(e){gq=e}},markerColor:{get:function(){return yq},set:function(e){yq=e}},stroke:{get:function(){return xq},set:function(e){xq=e}},strokeWidth:{get:function(){return bq},set:function(e){bq=e}},fill:{get:function(){return Tq},set:function(e){Tq=e}},clampToGround:{get:function(){return Cq},set:function(e){Cq=e}},crsNames:{get:function(){return pq}},crsLinkHrefs:{get:function(){return xpe}},crsLinkTypes:{get:function(){return bpe}}});Object.defineProperties(l0.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});l0.prototype.load=function(e,t){return Fpe(this,e,t,!0)};l0.prototype.process=function(e,t){return Fpe(this,e,t,!1)};function Fpe(e,t,n,i){qr.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let o=n.credit;typeof o=="string"&&(o=new bt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Se){t=Se.createIfNeeded(t),r=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:y(n.describe,gnt),markerSize:y(n.markerSize,_q),markerSymbol:y(n.markerSymbol,gq),markerColor:y(n.markerColor,yq),strokeWidthProperty:new Kn(y(n.strokeWidth,bq)),strokeMaterialProperty:new Ut(y(n.stroke,xq)),fillMaterialProperty:new Ut(y(n.fill,Tq)),clampToGround:y(n.clampToGround,Cq)},Promise.resolve(r).then(function(a){return xnt(e,a,n,s,i)}).catch(function(a){throw qr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}l0.prototype.update=function(e){return!0};function xnt(e,t,n,i,o){let r;l(i)&&(r=z_(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Cpe[t.type];if(!l(s))throw new re(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?T4:null;if(l(a)){if(!l(a.properties))throw new re("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=pq[u.name],!l(c))throw new re(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=xpe[u.href];if(l(f)||(f=bpe[u.type]),!l(f))throw new re(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=pq[`EPSG:${u.code}`],!l(c))throw new re(`Unknown crs EPSG code: ${u.code}`)}else throw new re(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,qr.setLoading(e,!1),e})})}var gT=l0;var V_e=Zo(qq(),1);var U_e;typeof DOMParser<"u"&&(U_e=new DOMParser);var pot=new V_e.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),z4=32,R_e=2414016,O_e=1,M_e=16093e3,L_e=.1,_ot=[null,void 0,"http://www.topografix.com/GPX/1/1"],Do={gpx:_ot};function got(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function Yq(e,t){let n=oF(e,"id");return n=l(n)?n:zn(),t.getOrCreateEntity(n)}function Xq(e){let t=N_e(e,"lon"),n=N_e(e,"lat"),i=nF(e,"ele",Do.gpx);return h.fromDegrees(t,n,i)}function N_e(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function oF(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function u0(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Kq(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function nF(e,t,n){let i=u0(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function $l(e,t,n){let i=u0(e,t,n);if(l(i))return i.textContent.trim()}function z_e(e){let t=new ac;return t.width=z4,t.height=z4,t.scaleByDistance=new Bt(R_e,O_e,M_e,L_e),t.pixelOffsetScaleByDistance=new Bt(R_e,O_e,M_e,L_e),t.verticalOrigin=new Kn(Rn.BOTTOM),t.image=e,t}function yot(){let e=new Ud;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=yi.LEFT,e.font="16px sans-serif",e.style=qo.FILL_AND_OUTLINE,e}function H_e(e){let t=new uc;return t.width=4,t.material=new $y,t.material.color=l(e)?e:H.RED,t.material.outlineWidth=2,t.material.outlineColor=H.BLACK,t}var F_e={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},iF;typeof document<"u"&&(iF=document.createElement("div"));function Zq(e,t){let n,i="",o=Object.keys(F_e),r=o.length;for(n=0;n<r;n++){let f=o[n],d=F_e[f];d.value=y($l(e,d.tag,Do.gpx),""),l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=pot.link(i),iF.innerHTML=i;let s=iF.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=H.WHITE,c=H.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${iF.innerHTML}</div>`,iF.innerHTML="",u}function G_e(e,t,n,i){let o=Xq(t),r=Yq(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",H.RED,z4);r.billboard=z_e(s);let a=$l(t,"name",Do.gpx);r.name=a,r.label=yot(),r.label.text=a,r.description=Zq(t,r),i.clampToGround&&(r.billboard.heightReference=Ye.CLAMP_TO_GROUND,r.label.heightReference=Ye.CLAMP_TO_GROUND)}function xot(e,t,n,i){let o=Yq(t,n);o.description=Zq(t,o);let r=Kq(t,"rtept",Do.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)G_e(e,r[a],n,i),s[a]=Xq(r[a]);o.polyline=H_e(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function bot(e,t,n,i){let o=Yq(t,n);o.description=Zq(t,o);let r=Kq(t,"trkseg",Do.gpx),s=[],a=[],c,u=!0,f=new ya;for(let d=0;d<r.length;d++)c=Tot(r[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",H.RED,z4);o.billboard=z_e(d),o.position=f,i.clampToGround&&(o.billboard.heightReference=Ye.CLAMP_TO_GROUND),o.availability=new jr,o.availability.addInterval(new An({start:a[0],stop:a[a.length-1]}))}o.polyline=H_e(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Tot(e){let t={positions:[],times:[]},n=Kq(e,"trkpt",Do.gpx),i;for(let o=0;o<n.length;o++){let r=Xq(n[o]);t.positions.push(r),i=$l(n[o],"time",Do.gpx),l(i)&&t.times.push(Z.fromIso8601(i))}return t}function Cot(e){let t=u0(e,"metadata",Do.gpx);if(l(t)){let n={name:$l(t,"name",Do.gpx),desc:$l(t,"desc",Do.gpx),author:Aot(t),copyright:Sot(t),link:W_e(t),time:$l(t,"time",Do.gpx),keywords:$l(t,"keywords",Do.gpx),bounds:vot(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function Aot(e){let t=u0(e,"author",Do.gpx);if(l(t)){let n={name:$l(t,"name",Do.gpx),email:Eot(t),link:W_e(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function Eot(e){let t=u0(e,"email",Do.gpx);if(l(t)){let n=$l(t,"id",Do.gpx),i=$l(t,"domain",Do.gpx);return`${n}@${i}`}}function W_e(e){let t=u0(e,"link",Do.gpx);if(l(t)){let n={href:oF(t,"href"),text:$l(t,"text",Do.gpx),mimeType:$l(t,"type",Do.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function Sot(e){let t=u0(e,"copyright",Do.gpx);if(l(t)){let n={author:oF(t,"author"),year:$l(t,"year",Do.gpx),license:$l(t,"license",Do.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function vot(e){let t=u0(e,"bounds",Do.gpx);if(l(t)){let n={minLat:nF(t,"minlat",Do.gpx),maxLat:nF(t,"maxlat",Do.gpx),minLon:nF(t,"minlon",Do.gpx),maxLon:nF(t,"maxlon",Do.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var B_e={wpt:G_e,rte:xot,trk:bot};function wot(e,t,n,i){let o=Object.keys(B_e),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=B_e[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Do.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function k_e(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=oF(o,"version"),s=oF(o,"creator"),a,c=Cot(o);l(c)&&(a=c.name),o.localName==="gpx"?wot(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=Z.equals(d,He.MINIMUM_VALUE),m=Z.equals(p,He.MAXIMUM_VALUE);if(!g||!m){let b;g&&(b=new Date,b.setHours(0,0,0,0),d=Z.fromDate(b)),m&&(b=new Date,b.setHours(24,0,0,0),p=Z.fromDate(b)),u=new xh,u.startTime=d,u.stopTime=p,u.currentTime=Z.clone(d),u.clockRange=Yr.LOOP_STOP,u.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(p,d)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),Dot(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==r&&(e._version=r,x=!0),u!==e._clock&&(x=!0,e._clock=u),x&&e._changed.raiseEvent(e),qr.setLoading(e,!1),e}function Dot(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function Iot(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=n;if(typeof n=="string"||n instanceof Se){n=Se.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?got(r).then(function(s){let a,c;try{a=U_e.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new re(u)}return k_e(e,a,i)}):k_e(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function wS(){this._changed=new pe,this._error=new pe,this._loading=new pe,this._clock=void 0,this._entityCollection=new $s(this),this._entityCluster=new Fu,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new eg}wS.load=function(e,t){return new wS().load(e,t)};Object.defineProperties(wS.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});wS.prototype.update=function(e){return!0};wS.prototype.load=function(e,t){if(!l(e))throw new he("data is required.");t=y(t,y.EMPTY_OBJECT),qr.setLoading(this,!0);let n=this._name,i=this;return Iot(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Z.equals(s,He.MINIMUM_VALUE),u=Z.equals(a,He.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=Z.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=Z.fromDate(d)),o=new xh,o.startTime=s,o.stopTime=a,o.currentTime=Z.clone(s),o.clockRange=Yr.LOOP_STOP,o.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),qr.setLoading(i,!1),i}).catch(function(o){return qr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var rF=wS;function Pot(e,t){this.position=e,this.headingPitchRoll=t}var sF=Pot;var vye=Zo(qq(),1),PF=Zo(uu(),1);function X4(e){return K4(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function K4(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?K4(n):n),[])}var j_e=[0,1,2,3].concat(...X4([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function pr(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,d,p,g,m,x,b=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)d=o.heap[f],g=r[r[d*2+1]*2+1]+1,g>u&&(g=u,b++),r[d*2+1]=g,!(d>e.max_code)&&(o.bl_count[g]++,m=0,d>=c&&(m=a[d-c]),x=r[d*2],o.opt_len+=x*(g+m),s&&(o.static_len+=x*(s[d*2+1]+m)));if(b!==0){do{for(g=u-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(g=u;g!==0;g--)for(d=o.bl_count[g];d!==0;)p=o.heap[--f],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),d--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,u,f,d;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=r;f++)d=o[f*2+1],d!==0&&(o[f*2]=n(a[d]++,d))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,d;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=f=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)d=o.heap[++o.heap_len]=f<2?++f:0,r[d*2]=1,o.depth[d]=0,o.opt_len--,s&&(o.static_len-=s[d*2+1]);for(e.max_code=f,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);d=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=u,r[d*2]=r[c*2]+r[u*2],o.depth[d]=Math.max(o.depth[c],o.depth[u])+1,r[c*2+1]=r[u*2+1]=d,o.heap[1]=d++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}pr._length_code=[0,1,2,3,4,5,6,7].concat(...X4([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));pr.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];pr.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];pr.d_code=function(e){return e<256?j_e[e]:j_e[256+(e>>>7)]};pr.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];pr.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];pr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];pr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function za(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var Rot=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],Oot=X4([[144,8],[112,9],[24,7],[8,8]]);za.static_ltree=K4(Rot.map((e,t)=>[e,Oot[t]]));var Mot=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],Lot=X4([[30,5]]);za.static_dtree=K4(Mot.map((e,t)=>[e,Lot[t]]));za.static_l_desc=new za(za.static_ltree,pr.extra_lbits,257,286,15);za.static_d_desc=new za(za.static_dtree,pr.extra_dbits,0,30,15);za.static_bl_desc=new za(null,pr.extra_blbits,0,19,7);var Not=9,Fot=8;function Hm(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var Y_e=0,q4=1,ST=2,Ih=[new Hm(0,0,0,0,Y_e),new Hm(4,4,8,4,q4),new Hm(4,5,16,8,q4),new Hm(4,6,32,32,q4),new Hm(4,4,16,16,ST),new Hm(8,16,32,32,ST),new Hm(8,16,128,128,ST),new Hm(8,32,128,256,ST),new Hm(32,128,258,1024,ST),new Hm(32,258,258,4096,ST)],H4=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],ld=0,G4=1,aF=2,W4=3,Bot=32,$q=42,j4=113,cF=666,Qq=8,kot=0,Jq=1,Vot=2,Ir=3,Y4=258,ju=Y4+Ir+1;function q_e(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function Uot(){let e=this,t,n,i,o,r,s,a,c,u,f,d,p,g,m,x,b,T,C,A,E,v,D,O,R,M,N,_,S,w,I,L,B,U,V=new pr,G=new pr,k=new pr;e.depth=[];let W,q,J,j,K,Q;e.bl_count=[],e.heap=[],L=[],B=[],U=[];function de(){u=2*r,d[g-1]=0;for(let Le=0;Le<g-1;Le++)d[Le]=0;N=Ih[_].max_lazy,w=Ih[_].good_length,I=Ih[_].nice_length,M=Ih[_].max_chain,v=0,T=0,O=0,C=R=Ir-1,E=0,p=0}function xe(){let Le;for(Le=0;Le<286;Le++)L[Le*2]=0;for(Le=0;Le<30;Le++)B[Le*2]=0;for(Le=0;Le<19;Le++)U[Le*2]=0;L[256*2]=1,e.opt_len=e.static_len=0,q=J=0}function ce(){V.dyn_tree=L,V.stat_desc=za.static_l_desc,G.dyn_tree=B,G.stat_desc=za.static_d_desc,k.dyn_tree=U,k.stat_desc=za.static_bl_desc,K=0,Q=0,j=8,xe()}e.pqdownheap=function(Le,it){let qe=e.heap,Xe=qe[it],dt=it<<1;for(;dt<=e.heap_len&&(dt<e.heap_len&&q_e(Le,qe[dt+1],qe[dt],e.depth)&&dt++,!q_e(Le,Xe,qe[dt],e.depth));)qe[it]=qe[dt],it=dt,dt<<=1;qe[it]=Xe};function ge(Le,it){let qe=-1,Xe,dt=Le[0*2+1],Ht=0,Tn=7,Oo=4;dt===0&&(Tn=138,Oo=3),Le[(it+1)*2+1]=65535;for(let Ao=0;Ao<=it;Ao++)Xe=dt,dt=Le[(Ao+1)*2+1],!(++Ht<Tn&&Xe==dt)&&(Ht<Oo?U[Xe*2]+=Ht:Xe!==0?(Xe!=qe&&U[Xe*2]++,U[16*2]++):Ht<=10?U[17*2]++:U[18*2]++,Ht=0,qe=Xe,dt===0?(Tn=138,Oo=3):Xe==dt?(Tn=6,Oo=3):(Tn=7,Oo=4))}function be(){let Le;for(ge(L,V.max_code),ge(B,G.max_code),k.build_tree(e),Le=18;Le>=3&&U[pr.bl_order[Le]*2+1]===0;Le--);return e.opt_len+=3*(Le+1)+5+5+4,Le}function De(Le){e.pending_buf[e.pending++]=Le}function Ae(Le){De(Le&255),De(Le>>>8&255)}function ke(Le){De(Le>>8&255),De(Le&255&255)}function ze(Le,it){let qe,Xe=it;Q>16-Xe?(qe=Le,K|=qe<<Q&65535,Ae(K),K=qe>>>16-Q,Q+=Xe-16):(K|=Le<<Q&65535,Q+=Xe)}function tt(Le,it){let qe=Le*2;ze(it[qe]&65535,it[qe+1]&65535)}function vt(Le,it){let qe,Xe=-1,dt,Ht=Le[0*2+1],Tn=0,Oo=7,Ao=4;for(Ht===0&&(Oo=138,Ao=3),qe=0;qe<=it;qe++)if(dt=Ht,Ht=Le[(qe+1)*2+1],!(++Tn<Oo&&dt==Ht)){if(Tn<Ao)do tt(dt,U);while(--Tn!==0);else dt!==0?(dt!=Xe&&(tt(dt,U),Tn--),tt(16,U),ze(Tn-3,2)):Tn<=10?(tt(17,U),ze(Tn-3,3)):(tt(18,U),ze(Tn-11,7));Tn=0,Xe=dt,Ht===0?(Oo=138,Ao=3):dt==Ht?(Oo=6,Ao=3):(Oo=7,Ao=4)}}function pt(Le,it,qe){let Xe;for(ze(Le-257,5),ze(it-1,5),ze(qe-4,4),Xe=0;Xe<qe;Xe++)ze(U[pr.bl_order[Xe]*2+1],3);vt(L,Le-1),vt(B,it-1)}function Be(){Q==16?(Ae(K),K=0,Q=0):Q>=8&&(De(K&255),K>>>=8,Q-=8)}function qt(){ze(Jq<<1,3),tt(256,za.static_ltree),Be(),1+j+10-Q<9&&(ze(Jq<<1,3),tt(256,za.static_ltree),Be()),j=7}function At(Le,it){let qe,Xe,dt;if(e.dist_buf[q]=Le,e.lc_buf[q]=it&255,q++,Le===0?L[it*2]++:(J++,Le--,L[(pr._length_code[it]+256+1)*2]++,B[pr.d_code(Le)*2]++),!(q&8191)&&_>2){for(qe=q*8,Xe=v-T,dt=0;dt<30;dt++)qe+=B[dt*2]*(5+pr.extra_dbits[dt]);if(qe>>>=3,J<Math.floor(q/2)&&qe<Math.floor(Xe/2))return!0}return q==W-1}function lt(Le,it){let qe,Xe,dt=0,Ht,Tn;if(q!==0)do qe=e.dist_buf[dt],Xe=e.lc_buf[dt],dt++,qe===0?tt(Xe,Le):(Ht=pr._length_code[Xe],tt(Ht+256+1,Le),Tn=pr.extra_lbits[Ht],Tn!==0&&(Xe-=pr.base_length[Ht],ze(Xe,Tn)),qe--,Ht=pr.d_code(qe),tt(Ht,it),Tn=pr.extra_dbits[Ht],Tn!==0&&(qe-=pr.base_dist[Ht],ze(qe,Tn)));while(dt<q);tt(256,Le),j=Le[256*2+1]}function jn(){Q>8?Ae(K):Q>0&&De(K&255),K=0,Q=0}function sn(Le,it,qe){jn(),j=8,qe&&(Ae(it),Ae(~it)),e.pending_buf.set(c.subarray(Le,Le+it),e.pending),e.pending+=it}function me(Le,it,qe){ze((kot<<1)+(qe?1:0),3),sn(Le,it,!0)}function Ce(Le,it,qe){let Xe,dt,Ht=0;_>0?(V.build_tree(e),G.build_tree(e),Ht=be(),Xe=e.opt_len+3+7>>>3,dt=e.static_len+3+7>>>3,dt<=Xe&&(Xe=dt)):Xe=dt=it+5,it+4<=Xe&&Le!=-1?me(Le,it,qe):dt==Xe?(ze((Jq<<1)+(qe?1:0),3),lt(za.static_ltree,za.static_dtree)):(ze((Vot<<1)+(qe?1:0),3),pt(V.max_code+1,G.max_code+1,Ht+1),lt(L,B)),xe(),qe&&jn()}function mn(Le){Ce(T>=0?T:-1,v-T,Le),T=v,t.flush_pending()}function ft(){let Le,it,qe,Xe;do{if(Xe=u-O-v,Xe===0&&v===0&&O===0)Xe=r;else if(Xe==-1)Xe--;else if(v>=r+r-ju){c.set(c.subarray(r,r+r),0),D-=r,v-=r,T-=r,Le=g,qe=Le;do it=d[--qe]&65535,d[qe]=it>=r?it-r:0;while(--Le!==0);Le=r,qe=Le;do it=f[--qe]&65535,f[qe]=it>=r?it-r:0;while(--Le!==0);Xe+=r}if(t.avail_in===0)return;Le=t.read_buf(c,v+O,Xe),O+=Le,O>=Ir&&(p=c[v]&255,p=(p<<b^c[v+1]&255)&x)}while(O<ju&&t.avail_in!==0)}function ao(Le){let it=65535,qe;for(it>i-5&&(it=i-5);;){if(O<=1){if(ft(),O===0&&Le==0)return ld;if(O===0)break}if(v+=O,O=0,qe=T+it,(v===0||v>=qe)&&(O=v-qe,v=qe,mn(!1),t.avail_out===0)||v-T>=r-ju&&(mn(!1),t.avail_out===0))return ld}return mn(Le==4),t.avail_out===0?Le==4?aF:ld:Le==4?W4:G4}function Ro(Le){let it=M,qe=v,Xe,dt,Ht=R,Tn=v>r-ju?v-(r-ju):0,Oo=I,Ao=a,Za=v+Y4,$a=c[qe+Ht-1],Ai=c[qe+Ht];R>=w&&(it>>=2),Oo>O&&(Oo=O);do if(Xe=Le,!(c[Xe+Ht]!=Ai||c[Xe+Ht-1]!=$a||c[Xe]!=c[qe]||c[++Xe]!=c[qe+1])){qe+=2,Xe++;do;while(c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&qe<Za);if(dt=Y4-(Za-qe),qe=Za-Y4,dt>Ht){if(D=Le,Ht=dt,dt>=Oo)break;$a=c[qe+Ht-1],Ai=c[qe+Ht]}}while((Le=f[Le&Ao]&65535)>Tn&&--it!==0);return Ht<=O?Ht:O}function ra(Le){let it=0,qe;for(;;){if(O<ju){if(ft(),O<ju&&Le==0)return ld;if(O===0)break}if(O>=Ir&&(p=(p<<b^c[v+(Ir-1)]&255)&x,it=d[p]&65535,f[v&a]=d[p],d[p]=v),it!==0&&(v-it&65535)<=r-ju&&S!=2&&(C=Ro(it)),C>=Ir)if(qe=At(v-D,C-Ir),O-=C,C<=N&&O>=Ir){C--;do v++,p=(p<<b^c[v+(Ir-1)]&255)&x,it=d[p]&65535,f[v&a]=d[p],d[p]=v;while(--C!==0);v++}else v+=C,C=0,p=c[v]&255,p=(p<<b^c[v+1]&255)&x;else qe=At(0,c[v]&255),O--,v++;if(qe&&(mn(!1),t.avail_out===0))return ld}return mn(Le==4),t.avail_out===0?Le==4?aF:ld:Le==4?W4:G4}function Rr(Le){let it=0,qe,Xe;for(;;){if(O<ju){if(ft(),O<ju&&Le==0)return ld;if(O===0)break}if(O>=Ir&&(p=(p<<b^c[v+(Ir-1)]&255)&x,it=d[p]&65535,f[v&a]=d[p],d[p]=v),R=C,A=D,C=Ir-1,it!==0&&R<N&&(v-it&65535)<=r-ju&&(S!=2&&(C=Ro(it)),C<=5&&(S==1||C==Ir&&v-D>4096)&&(C=Ir-1)),R>=Ir&&C<=R){Xe=v+O-Ir,qe=At(v-1-A,R-Ir),O-=R-1,R-=2;do++v<=Xe&&(p=(p<<b^c[v+(Ir-1)]&255)&x,it=d[p]&65535,f[v&a]=d[p],d[p]=v);while(--R!==0);if(E=0,C=Ir-1,v++,qe&&(mn(!1),t.avail_out===0))return ld}else if(E!==0){if(qe=At(0,c[v-1]&255),qe&&mn(!1),v++,O--,t.avail_out===0)return ld}else E=1,v++,O--}return E!==0&&(qe=At(0,c[v-1]&255),E=0),mn(Le==4),t.avail_out===0?Le==4?aF:ld:Le==4?W4:G4}function As(Le){return Le.total_in=Le.total_out=0,Le.msg=null,e.pending=0,e.pending_out=0,n=j4,o=0,ce(),de(),0}e.deflateInit=function(Le,it,qe,Xe,dt,Ht){return Xe||(Xe=Qq),dt||(dt=Fot),Ht||(Ht=0),Le.msg=null,it==-1&&(it=6),dt<1||dt>Not||Xe!=Qq||qe<9||qe>15||it<0||it>9||Ht<0||Ht>2?-2:(Le.dstate=e,s=qe,r=1<<s,a=r-1,m=dt+7,g=1<<m,x=g-1,b=Math.floor((m+Ir-1)/Ir),c=new Uint8Array(r*2),f=[],d=[],W=1<<dt+6,e.pending_buf=new Uint8Array(W*4),i=W*4,e.dist_buf=new Uint16Array(W),e.lc_buf=new Uint8Array(W),_=it,S=Ht,As(Le))},e.deflateEnd=function(){return n!=$q&&n!=j4&&n!=cF?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,d=null,f=null,c=null,e.dstate=null,n==j4?-3:0)},e.deflateParams=function(Le,it,qe){let Xe=0;return it==-1&&(it=6),it<0||it>9||qe<0||qe>2?-2:(Ih[_].func!=Ih[it].func&&Le.total_in!==0&&(Xe=Le.deflate(1)),_!=it&&(_=it,N=Ih[_].max_lazy,w=Ih[_].good_length,I=Ih[_].nice_length,M=Ih[_].max_chain),S=qe,Xe)},e.deflateSetDictionary=function(Le,it,qe){let Xe=qe,dt,Ht=0;if(!it||n!=$q)return-2;if(Xe<Ir)return 0;for(Xe>r-ju&&(Xe=r-ju,Ht=qe-Xe),c.set(it.subarray(Ht,Ht+Xe),0),v=Xe,T=Xe,p=c[0]&255,p=(p<<b^c[1]&255)&x,dt=0;dt<=Xe-Ir;dt++)p=(p<<b^c[dt+(Ir-1)]&255)&x,f[dt&a]=d[p],d[p]=dt;return 0},e.deflate=function(Le,it){let qe,Xe,dt,Ht,Tn;if(it>4||it<0)return-2;if(!Le.next_out||!Le.next_in&&Le.avail_in!==0||n==cF&&it!=4)return Le.msg=H4[4],-2;if(Le.avail_out===0)return Le.msg=H4[7],-5;if(t=Le,Ht=o,o=it,n==$q&&(Xe=Qq+(s-8<<4)<<8,dt=(_-1&255)>>1,dt>3&&(dt=3),Xe|=dt<<6,v!==0&&(Xe|=Bot),Xe+=31-Xe%31,n=j4,ke(Xe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&it<=Ht&&it!=4)return t.msg=H4[7],-5;if(n==cF&&t.avail_in!==0)return Le.msg=H4[7],-5;if(t.avail_in!==0||O!==0||it!=0&&n!=cF){switch(Tn=-1,Ih[_].func){case Y_e:Tn=ao(it);break;case q4:Tn=ra(it);break;case ST:Tn=Rr(it);break;default:}if((Tn==aF||Tn==W4)&&(n=cF),Tn==ld||Tn==aF)return t.avail_out===0&&(o=-1),0;if(Tn==G4){if(it==1)qt();else if(me(0,0,!1),it==3)for(qe=0;qe<g;qe++)d[qe]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return it!=4?0:1}}function X_e(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}X_e.prototype={deflateInit(e,t){let n=this;return n.dstate=new Uot,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function K_e(e){let t=this,n=new X_e,i=zot(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let u,f,d=0,p=0,g=0,m=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(r)):m.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(g),m.forEach(function(x){f.set(x,p),p+=x.length})):f=m[0]?new Uint8Array(m[0]):new Uint8Array,f}},t.flush=function(){let a,c,u=0,f=0,d=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&d.push(r.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,u),u+=p.length}),c}}function zot(e){return e+5*(Math.floor(e/16383)+1)}var qu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],pge=1440,Hot=0,Got=4,Wot=9,jot=5,qot=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Yot=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Xot=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Kot=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],Zot=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],$ot=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],f0=15;function iY(){let e=this,t,n,i,o,r,s;function a(u,f,d,p,g,m,x,b,T,C,A){let E,v,D,O,R,M,N,_,S,w,I,L,B,U,V;w=0,R=d;do i[u[f+w]]++,w++,R--;while(R!==0);if(i[0]==d)return x[0]=-1,b[0]=0,0;for(_=b[0],M=1;M<=f0&&i[M]===0;M++);for(N=M,_<M&&(_=M),R=f0;R!==0&&i[R]===0;R--);for(D=R,_>R&&(_=R),b[0]=_,U=1<<M;M<R;M++,U<<=1)if((U-=i[M])<0)return-3;if((U-=i[R])<0)return-3;for(i[R]+=U,s[1]=M=0,w=1,B=2;--R!==0;)s[B]=M+=i[w],B++,w++;R=0,w=0;do(M=u[f+w])!==0&&(A[s[M]++]=R),w++;while(++R<d);for(d=s[D],s[0]=R=0,w=0,O=-1,L=-_,r[0]=0,I=0,V=0;N<=D;N++)for(E=i[N];E--!==0;){for(;N>L+_;){if(O++,L+=_,V=D-L,V=V>_?_:V,(v=1<<(M=N-L))>E+1&&(v-=E+1,B=N,M<V))for(;++M<V&&!((v<<=1)<=i[++B]);)v-=i[B];if(V=1<<M,C[0]+V>pge)return-3;r[O]=I=C[0],C[0]+=V,O!==0?(s[O]=R,o[0]=M,o[1]=_,M=R>>>L-_,o[2]=I-r[O-1]-M,T.set(o,(r[O-1]+M)*3)):x[0]=I}for(o[1]=N-L,w>=d?o[0]=192:A[w]<p?(o[0]=A[w]<256?0:96,o[2]=A[w++]):(o[0]=m[A[w]-p]+16+64,o[2]=g[A[w++]-p]),v=1<<N-L,M=R>>>L;M<V;M+=v)T.set(o,(I+M)*3);for(M=1<<N-1;R&M;M>>>=1)R^=M;for(R^=M,S=(1<<L)-1;(R&S)!=s[O];)O--,L-=_,S=(1<<L)-1}return U!==0&&D!=1?-5:0}function c(u){let f;for(t||(t=[],n=[],i=new Int32Array(f0+1),o=[],r=new Int32Array(f0),s=new Int32Array(f0+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<f0+1;f++)i[f]=0;for(f=0;f<3;f++)o[f]=0;r.set(i.subarray(0,f0),0),s.set(i.subarray(0,f0+1),0)}e.inflate_trees_bits=function(u,f,d,p,g){let m;return c(19),t[0]=0,m=a(u,0,19,19,null,null,d,f,p,t,n),m==-3?g.msg="oversubscribed dynamic bit lengths tree":(m==-5||f[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",m=-3),m},e.inflate_trees_dynamic=function(u,f,d,p,g,m,x,b,T){let C;return c(288),t[0]=0,C=a(d,0,u,257,Xot,Kot,m,p,b,t,n),C!=0||p[0]===0?(C==-3?T.msg="oversubscribed literal/length tree":C!=-4&&(T.msg="incomplete literal/length tree",C=-3),C):(c(288),C=a(d,u,f,0,Zot,$ot,x,g,b,t,n),C!=0||g[0]===0&&u>257?(C==-3?T.msg="oversubscribed distance tree":C==-5?(T.msg="incomplete distance tree",C=-3):C!=-4&&(T.msg="empty distance tree with lengths",C=-3),C):0)}}iY.inflate_trees_fixed=function(e,t,n,i){return e[0]=Wot,t[0]=jot,n[0]=qot,i[0]=Yot,0};var Z4=0,Z_e=1,$_e=2,Q_e=3,J_e=4,ege=5,tge=6,eY=7,nge=8,$4=9;function Qot(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,u=0,f=0,d,p=0,g,m=0;function x(b,T,C,A,E,v,D,O){let R,M,N,_,S,w,I,L,B,U,V,G,k,W,q,J;I=O.next_in_index,L=O.avail_in,S=D.bitb,w=D.bitk,B=D.write,U=B<D.read?D.read-B-1:D.end-B,V=qu[b],G=qu[T];do{for(;w<20;)L--,S|=(O.read_byte(I++)&255)<<w,w+=8;if(R=S&V,M=C,N=A,J=(N+R)*3,(_=M[J])===0){S>>=M[J+1],w-=M[J+1],D.win[B++]=M[J+2],U--;continue}do{if(S>>=M[J+1],w-=M[J+1],_&16){for(_&=15,k=M[J+2]+(S&qu[_]),S>>=_,w-=_;w<15;)L--,S|=(O.read_byte(I++)&255)<<w,w+=8;R=S&G,M=E,N=v,J=(N+R)*3,_=M[J];do if(S>>=M[J+1],w-=M[J+1],_&16){for(_&=15;w<_;)L--,S|=(O.read_byte(I++)&255)<<w,w+=8;if(W=M[J+2]+(S&qu[_]),S>>=_,w-=_,U-=k,B>=W)q=B-W,B-q>0&&2>B-q?(D.win[B++]=D.win[q++],D.win[B++]=D.win[q++],k-=2):(D.win.set(D.win.subarray(q,q+2),B),B+=2,q+=2,k-=2);else{q=B-W;do q+=D.end;while(q<0);if(_=D.end-q,k>_){if(k-=_,B-q>0&&_>B-q)do D.win[B++]=D.win[q++];while(--_!==0);else D.win.set(D.win.subarray(q,q+_),B),B+=_,q+=_,_=0;q=0}}if(B-q>0&&k>B-q)do D.win[B++]=D.win[q++];while(--k!==0);else D.win.set(D.win.subarray(q,q+k),B),B+=k,q+=k,k=0;break}else if(!(_&64))R+=M[J+2],R+=S&qu[_],J=(N+R)*3,_=M[J];else return O.msg="invalid distance code",k=O.avail_in-L,k=w>>3<k?w>>3:k,L+=k,I-=k,w-=k<<3,D.bitb=S,D.bitk=w,O.avail_in=L,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,-3;while(!0);break}if(_&64)return _&32?(k=O.avail_in-L,k=w>>3<k?w>>3:k,L+=k,I-=k,w-=k<<3,D.bitb=S,D.bitk=w,O.avail_in=L,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,1):(O.msg="invalid literal/length code",k=O.avail_in-L,k=w>>3<k?w>>3:k,L+=k,I-=k,w-=k<<3,D.bitb=S,D.bitk=w,O.avail_in=L,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,-3);if(R+=M[J+2],R+=S&qu[_],J=(N+R)*3,(_=M[J])===0){S>>=M[J+1],w-=M[J+1],D.win[B++]=M[J+2],U--;break}}while(!0)}while(U>=258&&L>=10);return k=O.avail_in-L,k=w>>3<k?w>>3:k,L+=k,I-=k,w-=k<<3,D.bitb=S,D.bitk=w,O.avail_in=L,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,0}e.init=function(b,T,C,A,E,v){t=Z4,u=b,f=T,d=C,p=A,g=E,m=v,i=null},e.proc=function(b,T,C){let A,E,v,D=0,O=0,R=0,M,N,_,S;for(R=T.next_in_index,M=T.avail_in,D=b.bitb,O=b.bitk,N=b.write,_=N<b.read?b.read-N-1:b.end-N;;)switch(t){case Z4:if(_>=258&&M>=10&&(b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,C=x(u,f,d,p,g,m,b,T),R=T.next_in_index,M=T.avail_in,D=b.bitb,O=b.bitk,N=b.write,_=N<b.read?b.read-N-1:b.end-N,C!=0)){t=C==1?eY:$4;break}r=u,i=d,o=p,t=Z_e;case Z_e:for(A=r;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}if(E=(o+(D&qu[A]))*3,D>>>=i[E+1],O-=i[E+1],v=i[E],v===0){s=i[E+2],t=tge;break}if(v&16){a=v&15,n=i[E+2],t=$_e;break}if(!(v&64)){r=v,o=E/3+i[E+2];break}if(v&32){t=eY;break}return t=$4,T.msg="invalid literal/length code",C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);case $_e:for(A=a;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}n+=D&qu[A],D>>=A,O-=A,r=f,i=g,o=m,t=Q_e;case Q_e:for(A=r;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}if(E=(o+(D&qu[A]))*3,D>>=i[E+1],O-=i[E+1],v=i[E],v&16){a=v&15,c=i[E+2],t=J_e;break}if(!(v&64)){r=v,o=E/3+i[E+2];break}return t=$4,T.msg="invalid distance code",C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);case J_e:for(A=a;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}c+=D&qu[A],D>>=A,O-=A,t=ege;case ege:for(S=N-c;S<0;)S+=b.end;for(;n!==0;){if(_===0&&(N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0&&(b.write=N,C=b.inflate_flush(T,C),N=b.write,_=N<b.read?b.read-N-1:b.end-N,N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0)))return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);b.win[N++]=b.win[S++],_--,S==b.end&&(S=0),n--}t=Z4;break;case tge:if(_===0&&(N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0&&(b.write=N,C=b.inflate_flush(T,C),N=b.write,_=N<b.read?b.read-N-1:b.end-N,N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0)))return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);C=0,b.win[N++]=s,_--,t=Z4;break;case eY:if(O>7&&(O-=8,M++,R--),b.write=N,C=b.inflate_flush(T,C),N=b.write,_=N<b.read?b.read-N-1:b.end-N,b.read!=b.write)return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);t=nge;case nge:return C=1,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);case $4:return C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);default:return C=-2,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C)}},e.free=function(){}}var ige=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],DS=0,tY=1,oge=2,rge=3,sge=4,age=5,Q4=6,J4=7,cge=8,vT=9;function Jot(e,t){let n=this,i=DS,o=0,r=0,s=0,a,c=[0],u=[0],f=new Qot,d=0,p=new Int32Array(pge*3),g=0,m=new iY;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,b){b&&(b[0]=g),i==Q4&&f.free(x),i=DS,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,b){let T,C,A;return C=x.next_out_index,A=n.read,T=(A<=n.write?n.write:n.end)-A,T>x.avail_out&&(T=x.avail_out),T!==0&&b==-5&&(b=0),x.avail_out-=T,x.total_out+=T,x.next_out.set(n.win.subarray(A,A+T),C),C+=T,A+=T,A==n.end&&(A=0,n.write==n.end&&(n.write=0),T=n.write-A,T>x.avail_out&&(T=x.avail_out),T!==0&&b==-5&&(b=0),x.avail_out-=T,x.total_out+=T,x.next_out.set(n.win.subarray(A,A+T),C),C+=T,A+=T),x.next_out_index=C,n.read=A,b},n.proc=function(x,b){let T,C,A,E,v,D,O,R;for(E=x.next_in_index,v=x.avail_in,C=n.bitb,A=n.bitk,D=n.write,O=D<n.read?n.read-D-1:n.end-D;;){let M,N,_,S,w,I,L,B;switch(i){case DS:for(;A<3;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}switch(T=C&7,d=T&1,T>>>1){case 0:C>>>=3,A-=3,T=A&7,C>>>=T,A-=T,i=tY;break;case 1:M=[],N=[],_=[[]],S=[[]],iY.inflate_trees_fixed(M,N,_,S),f.init(M[0],N[0],_[0],0,S[0],0),C>>>=3,A-=3,i=Q4;break;case 2:C>>>=3,A-=3,i=rge;break;case 3:return C>>>=3,A-=3,i=vT,x.msg="invalid block type",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b)}break;case tY:for(;A<32;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}if((~C>>>16&65535)!=(C&65535))return i=vT,x.msg="invalid stored block lengths",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);o=C&65535,C=A=0,i=o!==0?oge:d!==0?J4:DS;break;case oge:if(v===0||O===0&&(D==n.end&&n.read!==0&&(D=0,O=D<n.read?n.read-D-1:n.end-D),O===0&&(n.write=D,b=n.inflate_flush(x,b),D=n.write,O=D<n.read?n.read-D-1:n.end-D,D==n.end&&n.read!==0&&(D=0,O=D<n.read?n.read-D-1:n.end-D),O===0)))return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);if(b=0,T=o,T>v&&(T=v),T>O&&(T=O),n.win.set(x.read_buf(E,T),D),E+=T,v-=T,D+=T,O-=T,(o-=T)!==0)break;i=d!==0?J4:DS;break;case rge:for(;A<14;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}if(r=T=C&16383,(T&31)>29||(T>>5&31)>29)return i=vT,x.msg="too many length or distance symbols",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);if(T=258+(T&31)+(T>>5&31),!a||a.length<T)a=[];else for(R=0;R<T;R++)a[R]=0;C>>>=14,A-=14,s=0,i=sge;case sge:for(;s<4+(r>>>10);){for(;A<3;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}a[ige[s++]]=C&7,C>>>=3,A-=3}for(;s<19;)a[ige[s++]]=0;if(c[0]=7,T=m.inflate_trees_bits(a,c,u,p,x),T!=0)return b=T,b==-3&&(a=null,i=vT),n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);s=0,i=age;case age:for(;T=r,!(s>=258+(T&31)+(T>>5&31));){let U,V;for(T=c[0];A<T;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}if(T=p[(u[0]+(C&qu[T]))*3+1],V=p[(u[0]+(C&qu[T]))*3+2],V<16)C>>>=T,A-=T,a[s++]=V;else{for(R=V==18?7:V-14,U=V==18?11:3;A<T+R;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}if(C>>>=T,A-=T,U+=C&qu[R],C>>>=R,A-=R,R=s,T=r,R+U>258+(T&31)+(T>>5&31)||V==16&&R<1)return a=null,i=vT,x.msg="invalid bit length repeat",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);V=V==16?a[R-1]:0;do a[R++]=V;while(--U!==0);s=R}}if(u[0]=-1,w=[],I=[],L=[],B=[],w[0]=9,I[0]=6,T=r,T=m.inflate_trees_dynamic(257+(T&31),1+(T>>5&31),a,w,I,L,B,p,x),T!=0)return T==-3&&(a=null,i=vT),b=T,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);f.init(w[0],I[0],p,L[0],p,B[0]),i=Q4;case Q4:if(n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,(b=f.proc(n,x,b))!=1)return n.inflate_flush(x,b);if(b=0,f.free(x),E=x.next_in_index,v=x.avail_in,C=n.bitb,A=n.bitk,D=n.write,O=D<n.read?n.read-D-1:n.end-D,d===0){i=DS;break}i=J4;case J4:if(n.write=D,b=n.inflate_flush(x,b),D=n.write,O=D<n.read?n.read-D-1:n.end-D,n.read!=n.write)return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);i=cge;case cge:return b=1,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);case vT:return b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);default:return b=-2,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b)}}},n.free=function(x){n.reset(x,null),n.win=null,p=null},n.set_dictionary=function(x,b,T){n.win.set(x.subarray(b,b+T),0),n.read=n.write=T},n.sync_point=function(){return i==tY?1:0}}var ert=32,trt=8,nrt=0,lge=1,uge=2,fge=3,dge=4,hge=5,nY=6,lF=7,mge=12,d0=13,irt=[0,0,255,255];function ort(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=lF,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new Jot(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==Got?-5:0,o=-5;;)switch(s.mode){case nrt:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=trt){s.mode=d0,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=d0,n.msg="invalid win size",s.marker=5;break}s.mode=lge;case lge:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=d0,n.msg="incorrect header check",s.marker=5;break}if(!(r&ert)){s.mode=lF;break}s.mode=uge;case uge:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=fge;case fge:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=dge;case dge:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=hge;case hge:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=nY,2);case nY:return s.mode=d0,n.msg="need dictionary",s.marker=0,-2;case lF:if(o=s.blocks.proc(n,o),o==-3){s.mode=d0,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=mge;case mge:return n.avail_in=0,1;case d0:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=nY)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=lF,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=d0&&(c.mode=d0,c.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=c.marker;i!==0&&r<4;)n.read_byte(o)==irt[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,c.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=lF,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function _ge(){}_ge.prototype={inflateInit(e){let t=this;return t.istate=new ort,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};function gge(e){let t=this,n=new _ge,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=Hot,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let u=[],f,d,p=0,g=0,m=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),f=n.inflate(o),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(r)):u.push(r.subarray(0,n.next_out_index))),m+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(d=new Uint8Array(m),u.forEach(function(x){d.set(x,g),g+=x.length})):d=u[0]?new Uint8Array(u[0]):new Uint8Array,d}},t.flush=function(){n.inflateEnd()}}var IS="/",oY=new Date(2107,11,31),rY=new Date(1980,0,1),Di=void 0,Yu="undefined",ig="function";var uF=class{constructor(t){return class extends null{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var rrt=64,yge=2;try{typeof navigator!=Yu&&navigator.hardwareConcurrency&&(yge=navigator.hardwareConcurrency)}catch{}var srt={chunkSize:512*1024,maxWorkers:yge,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Di,CompressionStreamNative:typeof CompressionStream!=Yu&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Yu&&DecompressionStream},m0=Object.assign({},srt);function fF(){return m0}function eH(e){return Math.max(e.chunkSize,rrt)}function PS(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:u,DecompressionStream:f,workerScripts:d}=e;if(h0("baseURL",t),h0("chunkSize",n),h0("maxWorkers",i),h0("terminateWorkerTimeout",o),h0("useCompressionStream",r),h0("useWebWorkers",s),a&&(m0.CompressionStream=new uF(a)),c&&(m0.DecompressionStream=new uF(c)),h0("CompressionStream",u),h0("DecompressionStream",f),d!==Di){let{deflate:p,inflate:g}=d;if((p||g)&&(m0.workerScripts||(m0.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");m0.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");m0.workerScripts.inflate=g}}}function h0(e,t){t!==Di&&(m0[e]=t)}var xge=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;xge[e]=t}var og=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^xge[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var dF=class extends null{constructor(){let t,n=new og;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};function RS(e){if(typeof TextEncoder==Yu){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var dl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=dl.getPartial(n);return i===32?e.concat(t):dl._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+dl.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=dl.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=dl.getPartial(o);return i.push(dl.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},hF={bytes:{fromBits(e){let n=dl.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(dl.partial(8*(n&3),i)),t}}},bge={};bge.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=hF.utf8String.toBits(e));let n=t._buffer=dl.concat(t._buffer,e),i=t._length,o=t._length=i+dl.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=dl.concat(t,[dl.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var sY={};sY.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=o[c=o[a=o[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=o[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],u=r[3],f=r[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],x=4,b,T,C;for(let A=0;A<i;A++)b=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[m&255]^n[x],T=s[p>>>24]^a[g>>16&255]^c[m>>8&255]^u[d&255]^n[x+1],C=s[g>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[x+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[x+3],x+=4,d=b,p=T,g=C;for(let A=0;A<4;A++)o[t?3&-A:A]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[x++],b=d,d=p,p=g,g=m,m=b;return o}};var Tge={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},aY={};aY.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=dl.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return dl.clamp(t,o)}};var p0={importKey(e){return new p0.hmacSha1(hF.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,u,f=new ArrayBuffer(o),d=new DataView(f),p=0,g=dl;for(t=hF.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)d.setInt32(p,r[a]),p+=4}return f.slice(0,i/8)}};p0.hmacSha1=class{constructor(e){let t=this,n=t._hash=bge.sha1,i=[[],[]];t._baseHash=[new n,new n];let o=t._baseHash[0].blockSize/32;e.length>o&&(e=new n().update(e).finalize());for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var art=typeof crypto!=Yu&&typeof crypto.getRandomValues==ig,_0="Invalid password",wT="Invalid signature",rg="zipjs-abort-check-password";function tH(e){return art?crypto.getRandomValues(e):Tge.getRandomValues(e)}var OS=16,crt="raw",Ege={name:"PBKDF2"},lrt={name:"HMAC"},urt="SHA-1",frt=Object.assign({hash:lrt},Ege),cY=Object.assign({iterations:1e3,hash:{name:urt}},Ege),drt=["deriveBits"],pF=[8,12,16],mF=[16,24,32],g0=10,hrt=[0,0,0,0],oH=typeof crypto!=Yu,yF=oH&&crypto.subtle,Sge=oH&&typeof yF!=Yu,Gm=hF.bytes,mrt=sY.aes,prt=aY.ctrGladman,_rt=p0.hmacSha1,Cge=oH&&Sge&&typeof yF.importKey==ig,Age=oH&&Sge&&typeof yF.deriveBits==ig,nH=class extends null{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:Dge(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await grt(c,f,u,ud(s,0,pF[f]+2)),s=ud(s,pF[f]+2),r?a.error(new Error(rg)):d()):await p;let g=new Uint8Array(s.length-g0-(s.length-g0)%OS);a.enqueue(vge(c,s,g,0,g0,!0))},async flush(s){let{signed:a,ctr:c,hmac:u,pending:f,ready:d}=this;if(u&&c){await d;let p=ud(f,0,f.length-g0),g=ud(f,f.length-g0),m=new Uint8Array;if(p.length){let x=gF(Gm,p);u.update(x);let b=c.update(x);m=_F(Gm,b)}if(a){let x=ud(_F(Gm,u.digest()),0,g0);for(let b=0;b<g0;b++)if(x[b]!=g[b])throw new Error(wT)}s.enqueue(m)}}})}},iH=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:Dge(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:u,resolveReady:f,ready:d}=a,p=new Uint8Array;c?(p=await yrt(a,u,c),f()):await d;let g=new Uint8Array(p.length+r.length-r.length%OS);g.set(p,0),s.enqueue(vge(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(c.length){let d=s.update(gF(Gm,c));a.update(d),f=_F(Gm,d)}o.signature=_F(Gm,a.digest()).slice(0,g0),r.enqueue(lY(f,o.signature))}}}),o=this}};function vge(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,u=t.length-o;c.length&&(t=lY(c,t),n=Trt(n,u-u%OS));let f;for(f=0;f<=u-OS;f+=OS){let d=gF(Gm,ud(t,f,f+OS));r&&a.update(d);let p=s.update(d);r||a.update(p),n.set(_F(Gm,p),f+i)}return e.pending=ud(t,f),n}async function grt(e,t,n,i){let o=await wge(e,t,n,ud(i,0,pF[t])),r=ud(i,pF[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(_0)}async function yrt(e,t,n){let i=tH(new Uint8Array(pF[t])),o=await wge(e,t,n,i);return lY(i,o)}async function wge(e,t,n,i){e.password=null;let o=await xrt(crt,n,frt,!1,drt),r=await brt(Object.assign({salt:i},cY),o,8*(mF[t]*2+2)),s=new Uint8Array(r),a=gF(Gm,ud(s,0,mF[t])),c=gF(Gm,ud(s,mF[t],mF[t]*2)),u=ud(s,mF[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new prt(new mrt(a),Array.from(hrt)),hmac:new _rt(c)}),u}async function xrt(e,t,n,i,o){if(Cge)try{return await yF.importKey(e,t,n,i,o)}catch{return Cge=!1,p0.importKey(t)}else return p0.importKey(t)}async function brt(e,t,n){if(Age)try{return await yF.deriveBits(e,t,n)}catch{return Age=!1,p0.pbkdf2(t,e.salt,cY.iterations,n)}else return p0.pbkdf2(t,e.salt,cY.iterations,n)}function Dge(e,t){return t===Di?RS(e):t}function lY(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function Trt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function ud(e,t,n){return e.subarray(t,n)}function _F(e,t){return e.fromBits(t)}function gF(e,t){return e.toBits(t)}var MS=12,rH=class extends null{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Oge(this,t)},transform(o,r){let s=this;if(s.password){let a=Ige(s,o.subarray(0,MS));if(s.password=null,a[MS-1]!=s.passwordVerification)throw new Error(_0);o=o.subarray(MS)}i?r.error(new Error(rg)):r.enqueue(Ige(s,o))}})}},sH=class extends null{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Oge(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=tH(new Uint8Array(MS));c[MS-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(Pge(r,c),0),a=MS}else s=new Uint8Array(i.length),a=0;s.set(Pge(r,i),a),o.enqueue(s)}})}};function Ige(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Mge(e)^t[i],uY(e,n[i]);return n}function Pge(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Mge(e)^t[i],uY(e,t[i]);return n}function Oge(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new og(n[0]),crcKey2:new og(n[2])});for(let i=0;i<t.length;i++)uY(e,t.charCodeAt(i))}function uY(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Rge(Math.imul(Rge(i+Lge(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function Mge(e){let t=e.keys[2]|2;return Lge(Math.imul(t,t^1)>>>8)}function Lge(e){return e&255}function Rge(e){return e&4294967295}var Nge="deflate-raw",aH=class extends null{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:u,level:f}=t,d=this,p,g,m=Fge(super.readable);(!s||c)&&u&&(p=new dF,m=Wm(m,p)),r&&(m=kge(m,a,{level:f,chunkSize:n},o,i)),s&&(c?m=Wm(m,new sH(t)):(g=new iH(t),m=Wm(m,g))),Bge(d,m,()=>{let x;s&&!c&&(x=g.signature),(!s||c)&&u&&(x=new DataView(p.value.buffer).getUint32(0)),d.signature=x})}},cH=class extends null{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:u,useCompressionStream:f}=t,d,p,g=Fge(super.readable);s&&(r?g=Wm(g,new rH(t)):(p=new nH(t),g=Wm(g,p))),u&&(g=kge(g,f,{chunkSize:n},o,i)),(!s||r)&&a&&(d=new dF,g=Wm(g,d)),Bge(this,g,()=>{if((!s||r)&&a){let m=new DataView(d.value.buffer);if(c!=m.getUint32(0,!1))throw new Error(wT)}})}};function Fge(e){return Wm(e,new null({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function Bge(e,t,n){t=Wm(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function kge(e,t,n,i,o){try{let r=t&&i?i:o;e=Wm(e,new r(Nge,n))}catch{if(t)try{e=Wm(e,new o(Nge,n))}catch{return e}else return e}return e}function Wm(e,t){return e.pipeThrough(t)}var Vge="message",Uge="start",zge="pull",fY="data",Hge="ack",dY="close",fH="deflate",dH="inflate";var lH=class extends null{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(fH)?r=aH:o.startsWith(dH)&&(r=cH);let s=0,a=0,c=new r(t,n),u=super.readable,f=new null({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),d=new null({transform(p,g){p&&p.length&&(s+=p.length,g.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(f).pipeThrough(c).pipeThrough(d)}})}},uH=class extends null{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var jge=typeof Worker!=Yu;var LS=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:u},f){let{signal:d}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new uH(r.chunkSize)).pipeThrough(new mY(n,s),{signal:d}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:m}=t;g?(m?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,f(t)}}),(a&&jge?Crt:qge)(t,r)}},mY=class extends null{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await hY(n,o)},async transform(a,c){s+=a.length,i&&await hY(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await hY(r,s)}})}};async function hY(e,...t){try{await e(...t)}catch{}}function qge(e,t){return{run:()=>Art(e,t)}}function Crt(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=vrt(e.scripts[0],n,e)}catch{return jge=!1,qge(e,t)}Object.assign(e,{worker:o,interface:{run:()=>Ert(e,{chunkSize:i})}})}return e.interface}async function Art({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new lH(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}finally{i()}}async function Ert(e,t){let n,i,o=new Promise((p,g)=>{n=p,i=g});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:u}=Srt(e.writable),f=hH({type:Uge,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);f||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let d=await o;return f||await c.getWriter().close(),await u,d}function Srt(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var Gge=!0,Wge=!0;function vrt(e,t,n){let i={type:"module"},o,r;typeof e==ig&&(e=e());try{o=new URL(e,t)}catch{o=e}if(Gge)try{r=new Worker(o)}catch{Gge=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(Vge,s=>wrt(s,n)),r}function hH(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,c.push(e.value)),o&&Wge?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{Wge=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function wrt({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d}=t;try{if(s){let{message:g,stack:m,code:x,name:b}=s,T=new Error(g);Object.assign(T,{stack:m,code:x,name:b}),p(T)}else{if(n==zge){let{value:g,done:m}=await a.read();hH({type:fY,value:g,done:m,messageId:o},t)}n==fY&&(await c.ready,await c.write(new Uint8Array(i)),hH({type:Hge,messageId:o},t)),n==dY&&p(null,r)}}catch(g){hH({type:dY,messageId:o},t),p(g)}function p(g,m){g?f(g):u(m),c&&c.releaseLock(),d()}}var DT=[],pY=[];var Yge=0;async function mH(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:c,signed:u,encrypted:f}=n,{workerScripts:d,maxWorkers:p}=i;t.transferStreams=o||o===Di;let g=!c&&!u&&!f&&!t.transferStreams;return t.useWebWorkers=!g&&(r||r===Di&&i.useWebWorkers),t.scripts=t.useWebWorkers&&d?d[a]:[],n.useCompressionStream=s||s===Di&&i.useCompressionStream,(await m()).run();async function m(){let b=DT.find(T=>!T.busy);if(b)return Xge(b),new LS(b,e,t,x);if(DT.length<p){let T={indexWorker:Yge};return Yge++,DT.push(T),new LS(T,e,t,x)}else return new Promise(T=>pY.push({resolve:T,stream:e,workerOptions:t}))}function x(b){if(pY.length){let[{resolve:T,stream:C,workerOptions:A}]=pY.splice(0,1);T(new LS(b,C,A,x))}else b.worker?(Xge(b),Drt(b,t)):DT=DT.filter(T=>T!=b)}}function Drt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{DT=DT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function Xge(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var Irt="Writer iterator completed too soon",Prt="text/plain";var Rrt="Content-Type";var Ort=64*1024,yY="writable",NS=class{constructor(){this.size=0}init(){this.initialized=!0}},pH=class extends NS{get readable(){let t=this,{chunkSize:n=Ort}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this;o.enqueue(await Ha(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},_Y=class extends NS{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,yY,{get(){return n}})}writeUint8Array(){}};var _H=class extends _Y{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length>2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},sg=class extends pH{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return s.byteLength>n&&(s=s.slice(t,o)),new Uint8Array(s)}},xF=class extends NS{constructor(t){super();let n=this,i=new null,o=[];t&&o.push([Rrt,t]),Object.defineProperty(n,yY,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},gH=class extends sg{constructor(t){super(new Blob([t],{type:Prt}))}},yH=class extends xF{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var gY=class extends pH{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;c>=r[a].size;)c-=r[a].size,a++;let u=r[a],f=u.size;if(c+n<=f)s=await Ha(u,c,n);else{let d=f-c;s=new Uint8Array(n),s.set(await Ha(u,c,d)),s.set(await o.readUint8Array(t+d,n-d,i),d)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},xH=class extends NS{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(f){let{availableSize:d}=i;if(s)f.length>=d?(await c(f.slice(0,d)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.slice(d))):await c(f);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(Irt);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await qm(o),r=p.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,yY,{get(){return a}});async function c(f){let d=f.length;d&&(await s.ready,await s.write(f),o.size+=d,i.size+=d,i.availableSize-=d)}async function u(){r.size=o.size,await s.close()}}};async function qm(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function bH(e){return Array.isArray(e)&&(e=new gY(e)),e instanceof ReadableStream&&(e={readable:e}),e}function TH(e){e.writable===Di&&typeof e.next==ig&&(e=new xH(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Di&&(t.size=0),e instanceof xH||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Ha(e,t,n,i){return e.readUint8Array(t,n,i)}var Kge="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Mrt=Kge.length==256;function Zge(e){if(Mrt){let t="";for(let n=0;n<e.length;n++)t+=Kge[e[n]];return t}else return new TextDecoder().decode(e)}function bF(e,t){return t&&t.trim().toLowerCase()=="cp437"?Zge(e):new TextDecoder(t).decode(e)}var xY="filename",bY="rawFilename",TY="comment",CY="rawComment",AY="uncompressedSize",EY="compressedSize",SY="offset",CH="diskNumberStart",FS="lastModDate",AH="rawLastModDate",TF="lastAccessDate",$ge="rawLastAccessDate",CF="creationDate",Qge="rawCreationDate",vY="internalFileAttribute",wY="externalFileAttribute",DY="msDosCompatible",EH="zip64",IY="encrypted",PY="version",RY="versionMadeBy",OY="zipCrypto",Lrt=[xY,bY,EY,AY,FS,AH,TY,CY,TF,CF,SY,CH,CH,vY,wY,DY,EH,IY,PY,RY,OY,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],y0=class{constructor(t){Lrt.forEach(n=>this[n]=t[n])}};var MY="File format is not recognized",krt="End of central directory not found",Vrt="End of Zip64 central directory locator not found",Urt="Central directory header not found",zrt="Local file header not found",Hrt="Zip64 extra field not found",Grt="File contains encrypted entry",Wrt="Encryption method not supported",Jge="Compression method not supported",eye="Split zip file",tye="utf-8",nye="cp437",jrt=[[AY,4294967295],[EY,4294967295],[SY,4294967295],[CH,65535]],qrt={[65535]:{getValue:Ts,bytes:4},[4294967295]:{getValue:SH,bytes:8}},OH=class{constructor(t,n={}){Object.assign(this,{reader:bH(t),options:n,config:fF()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await qm(i),(i.size===Di||!i.readUint8Array)&&(i=new sg(await new Response(i.readable).blob()),await qm(i)),i.size<22)throw new Error(MY);i.chunkSize=eH(o);let r=await $rt(i,101010256,i.size,22,65535*16);if(!r){let N=await Ha(i,0,4),_=Ta(N);throw Ts(_)==134695760?new Error(eye):new Error(krt)}let s=Ta(r),a=Ts(s,12),c=Ts(s,16),u=r.offset,f=ba(s,20),d=u+22+f,p=ba(s,4),g=i.lastDiskNumber||0,m=ba(s,6),x=ba(s,8),b=0,T=0;if(c==4294967295||a==4294967295||x==65535||m==65535){let N=await Ha(i,r.offset-20,20),_=Ta(N);if(Ts(_,0)==117853008){c=SH(_,8);let S=await Ha(i,c,56,-1),w=Ta(S),I=r.offset-20-56;if(Ts(w,0)!=101075792&&c!=I){let L=c;c=I,b=c-L,S=await Ha(i,c,56,-1),w=Ta(S)}if(Ts(w,0)!=101075792)throw new Error(Vrt);p==65535&&(p=Ts(w,16)),m==65535&&(m=Ts(w,20)),x==65535&&(x=SH(w,32)),a==4294967295&&(a=SH(w,40)),c-=a}}if(c>=i.size&&(b=i.size-c-a-22,c=i.size-a-22),g!=p)throw new Error(eye);if(c<0)throw new Error(MY);let C=0,A=await Ha(i,c,a,m),E=Ta(A);if(a){let N=r.offset-a;if(Ts(E,C)!=33639248&&c!=N){let _=c;c=N,b+=c-_,A=await Ha(i,c,a,m),E=Ta(A)}}let v=r.offset-c-(i.lastDiskOffset||0);if(a!=v&&v>=0&&(a=v,A=await Ha(i,c,a,m),E=Ta(A)),c<0||c>=i.size)throw new Error(MY);let D=hl(n,t,"filenameEncoding"),O=hl(n,t,"commentEncoding");for(let N=0;N<x;N++){let _=new NY(i,o,n.options);if(Ts(E,C)!=33639248)throw new Error(Urt);oye(_,E,C+6);let S=!!_.bitFlag.languageEncodingFlag,w=C+46,I=w+_.filenameLength,L=I+_.extraFieldLength,B=ba(E,C+4),U=(B&0)==0,V=A.subarray(w,I),G=ba(E,C+32),k=L+G,W=A.subarray(L,k),q=S,J=S,j=U&&(BS(E,C+38)&16)==16,K=Ts(E,C+42)+b;Object.assign(_,{versionMadeBy:B,msDosCompatible:U,compressedSize:0,uncompressedSize:0,commentLength:G,directory:j,offset:K,diskNumberStart:ba(E,C+34),internalFileAttribute:ba(E,C+36),externalFileAttribute:Ts(E,C+38),rawFilename:V,filenameUTF8:q,commentUTF8:J,rawExtraField:A.subarray(I,L)});let Q=hl(n,t,"decodeText")||bF,de=q?tye:D||nye,xe=J?tye:O||nye,ce=Q(V,de);ce===Di&&(ce=bF(V,de));let ge=Q(W,xe);ge===Di&&(ge=bF(W,xe)),Object.assign(_,{rawComment:W,filename:ce,comment:ge,directory:j||ce.endsWith(IS)}),T=Math.max(K,T),rye(_,_,E,C+6),_.zipCrypto=_.encrypted&&!_.extraFieldAES;let be=new y0(_);be.getData=(Ae,ke)=>_.getData(Ae,be,ke),C=k;let{onprogress:De}=t;if(De)try{await De(N+1,x,new y0(_))}catch{}yield be}let R=hl(n,t,"extractPrependedData"),M=hl(n,t,"extractAppendedData");return R&&(n.prependedData=T>0?await Ha(i,0,T):new Uint8Array),n.comment=f?await Ha(i,u+22,f):new Uint8Array,M&&(n.appendedData=d<i.size?await Ha(i,d,i.size-d):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var NY=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:c,compressionMethod:u,config:f,bitFlag:d,signature:p,rawLastModDate:g,uncompressedSize:m,compressedSize:x}=o,b=n.localDirectory={},T=await Ha(r,s,30,a),C=Ta(T),A=hl(o,i,"password"),E=hl(o,i,"rawPassword"),v=hl(o,i,"passThrough");if(A=A&&A.length&&A,E=E&&E.length&&E,c&&c.originalCompressionMethod!=99)throw new Error(Jge);if(u!=0&&u!=8&&!v)throw new Error(Jge);if(Ts(C,0)!=67324752)throw new Error(zrt);oye(b,C,4),b.rawExtraField=b.extraFieldLength?await Ha(r,s+30+b.filenameLength,b.extraFieldLength,a):new Uint8Array,rye(o,b,C,4,!0),Object.assign(n,{lastAccessDate:b.lastAccessDate,creationDate:b.creationDate});let D=o.encrypted&&b.encrypted&&!v,O=D&&!c;if(v||(n.zipCrypto=O),D){if(!O&&c.strength===Di)throw new Error(Wrt);if(!A&&!E)throw new Error(Grt)}let R=s+30+b.filenameLength+b.extraFieldLength,M=x,N=r.readable;Object.assign(N,{diskNumberStart:a,offset:R,size:M});let _=hl(o,i,"signal"),S=hl(o,i,"checkPasswordOnly");S&&(t=new WritableStream),t=TH(t),await qm(t,v?x:m);let{writable:w}=t,{onstart:I,onprogress:L,onend:B}=i,U={options:{codecType:dH,password:A,rawPassword:E,zipCrypto:O,encryptionStrength:c&&c.strength,signed:hl(o,i,"checkSignature")&&!v,passwordVerification:O&&(d.dataDescriptor?g>>>8&255:p>>>24&255),signature:p,compressed:u!=0&&!v,encrypted:o.encrypted&&!v,useWebWorkers:hl(o,i,"useWebWorkers"),useCompressionStream:hl(o,i,"useCompressionStream"),transferStreams:hl(o,i,"transferStreams"),checkPasswordOnly:S},config:f,streamOptions:{signal:_,size:M,onstart:I,onprogress:L,onend:B}},V=0;try{({outputSize:V}=await mH({readable:N,writable:w},U))}catch(G){if(!S||G.message!=rg)throw G}finally{let G=hl(o,i,"preventClose");w.size+=V,!G&&!w.locked&&await w.getWriter().close()}return S?Di:t.getData?t.getData():w}};function oye(e,t,n){let i=e.rawBitFlag=ba(t,n+2),o=(i&1)==1,r=Ts(t,n+6);Object.assign(e,{encrypted:o,version:ba(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:Qrt(r),filenameLength:ba(t,n+22),extraFieldLength:ba(t,n+24)})}function rye(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=Ta(new Uint8Array(r)),c=0;try{for(;c<r.length;){let T=ba(a,c),C=ba(a,c+2);s.set(T,{type:T,data:r.slice(c+4,c+4+C)}),c+=4+C}}catch{}let u=ba(n,i+4);Object.assign(t,{signature:Ts(n,i+10),uncompressedSize:Ts(n,i+18),compressedSize:Ts(n,i+14)});let f=s.get(1);f&&(Yrt(f,t),t.extraFieldZip64=f);let d=s.get(28789);d&&(iye(d,xY,bY,t,e),t.extraFieldUnicodePath=d);let p=s.get(25461);p&&(iye(p,TY,CY,t,e),t.extraFieldUnicodeComment=p);let g=s.get(39169);g?(Xrt(g,t,u),t.extraFieldAES=g):t.compressionMethod=u;let m=s.get(10);m&&(Krt(m,t),t.extraFieldNTFS=m);let x=s.get(21589);x&&(Zrt(x,t,o),t.extraFieldExtendedTimestamp=x);let b=s.get(6534);b&&(t.extraFieldUSDZ=b)}function Yrt(e,t){t.zip64=!0;let n=Ta(e.data),i=jrt.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[s,a]=i[o];if(t[s]==a){let c=qrt[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(Hrt)}}function iye(e,t,n,i,o){let r=Ta(e.data),s=new og;s.append(o[n]);let a=Ta(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Ts(r,1);Object.assign(e,{version:BS(r,0),[t]:bF(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==Ts(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function Xrt(e,t,n){let i=Ta(e.data),o=BS(i,4);Object.assign(e,{vendorVersion:BS(i,0),vendorId:BS(i,2),strength:o,originalCompressionMethod:n,compressionMethod:ba(i,5)}),t.compressionMethod=e.compressionMethod}function Krt(e,t){let n=Ta(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=ba(n,i),s=ba(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=Ta(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=LY(s),f=LY(a),d=LY(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function Zrt(e,t,n){let i=Ta(e.data),o=BS(i,0),r=[],s=[];n?((o&1)==1&&(r.push(FS),s.push(AH)),(o&2)==2&&(r.push(TF),s.push($ge)),(o&4)==4&&(r.push(CF),s.push(Qge))):e.data.length>=5&&(r.push(FS),s.push(AH));let a=1;r.forEach((c,u)=>{if(e.data.length>=a+4){let f=Ts(i,a);t[c]=e[c]=new Date(f*1e3);let d=s[u];e[d]=f}a+=4})}async function $rt(e,t,n,i,o){let r=new Uint8Array(4),s=Ta(r);Jrt(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,d=await Ha(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==r[0]&&d[p+1]==r[1]&&d[p+2]==r[2]&&d[p+3]==r[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function hl(e,t,n){return t[n]===Di?e.options[n]:t[n]}function Qrt(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function LY(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function BS(e,t){return e.getUint8(t)}function ba(e,t){return e.getUint16(t,!0)}function Ts(e,t){return e.getUint32(t,!0)}function SH(e,t){return Number(e.getBigUint64(t,!0))}function Jrt(e,t,n){e.setUint32(t,n,!0)}function Ta(e){return new DataView(e.buffer)}var ist="File already exists",ost="Zip file comment exceeds 64KB",rst="File entry comment exceeds 64KB",sst="File entry name exceeds 64KB",cye="Version exceeds 65535",ast="The strength must equal 1, 2, or 3",cst="Extra field type exceeds 65535",lst="Extra field data exceeds 64KB",KY="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",ust="Undefined uncompressed size",lye=new Uint8Array([7,0,2,0,65,69,3,0,0]),YY=0,uye=[],NH=class{constructor(t,n={}){t=TH(t);let i=t.availableSize!==Di&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Di&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:fF(),files:new Map,filenames:new Set,offset:n.offset===Di?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;YY<s.maxWorkers?YY++:await new Promise(c=>uye.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(ist);return o.filenames.add(t),a=fst(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=uye.shift();c?c():YY--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await bst(this,t,n),go(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function fst(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(IS)?t+=IS:i.directory=t.endsWith(IS);let o=go(e,i,"encodeText",RS),r=o(t);if(r===Di&&(r=RS(t)),$i(r)>65535)throw new Error(sst);let s=i.comment||"",a=o(s);if(a===Di&&(a=RS(s)),$i(a)>65535)throw new Error(rst);let c=go(e,i,PY,20);if(c>65535)throw new Error(cye);let u=go(e,i,RY,20);if(u>65535)throw new Error(cye);let f=go(e,i,FS,new Date),d=go(e,i,TF),p=go(e,i,CF),g=go(e,i,DY,!0),m=go(e,i,vY,0),x=go(e,i,wY,0),b=go(e,i,"passThrough"),T,C;b||(T=go(e,i,"password"),C=go(e,i,"rawPassword"));let A=go(e,i,"encryptionStrength",3),E=go(e,i,OY),v=go(e,i,"extendedTimestamp",!0),D=go(e,i,"keepOrder",!0),O=go(e,i,"level"),R=go(e,i,"useWebWorkers"),M=go(e,i,"bufferedWrite"),N=go(e,i,"dataDescriptorSignature",!1),_=go(e,i,"signal"),S=go(e,i,"useUnicodeFileNames",!0),w=go(e,i,"useCompressionStream"),I=go(e,i,"compressionMethod"),L=go(e,i,"dataDescriptor",!0),B=go(e,i,EH);if(!E&&(T!==Di||C!==Di)&&!(A>=1&&A<=3))throw new Error(ast);let U=new Uint8Array,{extraField:V}=i;if(V){let vt=0,pt=0;V.forEach(Be=>vt+=4+$i(Be)),U=new Uint8Array(vt),V.forEach((Be,qt)=>{if(qt>65535)throw new Error(cst);if($i(Be)>65535)throw new Error(lst);Ms(U,new Uint16Array([qt]),pt),Ms(U,new Uint16Array([$i(Be)]),pt+2),Ms(U,Be,pt+4),pt+=4+$i(Be)})}let G=0,k=0,W=0;if(b&&({uncompressedSize:W}=i,W===Di))throw new Error(ust);let q=B===!0;n&&(n=bH(n),await qm(n),b?G=fye(W):n.size===Di?(L=!0,(B||B===Di)&&(B=!0,W=G=4294967296)):(W=n.size,G=fye(W)));let{diskOffset:J,diskNumber:j,maxSize:K}=e.writer,Q=q||W>4294967295,de=q||G>4294967295,xe=q||e.offset+e.pendingEntriesSize-J>4294967295,ge=go(e,i,"supportZip64SplitFile",!0)&&q||j+Math.ceil(e.pendingEntriesSize/K)>65535;if(xe||Q||de||ge){if(B===!1||!D)throw new Error(KY);B=!0}B=B||!1;let be=go(e,i,IY),{signature:De}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:c,versionMadeBy:u,lastModDate:f,lastAccessDate:d,creationDate:p,rawExtraField:U,zip64:B,zip64UncompressedSize:Q,zip64CompressedSize:de,zip64Offset:xe,zip64DiskNumberStart:ge,password:T,rawPassword:C,level:!w&&e.config.CompressionStream===Di&&e.config.CompressionStreamNative===Di?0:O,useWebWorkers:R,encryptionStrength:A,extendedTimestamp:v,zipCrypto:E,bufferedWrite:M,keepOrder:D,useUnicodeFileNames:S,dataDescriptor:L,dataDescriptorSignature:N,signal:_,msDosCompatible:g,internalFileAttribute:m,externalFileAttribute:x,useCompressionStream:w,passThrough:b,encrypted:!!(T&&$i(T)||C&&$i(C))||b&&be,signature:De,compressionMethod:I});let Ae=mst(i),ke=_st(i),ze=$i(Ae.localHeaderArray,ke.dataDescriptorArray);k=ze+G,e.options.usdz&&(k+=k+64),e.pendingEntriesSize+=k;let tt;try{tt=await dst(e,t,n,{headerInfo:Ae,dataDescriptorInfo:ke,metadataSize:ze},i)}finally{e.pendingEntriesSize-=k}return Object.assign(tt,{name:t,comment:s,extraField:V}),new y0(tt)}async function dst(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:u}=o,{headerInfo:f}=i,{usdz:d}=e.options,p=Array.from(r.values()).pop(),g={},m,x,b,T,C,A,E;r.set(t,g);try{let R;a&&(R=p&&p.lock,v()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!d?(A=new null,E=new Response(A.readable).blob(),A.writable.size=0,m=!0,e.bufferedWrites++,await qm(s)):(A=s,await D()),await qm(A);let{writable:M}=s,{diskOffset:N}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let S=new Uint8Array(4),w=Ga(S);Zi(w,0,134695760),await Ym(M,S),e.offset+=4}d&&pst(i,e.offset-N),m||(await R,await O(M));let{diskNumber:_}=s;if(C=!0,g.diskNumberStart=_,g=await hst(n,A,g,i,e.config,o),C=!1,r.set(t,g),g.filename=t,m){await A.writable.getWriter().close();let S=await E;await R,await D(),T=!0,c||(S=await yst(g,S,M,o)),await O(M),g.diskNumberStart=s.diskNumber,N=s.diskOffset,await S.stream().pipeTo(M,{preventClose:!0,preventAbort:!0,signal:u}),M.size+=S.size,T=!1}if(g.offset=e.offset-N,g.zip64)xst(g,o);else if(g.offset>4294967295)throw new Error(KY);return e.offset+=g.size,g}catch(R){if(m&&T||!m&&C){if(e.hasCorruptedEntries=!0,R)try{R.corruptedEntry=!0}catch{}m?e.offset+=A.writable.size:e.offset=A.writable.size}throw r.delete(t),R}finally{m&&e.bufferedWrites--,b&&b(),x&&x()}function v(){g.lock=new Promise(R=>b=R)}async function D(){e.writerLocked=!0;let{lockWriter:R}=e;e.lockWriter=new Promise(M=>x=()=>{e.writerLocked=!1,M()}),await R}async function O(R){$i(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Ym(R,new Uint8Array))}}async function hst(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=o,{localHeaderArray:f,headerArray:d,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:x,version:b,compressionMethod:T,rawExtraFieldExtendedTimestamp:C,extraFieldExtendedTimestampFlag:A,rawExtraFieldNTFS:E,rawExtraFieldAES:v}=a,{dataDescriptorArray:D}=c,{rawFilename:O,lastAccessDate:R,creationDate:M,password:N,rawPassword:_,level:S,zip64:w,zip64UncompressedSize:I,zip64CompressedSize:L,zip64Offset:B,zip64DiskNumberStart:U,zipCrypto:V,dataDescriptor:G,directory:k,versionMadeBy:W,rawComment:q,rawExtraField:J,useWebWorkers:j,onstart:K,onprogress:Q,onend:de,signal:xe,encryptionStrength:ce,extendedTimestamp:ge,msDosCompatible:be,internalFileAttribute:De,externalFileAttribute:Ae,useCompressionStream:ke,passThrough:ze}=s,tt={lock:i,versionMadeBy:W,zip64:w,directory:!!k,filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:q,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:E,rawExtraFieldAES:v,rawExtraField:J,extendedTimestamp:ge,msDosCompatible:be,internalFileAttribute:De,externalFileAttribute:Ae,diskNumberStart:n},{signature:vt,uncompressedSize:pt}=s,Be=0;ze||(pt=0);let{writable:qt}=t;if(e){e.chunkSize=eH(r),await Ym(qt,f);let lt=e.readable,jn=lt.size=e.size,sn={options:{codecType:fH,level:S,rawPassword:_,password:N,encryptionStrength:ce,zipCrypto:m&&V,passwordVerification:m&&V&&g>>8&255,signed:!ze,compressed:x&&!ze,encrypted:m&&!ze,useWebWorkers:j,useCompressionStream:ke,transferStreams:!1},config:r,streamOptions:{signal:xe,size:jn,onstart:K,onprogress:Q,onend:de}},me=await mH({readable:lt,writable:qt},sn);Be=me.outputSize,ze||(pt=me.inputSize,vt=me.signature),qt.size+=pt}else await Ym(qt,f);let At;if(w){let lt=4;I&&(lt+=8),L&&(lt+=8),B&&(lt+=8),U&&(lt+=4),At=new Uint8Array(lt)}else At=new Uint8Array;return gst({signature:vt,rawExtraFieldZip64:At,compressedSize:Be,uncompressedSize:pt,headerInfo:a,dataDescriptorInfo:c},s),G&&await Ym(qt,D),Object.assign(tt,{uncompressedSize:pt,compressedSize:Be,lastModDate:p,rawLastModDate:g,creationDate:M,lastAccessDate:R,encrypted:m,zipCrypto:V,size:u+Be,compressionMethod:T,version:b,headerArray:d,signature:vt,rawExtraFieldZip64:At,extraFieldExtendedTimestampFlag:A,zip64UncompressedSize:I,zip64CompressedSize:L,zip64Offset:B,zip64DiskNumberStart:U}),tt}function mst(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:d,encryptionStrength:p,extendedTimestamp:g,encrypted:m}=e,{version:x,compressionMethod:b}=e,T=!f&&(r>0||r===Di&&b!==0),C;if(m&&!a){C=new Uint8Array($i(lye)+2);let B=Ga(C);ro(B,0,39169),Ms(C,lye,2),FH(B,8,p)}else C=new Uint8Array;let A,E,v;if(g){E=new Uint8Array(9+(i?4:0)+(o?4:0));let B=Ga(E);ro(B,0,21589),ro(B,2,$i(E)-4),v=1+(i?2:0)+(o?4:0),FH(B,4,v);let U=5;Zi(B,U,Math.floor(n.getTime()/1e3)),U+=4,i&&(Zi(B,U,Math.floor(i.getTime()/1e3)),U+=4),o&&Zi(B,U,Math.floor(o.getTime()/1e3));try{A=new Uint8Array(36);let V=Ga(A),G=XY(n);ro(V,0,10),ro(V,2,32),ro(V,8,1),ro(V,10,24),Ql(V,12,G),Ql(V,20,XY(i)||G),Ql(V,28,XY(o)||G)}catch{A=new Uint8Array}}else A=E=new Uint8Array;let D=0;c&&(D=D|2048),u&&(D=D|8),b===Di&&(b=T?8:0),b==8&&(r>=1&&r<3&&(D=D|6),r>=3&&r<5&&(D=D|1),r===9&&(D=D|2)),s&&(x=x>45?x:45),m&&(D=D|1,a||(x=x>51?x:51,C[9]=b,b=99));let O=new Uint8Array(26),R=Ga(O);ro(R,0,x),ro(R,2,D),ro(R,4,b);let M=new Uint32Array(1),N=Ga(M),_;n<rY?_=rY:n>oY?_=oY:_=n,ro(N,0,(_.getHours()<<6|_.getMinutes())<<5|_.getSeconds()/2),ro(N,2,(_.getFullYear()-1980<<4|_.getMonth()+1)<<5|_.getDate());let S=M[0];Zi(R,6,S),ro(R,22,$i(t));let w=$i(C,E,A,d);ro(R,24,w);let I=new Uint8Array(30+$i(t)+w),L=Ga(I);return Zi(L,0,67324752),Ms(I,O,4),Ms(I,t,30),Ms(I,C,30+$i(t)),Ms(I,E,30+$i(t,C)),Ms(I,A,30+$i(t,C,E)),Ms(I,d,30+$i(t,C,E,A)),{localHeaderArray:I,headerArray:O,headerView:R,lastModDate:n,rawLastModDate:S,encrypted:m,compressed:T,version:x,compressionMethod:b,extraFieldExtendedTimestampFlag:v,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:A,rawExtraFieldAES:C,extraFieldLength:w}}function pst(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ga(i),s=64-(t+$i(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Ga(a);ro(c,0,6534),ro(c,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array($i(u)+s),Ms(i,u),Ms(i,a,$i(u)),r=Ga(i),ro(r,28,o+s),e.metadataSize+=s}function _st(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=Ga(o),i&&(s=4,Zi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function gst(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:u}=s,{dataDescriptorView:f,dataDescriptorOffset:d}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:m,zipCrypto:x,dataDescriptor:b}=t;if((!u||x)&&n!==Di&&(Zi(c,10,n),b&&Zi(f,d,n)),p){let T=Ga(i);ro(T,0,1),ro(T,2,$i(i)-4);let C=4;g&&(Zi(c,18,4294967295),Ql(T,C,BigInt(r)),C+=8),m&&(Zi(c,14,4294967295),Ql(T,C,BigInt(o))),b&&(Ql(f,d+4,BigInt(o)),Ql(f,d+12,BigInt(r)))}else Zi(c,14,o),Zi(c,18,r),b&&(Zi(f,d+4,o),Zi(f,d+8,r))}async function yst(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&Zi(r,14,e.signature),e.zip64?(Zi(r,18,4294967295),Zi(r,22,4294967295)):(Zi(r,18,e.compressedSize),Zi(r,22,e.uncompressedSize)),await Ym(n,new Uint8Array(o)),t.slice(o.byteLength)}function xst(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,u=Ga(n),f=4;r&&(f+=8),s&&(f+=8),a&&(Ql(u,f,BigInt(i)),f+=8),c&&Zi(u,f,o)}async function bst(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,u=0,f=e.offset-r,d=i.size;for(let[,v]of i){let{rawFilename:D,rawExtraFieldZip64:O,rawExtraFieldAES:R,rawComment:M,rawExtraFieldNTFS:N,rawExtraField:_,extendedTimestamp:S,extraFieldExtendedTimestampFlag:w,lastModDate:I}=v,L;if(S){L=new Uint8Array(9);let B=Ga(L);ro(B,0,21589),ro(B,2,5),FH(B,4,w),Zi(B,5,Math.floor(I.getTime()/1e3))}else L=new Uint8Array;v.rawExtraFieldCDExtendedTimestamp=L,u+=46+$i(D,M,O,R,N,L,_)}let p=new Uint8Array(u),g=Ga(p);await qm(o);let m=0;for(let[v,D]of Array.from(i.values()).entries()){let{offset:O,rawFilename:R,rawExtraFieldZip64:M,rawExtraFieldAES:N,rawExtraFieldCDExtendedTimestamp:_,rawExtraFieldNTFS:S,rawExtraField:w,rawComment:I,versionMadeBy:L,headerArray:B,directory:U,zip64:V,zip64UncompressedSize:G,zip64CompressedSize:k,zip64DiskNumberStart:W,zip64Offset:q,msDosCompatible:J,internalFileAttribute:j,externalFileAttribute:K,diskNumberStart:Q,uncompressedSize:de,compressedSize:xe}=D,ce=$i(M,N,_,S,w);Zi(g,c,33639248),ro(g,c+4,L);let ge=Ga(B);G||Zi(ge,18,de),k||Zi(ge,14,xe),Ms(p,B,c+6),ro(g,c+30,ce),ro(g,c+32,$i(I)),ro(g,c+34,V&&W?65535:Q),ro(g,c+36,j),K?Zi(g,c+38,K):U&&J&&FH(g,c+38,16),Zi(g,c+42,V&&q?4294967295:O),Ms(p,R,c+46),Ms(p,M,c+46+$i(R)),Ms(p,N,c+46+$i(R,M)),Ms(p,_,c+46+$i(R,M,N)),Ms(p,S,c+46+$i(R,M,N,_)),Ms(p,w,c+46+$i(R,M,N,_,S)),Ms(p,I,c+46+$i(R)+ce);let be=46+$i(R,I)+ce;if(c-m>o.availableSize&&(o.availableSize=0,await Ym(s,p.slice(m,c)),m=c),c+=be,n.onprogress)try{await n.onprogress(v+1,i.size,new y0(D))}catch{}}await Ym(s,m?p.slice(m):p);let x=o.diskNumber,{availableSize:b}=o;b<22&&x++;let T=go(e,n,EH);if(f>4294967295||u>4294967295||d>65535||x>65535){if(T===!1)throw new Error(KY);T=!0}let C=new Uint8Array(T?98:22),A=Ga(C);c=0,T&&(Zi(A,0,101075792),Ql(A,4,BigInt(44)),ro(A,12,45),ro(A,14,45),Zi(A,16,x),Zi(A,20,a),Ql(A,24,BigInt(d)),Ql(A,32,BigInt(d)),Ql(A,40,BigInt(u)),Ql(A,48,BigInt(f)),Zi(A,56,117853008),Ql(A,64,BigInt(f)+BigInt(u)),Zi(A,72,x+1),go(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),d=65535,f=4294967295,u=4294967295,c+=76),Zi(A,c,101010256),ro(A,c+4,x),ro(A,c+6,a),ro(A,c+8,d),ro(A,c+10,d),Zi(A,c+12,u),Zi(A,c+16,f);let E=$i(t);if(E)if(E<=65535)ro(A,c+20,E);else throw new Error(ost);await Ym(s,C),E&&await Ym(s,t)}async function Ym(e,t){let n=e.getWriter();try{await n.ready,e.size+=$i(t),await n.write(t)}finally{n.releaseLock()}}function XY(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function go(e,t,n,i){let o=t[n]===Di?e.options[n]:t[n];return o===Di?i:o}function fye(e){return e+5*(Math.floor(e/16383)+1)}function FH(e,t,n){e.setUint8(t,n)}function ro(e,t,n){e.setUint16(t,n,!0)}function Zi(e,t,n){e.setUint32(t,n,!0)}function Ql(e,t,n){e.setBigUint64(t,n,!0)}function Ms(e,t,n){e.set(t,n)}function Ga(e){return new DataView(e.buffer)}function $i(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}PS({Deflate:K_e,Inflate:gge});function Tst(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var In=Tst;function Cst(e,t){this.position=e,this.headingPitchRange=t}var SF=Cst;function BH(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new pe,this.tourEnd=new pe,this.entryStart=new pe,this.entryEnd=new pe,this._activeEntries=[]}BH.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};BH.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;mye.call(this,e,t,function(i){n.playlistIndex=0,i||hye(n._activeEntries),n.tourEnd.raiseEvent(i)})};BH.prototype.stop=function(){hye(this._activeEntries)};function hye(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function mye(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=Ast.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function Ast(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,mye.call(this,e,t,n)}}var vF=BH;var Fi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Fi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Fi.Bounce.In(e*2)*.5:Fi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),wF=function(){return performance.now()},Est=function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=wF()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e}(),kS={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=kS.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=kS.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=kS.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=kS.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},pye=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),ZY=new Est,_ye=function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Fi.Linear.None,this._interpolationFunction=kS.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=pye.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=ZY,ZY.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=wF()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var d=i[s];if(d.length===0)continue;for(var p=[a],g=0,m=d.length;g<m;g+=1){var x=this._handleRelativeValue(a,d[g]);if(isNaN(x)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(x)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var b=a;for(var T in b)n[s][T]=b[T];o[s]=c?[]:{};var d=i[s];if(!this._isDynamic){var C={};for(var T in d)C[T]=d[T];i[s]=d=C}this._setupProperties(b,n[s],d,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=wF()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=wF()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Fi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=kS.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=wF()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var x=Math.trunc(s/a),b=s-x*a,T=Math.min(b/i._duration,1);return T===0&&s===i._duration?1:T},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,m=this._chainedTweens.length;g<m;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),u=Array.isArray(a),f=!c&&u;f?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var Wti=pye.nextId,Xm=ZY,jti=Xm.getAll.bind(Xm),qti=Xm.removeAll.bind(Xm),Yti=Xm.add.bind(Xm),Xti=Xm.remove.bind(Xm),Kti=Xm.update.bind(Xm);var Sst={LINEAR_NONE:Fi.Linear.None,QUADRATIC_IN:Fi.Quadratic.In,QUADRATIC_OUT:Fi.Quadratic.Out,QUADRATIC_IN_OUT:Fi.Quadratic.InOut,CUBIC_IN:Fi.Cubic.In,CUBIC_OUT:Fi.Cubic.Out,CUBIC_IN_OUT:Fi.Cubic.InOut,QUARTIC_IN:Fi.Quartic.In,QUARTIC_OUT:Fi.Quartic.Out,QUARTIC_IN_OUT:Fi.Quartic.InOut,QUINTIC_IN:Fi.Quintic.In,QUINTIC_OUT:Fi.Quintic.Out,QUINTIC_IN_OUT:Fi.Quintic.InOut,SINUSOIDAL_IN:Fi.Sinusoidal.In,SINUSOIDAL_OUT:Fi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Fi.Sinusoidal.InOut,EXPONENTIAL_IN:Fi.Exponential.In,EXPONENTIAL_OUT:Fi.Exponential.Out,EXPONENTIAL_IN_OUT:Fi.Exponential.InOut,CIRCULAR_IN:Fi.Circular.In,CIRCULAR_OUT:Fi.Circular.Out,CIRCULAR_IN_OUT:Fi.Circular.InOut,ELASTIC_IN:Fi.Elastic.In,ELASTIC_OUT:Fi.Elastic.Out,ELASTIC_IN_OUT:Fi.Elastic.InOut,BACK_IN:Fi.Back.In,BACK_OUT:Fi.Back.Out,BACK_IN_OUT:Fi.Back.InOut,BOUNCE_IN:Fi.Bounce.In,BOUNCE_OUT:Fi.Bounce.Out,BOUNCE_IN_OUT:Fi.Bounce.InOut},Kr=Object.freeze(Sst);function kH(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}kH.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ae(this.view.position);t.flyToBoundingSphere(o,i)}};kH.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};kH.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Kr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=xt(t,e)),t};var DF=kH;function $Y(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}$Y.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};$Y.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var IF=$Y;var wye={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=ex(t),wye[t]}},oX;typeof DOMParser<"u"&&(oX=new DOMParser);var vst=new vye.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),x0=32,gye=2414016,yye=1,xye=16093e3,bye=.1,Tye=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Cye=["http://www.google.com/kml/ext/2.2"],wst=["http://www.w3.org/2005/Atom"],Re={kml:Tye,gx:Cye,atom:wst,kmlgx:Tye.concat(Cye)},rX={Document:Bye,Folder:qst,Placemark:Yst,NetworkLink:nat,GroundOverlay:Jst,PhotoOverlay:Uye,ScreenOverlay:Qst,Tour:Kst};function Km(e){this._dataSource=e,this._deferred=wl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Km.prototype,{dataSource:{get:function(){return this._dataSource}}});Km.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Km.prototype.addPromise=function(e){this._promises.push(e)};Km.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Km.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Zu._getTimestamp()),this._process(e)};Km.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Zu._getTimestamp(),e._process(!0)},0)};Km.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};Km.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Km.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=rX[i.localName];if(l(o)&&(Re.kml.indexOf(i.namespaceURI)!==-1||Re.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Zu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Dst(e){let t=e.slice(0,Math.min(4,e.size)),n=wl(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function Ist(e){let t=wl(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function Dye(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function Iye(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function Pst(e,t){return Promise.resolve(e.getData(new yH)).then(function(n){n=Dye(n),n=Iye(n),t.kml=oX.parseFromString(n,"application/xml")})}function QY(e,t){let n=y(wye.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new _H(n))).then(function(i){t[e.filename]=i})}function Xu(e,t,n,i){let o=i.keys,r=new PF.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new PF.default(u).absoluteTo(r).toString(),p=o.indexOf(d);if(p!==-1){let g=o[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Ku(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=sX(a,i);l(c)&&s.setAttribute(n,c.url)}}function Pye(e,t,n){let i=Ls(e,"id");i=l(i)&&i.length!==0?i:zn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=zn(),l(n)&&(i=n+i)),o=t.add(new nr({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new sat),o}function RF(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function HH(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,h.fromDegrees(i,o,r,t)}function VH(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=HH(n[s],t);return o}function b0(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ls(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Bi(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Aye(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Ph(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Jn(e,t,n){let i=Bi(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Pn(e,t,n){let i=Bi(e,t,n);if(l(i))return i.textContent.trim()}function Rh(e,t,n){let i=Bi(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function sX(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new Se({url:o});else{let r=new PF.default(t.getUrlComponent()),s=new PF.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Se({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Jl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function nX(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(Jl.maximumRed=r,Jl.red=void 0):(Jl.maximumRed=void 0,Jl.red=0),o>0?(Jl.maximumGreen=o,Jl.green=void 0):(Jl.maximumGreen=void 0,Jl.green=0),i>0?(Jl.maximumBlue=i,Jl.blue=void 0):(Jl.maximumBlue=void 0,Jl.blue=0),Jl.alpha=n,H.fromRandom(Jl)):new H(r,o,i,n)}function IT(e,t,n){let i=Pn(e,t,n);if(l(i))return nX(i,Pn(e,"colorMode",n)==="random")}function Rst(e){let t=Bi(e,"TimeStamp",Re.kmlgx),n=Pn(t,"when",Re.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=Z.fromIso8601(n),o=new jr;return o.addInterval(new An({start:i,stop:He.MAXIMUM_VALUE})),o}function Ost(e){let t=Bi(e,"TimeSpan",Re.kmlgx);if(!l(t))return;let n,i=Bi(t,"begin",Re.kmlgx),o=l(i)?Z.fromIso8601(i.textContent):void 0,r=Bi(t,"end",Re.kmlgx),s=l(r)?Z.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(Z.lessThan(s,o)){let a=o;o=s,s=a}n=new jr,n.addInterval(new An({start:o,stop:s}))}else l(o)?(n=new jr,n.addInterval(new An({start:o,stop:He.MAXIMUM_VALUE}))):l(s)&&(n=new jr,n.addInterval(new An({start:He.MINIMUM_VALUE,stop:s})));return n}function Rye(){let e=new ac;return e.width=x0,e.height=x0,e.scaleByDistance=new Bt(gye,yye,xye,bye),e.pixelOffsetScaleByDistance=new Bt(gye,yye,xye,bye),e}function aX(){let e=new zd;return e.outline=!0,e.outlineColor=H.WHITE,e}function Oye(){let e=new Ud;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=yi.LEFT,e.font="16px sans-serif",e.style=qo.FILL_AND_OUTLINE,e}function cX(e,t,n,i,o){let r=Pn(e,"href",Re.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y(Jn(e,"x",Re.gx),0),u=y(Jn(e,"y",Re.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=sX(r,n,i);if(o){let a=Pn(e,"refreshMode",Re.kml),c=Pn(e,"viewRefreshMode",Re.kml);a==="onInterval"||a==="onExpire"?gt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&>(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(Pn(e,"viewBoundScale",Re.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=y(Pn(e,"viewFormat",Re.kml),f),p=Pn(e,"httpQuery",Re.kml);l(d)&&s.setQueryParameters(fu(zH(d))),l(p)&&s.setQueryParameters(fu(zH(p)));let g=t._ellipsoid;return uX(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function Mst(e,t,n,i,o){let r=Jn(t,"scale",Re.kml),s=Jn(t,"heading",Re.kml),a=IT(t,"color",Re.kml),c=Bi(t,"Icon",Re.kml),u=cX(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=Jn(c,"x",Re.gx),d=Jn(c,"y",Re.gx),p=Jn(c,"w",Re.gx),g=Jn(c,"h",Re.gx),m=Bi(t,"hotSpot",Re.kml),x=b0(m,"x"),b=b0(m,"y"),T=Ls(m,"xunits"),C=Ls(m,"yunits"),A=n.billboard;l(A)||(A=Rye(),n.billboard=A),A.image=u,A.scale=r,A.color=a,(l(f)||l(d)||l(p)||l(g))&&(A.imageSubRegion=new je(f,d,p,g)),l(s)&&s!==0&&(A.rotation=P.toRadians(-s),A.alignedAxis=h.UNIT_Z),r=y(r,1);let E,v;l(x)&&(T==="pixels"?E=-x*r:T==="insetPixels"?E=(x-x0)*r:T==="fraction"&&(E=-x*x0*r),E+=x0*.5*r),l(b)&&(C==="pixels"?v=b*r:C==="insetPixels"?v=(-b+x0)*r:C==="fraction"&&(v=b*x0*r),v-=x0*.5*r),(l(E)||l(v))&&(A.pixelOffset=new z(E,v))}function UH(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")Mst(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=Oye(),n.label=c),c.scale=y(Jn(a,"scale",Re.kml),c.scale),c.fillColor=y(IT(a,"color",Re.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new uc,n.polyline=c),c.width=Jn(a,"width",Re.kml),c.material=IT(a,"color",Re.kml),l(IT(a,"outerColor",Re.gx))&>("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Jn(a,"outerWidth",Re.gx))&>("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Jn(a,"physicalWidth",Re.gx))&>("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Rh(a,"labelVisibility",Re.gx))&>("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=aX(),n.polygon=c),c.material=y(IT(a,"color",Re.kml),c.material),c.fill=y(Rh(a,"fill",Re.kml),c.fill),c.outline=y(Rh(a,"outline",Re.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y(nX(Pn(a,"bgColor",Re.kml)),H.WHITE),u=y(nX(Pn(a,"textColor",Re.kml)),H.BLACK),f=Pn(a,"text",Re.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Pn(a,"listItemType",Re.kml);(c==="radioFolder"||c==="checkOffOnly")&>(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function Lst(e,t,n,i,o){let r=new nr,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")UH(e,d,r,i,o);else{let p=Ph(d,"Pair",Re.kml);for(let g=0;g<p.length;g++){let m=p[g],x=Pn(m,"key",Re.kml);if(x==="normal"){let b=Pn(m,"styleUrl",Re.kml);if(l(b))s=n.getById(b),l(s)||(s=n.getById(`#${b}`)),l(s)&&r.merge(s);else{let T=Bi(m,"Style",Re.kml);UH(e,T,r,i,o)}}else gt(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let f=Pn(t,"styleUrl",Re.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&r.merge(s)}return r}function Nst(e,t,n){return t.fetchXML().then(function(i){return Mye(e,i,n,t,!0)})}function Mye(e,t,n,i,o,r){let s,a,c,u,f=Aye(t,"Style",Re.kml);if(l(f)){let x=f.length;for(s=0;s<x;s++)u=f[s],a=Ls(u,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new nr({id:a}),n.add(c),UH(e,u,c,i,r)))}let d=Aye(t,"StyleMap",Re.kml);if(l(d)){let x=d.length;for(s=0;s<x;s++){let b=d[s];if(a=Ls(b,"id"),l(a)){let T=Ph(b,"Pair",Re.kml);for(let C=0;C<T.length;C++){let A=T[C],E=Pn(A,"key",Re.kml);if(E==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Pn(A,"styleUrl",Re.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),o&&l(i)&&(v=i.getUrlComponent()+v);let D=n.getById(v);l(D)&&c.merge(D)}else u=Bi(A,"Style",Re.kml),UH(e,u,c,i,r)}}else gt(`kml-styleMap-${E}`,`KML - Unsupported StyleMap key: ${E}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let x=g[s].textContent;if(x[0]!=="#"){let b=x.split("#");if(b.length===2){let T=b[0],C=i.getDerivedResource({url:T});p.push(Nst(e,C,n))}}}return p}function lX(e,t,n){let i=new W_(e,t.id,["position"]),o=new Bm(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new uc,t.polyline.positions=new G_([i,o])}function Lye(e,t){return!l(e)&&!l(t)||e==="clampToGround"?Ye.CLAMP_TO_GROUND:e==="relativeToGround"?Ye.RELATIVE_TO_GROUND:e==="absolute"?Ye.NONE:t==="clampToSeaFloor"?(gt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Ye.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(gt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Ye.RELATIVE_TO_GROUND):(l(e)?gt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):gt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Ye.CLAMP_TO_GROUND)}function Fst(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&>("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new Bm(e))}function Bst(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&>("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function GH(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():Oye(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():Rye(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(H.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new z(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function Nye(e,t){let n=e.path;l(n)||(n=new Hp,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function kst(e,t,n,i,o){let r=Pn(n,"coordinates",Re.kml),s=Pn(n,"altitudeMode",Re.kml),a=Pn(n,"altitudeMode",Re.gx),c=Rh(n,"extrude",Re.kml),u=e._ellipsoid,f=HH(r,u);return i.position=f,GH(e,i,o,Lye(s,a)),c&&RF(s,a)&&lX(t,i,o),!0}function Eye(e,t,n,i,o){let r=Bi(n,"coordinates",Re.kml),s=Pn(n,"altitudeMode",Re.kml),a=Pn(n,"altitudeMode",Re.gx),c=Rh(n,"extrude",Re.kml),u=Rh(n,"tessellate",Re.kml),f=RF(s,a),d=Jn(n,"drawOrder",Re.gx),p=e._ellipsoid,g=VH(r,p),m=o.polyline;if(f&&c){let x=new Gp;i.wall=x,x.positions=g;let b=o.polygon;l(b)&&(x.fill=b.fill,x.material=b.material),x.outline=!0,l(m)?(x.outlineColor=l(m.material)?m.material.color:H.WHITE,x.outlineWidth=m.width):l(b)&&(x.outlineColor=l(b.material)?b.material.color:H.WHITE)}else if(e._clampToGround&&!f&&u){let x=new uc;x.clampToGround=!0,i.polyline=x,x.positions=g,l(m)?(x.material=l(m.material)?m.material.color.getValue(He.MINIMUM_VALUE):H.WHITE,x.width=y(m.width,1)):(x.material=H.WHITE,x.width=1),x.zIndex=d}else l(d)&>("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&>("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new uc,i.polyline=m,m.positions=Bst(g,s,a,p),(!u||f)&&(m.arcType=Qt.NONE);return!0}function Vst(e,t,n,i,o){let r=Bi(n,"outerBoundaryIs",Re.kml),s=Bi(r,"LinearRing",Re.kml),a=Bi(s,"coordinates",Re.kml),c=e._ellipsoid,u=VH(a,c),f=Rh(n,"extrude",Re.kml),d=Pn(n,"altitudeMode",Re.kml),p=Pn(n,"altitudeMode",Re.gx),g=RF(d,p),m=l(o.polygon)?o.polygon.clone():aX(),x=o.polyline;if(l(x)&&(m.outlineColor=l(x.material)?x.material.color:H.WHITE,m.outlineWidth=x.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let b=new Na(u),T=Ph(n,"innerBoundaryIs",Re.kml);for(let C=0;C<T.length;C++){s=Ph(T[C],"LinearRing",Re.kml);for(let A=0;A<s.length;A++)a=Bi(s[A],"coordinates",Re.kml),u=VH(a,c),l(u)&&b.holes.push(new Na(u))}m.hierarchy=b}return!0}function Ust(e,t,n,i,o){let r=Pn(n,"altitudeMode",Re.kml),s=Pn(n,"altitudeMode",Re.gx),a=Ph(n,"coord",Re.gx),c=Ph(n,"angles",Re.gx),u=Ph(n,"when",Re.kml),f=Rh(n,"extrude",Re.kml),d=RF(r,s),p=e._ellipsoid;c.length>0&>("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],x=[];for(let T=0;T<g;T++){let C=HH(a[T].textContent,p);m.push(C),x.push(Z.fromIso8601(u[T].textContent))}let b=new ya;return b.addSamples(x,m),i.position=b,GH(e,i,o,Lye(r,s)),Nye(i,o),i.availability=new jr,u.length>0&&i.availability.addInterval(new An({start:x[0],stop:x[x.length-1]})),d&&f&&lX(t,i,o),!0}function Sye(e,t,n,i,o,r,s,a,c){let u=e[0],f=e[e.length-1],d=new ya;d.addSamples(e,t),n.intervals.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:Fst(d,s,a)})),i.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function zst(e,t,n,i,o){let r=Rh(n,"interpolate",Re.gx),s=Ph(n,"Track",Re.gx),a,c,u,f=!1,d=new q_,p=new jr,g=new _a,m=e._ellipsoid;for(let x=0,b=s.length;x<b;x++){let T=s[x],C=Ph(T,"when",Re.kml),A=Ph(T,"coord",Re.gx),E=Pn(T,"altitudeMode",Re.kml),v=Pn(T,"altitudeMode",Re.gx),D=RF(E,v),O=Rh(T,"extrude",Re.kml),R=Math.min(A.length,C.length),M=[];a=[];for(let N=0;N<R;N++){let _=HH(A[N].textContent,m);M.push(_),a.push(Z.fromIso8601(C[N].textContent))}r&&(l(c)&&Sye([c,a[0]],[u,M[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=M[M.length-1]),Sye(a,M,g,p,d,D&&O,E,v,!0),f=f||D&&O}return i.availability=p,i.position=g,GH(e,i,o),Nye(i,o),f&&(lX(t,i,o),i.polyline.show=d),!0}var Fye={Point:kst,LineString:Eye,LinearRing:Eye,Polygon:Vst,Track:Ust,MultiTrack:zst,MultiGeometry:Hst,Model:Gst};function Hst(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=Fye[f.localName];if(l(d)){let p=Pye(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,o)&&(a=!0)}}return a}function Gst(e,t,n,i,o){return gt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Wst(e,t){let n=Bi(e,"ExtendedData",Re.kml);if(!l(n))return;l(Bi(n,"SchemaData",Re.kml))&>("kml-schemaData","KML - SchemaData is unsupported"),l(Ls(n,"xmlns:prefix"))&>("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Ph(n,"Data",Re.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Ls(a,"name");l(c)&&(i[c]={displayName:Pn(a,"displayName",Re.kml),value:Pn(a,"value",Re.kml)})}}t.kml.extendedData=i}var yo;typeof document<"u"&&(yo=document.createElement("div"));function jst(e,t,n,i,o){let r,s,a,c=t.kml,u=c.extendedData,f=Pn(e,"description",Re.kml),d=y(t.balloonStyle,n.balloonStyle),p=H.WHITE,g=H.BLACK,m=f;l(d)&&(p=y(d.bgColor,H.WHITE),g=y(d.textColor,H.BLACK),m=y(d.text,f));let x;if(l(m)){if(m=m.replace("$[name]",y(t.name,"")),m=m.replace("$[description]",y(f,"")),m=m.replace("$[address]",y(c.address,"")),m=m.replace("$[Snippet]",y(c.snippet,"")),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let C=m.match(/\$\[.+?\]/g);if(C!==null)for(r=0;r<C.length;r++){let A=C[r],E=A.substr(2,A.length-3),v=/\/displayName$/.test(E);E=E.replace(/\/displayName$/,""),x=u[E],l(x)&&(x=v?x.displayName:x.value),l(x)&&(m=m.replace(A,y(x,"")))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],x=u[s],m+=`<tr><th>${y(x.displayName,s)}</th><td>${y(x.value,"")}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=vst.link(m),yo.innerHTML=m;let b=yo.querySelectorAll("a");for(r=0;r<b.length;r++)b[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Xu(yo,"a","href",i),Xu(yo,"link","href",i),Xu(yo,"area","href",i),Xu(yo,"img","src",i),Xu(yo,"iframe","src",i),Xu(yo,"video","src",i),Xu(yo,"audio","src",i),Xu(yo,"source","src",i),Xu(yo,"track","src",i),Xu(yo,"input","src",i),Xu(yo,"embed","src",i),Xu(yo,"script","src",i),Xu(yo,"video","poster",i)),Ku(yo,"a","href",o),Ku(yo,"link","href",o),Ku(yo,"area","href",o),Ku(yo,"img","src",o),Ku(yo,"iframe","src",o),Ku(yo,"video","src",o),Ku(yo,"audio","src",o),Ku(yo,"source","src",o),Ku(yo,"track","src",o),Ku(yo,"input","src",o),Ku(yo,"embed","src",o),Ku(yo,"script","src",o),Ku(yo,"video","poster",o);let T='<div class="cesium-infoBox-description-lighter" style="';T+="overflow:auto;",T+="word-wrap:break-word;",T+=`background-color:${p.toCssColorString()};`,T+=`color:${g.toCssColorString()};`,T+='">',T+=`${yo.innerHTML}</div>`,yo.innerHTML="",t.description=T}function WH(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=Pye(t,i,n.context),c=a.kml,u=Lst(e,t,n.styleCollection,r,s),f=Pn(t,"name",Re.kml);a.name=f,a.parent=o;let d=Ost(t);l(d)||(d=Rst(t)),a.availability=d,dX(a);function p(A){return A?A.show&&p(A.parent):!0}let g=Rh(t,"visibility",Re.kml);a.show=p(o)&&y(g,!0);let m=Bi(t,"author",Re.atom),x=c.author;x.name=Pn(m,"name",Re.atom),x.uri=Pn(m,"uri",Re.atom),x.email=Pn(m,"email",Re.atom);let b=Bi(t,"link",Re.atom),T=c.link;T.href=Ls(b,"href"),T.hreflang=Ls(b,"hreflang"),T.rel=Ls(b,"rel"),T.type=Ls(b,"type"),T.title=Ls(b,"title"),T.length=Ls(b,"length"),c.address=Pn(t,"address",Re.kml),c.phoneNumber=Pn(t,"phoneNumber",Re.kml),c.snippet=Pn(t,"Snippet",Re.kml),Wst(t,a),jst(t,a,u,s,r);let C=e._ellipsoid;return Vye(t,a,C),kye(t,a,C),l(Bi(t,"Region",Re.kml))&>("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function Bye(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function qst(e,t,n,i){let o=WH(e,t,n),r=Ge(n);r.parentEntity=o.entity,Bye(e,t,r,i)}function Yst(e,t,n,i){let o=WH(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=Fye[d.localName];l(p)&&(p(e,n.entityCollection,d,r,s,r.id),a=!0)}a||(r.merge(s),GH(e,r,s))}var Xst={FlyTo:$st,Wait:Zst,SoundCue:JY,AnimatedUpdate:JY,TourControl:JY};function Kst(e,t,n,i){let o=Pn(t,"name",Re.kml),r=Ls(t,"id"),s=new vF(o,r),a=Bi(t,"Playlist",Re.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=Xst[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function JY(e,t){gt(`KML Tour unsupported node ${t.localName}`)}function Zst(e,t){let n=Jn(t,"duration",Re.gx);e.addPlaylistEntry(new IF(n))}function $st(e,t,n){let i=Jn(t,"duration",Re.gx),o=Pn(t,"flyToMode",Re.gx),r={kml:{}};Vye(t,r,n),kye(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new DF(i,o,s);e.addPlaylistEntry(a)}function kye(e,t,n){let i=Bi(e,"Camera",Re.kml);if(l(i)){let o=y(Jn(i,"longitude",Re.kml),0),r=y(Jn(i,"latitude",Re.kml),0),s=y(Jn(i,"altitude",Re.kml),0),a=y(Jn(i,"heading",Re.kml),0),c=y(Jn(i,"tilt",Re.kml),0),u=y(Jn(i,"roll",Re.kml),0),f=h.fromDegrees(o,r,s,n),d=Da.fromDegrees(a,c-90,u);t.kml.camera=new sF(f,d)}}function Vye(e,t,n){let i=Bi(e,"LookAt",Re.kml);if(l(i)){let o=y(Jn(i,"longitude",Re.kml),0),r=y(Jn(i,"latitude",Re.kml),0),s=y(Jn(i,"altitude",Re.kml),0),a=Jn(i,"heading",Re.kml),c=Jn(i,"tilt",Re.kml),u=y(Jn(i,"range",Re.kml),0);c=P.toRadians(y(c,0)),a=P.toRadians(y(a,0));let f=new cd(a,c-P.PI_OVER_TWO,u),d=h.fromDegrees(o,r,s,n);t.kml.lookAt=new SF(d,f)}}function Qst(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Bi(t,"Icon",Re.kml),c=cX(a,e,r,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=Bi(t,"screenXY",Re.kml),p=Bi(t,"overlayXY",Re.kml),g=Bi(t,"size",Re.kml),m,x,b,T,C,A;l(g)&&(m=b0(g,"x"),x=b0(g,"y"),b=Ls(g,"xunits"),T=Ls(g,"yunits"),l(m)&&m!==-1&&m!==0&&(b==="fraction"?C=`width: ${Math.floor(m*100)}%`:b==="pixels"&&(C=`width: ${m}px`),f.push(C)),l(x)&&x!==-1&&x!==0&&(T==="fraction"?A=`height: ${Math.floor(x*100)}%`:T==="pixels"&&(A=`height: ${x}px`),f.push(A))),u.style=f.join(";");let E=0,v=u.height;l(p)&&(m=b0(p,"x"),x=b0(p,"y"),b=Ls(p,"xunits"),T=Ls(p,"yunits"),l(m)&&(b==="fraction"?E=m*u.width:(b==="pixels"||b==="insetPixels")&&(E=m)),l(x)&&(T==="fraction"?v=x*u.height:(T==="pixels"||T==="insetPixels")&&(v=x))),l(d)&&(m=b0(d,"x"),x=b0(d,"y"),b=Ls(d,"xunits"),T=Ls(d,"yunits"),l(m)&&(b==="fraction"?C=`left: calc(${Math.floor(m*100)}% - ${E}px)`:b==="pixels"?C=`left: ${m-E}px`:b==="insetPixels"&&(C=`right: ${m-E}px`),f.push(C)),l(x)&&(T==="fraction"?A=`bottom: calc(${Math.floor(x*100)}% - ${v}px)`:T==="pixels"?A=`bottom: ${x-v}px`:T==="insetPixels"&&(A=`top: ${x-v}px`),f.push(A))),u.style=f.join(";")},o.appendChild(u)}function Jst(e,t,n,i){let r=WH(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=VH(Bi(t,"LatLonQuad",Re.gx),c),f=Jn(t,"drawOrder",Re.kml);if(l(u))s=aX(),s.hierarchy=new Na(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new Hd,s.zIndex=f,r.rectangle=s;let m=Bi(t,"LatLonBox",Re.kml);if(l(m)){let x=Jn(m,"west",Re.kml),b=Jn(m,"south",Re.kml),T=Jn(m,"east",Re.kml),C=Jn(m,"north",Re.kml);l(x)&&(x=P.negativePiToPi(P.toRadians(x))),l(b)&&(b=P.clampToLatitudeRange(P.toRadians(b))),l(T)&&(T=P.negativePiToPi(P.toRadians(T))),l(C)&&(C=P.clampToLatitudeRange(P.toRadians(C))),s.coordinates=new se(x,b,T,C);let A=Jn(m,"rotation",Re.kml);if(l(A)){let E=P.toRadians(A);s.rotation=E,s.stRotation=E}}}let d=Bi(t,"Icon",Re.kml),p=cX(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&>("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=Jn(d,"x",Re.gx),x=Jn(d,"y",Re.gx),b=Jn(d,"w",Re.gx),T=Jn(d,"h",Re.gx);(l(m)||l(x)||l(b)||l(T))&>("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=IT(t,"color",Re.kml),s.material.transparent=!0}else s.material=IT(t,"color",Re.kml);let g=Pn(t,"altitudeMode",Re.kml);l(g)?g==="absolute"?(s.height=Jn(t,"altitude",Re.kml),s.zIndex=void 0):g!=="clampToGround"&>("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Pn(t,"altitudeMode",Re.gx),g==="relativeToSeaFloor"?(gt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Jn(t,"altitude",Re.kml),s.zIndex=void 0):g==="clampToSeaFloor"?gt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&>("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function Uye(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),gt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var T0={INTERVAL:0,EXPIRE:1,STOP:2};function zH(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var eat=new se,VS=new fe,eX=new z,tat=new h;function uX(e,t,n,i,o,r){function s(u){return u<-P.PI_OVER_TWO?-P.PI_OVER_TWO:u>P.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=ix(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(o=y(o,eat),l(n)&&(eX.x=n.clientWidth*.5,eX.y=n.clientHeight*.5,u=t.pickEllipsoid(eX,r,tat)),l(u)?f=r.cartesianToCartographic(u,VS):(f=se.center(o,VS),u=r.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let T=o.width*i*.5,C=o.height*i*.5;o=new se(a(f.longitude-T),s(f.latitude-C),a(f.longitude+T),s(f.latitude+C))}c=c.replace("[bboxWest]",P.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(o.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,VS),c=c.replace("[cameraLon]",P.toDegrees(VS.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(VS.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(VS.height).toString());let g=t.frustum,m=g.aspectRatio,x="",b="";if(l(m)){let T=P.toDegrees(g.fov);m>1?(x=T,b=T/m):(b=T,x=T*m)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",b.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(fu(c))}function nat(e,t,n,i){let r=WH(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Bi(t,"Link",Re.kml);if(l(c)||(c=Bi(t,"Url",Re.kml)),l(c)){let u=Pn(c,"href",Re.kml),f,d;if(l(u)){let p=u;if(u=sX(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Pn(c,"viewRefreshMode",Re.kml),f==="onRegion"){gt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=y(Pn(c,"viewBoundScale",Re.kml),1);let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",T=y(Pn(c,"viewFormat",Re.kml),b),C=Pn(c,"httpQuery",Re.kml);l(T)&&u.setQueryParameters(fu(zH(T))),l(C)&&u.setQueryParameters(fu(zH(C)));let A=e._ellipsoid;uX(u,e.camera,e.canvas,d,e._lastCameraView.bbox,A)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new $s,x=fX(e,m,u,g).then(function(b){let T=e._entityCollection,C=m.values;T.suspendEvents();for(let v=0;v<C.length;v++){let D=C[v];l(D.parent)||(D.parent=r,dX(D)),T.add(D)}T.resumeEvents();let A=Pn(c,"refreshMode",Re.kml),E=y(Jn(c,"refreshInterval",Re.kml),0);if(A==="onInterval"&&E>0||A==="onExpire"||f==="onStop"){let v=Bi(b,"NetworkLinkControl",Re.kml),D=l(v),O=Z.now(),R={id:zn(),href:u,cookie:{},lastUpdated:O,updating:!1,entity:r,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:O},M=0;if(D&&(R.cookie=fu(y(Pn(v,"cookie",Re.kml),"")),M=y(Jn(v,"minRefreshPeriod",Re.kml),0)),A==="onInterval")D&&(E=Math.max(M,E)),R.refreshMode=T0.INTERVAL,R.time=E;else if(A==="onExpire"){let N;if(D&&(N=Pn(v,"expires",Re.kml)),l(N))try{let _=Z.fromIso8601(N),S=Z.secondsDifference(_,O);S>0&&S<M&&Z.addSeconds(O,M,_),R.refreshMode=T0.EXPIRE,R.time=_}catch{gt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else gt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=T0.STOP,R.time=y(Jn(c,"viewRefreshTime",Re.kml),0)):gt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(b){gt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,b)});i.addPromise(x)}}}function iat(e,t,n,i){let o=rX[t.localName];return l(o)?o(e,t,n,i):Uye(e,t,n,i)}function iX(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Bi(a,"Document",Re.kml),u=Pn(c,"name",Re.kml);l(u)||(u=z_(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Zu._DeferredLoading(e),d=new $s(e);return Promise.all(Mye(e,n,d,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let x=0;x<m.length;x++){let b=m[x];if(l(rX[b.localName])){p=b;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),iat(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function oat(e,t,n,i,o){let r=en("ThirdParty/Workers/z-worker-pako.js");PS({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new OH(new sg(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],u={},f;for(let d=0;d<a.length;d++){let p=a[d];p.directory||(/\.kml$/i.test(p.filename)&&(!l(f)||!/\//i.test(p.filename))?(l(f)&&c.push(QY(f,u)),f=p):c.push(QY(p,u)))}return l(f)&&c.push(Pst(f,u)),Promise.all(c).then(function(){if(s.close(),!l(u.kml))throw new re("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),iX(e,t,u.kml,i,u,o)})})}function fX(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Se){n=Se.createIfNeeded(n),c=n.fetchBlob(),o=y(o,n.clone());let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else o=y(o,Se.DEFAULT.clone());return o=Se.createIfNeeded(o),l(a)&&(a=In(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?Dst(u).then(function(f){return f?oat(e,t,u,o,a):Ist(u).then(function(d){d=Dye(d),d=Iye(d);let p,g;try{p=oX.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new re(m)}return iX(e,t,p,o,r,a,s)})}):iX(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function Zu(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new pe,this._error=new pe,this._loading=new pe,this._refresh=new pe,this._unsupportedNode=new pe,this._clock=void 0,this._entityCollection=new $s(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new eg,this._networkLinks=new Et,this._entityCluster=new Fu,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?h.clone(t.positionWC):void 0,direction:l(t)?h.clone(t.directionWC):void 0,up:l(t)?h.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():se.clone(se.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,ee.default);let i=e.credit;typeof i=="string"&&(i=new bt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Zu.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new Zu(t).load(e,t)};Object.defineProperties(Zu.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Zu.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),qr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return fX(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Z.equals(s,He.MINIMUM_VALUE),u=Z.equals(a,He.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=Z.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=Z.fromDate(d)),o=new xh,o.startTime=s,o.stopTime=a,o.currentTime=Z.clone(s),o.clockRange=Yr.LOOP_STOP,o.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),qr.setLoading(i,!1),i}).catch(function(o){return qr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Zu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function dX(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function rat(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Bi(r,"NetworkLinkControl",Re.kml),c=l(a),u=0;if(c){if(l(Bi(a,"Update",Re.kml))){gt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=fu(y(Pn(a,"cookie",Re.kml),"")),u=y(Jn(a,"minRefreshPeriod",Re.kml),0)}let f=Z.now(),d=t.refreshMode;if(d===T0.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===T0.EXPIRE){let O;if(l(a)&&(O=Pn(a,"expires",Re.kml)),l(O))try{let R=Z.fromIso8601(O),M=Z.secondsDifference(R,f);M>0&&M<u&&Z.addSeconds(f,u,R),t.time=R}catch{gt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else gt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function x(O){g.remove(O);let R=O._children,M=R.length;for(let N=0;N<M;++N)x(R[N])}g.suspendEvents();let b=g.values.slice(),T;for(T=0;T<b.length;++T){let O=b[T];O.parent===p&&(O.parent=void 0,x(O))}for(g.resumeEvents(),g.suspendEvents(),T=0;T<m.length;T++){let O=m[T];l(O.parent)||(O.parent=p,dX(O)),g.add(O)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let C=g.computeAvailability(),A=C.start,E=C.stop,v=Z.equals(A,He.MINIMUM_VALUE),D=Z.equals(E,He.MAXIMUM_VALUE);if(!v||!D){let O=e._clock;(O.startTime!==A||O.stopTime!==E)&&(O.startTime=A,O.stopTime=E,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var tX=new Et;Zu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=Z.now(),i=this;tX.removeAll();function o(f){let d=f._children,p=d.length;for(let g=0;g<p;++g){let m=d[g];tX.set(m.id,m),o(m)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,P.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,P.EPSILON7)&&a.upWC.equalsEpsilon(s.up,P.EPSILON7))&&(s.position=h.clone(a.positionWC),s.direction=h.clone(a.directionWC),s.up=h.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new Et,u=!1;return t.values.forEach(function(f){let d=f.entity;if(!tX.contains(d.id)){if(!f.updating){let p=!1;if(f.refreshMode===T0.INTERVAL?Z.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===T0.EXPIRE?Z.greaterThan(n,f.time)&&(p=!0):f.refreshMode===T0.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&Z.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(d),f.updating=!0;let g=new $s,m=f.href.clone();m.setQueryParameters(f.cookie);let x=y(i._ellipsoid,ee.default);uX(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,x),fX(i,g,m,{context:d.id}).then(rat(i,f,g,c,m)).catch(function(b){let T=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(T),i._error.raiseEvent(i,T)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function sat(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}Zu._DeferredLoading=Km;Zu._getTimestamp=Ti;var PT=Zu;function OF(){he.throwInstantiationError()}OF.prototype.update=he.throwInstantiationError;OF.prototype.getBoundingSphere=he.throwInstantiationError;OF.prototype.isDestroyed=he.throwInstantiationError;OF.prototype.destroy=he.throwInstantiationError;var hX=OF;var mX=32,aat="http://www.opengis.net/kml/2.2",Mh="http://www.google.com/kml/ext/2.2",cat="http://www.w3.org/2000/xmlns/";function jH(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var lat=/^data:image\/([^,;]+)/;jH.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Se){if(e=Se.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(lat);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function uat(e,t){return function(n){e._files[t]=n}}jH.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new re("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(uat(this,r))}return o};Object.defineProperties(jH.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function qH(e){this._time=e}qH.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};qH.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return OT(n)};qH.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function pX(){this._ids={},this._styles={},this._count=0}pX.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};pX.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function Gye(){this._ids={}}Gye.prototype.get=function(e){if(!l(e))return this.get(zn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function _X(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=_X._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(cat,"xmlns:gx",Mh);let a=r.createElement("Document");s.appendChild(a),jye(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?fat(f,c.files):{kml:f,externalFiles:c.files}})}function fat(e,t){let n=en("ThirdParty/Workers/z-worker-pako.js");PS({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new xF,o=new NH(i);return o.add("doc.kml",new gH(e)).then(function(){let r=Object.keys(t);return Wye(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function Wye(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new sg(n[o])).then(function(){return Wye(e,t,n,i+1)})}_X._createState=function(e){let t=e.entities,n=new pX,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===He.MINIMUM_VALUE?r.stop===He.MAXIMUM_VALUE?r=new An:Z.addSeconds(r.stop,-10*s,r.start):r.stop===He.MAXIMUM_VALUE&&Z.addSeconds(r.start,10*s,r.stop);let a=new jH(e.modelCallback);return{kmlDoc:document.implementation.createDocument(aat,"kml"),ellipsoid:y(e.ellipsoid,ee.default),idManager:new Gye,styleCache:n,externalFileHandler:a,time:o,valueGetter:new qH(o),sampleDuration:s,defaultAvailability:new jr([r])}};function jye(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],dat(e,p,u,f),hat(e,p.polyline,u,f),Hye(e,p.rectangle,u,f,c),Hye(e,p.polygon,u,f,c),gat(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),Z.equals(m.start,He.MINIMUM_VALUE)||g.appendChild(fn(i,"begin",Z.toIso8601(m.start))),Z.equals(m.stop,He.MAXIMUM_VALUE)||g.appendChild(fn(i,"end",Z.toIso8601(m.stop))));for(let T=0;T<c.length;++T){let C=c[T];C.setAttribute("id",s.get(p.id)),C.appendChild(fn(i,"name",p.name)),C.appendChild(fn(i,"visibility",p.show)),C.appendChild(fn(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C)}let x=u.length;if(x>0){let T=i.createElement("Placemark");T.setAttribute("id",s.get(p.id));let C=p.name,A=p.label;if(l(A)){let v=i.createElement("LabelStyle"),D=r.get(A.text);C=l(D)&&D.length>0?D:C;let O=r.getColor(A.fillColor);l(O)&&(v.appendChild(fn(i,"color",O)),v.appendChild(fn(i,"colorMode","normal")));let R=r.get(A.scale);l(R)&&v.appendChild(fn(i,"scale",R)),f.push(v)}T.appendChild(fn(i,"name",C)),T.appendChild(fn(i,"visibility",p.show)),T.appendChild(fn(i,"description",p.description)),l(g)&&T.appendChild(g),t.appendChild(T);let E=f.length;if(E>0){let v=i.createElement("Style");for(let D=0;D<E;++D)v.appendChild(f[D]);T.appendChild(fn(i,"styleUrl",o.get(v)))}if(u.length===1)T.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let D=0;D<x;++D)v.appendChild(u[D]);T.appendChild(v)}}let b=p._children;if(b.length>0){let T=i.createElement("Folder");T.setAttribute("id",s.get(p.id)),T.appendChild(fn(i,"name",p.name)),T.appendChild(fn(i,"visibility",p.show)),T.appendChild(fn(i,"description",p.description)),t.appendChild(T),jye(e,T,b)}}}var eu=new h,ml=new fe,Oh=new Z;function dat(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){qye(e,t,a,n,i);return}s.get(c,void 0,eu);let u=fn(o,"coordinates",RT(eu,r)),f=o.createElement("Point"),d=o.createElement("altitudeMode");d.appendChild(MT(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof ac?Xye(e,a):Yye(e,a);i.push(p)}function qye(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof _a?(c=u.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let d=n instanceof zp,p,g,m,x=[];for(p=0;p<c.length;++p){let T=c.get(p),C=f?u:T.data,A=r.createElement("altitudeMode");C instanceof Bm?(C=C._value,A.appendChild(MT(e,Ye.CLAMP_TO_GROUND))):l(n)?A.appendChild(MT(e,n.heightReference)):A.appendChild(MT(e,Ye.NONE));let E=[],v=[];if(C.isConstant){a.get(C,void 0,eu);let O=fn(r,"coordinates",RT(eu,s));E.push(Z.toIso8601(T.start)),v.push(O),E.push(Z.toIso8601(T.stop)),v.push(O)}else if(C instanceof ya)for(m=C._property._times,g=0;g<m.length;++g)E.push(Z.toIso8601(m[g])),C.getValueInReferenceFrame(m[g],zi.FIXED,eu),v.push(RT(eu,s));else if(C instanceof Uu){m=C._times;let O=C._values;for(g=0;g<m.length;++g)E.push(Z.toIso8601(m[g])),h.fromArray(O,g*3,eu),v.push(RT(eu,s))}else{let O=e.sampleDuration;T.start.clone(Oh),T.isStartIncluded||Z.addSeconds(Oh,O,Oh);let R=T.stop;for(;Z.lessThan(Oh,R);)C.getValue(Oh,eu),E.push(Z.toIso8601(Oh)),v.push(RT(eu,s)),Z.addSeconds(Oh,O,Oh);T.isStopIncluded&&Z.equals(Oh,R)&&(C.getValue(Oh,eu),E.push(Z.toIso8601(Oh)),v.push(RT(eu,s)))}let D=r.createElementNS(Mh,"Track");D.appendChild(A);for(let O=0;O<E.length;++O){let R=fn(r,"when",E[O]),M=fn(r,"coord",v[O],Mh);D.appendChild(R),D.appendChild(M)}d&&D.appendChild(Kye(e,n)),x.push(D)}if(x.length===1)i.push(x[0]);else if(x.length>1){let T=r.createElementNS(Mh,"MultiTrack");for(p=0;p<x.length;++p)T.appendChild(x[p]);i.push(T)}if(l(n)&&!d){let T=n instanceof ac?Xye(e,n):Yye(e,n);o.push(T)}let b=t.path;if(l(b)){let T=a.get(b.width),C=b.material;if(l(C)||l(T)){let A=r.createElement("LineStyle");l(T)&&A.appendChild(fn(r,"width",T)),gX(e,C,A),o.push(A)}}}function Yye(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(fn(n,"color",r)),o.appendChild(fn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(fn(n,"scale",s/mX)),o}function Xye(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(fn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(fn(n,"x",g.x,Mh)),p.appendChild(fn(n,"y",g.y,Mh)),p.appendChild(fn(n,"w",g.width,Mh)),p.appendChild(fn(n,"h",g.height,Mh))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(fn(n,"color",a)),r.appendChild(fn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(fn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=y(c,1),z.divideByScalar(u,c,u);let p=i.get(t.width,mX),g=i.get(t.height,mX),m=i.get(t.horizontalOrigin,yi.CENTER);m===yi.CENTER?u.x-=p*.5:m===yi.RIGHT&&(u.x-=p);let x=i.get(t.verticalOrigin,Rn.CENTER);x===Rn.TOP?u.y+=g:x===Rn.CENTER&&(u.y+=g*.5);let b=n.createElement("hotSpot");b.setAttribute("x",-u.x),b.setAttribute("y",u.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),r.appendChild(b)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=P.toDegrees(-f),f===0&&(f=360),r.appendChild(fn(n,"heading",f))),r}function hat(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(fn(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=fn(o,"coordinates",RT(p,r));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(fn(o,"drawOrder",m,Mh)),n.push(a);let x=o.createElement("LineStyle"),b=s.get(t.width);l(b)&&x.appendChild(fn(o,"width",b)),gX(e,t.material,x),i.push(x)}function mat(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],u=[se.northeast,se.southeast,se.southwest,se.northwest];for(let g=0;g<4;++g)u[g](a,ml),c.push(`${P.toDegrees(ml.longitude)},${P.toDegrees(ml.latitude)},${r}`);let f=fn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function zye(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)fe.fromCartesian(t[f],r,ml),s.push(`${P.toDegrees(ml.longitude)},${P.toDegrees(ml.latitude)},${i?ml.height:n}`);let c=fn(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function pat(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(zye(e,f,r,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let x=i.createElement("innerBoundaryIs");x.appendChild(zye(e,p[m].positions,r,s)),a.push(x)}}return a}function Hye(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Hd;if(a&&s.getMaterialType(t.material)==="Image"){_at(e,t,o);return}let c=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(fn(r,"extrude",!0));let f=a?mat(e,t,u):pat(e,t,u),d=f.length;for(let b=0;b<d;++b)c.appendChild(f[b]);let p=r.createElement("altitudeMode");p.appendChild(MT(e,t.heightReference)),c.appendChild(p),n.push(c);let g=r.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(fn(r,"fill",m)),gX(e,t.material,g);let x=s.get(t.outline,!1);if(x){g.appendChild(fn(r,"outline",x));let b=r.createElement("LineStyle"),T=s.get(t.outlineWidth,1);b.appendChild(fn(r,"width",T));let C=s.getColor(t.outlineColor,H.BLACK);b.appendChild(fn(r,"color",C)),b.appendChild(fn(r,"colorMode","normal")),i.push(b)}i.push(g)}function _at(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(MT(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(fn(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(fn(i,"north",P.toDegrees(u.north))),f.appendChild(fn(i,"south",P.toDegrees(u.south))),f.appendChild(fn(i,"east",P.toDegrees(u.east))),f.appendChild(fn(i,"west",P.toDegrees(u.west))),s.appendChild(f);let d=o.get(t.material),p=r.texture(d.image),g=i.createElement("Icon");g.appendChild(fn(i,"href",p)),s.appendChild(g);let m=d.color;l(m)&&s.appendChild(fn(i,"color",OT(d.color))),n.push(s)}function Kye(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(fn(n,"x",s)),u.appendChild(fn(n,"y",s)),u.appendChild(fn(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(fn(n,"href",c)),r.appendChild(a),r}function gat(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){qye(e,t,n,i,o);return}let u=Kye(e,n),f=r.createElement("altitudeMode");f.appendChild(MT(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,eu),fe.fromCartesian(eu,s,ml);let d=r.createElement("Location");d.appendChild(fn(r,"longitude",P.toDegrees(ml.longitude))),d.appendChild(fn(r,"latitude",P.toDegrees(ml.latitude))),d.appendChild(fn(r,"altitude",ml.height)),u.appendChild(d),i.push(u)}function gX(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,u;switch(a){case"Image":s=OT(H.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=OT(r.color);break;case"PolylineOutline":s=OT(r.color),c=OT(r.outlineColor),u=r.outlineWidth,n.appendChild(fn(i,"outerColor",c,Mh)),n.appendChild(fn(i,"outerWidth",u,Mh));break;case"Stripe":s=OT(r.oddColor);break}l(s)&&(n.appendChild(fn(i,"color",s)),n.appendChild(fn(i,"colorMode","normal")))}function MT(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,Ye.NONE),r;switch(o){case Ye.NONE:r=n.createTextNode("absolute");break;case Ye.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case Ye.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function RT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)fe.fromCartesian(e[o],t,ml),i.push(`${P.toDegrees(ml.longitude)},${P.toDegrees(ml.latitude)},${ml.height}`);return i.join(" ")}function fn(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function OT(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var yX=_X;function yat(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=` +${o}`),t}var Zm=yat;async function xat(e,t,n,i){return l(i)||(i=!1),Cat(e,t,n,i)}function bat(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then($ye(i)):r=o.then($ye(i)).catch(Aat(i)),e.shift(),t.push(r),!0}function Tat(e){return new Promise(function(t){setTimeout(t,e)})}function xX(e,t,n){return e.length?bat(e,t,n)?xX(e,t,n):Tat(100).then(()=>xX(e,t,n)):Promise.resolve()}function Cat(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[f]=d,s.push(d)}a[f].positions.push(n[r])}let c=[];return xX(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Zye(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function $ye(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!Zye(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];Zye(s,i,n)}}):Promise.resolve()}}function Aat(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var MF=xat;var bX=new z;async function Qye(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=r.computeMaximumLevelAtPosition(u);if(o[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,bX);let p=e.loadTileDataAvailability(bX.x,bX.y,1);l(p)&&s.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return MF(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];r.computeMaximumLevelAtPosition(u)!==o[c]&&a.push(u)}return a.length>0&&await Qye(e,a,n),t}var LT=Qye;async function TX(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return r;let c=[se.center(e),se.southeast(e),se.southwest(e),se.northeast(e),se.northwest(e)],u=await TX._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,m){return l(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=r;return f&&(p.height+=d),p}TX._sampleTerrainMostDetailed=LT;var NT=TX;var Eat={NONE:0,LERC:1},fd=Object.freeze(Eat);var Sat={NONE:0,BITS12:1},Js=Object.freeze(Sat);var FT=new h,vat=new h,dd=new z,YH=new F,wat=new F,Dat=Math.pow(2,12);function vc(e,t,n,i,o,r,s,a,c,u){let f=Js.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,m=t.maximum,x=h.subtract(m,g,vat),b=i-n;Math.max(h.maximumComponent(x),b)<Dat-1?f=Js.BITS12:f=Js.NONE,d=F.inverseTransformation(o,new F);let C=h.negate(g,FT);F.multiply(F.fromTranslation(C,YH),d,d);let A=FT;A.x=1/x.x,A.y=1/x.y,A.z=1/x.z,F.multiply(F.fromScale(A,YH),d,d),p=F.clone(o),F.setTranslation(p,h.ZERO,p),o=F.clone(o,new F);let E=F.fromTranslation(g,YH),v=F.fromScale(x,wat),D=F.multiply(E,v,YH);F.multiply(o,D,o),F.multiply(p,D,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(u,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}vc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,u=i.y;if(this.quantization===Js.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,FT),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=P.clamp((o-this.minimumHeight)/f,0,1);z.fromElements(n.x,n.y,dd);let p=Mn.compressTextureCoordinates(dd);z.fromElements(n.z,d,dd);let g=Mn.compressTextureCoordinates(dd);z.fromElements(c,u,dd);let m=Mn.compressTextureCoordinates(dd);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){z.fromElements(s,0,dd);let x=Mn.compressTextureCoordinates(dd);e[t++]=x}}else h.subtract(n,this.center,FT),e[t++]=FT.x,e[t++]=FT.y,e[t++]=FT.z,e[t++]=o,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Mn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Iat=new h,Jye=new h;vc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*r+f;t[p]=e[d]}let a=this.decodePosition(t,s,Iat),c=n.geodeticSurfaceNormal(a,Jye),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};vc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};vc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Js.BITS12){let i=Mn.decompressTextureCoordinates(e[t],dd);n.x=i.x,n.y=i.y;let o=Mn.decompressTextureCoordinates(e[t+1],dd);return n.z=o.x,F.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};vc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,Jye),a=this.decodeHeight(e,t),c=Er.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};vc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new z),t*=this.stride,this.quantization===Js.BITS12?Mn.decompressTextureCoordinates(e[t+2],n):z.fromElements(e[t+4],e[t+5],n)};vc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Js.BITS12?Mn.decompressTextureCoordinates(e[t+1],dd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};vc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Js.BITS12?Mn.decompressTextureCoordinates(e[t+3],dd).x:e[t+6]};vc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return z.fromElements(o,r,n)};vc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};vc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Js.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var XH={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},KH={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};vc.prototype.getAttributes=function(e){let t=X.FLOAT,n=X.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===Js.NONE){s(XH.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(XH.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(XH.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(KH.compressed0,a?4:3),c&&s(KH.compressed1,1),this.hasGeodeticSurfaceNormals&&s(KH.geodeticSurfaceNormal,3)}return r};vc.prototype.getAttributeLocations=function(){return this.quantization===Js.NONE?XH:KH};vc.clone=function(e,t){if(l(e))return l(t)||(t=new vc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var wc=vc;var $m={};$m.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var CX=new h,Pat=new F,Rat=new h,Oat=new h;$m.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=y(e.isGeographic,!0),m=y(e.ellipsoid,ee.default),x=1/m.maximumRadius,b=se.clone(e.nativeRectangle),T=se.clone(e.rectangle),C,A,E,v;l(T)?(C=T.west,A=T.south,E=T.east,v=T.north):g?(C=a(b.west),A=a(b.south),E=a(b.east),v=a(b.north)):(C=b.west*x,A=s-2*o(r(-b.south*x)),E=b.east*x,v=s-2*o(r(-b.north*x)));let D=e.relativeToCenter,O=l(D);D=O?D:h.ZERO;let R=y(e.includeWebMercatorT,!1),M=y(e.exaggeration,1),N=y(e.exaggerationRelativeHeight,0),S=M!==1,w=y(e.structure,$m.DEFAULT_STRUCTURE),I=y(w.heightScale,$m.DEFAULT_STRUCTURE.heightScale),L=y(w.heightOffset,$m.DEFAULT_STRUCTURE.heightOffset),B=y(w.elementsPerHeight,$m.DEFAULT_STRUCTURE.elementsPerHeight),U=y(w.stride,$m.DEFAULT_STRUCTURE.stride),V=y(w.elementMultiplier,$m.DEFAULT_STRUCTURE.elementMultiplier),G=y(w.isBigEndian,$m.DEFAULT_STRUCTURE.isBigEndian),k=se.computeWidth(b),W=se.computeHeight(b),q=k/(u-1),J=W/(f-1);g||(k*=x,W*=x);let j=m.radiiSquared,K=j.x,Q=j.y,de=j.z,xe=65536,ce=-65536,ge=Ot.eastNorthUpToFixedFrame(D,m),be=F.inverseTransformation(ge,Pat),De,Ae;R&&(De=Oi.geodeticLatitudeToMercatorAngle(A),Ae=1/(Oi.geodeticLatitudeToMercatorAngle(v)-De));let ke=Rat;ke.x=Number.POSITIVE_INFINITY,ke.y=Number.POSITIVE_INFINITY,ke.z=Number.POSITIVE_INFINITY;let ze=Oat;ze.x=Number.NEGATIVE_INFINITY,ze.y=Number.NEGATIVE_INFINITY,ze.z=Number.NEGATIVE_INFINITY;let tt=Number.POSITIVE_INFINITY,vt=u*f,pt=d>0?u*2+f*2:0,Be=vt+pt,qt=new Array(Be),At=new Array(Be),lt=new Array(Be),jn=R?new Array(Be):[],sn=S?new Array(Be):[],me=0,Ce=f,mn=0,ft=u;p&&(--me,++Ce,--mn,++ft);let ao=1e-5;for(let Xe=me;Xe<Ce;++Xe){let dt=Xe;dt<0&&(dt=0),dt>=f&&(dt=f-1);let Ht=b.north-J*dt;g?Ht=a(Ht):Ht=s-2*o(r(-Ht*x));let Tn=(Ht-A)/(v-A);Tn=P.clamp(Tn,0,1);let Oo=Xe===me,Ao=Xe===Ce-1;d>0&&(Oo?Ht+=ao*W:Ao&&(Ht-=ao*W));let Za=t(Ht),$a=n(Ht),Ai=de*$a,pi;R&&(pi=(Oi.geodeticLatitudeToMercatorAngle(Ht)-De)*Ae);for(let sa=mn;sa<ft;++sa){let Zr=sa;Zr<0&&(Zr=0),Zr>=u&&(Zr=u-1);let Al=dt*(u*U)+Zr*U,xo;if(B===1)xo=c[Al];else{xo=0;let zo;if(G)for(zo=0;zo<B;++zo)xo=xo*V+c[Al+zo];else for(zo=B-1;zo>=0;--zo)xo=xo*V+c[Al+zo]}xo=xo*I+L,ce=Math.max(ce,xo),xe=Math.min(xe,xo);let Or=b.west+q*Zr;g?Or=a(Or):Or=Or*x;let gp=(Or-C)/(E-C);gp=P.clamp(gp,0,1);let $r=dt*u+Zr;if(d>0){let zo=sa===mn,cn=sa===ft-1,Ee=Oo||Ao||zo||cn;if((Oo||Ao)&&(zo||cn))continue;Ee&&(xo-=d,zo?($r=vt+(f-dt-1),Or-=ao*k):Ao?$r=vt+f+(u-Zr-1):cn?($r=vt+f+u+dt,Or+=ao*k):Oo&&($r=vt+f+u+f+Zr))}let hf=Za*t(Or),Qa=Za*n(Or),Z0=K*hf,aa=Q*Qa,Nc=1/i(Z0*hf+aa*Qa+Ai*$a),fs=Z0*Nc,mf=aa*Nc,pf=Ai*Nc,_f=new h;_f.x=fs+hf*xo,_f.y=mf+Qa*xo,_f.z=pf+$a*xo,F.multiplyByPoint(be,_f,CX),h.minimumByComponent(CX,ke,ke),h.maximumByComponent(CX,ze,ze),tt=Math.min(tt,xo),qt[$r]=_f,lt[$r]=new z(gp,Tn),At[$r]=xo,R&&(jn[$r]=pi),S&&(sn[$r]=m.geodeticSurfaceNormal(_f))}}let Ro=ae.fromPoints(qt),ra;l(T)&&(ra=vn.fromRectangle(T,xe,ce,m));let Rr;O&&(Rr=new V_(m).computeHorizonCullingPointPossiblyUnderEllipsoid(D,qt,xe));let As=new Xg(ke,ze,D),Le=new wc(D,As,tt,ce,ge,!1,R,S,M,N),it=new Float32Array(Be*Le.stride),qe=0;for(let Xe=0;Xe<Be;++Xe)qe=Le.encode(it,qe,qt[Xe],lt[Xe],At[Xe],void 0,jn[Xe],sn[Xe]);return{vertices:it,maximumHeight:ce,minimumHeight:xe,encoding:Le,boundingSphere3D:Ro,orientedBoundingBox:ra,occludeePointInScaledSpace:Rr}};var US=$m;function C0(){he.throwInstantiationError()}Object.defineProperties(C0.prototype,{credits:{get:he.throwInstantiationError},waterMask:{get:he.throwInstantiationError}});C0.prototype.interpolateHeight=he.throwInstantiationError;C0.prototype.isChildAvailable=he.throwInstantiationError;C0.prototype.createMesh=he.throwInstantiationError;C0.prototype.upsample=he.throwInstantiationError;C0.prototype.wasCreatedByUpsampling=he.throwInstantiationError;C0.maximumAsynchronousTasks=5;var Lh=C0;function Mat(e,t,n,i,o,r,s,a,c,u,f,d,p,g,m,x){this.center=e,this.vertices=t,this.stride=y(u,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=d,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=x}var hd=Mat;function pl(){he.throwInstantiationError()}Object.defineProperties(pl.prototype,{errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},hasWaterMask:{get:he.throwInstantiationError},hasVertexNormals:{get:he.throwInstantiationError},availability:{get:he.throwInstantiationError}});var e0e=[];pl.getRegularGridIndices=function(e,t){let n=e0e[e];l(n)||(e0e[e]=n=[]);let i=n[t];return l(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),o0e(e,t,i,0)),i};var t0e=[];pl.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=t0e[e];l(n)||(t0e[e]=n=[]);let i=n[t];if(!l(i)){let o=pl.getRegularGridIndices(e,t),r=i0e(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var n0e=[];pl.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=n0e[e];l(n)||(n0e[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,u=r+a,f=i0e(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,x=Ne.createTypedArray(c,u);o0e(e,t,x,0),pl.addSkirtIndices(d,p,g,m,o,x,r),i=n[t]={indices:x,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};pl.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=ZH(e,a,r,s),a+=e.length,s=ZH(t,a,r,s),a+=t.length,s=ZH(n,a,r,s),a+=n.length,ZH(i,a,r,s)};function i0e(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function o0e(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function ZH(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}pl.heightmapTerrainQuality=.25;pl.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*pl.heightmapTerrainQuality/(t*n)};pl.prototype.requestTileGeometry=he.throwInstantiationError;pl.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;pl.prototype.getTileDataAvailable=he.throwInstantiationError;pl.prototype.loadTileDataAvailability=he.throwInstantiationError;var ss=pl;function ag(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,fd.NONE);let t=US.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===fd.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(ag.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var r0e="createVerticesFromHeightmap",Lat=new gi(r0e),Nat=new gi(r0e,Lh.maximumAsynchronousTasks);ag.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),d=c.cartographicToCartesian(se.center(f)),p=this._structure,m=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let b=(a?Nat:Lat).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Pi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(b))return;let T=this;return Promise.resolve(b).then(function(C){let A;T._skirtHeight>0?A=ss.getRegularGridAndSkirtIndicesAndEdgeIndices(C.gridWidth,C.gridHeight):A=ss.getRegularGridIndicesAndEdgeIndices(C.gridWidth,C.gridHeight);let E=C.gridWidth*C.gridHeight;return T._mesh=new hd(d,new Float32Array(C.vertices),A.indices,A.indexCountWithoutSkirts,E,C.minimumHeight,C.maximumHeight,ae.clone(C.boundingSphere3D),h.clone(C.occludeePointInScaledSpace),C.numberOfAttributes,vn.clone(C.orientedBoundingBox),wc.clone(C.encoding),A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),T._buffer=void 0,T._mesh})};ag.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(se.center(u)),d=this._structure,g=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let m=US.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Pi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=ss.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=ss.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=m.gridWidth*m.gridHeight;return this._mesh=new hd(f,m.vertices,x.indices,x.indexCountWithoutSkirts,b,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};ag.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,d=r.heightScale,p=l(this._mesh),g=this._encoding===fd.LERC;if(!p&&g)return;let x;if(p){let b=this._mesh.vertices,T=this._mesh.encoding;x=s0e(b,T,f,d,e,i,o,t,n)}else x=Fat(this._buffer,a,c,s,u,e,i,o,t,n),x=x*d+f;return x};ag.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,m=a.encoding,x=e.tileXYToRectangle(t,n,i),b=e.tileXYToRectangle(o,r,s),T=f.heightOffset,C=f.heightScale,A=f.elementsPerHeight,E=f.elementMultiplier,v=f.isBigEndian,D=Math.pow(E,A-1);for(let O=0;O<u;++O){let R=P.lerp(b.north,b.south,O/(u-1));for(let M=0;M<c;++M){let N=P.lerp(b.west,b.east,M/(c-1)),_=s0e(g,m,T,C,x,c,u,N,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,Bat(p,A,E,D,d,v,O*c+M,_)}}return Promise.resolve(new ag({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};ag.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};ag.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function Fat(e,t,n,i,o,r,s,a,c,u){let f=(c-r.west)*(s-1)/(r.east-r.west),d=(u-r.south)*(a-1)/(r.north-r.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=d|0,x=m+1;x>=a&&(x=a-1,m=a-2);let b=f-p,T=d-m;m=a-1-m,x=a-1-x;let C=$H(e,t,n,i,o,m*s+p),A=$H(e,t,n,i,o,m*s+g),E=$H(e,t,n,i,o,x*s+p),v=$H(e,t,n,i,o,x*s+g);return a0e(b,T,C,A,E,v)}function s0e(e,t,n,i,o,r,s,a,c){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(s-1)/(o.north-o.south),d=u|0,p=d+1;p>=r&&(p=r-1,d=r-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let x=u-d,b=f-g;g=s-1-g,m=s-1-m;let T=(t.decodeHeight(e,g*r+d)-n)/i,C=(t.decodeHeight(e,g*r+p)-n)/i,A=(t.decodeHeight(e,m*r+d)-n)/i,E=(t.decodeHeight(e,m*r+p)-n)/i;return a0e(x,b,T,C,A,E)}function a0e(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function $H(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function Bat(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Wa=ag;function zS(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Xi({ellipsoid:y(e.ellipsoid,ee.default)})),this._levelZeroMaximumGeometricError=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe}Object.defineProperties(zS.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});zS.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Wa({buffer:new Uint8Array(16*16),width:16,height:16}))};zS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};zS.prototype.getTileDataAvailable=function(e,t,n){};zS.prototype.loadTileDataAvailability=function(e,t,n){};var Qm=zS;var LF=`uniform vec4 u_initialColor; #if TEXTURE_UNITS > 0 uniform sampler2D u_dayTextures[TEXTURE_UNITS]; @@ -7160,7 +10360,7 @@ vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat } #endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var NP=`#ifdef QUANTIZATION_BITS12 +`;var NF=`#ifdef QUANTIZATION_BITS12 in vec4 compressed0; in float compressed1; #else @@ -7445,7 +10645,7 @@ void main() v_height = height; #endif } -`;var cA=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +`;var HS=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); @@ -7463,4970 +10663,8 @@ void main() opacity ); } -`;var qg=`in vec4 v_color; -in vec4 v_outlineColor; -in float v_innerPercent; -in float v_pixelDistance; -in vec4 v_pickColor; -in float v_splitDirection; - -void main() -{ - if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; - - // The distance in UV space from this fragment to the center of the point, at most 0.5. - float distanceToCenter = length(gl_PointCoord - vec2(0.5)); - // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. - float maxDistance = max(0.0, 0.5 - v_pixelDistance); - float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); - float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); - - vec4 color = mix(v_outlineColor, v_color, innerAlpha); - color.a *= wholeAlpha; - -// Fully transparent parts of the billboard are not pickable. -#if !defined(OPAQUE) && !defined(TRANSLUCENT) - if (color.a < 0.005) // matches 0/255 and 1/255 - { - discard; - } -#else -// The billboard is rendered twice. The opaque pass discards translucent fragments -// and the translucent pass discards opaque fragments. -#ifdef OPAQUE - if (color.a < 0.995) // matches < 254/255 - { - discard; - } -#else - if (color.a >= 0.995) // matches 254/255 and 255/255 - { - discard; - } -#endif -#endif - - out_FragColor = czm_gammaCorrect(color); - czm_writeLogDepth(); -} -`;var FP=`uniform float u_maxTotalPointSize; - -in vec4 positionHighAndSize; -in vec4 positionLowAndOutline; -in vec4 compressedAttribute0; // color, outlineColor, pick color -in vec4 compressedAttribute1; // show, translucency by distance, some free space -in vec4 scaleByDistance; // near, nearScale, far, farScale -in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection - -out vec4 v_color; -out vec4 v_outlineColor; -out float v_innerPercent; -out float v_pixelDistance; -out vec4 v_pickColor; -out float v_splitDirection; - -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; - -void main() -{ - // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - - // unpack attributes - vec3 positionHigh = positionHighAndSize.xyz; - vec3 positionLow = positionLowAndOutline.xyz; - float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; - float totalSize = positionHighAndSize.w + outlineWidthBothSides; - float outlinePercent = outlineWidthBothSides / totalSize; - // Scale in response to browser-zoom. - totalSize *= czm_pixelRatio; - - float temp = compressedAttribute1.x * SHIFT_RIGHT8; - float show = floor(temp); - -#ifdef EYE_DISTANCE_TRANSLUCENCY - vec4 translucencyByDistance; - translucencyByDistance.x = compressedAttribute1.z; - translucencyByDistance.z = compressedAttribute1.w; - - translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; - - temp = compressedAttribute1.y * SHIFT_RIGHT8; - translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif - - /////////////////////////////////////////////////////////////////////////// - - vec4 color; - vec4 outlineColor; - vec4 pickColor; - - // compressedAttribute0.z => pickColor.rgb - - temp = compressedAttribute0.z * SHIFT_RIGHT8; - pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor.r = floor(temp); - - // compressedAttribute0.x => color.rgb - - temp = compressedAttribute0.x * SHIFT_RIGHT8; - color.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - color.g = (temp - floor(temp)) * SHIFT_LEFT8; - color.r = floor(temp); - - // compressedAttribute0.y => outlineColor.rgb - - temp = compressedAttribute0.y * SHIFT_RIGHT8; - outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.r = floor(temp); - - // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a - - temp = compressedAttribute0.w * SHIFT_RIGHT8; - pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor = pickColor / 255.0; - - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor /= 255.0; - color.a = floor(temp); - color /= 255.0; - - /////////////////////////////////////////////////////////////////////////// - - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - - /////////////////////////////////////////////////////////////////////////// - -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - // 2D camera distance is a special case - // treat all billboards as flattened to the z=0.0 plane - lengthSq = czm_eyeHeight2D.y; - } - else - { - lengthSq = dot(positionEC.xyz, positionEC.xyz); - } -#endif - -#ifdef EYE_DISTANCE_SCALING - totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); -#endif - if (totalSize > 0.0) { - // Add padding for anti-aliasing on both sides. - totalSize += 3.0; - } - - // Clamp to max point size. - totalSize = min(totalSize, u_maxTotalPointSize); - // If size is too small, push vertex behind near plane for clipping. - // Note that context.minimumAliasedPointSize "will be at most 1.0". - if (totalSize < 1.0) - { - positionEC.xyz = vec3(0.0); - totalSize = 1.0; - } - - float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY - translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); - // push vertex behind near plane for clipping - if (translucency < 0.004) - { - positionEC.xyz = vec3(0.0); - } -#endif - -#ifdef DISTANCE_DISPLAY_CONDITION - float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; - float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; - if (lengthSq < nearSq || lengthSq > farSq) { - // push vertex behind camera to force it to be clipped - positionEC.xyz = vec3(0.0, 0.0, 1.0); - } -#endif - - gl_Position = czm_projection * positionEC; - czm_vertexLogDepth(); - -#ifdef DISABLE_DEPTH_DISTANCE - float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; - if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) - { - disableDepthTestDistance = czm_minimumDisableDepthTestDistance; - } - - if (disableDepthTestDistance != 0.0) - { - // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. - float zclip = gl_Position.z / gl_Position.w; - bool clipped = (zclip < -1.0 || zclip > 1.0); - if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) - { - // Position z on the near plane. - gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH - czm_vertexLogDepth(vec4(czm_currentFrustum.x)); -#endif - } - } -#endif - - v_color = color; - v_color.a *= translucency * show; - v_outlineColor = outlineColor; - v_outlineColor.a *= translucency * show; - - v_innerPercent = 1.0 - outlinePercent; - v_pixelDistance = 2.0 / totalSize; - gl_PointSize = totalSize * show; - gl_Position *= show; - - v_pickColor = pickColor; - v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; -} -`;var BP=`in vec2 v_textureCoordinates; - -uniform int u_polygonsLength; -uniform int u_extentsLength; -uniform highp sampler2D u_polygonTexture; -uniform highp sampler2D u_extentsTexture; - -int getPolygonIndex(float dimension, vec2 coord) { - vec2 uv = coord.xy * dimension; - return int(floor(uv.y) * dimension + floor(uv.x)); -} - -vec2 getLookupUv(ivec2 dimensions, int i) { - int pixY = i / dimensions.x; - int pixX = i - (pixY * dimensions.x); - float pixelWidth = 1.0 / float(dimensions.x); - float pixelHeight = 1.0 / float(dimensions.y); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - return vec2(u, v); -} - -vec4 getExtents(int i) { - return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i)); -} - -ivec2 getPositionsLengthAndExtentsIndex(int i) { - vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i); - vec4 value = texture(u_polygonTexture, uv); - return ivec2(int(value.x), int(value.y)); -} - -vec2 getPolygonPosition(int i) { - vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i); - return texture(u_polygonTexture, uv).xy; -} - -vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) { - float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y); - float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x); - return vec2(latitude, longitude); -} - -void main() { - int lastPolygonIndex = 0; - out_FragColor = vec4(1.0); - - // Get the relevant region of the texture - float dimension = float(u_extentsLength); - if (u_extentsLength > 2) { - dimension = ceil(log2(float(u_extentsLength))); - } - int regionIndex = getPolygonIndex(dimension, v_textureCoordinates); - - for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) { - ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex); - int positionsLength = positionsLengthAndExtents.x; - int polygonExtentsIndex = positionsLengthAndExtents.y; - lastPolygonIndex += 1; - - // Only compute signed distance for the relevant part of the atlas - if (polygonExtentsIndex == regionIndex) { - float clipAmount = czm_infinity; - vec4 extents = getExtents(polygonExtentsIndex); - vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension; - vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents); - float s = 1.0; - - // Check each edge for absolute distance - for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) { - vec2 a = getPolygonPosition(lastPolygonIndex + i); - vec2 b = getPolygonPosition(lastPolygonIndex + j); - - vec2 ab = b - a; - vec2 pa = p - a; - float t = dot(pa, ab) / dot(ab, ab); - t = clamp(t, 0.0, 1.0); - - vec2 pq = pa - t * ab; - float d = length(pq); - - // Inside / outside computation to determine sign - bvec3 cond = bvec3(p.y >= a.y, - p.y < b.y, - ab.x * pa.y > ab.y * pa.x); - if (all(cond) || all(not(cond))) s = -s; - if (abs(d) < abs(clipAmount)) { - clipAmount = d; - } - } - - // Normalize the range to [0,1] - vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; - // In the case where we've iterated through multiple polygons, take the minimum - out_FragColor = min(out_FragColor, result); - } - - lastPolygonIndex += positionsLength; - } -}`;var _u=`void clipLineSegmentToNearPlane( - vec3 p0, - vec3 p1, - out vec4 positionWC, - out bool clipped, - out bool culledByNearPlane, - out vec4 clippedPositionEC) -{ - culledByNearPlane = false; - clipped = false; - - vec3 p0ToP1 = p1 - p0; - float magnitude = length(p0ToP1); - vec3 direction = normalize(p0ToP1); - - // Distance that p0 is behind the near plane. Negative means p0 is - // in front of the near plane. - float endPoint0Distance = czm_currentFrustum.x + p0.z; - - // Camera looks down -Z. - // When moving a point along +Z: LESS VISIBLE - // * Points in front of the camera move closer to the camera. - // * Points behind the camrea move farther away from the camera. - // When moving a point along -Z: MORE VISIBLE - // * Points in front of the camera move farther away from the camera. - // * Points behind the camera move closer to the camera. - - // Positive denominator: -Z, becoming more visible - // Negative denominator: +Z, becoming less visible - // Nearly zero: parallel to near plane - float denominator = -direction.z; - - if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) - { - // p0 is behind the near plane and the line to p1 is nearly parallel to - // the near plane, so cull the segment completely. - culledByNearPlane = true; - } - else if (endPoint0Distance > 0.0) - { - // p0 is behind the near plane, and the line to p1 is moving distinctly - // toward or away from it. - - // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) - float t = endPoint0Distance / denominator; - if (t < 0.0 || t > magnitude) - { - // Near plane intersection is not between the two points. - // We already confirmed p0 is behind the naer plane, so now - // we know the entire segment is behind it. - culledByNearPlane = true; - } - else - { - // Segment crosses the near plane, update p0 to lie exactly on it. - p0 = p0 + t * direction; - - // Numerical noise might put us a bit on the wrong side of the near plane. - // Don't let that happen. - p0.z = min(p0.z, -czm_currentFrustum.x); - - clipped = true; - } - } - - clippedPositionEC = vec4(p0, 1.0); - positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); -} - -vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) -{ - // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. - -#ifdef POLYLINE_DASH - // Compute the window coordinates of the points. - vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); - vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); - vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); - - // Determine the relative screen space direction of the line. - vec2 lineDir; - if (usePrevious) { - lineDir = normalize(positionWindow.xy - previousWindow.xy); - } - else { - lineDir = normalize(nextWindow.xy - positionWindow.xy); - } - angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) - - // Quantize the angle so it doesn't change rapidly between segments. - angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; -#endif - - vec4 clippedPrevWC, clippedPrevEC; - bool prevSegmentClipped, prevSegmentCulled; - clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); - - vec4 clippedNextWC, clippedNextEC; - bool nextSegmentClipped, nextSegmentCulled; - clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); - - bool segmentClipped, segmentCulled; - vec4 clippedPositionWC, clippedPositionEC; - clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); - - if (segmentCulled) - { - return vec4(0.0, 0.0, 0.0, 1.0); - } - - vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); - vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); - - // If a segment was culled, we can't use the corresponding direction - // computed above. We should never see both of these be true without - // \`segmentCulled\` above also being true. - if (prevSegmentCulled) - { - directionToPrevWC = -directionToNextWC; - } - else if (nextSegmentCulled) - { - directionToNextWC = -directionToPrevWC; - } - - vec2 thisSegmentForwardWC, otherSegmentForwardWC; - if (usePrevious) - { - thisSegmentForwardWC = -directionToPrevWC; - otherSegmentForwardWC = directionToNextWC; - } - else - { - thisSegmentForwardWC = directionToNextWC; - otherSegmentForwardWC = -directionToPrevWC; - } - - vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); - - vec2 leftWC = thisSegmentLeftWC; - float expandWidth = width * 0.5; - - // When lines are split at the anti-meridian, the position may be at the - // same location as the next or previous position, and we need to handle - // that to avoid producing NaNs. - if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) - { - vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); - - vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; - float leftSumLength = length(leftSumWC); - leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); - - // The sine of the angle between the two vectors is given by the formula - // |a x b| = |a||b|sin(theta) - // which is - // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); - // Because the z components of both vectors are zero, the x and y coordinate will be zero. - // Therefore, the sine of the angle is just the z component of the cross product. - vec2 u = -thisSegmentForwardWC; - vec2 v = leftWC; - float sinAngle = abs(u.x * v.y - u.y * v.x); - expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); - } - - vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; - return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; -} - -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) -{ - vec4 positionEC = czm_modelViewRelativeToEye * position; - vec4 prevEC = czm_modelViewRelativeToEye * previous; - vec4 nextEC = czm_modelViewRelativeToEye * next; - return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); -} -`;var vx=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif - -in vec2 v_st; - -void main() -{ - czm_materialInput materialInput; - - vec2 st = v_st; - st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); - - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = vec3(st, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#ifdef VECTOR_TILE - out_FragColor *= u_highlightColor; -#endif - - czm_writeLogDepth(); -} -`;var kP=`in vec4 v_startPlaneNormalEcAndHalfWidth; -in vec4 v_endPlaneNormalEcAndBatchId; -in vec4 v_rightPlaneEC; // Technically can compute distance for this here -in vec4 v_endEcAndStartEcX; -in vec4 v_texcoordNormalizationAndStartEcYZ; - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif - -void main(void) -{ - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); - - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; - - float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); - - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - // Check distance of the eye coordinate against start and end planes with normals in the right plane. - // For computing unskewed lengthwise texture coordinate. - // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. - - // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" - vec3 alignedPlaneNormal; - - // start aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); - - // end aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); - -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Clamp - distance to aligned planes may be negative due to mitering, - // so fragment texture coordinate might be out-of-bounds. - float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); - s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; - float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); - - czm_materialInput materialInput; - - materialInput.s = s; - materialInput.st = vec2(s, t); - materialInput.str = vec3(s, t, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - - czm_writeDepthClamp(); -} -`;var VP=`in vec3 v_forwardDirectionEC; -in vec3 v_texcoordNormalizationAndHalfWidth; -in float v_batchId; - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#else -in vec2 v_alignedPlaneDistances; -in float v_texcoordT; -#endif - -float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { - // We don't expect the ray to ever be parallel to the plane - return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); -} - -void main(void) -{ - vec4 eyeCoordinate = gl_FragCoord; - eyeCoordinate /= eyeCoordinate.w; - -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Use distances for planes aligned with segment to prevent skew in dashing - float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); - float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); - - // Clamp - distance to aligned planes may be negative due to mitering - distanceFromStart = max(0.0, distanceFromStart); - distanceFromEnd = max(0.0, distanceFromEnd); - - float s = distanceFromStart / (distanceFromStart + distanceFromEnd); - s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; - - czm_materialInput materialInput; - - materialInput.s = s; - materialInput.st = vec2(s, v_texcoordT); - materialInput.str = vec3(s, v_texcoordT, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR -} -`;var UP=`in vec3 position3DHigh; -in vec3 position3DLow; - -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; - -in float batchId; - -out vec3 v_forwardDirectionEC; -out vec3 v_texcoordNormalizationAndHalfWidth; -out float v_batchId; - -// For materials -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#else -out vec2 v_alignedPlaneDistances; -out float v_texcoordT; -#endif - -// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. -// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. -void main() -{ - v_batchId = batchId; - - // Start position - vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); - vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); - vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - - // Start plane - vec4 startPlane2D; - vec4 startPlane3D; - startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); - startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); - - // Right plane - vec4 rightPlane2D; - vec4 rightPlane3D; - rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); - rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); - - // End position - posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); - posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); - posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); - vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); - - // End plane - vec4 endPlane2D; - vec4 endPlane3D; - endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); - endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); - - // Forward direction - v_forwardDirectionEC = normalize(endEC - startEC); - - vec2 cleanTexcoordNormalization2D; - cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); - cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); - vec2 cleanTexcoordNormalization3D; - cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; - cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); - - v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#else // PER_INSTANCE_COLOR - // For computing texture coordinates - - v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); - v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); -#endif // PER_INSTANCE_COLOR - -#ifdef WIDTH_VARYING - float width = czm_batchTable_width(batchId); - float halfWidth = width * 0.5; - v_width = width; - v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#else - float halfWidth = 0.5 * czm_batchTable_width(batchId); - v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#endif - - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - // Since this is morphing, compute both 3D and 2D positions and then blend. - - // ****** 3D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); - vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Nudge the top vertex upwards to prevent flickering - vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); - geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc3D.xyz += geodeticSurfaceNormal; - - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); - - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - - // ****** 2D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition - absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); - absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); - planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); - upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Nudge the top vertex upwards to prevent flickering - geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); - geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc2D.xyz += geodeticSurfaceNormal; - - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(texcoordNormalization2D.x); -#ifndef PER_INSTANCE_COLOR - // Use vertex's sidedness to compute its texture coordinate. - v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); -#endif - - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - - // Blend for actual position - gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); - -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var zP=`in vec3 position3DHigh; -in vec3 position3DLow; - -// In 2D and in 3D, texture coordinate normalization component signs encodes: -// * X sign - sidedness relative to right plane -// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume -#ifndef COLUMBUS_VIEW_2D -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -#else -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -#endif - -in float batchId; - -out vec4 v_startPlaneNormalEcAndHalfWidth; -out vec4 v_endPlaneNormalEcAndBatchId; -out vec4 v_rightPlaneEC; -out vec4 v_endEcAndStartEcX; -out vec4 v_texcoordNormalizationAndStartEcYZ; - -// For materials -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif - -void main() -{ -#ifdef COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; - - vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); - vec3 ecEnd = forwardDirectionEC + ecStart; - forwardDirectionEC = normalize(forwardDirectionEC); - - // Right plane - v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - - v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); - v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; - -#else // COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; - vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); - vec3 ecEnd = ecStart + offset; - - vec3 forwardDirectionEC = normalize(offset); - - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - - // Right plane - v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - - v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; - -#endif // COLUMBUS_VIEW_2D - - v_endEcAndStartEcX.xyz = ecEnd; - v_endEcAndStartEcX.w = ecStart.x; - v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif // PER_INSTANCE_COLOR - - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - vec4 positionRelativeToEye = czm_computePosition(); - - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); - vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Extrude bottom vertices downward for far view distances, like for GroundPrimitives - upOrDown = cross(forwardDirectionEC, normalEC); - upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; - upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; - upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; - positionEC.xyz += upOrDown; - - v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); - - // Determine distance along normalEC to push for a volume of appropriate width. - // Make volumes about double pixel width for a conservative fit - in practice the - // extra cost here is minimal compared to the loose volume heights. - // - // N = normalEC (guaranteed "right-facing") - // R = rightEC - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - float width = czm_batchTable_width(batchId); -#ifdef WIDTH_VARYING - v_width = width; -#endif - - v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; - v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; - - v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; - v_endPlaneNormalEcAndBatchId.w = batchId; - - width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R - width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N - - // Determine if this vertex is on the "left" or "right" -#ifdef COLUMBUS_VIEW_2D - normalEC *= sign(texcoordNormalization2D.x); -#else - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); -#endif - - positionEC.xyz += width * normalEC; - gl_Position = czm_depthClamp(czm_projection * positionEC); - -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var HP=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 position2DHigh; -in vec3 position2DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 prevPosition2DHigh; -in vec3 prevPosition2DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec3 nextPosition2DHigh; -in vec3 nextPosition2DLow; -in vec4 texCoordExpandAndBatchIndex; - -out vec2 v_st; -out float v_width; -out vec4 v_pickColor; -out float v_polylineAngle; - -void main() -{ - float texCoord = texCoordExpandAndBatchIndex.x; - float expandDir = texCoordExpandAndBatchIndex.y; - bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; - float batchTableIndex = texCoordExpandAndBatchIndex.w; - - vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); - float width = widthAndShow.x + 0.5; - float show = widthAndShow.y; - - if (width < 1.0) - { - show = 0.0; - } - - vec4 pickColor = batchTable_getPickColor(batchTableIndex); - - vec4 p, prev, next; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); - prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); - next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); - prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); - next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), - czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), - czm_morphTime); - prev = czm_columbusViewMorph( - czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), - czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), - czm_morphTime); - next = czm_columbusViewMorph( - czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), - czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), - czm_morphTime); - } - - #ifdef DISTANCE_DISPLAY_CONDITION - vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); - vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); - vec3 centerLow = centerLowAndRadius.xyz; - float radius = centerLowAndRadius.w; - vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); - - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - lengthSq = czm_eyeHeight2D.y; - } - else - { - vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); - lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); - } - - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - if (lengthSq < nearSq || lengthSq > farSq) - { - show = 0.0; - } - #endif - - float polylineAngle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); - gl_Position = czm_viewportOrthographic * positionWC * show; - - v_st.s = texCoord; - v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); - - v_width = width; - v_pickColor = pickColor; - v_polylineAngle = polylineAngle; -} -`;var GP=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(u_texture, v_textureCoordinates); -} -`;var WP=`in vec4 position; -in float webMercatorT; - -uniform vec2 u_textureDimensions; - -out vec2 v_textureCoordinates; - -void main() -{ - v_textureCoordinates = vec2(position.x, webMercatorT); - gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); -} -`;var lA=`#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -in vec4 v_sphericalExtents; -#else // SPHERICAL -in vec2 v_inversePlaneExtents; -in vec4 v_westPlane; -in vec4 v_southPlane; -#endif // SPHERICAL -in vec3 v_uvMinAndSphericalLongitudeRotation; -in vec3 v_uMaxAndInverseDistance; -in vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif - -#ifdef NORMAL_EC -vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); - return eyeCoordinate.xyz / eyeCoordinate.w; -} - -vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { - vec2 glFragCoordXY = gl_FragCoord.xy; - // Sample depths at both offset and negative offset - float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); - float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); - // Explicitly evaluate both paths - // Necessary for multifrustum and for edges of the screen - bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); - float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); - float useDownOrLeft = float(useUpOrRight == 0.0); - vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); - vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); - return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; -} -#endif // NORMAL_EC - -void main(void) -{ -#ifdef REQUIRES_EC - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -#endif - -#ifdef REQUIRES_WC - vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; - vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; -#endif - -#ifdef TEXTURE_COORDINATES - vec2 uv; -#ifdef SPHERICAL - // Treat world coords as a sphere normal for spherical coordinates - vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); - sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; - sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); - uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; - uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; -#else // SPHERICAL - // Unpack planes and transform to eye space - uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; - uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; -#endif // SPHERICAL -#endif // TEXTURE_COORDINATES - -#ifdef PICK -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - // Check for logDepthOrDepth != 0.0 to make sure this should be classified. - if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { - out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource - czm_writeDepthClamp(); - } -#else // CULL_FRAGMENTS - out_FragColor.a = 1.0; -#endif // CULL_FRAGMENTS -#else // PICK - -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { - discard; - } -#endif - -#ifdef NORMAL_EC - // Compute normal by sampling adjacent pixels in 2x2 block in screen space - vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); - vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); - vec3 normalEC = normalize(cross(leftRight, downUp)); -#endif - - -#ifdef PER_INSTANCE_COLOR - - vec4 color = czm_gammaCorrect(v_color); -#ifdef FLAT - out_FragColor = color; -#else // FLAT - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = -eyeCoordinate.xyz; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - -#else // PER_INSTANCE_COLOR - - // Material support. - // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or - // dependencies for culling but might not actually be used by the material. - - czm_materialInput materialInput; - -#ifdef USES_NORMAL_EC - materialInput.normalEC = normalEC; -#endif - -#ifdef USES_POSITION_TO_EYE_EC - materialInput.positionToEyeEC = -eyeCoordinate.xyz; -#endif - -#ifdef USES_TANGENT_TO_EYE - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); -#endif - -#ifdef USES_ST - // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired - // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. - // Shader is provided a set of reference points for remapping. - materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; - materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; -#endif - - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else // FLAT - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - -#endif // PER_INSTANCE_COLOR - czm_writeDepthClamp(); -#endif // PICK -} -`;var jP=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; - -#ifdef EXTRUDED_GEOMETRY -in vec3 extrudeDirection; - -uniform float u_globeMinimumAltitude; -#endif // EXTRUDED_GEOMETRY - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif // PER_INSTANCE_COLOR - -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -out vec4 v_sphericalExtents; -#else // SPHERICAL -out vec2 v_inversePlaneExtents; -out vec4 v_westPlane; -out vec4 v_southPlane; -#endif // SPHERICAL -out vec3 v_uvMinAndSphericalLongitudeRotation; -out vec3 v_uMaxAndInverseDistance; -out vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES - -void main() -{ - vec4 position = czm_computePosition(); - -#ifdef EXTRUDED_GEOMETRY - float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); - delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; - - //extrudeDirection is zero for the top layer - position = position + vec4(extrudeDirection * delta, 0.0); -#endif - -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL - v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); - v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); -#else // SPHERICAL -#ifdef COLUMBUS_VIEW_2D - vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); - vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); - - // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): - // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) - // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) - // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) - vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); - bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; - planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); - planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); - - // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) - // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) - // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) - idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; - idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); - planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); - planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); - - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; - vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; - vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; -#else // COLUMBUS_VIEW_2D - // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; - vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; - vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; -#endif // COLUMBUS_VIEW_2D - - vec3 eastWard = southEastCorner - southWestCorner; - float eastExtent = length(eastWard); - eastWard /= eastExtent; - - vec3 northWard = northWestCorner - southWestCorner; - float northExtent = length(northWard); - northWard /= northExtent; - - v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); - v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); - v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); -#endif // SPHERICAL - vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); - vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); - - v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); - v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); - v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; -#endif // TEXTURE_COORDINATES - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif - - gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); -} -`;var Yg=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif - -void main(void) -{ -#ifdef VECTOR_TILE - out_FragColor = czm_gammaCorrect(u_highlightColor); -#else - out_FragColor = vec4(1.0); -#endif - czm_writeDepthClamp(); -} -`;var uA=`float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); -} - -void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) -{ - float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; - - // Adjustment to the atmosphere radius applied based on the camera height. - float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; - float distanceAdjustMax = czm_ellipsoidRadii.x; - float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; - float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); - - // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit - // for the position on the ellipsoid. - float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; - float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; - - // Setup the primary ray: from the camera position to the vertex position. - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); - - underTranslucentGlobe = 0.0; - - // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. - #if defined(GLOBE_TRANSLUCENT) - - // Check for intersection with the inner radius of the atmopshere. - czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); - if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { - - // Compute position on globe. - vec3 direction = normalize(positionWC); - czm_ray ellipsoidRay = czm_ray(positionWC, -direction); - czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); - vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); - - // Control the color using the camera angle. - float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); - - // Control the opacity using the distance from Earth. - opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); - vec3 horizonColor = vec3(0.1, 0.2, 0.3); - vec3 nearColor = vec3(0.0); - - rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); - - // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. - underTranslucentGlobe = 1.0; - return; - } - #endif - - computeScattering( - primaryRay, - length(cameraToPositionWC), - lightDirection, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); - - // Alter the opacity based on how close the viewer is to the ground. - // (0.0 = At edge of atmosphere, 1.0 = On ground) - float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; - float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; - opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); - - // Alter alpha based on time of day (0.0 = night , 1.0 = day) - float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; - opacity *= pow(nightAlpha, 0.5); -} -`;var qP=`in vec3 v_outerPositionWC; - -uniform vec3 u_hsbShift; - -#ifndef PER_FRAGMENT_ATMOSPHERE -in vec3 v_mieColor; -in vec3 v_rayleighColor; -in float v_opacity; -in float v_translucent; -#endif - -void main (void) -{ - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum); - - vec3 mieColor; - vec3 rayleighColor; - float opacity; - float translucent; - - #ifdef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - v_outerPositionWC, - lightDirection, - rayleighColor, - mieColor, - opacity, - translucent - ); - #else - mieColor = v_mieColor; - rayleighColor = v_rayleighColor; - opacity = v_opacity; - translucent = v_translucent; - #endif - - vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); - - #ifndef HDR - color.rgb = czm_pbrNeutralTonemapping(color.rgb); - color.rgb = czm_inverseGamma(color.rgb); - #endif - - #ifdef COLOR_CORRECT - const bool ignoreBlackPixels = true; - color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels); - #endif - - // For the parts of the sky atmosphere that are not behind a translucent globe, - // we mix in the default opacity so that the sky atmosphere still appears at distance. - // This is needed because the opacity in the sky atmosphere is initially adjusted based - // on the camera height. - if (translucent == 0.0) { - color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); - } - - out_FragColor = color; -} -`;var YP=`in vec4 position; - -out vec3 v_outerPositionWC; - -#ifndef PER_FRAGMENT_ATMOSPHERE -out vec3 v_mieColor; -out vec3 v_rayleighColor; -out float v_opacity; -out float v_translucent; -#endif - -void main(void) -{ - vec4 positionWC = czm_model * position; - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum); - - #ifndef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - positionWC.xyz, - lightDirection, - v_rayleighColor, - v_mieColor, - v_opacity, - v_translucent - ); - #endif - - v_outerPositionWC = positionWC.xyz; - gl_Position = czm_modelViewProjection * position; -} -`;var XP=`uniform samplerCube u_cubeMap; - -in vec3 v_texCoord; - -void main() -{ - vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); - out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); -} -`;var KP=`in vec3 position; -out vec3 v_texCoord; - -void main() -{ - vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); - gl_Position = czm_projection * vec4(p, 1.0); - v_texCoord = position.xyz; -} -`;var ZP=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 color = texture(u_texture, v_textureCoordinates); - out_FragColor = czm_gammaCorrect(color); -} -`;var $P=`uniform float u_radiusTS; - -in vec2 v_textureCoordinates; - -vec2 rotate(vec2 p, vec2 direction) -{ - return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); -} - -vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) -{ - vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); - float radius = length(rotatedPosition) * lengthScalar; - float burst = 1.0 - smoothstep(0.0, 0.55, radius); - return vec4(burst); -} - -void main() -{ - float lengthScalar = 2.0 / sqrt(2.0); - vec2 position = v_textureCoordinates - vec2(0.5); - float radius = length(position) * lengthScalar; - float surface = step(radius, u_radiusTS); - vec4 color = vec4(vec2(1.0), surface + 0.2, surface); - - float glow = 1.0 - smoothstep(0.0, 0.55, radius); - color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; - - vec4 burst = vec4(0.0); - - // The following loop has been manually unrolled for speed, to - // avoid sin() and cos(). - // - //for (float i = 0.4; i < 3.2; i += 1.047) { - // vec2 direction = vec2(sin(i), cos(i)); - // burst += 0.4 * addBurst(position, direction, lengthScalar); - // - // direction = vec2(sin(i - 0.08), cos(i - 0.08)); - // burst += 0.3 * addBurst(position, direction, lengthScalar); - //} - - burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 - burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 - burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - - burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 - - // End of manual loop unrolling. - - color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; - - out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); -} -`;var QP=`in vec2 direction; - -uniform float u_size; - -out vec2 v_textureCoordinates; - -void main() -{ - vec4 position; - if (czm_morphTime == 1.0) - { - position = vec4(czm_sunPositionWC, 1.0); - } - else - { - position = vec4(czm_sunPositionColumbusView.zxy, 1.0); - } - - vec4 positionEC = czm_view * position; - vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - - vec2 halfSize = vec2(u_size * 0.5); - halfSize *= ((direction * 2.0) - 1.0); - - gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); - - v_textureCoordinates = direction; -} -`;var JP=`in vec4 v_startPlaneEC; -in vec4 v_endPlaneEC; -in vec4 v_rightPlaneEC; -in float v_halfWidth; -in vec3 v_volumeUpEC; - -uniform vec4 u_highlightColor; -void main() -{ - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; - - float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); - - // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction - halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); - - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); - - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - out_FragColor = u_highlightColor; - - czm_writeDepthClamp(); -} -`;var e1=`in vec3 startEllipsoidNormal; -in vec3 endEllipsoidNormal; -in vec4 startPositionAndHeight; -in vec4 endPositionAndHeight; -in vec4 startFaceNormalAndVertexCorner; -in vec4 endFaceNormalAndHalfWidth; -in float a_batchId; - -uniform mat4 u_modifiedModelView; -uniform vec2 u_minimumMaximumVectorHeights; - -out vec4 v_startPlaneEC; -out vec4 v_endPlaneEC; -out vec4 v_rightPlaneEC; -out float v_halfWidth; -out vec3 v_volumeUpEC; - -void main() -{ - // vertex corner IDs - // 3-----------7 - // /| left /| - // / | 1 / | - // 2-----------6 5 end - // | / | / - // start |/ right |/ - // 0-----------4 - // - float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end - float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top - - vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; - vec3 right = normalize(cross(forward, startEllipsoidNormal)); - - vec4 position = vec4(startPositionAndHeight.xyz, 1.0); - position.xyz += forward * isEnd; - - v_volumeUpEC = czm_normal * normalize(cross(right, forward)); - - // Push for volume height - float offset; - vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); - - // offset height to create volume - offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); - offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; - position.xyz += offset * ellipsoidNormal; - - // move from RTC to EC - position = u_modifiedModelView * position; - right = czm_normal * right; - - // Push for width in a direction that is in the start or end plane and in a plane with right - // N = normalEC ("right-facing" direction for push) - // R = right - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); - scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); - vec3 miterPushNormal = czm_normal * normalize(scratchNormal); - - offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC - offset = offset / dot(miterPushNormal, right); - position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); - - gl_Position = czm_depthClamp(czm_projection * position); - - position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); - vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; - v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); - v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); - - position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); - vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; - v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); - v_halfWidth = endFaceNormalAndHalfWidth.w; -} -`;var t1=`in vec4 currentPosition; -in vec4 previousPosition; -in vec4 nextPosition; -in vec2 expandAndWidth; -in float a_batchId; - -uniform mat4 u_modifiedModelView; - -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; - - vec4 p = u_modifiedModelView * currentPosition; - vec4 prev = u_modifiedModelView * previousPosition; - vec4 next = u_modifiedModelView * nextPosition; - - float angle; - vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; -} -`;var fA=`in vec3 position; -in float a_batchId; - -uniform mat4 u_modifiedModelViewProjection; - -void main() -{ - gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;var n1=` -in vec2 v_textureCoordinates; - -void main() -{ - czm_materialInput materialInput; - - materialInput.s = v_textureCoordinates.s; - materialInput.st = v_textureCoordinates; - materialInput.str = vec3(v_textureCoordinates, 0.0); - materialInput.normalEC = vec3(0.0, 0.0, -1.0); - - czm_material material = czm_getMaterial(materialInput); - - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -} -`;function Xg(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new me,this.setValue(e)}Object.defineProperties(Xg.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Xg.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Xg.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};Xg.prototype.equals=function(e){return this===e||e instanceof Xg&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Xg.prototype.valueOf=function(){return this._value};Xg.prototype.toString=function(){return String(this._value)};var Kn=Xg;function fRe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function dRe(e){return new Kn(e)}function hRe(e,t,n){return fRe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,dRe))}var le=hRe;function i1(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(i1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance"),splitDirection:le("splitDirection")});i1.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new i1(this)};i1.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var sc=i1;function wx(){this._array=[],this._hash={}}Object.defineProperties(wx.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});wx.prototype.contains=function(e){return l(this._hash[e])};wx.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};wx.prototype.get=function(e){return this._hash[e]};wx.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};wx.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var St=wx;function gu(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(gu.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});gu.packedLength=2;gu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};gu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new gu),n.near=e[t++],n.far=e[t],n};gu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};gu.clone=function(e,t){if(l(e))return l(t)||(t=new gu),t.near=e.near,t.far=e.far,t};gu.prototype.clone=function(e){return gu.clone(this,e)};gu.prototype.equals=function(e){return gu.equals(this,e)};var Lt=gu;function vf(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}vf.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new vf(e.near,e.nearValue,e.far,e.farValue)};vf.packedLength=4;vf.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};vf.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new vf),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};vf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};vf.prototype.clone=function(e){return vf.clone(this,e)};vf.prototype.equals=function(e){return vf.equals(this,e)};var kt=vf;var Dx={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},Ye=Object.freeze(Dx);function wf(e){return e===Dx.CLAMP_TO_GROUND||e===Dx.CLAMP_TO_3D_TILE||e===Dx.CLAMP_TO_TERRAIN}function dA(e){return e===Dx.RELATIVE_TO_GROUND||e===Dx.RELATIVE_TO_3D_TILE||e===Dx.RELATIVE_TO_TERRAIN}var mRe={CENTER:0,LEFT:1,RIGHT:-1},gi=Object.freeze(mRe);var pRe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Rn=Object.freeze(pRe);var _Re={DONE:0,PENDING:1,FAILED:2},ct=Object.freeze(_Re);function kd(){he.throwInstantiationError()}Object.defineProperties(kd.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});kd.prototype.getValue=he.throwInstantiationError;kd.prototype.equals=he.throwInstantiationError;kd.equals=function(e,t){return e===t||l(e)&&e.equals(t)};kd.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!kd.equals(e[i],t[i]))return!1;return!0};kd.isConstant=function(e){return!l(e)||e.isConstant};kd.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};kd.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};kd.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var Y=kd;var gRe={LEFT:-1,NONE:0,RIGHT:1},Br=Object.freeze(gRe);var yRe=H.WHITE,xRe=h.ZERO,bRe=Ye.NONE,TRe=z.ZERO,CRe=1,ARe=0,ERe=h.ZERO,SRe=gi.CENTER,vRe=Rn.CENTER,wRe=!1,DRe=Br.NONE,IRe=new h,PRe=new H,RRe=new h,ORe=new z,MRe=new kt,LRe=new kt,NRe=new kt,FRe=new je,BRe=new Lt;function Dne(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function Kg(e,t){t.collectionChanged.addEventListener(Kg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new St,this._onCollectionChanged(t,t.values,[],[])}Kg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;if(f&&(d=Y.getValueOrUndefined(s._position,e,IRe),c=Y.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){i9(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u),u.show=f,(!l(u.image)||r.textureValue!==c)&&(u.image=c,r.textureValue=c),u.position=d,u.color=Y.getValueOrDefault(a._color,e,yRe,PRe),u.eyeOffset=Y.getValueOrDefault(a._eyeOffset,e,xRe,RRe),u.heightReference=Y.getValueOrDefault(a._heightReference,e,bRe),u.pixelOffset=Y.getValueOrDefault(a._pixelOffset,e,TRe,ORe),u.scale=Y.getValueOrDefault(a._scale,e,CRe),u.rotation=Y.getValueOrDefault(a._rotation,e,ARe),u.alignedAxis=Y.getValueOrDefault(a._alignedAxis,e,ERe),u.horizontalOrigin=Y.getValueOrDefault(a._horizontalOrigin,e,SRe),u.verticalOrigin=Y.getValueOrDefault(a._verticalOrigin,e,vRe),u.width=Y.getValueOrUndefined(a._width,e),u.height=Y.getValueOrUndefined(a._height,e),u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,MRe),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,LRe),u.pixelOffsetScaleByDistance=Y.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,NRe),u.sizeInMeters=Y.getValueOrDefault(a._sizeInMeters,e,wRe),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,BRe),u.disableDepthTestDistance=Y.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=Y.getValueOrDefault(a._splitDirection,e,DRe);let p=Y.getValueOrUndefined(a._imageSubRegion,e,FRe);l(p)&&u.setImageSubRegion(u._imageId,p)}return!0};Kg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return ct.FAILED;let i=n.billboard;if(i.heightReference===Ye.NONE)t.center=h.clone(i.position,t.center);else{if(!l(i._clampedPosition))return ct.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ct.DONE};Kg.prototype.isDestroyed=function(){return!1};Kg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Kg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};Kg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new Dne(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Dne(r)):(i9(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],i9(s.get(r.id),r,a),s.remove(r.id)};function i9(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var o1=Kg;var kRe=new h;function dm(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}dm.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new dm({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};dm.fromAxisAlignedBoundingBox=function(e){return new dm({minimum:e.minimum,maximum:e.maximum})};dm.packedLength=2*h.packedLength+1;dm.pack=function(e,t,n){return n=y(n,0),h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=y(e._offsetAttribute,-1),t};var Pne=new h,Rne=new h,Ine={minimum:Pne,maximum:Rne,offsetAttribute:void 0};dm.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Pne),o=h.unpack(e,t+h.packedLength,Rne),r=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Ine.offsetAttribute=r===-1?void 0:r,new dm(Ine))};dm.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new fn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=h.subtract(n,t,kRe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===sn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new at({attributes:i,indices:o,primitiveType:Me.LINES,boundingSphere:new ae(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var Vd=dm;function hA(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([H.floatToByte(e),H.floatToByte(t),H.floatToByte(n),H.floatToByte(i)])}Object.defineProperties(hA.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});hA.fromColor=function(e){return new hA(e.red,e.green,e.blue,e.alpha)};hA.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};hA.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Wt=hA;function r1(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(r1.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});r1.fromDistanceDisplayCondition=function(e){return new r1(e.near,e.far)};r1.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var kn=r1;function VRe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var vt=VRe;function Jo(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?Z.clone(e.start):new Z,this.stop=l(e.stop)?Z.clone(e.stop):new Z,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(Jo.prototype,{isEmpty:{get:function(){let e=Z.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var mA={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Jo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new he("options.iso8601 is an invalid ISO 8601 interval.");let i=Z.fromIso8601(n[0]),o=Z.fromIso8601(n[1]),r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(mA.start=i,mA.stop=o,mA.isStartIncluded=r,mA.isStopIncluded=s,mA.data=a,new Jo(mA))};Jo.toIso8601=function(e,t){return`${Z.toIso8601(e.start,t)}/${Z.toIso8601(e.stop,t)}`};Jo.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Jo(e)};Jo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Z.equals(e.start,t.start)&&Z.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Jo.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Z.equalsEpsilon(e.start,t.start,n)&&Z.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Jo.intersect=function(e,t,n,i){if(!l(t))return Jo.clone(Jo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=Z.greaterThanOrEquals(s,o)&&Z.greaterThanOrEquals(r,s),u=!c&&Z.lessThanOrEquals(s,o)&&Z.lessThanOrEquals(o,a);if(!c&&!u)return Jo.clone(Jo.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=Z.lessThan(r,a);return l(n)||(n=new Jo),n.start=c?s:o,n.isStartIncluded=f&&p||!Z.equals(s,o)&&(c&&p||u&&f),n.stop=m?r:a,n.isStopIncluded=m?d:d&&g||!Z.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};Jo.contains=function(e,t){if(e.isEmpty)return!1;let n=Z.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=Z.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Jo.prototype.clone=function(e){return Jo.clone(this,e)};Jo.prototype.equals=function(e,t){return Jo.equals(this,e,t)};Jo.prototype.equalsEpsilon=function(e,t,n){return Jo.equalsEpsilon(this,e,t,n)};Jo.prototype.toString=function(){return Jo.toIso8601(this)};Jo.EMPTY=Object.freeze(new Jo({start:new Z,stop:new Z,isStartIncluded:!1,isStopIncluded:!1}));var An=Jo;var One=Object.freeze(Z.fromIso8601("0000-01-01T00:00:00Z")),Mne=Object.freeze(Z.fromIso8601("9999-12-31T24:00:00Z")),URe=Object.freeze(new An({start:One,stop:Mne})),zRe={MINIMUM_VALUE:One,MAXIMUM_VALUE:Mne,MAXIMUM_INTERVAL:URe},He=zRe;function s1(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(s1.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});s1.fromCartesian3=function(e){return new s1(e.x,e.y,e.z)};s1.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Ji=s1;function cU(e){e=y(e,!0),this.value=cU.toValue(e)}Object.defineProperties(cU.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});cU.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var gn=cU;var a1=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = tangentToEyeMatrix; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var c1=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec3 tangent; -in vec3 bitangent; -in vec2 st; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec3 v_tangentEC; -out vec3 v_bitangentEC; -out vec2 v_st; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_tangentEC = czm_normal * tangent; // tangent in eye coordinates - v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var l1=`in vec3 v_positionEC; -in vec3 v_normalEC; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var u1=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var f1=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var d1=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec2 st; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec2 v_st; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var HRe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX},Ra=Object.freeze(HRe);var GRe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE},Eo=Object.freeze(GRe);var WRe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:Eo.SOURCE_ALPHA,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:Eo.ONE,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:Eo.SOURCE_ALPHA,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE,functionDestinationAlpha:Eo.ONE})},un=Object.freeze(WRe);var jRe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK},yi=Object.freeze(jRe);function pA(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(pA.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});pA.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};pA.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};pA.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ge(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};pA.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=un.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:yi.BACK}),l(n)&&(i=bt(n,i,!0)),i};var io=pA;var h1=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var m1=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - vec2 centerPixel = fract(repeat * st); - float centerBump = texture(image, centerPixel).channel; - - float imageWidth = float(imageDimensions.x); - vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); - float rightBump = texture(image, rightPixel).channel; - - float imageHeight = float(imageDimensions.y); - vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); - float topBump = texture(image, leftPixel).channel; - - vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - material.diffuse = vec3(0.01); - - return material; -} -`;var p1=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 - - // Find the distance from the closest separator (region between two colors) - float scaledWidth = fract(repeat.s * st.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(repeat.t * st.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - float value = min(scaledWidth, scaledHeight); - - vec4 currentColor = mix(lightColor, darkColor, b); - vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); - - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var _1=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 - - vec4 color = mix(lightColor, darkColor, b); - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var g1=`uniform sampler2D heights; -uniform sampler2D colors; - -// This material expects heights to be sorted from lowest to highest. - -float getHeight(int idx, float invTexSize) -{ - vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); -#ifdef OES_texture_float - return texture(heights, uv).x; -#else - return czm_unpackFloat(texture(heights, uv)); -#endif -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float height = materialInput.height; - float invTexSize = 1.0 / float(heightsDimensions.x); - - float minHeight = getHeight(0, invTexSize); - float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); - - // early-out when outside the height range - if (height < minHeight || height > maxHeight) { - material.diffuse = vec3(0.0); - material.alpha = 0.0; - return material; - } - - // Binary search to find heights above and below. - int idxBelow = 0; - int idxAbove = heightsDimensions.x; - float heightBelow = minHeight; - float heightAbove = maxHeight; - - // while loop not allowed, so use for loop with max iterations. - // maxIterations of 16 supports a texture size up to 65536 (2^16). - const int maxIterations = 16; - for (int i = 0; i < maxIterations; i++) { - if (idxBelow >= idxAbove - 1) { - break; - } - - int idxMid = (idxBelow + idxAbove) / 2; - float heightTex = getHeight(idxMid, invTexSize); - - if (height > heightTex) { - idxBelow = idxMid; - heightBelow = heightTex; - } else { - idxAbove = idxMid; - heightAbove = heightTex; - } - } - - float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); - vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); - vec4 color = texture(colors, colorUv); - - // undo preumultiplied alpha - if (color.a > 0.0) - { - color.rgb /= color.a; - } - - color.rgb = czm_gammaCorrect(color.rgb); - - material.diffuse = color.rgb; - material.alpha = color.a; - return material; -} -`;var y1=`uniform vec4 color; -uniform float spacing; -uniform float width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float distanceToContour = mod(materialInput.height, spacing); - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float dxc = abs(dFdx(materialInput.height)); - float dyc = abs(dFdy(materialInput.height)); - float dF = max(dxc, dyc) * czm_pixelRatio * width; - float alpha = (distanceToContour < dF) ? 1.0 : 0.0; -#else - // If no derivatives available (IE 10?), use pixel ratio - float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; -#endif - - vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var x1=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); - vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var b1=`uniform vec4 fadeInColor; -uniform vec4 fadeOutColor; -uniform float maximumDistance; -uniform bool repeat; -uniform vec2 fadeDirection; -uniform vec2 time; - -float getTime(float t, float coord) -{ - float scalar = 1.0 / maximumDistance; - float q = distance(t, coord) * scalar; - if (repeat) - { - float r = distance(t, coord + 1.0) * scalar; - float s = distance(t, coord - 1.0) * scalar; - q = min(min(r, s), q); - } - return clamp(q, 0.0, 1.0); -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float s = getTime(time.x, st.s) * fadeDirection.s; - float t = getTime(time.y, st.t) * fadeDirection.t; - - float u = length(vec2(s, t)); - vec4 color = mix(fadeInColor, fadeOutColor, u); - - color = czm_gammaCorrect(color); - material.emission = color.rgb; - material.alpha = color.a; - - return material; -} -`;var T1=`uniform vec4 color; -uniform float cellAlpha; -uniform vec2 lineCount; -uniform vec2 lineThickness; -uniform vec2 lineOffset; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - - float value; - - // Fuzz Factor - Controls blurriness of lines -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - const float fuzz = 1.2; - vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; - - // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. - vec2 dx = abs(dFdx(st)); - vec2 dy = abs(dFdy(st)); - vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; - value = min( - smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), - smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); -#else - // If no derivatives available (IE 10?), revert to view-dependent fuzz - const float fuzz = 0.05; - - vec2 range = 0.5 - (lineThickness * 0.05); - value = min( - 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), - 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); -#endif - - // Edges taken from RimLightingMaterial.glsl - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); - float sRim = smoothstep(0.8, 1.0, dRim); - value *= (1.0 - sRim); - - vec4 halfColor; - halfColor.rgb = color.rgb * 0.5; - halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); - halfColor = czm_gammaCorrect(halfColor); - material.diffuse = halfColor.rgb; - material.emission = halfColor.rgb; - material.alpha = halfColor.a; - - return material; -} -`;var C1=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec4 textureValue = texture(image, fract(repeat * materialInput.st)); - vec3 normalTangentSpace = textureValue.channels; - normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; - normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); - normalTangentSpace = normalize(normalTangentSpace); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - - return material; -} -`;var A1=`uniform vec4 color; - -float getPointOnLine(vec2 p0, vec2 p1, float x) -{ - float slope = (p0.y - p1.y) / (p0.x - p1.x); - return slope * (x - p0.x) + p0.y; -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; -#else - // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head - float base = 0.975; -#endif - - vec2 center = vec2(1.0, 0.5); - float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); - float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); - - float halfWidth = 0.15; - float s = step(0.5 - halfWidth, st.t); - s *= 1.0 - step(0.5 + halfWidth, st.t); - s *= 1.0 - step(base, st.s); - - float t = step(base, materialInput.st.s); - t *= 1.0 - step(ptOnUpperLine, st.t); - t *= step(ptOnLowerLine, st.t); - - // Find the distance from the closest separator (region between two colors) - float dist; - if (st.s < base) - { - float d1 = abs(st.t - (0.5 - halfWidth)); - float d2 = abs(st.t - (0.5 + halfWidth)); - dist = min(d1, d2); - } - else - { - float d1 = czm_infinity; - if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) - { - d1 = abs(st.s - base); - } - float d2 = abs(st.t - ptOnUpperLine); - float d3 = abs(st.t - ptOnLowerLine); - dist = min(min(d1, d2), d3); - } - - vec4 outsideColor = vec4(0.0); - vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); - vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); - - outColor = czm_gammaCorrect(outColor); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - return material; -} -`;var E1=`uniform vec4 color; -uniform vec4 gapColor; -uniform float dashLength; -uniform float dashPattern; -in float v_polylineAngle; - -const float maskLength = 16.0; - -mat2 rotate(float rad) { - float c = cos(rad); - float s = sin(rad); - return mat2( - c, s, - -s, c - ); -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; - - // Get the relative position within the dash from 0 to 1 - float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); - // Figure out the mask index. - float maskIndex = floor(dashPosition * maskLength); - // Test the bit mask. - float maskTest = floor(dashPattern / pow(2.0, maskIndex)); - vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; - if (fragColor.a < 0.005) { // matches 0/255 and 1/255 - discard; - } - - fragColor = czm_gammaCorrect(fragColor); - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - return material; -} -`;var S1=`uniform vec4 color; -uniform float glowPower; -uniform float taperPower; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); - - if (taperPower <= 0.99999) { - glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); - } - - vec4 fragColor; - fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); - fragColor.a = clamp(0.0, 1.0, glow) * color.a; - fragColor = czm_gammaCorrect(fragColor); - - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - - return material; -} -`;var v1=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; - -in float v_width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; - float b = step(0.5 - halfInteriorWidth, st.t); - b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); - - // Find the distance from the closest separator (region between two colors) - float d1 = abs(st.t - (0.5 - halfInteriorWidth)); - float d2 = abs(st.t - (0.5 + halfInteriorWidth)); - float dist = min(d1, d2); - - vec4 currentColor = mix(outlineColor, color, b); - vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); - outColor = czm_gammaCorrect(outColor); - - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var w1=`uniform vec4 color; -uniform vec4 rimColor; -uniform float width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); - float s = smoothstep(1.0 - width, 1.0, d); - - vec4 outColor = czm_gammaCorrect(color); - vec4 outRimColor = czm_gammaCorrect(rimColor); - - material.diffuse = outColor.rgb; - material.emission = outRimColor.rgb * s; - material.alpha = mix(outColor.a, outRimColor.a, s); - - return material; -} -`;var D1=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var I1=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) - float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); - float value = fract((coord - offset) * (repeat * 0.5)); - float dist = min(value, min(abs(value - 0.5), 1.0 - value)); - - vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); - vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); - color = czm_gammaCorrect(color); - - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var P1=`uniform vec4 waterColor; -uniform vec4 landColor; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); - outColor = czm_gammaCorrect(outColor); - - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var R1=`// Thanks for the contribution Jonas -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog - -uniform sampler2D specularMap; -uniform sampler2D normalMap; -uniform vec4 baseWaterColor; -uniform vec4 blendColor; -uniform float frequency; -uniform float animationSpeed; -uniform float amplitude; -uniform float specularIntensity; -uniform float fadeFactor; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float time = czm_frameNumber * animationSpeed; - - // fade is a function of the distance from the fragment and the frequency of the waves - float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); - - float specularMapValue = texture(specularMap, materialInput.st).r; - - // note: not using directional motion at this time, just set the angle to 0.0; - vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); - vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); - - // fade out the normal perturbation as we move further from the water surface - normalTangentSpace.xy /= fade; - - // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) - normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); - - normalTangentSpace = normalize(normalTangentSpace); - - // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane - float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); - - // fade out water effect as specular map value decreases - material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; - - // base color is a blend of the water and non-water color based on the value from the specular map - // may need a uniform blend factor to better control this - material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); - - // diffuse highlights are based on how perturbed the normal is - material.diffuse += (0.1 * tsPerturbationRatio); - - material.diffuse = material.diffuse; - - material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); - - material.specular = specularIntensity; - material.shininess = 10.0; - - return material; -} -`;function We(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,Zt.LINEAR),this._magnificationFilter=y(e.magnificationFilter,di.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,qRe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(We._uniformList[this.type])||(We._uniformList[this.type]=Object.keys(this._uniforms))}We._uniformList={};We.fromType=function(e,t){let n=new We({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};We.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};We.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(x){return x.bufferView}),u=u[0]);let d=new $t({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Pt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Pt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let x=this.uniforms[m];x.x=p._width,x.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let u=c.images,f=new Cr({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new $t({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};We.prototype.isDestroyed=function(){return!1};We.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function qRe(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=Ge(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=Ge(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=Ge(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:Hn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=We._materialCache.getMaterial(t.type);if(l(i)){let r=Ge(i.fabric,!0);t._template=bt(t._template,r,!0),n=i.translucent}ZRe(t),l(i)||We._materialCache.addMaterial(t.type,t),QRe(t),nOe(t),oOe(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,o),n=y(e.translucent,n),l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function o9(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function Lne(e,t){}function YRe(e,t){}var XRe=["type","materials","uniforms","components","source"],KRe=["diffuse","specular","shininess","normal","emission","alpha"];function ZRe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;o9(t,XRe,Lne,!0),o9(o,KRe,Lne,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);o9(n,r,YRe,!1)}function $Re(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function QRe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} -`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) -{ -`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&$Re(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; -`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; -`:e.shaderSource+=`material.${o} = ${t[o]}; -`}e.shaderSource+=`return material; -} -`}}var Nne={mat2:Ii,mat3:$,mat4:F},JRe=/\.ktx2$/i;function eOe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===We.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new $t({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Pt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Pt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),a)return;let d=r instanceof Se;if(!l(n._texturePaths[e])||d&&r.url!==n._texturePaths[e].url||!d&&r!==n._texturePaths[e]){if(typeof r=="string"||d){let p=d?r:Se.createIfNeeded(r),g;JRe.test(p.url)?g=Dl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(m){n._loadedImages.push({id:e,image:m})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function tOe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Cr){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===We.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Se.createIfNeeded(i.positiveX).fetchImage(),Se.createIfNeeded(i.negativeX).fetchImage(),Se.createIfNeeded(i.positiveY).fetchImage(),Se.createIfNeeded(i.negativeY).fetchImage(),Se.createIfNeeded(i.positiveZ).fetchImage(),Se.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function nOe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Fne(e,n)}function Fne(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=iOe(o),s;if(r==="channels")s=O1(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;rOe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Fne(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=O1(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(eOe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(tOe(t));else if(r.indexOf("mat")!==-1){let u=new Nne[r];e._uniforms[c]=function(){return Nne[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function iOe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Se||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===We.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function oOe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new We({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=bt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;O1(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=O1(e,i,a)}}function O1(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(o+=1,n)}),o}function rOe(e,t,n){return O1(e,t,t,n)}We._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};We.DefaultImageId="czm_defaultImage";We.DefaultCubeMapId="czm_defaultCubeMap";We.ColorType="Color";We._materialCache.addMaterial(We.ColorType,{fabric:{type:We.ColorType,uniforms:{color:new H(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});We.ImageType="Image";We._materialCache.addMaterial(We.ImageType,{fabric:{type:We.ImageType,uniforms:{image:We.DefaultImageId,repeat:new z(1,1),color:new H(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});We.DiffuseMapType="DiffuseMap";We._materialCache.addMaterial(We.DiffuseMapType,{fabric:{type:We.DiffuseMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new z(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.AlphaMapType="AlphaMap";We._materialCache.addMaterial(We.AlphaMapType,{fabric:{type:We.AlphaMapType,uniforms:{image:We.DefaultImageId,channel:"a",repeat:new z(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});We.SpecularMapType="SpecularMap";We._materialCache.addMaterial(We.SpecularMapType,{fabric:{type:We.SpecularMapType,uniforms:{image:We.DefaultImageId,channel:"r",repeat:new z(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});We.EmissionMapType="EmissionMap";We._materialCache.addMaterial(We.EmissionMapType,{fabric:{type:We.EmissionMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new z(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.BumpMapType="BumpMap";We._materialCache.addMaterial(We.BumpMapType,{fabric:{type:We.BumpMapType,uniforms:{image:We.DefaultImageId,channel:"r",strength:.8,repeat:new z(1,1)},source:m1},translucent:!1});We.NormalMapType="NormalMap";We._materialCache.addMaterial(We.NormalMapType,{fabric:{type:We.NormalMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",strength:.8,repeat:new z(1,1)},source:C1},translucent:!1});We.GridType="Grid";We._materialCache.addMaterial(We.GridType,{fabric:{type:We.GridType,uniforms:{color:new H(0,1,0,1),cellAlpha:.1,lineCount:new z(8,8),lineThickness:new z(1,1),lineOffset:new z(0,0)},source:T1},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});We.StripeType="Stripe";We._materialCache.addMaterial(We.StripeType,{fabric:{type:We.StripeType,uniforms:{horizontal:!0,evenColor:new H(1,1,1,.5),oddColor:new H(0,0,1,.5),offset:0,repeat:5},source:I1},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});We.CheckerboardType="Checkerboard";We._materialCache.addMaterial(We.CheckerboardType,{fabric:{type:We.CheckerboardType,uniforms:{lightColor:new H(1,1,1,.5),darkColor:new H(0,0,0,.5),repeat:new z(5,5)},source:p1},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.DotType="Dot";We._materialCache.addMaterial(We.DotType,{fabric:{type:We.DotType,uniforms:{lightColor:new H(1,1,0,.75),darkColor:new H(0,1,1,.75),repeat:new z(5,5)},source:_1},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.WaterType="Water";We._materialCache.addMaterial(We.WaterType,{fabric:{type:We.WaterType,uniforms:{baseWaterColor:new H(.2,.3,.6,1),blendColor:new H(0,1,.699,1),specularMap:We.DefaultImageId,normalMap:We.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:R1},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});We.RimLightingType="RimLighting";We._materialCache.addMaterial(We.RimLightingType,{fabric:{type:We.RimLightingType,uniforms:{color:new H(1,0,0,.7),rimColor:new H(1,1,1,.4),width:.3},source:w1},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});We.FadeType="Fade";We._materialCache.addMaterial(We.FadeType,{fabric:{type:We.FadeType,uniforms:{fadeInColor:new H(1,0,0,1),fadeOutColor:new H(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new z(.5,.5)},source:b1},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});We.PolylineArrowType="PolylineArrow";We._materialCache.addMaterial(We.PolylineArrowType,{fabric:{type:We.PolylineArrowType,uniforms:{color:new H(1,1,1,1)},source:A1},translucent:!0});We.PolylineDashType="PolylineDash";We._materialCache.addMaterial(We.PolylineDashType,{fabric:{type:We.PolylineDashType,uniforms:{color:new H(1,0,1,1),gapColor:new H(0,0,0,0),dashLength:16,dashPattern:255},source:E1},translucent:!0});We.PolylineGlowType="PolylineGlow";We._materialCache.addMaterial(We.PolylineGlowType,{fabric:{type:We.PolylineGlowType,uniforms:{color:new H(0,.5,1,1),glowPower:.25,taperPower:1},source:S1},translucent:!0});We.PolylineOutlineType="PolylineOutline";We._materialCache.addMaterial(We.PolylineOutlineType,{fabric:{type:We.PolylineOutlineType,uniforms:{color:new H(1,1,1,1),outlineColor:new H(1,0,0,1),outlineWidth:1},source:v1},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});We.ElevationContourType="ElevationContour";We._materialCache.addMaterial(We.ElevationContourType,{fabric:{type:We.ElevationContourType,uniforms:{spacing:100,color:new H(1,0,0,1),width:1},source:y1},translucent:!1});We.ElevationRampType="ElevationRamp";We._materialCache.addMaterial(We.ElevationRampType,{fabric:{type:We.ElevationRampType,uniforms:{image:We.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:x1},translucent:!1});We.SlopeRampMaterialType="SlopeRamp";We._materialCache.addMaterial(We.SlopeRampMaterialType,{fabric:{type:We.SlopeRampMaterialType,uniforms:{image:We.DefaultImageId},source:D1},translucent:!1});We.AspectRampMaterialType="AspectRamp";We._materialCache.addMaterial(We.AspectRampMaterialType,{fabric:{type:We.AspectRampMaterialType,uniforms:{image:We.DefaultImageId},source:h1},translucent:!1});We.ElevationBandType="ElevationBand";We._materialCache.addMaterial(We.ElevationBandType,{fabric:{type:We.ElevationBandType,uniforms:{heights:We.DefaultImageId,colors:We.DefaultImageId},source:g1},translucent:!0});We.WaterMaskType="WaterMask";We._materialCache.addMaterial(We.WaterMaskType,{fabric:{type:We.WaterMaskType,source:P1,uniforms:{waterColor:new H(1,1,1,1),landColor:new H(0,0,0,0)}},translucent:!1});var Yi=We;function Ix(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,Ix.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Ix.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Ix.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Ix.prototype.isTranslucent=io.prototype.isTranslucent;Ix.prototype.getRenderState=io.prototype.getRenderState;Ix.MaterialSupport={BASIC:Object.freeze({vertexFormat:Ie.POSITION_AND_NORMAL,vertexShaderSource:u1,fragmentShaderSource:l1}),TEXTURED:Object.freeze({vertexFormat:Ie.POSITION_NORMAL_AND_ST,vertexShaderSource:d1,fragmentShaderSource:f1}),ALL:Object.freeze({vertexFormat:Ie.ALL,vertexShaderSource:c1,fragmentShaderSource:a1})};var ao=Ix;var M1=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec4 v_color; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - vec4 color = czm_gammaCorrect(v_color); - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -} -`;var L1=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec4 color; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec4 v_color; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_color = color; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var Px=`in vec4 v_color; - -void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -} -`;var N1=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 color; -in float batchId; - -out vec4 v_color; - -void main() -{ - vec4 p = czm_computePosition(); - - v_color = color; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function Lp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?N1:L1,r=i?Px:M1,s=i?Lp.FLAT_VERTEX_FORMAT:Lp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Lp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Lp.VERTEX_FORMAT=Ie.POSITION_AND_NORMAL;Lp.FLAT_VERTEX_FORMAT=Ie.POSITION_ONLY;Lp.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Lp.prototype.isTranslucent=io.prototype.isTranslucent;Lp.prototype.getRenderState=io.prototype.getRenderState;var cn=Lp;function _A(e){this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(_A.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});_A.prototype.getType=function(e){return"Color"};var sOe=new Z;_A.prototype.getValue=function(e,t){return l(e)||(e=Z.now(sOe)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,H.WHITE,t.color),t};_A.prototype.equals=function(e){return this===e||e instanceof _A&&Y.equals(this._color,e._color)};var zt=_A;function Zg(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ee.default),this._rectangle=y(e.rectangle,se.MAX_VALUE),this._projection=new Di(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(Zg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Zg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Zg.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Zg.prototype.rectangleToNativeRectangle=function(e,t){let n=P.toDegrees(e.west),i=P.toDegrees(e.south),o=P.toDegrees(e.east),r=P.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new se(n,i,o,r)};Zg.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=P.toDegrees(o.west),o.south=P.toDegrees(o.south),o.east=P.toDegrees(o.east),o.north=P.toDegrees(o.north),o};Zg.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,u=(e+1)*a+o.west,f=o.height/s,d=o.north-t*f,p=o.north-(t+1)*f;return l(i)||(i=new se(c,p,u,d)),i.west=c,i.south=p,i.east=u,i.north=d,i};Zg.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!se.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=P.TWO_PI);let u=(c-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new z(u,f)};var Xi=Zg;var Bne=new h,kne=new h,Vne=new fe,r9=new h,aOe=new h,Une=new ae,cOe=new Xi,F1=[new fe,new fe,new fe,new fe],B1=new z,Qr={};Qr.initialize=function(){let e=Qr._initPromise;return l(e)||(e=Se.fetchJson(nn("Assets/approximateTerrainHeights.json")).then(function(t){Qr._terrainHeights=t}),Qr._initPromise=e),e};Qr.getMinimumMaximumHeights=function(e,t){t=y(t,ee.default);let n=zne(e),i=Qr._defaultMinTerrainHeight,o=Qr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Qr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(se.northeast(e,Vne),Bne),t.cartographicToCartesian(se.southwest(e,Vne),kne),h.midpoint(kne,Bne,r9);let a=t.scaleToGeodeticSurface(r9,aOe);if(l(a)){let c=h.distance(r9,a);i=Math.min(i,-c)}else i=Qr._defaultMinTerrainHeight}return i=Math.max(Qr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Qr.getBoundingSphere=function(e,t){t=y(t,ee.default);let n=zne(e),i=Qr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Qr._terrainHeights[r];l(s)&&(i=s[1])}let o=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,Une),ae.union(o,Une,o)};function zne(e){fe.fromRadians(e.east,e.north,0,F1[0]),fe.fromRadians(e.west,e.north,0,F1[1]),fe.fromRadians(e.east,e.south,0,F1[2]),fe.fromRadians(e.west,e.south,0,F1[3]);let t=0,n=0,i=0,o=0,r=Qr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let u=F1[c];if(cOe.positionToTileXY(u,s,B1),c===0)i=B1.x,o=B1.y;else if(i!==B1.x||o!==B1.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Qr._terrainHeightsMaxLevel=6;Qr._defaultMaxTerrainHeight=9e3;Qr._defaultMinTerrainHeight=-1e5;Qr._terrainHeights=void 0;Qr._initPromise=void 0;Object.defineProperties(Qr,{initialized:{get:function(){return l(Qr._terrainHeights)}}});var li=Qr;function Gc(e,t,n){this.minimum=h.clone(y(e,h.ZERO)),this.maximum=h.clone(y(t,h.ZERO)),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Gc.fromCorners=function(e,t,n){return l(n)||(n=new Gc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Gc.fromPoints=function(e,t){if(l(t)||(t=new Gc),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,x=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(m,i),s=Math.max(m,s),o=Math.min(x,o),a=Math.max(x,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};Gc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new Gc(e.minimum,e.maximum,e.center)};Gc.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var lU=new h;Gc.intersectPlane=function(e,t){lU=h.subtract(e.maximum,e.minimum,lU);let n=h.multiplyByScalar(lU,.5,lU),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=h.dot(e.center,i)+t.distance;return r-o>0?jt.INSIDE:r+o<0?jt.OUTSIDE:jt.INTERSECTING};Gc.prototype.clone=function(e){return Gc.clone(this,e)};Gc.prototype.intersectPlane=function(e){return Gc.intersectPlane(this,e)};Gc.prototype.equals=function(e){return Gc.equals(this,e)};var $g=Gc;var s9=new oe;function hm(e,t){t=y(t,ee.default),e=t.scaleToGeodeticSurface(e);let n=Mt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(F.getColumn(n,0,s9)),this._yAxis=h.fromCartesian4(F.getColumn(n,1,s9));let i=h.fromCartesian4(F.getColumn(n,2,s9));this._plane=an.fromPointNormal(e,i)}Object.defineProperties(hm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var lOe=new $g;hm.fromPoints=function(e,t){let n=$g.fromPoints(e,lOe);return new hm(n.center,t)};var Hne=new mn,uU=new h;hm.prototype.projectPointOntoPlane=function(e,t){let n=Hne;n.origin=e,h.normalize(e,n.direction);let i=$n.rayPlane(n,this._plane,uU);if(l(i)||(h.negate(n.direction,n.direction),i=$n.rayPlane(n,this._plane,uU)),l(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new z(r,s)}};hm.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);l(r)&&(t[n]=r,n++)}return t.length=n,t};hm.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new z);let n=Hne;n.origin=e,h.clone(this._plane.normal,n.direction);let i=$n.rayPlane(n,this._plane,uU);l(i)||(h.negate(n.direction,n.direction),i=$n.rayPlane(n,this._plane,uU));let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return t.x=r,t.y=s,t};hm.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var uOe=new h;hm.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=uOe;return h.multiplyByScalar(o,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(r,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};hm.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Jr=hm;function Vi(e,t){this.center=h.clone(y(e,h.ZERO)),this.halfAxes=$.clone(y(t,$.ZERO))}Vi.packedLength=h.packedLength+$.packedLength;Vi.pack=function(e,t,n){return n=y(n,0),h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};Vi.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Vi),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var fOe=new h,dOe=new h,hOe=new h,mOe=new h,pOe=new h,_Oe=new h,gOe=new $,yOe={unitary:new $,diagonal:new $};Vi.fromPoints=function(e,t){if(l(t)||(t=new Vi),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,o=h.clone(e[0],fOe);for(n=1;n<i;n++)h.add(o,e[n],o);let r=1/i;h.multiplyByScalar(o,r,o);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],o,dOe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=r,a*=r,c*=r,u*=r,f*=r,d*=r;let g=gOe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=$.computeEigenDecomposition(g,yOe),x=$.clone(m.unitary,t.halfAxes),b=$.getColumn(x,0,mOe),T=$.getColumn(x,1,pOe),C=$.getColumn(x,2,_Oe),A=-Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE,D=Number.MAX_VALUE,O=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],A=Math.max(h.dot(b,p),A),E=Math.max(h.dot(T,p),E),v=Math.max(h.dot(C,p),v),D=Math.min(h.dot(b,p),D),O=Math.min(h.dot(T,p),O),R=Math.min(h.dot(C,p),R);b=h.multiplyByScalar(b,.5*(D+A),b),T=h.multiplyByScalar(T,.5*(O+E),T),C=h.multiplyByScalar(C,.5*(R+v),C);let M=h.add(b,T,t.center);h.add(M,C,M);let N=hOe;return N.x=A-D,N.y=E-O,N.z=v-R,h.multiplyByScalar(N,.5,N),$.multiplyByScale(t.halfAxes,N,t.halfAxes),t};var Xne=new h,xOe=new h;function Gne(e,t,n,i,o,r,s,a,c,u,f){l(f)||(f=new Vi);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=Xne;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=xOe;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(d,p,p),h.add(e,p,m),$.multiplyByScale(d,g,d),f}var Wne=new fe,bOe=new h,TOe=new fe,COe=new fe,AOe=new fe,EOe=new fe,SOe=new fe,vOe=new h,jne=new h,wOe=new h,qne=new h,DOe=new h,IOe=new z,POe=new z,ROe=new z,OOe=new z,MOe=new z,LOe=new h,NOe=new h,FOe=new h,BOe=new h,kOe=new z,VOe=new h,UOe=new h,zOe=new h,HOe=new an(h.UNIT_X,0);Vi.fromRectangle=function(e,t,n,i,o){t=y(t,0),n=y(n,0),i=y(i,ee.default);let r,s,a,c,u,f,d;if(e.width<=P.PI){let O=se.center(e,Wne),R=i.cartographicToCartesian(O,bOe),M=new Jr(R,i);d=M.plane;let N=O.longitude,_=e.south<0&&e.north>0?0:O.latitude,S=fe.fromRadians(N,e.north,n,TOe),w=fe.fromRadians(e.west,e.north,n,COe),I=fe.fromRadians(e.west,_,n,AOe),L=fe.fromRadians(e.west,e.south,n,EOe),B=fe.fromRadians(N,e.south,n,SOe),U=i.cartographicToCartesian(S,vOe),V=i.cartographicToCartesian(w,jne),G=i.cartographicToCartesian(I,wOe),k=i.cartographicToCartesian(L,qne),W=i.cartographicToCartesian(B,DOe),j=M.projectPointToNearestOnPlane(U,IOe),J=M.projectPointToNearestOnPlane(V,POe),q=M.projectPointToNearestOnPlane(G,ROe),K=M.projectPointToNearestOnPlane(k,OOe),Q=M.projectPointToNearestOnPlane(W,MOe);return r=Math.min(J.x,q.x,K.x),s=-r,c=Math.max(J.y,j.y),a=Math.min(K.y,Q.y),w.height=L.height=t,V=i.cartographicToCartesian(w,jne),k=i.cartographicToCartesian(L,qne),u=Math.min(an.getPointDistance(d,V),an.getPointDistance(d,k)),f=n,Gne(M.origin,M.xAxis,M.yAxis,M.zAxis,r,s,a,c,u,f,o)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,x=se.center(e,Wne).longitude,b=h.fromRadians(x,m,n,i,LOe);b.z=0;let C=Math.abs(b.x)<P.EPSILON10&&Math.abs(b.y)<P.EPSILON10?h.UNIT_X:h.normalize(b,NOe),A=h.UNIT_Z,E=h.cross(C,A,FOe);d=an.fromPointNormal(b,C,HOe);let v=h.fromRadians(x+P.PI_OVER_TWO,m,n,i,BOe);s=h.dot(an.projectPointOntoPlane(d,v,kOe),E),r=-s,c=h.fromRadians(0,e.north,g?t:n,i,VOe).z,a=h.fromRadians(0,e.south,p?t:n,i,UOe).z;let D=h.fromRadians(e.east,m,n,i,zOe);return u=an.getPointDistance(d,D),f=0,Gne(b,E,A,C,r,s,a,c,u,f,o)};Vi.fromTransformation=function(e,t){return l(t)||(t=new Vi),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Vi.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new Vi(e.center,e.halfAxes)};Vi.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[$.COLUMN0ROW0]+s*o[$.COLUMN0ROW1]+a*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+s*o[$.COLUMN1ROW1]+a*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+s*o[$.COLUMN2ROW1]+a*o[$.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?jt.OUTSIDE:u>=c?jt.INSIDE:jt.INTERSECTING};var Kne=new h,Zne=new h,$ne=new h,GOe=new h,Yne=new h,WOe=new h;Vi.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Xne),i=e.halfAxes,o=$.getColumn(i,0,Kne),r=$.getColumn(i,1,Zne),s=$.getColumn(i,2,$ne),a=h.magnitude(o),c=h.magnitude(r),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(o,a,o):f=!1,c>0?h.divideByScalar(r,c,r):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,m,x,b;if(g===1){let E=o;m=r,x=s,d?p||(E=s,x=o):(E=r,m=o),b=h.cross(m,x,Yne),E===o?o=b:E===r?r=b:E===s&&(s=b)}else if(g===2){m=o,d?m=r:p&&(m=s);let E=h.UNIT_Y;E.equalsEpsilon(m,P.EPSILON3)&&(E=h.UNIT_X),x=h.cross(m,E,GOe),h.normalize(x,x),b=h.cross(m,x,Yne),h.normalize(b,b),m===o?(r=x,s=b):m===r?(s=x,o=b):m===s&&(o=x,r=b)}else g===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let T=WOe;T.x=h.dot(n,o),T.y=h.dot(n,r),T.z=h.dot(n,s);let C=0,A;return T.x<-a?(A=T.x+a,C+=A*A):T.x>a&&(A=T.x-a,C+=A*A),T.y<-c?(A=T.y+c,C+=A*A):T.y>c&&(A=T.y-c,C+=A*A),T.z<-u?(A=T.z+u,C+=A*A):T.z>u&&(A=T.z-u,C+=A*A),C};var jOe=new h,qOe=new h;Vi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Da);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,Kne),u=$.getColumn(a,1,Zne),f=$.getColumn(a,2,$ne),d=h.add(c,u,jOe);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,qOe),g=h.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var YOe=new h,XOe=new h,KOe=new h;Vi.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,YOe),r=$.getColumn(i,1,XOe),s=$.getColumn(i,2,KOe);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],o,t[1]),h.subtract(t[1],r,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],o,t[2]),h.add(t[2],r,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],o,t[3]),h.add(t[3],r,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],o,t[4]),h.subtract(t[4],r,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],o,t[5]),h.subtract(t[5],r,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],o,t[6]),h.add(t[6],r,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],o,t[7]),h.add(t[7],r,t[7]),h.add(t[7],s,t[7]),t};var ZOe=new $;Vi.computeTransformation=function(e,t){l(t)||(t=new F);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,ZOe);return F.fromRotationTranslation(i,n,t)};var $Oe=new ae;Vi.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,$Oe);return!t.isBoundingSphereVisible(n)};Vi.prototype.intersectPlane=function(e){return Vi.intersectPlane(this,e)};Vi.prototype.distanceSquaredTo=function(e){return Vi.distanceSquaredTo(this,e)};Vi.prototype.computePlaneDistances=function(e,t,n){return Vi.computePlaneDistances(this,e,t,n)};Vi.prototype.computeCorners=function(e){return Vi.computeCorners(this,e)};Vi.prototype.computeTransformation=function(e){return Vi.computeTransformation(this,e)};Vi.prototype.isOccluded=function(e){return Vi.isOccluded(this,e)};Vi.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Vi.prototype.clone=function(e){return Vi.clone(this,e)};Vi.prototype.equals=function(e){return Vi.equals(this,e)};var vn=Vi;var fU={};fU.getHeight=function(e,t,n){return(e-n)*t+n};var QOe=new fe;fU.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,QOe);if(!l(r))return h.clone(e,o);let s=fU.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var Er=fU;var Qne={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};Qne.NUMBER_OF_CLASSIFICATION_TYPES=3;var Vn=Object.freeze(Qne);var JOe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},ac=Object.freeze(JOe);function eMe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var k1=eMe;function Np(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=tMe(t),o=e.floatingPointTexture,r=i===Ke.FLOAT&&!o,s=nMe(t,r),a=iMe(s,t,r),c=Math.floor(Nt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,x=m*.5;this._textureDimensions=new z(f,d),this._textureStep=new oe(p,g,m,x),this._pixelDatatype=r?Ke.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let b=4*f*d;this._batchValues=i===Ke.FLOAT&&!r?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(Np.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function tMe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==X.UNSIGNED_BYTE){t=!0;break}return t?Ke.FLOAT:Ke.UNSIGNED_BYTE}function eie(e,t){let n=e[t].componentsPerAttribute;return n===2?z:n===3?h:n===4?oe:Number}function nMe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==X.UNSIGNED_BYTE&&t?i+=4:++i}return n}function iMe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==X.UNSIGNED_BYTE&&n?o+4:o+1}var V1=new oe;function oMe(e,t,n){let i=oe.unpack(e,t,V1),o=oe.unpackFloat(i);i=oe.unpack(e,t+4,V1);let r=oe.unpackFloat(i);i=oe.unpack(e,t+8,V1);let s=oe.unpackFloat(i);i=oe.unpack(e,t+12,V1);let a=oe.unpackFloat(i);return oe.fromElements(o,r,s,a,n)}function rMe(e,t,n){let i=oe.packFloat(e.x,V1);oe.pack(i,t,n),i=oe.packFloat(e.y,i),oe.pack(i,t,n+4),i=oe.packFloat(e.z,i),oe.pack(i,t,n+8),i=oe.packFloat(e.w,i),oe.pack(i,t,n+12)}var Jne=new oe;Np.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Ke.UNSIGNED_BYTE?a=oMe(this._batchValues,s,Jne):a=oe.unpack(this._batchValues,s,Jne);let c=eie(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var sMe=[void 0,void 0,new z,new h,new oe],aMe=new oe;Np.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=sMe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=eie(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=aMe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Ke.UNSIGNED_BYTE?rMe(c,this._batchValues,d):oe.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function cMe(e,t){let n=e._textureDimensions;e._texture=new Pt({context:t,pixelFormat:et.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:$t.NEAREST,flipY:!1})}function lMe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Np.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||cMe(this,e.context),lMe(this))};Np.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:bt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function uMe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float numberOfAttributes = float(${t}); - return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); -} -`:`uniform vec4 batchTextureStep; -uniform vec2 batchTextureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float stepY = batchTextureStep.z; - float centerY = batchTextureStep.w; - float numberOfAttributes = float(${t}); - float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); - float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}function fMe(e){return e===1?"float":`vec${e}`}function dMe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function hMe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=fMe(o),a=dMe(o),c=e._offsets[t],u=`${s} ${r}(float batchId) -{ - vec2 st = computeSt(batchId); - st.x += batchTextureStep.x * float(${c}); -`;return e._packFloats&&i.componentDatatype!==Ke.UNSIGNED_BYTE?u+=`vec4 textureValue; -textureValue.x = czm_unpackFloat(texture(batchTexture, st)); -textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); -textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); -textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); -`:u+=` vec4 textureValue = texture(batchTexture, st); -`,u+=` ${s} value = textureValue${a}; -`,e._pixelDatatype===Ke.UNSIGNED_BYTE&&i.componentDatatype===X.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; -`:e._pixelDatatype===Ke.FLOAT&&i.componentDatatype===X.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; -`),u+=` return value; -} -`,u}Np.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${uMe(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=hMe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r} -${t} -${s}`}};Np.prototype.isDestroyed=function(){return!1};Np.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Rx=Np;function Rl(e){this._ellipsoid=y(e,ee.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Rl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Rl.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};Rl.geodeticLatitudeToMercatorAngle=function(e){e>Rl.MaximumLatitude?e=Rl.MaximumLatitude:e<-Rl.MaximumLatitude&&(e=-Rl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Rl.MaximumLatitude=Rl.mercatorAngleToGeodeticLatitude(Math.PI);Rl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Rl.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};Rl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=Rl.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var Pi=Rl;function mMe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!F.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Ln.transformToWorldCoordinates(e[r]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function a9(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function pMe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?a9(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(a9(i.westHemisphereGeometry,n),a9(i.eastHemisphereGeometry,n))}}function _Me(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(mMe(t,a,o),!o)for(c=0;c<d;++c)l(t[c].geometry)&&Ln.splitLongitude(t[c]);if(pMe(t),r)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Ln.reorderForPostVertexCache(g.geometry),Ln.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Ln.reorderForPostVertexCache(g.westHemisphereGeometry),Ln.reorderForPreVertexCache(g.westHemisphereGeometry),Ln.reorderForPostVertexCache(g.eastHemisphereGeometry),Ln.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Ln.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(o)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===X.DOUBLE&&Ln.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===X.DOUBLE){let x=`${m}3D`,b=`${m}2D`;Ln.projectTo2D(u,m,x,b,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ae.fromVertices(u.attributes.position2D.values)),Ln.encodeAttribute(u,x,`${x}High`,`${x}Low`),Ln.encodeAttribute(u,b,`${b}High`,`${b}Low`)}s&&Ln.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Ln.fitToUnsignedShortIndices(u));p=g}return p}function c9(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function gMe(e,t){let n=[];return c9(e,"geometry",t,n),c9(e,"westHemisphereGeometry",t,n),c9(e,"eastHemisphereGeometry",t,n),n}var Fp={};Fp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=_Me(e),t.length>0&&(n=Ln.createAttributeLocations(t[0]),e.createPickOffsets&&(r=gMe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=ae.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ae.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function yMe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function xMe(e,t){let n=e.length;for(let i=0;i<n;++i)yMe(e[i],t)}function bMe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*ae.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}Fp.packCreateGeometryResults=function(e,t){let n=new Float64Array(bMe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ae.pack(c.boundingSphere,n,s),s+=ae.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ae.pack(c.boundingSphereCV,n,s),s+=ae.packedLength;let p=c.attributes,g=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(g.push(x),l(o[x])||(o[x]=i.length,i.push(x)));n[s++]=g.length;for(let x=0;x<g.length;x++){let b=g[x],T=p[b];n[s++]=o[b],n[s++]=T.componentDatatype,n[s++]=T.componentsPerAttribute,n[s++]=T.normalize?1:0,n[s++]=T.values.length,n.set(T.values,s),s+=T.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};Fp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ae.unpack(n,s)),s+=ae.packedLength,n[s++]===1&&(p=ae.unpack(n,s)),s+=ae.packedLength;let x,b,T,C=new fn,A=n[s++];for(i=0;i<A;i++){let v=t[n[s++]],D=n[s++];T=n[s++];let O=n[s++]!==0;x=n[s++],b=X.createTypedArray(D,x);for(let R=0;R<x;R++)b[R]=n[s++];C[v]=new ve({componentDatatype:D,componentsPerAttribute:T,normalize:O,values:b})}let E;if(x=n[s++],x>0){let v=b.length/T;for(E=Ne.createTypedArray(v,x),i=0;i<x;i++)E[i]=n[s++]}o[r++]=new at({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:E,attributes:C,offsetAttribute:f})}return o};function TMe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(F.pack(s.modelMatrix,i,o),o+=F.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function CMe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=F.unpack(t,o),s;o+=F.packedLength,l(t[o])&&(s={offset:new Ji(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}Fp.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:TMe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Di,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Fp.unpackCombineGeometryParameters=function(e){let t=CMe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=Fp.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[o];p.geometry=d,++o}}let r=ee.clone(e.ellipsoid),s=e.isGeographic?new Di(r):new Pi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function tie(e){let t=e.length,n=1+(ae.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,ae.pack(e[r],i,o)):i[o++]=0,o+=ae.packedLength}return i}function nie(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ae.unpack(e,i)),++n,i+=ae.packedLength;return t}Fp.packCombineGeometryResults=function(e,t){l(e.geometries)&&xMe(e.geometries,t);let n=tie(e.boundingSpheres),i=tie(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};Fp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:nie(e.boundingSpheres),boundingSpheresCV:nie(e.boundingSpheresCV)}};var Ox=Fp;var AMe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Sr=Object.freeze(AMe);var yu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};yu.NUMBER_OF_SHADOW_MODES=4;yu.castShadows=function(e){return e===yu.ENABLED||e===yu.CAST_ONLY};yu.receiveShadows=function(e){return e===yu.ENABLED||e===yu.RECEIVE_ONLY};yu.fromCastReceive=function(e,t){return e&&t?yu.ENABLED:e?yu.CAST_ONLY:t?yu.RECEIVE_ONLY:yu.DISABLED};var yn=Object.freeze(yu);function vr(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,yn.DISABLED),this._translucent=void 0,this._state=Sr.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(vr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function EMe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var SMe=new z,vMe=new h,fie=new oe;function die(e){let t=e.length;if(t===1)return e[0];if(t===2)return z.unpack(e,0,SMe);if(t===3)return h.unpack(e,0,vMe);if(t===4)return oe.unpack(e,0,fie)}function wMe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=EMe(i),s=r.length,a=[],c={},u={},f,p=i[0].attributes,g,m,x;for(g=0;g<s;++g)m=r[g],x=p[m],c[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:X.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:X.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let b=a.length,T=new Rx(t,a,o);for(g=0;g<o;++g){let C=i[g];p=C.attributes;for(let O=0;O<s;++O){m=r[O],x=p[m];let R=die(x.value),M=c[m];T.setBatchedAttribute(g,M,R)}let A={primitive:y(C.pickPrimitive,e)};l(C.id)&&(A.id=C.id);let E=t.createPickId(A);e._pickIds.push(E);let v=E.color,D=fie;D.x=H.floatToByte(v.red),D.y=H.floatToByte(v.green),D.z=H.floatToByte(v.blue),D.w=H.floatToByte(v.alpha),T.setBatchedAttribute(g,b-1,D)}e._batchTable=T,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function DMe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new ve({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function IMe(e){let t=e.attributes,n=new fn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=DMe(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new at({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ae.clone(e.boundingSphere)})}function PMe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var RMe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;vr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=RMe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c}; -`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView; -`,r+=`in vec4 position; -`,s+=`${c} -{ - return u_modifiedModelView * position; -} - -`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} -{ - return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); -} - -`:(r+=`in vec3 ${a}2DHigh; -in vec3 ${a}2DLow; -`,s+=`${c} -{ - vec4 p; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), - czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), - czm_morphTime); - } - return p; -} - -`)}return[o,r,t,s].join(` -`)};vr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Ue.replaceMain(t,"czm_non_show_main")} -void main() -{ - czm_non_show_main(); - gl_Position *= czm_batchTable_show(batchId); -}`:t};vr._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function iie(e){return`${Ue.replaceMain(e,"czm_non_pick_main")} -out vec4 v_pickColor; -void main() -{ - czm_non_pick_main(); - v_pickColor = czm_batchTable_pickColor(batchId); -}`}function oie(e){return`in vec4 v_pickColor; -${e}`}vr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};vr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; -`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition(); -`;return o+=` if (czm_sceneMode == czm_sceneMode3D) -`,o+=` { -`,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` } -`,o+=` else -`,o+=` { -`,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` } -`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};vr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Ue.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() -{ - czm_non_distanceDisplayCondition_main(); - vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); - vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); - vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); - float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); -`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); -`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); - vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); - vec4 centerRTE; - if (czm_morphTime == 1.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); - } - else if (czm_morphTime == 0.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); - } - else - { - centerRTE = czm_columbusViewMorph( - czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), - czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), - czm_morphTime); - } -`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; - float distanceSq; - if (czm_sceneMode == czm_sceneMode2D) - { - distanceSq = czm_eyeHeight2D.y - radiusSq; - } - else - { - distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; - } - distanceSq = max(distanceSq, 0.0); - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${o}`};function rie(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; -`;let m=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${m}); -`}n&&o&&r?(f+=`vec3 normal; -vec3 tangent; -vec3 bitangent; -`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(f+=`vec3 normal; -`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); -`),o&&(f+=`vec3 tangent; -`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`),r&&(f+=`vec3 bitangent; -`,d+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=Ue.replaceMain(p,"czm_non_compressed_main");let g=`void main() -{ -${d} czm_non_compressed_main(); -}`;return[u,f,p,g].join(` -`)}function OMe(e){let t=Ue.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - gl_Position = czm_depthClamp(gl_Position);} -`,t}function MMe(e){let t=Ue.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - #if defined(LOG_DEPTH) - czm_writeLogDepth(); - #else - czm_writeDepthClamp(); - #endif -} -`,t}function sie(e,t){let n=e.vertexAttributes}function LMe(e,t){return function(){return e[t]}}var l9=Math.max(Ht.hardwareConcurrency-1,1),dU,NMe=new _i("combineGeometry");function FMe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Sr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(dU))for(dU=new Array(l9),o=0;o<l9;o++)dU[o]=new _i("createGeometry");let f;for(u=k1(u,l9),o=0;o<u.length;o++){let d=0,p=u[o],g=p.length;for(r=0;r<g;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=y(i.constructor.packedLength,i.packedLength));let m;if(d>0){let x=new Float64Array(d);for(m=[x.buffer],r=0;r<g;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,f.offset),f.geometry=x)}c.push(dU[o].scheduleTask({subTasks:u[o]},m))}e._state=Sr.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=Sr.CREATED}).catch(function(d){z1(e,t,Sr.FAILED,d)})}else if(e._state===Sr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=NMe.scheduleTask(Ox.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Sr.COMBINING,Promise.resolve(f).then(function(d){let p=Ox.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Sr.COMBINED):z1(e,t,Sr.FAILED,void 0)}).catch(function(d){z1(e,t,Sr.FAILED,d)})}}function BMe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=IMe(p):g=p.constructor.createGeometry(p),o[c++]=PMe(s,g),r.push(s.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=Ox.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=F.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Sr.COMBINED):z1(e,t,Sr.FAILED,void 0)}function kMe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ae;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],b=e._batchTable.getBatchedAttribute(i,n,new h);x=r[i].clone(x),_ie(x,b,o[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||ae.intersectPlane(x,an.ORIGIN_ZX_PLANE)!==jt.INTERSECTING?c.push(x):(u.push(x),f.push(x))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ae.union(d,c[i]);for(i=1;i<f.length;i++)p=ae.union(p,f[i]);for(i=1;i<u.length;i++)g=ae.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let x=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=ae.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}vr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var aie=new Gn,hie=new fe,mie=new h,pie=new ae;function VMe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let x=p[m];if(!l(x))continue;let b=e.modelMatrix;l(b)&&(x=ae.transform(x,b,pie));let T=x.center,C=x.radius,A=Gn.fromCartesian(T,aie);if(d.setBatchedAttribute(m,o,A.high),d.setBatchedAttribute(m,r,A.low),!t.scene3DOnly){let E=f.cartesianToCartographic(T,hie),v=u.project(E,mie);A=Gn.fromCartesian(v,aie),d.setBatchedAttribute(m,s,A.high),d.setBatchedAttribute(m,a,A.low)}d.setBatchedAttribute(m,c,C)}e._batchTableBoundingSpheresUpdated=!0}var u9=new h,UMe=new h;function cie(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ae.transform(f,p,pie));let g=f.center;g=r.scaleToGeodeticSurface(g,UMe);let m=r.cartesianToCartographic(g,hie),x=o.project(m,mie),b=h.add(d,g,u9);m=r.cartesianToCartographic(b,m);let T=o.project(m,u9),C=h.subtract(T,x,u9),A=C.x;C.x=C.z,C.z=C.y,C.y=A,s.setBatchedAttribute(u,i,C)}e._batchTableOffsetsUpdated=!0}function zMe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(ei.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Fe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ae.clone(u.boundingSphere)),e._boundingSphereWC.push(new ae),!o){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ae.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ae),e._boundingSphereMorph.push(new ae)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,z1(e,t,Sr.COMPLETE,void 0)}function HMe(e,t,n,i){let o=n.getRenderState(),r;i?(r=Ge(o,!1),r.cull={enabled:!0,face:yi.BACK},e._frontFaceRS=Ve.fromCache(r),r.cull.face=yi.FRONT,e._backFaceRS=Ve.fromCache(r)):(e._frontFaceRS=Ve.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Ge(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Ge(o,!1),r.depthTest.func=ac.GREATER,i?(r.cull={enabled:!0,face:yi.BACK},e._frontFaceDepthFailRS=Ve.fromCache(r),r.cull.face=yi.FRONT,e._backFaceDepthFailRS=Ve.fromCache(r)):(e._frontFaceDepthFailRS=Ve.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function GMe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=vr._appendOffsetToShader(e,r),r=vr._appendShowToShader(e,r),r=vr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=iie(r),r=vr._updateColorAttribute(e,r,!1),r=rie(e,r),r=vr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=oie(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),sie(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=vr._appendShowToShader(e,r),r=vr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=iie(r),r=vr._updateColorAttribute(e,r,!0),r=rie(e,r),r=vr._modifyShaderPosition(e,r,t.scene3DOnly),r=OMe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=oie(s),s=MMe(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),sie(e._spDepthFail,o))}var U1=new F,lie=new h;function uie(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=LMe(s,c));let a=bt(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return F.multiply(c,e._modelMatrix,U1),F.multiplyByPoint(U1,e.rtcCenter,lie),F.setTranslation(U1,lie,U1),U1}),a}function WMe(e,t,n,i,o,r,s,a){let c=uie(e,t,n,a),u;l(e._depthFailAppearance)&&(u=uie(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?we.TRANSLUCENT:we.OPAQUE,d=o?2:1;d*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*d;let p=r.length,g=0;for(let m=0;m<p;++m){let x;o&&(x=r[m],l(x)||(x=r[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,++m),x=r[m],l(x)||(x=r[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,l(e._depthFailAppearance)&&(o&&(++m,x=r[m],l(x)||(x=r[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++m,x=r[m],l(x)||(x=r[m]=new Ze({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++g}}vr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!F.equals(n,e._modelMatrix))for(F.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=ae.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ae.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=ae.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function jMe(e,t,n,i,o,r,s,a){vr._updateBoundingVolumes(e,t,o);let c;t.mode===ne.SCENE3D?c=e._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ne.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=yn.castShadows(e.shadows),g=yn.receiveShadows(e.shadows),m=n.length,x=a?2:1;x*=l(e._depthFailAppearance)?2:1;for(let b=0;b<m;++b){let T=Math.floor(b/x),C=n[b];C.modelMatrix=o,C.boundingVolume=c[T],C.cull=r,C.debugShowBoundingVolume=s,C.castShadows=p,C.receiveShadows=g,d?C.pickId="v_pickColor":C.pickId=void 0,u.push(C)}}}vr.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==ne.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Sr.FAILED)return;let t=e.context;if(l(this._batchTable)||wMe(this,t),this._batchTable.attributes.length>0){if(Nt.maximumVertexTextureImageUnits===0)throw new re("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Sr.COMPLETE&&this._state!==Sr.COMBINED&&(this.asynchronous?FMe(this,e):BMe(this,e)),this._state===Sr.COMBINED&&(VMe(this,e),cie(this,e),zMe(this,e)),!this.show||this._state!==Sr.COMPLETE)return;this._batchTableOffsetsUpdated||cie(this,e),this._recomputeBoundingSpheres&&kMe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&y(this._createRenderStatesFunction,HMe)(this,t,n,u),r&&y(this._createShaderProgramFunction,GMe)(this,e,n),(o||r)&&y(this._createCommandsFunction,WMe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,jMe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var qMe=new ae,YMe=new ae;function _ie(e,t,n){if(n===sn.TOP){let i=ae.clone(e,qMe),o=ae.clone(e,YMe);o.center=h.add(o.center,t,o.center),e=ae.union(i,o,e)}else n===sn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function XMe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=X.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function KMe(e,t,n,i,o){return function(r){let s=die(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var ZMe=new h;function $Me(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&_ie(i,h.fromArray(r.get(),0,ZMe),e._offsetInstanceExtend[n]),l(o)&&(i=ae.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function QMe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}vr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:XMe(s,n,f),set:KMe(s,n,f,this,u)}}return $Me(this,c,n),QMe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};vr.prototype.isDestroyed=function(){return!1};vr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function z1(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Sr.COMPLETE||e._state===Sr.FAILED})}var Dn=vr;function JMe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var cc=JMe;function Df(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new f9;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new f9;if(o.requiresTextureCoordinates=e,n instanceof cn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource} -${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Df.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof cn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof cn||(o=t.material.shaderSource),new Ue({defines:i,sources:[o,lA]})};Df.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Ue({defines:n,sources:[lA],pickColorQualifier:"in"})};Df.prototype.createVertexShader=function(e,t,n,i){return Eie(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Df.prototype.createPickVertexShader=function(e,t,n,i){return Eie(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var gie=new h,yie=new fe,xie={high:0,low:0};function Eie(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=yie;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,gie),d=Gn.encode(f.x,xie);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=yie;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,gie);d=Gn.encode(g.x,xie),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof cn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ue({defines:c,sources:[o]})}function f9(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(f9.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function bie(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/z.distance(t,e)}var eLe=[new z,new z,new z,new z];function Sie(e,t){let n=eLe,i=z.unpack(t,0,n[0]),o=z.unpack(t,2,n[1]),r=z.unpack(t,4,n[2]);e.uMaxVmax=new cc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/bie(i,o,r),a=1/bie(i,r,o);e.uvMinAndExtents=new cc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var vie=new fe,wie=new h,tLe=new h,nLe=new h,hU={high:0,low:0};function Die(e,t,n){let i=vie;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,wie);i.latitude=e.north;let r=t.project(i,tLe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,nLe),a=[0,0,0,0],c=[0,0,0,0],u=Gn.encode(o.x,hU);a[0]=u.high,c[0]=u.low,u=Gn.encode(o.y,hU),a[1]=u.high,c[1]=u.low,u=Gn.encode(r.y,hU),a[2]=u.high,c[2]=u.low,u=Gn.encode(s.x,hU),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new cc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new cc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var iLe=new F,oLe=new F,Tie=new h,rLe=new fe,sLe=[new fe,new fe,new fe,new fe,new fe,new fe,new fe,new fe];function aLe(e,t,n,i,o,r){let s=se.center(e,rLe);s.height=n;let a=fe.toCartesian(s,t,Tie),c=Mt.eastNorthUpToFixedFrame(a,t,iLe),u=F.inverse(c,oLe),f=e.west,d=e.east,p=e.north,g=e.south,m=sLe;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let x=(f+d)*.5,b=(p+g)*.5;m[4].latitude=g,m[4].longitude=x,m[5].latitude=p,m[5].longitude=x,m[6].latitude=b,m[6].longitude=f,m[7].latitude=b,m[7].longitude=d;let T=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let M=fe.toCartesian(m[R],t,Tie);F.multiplyByPoint(u,M,M),M.z=0,T=Math.min(T,M.x),C=Math.max(C,M.x),A=Math.min(A,M.y),E=Math.max(E,M.y)}let v=i;v.x=T,v.y=A,v.z=0,F.multiplyByPoint(c,v,v);let D=o;D.x=C,D.y=A,D.z=0,F.multiplyByPoint(c,D,D),h.subtract(D,v,o);let O=r;O.x=T,O.y=E,O.z=0,F.multiplyByPoint(c,O,O),h.subtract(O,v,r)}var cLe=new h,lLe=new h,uLe=new Gn;Df.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=wie,s=cLe,a=lLe;aLe(e,n,y(o,0),r,s,a);let c={};Sie(c,t);let u=Gn.fromCartesian(r,uLe);return c.southWest_HIGH=new cc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new cc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new cc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new cc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Die(e,i,c),c};var fLe=new h;function Cie(e,t,n,i){let o=vie;o.latitude=e,o.longitude=t,o.height=0;let r=fe.toCartesian(o,n,fLe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=P.fastApproximateAtan2(s,r.z),c=P.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var Aie=new z;Df.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=Cie(e.south,e.west,n,Aie),r=o.x,s=o.y,a=Cie(e.north,e.east,n,Aie),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),r-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-r),g={sphericalExtents:new cc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,d]}),longitudeRotation:new cc({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Sie(g,t),Die(e,i,g),g};Df.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Df.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function dLe(e){return Math.max(e.width,e.height)>Df.MAX_WIDTH_FOR_PLANAR_EXTENTS}Df.shouldUseSphericalCoordinates=function(e){return dLe(e)};Df.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var xu=Df;var hLe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Un=Object.freeze(hLe);var mLe={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},dt=Object.freeze(mLe);var mU={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};mU.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Un.ALWAYS,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.REPLACE},backFunction:Un.ALWAYS,backOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.REPLACE},reference:mU.CESIUM_3D_TILE_MASK,mask:mU.CESIUM_3D_TILE_MASK}};var Ut=Object.freeze(mU);function Mx(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Vn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Mx.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Mx.isSupported=function(e){return e.context.stencilBuffer};function gA(e,t){let n=t?Un.EQUAL:Un.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:dt.KEEP,zFail:dt.DECREMENT_WRAP,zPass:dt.KEEP},backFunction:n,backOperation:{fail:dt.KEEP,zFail:dt.INCREMENT_WRAP,zPass:dt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ac.LESS_OR_EQUAL},depthMask:!1}}function h9(e){return{stencilTest:{enabled:e,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var pLe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function _Le(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(gA(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(gA(o,!0)),e._rsColorPass=Ve.fromCache(h9(o,!1)),e._rsPickPass=Ve.fromCache(pLe)}function gLe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; -`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Ue.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${r} czm_non_compressed_main(); -}`;return[i,o,s,a].join(` -`)}}function yLe(e,t){let n=t.context,i=e._primitive,o=jP;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Dn._appendDistanceDisplayConditionToShader(i,o),o=Dn._modifyShaderPosition(e,o,t.scene3DOnly),o=Dn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=gLe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ue({defines:[a],sources:[o]}),u=new Ue({sources:[Yg]}),f=e._primitive._attributeLocations,d=new xu(s,r,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Ue.createPickVertexShaderSource(o);m=Dn._appendShowToShader(i,m),m=Dn._updatePickColorAttribute(m);let x=d.createPickFragmentShader(!1),b=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f}),s){let T=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(T)){let C=d.createPickFragmentShader(!0),A=d.createPickVertexShader([a],m,!0,t.mapProjection);T=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:A,fragmentShaderSource:C,attributeLocations:f})}e._spPick2D=T}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=Dn._appendShowToShader(i,o),c=new Ue({defines:[a],sources:[o]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let x=d.createFragmentShader(!0),b=d.createVertexShader([a],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f})}e._spColor2D=m}}function xLe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],l(r)||(r=t[o]=new Ze({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=we.TERRAIN_CLASSIFICATION,s=Ze.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=we.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new Ze({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=we.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=bt(c,x._uniforms)),r.uniformMap=c,s=Ze.shallowClone(r,r.derivedCommands.tileset),s.pass=we.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let b=Ze.shallowClone(r,r.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=b,b=Ze.shallowClone(s,s.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=Ze.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function bLe(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<o;c+=2){let m=i._va[d++];if(n&&(a=r[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new Ze({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=we.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Ze.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=we.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new Ze({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=we.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Ze.shallowClone(u,u.derivedCommands.tileset),f.pass=we.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let x=Ze.shallowClone(u,u.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x,x=Ze.shallowClone(f,f.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=x}}}function TLe(e,t,n,i,o,r,s){xLe(e,r),bLe(e,s)}function Iie(e,t){return Math.floor(e%t/2)}function d9(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Pie(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function CLe(e,t,n,i,o,r,s,a){let c=e._primitive;Dn._updateBoundingVolumes(c,t,o);let u;t.mode===ne.SCENE3D?u=c._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===ne.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==Vn.CESIUM_3D_TILE,p=f!==Vn.TERRAIN,g=t.passes,m,x,b;if(g.render){let T=n.length;for(m=0;m<T;++m)x=u[Iie(m,T)],d&&(b=n[m],d9(b,t,o,r,x,s)),p&&(b=n[m].derivedCommands.tileset,d9(b,t,o,r,x,s));if(t.invertClassification){let C=e._commandsIgnoreShow,A=C.length;for(m=0;m<A;++m)x=u[m],b=C[m],d9(b,t,o,r,x,s)}}if(g.pick){let T=i.length,C=c._pickOffsets;for(m=0;m<T;++m){let A=C[Iie(m,T)];x=u[A.index],d&&(b=i[m],Pie(b,t,o,r,x)),p&&(b=i[m].derivedCommands.tileset,Pie(b,t,o,r,x))}}}Mx.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(r>0&&(c=o[0].attributes,p=xu.hasAttributesForSphericalExtents(c),g=xu.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<r;s++){a=o[s];let x=a.attributes.color;l(x)&&(u=!0),f=f&&l(x)&&Wt.equals(d,x)}if(!f&&!p&&!g)throw new he("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new cn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(r);for(s=0;s<r;++s)a=o[s],m[s]=new vt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,b){n._createBoundingVolumeFunction(x,b)}),i._createRenderStatesFunction=function(x,b,T,C){_Le(n,b)},i._createShaderProgramFunction=function(x,b,T){yLe(n,b)},i._createCommandsFunction=function(x,b,T,C,A,E,v){TLe(n,void 0,void 0,!0,!1,E,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,b,T,C,A,E,v,D){n._updateAndQueueCommandsFunction(x,b,T,C,A,E,v,D)}:i._updateAndQueueCommandsFunction=function(x,b,T,C,A,E,v,D){CLe(n,b,T,C,A,E,v,D)},this._primitive=new Dn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(gA(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(gA(!1,!0)),this._rsColorPass=Ve.fromCache(h9(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(gA(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(gA(!0,!0)),this._rsColorPass=Ve.fromCache(h9(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Mx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Mx.prototype.isDestroyed=function(){return!1};Mx.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var yA=Mx;var ALe={u_globeMinimumAltitude:function(){return 55e3}};function Ol(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(l(a)&&l(a.color)){t=new cn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Vn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=li._defaultMaxTerrainHeight,this._minTerrainHeight=li._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:ALe}}Object.defineProperties(Ol.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});Ol.isSupported=yA.isSupported;function Rie(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Oie(e){return function(t,n){return e._minHeight}}var ELe=new h,SLe=new h,vLe=new h,wLe=new fe,DLe=new se;function pU(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<r;d+=3){let p=h.unpack(i,d,ELe),g=h.unpack(o,d,SLe),m=h.add(p,g,vLe),x=n.cartesianToCartographic(m,wLe),b=x.latitude,T=x.longitude;s=Math.min(s,b),a=Math.min(a,T),c=Math.max(c,b),u=Math.max(u,T)}let f=DLe;return f.north=c,f.south=s,f.east=u,f.west=a,f}function ILe(e,t,n){let i=li.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function PLe(e,t,n){let i=t.mapProjection.ellipsoid,o=pU(t,n),r=vn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=ae.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function m9(e,t){return Math.floor(e%t/2)}function p9(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Mie(e,t,n,i,o,r){let s=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function RLe(e,t,n,i,o,r,s,a){let c;t.mode===ne.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==Vn.CESIUM_3D_TILE,d=u!==Vn.TERRAIN,p=t.passes,g=e._primitive,m,x,b;if(p.render){let T=n.length;for(m=0;m<T;++m)x=c[m9(m,T)],f&&(b=n[m],p9(e,b,t,o,r,x,s)),d&&(b=n[m].derivedCommands.tileset,p9(e,b,t,o,r,x,s));if(t.invertClassification){let C=g._commandsIgnoreShow,A=C.length;for(m=0;m<A;++m)x=c[m],b=C[m],p9(e,b,t,o,r,x,s)}}if(p.pick){let T=i.length,C;for(e._useFragmentCulling||(C=g._primitive._pickOffsets),m=0;m<T;++m){if(x=c[m9(m,T)],!e._useFragmentCulling){let A=C[m9(m,T)];x=c[A.index]}f&&(b=i[m],Mie(e,b,t,o,r,x)),d&&(b=i[m].derivedCommands.tileset,Mie(e,b,t,o,r,x))}}}Ol.initializeTerrainHeights=function(){return li.initialize()};Ol.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!li.initialized){Ol.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){o=a[f],r=o.geometry;let x=pU(e,r);l(d)?l(x)&&se.union(d,x,d):d=se.clone(x);let b=o.id;if(l(b)&&l(x)){let T=li.getBoundingSphere(x,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(T)}s=r.constructor,!l(s)||l(s.createShadowVolume)}ILe(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Er.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Er.getHeight(this._maxTerrainHeight,p,g);let m=Ol._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let x,b=!0;for(f=0;f<c;++f)if(o=a[f],r=o.geometry,d=pU(e,r),xu.shouldUseSphericalCoordinates(d)){b=!1;break}for(f=0;f<c;++f){o=a[f],r=o.geometry,s=r.constructor;let T=pU(e,r),C=r.textureCoordinateRotationPoints;b?x=xu.getPlanarTextureCoordinateAttributes(T,C,i,e.mapProjection,this._maxHeight):x=xu.getSphericalExtentGeometryInstanceAttributes(T,C,i,e.mapProjection);let A=o.attributes;for(let E in A)A.hasOwnProperty(E)&&(x[E]=A[E]);u[f]=new vt({geometry:s.createShadowVolume(r,Oie(this),Rie(this)),attributes:x,id:o.id})}}else for(f=0;f<c;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new vt({geometry:s.createShadowVolume(r,Oie(this),Rie(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,b){PLe(t,x,b)},n._updateAndQueueCommandsFunction=function(x,b,T,C,A,E,v,D){RLe(t,b,T,C,A,E,v,D)},this._primitive=new yA(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Ol.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Ol.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Ol.prototype.isDestroyed=function(){return!1};Ol.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};Ol._supportsMaterials=function(e){return e.depthTexture};Ol.supportsMaterials=function(e){return Ol._supportsMaterials(e.frameState.context)};var Wc=Ol;function xA(){he.throwInstantiationError()}Object.defineProperties(xA.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});xA.prototype.getType=he.throwInstantiationError;xA.prototype.getValue=he.throwInstantiationError;xA.prototype.equals=he.throwInstantiationError;var OLe=new Z;xA.getValue=function(e,t,n){let i;return l(e)||(e=Z.now(OLe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Yi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Yi.ColorType)&&(n=Yi.fromType(Yi.ColorType)),H.clone(H.WHITE,n.uniforms.color),n)};var er=xA;function Lx(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Lx.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!Y.getValueOrDefault(t.show,n,!0)};Lx.prototype._setOptions=he.throwInstantiationError;Lx.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof zt,d,p=t._getIsClosed(c);if(f)d=new cn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=er.getValue(e,u,this._material);this._material=g,d=new ao({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=cn.VERTEX_FORMAT,this._primitive=o.add(new Wc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),Y.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Dn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=Y.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Dn({geometryInstances:u,appearance:new cn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Lx.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ct.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ct.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ct.PENDING:ct.FAILED};Lx.prototype.isDestroyed=function(){return!1};Lx.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ti=Lx;var MLe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Bp=Object.freeze(MLe);var LLe={NONE:0,GEODESIC:1,RHUMB:2},Jt=Object.freeze(LLe);var Lie=P.EPSILON10;function NLe(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<r;++s)c=e[s],t(a,c,Lie)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),o&&i.push(s)):(l(u)&&(u.push(c),f=s,o&&(d=i.length)),a=c);return n&&t(e[0],e[r-1],Lie)&&(o&&(l(u)?i.splice(d,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Co=NLe;function FLe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,r),d=c*s,p=d*d,g=1-p,m=Math.sqrt(g),x=t/4,b=x*x,T=b*x,C=b*b,A=1+x-3*b/4+5*T/4-175*C/64,E=1-x+15*b/8-35*T/8,v=1-3*x+35*b/4,D=1-5*x,O=A*f-E*Math.sin(2*f)*x/2-v*Math.sin(4*f)*b/16-D*Math.sin(6*f)*T/48-Math.sin(8*f)*5*C/512,R=e._constants;R.a=n,R.b=i,R.f=o,R.cosineHeading=r,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=x,R.u4Over16=b,R.u6Over64=T,R.u8Over256=C,R.a0=A,R.a1=E,R.a2=v,R.a3=D,R.distanceRatio=O}function BLe(e,t){return e*t*(4+e*(4-3*t))/16}function Nie(e,t,n,i,o,r,s){let a=BLe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function kLe(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),x=d*g,b=d*m,T=p*m,C=p*g,A=c,E=P.TWO_PI,v=Math.cos(A),D=Math.sin(A),O,R,M,N,_;do{v=Math.cos(A),D=Math.sin(A);let k=b-C*v;M=Math.sqrt(g*g*D*D+k*k),R=T+x*v,O=Math.atan2(M,R);let W;M===0?(W=0,N=1):(W=x*D/M,N=1-W*W),E=A,_=R-2*T/N,isFinite(_)||(_=0),A=c+Nie(a,W,N,O,M,R,_)}while(Math.abs(A-E)>P.EPSILON12);let S=N*(t*t-n*n)/(n*n),w=1+S*(4096+S*(S*(320-175*S)-768))/16384,I=S*(256+S*(S*(74-47*S)-128))/1024,L=_*_,B=I*M*(_+I*(R*(2*L-1)-I*_*(4*M*M-3)*(4*L-3)/6)/4),U=n*w*(O-B),V=Math.atan2(g*D,b-C*v),G=Math.atan2(d*D,b*v-C);e._distance=U,e._startHeading=V,e._endHeading=G,e._uSquared=S}var VLe=new h,_9=new h;function Fie(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,_9),VLe),r=h.normalize(i.cartographicToCartesian(n,_9),_9);kLe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=fe.clone(t,e._start),e._end=fe.clone(n,e._end),e._start.height=0,e._end.height=0,FLe(e)}function H1(e,t,n){let i=y(n,ee.default);this._ellipsoid=i,this._start=new fe,this._end=new fe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Fie(this,e,t,i)}Object.defineProperties(H1.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});H1.prototype.setEndPoints=function(e,t){Fie(this,e,t,this._ellipsoid)};H1.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};H1.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,x=n.u6Over64,b=n.u4Over16,T=2*p*g*o/3+i*(1-m+7*b/4-15*x/4+579*g/64-(b-15*x/4+187*g/16)*o-(5*x/4-115*g/16)*r-29*g*s/16)+(m/2-b+71*x/32-85*g/16)*a+(5*b/16-5*x/4+383*g/96)*c-d*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*u+539*g*f/1536,C=Math.asin(Math.sin(T)*n.cosineAlpha),A=Math.atan(n.a/n.b*Math.tan(C));T=T-n.sigma;let E=Math.cos(2*n.sigma+T),v=Math.sin(T),D=Math.cos(T),O=n.cosineU*D,R=n.sineU*v,N=Math.atan2(v*n.sineHeading,O-R*n.cosineHeading)-Nie(n.f,n.sineAlpha,n.cosineSquaredAlpha,T,v,D,E);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=A,t.height=0,t):new fe(this._start.longitude+N,A,0)};var kp=H1;function y9(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),x=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*x)}function ULe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),x=Math.cos(2*i),b=Math.sin(4*i),T=Math.cos(4*i),C=Math.sin(6*i),A=Math.cos(6*i),E=Math.sin(8*i),v=Math.cos(8*i),D=Math.sin(10*i),O=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*d/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*x+(21*i*f/256+483*i*d/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*T+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*A+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*O+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*d/4096-33*o*d/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*o*d/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*b+(151*f/6144+151*d/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*C+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*E+(8011*p/2621440+8011*g/1048576)*D+293393*g/251658240*R}function bA(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function zLe(e,t,n,i,o){let r=bA(e._ellipticity,n),s=bA(e._ellipticity,o);return Math.atan2(P.negativePiToPi(i-t),s-r)}function HLe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(o)*P.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=y9(e._ellipticity,t,o);u=(y9(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var GLe=new h,g9=new h;function Bie(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,g9),GLe),r=h.normalize(i.cartographicToCartesian(n,g9),g9),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=fe.clone(t,e._start),e._start.height=0,e._end=fe.clone(n,e._end),e._end.height=0,e._heading=zLe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=HLe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function kie(e,t,n,i,o,r){if(n===0)return fe.clone(e,r);let s=o*o,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=y9(o,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=ULe(p,o,i),Math.abs(t)<P.EPSILON10)a=P.negativePiToPi(e.longitude);else{let g=bA(o,e.latitude),m=bA(o,c);u=Math.tan(t)*(m-g),a=P.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new fe(a,c,0)}function Vp(e,t,n){let i=y(n,ee.default);this._ellipsoid=i,this._start=new fe,this._end=new fe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Bie(this,e,t,i)}Object.defineProperties(Vp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});Vp.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,ee.default),s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=kie(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new Vp(e,d,r):(o.setEndPoints(e,d),o)};Vp.prototype.setEndPoints=function(e,t){Bie(this,e,t,this._ellipsoid)};Vp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Vp.prototype.interpolateUsingSurfaceDistance=function(e,t){return kie(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Vp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(r.longitude)*Math.PI),l(t)||(t=new fe),Math.abs(P.PI_OVER_TWO-o)<=P.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-o),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,r.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};Vp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let r=bA(n,o.latitude),s=bA(n,e),a=Math.tan(i)*(s-r),c=P.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new fe(c,e,0)};var Oa=Vp;var v9=[Di,Pi],WLe=v9.length,ooe=Math.cos(P.toRadians(30)),Vie=Math.cos(P.toRadians(150)),roe=0,soe=1e3;function Jg(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,Jt.GEODESIC),this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Jg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});Jg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<WLe;i++)if(t instanceof v9[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var jLe=new h,Uie=new h,zie=new h;function S9(e,t,n,i,o){let r=jc(i,e,0,jLe),s=jc(i,e,n,Uie),a=jc(i,t,0,zie),c=Up(s,r,Uie),u=Up(a,r,zie);return h.cross(u,c,o),h.normalize(o,o)}var qLe=new fe,YLe=new h,XLe=new h,KLe=new h;function x9(e,t,n,i,o,r,s,a,c,u,f){if(o===0)return;let d;r===Jt.GEODESIC?d=new kp(e,t,s):r===Jt.RHUMB&&(d=new Oa(e,t,s));let p=d.surfaceDistance;if(p<o)return;let g=S9(e,t,i,s,KLe),m=Math.ceil(p/o),x=p/m,b=x,T=m-1,C=a.length;for(let A=0;A<T;A++){let E=d.interpolateUsingSurfaceDistance(b,qLe),v=jc(s,E,n,YLe),D=jc(s,E,i,XLe);h.pack(g,a,C),h.pack(v,c,C),h.pack(D,u,C),f.push(E.latitude),f.push(E.longitude),C+=3,b+=x}}var b9=new fe;function jc(e,t,n,i){return fe.clone(t,b9),b9.height=n,fe.toCartesian(b9,e,i)}Jg.pack=function(e,t,n){let i=y(n,0),o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ee.pack(e._ellipsoid,t,i),i+=ee.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};Jg.unpack=function(e,t,n){let i=y(t,0),o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=ee.unpack(e,i);i+=ee.packedLength;let f=e[i++],d=e[i++]===1;return l(n)||(n=new Jg({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function Up(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function Hie(e,t,n,i){return i=Up(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var ZLe=new h,$Le=new h,QLe=new h,aoe=new h,JLe=0,eNe=-1;function T9(e,t,n,i,o){let r=Up(n,t,aoe),s=Hie(e,t,r,ZLe),a=Hie(i,t,r,$Le);if(P.equalsEpsilon(h.dot(s,a),eNe,P.EPSILON5))return o=h.cross(r,s,o),o=h.normalize(o,o),o;o=h.add(a,s,o),o=h.normalize(o,o);let c=h.cross(r,o,QLe);return h.dot(a,c)<JLe&&(o=h.negate(o,o)),o}var xU=an.fromPointNormal(h.ZERO,h.UNIT_Y),tNe=new h,nNe=new h,iNe=new h,oNe=new h,rNe=new h,_U=new h,gU=new fe,Gie=new fe,Wie=new fe;Jg.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new v9[e._projectionIndex](i),a=roe,c=soe,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,x,b,T=new Oa(void 0,void 0,i),C,A,E,v=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],C=$n.lineSegmentPlane(g,m,xU,_U),l(C)&&!h.equalsEpsilon(C,g,P.EPSILON7)&&!h.equalsEpsilon(C,m,P.EPSILON7)&&(e.arcType===Jt.GEODESIC?v.push(h.clone(C)):e.arcType===Jt.RHUMB&&(E=i.cartesianToCartographic(C,gU).longitude,x=i.cartesianToCartographic(g,gU),b=i.cartesianToCartographic(m,Gie),T.setEndPoints(x,b),A=T.findIntersectionWithLongitude(E,Wie),C=i.cartographicToCartesian(A,_U),l(C)&&!h.equalsEpsilon(C,g,P.EPSILON7)&&!h.equalsEpsilon(C,m,P.EPSILON7)&&v.push(h.clone(C)))),v.push(m);n&&(g=d[p-1],m=d[0],C=$n.lineSegmentPlane(g,m,xU,_U),l(C)&&!h.equalsEpsilon(C,g,P.EPSILON7)&&!h.equalsEpsilon(C,m,P.EPSILON7)&&(e.arcType===Jt.GEODESIC?v.push(h.clone(C)):e.arcType===Jt.RHUMB&&(E=i.cartesianToCartographic(C,gU).longitude,x=i.cartesianToCartographic(g,gU),b=i.cartesianToCartographic(m,Gie),T.setEndPoints(x,b),A=T.findIntersectionWithLongitude(E,Wie),C=i.cartographicToCartesian(A,_U),l(C)&&!h.equalsEpsilon(C,g,P.EPSILON7)&&!h.equalsEpsilon(C,m,P.EPSILON7)&&v.push(h.clone(C)))));let D=v.length,O=new Array(D);for(f=0;f<D;f++){let j=fe.fromCartesian(v[f],i);j.height=0,O[f]=j}if(O=Co(O,fe.equalsEpsilon),D=O.length,D<2)return;let R=[],M=[],N=[],_=[],S=tNe,w=nNe,I=iNe,L=oNe,B=rNe,U=O[0],V=O[1],G=O[D-1];for(S=jc(i,G,a,S),L=jc(i,V,a,L),w=jc(i,U,a,w),I=jc(i,U,c,I),n?B=T9(S,w,I,L,B):B=S9(U,V,c,i,B),h.pack(B,M,0),h.pack(w,N,0),h.pack(I,_,0),R.push(U.latitude),R.push(U.longitude),x9(U,V,a,c,o,r,i,M,N,_,R),f=1;f<D-1;++f){S=h.clone(w,S),w=h.clone(L,w);let j=O[f];jc(i,j,c,I),jc(i,O[f+1],a,L),T9(S,w,I,L,B),u=M.length,h.pack(B,M,u),h.pack(w,N,u),h.pack(I,_,u),R.push(j.latitude),R.push(j.longitude),x9(O[f],O[f+1],a,c,o,r,i,M,N,_,R)}let k=O[D-1],W=O[D-2];if(w=jc(i,k,a,w),I=jc(i,k,c,I),n){let j=O[0];S=jc(i,W,a,S),L=jc(i,j,a,L),B=T9(S,w,I,L,B)}else B=S9(W,k,c,i,B);if(u=M.length,h.pack(B,M,u),h.pack(w,N,u),h.pack(I,_,u),R.push(k.latitude),R.push(k.longitude),n){for(x9(k,U,a,c,o,r,i,M,N,_,R),u=M.length,f=0;f<3;++f)M[u+f]=M[f],N[u+f]=N[f],_[u+f]=_[f];R.push(U.latitude),R.push(U.longitude)}return RNe(n,s,N,_,M,R,t)};var sNe=new h,aNe=new $,cNe=new Oe;function jie(e,t,n,i){let o=Up(n,t,sNe),r=h.dot(o,e);if(r>ooe||r<Vie){let s=Up(i,n,aoe),a=r<Vie?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Oe.fromAxisAngle(s,a,cNe),u=$.fromQuaternion(c,aNe);return $.multiplyByVector(u,e,e),!0}return!1}var qie=new fe,lNe=new h,Yie=new h;function G1(e,t,n,i,o){let r=fe.toCartesian(t,e._ellipsoid,lNe),s=h.add(r,n,Yie),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,qie);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,Yie),u=c.cartesianToCartographic(s,qie)),u.height=0;let f=e.project(u,o);return o=h.subtract(f,i,o),o.z=0,o=h.normalize(o,o),a&&h.negate(o,o),o}var uNe=new h,Xie=new h;function Kie(e,t,n,i,o,r){let s=h.subtract(t,e,uNe);h.normalize(s,s);let a=n-roe,c=h.multiplyByScalar(s,a,Xie);h.add(e,c,o);let u=i-soe;c=h.multiplyByScalar(s,u,Xie),h.add(t,c,r)}var fNe=new h;function yU(e,t){let n=an.getPointDistance(xU,e),i=an.getPointDistance(xU,t),o=fNe;P.equalsEpsilon(n,0,P.EPSILON2)?(o=Up(t,e,o),h.multiplyByScalar(o,P.EPSILON2,o),h.add(e,o,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(o=Up(e,t,o),h.multiplyByScalar(o,P.EPSILON2,o),h.add(t,o,t))}function dNe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let o=P.sign(t.longitude);return e.longitude=o*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let o=P.sign(e.longitude);return t.longitude=o*(i-P.EPSILON11),2}return 0}var coe=new fe,loe=new fe,Zie=new h,C9=new h,$ie=new h,Qie=new h,hNe=new h,Jie=new h,mNe=[coe,loe],pNe=new se,_Ne=new h,gNe=new h,yNe=new h,xNe=new h,bNe=new h,TNe=new h,A9=new h,E9=new h,CNe=new h,ANe=new h,ENe=new h,eoe=new h,SNe=new h,vNe=new h,wNe=new Gn,DNe=new Gn,toe=new h,INe=new h,noe=new h,PNe=[new ae,new ae],uoe=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],ioe=uoe.length;function RNe(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(d*3),b=new Float32Array(p),T=new Float32Array(p),C=new Float32Array(p),A=new Float32Array(p),E=new Float32Array(p),v,D,O,R;s&&(v=new Float32Array(p),D=new Float32Array(p),O=new Float32Array(p),R=new Float32Array(d*2));let M=r.length/2,N=0,_=coe;_.height=0;let S=loe;S.height=0;let w=Zie,I=C9;if(s)for(c=0,a=1;a<M;a++)_.latitude=r[c],_.longitude=r[c+1],S.latitude=r[c+2],S.longitude=r[c+3],w=t.project(_,w),I=t.project(S,I),N+=h.distance(w,I),c+=2;let L=i.length/3;I=h.unpack(i,0,I);let B=0;for(c=3,a=1;a<L;a++)w=h.clone(I,w),I=h.unpack(i,c,I),B+=h.distance(w,I),c+=3;let U;c=3;let V=0,G=0,k=0,W=0,j=!1,J=h.unpack(n,0,Qie),q=h.unpack(i,0,C9),K=h.unpack(o,0,Jie);if(e){let Ae=h.unpack(n,n.length-6,$ie);jie(K,Ae,J,q)&&(K=h.negate(K,K))}let Q=0,de=0,ye=0;for(a=0;a<f;a++){let Ae=h.clone(J,$ie),ke=h.clone(q,Zie),ze=h.clone(K,hNe);j&&(ze=h.negate(ze,ze)),J=h.unpack(n,c,Qie),q=h.unpack(i,c,C9),K=h.unpack(o,c,Jie),j=jie(K,Ae,J,q),_.latitude=r[V],_.longitude=r[V+1],S.latitude=r[V+2],S.longitude=r[V+3];let tt,wt,_t,Be;if(s){let mi=dNe(_,S);tt=t.project(_,bNe),wt=t.project(S,TNe);let ra=Up(wt,tt,toe);ra.y=Math.abs(ra.y),_t=A9,Be=E9,mi===0||h.dot(ra,h.UNIT_Y)>ooe?(_t=G1(t,_,ze,tt,A9),Be=G1(t,S,K,wt,E9)):mi===1?(Be=G1(t,S,K,wt,E9),_t.x=0,_t.y=P.sign(_.longitude-Math.abs(S.longitude)),_t.z=0):(_t=G1(t,_,ze,tt,A9),Be.x=0,Be.y=P.sign(_.longitude-S.longitude),Be.z=0)}let Yt=h.distance(ke,q),Et=Gn.fromCartesian(Ae,wNe),ut=h.subtract(J,Ae,CNe),tn=h.normalize(ut,eoe),Ce=h.subtract(ke,Ae,ANe);Ce=h.normalize(Ce,Ce);let Te=h.cross(tn,Ce,eoe);Te=h.normalize(Te,Te);let it=h.cross(Ce,ze,SNe);it=h.normalize(it,it);let ji=h.subtract(q,J,ENe);ji=h.normalize(ji,ji);let ft=h.cross(K,ji,vNe);ft=h.normalize(ft,ft);let yo=Yt/B,Xo=Q/B,Xa=0,Rr,As,Le,ot=0,qe=0;if(s){Xa=h.distance(tt,wt),Rr=Gn.fromCartesian(tt,DNe),As=h.subtract(wt,tt,toe),Le=h.normalize(As,INe);let mi=Le.x;Le.x=Le.y,Le.y=-mi,ot=Xa/N,qe=de/N}for(U=0;U<8;U++){let mi=W+U*4,ra=G+U*2,Zr=mi+3,Cl=U<4?1:-1,xo=U===2||U===3||U===6||U===7?1:-1;h.pack(Et.high,b,mi),b[Zr]=ut.x,h.pack(Et.low,T,mi),T[Zr]=ut.y,h.pack(it,C,mi),C[Zr]=ut.z,h.pack(ft,A,mi),A[Zr]=yo*Cl,h.pack(Te,E,mi);let Or=Xo*xo;Or===0&&xo<0&&(Or=9),E[Zr]=Or,s&&(v[mi]=Rr.high.x,v[mi+1]=Rr.high.y,v[mi+2]=Rr.low.x,v[mi+3]=Rr.low.y,O[mi]=-_t.y,O[mi+1]=_t.x,O[mi+2]=Be.y,O[mi+3]=-Be.x,D[mi]=As.x,D[mi+1]=As.y,D[mi+2]=Le.x,D[mi+3]=Le.y,R[ra]=ot*Cl,Or=qe*xo,Or===0&&xo<0&&(Or=9),R[ra+1]=Or)}let Xe=yNe,ht=xNe,Gt=_Ne,Tn=gNe,Ro=se.fromCartographicArray(mNe,pNe),Ao=li.getMinimumMaximumHeights(Ro,u),Ka=Ao.minimumTerrainHeight,Za=Ao.maximumTerrainHeight;ye+=Math.abs(Ka),ye+=Math.abs(Za),Kie(Ae,ke,Ka,Za,Xe,Gt),Kie(J,q,Ka,Za,ht,Tn);let Ci=h.multiplyByScalar(Te,P.EPSILON5,noe);h.add(Xe,Ci,Xe),h.add(ht,Ci,ht),h.add(Gt,Ci,Gt),h.add(Tn,Ci,Tn),yU(Xe,ht),yU(Gt,Tn),h.pack(Xe,x,k),h.pack(ht,x,k+3),h.pack(Tn,x,k+6),h.pack(Gt,x,k+9),Ci=h.multiplyByScalar(Te,-2*P.EPSILON5,noe),h.add(Xe,Ci,Xe),h.add(ht,Ci,ht),h.add(Gt,Ci,Gt),h.add(Tn,Ci,Tn),yU(Xe,ht),yU(Gt,Tn),h.pack(Xe,x,k+12),h.pack(ht,x,k+15),h.pack(Tn,x,k+18),h.pack(Gt,x,k+21),V+=2,c+=3,G+=16,k+=24,W+=32,Q+=Yt,de+=Xa}c=0;let ce=0;for(a=0;a<f;a++){for(U=0;U<ioe;U++)m[c+U]=uoe[U]+ce;ce+=8,c+=ioe}let _e=PNe;ae.fromVertices(n,h.ZERO,3,_e[0]),ae.fromVertices(i,h.ZERO,3,_e[1]);let xe=ae.fromBoundingSpheres(_e);xe.radius+=ye/(f*2);let De={position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:Qg(b),startLoAndForwardOffsetY:Qg(T),startNormalAndForwardOffsetZ:Qg(C),endNormalAndTextureCoordinateNormalizationX:Qg(A),rightNormalAndTextureCoordinateNormalizationY:Qg(E)};return s&&(De.startHiLo2D=Qg(v),De.offsetAndRight2D=Qg(D),De.startEndNormals2D=Qg(O),De.texcoordNormalization2D=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new at({attributes:De,indices:m,boundingSphere:xe})}function Qg(e){return new ve({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Jg._projectNormal=G1;var Nx=Jg;var W1=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec4 color; -in float batchId; - -out vec4 v_color; - -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; - - vec4 p = czm_computePosition(); - vec4 prev = czm_computePrevPosition(); - vec4 next = czm_computeNextPosition(); - - float angle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; - - v_color = color; -} -`;var w9=`${_u} -${W1}`,ONe=Px;Ht.isInternetExplorer()||(w9=`#define CLIP_POLYLINE -${w9}`);function Fx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Fx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,w9),this._fragmentShaderSource=y(e.fragmentShaderSource,ONe),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Fx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Fx.VERTEX_FORMAT=Ie.POSITION_ONLY;Fx.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Fx.prototype.isTranslucent=io.prototype.isTranslucent;Fx.prototype.getRenderState=io.prototype.getRenderState;var es=Fx;var j1=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; -in float batchId; - -out float v_width; -out vec2 v_st; -out float v_polylineAngle; - -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; - - vec4 p = czm_computePosition(); - vec4 prev = czm_computePrevPosition(); - vec4 next = czm_computeNextPosition(); - - float angle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; - - v_width = width; - v_st.s = st.s; - v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); - v_polylineAngle = angle; -} -`;var D9=`${_u} -${j1}`,MNe=vx;Ht.isInternetExplorer()||(D9=`#define CLIP_POLYLINE -${D9}`);function Bx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Bx.VERTEX_FORMAT;this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,D9),this._fragmentShaderSource=y(e.fragmentShaderSource,MNe),this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Bx.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH -${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Bx.VERTEX_FORMAT=Ie.POSITION_AND_ST;Bx.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Bx.prototype.isTranslucent=io.prototype.isTranslucent;Bx.prototype.getRenderState=io.prototype.getRenderState;var la=Bx;function zp(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new la),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,Vn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=foe(!1),this._renderState3DTiles=foe(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(zp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});zp.initializeTerrainHeights=function(){return li.initialize()};function LNe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(zP);s=Dn._appendShowToShader(o,s),s=Dn._appendDistanceDisplayConditionToShader(o,s),s=Dn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(UP);a=Dn._appendShowToShader(o,a),a=Dn._appendDistanceDisplayConditionToShader(o,a),a=Dn._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(kP),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new Ue({defines:u,sources:[s]}),m=new Ue({defines:p,sources:[d,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let T=new Ue({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:T,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=x;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(b)){let T=new Ue({defines:u.concat([`MAX_TERRAIN_HEIGHT ${li._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(VP);let C=new Ue({defines:p,sources:[d,c]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:r})}e._spMorph=b}function foe(e){return Ve.fromCache({cull:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Un.EQUAL,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},backFunction:Un.EQUAL,backOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})}function NNe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof es?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=o[d];l(g)||(g=o[d]=new Ze({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=we.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=Ze.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=we.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let x=Ze.shallowClone(g,g.derivedCommands.color2D);x.shaderProgram=e._sp2D,g.derivedCommands.color2D=x;let b=Ze.shallowClone(m,m.derivedCommands.color2D);b.shaderProgram=e._sp2D,m.derivedCommands.color2D=b;let T=Ze.shallowClone(g,g.derivedCommands.colorMorph);T.renderState=e._renderStateMorph,T.shaderProgram=e._spMorph,T.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=T}}function doe(e,t,n,i,o,r,s){n.mode===ne.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ne.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function FNe(e,t,n,i,o,r,s){let a=e._primitive;Dn._updateBoundingVolumes(a,t,o);let c;t.mode===ne.SCENE3D?c=a._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ne.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===ne.MORPHING,f=e.classificationType,d=f!==Vn.CESIUM_3D_TILE,p=f!==Vn.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let x=n.length;for(let b=0;b<x;++b){let T=c[b];d&&(g=n[b],doe(e,g,t,o,r,T,s)),p&&(g=n[b].derivedCommands.tileset,doe(e,g,t,o,r,T,s))}}}zp.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!li.initialized){zp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new cc({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,Nx.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new vt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){LNe(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){NNe(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,x){FNe(n,u,f,d,p,g,m)},this._primitive=new Dn(i)}if(this.appearance instanceof es&&!this._hasPerInstanceColors)throw new he("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};zp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};zp.isSupported=function(e){return e.frameState.context.depthTexture};zp.prototype.isDestroyed=function(){return!1};zp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var Ud=zp;var BNe=new z(1,1),kNe=!1,VNe=H.WHITE;function TA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(TA.prototype,{isConstant:{get:function(){return Y.isConstant(this._image)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});TA.prototype.getType=function(e){return"Image"};var UNe=new Z;TA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(UNe)),l(t)||(t={}),t.image=Y.getValueOrUndefined(this._image,e),t.repeat=Y.getValueOrClonedDefault(this._repeat,e,BNe,t.repeat),t.color=Y.getValueOrClonedDefault(this._color,e,VNe,t.color),Y.getValueOrDefault(this._transparent,e,kNe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};TA.prototype.equals=function(e){return this===e||e instanceof TA&&Y.equals(this._image,e._image)&&Y.equals(this._repeat,e._repeat)&&Y.equals(this._color,e._color)&&Y.equals(this._transparent,e._transparent)};var ey=TA;function zNe(e){if(e instanceof H)return new zt(e);if(typeof e=="string"||e instanceof Se||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new ey;return t.image=e,t}}function HNe(e,t){return le(e,t,zNe)}var Mo=HNe;function q1(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(q1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Mo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});q1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new q1(this)};q1.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var kx=q1;var GNe={FIXED:0,INERTIAL:1},Ui=Object.freeze(GNe);function CA(){he.throwInstantiationError()}Object.defineProperties(CA.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError},referenceFrame:{get:he.throwInstantiationError}});CA.prototype.getValue=he.throwInstantiationError;CA.prototype.getValueInReferenceFrame=he.throwInstantiationError;CA.prototype.equals=he.throwInstantiationError;var hoe=new $;CA.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new h),n===i)return h.clone(t,o);let r=Mt.computeIcrfToCentralBodyFixedMatrix(e,hoe);if(n===Ui.INERTIAL)return $.multiplyByVector(r,t,o);if(n===Ui.FIXED)return $.multiplyByVector($.transpose(r,hoe),t,o)};var zd=CA;function Vx(e,t){this._definitionChanged=new me,this._value=h.clone(e),this._referenceFrame=y(t,Ui.FIXED)}Object.defineProperties(Vx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Ui.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var WNe=new Z;Vx.prototype.getValue=function(e,t){return l(e)||(e=Z.now(WNe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Vx.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Vx.prototype.getValueInReferenceFrame=function(e,t,n){return zd.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Vx.prototype.equals=function(e){return this===e||e instanceof Vx&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var qc=Vx;function Y1(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Y1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Mo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});Y1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Y1(this)};Y1.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Ux=Y1;function jNe(e){return e}function qNe(e,t){return le(e,t,jNe)}var Yc=qNe;function X1(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(X1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Mo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});X1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new X1(this)};X1.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var zx=X1;function K1(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(K1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Mo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});K1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new K1(this)};K1.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Hx=K1;function Z1(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Z1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Mo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Z1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Z1(this)};Z1.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Gx=Z1;function $1(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties($1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});$1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new $1(this)};$1.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Hd=$1;var YNe=new h(1,1,1),XNe=h.ZERO,KNe=Oe.IDENTITY;function moe(e,t,n){this.translation=h.clone(y(e,XNe)),this.rotation=Oe.clone(y(t,KNe)),this.scale=h.clone(y(n,YNe))}moe.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Oe.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var ty=moe;var I9=new ty;function Q1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(Q1.prototype,{isConstant:{get:function(){return Y.isConstant(this._translation)&&Y.isConstant(this._rotation)&&Y.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});var ZNe=new Z;Q1.prototype.getValue=function(e,t){return l(e)||(e=Z.now(ZNe)),l(t)||(t=new ty),t.translation=Y.getValueOrClonedDefault(this._translation,e,I9.translation,t.translation),t.rotation=Y.getValueOrClonedDefault(this._rotation,e,I9.rotation,t.rotation),t.scale=Y.getValueOrClonedDefault(this._scale,e,I9.scale,t.scale),t};Q1.prototype.equals=function(e){return this===e||e instanceof Q1&&Y.equals(this._translation,e._translation)&&Y.equals(this._rotation,e._rotation)&&Y.equals(this._scale,e._scale)};var Wx=Q1;function Hp(e,t){this._propertyNames=[],this._definitionChanged=new me,l(e)&&this.merge(e,t)}Object.defineProperties(Hp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!Y.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Hp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function $Ne(e){return new Kn(e)}Hp.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,y(n,$Ne))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Hp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var QNe=new Z;Hp.prototype.getValue=function(e,t){l(e)||(e=Z.now(QNe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=Y.getValueOrUndefined(this[r],e,t[r])}return t};Hp.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function JNe(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!Y.equals(e[s],t[s]))return!1}return!0}Hp.prototype.equals=function(e){return this===e||e instanceof Hp&&JNe(this,e)};var Ml=Hp;function poe(e){return new Wx(e)}function eFe(e){return new Ml(e,poe)}function tFe(e){return new Ml(e)}function J1(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(J1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),enableVerticalExaggeration:le("enableVerticalExaggeration"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,eFe),articulations:le("articulations",void 0,tFe),clippingPlanes:le("clippingPlanes"),customShader:le("customShader")});J1.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new J1(this)};J1.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.enableVerticalExaggeration=y(this.enableVerticalExaggeration,e.enableVerticalExaggeration),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Ml(t,poe)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Ml(n)}};var Gp=J1;function eR(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(eR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});eR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new eR(this)};eR.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var jx=eR;function tR(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(tR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:Mo("material"),distanceDisplayCondition:le("distanceDisplayCondition")});tR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new tR(this)};tR.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Wp=tR;function nR(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(nR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:Mo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});nR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new nR(this)};nR.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var iR=nR;function oR(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(oR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance"),splitDirection:le("splitDirection")});oR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new oR(this)};oR.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var qx=oR;function nFe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Ma=nFe;function iFe(e){return Array.isArray(e)&&(e=new Ma(e)),new Kn(e)}function rR(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(rR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,iFe),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Mo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});rR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new rR(this)};rR.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var Gd=rR;function sR(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(sR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:Mo("material"),depthFailMaterial:Mo("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});sR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new sR(this)};sR.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var lc=sR;function aR(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(aR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Mo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});aR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new aR(this)};aR.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Yx=aR;function cR(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(cR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Mo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});cR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new cR(this)};cR.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Wd=cR;function lR(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(lR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:Mo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});lR.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new lR(this)};lR.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var jp=lR;var oFe=new fe,P9=[];function rFe(e){return new qc(e)}function sFe(e){return le(e,void 0,rFe)}function Gs(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function If(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=Hn()),this._availability=void 0,this._id=t,this._definitionChanged=new me,this._name=e.name,this._show=y(e.show,!0),this._trackingReferenceFrame=y(e.trackingReferenceFrame,Bp.AUTODETECT),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...P9],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function R9(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&R9(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(If.prototype,{availability:Yc("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Yc("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&R9(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:Yc("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&R9(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Gs("billboard",sc),box:Gs("box",kx),corridor:Gs("corridor",Ux),cylinder:Gs("cylinder",zx),description:le("description"),ellipse:Gs("ellipse",Hx),ellipsoid:Gs("ellipsoid",Gx),label:Gs("label",Hd),model:Gs("model",Gp),tileset:Gs("tileset",jx),orientation:le("orientation"),path:Gs("path",Wp),plane:Gs("plane",iR),point:Gs("point",qx),polygon:Gs("polygon",Gd),polyline:Gs("polyline",lc),polylineVolume:Gs("polylineVolume",Yx),properties:Gs("properties",Ml),position:sFe("position"),rectangle:Gs("rectangle",Wd),viewFrom:le("viewFrom"),wall:Gs("wall",jp)});If.registerEntityType=function(e,t){Object.defineProperties(If.prototype,{[e]:Gs(e,t)}),P9.includes(e)||P9.push(e)};If.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};If.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Yc(e,!0))};If.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};If.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var _oe=new $,goe=new h,yoe=new Oe;If.prototype.computeModelMatrix=function(e,t){let n=Y.getValueOrUndefined(this._position,e,goe);if(!l(n))return;let i=Y.getValueOrUndefined(this._orientation,e,yoe);return l(i)?t=F.fromRotationTranslation($.fromQuaternion(i,_oe),n,t):t=Mt.eastNorthUpToFixedFrame(n,void 0,t),t};If.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=Y.getValueOrDefault(t,e,Ye.NONE),s=Y.getValueOrUndefined(this._position,e,goe);if(r===Ye.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,P.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,oFe);wf(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=Y.getValueOrUndefined(this._orientation,e,yoe);return l(c)?o=F.fromRotationTranslation($.fromQuaternion(c,_oe),s,o):o=Mt.eastNorthUpToFixedFrame(s,void 0,o),o};If.supportsMaterialsforEntitiesOnTerrain=function(e){return Wc.supportsMaterials(e)};If.supportsPolylinesOnTerrain=function(e){return Ud.isSupported(e)};var tr=If;var aFe=new zt(H.WHITE),cFe=new Kn(!0),lFe=new Kn(!0),uFe=new Kn(!1),fFe=new Kn(H.BLACK),dFe=new Kn(yn.DISABLED),hFe=new Kn(new Lt),mFe=new Kn(Vn.BOTH);function Xc(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new me,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=tr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Xc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&Y.isConstant(this._showProperty)&&Y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&Y.isConstant(this._showProperty)&&Y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Xc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};Xc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};Xc.prototype.createFillGeometryInstance=he.throwInstantiationError;Xc.prototype.createOutlineGeometryInstance=he.throwInstantiationError;Xc.prototype.isDestroyed=function(){return!1};Xc.prototype.destroy=function(){ue(this)};Xc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(He.MINIMUM_VALUE)};Xc.prototype._isOnTerrain=function(e,t){return!1};Xc.prototype._getIsClosed=function(e){return!0};Xc.prototype._isDynamic=he.throwInstantiationError;Xc.prototype._setStaticOptions=he.throwInstantiationError;Xc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(He.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(He.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(o.material,aFe),this._fillProperty=y(r,lFe),this._showProperty=y(u,cFe),this._showOutlineProperty=y(o.outline,uFe),this._outlineColorProperty=c?y(o.outlineColor,fFe):void 0,this._shadowsProperty=y(o.shadows,dFe),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,hFe),this._classificationTypeProperty=y(o.classificationType,mFe),this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof zt);if(c&&f&&(yt(yt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let d=o.outlineWidth;this._outlineWidth=l(d)?d.getValue(He.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Xc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ni=Xc;function AA(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new me,this.setCallback(e,t)}Object.defineProperties(AA.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var pFe=new Z;AA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(pFe)),this._callback(e,t)};AA.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};AA.prototype.equals=function(e){return this===e||e instanceof AA&&this._callback===e._callback&&this._isConstant===e._isConstant};var jd=AA;var xoe=new h;function EA(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new fe,this._normal=new h,this._definitionChanged=new me,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(He.MINIMUM_VALUE,xoe);if(!l(r)||h.equals(r,h.ZERO)||!l(e.globe))return;this._position=h.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(EA.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});EA.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var _Fe=new Z;EA.prototype.getValue=function(e,t){l(e)||(e=Z.now(_Fe));let n=Y.getValueOrDefault(this._heightReference,e,Ye.NONE),i=Y.getValueOrDefault(this._extrudedHeightReference,e,Ye.NONE);if(n===Ye.NONE&&!dA(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,xoe);if(!l(r)||h.equals(r,h.ZERO)||!l(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,P.EPSILON10))return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return h.multiplyByScalar(s,this._terrainHeight,t)};EA.prototype.isDestroyed=function(){return!1};EA.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var Xx=EA;function gFe(e,t,n,i){if(ni.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new jd(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Xx(this._scene,s,r)}}var qp=gFe;var boe=h.ZERO,Toe=new h,yFe=new h,Coe=new H;function xFe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function bu(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new xFe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(bu.prototype=Object.create(ni.prototype),bu.prototype.constructor=bu);Object.defineProperties(bu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});bu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof zt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Coe)),l(a)||(a=H.WHITE),s.color=Wt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,boe,Toe))),new vt({id:t,geometry:Ia.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};bu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Coe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,boe,Toe))),new vt({id:t,geometry:Vd.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};bu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};bu.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ni.prototype._isHidden.call(this,e,t)};bu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.dimensions.isConstant||!Y.isConstant(t.outlineWidth)};bu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof zt?cn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(He.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Ye.NONE?sn.ALL:void 0};bu.prototype._onEntityPropertyChanged=qp;bu.DynamicGeometryUpdater=SA;function SA(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(SA.prototype=Object.create(ti.prototype),SA.prototype.constructor=SA);SA.prototype._isHidden=function(e,t,n){let i=Y.getValueOrUndefined(e.position,n,yFe),o=this._options.dimensions;return!l(i)||!l(o)||ti.prototype._isHidden.call(this,e,t,n)};SA.prototype._setOptions=function(e,t,n){let i=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),o=this._options;o.dimensions=Y.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Ye.NONE?sn.ALL:void 0};var uR=bu;function Kx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=y(n,Ui.FIXED),this._definitionChanged=new me,this.setCallback(e,t)}Object.defineProperties(Kx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var bFe=new Z;Kx.prototype.getValue=function(e,t){return l(e)||(e=Z.now(bFe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Kx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Kx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return zd.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Kx.prototype.equals=function(e){return this===e||e instanceof Kx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var fR=Kx;/*! @license DOMPurify 3.2.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.2/LICENSE */var{entries:Ooe,setPrototypeOf:Aoe,isFrozen:TFe,getPrototypeOf:CFe,getOwnPropertyDescriptor:AFe}=Object,{freeze:Zc,seal:Pf,create:Moe}=Object,{apply:B9,construct:k9}=typeof Reflect<"u"&&Reflect;Zc||(Zc=function(t){return t});Pf||(Pf=function(t){return t});B9||(B9=function(t,n,i){return t.apply(n,i)});k9||(k9=function(t,n){return new t(...n)});var bU=Tu(Array.prototype.forEach),Eoe=Tu(Array.prototype.pop),dR=Tu(Array.prototype.push),CU=Tu(String.prototype.toLowerCase),O9=Tu(String.prototype.toString),Soe=Tu(String.prototype.match),hR=Tu(String.prototype.replace),EFe=Tu(String.prototype.indexOf),SFe=Tu(String.prototype.trim),qd=Tu(Object.prototype.hasOwnProperty),Kc=Tu(RegExp.prototype.test),mR=vFe(TypeError);function Tu(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return B9(e,t,i)}}function vFe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return k9(e,n)}}function Ri(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:CU;Aoe&&Aoe(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(TFe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function wFe(e){for(let t=0;t<e.length;t++)qd(e,t)||(e[t]=null);return e}function Zx(e){let t=Moe(null);for(let[n,i]of Ooe(e))qd(e,n)&&(Array.isArray(i)?t[n]=wFe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=Zx(i):t[n]=i);return t}function pR(e,t){for(;e!==null;){let i=AFe(e,t);if(i){if(i.get)return Tu(i.get);if(typeof i.value=="function")return Tu(i.value)}e=CFe(e)}function n(){return null}return n}var voe=Zc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),M9=Zc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),L9=Zc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),DFe=Zc(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),N9=Zc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),IFe=Zc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),woe=Zc(["#text"]),Doe=Zc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),F9=Zc(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ioe=Zc(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),TU=Zc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),PFe=Pf(/\{\{[\w\W]*|[\w\W]*\}\}/gm),RFe=Pf(/<%[\w\W]*|[\w\W]*%>/gm),OFe=Pf(/\${[\w\W]*}/gm),MFe=Pf(/^data-[\-\w.\u00B7-\uFFFF]/),LFe=Pf(/^aria-[\-\w]+$/),Loe=Pf(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),NFe=Pf(/^(?:\w+script|data):/i),FFe=Pf(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Noe=Pf(/^html$/i),BFe=Pf(/^[a-z][.\w]*(-[.\w]+)+$/i),Poe=Object.freeze({__proto__:null,ARIA_ATTR:LFe,ATTR_WHITESPACE:FFe,CUSTOM_ELEMENT:BFe,DATA_ATTR:MFe,DOCTYPE_NAME:Noe,ERB_EXPR:RFe,IS_ALLOWED_URI:Loe,IS_SCRIPT_OR_DATA:NFe,MUSTACHE_EXPR:PFe,TMPLIT_EXPR:OFe}),_R={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},kFe=function(){return typeof window>"u"?null:window},VFe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Roe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Foe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kFe(),t=ln=>Foe(ln);if(t.version="3.2.2",t.removed=[],!e||!e.document||e.document.nodeType!==_R.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:g}=e,m=c.prototype,x=pR(m,"cloneNode"),b=pR(m,"remove"),T=pR(m,"nextSibling"),C=pR(m,"childNodes"),A=pR(m,"parentNode");if(typeof s=="function"){let ln=n.createElement("template");ln.content&&ln.content.ownerDocument&&(n=ln.content.ownerDocument)}let E,v="",{implementation:D,createNodeIterator:O,createDocumentFragment:R,getElementsByTagName:M}=n,{importNode:N}=i,_=Roe();t.isSupported=typeof Ooe=="function"&&typeof A=="function"&&D&&D.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:S,ERB_EXPR:w,TMPLIT_EXPR:I,DATA_ATTR:L,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:G}=Poe,{IS_ALLOWED_URI:k}=Poe,W=null,j=Ri({},[...voe,...M9,...L9,...N9,...woe]),J=null,q=Ri({},[...Doe,...F9,...Ioe,...TU]),K=Object.seal(Moe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Q=null,de=null,ye=!0,ce=!0,_e=!1,xe=!0,De=!1,Ae=!0,ke=!1,ze=!1,tt=!1,wt=!1,_t=!1,Be=!1,Yt=!0,Et=!1,ut="user-content-",tn=!0,Ce=!1,Te={},it=null,ji=Ri({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ft=null,yo=Ri({},["audio","video","img","source","image","track"]),Xo=null,Xa=Ri({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Rr="http://www.w3.org/1998/Math/MathML",As="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml",ot=Le,qe=!1,Xe=null,ht=Ri({},[Rr,As,Le],O9),Gt=Ri({},["mi","mo","mn","ms","mtext"]),Tn=Ri({},["annotation-xml"]),Ro=Ri({},["title","style","font","a","script"]),Ao=null,Ka=["application/xhtml+xml","text/html"],Za="text/html",Ci=null,mi=null,ra=n.createElement("form"),Zr=function(Ee){return Ee instanceof RegExp||Ee instanceof Function},Cl=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(mi&&mi===Ee)){if((!Ee||typeof Ee!="object")&&(Ee={}),Ee=Zx(Ee),Ao=Ka.indexOf(Ee.PARSER_MEDIA_TYPE)===-1?Za:Ee.PARSER_MEDIA_TYPE,Ci=Ao==="application/xhtml+xml"?O9:CU,W=qd(Ee,"ALLOWED_TAGS")?Ri({},Ee.ALLOWED_TAGS,Ci):j,J=qd(Ee,"ALLOWED_ATTR")?Ri({},Ee.ALLOWED_ATTR,Ci):q,Xe=qd(Ee,"ALLOWED_NAMESPACES")?Ri({},Ee.ALLOWED_NAMESPACES,O9):ht,Xo=qd(Ee,"ADD_URI_SAFE_ATTR")?Ri(Zx(Xa),Ee.ADD_URI_SAFE_ATTR,Ci):Xa,ft=qd(Ee,"ADD_DATA_URI_TAGS")?Ri(Zx(yo),Ee.ADD_DATA_URI_TAGS,Ci):yo,it=qd(Ee,"FORBID_CONTENTS")?Ri({},Ee.FORBID_CONTENTS,Ci):ji,Q=qd(Ee,"FORBID_TAGS")?Ri({},Ee.FORBID_TAGS,Ci):{},de=qd(Ee,"FORBID_ATTR")?Ri({},Ee.FORBID_ATTR,Ci):{},Te=qd(Ee,"USE_PROFILES")?Ee.USE_PROFILES:!1,ye=Ee.ALLOW_ARIA_ATTR!==!1,ce=Ee.ALLOW_DATA_ATTR!==!1,_e=Ee.ALLOW_UNKNOWN_PROTOCOLS||!1,xe=Ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=Ee.SAFE_FOR_TEMPLATES||!1,Ae=Ee.SAFE_FOR_XML!==!1,ke=Ee.WHOLE_DOCUMENT||!1,wt=Ee.RETURN_DOM||!1,_t=Ee.RETURN_DOM_FRAGMENT||!1,Be=Ee.RETURN_TRUSTED_TYPE||!1,tt=Ee.FORCE_BODY||!1,Yt=Ee.SANITIZE_DOM!==!1,Et=Ee.SANITIZE_NAMED_PROPS||!1,tn=Ee.KEEP_CONTENT!==!1,Ce=Ee.IN_PLACE||!1,k=Ee.ALLOWED_URI_REGEXP||Loe,ot=Ee.NAMESPACE||Le,Gt=Ee.MATHML_TEXT_INTEGRATION_POINTS||Gt,Tn=Ee.HTML_INTEGRATION_POINTS||Tn,K=Ee.CUSTOM_ELEMENT_HANDLING||{},Ee.CUSTOM_ELEMENT_HANDLING&&Zr(Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&Zr(Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&typeof Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(ce=!1),_t&&(wt=!0),Te&&(W=Ri({},woe),J=[],Te.html===!0&&(Ri(W,voe),Ri(J,Doe)),Te.svg===!0&&(Ri(W,M9),Ri(J,F9),Ri(J,TU)),Te.svgFilters===!0&&(Ri(W,L9),Ri(J,F9),Ri(J,TU)),Te.mathMl===!0&&(Ri(W,N9),Ri(J,Ioe),Ri(J,TU))),Ee.ADD_TAGS&&(W===j&&(W=Zx(W)),Ri(W,Ee.ADD_TAGS,Ci)),Ee.ADD_ATTR&&(J===q&&(J=Zx(J)),Ri(J,Ee.ADD_ATTR,Ci)),Ee.ADD_URI_SAFE_ATTR&&Ri(Xo,Ee.ADD_URI_SAFE_ATTR,Ci),Ee.FORBID_CONTENTS&&(it===ji&&(it=Zx(it)),Ri(it,Ee.FORBID_CONTENTS,Ci)),tn&&(W["#text"]=!0),ke&&Ri(W,["html","head","body"]),W.table&&(Ri(W,["tbody"]),delete Q.tbody),Ee.TRUSTED_TYPES_POLICY){if(typeof Ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw mR('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw mR('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=Ee.TRUSTED_TYPES_POLICY,v=E.createHTML("")}else E===void 0&&(E=VFe(g,o)),E!==null&&typeof v=="string"&&(v=E.createHTML(""));Zc&&Zc(Ee),mi=Ee}},xo=Ri({},[...M9,...L9,...DFe]),Or=Ri({},[...N9,...IFe]),xp=function(Ee){let Rt=A(Ee);(!Rt||!Rt.tagName)&&(Rt={namespaceURI:ot,tagName:"template"});let pn=CU(Ee.tagName),yr=CU(Rt.tagName);return Xe[Ee.namespaceURI]?Ee.namespaceURI===As?Rt.namespaceURI===Le?pn==="svg":Rt.namespaceURI===Rr?pn==="svg"&&(yr==="annotation-xml"||Gt[yr]):!!xo[pn]:Ee.namespaceURI===Rr?Rt.namespaceURI===Le?pn==="math":Rt.namespaceURI===As?pn==="math"&&Tn[yr]:!!Or[pn]:Ee.namespaceURI===Le?Rt.namespaceURI===As&&!Tn[yr]||Rt.namespaceURI===Rr&&!Gt[yr]?!1:!Or[pn]&&(Ro[pn]||!xo[pn]):!!(Ao==="application/xhtml+xml"&&Xe[Ee.namespaceURI]):!1},$r=function(Ee){dR(t.removed,{element:Ee});try{A(Ee).removeChild(Ee)}catch{b(Ee)}},mf=function(Ee,Rt){try{dR(t.removed,{attribute:Rt.getAttributeNode(Ee),from:Rt})}catch{dR(t.removed,{attribute:null,from:Rt})}if(Rt.removeAttribute(Ee),Ee==="is")if(wt||_t)try{$r(Rt)}catch{}else try{Rt.setAttribute(Ee,"")}catch{}},$a=function(Ee){let Rt=null,pn=null;if(tt)Ee="<remove></remove>"+Ee;else{let Sa=Soe(Ee,/^[\r\n\t ]+/);pn=Sa&&Sa[0]}Ao==="application/xhtml+xml"&&ot===Le&&(Ee='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ee+"</body></html>");let yr=E?E.createHTML(Ee):Ee;if(ot===Le)try{Rt=new p().parseFromString(yr,Ao)}catch{}if(!Rt||!Rt.documentElement){Rt=D.createDocument(ot,"template",null);try{Rt.documentElement.innerHTML=qe?v:yr}catch{}}let Qa=Rt.body||Rt.documentElement;return Ee&&pn&&Qa.insertBefore(n.createTextNode(pn),Qa.childNodes[0]||null),ot===Le?M.call(Rt,ke?"html":"body")[0]:ke?Rt.documentElement:Qa},ex=function(Ee){return O.call(Ee.ownerDocument||Ee,Ee,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ea=function(Ee){return Ee instanceof d&&(typeof Ee.nodeName!="string"||typeof Ee.textContent!="string"||typeof Ee.removeChild!="function"||!(Ee.attributes instanceof f)||typeof Ee.removeAttribute!="function"||typeof Ee.setAttribute!="function"||typeof Ee.namespaceURI!="string"||typeof Ee.insertBefore!="function"||typeof Ee.hasChildNodes!="function")},Al=function(Ee){return typeof a=="function"&&Ee instanceof a};function Nc(ln,Ee,Rt){bU(ln,pn=>{pn.call(t,Ee,Rt,mi)})}let fs=function(Ee){let Rt=null;if(Nc(_.beforeSanitizeElements,Ee,null),Ea(Ee))return $r(Ee),!0;let pn=Ci(Ee.nodeName);if(Nc(_.uponSanitizeElement,Ee,{tagName:pn,allowedTags:W}),Ee.hasChildNodes()&&!Al(Ee.firstElementChild)&&Kc(/<[/\w]/g,Ee.innerHTML)&&Kc(/<[/\w]/g,Ee.textContent)||Ee.nodeType===_R.progressingInstruction||Ae&&Ee.nodeType===_R.comment&&Kc(/<[/\w]/g,Ee.data))return $r(Ee),!0;if(!W[pn]||Q[pn]){if(!Q[pn]&&_f(pn)&&(K.tagNameCheck instanceof RegExp&&Kc(K.tagNameCheck,pn)||K.tagNameCheck instanceof Function&&K.tagNameCheck(pn)))return!1;if(tn&&!it[pn]){let yr=A(Ee)||Ee.parentNode,Qa=C(Ee)||Ee.childNodes;if(Qa&&yr){let Sa=Qa.length;for(let El=Sa-1;El>=0;--El){let Qh=x(Qa[El],!0);Qh.__removalCount=(Ee.__removalCount||0)+1,yr.insertBefore(Qh,T(Ee))}}}return $r(Ee),!0}return Ee instanceof c&&!xp(Ee)||(pn==="noscript"||pn==="noembed"||pn==="noframes")&&Kc(/<\/no(script|embed|frames)/i,Ee.innerHTML)?($r(Ee),!0):(De&&Ee.nodeType===_R.text&&(Rt=Ee.textContent,bU([S,w,I],yr=>{Rt=hR(Rt,yr," ")}),Ee.textContent!==Rt&&(dR(t.removed,{element:Ee.cloneNode()}),Ee.textContent=Rt)),Nc(_.afterSanitizeElements,Ee,null),!1)},pf=function(Ee,Rt,pn){if(Yt&&(Rt==="id"||Rt==="name")&&(pn in n||pn in ra))return!1;if(!(ce&&!de[Rt]&&Kc(L,Rt))){if(!(ye&&Kc(B,Rt))){if(!J[Rt]||de[Rt]){if(!(_f(Ee)&&(K.tagNameCheck instanceof RegExp&&Kc(K.tagNameCheck,Ee)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Ee))&&(K.attributeNameCheck instanceof RegExp&&Kc(K.attributeNameCheck,Rt)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(Rt))||Rt==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&Kc(K.tagNameCheck,pn)||K.tagNameCheck instanceof Function&&K.tagNameCheck(pn))))return!1}else if(!Xo[Rt]){if(!Kc(k,hR(pn,V,""))){if(!((Rt==="src"||Rt==="xlink:href"||Rt==="href")&&Ee!=="script"&&EFe(pn,"data:")===0&&ft[Ee])){if(!(_e&&!Kc(U,hR(pn,V,"")))){if(pn)return!1}}}}}}return!0},_f=function(Ee){return Ee!=="annotation-xml"&&Soe(Ee,G)},gf=function(Ee){Nc(_.beforeSanitizeAttributes,Ee,null);let{attributes:Rt}=Ee;if(!Rt)return;let pn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0},yr=Rt.length;for(;yr--;){let Qa=Rt[yr],{name:Sa,namespaceURI:El,value:Qh}=Qa,Qv=Ci(Sa),Fc=Sa==="value"?Qh:SFe(Qh);if(pn.attrName=Qv,pn.attrValue=Fc,pn.keepAttr=!0,pn.forceKeepAttr=void 0,Nc(_.uponSanitizeAttribute,Ee,pn),Fc=pn.attrValue,Et&&(Qv==="id"||Qv==="name")&&(mf(Sa,Ee),Fc=ut+Fc),Ae&&Kc(/((--!?|])>)|<\/(style|title)/i,Fc)){mf(Sa,Ee);continue}if(pn.forceKeepAttr||(mf(Sa,Ee),!pn.keepAttr))continue;if(!xe&&Kc(/\/>/i,Fc)){mf(Sa,Ee);continue}De&&bU([S,w,I],WQ=>{Fc=hR(Fc,WQ," ")});let GQ=Ci(Ee.nodeName);if(pf(GQ,Qv,Fc)){if(E&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!El)switch(g.getAttributeType(GQ,Qv)){case"TrustedHTML":{Fc=E.createHTML(Fc);break}case"TrustedScriptURL":{Fc=E.createScriptURL(Fc);break}}try{El?Ee.setAttributeNS(El,Sa,Fc):Ee.setAttribute(Sa,Fc),Ea(Ee)?$r(Ee):Eoe(t.removed)}catch{}}}Nc(_.afterSanitizeAttributes,Ee,null)},Uo=function ln(Ee){let Rt=null,pn=ex(Ee);for(Nc(_.beforeSanitizeShadowDOM,Ee,null);Rt=pn.nextNode();)Nc(_.uponSanitizeShadowNode,Rt,null),!fs(Rt)&&(Rt.content instanceof r&&ln(Rt.content),gf(Rt));Nc(_.afterSanitizeShadowDOM,Ee,null)};return t.sanitize=function(ln){let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Rt=null,pn=null,yr=null,Qa=null;if(qe=!ln,qe&&(ln="<!-->"),typeof ln!="string"&&!Al(ln))if(typeof ln.toString=="function"){if(ln=ln.toString(),typeof ln!="string")throw mR("dirty is not a string, aborting")}else throw mR("toString is not a function");if(!t.isSupported)return ln;if(ze||Cl(Ee),t.removed=[],typeof ln=="string"&&(Ce=!1),Ce){if(ln.nodeName){let Qh=Ci(ln.nodeName);if(!W[Qh]||Q[Qh])throw mR("root node is forbidden and cannot be sanitized in-place")}}else if(ln instanceof a)Rt=$a("<!---->"),pn=Rt.ownerDocument.importNode(ln,!0),pn.nodeType===_R.element&&pn.nodeName==="BODY"||pn.nodeName==="HTML"?Rt=pn:Rt.appendChild(pn);else{if(!wt&&!De&&!ke&&ln.indexOf("<")===-1)return E&&Be?E.createHTML(ln):ln;if(Rt=$a(ln),!Rt)return wt?null:Be?v:""}Rt&&tt&&$r(Rt.firstChild);let Sa=ex(Ce?ln:Rt);for(;yr=Sa.nextNode();)fs(yr)||(yr.content instanceof r&&Uo(yr.content),gf(yr));if(Ce)return ln;if(wt){if(_t)for(Qa=R.call(Rt.ownerDocument);Rt.firstChild;)Qa.appendChild(Rt.firstChild);else Qa=Rt;return(J.shadowroot||J.shadowrootmode)&&(Qa=N.call(i,Qa,!0)),Qa}let El=ke?Rt.outerHTML:Rt.innerHTML;return ke&&W["!doctype"]&&Rt.ownerDocument&&Rt.ownerDocument.doctype&&Rt.ownerDocument.doctype.name&&Kc(Noe,Rt.ownerDocument.doctype.name)&&(El="<!DOCTYPE "+Rt.ownerDocument.doctype.name+`> -`+El),De&&bU([S,w,I],Qh=>{El=hR(El,Qh," ")}),E&&Be?E.createHTML(El):El},t.setConfig=function(){let ln=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Cl(ln),ze=!0},t.clearConfig=function(){mi=null,ze=!1},t.isValidAttribute=function(ln,Ee,Rt){mi||Cl({});let pn=Ci(ln),yr=Ci(Ee);return pf(pn,yr,Rt)},t.addHook=function(ln,Ee){typeof Ee=="function"&&dR(_[ln],Ee)},t.removeHook=function(ln){return Eoe(_[ln])},t.removeHooks=function(ln){_[ln]=[]},t.removeAllHooks=function(){_=Roe()},t}var Boe=Foe();var UFe=0,V9={};function mm(e,t){let n,i=e;l(V9[i])?n=V9[i]:(n=UFe++,V9[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(mm.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=Boe.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});mm.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};mm.prototype.equals=function(e){return mm.equals(this,e)};mm.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};mm.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new mm(e.html,t)};mm.clone=function(e){if(l(e))return new mm(e.html,e.showOnScreen)};var Tt=mm;function $x(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new me}Object.defineProperties($x.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});$x.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function U9(e){e._cubeMapBuffers=void 0}$x.prototype.update=function(e){let{context:t}=e;if(!$x.isSupported(t))return;if(l(this._texture)){U9(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(U9(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;Dl(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT);let o=et.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let f={};Object.values(Cr.FaceName).forEach(d=>{f[d]=void 0});for(let d=r;d<a;d++)n.push(f)}let c=new $t({minificationFilter:Zt.LINEAR_MIPMAP_LINEAR}),u=new Cr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};$x.prototype.isDestroyed=function(){return!1};$x.prototype.destroy=function(){return U9(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var Yd=$x;function gR(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?z.clone(e.imageBasedLightingFactor):new z(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=z.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(gR.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=z.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function zFe(e,t){if(Yd.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Yd(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}gR.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;z.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(zFe(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};gR.prototype.isDestroyed=function(){return!1};gR.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var Qx=gR;var H9=Ko(uu(),1);var z9,koe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0ZDdmNWJiNy0wMmNlLTQ1MWUtODM2YS02NGM1MTBlOGMwMWQiLCJpZCI6MjU5LCJpYXQiOjE3MzMxNTc4OTV9.B3URHf0VdHDtGckb-hv7uqATdn8KfvkiuoAFZUq8tAo",AU={};AU.defaultAccessToken=koe;AU.defaultServer=new Se({url:"https://api.cesium.com/"});AU.getDefaultTokenCredit=function(e){if(e===koe){if(!l(z9)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;z9=new Tt(t,!0)}return z9}};var Xd=AU;function $c(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:HFe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new re("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Se.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new H9.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&($c.prototype=Object.create(Se.prototype),$c.prototype.constructor=$c);$c.fromAssetId=function(e,t){let n=$c._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new $c(i,n)})};Object.defineProperties($c.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=$c.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});$c.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Tt.getIonCredit),i=Xd.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Tt.clone(i)),n};$c.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new $c(t._ionEndpoint,t._ionEndpointResource)),e=Se.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};$c.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Se.prototype.fetchImage.call(this,e)};$c.prototype._makeRequest=function(e){return this._isExternal||new H9.default(this.url).authority()!==this._ionEndpointDomain?Se.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Se.prototype._makeRequest.call(this,e))};$c._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,Xd.defaultServer),i=y(t.accessToken,Xd.defaultAccessToken);n=Se.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function HFe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var Cu=$c;function pm(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(pm.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});pm.prototype.get=function(e){return this._array[e]};pm.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};pm.prototype.peek=function(){return this._array[this._length-1]};pm.prototype.push=function(e){let t=this.length++;this._array[t]=e};pm.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};pm.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};pm.prototype.resize=function(e){this.length=e};pm.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Qc=pm;var Yp={X:0,Y:1,Z:2};Yp.Y_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));Yp.Z_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));Yp.X_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));Yp.Z_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));Yp.X_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));Yp.Y_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));Yp.fromName=function(e){return Yp[e]};var Lo=Object.freeze(Yp);function Voe(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(Voe.prototype,{metadata:{get:function(){return this._metadata}}});var Jx=Voe;function ny(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),ny.decode(e)}ny.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};ny.decodeWithFromCharCode=function(e){let t="",n=GFe(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function yR(e,t,n){return t<=e&&e<=n}function GFe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(yR(u,0,127)){s.push(u);continue}if(yR(u,194,223)){i=1,t=u&31;continue}if(yR(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(yR(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new re("String decoding failed.")}if(!yR(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?ny.decode=ny.decodeWithTextDecoder:ny.decode=ny.decodeWithFromCharCode;var Ll=ny;function WFe(e,t){return t=y(t,0),Ll(e,t,Math.min(4,e.length))}var Kd=WFe;function Rf(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Rf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var xR=Uint32Array.BYTES_PER_ELEMENT;Rf.fromTileType=async function(e,t,n,i,o,r){o=y(o,0);let s=new Uint8Array(i),a=new DataView(i);o+=xR;let c=a.getUint32(o,!0);if(c!==1)throw new re(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=xR,o+=xR;let u=a.getUint32(o,!0);o+=xR;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let d=[];d.length=u;for(let m=0;m<u;++m){let x=Kd(s,o),b=a.getUint32(o+xR*2,!0),T=r[x],C=`${f}${m}`,A=n.getDerivedResource({queryParameters:{compositeIndex:C}});if(l(T))d[m]=Promise.resolve(T(e,t,A,i,o));else throw new re(`Unknown tile content type, ${x}, inside Composite tile`);o+=b}let p=await Promise.all(d);return new Rf(e,t,n,p)};Rf.prototype.hasProperty=function(e,t){return!1};Rf.prototype.getFeature=function(e){};Rf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Rf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Rf.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};Rf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=h.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};Rf.prototype.isDestroyed=function(){return!1};Rf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var bR=Rf;function jFe(e,t,n){return JSON.parse(Ll(e,t,n))}var No=jFe;function uc(e){this._id=Hn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,Nt.maximumTextureSize),r=Math.ceil(t/Nt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new z(o,r),i=new oe(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(uc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});uc.DEFAULT_COLOR_VALUE=H.WHITE;uc.DEFAULT_SHOW_VALUE=!0;function Uoe(e){let t=e._textureDimensions;return t.x*t.y*4}function zoe(e){if(!l(e._batchValues)){let t=Uoe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Hoe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}uc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Hoe(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=zoe(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};uc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};uc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var qFe=new Array(4);uc.prototype.setColor=function(e,t){if(H.equals(t,uc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(qFe),i=n[3],o=zoe(this),r=e*4,s=Hoe(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};uc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};uc.prototype.getColor=function(e,t){if(!l(this._batchValues))return H.clone(uc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return H.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};uc.prototype.getPickColor=function(e){return this._pickIds[e]};function Goe(e,t,n){let i=e._textureDimensions;return new Pt({context:t,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:$t.NEAREST})}function YFe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=Uoe(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;r[d]=H.floatToByte(f.red),r[d+1]=H.floatToByte(f.green),r[d+2]=H.floatToByte(f.blue),r[d+3]=H.floatToByte(f.alpha)}e._pickTexture=Goe(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function XFe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}uc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&YFe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Goe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),XFe(this))};uc.prototype.isDestroyed=function(){return!1};uc.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Jc=uc;var KFe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ZFe={SCALAR:void 0,VEC2:z,VEC3:h,VEC4:oe,MAT2:Ii,MAT3:$,MAT4:F};function $Fe(e){let t=e.componentType,n;typeof t=="string"?n=X.fromName(t):n=t;let i=KFe[e.type],o=ZFe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return X.createArrayBufferView(n,r,s,i*a)}}}var Au=$Fe;function Xp(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,QFe(this,e.extension,e.binaryBody)}Object.defineProperties(Xp.prototype,{byteLength:{get:function(){return this._byteLength}}});function QFe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=y(c.componentType,X.UNSIGNED_SHORT),c.type=on.SCALAR,r=Au(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=y(u.componentType,X.UNSIGNED_SHORT),u.type=on.SCALAR,r=Au(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=y(f.componentType,X.UNSIGNED_SHORT),f.type=on.SCALAR,r=Au(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let T=a[i].length,C=a[i].instances,A=JFe(T,C,n);p+=e2e(A),a[i].instances=bt(A,C)}let x=new Array(m).fill(0),b=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],b[i]=x[o],++x[o];p+=b.byteLength,e._classes=a,e._classIds=c,e._classIndexes=b,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function JFe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new re("componentType is required.");if(!l(c))throw new re("type is required.");if(!l(n))throw new re(`Property ${o} requires a batch table binary.`);let u=Au(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function e2e(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var t2e=[],n2e=[],i2e=0;function o2e(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=t2e;c.length=Math.max(c.length,a);let u=++i2e,f=n2e;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=o[t],g=s[t];for(let m=0;m<p;++m){let x=r[g+m];x!==t&&f.push(x)}}}function r2e(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(l(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function TR(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return o2e(e,t,n)}else return n(e,t);return r2e(e,t,n)}Xp.prototype.hasProperty=function(e,t){let n=TR(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};Xp.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(l(o[e]))return!0}return!1};Xp.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,TR(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Xp.prototype.getProperty=function(e,t){return TR(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(l(a))return l(a.typedArray)?s2e(a,s):Ge(a[s],!0)})};function s2e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Xp.prototype.setProperty=function(e,t,n){let i=TR(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],u=a.instances[t];if(l(u))return l(u.typedArray)?a2e(u,c,n):u[c]=Ge(n,!0),!0});return l(i)};function a2e(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Xp.prototype.isClass=function(e,t){let n=TR(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};Xp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var eb=Xp;var c2e={HIGHLIGHT:0,REPLACE:1,MIX:2},Nl=Object.freeze(c2e);var G9=Jc.DEFAULT_COLOR_VALUE,W9=Jc.DEFAULT_SHOW_VALUE;function mo(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=y(r,{});let s=l2e(n);this._properties=s,this._batchTableHierarchy=u2e(this,n,i);let a=joe(t,s,i);this._binaryPropertiesByteLength=f2e(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Jc({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}mo._deprecationWarning=ms;Object.defineProperties(mo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function l2e(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ge(e[n],!0));return t}function u2e(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(mo._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=o,i=o),!!l(i))return new eb({extension:i,binaryBody:n})}function joe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new re("componentType is required.");if(!l(c))throw new re("type is required.");if(!l(n))throw new re(`Property ${o} requires a batch table binary.`);let u=Au(r),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:d}}}return i}function f2e(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}mo.getBinaryProperties=function(e,t,n){return joe(e,t,n)};mo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};mo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};mo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};mo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};mo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};mo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};mo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var d2e=new H;mo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(G9),this.setAllShow(W9);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?y(e.color.evaluateColor(o,d2e),G9):G9,s=l(e.show)?y(e.show.evaluate(o),W9):W9;this.setColor(i,r),this.setShow(i,s)}};function h2e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function m2e(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}mo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};mo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};mo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};mo.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};mo.prototype.hasPropertyBySemantic=function(){return!1};mo.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};mo.prototype.getPropertyBySemantic=function(e,t){};mo.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return h2e(i,e)}let n=this._properties[t];if(l(n))return Ge(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};mo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){m2e(r,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];l(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=Ge(n,!0)};function p2e(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - return vec2(centerX + (batchId * stepX), 0.5); -} -`:`uniform vec4 tile_textureStep; -uniform vec2 tile_textureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - float stepY = tile_textureStep.z; - float centerY = tile_textureStep.w; - float xId = mod(batchId, tile_textureDimensions.x); - float yId = floor(batchId / tile_textureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}mo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=qoe(o,n,!1),s;return Nt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; -`),s+=`uniform sampler2D tile_batchTexture; -out vec4 tile_featureColor; -out vec2 tile_featureSt; -void main() -{ - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; -void main() -{ - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${r} -${p2e(i)}${s}`}};function Woe(e,t){return e=Ue.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function _2e(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function qoe(e,t,n){if(!l(t))return Woe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return Woe(e,n);let r=o[0],s=o[2];e=Ue.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} -vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) -{ - vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); - vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; - return vec4(diffuse.rgb, sourceDiffuse.a); -} -`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; - tile_diffuse = tile_diffuse_final(source, tile_featureColor); - tile_main(); -`}else s==="sampler2D"&&(e=_2e(e,t),u=` tile_diffuse = tile_featureColor; - tile_main(); -`);return e=`uniform float tile_colorBlend; -vec4 tile_diffuse = vec4(1.0); -${a}${r} -${e} -void tile_color(vec4 tile_featureColor) -{ -${u}`,n&&(e+=c),e+=`} -`,e}mo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=qoe(i,t,!0),Nt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};mo.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=Ue.replaceMain(e,"tile_main"),Nt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_main(); - out_FragColor = tile_featureColor; - out_FragColor.rgb *= out_FragColor.a; -}`:e+=`uniform sampler2D tile_batchTexture; -uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -void main() -{ - tile_main(); - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } - out_FragColor = featureProperties; - out_FragColor.rgb *= out_FragColor.a; -} -`,e}};function g2e(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Nl.HIGHLIGHT)return 0;if(n===Nl.REPLACE)return 1;if(n===Nl.MIX)return P.clamp(i,P.EPSILON4,1)}mo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return bt(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return g2e(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};mo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var iy={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};mo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=y2e(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===we.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=x2e(f),f.dirty=!1);let p=d.originalCommand;c!==iy.ALL_OPAQUE&&f.pass!==we.TRANSLUCENT&&(l(d.translucent)||(d.translucent=b2e(p))),c!==iy.ALL_TRANSLUCENT&&f.pass!==we.TRANSLUCENT&&(l(d.opaque)||(d.opaque=T2e(p)),a&&(r||(l(d.zback)||(d.zback=A2e(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||o._selectionDepth!==S2e(d.stencil))&&(f.renderState.depthMask?d.stencil=E2e(p,o._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==we.TRANSLUCENT?(c===iy.ALL_OPAQUE&&(n[u]=g),c===iy.ALL_TRANSLUCENT&&(n[u]=m),c===iy.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function y2e(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?iy.ALL_OPAQUE:t===e.featuresLength?iy.ALL_TRANSLUCENT:iy.OPAQUE_AND_TRANSLUCENT}function x2e(e){let t=Ze.shallowClone(e),n=t.pass===we.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function b2e(e){let t=Ze.shallowClone(e);return t.pass=we.TRANSLUCENT,t.renderState=v2e(e.renderState),t}function T2e(e){let t=Ze.shallowClone(e);return t.renderState=w2e(e.renderState),t}function C2e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function A2e(e,t){let n=Ze.shallowClone(t),i=Ge(n.renderState,!0);i.cull.enabled=!0,i.cull.face=yi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Ut.setCesium3DTileBit(),i.stencilMask=Ut.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ge(t.uniformMap);let o=new z(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=C2e(e,t.shaderProgram),n}function E2e(e,t){let n=Ze.shallowClone(e),i=Ge(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Ut.SKIP_LOD_MASK,i.stencilTest.reference=Ut.CESIUM_3D_TILE_MASK|t<<Ut.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Un.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=dt.REPLACE,i.stencilTest.backFunction=Un.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=dt.REPLACE,i.stencilMask=Ut.CESIUM_3D_TILE_MASK|Ut.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function S2e(e){return(e.renderState.stencilTest.reference&Ut.SKIP_LOD_MASK)>>>Ut.SKIP_LOD_BIT_SHIFT}function v2e(e){let t=Ge(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=Ut.setCesium3DTileBit(),t.stencilMask=Ut.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function w2e(e){let t=Ge(e,!0);return t.stencilTest=Ut.setCesium3DTileBit(),t.stencilMask=Ut.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}mo.prototype.update=function(e,t){this._batchTexture.update(e,t)};mo.prototype.isDestroyed=function(){return!1};mo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var Kp=mo;function D2e(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var _m=D2e;function Of(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Of.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new H),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});Of.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Of.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Of.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Of.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};Of.prototype.getPropertyInherited=function(e){return Of.getPropertyInherited(this._content,this._batchId,e)};Of.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Of.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Of.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Of.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ws=Of;var j9=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},q9=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Fl=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>r.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=` -`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},I2e=new j9;Object.assign(Fl,{hooks:I2e,plugins:new q9(Fl),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Fl.max_unop_len=Fl.getMaxKeyLen(Fl.unary_ops);Fl.max_binop_len=Fl.getMaxKeyLen(Fl.binary_ops);var oy=e=>new Fl(e).parse(),P2e=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Fl).filter(e=>!P2e.includes(e)&&oy[e]===void 0).forEach(e=>{oy[e]=Fl[e]});oy.Jsep=Fl;var R2e="ConditionalExpression",O2e={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:R2e,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};oy.plugins.register(O2e);var M2e={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},mt=Object.freeze(M2e);function Zd(e,t){this._expression=e,e=q2e(e,t),e=X2e(Y2e(e)),oy.addBinaryOp("=~",0),oy.addBinaryOp("!~",0);let n;try{n=oy(e)}catch(i){throw new re(i)}this._runtimeAst=Ai(this,n)}Object.defineProperties(Zd.prototype,{expression:{get:function(){return this._expression}}});var On={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new z],cartesian3Array:[new h],cartesian4Array:[new oe],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new z),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new oe),this.cartesian4Array[this.cartesian4Index++]}};Zd.prototype.evaluate=function(e,t){On.reset();let n=this._runtimeAst.evaluate(e);return t instanceof H&&n instanceof oe?H.fromCartesian4(n,t):n instanceof z||n instanceof h||n instanceof oe?n.clone(t):n};Zd.prototype.evaluateColor=function(e,t){On.reset();let n=this._runtimeAst.evaluate(e);return H.fromCartesian4(n,t)};Zd.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} -{ - return ${o}; -} -`,o};Zd.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Zd.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var L2e=["!","-","+"],Yoe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],vU=/\${(.*?)}/g,N2e=/\\/g,F2e="@#%",B2e=/@#%/g,wU=new H,DU={abs:js(Math.abs),sqrt:js(Math.sqrt),cos:js(Math.cos),sin:js(Math.sin),tan:js(Math.tan),acos:js(Math.acos),asin:js(Math.asin),atan:js(Math.atan),radians:js(P.toRadians),degrees:js(P.toDegrees),sign:js(P.sign),floor:js(Math.floor),ceil:js(Math.ceil),round:js(Math.round),exp:js(Math.exp),exp2:js(V2e),log:js(Math.log),log2:js(U2e),fract:js(k2e),length:z2e,normalize:H2e},IU={atan2:EU(Math.atan2,!1),pow:EU(Math.pow,!1),min:EU(Math.min,!0),max:EU(Math.max,!0),distance:G2e,dot:W2e,cross:j2e},K9={clamp:Xoe(P.clamp,!0),mix:Xoe(P.lerp,!0)};function k2e(e){return e-Math.floor(e)}function V2e(e){return Math.pow(2,e)}function U2e(e){return P.log2(e)}function js(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof z)return z.fromElements(e(n.x),e(n.y),On.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),On.getCartesian3());if(n instanceof oe)return oe.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),On.getCartesian4());throw new re(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function EU(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof z)return z.fromElements(e(i.x,o),e(i.y,o),On.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),On.getCartesian3());if(i instanceof oe)return oe.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),On.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof z&&o instanceof z)return z.fromElements(e(i.x,o.x),e(i.y,o.y),On.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),On.getCartesian3());if(i instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),On.getCartesian4());throw new re(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Xoe(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof z&&o instanceof z)return z.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),On.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),On.getCartesian3());if(i instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),On.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof z&&o instanceof z&&r instanceof z)return z.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),On.getCartesian2());if(i instanceof h&&o instanceof h&&r instanceof h)return h.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),On.getCartesian3());if(i instanceof oe&&o instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),On.getCartesian4());throw new re(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function z2e(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof z)return z.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof oe)return oe.magnitude(t);throw new re(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function H2e(e,t){if(typeof t=="number")return 1;if(t instanceof z)return z.normalize(t,On.getCartesian2());if(t instanceof h)return h.normalize(t,On.getCartesian3());if(t instanceof oe)return oe.normalize(t,On.getCartesian4());throw new re(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function G2e(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof z&&n instanceof z)return z.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof oe&&n instanceof oe)return oe.distance(t,n);throw new re(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function W2e(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof z&&n instanceof z)return z.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof oe&&n instanceof oe)return oe.dot(t,n);throw new re(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function j2e(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,On.getCartesian3());throw new re(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Ct(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,oBe(this)}function q2e(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function Y2e(e){return e.replace(N2e,F2e)}function X9(e){return e.replace(B2e,"\\")}function X2e(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new re("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function K2e(e){let t=typeof e.value;if(e.value===null)return new Ct(mt.LITERAL_NULL,null);if(t==="boolean")return new Ct(mt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Ct(mt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Ct(mt.VARIABLE_IN_STRING,e.value):new Ct(mt.LITERAL_STRING,X9(e.value))}function Z2e(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new re(`${o} is not a function.`);return i===0?o==="test"?new Ct(mt.LITERAL_BOOLEAN,!1):new Ct(mt.LITERAL_NULL,null):(s=Ai(e,c),a=Ai(e,n[0]),new Ct(mt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Ai(e,c),new Ct(mt.FUNCTION_CALL,o,r);throw new re(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Ct(mt.LITERAL_COLOR,o);if(r=Ai(e,n[0]),l(n[1])){let c=Ai(e,n[1]);return new Ct(mt.LITERAL_COLOR,o,[r,c])}return new Ct(mt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new re(`${o} requires three arguments.`);return r=[Ai(e,n[0]),Ai(e,n[1]),Ai(e,n[2])],new Ct(mt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new re(`${o} requires four arguments.`);return r=[Ai(e,n[0]),Ai(e,n[1]),Ai(e,n[2]),Ai(e,n[3])],new Ct(mt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=Ai(e,n[c]);return new Ct(mt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Ct(mt.LITERAL_BOOLEAN,!0):new Ct(mt.LITERAL_BOOLEAN,!1):(r=Ai(e,n[0]),new Ct(mt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new re(`${o} requires exactly one argument.`);return r=Ai(e,n[0]),new Ct(mt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new re(`${o} does not take any argument.`);return new Ct(mt.UNARY,o)}else if(l(DU[o])){if(i!==1)throw new re(`${o} requires exactly one argument.`);return r=Ai(e,n[0]),new Ct(mt.UNARY,o,r)}else if(l(IU[o])){if(i!==2)throw new re(`${o} requires exactly two arguments.`);return s=Ai(e,n[0]),a=Ai(e,n[1]),new Ct(mt.BINARY,o,s,a)}else if(l(K9[o])){if(i!==3)throw new re(`${o} requires exactly three arguments.`);s=Ai(e,n[0]),a=Ai(e,n[1]);let c=Ai(e,n[2]);return new Ct(mt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Ct(mt.LITERAL_BOOLEAN,!1):(r=Ai(e,n[0]),new Ct(mt.UNARY,o,r));if(o==="Number")return i===0?new Ct(mt.LITERAL_NUMBER,0):(r=Ai(e,n[0]),new Ct(mt.UNARY,o,r));if(o==="String")return i===0?new Ct(mt.LITERAL_STRING,""):(r=Ai(e,n[0]),new Ct(mt.UNARY,o,r));if(o==="regExp")return $2e(e,t)}}throw new re(`Unexpected function call "${o}".`)}function $2e(e,t){let n=t.arguments;if(n.length===0)return new Ct(mt.LITERAL_REGEX,new RegExp);let i=Ai(e,n[0]),o;if(n.length>1){let r=Ai(e,n[1]);if(Y9(i)&&Y9(r)){try{o=new RegExp(X9(String(i._value)),r._value)}catch(s){throw new re(s)}return new Ct(mt.LITERAL_REGEX,o)}return new Ct(mt.REGEX,i,r)}if(Y9(i)){try{o=new RegExp(X9(String(i._value)))}catch(r){throw new re(r)}return new Ct(mt.LITERAL_REGEX,o)}return new Ct(mt.REGEX,i)}function Q2e(e){if(nBe(e.name)){let t=iBe(e.name);return t.substr(0,8)==="tiles3d_"?new Ct(mt.BUILTIN_VARIABLE,t):new Ct(mt.VARIABLE,t)}else{if(e.name==="NaN")return new Ct(mt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Ct(mt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Ct(mt.LITERAL_UNDEFINED,void 0)}throw new re(`${e.name} is not defined.`)}function J2e(e){let t=e.property.name;if(t==="PI")return new Ct(mt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Ct(mt.LITERAL_NUMBER,Math.E)}function eBe(e){if(e.property.name==="POSITIVE_INFINITY")return new Ct(mt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function tBe(e,t){if(t.object.name==="Math")return J2e(t);if(t.object.name==="Number")return eBe(t);let n,i=Ai(e,t.object);return t.computed?(n=Ai(e,t.property),new Ct(mt.MEMBER,"brackets",i,n)):(n=new Ct(mt.LITERAL_STRING,t.property.name),new Ct(mt.MEMBER,"dot",i,n))}function Y9(e){return e._type>=mt.LITERAL_NULL}function nBe(e){return e.substr(0,4)==="czm_"}function iBe(e){return e.substr(4)}function Ai(e,t){let n,i,o,r;if(t.type==="Literal")n=K2e(t);else if(t.type==="CallExpression")n=Z2e(e,t);else if(t.type==="Identifier")n=Q2e(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ai(e,t.argument);if(L2e.indexOf(i)>-1)n=new Ct(mt.UNARY,i,s);else throw new re(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Ai(e,t.left),r=Ai(e,t.right),Yoe.indexOf(i)>-1)n=new Ct(mt.BINARY,i,o,r);else throw new re(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Ai(e,t.left),r=Ai(e,t.right),Yoe.indexOf(i)>-1&&(n=new Ct(mt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Ai(e,t.test);o=Ai(e,t.consequent),r=Ai(e,t.alternate),n=new Ct(mt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=tBe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ai(e,t.elements[a]);n=new Ct(mt.ARRAY,s)}else throw t.type==="Compound"?new re("Provide exactly one expression."):new re("Cannot parse expression.");return n}function oBe(e){e._type===mt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===mt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===mt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(DU[e._value])&&(e.evaluate=sBe(e._value)):e._type===mt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(IU[e._value])&&(e.evaluate=aBe(e._value)):e._type===mt.TERNARY?e.evaluate=cBe(e._value):e._type===mt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===mt.ARRAY?e.evaluate=e._evaluateArray:e._type===mt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===mt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===mt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===mt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===mt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===mt.REGEX?e.evaluate=e._evaluateRegExp:e._type===mt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=rBe):e.evaluate=e._evaluateLiteral}function rBe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function sBe(e){let t=DU[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function aBe(e){let t=IU[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function cBe(e){let t=K9[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function PU(e,t){if(l(e))return e.getPropertyInherited(t)}Ct.prototype._evaluateLiteral=function(){return this._value};Ct.prototype._evaluateLiteralColor=function(e){let t=wU,n=this._left;if(this._value==="color")l(n)?n.length>1?(H.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):H.fromCssColorString(n[0].evaluate(e),t):H.fromBytes(255,255,255,255,t);else if(this._value==="rgb")H.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;H.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?H.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&H.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return oe.fromColor(t,On.getCartesian4())};Ct.prototype._evaluateLiteralVector=function(e){let t=On.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof z)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof oe)t.push(c.x,c.y,c.z,c.w);else throw new re(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new re(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new re(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new re(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return z.fromArray(t,0,On.getCartesian2());if(n==="vec3")return h.fromArray(t,0,On.getCartesian3());if(n==="vec4")return oe.fromArray(t,0,On.getCartesian4())};Ct.prototype._evaluateLiteralString=function(){return this._value};Ct.prototype._evaluateVariableString=function(e){let t=this._value,n=vU.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=PU(e,o);l(r)||(r=""),t=t.replace(i,r),n=vU.exec(t)}return t};Ct.prototype._evaluateVariable=function(e){return PU(e,this._value)};function tb(e){return e._value==="feature"}Ct.prototype._evaluateMemberDot=function(e){if(tb(this._left))return PU(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof z||t instanceof h||t instanceof oe){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Ct.prototype._evaluateMemberBrackets=function(e){if(tb(this._left))return PU(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof z||t instanceof h||t instanceof oe){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Ct.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Ct.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Ct.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof z)return z.negate(t,On.getCartesian2());if(t instanceof h)return h.negate(t,On.getCartesian3());if(t instanceof oe)return oe.negate(t,On.getCartesian4());if(typeof t=="number")return-t;throw new re(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Ct.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof z||t instanceof h||t instanceof oe||typeof t=="number"))throw new re(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Ct.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Ct.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Ct.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Ct.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Ct.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new re(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Ct.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new re(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Ct.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.add(t,n,On.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,On.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.add(t,n,On.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new re(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.subtract(t,n,On.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,On.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.subtract(t,n,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new re(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.multiplyComponents(t,n,On.getCartesian2());if(n instanceof z&&typeof t=="number")return z.multiplyByScalar(n,t,On.getCartesian2());if(t instanceof z&&typeof n=="number")return z.multiplyByScalar(t,n,On.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,On.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,On.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,On.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.multiplyComponents(t,n,On.getCartesian4());if(n instanceof oe&&typeof t=="number")return oe.multiplyByScalar(n,t,On.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.multiplyByScalar(t,n,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new re(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.divideComponents(t,n,On.getCartesian2());if(t instanceof z&&typeof n=="number")return z.divideByScalar(t,n,On.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,On.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,On.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.divideComponents(t,n,On.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.divideByScalar(t,n,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new re(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.fromElements(t.x%n.x,t.y%n.y,On.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,On.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new re(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof h&&t instanceof h||n instanceof oe&&t instanceof oe?t.equals(n):t===n};Ct.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof h&&t instanceof h||n instanceof oe&&t instanceof oe?!t.equals(n):t!==n};Ct.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new re(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Ct.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Ct.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Ct.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Ct.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Ct.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Ct.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Ct.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Ct.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Ct.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new re(o)}return i};Ct.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new re(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Ct.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new re(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new re(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new re(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Ct.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof z||t instanceof h||t instanceof oe)return String(t);throw new re(`Unexpected function call "${this._value}".`)};function Koe(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==mt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return H.fromHsl(i,o,r,s,wU)}function Zoe(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==mt.LITERAL_NUMBER)return;let i=wU;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function ry(e){return e%1===0?e.toFixed(1):e.toString()}function lBe(e){let t=ry(e.red),n=ry(e.green),i=ry(e.blue);return`vec3(${t}, ${n}, ${i})`}function SU(e){let t=ry(e.red),n=ry(e.green),i=ry(e.blue),o=ry(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function $oe(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function Qoe(e,t){return l(t[e])?t[e]:Zd.NULL_SENTINEL}Zd.NULL_SENTINEL="czm_infinity";Ct.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=$oe(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=$oe(this._value,e,t,this));let u,f,d;switch(a){case mt.VARIABLE:return tb(this)?void 0:Qoe(c,e);case mt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(DU[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new re(`Error generating style shader: "${c}" is not supported.`);return c+o;case mt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(IU[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case mt.TERNARY:if(l(K9[c]))return`${c}(${o}, ${r}, ${s})`;break;case mt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case mt.MEMBER:return tb(this._left)?Qoe(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case mt.FUNCTION_CALL:throw new re(`Error generating style shader: "${c}" is not supported.`);case mt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new re("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case mt.REGEX:throw new re("Error generating style shader: Regular expressions are not supported.");case mt.VARIABLE_IN_STRING:throw new re("Error generating style shader: Converting a variable to a string is not supported.");case mt.LITERAL_NULL:return Zd.NULL_SENTINEL;case mt.LITERAL_BOOLEAN:return c?"true":"false";case mt.LITERAL_NUMBER:return ry(c);case mt.LITERAL_STRING:if(l(n)&&n._type===mt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||tb(n._left)))return c;if(i=H.fromCssColorString(c,wU),l(i))return lBe(i);throw new re("Error generating style shader: String literals are not supported.");case mt.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Zoe(this),l(i)?SU(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Zoe(this),l(i)?SU(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=Koe(this),l(i)?SU(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=Koe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),SU(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case mt.LITERAL_VECTOR:f=o.length,d=`${c}(`;for(let p=0;p<f;++p)d+=o[p],p<f-1&&(d+=", ");return d+=")",d;case mt.LITERAL_REGEX:throw new re("Error generating style shader: Regular expressions are not supported.");case mt.LITERAL_UNDEFINED:return Zd.NULL_SENTINEL;case mt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Ct.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case mt.VARIABLE:tb(this)||e.push(s);break;case mt.VARIABLE_IN_STRING:for(a=vU.exec(s);a!==null;)e.push(a[1]),a=vU.exec(s);break;case mt.LITERAL_STRING:l(t)&&t._type===mt.MEMBER&&tb(t._left)&&e.push(s);break}};var Mf=Zd;function Zp(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,h.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=H.clone(H.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,Vn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(Zp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var uBe={position:0,a_batchId:1};function fBe(e,t){if(l(e._va))return;let n=gt.createVertexBuffer({context:t,typedArray:e._positions,usage:Fe.STATIC_DRAW}),i=gt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Fe.STATIC_DRAW}),o=gt.createIndexBuffer({context:t,typedArray:e._indices,usage:Fe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:X.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:X.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new ei({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ei({context:t,attributes:r,indexBuffer:gt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Fe.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function dBe(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,uBe),o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Ue.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() -{ - czm_non_pick_main(); - out_FragColor = ${o}; -} -`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(fA),c=n.getFragmentShaderCallback(!1,void 0,!0)(Yg);o=n.getPickId();let u=new Ue({sources:[a]}),f=new Ue({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Ue({sources:[fA]}),f=new Ue({defines:["VECTOR_TILE"],sources:[Yg]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Ue.replaceMain(c,"czm_non_pick_main"),c=`${c} -void main() -{ - czm_non_pick_main(); - out_FragColor = ${o}; -} -`;let d=new Ue({sources:[a]}),p=new Ue({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function Joe(e){let t=e?Un.EQUAL:Un.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:dt.KEEP,zFail:dt.DECREMENT_WRAP,zPass:dt.KEEP},backFunction:t,backOperation:{fail:dt.KEEP,zFail:dt.INCREMENT_WRAP,zPass:dt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ac.LESS_OR_EQUAL},depthMask:!1}}var hBe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},mBe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function pBe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(Joe(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(Joe(!0)),e._rsColorPass=Ve.fromCache(hBe),e._rsPickPass=Ve.fromCache(mBe))}var nb=new F,ere=new h;function _Be(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return F.clone(i,nb),F.multiplyByPoint(nb,e._center,ere),F.setTranslation(nb,ere,nb),F.multiply(o,nb,nb),nb},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function Z9(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=s[f],p=i[d],g=o[d],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[d]=n,n+=g}return n}function gBe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=Z9(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(H.equals(f.color,a.color))u=Z9(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=Z9(n,s,u,i,o,f.batchIds,r),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function $9(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],d=s[f],p=i[d],g=o[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function yBe(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=$9(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let d=t.pop();if(H.equals(d.color,r.color))u=$9(a,c,u,n,i,d.batchIds,o),r.batchIds=r.batchIds.concat(d.batchIds),r.count=u-r.offset;else{let p=u;u=$9(a,c,u,n,i,d.batchIds,o),d.offset=p,d.count=u-p,s.push(d),r=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function xBe(e,t){return t.color.toRgba()-e.color.toRgba()}function bBe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(xBe),t.webgl2?yBe(e,n):gBe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function TBe(e,t){let n=bBe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=y(e._modelMatrix,F.IDENTITY),f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,m=o[p].count,x=i[p*2];l(x)||(x=i[p*2]=new Ze({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=g,x.count=m,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=f,x.boundingVolume=d,x.cull=!1,x.pass=we.TERRAIN_CLASSIFICATION;let b=Ze.shallowClone(x,x.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=we.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=b;let T=i[p*2+1];l(T)||(T=i[p*2+1]=new Ze({owner:e})),T.vertexArray=a,T.modelMatrix=u,T.offset=g,T.count=m,T.renderState=e._rsColorPass,T.shaderProgram=c,T.uniformMap=f,T.boundingVolume=d,T.cull=!1,T.pass=we.TERRAIN_CLASSIFICATION;let C=Ze.shallowClone(T,T.derivedCommands.tileset);C.pass=we.CESIUM_3D_TILE_CLASSIFICATION,T.derivedCommands.tileset=C}e._commandsDirty=!0}function CBe(e,t){if(e.classificationType===Vn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let u=i[c]=Ze.shallowClone(n[a],i[c]);u.shaderProgram=o,u.pass=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function ABe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=y(e._modelMatrix,F.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new Ze({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=d,p.pass=we.TERRAIN_CLASSIFICATION;let g=Ze.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=we.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new Ze({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=a,m.boundingVolume=d,m.pass=we.TERRAIN_CLASSIFICATION;let x=Ze.shallowClone(m,m.derivedCommands.tileset);x.pass=we.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=x}e._pickCommandsDirty=!1}Zp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ws(e,r)}};Zp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function EBe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=H.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=H.clone(H.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var SBe=new H,vBe=H.WHITE,wBe=!0,DBe=/\$/;Zp.prototype.applyStyle=function(e,t){if(!l(e)){EBe(this,t);return}let n=e.color,i=n instanceof Mf&&!DBe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,SBe):vBe,c.show=l(e.show)?e.show.evaluate(c):wBe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=H.clone(H.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Zp.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let x=c[f].offset,b=c[f].count;if(s>=x&&s<x+b)break}c.push(new _m({color:H.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let x=0;x<m;++x){let b=g[x];if(b===e)continue;let T=n[b];o[T]<s?d.push(b):p.push(b)}p.length!==0&&c.push(new _m({color:H.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function tre(e,t,n,i){let o=e.classificationType,r=o!==Vn.CESIUM_3D_TILE,s=o!==Vn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=we.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=we.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function IBe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=we.OPAQUE,n.push(r)}}function PBe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Me.LINES):(n=e._rsColorPass,i=Me.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}Zp.prototype.update=function(e){let t=e.context;fBe(this,t),dBe(this,t),pBe(this),_Be(this,t);let n=e.passes;n.render&&(TBe(this,t),CBe(this,e),PBe(this),this._debugWireframe?IBe(e,this._commands):tre(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(ABe(this),tre(this,e,this._pickCommands))};Zp.prototype.isDestroyed=function(){return!1};Zp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var ib=Zp;function Eu(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Vn.BOTH}Object.defineProperties(Eu.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});Eu.packedBoxLength=F.packedLength+h.packedLength;Eu.packedCylinderLength=F.packedLength+2;Eu.packedEllipsoidLength=F.packedLength+h.packedLength;Eu.packedSphereLength=h.packedLength+1;function RBe(e){let t=new Float64Array(F.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,F.pack(e._modelMatrix,t,n),t}function OBe(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=ae.unpack(t,n),n+=ae.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=H.unpack(t,n);n+=H.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[c]=new _m({color:u,offset:f,count:d,batchIds:g})}return i}var MBe=new _i("createVectorTileGeometries",5),LBe=new H;function NBe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let x=e._batchTable;for(let b=0;b<m;++b){let T=x.getColor(b,LBe);u[b]=T.toRgba()}f=e._packedBuffer=RBe(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,o.buffer),l(r)&&d.push(r.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=MBe.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let x=new Float64Array(m.packedBuffer);OBe(e,x)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),FBe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function FBe(e){l(e._primitive)||(e._primitive=new ib({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}Eu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Eu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Eu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Eu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Eu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=NBe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Eu.prototype.isDestroyed=function(){return!1};Eu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var $p=Eu;function gm(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,VBe(this,i,o)}Object.defineProperties(gm.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function BBe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function kBe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(d&&p)throw new re("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=m++;if(!l(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var ob=Uint32Array.BYTES_PER_ELEMENT;function VBe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=ob;let r=o.getUint32(n,!0);if(r!==1)throw new re(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=ob;let s=o.getUint32(n,!0);if(n+=ob,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=ob,a===0)throw new re("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=ob;let u=o.getUint32(n,!0);n+=ob;let f=o.getUint32(n,!0);n+=ob;let d=No(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=No(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let x=y(d.BOXES_LENGTH,0),b=y(d.CYLINDERS_LENGTH,0),T=y(d.ELLIPSOIDS_LENGTH,0),C=y(d.SPHERES_LENGTH,0),A=x+b+T+C,E=new Kp(e,A,g,m,BBe(e));if(e._batchTable=E,A===0)return;let v=e.tile.computedTransform,D;l(d.RTC_CENTER)&&(D=h.unpack(d.RTC_CENTER),F.multiplyByPoint(v,D,D));let O=kBe(d,p);if(x>0||b>0||T>0||C>0){let R,M,N,_;if(x>0){let S=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,S,$p.packedBoxLength*x)}if(b>0){let S=p.byteOffset+d.CYLINDERS.byteOffset;M=new Float32Array(p.buffer,S,$p.packedCylinderLength*b)}if(T>0){let S=p.byteOffset+d.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,S,$p.packedEllipsoidLength*T)}if(C>0){let S=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,S,$p.packedSphereLength*C)}return e._geometries=new $p({boxes:R,boxBatchIds:O.boxes,cylinders:M,cylinderBatchIds:O.cylinders,ellipsoids:N,ellipsoidBatchIds:O.ellipsoids,spheres:_,sphereBatchIds:O.spheres,center:D,modelMatrix:v,batchTable:E,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function nre(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}gm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};gm.prototype.getFeature=function(e){return nre(this),this._features[e]};gm.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};gm.prototype.applyStyle=function(e){nre(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};gm.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};gm.prototype.pick=function(e,t,n){};gm.prototype.isDestroyed=function(){return!1};gm.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var CR=gm;var Q9={};Q9.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),ire(i,o,r,s);return c};Q9.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),ire(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function ire(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var vA=Q9;var rb=30,UBe=1<<rb,zBe=1<<rb+1>>>0,J9=2*rb+1,sy=4,sre=[],are=[],HBe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],ay=1,wA=2,RU=[ay,0,0,ay|wA];function ts(e){if(!Ht.supportsBigInt())throw new re("S2 required BigInt support");this._cellId=e,this._level=ts.getLevel(e)}ts.fromToken=function(e){return new ts(ts.getIdFromToken(e))};ts.isValidId=function(e){return!(e<=0||e>>BigInt(J9)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ts.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?ts.isValidId(ts.getIdFromToken(e)):!1};ts.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};ts.getTokenFromId=function(e){let t=Math.floor(QBe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ts.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return rb-(t>>1)};ts.prototype.getChild=function(e){let t=ure(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ts(n)};ts.prototype.getParent=function(){let e=ure(this._cellId)<<BigInt(2);return new ts(this._cellId&~e+BigInt(1)|e)};ts.prototype.getParentAtLevel=function(e){let t=ZBe(e);return new ts(this._cellId&-t|t)};ts.prototype.getCenter=function(e){e=y(e,ee.WGS84);let t=GBe(this._cellId,this._level);t=h.normalize(t,t);let n=new fe.fromCartesian(t,ee.UNIT_SPHERE);return fe.toCartesian(n,e,new h)};ts.prototype.getVertex=function(e,t){t=y(t,ee.WGS84);let n=WBe(this._cellId,this._level,e);n=h.normalize(n,n);let i=new fe.fromCartesian(n,ee.UNIT_SPHERE);return fe.toCartesian(i,t,new h)};ts.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(J9-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new ts(a)};function GBe(e,t){let n=jBe(e,t);return qBe(n[0],n[1],n[2])}function WBe(e,t,n){let i=cre(e,t),o=YBe([i[1],i[2]],t),r=n>>1&1;return lre(i[0],o[0][r^n&1],o[1][r])}function jBe(e,t){let n=cre(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function cre(e){sre.length===0&&KBe();let t=Number(e>>BigInt(J9)),n=t&ay,i=(1<<sy)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?rb-7*sy:sy))-1;n+=Number(e>>BigInt(s*2*sy+1)&BigInt(c))<<2,n=are[n];let u=s*sy;o+=n>>sy+2<<u,r+=(n>>2&i)<<u,n&=ay|wA}return[t,o,r]}function qBe(e,t,n){let i=ore(t),o=ore(n),r=OU(i),s=OU(o);return lre(e,r,s)}function lre(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function OU(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function ore(e){return 1/zBe*e}function YBe(e,t){let n=[[],[]],i=XBe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=OU(rre(r)),n[o][1]=OU(rre(s))}return n}function XBe(e){return 1<<rb-e>>>0}function rre(e){return 1/UBe*e}function cy(e,t,n,i,o,r){if(e===sy){let s=(t<<sy)+n;sre[(s<<2)+i]=(o<<2)+r,are[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=HBe[r];cy(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^RU[0]),cy(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^RU[1]),cy(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^RU[2]),cy(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^RU[3])}}function KBe(){cy(0,0,0,0,0,0),cy(0,0,0,ay,0,ay),cy(0,0,0,wA,0,wA),cy(0,0,0,ay|wA,0,ay|wA)}function ure(e){return e&~e+BigInt(1)}function ZBe(e){return BigInt(1)<<BigInt(2*(rb-e))}var $Be=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function QBe(e){return $Be[(-e&e)%BigInt(67)]}var Qp=ts;function JBe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ii=JBe;function eW(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new re(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=e3e(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function e3e(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(eW.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});eW.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var DA=eW;function Jp(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Jp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Jp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Jp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Jp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Jp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Jp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Jp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var IA=Jp;var MU={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};MU.getBranchingFactor=function(e){switch(e){case MU.OCTREE:return 8;case MU.QUADTREE:return 4}};var ns=Object.freeze(MU);function ua(){}Object.defineProperties(ua.prototype,{class:{get:function(){he.throwInstantiationError()}}});ua.prototype.hasProperty=function(e){he.throwInstantiationError()};ua.prototype.hasPropertyBySemantic=function(e){he.throwInstantiationError()};ua.prototype.getPropertyIds=function(e){he.throwInstantiationError()};ua.prototype.getProperty=function(e){he.throwInstantiationError()};ua.prototype.setProperty=function(e,t){he.throwInstantiationError()};ua.prototype.getPropertyBySemantic=function(e){he.throwInstantiationError()};ua.prototype.setPropertyBySemantic=function(e,t){he.throwInstantiationError()};ua.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};ua.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};ua.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};ua.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ge(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ua.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};ua.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return ua.getProperty(o.id,t,n)};ua.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?ua.setProperty(r.id,t,n,i):!1};var Fn=ua;function e_(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(e_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});e_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};e_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};e_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};e_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};e_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};e_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};e_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var AR=e_;var Ft={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Ft.getMinimum=function(e){switch(e){case Ft.INT8:return-128;case Ft.UINT8:return 0;case Ft.INT16:return-32768;case Ft.UINT16:return 0;case Ft.INT32:return-2147483648;case Ft.UINT32:return 0;case Ft.INT64:return Ht.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Ft.UINT64:return Ht.supportsBigInt()?BigInt(0):0;case Ft.FLOAT32:return-34028234663852886e22;case Ft.FLOAT64:return-Number.MAX_VALUE}};Ft.getMaximum=function(e){switch(e){case Ft.INT8:return 127;case Ft.UINT8:return 255;case Ft.INT16:return 32767;case Ft.UINT16:return 65535;case Ft.INT32:return 2147483647;case Ft.UINT32:return 4294967295;case Ft.INT64:return Ht.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Ft.UINT64:return Ht.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Ft.FLOAT32:return 34028234663852886e22;case Ft.FLOAT64:return Number.MAX_VALUE}};Ft.isIntegerType=function(e){switch(e){case Ft.INT8:case Ft.UINT8:case Ft.INT16:case Ft.UINT16:case Ft.INT32:case Ft.UINT32:case Ft.INT64:case Ft.UINT64:return!0;default:return!1}};Ft.isUnsignedIntegerType=function(e){switch(e){case Ft.UINT8:case Ft.UINT16:case Ft.UINT32:case Ft.UINT64:return!0;default:return!1}};Ft.isVectorCompatible=function(e){switch(e){case Ft.INT8:case Ft.UINT8:case Ft.INT16:case Ft.UINT16:case Ft.INT32:case Ft.UINT32:case Ft.FLOAT32:case Ft.FLOAT64:return!0;default:return!1}};Ft.normalize=function(e,t){return Math.max(Number(e)/Number(Ft.getMaximum(t)),-1)};Ft.unnormalize=function(e,t){let n=Ft.getMaximum(t),i=Ft.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Ft.INT64||t===Ft.UINT64)&&Ht.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Ft.applyValueTransform=function(e,t,n){return n*e+t};Ft.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Ft.getSizeInBytes=function(e){switch(e){case Ft.INT8:case Ft.UINT8:return 1;case Ft.INT16:case Ft.UINT16:return 2;case Ft.INT32:case Ft.UINT32:return 4;case Ft.INT64:case Ft.UINT64:return 8;case Ft.FLOAT32:return 4;case Ft.FLOAT64:return 8}};Ft.fromComponentDatatype=function(e){switch(e){case X.BYTE:return Ft.INT8;case X.UNSIGNED_BYTE:return Ft.UINT8;case X.SHORT:return Ft.INT16;case X.UNSIGNED_SHORT:return Ft.UINT16;case X.INT:return Ft.INT32;case X.UNSIGNED_INT:return Ft.UINT32;case X.FLOAT:return Ft.FLOAT32;case X.DOUBLE:return Ft.FLOAT64}};Ft.toComponentDatatype=function(e){switch(e){case Ft.INT8:return X.BYTE;case Ft.UINT8:return X.UNSIGNED_BYTE;case Ft.INT16:return X.SHORT;case Ft.UINT16:return X.UNSIGNED_SHORT;case Ft.INT32:return X.INT;case Ft.UINT32:return X.UNSIGNED_INT;case Ft.FLOAT32:return X.FLOAT;case Ft.FLOAT64:return X.DOUBLE}};var Vt=Object.freeze(Ft);var Go={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Go.isVectorType=function(e){switch(e){case Go.VEC2:case Go.VEC3:case Go.VEC4:return!0;default:return!1}};Go.isMatrixType=function(e){switch(e){case Go.MAT2:case Go.MAT3:case Go.MAT4:return!0;default:return!1}};Go.getComponentCount=function(e){switch(e){case Go.SCALAR:case Go.STRING:case Go.ENUM:case Go.BOOLEAN:return 1;case Go.VEC2:return 2;case Go.VEC3:return 3;case Go.VEC4:return 4;case Go.MAT2:return 4;case Go.MAT3:return 9;case Go.MAT4:return 16}};Go.getMathType=function(e){switch(e){case Go.VEC2:return z;case Go.VEC3:return h;case Go.VEC4:return oe;case Go.MAT2:return Ii;case Go.MAT3:return $;case Go.MAT4:return F;default:return}};var lt=Object.freeze(Go);function La(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&Vt.isIntegerType(i)&&y(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=Ge(e.min,!0),this._max=Ge(e.max,!0),this._normalized=r;let s=Ge(e.offset,!0),a=Ge(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ge(e.noData,!0),this._default=Ge(e.default,!0),this._required=y(e.required,!0),this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}La.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=t3e(n),o=n3e(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=y(n.required,!1):r=!1,new La({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(La.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function t3e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===lt.SCALAR||lt.isMatrixType(t)||lt.isVectorType(t))return!1;if(l(Vt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function n3e(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===lt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===lt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===lt.SCALAR||lt.isMatrixType(n)||lt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===lt.BOOLEAN||n===lt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===lt.BOOLEAN||i===lt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Vt[i]))return{type:lt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(Vt[n]))return{type:lt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}La.prototype.normalize=function(e){return this._normalized?tW(e,this._valueType,Vt.normalize):e};La.prototype.unnormalize=function(e){return this._normalized?tW(e,this._valueType,Vt.unnormalize):e};La.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:La.valueTransformInPlace(e,this._offset,this._scale,Vt.applyValueTransform)};La.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:La.valueTransformInPlace(e,this._offset,this._scale,Vt.unapplyValueTransform)};La.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,o=lt.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};La.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!mre(e,t))return e};function mre(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!mre(e[n],t[n]))return!1;return!0}La.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=lt.getMathType(this._type),i=this._isArray,o=lt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};La.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=lt.getMathType(this._type),i=this._isArray,o=lt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};La.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?i3e(this,e):pre(this,e)};function i3e(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=pre(e,t[i]);if(l(o))return o}}function pre(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return lt.isVectorType(n)?o3e(t,n,i):lt.isMatrixType(n)?r3e(t,n,i):n===lt.STRING?s3e(t):n===lt.BOOLEAN?a3e(t):n===lt.ENUM?c3e(t,o):l3e(t,i,r)}function o3e(e,t,n){if(!Vt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===lt.VEC2&&!(e instanceof z))return`vector value ${e} must be a Cartesian2`;if(t===lt.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===lt.VEC4&&!(e instanceof oe))return`vector value ${e} must be a Cartesian4`}function r3e(e,t,n){if(!Vt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===lt.MAT2&&!(e instanceof Ii))return`matrix value ${e} must be a Matrix2`;if(t===lt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===lt.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function s3e(e){if(typeof e!="string")return LU(e,lt.STRING)}function a3e(e){if(typeof e!="boolean")return LU(e,lt.BOOLEAN)}function c3e(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function l3e(e,t,n){let i=typeof e;switch(t){case Vt.INT8:case Vt.UINT8:case Vt.INT16:case Vt.UINT16:case Vt.INT32:case Vt.UINT32:case Vt.FLOAT32:case Vt.FLOAT64:return i!=="number"?LU(e,t):isFinite(e)?dre(e,t,n):hre(e,t);case Vt.INT64:case Vt.UINT64:return i!=="number"&&i!=="bigint"?LU(e,t):i==="number"&&!isFinite(e)?hre(e,t):dre(e,t,n)}}function LU(e,t){return`value ${e} does not match type ${t}`}function fre(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function dre(e,t,n){if(n){let i=Vt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?fre(e,t,n):void 0}if(e<Vt.getMinimum(t)||e>Vt.getMaximum(t))return fre(e,t,n)}function hre(e,t){return`value ${e} of type ${t} must be finite`}function tW(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=tW(e[i],t,n);return e}La.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=La.valueTransformInPlace(e[o],t[o],n[o],i);return e};var ym=La;function ER(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=r===lt.STRING,d=r===lt.BOOLEAN,p=0,g;if(a){let _=y(n.arrayOffsetType,n.offsetType);_=y(Vt[_],Vt.UINT32);let S=y(n.arrayOffsets,n.arrayOffsetBufferView);g=new nW(o[S],_,t+1),p+=g.typedArray.byteLength}let m=lt.getComponentCount(r),x;a?x=g.get(t)-g.get(0):s?x=t*i.arrayLength:x=t;let b=m*x,T;if(f){let _=y(n.stringOffsetType,n.offsetType);_=y(Vt[_],Vt.UINT32);let S=y(n.stringOffsets,n.stringOffsetBufferView);T=new nW(o[S],_,b+1),p+=T.typedArray.byteLength}(f||d)&&(c=Vt.UINT8);let C;f?C=T.get(b)-T.get(0):d?C=Math.ceil(b/8):C=b;let A=y(n.values,n.bufferView),E=new nW(o[A],c,C);p+=E.typedArray.byteLength;let v=n.offset,D=n.scale,O=i.hasValueTransform||l(v)||l(D);v=y(v,i.offset),D=y(D,i.scale),v=_re(v),D=_re(D);let R,M,N=this;f?R=function(_){return d3e(_,N._values,N._stringOffsets)}:d?(R=function(_){return h3e(_,N._values)},M=function(_,S){m3e(_,N._values,S)}):l(u)?(R=function(_){let S=N._values.get(_);return u.namesByValue[S]},M=function(_,S){let w=u.valuesByName[S];N._values.set(_,w)}):(R=function(_){return N._values.get(_)},M=function(_,S){N._values.set(_,S)}),this._arrayOffsets=g,this._stringOffsets=T,this._values=E,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=D,this._hasValueTransform=O,this._getValue=R,this._setValue=M,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(ER.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});ER.prototype.get=function(e){let t=u3e(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=C3e(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};ER.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=A3e(this,t),t=n.unnormalize(t),f3e(this,e,t)};ER.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function _re(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function u3e(e,t){yre(e)&&xre(e);let n=e._classProperty,i=n.isArray,o=n.type,r=lt.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ge(s,!0):s}return!i&&r===1?e._getValue(t):gre(e,n,t)}function gre(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=lt.getComponentCount(t.type);i*=s,o*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function f3e(e,t,n){b3e(e,t,n)&&xre(e);let i=e._classProperty,o=i.isArray,r=i.type,s=lt.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Ge(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=y(i.arrayLength,1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function d3e(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Ll(t.typedArray,i,o)}function h3e(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function m3e(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function p3e(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function _3e(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function g3e(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function y3e(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function x3e(e){switch(e){case Vt.INT8:return X.BYTE;case Vt.UINT8:return X.UNSIGNED_BYTE;case Vt.INT16:return X.SHORT;case Vt.UINT16:return X.UNSIGNED_SHORT;case Vt.INT32:return X.INT;case Vt.UINT32:return X.UNSIGNED_INT;case Vt.FLOAT32:return X.FLOAT;case Vt.FLOAT64:return X.DOUBLE}}function yre(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===lt.STRING||i===Vt.INT64&&!Ht.supportsBigInt64Array()||i===Vt.UINT64&&!Ht.supportsBigUint64Array()}function b3e(e,t,n){if(yre(e))return!0;let i=e._arrayOffsets;if(l(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function xre(e){e._unpackedValues=T3e(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function T3e(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=lt.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=gre(e,i,a);return n}function C3e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:ym.valueTransformInPlace(t,e._offset,e._scale,Vt.applyValueTransform)}function A3e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:ym.valueTransformInPlace(t,e._offset,e._scale,Vt.unapplyValueTransform)}function nW(e,t,n){let i=this,o,r,s;if(t===Vt.INT64)Ht.supportsBigInt()?Ht.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return _3e(a,i)}):(yt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return p3e(a,i)});else if(t===Vt.UINT64)Ht.supportsBigInt()?Ht.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return y3e(a,i)}):(yt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return g3e(a,i)});else{let a=x3e(t);o=X.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var SR=ER;function $d(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new SR({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties($d.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});$d.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};$d.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};$d.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};$d.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=E3e(this._class,t),i};$d.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};$d.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};$d.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return l(o)&&(i=o[t]),l(i)?this.setProperty(e,i.id,n):!1};$d.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};$d.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function E3e(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let o=i.default;return i.isArray&&(o=Ge(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Bl=$d;function ly(){}Object.defineProperties(ly.prototype,{cacheKey:{get:function(){he.throwInstantiationError()}}});ly.prototype.load=function(){he.throwInstantiationError()};ly.prototype.unload=function(){};ly.prototype.process=function(e){return!1};ly.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=` -${t.message}`);let n=new re(e);return l(t)&&(n.stack=`Original stack: -${t.stack} -Handler stack: -${n.stack}`),n};ly.prototype.isDestroyed=function(){return!1};ly.prototype.destroy=function(){return this.unload(),ue(this)};var Ki=ly;var S3e={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},pt=Object.freeze(S3e);function t_(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(t_.prototype=Object.create(Ki.prototype),t_.prototype.constructor=t_);Object.defineProperties(t_.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});t_.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=v3e(this),this._promise)};async function v3e(e){let t=e._resource;e._state=pt.LOADING;try{let n=await t_._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=pt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=pt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}t_._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};t_.prototype.unload=function(){this._typedArray=void 0};var sb=t_;var vre=Ko(Sre(),1);function ab(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,d=!1,p,g,m,x;if(ii(a,"EXT_meshopt_compression")){let T=a.extensions.EXT_meshopt_compression;c=T.buffer,u=y(T.byteOffset,0),f=T.byteLength,d=!0,p=T.byteStride,g=T.count,m=T.mode,x=y(T.filter,"NONE")}let b=n.buffers[c];this._hasMeshopt=d,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=m,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=b,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(ab.prototype=Object.create(Ki.prototype),ab.prototype.constructor=ab);Object.defineProperties(ab.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function R3e(e){try{let t=O3e(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);vre.MeshoptDecoder.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=pt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load buffer view",t)}}ab.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,this._promise=R3e(this),this._promise)};function O3e(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}ab.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var PA=ab;function kr(){}kr._maxDecodingConcurrency=Math.max(Ht.hardwareConcurrency-1,1);kr._decoderTaskProcessor=void 0;kr._taskProcessorReady=!1;kr._error=void 0;kr._getDecoderTaskProcessor=function(){if(!l(kr._decoderTaskProcessor)){let e=new _i("decodeDraco",kr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?kr._taskProcessorReady=!0:kr._error=new re("Draco decoder could not be initialized.")}).catch(t=>{kr._error=t}),kr._decoderTaskProcessor=e}return kr._decoderTaskProcessor};kr.decodePointCloud=function(e){let t=kr._getDecoderTaskProcessor();if(l(kr._error))throw kr._error;if(kr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};kr.decodeBufferView=function(e){let t=kr._getDecoderTaskProcessor();if(l(kr._error))throw kr._error;if(kr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var n_=kr;function uy(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=pt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(uy.prototype=Object.create(Ki.prototype),uy.prototype.constructor=uy);Object.defineProperties(uy.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function M3e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=pt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;wre(e,n)}}uy.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,this._promise=M3e(this),this._promise)};function wre(e,t){throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load Draco",t)}async function L3e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=pt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}uy.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.PROCESSING||(l(this._dracoError)&&wre(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=n_.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=L3e(this,c)};uy.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var RA=uy;function N3e(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Se.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Se.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Se({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var cb=N3e;function i_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(i_.prototype=Object.create(Ki.prototype),i_.prototype.constructor=i_);Object.defineProperties(i_.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});i_.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=F3e(this),this._promise):(this._promise=B3e(this),this._promise)};function Dre(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function F3e(e){e._state=pt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await V3e(i);if(e.isDestroyed())return;let r=Dre(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=pt.READY,e}catch(n){return e.isDestroyed()?void 0:Ire(e,n,"Failed to load embedded image")}}async function B3e(e){e._state=pt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await z3e(i);if(e.isDestroyed())return;let r=Dre(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=pt.READY,e}catch(o){return e.isDestroyed()?void 0:Ire(e,o,`Failed to load image: ${n}`)}}function Ire(e,t,n){return e.unload(),e._state=pt.FAILED,Promise.reject(e.getError(n,t))}function k3e(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new re("Image format is not recognized")}async function V3e(e){let t=k3e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Dl(n)}return i_._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var U3e=/(^data:image\/ktx2)|(\.ktx2$)/i;function z3e(e){let t=e.getUrlComponent(!1,!0);return U3e.test(t)?Dl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}i_.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};i_._loadImageFromTypedArray=cb;var OA=i_;var H3e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Na=Object.freeze(H3e);function fy(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),d=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=d,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(fy.prototype=Object.create(Ki.prototype),fy.prototype.constructor=fy);Object.defineProperties(fy.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var G3e=new cW;fy.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=W3e(this),this._promise):(this._promise=j3e(this),this._promise)};async function W3e(e){e._state=pt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=pt.LOADED,e)}catch(n){if(e.isDestroyed())return;aW(e,n)}}async function j3e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=pt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=q3e(e,a),e._state=pt.PROCESSING,e}catch(s){if(e.isDestroyed())return;aW(e,s)}}function q3e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ne.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let d=r*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,ms("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Ne.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):s===Ne.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):s===Ne.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function aW(e,t){throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load index buffer",t)}function cW(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}cW.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};cW.prototype.execute=function(){this.buffer=Pre(this.typedArray,this.indexDatatype,this.context)};function Pre(e,t,n){let i=gt.createIndexBuffer({typedArray:e,context:n,usage:Fe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}fy.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.LOADED&&this._state!==pt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=X.fromTypedArray(t),this._indexDatatype=n)}catch(o){aW(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=G3e;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Na.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=Pre(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=pt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};fy.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var MA=fy;function Y3e(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var vs=Y3e;function X3e(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var lr=X3e;function qt(){}qt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};qt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(l(r))return r}}};qt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?qt.objectLegacy(i,n):qt.object(i,n)};qt.accessor=function(e,t){return qt.topLevel(e,"accessors",t)};qt.accessorWithSemantic=function(e,t,n){let i={};return qt.mesh(e,function(o){return qt.meshPrimitive(o,function(r){let s=qt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:qt.meshPrimitiveTarget(r,function(a){return qt.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};qt.accessorContainingVertexAttributeData=function(e,t){let n={};return qt.mesh(e,function(i){return qt.meshPrimitive(i,function(o){let r=qt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:qt.meshPrimitiveTarget(o,function(s){return qt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};qt.accessorContainingIndexData=function(e,t){let n={};return qt.mesh(e,function(i){return qt.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let s=t(r);if(l(s))return s}})})};qt.animation=function(e,t){return qt.topLevel(e,"animations",t)};qt.animationChannel=function(e,t){let n=e.channels;return qt.object(n,t)};qt.animationSampler=function(e,t){let n=e.samplers;return qt.object(n,t)};qt.buffer=function(e,t){return qt.topLevel(e,"buffers",t)};qt.bufferView=function(e,t){return qt.topLevel(e,"bufferViews",t)};qt.camera=function(e,t){return qt.topLevel(e,"cameras",t)};qt.image=function(e,t){return qt.topLevel(e,"images",t)};qt.material=function(e,t){return qt.topLevel(e,"materials",t)};qt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};qt.mesh=function(e,t){return qt.topLevel(e,"meshes",t)};qt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(l(s))return s}}};qt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};qt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(l(r))return r}}};qt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};qt.node=function(e,t){return qt.topLevel(e,"nodes",t)};qt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=qt.nodeInTree(e,u,n),l(c)))return c}}}};qt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return qt.nodeInTree(e,i,n)};qt.program=function(e,t){return lr(e,"KHR_techniques_webgl")?qt.object(e.extensions.KHR_techniques_webgl.programs,t):qt.topLevel(e,"programs",t)};qt.sampler=function(e,t){return qt.topLevel(e,"samplers",t)};qt.scene=function(e,t){return qt.topLevel(e,"scenes",t)};qt.shader=function(e,t){return lr(e,"KHR_techniques_webgl")?qt.object(e.extensions.KHR_techniques_webgl.shaders,t):qt.topLevel(e,"shaders",t)};qt.skin=function(e,t){return qt.topLevel(e,"skins",t)};qt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(l(s))return s}}};qt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};qt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};qt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};qt.technique=function(e,t){return lr(e,"KHR_techniques_webgl")?qt.object(e.extensions.KHR_techniques_webgl.techniques,t):qt.topLevel(e,"techniques",t)};qt.texture=function(e,t){return qt.topLevel(e,"textures",t)};var Pe=qt;function K3e(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var Su=K3e;function Z3e(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return X.getSizeInBytes(t.componentType)*Su(t.type)}var kl=Z3e;function $3e(e){Pe.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Pe.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){if(i.mode=y(i.mode,te.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=vs(e.materials,o)}})}),Pe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=kl(e,i),r.target=te.ARRAY_BUFFER}}),Pe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=te.ELEMENT_ARRAY_BUFFER}}),Pe.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&Pe.materialValue(n,function(c){l(c.index)&&lb(c)}),lb(n.emissiveTexture),lb(n.normalTexture),lb(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),lb(s.baseColorTexture),lb(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),lb(a.specularGlossinessTexture))}),Pe.animation(e,function(n){Pe.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=Q3e(e);return Pe.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Pe.sampler(e,function(n){n.wrapS=y(n.wrapS,te.REPEAT),n.wrapT=y(n.wrapT,te.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function Q3e(e){let t={};return Pe.animation(e,function(n){Pe.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function lb(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var PR=$3e;function J3e(e){return Pe.shader(e,function(t){VU(t)}),Pe.buffer(e,function(t){VU(t)}),Pe.image(e,function(t){VU(t)}),VU(e),e}function VU(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var dy=J3e;function eke(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var RR=eke;function tke(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),RR(e,t),n.length===0&&delete e.extensionsUsed}}var ub=tke;var nke=4;function ike(e){if(Kd(e)!=="glTF")throw new re("File is not valid binary glTF");let n=Rre(e,0,5),i=n[1];if(i!==1&&i!==2)throw new re("Binary glTF version is not 1 or 2");return i===1?oke(e,n):rke(e,n)}function Rre(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*nke,!0);return o}function oke(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new re("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Ll(e,r,i),c=JSON.parse(a);dy(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=y(f.binary_glTF,f.KHR_binary_glTF);l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return ub(c,"KHR_binary_glTF"),c}function rke(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=Rre(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=Ll(u);o=JSON.parse(f),dy(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var OR=ike;function ske(e){return Pe.shader(e,function(t){UU(t)}),Pe.buffer(e,function(t){UU(t)}),Pe.image(e,function(t){UU(t)}),UU(e),e}function UU(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var MR=ske;function ake(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),vs(n,t,!0)}var Lf=ake;function cke(e){switch(e){case X.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case X.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case X.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case X.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case X.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case X.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case X.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case X.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var o_=cke;function lke(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Su(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=kl(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,x=t.componentType,b=X.getSizeInBytes(x),T=new DataView(d.buffer),C=new Array(r),A=o_(x);for(let E=0;E<p;E++){A(T,m,r,b,C);for(let v=0;v<r;v++){let D=C[v];s[v]=Math.min(s[v],D),a[v]=Math.max(a[v],D)}m+=g}return{min:s,max:a}}var fb=lke;var uke=[te.FUNC_ADD,te.FUNC_ADD],fke=[te.ONE,te.ZERO,te.ONE,te.ZERO];function Ore(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var dke=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function hke(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(dke.indexOf(e[n])===-1)return t;return e}function mke(e){let t={},n={},i=e.techniques;return l(i)&&(Pe.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Ore(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,uke),blendFactors:hke(c.blendFuncSeparate,fke)})}Ore(s,te.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Lf(e,"KHR_blend")),Pe.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Pe.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var LR=mke;function pke(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),vs(n,t,!0),Lf(e,t)}var NR=pke;function _ke(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Pe.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Pe.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Pe.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(o[a.program]))u.program=o[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=vs(r.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=vs(r.shaders,m,!0),u.program=vs(r.programs,p),o[a.program]=u.program}i[c]=vs(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Lf(e,"KHR_techniques_webgl"),NR(e,"KHR_techniques_webgl"))}return Pe.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Pe.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var FR=_ke;function gke(e,t){bo.typeOf.object("material",e),bo.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:u}=s;if(l(c)){let f=t(c.index,c);if(l(f))return f}if(l(u)){let f=t(u.index,u);if(l(f))return f}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:u,emission:f,specular:d}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(f)&&l(f.index)){let p=t(f.index,f);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}}}let o=Pe.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var LA=gke;var Mre=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function yke(e,t){return t=y(t,Mre),Mre.forEach(function(n){t.indexOf(n)>-1&&bke(e,n)}),e}var xke={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function bke(e,t){let n=xke[t],i=e[n];if(l(i)){let o=0,r=bm[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(xm[t](e,a-o),o++)}}function xm(){}xm.accessor=function(e,t){e.accessors.splice(t,1),Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){Pe.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Pe.meshPrimitiveTarget(o,function(a){Pe.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Pe.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Pe.animation(e,function(i){Pe.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};xm.buffer=function(e,t){e.buffers.splice(t,1),Pe.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};xm.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Pe.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Pe.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Pe.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),lr(e,"KHR_draco_mesh_compression")&&Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),lr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(lr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};xm.image=function(e,t){e.images.splice(t,1),Pe.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};xm.mesh=function(e,t){e.meshes.splice(t,1),Pe.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};xm.node=function(e,t){e.nodes.splice(t,1),Pe.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Pe.animation(e,function(i){Pe.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Pe.technique(e,function(i){Pe.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Pe.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Pe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};xm.material=function(e,t){e.materials.splice(t,1),Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};xm.sampler=function(e,t){e.samplers.splice(t,1),Pe.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};xm.texture=function(e,t){if(e.textures.splice(t,1),Pe.material(e,function(i){LA(i,function(o,r){r.index>t&&--r.index})}),lr(e,"EXT_feature_metadata")){Pe.mesh(e,function(r){Pe.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(lr(e,"EXT_mesh_features")&&Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),lr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function bm(){}bm.accessor=function(e){let t={};return Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){Pe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Pe.meshPrimitiveTarget(i,function(r){Pe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Pe.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Pe.animation(e,function(n){Pe.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),lr(e,"EXT_mesh_gpu_instancing")&&Pe.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),lr(e,"CESIUM_primitive_outline")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};bm.buffer=function(e){let t={};return Pe.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};bm.bufferView=function(e){let t={};if(Pe.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Pe.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Pe.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),lr(e,"KHR_draco_mesh_compression")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),lr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(lr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};bm.image=function(e){let t={};return Pe.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};bm.mesh=function(e){let t={};return Pe.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function Lre(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!Lre(e,o,n)}).length===0}bm.node=function(e){let t={};return Pe.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Pe.skinJoint(n,function(i){t[i]=!0})}),Pe.animation(e,function(n){Pe.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Pe.technique(e,function(n){Pe.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Pe.node(e,function(n,i){Lre(e,i,t)||(t[i]=!0)}),t};bm.material=function(e){let t={};return Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};bm.texture=function(e){let t={};if(Pe.material(e,function(n){LA(n,function(i){t[i]=!0})}),lr(e,"EXT_feature_metadata")){Pe.mesh(e,function(o){Pe.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(lr(e,"EXT_mesh_features")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),lr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};bm.sampler=function(e){let t={};return Pe.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var BR=yke;function Tke(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:vs(e.buffers,n),byteOffset:0,byteLength:t.length};return vs(e.bufferViews,o)}var kR=Tke;function Cke(e,t){let n=kl(e,t),i=X.getSizeInBytes(t.componentType),o=Su(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(o),p=o_(t.componentType);for(let g=0;g<r;++g){p(f,u,o,i,d);for(let m=0;m<o;++m)s[g*o+m]=d[m];u+=n}return s}var VR=Cke;function Ake(e){let t;return Pe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?zU(e,i,X.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&zU(e,i,X.UNSIGNED_SHORT)}),Pe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?zU(e,i,X.UNSIGNED_BYTE):t===te.SHORT&&zU(e,i,X.UNSIGNED_SHORT)}),e}function zU(e,t,n){let i=X.createTypedArray(n,VR(e,t)),o=new Uint8Array(i.buffer);t.bufferView=kR(e,o),t.componentType=n,t.byteOffset=0}var UR=Ake;function Eke(e,t){return ub(e,t),t==="CESIUM_RTC"&&Ske(e),lW(e,t)}function Ske(e){Pe.technique(e,function(t){Pe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function lW(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)lW(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&lW(e[o],t);return i}}var db=Eke;var HU={.8:Rke,"1.0":Qke,"2.0":void 0};function vke(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(HU,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(HU,i)||(i="1.0"));let o=HU[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=HU[i];return t.keepLegacyExtensions||(tVe(e,t),nVe(e)),e}function Bre(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;l(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function wke(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=y(a.primitive,te.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function Dke(e){let t=e.nodes,n=new h,i=new Oe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;h.fromArray(a,0,n),Oe.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;l(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function Ike(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new h,a=new Oe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let x=f[m];if(x.target.path==="rotation"){let b=d[p[x.sampler].output];if(l(r[b]))continue;r[b]=!0;let T=n[b],C=i[T.bufferView],E=o[C.buffer].extras._pipeline.source,v=E.byteOffset+C.byteOffset+T.byteOffset,D=T.componentType,O=T.count,R=Su(T.type),M=T.count*R,N=X.createArrayBufferView(D,E.buffer,v,M);for(let _=0;_<O;_++){let S=_*R;h.unpack(N,S,s);let w=N[S+3];Oe.fromAxisAngle(s,w,a),Oe.pack(a,N,S)}}}}}}function Pke(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function Rke(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,Bre(e),wke(e),Dke(e),Ike(e),Pke(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Lf(e,"KHR_materials_common")}}function Oke(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function Nre(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),l(o.name)||(o.name=i)}return n}function Mke(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,l(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=Nre(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Pe.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Pe.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Pe.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Pe.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Pe.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Pe.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Pe.mesh(e,function(s){Pe.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Pe.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Pe.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=vs(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Pe.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Pe.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Pe.animation(e,function(s){let a={};s.samplers=Nre(s.samplers,a),Pe.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Pe.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Pe.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Pe.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Pe.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Pe.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Pe.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function Lke(e){Pe.animation(e,function(t){Pe.animationSampler(t,function(n){delete n.name})})}function Nke(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Pe.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function Fke(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var Bke={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function kke(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(Bke[o])&&e.extensionsRequired.push(o)}}}function Vke(e){Pe.buffer(e,function(t){delete t.type})}function Uke(e){Pe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function zke(e){Pe.mesh(e,function(t){Pe.meshPrimitive(t,function(n){Pe.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Pe.technique(e,function(t){Pe.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var Hke={POSITION:!0,NORMAL:!0,TANGENT:!0},Gke={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function Wke(e){let t={};Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){Pe.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let u,f=Gke[a];l(f)?(u=f+c,t[r]=u):l(Hke[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Pe.technique(e,function(n){Pe.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function jke(e){Pe.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function fW(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:kl(e,t)}function qke(e){Pe.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Pe.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=fW(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function Yke(e){let t,n,i,o=e.bufferViews,r={};Pe.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Pe.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=fW(e,p),m=p.byteOffset,x=p.count*g;delete p.byteStride;let b=t<d-1,T=b?fW(e,c[t+1]):void 0;if(g!==T){let C=Ge(i,!0);r[a]&&(C.byteStride=g),C.byteOffset+=u,C.byteLength=m+x-u;let A=vs(o,C);for(n=f;n<=t;++n)p=c[n],p.bufferView=A,p.byteOffset=p.byteOffset-u;u=b?c[t+1].byteOffset:void 0,f=t+1}}}BR(e,["accessor","bufferView","buffer"])}function Xke(e){Pe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=fb(e,n);n.min=i.min,n.max=i.max}})}function kre(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||oe.fromArray(e.rotation).equals(new oe(0,0,0,1)))&&(!l(e.matrix)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Vre(e,t){Pe.scene(e,function(n){let i=n.nodes;if(l(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Pe.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),kre(n)&&Vre(e,i))}}),delete e.nodes[t]}function Kke(e){return Pe.node(e,function(t,n){kre(t)&&Vre(e,n)}),e}function Zke(e){Pe.animation(e,function(t){Pe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=fb(e,i);i.min=o.min,i.max=o.max}})})}function $ke(e){Pe.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=fb(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function Qke(e){e.asset=y(e.asset,{}),e.asset.version="2.0",Bre(e),Oke(e),Kke(e),Mke(e),Lke(e),Fke(e),kke(e),qke(e),Yke(e),Xke(e),Zke(e),$ke(e),Vke(e),Uke(e),zke(e),Wke(e),UR(e),jke(e),LR(e),FR(e),Nke(e)}var Jke=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],eVe=["u_diffuse","u_diffuse_mat"];function dW(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function hW(e){return l(e.index)}function mW(e){return Array.isArray(e)&&e.length===4}function Ure(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function tVe(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,Jke),i=y(t.baseColorFactorNames,eVe);Pe.material(e,function(o){Pe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&hW(r)?(dW(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&mW(r)&&(dW(o),o.pbrMetallicRoughness.baseColorFactor=Ure(r))})}),db(e,"KHR_techniques_webgl"),db(e,"KHR_blend")}function uW(e,t){l(t)&&(mW(t)?e.pbrMetallicRoughness.baseColorFactor=Ure(t):hW(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Fre(e,t){l(t)&&(mW(t)?e.emissiveFactor=t.slice(0,3):hW(t)&&(e.emissiveTexture=t))}function nVe(e){Pe.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=y(n.values,{}),o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;dW(t),n.technique==="CONSTANT"?(Lf(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},uW(t,s),uW(t,o)):(uW(t,r),Fre(t,o),Fre(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),db(e,"KHR_materials_common")}var zR=vke;var oi={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function iVe(e){switch(e){case oi.POSITION:return"positionMC";case oi.NORMAL:return"normalMC";case oi.TANGENT:return"tangentMC";case oi.TEXCOORD:return"texCoord";case oi.COLOR:return"color";case oi.JOINTS:return"joints";case oi.WEIGHTS:return"weights";case oi.FEATURE_ID:return"featureId"}}oi.hasSetIndex=function(e){switch(e){case oi.POSITION:case oi.NORMAL:case oi.TANGENT:return!1;case oi.TEXCOORD:case oi.COLOR:case oi.JOINTS:case oi.WEIGHTS:case oi.FEATURE_ID:return!0}};oi.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return oi.POSITION;case"NORMAL":return oi.NORMAL;case"TANGENT":return oi.TANGENT;case"TEXCOORD":return oi.TEXCOORD;case"COLOR":return oi.COLOR;case"JOINTS":return oi.JOINTS;case"WEIGHTS":return oi.WEIGHTS;case"_FEATURE_ID":return oi.FEATURE_ID}};oi.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return oi.POSITION;case"RGBA":case"RGB":case"RGB565":return oi.COLOR;case"NORMAL":case"NORMAL_OCT16P":return oi.NORMAL;case"BATCH_ID":return oi.FEATURE_ID}};oi.getGlslType=function(e){switch(e){case oi.POSITION:case oi.NORMAL:case oi.TANGENT:return"vec3";case oi.TEXCOORD:return"vec2";case oi.COLOR:return"vec4";case oi.JOINTS:return"ivec4";case oi.WEIGHTS:return"vec4";case oi.FEATURE_ID:return"int"}};oi.getVariableName=function(e,t){let n=iVe(e);return l(t)&&(n+=`_${t}`),n};var At=Object.freeze(oi);function fc(){}fc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` -${n.message}`);let o=new re(i);return l(n)&&(o.stack=`Original stack: -${n.stack} -Handler stack: -${o.stack}`),o};fc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Oe.IDENTITY,l(e.scale)?e.scale:h.ONE)};fc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};fc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};fc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};fc.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};fc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=At.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=on.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),u;return c&&(u=r?"vec4":on.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var oVe=new h,rVe=new h;fc.getPositionMinMax=function(e,t,n){let i=fc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=h.add(r,t,rVe),o=h.add(o,n,oVe)),{min:r,max:o}};fc.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===Lo.Y?n=F.clone(Lo.Y_UP_TO_Z_UP,n):e===Lo.X&&(n=F.clone(Lo.X_UP_TO_Z_UP,n)),t===Lo.Z&&(n=F.multiplyTransformation(n,Lo.Z_UP_TO_X_UP,n)),n};var sVe=new $;fc.getCullFace=function(e,t){if(!Me.isTriangles(t))return yi.BACK;let n=F.getMatrix3(e,sVe);return $.determinant(n)<0?yi.FRONT:yi.BACK};fc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};fc.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};fc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!fc.supportedExtensions[i])throw new re(`Unsupported glTF Extension: ${i}`)}};var Kt=fc;function hy(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(hy.prototype=Object.create(Ki.prototype),hy.prototype.constructor=hy);Object.defineProperties(hy.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});hy.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,l(this._gltfJson)?(this._promise=zre(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Hre(this,this._typedArray),this._promise):(this._promise=aVe(this),this._promise))};async function aVe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;pW(e,n)}return Hre(e,t)}function pW(e,t){e.unload(),e._state=pt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function cVe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!lr(t,"KHR_techniques_webgl")&&!lr(t,"KHR_materials_common"))return Promise.resolve();let n=[];Pe.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),zR(t)}function lVe(e){let t=[];return Pe.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Ep(i)&&(delete n.uri,t.push(Se.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function uVe(e,t){let n=[];return Pe.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function zre(e,t){try{dy(t),await lVe(t),await cVe(e,t),PR(t),await uVe(e,t),MR(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new re(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&Kt.checkSupportedExtensions(i),e._gltf=t,e._state=pt.READY,e}catch(n){if(e.isDestroyed())return;pW(e,n)}}async function Hre(e,t){let n;try{Kd(t)==="glTF"?n=OR(t):n=No(t)}catch(i){if(e.isDestroyed())return;pW(e,i)}return zre(e,n)}hy.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};hy.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var NA=hy;var fVe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Tm=Object.freeze(fVe);var So={};function dVe(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function hVe(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function mVe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function pVe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function _Ve(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function gVe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function yVe(){this.attributes=[]}function xVe(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function bVe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function TVe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function CVe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function AVe(){this.nodes=[]}var EVe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function SVe(){this.input=[],this.interpolation=void 0,this.output=[]}function vVe(){this.node=void 0,this.path=void 0}function wVe(){this.sampler=void 0,this.target=void 0}function DVe(){this.name=void 0,this.samplers=[],this.channels=[]}function IVe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function PVe(){this.name=void 0,this.stages=[]}function Gre(){this.credits=[]}function RVe(){this.asset=new Gre,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=F.clone(F.IDENTITY),this.extensions={}}function OVe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0}function my(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=oe.clone(my.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=my.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=my.DEFAULT_ROUGHNESS_FACTOR}my.DEFAULT_BASE_COLOR_FACTOR=oe.ONE;my.DEFAULT_METALLIC_FACTOR=1;my.DEFAULT_ROUGHNESS_FACTOR=1;function hb(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=oe.clone(hb.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(hb.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=hb.DEFAULT_GLOSSINESS_FACTOR}hb.DEFAULT_DIFFUSE_FACTOR=oe.ONE;hb.DEFAULT_SPECULAR_FACTOR=h.ONE;hb.DEFAULT_GLOSSINESS_FACTOR=1;function HR(){this.specularFactor=HR.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(HR.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}HR.DEFAULT_SPECULAR_FACTOR=1;HR.DEFAULT_SPECULAR_COLOR_FACTOR=h.ONE;function GR(){this.anisotropyStrength=GR.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=GR.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}GR.DEFAULT_ANISOTROPY_STRENGTH=0;GR.DEFAULT_ANISOTROPY_ROTATION=0;function WR(){this.clearcoatFactor=WR.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=WR.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}WR.DEFAULT_CLEARCOAT_FACTOR=0;WR.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function _W(){this.metallicRoughness=new my,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(_W.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Tm.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}_W.DEFAULT_EMISSIVE_FACTOR=h.ZERO;So.Quantization=dVe;So.Attribute=hVe;So.Indices=mVe;So.FeatureIdAttribute=pVe;So.FeatureIdTexture=gVe;So.FeatureIdImplicitRange=_Ve;So.MorphTarget=yVe;So.Primitive=xVe;So.Instances=bVe;So.Skin=TVe;So.Node=CVe;So.Scene=AVe;So.AnimatedPropertyType=Object.freeze(EVe);So.AnimationSampler=SVe;So.AnimationTarget=vVe;So.AnimationChannel=wVe;So.Animation=DVe;So.ArticulationStage=IVe;So.Articulation=PVe;So.Asset=Gre;So.Components=RVe;So.TextureReader=OVe;So.MetallicRoughness=my;So.SpecularGlossiness=hb;So.Specular=HR;So.Anisotropy=GR;So.Clearcoat=WR;So.Material=_W;var xn=So;var GU={};GU.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureId:n,supportedImageFormats:i}=e,o=t.textures[n],r=o.extensions;if(l(r)){if(i.webp&&l(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&l(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};GU.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=Cn.REPEAT,r=Cn.REPEAT,s=Zt.LINEAR,a=di.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];o=y(d.wrapS,o),r=y(d.wrapT,r),s=y(d.minFilter,s),a=y(d.magFilter,a)}return i&&s!==Zt.LINEAR&&s!==Zt.NEAREST&&(s===Zt.NEAREST_MIPMAP_NEAREST||s===Zt.NEAREST_MIPMAP_LINEAR?s=Zt.NEAREST:s=Zt.LINEAR),new $t({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var MVe=new z(1,1);GU.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let{textureInfo:t,channels:n,texture:i}=e,o=y(t.texCoord,0),r,s=t.extensions?.KHR_texture_transform;if(l(s)){o=y(s.texCoord,o);let c=l(s.offset)?z.unpack(s.offset):z.ZERO,u=y(s.rotation,0),f=l(s.scale)?z.unpack(s.scale):MVe;u=-u,r=new $(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new xn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var Vl=GU;function LVe(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var py=LVe;function _y(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),u=i.index,f=Vl.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(_y.prototype=Object.create(Ki.prototype),_y.prototype.constructor=_y);Object.defineProperties(_y.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var NVe=new gW;async function FVe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=pt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load texture",n)}}_y.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,this._promise=FVe(this),this._promise)};function gW(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}gW.prototype.set=function(e,t,n,i,o,r){this.gltf=e,this.textureInfo=t,this.textureId=n,this.image=i,this.mipLevels=o,this.context=r};gW.prototype.execute=function(){this.texture=Wre(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function Wre(e,t,n,i,o,r){let s=i.internalFormat,a=!1;et.isCompressedFormat(s)&&!l(o)&&(a=!0);let c=Vl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===Zt.NEAREST_MIPMAP_NEAREST||u===Zt.NEAREST_MIPMAP_LINEAR||u===Zt.LINEAR_MIPMAP_NEAREST||u===Zt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,m=g||f===Cn.REPEAT||f===Cn.MIRRORED_REPEAT||d===Cn.REPEAT||d===Cn.MIRRORED_REPEAT,x=!P.isPowerOfTwo(i.width)||!P.isPowerOfTwo(i.height),b=m&&x,T;return l(s)?(!r.webgl2&&et.isCompressedFormat(s)&&x&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),T=Pt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(b&&(i=py(i)),T=Pt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&T.generateMipmap(),T}_y.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.LOADED&&this._state!==pt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=pt.PROCESSING;let t;if(this._asynchronous){let n=NVe;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Na.TEXTURE))return;t=n.texture}else t=Wre(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=pt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};_y.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var FA=_y;function gy(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=e.cacheKey,f=y(e.asynchronous,!0),d=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(gy.prototype=Object.create(Ki.prototype),gy.prototype.constructor=gy);Object.defineProperties(gy.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function BVe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}gy.prototype.load=async function(){return l(this._promise)?this._promise:BVe(this._draco,this._attributeSemantic)?(this._promise=VVe(this),this._promise):(this._promise=zVe(this),this._promise)};function kVe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new xn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=on.VEC2,a.normalizationRange=r;else{let c=on.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function VVe(e){e._state=pt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=pt.LOADED,e)}catch{if(e.isDestroyed())return;yW(e)}}function UVe(e){e._state=pt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,u=o.data.quantization;l(u)&&(e._quantization=kVe(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function zVe(e){e._state=pt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=pt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;yW(e,n)}}function yW(e,t){throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load vertex buffer",t)}function xW(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}xW.prototype.set=function(e,t){this.typedArray=e,this.context=t};xW.prototype.execute=function(){this.buffer=jre(this.typedArray,this.context)};function jre(e,t){let n=gt.createVertexBuffer({typedArray:e,context:t,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var HVe=new xW;gy.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.LOADED&&this._state!==pt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){yW(this,i)}UVe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=HVe;if(i.set(n,e.context),!e.jobScheduler.execute(i,Na.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=jre(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=pt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};gy.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var BA=gy;function jR(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(e.properties,{}),i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}jR.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=ym.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new jR({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(jR.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});jR.BATCH_TABLE_CLASS_NAME="_batchTable";var Qd=jR;function WU(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}WU.fromJson=function(e){return new WU({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(WU.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var qR=WU;function jU(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=y(e.valueType,Vt.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}jU.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(o){return qR.fromJson(o)});return new jU({id:t,values:i,valueType:Vt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(jU.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var YR=jU;function qU(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}qU.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=YR.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Qd.fromJson({id:i,class:e.classes[i],enums:t}));return new qU({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(qU.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var vu=qU;function mb(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?vu.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(mb.prototype=Object.create(Ki.prototype),mb.prototype.constructor=mb);Object.defineProperties(mb.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});mb.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=GVe(this),this._promise)};async function GVe(e){let t=e._resource;e._state=pt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=vu.fromJson(n),e._state=pt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=pt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}mb.prototype.unload=function(){this._schema=void 0};var kA=mb;var Jd={};function VA(e){return em(e.url)}function YU(e){let{byteOffset:t,byteLength:n}=e;if(ii(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function WVe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function qre(e,t){return`${VA(e)}-buffer-id-${t}`}function XR(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return VA(o)}return qre(n,t)}function bW(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=XR(a,s,n,i),u=YU(r);return`${c}-range-${u}`}function Yre(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let p=i.getDerivedResource({url:s});return VA(p)}let a=e.bufferViews[r],c=a.buffer,u=e.buffers[c],f=XR(u,c,n,i),d=YU(a);return`${f}-range-${d}`}function jVe(e,t){let n=Vl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Jd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${VA(n)}`};Jd.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e;return`external-buffer:${VA(t)}`};Jd.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${qre(t,n)}`};Jd.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t}=e;return`gltf:${VA(t)}`};Jd.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ii(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=XR(a,s,i,o),u=YU(r);return`buffer-view:${c}-range-${u}`};Jd.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${bW(t,n,i,o)}`};Jd.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:c=!1,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d="";if(c&&(d+="-dequantize"),u&&(d+="-buffer",d+=`-context-${o.context.id}`),f&&(d+="-typed-array"),l(s))return`vertex-buffer:${bW(t,s,n,i)}-draco-${a}${d}`;let p=t.bufferViews[r],g=p.buffer,m=t.buffers[g],x=XR(m,g,n,i),b=YU(p);return`vertex-buffer:${x}-range-${b}${d}`};Jd.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${bW(t,s,i,o)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,m=t.buffers[g],x=XR(m,g,i,o),b=WVe(f,p);return`index-buffer:${x}-accessor-${b}${u}`};Jd.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${Yre(t,n,i,o)}`};Jd.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=Vl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=Yre(t,c,i,o),f=jVe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var Ul=Jd;function KR(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}KR.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};KR.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;l(n)&&(o+=n.sizeInBytes),l(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};KR.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};KR.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var ZR=KR;function Nn(){}Nn.cacheEntries={};Nn.statistics=new ZR;function qVe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new qVe(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{schema:t,resource:n}=e,i=Ul.getSchemaCacheKey({schema:t,resource:n}),o=Nn.get(i);return l(o)?o:(o=new kA({schema:t,resource:n,cacheKey:i}),Nn.add(o))};Nn.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n,typedArray:i}=e,o=Ul.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Nn.get(o);return l(r)?r:(r=new sb({typedArray:i,cacheKey:o}),Nn.add(r))};Nn.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e,n=Ul.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new sb({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=Ul.getGltfCacheKey({gltfResource:t}),s=Nn.get(r);return l(s)?s:(s=new NA({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Nn.add(s))};Nn.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=Ul.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Nn.get(r);return l(s)?s:(s=new PA({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Nn.add(s))};Nn.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e,r=Ul.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:o}),s=Nn.get(r);return l(s)?s:(s=new RA({resourceCache:Nn,gltf:t,draco:n,gltfResource:i,baseResource:o,cacheKey:r}),Nn.add(s))};Nn.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,asynchronous:u=!0,dequantize:f=!1,loadBuffer:d=!1,loadTypedArray:p=!1}=e,g=Ul.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:f,loadBuffer:d,loadTypedArray:p}),m=Nn.get(g);return l(m)?m:(m=new BA({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,cacheKey:g,asynchronous:u,dequantize:f,loadBuffer:d,loadTypedArray:p}),Nn.add(m))};Nn.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,asynchronous:a=!0,loadBuffer:c=!1,loadTypedArray:u=!1}=e,f=Ul.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:c,loadTypedArray:u}),d=Nn.get(f);return l(d)?d:(d=new MA({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,draco:s,cacheKey:f,asynchronous:a,loadBuffer:c,loadTypedArray:u}),Nn.add(d))};Nn.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=Ul.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Nn.get(r);return l(s)?s:(s=new OA({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Nn.add(s))};Nn.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=Ul.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new FA({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[BA,MA,RA,FA,OA,PA,sb,kA,NA],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var Ei=Nn;function fa(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(fa.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});fa.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};fa.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};fa.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};fa.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};fa.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};fa.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};fa.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};fa.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===ns.OCTREE&&(t=3),e>>t};fa.fromSubtreeJson=async function(e,t,n,i,o){let r=new fa(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=YVe(n);let a=s.json;r._subtreeJson=a;let c;if(ii(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let C=a.tileMetadata;c=a.propertyTables[C]}let u=[];if(l(a.contentMetadata)){let C=a.contentMetadata.length;for(let A=0;A<C;A++){let E=a.contentMetadata[A];u.push(a.propertyTables[E])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let C=p.class,A=d.classes[C];f=new AR({subtreeMetadata:p,class:A})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],ii(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,g));let m=XVe(a.buffers),x=KVe(a.bufferViews,m);ZVe(a,x),l(c)&&Xre(c,x);for(let C=0;C<u.length;C++){let A=u[C];Xre(A,x)}let b=await $Ve(r,m,s.binary),T=JVe(x,b);return eUe(r,a,i,T),l(c)&&(tUe(r,i,T),iUe(r)),nUe(r,i,T),oUe(r),r._ready=!0,r};function YVe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=No(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function XVe(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function KVe(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function ZVe(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function Xre(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=y(r.values,r.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(r.stringOffsets,r.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(r.arrayOffsets,r.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function $Ve(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=QVe(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function QVe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Ei.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function JVe(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function eUe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=ii(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=TW(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=TW(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=TW(t.childSubtreeAvailability,i,a)}function TW(e,t,n,i){if(l(e.constant))return new DA({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new DA({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function tUe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Bl({class:a,count:o,properties:i.properties,bufferViews:n})}function nUe(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=o[a].availableCount,d=c.class,p=r.classes[d],g=new Bl({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function Kre(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function iUe(e){let t=Kre(e._tileAvailability);e._tileJumpBuffer=t}function oUe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Kre(o);t.push(r)}}fa.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new re("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};fa.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new re("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function rUe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function sUe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}fa.prototype.getTileMetadataView=function(e){let t=rUe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new IA({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};fa.prototype.getContentMetadataView=function(e,t){let n=sUe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new IA({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};fa.prototype.isDestroyed=function(){return!1};fa.prototype.destroy=function(){return l(this._bufferLoader)&&Ei.unload(this._bufferLoader),ue(this)};var pb=fa;var aUe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},_b=Object.freeze(aUe);var eh={};eh.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:eh.parseBoundingVolumeSemantic("TILE",e),minimumHeight:eh._parseMinimumHeight("TILE",e),maximumHeight:eh._parseMaximumHeight("TILE",e)},content:{boundingVolume:eh.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:eh._parseMinimumHeight("CONTENT",e),maximumHeight:eh._parseMaximumHeight("CONTENT",e)}}};eh.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};eh._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};eh._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var gb=eh;function el(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(el.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});el.fromSubtreeJson=async function(e,t,n,i,o,r){r=y(r,0);let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,u=await pb.fromSubtreeJson(n,i,s,a,c),f=new el(e,t,n);return f._implicitSubtree=u,cUe(f,u),f._ready=!0,f};function cUe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=uUe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=lUe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=xUe(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function lUe(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function uUe(e,t,n,i){let s=Zre(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let x=p+m;if(!t.tileIsAvailableAtIndex(x)){u.push(void 0);continue}let b=t.getParentMortonIndex(m),T=c[b],C=m%f.branchingFactor,A=Zre(e,t,T,C,x);T.children.push(A),a.numberOfTilesTotal++,u.push(A)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function $re(e,t,n){let i=_b.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Zre(e,t,n,i,o,r){let s=e._implicitTileset,a;y(r,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u,f;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let D=gb.parseAllBoundingVolumeSemantics(c);u=D.tile,f=D.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let D=0;D<p;D++)if(t.contentIsAvailableAtCoordinates(a,D)){g=!0;break}let m=hUe(s,a,i,r,n,u),x=[];for(let D=0;D<s.contentCount;D++){if(!t.contentIsAvailableAtIndex(o,D))continue;let M={uri:s.contentUriTemplates[D].getDerivedResource({templateValues:a.getTemplateValues()}).url},N=mUe(m,f);l(N)&&(M.boundingVolume=N),x.push(bt(M,s.contentHeaders[D]))}let b=$re(c,s,a),T={boundingVolume:m,geometricError:b,refine:s.refine,contents:x},C=!0,A=Ge(s.tileHeader,C);delete A.boundingVolume,delete A.transform,delete A.metadata;let E=bt(T,A,C),v=nse(e,s.baseResource,E,n);return v.implicitCoordinates=a,v.implicitSubtree=t,v.metadata=c,v.hasImplicitContentMetadata=g,v}function XU(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ii(e,"3DTILES_bounding_volume_S2")||l(e.region))}function AW(e,t){l(t)&&(ii(e,"3DTILES_bounding_volume_S2")?dUe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&fUe(e.region,t.minimumHeight,t.maximumHeight))}function fUe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function dUe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function hUe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!XU(r.boundingVolume,r)&&XU(e.boundingVolume,r)?s=Qre(e,t,n,y(i,!1),o):s=r.boundingVolume,AW(s,r),s}function mUe(e,t){let n;return l(t)&&(n=t.boundingVolume),XU(n,t)?AW(n,t):XU(e,t)&&(n=Ge(e,!0),AW(n,t)),n}function Qre(e,t,n,i,o){let r=e.boundingVolume;return ii(r,"3DTILES_bounding_volume_S2")?Jre(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:tse(r.region,t.level,t.x,t.y,t.z)}:{box:ese(r.box,t.level,t.x,t.y,t.z)}}function Jre(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Qp.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?vA.encode2D(i,o,r):vA.encode2D(i,r,o),f=Qp.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Qp.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var pUe=new h,_Ue=new h,CW=new h,gUe=new $;function ese(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,_Ue),s=$.unpack(e,3,gUe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,pUe);l(o)&&(f=-1+(2*o+1)*a,d.z=a);let p=h.fromElements(c,u,f,CW);p=$.multiplyByVector(s,p,CW),p=h.add(p,r,CW);let g=$.clone(s);g=$.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),$.pack(g,m,3),m}var yUe=new se;function tse(e,t,n,i,o){if(t===0)return e.slice();let r=se.unpack(e,0,yUe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*r.width,f=P.negativePiToPi(r.west+n*u),d=P.negativePiToPi(f+u),p=c*r.height,g=P.negativePiToPi(r.south+i*p),m=P.negativePiToPi(g+p),x=s,b=a;if(l(o)){let T=c*(a-s);x+=o*T,b=x+T}return[f,g,d,m,x,b]}function xUe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Qre(i,o,n,!1,t),s=$re(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=nse(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function nse(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}el.prototype.hasProperty=function(e,t){return!1};el.prototype.getFeature=function(e){};el.prototype.applyDebugSettings=function(e,t){};el.prototype.applyStyle=function(e){};el.prototype.update=function(e,t){};el.prototype.pick=function(e,t,n){};el.prototype.isDestroyed=function(){return!1};el.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};el._deriveBoundingBox=ese;el._deriveBoundingRegion=tse;el._deriveBoundingVolumeS2=Jre;var UA=el;var bUe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},zl=Object.freeze(bUe);function zA(e,t){this._distance=t,this._normal=new ise(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(zA.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});zA.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new zA(e.normal,e.distance),t};zA.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new zA(e.normal,e.distance)};function ise(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(ise.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var yb=zA;function dc(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.edgeColor=H.clone(y(e.edgeColor,H.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new me,this.planeRemoved=new me,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?cse:lse,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function cse(e){return e===jt.OUTSIDE}function lse(e){return e===jt.INSIDE}Object.defineProperties(dc.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?cse:lse)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function ose(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}dc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){ose(n,i)},e.index=t,ose(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};dc.prototype.get=function(e){return this._planes[e]};function use(e,t){let n=e.length;for(let i=0;i<n;++i)if(an.equals(e[i],t))return i;return-1}dc.prototype.contains=function(e){return use(this._planes,e)!==-1};dc.prototype.remove=function(e){let t=this._planes,n=use(t,e);if(n===-1)return!1;e instanceof yb&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof yb&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};dc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof yb&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var TUe=new oe,CUe=new oe;function rse(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=Mn.octEncodeToCartesian4(a.normal,CUe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=oe.packFloat(a.distance,TUe);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function sse(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function fse(e,t){let n=Nt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var AUe=new z;dc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=dc.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=fse(o,AUe);s.y*=2,i?(t=new Pt({context:n,width:s.x,height:s.y,pixelFormat:et.RGBA,pixelDatatype:Ke.FLOAT,sampler:$t.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Pt({context:n,width:s.x,height:s.y,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:$t.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(sse(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(rse(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),sse(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),rse(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var EUe=new F,ase=new an(h.UNIT_X,0);dc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=F.multiply(t,o,EUe));let r=jt.INSIDE;!this.unionClippingRegions&&i>0&&(r=jt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];an.transform(a,o,ase);let c=e.intersectPlane(ase);if(c===jt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};dc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};dc.useFloatTexture=function(e){return e.floatingPointTexture};dc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=dc.useFloatTexture(t)?e.length:e.length*2,r=fse(o,n);return r.y*=2,r};dc.prototype.isDestroyed=function(){return!1};dc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var gs=dc;function vW(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=hse(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,u;if(i&&(r=IUe(e,t,r,n)),e.length>80*n){a=1/0,c=1/0;let f=-1/0,d=-1/0;for(let p=n;p<o;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<c&&(c=m),g>f&&(f=g),m>d&&(d=m)}u=Math.max(f-a,d-c),u=u!==0?32767/u:0}return $R(r,s,n,a,c,u,0),s}function hse(e,t,n,i,o){let r;if(o===UUe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=dse(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=dse(s/i|0,e[s],e[s+1],r);return r&&$U(r,r.next)&&(JR(r),r=r.next),r}function xb(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&($U(n,n.next)||Vr(n.prev,n,n.next)===0)){if(JR(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function $R(e,t,n,i,o,r,s){if(!e)return;!s&&r&&LUe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(r?vUe(e,i,o,r):SUe(e)){t.push(c.i,e.i,u.i),JR(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=wUe(xb(e),t),$R(e,t,n,i,o,r,2)):s===2&&DUe(e,t,n,i,o,r):$R(xb(e),t,n,i,o,r,1);break}}}function SUe(e){let t=e.prev,n=e,i=e.next;if(Vr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=o<r?o<s?o:s:r<s?r:s,d=a<c?a<u?a:u:c<u?c:u,p=o>r?o>s?o:s:r>s?r:s,g=a>c?a>u?a:u:c>u?c:u,m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&HA(o,a,r,c,s,u,m.x,m.y)&&Vr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function vUe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Vr(o,r,s)>=0)return!1;let a=o.x,c=r.x,u=s.x,f=o.y,d=r.y,p=s.y,g=a<c?a<u?a:u:c<u?c:u,m=f<d?f<p?f:p:d<p?d:p,x=a>c?a>u?a:u:c>u?c:u,b=f>d?f>p?f:p:d>p?d:p,T=EW(g,m,t,n,i),C=EW(x,b,t,n,i),A=e.prevZ,E=e.nextZ;for(;A&&A.z>=T&&E&&E.z<=C;){if(A.x>=g&&A.x<=x&&A.y>=m&&A.y<=b&&A!==o&&A!==s&&HA(a,f,c,d,u,p,A.x,A.y)&&Vr(A.prev,A,A.next)>=0||(A=A.prevZ,E.x>=g&&E.x<=x&&E.y>=m&&E.y<=b&&E!==o&&E!==s&&HA(a,f,c,d,u,p,E.x,E.y)&&Vr(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;A&&A.z>=T;){if(A.x>=g&&A.x<=x&&A.y>=m&&A.y<=b&&A!==o&&A!==s&&HA(a,f,c,d,u,p,A.x,A.y)&&Vr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;E&&E.z<=C;){if(E.x>=g&&E.x<=x&&E.y>=m&&E.y<=b&&E!==o&&E!==s&&HA(a,f,c,d,u,p,E.x,E.y)&&Vr(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function wUe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!$U(i,o)&&mse(i,n,n.next,o)&&QR(i,o)&&QR(o,i)&&(t.push(i.i,n.i,o.i),JR(n),JR(n.next),n=e=o),n=n.next}while(n!==e);return xb(n)}function DUe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&BUe(s,a)){let c=pse(s,a);s=xb(s,s.next),c=xb(c,c.next),$R(s,t,n,i,o,r,0),$R(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function IUe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,u=hse(e,a,c,i,!1);u===u.next&&(u.steiner=!0),o.push(FUe(u))}o.sort(PUe);for(let r=0;r<o.length;r++)n=RUe(o[r],n);return n}function PUe(e,t){return e.x-t.x}function RUe(e,t){let n=OUe(e,t);if(!n)return t;let i=pse(n,e);return xb(i,i.next),xb(n,n.next)}function OUe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let d=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>r&&(r=d,s=n.x<n.next.x?n:n.next,d===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&HA(o<u?i:r,o,c,u,o<u?r:i,o,n.x,n.y)){let d=Math.abs(o-n.y)/(i-n.x);QR(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&MUe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function MUe(e,t){return Vr(e.prev,e,t.prev)<0&&Vr(t.next,e,e.next)<0}function LUe(e,t,n,i){let o=e;do o.z===0&&(o.z=EW(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,NUe(o)}function NUe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function EW(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function FUe(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function HA(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function BUe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!kUe(e,t)&&(QR(e,t)&&QR(t,e)&&VUe(e,t)&&(Vr(e.prev,e,t.prev)||Vr(e,t.prev,t))||$U(e,t)&&Vr(e.prev,e,e.next)>0&&Vr(t.prev,t,t.next)>0)}function Vr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function $U(e,t){return e.x===t.x&&e.y===t.y}function mse(e,t,n,i){let o=ZU(Vr(e,t,n)),r=ZU(Vr(e,t,i)),s=ZU(Vr(n,i,e)),a=ZU(Vr(n,i,t));return!!(o!==r&&s!==a||o===0&&KU(e,n,t)||r===0&&KU(e,i,t)||s===0&&KU(n,e,i)||a===0&&KU(n,t,i))}function KU(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function ZU(e){return e>0?1:e<0?-1:0}function kUe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&mse(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function QR(e,t){return Vr(e.prev,e,e.next)<0?Vr(e,t,e.next)>=0&&Vr(e,e.prev,t)>=0:Vr(e,t,e.prev)<0||Vr(e,e.next,t)<0}function VUe(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function pse(e,t){let n=SW(e.i,e.x,e.y),i=SW(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function dse(e,t,n,i){let o=SW(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function JR(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function SW(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function UUe(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var zUe=new h,HUe=new h,yy={};yy.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};yy.computeWindingOrder2D=function(e){return yy.computeArea2D(e)>0?hs.COUNTER_CLOCKWISE:hs.CLOCKWISE};yy.triangulate=function(e,t){let n=z.packArray(e);return vW(n,t,2)};var xse=new h,bse=new h,Tse=new h,_se=new h,gse=new h,yse=new h,r_=new h,Cse=new z,Ase=new z,Ese=new z,GA=new z;yy.computeSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let A=t[a];if(u[d++]=A.x,u[d++]=A.y,u[d++]=A.z,r){let E=i[a];f[p++]=E.x,f[p++]=E.y}}let g=[],m={},x=e.maximumRadius,b=P.chordLength(o,x),T=b*b;for(;s.length>0;){let A=s.pop(),E=s.pop(),v=s.pop(),D=h.fromArray(u,v*3,xse),O=h.fromArray(u,E*3,bse),R=h.fromArray(u,A*3,Tse),M,N,_;r&&(M=z.fromArray(f,v*2,Cse),N=z.fromArray(f,E*2,Ase),_=z.fromArray(f,A*2,Ese));let S=h.multiplyByScalar(h.normalize(D,_se),x,_se),w=h.multiplyByScalar(h.normalize(O,gse),x,gse),I=h.multiplyByScalar(h.normalize(R,yse),x,yse),L=h.magnitudeSquared(h.subtract(S,w,r_)),B=h.magnitudeSquared(h.subtract(w,I,r_)),U=h.magnitudeSquared(h.subtract(I,S,r_)),V=Math.max(L,B,U),G,k,W;V>T?L===V?(G=`${Math.min(v,E)} ${Math.max(v,E)}`,a=m[G],l(a)||(k=h.add(D,O,r_),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=z.add(M,N,GA),z.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(v,a,A),s.push(a,E,A)):B===V?(G=`${Math.min(E,A)} ${Math.max(E,A)}`,a=m[G],l(a)||(k=h.add(O,R,r_),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=z.add(N,_,GA),z.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(E,a,v),s.push(a,A,v)):U===V&&(G=`${Math.min(A,v)} ${Math.max(A,v)}`,a=m[G],l(a)||(k=h.add(R,D,r_),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=z.add(_,M,GA),z.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(A,a,E),s.push(a,v,E)):(g.push(v),g.push(E),g.push(A))}let C={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(C.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new at(C)};var GUe=new fe,WUe=new fe,jUe=new fe,wW=new fe;yy.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[d++]=v.x,u[d++]=v.y,u[d++]=v.z,r){let D=i[a];f[p++]=D.x,f[p++]=D.y}}let g=[],m={},x=e.maximumRadius,b=P.chordLength(o,x),T=new Oa(void 0,void 0,e),C=new Oa(void 0,void 0,e),A=new Oa(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),D=s.pop(),O=s.pop(),R=h.fromArray(u,O*3,xse),M=h.fromArray(u,D*3,bse),N=h.fromArray(u,v*3,Tse),_,S,w;r&&(_=z.fromArray(f,O*2,Cse),S=z.fromArray(f,D*2,Ase),w=z.fromArray(f,v*2,Ese));let I=e.cartesianToCartographic(R,GUe),L=e.cartesianToCartographic(M,WUe),B=e.cartesianToCartographic(N,jUe);T.setEndPoints(I,L);let U=T.surfaceDistance;C.setEndPoints(L,B);let V=C.surfaceDistance;A.setEndPoints(B,I);let G=A.surfaceDistance,k=Math.max(U,V,G),W,j,J,q,K;k>b?U===k?(W=`${Math.min(O,D)} ${Math.max(O,D)}`,a=m[W],l(a)||(j=T.interpolateUsingFraction(.5,wW),J=(I.height+L.height)*.5,q=h.fromRadians(j.longitude,j.latitude,J,e,r_),u.push(q.x,q.y,q.z),a=u.length/3-1,m[W]=a,r&&(K=z.add(_,S,GA),z.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(O,a,v),s.push(a,D,v)):V===k?(W=`${Math.min(D,v)} ${Math.max(D,v)}`,a=m[W],l(a)||(j=C.interpolateUsingFraction(.5,wW),J=(L.height+B.height)*.5,q=h.fromRadians(j.longitude,j.latitude,J,e,r_),u.push(q.x,q.y,q.z),a=u.length/3-1,m[W]=a,r&&(K=z.add(S,w,GA),z.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(D,a,O),s.push(a,v,O)):G===k&&(W=`${Math.min(v,O)} ${Math.max(v,O)}`,a=m[W],l(a)||(j=A.interpolateUsingFraction(.5,wW),J=(B.height+I.height)*.5,q=h.fromRadians(j.longitude,j.latitude,J,e,r_),u.push(q.x,q.y,q.z),a=u.length/3-1,m[W]=a,r&&(K=z.add(w,_,GA),z.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(v,a,D),s.push(a,O,D)):(g.push(O),g.push(D),g.push(v))}let E={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(E.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new at(E)};yy.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,ee.default);let o=zUe,r=HUe;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),h.multiplyByScalar(o,t,o),h.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var ri=yy;function xy(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(xy.prototype,{length:{get:function(){return this._length}}});xy.prototype.enqueue=function(e){this._array.push(e),this._length++};xy.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};xy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};xy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};xy.prototype.clear=function(){this._array.length=this._offset=this._length=0};xy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var by=xy;var nr={};nr.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};nr.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)o.push(a[u])}}return n};nr.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=nr.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var bb=new z;function wse(e,t,n,i){return z.subtract(t,e,bb),z.multiplyByScalar(bb,n/i,bb),z.add(e,bb,bb),[bb.x,bb.y]}var Ty=new h;function qUe(e,t,n,i){return h.subtract(t,e,Ty),h.multiplyByScalar(Ty,n/i,Ty),h.add(e,Ty,Ty),[Ty.x,Ty.y,Ty.z]}nr.subdivideLineCount=function(e,t,n){let o=h.distance(e,t)/n,r=Math.max(0,Math.ceil(P.log2(o)));return Math.pow(2,r)};var JU=new fe,ez=new fe,YUe=new fe,XUe=new h,QU=new Oa;nr.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,JU),r=e.cartesianToCartographic(n,ez),a=new Oa(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};nr.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=nr.subdivideLineCount(n,i,o),a=z.distance(e,t),c=a/s,u=r;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=wse(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};nr.subdivideLine=function(e,t,n,i){let o=nr.subdivideLineCount(e,t,n),r=h.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let u=0;u<o;u++){let f=qUe(e,t,u*s,r);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};nr.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,JU),c=n.cartesianToCartographic(o,ez);QU.setEndPoints(a,c);let u=QU.surfaceDistance/r,f=Math.max(0,Math.ceil(P.log2(u))),d=Math.pow(2,f),p=z.distance(e,t),g=p/d,m=s;m.length=d*2;let x=0;for(let b=0;b<d;b++){let T=wse(e,t,b*g,p);m[x++]=T[0],m[x++]=T[1]}return m};nr.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,JU),s=e.cartesianToCartographic(n,ez),a=new Oa(r,s,e),c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f;l(o)||(o=[]);let p=o;p.length=f*3;let g=0;for(let m=0;m<f;m++){let x=a.interpolateUsingSurfaceDistance(m*d,YUe),b=e.cartographicToCartesian(x,XUe);p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}return p};var KUe=new h,ZUe=new h,$Ue=new h,QUe=new h;nr.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=y(i,ee.default);let r=KUe,s=ZUe,a=$Ue,c=QUe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(r,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,o&&(c=h.clone(a,c)),s=h.multiplyByScalar(r,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};nr.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new by;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=Co(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let d=c.holes[r],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Co(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)o.enqueue(d.holes[s])}i.push(u)}return i};var JUe=new fe;function eze(e,t,n){let i=n.cartesianToCartographic(e,JU),o=n.cartesianToCartographic(t,ez);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;QU.setEndPoints(i,o);let r=QU.findIntersectionWithLatitude(0,JUe);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>P.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function tze(e,t,n,i){if(i===Jt.RHUMB)return eze(e,t,n);let o=$n.lineSegmentPlane(e,t,an.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var nze=new fe;function ize(e,t,n){let i=[],o,r,s,a,c,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],s=P.sign(o.z),a=P.sign(r.z);let f=d=>t.cartesianToCartographic(d,nze).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(c=tze(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function Dse(e,t,n,i,o,r,s){let a=[],c=r,u=d=>p=>p.position===d,f=[];do{let d=n[c];a.push(d);let p=i.findIndex(u(c)),g=i[p];if(!l(g)){++c;continue}let{visited:m,type:x,next:b}=g;if(g.visited=!0,x===0){if(b===0){let E=i[p-(s?1:-1)];if(E?.position===c+1)E.visited=!0;else{++c;continue}}if(!m&&s&&b>0||r===c&&!s&&b<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}m||f.push(c);let C=p+(s?1:-1),A=i[C];if(!l(A)){++c;continue}c=A.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let d of f)t=Dse(e,++t,n,i,0,d,!s);return t}nr.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=ize(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;o=Dse(i,o,s,a,1,0,c)}return i};nr.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new by;c.enqueue(e);let u=l(r);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,g,m;if(i)for(m=d.length,g=0;g<m;g++)o.scaleToGeodeticSurface(d[g],d[g]);if(t||(d=Co(d,h.equalsEpsilon,!0)),d.length<3)continue;let x=n(d);if(!l(x))continue;let b=[],T=ri.computeWindingOrder2D(x);if(T===hs.CLOCKWISE&&(x.reverse(),d=d.slice().reverse()),u){u=!1;let D=[d];if(D=r(D,D),D.length>1){for(let O of D)c.enqueue(new Ma(O,p));continue}}let C=d.slice(),A=l(p)?p.length:0,E=[],v;for(g=0;g<A;g++){let D=p[g],O=D.positions;if(i)for(m=O.length,v=0;v<m;++v)o.scaleToGeodeticSurface(O[v],O[v]);if(t||(O=Co(O,h.equalsEpsilon,!0)),O.length<3)continue;let R=n(O);if(!l(R))continue;T=ri.computeWindingOrder2D(R),T===hs.CLOCKWISE&&(R.reverse(),O=O.slice().reverse()),E.push(O),b.push(C.length),C=C.concat(O),x=x.concat(R);let M=0;for(l(D.holes)&&(M=D.holes.length),v=0;v<M;v++)c.enqueue(D.holes[v])}s.push({outerRing:d,holes:E}),a.push({positions:C,positions2D:x,holes:b})}return{hierarchy:s,polygons:a}};var oze=new z,rze=new h,sze=new Oe,aze=new $;nr.computeBoundingRectangle=function(e,t,n,i,o){let r=Oe.fromAxisAngle(e,i,sze),s=$.fromQuaternion(r,aze),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],rze);$.multiplyByVector(s,g,g);let m=t(g,oze);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=a,o.y=u,o.width=c-a,o.height=f-u,o};nr.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=ri.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let d=c.length,p=new Array(d*3),g=0;for(let b=0;b<d;b++){let T=c[b];p[g++]=T.x,p[g++]=T.y,p[g++]=T.z}let m={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Me.TRIANGLES};u&&(m.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:z.packArray(f)}));let x=new at(m);return r.normal?Ln.computeNormal(x):x}if(s===Jt.GEODESIC)return ri.computeSubdivision(e,c,a,f,i);if(s===Jt.RHUMB)return ri.computeRhumbLineSubdivision(e,c,a,f,i)};var Sse=[],vse=[],cze=new h,lze=new h;nr.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,u,f,d,p,g,m,x=e.length,b=0,T=0,C=l(t),A=C?t.positions:void 0;if(o)for(a=x*3*2,s=new Array(a*2),C&&(m=x*2*2,g=new Array(m*2)),c=0;c<x;c++)u=e[c],f=e[(c+1)%x],s[b]=s[b+a]=u.x,++b,s[b]=s[b+a]=u.y,++b,s[b]=s[b+a]=u.z,++b,s[b]=s[b+a]=f.x,++b,s[b]=s[b+a]=f.y,++b,s[b]=s[b+a]=f.z,++b,C&&(d=A[c],p=A[(c+1)%x],g[T]=g[T+m]=d.x,++T,g[T]=g[T+m]=d.y,++T,g[T]=g[T+m]=p.x,++T,g[T]=g[T+m]=p.y,++T);else{let R=P.chordLength(i,n.maximumRadius),M=0;if(r===Jt.GEODESIC)for(c=0;c<x;c++)M+=nr.subdivideLineCount(e[c],e[(c+1)%x],R);else if(r===Jt.RHUMB)for(c=0;c<x;c++)M+=nr.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],R);for(a=(M+x)*3,s=new Array(a*2),C&&(m=(M+x)*2,g=new Array(m*2)),c=0;c<x;c++){u=e[c],f=e[(c+1)%x];let N,_;C&&(d=A[c],p=A[(c+1)%x]),r===Jt.GEODESIC?(N=nr.subdivideLine(u,f,R,vse),C&&(_=nr.subdivideTexcoordLine(d,p,u,f,R,Sse))):r===Jt.RHUMB&&(N=nr.subdivideRhumbLine(n,u,f,R,vse),C&&(_=nr.subdivideTexcoordRhumbLine(d,p,n,u,f,R,Sse)));let S=N.length;for(let w=0;w<S;++w,++b)s[b]=N[w],s[b+a]=N[w];if(s[b]=f.x,s[b+a]=f.x,++b,s[b]=f.y,s[b+a]=f.y,++b,s[b]=f.z,s[b+a]=f.z,++b,C){let w=_.length;for(let I=0;I<w;++I,++T)g[T]=_[I],g[T+m]=_[I];g[T]=p.x,g[T+m]=p.x,++T,g[T]=p.y,g[T+m]=p.y,++T}}}x=s.length;let E=Ne.createTypedArray(x/3,x-e.length*6),v=0;for(x/=6,c=0;c<x;c++){let R=c,M=R+1,N=R+x,_=N+1;u=h.fromArray(s,R*3,cze),f=h.fromArray(s,M*3,lze),!h.equalsEpsilon(u,f,P.EPSILON10,P.EPSILON10)&&(E[v++]=R,E[v++]=N,E[v++]=M,E[v++]=M,E[v++]=N,E[v++]=_)}let D={attributes:new fn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),indices:E,primitiveType:Me.TRIANGLES};return C&&(D.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),new at(D)};var zn=nr;function Ur(e,t){this.position=e,l(this.position)||(this.position=new z),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Ur.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Ur.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=z.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(P.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=P.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=P.TWO_PI),e}}});var WA=new fe,uze=new h;Ur.prototype.getLatitude=function(e){l(e)||(e=ee.default),WA.latitude=this.conformalLatitude,WA.longitude=this.longitude,WA.height=0;let t=this.ellipsoid.cartographicToCartesian(WA,uze);return e.cartesianToCartographic(t,WA),WA.latitude};var fze=new mn,dze=new h,hze=new h;Ur.fromCartesian=function(e,t){let n=P.signNotZero(e.z),i=Ur.NORTH_POLE_TANGENT_PLANE,o=Ur.SOUTH_POLE;n<0&&(i=Ur.SOUTH_POLE_TANGENT_PLANE,o=Ur.NORTH_POLE);let r=fze;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,dze),h.normalize(r.direction,r.direction);let s=$n.rayPlane(r,i.plane,hze),a=h.subtract(s,o,s),c=h.dot(i.xAxis,a),u=n*h.dot(i.yAxis,a);return l(t)?(t.position=new z(c,u),t.tangentPlane=i,t):new Ur(new z(c,u),i)};Ur.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Ur.fromCartesian(e[i],t[i]);return t};Ur.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Ur(e.position,e.tangentPlane)};Ur.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));Ur.NORTH_POLE=Object.freeze(new h(0,0,.5));Ur.SOUTH_POLE=Object.freeze(new h(0,0,-.5));Ur.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Jr(Ur.NORTH_POLE,Ur.HALF_UNIT_SPHERE));Ur.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Jr(Ur.SOUTH_POLE,Ur.HALF_UNIT_SPHERE));var hc=Ur;var mze=new fe,Ise=new fe;function pze(e,t,n,i){let r=i.cartesianToCartographic(e,mze).height,s=i.cartesianToCartographic(t,Ise);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,Ise);a.height=r-100,i.cartographicToCartesian(a,n)}var Pse=new je,_ze=new h,gze=new h,yze=new h,xze=new h,bze=new h,Tze=new h,tz=new h,Cm=new h,jA=new h,Cze=new z,Aze=new z,Eze=new h,Rse=new Oe,Sze=new $,vze=new $;function DW(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,x=e.perPositionHeight,b=Cze;b.x=f.x,b.y=f.y;let T=t.st?new Float32Array(2*(s/3)):void 0,C;t.normal&&(x&&c&&!a?C=n.attributes.normal.values:C=new Float32Array(s));let A=t.tangent?new Float32Array(s):void 0,E=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,D=0,O=0,R=gze,M=yze,N=xze,_=!0,S=Sze,w=vze;if(m!==0){let B=Oe.fromAxisAngle(d,m,Rse);S=$.fromQuaternion(B,S),B=Oe.fromAxisAngle(d,-m,Rse),w=$.fromQuaternion(B,w)}else S=$.clone($.IDENTITY,S),w=$.clone($.IDENTITY,w);let I=0,L=0;c&&u&&(I=s/2,L=s/3,s/=2);for(let B=0;B<s;B+=3){let U=h.fromArray(o,B,Eze);if(t.st&&!l(r)){let V=$.multiplyByVector(S,U,_ze);V=g.scaleToGeodeticSurface(V,V);let G=p([V],Aze)[0];z.subtract(G,b,G);let k=P.clamp(G.x/f.width,0,1),W=P.clamp(G.y/f.height,0,1);u&&(T[D+L]=k,T[D+1+L]=W),c&&(T[D]=k,T[D+1]=W),D+=2}if(t.normal||t.tangent||t.bitangent||i){let V=O+1,G=O+2;if(a){if(B+3<s){let k=h.fromArray(o,B+3,bze);if(_){let W=h.fromArray(o,B+s,Tze);x&&pze(U,k,W,g),h.subtract(k,U,k),h.subtract(W,U,W),R=h.normalize(h.cross(W,k,R),R),_=!1}h.equalsEpsilon(k,U,P.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(N=g.geodeticSurfaceNormal(U,N),t.tangent&&(M=h.normalize(h.cross(N,R,M),M)))}else R=g.geodeticSurfaceNormal(U,R),(t.tangent||t.bitangent)&&(x&&(tz=h.fromArray(C,O,tz),Cm=h.cross(h.UNIT_Z,tz,Cm),Cm=h.normalize($.multiplyByVector(w,Cm,Cm),Cm),t.bitangent&&(jA=h.normalize(h.cross(tz,Cm,jA),jA))),M=h.cross(h.UNIT_Z,R,M),M=h.normalize($.multiplyByVector(w,M,M),M),t.bitangent&&(N=h.normalize(h.cross(R,M,N),N)));t.normal&&(e.wall?(C[O+I]=R.x,C[V+I]=R.y,C[G+I]=R.z):u&&(C[O+I]=-R.x,C[V+I]=-R.y,C[G+I]=-R.z),(c&&!x||a)&&(C[O]=R.x,C[V]=R.y,C[G]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(U,R)),v[O+I]=-R.x,v[V+I]=-R.y,v[G+I]=-R.z),t.tangent&&(e.wall?(A[O+I]=M.x,A[V+I]=M.y,A[G+I]=M.z):u&&(A[O+I]=-M.x,A[V+I]=-M.y,A[G+I]=-M.z),c&&(x?(A[O]=Cm.x,A[V]=Cm.y,A[G]=Cm.z):(A[O]=M.x,A[V]=M.y,A[G]=M.z))),t.bitangent&&(u&&(E[O+I]=N.x,E[V+I]=N.y,E[G+I]=N.z),c&&(x?(E[O]=jA.x,E[V]=jA.y,E[G]=jA.z):(E[O]=N.x,E[V]=N.y,E[G]=N.z))),O+=3}}t.st&&!l(r)&&(n.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T})),t.normal&&(n.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(n.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,d=new Uint8Array(f);if(e.offsetAttribute===sn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===sn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var Ose=[];function wze(e,t,n,i,o,r,s,a,c,u){let f={walls:[]},d;if(s||a){let C=zn.createGeometryFromPositions(e,t,n,i,r,c,u),A=C.attributes.position.values,E=C.indices,v,D;if(s&&a){let O=A.concat(A);v=O.length/3,D=Ne.createTypedArray(v,E.length*2),D.set(E);let R=E.length,M=v/2;for(d=0;d<R;d+=3){let N=D[d]+M,_=D[d+1]+M,S=D[d+2]+M;D[d+R]=S,D[d+1+R]=_,D[d+2+R]=N}if(C.attributes.position.values=O,r&&c.normal){let N=C.attributes.normal.values;C.attributes.normal.values=new Float32Array(O.length),C.attributes.normal.values.set(N)}if(c.st&&l(n)){let N=C.attributes.st.values;C.attributes.st.values=new Float32Array(v*2),C.attributes.st.values=N.concat(N)}C.indices=D}else if(a){for(v=A.length/3,D=Ne.createTypedArray(v,E.length),d=0;d<E.length;d+=3)D[d]=E[d+2],D[d+1]=E[d+1],D[d+2]=E[d];C.indices=D}f.topAndBottom=new vt({geometry:C})}let p=o.outerRing,g=Jr.fromPoints(p,e),m=g.projectPointsOntoPlane(p,Ose),x=ri.computeWindingOrder2D(m);x===hs.CLOCKWISE&&(p=p.slice().reverse());let b=zn.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new vt({geometry:b}));let T=o.holes;for(d=0;d<T.length;d++){let C=T[d];m=g.projectPointsOntoPlane(C,Ose),x=ri.computeWindingOrder2D(m),x===hs.COUNTER_CLOCKWISE&&(C=C.slice().reverse()),b=zn.computeWallGeometry(C,n,e,i,r,u),f.walls.push(new vt({geometry:b}))}return f}function Ff(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Ie.DEFAULT),i=y(e.ellipsoid,ee.default),o=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),u=y(e.height,0),f=y(e.extrudedHeight,u);if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Ie.clone(n),this._ellipsoid=ee.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,Jt.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=zn.computeHierarchyPackedLength(t,h)+ee.packedLength+Ie.packedLength+(s?zn.computeHierarchyPackedLength(s,z):1)+12}Ff.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new Ff(t)};Ff.pack=function(e,t,n){return n=y(n,0),n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=zn.packPolygonHierarchy(e._textureCoordinates,t,n,z):t[n++]=-1,t[n++]=e.packedLength,t};var Dze=ee.clone(ee.UNIT_SPHERE),Ize=new Ie,Pze={polygonHierarchy:{}};Ff.unpack=function(e,t,n){t=y(t,0);let i=zn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,Dze);t+=ee.packedLength;let r=Ie.unpack(e,t,Ize);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,x=e[t++],b=e[t++],T=e[t]===-1?void 0:zn.unpackPolygonHierarchy(e,t,z);l(T)?(t=T.startingIndex,delete T.startingIndex):t++;let C=e[t++];return l(n)||(n=new Ff(Pze)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=x===-1?void 0:x,n._arcType=b,n._textureCoordinates=T,n.packedLength=C,n};var Rze=new z,Oze=new z,Mze=new hc;function Mse(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+P.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==Jt.RHUMB){let p=z.subtract(t.position,e.position,Rze),g=z.dot(t.position,p)/z.dot(p,p);if(g>0&&g<1){let m=z.add(t.position,z.multiplyByScalar(p,-g,p),Oze),x=hc.clone(t,Mze);x.position=m;let b=x.getLatitude(n);r.south=Math.min(r.south,b),r.north=Math.max(r.north,b),Math.abs(c)>Math.abs(b)&&(u=b)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=z.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=d),u<=0&&(o.southAngle+=d)}var Lse=new hc,Lze=new hc,Nf={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Ff.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new se),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Nf.northAngle=0,Nf.southAngle=0,Nf.westOverIdl=Number.POSITIVE_INFINITY,Nf.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=hc.fromCartesian(e[0],Lze);for(let s=1;s<o;s++){let a=hc.fromCartesian(e[s],Lse);Mse(a,r,t,n,Nf,i),r=hc.clone(a,r)}return Mse(hc.fromCartesian(e[0],Lse),r,t,n,Nf,i),i.east-i.west>Nf.eastOverIdl-Nf.westOverIdl&&(i.west=Nf.westOverIdl,i.east=Nf.eastOverIdl,i.east>P.PI&&(i.east=i.east-P.TWO_PI),i.west>P.PI&&(i.west=i.west-P.TWO_PI)),P.equalsEpsilon(Math.abs(Nf.northAngle),P.TWO_PI,P.EPSILON10)&&(i.north=P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),P.equalsEpsilon(Math.abs(Nf.southAngle),P.TWO_PI,P.EPSILON10)&&(i.south=-P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),i};var Nze=new hc;function Fze(e,t,n){return e.height>=P.PI||e.width>=P.PI?hc.fromCartesian(t[0],Nze).tangentPlane:Jr.fromPoints(t,n)}var Nse=new fe;function Bze(e,t,n){return(i,o)=>{if(e.height>=P.PI||e.width>=P.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],Nse);o[s]=new z(a.longitude/P.PI,a.latitude/P.PI_OVER_TWO)}return o.length=i.length,o}return hc.fromCartesianArray(i,o)}return Jr.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function kze(e,t,n){if(e.height>=P.PI||e.width>=P.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,Nse);return l(r)||(r=new z),r.x=s.longitude/P.PI,r.y=s.latitude/P.PI_OVER_TWO,r}return hc.fromCartesian(o,r)};let i=Jr.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function Vze(e,t,n,i){return(o,r)=>!i&&(e.height>=P.PI_OVER_TWO||e.width>=2*P.PI_OVER_THREE)?zn.splitPolygonsOnEquator(o,t,n,r):o}function Uze(e,t,n,i){if(t.height>=P.PI||t.width>=P.PI)return je.fromRectangle(t,void 0,Pse);let o=e,r=Jr.fromPoints(o,n);return zn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Pse)}Ff.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=r.positions;if(p.length<3)return;let g=e.rectangle,m=zn.polygonsFromHierarchy(r,d,Bze(g,p,n),!s,n,Vze(g,n,u,s)),x=m.hierarchy,b=m.polygons,T=function(I){return I},C=d?zn.polygonsFromHierarchy(f,!0,T,!1,n).polygons:void 0;if(x.length===0)return;let A=x[0].outerRing,E=Uze(A,g,n,o),v=[],D=e._height,O=e._extrudedHeight,R=e._perPositionHeightExtrude||!P.equalsEpsilon(D,O,0,P.EPSILON2),M={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:Fze(g,A,n).plane.normal,projectTo2d:kze(g,A,n),boundingRectangle:E,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},N;if(R)for(M.extrude=!0,M.top=a,M.bottom=c,M.shadowVolume=e._shadowVolume,M.offsetAttribute=e._offsetAttribute,N=0;N<b.length;N++){let I=wze(n,b[N],d?C[N]:void 0,i,x[N],s,a,c,t,u),L;a&&c?(L=I.topAndBottom,M.geometry=zn.scaleToGeodeticHeightExtruded(L.geometry,D,O,n,s)):a?(L=I.topAndBottom,L.geometry.attributes.position.values=ri.scaleToGeodeticHeight(L.geometry.attributes.position.values,D,n,!s),M.geometry=L.geometry):c&&(L=I.topAndBottom,L.geometry.attributes.position.values=ri.scaleToGeodeticHeight(L.geometry.attributes.position.values,O,n,!0),M.geometry=L.geometry),(a||c)&&(M.wall=!1,L.geometry=DW(M),v.push(L));let B=I.walls;M.wall=!0;for(let U=0;U<B.length;U++){let V=B[U];M.geometry=zn.scaleToGeodeticHeightExtruded(V.geometry,D,O,n,s),V.geometry=DW(M),v.push(V)}}else for(N=0;N<b.length;N++){let I=new vt({geometry:zn.createGeometryFromPositions(n,b[N],d?C[N]:void 0,i,s,t,u)});if(I.geometry.attributes.position.values=ri.scaleToGeodeticHeight(I.geometry.attributes.position.values,D,n,!s),M.geometry=I.geometry,I.geometry=DW(M),l(e._offsetAttribute)){let L=I.geometry.attributes.position.values.length,B=e._offsetAttribute===sn.NONE?0:1,U=new Uint8Array(L/3).fill(B);I.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}v.push(I)}let _=Ln.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=Ne.createTypedArray(_.attributes.position.values.length/3,_.indices);let S=_.attributes,w=ae.fromVertices(S.position.values);return t.position||delete S.position,new at({attributes:S,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};Ff.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Ff({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function zze(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return at._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(Ff.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Ff.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=zze(this)),this._textureCoordinateRotationPoints}}});var s_=Ff;function Tb(e){this._ellipsoid=y(e.ellipsoid,ee.default),this._positions=[...e.positions]}Object.defineProperties(Tb.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});Tb.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new Tb({positions:e.positions,ellipsoid:e.ellipsoid})};Tb.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};Tb.prototype.computeRectangle=function(e){return s_.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var Hze=new se,Fse=new h;Tb.prototype.computeSphericalExtents=function(e){l(e)||(e=new se);let t=this.computeRectangle(Hze),n=fe.toCartesian(se.southwest(t),this.ellipsoid,Fse),i=Math.sqrt(n.x*n.x+n.y*n.y),o=P.fastApproximateAtan2(i,n.z),r=P.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=fe.toCartesian(se.northeast(t),this.ellipsoid,Fse),i=Math.sqrt(n.x*n.x+n.y*n.y),o=P.fastApproximateAtan2(i,n.z),r=P.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var qA=Tb;function is(e){e=y(e,y.EMPTY_OBJECT),this._polygons=[],this._totalPositions=0,this.enabled=y(e.enabled,!0),this.inverse=y(e.inverse,!1),this.polygonAdded=new me,this.polygonRemoved=new me,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(is.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});is.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};is.prototype.get=function(e){return this._polygons[e]};is.prototype.contains=function(e){return this._polygons.some(t=>qA.equals(t,e))};is.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>qA.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var Gze=new se;function Wze(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=se.clone(a);f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI);let d=[r];for(let p=0;p<t.length;++p){let g=t[p];if(l(g)&&l(se.simpleIntersection(g,f))&&!se.equals(g,f)){let m=n[p];d.push(...m),m.reduce((x,b)=>se.union(e[b].computeSphericalExtents(Gze),x,x),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=se.clone(a,f),f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),p=-1}}t.push(f),n.push(d)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}is.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function jze(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=Wze(i),s=0;for(let[c,u]of i.entries()){let f=u.length;t[s++]=f,t[s++]=r.get(c);for(let d=0;d<f;++d){let p=u.positions[d],g=Math.hypot(p.x,p.y),m=P.fastApproximateAtan2(g,p.z),x=P.fastApproximateAtan2(p.x,p.y);t[s++]=m,t[s++]=x}}let a=0;for(let c of o){let u=1/(c.east-c.west),f=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=f,n[a++]=u}e._extentsCount=o.length}var IW=new z;is.prototype.update=function(e){let t=e.context;if(!is.isSupported(e))throw new re("ClippingPolygonCollections are only supported for WebGL 2.");let n=this._polygons.reduce((s,a)=>s+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let s=is.getTextureResolution(i,this.pixelsNeededForPolygonPositions,IW);i=new Pt({context:t,width:s.x,height:s.y,pixelFormat:et.RG,pixelDatatype:Ke.FLOAT,sampler:$t.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(l(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let s=is.getTextureResolution(o,this.pixelsNeededForExtents,IW);o=new Pt({context:t,width:s.x,height:s.y,pixelFormat:et.RGBA,pixelDatatype:Ke.FLOAT,sampler:$t.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(jze(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(r)){let s=is.getClippingDistanceTextureResolution(this,IW);r=new Pt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?et.RED:et.LUMINANCE,pixelDatatype:Ke.FLOAT,sampler:new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR,magnificationFilter:di.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=qze(this)};is.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function qze(e){let t=e._polygonsTexture,n=e._extentsTexture;return new kc({fragmentShaderSource:BP,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var Bse=new se,Yze=new se;is.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=jt.OUTSIDE;this.inverse&&(o=jt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let f=e.boundingVolume.computeCorners();c=se.fromCartesianArray(f,t,Bse)}l(c)||(c=se.fromBoundingSphere(e.boundingSphere,t,Bse));let u=se.simpleIntersection(c,a,Yze);l(u)&&(o=jt.INTERSECTING)}return o};is.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};is.isSupported=function(e){return e?.context.webgl2};is.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Nt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};is.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Nt.maximumTextureSize,4096),t.y=Math.min(Nt.maximumTextureSize,4096),t)};is.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):is.getTextureResolution(n,e.pixelsNeededForExtents,t)};is.prototype.isDestroyed=function(){return!1};is.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),ue(this)};var th=is;var eO={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};eO.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?eO.SUNLIGHT:eO.SCENE_LIGHT:eO.NONE};var a_=Object.freeze(eO);function kse(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=a_.NONE}kse.requiresColorCorrect=function(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))};var Cb=kse;function si(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,e=y(e,y.EMPTY_OBJECT);let t=Math.min(y(e.mipmapLevels,10),Math.log2(Nt.maximumCubeMapSize));this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=si.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Z;let n=Math.pow(2,t-1);this._textureDimensions=new z(n,n),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=y(e.enabled,!0),this.shouldUpdate=!0,this.maximumSecondsDifference=y(e.maximumSecondsDifference,60*60),this.maximumPositionEpsilon=y(e.maximumPositionEpsilon,1e3),this.atmosphereScatteringIntensity=y(e.atmosphereScatteringIntensity,2),this.gamma=y(e.gamma,1),this.brightness=y(e.brightness,1),this.saturation=y(e.saturation,1),this.groundColor=y(e.groundColor,si.AVERAGE_EARTH_GROUND_COLOR),this.groundAlbedo=y(e.groundAlbedo,.31)}Object.defineProperties(si.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.clone(e,this._position),this.reset())}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});si._maximumComputeCommandCount=8;si._activeComputeCommandCount=0;si._nextFrameCommandQueue=[];si._queueCommand=(e,t)=>{if(si._activeComputeCommandCount>=si._maximumComputeCommandCount){si._nextFrameCommandQueue.push(e);return}t.commandList.push(e),si._activeComputeCommandCount++};si._updateCommandQueue=e=>{if(si._maximumComputeCommandCount=Math.log2(Nt.maximumCubeMapSize),si._nextFrameCommandQueue.length>0&&si._activeComputeCommandCount<si._maximumComputeCommandCount){let t=si._nextFrameCommandQueue.shift();for(;l(t)&&si._activeComputeCommandCount<si._maximumComputeCommandCount;){if(t.canceled){t=si._nextFrameCommandQueue.shift();continue}e.commandList.push(t),si._activeComputeCommandCount++,t=si._nextFrameCommandQueue.shift()}}};si.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};si.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0,si._activeComputeCommandCount--),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0,si._activeComputeCommandCount--),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,si._activeComputeCommandCount--,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0};var Xze=new h,Kze=new h;function Zze(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,Kze),s=1.025,a=Xze,c=l(r)?h.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Vse=new h,$ze=new F,Qze=new oe,Jze=new H;function e4e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new Cr({context:n,width:i.x,height:i.y,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:et.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new Ue({sources:[Bd,DP]}),e._radianceMapFS=o),Cb.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=Mt.eastNorthUpToFixedFrame(r,a,$ze),u=Qze;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of Cr.faceNames()){let p=e._radianceMapTextures[f];l(p)&&p.destroy(),p=new Pt({context:n,width:i.x,height:i.y,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:et.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new kc({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>Cr.getDirection(d,Vse),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,Jze)},persists:!0,owner:e,postExecute:()=>{let x=e._radianceMapComputeCommands;if(!l(x[g]))return;x[g]=void 0;let b=new Nr({context:n,colorTextures:[e._radianceMapTextures[g]],destroyAttachments:!1});b._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),b._unBind(),b.destroy(),si._activeComputeCommandCount--,x.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)}});e._radianceMapComputeCommands[f]=m,si._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function t4e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,u=(d,p,g,m)=>()=>{let x=e._convolutionComputeCommands;!l(x[d])||x[d].canceled||(x[d]=void 0,n.copyFace(t,p,g,m),c++,si._activeComputeCommandCount--,c===e._specularMapTextures.length&&(e._irradianceCommandDirty=!0,n.sampler=new $t({minificationFilter:Zt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0))},f=0;for(let d=1;d<i;++d){for(let p of Cr.faceNames()){let g=e._specularMapTextures[f]=new Pt({context:a,width:r,height:s,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:et.RGBA}),m=e._va;l(m)||(m=Cr.createVertexArray(a,p),e._va=m);let x=e._convolveSP;l(x)||(x=Qt.fromCache({context:a,vertexShaderSource:PP,fragmentShaderSource:IP,attributeLocations:{positions:0}}),e._convolveSP=x);let b=new kc({shaderProgram:x,vertexArray:m,outputTexture:g,persists:!0,owner:e,uniformMap:{u_roughness:()=>d/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>Cr.getDirection(p,Vse)},postExecute:u(f,g,p,d)});e._convolutionComputeCommands[f]=b,si._queueCommand(b,t),++f}r/=2,s/=2}}var Use=new z(3,3);function n4e(e,t){let n=t.context,i=Use,o=e._irradianceMapTexture;l(o)||(o=new Pt({context:n,width:i.x,height:i.y,pixelDatatype:Ke.FLOAT,pixelFormat:et.RGBA}),e._irradianceMapTexture=o);let r=e._irradianceMapFS;l(r)||(r=new Ue({sources:[wP]}),e._irradianceMapFS=r);let s=new kc({fragmentShaderSource:r,outputTexture:o,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture},postExecute:()=>{l(e._irradianceComputeCommand)&&(e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,si._activeComputeCommandCount--)}});e._irradianceComputeCommand=s,si._queueCommand(s,t),e._irradianceTextureDirty=!0}function i4e(e,t){let n=t.context,i=new Nr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Use,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(r,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._shouldRegenerateShaders=!0}si.prototype.update=function(e){let t=e.mode;if(!si.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===ne.MORPHING){this._shouldRegenerateShaders=!1;return}si._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting;if((Zze(this,e)||i===a_.SUNLIGHT&&!Z.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference))&&(this.reset(),this._lastTime=Z.clone(e.time,this._lastTime)),this._radianceMapDirty&&(e4e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(t4e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(n4e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){i4e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};si.prototype.isDestroyed=function(){return!1};si.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&this._irradianceMapTexture.destroy(),ue(this)};si.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};si.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(H.fromCssColorString("#717145"));si.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var c_=si;var tO={HIGHLIGHT:0,REPLACE:1,MIX:2};tO.getColorBlend=function(e,t){if(e===tO.HIGHLIGHT)return 0;if(e===tO.REPLACE)return 1;if(e===tO.MIX)return P.clamp(t,P.EPSILON4,1)};var mc=Object.freeze(tO);var o4e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},pc=Object.freeze(o4e);var r4e={STEP:0,LINEAR:1,CUBICSPLINE:2},nh=Object.freeze(r4e);var zse={};function nO(e){this._count=e.count,this._properties=Ge(e.properties,!0)}nO.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,zse)};nO.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,zse,e)};nO.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ge(n[e],!0)};nO.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ge(n,!0)};var l_=nO;function _c(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(_c.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});_c.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};_c.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};_c.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};_c.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var PW=[];_c.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(PW)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,PW)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(PW)),t};_c.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};_c.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new l_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};_c.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};_c.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};_c.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};_c.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};_c.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};_c.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};_c.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var tl=_c;function iO(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=Vl.createModelTextureReader({textureInfo:r,channels:c4e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(iO.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});iO.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(yt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(yt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==lt.SCALAR?(yt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Vt.UINT8?(yt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:lt.isVectorType(t)||t===lt.SCALAR?n!==Vt.UINT8?(yt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(yt(`Property texture property ${e.id} has an unsupported type`),!1)};var s4e=[void 0,"float","vec2","vec3","vec4"],a4e=[void 0,"int","ivec2","ivec3","ivec4"];iO.prototype.getGlslType=function(){let e=this._classProperty,t=lt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?s4e[t]:a4e[t]};iO.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function c4e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var oO=iO;function RW(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new oO({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(RW.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});RW.prototype.getProperty=function(e){return this._properties[e]};var u_=RW;function Hse(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=y(i,n.offset),o=y(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Hse.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var rO=Hse;function OW(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new rO({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(OW.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});OW.prototype.getProperty=function(e){return this._properties[e]};var Ab=OW;function sO(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(sO.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});sO.prototype.getPropertyTable=function(e){return this._propertyTables[e]};sO.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};sO.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var qs=sO;function l4e(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=new Bl({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new tl({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new u_({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new Ab({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new qs({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var aO=l4e;function u4e(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],u=n.classes[c.class],f=new Bl({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new tl({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new u_({id:a,propertyTexture:f4e(c),class:n.classes[c.class],textures:e.textures}))}return new qs({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function f4e(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:d4e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=bt(o.texture,r,!0)}return t}function d4e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var cO=u4e;function Cy(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:u=!0}=e;this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(Cy.prototype=Object.create(Ki.prototype),Cy.prototype.constructor=Cy);Object.defineProperties(Cy.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function h4e(e){try{let t=y4e(e),n=A4e(e),i=E4e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=pt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load structural metadata",t)}}Cy.prototype.load=function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,this._promise=h4e(this),this._promise)};function m4e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function p4e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function _4e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];m4e(o.properties,n)}return n}function g4e(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&p4e(r,n)}}return n}async function y4e(e){let t;l(e._extension)?t=_4e(e._extension):t=g4e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Ei.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function x4e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&b4e(r,t)}return t}function b4e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function T4e(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&C4e(r,t)}}return t}function C4e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function A4e(e){let t;l(e._extension)?t=x4e(e._extension):t=T4e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Ei.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function E4e(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Ei.getSchemaLoader({resource:i})}else n=Ei.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}Cy.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],u=t[a];u.isDestroyed()||(s[c]=u.texture)}return l(this._extension)?this._structuralMetadata=aO({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=cO({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),Gse(this),this._state=pt.READY,!0};function Gse(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ei.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function S4e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ei.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}Cy.prototype.unload=function(){Gse(this),S4e(this),l(this._schemaLoader)&&Ei.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var lO=Cy;var YA={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};YA.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return YA.TRANSLATION;case"ROTATION":return YA.ROTATION;case"SCALE":return YA.SCALE;case"_FEATURE_ID":return YA.FEATURE_ID}};var os=Object.freeze(YA);var v4e=65534,w4e=255;function nz(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new qse(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],D4e(this)}Object.defineProperties(nz.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function D4e(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),x=Wse(i,c,u,f,p,g,m);for(;l(x);){let b=s[x];if(!l(b)){b=r+o.length;let T=x;for(;T>=r;)T=o[T-r];o.push(T),s[x]=b}b>v4e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>w4e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=b,t[a]=b):x===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),x=Wse(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Wse(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=MW(e,t,a,c,u);if(f===0)return t;let d=0,p=o?1:0,g=r?1:0,m=MW(e,n,d,p,g);if(m===0)return n;let x=s?1:0,b=0,T=r?1:0,C=MW(e,i,x,b,T);if(C===0)return i;let A=f&m&C,E,v,D;if(A&1)E=0,v=1,D=2;else if(A&2)E=0,D=1,v=2;else if(A&4)v=0,E=1,D=2;else if(A&8)v=0,D=1,E=2;else if(A&16)D=0,E=1,v=2;else if(A&32)D=0,v=1,E=2;else{let N=LW(f),_=LW(m),S=LW(C);return N<_&&N<S?t:_<S?n:i}let O=t*3;e[O+E]=a,e[O+v]=c,e[O+D]=u;let R=n*3;e[R+E]=d,e[R+v]=p,e[R+D]=g;let M=i*3;e[M+E]=x,e[M+v]=b,e[M+D]=T}function MW(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function LW(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}nz.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};nz.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Nt.maximumTextureSize),i=n,o=jse(i),r=[];for(;i>1;)i>>=1,r.push(jse(i));let s=new Pt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:et.LUMINANCE,sampler:new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR_MIPMAP_LINEAR,magnificationFilter:di.LINEAR})});return t.outlineTexture=s,s};function jse(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function qse(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}qse.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var Eb=nz;function Yse(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function I4e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function iz(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}iz.prototype.postProcess=function(e){this.needsOutlines&&(P4e(this),O4e(this,e))};function P4e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new Eb({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ne.fromTypedArray(n.typedArray);let r=R4e(o.outlineCoordinates),s=new Yse(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function R4e(e){let t=new xn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=X.FLOAT,t.type=on.VEC3,t.normalized=!1,t.count=e.length/3,t}function O4e(e,t){M4e(e.attributePlans,t),l(e.indicesPlan)&&L4e(e.indicesPlan,t)}function M4e(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=gt.createVertexBuffer({typedArray:s,context:t,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function L4e(e,t){let n=e.indices;if(e.loadBuffer){let i=gt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Fe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}iz.AttributeLoadPlan=Yse;iz.IndicesLoadPlan=I4e;var Sb=iz;function N4e(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var uO=N4e;function Xse(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Xse.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var fO=Xse;function Kse(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(Kse.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var dO=Kse;function Zse(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Zse.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var hO=Zse;var F4e={Direct:"Direct",Indirect:"Indirect"},Ay=Object.freeze(F4e);function $se(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties($se.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var XA=$se;function Qse(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Qse.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var mO=Qse;function KA(){}function Jse(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function B4e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new fO({position:t,adjustmentParams:n})}function k4e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=Jse(e.covarianceMatrix);return new dO({position:t,adjustmentParams:n,covarianceMatrix:i})}function V4e(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let r of e.params){let s=new mO({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new hO({groupFlags:t,rotationThetas:n,params:i})}KA.load=function(e){let t=e.storageType;if(t===Ay.Direct)return KA.loadDirect(e);if(t===Ay.Indirect)return KA.loadIndirect(e);throw new re(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};KA.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=B4e(r);t.push(s)}let i=Jse(e.covarianceDirectUpperTriangle);return new XA({storageType:Ay.Direct,anchorPointsDirect:t,covarianceDirect:i})};KA.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=k4e(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=V4e(s);o.push(a)}return new XA({storageType:Ay.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var pO=KA;function eae(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(eae.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var _O=eae;function tae(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(tae.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var gO=tae;function nae(e){this._ppeTextures=e}Object.defineProperties(nae.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var yO=nae;function wr(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=y(e.asynchronous,!0);this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(wr.prototype=Object.create(Ki.prototype),wr.prototype.constructor=wr);Object.defineProperties(wr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});wr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=pt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=pt.FAILED,this.getError("Failed to load GPM data",e)}};wr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,this._promise=this._loadResources(this),this._promise)};function U4e(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}wr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=U4e(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Ei.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};wr.ppeTexturesMetadataSchemaCache=new Map;wr._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,o=e.offset??0,r=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:o,scale:r,min:n.min,max:n.max}}}};wr._obtainPpeTexturesMetadataSchema=function(e){let n=wr._collectPpeTexturePropertyIdentifiers(e).toString(),i=wr.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${wr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=wr._createPpeTextureClassJson(c,a);r.classes[u]=f}return i=vu.fromJson(r),wr.ppeTexturesMetadataSchemaCache.set(n,i),i};wr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=wr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};wr._convertToStructuralMetadata=function(e,t){let n=[],i=wr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,f=a.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new u_({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new qs({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};wr.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(o[f]=d.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let d=f.traits,p=new gO({min:d.min,max:d.max,source:d.source}),g=new _O({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(g)}}let a=new yO(r);this._meshPrimitiveGpmLocal=a;let c=wr._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=pt.READY,!0};wr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Ei.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};wr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var xO=wr;var{Attribute:z4e,Indices:H4e,FeatureIdAttribute:iae,FeatureIdTexture:oae,FeatureIdImplicitRange:rae,MorphTarget:G4e,Primitive:W4e,Instances:j4e,Skin:q4e,Node:Y4e,AnimatedPropertyType:X4e,AnimationSampler:K4e,AnimationTarget:Z4e,AnimationChannel:$4e,Animation:Q4e,ArticulationStage:J4e,Articulation:eHe,Asset:tHe,Scene:nHe,Components:iHe,MetallicRoughness:oHe,SpecularGlossiness:rHe,Specular:sHe,Anisotropy:NW,Clearcoat:FW,Material:aHe}=xn,Fo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function ih(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=Lo.Y,forwardAxis:a=Lo.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:u=!1,enablePick:f=!1,loadIndicesForWireframe:d=!1,loadPrimitiveOutline:p=!0,loadForClassification:g=!1,renameBatchIdSemantic:m=!1}=e,{baseResource:x=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=x,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=c,this._loadAttributesFor2D=u,this._enablePick=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=m,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Fo.NOT_LOADED,this._textureState=Fo.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(ih.prototype=Object.create(Ki.prototype),ih.prototype.constructor=ih);Object.defineProperties(ih.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function cHe(e){e._state=Fo.LOADING,e._textureState=Fo.LOADING;try{let t=Ei.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Fo.LOADED,e._textureState=Fo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Fo.FAILED,e._textureState=Fo.FAILED,oz(e,t)}}async function lHe(e,t){Ht.supportsWebP.initialized||await Ht.supportsWebP.initialize(),e._supportedImageFormats=new uO({webp:Ht.supportsWebP(),basis:t.context.supportsBasis});let n=d8e(e,t);return e._state=Fo.PROCESSING,e._textureState=Fo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ei.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}ih.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=cHe(this),this._promise)};function oz(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function uHe(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(l(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(l(r)){let s=r.process(t);s&&(l(e._components.structuralMetadata)&&yt("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&s}n&&(e._state=Fo.POST_PROCESSING)}function fHe(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&dHe(e,o)}}function dHe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let c=r[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}ih.prototype._process=function(e){return this._state===Fo.READY?!0:(this._state===Fo.PROCESSING&&uHe(this,e),this._resourcesLoaded&&this._state===Fo.POST_PROCESSING&&(fHe(this,e.context),this._state=Fo.PROCESSED),this._resourcesLoaded&&this._state===Fo.PROCESSED?(mae(this),this._typedArray=void 0,this._state=Fo.READY,!0):!1)};ih.prototype._processTextures=function(e){if(this._textureState===Fo.READY)return!0;if(this._textureState!==Fo.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&l(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=Fo.READY,this._texturesLoaded=!0,!0):!1};ih.prototype.process=function(e){if(this._state===Fo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=lHe(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=Fo.FAILED;let o=this._processError;this._processError=void 0,oz(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===Fo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Fo.FAILED,oz(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Fo.FAILED,oz(this,o)}return this._incrementallyLoadTextures?n:n&&i};function hHe(e,t,n,i,o,r,s){let a=e.gltfJson,u=a.accessors[t].bufferView;return Ei.getVertexBufferLoader({gltf:a,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,bufferViewId:u,draco:i,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function mHe(e,t,n,i,o,r){return Ei.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:r,draco:n,asynchronous:e._asynchronous,loadBuffer:i,loadTypedArray:o})}function pHe(e,t){let n=Ei.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function sae(e,t,n){let i=t.byteOffset,o=kl(e,t),r=t.count,s=Su(t.type),a=t.componentType,c=X.getSizeInBytes(a),u=c*s,f=r*s;if(o===u)return n=new Uint8Array(n),X.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=X.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=o_(t.componentType);i=n.byteOffset+i;for(let x=0;x<r;++x){m(p,i,s,c,g);for(let b=0;b<s;++b)d[x*s+b]=g[b];i+=o}return d}function _He(e,t){let n=e.type;if(n===on.SCALAR)return t.fill(0);let i=on.getMathType(n);return t.fill(i.clone(i.ZERO))}function gHe(e,t,n,i){let o=e.type,r=e.count;if(o===on.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===on.VEC4&&i)for(let s=0;s<r;s++)n[s]=Oe.unpack(t,s*4);else{let s=on.getMathType(o),a=on.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function yHe(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=sae(r,n,t.typedArray);i=y(i,!1),gHe(n,s,o,i)}function rz(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=pHe(e,o),s=yHe(e,r,t,n,i);return e._loaderPromises.push(s),i}return _He(t,i)}function wu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function xHe(e){return e===Number?0:new e}function bHe(e){switch(e){case X.BYTE:return 127;case X.UNSIGNED_BYTE:return 255;case X.SHORT:return 32767;case X.UNSIGNED_SHORT:return 65535;default:return 1}}var THe={VEC2:new z(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new oe(-1,-1,-1,-1)};function CHe(e,t){let n=bHe(e.componentDatatype),i=THe[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function AHe(e,t,n){let i=e.decodeMatrix,o=wu(n,e.decodedMin),r=wu(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new xn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new z(i[6],i[7]),s.quantizedVolumeStepSize=new z(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new oe(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new oe(i[0],i[6],i[12],i[18])),t.quantization=s}function EHe(e,t,n,i,o){let r=e.accessors[t],s=on.getMathType(r.type),a=y(r.normalized,!1),c=new z4e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=xHe(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=wu(s,r.min),c.max=wu(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=kl(e,r),ii(r,"WEB3D_quantized_attributes")&&AHe(r.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===At.POSITION||c.semantic===At.NORMAL||c.semantic===At.TANGENT||c.semantic===At.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&CHe(c,s),c}function aae(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var SHe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function BW(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=SHe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function vHe(e){let t=e===At.POSITION,n=e===At.FEATURE_ID,i=e===At.TEXCOORD;return t||n||i}function wHe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=X.createArrayBufferView(o,t.typedArray.buffer)}}function DHe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=sae(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function cae(e,t,n,i,o,r,s){let a=e.gltfJson,c=a.accessors[t],u=c.bufferView,f=n.gltfSemantic,d=n.renamedSemantic,p=n.modelSemantic,g=l(p)?aae(d):void 0,x=EHe(a,t,f,p,g);if(!l(i)&&!l(u))return x;let b=hHe(e,t,f,i,o,r,s),T=e._geometryLoaders.length;e._geometryLoaders.push(b);let C=b.load();return e._loaderPromises.push(C),e._geometryCallbacks[T]=()=>{l(i)&&l(i.attributes)&&l(i.attributes[f])?wHe(x,b,o,r):DHe(a,c,x,b,o,r)},x}function lae(e,t,n,i,o,r,s){let a=n.modelSemantic,c=a===At.POSITION,u=a===At.FEATURE_ID,f=c&&!o&&e._loadAttributesFor2D&&!s.scene3DOnly,d=c&&e._enablePick&&!s.context.webgl2,p=e._loadForClassification&&u,g=e._loadAttributesAsTypedArray,m=!g,x=g||f||d||p,C=cae(e,t,n,i,r?!1:m,r?!0:x,s),A=new Sb.AttributeLoadPlan(C);return A.loadBuffer=m,A.loadTypedArray=x,A}function IHe(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=BW(e,os,i),u=c.modelSemantic,f=u===os.TRANSLATION||u===os.ROTATION||u===os.SCALE,d=u===os.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,m=!p,x=e._loadAttributesFor2D&&!o.scene3DOnly;return cae(e,t,c,void 0,m,p||d&&(!a||x||g),o)}function PHe(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView;if(!l(n)&&!l(a))return;let c=new H4e;c.count=s.count;let u=e._loadAttributesAsTypedArray,f=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,d=e._loadForClassification&&i,g=!u,m=u||f||d,T=mHe(e,t,n,o?!1:g,o?!0:m,r),C=e._geometryLoaders.length;e._geometryLoaders.push(T);let A=T.load();e._loaderPromises.push(A),e._geometryCallbacks[C]=()=>{c.indexDatatype=T.indexDatatype,c.buffer=T.buffer,c.typedArray=T.typedArray};let E=new Sb.IndicesLoadPlan(c);return E.loadBuffer=g,E.loadTypedArray=m,E}function nl(e,t,n,i){let o=e.gltfJson,r=Vl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Ei.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=Vl.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=Fo.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function RHe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new rHe;return l(i)&&(c.diffuseTexture=nl(e,i,n)),l(o)&&(c.specularGlossinessTexture=nl(e,o,n)),c.diffuseFactor=wu(oe,r),c.specularFactor=wu(h,s),c.glossinessFactor=a,c}function OHe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new oHe;return l(i)&&(c.baseColorTexture=nl(e,i,n)),l(o)&&(c.metallicRoughnessTexture=nl(e,o,n)),c.baseColorFactor=wu(oe,r),c.metallicFactor=s,c.roughnessFactor=a,c}function MHe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new sHe;return l(o)&&(a.specularTexture=nl(e,o,n)),l(s)&&(a.specularColorTexture=nl(e,s,n)),a.specularFactor=i,a.specularColorFactor=wu(h,r),a}function LHe(e,t,n){let{anisotropyStrength:i=NW.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=NW.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new NW;return l(r)&&(s.anisotropyTexture=nl(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function NHe(e,t,n){let{clearcoatFactor:i=FW.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=FW.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new FW;return l(o)&&(c.clearcoatTexture=nl(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=nl(e,s,n)),l(a)&&(c.clearcoatNormalTexture=nl(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function FHe(e,t,n){let i=new aHe,o=y(t.extensions,y.EMPTY_OBJECT),r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=RHe(e,r,n):(l(u)&&(i.metallicRoughness=OHe(e,u,n)),l(s)&&!i.unlit&&(i.specular=MHe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=LHe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=NHe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=nl(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=nl(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=nl(e,t.occlusionTexture,n)),i.emissiveFactor=wu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function uae(e,t){let n=new iae;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function fae(e,t,n,i){let o=new iae,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=aae(r.attribute),o.positionalLabel=i,o}function dae(e,t){let n=new rae;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function hae(e,t,n,i){let o=new rae,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function BHe(e,t,n,i){let o=new oae;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=nl(e,r,n,$t.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function kHe(e,t,n,i,o,r){let s=new oae,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=nl(e,c,i,$t.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function VHe(e,t,n,i,o){let r=new G4e,s=void 0,a=!1;for(let c in t){if(!t.hasOwnProperty(c))continue;let u=t[c],f=BW(e,At,c),d=lae(e,u,f,s,a,n,o);r.attributes.push(d.attribute),i.attributePlans.push(d)}return r}function UHe(e,t,n,i){let o=new W4e,r=new Sb(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=FHe(e,e.gltfJson.materials[s],i));let a=y(t.extensions,y.EMPTY_OBJECT),c=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(u)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=zHe(e,u,r));let f=e._loadForClassification,d=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(l(g))for(let v in g){if(!g.hasOwnProperty(v))continue;let D=g[v],O=BW(e,At,v),R=O.modelSemantic;if(f&&!vHe(R))continue;R===At.FEATURE_ID&&(p=!0);let M=lae(e,D,O,d,n,c,i);r.attributePlans.push(M),o.attributes.push(M.attribute)}let m=t.targets;if(l(m)&&!f)for(let v=0;v<m.length;++v)o.morphTargets.push(VHe(e,m[v],c,r,i));let x=t.indices;if(l(x)){let v=PHe(e,x,d,p,c,i);l(v)&&(r.indicesPlan=v,o.indices=v.indices)}let b=a.EXT_structural_metadata,T=a.EXT_mesh_features,C=a.EXT_feature_metadata,A=l(C);l(T)?HHe(e,o,T,i):A&&GHe(e,o,C,i),l(b)?WHe(o,b):A&&jHe(e,o,C);let E=t.mode;if(f&&E!==Me.TRIANGLES)throw new re("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function zHe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return rz(e,i,!1)}function HHe(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,c;l(s.texture)?c=BHe(e,s,i,a):l(s.attribute)?c=uae(s,a):c=dae(s,a),t.featureIds.push(c)}}function GHe(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m;l(u.featureIds.attribute)?m=fae(u,d,p,g):m=hae(u,d,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m=kHe(e,u,d,i,p,g);t.featureIds.push(m)}}function WHe(e,t){l(t)&&(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function jHe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function qHe(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new j4e,r=i.attributes;if(l(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(IHe(e,f,r,u,n))}let s=y(i.extensions,y.EMPTY_OBJECT),a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?YHe(o,a):l(c)&&XHe(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function YHe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=uae(o,r):s=dae(o,r),e.featureIds.push(s)}}function XHe(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,u=i.indexOf(c),f=o[c].count,d=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=fae(a,u,f,d):p=hae(a,u,f,d),t.featureIds.push(p)}}function KHe(e,t,n){let i=new Y4e;i.name=t.name,i.matrix=wu(F,t.matrix),i.translation=wu(h,t.translation),i.rotation=wu(Oe,t.rotation),i.scale=wu(h,t.scale);let o=y(t.extensions,y.EMPTY_OBJECT),r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new re("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=qHe(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],u=c.primitives;for(let p=0;p<u.length;++p)i.primitives.push(UHe(e,u[p],l(i.instances),n));let f=y(t.weights,c.weights),d=i.primitives[0].morphTargets;i.morphWeights=l(f)?f.slice():new Array(d.length).fill(0)}return i}function ZHe(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=KHe(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function $He(e,t,n){let i=new q4e,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=rz(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(F.IDENTITY);return i}function QHe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=$He(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;l(s)&&(t[r].skin=i[s])}return i}async function JHe(e,t,n,i){let o=new lO({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=o,o.load()}async function e8e(e,t,n,i){let o=new xO({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=o,o.load()}function t8e(e,t){let n=new K4e,i=e.gltfJson.accessors,o=i[t.input];n.input=rz(e,o);let r=t.interpolation;n.interpolation=y(nh[r],nh.LINEAR);let s=i[t.output];return n.output=rz(e,s,!0),n}function n8e(e,t){let n=new Z4e,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=X4e[o],n}function i8e(e,t,n){let i=new $4e,o=e.sampler;return i.sampler=t[o],i.target=n8e(e.target,n),i}function o8e(e,t,n){let i=new Q4e;i.name=t.name;let o=t.samplers.map(function(s,a){let c=t8e(e,s);return c.index=a,c}),r=t.channels.map(function(s){return i8e(s,o,n)});return i.samplers=o,i.channels=r,i}function r8e(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=o8e(e,o,t);return s.index=r,s})}function s8e(e){let t=new J4e;t.name=e.name;let n=e.type.toUpperCase();return t.type=pc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function a8e(e){let t=new eHe;return t.name=e.name,t.stages=e.stages.map(s8e),t}function c8e(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(a8e):[]}function l8e(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function u8e(e,t){let n=new nHe,i=l8e(e);return n.nodes=i.map(function(o){return t[o]}),n}var f8e=new h;function d8e(e,t){let n=e.gltfJson,i=y(n.extensions,y.EMPTY_OBJECT),o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let C=r.featureTables,A=r.featureTextures,E=l(C)?C:[],v=l(A)?A:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=ZHe(e,t),c=QHe(e,a),u=r8e(e,a),f=c8e(n),d=u8e(n,a),p=new iHe,g=new tHe,m=n.asset.copyright;if(l(m)){let C=m.split(";").map(function(A){return new Tt(A.trim())});g.credits=C}if(p.asset=g,p.scene=d,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let C=h.fromArray(s.center,0,f8e);p.transform=F.fromTranslation(C,p.transform)}if(e._components=p,l(o)||l(r)){let C=JHe(e,o,r,t);e._loaderPromises.push(C)}let x=i.NGA_gpm_local;if(l(x)){let C=pO.load(x);e._components.extensions.NGA_gpm_local=C}let b=n.meshes;if(l(b))for(let C of b){let A=C.primitives;if(l(A))for(let E of A){let v=E.extensions;if(l(v)){let D=v.NGA_gpm_local;if(l(D)){let O=e8e(e,n,D,t);e._loaderPromises.push(O)}}}}let T=[];return T.push.apply(T,e._loaderPromises),e._incrementallyLoadTextures||T.push.apply(T,e._texturesPromises),Promise.all(T)}function h8e(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ei.unload(t[n]);e._textureLoaders.length=0}function mae(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ei.unload(t[n]);e._bufferViewLoaders.length=0}function m8e(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ei.unload(t[n]);e._geometryLoaders.length=0}function p8e(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function _8e(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function g8e(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}ih.prototype.isUnloaded=function(){return this._state===Fo.UNLOADED};ih.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ei.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,h8e(this),mae(this),m8e(this),p8e(this),_8e(this),g8e(this),this._components=void 0,this._typedArray=void 0,this._state=Fo.UNLOADED};var f_=ih;var bO=`uniform sampler2D u_pointCloud_colorGBuffer; -uniform sampler2D u_pointCloud_depthGBuffer; -uniform vec2 u_distanceAndEdlStrength; -in vec2 v_textureCoordinates; - -vec2 neighborContribution(float log2Depth, vec2 offset) -{ - float dist = u_distanceAndEdlStrength.x; - vec2 texCoordOrig = v_textureCoordinates + offset * dist; - vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); - vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); - - float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); - float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); - - // ignore depth values that are the clear depth - if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { - return vec2(0.0); - } - - // interpolate the two adjacent depth values - float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); - return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); -} - -void main() -{ - float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); - eyeCoordinate /= eyeCoordinate.w; - - float log2Depth = log2(-eyeCoordinate.z); - - if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer - { - discard; - } - - vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); - - // sample from neighbors left, right, down, up - vec2 texelSize = 1.0 / czm_viewport.zw; - - vec2 responseAndCount = vec2(0.0); - - responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); - responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); - responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); - responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); - - float response = responseAndCount.x / responseAndCount.y; - float strength = u_distanceAndEdlStrength.y; - float shade = exp(-response * 300.0 * strength); - color.rgb *= shade; - out_FragColor = vec4(color); - - // Input and output depth are the same. - gl_FragDepth = depthOrLogDepth; -} -`;function ZA(){this._framebuffer=new hi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(ZA.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function y8e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var kW=new z;function x8e(e,t){let n=new Ue({defines:["LOG_DEPTH_WRITE"],sources:[bO]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return kW.x=e._radius,kW.y=e._strength,kW}},o=Ve.fromCache({blending:un.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Ut.setCesium3DTileBit(),stencilMask:Ut.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:we.CESIUM_3D_TILE,owner:e}),e._clearCommand=new Jn({framebuffer:e.framebuffer,color:new H(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:we.CESIUM_3D_TILE,owner:e})}function b8e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),x8e(e,t)}function pae(e){return e.drawBuffers&&e.fragmentDepth}ZA.isSupported=pae;function T8e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; -layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=Ue.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() -{ - czm_point_cloud_post_process_main(); -#ifdef LOG_DEPTH - czm_writeLogDepth(); - out_FragData_1 = czm_packDepth(gl_FragDepth); -#else - out_FragData_1 = czm_packDepth(gl_FragCoord.z); -#endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}ZA.prototype.update=function(e,t,n,i){if(!pae(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,b8e(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Me.POINTS||u.pass===we.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=Ze.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=T8e(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};ZA.prototype.isDestroyed=function(){return!1};ZA.prototype.destroy=function(){return y8e(this),ue(this)};var d_=ZA;function _ae(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}_ae.isSupported=function(e){return d_.isSupported(e.context)};var Am=_ae;var Fa={},C8e=new oe(0,0,0,1),gc=new oe,A8e=new je,VW=new z,UW=new z;Fa.worldToWindowCoordinates=function(e,t,n){return Fa.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var gae=new oe,yae=new h;function TO(e,t,n,i){let o=n.viewMatrix,r=F.multiplyByVector(o,oe.fromElements(e.x,e.y,e.z,1,gae),gae),s=h.multiplyComponents(t,h.normalize(r,yae),yae);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,r,i)}var E8e=new fe(Math.PI,P.PI_OVER_TWO),S8e=new h,v8e=new h;Fa.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Fa.computeActualEllipsoidPosition(o,t,C8e);if(!l(r))return;let s=e.canvas,a=A8e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(o.mode===ne.SCENE2D){let f=e.mapProjection,d=E8e,p=f.project(d,S8e),g=h.clone(c.position,v8e),m=c.frustum.clone(),x=F.computeViewportTransformation(a,0,1,new F),b=c.frustum.projectionMatrix,T=c.positionWC.y,C=h.fromElements(P.sign(T)*p.x-T,0,-c.positionWC.x),A=Mt.pointToGLWindowCoordinates(b,x,C);if(T===0||A.x<=0||A.x>=s.clientWidth)u=!0;else{if(A.x>s.clientWidth*.5){a.width=A.x,c.frustum.right=p.x-T,gc=TO(r,n,c,gc),Fa.clipToGLWindowCoordinates(a,gc,VW),a.x+=A.x,c.position.x=-c.position.x;let E=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-E,gc=TO(r,n,c,gc),Fa.clipToGLWindowCoordinates(a,gc,UW)}else{a.x+=A.x,a.width-=A.x,c.frustum.left=-p.x-T,gc=TO(r,n,c,gc),Fa.clipToGLWindowCoordinates(a,gc,VW),a.x=a.x-a.width,c.position.x=-c.position.x;let E=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-E,gc=TO(r,n,c,gc),Fa.clipToGLWindowCoordinates(a,gc,UW)}h.clone(g,c.position),c.frustum=m.clone(),i=z.clone(VW,i),(i.x<0||i.x>s.clientWidth)&&(i.x=UW.x)}}if(o.mode!==ne.SCENE2D||u){if(gc=TO(r,n,c,gc),gc.z<0&&!(c.frustum instanceof rn)&&!(c.frustum instanceof Fr))return;i=Fa.clipToGLWindowCoordinates(a,gc,i)}return i.y=s.clientHeight-i.y,i};Fa.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Fa.worldToWindowCoordinates(e,t,n),!!l(n))return Fa.transformWindowToDrawingBuffer(e,n,n)};var h_=new h,w8e=new fe;Fa.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,w8e);if(!l(r))return;if(o.project(r,h_),i===ne.COLUMBUS_VIEW)return h.fromElements(h_.z,h_.x,h_.y,n);if(i===ne.SCENE2D)return h.fromElements(0,h_.x,h_.y,n);let s=e.morphTime;return h.fromElements(P.lerp(h_.z,t.x,s),P.lerp(h_.x,t.y,s),P.lerp(h_.y,t.z,s),n)};var xae=new h,bae=new h,Tae=new F;Fa.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,xae),F.computeViewportTransformation(e,0,1,Tae),F.multiplyByPoint(Tae,xae,bae),z.fromCartesian3(bae,n)};Fa.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return z.fromElements(t.x*o,t.y*r,n)};var D8e=new oe,Cae=new oe;Fa.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=oe.clone(oe.UNIT_W,D8e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=F.multiplyByVector(r.inverseViewProjection,f,Cae);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=Cae,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=F.multiplyByVector(r.inverseView,d,d)}return h.fromCartesian4(d,i)};var zi=Fa;var $A={};$A._deprecationWarning=ms;var m_=Uint32Array.BYTES_PER_ELEMENT;$A.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=m_;let r=o.getUint32(t,!0);if(r!==1)throw new re(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=m_;let s=o.getUint32(t,!0);t+=m_;let a=o.getUint32(t,!0);t+=m_;let c=o.getUint32(t,!0);t+=m_;let u=o.getUint32(t,!0);t+=m_;let f=o.getUint32(t,!0);t+=m_;let d;u>=570425344?(t-=m_*2,d=a,u=c,f=0,a=0,c=0,$A._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=m_,d=u,u=a,f=c,a=0,c=0,$A._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(d,0)}:(p=No(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,x;u>0&&(m=No(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new re("glTF byte length must be greater than 0.");let T;return t%4===0?T=new Uint8Array(e,t,b):($A._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),T=new Uint8Array(i.subarray(t,t+b))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:x,gltf:T}};var CO=$A;function AO(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Aae(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=X.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function I8e(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=X.createTypedArray(n,i),o[t]=r),r}AO.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,X.UNSIGNED_INT),n=y(n,1),Aae(this,e,t,n,1,i.byteOffset)):i};AO.prototype.hasProperty=function(e){return l(this.json[e])};AO.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=X.fromName(i.componentType)),Aae(this,e,t,n,this.featuresLength,i.byteOffset)):I8e(this,e,t,i)};AO.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var oh=AO;function EO(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=y(e.parseAsPropertyAttributes,!1),r=e.customAttributeOutput,s=P8e(n),a;l(s.jsonProperties)&&(a=new l_({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new eb({extension:s.hierarchy,binaryBody:i}));let u=Qd.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(o){let b=O8e(t,u,f,i,r);g=b.transcodedSchema,p=[new Ab({propertyAttribute:b.propertyAttributeJson,class:b.transcodedClass})]}else{let b=R8e(t,u,f,i);g=b.transcodedSchema;let T=b.featureTableJson;d=new Bl({count:T.count,properties:T.properties,class:b.transcodedClass,bufferViews:b.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(a)||l(c)){let b=new tl({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});m.push(b)}let x={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new qs(x)}function P8e(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(EO._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function R8e(e,t,n,i){let o={},r={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new re(`Property ${d} requires a batch table binary.`);let p=n[d],g=Au(p);r[d]={bufferView:a},o[d]=Eae(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let u=vu.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function O8e(e,t,n,i,o){let r={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new re(`Property ${d} requires a batch table binary.`);let g=Kt.sanitizeGlslIdentifier(d);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=Eae(p);m.name=d,r[g]=m;let x=g.toUpperCase();x.startsWith("_")||(x=`_${x}`);let b=p.typedArray;l(b)||(b=Au(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let T=new xn.Attribute;T.name=x,T.count=e,T.type=p.type;let C=X.fromTypedArray(b);(C===X.INT||C===X.UNSIGNED_INT||C===X.DOUBLE)&&(EO._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${x}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),b=new Float32Array(b)),T.componentDatatype=X.fromTypedArray(b),T.typedArray=b,o.push(T),s[g]={attribute:x}}let c={classes:{}};c.classes[t]={properties:r};let u=vu.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function Eae(e){let t=M8e(e.componentType);return{type:e.type,componentType:t}}function M8e(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}EO._deprecationWarning=ms;EO._oneTimeWarning=yt;var p_=EO;var vb={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},L8e=xn.FeatureIdAttribute;function Ey(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Lo.Y),u=y(e.forwardAxis,Lo.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadAttributesFor2D,!1),p=y(e.enablePick,!1),g=y(e.loadIndicesForWireframe,!1),m=y(e.loadPrimitiveOutline,!0),x=y(e.loadForClassification,!1);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=d,this._enablePick=p,this._loadIndicesForWireframe=g,this._loadPrimitiveOutline=m,this._loadForClassification=x,this._state=vb.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(Ey.prototype=Object.create(Ki.prototype),Ey.prototype.constructor=Ey);Object.defineProperties(Ey.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Ey.prototype.load=function(){if(l(this._promise))return this._promise;let e=CO.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new oh(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(a)&&(this._transform=F.fromTranslation(h.fromArray(a))),this._batchTable={json:o,binary:r};let c=new f_({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=vb.LOADING;let u=this;return this._promise=c.load().then(function(){if(!u.isDestroyed())return u._state=vb.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return N8e(u,f)}),this._promise};function N8e(e,t){return e.unload(),e._state=vb.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}Ey.prototype.process=function(e){if(this._state===vb.READY)return!0;if(this._state!==vb.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),F8e(this,n),this._components=n,this._arrayBuffer=void 0,this._state=vb.READY,!0};function F8e(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=p_({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new tl({name:Qd.BATCH_TABLE_CLASS_NAME,count:i});o=new qs({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)Sae(r[a]);t.structuralMetadata=o}function Sae(e){let t=e.children.length;for(let i=0;i<t;i++)Sae(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Kt.getAttributeBySemantic(o,At.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new L8e;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}Ey.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var SO=Ey;function Sy(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(Sy.prototype=Object.create(Ki.prototype),Sy.prototype.constructor=Sy);Object.defineProperties(Sy.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Sy.prototype.load=function(){return Promise.resolve(this)};Sy.prototype.process=function(e){return l(this._components)||(this._components=K8e(this._geoJson,e),this._geoJson=void 0),!0};function B8e(){this.lines=void 0,this.points=void 0,this.properties=void 0}function k8e(){this.features=[]}function zW(e){let t=e[0],n=e[1],i=y(e[2],0);return new h(t,n,i)}function HW(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=zW(e[o]);return[n]}function V8e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=HW(e[i])[0];return n}function vae(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=HW(e[i])[0];return n}function U8e(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,vae(e[i]));return n}function z8e(e){return[zW(e)]}function H8e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=zW(e[i]);return n}var G8e={LineString:HW,MultiLineString:V8e,MultiPolygon:U8e,Polygon:vae,MultiPoint:H8e,Point:z8e},W8e={LineString:Me.LINES,MultiLineString:Me.LINES,MultiPolygon:Me.LINES,Polygon:Me.LINES,MultiPoint:Me.POINTS,Point:Me.POINTS};function wae(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=G8e[n],o=W8e[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new B8e;o===Me.LINES?s.lines=i(r):o===Me.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function j8e(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)wae(n[o],t)}var q8e={FeatureCollection:j8e,Feature:wae},sz=new h;function Y8e(e,t,n){let i=0,o=0,r=e.length;for(let M=0;M<r;M++){let N=e[M];if(l(N.lines)){let _=N.lines.length;for(let S=0;S<_;S++){let w=N.lines[S];i+=w.length,o+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ne.createTypedArray(i,o),u=Ne.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let M=0;M<r;M++){let N=e[M];if(!l(N.lines))continue;let _=N.lines.length;for(let S=0;S<_;S++){let w=N.lines[S],I=w.length;for(let L=0;L<I;L++){let B=w[L],U=h.fromDegrees(B.x,B.y,B.z,ee.WGS84,sz),V=F.multiplyByPoint(t,U,sz);h.minimumByComponent(f,V,f),h.maximumByComponent(d,V,d),h.pack(V,s,p*3),a[p]=M,L<I-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let m=gt.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});m.vertexArrayDestroyable=!1;let x=gt.createVertexBuffer({typedArray:a,context:n.context,usage:Fe.STATIC_DRAW});x.vertexArrayDestroyable=!1;let b=gt.createIndexBuffer({typedArray:c,context:n.context,usage:Fe.STATIC_DRAW,indexDatatype:u});b.vertexArrayDestroyable=!1;let T=new xn.Attribute;T.semantic=At.POSITION,T.componentDatatype=X.FLOAT,T.type=on.VEC3,T.count=i,T.min=f,T.max=d,T.buffer=m;let C=new xn.Attribute;C.semantic=At.FEATURE_ID,C.setIndex=0,C.componentDatatype=X.FLOAT,C.type=on.SCALAR,C.count=i,C.buffer=x;let A=[T,C],E=new xn.Material;E.unlit=!0;let v=new xn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=b;let D=new xn.FeatureIdAttribute;D.featureCount=r,D.propertyTableId=0,D.setIndex=0,D.positionalLabel="featureId_0";let O=[D],R=new xn.Primitive;return R.attributes=A,R.indices=v,R.featureIds=O,R.primitiveType=Me.LINES,R.material=E,R}function X8e(e,t,n){let i=0,o=e.length;for(let A=0;A<o;A++){let E=e[A];l(E.points)&&(i+=E.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let A=0;A<o;A++){let E=e[A];if(!l(E.points))continue;let v=E.points.length;for(let D=0;D<v;D++){let O=E.points[D],R=h.fromDegrees(O.x,O.y,O.z,ee.WGS84,sz),M=F.multiplyByPoint(t,R,sz);h.minimumByComponent(a,M,a),h.maximumByComponent(c,M,c),h.pack(M,r,u*3),s[u]=A,u++}}let f=gt.createVertexBuffer({typedArray:r,context:n.context,usage:Fe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=gt.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new xn.Attribute;p.semantic=At.POSITION,p.componentDatatype=X.FLOAT,p.type=on.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new xn.Attribute;g.semantic=At.FEATURE_ID,g.setIndex=0,g.componentDatatype=X.FLOAT,g.type=on.SCALAR,g.count=i,g.buffer=d;let m=[p,g],x=new xn.Material;x.unlit=!0;let b=new xn.FeatureIdAttribute;b.featureCount=o,b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0";let T=[b],C=new xn.Primitive;return C.attributes=m,C.featureIds=T,C.primitiveType=Me.POINTS,C.material=x,C}function K8e(e,t){let n=new k8e,i=q8e[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new re("GeoJSON must have at least one feature");let s={};for(let M=0;M<r;M++){let N=o[M],_=y(N.properties,y.EMPTY_OBJECT);for(let S in _)_.hasOwnProperty(S)&&(l(s[S])||(s[S]=new Array(r)))}for(let M=0;M<r;M++){let N=o[M];for(let _ in s)if(s.hasOwnProperty(_)){let S=y(N.properties[_],"");s[_][M]=S}}let a=new l_({count:r,properties:s}),u=[new tl({id:0,count:r,jsonMetadataTable:a})],f=vu.fromJson({}),d=new qs({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,x=!1;for(let M=0;M<r;M++){let N=o[M];if(l(N.lines)){m=!0;let _=N.lines.length;for(let S=0;S<_;S++){let w=N.lines[S],I=w.length;for(let L=0;L<I;L++)h.minimumByComponent(p,w[L],p),h.maximumByComponent(g,w[L],g)}}if(l(N.points)){x=!0;let _=N.points.length;for(let S=0;S<_;S++){let w=N.points[S];h.minimumByComponent(p,w,p),h.maximumByComponent(g,w,g)}}}let b=h.midpoint(p,g,new h),T=h.fromDegrees(b.x,b.y,b.z,ee.WGS84,new h),C=Mt.eastNorthUpToFixedFrame(T,ee.WGS84,new F),A=F.inverseTransformation(C,new F),E=[];m&&E.push(Y8e(o,A,t)),x&&E.push(X8e(o,A,t));let v=new xn.Node;v.index=0,v.primitives=E;let D=[v],O=new xn.Scene;O.nodes=D;let R=new xn.Components;return R.scene=O,R.nodes=D,R.transform=C,R.structuralMetadata=d,R}Sy.prototype.unload=function(){this._components=void 0};var vO=Sy;var az={};az._deprecationWarning=ms;var vy=Uint32Array.BYTES_PER_ELEMENT;az.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=vy;let r=o.getUint32(t,!0);if(r!==1)throw new re(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=vy;let s=o.getUint32(t,!0);t+=vy;let a=o.getUint32(t,!0);if(a===0)throw new re("featureTableJsonByteLength is zero, the feature table must be defined.");t+=vy;let c=o.getUint32(t,!0);t+=vy;let u=o.getUint32(t,!0);t+=vy;let f=o.getUint32(t,!0);t+=vy;let d=o.getUint32(t,!0);if(d!==1&&d!==0)throw new re(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=vy;let p=No(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,x;u>0&&(m=No(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new re("glTF byte length must be greater than 0.");let T;return t%4===0?T=new Uint8Array(e,t,b):(az._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),T=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:x,gltf:T}};var wO=az;var __={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},cz=xn.Attribute,Z8e=xn.FeatureIdAttribute,Iae=xn.Instances;function g_(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Lo.Y),u=y(e.forwardAxis,Lo.X),f=y(e.loadAttributesAsTypedArray,!1),d=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.enablePick,!1);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=d,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=__.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(g_.prototype=Object.create(Ki.prototype),g_.prototype.constructor=g_);Object.defineProperties(g_.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});g_.prototype.load=function(){if(l(this._promise))return this._promise;let e=wO.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new oh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new re("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(c)&&(this._transform=F.fromTranslation(h.fromArray(c))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let d=Ll(e.gltf);d=d.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:d});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new f_(u);return this._gltfLoader=f,this._state=__.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=__.PROCESSING,this}).catch(d=>{if(!this.isDestroyed())throw $8e(this,d)}),this._promise};function $8e(e,t){return e.unload(),e._state=__.FAILED,e.getError("Failed to load i3dm",t)}g_.prototype.process=function(e){if(this._state===__.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===__.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),eGe(this,i,e),Q8e(this,i),this._components=i,this._arrayBuffer=void 0,this._state=__.READY,!0};function Q8e(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=p_({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new tl({name:Qd.BATCH_TABLE_CLASS_NAME,count:i});o=new qs({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var lz=new h,GW=new Array(4),J8e=new F;function eGe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",X.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=nGe(o,r),d;c&&(d=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let g=new Float32Array(r),m=h.unpackArray(f),x=new h,b=new h,T=new h,C=new h,A=new $,E=new Oe,v=new Array(4),D=new h,O=new Array(3),R=new F;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let V=ae.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],V.center,lz),f[3*i+0]=lz.x,f[3*i+1]=lz.y,f[3*i+2]=lz.z;let G=F.fromTranslation(V.center,J8e);t.transform=F.multiplyTransformation(G,t.transform,t.transform)}for(i=0;i<r;i++){x=h.clone(m[i]),l(s)&&h.add(x,h.unpack(s),x),c&&(iGe(o,a,i,E,x,T,b,C,A,R),Oe.pack(E,v,0),d[4*i+0]=v[0],d[4*i+1]=v[1],d[4*i+2]=v[2],d[4*i+3]=v[3]),u&&(oGe(o,i,D),h.pack(D,O,0),p[3*i+0]=O[0],p[3*i+1]=O[1],p[3*i+2]=O[2]);let V=o.getProperty("BATCH_ID",X.UNSIGNED_SHORT,1,i);l(V)||(V=i),g[i]=V}let M=new Iae;M.transformInWorldSpace=!0;let N=e._buffers,_=new cz;if(_.name="Instance Translation",_.semantic=os.TRANSLATION,_.componentDatatype=X.FLOAT,_.type=on.VEC3,_.count=r,_.typedArray=f,!c){let V=gt.createVertexBuffer({context:n.context,typedArray:f,usage:Fe.STATIC_DRAW});V.vertexArrayDestroyable=!1,N.push(V),_.buffer=V}if(M.attributes.push(_),c){let V=new cz;V.name="Instance Rotation",V.semantic=os.ROTATION,V.componentDatatype=X.FLOAT,V.type=on.VEC4,V.count=r,V.typedArray=d,M.attributes.push(V)}if(u){let V=new cz;if(V.name="Instance Scale",V.semantic=os.SCALE,V.componentDatatype=X.FLOAT,V.type=on.VEC3,V.count=r,c)V.typedArray=p;else{let G=gt.createVertexBuffer({context:n.context,typedArray:p,usage:Fe.STATIC_DRAW});G.vertexArrayDestroyable=!1,N.push(G),V.buffer=G}M.attributes.push(V)}let S=new cz;S.name="Instance Feature ID",S.setIndex=0,S.semantic=os.FEATURE_ID,S.componentDatatype=X.FLOAT,S.type=on.SCALAR,S.count=r;let w=gt.createVertexBuffer({context:n.context,typedArray:g,usage:Fe.STATIC_DRAW});w.vertexArrayDestroyable=!1,N.push(w),S.buffer=w,M.attributes.push(S);let I=new Z8e;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",M.featureIds.push(I);let L=t.nodes,B=L.length,U=!1;for(i=0;i<B;i++){let V=L[i];V.primitives.length>0&&(V.instances=U?tGe(M):M,U=!0)}}function tGe(e){let t=new Iae;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Ge(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function nGe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",X.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(i))throw new re("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(o))throw new re("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new re("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Dae=new Array(4);function iGe(e,t,n,i,o,r,s,a,c,u){let f=e.getProperty("NORMAL_UP",X.FLOAT,3,n,GW),d=e.getProperty("NORMAL_RIGHT",X.FLOAT,3,n,Dae),p=!1;if(l(f)){if(!l(d))throw new re("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,r),h.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",X.UNSIGNED_SHORT,2,n,GW),m=e.getProperty("NORMAL_RIGHT_OCT32P",X.UNSIGNED_SHORT,2,n,Dae);if(l(g)){if(!l(m))throw new re("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Mn.octDecodeInRange(g[0],g[1],65535,r),Mn.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(Mt.eastNorthUpToFixedFrame(o,ee.WGS84,u),F.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,r,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,r,c),$.setColumn(c,2,a,c)),Oe.fromRotationMatrix(c,i)}function oGe(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",X.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",X.FLOAT,3,t,GW);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function rGe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}g_.prototype.isUnloaded=function(){return this._state===__.UNLOADED};g_.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),rGe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=__.UNLOADED};var DO=g_;var sGe={STOPPED:0,ANIMATING:1},rh=Object.freeze(sGe);function QA(){this.times=void 0,this.points=void 0,he.throwInstantiationError()}QA.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Oe)return Oe};QA.prototype.evaluate=he.throwInstantiationError;QA.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};QA.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};QA.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var oo=QA;function JA(e){this._value=e,this._valueType=oo.getPointType(e)}Object.defineProperties(JA.prototype,{value:{get:function(){return this._value}}});JA.prototype.findTimeInterval=function(e){};JA.prototype.wrapTime=function(e){return 0};JA.prototype.clampTime=function(e){return 0};JA.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var IO=JA;function eE(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=oo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(eE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});eE.prototype.findTimeInterval=oo.prototype.findTimeInterval;eE.prototype.wrapTime=oo.prototype.wrapTime;eE.prototype.clampTime=oo.prototype.clampTime;eE.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new h),h.lerp(n[o],n[o+1],r,t))};var wy=eE;var Pae={};Pae.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new h,s[a]=new h;o[0]=n[0]/t[0],r[0]=h.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var tE=Pae;var Rae=[],Oae=[],Mae=[],Lae=[];function aGe(e,t,n){let i=Rae,o=Mae,r=Oae,s=Lae;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),tE.solve(i,r,o,s)}function cGe(e){let t=Rae,n=Mae,i=Oae,o=Lae;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r+1],e[r-1],s),h.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r],e[r-1],s),h.multiplyByScalar(s,3,s),tE.solve(t,i,n,o)}function Hl(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=oo.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Hl.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});Hl.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Hl({times:t,points:n,inTangents:r,outTangents:o})};Hl.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new wy({points:n,times:t});let i=cGe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Hl({times:t,points:n,inTangents:r,outTangents:o})};Hl.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=oo.getPointType(n[0]);if(n.length<3)return new wy({points:n,times:t});let s=aGe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Hl({times:t,points:n,inTangents:c,outTangents:a})};Hl.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Hl.prototype.findTimeInterval=oo.prototype.findTimeInterval;var lGe=new oe,nE=new h;Hl.prototype.wrapTime=oo.prototype.wrapTime;Hl.prototype.clampTime=oo.prototype.clampTime;Hl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=lGe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=F.multiplyByVector(Hl.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,nE),d.add(t,nE,t),d.multiplyByScalar(r[s],f.z,nE),d.add(t,nE,t),d.multiplyByScalar(o[s],f.w,nE),d.add(t,nE,t))};var Dy=Hl;function iE(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=oo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(iE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});iE.prototype.findTimeInterval=oo.prototype.findTimeInterval;iE.prototype.wrapTime=oo.prototype.wrapTime;iE.prototype.clampTime=oo.prototype.clampTime;iE.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var PO=iE;function uGe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Oe);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return Oe.fastSlerp(a,c,s,o)}}function oE(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=uGe(this),this._lastTimeIndex=0}Object.defineProperties(oE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});oE.prototype.findTimeInterval=oo.prototype.findTimeInterval;oE.prototype.wrapTime=oo.prototype.wrapTime;oE.prototype.clampTime=oo.prototype.clampTime;oE.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var RO=oE;var rE=xn.AnimatedPropertyType;function WW(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,pGe(this)}Object.defineProperties(WW.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function fGe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new Dy({times:e,points:n,inTangents:i,outTangents:o})}function Nae(e,t,n,i){if(e.length===1&&t.length===1)return new IO(t[0]);switch(n){case nh.STEP:return new PO({times:e,points:t});case nh.CUBICSPLINE:return fGe(e,t);case nh.LINEAR:return i===rE.ROTATION?new RO({times:e,points:t}):new wy({times:e,points:t})}}function dGe(e,t,n,i,o){let r=[];if(i===rE.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(a),d=c;if(n===nh.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+o],f[u+2]=t[d+2*o],d+=o*3;else for(u=0;u<a;u++)f[u]=t[d],d+=o;r.push(Nae(e,f,n,i))}}else r.push(Nae(e,t,n,i));return r}var hGe=new h,mGe=new Oe;function pGe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=dGe(i,o,r,a,u);e._splines=f,e._path=a}WW.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===rE.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===rE.TRANSLATION||n===rE.SCALE?o[n]=r.evaluate(s,hGe):n===rE.ROTATION&&(o[n]=r.evaluate(s,mGe))}}};var OO=WW;function jW(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=Z.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=Z.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,zl.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new me,this.update=new me,this.stop=new me,this._state=rh.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,_Ge(this)}Object.defineProperties(jW.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function _Ge(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let u=r[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new OO({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}jW.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var MO=jW;function y_(e){this.animationAdded=new me,this.animationRemoved=new me,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(y_.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function qW(e,t,n){let i=e._model,o=new MO(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}y_.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return qW(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return qW(this,n[i],e)};y_.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=qW(this,n[r],e);i.push(s)}return i};y_.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};y_.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};y_.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};y_.prototype.get=function(e){return this._runtimeAnimations[e]};var uz=[];function gGe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}y_.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&Z.equals(e.time,this._previousTime))return!1;this._previousTime=Z.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=Z.addSeconds(y(a.startTime,o),a.delay,new Z)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=Z.lessThanOrEquals(c,o),p=l(f)&&Z.greaterThan(o,f),g=0;if(u!==0){let b=Z.secondsDifference(p?f:o,c);g=l(a._animationTime)?a._animationTime(u,b):b/u}let m=a.loop===zl.REPEAT||a.loop===zl.MIRRORED_REPEAT,x=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let b=a._state===rh.STOPPED;if(x!==b)continue}if(a._prevAnimationDelta=g,x||a._state===rh.ANIMATING){if(x&&a._state===rh.STOPPED&&(a._state=rh.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===zl.REPEAT)g=g-Math.floor(g);else if(a.loop===zl.MIRRORED_REPEAT){let T=Math.floor(g),C=g-T;g=T%2===1?1-C:C}a.reverse&&(g=1-g);let b=g*u*a.multiplier;b=P.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=rh.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&uz.push(a))}}n=uz.length;for(let s=0;s<n;++s){let a=uz[s];t.splice(t.indexOf(a),1),e.afterRender.push(gGe(this,r,a))}return uz.length=0,i};var LO=y_;function wb(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(wb.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new H),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});wb.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};wb.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};wb.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};wb.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};wb.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var NO=wb;var FO={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};FO.getStyleCommandsNeeded=function(e,t){return t===0?FO.ALL_OPAQUE:t===e?FO.ALL_TRANSLUCENT:FO.OPAQUE_AND_TRANSLUCENT};var sh=Object.freeze(FO);var Iy={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Iy.is3DTiles=function(e){switch(e){case Iy.TILE_GLTF:case Iy.TILE_B3DM:case Iy.TILE_I3DM:case Iy.TILE_PNTS:case Iy.TILE_GEOJSON:return!0;case Iy.GLTF:return!1}};var ur=Object.freeze(Iy);function zr(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=sh.ALL_OPAQUE,yGe(this)}Object.defineProperties(zr.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function yGe(e){let t=e._model,n=ur.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new Ws(s,o)}else for(o=0;o<i;o++)r[o]=new NO({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Jc({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}zr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=sh.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};zr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};zr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};zr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};zr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};zr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};zr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};zr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};zr.prototype.getFeature=function(e){return this._features[e]};zr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};zr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};zr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};zr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};zr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};zr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};zr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};zr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};zr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var xGe=new H;zr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Jc.DEFAULT_COLOR_VALUE),this.setAllShow(Jc.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,xGe),Jc.DEFAULT_COLOR_VALUE):Jc.DEFAULT_COLOR_VALUE,o=l(e.show)?y(e.show.evaluate(n),Jc.DEFAULT_SHOW_VALUE):Jc.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};zr.prototype.isDestroyed=function(){return!1};zr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var BO=zr;var Fae={name:"TilesetPipelineStage"};Fae.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,pe.FRAGMENT);let r={u_polygonOffset:function(){return z.ZERO}};e.uniformMap=bt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Ut.setCesium3DTileBit(),i.stencilMask=Ut.CESIUM_3D_TILE_MASK};var kO=Fae;var VO=`// robust iterative solution without trig functions -// https://github.com/0xfaded/ellipse_demo/issues/1 -// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse -// -// This version uses only a single iteration for best performance. For fog -// rendering, the difference is negligible. -vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) { - vec2 p = abs(pos); - vec2 inverseRadii = 1.0 / radii; - vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii; - - // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t)) - // but store the cos and sin of t in a vec2 for efficiency. - // Initial guess: t = cos(pi/4) - vec2 tTrigs = vec2(0.70710678118); - vec2 v = radii * tTrigs; - - // Find the evolute of the ellipse (center of curvature) at v. - vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs; - // Find the (approximate) intersection of p - evolute with the ellipsoid. - vec2 q = normalize(p - evolute) * length(v - evolute); - // Update the estimate of t. - tTrigs = (q + evolute) * inverseRadii; - tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); - v = radii * tTrigs; - - return v * sign(pos); -} - -vec3 computeEllipsoidPositionWC(vec3 positionMC) { - // Get the world-space position and project onto a meridian plane of - // the ellipsoid - vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; - - vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z); - vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz); - - // Reconstruct a 3D point in world space - return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y); -} - -void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) { - - vec3 fogColor = groundAtmosphereColor.rgb; - - // If there is dynamic lighting, apply that to the fog. - const float NONE = 0.0; - if (czm_atmosphereDynamicLighting != NONE) { - float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0); - fogColor *= darken; - } - - // Tonemap if HDR rendering is disabled - #ifndef HDR - fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); - fogColor.rgb = czm_inverseGamma(fogColor.rgb); - #endif - - vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar); - color = vec4(withFog, color.a); -} - -void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) { - vec3 rayleighColor; - vec3 mieColor; - float opacity; - - vec3 positionWC; - vec3 lightDirection; - - // When the camera is in space, compute the position per-fragment for - // more accurate ground atmosphere. All other cases will use - // - // The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717 - if (false) { - positionWC = computeEllipsoidPositionWC(attributes.positionMC); - lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); - - // The fog color is derived from the ground atmosphere color - czm_computeGroundAtmosphereScattering( - positionWC, - lightDirection, - rayleighColor, - mieColor, - opacity - ); - } else { - positionWC = attributes.positionWC; - lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); - rayleighColor = v_atmosphereRayleighColor; - mieColor = v_atmosphereMieColor; - opacity = v_atmosphereOpacity; - } - - //color correct rayleigh and mie colors - const bool ignoreBlackPixels = true; - rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels); - mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels); - - vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); - - if (u_isInFog) { - float distanceToCamera = length(attributes.positionEC); - applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); - } else { - // Ground atmosphere - } -} -`;var UO=`void atmosphereStage(ProcessedAttributes attributes) { - vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); - - czm_computeGroundAtmosphereScattering( - // This assumes the geometry stage came before this. - v_positionWC, - lightDirection, - v_atmosphereRayleighColor, - v_atmosphereMieColor, - v_atmosphereOpacity - ); -} -`;var Bae={name:"AtmospherePipelineStage"};Bae.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,pe.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,pe.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([UO]),i.addFragmentLines([VO]),i.addUniform("bool","u_isInFog",pe.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=h.distance(n.camera.positionWC,t.boundingSphere.center);return P.fog(o,n.fog.density)>P.EPSILON3}};var zO=Bae;var HO=`#ifdef DIFFUSE_IBL -vec3 sampleDiffuseEnvironment(vec3 cubeDir) -{ - #ifdef CUSTOM_SPHERICAL_HARMONICS - return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); - #else - return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); - #endif -} -#endif - -#ifdef SPECULAR_IBL -vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) -{ - #ifdef CUSTOM_SPECULAR_IBL - float lod = roughness * model_specularEnvironmentMapsMaximumLOD; - return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; - #else - float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; - return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; - #endif -} -vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) -{ - // see https://bruop.github.io/ibl/ at Single Scattering Results - // Roughness dependent fresnel, from Fdez-Aguera - vec3 f90 = max(vec3(1.0 - roughness), f0); - vec3 F = fresnelSchlick2(f0, f90, NdotV); - - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); - - return specularSample * (F * brdfLut.x + brdfLut.y); -} -#endif - -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -/** - * Compute the light contributions from environment maps and spherical harmonic coefficients. - * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation - * of the single- and multi-scattering terms. - * - * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position. - * @param {vec3} normalEC The surface normal in eye coordinates. - * @param {czm_modelMaterial} The material properties. - * @return {vec3} The computed HDR color. - */ -vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { - vec3 f0 = material.specular; - float roughness = material.roughness; - float specularWeight = 1.0; - #ifdef USE_SPECULAR - specularWeight = material.specularWeight; - #endif - float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); - - // see https://bruop.github.io/ibl/ at Single Scattering Results - // Roughness dependent fresnel, from Fdez-Aguera - vec3 f90 = max(vec3(1.0 - roughness), f0); - vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); - - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); - - #ifdef DIFFUSE_IBL - vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); - vec3 irradiance = sampleDiffuseEnvironment(normalMC); - - vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; - float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); - vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); - vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; - vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; - #else - vec3 diffuseContribution = vec3(0.0); - #endif - - #ifdef USE_ANISOTROPY - // Bend normal to account for anisotropic distortion of specular reflection - vec3 anisotropyDirection = material.anisotropicB; - vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); - vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); - float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); - float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; - vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); - vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); - #else - vec3 reflectEC = reflect(-viewDirectionEC, normalEC); - #endif - - #ifdef SPECULAR_IBL - vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); - vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); - vec3 specularContribution = radiance * FssEss * model_iblFactor.y; - #else - vec3 specularContribution = vec3(0.0); - #endif - - return diffuseContribution + specularContribution; -} -#endif -`;var kae={name:"ImageBasedLightingPipelineStage"},bGe=new z;kae.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,pe.FRAGMENT),r.addUniform("vec2","model_iblFactor",pe.FRAGMENT),Yd.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",pe.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,pe.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,pe.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,pe.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",pe.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,pe.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,pe.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,pe.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",pe.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",pe.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,pe.FRAGMENT)),r.addFragmentLines(HO);let c={model_iblFactor:function(){return z.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,bGe)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=bt(c,e.uniformMap)};var GO=kae;var TGe=P.EPSILON16;function XW(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(XW.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,TGe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var CGe=new h,YW=new $;XW.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=CGe,o;switch(t){case pc.XROTATE:o=$.fromRotationX(P.toRadians(n),YW),e=F.multiplyByMatrix3(e,o,e);break;case pc.YROTATE:o=$.fromRotationY(P.toRadians(n),YW),e=F.multiplyByMatrix3(e,o,e);break;case pc.ZROTATE:o=$.fromRotationZ(P.toRadians(n),YW),e=F.multiplyByMatrix3(e,o,e);break;case pc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case pc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case pc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case pc.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case pc.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case pc.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case pc.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var WO=XW;function fz(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,AGe(this)}Object.defineProperties(fz.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function AGe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new WO({stage:a,runtimeArticulation:e});o.push(c);let u=a.name;r[u]=c}}fz.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var EGe=new F,SGe=new F;fz.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,EGe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=F.multiplyTransformation(s.originalTransform,e,SGe);s.transform=a}};var jO=fz;var qO=`void modelColorStage(inout czm_modelMaterial material) -{ - material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend); - float highlight = ceil(model_colorBlend); - material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight); - material.alpha *= model_color.a; -} -`;var sE={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};sE.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,pe.FRAGMENT),i.addFragmentLines(qO);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=we.TRANSLUCENT),i.addUniform("vec4",sE.COLOR_UNIFORM_NAME,pe.FRAGMENT),o[sE.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",sE.COLOR_BLEND_UNIFORM_NAME,pe.FRAGMENT),o[sE.COLOR_BLEND_UNIFORM_NAME]=function(){return mc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=bt(o,e.uniformMap)};var Py=sE;var YO=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE -vec4 getClippingPlane( - highp sampler2D packedClippingPlanes, - int clippingPlaneNumber, - mat4 transform -) { - int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; - int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - vec4 plane = texture(packedClippingPlanes, vec2(u, v)); - return czm_transformPlane(plane, transform); -} -#else -// Handle uint8 clipping texture instead -vec4 getClippingPlane( - highp sampler2D packedClippingPlanes, - int clippingPlaneNumber, - mat4 transform -) { - int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each - int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; - int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; - vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); - vec4 plane; - plane.xyz = czm_octDecode(oct, 65535.0); - plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); - return czm_transformPlane(plane, transform); -} -#endif - -float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { - vec4 position = czm_windowToEyeCoordinates(fragCoord); - vec3 clipNormal = vec3(0.0); - vec3 clipPosition = vec3(0.0); - float pixelWidth = czm_metersPerPixel(position); - - #ifdef UNION_CLIPPING_REGIONS - float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below. - #else - float clipAmount = 0.0; - bool clipped = true; - #endif - - for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { - vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); - clipNormal = clippingPlane.xyz; - clipPosition = -clippingPlane.w * clipNormal; - float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; - - #ifdef UNION_CLIPPING_REGIONS - clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); - if (amount <= 0.0) { - discard; - } - #else - clipAmount = max(amount, clipAmount); - clipped = clipped && (amount <= 0.0); - #endif - } - - #ifndef UNION_CLIPPING_REGIONS - if (clipped) { - discard; - } - #endif - - return clipAmount; -} - -void modelClippingPlanesStage(inout vec4 color) -{ - float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; - float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; - - if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { - color = clippingPlanesEdgeColor; - } -} -`;var Vae={name:"ModelClippingPlanesPipelineStage"},vGe=new z;Vae.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,pe.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,pe.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,pe.FRAGMENT),gs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,pe.FRAGMENT);let s=gs.getTextureResolution(i,o,vGe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,pe.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,pe.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",pe.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",pe.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",pe.FRAGMENT),r.addFragmentLines(YO);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=H.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=bt(a,e.uniformMap)};var XO=Vae;var KO=`void modelClippingPolygonsStage(ProcessedAttributes attributes) -{ - vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC); - sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); - - vec2 minDistance = vec2(czm_infinity); - v_regionIndex = -1; - v_clippingPosition = vec2(czm_infinity); - - for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) { - vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex); - vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz; - - vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0)); - vec2 distance = abs(rectUv - clamped) * extents.wz; - - if (minDistance.x > distance.x || minDistance.y > distance.y) { - minDistance = distance; - v_clippingPosition = rectUv; - } - - float threshold = 0.01; - if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) { - v_regionIndex = regionIndex; - } - } -} -`;var ZO=`void modelClippingPolygonsStage() -{ - vec2 clippingPosition = v_clippingPosition; - int regionIndex = v_regionIndex; - czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); -} -`;var Uae={name:"ModelClippingPolygonsPipelineStage"};Uae.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,pe.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,pe.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,pe.BOTH),o.addUniform("sampler2D","model_clippingDistance",pe.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",pe.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(KO),o.addFragmentLines(ZO);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=bt(r,e.uniformMap)};var $O=Uae;function zae(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(zae.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var QO=zae;var JO=`mat4 getInstancingTransform() -{ - mat4 instancingTransform; - - #ifdef HAS_INSTANCE_MATRICES - instancingTransform = mat4( - a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 - a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 - a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 - a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation = a_instanceTranslation; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif - - instancingTransform = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation.x, translation.y, translation.z, 1.0 - ); - #endif - - return instancingTransform; -} - -#ifdef USE_2D_INSTANCING -mat4 getInstancingTransform2D() -{ - mat4 instancingTransform2D; - - #ifdef HAS_INSTANCE_MATRICES - instancingTransform2D = mat4( - a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 - a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 - a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 - a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation2D = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation2D = a_instanceTranslation2D; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif - - instancingTransform2D = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation2D.x, translation2D.y, translation2D.z, 1.0 - ); - #endif - - return instancingTransform2D; -} -#endif -`;var eM=`void instancingStage(inout ProcessedAttributes attributes) -{ - vec3 positionMC = attributes.positionMC; - - mat4 instancingTransform = getInstancingTransform(); - - attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; - - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; - #endif - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var tM=`void legacyInstancingStage( - inout ProcessedAttributes attributes, - out mat4 instanceModelView, - out mat3 instanceModelViewInverseTranspose) -{ - vec3 positionMC = attributes.positionMC; - - mat4 instancingTransform = getInstancingTransform(); - - mat4 instanceModel = instancingTransform * u_instance_nodeTransform; - instanceModelView = u_instance_modifiedModelView; - instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); - - attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var dz=new F,wGe=new F,DGe=new F,Gae={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Xae,_transformsToTypedArray:ZW};Gae.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(JO);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,d=[];GGe(e,n,i,d,u,f),qGe(e,n,i,d);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,pe.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",pe.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",pe.VERTEX),p.u_instance_modifiedModelView=function(){let g=F.multiplyTransformation(s.modelMatrix,a.components.transform,dz);return u?F.multiplyTransformation(n.context.uniformState.view3D,g,dz):(n.mode!==ne.SCENE3D&&(g=Mt.basisTo2D(n.mapProjection,g,dz)),F.multiplyTransformation(n.context.uniformState.view,g,dz))},p.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,wGe)},r.addVertexLines(tM)):r.addVertexLines(eM),u){r.addDefine("USE_2D_INSTANCING",void 0,pe.VERTEX),r.addUniform("mat4","u_modelView2D",pe.VERTEX);let g=n.context,m=F.fromTranslation(c.instancingReferencePoint2D,new F);p.u_modelView2D=function(){return F.multiplyTransformation(g.uniformState.view,m,DGe)}}e.uniformMap=bt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,d)};var nM=new F,IGe=new h;function PGe(e,t,n,i,o){let r=F.multiplyTransformation(t,e,nM);return r=F.multiplyTransformation(r,n,nM),o=Mt.basisTo2D(i.mapProjection,r,o),o}function RGe(e,t,n,i,o){let r=F.fromTranslation(e,nM),s=F.multiplyTransformation(t,r,nM);s=F.multiplyTransformation(s,n,nM);let a=F.getTranslation(s,IGe);return o=zi.computeActualEllipsoidPosition(i,a,o),o}function Wae(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=F.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(o.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var jae=new F,qae=new F,OGe=new F,MGe=new h;function LGe(e,t,n,i){let o=jae,r=qae;Wae(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=PGe(f,o,r,n,OGe),p=F.getTranslation(d,MGe),g=h.subtract(p,a,p);i[u]=F.setTranslation(d,g,i[u])}return i}function NGe(e,t,n,i){let o=jae,r=qae;Wae(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=RGe(f,o,r,n,f);i[u]=h.subtract(d,a,i[u])}return i}var FGe=new h,BGe=new h;function Yae(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=F.multiplyByPoint(i,n.instancingTranslationMin,FGe),r=zi.computeActualEllipsoidPosition(t,o,o),s=F.multiplyByPoint(i,n.instancingTranslationMax,BGe),a=zi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(r,a,.5,new h)}function ZW(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function kGe(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var VGe=new h,UGe=new Oe,zGe=new h;function Xae(e,t,n){let i=new Array(t),o=Kt.getAttributeBySemantic(e,os.TRANSLATION),r=Kt.getAttributeBySemantic(e,os.ROTATION),s=Kt.getAttributeBySemantic(e,os.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),d=l(s),p=u?o.typedArray:new Float32Array(t*3),g=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(g=Mn.dequantize(g,r.componentDatatype,r.type,t));let m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let b=0;b<t;b++){let T=new h(p[b*3],p[b*3+1],p[b*3+2],VGe);h.maximumByComponent(a,T,a),h.minimumByComponent(c,T,c);let C=new Oe(g[b*4],g[b*4+1],g[b*4+2],f?g[b*4+3]:1,UGe),A=new h(m[b*3],m[b*3+1],m[b*3+2],zGe),E=F.fromTranslationQuaternionRotationScale(T,C,A,new F);i[b]=E}let x=n.runtimeNode;return x.instancingTranslationMin=c,x.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),d&&(s.typedArray=void 0),i}function HGe(e,t,n){let i=new Array(t),o=e.typedArray,r=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,h.minimumByComponent(r,u,r),h.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function $W(e,t){let n=gt.createVertexBuffer({context:t.context,typedArray:e,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function GGe(e,t,n,i,o,r){let s=Kt.getAttributeBySemantic(n,os.ROTATION);l(s)?WGe(e,n,i,t,o,r):jGe(e,n,i,t,o)}function WGe(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=Xae(t,a,e);let b=ZW(d);p=$W(b,i),c._modelResources.push(p),r&&(u.transformsTypedArray=b),u.instancingTransformsBuffer=p}if(Hae(e,p,n,f),!o)return;let g=Ge(i);g.mode=ne.COLUMBUS_VIEW,Yae(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let b=LGe(d,e,g,d),T=ZW(b);m=$W(T,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}Hae(e,m,n,"Transform2D")}function jGe(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=Kt.getAttributeBySemantic(t,os.TRANSLATION),u=Kt.getAttributeBySemantic(t,os.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),KW(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=HGe(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),KW(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let g=Ge(i);g.mode=ne.COLUMBUS_VIEW,Yae(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let C=NGe(f,e,g,f),A=kGe(C);r&&(a.transformsTypedArray=A),m=$W(A,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!o)return;KW(e,m,0,void 0,n,"Translation2D")}function Hae(e,t,n,i){let r=X.getSizeInBytes(X.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function KW(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function qGe(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===os.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:on.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var iM=Gae;var QW={};QW.name="ModelMatrixUpdateStage";QW.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Kae(e,t,o,e.transformToRoot),e._transformDirty=!1}};function YGe(e,t,n){e.modelMatrix=F.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Kt.getCullFace(e.modelMatrix,e.primitiveType)}function Kae(e,t,n,i){let o;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];YGe(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=F.clone(i,a._transformToRoot),Kae(a,t,n,i),a._transformDirty=!1}}var oM=QW;var Zae={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:$ae,_countGeneratedBuffers:Qae};Zae.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;$ae(i,o),Qae(i,r)};function $ae(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function Qae(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var rM=Zae;function aE(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,XGe(this)}Object.defineProperties(aE.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=F.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),JW(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Oe.equals(n,e)||(t.rotation=Oe.clone(e,t.rotation),JW(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),JW(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function XGe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new ty(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function JW(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}aE.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};aE.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(iM),t.push(rM),n.push(oM)};aE.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};aE.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new F);let r=F.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=F.inverseTransformation(r,t[o]);t[o]=F.multiplyTransformation(s,n[o],t[o])}};var sM=aE;var Jae={name:"AlphaPipelineStage"};Jae.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=y(i.pass,o.opaquePass);let r=e.renderStateOptions;i.pass===we.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=un.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,pe.FRAGMENT),s.addUniform("float","u_alphaCutoff",pe.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var aM=Jae;var ece={name:"BatchTexturePipelineStage"};ece.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=bt(o,e.uniformMap)};var cM=ece;var tce={name:"ClassificationPipelineStage"};tce.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,pe.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||KGe(t,o)};function KGe(e,t){let n=Kt.getAttributeBySemantic(e,At.POSITION);if(!l(n))throw new re("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=Kt.getAttributeBySemantic(e,At.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=r?i[0]:0,p=c[d],g=0;for(let x=1;x<s;x++){let b=r?i[x]:x,T=c[b];if(T!==p){let C=x-g,A=x;u.push(C),f.push(A),g=A,p=T}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var lM=tce;var uM=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) -{ - bool styleTranslucent = (featureColor.a != 1.0); - // Only render translucent features in the translucent pass (if the style or the original command has translucency). - if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) - { - // If the model has a translucent silhouette, it needs to render during the silhouette color command, - // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. - #ifdef HAS_SILHOUETTE - positionMC *= float(model_silhouettePass); - #else - positionMC *= 0.0; - #endif - } - // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. - else if (czm_pass != czm_passTranslucent && styleTranslucent) - { - positionMC *= 0.0; - } -} - -void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) -{ - float show = ceil(feature.color.a); - positionMC *= show; - - #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) - filterByPassType(positionMC, feature.color); - #endif -} -`;var fM=`void filterByPassType(vec4 featureColor) -{ - bool styleTranslucent = (featureColor.a != 1.0); - // Only render translucent features in the translucent pass (if the style or the original command has translucency). - if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) - { - // If the model has a translucent silhouette, it needs to render during the silhouette color command, - // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. - #ifdef HAS_SILHOUETTE - if(!model_silhouettePass) { - discard; - } - #else - discard; - #endif - } - // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. - else if (czm_pass != czm_passTranslucent && styleTranslucent) - { - discard; - } -} - -void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) -{ - vec4 featureColor = feature.color; - if (featureColor.a == 0.0) - { - discard; - } - - // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader. - // So, we only apply in in the fragment shader if the feature ID texture is used. - #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) - filterByPassType(featureColor); - #endif - - featureColor = czm_gammaCorrect(featureColor); - - // Classification models compute the diffuse differently. - #ifdef HAS_CLASSIFICATION - material.diffuse = featureColor.rgb * featureColor.a; - #else - float highlight = ceil(model_colorBlend); - material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); - #endif - - material.alpha *= featureColor.a; -} -`;var nce={name:"CPUStylingPipelineStage"};nce.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(uM),o.addFragmentLines(fM),o.addDefine("USE_CPU_STYLING",void 0,pe.BOTH),l(i.color)||(o.addUniform("float",Py.COLOR_BLEND_UNIFORM_NAME,pe.FRAGMENT),e.uniformMap[Py.COLOR_BLEND_UNIFORM_NAME]=function(){return mc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",pe.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===we.TRANSLUCENT}};var dM=nce;var ice={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};ice.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var x_=Object.freeze(ice);var hM=`void customShaderStage( - inout czm_modelVertexOutput vsOutput, - inout ProcessedAttributes attributes, - FeatureIds featureIds, - Metadata metadata, - MetadataClass metadataClass, - MetadataStatistics metadataStatistics -) { - // VertexInput and initializeInputStruct() are dynamically generated in JS, - // see CustomShaderPipelineStage.js - VertexInput vsInput; - initializeInputStruct(vsInput, attributes); - vsInput.featureIds = featureIds; - vsInput.metadata = metadata; - vsInput.metadataClass = metadataClass; - vsInput.metadataStatistics = metadataStatistics; - vertexMain(vsInput, vsOutput); - attributes.positionMC = vsOutput.positionMC; -} -`;var mM=`void customShaderStage( - inout czm_modelMaterial material, - ProcessedAttributes attributes, - FeatureIds featureIds, - Metadata metadata, - MetadataClass metadataClass, - MetadataStatistics metadataStatistics -) { - // FragmentInput and initializeInputStruct() are dynamically generated in JS, - // see CustomShaderPipelineStage.js - FragmentInput fsInput; - initializeInputStruct(fsInput, attributes); - fsInput.featureIds = featureIds; - fsInput.metadata = metadata; - fsInput.metadataClass = metadataClass; - fsInput.metadataStatistics = metadataStatistics; - fragmentMain(fsInput, material); -} -`;var pM=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); -} -`;var _M=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) -{ - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); - setFeatureIdVaryings(); -} -`;var Hi={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Hi.process=function(e,t,n){let i=e.shaderBuilder;ZGe(i);let o=e.runtimeNode.node.instances;l(o)&&$Ge(e,o,n),QGe(e,t,n),i.addVertexLines(_M),i.addFragmentLines(pM)};function ZGe(e){e.addStruct(Hi.STRUCT_ID_FEATURE_IDS_VS,Hi.STRUCT_NAME_FEATURE_IDS,pe.VERTEX),e.addStruct(Hi.STRUCT_ID_FEATURE_IDS_FS,Hi.STRUCT_NAME_FEATURE_IDS,pe.FRAGMENT),e.addFunction(Hi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Hi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,pe.VERTEX),e.addFunction(Hi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Hi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,pe.FRAGMENT),e.addFunction(Hi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Hi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,pe.VERTEX),e.addFunction(Hi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Hi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,pe.FRAGMENT),e.addFunction(Hi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Hi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,pe.VERTEX)}function $Ge(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof xn.FeatureIdAttribute?JGe(e,s,a):oce(e,s,a,o,1,n);let c=s.label;l(c)&&rce(e,a,c,pe.BOTH)}}function QGe(e,t,n){let i=t.featureIds,r=Kt.getAttributeBySemantic(t,At.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=pe.BOTH;a instanceof xn.FeatureIdAttribute?e5e(e,a,c):a instanceof xn.FeatureIdImplicitRange?oce(e,a,c,r,void 0,n):(t5e(e,a,c,s,n),u=pe.FRAGMENT);let f=a.label;l(f)&&rce(e,c,f,u)}}function JGe(e,t,n){let i=e.shaderBuilder;i.addStructField(Hi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Hi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Hi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Hi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Hi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function e5e(e,t,n){let i=e.shaderBuilder;i.addStructField(Hi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Hi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Hi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Hi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function oce(e,t,n,i,o,r){n5e(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Hi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Hi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Hi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Hi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Hi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function t5e(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return y(a.texture,o.context.defaultTexture)};let c=a.channels,u=e.shaderBuilder;u.addStructField(Hi.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,pe.FRAGMENT);let d=`v_texCoord_${a.texCoord}`,p=d,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let b=`${r}Transform`;u.addUniform("mat3",b,pe.FRAGMENT),s[b]=function(){return g},p=`vec2(${b} * vec3(${d}, 1.0))`}let m=`texture(${r}, ${p}).${c}`,x=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(Hi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[x])}function rce(e,t,n,i){let o=e.shaderBuilder,r=pe.includesVertexShader(i);r&&o.addStructField(Hi.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Hi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Hi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Hi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function n5e(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let u=i5e(t,n);s=gt.createVertexBuffer({context:o.context,typedArray:u,usage:Fe.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:X.FLOAT,strideInBytes:X.getSizeInBytes(X.FLOAT),offsetInBytes:0};e.attributes.push(c)}function i5e(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var Ry=Hi;var gM=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) -{ - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); -} -`;var yM=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) -{ - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); - setMetadataVaryings(); -} -`;var Si={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Si.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=o5e(r.propertyAttributes,t,a),u=s5e(r.propertyTextures,a),f=c.concat(u);c5e(i,f),f5e(i),i.addVertexLines(yM),i.addFragmentLines(gM);for(let d=0;d<c.length;d++){let p=c[d];d5e(e,p)}for(let d=0;d<u.length;d++){let p=u[d];m5e(e,p)}};function o5e(e,t,n){return l(e)?e.flatMap(i=>r5e(i,t,n)):[]}function r5e(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Kt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:m,variableName:x}=o(g);u[f]={metadataVariable:r(d),property:p,type:p.classProperty.type,glslType:m,variableName:x,propertyStatistics:a?.properties[d],shaderDestination:pe.BOTH}}return u}function s5e(e,t){return l(e)?e.flatMap(n=>a5e(n,t)):[]}function a5e(e,t){let{sanitizeGlslIdentifier:n}=Kt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,u]=r[a];s[a]={metadataVariable:n(c),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:pe.FRAGMENT}}return s}function c5e(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==lt.ENUM&&i.add(u)}let o=Si.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Si.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,u){e.addStruct(a,a,pe.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?u5e(c):c;e.addStructField(a,p,d)}}}var l5e={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function u5e(e){let t=l5e[e];return l(t)?t:e}function f5e(e){e.addStruct(Si.STRUCT_ID_METADATA_VS,Si.STRUCT_NAME_METADATA,pe.VERTEX),e.addStruct(Si.STRUCT_ID_METADATA_FS,Si.STRUCT_NAME_METADATA,pe.FRAGMENT),e.addStruct(Si.STRUCT_ID_METADATA_CLASS_VS,Si.STRUCT_NAME_METADATA_CLASS,pe.VERTEX),e.addStruct(Si.STRUCT_ID_METADATA_CLASS_FS,Si.STRUCT_NAME_METADATA_CLASS,pe.FRAGMENT),e.addStruct(Si.STRUCT_ID_METADATA_STATISTICS_VS,Si.STRUCT_NAME_METADATA_STATISTICS,pe.VERTEX),e.addStruct(Si.STRUCT_ID_METADATA_STATISTICS_FS,Si.STRUCT_NAME_METADATA_STATISTICS,pe.FRAGMENT),e.addFunction(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,Si.FUNCTION_SIGNATURE_INITIALIZE_METADATA,pe.VERTEX),e.addFunction(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,Si.FUNCTION_SIGNATURE_INITIALIZE_METADATA,pe.FRAGMENT),e.addFunction(Si.FUNCTION_ID_SET_METADATA_VARYINGS,Si.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,pe.VERTEX)}function d5e(e,t){h5e(e,t),sce(e.shaderBuilder,t),ace(e.shaderBuilder,t)}function h5e(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=lce({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:pe.BOTH,property:o});n.addStructField(Si.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Si.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function m5e(e,t){p5e(e,t),sce(e.shaderBuilder,t),ace(e.shaderBuilder,t)}function p5e(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:u,texture:f,transform:d}=s.textureReader,p=`u_propertyTexture_${u}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,pe.FRAGMENT),i[p]=()=>f),n.addStructField(Si.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,m=g;if(l(d)&&!$.equals(d,$.IDENTITY)){let A=`${p}Transform`;n.addUniform("mat3",A,pe.FRAGMENT),i[A]=function(){return d},m=`vec2(${A} * vec3(${g}, 1.0))`}let x=`texture(${p}, ${m}).${c}`,b=s.unpackInShader(x),T=lce({valueExpression:b,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:pe.FRAGMENT,property:s}),C=`metadata.${o} = ${T};`;n.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,[C])}function sce(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=cce(Si.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Si.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,s),pe.includesVertexShader(r)&&(e.addStructField(Si.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function ace(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===lt.ENUM)return;let s=Si.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=cce(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Si.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,c),pe.includesVertexShader(t.shaderDestination)&&(e.addStructField(Si.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function cce(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function lce(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,o,u),s.addUniform(c,r,u);let{offset:f,scale:d}=n;return a[o]=()=>f,a[r]=()=>d,`czm_valueTransform(${o}, ${r}, ${t})`}var Bf=Si;var _5e={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Oy=Object.freeze(_5e);var da={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:yt};da.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Oy.TRANSLUCENT?r.pass=we.TRANSLUCENT:c===Oy.OPAQUE&&(r.pass=void 0);let u=E5e(s,t);if(!u.customShaderEnabled)return;if(D5e(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,pe.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,pe.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,pe.FRAGMENT);let p=x_.getDefineName(s.mode);i.addDefine(p,void 0,pe.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let d=s.varyings;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];i.addVarying(g,p)}e.uniformMap=bt(e.uniformMap,s.uniformMap)};function g5e(e){let t={};for(let n=0;n<e.length;n++){let i=Kt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var y5e={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},x5e={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function uce(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=y5e[t],i=x5e[t];if(l(n))return{attributeField:[n,e],value:i}}function b5e(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=fce(t,n,!1),o=dce(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let f=[i[c].glslType,c];s.push(f),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let u=o[c],f=uce(u);if(!l(f))return da._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${u}, disabling custom vertex shader`),{enabled:!1};s.push(f.attributeField),r=`vsInput.attributes.${u} = ${f.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function T5e(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function C5e(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=fce(t,n,!0),o=dce(t,n,!0),r,s=[],a=[];for(let u in i){if(!i.hasOwnProperty(u))continue;let d=[i[u].glslType,u];s.push(d),r=`fsInput.attributes.${u} = attributes.${u};`,a.push(r)}for(let u=0;u<o.length;u++){let f=o[u],d=uce(f);if(!l(d))return da._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${f}, disabling custom fragment shader.`),{enabled:!1};s.push(d.attributeField),r=`fsInput.attributes.${f} = ${d.value};`,a.push(r)}let c=T5e(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var A5e={positionWC:!0,positionEC:!0};function fce(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function dce(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||A5e.hasOwnProperty(o))continue;let r=o;n&&o==="normalEC"?r="normalMC":n&&o==="tangentEC"&&(r="tangentMC"),e.hasOwnProperty(r)||i.push(o)}return i}function E5e(e,t){let n=g5e(t.attributes),i=b5e(e,n),o=C5e(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function S5e(e,t){let n=da.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,da.STRUCT_NAME_ATTRIBUTES,pe.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=da.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,da.STRUCT_NAME_VERTEX_INPUT,pe.VERTEX),e.addStructField(n,da.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Ry.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Bf.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Bf.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Bf.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=da.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,da.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,pe.VERTEX),e.addFunctionLines(r,o)}function v5e(e,t){let n=da.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,da.STRUCT_NAME_ATTRIBUTES,pe.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=da.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,da.STRUCT_NAME_FRAGMENT_INPUT,pe.FRAGMENT),e.addStructField(n,da.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Ry.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Bf.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Bf.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Bf.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=da.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,da.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,pe.FRAGMENT),e.addFunctionLines(r,o)}var w5e=[];function D5e(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=w5e;i.enabled&&(S5e(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,hM),e.addVertexLines(r)),o.enabled&&(v5e(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,mM),e.addFragmentLines(r))}var xM=da;var bM={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};bM.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,pe.VERTEX),i.addFunction(bM.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,bM.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,pe.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===At.POSITION,d=c.semantic===At.TEXCOORD;if(r&&!f&&!d)continue;let p=Kt.getAttributeInfo(c);P5e(i,p),I5e(e,p)}};function I5e(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,pe.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,pe.VERTEX),n.addUniform(c,a,pe.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=hce(u,0),f=hce(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function hce(e,t){return e instanceof oe?e:new oe(e.x,e.y,e.z,t)}function P5e(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=R5e(n,i):o=O5e(n),e.addFunctionLines(bM.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function R5e(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function O5e(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var TM=bM;var CM=`void geometryStage(out ProcessedAttributes attributes) -{ - attributes.positionMC = v_positionMC; - attributes.positionEC = v_positionEC; - - #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) - attributes.positionWC = v_positionWC; - #endif - - #ifdef HAS_NORMALS - // renormalize after interpolation - attributes.normalEC = normalize(v_normalEC); - #endif - - #ifdef HAS_TANGENTS - attributes.tangentEC = normalize(v_tangentEC); - #endif - - #ifdef HAS_BITANGENTS - attributes.bitangentEC = normalize(v_bitangentEC); - #endif - - // Everything else is dynamically generated in GeometryPipelineStage - setDynamicVaryings(attributes); -} -`;var AM=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) -{ - vec4 computedPosition; - - // Compute positions in different coordinate systems - vec3 positionMC = attributes.positionMC; - v_positionMC = positionMC; - v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; - - #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) - vec3 position2D = attributes.position2D; - vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; - computedPosition = czm_projection * vec4(positionEC, 1.0); - #else - computedPosition = czm_projection * vec4(v_positionEC, 1.0); - #endif - - // Sometimes the custom shader and/or style needs this - #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS) - // Note that this is a 32-bit position which may result in jitter on small - // scales. - v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; - #endif - - #ifdef HAS_NORMALS - v_normalEC = normalize(normal * attributes.normalMC); - #endif - - #ifdef HAS_TANGENTS - v_tangentEC = normalize(normal * attributes.tangentMC); - #endif - - #ifdef HAS_BITANGENTS - v_bitangentEC = normalize(normal * attributes.bitangentMC); - #endif - - // All other varyings need to be dynamically generated in - // GeometryPipelineStage - setDynamicVaryings(attributes); - - return computedPosition; -} -`;var cE=`vec2 computeSt(float featureId) -{ - float stepX = model_textureStep.x; - float centerX = model_textureStep.y; - - #ifdef MULTILINE_BATCH_TEXTURE - float stepY = model_textureStep.z; - float centerY = model_textureStep.w; - - float xId = mod(featureId, model_textureDimensions.x); - float yId = floor(featureId / model_textureDimensions.x); - - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); - #else - return vec2(centerX + (featureId * stepX), 0.5); - #endif -} - -void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) -{ - int featureId = featureIds.SELECTED_FEATURE_ID; - - - if (featureId < model_featuresLength) - { - vec2 featureSt = computeSt(float(featureId)); - - feature.id = featureId; - feature.st = featureSt; - feature.color = texture(model_batchTexture, featureSt); - } - // Floating point comparisons can be unreliable in GLSL, so we - // increment the feature ID to make sure it's always greater - // then the model_featuresLength - a condition we check for in the - // pick ID, to avoid sampling the pick texture if the feature ID is - // greater than the number of features. - else - { - feature.id = model_featuresLength + 1; - feature.st = vec2(0.0); - feature.color = vec4(1.0); - } - - #ifdef HAS_NULL_FEATURE_ID - if (featureId == model_nullFeatureId) { - feature.id = featureId; - feature.st = vec2(0.0); - feature.color = vec4(1.0); - } - #endif -} -`;var EM={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};EM.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=M5e(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),L5e(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===pe.BOTH&&i.addVertexLines(cE),i.addFragmentLines(cE)};function mce(e){return e instanceof xn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function pce(e){return e instanceof xn.FeatureIdTexture?pe.FRAGMENT:pe.BOTH}function M5e(e,t,n){let i,o;return l(t.instances)&&(o=Kt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:pce(o),featureIdDefine:mce(o)}):(o=Kt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:pce(o),featureIdDefine:mce(o)})}function L5e(e){e.addStructField(EM.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(EM.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(EM.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var My=EM;var Ys={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Ys.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",pe.VERTEX),i.addStruct(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",pe.FRAGMENT),i.addStruct(My.STRUCT_ID_SELECTED_FEATURE,My.STRUCT_NAME_SELECTED_FEATURE,pe.BOTH),i.addFunction(Ys.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ys.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,pe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ys.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ys.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,pe.VERTEX),i.addFunction(Ys.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ys.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,pe.FRAGMENT),o.type===ur.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,pe.FRAGMENT);let r=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=on.getAttributeLocationCount(f.type),p=f.semantic===At.POSITION,g;d>1?(g=e.attributeIndex,e.attributeIndex+=d):p&&!a?g=0:g=e.attributeIndex++,N5e(e,f,g,d,r,s)}W5e(i,t.attributes),t.primitiveType===Me.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(AM),i.addFragmentLines(CM)};function N5e(e,t,n,i,o,r){let s=e.shaderBuilder,a=Kt.getAttributeInfo(t),c=o&&!r;i>1?k5e(e,t,n,i):B5e(e,t,n,c),U5e(s,a,c),V5e(s,a),l(t.semantic)&&F5e(s,t),z5e(s,a,o),H5e(s,a,c),G5e(s,a)}function F5e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case At.NORMAL:e.addDefine("HAS_NORMALS");break;case At.TANGENT:e.addDefine("HAS_TANGENTS");break;case At.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case At.TEXCOORD:case At.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function B5e(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===At.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===At.POSITION,f=u?0:n,d=on.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:X.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function k5e(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,u=on.getNumberOfComponents(s)/i,f=X.getSizeInBytes(a),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,x={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(x)}}function V5e(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function U5e(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===At.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function z5e(e,t,n){let i=Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function H5e(e,t,n){let i=Ys.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function G5e(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=Ys.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Ys.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function W5e(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===At.NORMAL?n=!0:r.semantic===At.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Ys.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var SM=Ys;var vM=`#ifdef USE_IBL_LIGHTING -vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) -{ - #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) - // Environment maps were provided, use them for IBL - vec3 viewDirection = -normalize(position); - vec3 iblColor = textureIBL(viewDirection, normal, material); - return iblColor; - #endif - - return vec3(0.0); -} -#endif - -#ifdef USE_CLEARCOAT -vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) -{ - vec3 viewDirection = -normalize(position); - vec3 halfwayDirection = normalize(viewDirection + lightDirection); - vec3 normal = material.clearcoatNormal; - float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0); - - // clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5. - vec3 f0 = vec3(0.04); - vec3 f90 = vec3(1.0); - // Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h). - // This is to make it energy conserving with a simple layering function. - float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); - vec3 F = fresnelSchlick2(f0, f90, NdotV); - - // compute specular reflection from direct lighting - float roughness = material.clearcoatRoughness; - float alphaRoughness = roughness * roughness; - float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness); - vec3 directReflection = F * directStrength * NdotL; - vec3 color = lightColorHdr * directReflection; - - #ifdef SPECULAR_IBL - // Find the direction in which to sample the environment map - vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal)); - vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness); - color += iblColor * material.occlusion; - #endif - - float clearcoatFactor = material.clearcoatFactor; - vec3 clearcoatColor = color * clearcoatFactor; - - // Dim base layer based on transmission loss through clearcoat - return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor; -} -#endif - -#if defined(LIGHTING_PBR) && defined(HAS_NORMALS) -vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position) -{ - #ifdef USE_CUSTOM_LIGHT_COLOR - vec3 lightColorHdr = model_lightColorHdr; - #else - vec3 lightColorHdr = czm_lightColorHdr; - #endif - - vec3 viewDirection = -normalize(position); - vec3 normal = material.normalEC; - vec3 lightDirection = normalize(czm_lightDirectionEC); - - vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material); - vec3 directColor = lightColorHdr * directLighting; - - // Accumulate colors from base layer - vec3 color = directColor + material.emissive; - #ifdef USE_IBL_LIGHTING - color += computeIBL(position, normal, lightDirection, lightColorHdr, material); - #endif - - #ifdef USE_CLEARCOAT - color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material); - #endif - - return color; -} -#endif - -/** - * Compute the material color under the current lighting conditions. - * All other material properties are passed through so further stages - * have access to them. - * - * @param {czm_modelMaterial} material The material properties from {@MaterialStageFS} - * @param {ProcessedAttributes} attributes - */ -void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) -{ - #ifdef LIGHTING_PBR - #ifdef HAS_NORMALS - vec3 color = computePbrLighting(material, attributes.positionEC); - #else - vec3 color = material.diffuse * material.occlusion + material.emissive; - #endif - // In HDR mode, the frame buffer is in linear color space. The - // post-processing stages (see PostProcessStageCollection) will handle - // tonemapping. However, if HDR is not enabled, we must tonemap else large - // values may be clamped to 1.0 - #ifndef HDR - color = czm_pbrNeutralTonemapping(color); - #endif - #else // unlit - vec3 color = material.diffuse; - #endif - - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - // The colors resulting from point cloud styles are adjusted differently. - color = czm_gammaCorrect(color); - #elif !defined(HDR) - // If HDR is not enabled, the frame buffer stores sRGB colors rather than - // linear colors so the linear value must be converted. - color = czm_linearToSrgb(color); - #endif - - material.diffuse = color; -} -`;var j5e={UNLIT:0,PBR:1},Em=Object.freeze(j5e);var _ce={name:"LightingPipelineStage"};_ce.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,pe.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",pe.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Em.PBR?o.addDefine("LIGHTING_PBR",void 0,pe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,pe.FRAGMENT),o.addFragmentLines(vM)};var wM=_ce;var DM=`// If the style color is white, it implies the feature has not been styled. -bool isDefaultStyleColor(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} - -vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) -{ - vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); - vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; - return color; -} - -vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform) -{ - return vec2(textureTransform * vec3(texCoord, 1.0)); -} - -#ifdef HAS_NORMAL_TEXTURE -vec2 getNormalTexCoords() -{ - vec2 texCoord = TEXCOORD_NORMAL; - #ifdef HAS_NORMAL_TEXTURE_TRANSFORM - texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0)); - #endif - return texCoord; -} -#endif - -#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE) -vec3 computeTangent(in vec3 position, in vec2 normalTexCoords) -{ - vec2 tex_dx = dFdx(normalTexCoords); - vec2 tex_dy = dFdy(normalTexCoords); - float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y; - vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position); - return tangent / determinant; -} -#endif - -#ifdef USE_ANISOTROPY -struct NormalInfo { - vec3 tangent; - vec3 bitangent; - vec3 normal; - vec3 geometryNormal; -}; - -NormalInfo getNormalInfo(ProcessedAttributes attributes) -{ - vec3 geometryNormal = attributes.normalEC; - #ifdef HAS_NORMAL_TEXTURE - vec2 normalTexCoords = getNormalTexCoords(); - #endif - - #ifdef HAS_BITANGENTS - vec3 tangent = attributes.tangentEC; - vec3 bitangent = attributes.bitangentEC; - #else // Assume HAS_NORMAL_TEXTURE - vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords); - tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent)); - vec3 bitangent = normalize(cross(geometryNormal, tangent)); - #endif - - #ifdef HAS_NORMAL_TEXTURE - mat3 tbn = mat3(tangent, bitangent, geometryNormal); - vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; - normalSample = 2.0 * normalSample - 1.0; - #ifdef HAS_NORMAL_TEXTURE_SCALE - normalSample.xy *= u_normalTextureScale; - #endif - vec3 normal = normalize(tbn * normalSample); - #else - vec3 normal = geometryNormal; - #endif - - #ifdef HAS_DOUBLE_SIDED_MATERIAL - if (czm_backFacing()) { - tangent *= -1.0; - bitangent *= -1.0; - normal *= -1.0; - geometryNormal *= -1.0; - } - #endif - - NormalInfo normalInfo; - normalInfo.tangent = tangent; - normalInfo.bitangent = bitangent; - normalInfo.normal = normal; - normalInfo.geometryNormal = geometryNormal; - - return normalInfo; -} -#endif - -#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) -vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) -{ - vec2 normalTexCoords = getNormalTexCoords(); - - // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set - #ifdef HAS_BITANGENTS - vec3 t = attributes.tangentEC; - vec3 b = attributes.bitangentEC; - #else - vec3 t = computeTangent(attributes.positionEC, normalTexCoords); - t = normalize(t - geometryNormal * dot(geometryNormal, t)); - vec3 b = normalize(cross(geometryNormal, t)); - #endif - - mat3 tbn = mat3(t, b, geometryNormal); - vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; - normalSample = 2.0 * normalSample - 1.0; - #ifdef HAS_NORMAL_TEXTURE_SCALE - normalSample.xy *= u_normalTextureScale; - #endif - return normalize(tbn * normalSample); -} -#endif - -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE -vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) -{ - vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL; - #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM - normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0)); - #endif - - // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set - #ifdef HAS_BITANGENTS - vec3 t = attributes.tangentEC; - vec3 b = attributes.bitangentEC; - #else - vec3 t = computeTangent(attributes.positionEC, normalTexCoords); - t = normalize(t - geometryNormal * dot(geometryNormal, t)); - vec3 b = normalize(cross(geometryNormal, t)); - #endif - - mat3 tbn = mat3(t, b, geometryNormal); - vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb; - normalSample = 2.0 * normalSample - 1.0; - #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE - normalSample.xy *= u_clearcoatNormalTextureScale; - #endif - return normalize(tbn * normalSample); -} -#endif - -#ifdef HAS_NORMALS -vec3 computeNormal(ProcessedAttributes attributes) -{ - // Geometry normal. This is already normalized - vec3 normal = attributes.normalEC; - - #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) - normal = getNormalFromTexture(attributes, normal); - #endif - - #ifdef HAS_DOUBLE_SIDED_MATERIAL - if (czm_backFacing()) { - normal = -normal; - } - #endif - - return normal; -} -#endif - -#ifdef HAS_BASE_COLOR_TEXTURE -vec4 getBaseColorFromTexture() -{ - vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; - #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM - baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); - #endif - - vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); - - #ifdef HAS_BASE_COLOR_FACTOR - baseColorWithAlpha *= u_baseColorFactor; - #endif - - return baseColorWithAlpha; -} -#endif - -#ifdef HAS_EMISSIVE_TEXTURE -vec3 getEmissiveFromTexture() -{ - vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; - #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM - emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); - #endif - - vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); - #ifdef HAS_EMISSIVE_FACTOR - emissive *= u_emissiveFactor; - #endif - - return emissive; -} -#endif - -#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) -void setSpecularGlossiness(inout czm_modelMaterial material) -{ - #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE - vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; - #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM - specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); - #endif - - vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); - vec3 specular = specularGlossiness.rgb; - float glossiness = specularGlossiness.a; - #ifdef HAS_LEGACY_SPECULAR_FACTOR - specular *= u_legacySpecularFactor; - #endif - - #ifdef HAS_GLOSSINESS_FACTOR - glossiness *= u_glossinessFactor; - #endif - #else - #ifdef HAS_LEGACY_SPECULAR_FACTOR - vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0)); - #else - vec3 specular = vec3(1.0); - #endif - - #ifdef HAS_GLOSSINESS_FACTOR - float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); - #else - float glossiness = 1.0; - #endif - #endif - - #ifdef HAS_DIFFUSE_TEXTURE - vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; - #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM - diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); - #endif - - vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); - #ifdef HAS_DIFFUSE_FACTOR - diffuse *= u_diffuseFactor; - #endif - #elif defined(HAS_DIFFUSE_FACTOR) - vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); - #else - vec4 diffuse = vec4(1.0); - #endif - - material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular)); - // the specular glossiness extension's alpha overrides anything set - // by the base material. - material.alpha = diffuse.a; - - material.specular = specular; - - // glossiness is the opposite of roughness, but easier for artists to use. - material.roughness = 1.0 - glossiness; -} -#elif defined(LIGHTING_PBR) -float setMetallicRoughness(inout czm_modelMaterial material) -{ - #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE - vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; - #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM - metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); - #endif - - vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; - float metalness = clamp(metallicRoughness.b, 0.0, 1.0); - float roughness = clamp(metallicRoughness.g, 0.0, 1.0); - #ifdef HAS_METALLIC_FACTOR - metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0); - #endif - - #ifdef HAS_ROUGHNESS_FACTOR - roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0); - #endif - #else - #ifdef HAS_METALLIC_FACTOR - float metalness = clamp(u_metallicFactor, 0.0, 1.0); - #else - float metalness = 1.0; - #endif - - #ifdef HAS_ROUGHNESS_FACTOR - float roughness = clamp(u_roughnessFactor, 0.0, 1.0); - #else - float roughness = 1.0; - #endif - #endif - - // dielectrics use f0 = 0.04, metals use albedo as f0 - const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); - vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness); - - material.specular = f0; - - // diffuse only applies to dielectrics. - material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness); - - // This is perceptual roughness. The square of this value is used for direct lighting - material.roughness = roughness; - - return metalness; -} -#ifdef USE_SPECULAR -void setSpecular(inout czm_modelMaterial material, in float metalness) -{ - #ifdef HAS_SPECULAR_TEXTURE - vec2 specularTexCoords = TEXCOORD_SPECULAR; - #ifdef HAS_SPECULAR_TEXTURE_TRANSFORM - specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform); - #endif - float specularWeight = texture(u_specularTexture, specularTexCoords).a; - #ifdef HAS_SPECULAR_FACTOR - specularWeight *= u_specularFactor; - #endif - #else - #ifdef HAS_SPECULAR_FACTOR - float specularWeight = u_specularFactor; - #else - float specularWeight = 1.0; - #endif - #endif - - #ifdef HAS_SPECULAR_COLOR_TEXTURE - vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; - #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM - specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); - #endif - vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; - vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); - #ifdef HAS_SPECULAR_COLOR_FACTOR - specularColorFactor *= u_specularColorFactor; - #endif - #else - #ifdef HAS_SPECULAR_COLOR_FACTOR - vec3 specularColorFactor = u_specularColorFactor; - #else - vec3 specularColorFactor = vec3(1.0); - #endif - #endif - material.specularWeight = specularWeight; - vec3 f0 = material.specular; - vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0)); - material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness); -} -#endif -#ifdef USE_ANISOTROPY -void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo) -{ - mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x); - float anisotropyStrength = u_anisotropy.z; - - vec2 direction = vec2(1.0, 0.0); - #ifdef HAS_ANISOTROPY_TEXTURE - vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY; - #ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM - anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); - #endif - vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; - direction = anisotropySample.rg * 2.0 - vec2(1.0); - anisotropyStrength *= anisotropySample.b; - #endif - - direction = rotation * direction; - mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal); - vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0)); - vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT); - - material.anisotropicT = anisotropicT; - material.anisotropicB = anisotropicB; - material.anisotropyStrength = anisotropyStrength; -} -#endif -#ifdef USE_CLEARCOAT -void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes) -{ - #ifdef HAS_CLEARCOAT_TEXTURE - vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; - #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM - clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); - #endif - float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; - #ifdef HAS_CLEARCOAT_FACTOR - clearcoatFactor *= u_clearcoatFactor; - #endif - #else - #ifdef HAS_CLEARCOAT_FACTOR - float clearcoatFactor = u_clearcoatFactor; - #else - // PERFORMANCE_IDEA: this case should turn the whole extension off - float clearcoatFactor = 0.0; - #endif - #endif - - #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE - vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; - #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM - clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); - #endif - float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; - #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR - clearcoatRoughness *= u_clearcoatRoughnessFactor; - #endif - #else - #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR - float clearcoatRoughness = u_clearcoatRoughnessFactor; - #else - float clearcoatRoughness = 0.0; - #endif - #endif - - material.clearcoatFactor = clearcoatFactor; - // This is perceptual roughness. The square of this value is used for direct lighting - material.clearcoatRoughness = clearcoatRoughness; - #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE - material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC); - #else - material.clearcoatNormal = attributes.normalEC; - #endif -} -#endif -#endif - -void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) -{ - #ifdef USE_ANISOTROPY - NormalInfo normalInfo = getNormalInfo(attributes); - material.normalEC = normalInfo.normal; - #elif defined(HAS_NORMALS) - material.normalEC = computeNormal(attributes); - #endif - - vec4 baseColorWithAlpha = vec4(1.0); - // Regardless of whether we use PBR, set a base color - #ifdef HAS_BASE_COLOR_TEXTURE - baseColorWithAlpha = getBaseColorFromTexture(); - #elif defined(HAS_BASE_COLOR_FACTOR) - baseColorWithAlpha = u_baseColorFactor; - #endif - - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - baseColorWithAlpha = v_pointCloudColor; - #elif defined(HAS_COLOR_0) - vec4 color = attributes.color_0; - // .pnts files store colors in the sRGB color space - #ifdef HAS_SRGB_COLOR - color = czm_srgbToLinear(color); - #endif - baseColorWithAlpha *= color; - #endif - - #ifdef USE_CPU_STYLING - baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend); - #endif - material.baseColor = baseColorWithAlpha; - material.diffuse = baseColorWithAlpha.rgb; - material.alpha = baseColorWithAlpha.a; - - #ifdef HAS_OCCLUSION_TEXTURE - vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; - #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM - occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); - #endif - material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; - #endif - - #ifdef HAS_EMISSIVE_TEXTURE - material.emissive = getEmissiveFromTexture(); - #elif defined(HAS_EMISSIVE_FACTOR) - material.emissive = u_emissiveFactor; - #endif - - #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) - setSpecularGlossiness(material); - #elif defined(LIGHTING_PBR) - float metalness = setMetallicRoughness(material); - #ifdef USE_SPECULAR - setSpecular(material, metalness); - #endif - #ifdef USE_ANISOTROPY - setAnisotropy(material, normalInfo); - #endif - #ifdef USE_CLEARCOAT - setClearcoat(material, attributes); - #endif - #endif -} -`;var{Material:q5e,MetallicRoughness:ej,SpecularGlossiness:tj,Specular:gce,Clearcoat:yce}=xn,xce={name:"MaterialPipelineStage",_processTexture:Gl,_processTextureTransform:bce};xce.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;X5e(i,r,s,u,f,d,c),l(i.specularGlossiness)?K5e(i.specularGlossiness,r,s,u,c):(l(i.specular)&&Kt.supportedExtensions.KHR_materials_specular&&Z5e(i.specular,r,s,u,c),l(i.anisotropy)&&Kt.supportedExtensions.KHR_materials_anisotropy&&Q5e(i.anisotropy,r,s,u,c),l(i.clearcoat)&&Kt.supportedExtensions.KHR_materials_clearcoat&&J5e(i.clearcoat,r,s,u,c),e6e(i.metallicRoughness,r,s,u,c));let p=Kt.getAttributeBySemantic(t,At.NORMAL),g=e.lightingOptions;i.unlit||!p||a?g.lightingModel=Em.UNLIT:g.lightingModel=Em.PBR;let m=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=m;let x=e.alphaOptions;i.alphaMode===Tm.BLEND?x.pass=we.TRANSLUCENT:i.alphaMode===Tm.MASK&&(x.alphaCutoff=i.alphaCutoff),s.addFragmentLines(DM),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,pe.BOTH)};function bce(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,pe.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,pe.FRAGMENT),t[s]=function(){return n.transform}}function Y5e(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,pe.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,pe.FRAGMENT),t[s]=function(){return n.scale}}function Gl(e,t,n,i,o,r){e.addUniform("sampler2D",i,pe.FRAGMENT),t[i]=function(){return y(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,pe.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,c,pe.FRAGMENT);let f=n.transform;l(f)&&!$.equals(f,$.IDENTITY)&&bce(e,t,n,i,o);let{scale:d}=n;l(d)&&d!==1&&Y5e(e,t,n,i,o)}function X5e(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:u,occlusionTexture:f}=e;l(a)&&!h.equals(a,q5e.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",pe.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,pe.FRAGMENT),l(c)&&!s&&Gl(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(u)&&!s&&Gl(n,t,u,"u_normalTexture","NORMAL",o),l(f)&&!s&&Gl(n,t,f,"u_occlusionTexture","OCCLUSION",i)}function K5e(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,pe.FRAGMENT),l(r)&&!o&&Gl(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!oe.equals(s,tj.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",pe.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,pe.FRAGMENT)),l(a)&&!o&&Gl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!h.equals(c,tj.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",pe.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,pe.FRAGMENT)),l(u)&&u!==tj.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",pe.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,pe.FRAGMENT))}function Z5e(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,pe.FRAGMENT),l(r)&&!o&&Gl(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==gce.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",pe.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,pe.FRAGMENT)),l(a)&&!o&&Gl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,gce.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",pe.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,pe.FRAGMENT))}var $5e=new h;function Q5e(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,pe.FRAGMENT),l(a)&&!o&&Gl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",pe.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,r,$5e)}}function J5e(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,pe.FRAGMENT),l(r)&&r!==yce.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",pe.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,pe.FRAGMENT)),l(s)&&!o&&Gl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==yce.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",pe.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,pe.FRAGMENT)),l(c)&&!o&&Gl(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!o&&Gl(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function e6e(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,pe.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&Gl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!oe.equals(s,ej.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",pe.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,pe.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&Gl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==ej.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",pe.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,pe.FRAGMENT));let u=e.roughnessFactor;l(u)&&u!==ej.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",pe.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,pe.FRAGMENT))}var IM=xce;var il={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};il.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(il.METADATA_PICKING_VALUE_TYPE,"float",pe.FRAGMENT),i.addDefine(il.METADATA_PICKING_VALUE_STRING,"0.0",pe.FRAGMENT),i.addDefine(il.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",pe.FRAGMENT),i.addDefine(il.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",pe.FRAGMENT),i.addDefine(il.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",pe.FRAGMENT),i.addDefine(il.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",pe.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",pe.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${il.METADATA_PICKING_VALUE_TYPE} value = ${il.METADATA_PICKING_VALUE_TYPE}(${il.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${il.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${il.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${il.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${il.METADATA_PICKING_VALUE_COMPONENT_W};`],pe.FRAGMENT)};var Du=il;var PM=`void morphTargetsStage(inout ProcessedAttributes attributes) -{ - vec3 positionMC = attributes.positionMC; - attributes.positionMC = getMorphedPosition(positionMC); - - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = getMorphedNormal(normalMC); - #endif - - #ifdef HAS_TANGENTS - vec3 tangentMC = attributes.tangentMC; - attributes.tangentMC = getMorphedTangent(tangentMC); - #endif -}`;var Ba={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Ba.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,pe.VERTEX),s6e(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==At.POSITION&&p!==At.NORMAL&&p!==At.TANGENT||(n6e(e,d,e.attributeIndex,a),e.attributeIndex++)}}a6e(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,pe.VERTEX),n.addVertexLines(PM);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=bt(s,e.uniformMap)};var t6e={attributeString:void 0,functionId:void 0};function n6e(e,t,n,i){let o=e.shaderBuilder;i6e(e,t,n);let r=o6e(t,t6e);r6e(o,r,i)}function i6e(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:on.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function o6e(e,t){switch(e.semantic){case At.POSITION:t.attributeString="Position",t.functionId=Ba.FUNCTION_ID_GET_MORPHED_POSITION;break;case At.NORMAL:t.attributeString="Normal",t.functionId=Ba.FUNCTION_ID_GET_MORPHED_NORMAL;break;case At.TANGENT:t.attributeString="Tangent",t.functionId=Ba.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function r6e(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function s6e(e){e.addFunction(Ba.FUNCTION_ID_GET_MORPHED_POSITION,Ba.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,pe.VERTEX),e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Ba.FUNCTION_ID_GET_MORPHED_NORMAL,Ba.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,pe.VERTEX),e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Ba.FUNCTION_ID_GET_MORPHED_TANGENT,Ba.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,pe.VERTEX),e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function a6e(e){e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Ba.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var RM=Ba;var Tce={name:"PickingPipelineStage"};Tce.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)c6e(e,t,a,i);else if(l(a))l6e(e,i);else{let c=Cce(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",pe.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function Cce(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(ur.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function c6e(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Kt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Kt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",pe.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(f.pickTexture,f.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function l6e(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let d=0;d<n;d++){let p=Cce(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let m=g.color;o[d*4+0]=H.floatToByte(m.red),o[d*4+1]=H.floatToByte(m.green),o[d*4+2]=H.floatToByte(m.blue),o[d*4+3]=H.floatToByte(m.alpha)}r._pickIds=i;let a=gt.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,pe.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var OM=Tce;var u6e={ADD:0,REPLACE:1},Wo=Object.freeze(u6e);var MM=`float getPointSizeFromAttenuation(vec3 positionEC) { - // Variables are packed into a single vector to minimize gl.uniformXXX() calls - float pointSize = model_pointCloudParameters.x; - float geometricError = model_pointCloudParameters.y; - float depthMultiplier = model_pointCloudParameters.z; - - float depth = -positionEC.z; - return min((geometricError / depth) * depthMultiplier, pointSize); -} - -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); -} -#endif - -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); -} -#endif - -#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); -} -#elif defined(HAS_POINT_CLOUD_ATTENUATION) -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - return getPointSizeFromAttenuation(v_positionEC); -} -#endif - -#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING -float pointCloudBackFaceCullingStage() { - #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) - // This needs to be computed in eye coordinates so we can't use attributes.normalMC - return step(-v_normalEC.z, 0.0); - #else - return 1.0; - #endif -} -#endif`;var f6e=new oe,Ece={name:"PointCloudStylingPipelineStage"};Ece.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(r)&&!u){let x=p6e(a),b=_6e(r,x);g6e(i,b);let C=y6e(b).indexOf("normalMC")>=0,A=Kt.getAttributeBySemantic(t,At.NORMAL);if(C&&!A)throw new re("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,pe.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=we.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,pe.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,pe.VERTEX);let d,p,g;ur.is3DTiles(o.type)&&(p=!0,d=o.content,g=d.tile.refine===Wo.ADD),i.addUniform("vec4","model_pointCloudParameters",pe.VERTEX),i.addVertexLines(MM);let m=e.uniformMap;m.model_pointCloudParameters=function(){let x=f6e,b=1;p&&(b=g?5:d.tileset.memoryAdjustedScreenSpaceError),x.x=y(f.maximumAttenuation,b),x.x*=n.pixelRatio;let T=d6e(e,t,f,d);x.y=T*f.geometricErrorScale;let C=n.context,A=n.camera.frustum,E;return n.mode===ne.SCENE2D||A instanceof rn?E=Number.POSITIVE_INFINITY:E=C.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=E,p&&(x.w=d.tileset.timeSinceLoad),x}};var Ace=new h;function d6e(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=Kt.getAttributeBySemantic(t,At.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,Ace);a=F.multiplyByPointAsVector(s,a,Ace);let c=a.x*a.y*a.z;return P.cbrt(c/r)}var h6e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},m6e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function p6e(e){let t=Ge(m6e);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var nj="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function _6e(e,t){let n=h6e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${nj})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${nj})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${nj})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function g6e(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,pe.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,pe.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,pe.VERTEX),e.addVertexLines(o))}function ij(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function y6e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&ij(t,o),l(n)&&ij(n,o),l(i)&&ij(i,o),o}var LM=Ece;var NM=`void primitiveOutlineStage() { - v_outlineCoordinates = a_outlineCoordinates; -} -`;var FM=`void primitiveOutlineStage(inout czm_modelMaterial material) { - if (!model_showOutline) { - return; - } - - float outlineX = - texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; - float outlineY = - texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; - float outlineZ = - texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; - float outlineness = max(outlineX, max(outlineY, outlineZ)); - - material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); -} - -`;var Sce={name:"PrimitiveOutlinePipelineStage"};Sce.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,pe.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:on.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",pe.FRAGMENT);let a=Eb.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",pe.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",pe.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(NM),i.addFragmentLines(FM)};var BM=Sce;var vce={name:"PrimitiveStatisticsPipelineStage",_countGeometry:wce,_count2DPositions:Dce,_countMorphTargetAttributes:Ice,_countMaterialTextures:Pce,_countFeatureIdTextures:Rce,_countBinaryMetadata:Oce};vce.process=function(e,t,n){let i=e.model,o=i.statistics;wce(o,t),Dce(o,e.runtimePrimitive),Ice(o,t),Pce(o,t.material),Rce(o,t.featureIds),Oce(o,i)};function wce(e,t){let n=l(t.indices)?t.indices.count:Kt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Me.POINTS?e.pointsLength+=n:Me.isTriangles(i)&&(e.trianglesLength+=x6e(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function x6e(e,t){switch(e){case Me.TRIANGLES:return t/3;case Me.TRIANGLE_STRIP:case Me.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Dce(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Ice(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function Pce(e,t){let n=b6e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function b6e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function Rce(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof xn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Oce(e,t){let n=t.structuralMetadata;l(n)&&(T6e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function T6e(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var kM=vce;var C6e=new F,A6e=new F,Mce={name:"SceneMode2DPipelineStage"};Mce.process=function(e,t,n){let i=Kt.getAttributeBySemantic(t,At.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=F.multiplyTransformation(s,a,C6e),u=v6e(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let x=I6e(i,c,u,n);f.positionBuffer2D=x,r._modelResources.push(x),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,pe.VERTEX),o.addUniform("mat4","u_modelView2D",pe.VERTEX);let p=F.fromTranslation(u.center,new F),g=n.context,m={u_modelView2D:function(){return F.multiplyTransformation(g.uniformState.view,p,A6e)}};e.uniformMap=bt(m,e.uniformMap)};var E6e=new h,S6e=new h;function v6e(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,E6e),o=zi.computeActualEllipsoidPosition(n,i,i),r=F.multiplyByPoint(t,e.positionMax,S6e),s=zi.computeActualEllipsoidPosition(n,r,r);return ae.fromCornerPoints(o,s,new ae)}var Lce=new h;function w6e(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,Lce),c=h.multiplyComponents(a,r,a),u=h.add(c,o,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function D6e(e,t,n,i){let o;l(e.quantization)?o=w6e(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let u=h.fromArray(o,c,Lce);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=F.multiplyByPoint(t,u,u),d=zi.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function I6e(e,t,n,i){let o=Ge(i);o.mode=ne.COLUMBUS_VIEW;let r=n.center,s=D6e(e,t,r,o),a=gt.createVertexBuffer({context:i.context,typedArray:s,usage:Fe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var VM=Mce;var UM=`void skinningStage(inout ProcessedAttributes attributes) -{ - mat4 skinningMatrix = getSkinningMatrix(); - mat3 skinningMatrixMat3 = mat3(skinningMatrix); - - vec4 positionMC = vec4(attributes.positionMC, 1.0); - attributes.positionMC = vec3(skinningMatrix * positionMC); - - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = skinningMatrixMat3 * normalMC; - #endif - - #ifdef HAS_TANGENTS - vec3 tangentMC = attributes.tangentMC; - attributes.tangentMC = skinningMatrixMat3 * tangentMC; - #endif -}`;var Db={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};Db.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,pe.VERTEX),R6e(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,pe.VERTEX),n.addVertexLines(UM);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=bt(r,e.uniformMap)};function P6e(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===At.JOINTS||r.semantic===At.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function R6e(e,t){e.addFunction(Db.FUNCTION_ID_GET_SKINNING_MATRIX,Db.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,pe.VERTEX),e.addFunctionLines(Db.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=P6e(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(Db.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(Db.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var zM=Db;var HM=`void verticalExaggerationStage( - inout ProcessedAttributes attributes -) { - // Compute the distance from the camera to the local center of curvature. - vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); - vec2 vertexAzimuth = normalize(vertexPositionENU.xy); - // Curvature = 1 / radius of curvature. - float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature); - float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; - - // Compute the approximate ellipsoid normal at the vertex position. - // Uses a circular approximation for the Earth curvature along the geodesic. - vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; - vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; - vec3 vertexNormal = normalize(centerToVertex); - - // Estimate the (sine of the) angle between the camera direction and the vertex normal - float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC); - float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC); - float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance); - bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta; - - // Approximate the change in height above the ellipsoid, from camera to vertex position. - float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal); - float smallAngleVersine = 0.5 * sinTheta * sinTheta; - float versine = isSmallAngle ? smallAngleVersine : exactVersine; - float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine; - float vertexHeight = czm_eyeHeight + dHeight; - - // Transform the approximate vertex normal to model coordinates. - vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz; - vertexNormalMC = normalize(vertexNormalMC); - - // Compute the exaggeration and apply it along the approximate vertex normal. - float stretch = u_verticalExaggerationAndRelativeHeight.x; - float shift = u_verticalExaggerationAndRelativeHeight.y; - float exaggeration = (vertexHeight - shift) * (stretch - 1.0); - attributes.positionMC += exaggeration * vertexNormalMC; -} -`;var Nce={name:"VerticalExaggerationPipelineStage"},O6e=new z;Nce.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(HM),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,pe.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",pe.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return z.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,O6e)}};var GM=Nce;var oj={};function M6e(e){let t=Ne.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function L6e(e,t){let n=t.length,i=Ne.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function N6e(e){let t=e-2,n=2+t*4,i=Ne.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function F6e(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=c}return r}function B6e(e){let t=e-2,n=2+t*4,i=Ne.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function k6e(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}oj.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Me.TRIANGLES)return i?L6e(t,n):M6e(t);if(e===Me.TRIANGLE_STRIP)return i?F6e(t,n):N6e(t);if(e===Me.TRIANGLE_FAN)return i?k6e(t,n):B6e(t)};oj.getWireframeIndicesCount=function(e,t){return e===Me.TRIANGLES?t*2:e===Me.TRIANGLE_STRIP||e===Me.TRIANGLE_FAN?2+(t-2)*4:t};var lE=oj;var Fce={name:"WireframePipelineStage"};Fce.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,pe.FRAGMENT);let o=e.model,r=V6e(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Me.LINES,e.count=lE.getWireframeIndicesCount(a,c)};function V6e(e,t,n){let o=Kt.getAttributeBySemantic(e,At.POSITION).count,r=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&r?(s=f.sizeInBytes===d?new Uint8Array(d):Ne.createTypedArray(o,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=lE.createWireframeIndices(a,o,s),u=Ne.fromSizeInBytes(c.BYTES_PER_ELEMENT);return gt.createIndexBuffer({context:n.context,typedArray:c,usage:Fe.STATIC_DRAW,indexDatatype:u})}var WM=Fce;function Bce(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}Bce.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,u=e.mode!==ne.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r),x=!(g&&l(r.fragmentShaderText))||r.mode!==x_.REPLACE_MATERIAL,b=Kt.hasQuantizedAttributes(n.attributes),T=o.debugWireframe&&Me.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),C=o.pointCloudShading,A=l(C)&&C.attenuation,E=l(C)&&C.backFaceCulling,v=n.primitiveType===Me.POINTS&&(l(s)||A||E),D=o._enableShowOutline&&l(n.outlineCoordinates),O=U6e(o,i,n),R=l(o.classificationType);u&&t.push(VM),t.push(SM),T&&t.push(WM),R&&t.push(lM),d&&t.push(RM),p&&t.push(zM),v&&t.push(LM),b&&t.push(TM),x&&t.push(IM),t.push(Ry),t.push(Bf),t.push(Du),O.hasPropertyTable&&(t.push(My),t.push(cM),t.push(dM)),f&&t.push(GM),g&&t.push(xM),t.push(wM),o.allowPicking&&t.push(OM),D&&t.push(BM),t.push(aM),t.push(kM)};function U6e(e,t,n){let i;return l(t.instances)&&(i=Kt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Kt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var jM=Bce;function rj(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],z6e(this)}Object.defineProperties(rj.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function z6e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let u=i[c].index,f=r[u];s.push(f);let d=n[c],p=kce(f,d,new F);a.push(p)}}function kce(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}rj.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=kce(i,o,e[n])}};var qM=rj;function H6e(){this.pass=void 0,this.alphaCutoff=void 0}var YM=H6e;function G6e(e){this.shaderBuilder=new Sx,this.model=e,this.uniformMap={},this.alphaOptions=new YM,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:ac.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var XM=G6e;var KM=`void silhouetteStage(inout vec4 color) { - if(model_silhouettePass) { - color = czm_gammaCorrect(model_silhouetteColor); - } -}`;var ZM=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { - #ifdef HAS_NORMALS - if(model_silhouettePass) { - vec3 normal = normalize(czm_normal3D * attributes.normalMC); - normal.x *= czm_projection[0][0]; - normal.y *= czm_projection[1][1]; - positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; - } - #endif -} -`;var hz={name:"ModelSilhouettePipelineStage"};hz.silhouettesLength=0;hz.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++hz.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,pe.BOTH),i.addVertexLines(ZM),i.addFragmentLines(KM),i.addUniform("vec4","model_silhouetteColor",pe.FRAGMENT),i.addUniform("float","model_silhouetteSize",pe.VERTEX),i.addUniform("bool","model_silhouettePass",pe.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=bt(o,e.uniformMap),e.hasSilhouette=!0};var $M=hz;var QM=`void modelSplitterStage() -{ - // Don't split when rendering the shadow map, because it is rendered from - // the perspective of a totally different camera. -#ifndef SHADOW_MAP - if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif -} -`;var mz={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};mz.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,pe.FRAGMENT),i.addFragmentLines(QM);let o={};i.addUniform("float",mz.SPLIT_DIRECTION_UNIFORM_NAME,pe.FRAGMENT),o[mz.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=bt(o,e.uniformMap)};var JM=mz;function W6e(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ge(e.uniformMap),this.alphaOptions=Ge(e.alphaOptions),this.renderStateOptions=Ge(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var eL=W6e;function j6e(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,Em.UNLIT)}var tL=j6e;function q6e(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ge(e.uniformMap),this.alphaOptions=Ge(e.alphaOptions),this.renderStateOptions=Ge(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Kt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Kt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new tL,this.pickId=void 0}var nL=q6e;function aj(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==Vn.CESIUM_3D_TILE,this._classifies3DTiles=o!==Vn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Z6e(this)}function Y6e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:dt.KEEP,zFail:dt.DECREMENT_WRAP,zPass:dt.KEEP},backFunction:e,backOperation:{fail:dt.KEEP,zFail:dt.INCREMENT_WRAP,zPass:dt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ac.LESS_OR_EQUAL},depthMask:!1}}var X6e={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},K6e={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},zce=[];function Z6e(e){let t=e._command,n=zce;if(e._useDebugWireframe){t.pass=we.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=iL(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=we.TERRAIN_CLASSIFICATION,s=sj(t,r),a=Vce(t,r);n.length=0,n.push(s,a),e._commandListTerrain=iL(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Uce(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=we.CESIUM_3D_TILE_CLASSIFICATION,s=sj(t,r),a=Vce(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=iL(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Uce(e,n,e._commandList3DTilesPicking))}}function iL(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let u=o[c],f=r[c];for(let d=0;d<a;d++){let p=t[d],g=Ze.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function sj(e,t){let n=Ze.shallowClone(e);n.cull=!1,n.pass=t;let i=t===we.TERRAIN_CLASSIFICATION?Un.ALWAYS:Un.EQUAL,o=Y6e(i);return n.renderState=Ve.fromCache(o),n}function Vce(e,t){let n=Ze.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ve.fromCache(X6e),n}var $6e=[];function Uce(e,t,n){let i=Ve.fromCache(K6e),o=t[0],r=t[1],s=Ze.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=Ze.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=$6e;return c.length=0,c.push(s,a),iL(e,c,n)}Object.defineProperties(aj.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ae.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});aj.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=sj(this._command,o),s=zce;s.length=0,s.push(r),this._commandListIgnoreShow=iL(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var oL=aj;function pz(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===we.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,d=c;this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=ae.clone(t.boundingVolume),this._modelMatrix2D=new F,this._boundingVolume2D=new ae,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,Q6e(this)}function b_(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}b_.clone=function(e){return new b_({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Q6e(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new b_({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new b_({command:r9e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new b_({command:f9e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new b_({command:d9e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new b_({command:s9e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new b_({command:a9e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(pz.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ae.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,e9e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,t9e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,n9e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,i9e(this))}}});function J6e(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ae.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function e9e(e){let t=e.shadows,n=yn.castShadows(t),i=yn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function t9e(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=Ge(r.renderState,!0);s.cull.enabled=t,r.renderState=Ve.fromCache(s)}}}function n9e(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=Ge(r.renderState,!0);s.cull.face=t,r.renderState=Ve.fromCache(s)}}}function i9e(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}pz.prototype.pushCommands=function(e,t){let n=Hce(this,e);n&&!this._has2DCommands&&(o9e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(J6e(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==sh.ALL_OPAQUE&&fE(t,this._translucentCommand,n),i===sh.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||fE(o._backfaceCommands,this._skipLodBackfaceCommand,n),c9e(this,r,n),fE(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){fE(t,this._silhouetteModelCommand,n);return}return fE(t,this._originalCommand,n),t}};pz.prototype.pushSilhouetteCommands=function(e,t){let n=Hce(this,e);return fE(t,this._silhouetteColorCommand,n),t};function fE(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function Hce(e,t){if(t.mode!==ne.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*P.PI;return o<s&&r>s||o<-s&&r>-s}function uE(e,t){if(!l(t))return;let n=b_.clone(t),i=Ze.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function o9e(e){uE(e,e._originalCommand),uE(e,e._translucentCommand),uE(e,e._skipLodBackfaceCommand),uE(e,e._skipLodStencilCommand),uE(e,e._silhouetteModelCommand),uE(e,e._silhouetteColorCommand)}function r9e(e){let t=Ze.shallowClone(e);t.pass=we.TRANSLUCENT;let n=Ge(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function s9e(e,t){let n=t._silhouetteId%255,i=Ze.shallowClone(e),o=Ge(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function a9e(e,t){let n=t._silhouetteId%255,i=Ze.shallowClone(e),o=Ge(e.renderState,!0);o.cull.enabled=!1,(e.pass===we.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=we.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ge(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function c9e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=l9e(o);if(r!==s){let a=u9e(r),c=Ge(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ve.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function l9e(e){return(e.renderState.stencilTest.reference&Ut.SKIP_LOD_MASK)>>>Ut.SKIP_LOD_BIT_SHIFT}function u9e(e){return Ut.CESIUM_3D_TILE_MASK|e<<Ut.SKIP_LOD_BIT_SHIFT}function f9e(e){let t=Ze.shallowClone(e),n=Ge(e.renderState,!0);n.cull.enabled=!0,n.cull.face=yi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ge(t.uniformMap),o=new z(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ve.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function d9e(e){let t=Ze.shallowClone(e),n=Ge(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Ut.SKIP_LOD_MASK,i.reference=Ut.CESIUM_3D_TILE_MASK,i.frontFunction=Un.GREATER_OR_EQUAL,i.frontOperation.zPass=dt.REPLACE,i.backFunction=Un.GREATER_OR_EQUAL,i.backOperation.zPass=dt.REPLACE,n.stencilMask=Ut.CESIUM_3D_TILE_MASK|Ut.SKIP_LOD_MASK,t.renderState=Ve.fromCache(n),t}var rL=pz;var sL=`precision highp float; - -czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { - czm_modelVertexOutput vsOutput; - vsOutput.positionMC = positionMC; - vsOutput.pointSize = 1.0; - return vsOutput; -} - -void main() -{ - // Initialize the attributes struct with all - // attributes except quantized ones. - ProcessedAttributes attributes; - initializeAttributes(attributes); - - // Dequantize the quantized ones and add them to the - // attributes struct. - #ifdef USE_DEQUANTIZATION - dequantizationStage(attributes); - #endif - - #ifdef HAS_MORPH_TARGETS - morphTargetsStage(attributes); - #endif - - #ifdef HAS_SKINNING - skinningStage(attributes); - #endif - - #ifdef HAS_PRIMITIVE_OUTLINE - primitiveOutlineStage(); - #endif - - // Compute the bitangent according to the formula in the glTF spec. - // Normal and tangents can be affected by morphing and skinning, so - // the bitangent should not be computed until their values are finalized. - #ifdef HAS_BITANGENTS - attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); - #endif - - FeatureIds featureIds; - featureIdStage(featureIds, attributes); - - #ifdef HAS_SELECTED_FEATURE_ID - SelectedFeature feature; - selectedFeatureIdStage(feature, featureIds); - // Handle any show properties that come from the style. - cpuStylingStage(attributes.positionMC, feature); - #endif - - #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) - // The scene mode 2D pipeline stage and instancing stage add a different - // model view matrix to accurately project the model to 2D. However, the - // output positions and normals should be transformed by the 3D matrices - // to keep the data the same for the fragment shader. - mat4 modelView = czm_modelView3D; - mat3 normal = czm_normal3D; - #else - // These are used for individual model projection because they will - // automatically change based on the scene mode. - mat4 modelView = czm_modelView; - mat3 normal = czm_normal; - #endif - - // Update the position for this instance in place - #ifdef HAS_INSTANCING - - // The legacy instance stage is used when rendering i3dm models that - // encode instances transforms in world space, as opposed to glTF models - // that use EXT_mesh_gpu_instancing, where instance transforms are encoded - // in object space. - #ifdef USE_LEGACY_INSTANCING - mat4 instanceModelView; - mat3 instanceModelViewInverseTranspose; - - legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); - - modelView = instanceModelView; - normal = instanceModelViewInverseTranspose; - #else - instancingStage(attributes); - #endif - - #ifdef USE_PICKING - v_pickColor = a_pickColor; - #endif - - #endif - - Metadata metadata; - MetadataClass metadataClass; - MetadataStatistics metadataStatistics; - metadataStage(metadata, metadataClass, metadataStatistics, attributes); - - #ifdef HAS_VERTICAL_EXAGGERATION - verticalExaggerationStage(attributes); - #endif - - #ifdef HAS_CUSTOM_VERTEX_SHADER - czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); - customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); - #endif - - // Compute the final position in each coordinate system needed. - // This returns the value that will be assigned to gl_Position. - vec4 positionClip = geometryStage(attributes, modelView, normal); - - // This must go after the geometry stage as it needs v_positionWC - #ifdef HAS_ATMOSPHERE - atmosphereStage(attributes); - #endif - - #ifdef ENABLE_CLIPPING_POLYGONS - modelClippingPolygonsStage(attributes); - #endif - - #ifdef HAS_SILHOUETTE - silhouetteStage(attributes, positionClip); - #endif - - #ifdef HAS_POINT_CLOUD_SHOW_STYLE - float show = pointCloudShowStylingStage(attributes, metadata); - #else - float show = 1.0; - #endif - - #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING - show *= pointCloudBackFaceCullingStage(); - #endif - - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); - #endif - - #ifdef PRIMITIVE_TYPE_POINTS - #ifdef HAS_CUSTOM_VERTEX_SHADER - gl_PointSize = vsOutput.pointSize; - #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) - gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); - #else - gl_PointSize = 1.0; - #endif - - gl_PointSize *= show; - #endif - - // Important NOT to compute gl_Position = show * positionClip or we hit: - // https://github.com/CesiumGS/cesium/issues/11270 - // - // We will discard points with v_pointCloudShow == 0 in the fragment shader. - gl_Position = positionClip; - - #ifdef HAS_POINT_CLOUD_SHOW_STYLE - v_pointCloudShow = show; - #endif -} -`;var aL=` -precision highp float; -czm_modelMaterial defaultModelMaterial() -{ - czm_modelMaterial material; - material.diffuse = vec3(0.0); - material.specular = vec3(1.0); - material.roughness = 1.0; - material.occlusion = 1.0; - material.normalEC = vec3(0.0, 0.0, 1.0); - material.emissive = vec3(0.0); - material.alpha = 1.0; - return material; -} - -vec4 handleAlpha(vec3 color, float alpha) -{ - #ifdef ALPHA_MODE_MASK - if (alpha < u_alphaCutoff) { - discard; - } - #endif - - return vec4(color, alpha); -} - -SelectedFeature selectedFeature; - -void main() -{ - #ifdef HAS_POINT_CLOUD_SHOW_STYLE - if (v_pointCloudShow == 0.0) - { - discard; - } - #endif - - #ifdef HAS_MODEL_SPLITTER - modelSplitterStage(); - #endif - - czm_modelMaterial material = defaultModelMaterial(); - - ProcessedAttributes attributes; - geometryStage(attributes); - - FeatureIds featureIds; - featureIdStage(featureIds, attributes); - - Metadata metadata; - MetadataClass metadataClass; - MetadataStatistics metadataStatistics; - metadataStage(metadata, metadataClass, metadataStatistics, attributes); - - //======================================================================== - // When not picking metadata START - #ifndef METADATA_PICKING_ENABLED - - #ifdef HAS_SELECTED_FEATURE_ID - selectedFeatureIdStage(selectedFeature, featureIds); - #endif - - #ifndef CUSTOM_SHADER_REPLACE_MATERIAL - materialStage(material, attributes, selectedFeature); - #endif - - #ifdef HAS_CUSTOM_FRAGMENT_SHADER - customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); - #endif - - lightingStage(material, attributes); - - #ifdef HAS_SELECTED_FEATURE_ID - cpuStylingStage(material, selectedFeature); - #endif - - #ifdef HAS_MODEL_COLOR - modelColorStage(material); - #endif - - #ifdef HAS_PRIMITIVE_OUTLINE - primitiveOutlineStage(material); - #endif - - vec4 color = handleAlpha(material.diffuse, material.alpha); - - // When not picking metadata END - //======================================================================== - #else - //======================================================================== - // When picking metadata START - - vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0); - metadataPickingStage(metadata, metadataClass, metadataValues); - vec4 color = metadataValues; - - #endif - // When picking metadata END - //======================================================================== - - #ifdef HAS_CLIPPING_PLANES - modelClippingPlanesStage(color); - #endif - - #ifdef ENABLE_CLIPPING_POLYGONS - modelClippingPolygonsStage(); - #endif - - //======================================================================== - // When not picking metadata START - #ifndef METADATA_PICKING_ENABLED - - #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) - silhouetteStage(color); - #endif - - #ifdef HAS_ATMOSPHERE - atmosphereStage(color, attributes); - #endif - - #endif - // When not picking metadata END - //======================================================================== - - out_FragColor = color; -} -`;function Gce(){}Gce.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=h9e(e,n,t),o=m9e(e,i,t),r=e.model;return l(r.classificationType)?new oL({primitiveRenderResources:e,command:o}):new rL({primitiveRenderResources:e,command:o})};function h9e(e,t,n){t.addVertexLines(sL),t.addFragmentLines(aL);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function m9e(e,t,n){let i=p9e(e),o=new ei({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,c=n.mode===ne.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&r._projectTo2D)u=F.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new F),f=e.runtimePrimitive.boundingSphere2D;else{let T=c?a._computedModelMatrix:a._computedModelMatrix2D;u=F.multiplyTransformation(T,e.runtimeNode.computedTransform,new F),f=ae.transform(e.boundingSphere,u)}let d=Ge(Ve.fromCache(e.renderStateOptions),!0);d.cull.face=Kt.getCullFace(u,e.primitiveType),d=Ve.fromCache(d);let p=l(r.classificationType),g=p?!1:yn.castShadows(r.shadows),m=p?!1:yn.receiveShadows(r.shadows),x=p?void 0:e.pickId;return new Ze({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:x,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function p9e(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var cL=Gce;function Iu(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=Kt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},_9e(this)}Object.defineProperties(Iu.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function _9e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Wce(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let C=0;C<s;C++){let A=r[C],E=new jO({articulation:A,sceneGraph:e}),v=E.name;a[v]=E}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=F.IDENTITY;for(let C=0;C<d;C++){let A=n.nodes[C],E=jce(e,A,p);e._rootNodes.push(E)}let g=t.skins,m=e._runtimeSkins,x=g.length;for(let C=0;C<x;C++){let A=g[C];m.push(new qM({skin:A,sceneGraph:e}))}let b=e._skinnedNodes,T=b.length;for(let C=0;C<T;C++){let A=b[C],E=e._runtimeNodes[A],D=c[A].skin.index;E._runtimeSkin=m[D],E.updateJointMatrices()}e.applyArticulations()}function Wce(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var g9e=new h;function y9e(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,g9e);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=Mt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Mt.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ae.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function jce(e,t,n){let i=[],o=Kt.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let d=t.children[f],p=F.multiplyTransformation(n,o,new F),g=jce(e,d,p);i.push(g)}let s=new sM({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new jM({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new QO(f,s);f._nodesByName[u]=d}return c}var x9e=new h,b9e=new h,T9e=new h,C9e=new h;Iu.prototype.buildDrawCommands=function(e){let t=this._model,n=new XM(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,x9e),c=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,b9e);for(o=0;o<this._runtimeNodes.length;o++){let u=this._runtimeNodes[o];if(!l(u))continue;u.configurePipeline();let f=u.pipelineStages,d=new eL(n,u);for(r=0;r<f.length;r++)f[r].process(d,u.node,e);let p=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){let g=u.runtimePrimitives[r];g.configurePipeline(e);let m=g.pipelineStages,x=new nL(d,g);for(s=0;s<m.length;s++)m[s].process(x,g.primitive,e);g.boundingSphere=ae.clone(x.boundingSphere,new ae);let b=F.multiplyByPoint(p,x.positionMin,T9e),T=F.multiplyByPoint(p,x.positionMax,C9e);h.minimumByComponent(a,b,a),h.maximumByComponent(c,T,c);let C=cL.buildModelDrawCommand(x,e);g.drawCommand=C}}this._boundingSphere=ae.fromCornerPoints(a,c,new ae),this._boundingSphere=ae.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ae.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ae.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Iu.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;l(n.color)&&t.push(Py),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(GO),n.isClippingEnabled()&&t.push(XO),n.isClippingPolygonsEnabled()&&t.push($O),n.hasSilhouette(e)&&t.push($M),l(n.splitDirection)&&n.splitDirection!==Br.NONE&&t.push(JM),ur.is3DTiles(n.type)&&t.push(kO),i&&t.push(zO))};Iu.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==ne.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};Iu.prototype.updateModelMatrix=function(e,t){Wce(this,e),t.mode!==ne.SCENE3D&&y9e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Iu.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function qce(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);qce(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,o)}}function _z(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];qce(e,c,t,n,i)}}var A9e={backFaceCulling:void 0};Iu.prototype.updateBackFaceCulling=function(e){let t=A9e;t.backFaceCulling=e,_z(this,!1,E9e,t)};function E9e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var S9e={shadowMode:void 0};Iu.prototype.updateShadows=function(e){let t=S9e;t.shadowMode=e,_z(this,!1,v9e,t)};function v9e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var w9e={debugShowBoundingVolume:void 0};Iu.prototype.updateShowBoundingVolume=function(e){let t=w9e;t.debugShowBoundingVolume=e,_z(this,!1,D9e,t)};function D9e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Yce=[],I9e={frameState:void 0,hasSilhouette:void 0};Iu.prototype.pushDrawCommands=function(e){let t=Yce;t.length=0;let n=I9e;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,_z(this,!0,P9e,n),e.commandList.push.apply(e.commandList,t)};function P9e(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Yce,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}Iu.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};Iu.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var lL=Iu;function Ly(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new St}Object.defineProperties(Ly.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});Ly.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};Ly.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};Ly.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Ly.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Ly.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Ly.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var uL=Ly;var $ce=Ko(sV(),1);var Xce={},Ib=Uint32Array.BYTES_PER_ELEMENT;Xce.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=Ib;let o=i.getUint32(t,!0);if(o!==1)throw new re(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=Ib,t+=Ib;let r=i.getUint32(t,!0);if(r===0)throw new re("Feature table must have a byte length greater than zero");t+=Ib;let s=i.getUint32(t,!0);t+=Ib;let a=i.getUint32(t,!0);t+=Ib;let c=i.getUint32(t,!0);t+=Ib;let u=No(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=No(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new oh(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new re("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(x)&&(x=h.unpack(x));let b=R9e(g,d);if(b.rtcCenter=x,b.pointsLength=m,!b.hasPositions){let T=O9e(g);b.positions=T,b.hasPositions=b.hasPositions||l(T)}if(!b.hasPositions)throw new re("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let T=L9e(g);b.normals=T,b.hasNormals=b.hasNormals||l(T)}if(!b.hasColors){let T=M9e(g);b.colors=T,b.hasColors=b.hasColors||l(T),b.hasConstantColor=l(b.constantColor),b.isTranslucent=l(T)&&T.isTranslucent}if(!b.hasBatchIds){let T=N9e(g);b.batchIds=T,b.hasBatchIds=b.hasBatchIds||l(T)}if(b.hasBatchIds){let T=g.getGlobalProperty("BATCH_LENGTH");if(!l(T))throw new re("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=T}return l(p)&&(p=new Uint8Array(p),b.batchTableJson=d,b.batchTableBinary=p),b};function R9e(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,u,f,d,p;if(l(s)){o=s.properties;let m=s.byteOffset,x=s.byteLength;if(!l(o)||!l(m)||!l(x))throw new re("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+x),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),d=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:bt(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function O9e(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",X.FLOAT,3),{name:At.POSITION,semantic:At.POSITION,typedArray:n,isQuantized:!1,componentDatatype:X.FLOAT,type:on.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(i))throw new re("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(r))throw new re("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:At.POSITION,semantic:At.POSITION,typedArray:n,isQuantized:!0,componentDatatype:X.FLOAT,type:on.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:X.UNSIGNED_SHORT,quantizedType:on.VEC3}}}function M9e(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",X.UNSIGNED_BYTE,4),{name:At.COLOR,semantic:At.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:on.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",X.UNSIGNED_BYTE,3),{name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:on.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",X.UNSIGNED_SHORT,1),{name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n,componentDatatype:X.FLOAT,type:on.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",X.UNSIGNED_BYTE,4),o=i[3],r=H.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:At.COLOR,semantic:At.COLOR,setIndex:0,constantColor:r,componentDatatype:X.FLOAT,type:on.VEC4,isQuantized:!1,isTranslucent:s}}}function L9e(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",X.FLOAT,3),{name:At.NORMAL,semantic:At.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:X.FLOAT,type:on.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",X.UNSIGNED_BYTE,2),{name:At.NORMAL,semantic:At.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:on.VEC2,quantizedComponentDatatype:X.UNSIGNED_BYTE,componentDatatype:X.FLOAT,type:on.VEC3}}function N9e(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",X.UNSIGNED_SHORT,1);return{name:At.FEATURE_ID,semantic:At.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:X.fromTypedArray(n),type:on.SCALAR}}}var Pb=Xce;var F9e=xn.Components,B9e=xn.Scene,k9e=xn.Node,V9e=xn.Primitive,U9e=xn.Attribute,Kce=xn.Quantization,z9e=xn.FeatureIdAttribute,H9e=xn.Material,G9e=xn.MetallicRoughness;function Ny(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=pt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(Ny.prototype=Object.create(Ki.prototype),Ny.prototype.constructor=Ny);Object.defineProperties(Ny.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Ny.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=Pb.parse(this._arrayBuffer,this._byteOffset),this._state=pt.PROCESSING,this._promise=Promise.resolve(this)};Ny.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===pt.READY)return!0;if(this._state===pt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=W9e(this,e.context)}return!1};function W9e(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=n_.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&j9e(e,i,r),nWe(e,t),e._state=pt.READY,e}).catch(function(r){e.unload(),e._state=pt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function j9e(e,t,n){e._state=pt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:At.POSITION,typedArray:n.POSITION.array,componentDatatype:X.FLOAT,type:on.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=d,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=d<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT,o.quantizedType=on.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:At.NORMAL,typedArray:n.NORMAL.array,componentDatatype:X.FLOAT,type:on.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=X.UNSIGNED_BYTE,o.quantizedType=on.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:X.UNSIGNED_BYTE,type:on.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:X.UNSIGNED_BYTE,type:on.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:At.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:X.fromTypedArray(a),type:on.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let u=c.data;r[a]={byteOffset:u.byteOffset,type:q9e(u.componentsPerAttribute),componentType:Y9e(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function q9e(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Y9e(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function fL(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Kce,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Kce;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new U9e;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=y(t.normalized,!1),r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Mn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=H.pack(t.constantColor,a)}else{let a=gt.createVertexBuffer({typedArray:i,context:n,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===At.POSITION&&s&&(r.typedArray=i),r}var Zce,gz;function X9e(e){if(!l(gz)){Zce=new $ce.default(0),gz=new Array(e);for(let t=0;t<e;++t)gz[t]=Zce.random()}return gz}var K9e=new h,Z9e=new h,$9e=new h;function Q9e(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=X9e(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,K9e),u=h.fromElements(a,a,a,Z9e),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)d=Math.floor(r[f]*i),p=h.unpack(t,d*3,$9e),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var J9e={name:At.COLOR,semantic:At.COLOR,setIndex:0,constantColor:H.DARKGRAY,componentDatatype:X.FLOAT,type:on.VEC4,isQuantized:!1,isTranslucent:!1};function eWe(e,t,n){let i=[],o,r=t.positions;return l(r)&&(Q9e(r),o=fL(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=fL(e,t.normals,n),i.push(o)),l(t.colors)?(o=fL(e,t.colors,n),i.push(o)):(o=fL(e,J9e,n),i.push(o)),l(t.batchIds)&&(o=fL(e,t.batchIds,n),i.push(o)),i}function tWe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);if(l(o)||e.hasDracoBatchTable){let s=y(n,i);return p_({count:s,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t})}return new qs({schema:{},propertyTables:[]})}function nWe(e,t){let n=e._parsedContent,i=new G9e;i.metallicFactor=0,i.roughnessFactor=.9;let o=new H9e;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=Tm.BLEND);let s=!l(n.normals);o.unlit=s;let a=new V9e;if(a.attributes=eWe(e,n,t),a.primitiveType=Me.POINTS,a.material=o,l(n.batchIds)){let g=new z9e;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new k9e;c.index=0,c.primitives=[a];let u=new B9e;u.nodes=[c],u.upAxis=Lo.Z,u.forwardAxis=Lo.X;let f=new F9e;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=tWe(n,d),d.length>0&&iWe(e,a,d,t),l(n.rtcCenter)&&(f.transform=F.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=F.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function iWe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=gt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Fe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}Ny.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var dL=Ny;var oWe=new h,rWe=new h,sWe=new h,aWe=new F,cWe=new F,lWe=new F,uWe=new fe,fWe=new ae;function dE(e,t,n,i,o,r,s){if(!e._ready||n.mode===ne.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,u=c._runtimeNodes;for(let f=0;f<u.length;f++){let d=u[f],p=d.node,g=F.clone(d.computedTransform,aWe),m=F.clone(c.computedModelMatrix,cWe),x=p.instances;l(x)&&x.transformInWorldSpace&&(m=F.multiplyTransformation(e.modelMatrix,c.components.transform,m),g=F.multiplyTransformation(c.axisCorrectionMatrix,d.computedTransform,g));let b=F.multiplyTransformation(m,g,lWe);n.mode!==ne.SCENE3D&&(b=Mt.basisTo2D(n.mapProjection,b,b));let T=[];if(l(x)){let A=x.attributes[0].count,E=x.attributes[0].componentDatatype,v=12,D=d.transformsTypedArray;if(!l(D)){let O=d.instancingTransformsBuffer;l(O)&&n.context.webgl2&&(D=X.createTypedArray(E,A*v),O.getBufferData(D))}if(l(D))for(let O=0;O<A;O++){let R=O*v,M=new F(D[R],D[R+1],D[R+2],D[R+3],D[R+4],D[R+5],D[R+6],D[R+7],D[R+8],D[R+9],D[R+10],D[R+11],0,0,0,1);x.transformInWorldSpace?(F.multiplyTransformation(M,g,M),F.multiplyTransformation(m,M,M)):F.multiplyTransformation(M,b,M),T.push(M)}}T.length===0&&T.push(b);let C=d.runtimePrimitives.length;for(let A=0;A<C;A++){let E=d.runtimePrimitives[A],v=E.primitive;if(l(E.boundingSphere)&&!l(x)){let j=ae.transform(E.boundingSphere,b,fWe),J=$n.raySphere(t,j);if(!l(J))continue}let D=Kt.getAttributeBySemantic(v,At.POSITION),O=D.byteOffset,R=D.byteStride,M=D.count;if(!l(v.indices))continue;let N=v.indices.typedArray;if(!l(N)){let j=v.indices.buffer,J=v.indices.count,q=v.indices.indexDatatype;l(j)&&n.context.webgl2&&(q===Ne.UNSIGNED_BYTE?N=new Uint8Array(J):q===Ne.UNSIGNED_SHORT?N=new Uint16Array(J):q===Ne.UNSIGNED_INT&&(N=new Uint32Array(J)),j.getBufferData(N))}let _=D.typedArray,S=D.componentDatatype,w=D.type,I=D.quantization;l(I)&&(S=D.quantization.componentDatatype,w=D.quantization.type);let L=on.getNumberOfComponents(w),B=X.getSizeInBytes(S),U=!l(_)&&l(R)&&R!==L*B,V=L,G=0;U&&(V=R/B,G=O/B);let k=M*V;if(!l(_)){let j=D.buffer;l(j)&&n.context.webgl2&&(_=X.createTypedArray(S,k),j.getBufferData(_,U?0:O,0,k)),I&&D.normalized&&(_=Mn.dequantize(_,S,w,M))}if(!l(N)||!l(_))return;r=y(r,ee.default),i=y(i,1),o=y(o,0);let W=N.length;for(let j=0;j<W;j+=3){let J=N[j],q=N[j+1],K=N[j+2];for(let Q of T){let de=cj(_,J,G,V,I,Q,i,o,r,oWe),ye=cj(_,q,G,V,I,Q,i,o,r,rWe),ce=cj(_,K,G,V,I,Q,i,o,r,sWe),_e=$n.rayTriangleParametric(t,de,ye,ce,y(e.backFaceCulling,!0));l(_e)&&_e<a&&_e>=0&&(a=_e)}}}}if(a!==Number.MAX_VALUE){if(s=mn.getPoint(t,a,s),n.mode!==ne.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,d=f.ellipsoid,p=f.unproject(s,uWe);d.cartographicToCartesian(p,s)}return s}}function cj(e,t,n,i,o,r,s,a,c,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],l(o))if(o.octEncoded){if(u=Mn.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let d=u.x;u.x=u.z,u.z=u.y,u.y=d}}else u=h.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=h.add(u,o.quantizedVolumeOffset,u);return u=F.multiplyByPoint(r,u,u),s!==1&&Er.getPosition(u,c,s,a,u),u}function co(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,ur.GLTF),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new LO(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=H.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,mc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,H.RED);this._silhouetteColor=H.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,we.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ae,this._initialRadius=void 0,this._heightReference=y(e.heightReference,Ye.NONE),this._heightDirty=this._heightReference!==Ye.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=y(e.enableVerticalExaggeration,!0),this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new Am(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?gs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?th.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Qx,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new c_(e.environmentMapOptions);c_.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,yn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===ur.GLTF&&yt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new Tt(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,Br.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,H.BLACK),this._classificationType=e.classificationType,this._statistics=new uL,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._errorEvent=new me,this._readyEvent=new me,this._texturesReadyEvent=new me,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function lj(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function dWe(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new BO({model:e,propertyTable:s});n.push(a)}return n}function hWe(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=Kt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],u=Kt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function dj(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(co.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){dj(e,this._color)&&this.resetDrawCommands(),this._color=H.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!H.equals(e,this._silhouetteColor)){let t=dj(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=H.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return ele(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===ur.GLTF&&yt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(gs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(th.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(c_.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});co.prototype.getNode=function(e){return this._nodesByName[e]};co.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};co.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};co.prototype.getExtension=function(e){return this._loader.components.extensions[e]};co.prototype.makeStyleDirty=function(){this._styleDirty=!0};co.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var mWe=new F,pWe=new $,_We=new F;co.prototype.update=function(e){let t=!1;try{t=gWe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")lj(this,n);else{let i=Kt.getError("model",this._resource,n);lj(this,i)}}if(yWe(this,e),xWe(this,e),bWe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=Kt.getError("model",this._resource,new re("Failed to load model."));lj(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&dWe(this,i);let o=new lL({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(TWe(this),CWe(this),AWe(this,e),EWe(this),SWe(this,e),vWe(this,e),wWe(this,e),DWe(this,e),IWe(this,e),PWe(this,e),RWe(this,e),this._defaultTexture=e.context.defaultTexture,OWe(this,e),MWe(this,e),LWe(this),NWe(this,e),VWe(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),BWe(this),UWe(this,e),zWe(this),HWe(this,e)}};function gWe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function yWe(e,t){l(e._customShader)&&e._customShader.update(t)}function xWe(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function bWe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function TWe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=hWe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function CWe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function AWe(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&Jce(e)}function Jce(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=sh.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function EWe(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function SWe(e,t){e._silhouetteDirty&&(tle(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function vWe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function wWe(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function DWe(e,t){let n=0;e.isClippingPolygonsEnabled()&&(e._clippingPolygons.owner===e&&(e._clippingPolygons.update(t),e._clippingPolygons.queueCommands(t)),n=e._clippingPolygons.clippingPolygonsState),n!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=n)}function IWe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function PWe(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function RWe(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function OWe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function MWe(e,t){F.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix))}var Fy=new h,uj=new fe;function LWe(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===Ye.NONE){e._clampedModelMatrix=void 0;return}let n=y(t.ellipsoid,ee.default),i=e.modelMatrix;Fy.x=i[12],Fy.y=i[13],Fy.z=i[14];let o=n.cartesianToCartographic(Fy);l(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(i,new F)),e._removeUpdateHeightCallback=t.updateHeight(o,Qce(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=Qce(e,n,o);fe.clone(o,uj),uj.height=r,s(uj)}e._heightDirty=!1,e._updateModelMatrix=!0}function NWe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;ele(e,n),FWe(e,n,t)}function ele(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ae.transform(e._boundingSphere,t,e._boundingSphere)}function FWe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);F.getTranslation(t,Fy),e._sceneMode!==ne.SCENE3D&&zi.computeActualEllipsoidPosition(n,Fy,Fy);let s=e._boundingSphere.radius,a=GWe(Fy,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function BWe(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}var kWe=new $(1,0,0,0,0,1,0,-1,0);function VWe(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),o=t.context,r=pWe,s=mWe;if(s=F.multiply(o.uniformState.view3D,i,s),r=F.getRotation(s,r),r=$.transpose(r,r),e._iblReferenceFrameMatrix=$.multiply(kWe,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=_We;a=F.multiply(o.uniformState.view3D,i,a),a=F.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=F.inverseTranspose(a,e._clippingPlanesMatrix)}}function UWe(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function zWe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=Tt.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=Tt.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=Tt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function HWe(e,t){let n=jWe(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(qWe(e,t),e._sceneGraph.pushDrawCommands(t))}var fj=new ae;function GWe(e,t,n){return fj.center=e,fj.radius=t,n.camera.getPixelSize(fj,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var yz=new h;function Qce(e,t,n){return function(i){dA(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,yz);let o=e._clampedModelMatrix;F.clone(e.modelMatrix,o),o[12]=yz.x,o[13]=yz.y,o[14]=yz.z,e._heightDirty=!0}}var WWe=new h;function jWe(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===ne.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=F.getTranslation(e.modelMatrix,WWe);zi.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function qWe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}co.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};co.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function tle(e){return e.context.stencilBuffer}co.prototype.hasSilhouette=function(e){return tle(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};co.prototype.hasSkipLevelOfDetail=function(e){if(!ur.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};co.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};co.prototype.pick=function(e,t,n,i,o){return dE(this,e,t,n,i,o)};co.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};co.prototype.isDestroyed=function(){return!1};co.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,ue(this)};co.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};co.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};co.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),o=Se.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=Se.createIfNeeded(t);let r=new f_(n),a=l(e.content)?ur.TILE_GLTF:ur.GLTF,c=n.gltfResource,u=hL(r,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),Kt.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let d=new co(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(Tt.clone(p[m]))}return d};co.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new SO(t);try{await n.load();let i=hL(n,ur.TILE_B3DM,e);return new co(i)}catch(i){throw n.destroy(),i}};co.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new dL(t);try{await n.load();let i=hL(n,ur.TILE_PNTS,e);return new co(i)}catch(i){throw n.destroy(),i}};co.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new DO(t);try{await n.load();let i=hL(n,ur.TILE_I3DM,e);return new co(i)}catch(i){throw n.destroy(),i}};co.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new vO(t),i=hL(n,ur.TILE_GEOJSON,e);return new co(i)};var YWe=new H;co.prototype.applyColorAndShow=function(e){let t=H.clone(this._color,YWe),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):H.clone(H.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,dj(t,this._color)&&this.resetDrawCommands()};co.prototype.applyStyle=function(e){let t=this.type===ur.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Jce(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function hL(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var ah=co;function Hr(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Hr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Hr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Hr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Hr.prototype.getExtension=function(e){return this._model.getExtension(e)};Hr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Hr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Hr.prototype.applyDebugSettings=function(e,t){t=e?t:H.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Hr.prototype.applyStyle=function(e){this._model.style=e};Hr.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;l(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),l(s)&&l(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:zl.REPEAT}),this._ready=!0)};Hr.prototype.isDestroyed=function(){return!1};Hr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Hr.fromGltf=async function(e,t,n,i){let o=new Hr(e,t,n),s=mL(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await ah.fromGltfAsync(s);return o._model=c,o};Hr.fromB3dm=async function(e,t,n,i,o){let r=new Hr(e,t,n),a=mL(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await ah.fromB3dm(a);return r._model=u,r};Hr.fromI3dm=async function(e,t,n,i,o){let r=new Hr(e,t,n),a=mL(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await ah.fromI3dm(a);return r._model=c,r};Hr.fromPnts=async function(e,t,n,i,o){let r=new Hr(e,t,n),a=mL(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await ah.fromPnts(a);return r._model=c,r};Hr.fromGeoJson=async function(e,t,n,i){let o=new Hr(e,t,n),s=mL(e,t,o,{geoJson:i,resource:n}),a=await ah.fromGeoJson(s);return o._model=a,o};Hr.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ee.WGS84,n)};function mL(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:we.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return bt(i,o)}var Pu=Hr;function kf(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(kf.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});kf.fromJson=function(e,t,n,i){let o=new kf(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};kf.prototype.hasProperty=function(e,t){return!1};kf.prototype.getFeature=function(e){};kf.prototype.applyDebugSettings=function(e,t){};kf.prototype.applyStyle=function(e){};kf.prototype.update=function(e,t){};kf.prototype.pick=function(e,t,n){};kf.prototype.isDestroyed=function(){return!1};kf.prototype.destroy=function(){return ue(this)};var pL=kf;function xi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=Lt.clone(r)),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._pixelOffset=z.clone(y(e.pixelOffset,z.ZERO)),this._translate=new z(0,0),this._eyeOffset=h.clone(y(e.eyeOffset,h.ZERO)),this._heightReference=y(e.heightReference,Ye.NONE),this._verticalOrigin=y(e.verticalOrigin,Rn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,gi.CENTER),this._scale=y(e.scale,1),this._color=H.clone(y(e.color,H.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=h.clone(y(e.alignedAxis,h.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=Hn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=H.clone(y(e.outlineColor,H.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping(),this._splitDirection=y(e.splitDirection,Br.NONE)}var nle=xi.SHOW_INDEX=0,bz=xi.POSITION_INDEX=1,sle=xi.PIXEL_OFFSET_INDEX=2,XWe=xi.EYE_OFFSET_INDEX=3,KWe=xi.HORIZONTAL_ORIGIN_INDEX=4,ZWe=xi.VERTICAL_ORIGIN_INDEX=5,$We=xi.SCALE_INDEX=6,Tz=xi.IMAGE_INDEX_INDEX=7,ile=xi.COLOR_INDEX=8,QWe=xi.ROTATION_INDEX=9,JWe=xi.ALIGNED_AXIS_INDEX=10,eje=xi.SCALE_BY_DISTANCE_INDEX=11,tje=xi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,nje=xi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,ije=xi.DISTANCE_DISPLAY_CONDITION=14,oje=xi.DISABLE_DEPTH_DISTANCE=15;xi.TEXTURE_COORDINATE_BOUNDS=16;var ole=xi.SDF_INDEX=17,rje=xi.SPLIT_DIRECTION_INDEX=18;xi.NUMBER_OF_PROPERTIES=19;function Bo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(xi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Bo(this,nle))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),Bo(this,bz))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Bo(this,bz))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;z.equals(t,e)||(z.clone(e,t),Bo(this,sle))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),Bo(this,eje))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),Bo(this,tje))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;kt.equals(t,e)||(this._pixelOffsetScaleByDistance=kt.clone(e,t),Bo(this,nje))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Bo(this,XWe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Bo(this,KWe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Bo(this,ZWe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Bo(this,$We))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),Bo(this,ile))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Bo(this,QWe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Bo(this,JWe))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Bo(this,Tz))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Bo(this,Tz))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Bo(this,ile))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Lt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),Bo(this,ije))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Bo(this,oje))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof Se?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Hn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Bo(this,Tz))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition),Bo(this,bz)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Bo(this,nle))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),Bo(this,ole))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Bo(this,ole))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Bo(this,rje))}}});xi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};xi.prototype._updateClamping=function(){xi._updateClamping(this._billboardCollection,this)};var Cz=new fe;xi._updateClamping=function(e,t){let n=e._scene;if(!l(n))return;let i=y(n.ellipsoid,ee.default),o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===Ye.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Ye.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(u){let f=i.cartographicToCartesian(u,t._clampedPosition);dA(t._heightReference)&&(t._mode===ne.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),fe.clone(s,Cz);let c=n.getHeight(s,t._heightReference);l(c)&&(Cz.height=c),a(Cz)};xi.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(c){if(r._imageId!==t||r._image!==n||!je.equals(r._imageSubRegion,i))return;let u=e.textureCoordinates[c];r._imageWidth=e.texture.width*u.width,r._imageHeight=e.texture.height*u.height,r._imageIndex=c,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,Bo(r,Tz);let f=r._billboardCollection._scene;l(f)&&f.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;let a=e.getImageIndex(t);if(l(a)&&!l(i)){s(a);return}o.then(s).catch(function(c){console.error(`Error loading image for billboard: ${c}`),r._imageIndexPromise=void 0})};xi.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};xi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&je.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=je.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};xi.prototype._setTranslate=function(e){let t=this._translate;z.equals(t,e)||(z.clone(e,t),Bo(this,sle))};xi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};xi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Bo(this,bz)};var rle=new oe;xi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(F.multiplyByPoint(i,t,rle),zi.computeActualEllipsoidPosition(n,rle))};var ale=new h;xi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=F.multiplyByPoint(e,t,ale),a=zi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return z.add(a,i,a),a};var xz=new z(0,0);xi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new z),z.clone(this._pixelOffset,xz),z.add(xz,this._translate,xz);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,Cz);o=a.cartographicToCartesian(c,ale),i=F.IDENTITY}return xi._computeScreenSpacePosition(i,o,this._eyeOffset,xz,e,t)};xi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===gi.RIGHT?s-=i:e.horizontalOrigin===gi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Rn.BOTTOM||e.verticalOrigin===Rn.BASELINE?a-=o:e.verticalOrigin===Rn.CENTER&&(a-=o*.5),l(n)||(n=new je),n.x=s,n.y=a,n.width=i,n.height=o,n};xi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&je.equals(this._imageSubRegion,e._imageSubRegion)&&H.equals(this._color,e._color)&&z.equals(this._pixelOffset,e._pixelOffset)&&z.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};xi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var lo=xi;var sje={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},vo=Object.freeze(sje);var aje={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Xs=Object.freeze(aje);function T_(e,t,n,i,o){this.bottomLeft=y(e,z.ZERO),this.topRight=y(t,z.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var cje=new z(16,16);function By(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,cje);this._context=e.context,this._pixelFormat=y(e.pixelFormat,et.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Hn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(By.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Pt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function lje(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),u=o*(a+t.height+r),f=s/c,d=a/u,p=new T_(new z(s+r,r),new z(c,a)),g=new T_(new z,new z(c,a),e._root,p),m=new T_(new z(r,a+r),new z(c,u)),x=new T_(new z,new z(c,u),g,m);for(let C=0;C<e._textureCoordinates.length;C++){let A=e._textureCoordinates[C];l(A)&&(A.x*=f,A.y*=d,A.width*=f,A.height*=d)}let b=new Pt({context:e._context,width:c,height:u,pixelFormat:e._pixelFormat}),T=new Nr({context:n,colorTextures:[e._texture],destroyAttachments:!1});T._bind(),b.copyFromFramebuffer(0,0,0,0,c,u),T._unBind(),T.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=b,e._root=x}else{let s=o*(t.width+2*r),a=o*(t.height+2*r);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Pt({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new T_(new z(r,r),new z(s,a))}}function Az(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,r=i-n.width,s=o-n.height;if(r<0||s<0)return;if(r===0&&s===0)return t;if(r>s){t.childNode1=new T_(new z(t.bottomLeft.x,t.bottomLeft.y),new z(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new T_(new z(a,t.bottomLeft.y),new z(t.topRight.x,t.topRight.y)))}else{t.childNode1=new T_(new z(t.bottomLeft.x,t.bottomLeft.y),new z(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new T_(new z(t.bottomLeft.x,a),new z(t.topRight.x,t.topRight.y)))}return Az(e,t.childNode1,n)}return Az(e,t.childNode1,n)||Az(e,t.childNode2,n)}}function cle(e,t,n){let i=Az(e,e._root,t);if(l(i)){i.imageIndex=n;let o=e._texture.width,r=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/o,u=i.bottomLeft.y/r,f=s/o,d=a/r;e._textureCoordinates[n]=new je(c,u,f,d),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else lje(e,t),cle(e,t,n);e._guid=Hn()}function lle(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return cle(e,t,n),n}By.prototype.getImageIndex=function(e){return this._indexHash[e]};By.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=lle(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};By.prototype.addImage=function(e,t){let n=this._idHash[e];if(l(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof Se)&&(t=Se.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(o){let r=lle(i,o);return i._indexHash[e]=r,r}),this._idHash[e]=n,n};By.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new re(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;let r=i._texture.width,s=i._texture.height,a=i._textureCoordinates[o],c=a.x+t.x/r,u=a.y+t.y/s,f=t.width/r,d=t.height/s,p=i._textureCoordinates.push(new je(c,u,f,d))-1;return i._indexHash[e]=p,i._guid=Hn(),p})};By.prototype.isDestroyed=function(){return!1};By.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var ky=By;var uje=lo.SHOW_INDEX,gL=lo.POSITION_INDEX,ule=lo.PIXEL_OFFSET_INDEX,fle=lo.EYE_OFFSET_INDEX,fje=lo.HORIZONTAL_ORIGIN_INDEX,dje=lo.VERTICAL_ORIGIN_INDEX,hje=lo.SCALE_INDEX,_L=lo.IMAGE_INDEX_INDEX,dle=lo.COLOR_INDEX,mje=lo.ROTATION_INDEX,pje=lo.ALIGNED_AXIS_INDEX,hle=lo.SCALE_BY_DISTANCE_INDEX,mle=lo.TRANSLUCENCY_BY_DISTANCE_INDEX,ple=lo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,_le=lo.DISTANCE_DISPLAY_CONDITION,_je=lo.DISABLE_DEPTH_DISTANCE,gje=lo.TEXTURE_COORDINATE_BOUNDS,gle=lo.SDF_INDEX,yle=lo.SPLIT_DIRECTION_INDEX,xj=lo.NUMBER_OF_PROPERTIES,uo,yje={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},xje={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function zf(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(xj),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,vo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW],this._highlightColor=H.clone(H.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(zf.prototype,{length:{get:function(){return bj(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function xle(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}zf.prototype.add=function(e){let t=new lo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};zf.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};zf.prototype.removeAll=function(){xle(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function bj(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}zf.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};zf.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};zf.prototype.get=function(e){return bj(this),this._billboards[e]};var hj;function bje(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=gt.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function Tje(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=gt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function Cje(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=gt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}zf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<xj;++i){let o=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Aje(e,t,n,i,o,r){let s=[{index:uo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[gL]},{index:uo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[gL]},{index:uo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[ule]},{index:uo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[mle]},{index:uo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[dle]},{index:uo.eyeOffset,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[fle]},{index:uo.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[hle]},{index:uo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[ple]},{index:uo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[_le]},{index:uo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[gje]},{index:uo.splitDirection,componentsPerAttribute:1,componentDatatype:X.FLOAT,usage:n[yle]}];i&&s.push({index:uo.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:Cje(e)}),l(o)&&s.push({index:uo.a_batchId,componentsPerAttribute:1,componentDatatype:X.FLOAT,bufferUsage:Fe.STATIC_DRAW}),r&&s.push({index:uo.sdf,componentsPerAttribute:2,componentDatatype:X.FLOAT,usage:n[gle]});let a=i?t:4*t;return new Mp(e,s,a,i)}var mj=new Gn;function ble(e,t,n,i,o){let r,s=i[uo.positionHighAndScale],a=i[uo.positionLowAndRotation],c=o._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Gn.fromCartesian(c,mj);let u=o.scale,f=o.rotation;f!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);let d=mj.high,p=mj.low;e._instanced?(r=o._index,s(r,d.x,d.y,d.z,u),a(r,p.x,p.y,p.z,f)):(r=o._index*4,s(r+0,d.x,d.y,d.z,u),s(r+1,d.x,d.y,d.z,u),s(r+2,d.x,d.y,d.z,u),s(r+3,d.x,d.y,d.z,u),a(r+0,p.x,p.y,p.z,f),a(r+1,p.x,p.y,p.z,f),a(r+2,p.x,p.y,p.z,f),a(r+3,p.x,p.y,p.z,f))}var Uf=new z,Vf=32768,hE=65536,pj=4096,Sm=256,Eje=128,Sje=32,vje=8,Tle=4,wje=1/256,Cle=0,Ale=2,Ele=3,Sle=1;function vle(e,t,n,i,o){let r,s=i[uo.compressedAttribute0],a=o.pixelOffset,c=a.x,u=a.y,f=o._translate,d=f.x,p=f.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+d),Math.abs(-u+p));let g=o.horizontalOrigin,m=o._verticalOrigin,x=o.show&&o.clusterShow;o.color.alpha===0&&(x=!1),m===Rn.BASELINE&&(m=Rn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&g===gi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&m===Rn.CENTER;let b=0,T=0,C=0,A=0,E=o._imageIndex;if(E!==-1){let U=n[E];b=U.x,T=U.y,C=U.width,A=U.height}let v=b+C,D=T+A,O=Math.floor(P.clamp(c,-Vf,Vf)+Vf)*Eje;O+=(g+1)*Sje,O+=(m+1)*vje,O+=(x?1:0)*Tle;let R=Math.floor(P.clamp(u,-Vf,Vf)+Vf)*Sm,M=Math.floor(P.clamp(d,-Vf,Vf)+Vf)*Sm,N=(P.clamp(p,-Vf,Vf)+Vf)*wje,_=Math.floor(N),S=Math.floor((N-_)*Sm);R+=_,M+=S,Uf.x=b,Uf.y=T;let w=Mn.compressTextureCoordinates(Uf);Uf.x=v;let I=Mn.compressTextureCoordinates(Uf);Uf.y=D;let L=Mn.compressTextureCoordinates(Uf);Uf.x=b;let B=Mn.compressTextureCoordinates(Uf);e._instanced?(r=o._index,s(r,O,R,M,w)):(r=o._index*4,s(r+0,O+Cle,R,M,w),s(r+1,O+Ale,R,M,I),s(r+2,O+Ele,R,M,L),s(r+3,O+Sle,R,M,B))}function wle(e,t,n,i,o){let r,s=i[uo.compressedAttribute1],a=o.alignedAxis;h.equals(a,h.ZERO)||(e._shaderAlignedAxis=!0);let c=0,u=1,f=1,d=1,p=o.translucencyByDistance;l(p)&&(c=p.near,u=p.nearValue,f=p.far,d=p.farValue,(u!==1||d!==1)&&(e._shaderTranslucencyByDistance=!0));let g=0,m=o._imageIndex;m!==-1&&(g=n[m].width);let x=e._textureAtlas.texture.width,b=Math.round(y(o.width,x*g));e._maxSize=Math.max(e._maxSize,b);let T=P.clamp(b,0,hE),C=0;Math.abs(h.magnitudeSquared(a)-1)<P.EPSILON6&&(C=Mn.octEncodeFloat(a)),u=P.clamp(u,0,1),u=u===1?255:u*255|0,T=T*Sm+u,d=P.clamp(d,0,1),d=d===1?255:d*255|0,C=C*Sm+d,e._instanced?(r=o._index,s(r,T,C,c,f)):(r=o._index*4,s(r+0,T,C,c,f),s(r+1,T,C,c,f),s(r+2,T,C,c,f),s(r+3,T,C,c,f))}function gj(e,t,n,i,o){let r,s=i[uo.compressedAttribute2],a=o.color,c=l(e._batchTable)?H.WHITE:o.getPickId(t.context).color,u=o.sizeInMeters?1:0,f=Math.abs(h.magnitudeSquared(o.alignedAxis)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&u===1;let d=0,p=o._imageIndex;p!==-1&&(d=n[p].height);let g=e._textureAtlas.texture.dimensions,m=Math.round(y(o.height,g.y*d));e._maxSize=Math.max(e._maxSize,m);let x=y(o._labelHorizontalOrigin,-2);x+=2;let b=m*Tle+x,T=H.floatToByte(a.red),C=H.floatToByte(a.green),A=H.floatToByte(a.blue),E=T*hE+C*Sm+A;T=H.floatToByte(c.red),C=H.floatToByte(c.green),A=H.floatToByte(c.blue);let v=T*hE+C*Sm+A,D=H.floatToByte(a.alpha)*hE+H.floatToByte(c.alpha)*Sm;D+=u*2+f,e._instanced?(r=o._index,s(r,E,v,D,b)):(r=o._index*4,s(r+0,E,v,D,b),s(r+1,E,v,D,b),s(r+2,E,v,D,b),s(r+3,E,v,D,b))}function yj(e,t,n,i,o){let r,s=i[uo.eyeOffset],a=o.eyeOffset,c=a.z;if(o._heightReference!==Ye.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let u=0,f=0,d=o._imageIndex;if(d!==-1){let g=n[d];u=g.width,f=g.height}Uf.x=u,Uf.y=f;let p=Mn.compressTextureCoordinates(Uf);r=o._index,s(r,a.x,a.y,c,p)}else r=o._index*4,s(r+0,a.x,a.y,c,0),s(r+1,a.x,a.y,c,0),s(r+2,a.x,a.y,c,0),s(r+3,a.x,a.y,c,0)}function Dle(e,t,n,i,o){let r,s=i[uo.scaleByDistance],a=0,c=1,u=1,f=1,d=o.scaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,u,f)):(r=o._index*4,s(r+0,a,c,u,f),s(r+1,a,c,u,f),s(r+2,a,c,u,f),s(r+3,a,c,u,f))}function Ile(e,t,n,i,o){let r,s=i[uo.pixelOffsetScaleByDistance],a=0,c=1,u=1,f=1,d=o.pixelOffsetScaleByDistance;l(d)&&(a=d.near,c=d.nearValue,u=d.far,f=d.farValue,(c!==1||f!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,u,f)):(r=o._index*4,s(r+0,a,c,u,f),s(r+1,a,c,u,f),s(r+2,a,c,u,f),s(r+3,a,c,u,f))}function Ple(e,t,n,i,o){let r,s=i[uo.compressedAttribute3],a=0,c=Number.MAX_VALUE,u=o.distanceDisplayCondition;l(u)&&(a=u.near,c=u.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let f=o.disableDepthTestDistance,d=wf(o.heightReference)&&t.context.depthTexture;l(f)||(f=d?5e3:0),f*=f,(d||f>0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,g;if(l(o._labelDimensions))g=o._labelDimensions.x,p=o._labelDimensions.y;else{let T=0,C=0,A=o._imageIndex;if(A!==-1){let v=n[A];T=v.height,C=v.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*T));let E=e._textureAtlas.texture.width;g=Math.round(y(o.width,E*C))}let m=Math.floor(P.clamp(g,0,pj)),x=Math.floor(P.clamp(p,0,pj)),b=m*pj+x;e._instanced?(r=o._index,s(r,a,c,f,b)):(r=o._index*4,s(r+0,a,c,f,b),s(r+1,a,c,f,b),s(r+2,a,c,f,b),s(r+3,a,c,f,b))}function Rle(e,t,n,i,o){if(wf(o.heightReference)){let m=e._scene,x=t.context,b=t.globeTranslucencyState.translucent,T=l(m.globe)&&m.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!b&&T}let r,s=i[uo.textureCoordinateBoundsOrLabelTranslate];if(Nt.maximumVertexTextureImageUnits>0){let m=0,x=0;l(o._labelTranslate)&&(m=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,m,x,0,0)):(r=o._index*4,s(r+0,m,x,0,0),s(r+1,m,x,0,0),s(r+2,m,x,0,0),s(r+3,m,x,0,0));return}let a=0,c=0,u=0,f=0,d=o._imageIndex;if(d!==-1){let m=n[d];a=m.x,c=m.y,u=m.width,f=m.height}let p=a+u,g=c+f;e._instanced?(r=o._index,s(r,a,c,p,g)):(r=o._index*4,s(r+0,a,c,p,g),s(r+1,a,c,p,g),s(r+2,a,c,p,g),s(r+3,a,c,p,g))}function Dje(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[uo.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function Ole(e,t,n,i,o){if(!e._sdf)return;let r,s=i[uo.sdf],a=o.outlineColor,c=o.outlineWidth,u=H.floatToByte(a.red),f=H.floatToByte(a.green),d=H.floatToByte(a.blue),p=u*hE+f*Sm+d,g=c/Xs.RADIUS,m=H.floatToByte(a.alpha)*hE+H.floatToByte(g)*Sm;e._instanced?(r=o._index,s(r,p,m)):(r=o._index*4,s(r+0,p+Cle,m),s(r+1,p+Ale,m),s(r+2,p+Ele,m),s(r+3,p+Sle,m))}function Mle(e,t,n,i,o){let r=i[uo.splitDirection],s=0,a=o.splitDirection;l(a)&&(s=a);let c;e._instanced?(c=o._index,r(c,s)):(c=o._index*4,r(c+0,s),r(c+1,s),r(c+2,s),r(c+3,s))}function Ije(e,t,n,i,o){ble(e,t,n,i,o),vle(e,t,n,i,o),wle(e,t,n,i,o),gj(e,t,n,i,o),yj(e,t,n,i,o),Dle(e,t,n,i,o),Ile(e,t,n,i,o),Ple(e,t,n,i,o),Rle(e,t,n,i,o),Dje(e,t,n,i,o),Ole(e,t,n,i,o),Mle(e,t,n,i,o)}function _j(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=lo._computeActualPosition(u,f,i,o);l(d)&&(u._setActualPosition(d),r?a.push(d):ae.expand(s,d,s))}r&&ae.fromPoints(a,s)}function Pje(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&_j(e,i,i.length,t,r,!0)):n===ne.MORPHING?_j(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&_j(e,o,e._billboardsToUpdateIndex,t,r,!1)}function Rje(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function Oje(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; -in vec2 v_textureCoordinates; -void main() -{ - out_FragColor = texture(billboard_texture, v_textureCoordinates); -} -`,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=we.OVERLAY,i}var Mje=[];zf.prototype.update=function(e){if(bj(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,uo=this._instanced?xje:yje,hj=this._instanced?Tje:bje;let o=this._textureAtlas;if(!l(o)){o=this._textureAtlas=new ky({context:i});for(let R=0;R<n;++R)t[R]._loadImage()}let r=o.textureCoordinates;if(r.length===0)return;Pje(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R<xj;++R)c[R]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Aje(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let R=0;R<n;++R){let M=this._billboards[R];M._dirty=!1,Ije(this,e,r,d,M)}this._vaf.commit(hj(i))}this._billboardsToUpdateIndex=0}else if(a>0){let R=Mje;R.length=0,(c[gL]||c[mje]||c[hje])&&R.push(ble),(c[_L]||c[ule]||c[fje]||c[dje]||c[uje])&&(R.push(vle),this._instanced&&R.push(yj)),(c[_L]||c[pje]||c[mle])&&(R.push(wle),R.push(gj)),(c[_L]||c[dle])&&R.push(gj),c[fle]&&R.push(yj),c[hle]&&R.push(Dle),c[ple]&&R.push(Ile),(c[_le]||c[_je]||c[_L]||c[gL])&&R.push(Ple),(c[_L]||c[gL])&&R.push(Rle),c[gle]&&R.push(Ole),c[yle]&&R.push(Mle);let M=R.length;if(d=this._vaf.writers,a/n>.1){for(let N=0;N<a;++N){let _=s[N];_._dirty=!1;for(let S=0;S<M;++S)R[S](this,e,r,d,_)}this._vaf.commit(hj(i))}else{for(let N=0;N<a;++N){let _=s[N];_._dirty=!1;for(let S=0;S<M;++S)R[S](this,e,r,d,_);this._instanced?this._vaf.subCommit(_._index,1):this._vaf.subCommit(_._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,x=F.IDENTITY;e.mode===ne.SCENE3D?(x=this.modelMatrix,m=ae.clone(this._baseVolumeWC,this._boundingVolume)):m=ae.clone(this._baseVolume2D,this._boundingVolume),Rje(this,e,m);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===vo.OPAQUE||this._blendOption===vo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===vo.TRANSLUCENT;this._blendOption===vo.TRANSLUCENT||this._blendOption===vo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:R?te.LEQUAL:te.LESS},depthMask:R,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let T,C,A,E,v,D=Nt.maximumVertexTextureImageUnits>0;if(b||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){T=xP,C=yP,v=[],l(this._batchTable)&&(v.push("VECTOR_TILE"),T=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(T),C=this._batchTable.getFragmentShaderCallback(!1,void 0)(C)),A=new Ue({defines:v,sources:[T]}),this._instanced&&A.defines.push("INSTANCED"),this._shaderRotation&&A.defines.push("ROTATION"),this._shaderAlignedAxis&&A.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&A.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&A.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&A.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&A.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&A.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(D?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-Xs.CUTOFF;this._sdf&&A.defines.push("SDF");let M=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===vo.OPAQUE_AND_TRANSLUCENT&&(E=new Ue({defines:["OPAQUE",M],sources:[C]}),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${R}`)),this._sp=Qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:uo}),E=new Ue({defines:["TRANSLUCENT",M],sources:[C]}),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:uo})),this._blendOption===vo.OPAQUE&&(E=new Ue({defines:[M],sources:[C]}),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${R}`)),this._sp=Qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:uo})),this._blendOption===vo.TRANSLUCENT&&(E=new Ue({defines:[M],sources:[C]}),this._shaderClampToGround&&(D?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:uo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let O=e.commandList;if(p.render||p.pick){let R=this._colorCommands,M=this._blendOption===vo.OPAQUE,N=this._blendOption===vo.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,S=_.length,w=this._uniforms,I;l(this._batchTable)?(w=this._batchTable.getUniformMapCallback()(w),I=this._batchTable.getPickId()):I="v_pickColor",R.length=S;let L=N?S*2:S;for(let B=0;B<L;++B){let U=R[B];l(U)||(U=R[B]=new Ze);let V=M||N&&B%2===0;U.pass=V||!N?we.OPAQUE:we.TRANSLUCENT,U.owner=this;let G=N?Math.floor(B/2):B;U.boundingVolume=m,U.modelMatrix=x,U.count=_[G].indicesCount,U.shaderProgram=V?this._sp:this._spTranslucent,U.uniformMap=w,U.vertexArray=_[G].va,U.renderState=V?this._rsOpaque:this._rsTranslucent,U.debugShowBoundingVolume=this.debugShowBoundingVolume,U.pickId=I,this._instanced&&(U.count=6,U.instanceCount=n),O.push(U)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=Oje(this,e.context)),O.push(this.debugCommand))}};zf.prototype.isDestroyed=function(){return!1};zf.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),xle(this._billboards),ue(this)};var Ru=zf;function Lje(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var Rb=Lje;function ha(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),mE(this)}var Nje=new fe;Object.defineProperties(ha.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=H.clone(e,this._color),mE(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,mE(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=H.clone(e,this._pointOutlineColor),mE(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,mE(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,Nje);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=H.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&mE(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ha.defaultColor=H.WHITE;ha.defaultPointOutlineColor=H.BLACK;ha.defaultPointOutlineWidth=0;ha.defaultPointSize=8;function mE(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,ha.defaultColor),i=y(e._pointOutlineColor,ha.defaultPointOutlineColor),o=y(e._pointOutlineWidth,ha.defaultPointOutlineWidth),r=y(e._pointSize,ha.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(H.equals(n,s)&&H.equals(i,a)&&o===c&&r===u)return;e._billboardColor=H.clone(n,e._billboardColor),e._billboardOutlineColor=H.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,r,p,o]);t.setImage(g,Rb(f,d,p,o,r))}ha.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ha.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ha.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ha.prototype.getPropertyInherited=function(e){return Ws.getPropertyInherited(this._content,this._batchId,e)};ha.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ha.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ha.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ha.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var C_=ha;function Fje(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=r.width+u|0,d=3*a,p=d/2;c.width=f,c.height=d;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),o&&(g.fillStyle="black",g.fillText(t,u/2,p));let m=g.getImageData(0,0,f,d).data,x=m.length,b=f*4,T,C,A,E;for(T=0;T<x;++T)if(m[T]!==255){A=T/b|0;break}for(T=x-1;T>=0;--T)if(m[T]!==255){E=T/b|0;break}let v=-1;for(T=0;T<f&&v===-1;++T)for(C=0;C<d;++C){let D=T*4+C*b;if(m[D]!==255||m[D+1]!==255||m[D+2]!==255||m[D+3]!==255){v=T;break}}return{width:r.width,height:E-A,ascent:p-A,descent:E-p,minx:v-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var Ob;function Bje(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),o=y(t.fill,!0),r=y(t.strokeWidth,1),s=y(t.backgroundColor,H.TRANSPARENT),a=y(t.padding,0),c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(Ob)||(l(f.imageSmoothingEnabled)?Ob="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?Ob="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?Ob="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(Ob="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[Ob]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=Fje(f,e,n,i,o);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=-d.minx,g=Math.ceil(d.width)+p+c,m=d.height+c,x=m-d.ascent+a,b=m-x+c;if(u.width=g,u.height=m,f.font=n,f.lineJoin="round",f.lineWidth=r,f[Ob]=!1,s!==H.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=y(t.strokeColor,H.BLACK);f.strokeStyle=T.toCssColorString(),f.strokeText(e,p+a,b)}if(o){let T=y(t.fillColor,H.WHITE);f.fillStyle=T.toCssColorString(),f.fillText(e,p+a,b)}return u}var Mb=Bje;var Wle=Ko(Ble(),1);var Vje={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},jo=Object.freeze(Vje);var kle={},Vle=0,Uje=256,zje=new H(.165,.165,.165,.8),Hje=new z(7,5),ys=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Lb(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function xL(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function bL(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function zle(e){let t=kle[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(bL(n,"line-height"));isNaN(i)&&(i=void 0),t={family:bL(n,"font-family"),size:bL(n,"font-size").replace("px",""),style:bL(n,"font-style"),weight:bL(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Vle<Uje&&(kle[e._font]=t,Vle++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function ch(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=Lt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=H.clone(y(e.fillColor,H.WHITE)),this._outlineColor=H.clone(y(e.outlineColor,H.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=H.clone(y(e.backgroundColor,zje)),this._backgroundPadding=z.clone(y(e.backgroundPadding,Hje)),this._style=y(e.style,jo.FILL),this._verticalOrigin=y(e.verticalOrigin,Rn.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,gi.LEFT),this._pixelOffset=z.clone(y(e.pixelOffset,z.ZERO)),this._eyeOffset=h.clone(y(e.eyeOffset,h.ZERO)),this._position=h.clone(y(e.position,h.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=y(e.heightReference,Ye.NONE),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,zle(this),this._updateClamping()}Object.defineProperties(ch.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),xL(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=ch.filterUnsupportedCharacters(e);this._renderedText=ch.enableRightToLeftDetection?Xje(t):t,Lb(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,Lb(this),zle(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;H.equals(t,e)||(H.clone(e,t),Lb(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),Lb(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Lb(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,Lb(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!H.equals(t,e)){H.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;z.equals(t,e)||(z.clone(e,t),xL(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,Lb(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!z.equals(t,e)){z.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!kt.equals(t,e)){this._translucencyByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!kt.equals(t,e)){this._pixelOffsetScaleByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!kt.equals(t,e)){this._scaleByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,xL(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),xL(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),xL(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Lt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});ch.prototype._updateClamping=function(){lo._updateClamping(this._labelCollection,this)};ch.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new z);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return lo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};ch.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===Rn.BOTTOM||e.verticalOrigin===Rn.BASELINE?o-=s:e.verticalOrigin===Rn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],x=m.billboard;if(!l(x))continue;let b=t.x+x._translate.x,T=t.y-x._translate.y,C=m.dimensions.width*a,A=m.dimensions.height*a;e.verticalOrigin===Rn.BOTTOM||e.verticalOrigin===Rn.BASELINE?T-=A:e.verticalOrigin===Rn.CENTER&&(T-=A*.5),e._verticalOrigin===Rn.TOP?T+=Xs.PADDING*a:(e._verticalOrigin===Rn.BOTTOM||e._verticalOrigin===Rn.BASELINE)&&(T-=Xs.PADDING*a),i=Math.min(i,b),o=Math.min(o,T),u=Math.max(u,b+C),f=Math.max(f,T+A)}r=u-i,s=f-o}return l(n)||(n=new je),n.x=i,n.y=o,n.width=r,n.height=s,n};ch.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};ch.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&H.equals(this._fillColor,e._fillColor)&&H.equals(this._outlineColor,e._outlineColor)&&H.equals(this._backgroundColor,e._backgroundColor)&&z.equals(this._backgroundPadding,e._backgroundPadding)&&z.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};ch.prototype.isDestroyed=function(){return!1};ch.enableRightToLeftDetection=!1;function Gje(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ys.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=ys.RTL:n.test(f)?a=ys.LTR:i.test(f)?a=ys.BRACKETS:a=ys.WEAK,u===0&&(s=a),s===a&&a!==ys.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function Wje(e){return e.split("").reverse().join("")}function TL(e,t,n){return e.slice(0,t)+n+e.slice(t)}function jje(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var qje="\u05D0-\u05EA",Yje="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Ule=new RegExp(`[${qje}${Yje}]`);function Xje(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Ule.test(o.charAt(0)),s=Gje(o,Ule),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===ys.BRACKETS?jje(f.Word):Wje(f.Word);r?f.Type===ys.RTL?(c=d+c,a=0):f.Type===ys.LTR?(c=TL(c,a,f.Word),a+=f.Word.length):(f.Type===ys.WEAK||f.Type===ys.BRACKETS)&&(f.Type===ys.WEAK&&s[u-1].Type===ys.BRACKETS?c=d+c:s[u-1].Type===ys.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===ys.RTL?(c=d+c,a=0):(c=TL(c,a,f.Word),a+=f.Word.length):c=TL(c,0,d)):f.Type===ys.RTL?c=TL(c,a,d):f.Type===ys.LTR?(c+=f.Word,a=c.length):(f.Type===ys.WEAK||f.Type===ys.BRACKETS)&&(u>0&&s[u-1].Type===ys.RTL?s.length>u+1?s[u+1].Type===ys.RTL?c=TL(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` -`)}return n}var Vy=ch;var jle=Ko(Hle(),1);function Zje(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function $je(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var Qje=1.2,qle="ID_WHITE_PIXEL",Tj=new z(4,4),Jje=new je(1,1,1,1);function e7e(e){let t=document.createElement("canvas");t.width=Tj.x,t.height=Tj.y;let n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(qle,t)}var Hf={};function t7e(e,t,n,i,o,r,s){return Hf.font=t,Hf.fillColor=n,Hf.strokeColor=i,Hf.strokeWidth=o,Hf.padding=Xs.PADDING,s===Rn.CENTER?Hf.textBaseline="middle":s===Rn.TOP?Hf.textBaseline="top":Hf.textBaseline="bottom",Hf.fill=r===jo.FILL||r===jo.FILL_AND_OUTLINE,Hf.stroke=r===jo.OUTLINE||r===jo.FILL_AND_OUTLINE,Hf.backgroundColor=H.BLACK,Mb(e,Hf)}function Cj(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function n7e(e,t,n,i){i.index=e.addImageSync(t,n)}var i7e=new jle.default;function o7e(e,t){let n=t._renderedText,i=i7e.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length,a,c,u;if(t._relativeSize=t._fontSize/Xs.FONT_SIZE,o<s)for(c=o;c<s;++c)Cj(e,r[c]);r.length=o;let f=t.show&&t._showBackground&&n.split(` -`).join("").length>0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(l(d)||(d=p.add({collection:e,image:qle,imageSubRegion:Jje}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=gi.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t.totalScale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance,d.clusterShow=t.clusterShow):l(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);let g=e._glyphTextureCache;for(u=0;u<o;++u){let m=i[u],x=t._verticalOrigin,b=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+x]),T=g[b];if(!l(T)){let C=`${t._fontStyle} ${t._fontWeight} ${Xs.FONT_SIZE}px ${t._fontFamily}`,A=t7e(m,C,H.WHITE,H.WHITE,0,jo.FILL,x);if(T=new $je(e,-1,A.dimensions),g[b]=T,A.width>0&&A.height>0){let E=(0,Wle.default)(A,{cutoff:Xs.CUTOFF,radius:Xs.RADIUS}),v=A.getContext("2d"),D=A.width,O=A.height,R=v.getImageData(0,0,D,O);for(let M=0;M<D;M++)for(let N=0;N<O;N++){let _=N*D+M,S=E[_]*255,w=_*4;R.data[w+0]=S,R.data[w+1]=S,R.data[w+2]=S,R.data[w+3]=S}v.putImageData(R,0,0),m!==" "&&n7e(e._textureAtlas,b,A,T)}}if(a=r[u],l(a)?T.index===-1?Cj(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new Zje,r[u]=a),a.textureInfo=T,a.dimensions=T.dimensions,T.index!==-1){let C=a.billboard,A=e._spareBillboards;l(C)||(A.length>0?C=A.pop():(C=e._billboardCollection.add({collection:e}),C._labelDimensions=new z,C._labelTranslate=new z),a.billboard=C),C.show=t._show,C.position=t._position,C.eyeOffset=t._eyeOffset,C.pixelOffset=t._pixelOffset,C.horizontalOrigin=gi.LEFT,C.verticalOrigin=t._verticalOrigin,C.heightReference=t._heightReference,C.scale=t.totalScale,C.pickPrimitive=t,C.id=t._id,C.image=b,C.translucencyByDistance=t._translucencyByDistance,C.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,C.scaleByDistance=t._scaleByDistance,C.distanceDisplayCondition=t._distanceDisplayCondition,C.disableDepthTestDistance=t._disableDepthTestDistance,C._batchIndex=t._batchIndex,C.outlineColor=t.outlineColor,t.style===jo.FILL_AND_OUTLINE?(C.color=t._fillColor,C.outlineWidth=t.outlineWidth):t.style===jo.FILL?(C.color=t._fillColor,C.outlineWidth=0):t.style===jo.OUTLINE&&(C.color=H.TRANSPARENT,C.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function Gle(e,t,n){return t===gi.CENTER?-e/2:t===gi.RIGHT?-(e+n.x):n.x}var fr=new z,r7e=new z;function s7e(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,f=1,d,p=t.length,g=e._backgroundBillboard,m=z.clone(l(g)?e._backgroundPadding:z.ZERO,r7e);for(m.x/=e._relativeSize,m.y/=e._relativeSize,d=0;d<p;++d)n.charAt(d)===` -`?(a.push(r),++f,r=0):(i=t[d],o=i.dimensions,u=Math.max(u,o.height-o.descent),c=Math.max(c,o.descent),r+=o.width-o.minx,d<p-1&&(r+=t[d+1].dimensions.minx),s=Math.max(s,r));a.push(r);let x=u+c,b=e.totalScale,T=e._horizontalOrigin,C=e._verticalOrigin,A=0,E=a[A],v=Gle(E,T,m),D=(l(e._lineHeight)?e._lineHeight:Qje*e._fontSize)/e._relativeSize,O=D*(f-1),R=s,M=x+O;l(g)&&(R+=m.x*2,M+=m.y*2,g._labelHorizontalOrigin=T),fr.x=v*b,fr.y=0;let N=!0,_=0;for(d=0;d<p;++d)if(n.charAt(d)===` -`)++A,_+=D,E=a[A],v=Gle(E,T,m),fr.x=v*b,N=!0;else if(i=t[d],o=i.dimensions,C===Rn.TOP?(fr.y=o.height-u-m.y,fr.y+=Xs.PADDING):C===Rn.CENTER?fr.y=(O+o.height-u)/2:C===Rn.BASELINE?(fr.y=O,fr.y-=Xs.PADDING):(fr.y=O+c+m.y,fr.y-=Xs.PADDING),fr.y=(fr.y-o.descent-_)*b,N&&(fr.x-=Xs.PADDING*b,N=!1),l(i.billboard)&&(i.billboard._setTranslate(fr),i.billboard._labelDimensions.x=R,i.billboard._labelDimensions.y=M,i.billboard._labelHorizontalOrigin=T),d<p-1){let S=t[d+1];fr.x+=(o.width-o.minx+S.dimensions.minx)*b}if(l(g)&&n.split(` -`).join("").length>0&&(T===gi.CENTER?v=-s/2-m.x:T===gi.RIGHT?v=-(s+m.x*2):v=0,fr.x=v*b,C===Rn.TOP?fr.y=x-u-c:C===Rn.CENTER?fr.y=(x-u)/2-c:C===Rn.BASELINE?fr.y=-m.y-c:fr.y=0,fr.y=fr.y*b,g.width=R,g.height=M,g._setTranslate(fr),g._labelTranslate=z.clone(fr,g._labelTranslate)),wf(e.heightReference))for(d=0;d<p;++d){i=t[d];let S=i.billboard;l(S)&&(S._labelTranslate=z.clone(fr,S._labelTranslate))}}function Yle(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)Cj(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function vm(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new Ru({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new Ru({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=H.clone(H.WHITE),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,vo.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(vm.prototype,{length:{get:function(){return this._labels.length}}});vm.prototype.add=function(e){let t=new Vy(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};vm.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Yle(this,e),!0}return!1};vm.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Yle(this,e[t]);e.length=0};vm.prototype.contains=function(e){return l(e)&&e._labelCollection===this};vm.prototype.get=function(e){return this._labels[e]};vm.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;l(this._textureAtlas)||(this._textureAtlas=new ky({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new ky({context:i,initialSize:Tj}),n.textureAtlas=this._backgroundTextureAtlas,e7e(this._backgroundTextureAtlas));let o=this._labelsToUpdate.length;for(let s=0;s<o;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(o7e(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(s7e(a),a._repositionAllGlyphs=!1);let u=a._glyphs.length-c;this._totalGlyphCount+=u}let r=n.length>0?vo.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};vm.prototype.isDestroyed=function(){return!1};vm.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var wm=vm;var ol={};ol.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};ol.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var a7e=new fe;ol.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,a7e).height}return i};var c7e=new F,l7e=new h,Xle=new h,u7e=new an(h.UNIT_X,0),Kle=new h,f7e=new an(h.UNIT_X,0),d7e=new h,h7e=new h,Ej=[];function $le(e,t,n){let i=Ej;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var vz=new fe,Sz=new fe,Uy=new h,Sj=new h,m7e=new h,Aj=new kp,CL=new Oa;function p7e(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,Sj),u=i.scaleToGeodeticSurface(t,m7e),f=ol.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,vz),p=i.cartesianToCartographic(u,Sz),g=$le(f,o,r);Aj.setEndPoints(d,p);let m=Aj.surfaceDistance/f,x=a;d.height=o;let b=i.cartographicToCartesian(d,Uy);h.pack(b,s,x),x+=3;for(let T=1;T<f;T++){let C=Aj.interpolateUsingSurfaceDistance(T*m,Sz);C.height=g[T],b=i.cartographicToCartesian(C,Uy),h.pack(b,s,x),x+=3}return x}function _7e(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,vz),u=i.cartesianToCartographic(t,Sz),f=ol.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=$le(f,o,r);CL.ellipsoid.equals(i)||(CL=new Oa(void 0,void 0,i)),CL.setEndPoints(c,u);let p=CL.surfaceDistance/f,g=a;c.height=o;let m=i.cartographicToCartesian(c,Uy);h.pack(m,s,g),g+=3;for(let x=1;x<f;x++){let b=CL.interpolateUsingSurfaceDistance(x*p,Sz);b.height=d[x],m=i.cartographicToCartesian(b,Uy),h.pack(m,s,g),g+=3}return g}ol.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,F.IDENTITY);let o=F.inverseTransformation(t,c7e),r=F.multiplyByPoint(o,h.ZERO,l7e),s=h.normalize(F.multiplyByPointAsVector(o,h.UNIT_Y,Xle),Xle),a=an.fromPointNormal(r,s,u7e),c=h.normalize(F.multiplyByPointAsVector(o,h.UNIT_X,Kle),Kle),u=an.fromPointNormal(r,c,f7e),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(an.getPointDistance(u,d)<0||an.getPointDistance(u,m)<0){let x=$n.lineSegmentPlane(d,m,a,d7e);if(l(x)){let b=h.multiplyByScalar(s,5e-9,h7e);an.getPointDistance(a,d)<0&&h.negate(b,b),n.push(h.add(x,b,new h)),i.push(f+1),h.negate(b,b),n.push(h.add(x,b,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};ol.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ee.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],Sj);if(o=r?o[0]:o,o!==0){let b=i.geodeticSurfaceNormal(x,Uy);h.multiplyByScalar(b,o,b),h.add(x,b,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=y(e.granularity,P.RADIANS_PER_DEGREE);s=P.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=ol.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let x=t[c],b=t[c+1],T=r?o[c]:o,C=r?o[c+1]:o;d=p7e(x,b,s,i,T,C,f,d)}Ej.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,vz);g.height=r?o[n-1]:o;let m=i.cartographicToCartesian(g,Uy);return h.pack(m,f,u-3),f};var Zle=new fe,g7e=new fe;ol.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ee.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let T=i.scaleToGeodeticSurface(t[0],Sj);if(o=r?o[0]:o,o!==0){let C=i.geodeticSurfaceNormal(T,Uy);h.multiplyByScalar(C,o,C),h.add(T,C,T)}return[T.x,T.y,T.z]}let s=y(e.granularity,P.RADIANS_PER_DEGREE),a=0,c,u=i.cartesianToCartographic(t[0],Zle),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],g7e),a+=ol.numberOfPointsRhumbLine(u,f,s),u=fe.clone(f,Zle);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let T=t[c],C=t[c+1],A=r?o[c]:o,E=r?o[c+1]:o;g=_7e(T,C,s,i,A,E,p,g)}Ej.length=0;let m=t[n-1],x=i.cartesianToCartographic(m,vz);x.height=r?o[n-1]:o;let b=i.cartographicToCartesian(x,Uy);return h.pack(b,p,d-3),p};ol.generateCartesianArc=function(e){let t=ol.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};ol.generateCartesianRhumbArc=function(e){let t=ol.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};var Oi=ol;function Ou(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Yi.fromType(Yi.ColorType,{color:new H(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Co(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Oi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Jle),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var Qle=Ou.POSITION_INDEX=0,y7e=Ou.SHOW_INDEX=1,x7e=Ou.WIDTH_INDEX=2,b7e=Ou.MATERIAL_INDEX=3,AL=Ou.POSITION_SIZE_INDEX=4,T7e=Ou.DISTANCE_DISPLAY_CONDITION=5,Jle=Ou.NUMBER_OF_PROPERTIES=6;function A_(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Ou.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,A_(this,y7e))}},positions:{get:function(){return this._positions},set:function(e){let t=Co(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&A_(this,AL),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),A_(this,Qle),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,A_(this,b7e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,A_(this,x7e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,A_(this,AL)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Lt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),A_(this,T7e))}}});Ou.prototype.update=function(){let e=F.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Qle]>0||this._propertiesChanged[AL]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=Oi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)A_(this,AL);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){A_(this,AL);break}}};Ou.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Ou.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Jle-1;++t)e[t]=0};Ou.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Gf=Ou;var C7e=Gf.SHOW_INDEX,A7e=Gf.WIDTH_INDEX,wj=Gf.POSITION_INDEX,E7e=Gf.MATERIAL_INDEX,eue=Gf.POSITION_SIZE_INDEX,S7e=Gf.DISTANCE_DISPLAY_CONDITION,aue=Gf.NUMBER_OF_PROPERTIES,Wl={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function lh(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(aue),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Fe.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=H.clone(H.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(lh.prototype,{length:{get:function(){return Dj(this),this._polylines.length}}});lh.prototype.add=function(e){let t=new Gf(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};lh.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};lh.prototype.removeAll=function(){Ij(this),due(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};lh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};lh.prototype.get=function(e){return Dj(this),this._polylines[e]};function v7e(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:X.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:X.FLOAT,componentsPerAttribute:2}];e._batchTable=new Rx(t,n,e._polylines.length)}var cue=new Gn,lue=new oe,uue=new z;lh.prototype.update=function(e){if(Dj(this),this._polylines.length===0||!this.show)return;O7e(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Nt.maximumVertexTextureImageUnits===0)throw new re("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");v7e(this,t),this._createBatchTable=!1}if(this._createVertexArray||D7e(this))iue(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ne.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[eue]||o[E7e])iue(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],o=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[wj]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((o[C7e]||o[A7e])&&this._batchTable.setBatchedAttribute(i._index,0,new z(i._width,i._show)),this._batchTable.attributes.length>2){if(o[wj]||o[eue]){let m=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=Gn.fromCartesian(m.center,cue),b=oe.fromElements(x.low.x,x.low.y,x.low.z,m.radius,lue);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[S7e]){let m=uue;m.x=0,m.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(m.x=x.near,m.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<aue;++c)o[c]=0;let r=F.IDENTITY;e.mode===ne.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ve.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ve.fromCache({blending:un.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;w7e(this,e,c,r)}};var EL=new ae,tue=new ae;function w7e(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let x=u[m],b=x.buckets,T=b.length;for(let C=0;C<T;++C){let A=b[C],E=A.offset,v=A.bucket.shaderProgram,D=A.bucket.polylines,O=D.length,R,M,N=0,_,S;for(let w=0;w<O;++w){let I=D[w],L=P7e(I._material);if(L!==R){if(l(R)&&N>0){let G=M.isTranslucent();a>=s?(_=new Ze({owner:e}),n.push(_)):_=n[a],++a,S=bt(p(M._uniforms),e._uniformMap),_.boundingVolume=ae.clone(EL,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=x.va,_.renderState=G?e._translucentRS:e._opaqueRS,_.pass=G?we.TRANSLUCENT:we.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=S,_.count=N,_.offset=E,E+=N,N=0,c=!0,r.push(_)}M=I._material,M.update(o),R=L}let B=I._locatorBuckets,U=B.length;for(let G=0;G<U;++G){let k=B[G];k.locator===A&&(N+=k.count)}let V;t.mode===ne.SCENE3D?V=I._boundingVolumeWC:t.mode===ne.COLUMBUS_VIEW?V=I._boundingVolume2D:t.mode===ne.SCENE2D?l(I._boundingVolume2D)&&(V=ae.clone(I._boundingVolume2D,tue),V.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(V=ae.union(I._boundingVolumeWC,I._boundingVolume2D,tue)),c?(c=!1,ae.clone(V,EL)):ae.union(V,EL,EL)}l(R)&&N>0&&(a>=s?(_=new Ze({owner:e}),n.push(_)):_=n[a],++a,S=bt(p(M._uniforms),e._uniformMap),_.boundingVolume=ae.clone(EL,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=x.va,_.renderState=M.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=M.isTranslucent()?we.TRANSLUCENT:we.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=S,_.count=N,_.offset=E,c=!0,r.push(_)),R=void 0}}n.length=a}lh.prototype.isDestroyed=function(){return!1};lh.prototype.destroy=function(){return fue(this),Ij(this),due(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function D7e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[wj]?(i.bufferUsage!==Fe.STREAM_DRAW&&(t=!0,i.bufferUsage=Fe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Fe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Fe.STATIC_DRAW):i.frameCount--),t}var nue=[0,0,0];function iue(e,t,n){e._createVertexArray=!1,Ij(e),fue(e),R7e(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,r,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,x=new Float32Array(6*f*3),b=new Float32Array(f*4),T,C=0,A=0,E=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(x,b,C,A,E,r,t,n),m===ne.MORPHING&&(l(T)||(T=new Float32Array(6*f*3)),g.writeForMorph(T,C));let S=g.lengthOfPositions;C+=6*S*3,A+=S*4,E+=S*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,D=Fe.STATIC_DRAW;e._positionBuffer=gt.createVertexBuffer({context:t,typedArray:x,usage:v});let O;l(T)&&(O=gt.createVertexBuffer({context:t,typedArray:T,usage:v})),e._texCoordExpandAndBatchIndexBuffer=gt.createVertexBuffer({context:t,typedArray:b,usage:D});let R=3*Float32Array.BYTES_PER_ELEMENT,M=4*Float32Array.BYTES_PER_ELEMENT,N=0,_=i.length;for(let S=0;S<_;++S)if(o=i[S],o.length>0){let w=new Uint16Array(o),I=gt.createIndexBuffer({context:t,typedArray:w,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});N+=a[S];let L=6*(S*(R*P.SIXTY_FOUR_KILOBYTES)-N*R),B=R+L,U=R+B,V=R+U,G=R+V,k=R+G,W=S*(M*P.SIXTY_FOUR_KILOBYTES)-N*M,j=[{index:Wl.position3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:L,strideInBytes:6*R},{index:Wl.position3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Wl.position2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:L,strideInBytes:6*R},{index:Wl.position2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Wl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:Wl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Wl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:Wl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Wl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:Wl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Wl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:Wl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Wl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:X.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:W}],J,q,K,Q;m===ne.SCENE3D?(q=e._positionBuffer,J="vertexBuffer",K=nue,Q="value"):m===ne.SCENE2D||m===ne.COLUMBUS_VIEW?(q=nue,J="value",K=e._positionBuffer,Q="vertexBuffer"):(q=O,J="vertexBuffer",K=e._positionBuffer,Q="vertexBuffer"),j[0][J]=q,j[1][J]=q,j[2][Q]=K,j[3][Q]=K,j[4][J]=q,j[5][J]=q,j[6][Q]=K,j[7][Q]=K,j[8][J]=q,j[9][J]=q,j[10][Q]=K,j[11][Q]=K;let de=new ei({context:t,attributes:j,indexBuffer:I});e._vertexArrays.push({va:de,buckets:u[S]})}}}function I7e(e,t){return t instanceof Pt?t.id:t}var wz=[];function P7e(e){let t=Yi._uniformList[e.type],n=t.length;wz.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];wz[i]=r,wz[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(wz,I7e)}`}function R7e(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new Dm(c,t,n)),u.addPolyline(a)}}}function O7e(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function Dj(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function Ij(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function fue(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}lh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function due(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function vj(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Dm(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Dm.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Dm.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),Ht.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Ue({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,vx]}),r=t.getVertexShaderCallback()(HP),s=new Ue({defines:i,sources:[_u,r]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Wl})};function hue(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(an.ORIGIN_ZX_PLANE)===jt.INTERSECTING}Dm.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ne.SCENE3D||!hue(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var ws=new h,Wf=new h,jf=new h,Dz=new h,M7e=new oe,L7e=new z;Dm.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,x=g.show&&m>0,b=g._index,T=this.getSegments(g,a),C=T.positions,A=T.lengths,E=C.length,v=g.getPickId(s).color,D=0,O=0,R;for(let U=0;U<E;++U){U===0?g._loop?R=C[E-2]:(R=Dz,h.subtract(C[0],C[1],R),h.add(C[0],R,R)):R=C[U-1],h.clone(R,Wf),h.clone(C[U],ws),U===E-1?g._loop?R=C[1]:(R=Dz,h.subtract(C[E-1],C[E-2],R),h.add(C[E-1],R,R)):R=C[U+1],h.clone(R,jf);let V=A[D];U===O+V&&(O+=V,++D);let G=U-O===0,k=U===O+A[D]-1;c===ne.SCENE2D&&(Wf.z=0,ws.z=0,jf.z=0),(c===ne.SCENE2D||c===ne.MORPHING)&&(G||k)&&u-Math.abs(ws.x)<1&&((ws.x<0&&Wf.x>0||ws.x>0&&Wf.x<0)&&h.clone(ws,Wf),(ws.x<0&&jf.x>0||ws.x>0&&jf.x<0)&&h.clone(ws,jf));let W=G?2:0,j=k?2:4;for(let J=W;J<j;++J){Gn.writeElements(ws,e,n),Gn.writeElements(Wf,e,n+6),Gn.writeElements(jf,e,n+12);let q=J-2<0?-1:1;t[o]=U/(E-1),t[o+1]=2*(J%2)-1,t[o+2]=q,t[o+3]=b,n+=6*3,o+=4}}let M=M7e;M.x=H.floatToByte(v.red),M.y=H.floatToByte(v.green),M.z=H.floatToByte(v.blue),M.w=H.floatToByte(v.alpha);let N=L7e;N.x=m,N.y=x?1:0;let _=c===ne.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,S=Gn.fromCartesian(_.center,cue),w=S.high,I=oe.fromElements(S.low.x,S.low.y,S.low.z,_.radius,lue),L=uue;L.x=0,L.y=Number.MAX_VALUE;let B=g.distanceDisplayCondition;l(B)&&(L.x=B.near,L.y=B.far),r.setBatchedAttribute(b,0,N),r.setBatchedAttribute(b,1,M),r.attributes.length>2&&(r.setBatchedAttribute(b,2,w),r.setBatchedAttribute(b,3,I),r.setBatchedAttribute(b,4,L))}};var N7e=new h,F7e=new h,B7e=new h,oue=new h;Dm.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=oue,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=F.multiplyByPoint(n,g,F7e);let m=F.multiplyByPoint(n,a[p],N7e),x;p===u-1?s._loop?x=a[1]:(x=oue,h.subtract(a[u-1],a[u-2],x),h.add(a[u-1],x,x)):x=a[p+1],x=F.multiplyByPoint(n,x,B7e);let b=c[f];p===d+b&&(d+=b,++f);let T=p-d===0,C=p===d+c[f]-1,A=T?2:0,E=C?2:4;for(let v=A;v<E;++v)Gn.writeElements(m,e,t),Gn.writeElements(g,e,t+6),Gn.writeElements(x,e,t+12),t+=6*3}}};var k7e=new Array(1);Dm.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new vj(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===ne.SCENE3D){g=k7e;let x=p._actualPositions.length;if(x>0)g[0]=x;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let x=0;for(let b=0;b<m;++b){let T=g[b]-1;for(let C=0;C<T;++C)c+4>P.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new vj(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new vj(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Dm.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var pE={positions:void 0,lengths:void 0},rue=new Array(1),V7e=new h,U7e=new fe;Dm.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ne.SCENE3D)return rue[0]=n.length,pE.positions=n,pE.lengths=rue,pE;hue(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=V7e;for(let u=0;u<s;++u)a=n[u],c=F.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,U7e)));if(o.length>0){e._boundingVolume2D=ae.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return pE.positions=o,pE.lengths=e._segments.lengths,pE};var sue;Dm.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=sue,c=6*s*3;!l(a)||a.length<c?a=sue=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,x;s=f.length;for(let b=0;b<s;++b){b===0?t._loop?x=f[s-2]:(x=Dz,h.subtract(f[0],f[1],x),h.add(f[0],x,x)):x=f[b-1],h.clone(x,Wf),h.clone(f[b],ws),b===s-1?t._loop?x=f[1]:(x=Dz,h.subtract(f[s-1],f[s-2],x),h.add(f[s-1],x,x)):x=f[b+1],h.clone(x,jf);let T=d[g];b===m+T&&(m+=T,++g);let C=b-m===0,A=b===m+d[g]-1;o===ne.SCENE2D&&(Wf.z=0,ws.z=0,jf.z=0),(o===ne.SCENE2D||o===ne.MORPHING)&&(C||A)&&r-Math.abs(ws.x)<1&&((ws.x<0&&Wf.x>0||ws.x>0&&Wf.x<0)&&h.clone(ws,Wf),(ws.x<0&&jf.x>0||ws.x>0&&jf.x<0)&&h.clone(ws,jf));let E=C?2:0,v=A?2:4;for(let D=E;D<v;++D)Gn.writeElements(ws,a,p),Gn.writeElements(Wf,a,p+6),Gn.writeElements(jf,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var uh=lh;function zy(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new Ru({batchTable:e.batchTable}),this._labelCollection=new wm({batchTable:e.batchTable}),this._polylineCollection=new uh,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(zy.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function z7e(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+se.packedLength+ee.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,se.pack(n,s,a),a+=se.packedLength,ee.pack(t,s,a),s}var H7e=new _i("createVectorTilePoints",5),G7e=new h;function W7e(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=z7e(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=H7e.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let m=d[g],x=h.unpack(n,g*3,G7e),b=c.add();b.position=x,b._batchIndex=m;let T=u.add();T.text=" ",T.position=x,T._batchIndex=m;let C=f.add();C.positions=[h.clone(x),h.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}zy.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],u=n.get(a),f=i.get(a),d=o.get(a);t[c]=new C_(e,c,u,f,d)}};zy.prototype.applyDebugSettings=function(e,t){e?(H.clone(t,this._billboardCollection._highlightColor),H.clone(t,this._labelCollection._highlightColor),H.clone(t,this._polylineCollection._highlightColor)):(H.clone(H.WHITE,this._billboardCollection._highlightColor),H.clone(H.WHITE,this._labelCollection._highlightColor),H.clone(H.WHITE,this._polylineCollection._highlightColor))};function j7e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=C_.defaultPointSize,s.color=C_.defaultColor,s.pointOutlineColor=C_.defaultPointOutlineColor,s.pointOutlineWidth=C_.defaultPointOutlineWidth,s.labelColor=H.WHITE,s.labelOutlineColor=H.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=jo.FILL,s.labelText=void 0,s.backgroundColor=new H(.165,.165,.165,.8),s.backgroundPadding=new z(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=H.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=gi.CENTER,s.verticalOrigin=Rn.CENTER,s.labelHorizontalOrigin=gi.RIGHT,s.labelVerticalOrigin=Rn.BASELINE}}var q7e=new H,Y7e=new H,X7e=new H,K7e=new H,Z7e=new H,$7e=new H,SL=new kt,vL=new kt,Pj=new Lt;zy.prototype.applyStyle=function(e,t){if(!l(e)){j7e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,q7e)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Y7e)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,X7e)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,K7e)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,Z7e)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(SL.near=a.x,SL.nearValue=a.y,SL.far=a.z,SL.farValue=a.w,s.scaleByDistance=SL):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(vL.near=a.x,vL.nearValue=a.y,vL.far=a.z,vL.farValue=a.w,s.translucencyByDistance=vL):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(Pj.near=a.x,Pj.far=a.y,s.distanceDisplayCondition=Pj):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,$7e)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};zy.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=W7e(this,e.mapProjection.ellipsoid)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};zy.prototype.isDestroyed=function(){return!1};zy.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var wL=zy;function E_(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,h.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Vn.BOTH}Object.defineProperties(E_.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function Q7e(e){let t=new Float64Array(3+h.packedLength+ee.packedLength+se.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,se.pack(e._rectangle,t,n),t}function J7e(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=vn.unpack(t,n),n+=vn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=H.unpack(t,n);n+=H.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new _m({color:c,offset:u,count:f,batchIds:p})}}var eqe=new _i("createVectorTilePolygons",5),tqe=new H;function nqe(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(se.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,m=s.length;for(let x=0;x<m;++x){let b=g.getColor(x,tqe);s[x]=b.toRgba()}a=e._packedBuffer=Q7e(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=eqe.scheduleTask(u,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(g.packedBuffer),x=m[0];J7e(e,m),e._indices=Ne.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),iqe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function iqe(e){l(e._primitive)||(e._primitive=new ib({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}E_.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};E_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};E_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};E_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};E_.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=nqe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};E_.prototype.isDestroyed=function(){return!1};E_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var DL=E_;function fh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=H.clone(H.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(fh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function oqe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+se.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,se.pack(t,a,c),c+=se.packedLength,ee.pack(o,a,c),c+=ee.packedLength,h.pack(r,a,c),a}var rqe=new _i("createVectorTilePolylines",5),_E={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function sqe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=oqe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=rqe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===Ne.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),aqe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function aqe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=gt.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),f=gt.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),d=gt.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),p=gt.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),g=gt.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),m=gt.createIndexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),x=[{index:_E.previousPosition,vertexBuffer:u,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:_E.currentPosition,vertexBuffer:f,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:_E.nextPosition,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:_E.expandAndWidth,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:2},{index:_E.a_batchId,vertexBuffer:g,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ei({context:t,attributes:x,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var IL=new F,mue=new h;function cqe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,IL),F.multiplyByPoint(IL,e._center,mue),F.setTranslation(IL,mue,IL),IL},u_highlightColor:function(){return e._highlightColor}})}function lqe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var uqe=`uniform vec4 u_highlightColor; -void main() -{ - out_FragColor = u_highlightColor; -} -`;function fqe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(t1),o=n.getFragmentShaderCallback(!1,void 0,!1)(uqe),r=new Ue({defines:["VECTOR_TILE",Ht.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[_u,i]}),s=new Ue({defines:["VECTOR_TILE"],sources:[o]});e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:_E})}function dqe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new Ze({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:we.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}fh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,u=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let d=o[r],p=o[r+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};fh.prototype.getPositions=function(e){return fh.getPolylinePositions(this,e)};fh.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ws(e,r)}};fh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function hqe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=H.WHITE}}var mqe=new H,pqe=H.WHITE,_qe=!0;fh.prototype.applyStyle=function(e,t){if(!l(e)){hqe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,mqe):pqe,s.show=l(e.show)?e.show.evaluate(s):_qe}};fh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=sqe(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}cqe(this,t),fqe(this,t),lqe(this);let n=e.passes;(n.render||n.pick)&&dqe(this,e)};fh.prototype.isDestroyed=function(){return!1};fh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var Nb=fh;function S_(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new z(li._defaultMinTerrainHeight,li._defaultMaxTerrainHeight),this._boundingVolume=vn.fromRectangle(e.rectangle,li._defaultMinTerrainHeight,li._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=H.clone(H.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(S_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function gqe(e,t,n){let i=li.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;vn.fromRectangle(c,o,r,n,a)}function yqe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+se.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,se.pack(t,a,c),c+=se.packedLength,ee.pack(o,a,c),c+=ee.packedLength,h.pack(r,a,c),a}var xqe=new _i("createVectorTileClampedPolylines"),Hy={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function bqe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=yqe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=xqe.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===Ne.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Tqe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Tqe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=gt.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),p=gt.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),g=gt.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),m=gt.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),x=gt.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),b=gt.createVertexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW}),T=gt.createVertexBuffer({context:t,typedArray:c,usage:Fe.STATIC_DRAW}),C=gt.createIndexBuffer({context:t,typedArray:u,usage:Fe.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),A=[{index:Hy.startEllipsoidNormal,vertexBuffer:d,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:Hy.endEllipsoidNormal,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:Hy.startPositionAndHeight,vertexBuffer:g,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Hy.endPositionAndHeight,vertexBuffer:m,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Hy.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Hy.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:Hy.a_batchId,vertexBuffer:T,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ei({context:t,attributes:A,indexBuffer:C}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var PL=new F,pue=new h;function Cqe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,PL),F.multiplyByPoint(PL,e._center,pue),F.setTranslation(PL,pue,PL),PL},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function _ue(e){return Ve.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Un.EQUAL,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},backFunction:Un.EQUAL,backOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})}function Aqe(e){l(e._rs)||(e._rs=_ue(!1),e._rs3DTiles=_ue(!0))}function Eqe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(e1),o=n.getFragmentShaderCallback(!1,void 0,!0)(JP),r=new Ue({defines:["VECTOR_TILE",Ht.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[_u,i]}),s=new Ue({defines:["VECTOR_TILE"],sources:[o]});e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Hy})}function Sqe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new Ze({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:we.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=Ze.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=we.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Vn.TERRAIN||i===Vn.BOTH)&&t.commandList.push(n),(i===Vn.CESIUM_3D_TILE||i===Vn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}S_.prototype.getPositions=function(e){return Nb.getPolylinePositions(this,e)};S_.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ws(e,r)}};S_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function vqe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=H.WHITE}}var wqe=new H,Dqe=H.WHITE,Iqe=!0;S_.prototype.applyStyle=function(e,t){if(!l(e)){vqe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,wqe):Dqe,s.show=l(e.show)?e.show.evaluate(s):Iqe}};function Pqe(e){return li.initialize().then(function(){gqe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}S_.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Pqe(this).then(bqe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Cqe(this,t),Eqe(this,t),Aqe(this);let n=e.passes;(n.render||n.pick)&&Sqe(this,e)};S_.prototype.isDestroyed=function(){return!1};S_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var RL=S_;var Rj=32767,Rqe=new fe,Oqe=new h;function Mqe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);Mn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let d=s[f],p=a[f],g=c[f],m=P.lerp(t.west,t.east,d/Rj),x=P.lerp(t.south,t.north,p/Rj),b=P.lerp(n,i,g/Rj),T=fe.fromRadians(m,x,b,Rqe),C=o.cartographicToCartesian(T,Oqe);h.pack(C,u,f*3)}return u}var OL=Mqe;function hh(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,kqe(this,i,o)}Object.defineProperties(hh.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function Lqe(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function Nqe(e,t){let n,i,o,r,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(o),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new re("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var dh=Uint32Array.BYTES_PER_ELEMENT;function Fqe(e){return new Nb(e)}function Bqe(e){return new RL(e)}function kqe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=dh;let r=o.getUint32(n,!0);if(r!==1)throw new re(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=dh;let s=o.getUint32(n,!0);if(n+=dh,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=dh,a===0)throw new re("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=dh;let u=o.getUint32(n,!0);n+=dh;let f=o.getUint32(n,!0);n+=dh;let d=o.getUint32(n,!0);n+=dh;let p=o.getUint32(n,!0);n+=dh;let g=o.getUint32(n,!0);n+=dh;let m=o.getUint32(n,!0);n+=dh;let x=No(i,n,a);n+=a;let b=new Uint8Array(t,n,c);n+=c;let T,C;u>0&&(T=No(i,n,u),n+=u,f>0&&(C=new Uint8Array(t,n,f),C=new Uint8Array(C),n+=f));let A=y(x.POLYGONS_LENGTH,0),E=y(x.POLYLINES_LENGTH,0),v=y(x.POINTS_LENGTH,0),D=A+E+v,O=new Kp(e,D,T,C,Lqe(e));if(e._batchTable=O,D===0)return;let R=new oh(x,b),M=R.getGlobalProperty("REGION");if(!l(M))throw new re("Feature table global property: REGION must be defined");let N=se.unpack(M),_=M[4],S=M[5],w=e._tile.computedTransform,I=R.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(I)?(I=h.unpack(I),F.multiplyByPoint(w,I,I)):(I=se.center(N),I.height=P.lerp(_,S,.5),I=ee.WGS84.cartographicToCartesian(I));let L=Nqe(x,b);if(n+=(4-n%4)%4,A>0){R.featuresLength=A;let B=y(R.getPropertyArray("POLYGON_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new re("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=y(R.getPropertyArray("POLYGON_INDEX_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_INDEX_COUNT",X.UNSIGNED_INT,1));if(!l(U))throw new re("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=B.reduce(function(q,K){return q+K*2},0),G=U.reduce(function(q,K){return q+K},0),k=new Uint32Array(t,n,G);n+=d;let W=new Uint16Array(t,n,V);n+=p;let j,J;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(j=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",X.FLOAT,1),J=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",X.FLOAT,1)),e._polygons=new DL({positions:W,counts:B,indexCounts:U,indices:k,minimumHeight:_,maximumHeight:S,polygonMinimumHeights:j,polygonMaximumHeights:J,center:I,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,batchIds:L.polygons,modelMatrix:w})}if(E>0){R.featuresLength=E;let B=y(R.getPropertyArray("POLYLINE_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYLINE_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new re("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let U=R.getPropertyArray("POLYLINE_WIDTHS",X.UNSIGNED_SHORT,1);if(!l(U)){U=new Uint16Array(E);for(let J=0;J<E;++J)U[J]=2}let V=B.reduce(function(J,q){return J+q*3},0),G=new Uint16Array(t,n,V);n+=g;let k=e._tileset,W=k.examineVectorLinesFunction;if(l(W)){let J=OL(new Uint16Array(G),N,_,S,ee.WGS84);Vqe(J,B,L.polylines,O,e.url,W)}let j=Fqe;l(k.classificationType)&&(j=Bqe),e._polylines=j({positions:G,widths:U,counts:B,batchIds:L.polylines,minimumHeight:_,maximumHeight:S,center:I,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,classificationType:k.classificationType,keepDecodedPositions:k.vectorKeepDecodedPositions})}if(v>0){let B=new Uint16Array(t,n,v*3);n+=m,e._points=new wL({positions:B,batchIds:L.points,minimumHeight:_,maximumHeight:S,rectangle:N,batchTable:O})}}function Oj(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}hh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};hh.prototype.getFeature=function(e){return l(this._features)||Oj(this),this._features[e]};hh.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};hh.prototype.applyStyle=function(e){l(this._features)||Oj(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};hh.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||Oj(this),this._batchTable.update(e,t),this._ready=!0)};hh.prototype.pick=function(e,t,n){};hh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};hh.prototype.isDestroyed=function(){return!1};hh.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function Vqe(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,r(f,n[c],o,i)}}var ML=hh;var gue={b3dm:function(e,t,n,i,o){return Pu.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Pu.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Pu.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return bR.fromTileType(e,t,n,i,o,gue)},externalTileset:function(e,t,n,i){return pL.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new CR(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new ML(e,t,n,i,o)},subt:function(e,t,n,i,o){return UA.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return UA.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new re("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return Pu.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Pu.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Pu.fromGeoJson(e,t,n,i)}},Fb=gue;var Uqe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},qo=Object.freeze(Uqe);var mh={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};mh.isBinaryFormat=function(e){switch(e){case mh.BATCHED_3D_MODEL:case mh.INSTANCED_3D_MODEL:case mh.COMPOSITE:case mh.POINT_CLOUD:case mh.VECTOR:case mh.GEOMETRY:case mh.IMPLICIT_SUBTREE:case mh.VOXEL_BINARY:case mh.GLTF_BINARY:return!0;default:return!1}};var Ds=Object.freeze(mh);var zqe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},qf=Object.freeze(zqe);var Ks={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},v_=new Array(Ks.NUMBER_OF_PASSES);v_[Ks.RENDER]=Object.freeze({pass:Ks.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});v_[Ks.PICK]=Object.freeze({pass:Ks.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});v_[Ks.SHADOW]=Object.freeze({pass:Ks.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});v_[Ks.PRELOAD]=Object.freeze({pass:Ks.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});v_[Ks.PRELOAD_FLIGHT]=Object.freeze({pass:Ks.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});v_[Ks.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ks.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});v_[Ks.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ks.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});v_[Ks.MOST_DETAILED_PICK]=Object.freeze({pass:Ks.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ks.getPassOptions=function(e){return v_[e]};var Vo=Object.freeze(Ks);function Im(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Im.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});Im.prototype.hasProperty=function(e,t){return!1};Im.prototype.getFeature=function(e){};Im.prototype.applyDebugSettings=function(e,t){};Im.prototype.applyStyle=function(e){};Im.prototype.update=function(e,t){};Im.prototype.pick=function(e,t,n){};Im.prototype.isDestroyed=function(){return!1};Im.prototype.destroy=function(){return ue(this)};var gE=Im;function w_(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(w_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});w_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};w_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};w_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};w_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};w_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};w_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};w_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var LL=w_;function Mj(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Mj._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new LL({content:n,class:o})}}Mj._oneTimeWarning=yt;var Bb=Mj;function Hqe(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var kb=Hqe;function D_(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(D_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});D_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};D_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};D_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};D_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};D_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};D_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};D_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var NL=D_;function Lj(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Lj._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new NL({tile:n,class:o})}}Lj._oneTimeWarning=yt;var FL=Lj;function Gqe(e){let t=new Uint8Array(e),n=Kd(t);if(n==="glTF"&&(n="glb"),Ds.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Wqe(t);if(l(i.root))return{contentType:Ds.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ds.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ds.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ds.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ds.VOXEL_JSON,jsonPayload:i};throw new re("Invalid tile content.")}function Wqe(e){let t;try{t=No(e)}catch{throw new re("Invalid tile content.")}return t}var Pm=Gqe;function Yf(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=nc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(Yf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function Nj(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function yue(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}Yf.prototype.requestInnerContents=function(){if(!jqe(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;Nj(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=qqe(this,n,t,this._tile._contentState);return Yqe(this)};function jqe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!nc.serverHasOpenSlots(n,t[n]))return!1;return nc.heapHasOpenSlots(e.length)}function qqe(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Zo({throttle:!0,throttleByServer:!0,type:ds.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Zn.CANCELLED){yue(e,i);return}return Nj(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Zn.CANCELLED){yue(e,i);return}Nj(e,-1),xue(e,t,f)}})}async function Yqe(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>Xqe(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function Xqe(e,t,n){if(l(t))try{let i=Pm(t);if(i.contentType===Ds.EXTERNAL_TILESET)throw new re("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ds.GEOMETRY||i.contentType===Ds.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=Fb[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=Bb(o,u));let f=kb(o,u);return l(f)&&(a.group=new Jx({metadata:f})),a}catch(i){xue(e,n,i)}}function xue(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}Yf.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};Yf.prototype.hasProperty=function(e,t){return!1};Yf.prototype.getFeature=function(e){};Yf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Yf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Yf.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};Yf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=h.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};Yf.prototype.isDestroyed=function(){return!1};Yf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var BL=Yf;var bue=Math.cos,Tue=Math.sin,Kqe=Math.sqrt,Fj={};Fj.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,d=bue(f),p=Tue(f),g=a.z*p,m=c.longitude+i*e.granYSin+o*e.granXCos,x=d*bue(m),b=d*Tue(m),T=a.x*x,C=a.y*b,A=Kqe(T*x+C*b+g*p);if(r.x=T/A,r.y=C/A,r.z=g/A,n){let E=e.stNwCorner;l(E)?(f=E.latitude-e.stGranYCos*i+o*e.stGranXSin,m=E.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var Zqe=new Ii,Xf=new h,$qe=new fe,Iz=new h,kL=new Di;function Cue(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;kL._ellipsoid=ee.default,Xf=kL.project(e,Xf),Xf=h.subtract(Xf,Iz,Xf);let g=Ii.fromRotation(t,Zqe);Xf=Ii.multiplyByVector(g,Xf,Xf),Xf=h.add(Xf,Iz,Xf),e=kL.unproject(Xf,e),r-=1,s-=1;let m=e.latitude,x=m+r*p,b=m-c*s,T=m-c*s+r*p,C=Math.max(m,x,b,T),A=Math.min(m,x,b,T),E=e.longitude,v=E+r*u,D=E+s*d,O=E+s*d+r*u,R=Math.max(E,v,D,O),M=Math.min(E,v,D,O);return{north:C,south:A,east:R,west:M,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}Fj.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===P.PI_OVER_TWO&&(d=!0),f===-P.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>a?g=P.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,b=Math.ceil(m/t)+1,T=g/(x-1),C=m/(b-1),A=se.northwest(e,r),E=se.center(e,$qe);(n!==0||i!==0)&&(E.longitude<A.longitude&&(E.longitude+=P.TWO_PI),kL._ellipsoid=ee.default,Iz=kL.project(E,Iz));let v=C,D=T,O=0,R=0,M=se.clone(e,o),N={granYCos:v,granYSin:O,granXCos:D,granXSin:R,nwCorner:A,boundingRectangle:M,width:x,height:b,northCap:d,southCap:p};if(n!==0){let _=Cue(A,n,T,C,E,x,b);u=_.north,f=_.south,a=_.east,c=_.west,N.granYCos=_.granYCos,N.granYSin=_.granYSin,N.granXCos=_.granXCos,N.granXSin=_.granXSin,M.north=u,M.south=f,M.east=a,M.west=c}if(i!==0){n=n-i;let _=se.northwest(M,s),S=Cue(_,n,T,C,E,x,b);N.stGranYCos=S.granYCos,N.stGranXCos=S.granXCos,N.stGranYSin=S.granYSin,N.stGranXSin=S.granXSin,N.stNwCorner=_,N.stWest=S.west,N.stSouth=S.south}return N};var Is=Fj;var Qqe=new ae,Jqe=new ae,eYe=new h,tYe=new se;function Aue(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;r&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*o+2*a-f;let d=new Float64Array(u*3),p=0,g=0,m,x=eYe;if(r)Is.computePosition(t,n,!1,g,0,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;else for(m=0;m<o;m++)Is.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(m=o-1,g=1;g<i;g++)Is.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;if(g=i-1,!s)for(m=o-2;m>=0;m--)Is.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;for(m=0,g=i-2;g>0;g--)Is.computePosition(t,n,!1,g,m,x),d[p++]=x.x,d[p++]=x.y,d[p++]=x.z;let b=d.length/3*2,T=Ne.createTypedArray(d.length/3,b),C=0;for(let E=0;E<d.length/3-1;E++)T[C++]=E,T[C++]=E+1;T[C++]=d.length/3-1,T[C++]=0;let A=new at({attributes:new fn,primitiveType:Me.LINES});return A.attributes.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),A.indices=T,A}function nYe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=Aue(e,t),s=t.height,a=t.width,c=ri.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=ri.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(d,u),r.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let x=(f.length/3+m)*2,b=Ne.createTypedArray(f.length/3,x);u=f.length/6;let T=0;for(let A=0;A<u-1;A++)b[T++]=A,b[T++]=A+1,b[T++]=A+u,b[T++]=A+u+1;b[T++]=u-1,b[T++]=0,b[T++]=u+u-1,b[T++]=u,b[T++]=0,b[T++]=u;let C;if(p)C=s-1;else{let A=a-1;b[T++]=A,b[T++]=A+u,C=a+s-2}if(b[T++]=C,b[T++]=C+u,!g){let A=a+C-1;b[T++]=A,b[T]=A+u}return r.indices=b,r}function xE(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,P.RADIANS_PER_DEGREE),i=y(e.ellipsoid,ee.default),o=y(e.rotation,0),r=y(e.height,0),s=y(e.extrudedHeight,r);this._rectangle=se.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}xE.packedLength=se.packedLength+ee.packedLength+5;xE.pack=function(e,t,n){return n=y(n,0),se.pack(e._rectangle,t,n),n+=se.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var Eue=new se,Sue=ee.clone(ee.UNIT_SPHERE),yE={rectangle:Eue,ellipsoid:Sue,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};xE.unpack=function(e,t,n){t=y(t,0);let i=se.unpack(e,t,Eue);t+=se.packedLength;let o=ee.unpack(e,t,Sue);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=se.clone(i,n._rectangle),n._ellipsoid=ee.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(yE.granularity=r,yE.height=s,yE.rotation=a,yE.extrudedHeight=c,yE.offsetAttribute=u===-1?void 0:u,new xE(yE))};var iYe=new fe;xE.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Is.computeOptions(t,e._granularity,e._rotation,0,tYe,iYe),o,r;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),u;if(c){if(o=nYe(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===sn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===sn.NONE?0:1,g=g.fill(u)),o.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ae.fromRectangle3D(t,n,s,Jqe),d=ae.fromRectangle3D(t,n,a,Qqe);r=ae.union(f,d)}else{if(o=Aue(e,i),o.attributes.position.values=ri.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===sn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}r=ae.fromRectangle3D(t,n,s)}return new at({attributes:o.attributes,indices:o.indices,primitiveType:Me.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var Vb=xE;function TE(e){this.rectangle=se.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=y(e.ellipsoid,ee.WGS84);cYe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(TE.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});TE.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=vn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)};var vue=new h,Pz=new h,wue=new h,oYe=new h,rYe=new h,sYe=new h,aYe=new h,Kf=new fe,Due=new an(h.UNIT_X,0),bE=new mn;function cYe(e,t,n){n.cartographicToCartesian(se.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(se.northeast(t),e.northeastCornerCartesian),Kf.longitude=t.west,Kf.latitude=(t.south+t.north)*.5,Kf.height=0;let i=n.cartographicToCartesian(Kf,sYe),o=h.cross(i,h.UNIT_Z,oYe);h.normalize(o,e.westNormal),Kf.longitude=t.east;let r=n.cartographicToCartesian(Kf,aYe),s=h.cross(h.UNIT_Z,r,vue);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,vue);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,rYe),u=t.south,f;if(u>0){Kf.longitude=(t.west+t.east)*.5,Kf.latitude=u;let x=n.cartographicToCartesian(Kf,bE.origin);h.clone(c,bE.direction);let b=an.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Due);$n.rayPlane(bE,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(x,Pz)}else f=n.geodeticSurfaceNormalCartographic(se.southeast(t),Pz);let d=h.cross(f,a,wue);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){Kf.longitude=(t.west+t.east)*.5,Kf.latitude=p;let x=n.cartographicToCartesian(Kf,bE.origin);h.negate(c,bE.direction);let b=an.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Due);$n.rayPlane(bE,b,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,Pz)}else g=n.geodeticSurfaceNormalCartographic(se.northwest(t),Pz);let m=h.cross(a,g,wue);h.normalize(m,e.northNormal)}var lYe=new h,uYe=new h,fYe=new h(0,-1,0),dYe=new h(0,0,-1),Iue=new h;function hYe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!se.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(se.southwest(e.rectangle),lYe),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(se.northeast(e.rectangle),uYe),f.z=f.y,f.y=f.x,f.x=0,d=fYe,g=h.UNIT_Y,p=dYe,m=h.UNIT_Z);let x=h.subtract(i,u,Iue),b=h.dot(x,d),T=h.dot(x,p),C=h.subtract(i,f,Iue),A=h.dot(C,g),E=h.dot(C,m);b>0?r+=b*b:A>0&&(r+=A*A),T>0?r+=T*T:E>0&&(r+=E*E)}let s,a,c;if(t.mode===ne.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}TE.prototype.distanceToCamera=function(e){let t=hYe(this,e);if(e.mode===ne.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};TE.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};TE.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new Vb({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new vt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Wt.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var Zf=TE;var VL={},mYe=new h,Pue=new h,Rue=new h,Oue=new h,Mue=new vn;VL.validOutline=function(e){let n=vn.fromPoints(e,Mue).halfAxes,i=$.getColumn(n,0,Pue),o=$.getColumn(n,1,Rue),r=$.getColumn(n,2,Oue),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};VL.computeProjectTo2DArguments=function(e,t,n,i){let o=vn.fromPoints(e,Mue),r=o.halfAxes,s=$.getColumn(r,0,Pue),a=$.getColumn(r,1,Rue),c=$.getColumn(r,2,Oue),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(o.center,t),!0};function Lue(e,t,n,i,o){let r=h.subtract(e,t,mYe),s=h.dot(n,r),a=h.dot(i,r);return z.fromElements(s,a,o)}VL.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Lue(i[r],e,t,n);return o}};VL.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Lue(i,e,t,n,o)}};var I_=VL;function pYe(e){let t=e.length,n=new Float64Array(t*3),i=Ne.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new fn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n})});return new at({attributes:s,indices:i,primitiveType:Me.LINES})}function Ub(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=zn.computeHierarchyPackedLength(t,h)+1}Ub.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new Ub(t)};Ub.pack=function(e,t,n){return n=y(n,0),n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var _Ye={polygonHierarchy:{}};Ub.unpack=function(e,t,n){t=y(t,0);let i=zn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new Ub(_Ye)),n._polygonHierarchy=i,n.packedLength=o,n};Ub.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Co(n,h.equalsEpsilon,!0),n.length<3||!I_.validOutline(n))return;let o=zn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new vt({geometry:pYe(o[c])});r.push(u)}let s=Ln.combineInstances(r)[0],a=ae.fromPoints(t.positions);return new at({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var $f=Ub;var Rz=new fe;function UL(e){let t=Qp.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),o=y(e.ellipsoid,ee.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=SYe(t,n,i,o);this._boundingPlanes=r;let s=IYe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=Wj(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=Wj(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=Wj(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();Rz=o.cartesianToCartographic(c,Rz),Rz.height=(i+n)/2,this.center=o.cartographicToCartesian(Rz,c),this._boundingSphere=ae.fromPoints(s)}var gYe=new h,yYe=new fe,xYe=new h,bYe=new fe,TYe=new h,CYe=new h,AYe=new h,EYe=new h;function SYe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,gYe),a=i.cartesianToCartographic(r,yYe);a.height=n;let c=i.cartographicToCartesian(a,xYe),u=an.fromPointNormal(c,s);o[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,bYe),m.height=t;let b=an.getPointDistance(u,i.cartographicToCartesian(m,TYe));b<f&&(f=b)}let x=an.clone(u);for(x.normal=h.negate(x.normal,x.normal),x.distance=x.distance*-1+f,o[1]=x,d=0;d<4;d++){g=p[d];let b=p[(d+1)%4],T=i.geodeticSurfaceNormal(g,CYe),C=h.subtract(b,g,EYe),A=h.cross(C,T,AYe);A=h.normalize(A,A),o[2+d]=an.fromPointNormal(g,A)}return o}var zb=new h,Hb=new h,Gb=new h,Bj=new h,kj=new h,Vj=new h,vYe=new h,wYe=new h,DYe=new h,Uj=new h,zj=new h,Hj=new h,Gy=new h,Rm=new $;function Nue(e,t,n){zb=e.normal,Hb=t.normal,Gb=n.normal,Bj=h.multiplyByScalar(e.normal,-e.distance,Bj),kj=h.multiplyByScalar(t.normal,-t.distance,kj),Vj=h.multiplyByScalar(n.normal,-n.distance,Vj),Uj=h.multiplyByScalar(h.cross(Hb,Gb,vYe),h.dot(Bj,zb),Uj),zj=h.multiplyByScalar(h.cross(Gb,zb,wYe),h.dot(kj,Hb),zj),Hj=h.multiplyByScalar(h.cross(zb,Hb,DYe),h.dot(Vj,Gb),Hj),Rm[0]=zb.x,Rm[1]=Hb.x,Rm[2]=Gb.x,Rm[3]=zb.y,Rm[4]=Hb.y,Rm[5]=Gb.y,Rm[6]=zb.z,Rm[7]=Hb.z,Rm[8]=Gb.z;let i=$.determinant(Rm);return Gy=h.add(Uj,zj,Gy),Gy=h.add(Gy,Hj,Gy),new h(Gy.x/i,Gy.y/i,Gy.z/i)}function IYe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Nue(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Nue(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var Gj=new h,CE=new h;function Wj(e,t){let n=[];for(let i=0;i<4;i++)Gj=h.subtract(t[(i+1)%4],t[i],Gj),CE=h.cross(e.normal,Gj,CE),CE=h.normalize(CE,CE),n[i]=h.clone(CE);return n}Object.defineProperties(UL.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var jj=new h;UL.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;an.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):an.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,an.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=qj(an.projectPointOntoPlane(c,t,jj),i[0],c,o),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Fue(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=qj(an.projectPointOntoPlane(c,t,jj),i[r],c,this._edgeNormals[n[r]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=qj(an.projectPointOntoPlane(this._boundingPlanes[1],t,jj),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var PYe=new h,RYe=new h;function Fue(e,t,n){let i=h.subtract(n,t,PYe),o=h.subtract(e,t,RYe),r=h.dot(i,o);if(r<=0)return t;let s=h.dot(i,i);return r>=s?n:(r=r/s,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var OYe=new an(h.UNIT_X,0);function qj(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let u=an.fromPointNormal(t[c],i[c],OYe);an.getPointDistance(u,e)<0||(a=Fue(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}UL.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?jt.INSIDE:n===this._vertices.length?jt.OUTSIDE:jt.INTERSECTING};UL.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new $f({polygonHierarchy:{positions:this._planeVertices[0]}}),i=$f.createGeometry(n),o=new vt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Wt.fromColor(e)}}),r=new $f({polygonHierarchy:{positions:this._planeVertices[1]}}),s=$f.createGeometry(r),a=new vt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Wt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new $f({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=$f.createGeometry(f);c[u]=new vt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Wt.fromColor(e)}})}return new Dn({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var zL=UL;var MYe=new h(1,1,1),Oz=Math.cos,Mz=Math.sin;function AE(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,MYe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,P.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),u=Math.round(y(e.subdivisions,128));this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}AE.packedLength=2*h.packedLength+8;AE.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var Bue=new h,kue=new h,P_={radii:Bue,innerRadii:kue,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};AE.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Bue);t+=h.packedLength;let o=h.unpack(e,t,kue);t+=h.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(P_.minimumClock=r,P_.maximumClock=s,P_.minimumCone=a,P_.maximumCone=c,P_.stackPartitions=u,P_.slicePartitions=f,P_.subdivisions=d,P_.offsetAttribute=p===-1?void 0:p,new AE(P_))};AE.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ee.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-r)/P.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,x=!1;g&&(p=2,r>0&&(m=!0,d+=u),s<Math.PI&&(x=!0,d+=u));let b=a*p*(f+u),T=new Float64Array(b*3),C=2*(b+d-(u+f)*p),A=Ne.createTypedArray(b,C),E,v,D,O,R=0,M=new Array(f),N=new Array(f);for(E=0;E<f;E++)O=r+E*(s-r)/(f-1),M[E]=Mz(O),N[E]=Oz(O);let _=new Array(a),S=new Array(a);for(E=0;E<a;E++)D=i+E*(o-i)/(a-1),_[E]=Mz(D),S[E]=Oz(D);for(E=0;E<f;E++)for(v=0;v<a;v++)T[R++]=t.x*M[E]*S[v],T[R++]=t.y*M[E]*_[v],T[R++]=t.z*N[E];if(g)for(E=0;E<f;E++)for(v=0;v<a;v++)T[R++]=n.x*M[E]*S[v],T[R++]=n.y*M[E]*_[v],T[R++]=n.z*N[E];for(M.length=a,N.length=a,E=0;E<a;E++)O=r+E*(s-r)/(a-1),M[E]=Mz(O),N[E]=Oz(O);for(_.length=u,S.length=u,E=0;E<u;E++)D=i+E*(o-i)/(u-1),_[E]=Mz(D),S[E]=Oz(D);for(E=0;E<a;E++)for(v=0;v<u;v++)T[R++]=t.x*M[E]*S[v],T[R++]=t.y*M[E]*_[v],T[R++]=t.z*N[E];if(g)for(E=0;E<a;E++)for(v=0;v<u;v++)T[R++]=n.x*M[E]*S[v],T[R++]=n.y*M[E]*_[v],T[R++]=n.z*N[E];for(R=0,E=0;E<f*p;E++){let L=E*a;for(v=0;v<a-1;v++)A[R++]=L+v,A[R++]=L+v+1}let w=f*a*p;for(E=0;E<u;E++)for(v=0;v<a-1;v++)A[R++]=w+E+v*u,A[R++]=w+E+(v+1)*u;if(g)for(w=f*a*p+u*a,E=0;E<u;E++)for(v=0;v<a-1;v++)A[R++]=w+E+v*u,A[R++]=w+E+(v+1)*u;if(g){let L=f*a*p,B=L+a*u;if(m)for(E=0;E<u;E++)A[R++]=L+E,A[R++]=B+E;if(x)for(L+=a*u-u,B+=a*u-u,E=0;E<u;E++)A[R++]=L+E,A[R++]=B+E}let I=new fn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T})});if(l(e._offsetAttribute)){let L=T.length,B=e._offsetAttribute===sn.NONE?0:1,U=new Uint8Array(L/3).fill(B);I.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:U})}return new at({attributes:I,indices:A,primitiveType:Me.LINES,boundingSphere:ae.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Mu=AE;function EE(e){let t=y(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Mu(i),this._workerName="createSphereOutlineGeometry"}EE.packedLength=Mu.packedLength;EE.pack=function(e,t,n){return Mu.pack(e._ellipsoidGeometry,t,n)};var LYe=new Mu,Wb={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};EE.unpack=function(e,t,n){let i=Mu.unpack(e,t,LYe);return Wb.stackPartitions=i._stackPartitions,Wb.slicePartitions=i._slicePartitions,Wb.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,Wb.radii),n._ellipsoidGeometry=new Mu(Wb),n):(Wb.radius=i._radii.x,new EE(Wb))};EE.createGeometry=function(e){return Mu.createGeometry(e._ellipsoidGeometry)};var R_=EE;function SE(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ae(e,t)}Object.defineProperties(SE.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});SE.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};SE.prototype.intersectPlane=function(e){return ae.intersectPlane(this._boundingSphere,e)};SE.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};SE.prototype.createDebugVolume=function(e){let t=new R_({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new vt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Wt.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var O_=SE;var NYe=new h,FYe=new h,BYe=new h,kYe=new h;function jb(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,P.EPSILON7/i,n)}function Yj(e,t){let n=h.normalize(e,kYe),i=h.equalsEpsilon(n,h.UNIT_X,P.EPSILON6)?h.UNIT_Y:h.UNIT_X;return jb(e,i,t)}function Vue(e){let t=$.getColumn(e,0,NYe),n=$.getColumn(e,1,FYe),i=$.getColumn(e,2,BYe),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(o&&!r&&!s?t=jb(n,i,t):!o&&r&&!s?n=jb(t,i,n):!o&&!r&&s?i=jb(n,t,i):o?r?s||(t=Yj(i,t),n=jb(i,t,n)):(t=Yj(n,t),i=jb(n,t,i)):(n=Yj(t,n),i=jb(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function vE(e,t){t=Vue(t),this._orientedBoundingBox=new vn(e,t),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(vE.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});vE.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};vE.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};vE.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=Vue(t),$.clone(t,this._orientedBoundingBox.halfAxes),ae.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};vE.prototype.createDebugVolume=function(e){let t=new Vd({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new vt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Wt.fromColor(e)}});return new Dn({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var Lu=vE;function ir(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||ii(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=F.multiply(a,this.transform,new F),u=l(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(u,this.transform,new F),this.computedTransform=c,this.metadata=FL(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,ir._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&ir._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Wo.REPLACE:Wo.ADD):l(i)?p=i.refine:p=Wo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,x,b,T;if(t=Se.createIfNeeded(t),r)x=qo.UNLOADED,b=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(ir._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(ir._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new gE(e,this),m=!0,x=qo.READY):(x=qo.UNLOADED,b=t.getDerivedResource({url:v}),T=nc.getServerKey(b.getUrlComponent()))}else g=new gE(e,this),m=!0,x=qo.READY;this._content=g,this._contentResource=b,this._contentState=x,this._expiredContent=void 0,this._serverKey=T,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let C=n.expire,A,E;l(C)&&(A=C.duration,l(C.date)&&(E=Z.fromIso8601(C.date))),this.expireDuration=A,this.expireDate=E,this.lastStyleTime=0,this._optimChildrenWithinParent=qf.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=H.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new Z,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}ir._deprecationWarning=ms;Object.defineProperties(ir.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new H),H.clone(this._color)},set:function(e){this._color=H.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===qo.READY}},contentUnloaded:{get:function(){return this._contentState===qo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===qo.EXPIRED}},contentFailed:{get:function(){return this._contentState===qo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Wy=new h;function VYe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,Wy),c=h.add(s.positionWC,a,Wy),u=h.subtract(c,r,Wy);if(h.magnitude(u)>o){let E=h.normalize(u,Wy),v=h.multiplyByScalar(E,o,Wy),D=h.add(r,v,Wy),O=h.subtract(D,s.positionWC,Wy),R=h.normalize(O,Wy);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Wo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Vo.PRELOAD_FLIGHT||n._pass===Vo.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*m;if(e._foveatedFactor<=x)return!1;let b=m-x,T=P.clamp((e._foveatedFactor-x)/b,0,1),C=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,T),A=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-C<=A}var Gue=new Z;ir.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*o,p;if(e.mode===ne.SCENE2D||u instanceof rn){let g=u.offCenterFrustum;l(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/m}else{let g=Math.max(this._distanceToCamera,P.EPSILON7),m=u.sseDenominator;if(p=s*d/(g*m),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,T=P.fog(g,x)*b;p-=T}}return p/=e.pixelRatio,p};function UYe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function zYe(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}ir.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:_s.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==_s.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=zYe(n,this),this._priorityProgressiveResolution=UYe(n,this),this.priorityDeferred=VYe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};ir.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Z.now(Gue);Z.lessThan(this.expireDate,e)&&(this._contentState=qo.EXPIRED,this._expiredContent=this._content)}};function HYe(e){if(!l(e.expireDuration))return;let t=Z.now(Gue);Z.addSeconds(t,e.expireDuration,t),l(e.expireDate)?Z.lessThan(e.expireDate,t)&&Z.clone(t,e.expireDate):e.expireDate=Z.clone(t)}function GYe(e){return function(){return e._priority}}ir.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?WYe(this):qYe(this)};function WYe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ii(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new BL(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=qo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=qo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=qo.FAILED,o})}async function jYe(e,t,n,i,o){let r=e._contentState;e._contentState=qo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Zn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=qo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Zn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await YYe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=qo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=qo.FAILED,a}}function qYe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Zo({throttle:!0,throttleByServer:!0,type:ds.TILES3D,priorityFunction:GYe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return jYe(e,o,i,n,r)}async function YYe(e,t){let n=Pm(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Ds.GEOMETRY||n.contentType===Ds.VECTOR,(n.contentType===Ds.IMPLICIT_SUBTREE||n.contentType===Ds.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===Ds.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=Fb[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=Bb(i,s));let a=kb(i,s);return l(a)&&(o.group=new Jx({metadata:a})),o}ir.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};ir.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=qo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var Wue=new ae;function Kj(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,Wue);e._boundingVolume2D=new O_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function XYe(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,Wue);e._contentBoundingVolume2D=new O_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}ir.prototype.visibility=function(e,t){let n=e.cullingVolume,i=Kj(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==jt.INSIDE,a===jt.OUTSIDE)return _s.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==jt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};ir.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return jt.INSIDE;if(this._visibilityPlaneMask===_s.MASK_INSIDE)return jt.INSIDE;let t=e.cullingVolume,n=XYe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==jt.INSIDE,s===jt.OUTSIDE)return jt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==jt.OUTSIDE,s===jt.INSIDE)return jt.OUTSIDE}return t.computeVisibility(n)};ir.prototype.distanceToTile=function(e){return Kj(this,e).distanceToCamera(e)};var KYe=new h;ir.prototype.distanceToTileCenter=function(e){let n=Kj(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,KYe);return h.dot(e.camera.directionWC,i)};ir.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var jue=new $,que=new h,ZYe=new $,Zj=new h,Yue=new se,Xue=new vn,Xj=new F;function $Ye(e,t,n){let i=h.fromElements(e[0],e[1],e[2],Zj),o=$.fromArray(e,3,ZYe);i=F.multiplyByPoint(t,i,i);let r=F.getMatrix3(t,jue);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new Lu(i,o)}function QYe(e,t,n,i){let o=se.unpack(e,0,Yue),r=e[4],s=e[5],a=vn.fromRectangle(o,r,s,ee.WGS84,Xue),c=a.center,u=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,Xj),Xj),c=F.multiplyByPoint(t,c,c);let f=F.getMatrix3(t,jue);return u=$.multiply(f,u,u),l(i)&&i instanceof Lu?(i.update(c,u),i):new Lu(c,u)}function JYe(e,t,n,i){if(!F.equalsEpsilon(t,n,P.EPSILON8))return QYe(e,t,n,i);let o=se.unpack(e,0,Yue);return l(i)?(i.rectangle=se.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Zf({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function eXe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],Zj),o=e[3];i=F.multiplyByPoint(t,i,i);let r=F.getScale(t,que),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new O_(i,o)}ir.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=gb.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new re("boundingVolume must be defined");if(ii(e,"3DTILES_bounding_volume_S2"))return new zL(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=$Ye(r,t,n);return this._verticalExaggeration!==1&&Uue(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=JYe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Lu?Uue(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Er.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Er.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ee.WGS84))),c}if(l(a)){let c=eXe(a,t,n);if(this._verticalExaggeration!==1){let u=Er.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,Zj),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new re("boundingVolume must contain a sphere, region, or box")};var tXe=h.unpackArray(new Array(8*3).fill(0));function Uue(e,t,n){let i=e.boundingVolume.computeCorners(tXe).map(r=>Er.getPosition(r,ee.WGS84,t,n,r)),o=vn.fromPoints(i,Xue);e.update(o.center,o.halfAxes)}ir.prototype.updateTransform=function(e,t){e=y(e,F.IDENTITY);let n=F.multiplyTransformation(e,this.transform,Xj),i=!F.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&F.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};ir.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,que),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function nXe(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=H.WHITE:c=H.DARKGRAY:c=H.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Wt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(H.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(H.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=H.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function iXe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=qo.FAILED,o}}function oXe(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function rXe(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}ir.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;oXe(this,e),rXe(this,e),nXe(this,e,t,n),iXe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===we.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var zue=[];ir.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(HYe(this),this._selectedFrame=0,this.lastStyleTime=0,Z.now(this._loadTimestamp),this._contentState=qo.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=zue;try{this._content.update(e,t)}catch(i){throw this._contentState=qo.FAILED,i}zue.length=0,t.commandList=n};function Hue(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function Lz(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}ir.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,u=o,f=c+u,d=r,p=Math.pow(10,f),g=f+d,m=r,x=Math.pow(10,g),b=g+m,T=Math.pow(10,b),C=Lz(this._depth,n.depth,i.depth);C=t?1-C:C;let E=!e.isSkippingLevelOfDetail&&this.refine===Wo.REPLACE?Lz(this._priorityHolder._distanceToCamera,n.distance,i.distance):Lz(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=Hue(E,a,s),D=this._priorityProgressiveResolution?0:p,O=Lz(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=Hue(O,u,c),M=this.priorityDeferred?x:0,N=e._pass===Vo.PRELOAD_FLIGHT?0:T;this._priority=C+v+D+R+M+N};ir.prototype.isDestroyed=function(){return!1};ir.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var Qf=ir;function M_(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(M_.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});M_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};M_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};M_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};M_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};M_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};M_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};M_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var wE=M_;function L_(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(L_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});L_.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};L_.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};L_.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};L_.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};L_.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};L_.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};L_.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var HL=L_;function Kue(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),o;l(i)&&(o=new HL({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new wE({group:f,class:n.classes[f.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new wE({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Kue.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var qb=Kue;var Zue={},sXe=new h;Zue.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Lu||i instanceof Zf){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=qf.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Lu||a instanceof Zf)){e._optimChildrenWithinParent=qf.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,o.center,sXe),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=qf.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===qf.USE_OPTIMIZATION};var GL=Zue;function WL(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(WL.prototype,{length:{get:function(){return this._length}}});function aXe(e,t,n){this.item=e,this.previous=t,this.next=n}WL.prototype.add=function(e){let t=new aXe(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function $ue(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}WL.prototype.remove=function(e){l(e)&&($ue(this,e),--this._length)};WL.prototype.splice=function(e,t){if(e===t)return;$ue(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var jL=WL;function Yb(){this._list=new jL,this._sentinel=this._list.add(),this._trimTiles=!1}Yb.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Yb.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Yb.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Yb.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Yb.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};Yb.prototype.trim=function(){this._trimTiles=!0};var qL=Yb;function Nz(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function Qj(e,t){let n;return t==="_loadTimestamp"?n=Z.toDate(e).getTime():n=e,n}Nz.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=Qj(e,n),this._referenceMaximum[n]=Qj(t,n)};function cXe(e,t){let n=e.tilePropertyName;if(l(n)){let i=Qj(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var $j=[new H(.1,.1,.1,1),new H(.153,.278,.878,1),new H(.827,.231,.49,1),new H(.827,.188,.22,1),new H(1,.592,.259,1),new H(1,.843,0,1)];Nz.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=cXe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+P.EPSILON7,c=P.clamp(i-o,0,s)/s,u=$j.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=$j[d],x=$j[p],b=H.clone(H.WHITE);b.red=P.lerp(m.red,x.red,g),b.green=P.lerp(m.green,x.green,g),b.blue=P.lerp(m.blue,x.blue,g),e._debugColor=b};Nz.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var YL=Nz;function DE(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}DE.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};DE.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};DE.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Pu))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};DE.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Pu))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};DE.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.texturesReferenceCounterById={...e.texturesReferenceCounterById},t.batchTableByteLength=e.batchTableByteLength};var N_=DE;function XL(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(XL.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});XL.prototype.makeDirty=function(){this._styleDirty=!0};XL.prototype.resetDirty=function(){this._styleDirty=!1};XL.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var KL=XL;function lXe(e,t,n){let i=ii(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!ii(o,"3DTILES_bounding_volume_S2")&&!ii(o,"3DTILES_bounding_volume_cylinder"))throw new re("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new Se({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=uXe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Ge(a,!0));let c=new Se({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=fXe(t),this.subdivisionScheme=ns[i.subdivisionScheme],this.branchingFactor=ns.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function uXe(e){if(ii(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function fXe(e){let t=Ge(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var Xb=lXe;var ZL={};function Que(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function Jj(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Jue(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function e7(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}ZL.encode2D=function(e,t){return(Que(e)|Que(t)<<1)>>>0};ZL.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Jue(e),t[1]=Jue(e>>1),t};ZL.encode3D=function(e,t,n){return Jj(e)|Jj(t)<<1|Jj(n)<<2};ZL.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=e7(e),t[1]=e7(e>>1),t[2]=e7(e>>2),t};var jy=ZL;function Yo(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===ns.OCTREE&&(this.z=e.z)}Object.defineProperties(Yo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===ns.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===ns.OCTREE?jy.encode3D(this.x,this.y,this.z):jy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===ns.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Yo.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===ns.OCTREE){let o=(this.z<<e.level)+e.z;return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Yo.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===ns.OCTREE){let r=Math.floor(this.z/t);return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Yo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===ns.OCTREE){let r=e.z%n;return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Yo.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===ns.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Yo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Yo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Yo.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===ns.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Yo.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===ns.OCTREE?this.z===e.z:!0)};Yo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Yo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Yo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Yo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===ns.OCTREE&&(e.z=this.z),e};var efe=[0,0,0];Yo.fromMortonIndex=function(e,t,n,i){let o;return e===ns.OCTREE?(o=jy.decode3D(i,efe),new Yo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=jy.decode2D(i,efe),new Yo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Yo.fromTileIndex=function(e,t,n){let i,o,r;return e===ns.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(P.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Yo.fromMortonIndex(e,t,i,r)};var Kb=Yo;function F_(){}F_.selectTiles=function(e,t){he.throwInstantiationError()};F_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};F_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};F_.selectTile=function(e,t){if(e.contentVisibility(t)===jt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};F_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};F_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};F_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!dXe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function dXe(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}F_.updateTile=function(e,t){tfe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,pXe(e),e._shouldSelect=!1,e._finalResolution=!0};function tfe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];tfe(r,t),e._visible=r._visible;return}if(hXe(e,t)){e._visible=!1;return}let i=e.refine===Wo.REPLACE,o=e._optimChildrenWithinParent===qf.USE_OPTIMIZATION;if(i&&o&&n&&!mXe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function hXe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Wo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function mXe(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function pXe(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Zs=F_;function nfe(){}var $L={stack:new Qc,stackMaximumLength:0};nfe.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=Zs,s=$L.stack;for(s.push(i);s.length>0;){$L.stackMaximumLength=Math.max($L.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Wo.ADD,u=a.refine===Wo.REPLACE,f=_Xe(a);f&&gXe(a,s,t),(c||u&&!f)&&(yXe(e,a),o(a,t),xXe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return $L.stack.trim($L.stackMaximumLength),n};function _Xe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function gXe(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function yXe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function xXe(e,t){e.contentAvailable&&e.contentVisibility(t)!==jt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var QL=nfe;function ife(){}var JL={stack:new Qc,stackMaximumLength:0},eN={stack:new Qc,stackMaximumLength:0};ife.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Zs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;TXe(n,t),JL.stack.trim(JL.stackMaximumLength),eN.stack.trim(eN.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function t7(e,t){e.contentAvailable&&Zs.selectTile(e,t)}function bXe(e,t,n){let i=e.refine===Wo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Zs;for(let m=0;m<r.length;++m)s(r[m],n);r.sort(Zs.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let x=r[m];if(x.isVisible?(t.push(x),x._foveatedFactor<g&&(p=m,g=x._foveatedFactor),d=!0):(u||o.loadSiblings)&&(x._foveatedFactor<g&&(p=m,g=x._foveatedFactor),a(x,n),c(x,n)),u){let b;x._inRequestVolume?x.hasRenderableContent?b=x.contentAvailable:b=CXe(x,n):b=!1,f=f&&b}}if(d||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let x=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;x._foveatedFactor=Math.min(m._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(m._distanceToCamera,x._distanceToCamera);for(let b=0;b<r.length;++b)r[b]._priorityHolder=x}return f}function TXe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Zs,a=JL.stack;for(a.push(e);a.length>0;){JL.stackMaximumLength=Math.max(JL.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?bXe(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===Wo.ADD?(t7(c,t),o(c,t)):c.refine===Wo.REPLACE&&(o(c,t),d&&t7(c,t)):(n._emptyTiles.push(c),o(c,t),d&&t7(c,t)),r(c,t),s(c,t)}}function CXe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Zs,s=!0,a=eN.stack;for(a.push(e);a.length>0;){eN.stackMaximumLength=Math.max(eN.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,d=!c.hasRenderableContent&&n(c);if(!d&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),d)for(let p=0;p<f;++p){let g=u[p];a.push(g)}}return e.hasEmptyContent||s}var tN=ife;function ofe(){}var nN={stack:new Qc,stackMaximumLength:0},iN={stack:new Qc,stackMaximumLength:0},B_={stack:new Qc,stackMaximumLength:0,ancestorStack:new Qc,ancestorStackMaximumLength:0},AXe=2;ofe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Zs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;IXe(n,t),PXe(n,t),nN.stack.trim(nN.stackMaximumLength),iN.stack.trim(iN.stackMaximumLength),B_.stack.trim(B_.stackMaximumLength),B_.ancestorStack.trim(B_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function EXe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Zs,r=iN.stack;for(r.push(e);r.length>0;){iN.stackMaximumLength=Math.max(iN.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<AXe&&r.push(u))}}}function Fz(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:EXe(e,t)}function SXe(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function vXe(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function wXe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Zs;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(Zs.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function DXe(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function IXe(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Zs,c=nN.stack;for(c.push(e);c.length>0;){nN.stackMaximumLength=Math.max(nN.stackMaximumLength,c.length);let u=c.pop();SXe(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=o(u)?wXe(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===Wo.ADD?(Fz(u,t),r(u,t)):u.refine===Wo.REPLACE&&(DXe(u,i)?(r(u,t),p&&Fz(u,t)):p?(Fz(u,t),r(u,t)):vXe(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&Fz(u,t)),s(u,t),a(u,t)}}function PXe(e,t){let{selectTile:n,canTraverse:i}=Zs,{stack:o,ancestorStack:r}=B_,s;for(o.push(e);o.length>0||r.length>0;){if(B_.stackMaximumLength=Math.max(B_.stackMaximumLength,o.length),B_.ancestorStackMaximumLength=Math.max(B_.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Wo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&o.push(d)}}}}var oN=ofe;function or(e){e=y(e,y.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new qL,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Qc,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=y(e.cacheBytes,512*1024*1024);let t=y(e.maximumCacheOverflowBytes,512*1024*1024);this._maximumCacheOverflowBytes=t,this._styleEngine=new KL,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._addHeightCallbacks=[],this._statistics=new N_,this._statisticsLast=new N_,this._statisticsPerPass=new Array(Vo.NUMBER_OF_PASSES);for(let o=0;o<Vo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new N_;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new YL(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=P.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!0),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,P.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=y(e.dynamicScreenSpaceErrorDensity,2e-4),this.dynamicScreenSpaceErrorFactor=y(e.dynamicScreenSpaceErrorFactor,24),this.dynamicScreenSpaceErrorHeightFalloff=y(e.dynamicScreenSpaceErrorHeightFalloff,.25),this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,yn.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=Nl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Am(e.pointCloudShading),this._pointCloudEyeDomeLighting=new d_,this.loadProgress=new me,this.allTilesLoaded=new me,this.initialTilesLoaded=new me,this.tileLoad=new me,this.tileUnload=new me,this.tileFailed=new me,this.tileVisible=new me,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,l(e.clippingPlanes)&&gs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&th.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Qx,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new c_(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,H.BLACK),this.splitDirection=y(e.splitDirection,Br.NONE),this.enableCollision=y(e.enableCollision,!1),this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&yt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(or.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){th.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return ms("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,dfe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});or.fromIonAssetId=async function(e,t){let n=await Cu.fromAssetId(e);return or.fromUrl(n,t)};or.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await or.loadJson(n),r=await RXe(n,o),s=new or(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,dfe(s);let c=l(o.asset.gltfUpAxis)?Lo.fromName(o.asset.gltfUpAxis):Lo.Y,u=y(t.modelUpAxis,c),f=y(t.modelForwardAxis,Lo.X);s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,F.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>li._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s};or.loadJson=function(e){return Se.createIfNeeded(e).fetchJson()};or.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};or.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new re("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new re("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&or.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=rfe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Wo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=rfe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&GL.checkChildrenWithinParent(c)}return s};function rfe(e,t,n,i){if(!(l(n.implicitTiling)||ii(n,"3DTILES_implicit_tiling")))return new Qf(e,t,n,i);let r=e.schema,s=new Xb(t,n,r),a=new Kb({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Ge(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new Qf(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function RXe(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ei.getSchemaLoader({resource:e});else if(l(n.schema))i=Ei.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new qb({schema:i.schema,metadataJson:n});return Ei.unload(i),o}var sfe=new h,OXe=new fe,MXe=new F,LXe=new h,NXe=new h,FXe=new h,BXe=new h;function kXe(e,t){let n,i,o,r,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Zf)n=h.normalize(a.positionWC,sfe),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let x=F.inverseTransformation(c.computedTransform,MXe),b=t.mapProjection.ellipsoid,T=u.boundingVolume,C=F.multiplyByPoint(x,T.center,LXe);if(h.magnitude(C)>b.minimumRadius){let A=fe.fromCartesian(C,b,OXe);n=h.normalize(a.positionWC,sfe),i=a.directionWC,o=a.positionCartographic.height,r=0,s=A.height*2}else{let A=F.multiplyByPoint(x,a.positionWC,NXe);if(n=h.UNIT_Z,i=F.multiplyByPointAsVector(x,a.directionWC,FXe),i=h.normalize(i,i),o=A.z,u instanceof Lu){let E=$.getColumn(T.halfAxes,2,BXe),v=h.magnitude(E);r=C.z-v,s=C.z+v}else if(u instanceof O_){let E=T.radius;r=C.z-E,s=C.z+E}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=r+(s-r)*f,p=s,g=P.clamp((o-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function VXe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{lfe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?JXe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function cfe(e,t){return e._priority-t._priority}or.prototype.postPassesUpdate=function(e){l(this._root)&&(UXe(this,e),tKe(this,e),this._cache.unloadTiles(this,ffe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};or.prototype.prePassesUpdate=function(e){if(!l(this._root))return;YXe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=Z.clone(e.time)),this._timeSinceLoad=Math.max(Z.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&kXe(this,e),e.newFrame&&this._cache.reset()};function UXe(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==qo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function zXe(e){let t=e._requestedTiles;t.sort(cfe);for(let n=0;n<t.length;++n)VXe(e,t[n])}function lfe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function HXe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==qo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var GXe=new fe,WXe=new fe,jXe=new h;function qXe(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=fe.clone(r.positionCartographic,GXe),c=fe.fromCartesian(o.center,s,WXe);l(c)&&(a.height=c.height);let u=fe.toCartesian(a,s,jXe);h.distance(u,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function YXe(e,t){HXe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,lfe(f,e,u)}}e.totalMemoryUsageInBytes<i?KXe(e):a&&n.length>0&&XXe(e)}function XXe(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(cfe)}function KXe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var Bz=new h,ZXe={maximumFractionDigits:3};function afe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,ZXe):Math.round(t).toLocaleString()}function n7(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,Bz);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=h.normalize(i,Bz);r=h.multiplyByScalar(r,.75*n,Bz),o=h.add(r,i,Bz)}return o}function i7(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=` -Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=` -Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=` -Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=` -Triangles: ${e.content.trianglesLength}`,o++),i+=` -Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=` -Texture Memory: ${afe(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${afe(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` -Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` -- ${s[a]}`;o+=s.length}else i+=` -Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function $Xe(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:n7(e.debugPickedTile),a=i7(e.debugPickedTile,e,s);a.pixelOffset=new z(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];i7(a,e,n7(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&i7(a,e,n7(a))}}e._tileDebugLabels.update(t)}function QXe(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new Jn({stencil:0,pass:we.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:Ut.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<s.length;++m){let x=s[m];f&&u.raiseEvent(x),qXe(e,x,t),x.update(e,t,n),c.incrementSelectionCounts(x.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,x=m.length;i.length+=x;for(let b=g-1;b>=0;--b)i[d+x+b]=i[d+b];for(let b=0;b<x;++b)i[d+b]=m[b]}g=i.length-r,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new wm),$Xe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var ufe=[];function JXe(e,t){let n=t,i=ufe;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(eKe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function ffe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function eKe(e,t){e._cache.unloadTile(e,t,ffe),t.destroy()}or.prototype.trimLoadedTiles=function(){this._cache.trim()};function tKe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;N_.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function nKe(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function iKe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function oKe(e,t,n,i){if(t.mode===ne.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,nKe(e),iKe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&zXe(e),QXe(e,t,i),N_.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function dfe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Tt.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new Tt(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}or.prototype.getTraversal=function(e){let{pass:t}=e;return t===Vo.MOST_DETAILED_PRELOAD||t===Vo.MOST_DETAILED_PICK?QL:this.isSkippingLevelOfDetail?oN:tN};or.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};or.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Vo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Vo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Vo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Vo.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),u=c.length;if(e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r),s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let d=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=oKe(this,e,d,s)),a&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};or.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};or.prototype.isDestroyed=function(){return!1};or.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=ufe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,ue(this)};or.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};or.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!or.supportedExtensions[e[t]])throw new re(`Unsupported 3D Tiles Extension: ${e[t]}`)};var rKe=new mn,sKe=new h,aKe=new fe;or.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=rKe,o=n.cartographicToCartesian(e,i.direction);h.normalize(i.direction,i.direction),i.direction=h.normalize(o,i.direction),i.direction=h.negate(o,i.direction),i.origin=h.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,sKe);if(l(r))return n.cartesianToCartographic(r,aKe)?.height};or.prototype.updateHeight=function(e,t,n){n=y(n,ee.WGS84);let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var cKe=new Da,lKe=new h;or.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let u=i[c],f=$n.raySphere(e,u.contentBoundingVolume.boundingSphere,cKe);!l(f)||!l(u.content)||r.push(u)}let s=r.length;r.sort((c,u)=>{let f=ae.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),d=ae.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-d});let a;for(let c=0;c<s;++c){let f=r[c].content.pick(e,t,lKe);if(l(f))return a=h.clone(f,n),a}};var xs=or;var uKe=new F;function qy(e,t){t.collectionChanged.addEventListener(qy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new St,this._onCollectionChanged(t,t.values,[],[])}qy.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;f&&(d=s.computeModelMatrix(e,uKe),c=Se.createIfNeeded(Y.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],fKe(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=Y.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};qy.prototype.isDestroyed=function(){return!1};qy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)o7(this,e[i],t,n);return ue(this)};qy.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return ct.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ae.clone(i.boundingSphere,t),ct.DONE):ct.FAILED:ct.PENDING};qy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(o7(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],o7(this,r,a,c),s.remove(r.id)};function o7(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function fKe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await xs.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var rN=qy;var dKe=H.WHITE,hKe=H.BLACK,mKe=new z(2,2);function IE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(IE.prototype,{isConstant:{get:function(){return Y.isConstant(this._evenColor)&&Y.isConstant(this._oddColor)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});IE.prototype.getType=function(e){return"Checkerboard"};var pKe=new Z;IE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(pKe)),l(t)||(t={}),t.lightColor=Y.getValueOrClonedDefault(this._evenColor,e,dKe,t.lightColor),t.darkColor=Y.getValueOrClonedDefault(this._oddColor,e,hKe,t.darkColor),t.repeat=Y.getValueOrDefault(this._repeat,e,mKe),t};IE.prototype.equals=function(e){return this===e||e instanceof IE&&Y.equals(this._evenColor,e._evenColor)&&Y.equals(this._oddColor,e._oddColor)&&Y.equals(this._repeat,e._repeat)};var PE=IE;var hfe={id:void 0};function sN(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function yc(e){this._owner=e,this._entities=new St,this._addedEntities=new St,this._removedEntities=new St,this._changedEntities=new St,this._suspendCount=0,this._collectionChanged=new me,this._id=Hn(),this._show=!0,this._firing=!1,this._refire=!1}yc.prototype.suspendEvents=function(){this._suspendCount++};yc.prototype.resumeEvents=function(){this._suspendCount--,sN(this)};Object.defineProperties(yc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});yc.prototype.computeAvailability=function(){let e=He.MAXIMUM_VALUE,t=He.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;Z.lessThan(a,e)&&!a.equals(He.MINIMUM_VALUE)&&(e=a),Z.greaterThan(c,t)&&!c.equals(He.MAXIMUM_VALUE)&&(t=c)}}return He.MAXIMUM_VALUE.equals(e)&&(e=He.MINIMUM_VALUE),He.MINIMUM_VALUE.equals(t)&&(t=He.MAXIMUM_VALUE),new An({start:e,stop:t})};yc.prototype.add=function(e){e instanceof tr||(e=new tr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new he(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(yc.prototype._onEntityDefinitionChanged,this),sN(this),e};yc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};yc.prototype.contains=function(e){return this._entities.get(e.id)===e};yc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(yc.prototype._onEntityDefinitionChanged,this),sN(this),!0):!1};yc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(yc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),sN(this)};yc.prototype.getById=function(e){return this._entities.get(e)};yc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(hfe.id=e,t=new tr(hfe),this.add(t)),t};yc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),sN(this)};var $s=yc;var kz={id:void 0},RE=new Array(2);function r7(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function mfe(e,t,n,i){RE[0]=n,RE[1]=i.id,t[JSON.stringify(RE)]=i.definitionChanged.addEventListener(Gr.prototype._onDefinitionChanged,e)}function pfe(e,t,n,i){RE[0]=n,RE[1]=i.id;let o=JSON.stringify(RE);t[o](),t[o]=void 0}function Yy(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,u,f=e._composite,d=new $s(e),p=e._eventHash,g;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(Gr.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],pfe(e,p,g,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(Gr.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],mfe(e,p,g,s);let x=d.getById(s.id);l(x)||(x=f.getById(s.id),l(x)?r7(x):(kz.id=s.id,x=new tr(kz)),d.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function Gr(e,t){this._owner=t,this._composite=new $s(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Hn(),this._eventHash={},Yy(this),this._shouldRecomposite=!1}Object.defineProperties(Gr.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Gr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),Yy(this)};Gr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Yy(this),!0):!1};Gr.prototype.removeAllCollections=function(){this._collections.length=0,Yy(this)};Gr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Gr.prototype.contains=function(e){return this._composite.contains(e)};Gr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Gr.prototype.getCollection=function(e){return this._collections[e]};Gr.prototype.getCollectionsLength=function(){return this._collections.length};function Vz(e,t){return e.indexOf(t)}function _fe(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,Yy(e)}Gr.prototype.raiseCollection=function(e){let t=Vz(this._collections,e);_fe(this,t,t+1)};Gr.prototype.lowerCollection=function(e){let t=Vz(this._collections,e);_fe(this,t,t-1)};Gr.prototype.raiseCollectionToTop=function(e){let t=Vz(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Yy(this))};Gr.prototype.lowerCollectionToBottom=function(e){let t=Vz(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Yy(this))};Gr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Gr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Yy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Gr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Gr.prototype.getById=function(e){return this._composite.getById(e)};Gr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];pfe(this,d,p,m);let x=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),r7(u)),u.merge(c));l(u)||r.removeById(x),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];mfe(this,d,p,m);let x=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),l(u)?r7(u):(kz.id=x,u=new tr(kz),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};Gr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var s7=Gr;function a7(){this._removalFunctions=[]}a7.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};a7.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var dr=a7;function u7(e,t){return Z.compare(e.start,t.start)}function Wr(e){if(this._intervals=[],this._changedEvent=new me,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Wr.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Wr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Wr))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!An.equals(n[r],i[r],t))return!1;return!0};Wr.prototype.get=function(e){return this._intervals[e]};Wr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Wr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Wr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Wr.prototype.contains=function(e){return this.indexOf(e)>=0};var c7=new An;Wr.prototype.indexOf=function(e){let t=this._intervals;c7.start=e,c7.stop=e;let n=Oo(t,c7,u7);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&An.contains(t[n-1],e)?n-1:~n)};Wr.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};Wr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||Z.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Oo(n,e,u7);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=Z.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(Z.greaterThan(e.stop,n[i-1].stop)?e=new An({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new An({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=Z.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new An({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new An({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=Z.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new An({start:e.start,stop:Z.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:Z.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new An({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Wr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Oo(t,e,u7);n<0&&(n=~n);let i=!1;for(n>0&&(Z.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(Z.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new An({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new An({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new An({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&Z.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new An({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new An({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(Z.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new An({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Wr.prototype.intersect=function(e,t,n){let i=new Wr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],u=a[r];if(Z.lessThan(c.stop,u.start))++o;else if(Z.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=An.intersect(c,u,new An,n);f.isEmpty||i.addInterval(f,t)}Z.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};Wr.fromJulianDateArray=function(e,t){l(t)||(t=new Wr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),u,f=0;a&&(++f,u=new An({start:He.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new An({start:p,stop:g,isStartIncluded:t.length===f?r:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),p=g}return c&&(u=new An({start:n[i-1],stop:He.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var xc=new Ap,aN=[0,31,28,31,30,31,30,31,31,30,31,30,31];function l7(e,t,n){l(n)||(n=new Z),Z.toGregorianDate(e,xc);let i=xc.millisecond+t.millisecond,o=xc.second+t.second,r=xc.minute+t.minute,s=xc.hour+t.hour,a=xc.day+t.day,c=xc.month+t.month,u=xc.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),aN[2]=Dd(u)?29:28;a>aN[c]||c>=13;)a>aN[c]&&(a-=aN[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),aN[2]=Dd(u)?29:28;return xc.millisecond=i,xc.second=o,xc.minute=r,xc.hour=s,xc.day=a,xc.month=c,xc.year=u,Z.fromGregorianDate(xc,n)}var _Ke=new Z,gKe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function gfe(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(gKe);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),Z.toGregorianDate(Z.fromIso8601(e,_Ke),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var cN=new Ap;Wr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=Z.fromIso8601(n[0]),o=Z.fromIso8601(n[1]),r=[];if(!gfe(n[2],cN))r.push(i,o);else{let s=Z.clone(i);for(r.push(s);Z.compare(s,o)<0;)s=l7(s,cN),Z.compare(o,s)<=0&&Z.clone(o,s),r.push(s)}return Wr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Wr.fromIso8601DateArray=function(e,t){return Wr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return Z.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Wr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let u=0;u<c;++u)(gfe(i[u],cN)||u===0)&&(o&&l(a)?s=l7(a,cN):s=l7(n,cN),r.push(s),a=s);return Wr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var jr=Wr;function yKe(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function Zb(){this._eventHelper=new dr,this._definitionChanged=new me,this._intervals=new jr,this._intervals.changedEvent.addEventListener(Zb.prototype._intervalsChanged,this)}Object.defineProperties(Zb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var xKe=new Z;Zb.prototype.getValue=function(e,t){l(e)||(e=Z.now(xKe));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Zb.prototype.equals=function(e){return this===e||e instanceof Zb&&this._intervals.equals(e._intervals,Y.equals)};Zb.prototype._intervalsChanged=function(){yKe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var bc=Zb;function Xy(){this._definitionChanged=new me,this._composite=new bc,this._composite.definitionChanged.addEventListener(Xy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Xy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Xy.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var bKe=new Z;Xy.prototype.getValue=function(e,t){l(e)||(e=Z.now(bKe));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Xy.prototype.equals=function(e){return this===e||e instanceof Xy&&this._composite.equals(e._composite,Y.equals)};Xy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var OE=Xy;function Ky(e){this._referenceFrame=y(e,Ui.FIXED),this._definitionChanged=new me,this._composite=new bc,this._composite.definitionChanged.addEventListener(Ky.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Ky.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var TKe=new Z;Ky.prototype.getValue=function(e,t){return l(e)||(e=Z.now(TKe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Ky.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Ky.prototype.equals=function(e){return this===e||e instanceof Ky&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,Y.equals)};Ky.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ma=Ky;var CKe={ROUNDED:0,MITERED:1,BEVELED:2},Mi=Object.freeze(CKe);var pa=[new h,new h],AKe=new h,EKe=new h,SKe=new h,vKe=new h,wKe=new h,DKe=new h,IKe=new h,PKe=new h,RKe=new h,ME=new h,Uz=new h,lN={},f7=new fe;function OKe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];f7=t.cartesianToCartographic(o,f7),n[i]=f7.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function d7(e,t,n,i){let o=e[0],r=e[1],s=h.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var zz=new h,Hz=new h;function MKe(e,t,n,i){let o=new Jr(n,i),r=o.projectPointOntoPlane(h.add(n,e,zz),zz),s=o.projectPointOntoPlane(h.add(n,t,Hz),Hz),a=z.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var LKe=new h(-1,0,0),$b=new F,NKe=new F,h7=new $,FKe=$.IDENTITY.clone(),BKe=new h,kKe=new oe,yfe=new h;function k_(e,t,n,i,o,r,s,a){let c=BKe,u=kKe;$b=Mt.eastNorthUpToFixedFrame(e,o,$b),c=F.multiplyByPointAsVector($b,LKe,c),c=h.normalize(c,c);let f=MKe(c,t,e,o);h7=$.fromRotationZ(f,h7),yfe.z=r,$b=F.multiplyTransformation($b,F.fromRotationTranslation(h7,yfe,NKe),$b);let d=FKe;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=F.multiplyByPoint($b,u,u),i.push(u.x,u.y,u.z);return i}var VKe=new h;function m7(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,VKe);i=k_(c,t,n,i,o,r[a/3],s,1)}return i}function UKe(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function xfe(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var bfe=new Oe,Tfe=new h,Cfe=new $;function Afe(e,t,n,i,o,r,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,ME),h.subtract(n,e,Uz)),d=i===Mi.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;o?p=$.fromQuaternion(Oe.fromAxisAngle(h.negate(e,ME),f/(d+1),bfe),Cfe):p=$.fromQuaternion(Oe.fromAxisAngle(e,f/(d+1),bfe),Cfe);let g,m;if(t=h.clone(t,Tfe),d>0){let x=u?2:1;for(let b=0;b<d;b++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,ME),g=h.normalize(g,g),o||(g=h.negate(g,g)),m=r.scaleToGeodeticSurface(t,Uz),s=k_(m,g,a,s,r,c,1,x)}else g=h.subtract(t,e,ME),g=h.normalize(g,g),o||(g=h.negate(g,g)),m=r.scaleToGeodeticSurface(t,Uz),s=k_(m,g,a,s,r,c,1,1),n=h.clone(n,Tfe),g=h.subtract(n,e,ME),g=h.normalize(g,g),o||(g=h.negate(g,g)),m=r.scaleToGeodeticSurface(n,Uz),s=k_(m,g,a,s,r,c,1,1);return s}lN.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];z.equals(r,s)||n.push(s)}return n};lN.angleIsGreaterThanPi=function(e,t,n,i){let o=new Jr(n,i),r=o.projectPointOntoPlane(h.add(n,e,zz),zz),s=o.projectPointOntoPlane(h.add(n,t,Hz),Hz);return s.x*r.y-s.y*r.x>=0};var zKe=new h,HKe=new h;lN.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=OKe(e,r),a=i._granularity,c=i._cornerType,u=o?UKe(t,n):xfe(t,n),f=o?xfe(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],x=o?[]:void 0,b=AKe,T=EKe,C=SKe,A=vKe,E=wKe,v=DKe,D=IKe,O=PKe,R=RKe,M=e[0],N=e[1];A=r.geodeticSurfaceNormal(M,A),b=h.subtract(N,M,b),b=h.normalize(b,b),O=h.cross(A,b,O),O=h.normalize(O,O);let _=s[0],S=s[1];o&&(x=k_(M,O,f,x,r,_+d,1,1)),R=h.clone(M,R),M=N,T=h.negate(b,T);let w,I;for(let U=1;U<g-1;U++){let V=o?2:1;if(N=e[U+1],M.equals(N)){yt("Positions are too close and are considered equivalent with rounding error.");continue}b=h.subtract(N,M,b),b=h.normalize(b,b),A=r.geodeticSurfaceNormal(M,A);let G=h.multiplyByScalar(A,h.dot(b,A),zKe);h.subtract(b,G,G),h.normalize(G,G);let k=h.multiplyByScalar(A,h.dot(T,A),HKe);if(h.subtract(T,k,k),h.normalize(k,k),!P.equalsEpsilon(Math.abs(h.dot(G,k)),1,P.EPSILON7)){C=h.add(b,T,C),C=h.normalize(C,C),C=h.cross(C,A,C),C=h.cross(A,C,C),C=h.normalize(C,C);let j=1/Math.max(.25,h.magnitude(h.cross(C,T,ME))),J=lN.angleIsGreaterThanPi(b,T,M,r);J?(E=h.add(M,h.multiplyByScalar(C,j*p,C),E),v=h.add(E,h.multiplyByScalar(O,p,v),v),pa[0]=h.clone(R,pa[0]),pa[1]=h.clone(v,pa[1]),w=d7(pa,_+d,S+d,a),I=Oi.generateArc({positions:pa,granularity:a,ellipsoid:r}),m=m7(I,O,u,m,r,w,1),O=h.cross(A,b,O),O=h.normalize(O,O),D=h.add(E,h.multiplyByScalar(O,p,D),D),c===Mi.ROUNDED||c===Mi.BEVELED?Afe(E,v,D,c,J,r,m,u,S+d,o):(C=h.negate(C,C),m=k_(M,C,u,m,r,S+d,j,V)),R=h.clone(D,R)):(E=h.add(M,h.multiplyByScalar(C,j*p,C),E),v=h.add(E,h.multiplyByScalar(O,-p,v),v),pa[0]=h.clone(R,pa[0]),pa[1]=h.clone(v,pa[1]),w=d7(pa,_+d,S+d,a),I=Oi.generateArc({positions:pa,granularity:a,ellipsoid:r}),m=m7(I,O,u,m,r,w,1),O=h.cross(A,b,O),O=h.normalize(O,O),D=h.add(E,h.multiplyByScalar(O,-p,D),D),c===Mi.ROUNDED||c===Mi.BEVELED?Afe(E,v,D,c,J,r,m,u,S+d,o):m=k_(M,C,u,m,r,S+d,j,V),R=h.clone(D,R)),T=h.negate(b,T)}else m=k_(R,O,u,m,r,_+d,1,1),R=M;_=S,S=s[U+1],M=N}pa[0]=h.clone(R,pa[0]),pa[1]=h.clone(M,pa[1]),w=d7(pa,_+d,S+d,a),I=Oi.generateArc({positions:pa,granularity:a,ellipsoid:r}),m=m7(I,O,u,m,r,w,1),o&&(x=k_(M,O,f,x,r,S+d,1,1)),g=m.length;let L=o?g+x.length:g,B=new Float64Array(L);return B.set(m),o&&B.set(x,g),B};var ph=lN;var _7={},LE=new h,Dfe=new h,GKe=new h,Efe=new h,rl=[new h,new h],Ife=new h,Pfe=new h,Rfe=new h,WKe=new h,jKe=new h,qKe=new h,YKe=new h,XKe=new h,KKe=new h,ZKe=new h,Sfe=new Oe,vfe=new $;function Gz(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,LE),h.subtract(n,e,Dfe)),s=i===Mi.BEVELED?1:Math.ceil(r/P.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;o?u=$.fromQuaternion(Oe.fromAxisAngle(h.negate(e,LE),r/s,Sfe),vfe):u=$.fromQuaternion(Oe.fromAxisAngle(e,r/s,Sfe),vfe);let f=0;t=h.clone(t,LE);for(let d=0;d<s;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function $Ke(e){let t=Ife,n=Pfe,i=Rfe,o=e[1];n=h.fromArray(e[1],o.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let r=Gz(t,n,i,Mi.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(o,0,i),t=h.midpoint(n,i,t);let c=Gz(t,n,i,Mi.ROUNDED,!1);return[r,c]}function wfe(e,t,n,i){let o=LE;return i?o=h.add(e,t,o):(t=h.negate(t,t),o=h.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function p7(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,LE),a=h.negate(s,Dfe),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,GKe),p=h.add(d,a,Efe);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let g=h.add(d,s,Efe);r[u--]=g.z,r[u--]=g.y,r[u--]=g.x}return i.push(o,r),i}_7.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var QKe=new h,JKe=new h;_7.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Ife,c=Pfe,u=Rfe,f=WKe,d=jKe,p=qKe,g=YKe,m=XKe,x=KKe,b=ZKe,T=[],C=s?[]:void 0,A=s?[]:void 0,E=n[0],v=n[1];c=h.normalize(h.subtract(v,E,c),c),a=i.geodeticSurfaceNormal(E,a),f=h.normalize(h.cross(a,c,f),f),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),g=h.clone(E,g),E=v,u=h.negate(c,u);let D,O=[],R,M=n.length;for(R=1;R<M-1;R++){a=i.geodeticSurfaceNormal(E,a),v=n[R+1],c=h.normalize(h.subtract(v,E,c),c);let _=h.multiplyByScalar(a,h.dot(c,a),QKe);h.subtract(c,_,_),h.normalize(_,_);let S=h.multiplyByScalar(a,h.dot(u,a),JKe);if(h.subtract(u,S,S),h.normalize(S,S),!P.equalsEpsilon(Math.abs(h.dot(_,S)),1,P.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let I=o/Math.max(.25,h.magnitude(h.cross(d,u,LE))),L=ph.angleIsGreaterThanPi(c,u,E,i);d=h.multiplyByScalar(d,I,d),L?(m=h.add(E,d,m),b=h.add(m,h.multiplyByScalar(f,o,b),b),x=h.add(m,h.multiplyByScalar(f,o*2,x),x),rl[0]=h.clone(g,rl[0]),rl[1]=h.clone(b,rl[1]),D=Oi.generateArc({positions:rl,granularity:t,ellipsoid:i}),T=p7(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),p=h.clone(x,p),f=h.normalize(h.cross(a,c,f),f),x=h.add(m,h.multiplyByScalar(f,o*2,x),x),g=h.add(m,h.multiplyByScalar(f,o,g),g),r===Mi.ROUNDED||r===Mi.BEVELED?O.push({leftPositions:Gz(m,p,x,r,L)}):O.push({leftPositions:wfe(E,h.negate(d,d),x,L)})):(x=h.add(E,d,x),b=h.add(x,h.negate(h.multiplyByScalar(f,o,b),b),b),m=h.add(x,h.negate(h.multiplyByScalar(f,o*2,m),m),m),rl[0]=h.clone(g,rl[0]),rl[1]=h.clone(b,rl[1]),D=Oi.generateArc({positions:rl,granularity:t,ellipsoid:i}),T=p7(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(x,h.negate(h.multiplyByScalar(f,o*2,m),m),m),g=h.add(x,h.negate(h.multiplyByScalar(f,o,g),g),g),r===Mi.ROUNDED||r===Mi.BEVELED?O.push({rightPositions:Gz(x,p,m,r,L)}):O.push({rightPositions:wfe(E,d,m,L)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),rl[0]=h.clone(g,rl[0]),rl[1]=h.clone(E,rl[1]),D=Oi.generateArc({positions:rl,granularity:t,ellipsoid:i}),T=p7(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z));let N;return r===Mi.ROUNDED&&(N=$Ke(T)),{positions:T,corners:O,lefts:C,normals:A,endPositions:N}};var Gi=_7;var Lfe=new h,Nfe=new h,Wz=new h,jz=new h,eZe=new h,Ffe=new h,Zy=new h,NE=new h;function Bfe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function _h(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,Zy),Zy);r.normal&&Gi.addAttribute(s,t,i,o),r.tangent&&Gi.addAttribute(a,u,i,o),r.bitangent&&Gi.addAttribute(c,n,i,o)}function kfe(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new fn,u,f=0,d=0,p,g=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,g+=m*2,d+=i[p+1].length-3;for(f+=3,d+=3,p=0;p<o.length;p++){u=o[p];let Q=o[p].leftPositions;l(Q)?(m=Q.length,f+=m,g+=m):(m=o[p].rightPositions.length,d+=m,g+=m)}let x=l(r),b;x&&(b=r[0].length-3,f+=b,d+=b,b/=3,g+=b*6);let T=f+d,C=new Float64Array(T),A=t.normal?new Float32Array(T):void 0,E=t.tangent?new Float32Array(T):void 0,v=t.bitangent?new Float32Array(T):void 0,D={normals:A,tangents:E,bitangents:v},O=0,R=T-1,M,N,_,S,w=Lfe,I=Nfe,L,B,U=b/2,V=Ne.createTypedArray(T/3,g),G=0;if(x){B=Wz,L=jz;let Q=r[0];for(w=h.fromArray(a,0,w),I=h.fromArray(s,0,I),p=0;p<U;p++)B=h.fromArray(Q,(U-1-p)*3,B),L=h.fromArray(Q,(U+p)*3,L),Gi.addAttribute(C,L,O),Gi.addAttribute(C,B,void 0,R),_h(D,w,I,O,R,t),N=O/3,S=N+1,M=(R-2)/3,_=M-1,V[G++]=M,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=S,O+=3,R-=3}let k=0,W=0,j=i[k++],J=i[k++];C.set(j,O),C.set(J,R-J.length+1),I=h.fromArray(s,W,I);let q,K;for(m=J.length-3,p=0;p<m;p+=3)q=n.geodeticSurfaceNormal(h.fromArray(j,p,Zy),Zy),K=n.geodeticSurfaceNormal(h.fromArray(J,m-p,NE),NE),w=h.normalize(h.add(q,K,w),w),_h(D,w,I,O,R,t),N=O/3,S=N+1,M=(R-2)/3,_=M-1,V[G++]=M,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=S,O+=3,R-=3;for(q=n.geodeticSurfaceNormal(h.fromArray(j,m,Zy),Zy),K=n.geodeticSurfaceNormal(h.fromArray(J,m,NE),NE),w=h.normalize(h.add(q,K,w),w),W+=3,p=0;p<o.length;p++){let Q;u=o[p];let de=u.leftPositions,ye=u.rightPositions,ce,_e,xe=Ffe,De=Wz,Ae=jz;if(w=h.fromArray(a,W,w),l(de)){for(_h(D,w,I,void 0,R,t),R-=3,ce=S,_e=_,Q=0;Q<de.length/3;Q++)xe=h.fromArray(de,Q*3,xe),V[G++]=ce,V[G++]=_e-Q-1,V[G++]=_e-Q,Gi.addAttribute(C,xe,void 0,R),De=h.fromArray(C,(_e-Q-1)*3,De),Ae=h.fromArray(C,ce*3,Ae),I=h.normalize(h.subtract(De,Ae,I),I),_h(D,w,I,void 0,R,t),R-=3;xe=h.fromArray(C,ce*3,xe),De=h.subtract(h.fromArray(C,_e*3,De),xe,De),Ae=h.subtract(h.fromArray(C,(_e-Q)*3,Ae),xe,Ae),I=h.normalize(h.add(De,Ae,I),I),_h(D,w,I,O,void 0,t),O+=3}else{for(_h(D,w,I,O,void 0,t),O+=3,ce=_,_e=S,Q=0;Q<ye.length/3;Q++)xe=h.fromArray(ye,Q*3,xe),V[G++]=ce,V[G++]=_e+Q,V[G++]=_e+Q+1,Gi.addAttribute(C,xe,O),De=h.fromArray(C,ce*3,De),Ae=h.fromArray(C,(_e+Q)*3,Ae),I=h.normalize(h.subtract(De,Ae,I),I),_h(D,w,I,O,void 0,t),O+=3;xe=h.fromArray(C,ce*3,xe),De=h.subtract(h.fromArray(C,(_e+Q)*3,De),xe,De),Ae=h.subtract(h.fromArray(C,_e*3,Ae),xe,Ae),I=h.normalize(h.negate(h.add(Ae,De,I),I),I),_h(D,w,I,void 0,R,t),R-=3}for(j=i[k++],J=i[k++],j.splice(0,3),J.splice(J.length-3,3),C.set(j,O),C.set(J,R-J.length+1),m=J.length-3,W+=3,I=h.fromArray(s,W,I),Q=0;Q<J.length;Q+=3)q=n.geodeticSurfaceNormal(h.fromArray(j,Q,Zy),Zy),K=n.geodeticSurfaceNormal(h.fromArray(J,m-Q,NE),NE),w=h.normalize(h.add(q,K,w),w),_h(D,w,I,O,R,t),S=O/3,N=S-1,_=(R-2)/3,M=_+1,V[G++]=M,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=S,O+=3,R-=3;O-=3,R+=3}if(w=h.fromArray(a,a.length-3,w),_h(D,w,I,O,R,t),x){O+=3,R-=3,B=Wz,L=jz;let Q=r[1];for(p=0;p<U;p++)B=h.fromArray(Q,(b-p-1)*3,B),L=h.fromArray(Q,p*3,L),Gi.addAttribute(C,B,void 0,R),Gi.addAttribute(C,L,O),_h(D,w,I,O,R,t),S=O/3,N=S-1,_=(R-2)/3,M=_+1,V[G++]=M,V[G++]=N,V[G++]=_,V[G++]=_,V[G++]=N,V[G++]=S,O+=3,R-=3}if(c.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C}),t.st){let Q=new Float32Array(T/3*2),de,ye,ce=0;if(x){f/=3,d/=3;let _e=Math.PI/(b+1);ye=1/(f-b+1),de=1/(d-b+1);let xe,De=b/2;for(p=De+1;p<b+1;p++)xe=P.PI_OVER_TWO+_e*p,Q[ce++]=de*(1+Math.cos(xe)),Q[ce++]=.5*(1+Math.sin(xe));for(p=1;p<d-b+1;p++)Q[ce++]=p*de,Q[ce++]=0;for(p=b;p>De;p--)xe=P.PI_OVER_TWO-p*_e,Q[ce++]=1-de*(1+Math.cos(xe)),Q[ce++]=.5*(1+Math.sin(xe));for(p=De;p>0;p--)xe=P.PI_OVER_TWO-_e*p,Q[ce++]=1-ye*(1+Math.cos(xe)),Q[ce++]=.5*(1+Math.sin(xe));for(p=f-b;p>0;p--)Q[ce++]=p*ye,Q[ce++]=1;for(p=1;p<De+1;p++)xe=P.PI_OVER_TWO+_e*p,Q[ce++]=ye*(1+Math.cos(xe)),Q[ce++]=.5*(1+Math.sin(xe))}else{for(f/=3,d/=3,ye=1/(f-1),de=1/(d-1),p=0;p<d;p++)Q[ce++]=p*de,Q[ce++]=0;for(p=f;p>0;p--)Q[ce++]=(p-1)*ye,Q[ce++]=1}c.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:Q})}return t.normal&&(c.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.normals})),t.tangent&&(c.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.tangents})),t.bitangent&&(c.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.bitangents})),{attributes:c,indices:V}}function tZe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Lfe,m=Nfe,x=Wz,b=jz,T=eZe,C=Ffe,A=c;for(u=0;u<s;u+=3){let E=A+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+s,m),x=h.fromArray(n,(u+3)%s,x),m=h.subtract(m,g,m),x=h.subtract(x,g,x),b=h.normalize(h.cross(m,x,b),b),t.normal&&(Gi.addAttribute(f,b,E),Gi.addAttribute(f,b,E+3),Gi.addAttribute(f,b,A),Gi.addAttribute(f,b,A+3)),(t.tangent||t.bitangent)&&(C=h.fromArray(i,u,C),t.bitangent&&(Gi.addAttribute(p,C,E),Gi.addAttribute(p,C,E+3),Gi.addAttribute(p,C,A),Gi.addAttribute(p,C,A+3)),t.tangent&&(T=h.normalize(h.cross(C,b,T),T),Gi.addAttribute(d,T,E),Gi.addAttribute(d,T,E+3),Gi.addAttribute(d,T,A),Gi.addAttribute(d,T,A+3))),A+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let E=e.tangent.values;d.set(E),d.set(E,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],x=f[u+1];d[p++]=m,d[p++]=x,d[p++]=m,d[p++]=x}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function g7(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function nZe(e,t){let n=new Ie({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=Gi.computePositions(e),r=kfe(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=ri.scaleToGeodeticHeight(f,s,i),m=g7(f,0,m),g=ri.scaleToGeodeticHeight(g,a,i),m=g7(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=tZe(c,t);let x,b=d/3;if(e.shadowVolume){let M=c.normal.values;d=M.length;let N=new Float32Array(d*6);for(x=0;x<d;x++)M[x]=-M[x];N.set(M,d),N=g7(M,d*4,N),c.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:N}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let M=new Uint8Array(b*6);if(e.offsetAttribute===sn.TOP)M=M.fill(1,0,b).fill(1,b*2,b*4);else{let N=e.offsetAttribute===sn.NONE?0:1;M=M.fill(N)}c.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}let T=u.length,C=b+b,A=Ne.createTypedArray(p.length/3,T*2+C*3);A.set(u);let E=T;for(x=0;x<T;x+=3){let M=u[x],N=u[x+1],_=u[x+2];A[E++]=_+b,A[E++]=N+b,A[E++]=M+b}let v,D,O,R;for(x=0;x<C;x+=2)v=x+C,D=v+C,O=v+1,R=D+1,A[E++]=v,A[E++]=D,A[E++]=O,A[E++]=O,A[E++]=D,A[E++]=R;return{attributes:c,indices:A}}var Ofe=new h,uN=new h,ed=new fe;function Mfe(e,t,n,i,o,r){let s=h.subtract(t,e,Ofe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,uN),c=h.cross(s,a,Ofe);h.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,d=r.latitude,p=r.longitude;h.add(e,c,uN),n.cartesianToCartographic(uN,ed);let g=ed.latitude,m=ed.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,uN),n.cartesianToCartographic(uN,ed),g=ed.latitude,m=ed.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=d,r.longitude=p}var Jf=new h,fN=new h,jl=new fe,ql=new fe;function Vfe(e,t,n,i,o){e=Bfe(e,t);let r=Co(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new se;let a=n*.5;jl.latitude=Number.POSITIVE_INFINITY,jl.longitude=Number.POSITIVE_INFINITY,ql.latitude=Number.NEGATIVE_INFINITY,ql.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Mi.ROUNDED){let p=r[0];h.subtract(p,r[1],Jf),h.normalize(Jf,Jf),h.multiplyByScalar(Jf,a,Jf),h.add(p,Jf,fN),t.cartesianToCartographic(fN,ed),c=ed.latitude,u=ed.longitude,jl.latitude=Math.min(jl.latitude,c),jl.longitude=Math.min(jl.longitude,u),ql.latitude=Math.max(ql.latitude,c),ql.longitude=Math.max(ql.longitude,u)}for(let p=0;p<s-1;++p)Mfe(r[p],r[p+1],t,a,jl,ql);let f=r[s-1];h.subtract(f,r[s-2],Jf),h.normalize(Jf,Jf),h.multiplyByScalar(Jf,a,Jf),h.add(f,Jf,fN),Mfe(f,fN,t,a,jl,ql),i===Mi.ROUNDED&&(t.cartesianToCartographic(fN,ed),c=ed.latitude,u=ed.longitude,jl.latitude=Math.min(jl.latitude,c),jl.longitude=Math.min(jl.longitude,u),ql.latitude=Math.max(ql.latitude,c),ql.longitude=Math.max(ql.longitude,u));let d=l(o)?o:new se;return d.north=ql.latitude,d.south=jl.latitude,d.east=ql.longitude,d.west=jl.longitude,d}function U_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ee.packedLength+Ie.packedLength+7}U_.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Ufe=ee.clone(ee.UNIT_SPHERE),zfe=new Ie,V_={positions:void 0,ellipsoid:Ufe,vertexFormat:zfe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};U_.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)o[m]=h.unpack(e,t);let r=ee.unpack(e,t,Ufe);t+=ee.packedLength;let s=Ie.unpack(e,t,zfe);t+=Ie.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=o,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Ie.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(V_.positions=o,V_.width=a,V_.height=c,V_.extrudedHeight=u,V_.cornerType=f,V_.granularity=d,V_.shadowVolume=p,V_.offsetAttribute=g===-1?void 0:g,new U_(V_))};U_.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,o=y(e.ellipsoid,ee.default),r=y(e.cornerType,Mi.ROUNDED);return Vfe(n,o,i,r,t)};U_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Bfe(t,i);let o=Co(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=nZe(u,c);else{let g=Gi.computePositions(u);if(f=kfe(g,c,i),f.attributes.position.values=ri.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let m=e._offsetAttribute===sn.NONE?0:1,x=f.attributes.position.values.length,b=new Uint8Array(x/3).fill(m);f.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let d=f.attributes,p=ae.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new at({attributes:d,indices:f.indices,primitiveType:Me.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};U_.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new U_({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(U_.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Vfe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var Qb=U_;var Hfe=new h,Gfe=new h,iZe=new h;function oZe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Wfe(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new fn,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){a=o[f];let L=o[f].leftPositions;l(L)?(p=L.length,c+=p,d+=p/3*2):(p=o[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(r),m;g&&(m=r[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let x=c+u,b=new Float64Array(x),T=0,C=x-1,A,E,v,D,O,R,M=m/2,N=Ne.createTypedArray(x/3,d+4),_=0;if(N[_++]=T/3,N[_++]=(C-2)/3,g){n.push(T/3),R=Hfe,O=Gfe;let L=r[0];for(f=0;f<M;f++)R=h.fromArray(L,(M-1-f)*3,R),O=h.fromArray(L,(M+f)*3,O),Gi.addAttribute(b,O,T),Gi.addAttribute(b,R,void 0,C),E=T/3,D=E+1,A=(C-2)/3,v=A-1,N[_++]=A,N[_++]=v,N[_++]=E,N[_++]=D,T+=3,C-=3}let S=0,w=i[S++],I=i[S++];for(b.set(w,T),b.set(I,C-I.length+1),p=I.length-3,n.push(T/3,(C-2)/3),f=0;f<p;f+=3)E=T/3,D=E+1,A=(C-2)/3,v=A-1,N[_++]=A,N[_++]=v,N[_++]=E,N[_++]=D,T+=3,C-=3;for(f=0;f<o.length;f++){let L;a=o[f];let B=a.leftPositions,U=a.rightPositions,V,G=iZe;if(l(B)){for(C-=3,V=v,n.push(D),L=0;L<B.length/3;L++)G=h.fromArray(B,L*3,G),N[_++]=V-L-1,N[_++]=V-L,Gi.addAttribute(b,G,void 0,C),C-=3;n.push(V-Math.floor(B.length/6)),t===Mi.BEVELED&&n.push((C-2)/3+1),T+=3}else{for(T+=3,V=D,n.push(v),L=0;L<U.length/3;L++)G=h.fromArray(U,L*3,G),N[_++]=V+L,N[_++]=V+L+1,Gi.addAttribute(b,G,T),T+=3;n.push(V+Math.floor(U.length/6)),t===Mi.BEVELED&&n.push(T/3-1),C-=3}for(w=i[S++],I=i[S++],w.splice(0,3),I.splice(I.length-3,3),b.set(w,T),b.set(I,C-I.length+1),p=I.length-3,L=0;L<I.length;L+=3)D=T/3,E=D-1,v=(C-2)/3,A=v+1,N[_++]=A,N[_++]=v,N[_++]=E,N[_++]=D,T+=3,C-=3;T-=3,C+=3,n.push(T/3,(C-2)/3)}if(g){T+=3,C-=3,R=Hfe,O=Gfe;let L=r[1];for(f=0;f<M;f++)R=h.fromArray(L,(m-f-1)*3,R),O=h.fromArray(L,f*3,O),Gi.addAttribute(b,R,void 0,C),Gi.addAttribute(b,O,T),D=T/3,E=D-1,v=(C-2)/3,A=v+1,N[_++]=A,N[_++]=v,N[_++]=E,N[_++]=D,T+=3,C-=3;n.push(T/3)}else n.push(T/3,(C-2)/3);return N[_++]=T/3,N[_++]=(C-2)/3,s.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:s,indices:N,wallIndices:n}}function rZe(e){let t=e.ellipsoid,n=Gi.computePositions(e),i=Wfe(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=ri.scaleToGeodeticHeight(u,r,t),d=ri.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let A=new Uint8Array(f*2);if(e.offsetAttribute===sn.TOP)A=A.fill(1,0,f);else{let E=e.offsetAttribute===sn.NONE?0:1;A=A.fill(E)}a.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}let g,m=c.length,x=Ne.createTypedArray(p.length/3,(m+o.length)*2);x.set(c);let b=m;for(g=0;g<m;g+=2){let A=c[g],E=c[g+1];x[b++]=A+f,x[b++]=E+f}let T,C;for(g=0;g<o.length;g++)T=o[g],C=T+f,x[b++]=T,x[b++]=C;return{attributes:a,indices:x}}function dN(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ee.packedLength+6}dN.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var jfe=ee.clone(ee.UNIT_SPHERE),$y={positions:void 0,ellipsoid:jfe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};dN.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)o[p]=h.unpack(e,t);let r=ee.unpack(e,t,jfe);t+=ee.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=o,n._ellipsoid=ee.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):($y.positions=o,$y.width=s,$y.height=a,$y.extrudedHeight=c,$y.cornerType=u,$y.granularity=f,$y.offsetAttribute=d===-1?void 0:d,new dN($y))};dN.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=oZe(t,i);let o=Co(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=rZe(c);else{let p=Gi.computePositions(c);if(u=Wfe(p,c.cornerType),u.attributes.position.values=ri.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===sn.NONE?0:1,x=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let f=u.attributes,d=ae.fromVertices(f.position.values,void 0,3);return new at({attributes:f,indices:u.indices,primitiveType:Me.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var hN=dN;var sZe=new Kn(0);function sl(e){ni.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(sl.prototype=Object.create(ni.prototype),sl.prototype.constructor=sl);Object.defineProperties(sl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});sl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Wc.isSupported(this._scene)};sl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};sl.prototype._computeCenter=he.throwInstantiationError;sl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ni.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&yt(yt.geometryZIndex),this._zIndex=y(o.zIndex,sZe),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new jd(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Xx(this._scene,a,r,s)}};sl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ni.prototype.destroy.call(this)};sl.getGeometryHeight=function(e,t){if(!l(e)){t!==Ye.NONE&&yt(yt.geometryHeightReference);return}return wf(t)?0:e};sl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==Ye.NONE&&yt(yt.geometryExtrudedHeightReference);return}return wf(t)?sl.CLAMP_TO_GROUND:e};sl.CLAMP_TO_GROUND="clamp";sl.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=Ye.NONE),(!l(n)||!l(i))&&(i=Ye.NONE);let o=0;if(t!==Ye.NONE&&o++,i===Ye.RELATIVE_TO_GROUND&&o++,o===2)return sn.ALL;if(o===1)return sn.TOP};var Wn=sl;var qfe=new H,Yfe=h.ZERO,Xfe=new h,Kfe=new se;function aZe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function gh(e,t){Wn.call(this,{entity:e,scene:t,geometryOptions:new aZe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(gh.prototype=Object.create(Wn.prototype),gh.prototype.constructor=gh);gh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,qfe)),l(o)||(o=H.WHITE),i.color=Wt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Yfe,Xfe))),new vt({id:t,geometry:new Qb(this._options),attributes:i})};gh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,qfe),o={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Yfe,Xfe))),new vt({id:t,geometry:new hN(this._options),attributes:o})};gh.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};gh.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||ni.prototype._isHidden.call(this,e,t)};gh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.width)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.cornerType)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};gh.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrUndefined(t.height,He.MINIMUM_VALUE),i=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),o=Y.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),r=Y.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof zt?cn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(He.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(He.MINIMUM_VALUE),s.granularity=Y.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),s.cornerType=Y.getValueOrUndefined(t.cornerType,He.MINIMUM_VALUE),s.offsetAttribute=Wn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Wn.getGeometryHeight(n,i),o=Wn.getGeometryExtrudedHeight(o,r),o===Wn.CLAMP_TO_GROUND&&(o=li.getMinimumMaximumHeights(Qb.computeRectangle(s,Kfe)).minimumTerrainHeight),s.extrudedHeight=o};gh.DynamicGeometryUpdater=FE;function FE(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(FE.prototype=Object.create(ti.prototype),FE.prototype.constructor=FE);FE.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ti.prototype._isHidden.call(this,e,t,n)};FE.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.positions=Y.getValueOrUndefined(t.positions,n),i.width=Y.getValueOrUndefined(t.width,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.cornerType=Y.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Wn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Wn.getGeometryHeight(o,r),s=Wn.getGeometryExtrudedHeight(s,a),s===Wn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(Qb.computeRectangle(i,Kfe)).minimumTerrainHeight),i.extrudedHeight=s};var mN=gh;function qz(){he.throwInstantiationError()}Object.defineProperties(qz.prototype,{name:{get:he.throwInstantiationError},clock:{get:he.throwInstantiationError},entities:{get:he.throwInstantiationError},isLoading:{get:he.throwInstantiationError},changedEvent:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},loadingEvent:{get:he.throwInstantiationError},show:{get:he.throwInstantiationError},clustering:{get:he.throwInstantiationError}});qz.prototype.update=function(e){he.throwInstantiationError()};qz.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var qr=qz;function Om(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Om.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Zfe=new h;Om.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Zfe);return x7(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Om.prototype.isScaledSpacePointVisible=function(e){return x7(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var cZe=new h;Om.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=cZe,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),x7(e,o,i)};Om.prototype.computeHorizonCullingPoint=function(e,t,n){return Jfe(this._ellipsoid,e,t,n)};var $fe=ee.clone(ee.UNIT_SPHERE);Om.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Qfe(this._ellipsoid,n,$fe);return Jfe(o,e,t,i)};Om.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return ede(this._ellipsoid,e,t,n,i,o)};Om.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Qfe(this._ellipsoid,o,$fe);return ede(s,e,t,n,i,r)};var lZe=[];Om.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=se.subsample(e,t,0,lZe),o=ae.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var uZe=new h;function Qfe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,uZe);e=ee.fromCartesian3(i,n)}return e}function Jfe(e,t,n,i){l(i)||(i=new h);let o=ide(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=tde(e,c,o);if(u<0)return;r=Math.max(r,u)}return nde(o,r,i)}var Yz=new h;function ede(e,t,n,i,o,r){l(r)||(r=new h),i=y(i,3),o=y(o,h.ZERO);let s=ide(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){Yz.x=n[c]+o.x,Yz.y=n[c+1]+o.y,Yz.z=n[c+2]+o.z;let f=tde(e,Yz,s);if(f<0)return;a=Math.max(a,f)}return nde(s,a,r)}function x7(e,t,n){let i=t,o=n,r=h.subtract(e,i,Zfe),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var fZe=new h,dZe=new h;function tde(e,t,n){let i=e.transformPositionToScaledSpace(t,fZe),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,dZe);o=Math.max(1,o),r=Math.max(1,r);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-c*f)}function nde(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var y7=new h;function ide(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,y7),h.normalize(y7,y7))}var z_=Om;function Dr(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=Lt.clone(o)),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._color=H.clone(y(e.color,H.WHITE)),this._outlineColor=H.clone(y(e.outlineColor,H.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=y(e.splitDirection,Br.NONE)}var ode=Dr.SHOW_INDEX=0,ade=Dr.POSITION_INDEX=1,hZe=Dr.COLOR_INDEX=2,mZe=Dr.OUTLINE_COLOR_INDEX=3,pZe=Dr.OUTLINE_WIDTH_INDEX=4,_Ze=Dr.PIXEL_SIZE_INDEX=5,gZe=Dr.SCALE_BY_DISTANCE_INDEX=6,yZe=Dr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,xZe=Dr.DISTANCE_DISPLAY_CONDITION_INDEX=8,bZe=Dr.DISABLE_DEPTH_DISTANCE_INDEX=9,TZe=Dr.SPLIT_DIRECTION_INDEX=10;Dr.NUMBER_OF_PROPERTIES=11;function Nu(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Dr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Nu(this,ode))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Nu(this,ade))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),Nu(this,gZe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),Nu(this,yZe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Nu(this,_Ze))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),Nu(this,hZe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;H.equals(t,e)||(H.clone(e,t),Nu(this,mZe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Nu(this,pZe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Lt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),Nu(this,xZe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Nu(this,bZe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Nu(this,ode))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Nu(this,TZe))}}});Dr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Dr.prototype._getActualPosition=function(){return this._actualPosition};Dr.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Nu(this,ade)};var rde=new oe;Dr._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(F.multiplyByPoint(n,e,rde),zi.computeActualEllipsoidPosition(t,rde))};var sde=new oe;Dr._computeScreenSpacePosition=function(e,t,n,i){let o=F.multiplyByVector(e,oe.fromElements(t.x,t.y,t.z,1,sde),sde);return zi.worldToWindowCoordinates(n,o,i)};Dr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new z);let i=n.modelMatrix,o=Dr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Dr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new je),n.x=r,n.y=s,n.width=a,n.height=c,n};Dr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&H.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&H.equals(this._outlineColor,e._outlineColor)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Dr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ps=Dr;var CZe=Ps.SHOW_INDEX,C7=Ps.POSITION_INDEX,cde=Ps.COLOR_INDEX,AZe=Ps.OUTLINE_COLOR_INDEX,EZe=Ps.OUTLINE_WIDTH_INDEX,SZe=Ps.PIXEL_SIZE_INDEX,lde=Ps.SCALE_BY_DISTANCE_INDEX,ude=Ps.TRANSLUCENCY_BY_DISTANCE_INDEX,fde=Ps.DISTANCE_DISPLAY_CONDITION_INDEX,vZe=Ps.DISABLE_DEPTH_DISTANCE_INDEX,wZe=Ps.SPLIT_DIRECTION_INDEX,A7=Ps.NUMBER_OF_PROPERTIES,Tc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function td(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(A7),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,vo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(td.prototype,{length:{get:function(){return E7(this),this._pointPrimitives.length}}});function dde(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}td.prototype.add=function(e){let t=new Ps(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};td.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};td.prototype.removeAll=function(){dde(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function E7(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}td.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};td.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};td.prototype.get=function(e){return E7(this),this._pointPrimitives[e]};td.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<A7;++i){let o=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function DZe(e,t,n){return new Mp(e,[{index:Tc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[C7]},{index:Tc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[C7]},{index:Tc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[cde]},{index:Tc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[ude]},{index:Tc.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[lde]},{index:Tc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[fde]}],t)}var b7=new Gn;function hde(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Gn.fromCartesian(r,b7);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[Tc.positionHighAndSize],u=b7.high;c(o,u.x,u.y,u.z,s);let f=n[Tc.positionLowAndOutline],d=b7.low;f(o,d.x,d.y,d.z,a)}var Xz=65536,pN=256;function mde(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=H.floatToByte(r.red),u=H.floatToByte(r.green),f=H.floatToByte(r.blue),d=c*Xz+u*pN+f;c=H.floatToByte(a.red),u=H.floatToByte(a.green),f=H.floatToByte(a.blue);let p=c*Xz+u*pN+f;c=H.floatToByte(s.red),u=H.floatToByte(s.green),f=H.floatToByte(s.blue);let g=c*Xz+u*pN+f,m=H.floatToByte(r.alpha)*Xz+H.floatToByte(a.alpha)*pN+H.floatToByte(s.alpha),x=n[Tc.compressedAttribute0];x(o,d,p,g,m)}function pde(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*pN+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[Tc.compressedAttribute1];g(o,d,p,r,a)}function _de(e,t,n,i){let o=i._index,r=n[Tc.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,u)}function gde(e,t,n,i){let o=i._index,r=n[Tc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),r(o,s,a,u,f)}function IZe(e,t,n,i){hde(e,t,n,i),mde(e,t,n,i),pde(e,t,n,i),_de(e,t,n,i),gde(e,t,n,i)}function T7(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Ps._computeActualPosition(f,i,o);l(d)&&(u._setActualPosition(d),r?a.push(d):ae.expand(s,d,s))}r&&ae.fromPoints(a,s)}function PZe(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&T7(e,i,i.length,t,r,!0)):n===ne.MORPHING?T7(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&T7(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function RZe(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var OZe=[];td.prototype.update=function(e){if(E7(this),!this.show)return;this._maxTotalPointSize=Nt.maximumAliasedPointSize,PZe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<A7;++v)r[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=DZe(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let D=this._pointPrimitives[v];D._dirty=!1,IZe(this,c,a,D)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let v=OZe;v.length=0,(r[C7]||r[EZe]||r[SZe])&&v.push(hde),(r[cde]||r[AZe])&&v.push(mde),(r[CZe]||r[ude])&&v.push(pde),r[lde]&&v.push(_de),(r[fde]||r[vZe]||r[wZe])&&v.push(gde);let D=v.length;if(a=this._vaf.writers,o/n>.1){for(let O=0;O<o;++O){let R=i[O];R._dirty=!1;for(let M=0;M<D;++M)v[M](this,c,a,R)}this._vaf.commit()}else{for(let O=0;O<o;++O){let R=i[O];R._dirty=!1;for(let M=0;M<D;++M)v[M](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=F.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,d=ae.clone(this._baseVolumeWC,this._boundingVolume)):d=ae.clone(this._baseVolume2D,this._boundingVolume),RZe(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===vo.OPAQUE||this._blendOption===vo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===vo.TRANSLUCENT||this._blendOption===vo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Ue({sources:[FP]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===vo.OPAQUE_AND_TRANSLUCENT&&(x=new Ue({defines:["OPAQUE"],sources:[qg]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Tc}),x=new Ue({defines:["TRANSLUCENT"],sources:[qg]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Tc})),this._blendOption===vo.OPAQUE&&(x=new Ue({sources:[qg]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Tc})),this._blendOption===vo.TRANSLUCENT&&(x=new Ue({sources:[qg]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:Tc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,T,C,A,E=e.commandList;if(u.render||f){let v=this._colorCommands,D=this._blendOption===vo.OPAQUE,O=this._blendOption===vo.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,T=b.length,v.length=T;let R=O?T*2:T;for(A=0;A<R;++A){let M=D||O&&A%2===0;C=v[A],l(C)||(C=v[A]=new Ze),C.primitiveType=Me.POINTS,C.pass=M||!O?we.OPAQUE:we.TRANSLUCENT,C.owner=this;let N=O?Math.floor(A/2):A;C.boundingVolume=d,C.modelMatrix=p,C.shaderProgram=M?this._sp:this._spTranslucent,C.uniformMap=this._uniforms,C.vertexArray=b[N].va,C.renderState=M?this._rsOpaque:this._rsTranslucent,C.debugShowBoundingVolume=this.debugShowBoundingVolume,C.pickId="v_pickColor",E.push(C)}}};td.prototype.isDestroyed=function(){return!1};td.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),dde(this._pointPrimitives),ue(this)};var BE=td;var yde=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],S7=1,_N=8,yN=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==S7)throw new Error(`Got v${o} data when expected v${S7}.`);let r=yde[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=yde.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,_N,t),this.coords=new this.ArrayType(this.data,_N+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(_N+s+a+c),this.ids=new this.IndexArrayType(this.data,_N,t),this.coords=new this.ArrayType(this.data,_N+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(S7<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return w7(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,d=c.pop()||0,p=c.pop()||0;if(d-p<=a){for(let b=p;b<=d;b++){let T=s[2*b],C=s[2*b+1];T>=t&&T<=i&&C>=n&&C<=o&&u.push(r[b])}continue}let g=p+d>>1,m=s[2*g],x=s[2*g+1];m>=t&&m<=i&&x>=n&&x<=o&&u.push(r[g]),(f===0?t<=m:n<=x)&&(c.push(p),c.push(g-1),c.push(1-f)),(f===0?i>=m:o>=x)&&(c.push(g+1),c.push(d),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let b=p;b<=d;b++)xde(r[2*b],r[2*b+1],t,n)<=u&&c.push(o[b]);continue}let g=p+d>>1,m=r[2*g],x=r[2*g+1];xde(m,x,t,n)<=u&&c.push(o[g]),(f===0?t-i<=m:n-i<=x)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=m:n+i>=x)&&(a.push(g+1),a.push(d),a.push(1-f))}return c}};function w7(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;bde(e,t,s,i,o,r),w7(e,t,n,i,s-1,1-r),w7(e,t,n,s+1,o,1-r)}function bde(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),x=Math.min(o,Math.floor(n+(u-f)*p/u+g));bde(e,t,n,m,x,r)}let s=t[2*n+r],a=i,c=o;for(gN(e,t,i,n),t[2*o+r]>s&&gN(e,t,i,o);a<c;){for(gN(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?gN(e,t,i,c):(c++,gN(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function gN(e,t,n,i){v7(e,n,i),v7(t,2*n,2*i),v7(t,2*n+1,2*i+1)}function v7(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function xde(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function yh(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new me,this.show=y(e.show,!0)}function Tde(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var MZe=new je;function Cde(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Vy.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=lo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ps.getScreenSpaceBoundingBox(e,t,o)),Tde(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Ede(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Vy.getScreenSpaceBoundingBox(s,t,MZe);Tde(a,n),o=je.union(o,a,o)}return o}function LZe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Ede(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Ade(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function Ede(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function D7(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===ne.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),u=o._clusterBillboards&&l(a.id._billboard),f=o._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var NZe=new je,FZe=new je,BZe=new je;function kZe(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new wm({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Ru({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new BE;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,x=n.ellipsoid,b=n.camera.positionWC,T=new z_(x,b),C=[];e._clusterLabels&&D7(i,C,n,T,e),e._clusterBillboards&&D7(o,C,n,T,e),e._clusterPoints&&D7(r,C,n,T,e);let A,E,v,D,O,R,M,N,_,S,w,I;if(C.length>0){let L=new yN(C.length,64,Uint32Array);for(let B=0;B<C.length;++B)L.add(C[B].coord.x,C[B].coord.y);if(L.finish(),m<g)for(v=d.length,A=0;A<v;++A){let B=d[A];if(!T.isPointVisible(B.position))continue;let U=lo._computeScreenSpacePosition(F.IDENTITY,B.position,h.ZERO,z.ZERO,n);if(!l(U))continue;let V=1-m/g,G=B.width=B.width*V,k=B.height=B.height*V;G=Math.max(G,B.minimumWidth),k=Math.max(k,B.minimumHeight);let W=U.x-G*.5,j=U.y-k*.5,J=U.x+G,q=U.y+k;for(O=L.range(W,j,J,q),R=O.length,S=0,_=[],E=0;E<R;++E)M=O[E],N=C[M],N.clustered||(++S,w=N.collection,I=N.index,_.push(w.get(I).id));if(S>=f)for(Ade(B.position,S,_,e),p.push(B),E=0;E<R;++E)C[O[E]].clustered=!0}for(v=C.length,A=0;A<v;++A){let B=C[A];if(B.clustered)continue;B.clustered=!0,w=B.collection,I=B.index;let U=w.get(I);D=Cde(U,B.coord,u,e,NZe);let V=je.clone(D,FZe);O=L.range(D.x,D.y,D.x+D.width,D.y+D.height),R=O.length;let G=h.clone(U.position);for(S=1,_=[U.id],E=0;E<R;++E)if(M=O[E],N=C[M],!N.clustered){let k=N.collection.get(N.index),W=Cde(k,N.coord,u,e,BZe);h.add(k.position,G,G),je.union(V,W,V),++S,_.push(k.id)}if(S>=f){let k=h.multiplyByScalar(G,1/S,G);for(Ade(k,S,_,e),p.push({position:k,width:V.width,height:V.height,minimumWidth:D.width,minimumHeight:D.height}),E=0;E<R;++E)C[O[E]].clustered=!0}else LZe(U,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}yh.prototype._initialize=function(e){this._scene=e;let t=kZe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(yh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function P7(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function R7(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}yh.prototype.getLabel=P7("_labelCollection",wm,"_unusedLabelIndices","labelIndex");yh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,R7(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};yh.prototype.getBillboard=P7("_billboardCollection",Ru,"_unusedBillboardIndices","billboardIndex");yh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,R7(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};yh.prototype.getPoint=P7("_pointCollection",BE,"_unusedPointIndices","pointIndex");yh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,R7(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function I7(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function VZe(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,I7(e._labelCollection),I7(e._billboardCollection),I7(e._pointCollection))}yh.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,VZe(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};yh.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Fu=yh;function O7(e){this._name=e,this._clock=void 0,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._entityCollection=new $s(this),this._entityCluster=new Fu}Object.defineProperties(O7.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){qr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});O7.prototype.update=function(e){return!0};var xN=O7;var Sde={};Sde.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=o?a*3:0,m=o?(a+i)*3:i*3;for(f=0;f<i;f++){let x=f/i*P.TWO_PI,b=Math.cos(x),T=Math.sin(x),C=b*n,A=T*n,E=b*t,v=T*t;u[p+g]=C,u[p+g+1]=A,u[p+g+2]=s,u[p+m]=E,u[p+m+1]=v,u[p+m+2]=r,p+=3,o&&(u[d++]=C,u[d++]=A,u[d++]=s,u[d++]=E,u[d++]=v,u[d++]=r)}return u};var Jb=Sde;var M7=new z,UZe=new h,zZe=new h,HZe=new h,GZe=new h;function H_(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Ie.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}H_.packedLength=Ie.packedLength+5;H_.pack=function(e,t,n){return n=y(n,0),Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var vde=new Ie,kE={vertexFormat:vde,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};H_.unpack=function(e,t,n){t=y(t,0);let i=Ie.unpack(e,t,vde);t+=Ie.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(kE.length=o,kE.topRadius=r,kE.bottomRadius=s,kE.slices=a,kE.offsetAttribute=c===-1?void 0:c,new H_(kE))};H_.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,u=Jb.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,d=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,g=o.bitangent?new Float32Array(c*3):void 0,m,x=o.normal||o.tangent||o.bitangent;if(x){let O=o.tangent||o.bitangent,R=0,M=0,N=0,_=Math.atan2(i-n,t),S=UZe;S.z=Math.sin(_);let w=Math.cos(_),I=HZe,L=zZe;for(m=0;m<r;m++){let B=m/r*P.TWO_PI,U=w*Math.cos(B),V=w*Math.sin(B);x&&(S.x=U,S.y=V,O&&(I=h.normalize(h.cross(h.UNIT_Z,S,I),I)),o.normal&&(d[R++]=S.x,d[R++]=S.y,d[R++]=S.z,d[R++]=S.x,d[R++]=S.y,d[R++]=S.z),o.tangent&&(p[M++]=I.x,p[M++]=I.y,p[M++]=I.z,p[M++]=I.x,p[M++]=I.y,p[M++]=I.z),o.bitangent&&(L=h.normalize(h.cross(S,I,L),L),g[N++]=L.x,g[N++]=L.y,g[N++]=L.z,g[N++]=L.x,g[N++]=L.y,g[N++]=L.z))}for(m=0;m<r;m++)o.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),o.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),o.bitangent&&(g[N++]=0,g[N++]=-1,g[N++]=0);for(m=0;m<r;m++)o.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),o.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),o.bitangent&&(g[N++]=0,g[N++]=1,g[N++]=0)}let b=12*r-12,T=Ne.createTypedArray(c,b),C=0,A=0;for(m=0;m<r-1;m++)T[C++]=A,T[C++]=A+2,T[C++]=A+3,T[C++]=A,T[C++]=A+3,T[C++]=A+1,A+=2;for(T[C++]=s-2,T[C++]=0,T[C++]=1,T[C++]=s-2,T[C++]=1,T[C++]=s-1,m=1;m<r-1;m++)T[C++]=s+m+1,T[C++]=s+m,T[C++]=s;for(m=1;m<r-1;m++)T[C++]=a,T[C++]=a+m,T[C++]=a+m+1;let E=0;if(o.st){let O=Math.max(n,i);for(m=0;m<c;m++){let R=h.fromArray(u,m*3,GZe);f[E++]=(R.x+O)/(2*O),f[E++]=(R.y+O)/(2*O)}}let v=new fn;o.position&&(v.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(v.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:d})),o.tangent&&(v.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(v.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(v.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),M7.x=t*.5,M7.y=Math.max(i,n);let D=new ae(h.ZERO,z.magnitude(M7));if(l(e._offsetAttribute)){t=u.length;let O=e._offsetAttribute===sn.NONE?0:1,R=new Uint8Array(t/3).fill(O);v.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new at({attributes:v,indices:T,primitiveType:Me.TRIANGLES,boundingSphere:D,offsetAttribute:e._offsetAttribute})};var L7;H_.getUnitCylinder=function(){return l(L7)||(L7=H_.createGeometry(new H_({topRadius:1,bottomRadius:1,length:1,vertexFormat:Ie.POSITION_ONLY}))),L7};var bN=H_;var N7=new z;function VE(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.slices,128),r=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}VE.packedLength=6;VE.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var eT={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};VE.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(eT.length=i,eT.topRadius=o,eT.bottomRadius=r,eT.slices=s,eT.numberOfVerticalLines=a,eT.offsetAttribute=c===-1?void 0:c,new VE(eT))};VE.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=Jb.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let x=Math.min(r,o);u=Math.round(o/x),c+=x}let f=Ne.createTypedArray(s,c*2),d=0,p;for(p=0;p<o-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+o,f[d++]=p+1+o;if(f[d++]=o-1,f[d++]=0,f[d++]=o+o-1,f[d++]=o,r>0)for(p=0;p<o;p+=u)f[d++]=p,f[d++]=p+o;let g=new fn;g.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:a}),N7.x=t*.5,N7.y=Math.max(i,n);let m=new ae(h.ZERO,z.magnitude(N7));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===sn.NONE?0:1,b=new Uint8Array(t/3).fill(x);g.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}return new at({attributes:g,indices:f,primitiveType:Me.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var TN=VE;var wde=h.ZERO,Dde=new h,WZe=new h,Ide=new H;function jZe(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Bu(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new jZe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Bu.prototype=Object.create(ni.prototype),Bu.prototype.constructor=Bu);Object.defineProperties(Bu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Bu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof zt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Ide)),l(a)||(a=H.WHITE),s.color=Wt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,wde,Dde))),new vt({id:t,geometry:new bN(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Bu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Ide),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,wde,Dde))),new vt({id:t,geometry:new TN(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Bu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};Bu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||ni.prototype._isHidden.call(this,e,t)};Bu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!Y.isConstant(t.slices)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.numberOfVerticalLines)};Bu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof zt?cn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(He.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(He.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(He.MINIMUM_VALUE),i.slices=Y.getValueOrUndefined(t.slices,He.MINIMUM_VALUE),i.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,He.MINIMUM_VALUE),i.offsetAttribute=n!==Ye.NONE?sn.ALL:void 0};Bu.prototype._onEntityPropertyChanged=qp;Bu.DynamicGeometryUpdater=UE;function UE(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(UE.prototype=Object.create(ti.prototype),UE.prototype.constructor=UE);UE.prototype._isHidden=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(e.position,n,WZe);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ti.prototype._isHidden.call(this,e,t,n)};UE.prototype._setOptions=function(e,t,n){let i=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),o=this._options;o.length=Y.getValueOrUndefined(t.length,n),o.topRadius=Y.getValueOrUndefined(t.topRadius,n),o.bottomRadius=Y.getValueOrUndefined(t.bottomRadius,n),o.slices=Y.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Ye.NONE?sn.ALL:void 0};var CN=Bu;var qZe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Yr=Object.freeze(qZe);var YZe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},po=Object.freeze(YZe);var XZe={NONE:0,HOLD:1,EXTRAPOLATE:2},ku=Object.freeze(XZe);var Pde=Ko(uu(),1);function KZe(e){let t=new Pde.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var G_=KZe;var ZZe=P.factorial;function F7(e,t,n,i,o,r){let s=0,a,c,u;if(i>0){for(c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(r.push(c),s+=F7(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var Kz={type:"Hermite"};Kz.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};Kz.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,u,f,d=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let b=new Array(d);for(p[r]=b,s=0;s<d;s++)b[s]=[]}let g=d,m=new Array(g);for(r=0;r<g;r++)m[r]=r;let x=d-1;for(c=0;c<i;c++){for(s=0;s<g;s++)f=m[s]*i+c,p[c][0].push(n[f]);for(r=1;r<g;r++){let b=!1;for(s=0;s<g-r;s++){let T=t[m[s]],C=t[m[s+r]],A;C-T<=0?(f=m[s]*i+i*r+c,A=n[f],p[c][r].push(A/ZZe(r))):(A=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(A/(C-T))),b=b||A!==0}b||(x=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=x;r++){let b=F7(e,m,t,a,r,[]);for(c=0;c<i;c++){let T=p[c][r][0];o[c+a*i]+=T*b}}return o};var $Ze=[];Kz.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let T=0;T<a;T++)s[T]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let T=0;T<o+1;T++)u[f*(o+1)+T]=f;let d=u.length,p=$Ze,g=QZe(p,u,t,n,i,o),m=[],x=d*(d+1)/2,b=Math.min(g,r);for(let T=0;T<=b;T++)for(f=T;f<=g;f++){m.length=0;let C=F7(e,u,t,T,f,m),A=Math.floor(f*(1-f)/2)+d*f;for(let E=0;E<i;E++){let v=Math.floor(E*x),D=p[v+A];s[E+T*i]+=D*C}}return s};function QZe(e,t,n,i,o,r){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<o;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,x=Math.floor(g*(1-g)/2)+u*g,b=!1;for(s=0;s<u-g;s++){let T=n[t[s]],C=n[t[s+g]],A,E;if(C-T<=0)a=t[s]*o*(r+1)+o*g+d,A=i[a],E=A/P.factorial(g),e[p+x+m]=E,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);A=e[p+v+s+1]-e[p+v+s],E=A/(C-T),e[p+x+m]=E,m++}b=b||A!==0}b&&(c=Math.max(c,g))}}return c}var AN=Kz;var B7={type:"Lagrange"};B7.getRequiredDataPoints=function(e){return Math.max(e+1,2)};B7.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let u=t[r]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var EN=B7;var k7={type:"Linear"};k7.getRequiredDataPoints=function(e){return 2};k7.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],u=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-c*a)/(u-c);return o};var tT=k7;function Cc(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}Cc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new Cc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};Cc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Cc(e.clock,e.cone,e.magnitude)};Cc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Cc(e.clock,e.cone,1)};Cc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Cc.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};Cc.prototype.equals=function(e){return Cc.equals(this,e)};Cc.prototype.clone=function(e){return Cc.clone(this,e)};Cc.prototype.equalsEpsilon=function(e,t){return Cc.equalsEpsilon(this,e,t)};Cc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var SN=Cc;var PN=Ko(uu(),1);var V7;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?V7=function(){return performance.now()}:V7=function(){return Date.now()};var bi=V7;function U7(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=Z.clone(t):l(n)?t=Z.clone(n):l(i)?t=Z.addDays(i,-1,new Z):t=Z.now(),l(n)?n=Z.clone(n):n=Z.clone(t),l(i)?i=Z.clone(i):i=Z.addDays(n,1,new Z),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,Yr.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new me,this.onStop=new me,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=bi(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,po.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(U7.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Z.equals(this._currentTime,e)||(this._clockStep===po.SYSTEM_CLOCK&&(this._clockStep=po.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===po.SYSTEM_CLOCK&&(this._clockStep=po.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===po.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=Z.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===po.SYSTEM_CLOCK&&(this._clockStep=po.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});U7.prototype.tick=function(){let e=bi(),t=Z.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===po.SYSTEM_CLOCK)t=Z.now(t);else{let i=this._multiplier;if(n===po.TICK_DEPENDENT)t=Z.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=Z.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===Yr.CLAMPED)Z.lessThan(t,r)?t=Z.clone(r,t):Z.greaterThan(t,s)&&(t=Z.clone(s,t),this.onStop.raiseEvent(this));else if(o===Yr.LOOP_STOP)for(Z.lessThan(t,r)&&(t=Z.clone(r,t));Z.greaterThan(t,s);)t=Z.addSeconds(r,Z.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var xh=U7;function nT(){this._definitionChanged=new me,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(nT.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Yc("startTime"),stopTime:Yc("stopTime"),currentTime:Yc("currentTime"),clockRange:Yc("clockRange"),clockStep:Yc("clockStep"),multiplier:Yc("multiplier")});nT.prototype.clone=function(e){return l(e)||(e=new nT),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};nT.prototype.equals=function(e){return this===e||l(e)&&Z.equals(this.startTime,e.startTime)&&Z.equals(this.stopTime,e.stopTime)&&Z.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};nT.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};nT.prototype.getValue=function(e){return l(e)||(e=new xh),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var bh=nT;var JZe=H.WHITE,e$e=.1,t$e=new z(8,8),n$e=new z(0,0),i$e=new z(1,1);function zE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(zE.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._cellAlpha)&&Y.isConstant(this._lineCount)&&Y.isConstant(this._lineThickness)&&Y.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});zE.prototype.getType=function(e){return"Grid"};var o$e=new Z;zE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(o$e)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,JZe,t.color),t.cellAlpha=Y.getValueOrDefault(this._cellAlpha,e,e$e),t.lineCount=Y.getValueOrClonedDefault(this._lineCount,e,t$e,t.lineCount),t.lineThickness=Y.getValueOrClonedDefault(this._lineThickness,e,i$e,t.lineThickness),t.lineOffset=Y.getValueOrClonedDefault(this._lineOffset,e,n$e,t.lineOffset),t};zE.prototype.equals=function(e){return this===e||e instanceof zE&&Y.equals(this._color,e._color)&&Y.equals(this._cellAlpha,e._cellAlpha)&&Y.equals(this._lineCount,e._lineCount)&&Y.equals(this._lineThickness,e._lineThickness)&&Y.equals(this._lineOffset,e._lineOffset)};var HE=zE;function GE(e){this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(GE.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});GE.prototype.getType=function(e){return"PolylineArrow"};var r$e=new Z;GE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(r$e)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,H.WHITE,t.color),t};GE.prototype.equals=function(e){return this===e||e instanceof GE&&Y.equals(this._color,e._color)};var WE=GE;var s$e=H.WHITE,a$e=H.TRANSPARENT,c$e=16,l$e=255;function jE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(jE.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._gapColor)&&Y.isConstant(this._dashLength)&&Y.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});jE.prototype.getType=function(e){return"PolylineDash"};var u$e=new Z;jE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(u$e)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,s$e,t.color),t.gapColor=Y.getValueOrClonedDefault(this._gapColor,e,a$e,t.gapColor),t.dashLength=Y.getValueOrDefault(this._dashLength,e,c$e,t.dashLength),t.dashPattern=Y.getValueOrDefault(this._dashPattern,e,l$e,t.dashPattern),t};jE.prototype.equals=function(e){return this===e||e instanceof jE&&Y.equals(this._color,e._color)&&Y.equals(this._gapColor,e._gapColor)&&Y.equals(this._dashLength,e._dashLength)&&Y.equals(this._dashPattern,e._dashPattern)};var qE=jE;var f$e=H.WHITE,d$e=.25,h$e=1;function YE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(YE.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});YE.prototype.getType=function(e){return"PolylineGlow"};var m$e=new Z;YE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(m$e)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,f$e,t.color),t.glowPower=Y.getValueOrDefault(this._glowPower,e,d$e,t.glowPower),t.taperPower=Y.getValueOrDefault(this._taperPower,e,h$e,t.taperPower),t};YE.prototype.equals=function(e){return this===e||e instanceof YE&&Y.equals(this._color,e._color)&&Y.equals(this._glowPower,e._glowPower)&&Y.equals(this._taperPower,e._taperPower)};var XE=YE;var p$e=H.WHITE,_$e=H.BLACK,g$e=1;function KE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(KE.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._outlineColor)&&Y.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});KE.prototype.getType=function(e){return"PolylineOutline"};var y$e=new Z;KE.prototype.getValue=function(e,t){return l(e)||(e=Z.now(y$e)),l(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,p$e,t.color),t.outlineColor=Y.getValueOrClonedDefault(this._outlineColor,e,_$e,t.outlineColor),t.outlineWidth=Y.getValueOrDefault(this._outlineWidth,e,g$e),t};KE.prototype.equals=function(e){return this===e||e instanceof KE&&Y.equals(this._color,e._color)&&Y.equals(this._outlineColor,e._outlineColor)&&Y.equals(this._outlineWidth,e._outlineWidth)};var Qy=KE;function W_(e,t){this._value=void 0,this._definitionChanged=new me,this._eventHelper=new dr,this._referenceFrame=y(t,Ui.FIXED),this.setValue(e)}Object.defineProperties(W_.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!Y.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var x$e=new Z;W_.prototype.getValue=function(e,t){return l(e)||(e=Z.now(x$e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};W_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};W_.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,W_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};W_.prototype.equals=function(e){return this===e||e instanceof W_&&this._referenceFrame===e._referenceFrame&&Y.arrayEquals(this._value,e._value)};W_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var j_=W_;function Jy(e){this._value=void 0,this._definitionChanged=new me,this._eventHelper=new dr,this.setValue(e)}Object.defineProperties(Jy.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!Y.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var b$e=new Z;Jy.prototype.getValue=function(e,t){l(e)||(e=Z.now(b$e));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};Jy.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Jy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Jy.prototype.equals=function(e){return this===e||e instanceof Jy&&Y.arrayEquals(this._value,e._value)};Jy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ZE=Jy;function iT(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(Vu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function Vu(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new me,e.collectionChanged.addEventListener(Vu.prototype._onCollectionChanged,this)}Object.defineProperties(Vu.prototype,{isConstant:{get:function(){return Y.isConstant(iT(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=iT(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return iT(this)}}});Vu.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new Vu(e,n,i)};var T$e=new Z;Vu.prototype.getValue=function(e,t){let n=iT(this);return l(e)||(e=Z.now(T$e)),l(n)?n.getValue(e,t):void 0};Vu.prototype.getValueInReferenceFrame=function(e,t,n){let i=iT(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Vu.prototype.getType=function(e){let t=iT(this);return l(t)?t.getType(e):void 0};Vu.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};Vu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Vu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Vu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=iT(this),l(i)&&this._definitionChanged.raiseEvent(this))};var q_=Vu;var C$e={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(n,e.length);let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-P.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+P.TWO_PI:o}},nd=C$e;var Rde={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function Ode(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function Mde(e,t){return e instanceof Z?e:typeof e=="string"?Z.fromIso8601(e):Z.addSeconds(t,e,new Z)}var z7=[],H7=[];function Zz(e,t,n,i,o){let r=0,s,a,c,u,f,d;for(;r<i.length;){f=Mde(i[r],e),c=Oo(t,f,Z.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*o,a=void 0,d=t[c];r<i.length&&(f=Mde(i[r],e),!(l(a)&&Z.compare(a,f)>=0||l(d)&&Z.compare(f,d)>=0));){for(z7[p++]=f,r=r+1,s=0;s<o;s++)H7[g++]=i[r],r=r+1;a=f}p>0&&(H7.length=g,Ode(n,u,H7),z7.length=p,Ode(t,c,z7))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function id(e,t){let n=e;n===Number&&(n=Rde);let i=n.packedLength,o=y(n.packedInterpolationLength,i),r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=Rde);let f=u.packedLength;i+=f,o+=y(u.packedInterpolationLength,f),s[c]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=tT,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new me,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=ku.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=ku.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(id.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var A$e=new Z;id.prototype.getValue=function(e,t){l(e)||(e=Z.now(A$e));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Oo(n,e,Z.compare);if(a<0){if(a=~a,a===0){let E=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===ku.NONE||o!==0&&Z.secondsDifference(E,e)>o)return;if(this._backwardExtrapolationType===ku.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let E=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===ku.NONE||o!==0&&Z.secondsDifference(e,E)>o)return;if(this._forwardExtrapolationType===ku.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,d=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let E=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);E!==this._numberOfPoints&&(this._numberOfPoints=E,c.length=E,u.length=E*d)}let g=this._numberOfPoints-1;if(g<1)return;let m=0,x=i-1;if(x-m+1>=g+1){let E=a-(g/2|0)-1;E<m&&(E=m);let v=E+g;v>x&&(v=x,E=v-g,E<m&&(E=m)),m=E,x=v}let T=x-m+1;for(let E=0;E<T;++E)c[E]=Z.secondsDifference(n[m+E],n[x]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,m,x,u);else{let E=0,v=this._packedLength,D=m*v,O=(x+1)*v;for(;D<O;)u[E]=s[D],D++,E++}let C=Z.secondsDifference(e,n[x]),A;if(p===0||!l(f.interpolate))A=f.interpolateOrderZero(C,c,u,d,this._interpolationResult);else{let E=Math.floor(d/(p+1));A=f.interpolate(C,c,u,E,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(A,s,m,x,t):r.unpack(A,0,t)}return r.unpack(s,a*this._packedLength,t)};id.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};id.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}Zz(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};id.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}Zz(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};id.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};id.prototype.addSamplesPackedArray=function(e,t){Zz(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};id.prototype.removeSample=function(e){let t=Oo(this._times,e,Z.compare);return t<0?!1:(Lde(this,t,1),!0)};function Lde(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}id.prototype.removeSamples=function(e){let t=this._times,n=Oo(t,e.start,Z.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Oo(t,e.stop,Z.compare);i<0?i=~i:e.isStopIncluded&&++i,Lde(this,n,i-n)};id.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!Z.equals(a[r],c[r]))return!1;let u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};id._mergeNewSamples=Zz;var Uu=id;function od(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new Uu(h,n),this._definitionChanged=new me,this._referenceFrame=y(e,Ui.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(od.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var E$e=new Z;od.prototype.getValue=function(e,t){return l(e)||(e=Z.now(E$e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};od.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return zd.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};od.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};od.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};od.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};od.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};od.prototype.removeSample=function(e){return this._property.removeSample(e)};od.prototype.removeSamples=function(e){this._property.removeSamples(e)};od.prototype.equals=function(e){return this===e||e instanceof od&&Y.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var _a=od;var S$e={HORIZONTAL:0,VERTICAL:1},Th=Object.freeze(S$e);var v$e=Th.HORIZONTAL,w$e=H.WHITE,D$e=H.BLACK,I$e=0,P$e=1;function $E(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties($E.prototype,{isConstant:{get:function(){return Y.isConstant(this._orientation)&&Y.isConstant(this._evenColor)&&Y.isConstant(this._oddColor)&&Y.isConstant(this._offset)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});$E.prototype.getType=function(e){return"Stripe"};var R$e=new Z;$E.prototype.getValue=function(e,t){return l(e)||(e=Z.now(R$e)),l(t)||(t={}),t.horizontal=Y.getValueOrDefault(this._orientation,e,v$e)===Th.HORIZONTAL,t.evenColor=Y.getValueOrClonedDefault(this._evenColor,e,w$e,t.evenColor),t.oddColor=Y.getValueOrClonedDefault(this._oddColor,e,D$e,t.oddColor),t.offset=Y.getValueOrDefault(this._offset,e,I$e),t.repeat=Y.getValueOrDefault(this._repeat,e,P$e),t};$E.prototype.equals=function(e){return this===e||e instanceof $E&&Y.equals(this._orientation,e._orientation)&&Y.equals(this._evenColor,e._evenColor)&&Y.equals(this._oddColor,e._oddColor)&&Y.equals(this._offset,e._offset)&&Y.equals(this._repeat,e._repeat)};var QE=$E;function e0(e){this._definitionChanged=new me,this._intervals=new jr,this._intervals.changedEvent.addEventListener(e0.prototype._intervalsChanged,this),this._referenceFrame=y(e,Ui.FIXED)}Object.defineProperties(e0.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var O$e=new Z;e0.prototype.getValue=function(e,t){return l(e)||(e=Z.now(O$e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};e0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return zd.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};e0.prototype.equals=function(e){return this===e||e instanceof e0&&this._intervals.equals(e._intervals,Y.equals)&&this._referenceFrame===e._referenceFrame};e0.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Y_=e0;function oT(){this._definitionChanged=new me,this._intervals=new jr,this._intervals.changedEvent.addEventListener(oT.prototype._intervalsChanged,this)}Object.defineProperties(oT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var M$e=new Z;oT.prototype.getValue=function(e,t){l(e)||(e=Z.now(M$e));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};oT.prototype.equals=function(e){return this===e||e instanceof oT&&this._intervals.equals(e._intervals,Y.equals)};oT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var X_=oT;function JE(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new me,this._normalize=y(t,!0),this.position=e}Object.defineProperties(JE.prototype,{isConstant:{get:function(){return Y.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var L$e=new h,Nde=new h,Fde=new Z,N$e=new Z,G7=1/60;JE.prototype.getValue=function(e,t){return this._getValue(e,t)};JE.prototype._getValue=function(e,t,n){l(e)||(e=Z.now(N$e)),l(t)||(t=new h);let i=this._position;if(Y.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,L$e),r=i.getValue(Z.addSeconds(e,G7,Fde),Nde);if(!l(o)||!l(r)&&(r=o,o=i.getValue(Z.addSeconds(e,-G7,Fde),Nde),!l(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&o.clone(n);let s=h.subtract(r,o,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,G7,t)};JE.prototype.equals=function(e){return this===e||e instanceof JE&&Y.equals(this._position,e._position)};var K_=JE;function vN(e,t){this._velocityVectorProperty=new K_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new me,this.ellipsoid=y(t,ee.default);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(vN.prototype,{isConstant:{get:function(){return Y.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var Bde=new h,F$e=new h,kde=new $,B$e=new Z;vN.prototype.getValue=function(e,t){l(e)||(e=Z.now(B$e));let n=this._velocityVectorProperty._getValue(e,F$e,Bde);if(l(n))return Mt.rotationMatrixFromPositionVelocity(Bde,n,this._ellipsoid,kde),Oe.fromRotationMatrix(kde,t)};vN.prototype.equals=function(e){return this===e||e instanceof vN&&Y.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var wN=vN;var Z_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Z_.validate=function(e){return e===Z_.COMPLETE||e===Z_.BELOW_ELLIPSOID_HORIZON||e===Z_.ABOVE_ELLIPSOID_HORIZON};Z_.toString=function(e){switch(e){case Z_.COMPLETE:return"COMPLETE";case Z_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Z_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new he("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var eS=Z_;function t0(){}t0.packedLength=h.packedLength;t0.unpack=h.unpack;t0.pack=h.pack;var W7;function DN(e,t){return t[0]==="#"&&(t=W7+t),q_.fromString(e,t)}function Vde(e,t,n){if(l(n.reference))return DN(t,n.reference);if(l(n.velocityReference)){let i=DN(t,n.velocityReference);switch(e){case h:case t0:return new K_(i,e===t0);case Oe:return new wN(i)}}throw new re(`${JSON.stringify(n)} is not valid CZML.`)}function k$e(e,t){return new jd(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Wi=new h,al=new SN,Ac=new fe,rT=new An,$z=new Oe;function V$e(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===H.packedLength)return[H.byteToFloat(n[0]),H.byteToFloat(n[1]),H.byteToFloat(n[2]),H.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=H.byteToFloat(n[o+1]),t[o+2]=H.byteToFloat(n[o+2]),t[o+3]=H.byteToFloat(n[o+3]),t[o+4]=H.byteToFloat(n[o+4]);return t}function Ude(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):Se.createIfNeeded(n)}function U$e(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===se.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=P.toRadians(n[o+1]),t[o+2]=P.toRadians(n[o+2]),t[o+3]=P.toRadians(n[o+3]),t[o+4]=P.toRadians(n[o+4]);return t}function z$e(e){let t=e.length;if(al.magnitude=1,t===2)return al.clock=e[0],al.cone=e[1],h.fromSpherical(al,Wi),[Wi.x,Wi.y,Wi.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],al.clock=e[i+1],al.cone=e[i+2],h.fromSpherical(al,Wi),n[o+1]=Wi.x,n[o+2]=Wi.y,n[o+3]=Wi.z;return n}function H$e(e){let t=e.length;if(t===3)return al.clock=e[0],al.cone=e[1],al.magnitude=e[2],h.fromSpherical(al,Wi),[Wi.x,Wi.y,Wi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],al.clock=e[i+1],al.cone=e[i+2],al.magnitude=e[i+3],h.fromSpherical(al,Wi),n[i+1]=Wi.x,n[i+2]=Wi.y,n[i+3]=Wi.z;return n}function G$e(e){let t=e.length;if(t===3)return Ac.longitude=e[0],Ac.latitude=e[1],Ac.height=e[2],ee.default.cartographicToCartesian(Ac,Wi),[Wi.x,Wi.y,Wi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ac.longitude=e[i+1],Ac.latitude=e[i+2],Ac.height=e[i+3],ee.default.cartographicToCartesian(Ac,Wi),n[i+1]=Wi.x,n[i+2]=Wi.y,n[i+3]=Wi.z;return n}function W$e(e){let t=e.length;if(t===3)return Ac.longitude=P.toRadians(e[0]),Ac.latitude=P.toRadians(e[1]),Ac.height=e[2],ee.default.cartographicToCartesian(Ac,Wi),[Wi.x,Wi.y,Wi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ac.longitude=P.toRadians(e[i+1]),Ac.latitude=P.toRadians(e[i+2]),Ac.height=e[i+3],ee.default.cartographicToCartesian(Ac,Wi),n[i+1]=Wi.x,n[i+2]=Wi.y,n[i+3]=Wi.z;return n}function j7(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return z$e(o);let r=e.spherical;if(l(r))return H$e(r);let s=e.cartographicRadians;if(l(s))return G$e(s);let a=e.cartographicDegrees;if(l(a))return W$e(a);throw new re(`${JSON.stringify(e)} is not a valid CZML interval.`)}function zde(e,t){h.unpack(e,t,Wi),h.normalize(Wi,Wi),h.pack(Wi,e,t)}function j$e(e){let t=j7(e);if(t.length===3)return zde(t,0),t;for(let n=1;n<t.length;n+=4)zde(t,n);return t}function Hde(e,t){Oe.unpack(e,t,$z),Oe.normalize($z,$z),Oe.pack($z,e,t)}function q$e(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return Hde(t,0),t;for(let n=1;n<t.length;n+=5)Hde(t,n)}return t}function Gde(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?je:e.hasOwnProperty("cartesian2")?z:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?t0:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?H:e.hasOwnProperty("arcType")?Jt:e.hasOwnProperty("classificationType")?Vn:e.hasOwnProperty("colorBlendMode")?mc:e.hasOwnProperty("cornerType")?Mi:e.hasOwnProperty("heightReference")?Ye:e.hasOwnProperty("horizontalOrigin")?gi:e.hasOwnProperty("date")?Z:e.hasOwnProperty("labelStyle")?jo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?kt:e.hasOwnProperty("distanceDisplayCondition")?Lt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Oe:e.hasOwnProperty("shadowMode")?yn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Th:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?se:e.hasOwnProperty("uri")?PN.default:e.hasOwnProperty("verticalOrigin")?Rn:Object}function Y$e(e,t,n){switch(e){case Jt:return Jt[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case je:return t.boundingRectangle;case z:return t.cartesian2;case h:return j7(t);case t0:return j$e(t);case H:return V$e(t);case Vn:return Vn[y(t.classificationType,t)];case mc:return mc[y(t.colorBlendMode,t)];case Mi:return Mi[y(t.cornerType,t)];case Ye:return Ye[y(t.heightReference,t)];case gi:return gi[y(t.horizontalOrigin,t)];case Image:return Ude(t,n);case Z:return Z.fromIso8601(y(t.date,t));case jo:return jo[y(t.labelStyle,t)];case Number:return y(t.number,t);case kt:return t.nearFarScalar;case Lt:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case Oe:return q$e(t);case nd:return y(t.number,t);case eS:return eS[y(t.portionToDisplay,t)];case yn:return yn[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case Th:return Th[y(t.stripeOrientation,t)];case se:return U$e(t);case PN.default:return Ude(t,n);case Rn:return Rn[y(t.verticalOrigin,t)];default:throw new re(`Unknown CzmlDataSource interval type: ${e}`)}}var X$e={HERMITE:AN,LAGRANGE:EN,LINEAR:tT};function Qz(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:X$e[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=ku[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=ku[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Wde={iso8601:void 0};function hr(e){if(l(e))return Wde.iso8601=e,An.fromIso8601(Wde)}function q7(e){let t=He.MAXIMUM_INTERVAL.clone();return t.data=e,t}function jde(e){let t=new bc;return t.intervals.addInterval(q7(e)),t}function qde(e){let t=new ma(e.referenceFrame);return t.intervals.addInterval(q7(e)),t}function Jz(e,t,n,i,o,r,s){let a=hr(i.interval);l(o)&&(l(a)?a=An.intersect(a,o,rT):a=o);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(He.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return ihe(t[n],a)}let g=!1;if(d){if(u=Y$e(e,i,r),!l(u))return;c=y(e.packedLength,1),f=y(u.length,1),g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==nd;if(!g&&!p){d?t[n]=new Kn(m?e.unpack(u,0):u):t[n]=Vde(e,s,i);return}let x=t[n],b,T=i.epoch;if(l(T)&&(b=Z.fromIso8601(T)),g&&!p){x instanceof Uu||(t[n]=x=new Uu(e)),x.addSamplesPackedArray(u,b),Qz(i,x);return}let C;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=Vde(e,s,i),l(x)||(t[n]=x=d?new X_:new bc),d&&x instanceof X_?x.intervals.addInterval(a):x instanceof bc?(d&&(a.data=new Kn(a.data)),x.intervals.addInterval(a)):(t[n]=x=jde(x),d&&(a.data=new Kn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new bc),x instanceof bc||(t[n]=x=jde(x));let A=x.intervals;C=A.findInterval(a),(!l(C)||!(C.data instanceof Uu))&&(C=a.clone(),C.data=new Uu(e),A.addInterval(C)),C.data.addSamplesPackedArray(u,b),Qz(i,C.data)}function ihe(e,t){if(e instanceof Uu){e.removeSamples(t);return}else if(e instanceof X_){e.intervals.removeInterval(t);return}else if(e instanceof bc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=An.intersect(n.get(i),t,rT);o.isEmpty||ihe(o.data,t)}n.removeInterval(t);return}}function ge(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)Jz(e,t,n,i[a],o,r,s);else Jz(e,t,n,i,o,r,s)}function Yde(e,t,n,i,o,r){let s=hr(n.interval);l(i)&&(l(s)?s=An.intersect(s,i,rT):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(He.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return ohe(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=Ui[n.referenceFrame]),g=y(g,Ui.FIXED),u=j7(n),f=y(u.length,1),m=f>c),!m&&!p){d?e[t]=new qc(h.unpack(u),g):e[t]=DN(r,n.reference);return}let x=e[t],b,T=n.epoch;if(l(T)&&(b=Z.fromIso8601(T)),m&&!p){(!(x instanceof _a)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new _a(g,a)),x.addSamplesPackedArray(u,b),Qz(n,x);return}let C;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=DN(r,n.reference),l(x)||(d?x=new Y_(g):x=new ma(g),e[t]=x),d&&x instanceof Y_&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof ma?(d&&(s.data=new qc(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=qde(x),d&&(s.data=new qc(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof ma||(e[t]=x=qde(x)):e[t]=x=new ma(g);let A=x.intervals;C=A.findInterval(s),(!l(C)||!(C.data instanceof _a)||l(g)&&C.data.referenceFrame!==g)&&(C=s.clone(),C.data=new _a(g,a),A.addInterval(C)),C.data.addSamplesPackedArray(u,b),Qz(n,C.data)}function ohe(e,t){if(e instanceof _a){e.removeSamples(t);return}else if(e instanceof Y_){e.intervals.removeInterval(t);return}else if(e instanceof ma){let n=e.intervals;for(let i=0;i<n.length;++i){let o=An.intersect(n.get(i),t,rT);o.isEmpty||ohe(o.data,t)}n.removeInterval(t);return}}function rhe(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Yde(e,t,n[s],i,o,r);else Yde(e,t,n,i,o,r)}function Xde(e,t,n,i){l(n.references)?e4(e,t,n.references,n.interval,i,ZE,bc):(l(n.cartesian2)?n.array=z.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=z.unpackArray(n.cartesian)),l(n.array)&&ge(Array,e,t,n,void 0,void 0,i))}function Kde(e,t,n,i,o,r){let s=hr(n.interval);l(i)&&(l(s)?s=An.intersect(s,i,rT):s=i);let a=e[t],c,u;if(l(s)){a instanceof OE||(a=new OE,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof zt||(c=new zt),f=n.solidColor,ge(H,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof HE||(c=new HE),f=n.grid,ge(H,c,"color",f.color,void 0,o,r),ge(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),ge(z,c,"lineCount",f.lineCount,void 0,o,r),ge(z,c,"lineThickness",f.lineThickness,void 0,o,r),ge(z,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof ey||(c=new ey),f=n.image,ge(Image,c,"image",f.image,void 0,o,r),ge(z,c,"repeat",f.repeat,void 0,o,r),ge(H,c,"color",f.color,void 0,o,r),ge(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof QE||(c=new QE),f=n.stripe,ge(Th,c,"orientation",f.orientation,void 0,o,r),ge(H,c,"evenColor",f.evenColor,void 0,o,r),ge(H,c,"oddColor",f.oddColor,void 0,o,r),ge(Number,c,"offset",f.offset,void 0,o,r),ge(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof Qy||(c=new Qy),f=n.polylineOutline,ge(H,c,"color",f.color,void 0,o,r),ge(H,c,"outlineColor",f.outlineColor,void 0,o,r),ge(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof XE||(c=new XE),f=n.polylineGlow,ge(H,c,"color",f.color,void 0,o,r),ge(Number,c,"glowPower",f.glowPower,void 0,o,r),ge(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof WE||(c=new WE),f=n.polylineArrow,ge(H,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof qE||(c=new qE),f=n.polylineDash,ge(H,c,"color",f.color,void 0,void 0,r),ge(H,c,"gapColor",f.gapColor,void 0,void 0,r),ge(Number,c,"dashLength",f.dashLength,void 0,o,r),ge(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof PE||(c=new PE),f=n.checkerboard,ge(H,c,"evenColor",f.evenColor,void 0,o,r),ge(H,c,"oddColor",f.oddColor,void 0,o,r),ge(z,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function zu(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Kde(e,t,n[s],i,o,r);else Kde(e,t,n,i,o,r)}function K$e(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function Z$e(e,t,n,i){let o=t.description;l(o)&&ge(String,e,"description",o,void 0,i,n)}function $$e(e,t,n,i){let o=t.position;l(o)&&rhe(e,"position",o,void 0,i,n)}function Q$e(e,t,n,i){let o=t.viewFrom;l(o)&&ge(h,e,"viewFrom",o,void 0,i,n)}function J$e(e,t,n,i){let o=t.orientation;l(o)&&ge(Oe,e,"orientation",o,void 0,i,n)}function eQe(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Ml);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)Jz(Gde(s[a]),e.properties,r,s[a],void 0,i,n);else Jz(Gde(s),e.properties,r,s,void 0,i,n)}}}function e4(e,t,n,i,o,r,s){let a=n.map(function(c){return DN(o,c)});if(l(i)){i=hr(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(q7(c)),e[t]=c=u}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function Zde(e,t,n,i){let o=n.references;l(o)?e4(e,t,o,n.interval,i,ZE,bc):ge(Array,e,t,n,void 0,void 0,i)}function $de(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Zde(e,t,n[o],i);else Zde(e,t,n,i)}function Qde(e,t,n,i){let o=n.references;l(o)?e4(e,t,o,n.interval,i,j_,ma):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ee.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ee.default)),l(n.array)&&ge(Array,e,t,n,void 0,void 0,i))}function RN(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Qde(e,t,n[o],i);else Qde(e,t,n,i)}function tQe(e){return h.unpackArray(e)}function nQe(e){return h.fromRadiansArrayHeights(e,ee.default)}function iQe(e){return h.fromDegreesArrayHeights(e,ee.default)}function Jde(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return e4(a,"positions",s,n.interval,i,j_,ma),a.positions});e[t]=new j_(r)}else l(n.cartesian)?n.array=n.cartesian.map(tQe):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(nQe):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(iQe)),l(n.array)&&ge(Array,e,t,n,void 0,void 0,i)}function oQe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Jde(e,t,n[o],i);else Jde(e,t,n,i)}function rQe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Xde(e,t,n[o],i);else Xde(e,t,n,i)}function sQe(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new jr),r.addInterval(hr(o[s]));else r=new jr,r.addInterval(hr(o));e.availability=r}function aQe(e,t,n,i,o){l(t)&&ge(t0,e,"alignedAxis",t,n,i,o)}function cQe(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=hr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new sc),ge(Boolean,s,"show",o.show,r,i,n),ge(Image,s,"image",o.image,r,i,n),ge(Number,s,"scale",o.scale,r,i,n),ge(z,s,"pixelOffset",o.pixelOffset,r,i,n),ge(h,s,"eyeOffset",o.eyeOffset,r,i,n),ge(gi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ge(Rn,s,"verticalOrigin",o.verticalOrigin,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(H,s,"color",o.color,r,i,n),ge(nd,s,"rotation",o.rotation,r,i,n),aQe(s,o.alignedAxis,r,i,n),ge(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),ge(Number,s,"width",o.width,r,i,n),ge(Number,s,"height",o.height,r,i,n),ge(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ge(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ge(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ge(je,s,"imageSubRegion",o.imageSubRegion,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function lQe(e,t,n,i){let o=t.box;if(!l(o))return;let r=hr(o.interval),s=e.box;l(s)||(e.box=s=new kx),ge(Boolean,s,"show",o.show,r,i,n),ge(h,s,"dimensions",o.dimensions,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function uQe(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=hr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new Ux),ge(Boolean,s,"show",o.show,r,i,n),RN(s,"positions",o.positions,n),ge(Number,s,"width",o.width,r,i,n),ge(Number,s,"height",o.height,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ge(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ge(Mi,s,"cornerType",o.cornerType,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Vn,s,"classificationType",o.classificationType,r,i,n),ge(Number,s,"zIndex",o.zIndex,r,i,n)}function fQe(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=hr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new zx),ge(Boolean,s,"show",o.show,r,i,n),ge(Number,s,"length",o.length,r,i,n),ge(Number,s,"topRadius",o.topRadius,r,i,n),ge(Number,s,"bottomRadius",o.bottomRadius,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ge(Number,s,"slices",o.slices,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function dQe(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new re("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new re("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function hQe(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=hr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Hx),ge(Boolean,s,"show",o.show,r,i,n),ge(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),ge(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),ge(Number,s,"height",o.height,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ge(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ge(nd,s,"rotation",o.rotation,r,i,n),ge(nd,s,"stRotation",o.stRotation,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Vn,s,"classificationType",o.classificationType,r,i,n),ge(Number,s,"zIndex",o.zIndex,r,i,n)}function mQe(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=hr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Gx),ge(Boolean,s,"show",o.show,r,i,n),ge(h,s,"radii",o.radii,r,i,n),ge(h,s,"innerRadii",o.innerRadii,r,i,n),ge(Number,s,"minimumClock",o.minimumClock,r,i,n),ge(Number,s,"maximumClock",o.maximumClock,r,i,n),ge(Number,s,"minimumCone",o.minimumCone,r,i,n),ge(Number,s,"maximumCone",o.maximumCone,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Number,s,"stackPartitions",o.stackPartitions,r,i,n),ge(Number,s,"slicePartitions",o.slicePartitions,r,i,n),ge(Number,s,"subdivisions",o.subdivisions,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function pQe(e,t,n,i){let o=t.label;if(!l(o))return;let r=hr(o.interval),s=e.label;l(s)||(e.label=s=new Hd),ge(Boolean,s,"show",o.show,r,i,n),ge(String,s,"text",o.text,r,i,n),ge(String,s,"font",o.font,r,i,n),ge(jo,s,"style",o.style,r,i,n),ge(Number,s,"scale",o.scale,r,i,n),ge(Boolean,s,"showBackground",o.showBackground,r,i,n),ge(H,s,"backgroundColor",o.backgroundColor,r,i,n),ge(z,s,"backgroundPadding",o.backgroundPadding,r,i,n),ge(z,s,"pixelOffset",o.pixelOffset,r,i,n),ge(h,s,"eyeOffset",o.eyeOffset,r,i,n),ge(gi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ge(Rn,s,"verticalOrigin",o.verticalOrigin,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(H,s,"fillColor",o.fillColor,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ge(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ge(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function _Qe(e,t,n,i){let o=t.model;if(!l(o))return;let r=hr(o.interval),s=e.model;l(s)||(e.model=s=new Gp),ge(Boolean,s,"show",o.show,r,i,n),ge(PN.default,s,"uri",o.gltf,r,i,n),ge(Number,s,"scale",o.scale,r,i,n),ge(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),ge(Number,s,"maximumScale",o.maximumScale,r,i,n),ge(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),ge(Boolean,s,"runAnimations",o.runAnimations,r,i,n),ge(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(H,s,"silhouetteColor",o.silhouetteColor,r,i,n),ge(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),ge(H,s,"color",o.color,r,i,n),ge(mc,s,"colorBlendMode",o.colorBlendMode,r,i,n),ge(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)ehe(s,u[a],r,i,n);else ehe(s,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)the(s,f[a],r,i,n);else the(s,f,r,i,n)}function ehe(e,t,n,i,o){let r=hr(t.interval);l(n)&&(l(r)?r=An.intersect(r,n,rT):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new Ml),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new Wx),ge(h,p,"translation",d.translation,r,i,o),ge(Oe,p,"rotation",d.rotation,r,i,o),ge(h,p,"scale",d.scale,r,i,o)}}function the(e,t,n,i,o){let r=hr(t.interval);l(n)&&(l(r)?r=An.intersect(r,n,rT):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new Ml),s.hasProperty(f)||s.addProperty(f),ge(Number,s,f,d,r,i,o))}}function gQe(e,t,n,i){let o=t.path;if(!l(o))return;let r=hr(o.interval),s=e.path;l(s)||(e.path=s=new Wp),ge(Boolean,s,"show",o.show,r,i,n),ge(Number,s,"leadTime",o.leadTime,r,i,n),ge(Number,s,"trailTime",o.trailTime,r,i,n),ge(Number,s,"width",o.width,r,i,n),ge(Number,s,"resolution",o.resolution,r,i,n),zu(s,"material",o.material,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function yQe(e,t,n,i){let o=t.point;if(!l(o))return;let r=hr(o.interval),s=e.point;l(s)||(e.point=s=new qx),ge(Boolean,s,"show",o.show,r,i,n),ge(Number,s,"pixelSize",o.pixelSize,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(H,s,"color",o.color,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ge(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function IN(e){this.polygon=e,this._definitionChanged=new me}Object.defineProperties(IN.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});IN.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new Ma(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Ma(n,i)};IN.prototype.equals=function(e){return this===e||e instanceof IN&&Y.equals(this.polygon._positions,e.polygon._positions)&&Y.equals(this.polygon._holes,e.polygon._holes)};function xQe(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=hr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Gd),ge(Boolean,s,"show",o.show,r,i,n),RN(s,"_positions",o.positions,n),oQe(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new IN(s)),ge(Number,s,"height",o.height,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ge(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ge(nd,s,"stRotation",o.stRotation,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),ge(Boolean,s,"closeTop",o.closeTop,r,i,n),ge(Boolean,s,"closeBottom",o.closeBottom,r,i,n),ge(Jt,s,"arcType",o.arcType,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Vn,s,"classificationType",o.classificationType,r,i,n),ge(Number,s,"zIndex",o.zIndex,r,i,n)}function bQe(e){return e?Jt.GEODESIC:Jt.NONE}function TQe(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=hr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new lc),ge(Boolean,s,"show",o.show,r,i,n),RN(s,"positions",o.positions,n),ge(Number,s,"width",o.width,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),zu(s,"material",o.material,r,i,n),zu(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),ge(Jt,s,"arcType",o.arcType,r,i,n),ge(Boolean,s,"clampToGround",o.clampToGround,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Vn,s,"classificationType",o.classificationType,r,i,n),ge(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};ge(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=k$e(a.followSurface,bQe)}}function CQe(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=hr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new Yx),RN(s,"positions",o.positions,n),rQe(s,"shape",o.shape,n),ge(Boolean,s,"show",o.show,r,i,n),ge(Mi,s,"cornerType",o.cornerType,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function AQe(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=hr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Wd),ge(Boolean,s,"show",o.show,r,i,n),ge(se,s,"coordinates",o.coordinates,r,i,n),ge(Number,s,"height",o.height,r,i,n),ge(Ye,s,"heightReference",o.heightReference,r,i,n),ge(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ge(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ge(nd,s,"rotation",o.rotation,r,i,n),ge(nd,s,"stRotation",o.stRotation,r,i,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ge(Vn,s,"classificationType",o.classificationType,r,i,n),ge(Number,s,"zIndex",o.zIndex,r,i,n)}function EQe(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=hr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new jx),ge(Boolean,s,"show",o.show,r,i,n),ge(PN.default,s,"uri",o.uri,r,i,n),ge(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function SQe(e,t,n,i){let o=t.wall;if(!l(o))return;let r=hr(o.interval),s=e.wall;l(s)||(e.wall=s=new jp),ge(Boolean,s,"show",o.show,r,i,n),RN(s,"positions",o.positions,n),$de(s,"minimumHeights",o.minimumHeights,n),$de(s,"maximumHeights",o.maximumHeights,n),ge(Number,s,"granularity",o.granularity,r,i,n),ge(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),ge(Boolean,s,"outline",o.outline,r,i,n),ge(H,s,"outlineColor",o.outlineColor,r,i,n),ge(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ge(yn,s,"shadows",o.shadows,r,i,n),ge(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function nhe(e,t,n,i,o){let r=e.id;if(l(r)||(r=Hn()),W7=r,!l(o._version)&&r!=="document")throw new re("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")dQe(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}W7=void 0}function vQe(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(He.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Z.secondsDifference(s,r),c=Math.round(a/120);return t=new bh,t.startTime=Z.clone(r),t.stopTime=Z.clone(s),t.clockRange=Yr.LOOP_STOP,t.multiplier=c,t.currentTime=Z.clone(r),t.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new bh,t.startTime=He.MINIMUM_VALUE.clone(),t.stopTime=He.MAXIMUM_VALUE.clone(),t.currentTime=He.MINIMUM_VALUE.clone(),t.clockRange=Yr.LOOP_STOP,t.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=hr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=Z.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Yr[n.range],Yr.LOOP_STOP)),l(n.step)&&(t.clockStep=y(po[n.step],po.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function she(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Tt(s)),e._credit=s,typeof t=="string"||t instanceof Se){t=Se.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return r=Se.createIfNeeded(r),qr.setLoading(e,!0),Promise.resolve(o).then(function(a){return wQe(e,a,r,i)}).catch(function(a){return qr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function wQe(e,t,n,i){qr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new ahe,o.removeAll()),bs._processCzml(t,o,n,void 0,e);let r=vQe(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=G_(n.getUrlComponent()),r=!0),qr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function ahe(){this.name=void 0,this.clock=void 0}function bs(e){this._name=e,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._clock=void 0,this._documentPacket=new ahe,this._version=void 0,this._entityCollection=new $s(this),this._entityCluster=new Fu,this._credit=void 0,this._resourceCredits=[]}bs.load=function(e,t){return new bs().load(e,t)};Object.defineProperties(bs.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});bs.updaters=[cQe,lQe,uQe,fQe,hQe,mQe,pQe,_Qe,K$e,Z$e,gQe,yQe,xQe,TQe,CQe,eQe,AQe,$$e,EQe,Q$e,SQe,J$e,sQe];bs.registerUpdater=function(e){bs.updaters.includes(e)||bs.updaters.push(e)};bs.unregisterUpdater=function(e){if(bs.updaters.includes(e)){let t=bs.updaters.indexOf(e);bs.updaters.splice(t,1)}};bs.prototype.process=function(e,t){return she(this,e,t,!1)};bs.prototype.load=function(e,t){return she(this,e,t,!0)};bs.prototype.update=function(e){return!0};bs.processPacketData=ge;bs.processPositionPacketData=rhe;bs.processMaterialPacketData=zu;bs._processCzml=function(e,t,n,i,o){if(i=y(i,bs.updaters),Array.isArray(e))for(let r=0,s=e.length;r<s;++r)nhe(e[r],t,i,n,o);else nhe(e,t,i,n,o)};var ON=bs;function cl(){this._dataSources=[],this._dataSourceAdded=new me,this._dataSourceRemoved=new me,this._dataSourceMoved=new me}Object.defineProperties(cl.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});cl.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};cl.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};cl.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};cl.prototype.contains=function(e){return this.indexOf(e)!==-1};cl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};cl.prototype.get=function(e){return this._dataSources[e]};cl.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function t4(e,t){return e.indexOf(t)}function che(e,t,n){let i=e._dataSources,o=i.length-1;if(t=P.clamp(t,0,o),n=P.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}cl.prototype.raise=function(e){let t=t4(this._dataSources,e);che(this,t,t+1)};cl.prototype.lower=function(e){let t=t4(this._dataSources,e);che(this,t,t-1)};cl.prototype.raiseToTop=function(e){let t=t4(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};cl.prototype.lowerToBottom=function(e){let t=t4(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};cl.prototype.isDestroyed=function(){return!1};cl.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var MN=cl;function ga(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=Hn(),this._primitiveAdded=new me,this._primitiveRemoved=new me,this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(ga.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});ga.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e};ga.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};ga.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};ga.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};ga.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function n4(e,t){return e._primitives.indexOf(t)}ga.prototype.raise=function(e){if(l(e)){let t=n4(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};ga.prototype.raiseToTop=function(e){if(l(e)){let t=n4(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};ga.prototype.lower=function(e){if(l(e)){let t=n4(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};ga.prototype.lowerToBottom=function(e){if(l(e)){let t=n4(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};ga.prototype.get=function(e){return this._primitives[e]};ga.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};ga.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};ga.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};ga.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};ga.prototype.isDestroyed=function(){return!1};ga.prototype.destroy=function(){return this.removeAll(),ue(this)};var Yl=ga;function Mm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Mm.prototype,{length:{get:function(){return this._length}}});Mm.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new Yl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};Mm.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Mm.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};Mm.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};Mm.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Mm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Mm.prototype.isDestroyed=function(){return!1};Mm.prototype.destroy=function(){return this.removeAll(),ue(this)};var LN=Mm;function tS(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new St}tS.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};tS.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};tS.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};tS.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};tS.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):ct.FAILED};var sT=tS;var X7={},i4=new h,lhe=new h,uhe=new Oe,fhe=new $;function nS(e,t,n,i,o,r,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),i4),h.multiplyByScalar(n,Math.sin(f),lhe),h.add(i4,lhe,i4);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(s*d+o*p)/a;return Oe.fromAxisAngle(i4,m,uhe),$.fromQuaternion(uhe,fhe),$.multiplyByVector(fhe,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var dhe=new h,hhe=new h,Y7=new h,DQe=new h;X7.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,dhe);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,hhe),x=i.geodeticSurfaceNormal(g,DQe),b=h.multiplyByScalar(x,o,Y7);h.add(g,b,g),n&&(h.multiplyByScalar(x,r,b),h.add(m,b,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var IQe=new h,PQe=new h,RQe=new h;X7.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=o*o,f=o*i,d=h.magnitude(s),p=h.normalize(s,IQe),g=h.cross(h.UNIT_Z,s,PQe);g=h.normalize(g,g);let m=h.cross(p,g,RQe),x=1+Math.ceil(P.PI_OVER_TWO/a),b=P.PI_OVER_TWO/(x-1),T=P.PI_OVER_TWO-x*b;T<0&&(x-=Math.ceil(Math.abs(T)/b));let C=2*(x*(x+2)),A=t?new Array(C*3):void 0,E=0,v=dhe,D=hhe,O=x*4*3,R=O-1,M=0,N=n?new Array(O):void 0,_,S,w,I,L;for(T=P.PI_OVER_TWO,v=nS(T,r,m,g,c,f,u,d,p,v),t&&(A[E++]=v.x,A[E++]=v.y,A[E++]=v.z),n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x),T=P.PI_OVER_TWO-b,_=1;_<x+1;++_){if(v=nS(T,r,m,g,c,f,u,d,p,v),D=nS(Math.PI-T,r,m,g,c,f,u,d,p,D),t){for(A[E++]=v.x,A[E++]=v.y,A[E++]=v.z,w=2*_+2,S=1;S<w-1;++S)I=S/(w-1),L=h.lerp(v,D,I,Y7),A[E++]=L.x,A[E++]=L.y,A[E++]=L.z;A[E++]=D.x,A[E++]=D.y,A[E++]=D.z}n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x,N[M++]=D.x,N[M++]=D.y,N[M++]=D.z),T=P.PI_OVER_TWO-(_+1)*b}for(_=x;_>1;--_){if(T=P.PI_OVER_TWO-(_-1)*b,v=nS(-T,r,m,g,c,f,u,d,p,v),D=nS(T+Math.PI,r,m,g,c,f,u,d,p,D),t){for(A[E++]=v.x,A[E++]=v.y,A[E++]=v.z,w=2*(_-1)+2,S=1;S<w-1;++S)I=S/(w-1),L=h.lerp(v,D,I,Y7),A[E++]=L.x,A[E++]=L.y,A[E++]=L.z;A[E++]=D.x,A[E++]=D.y,A[E++]=D.z}n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x,N[M++]=D.x,N[M++]=D.y,N[M++]=D.z)}T=P.PI_OVER_TWO,v=nS(-T,r,m,g,c,f,u,d,p,v);let B={};return t&&(A[E++]=v.x,A[E++]=v.y,A[E++]=v.z,B.positions=A,B.numPts=x),n&&(N[R--]=v.z,N[R--]=v.y,N[R--]=v.x,B.outerPositions=N),B};var Xl=X7;var iS=new h,K7=new h,Z7=new h,mhe=new h,Rs=new z,phe=new $,OQe=new $,$7=new Oe,_he=new h,ghe=new h,yhe=new h,s4=new fe,xhe=new h,bhe=new z,The=new z;function Che(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,x=f?new Float32Array(u*3):void 0,b=0,T=_he,C=ghe,A=yhe,E=new Di(a),v=E.project(a.cartesianToCartographic(o,s4),xhe),D=a.scaleToGeodeticSurface(o,iS);a.geodeticSurfaceNormal(D,D);let O=phe,R=OQe;if(c!==0){let L=Oe.fromAxisAngle(D,c,$7);O=$.fromQuaternion(L,O),L=Oe.fromAxisAngle(D,-c,$7),R=$.fromQuaternion(L,R)}else O=$.clone($.IDENTITY,O),R=$.clone($.IDENTITY,R);let M=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,bhe),N=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,The),_=e.length,S=n?_:0,w=S/3*2;for(let L=0;L<_;L+=3){let B=L+1,U=L+2,V=h.fromArray(e,L,iS);if(i.st){let G=$.multiplyByVector(O,V,K7),k=E.project(a.cartesianToCartographic(G,s4),Z7);h.subtract(k,v,k),Rs.x=(k.x+r)/(2*r),Rs.y=(k.y+s)/(2*s),M.x=Math.min(Rs.x,M.x),M.y=Math.min(Rs.y,M.y),N.x=Math.max(Rs.x,N.x),N.y=Math.max(Rs.y,N.y),n&&(d[b+w]=Rs.x,d[b+1+w]=Rs.y),d[b++]=Rs.x,d[b++]=Rs.y}(i.normal||i.tangent||i.bitangent||f)&&(T=a.geodeticSurfaceNormal(V,T),f&&(x[L+S]=-T.x,x[B+S]=-T.y,x[U+S]=-T.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(C=h.normalize(h.cross(h.UNIT_Z,T,C),C),$.multiplyByVector(R,C,C)),i.normal&&(p[L]=T.x,p[B]=T.y,p[U]=T.z,n&&(p[L+S]=-T.x,p[B+S]=-T.y,p[U+S]=-T.z)),i.tangent&&(g[L]=C.x,g[B]=C.y,g[U]=C.z,n&&(g[L+S]=-C.x,g[B+S]=-C.y,g[U+S]=-C.z)),i.bitangent&&(A=h.normalize(h.cross(T,C,A),A),m[L]=A.x,m[B]=A.y,m[U]=A.z,n&&(m[L+S]=A.x,m[B+S]=A.y,m[U+S]=A.z))))}if(i.st){_=d.length;for(let L=0;L<_;L+=2)d[L]=(d[L]-M.x)/(N.x-M.x),d[L+1]=(d[L+1]-M.y)/(N.y-M.y)}let I=new fn;if(i.position){let L=Xl.raisePositionsToHeight(e,t,n);I.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:L})}if(i.st&&(I.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(I.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let L=new Uint8Array(u);if(t.offsetAttribute===sn.TOP)L=L.fill(1,0,u/2);else{let B=t.offsetAttribute===sn.NONE?0:1;L=L.fill(B)}I.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}return I}function Ahe(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var aT=new h;function MQe(e){let t=e.center;aT=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,aT),e.height,aT),aT=h.add(t,aT,aT);let n=new ae(aT,e.semiMajorAxis),i=Xl.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Che(o,e,!1),a=Ahe(r);return a=Ne.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function LQe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,x=n.bitangent?new Float32Array(f*3):void 0,b=t.shadowVolume,T=b?new Float32Array(f*3):void 0,C=0,A=_he,E=ghe,v=yhe,D=new Di(s),O=D.project(s.cartesianToCartographic(i,s4),xhe),R=s.scaleToGeodeticSurface(i,iS);s.geodeticSurfaceNormal(R,R);let M=Oe.fromAxisAngle(R,u,$7),N=$.fromQuaternion(M,phe),_=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,bhe),S=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,The),w=e.length,I=w/3*2;for(let B=0;B<w;B+=3){let U=B+1,V=B+2,G=h.fromArray(e,B,iS),k;if(n.st){let j=$.multiplyByVector(N,G,K7),J=D.project(s.cartesianToCartographic(j,s4),Z7);h.subtract(J,O,J),Rs.x=(J.x+o)/(2*o),Rs.y=(J.y+r)/(2*r),_.x=Math.min(Rs.x,_.x),_.y=Math.min(Rs.y,_.y),S.x=Math.max(Rs.x,S.x),S.y=Math.max(Rs.y,S.y),p[C+I]=Rs.x,p[C+1+I]=Rs.y,p[C++]=Rs.x,p[C++]=Rs.y}G=s.scaleToGeodeticSurface(G,G),k=h.clone(G,K7),A=s.geodeticSurfaceNormal(G,A),b&&(T[B+w]=-A.x,T[U+w]=-A.y,T[V+w]=-A.z);let W=h.multiplyByScalar(A,a,mhe);if(G=h.add(G,W,G),W=h.multiplyByScalar(A,c,W),k=h.add(k,W,k),n.position&&(d[B+w]=k.x,d[U+w]=k.y,d[V+w]=k.z,d[B]=G.x,d[U]=G.y,d[V]=G.z),n.normal||n.tangent||n.bitangent){v=h.clone(A,v);let j=h.fromArray(e,(B+3)%w,mhe);h.subtract(j,G,j);let J=h.subtract(k,G,Z7);A=h.normalize(h.cross(J,j,A),A),n.normal&&(g[B]=A.x,g[U]=A.y,g[V]=A.z,g[B+w]=A.x,g[U+w]=A.y,g[V+w]=A.z),n.tangent&&(E=h.normalize(h.cross(v,A,E),E),m[B]=E.x,m[U]=E.y,m[V]=E.z,m[B+w]=E.x,m[B+1+w]=E.y,m[B+2+w]=E.z),n.bitangent&&(x[B]=v.x,x[U]=v.y,x[V]=v.z,x[B+w]=v.x,x[U+w]=v.y,x[V+w]=v.z)}}if(n.st){w=p.length;for(let B=0;B<w;B+=2)p[B]=(p[B]-_.x)/(S.x-_.x),p[B+1]=(p[B+1]-_.y)/(S.y-_.y)}let L=new fn;if(n.position&&(L.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(L.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(L.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(L.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(L.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),b&&(L.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),l(t.offsetAttribute)){let B=new Uint8Array(f);if(t.offsetAttribute===sn.TOP)B=B.fill(1,0,f/2);else{let U=t.offsetAttribute===sn.NONE?0:1;B=B.fill(U)}L.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return L}function NQe(e){let t=e.length/3,n=Ne.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var o4=new ae,r4=new ae;function FQe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,iS),e.height,iS);o4.center=h.add(t,o,o4.center),o4.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),r4.center=h.add(t,o,r4.center),r4.radius=i;let r=Xl.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,u=ae.union(o4,r4),f=Che(s,e,!0),d=Ahe(a),p=d.length;d.length=p*2;let g=s.length/3;for(let E=0;E<p;E+=3)d[E+p]=d[E+2]+g,d[E+1+p]=d[E+1]+g,d[E+2+p]=d[E]+g;let m=Ne.createTypedArray(g*2/3,d),x=new at({attributes:f,indices:m,primitiveType:Me.TRIANGLES}),b=LQe(c,e);d=NQe(c);let T=Ne.createTypedArray(c.length*2/3,d),C=new at({attributes:b,indices:T,primitiveType:Me.TRIANGLES}),A=Ln.combineInstances([new vt({geometry:x}),new vt({geometry:C})]);return{boundingSphere:u,attributes:A[0].attributes,indices:A[0].indices}}function Ehe(e,t,n,i,o,r,s){let c=Xl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=se.fromCartesianArray(f,r,s);return d.width>P.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function Nm(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ee.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Ie.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ee.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Ie.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Nm.packedLength=h.packedLength+ee.packedLength+Ie.packedLength+9;Nm.pack=function(e,t,n){return n=y(n,0),h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var She=new h,vhe=new ee,whe=new Ie,Lm={center:She,ellipsoid:vhe,vertexFormat:whe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Nm.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,She);t+=h.packedLength;let o=ee.unpack(e,t,vhe);t+=ee.packedLength;let r=Ie.unpack(e,t,whe);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(Lm.height=f,Lm.extrudedHeight=p,Lm.granularity=d,Lm.stRotation=u,Lm.rotation=c,Lm.semiMajorAxis=s,Lm.semiMinorAxis=a,Lm.shadowVolume=g,Lm.offsetAttribute=m===-1?void 0:m,new Nm(Lm))};Nm.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,ee.default),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,P.RADIANS_PER_DEGREE),a=y(e.rotation,0);return Ehe(n,o,r,a,s,i,t)};Nm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=FQe(o);else if(r=MQe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===sn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new at({attributes:r.attributes,indices:r.indices,primitiveType:Me.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Nm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Nm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};function BQe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Xl.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return at._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(Nm.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Ehe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=BQe(this)),this._textureCoordinateRotationPoints}}});var ll=Nm;var Dhe=new h,cT=new h;function kQe(e){let t=e.center;cT=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,cT),e.height,cT),cT=h.add(t,cT,cT);let n=new ae(cT,e.semiMajorAxis),i=Xl.computeEllipsePositions(e,!1,!0).outerPositions,o=new fn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Xl.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ne.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var a4=new ae,c4=new ae;function VQe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,Dhe),e.height,Dhe);a4.center=h.add(t,o,a4.center),a4.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),c4.center=h.add(t,o,c4.center),c4.radius=i;let r=Xl.computeEllipsePositions(e,!1,!0).outerPositions,s=new fn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:Xl.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ae.union(a4,c4),c=r.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===sn.TOP)m=m.fill(1,0,c/2);else{let x=e.offsetAttribute===sn.NONE?0:1;m=m.fill(x)}s.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=y(e.numberOfVerticalLines,16);u=P.clamp(u,0,c/2);let f=Ne.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let x=Math.min(g*u,c);for(p=0;p<x;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function oS(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ee.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ee.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}oS.packedLength=h.packedLength+ee.packedLength+8;oS.pack=function(e,t,n){return n=y(n,0),h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Ihe=new h,Phe=new ee,$_={center:Ihe,ellipsoid:Phe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};oS.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Ihe);t+=h.packedLength;let o=ee.unpack(e,t,Phe);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):($_.height=c,$_.extrudedHeight=f,$_.granularity=u,$_.rotation=a,$_.semiMajorAxis=r,$_.semiMinorAxis=s,$_.numberOfVerticalLines=d,$_.offsetAttribute=p===-1?void 0:p,new oS($_))};oS.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=VQe(o);else if(r=kQe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===sn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new at({attributes:r.attributes,indices:r.indices,primitiveType:Me.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Hu=oS;var Rhe=new H,Ohe=h.ZERO,Mhe=new h,Lhe=new se;function UQe(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Ch(e,t){Wn.call(this,{entity:e,scene:t,geometryOptions:new UQe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Ch.prototype=Object.create(Wn.prototype),Ch.prototype.constructor=Ch);Ch.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Rhe)),l(o)||(o=H.WHITE),i.color=Wt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Ohe,Mhe))),new vt({id:t,geometry:new ll(this._options),attributes:i})};Ch.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Rhe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Ohe,Mhe))),new vt({id:t,geometry:new Hu(this._options),attributes:r})};Ch.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};Ch.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||ni.prototype._isHidden.call(this,e,t)};Ch.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!Y.isConstant(t.rotation)||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.numberOfVerticalLines)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};Ch.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrUndefined(t.height,He.MINIMUM_VALUE),i=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),o=Y.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),r=Y.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof zt?cn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(He.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(He.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(He.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=Y.getValueOrUndefined(t.rotation,He.MINIMUM_VALUE),s.granularity=Y.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),s.stRotation=Y.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),s.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,He.MINIMUM_VALUE),s.offsetAttribute=Wn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Wn.getGeometryHeight(n,i),o=Wn.getGeometryExtrudedHeight(o,r),o===Wn.CLAMP_TO_GROUND&&(o=li.getMinimumMaximumHeights(ll.computeRectangle(s,Lhe)).minimumTerrainHeight),s.extrudedHeight=o};Ch.DynamicGeometryUpdater=rS;function rS(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(rS.prototype=Object.create(ti.prototype),rS.prototype.constructor=rS);rS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ti.prototype._isHidden.call(this,e,t,n)};rS.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.center=Y.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=Y.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=Y.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=Y.getValueOrUndefined(t.rotation,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Wn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Wn.getGeometryHeight(o,r),s=Wn.getGeometryExtrudedHeight(s,a),s===Wn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(ll.computeRectangle(i,Lhe)).minimumTerrainHeight),i.extrudedHeight=s};var NN=Ch;var zQe=new h,HQe=new h,GQe=new h,WQe=new h,jQe=new h,qQe=new h(1,1,1),Nhe=Math.cos,Fhe=Math.sin;function Q_(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,qQe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,P.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),u=y(e.vertexFormat,Ie.DEFAULT);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Ie.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Q_.packedLength=2*h.packedLength+Ie.packedLength+7;Q_.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var Bhe=new h,khe=new h,Vhe=new Ie,n0={radii:Bhe,innerRadii:khe,vertexFormat:Vhe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Q_.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Bhe);t+=h.packedLength;let o=h.unpack(e,t,khe);t+=h.packedLength;let r=Ie.unpack(e,t,Vhe);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(n0.minimumClock=s,n0.maximumClock=a,n0.minimumCone=c,n0.maximumCone=u,n0.stackPartitions=f,n0.slicePartitions=d,n0.offsetAttribute=p===-1?void 0:p,new Q_(n0))};Q_.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/P.TWO_PI),u=Math.round(u*Math.abs(s-r)/P.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[r],m=[i];for(f=0;f<u;f++)g.push(r+f*(s-r)/(u-1));for(g.push(s),d=0;d<c;d++)m.push(i+d*(o-i)/(c-1));m.push(o);let x=g.length,b=m.length,T=0,C=1,A=n.x!==t.x||n.y!==t.y||n.z!==t.z,E=!1,v=!1,D=!1;A&&(C=2,r>0&&(E=!0,T+=c-1),s<Math.PI&&(v=!0,T+=c-1),(o-i)%P.TWO_PI?(D=!0,T+=(u-1)*2+1):T+=1);let O=b*x*C,R=new Float64Array(O*3),M=new Array(O).fill(!1),N=new Array(O).fill(!1),_=c*u*C,S=6*(_+T+1-(c+u)*C),w=Ne.createTypedArray(_,S),I=a.normal?new Float32Array(O*3):void 0,L=a.tangent?new Float32Array(O*3):void 0,B=a.bitangent?new Float32Array(O*3):void 0,U=a.st?new Float32Array(O*2):void 0,V=new Array(x),G=new Array(x);for(f=0;f<x;f++)V[f]=Fhe(g[f]),G[f]=Nhe(g[f]);let k=new Array(b),W=new Array(b);for(d=0;d<b;d++)W[d]=Nhe(m[d]),k[d]=Fhe(m[d]);for(f=0;f<x;f++)for(d=0;d<b;d++)R[p++]=t.x*V[f]*W[d],R[p++]=t.y*V[f]*k[d],R[p++]=t.z*G[f];let j=O/2;if(A)for(f=0;f<x;f++)for(d=0;d<b;d++)R[p++]=n.x*V[f]*W[d],R[p++]=n.y*V[f]*k[d],R[p++]=n.z*G[f],M[j]=!0,f>0&&f!==x-1&&d!==0&&d!==b-1&&(N[j]=!0),j++;p=0;let J,q;for(f=1;f<x-2;f++)for(J=f*b,q=(f+1)*b,d=1;d<b-2;d++)w[p++]=q+d,w[p++]=q+d+1,w[p++]=J+d+1,w[p++]=q+d,w[p++]=J+d+1,w[p++]=J+d;if(A){let tt=x*b;for(f=1;f<x-2;f++)for(J=tt+f*b,q=tt+(f+1)*b,d=1;d<b-2;d++)w[p++]=q+d,w[p++]=J+d,w[p++]=J+d+1,w[p++]=q+d,w[p++]=J+d+1,w[p++]=q+d+1}let K,Q;if(A){if(E)for(Q=x*b,f=1;f<b-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Q+f+1,w[p++]=f,w[p++]=Q+f+1,w[p++]=Q+f;if(v)for(K=x*b-b,Q=x*b*C-b,f=1;f<b-2;f++)w[p++]=K+f+1,w[p++]=K+f,w[p++]=Q+f,w[p++]=K+f+1,w[p++]=Q+f,w[p++]=Q+f+1}if(D){for(f=1;f<x-2;f++)Q=b*x+b*f,K=b*f,w[p++]=Q,w[p++]=K+b,w[p++]=K,w[p++]=Q,w[p++]=Q+b,w[p++]=K+b;for(f=1;f<x-2;f++)Q=b*x+b*(f+1)-1,K=b*(f+1)-1,w[p++]=K+b,w[p++]=Q,w[p++]=K,w[p++]=K+b,w[p++]=Q+b,w[p++]=Q}let de=new fn;a.position&&(de.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:R}));let ye=0,ce=0,_e=0,xe=0,De=O/2,Ae,ke=ee.fromCartesian3(t),ze=ee.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<O;f++){Ae=M[f]?ze:ke;let tt=h.fromArray(R,f*3,zQe),wt=Ae.geodeticSurfaceNormal(tt,HQe);if(N[f]&&h.negate(wt,wt),a.st){let _t=z.negate(wt,jQe);U[ye++]=Math.atan2(_t.y,_t.x)/P.TWO_PI+.5,U[ye++]=Math.asin(wt.z)/Math.PI+.5}if(a.normal&&(I[ce++]=wt.x,I[ce++]=wt.y,I[ce++]=wt.z),a.tangent||a.bitangent){let _t=GQe,Be=0,Yt;if(M[f]&&(Be=De),!E&&f>=Be&&f<Be+b*2?Yt=h.UNIT_X:Yt=h.UNIT_Z,h.cross(Yt,wt,_t),h.normalize(_t,_t),a.tangent&&(L[_e++]=_t.x,L[_e++]=_t.y,L[_e++]=_t.z),a.bitangent){let Et=h.cross(wt,_t,WQe);h.normalize(Et,Et),B[xe++]=Et.x,B[xe++]=Et.y,B[xe++]=Et.z}}}a.st&&(de.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:U})),a.normal&&(de.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(de.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:L})),a.bitangent&&(de.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:B}))}if(l(e._offsetAttribute)){let tt=R.length,wt=e._offsetAttribute===sn.NONE?0:1,_t=new Uint8Array(tt/3).fill(wt);de.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:_t})}return new at({attributes:de,indices:w,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromEllipsoid(ke),offsetAttribute:e._offsetAttribute})};var Q7;Q_.getUnitEllipsoid=function(){return l(Q7)||(Q7=Q_.createGeometry(new Q_({radii:new h(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),Q7};var Qs=Q_;var YQe=new zt(H.WHITE),J7=h.ZERO,eq=new h,XQe=new h,KQe=new h,tq=new H,ZQe=new h(1,1,1);function $Qe(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function Gu(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new $Qe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Gu.prototype=Object.create(ni.prototype),Gu.prototype.constructor=Gu);Object.defineProperties(Gu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Gu.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new gn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=kn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof zt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,tq)),l(f)||(f=H.WHITE),r=Wt.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,J7,eq))),new vt({id:i,geometry:new Qs(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};Gu.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,tq),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new gn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(r),distanceDisplayCondition:kn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,J7,eq))),new vt({id:i,geometry:new Mu(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Gu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};Gu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||ni.prototype._isHidden.call(this,e,t)};Gu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.radii.isConstant||!Y.isConstant(t.innerRadii)||!Y.isConstant(t.stackPartitions)||!Y.isConstant(t.slicePartitions)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.minimumClock)||!Y.isConstant(t.maximumClock)||!Y.isConstant(t.minimumCone)||!Y.isConstant(t.maximumCone)||!Y.isConstant(t.subdivisions)};Gu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof zt?cn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(He.MINIMUM_VALUE,i.radii),i.innerRadii=Y.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=Y.getValueOrUndefined(t.minimumClock,He.MINIMUM_VALUE),i.maximumClock=Y.getValueOrUndefined(t.maximumClock,He.MINIMUM_VALUE),i.minimumCone=Y.getValueOrUndefined(t.minimumCone,He.MINIMUM_VALUE),i.maximumCone=Y.getValueOrUndefined(t.maximumCone,He.MINIMUM_VALUE),i.stackPartitions=Y.getValueOrUndefined(t.stackPartitions,He.MINIMUM_VALUE),i.slicePartitions=Y.getValueOrUndefined(t.slicePartitions,He.MINIMUM_VALUE),i.subdivisions=Y.getValueOrUndefined(t.subdivisions,He.MINIMUM_VALUE),i.offsetAttribute=n!==Ye.NONE?sn.ALL:void 0};Gu.prototype._onEntityPropertyChanged=qp;Gu.DynamicGeometryUpdater=FN;function FN(e,t,n){ti.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}l(Object.create)&&(FN.prototype=Object.create(ti.prototype),FN.prototype.constructor=FN);FN.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!Y.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=Y.getValueOrUndefined(n.radii,e,XQe),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=Y.getValueOrDefault(n.fill,e,!0),s=Y.getValueOrDefault(n.outline,e,!1),a=Y.getValueOrClonedDefault(n.outlineColor,e,H.BLACK,tq),c=er.getValue(e,y(n.material,YQe),this._material),u=Y.getValueOrUndefined(n.innerRadii,e,KQe),f=Y.getValueOrUndefined(n.minimumClock,e),d=Y.getValueOrUndefined(n.maximumClock,e),p=Y.getValueOrUndefined(n.minimumCone,e),g=Y.getValueOrUndefined(n.maximumCone,e),m=Y.getValueOrUndefined(n.stackPartitions,e),x=Y.getValueOrUndefined(n.slicePartitions,e),b=Y.getValueOrUndefined(n.subdivisions,e),T=Y.getValueOrDefault(n.outlineWidth,e,1),C=Y.getValueOrDefault(n.heightReference,e,Ye.NONE),A=C!==Ye.NONE?sn.ALL:void 0,E=this._scene.mode,v=E===ne.SCENE3D&&C===Ye.NONE,D=this._options,O=this._geometryUpdater.shadowsProperty.getValue(e),M=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=Y.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,J7,eq);if(!v||this._lastSceneMode!==E||!l(this._primitive)||D.stackPartitions!==m||D.slicePartitions!==x||l(u)&&!h.equals(D.innerRadii!==u)||D.minimumClock!==f||D.maximumClock!==d||D.minimumCone!==p||D.maximumCone!==g||D.subdivisions!==b||this._lastOutlineWidth!==T||D.offsetAttribute!==A){let S=this._primitives;S.removeAndDestroy(this._primitive),S.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=T,D.stackPartitions=m,D.slicePartitions=x,D.subdivisions=b,D.offsetAttribute=A,D.radii=h.clone(v?ZQe:i,D.radii),l(u)?v?D.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,D.innerRadii):D.innerRadii=h.clone(u,D.innerRadii):D.innerRadii=void 0,D.minimumClock=f,D.maximumClock=d,D.minimumCone=p,D.maximumCone=g;let w=new ao({material:c,translucent:c.isTranslucent(),closed:!0});D.vertexFormat=w.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=S.add(new Dn({geometryInstances:I,appearance:w,asynchronous:!1,shadows:O}));let L=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=S.add(new Dn({geometryInstances:L,appearance:new cn({flat:!0,translucent:L.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(T)}}),asynchronous:!1,shadows:O})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=H.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=M,this._lastOffset=h.clone(N,this._lastOffset)}else if(this._primitive.ready){let S=this._primitive,w=this._outlinePrimitive;S.show=!0,w.show=!0,S.appearance.material=c;let I=this._attributes;l(I)||(I=S.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=gn.toValue(r,I.show),this._lastShow=r);let L=this._outlineAttributes;l(L)||(L=w.getGeometryInstanceAttributes(t),this._outlineAttributes=L),s!==this._lastOutlineShow&&(L.show=gn.toValue(s,L.show),this._lastOutlineShow=s),H.equals(a,this._lastOutlineColor)||(L.color=Wt.toValue(a,L.color),H.clone(a,this._lastOutlineColor)),Lt.equals(M,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=kn.toValue(M,I.distanceDisplayCondition),L.distanceDisplayCondition=kn.toValue(M,L.distanceDisplayCondition),Lt.clone(M,this._lastDistanceDisplayCondition)),h.equals(N,this._lastOffset)||(I.offset=Ji.toValue(N,I.offset),L.offset=Ji.toValue(N,I.offset),h.clone(N,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=F.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var BN=Gu;function sS(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Ie.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}sS.packedLength=Ie.packedLength;sS.pack=function(e,t,n){return n=y(n,0),Ie.pack(e._vertexFormat,t,n),t};var Uhe=new Ie,QQe={vertexFormat:Uhe};sS.unpack=function(e,t,n){t=y(t,0);let i=Ie.unpack(e,t,Uhe);return l(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n):new sS(QQe)};var l4=new h(-.5,-.5,0),u4=new h(.5,.5,0);sS.createGeometry=function(e){let t=e._vertexFormat,n=new fn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=l4.x,o[1]=l4.y,o[2]=0,o[3]=u4.x,o[4]=l4.y,o[5]=0,o[6]=u4.x,o[7]=u4.y,o[8]=0,o[9]=l4.x,o[10]=u4.y,o[11]=0,n.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new at({attributes:n,indices:i,primitiveType:Me.TRIANGLES,boundingSphere:new ae(h.ZERO,Math.sqrt(2))})};var kN=sS;function aS(){this._workerName="createPlaneOutlineGeometry"}aS.packedLength=0;aS.pack=function(e,t){return t};aS.unpack=function(e,t,n){return l(n)?n:new aS};var i0=new h(-.5,-.5,0),f4=new h(.5,.5,0);aS.createGeometry=function(){let e=new fn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=i0.x,n[1]=i0.y,n[2]=i0.z,n[3]=f4.x,n[4]=i0.y,n[5]=i0.z,n[6]=f4.x,n[7]=f4.y,n[8]=i0.z,n[9]=i0.x,n[10]=f4.y,n[11]=i0.z,e.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new at({attributes:e,indices:t,primitiveType:Me.LINES,boundingSphere:new ae(h.ZERO,Math.sqrt(2))})};var VN=aS;var JQe=new h,zhe=new H;function eJe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function rd(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new eJe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(rd.prototype=Object.create(ni.prototype),rd.prototype.constructor=rd);rd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof zt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,zhe)),l(g)||(g=H.WHITE),o=Wt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=Y.getValueOrDefault(c.plane,e,u.plane),p=Y.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=nq(d,p,f,f),new vt({id:t,geometry:new kN(this._options),modelMatrix:f,attributes:i})};rd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,zhe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=Y.getValueOrDefault(r.plane,e,s.plane),u=Y.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=nq(c,u,a,a),new vt({id:t,geometry:new VN,modelMatrix:a,attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};rd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||ni.prototype._isHidden.call(this,e,t)};rd.prototype._getIsClosed=function(e){return!1};rd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!Y.isConstant(t.outlineWidth)};rd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof zt,i=this._options;i.vertexFormat=n?cn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(He.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(He.MINIMUM_VALUE,i.dimensions)};rd.DynamicGeometryUpdater=cS;function cS(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(cS.prototype=Object.create(ti.prototype),cS.prototype.constructor=cS);cS.prototype._isHidden=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(e.position,n,JQe);return!l(o)||!l(i.plane)||!l(i.dimensions)||ti.prototype._isHidden.call(this,e,t,n)};cS.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=Y.getValueOrDefault(t.plane,n,i.plane),i.dimensions=Y.getValueOrUndefined(t.dimensions,n,i.dimensions)};var tJe=new h,nJe=new h,iJe=new h,oJe=new h,rJe=new $,sJe=new $,aJe=new F;function nq(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,iJe),a=h.clone(h.UNIT_Z,nJe);P.equalsEpsilon(Math.abs(h.dot(a,o)),1,P.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,tJe);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let u=rJe;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,o,u);let f=h.fromElements(t.x,t.y,1,oJe),d=$.multiplyByScale(u,f,sJe),p=F.fromRotationTranslation(d,s,aJe);return F.multiplyTransformation(n,p,i)}rd.createPrimitiveMatrix=nq;var UN=rd;var cJe=new h,lJe=new je,uJe=new z,fJe=new z,dJe=new h,hJe=new h,mJe=new h,zN=new h,pJe=new h,_Je=new h,Hhe=new Oe,gJe=new $,yJe=new $,xJe=new h;function bJe(e,t,n,i,o,r,s,a,c){let u=e.positions,f=ri.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=Ne.createTypedArray(u.length,f.length);d.set(f);let p=gJe;if(i!==0){let _=Oe.fromAxisAngle(s,i,Hhe);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Oe.fromAxisAngle(s,-i,Hhe);let S=$.fromQuaternion(_,yJe);a=h.normalize($.multiplyByVector(S,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=fJe;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,x=m*3,b=new Float64Array(x),T=t.normal?new Float32Array(x):void 0,C=t.tangent?new Float32Array(x):void 0,A=t.bitangent?new Float32Array(x):void 0,E=t.st?new Float32Array(m*2):void 0,v=0,D=0,O=0,R=0,M=0;for(let _=0;_<m;_++){let S=u[_];if(b[v++]=S.x,b[v++]=S.y,b[v++]=S.z,t.st)if(l(o)&&o.positions.length===m)E[M++]=o.positions[_].x,E[M++]=o.positions[_].y;else{let w=$.multiplyByVector(p,S,cJe),I=r(w,uJe);z.subtract(I,g,I);let L=P.clamp(I.x/n.width,0,1),B=P.clamp(I.y/n.height,0,1);E[M++]=L,E[M++]=B}t.normal&&(T[D++]=s.x,T[D++]=s.y,T[D++]=s.z),t.tangent&&(C[R++]=a.x,C[R++]=a.y,C[R++]=a.z),t.bitangent&&(A[O++]=c.x,A[O++]=c.y,A[O++]=c.z)}let N=new fn;return t.position&&(N.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b})),t.normal&&(N.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.tangent&&(N.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.bitangent&&(N.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.st&&(N.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:E})),new at({attributes:N,indices:d,primitiveType:Me.TRIANGLES})}function lT(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Ie.DEFAULT);this._vertexFormat=Ie.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=zn.computeHierarchyPackedLength(t,h)+Ie.packedLength+ee.packedLength+(l(n)?zn.computeHierarchyPackedLength(n,z):1)+2}lT.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new lT(t)};lT.pack=function(e,t,n){return n=y(n,0),n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=zn.packPolygonHierarchy(e._textureCoordinates,t,n,z):t[n++]=-1,t[n++]=e.packedLength,t};var TJe=ee.clone(ee.UNIT_SPHERE),CJe=new Ie,AJe={polygonHierarchy:{}};lT.unpack=function(e,t,n){t=y(t,0);let i=zn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,TJe);t+=ee.packedLength;let r=Ie.unpack(e,t,CJe);t+=Ie.packedLength;let s=e[t++],a=e[t]===-1?void 0:zn.unpackPolygonHierarchy(e,t,z);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new lT(AJe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};lT.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=Co(s,h.equalsEpsilon,!0),s.length<3)return;let a=dJe,c=hJe,u=mJe,f=pJe,d=_Je;if(!I_.computeProjectTo2DArguments(s,zN,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(zN,h.ZERO,P.EPSILON6)){let M=e._ellipsoid.geodeticSurfaceNormal(zN,xJe);h.dot(a,M)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=I_.createProjectPointsTo2DFunction(zN,f,d),m=I_.createProjectPointTo2DFunction(zN,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let x=zn.polygonsFromHierarchy(n,r,g,!1),b=x.hierarchy,T=x.polygons,C=function(M){return M},A=r?zn.polygonsFromHierarchy(o,!0,C,!1).polygons:void 0;if(b.length===0)return;s=b[0].outerRing;let E=ae.fromPoints(s),v=zn.computeBoundingRectangle(a,m,s,i,lJe),D=[];for(let M=0;M<T.length;M++){let N=new vt({geometry:bJe(T[M],t,v,i,r?A[M]:void 0,m,a,c,u)});D.push(N)}let O=Ln.combineInstances(D)[0];O.attributes.position.values=new Float64Array(O.attributes.position.values),O.indices=Ne.createTypedArray(O.attributes.position.values.length/3,O.indices);let R=O.attributes;return t.position||delete R.position,new at({attributes:R,indices:O.indices,primitiveType:O.primitiveType,boundingSphere:E})};var HN=lT;var Ghe=[],d4=[];function EJe(e,t,n,i,o){let s=Jr.fromPoints(t,e).projectPointsOntoPlane(t,Ghe);ri.computeWindingOrder2D(s)===hs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],x=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=x.x,c[d++]=x.y,c[d++]=x.z}else{let m=0;if(o===Jt.GEODESIC)for(u=0;u<f;u++)m+=zn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===Jt.RHUMB)for(u=0;u<f;u++)m+=zn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let x;o===Jt.GEODESIC?x=zn.subdivideLine(t[u],t[(u+1)%f],n,d4):o===Jt.RHUMB&&(x=zn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,d4));let b=x.length;for(let T=0;T<b;++T)c[d++]=x[T]}}f=c.length/3;let p=f*2,g=Ne.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d++]=0,new vt({geometry:new at({attributes:new fn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Me.LINES})})}function SJe(e,t,n,i,o){let s=Jr.fromPoints(t,e).projectPointsOntoPlane(t,Ghe);ri.computeWindingOrder2D(s)===hs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let b=t[u],T=t[(u+1)%f];c[p++]=b.x,c[p++]=b.y,c[p++]=b.z,c[p++]=T.x,c[p++]=T.y,c[p++]=T.z}else{let b=0;if(o===Jt.GEODESIC)for(u=0;u<f;u++)b+=zn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===Jt.RHUMB)for(u=0;u<f;u++)b+=zn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(b*3*2),u=0;u<f;++u){d[u]=p/3;let T;o===Jt.GEODESIC?T=zn.subdivideLine(t[u],t[(u+1)%f],n,d4):o===Jt.RHUMB&&(T=zn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,d4));let C=T.length;for(let A=0;A<C;++A)c[p++]=T[A]}}f=c.length/(3*2);let g=d.length,m=(f*2+g)*2,x=Ne.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)x[p++]=u,x[p++]=(u+1)%f,x[p++]=u+f,x[p++]=(u+1)%f+f;for(u=0;u<g;u++){let b=d[u];x[p++]=b,x[p++]=b+f}return new vt({geometry:new at({attributes:new fn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Me.LINES})})}function uT(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,ee.default),i=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.perPositionHeight,!1),r=o&&l(e.extrudedHeight),s=y(e.arcType,Jt.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!r){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=ee.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=zn.computeHierarchyPackedLength(t,h)+ee.packedLength+8}uT.pack=function(e,t,n){return n=y(n,0),n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var vJe=ee.clone(ee.UNIT_SPHERE),wJe={polygonHierarchy:{}};uT.unpack=function(e,t,n){t=y(t,0);let i=zn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,vJe);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new uT(wJe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};uT.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new uT(t)};uT.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=zn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],u=P.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,d,0,P.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=SJe(t,s[m],u,o,r),a.geometry=zn.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,o),l(e._offsetAttribute)){let T=a.geometry.attributes.position.values.length/3,C=new Uint8Array(T);e._offsetAttribute===sn.TOP?C=C.fill(1,0,T/2):(g=e._offsetAttribute===sn.NONE?0:1,C=C.fill(g)),a.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}c.push(a)}else for(m=0;m<s.length;m++){if(a=EJe(t,s[m],u,o,r),a.geometry.attributes.position.values=ri.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let T=a.geometry.attributes.position.values.length;g=e._offsetAttribute===sn.NONE?0:1;let C=new Uint8Array(T/3).fill(g);a.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}c.push(a)}let x=Ln.combineInstances(c)[0],b=ae.fromVertices(x.attributes.position.values);return new at({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};var GN=uT;var Whe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",jhe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",qhe=new H,Yhe=h.ZERO,Xhe=new h,Khe=new se,DJe=[],IJe=new z;function PJe(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function Wu(e,t){Wn.call(this,{entity:e,scene:t,geometryOptions:new PJe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Wu.prototype=Object.create(Wn.prototype),Wu.prototype.constructor=Wu);Wu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,qhe)),l(s)||(s=H.WHITE),o.color=Wt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Yhe,Xhe)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new HN(i):r=new s_(i),new vt({id:t,geometry:r,attributes:o})};Wu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,qhe),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(o),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Yhe,Xhe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new $f(i):a=new GN(i),new vt({id:t,geometry:a,attributes:s})};Wu.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=Jr.fromPoints(i,o),s=r.projectPointsOntoPlane(i,DJe),a=s.length,c=0,u=a-1,f=new z;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],x=g.x*m.y-m.x*g.y,b=z.add(g,m,IJe);b=z.multiplyByScalar(b,x,b),f=z.add(f,b,f),c+=x}let d=1/(c*3);return f=z.multiplyByScalar(f,d,f),r.projectPointOntoEllipsoid(f,t)};Wu.prototype._isHidden=function(e,t){return!l(t.hierarchy)||ni.prototype._isHidden.call(this,e,t)};Wu.prototype._isOnTerrain=function(e,t){let n=Wn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(He.MINIMUM_VALUE):!0);return n&&!o};Wu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.textureCoordinates)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.perPositionHeight)||!Y.isConstant(t.closeTop)||!Y.isConstant(t.closeBottom)||!Y.isConstant(t.zIndex)||!Y.isConstant(t.arcType)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};Wu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof zt,i=this._options;i.vertexFormat=n?cn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(He.MINIMUM_VALUE),r=Y.getValueOrUndefined(t.height,He.MINIMUM_VALUE),s=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),a=Y.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),c=Y.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE),u=Y.getValueOrDefault(t.perPositionHeight,He.MINIMUM_VALUE,!1);r=Wn.getGeometryHeight(r,s);let f;if(u?(l(r)&&(r=void 0,yt(Whe)),s!==Ye.NONE&&u&&(r=void 0,yt(jhe))):(l(a)&&!l(r)&&(r=0),f=Wn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=Y.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),i.stRotation=Y.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=Y.getValueOrDefault(t.closeTop,He.MINIMUM_VALUE,!0),i.closeBottom=Y.getValueOrDefault(t.closeBottom,He.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=Y.getValueOrDefault(t.arcType,He.MINIMUM_VALUE,Jt.GEODESIC),i.textureCoordinates=Y.getValueOrUndefined(t.textureCoordinates,He.MINIMUM_VALUE),a=Wn.getGeometryExtrudedHeight(a,c),a===Wn.CLAMP_TO_GROUND){let d=s_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Khe);a=li.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};Wu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};Wu.DynamicGeometryUpdater=lS;function lS(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(lS.prototype=Object.create(ti.prototype),lS.prototype.constructor=lS);lS.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ti.prototype._isHidden.call(this,e,t,n)};lS.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=Y.getValueOrUndefined(t.hierarchy,n);let o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),s=Y.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE),a=Y.getValueOrUndefined(t.extrudedHeight,n),c=Y.getValueOrUndefined(t.perPositionHeight,n);o=Wn.getGeometryHeight(o,s);let u;if(c?(l(o)&&(o=void 0,yt(Whe)),r!==Ye.NONE&&c&&(o=void 0,yt(jhe))):(l(a)&&!l(o)&&(o=0),u=Wn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=Y.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=Y.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=Y.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=Y.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=Y.getValueOrDefault(t.arcType,n,Jt.GEODESIC),a=Wn.getGeometryExtrudedHeight(a,s),a===Wn.CLAMP_TO_GROUND){let f=s_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Khe);a=li.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var WN=Wu;function RJe(e,t,n,i){let o=new fn;i.position&&(o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=ri.triangulate(t),u=(a-1)*r*6+c.length*2,f=Ne.createTypedArray(s,u),d,p,g,m,x,b,T=r*2,C=0;for(d=0;d<a-1;d++){for(p=0;p<r-1;p++)g=p*2+d*r*2,b=g+T,m=g+1,x=m+T,f[C++]=m,f[C++]=g,f[C++]=x,f[C++]=x,f[C++]=g,f[C++]=b;g=r*2-2+d*r*2,m=g+1,x=m+T,b=g+T,f[C++]=m,f[C++]=g,f[C++]=x,f[C++]=x,f[C++]=g,f[C++]=b}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),D=1/(a-1),O=1/n.height,R=n.height/2,M,N,_=0;for(d=0;d<a;d++){for(M=d*D,N=O*(t[0].y+R),v[_++]=M,v[_++]=N,p=1;p<r;p++)N=O*(t[p].y+R),v[_++]=M,v[_++]=N,v[_++]=M,v[_++]=N;N=O*(t[0].y+R),v[_++]=M,v[_++]=N}for(p=0;p<r;p++)M=0,N=O*(t[p].y+R),v[_++]=M,v[_++]=N;for(p=0;p<r;p++)M=(a-1)*D,N=O*(t[p].y+R),v[_++]=M,v[_++]=N;o.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let A=s-r*2;for(d=0;d<c.length;d+=3){let v=c[d]+A,D=c[d+1]+A,O=c[d+2]+A;f[C++]=v,f[C++]=D,f[C++]=O,f[C++]=O+r,f[C++]=D+r,f[C++]=v+r}let E=new at({attributes:o,indices:f,boundingSphere:ae.fromVertices(e),primitiveType:Me.TRIANGLES});if(i.normal&&(E=Ln.computeNormal(E)),i.tangent||i.bitangent){try{E=Ln.computeTangentAndBitangent(E)}catch{yt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(E.attributes.tangent=void 0),i.bitangent||(E.attributes.bitangent=void 0),i.st||(E.attributes.st=void 0)}return E}function qN(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+ee.packedLength+Ie.packedLength+2}qN.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Zhe=ee.clone(ee.UNIT_SPHERE),$he=new Ie,jN={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Zhe,vertexFormat:$he,cornerType:void 0,granularity:void 0};qN.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,Zhe);t+=ee.packedLength;let c=Ie.unpack(e,t,$he);t+=Ie.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(jN.polylinePositions=r,jN.shapePositions=s,jN.cornerType=u,jN.granularity=f,new qN(jN))};var OJe=new je;qN.createGeometry=function(e){let t=e._positions,n=Co(t,h.equalsEpsilon),i=e._shape;if(i=ph.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ri.computeWindingOrder2D(i)===hs.CLOCKWISE&&i.reverse();let o=je.fromPoints(i,OJe),r=ph.computePositions(n,i,o,e,!0);return RJe(r,i,o,e._vertexFormat)};var YN=qN;function MJe(e,t){let n=new fn;n.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Ne.createTypedArray(o,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new at({attributes:n,indices:Ne.createTypedArray(o,a),boundingSphere:ae.fromVertices(e),primitiveType:Me.LINES})}function KN(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._cornerType=y(e.cornerType,Mi.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+ee.packedLength+2}KN.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Qhe=ee.clone(ee.UNIT_SPHERE),XN={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Qhe,height:void 0,cornerType:void 0,granularity:void 0};KN.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,Qhe);t+=ee.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(XN.polylinePositions=r,XN.shapePositions=s,XN.cornerType=c,XN.granularity=u,new KN(XN))};var LJe=new je;KN.createGeometry=function(e){let t=e._positions,n=Co(t,h.equalsEpsilon),i=e._shape;if(i=ph.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ri.computeWindingOrder2D(i)===hs.CLOCKWISE&&i.reverse();let o=je.fromPoints(i,LJe),r=ph.computePositions(n,i,o,e,!1);return MJe(r,i)};var ZN=KN;var Jhe=new H;function NJe(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function Fm(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new NJe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Fm.prototype=Object.create(ni.prototype),Fm.prototype.constructor=Fm);Fm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof zt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Jhe)),l(c)||(c=H.WHITE),o=Wt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new vt({id:t,geometry:new YN(this._options),attributes:i})};Fm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Jhe),o=this._distanceDisplayConditionProperty.getValue(e);return new vt({id:t,geometry:new ZN(this._options),attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Fm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||ni.prototype._isHidden.call(this,e,t)};Fm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!Y.isConstant(t.granularity)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.cornerType)};Fm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof zt;o.vertexFormat=r?cn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(He.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(He.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(He.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(He.MINIMUM_VALUE):void 0};Fm.DynamicGeometryUpdater=uS;function uS(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(uS.prototype=Object.create(ti.prototype),uS.prototype.constructor=uS);uS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ti.prototype._isHidden.call(this,e,t,n)};uS.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=Y.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=Y.getValueOrUndefined(t.shape,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.cornerType=Y.getValueOrUndefined(t.cornerType,n)};var $N=Fm;var iq=new h,nme=new h,ime=new h,ome=new h,rme=new se,FJe=new z,BJe=new ae,kJe=new ae;function sme(e,t){let n=new at({attributes:new fn,primitiveType:Me.TRIANGLES});return n.attributes.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function VJe(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,u=ome,f=ime,d=nme;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=h.fromArray(e,p,iq),m=c+1,x=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),$.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(r[c]=d.x,r[m]=d.y,r[x]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[x]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[x]=u.z),c+=3}return sme(t,{positions:e,normals:r,tangents:s,bitangents:a})}var oq=new h,ame=new h;function UJe(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=ome,p=ime,g=nme;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let x=h.fromArray(e,m,iq),b=h.fromArray(e,(m+6)%i,oq);if(f){let T=h.fromArray(e,(m+3)%i,ame);h.subtract(b,x,b),h.subtract(T,x,T),g=h.normalize(h.cross(T,b,g),g),f=!1}h.equalsEpsilon(b,x,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(x,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(o[a++]=g.x,o[a++]=g.y,o[a++]=g.z,o[a++]=g.x,o[a++]=g.y,o[a++]=g.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return sme(t,{positions:e,normals:o,tangents:r,bitangents:s})}function cme(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,u=o,f=o,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=r*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,x=0,b=iq,T=FJe,C=Number.MAX_VALUE,A=Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let S=c;S<u;++S)for(let w=0;w<r;++w)Is.computePosition(t,i,n.st,S,w,b,T),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(g[x++]=T.x,g[x++]=T.y,C=Math.min(C,T.x),A=Math.min(A,T.y),E=Math.max(E,T.x),v=Math.max(v,T.y));if(s&&(Is.computePosition(t,i,n.st,0,0,b,T),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(g[x++]=T.x,g[x++]=T.y,C=T.x,A=T.y,E=T.x,v=T.y)),a&&(Is.computePosition(t,i,n.st,o-1,0,b,T),p[m++]=b.x,p[m++]=b.y,p[m]=b.z,n.st&&(g[x++]=T.x,g[x]=T.y,C=Math.min(C,T.x),A=Math.min(A,T.y),E=Math.max(E,T.x),v=Math.max(v,T.y))),n.st&&(C<0||A<0||E>1||v>1))for(let S=0;S<g.length;S+=2)g[S]=(g[S]-C)/(E-C),g[S+1]=(g[S+1]-A)/(v-A);let D=VJe(p,n,i,t.tangentRotationMatrix),O=6*(r-1)*(f-1);s&&(O+=3*(r-1)),a&&(O+=3*(r-1));let R=Ne.createTypedArray(d,O),M=0,N=0,_;for(_=0;_<f-1;++_){for(let S=0;S<r-1;++S){let w=M,I=w+r,L=I+1,B=w+1;R[N++]=w,R[N++]=I,R[N++]=B,R[N++]=B,R[N++]=I,R[N++]=L,++M}++M}if(s||a){let S=d-1,w=d-1;s&&a&&(S=d-2);let I,L;if(M=0,s)for(_=0;_<r-1;_++)I=M,L=I+1,R[N++]=S,R[N++]=I,R[N++]=L,++M;if(a)for(M=(f-1)*r,_=0;_<r-1;_++)I=M,L=I+1,R[N++]=I,R[N++]=w,R[N++]=L,++M}return D.indices=R,n.st&&(D.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:g})),D}function fS(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function dS(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var rq=new Ie;function zJe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Be=Ie.clone(o,rq);Be.normal=!0,e._vertexFormat=Be}let d=cme(e,t);n&&(e._vertexFormat=o);let p=ri.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,x=new Float64Array(m);x.set(p);let b=ri.scaleToGeodeticHeight(d.attributes.position.values,r,a);x.set(b,g),d.attributes.position.values=x;let T=o.normal?new Float32Array(m):void 0,C=o.tangent?new Float32Array(m):void 0,A=o.bitangent?new Float32Array(m):void 0,E=o.st?new Float32Array(m/3*2):void 0,v,D;if(o.normal){for(D=d.attributes.normal.values,T.set(D),f=0;f<g;f++)D[f]=-D[f];T.set(D,g),d.attributes.normal.values=T}if(n){D=d.attributes.normal.values,o.normal||(d.attributes.normal=void 0);let Be=new Float32Array(m);for(f=0;f<g;f++)D[f]=-D[f];Be.set(D,g),d.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:Be})}let O,R=l(i);if(R){let Be=g/3*2,Yt=new Uint8Array(Be);i===sn.TOP?Yt=Yt.fill(1,0,Be/2):(O=i===sn.NONE?0:1,Yt=Yt.fill(O)),d.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:Yt})}if(o.tangent){let Be=d.attributes.tangent.values;for(C.set(Be),f=0;f<g;f++)Be[f]=-Be[f];C.set(Be,g),d.attributes.tangent.values=C}if(o.bitangent){let Be=d.attributes.bitangent.values;A.set(Be),A.set(Be,g),d.attributes.bitangent.values=A}o.st&&(v=d.attributes.st.values,E.set(v),E.set(v,g/3*2),d.attributes.st.values=E);let M=d.indices,N=M.length,_=g/3,S=Ne.createTypedArray(m/3,N*2);for(S.set(M),f=0;f<N;f+=3)S[f+N]=M[f+2]+_,S[f+1+N]=M[f+1]+_,S[f+2+N]=M[f]+_;d.indices=S;let w=t.northCap,I=t.southCap,L=c,B=2,U=0,V=4,G=4;w&&(B-=1,L-=1,U+=1,V-=2,G-=1),I&&(B-=1,L-=1,U+=1,V-=2,G-=1),U+=B*u+2*L-V;let k=(U+G)*2,W=new Float64Array(k*3),j=n?new Float32Array(k*3):void 0,J=R?new Uint8Array(k):void 0,q=o.st?new Float32Array(k*2):void 0,K=i===sn.TOP;R&&!K&&(O=i===sn.ALL?1:0,J=J.fill(O));let Q=0,de=0,ye=0,ce=0,_e=u*L,xe;for(f=0;f<_e;f+=u)xe=f*3,W=fS(W,Q,xe,p,b),Q+=6,o.st&&(q=dS(q,de,f*2,v),de+=4),n&&(ye+=3,j[ye++]=D[xe],j[ye++]=D[xe+1],j[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1);if(I){let Be=w?_e+1:_e;for(xe=Be*3,f=0;f<2;f++)W=fS(W,Q,xe,p,b),Q+=6,o.st&&(q=dS(q,de,Be*2,v),de+=4),n&&(ye+=3,j[ye++]=D[xe],j[ye++]=D[xe+1],j[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1)}else for(f=_e-u;f<_e;f++)xe=f*3,W=fS(W,Q,xe,p,b),Q+=6,o.st&&(q=dS(q,de,f*2,v),de+=4),n&&(ye+=3,j[ye++]=D[xe],j[ye++]=D[xe+1],j[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1);for(f=_e-1;f>0;f-=u)xe=f*3,W=fS(W,Q,xe,p,b),Q+=6,o.st&&(q=dS(q,de,f*2,v),de+=4),n&&(ye+=3,j[ye++]=D[xe],j[ye++]=D[xe+1],j[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1);if(w){let Be=_e;for(xe=Be*3,f=0;f<2;f++)W=fS(W,Q,xe,p,b),Q+=6,o.st&&(q=dS(q,de,Be*2,v),de+=4),n&&(ye+=3,j[ye++]=D[xe],j[ye++]=D[xe+1],j[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1)}else for(f=u-1;f>=0;f--)xe=f*3,W=fS(W,Q,xe,p,b),Q+=6,o.st&&(q=dS(q,de,f*2,v),de+=4),n&&(ye+=3,j[ye++]=D[xe],j[ye++]=D[xe+1],j[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1);let De=UJe(W,o,a);o.st&&(De.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:q})),n&&(De.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:j})),R&&(De.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:J}));let Ae=Ne.createTypedArray(k,U*6),ke,ze,tt,wt;g=W.length/3;let _t=0;for(f=0;f<g-1;f+=2){ke=f,wt=(ke+2)%g;let Be=h.fromArray(W,ke*3,oq),Yt=h.fromArray(W,wt*3,ame);h.equalsEpsilon(Be,Yt,P.EPSILON10)||(ze=(ke+1)%g,tt=(ze+2)%g,Ae[_t++]=ke,Ae[_t++]=ze,Ae[_t++]=wt,Ae[_t++]=wt,Ae[_t++]=ze,Ae[_t++]=tt)}return De.indices=Ae,De=Ln.combineInstances([new vt({geometry:d}),new vt({geometry:De})]),De[0]}var HJe=[new h,new h,new h,new h],lme=new fe,GJe=new fe;function sq(e,t,n,i,o){if(n===0)return se.clone(e,o);let r=Is.computeOptions(e,t,n,0,rme,lme),s=r.height,a=r.width,c=HJe;return Is.computePosition(r,i,!1,0,0,c[0]),Is.computePosition(r,i,!1,0,a-1,c[1]),Is.computePosition(r,i,!1,s-1,0,c[2]),Is.computePosition(r,i,!1,s-1,a-1,c[3]),se.fromCartesianArray(c,i,o)}function Bm(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=se.clone(t),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Bm.packedLength=se.packedLength+ee.packedLength+Ie.packedLength+7;Bm.pack=function(e,t,n){return n=y(n,0),se.pack(e._rectangle,t,n),n+=se.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var ume=new se,fme=ee.clone(ee.UNIT_SPHERE),o0={rectangle:ume,ellipsoid:fme,vertexFormat:rq,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Bm.unpack=function(e,t,n){t=y(t,0);let i=se.unpack(e,t,ume);t+=se.packedLength;let o=ee.unpack(e,t,fme);t+=ee.packedLength;let r=Ie.unpack(e,t,rq);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=se.clone(i,n._rectangle),n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(o0.granularity=s,o0.height=a,o0.rotation=c,o0.stRotation=u,o0.extrudedHeight=f,o0.shadowVolume=d,o0.offsetAttribute=p===-1?void 0:p,new Bm(o0))};Bm.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.ellipsoid,ee.default),r=y(e.rotation,0);return sq(n,i,r,o,t)};var WJe=new $,eme=new Oe,jJe=new fe;Bm.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Is.computeOptions(t,e._granularity,i,o,rme,lme,GJe),a=WJe;if(o!==0||i!==0){let g=se.center(t,jJe),m=n.geodeticSurfaceNormalCartographic(g,oq);Oe.fromAxisAngle(m,-o,eme),$.fromQuaternion(eme,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!P.equalsEpsilon(c,u,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=zJe(e,s);let g=ae.fromRectangle3D(t,n,c,kJe),m=ae.fromRectangle3D(t,n,u,BJe);p=ae.union(g,m)}else{if(d=cme(e,s),d.attributes.position.values=ri.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===sn.NONE?0:1,x=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=ae.fromRectangle3D(t,n,c)}return r.position||delete d.attributes.position,new at({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Bm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Bm({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};var tme=new se,qJe=[new z,new z,new z],YJe=new Ii,XJe=new fe;function KJe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=se.clone(e._rectangle,tme),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=sq(t,n,o,i,tme),s=qJe;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=Ii.fromRotation(e._stRotation,YJe),u=se.center(a,XJe);for(let m=0;m<3;++m){let x=s[m];x.x-=u.longitude,x.y-=u.latitude,Ii.multiplyByVector(c,x,x),x.x+=u.longitude,x.y+=u.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return z.pack(f,g),z.pack(d,g,2),z.pack(p,g,4),g}Object.defineProperties(Bm.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=sq(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=KJe(this)),this._textureCoordinateRotationPoints}}});var fT=Bm;var dme=new H,hme=h.ZERO,mme=new h,pme=new se,ZJe=new se,$Je=new fe;function QJe(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Ah(e,t){Wn.call(this,{entity:e,scene:t,geometryOptions:new QJe(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Ah.prototype=Object.create(Wn.prototype),Ah.prototype.constructor=Ah);Ah.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,dme)),l(o)||(o=H.WHITE),i.color=Wt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,hme,mme))),new vt({id:t,geometry:new fT(this._options),attributes:i})};Ah.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,dme),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,hme,mme))),new vt({id:t,geometry:new Vb(this._options),attributes:r})};Ah.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.rectangle.coordinates,e,ZJe);if(!l(n))return;let i=se.center(n,$Je);return fe.toCartesian(i,ee.default,t)};Ah.prototype._isHidden=function(e,t){return!l(t.coordinates)||ni.prototype._isHidden.call(this,e,t)};Ah.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.rotation)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};Ah.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof zt,i=Y.getValueOrUndefined(t.height,He.MINIMUM_VALUE),o=Y.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),r=Y.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),s=Y.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?cn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(He.MINIMUM_VALUE,a.rectangle),a.granularity=Y.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),a.stRotation=Y.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),a.rotation=Y.getValueOrUndefined(t.rotation,He.MINIMUM_VALUE),a.offsetAttribute=Wn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Wn.getGeometryHeight(i,o),r=Wn.getGeometryExtrudedHeight(r,s),r===Wn.CLAMP_TO_GROUND&&(r=li.getMinimumMaximumHeights(fT.computeRectangle(a,pme)).minimumTerrainHeight),a.extrudedHeight=r};Ah.DynamicGeometryUpdater=hS;function hS(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(hS.prototype=Object.create(ti.prototype),hS.prototype.constructor=hS);hS.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ti.prototype._isHidden.call(this,e,t,n)};hS.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,Ye.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=Y.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.rotation=Y.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Wn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Wn.getGeometryHeight(o,r),s=Wn.getGeometryExtrudedHeight(s,a),s===Wn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(fT.computeRectangle(i,pme)).minimumTerrainHeight),i.extrudedHeight=s};var QN=Ah;var _me={};function JJe(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var eet=new fe,tet=new fe;function net(e,t,n,i){t=Co(t,h.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),u=new Array(o),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,eet);s&&(d.height=n[0]),c[0]=d.height,r?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,x=1;for(let b=1;b<o;++b){let T=t[b],C=e.cartesianToCartographic(T,tet);s&&(C.height=n[b]),m=m&&C.height===0,JJe(d,C)?d.height<C.height&&(c[x-1]=C.height):(a[x]=T,c[x]=C.height,r?u[x]=i[b]:u[x]=0,m=m&&c[x]===u[x],fe.clone(C,d),++x)}if(!(m||x<2))return a.length=x,c.length=x,u.length=x,{positions:a,topHeights:c,bottomHeights:u}}var iet=new Array(2),oet=new Array(2),ret={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};_me.computePositions=function(e,t,n,i,o,r){let s=net(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=P.chordLength(o,e.maximumRadius),p=ret;if(p.minDistance=d,p.ellipsoid=e,r){let g=0,m;for(m=0;m<a-1;m++)g+=Oi.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let x=iet,b=oet;p.positions=x,p.height=b;let T=0;for(m=0;m<a-1;m++){x[0]=t[m],x[1]=t[m+1],b[0]=n[m],b[1]=n[m+1];let C=Oi.generateArc(p);u.set(C,T),b[0]=i[m],b[1]=i[m+1],f.set(Oi.generateArc(p),T),T+=C.length}}else p.positions=t,p.height=n,u=new Float64Array(Oi.generateArc(p)),p.height=i,f=new Float64Array(Oi.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var dT=_me;var aq=new h,h4=new h,set=new h,gme=new h,aet=new h,cet=new h,uet=new h;function hT(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.ellipsoid,ee.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Ie.clone(o),this._granularity=r,this._ellipsoid=ee.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ee.packedLength+Ie.packedLength+1}hT.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._granularity,t};var yme=ee.clone(ee.UNIT_SPHERE),xme=new Ie,JN={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:yme,vertexFormat:xme,granularity:void 0};hT.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ee.unpack(e,t,yme);t+=ee.packedLength;let u=Ie.unpack(e,t,xme);t+=Ie.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._vertexFormat=Ie.clone(u,n._vertexFormat),n._granularity=f,n):(JN.positions=r,JN.minimumHeights=s,JN.maximumHeights=a,JN.granularity=f,new hT(JN))};hT.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new hT(c)};hT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=dT.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,x=o.tangent?new Float32Array(p):void 0,b=o.bitangent?new Float32Array(p):void 0,T=o.st?new Float32Array(p/3*2):void 0,C=0,A=0,E=0,v=0,D=0,O=uet,R=cet,M=aet,N=!0;d/=3;let _,S=0,w=1/(d-f-1);for(_=0;_<d;++_){let V=_*3,G=h.fromArray(u,V,aq),k=h.fromArray(c,V,h4);if(o.position&&(g[C++]=k.x,g[C++]=k.y,g[C++]=k.z,g[C++]=G.x,g[C++]=G.y,g[C++]=G.z),o.st&&(T[D++]=S,T[D++]=0,T[D++]=S,T[D++]=1),o.normal||o.tangent||o.bitangent){let W=h.clone(h.ZERO,gme),j=h.subtract(G,s.geodeticSurfaceNormal(G,h4),h4);if(_+1<d&&(W=h.fromArray(u,V+3,gme)),N){let J=h.subtract(W,G,set),q=h.subtract(j,G,aq);O=h.normalize(h.cross(q,J,O),O),N=!1}h.equalsEpsilon(G,W,P.EPSILON10)?N=!0:(S+=w,o.tangent&&(R=h.normalize(h.subtract(W,G,R),R)),o.bitangent&&(M=h.normalize(h.cross(O,R,M),M))),o.normal&&(m[A++]=O.x,m[A++]=O.y,m[A++]=O.z,m[A++]=O.x,m[A++]=O.y,m[A++]=O.z),o.tangent&&(x[v++]=R.x,x[v++]=R.y,x[v++]=R.z,x[v++]=R.x,x[v++]=R.y,x[v++]=R.z),o.bitangent&&(b[E++]=M.x,b[E++]=M.y,b[E++]=M.z,b[E++]=M.x,b[E++]=M.y,b[E++]=M.z)}}let I=new fn;o.position&&(I.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(I.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(I.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),o.bitangent&&(I.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(I.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T}));let L=p/3;p-=6*(f+1);let B=Ne.createTypedArray(L,p),U=0;for(_=0;_<L-2;_+=2){let V=_,G=_+2,k=h.fromArray(g,V*3,aq),W=h.fromArray(g,G*3,h4);if(h.equalsEpsilon(k,W,P.EPSILON10))continue;let j=_+1,J=_+3;B[U++]=j,B[U++]=V,B[U++]=J,B[U++]=J,B[U++]=V,B[U++]=G}return new at({attributes:I,indices:B,primitiveType:Me.TRIANGLES,boundingSphere:new ae.fromVertices(g)})};var eF=hT;var bme=new h,Tme=new h;function mT(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.ellipsoid,ee.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ee.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ee.packedLength+1}mT.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n]=e._granularity,t};var Cme=ee.clone(ee.UNIT_SPHERE),tF={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Cme,granularity:void 0};mT.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ee.unpack(e,t,Cme);t+=ee.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._granularity=u,n):(tF.positions=r,tF.minimumHeights=s,tF.maximumHeights=a,tF.granularity=u,new mT(tF))};mT.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new mT(c)};mT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=dT.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let C=g*3,A=h.fromArray(c,C,bme),E=h.fromArray(a,C,Tme);d[p++]=E.x,d[p++]=E.y,d[p++]=E.z,d[p++]=A.x,d[p++]=A.y,d[p++]=A.z}let m=new fn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d})}),x=f/3;f=2*x-4+x;let b=Ne.createTypedArray(x,f),T=0;for(g=0;g<x-2;g+=2){let C=g,A=g+2,E=h.fromArray(d,C*3,bme),v=h.fromArray(d,A*3,Tme);if(h.equalsEpsilon(E,v,P.EPSILON10))continue;let D=g+1,O=g+3;b[T++]=D,b[T++]=C,b[T++]=D,b[T++]=O,b[T++]=C,b[T++]=A}return b[T++]=x-2,b[T++]=x-1,new at({attributes:m,indices:b,primitiveType:Me.LINES,boundingSphere:new ae.fromVertices(d)})};var nF=mT;var Ame=new H;function fet(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Eh(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new fet(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Eh.prototype=Object.create(ni.prototype),Eh.prototype.constructor=Eh);Eh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof zt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Ame)),l(c)||(c=H.WHITE),o=Wt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new vt({id:t,geometry:new eF(this._options),attributes:i})};Eh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,H.BLACK,Ame),o=this._distanceDisplayConditionProperty.getValue(e);return new vt({id:t,geometry:new nF(this._options),attributes:{show:new gn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Eh.prototype._isHidden=function(e,t){return!l(t.positions)||ni.prototype._isHidden.call(this,e,t)};Eh.prototype._getIsClosed=function(e){return!1};Eh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Y.isConstant(t.minimumHeights)||!Y.isConstant(t.maximumHeights)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.granularity)};Eh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof zt,s=this._options;s.vertexFormat=r?cn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(He.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(He.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(He.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(He.MINIMUM_VALUE):void 0};Eh.DynamicGeometryUpdater=mS;function mS(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(mS.prototype=Object.create(ti.prototype),mS.prototype.constructor=mS);mS.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ti.prototype._isHidden.call(this,e,t,n)};mS.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=Y.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=Y.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=Y.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=Y.getValueOrUndefined(t.granularity,n)};var iF=Eh;var pT=[uR,CN,mN,NN,BN,UN,WN,$N,QN,iF];function _T(e,t){this.entity=e,this.scene=t;let n=new Array(pT.length),i=new me,o=new dr;for(let r=0;r<n.length;r++){let s=new pT[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(_T.prototype._onEntityPropertyChanged,this)}_T.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};_T.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};_T.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};_T.registerUpdater=function(e){pT.includes(e)||pT.push(e)};_T.unregisterUpdater=function(e){if(pT.includes(e)){let t=pT.indexOf(e);pT.splice(t,1)}};var gT=_T;var Eme=new H,det=new Lt,het=new Lt,met=h.ZERO,pet=new h;function Sh(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.updaters=new St,this.updatersWithAttributes=new St,this.attributes=new St,this.subscriptions=new St,this.showsUpdated=new St,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(Sh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Sh.prototype.onMaterialChanged=function(){this.invalidated=!0};Sh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Sh.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty)||!Y.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Sh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Sh.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=er.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Dn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof zt)&&(this.depthFailMaterial=er.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let b=u.fillMaterialProperty.color,T=Y.getValueOrDefault(b,e,H.WHITE,Eme);H.equals(d._lastColor,T)||(d._lastColor=H.clone(T,d._lastColor),d.color=Wt.toValue(T,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof zt&&(!u.depthFailMaterialProperty.isConstant||c)){let b=u.depthFailMaterialProperty.color,T=Y.getValueOrDefault(b,e,H.WHITE,Eme);H.equals(d._lastDepthFailColor,T)||(d._lastDepthFailColor=H.clone(T,d._lastDepthFailColor),d.depthFailColor=Wt.toValue(T,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,het,det);Lt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Lt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(b,d.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!Y.isConstant(x)){let b=Y.getValueOrDefault(x,e,met,pet);h.equals(b,d._lastOffset)||(d._lastOffset=h.clone(b,d._lastOffset),d.offset=Ji.toValue(b,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Sh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Sh.prototype.contains=function(e){return this.updaters.contains(e.id)};Sh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ct.FAILED:(i.boundingSphere.clone(t),ct.DONE)};Sh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function pS(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}pS.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new Sh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Sme(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}pS.prototype.remove=function(e){Sme(this._solidItems,e)||Sme(this._translucentItems,e)};function vme(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function m4(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}pS.prototype.update=function(e){let t=m4(this,this._solidItems,e,!0);t=m4(this,this._translucentItems,e,t)&&t;let n=vme(this,this._solidItems,e),i=vme(this,this._translucentItems,e);return(n||i)&&(t=m4(this,this._solidItems,e,t)&&t,t=m4(this,this._translucentItems,e,t)&&t),t};function wme(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return ct.FAILED}pS.prototype.getBoundingSphere=function(e,t){let n=wme(this._solidItems,e,t);return n===ct.FAILED?wme(this._translucentItems,e,t):n};function Dme(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}pS.prototype.removeAllPrimitives=function(){Dme(this._solidItems),Dme(this._translucentItems)};var sd=pS;var _et=new Lt,get=new Lt,yet=h.ZERO,xet=new h;function vh(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new St,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new St,this.attributes=new St,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(vh.prototype.onMaterialChanged,this),this.subscriptions=new St,this.showsUpdated=new St}vh.prototype.onMaterialChanged=function(){this.invalidated=!0};vh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};vh.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty)||!Y.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};vh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var bet=new H;vh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=er.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=er.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Dn({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=er.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof zt)&&(this.depthFailMaterial=er.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof zt&&!c.depthFailMaterialProperty.isConstant){let b=c.depthFailMaterialProperty.color,T=Y.getValueOrDefault(b,e,H.WHITE,bet);H.equals(d._lastDepthFailColor,T)||(d._lastDepthFailColor=H.clone(T,d._lastDepthFailColor),d.depthFailColor=Wt.toValue(T,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,get,_et);Lt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Lt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(b,d.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!Y.isConstant(x)){let b=Y.getValueOrDefault(x,e,yet,xet);h.equals(b,d._lastOffset)||(d._lastOffset=h.clone(b,d._lastOffset),d.offset=Ji.toValue(b,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};vh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};vh.prototype.contains=function(e){return this.updaters.contains(e.id)};vh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ct.FAILED:(i.boundingSphere.clone(t),ct.DONE)};vh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function _S(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}_S.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new vh(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};_S.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};_S.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};_S.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ct.FAILED};_S.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var ad=_S;var Pme=Ko(Ime(),1);function p4(){this._tree=new Pme.default}function yT(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}yT.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};p4.prototype.insert=function(e,t){let n=yT.fromRectangleAndId(e,t,new yT);this._tree.insert(n)};function Tet(e,t){return e.id===t.id}var Cet=new yT;p4.prototype.remove=function(e,t){let n=yT.fromRectangleAndId(e,t,Cet);this._tree.remove(n,Tet)};var Aet=new yT;p4.prototype.collides=function(e){let t=yT.fromRectangleAndId("",e,Aet);return this._tree.collides(t)};var xT=p4;var Eet=new H,vet=new Lt,wet=new Lt;function J_(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.updaters=new St,this.updatersWithAttributes=new St,this.attributes=new St,this.subscriptions=new St,this.showsUpdated=new St,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new xT}J_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};J_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};J_.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};J_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Wc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let x=u.fillMaterialProperty.color,b=Y.getValueOrDefault(x,e,H.WHITE,Eet);H.equals(d._lastColor,b)||(d._lastColor=H.clone(b,d._lastColor),d.color=Wt.toValue(b,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let x=Y.getValueOrDefault(m,e,wet,vet);Lt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Lt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};J_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};J_.prototype.contains=function(e){return this.updaters.contains(e.id)};J_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),ct.DONE):ct.FAILED};J_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function gS(e,t){this._batches=[],this._primitives=e,this._classificationType=t}gS.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=Y.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new J_(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};gS.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};gS.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};gS.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ct.FAILED};gS.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var yS=gS;var Det=new Lt,Iet=new Lt;function cd(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new St,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.material=void 0,this.updatersWithAttributes=new St,this.attributes=new St,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(cd.prototype.onMaterialChanged,this),this.subscriptions=new St,this.showsUpdated=new St,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new xT}cd.prototype.onMaterialChanged=function(){this.invalidated=!0};cd.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};cd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof zt&&t instanceof zt?!0:l(t)&&t.equals(n)};cd.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};cd.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};cd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=er.getValue(e,this.materialProperty,this.material),n=new Wc({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=er.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let x=Y.getValueOrDefault(m,e,Iet,Det);Lt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Lt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};cd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};cd.prototype.contains=function(e){return this.updaters.contains(e.id)};cd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ct.FAILED:(i.boundingSphere.clone(t),ct.DONE)};cd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function xS(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}xS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=xu.shouldUseSphericalCoordinates(o.geometry.rectangle),s=Y.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new cd(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};xS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};xS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};xS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ct.FAILED};xS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var oF=xS;var Pet=new H,Ret=new Lt,Oet=new Lt,Met=h.ZERO,Let=new h;function eg(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.updaters=new St,this.updatersWithAttributes=new St,this.attributes=new St,this.itemsToRemove=[],this.subscriptions=new St,this.showsUpdated=new St}eg.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty)||!Y.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};eg.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};eg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Dn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new cn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let b=u.outlineColorProperty,T=Y.getValueOrDefault(b,e,H.WHITE,Pet);H.equals(d._lastColor,T)||(d._lastColor=H.clone(T,d._lastColor),d.color=Wt.toValue(T,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,Oet,Ret);Lt.equals(b,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Lt.clone(b,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(b,d.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!Y.isConstant(x)){let b=Y.getValueOrDefault(x,e,Met,Let);h.equals(b,d._lastOffset)||(d._lastOffset=h.clone(b,d._lastOffset),d.offset=Ji.toValue(b,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};eg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=gn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};eg.prototype.contains=function(e){return this.updaters.contains(e.id)};eg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ct.FAILED:(i.boundingSphere.clone(t),ct.DONE)};eg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function bS(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new St,this._translucentBatches=new St}bS.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new eg(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new eg(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};bS.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};bS.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d=!1;do{for(d=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(d);return f};bS.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return ct.FAILED};bS.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var TS=bS;var Net=[];function Kl(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new St,this._removedObjects=new St,this._changedObjects=new St;let o=yn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=tr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new TS(n,e,s,!1),this._outlineBatches[o+s]=new TS(n,e,s,!0),this._closedColorBatches[s]=new sd(n,cn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new sd(n,cn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new ad(n,ao,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new ad(n,ao,void 0,!0,s,!1),this._openColorBatches[s]=new sd(n,cn,void 0,!1,s,!0),this._openColorBatches[o+s]=new sd(n,cn,void 0,!1,s,!1),this._openMaterialBatches[s]=new ad(n,ao,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new ad(n,ao,void 0,!1,s,!1);let a=Vn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new oF(i,s,ao)),c[s]=new yS(i,s);else for(s=0;s<a;++s)c[s]=new yS(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new sT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new St,this._updaterSets=new St,this._entityCollection=t,t.collectionChanged.addEventListener(Kl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Net)}Kl.registerUpdater=function(e){gT.registerUpdater(e)};Kl.unregisterUpdater=function(e){gT.unregisterUpdater(e)};Kl.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(x){d._removeUpdater(x),d._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new gT(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(x){d._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Kl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var Fet=[],Bet=new ae;Kl.prototype.getBoundingSphere=function(e,t){let n=Fet,i=Bet,o=0,r=ct.DONE,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(d,i),r===ct.PENDING)return ct.PENDING;r===ct.DONE&&(n[o]=ae.clone(i,n[o]),o++)}}return o===0?ct.FAILED:(n.length=o,ae.fromBoundingSpheres(n,t),ct.DONE)};Kl.prototype.isDestroyed=function(){return!1};Kl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Kl.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),ue(this)};Kl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Kl.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=yn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof zt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof zt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof zt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Kl._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Kl.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var rF=Kl;var ket=1,Vet="30px sans-serif",Uet=jo.FILL,zet=H.WHITE,Het=H.BLACK,Get=1,Wet=!1,jet=new H(.165,.165,.165,.8),qet=new z(7,5),Yet=z.ZERO,Xet=h.ZERO,Ket=Ye.NONE,Zet=gi.CENTER,$et=Rn.CENTER,Qet=new h,Jet=new H,ett=new H,ttt=new H,ntt=new z,itt=new h,ott=new z,rtt=new kt,stt=new kt,att=new kt,ctt=new Lt;function Rme(e){this.entity=e,this.label=void 0,this.index=void 0}function r0(e,t){t.collectionChanged.addEventListener(r0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new St,this._onCollectionChanged(t,t.values,[],[])}r0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,u=r.label,f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;if(f&&(d=Y.getValueOrUndefined(s._position,e,Qet),c=Y.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){uq(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=Y.getValueOrDefault(a._heightReference,e,Ket);l(u)||(u=n.getLabel(s),u.id=s,r.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=Y.getValueOrDefault(a._scale,e,ket),u.font=Y.getValueOrDefault(a._font,e,Vet),u.style=Y.getValueOrDefault(a._style,e,Uet),u.fillColor=Y.getValueOrDefault(a._fillColor,e,zet,Jet),u.outlineColor=Y.getValueOrDefault(a._outlineColor,e,Het,ett),u.outlineWidth=Y.getValueOrDefault(a._outlineWidth,e,Get),u.showBackground=Y.getValueOrDefault(a._showBackground,e,Wet),u.backgroundColor=Y.getValueOrDefault(a._backgroundColor,e,jet,ttt),u.backgroundPadding=Y.getValueOrDefault(a._backgroundPadding,e,qet,ntt),u.pixelOffset=Y.getValueOrDefault(a._pixelOffset,e,Yet,ott),u.eyeOffset=Y.getValueOrDefault(a._eyeOffset,e,Xet,itt),u.heightReference=g,u.horizontalOrigin=Y.getValueOrDefault(a._horizontalOrigin,e,Zet),u.verticalOrigin=Y.getValueOrDefault(a._verticalOrigin,e,$et),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,rtt),u.pixelOffsetScaleByDistance=Y.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,stt),u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,att),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,ctt),u.disableDepthTestDistance=Y.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};r0.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return ct.FAILED;let i=n.label;return t.center=h.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,ct.DONE};r0.prototype.isDestroyed=function(){return!1};r0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(r0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};r0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new Rme(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Rme(r)):(uq(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],uq(s.get(r.id),r,a),s.remove(r.id)};function uq(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var sF=r0;var ltt=1,utt=!0,ftt=0,dtt=!0,htt=!0,mtt=yn.ENABLED,ptt=Ye.NONE,_tt=H.RED,gtt=0,ytt=H.WHITE,xtt=mc.HIGHLIGHT,btt=.5,Ttt=new z(1,1),Ctt=new F,Att=new F,Ome=new H,Mme=new Array(4),Ett=new h;function s0(e,t){t.collectionChanged.addEventListener(s0.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new St,this._onCollectionChanged(t,t.values,[],[])}async function Stt(e,t,n,i){let o=e._primitives,r=e._modelHash;try{let s=await ah.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(r[t.id]))return;s.id=t,o.add(s),r[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(r[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(r[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(r[t.id]))return;console.log(s),r[t.id].loadFailed=!0}}s0.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,Ctt),c=Se.createIfNeeded(Y.getValueOrUndefined(a._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1},n[s.id]=u;let m=Y.getValueOrDefault(a._incrementallyLoadTextures,e,dtt);Stt(this,s,c,m)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=Y.getValueOrDefault(a._scale,e,ltt),p.enableVerticalExaggeration=Y.getValueOrDefault(a._enableVerticalExaggeration,e,utt),p.minimumPixelSize=Y.getValueOrDefault(a._minimumPixelSize,e,ftt),p.maximumScale=Y.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(d,p.modelMatrix),p.shadows=Y.getValueOrDefault(a._shadows,e,mtt),p.heightReference=Y.getValueOrDefault(a._heightReference,e,ptt),p.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=Y.getValueOrDefault(a._silhouetteColor,e,_tt,Ome),p.silhouetteSize=Y.getValueOrDefault(a._silhouetteSize,e,gtt),p.color=Y.getValueOrDefault(a._color,e,ytt,Ome),p.colorBlendMode=Y.getValueOrDefault(a._colorBlendMode,e,xtt),p.colorBlendAmount=Y.getValueOrDefault(a._colorBlendAmount,e,btt),p.clippingPlanes=Y.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=Y.getValueOrDefault(a._clampAnimations,e,htt),p.imageBasedLighting.imageBasedLightingFactor=Y.getValueOrDefault(a._imageBasedLightingFactor,e,Ttt);let g=Y.getValueOrUndefined(a._lightColor,e);if(l(g)&&(H.pack(g,Mme,0),g=h.unpack(Mme,0,Ett)),p.lightColor=g,p.customShader=Y.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=Y.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:zl.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let x=Y.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(x)){let C=Object.keys(x);for(let A=0,E=C.length;A<E;++A){let v=C[A],D=x[v];if(!l(D))continue;let O=p.getNode(v);if(!l(O))continue;let R=F.fromTranslationRotationScale(D,Att);O.matrix=F.multiply(O.originalMatrix,R,R)}}let b=!1,T=Y.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(T)){let C=Object.keys(T);for(let A=0,E=C.length;A<E;++A){let v=C[A],D=T[v];l(D)&&(b=!0,p.setArticulationStage(v,D))}}b&&p.applyArticulations()}}return!0};s0.prototype.isDestroyed=function(){return!1};s0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(s0.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)fq(this,e[i],t,n);return ue(this)};var _4=new h,vtt=new fe;s0.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return ct.FAILED;if(n.loadFailed)return ct.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return ct.PENDING;if(!i.ready||!n.modelUpdated)return ct.PENDING;let o=this._scene,r=y(o.ellipsoid,ee.default);if(i.heightReference!==Ye.NONE){let a=i.modelMatrix;_4.x=a[12],_4.y=a[13],_4.z=a[14];let c=r.cartesianToCartographic(_4,vtt),u=o.getHeight(c,i.heightReference);return l(u)&&(wf(i.heightReference)?c.height=u:c.height+=u),ae.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),ct.DONE}return ae.clone(i.boundingSphere,t),ct.DONE};s0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(wtt(r,a),s.set(r.id,r)):(fq(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],fq(this,r,a,c),s.remove(r.id)};function fq(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function wtt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var aF=s0;function a0(e){this._definitionChanged=new me,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(a0.prototype,{isConstant:{get:function(){return Y.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Ui.FIXED}}});var Dtt=new Z;a0.prototype.getValue=function(e,t){return l(e)||(e=Z.now(Dtt)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};a0.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};a0.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ee.default.scaleToGeodeticSurface(n,n):void 0};a0.prototype.equals=function(e){return this===e||e instanceof a0&&this._value===e._value};a0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var km=a0;var Itt=60,Ptt=1,Nme=new An,dq=new An,hq=new An;function Lme(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function Rtt(e,t,n,i,o,r,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,r,c[u]),l(f)&&(c[u++]=f);let d=!l(o)||Z.lessThanOrEquals(o,t)||Z.greaterThanOrEquals(o,n),p=0,g=i.length,m=i[p],x=n,b=!1,T,C,A;for(;p<g;){if(!d&&Z.greaterThanOrEquals(m,o)&&(f=e.getValueInReferenceFrame(o,r,c[u]),l(f)&&(c[u++]=f),d=!0),Z.greaterThan(m,t)&&Z.lessThan(m,x)&&!m.equals(o)&&(f=e.getValueInReferenceFrame(m,r,c[u]),l(f)&&(c[u++]=f)),p<g-1){if(s>0&&!b){let E=i[p+1],v=Z.secondsDifference(E,m);b=v>s,b&&(T=Math.ceil(v/s),C=0,A=v/Math.max(T,2),T=Math.max(T-1,1))}if(b&&C<T){m=Z.addSeconds(m,A,new Z),C++;continue}}b=!1,p++,m=i[p]}return f=e.getValueInReferenceFrame(n,r,c[u]),l(f)&&(c[u++]=f),u}function Ott(e,t,n,i,o,r,s,a){let c,u=0,f=s,d=t,p=!l(i)||Z.lessThanOrEquals(i,t)||Z.greaterThanOrEquals(i,n);for(;Z.lessThan(d,n);)!p&&Z.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,a[f]),l(c)&&(a[f]=c,f++),u++,d=Z.addSeconds(t,r*u,new Z);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function Mtt(e,t,n,i,o,r,s,a){let c,u=0,f=s,d=t,p=Math.max(r,60),g=!l(i)||Z.lessThanOrEquals(i,t)||Z.greaterThanOrEquals(i,n);for(;Z.lessThan(d,n);)!g&&Z.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,o,a[f]),l(c)&&(a[f]=c,f++),u++,d=Z.addSeconds(t,p*u,new Z);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function Ltt(e,t,n,i,o,r,s,a){hq.start=t,hq.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!An.intersect(d,hq,Nme).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=Z.addSeconds(d.start,Z.secondsDifference(d.stop,d.start)/2,new Z));let g=e.getValueInReferenceFrame(p,o,a[c]);l(g)&&(a[c]=g,c++)}}return c}function Ntt(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function Ftt(e,t,n,i,o,r,s,a){dq.start=t,dq.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!An.intersect(d,dq,Nme).isEmpty){let p=d.start,g=d.stop,m=t;Z.greaterThan(p,m)&&(m=p);let x=n;Z.lessThan(g,x)&&(x=g),c=Fme(d.data,m,x,i,o,r,c,a)}}return c}function Fme(e,t,n,i,o,r,s,a){for(;e instanceof q_;)e=e.resolvedProperty;if(e instanceof _a){let c=e._property._times;s=Rtt(e,t,n,c,i,o,r,s,a)}else e instanceof fR?s=Ott(e,t,n,i,o,r,s,a):e instanceof ma?s=Ftt(e,t,n,i,o,r,s,a):e instanceof Y_?s=Ltt(e,t,n,i,o,r,s,a):e instanceof qc||e instanceof km&&Y.isConstant(e)?s=Ntt(e,t,n,i,o,r,s,a):s=Mtt(e,t,n,i,o,r,s,a);return s}function Bme(e,t,n,i,o,r,s){l(s)||(s=[]);let a=Fme(e,t,n,i,o,r,0,s);return s.length=a,s}var Btt=new $;function cF(e,t){this._unusedIndexes=[],this._polylineCollection=new uh,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}cF.prototype.update=function(e){if(this._referenceFrame===Ui.INERTIAL){let t=Mt.computeIcrfToCentralBodyFixedMatrix(e,Btt);F.fromRotationTranslation(t,h.ZERO,this._polylineCollection.modelMatrix)}};cF.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let d=Y.getValueOrUndefined(i._leadTime,e),p=Y.getValueOrUndefined(i._trailTime,e),g=n._availability,m=l(g),x=l(d),b=l(p);if(u=m||x&&b,u){if(b&&(r=Z.addSeconds(e,-p,new Z)),x&&(s=Z.addSeconds(e,d,new Z)),m){let T=g.start,C=g.stop;(!b||Z.greaterThan(T,r))&&(r=T),(!x||Z.lessThan(C,s))&&(s=C)}u=Z.lessThan(r,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let d=this._unusedIndexes;if(d.length>0){let g=d.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=Y.getValueOrDefault(i._resolution,e,Itt);c.show=!0,c.positions=Bme(o,r,s,e,this._referenceFrame,f,c.positions.slice()),c.material=er.getValue(e,i._material,c.material),c.width=Y.getValueOrDefault(i._width,e,Ptt),c.distanceDisplayCondition=Y.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};cF.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};cF.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function c0(e,t){t.collectionChanged.addEventListener(c0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new St,this._onCollectionChanged(t,t.values,[],[])}c0.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,u=Ui.FIXED;this._scene.mode===ne.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(f)||(f=new cF(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,l(f)&&f.updateObject(e,r)}return!0};c0.prototype.isDestroyed=function(){return!1};c0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(c0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};c0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new Lme(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Lme(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};c0._subSample=Bme;var lF=c0;var kme=H.WHITE,Vme=H.BLACK,Ume=0,zme=1,Hme=0,Gme=Br.NONE,Wme=new H,ktt=new h,jme=new H,qme=new kt,Yme=new kt,Xme=new Lt;function Kme(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function l0(e,t){t.collectionChanged.addEventListener(l0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new St,this._onCollectionChanged(t,t.values,[],[])}l0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,u=r.billboard,f=Y.getValueOrDefault(a._heightReference,e,Ye.NONE),d=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),p;if(d&&(p=Y.getValueOrUndefined(s._position,e,ktt),d=l(p)),!d){uF(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==Ye.NONE&&!l(u)?(l(c)&&(uF(r,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===Ye.NONE&&!l(c)&&(l(u)&&(uF(r,s,n),u=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,qme),c.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,Yme),c.color=Y.getValueOrDefault(a._color,e,kme,Wme),c.outlineColor=Y.getValueOrDefault(a._outlineColor,e,Vme,jme),c.outlineWidth=Y.getValueOrDefault(a._outlineWidth,e,Ume),c.pixelSize=Y.getValueOrDefault(a._pixelSize,e,zme),c.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,Xme),c.disableDepthTestDistance=Y.getValueOrDefault(a._disableDepthTestDistance,e,Hme),c.splitDirection=Y.getValueOrDefault(a._splitDirection,e,Gme);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,qme),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,Yme),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,Xme),u.disableDepthTestDistance=Y.getValueOrDefault(a._disableDepthTestDistance,e,Hme),u.splitDirection=Y.getValueOrDefault(a._splitDirection,e,Gme),u.heightReference=f;let x=Y.getValueOrDefault(a._color,e,kme,Wme),b=Y.getValueOrDefault(a._outlineColor,e,Vme,jme),T=Math.round(Y.getValueOrDefault(a._outlineWidth,e,Ume)),C=Math.max(1,Math.round(Y.getValueOrDefault(a._pixelSize,e,zme)));if(T>0?(u.scale=1,g=g||T!==r.outlineWidth||C!==r.pixelSize||!H.equals(x,r.color)||!H.equals(b,r.outlineColor)):(u.scale=C/50,C=50,g=g||T!==r.outlineWidth||!H.equals(x,r.color)||!H.equals(b,r.outlineColor)),g){r.color=H.clone(x,r.color),r.outlineColor=H.clone(b,r.outlineColor),r.pixelSize=C,r.outlineWidth=T;let A=x.alpha,E=x.toCssColorString(),v=b.toCssColorString(),D=JSON.stringify([E,C,v,T]);u.setImage(D,Rb(A,E,v,T,C))}m&&u._updateClamping()}}return!0};l0.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return ct.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ct.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ct.DONE};l0.prototype.isDestroyed=function(){return!1};l0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(l0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};l0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new Kme(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Kme(r)):(uF(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],uF(s.get(r.id),r,a),s.remove(r.id)};function uF(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var fF=l0;var epe=[];function Vtt(e,t,n,i,o){let r=epe;r.length=o;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(H.equals(n,i)){for(s=0;s<o;s++)r[s]=H.clone(n);return r}let x=(d-a)/o,b=(p-c)/o,T=(g-u)/o,C=(m-f)/o;for(s=0;s<o;s++)r[s]=new H(a+s*x,c+s*b,u+s*T,f+s*C);return r}function dF(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),o=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._arcType=y(e.arcType,Jt.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*H.packedLength:1,this.packedLength=r+ee.packedLength+Ie.packedLength+4}dF.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=H.packedLength)H.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var tpe=ee.clone(ee.UNIT_SPHERE),npe=new Ie,bT={positions:void 0,colors:void 0,ellipsoid:tpe,vertexFormat:npe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};dF.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=ee.unpack(e,t,tpe);t+=ee.packedLength;let c=Ie.unpack(e,t,npe);t+=Ie.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(bT.positions=r,bT.colors=s,bT.width=u,bT.colorsPerVertex=f,bT.arcType=d,bT.granularity=p,new dF(bT))};var Zme=new h,$me=new h,Qme=new h,Jme=new h;dF.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Co(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let L=0,B=d[0];i=i.filter(function(U,V){let G=!1;return o?G=V===B||V===0&&B===1:G=V+1===B,G?(L++,B=d[L],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===Jt.GEODESIC||r===Jt.RHUMB){let L,B;r===Jt.GEODESIC?(L=P.chordLength(s,a.maximumRadius),B=Oi.numberOfPoints):(L=s,B=Oi.numberOfPointsRhumbLine);let U=Oi.extractHeights(p,a);if(l(i)){let V=1;for(c=0;c<g-1;++c)V+=B(p[c],p[c+1],L);let G=new Array(V),k=0;for(c=0;c<g-1;++c){let W=p[c],j=p[c+1],J=i[c],q=B(W,j,L);if(o&&c<V){let K=i[c+1],Q=Vtt(W,j,J,K,q),de=Q.length;for(u=0;u<de;++u)G[k++]=Q[u]}else for(u=0;u<q;++u)G[k++]=H.clone(J)}G[k]=H.clone(i[i.length-1]),i=G,epe.length=0}r===Jt.GEODESIC?p=Oi.generateCartesianArc({positions:p,minDistance:L,ellipsoid:a,height:U}):p=Oi.generateCartesianRhumbArc({positions:p,granularity:L,ellipsoid:a,height:U})}g=p.length;let m=g*4-4,x=new Float64Array(m*3),b=new Float64Array(m*3),T=new Float64Array(m*3),C=new Float32Array(m*2),A=n.st?new Float32Array(m*2):void 0,E=l(i)?new Uint8Array(m*4):void 0,v=0,D=0,O=0,R=0,M;for(u=0;u<g;++u){u===0?(M=Zme,h.subtract(p[0],p[1],M),h.add(p[0],M,M)):M=p[u-1],h.clone(M,Qme),h.clone(p[u],$me),u===g-1?(M=Zme,h.subtract(p[g-1],p[g-2],M),h.add(p[g-1],M,M)):M=p[u+1],h.clone(M,Jme);let L,B;l(E)&&(u!==0&&!o?L=i[u-1]:L=i[u],u!==g-1&&(B=i[u]));let U=u===0?2:0,V=u===g-1?2:4;for(f=U;f<V;++f){h.pack($me,x,v),h.pack(Qme,b,v),h.pack(Jme,T,v),v+=3;let G=f-2<0?-1:1;if(C[D++]=2*(f%2)-1,C[D++]=G*t,n.st&&(A[O++]=u/(g-1),A[O++]=Math.max(C[D-2],0)),l(E)){let k=f<2?L:B;E[R++]=H.floatToByte(k.red),E[R++]=H.floatToByte(k.green),E[R++]=H.floatToByte(k.blue),E[R++]=H.floatToByte(k.alpha)}}}let N=new fn;N.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x}),N.prevPosition=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),N.nextPosition=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T}),N.expandAndWidth=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:C}),n.st&&(N.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:A})),l(E)&&(N.color=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0}));let _=Ne.createTypedArray(m,g*6-6),S=0,w=0,I=g-1;for(u=0;u<I;++u)_[w++]=S,_[w++]=S+2,_[w++]=S+1,_[w++]=S+1,_[w++]=S+2,_[w++]=S+3,S+=4;return new at({attributes:N,indices:_,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromPoints(p),geometryType:Tf.POLYLINES})};var tg=dF;var Utt=new Kn(0),g4={},ipe=new H,ztt=new zt(H.WHITE),Htt=new Kn(!0),Gtt=new Kn(yn.DISABLED),Wtt=new Kn(new Lt),jtt=new Kn(Vn.BOTH);function qtt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Ytt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function wh(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(wh.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new me,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new qtt,this._groundGeometryOptions=new Ytt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=tr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(wh.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&Y.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});wh.prototype.isOutlineVisible=function(e){return!1};wh.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};wh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new gn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof zt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,ipe)),l(a)||(a=H.WHITE),s.color=Wt.fromColor(a)),this.clampToGround?new vt({id:t,geometry:new Nx(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof zt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,ipe)),l(a)||(a=H.WHITE),s.depthFailColor=Wt.fromColor(a)),new vt({id:t,geometry:new tg(this._geometryOptions),attributes:s}))};wh.prototype.createOutlineGeometryInstance=function(e){};wh.prototype.isDestroyed=function(){return!1};wh.prototype.destroy=function(){this._entitySubscription(),ue(this)};wh.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(He.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=y(o.material,ztt),u=c instanceof zt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=y(s,Htt),this._shadowsProperty=y(o.shadows,Gtt),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,Wtt),this._classificationTypeProperty=y(o.classificationType,jtt),this._fillEnabled=!0,this._zIndex=y(a,Utt);let f=o.width,d=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!Y.isConstant(f)||!Y.isConstant(d)||!Y.isConstant(g)||!Y.isConstant(p)||!Y.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,x=r.getValue(He.MINIMUM_VALUE,m.positions);if(!l(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let b;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof zt)?b=es.VERTEX_FORMAT:b=la.VERTEX_FORMAT,m.vertexFormat=b,m.positions=x,m.width=l(f)?f.getValue(He.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(He.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(He.MINIMUM_VALUE):void 0;let T=this._groundGeometryOptions;T.positions=x,T.width=m.width,T.arcType=m.arcType,T.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(He.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&yt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};wh.prototype.createDynamicUpdater=function(e,t){return new hF(e,t,this)};var CS={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function hF(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function ope(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=g4[n];!l(i)||i.isDestroyed()?(i=new uh,g4[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}hF.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=Y.getValueOrUndefined(o,e,this._positions);t._clampToGround=Y.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=Y.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=Y.getValueOrDefault(i._arcType,e,Jt.GEODESIC),t._groundGeometryOptions.granularity=Y.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!Y.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof zt)p=new es;else{let g=er.getValue(e,d,this._material);p=new la({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Ud({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),Y.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=ope(this);if(!n.isShowing||!n.isAvailable(e)||!Y.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=Jt.GEODESIC;c=Y.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==Jt.NONE&&l(u)&&(CS.ellipsoid=f,CS.positions=r,CS.granularity=Y.getValueOrUndefined(i._granularity,e),CS.height=Oi.extractHeights(r,f),c===Jt.GEODESIC?r=Oi.generateCartesianArc(CS):r=Oi.generateCartesianRhumbArc(CS)),a.show=!0,a.positions=r.slice(),a.material=er.getValue(e,t.fillMaterialProperty,a.material),a.width=Y.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=Y.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};hF.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ae.clone(n.boundingSphere,e),ct.DONE}return l(t)&&!t.ready?ct.PENDING:ct.DONE}else{let t=ope(this);if(t.show&&t.positions.length>0)return ae.fromPoints(t.positions,e),ct.DONE}return ct.FAILED};hF.prototype.isDestroyed=function(){return!1};hF.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=g4[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete g4[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var mF=wh;var Xtt=new H,Ktt=new Lt,Ztt=new Lt;function Dh(e,t,n,i,o){let r;n instanceof zt?r=es:r=la,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new St,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.material=void 0,this.updatersWithAttributes=new St,this.attributes=new St,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Dh.prototype.onMaterialChanged,this),this.subscriptions=new St,this.showsUpdated=new St,this.zIndex=i,this._asynchronous=o}Dh.prototype.onMaterialChanged=function(){this.invalidated=!0};Dh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof zt&&t instanceof zt?!0:l(t)&&t.equals(n)};Dh.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Dh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Dh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Ud({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===la&&(this.material=er.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===la&&(this.material=er.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,b=Y.getValueOrDefault(x,e,H.WHITE,Xtt);H.equals(d._lastColor,b)||(d._lastColor=H.clone(b,d._lastColor),d.color=Wt.toValue(b,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=gn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let x=Y.getValueOrDefault(m,e,Ztt,Ktt);Lt.equals(x,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Lt.clone(x,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=kn.toValue(x,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Dh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=gn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Dh.prototype.contains=function(e){return this.updaters.contains(e.id)};Dh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ct.FAILED:(i.boundingSphere.clone(t),ct.DONE)};Dh.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function AS(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}AS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Y.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new Dh(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};AS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};AS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};AS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ct.FAILED};AS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var pF=AS;var $tt=[];function rpe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function spe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof zt?1:2);let r;l(i)&&(r=i+o*yn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof zt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Vm(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new St,this._removedObjects=new St,this._changedObjects=new St;let o,r=yn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new sd(n,es,void 0,!1,o),this._materialBatches[o]=new ad(n,la,void 0,!1,o),this._colorBatches[o+r]=new sd(n,es,es,!1,o),this._materialBatches[o+r]=new ad(n,la,es,!1,o),this._colorBatches[o+r*2]=new sd(n,es,la,!1,o),this._materialBatches[o+r*2]=new ad(n,la,la,!1,o);this._dynamicBatch=new sT(n,i);let s=Vn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new pF(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new St,this._updaters=new St,this._entityCollection=t,t.collectionChanged.addEventListener(Vm.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,$tt)}Vm.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(rpe(this,f),spe(this,e,f)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaters.get(u),rpe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new mF(c,this._scene),this._updaters.set(u,f),spe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Vm._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var Qtt=[],Jtt=new ae;Vm.prototype.getBoundingSphere=function(e,t){let n=Qtt,i=Jtt,o=0,r=ct.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(c,i),r===ct.PENDING)return ct.PENDING;r===ct.DONE&&(n[o]=ae.clone(i,n[o]),o++)}return o===0?ct.FAILED:(n.length=o,ae.fromBoundingSpheres(n,t),ct.DONE)};Vm.prototype.isDestroyed=function(){return!1};Vm.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Vm.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};Vm._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Vm.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var _F=Vm;function Zl(e){Wc.initializeTerrainHeights(),Ud.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new dr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Zl.defaultVisualizersCallback);let i=!1,o=new Yl,r=new Yl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new xN;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var ES=[];Zl.registerVisualizer=function(e){ES.includes(e)||ES.push(e)};Zl.unregisterVisualizer=function(e){if(ES.includes(e)){let t=ES.indexOf(e);ES.splice(t,1)}};Zl.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new o1(t,i),new rF(e,i,n._primitives,n._groundPrimitives),new sF(t,i),new aF(e,i),new rN(e,i),new fF(t,i),new lF(e,i),new _F(e,i,n._primitives,n._groundPrimitives),...ES.map(o=>new o(e,i))]};Object.defineProperties(Zl.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Zl.prototype.isDestroyed=function(){return!1};Zl.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};Zl.prototype.update=function(e){if(!li.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=t,t};Zl.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var ent=[],tnt=new ae;Zl.prototype.getBoundingSphere=function(e,t,n){if(!this._ready&&!t)return ct.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let g=p.get(i);if(g.entities.contains(e)){r=g;break}}}if(!l(r))return ct.FAILED;let s=ent,a=tnt,c=0,u=ct.DONE,f=r._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===ct.PENDING)return ct.PENDING;u===ct.DONE&&(s[c]=ae.clone(a,s[c]),c++)}}return c===0?ct.FAILED:(s.length=c,ae.fromBoundingSpheres(s,n),ct.DONE)};Zl.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Yl),s=o.add(new LN);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Zl.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Zl.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var gF=Zl;function mq(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}mq.clone=function(e,t){if(l(e))return l(t)||(t=new mq),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var ld=mq;var ape=new $,cpe=new $,lpe=new $,nnt=new F,y4=new h,upe=new h,pq=new h,_q=new h,fpe=new h,dpe=new h,int=new Oe,ont=new h,rnt=new $,SS=new Z,snt=1.25;function ant(e,t,n,i,o,r,s,a,c,u){let f=e.scene.mode,d=o.getValue(c,e._lastCartesian);if(l(d)){let p=!1,g=!1,m,x,b;if(f===ne.SCENE3D){Z.addSeconds(c,.001,SS);let O=o.getValue(SS,y4);if(l(O)||(Z.addSeconds(c,-.001,SS),O=o.getValue(SS,y4),g=!0),l(O)){let R=Mt.computeFixedToIcrfMatrix(c,ape),M=Mt.computeFixedToIcrfMatrix(SS,cpe),N;!l(R)||!l(M)?(N=Mt.computeTemeToPseudoFixedMatrix(c,lpe),R=$.transpose(N,ape),M=Mt.computeTemeToPseudoFixedMatrix(SS,cpe),$.transpose(M,M)):N=$.transpose(R,lpe);let _=$.multiplyByVector(R,d,fpe),S=$.multiplyByVector(M,O,dpe);h.subtract(_,S,_q);let w=h.magnitude(_q)*1e3,I=P.GRAVITATIONALPARAMETER,L=-I/(w*w-2*I/h.magnitude(_));L<0||L>snt*u.maximumRadius?(m=upe,h.normalize(d,m),h.negate(m,m),b=h.clone(h.UNIT_Z,pq),x=h.cross(b,m,y4),h.magnitude(x)>P.EPSILON7&&(h.normalize(m,m),h.normalize(x,x),b=h.cross(m,x,pq),h.normalize(b,b),p=!0)):h.equalsEpsilon(d,O,P.EPSILON7)||(b=upe,h.normalize(_,b),h.normalize(S,S),x=h.cross(b,S,pq),g&&(x=h.multiplyByScalar(x,-1,x)),h.equalsEpsilon(x,h.ZERO,P.EPSILON7)||(m=h.cross(x,b,y4),$.multiplyByVector(N,m,m),$.multiplyByVector(N,x,x),$.multiplyByVector(N,b,b),h.normalize(m,m),h.normalize(x,x),h.normalize(b,b),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let T,C,A;i&&(T=h.clone(t.position,_q),C=h.clone(t.direction,fpe),A=h.clone(t.up,dpe));let E=nnt,v;l(s)&&(v=s.getValue(c,int));let D=r.getValue(c,ont);if(a===Bp.INERTIAL&&l(v))F.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===Bp.VELOCITY&&l(D)){let O=Mt.rotationMatrixFromPositionVelocity(d,D,u,rnt);F.fromRotationTranslation(O,d,E)}else a===Bp.ENU||!p?Mt.eastNorthUpToFixedFrame(d,u,E):(E[0]=m.x,E[1]=m.y,E[2]=m.z,E[3]=0,E[4]=x.x,E[5]=x.y,E[6]=x.z,E[7]=0,E[8]=b.x,E[9]=b.y,E[10]=b.z,E[11]=0,E[12]=d.x,E[13]=d.y,E[14]=d.z,E[15]=0);t._setTransform(E),i&&(h.clone(T,t.position),h.clone(C,t.direction),h.clone(A,t.up),h.cross(C,A,t.right))}if(n){let p=f===ne.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function yF(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,ee.default),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new K_(e.position,!0),this._offset3D=new h}Object.defineProperties(yF,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});yF.defaultOffset3D=new h(-14e3,3500,3500);var x4=new ld,cnt=new h;yF.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ne.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,d=o!==this._mode,p=n.camera,g=f||d,m=!0;if(f){let x=r.viewFrom,b=l(x);if(!b&&l(t)){x4.pitch=-P.PI_OVER_FOUR,x4.range=0;let T=a.getValue(e,cnt);if(l(T)){let C=2-1/Math.max(1,h.magnitude(T)/i.maximumRadius);x4.pitch*=C}p.viewBoundingSphere(t,x4),this.boundingSphere=t,g=!1,m=!1}else(!b||!l(x.getValue(e,this._offset3D)))&&h.clone(yF._defaultOffset3D,this._offset3D)}else!d&&this._mode!==ne.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,ant(this,p,g,m,a,c,u,s,e,i)};var xF=yF;function TF(){this._cache={}}TF.prototype.fromColor=function(e,t){return b4(void 0,void 0,e,t,this._cache)};TF.prototype.fromUrl=function(e,t,n){return b4(e,void 0,t,n,this._cache)};TF.prototype.fromMakiIconId=function(e,t,n){return b4(nn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};TF.prototype.fromText=function(e,t,n){return b4(void 0,e,t,n,this._cache)};var lnt=new H;function unt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,lnt).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function hpe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=H.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=H.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var bF=new Array(4);function b4(e,t,n,i,o){bF[0]=e,bF[1]=t,bF[2]=n,bF[3]=i;let r=JSON.stringify(bF),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(unt(c,n,i),l(e)){let f=Se.createIfNeeded(e).fetchImage().then(function(d){return hpe(c,d,i),o[r]=a,a});return o[r]=f,f}else if(l(t)){let u=Mb(t,{font:`bold ${i}px sans-serif`});hpe(c,u,i)}return o[r]=a,a}var ng=TF;var _pe=Ko(ppe(),1);function C4(e){return h.fromDegrees(e[0],e[1],e[2])}var gq={"urn:ogc:def:crs:OGC:1.3:CRS84":C4,"EPSG:4326":C4,"urn:ogc:def:crs:EPSG::4326":C4},gpe={},ype={},yq=48,xq,bq=H.ROYALBLUE,Tq=H.YELLOW,Cq=2,Aq=H.fromBytes(255,255,0,100),Eq=!1,fnt={small:24,medium:48,large:64},dnt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function xpe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||dnt.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${xpe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function hnt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function mnt(e,t){return new jd(hnt(xpe,e,t),!0)}function A4(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Hn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let d=f.toLowerCase();if(u>1&&d==="title"){u=1,s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new Kn(c):n(r,s))}return o}function Sq(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var bpe={Feature:Cpe,FeatureCollection:pnt,GeometryCollection:Ape,LineString:Dpe,MultiLineString:Ipe,MultiPoint:vpe,MultiPolygon:Ope,Point:Spe,Polygon:Rpe,Topology:Mpe},Tpe={GeometryCollection:Ape,LineString:Dpe,MultiLineString:Ipe,MultiPoint:vpe,MultiPolygon:Ope,Point:Spe,Polygon:Rpe,Topology:Mpe};function Cpe(e,t,n,i,o){if(t.geometry===null){A4(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new re("feature.geometry is required.");let r=t.geometry.type,s=Tpe[r];if(!l(s))throw new re(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function pnt(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)Cpe(e,r[s],void 0,i,o)}function Ape(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],u=c.type,f=Tpe[u];if(!l(f))throw new re(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function Epe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=H.fromCssColorString(g)),a=y(fnt[c["marker-size"]],a);let m=c["marker-symbol"];l(m)&&(r=m)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new sc;f.verticalOrigin=new Kn(Rn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=Ye.CLAMP_TO_GROUND);let d=A4(t,e._entityCollection,o.describe);d.billboard=f,d.position=new qc(n(i));let p=Promise.resolve(u).then(function(g){f.image=new Kn(g)}).catch(function(){f.image=new Kn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function Spe(e,t,n,i,o){Epe(e,t,i,n.coordinates,o)}function vpe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Epe(e,t,i,r[s],o)}function wpe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new Kn(f));let d,p=a.stroke;l(p)&&(d=H.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=r.color.getValue().clone()),d.alpha=g),l(d)&&(r=new zt(d))}let c=A4(t,e._entityCollection,o.describe),u=new lc;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new Kn(Sq(i,n)),u.arcType=Jt.RHUMB}function Dpe(e,t,n,i,o){wpe(e,t,i,n.coordinates,o)}function Ipe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)wpe(e,t,i,r[s],o)}function Ppe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new Kn(g));let m,x=c.stroke;l(x)&&(m=H.fromCssColorString(x));let b=c["stroke-opacity"];l(b)&&b!==1&&(l(m)||(m=r.getValue().clone()),m.alpha=b),l(m)&&(r=new Kn(m));let T,C=c.fill,A=s.color.getValue();l(C)&&(T=H.fromCssColorString(C),T.alpha=A.alpha),b=c["fill-opacity"],l(b)&&b!==A.alpha&&(l(T)||(T=A.clone()),T.alpha=b),l(T)&&(s=new zt(T))}let u=new Gd;u.outline=new Kn(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=Jt.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Ma(Sq(i[g],n)));let d=i[0];u.hierarchy=new Kn(new Ma(Sq(d,n),f)),d[0].length>2?u.perPositionHeight=new Kn(!0):o.clampToGround||(u.height=0);let p=A4(t,e._entityCollection,o.describe);p.polygon=u}function Rpe(e,t,n,i,o){Ppe(e,t,i,n.coordinates,o)}function Ope(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Ppe(e,t,i,r[s],o)}function Mpe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=_pe.feature(n,n.objects[r]),a=bpe[s.type];a(e,s,s,i,o)}}function u0(e){this._name=e,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._entityCollection=new $s(this),this._promises=[],this._pinBuilder=new ng,this._entityCluster=new Fu,this._credit=void 0,this._resourceCredits=[]}u0.load=function(e,t){return new u0().load(e,t)};Object.defineProperties(u0,{markerSize:{get:function(){return yq},set:function(e){yq=e}},markerSymbol:{get:function(){return xq},set:function(e){xq=e}},markerColor:{get:function(){return bq},set:function(e){bq=e}},stroke:{get:function(){return Tq},set:function(e){Tq=e}},strokeWidth:{get:function(){return Cq},set:function(e){Cq=e}},fill:{get:function(){return Aq},set:function(e){Aq=e}},clampToGround:{get:function(){return Eq},set:function(e){Eq=e}},crsNames:{get:function(){return gq}},crsLinkHrefs:{get:function(){return gpe}},crsLinkTypes:{get:function(){return ype}}});Object.defineProperties(u0.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});u0.prototype.load=function(e,t){return Lpe(this,e,t,!0)};u0.prototype.process=function(e,t){return Lpe(this,e,t,!1)};function Lpe(e,t,n,i){qr.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let o=n.credit;typeof o=="string"&&(o=new Tt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Se){t=Se.createIfNeeded(t),r=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:y(n.describe,mnt),markerSize:y(n.markerSize,yq),markerSymbol:y(n.markerSymbol,xq),markerColor:y(n.markerColor,bq),strokeWidthProperty:new Kn(y(n.strokeWidth,Cq)),strokeMaterialProperty:new zt(y(n.stroke,Tq)),fillMaterialProperty:new zt(y(n.fill,Aq)),clampToGround:y(n.clampToGround,Eq)},Promise.resolve(r).then(function(a){return _nt(e,a,n,s,i)}).catch(function(a){throw qr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}u0.prototype.update=function(e){return!0};function _nt(e,t,n,i,o){let r;l(i)&&(r=G_(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=bpe[t.type];if(!l(s))throw new re(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?C4:null;if(l(a)){if(!l(a.properties))throw new re("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=gq[u.name],!l(c))throw new re(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=gpe[u.href];if(l(f)||(f=ype[u.type]),!l(f))throw new re(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=gq[`EPSG:${u.code}`],!l(c))throw new re(`Unknown crs EPSG code: ${u.code}`)}else throw new re(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,qr.setLoading(e,!1),e})})}var CF=u0;var B_e=Ko(jq(),1);var k_e;typeof DOMParser<"u"&&(k_e=new DOMParser);var uot=new B_e.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),W4=32,I_e=2414016,P_e=1,R_e=16093e3,O_e=.1,fot=[null,void 0,"http://www.topografix.com/GPX/1/1"],Do={gpx:fot};function dot(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function qq(e,t){let n=SF(e,"id");return n=l(n)?n:Hn(),t.getOrCreateEntity(n)}function Yq(e){let t=M_e(e,"lon"),n=M_e(e,"lat"),i=AF(e,"ele",Do.gpx);return h.fromDegrees(t,n,i)}function M_e(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function SF(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function m0(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Xq(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function AF(e,t,n){let i=m0(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function $l(e,t,n){let i=m0(e,t,n);if(l(i))return i.textContent.trim()}function V_e(e){let t=new sc;return t.width=W4,t.height=W4,t.scaleByDistance=new kt(I_e,P_e,R_e,O_e),t.pixelOffsetScaleByDistance=new kt(I_e,P_e,R_e,O_e),t.verticalOrigin=new Kn(Rn.BOTTOM),t.image=e,t}function hot(){let e=new Hd;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=jo.FILL_AND_OUTLINE,e}function U_e(e){let t=new lc;return t.width=4,t.material=new Qy,t.material.color=l(e)?e:H.RED,t.material.outlineWidth=2,t.material.outlineColor=H.BLACK,t}var L_e={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},EF;typeof document<"u"&&(EF=document.createElement("div"));function Kq(e,t){let n,i="",o=Object.keys(L_e),r=o.length;for(n=0;n<r;n++){let f=o[n],d=L_e[f];d.value=y($l(e,d.tag,Do.gpx),""),l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=uot.link(i),EF.innerHTML=i;let s=EF.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=H.WHITE,c=H.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${EF.innerHTML}</div>`,EF.innerHTML="",u}function z_e(e,t,n,i){let o=Yq(t),r=qq(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",H.RED,W4);r.billboard=V_e(s);let a=$l(t,"name",Do.gpx);r.name=a,r.label=hot(),r.label.text=a,r.description=Kq(t,r),i.clampToGround&&(r.billboard.heightReference=Ye.CLAMP_TO_GROUND,r.label.heightReference=Ye.CLAMP_TO_GROUND)}function mot(e,t,n,i){let o=qq(t,n);o.description=Kq(t,o);let r=Xq(t,"rtept",Do.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)z_e(e,r[a],n,i),s[a]=Yq(r[a]);o.polyline=U_e(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function pot(e,t,n,i){let o=qq(t,n);o.description=Kq(t,o);let r=Xq(t,"trkseg",Do.gpx),s=[],a=[],c,u=!0,f=new _a;for(let d=0;d<r.length;d++)c=_ot(r[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",H.RED,W4);o.billboard=V_e(d),o.position=f,i.clampToGround&&(o.billboard.heightReference=Ye.CLAMP_TO_GROUND),o.availability=new jr,o.availability.addInterval(new An({start:a[0],stop:a[a.length-1]}))}o.polyline=U_e(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function _ot(e){let t={positions:[],times:[]},n=Xq(e,"trkpt",Do.gpx),i;for(let o=0;o<n.length;o++){let r=Yq(n[o]);t.positions.push(r),i=$l(n[o],"time",Do.gpx),l(i)&&t.times.push(Z.fromIso8601(i))}return t}function got(e){let t=m0(e,"metadata",Do.gpx);if(l(t)){let n={name:$l(t,"name",Do.gpx),desc:$l(t,"desc",Do.gpx),author:yot(t),copyright:bot(t),link:H_e(t),time:$l(t,"time",Do.gpx),keywords:$l(t,"keywords",Do.gpx),bounds:Tot(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function yot(e){let t=m0(e,"author",Do.gpx);if(l(t)){let n={name:$l(t,"name",Do.gpx),email:xot(t),link:H_e(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function xot(e){let t=m0(e,"email",Do.gpx);if(l(t)){let n=$l(t,"id",Do.gpx),i=$l(t,"domain",Do.gpx);return`${n}@${i}`}}function H_e(e){let t=m0(e,"link",Do.gpx);if(l(t)){let n={href:SF(t,"href"),text:$l(t,"text",Do.gpx),mimeType:$l(t,"type",Do.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function bot(e){let t=m0(e,"copyright",Do.gpx);if(l(t)){let n={author:SF(t,"author"),year:$l(t,"year",Do.gpx),license:$l(t,"license",Do.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function Tot(e){let t=m0(e,"bounds",Do.gpx);if(l(t)){let n={minLat:AF(t,"minlat",Do.gpx),maxLat:AF(t,"maxlat",Do.gpx),minLon:AF(t,"minlon",Do.gpx),maxLon:AF(t,"maxlon",Do.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var N_e={wpt:z_e,rte:mot,trk:pot};function Cot(e,t,n,i){let o=Object.keys(N_e),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=N_e[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Do.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function F_e(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=SF(o,"version"),s=SF(o,"creator"),a,c=got(o);l(c)&&(a=c.name),o.localName==="gpx"?Cot(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=Z.equals(d,He.MINIMUM_VALUE),m=Z.equals(p,He.MAXIMUM_VALUE);if(!g||!m){let b;g&&(b=new Date,b.setHours(0,0,0,0),d=Z.fromDate(b)),m&&(b=new Date,b.setHours(24,0,0,0),p=Z.fromDate(b)),u=new bh,u.startTime=d,u.stopTime=p,u.currentTime=Z.clone(d),u.clockRange=Yr.LOOP_STOP,u.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(p,d)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),Aot(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==r&&(e._version=r,x=!0),u!==e._clock&&(x=!0,e._clock=u),x&&e._changed.raiseEvent(e),qr.setLoading(e,!1),e}function Aot(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function Eot(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=n;if(typeof n=="string"||n instanceof Se){n=Se.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?dot(r).then(function(s){let a,c;try{a=k_e.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new re(u)}return F_e(e,a,i)}):F_e(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function OS(){this._changed=new me,this._error=new me,this._loading=new me,this._clock=void 0,this._entityCollection=new $s(this),this._entityCluster=new Fu,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new ng}OS.load=function(e,t){return new OS().load(e,t)};Object.defineProperties(OS.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});OS.prototype.update=function(e){return!0};OS.prototype.load=function(e,t){if(!l(e))throw new he("data is required.");t=y(t,y.EMPTY_OBJECT),qr.setLoading(this,!0);let n=this._name,i=this;return Eot(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Z.equals(s,He.MINIMUM_VALUE),u=Z.equals(a,He.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=Z.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=Z.fromDate(d)),o=new bh,o.startTime=s,o.stopTime=a,o.currentTime=Z.clone(s),o.clockRange=Yr.LOOP_STOP,o.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),qr.setLoading(i,!1),i}).catch(function(o){return qr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var vF=OS;function Sot(e,t){this.position=e,this.headingPitchRoll=t}var wF=Sot;var Eye=Ko(jq(),1),$F=Ko(uu(),1);function $4(e){return Q4(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function Q4(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?Q4(n):n),[])}var G_e=[0,1,2,3].concat(...$4([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function pr(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,d,p,g,m,x,b=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)d=o.heap[f],g=r[r[d*2+1]*2+1]+1,g>u&&(g=u,b++),r[d*2+1]=g,!(d>e.max_code)&&(o.bl_count[g]++,m=0,d>=c&&(m=a[d-c]),x=r[d*2],o.opt_len+=x*(g+m),s&&(o.static_len+=x*(s[d*2+1]+m)));if(b!==0){do{for(g=u-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(g=u;g!==0;g--)for(d=o.bl_count[g];d!==0;)p=o.heap[--f],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),d--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,u,f,d;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=r;f++)d=o[f*2+1],d!==0&&(o[f*2]=n(a[d]++,d))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,d;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=f=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)d=o.heap[++o.heap_len]=f<2?++f:0,r[d*2]=1,o.depth[d]=0,o.opt_len--,s&&(o.static_len-=s[d*2+1]);for(e.max_code=f,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);d=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=u,r[d*2]=r[c*2]+r[u*2],o.depth[d]=Math.max(o.depth[c],o.depth[u])+1,r[c*2+1]=r[u*2+1]=d,o.heap[1]=d++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}pr._length_code=[0,1,2,3,4,5,6,7].concat(...$4([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));pr.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];pr.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];pr.d_code=function(e){return e<256?G_e[e]:G_e[256+(e>>>7)]};pr.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];pr.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];pr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];pr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Va(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var vot=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],wot=$4([[144,8],[112,9],[24,7],[8,8]]);Va.static_ltree=Q4(vot.map((e,t)=>[e,wot[t]]));var Dot=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],Iot=$4([[30,5]]);Va.static_dtree=Q4(Dot.map((e,t)=>[e,Iot[t]]));Va.static_l_desc=new Va(Va.static_ltree,pr.extra_lbits,257,286,15);Va.static_d_desc=new Va(Va.static_dtree,pr.extra_dbits,0,30,15);Va.static_bl_desc=new Va(null,pr.extra_blbits,0,19,7);var Pot=9,Rot=8;function Wm(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var j_e=0,K4=1,vT=2,Ph=[new Wm(0,0,0,0,j_e),new Wm(4,4,8,4,K4),new Wm(4,5,16,8,K4),new Wm(4,6,32,32,K4),new Wm(4,4,16,16,vT),new Wm(8,16,32,32,vT),new Wm(8,16,128,128,vT),new Wm(8,32,128,256,vT),new Wm(32,128,258,1024,vT),new Wm(32,258,258,4096,vT)],j4=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],ud=0,q4=1,DF=2,Y4=3,Oot=32,Zq=42,X4=113,IF=666,$q=8,Mot=0,Qq=1,Lot=2,Ir=3,Z4=258,ju=Z4+Ir+1;function W_e(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function Not(){let e=this,t,n,i,o,r,s,a,c,u,f,d,p,g,m,x,b,T,C,A,E,v,D,O,R,M,N,_,S,w,I,L,B,U,V=new pr,G=new pr,k=new pr;e.depth=[];let W,j,J,q,K,Q;e.bl_count=[],e.heap=[],L=[],B=[],U=[];function de(){u=2*r,d[g-1]=0;for(let Le=0;Le<g-1;Le++)d[Le]=0;N=Ph[_].max_lazy,w=Ph[_].good_length,I=Ph[_].nice_length,M=Ph[_].max_chain,v=0,T=0,O=0,C=R=Ir-1,E=0,p=0}function ye(){let Le;for(Le=0;Le<286;Le++)L[Le*2]=0;for(Le=0;Le<30;Le++)B[Le*2]=0;for(Le=0;Le<19;Le++)U[Le*2]=0;L[256*2]=1,e.opt_len=e.static_len=0,j=J=0}function ce(){V.dyn_tree=L,V.stat_desc=Va.static_l_desc,G.dyn_tree=B,G.stat_desc=Va.static_d_desc,k.dyn_tree=U,k.stat_desc=Va.static_bl_desc,K=0,Q=0,q=8,ye()}e.pqdownheap=function(Le,ot){let qe=e.heap,Xe=qe[ot],ht=ot<<1;for(;ht<=e.heap_len&&(ht<e.heap_len&&W_e(Le,qe[ht+1],qe[ht],e.depth)&&ht++,!W_e(Le,Xe,qe[ht],e.depth));)qe[ot]=qe[ht],ot=ht,ht<<=1;qe[ot]=Xe};function _e(Le,ot){let qe=-1,Xe,ht=Le[0*2+1],Gt=0,Tn=7,Ro=4;ht===0&&(Tn=138,Ro=3),Le[(ot+1)*2+1]=65535;for(let Ao=0;Ao<=ot;Ao++)Xe=ht,ht=Le[(Ao+1)*2+1],!(++Gt<Tn&&Xe==ht)&&(Gt<Ro?U[Xe*2]+=Gt:Xe!==0?(Xe!=qe&&U[Xe*2]++,U[16*2]++):Gt<=10?U[17*2]++:U[18*2]++,Gt=0,qe=Xe,ht===0?(Tn=138,Ro=3):Xe==ht?(Tn=6,Ro=3):(Tn=7,Ro=4))}function xe(){let Le;for(_e(L,V.max_code),_e(B,G.max_code),k.build_tree(e),Le=18;Le>=3&&U[pr.bl_order[Le]*2+1]===0;Le--);return e.opt_len+=3*(Le+1)+5+5+4,Le}function De(Le){e.pending_buf[e.pending++]=Le}function Ae(Le){De(Le&255),De(Le>>>8&255)}function ke(Le){De(Le>>8&255),De(Le&255&255)}function ze(Le,ot){let qe,Xe=ot;Q>16-Xe?(qe=Le,K|=qe<<Q&65535,Ae(K),K=qe>>>16-Q,Q+=Xe-16):(K|=Le<<Q&65535,Q+=Xe)}function tt(Le,ot){let qe=Le*2;ze(ot[qe]&65535,ot[qe+1]&65535)}function wt(Le,ot){let qe,Xe=-1,ht,Gt=Le[0*2+1],Tn=0,Ro=7,Ao=4;for(Gt===0&&(Ro=138,Ao=3),qe=0;qe<=ot;qe++)if(ht=Gt,Gt=Le[(qe+1)*2+1],!(++Tn<Ro&&ht==Gt)){if(Tn<Ao)do tt(ht,U);while(--Tn!==0);else ht!==0?(ht!=Xe&&(tt(ht,U),Tn--),tt(16,U),ze(Tn-3,2)):Tn<=10?(tt(17,U),ze(Tn-3,3)):(tt(18,U),ze(Tn-11,7));Tn=0,Xe=ht,Gt===0?(Ro=138,Ao=3):ht==Gt?(Ro=6,Ao=3):(Ro=7,Ao=4)}}function _t(Le,ot,qe){let Xe;for(ze(Le-257,5),ze(ot-1,5),ze(qe-4,4),Xe=0;Xe<qe;Xe++)ze(U[pr.bl_order[Xe]*2+1],3);wt(L,Le-1),wt(B,ot-1)}function Be(){Q==16?(Ae(K),K=0,Q=0):Q>=8&&(De(K&255),K>>>=8,Q-=8)}function Yt(){ze(Qq<<1,3),tt(256,Va.static_ltree),Be(),1+q+10-Q<9&&(ze(Qq<<1,3),tt(256,Va.static_ltree),Be()),q=7}function Et(Le,ot){let qe,Xe,ht;if(e.dist_buf[j]=Le,e.lc_buf[j]=ot&255,j++,Le===0?L[ot*2]++:(J++,Le--,L[(pr._length_code[ot]+256+1)*2]++,B[pr.d_code(Le)*2]++),!(j&8191)&&_>2){for(qe=j*8,Xe=v-T,ht=0;ht<30;ht++)qe+=B[ht*2]*(5+pr.extra_dbits[ht]);if(qe>>>=3,J<Math.floor(j/2)&&qe<Math.floor(Xe/2))return!0}return j==W-1}function ut(Le,ot){let qe,Xe,ht=0,Gt,Tn;if(j!==0)do qe=e.dist_buf[ht],Xe=e.lc_buf[ht],ht++,qe===0?tt(Xe,Le):(Gt=pr._length_code[Xe],tt(Gt+256+1,Le),Tn=pr.extra_lbits[Gt],Tn!==0&&(Xe-=pr.base_length[Gt],ze(Xe,Tn)),qe--,Gt=pr.d_code(qe),tt(Gt,ot),Tn=pr.extra_dbits[Gt],Tn!==0&&(qe-=pr.base_dist[Gt],ze(qe,Tn)));while(ht<j);tt(256,Le),q=Le[256*2+1]}function tn(){Q>8?Ae(K):Q>0&&De(K&255),K=0,Q=0}function Ce(Le,ot,qe){tn(),q=8,qe&&(Ae(ot),Ae(~ot)),e.pending_buf.set(c.subarray(Le,Le+ot),e.pending),e.pending+=ot}function Te(Le,ot,qe){ze((Mot<<1)+(qe?1:0),3),Ce(Le,ot,!0)}function it(Le,ot,qe){let Xe,ht,Gt=0;_>0?(V.build_tree(e),G.build_tree(e),Gt=xe(),Xe=e.opt_len+3+7>>>3,ht=e.static_len+3+7>>>3,ht<=Xe&&(Xe=ht)):Xe=ht=ot+5,ot+4<=Xe&&Le!=-1?Te(Le,ot,qe):ht==Xe?(ze((Qq<<1)+(qe?1:0),3),ut(Va.static_ltree,Va.static_dtree)):(ze((Lot<<1)+(qe?1:0),3),_t(V.max_code+1,G.max_code+1,Gt+1),ut(L,B)),ye(),qe&&tn()}function ji(Le){it(T>=0?T:-1,v-T,Le),T=v,t.flush_pending()}function ft(){let Le,ot,qe,Xe;do{if(Xe=u-O-v,Xe===0&&v===0&&O===0)Xe=r;else if(Xe==-1)Xe--;else if(v>=r+r-ju){c.set(c.subarray(r,r+r),0),D-=r,v-=r,T-=r,Le=g,qe=Le;do ot=d[--qe]&65535,d[qe]=ot>=r?ot-r:0;while(--Le!==0);Le=r,qe=Le;do ot=f[--qe]&65535,f[qe]=ot>=r?ot-r:0;while(--Le!==0);Xe+=r}if(t.avail_in===0)return;Le=t.read_buf(c,v+O,Xe),O+=Le,O>=Ir&&(p=c[v]&255,p=(p<<b^c[v+1]&255)&x)}while(O<ju&&t.avail_in!==0)}function yo(Le){let ot=65535,qe;for(ot>i-5&&(ot=i-5);;){if(O<=1){if(ft(),O===0&&Le==0)return ud;if(O===0)break}if(v+=O,O=0,qe=T+ot,(v===0||v>=qe)&&(O=v-qe,v=qe,ji(!1),t.avail_out===0)||v-T>=r-ju&&(ji(!1),t.avail_out===0))return ud}return ji(Le==4),t.avail_out===0?Le==4?DF:ud:Le==4?Y4:q4}function Xo(Le){let ot=M,qe=v,Xe,ht,Gt=R,Tn=v>r-ju?v-(r-ju):0,Ro=I,Ao=a,Ka=v+Z4,Za=c[qe+Gt-1],Ci=c[qe+Gt];R>=w&&(ot>>=2),Ro>O&&(Ro=O);do if(Xe=Le,!(c[Xe+Gt]!=Ci||c[Xe+Gt-1]!=Za||c[Xe]!=c[qe]||c[++Xe]!=c[qe+1])){qe+=2,Xe++;do;while(c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&c[++qe]==c[++Xe]&&qe<Ka);if(ht=Z4-(Ka-qe),qe=Ka-Z4,ht>Gt){if(D=Le,Gt=ht,ht>=Ro)break;Za=c[qe+Gt-1],Ci=c[qe+Gt]}}while((Le=f[Le&Ao]&65535)>Tn&&--ot!==0);return Gt<=O?Gt:O}function Xa(Le){let ot=0,qe;for(;;){if(O<ju){if(ft(),O<ju&&Le==0)return ud;if(O===0)break}if(O>=Ir&&(p=(p<<b^c[v+(Ir-1)]&255)&x,ot=d[p]&65535,f[v&a]=d[p],d[p]=v),ot!==0&&(v-ot&65535)<=r-ju&&S!=2&&(C=Xo(ot)),C>=Ir)if(qe=Et(v-D,C-Ir),O-=C,C<=N&&O>=Ir){C--;do v++,p=(p<<b^c[v+(Ir-1)]&255)&x,ot=d[p]&65535,f[v&a]=d[p],d[p]=v;while(--C!==0);v++}else v+=C,C=0,p=c[v]&255,p=(p<<b^c[v+1]&255)&x;else qe=Et(0,c[v]&255),O--,v++;if(qe&&(ji(!1),t.avail_out===0))return ud}return ji(Le==4),t.avail_out===0?Le==4?DF:ud:Le==4?Y4:q4}function Rr(Le){let ot=0,qe,Xe;for(;;){if(O<ju){if(ft(),O<ju&&Le==0)return ud;if(O===0)break}if(O>=Ir&&(p=(p<<b^c[v+(Ir-1)]&255)&x,ot=d[p]&65535,f[v&a]=d[p],d[p]=v),R=C,A=D,C=Ir-1,ot!==0&&R<N&&(v-ot&65535)<=r-ju&&(S!=2&&(C=Xo(ot)),C<=5&&(S==1||C==Ir&&v-D>4096)&&(C=Ir-1)),R>=Ir&&C<=R){Xe=v+O-Ir,qe=Et(v-1-A,R-Ir),O-=R-1,R-=2;do++v<=Xe&&(p=(p<<b^c[v+(Ir-1)]&255)&x,ot=d[p]&65535,f[v&a]=d[p],d[p]=v);while(--R!==0);if(E=0,C=Ir-1,v++,qe&&(ji(!1),t.avail_out===0))return ud}else if(E!==0){if(qe=Et(0,c[v-1]&255),qe&&ji(!1),v++,O--,t.avail_out===0)return ud}else E=1,v++,O--}return E!==0&&(qe=Et(0,c[v-1]&255),E=0),ji(Le==4),t.avail_out===0?Le==4?DF:ud:Le==4?Y4:q4}function As(Le){return Le.total_in=Le.total_out=0,Le.msg=null,e.pending=0,e.pending_out=0,n=X4,o=0,ce(),de(),0}e.deflateInit=function(Le,ot,qe,Xe,ht,Gt){return Xe||(Xe=$q),ht||(ht=Rot),Gt||(Gt=0),Le.msg=null,ot==-1&&(ot=6),ht<1||ht>Pot||Xe!=$q||qe<9||qe>15||ot<0||ot>9||Gt<0||Gt>2?-2:(Le.dstate=e,s=qe,r=1<<s,a=r-1,m=ht+7,g=1<<m,x=g-1,b=Math.floor((m+Ir-1)/Ir),c=new Uint8Array(r*2),f=[],d=[],W=1<<ht+6,e.pending_buf=new Uint8Array(W*4),i=W*4,e.dist_buf=new Uint16Array(W),e.lc_buf=new Uint8Array(W),_=ot,S=Gt,As(Le))},e.deflateEnd=function(){return n!=Zq&&n!=X4&&n!=IF?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,d=null,f=null,c=null,e.dstate=null,n==X4?-3:0)},e.deflateParams=function(Le,ot,qe){let Xe=0;return ot==-1&&(ot=6),ot<0||ot>9||qe<0||qe>2?-2:(Ph[_].func!=Ph[ot].func&&Le.total_in!==0&&(Xe=Le.deflate(1)),_!=ot&&(_=ot,N=Ph[_].max_lazy,w=Ph[_].good_length,I=Ph[_].nice_length,M=Ph[_].max_chain),S=qe,Xe)},e.deflateSetDictionary=function(Le,ot,qe){let Xe=qe,ht,Gt=0;if(!ot||n!=Zq)return-2;if(Xe<Ir)return 0;for(Xe>r-ju&&(Xe=r-ju,Gt=qe-Xe),c.set(ot.subarray(Gt,Gt+Xe),0),v=Xe,T=Xe,p=c[0]&255,p=(p<<b^c[1]&255)&x,ht=0;ht<=Xe-Ir;ht++)p=(p<<b^c[ht+(Ir-1)]&255)&x,f[ht&a]=d[p],d[p]=ht;return 0},e.deflate=function(Le,ot){let qe,Xe,ht,Gt,Tn;if(ot>4||ot<0)return-2;if(!Le.next_out||!Le.next_in&&Le.avail_in!==0||n==IF&&ot!=4)return Le.msg=j4[4],-2;if(Le.avail_out===0)return Le.msg=j4[7],-5;if(t=Le,Gt=o,o=ot,n==Zq&&(Xe=$q+(s-8<<4)<<8,ht=(_-1&255)>>1,ht>3&&(ht=3),Xe|=ht<<6,v!==0&&(Xe|=Oot),Xe+=31-Xe%31,n=X4,ke(Xe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&ot<=Gt&&ot!=4)return t.msg=j4[7],-5;if(n==IF&&t.avail_in!==0)return Le.msg=j4[7],-5;if(t.avail_in!==0||O!==0||ot!=0&&n!=IF){switch(Tn=-1,Ph[_].func){case j_e:Tn=yo(ot);break;case K4:Tn=Xa(ot);break;case vT:Tn=Rr(ot);break;default:}if((Tn==DF||Tn==Y4)&&(n=IF),Tn==ud||Tn==DF)return t.avail_out===0&&(o=-1),0;if(Tn==q4){if(ot==1)Yt();else if(Te(0,0,!1),ot==3)for(qe=0;qe<g;qe++)d[qe]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return ot!=4?0:1}}function q_e(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}q_e.prototype={deflateInit(e,t){let n=this;return n.dstate=new Not,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function Y_e(e){let t=this,n=new q_e,i=Fot(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let u,f,d=0,p=0,g=0,m=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(r)):m.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=d&&(c(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(g),m.forEach(function(x){f.set(x,p),p+=x.length})):f=m[0]?new Uint8Array(m[0]):new Uint8Array,f}},t.flush=function(){let a,c,u=0,f=0,d=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&d.push(r.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),d.forEach(function(p){c.set(p,u),u+=p.length}),c}}function Fot(e){return e+5*(Math.floor(e/16383)+1)}var qu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],hge=1440,Bot=0,kot=4,Vot=9,Uot=5,zot=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Hot=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Got=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Wot=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],jot=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],qot=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],p0=15;function nY(){let e=this,t,n,i,o,r,s;function a(u,f,d,p,g,m,x,b,T,C,A){let E,v,D,O,R,M,N,_,S,w,I,L,B,U,V;w=0,R=d;do i[u[f+w]]++,w++,R--;while(R!==0);if(i[0]==d)return x[0]=-1,b[0]=0,0;for(_=b[0],M=1;M<=p0&&i[M]===0;M++);for(N=M,_<M&&(_=M),R=p0;R!==0&&i[R]===0;R--);for(D=R,_>R&&(_=R),b[0]=_,U=1<<M;M<R;M++,U<<=1)if((U-=i[M])<0)return-3;if((U-=i[R])<0)return-3;for(i[R]+=U,s[1]=M=0,w=1,B=2;--R!==0;)s[B]=M+=i[w],B++,w++;R=0,w=0;do(M=u[f+w])!==0&&(A[s[M]++]=R),w++;while(++R<d);for(d=s[D],s[0]=R=0,w=0,O=-1,L=-_,r[0]=0,I=0,V=0;N<=D;N++)for(E=i[N];E--!==0;){for(;N>L+_;){if(O++,L+=_,V=D-L,V=V>_?_:V,(v=1<<(M=N-L))>E+1&&(v-=E+1,B=N,M<V))for(;++M<V&&!((v<<=1)<=i[++B]);)v-=i[B];if(V=1<<M,C[0]+V>hge)return-3;r[O]=I=C[0],C[0]+=V,O!==0?(s[O]=R,o[0]=M,o[1]=_,M=R>>>L-_,o[2]=I-r[O-1]-M,T.set(o,(r[O-1]+M)*3)):x[0]=I}for(o[1]=N-L,w>=d?o[0]=192:A[w]<p?(o[0]=A[w]<256?0:96,o[2]=A[w++]):(o[0]=m[A[w]-p]+16+64,o[2]=g[A[w++]-p]),v=1<<N-L,M=R>>>L;M<V;M+=v)T.set(o,(I+M)*3);for(M=1<<N-1;R&M;M>>>=1)R^=M;for(R^=M,S=(1<<L)-1;(R&S)!=s[O];)O--,L-=_,S=(1<<L)-1}return U!==0&&D!=1?-5:0}function c(u){let f;for(t||(t=[],n=[],i=new Int32Array(p0+1),o=[],r=new Int32Array(p0),s=new Int32Array(p0+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<p0+1;f++)i[f]=0;for(f=0;f<3;f++)o[f]=0;r.set(i.subarray(0,p0),0),s.set(i.subarray(0,p0+1),0)}e.inflate_trees_bits=function(u,f,d,p,g){let m;return c(19),t[0]=0,m=a(u,0,19,19,null,null,d,f,p,t,n),m==-3?g.msg="oversubscribed dynamic bit lengths tree":(m==-5||f[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",m=-3),m},e.inflate_trees_dynamic=function(u,f,d,p,g,m,x,b,T){let C;return c(288),t[0]=0,C=a(d,0,u,257,Got,Wot,m,p,b,t,n),C!=0||p[0]===0?(C==-3?T.msg="oversubscribed literal/length tree":C!=-4&&(T.msg="incomplete literal/length tree",C=-3),C):(c(288),C=a(d,u,f,0,jot,qot,x,g,b,t,n),C!=0||g[0]===0&&u>257?(C==-3?T.msg="oversubscribed distance tree":C==-5?(T.msg="incomplete distance tree",C=-3):C!=-4&&(T.msg="empty distance tree with lengths",C=-3),C):0)}}nY.inflate_trees_fixed=function(e,t,n,i){return e[0]=Vot,t[0]=Uot,n[0]=zot,i[0]=Hot,0};var J4=0,X_e=1,K_e=2,Z_e=3,$_e=4,Q_e=5,J_e=6,Jq=7,ege=8,eH=9;function Yot(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,u=0,f=0,d,p=0,g,m=0;function x(b,T,C,A,E,v,D,O){let R,M,N,_,S,w,I,L,B,U,V,G,k,W,j,J;I=O.next_in_index,L=O.avail_in,S=D.bitb,w=D.bitk,B=D.write,U=B<D.read?D.read-B-1:D.end-B,V=qu[b],G=qu[T];do{for(;w<20;)L--,S|=(O.read_byte(I++)&255)<<w,w+=8;if(R=S&V,M=C,N=A,J=(N+R)*3,(_=M[J])===0){S>>=M[J+1],w-=M[J+1],D.win[B++]=M[J+2],U--;continue}do{if(S>>=M[J+1],w-=M[J+1],_&16){for(_&=15,k=M[J+2]+(S&qu[_]),S>>=_,w-=_;w<15;)L--,S|=(O.read_byte(I++)&255)<<w,w+=8;R=S&G,M=E,N=v,J=(N+R)*3,_=M[J];do if(S>>=M[J+1],w-=M[J+1],_&16){for(_&=15;w<_;)L--,S|=(O.read_byte(I++)&255)<<w,w+=8;if(W=M[J+2]+(S&qu[_]),S>>=_,w-=_,U-=k,B>=W)j=B-W,B-j>0&&2>B-j?(D.win[B++]=D.win[j++],D.win[B++]=D.win[j++],k-=2):(D.win.set(D.win.subarray(j,j+2),B),B+=2,j+=2,k-=2);else{j=B-W;do j+=D.end;while(j<0);if(_=D.end-j,k>_){if(k-=_,B-j>0&&_>B-j)do D.win[B++]=D.win[j++];while(--_!==0);else D.win.set(D.win.subarray(j,j+_),B),B+=_,j+=_,_=0;j=0}}if(B-j>0&&k>B-j)do D.win[B++]=D.win[j++];while(--k!==0);else D.win.set(D.win.subarray(j,j+k),B),B+=k,j+=k,k=0;break}else if(!(_&64))R+=M[J+2],R+=S&qu[_],J=(N+R)*3,_=M[J];else return O.msg="invalid distance code",k=O.avail_in-L,k=w>>3<k?w>>3:k,L+=k,I-=k,w-=k<<3,D.bitb=S,D.bitk=w,O.avail_in=L,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,-3;while(!0);break}if(_&64)return _&32?(k=O.avail_in-L,k=w>>3<k?w>>3:k,L+=k,I-=k,w-=k<<3,D.bitb=S,D.bitk=w,O.avail_in=L,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,1):(O.msg="invalid literal/length code",k=O.avail_in-L,k=w>>3<k?w>>3:k,L+=k,I-=k,w-=k<<3,D.bitb=S,D.bitk=w,O.avail_in=L,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,-3);if(R+=M[J+2],R+=S&qu[_],J=(N+R)*3,(_=M[J])===0){S>>=M[J+1],w-=M[J+1],D.win[B++]=M[J+2],U--;break}}while(!0)}while(U>=258&&L>=10);return k=O.avail_in-L,k=w>>3<k?w>>3:k,L+=k,I-=k,w-=k<<3,D.bitb=S,D.bitk=w,O.avail_in=L,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,0}e.init=function(b,T,C,A,E,v){t=J4,u=b,f=T,d=C,p=A,g=E,m=v,i=null},e.proc=function(b,T,C){let A,E,v,D=0,O=0,R=0,M,N,_,S;for(R=T.next_in_index,M=T.avail_in,D=b.bitb,O=b.bitk,N=b.write,_=N<b.read?b.read-N-1:b.end-N;;)switch(t){case J4:if(_>=258&&M>=10&&(b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,C=x(u,f,d,p,g,m,b,T),R=T.next_in_index,M=T.avail_in,D=b.bitb,O=b.bitk,N=b.write,_=N<b.read?b.read-N-1:b.end-N,C!=0)){t=C==1?Jq:eH;break}r=u,i=d,o=p,t=X_e;case X_e:for(A=r;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}if(E=(o+(D&qu[A]))*3,D>>>=i[E+1],O-=i[E+1],v=i[E],v===0){s=i[E+2],t=J_e;break}if(v&16){a=v&15,n=i[E+2],t=K_e;break}if(!(v&64)){r=v,o=E/3+i[E+2];break}if(v&32){t=Jq;break}return t=eH,T.msg="invalid literal/length code",C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);case K_e:for(A=a;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}n+=D&qu[A],D>>=A,O-=A,r=f,i=g,o=m,t=Z_e;case Z_e:for(A=r;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}if(E=(o+(D&qu[A]))*3,D>>=i[E+1],O-=i[E+1],v=i[E],v&16){a=v&15,c=i[E+2],t=$_e;break}if(!(v&64)){r=v,o=E/3+i[E+2];break}return t=eH,T.msg="invalid distance code",C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);case $_e:for(A=a;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}c+=D&qu[A],D>>=A,O-=A,t=Q_e;case Q_e:for(S=N-c;S<0;)S+=b.end;for(;n!==0;){if(_===0&&(N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0&&(b.write=N,C=b.inflate_flush(T,C),N=b.write,_=N<b.read?b.read-N-1:b.end-N,N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0)))return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);b.win[N++]=b.win[S++],_--,S==b.end&&(S=0),n--}t=J4;break;case J_e:if(_===0&&(N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0&&(b.write=N,C=b.inflate_flush(T,C),N=b.write,_=N<b.read?b.read-N-1:b.end-N,N==b.end&&b.read!==0&&(N=0,_=N<b.read?b.read-N-1:b.end-N),_===0)))return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);C=0,b.win[N++]=s,_--,t=J4;break;case Jq:if(O>7&&(O-=8,M++,R--),b.write=N,C=b.inflate_flush(T,C),N=b.write,_=N<b.read?b.read-N-1:b.end-N,b.read!=b.write)return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);t=ege;case ege:return C=1,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);case eH:return C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C);default:return C=-2,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=N,b.inflate_flush(T,C)}},e.free=function(){}}var tge=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],MS=0,eY=1,nge=2,ige=3,oge=4,rge=5,tH=6,nH=7,sge=8,wT=9;function Xot(e,t){let n=this,i=MS,o=0,r=0,s=0,a,c=[0],u=[0],f=new Yot,d=0,p=new Int32Array(hge*3),g=0,m=new nY;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,b){b&&(b[0]=g),i==tH&&f.free(x),i=MS,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,b){let T,C,A;return C=x.next_out_index,A=n.read,T=(A<=n.write?n.write:n.end)-A,T>x.avail_out&&(T=x.avail_out),T!==0&&b==-5&&(b=0),x.avail_out-=T,x.total_out+=T,x.next_out.set(n.win.subarray(A,A+T),C),C+=T,A+=T,A==n.end&&(A=0,n.write==n.end&&(n.write=0),T=n.write-A,T>x.avail_out&&(T=x.avail_out),T!==0&&b==-5&&(b=0),x.avail_out-=T,x.total_out+=T,x.next_out.set(n.win.subarray(A,A+T),C),C+=T,A+=T),x.next_out_index=C,n.read=A,b},n.proc=function(x,b){let T,C,A,E,v,D,O,R;for(E=x.next_in_index,v=x.avail_in,C=n.bitb,A=n.bitk,D=n.write,O=D<n.read?n.read-D-1:n.end-D;;){let M,N,_,S,w,I,L,B;switch(i){case MS:for(;A<3;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}switch(T=C&7,d=T&1,T>>>1){case 0:C>>>=3,A-=3,T=A&7,C>>>=T,A-=T,i=eY;break;case 1:M=[],N=[],_=[[]],S=[[]],nY.inflate_trees_fixed(M,N,_,S),f.init(M[0],N[0],_[0],0,S[0],0),C>>>=3,A-=3,i=tH;break;case 2:C>>>=3,A-=3,i=ige;break;case 3:return C>>>=3,A-=3,i=wT,x.msg="invalid block type",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b)}break;case eY:for(;A<32;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}if((~C>>>16&65535)!=(C&65535))return i=wT,x.msg="invalid stored block lengths",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);o=C&65535,C=A=0,i=o!==0?nge:d!==0?nH:MS;break;case nge:if(v===0||O===0&&(D==n.end&&n.read!==0&&(D=0,O=D<n.read?n.read-D-1:n.end-D),O===0&&(n.write=D,b=n.inflate_flush(x,b),D=n.write,O=D<n.read?n.read-D-1:n.end-D,D==n.end&&n.read!==0&&(D=0,O=D<n.read?n.read-D-1:n.end-D),O===0)))return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);if(b=0,T=o,T>v&&(T=v),T>O&&(T=O),n.win.set(x.read_buf(E,T),D),E+=T,v-=T,D+=T,O-=T,(o-=T)!==0)break;i=d!==0?nH:MS;break;case ige:for(;A<14;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}if(r=T=C&16383,(T&31)>29||(T>>5&31)>29)return i=wT,x.msg="too many length or distance symbols",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);if(T=258+(T&31)+(T>>5&31),!a||a.length<T)a=[];else for(R=0;R<T;R++)a[R]=0;C>>>=14,A-=14,s=0,i=oge;case oge:for(;s<4+(r>>>10);){for(;A<3;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}a[tge[s++]]=C&7,C>>>=3,A-=3}for(;s<19;)a[tge[s++]]=0;if(c[0]=7,T=m.inflate_trees_bits(a,c,u,p,x),T!=0)return b=T,b==-3&&(a=null,i=wT),n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);s=0,i=rge;case rge:for(;T=r,!(s>=258+(T&31)+(T>>5&31));){let U,V;for(T=c[0];A<T;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}if(T=p[(u[0]+(C&qu[T]))*3+1],V=p[(u[0]+(C&qu[T]))*3+2],V<16)C>>>=T,A-=T,a[s++]=V;else{for(R=V==18?7:V-14,U=V==18?11:3;A<T+R;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(E++)&255)<<A,A+=8}if(C>>>=T,A-=T,U+=C&qu[R],C>>>=R,A-=R,R=s,T=r,R+U>258+(T&31)+(T>>5&31)||V==16&&R<1)return a=null,i=wT,x.msg="invalid bit length repeat",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);V=V==16?a[R-1]:0;do a[R++]=V;while(--U!==0);s=R}}if(u[0]=-1,w=[],I=[],L=[],B=[],w[0]=9,I[0]=6,T=r,T=m.inflate_trees_dynamic(257+(T&31),1+(T>>5&31),a,w,I,L,B,p,x),T!=0)return T==-3&&(a=null,i=wT),b=T,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);f.init(w[0],I[0],p,L[0],p,B[0]),i=tH;case tH:if(n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,(b=f.proc(n,x,b))!=1)return n.inflate_flush(x,b);if(b=0,f.free(x),E=x.next_in_index,v=x.avail_in,C=n.bitb,A=n.bitk,D=n.write,O=D<n.read?n.read-D-1:n.end-D,d===0){i=MS;break}i=nH;case nH:if(n.write=D,b=n.inflate_flush(x,b),D=n.write,O=D<n.read?n.read-D-1:n.end-D,n.read!=n.write)return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);i=sge;case sge:return b=1,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);case wT:return b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b);default:return b=-2,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=E-x.next_in_index,x.next_in_index=E,n.write=D,n.inflate_flush(x,b)}}},n.free=function(x){n.reset(x,null),n.win=null,p=null},n.set_dictionary=function(x,b,T){n.win.set(x.subarray(b,b+T),0),n.read=n.write=T},n.sync_point=function(){return i==eY?1:0}}var Kot=32,Zot=8,$ot=0,age=1,cge=2,lge=3,uge=4,fge=5,tY=6,PF=7,dge=12,_0=13,Qot=[0,0,255,255];function Jot(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=PF,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new Xot(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==kot?-5:0,o=-5;;)switch(s.mode){case $ot:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=Zot){s.mode=_0,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=_0,n.msg="invalid win size",s.marker=5;break}s.mode=age;case age:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=_0,n.msg="incorrect header check",s.marker=5;break}if(!(r&Kot)){s.mode=PF;break}s.mode=cge;case cge:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=lge;case lge:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=uge;case uge:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=fge;case fge:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=tY,2);case tY:return s.mode=_0,n.msg="need dictionary",s.marker=0,-2;case PF:if(o=s.blocks.proc(n,o),o==-3){s.mode=_0,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=dge;case dge:return n.avail_in=0,1;case _0:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=tY)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=PF,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=_0&&(c.mode=_0,c.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=c.marker;i!==0&&r<4;)n.read_byte(o)==Qot[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,c.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=PF,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function mge(){}mge.prototype={inflateInit(e){let t=this;return t.istate=new Jot,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};function pge(e){let t=this,n=new mge,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=Bot,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let u=[],f,d,p=0,g=0,m=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),f=n.inflate(o),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(r)):u.push(r.subarray(0,n.next_out_index))),m+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(d=new Uint8Array(m),u.forEach(function(x){d.set(x,g),g+=x.length})):d=u[0]?new Uint8Array(u[0]):new Uint8Array,d}},t.flush=function(){n.inflateEnd()}}var LS="/",iY=new Date(2107,11,31),oY=new Date(1980,0,1),Li=void 0,Yu="undefined",og="function";var RF=class{constructor(t){return class extends null{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var ert=64,_ge=2;try{typeof navigator!=Yu&&navigator.hardwareConcurrency&&(_ge=navigator.hardwareConcurrency)}catch{}var trt={chunkSize:512*1024,maxWorkers:_ge,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Li,CompressionStreamNative:typeof CompressionStream!=Yu&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Yu&&DecompressionStream},y0=Object.assign({},trt);function OF(){return y0}function iH(e){return Math.max(e.chunkSize,ert)}function NS(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:u,DecompressionStream:f,workerScripts:d}=e;if(g0("baseURL",t),g0("chunkSize",n),g0("maxWorkers",i),g0("terminateWorkerTimeout",o),g0("useCompressionStream",r),g0("useWebWorkers",s),a&&(y0.CompressionStream=new RF(a)),c&&(y0.DecompressionStream=new RF(c)),g0("CompressionStream",u),g0("DecompressionStream",f),d!==Li){let{deflate:p,inflate:g}=d;if((p||g)&&(y0.workerScripts||(y0.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");y0.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");y0.workerScripts.inflate=g}}}function g0(e,t){t!==Li&&(y0[e]=t)}var gge=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;gge[e]=t}var rg=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^gge[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var MF=class extends null{constructor(){let t,n=new rg;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};function FS(e){if(typeof TextEncoder==Yu){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var fl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=fl.getPartial(n);return i===32?e.concat(t):fl._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+fl.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=fl.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=fl.getPartial(o);return i.push(fl.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},LF={bytes:{fromBits(e){let n=fl.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(fl.partial(8*(n&3),i)),t}}},yge={};yge.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=LF.utf8String.toBits(e));let n=t._buffer=fl.concat(t._buffer,e),i=t._length,o=t._length=i+fl.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=fl.concat(t,[fl.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var rY={};rY.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=o[c=o[a=o[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=o[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],u=r[3],f=r[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],x=4,b,T,C;for(let A=0;A<i;A++)b=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[m&255]^n[x],T=s[p>>>24]^a[g>>16&255]^c[m>>8&255]^u[d&255]^n[x+1],C=s[g>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[x+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[x+3],x+=4,d=b,p=T,g=C;for(let A=0;A<4;A++)o[t?3&-A:A]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[x++],b=d,d=p,p=g,g=m,m=b;return o}};var xge={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},sY={};sY.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=fl.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return fl.clamp(t,o)}};var x0={importKey(e){return new x0.hmacSha1(LF.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,u,f=new ArrayBuffer(o),d=new DataView(f),p=0,g=fl;for(t=LF.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)d.setInt32(p,r[a]),p+=4}return f.slice(0,i/8)}};x0.hmacSha1=class{constructor(e){let t=this,n=t._hash=yge.sha1,i=[[],[]];t._baseHash=[new n,new n];let o=t._baseHash[0].blockSize/32;e.length>o&&(e=new n().update(e).finalize());for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var nrt=typeof crypto!=Yu&&typeof crypto.getRandomValues==og,b0="Invalid password",DT="Invalid signature",sg="zipjs-abort-check-password";function oH(e){return nrt?crypto.getRandomValues(e):xge.getRandomValues(e)}var BS=16,irt="raw",Cge={name:"PBKDF2"},ort={name:"HMAC"},rrt="SHA-1",srt=Object.assign({hash:ort},Cge),aY=Object.assign({iterations:1e3,hash:{name:rrt}},Cge),art=["deriveBits"],FF=[8,12,16],NF=[16,24,32],T0=10,crt=[0,0,0,0],aH=typeof crypto!=Yu,VF=aH&&crypto.subtle,Age=aH&&typeof VF!=Yu,jm=LF.bytes,lrt=rY.aes,urt=sY.ctrGladman,frt=x0.hmacSha1,bge=aH&&Age&&typeof VF.importKey==og,Tge=aH&&Age&&typeof VF.deriveBits==og,rH=class extends null{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:vge(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await drt(c,f,u,fd(s,0,FF[f]+2)),s=fd(s,FF[f]+2),r?a.error(new Error(sg)):d()):await p;let g=new Uint8Array(s.length-T0-(s.length-T0)%BS);a.enqueue(Ege(c,s,g,0,T0,!0))},async flush(s){let{signed:a,ctr:c,hmac:u,pending:f,ready:d}=this;if(u&&c){await d;let p=fd(f,0,f.length-T0),g=fd(f,f.length-T0),m=new Uint8Array;if(p.length){let x=kF(jm,p);u.update(x);let b=c.update(x);m=BF(jm,b)}if(a){let x=fd(BF(jm,u.digest()),0,T0);for(let b=0;b<T0;b++)if(x[b]!=g[b])throw new Error(DT)}s.enqueue(m)}}})}},sH=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:vge(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:u,resolveReady:f,ready:d}=a,p=new Uint8Array;c?(p=await hrt(a,u,c),f()):await d;let g=new Uint8Array(p.length+r.length-r.length%BS);g.set(p,0),s.enqueue(Ege(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(c.length){let d=s.update(kF(jm,c));a.update(d),f=BF(jm,d)}o.signature=BF(jm,a.digest()).slice(0,T0),r.enqueue(cY(f,o.signature))}}}),o=this}};function Ege(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,u=t.length-o;c.length&&(t=cY(c,t),n=_rt(n,u-u%BS));let f;for(f=0;f<=u-BS;f+=BS){let d=kF(jm,fd(t,f,f+BS));r&&a.update(d);let p=s.update(d);r||a.update(p),n.set(BF(jm,p),f+i)}return e.pending=fd(t,f),n}async function drt(e,t,n,i){let o=await Sge(e,t,n,fd(i,0,FF[t])),r=fd(i,FF[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(b0)}async function hrt(e,t,n){let i=oH(new Uint8Array(FF[t])),o=await Sge(e,t,n,i);return cY(i,o)}async function Sge(e,t,n,i){e.password=null;let o=await mrt(irt,n,srt,!1,art),r=await prt(Object.assign({salt:i},aY),o,8*(NF[t]*2+2)),s=new Uint8Array(r),a=kF(jm,fd(s,0,NF[t])),c=kF(jm,fd(s,NF[t],NF[t]*2)),u=fd(s,NF[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new urt(new lrt(a),Array.from(crt)),hmac:new frt(c)}),u}async function mrt(e,t,n,i,o){if(bge)try{return await VF.importKey(e,t,n,i,o)}catch{return bge=!1,x0.importKey(t)}else return x0.importKey(t)}async function prt(e,t,n){if(Tge)try{return await VF.deriveBits(e,t,n)}catch{return Tge=!1,x0.pbkdf2(t,e.salt,aY.iterations,n)}else return x0.pbkdf2(t,e.salt,aY.iterations,n)}function vge(e,t){return t===Li?FS(e):t}function cY(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function _rt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function fd(e,t,n){return e.subarray(t,n)}function BF(e,t){return e.fromBits(t)}function kF(e,t){return e.toBits(t)}var kS=12,cH=class extends null{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Pge(this,t)},transform(o,r){let s=this;if(s.password){let a=wge(s,o.subarray(0,kS));if(s.password=null,a[kS-1]!=s.passwordVerification)throw new Error(b0);o=o.subarray(kS)}i?r.error(new Error(sg)):r.enqueue(wge(s,o))}})}},lH=class extends null{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Pge(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=oH(new Uint8Array(kS));c[kS-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(Dge(r,c),0),a=kS}else s=new Uint8Array(i.length),a=0;s.set(Dge(r,i),a),o.enqueue(s)}})}};function wge(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Rge(e)^t[i],lY(e,n[i]);return n}function Dge(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Rge(e)^t[i],lY(e,t[i]);return n}function Pge(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new rg(n[0]),crcKey2:new rg(n[2])});for(let i=0;i<t.length;i++)lY(e,t.charCodeAt(i))}function lY(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Ige(Math.imul(Ige(i+Oge(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function Rge(e){let t=e.keys[2]|2;return Oge(Math.imul(t,t^1)>>>8)}function Oge(e){return e&255}function Ige(e){return e&4294967295}var Mge="deflate-raw",uH=class extends null{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:u,level:f}=t,d=this,p,g,m=Lge(super.readable);(!s||c)&&u&&(p=new MF,m=qm(m,p)),r&&(m=Fge(m,a,{level:f,chunkSize:n},o,i)),s&&(c?m=qm(m,new lH(t)):(g=new sH(t),m=qm(m,g))),Nge(d,m,()=>{let x;s&&!c&&(x=g.signature),(!s||c)&&u&&(x=new DataView(p.value.buffer).getUint32(0)),d.signature=x})}},fH=class extends null{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:u,useCompressionStream:f}=t,d,p,g=Lge(super.readable);s&&(r?g=qm(g,new cH(t)):(p=new rH(t),g=qm(g,p))),u&&(g=Fge(g,f,{chunkSize:n},o,i)),(!s||r)&&a&&(d=new MF,g=qm(g,d)),Nge(this,g,()=>{if((!s||r)&&a){let m=new DataView(d.value.buffer);if(c!=m.getUint32(0,!1))throw new Error(DT)}})}};function Lge(e){return qm(e,new null({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function Nge(e,t,n){t=qm(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function Fge(e,t,n,i,o){try{let r=t&&i?i:o;e=qm(e,new r(Mge,n))}catch{if(t)try{e=qm(e,new o(Mge,n))}catch{return e}else return e}return e}function qm(e,t){return e.pipeThrough(t)}var Bge="message",kge="start",Vge="pull",uY="data",Uge="ack",fY="close",mH="deflate",pH="inflate";var dH=class extends null{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(mH)?r=uH:o.startsWith(pH)&&(r=fH);let s=0,a=0,c=new r(t,n),u=super.readable,f=new null({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),d=new null({transform(p,g){p&&p.length&&(s+=p.length,g.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(f).pipeThrough(c).pipeThrough(d)}})}},hH=class extends null{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var Gge=typeof Worker!=Yu;var VS=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:u},f){let{signal:d}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new hH(r.chunkSize)).pipeThrough(new hY(n,s),{signal:d}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:m}=t;g?(m?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,f(t)}}),(a&&Gge?grt:Wge)(t,r)}},hY=class extends null{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await dY(n,o)},async transform(a,c){s+=a.length,i&&await dY(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await dY(r,s)}})}};async function dY(e,...t){try{await e(...t)}catch{}}function Wge(e,t){return{run:()=>yrt(e,t)}}function grt(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=Trt(e.scripts[0],n,e)}catch{return Gge=!1,Wge(e,t)}Object.assign(e,{worker:o,interface:{run:()=>xrt(e,{chunkSize:i})}})}return e.interface}async function yrt({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new dH(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}finally{i()}}async function xrt(e,t){let n,i,o=new Promise((p,g)=>{n=p,i=g});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:u}=brt(e.writable),f=_H({type:kge,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);f||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let d=await o;return f||await c.getWriter().close(),await u,d}function brt(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var zge=!0,Hge=!0;function Trt(e,t,n){let i={type:"module"},o,r;typeof e==og&&(e=e());try{o=new URL(e,t)}catch{o=e}if(zge)try{r=new Worker(o)}catch{zge=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(Bge,s=>Crt(s,n)),r}function _H(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,c.push(e.value)),o&&Hge?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{Hge=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function Crt({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d}=t;try{if(s){let{message:g,stack:m,code:x,name:b}=s,T=new Error(g);Object.assign(T,{stack:m,code:x,name:b}),p(T)}else{if(n==Vge){let{value:g,done:m}=await a.read();_H({type:uY,value:g,done:m,messageId:o},t)}n==uY&&(await c.ready,await c.write(new Uint8Array(i)),_H({type:Uge,messageId:o},t)),n==fY&&p(null,r)}}catch(g){_H({type:fY,messageId:o},t),p(g)}function p(g,m){g?f(g):u(m),c&&c.releaseLock(),d()}}var IT=[],mY=[];var jge=0;async function gH(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:c,signed:u,encrypted:f}=n,{workerScripts:d,maxWorkers:p}=i;t.transferStreams=o||o===Li;let g=!c&&!u&&!f&&!t.transferStreams;return t.useWebWorkers=!g&&(r||r===Li&&i.useWebWorkers),t.scripts=t.useWebWorkers&&d?d[a]:[],n.useCompressionStream=s||s===Li&&i.useCompressionStream,(await m()).run();async function m(){let b=IT.find(T=>!T.busy);if(b)return qge(b),new VS(b,e,t,x);if(IT.length<p){let T={indexWorker:jge};return jge++,IT.push(T),new VS(T,e,t,x)}else return new Promise(T=>mY.push({resolve:T,stream:e,workerOptions:t}))}function x(b){if(mY.length){let[{resolve:T,stream:C,workerOptions:A}]=mY.splice(0,1);T(new VS(b,C,A,x))}else b.worker?(qge(b),Art(b,t)):IT=IT.filter(T=>T!=b)}}function Art(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{IT=IT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function qge(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var Ert="Writer iterator completed too soon",Srt="text/plain";var vrt="Content-Type";var wrt=64*1024,gY="writable",US=class{constructor(){this.size=0}init(){this.initialized=!0}},yH=class extends US{get readable(){let t=this,{chunkSize:n=wrt}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this;o.enqueue(await Ua(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},pY=class extends US{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,gY,{get(){return n}})}writeUint8Array(){}};var xH=class extends pY{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length>2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},ag=class extends yH{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return s.byteLength>n&&(s=s.slice(t,o)),new Uint8Array(s)}},UF=class extends US{constructor(t){super();let n=this,i=new null,o=[];t&&o.push([vrt,t]),Object.defineProperty(n,gY,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},bH=class extends ag{constructor(t){super(new Blob([t],{type:Srt}))}},TH=class extends UF{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var _Y=class extends yH{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;c>=r[a].size;)c-=r[a].size,a++;let u=r[a],f=u.size;if(c+n<=f)s=await Ua(u,c,n);else{let d=f-c;s=new Uint8Array(n),s.set(await Ua(u,c,d)),s.set(await o.readUint8Array(t+d,n-d,i),d)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},CH=class extends US{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(f){let{availableSize:d}=i;if(s)f.length>=d?(await c(f.slice(0,d)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.slice(d))):await c(f);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(Ert);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Xm(o),r=p.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,gY,{get(){return a}});async function c(f){let d=f.length;d&&(await s.ready,await s.write(f),o.size+=d,i.size+=d,i.availableSize-=d)}async function u(){r.size=o.size,await s.close()}}};async function Xm(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function AH(e){return Array.isArray(e)&&(e=new _Y(e)),e instanceof ReadableStream&&(e={readable:e}),e}function EH(e){e.writable===Li&&typeof e.next==og&&(e=new CH(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Li&&(t.size=0),e instanceof CH||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Ua(e,t,n,i){return e.readUint8Array(t,n,i)}var Yge="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Drt=Yge.length==256;function Xge(e){if(Drt){let t="";for(let n=0;n<e.length;n++)t+=Yge[e[n]];return t}else return new TextDecoder().decode(e)}function zF(e,t){return t&&t.trim().toLowerCase()=="cp437"?Xge(e):new TextDecoder(t).decode(e)}var yY="filename",xY="rawFilename",bY="comment",TY="rawComment",CY="uncompressedSize",AY="compressedSize",EY="offset",SH="diskNumberStart",zS="lastModDate",vH="rawLastModDate",HF="lastAccessDate",Kge="rawLastAccessDate",GF="creationDate",Zge="rawCreationDate",SY="internalFileAttribute",vY="externalFileAttribute",wY="msDosCompatible",wH="zip64",DY="encrypted",IY="version",PY="versionMadeBy",RY="zipCrypto",Irt=[yY,xY,AY,CY,zS,vH,bY,TY,HF,GF,EY,SH,SH,SY,vY,wY,wH,DY,IY,PY,RY,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],C0=class{constructor(t){Irt.forEach(n=>this[n]=t[n])}};var OY="File format is not recognized",Mrt="End of central directory not found",Lrt="End of Zip64 central directory locator not found",Nrt="Central directory header not found",Frt="Local file header not found",Brt="Zip64 extra field not found",krt="File contains encrypted entry",Vrt="Encryption method not supported",$ge="Compression method not supported",Qge="Split zip file",Jge="utf-8",eye="cp437",Urt=[[CY,4294967295],[AY,4294967295],[EY,4294967295],[SH,65535]],zrt={[65535]:{getValue:Ts,bytes:4},[4294967295]:{getValue:DH,bytes:8}},NH=class{constructor(t,n={}){Object.assign(this,{reader:AH(t),options:n,config:OF()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Xm(i),(i.size===Li||!i.readUint8Array)&&(i=new ag(await new Response(i.readable).blob()),await Xm(i)),i.size<22)throw new Error(OY);i.chunkSize=iH(o);let r=await qrt(i,101010256,i.size,22,65535*16);if(!r){let N=await Ua(i,0,4),_=xa(N);throw Ts(_)==134695760?new Error(Qge):new Error(Mrt)}let s=xa(r),a=Ts(s,12),c=Ts(s,16),u=r.offset,f=ya(s,20),d=u+22+f,p=ya(s,4),g=i.lastDiskNumber||0,m=ya(s,6),x=ya(s,8),b=0,T=0;if(c==4294967295||a==4294967295||x==65535||m==65535){let N=await Ua(i,r.offset-20,20),_=xa(N);if(Ts(_,0)==117853008){c=DH(_,8);let S=await Ua(i,c,56,-1),w=xa(S),I=r.offset-20-56;if(Ts(w,0)!=101075792&&c!=I){let L=c;c=I,b=c-L,S=await Ua(i,c,56,-1),w=xa(S)}if(Ts(w,0)!=101075792)throw new Error(Lrt);p==65535&&(p=Ts(w,16)),m==65535&&(m=Ts(w,20)),x==65535&&(x=DH(w,32)),a==4294967295&&(a=DH(w,40)),c-=a}}if(c>=i.size&&(b=i.size-c-a-22,c=i.size-a-22),g!=p)throw new Error(Qge);if(c<0)throw new Error(OY);let C=0,A=await Ua(i,c,a,m),E=xa(A);if(a){let N=r.offset-a;if(Ts(E,C)!=33639248&&c!=N){let _=c;c=N,b+=c-_,A=await Ua(i,c,a,m),E=xa(A)}}let v=r.offset-c-(i.lastDiskOffset||0);if(a!=v&&v>=0&&(a=v,A=await Ua(i,c,a,m),E=xa(A)),c<0||c>=i.size)throw new Error(OY);let D=dl(n,t,"filenameEncoding"),O=dl(n,t,"commentEncoding");for(let N=0;N<x;N++){let _=new LY(i,o,n.options);if(Ts(E,C)!=33639248)throw new Error(Nrt);nye(_,E,C+6);let S=!!_.bitFlag.languageEncodingFlag,w=C+46,I=w+_.filenameLength,L=I+_.extraFieldLength,B=ya(E,C+4),U=(B&0)==0,V=A.subarray(w,I),G=ya(E,C+32),k=L+G,W=A.subarray(L,k),j=S,J=S,q=U&&(HS(E,C+38)&16)==16,K=Ts(E,C+42)+b;Object.assign(_,{versionMadeBy:B,msDosCompatible:U,compressedSize:0,uncompressedSize:0,commentLength:G,directory:q,offset:K,diskNumberStart:ya(E,C+34),internalFileAttribute:ya(E,C+36),externalFileAttribute:Ts(E,C+38),rawFilename:V,filenameUTF8:j,commentUTF8:J,rawExtraField:A.subarray(I,L)});let Q=dl(n,t,"decodeText")||zF,de=j?Jge:D||eye,ye=J?Jge:O||eye,ce=Q(V,de);ce===Li&&(ce=zF(V,de));let _e=Q(W,ye);_e===Li&&(_e=zF(W,ye)),Object.assign(_,{rawComment:W,filename:ce,comment:_e,directory:q||ce.endsWith(LS)}),T=Math.max(K,T),await iye(_,_,E,C+6),_.zipCrypto=_.encrypted&&!_.extraFieldAES;let xe=new C0(_);xe.getData=(Ae,ke)=>_.getData(Ae,xe,ke),C=k;let{onprogress:De}=t;if(De)try{await De(N+1,x,new C0(_))}catch{}yield xe}let R=dl(n,t,"extractPrependedData"),M=dl(n,t,"extractAppendedData");return R&&(n.prependedData=T>0?await Ua(i,0,T):new Uint8Array),n.comment=f?await Ua(i,u+22,f):new Uint8Array,M&&(n.appendedData=d<i.size?await Ua(i,d,i.size-d):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var LY=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:c,compressionMethod:u,config:f,bitFlag:d,signature:p,rawLastModDate:g,uncompressedSize:m,compressedSize:x}=o,b=n.localDirectory={},T=await Ua(r,s,30,a),C=xa(T),A=dl(o,i,"password"),E=dl(o,i,"rawPassword"),v=dl(o,i,"passThrough");if(A=A&&A.length&&A,E=E&&E.length&&E,c&&c.originalCompressionMethod!=99)throw new Error($ge);if(u!=0&&u!=8&&!v)throw new Error($ge);if(Ts(C,0)!=67324752)throw new Error(Frt);nye(b,C,4),b.rawExtraField=b.extraFieldLength?await Ua(r,s+30+b.filenameLength,b.extraFieldLength,a):new Uint8Array,await iye(o,b,C,4,!0),Object.assign(n,{lastAccessDate:b.lastAccessDate,creationDate:b.creationDate});let D=o.encrypted&&b.encrypted&&!v,O=D&&!c;if(v||(n.zipCrypto=O),D){if(!O&&c.strength===Li)throw new Error(Vrt);if(!A&&!E)throw new Error(krt)}let R=s+30+b.filenameLength+b.extraFieldLength,M=x,N=r.readable;Object.assign(N,{diskNumberStart:a,offset:R,size:M});let _=dl(o,i,"signal"),S=dl(o,i,"checkPasswordOnly");S&&(t=new WritableStream),t=EH(t),await Xm(t,v?x:m);let{writable:w}=t,{onstart:I,onprogress:L,onend:B}=i,U={options:{codecType:pH,password:A,rawPassword:E,zipCrypto:O,encryptionStrength:c&&c.strength,signed:dl(o,i,"checkSignature")&&!v,passwordVerification:O&&(d.dataDescriptor?g>>>8&255:p>>>24&255),signature:p,compressed:u!=0&&!v,encrypted:o.encrypted&&!v,useWebWorkers:dl(o,i,"useWebWorkers"),useCompressionStream:dl(o,i,"useCompressionStream"),transferStreams:dl(o,i,"transferStreams"),checkPasswordOnly:S},config:f,streamOptions:{signal:_,size:M,onstart:I,onprogress:L,onend:B}},V=0;try{({outputSize:V}=await gH({readable:N,writable:w},U))}catch(G){if(!S||G.message!=sg)throw G}finally{let G=dl(o,i,"preventClose");w.size+=V,!G&&!w.locked&&await w.getWriter().close()}return S?Li:t.getData?t.getData():w}};function nye(e,t,n){let i=e.rawBitFlag=ya(t,n+2),o=(i&1)==1,r=Ts(t,n+6);Object.assign(e,{encrypted:o,version:ya(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:Yrt(r),filenameLength:ya(t,n+22),extraFieldLength:ya(t,n+24)})}async function iye(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=xa(new Uint8Array(r)),c=0;try{for(;c<r.length;){let T=ya(a,c),C=ya(a,c+2);s.set(T,{type:T,data:r.slice(c+4,c+4+C)}),c+=4+C}}catch{}let u=ya(n,i+4);Object.assign(t,{signature:Ts(n,i+10),uncompressedSize:Ts(n,i+18),compressedSize:Ts(n,i+14)});let f=s.get(1);f&&(Hrt(f,t),t.extraFieldZip64=f);let d=s.get(28789);d&&(await tye(d,yY,xY,t,e),t.extraFieldUnicodePath=d);let p=s.get(25461);p&&(await tye(p,bY,TY,t,e),t.extraFieldUnicodeComment=p);let g=s.get(39169);g?(Grt(g,t,u),t.extraFieldAES=g):t.compressionMethod=u;let m=s.get(10);m&&(Wrt(m,t),t.extraFieldNTFS=m);let x=s.get(21589);x&&(jrt(x,t,o),t.extraFieldExtendedTimestamp=x);let b=s.get(6534);b&&(t.extraFieldUSDZ=b)}function Hrt(e,t){t.zip64=!0;let n=xa(e.data),i=Urt.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[s,a]=i[o];if(t[s]==a){let c=zrt[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(Brt)}}async function tye(e,t,n,i,o){let r=xa(e.data),s=new rg;s.append(o[n]);let a=xa(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Ts(r,1);Object.assign(e,{version:HS(r,0),[t]:zF(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==Ts(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function Grt(e,t,n){let i=xa(e.data),o=HS(i,4);Object.assign(e,{vendorVersion:HS(i,0),vendorId:HS(i,2),strength:o,originalCompressionMethod:n,compressionMethod:ya(i,5)}),t.compressionMethod=e.compressionMethod}function Wrt(e,t){let n=xa(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=ya(n,i),s=ya(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=xa(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=MY(s),f=MY(a),d=MY(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p)}}catch{}}function jrt(e,t,n){let i=xa(e.data),o=HS(i,0),r=[],s=[];n?((o&1)==1&&(r.push(zS),s.push(vH)),(o&2)==2&&(r.push(HF),s.push(Kge)),(o&4)==4&&(r.push(GF),s.push(Zge))):e.data.length>=5&&(r.push(zS),s.push(vH));let a=1;r.forEach((c,u)=>{if(e.data.length>=a+4){let f=Ts(i,a);t[c]=e[c]=new Date(f*1e3);let d=s[u];e[d]=f}a+=4})}async function qrt(e,t,n,i,o){let r=new Uint8Array(4),s=xa(r);Xrt(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,d=await Ua(e,f,u);for(let p=d.length-i;p>=0;p--)if(d[p]==r[0]&&d[p+1]==r[1]&&d[p+2]==r[2]&&d[p+3]==r[3])return{offset:f+p,buffer:d.slice(p,p+i).buffer}}}function dl(e,t,n){return t[n]===Li?e.options[n]:t[n]}function Yrt(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function MY(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function HS(e,t){return e.getUint8(t)}function ya(e,t){return e.getUint16(t,!0)}function Ts(e,t){return e.getUint32(t,!0)}function DH(e,t){return Number(e.getBigUint64(t,!0))}function Xrt(e,t,n){e.setUint32(t,n,!0)}function xa(e){return new DataView(e.buffer)}var Qrt="File already exists",Jrt="Zip file comment exceeds 64KB",est="File entry comment exceeds 64KB",tst="File entry name exceeds 64KB",sye="Version exceeds 65535",nst="The strength must equal 1, 2, or 3",ist="Extra field type exceeds 65535",ost="Extra field data exceeds 64KB",XY="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",rst="Undefined uncompressed size",aye=new Uint8Array([7,0,2,0,65,69,3,0,0]),qY=0,cye=[],kH=class{constructor(t,n={}){t=EH(t);let i=t.availableSize!==Li&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Li&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:OF(),files:new Map,filenames:new Set,offset:n.offset===Li?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;qY<s.maxWorkers?qY++:await new Promise(c=>cye.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(Qrt);return o.filenames.add(t),a=sst(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=cye.shift();c?c():qY--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await pst(this,t,n),_o(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function sst(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(LS)?t+=LS:i.directory=t.endsWith(LS);let o=_o(e,i,"encodeText",FS),r=o(t);if(r===Li&&(r=FS(t)),$i(r)>65535)throw new Error(tst);let s=i.comment||"",a=o(s);if(a===Li&&(a=FS(s)),$i(a)>65535)throw new Error(est);let c=_o(e,i,IY,20);if(c>65535)throw new Error(sye);let u=_o(e,i,PY,20);if(u>65535)throw new Error(sye);let f=_o(e,i,zS,new Date),d=_o(e,i,HF),p=_o(e,i,GF),g=_o(e,i,wY,!0),m=_o(e,i,SY,0),x=_o(e,i,vY,0),b=_o(e,i,"passThrough"),T,C;b||(T=_o(e,i,"password"),C=_o(e,i,"rawPassword"));let A=_o(e,i,"encryptionStrength",3),E=_o(e,i,RY),v=_o(e,i,"extendedTimestamp",!0),D=_o(e,i,"keepOrder",!0),O=_o(e,i,"level"),R=_o(e,i,"useWebWorkers"),M=_o(e,i,"bufferedWrite"),N=_o(e,i,"dataDescriptorSignature",!1),_=_o(e,i,"signal"),S=_o(e,i,"useUnicodeFileNames",!0),w=_o(e,i,"useCompressionStream"),I=_o(e,i,"compressionMethod"),L=_o(e,i,"dataDescriptor",!0),B=_o(e,i,wH);if(!E&&(T!==Li||C!==Li)&&!(A>=1&&A<=3))throw new Error(nst);let U=new Uint8Array,{extraField:V}=i;if(V){let wt=0,_t=0;V.forEach(Be=>wt+=4+$i(Be)),U=new Uint8Array(wt),V.forEach((Be,Yt)=>{if(Yt>65535)throw new Error(ist);if($i(Be)>65535)throw new Error(ost);Ms(U,new Uint16Array([Yt]),_t),Ms(U,new Uint16Array([$i(Be)]),_t+2),Ms(U,Be,_t+4),_t+=4+$i(Be)})}let G=0,k=0,W=0;if(b&&({uncompressedSize:W}=i,W===Li))throw new Error(rst);let j=B===!0;n&&(n=AH(n),await Xm(n),b?G=lye(W):n.size===Li?(L=!0,(B||B===Li)&&(B=!0,W=G=4294967296)):(W=n.size,G=lye(W)));let{diskOffset:J,diskNumber:q,maxSize:K}=e.writer,Q=j||W>4294967295,de=j||G>4294967295,ye=j||e.offset+e.pendingEntriesSize-J>4294967295,_e=_o(e,i,"supportZip64SplitFile",!0)&&j||q+Math.ceil(e.pendingEntriesSize/K)>65535;if(ye||Q||de||_e){if(B===!1||!D)throw new Error(XY);B=!0}B=B||!1;let xe=_o(e,i,DY),{signature:De}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:c,versionMadeBy:u,lastModDate:f,lastAccessDate:d,creationDate:p,rawExtraField:U,zip64:B,zip64UncompressedSize:Q,zip64CompressedSize:de,zip64Offset:ye,zip64DiskNumberStart:_e,password:T,rawPassword:C,level:!w&&e.config.CompressionStream===Li&&e.config.CompressionStreamNative===Li?0:O,useWebWorkers:R,encryptionStrength:A,extendedTimestamp:v,zipCrypto:E,bufferedWrite:M,keepOrder:D,useUnicodeFileNames:S,dataDescriptor:L,dataDescriptorSignature:N,signal:_,msDosCompatible:g,internalFileAttribute:m,externalFileAttribute:x,useCompressionStream:w,passThrough:b,encrypted:!!(T&&$i(T)||C&&$i(C))||b&&xe,signature:De,compressionMethod:I});let Ae=lst(i),ke=fst(i),ze=$i(Ae.localHeaderArray,ke.dataDescriptorArray);k=ze+G,e.options.usdz&&(k+=k+64),e.pendingEntriesSize+=k;let tt;try{tt=await ast(e,t,n,{headerInfo:Ae,dataDescriptorInfo:ke,metadataSize:ze},i)}finally{e.pendingEntriesSize-=k}return Object.assign(tt,{name:t,comment:s,extraField:V}),new C0(tt)}async function ast(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:u}=o,{headerInfo:f}=i,{usdz:d}=e.options,p=Array.from(r.values()).pop(),g={},m,x,b,T,C,A,E;r.set(t,g);try{let R;a&&(R=p&&p.lock,v()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!d?(A=new null,E=new Response(A.readable).blob(),A.writable.size=0,m=!0,e.bufferedWrites++,await Xm(s)):(A=s,await D()),await Xm(A);let{writable:M}=s,{diskOffset:N}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let S=new Uint8Array(4),w=za(S);Zi(w,0,134695760),await Km(M,S),e.offset+=4}d&&ust(i,e.offset-N),m||(await R,await O(M));let{diskNumber:_}=s;if(C=!0,g.diskNumberStart=_,g=await cst(n,A,g,i,e.config,o),C=!1,r.set(t,g),g.filename=t,m){await A.writable.getWriter().close();let S=await E;await R,await D(),T=!0,c||(S=await hst(g,S,M,o)),await O(M),g.diskNumberStart=s.diskNumber,N=s.diskOffset,await S.stream().pipeTo(M,{preventClose:!0,preventAbort:!0,signal:u}),M.size+=S.size,T=!1}if(g.offset=e.offset-N,g.zip64)mst(g,o);else if(g.offset>4294967295)throw new Error(XY);return e.offset+=g.size,g}catch(R){if(m&&T||!m&&C){if(e.hasCorruptedEntries=!0,R)try{R.corruptedEntry=!0}catch{}m?e.offset+=A.writable.size:e.offset=A.writable.size}throw r.delete(t),R}finally{m&&e.bufferedWrites--,b&&b(),x&&x()}function v(){g.lock=new Promise(R=>b=R)}async function D(){e.writerLocked=!0;let{lockWriter:R}=e;e.lockWriter=new Promise(M=>x=()=>{e.writerLocked=!1,M()}),await R}async function O(R){$i(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Km(R,new Uint8Array))}}async function cst(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=o,{localHeaderArray:f,headerArray:d,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:x,version:b,compressionMethod:T,rawExtraFieldExtendedTimestamp:C,extraFieldExtendedTimestampFlag:A,rawExtraFieldNTFS:E,rawExtraFieldAES:v}=a,{dataDescriptorArray:D}=c,{rawFilename:O,lastAccessDate:R,creationDate:M,password:N,rawPassword:_,level:S,zip64:w,zip64UncompressedSize:I,zip64CompressedSize:L,zip64Offset:B,zip64DiskNumberStart:U,zipCrypto:V,dataDescriptor:G,directory:k,versionMadeBy:W,rawComment:j,rawExtraField:J,useWebWorkers:q,onstart:K,onprogress:Q,onend:de,signal:ye,encryptionStrength:ce,extendedTimestamp:_e,msDosCompatible:xe,internalFileAttribute:De,externalFileAttribute:Ae,useCompressionStream:ke,passThrough:ze}=s,tt={lock:i,versionMadeBy:W,zip64:w,directory:!!k,filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:j,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:E,rawExtraFieldAES:v,rawExtraField:J,extendedTimestamp:_e,msDosCompatible:xe,internalFileAttribute:De,externalFileAttribute:Ae,diskNumberStart:n},{signature:wt,uncompressedSize:_t}=s,Be=0;ze||(_t=0);let{writable:Yt}=t;if(e){e.chunkSize=iH(r),await Km(Yt,f);let ut=e.readable,tn=ut.size=e.size,Ce={options:{codecType:mH,level:S,rawPassword:_,password:N,encryptionStrength:ce,zipCrypto:m&&V,passwordVerification:m&&V&&g>>8&255,signed:!ze,compressed:x&&!ze,encrypted:m&&!ze,useWebWorkers:q,useCompressionStream:ke,transferStreams:!1},config:r,streamOptions:{signal:ye,size:tn,onstart:K,onprogress:Q,onend:de}},Te=await gH({readable:ut,writable:Yt},Ce);Be=Te.outputSize,ze||(_t=Te.inputSize,wt=Te.signature),Yt.size+=_t}else await Km(Yt,f);let Et;if(w){let ut=4;I&&(ut+=8),L&&(ut+=8),B&&(ut+=8),U&&(ut+=4),Et=new Uint8Array(ut)}else Et=new Uint8Array;return dst({signature:wt,rawExtraFieldZip64:Et,compressedSize:Be,uncompressedSize:_t,headerInfo:a,dataDescriptorInfo:c},s),G&&await Km(Yt,D),Object.assign(tt,{uncompressedSize:_t,compressedSize:Be,lastModDate:p,rawLastModDate:g,creationDate:M,lastAccessDate:R,encrypted:m,zipCrypto:V,size:u+Be,compressionMethod:T,version:b,headerArray:d,signature:wt,rawExtraFieldZip64:Et,extraFieldExtendedTimestampFlag:A,zip64UncompressedSize:I,zip64CompressedSize:L,zip64Offset:B,zip64DiskNumberStart:U}),tt}function lst(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:d,encryptionStrength:p,extendedTimestamp:g,encrypted:m}=e,x=r!==0&&!f,{version:b,compressionMethod:T}=e,C;if(m&&!a){C=new Uint8Array($i(aye)+2);let B=za(C);ro(B,0,39169),Ms(C,aye,2),VH(B,8,p)}else C=new Uint8Array;let A,E,v;if(g){E=new Uint8Array(9+(i?4:0)+(o?4:0));let B=za(E);ro(B,0,21589),ro(B,2,$i(E)-4),v=1+(i?2:0)+(o?4:0),VH(B,4,v);let U=5;Zi(B,U,Math.floor(n.getTime()/1e3)),U+=4,i&&(Zi(B,U,Math.floor(i.getTime()/1e3)),U+=4),o&&Zi(B,U,Math.floor(o.getTime()/1e3));try{A=new Uint8Array(36);let V=za(A),G=YY(n);ro(V,0,10),ro(V,2,32),ro(V,8,1),ro(V,10,24),Ql(V,12,G),Ql(V,20,YY(i)||G),Ql(V,28,YY(o)||G)}catch{A=new Uint8Array}}else A=E=new Uint8Array;let D=0;c&&(D=D|2048),u&&(D=D|8),T===Li&&(T=x?8:0),T==8&&(r>=1&&r<3&&(D=D|6),r>=3&&r<5&&(D=D|1),r===9&&(D=D|2)),s&&(b=b>45?b:45),m&&(D=D|1,a||(b=b>51?b:51,C[9]=T,T=99));let O=new Uint8Array(26),R=za(O);ro(R,0,b),ro(R,2,D),ro(R,4,T);let M=new Uint32Array(1),N=za(M),_;n<oY?_=oY:n>iY?_=iY:_=n,ro(N,0,(_.getHours()<<6|_.getMinutes())<<5|_.getSeconds()/2),ro(N,2,(_.getFullYear()-1980<<4|_.getMonth()+1)<<5|_.getDate());let S=M[0];Zi(R,6,S),ro(R,22,$i(t));let w=$i(C,E,A,d);ro(R,24,w);let I=new Uint8Array(30+$i(t)+w),L=za(I);return Zi(L,0,67324752),Ms(I,O,4),Ms(I,t,30),Ms(I,C,30+$i(t)),Ms(I,E,30+$i(t,C)),Ms(I,A,30+$i(t,C,E)),Ms(I,d,30+$i(t,C,E,A)),{localHeaderArray:I,headerArray:O,headerView:R,lastModDate:n,rawLastModDate:S,encrypted:m,compressed:x,version:b,compressionMethod:T,extraFieldExtendedTimestampFlag:v,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:A,rawExtraFieldAES:C,extraFieldLength:w}}function ust(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=za(i),s=64-(t+$i(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=za(a);ro(c,0,6534),ro(c,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array($i(u)+s),Ms(i,u),Ms(i,a,$i(u)),r=za(i),ro(r,28,o+s),e.metadataSize+=s}function fst(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=za(o),i&&(s=4,Zi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function dst(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:u}=s,{dataDescriptorView:f,dataDescriptorOffset:d}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:m,zipCrypto:x,dataDescriptor:b}=t;if((!u||x)&&n!==Li&&(Zi(c,10,n),b&&Zi(f,d,n)),p){let T=za(i);ro(T,0,1),ro(T,2,$i(i)-4);let C=4;g&&(Zi(c,18,4294967295),Ql(T,C,BigInt(r)),C+=8),m&&(Zi(c,14,4294967295),Ql(T,C,BigInt(o))),b&&(Ql(f,d+4,BigInt(o)),Ql(f,d+12,BigInt(r)))}else Zi(c,14,o),Zi(c,18,r),b&&(Zi(f,d+4,o),Zi(f,d+8,r))}async function hst(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&Zi(r,14,e.signature),e.zip64?(Zi(r,18,4294967295),Zi(r,22,4294967295)):(Zi(r,18,e.compressedSize),Zi(r,22,e.uncompressedSize)),await Km(n,new Uint8Array(o)),t.slice(o.byteLength)}function mst(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,u=za(n),f=4;r&&(f+=8),s&&(f+=8),a&&(Ql(u,f,BigInt(i)),f+=8),c&&Zi(u,f,o)}async function pst(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,u=0,f=e.offset-r,d=i.size;for(let[,v]of i){let{rawFilename:D,rawExtraFieldZip64:O,rawExtraFieldAES:R,rawComment:M,rawExtraFieldNTFS:N,rawExtraField:_,extendedTimestamp:S,extraFieldExtendedTimestampFlag:w,lastModDate:I}=v,L;if(S){L=new Uint8Array(9);let B=za(L);ro(B,0,21589),ro(B,2,5),VH(B,4,w),Zi(B,5,Math.floor(I.getTime()/1e3))}else L=new Uint8Array;v.rawExtraFieldCDExtendedTimestamp=L,u+=46+$i(D,M,O,R,N,L,_)}let p=new Uint8Array(u),g=za(p);await Xm(o);let m=0;for(let[v,D]of Array.from(i.values()).entries()){let{offset:O,rawFilename:R,rawExtraFieldZip64:M,rawExtraFieldAES:N,rawExtraFieldCDExtendedTimestamp:_,rawExtraFieldNTFS:S,rawExtraField:w,rawComment:I,versionMadeBy:L,headerArray:B,directory:U,zip64:V,zip64UncompressedSize:G,zip64CompressedSize:k,zip64DiskNumberStart:W,zip64Offset:j,msDosCompatible:J,internalFileAttribute:q,externalFileAttribute:K,diskNumberStart:Q,uncompressedSize:de,compressedSize:ye}=D,ce=$i(M,N,_,S,w);Zi(g,c,33639248),ro(g,c+4,L);let _e=za(B);G||Zi(_e,18,de),k||Zi(_e,14,ye),Ms(p,B,c+6),ro(g,c+30,ce),ro(g,c+32,$i(I)),ro(g,c+34,V&&W?65535:Q),ro(g,c+36,q),K?Zi(g,c+38,K):U&&J&&VH(g,c+38,16),Zi(g,c+42,V&&j?4294967295:O),Ms(p,R,c+46),Ms(p,M,c+46+$i(R)),Ms(p,N,c+46+$i(R,M)),Ms(p,_,c+46+$i(R,M,N)),Ms(p,S,c+46+$i(R,M,N,_)),Ms(p,w,c+46+$i(R,M,N,_,S)),Ms(p,I,c+46+$i(R)+ce);let xe=46+$i(R,I)+ce;if(c-m>o.availableSize&&(o.availableSize=0,await Km(s,p.slice(m,c)),m=c),c+=xe,n.onprogress)try{await n.onprogress(v+1,i.size,new C0(D))}catch{}}await Km(s,m?p.slice(m):p);let x=o.diskNumber,{availableSize:b}=o;b<22&&x++;let T=_o(e,n,wH);if(f>4294967295||u>4294967295||d>65535||x>65535){if(T===!1)throw new Error(XY);T=!0}let C=new Uint8Array(T?98:22),A=za(C);c=0,T&&(Zi(A,0,101075792),Ql(A,4,BigInt(44)),ro(A,12,45),ro(A,14,45),Zi(A,16,x),Zi(A,20,a),Ql(A,24,BigInt(d)),Ql(A,32,BigInt(d)),Ql(A,40,BigInt(u)),Ql(A,48,BigInt(f)),Zi(A,56,117853008),Ql(A,64,BigInt(f)+BigInt(u)),Zi(A,72,x+1),_o(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),d=65535,f=4294967295,u=4294967295,c+=76),Zi(A,c,101010256),ro(A,c+4,x),ro(A,c+6,a),ro(A,c+8,d),ro(A,c+10,d),Zi(A,c+12,u),Zi(A,c+16,f);let E=$i(t);if(E)if(E<=65535)ro(A,c+20,E);else throw new Error(Jrt);await Km(s,C),E&&await Km(s,t)}async function Km(e,t){let n=e.getWriter();try{await n.ready,e.size+=$i(t),await n.write(t)}finally{n.releaseLock()}}function YY(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function _o(e,t,n,i){let o=t[n]===Li?e.options[n]:t[n];return o===Li?i:o}function lye(e){return e+5*(Math.floor(e/16383)+1)}function VH(e,t,n){e.setUint8(t,n)}function ro(e,t,n){e.setUint16(t,n,!0)}function Zi(e,t,n){e.setUint32(t,n,!0)}function Ql(e,t,n){e.setBigUint64(t,n,!0)}function Ms(e,t,n){e.set(t,n)}function za(e){return new DataView(e.buffer)}function $i(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}NS({Deflate:Y_e,Inflate:pge});function _st(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var In=_st;function gst(e,t){this.position=e,this.headingPitchRange=t}var qF=gst;function UH(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new me,this.tourEnd=new me,this.entryStart=new me,this.entryEnd=new me,this._activeEntries=[]}UH.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};UH.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;dye.call(this,e,t,function(i){n.playlistIndex=0,i||fye(n._activeEntries),n.tourEnd.raiseEvent(i)})};UH.prototype.stop=function(){fye(this._activeEntries)};function fye(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function dye(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=yst.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function yst(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,dye.call(this,e,t,n)}}var YF=UH;var Ni=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Ni.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Ni.Bounce.In(e*2)*.5:Ni.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),XF=function(){return performance.now()},xst=function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=XF()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e}(),GS={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=GS.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=GS.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=GS.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=GS.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},hye=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),KY=new xst,mye=function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ni.Linear.None,this._interpolationFunction=GS.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=hye.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=KY,KY.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=XF()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var d=i[s];if(d.length===0)continue;for(var p=[a],g=0,m=d.length;g<m;g+=1){var x=this._handleRelativeValue(a,d[g]);if(isNaN(x)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(x)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var b=a;for(var T in b)n[s][T]=b[T];o[s]=c?[]:{};var d=i[s];if(!this._isDynamic){var C={};for(var T in d)C[T]=d[T];i[s]=d=C}this._setupProperties(b,n[s],d,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=XF()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=XF()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Ni.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=GS.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=XF()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var x=Math.trunc(s/a),b=s-x*a,T=Math.min(b/i._duration,1);return T===0&&s===i._duration?1:T},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,m=this._chainedTweens.length;g<m;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),u=Array.isArray(a),f=!c&&u;f?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var dni=hye.nextId,Zm=KY,hni=Zm.getAll.bind(Zm),mni=Zm.removeAll.bind(Zm),pni=Zm.add.bind(Zm),_ni=Zm.remove.bind(Zm),gni=Zm.update.bind(Zm);var bst={LINEAR_NONE:Ni.Linear.None,QUADRATIC_IN:Ni.Quadratic.In,QUADRATIC_OUT:Ni.Quadratic.Out,QUADRATIC_IN_OUT:Ni.Quadratic.InOut,CUBIC_IN:Ni.Cubic.In,CUBIC_OUT:Ni.Cubic.Out,CUBIC_IN_OUT:Ni.Cubic.InOut,QUARTIC_IN:Ni.Quartic.In,QUARTIC_OUT:Ni.Quartic.Out,QUARTIC_IN_OUT:Ni.Quartic.InOut,QUINTIC_IN:Ni.Quintic.In,QUINTIC_OUT:Ni.Quintic.Out,QUINTIC_IN_OUT:Ni.Quintic.InOut,SINUSOIDAL_IN:Ni.Sinusoidal.In,SINUSOIDAL_OUT:Ni.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Ni.Sinusoidal.InOut,EXPONENTIAL_IN:Ni.Exponential.In,EXPONENTIAL_OUT:Ni.Exponential.Out,EXPONENTIAL_IN_OUT:Ni.Exponential.InOut,CIRCULAR_IN:Ni.Circular.In,CIRCULAR_OUT:Ni.Circular.Out,CIRCULAR_IN_OUT:Ni.Circular.InOut,ELASTIC_IN:Ni.Elastic.In,ELASTIC_OUT:Ni.Elastic.Out,ELASTIC_IN_OUT:Ni.Elastic.InOut,BACK_IN:Ni.Back.In,BACK_OUT:Ni.Back.Out,BACK_IN_OUT:Ni.Back.InOut,BOUNCE_IN:Ni.Bounce.In,BOUNCE_OUT:Ni.Bounce.Out,BOUNCE_IN_OUT:Ni.Bounce.InOut},Kr=Object.freeze(bst);function zH(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}zH.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ae(this.view.position);t.flyToBoundingSphere(o,i)}};zH.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};zH.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Kr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=bt(t,e)),t};var KF=zH;function ZY(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}ZY.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};ZY.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var ZF=ZY;var Sye={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=ox(t),Sye[t]}},iX;typeof DOMParser<"u"&&(iX=new DOMParser);var Tst=new Eye.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),A0=32,pye=2414016,_ye=1,gye=16093e3,yye=.1,xye=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],bye=["http://www.google.com/kml/ext/2.2"],Cst=["http://www.w3.org/2005/Atom"],Re={kml:xye,gx:bye,atom:Cst,kmlgx:xye.concat(bye)},oX={Document:Nye,Folder:zst,Placemark:Hst,NetworkLink:$st,GroundOverlay:Xst,PhotoOverlay:kye,ScreenOverlay:Yst,Tour:Wst};function $m(e){this._dataSource=e,this._deferred=vl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties($m.prototype,{dataSource:{get:function(){return this._dataSource}}});$m.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};$m.prototype.addPromise=function(e){this._promises.push(e)};$m.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};$m.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Zu._getTimestamp()),this._process(e)};$m.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Zu._getTimestamp(),e._process(!0)},0)};$m.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};$m.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};$m.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=oX[i.localName];if(l(o)&&(Re.kml.indexOf(i.namespaceURI)!==-1||Re.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Zu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Ast(e){let t=e.slice(0,Math.min(4,e.size)),n=vl(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function Est(e){let t=vl(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function vye(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function wye(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function Sst(e,t){return Promise.resolve(e.getData(new TH)).then(function(n){n=vye(n),n=wye(n),t.kml=iX.parseFromString(n,"application/xml")})}function $Y(e,t){let n=y(Sye.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new xH(n))).then(function(i){t[e.filename]=i})}function Xu(e,t,n,i){let o=i.keys,r=new $F.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new $F.default(u).absoluteTo(r).toString(),p=o.indexOf(d);if(p!==-1){let g=o[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Ku(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=rX(a,i);l(c)&&s.setAttribute(n,c.url)}}function Dye(e,t,n){let i=Ls(e,"id");i=l(i)&&i.length!==0?i:Hn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Hn(),l(n)&&(i=n+i)),o=t.add(new tr({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new tat),o}function QF(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function jH(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,h.fromDegrees(i,o,r,t)}function HH(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=jH(n[s],t);return o}function E0(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ls(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Fi(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Tye(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Rh(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Qn(e,t,n){let i=Fi(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Pn(e,t,n){let i=Fi(e,t,n);if(l(i))return i.textContent.trim()}function Oh(e,t,n){let i=Fi(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function rX(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new Se({url:o});else{let r=new $F.default(t.getUrlComponent()),s=new $F.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Se({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Jl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function tX(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(Jl.maximumRed=r,Jl.red=void 0):(Jl.maximumRed=void 0,Jl.red=0),o>0?(Jl.maximumGreen=o,Jl.green=void 0):(Jl.maximumGreen=void 0,Jl.green=0),i>0?(Jl.maximumBlue=i,Jl.blue=void 0):(Jl.maximumBlue=void 0,Jl.blue=0),Jl.alpha=n,H.fromRandom(Jl)):new H(r,o,i,n)}function PT(e,t,n){let i=Pn(e,t,n);if(l(i))return tX(i,Pn(e,"colorMode",n)==="random")}function vst(e){let t=Fi(e,"TimeStamp",Re.kmlgx),n=Pn(t,"when",Re.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=Z.fromIso8601(n),o=new jr;return o.addInterval(new An({start:i,stop:He.MAXIMUM_VALUE})),o}function wst(e){let t=Fi(e,"TimeSpan",Re.kmlgx);if(!l(t))return;let n,i=Fi(t,"begin",Re.kmlgx),o=l(i)?Z.fromIso8601(i.textContent):void 0,r=Fi(t,"end",Re.kmlgx),s=l(r)?Z.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(Z.lessThan(s,o)){let a=o;o=s,s=a}n=new jr,n.addInterval(new An({start:o,stop:s}))}else l(o)?(n=new jr,n.addInterval(new An({start:o,stop:He.MAXIMUM_VALUE}))):l(s)&&(n=new jr,n.addInterval(new An({start:He.MINIMUM_VALUE,stop:s})));return n}function Iye(){let e=new sc;return e.width=A0,e.height=A0,e.scaleByDistance=new kt(pye,_ye,gye,yye),e.pixelOffsetScaleByDistance=new kt(pye,_ye,gye,yye),e}function sX(){let e=new Gd;return e.outline=!0,e.outlineColor=H.WHITE,e}function Pye(){let e=new Hd;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=jo.FILL_AND_OUTLINE,e}function aX(e,t,n,i,o){let r=Pn(e,"href",Re.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y(Qn(e,"x",Re.gx),0),u=y(Qn(e,"y",Re.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=rX(r,n,i);if(o){let a=Pn(e,"refreshMode",Re.kml),c=Pn(e,"viewRefreshMode",Re.kml);a==="onInterval"||a==="onExpire"?yt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&yt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(Pn(e,"viewBoundScale",Re.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=y(Pn(e,"viewFormat",Re.kml),f),p=Pn(e,"httpQuery",Re.kml);l(d)&&s.setQueryParameters(fu(WH(d))),l(p)&&s.setQueryParameters(fu(WH(p)));let g=t._ellipsoid;return lX(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function Dst(e,t,n,i,o){let r=Qn(t,"scale",Re.kml),s=Qn(t,"heading",Re.kml),a=PT(t,"color",Re.kml),c=Fi(t,"Icon",Re.kml),u=aX(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=Qn(c,"x",Re.gx),d=Qn(c,"y",Re.gx),p=Qn(c,"w",Re.gx),g=Qn(c,"h",Re.gx),m=Fi(t,"hotSpot",Re.kml),x=E0(m,"x"),b=E0(m,"y"),T=Ls(m,"xunits"),C=Ls(m,"yunits"),A=n.billboard;l(A)||(A=Iye(),n.billboard=A),A.image=u,A.scale=r,A.color=a,(l(f)||l(d)||l(p)||l(g))&&(A.imageSubRegion=new je(f,d,p,g)),l(s)&&s!==0&&(A.rotation=P.toRadians(-s),A.alignedAxis=h.UNIT_Z),r=y(r,1);let E,v;l(x)&&(T==="pixels"?E=-x*r:T==="insetPixels"?E=(x-A0)*r:T==="fraction"&&(E=-x*A0*r),E+=A0*.5*r),l(b)&&(C==="pixels"?v=b*r:C==="insetPixels"?v=(-b+A0)*r:C==="fraction"&&(v=b*A0*r),v-=A0*.5*r),(l(E)||l(v))&&(A.pixelOffset=new z(E,v))}function GH(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")Dst(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=Pye(),n.label=c),c.scale=y(Qn(a,"scale",Re.kml),c.scale),c.fillColor=y(PT(a,"color",Re.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new lc,n.polyline=c),c.width=Qn(a,"width",Re.kml),c.material=PT(a,"color",Re.kml),l(PT(a,"outerColor",Re.gx))&&yt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Qn(a,"outerWidth",Re.gx))&&yt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Qn(a,"physicalWidth",Re.gx))&&yt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Oh(a,"labelVisibility",Re.gx))&&yt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=sX(),n.polygon=c),c.material=y(PT(a,"color",Re.kml),c.material),c.fill=y(Oh(a,"fill",Re.kml),c.fill),c.outline=y(Oh(a,"outline",Re.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y(tX(Pn(a,"bgColor",Re.kml)),H.WHITE),u=y(tX(Pn(a,"textColor",Re.kml)),H.BLACK),f=Pn(a,"text",Re.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Pn(a,"listItemType",Re.kml);(c==="radioFolder"||c==="checkOffOnly")&&yt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function Ist(e,t,n,i,o){let r=new tr,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")GH(e,d,r,i,o);else{let p=Rh(d,"Pair",Re.kml);for(let g=0;g<p.length;g++){let m=p[g],x=Pn(m,"key",Re.kml);if(x==="normal"){let b=Pn(m,"styleUrl",Re.kml);if(l(b))s=n.getById(b),l(s)||(s=n.getById(`#${b}`)),l(s)&&r.merge(s);else{let T=Fi(m,"Style",Re.kml);GH(e,T,r,i,o)}}else yt(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let f=Pn(t,"styleUrl",Re.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&r.merge(s)}return r}function Pst(e,t,n){return t.fetchXML().then(function(i){return Rye(e,i,n,t,!0)})}function Rye(e,t,n,i,o,r){let s,a,c,u,f=Tye(t,"Style",Re.kml);if(l(f)){let x=f.length;for(s=0;s<x;s++)u=f[s],a=Ls(u,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new tr({id:a}),n.add(c),GH(e,u,c,i,r)))}let d=Tye(t,"StyleMap",Re.kml);if(l(d)){let x=d.length;for(s=0;s<x;s++){let b=d[s];if(a=Ls(b,"id"),l(a)){let T=Rh(b,"Pair",Re.kml);for(let C=0;C<T.length;C++){let A=T[C],E=Pn(A,"key",Re.kml);if(E==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Pn(A,"styleUrl",Re.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),o&&l(i)&&(v=i.getUrlComponent()+v);let D=n.getById(v);l(D)&&c.merge(D)}else u=Fi(A,"Style",Re.kml),GH(e,u,c,i,r)}}else yt(`kml-styleMap-${E}`,`KML - Unsupported StyleMap key: ${E}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let x=g[s].textContent;if(x[0]!=="#"){let b=x.split("#");if(b.length===2){let T=b[0],C=i.getDerivedResource({url:T});p.push(Pst(e,C,n))}}}return p}function cX(e,t,n){let i=new q_(e,t.id,["position"]),o=new km(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new lc,t.polyline.positions=new j_([i,o])}function Oye(e,t){return!l(e)&&!l(t)||e==="clampToGround"?Ye.CLAMP_TO_GROUND:e==="relativeToGround"?Ye.RELATIVE_TO_GROUND:e==="absolute"?Ye.NONE:t==="clampToSeaFloor"?(yt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Ye.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(yt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Ye.RELATIVE_TO_GROUND):(l(e)?yt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):yt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Ye.CLAMP_TO_GROUND)}function Rst(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new km(e))}function Ost(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function qH(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():Pye(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():Iye(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(H.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new z(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function Mye(e,t){let n=e.path;l(n)||(n=new Wp,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function Mst(e,t,n,i,o){let r=Pn(n,"coordinates",Re.kml),s=Pn(n,"altitudeMode",Re.kml),a=Pn(n,"altitudeMode",Re.gx),c=Oh(n,"extrude",Re.kml),u=e._ellipsoid,f=jH(r,u);return i.position=f,qH(e,i,o,Oye(s,a)),c&&QF(s,a)&&cX(t,i,o),!0}function Cye(e,t,n,i,o){let r=Fi(n,"coordinates",Re.kml),s=Pn(n,"altitudeMode",Re.kml),a=Pn(n,"altitudeMode",Re.gx),c=Oh(n,"extrude",Re.kml),u=Oh(n,"tessellate",Re.kml),f=QF(s,a),d=Qn(n,"drawOrder",Re.gx),p=e._ellipsoid,g=HH(r,p),m=o.polyline;if(f&&c){let x=new jp;i.wall=x,x.positions=g;let b=o.polygon;l(b)&&(x.fill=b.fill,x.material=b.material),x.outline=!0,l(m)?(x.outlineColor=l(m.material)?m.material.color:H.WHITE,x.outlineWidth=m.width):l(b)&&(x.outlineColor=l(b.material)?b.material.color:H.WHITE)}else if(e._clampToGround&&!f&&u){let x=new lc;x.clampToGround=!0,i.polyline=x,x.positions=g,l(m)?(x.material=l(m.material)?m.material.color.getValue(He.MINIMUM_VALUE):H.WHITE,x.width=y(m.width,1)):(x.material=H.WHITE,x.width=1),x.zIndex=d}else l(d)&&yt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&yt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new lc,i.polyline=m,m.positions=Ost(g,s,a,p),(!u||f)&&(m.arcType=Jt.NONE);return!0}function Lst(e,t,n,i,o){let r=Fi(n,"outerBoundaryIs",Re.kml),s=Fi(r,"LinearRing",Re.kml),a=Fi(s,"coordinates",Re.kml),c=e._ellipsoid,u=HH(a,c),f=Oh(n,"extrude",Re.kml),d=Pn(n,"altitudeMode",Re.kml),p=Pn(n,"altitudeMode",Re.gx),g=QF(d,p),m=l(o.polygon)?o.polygon.clone():sX(),x=o.polyline;if(l(x)&&(m.outlineColor=l(x.material)?x.material.color:H.WHITE,m.outlineWidth=x.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let b=new Ma(u),T=Rh(n,"innerBoundaryIs",Re.kml);for(let C=0;C<T.length;C++){s=Rh(T[C],"LinearRing",Re.kml);for(let A=0;A<s.length;A++)a=Fi(s[A],"coordinates",Re.kml),u=HH(a,c),l(u)&&b.holes.push(new Ma(u))}m.hierarchy=b}return!0}function Nst(e,t,n,i,o){let r=Pn(n,"altitudeMode",Re.kml),s=Pn(n,"altitudeMode",Re.gx),a=Rh(n,"coord",Re.gx),c=Rh(n,"angles",Re.gx),u=Rh(n,"when",Re.kml),f=Oh(n,"extrude",Re.kml),d=QF(r,s),p=e._ellipsoid;c.length>0&&yt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],x=[];for(let T=0;T<g;T++){let C=jH(a[T].textContent,p);m.push(C),x.push(Z.fromIso8601(u[T].textContent))}let b=new _a;return b.addSamples(x,m),i.position=b,qH(e,i,o,Oye(r,s)),Mye(i,o),i.availability=new jr,u.length>0&&i.availability.addInterval(new An({start:x[0],stop:x[x.length-1]})),d&&f&&cX(t,i,o),!0}function Aye(e,t,n,i,o,r,s,a,c){let u=e[0],f=e[e.length-1],d=new _a;d.addSamples(e,t),n.intervals.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:Rst(d,s,a)})),i.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new An({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function Fst(e,t,n,i,o){let r=Oh(n,"interpolate",Re.gx),s=Rh(n,"Track",Re.gx),a,c,u,f=!1,d=new X_,p=new jr,g=new ma,m=e._ellipsoid;for(let x=0,b=s.length;x<b;x++){let T=s[x],C=Rh(T,"when",Re.kml),A=Rh(T,"coord",Re.gx),E=Pn(T,"altitudeMode",Re.kml),v=Pn(T,"altitudeMode",Re.gx),D=QF(E,v),O=Oh(T,"extrude",Re.kml),R=Math.min(A.length,C.length),M=[];a=[];for(let N=0;N<R;N++){let _=jH(A[N].textContent,m);M.push(_),a.push(Z.fromIso8601(C[N].textContent))}r&&(l(c)&&Aye([c,a[0]],[u,M[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=M[M.length-1]),Aye(a,M,g,p,d,D&&O,E,v,!0),f=f||D&&O}return i.availability=p,i.position=g,qH(e,i,o),Mye(i,o),f&&(cX(t,i,o),i.polyline.show=d),!0}var Lye={Point:Mst,LineString:Cye,LinearRing:Cye,Polygon:Lst,Track:Nst,MultiTrack:Fst,MultiGeometry:Bst,Model:kst};function Bst(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=Lye[f.localName];if(l(d)){let p=Dye(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,o)&&(a=!0)}}return a}function kst(e,t,n,i,o){return yt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Vst(e,t){let n=Fi(e,"ExtendedData",Re.kml);if(!l(n))return;l(Fi(n,"SchemaData",Re.kml))&&yt("kml-schemaData","KML - SchemaData is unsupported"),l(Ls(n,"xmlns:prefix"))&&yt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Rh(n,"Data",Re.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Ls(a,"name");l(c)&&(i[c]={displayName:Pn(a,"displayName",Re.kml),value:Pn(a,"value",Re.kml)})}}t.kml.extendedData=i}var go;typeof document<"u"&&(go=document.createElement("div"));function Ust(e,t,n,i,o){let r,s,a,c=t.kml,u=c.extendedData,f=Pn(e,"description",Re.kml),d=y(t.balloonStyle,n.balloonStyle),p=H.WHITE,g=H.BLACK,m=f;l(d)&&(p=y(d.bgColor,H.WHITE),g=y(d.textColor,H.BLACK),m=y(d.text,f));let x;if(l(m)){if(m=m.replace("$[name]",y(t.name,"")),m=m.replace("$[description]",y(f,"")),m=m.replace("$[address]",y(c.address,"")),m=m.replace("$[Snippet]",y(c.snippet,"")),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let C=m.match(/\$\[.+?\]/g);if(C!==null)for(r=0;r<C.length;r++){let A=C[r],E=A.substr(2,A.length-3),v=/\/displayName$/.test(E);E=E.replace(/\/displayName$/,""),x=u[E],l(x)&&(x=v?x.displayName:x.value),l(x)&&(m=m.replace(A,y(x,"")))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],x=u[s],m+=`<tr><th>${y(x.displayName,s)}</th><td>${y(x.value,"")}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=Tst.link(m),go.innerHTML=m;let b=go.querySelectorAll("a");for(r=0;r<b.length;r++)b[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Xu(go,"a","href",i),Xu(go,"link","href",i),Xu(go,"area","href",i),Xu(go,"img","src",i),Xu(go,"iframe","src",i),Xu(go,"video","src",i),Xu(go,"audio","src",i),Xu(go,"source","src",i),Xu(go,"track","src",i),Xu(go,"input","src",i),Xu(go,"embed","src",i),Xu(go,"script","src",i),Xu(go,"video","poster",i)),Ku(go,"a","href",o),Ku(go,"link","href",o),Ku(go,"area","href",o),Ku(go,"img","src",o),Ku(go,"iframe","src",o),Ku(go,"video","src",o),Ku(go,"audio","src",o),Ku(go,"source","src",o),Ku(go,"track","src",o),Ku(go,"input","src",o),Ku(go,"embed","src",o),Ku(go,"script","src",o),Ku(go,"video","poster",o);let T='<div class="cesium-infoBox-description-lighter" style="';T+="overflow:auto;",T+="word-wrap:break-word;",T+=`background-color:${p.toCssColorString()};`,T+=`color:${g.toCssColorString()};`,T+='">',T+=`${go.innerHTML}</div>`,go.innerHTML="",t.description=T}function YH(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=Dye(t,i,n.context),c=a.kml,u=Ist(e,t,n.styleCollection,r,s),f=Pn(t,"name",Re.kml);a.name=f,a.parent=o;let d=wst(t);l(d)||(d=vst(t)),a.availability=d,fX(a);function p(A){return A?A.show&&p(A.parent):!0}let g=Oh(t,"visibility",Re.kml);a.show=p(o)&&y(g,!0);let m=Fi(t,"author",Re.atom),x=c.author;x.name=Pn(m,"name",Re.atom),x.uri=Pn(m,"uri",Re.atom),x.email=Pn(m,"email",Re.atom);let b=Fi(t,"link",Re.atom),T=c.link;T.href=Ls(b,"href"),T.hreflang=Ls(b,"hreflang"),T.rel=Ls(b,"rel"),T.type=Ls(b,"type"),T.title=Ls(b,"title"),T.length=Ls(b,"length"),c.address=Pn(t,"address",Re.kml),c.phoneNumber=Pn(t,"phoneNumber",Re.kml),c.snippet=Pn(t,"Snippet",Re.kml),Vst(t,a),Ust(t,a,u,s,r);let C=e._ellipsoid;return Bye(t,a,C),Fye(t,a,C),l(Fi(t,"Region",Re.kml))&&yt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function Nye(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function zst(e,t,n,i){let o=YH(e,t,n),r=Ge(n);r.parentEntity=o.entity,Nye(e,t,r,i)}function Hst(e,t,n,i){let o=YH(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=Lye[d.localName];l(p)&&(p(e,n.entityCollection,d,r,s,r.id),a=!0)}a||(r.merge(s),qH(e,r,s))}var Gst={FlyTo:qst,Wait:jst,SoundCue:QY,AnimatedUpdate:QY,TourControl:QY};function Wst(e,t,n,i){let o=Pn(t,"name",Re.kml),r=Ls(t,"id"),s=new YF(o,r),a=Fi(t,"Playlist",Re.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=Gst[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function QY(e,t){yt(`KML Tour unsupported node ${t.localName}`)}function jst(e,t){let n=Qn(t,"duration",Re.gx);e.addPlaylistEntry(new ZF(n))}function qst(e,t,n){let i=Qn(t,"duration",Re.gx),o=Pn(t,"flyToMode",Re.gx),r={kml:{}};Bye(t,r,n),Fye(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new KF(i,o,s);e.addPlaylistEntry(a)}function Fye(e,t,n){let i=Fi(e,"Camera",Re.kml);if(l(i)){let o=y(Qn(i,"longitude",Re.kml),0),r=y(Qn(i,"latitude",Re.kml),0),s=y(Qn(i,"altitude",Re.kml),0),a=y(Qn(i,"heading",Re.kml),0),c=y(Qn(i,"tilt",Re.kml),0),u=y(Qn(i,"roll",Re.kml),0),f=h.fromDegrees(o,r,s,n),d=va.fromDegrees(a,c-90,u);t.kml.camera=new wF(f,d)}}function Bye(e,t,n){let i=Fi(e,"LookAt",Re.kml);if(l(i)){let o=y(Qn(i,"longitude",Re.kml),0),r=y(Qn(i,"latitude",Re.kml),0),s=y(Qn(i,"altitude",Re.kml),0),a=Qn(i,"heading",Re.kml),c=Qn(i,"tilt",Re.kml),u=y(Qn(i,"range",Re.kml),0);c=P.toRadians(y(c,0)),a=P.toRadians(y(a,0));let f=new ld(a,c-P.PI_OVER_TWO,u),d=h.fromDegrees(o,r,s,n);t.kml.lookAt=new qF(d,f)}}function Yst(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Fi(t,"Icon",Re.kml),c=aX(a,e,r,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=Fi(t,"screenXY",Re.kml),p=Fi(t,"overlayXY",Re.kml),g=Fi(t,"size",Re.kml),m,x,b,T,C,A;l(g)&&(m=E0(g,"x"),x=E0(g,"y"),b=Ls(g,"xunits"),T=Ls(g,"yunits"),l(m)&&m!==-1&&m!==0&&(b==="fraction"?C=`width: ${Math.floor(m*100)}%`:b==="pixels"&&(C=`width: ${m}px`),f.push(C)),l(x)&&x!==-1&&x!==0&&(T==="fraction"?A=`height: ${Math.floor(x*100)}%`:T==="pixels"&&(A=`height: ${x}px`),f.push(A))),u.style=f.join(";");let E=0,v=u.height;l(p)&&(m=E0(p,"x"),x=E0(p,"y"),b=Ls(p,"xunits"),T=Ls(p,"yunits"),l(m)&&(b==="fraction"?E=m*u.width:(b==="pixels"||b==="insetPixels")&&(E=m)),l(x)&&(T==="fraction"?v=x*u.height:(T==="pixels"||T==="insetPixels")&&(v=x))),l(d)&&(m=E0(d,"x"),x=E0(d,"y"),b=Ls(d,"xunits"),T=Ls(d,"yunits"),l(m)&&(b==="fraction"?C=`left: calc(${Math.floor(m*100)}% - ${E}px)`:b==="pixels"?C=`left: ${m-E}px`:b==="insetPixels"&&(C=`right: ${m-E}px`),f.push(C)),l(x)&&(T==="fraction"?A=`bottom: calc(${Math.floor(x*100)}% - ${v}px)`:T==="pixels"?A=`bottom: ${x-v}px`:T==="insetPixels"&&(A=`top: ${x-v}px`),f.push(A))),u.style=f.join(";")},o.appendChild(u)}function Xst(e,t,n,i){let r=YH(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=HH(Fi(t,"LatLonQuad",Re.gx),c),f=Qn(t,"drawOrder",Re.kml);if(l(u))s=sX(),s.hierarchy=new Ma(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new Wd,s.zIndex=f,r.rectangle=s;let m=Fi(t,"LatLonBox",Re.kml);if(l(m)){let x=Qn(m,"west",Re.kml),b=Qn(m,"south",Re.kml),T=Qn(m,"east",Re.kml),C=Qn(m,"north",Re.kml);l(x)&&(x=P.negativePiToPi(P.toRadians(x))),l(b)&&(b=P.clampToLatitudeRange(P.toRadians(b))),l(T)&&(T=P.negativePiToPi(P.toRadians(T))),l(C)&&(C=P.clampToLatitudeRange(P.toRadians(C))),s.coordinates=new se(x,b,T,C);let A=Qn(m,"rotation",Re.kml);if(l(A)){let E=P.toRadians(A);s.rotation=E,s.stRotation=E}}}let d=Fi(t,"Icon",Re.kml),p=aX(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&yt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=Qn(d,"x",Re.gx),x=Qn(d,"y",Re.gx),b=Qn(d,"w",Re.gx),T=Qn(d,"h",Re.gx);(l(m)||l(x)||l(b)||l(T))&&yt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=PT(t,"color",Re.kml),s.material.transparent=!0}else s.material=PT(t,"color",Re.kml);let g=Pn(t,"altitudeMode",Re.kml);l(g)?g==="absolute"?(s.height=Qn(t,"altitude",Re.kml),s.zIndex=void 0):g!=="clampToGround"&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Pn(t,"altitudeMode",Re.gx),g==="relativeToSeaFloor"?(yt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Qn(t,"altitude",Re.kml),s.zIndex=void 0):g==="clampToSeaFloor"?yt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function kye(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),yt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var S0={INTERVAL:0,EXPIRE:1,STOP:2};function WH(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Kst=new se,WS=new fe,JY=new z,Zst=new h;function lX(e,t,n,i,o,r){function s(u){return u<-P.PI_OVER_TWO?-P.PI_OVER_TWO:u>P.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=ax(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(o=y(o,Kst),l(n)&&(JY.x=n.clientWidth*.5,JY.y=n.clientHeight*.5,u=t.pickEllipsoid(JY,r,Zst)),l(u)?f=r.cartesianToCartographic(u,WS):(f=se.center(o,WS),u=r.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let T=o.width*i*.5,C=o.height*i*.5;o=new se(a(f.longitude-T),s(f.latitude-C),a(f.longitude+T),s(f.latitude+C))}c=c.replace("[bboxWest]",P.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(o.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,WS),c=c.replace("[cameraLon]",P.toDegrees(WS.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(WS.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(WS.height).toString());let g=t.frustum,m=g.aspectRatio,x="",b="";if(l(m)){let T=P.toDegrees(g.fov);m>1?(x=T,b=T/m):(b=T,x=T*m)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",b.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(fu(c))}function $st(e,t,n,i){let r=YH(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Fi(t,"Link",Re.kml);if(l(c)||(c=Fi(t,"Url",Re.kml)),l(c)){let u=Pn(c,"href",Re.kml),f,d;if(l(u)){let p=u;if(u=rX(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Pn(c,"viewRefreshMode",Re.kml),f==="onRegion"){yt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=y(Pn(c,"viewBoundScale",Re.kml),1);let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",T=y(Pn(c,"viewFormat",Re.kml),b),C=Pn(c,"httpQuery",Re.kml);l(T)&&u.setQueryParameters(fu(WH(T))),l(C)&&u.setQueryParameters(fu(WH(C)));let A=e._ellipsoid;lX(u,e.camera,e.canvas,d,e._lastCameraView.bbox,A)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new $s,x=uX(e,m,u,g).then(function(b){let T=e._entityCollection,C=m.values;T.suspendEvents();for(let v=0;v<C.length;v++){let D=C[v];l(D.parent)||(D.parent=r,fX(D)),T.add(D)}T.resumeEvents();let A=Pn(c,"refreshMode",Re.kml),E=y(Qn(c,"refreshInterval",Re.kml),0);if(A==="onInterval"&&E>0||A==="onExpire"||f==="onStop"){let v=Fi(b,"NetworkLinkControl",Re.kml),D=l(v),O=Z.now(),R={id:Hn(),href:u,cookie:{},lastUpdated:O,updating:!1,entity:r,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:O},M=0;if(D&&(R.cookie=fu(y(Pn(v,"cookie",Re.kml),"")),M=y(Qn(v,"minRefreshPeriod",Re.kml),0)),A==="onInterval")D&&(E=Math.max(M,E)),R.refreshMode=S0.INTERVAL,R.time=E;else if(A==="onExpire"){let N;if(D&&(N=Pn(v,"expires",Re.kml)),l(N))try{let _=Z.fromIso8601(N),S=Z.secondsDifference(_,O);S>0&&S<M&&Z.addSeconds(O,M,_),R.refreshMode=S0.EXPIRE,R.time=_}catch{yt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else yt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=S0.STOP,R.time=y(Qn(c,"viewRefreshTime",Re.kml),0)):yt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(b){yt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,b)});i.addPromise(x)}}}function Qst(e,t,n,i){let o=oX[t.localName];return l(o)?o(e,t,n,i):kye(e,t,n,i)}function nX(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Fi(a,"Document",Re.kml),u=Pn(c,"name",Re.kml);l(u)||(u=G_(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Zu._DeferredLoading(e),d=new $s(e);return Promise.all(Rye(e,n,d,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let x=0;x<m.length;x++){let b=m[x];if(l(oX[b.localName])){p=b;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),Qst(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function Jst(e,t,n,i,o){let r=nn("ThirdParty/Workers/z-worker-pako.js");NS({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new NH(new ag(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],u={},f;for(let d=0;d<a.length;d++){let p=a[d];p.directory||(/\.kml$/i.test(p.filename)&&(!l(f)||!/\//i.test(p.filename))?(l(f)&&c.push($Y(f,u)),f=p):c.push($Y(p,u)))}return l(f)&&c.push(Sst(f,u)),Promise.all(c).then(function(){if(s.close(),!l(u.kml))throw new re("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),nX(e,t,u.kml,i,u,o)})})}function uX(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Se){n=Se.createIfNeeded(n),c=n.fetchBlob(),o=y(o,n.clone());let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else o=y(o,Se.DEFAULT.clone());return o=Se.createIfNeeded(o),l(a)&&(a=In(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?Ast(u).then(function(f){return f?Jst(e,t,u,o,a):Est(u).then(function(d){d=vye(d),d=wye(d);let p,g;try{p=iX.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new re(m)}return nX(e,t,p,o,r,a,s)})}):nX(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function Zu(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new me,this._error=new me,this._loading=new me,this._refresh=new me,this._unsupportedNode=new me,this._clock=void 0,this._entityCollection=new $s(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new ng,this._networkLinks=new St,this._entityCluster=new Fu,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?h.clone(t.positionWC):void 0,direction:l(t)?h.clone(t.directionWC):void 0,up:l(t)?h.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():se.clone(se.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,ee.default);let i=e.credit;typeof i=="string"&&(i=new Tt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Zu.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new Zu(t).load(e,t)};Object.defineProperties(Zu.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Zu.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),qr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return uX(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Z.equals(s,He.MINIMUM_VALUE),u=Z.equals(a,He.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=Z.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=Z.fromDate(d)),o=new bh,o.startTime=s,o.stopTime=a,o.currentTime=Z.clone(s),o.clockRange=Yr.LOOP_STOP,o.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),qr.setLoading(i,!1),i}).catch(function(o){return qr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Zu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function fX(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function eat(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Fi(r,"NetworkLinkControl",Re.kml),c=l(a),u=0;if(c){if(l(Fi(a,"Update",Re.kml))){yt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=fu(y(Pn(a,"cookie",Re.kml),"")),u=y(Qn(a,"minRefreshPeriod",Re.kml),0)}let f=Z.now(),d=t.refreshMode;if(d===S0.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===S0.EXPIRE){let O;if(l(a)&&(O=Pn(a,"expires",Re.kml)),l(O))try{let R=Z.fromIso8601(O),M=Z.secondsDifference(R,f);M>0&&M<u&&Z.addSeconds(f,u,R),t.time=R}catch{yt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else yt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function x(O){g.remove(O);let R=O._children,M=R.length;for(let N=0;N<M;++N)x(R[N])}g.suspendEvents();let b=g.values.slice(),T;for(T=0;T<b.length;++T){let O=b[T];O.parent===p&&(O.parent=void 0,x(O))}for(g.resumeEvents(),g.suspendEvents(),T=0;T<m.length;T++){let O=m[T];l(O.parent)||(O.parent=p,fX(O)),g.add(O)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let C=g.computeAvailability(),A=C.start,E=C.stop,v=Z.equals(A,He.MINIMUM_VALUE),D=Z.equals(E,He.MAXIMUM_VALUE);if(!v||!D){let O=e._clock;(O.startTime!==A||O.stopTime!==E)&&(O.startTime=A,O.stopTime=E,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var eX=new St;Zu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=Z.now(),i=this;eX.removeAll();function o(f){let d=f._children,p=d.length;for(let g=0;g<p;++g){let m=d[g];eX.set(m.id,m),o(m)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,P.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,P.EPSILON7)&&a.upWC.equalsEpsilon(s.up,P.EPSILON7))&&(s.position=h.clone(a.positionWC),s.direction=h.clone(a.directionWC),s.up=h.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new St,u=!1;return t.values.forEach(function(f){let d=f.entity;if(!eX.contains(d.id)){if(!f.updating){let p=!1;if(f.refreshMode===S0.INTERVAL?Z.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===S0.EXPIRE?Z.greaterThan(n,f.time)&&(p=!0):f.refreshMode===S0.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&Z.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(d),f.updating=!0;let g=new $s,m=f.href.clone();m.setQueryParameters(f.cookie);let x=y(i._ellipsoid,ee.default);lX(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,x),uX(i,g,m,{context:d.id}).then(eat(i,f,g,c,m)).catch(function(b){let T=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(T),i._error.raiseEvent(i,T)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function tat(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}Zu._DeferredLoading=$m;Zu._getTimestamp=bi;var JF=Zu;function e2(){he.throwInstantiationError()}e2.prototype.update=he.throwInstantiationError;e2.prototype.getBoundingSphere=he.throwInstantiationError;e2.prototype.isDestroyed=he.throwInstantiationError;e2.prototype.destroy=he.throwInstantiationError;var dX=e2;var hX=32,nat="http://www.opengis.net/kml/2.2",Lh="http://www.google.com/kml/ext/2.2",iat="http://www.w3.org/2000/xmlns/";function XH(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var oat=/^data:image\/([^,;]+)/;XH.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Se){if(e=Se.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(oat);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function rat(e,t){return function(n){e._files[t]=n}}XH.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new re("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(rat(this,r))}return o};Object.defineProperties(XH.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function KH(e){this._time=e}KH.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};KH.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return OT(n)};KH.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function mX(){this._ids={},this._styles={},this._count=0}mX.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};mX.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function zye(){this._ids={}}zye.prototype.get=function(e){if(!l(e))return this.get(Hn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function pX(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=pX._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(iat,"xmlns:gx",Lh);let a=r.createElement("Document");s.appendChild(a),Gye(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?sat(f,c.files):{kml:f,externalFiles:c.files}})}function sat(e,t){let n=nn("ThirdParty/Workers/z-worker-pako.js");NS({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new UF,o=new kH(i);return o.add("doc.kml",new bH(e)).then(function(){let r=Object.keys(t);return Hye(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function Hye(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new ag(n[o])).then(function(){return Hye(e,t,n,i+1)})}pX._createState=function(e){let t=e.entities,n=new mX,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===He.MINIMUM_VALUE?r.stop===He.MAXIMUM_VALUE?r=new An:Z.addSeconds(r.stop,-10*s,r.start):r.stop===He.MAXIMUM_VALUE&&Z.addSeconds(r.start,10*s,r.stop);let a=new XH(e.modelCallback);return{kmlDoc:document.implementation.createDocument(nat,"kml"),ellipsoid:y(e.ellipsoid,ee.default),idManager:new zye,styleCache:n,externalFileHandler:a,time:o,valueGetter:new KH(o),sampleDuration:s,defaultAvailability:new jr([r])}};function Gye(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],aat(e,p,u,f),cat(e,p.polyline,u,f),Uye(e,p.rectangle,u,f,c),Uye(e,p.polygon,u,f,c),dat(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),Z.equals(m.start,He.MINIMUM_VALUE)||g.appendChild(dn(i,"begin",Z.toIso8601(m.start))),Z.equals(m.stop,He.MAXIMUM_VALUE)||g.appendChild(dn(i,"end",Z.toIso8601(m.stop))));for(let T=0;T<c.length;++T){let C=c[T];C.setAttribute("id",s.get(p.id)),C.appendChild(dn(i,"name",p.name)),C.appendChild(dn(i,"visibility",p.show)),C.appendChild(dn(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C)}let x=u.length;if(x>0){let T=i.createElement("Placemark");T.setAttribute("id",s.get(p.id));let C=p.name,A=p.label;if(l(A)){let v=i.createElement("LabelStyle"),D=r.get(A.text);C=l(D)&&D.length>0?D:C;let O=r.getColor(A.fillColor);l(O)&&(v.appendChild(dn(i,"color",O)),v.appendChild(dn(i,"colorMode","normal")));let R=r.get(A.scale);l(R)&&v.appendChild(dn(i,"scale",R)),f.push(v)}T.appendChild(dn(i,"name",C)),T.appendChild(dn(i,"visibility",p.show)),T.appendChild(dn(i,"description",p.description)),l(g)&&T.appendChild(g),t.appendChild(T);let E=f.length;if(E>0){let v=i.createElement("Style");for(let D=0;D<E;++D)v.appendChild(f[D]);T.appendChild(dn(i,"styleUrl",o.get(v)))}if(u.length===1)T.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let D=0;D<x;++D)v.appendChild(u[D]);T.appendChild(v)}}let b=p._children;if(b.length>0){let T=i.createElement("Folder");T.setAttribute("id",s.get(p.id)),T.appendChild(dn(i,"name",p.name)),T.appendChild(dn(i,"visibility",p.show)),T.appendChild(dn(i,"description",p.description)),t.appendChild(T),Gye(e,T,b)}}}var eu=new h,hl=new fe,Mh=new Z;function aat(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){Wye(e,t,a,n,i);return}s.get(c,void 0,eu);let u=dn(o,"coordinates",RT(eu,r)),f=o.createElement("Point"),d=o.createElement("altitudeMode");d.appendChild(MT(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof sc?qye(e,a):jye(e,a);i.push(p)}function Wye(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof ma?(c=u.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let d=n instanceof Gp,p,g,m,x=[];for(p=0;p<c.length;++p){let T=c.get(p),C=f?u:T.data,A=r.createElement("altitudeMode");C instanceof km?(C=C._value,A.appendChild(MT(e,Ye.CLAMP_TO_GROUND))):l(n)?A.appendChild(MT(e,n.heightReference)):A.appendChild(MT(e,Ye.NONE));let E=[],v=[];if(C.isConstant){a.get(C,void 0,eu);let O=dn(r,"coordinates",RT(eu,s));E.push(Z.toIso8601(T.start)),v.push(O),E.push(Z.toIso8601(T.stop)),v.push(O)}else if(C instanceof _a)for(m=C._property._times,g=0;g<m.length;++g)E.push(Z.toIso8601(m[g])),C.getValueInReferenceFrame(m[g],Ui.FIXED,eu),v.push(RT(eu,s));else if(C instanceof Uu){m=C._times;let O=C._values;for(g=0;g<m.length;++g)E.push(Z.toIso8601(m[g])),h.fromArray(O,g*3,eu),v.push(RT(eu,s))}else{let O=e.sampleDuration;T.start.clone(Mh),T.isStartIncluded||Z.addSeconds(Mh,O,Mh);let R=T.stop;for(;Z.lessThan(Mh,R);)C.getValue(Mh,eu),E.push(Z.toIso8601(Mh)),v.push(RT(eu,s)),Z.addSeconds(Mh,O,Mh);T.isStopIncluded&&Z.equals(Mh,R)&&(C.getValue(Mh,eu),E.push(Z.toIso8601(Mh)),v.push(RT(eu,s)))}let D=r.createElementNS(Lh,"Track");D.appendChild(A);for(let O=0;O<E.length;++O){let R=dn(r,"when",E[O]),M=dn(r,"coord",v[O],Lh);D.appendChild(R),D.appendChild(M)}d&&D.appendChild(Yye(e,n)),x.push(D)}if(x.length===1)i.push(x[0]);else if(x.length>1){let T=r.createElementNS(Lh,"MultiTrack");for(p=0;p<x.length;++p)T.appendChild(x[p]);i.push(T)}if(l(n)&&!d){let T=n instanceof sc?qye(e,n):jye(e,n);o.push(T)}let b=t.path;if(l(b)){let T=a.get(b.width),C=b.material;if(l(C)||l(T)){let A=r.createElement("LineStyle");l(T)&&A.appendChild(dn(r,"width",T)),_X(e,C,A),o.push(A)}}}function jye(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(dn(n,"color",r)),o.appendChild(dn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(dn(n,"scale",s/hX)),o}function qye(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(dn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(dn(n,"x",g.x,Lh)),p.appendChild(dn(n,"y",g.y,Lh)),p.appendChild(dn(n,"w",g.width,Lh)),p.appendChild(dn(n,"h",g.height,Lh))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(dn(n,"color",a)),r.appendChild(dn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(dn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=y(c,1),z.divideByScalar(u,c,u);let p=i.get(t.width,hX),g=i.get(t.height,hX),m=i.get(t.horizontalOrigin,gi.CENTER);m===gi.CENTER?u.x-=p*.5:m===gi.RIGHT&&(u.x-=p);let x=i.get(t.verticalOrigin,Rn.CENTER);x===Rn.TOP?u.y+=g:x===Rn.CENTER&&(u.y+=g*.5);let b=n.createElement("hotSpot");b.setAttribute("x",-u.x),b.setAttribute("y",u.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),r.appendChild(b)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=P.toDegrees(-f),f===0&&(f=360),r.appendChild(dn(n,"heading",f))),r}function cat(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(dn(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=dn(o,"coordinates",RT(p,r));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(dn(o,"drawOrder",m,Lh)),n.push(a);let x=o.createElement("LineStyle"),b=s.get(t.width);l(b)&&x.appendChild(dn(o,"width",b)),_X(e,t.material,x),i.push(x)}function lat(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],u=[se.northeast,se.southeast,se.southwest,se.northwest];for(let g=0;g<4;++g)u[g](a,hl),c.push(`${P.toDegrees(hl.longitude)},${P.toDegrees(hl.latitude)},${r}`);let f=dn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function Vye(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)fe.fromCartesian(t[f],r,hl),s.push(`${P.toDegrees(hl.longitude)},${P.toDegrees(hl.latitude)},${i?hl.height:n}`);let c=dn(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function uat(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(Vye(e,f,r,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let x=i.createElement("innerBoundaryIs");x.appendChild(Vye(e,p[m].positions,r,s)),a.push(x)}}return a}function Uye(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Wd;if(a&&s.getMaterialType(t.material)==="Image"){fat(e,t,o);return}let c=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(dn(r,"extrude",!0));let f=a?lat(e,t,u):uat(e,t,u),d=f.length;for(let b=0;b<d;++b)c.appendChild(f[b]);let p=r.createElement("altitudeMode");p.appendChild(MT(e,t.heightReference)),c.appendChild(p),n.push(c);let g=r.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(dn(r,"fill",m)),_X(e,t.material,g);let x=s.get(t.outline,!1);if(x){g.appendChild(dn(r,"outline",x));let b=r.createElement("LineStyle"),T=s.get(t.outlineWidth,1);b.appendChild(dn(r,"width",T));let C=s.getColor(t.outlineColor,H.BLACK);b.appendChild(dn(r,"color",C)),b.appendChild(dn(r,"colorMode","normal")),i.push(b)}i.push(g)}function fat(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(MT(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(dn(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(dn(i,"north",P.toDegrees(u.north))),f.appendChild(dn(i,"south",P.toDegrees(u.south))),f.appendChild(dn(i,"east",P.toDegrees(u.east))),f.appendChild(dn(i,"west",P.toDegrees(u.west))),s.appendChild(f);let d=o.get(t.material),p=r.texture(d.image),g=i.createElement("Icon");g.appendChild(dn(i,"href",p)),s.appendChild(g);let m=d.color;l(m)&&s.appendChild(dn(i,"color",OT(d.color))),n.push(s)}function Yye(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(dn(n,"x",s)),u.appendChild(dn(n,"y",s)),u.appendChild(dn(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(dn(n,"href",c)),r.appendChild(a),r}function dat(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){Wye(e,t,n,i,o);return}let u=Yye(e,n),f=r.createElement("altitudeMode");f.appendChild(MT(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,eu),fe.fromCartesian(eu,s,hl);let d=r.createElement("Location");d.appendChild(dn(r,"longitude",P.toDegrees(hl.longitude))),d.appendChild(dn(r,"latitude",P.toDegrees(hl.latitude))),d.appendChild(dn(r,"altitude",hl.height)),u.appendChild(d),i.push(u)}function _X(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,u;switch(a){case"Image":s=OT(H.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=OT(r.color);break;case"PolylineOutline":s=OT(r.color),c=OT(r.outlineColor),u=r.outlineWidth,n.appendChild(dn(i,"outerColor",c,Lh)),n.appendChild(dn(i,"outerWidth",u,Lh));break;case"Stripe":s=OT(r.oddColor);break}l(s)&&(n.appendChild(dn(i,"color",s)),n.appendChild(dn(i,"colorMode","normal")))}function MT(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,Ye.NONE),r;switch(o){case Ye.NONE:r=n.createTextNode("absolute");break;case Ye.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case Ye.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function RT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)fe.fromCartesian(e[o],t,hl),i.push(`${P.toDegrees(hl.longitude)},${P.toDegrees(hl.latitude)},${hl.height}`);return i.join(" ")}function dn(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function OT(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var gX=pX;function hat(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=` -${o}`),t}var Qm=hat;async function mat(e,t,n,i){return l(i)||(i=!1),gat(e,t,n,i)}function pat(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(Kye(i)):r=o.then(Kye(i)).catch(yat(i)),e.shift(),t.push(r),!0}function _at(e){return new Promise(function(t){setTimeout(t,e)})}function yX(e,t,n){return e.length?pat(e,t,n)?yX(e,t,n):_at(100).then(()=>yX(e,t,n)):Promise.resolve()}function gat(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[f]=d,s.push(d)}a[f].positions.push(n[r])}let c=[];return yX(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Xye(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function Kye(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!Xye(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];Xye(s,i,n)}}):Promise.resolve()}}function yat(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var t2=mat;var xX=new z;async function Zye(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=r.computeMaximumLevelAtPosition(u);if(o[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,xX);let p=e.loadTileDataAvailability(xX.x,xX.y,1);l(p)&&s.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return t2(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];r.computeMaximumLevelAtPosition(u)!==o[c]&&a.push(u)}return a.length>0&&await Zye(e,a,n),t}var LT=Zye;async function bX(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return r;let c=[se.center(e),se.southeast(e),se.southwest(e),se.northeast(e),se.northwest(e)],u=await bX._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,m){return l(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=r;return f&&(p.height+=d),p}bX._sampleTerrainMostDetailed=LT;var NT=bX;var xat={NONE:0,LERC:1},dd=Object.freeze(xat);var bat={NONE:0,BITS12:1},Js=Object.freeze(bat);var FT=new h,Tat=new h,hd=new z,ZH=new F,Cat=new F,Aat=Math.pow(2,12);function vc(e,t,n,i,o,r,s,a,c,u){let f=Js.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,m=t.maximum,x=h.subtract(m,g,Tat),b=i-n;Math.max(h.maximumComponent(x),b)<Aat-1?f=Js.BITS12:f=Js.NONE,d=F.inverseTransformation(o,new F);let C=h.negate(g,FT);F.multiply(F.fromTranslation(C,ZH),d,d);let A=FT;A.x=1/x.x,A.y=1/x.y,A.z=1/x.z,F.multiply(F.fromScale(A,ZH),d,d),p=F.clone(o),F.setTranslation(p,h.ZERO,p),o=F.clone(o,new F);let E=F.fromTranslation(g,ZH),v=F.fromScale(x,Cat),D=F.multiply(E,v,ZH);F.multiply(o,D,o),F.multiply(p,D,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(u,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}vc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,u=i.y;if(this.quantization===Js.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,FT),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=P.clamp((o-this.minimumHeight)/f,0,1);z.fromElements(n.x,n.y,hd);let p=Mn.compressTextureCoordinates(hd);z.fromElements(n.z,d,hd);let g=Mn.compressTextureCoordinates(hd);z.fromElements(c,u,hd);let m=Mn.compressTextureCoordinates(hd);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){z.fromElements(s,0,hd);let x=Mn.compressTextureCoordinates(hd);e[t++]=x}}else h.subtract(n,this.center,FT),e[t++]=FT.x,e[t++]=FT.y,e[t++]=FT.z,e[t++]=o,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Mn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Eat=new h,$ye=new h;vc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*r+f;t[p]=e[d]}let a=this.decodePosition(t,s,Eat),c=n.geodeticSurfaceNormal(a,$ye),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};vc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};vc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Js.BITS12){let i=Mn.decompressTextureCoordinates(e[t],hd);n.x=i.x,n.y=i.y;let o=Mn.decompressTextureCoordinates(e[t+1],hd);return n.z=o.x,F.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};vc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,$ye),a=this.decodeHeight(e,t),c=Er.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};vc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new z),t*=this.stride,this.quantization===Js.BITS12?Mn.decompressTextureCoordinates(e[t+2],n):z.fromElements(e[t+4],e[t+5],n)};vc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Js.BITS12?Mn.decompressTextureCoordinates(e[t+1],hd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};vc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Js.BITS12?Mn.decompressTextureCoordinates(e[t+3],hd).x:e[t+6]};vc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return z.fromElements(o,r,n)};vc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};vc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Js.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var $H={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},QH={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};vc.prototype.getAttributes=function(e){let t=X.FLOAT,n=X.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===Js.NONE){s($H.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s($H.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s($H.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(QH.compressed0,a?4:3),c&&s(QH.compressed1,1),this.hasGeodeticSurfaceNormals&&s(QH.geodeticSurfaceNormal,3)}return r};vc.prototype.getAttributeLocations=function(){return this.quantization===Js.NONE?$H:QH};vc.clone=function(e,t){if(l(e))return l(t)||(t=new vc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var wc=vc;var Jm={};Jm.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var TX=new h,Sat=new F,vat=new h,wat=new h;Jm.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=y(e.isGeographic,!0),m=y(e.ellipsoid,ee.default),x=1/m.maximumRadius,b=se.clone(e.nativeRectangle),T=se.clone(e.rectangle),C,A,E,v;l(T)?(C=T.west,A=T.south,E=T.east,v=T.north):g?(C=a(b.west),A=a(b.south),E=a(b.east),v=a(b.north)):(C=b.west*x,A=s-2*o(r(-b.south*x)),E=b.east*x,v=s-2*o(r(-b.north*x)));let D=e.relativeToCenter,O=l(D);D=O?D:h.ZERO;let R=y(e.includeWebMercatorT,!1),M=y(e.exaggeration,1),N=y(e.exaggerationRelativeHeight,0),S=M!==1,w=y(e.structure,Jm.DEFAULT_STRUCTURE),I=y(w.heightScale,Jm.DEFAULT_STRUCTURE.heightScale),L=y(w.heightOffset,Jm.DEFAULT_STRUCTURE.heightOffset),B=y(w.elementsPerHeight,Jm.DEFAULT_STRUCTURE.elementsPerHeight),U=y(w.stride,Jm.DEFAULT_STRUCTURE.stride),V=y(w.elementMultiplier,Jm.DEFAULT_STRUCTURE.elementMultiplier),G=y(w.isBigEndian,Jm.DEFAULT_STRUCTURE.isBigEndian),k=se.computeWidth(b),W=se.computeHeight(b),j=k/(u-1),J=W/(f-1);g||(k*=x,W*=x);let q=m.radiiSquared,K=q.x,Q=q.y,de=q.z,ye=65536,ce=-65536,_e=Mt.eastNorthUpToFixedFrame(D,m),xe=F.inverseTransformation(_e,Sat),De,Ae;R&&(De=Pi.geodeticLatitudeToMercatorAngle(A),Ae=1/(Pi.geodeticLatitudeToMercatorAngle(v)-De));let ke=vat;ke.x=Number.POSITIVE_INFINITY,ke.y=Number.POSITIVE_INFINITY,ke.z=Number.POSITIVE_INFINITY;let ze=wat;ze.x=Number.NEGATIVE_INFINITY,ze.y=Number.NEGATIVE_INFINITY,ze.z=Number.NEGATIVE_INFINITY;let tt=Number.POSITIVE_INFINITY,wt=u*f,_t=d>0?u*2+f*2:0,Be=wt+_t,Yt=new Array(Be),Et=new Array(Be),ut=new Array(Be),tn=R?new Array(Be):[],Ce=S?new Array(Be):[],Te=0,it=f,ji=0,ft=u;p&&(--Te,++it,--ji,++ft);let yo=1e-5;for(let Xe=Te;Xe<it;++Xe){let ht=Xe;ht<0&&(ht=0),ht>=f&&(ht=f-1);let Gt=b.north-J*ht;g?Gt=a(Gt):Gt=s-2*o(r(-Gt*x));let Tn=(Gt-A)/(v-A);Tn=P.clamp(Tn,0,1);let Ro=Xe===Te,Ao=Xe===it-1;d>0&&(Ro?Gt+=yo*W:Ao&&(Gt-=yo*W));let Ka=t(Gt),Za=n(Gt),Ci=de*Za,mi;R&&(mi=(Pi.geodeticLatitudeToMercatorAngle(Gt)-De)*Ae);for(let ra=ji;ra<ft;++ra){let Zr=ra;Zr<0&&(Zr=0),Zr>=u&&(Zr=u-1);let Cl=ht*(u*U)+Zr*U,xo;if(B===1)xo=c[Cl];else{xo=0;let Uo;if(G)for(Uo=0;Uo<B;++Uo)xo=xo*V+c[Cl+Uo];else for(Uo=B-1;Uo>=0;--Uo)xo=xo*V+c[Cl+Uo]}xo=xo*I+L,ce=Math.max(ce,xo),ye=Math.min(ye,xo);let Or=b.west+j*Zr;g?Or=a(Or):Or=Or*x;let xp=(Or-C)/(E-C);xp=P.clamp(xp,0,1);let $r=ht*u+Zr;if(d>0){let Uo=ra===ji,ln=ra===ft-1,Ee=Ro||Ao||Uo||ln;if((Ro||Ao)&&(Uo||ln))continue;Ee&&(xo-=d,Uo?($r=wt+(f-ht-1),Or-=yo*k):Ao?$r=wt+f+(u-Zr-1):ln?($r=wt+f+u+ht,Or+=yo*k):Ro&&($r=wt+f+u+f+Zr))}let mf=Ka*t(Or),$a=Ka*n(Or),ex=K*mf,Ea=Q*$a,Nc=1/i(ex*mf+Ea*$a+Ci*Za),fs=ex*Nc,pf=Ea*Nc,_f=Ci*Nc,gf=new h;gf.x=fs+mf*xo,gf.y=pf+$a*xo,gf.z=_f+Za*xo,F.multiplyByPoint(xe,gf,TX),h.minimumByComponent(TX,ke,ke),h.maximumByComponent(TX,ze,ze),tt=Math.min(tt,xo),Yt[$r]=gf,ut[$r]=new z(xp,Tn),Et[$r]=xo,R&&(tn[$r]=mi),S&&(Ce[$r]=m.geodeticSurfaceNormal(gf))}}let Xo=ae.fromPoints(Yt),Xa;l(T)&&(Xa=vn.fromRectangle(T,ye,ce,m));let Rr;O&&(Rr=new z_(m).computeHorizonCullingPointPossiblyUnderEllipsoid(D,Yt,ye));let As=new $g(ke,ze,D),Le=new wc(D,As,tt,ce,_e,!1,R,S,M,N),ot=new Float32Array(Be*Le.stride),qe=0;for(let Xe=0;Xe<Be;++Xe)qe=Le.encode(ot,qe,Yt[Xe],ut[Xe],Et[Xe],void 0,tn[Xe],Ce[Xe]);return{vertices:ot,maximumHeight:ce,minimumHeight:ye,encoding:Le,boundingSphere3D:Xo,orientedBoundingBox:Xa,occludeePointInScaledSpace:Rr}};var jS=Jm;function v0(){he.throwInstantiationError()}Object.defineProperties(v0.prototype,{credits:{get:he.throwInstantiationError},waterMask:{get:he.throwInstantiationError}});v0.prototype.interpolateHeight=he.throwInstantiationError;v0.prototype.isChildAvailable=he.throwInstantiationError;v0.prototype.createMesh=he.throwInstantiationError;v0.prototype.upsample=he.throwInstantiationError;v0.prototype.wasCreatedByUpsampling=he.throwInstantiationError;v0.maximumAsynchronousTasks=5;var Nh=v0;function Dat(e,t,n,i,o,r,s,a,c,u,f,d,p,g,m,x){this.center=e,this.vertices=t,this.stride=y(u,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=d,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=x}var md=Dat;function ml(){he.throwInstantiationError()}Object.defineProperties(ml.prototype,{errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},hasWaterMask:{get:he.throwInstantiationError},hasVertexNormals:{get:he.throwInstantiationError},availability:{get:he.throwInstantiationError}});var Qye=[];ml.getRegularGridIndices=function(e,t){let n=Qye[e];l(n)||(Qye[e]=n=[]);let i=n[t];return l(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),n0e(e,t,i,0)),i};var Jye=[];ml.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Jye[e];l(n)||(Jye[e]=n=[]);let i=n[t];if(!l(i)){let o=ml.getRegularGridIndices(e,t),r=t0e(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var e0e=[];ml.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=e0e[e];l(n)||(e0e[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,u=r+a,f=t0e(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,x=Ne.createTypedArray(c,u);n0e(e,t,x,0),ml.addSkirtIndices(d,p,g,m,o,x,r),i=n[t]={indices:x,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};ml.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=JH(e,a,r,s),a+=e.length,s=JH(t,a,r,s),a+=t.length,s=JH(n,a,r,s),a+=n.length,JH(i,a,r,s)};function t0e(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function n0e(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function JH(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}ml.heightmapTerrainQuality=.25;ml.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*ml.heightmapTerrainQuality/(t*n)};ml.prototype.requestTileGeometry=he.throwInstantiationError;ml.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;ml.prototype.getTileDataAvailable=he.throwInstantiationError;ml.prototype.loadTileDataAvailability=he.throwInstantiationError;var ss=ml;function cg(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,dd.NONE);let t=jS.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===dd.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(cg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var i0e="createVerticesFromHeightmap",Iat=new _i(i0e),Pat=new _i(i0e,Nh.maximumAsynchronousTasks);cg.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),d=c.cartographicToCartesian(se.center(f)),p=this._structure,m=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let b=(a?Pat:Iat).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Di,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(b))return;let T=this;return Promise.resolve(b).then(function(C){let A;T._skirtHeight>0?A=ss.getRegularGridAndSkirtIndicesAndEdgeIndices(C.gridWidth,C.gridHeight):A=ss.getRegularGridIndicesAndEdgeIndices(C.gridWidth,C.gridHeight);let E=C.gridWidth*C.gridHeight;return T._mesh=new md(d,new Float32Array(C.vertices),A.indices,A.indexCountWithoutSkirts,E,C.minimumHeight,C.maximumHeight,ae.clone(C.boundingSphere3D),h.clone(C.occludeePointInScaledSpace),C.numberOfAttributes,vn.clone(C.orientedBoundingBox),wc.clone(C.encoding),A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),T._buffer=void 0,T._mesh})};cg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(se.center(u)),d=this._structure,g=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let m=jS.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Di,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=ss.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=ss.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=m.gridWidth*m.gridHeight;return this._mesh=new md(f,m.vertices,x.indices,x.indexCountWithoutSkirts,b,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};cg.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,d=r.heightScale,p=l(this._mesh),g=this._encoding===dd.LERC;if(!p&&g)return;let x;if(p){let b=this._mesh.vertices,T=this._mesh.encoding;x=o0e(b,T,f,d,e,i,o,t,n)}else x=Rat(this._buffer,a,c,s,u,e,i,o,t,n),x=x*d+f;return x};cg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,m=a.encoding,x=e.tileXYToRectangle(t,n,i),b=e.tileXYToRectangle(o,r,s),T=f.heightOffset,C=f.heightScale,A=f.elementsPerHeight,E=f.elementMultiplier,v=f.isBigEndian,D=Math.pow(E,A-1);for(let O=0;O<u;++O){let R=P.lerp(b.north,b.south,O/(u-1));for(let M=0;M<c;++M){let N=P.lerp(b.west,b.east,M/(c-1)),_=o0e(g,m,T,C,x,c,u,N,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,Oat(p,A,E,D,d,v,O*c+M,_)}}return Promise.resolve(new cg({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};cg.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};cg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function Rat(e,t,n,i,o,r,s,a,c,u){let f=(c-r.west)*(s-1)/(r.east-r.west),d=(u-r.south)*(a-1)/(r.north-r.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=d|0,x=m+1;x>=a&&(x=a-1,m=a-2);let b=f-p,T=d-m;m=a-1-m,x=a-1-x;let C=e8(e,t,n,i,o,m*s+p),A=e8(e,t,n,i,o,m*s+g),E=e8(e,t,n,i,o,x*s+p),v=e8(e,t,n,i,o,x*s+g);return r0e(b,T,C,A,E,v)}function o0e(e,t,n,i,o,r,s,a,c){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(s-1)/(o.north-o.south),d=u|0,p=d+1;p>=r&&(p=r-1,d=r-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let x=u-d,b=f-g;g=s-1-g,m=s-1-m;let T=(t.decodeHeight(e,g*r+d)-n)/i,C=(t.decodeHeight(e,g*r+p)-n)/i,A=(t.decodeHeight(e,m*r+d)-n)/i,E=(t.decodeHeight(e,m*r+p)-n)/i;return r0e(x,b,T,C,A,E)}function r0e(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function e8(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function Oat(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Ha=cg;function qS(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Xi({ellipsoid:y(e.ellipsoid,ee.default)})),this._levelZeroMaximumGeometricError=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new me}Object.defineProperties(qS.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});qS.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Ha({buffer:new Uint8Array(16*16),width:16,height:16}))};qS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};qS.prototype.getTileDataAvailable=function(e,t,n){};qS.prototype.loadTileDataAvailability=function(e,t,n){};var ep=qS;var Mat=new z;function Lat(e,t){let n=e.unionClippingRegions,i=e.length,o=gs.useFloatTexture(t),r=gs.getTextureResolution(e,t,Mat),s=r.x,a=r.y,c=o?Bat(s,a):kat(s,a);return c+=` -`,c+=n?Nat(i):Fat(i),c}function Nat(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +`;var kat=new z;function Vat(e,t){let n=e.unionClippingRegions,i=e.length,o=gs.useFloatTexture(t),r=gs.getTextureResolution(e,t,kat),s=r.x,a=r.y,c=o?Hat(s,a):Gat(s,a);return c+=` +`,c+=n?Uat(i):zat(i),c}function Uat(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { vec4 position = czm_windowToEyeCoordinates(fragCoord); vec3 clipNormal = vec3(0.0); @@ -12452,7 +10690,7 @@ ${o}`),t}var Qm=hat;async function mat(e,t,n,i){return l(i)||(i=!1),gat(e,t,n,i) } return clipAmount; } -`}function Fat(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +`}function zat(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { bool clipped = true; vec4 position = czm_windowToEyeCoordinates(fragCoord); @@ -12475,7 +10713,7 @@ ${o}`),t}var Qm=hat;async function mat(e,t,n,i){return l(i)||(i=!1),gat(e,t,n,i) } return clipAmount; } -`}function Bat(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`}function Hat(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int pixY = clippingPlaneNumber / ${e}; int pixX = clippingPlaneNumber - (pixY * ${e}); @@ -12484,7 +10722,7 @@ ${o}`),t}var Qm=hat;async function mat(e,t,n,i){return l(i)||(i=!1),gat(e,t,n,i) vec4 plane = texture(packedClippingPlanes, vec2(u, v)); return czm_transformPlane(plane, transform); } -`}function kat(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`}function Gat(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int clippingPlaneStartIndex = clippingPlaneNumber * 2; int pixY = clippingPlaneStartIndex / ${e}; @@ -12498,23 +10736,23 @@ ${o}`),t}var Qm=hat;async function mat(e,t,n,i){return l(i)||(i=!1),gat(e,t,n,i) plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v))); return czm_transformPlane(plane, transform); } -`}var lg=Lat;function Vat(e,t,n,i,o,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o,this.clippingPolygonShaderState=r}function CX(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function Uat(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case ne.SCENE3D:o=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:o=n;break;case ne.MORPHING:o=i;break}return o}function zat(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) { +`}var cg=Vat;function Wat(e,t,n,i,o,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o,this.clippingPolygonShaderState=r}function AX(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function jat(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case ne.SCENE3D:o=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:o=n;break;case ne.MORPHING:o=i;break}return o}function qat(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) { czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex); }`:`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) { - }`}function Hat(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) { + }`}function Yat(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) { return czm_unpackClippingExtents(extentsTexture, index); }`:`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) { return vec4(); - }`}function Gat(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}CX.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,m=e.showOceanWaves,x=e.enableLighting,b=e.dynamicAtmosphereLighting,T=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,A=e.perFragmentGroundAtmosphere,E=e.hasVertexNormals,v=e.useWebMercatorProjection,D=e.enableFog,O=e.enableClippingPlanes,R=e.clippingPlanes,M=e.enableClippingPolygons,N=e.clippingPolygons,_=e.clippedByBoundaries,S=e.hasImageryLayerCutout,w=e.colorCorrect,I=e.highlightFillTile,L=e.colorToAlpha,B=e.hasGeodeticSurfaceNormals,U=e.hasExaggeration,V=e.showUndergroundColor,G=e.translucent,k=0,W="",J=n.renderedMesh.encoding;J.quantization===Js.BITS12&&(k=1,W="QUANTIZATION_BITS12");let K=0,Q="";_&&(K=1,Q="TILE_LIMIT_RECTANGLE");let de=0,ye="";S&&(de=1,ye="APPLY_IMAGERY_CUTOUT");let ce=t.mode,_e=ce|o<<2|r<<3|s<<4|a<<5|c<<6|u<<7|p<<8|g<<9|m<<10|x<<11|b<<12|T<<13|C<<14|A<<15|E<<16|v<<17|D<<18|k<<19|d<<20|O<<21|M<<22|K<<23|de<<24|w<<25|I<<26|L<<27|B<<28|U<<29|V<<30|G<<31|f<<32,xe=0;l(R)&&R.length>0&&(xe=O?R.clippingPlanesState:0);let De=0;l(N)&&N.length>0&&(De=M?N.clippingPolygonsState:0);let Ae=n.surfaceShader;if(l(Ae)&&Ae.numberOfDayTextures===i&&Ae.flags===_e&&Ae.material===this.material&&Ae.clippingShaderState===xe&&Ae.clippingPolygonShaderState===De)return Ae.shaderProgram;let ke=this._shadersByTexturesFlags[i];if(l(ke)||(ke=this._shadersByTexturesFlags[i]=[]),Ae=ke[_e],!l(Ae)||Ae.material!==this.material||Ae.clippingShaderState!==xe||Ae.clippingPolygonShaderState!==De){let ze=this.baseVertexShaderSource.clone(),tt=this.baseFragmentShaderSource.clone();xe!==0&&tt.sources.unshift(lg(R,t.context)),De!==0&&(tt.sources.unshift(zat(t.context)),ze.sources.unshift(Hat(t.context))),ze.defines.push(W),tt.defines.push(`TEXTURE_UNITS ${i}`,Q,ye),o&&tt.defines.push("APPLY_BRIGHTNESS"),r&&tt.defines.push("APPLY_CONTRAST"),s&&tt.defines.push("APPLY_HUE"),a&&tt.defines.push("APPLY_SATURATION"),c&&tt.defines.push("APPLY_GAMMA"),u&&tt.defines.push("APPLY_ALPHA"),f&&tt.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&tt.defines.push("HAS_WATER_MASK"),g&&(tt.defines.push("SHOW_REFLECTIVE_OCEAN"),ze.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&tt.defines.push("SHOW_OCEAN_WAVES"),L&&tt.defines.push("APPLY_COLOR_TO_ALPHA"),V&&(ze.defines.push("UNDERGROUND_COLOR"),tt.defines.push("UNDERGROUND_COLOR")),G&&(ze.defines.push("TRANSLUCENT"),tt.defines.push("TRANSLUCENT")),x&&(E?(ze.defines.push("ENABLE_VERTEX_LIGHTING"),tt.defines.push("ENABLE_VERTEX_LIGHTING")):(ze.defines.push("ENABLE_DAYNIGHT_SHADING"),tt.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(ze.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),tt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),T&&(ze.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),tt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(ze.defines.push("GROUND_ATMOSPHERE"),tt.defines.push("GROUND_ATMOSPHERE"),A&&(ze.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),tt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),ze.defines.push("INCLUDE_WEB_MERCATOR_Y"),tt.defines.push("INCLUDE_WEB_MERCATOR_Y"),D&&(ze.defines.push("FOG"),tt.defines.push("FOG")),d&&tt.defines.push("APPLY_SPLIT"),O&&tt.defines.push("ENABLE_CLIPPING_PLANES"),M&&(tt.defines.push("ENABLE_CLIPPING_POLYGONS"),ze.defines.push("ENABLE_CLIPPING_POLYGONS"),N.inverse&&tt.defines.push("CLIPPING_INVERSE"),tt.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${N.extentsCount}`),ze.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${N.extentsCount}`)),w&&tt.defines.push("COLOR_CORRECT"),I&&tt.defines.push("HIGHLIGHT_FILL_TILE"),B&&ze.defines.push("GEODETIC_SURFACE_NORMALS"),U&&ze.defines.push("EXAGGERATION");let wt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) + }`}function Xat(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}AX.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,d=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,m=e.showOceanWaves,x=e.enableLighting,b=e.dynamicAtmosphereLighting,T=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,A=e.perFragmentGroundAtmosphere,E=e.hasVertexNormals,v=e.useWebMercatorProjection,D=e.enableFog,O=e.enableClippingPlanes,R=e.clippingPlanes,M=e.enableClippingPolygons,N=e.clippingPolygons,_=e.clippedByBoundaries,S=e.hasImageryLayerCutout,w=e.colorCorrect,I=e.highlightFillTile,L=e.colorToAlpha,B=e.hasGeodeticSurfaceNormals,U=e.hasExaggeration,V=e.showUndergroundColor,G=e.translucent,k=0,W="",J=n.renderedMesh.encoding;J.quantization===Js.BITS12&&(k=1,W="QUANTIZATION_BITS12");let K=0,Q="";_&&(K=1,Q="TILE_LIMIT_RECTANGLE");let de=0,xe="";S&&(de=1,xe="APPLY_IMAGERY_CUTOUT");let ce=t.mode,ge=ce|o<<2|r<<3|s<<4|a<<5|c<<6|u<<7|p<<8|g<<9|m<<10|x<<11|b<<12|T<<13|C<<14|A<<15|E<<16|v<<17|D<<18|k<<19|d<<20|O<<21|M<<22|K<<23|de<<24|w<<25|I<<26|L<<27|B<<28|U<<29|V<<30|G<<31|f<<32,be=0;l(R)&&R.length>0&&(be=O?R.clippingPlanesState:0);let De=0;l(N)&&N.length>0&&(De=M?N.clippingPolygonsState:0);let Ae=n.surfaceShader;if(l(Ae)&&Ae.numberOfDayTextures===i&&Ae.flags===ge&&Ae.material===this.material&&Ae.clippingShaderState===be&&Ae.clippingPolygonShaderState===De)return Ae.shaderProgram;let ke=this._shadersByTexturesFlags[i];if(l(ke)||(ke=this._shadersByTexturesFlags[i]=[]),Ae=ke[ge],!l(Ae)||Ae.material!==this.material||Ae.clippingShaderState!==be||Ae.clippingPolygonShaderState!==De){let ze=this.baseVertexShaderSource.clone(),tt=this.baseFragmentShaderSource.clone();be!==0&&tt.sources.unshift(cg(R,t.context)),De!==0&&(tt.sources.unshift(qat(t.context)),ze.sources.unshift(Yat(t.context))),ze.defines.push(W),tt.defines.push(`TEXTURE_UNITS ${i}`,Q,xe),o&&tt.defines.push("APPLY_BRIGHTNESS"),r&&tt.defines.push("APPLY_CONTRAST"),s&&tt.defines.push("APPLY_HUE"),a&&tt.defines.push("APPLY_SATURATION"),c&&tt.defines.push("APPLY_GAMMA"),u&&tt.defines.push("APPLY_ALPHA"),f&&tt.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&tt.defines.push("HAS_WATER_MASK"),g&&(tt.defines.push("SHOW_REFLECTIVE_OCEAN"),ze.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&tt.defines.push("SHOW_OCEAN_WAVES"),L&&tt.defines.push("APPLY_COLOR_TO_ALPHA"),V&&(ze.defines.push("UNDERGROUND_COLOR"),tt.defines.push("UNDERGROUND_COLOR")),G&&(ze.defines.push("TRANSLUCENT"),tt.defines.push("TRANSLUCENT")),x&&(E?(ze.defines.push("ENABLE_VERTEX_LIGHTING"),tt.defines.push("ENABLE_VERTEX_LIGHTING")):(ze.defines.push("ENABLE_DAYNIGHT_SHADING"),tt.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(ze.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),tt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),T&&(ze.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),tt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(ze.defines.push("GROUND_ATMOSPHERE"),tt.defines.push("GROUND_ATMOSPHERE"),A&&(ze.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),tt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),ze.defines.push("INCLUDE_WEB_MERCATOR_Y"),tt.defines.push("INCLUDE_WEB_MERCATOR_Y"),D&&(ze.defines.push("FOG"),tt.defines.push("FOG")),d&&tt.defines.push("APPLY_SPLIT"),O&&tt.defines.push("ENABLE_CLIPPING_PLANES"),M&&(tt.defines.push("ENABLE_CLIPPING_POLYGONS"),ze.defines.push("ENABLE_CLIPPING_POLYGONS"),N.inverse&&tt.defines.push("CLIPPING_INVERSE"),tt.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${N.extentsCount}`),ze.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${N.extentsCount}`)),w&&tt.defines.push("COLOR_CORRECT"),I&&tt.defines.push("HIGHLIGHT_FILL_TILE"),B&&ze.defines.push("GEODETIC_SURFACE_NORMALS"),U&&ze.defines.push("EXAGGERATION");let vt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) { vec4 color = initialColor; -`;S&&(wt+=` vec4 cutoutAndColorResult; +`;S&&(vt+=` vec4 cutoutAndColorResult; bool texelUnclipped; -`);for(let Be=0;Be<i;++Be)S?wt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Be}]; +`);for(let Be=0;Be<i;++Be)S?vt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Be}]; texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; cutoutAndColorResult = sampleAndBlend( -`:wt+=` color = sampleAndBlend( -`,wt+=` color, +`:vt+=` color = sampleAndBlend( +`,vt+=` color, u_dayTextures[${Be}], u_dayTextureUseWebMercatorT[${Be}] ? textureCoordinates.xz : textureCoordinates.xy, u_dayTextureTexCoordsRectangle[${Be}], @@ -12530,9 +10768,261 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, ${d?`u_dayTextureSplit[${Be}]`:"0.0"}, ${L?`u_colorsToAlpha[${Be}]`:"vec4(0.0)"}, nightBlend ); -`,S&&(wt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); -`);wt+=` return color; - }`,tt.sources.push(wt),ze.sources.push(Uat(ce)),ze.sources.push(Gat(v));let _t=Qt.fromCache({context:t.context,vertexShaderSource:ze,fragmentShaderSource:tt,attributeLocations:J.getAttributeLocations()});Ae=ke[_e]=new Vat(i,_e,this.material,_t,xe,De)}return n.surfaceShader=Ae,Ae.shaderProgram};CX.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var n2=CX;var Wat={NONE:-1,PARTIAL:0,FULL:1},_r=Object.freeze(Wat);function t8(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}t8.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new t8(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Qm(i)}`),c};t8.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Io=t8;var jat={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ai=Object.freeze(jat);var qat={START:0,LOADING:1,DONE:2,FAILED:3},ea=Object.freeze(qat);var Yat={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},fo=Object.freeze(Yat);function rr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=fo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ae,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(rr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===fo.RECEIVING||e===fo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==ai.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var Xat=new fe;function AX(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,Xat);s=n.project(c,r),s=h.fromElements(s.z,s.x,s.y,r)}return s}var Kat=new h,Zat=new h,$at=new h;rr.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,u=a.length,f=Number.MAX_VALUE;for(let d=0;d<u;d+=3){let p=a[d],g=a[d+1],m=a[d+2],x=AX(c,t,n,s,p,Kat),b=AX(c,t,n,s,g,Zat),T=AX(c,t,n,s,m,$at),C=$n.rayTriangleParametric(e,x,b,T,i);l(C)&&C<f&&C>=0&&(f=C)}return f!==Number.MAX_VALUE?mn.getPoint(e,f,o):void 0};rr.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=fo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};rr.prototype.freeVertexArray=function(){rr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,rr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};rr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new rr),e.state===ea.START&&(Qat(e,t,n),e.state=ea.LOADING)};rr.processStateMachine=function(e,t,n,i,o,r,s){rr.initialize(e,n,i);let a=e.data;if(e.state===ea.LOADING&&Jat(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===fo.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let g in d)d.hasOwnProperty(g)&&(d[g](e)||(p[g]=d[g]));e._loadedCallbacks=p,e.state=ea.DONE}c&&(e.renderable=!0)};rr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){r=!1;continue}if(d.loadingImagery.state===ai.PLACEHOLDER){let g=d.loadingImagery.imageryLayer;if(g.ready){d.freeResources(),c.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||l(d.readyImagery),r=r&&l(d.loadingImagery)&&(d.loadingImagery.state===ai.FAILED||d.loadingImagery.state===ai.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function s0e(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=wc.clone(s);c.hasGeodeticSurfaceNormals=t,c=wc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(rr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=rr._createVertexArrayForMesh(i.context,o)):(rr._freeVertexArray(e.vertexArray),e.vertexArray=rr._createVertexArrayForMesh(i.context,o)),rr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}rr.prototype.addGeodeticSurfaceNormals=function(e,t){s0e(this,!0,e,t)};rr.prototype.removeGeodeticSurfaceNormals=function(e){s0e(this,!1,void 0,e)};rr.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let g=0;g<p;g++){let m=d[g];m.level=-1}}}};function Qat(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=fo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Jat(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===fo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||rr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===fo.FAILED&&ect(s,e,t,n,e.x,e.y,e.level),s.terrainState===fo.UNLOADED&&tct(s,n,e.x,e.y,e.level),s.terrainState===fo.RECEIVED&&ict(s,t,n,e.x,e.y,e.level),s.terrainState===fo.TRANSFORMED&&(oct(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=fo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)sct(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function ect(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=ea.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,d=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,o,r,s);l(p)&&(e.terrainState=fo.RECEIVING,Promise.resolve(p).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=fo.RECEIVED)}).catch(function(){e.terrainState=fo.FAILED}))}function tct(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=fo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=fo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Zn.CANCELLED){e.terrainData=void 0,e.terrainState=fo.UNLOADED,e.request=void 0;return}e.terrainState=fo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Io.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let c=new Zo({throttle:!1,throttleByServer:!0,type:ds.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=fo.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=fo.UNLOADED,e.request=void 0)}a()}var nct={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function ict(e,t,n,i,o,r){let s=n.tilingScheme,a=nct;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=fo.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=fo.TRANSFORMED}).catch(function(){e.terrainState=fo.FAILED}))}rr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=gt.createVertexBuffer({context:e,typedArray:n,usage:Fe.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=gt.createIndexBuffer({context:e,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ei({context:e,attributes:o,indexBuffer:s})};rr._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function oct(e,t,n,i,o,r,s){e.vertexArray=rr._createVertexArrayForMesh(t,e.mesh),e.terrainState=fo.READY,e.fill=e.fill&&e.fill.destroy(s)}function rct(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Pt.create({context:e,pixelFormat:et.LUMINANCE,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR,magnificationFilter:di.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function sct(e,t){let n=t.terrainData.waterMask,i=rct(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Pt.create({context:e,pixelFormat:et.LUMINANCE,pixelDatatype:Ke.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,oe.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}rr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};rr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var pd=rr;function w0(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ee.default),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Pi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new z(-i,-i),this._rectangleNortheastInMeters=new z(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new se(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(w0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});w0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};w0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};w0.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(se.southwest(e)),o=n.project(se.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new se(i.x,i.y,o.x,o.y)};w0.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,d=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=d,i.east=c,i.north=f,i):new se(a,d,c,f)};w0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new z(o.west,o.south)),a=r.unproject(new z(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};w0.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!se.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,d=this._projection.project(e),p=d.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-d.y,m=p/a|0;m>=o&&(m=o-1);let x=g/u|0;return x>=r&&(x=r-1),l(n)?(n.x=m,n.y=x,n):new z(m,x)};var as=w0;var EX,a0e="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSrZYLHFXe7j_lQcsSJKc8-7rwh0IFSNWLGZErkzXRnYjMjURTz-hGiKMEeAJIZBG7uiYEn0Mt1rrwlJGIpirZQC4iO428519DlO3QC9DnRBqLXGTBhirgoU7-Z2209sy87s49kw6NOC8_Eew6nCLf-pZ883DRPRyAYH7LC8cvRLInud0EdndtUFa4y83TamrA.AT1_ahjrWDrq",YS={};YS.defaultAccessToken=a0e;YS.defaultWorldImageryServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});YS.defaultWorldHillshadeServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});YS.defaultWorldOceanServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});YS.getDefaultTokenCredit=function(e){if(e===a0e){if(!l(EX)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';EX=new Tt(t,!0)}return EX}};var $u=YS;function SX(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Se.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Id(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}SX.prototype.isReady=function(){return this._isReady};SX.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Id(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var i2=SX;function vX(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}vX.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};vX.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Fh=vX;function XS(){he.throwInstantiationError()}Object.defineProperties(XS.prototype,{rectangle:{get:he.throwInstantiationError},tileWidth:{get:he.throwInstantiationError},tileHeight:{get:he.throwInstantiationError},maximumLevel:{get:he.throwInstantiationError},minimumLevel:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},tileDiscardPolicy:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},proxy:{get:he.throwInstantiationError},hasAlphaChannel:{get:he.throwInstantiationError}});XS.prototype.getTileCredits=function(e,t,n){he.throwInstantiationError()};XS.prototype.requestImage=function(e,t,n,i){he.throwInstantiationError()};XS.prototype.pickFeatures=function(e,t,n,i,o){he.throwInstantiationError()};var act=/\.ktx2$/i;XS.loadImage=function(e,t){let n=Se.createIfNeeded(t);return act.test(n.url)?Dl(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var pl=XS;var cct={SATELLITE:1,OCEANS:2,HILLSHADE:3},Bh=Object.freeze(cct);function c0e(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new Xi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Tt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}c0e.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new i2({missingImageUrl:l0e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new z(0,0),new z(200,20),new z(20,200),new z(80,110),new z(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function lct(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new as({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Xi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new re(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Pi,o=e.fullExtent,r=i.unproject(new h(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new se(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=se.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new re(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Tt(e.copyrightText)]:t.credit=new Tt(e.copyrightText))}function uct(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new re(n)}async function fct(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();lct(i,t)}catch(i){uct(e,i)}}function tp(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Xi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new Tt(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new me}tp.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case Bh.SATELLITE:{n=y(t.token,$u.defaultAccessToken),i=Se.createIfNeeded($u.defaultWorldImageryServer),i.appendForwardSlash();let r=$u.getDefaultTokenCredit(n);l(r)&&(o=Tt.clone(r))}break;case Bh.OCEANS:{n=y(t.token,$u.defaultAccessToken),i=Se.createIfNeeded($u.defaultWorldOceanServer),i.appendForwardSlash();let r=$u.getDefaultTokenCredit(n);l(r)&&(o=Tt.clone(r))}break;case Bh.HILLSHADE:{n=y(t.token,$u.defaultAccessToken),i=Se.createIfNeeded($u.defaultWorldHillshadeServer),i.appendForwardSlash();let r=$u.getDefaultTokenCredit(n);l(r)&&(o=Tt.clone(r))}break;default:}return tp.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function l0e(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Di?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(tp.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});tp.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new tp(t);i._resource=n;let o=new c0e(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await fct(n,o),o.build(i),i};tp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};tp.prototype.requestImage=function(e,t,n,i){return pl.loadImage(this,l0e(this,e,t,n,i))};tp.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Di)s=P.toDegrees(i),a=P.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new fe(i,o,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let x=0;x<m.length;++x){let b=m[x],T=new Fh;if(T.data=b,T.name=b.value,T.properties=b.attributes,T.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let C=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(C===4326||C===4283)T.position=fe.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(C===102100||C===900913||C===3857){let A=new Pi;T.position=A.unproject(new h(b.geometry.x,b.geometry.y,b.geometry.z))}}g.push(T)}return g})};tp._metadataCache={};var ug=tp;var dct={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},KS=Object.freeze(dct);function o2(e){}o2.prototype.isReady=function(){return!0};o2.prototype.shouldDiscardImage=function(e){return o2.EMPTY_IMAGE===e};var n8;Object.defineProperties(o2,{EMPTY_IMAGE:{get:function(){return l(n8)||(n8=new Image,n8.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),n8}}});var ZS=o2;function u0e(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}u0e.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof Tt)break;o.credit=new Tt(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],u=c.bbox;c.bbox=new se(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}};function hct(e,t){if(e.resourceSets.length!==1)throw new re("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function mct(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new re(i)}async function pct(e,t,n){let i=e.url,o=Ns._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),Ns._metadataCache[i]=o);try{let r=await o;return hct(r,t)}catch(r){mct(e,r,n)}}function Ns(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,KS.AERIAL),this._mapLayer=e.mapLayer,this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new ZS),this._proxy=e.proxy,this._credit=new Tt(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Ns.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new as({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new me}Object.defineProperties(Ns.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});Ns.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,KS.AERIAL),o=Se.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Ns(t);a._resource=o;let c=new u0e(t);return await pct(s,c),c.build(a),a};var _ct=new se;Ns.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,_ct);return xct(this._attributionList,n,i)};Ns.prototype.requestImage=function(e,t,n,i){let o=pl.loadImage(this,gct(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?ZS.EMPTY_IMAGE:Promise.reject(r)})};Ns.prototype.pickFeatures=function(e,t,n,i,o){};Ns.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};Ns.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};Ns._logoUrl=void 0;Object.defineProperties(Ns,{logoUrl:{get:function(){return l(Ns._logoUrl)||(Ns._logoUrl=nn("Assets/Images/bing_maps_credit.png")),Ns._logoUrl},set:function(e){Ns._logoUrl=e}}});function gct(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:Ns.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var yct=new se;function xct(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=se.intersection(n,d.bbox,yct);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Ns._metadataCache={};var r2=Ns;var f0e=/{[^}]+}/g,d0e={x:Act,y:Sct,z:Dct,s:Ict,reverseX:Ect,reverseY:vct,reverseZ:wct,westDegrees:Pct,southDegrees:Rct,eastDegrees:Oct,northDegrees:Mct,westProjected:Lct,southProjected:Nct,eastProjected:Fct,northProjected:Bct,width:kct,height:Vct},bct=bt(d0e,{i:Uct,j:zct,reverseI:Hct,reverseJ:Gct,longitudeDegrees:jct,latitudeDegrees:qct,longitudeProjected:Yct,latitudeProjected:Xct,format:Zct});function s2(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new me;let t=Se.createIfNeeded(e.url),n=Se.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new as({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=se.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Tt(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=bt(d0e,r),a=bt(bct,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(s2.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});s2.prototype.getTileCredits=function(e,t,n){};s2.prototype.requestImage=function(e,t,n,i){return pl.loadImage(this,Tct(this,e,t,n,i))};s2.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=Cct(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var i8=!1,Qu=new se,o8=!1,a2=new se;function Tct(e,t,n,i,o){i8=!1,o8=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},u=s.match(f0e);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var wX=!1,QS=new z,DX=!1;function Cct(e,t,n,i,o,r,s){i8=!1,o8=!1,wX=!1,DX=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(f0e);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function JS(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function Act(e,t,n,i){return JS(e,"{x}",t)}function Ect(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return JS(e,"{reverseX}",o)}function Sct(e,t,n,i){return JS(e,"{y}",n)}function vct(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return JS(e,"{reverseY}",o)}function wct(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return JS(e,"{reverseZ}",r)}function Dct(e,t,n,i){return JS(e,"{z}",i)}function Ict(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function r8(e,t,n,i){i8||(e.tilingScheme.tileXYToRectangle(t,n,i,Qu),Qu.west=P.toDegrees(Qu.west),Qu.south=P.toDegrees(Qu.south),Qu.east=P.toDegrees(Qu.east),Qu.north=P.toDegrees(Qu.north),i8=!0)}function Pct(e,t,n,i){return r8(e,t,n,i),Qu.west}function Rct(e,t,n,i){return r8(e,t,n,i),Qu.south}function Oct(e,t,n,i){return r8(e,t,n,i),Qu.east}function Mct(e,t,n,i){return r8(e,t,n,i),Qu.north}function s8(e,t,n,i){o8||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,a2),o8=!0)}function Lct(e,t,n,i){return s8(e,t,n,i),a2.west}function Nct(e,t,n,i){return s8(e,t,n,i),a2.south}function Fct(e,t,n,i){return s8(e,t,n,i),a2.east}function Bct(e,t,n,i){return s8(e,t,n,i),a2.north}function kct(e,t,n,i){return e.tileWidth}function Vct(e,t,n,i){return e.tileHeight}function Uct(e,t,n,i,o,r,s){return a8(e,t,n,i,o,r),QS.x}function zct(e,t,n,i,o,r,s){return a8(e,t,n,i,o,r),QS.y}function Hct(e,t,n,i,o,r,s){return a8(e,t,n,i,o,r),e.tileWidth-QS.x-1}function Gct(e,t,n,i,o,r,s){return a8(e,t,n,i,o,r),e.tileHeight-QS.y-1}var Wct=new se,$S=new h;function a8(e,t,n,i,o,r,s){if(wX)return;IX(e,t,n,i,o,r);let a=$S,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Wct);QS.x=e.tileWidth*(a.x-c.west)/c.width|0,QS.y=e.tileHeight*(c.north-a.y)/c.height|0,wX=!0}function jct(e,t,n,i,o,r,s){return P.toDegrees(o)}function qct(e,t,n,i,o,r,s){return P.toDegrees(r)}function Yct(e,t,n,i,o,r,s){return IX(e,t,n,i,o,r),$S.x}function Xct(e,t,n,i,o,r,s){return IX(e,t,n,i,o,r),$S.y}var Kct=new fe;function IX(e,t,n,i,o,r,s){if(!DX){if(e.tilingScheme.projection instanceof Di)$S.x=P.toDegrees(o),$S.y=P.toDegrees(r);else{let a=Kct;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,$S)}DX=!0}}function Zct(e,t,n,i,o,r,s){return s}var Ga=s2;function _d(e){Ga.call(this,e)}_d._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return _d._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof nm)return _d._metadataFailure(e,t);throw o}};_d.fromUrl=async function(e,t){let n=Se.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let r=await _d._requestMetadata(t,i,o);return new _d(r)};l(Object.create)&&(_d.prototype=Object.create(Ga.prototype),_d.prototype.constructor=_d);function h0e(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function m0e(e,t,n){let i=e.positionToTileXY(se.southwest(t),n),o=e.positionToTileXY(se.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}_d._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(r.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let M=g.item(R).childNodes;for(let N=0;N<M.length;N++)s.test(M.item(N).nodeName)&&p.push(M.item(N))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Io.reportError(void 0,o,o.errorEvent,m),new re(m);let x=y(t.fileExtension,u.getAttribute("extension")),b=y(t.tileWidth,parseInt(u.getAttribute("width"),10)),T=y(t.tileHeight,parseInt(u.getAttribute("height"),10)),C=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),A=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),E=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(E==="geodetic"||E==="global-geodetic")v=new Xi({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")v=new as({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(o)&&Io.reportError(void 0,o,o.errorEvent,m),new re(m);let D=se.clone(t.rectangle);if(!l(D)){let R,M,N,_;y(t.flipXY,!1)?(N=new z(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new z(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(N=new z(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new z(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=E==="geodetic"||E==="mercator";if(v.projection instanceof Di||w)R=fe.fromDegrees(N.x,N.y),M=fe.fromDegrees(_.x,_.y);else{let I=v.projection;R=I.unproject(N),M=I.unproject(_)}D=new se(R.longitude,R.latitude,M.longitude,M.latitude)}return D=h0e(D,v),C=m0e(v,D,C),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:v,rectangle:D,tileWidth:b,tileHeight:T,minimumLevel:C,maximumLevel:A,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};_d._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),o=y(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new as({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=h0e(a,s);let c=m0e(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var D0=_d;function p0e(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}p0e.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function $ct(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new re(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new re(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new as({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new re(o)}return!0}function Qct(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new re(i)}async function Jct(e,t,n){try{let i=await e.fetchText();$ct(i,t)}catch(i){Qct(i,e,n)}}function tu(e){e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new Tt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${tu.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new me}Object.defineProperties(tu.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});tu.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=Se.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new p0e(n);s.channel=t,await Jct(r,s);let a=new tu(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};tu.prototype.getTileCredits=function(e,t,n){};tu.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return pl.loadImage(this,o)};tu.prototype.pickFeatures=function(e,t,n,i,o){};tu._logoUrl=void 0;Object.defineProperties(tu,{logoUrl:{get:function(){return l(tu._logoUrl)||(tu._logoUrl=nn("Assets/Images/google_earth_credit.png")),tu._logoUrl},set:function(e){tu._logoUrl=e}}});var c2=tu;var elt=/\/$/,_0e=new Tt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function ev(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Se.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();elt.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Tt(s))):s=_0e,this._resource=i,this._imageryProvider=new Ga({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(ev.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});ev.prototype.getTileCredits=function(e,t,n){};ev.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ev.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};ev._defaultCredit=_0e;var l2=ev;function BT(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,se.MAX_VALUE),n=new Xi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new me;let i=e.credit;typeof i=="string"&&(i=new Tt(i)),this._credit=i;let o=Se.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(BT.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function tlt(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Io.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return PX(e,n,r);throw l(n)&&(n._hasError=!0),new re(o)}async function PX(e,t,n){try{return await pl.loadImage(null,e)}catch(i){return tlt(e,i,t,n)}}BT.fromUrl=async function(e,t){let n=Se.createIfNeeded(e),i=await PX(n);t=y(t,y.EMPTY_OBJECT);let o=new BT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};BT.prototype.getTileCredits=function(e,t,n){};BT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await PX(this._resource,this);return this._image=o,Io.reportSuccess(this._errorEvent),o}return this._image};BT.prototype.pickFeatures=function(e,t,n,i,o){};var u2=BT;function nlt(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=ilt:e==="xml"?n=alt:(e==="html"||e==="text")&&(n=g0e)),this.callback=n}function ilt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Fh;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=fe.fromDegrees(s,a)}t.push(r)}return t}var RX="http://www.mapinfo.com/mxp",olt="http://www.esri.com/wms",rlt="http://www.opengis.net/wfs",slt="http://www.opengis.net/gml";function alt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===RX)return clt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===olt)return llt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===rlt)return ult(e);if(t.localName==="ServiceExceptionReport")throw new re(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?flt(e):dlt(e)}function clt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(RX,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(RX,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new Fh;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function llt(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(c8(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(c8(a,i))}}return n}function ult(e){let t=[],i=e.documentElement.getElementsByTagNameNS(slt,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};OX(r,s),t.push(c8(r,s))}return t}function flt(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new re("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};OX(s,a),t.push(c8(s,a))}}return t}function OX(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&OX(o,t)&&(t[o.localName]=o.textContent)}return n}function c8(e,t){let n=new Fh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function dlt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Fh;return o.data=e,o.description=n.innerHTML,[o]}var hlt=/<body>\s*<\/body>/im,mlt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,plt=/<title>([\s\S]*)<\/title>/im;function g0e(e){if(hlt.test(e)||mlt.test(e))return;let t,n=plt.exec(e);n&&n.length>1&&(t=n[1]);let i=new Fh;return i.name=t,i.description=e,i.data=e,[i]}var kT=nlt;function f2(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(f2.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});f2.prototype.getFromCache=function(e,t,n,i){let o=y0e(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};f2.prototype.checkApproachingInterval=function(e,t,n,i){let o=y0e(e,t,n),r=this._tilesRequestedForInterval,s=x0e(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!b0e(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};f2.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=x0e(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=b0e(this,c,r),a||s.push(c)}}};function y0e(e,t,n){return`${e}-${t}-${n}`}function _lt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function x0e(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=Z.secondsDifference(c.stop,i),++a):(s=Z.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function b0e(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=_lt(s),c=new Zo({throttle:!1,throttleByServer:!0,type:ds.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(r[s]={promise:u,request:c},!0):!1}var VT=f2;var glt=[3034,3035,3042,3043,3044],ylt=[4471,4559];function kh(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new he("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=Se.createIfNeeded(e.url),n=Se.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(kh.DefaultParameters,!0),n.setQueryParameters(kh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(T0e(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(T0e(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new VT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return C0e(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Pi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!ylt.includes(a)||glt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Pi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Ga({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Xi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,kh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function C0e(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function xlt(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(kh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});kh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};kh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=C0e(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};kh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return xlt(this,e,t,n,i,o,s)};kh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});kh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});kh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new kT("json","application/json")),Object.freeze(new kT("xml","text/xml")),Object.freeze(new kT("text","text/html"))]);function T0e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var d2=kh;var blt=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function h2(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Se.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(blt),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new as({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new VT({clock:e.clock,times:e.times,requestImageFunction:function(d,p,g,m,x){return A0e(s,d,p,g,m,x)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(se.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(se.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new me;let f=e.credit;this._credit=typeof f=="string"?new Tt(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function A0e(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(r)?r.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:o}),d.setTemplateValues(p),l(u)&&d.setTemplateValues(u),l(f)&&d.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(u)&&(g=bt(g,u)),l(f)&&(g=bt(g,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:g,request:o}),d.setTemplateValues(p)}return pl.loadImage(e,d)}Object.defineProperties(h2.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}}});h2.prototype.getTileCredits=function(e,t,n){};h2.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=A0e(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};h2.prototype.pickFeatures=function(e,t,n,i,o){};var m2=h2;var Tlt={ARCGIS_MAPSERVER:ug.fromUrl,BING:async(e,t)=>r2.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,c2.fromUrl(e,n,t)},MAPBOX:(e,t)=>new l2({url:e,...t}),SINGLE_TILE:u2.fromUrl,TMS:D0.fromUrl,URL_TEMPLATE:(e,t)=>new Ga({url:e,...t}),WMS:(e,t)=>new d2({url:e,...t}),WMTS:(e,t)=>new m2({url:e,...t})};function np(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new me}Object.defineProperties(np.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});np.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Cu._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=np._endpointCache[i];l(o)||(o=n.fetchJson(),np._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new re(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await D0.fromUrl(new Cu(r,n));else{let u=Tlt[a];if(!l(u))throw new re(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},d=f.url;delete f.url,s=await u(d,f)}let c=new np(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=Cu.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};np.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};np.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};np.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};np._endpointCache={};var fg=np;var Clt={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},dg=Object.freeze(Clt);function Alt(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,dg.AERIAL);return fg.fromAssetId(t)}var hg=Alt;function tv(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ai.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}tv.createPlaceholder=function(e){let t=new tv(e,0,0,0);return t.addReference(),t.state=ai.PLACEHOLDER,t};tv.prototype.addReference=function(){++this.referenceCount};tv.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};tv.prototype.processStateMachine=function(e,t,n){this.state===ai.UNLOADED&&!n&&(this.state=ai.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ai.RECEIVED&&(this.state=ai.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ai.READY&&t&&!this.texture;(this.state===ai.TEXTURE_LOADED||i)&&(this.state=ai.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var nv=tv;function MX(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}MX.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};MX.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ai.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==ai.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==ai.FAILED&&r.state!==ai.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ai.FAILED||i.state===ai.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var iv=MX;function Ti(e,t){this._imageryProvider=e,this._readyEvent=new me,this._errorEvent=new me,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,Ti.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,Ti.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,Ti.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,Ti.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,Ti.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,Ti.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,Ti.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,Ti.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,se.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new iv(nv.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(Ti.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Ti.DEFAULT_BRIGHTNESS=1;Ti.DEFAULT_CONTRAST=1;Ti.DEFAULT_HUE=0;Ti.DEFAULT_SATURATION=1;Ti.DEFAULT_GAMMA=1;Ti.DEFAULT_SPLIT=Br.NONE;Ti.DEFAULT_MINIFICATION_FILTER=Zt.LINEAR;Ti.DEFAULT_MAGNIFICATION_FILTER=di.LINEAR;Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ti.fromProviderAsync=function(e,t){let n=new Ti(void 0,t);return Dlt(n,Promise.resolve(e)),n};Ti.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),Ti.fromProviderAsync(hg({style:e.style}),e)};Ti.prototype.isBaseLayer=function(){return this._isBaseLayer};Ti.prototype.isDestroyed=function(){return!1};Ti.prototype.destroy=function(){return ue(this)};var v0e=new se,E0e=new se,LX=new se,w0e=new se;Ti.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return se.intersection(e.rectangle,t)};Ti.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Pi&&e.rectangle.north<Pi.MaximumLatitude&&e.rectangle.south>-Pi.MaximumLatitude,s=se.intersection(o.rectangle,this._rectangle,v0e),a=se.intersection(e.rectangle,s,E0e);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,I=e.rectangle;a=E0e,I.south>=w.north?a.north=a.south=w.north:I.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(I.south,w.south),a.north=Math.min(I.north,w.north)),I.west>=w.east?a.west=a.east=w.east:I.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(I.west,w.west),a.east=Math.min(I.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=vlt(this,f,c);d=Math.max(0,d);let p=o.maximumLevel;if(d>p&&(d=p),l(o.minimumLevel)){let w=o.minimumLevel;d<w&&(d=w)}let g=o.tilingScheme,m=g.positionToTileXY(se.northwest(a),d),x=g.positionToTileXY(se.southeast(a),d),b=e.rectangle.width/512,T=e.rectangle.height/512,C=g.tileXYToRectangle(m.x,m.y,d);Math.abs(C.south-e.rectangle.north)<T&&m.y<x.y&&++m.y,Math.abs(C.east-e.rectangle.west)<b&&m.x<x.x&&++m.x;let A=g.tileXYToRectangle(x.x,x.y,d);Math.abs(A.north-e.rectangle.south)<T&&x.y>m.y&&--x.y,Math.abs(A.west-e.rectangle.east)<b&&x.x>m.x&&--x.x;let E=se.clone(e.rectangle,w0e),v=g.tileXYToRectangle(m.x,m.y,d),D=se.intersection(v,s,LX),O;r?(g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(D,D),g.rectangleToNativeRectangle(s,s),O=g.tileXYToNativeRectangle.bind(g),b=E.width/512,T=E.height/512):O=g.tileXYToRectangle.bind(g);let R,M=0,N=1,_;!this.isBaseLayer()&&Math.abs(D.west-E.west)>=b&&(M=Math.min(1,(D.west-E.west)/E.width)),!this.isBaseLayer()&&Math.abs(D.north-E.north)>=T&&(N=Math.max(0,(D.north-E.south)/E.height));let S=N;for(let w=m.x;w<=x.x;w++)if(R=M,v=O(w,m.y,d),D=se.simpleIntersection(v,s,LX),!!l(D)){M=Math.min(1,(D.east-E.west)/E.width),w===x.x&&(this.isBaseLayer()||Math.abs(D.east-E.east)<b)&&(M=1),N=S;for(let I=m.y;I<=x.y;I++){if(_=N,v=O(w,I,d),D=se.simpleIntersection(v,s,LX),!l(D))continue;N=Math.max(0,(D.south-E.south)/E.height),I===x.y&&(this.isBaseLayer()||Math.abs(D.south-E.south)<T)&&(N=0);let L=new oe(R,N,M,_),B=this.getImageryFromCache(w,I,d);i.imagery.splice(n,0,new iv(B,L,r)),++n}}return!0};Ti.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,v0e),i=c.rectangleToNativeRectangle(i,w0e)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new oe(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Ti.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=ai.RECEIVED,e.request=void 0,Io.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Zn.CANCELLED){e.state=ai.UNLOADED,e.request=void 0;return}e.state=ai.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Io.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Zo({throttle:!1,throttleByServer:!0,type:ds.IMAGERY});e.request=s,e.state=ai.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=ai.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Ti.prototype._createTextureWebGL=function(e,t){let n=new $t({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Pt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Pt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?et.RGBA:et.RGB,sampler:n})};Ti.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=ai.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ai.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Pi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ai.TEXTURE_LOADED};function S0e(e,t,n){return`${e}:${t}:${n}`}Ti.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Zt.LINEAR&&i===di.LINEAR&&!et.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=Zt.LINEAR_MIPMAP_LINEAR;let r=Nt.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=S0e(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(um.NICEST),t.sampler=u}else{let r=S0e(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ti.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Di)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new kc({persists:!0,owner:this,preExecute:function(c){Slt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ai.READY,t.releaseReference()},canceled:function(){t.state=ai.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ai.READY};Ti.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Ti.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ti.prototype.getImageryFromCache=function(e,t,n,i){let o=D0e(e,t,n),r=this._imageryCache[o];return l(r)||(r=new nv(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ti.prototype.removeImageryFromCache=function(e){let t=D0e(e.x,e.y,e.level);delete this._imageryCache[t]};function D0e(e,t,n){return JSON.stringify([e,t,n])}var l8={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new z,texture:void 0},Elt=Ht.supportsTypedArrays()?new Float32Array(2*64):void 0;function Slt(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),T=0;for(let D=0;D<64;++D){let O=D/63;b[T++]=0,b[T++]=O,b[T++]=1,b[T++]=O}let C={position:0,webMercatorT:1},A=ss.getRegularGridIndices(2,64),E=gt.createIndexBuffer({context:t,typedArray:A,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});o.vertexArray=new ei({context:t,attributes:[{index:C.position,vertexBuffer:gt.createVertexBuffer({context:t,typedArray:b,usage:Fe.STATIC_DRAW}),componentsPerAttribute:2},{index:C.webMercatorT,vertexBuffer:gt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Fe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let v=new Ue({sources:[WP]});o.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:GP,attributeLocations:C}),o.sampler=new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR,magnificationFilter:di.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;l8.textureDimensions.x=r,l8.textureDimensions.y=s,l8.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Pt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(r)&&P.isPowerOfTwo(s)&&d.generateMipmap(um.NICEST);let p=i.south,g=i.north,m=Elt,x=0;for(let b=0;b<64;++b){let T=b/63,C=P.lerp(p,g,T);a=Math.sin(C);let E=(.5*Math.log((1+a)/(1-a))-c)*f;m[x++]=E,m[x++]=E}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=d,e.uniformMap=l8,e.vertexArray=o.vertexArray}function vlt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Di?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function wlt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Dlt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){wlt(e._errorEvent,i)}}var Wa=Ti;var Ilt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},_n=Ilt;var I0e={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=I0e.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Yn=I0e;function rv(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe}rv.prototype.update=function(e,t,n){this.changedThisFrame&&(F0e(e,t,this.tile,n),this.changedThisFrame=!1)};rv.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};rv.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):pd._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Plt=new by;rv.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Plt;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),d=c.findTileToEast(r),p=c.findTileToNorth(r);Fs(e,n,c,u,s,_n.EAST,!1,a,i),Fs(e,n,c,f,s,_n.NORTH,!1,a,i),Fs(e,n,c,d,s,_n.WEST,!1,a,i),Fs(e,n,c,p,s,_n.SOUTH,!1,a,i);let g=u.findTileToNorth(r),m=u.findTileToSouth(r),x=d.findTileToNorth(r),b=d.findTileToSouth(r);Fs(e,n,c,g,s,_n.SOUTHEAST,!1,a,i),Fs(e,n,c,x,s,_n.SOUTHWEST,!1,a,i),Fs(e,n,c,m,s,_n.NORTHEAST,!1,a,i),Fs(e,n,c,b,s,_n.NORTHWEST,!1,a,i),c=a.dequeue()}};function Fs(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||Yn.wasKicked(u._lastSelectionResult)||Yn.originalResult(u._lastSelectionResult)===Yn.CULLED);){if(s)return;let f=u.parent;if(r>=_n.NORTHWEST&&f!==void 0)switch(r){case _n.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case _n.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case _n.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case _n.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Yn.RENDERED){if(l(u.data.vertexArray))return;Rlt(e,t,n,u,r,o,a,c);return}if(Yn.originalResult(i._lastSelectionResult)!==Yn.CULLED)switch(r){case _n.WEST:Fs(e,t,n,i.northwestChild,o,r,!0,a,c),Fs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case _n.EAST:Fs(e,t,n,i.southeastChild,o,r,!0,a,c),Fs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case _n.SOUTH:Fs(e,t,n,i.southwestChild,o,r,!0,a,c),Fs(e,t,n,i.southeastChild,o,r,!0,a,c);break;case _n.NORTH:Fs(e,t,n,i.northeastChild,o,r,!0,a,c),Fs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case _n.NORTHWEST:Fs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case _n.NORTHEAST:Fs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case _n.SOUTHWEST:Fs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case _n.SOUTHEAST:Fs(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new he("Invalid edge")}}}function Rlt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new rv(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Olt(e,t,n,i,o,a)}function Olt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(F0e(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case _n.WEST:u=s.westMeshes,f=s.westTiles;break;case _n.SOUTH:u=s.southMeshes,f=s.southTiles;break;case _n.EAST:u=s.eastMeshes,f=s.eastTiles;break;case _n.NORTH:u=s.northMeshes,f=s.northTiles;break;case _n.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case _n.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case _n.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case _n.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,x=n.rectangle,b,T=i.rectangle;switch(o){case _n.WEST:for(b=(T.north-T.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.greaterThan(x.north,m.south,b));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.greaterThanOrEquals(x.south,m.north,b));++p);break;case _n.SOUTH:for(b=(T.east-T.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.lessThan(x.west,m.east,b));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.lessThanOrEquals(x.east,m.west,b));++p);break;case _n.EAST:for(b=(T.north-T.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.lessThan(x.south,m.north,b));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.lessThanOrEquals(x.north,m.south,b));++p);break;case _n.NORTH:for(b=(T.east-T.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.greaterThan(x.east,m.west,b));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.greaterThanOrEquals(x.west,m.east,b));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var UT=new fe,Mlt=new fe,ov=new h,kX=new h,NX=new z,FX=new z,Ju=new z;function _8(){this.height=0,this.encodedNormal=new z}function u8(e,t,n,i,o,r,s,a,c){if(l(o))return o;let u;if(l(r)&&l(s))u=(r.height+s.height)*.5;else if(l(r))u=r.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return B0e(e,t,n,i,u,c),c}var Llt={minimumHeight:0,maximumHeight:0},Nlt=new h,P0e=new _8,R0e=new _8,O0e=new _8,M0e=new _8,Flt=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,Blt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function F0e(e,t,n,i){pd.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=d8(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,O0e),p=d8(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,P0e),g=d8(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,R0e),m=d8(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,M0e);d=u8(r,f,0,1,d,p,m,g,O0e),p=u8(r,f,0,0,p,d,g,m,P0e),g=u8(r,f,1,1,g,p,m,d,R0e),m=u8(r,f,1,1,m,g,d,p,M0e);let x=p.height,b=g.height,T=d.height,C=m.height,A=Math.min(x,b,T,C),E=Math.max(x,b,T,C),v=(A+E)*.5,D,O,R=e.getLevelMaximumGeometricError(n.level),M=f.maximumRadius-R,N=Math.acos(M/f.maximumRadius)*4;if(N*=1.5,s.width>N&&E-A<=R){let w=new Ha({width:9,height:9,buffer:Flt,structure:{heightOffset:E}}),I=Blt;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,r.mesh=w._createMeshSync(I)}else{let w=u,I=se.center(s,Mlt);I.height=v;let L=f.cartographicToCartesian(I,Nlt),B=new wc(L,void 0,void 0,void 0,void 0,!0,!0,w,a,c),U=5,V;for(V=r.westMeshes,D=0,O=V.length;D<O;++D)U+=V[D].eastIndicesNorthToSouth.length;for(V=r.southMeshes,D=0,O=V.length;D<O;++D)U+=V[D].northIndicesWestToEast.length;for(V=r.eastMeshes,D=0,O=V.length;D<O;++D)U+=V[D].westIndicesSouthToNorth.length;for(V=r.northMeshes,D=0,O=V.length;D<O;++D)U+=V[D].southIndicesEastToWest.length;let G=Llt;G.minimumHeight=A,G.maximumHeight=E;let k=B.stride,W=new Float32Array(U*k),j=0,J=j;j=f8(f,s,B,W,j,0,1,d.height,d.encodedNormal,1,G),j=m8(r,f,B,W,j,r.westTiles,r.westMeshes,_n.EAST,G);let q=j;j=f8(f,s,B,W,j,0,0,p.height,p.encodedNormal,0,G),j=m8(r,f,B,W,j,r.southTiles,r.southMeshes,_n.NORTH,G);let K=j;j=f8(f,s,B,W,j,1,0,g.height,g.encodedNormal,0,G),j=m8(r,f,B,W,j,r.eastTiles,r.eastMeshes,_n.WEST,G);let Q=j;j=f8(f,s,B,W,j,1,1,m.height,m.encodedNormal,1,G),j=m8(r,f,B,W,j,r.northTiles,r.northMeshes,_n.SOUTH,G),A=G.minimumHeight,E=G.maximumHeight;let de=vn.fromRectangle(s,A,E,n.tilingScheme.ellipsoid),ye=Pi.geodeticLatitudeToMercatorAngle(s.south),ce=1/(Pi.geodeticLatitudeToMercatorAngle(s.north)-ye),_e=(Pi.geodeticLatitudeToMercatorAngle(I.latitude)-ye)*ce,xe=f.geodeticSurfaceNormalCartographic(UT,kX),De=Mn.octEncode(xe,NX),Ae=j;B.encode(W,j*k,de.center,z.fromElements(.5,.5,Ju),v,De,_e,xe),++j;let ke=j,ze=ke<256?1:2,tt=(ke-1)*3,wt=tt*ze,_t=(W.length-ke*k)*Float32Array.BYTES_PER_ELEMENT,Be;if(_t>=wt){let Te=ke*k*Float32Array.BYTES_PER_ELEMENT;Be=ke<256?new Uint8Array(W.buffer,Te,tt):new Uint16Array(W.buffer,Te,tt)}else Be=ke<256?new Uint8Array(tt):new Uint16Array(tt);W=new Float32Array(W.buffer,0,ke*k);let Yt=0;for(D=0;D<ke-2;++D)Be[Yt++]=Ae,Be[Yt++]=D,Be[Yt++]=D+1;Be[Yt++]=Ae,Be[Yt++]=D,Be[Yt++]=0;let Et=[];for(D=q;D>=J;--D)Et.push(D);let ut=[];for(D=K;D>=q;--D)ut.push(D);let tn=[];for(D=Q;D>=K;--D)tn.push(D);let Ce=[];for(Ce.push(0),D=Ae-1;D>=Q;--D)Ce.push(D);r.mesh=new md(B.center,W,Be,tt,ke,A,E,ae.fromOrientedBoundingBox(de),Wlt(e,de.center,s,A,E),B.stride,de,B,Et,ut,tn,Ce)}let _=t.context;r._destroyVertexArray(i),r.vertexArray=pd._createVertexArrayForMesh(_,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let S=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=o._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(r.waterMaskTexture=w.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,w,r.waterMaskTranslationAndScale))}l(S)&&(--S.referenceCount,S.referenceCount===0&&S.destroy())}function f8(e,t,n,i,o,r,s,a,c,u,f){let d=UT;d.longitude=P.lerp(t.west,t.east,r),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,ov),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,kX));let m=FX;return m.x=r,m.y=s,n.encode(i,o*n.stride,p,m,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var p8=new se;function p2(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=se.clone(e.rectangle,p8),o.west-=P.TWO_PI,o.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=se.clone(e.rectangle,p8),o.west+=P.TWO_PI,o.east+=P.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,d=(r.north-o.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var klt=new z;function BX(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var Vlt=new z,Ult=new h;function zlt(e,t,n,i,o,r,s,a,c,u){let f=i.encoding,d=i.vertices,p=p2(t,n,f.decodeTextureCoordinates(d,o,Ju),Ju),g=p2(t,n,f.decodeTextureCoordinates(d,r,FX),FX),m;c?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let x=f.decodeHeight(d,o),b=f.decodeHeight(d,r),T=n.rectangle;UT.longitude=P.lerp(T.west,T.east,s),UT.latitude=P.lerp(T.south,T.north,a),u.height=UT.height=P.lerp(x,b,m);let C;if(f.hasVertexNormals){let A=f.getOctEncodedNormal(d,o,klt),E=f.getOctEncodedNormal(d,r,Vlt),v=Mn.octDecode(A.x,A.y,ov),D=Mn.octDecode(E.x,E.y,Ult);C=h.lerp(v,D,m,ov),h.normalize(C,C),Mn.octEncode(C,u.encodedNormal)}else C=e.geodeticSurfaceNormalCartographic(UT,ov),Mn.octEncode(C,u.encodedNormal)}function B0e(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(UT,ov);Mn.octEncode(s,r.encodedNormal)}function d8(e,t,n,i,o,r,s,a,c,u,f){if(N0e(e,t,a,s,!1,n,i,f)||N0e(e,t,u,c,!0,n,i,f))return f;let p;if(VX(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],BX(r,p,n,i,f),f;let g;if(n===0?i===0?g=h8(e.westMeshes,e.westTiles,_n.EAST,e.southMeshes,e.southTiles,_n.NORTH,n,i):g=h8(e.northMeshes,e.northTiles,_n.SOUTH,e.westMeshes,e.westTiles,_n.EAST,n,i):i===0?g=h8(e.southMeshes,e.southTiles,_n.NORTH,e.eastMeshes,e.eastTiles,_n.WEST,n,i):g=h8(e.eastMeshes,e.eastTiles,_n.WEST,e.northMeshes,e.northTiles,_n.SOUTH,n,i),l(g))return B0e(e,t,n,i,g,f),f}function h8(e,t,n,i,o,r,s,a){let c=L0e(e,t,!1,n,s,a),u=L0e(i,o,!0,r,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function m8(e,t,n,i,o,r,s,a,c){for(let u=0;u<r.length;++u)o=Hlt(e,t,n,i,o,r[u],s[u],a,c);return o}function Hlt(e,t,n,i,o,r,s,a,c){let u=r.rectangle;a===_n.EAST&&e.tile.x===0?(u=se.clone(r.rectangle,p8),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===_n.WEST&&r.x===0&&(u=se.clone(r.rectangle,p8),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Ju),d=Ju.x,p=Ju.y);let g,m;switch(a){case _n.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case _n.NORTH:g=s.northIndicesWestToEast,m=!0;break;case _n.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case _n.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let x=r,b=e.tile,T=s.encoding,C=s.vertices,A=n.stride,E,v;T.hasWebMercatorT&&(E=Pi.geodeticLatitudeToMercatorAngle(f.south),v=1/(Pi.geodeticLatitudeToMercatorAngle(f.north)-E));for(let D=0;D<g.length;++D){let O=g[D],R=T.decodeTextureCoordinates(C,O,Ju);p2(x,b,R,R);let M=R.x,N=R.y,_=m?M:N;if(_<0||_>1||Math.abs(M-d)<P.EPSILON5&&Math.abs(N-p)<P.EPSILON5)continue;let S=Math.abs(M)<P.EPSILON5||Math.abs(M-1)<P.EPSILON5,w=Math.abs(N)<P.EPSILON5||Math.abs(N-1)<P.EPSILON5;if(S&&w)continue;let I=T.decodePosition(C,O,ov),L=T.decodeHeight(C,O),B;T.hasVertexNormals?B=T.getOctEncodedNormal(C,O,NX):(B=NX,B.x=0,B.y=0);let U=N;if(T.hasWebMercatorT){let G=P.lerp(f.south,f.north,N);U=(Pi.geodeticLatitudeToMercatorAngle(G)-E)*v}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,kX)),n.encode(i,o*A,I,R,L,B,U,V),c.minimumHeight=Math.min(c.minimumHeight,L),c.maximumHeight=Math.max(c.maximumHeight,L),++o}return o}function L0e(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!VX(d,f))continue;let p;switch(i){case _n.WEST:p=f.westIndicesSouthToNorth;break;case _n.SOUTH:p=f.southIndicesEastToWest;break;case _n.EAST:p=f.eastIndicesNorthToSouth;break;case _n.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function VX(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function N0e(e,t,n,i,o,r,s,a){let c,u,f,d,p,g=i[o?0:n.length-1],m=n[o?0:n.length-1];if(VX(g,m)&&(r===0?s===0?(c=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(c=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):s===0?(c=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(c=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){d=o?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,Ju);let x=p2(g,e.tile,Ju,Ju);if(x.x===r&&x.y===s)return BX(m,p,r,s,a),!0;if(d=Oo(c,u?r:s,function(b,T){m.encoding.decodeTextureCoordinates(m.vertices,b,Ju);let C=p2(g,e.tile,Ju,Ju);return f?u?C.x-r:C.y-s:u?r-C.x:s-C.y}),d<0){if(d=~d,d>0&&d<c.length)return zlt(t,g,e.tile,m,c[d-1],c[d],r,s,u,a),!0}else return BX(m,c[d],r,s,a),!0}return!1}var Glt=[new h,new h,new h,new h];function Wlt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Glt;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var sv=rv;function sr(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=yn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new me,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(sr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(sr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(sr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(sr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new me,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new H(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=se.clone(se.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(sr.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=oe.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){th.setOwner(e,this,"_clippingPolygons")}}});function jlt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}sr.prototype.update=function(e){this._imageryLayers._update()};function qlt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}sr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(jlt)})),qlt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)pd._freeVertexArray(t[i]);t.length=0};sr.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};sr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ac.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ac.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=Ge(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=Ge(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&sv.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let u=0,f=c.length;u<f;++u){let d=c[u],p=d.data.tileBoundingRegion;_ut(this,d,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function H0e(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}sr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)H0e(t[n],e)};sr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};sr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};sr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Yn.CULLED_BUT_NEEDED,o=n.terrainState),pd.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==_r.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,pd.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Ylt=new ae,G0e=new se,Xlt=new se,Klt=new fe;function y8(e,t){if(t.west<t.east)return t;let n=se.clone(t,Xlt);return se.center(e,Klt).longitude>0?n.east=P.PI:n.west=-P.PI,n}function W0e(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!se.equals(e.cartographicLimitRectangle,se.MAX_VALUE))}sr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=W0e(this,t);if(t.fog.enabled&&!o&&P.fog(i,t.fog.density)>=1)return _r.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return _r.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let u=y8(e.rectangle,this.cartographicLimitRectangle),f=se.simpleIntersection(u,e.rectangle,G0e);if(!l(f))return _r.NONE;if(se.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=Ylt,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),h.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(r.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!l(c))return _r.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let b=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=b!==jt.INSIDE,b===jt.OUTSIDE)return _r.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(s);e.isClipped=b!==jt.OUTSIDE}let g,m=a.computeVisibility(c);if(m===jt.OUTSIDE?g=_r.NONE:m===jt.INTERSECTING?g=_r.PARTIAL:m===jt.INSIDE&&(g=_r.FULL),g===_r.NONE)return g;let x=t.mode===ne.SCENE3D&&t.camera.frustum instanceof rn;if(t.mode===ne.SCENE3D&&!x&&l(n)&&!o){let b=r.occludeePointInScaledSpace;return!l(b)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?g:_r.NONE}return g};sr.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Zlt=[],$lt=[];sr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Zlt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===fo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===ai.FAILED||p.state===ai.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=$lt;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:Yn.NONE;if(p===Yn.RENDERED){let g=d.data;if(!l(g))continue;if(!o&&d.data.terrainState===fo.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let x=m[a],b=x.loadingImagery,T=!l(b)||b.state===ai.FAILED||b.state===ai.INVALID,C=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(T&&!i[C])return!1}}else p===Yn.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var Qlt=new h;sr.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=h.subtract(i.center,o,Qlt),a=h.magnitude(s);return a<P.EPSILON5?0:(h.divideByScalar(s,a,s),(1-h.dot(s,r))*e._distance)};var k0e=new F,g8=new F,Jlt=new oe,eut=new oe,tut=new oe,nut=new h,V0e=new h,iut=new h,out=new h;sr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var rut=[new h,new h,new h,new h];function U0e(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=rut;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}sr.prototype.computeDistanceToTile=function(e,t){sut(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-s);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function sut(e,t,n){let i=e.data;i===void 0&&(i=e.data=new pd);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Zf({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)r.minimumHeight=d._minimumHeight,r.maximumHeight=d._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,x=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Er.getHeight(r.minimumHeight,p,g),r.maximumHeight=Er.getHeight(r.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=vn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ae.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=U0e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=U0e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}sr.prototype.isDestroyed=function(){return!1};sr.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function aut(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(o=a[u],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}sr.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,d=0;for(a=0;a<u;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=aut(d,e,n),s.state=ea.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=ea.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Yn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};sr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};sr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};sr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var cut=new F,lut=new F;function z0e(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=F.multiplyByPoint(i,this.properties.rtc,V0e);return F.setTranslation(i,o,k0e),k0e},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=F.multiplyByPoint(i,this.properties.rtc,V0e);return F.setTranslation(i,r,g8),F.multiply(o,g8,g8),g8},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?F.multiply(e.context.uniformState.view,i.modelMatrix,cut):F.IDENTITY;return F.inverseTranspose(o,lut)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new oe(0,0,.5,1),fillHighlightColor:new H(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new z(65e5,9e6),nightFadeDistance:new z(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new F,tileRectangle:new oe,verticalExaggerationAndRelativeHeight:new z(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new z,southMercatorYAndOneOverHeight:new z,waterMask:void 0,waterMaskTranslationAndScale:new oe,minMaxHeight:new z,scaleAndBias:new F,clippingPlanesEdgeColor:H.clone(H.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new oe,frontFaceAlphaByDistance:new oe,backFaceAlphaByDistance:new oe,localizedTranslucencyRectangle:new oe,undergroundColor:H.clone(H.TRANSPARENT),undergroundColorAlphaByDistance:new oe,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?bt(n,t.materialUniformMap):n}function uut(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=fut(e,r,o),i.wireframeVertexArray.mesh=o}}function fut(e,t,n){let o={indices:n.indices,primitiveType:Me.TRIANGLES};Ln.toWireframe(o);let r=o.indices,s=gt.createIndexBuffer({context:e,typedArray:r,usage:Fe.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ei({context:e,attributes:t._attributes,indexBuffer:s})}var j0e,q0e,x8;(function(){let e=new vt({geometry:Vd.fromDimensions({dimensions:new h(2,2,2)})}),t=new vt({geometry:new R_({radius:1})}),n=new F,i,o;function r(s){return new Dn({geometryInstances:s,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})}j0e=function(s,a){return s===i||(x8(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Wt.fromColor(a),o=r(e)),o},q0e=function(s,a){return s===i||(x8(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Wt.fromColor(a),o=r(t)),o},x8=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var dut=new oe(0,0,0,0),hut={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},mut=H.TRANSPARENT,put=new kt;function _ut(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new sv(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let Te=r.credits;for(let it=0,ji=Te.length;it<ji;++it)o.addCreditToNextFrame(Te[it])}let s=Nt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,x=y(e.undergroundColor,mut),b=y(e.undergroundColorAlphaByDistance,put),T=W0e(e,n)&&n.mode===ne.SCENE3D&&x.alpha>0&&(b.nearValue>0||b.farValue>0),C=e.lambertDiffuseMultiplier,A=e.vertexShadowDarkness,E=e.hasWaterMask&&l(a),v=E&&e.showWaterEffect,D=e.oceanNormalMap,O=v&&l(D),R=e.terrainProvider,M=l(R)&&e.terrainProvider.hasVertexNormals,N=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,S=yn.castShadows(e.shadows)&&!d,w=yn.receiveShadows(e.shadows)&&!d,I=e.hueShift,L=e.saturationShift,B=e.brightnessShift,U=!(P.equalsEpsilon(I,0,P.EPSILON7)&&P.equalsEpsilon(L,0,P.EPSILON7)&&P.equalsEpsilon(B,0,P.EPSILON7)),V=!1;if(_){let Te=h.magnitude(n.camera.positionWC),it=e.nightFadeOutDistance;V=Te>it}E&&--s,O&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let G=i.renderedMesh,k=G.center,W=G.encoding,j=i.tileBoundingRegion,J=n.verticalExaggeration,q=n.verticalExaggerationRelativeHeight,K=J!==1,Q=W.hasGeodeticSurfaceNormals,de=Jlt,ye=0,ce=0,_e=0,xe=0,De=!1;if(n.mode!==ne.SCENE3D){let Te=n.mapProjection,it=Te.project(se.southwest(t.rectangle),iut),ji=Te.project(se.northeast(t.rectangle),out);if(de.x=it.x,de.y=it.y,de.z=ji.x,de.w=ji.y,n.mode!==ne.MORPHING&&(k=nut,k.x=0,k.y=(de.z+de.x)*.5,k.z=(de.w+de.y)*.5,de.x-=k.y,de.y-=k.z,de.z-=k.y,de.w-=k.z),n.mode===ne.SCENE2D&&W.quantization===Js.BITS12){let ft=1/(Math.pow(2,12)-1)*.5,yo=(de.z-de.x)*ft,Xo=(de.w-de.y)*ft;de.x-=yo,de.y-=Xo,de.z+=yo,de.w+=Xo}Te instanceof Pi&&(ye=t.rectangle.south,ce=t.rectangle.north,_e=Pi.geodeticLatitudeToMercatorAngle(ye),xe=1/(Pi.geodeticLatitudeToMercatorAngle(ce)-_e),De=!0)}let Ae=hut;Ae.frameState=n,Ae.surfaceTile=i,Ae.hasWaterMask=E,Ae.showReflectiveOcean=v,Ae.showOceanWaves=O,Ae.enableLighting=e.enableLighting,Ae.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ae.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ae.showGroundAtmosphere=_,Ae.atmosphereLightIntensity=e.atmosphereLightIntensity,Ae.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ae.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ae.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ae.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ae.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ae.perFragmentGroundAtmosphere=V,Ae.hasVertexNormals=M,Ae.useWebMercatorProjection=De,Ae.clippedByBoundaries=i.clippedByBoundaries,Ae.hasGeodeticSurfaceNormals=Q,Ae.hasExaggeration=K;let ke=i.imagery,ze=0,tt=ke.length,wt=e.showSkirts&&!u&&!d,_t=e.backFaceCulling&&!u&&!d,Be=_t?e._renderState:e._disableCullingRenderState,Yt=_t?e._blendRenderState:e._disableCullingBlendRenderState,Et=Be,ut=e._firstPassInitialColor,tn=n.context;if(l(e._debug.boundingSphereTile)||x8(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let Te=e._drawCommands.length;for(let it=0;it<Te;++it)e._uniformMaps[it]=z0e(n,e)}do{let Te=0,it,ji;if(e._drawCommands.length<=e._usedDrawCommands?(it=new Ze,it.owner=t,it.cull=!1,it.boundingVolume=new ae,it.orientedBoundingBox=void 0,ji=z0e(n,e),e._drawCommands.push(it),e._uniformMaps.push(ji)):(it=e._drawCommands[e._usedDrawCommands],ji=e._uniformMaps[e._usedDrawCommands]),it.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Ea=j.boundingVolume,Al=j.boundingSphere;l(Ea)?j0e(Ea,H.RED).update(n):l(Al)&&q0e(Al,H.RED).update(n)}let ft=ji.properties;oe.clone(ut,ft.initialColor),ft.oceanNormalMap=D,ft.lightingFadeDistance.x=e.lightingFadeOutDistance,ft.lightingFadeDistance.y=e.lightingFadeInDistance,ft.nightFadeDistance.x=e.nightFadeOutDistance,ft.nightFadeDistance.y=e.nightFadeInDistance,ft.atmosphereLightIntensity=e.atmosphereLightIntensity,ft.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ft.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ft.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ft.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ft.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ft.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let yo=u?g:p,Xo=u?p:g;l(yo)&&(oe.fromElements(yo.near,yo.nearValue,yo.far,yo.farValue,ft.frontFaceAlphaByDistance),oe.fromElements(Xo.near,Xo.nearValue,Xo.far,Xo.farValue,ft.backFaceAlphaByDistance)),oe.fromElements(b.near,b.nearValue,b.far,b.farValue,ft.undergroundColorAlphaByDistance),H.clone(x,ft.undergroundColor),ft.lambertDiffuseMultiplier=C,ft.vertexShadowDarkness=A;let Xa=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Xa&&H.clone(e.fillHighlightColor,ft.fillHighlightColor),ft.verticalExaggerationAndRelativeHeight.x=J,ft.verticalExaggerationAndRelativeHeight.y=q,ft.center3D=G.center,h.clone(k,ft.rtc),oe.clone(de,ft.tileRectangle),ft.southAndNorthLatitude.x=ye,ft.southAndNorthLatitude.y=ce,ft.southMercatorYAndOneOverHeight.x=_e,ft.southMercatorYAndOneOverHeight.y=xe;let Rr=eut,As=y8(t.rectangle,e.cartographicLimitRectangle),Le=tut,ot=y8(t.rectangle,m);h.fromElements(I,L,B,ft.hsbShift);let qe=t.rectangle,Xe=1/qe.width,ht=1/qe.height;Rr.x=(As.west-qe.west)*Xe,Rr.y=(As.south-qe.south)*ht,Rr.z=(As.east-qe.west)*Xe,Rr.w=(As.north-qe.south)*ht,oe.clone(Rr,ft.localizedCartographicLimitRectangle),Le.x=(ot.west-qe.west)*Xe,Le.y=(ot.south-qe.south)*ht,Le.z=(ot.east-qe.west)*Xe,Le.w=(ot.north-qe.south)*ht,oe.clone(Le,ft.localizedTranslucencyRectangle);let Gt=N&&P.fog(t._distance,n.fog.density)>P.EPSILON3;U=U&&(Gt||_);let Tn=!1,Ro=!1,Ao=!1,Ka=!1,Za=!1,Ci=!1,mi=!1,ra=!1,Zr=!1,Cl=!1;for(;Te<s&&ze<tt;){let Ea=ke[ze],Al=Ea.readyImagery;if(++ze,!l(Al)||Al.imageryLayer.alpha===0)continue;let Nc=Ea.useWebMercatorT?Al.textureWebMercator:Al.texture,fs=Al.imageryLayer;l(Ea.textureTranslationAndScale)||(Ea.textureTranslationAndScale=fs._calculateTextureTranslationAndScale(t,Ea)),ft.dayTextures[Te]=Nc,ft.dayTextureTranslationAndScale[Te]=Ea.textureTranslationAndScale,ft.dayTextureTexCoordsRectangle[Te]=Ea.textureCoordinateRectangle,ft.dayTextureUseWebMercatorT[Te]=Ea.useWebMercatorT,ft.dayTextureAlpha[Te]=fs.alpha,Ci=Ci||ft.dayTextureAlpha[Te]!==1,ft.dayTextureNightAlpha[Te]=fs.nightAlpha,mi=mi||ft.dayTextureNightAlpha[Te]!==1,ft.dayTextureDayAlpha[Te]=fs.dayAlpha,mi=mi||ft.dayTextureDayAlpha[Te]!==1,ft.dayTextureBrightness[Te]=fs.brightness,Tn=Tn||ft.dayTextureBrightness[Te]!==Wa.DEFAULT_BRIGHTNESS,ft.dayTextureContrast[Te]=fs.contrast,Ro=Ro||ft.dayTextureContrast[Te]!==Wa.DEFAULT_CONTRAST,ft.dayTextureHue[Te]=fs.hue,Ao=Ao||ft.dayTextureHue[Te]!==Wa.DEFAULT_HUE,ft.dayTextureSaturation[Te]=fs.saturation,Ka=Ka||ft.dayTextureSaturation[Te]!==Wa.DEFAULT_SATURATION,ft.dayTextureOneOverGamma[Te]=1/fs.gamma,Za=Za||ft.dayTextureOneOverGamma[Te]!==1/Wa.DEFAULT_GAMMA,ft.dayTextureSplit[Te]=fs.splitDirection,ra=ra||ft.dayTextureSplit[Te]!==0;let pf=ft.dayTextureCutoutRectangles[Te];if(l(pf)||(pf=ft.dayTextureCutoutRectangles[Te]=new oe),oe.clone(oe.ZERO,pf),l(fs.cutoutRectangle)){let Uo=y8(qe,fs.cutoutRectangle),ln=se.simpleIntersection(Uo,qe,G0e);Zr=l(ln)||Zr,pf.x=(Uo.west-qe.west)*Xe,pf.y=(Uo.south-qe.south)*ht,pf.z=(Uo.east-qe.west)*Xe,pf.w=(Uo.north-qe.south)*ht}let _f=ft.colorsToAlpha[Te];l(_f)||(_f=ft.colorsToAlpha[Te]=new oe);let gf=l(fs.colorToAlpha)&&fs.colorToAlphaThreshold>0;if(Cl=Cl||gf,gf){let Uo=fs.colorToAlpha;_f.x=Uo.red,_f.y=Uo.green,_f.z=Uo.blue,_f.w=fs.colorToAlphaThreshold}else _f.w=-1;if(l(Al.credits)){let Uo=Al.credits;for(let ln=0,Ee=Uo.length;ln<Ee;++ln)o.addCreditToNextFrame(Uo[ln])}++Te}ft.dayTextures.length=Te,ft.waterMask=a,oe.clone(c,ft.waterMaskTranslationAndScale),ft.minMaxHeight.x=W.minimumHeight,ft.minMaxHeight.y=W.maximumHeight,F.clone(W.matrix,ft.scaleAndBias);let xo=e._clippingPlanes,Or=l(xo)&&xo.enabled&&t.isClipped;Or&&(ft.clippingPlanesEdgeColor=H.clone(xo.edgeColor,ft.clippingPlanesEdgeColor),ft.clippingPlanesEdgeWidth=xo.edgeWidth);let xp=e._clippingPolygons,$r=l(xp)&&xp.enabled&&t.isClipped;Ae.numberOfDayTextures=Te,Ae.applyBrightness=Tn,Ae.applyContrast=Ro,Ae.applyHue=Ao,Ae.applySaturation=Ka,Ae.applyGamma=Za,Ae.applyAlpha=Ci,Ae.applyDayNightAlpha=mi,Ae.applySplit=ra,Ae.enableFog=Gt,Ae.enableClippingPlanes=Or,Ae.clippingPlanes=xo,Ae.enableClippingPolygons=$r,Ae.clippingPolygons=xp,Ae.hasImageryLayerCutout=Zr,Ae.colorCorrect=U,Ae.highlightFillTile=Xa,Ae.colorToAlpha=Cl,Ae.showUndergroundColor=T,Ae.translucent=d;let mf=i.renderedMesh.indices.length;wt||(mf=i.renderedMesh.indexCountWithoutSkirts),it.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ae),it.castShadows=S,it.receiveShadows=w,it.renderState=Et,it.primitiveType=Me.TRIANGLES,it.vertexArray=i.vertexArray||i.fill.vertexArray,it.count=mf,it.uniformMap=ji,it.pass=we.GLOBE,e._debug.wireframe&&(uut(tn,e,t),l(i.wireframeVertexArray)&&(it.vertexArray=i.wireframeVertexArray,it.primitiveType=Me.LINES,it.count=mf*2));let $a=it.boundingVolume,ex=it.orientedBoundingBox;n.mode!==ne.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,j.minimumHeight,j.maximumHeight,$a),h.fromElements($a.center.z,$a.center.x,$a.center.y,$a.center),n.mode===ne.MORPHING&&($a=ae.union(j.boundingSphere,$a,$a))):(it.boundingVolume=ae.clone(j.boundingSphere,$a),it.orientedBoundingBox=vn.clone(j.boundingVolume,ex)),it.dirty=!0,d&&f.updateDerivedCommands(it,n),H0e(it,n),Et=Yt,ut=dut}while(ze<tt)}var _2=sr;function Y0e(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=se.clone(se.MAX_VALUE)}Object.defineProperties(Y0e.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=kt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=kt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=se.clone(se.MAX_VALUE)),se.clone(e,this._rectangle)}}});var g2=Y0e;function Bs(){this._layers=[],this.layerAdded=new me,this.layerRemoved=new me,this.layerMoved=new me,this.layerShownOrHidden=new me}Object.defineProperties(Bs.prototype,{length:{get:function(){return this._layers.length}}});Bs.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Bs.prototype.addImageryProvider=function(e,t){let n=new Wa(e);return this.add(n,t),n};Bs.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Bs.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Bs.prototype.contains=function(e){return this.indexOf(e)!==-1};Bs.prototype.indexOf=function(e){return this._layers.indexOf(e)};Bs.prototype.get=function(e){return this._layers[e]};function b8(e,t){return e.indexOf(t)}function X0e(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Bs.prototype.raise=function(e){let t=b8(this._layers,e);X0e(this,t,t+1)};Bs.prototype.lower=function(e){let t=b8(this._layers,e);X0e(this,t,t-1)};Bs.prototype.raiseToTop=function(e){let t=b8(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Bs.prototype.lowerToBottom=function(e){let t=b8(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var gut=new se;function K0e(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];se.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!se.contains(u.rectangle,t))continue;let d=gut,p=1/1024;d.west=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),se.contains(d,t)&&i(u)}}Bs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(K0e(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Bs.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(K0e(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=r[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};Bs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Bs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Bs.prototype.isDestroyed=function(){return!1};Bs.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Bs.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var y2=Bs;function Z0e(e){this._ellipsoid=new z_(e.ellipsoid,h.ZERO)}Object.defineProperties(Z0e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var x2=Z0e;function _l(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Yn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=ea.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}_l.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new _l({tilingScheme:e,x:s,y:r,level:0});return i};_l.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],se.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],se.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(_l.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new _l({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new _l({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new _l({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new _l({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<ea.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});_l.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};_l.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};_l.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};_l.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};_l.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};_l.prototype.freeResources=function(){this.state=ea.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),T8(this._southwestChild),this._southwestChild=void 0,T8(this._southeastChild),this._southeastChild=void 0,T8(this._northwestChild),this._northwestChild=void 0,T8(this._northeastChild),this._northeastChild=void 0};function T8(e){l(e)&&e.freeResources()}var b2=_l;function C8(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}C8.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};C8.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),$0e(this,t)),t=i}};function $0e(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}C8.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&$0e(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var T2=C8;function gd(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new T2,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new x2({ellipsoid:n}),this._tileLoadProgressEvent=new me,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(gd.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});gd.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function yut(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,J0e(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}gd.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==ea.START&&e(t),t=t.replacementNext};gd.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};gd.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};gd.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function J0e(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}gd.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(yut(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),J0e(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};gd.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Cut(this,e),Out(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function xut(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=me.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}gd.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(Dut(this,e),Rut(this,e),xut(this,e))};gd.prototype.isDestroyed=function(){return!1};gd.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var A2,Q0e=new fe;function but(e,t){let n=se.center(e.rectangle,Q0e),i=n.longitude-A2.longitude,o=n.latitude-A2.latitude;n=se.center(t.rectangle,Q0e);let r=n.longitude-A2.longitude,s=n.latitude-A2.latitude;return i*i+o*o-(r*r+s*s)}var Tut=new h,C2=[];function Cut(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles)){let x=r.tilingScheme;if(l(x)){let b=r.tilingScheme;e._levelZeroTiles=b2.createLevelZeroTiles(b);let T=e._levelZeroTiles.length;if(C2.length<T)for(C2=new Array(T),o=0;o<T;++o)C2[o]===void 0&&(C2[o]=new E2)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;A2=t.camera.positionCartographic,a.sort(but);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(d,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let m=F.getTranslation(g.transform,Tut);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?ja(e,s,r,t,c,!1,C2[o]):(mg(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function mg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function E2(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function exe(){this.southwest=new E2,this.southeast=new E2,this.northwest=new E2,this.northeast=new E2}exe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var HX=new Array(31);for(let e=0;e<HX.length;++e)HX[e]=new exe;function Aut(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=vut(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:Yn.NONE,g=e.tileProvider;if(s||i){let m=Yn.originalResult(p)===Yn.RENDERED,x=Yn.originalResult(p)===Yn.CULLED||p===Yn.NONE,b=n.state===ea.DONE,T=m||x||b;if(T||l(g.canRenderWithoutLosingDetail)&&(T=g.canRenderWithoutLosingDetail(n)),T){s&&mg(e,e._tileLoadQueueMedium,n,t),A8(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&mg(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){A8(e,n),mg(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.REFINED;let x=e._tilesToRender.length,b=e._tileLoadQueueLow.length,T=e._tileLoadQueueMedium.length,C=e._tileLoadQueueHigh.length,A=e._tileToUpdateHeights.length;if(Eut(e,a,c,u,f,t,i,o),x!==e._tilesToRender.length){let E=o.allAreRenderable,v=o.anyWereRenderedLastFrame,D=o.notYetRenderableCount,O=!1;if(!E&&!v){let R=e._tilesToRender;for(let N=x;N<R.length;++N){let _=R[N];for(;_!==void 0&&_._lastSelectionResult!==Yn.KICKED&&_!==n;)_._lastSelectionResult=Yn.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=A,A8(e,n),n._lastSelectionResult=Yn.RENDERED;let M=p===Yn.RENDERED;!M&&D>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=T,e._tileLoadQueueHigh.length=C,mg(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,O=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=M,M||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!O&&mg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,A8(e,n),mg(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Eut(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=HX[t.level],p=d.southwest,g=d.southeast,m=d.northwest,x=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(ja(e,t,u,r,f,s,p),ja(e,n,u,r,f,s,g),ja(e,i,u,r,f,s,m),ja(e,o,u,r,f,s,x)):(ja(e,i,u,r,f,s,m),ja(e,t,u,r,f,s,p),ja(e,o,u,r,f,s,x),ja(e,n,u,r,f,s,g)):c.latitude<t.rectangle.north?(ja(e,n,u,r,f,s,g),ja(e,t,u,r,f,s,p),ja(e,o,u,r,f,s,x),ja(e,i,u,r,f,s,m)):(ja(e,o,u,r,f,s,x),ja(e,i,u,r,f,s,m),ja(e,n,u,r,f,s,g),ja(e,t,u,r,f,s,p)),d.combine(a)}function Sut(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&se.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&se.contains(n,e._cameraReferenceFrameOriginCartographic)}function ja(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==_r.NONE)return Aut(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Sut(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&mg(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Yn.NONE;c!==Yn.CULLED_BUT_NEEDED&&c!==Yn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Yn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(mg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Yn.CULLED):t._lastSelectionResult=Yn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function vut(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof rn||t.camera.frustum instanceof Fr)return wut(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=P.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function wut(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function A8(e,t){e._tilesToRender.push(t)}function Dut(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=bi()+e._loadQueueTimeSlice,s=e._tileProvider,a=UX(e,t,s,r,n,!1);a=UX(e,t,s,r,i,a),UX(e,t,s,r,o,a)}function Iut(e,t){return e._loadPriority-t._loadPriority}function UX(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(Iut);for(let s=0,a=o.length;s<a&&(bi()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var av=new mn,zX=new fe,I0=new h,Put=[];function Rut(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Put;n.length=0;let i=e._tileToUpdateHeights,o=bi(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let x=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:Yn.NONE;(x===Yn.RENDERED||x===Yn.CULLED_BUT_NEEDED)&&n.push(d),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,g=p.length,m=!1;for(f=e._lastTileIndex;f<g;++f){let x=p[f],b=d.data.terrainData,T=l(b)&&b.wasCreatedByUpsampling();if(d.level>x.level&&!T){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=h.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let A=u.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,av.direction),E=u.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,av.origin);if(!l(E)){let v=0;l(d.data.tileBoundingRegion)&&(v=d.data.tileBoundingRegion.minimumHeight);let D=Math.min(v,-11500),O=h.multiplyByScalar(A,Math.abs(D)+1,I0);h.subtract(x.positionOnEllipsoidSurface,O,av.origin)}}else fe.clone(x.positionCartographic,zX),zX.height=-11500,c.project(zX,I0),h.fromElements(I0.z,I0.x,I0.y,I0),h.clone(I0,av.origin),h.clone(h.UNIT_X,av.direction);let C=d.data.pick(av,a,c,!1,I0);l(C)&&(l(x.callback)&&x.callback(C),x.level=d.level)}if(bi()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Out(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var S2=gd;function Vh(e){e=y(e,ee.default);let t=new ep({ellipsoid:e}),n=new y2;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new n2,this._material=void 0,this._surface=new S2({tileProvider:new _2({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new me,this._undergroundColor=H.clone(H.BLACK),this._undergroundColorAlphaByDistance=new kt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new g2,WX(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Se({url:nn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ee.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=P.PI*e.minimumRadius,this.nightFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*P.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=yn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Vh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=se.clone(se.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&WX(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,WX(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=H.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=kt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function WX(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Bd,cA];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(LP),e._surfaceShaderSet.baseVertexShaderSource=new Ue({sources:[Bd,cA,NP],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ue({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Mut(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),o=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var Lut=[],Nut={start:0,stop:0};Vh.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=Lut;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(o!==ne.SCENE3D)p.pickBoundingSphere=g=ae.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),h.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let m=$n.raySphere(e,g,Nut);l(m)&&s.push(p)}s.sort(Mut(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(d));++f);return d};var Fut=new fe;Vh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Fut);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var But=new h,txe=new h,kut=new fe,Vut=new mn;function GX(e,t){return l(e)&&se.contains(e.rectangle,t)?e:void 0}Vh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!se.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=GX(n._southwestChild,e)||GX(n._southeastChild,e)||GX(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,But),u=Vut,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(y(g,0),-11500),x=h.multiplyByScalar(f,Math.abs(m)+1,txe);h.subtract(c,x,u.origin)}let p=n.data.pick(u,void 0,s,!1,txe);if(l(p))return a.cartesianToCartographic(p,kut).height};Vh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Vh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Pt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ne.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Vh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Vh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Vh.prototype.isDestroyed=function(){return!1};Vh.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var v2=Vh;function Uut(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var w2=Uut;var pxe={},zut=32.184,Hut=2451545,nxe=-.0529921,ixe=-.1059842,oxe=13.0120009,rxe=13.3407154,sxe=.9856003,axe=26.4057084,cxe=13.064993,lxe=.3287146,uxe=1.7484877,fxe=-.1589763,dxe=.0036096,hxe=.1643573,mxe=12.9590088,jX=new Z;pxe.ComputeMoon=function(e,t){l(e)||(e=Z.now()),jX=Z.addSeconds(e,zut,jX);let n=Z.totalDays(jX)-Hut,i=n/qn.DAYS_PER_JULIAN_CENTURY,o=(125.045+nxe*n)*P.RADIANS_PER_DEGREE,r=(250.089+ixe*n)*P.RADIANS_PER_DEGREE,s=(260.008+oxe*n)*P.RADIANS_PER_DEGREE,a=(176.625+rxe*n)*P.RADIANS_PER_DEGREE,c=(357.529+sxe*n)*P.RADIANS_PER_DEGREE,u=(311.589+axe*n)*P.RADIANS_PER_DEGREE,f=(134.963+cxe*n)*P.RADIANS_PER_DEGREE,d=(276.617+lxe*n)*P.RADIANS_PER_DEGREE,p=(34.226+uxe*n)*P.RADIANS_PER_DEGREE,g=(15.134+fxe*n)*P.RADIANS_PER_DEGREE,m=(119.743+dxe*n)*P.RADIANS_PER_DEGREE,x=(239.961+hxe*n)*P.RADIANS_PER_DEGREE,b=(25.053+mxe*n)*P.RADIANS_PER_DEGREE,T=Math.sin(o),C=Math.sin(r),A=Math.sin(s),E=Math.sin(a),v=Math.sin(c),D=Math.sin(u),O=Math.sin(f),R=Math.sin(d),M=Math.sin(p),N=Math.sin(g),_=Math.sin(m),S=Math.sin(x),w=Math.sin(b),I=Math.cos(o),L=Math.cos(r),B=Math.cos(s),U=Math.cos(a),V=Math.cos(c),G=Math.cos(u),k=Math.cos(f),W=Math.cos(d),j=Math.cos(p),J=Math.cos(g),q=Math.cos(m),K=Math.cos(x),Q=Math.cos(b),de=(269.9949+.0031*i-3.8787*T-.1204*C+.07*A-.0172*E+.0072*D-.0052*N+.0043*w)*P.RADIANS_PER_DEGREE,ye=(66.5392+.013*i+1.5419*I+.0239*L-.0278*B+.0068*U-.0029*G+9e-4*k+8e-4*J-9e-4*Q)*P.RADIANS_PER_DEGREE,ce=(38.3213+13.17635815*n-14e-13*n*n+3.561*T+.1208*C-.0642*A+.0158*E+.0252*v-.0066*D-.0047*O-.0046*R+.0028*M+.0052*N+.004*_+.0019*S-.0044*w)*P.RADIANS_PER_DEGREE,_e=(13.17635815-14e-13*(2*n)+3.561*I*nxe+.1208*L*ixe-.0642*B*oxe+.0158*U*rxe+.0252*V*sxe-.0066*G*axe-.0047*k*cxe-.0046*W*lxe+.0028*j*uxe+.0052*J*fxe+.004*q*dxe+.0019*K*hxe-.0044*Q*mxe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new w2),t.rightAscension=de,t.declination=ye,t.rotation=ce,t.rotationRate=_e,t};var D2=pxe;function _xe(e){(!l(e)||typeof e!="function")&&(e=D2.ComputeMoon),this._computeFunction=e}var Gut=new h,Wut=new h,jut=new h;function qut(e,t,n){let i=Gut;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=jut;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,Wut);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var Yut=new $,Xut=new Oe;_xe.prototype.evaluate=function(e,t){l(e)||(e=Z.now());let n=this._computeFunction(e),i=qut(n.rightAscension,n.declination,t),o=P.zeroToTwoPi(n.rotation),r=Oe.fromAxisAngle(h.UNIT_Z,o,Xut),s=$.fromQuaternion(Oe.conjugate(r,r),Yut);return $.multiply(s,i,i)};var I2=_xe;var qX={position:0};function E8(e){e=y(e,y.EMPTY_OBJECT),this.center=h.clone(y(e.center,h.ZERO)),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new ae,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=y(e.show,!0),this.material=y(e.material,Yi.fromType(Yi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new Ze({owner:y(e._owner,this)}),this._pickCommand=new Ze({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function Kut(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ia.createGeometry(Ia.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Ie.POSITION_ONLY}));return t=ei.fromGeometry({context:e,geometry:n,attributeLocations:qX,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}E8.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Kut(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!F.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),F.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(r),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Ue({sources:[aA]}),p=new Ue({sources:[this.material.shaderSource,sA]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:qX}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=bt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?we.TRANSLUCENT:we.OPAQUE,g.push(f)),m.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new Ue({sources:[aA]}),p=new Ue({sources:[this.material.shaderSource,sA],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:qX}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=bt(bt(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?we.TRANSLUCENT:we.OPAQUE,g.push(x)}};E8.prototype.isDestroyed=function(){return!1};E8.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var P2=E8;function R2(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=nn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,ee.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new P2({radii:this.ellipsoid.radii,material:Yi.fromType(Yi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new I2}Object.defineProperties(R2.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var S8=new $,Zut=new $,$ut=new h,v8=[];R2.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Mt.computeIcrfToFixedMatrix(n,S8))||Mt.computeTemeToPseudoFixedMatrix(n,S8);let i=this._axes.evaluate(n,Zut);$.transpose(i,i),$.multiply(S8,i,i);let o=jg.computeMoonPositionInEarthInertialFrame(n,$ut);$.multiplyByVector(S8,o,o),F.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=v8,v8.length=0,t.update(e),e.commandList=r,v8.length===1?v8[0]:void 0};R2.prototype.isDestroyed=function(){return!1};R2.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var O2=R2;var YX=[],XX=[];function Qut(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=YX,u=XX,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[o+d+1];f=0,d=0;for(let p=i;p<=r;++p){let g=c[f],m=u[d];f<s&&(d>=a||t(g,m,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=m,++d)}}function KX(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);KX(e,t,n,i,r),KX(e,t,n,r+1,o),Qut(e,t,n,i,r,o)}function Jut(e,t,n){let i=e.length,o=Math.ceil(i*.5);YX.length=o,XX.length=o,KX(e,t,n,0,i-1),YX.length=0,XX.length=0}var pg=Jut;function Dc(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var w8=new h;Object.defineProperties(Dc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,w8),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,w8);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,w8),w8)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Dc.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Dc(e,t)};var yxe=new h;Dc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,yxe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var eft=new h;Dc.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,eft),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,yxe),o=this._occluderRadius-n;if(o=h.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),o*o+n*n>h.magnitudeSquared(i)):!1;if(o>0){i=h.subtract(t,this._cameraPosition,i);let r=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var tft=new h;Dc.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return _r.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,tft),o=this._occluderRadius-n,r=h.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return o*o+n*n<s?_r.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?_r.FULL:_r.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?_r.PARTIAL:_r.FULL))}}return _r.NONE};var D8=new h;Dc.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,s=n.length,a=h.normalize(h.subtract(i,o,D8),D8),c=-h.dot(a,o),u=Dc._anyRotationVector(o,a,c),f=Dc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=Dc._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=r/f;return h.add(o,h.multiplyByScalar(a,p,D8),D8)};var nft=[];Dc.computeOccludeePointFromRectangle=function(e,t){t=y(t,ee.default);let n=se.subsample(e,t,0,nft),i=ae.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return Dc.computeOccludeePoint(new ae(o,t.minimumRadius),i.center,n)};var ift=new h;Dc._anyRotationVector=function(e,t,n){let i=h.abs(t,ift),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new h,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,r),i),e,i),i)};var oft=new h;Dc._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,oft);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let s=h.cross(t,r,r);if(h.magnitude(s)>P.EPSILON13)return h.normalize(s,new h)}return o};var ZX=new h,rft=new h,I8=new h,gxe=new h;Dc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,ZX),s=h.clone(e.center,rft),a=e.radius,c=h.subtract(s,r,I8),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),b=p*m*p;c=h.normalize(c,c);let T=h.add(r,h.multiplyByScalar(c,b,gxe),gxe),C=Math.sqrt(d-b*b),A=this._rotationVector(s,t,n,r,i),E=h.fromElements(A.x*A.x*c.x+(A.x*A.y-A.z)*c.y+(A.x*A.z+A.y)*c.z,(A.x*A.y+A.z)*c.x+A.y*A.y*c.y+(A.y*A.z-A.x)*c.z,(A.x*A.z-A.y)*c.x+(A.y*A.z+A.x)*c.y+A.z*A.z*c.z,ZX);E=h.normalize(E,E);let v=h.multiplyByScalar(E,C,ZX);A=h.normalize(h.subtract(h.add(T,v,I8),s,I8),I8);let D=h.dot(t,A);A=h.normalize(h.subtract(h.subtract(T,v,A),s,A),A);let O=h.dot(t,A);return D<O?D:O};var M2=Dc;function ip(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new _s,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function $X(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(ip.prototype,{projectionMatrix:{get:function(){return $X(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return $X(this),this._infinitePerspective}}});var sft=new h,aft=new h,cft=new h,lft=new h;ip.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,sft),d=aft;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=cft;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=lft;h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new oe),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new oe),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new oe),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new oe),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new oe),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new oe),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};ip.prototype.getPixelDimensions=function(e,t,n,i,o){$X(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};ip.prototype.clone=function(e){return l(e)||(e=new ip),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};ip.prototype.equals=function(e){return l(e)&&e instanceof ip&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};ip.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof ip&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var gl=ip;function nu(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new gl,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}nu.packedLength=6;nu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};nu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new nu),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Uh(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(nu.prototype,{projectionMatrix:{get:function(){return Uh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Uh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Uh(this),this._fovy}},sseDenominator:{get:function(){return Uh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Uh(this),this._offCenterFrustum}}});nu.prototype.computeCullingVolume=function(e,t,n){return Uh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};nu.prototype.getPixelDimensions=function(e,t,n,i,o){return Uh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};nu.prototype.clone=function(e){return l(e)||(e=new nu),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};nu.prototype.equals=function(e){return!l(e)||!(e instanceof nu)?!1:(Uh(this),Uh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};nu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof nu)?!1:(Uh(this),Uh(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var wi=nu;function L2(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(L2.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function uft(e,t,n){let i=t.createViewportQuadCommand(bP,{framebuffer:n,renderState:Ve.fromCache({viewport:new je(0,0,256,256)})});e._drawCommand=i}L2.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Pt({context:t,width:256,height:256,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:$t.NEAREST});this._colorTexture=n;let i=new Nr({context:t,colorTextures:[n],destroyAttachments:!1});uft(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};L2.prototype.isDestroyed=function(){return!1};L2.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var N2=L2;var Cxe={};function fft(e,t,n){let i,o,r;if(e instanceof wi){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof gl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var dft=new h,xxe=new h;function Axe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-r)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(o){return P.lerp(e,t,o)}}function JX(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,dft),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),xxe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),xxe));r=Math.min(fft(d,g,m)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return P.lerp(n,i,a)}}function F2(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var Exe=new h;function hft(e,t,n,i,o,r,s,a){let c=e.camera,u=h.clone(c.position,Exe),f=c.pitch,d=F2(c.heading,i),p=F2(c.roll,r),g=JX(c,n,u.z,n.z,s),m=Axe(f,o,g,a);function x(b){let T=b.time/t;c.setView({orientation:{heading:P.lerp(d,i,T),pitch:m(T),roll:P.lerp(p,r,T)}}),z.lerp(u,n,T,c.position),c.position.z=g(T)}return x}function mft(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function pft(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var _ft=new fe,gft=new fe;function yft(e,t,n,i,o,r,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=fe.clone(f.positionCartographic,_ft),m=f.pitch,x=F2(f.heading,i),b=F2(f.roll,r),T=p.cartesianToCartographic(n,gft);g.longitude=P.zeroToTwoPi(g.longitude),T.longitude=P.zeroToTwoPi(T.longitude);let C=!1;if(l(a)){let D=P.zeroToTwoPi(a),O=Math.min(g.longitude,T.longitude),R=Math.max(g.longitude,T.longitude),M=D>=O&&D<=R;if(l(c)){let N=Math.abs(g.longitude-T.longitude),_=P.TWO_PI-N;(M?N:_)<(M?_:N)*c&&!M&&(C=!0)}else M||(C=!0)}C?mft(g,T):pft(g,T);let A=JX(f,n,g.height,T.height,s),E=Axe(m,o,A,u);function v(){let D=g.longitude,O=T.longitude,R=g.latitude,M=T.latitude;return function(_){let S=_.time/t,w=h.fromRadians(P.lerp(D,O,S),P.lerp(R,M,S),A(S),p);f.setView({destination:w,orientation:{heading:P.lerp(x,i,S),pitch:E(S),roll:P.lerp(b,r,S)}})}}return v()}function xft(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,Exe),u=F2(a.heading,i),f=a.frustum.right-a.frustum.left,d=JX(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:P.lerp(u,i,m)}}),z.lerp(c,n,m,a.position);let x=d(m),b=a.frustum,T=b.top/b.right,C=(x-(b.right-b.left))*.5;b.right+=C,b.left-=C,b.top=T*b.right,b.bottom=-b.top}return p}var bxe=new fe,bft=new h;function QX(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Txe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Cxe.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ne.MORPHING)return QX();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;o&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,bxe),n=r.project(bxe,bft));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let x=y(t.heading,0),b=y(t.pitch,-P.PI_OVER_TWO),T=y(t.roll,0),C=e.screenSpaceCameraController;C.enableInputs=!1;let A=Txe(C,t.complete),E=Txe(C,t.cancel),v=p.frustum,D=e.mode===ne.SCENE2D;if(D=D&&z.equalsEpsilon(p.position,n,P.EPSILON6),D=D&&P.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,P.EPSILON6),D=D||e.mode!==ne.SCENE2D&&h.equalsEpsilon(n,p.position,P.EPSILON10),D=D&&P.equalsEpsilon(P.negativePiToPi(x),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(b),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(T),P.negativePiToPi(p.roll),P.EPSILON10),D)return QX(A,E);let O=new Array(4);if(O[ne.SCENE2D]=xft,O[ne.SCENE3D]=yft,O[ne.COLUMBUS_VIEW]=hft,m<=0)return QX(function(){O[i](e,1,n,x,b,T,a,c,u,f)({time:1}),typeof A=="function"&&A()},E);let R=O[i](e,m,n,x,b,T,a,c,u,f);if(!l(d)){let M=p.positionCartographic.height,N=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;M>N&&M>11500?d=Kr.CUBIC_OUT:d=Kr.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:A,cancel:E}};var B2=Cxe;var Tft={ROTATE:0,INFINITE_SCROLL:1},iu=Object.freeze(Tft);function en(e){this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new fe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new me,this._moveEnd=new me,this._changed=new me,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new F,this._invViewMatrix=new F,Oxe(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new fe(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,Wxe(this,en.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*en.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}en.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);en.TRANSFORM_2D_INVERSE=F.inverseTransformation(en.TRANSFORM_2D,new F);en.DEFAULT_VIEW_RECTANGLE=se.fromDegrees(-95,-20,-70,90);en.DEFAULT_VIEW_FACTOR=.5;en.DEFAULT_OFFSET=new ld(0,-P.PI_OVER_FOUR,0);function Oxe(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Cft(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=bi()):e.timeSinceMoved=Math.max(bi()-e._lastMovedTimestamp,0)/1e3}}en.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};en.prototype._updateCameraChanged=function(){let e=this;if(Cft(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%P.TWO_PI;s=s>P.PI?P.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,x=e._changedFrustum,b=p.x+m.left,T=p.x+m.right,C=g.x+x.left,A=g.x+x.right,E=p.y+m.bottom,v=p.y+m.top,D=g.y+x.bottom,O=g.y+x.top,R=Math.max(b,C),M=Math.min(T,A),N=Math.max(E,D),_=Math.min(v,O),S;if(R>=M||N>=v)S=1;else{let w=x;b<C&&T>A&&E<D&&v>O&&(w=m),S=1-(M-R)*(_-N)/((w.right-w.left)*(w.top-w.bottom))}S>t&&(e._changed.raiseEvent(S),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=P.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function Aft(e){Mt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Eft=new fe,Sft=new h,P8=new h,vft=new oe,wft=new oe,Dft=new oe,Ift=new oe,Pft=new oe;function Rft(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,vft),o=n.cartesianToCartographic(i,Eft),r=t.project(o,Sft),s=wft;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=oe.clone(oe.UNIT_X,Pft),c=oe.add(F.getColumn(e._transform,0,P8),i,P8);n.cartesianToCartographic(c,o),t.project(o,r);let u=Dft;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=Ift;if(h.magnitudeSquared(u)>P.EPSILON10)h.cross(a,u,f);else{let d=oe.add(F.getColumn(e._transform,1,P8),i,P8);n.cartesianToCartographic(d,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<P.EPSILON10&&(oe.clone(oe.UNIT_Y,u),oe.clone(oe.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),F.setColumn(e._actualTransform,0,u,e._actualTransform),F.setColumn(e._actualTransform,1,f,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var eK=new h;function Pc(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!h.equals(o,e.position)||n;r&&(o=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone(en.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?Aft(e):Rft(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=F.multiplyByPoint(g,o,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=eK;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===ne.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,eK));if(Math.abs(1-m)>P.EPSILON2){let x=1/h.magnitudeSquared(c),b=h.dot(c,s)*x,T=h.multiplyByScalar(s,b,eK);c=h.normalize(h.subtract(c,T,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=F.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=F.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=F.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||u||d||p)&&Oxe(e)}function Mxe(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function Lxe(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function Nxe(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var M8=new F,L8=new F;Object.defineProperties(en.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Pc(this),this._invTransform}},viewMatrix:{get:function(){return Pc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Pc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Pc(this),this._positionCartographic}},positionWC:{get:function(){return Pc(this),this._positionWC}},directionWC:{get:function(){return Pc(this),this._directionWC}},upWC:{get:function(){return Pc(this),this._upWC}},rightWC:{get:function(){return Pc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,M8),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,L8);this._setTransform(n);let i=Mxe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,M8),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,L8);this._setTransform(n);let i=Lxe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,M8),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,L8);this._setTransform(n);let i=Nxe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});en.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===ne.SCENE2D&&Vxe(this,this.position)};var Oft=new h,Mft=new h,Lft=new h;en.prototype._setTransform=function(e){let t=h.clone(this.positionWC,Oft),n=h.clone(this.upWC,Mft),i=h.clone(this.directionWC,Lft);F.clone(e,this._transform),this._transformChanged=!0,Pc(this);let o=this._actualInvTransform;F.multiplyByPoint(o,t,this.position),F.multiplyByPointAsVector(o,i,this.direction),F.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),Pc(this)};var Nft=new z,Fft=new mn,Bft=new h,kft=new h;function Fxe(e){if(!F.equals(F.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=Nft;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,Fft);o=n.pickWorldCoordinates(a,t,!0,Bft)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,kft));let s;if(l(o)||l(r)){let a=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}en.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof rn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Fxe(this)))};var N8=new h,rK=new F,Vft=new F,sK=new Oe,aK=new $,Bxe=new fe;function Uft(e,t,n){let i=F.clone(e.transform,rK),o=Mt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Vft);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let r=Oe.fromHeadingPitchRoll(n,sK),s=$.fromQuaternion(r,aK);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function zft(e,t,n,i){let o=F.clone(e.transform,rK);if(e._setTransform(F.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Bxe);t=a.project(c,N8)}h.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let r=Oe.fromHeadingPitchRoll(n,sK),s=$.fromQuaternion(r,aK);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Hft(e,t,n,i){let o=F.clone(e.transform,rK);if(e._setTransform(F.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,Bxe);t=c.project(u,N8)}z.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===iu.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let r=Oe.fromHeadingPitchRoll(n,sK),s=$.fromQuaternion(r,aK);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Gft=new h,Wft=new h,jft=new h;function kxe(e,t,n,i){let o=h.clone(n.direction,Gft),r=h.clone(n.up,Wft);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Mt.eastNorthUpToFixedFrame(t,a,M8),u=F.inverseTransformation(c,L8);F.multiplyByPointAsVector(u,o,o),F.multiplyByPointAsVector(u,r,r)}let s=h.cross(o,r,jft);return i.heading=Mxe(o,r),i.pitch=Lxe(o),i.roll=Nxe(o,r,s),i}var oK={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},cv=new va;en.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,h.clone(this.positionWC,N8));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,N8),i=!1),l(t.direction)&&(t=kxe(this,o,t,oK.orientation)),cv.heading=y(t.heading,0),cv.pitch=y(t.pitch,-P.PI_OVER_TWO),cv.roll=y(t.roll,0),n===ne.SCENE3D?Uft(this,o,cv):n===ne.SCENE2D?Hft(this,o,cv,i):zft(this,o,cv,i)};var qft=new h;en.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:en.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(en.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*en.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,qft).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};en.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new oe),Pc(this),F.multiplyByVector(this._actualInvTransform,e,t)};en.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Pc(this),F.multiplyByPoint(this._actualInvTransform,e,t)};en.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Pc(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};en.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new oe),Pc(this),F.multiplyByVector(this._actualTransform,e,t)};en.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Pc(this),F.multiplyByPoint(this._actualTransform,e,t)};en.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Pc(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function Vxe(e,t){let n=e._scene.mapMode2D===iu.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var Sxe=new h;en.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,Sxe),h.add(n,Sxe,n),this._mode===ne.SCENE2D&&Vxe(this,n),this._adjustOrthographicFrustum(!0)};en.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?F8(this,e):this.move(this.direction,e)};en.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?F8(this,-e):this.move(this.direction,-e)};en.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};en.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};en.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};en.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};en.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,-e)};en.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,e)};en.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,-e)};en.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,e)};var Yft=new Oe,Xft=new $;en.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Oe.fromAxisAngle(e,-n,Yft),o=$.fromQuaternion(i,Xft),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};en.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};en.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Kft=new Oe,Zft=new $;en.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Oe.fromAxisAngle(e,-n,Kft),o=$.fromQuaternion(i,Zft);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};en.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),Uxe(this,e)};en.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),Uxe(this,-e)};var $ft=new h,Qft=new h,Jft=new h,vxe=new h;function Uxe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,P.EPSILON2)){let i=h.normalize(n,$ft),o=h.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,vxe),P.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,Qft),a=h.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=h.dot(i,h.negate(s,vxe)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=h.cross(s,i,Jft);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}en.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),zxe(this,-e)};en.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),zxe(this,e)};function zxe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function F8(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===iu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===iu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Hxe(e,t){e.move(e.direction,t)}en.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?F8(this,e):Hxe(this,e)};en.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?F8(this,-e):Hxe(this,-e)};en.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return h.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var edt=new F;en.prototype.lookAt=function(e,t){let n=this._scene,i=y(n.ellipsoid,ee.default),o=Mt.eastNorthUpToFixedFrame(e,i,edt);this.lookAtTransform(o,t)};var tdt=new h,ndt=new Oe,idt=new Oe,odt=new $;function Gxe(e,t,n){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let i=Oe.fromAxisAngle(h.UNIT_Y,-t,ndt),o=Oe.fromAxisAngle(h.UNIT_Z,-e,idt),r=Oe.multiply(o,i,o),s=$.fromQuaternion(r,odt),a=h.clone(h.UNIT_X,tdt);return $.multiplyByVector(s,a,a),h.negate(a,a),h.multiplyByScalar(a,n,a),a}en.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=Gxe(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){z.clone(z.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<P.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(F.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<P.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var k2=new fe,rdt=new fe,sdt=new h,adt=new h,cdt=new h,ldt=new h,udt=new h,fdt=new h,ddt=new h,tK=new h,hdt={direction:new h,right:new h,up:new h},wxe;function Ic(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function Wxe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:hdt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=P.TWO_PI);let f=(c+u)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let M=k2;M.longitude=f,M.latitude=s,M.height=0;let N=rdt;N.longitude=f,N.latitude=a,N.height=0;let _=wxe;(!l(_)||_.ellipsoid!==o)&&(wxe=_=new kp(void 0,void 0,o)),_.setEndPoints(M,N),d=_.interpolateUsingFraction(.5,k2).latitude}let p=k2;p.longitude=f,p.latitude=d,p.height=0;let g=o.cartographicToCartesian(p,ddt),m=k2;m.longitude=u,m.latitude=s;let x=o.cartographicToCartesian(m,sdt);m.longitude=c;let b=o.cartographicToCartesian(m,cdt);m.longitude=f;let T=o.cartographicToCartesian(m,udt);m.latitude=a;let C=o.cartographicToCartesian(m,fdt);m.longitude=u;let A=o.cartographicToCartesian(m,ldt);m.longitude=c;let E=o.cartographicToCartesian(m,adt);h.subtract(b,g,b),h.subtract(A,g,A),h.subtract(x,g,x),h.subtract(E,g,E),h.subtract(T,g,T),h.subtract(C,g,C);let v=o.geodeticSurfaceNormal(g,r.direction);h.negate(v,v);let D=h.cross(v,h.UNIT_Z,r.right);h.normalize(D,D);let O=h.cross(D,v,r.up),R;if(e.frustum instanceof rn){let M=Math.max(h.distance(x,b),h.distance(A,E)),N=Math.max(h.distance(x,A),h.distance(b,E)),_,S,w=e.frustum._offCenterFrustum,I=w.right/w.top,L=N*I;M>L?(_=M,S=_/I):(S=N,_=L),R=Math.max(_,S)}else{let M=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*M;if(R=Math.max(Ic(v,O,b,M),Ic(v,O,A,M),Ic(v,O,x,M),Ic(v,O,E,M),Ic(v,O,T,M),Ic(v,O,C,M),Ic(v,D,b,N),Ic(v,D,A,N),Ic(v,D,x,N),Ic(v,D,E,N),Ic(v,D,T,N),Ic(v,D,C,N)),a<0&&s>0){let _=k2;_.longitude=c,_.latitude=0,_.height=0;let S=o.cartographicToCartesian(_,tK);h.subtract(S,g,S),R=Math.max(R,Ic(v,O,S,M),Ic(v,D,S,N)),_.longitude=u,S=o.cartographicToCartesian(_,tK),h.subtract(S,g,S),R=Math.max(R,Ic(v,O,S,M),Ic(v,D,S,N))}}return h.add(g,h.multiplyByScalar(v,-R,tK),n)}var mdt=new fe,pdt=new h,_dt=new h;function gdt(e,t,n){let i=e._projection;t.west>t.east&&(t=se.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=mdt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,pdt);F.multiplyByPoint(o,a,a),F.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,_dt);if(F.multiplyByPoint(o,c,c),F.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var ydt=new fe,xdt=new h,bdt=new h;function Tdt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===iu.INFINITE_SCROLL?o+=P.TWO_PI:(t=se.MAX_VALUE,o=t.east));let r=ydt;r.longitude=o,r.latitude=t.north;let s=i.project(r,xdt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,bdt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}en.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===ne.SCENE3D)return Wxe(this,e,t);if(n===ne.COLUMBUS_VIEW)return gdt(this,e,t);if(n===ne.SCENE2D)return Tdt(this,e,t)};var Cdt=new mn;function Adt(e,t,n,i){n=y(n,ee.default);let o=e.getPickRay(t,Cdt),r=$n.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return mn.getPoint(o,s,i)}var Edt=new mn;function Sdt(e,t,n,i){let r=e.getPickRay(t,Edt).origin;r=h.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var vdt=new mn;function wdt(e,t,n,i){let o=e.getPickRay(t,vdt),r=-o.origin.x/o.direction.x;mn.getPoint(o,r,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}en.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=y(t,ee.default),this._mode===ne.SCENE3D)n=Adt(this,e,t,n);else if(this._mode===ne.SCENE2D)n=Sdt(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=wdt(this,e,this._projection,n);else return;return n}};var Ddt=new h,Idt=new h,Pdt=new h;function Rdt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,Ddt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,Idt),m=h.multiplyByScalar(e.upWC,f*c*s,Pdt),x=h.add(p,g,n.direction);return h.add(x,m,x),h.subtract(x,d,x),h.normalize(x,x),n}var R8=new h;function Odt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return h.clone(e.position,f),h.multiplyByScalar(e.right,c,R8),h.add(R8,f,f),h.multiplyByScalar(e.up,u,R8),h.add(R8,f,f),h.clone(e.directionWC,n.direction),(e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D)&&h.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}en.prototype.getPickRay=function(e,t){l(t)||(t=new mn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?Rdt(this,e,t):Odt(this,e,t)};var Mdt=new h,Ldt=new h;en.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,Mdt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),Ldt);return Math.max(0,h.magnitude(n)-e.radius)};var Ndt=new z;en.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Ndt);return Math.max(o.x,o.y)};function Fdt(e,t,n,i,o,r){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Kr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var Bdt=new h,Dxe=new h,kdt=new h,Vdt=new h;function Udt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,Bdt),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,Dxe),Dxe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,kdt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,Vdt)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),x=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-x||n.y>x){let b=s.y<-m||s.y>m,T=s.z<-x||s.z>x;if(b||T)return Fdt(e,n,s,m,x,t)}}en.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return Udt(this,e)};var zdt=new h,ta={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};en.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};en.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=ta.destination,e.orientation.heading=ta.heading,e.orientation.pitch=ta.pitch,e.orientation.roll=ta.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};en.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof se;i&&(t=this.getRectangleCameraCoordinates(t,zdt));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=kxe(this,t,o,oK.orientation)),l(e.duration)&&e.duration<=0){let f=oK;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;ta.destination=t,ta.heading=o.heading,ta.pitch=o.pitch,ta.roll=o.roll,ta.duration=e.duration,ta.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},ta.cancel=e.cancel,ta.endTransform=e.endTransform,ta.convert=i?!1:e.convert,ta.maximumHeight=e.maximumHeight,ta.pitchAdjustHeight=e.pitchAdjustHeight,ta.flyOverLongitude=e.flyOverLongitude,ta.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ta.easingFunction=e.easingFunction;let a=this._scene,c=B2.createTween(a,ta);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=en.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Hdt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Gdt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var Wdt=100;function jxe(e,t,n){n=ld.clone(l(n)?n:en.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=Wdt:e.frustum instanceof rn||e._mode===ne.SCENE2D?n.range=Gdt(e,s):n.range=Hdt(e,s),n.range=P.clamp(n.range,i,o)}return n}en.prototype.viewBoundingSphere=function(e,t){t=jxe(this,e,t),this.lookAt(e.center,t)};var jdt=new F,qdt=new h,Ydt=new h,Xdt=new h,Kdt=new h,Zdt=new oe,$dt=new Oe,Qdt=new $;en.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=jxe(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,qdt):o=Gxe(i.heading,i.pitch,i.range);let r=this._scene,s=y(r.ellipsoid,ee.default),a=Mt.eastNorthUpToFixedFrame(e.center,s,jdt);F.multiplyByPoint(a,o,o);let c,u;if(!n){if(c=h.subtract(e.center,o,Ydt),h.normalize(c,c),u=F.multiplyByPointAsVector(a,h.UNIT_Z,Xdt),1-Math.abs(h.dot(c,u))<P.EPSILON6){let d=Oe.fromAxisAngle(c,i.heading,$dt),p=$.fromQuaternion(d,Qdt);h.fromCartesian4(F.getColumn(a,1,Zdt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,Kdt);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var Ixe=new h,Pxe=new h,nK=new h,Rxe=new h,V2=[new h,new h,new h,new h];function Jdt(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,Ixe),r=h.magnitude(o),s=h.normalize(o,Pxe),a,c;h.equalsEpsilon(s,h.UNIT_Z,P.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,nK),nK),c=h.normalize(h.cross(s,a,Rxe),Rxe));let u=Math.sqrt(h.magnitudeSquared(o)-1),f=h.multiplyByScalar(s,1/r,Ixe),d=u/r,p=h.multiplyByScalar(a,d,Pxe),g=h.multiplyByScalar(c,d,nK),m=h.add(f,g,V2[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let x=h.subtract(f,g,V2[1]);h.subtract(x,p,x),h.multiplyComponents(n,x,x);let b=h.subtract(f,g,V2[2]);h.add(b,p,b),h.multiplyComponents(n,b,b);let T=h.add(f,g,V2[3]);return h.add(T,p,T),h.multiplyComponents(n,T,T),V2}var iK=new z,eht=new h,P0=[new fe,new fe,new fe,new fe];function O8(e,t,n,i,o,r){iK.x=e,iK.y=t;let s=i.pickEllipsoid(iK,o,eht);return l(s)?(P0[n]=o.cartesianToCartographic(s,P0[n]),1):(P0[n]=o.cartesianToCartographic(r[n],P0[n]),0)}en.prototype.computeViewRectangle=function(e,t){e=y(e,ee.default);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ae(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===jt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,u=Jdt(this,e);if(c+=O8(0,0,0,this,e,u),c+=O8(0,a,1,this,e,u),c+=O8(s,a,2,this,e,u),c+=O8(s,0,3,this,e,u),c<2)return se.MAX_VALUE;t=se.fromCartographicArray(P0,t);let f=0,d=P0[3].longitude;for(let p=0;p<4;++p){let g=P0[p].longitude,m=Math.abs(g-d);m>P.PI?f+=P.TWO_PI-m:f+=m,d=g}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,P0[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};en.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof wi)return;let e=this._scene;this.frustum=new wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};en.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof rn)return;let e=Fxe(this),t=this._scene;this.frustum=new rn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};en.clone=function(e,t){return l(t)||(t=new en(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var so=en;function tht(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var yd=tht;var Zxe=Ko(uu(),1),qxe=576,nht=100,U2="#ffffff",B8="#48b";function $xe(e,t){this.credit=e,this.count=y(t,1)}function iht(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Tt.equals(o,t))return!0}return!1}function oht(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Tt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Qxe="cesium-credit-delimiter";function Yxe(e){let t=document.createElement("span");return t.textContent=e,t.className=Qxe,t}function Xxe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Kxe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(Yxe(n));else{let f=o[u];f.className!==Qxe&&e.replaceChild(Yxe(n),f)}}let c=a.element;if(o.length<=r)e.appendChild(Xxe(c,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(Xxe(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function rht(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<qxe?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=qxe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function sht(e){let t=` +`,S&&(vt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); +`);vt+=` return color; + }`,tt.sources.push(vt),ze.sources.push(jat(ce)),ze.sources.push(Xat(v));let pt=$t.fromCache({context:t.context,vertexShaderSource:ze,fragmentShaderSource:tt,attributeLocations:J.getAttributeLocations()});Ae=ke[ge]=new Wat(i,ge,this.material,pt,be,De)}return n.surfaceShader=Ae,Ae.shaderProgram};AX.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var FF=AX;var Kat={NONE:-1,PARTIAL:0,FULL:1},_r=Object.freeze(Kat);function QH(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}QH.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new QH(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Zm(i)}`),c};QH.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Io=QH;var Zat={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ai=Object.freeze(Zat);var $at={START:0,LOADING:1,DONE:2,FAILED:3},ea=Object.freeze($at);var Qat={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},ho=Object.freeze(Qat);function sr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=ho.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ae,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(sr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===ho.RECEIVING||e===ho.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==ai.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var Jat=new fe;function EX(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,Jat);s=n.project(c,r),s=h.fromElements(s.z,s.x,s.y,r)}return s}var ect=new h,tct=new h,nct=new h;sr.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,u=a.length,f=Number.MAX_VALUE;for(let d=0;d<u;d+=3){let p=a[d],g=a[d+1],m=a[d+2],x=EX(c,t,n,s,p,ect),b=EX(c,t,n,s,g,tct),T=EX(c,t,n,s,m,nct),C=$n.rayTriangleParametric(e,x,b,T,i);l(C)&&C<f&&C>=0&&(f=C)}return f!==Number.MAX_VALUE?hn.getPoint(e,f,o):void 0};sr.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=ho.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};sr.prototype.freeVertexArray=function(){sr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,sr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};sr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new sr),e.state===ea.START&&(ict(e,t,n),e.state=ea.LOADING)};sr.processStateMachine=function(e,t,n,i,o,r,s){sr.initialize(e,n,i);let a=e.data;if(e.state===ea.LOADING&&oct(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===ho.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let d=e._loadedCallbacks,p={};for(let g in d)d.hasOwnProperty(g)&&(d[g](e)||(p[g]=d[g]));e._loadedCallbacks=p,e.state=ea.DONE}c&&(e.renderable=!0)};sr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let d=c[u];if(!l(d.loadingImagery)){r=!1;continue}if(d.loadingImagery.state===ai.PLACEHOLDER){let g=d.loadingImagery.imageryLayer;if(g.ready){d.freeResources(),c.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=d.processStateMachine(e,n,i);a=a&&p,s=s||p||l(d.readyImagery),r=r&&l(d.loadingImagery)&&(d.loadingImagery.state===ai.FAILED||d.loadingImagery.state===ai.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function c0e(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=wc.clone(s);c.hasGeodeticSurfaceNormals=t,c=wc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(sr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=sr._createVertexArrayForMesh(i.context,o)):(sr._freeVertexArray(e.vertexArray),e.vertexArray=sr._createVertexArrayForMesh(i.context,o)),sr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}sr.prototype.addGeodeticSurfaceNormals=function(e,t){c0e(this,!0,e,t)};sr.prototype.removeGeodeticSurfaceNormals=function(e){c0e(this,!1,void 0,e)};sr.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let d=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(d,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let d=e.customData,p=d.length;for(let g=0;g<p;g++){let m=d[g];m.level=-1}}}};function ict(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=ho.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function oct(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===ho.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||sr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===ho.FAILED&&rct(s,e,t,n,e.x,e.y,e.level),s.terrainState===ho.UNLOADED&&sct(s,n,e.x,e.y,e.level),s.terrainState===ho.RECEIVED&&cct(s,t,n,e.x,e.y,e.level),s.terrainState===ho.TRANSFORMED&&(lct(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=ho.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)fct(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function rct(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=ea.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,d=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,d,o,r,s);l(p)&&(e.terrainState=ho.RECEIVING,Promise.resolve(p).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=ho.RECEIVED)}).catch(function(){e.terrainState=ho.FAILED}))}function sct(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=ho.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=ho.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Zn.CANCELLED){e.terrainData=void 0,e.terrainState=ho.UNLOADED,e.request=void 0;return}e.terrainState=ho.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Io.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let c=new $o({throttle:!1,throttleByServer:!0,type:ds.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=ho.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=ho.UNLOADED,e.request=void 0)}a()}var act={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function cct(e,t,n,i,o,r){let s=n.tilingScheme,a=act;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=ho.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=ho.TRANSFORMED}).catch(function(){e.terrainState=ho.FAILED}))}sr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=_t.createVertexBuffer({context:e,typedArray:n,usage:Fe.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=_t.createIndexBuffer({context:e,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ti({context:e,attributes:o,indexBuffer:s})};sr._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function lct(e,t,n,i,o,r,s){e.vertexArray=sr._createVertexArrayForMesh(t,e.mesh),e.terrainState=ho.READY,e.fill=e.fill&&e.fill.destroy(s)}function uct(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=It.create({context:e,pixelFormat:et.LUMINANCE,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Zt({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:di.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function fct(e,t){let n=t.terrainData.waterMask,i=uct(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=It.create({context:e,pixelFormat:et.LUMINANCE,pixelDatatype:Ke.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,oe.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}sr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};sr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var md=sr;function A0(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ee.default),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Oi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new z(-i,-i),this._rectangleNortheastInMeters=new z(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new se(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(A0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});A0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};A0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};A0.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(se.southwest(e)),o=n.project(se.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new se(i.x,i.y,o.x,o.y)};A0.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,d=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=d,i.east=c,i.north=f,i):new se(a,d,c,f)};A0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new z(o.west,o.south)),a=r.unproject(new z(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};A0.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!se.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,d=this._projection.project(e),p=d.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-d.y,m=p/a|0;m>=o&&(m=o-1);let x=g/u|0;return x>=r&&(x=r-1),l(n)?(n.x=m,n.y=x,n):new z(m,x)};var as=A0;var SX,l0e="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSFctdVnwhKUPPSRxMpNygUNlP8JmGGUdPJSkOUNGzOjDGJ6_IBw0ZIYb2CxiR6SbKR4hMj3np1HXa_Idxv_txLhu62WcUsFQSTBvq7ktym5DNKxqVmIzBnPljNsM8ff9hCKEXq0LTd8VzkHqjVA7-ig_wg7BqJGg7vUMgG1QseyUAjpmY2OaEv9rA8aeBjRrc.AT1_8nZ92i8c",GS={};GS.defaultAccessToken=l0e;GS.defaultWorldImageryServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});GS.defaultWorldHillshadeServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});GS.defaultWorldOceanServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});GS.getDefaultTokenCredit=function(e){if(e===l0e){if(!l(SX)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';SX=new bt(t,!0)}return SX}};var $u=GS;function vX(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Se.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Dd(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}vX.prototype.isReady=function(){return this._isReady};vX.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Dd(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var BF=vX;function wX(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}wX.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};wX.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Nh=wX;function WS(){he.throwInstantiationError()}Object.defineProperties(WS.prototype,{rectangle:{get:he.throwInstantiationError},tileWidth:{get:he.throwInstantiationError},tileHeight:{get:he.throwInstantiationError},maximumLevel:{get:he.throwInstantiationError},minimumLevel:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},tileDiscardPolicy:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},proxy:{get:he.throwInstantiationError},hasAlphaChannel:{get:he.throwInstantiationError}});WS.prototype.getTileCredits=function(e,t,n){he.throwInstantiationError()};WS.prototype.requestImage=function(e,t,n,i){he.throwInstantiationError()};WS.prototype.pickFeatures=function(e,t,n,i,o){he.throwInstantiationError()};var dct=/\.ktx2$/i;WS.loadImage=function(e,t){let n=Se.createIfNeeded(t);return dct.test(n.url)?Il(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var _l=WS;var hct={SATELLITE:1,OCEANS:2,HILLSHADE:3},Fh=Object.freeze(hct);function u0e(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new Xi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new bt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}u0e.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new BF({missingImageUrl:f0e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new z(0,0),new z(200,20),new z(20,200),new z(80,110),new z(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function mct(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new as({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Xi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new re(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Oi,o=e.fullExtent,r=i.unproject(new h(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new se(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=se.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new re(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new bt(e.copyrightText)]:t.credit=new bt(e.copyrightText))}function pct(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new re(n)}async function _ct(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();mct(i,t)}catch(i){pct(e,i)}}function Jm(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Xi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new bt(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new pe}Jm.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case Fh.SATELLITE:{n=y(t.token,$u.defaultAccessToken),i=Se.createIfNeeded($u.defaultWorldImageryServer),i.appendForwardSlash();let r=$u.getDefaultTokenCredit(n);l(r)&&(o=bt.clone(r))}break;case Fh.OCEANS:{n=y(t.token,$u.defaultAccessToken),i=Se.createIfNeeded($u.defaultWorldOceanServer),i.appendForwardSlash();let r=$u.getDefaultTokenCredit(n);l(r)&&(o=bt.clone(r))}break;case Fh.HILLSHADE:{n=y(t.token,$u.defaultAccessToken),i=Se.createIfNeeded($u.defaultWorldHillshadeServer),i.appendForwardSlash();let r=$u.getDefaultTokenCredit(n);l(r)&&(o=bt.clone(r))}break;default:}return Jm.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function f0e(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Pi?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(Jm.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Jm.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Jm(t);i._resource=n;let o=new u0e(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await _ct(n,o),o.build(i),i};Jm.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Jm.prototype.requestImage=function(e,t,n,i){return _l.loadImage(this,f0e(this,e,t,n,i))};Jm.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Pi)s=P.toDegrees(i),a=P.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new fe(i,o,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let x=0;x<m.length;++x){let b=m[x],T=new Nh;if(T.data=b,T.name=b.value,T.properties=b.attributes,T.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let C=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(C===4326||C===4283)T.position=fe.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(C===102100||C===900913||C===3857){let A=new Oi;T.position=A.unproject(new h(b.geometry.x,b.geometry.y,b.geometry.z))}}g.push(T)}return g})};Jm._metadataCache={};var lg=Jm;var gct={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},jS=Object.freeze(gct);function kF(e){}kF.prototype.isReady=function(){return!0};kF.prototype.shouldDiscardImage=function(e){return kF.EMPTY_IMAGE===e};var JH;Object.defineProperties(kF,{EMPTY_IMAGE:{get:function(){return l(JH)||(JH=new Image,JH.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),JH}}});var qS=kF;function d0e(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}d0e.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof bt)break;o.credit=new bt(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],u=c.bbox;c.bbox=new se(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}};function yct(e,t){if(e.resourceSets.length!==1)throw new re("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function xct(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new re(i)}async function bct(e,t,n){let i=e.url,o=Ns._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),Ns._metadataCache[i]=o);try{let r=await o;return yct(r,t)}catch(r){xct(e,r,n)}}function Ns(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,jS.AERIAL),this._mapLayer=e.mapLayer,this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new qS),this._proxy=e.proxy,this._credit=new bt(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Ns.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new as({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new pe}Object.defineProperties(Ns.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});Ns.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,jS.AERIAL),o=Se.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Ns(t);a._resource=o;let c=new d0e(t);return await bct(s,c),c.build(a),a};var Tct=new se;Ns.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Tct);return Ect(this._attributionList,n,i)};Ns.prototype.requestImage=function(e,t,n,i){let o=_l.loadImage(this,Cct(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?qS.EMPTY_IMAGE:Promise.reject(r)})};Ns.prototype.pickFeatures=function(e,t,n,i,o){};Ns.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};Ns.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};Ns._logoUrl=void 0;Object.defineProperties(Ns,{logoUrl:{get:function(){return l(Ns._logoUrl)||(Ns._logoUrl=en("Assets/Images/bing_maps_credit.png")),Ns._logoUrl},set:function(e){Ns._logoUrl=e}}});function Cct(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:Ns.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Act=new se;function Ect(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=se.intersection(n,d.bbox,Act);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Ns._metadataCache={};var VF=Ns;var h0e=/{[^}]+}/g,m0e={x:Dct,y:Pct,z:Mct,s:Lct,reverseX:Ict,reverseY:Rct,reverseZ:Oct,westDegrees:Nct,southDegrees:Fct,eastDegrees:Bct,northDegrees:kct,westProjected:Vct,southProjected:Uct,eastProjected:zct,northProjected:Hct,width:Gct,height:Wct},Sct=xt(m0e,{i:jct,j:qct,reverseI:Yct,reverseJ:Xct,longitudeDegrees:Zct,latitudeDegrees:$ct,longitudeProjected:Qct,latitudeProjected:Jct,format:tlt});function UF(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new pe;let t=Se.createIfNeeded(e.url),n=Se.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new as({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=se.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new bt(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=xt(m0e,r),a=xt(Sct,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(UF.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});UF.prototype.getTileCredits=function(e,t,n){};UF.prototype.requestImage=function(e,t,n,i){return _l.loadImage(this,vct(this,e,t,n,i))};UF.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=wct(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var e8=!1,Qu=new se,t8=!1,zF=new se;function vct(e,t,n,i,o){e8=!1,t8=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},u=s.match(h0e);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var DX=!1,XS=new z,IX=!1;function wct(e,t,n,i,o,r,s){e8=!1,t8=!1,DX=!1,IX=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(h0e);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function KS(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function Dct(e,t,n,i){return KS(e,"{x}",t)}function Ict(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return KS(e,"{reverseX}",o)}function Pct(e,t,n,i){return KS(e,"{y}",n)}function Rct(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return KS(e,"{reverseY}",o)}function Oct(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return KS(e,"{reverseZ}",r)}function Mct(e,t,n,i){return KS(e,"{z}",i)}function Lct(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function n8(e,t,n,i){e8||(e.tilingScheme.tileXYToRectangle(t,n,i,Qu),Qu.west=P.toDegrees(Qu.west),Qu.south=P.toDegrees(Qu.south),Qu.east=P.toDegrees(Qu.east),Qu.north=P.toDegrees(Qu.north),e8=!0)}function Nct(e,t,n,i){return n8(e,t,n,i),Qu.west}function Fct(e,t,n,i){return n8(e,t,n,i),Qu.south}function Bct(e,t,n,i){return n8(e,t,n,i),Qu.east}function kct(e,t,n,i){return n8(e,t,n,i),Qu.north}function i8(e,t,n,i){t8||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,zF),t8=!0)}function Vct(e,t,n,i){return i8(e,t,n,i),zF.west}function Uct(e,t,n,i){return i8(e,t,n,i),zF.south}function zct(e,t,n,i){return i8(e,t,n,i),zF.east}function Hct(e,t,n,i){return i8(e,t,n,i),zF.north}function Gct(e,t,n,i){return e.tileWidth}function Wct(e,t,n,i){return e.tileHeight}function jct(e,t,n,i,o,r,s){return o8(e,t,n,i,o,r),XS.x}function qct(e,t,n,i,o,r,s){return o8(e,t,n,i,o,r),XS.y}function Yct(e,t,n,i,o,r,s){return o8(e,t,n,i,o,r),e.tileWidth-XS.x-1}function Xct(e,t,n,i,o,r,s){return o8(e,t,n,i,o,r),e.tileHeight-XS.y-1}var Kct=new se,YS=new h;function o8(e,t,n,i,o,r,s){if(DX)return;PX(e,t,n,i,o,r);let a=YS,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Kct);XS.x=e.tileWidth*(a.x-c.west)/c.width|0,XS.y=e.tileHeight*(c.north-a.y)/c.height|0,DX=!0}function Zct(e,t,n,i,o,r,s){return P.toDegrees(o)}function $ct(e,t,n,i,o,r,s){return P.toDegrees(r)}function Qct(e,t,n,i,o,r,s){return PX(e,t,n,i,o,r),YS.x}function Jct(e,t,n,i,o,r,s){return PX(e,t,n,i,o,r),YS.y}var elt=new fe;function PX(e,t,n,i,o,r,s){if(!IX){if(e.tilingScheme.projection instanceof Pi)YS.x=P.toDegrees(o),YS.y=P.toDegrees(r);else{let a=elt;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,YS)}IX=!0}}function tlt(e,t,n,i,o,r,s){return s}var ja=UF;function pd(e){ja.call(this,e)}pd._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return pd._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof tm)return pd._metadataFailure(e,t);throw o}};pd.fromUrl=async function(e,t){let n=Se.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let r=await pd._requestMetadata(t,i,o);return new pd(r)};l(Object.create)&&(pd.prototype=Object.create(ja.prototype),pd.prototype.constructor=pd);function p0e(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function _0e(e,t,n){let i=e.positionToTileXY(se.southwest(t),n),o=e.positionToTileXY(se.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}pd._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(r.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let M=g.item(R).childNodes;for(let N=0;N<M.length;N++)s.test(M.item(N).nodeName)&&p.push(M.item(N))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Io.reportError(void 0,o,o.errorEvent,m),new re(m);let x=y(t.fileExtension,u.getAttribute("extension")),b=y(t.tileWidth,parseInt(u.getAttribute("width"),10)),T=y(t.tileHeight,parseInt(u.getAttribute("height"),10)),C=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),A=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),E=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(E==="geodetic"||E==="global-geodetic")v=new Xi({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")v=new as({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(o)&&Io.reportError(void 0,o,o.errorEvent,m),new re(m);let D=se.clone(t.rectangle);if(!l(D)){let R,M,N,_;y(t.flipXY,!1)?(N=new z(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new z(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(N=new z(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new z(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=E==="geodetic"||E==="mercator";if(v.projection instanceof Pi||w)R=fe.fromDegrees(N.x,N.y),M=fe.fromDegrees(_.x,_.y);else{let I=v.projection;R=I.unproject(N),M=I.unproject(_)}D=new se(R.longitude,R.latitude,M.longitude,M.latitude)}return D=p0e(D,v),C=_0e(v,D,C),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:v,rectangle:D,tileWidth:b,tileHeight:T,minimumLevel:C,maximumLevel:A,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};pd._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),o=y(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new as({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=p0e(a,s);let c=_0e(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var E0=pd;function g0e(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}g0e.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function nlt(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new re(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new re(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new as({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new re(o)}return!0}function ilt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new re(i)}async function olt(e,t,n){try{let i=await e.fetchText();nlt(i,t)}catch(i){ilt(i,e,n)}}function tu(e){e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new bt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${tu.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new pe}Object.defineProperties(tu.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});tu.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=Se.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new g0e(n);s.channel=t,await olt(r,s);let a=new tu(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};tu.prototype.getTileCredits=function(e,t,n){};tu.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return _l.loadImage(this,o)};tu.prototype.pickFeatures=function(e,t,n,i,o){};tu._logoUrl=void 0;Object.defineProperties(tu,{logoUrl:{get:function(){return l(tu._logoUrl)||(tu._logoUrl=en("Assets/Images/google_earth_credit.png")),tu._logoUrl},set:function(e){tu._logoUrl=e}}});var HF=tu;var rlt=/\/$/,y0e=new bt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function ZS(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Se.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();rlt.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new bt(s))):s=y0e,this._resource=i,this._imageryProvider=new ja({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(ZS.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});ZS.prototype.getTileCredits=function(e,t,n){};ZS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ZS.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};ZS._defaultCredit=y0e;var GF=ZS;function BT(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,se.MAX_VALUE),n=new Xi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new pe;let i=e.credit;typeof i=="string"&&(i=new bt(i)),this._credit=i;let o=Se.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(BT.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function slt(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Io.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return RX(e,n,r);throw l(n)&&(n._hasError=!0),new re(o)}async function RX(e,t,n){try{return await _l.loadImage(null,e)}catch(i){return slt(e,i,t,n)}}BT.fromUrl=async function(e,t){let n=Se.createIfNeeded(e),i=await RX(n);t=y(t,y.EMPTY_OBJECT);let o=new BT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};BT.prototype.getTileCredits=function(e,t,n){};BT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await RX(this._resource,this);return this._image=o,Io.reportSuccess(this._errorEvent),o}return this._image};BT.prototype.pickFeatures=function(e,t,n,i,o){};var WF=BT;function alt(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=clt:e==="xml"?n=dlt:(e==="html"||e==="text")&&(n=x0e)),this.callback=n}function clt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Nh;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=fe.fromDegrees(s,a)}t.push(r)}return t}var OX="http://www.mapinfo.com/mxp",llt="http://www.esri.com/wms",ult="http://www.opengis.net/wfs",flt="http://www.opengis.net/gml";function dlt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===OX)return hlt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===llt)return mlt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===ult)return plt(e);if(t.localName==="ServiceExceptionReport")throw new re(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?_lt(e):glt(e)}function hlt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(OX,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(OX,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new Nh;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function mlt(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(r8(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(r8(a,i))}}return n}function plt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(flt,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};MX(r,s),t.push(r8(r,s))}return t}function _lt(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new re("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};MX(s,a),t.push(r8(s,a))}}return t}function MX(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&MX(o,t)&&(t[o.localName]=o.textContent)}return n}function r8(e,t){let n=new Nh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function glt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Nh;return o.data=e,o.description=n.innerHTML,[o]}var ylt=/<body>\s*<\/body>/im,xlt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,blt=/<title>([\s\S]*)<\/title>/im;function x0e(e){if(ylt.test(e)||xlt.test(e))return;let t,n=blt.exec(e);n&&n.length>1&&(t=n[1]);let i=new Nh;return i.name=t,i.description=e,i.data=e,[i]}var kT=alt;function jF(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(jF.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});jF.prototype.getFromCache=function(e,t,n,i){let o=b0e(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};jF.prototype.checkApproachingInterval=function(e,t,n,i){let o=b0e(e,t,n),r=this._tilesRequestedForInterval,s=T0e(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!C0e(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};jF.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=T0e(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=C0e(this,c,r),a||s.push(c)}}};function b0e(e,t,n){return`${e}-${t}-${n}`}function Tlt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function T0e(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=Z.secondsDifference(c.stop,i),++a):(s=Z.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function C0e(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=Tlt(s),c=new $o({throttle:!1,throttleByServer:!0,type:ds.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(r[s]={promise:u,request:c},!0):!1}var VT=jF;var Clt=[3034,3035,3042,3043,3044],Alt=[4471,4559];function Bh(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new he("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=Se.createIfNeeded(e.url),n=Se.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Bh.DefaultParameters,!0),n.setQueryParameters(Bh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(A0e(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(A0e(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new VT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return E0e(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Oi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Alt.includes(a)||Clt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Oi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new ja({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Xi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,Bh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function E0e(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function Elt(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(Bh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Bh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Bh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=E0e(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Bh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return Elt(this,e,t,n,i,o,s)};Bh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Bh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Bh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new kT("json","application/json")),Object.freeze(new kT("xml","text/xml")),Object.freeze(new kT("text","text/html"))]);function A0e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var qF=Bh;var Slt=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function YF(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Se.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(Slt),this._useKvp=!0;else{let d={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(d),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new as({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new VT({clock:e.clock,times:e.times,requestImageFunction:function(d,p,g,m,x){return S0e(s,d,p,g,m,x)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(se.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(se.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new pe;let f=e.credit;this._credit=typeof f=="string"?new bt(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function S0e(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(r)?r.data:void 0,d,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:o}),d.setTemplateValues(p),l(u)&&d.setTemplateValues(u),l(f)&&d.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(u)&&(g=xt(g,u)),l(f)&&(g=xt(g,f)),p={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:g,request:o}),d.setTemplateValues(p)}return _l.loadImage(e,d)}Object.defineProperties(YF.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}}});YF.prototype.getTileCredits=function(e,t,n){};YF.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=S0e(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};YF.prototype.pickFeatures=function(e,t,n,i,o){};var XF=YF;var vlt={ARCGIS_MAPSERVER:lg.fromUrl,BING:async(e,t)=>VF.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,HF.fromUrl(e,n,t)},MAPBOX:(e,t)=>new GF({url:e,...t}),SINGLE_TILE:WF.fromUrl,TMS:E0.fromUrl,URL_TEMPLATE:(e,t)=>new ja({url:e,...t}),WMS:(e,t)=>new qF({url:e,...t}),WMTS:(e,t)=>new XF({url:e,...t})};function ep(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new pe}Object.defineProperties(ep.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});ep.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Cu._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=ep._endpointCache[i];l(o)||(o=n.fetchJson(),ep._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new re(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await E0.fromUrl(new Cu(r,n));else{let u=vlt[a];if(!l(u))throw new re(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},d=f.url;delete f.url,s=await u(d,f)}let c=new ep(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=Cu.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};ep.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};ep.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ep.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};ep._endpointCache={};var ug=ep;var wlt={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},fg=Object.freeze(wlt);function Dlt(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,fg.AERIAL);return ug.fromAssetId(t)}var dg=Dlt;var KF=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = texture(u_texture, v_textureCoordinates); +} +`;var ZF=`in vec4 position; +in float webMercatorT; + +uniform vec2 u_textureDimensions; + +out vec2 v_textureCoordinates; + +void main() +{ + v_textureCoordinates = vec2(position.x, webMercatorT); + gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); +} +`;function $S(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ai.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}$S.createPlaceholder=function(e){let t=new $S(e,0,0,0);return t.addReference(),t.state=ai.PLACEHOLDER,t};$S.prototype.addReference=function(){++this.referenceCount};$S.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};$S.prototype.processStateMachine=function(e,t,n){this.state===ai.UNLOADED&&!n&&(this.state=ai.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ai.RECEIVED&&(this.state=ai.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ai.READY&&t&&!this.texture;(this.state===ai.TEXTURE_LOADED||i)&&(this.state=ai.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var QS=$S;function LX(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}LX.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};LX.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ai.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==ai.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==ai.FAILED&&r.state!==ai.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ai.FAILED||i.state===ai.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var JS=LX;function Ci(e,t){this._imageryProvider=e,this._readyEvent=new pe,this._errorEvent=new pe,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,Ci.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,Ci.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,Ci.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,Ci.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,Ci.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,Ci.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,Ci.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,Ci.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,se.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new JS(QS.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,Ci.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(Ci.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Ci.DEFAULT_BRIGHTNESS=1;Ci.DEFAULT_CONTRAST=1;Ci.DEFAULT_HUE=0;Ci.DEFAULT_SATURATION=1;Ci.DEFAULT_GAMMA=1;Ci.DEFAULT_SPLIT=Br.NONE;Ci.DEFAULT_MINIFICATION_FILTER=Kt.LINEAR;Ci.DEFAULT_MAGNIFICATION_FILTER=di.LINEAR;Ci.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ci.fromProviderAsync=function(e,t){let n=new Ci(void 0,t);return Mlt(n,Promise.resolve(e)),n};Ci.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),Ci.fromProviderAsync(dg({style:e.style}),e)};Ci.prototype.isBaseLayer=function(){return this._isBaseLayer};Ci.prototype.isDestroyed=function(){return!1};Ci.prototype.destroy=function(){return ue(this)};var D0e=new se,v0e=new se,NX=new se,I0e=new se;Ci.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return se.intersection(e.rectangle,t)};Ci.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Oi&&e.rectangle.north<Oi.MaximumLatitude&&e.rectangle.south>-Oi.MaximumLatitude,s=se.intersection(o.rectangle,this._rectangle,D0e),a=se.intersection(e.rectangle,s,v0e);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,I=e.rectangle;a=v0e,I.south>=w.north?a.north=a.south=w.north:I.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(I.south,w.south),a.north=Math.min(I.north,w.north)),I.west>=w.east?a.west=a.east=w.east:I.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(I.west,w.west),a.east=Math.min(I.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Rlt(this,f,c);d=Math.max(0,d);let p=o.maximumLevel;if(d>p&&(d=p),l(o.minimumLevel)){let w=o.minimumLevel;d<w&&(d=w)}let g=o.tilingScheme,m=g.positionToTileXY(se.northwest(a),d),x=g.positionToTileXY(se.southeast(a),d),b=e.rectangle.width/512,T=e.rectangle.height/512,C=g.tileXYToRectangle(m.x,m.y,d);Math.abs(C.south-e.rectangle.north)<T&&m.y<x.y&&++m.y,Math.abs(C.east-e.rectangle.west)<b&&m.x<x.x&&++m.x;let A=g.tileXYToRectangle(x.x,x.y,d);Math.abs(A.north-e.rectangle.south)<T&&x.y>m.y&&--x.y,Math.abs(A.west-e.rectangle.east)<b&&x.x>m.x&&--x.x;let E=se.clone(e.rectangle,I0e),v=g.tileXYToRectangle(m.x,m.y,d),D=se.intersection(v,s,NX),O;r?(g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(D,D),g.rectangleToNativeRectangle(s,s),O=g.tileXYToNativeRectangle.bind(g),b=E.width/512,T=E.height/512):O=g.tileXYToRectangle.bind(g);let R,M=0,N=1,_;!this.isBaseLayer()&&Math.abs(D.west-E.west)>=b&&(M=Math.min(1,(D.west-E.west)/E.width)),!this.isBaseLayer()&&Math.abs(D.north-E.north)>=T&&(N=Math.max(0,(D.north-E.south)/E.height));let S=N;for(let w=m.x;w<=x.x;w++)if(R=M,v=O(w,m.y,d),D=se.simpleIntersection(v,s,NX),!!l(D)){M=Math.min(1,(D.east-E.west)/E.width),w===x.x&&(this.isBaseLayer()||Math.abs(D.east-E.east)<b)&&(M=1),N=S;for(let I=m.y;I<=x.y;I++){if(_=N,v=O(w,I,d),D=se.simpleIntersection(v,s,NX),!l(D))continue;N=Math.max(0,(D.south-E.south)/E.height),I===x.y&&(this.isBaseLayer()||Math.abs(D.south-E.south)<T)&&(N=0);let L=new oe(R,N,M,_),B=this.getImageryFromCache(w,I,d);i.imagery.splice(n,0,new JS(B,L,r)),++n}}return!0};Ci.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,D0e),i=c.rectangleToNativeRectangle(i,I0e)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new oe(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Ci.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=ai.RECEIVED,e.request=void 0,Io.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Zn.CANCELLED){e.state=ai.UNLOADED,e.request=void 0;return}e.state=ai.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Io.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new $o({throttle:!1,throttleByServer:!0,type:ds.IMAGERY});e.request=s,e.state=ai.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=ai.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Ci.prototype._createTextureWebGL=function(e,t){let n=new Zt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new It({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new It({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?et.RGBA:et.RGB,sampler:n})};Ci.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=ai.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ai.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Oi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ai.TEXTURE_LOADED};function w0e(e,t,n){return`${e}:${t}:${n}`}Ci.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Kt.LINEAR&&i===di.LINEAR&&!et.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=Kt.LINEAR_MIPMAP_LINEAR;let r=Lt.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=w0e(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new Zt({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(lm.NICEST),t.sampler=u}else{let r=w0e(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new Zt({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ci.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Pi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new kc({persists:!0,owner:this,preExecute:function(c){Plt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ai.READY,t.releaseReference()},canceled:function(){t.state=ai.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ai.READY};Ci.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Ci.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ci.prototype.getImageryFromCache=function(e,t,n,i){let o=P0e(e,t,n),r=this._imageryCache[o];return l(r)||(r=new QS(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ci.prototype.removeImageryFromCache=function(e){let t=P0e(e.x,e.y,e.level);delete this._imageryCache[t]};function P0e(e,t,n){return JSON.stringify([e,t,n])}var s8={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new z,texture:void 0},Ilt=zt.supportsTypedArrays()?new Float32Array(2*64):void 0;function Plt(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),T=0;for(let D=0;D<64;++D){let O=D/63;b[T++]=0,b[T++]=O,b[T++]=1,b[T++]=O}let C={position:0,webMercatorT:1},A=ss.getRegularGridIndices(2,64),E=_t.createIndexBuffer({context:t,typedArray:A,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});o.vertexArray=new ti({context:t,attributes:[{index:C.position,vertexBuffer:_t.createVertexBuffer({context:t,typedArray:b,usage:Fe.STATIC_DRAW}),componentsPerAttribute:2},{index:C.webMercatorT,vertexBuffer:_t.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Fe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let v=new Ue({sources:[ZF]});o.shaderProgram=$t.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:KF,attributeLocations:C}),o.sampler=new Zt({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:di.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;s8.textureDimensions.x=r,s8.textureDimensions.y=s,s8.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new It({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(r)&&P.isPowerOfTwo(s)&&d.generateMipmap(lm.NICEST);let p=i.south,g=i.north,m=Ilt,x=0;for(let b=0;b<64;++b){let T=b/63,C=P.lerp(p,g,T);a=Math.sin(C);let E=(.5*Math.log((1+a)/(1-a))-c)*f;m[x++]=E,m[x++]=E}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=d,e.uniformMap=s8,e.vertexArray=o.vertexArray}function Rlt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Pi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function Olt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Mlt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Olt(e._errorEvent,i)}}var qa=Ci;var Llt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},_n=Llt;var R0e={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=R0e.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Yn=R0e;function tv(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe}tv.prototype.update=function(e,t,n){this.changedThisFrame&&(k0e(e,t,this.tile,n),this.changedThisFrame=!1)};tv.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};tv.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):md._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Nlt=new yy;tv.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Nlt;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),d=c.findTileToEast(r),p=c.findTileToNorth(r);Fs(e,n,c,u,s,_n.EAST,!1,a,i),Fs(e,n,c,f,s,_n.NORTH,!1,a,i),Fs(e,n,c,d,s,_n.WEST,!1,a,i),Fs(e,n,c,p,s,_n.SOUTH,!1,a,i);let g=u.findTileToNorth(r),m=u.findTileToSouth(r),x=d.findTileToNorth(r),b=d.findTileToSouth(r);Fs(e,n,c,g,s,_n.SOUTHEAST,!1,a,i),Fs(e,n,c,x,s,_n.SOUTHWEST,!1,a,i),Fs(e,n,c,m,s,_n.NORTHEAST,!1,a,i),Fs(e,n,c,b,s,_n.NORTHWEST,!1,a,i),c=a.dequeue()}};function Fs(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||Yn.wasKicked(u._lastSelectionResult)||Yn.originalResult(u._lastSelectionResult)===Yn.CULLED);){if(s)return;let f=u.parent;if(r>=_n.NORTHWEST&&f!==void 0)switch(r){case _n.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case _n.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case _n.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case _n.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Yn.RENDERED){if(l(u.data.vertexArray))return;Flt(e,t,n,u,r,o,a,c);return}if(Yn.originalResult(i._lastSelectionResult)!==Yn.CULLED)switch(r){case _n.WEST:Fs(e,t,n,i.northwestChild,o,r,!0,a,c),Fs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case _n.EAST:Fs(e,t,n,i.southeastChild,o,r,!0,a,c),Fs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case _n.SOUTH:Fs(e,t,n,i.southwestChild,o,r,!0,a,c),Fs(e,t,n,i.southeastChild,o,r,!0,a,c);break;case _n.NORTH:Fs(e,t,n,i.northeastChild,o,r,!0,a,c),Fs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case _n.NORTHWEST:Fs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case _n.NORTHEAST:Fs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case _n.SOUTHWEST:Fs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case _n.SOUTHEAST:Fs(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new he("Invalid edge")}}}function Flt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new tv(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Blt(e,t,n,i,o,a)}function Blt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(k0e(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case _n.WEST:u=s.westMeshes,f=s.westTiles;break;case _n.SOUTH:u=s.southMeshes,f=s.southTiles;break;case _n.EAST:u=s.eastMeshes,f=s.eastTiles;break;case _n.NORTH:u=s.northMeshes,f=s.northTiles;break;case _n.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case _n.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case _n.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case _n.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,x=n.rectangle,b,T=i.rectangle;switch(o){case _n.WEST:for(b=(T.north-T.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.greaterThan(x.north,m.south,b));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.greaterThanOrEquals(x.south,m.north,b));++p);break;case _n.SOUTH:for(b=(T.east-T.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.lessThan(x.west,m.east,b));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.lessThanOrEquals(x.east,m.west,b));++p);break;case _n.EAST:for(b=(T.north-T.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.lessThan(x.south,m.north,b));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.lessThanOrEquals(x.north,m.south,b));++p);break;case _n.NORTH:for(b=(T.east-T.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.greaterThan(x.east,m.west,b));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.greaterThanOrEquals(x.west,m.east,b));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var UT=new fe,klt=new fe,ev=new h,VX=new h,FX=new z,BX=new z,Ju=new z;function h8(){this.height=0,this.encodedNormal=new z}function a8(e,t,n,i,o,r,s,a,c){if(l(o))return o;let u;if(l(r)&&l(s))u=(r.height+s.height)*.5;else if(l(r))u=r.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return V0e(e,t,n,i,u,c),c}var Vlt={minimumHeight:0,maximumHeight:0},Ult=new h,O0e=new h8,M0e=new h8,L0e=new h8,N0e=new h8,zlt=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,Hlt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function k0e(e,t,n,i){md.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=l8(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,L0e),p=l8(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,O0e),g=l8(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,M0e),m=l8(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,N0e);d=a8(r,f,0,1,d,p,m,g,L0e),p=a8(r,f,0,0,p,d,g,m,O0e),g=a8(r,f,1,1,g,p,m,d,M0e),m=a8(r,f,1,1,m,g,d,p,N0e);let x=p.height,b=g.height,T=d.height,C=m.height,A=Math.min(x,b,T,C),E=Math.max(x,b,T,C),v=(A+E)*.5,D,O,R=e.getLevelMaximumGeometricError(n.level),M=f.maximumRadius-R,N=Math.acos(M/f.maximumRadius)*4;if(N*=1.5,s.width>N&&E-A<=R){let w=new Wa({width:9,height:9,buffer:zlt,structure:{heightOffset:E}}),I=Hlt;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,r.mesh=w._createMeshSync(I)}else{let w=u,I=se.center(s,klt);I.height=v;let L=f.cartographicToCartesian(I,Ult),B=new wc(L,void 0,void 0,void 0,void 0,!0,!0,w,a,c),U=5,V;for(V=r.westMeshes,D=0,O=V.length;D<O;++D)U+=V[D].eastIndicesNorthToSouth.length;for(V=r.southMeshes,D=0,O=V.length;D<O;++D)U+=V[D].northIndicesWestToEast.length;for(V=r.eastMeshes,D=0,O=V.length;D<O;++D)U+=V[D].westIndicesSouthToNorth.length;for(V=r.northMeshes,D=0,O=V.length;D<O;++D)U+=V[D].southIndicesEastToWest.length;let G=Vlt;G.minimumHeight=A,G.maximumHeight=E;let k=B.stride,W=new Float32Array(U*k),q=0,J=q;q=c8(f,s,B,W,q,0,1,d.height,d.encodedNormal,1,G),q=f8(r,f,B,W,q,r.westTiles,r.westMeshes,_n.EAST,G);let j=q;q=c8(f,s,B,W,q,0,0,p.height,p.encodedNormal,0,G),q=f8(r,f,B,W,q,r.southTiles,r.southMeshes,_n.NORTH,G);let K=q;q=c8(f,s,B,W,q,1,0,g.height,g.encodedNormal,0,G),q=f8(r,f,B,W,q,r.eastTiles,r.eastMeshes,_n.WEST,G);let Q=q;q=c8(f,s,B,W,q,1,1,m.height,m.encodedNormal,1,G),q=f8(r,f,B,W,q,r.northTiles,r.northMeshes,_n.SOUTH,G),A=G.minimumHeight,E=G.maximumHeight;let de=vn.fromRectangle(s,A,E,n.tilingScheme.ellipsoid),xe=Oi.geodeticLatitudeToMercatorAngle(s.south),ce=1/(Oi.geodeticLatitudeToMercatorAngle(s.north)-xe),ge=(Oi.geodeticLatitudeToMercatorAngle(I.latitude)-xe)*ce,be=f.geodeticSurfaceNormalCartographic(UT,VX),De=Mn.octEncode(be,FX),Ae=q;B.encode(W,q*k,de.center,z.fromElements(.5,.5,Ju),v,De,ge,be),++q;let ke=q,ze=ke<256?1:2,tt=(ke-1)*3,vt=tt*ze,pt=(W.length-ke*k)*Float32Array.BYTES_PER_ELEMENT,Be;if(pt>=vt){let me=ke*k*Float32Array.BYTES_PER_ELEMENT;Be=ke<256?new Uint8Array(W.buffer,me,tt):new Uint16Array(W.buffer,me,tt)}else Be=ke<256?new Uint8Array(tt):new Uint16Array(tt);W=new Float32Array(W.buffer,0,ke*k);let qt=0;for(D=0;D<ke-2;++D)Be[qt++]=Ae,Be[qt++]=D,Be[qt++]=D+1;Be[qt++]=Ae,Be[qt++]=D,Be[qt++]=0;let At=[];for(D=j;D>=J;--D)At.push(D);let lt=[];for(D=K;D>=j;--D)lt.push(D);let jn=[];for(D=Q;D>=K;--D)jn.push(D);let sn=[];for(sn.push(0),D=Ae-1;D>=Q;--D)sn.push(D);r.mesh=new hd(B.center,W,Be,tt,ke,A,E,ae.fromOrientedBoundingBox(de),Klt(e,de.center,s,A,E),B.stride,de,B,At,lt,jn,sn)}let _=t.context;r._destroyVertexArray(i),r.vertexArray=md._createVertexArrayForMesh(_,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let S=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=o._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(r.waterMaskTexture=w.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,w,r.waterMaskTranslationAndScale))}l(S)&&(--S.referenceCount,S.referenceCount===0&&S.destroy())}function c8(e,t,n,i,o,r,s,a,c,u,f){let d=UT;d.longitude=P.lerp(t.west,t.east,r),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,ev),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,VX));let m=BX;return m.x=r,m.y=s,n.encode(i,o*n.stride,p,m,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var d8=new se;function $F(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=se.clone(e.rectangle,d8),o.west-=P.TWO_PI,o.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=se.clone(e.rectangle,d8),o.west+=P.TWO_PI,o.east+=P.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,d=(r.north-o.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var Glt=new z;function kX(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var Wlt=new z,jlt=new h;function qlt(e,t,n,i,o,r,s,a,c,u){let f=i.encoding,d=i.vertices,p=$F(t,n,f.decodeTextureCoordinates(d,o,Ju),Ju),g=$F(t,n,f.decodeTextureCoordinates(d,r,BX),BX),m;c?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let x=f.decodeHeight(d,o),b=f.decodeHeight(d,r),T=n.rectangle;UT.longitude=P.lerp(T.west,T.east,s),UT.latitude=P.lerp(T.south,T.north,a),u.height=UT.height=P.lerp(x,b,m);let C;if(f.hasVertexNormals){let A=f.getOctEncodedNormal(d,o,Glt),E=f.getOctEncodedNormal(d,r,Wlt),v=Mn.octDecode(A.x,A.y,ev),D=Mn.octDecode(E.x,E.y,jlt);C=h.lerp(v,D,m,ev),h.normalize(C,C),Mn.octEncode(C,u.encodedNormal)}else C=e.geodeticSurfaceNormalCartographic(UT,ev),Mn.octEncode(C,u.encodedNormal)}function V0e(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(UT,ev);Mn.octEncode(s,r.encodedNormal)}function l8(e,t,n,i,o,r,s,a,c,u,f){if(B0e(e,t,a,s,!1,n,i,f)||B0e(e,t,u,c,!0,n,i,f))return f;let p;if(UX(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],kX(r,p,n,i,f),f;let g;if(n===0?i===0?g=u8(e.westMeshes,e.westTiles,_n.EAST,e.southMeshes,e.southTiles,_n.NORTH,n,i):g=u8(e.northMeshes,e.northTiles,_n.SOUTH,e.westMeshes,e.westTiles,_n.EAST,n,i):i===0?g=u8(e.southMeshes,e.southTiles,_n.NORTH,e.eastMeshes,e.eastTiles,_n.WEST,n,i):g=u8(e.eastMeshes,e.eastTiles,_n.WEST,e.northMeshes,e.northTiles,_n.SOUTH,n,i),l(g))return V0e(e,t,n,i,g,f),f}function u8(e,t,n,i,o,r,s,a){let c=F0e(e,t,!1,n,s,a),u=F0e(i,o,!0,r,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function f8(e,t,n,i,o,r,s,a,c){for(let u=0;u<r.length;++u)o=Ylt(e,t,n,i,o,r[u],s[u],a,c);return o}function Ylt(e,t,n,i,o,r,s,a,c){let u=r.rectangle;a===_n.EAST&&e.tile.x===0?(u=se.clone(r.rectangle,d8),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===_n.WEST&&r.x===0&&(u=se.clone(r.rectangle,d8),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Ju),d=Ju.x,p=Ju.y);let g,m;switch(a){case _n.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case _n.NORTH:g=s.northIndicesWestToEast,m=!0;break;case _n.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case _n.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let x=r,b=e.tile,T=s.encoding,C=s.vertices,A=n.stride,E,v;T.hasWebMercatorT&&(E=Oi.geodeticLatitudeToMercatorAngle(f.south),v=1/(Oi.geodeticLatitudeToMercatorAngle(f.north)-E));for(let D=0;D<g.length;++D){let O=g[D],R=T.decodeTextureCoordinates(C,O,Ju);$F(x,b,R,R);let M=R.x,N=R.y,_=m?M:N;if(_<0||_>1||Math.abs(M-d)<P.EPSILON5&&Math.abs(N-p)<P.EPSILON5)continue;let S=Math.abs(M)<P.EPSILON5||Math.abs(M-1)<P.EPSILON5,w=Math.abs(N)<P.EPSILON5||Math.abs(N-1)<P.EPSILON5;if(S&&w)continue;let I=T.decodePosition(C,O,ev),L=T.decodeHeight(C,O),B;T.hasVertexNormals?B=T.getOctEncodedNormal(C,O,FX):(B=FX,B.x=0,B.y=0);let U=N;if(T.hasWebMercatorT){let G=P.lerp(f.south,f.north,N);U=(Oi.geodeticLatitudeToMercatorAngle(G)-E)*v}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,VX)),n.encode(i,o*A,I,R,L,B,U,V),c.minimumHeight=Math.min(c.minimumHeight,L),c.maximumHeight=Math.max(c.maximumHeight,L),++o}return o}function F0e(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!UX(d,f))continue;let p;switch(i){case _n.WEST:p=f.westIndicesSouthToNorth;break;case _n.SOUTH:p=f.southIndicesEastToWest;break;case _n.EAST:p=f.eastIndicesNorthToSouth;break;case _n.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function UX(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function B0e(e,t,n,i,o,r,s,a){let c,u,f,d,p,g=i[o?0:n.length-1],m=n[o?0:n.length-1];if(UX(g,m)&&(r===0?s===0?(c=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(c=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):s===0?(c=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(c=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){d=o?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,Ju);let x=$F(g,e.tile,Ju,Ju);if(x.x===r&&x.y===s)return kX(m,p,r,s,a),!0;if(d=Mo(c,u?r:s,function(b,T){m.encoding.decodeTextureCoordinates(m.vertices,b,Ju);let C=$F(g,e.tile,Ju,Ju);return f?u?C.x-r:C.y-s:u?r-C.x:s-C.y}),d<0){if(d=~d,d>0&&d<c.length)return qlt(t,g,e.tile,m,c[d-1],c[d],r,s,u,a),!0}else return kX(m,c[d],r,s,a),!0}return!1}var Xlt=[new h,new h,new h,new h];function Klt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Xlt;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var nv=tv;function ar(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=yn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new pe,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(ar.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(ar.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(ar.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(ar.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new pe,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new H(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=se.clone(se.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(ar.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=oe.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Jd.setOwner(e,this,"_clippingPolygons")}}});function Zlt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}ar.prototype.update=function(e){this._imageryLayers._update()};function $lt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}ar.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Zlt)})),$lt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)md._freeVertexArray(t[i]);t.length=0};ar.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};ar.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:cc.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},blending:ln.ALPHA_BLEND});let s=Ge(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=Ge(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&nv.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let u=0,f=c.length;u<f;++u){let d=c[u],p=d.data.tileBoundingRegion;Tut(this,d,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function W0e(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}ar.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)W0e(t[n],e)};ar.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};ar.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};ar.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Yn.CULLED_BUT_NEEDED,o=n.terrainState),md.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==_r.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,md.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Qlt=new ae,j0e=new se,Jlt=new se,eut=new fe;function p8(e,t){if(t.west<t.east)return t;let n=se.clone(t,Jlt);return se.center(e,eut).longitude>0?n.east=P.PI:n.west=-P.PI,n}function q0e(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!se.equals(e.cartographicLimitRectangle,se.MAX_VALUE))}ar.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=q0e(this,t);if(t.fog.enabled&&!o&&P.fog(i,t.fog.density)>=1)return _r.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return _r.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let u=p8(e.rectangle,this.cartographicLimitRectangle),f=se.simpleIntersection(u,e.rectangle,j0e);if(!l(f))return _r.NONE;if(se.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=Qlt,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),h.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(r.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!l(c))return _r.PARTIAL;let d=this._clippingPlanes;if(l(d)&&d.enabled){let b=d.computeIntersectionWithBoundingVolume(c);if(e.isClipped=b!==Wt.INSIDE,b===Wt.OUTSIDE)return _r.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(s);e.isClipped=b!==Wt.OUTSIDE}let g,m=a.computeVisibility(c);if(m===Wt.OUTSIDE?g=_r.NONE:m===Wt.INTERSECTING?g=_r.PARTIAL:m===Wt.INSIDE&&(g=_r.FULL),g===_r.NONE)return g;let x=t.mode===ne.SCENE3D&&t.camera.frustum instanceof nn;if(t.mode===ne.SCENE3D&&!x&&l(n)&&!o){let b=r.occludeePointInScaledSpace;return!l(b)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?g:_r.NONE}return g};ar.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var tut=[],nut=[];ar.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=tut;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===ho.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===ai.FAILED||p.state===ai.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=nut;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:Yn.NONE;if(p===Yn.RENDERED){let g=d.data;if(!l(g))continue;if(!o&&d.data.terrainState===ho.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let x=m[a],b=x.loadingImagery,T=!l(b)||b.state===ai.FAILED||b.state===ai.INVALID,C=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(T&&!i[C])return!1}}else p===Yn.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var iut=new h;ar.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=h.subtract(i.center,o,iut),a=h.magnitude(s);return a<P.EPSILON5?0:(h.divideByScalar(s,a,s),(1-h.dot(s,r))*e._distance)};var U0e=new F,m8=new F,out=new oe,rut=new oe,sut=new oe,aut=new h,z0e=new h,cut=new h,lut=new h;ar.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var uut=[new h,new h,new h,new h];function H0e(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=uut;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}ar.prototype.computeDistanceToTile=function(e,t){fut(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-s);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function fut(e,t,n){let i=e.data;i===void 0&&(i=e.data=new md);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Kf({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)r.minimumHeight=d._minimumHeight,r.maximumHeight=d._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,x=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Er.getHeight(r.minimumHeight,p,g),r.maximumHeight=Er.getHeight(r.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=vn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ae.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=H0e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=H0e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}ar.prototype.isDestroyed=function(){return!1};ar.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function dut(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(o=a[u],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}ar.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,d=0;for(a=0;a<u;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++d;else if(f!==-1)break}if(f===-1)return;let p=f+d;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=dut(d,e,n),s.state=ea.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=ea.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Yn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};ar.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};ar.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};ar.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var hut=new F,mut=new F;function G0e(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=F.multiplyByPoint(i,this.properties.rtc,z0e);return F.setTranslation(i,o,U0e),U0e},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=F.multiplyByPoint(i,this.properties.rtc,z0e);return F.setTranslation(i,r,m8),F.multiply(o,m8,m8),m8},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?F.multiply(e.context.uniformState.view,i.modelMatrix,hut):F.IDENTITY;return F.inverseTranspose(o,mut)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new oe(0,0,.5,1),fillHighlightColor:new H(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new z(65e5,9e6),nightFadeDistance:new z(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new F,tileRectangle:new oe,verticalExaggerationAndRelativeHeight:new z(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new z,southMercatorYAndOneOverHeight:new z,waterMask:void 0,waterMaskTranslationAndScale:new oe,minMaxHeight:new z,scaleAndBias:new F,clippingPlanesEdgeColor:H.clone(H.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new oe,frontFaceAlphaByDistance:new oe,backFaceAlphaByDistance:new oe,localizedTranslucencyRectangle:new oe,undergroundColor:H.clone(H.TRANSPARENT),undergroundColorAlphaByDistance:new oe,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?xt(n,t.materialUniformMap):n}function put(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=_ut(e,r,o),i.wireframeVertexArray.mesh=o}}function _ut(e,t,n){let o={indices:n.indices,primitiveType:Me.TRIANGLES};Ln.toWireframe(o);let r=o.indices,s=_t.createIndexBuffer({context:e,typedArray:r,usage:Fe.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ti({context:e,attributes:t._attributes,indexBuffer:s})}var Y0e,X0e,_8;(function(){let e=new St({geometry:Bd.fromDimensions({dimensions:new h(2,2,2)})}),t=new St({geometry:new I_({radius:1})}),n=new F,i,o;function r(s){return new Dn({geometryInstances:s,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}Y0e=function(s,a){return s===i||(_8(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Gt.fromColor(a),o=r(e)),o},X0e=function(s,a){return s===i||(_8(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Gt.fromColor(a),o=r(t)),o},_8=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var gut=new oe(0,0,0,0),yut={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},xut=H.TRANSPARENT,but=new Bt;function Tut(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new nv(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let me=r.credits;for(let Ce=0,mn=me.length;Ce<mn;++Ce)o.addCreditToNextFrame(me[Ce])}let s=Lt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,x=y(e.undergroundColor,xut),b=y(e.undergroundColorAlphaByDistance,but),T=q0e(e,n)&&n.mode===ne.SCENE3D&&x.alpha>0&&(b.nearValue>0||b.farValue>0),C=e.lambertDiffuseMultiplier,A=e.vertexShadowDarkness,E=e.hasWaterMask&&l(a),v=E&&e.showWaterEffect,D=e.oceanNormalMap,O=v&&l(D),R=e.terrainProvider,M=l(R)&&e.terrainProvider.hasVertexNormals,N=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,S=yn.castShadows(e.shadows)&&!d,w=yn.receiveShadows(e.shadows)&&!d,I=e.hueShift,L=e.saturationShift,B=e.brightnessShift,U=!(P.equalsEpsilon(I,0,P.EPSILON7)&&P.equalsEpsilon(L,0,P.EPSILON7)&&P.equalsEpsilon(B,0,P.EPSILON7)),V=!1;if(_){let me=h.magnitude(n.camera.positionWC),Ce=e.nightFadeOutDistance;V=me>Ce}E&&--s,O&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let G=i.renderedMesh,k=G.center,W=G.encoding,q=i.tileBoundingRegion,J=n.verticalExaggeration,j=n.verticalExaggerationRelativeHeight,K=J!==1,Q=W.hasGeodeticSurfaceNormals,de=out,xe=0,ce=0,ge=0,be=0,De=!1;if(n.mode!==ne.SCENE3D){let me=n.mapProjection,Ce=me.project(se.southwest(t.rectangle),cut),mn=me.project(se.northeast(t.rectangle),lut);if(de.x=Ce.x,de.y=Ce.y,de.z=mn.x,de.w=mn.y,n.mode!==ne.MORPHING&&(k=aut,k.x=0,k.y=(de.z+de.x)*.5,k.z=(de.w+de.y)*.5,de.x-=k.y,de.y-=k.z,de.z-=k.y,de.w-=k.z),n.mode===ne.SCENE2D&&W.quantization===Js.BITS12){let ft=1/(Math.pow(2,12)-1)*.5,ao=(de.z-de.x)*ft,Ro=(de.w-de.y)*ft;de.x-=ao,de.y-=Ro,de.z+=ao,de.w+=Ro}me instanceof Oi&&(xe=t.rectangle.south,ce=t.rectangle.north,ge=Oi.geodeticLatitudeToMercatorAngle(xe),be=1/(Oi.geodeticLatitudeToMercatorAngle(ce)-ge),De=!0)}let Ae=yut;Ae.frameState=n,Ae.surfaceTile=i,Ae.hasWaterMask=E,Ae.showReflectiveOcean=v,Ae.showOceanWaves=O,Ae.enableLighting=e.enableLighting,Ae.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ae.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ae.showGroundAtmosphere=_,Ae.atmosphereLightIntensity=e.atmosphereLightIntensity,Ae.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ae.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ae.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ae.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ae.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ae.perFragmentGroundAtmosphere=V,Ae.hasVertexNormals=M,Ae.useWebMercatorProjection=De,Ae.clippedByBoundaries=i.clippedByBoundaries,Ae.hasGeodeticSurfaceNormals=Q,Ae.hasExaggeration=K;let ke=i.imagery,ze=0,tt=ke.length,vt=e.showSkirts&&!u&&!d,pt=e.backFaceCulling&&!u&&!d,Be=pt?e._renderState:e._disableCullingRenderState,qt=pt?e._blendRenderState:e._disableCullingBlendRenderState,At=Be,lt=e._firstPassInitialColor,jn=n.context;if(l(e._debug.boundingSphereTile)||_8(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let me=e._drawCommands.length;for(let Ce=0;Ce<me;++Ce)e._uniformMaps[Ce]=G0e(n,e)}do{let me=0,Ce,mn;if(e._drawCommands.length<=e._usedDrawCommands?(Ce=new Ze,Ce.owner=t,Ce.cull=!1,Ce.boundingVolume=new ae,Ce.orientedBoundingBox=void 0,mn=G0e(n,e),e._drawCommands.push(Ce),e._uniformMaps.push(mn)):(Ce=e._drawCommands[e._usedDrawCommands],mn=e._uniformMaps[e._usedDrawCommands]),Ce.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let aa=q.boundingVolume,El=q.boundingSphere;l(aa)?Y0e(aa,H.RED).update(n):l(El)&&X0e(El,H.RED).update(n)}let ft=mn.properties;oe.clone(lt,ft.initialColor),ft.oceanNormalMap=D,ft.lightingFadeDistance.x=e.lightingFadeOutDistance,ft.lightingFadeDistance.y=e.lightingFadeInDistance,ft.nightFadeDistance.x=e.nightFadeOutDistance,ft.nightFadeDistance.y=e.nightFadeInDistance,ft.atmosphereLightIntensity=e.atmosphereLightIntensity,ft.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ft.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ft.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ft.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ft.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ft.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ao=u?g:p,Ro=u?p:g;l(ao)&&(oe.fromElements(ao.near,ao.nearValue,ao.far,ao.farValue,ft.frontFaceAlphaByDistance),oe.fromElements(Ro.near,Ro.nearValue,Ro.far,Ro.farValue,ft.backFaceAlphaByDistance)),oe.fromElements(b.near,b.nearValue,b.far,b.farValue,ft.undergroundColorAlphaByDistance),H.clone(x,ft.undergroundColor),ft.lambertDiffuseMultiplier=C,ft.vertexShadowDarkness=A;let ra=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;ra&&H.clone(e.fillHighlightColor,ft.fillHighlightColor),ft.verticalExaggerationAndRelativeHeight.x=J,ft.verticalExaggerationAndRelativeHeight.y=j,ft.center3D=G.center,h.clone(k,ft.rtc),oe.clone(de,ft.tileRectangle),ft.southAndNorthLatitude.x=xe,ft.southAndNorthLatitude.y=ce,ft.southMercatorYAndOneOverHeight.x=ge,ft.southMercatorYAndOneOverHeight.y=be;let Rr=rut,As=p8(t.rectangle,e.cartographicLimitRectangle),Le=sut,it=p8(t.rectangle,m);h.fromElements(I,L,B,ft.hsbShift);let qe=t.rectangle,Xe=1/qe.width,dt=1/qe.height;Rr.x=(As.west-qe.west)*Xe,Rr.y=(As.south-qe.south)*dt,Rr.z=(As.east-qe.west)*Xe,Rr.w=(As.north-qe.south)*dt,oe.clone(Rr,ft.localizedCartographicLimitRectangle),Le.x=(it.west-qe.west)*Xe,Le.y=(it.south-qe.south)*dt,Le.z=(it.east-qe.west)*Xe,Le.w=(it.north-qe.south)*dt,oe.clone(Le,ft.localizedTranslucencyRectangle);let Ht=N&&P.fog(t._distance,n.fog.density)>P.EPSILON3;U=U&&(Ht||_);let Tn=!1,Oo=!1,Ao=!1,Za=!1,$a=!1,Ai=!1,pi=!1,sa=!1,Zr=!1,Al=!1;for(;me<s&&ze<tt;){let aa=ke[ze],El=aa.readyImagery;if(++ze,!l(El)||El.imageryLayer.alpha===0)continue;let Nc=aa.useWebMercatorT?El.textureWebMercator:El.texture,fs=El.imageryLayer;l(aa.textureTranslationAndScale)||(aa.textureTranslationAndScale=fs._calculateTextureTranslationAndScale(t,aa)),ft.dayTextures[me]=Nc,ft.dayTextureTranslationAndScale[me]=aa.textureTranslationAndScale,ft.dayTextureTexCoordsRectangle[me]=aa.textureCoordinateRectangle,ft.dayTextureUseWebMercatorT[me]=aa.useWebMercatorT,ft.dayTextureAlpha[me]=fs.alpha,Ai=Ai||ft.dayTextureAlpha[me]!==1,ft.dayTextureNightAlpha[me]=fs.nightAlpha,pi=pi||ft.dayTextureNightAlpha[me]!==1,ft.dayTextureDayAlpha[me]=fs.dayAlpha,pi=pi||ft.dayTextureDayAlpha[me]!==1,ft.dayTextureBrightness[me]=fs.brightness,Tn=Tn||ft.dayTextureBrightness[me]!==qa.DEFAULT_BRIGHTNESS,ft.dayTextureContrast[me]=fs.contrast,Oo=Oo||ft.dayTextureContrast[me]!==qa.DEFAULT_CONTRAST,ft.dayTextureHue[me]=fs.hue,Ao=Ao||ft.dayTextureHue[me]!==qa.DEFAULT_HUE,ft.dayTextureSaturation[me]=fs.saturation,Za=Za||ft.dayTextureSaturation[me]!==qa.DEFAULT_SATURATION,ft.dayTextureOneOverGamma[me]=1/fs.gamma,$a=$a||ft.dayTextureOneOverGamma[me]!==1/qa.DEFAULT_GAMMA,ft.dayTextureSplit[me]=fs.splitDirection,sa=sa||ft.dayTextureSplit[me]!==0;let mf=ft.dayTextureCutoutRectangles[me];if(l(mf)||(mf=ft.dayTextureCutoutRectangles[me]=new oe),oe.clone(oe.ZERO,mf),l(fs.cutoutRectangle)){let zo=p8(qe,fs.cutoutRectangle),cn=se.simpleIntersection(zo,qe,j0e);Zr=l(cn)||Zr,mf.x=(zo.west-qe.west)*Xe,mf.y=(zo.south-qe.south)*dt,mf.z=(zo.east-qe.west)*Xe,mf.w=(zo.north-qe.south)*dt}let pf=ft.colorsToAlpha[me];l(pf)||(pf=ft.colorsToAlpha[me]=new oe);let _f=l(fs.colorToAlpha)&&fs.colorToAlphaThreshold>0;if(Al=Al||_f,_f){let zo=fs.colorToAlpha;pf.x=zo.red,pf.y=zo.green,pf.z=zo.blue,pf.w=fs.colorToAlphaThreshold}else pf.w=-1;if(l(El.credits)){let zo=El.credits;for(let cn=0,Ee=zo.length;cn<Ee;++cn)o.addCreditToNextFrame(zo[cn])}++me}ft.dayTextures.length=me,ft.waterMask=a,oe.clone(c,ft.waterMaskTranslationAndScale),ft.minMaxHeight.x=W.minimumHeight,ft.minMaxHeight.y=W.maximumHeight,F.clone(W.matrix,ft.scaleAndBias);let xo=e._clippingPlanes,Or=l(xo)&&xo.enabled&&t.isClipped;Or&&(ft.clippingPlanesEdgeColor=H.clone(xo.edgeColor,ft.clippingPlanesEdgeColor),ft.clippingPlanesEdgeWidth=xo.edgeWidth);let gp=e._clippingPolygons,$r=l(gp)&&gp.enabled&&t.isClipped;Ae.numberOfDayTextures=me,Ae.applyBrightness=Tn,Ae.applyContrast=Oo,Ae.applyHue=Ao,Ae.applySaturation=Za,Ae.applyGamma=$a,Ae.applyAlpha=Ai,Ae.applyDayNightAlpha=pi,Ae.applySplit=sa,Ae.enableFog=Ht,Ae.enableClippingPlanes=Or,Ae.clippingPlanes=xo,Ae.enableClippingPolygons=$r,Ae.clippingPolygons=gp,Ae.hasImageryLayerCutout=Zr,Ae.colorCorrect=U,Ae.highlightFillTile=ra,Ae.colorToAlpha=Al,Ae.showUndergroundColor=T,Ae.translucent=d;let hf=i.renderedMesh.indices.length;vt||(hf=i.renderedMesh.indexCountWithoutSkirts),Ce.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ae),Ce.castShadows=S,Ce.receiveShadows=w,Ce.renderState=At,Ce.primitiveType=Me.TRIANGLES,Ce.vertexArray=i.vertexArray||i.fill.vertexArray,Ce.count=hf,Ce.uniformMap=mn,Ce.pass=we.GLOBE,e._debug.wireframe&&(put(jn,e,t),l(i.wireframeVertexArray)&&(Ce.vertexArray=i.wireframeVertexArray,Ce.primitiveType=Me.LINES,Ce.count=hf*2));let Qa=Ce.boundingVolume,Z0=Ce.orientedBoundingBox;n.mode!==ne.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,q.minimumHeight,q.maximumHeight,Qa),h.fromElements(Qa.center.z,Qa.center.x,Qa.center.y,Qa.center),n.mode===ne.MORPHING&&(Qa=ae.union(q.boundingSphere,Qa,Qa))):(Ce.boundingVolume=ae.clone(q.boundingSphere,Qa),Ce.orientedBoundingBox=vn.clone(q.boundingVolume,Z0)),Ce.dirty=!0,d&&f.updateDerivedCommands(Ce,n),W0e(Ce,n),At=qt,lt=gut}while(ze<tt)}var QF=ar;function K0e(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=se.clone(se.MAX_VALUE)}Object.defineProperties(K0e.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Bt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Bt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=se.clone(se.MAX_VALUE)),se.clone(e,this._rectangle)}}});var JF=K0e;function Bs(){this._layers=[],this.layerAdded=new pe,this.layerRemoved=new pe,this.layerMoved=new pe,this.layerShownOrHidden=new pe}Object.defineProperties(Bs.prototype,{length:{get:function(){return this._layers.length}}});Bs.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Bs.prototype.addImageryProvider=function(e,t){let n=new qa(e);return this.add(n,t),n};Bs.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Bs.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Bs.prototype.contains=function(e){return this.indexOf(e)!==-1};Bs.prototype.indexOf=function(e){return this._layers.indexOf(e)};Bs.prototype.get=function(e){return this._layers[e]};function g8(e,t){return e.indexOf(t)}function Z0e(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Bs.prototype.raise=function(e){let t=g8(this._layers,e);Z0e(this,t,t+1)};Bs.prototype.lower=function(e){let t=g8(this._layers,e);Z0e(this,t,t-1)};Bs.prototype.raiseToTop=function(e){let t=g8(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Bs.prototype.lowerToBottom=function(e){let t=g8(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Cut=new se;function $0e(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];se.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!se.contains(u.rectangle,t))continue;let d=Cut,p=1/1024;d.west=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),se.contains(d,t)&&i(u)}}Bs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if($0e(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Bs.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if($0e(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=r[c];if(l(u)&&u.length>0)for(let d=0;d<u.length;++d){let p=u[d];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};Bs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Bs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Bs.prototype.isDestroyed=function(){return!1};Bs.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Bs.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var e2=Bs;function Q0e(e){this._ellipsoid=new V_(e.ellipsoid,h.ZERO)}Object.defineProperties(Q0e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var t2=Q0e;function gl(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Yn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=ea.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}gl.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new gl({tilingScheme:e,x:s,y:r,level:0});return i};gl.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],se.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],se.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(gl.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new gl({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new gl({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new gl({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new gl({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<ea.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});gl.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};gl.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};gl.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};gl.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};gl.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};gl.prototype.freeResources=function(){this.state=ea.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),y8(this._southwestChild),this._southwestChild=void 0,y8(this._southeastChild),this._southeastChild=void 0,y8(this._northwestChild),this._northwestChild=void 0,y8(this._northeastChild),this._northeastChild=void 0};function y8(e){l(e)&&e.freeResources()}var n2=gl;function x8(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}x8.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};x8.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),J0e(this,t)),t=i}};function J0e(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}x8.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&J0e(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var i2=x8;function _d(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new i2,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new t2({ellipsoid:n}),this._tileLoadProgressEvent=new pe,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(_d.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});_d.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Aut(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,txe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}_d.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==ea.START&&e(t),t=t.replacementNext};_d.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};_d.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};_d.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function txe(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}_d.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Aut(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),txe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};_d.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),wut(this,e),But(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Eut(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=pe.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}_d.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(Mut(this,e),Fut(this,e),Eut(this,e))};_d.prototype.isDestroyed=function(){return!1};_d.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var r2,exe=new fe;function Sut(e,t){let n=se.center(e.rectangle,exe),i=n.longitude-r2.longitude,o=n.latitude-r2.latitude;n=se.center(t.rectangle,exe);let r=n.longitude-r2.longitude,s=n.latitude-r2.latitude;return i*i+o*o-(r*r+s*s)}var vut=new h,o2=[];function wut(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles)){let x=r.tilingScheme;if(l(x)){let b=r.tilingScheme;e._levelZeroTiles=n2.createLevelZeroTiles(b);let T=e._levelZeroTiles.length;if(o2.length<T)for(o2=new Array(T),o=0;o<T;++o)o2[o]===void 0&&(o2[o]=new s2)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;r2=t.camera.positionCartographic,a.sort(Sut);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,d=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(d,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let m=F.getTranslation(g.transform,vut);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ya(e,s,r,t,c,!1,o2[o]):(hg(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=d}function hg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function s2(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function nxe(){this.southwest=new s2,this.southeast=new s2,this.northwest=new s2,this.northeast=new s2}nxe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var GX=new Array(31);for(let e=0;e<GX.length;++e)GX[e]=new nxe;function Dut(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=Rut(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:Yn.NONE,g=e.tileProvider;if(s||i){let m=Yn.originalResult(p)===Yn.RENDERED,x=Yn.originalResult(p)===Yn.CULLED||p===Yn.NONE,b=n.state===ea.DONE,T=m||x||b;if(T||l(g.canRenderWithoutLosingDetail)&&(T=g.canRenderWithoutLosingDetail(n)),T){s&&hg(e,e._tileLoadQueueMedium,n,t),b8(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&hg(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){b8(e,n),hg(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.REFINED;let x=e._tilesToRender.length,b=e._tileLoadQueueLow.length,T=e._tileLoadQueueMedium.length,C=e._tileLoadQueueHigh.length,A=e._tileToUpdateHeights.length;if(Iut(e,a,c,u,f,t,i,o),x!==e._tilesToRender.length){let E=o.allAreRenderable,v=o.anyWereRenderedLastFrame,D=o.notYetRenderableCount,O=!1;if(!E&&!v){let R=e._tilesToRender;for(let N=x;N<R.length;++N){let _=R[N];for(;_!==void 0&&_._lastSelectionResult!==Yn.KICKED&&_!==n;)_._lastSelectionResult=Yn.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=A,b8(e,n),n._lastSelectionResult=Yn.RENDERED;let M=p===Yn.RENDERED;!M&&D>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=T,e._tileLoadQueueHigh.length=C,hg(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,O=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=M,M||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!O&&hg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,b8(e,n),hg(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Iut(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=GX[t.level],p=d.southwest,g=d.southeast,m=d.northwest,x=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Ya(e,t,u,r,f,s,p),Ya(e,n,u,r,f,s,g),Ya(e,i,u,r,f,s,m),Ya(e,o,u,r,f,s,x)):(Ya(e,i,u,r,f,s,m),Ya(e,t,u,r,f,s,p),Ya(e,o,u,r,f,s,x),Ya(e,n,u,r,f,s,g)):c.latitude<t.rectangle.north?(Ya(e,n,u,r,f,s,g),Ya(e,t,u,r,f,s,p),Ya(e,o,u,r,f,s,x),Ya(e,i,u,r,f,s,m)):(Ya(e,o,u,r,f,s,x),Ya(e,i,u,r,f,s,m),Ya(e,n,u,r,f,s,g),Ya(e,t,u,r,f,s,p)),d.combine(a)}function Put(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&se.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&se.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ya(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==_r.NONE)return Dut(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Put(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&hg(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Yn.NONE;c!==Yn.CULLED_BUT_NEEDED&&c!==Yn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Yn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(hg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Yn.CULLED):t._lastSelectionResult=Yn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Rut(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof nn||t.camera.frustum instanceof Fr)return Out(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=P.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function Out(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function b8(e,t){e._tilesToRender.push(t)}function Mut(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=Ti()+e._loadQueueTimeSlice,s=e._tileProvider,a=zX(e,t,s,r,n,!1);a=zX(e,t,s,r,i,a),zX(e,t,s,r,o,a)}function Lut(e,t){return e._loadPriority-t._loadPriority}function zX(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(Lut);for(let s=0,a=o.length;s<a&&(Ti()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var iv=new hn,HX=new fe,S0=new h,Nut=[];function Fut(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Nut;n.length=0;let i=e._tileToUpdateHeights,o=Ti(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let x=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:Yn.NONE;(x===Yn.RENDERED||x===Yn.CULLED_BUT_NEEDED)&&n.push(d),i.shift(),e._lastTileIndex=0;continue}let p=d.customData,g=p.length,m=!1;for(f=e._lastTileIndex;f<g;++f){let x=p[f],b=d.data.terrainData,T=l(b)&&b.wasCreatedByUpsampling();if(d.level>x.level&&!T){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=h.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let A=u.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,iv.direction),E=u.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,iv.origin);if(!l(E)){let v=0;l(d.data.tileBoundingRegion)&&(v=d.data.tileBoundingRegion.minimumHeight);let D=Math.min(v,-11500),O=h.multiplyByScalar(A,Math.abs(D)+1,S0);h.subtract(x.positionOnEllipsoidSurface,O,iv.origin)}}else fe.clone(x.positionCartographic,HX),HX.height=-11500,c.project(HX,S0),h.fromElements(S0.z,S0.x,S0.y,S0),h.clone(S0,iv.origin),h.clone(h.UNIT_X,iv.direction);let C=d.data.pick(iv,a,c,!1,S0);l(C)&&(l(x.callback)&&x.callback(C),x.level=d.level)}if(Ti()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function But(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var a2=_d;function kh(e){e=y(e,ee.default);let t=new Qm({ellipsoid:e}),n=new e2;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new FF,this._material=void 0,this._surface=new a2({tileProvider:new QF({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new pe,this._undergroundColor=H.clone(H.BLACK),this._undergroundColorAlphaByDistance=new Bt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new JF,jX(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Se({url:en("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ee.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=P.PI*e.minimumRadius,this.nightFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*P.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=yn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(kh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=se.clone(se.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&jX(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,jX(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=H.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Bt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function jX(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[eh,HS];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(LF),e._surfaceShaderSet.baseVertexShaderSource=new Ue({sources:[eh,HS,NF],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ue({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function kut(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),o=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var Vut=[],Uut={start:0,stop:0};kh.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=Vut;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(o!==ne.SCENE3D)p.pickBoundingSphere=g=ae.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),h.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let m=$n.raySphere(e,g,Uut);l(m)&&s.push(p)}s.sort(kut(e.origin));let d;for(c=s.length,f=0;f<c&&(d=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(d));++f);return d};var zut=new fe;kh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,zut);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var Hut=new h,ixe=new h,Gut=new fe,Wut=new hn;function WX(e,t){return l(e)&&se.contains(e.rectangle,t)?e:void 0}kh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!se.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=WX(n._southwestChild,e)||WX(n._southeastChild,e)||WX(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,Hut),u=Wut,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(y(g,0),-11500),x=h.multiplyByScalar(f,Math.abs(m)+1,ixe);h.subtract(c,x,u.origin)}let p=n.data.pick(u,void 0,s,!1,ixe);if(l(p))return a.cartesianToCartographic(p,Gut).height};kh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};kh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new It({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ne.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};kh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};kh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};kh.prototype.isDestroyed=function(){return!1};kh.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var c2=kh;function jut(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var l2=jut;var gxe={},qut=32.184,Yut=2451545,oxe=-.0529921,rxe=-.1059842,sxe=13.0120009,axe=13.3407154,cxe=.9856003,lxe=26.4057084,uxe=13.064993,fxe=.3287146,dxe=1.7484877,hxe=-.1589763,mxe=.0036096,pxe=.1643573,_xe=12.9590088,qX=new Z;gxe.ComputeMoon=function(e,t){l(e)||(e=Z.now()),qX=Z.addSeconds(e,qut,qX);let n=Z.totalDays(qX)-Yut,i=n/qn.DAYS_PER_JULIAN_CENTURY,o=(125.045+oxe*n)*P.RADIANS_PER_DEGREE,r=(250.089+rxe*n)*P.RADIANS_PER_DEGREE,s=(260.008+sxe*n)*P.RADIANS_PER_DEGREE,a=(176.625+axe*n)*P.RADIANS_PER_DEGREE,c=(357.529+cxe*n)*P.RADIANS_PER_DEGREE,u=(311.589+lxe*n)*P.RADIANS_PER_DEGREE,f=(134.963+uxe*n)*P.RADIANS_PER_DEGREE,d=(276.617+fxe*n)*P.RADIANS_PER_DEGREE,p=(34.226+dxe*n)*P.RADIANS_PER_DEGREE,g=(15.134+hxe*n)*P.RADIANS_PER_DEGREE,m=(119.743+mxe*n)*P.RADIANS_PER_DEGREE,x=(239.961+pxe*n)*P.RADIANS_PER_DEGREE,b=(25.053+_xe*n)*P.RADIANS_PER_DEGREE,T=Math.sin(o),C=Math.sin(r),A=Math.sin(s),E=Math.sin(a),v=Math.sin(c),D=Math.sin(u),O=Math.sin(f),R=Math.sin(d),M=Math.sin(p),N=Math.sin(g),_=Math.sin(m),S=Math.sin(x),w=Math.sin(b),I=Math.cos(o),L=Math.cos(r),B=Math.cos(s),U=Math.cos(a),V=Math.cos(c),G=Math.cos(u),k=Math.cos(f),W=Math.cos(d),q=Math.cos(p),J=Math.cos(g),j=Math.cos(m),K=Math.cos(x),Q=Math.cos(b),de=(269.9949+.0031*i-3.8787*T-.1204*C+.07*A-.0172*E+.0072*D-.0052*N+.0043*w)*P.RADIANS_PER_DEGREE,xe=(66.5392+.013*i+1.5419*I+.0239*L-.0278*B+.0068*U-.0029*G+9e-4*k+8e-4*J-9e-4*Q)*P.RADIANS_PER_DEGREE,ce=(38.3213+13.17635815*n-14e-13*n*n+3.561*T+.1208*C-.0642*A+.0158*E+.0252*v-.0066*D-.0047*O-.0046*R+.0028*M+.0052*N+.004*_+.0019*S-.0044*w)*P.RADIANS_PER_DEGREE,ge=(13.17635815-14e-13*(2*n)+3.561*I*oxe+.1208*L*rxe-.0642*B*sxe+.0158*U*axe+.0252*V*cxe-.0066*G*lxe-.0047*k*uxe-.0046*W*fxe+.0028*q*dxe+.0052*J*hxe+.004*j*mxe+.0019*K*pxe-.0044*Q*_xe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new l2),t.rightAscension=de,t.declination=xe,t.rotation=ce,t.rotationRate=ge,t};var u2=gxe;function yxe(e){(!l(e)||typeof e!="function")&&(e=u2.ComputeMoon),this._computeFunction=e}var Xut=new h,Kut=new h,Zut=new h;function $ut(e,t,n){let i=Xut;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=Zut;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,Kut);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var Qut=new $,Jut=new Oe;yxe.prototype.evaluate=function(e,t){l(e)||(e=Z.now());let n=this._computeFunction(e),i=$ut(n.rightAscension,n.declination,t),o=P.zeroToTwoPi(n.rotation),r=Oe.fromAxisAngle(h.UNIT_Z,o,Jut),s=$.fromQuaternion(Oe.conjugate(r,r),Qut);return $.multiply(s,i,i)};var f2=yxe;var ov=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; + +in vec3 v_positionEC; + +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +{ + vec3 positionEC = czm_pointAlongRay(ray, intersection); + vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; + vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); + vec3 sphericalNormal = normalize(positionMC / u_radii); + vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates + vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates + + vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal); + vec3 positionToEyeEC = -positionEC; + + czm_materialInput materialInput; + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = (positionMC + u_radii) / u_radii; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); + +#ifdef ONLY_SUN_LIGHTING + return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); +#else + return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} + +void main() +{ + // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii + // in the vertex shader. Only when it is larger than some constant, march along the ray. + // Otherwise perform one intersection test which will be the common case. + + // Test if the ray intersects a sphere with the ellipsoid's maximum radius. + // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test + // may cause false negatives. This will discard fragments before marching the ray forward. + float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; + vec3 direction = normalize(v_positionEC); + vec3 ellipsoidCenter = czm_modelView[3].xyz; + + float t1 = -1.0; + float t2 = -1.0; + + float b = -2.0 * dot(direction, ellipsoidCenter); + float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; + + float discriminant = b * b - 4.0 * c; + if (discriminant >= 0.0) { + t1 = (-b - sqrt(discriminant)) * 0.5; + t2 = (-b + sqrt(discriminant)) * 0.5; + } + + if (t1 < 0.0 && t2 < 0.0) { + discard; + } + + float t = min(t1, t2); + if (t < 0.0) { + t = 0.0; + } + + // March ray forward to intersection with larger sphere and find + czm_ray ray = czm_ray(t * direction, direction); + + vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); + + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); + + if (czm_isEmpty(intersection)) + { + discard; + } + + // If the viewer is outside, compute outsideFaceColor, with normals facing outward. + vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); + + // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. + vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); + + out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); + out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); + +#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + t = (intersection.start != 0.0) ? intersection.start : intersection.stop; + vec3 positionEC = czm_pointAlongRay(ray, t); + vec4 positionCC = czm_projection * vec4(positionEC, 1.0); +#ifdef LOG_DEPTH + czm_writeLogDepth(1.0 + positionCC.w); +#else + float z = positionCC.z / positionCC.w; + + float n = czm_depthRange.near; + float f = czm_depthRange.far; + + gl_FragDepth = (z * (f - n) + f + n) * 0.5; +#endif +#endif +} +`;var rv=`in vec3 position; + +uniform vec3 u_radii; + +out vec3 v_positionEC; + +void main() +{ + // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. + // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, + // but doing it here allows us to change the radii without rewriting the vertex data, and + // allows all ellipsoids to reuse the same vertex data. + vec4 p = vec4(u_radii * position, 1.0); + + v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates + gl_Position = czm_modelViewProjection * p; // position in clip coordinates + + // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums + // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the + // ellipsoid (does not write depth) that was rendered in the farther frustum. + // + // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates + // artifacts since some fragments can be alpha blended twice. This is solved by only rendering + // the ellipsoid in the closest frustum to the viewer. + gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); + + czm_vertexLogDepth(); +} +`;var YX={position:0};function T8(e){e=y(e,y.EMPTY_OBJECT),this.center=h.clone(y(e.center,h.ZERO)),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new ae,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=y(e.show,!0),this.material=y(e.material,Yi.fromType(Yi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new Ze({owner:y(e._owner,this)}),this._pickCommand=new Ze({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function eft(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ra.createGeometry(Ra.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Ie.POSITION_ONLY}));return t=ti.fromGeometry({context:e,geometry:n,attributeLocations:YX,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}T8.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?ln.ALPHA_BLEND:void 0})),l(this._va)||(this._va=eft(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!F.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),F.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(r),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Ue({sources:[rv]}),p=new Ue({sources:[this.material.shaderSource,ov]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:YX}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=xt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?we.TRANSLUCENT:we.OPAQUE,g.push(f)),m.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new Ue({sources:[rv]}),p=new Ue({sources:[this.material.shaderSource,ov],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=$t.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:YX}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=xt(xt(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?we.TRANSLUCENT:we.OPAQUE,g.push(x)}};T8.prototype.isDestroyed=function(){return!1};T8.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var d2=T8;function h2(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=en("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,ee.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new d2({radii:this.ellipsoid.radii,material:Yi.fromType(Yi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new f2}Object.defineProperties(h2.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var C8=new $,tft=new $,nft=new h,A8=[];h2.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Ot.computeIcrfToFixedMatrix(n,C8))||Ot.computeTemeToPseudoFixedMatrix(n,C8);let i=this._axes.evaluate(n,tft);$.transpose(i,i),$.multiply(C8,i,i);let o=Wg.computeMoonPositionInEarthInertialFrame(n,nft);$.multiplyByVector(C8,o,o),F.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=A8,A8.length=0,t.update(e),e.commandList=r,A8.length===1?A8[0]:void 0};h2.prototype.isDestroyed=function(){return!1};h2.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var m2=h2;var XX=[],KX=[];function ift(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=XX,u=KX,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[o+d+1];f=0,d=0;for(let p=i;p<=r;++p){let g=c[f],m=u[d];f<s&&(d>=a||t(g,m,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=m,++d)}}function ZX(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);ZX(e,t,n,i,r),ZX(e,t,n,r+1,o),ift(e,t,n,i,r,o)}function oft(e,t,n){let i=e.length,o=Math.ceil(i*.5);XX.length=o,KX.length=o,ZX(e,t,n,0,i-1),XX.length=0,KX.length=0}var mg=oft;function Dc(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var E8=new h;Object.defineProperties(Dc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,E8),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,E8);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,E8),E8)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Dc.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Dc(e,t)};var bxe=new h;Dc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,bxe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var rft=new h;Dc.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,rft),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,bxe),o=this._occluderRadius-n;if(o=h.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),o*o+n*n>h.magnitudeSquared(i)):!1;if(o>0){i=h.subtract(t,this._cameraPosition,i);let r=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var sft=new h;Dc.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return _r.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,sft),o=this._occluderRadius-n,r=h.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return o*o+n*n<s?_r.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?_r.FULL:_r.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?_r.PARTIAL:_r.FULL))}}return _r.NONE};var S8=new h;Dc.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,s=n.length,a=h.normalize(h.subtract(i,o,S8),S8),c=-h.dot(a,o),u=Dc._anyRotationVector(o,a,c),f=Dc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=Dc._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=r/f;return h.add(o,h.multiplyByScalar(a,p,S8),S8)};var aft=[];Dc.computeOccludeePointFromRectangle=function(e,t){t=y(t,ee.default);let n=se.subsample(e,t,0,aft),i=ae.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return Dc.computeOccludeePoint(new ae(o,t.minimumRadius),i.center,n)};var cft=new h;Dc._anyRotationVector=function(e,t,n){let i=h.abs(t,cft),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new h,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,r),i),e,i),i)};var lft=new h;Dc._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,lft);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let s=h.cross(t,r,r);if(h.magnitude(s)>P.EPSILON13)return h.normalize(s,new h)}return o};var $X=new h,uft=new h,v8=new h,xxe=new h;Dc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,$X),s=h.clone(e.center,uft),a=e.radius,c=h.subtract(s,r,v8),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),b=p*m*p;c=h.normalize(c,c);let T=h.add(r,h.multiplyByScalar(c,b,xxe),xxe),C=Math.sqrt(d-b*b),A=this._rotationVector(s,t,n,r,i),E=h.fromElements(A.x*A.x*c.x+(A.x*A.y-A.z)*c.y+(A.x*A.z+A.y)*c.z,(A.x*A.y+A.z)*c.x+A.y*A.y*c.y+(A.y*A.z-A.x)*c.z,(A.x*A.z-A.y)*c.x+(A.y*A.z+A.x)*c.y+A.z*A.z*c.z,$X);E=h.normalize(E,E);let v=h.multiplyByScalar(E,C,$X);A=h.normalize(h.subtract(h.add(T,v,v8),s,v8),v8);let D=h.dot(t,A);A=h.normalize(h.subtract(h.subtract(T,v,A),s,A),A);let O=h.dot(t,A);return D<O?D:O};var p2=Dc;function tp(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new _s,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function QX(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(tp.prototype,{projectionMatrix:{get:function(){return QX(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return QX(this),this._infinitePerspective}}});var fft=new h,dft=new h,hft=new h,mft=new h;tp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,fft),d=dft;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=hft;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=mft;h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new oe),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new oe),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new oe),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new oe),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new oe),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new oe),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};tp.prototype.getPixelDimensions=function(e,t,n,i,o){QX(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};tp.prototype.clone=function(e){return l(e)||(e=new tp),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};tp.prototype.equals=function(e){return l(e)&&e instanceof tp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};tp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof tp&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var yl=tp;function nu(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new yl,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}nu.packedLength=6;nu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};nu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new nu),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Vh(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(nu.prototype,{projectionMatrix:{get:function(){return Vh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Vh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Vh(this),this._fovy}},sseDenominator:{get:function(){return Vh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Vh(this),this._offCenterFrustum}}});nu.prototype.computeCullingVolume=function(e,t,n){return Vh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};nu.prototype.getPixelDimensions=function(e,t,n,i,o){return Vh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};nu.prototype.clone=function(e){return l(e)||(e=new nu),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};nu.prototype.equals=function(e){return!l(e)||!(e instanceof nu)?!1:(Vh(this),Vh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};nu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof nu)?!1:(Vh(this),Vh(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ii=nu;var _2=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; + +float vdcRadicalInverse(int i) +{ + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) + { + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); + } + return value; +} + +vec2 hammersley2D(int i, int N) +{ + return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} + +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ + float alphaRoughnessSquared = alphaRoughness * alphaRoughness; + float phi = 2.0 * M_PI * xi.x; + float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); + vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangentX = normalize(cross(upVector, N)); + vec3 tangentY = cross(N, tangentX); + return tangentX * H.x + tangentY * H.y + N * H.z; +} + +/** + * Estimate the geometric self-shadowing of the microfacets in a surface, + * using the Smith Joint GGX visibility function. + * Note: Vis = G / (4 * NdotL * NdotV) + * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3 + * see Real-Time Rendering. Page 331 to 336. + * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg) + * + * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness. + * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source. + * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera. + */ +float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) +{ + float alphaRoughnessSq = alphaRoughness * alphaRoughness; + + float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); + float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); + + float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0 + if (GGX > 0.0) + { + return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0 + } + return 0.0; +} + +vec2 integrateBrdf(float roughness, float NdotV) +{ + vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); + float A = 0.0; + float B = 0.0; + const int NumSamples = 1024; + float alphaRoughness = roughness * roughness; + for (int i = 0; i < NumSamples; i++) + { + vec2 xi = hammersley2D(i, NumSamples); + vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); + vec3 L = 2.0 * dot(V, H) * H - V; + float NdotL = clamp(L.z, 0.0, 1.0); + float NdotH = clamp(H.z, 0.0, 1.0); + float VdotH = clamp(dot(V, H), 0.0, 1.0); + if (NdotL > 0.0) + { + float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); + float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; + float Fc = pow(1.0 - VdotH, 5.0); + A += (1.0 - Fc) * G_Vis; + B += Fc * G_Vis; + } + } + return vec2(A, B) / float(NumSamples); +} + +void main() +{ + out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); +} +`;function g2(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(g2.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function pft(e,t,n){let i=t.createViewportQuadCommand(_2,{framebuffer:n,renderState:Ve.fromCache({viewport:new je(0,0,256,256)})});e._drawCommand=i}g2.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new It({context:t,width:256,height:256,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:Zt.NEAREST});this._colorTexture=n;let i=new Nr({context:t,colorTextures:[n],destroyAttachments:!1});pft(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};g2.prototype.isDestroyed=function(){return!1};g2.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var y2=g2;var Exe={};function _ft(e,t,n){let i,o,r;if(e instanceof Ii){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof yl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var gft=new h,Txe=new h;function Sxe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-r)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(o){return P.lerp(e,t,o)}}function eK(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,gft),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),Txe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),Txe));r=Math.min(_ft(d,g,m)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return P.lerp(n,i,a)}}function x2(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var vxe=new h;function yft(e,t,n,i,o,r,s,a){let c=e.camera,u=h.clone(c.position,vxe),f=c.pitch,d=x2(c.heading,i),p=x2(c.roll,r),g=eK(c,n,u.z,n.z,s),m=Sxe(f,o,g,a);function x(b){let T=b.time/t;c.setView({orientation:{heading:P.lerp(d,i,T),pitch:m(T),roll:P.lerp(p,r,T)}}),z.lerp(u,n,T,c.position),c.position.z=g(T)}return x}function xft(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function bft(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var Tft=new fe,Cft=new fe;function Aft(e,t,n,i,o,r,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=fe.clone(f.positionCartographic,Tft),m=f.pitch,x=x2(f.heading,i),b=x2(f.roll,r),T=p.cartesianToCartographic(n,Cft);g.longitude=P.zeroToTwoPi(g.longitude),T.longitude=P.zeroToTwoPi(T.longitude);let C=!1;if(l(a)){let D=P.zeroToTwoPi(a),O=Math.min(g.longitude,T.longitude),R=Math.max(g.longitude,T.longitude),M=D>=O&&D<=R;if(l(c)){let N=Math.abs(g.longitude-T.longitude),_=P.TWO_PI-N;(M?N:_)<(M?_:N)*c&&!M&&(C=!0)}else M||(C=!0)}C?xft(g,T):bft(g,T);let A=eK(f,n,g.height,T.height,s),E=Sxe(m,o,A,u);function v(){let D=g.longitude,O=T.longitude,R=g.latitude,M=T.latitude;return function(_){let S=_.time/t,w=h.fromRadians(P.lerp(D,O,S),P.lerp(R,M,S),A(S),p);f.setView({destination:w,orientation:{heading:P.lerp(x,i,S),pitch:E(S),roll:P.lerp(b,r,S)}})}}return v()}function Eft(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,vxe),u=x2(a.heading,i),f=a.frustum.right-a.frustum.left,d=eK(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:P.lerp(u,i,m)}}),z.lerp(c,n,m,a.position);let x=d(m),b=a.frustum,T=b.top/b.right,C=(x-(b.right-b.left))*.5;b.right+=C,b.left-=C,b.top=T*b.right,b.bottom=-b.top}return p}var Cxe=new fe,Sft=new h;function JX(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Axe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Exe.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ne.MORPHING)return JX();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;o&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,Cxe),n=r.project(Cxe,Sft));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let x=y(t.heading,0),b=y(t.pitch,-P.PI_OVER_TWO),T=y(t.roll,0),C=e.screenSpaceCameraController;C.enableInputs=!1;let A=Axe(C,t.complete),E=Axe(C,t.cancel),v=p.frustum,D=e.mode===ne.SCENE2D;if(D=D&&z.equalsEpsilon(p.position,n,P.EPSILON6),D=D&&P.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,P.EPSILON6),D=D||e.mode!==ne.SCENE2D&&h.equalsEpsilon(n,p.position,P.EPSILON10),D=D&&P.equalsEpsilon(P.negativePiToPi(x),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(b),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(T),P.negativePiToPi(p.roll),P.EPSILON10),D)return JX(A,E);let O=new Array(4);if(O[ne.SCENE2D]=Eft,O[ne.SCENE3D]=Aft,O[ne.COLUMBUS_VIEW]=yft,m<=0)return JX(function(){O[i](e,1,n,x,b,T,a,c,u,f)({time:1}),typeof A=="function"&&A()},E);let R=O[i](e,m,n,x,b,T,a,c,u,f);if(!l(d)){let M=p.positionCartographic.height,N=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;M>N&&M>11500?d=Kr.CUBIC_OUT:d=Kr.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:A,cancel:E}};var b2=Exe;var vft={ROTATE:0,INFINITE_SCROLL:1},iu=Object.freeze(vft);function Jt(e){this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new fe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Ii,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new pe,this._moveEnd=new pe,this._changed=new pe,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new F,this._invViewMatrix=new F,Lxe(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new fe(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,qxe(this,Jt.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*Jt.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}Jt.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Jt.TRANSFORM_2D_INVERSE=F.inverseTransformation(Jt.TRANSFORM_2D,new F);Jt.DEFAULT_VIEW_RECTANGLE=se.fromDegrees(-95,-20,-70,90);Jt.DEFAULT_VIEW_FACTOR=.5;Jt.DEFAULT_OFFSET=new cd(0,-P.PI_OVER_FOUR,0);function Lxe(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function wft(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ti()):e.timeSinceMoved=Math.max(Ti()-e._lastMovedTimestamp,0)/1e3}}Jt.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};Jt.prototype._updateCameraChanged=function(){let e=this;if(wft(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%P.TWO_PI;s=s>P.PI?P.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,x=e._changedFrustum,b=p.x+m.left,T=p.x+m.right,C=g.x+x.left,A=g.x+x.right,E=p.y+m.bottom,v=p.y+m.top,D=g.y+x.bottom,O=g.y+x.top,R=Math.max(b,C),M=Math.min(T,A),N=Math.max(E,D),_=Math.min(v,O),S;if(R>=M||N>=v)S=1;else{let w=x;b<C&&T>A&&E<D&&v>O&&(w=m),S=1-(M-R)*(_-N)/((w.right-w.left)*(w.top-w.bottom))}S>t&&(e._changed.raiseEvent(S),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=P.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function Dft(e){Ot.basisTo2D(e._projection,e._transform,e._actualTransform)}var Ift=new fe,Pft=new h,w8=new h,Rft=new oe,Oft=new oe,Mft=new oe,Lft=new oe,Nft=new oe;function Fft(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,Rft),o=n.cartesianToCartographic(i,Ift),r=t.project(o,Pft),s=Oft;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=oe.clone(oe.UNIT_X,Nft),c=oe.add(F.getColumn(e._transform,0,w8),i,w8);n.cartesianToCartographic(c,o),t.project(o,r);let u=Mft;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=Lft;if(h.magnitudeSquared(u)>P.EPSILON10)h.cross(a,u,f);else{let d=oe.add(F.getColumn(e._transform,1,w8),i,w8);n.cartesianToCartographic(d,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<P.EPSILON10&&(oe.clone(oe.UNIT_Y,u),oe.clone(oe.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),F.setColumn(e._actualTransform,0,u,e._actualTransform),F.setColumn(e._actualTransform,1,f,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var tK=new h;function Pc(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!h.equals(o,e.position)||n;r&&(o=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone(Jt.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?Dft(e):Fft(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=F.multiplyByPoint(g,o,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=tK;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===ne.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,tK));if(Math.abs(1-m)>P.EPSILON2){let x=1/h.magnitudeSquared(c),b=h.dot(c,s)*x,T=h.multiplyByScalar(s,b,tK);c=h.normalize(h.subtract(c,T,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=F.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=F.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=F.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||u||d||p)&&Lxe(e)}function Nxe(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function Fxe(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function Bxe(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var P8=new F,R8=new F;Object.defineProperties(Jt.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Pc(this),this._invTransform}},viewMatrix:{get:function(){return Pc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Pc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Pc(this),this._positionCartographic}},positionWC:{get:function(){return Pc(this),this._positionWC}},directionWC:{get:function(){return Pc(this),this._directionWC}},upWC:{get:function(){return Pc(this),this._upWC}},rightWC:{get:function(){return Pc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,P8),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,R8);this._setTransform(n);let i=Nxe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,P8),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,R8);this._setTransform(n);let i=Fxe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,P8),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,R8);this._setTransform(n);let i=Bxe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});Jt.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===ne.SCENE2D&&zxe(this,this.position)};var Bft=new h,kft=new h,Vft=new h;Jt.prototype._setTransform=function(e){let t=h.clone(this.positionWC,Bft),n=h.clone(this.upWC,kft),i=h.clone(this.directionWC,Vft);F.clone(e,this._transform),this._transformChanged=!0,Pc(this);let o=this._actualInvTransform;F.multiplyByPoint(o,t,this.position),F.multiplyByPointAsVector(o,i,this.direction),F.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),Pc(this)};var Uft=new z,zft=new hn,Hft=new h,Gft=new h;function kxe(e){if(!F.equals(F.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=Uft;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,zft);o=n.pickWorldCoordinates(a,t,!0,Hft)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,Gft));let s;if(l(o)||l(r)){let a=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}Jt.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof nn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=kxe(this)))};var O8=new h,sK=new F,Wft=new F,aK=new Oe,cK=new $,Vxe=new fe;function jft(e,t,n){let i=F.clone(e.transform,sK),o=Ot.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Wft);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let r=Oe.fromHeadingPitchRoll(n,aK),s=$.fromQuaternion(r,cK);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function qft(e,t,n,i){let o=F.clone(e.transform,sK);if(e._setTransform(F.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Vxe);t=a.project(c,O8)}h.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let r=Oe.fromHeadingPitchRoll(n,aK),s=$.fromQuaternion(r,cK);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Yft(e,t,n,i){let o=F.clone(e.transform,sK);if(e._setTransform(F.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,Vxe);t=c.project(u,O8)}z.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===iu.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let r=Oe.fromHeadingPitchRoll(n,aK),s=$.fromQuaternion(r,cK);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Xft=new h,Kft=new h,Zft=new h;function Uxe(e,t,n,i){let o=h.clone(n.direction,Xft),r=h.clone(n.up,Kft);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Ot.eastNorthUpToFixedFrame(t,a,P8),u=F.inverseTransformation(c,R8);F.multiplyByPointAsVector(u,o,o),F.multiplyByPointAsVector(u,r,r)}let s=h.cross(o,r,Zft);return i.heading=Nxe(o,r),i.pitch=Fxe(o),i.roll=Bxe(o,r,s),i}var rK={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},sv=new Da;Jt.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,h.clone(this.positionWC,O8));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,O8),i=!1),l(t.direction)&&(t=Uxe(this,o,t,rK.orientation)),sv.heading=y(t.heading,0),sv.pitch=y(t.pitch,-P.PI_OVER_TWO),sv.roll=y(t.roll,0),n===ne.SCENE3D?jft(this,o,sv):n===ne.SCENE2D?Yft(this,o,sv,i):qft(this,o,sv,i)};var $ft=new h;Jt.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:Jt.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(Jt.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*Jt.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,$ft).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};Jt.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new oe),Pc(this),F.multiplyByVector(this._actualInvTransform,e,t)};Jt.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Pc(this),F.multiplyByPoint(this._actualInvTransform,e,t)};Jt.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Pc(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};Jt.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new oe),Pc(this),F.multiplyByVector(this._actualTransform,e,t)};Jt.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Pc(this),F.multiplyByPoint(this._actualTransform,e,t)};Jt.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Pc(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function zxe(e,t){let n=e._scene.mapMode2D===iu.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var wxe=new h;Jt.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,wxe),h.add(n,wxe,n),this._mode===ne.SCENE2D&&zxe(this,n),this._adjustOrthographicFrustum(!0)};Jt.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?M8(this,e):this.move(this.direction,e)};Jt.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?M8(this,-e):this.move(this.direction,-e)};Jt.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};Jt.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};Jt.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};Jt.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};Jt.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,-e)};Jt.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,e)};Jt.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,-e)};Jt.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,e)};var Qft=new Oe,Jft=new $;Jt.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Oe.fromAxisAngle(e,-n,Qft),o=$.fromQuaternion(i,Jft),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};Jt.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};Jt.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var edt=new Oe,tdt=new $;Jt.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Oe.fromAxisAngle(e,-n,edt),o=$.fromQuaternion(i,tdt);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};Jt.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),Hxe(this,e)};Jt.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),Hxe(this,-e)};var ndt=new h,idt=new h,odt=new h,Dxe=new h;function Hxe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,P.EPSILON2)){let i=h.normalize(n,ndt),o=h.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,Dxe),P.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,idt),a=h.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=h.dot(i,h.negate(s,Dxe)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=h.cross(s,i,odt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}Jt.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),Gxe(this,-e)};Jt.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),Gxe(this,e)};function Gxe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function M8(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===iu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===iu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Wxe(e,t){e.move(e.direction,t)}Jt.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?M8(this,e):Wxe(this,e)};Jt.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?M8(this,-e):Wxe(this,-e)};Jt.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return h.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var rdt=new F;Jt.prototype.lookAt=function(e,t){let n=this._scene,i=y(n.ellipsoid,ee.default),o=Ot.eastNorthUpToFixedFrame(e,i,rdt);this.lookAtTransform(o,t)};var sdt=new h,adt=new Oe,cdt=new Oe,ldt=new $;function jxe(e,t,n){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let i=Oe.fromAxisAngle(h.UNIT_Y,-t,adt),o=Oe.fromAxisAngle(h.UNIT_Z,-e,cdt),r=Oe.multiply(o,i,o),s=$.fromQuaternion(r,ldt),a=h.clone(h.UNIT_X,sdt);return $.multiplyByVector(s,a,a),h.negate(a,a),h.multiplyByScalar(a,n,a),a}Jt.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=jxe(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){z.clone(z.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<P.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(F.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<P.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var T2=new fe,udt=new fe,fdt=new h,ddt=new h,hdt=new h,mdt=new h,pdt=new h,_dt=new h,gdt=new h,nK=new h,ydt={direction:new h,right:new h,up:new h},Ixe;function Ic(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function qxe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:ydt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=P.TWO_PI);let f=(c+u)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let M=T2;M.longitude=f,M.latitude=s,M.height=0;let N=udt;N.longitude=f,N.latitude=a,N.height=0;let _=Ixe;(!l(_)||_.ellipsoid!==o)&&(Ixe=_=new Fp(void 0,void 0,o)),_.setEndPoints(M,N),d=_.interpolateUsingFraction(.5,T2).latitude}let p=T2;p.longitude=f,p.latitude=d,p.height=0;let g=o.cartographicToCartesian(p,gdt),m=T2;m.longitude=u,m.latitude=s;let x=o.cartographicToCartesian(m,fdt);m.longitude=c;let b=o.cartographicToCartesian(m,hdt);m.longitude=f;let T=o.cartographicToCartesian(m,pdt);m.latitude=a;let C=o.cartographicToCartesian(m,_dt);m.longitude=u;let A=o.cartographicToCartesian(m,mdt);m.longitude=c;let E=o.cartographicToCartesian(m,ddt);h.subtract(b,g,b),h.subtract(A,g,A),h.subtract(x,g,x),h.subtract(E,g,E),h.subtract(T,g,T),h.subtract(C,g,C);let v=o.geodeticSurfaceNormal(g,r.direction);h.negate(v,v);let D=h.cross(v,h.UNIT_Z,r.right);h.normalize(D,D);let O=h.cross(D,v,r.up),R;if(e.frustum instanceof nn){let M=Math.max(h.distance(x,b),h.distance(A,E)),N=Math.max(h.distance(x,A),h.distance(b,E)),_,S,w=e.frustum._offCenterFrustum,I=w.right/w.top,L=N*I;M>L?(_=M,S=_/I):(S=N,_=L),R=Math.max(_,S)}else{let M=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*M;if(R=Math.max(Ic(v,O,b,M),Ic(v,O,A,M),Ic(v,O,x,M),Ic(v,O,E,M),Ic(v,O,T,M),Ic(v,O,C,M),Ic(v,D,b,N),Ic(v,D,A,N),Ic(v,D,x,N),Ic(v,D,E,N),Ic(v,D,T,N),Ic(v,D,C,N)),a<0&&s>0){let _=T2;_.longitude=c,_.latitude=0,_.height=0;let S=o.cartographicToCartesian(_,nK);h.subtract(S,g,S),R=Math.max(R,Ic(v,O,S,M),Ic(v,D,S,N)),_.longitude=u,S=o.cartographicToCartesian(_,nK),h.subtract(S,g,S),R=Math.max(R,Ic(v,O,S,M),Ic(v,D,S,N))}}return h.add(g,h.multiplyByScalar(v,-R,nK),n)}var xdt=new fe,bdt=new h,Tdt=new h;function Cdt(e,t,n){let i=e._projection;t.west>t.east&&(t=se.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=xdt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,bdt);F.multiplyByPoint(o,a,a),F.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Tdt);if(F.multiplyByPoint(o,c,c),F.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var Adt=new fe,Edt=new h,Sdt=new h;function vdt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===iu.INFINITE_SCROLL?o+=P.TWO_PI:(t=se.MAX_VALUE,o=t.east));let r=Adt;r.longitude=o,r.latitude=t.north;let s=i.project(r,Edt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,Sdt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}Jt.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===ne.SCENE3D)return qxe(this,e,t);if(n===ne.COLUMBUS_VIEW)return Cdt(this,e,t);if(n===ne.SCENE2D)return vdt(this,e,t)};var wdt=new hn;function Ddt(e,t,n,i){n=y(n,ee.default);let o=e.getPickRay(t,wdt),r=$n.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return hn.getPoint(o,s,i)}var Idt=new hn;function Pdt(e,t,n,i){let r=e.getPickRay(t,Idt).origin;r=h.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Rdt=new hn;function Odt(e,t,n,i){let o=e.getPickRay(t,Rdt),r=-o.origin.x/o.direction.x;hn.getPoint(o,r,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}Jt.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=y(t,ee.default),this._mode===ne.SCENE3D)n=Ddt(this,e,t,n);else if(this._mode===ne.SCENE2D)n=Pdt(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=Odt(this,e,this._projection,n);else return;return n}};var Mdt=new h,Ldt=new h,Ndt=new h;function Fdt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,Mdt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,Ldt),m=h.multiplyByScalar(e.upWC,f*c*s,Ndt),x=h.add(p,g,n.direction);return h.add(x,m,x),h.subtract(x,d,x),h.normalize(x,x),n}var D8=new h;function Bdt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return h.clone(e.position,f),h.multiplyByScalar(e.right,c,D8),h.add(D8,f,f),h.multiplyByScalar(e.up,u,D8),h.add(D8,f,f),h.clone(e.directionWC,n.direction),(e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D)&&h.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}Jt.prototype.getPickRay=function(e,t){l(t)||(t=new hn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?Fdt(this,e,t):Bdt(this,e,t)};var kdt=new h,Vdt=new h;Jt.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,kdt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),Vdt);return Math.max(0,h.magnitude(n)-e.radius)};var Udt=new z;Jt.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Udt);return Math.max(o.x,o.y)};function zdt(e,t,n,i,o,r){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Kr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var Hdt=new h,Pxe=new h,Gdt=new h,Wdt=new h;function jdt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,Hdt),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,Pxe),Pxe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Gdt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,Wdt)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),x=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-x||n.y>x){let b=s.y<-m||s.y>m,T=s.z<-x||s.z>x;if(b||T)return zdt(e,n,s,m,x,t)}}Jt.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return jdt(this,e)};var qdt=new h,ta={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};Jt.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};Jt.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=ta.destination,e.orientation.heading=ta.heading,e.orientation.pitch=ta.pitch,e.orientation.roll=ta.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};Jt.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof se;i&&(t=this.getRectangleCameraCoordinates(t,qdt));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=Uxe(this,t,o,rK.orientation)),l(e.duration)&&e.duration<=0){let f=rK;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;ta.destination=t,ta.heading=o.heading,ta.pitch=o.pitch,ta.roll=o.roll,ta.duration=e.duration,ta.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},ta.cancel=e.cancel,ta.endTransform=e.endTransform,ta.convert=i?!1:e.convert,ta.maximumHeight=e.maximumHeight,ta.pitchAdjustHeight=e.pitchAdjustHeight,ta.flyOverLongitude=e.flyOverLongitude,ta.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ta.easingFunction=e.easingFunction;let a=this._scene,c=b2.createTween(a,ta);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=Jt.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Ydt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Xdt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var Kdt=100;function Yxe(e,t,n){n=cd.clone(l(n)?n:Jt.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=Kdt:e.frustum instanceof nn||e._mode===ne.SCENE2D?n.range=Xdt(e,s):n.range=Ydt(e,s),n.range=P.clamp(n.range,i,o)}return n}Jt.prototype.viewBoundingSphere=function(e,t){t=Yxe(this,e,t),this.lookAt(e.center,t)};var Zdt=new F,$dt=new h,Qdt=new h,Jdt=new h,eht=new h,tht=new oe,nht=new Oe,iht=new $;Jt.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=Yxe(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,$dt):o=jxe(i.heading,i.pitch,i.range);let r=this._scene,s=y(r.ellipsoid,ee.default),a=Ot.eastNorthUpToFixedFrame(e.center,s,Zdt);F.multiplyByPoint(a,o,o);let c,u;if(!n){if(c=h.subtract(e.center,o,Qdt),h.normalize(c,c),u=F.multiplyByPointAsVector(a,h.UNIT_Z,Jdt),1-Math.abs(h.dot(c,u))<P.EPSILON6){let d=Oe.fromAxisAngle(c,i.heading,nht),p=$.fromQuaternion(d,iht);h.fromCartesian4(F.getColumn(a,1,tht),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,eht);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var Rxe=new h,Oxe=new h,iK=new h,Mxe=new h,C2=[new h,new h,new h,new h];function oht(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,Rxe),r=h.magnitude(o),s=h.normalize(o,Oxe),a,c;h.equalsEpsilon(s,h.UNIT_Z,P.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,iK),iK),c=h.normalize(h.cross(s,a,Mxe),Mxe));let u=Math.sqrt(h.magnitudeSquared(o)-1),f=h.multiplyByScalar(s,1/r,Rxe),d=u/r,p=h.multiplyByScalar(a,d,Oxe),g=h.multiplyByScalar(c,d,iK),m=h.add(f,g,C2[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let x=h.subtract(f,g,C2[1]);h.subtract(x,p,x),h.multiplyComponents(n,x,x);let b=h.subtract(f,g,C2[2]);h.add(b,p,b),h.multiplyComponents(n,b,b);let T=h.add(f,g,C2[3]);return h.add(T,p,T),h.multiplyComponents(n,T,T),C2}var oK=new z,rht=new h,v0=[new fe,new fe,new fe,new fe];function I8(e,t,n,i,o,r){oK.x=e,oK.y=t;let s=i.pickEllipsoid(oK,o,rht);return l(s)?(v0[n]=o.cartesianToCartographic(s,v0[n]),1):(v0[n]=o.cartesianToCartographic(r[n],v0[n]),0)}Jt.prototype.computeViewRectangle=function(e,t){e=y(e,ee.default);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ae(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Wt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,u=oht(this,e);if(c+=I8(0,0,0,this,e,u),c+=I8(0,a,1,this,e,u),c+=I8(s,a,2,this,e,u),c+=I8(s,0,3,this,e,u),c<2)return se.MAX_VALUE;t=se.fromCartographicArray(v0,t);let f=0,d=v0[3].longitude;for(let p=0;p<4;++p){let g=v0[p].longitude,m=Math.abs(g-d);m>P.PI?f+=P.TWO_PI-m:f+=m,d=g}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,v0[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};Jt.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof Ii)return;let e=this._scene;this.frustum=new Ii,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};Jt.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof nn)return;let e=kxe(this),t=this._scene;this.frustum=new nn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};Jt.clone=function(e,t){return l(t)||(t=new Jt(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var so=Jt;function sht(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var gd=sht;var Qxe=Zo(uu(),1),Xxe=576,aht=100,A2="#ffffff",L8="#48b";function Jxe(e,t){this.credit=e,this.count=y(t,1)}function cht(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(bt.equals(o,t))return!0}return!1}function lht(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;bt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var ebe="cesium-credit-delimiter";function Kxe(e){let t=document.createElement("span");return t.textContent=e,t.className=ebe,t}function Zxe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function $xe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(Kxe(n));else{let f=o[u];f.className!==ebe&&e.replaceChild(Kxe(n),f)}}let c=a.element;if(o.length<=r)e.appendChild(Zxe(c,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(Zxe(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function uht(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<Xxe?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=Xxe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function fht(e){let t=` .cesium-credit-lightbox-overlay { display: none; z-index: 1; @@ -12546,19 +11036,19 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, .cesium-credit-lightbox { background-color: #303336; - color: ${U2}; + color: ${A2}; position: relative; - min-height: ${nht}px; + min-height: ${aht}px; margin: auto; } .cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited, .cesium-credit-wrapper a, .cesium-credit-wrapper a:visited { - color: ${U2}; + color: ${A2}; } .cesium-credit-lightbox > ul > li a:hover { - color: ${B8}; + color: ${L8}; } .cesium-credit-lightbox.cesium-credit-lightbox-expanded { border: 1px solid #444; @@ -12578,10 +11068,10 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, position: absolute; top: 0; right: 6px; - color: ${U2}; + color: ${A2}; } .cesium-credit-lightbox-close:hover { - color: ${B8}; + color: ${L8}; } .cesium-credit-lightbox > ul { margin: 0; @@ -12600,14 +11090,14 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, padding-left: 5px; cursor: pointer; text-decoration: underline; - color: ${U2}; + color: ${A2}; } .cesium-credit-expand-link:hover { - color: ${B8}; + color: ${L8}; } .cesium-credit-text { - color: ${U2}; + color: ${A2}; } .cesium-credit-delimiter { @@ -12620,13 +11110,60 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, } .cesium-credit-textContainer a:hover { - color: ${B8} + color: ${L8} } .cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { padding-left: 5px; } -`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function gr(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(m){r.contains(m.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),sht(e);let g=Tt.clone(gr.cesiumCredit);this._delimiter=y(t,"\u2022"),this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new St,lightboxCredits:new St},this._defaultCredit=void 0,this.viewport=n,this.container=e}function Jxe(e,t,n,i){i=y(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new $xe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}gr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Tt.clone(ebe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,Jxe(this,t,e)};gr.prototype.addStaticCredit=function(e){let t=this._staticCredits;iht(t,e)||t.push(e)};gr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};gr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};gr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};gr.prototype.update=function(){this._expanded&&rht(this)};gr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Tt.equals(gr.cesiumCredit,this._cesiumCredit)||Jxe(this,s,r,Number.MAX_VALUE)}Tt.equals(gr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Tt.clone(gr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};gr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Kxe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Kxe(this._creditList,t,void 0,"li"),oht(this)};gr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};gr.prototype.isDestroyed=function(){return!1};gr._cesiumCredit=void 0;gr._cesiumCreditInitialized=!1;var k8;function ebe(){if(!l(k8)){let e=nn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Zxe.default(e).path()),k8=new Tt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return gr._cesiumCreditInitialized||(gr._cesiumCredit=k8,gr._cesiumCreditInitialized=!0),k8}Object.defineProperties(gr,{cesiumCredit:{get:function(){return ebe(),gr._cesiumCredit},set:function(e){gr._cesiumCredit=e,gr._cesiumCreditInitialized=!0}}});gr.CreditDisplayElement=$xe;var z2=gr;var V8=0,aht=1;function zT(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e._drawNearPlane,!0),s,a;t instanceof wi?(s=V8,a=wi.packedLength):t instanceof rn&&(s=aht,a=rn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Oe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Oe.packedLength+Ie.packedLength}zT.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===V8?(wi.pack(o,t,n),n+=wi.packedLength):(rn.pack(o,t,n),n+=rn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Oe.pack(e._orientation,t,n),n+=Oe.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._drawNearPlane?1:0,t};var cht=new wi,lht=new rn,uht=new Oe,fht=new h,dht=new Ie;zT.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===V8?(o=wi.unpack(e,t,cht),t+=wi.packedLength):(o=rn.unpack(e,t,lht),t+=rn.packedLength);let r=h.unpack(e,t,fht);t+=h.packedLength;let s=Oe.unpack(e,t,uht);t+=Oe.packedLength;let a=Ie.unpack(e,t,dht);t+=Ie.packedLength;let c=e[t]===1;if(!l(n))return new zT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Oe.clone(s,n._orientation),n._vertexFormat=Ie.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function lv(e,t,n,i,o,r,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var hht=new $,mht=new F,cK=new F,tbe=new h,nbe=new h,ibe=new h,pht=new h,_ht=new h,ght=new h,R0=new Array(3),H2=new Array(4);H2[0]=new oe(-1,-1,1,1);H2[1]=new oe(1,-1,1,1);H2[2]=new oe(1,1,1,1);H2[3]=new oe(-1,1,1,1);var obe=new Array(4);for(let e=0;e<4;++e)obe[e]=new oe;zT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,hht),u=y(r,tbe),f=y(s,nbe),d=y(a,ibe);u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=F.computeView(e,d,f,u,mht),g,m,x=i.projectionMatrix;if(n===V8){let b=F.multiply(x,p,cK);m=F.inverse(b,cK)}else g=F.inverseTransformation(p,cK);l(m)?(R0[0]=i.near,R0[1]=i.far):(R0[0]=0,R0[1]=i.near,R0[2]=i.far);for(let b=0;b<2;++b)for(let T=0;T<4;++T){let C=oe.clone(H2[T],obe[T]);if(l(m)){C=F.multiplyByVector(m,C,C);let A=1/C.w;h.multiplyByScalar(C,A,C),h.subtract(C,e,C),h.normalize(C,C);let E=h.dot(d,C);h.multiplyByScalar(C,R0[b]/E,C),h.add(C,e,C)}else{let A=i.offCenterFrustum;l(A)&&(i=A);let E=R0[b],v=R0[b+1];C.x=(C.x*(i.right-i.left)+i.left+i.right)*.5,C.y=(C.y*(i.top-i.bottom)+i.bottom+i.top)*.5,C.z=(C.z*(E-v)-E-v)*.5,C.w=1,F.multiplyByVector(g,C,C)}o[12*b+T*3]=C.x,o[12*b+T*3+1]=C.y,o[12*b+T*3+2]=C.z}};zT.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);zT._computeNearFarPlanes(i,o,t,n,c);let u=3*4*2;c[u]=c[3*4],c[u+1]=c[3*4+1],c[u+2]=c[3*4+2],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[3*3],c[u+7]=c[3*3+1],c[u+8]=c[3*3+2],c[u+9]=c[3*7],c[u+10]=c[3*7+1],c[u+11]=c[3*7+2],u+=3*4,c[u]=c[3*5],c[u+1]=c[3*5+1],c[u+2]=c[3*5+2],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[3*4],c[u+10]=c[3*4+1],c[u+11]=c[3*4+2],u+=3*4,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[3*5],c[u+4]=c[3*5+1],c[u+5]=c[3*5+2],c[u+6]=c[3*6],c[u+7]=c[3*6+1],c[u+8]=c[3*6+2],c[u+9]=c[3*2],c[u+10]=c[3*2+1],c[u+11]=c[3*2+2],u+=3*4,c[u]=c[3*2],c[u+1]=c[3*2+1],c[u+2]=c[3*2+2],c[u+3]=c[3*6],c[u+4]=c[3*6+1],c[u+5]=c[3*6+2],c[u+6]=c[3*7],c[u+7]=c[3*7+1],c[u+8]=c[3*7+2],c[u+9]=c[3*3],c[u+10]=c[3*3+1],c[u+11]=c[3*3+2],r||(c=c.subarray(3*4));let f=new fn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,m=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,b=tbe,T=nbe,C=ibe,A=h.negate(b,pht),E=h.negate(T,_ht),v=h.negate(C,ght);u=0,r&&(lv(u,p,g,m,x,v,b,T),u+=3*4),lv(u,p,g,m,x,C,A,T),u+=3*4,lv(u,p,g,m,x,A,v,T),u+=3*4,lv(u,p,g,m,x,E,v,A),u+=3*4,lv(u,p,g,m,x,b,C,T),u+=3*4,lv(u,p,g,m,x,T,C,A),l(p)&&(f.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),l(x)&&(f.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:x}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new at({attributes:f,indices:d,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromVertices(c)})};var HT=zT;var lK=0,yht=1;function G2(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e._drawNearPlane,!0),r,s;t instanceof wi?(r=lK,s=wi.packedLength):t instanceof rn&&(r=yht,s=rn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Oe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Oe.packedLength}G2.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===lK?(wi.pack(o,t,n),n+=wi.packedLength):(rn.pack(o,t,n),n+=rn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Oe.pack(e._orientation,t,n),n+=Oe.packedLength,t[n]=e._drawNearPlane?1:0,t};var xht=new wi,bht=new rn,Tht=new Oe,Cht=new h;G2.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===lK?(o=wi.unpack(e,t,xht),t+=wi.packedLength):(o=rn.unpack(e,t,bht),t+=rn.packedLength);let r=h.unpack(e,t,Cht);t+=h.packedLength;let s=Oe.unpack(e,t,Tht);t+=Oe.packedLength;let a=e[t]===1;if(!l(n))return new G2({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Oe.clone(s,n._orientation),n._drawNearPlane=a,n};G2.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);HT._computeNearFarPlanes(i,o,t,n,s);let a=new fn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=r?2:1,d=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new at({attributes:a,indices:d,primitiveType:Me.LINES,boundingSphere:ae.fromVertices(s)})};var W2=G2;function U8(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,H.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Aht=new h,Eht=new $,Sht=new Oe,vht=new wi,wht=new gl,Dht=new rn,Iht=new Fr,Pht=new H,Rht=[1,1e5];U8.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof wi?a=vht:s instanceof gl?a=wht:s instanceof rn?a=Dht:a=Iht,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=Rht,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,d=r.directionWC,p=r.upWC,g=r.rightWC;g=h.negate(g,Aht);let m=Eht;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let x=Oe.fromRotationMatrix(m,Sht);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Dn({geometryInstances:new vt({geometry:new HT({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Wt.fromColor(H.fromAlpha(this._color,.1,Pht))},id:this.id,pickPrimitive:this}),appearance:new cn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Dn({geometryInstances:new vt({geometry:new W2({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Wt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};U8.prototype.isDestroyed=function(){return!1};U8.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var op=U8;function q2(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var j2=Ht.supportsTypedArrays()?new Float32Array(12):[],rbe=new h,sbe=new h,uK=new h,abe=new h,z8=new h;function Oht(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof rn)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,rbe),g=h.normalize(p,sbe),m=h.normalize(h.cross(h.UNIT_Z,p,uK),uK),x=h.normalize(h.cross(g,m,abe),abe),b=h.magnitude(p),T=Math.sqrt(b*b-1);o=h.multiplyByScalar(g,1/b,rbe);let C=T/b;r=h.multiplyByScalar(m,C,sbe),s=h.multiplyByScalar(x,C,uK)}let a=h.add(o,s,z8);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,j2,0);let c=h.subtract(o,s,z8);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,j2,3);let u=h.add(o,s,z8);h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,j2,6);let f=h.subtract(o,s,z8);return h.add(f,r,f),h.multiplyComponents(n,f,f),h.pack(f,j2,9),j2}q2.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ee(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new Ze({renderState:this._rs,boundingVolume:new ae(h.ZERO,i.maximumRadius),pass:we.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Ue({sources:[OP]}),a=new Ue({sources:[RP]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Oht(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new at({attributes:{position:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Me.TRIANGLES});this._va=ei.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Fe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};q2.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};q2.prototype.isDestroyed=function(){return!1};q2.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Y2=q2;function fv(){}var Mht=/\bgl_FragDepth\b/,Lht=/\bdiscard\b/;function Nht(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(Mht.test(r[a])||Lht.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() +`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function gr(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(m){r.contains(m.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),fht(e);let g=bt.clone(gr.cesiumCredit);this._delimiter=y(t,"\u2022"),this._screenContainer=d,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Et,lightboxCredits:new Et},this._defaultCredit=void 0,this.viewport=n,this.container=e}function tbe(e,t,n,i){i=y(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Jxe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}gr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=bt.clone(nbe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,tbe(this,t,e)};gr.prototype.addStaticCredit=function(e){let t=this._staticCredits;cht(t,e)||t.push(e)};gr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};gr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};gr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};gr.prototype.update=function(){this._expanded&&uht(this)};gr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&bt.equals(gr.cesiumCredit,this._cesiumCredit)||tbe(this,s,r,Number.MAX_VALUE)}bt.equals(gr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=bt.clone(gr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};gr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;$xe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",$xe(this._creditList,t,void 0,"li"),lht(this)};gr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};gr.prototype.isDestroyed=function(){return!1};gr._cesiumCredit=void 0;gr._cesiumCreditInitialized=!1;var N8;function nbe(){if(!l(N8)){let e=en("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Qxe.default(e).path()),N8=new bt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return gr._cesiumCreditInitialized||(gr._cesiumCredit=N8,gr._cesiumCreditInitialized=!0),N8}Object.defineProperties(gr,{cesiumCredit:{get:function(){return nbe(),gr._cesiumCredit},set:function(e){gr._cesiumCredit=e,gr._cesiumCreditInitialized=!0}}});gr.CreditDisplayElement=Jxe;var E2=gr;var F8=0,dht=1;function zT(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e._drawNearPlane,!0),s,a;t instanceof Ii?(s=F8,a=Ii.packedLength):t instanceof nn&&(s=dht,a=nn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Oe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Oe.packedLength+Ie.packedLength}zT.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===F8?(Ii.pack(o,t,n),n+=Ii.packedLength):(nn.pack(o,t,n),n+=nn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Oe.pack(e._orientation,t,n),n+=Oe.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._drawNearPlane?1:0,t};var hht=new Ii,mht=new nn,pht=new Oe,_ht=new h,ght=new Ie;zT.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===F8?(o=Ii.unpack(e,t,hht),t+=Ii.packedLength):(o=nn.unpack(e,t,mht),t+=nn.packedLength);let r=h.unpack(e,t,_ht);t+=h.packedLength;let s=Oe.unpack(e,t,pht);t+=Oe.packedLength;let a=Ie.unpack(e,t,ght);t+=Ie.packedLength;let c=e[t]===1;if(!l(n))return new zT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Oe.clone(s,n._orientation),n._vertexFormat=Ie.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function av(e,t,n,i,o,r,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var yht=new $,xht=new F,lK=new F,ibe=new h,obe=new h,rbe=new h,bht=new h,Tht=new h,Cht=new h,w0=new Array(3),S2=new Array(4);S2[0]=new oe(-1,-1,1,1);S2[1]=new oe(1,-1,1,1);S2[2]=new oe(1,1,1,1);S2[3]=new oe(-1,1,1,1);var sbe=new Array(4);for(let e=0;e<4;++e)sbe[e]=new oe;zT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,yht),u=y(r,ibe),f=y(s,obe),d=y(a,rbe);u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=F.computeView(e,d,f,u,xht),g,m,x=i.projectionMatrix;if(n===F8){let b=F.multiply(x,p,lK);m=F.inverse(b,lK)}else g=F.inverseTransformation(p,lK);l(m)?(w0[0]=i.near,w0[1]=i.far):(w0[0]=0,w0[1]=i.near,w0[2]=i.far);for(let b=0;b<2;++b)for(let T=0;T<4;++T){let C=oe.clone(S2[T],sbe[T]);if(l(m)){C=F.multiplyByVector(m,C,C);let A=1/C.w;h.multiplyByScalar(C,A,C),h.subtract(C,e,C),h.normalize(C,C);let E=h.dot(d,C);h.multiplyByScalar(C,w0[b]/E,C),h.add(C,e,C)}else{let A=i.offCenterFrustum;l(A)&&(i=A);let E=w0[b],v=w0[b+1];C.x=(C.x*(i.right-i.left)+i.left+i.right)*.5,C.y=(C.y*(i.top-i.bottom)+i.bottom+i.top)*.5,C.z=(C.z*(E-v)-E-v)*.5,C.w=1,F.multiplyByVector(g,C,C)}o[12*b+T*3]=C.x,o[12*b+T*3+1]=C.y,o[12*b+T*3+2]=C.z}};zT.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);zT._computeNearFarPlanes(i,o,t,n,c);let u=3*4*2;c[u]=c[3*4],c[u+1]=c[3*4+1],c[u+2]=c[3*4+2],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[3*3],c[u+7]=c[3*3+1],c[u+8]=c[3*3+2],c[u+9]=c[3*7],c[u+10]=c[3*7+1],c[u+11]=c[3*7+2],u+=3*4,c[u]=c[3*5],c[u+1]=c[3*5+1],c[u+2]=c[3*5+2],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[3*4],c[u+10]=c[3*4+1],c[u+11]=c[3*4+2],u+=3*4,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[3*5],c[u+4]=c[3*5+1],c[u+5]=c[3*5+2],c[u+6]=c[3*6],c[u+7]=c[3*6+1],c[u+8]=c[3*6+2],c[u+9]=c[3*2],c[u+10]=c[3*2+1],c[u+11]=c[3*2+2],u+=3*4,c[u]=c[3*2],c[u+1]=c[3*2+1],c[u+2]=c[3*2+2],c[u+3]=c[3*6],c[u+4]=c[3*6+1],c[u+5]=c[3*6+2],c[u+6]=c[3*7],c[u+7]=c[3*7+1],c[u+8]=c[3*7+2],c[u+9]=c[3*3],c[u+10]=c[3*3+1],c[u+11]=c[3*3+2],r||(c=c.subarray(3*4));let f=new un({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,m=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,b=ibe,T=obe,C=rbe,A=h.negate(b,bht),E=h.negate(T,Tht),v=h.negate(C,Cht);u=0,r&&(av(u,p,g,m,x,v,b,T),u+=3*4),av(u,p,g,m,x,C,A,T),u+=3*4,av(u,p,g,m,x,A,v,T),u+=3*4,av(u,p,g,m,x,E,v,A),u+=3*4,av(u,p,g,m,x,b,C,T),u+=3*4,av(u,p,g,m,x,T,C,A),l(p)&&(f.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),l(x)&&(f.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:x}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new st({attributes:f,indices:d,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromVertices(c)})};var HT=zT;var uK=0,Aht=1;function v2(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e._drawNearPlane,!0),r,s;t instanceof Ii?(r=uK,s=Ii.packedLength):t instanceof nn&&(r=Aht,s=nn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Oe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Oe.packedLength}v2.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===uK?(Ii.pack(o,t,n),n+=Ii.packedLength):(nn.pack(o,t,n),n+=nn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Oe.pack(e._orientation,t,n),n+=Oe.packedLength,t[n]=e._drawNearPlane?1:0,t};var Eht=new Ii,Sht=new nn,vht=new Oe,wht=new h;v2.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===uK?(o=Ii.unpack(e,t,Eht),t+=Ii.packedLength):(o=nn.unpack(e,t,Sht),t+=nn.packedLength);let r=h.unpack(e,t,wht);t+=h.packedLength;let s=Oe.unpack(e,t,vht);t+=Oe.packedLength;let a=e[t]===1;if(!l(n))return new v2({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Oe.clone(s,n._orientation),n._drawNearPlane=a,n};v2.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);HT._computeNearFarPlanes(i,o,t,n,s);let a=new un({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=r?2:1,d=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new st({attributes:a,indices:d,primitiveType:Me.LINES,boundingSphere:ae.fromVertices(s)})};var w2=v2;function B8(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,H.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Dht=new h,Iht=new $,Pht=new Oe,Rht=new Ii,Oht=new yl,Mht=new nn,Lht=new Fr,Nht=new H,Fht=[1,1e5];B8.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Ii?a=Rht:s instanceof yl?a=Oht:s instanceof nn?a=Mht:a=Lht,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=Fht,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,d=r.directionWC,p=r.upWC,g=r.rightWC;g=h.negate(g,Dht);let m=Iht;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let x=Oe.fromRotationMatrix(m,Pht);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Dn({geometryInstances:new St({geometry:new HT({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Gt.fromColor(H.fromAlpha(this._color,.1,Nht))},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Dn({geometryInstances:new St({geometry:new w2({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Gt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};B8.prototype.isDestroyed=function(){return!1};B8.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var np=B8;var D2=`in vec4 positionEC; + +void main() +{ + vec3 position; + vec3 direction; + if (czm_orthographicIn3D == 1.0) + { + vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; + vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom + vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top + position = vec3(mix(minPlane, maxPlane, uv), 0.0); + direction = vec3(0.0, 0.0, -1.0); + } + else + { + position = vec3(0.0); + direction = normalize(positionEC.xyz); + } + + czm_ray ray = czm_ray(position, direction); + + vec3 ellipsoid_center = czm_view[3].xyz; + + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); + if (!czm_isEmpty(intersection)) + { + out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); + } + else + { + discard; + } + + czm_writeLogDepth(); +} +`;var I2=`in vec4 position; + +out vec4 positionEC; + +void main() +{ + positionEC = czm_modelView * position; + gl_Position = czm_projection * positionEC; + + czm_vertexLogDepth(); +} +`;function R2(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var P2=zt.supportsTypedArrays()?new Float32Array(12):[],abe=new h,cbe=new h,fK=new h,lbe=new h,k8=new h;function Bht(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof nn)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,abe),g=h.normalize(p,cbe),m=h.normalize(h.cross(h.UNIT_Z,p,fK),fK),x=h.normalize(h.cross(g,m,lbe),lbe),b=h.magnitude(p),T=Math.sqrt(b*b-1);o=h.multiplyByScalar(g,1/b,abe);let C=T/b;r=h.multiplyByScalar(m,C,cbe),s=h.multiplyByScalar(x,C,fK)}let a=h.add(o,s,k8);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,P2,0);let c=h.subtract(o,s,k8);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,P2,3);let u=h.add(o,s,k8);h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,P2,6);let f=h.subtract(o,s,k8);return h.add(f,r,f),h.multiplyComponents(n,f,f),h.pack(f,P2,9),P2}R2.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ee(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new Ze({renderState:this._rs,boundingVolume:new ae(h.ZERO,i.maximumRadius),pass:we.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Ue({sources:[I2]}),a=new Ue({sources:[D2]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Bht(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new st({attributes:{position:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Me.TRIANGLES});this._va=ti.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Fe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};R2.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};R2.prototype.isDestroyed=function(){return!1};R2.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var O2=R2;function lv(){}var kht=/\bgl_FragDepth\b/,Vht=/\bdiscard\b/;function Uht(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(kht.test(r[a])||Vht.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() { out_FragColor = vec4(1.0); } @@ -12635,31 +11172,31 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, out_FragColor = vec4(1.0); czm_writeLogDepth(); } -`;i=new Ue({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function Fht(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ve.fromCache(o);return n[t.id]=r,r}fv.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=Ze.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=Nht(n,t.shaderProgram),i.depthOnlyCommand.renderState=Fht(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var Bht=/\s+czm_writeLogDepth\(/,kht=/\s+czm_vertexLogDepth\(/;function Vht(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let f=0;f<c.length;++f)if(kht.test(c[f])){a=!0;break}if(!a){for(let d=0;d<c.length;++d)c[d]=Ue.replaceMain(c[d],"czm_log_depth_main");c.push(` +`;i=new Ue({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function zht(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ve.fromCache(o);return n[t.id]=r,r}lv.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=Ze.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=Uht(n,t.shaderProgram),i.depthOnlyCommand.renderState=zht(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var Hht=/\s+czm_writeLogDepth\(/,Ght=/\s+czm_vertexLogDepth\(/;function Wht(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let f=0;f<c.length;++f)if(Ght.test(c[f])){a=!0;break}if(!a){for(let d=0;d<c.length;++d)c[d]=Ue.replaceMain(c[d],"czm_log_depth_main");c.push(` void main() { czm_log_depth_main(); czm_vertexLogDepth(); } -`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)Bht.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Ue.replaceMain(c[f],"czm_log_depth_main");u=` +`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)Hht.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Ue.replaceMain(c[f],"czm_log_depth_main");u=` void main() { czm_log_depth_main(); czm_writeLogDepth(); } -`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}fv.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=Ze.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Vht(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Uht(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () +`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}lv.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=Ze.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Wht(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function jht(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () { czm_non_pick_main(); if (${c}.a == 0.0) { discard; } ${c} = ${n}; -} `,f=r.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Ue.replaceMain(r[g],"czm_non_pick_main");d[f]=u;let p=new Ue({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function cbe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ve.fromCache(o);return n[t.id]=r,r}fv.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=Ze.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Uht(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=cbe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function uv(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function lbe(e){return e.isArray?e.arrayLength:lt.getComponentCount(e.type)}function zht(e){let t=lbe(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function ube(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function fbe(e,t){let n=Vt.getMaximum(t);return`(${e}) / float(${n})`}function Hht(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=ube(n,i,o)}return e.normalized||(n=fbe(n,e.componentType)),n}function Ght(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=ube(o,r,s)}return e.normalized||(o=fbe(o,e.componentType)),o}function Wht(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=zht(u),d=["0.0","0.0","0.0","0.0"],p=lbe(u);if(p===1)d[0]=Hht(u,c);else{let b=["x","y","z","w"];for(let T=0;T<p;T++)d[T]=Ght(u,c,b[T])}let g=t.fragmentShaderSource.defines.slice();g.push(Du.METADATA_PICKING_ENABLED),uv(g,Du.METADATA_PICKING_VALUE_TYPE,f),uv(g,Du.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),uv(g,Du.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),uv(g,Du.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),uv(g,Du.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),uv(g,Du.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Ue({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}fv.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=Ze.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Wht(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=cbe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function jht(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}fv.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=Ze.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=jht(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var rp=fv;function H8(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(o),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var qht=new Oe,dbe=new Oe,Yht=new $;function Xht(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Oe.fromAxisAngle(o,n,dbe),c=Oe.fromAxisAngle(r,i,qht),u=Oe.multiply(c,a,c),f=Oe.fromAxisAngle(s,t,dbe);Oe.multiply(f,u,u);let d=$.fromQuaternion(u,Yht);$.multiplyByVector(d,r,r),$.multiplyByVector(d,s,s),$.multiplyByVector(d,o,o)}H8.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;Xht(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};H8.prototype.isDestroyed=function(){return!1};H8.prototype.destroy=function(){return this._removeListener(),ue(this)};var X2=H8;function fK(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(fK.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var Kht=new h;fK.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==ne.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,P.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,Kht),a=Math.abs(h.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var K2=fK;function Zht(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var Z2=Zht;var ba={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},GT=ba.DERIVED_COMMANDS_MAXIMUM_LENGTH,Cbe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function WT(){this._frontFaceAlphaByDistance=new kt(0,1,0,1),this._backFaceAlphaByDistance=new kt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=se.clone(se.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(GT),this._derivedBlendCommandTypes=new Array(GT),this._derivedPickCommandTypes=new Array(GT),this._derivedCommandTypesToUpdate=new Array(GT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(WT.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});WT.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=hbe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=hbe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=mbe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=mbe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=emt(this,e,t),this._sunVisibleThroughGlobe=$ht(this,e),this._environmentVisible=Qht(this,e),this._useDepthPlane=Jht(this,e),this._numberOfTextureUniforms=tmt(this),this._rectangle=se.clone(t.translucency.rectangle,this._rectangle),nmt(this,e)};function hbe(e,t,n,i){return e?l(n)?(kt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function mbe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function $ht(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Qht(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Jht(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function emt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function tmt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function nmt(e,t){e._derivedCommandsLength=dK(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=dK(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=dK(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<GT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=gmt())}function dK(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?ba.PICK_FRONT_FACE:u?ba.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ba.TRANSLUCENT_FRONT_FACE,d=i?ba.PICK_BACK_FACE:u?ba.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ba.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(o[r++]=ba.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=ba.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=d):(o[r++]=d,o[r++]=f)):c?(n||(o[r++]=ba.DEPTH_ONLY_BACK_FACE),o[r++]=ba.OPAQUE_FRONT_FACE,o[r++]=d):(n||(o[r++]=ba.DEPTH_ONLY_FRONT_FACE),o[r++]=ba.OPAQUE_BACK_FACE,o[r++]=f),r)}function xd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function pbe(e,t){return e.indexOf(t)>-1}function imt(e,t){xd(e.defines,"TRANSLUCENT"),xd(t.defines,"TRANSLUCENT")}function omt(e,t){xd(e.defines,"GROUND_ATMOSPHERE"),xd(t.defines,"GROUND_ATMOSPHERE"),xd(e.defines,"FOG"),xd(t.defines,"FOG"),xd(e.defines,"TRANSLUCENT"),xd(t.defines,"TRANSLUCENT")}function hK(e,t){if(pbe(t.defines,"TILE_LIMIT_RECTANGLE")||pbe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +} `,f=r.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Ue.replaceMain(r[g],"czm_non_pick_main");d[f]=u;let p=new Ue({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function ube(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ve.fromCache(o);return n[t.id]=r,r}lv.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=Ze.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=jht(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=ube(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function cv(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function fbe(e){return e.isArray?e.arrayLength:ct.getComponentCount(e.type)}function qht(e){let t=fbe(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function dbe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function hbe(e,t){let n=kt.getMaximum(t);return`(${e}) / float(${n})`}function Yht(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=dbe(n,i,o)}return e.normalized||(n=hbe(n,e.componentType)),n}function Xht(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=dbe(o,r,s)}return e.normalized||(o=hbe(o,e.componentType)),o}function Kht(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=qht(u),d=["0.0","0.0","0.0","0.0"],p=fbe(u);if(p===1)d[0]=Yht(u,c);else{let b=["x","y","z","w"];for(let T=0;T<p;T++)d[T]=Xht(u,c,b[T])}let g=t.fragmentShaderSource.defines.slice();g.push(Du.METADATA_PICKING_ENABLED),cv(g,Du.METADATA_PICKING_VALUE_TYPE,f),cv(g,Du.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),cv(g,Du.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),cv(g,Du.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),cv(g,Du.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),cv(g,Du.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Ue({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}lv.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=Ze.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Kht(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=ube(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function Zht(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}lv.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=Ze.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Zht(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var ip=lv;function V8(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(o),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var $ht=new Oe,mbe=new Oe,Qht=new $;function Jht(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Oe.fromAxisAngle(o,n,mbe),c=Oe.fromAxisAngle(r,i,$ht),u=Oe.multiply(c,a,c),f=Oe.fromAxisAngle(s,t,mbe);Oe.multiply(f,u,u);let d=$.fromQuaternion(u,Qht);$.multiplyByVector(d,r,r),$.multiplyByVector(d,s,s),$.multiplyByVector(d,o,o)}V8.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;Jht(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};V8.prototype.isDestroyed=function(){return!1};V8.prototype.destroy=function(){return this._removeListener(),ue(this)};var M2=V8;function dK(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(dK.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var emt=new h;dK.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==ne.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,P.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,emt),a=Math.abs(h.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var L2=dK;function tmt(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var N2=tmt;var Ca={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},GT=Ca.DERIVED_COMMANDS_MAXIMUM_LENGTH,Ebe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function WT(){this._frontFaceAlphaByDistance=new Bt(0,1,0,1),this._backFaceAlphaByDistance=new Bt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=se.clone(se.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(GT),this._derivedBlendCommandTypes=new Array(GT),this._derivedPickCommandTypes=new Array(GT),this._derivedCommandTypesToUpdate=new Array(GT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(WT.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});WT.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=pbe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=pbe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=_be(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=_be(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=rmt(this,e,t),this._sunVisibleThroughGlobe=nmt(this,e),this._environmentVisible=imt(this,e),this._useDepthPlane=omt(this,e),this._numberOfTextureUniforms=smt(this),this._rectangle=se.clone(t.translucency.rectangle,this._rectangle),amt(this,e)};function pbe(e,t,n,i){return e?l(n)?(Bt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function _be(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function nmt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function imt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function omt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function rmt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function smt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function amt(e,t){e._derivedCommandsLength=hK(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=hK(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=hK(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<GT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=Cmt())}function hK(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?Ca.PICK_FRONT_FACE:u?Ca.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Ca.TRANSLUCENT_FRONT_FACE,d=i?Ca.PICK_BACK_FACE:u?Ca.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Ca.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(o[r++]=Ca.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=Ca.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=d):(o[r++]=d,o[r++]=f)):c?(n||(o[r++]=Ca.DEPTH_ONLY_BACK_FACE),o[r++]=Ca.OPAQUE_FRONT_FACE,o[r++]=d):(n||(o[r++]=Ca.DEPTH_ONLY_FRONT_FACE),o[r++]=Ca.OPAQUE_BACK_FACE,o[r++]=f),r)}function yd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function gbe(e,t){return e.indexOf(t)>-1}function cmt(e,t){yd(e.defines,"TRANSLUCENT"),yd(t.defines,"TRANSLUCENT")}function lmt(e,t){yd(e.defines,"GROUND_ATMOSPHERE"),yd(t.defines,"GROUND_ATMOSPHERE"),yd(e.defines,"FOG"),yd(t.defines,"FOG"),yd(e.defines,"TRANSLUCENT"),yd(t.defines,"TRANSLUCENT")}function mK(e,t){if(gbe(t.defines,"TILE_LIMIT_RECTANGLE")||gbe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() { out_FragColor = vec4(1.0); } -`;t.sources=[n]}function mK(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Ue.replaceMain(n[r],"czm_globe_translucency_main");n.push(` +`;t.sources=[n]}function pK(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Ue.replaceMain(n[r],"czm_globe_translucency_main");n.push(` uniform sampler2D u_classificationTexture; void main() @@ -12686,7 +11223,7 @@ void main() } out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); } -`)}function Abe(e,t){mK(e,t),xd(e.defines,"GROUND_ATMOSPHERE"),xd(t.defines,"GROUND_ATMOSPHERE"),xd(e.defines,"FOG"),xd(t.defines,"FOG")}function rmt(e,t){mK(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function smt(e,t){Abe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function _be(e,t){let n=`uniform sampler2D u_classificationTexture; +`)}function Sbe(e,t){pK(e,t),yd(e.defines,"GROUND_ATMOSPHERE"),yd(t.defines,"GROUND_ATMOSPHERE"),yd(e.defines,"FOG"),yd(t.defines,"FOG")}function umt(e,t){pK(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function fmt(e,t){Sbe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function ybe(e,t){let n=`uniform sampler2D u_classificationTexture; void main() { vec2 st = gl_FragCoord.xy / czm_viewport.zw; @@ -12697,7 +11234,7 @@ void main() } out_FragColor = pickColor; } -`;t.sources=[n]}function amt(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function cmt(e){e.cull.face=yi.BACK,e.cull.enabled=!0}function lmt(e){e.cull.face=yi.FRONT,e.cull.enabled=!0}function umt(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function fmt(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function dmt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function gbe(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function ybe(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function hmt(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function mmt(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function pmt(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ve.getState(e);i(s),r=Ve.fromCache(s),o[e.id]=r}return r}function dv(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function _mt(e,t,n,i,o){return l(o)?!i&&l(n)?n:bt(t,o(e),!1):t}function zh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function gmt(){return[new zh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:imt,getRenderStateFunction:cmt,getUniformMapFunction:void 0}),new zh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:omt,getRenderStateFunction:lmt,getUniformMapFunction:void 0}),new zh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:hK,getRenderStateFunction:umt,getUniformMapFunction:void 0}),new zh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:hK,getRenderStateFunction:fmt,getUniformMapFunction:void 0}),new zh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:hK,getRenderStateFunction:dmt,getUniformMapFunction:void 0}),new zh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:mK,getRenderStateFunction:gbe,getUniformMapFunction:dv}),new zh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Abe,getRenderStateFunction:ybe,getUniformMapFunction:dv}),new zh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:rmt,getRenderStateFunction:gbe,getUniformMapFunction:dv}),new zh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:smt,getRenderStateFunction:ybe,getUniformMapFunction:dv}),new zh({pass:we.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:_be,getRenderStateFunction:hmt,getUniformMapFunction:dv}),new zh({pass:we.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:_be,getRenderStateFunction:mmt,getUniformMapFunction:dv})]}var xbe=new Array(GT),bbe=new Array(GT);WT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)bbe[o]=this._derivedCommandPacks[n[o]],xbe[o]=Cbe[n[o]];ymt(this,e,i,n,xbe,bbe,t)}};function ymt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),d=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),x&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let T=r[b],C=i[b],A=o[b],E=a[A],v,D,O;l(E)?(v=E.uniformMap,D=E.shaderProgram,O=E.renderState):(v=void 0,D=void 0,O=void 0),E=Ze.shallowClone(t,E),a[A]=E;let R=y(E.derivedCommands.uniformMapDirtyFrame,0),M=y(E.derivedCommands.shaderProgramDirtyFrame,0),N=y(E.derivedCommands.renderStateDirtyFrame,0),_=g||R<f,S=m||M<d,w=x||N<p;_&&(E.derivedCommands.uniformMapDirtyFrame=u),S&&(E.derivedCommands.shaderProgramDirtyFrame=u),w&&(E.derivedCommands.renderStateDirtyFrame=u),E.derivedCommands.type=C,E.pass=T.pass,E.pickOnly=T.pickOnly,E.uniformMap=_mt(e,t.uniformMap,v,_,T.getUniformMapFunction),E.shaderProgram=amt(s.context,t.shaderProgram,D,S,T.getShaderProgramFunction,A),E.renderState=pmt(t.renderState,O,w,T.getRenderStateFunction,T.renderStateCache)}}}WT.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=Cbe[o[a]];n.commandList.push(s[c])}};function Ebe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function Tbe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var xmt=[ba.OPAQUE_FRONT_FACE,ba.OPAQUE_BACK_FACE],bmt=[ba.DEPTH_ONLY_FRONT_FACE,ba.DEPTH_ONLY_BACK_FACE,ba.DEPTH_ONLY_FRONT_AND_BACK_FACE];WT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[we.GLOBE],a=e.indices[we.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),Ebe(s,a,t,i,o,xmt))};WT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[we.GLOBE],c=e.indices[we.GLOBE],u=e.commands[we.TERRAIN_CLASSIFICATION],f=e.indices[we.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&Tbe(u,f,t,i,o),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,Ebe(a,c,t,i,o,bmt),r.depthTexture){let x=n.packDepth(r,o);s.globeDepthTexture=x}Tbe(u,f,t,i,o),s.globeDepthTexture=g,o.framebuffer=m};var $2=WT;var ou=`uniform sampler2D colorTexture; +`;t.sources=[n]}function dmt(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function hmt(e){e.cull.face=xi.BACK,e.cull.enabled=!0}function mmt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0}function pmt(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function _mt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function gmt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function xbe(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=ln.ALPHA_BLEND}function bbe(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=ln.ALPHA_BLEND}function ymt(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function xmt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function bmt(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ve.getState(e);i(s),r=Ve.fromCache(s),o[e.id]=r}return r}function uv(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Tmt(e,t,n,i,o){return l(o)?!i&&l(n)?n:xt(t,o(e),!1):t}function Uh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Cmt(){return[new Uh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:cmt,getRenderStateFunction:hmt,getUniformMapFunction:void 0}),new Uh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:lmt,getRenderStateFunction:mmt,getUniformMapFunction:void 0}),new Uh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:mK,getRenderStateFunction:pmt,getUniformMapFunction:void 0}),new Uh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:mK,getRenderStateFunction:_mt,getUniformMapFunction:void 0}),new Uh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:mK,getRenderStateFunction:gmt,getUniformMapFunction:void 0}),new Uh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:pK,getRenderStateFunction:xbe,getUniformMapFunction:uv}),new Uh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Sbe,getRenderStateFunction:bbe,getUniformMapFunction:uv}),new Uh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:umt,getRenderStateFunction:xbe,getUniformMapFunction:uv}),new Uh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:fmt,getRenderStateFunction:bbe,getUniformMapFunction:uv}),new Uh({pass:we.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:ybe,getRenderStateFunction:ymt,getUniformMapFunction:uv}),new Uh({pass:we.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:ybe,getRenderStateFunction:xmt,getUniformMapFunction:uv})]}var Tbe=new Array(GT),Cbe=new Array(GT);WT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)Cbe[o]=this._derivedCommandPacks[n[o]],Tbe[o]=Ebe[n[o]];Amt(this,e,i,n,Tbe,Cbe,t)}};function Amt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),d=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),x&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let T=r[b],C=i[b],A=o[b],E=a[A],v,D,O;l(E)?(v=E.uniformMap,D=E.shaderProgram,O=E.renderState):(v=void 0,D=void 0,O=void 0),E=Ze.shallowClone(t,E),a[A]=E;let R=y(E.derivedCommands.uniformMapDirtyFrame,0),M=y(E.derivedCommands.shaderProgramDirtyFrame,0),N=y(E.derivedCommands.renderStateDirtyFrame,0),_=g||R<f,S=m||M<d,w=x||N<p;_&&(E.derivedCommands.uniformMapDirtyFrame=u),S&&(E.derivedCommands.shaderProgramDirtyFrame=u),w&&(E.derivedCommands.renderStateDirtyFrame=u),E.derivedCommands.type=C,E.pass=T.pass,E.pickOnly=T.pickOnly,E.uniformMap=Tmt(e,t.uniformMap,v,_,T.getUniformMapFunction),E.shaderProgram=dmt(s.context,t.shaderProgram,D,S,T.getShaderProgramFunction,A),E.renderState=bmt(t.renderState,O,w,T.getRenderStateFunction,T.renderStateCache)}}}WT.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=Ebe[o[a]];n.commandList.push(s[c])}};function vbe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function Abe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var Emt=[Ca.OPAQUE_FRONT_FACE,Ca.OPAQUE_BACK_FACE],Smt=[Ca.DEPTH_ONLY_FRONT_FACE,Ca.DEPTH_ONLY_BACK_FACE,Ca.DEPTH_ONLY_FRONT_AND_BACK_FACE];WT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[we.GLOBE],a=e.indices[we.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),vbe(s,a,t,i,o,Emt))};WT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[we.GLOBE],c=e.indices[we.GLOBE],u=e.commands[we.TERRAIN_CLASSIFICATION],f=e.indices[we.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&Abe(u,f,t,i,o),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,vbe(a,c,t,i,o,Smt),r.depthTexture){let x=n.packDepth(r,o);s.globeDepthTexture=x}Abe(u,f,t,i,o),s.globeDepthTexture=g,o.framebuffer=m};var F2=WT;var ou=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -12705,7 +11242,7 @@ void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); } -`;function sp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new Jn({color:new H(0,0,0,0),owner:this}),this._clearCommand=new Jn({color:new H(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(sp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});sp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Tmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Un.EQUAL,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},backFunction:Un.NEVER,reference:0,mask:Ut.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},Cmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},backFunction:Un.NEVER,reference:0,mask:Ut.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},Amt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ut.setCesium3DTileBit(),stencilMask:Ut.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},Emt=`uniform sampler2D colorTexture; +`;function op(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ei({color:new H(0,0,0,0),owner:this}),this._clearCommand=new ei({color:new H(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(op.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});op.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var vmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},backFunction:Vn.NEVER,reference:0,mask:Vt.CLASSIFICATION_MASK},blending:ln.ALPHA_BLEND},wmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},backFunction:Vn.NEVER,reference:0,mask:Vt.CLASSIFICATION_MASK},blending:ln.ALPHA_BLEND},Dmt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Vt.setCesium3DTileBit(),stencilMask:Vt.CESIUM_3D_TILE_MASK,blending:ln.ALPHA_BLEND},Imt=`uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; @@ -12733,7 +11270,7 @@ void main() out_FragColor = color * highlightColor; gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; } -`,Smt=`uniform sampler2D colorTexture; +`,Pmt=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { @@ -12748,7 +11285,7 @@ void main() out_FragColor = color; #endif } -`;sp.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Pt({context:e,width:s,height:a,pixelFormat:et.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new pu({context:e,width:s,height:a,format:zc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(Tmt),this._rsClassified=Ve.fromCache(Cmt),this._rsDefault=Ve.fromCache(Amt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?Smt:Emt,f=new Ue({defines:["UNCLASSIFIED"],sources:[u]}),d=new Ue({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(ou,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};sp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};sp.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};sp.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};sp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};sp.prototype.isDestroyed=function(){return!1};sp.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var hv=sp;function G8(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(G8.prototype,{total:{get:function(){return this._total}}});function O0(e){let t=new Array(Na.NUMBER_OF_JOB_TYPES);t[Na.TEXTURE]=new G8(l(e)?e[Na.TEXTURE]:10),t[Na.PROGRAM]=new G8(l(e)?e[Na.PROGRAM]:10),t[Na.BUFFER]=new G8(l(e)?e[Na.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}O0.getTimestamp=bi;Object.defineProperties(O0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});O0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};O0.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};O0.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=O0.getTimestamp();e.execute();let a=O0.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var Q2=O0;function W8(e){e=y(e,y.EMPTY_OBJECT);let t=In(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=bi(),this._lastMsSampleTime=bi(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(W8.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});W8.prototype.update=function(e){let t=bi(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};W8.prototype.destroy=function(){return ue(this)};var _g=W8;var Ta={};Ta.decodeRawMetadataValue=function(e,t,n){switch(e){case Vt.INT8:return t.getInt8(n);case Vt.UINT8:return t.getUint8(n);case Vt.INT16:return t.getInt16(n,!0);case Vt.UINT16:return t.getUint16(n,!0);case Vt.INT32:return t.getInt32(n,!0);case Vt.UINT32:return t.getUint32(n,!0);case Vt.INT64:return t.getBigInt64(n,!0);case Vt.UINT64:return t.getBigUint64(n,!0);case Vt.FLOAT32:return t.getFloat32(n,!0);case Vt.FLOAT64:return t.getFloat64(n,!0)}throw new re(`Invalid component type: ${e}`)};Ta.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=Ta.decodeRawMetadataValue(i,t,n);return e.normalized?Vt.normalize(o,i):o};Ta.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Vt.getSizeInBytes(i),r=e.type,s=lt.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let d=0;d<s;d++){let p=n*a+d*o,g=Ta.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return Ta.decodeRawMetadataValueComponent(e,t,c)};Ta.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=Ta.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return Ta.decodeRawMetadataValueElement(e,n,0)};Ta.convertToObjectType=function(e,t){if(!l(t)||e===lt.SCALAR||e===lt.STRING||e===lt.BOOLEAN||e===lt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case lt.VEC2:return z.unpack(n,0,new z);case lt.VEC3:return h.unpack(n,0,new h);case lt.VEC4:return oe.unpack(n,0,new oe);case lt.MAT2:return Ii.unpack(n,0,new Ii);case lt.MAT3:return $.unpack(n,0,new $);case lt.MAT4:return F.unpack(n,0,new F)}throw new re(`Invalid metadata object type: ${e}`)};Ta.convertFromObjectType=function(e,t){if(!l(t)||e===lt.SCALAR||e===lt.STRING||e===lt.BOOLEAN||e===lt.ENUM)return t;switch(e){case lt.VEC2:return z.pack(t,Array(2));case lt.VEC3:return h.pack(t,Array(3));case lt.VEC4:return oe.pack(t,Array(4));case lt.MAT2:return Ii.pack(t,Array(4));case lt.MAT3:return $.pack(t,Array(9));case lt.MAT4:return F.pack(t,Array(16))}throw new re(`Invalid metadata object type: ${e}`)};Ta.decodeMetadataValues=function(e,t,n){let i=Ta.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=Ta.convertFromObjectType(e.type,t.offset),s=Ta.convertFromObjectType(e.type,t.scale);i=ym.valueTransformInPlace(i,r,s,Vt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],u=Ta.convertToObjectType(e.type,c);s[a]=u}return s}return Ta.convertToObjectType(e.type,i)};var J2=Object.freeze(Ta);function jT(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(jT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function vmt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function wmt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; +`;op.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new It({context:e,width:s,height:a,pixelFormat:et.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new pu({context:e,width:s,height:a,format:zc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(vmt),this._rsClassified=Ve.fromCache(wmt),this._rsDefault=Ve.fromCache(Dmt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?Pmt:Imt,f=new Ue({defines:["UNCLASSIFIED"],sources:[u]}),d=new Ue({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(ou,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};op.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};op.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};op.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};op.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};op.prototype.isDestroyed=function(){return!1};op.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var fv=op;function U8(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(U8.prototype,{total:{get:function(){return this._total}}});function D0(e){let t=new Array(Ba.NUMBER_OF_JOB_TYPES);t[Ba.TEXTURE]=new U8(l(e)?e[Ba.TEXTURE]:10),t[Ba.PROGRAM]=new U8(l(e)?e[Ba.PROGRAM]:10),t[Ba.BUFFER]=new U8(l(e)?e[Ba.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}D0.getTimestamp=Ti;Object.defineProperties(D0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});D0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};D0.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};D0.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=D0.getTimestamp();e.execute();let a=D0.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var B2=D0;function z8(e){e=y(e,y.EMPTY_OBJECT);let t=In(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Ti(),this._lastMsSampleTime=Ti(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(z8.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});z8.prototype.update=function(e){let t=Ti(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};z8.prototype.destroy=function(){return ue(this)};var pg=z8;var Aa={};Aa.decodeRawMetadataValue=function(e,t,n){switch(e){case kt.INT8:return t.getInt8(n);case kt.UINT8:return t.getUint8(n);case kt.INT16:return t.getInt16(n,!0);case kt.UINT16:return t.getUint16(n,!0);case kt.INT32:return t.getInt32(n,!0);case kt.UINT32:return t.getUint32(n,!0);case kt.INT64:return t.getBigInt64(n,!0);case kt.UINT64:return t.getBigUint64(n,!0);case kt.FLOAT32:return t.getFloat32(n,!0);case kt.FLOAT64:return t.getFloat64(n,!0)}throw new re(`Invalid component type: ${e}`)};Aa.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=Aa.decodeRawMetadataValue(i,t,n);return e.normalized?kt.normalize(o,i):o};Aa.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=kt.getSizeInBytes(i),r=e.type,s=ct.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let d=0;d<s;d++){let p=n*a+d*o,g=Aa.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return Aa.decodeRawMetadataValueComponent(e,t,c)};Aa.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=Aa.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return Aa.decodeRawMetadataValueElement(e,n,0)};Aa.convertToObjectType=function(e,t){if(!l(t)||e===ct.SCALAR||e===ct.STRING||e===ct.BOOLEAN||e===ct.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case ct.VEC2:return z.unpack(n,0,new z);case ct.VEC3:return h.unpack(n,0,new h);case ct.VEC4:return oe.unpack(n,0,new oe);case ct.MAT2:return Ri.unpack(n,0,new Ri);case ct.MAT3:return $.unpack(n,0,new $);case ct.MAT4:return F.unpack(n,0,new F)}throw new re(`Invalid metadata object type: ${e}`)};Aa.convertFromObjectType=function(e,t){if(!l(t)||e===ct.SCALAR||e===ct.STRING||e===ct.BOOLEAN||e===ct.ENUM)return t;switch(e){case ct.VEC2:return z.pack(t,Array(2));case ct.VEC3:return h.pack(t,Array(3));case ct.VEC4:return oe.pack(t,Array(4));case ct.MAT2:return Ri.pack(t,Array(4));case ct.MAT3:return $.pack(t,Array(9));case ct.MAT4:return F.pack(t,Array(16))}throw new re(`Invalid metadata object type: ${e}`)};Aa.decodeMetadataValues=function(e,t,n){let i=Aa.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=Aa.convertFromObjectType(e.type,t.offset),s=Aa.convertFromObjectType(e.type,t.scale);i=gm.valueTransformInPlace(i,r,s,kt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],u=Aa.convertToObjectType(e.type,c);s[a]=u}return s}return Aa.convertToObjectType(e.type,i)};var k2=Object.freeze(Aa);function jT(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(jT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Rmt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function Omt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -12760,7 +11297,7 @@ void main() out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0, czm_packDepth(depth), globeDepthPacked); } -`,{renderState:Ve.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}jT.prototype.update=function(e,t){vmt(this,e,t),wmt(this,e,t)};var Dmt=new oe,Imt=new oe(1,1/255,1/65025,1/16581375);jT.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=oe.unpack(i,0,Dmt);return oe.divideByScalar(o,255,o),oe.dot(o,Imt)};jT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};jT.prototype.isDestroyed=function(){return!1};jT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var eB=jT;function Pmt(e,t){this.near=y(e,0),this.far=y(t,0);let n=we.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var tB=Pmt;var M0=`uniform highp sampler2D u_depthTexture; +`,{renderState:Ve.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}jT.prototype.update=function(e,t){Rmt(this,e,t),Omt(this,e,t)};var Mmt=new oe,Lmt=new oe(1,1/255,1/65025,1/16581375);jT.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=oe.unpack(i,0,Mmt);return oe.divideByScalar(o,255,o),oe.dot(o,Lmt)};jT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};jT.prototype.isDestroyed=function(){return!1};jT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var V2=jT;function Nmt(e,t){this.near=y(e,0),this.far=y(t,0);let n=we.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var U2=Nmt;var I0=`uniform highp sampler2D u_depthTexture; in vec2 v_textureCoordinates; @@ -12768,18 +11305,76 @@ void main() { out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;function ap(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new je,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(ap.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function Sbe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!je.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=je.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!je.equals(r,e._rs.viewport)||a)&&(e._rs=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Un.EQUAL,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},backFunction:Un.NEVER,reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(M0,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(ou,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(M0,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(ou,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new Jn({color:new H(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}ap.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),Sbe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};ap.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};ap.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};ap.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),Sbe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};ap.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};ap.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(H.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};ap.prototype.isDestroyed=function(){return!1};ap.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var nB=ap;function qT(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new je,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(qT.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function Rmt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Omt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function Mmt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!je.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=je.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!je.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(M0,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new Jn({color:new H(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}qT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Omt(this,n,o,r,e),Mmt(this,n,o,r,i),this._useHdr=e};qT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};qT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};qT.prototype.isDestroyed=function(){return!1};qT.prototype.destroy=function(){return Rmt(this),ue(this)};var iB=qT;function gg(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new Jn({color:new H(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new Jn({color:new H(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new Jn({color:new H(0,0,0,0),owner:this}),this._alphaClearCommand=new Jn({color:new H(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new je,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function vbe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function pK(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function wbe(e){vbe(e),pK(e)}function Lmt(e,t,n,i){vbe(e),e._accumulationTexture=new Pt({context:t,width:n,height:i,pixelFormat:et.RGBA,pixelDatatype:Ke.FLOAT}),e._revealageTexture=new Pt({context:t,pixelFormat:et.RGBA,pixelDatatype:Ke.FLOAT,width:n,height:i,flipY:!1})}function Nmt(e,t){pK(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(pK(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(wbe(e),e._translucentMultipassSupport=!1,i=!1)}return i}gg.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,Lmt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!Nmt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Ue({sources:[vP]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Ue({defines:["MRT"],sources:[rA]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Ue({sources:[rA]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!je.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,je.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=je.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!je.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Fmt={enabled:!0,color:new H(0,0,0,0),equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:Eo.ONE,functionDestinationRgb:Eo.ONE,functionSourceAlpha:Eo.ZERO,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA},Bmt={enabled:!0,color:new H(0,0,0,0),equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:Eo.ONE,functionDestinationRgb:Eo.ONE,functionSourceAlpha:Eo.ONE,functionDestinationAlpha:Eo.ONE},kmt={enabled:!0,color:new H(0,0,0,0),equationRgb:Ra.ADD,equationAlpha:Ra.ADD,functionSourceRgb:Eo.ZERO,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Eo.ZERO,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA};function _K(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function Vmt(e,t,n){return _K(t,Fmt,e._translucentRenderStateCache,n)}function Umt(e,t,n){return _K(t,Bmt,e._translucentRenderStateCache,n)}function zmt(e,t,n){return _K(t,kmt,e._alphaRenderStateCache,n)}var Hmt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`;function rp(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new je,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(rp.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function wbe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!je.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=je.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!je.equals(r,e._rs.viewport)||a)&&(e._rs=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:ln.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},backFunction:Vn.NEVER,reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(I0,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(ou,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(I0,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(ou,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ei({color:new H(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}rp.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),wbe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};rp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};rp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};rp.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),wbe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};rp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};rp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(H.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};rp.prototype.isDestroyed=function(){return!1};rp.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var z2=rp;function qT(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new je,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(qT.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function Fmt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Bmt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function kmt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!je.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=je.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!je.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(I0,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ei({color:new H(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}qT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Bmt(this,n,o,r,e),kmt(this,n,o,r,i),this._useHdr=e};qT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};qT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};qT.prototype.isDestroyed=function(){return!1};qT.prototype.destroy=function(){return Fmt(this),ue(this)};var H2=qT;var dv=`#ifdef MRT +layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1; +#else +layout (location = 0) out vec4 out_FragColor; +#endif + +uniform vec4 u_bgColor; +uniform sampler2D u_depthTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) + { +#ifdef MRT + out_FragData_0 = u_bgColor; + out_FragData_1 = vec4(u_bgColor.a); +#else + out_FragColor = u_bgColor; +#endif + return; + } + + discard; +} +`;var G2=`/** + * Compositing for Weighted Blended Order-Independent Transparency. See: + * - http://jcgt.org/published/0002/02/09/ + * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html + */ + +uniform sampler2D u_opaque; +uniform sampler2D u_accumulation; +uniform sampler2D u_revealage; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 opaque = texture(u_opaque, v_textureCoordinates); + vec4 accum = texture(u_accumulation, v_textureCoordinates); + float r = texture(u_revealage, v_textureCoordinates).r; + +#ifdef MRT + vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); +#else + vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); +#endif + + out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; + + if (opaque != czm_backgroundColor) + { + out_FragColor.a = 1.0; + } +} +`;function _g(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new ei({color:new H(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ei({color:new H(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ei({color:new H(0,0,0,0),owner:this}),this._alphaClearCommand=new ei({color:new H(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new je,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Dbe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function _K(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function Ibe(e){Dbe(e),_K(e)}function Vmt(e,t,n,i){Dbe(e),e._accumulationTexture=new It({context:t,width:n,height:i,pixelFormat:et.RGBA,pixelDatatype:Ke.FLOAT}),e._revealageTexture=new It({context:t,pixelFormat:et.RGBA,pixelDatatype:Ke.FLOAT,width:n,height:i,flipY:!1})}function Umt(e,t){_K(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(_K(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(Ibe(e),e._translucentMultipassSupport=!1,i=!1)}return i}_g.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,Vmt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!Umt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Ue({sources:[G2]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Ue({defines:["MRT"],sources:[dv]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Ue({sources:[dv]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!je.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,je.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=je.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!je.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var zmt={enabled:!0,color:new H(0,0,0,0),equationRgb:Ma.ADD,equationAlpha:Ma.ADD,functionSourceRgb:Eo.ONE,functionDestinationRgb:Eo.ONE,functionSourceAlpha:Eo.ZERO,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA},Hmt={enabled:!0,color:new H(0,0,0,0),equationRgb:Ma.ADD,equationAlpha:Ma.ADD,functionSourceRgb:Eo.ONE,functionDestinationRgb:Eo.ONE,functionSourceAlpha:Eo.ONE,functionDestinationAlpha:Eo.ONE},Gmt={enabled:!0,color:new H(0,0,0,0),equationRgb:Ma.ADD,equationAlpha:Ma.ADD,functionSourceRgb:Eo.ZERO,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Eo.ZERO,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA};function gK(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function Wmt(e,t,n){return gK(t,zmt,e._translucentRenderStateCache,n)}function jmt(e,t,n){return gK(t,Hmt,e._translucentRenderStateCache,n)}function qmt(e,t,n){return gK(t,Gmt,e._alphaRenderStateCache,n)}var Ymt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragData_0 = vec4(Ci * wzi, ai); out_FragData_1 = vec4(ai * wzi); -`,Gmt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`,Xmt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragColor = vec4(Ci, ai) * wzi; -`,Wmt=` float ai = czm_out_FragColor.a; +`,Kmt=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); -`;function gK(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Ue.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; +`;function yK(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Ue.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; bool czm_discard = false; `);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; ${u}`}return a.sources.push(u),a.sources.push(`void main() @@ -12790,7 +11385,7 @@ ${u}`}return a.sources.push(u),a.sources.push(`void main() discard; } ${i}} -`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function jmt(e,t){return gK(e,t,"translucentMRT",Hmt)}function qmt(e,t){return gK(e,t,"translucentMultipass",Gmt)}function Ymt(e,t){return gK(e,t,"alphaMultipass",Wmt)}gg.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=Ze.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=jmt(t,e.shaderProgram),n.translucentCommand.renderState=Vmt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=Ze.shallowClone(e,n.translucentCommand),n.alphaCommand=Ze.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=qmt(t,e.shaderProgram),n.translucentCommand.renderState=Umt(this,t,e.renderState),n.alphaCommand.shaderProgram=Ymt(t,e.shaderProgram),n.alphaCommand.renderState=zmt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function Xmt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.alphaCommand:x.derivedCommands.oit.alphaCommand;n(b,t,i,g)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(x,t,i,g)}i.framebuffer=d}function Kmt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=d}gg.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Kmt(this,e,t,n,i,o);return}Xmt(this,e,t,n,i,o)};gg.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};gg.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,H.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};gg.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};gg.prototype.isDestroyed=function(){return!1};gg.prototype.destroy=function(){return wbe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var oB=gg;function rB(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(rB.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Zmt(e){e._framebuffer.destroy()}function $mt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new rc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new je},o.viewport=new je,e._passState=o}rB.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&$mt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};rB.prototype.isDestroyed=function(){return!1};rB.prototype.destroy=function(){return Zmt(this),ue(this)};var sB=rB;function mv(e){let t=new rc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new je},t.viewport=new je,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}mv.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return je.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var aB=new H;mv.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),u=0,f=0,d=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-c<=f&&f<=c){let m=4*((c-f)*t+u+a);aB.red=H.byteToFloat(o[m]),aB.green=H.byteToFloat(o[m+1]),aB.blue=H.byteToFloat(o[m+2]),aB.alpha=H.byteToFloat(o[m+3]);let x=i.getObjectByPickColor(aB);if(l(x))return x}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=d;d=-p,p=m}u+=d,f+=p}};mv.prototype.readCenterPixel=function(e){let t=y(e.width,1),n=y(e.height,1),o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};mv.prototype.isDestroyed=function(){return!1};mv.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var cB=mv;function yg(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new H(0,0,0,0),this._clearCommand=new Jn({color:new H(0,0,0,0),depth:1,owner:this})}function Qmt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(yg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});yg.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};yg.prototype.clear=function(e,t,n){H.clone(n,this._clearCommand.color),H.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};yg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};yg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};yg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};yg.prototype.isDestroyed=function(){return!1};yg.prototype.destroy=function(){return Qmt(this),ue(this)};var YT=yg;function XT(){}XT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};XT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Ue.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=Ue.replaceMain(o[u],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; +`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Zmt(e,t){return yK(e,t,"translucentMRT",Ymt)}function $mt(e,t){return yK(e,t,"translucentMultipass",Xmt)}function Qmt(e,t){return yK(e,t,"alphaMultipass",Kmt)}_g.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=Ze.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Zmt(t,e.shaderProgram),n.translucentCommand.renderState=Wmt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=Ze.shallowClone(e,n.translucentCommand),n.alphaCommand=Ze.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=$mt(t,e.shaderProgram),n.translucentCommand.renderState=jmt(this,t,e.renderState),n.alphaCommand.shaderProgram=Qmt(t,e.shaderProgram),n.alphaCommand.renderState=qmt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function Jmt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.alphaCommand:x.derivedCommands.oit.alphaCommand;n(b,t,i,g)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(x,t,i,g)}i.framebuffer=d}function ept(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=d}_g.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){ept(this,e,t,n,i,o);return}Jmt(this,e,t,n,i,o)};_g.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};_g.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,H.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};_g.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};_g.prototype.isDestroyed=function(){return!1};_g.prototype.destroy=function(){return Ibe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var W2=_g;function j2(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(j2.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function tpt(e){e._framebuffer.destroy()}function npt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new sc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new je},o.viewport=new je,e._passState=o}j2.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&npt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};j2.prototype.isDestroyed=function(){return!1};j2.prototype.destroy=function(){return tpt(this),ue(this)};var q2=j2;function hv(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new je},t.viewport=new je,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}hv.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return je.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var Y2=new H;hv.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),u=0,f=0,d=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-c<=f&&f<=c){let m=4*((c-f)*t+u+a);Y2.red=H.byteToFloat(o[m]),Y2.green=H.byteToFloat(o[m+1]),Y2.blue=H.byteToFloat(o[m+2]),Y2.alpha=H.byteToFloat(o[m+3]);let x=i.getObjectByPickColor(Y2);if(l(x))return x}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=d;d=-p,p=m}u+=d,f+=p}};hv.prototype.readCenterPixel=function(e){let t=y(e.width,1),n=y(e.height,1),o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};hv.prototype.isDestroyed=function(){return!1};hv.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var X2=hv;function gg(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new H(0,0,0,0),this._clearCommand=new ei({color:new H(0,0,0,0),depth:1,owner:this})}function ipt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(gg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});gg.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};gg.prototype.clear=function(e,t,n){H.clone(n,this._clearCommand.color),H.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};gg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};gg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};gg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};gg.prototype.isDestroyed=function(){return!1};gg.prototype.destroy=function(){return ipt(this),ue(this)};var YT=gg;function XT(){}XT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};XT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Ue.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=Ue.replaceMain(o[u],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; void main() { czm_shadow_cast_main(); @@ -12927,7 +11522,7 @@ ${m?` // Draw cascade colors for debugging float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,E+=` out_FragColor.rgb *= visibility; } -`,C.push(E),new Ue({defines:T,sources:C})};var cp=XT;function lp(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Ht.isInternetExplorer()||Ht.isEdge()||(Ht.isChrome()||Ht.isFirefox())&&Ht.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new F,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new oe,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new j8,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new z,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Fr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new oe,new oe],this._cascadeMatrices=[new F,new F,new F,new F],this._cascadeDistances=new oe;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new Jmt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,xK(this),this._clearCommand=new Jn({depth:1,color:new H}),this._clearPassState=new rc(t),this._size=y(e.size,2048),this.size=this._size}lp.MAXIMUM_DISTANCE=2e4;function Jmt(e){this.camera=new j8,this.passState=new rc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function yK(e,t){return Ve.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function xK(e){let t=!e._usesDepthTexture;e._primitiveRenderState=yK(t,e._primitiveBias),e._terrainRenderState=yK(t,e._terrainBias),e._pointRenderState=yK(t,e._pointBias)}lp.prototype.debugCreateRenderStates=function(){xK(this)};Object.defineProperties(lp.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){rpt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function bK(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function ept(e,t){let n=new pu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:zc.DEPTH_COMPONENT16}),i=new Pt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:$t.NEAREST}),o=new Nr({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function tpt(e,t){let n=new Pt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:et.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:$t.NEAREST}),i=new Nr({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function npt(e,t){let n=new pu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:zc.DEPTH_COMPONENT16}),i=new Cr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:$t.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Nr({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Pbe(e,t){e._isPointLight?npt(e,t):e._usesDepthTexture?tpt(e,t):ept(e,t)}function ipt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,xK(e),bK(e),Pbe(e,t))}function opt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(bK(e),Pbe(e,t),ipt(e,t),Rbe(e,t))}function Rbe(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function rpt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Nt.maximumCubeMapSize>=t?t:Nt.maximumCubeMapSize,o.x=t,o.y=t;let r=new je(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Nt.maximumTextureSize>=t?t:Nt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new je(0,0,t,t)):i===4&&(t=Nt.maximumTextureSize>=t*2?t:Nt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new je(0,0,t,t),n[1].passState.viewport=new je(t,0,t,t),n[2].passState.viewport=new je(0,t,t,t),n[3].passState.viewport=new je(t,t,t,t));e._clearPassState.viewport=new je(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,u=a.y/o.y,f=a.width/o.x,d=a.height/o.y;s.textureOffsets=new F(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var spt=new je;function apt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,C.push(E),new Ue({defines:T,sources:C})};var sp=XT;function ap(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(zt.isInternetExplorer()||zt.isEdge()||(zt.isChrome()||zt.isFirefox())&&zt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new F,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new oe,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new H8,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new z,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Fr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new oe,new oe],this._cascadeMatrices=[new F,new F,new F,new F],this._cascadeDistances=new oe;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new opt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,bK(this),this._clearCommand=new ei({depth:1,color:new H}),this._clearPassState=new sc(t),this._size=y(e.size,2048),this.size=this._size}ap.MAXIMUM_DISTANCE=2e4;function opt(e){this.camera=new H8,this.passState=new sc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function xK(e,t){return Ve.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function bK(e){let t=!e._usesDepthTexture;e._primitiveRenderState=xK(t,e._primitiveBias),e._terrainRenderState=xK(t,e._terrainBias),e._pointRenderState=xK(t,e._pointBias)}ap.prototype.debugCreateRenderStates=function(){bK(this)};Object.defineProperties(ap.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){upt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function TK(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function rpt(e,t){let n=new pu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:zc.DEPTH_COMPONENT16}),i=new It({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:Zt.NEAREST}),o=new Nr({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function spt(e,t){let n=new It({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:et.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:Zt.NEAREST}),i=new Nr({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function apt(e,t){let n=new pu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:zc.DEPTH_COMPONENT16}),i=new Cr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:Zt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Nr({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Obe(e,t){e._isPointLight?apt(e,t):e._usesDepthTexture?spt(e,t):rpt(e,t)}function cpt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,bK(e),TK(e),Obe(e,t))}function lpt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(TK(e),Obe(e,t),cpt(e,t),Mbe(e,t))}function Mbe(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function upt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Lt.maximumCubeMapSize>=t?t:Lt.maximumCubeMapSize,o.x=t,o.y=t;let r=new je(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Lt.maximumTextureSize>=t?t:Lt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new je(0,0,t,t)):i===4&&(t=Lt.maximumTextureSize>=t*2?t:Lt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new je(0,0,t,t),n[1].passState.viewport=new je(t,0,t,t),n[2].passState.viewport=new je(0,t,t,t),n[3].passState.viewport=new je(t,t,t,t));e._clearPassState.viewport=new je(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,u=a.y/o.y,f=a.width/o.x,d=a.height/o.y;s.textureOffsets=new F(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var fpt=new je;function dpt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -12988,7 +11583,19 @@ ${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCo `:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); `} out_FragColor = vec4(vec3(shadow), 1.0); } -`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=we.OVERLAY,i}function cpt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=spt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=apt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!je.equals(a.renderState.viewport,s))&&(a.renderState=Ve.fromCache({viewport:je.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var up=new Array(8);up[0]=new oe(-1,-1,-1,1);up[1]=new oe(1,-1,-1,1);up[2]=new oe(1,1,-1,1);up[3]=new oe(-1,1,-1,1);up[4]=new oe(-1,-1,1,1);up[5]=new oe(1,-1,1,1);up[6]=new oe(1,1,1,1);up[7]=new oe(-1,1,1,1);var L0=new F,TK=new Array(8);for(let e=0;e<8;++e)TK[e]=new oe;function lpt(e,t){let n=new vt({geometry:new Vd({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Wt.fromColor(t)}}),i=new vt({geometry:new R_({radius:.5}),attributes:{color:Wt.fromColor(t)}});return new Dn({geometryInstances:[n,i],appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var upt=[H.RED,H.GREEN,H.BLUE,H.MAGENTA],fpt=new h;function dpt(e,t){cpt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new op({camera:e._sceneCamera,color:H.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new op({camera:e._shadowMapCamera,color:H.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new op({camera:e._passes[i].camera,color:upt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Oe.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,fpt),a=F.fromTranslationQuaternionRotationScale(i,o,s,L0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=lpt(a,H.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new op({camera:e._shadowMapCamera,color:H.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function j8(){this.viewMatrix=new F,this.inverseViewMatrix=new F,this.frustum=void 0,this.positionCartographic=new fe,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new F}j8.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),fe.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var hpt=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);j8.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(hpt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var mpt=new Array(5),ppt=new wi,_pt=new Array(4),Obe=new h,Mbe=new h;function gpt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,u=r/o,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=_pt,g=mpt;for(g[0]=o,g[s]=r,a=0;a<s;++a){let N=(a+1)/s,_=o*Math.pow(u,N),S=o+c*N,w=P.lerp(S,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=g[0];for(a=0;a<s-1;++a)N+=p[a],g[a+1]=N}oe.unpack(g,0,e._cascadeSplits[0]),oe.unpack(g,1,e._cascadeSplits[1]),oe.unpack(p,0,e._cascadeDistances);let m=n.frustum,x=m.left,b=m.right,T=m.bottom,C=m.top,A=m.near,E=m.far,v=n.positionWC,D=n.directionWC,O=n.upWC,R=i.frustum.clone(ppt),M=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let N=F.multiply(R.projectionMatrix,i.viewMatrix,L0),_=F.inverse(N,L0),S=F.multiply(M,_,L0),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Obe),I=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Mbe);for(let G=0;G<8;++G){let k=oe.clone(up[G],TK[G]);F.multiplyByVector(S,k,k),h.divideByScalar(k,k.w,k),h.minimumByComponent(k,w,w),h.maximumByComponent(k,I,I)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let L=e._passes[a],B=L.camera;B.clone(n);let U=B.frustum;U.left=x+w.x*(b-x),U.right=x+I.x*(b-x),U.bottom=T+w.y*(C-T),U.top=T+I.y*(C-T),U.near=A+w.z*(E-A),U.far=A+I.z*(E-A),L.cullingVolume=B.frustum.computeCullingVolume(v,D,O);let V=e._cascadeMatrices[a];F.multiply(B.getViewProjection(),i.inverseViewMatrix,V),F.multiply(L.textureOffsets,V,V)}}var ypt=new F,xpt=new h,bpt=new h,Dbe=new h;function Tpt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,L0),r=F.inverse(o,L0),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,xpt);a=h.cross(c,s,bpt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,Dbe),f=F.computeView(u,s,a,c,ypt),d=F.multiply(f,r,L0),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Obe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Mbe);for(let E=0;E<8;++E){let v=oe.clone(up[E],TK[E]);F.multiplyByVector(d,v,v),h.divideByScalar(v,v.w,v),h.minimumByComponent(v,p,p),h.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=Dbe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let x=F.fromTranslation(m,L0);f=F.multiply(x,f,f);let b=.5*(g.x-p.x),T=.5*(g.y-p.y),C=g.z-p.z,A=n.frustum;A.left=-b,A.right=b,A.bottom=-T,A.top=T,A.near=.01,A.far=C,F.clone(f,n.viewMatrix),F.inverse(f,n.inverseViewMatrix),F.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var Cpt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],Apt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],Ept=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function Spt(e,t){let n=new wi;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=Cpt[i],o.upWC=Apt[i],o.rightWC=Ept[i],F.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),F.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var vpt=new h,wpt=new h,Lbe=new ae,Ibe=Lbe.center;function Dpt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=Lbe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,vpt),s=h.negate(i.directionWC,wpt),a=h.dot(r,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,Ibe),Ibe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere)}}function Ipt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,r.directionWC):e._isPointLight?h.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;F.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),F.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=so.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Dpt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}lp.prototype.update=function(e){if(Ipt(this,e),this._needsUpdate)if(opt(this,e.context),this._isPointLight&&Spt(this,e),this._cascadesEnabled&&(Tpt(this,e),this._numberOfCascades>1&&gpt(this,e)),this._isPointLight)this._shadowMapCullingVolume=_s.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&dpt(this,e)};lp.prototype.updatePass=function(e,t){Rbe(this,e,t)};var Ppt=new z;function Nbe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=Ppt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,oe.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return oe.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new oe,combinedUniforms2:new oe};return bt(t,o,!1)}function Rpt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=Ze.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===we.GLOBE,d=n.pass!==we.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=cp.getShadowCastShaderKeyword(p,f,g,d);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!l(s)){let b=u.vertexShaderSource,T=u.fragmentShaderSource,C=cp.createShadowCastVertexShader(b,p,f),A=cp.createShadowCastFragmentShader(T,p,g,d);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ge(a,!1),a.cull=Ge(a.cull,!1),a.cull.enabled=!1,a=Ve.fromCache(a)),c=Nbe(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}lp.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===we.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let d,p;l(o.receiveCommand)&&(d=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=Ze.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let x=cp.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,x),!l(d)){let b=cp.createShadowReceiveVertexShader(a,u,f),T=cp.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:b,fragmentShaderSource:T,attributeLocations:s._attributeLocations})}p=Nbe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=d,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};lp.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=Rpt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){bK(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var xg=lp;var KT=`uniform sampler2D colorTexture; +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=we.OVERLAY,i}function hpt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=fpt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=dpt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!je.equals(a.renderState.viewport,s))&&(a.renderState=Ve.fromCache({viewport:je.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var cp=new Array(8);cp[0]=new oe(-1,-1,-1,1);cp[1]=new oe(1,-1,-1,1);cp[2]=new oe(1,1,-1,1);cp[3]=new oe(-1,1,-1,1);cp[4]=new oe(-1,-1,1,1);cp[5]=new oe(1,-1,1,1);cp[6]=new oe(1,1,1,1);cp[7]=new oe(-1,1,1,1);var P0=new F,CK=new Array(8);for(let e=0;e<8;++e)CK[e]=new oe;function mpt(e,t){let n=new St({geometry:new Bd({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Gt.fromColor(t)}}),i=new St({geometry:new I_({radius:.5}),attributes:{color:Gt.fromColor(t)}});return new Dn({geometryInstances:[n,i],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var ppt=[H.RED,H.GREEN,H.BLUE,H.MAGENTA],_pt=new h;function gpt(e,t){hpt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new np({camera:e._sceneCamera,color:H.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new np({camera:e._shadowMapCamera,color:H.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new np({camera:e._passes[i].camera,color:ppt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Oe.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,_pt),a=F.fromTranslationQuaternionRotationScale(i,o,s,P0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=mpt(a,H.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new np({camera:e._shadowMapCamera,color:H.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function H8(){this.viewMatrix=new F,this.inverseViewMatrix=new F,this.frustum=void 0,this.positionCartographic=new fe,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new F}H8.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),fe.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var ypt=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);H8.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(ypt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var xpt=new Array(5),bpt=new Ii,Tpt=new Array(4),Lbe=new h,Nbe=new h;function Cpt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,u=r/o,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=Tpt,g=xpt;for(g[0]=o,g[s]=r,a=0;a<s;++a){let N=(a+1)/s,_=o*Math.pow(u,N),S=o+c*N,w=P.lerp(S,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=g[0];for(a=0;a<s-1;++a)N+=p[a],g[a+1]=N}oe.unpack(g,0,e._cascadeSplits[0]),oe.unpack(g,1,e._cascadeSplits[1]),oe.unpack(p,0,e._cascadeDistances);let m=n.frustum,x=m.left,b=m.right,T=m.bottom,C=m.top,A=m.near,E=m.far,v=n.positionWC,D=n.directionWC,O=n.upWC,R=i.frustum.clone(bpt),M=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let N=F.multiply(R.projectionMatrix,i.viewMatrix,P0),_=F.inverse(N,P0),S=F.multiply(M,_,P0),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Lbe),I=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Nbe);for(let G=0;G<8;++G){let k=oe.clone(cp[G],CK[G]);F.multiplyByVector(S,k,k),h.divideByScalar(k,k.w,k),h.minimumByComponent(k,w,w),h.maximumByComponent(k,I,I)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let L=e._passes[a],B=L.camera;B.clone(n);let U=B.frustum;U.left=x+w.x*(b-x),U.right=x+I.x*(b-x),U.bottom=T+w.y*(C-T),U.top=T+I.y*(C-T),U.near=A+w.z*(E-A),U.far=A+I.z*(E-A),L.cullingVolume=B.frustum.computeCullingVolume(v,D,O);let V=e._cascadeMatrices[a];F.multiply(B.getViewProjection(),i.inverseViewMatrix,V),F.multiply(L.textureOffsets,V,V)}}var Apt=new F,Ept=new h,Spt=new h,Pbe=new h;function vpt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,P0),r=F.inverse(o,P0),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,Ept);a=h.cross(c,s,Spt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,Pbe),f=F.computeView(u,s,a,c,Apt),d=F.multiply(f,r,P0),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Lbe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Nbe);for(let E=0;E<8;++E){let v=oe.clone(cp[E],CK[E]);F.multiplyByVector(d,v,v),h.divideByScalar(v,v.w,v),h.minimumByComponent(v,p,p),h.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=Pbe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let x=F.fromTranslation(m,P0);f=F.multiply(x,f,f);let b=.5*(g.x-p.x),T=.5*(g.y-p.y),C=g.z-p.z,A=n.frustum;A.left=-b,A.right=b,A.bottom=-T,A.top=T,A.near=.01,A.far=C,F.clone(f,n.viewMatrix),F.inverse(f,n.inverseViewMatrix),F.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var wpt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],Dpt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],Ipt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function Ppt(e,t){let n=new Ii;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=wpt[i],o.upWC=Dpt[i],o.rightWC=Ipt[i],F.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),F.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Rpt=new h,Opt=new h,Fbe=new ae,Rbe=Fbe.center;function Mpt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=Fbe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Rpt),s=h.negate(i.directionWC,Opt),a=h.dot(r,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,Rbe),Rbe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere)}}function Lpt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,r.directionWC):e._isPointLight?h.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;F.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),F.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=so.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Mpt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}ap.prototype.update=function(e){if(Lpt(this,e),this._needsUpdate)if(lpt(this,e.context),this._isPointLight&&Ppt(this,e),this._cascadesEnabled&&(vpt(this,e),this._numberOfCascades>1&&Cpt(this,e)),this._isPointLight)this._shadowMapCullingVolume=_s.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&gpt(this,e)};ap.prototype.updatePass=function(e,t){Mbe(this,e,t)};var Npt=new z;function Bbe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=Npt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,oe.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return oe.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new oe,combinedUniforms2:new oe};return xt(t,o,!1)}function Fpt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=Ze.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===we.GLOBE,d=n.pass!==we.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=sp.getShadowCastShaderKeyword(p,f,g,d);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!l(s)){let b=u.vertexShaderSource,T=u.fragmentShaderSource,C=sp.createShadowCastVertexShader(b,p,f),A=sp.createShadowCastFragmentShader(T,p,g,d);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ge(a,!1),a.cull=Ge(a.cull,!1),a.cull.enabled=!1,a=Ve.fromCache(a)),c=Bbe(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}ap.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===we.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let d,p;l(o.receiveCommand)&&(d=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=Ze.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let x=sp.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,x),!l(d)){let b=sp.createShadowReceiveVertexShader(a,u,f),T=sp.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:b,fragmentShaderSource:T,attributeLocations:s._attributeLocations})}p=Bbe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=d,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};ap.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=Fpt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};ap.prototype.isDestroyed=function(){return!1};ap.prototype.destroy=function(){TK(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var yg=ap;var K2=`uniform sampler2D u_opaqueDepthTexture; +uniform sampler2D u_translucentDepthTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; + float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; + translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); + out_FragColor = czm_packDepth(translucentDepth); +} +`;var KT=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; @@ -13019,7 +11626,7 @@ void main() out_FragColor = color; #endif } -`;var Opt=!1;function N0(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new Jn({color:new H(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new Jn({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new je,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(N0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Fbe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Bbe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function Mpt(e,t,n,i){Fbe(e),e._translucentDepthStencilTexture=new Pt({context:t,width:n,height:i,pixelFormat:et.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:$t.NEAREST})}function Lpt(e,t,n,i){Bbe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function Npt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(Mpt(e,t,o,r),Lpt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Ue({sources:[SP]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Ue({sources:[KT]}),a={colorTexture:function(){return e._textureToComposite}},Opt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Ue({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=Ze.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new Ue({sources:[KT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Ue({sources:[KT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!je.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,je.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=je.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!je.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!je.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Un.EQUAL,reference:Ut.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!je.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}N0.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){Npt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};N0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(we.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[we.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[we.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};N0.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),Fpt(this,e,t)};function Fpt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}N0.prototype.isSupported=function(){return this._supported};N0.prototype.isDestroyed=function(){return!1};N0.prototype.destroy=function(){return Fbe(this),Bbe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var lB=N0;function Bpt(){this.command=void 0,this.near=void 0,this.far=void 0}function q8(e,t,n){let i=e.context,o;i.depthTexture&&(o=new nB);let r;e._useOIT&&i.depthTexture&&(r=new oB(i));let s=new rc(i);s.viewport=je.clone(n),this.camera=t,this._cameraClone=so.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new cB(i),this.pickDepthFramebuffer=new sB,this.sceneFramebuffer=new YT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new iB,this.oit=r,this.translucentTileClassification=new lB(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var CK=new h,AK=new h;function kpt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,CK)),h.maximumComponent(h.abs(t.position,AK))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,CK),h.multiplyByScalar(t.position,o,AK),h.equalsEpsilon(CK,AK,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}q8.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return kpt(t,n,P.EPSILON15)?(this._cameraStartFired&&bi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=bi(),so.clone(t,n),!0)};function Vpt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===ne.SCENE2D,u=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let g,m;c?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g));let x=d[p];l(x)?(x.near=g,x.far=m):x=d[p]=new tB(g,m)}}function Upt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var kbe=new _s,zpt=new Da;q8.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let M=0;M<f.length;++M)for(let N=0;N<we.NUMBER_OF_PASSES;++N)f[M].indices[N]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,x=-Number.MAX_VALUE,{shadowsEnabled:b}=o,T=+Number.MAX_VALUE,C=-Number.MAX_VALUE,A=Number.MAX_VALUE,E=t.mode===ne.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,D=kbe.planes;for(let M=0;M<5;++M)D[M]=v.planes[M];v=kbe;for(let M=0;M<i.length;++M){let N=i[M],{pass:_,boundingVolume:S}=N;if(_===we.COMPUTE)c.push(N);else if(_===we.OVERLAY)u.push(N);else{let w,I;if(l(S)){if(!e.isVisible(v,N,E))continue;let B=S.computePlaneDistances(r,s,zpt);if(w=B.start,I=B.stop,m=Math.min(m,w),x=Math.max(x,I),b&&N.receiveShadows&&w<xg.MAXIMUM_DISTANCE&&!(_===we.GLOBE&&w<-100&&I>100)){let U=I-w;_!==we.GLOBE&&w<100&&(A=Math.min(A,U)),T=Math.min(T,w),C=Math.max(C,I)}}else N instanceof Jn?(w=a.near,I=a.far):(w=a.near,I=a.far,m=Math.min(m,w),x=Math.max(x,I));let L=d[g];l(L)||(L=d[g]=new Bpt),L.command=N,L.near=w,L.far=I,g++}}b&&(T=Math.min(Math.max(T,a.near),a.far),C=Math.max(Math.min(C,a.far),T),o.nearPlane=T,o.farPlane=C,o.closestObjectSize=A),Vpt(this,e,m,x);for(let M=0;M<g;M++)Upt(this,e,d[M]);if(g<p)for(let M=g;M<p;M++){let N=d[M];if(!l(N.command))break;N.command=void 0}let O=f.length,{frustumSplits:R}=t;R.length=O+1;for(let M=0;M<O;++M)R[M]=f[M].near,M===O-1&&(R[M+1]=f[M].far)};q8.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var ZT=q8;var Ube=.1,Hpt=new yd({pass:Vo.MOST_DETAILED_PRELOAD}),Gpt=new yd({pass:Vo.MOST_DETAILED_PICK}),uB=new yd({pass:Vo.PICK});function na(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new je(0,0,1,1),n=new so(e);n.frustum=new rn({width:Ube,aspectRatio:1,near:.1}),this._pickOffscreenView=new ZT(e,n,t)}na.prototype.update=function(){this._pickPositionCacheDirty=!0};na.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new eB,n[t]=i),i};var Wpt=new Fr,jpt=new h,Y8=new h,qpt=new z,Ypt=new F;function Xpt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=F.clone(r.transform,Ypt);r._setTransform(F.IDENTITY);let d=h.clone(r.position,jpt);h.multiplyByScalar(r.right,c,Y8),h.add(Y8,d,d),h.multiplyByScalar(r.up,u,Y8),h.add(Y8,d,d),r._setTransform(f),e.mode===ne.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(o.width,o.height,1,1,qpt),g=Wpt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,r.directionWC,r.upWC)}var Kpt=new gl,Zpt=new z;function $pt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,d=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,g=d*a*c,m=s.getPixelDimensions(o.width,o.height,1,1,Zpt),x=m.x*n*.5,b=m.y*i*.5,T=Kpt;return T.top=g+b,T.bottom=g-b,T.right=p+x,T.left=p-x,T.near=a,T.far=s.far,T.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function X8(e,t,n,i,o){let r=e.camera.frustum;return r instanceof rn||r instanceof Fr?Xpt(e,t,n,i,o):$pt(e,t,n,i,o)}var K8=new je(0,0,3,3),Z8=new z,fB=new H(0,0,0,0);function EK(e,t,n,i,o){return o.width=y(n,3),o.height=y(i,o.width),o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}na.prototype.pick=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=je.clone(a,u.viewport);let f=zi.transformWindowToDrawingBuffer(e,t,Z8),d=EK(o.drawingBufferHeight,f,n,i,K8);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=X8(e,f,d.width,d.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=uB,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,fB),e.resolveFramebuffers(u);let p=c.end(d);return o.endFrame(),p};na.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=je.clone(a,u.viewport);let f=zi.transformWindowToDrawingBuffer(e,t,Z8),d=EK(o.drawingBufferHeight,f,n,i,K8);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=X8(e,f,d.width,d.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=uB,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,fB),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return o.endFrame(),p};na.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=je.clone(s,c.viewport);let u=zi.transformWindowToDrawingBuffer(e,t,Z8),f=EK(i.drawingBufferHeight,u,1,1,K8);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=X8(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=uB,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,fB);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,J2.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function Qpt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=je.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=X8(e,t,1,1,s),o.tilesetPassState=uB,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,fB),e.resolveFramebuffers(c),i.endFrame()}var Jpt=new wi,e_t=new gl,t_t=new rn,n_t=new Fr;na.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let u=zi.transformWindowToDrawingBuffer(e,t,Z8);e.pickTranslucentDepth?Qpt(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(Jpt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(e_t):l(s.frustum.width)?f=s.frustum.clone(t_t):f=s.frustum.clone(n_t);let{frustumCommandsList:d}=a,p=d.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(o,u.x,u.y);if(l(x)&&x>0&&x<1){let b=d[g],T;return e.mode===ne.SCENE2D?(T=s.position.z,s.position.z=T-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,c.update(r),c.updateFrustum(f)):(f.near=b.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,c.updateFrustum(f)),n=zi.drawingBufferToWorldCoordinates(e,u,x,n),e.mode===ne.SCENE2D&&(s.position.z=T,c.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var i_t=new fe;na.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,i_t);o.cartographicToCartesian(r,n)}return n};function zbe(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,d=c.exclude;if(l(f)&&!l(u)){o.push(c);break}if(!l(u)||!l(u.primitive)||!d&&(o.push(c),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(g=!0,i.show=gn.toValue(!1,i.show),s.push(i))),u instanceof Ws&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=gn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}na.prototype.drillPick=function(e,t,n,i,o){let r=this;return zbe(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var Vbe=new h,o_t=new h;function r_t(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function Hbe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,Vbe),s=h.cross(o,r,Vbe),a=h.cross(o,s,o_t);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,Ube),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function s_t(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=Hbe(e,o,r,a),u=Hpt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}na.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)s_t(this,e,t[n])&&t.splice(n--,1)};function Gbe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Yl&&Gbe(o,t,n))}}function $8(e,t,n,i,o,r){let s=[];if(Gbe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new r_t(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function a_t(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function c_t(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,Hbe(e,n,o,f.camera);let d=je.clone(f.viewport,K8),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=Gpt:c.tilesetPassState=uB,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,fB),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(d);if(t.context.depthTexture){let{frustumCommandsList:x}=f,b=x.length;for(let T=0;T<b;++T){let A=e.getPickDepth(t,T).getDepth(a,0,0);if(l(A)&&A>0&&A<1){let E=x[T],v=E.near*(T!==0?t.opaqueFrustumNearOffset:1),D=E.far,O=v+A*(D-v);g=mn.getPoint(n,O);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&r||a_t(m,i)}}function Wbe(e,t,n,i,o,r,s,a){return zbe(i,function(){return c_t(e,t,n,o,r,s,a)})}function pv(e,t,n,i,o,r,s){let a=Wbe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function jbe(e,t,n,i,o,r,s,a){return Wbe(e,t,n,i,o,r,s,a)}function Q8(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}na.prototype.pickFromRay=function(e,t,n,i){return pv(this,e,t,n,i,!1,!1)};na.prototype.drillPickFromRay=function(e,t,n,i,o){return jbe(this,e,t,n,i,o,!1,!1)};na.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=mn.clone(t),n=l(n)?n.slice():n,Q8(e,$8(o,e,t,n,i,function(){return pv(o,e,t,n,i,!1,!0)}))};na.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=mn.clone(t),i=l(i)?i.slice():i,Q8(e,$8(r,e,t,i,o,function(){return jbe(r,e,t,n,i,o,!1,!0)}))};var l_t=new h,u_t=new h,f_t=new mn,qbe=new fe;function SK(e,t){let n=e.ellipsoid,i=li._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,u_t),r=fe.toCartesian(t,n,l_t),s=f_t;s.origin=r,s.direction=o;let a=new mn;return mn.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function Ybe(e,t){let n=e.ellipsoid,i=fe.fromCartesian(t,n,qbe);return SK(e,i)}function Xbe(e,t){let n=e.ellipsoid;return fe.fromCartesian(t,n,qbe).height}function d_t(e,t,n,i,o){let r=SK(t,n);return $8(e,t,r,i,o,function(){let s=pv(e,t,r,i,o,!0,!0);if(l(s))return Xbe(t,s.position)})}function h_t(e,t,n,i,o,r){let s=Ybe(t,n);return $8(e,t,s,i,o,function(){let a=pv(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}na.prototype.sampleHeight=function(e,t,n,i){let o=SK(e,t),r=pv(this,e,o,n,i,!0,!1);if(l(r))return Xbe(e,r.position)};na.prototype.clampToHeight=function(e,t,n,i,o){let r=Ybe(e,t),s=pv(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};na.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=d_t(this,e,t[s],n,i);return Q8(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};na.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=h_t(this,e,t[s],n,i,t[s]);return Q8(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};na.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var dB=na;var hB=`uniform sampler2D colorTexture; +`;var Bpt=!1;function R0(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ei({color:new H(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ei({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new je,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(R0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function kbe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Vbe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function kpt(e,t,n,i){kbe(e),e._translucentDepthStencilTexture=new It({context:t,width:n,height:i,pixelFormat:et.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:Zt.NEAREST})}function Vpt(e,t,n,i){Vbe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function Upt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(kpt(e,t,o,r),Vpt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Ue({sources:[K2]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Ue({sources:[KT]}),a={colorTexture:function(){return e._textureToComposite}},Bpt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Ue({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=Ze.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new Ue({sources:[KT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Ue({sources:[KT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!je.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,je.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=je.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!je.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!je.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,reference:Vt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!je.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:ln.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}R0.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){Upt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};R0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(we.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[we.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[we.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};R0.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),zpt(this,e,t)};function zpt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}R0.prototype.isSupported=function(){return this._supported};R0.prototype.isDestroyed=function(){return!1};R0.prototype.destroy=function(){return kbe(this),Vbe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var Z2=R0;function Hpt(){this.command=void 0,this.near=void 0,this.far=void 0}function G8(e,t,n){let i=e.context,o;i.depthTexture&&(o=new z2);let r;e._useOIT&&i.depthTexture&&(r=new W2(i));let s=new sc(i);s.viewport=je.clone(n),this.camera=t,this._cameraClone=so.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new X2(i),this.pickDepthFramebuffer=new q2,this.sceneFramebuffer=new YT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new H2,this.oit=r,this.translucentTileClassification=new Z2(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var AK=new h,EK=new h;function Gpt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,AK)),h.maximumComponent(h.abs(t.position,EK))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,AK),h.multiplyByScalar(t.position,o,EK),h.equalsEpsilon(AK,EK,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}G8.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Gpt(t,n,P.EPSILON15)?(this._cameraStartFired&&Ti()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ti(),so.clone(t,n),!0)};function Wpt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===ne.SCENE2D,u=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let g,m;c?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g));let x=d[p];l(x)?(x.near=g,x.far=m):x=d[p]=new U2(g,m)}}function jpt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var Ube=new _s,qpt=new Pa;G8.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let M=0;M<f.length;++M)for(let N=0;N<we.NUMBER_OF_PASSES;++N)f[M].indices[N]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,x=-Number.MAX_VALUE,{shadowsEnabled:b}=o,T=+Number.MAX_VALUE,C=-Number.MAX_VALUE,A=Number.MAX_VALUE,E=t.mode===ne.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,D=Ube.planes;for(let M=0;M<5;++M)D[M]=v.planes[M];v=Ube;for(let M=0;M<i.length;++M){let N=i[M],{pass:_,boundingVolume:S}=N;if(_===we.COMPUTE)c.push(N);else if(_===we.OVERLAY)u.push(N);else{let w,I;if(l(S)){if(!e.isVisible(v,N,E))continue;let B=S.computePlaneDistances(r,s,qpt);if(w=B.start,I=B.stop,m=Math.min(m,w),x=Math.max(x,I),b&&N.receiveShadows&&w<yg.MAXIMUM_DISTANCE&&!(_===we.GLOBE&&w<-100&&I>100)){let U=I-w;_!==we.GLOBE&&w<100&&(A=Math.min(A,U)),T=Math.min(T,w),C=Math.max(C,I)}}else N instanceof ei?(w=a.near,I=a.far):(w=a.near,I=a.far,m=Math.min(m,w),x=Math.max(x,I));let L=d[g];l(L)||(L=d[g]=new Hpt),L.command=N,L.near=w,L.far=I,g++}}b&&(T=Math.min(Math.max(T,a.near),a.far),C=Math.max(Math.min(C,a.far),T),o.nearPlane=T,o.farPlane=C,o.closestObjectSize=A),Wpt(this,e,m,x);for(let M=0;M<g;M++)jpt(this,e,d[M]);if(g<p)for(let M=g;M<p;M++){let N=d[M];if(!l(N.command))break;N.command=void 0}let O=f.length,{frustumSplits:R}=t;R.length=O+1;for(let M=0;M<O;++M)R[M]=f[M].near,M===O-1&&(R[M+1]=f[M].far)};G8.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var ZT=G8;var Hbe=.1,Ypt=new gd({pass:Uo.MOST_DETAILED_PRELOAD}),Xpt=new gd({pass:Uo.MOST_DETAILED_PICK}),$2=new gd({pass:Uo.PICK});function na(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new je(0,0,1,1),n=new so(e);n.frustum=new nn({width:Hbe,aspectRatio:1,near:.1}),this._pickOffscreenView=new ZT(e,n,t)}na.prototype.update=function(){this._pickPositionCacheDirty=!0};na.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new V2,n[t]=i),i};var Kpt=new Fr,Zpt=new h,W8=new h,$pt=new z,Qpt=new F;function Jpt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=F.clone(r.transform,Qpt);r._setTransform(F.IDENTITY);let d=h.clone(r.position,Zpt);h.multiplyByScalar(r.right,c,W8),h.add(W8,d,d),h.multiplyByScalar(r.up,u,W8),h.add(W8,d,d),r._setTransform(f),e.mode===ne.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(o.width,o.height,1,1,$pt),g=Kpt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,r.directionWC,r.upWC)}var e_t=new yl,t_t=new z;function n_t(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,d=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,g=d*a*c,m=s.getPixelDimensions(o.width,o.height,1,1,t_t),x=m.x*n*.5,b=m.y*i*.5,T=e_t;return T.top=g+b,T.bottom=g-b,T.right=p+x,T.left=p-x,T.near=a,T.far=s.far,T.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function j8(e,t,n,i,o){let r=e.camera.frustum;return r instanceof nn||r instanceof Fr?Jpt(e,t,n,i,o):n_t(e,t,n,i,o)}var q8=new je(0,0,3,3),Y8=new z,Q2=new H(0,0,0,0);function SK(e,t,n,i,o){return o.width=y(n,3),o.height=y(i,o.width),o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}na.prototype.pick=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=je.clone(a,u.viewport);let f=Hi.transformWindowToDrawingBuffer(e,t,Y8),d=SK(o.drawingBufferHeight,f,n,i,q8);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=j8(e,f,d.width,d.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=$2,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,Q2),e.resolveFramebuffers(u);let p=c.end(d);return o.endFrame(),p};na.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=je.clone(a,u.viewport);let f=Hi.transformWindowToDrawingBuffer(e,t,Y8),d=SK(o.drawingBufferHeight,f,n,i,q8);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=j8(e,f,d.width,d.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=$2,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,Q2),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return o.endFrame(),p};na.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=je.clone(s,c.viewport);let u=Hi.transformWindowToDrawingBuffer(e,t,Y8),f=SK(i.drawingBufferHeight,u,1,1,q8);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=j8(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=$2,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,Q2);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,k2.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function i_t(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=je.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=j8(e,t,1,1,s),o.tilesetPassState=$2,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,Q2),e.resolveFramebuffers(c),i.endFrame()}var o_t=new Ii,r_t=new yl,s_t=new nn,a_t=new Fr;na.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let u=Hi.transformWindowToDrawingBuffer(e,t,Y8);e.pickTranslucentDepth?i_t(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(o_t):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(r_t):l(s.frustum.width)?f=s.frustum.clone(s_t):f=s.frustum.clone(a_t);let{frustumCommandsList:d}=a,p=d.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(o,u.x,u.y);if(l(x)&&x>0&&x<1){let b=d[g],T;return e.mode===ne.SCENE2D?(T=s.position.z,s.position.z=T-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,c.update(r),c.updateFrustum(f)):(f.near=b.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,c.updateFrustum(f)),n=Hi.drawingBufferToWorldCoordinates(e,u,x,n),e.mode===ne.SCENE2D&&(s.position.z=T,c.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var c_t=new fe;na.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,c_t);o.cartographicToCartesian(r,n)}return n};function Gbe(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,d=c.exclude;if(l(f)&&!l(u)){o.push(c);break}if(!l(u)||!l(u.primitive)||!d&&(o.push(c),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(g=!0,i.show=gn.toValue(!1,i.show),s.push(i))),u instanceof Ws&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=gn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}na.prototype.drillPick=function(e,t,n,i,o){let r=this;return Gbe(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var zbe=new h,l_t=new h;function u_t(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function Wbe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,zbe),s=h.cross(o,r,zbe),a=h.cross(o,s,l_t);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,Hbe),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function f_t(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=Wbe(e,o,r,a),u=Ypt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}na.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)f_t(this,e,t[n])&&t.splice(n--,1)};function jbe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Yl&&jbe(o,t,n))}}function X8(e,t,n,i,o,r){let s=[];if(jbe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new u_t(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function d_t(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function h_t(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,Wbe(e,n,o,f.camera);let d=je.clone(f.viewport,q8),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=Xpt:c.tilesetPassState=$2,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,Q2),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(d);if(t.context.depthTexture){let{frustumCommandsList:x}=f,b=x.length;for(let T=0;T<b;++T){let A=e.getPickDepth(t,T).getDepth(a,0,0);if(l(A)&&A>0&&A<1){let E=x[T],v=E.near*(T!==0?t.opaqueFrustumNearOffset:1),D=E.far,O=v+A*(D-v);g=hn.getPoint(n,O);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&r||d_t(m,i)}}function qbe(e,t,n,i,o,r,s,a){return Gbe(i,function(){return h_t(e,t,n,o,r,s,a)})}function mv(e,t,n,i,o,r,s){let a=qbe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function Ybe(e,t,n,i,o,r,s,a){return qbe(e,t,n,i,o,r,s,a)}function K8(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}na.prototype.pickFromRay=function(e,t,n,i){return mv(this,e,t,n,i,!1,!1)};na.prototype.drillPickFromRay=function(e,t,n,i,o){return Ybe(this,e,t,n,i,o,!1,!1)};na.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=hn.clone(t),n=l(n)?n.slice():n,K8(e,X8(o,e,t,n,i,function(){return mv(o,e,t,n,i,!1,!0)}))};na.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=hn.clone(t),i=l(i)?i.slice():i,K8(e,X8(r,e,t,i,o,function(){return Ybe(r,e,t,n,i,o,!1,!0)}))};var m_t=new h,p_t=new h,__t=new hn,Xbe=new fe;function vK(e,t){let n=e.ellipsoid,i=li._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,p_t),r=fe.toCartesian(t,n,m_t),s=__t;s.origin=r,s.direction=o;let a=new hn;return hn.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function Kbe(e,t){let n=e.ellipsoid,i=fe.fromCartesian(t,n,Xbe);return vK(e,i)}function Zbe(e,t){let n=e.ellipsoid;return fe.fromCartesian(t,n,Xbe).height}function g_t(e,t,n,i,o){let r=vK(t,n);return X8(e,t,r,i,o,function(){let s=mv(e,t,r,i,o,!0,!0);if(l(s))return Zbe(t,s.position)})}function y_t(e,t,n,i,o,r){let s=Kbe(t,n);return X8(e,t,s,i,o,function(){let a=mv(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}na.prototype.sampleHeight=function(e,t,n,i){let o=vK(e,t),r=mv(this,e,o,n,i,!0,!1);if(l(r))return Zbe(e,r.position)};na.prototype.clampToHeight=function(e,t,n,i,o){let r=Kbe(e,t),s=mv(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};na.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=g_t(this,e,t[s],n,i);return K8(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};na.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=y_t(this,e,t[s],n,i,t[s]);return K8(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};na.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var J2=na;var eB=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13044,7 +11651,7 @@ void main() out_FragColor = vec4(color, fragmentColor.a); } -`;var mB=`precision highp float; +`;var tB=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; @@ -13188,7 +11795,7 @@ void main(void) ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var pB=`uniform sampler2D colorTexture; +`;var nB=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -13199,7 +11806,7 @@ void main(void) vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var _B=`uniform sampler2D colorTexture; +`;var iB=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; @@ -13218,7 +11825,7 @@ void main(void) darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var gB=`uniform sampler2D colorTexture; +`;var oB=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; @@ -13238,7 +11845,7 @@ void main(void) vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var yB=`uniform sampler2D colorTexture; +`;var rB=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; @@ -13249,7 +11856,7 @@ void main(void) vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var xB=`uniform sampler2D colorTexture; +`;var sB=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; @@ -13266,7 +11873,7 @@ void main(void) sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); out_FragColor = vec4(sceneColor, 1.0); } -`;var bB=`uniform sampler2D colorTexture; +`;var aB=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -13305,7 +11912,7 @@ void main(void) float d = computeDepthBlur(-posInCamera.z); out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); } -`;var TB=`uniform sampler2D depthTexture; +`;var cB=`uniform sampler2D depthTexture; in vec2 v_textureCoordinates; @@ -13314,7 +11921,7 @@ void main(void) float depth = czm_readDepth(depthTexture, v_textureCoordinates); out_FragColor = vec4(vec3(depth), 1.0); } -`;var CB=`uniform sampler2D depthTexture; +`;var lB=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; @@ -13374,7 +11981,7 @@ void main(void) float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } -`;var AB=`uniform sampler2D colorTexture; +`;var uB=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13414,7 +12021,7 @@ void main() c = czm_inverseGamma(c / w); out_FragColor = vec4(c, fragmentColor.a); } -`;var EB=`uniform sampler2D colorTexture; +`;var fB=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13439,7 +12046,7 @@ void main() out_FragColor = vec4(color, fragmentColor.a); } -`;var SB=`in vec2 v_textureCoordinates; +`;var dB=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; @@ -13460,7 +12067,7 @@ void main() float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } -`;var F0=`#define SAMPLES 8 +`;var O0=`#define SAMPLES 8 uniform float delta; uniform float sigma; @@ -13507,7 +12114,7 @@ void main() out_FragColor = result; } -`;var vB=`uniform sampler2D colorTexture; +`;var hB=`uniform sampler2D colorTexture; uniform sampler2D dirtTexture; uniform sampler2D starTexture; uniform vec2 dirtTextureDimensions; @@ -13660,7 +12267,7 @@ void main(void) out_FragColor = result; } -`;var wB=`uniform sampler2D colorTexture; +`;var mB=`uniform sampler2D colorTexture; uniform vec3 white; in vec2 v_textureCoordinates; @@ -13688,7 +12295,7 @@ void main() color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var DB=`uniform sampler2D colorTexture; +`;var pB=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13704,7 +12311,7 @@ void main(void) vec3 green = vec3(0.0, 1.0, 0.0); out_FragColor = vec4((noiseValue + rgb) * green, 1.0); } -`;var IB=`uniform sampler2D colorTexture; +`;var _B=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13731,7 +12338,7 @@ void main() color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var PB=`uniform sampler2D colorTexture; +`;var gB=`uniform sampler2D colorTexture; uniform sampler2D silhouetteTexture; in vec2 v_textureCoordinates; @@ -13742,7 +12349,682 @@ void main(void) vec4 color = texture(colorTexture, v_textureCoordinates); out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); } -`;function $T(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new z,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties($T.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function Kbe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function m_t(e,t){Kbe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new hi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function Zbe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function p_t(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function __t(e,t){let n=`uniform sampler2D colorTexture; +`;/** + * @license + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */var yB=`/** + * @license + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples +// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h + +// Steps used to integrate into Cesium: +// * The following defines are set: +// #define FXAA_PC 1 +// #define FXAA_WEBGL_1 1 +// #define FXAA_GREEN_AS_LUMA 1 +// #define FXAA_EARLY_EXIT 1 +// #define FXAA_GLSL_120 1 +// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. +// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace +// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. +// * There are no implicit conversions from ivec* to vec* so replace: +// #define FxaaInt2 ivec2 +// with +// #define FxaaInt2 vec2 +// * The texture2DLod function is only available in vertex shaders so replace: +// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) +// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) +// with +// #define FxaaTexTop(t, p) texture(t, p) +// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) +// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. +// * The following parameters to FxaaPixelShader are unused and can be removed: +// fxaaConsolePosPos +// fxaaConsoleRcpFrameOpt +// fxaaConsoleRcpFrameOpt2 +// fxaaConsole360RcpFrameOpt2 +// fxaaConsoleEdgeSharpness +// fxaaConsoleEdgeThreshold +// fxaaConsoleEdgeThresholdMi +// fxaaConsole360ConstDir + +// +// Choose the quality preset. +// This needs to be compiled into the shader as it effects code. +// Best option to include multiple presets is to +// in each shader define the preset, then include this file. +// +// OPTIONS +// ----------------------------------------------------------------------- +// 10 to 15 - default medium dither (10=fastest, 15=highest quality) +// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) +// 39 - no dither, very expensive +// +// NOTES +// ----------------------------------------------------------------------- +// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) +// 13 = about same speed as FXAA 3.9 and better than 12 +// 23 = closest to FXAA 3.9 visually and performance wise +// _ = the lowest digit is directly related to performance +// _ = the highest digit is directly related to style +// +//#define FXAA_QUALITY_PRESET 12 + + +#if (FXAA_QUALITY_PRESET == 10) + #define FXAA_QUALITY_PS 3 + #define FXAA_QUALITY_P0 1.5 + #define FXAA_QUALITY_P1 3.0 + #define FXAA_QUALITY_P2 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 11) + #define FXAA_QUALITY_PS 4 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 3.0 + #define FXAA_QUALITY_P3 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 12) + #define FXAA_QUALITY_PS 5 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 4.0 + #define FXAA_QUALITY_P4 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 13) + #define FXAA_QUALITY_PS 6 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 4.0 + #define FXAA_QUALITY_P5 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 14) + #define FXAA_QUALITY_PS 7 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 4.0 + #define FXAA_QUALITY_P6 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 15) + #define FXAA_QUALITY_PS 8 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 4.0 + #define FXAA_QUALITY_P7 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 20) + #define FXAA_QUALITY_PS 3 + #define FXAA_QUALITY_P0 1.5 + #define FXAA_QUALITY_P1 2.0 + #define FXAA_QUALITY_P2 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 21) + #define FXAA_QUALITY_PS 4 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 22) + #define FXAA_QUALITY_PS 5 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 23) + #define FXAA_QUALITY_PS 6 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 24) + #define FXAA_QUALITY_PS 7 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 3.0 + #define FXAA_QUALITY_P6 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 25) + #define FXAA_QUALITY_PS 8 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 4.0 + #define FXAA_QUALITY_P7 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 26) + #define FXAA_QUALITY_PS 9 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 4.0 + #define FXAA_QUALITY_P8 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 27) + #define FXAA_QUALITY_PS 10 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 4.0 + #define FXAA_QUALITY_P9 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 28) + #define FXAA_QUALITY_PS 11 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 4.0 + #define FXAA_QUALITY_P10 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 29) + #define FXAA_QUALITY_PS 12 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 2.0 + #define FXAA_QUALITY_P10 4.0 + #define FXAA_QUALITY_P11 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 39) + #define FXAA_QUALITY_PS 12 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.0 + #define FXAA_QUALITY_P2 1.0 + #define FXAA_QUALITY_P3 1.0 + #define FXAA_QUALITY_P4 1.0 + #define FXAA_QUALITY_P5 1.5 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 2.0 + #define FXAA_QUALITY_P10 4.0 + #define FXAA_QUALITY_P11 8.0 +#endif + +#define FxaaBool bool +#define FxaaFloat float +#define FxaaFloat2 vec2 +#define FxaaFloat3 vec3 +#define FxaaFloat4 vec4 +#define FxaaHalf float +#define FxaaHalf2 vec2 +#define FxaaHalf3 vec3 +#define FxaaHalf4 vec4 +#define FxaaInt2 vec2 +#define FxaaTex sampler2D + +#define FxaaSat(x) clamp(x, 0.0, 1.0) +#define FxaaTexTop(t, p) texture(t, p) +#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) + +FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } + +FxaaFloat4 FxaaPixelShader( + // + // Use noperspective interpolation here (turn off perspective interpolation). + // {xy} = center of pixel + FxaaFloat2 pos, + // + // Input color texture. + // {rgb_} = color in linear or perceptual color space + // if (FXAA_GREEN_AS_LUMA == 0) + // {___a} = luma in perceptual color space (not linear) + FxaaTex tex, + // + // Only used on FXAA Quality. + // This must be from a constant/uniform. + // {x_} = 1.0/screenWidthInPixels + // {_y} = 1.0/screenHeightInPixels + FxaaFloat2 fxaaQualityRcpFrame, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY_SUBPIX define. + // It is here now to allow easier tuning. + // Choose the amount of sub-pixel aliasing removal. + // This can effect sharpness. + // 1.00 - upper limit (softer) + // 0.75 - default amount of filtering + // 0.50 - lower limit (sharper, less sub-pixel aliasing removal) + // 0.25 - almost off + // 0.00 - completely off + FxaaFloat fxaaQualitySubpix, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define. + // It is here now to allow easier tuning. + // The minimum amount of local contrast required to apply algorithm. + // 0.333 - too little (faster) + // 0.250 - low quality + // 0.166 - default + // 0.125 - high quality + // 0.063 - overkill (slower) + FxaaFloat fxaaQualityEdgeThreshold, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define. + // It is here now to allow easier tuning. + // Trims the algorithm from processing darks. + // 0.0833 - upper limit (default, the start of visible unfiltered edges) + // 0.0625 - high quality (faster) + // 0.0312 - visible limit (slower) + // Special notes when using FXAA_GREEN_AS_LUMA, + // Likely want to set this to zero. + // As colors that are mostly not-green + // will appear very dark in the green channel! + // Tune by looking at mostly non-green content, + // then start at zero and increase until aliasing is a problem. + FxaaFloat fxaaQualityEdgeThresholdMin +) { +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posM; + posM.x = pos.x; + posM.y = pos.y; + FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); + #define lumaM rgbyM.y + FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); +/*--------------------------------------------------------------------------*/ + FxaaFloat maxSM = max(lumaS, lumaM); + FxaaFloat minSM = min(lumaS, lumaM); + FxaaFloat maxESM = max(lumaE, maxSM); + FxaaFloat minESM = min(lumaE, minSM); + FxaaFloat maxWN = max(lumaN, lumaW); + FxaaFloat minWN = min(lumaN, lumaW); + FxaaFloat rangeMax = max(maxWN, maxESM); + FxaaFloat rangeMin = min(minWN, minESM); + FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; + FxaaFloat range = rangeMax - rangeMin; + FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); + FxaaBool earlyExit = range < rangeMaxClamped; +/*--------------------------------------------------------------------------*/ + if(earlyExit) + return rgbyM; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNS = lumaN + lumaS; + FxaaFloat lumaWE = lumaW + lumaE; + FxaaFloat subpixRcpRange = 1.0/range; + FxaaFloat subpixNSWE = lumaNS + lumaWE; + FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; + FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNESE = lumaNE + lumaSE; + FxaaFloat lumaNWNE = lumaNW + lumaNE; + FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; + FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNWSW = lumaNW + lumaSW; + FxaaFloat lumaSWSE = lumaSW + lumaSE; + FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); + FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); + FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; + FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; + FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; + FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; +/*--------------------------------------------------------------------------*/ + FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; + FxaaFloat lengthSign = fxaaQualityRcpFrame.x; + FxaaBool horzSpan = edgeHorz >= edgeVert; + FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; +/*--------------------------------------------------------------------------*/ + if(!horzSpan) lumaN = lumaW; + if(!horzSpan) lumaS = lumaE; + if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; + FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; +/*--------------------------------------------------------------------------*/ + FxaaFloat gradientN = lumaN - lumaM; + FxaaFloat gradientS = lumaS - lumaM; + FxaaFloat lumaNN = lumaN + lumaM; + FxaaFloat lumaSS = lumaS + lumaM; + FxaaBool pairN = abs(gradientN) >= abs(gradientS); + FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); + if(pairN) lengthSign = -lengthSign; + FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posB; + posB.x = posM.x; + posB.y = posM.y; + FxaaFloat2 offNP; + offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; + offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; + if(!horzSpan) posB.x += lengthSign * 0.5; + if( horzSpan) posB.y += lengthSign * 0.5; +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posN; + posN.x = posB.x - offNP.x * FXAA_QUALITY_P0; + posN.y = posB.y - offNP.y * FXAA_QUALITY_P0; + FxaaFloat2 posP; + posP.x = posB.x + offNP.x * FXAA_QUALITY_P0; + posP.y = posB.y + offNP.y * FXAA_QUALITY_P0; + FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; + FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); + FxaaFloat subpixE = subpixC * subpixC; + FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); +/*--------------------------------------------------------------------------*/ + if(!pairN) lumaNN = lumaSS; + FxaaFloat gradientScaled = gradient * 1.0/4.0; + FxaaFloat lumaMM = lumaM - lumaNN * 0.5; + FxaaFloat subpixF = subpixD * subpixE; + FxaaBool lumaMLTZero = lumaMM < 0.0; +/*--------------------------------------------------------------------------*/ + lumaEndN -= lumaNN * 0.5; + lumaEndP -= lumaNN * 0.5; + FxaaBool doneN = abs(lumaEndN) >= gradientScaled; + FxaaBool doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1; + FxaaBool doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1; +/*--------------------------------------------------------------------------*/ + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 3) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 4) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 5) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 6) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 7) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 8) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 9) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 10) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 11) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 12) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } +/*--------------------------------------------------------------------------*/ + FxaaFloat dstN = posM.x - posN.x; + FxaaFloat dstP = posP.x - posM.x; + if(!horzSpan) dstN = posM.y - posN.y; + if(!horzSpan) dstP = posP.y - posM.y; +/*--------------------------------------------------------------------------*/ + FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; + FxaaFloat spanLength = (dstP + dstN); + FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; + FxaaFloat spanLengthRcp = 1.0/spanLength; +/*--------------------------------------------------------------------------*/ + FxaaBool directionN = dstN < dstP; + FxaaFloat dst = min(dstN, dstP); + FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; + FxaaFloat subpixG = subpixF * subpixF; + FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; + FxaaFloat subpixH = subpixG * fxaaQualitySubpix; +/*--------------------------------------------------------------------------*/ + FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; + FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); + if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; + if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; + return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); +} +`;function $T(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new z,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties($T.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function $be(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function x_t(e,t){$be(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new hi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function Qbe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function b_t(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function T_t(e,t){let n=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float sampleTexture(vec2 offset) { `;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); @@ -13779,7 +13061,7 @@ void main() { color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); `),n+=` out_FragColor = vec4(color); } -`,n}function g_t(e,t){Zbe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(__t(r,i),{framebuffer:n[r].framebuffer,uniformMap:p_t(e,r)});e._commands=o}$T.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new Jn({color:new H(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};$T.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,m_t(this,e),g_t(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};$T.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};$T.prototype.isDestroyed=function(){return!1};$T.prototype.destroy=function(){return Kbe(this),Zbe(this),ue(this)};var RB=$T;var y_t={NEAREST:0,LINEAR:1},ef=y_t;function QT(e){e=y(e,y.EMPTY_OBJECT);let{name:t=Hn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=ef.NEAREST,pixelFormat:a=et.RGBA,pixelDatatype:c=Ke.UNSIGNED_BYTE,clearColor:u=H.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let d=new rc;d.scissorTest={enabled:!0,rectangle:l(f)?je.clone(f):new je},this._passState=d,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(QT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var x_t=/uniform\s+sampler2D\s+depthTexture/g;QT.prototype._isSupported=function(e){return!x_t.test(this._fragmentShader)||e.depthTexture};function b_t(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof Pt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Pt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function T_t(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function C_t(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function A_t(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=T_t(e,r),n[r]=b_t(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Pt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=C_t(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=bt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function E_t(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,n}function C_t(e,t){Qbe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(T_t(r,i),{framebuffer:n[r].framebuffer,uniformMap:b_t(e,r)});e._commands=o}$T.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ei({color:new H(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};$T.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,x_t(this,e),C_t(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};$T.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};$T.prototype.isDestroyed=function(){return!1};$T.prototype.destroy=function(){return $be(this),Qbe(this),ue(this)};var xB=$T;var A_t={NEAREST:0,LINEAR:1},ef=A_t;function QT(e){e=y(e,y.EMPTY_OBJECT);let{name:t=zn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=ef.NEAREST,pixelFormat:a=et.RGBA,pixelDatatype:c=Ke.UNSIGNED_BYTE,clearColor:u=H.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let d=new sc;d.scissorTest={enabled:!0,rectangle:l(f)?je.clone(f):new je},this._passState=d,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(QT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var E_t=/uniform\s+sampler2D\s+depthTexture/g;QT.prototype._isSupported=function(e){return!E_t.test(this._fragmentShader)||e.depthTexture};function S_t(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof It&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof It&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function v_t(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function w_t(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function D_t(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=v_t(e,r),n[r]=S_t(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof It||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=w_t(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=xt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function I_t(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE uniform sampler2D czm_idTexture; uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; @@ -13803,8 +13085,8 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function S_t(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=E_t(n,o)}let i=new Ue({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function v_t(e){let t=e._sampleMode,n,i;t===ef.LINEAR?(n=Zt.LINEAR,i=di.LINEAR):(n=Zt.NEAREST,i=di.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function w_t(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function D_t(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function I_t(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new Pt({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],u=r[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=D_t(e,u);else if(typeof u=="string"){let d=new Se({url:u});s.push(d.fetchImage().then(w_t(e,c)))}else e._texturesToCreate.push({name:c,source:u})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function $be(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof Pt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function P_t(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function R_t(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];l(a.pickIds)?i+=a.pickIds.length:l(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Pt({context:t,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:$t.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,u=c.length;for(let f=0;f<u;++f){let d=c[f].color;r[o]=H.floatToByte(d.red),r[o+1]=H.floatToByte(d.green),r[o+2]=H.floatToByte(d.blue),r[o+3]=H.floatToByte(d.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=H.floatToByte(c.red),r[o+1]=H.floatToByte(c.green),r[o+2]=H.floatToByte(c.blue),r[o+3]=H.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new Pt({context:t,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:$t.NEAREST})}QT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&$be(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=P_t(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,R_t(this,e),A_t(this),I_t(this,e),S_t(this,e),v_t(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new je(0,0,i.width,i.height)}))),this._command.renderState=o};QT.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,$t.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};QT.prototype.isDestroyed=function(){return!1};QT.prototype.destroy=function(){return $be(this),ue(this)};var ho=QT;function JT(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Hn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(JT.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});JT.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};JT.prototype.get=function(e){return this._stages[e]};function O_t(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}JT.prototype.update=function(e,t){this._selectedDirty=O_t(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};JT.prototype.isDestroyed=function(){return!1};JT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var ru=JT;var Pr={};function vK(e){let o=`#define USE_STEP_SIZE -${F0}`,r=new ho({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:ef.LINEAR}),s=new ho({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:ef.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new ru({name:e,stages:[r,s],uniforms:a})}Pr.createBlurStage=function(){return vK("czm_blur")};Pr.createDepthOfFieldStage=function(){let e=vK("czm_depth_of_field_blur"),t=new ho({name:"czm_depth_of_field_composite",fragmentShader:bB,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new ru({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Pr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Pr.createEdgeDetectionStage=function(){let e=Hn();return new ho({name:`czm_edge_detection_${e}`,fragmentShader:CB,uniforms:{length:.25,color:H.clone(H.BLACK)}})};Pr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function M_t(e){if(!l(e))return Pr.createEdgeDetectionStage();let t=new ru({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +${e}`}function P_t(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=I_t(n,o)}let i=new Ue({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function R_t(e){let t=e._sampleMode,n,i;t===ef.LINEAR?(n=Kt.LINEAR,i=di.LINEAR):(n=Kt.NEAREST,i=di.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Zt({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function O_t(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function M_t(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function L_t(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new It({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],u=r[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=M_t(e,u);else if(typeof u=="string"){let d=new Se({url:u});s.push(d.fetchImage().then(O_t(e,c)))}else e._texturesToCreate.push({name:c,source:u})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function Jbe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof It&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function N_t(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function F_t(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];l(a.pickIds)?i+=a.pickIds.length:l(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new It({context:t,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:Zt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,u=c.length;for(let f=0;f<u;++f){let d=c[f].color;r[o]=H.floatToByte(d.red),r[o+1]=H.floatToByte(d.green),r[o+2]=H.floatToByte(d.blue),r[o+3]=H.floatToByte(d.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=H.floatToByte(c.red),r[o+1]=H.floatToByte(c.green),r[o+2]=H.floatToByte(c.blue),r[o+3]=H.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new It({context:t,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:Zt.NEAREST})}QT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&Jbe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=N_t(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,F_t(this,e),D_t(this),L_t(this,e),P_t(this,e),R_t(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new je(0,0,i.width,i.height)}))),this._command.renderState=o};QT.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,Zt.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};QT.prototype.isDestroyed=function(){return!1};QT.prototype.destroy=function(){return Jbe(this),ue(this)};var mo=QT;function JT(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=zn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(JT.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});JT.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};JT.prototype.get=function(e){return this._stages[e]};function B_t(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}JT.prototype.update=function(e,t){this._selectedDirty=B_t(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};JT.prototype.isDestroyed=function(){return!1};JT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var ru=JT;var Pr={};function wK(e){let o=`#define USE_STEP_SIZE +${O0}`,r=new mo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:ef.LINEAR}),s=new mo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:ef.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new ru({name:e,stages:[r,s],uniforms:a})}Pr.createBlurStage=function(){return wK("czm_blur")};Pr.createDepthOfFieldStage=function(){let e=wK("czm_depth_of_field_blur"),t=new mo({name:"czm_depth_of_field_composite",fragmentShader:aB,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new ru({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Pr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Pr.createEdgeDetectionStage=function(){let e=zn();return new mo({name:`czm_edge_detection_${e}`,fragmentShader:lB,uniforms:{length:.25,color:H.clone(H.BLACK)}})};Pr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function k_t(e){if(!l(e))return Pr.createEdgeDetectionStage();let t=new ru({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; `,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); if (edge${a}.a > 0.0) { @@ -13819,14 +13101,14 @@ void main() { ${o} } out_FragColor = color; } -`,s=new ho({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new ru({name:"czm_edge_detection_composite",stages:[t,s]})}Pr.createSilhouetteStage=function(e){let t=M_t(e),n=new ho({name:"czm_silhouette_color_edges",fragmentShader:PB,uniforms:{silhouetteTexture:t.name}});return new ru({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Pr.isSilhouetteSupported=function(e){return e.context.depthTexture};Pr.createBloomStage=function(){let e=new ho({name:"czm_bloom_contrast_bias",fragmentShader:xB,uniforms:{contrast:128,brightness:-.3}}),t=vK("czm_bloom_blur"),n=new ru({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new ho({name:"czm_bloom_generate_composite",fragmentShader:gB,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new ru({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Pr.createAmbientOcclusionStage=function(){let e=new ho({name:"czm_ambient_occlusion_generate",fragmentShader:mB,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new ho({name:"czm_ambient_occlusion_composite",fragmentShader:pB,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new ru({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Pr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var L_t=`#define FXAA_QUALITY_PRESET 39 -${MP} -${SB}`;Pr.createFXAAStage=function(){return new ho({name:"czm_FXAA",fragmentShader:L_t,sampleMode:ef.LINEAR})};Pr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=hB,new ho({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=AB,new ho({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=EB,new ho({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=IB,new ho({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=wB,new ho({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:H.WHITE,autoExposure:void 0,exposure:1}})};Pr.createAutoExposureStage=function(){return new RB};Pr.createBlackAndWhiteStage=function(){return new ho({name:"czm_black_and_white",fragmentShader:_B,uniforms:{gradations:5}})};Pr.createBrightnessStage=function(){return new ho({name:"czm_brightness",fragmentShader:yB,uniforms:{brightness:.5}})};Pr.createNightVisionStage=function(){return new ho({name:"czm_night_vision",fragmentShader:DB})};Pr.createDepthViewStage=function(){return new ho({name:"czm_depth_view",fragmentShader:TB})};Pr.createLensFlareStage=function(){return new ho({name:"czm_lens_flare",fragmentShader:vB,uniforms:{dirtTexture:nn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:nn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ee.WGS84.maximumRadius}})};var tf=Pr;function bg(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function MB(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function wK(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[MB(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(r[MB(d)]=!0)}}}return i.name}function OB(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=OB(e,t,n,p,o):a=wK(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<c;++u)f=MB(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=MB(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[MB(i.get(p))]=!0}return a}function N_t(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=OB(e,t,n,i,void 0);a=OB(e,t,n,o,a),a=wK(e,t,n,r,a),a=OB(e,t,n,e,a),wK(e,t,n,s,a)}else OB(e,t,n,e,void 0);return n}function F_t(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],r!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!H.equals(u,d.clearColor))continue;let m=d.stages,x=m.length,b=!1;for(let T=0;T<x;++T)if(n[m[T]]){b=!0;break}if(!b)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function B_t(e,t){let n=N_t(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=F_t(e,i,n[i]))}function DK(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function k_t(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new Jn({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}bg.prototype.updateDependencies=function(){this._updateDependencies=!0};bg.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(DK(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&B_t(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,DK(this),k_t(this,e))};bg.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};bg.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};bg.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};bg.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};bg.prototype.isDestroyed=function(){return!1};bg.prototype.destroy=function(){return DK(this),ue(this)};var eC=bg;var V_t={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var Tg=Object.freeze(V_t);var IK=[];function yl(){let e=tf.createFXAAStage(),t=tf.createAmbientOcclusionStage(),n=tf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=tf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=Tg.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new eC(this),r={},s=IK;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(yl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return PK(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case Tg.REINHARD:n=tf.createReinhardTonemappingStage(t);break;case Tg.MODIFIED_REINHARD:n=tf.createModifiedReinhardTonemappingStage(t);break;case Tg.FILMIC:n=tf.createFilmicTonemappingStage(t);break;case Tg.PBR_NEUTRAL:n=tf.createPbrNeutralTonemappingStage(t);break;default:n=tf.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function PK(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}yl.prototype.add=function(e){let t=this._stageNames,n=IK;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};yl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=IK;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};yl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};yl.prototype.get=function(e){return PK(this),this._stages[e]};yl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};yl.prototype.getStageByName=function(e){return this._stageNames[e]};yl.prototype.update=function(e,t,n){PK(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let T=0;T<r.length;++T){let C=r[T];C.ready&&C.enabled&&C._isSupported(e)&&(o[s++]=C)}o.length=s;let a=s!==i.length;if(!a){for(let T=0;T<s;++T)if(o[T]!==i[T]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let g=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),x=d.enabled&&d._isSupported(e),b=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||x!==this._tonemappingEnabled||b!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=x,this._fxaaEnabled=b,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let C=new Uint8Array(196608);for(let A=0;A<196608;A+=3)C[A]=Math.floor(Math.random()*255);this._randomTexture=new Pt({context:e,pixelFormat:et.RGB,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:C,width:256,height:256},sampler:new $t({wrapS:Cn.REPEAT,wrapT:Cn.REPEAT,minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let T=0;T<r.length;++T)r[T].update(e,t);s=0;for(let T=0;T<r.length;++T){let C=r[T];C.ready&&C.enabled&&C._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};yl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function tC(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}yl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return tC(t)};function fp(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){fp(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)fp(e.get(r),t,tC(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)fp(e.get(r),t,n,i,o)}yl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!d&&!p&&!m&&r===0)return;let b=t;d&&a.ready&&(fp(a,e,b,n,i),b=tC(a)),p&&c.ready&&(fp(c,e,b,n,i),b=tC(c)),g&&u.ready&&fp(u,e,b,n,i),m&&f.ready&&(fp(f,e,b,n,i),b=tC(f));let T=b;if(r>0){fp(o[0],e,b,n,i);for(let C=1;C<r;++C)fp(o[C],e,tC(o[C-1]),n,i);T=tC(o[r-1])}x&&s.ready&&fp(s,e,T,n,i)};yl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(ou,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};yl.prototype.isDestroyed=function(){return!1};yl.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var LB=yl;var U_t={SHIFT:0,CTRL:1,ALT:2},ia=Object.freeze(U_t);var z_t={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},bn=Object.freeze(z_t);function B0(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function FK(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function nC(e){if(e.shiftKey)return ia.SHIFT;if(e.ctrlKey)return ia.CTRL;if(e.altKey)return ia.ALT}var ks={LEFT:0,MIDDLE:1,RIGHT:2};function nf(e,t,n,i){function o(r){i(e,r)}Ht.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function H_t(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Ht.supportsPointerEvents()?(nf(e,"pointerdown",t,X_t),nf(e,"pointerup",t,aTe),nf(e,"pointermove",t,K_t),nf(e,"pointercancel",t,aTe)):(nf(e,"mousedown",t,cTe),nf(e,"mouseup",n,lTe),nf(e,"mousemove",n,uTe),nf(e,"touchstart",t,q_t),nf(e,"touchend",n,nTe),nf(e,"touchmove",n,Y_t),nf(e,"touchcancel",n,nTe)),nf(e,"dblclick",t,W_t);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",nf(e,i,t,j_t)}function G_t(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var Qbe={position:new z};function BK(e){e._lastSeenTouchEvent=bi()}function kK(e){return bi()-e._lastSeenTouchEvent>Hh.mouseEmulationIgnoreMilliseconds}function NK(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function cTe(e,t){if(!kK(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ks.LEFT)i=bn.LEFT_DOWN;else if(n===ks.MIDDLE)i=bn.MIDDLE_DOWN;else if(n===ks.RIGHT)i=bn.RIGHT_DOWN;else return;let o=B0(e,t,e._primaryPosition);z.clone(o,e._primaryStartPosition),z.clone(o,e._primaryPreviousPosition);let r=nC(t),s=e.getInputAction(i,r);l(s)&&(z.clone(o,Qbe.position),s(Qbe),t.preventDefault())}var Jbe={position:new z},eTe={position:new z};function RK(e,t,n,i){let o=nC(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=B0(e,i,e._primaryPosition);if(l(r)&&(z.clone(a,Jbe.position),r(Jbe)),l(s)){let c=e._primaryStartPosition;NK(c,a,e._clickPixelTolerance)&&(z.clone(a,eTe.position),s(eTe))}}}function lTe(e,t){if(!kK(e))return;let n=t.button;n!==ks.LEFT&&n!==ks.MIDDLE&&n!==ks.RIGHT||(e._buttonDown[ks.LEFT]&&(RK(e,bn.LEFT_UP,bn.LEFT_CLICK,t),e._buttonDown[ks.LEFT]=!1),e._buttonDown[ks.MIDDLE]&&(RK(e,bn.MIDDLE_UP,bn.MIDDLE_CLICK,t),e._buttonDown[ks.MIDDLE]=!1),e._buttonDown[ks.RIGHT]&&(RK(e,bn.RIGHT_UP,bn.RIGHT_CLICK,t),e._buttonDown[ks.RIGHT]=!1))}var OK={startPosition:new z,endPosition:new z};function uTe(e,t){if(!kK(e))return;let n=nC(t),i=B0(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(bn.MOUSE_MOVE,n);l(r)&&(z.clone(o,OK.startPosition),z.clone(i,OK.endPosition),r(OK)),z.clone(i,o),(e._buttonDown[ks.LEFT]||e._buttonDown[ks.MIDDLE]||e._buttonDown[ks.RIGHT])&&t.preventDefault()}var tTe={position:new z};function W_t(e,t){let n=t.button,i;if(n===ks.LEFT)i=bn.LEFT_DOUBLE_CLICK;else return;let o=nC(t),r=e.getInputAction(i,o);l(r)&&(B0(e,t,tTe.position),r(tTe))}function j_t(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=nC(t),o=e.getInputAction(bn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function q_t(e,t){BK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,B0(e,r,new z));J8(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,z.clone(a.get(s)))}function nTe(e,t){BK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);J8(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var iTe={position:new z},MK={position1:new z,position2:new z},oTe={position:new z},rTe={position:new z},sTe={position:new z};function J8(e,t){let n=nC(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[ks.LEFT]){if(e._buttonDown[ks.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(bn.LEFT_UP,n),l(r)&&(z.clone(e._primaryPosition,oTe.position),r(oTe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(bn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];NK(c,u,e._clickPixelTolerance)&&(z.clone(e._primaryPosition,rTe.position),s(rTe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(bn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];z.clone(c,e._primaryPosition),z.clone(c,e._primaryStartPosition),z.clone(c,e._primaryPreviousPosition),e._buttonDown[ks.LEFT]=!0,r=e.getInputAction(bn.LEFT_DOWN,n),l(r)&&(z.clone(c,iTe.position),r(iTe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(bn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];NK(u,f,e._holdPixelTolerance)&&(z.clone(e._primaryPosition,sTe.position),s(sTe))}},Hh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(bn.PINCH_START,n),l(r)&&(z.clone(i.values[0],MK.position1),z.clone(i.values[1],MK.position2),r(MK),t.preventDefault()))}function Y_t(e,t){BK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let u=a.get(s);l(u)&&B0(e,r,u)}fTe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,z.clone(a.get(s),c.get(s))}var LK={startPosition:new z,endPosition:new z},NB={distance:{startPosition:new z,endPosition:new z},angleAndHeight:{startPosition:new z,endPosition:new z}};function fTe(e,t){let n=nC(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[ks.LEFT]){let a=i.values[0];z.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(bn.MOUSE_MOVE,n),l(s)&&(z.clone(c,LK.startPosition),z.clone(a,LK.endPosition),s(LK)),z.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(bn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,x=f.y-u.y,b=Math.sqrt(m*m+x*x)*.25,T=(c.y+a.y)*.125,C=(f.y+u.y)*.125,A=Math.atan2(p,d),E=Math.atan2(x,m);z.fromElements(0,b,NB.distance.startPosition),z.fromElements(0,g,NB.distance.endPosition),z.fromElements(E,C,NB.angleAndHeight.startPosition),z.fromElements(A,T,NB.angleAndHeight.endPosition),s(NB)}}function X_t(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,B0(e,t,new z)),J8(e,t),e._previousPositions.set(i,z.clone(n.get(i)))}else cTe(e,t)}function aTe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),J8(e,t),e._previousPositions.remove(i)}else lTe(e,t)}function K_t(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;B0(e,t,o),fTe(e,t);let r=e._previousPositions;z.clone(n.get(i),r.get(i))}else uTe(e,t)}function Hh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Hh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new z,this._primaryPosition=new z,this._primaryPreviousPosition=new z,this._positions=new St,this._previousPositions=new St,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),H_t(this)}Hh.prototype.setInputAction=function(e,t,n){let i=FK(t,n);this._inputEvents[i]=e};Hh.prototype.getInputAction=function(e,t){let n=FK(e,t);return this._inputEvents[n]};Hh.prototype.removeInputAction=function(e,t){let n=FK(e,t);delete this._inputEvents[n]};Hh.prototype.isDestroyed=function(){return!1};Hh.prototype.destroy=function(){return G_t(this),ue(this)};Hh.mouseEmulationIgnoreMilliseconds=800;Hh.touchHoldDelayMilliseconds=1500;var of=Hh;function iC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}iC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};iC.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof rn,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?Dgt(this,e):Ngt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Z_t=new h,$_t=new h,Q_t=new h,J_t=new h,egt=new h,tgt=new h,ngt=new h,igt=new fe,ogt=new F,rgt=new wi,sgt=new rn,agt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};iC.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(F.IDENTITY);let i=Z_t,o=$_t,r=Q_t;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,o),o),h.cross(h.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(u.positionWC,i),h.clone(u.directionWC,o),h.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,ngt),d=Mt.eastNorthUpToFixedFrame(f,t,ogt);F.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,igt),i),F.multiplyByPointAsVector(d,o,o),F.multiplyByPointAsVector(d,r,r)}}let s;this._morphToOrthographic?(s=sgt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=rgt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=agt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Bgt(a);FB(this,c),this._previousMode===ne.SCENE2D?Fgt(this,e,a,c):(a.position2D=F.multiplyByPoint(so.TRANSFORM_2D,i,J_t),a.direction2D=F.multiplyByPointAsVector(so.TRANSFORM_2D,o,egt),a.up2D=F.multiplyByPointAsVector(so.TRANSFORM_2D,r,tgt),n._mode=ne.MORPHING,CTe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var zK={position:new h,direction:new h,up:new h,frustum:void 0},hTe=new wi;iC.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ne.SCENE2D)ygt(this,e,t);else{let i;e>0?(i=zK,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=mTe(this,t);let o,r=n.camera;r.frustum instanceof rn?o=r.frustum.clone():(o=hTe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=P.toRadians(60)),i.frustum=o;let s=ETe(i);FB(this,s),UK(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};iC.prototype.isDestroyed=function(){return!1};iC.prototype.destroy=function(){return eG(this),ue(this)};function FB(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new of(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,bn.LEFT_DOWN),e._morphHandler.setInputAction(n,bn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,bn.RIGHT_DOWN),e._morphHandler.setInputAction(n,bn.WHEEL)}}function eG(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var cgt=new fe,lgt=new h,ugt=new F;function mTe(e,t){let n=e._scene,i=n.camera,o=zK,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,cgt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,lgt),f=Mt.eastNorthUpToFixedFrame(u,t,ugt);return F.multiplyByPointAsVector(f,i.direction,s),F.multiplyByPointAsVector(f,i.up,a),o}var fgt=new h,dgt=new h,hgt=new h,mgt=new h,pgt=new h,_gt=new h;function UK(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,fgt),a=h.clone(r.direction,dgt),c=h.clone(r.up,hgt),u=F.multiplyByPoint(so.TRANSFORM_2D_INVERSE,n.position,mgt),f=F.multiplyByPointAsVector(so.TRANSFORM_2D_INVERSE,n.direction,pgt),d=F.multiplyByPointAsVector(so.TRANSFORM_2D_INVERSE,n.up,_gt);function p(m){bd(s,u,m.time,r.position),bd(a,f,m.time,r.direction),bd(c,d,m.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){ATe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var ggt=new rn,pTe=new h,_Te=new h,gTe=new h,HK=new h,yTe=new h,xTe=new h;function ygt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=zK,h.fromDegrees(0,0,5*n.maximumRadius,n,r.position),h.negate(r.position,r.direction),h.normalize(r.direction,r.direction),h.clone(h.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=mTe(e,n));let s;e._morphToOrthographic?(s=ggt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=hTe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),r.frustum=s;let a=ETe(r);FB(e,a);let c;e._morphToOrthographic?c=function(){UK(e,t,r,a)}:c=function(){TTe(e,t,r,function(){UK(e,t,r,a)})},t>0?(i._mode=ne.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,HK),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function bd(e,t,n,i){return h.lerp(e,t,n,i)}function bTe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof rn)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=r.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(d)}var xgt=new h,bgt=new h,Tgt=new h,VK=new h,Cgt=new h,Agt=new h,Egt=new Fr,Sgt=new mn,vgt=new h,wgt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function Dgt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,xgt),r=h.clone(i.direction,bgt),s=h.clone(i.up,Tgt),a=h.negate(h.UNIT_Z,Cgt),c=h.clone(h.UNIT_Y,Agt),u=VK;if(t>0)h.clone(h.ZERO,VK),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,VK);let b=Sgt;F.multiplyByPoint(so.TRANSFORM_2D,o,b.origin),F.multiplyByPointAsVector(so.TRANSFORM_2D,r,b.direction);let T=n.globe;if(l(T)){let C=T.pickWorldCoordinates(b,n,!0,vgt);l(C)&&(F.multiplyByPoint(so.TRANSFORM_2D_INVERSE,C,u),u.z+=h.distance(o,u))}}let f=Egt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=wgt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=STe(d);FB(e,p);function g(b){bd(o,u,b.time,i.position),bd(r,a,b.time,i.direction),bd(s,c,b.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(b,T){b.position.z=T}let x=n.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){bTe(e,t,d,m,p)}});e._currentTweens.push(x)}var dTe=new fe,Igt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Fr},Pgt={position:new h,direction:new h,up:new h,frustum:void 0},Rgt=new h,Ogt=new mn,Mgt=new F,Lgt=new h;function Ngt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Igt;if(t>0)h.clone(h.ZERO,r.position),r.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,dTe),i.mapProjection.project(dTe,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let d=Ogt;h.clone(r.position2D,d.origin);let p=h.clone(o.directionWC,d.direction),g=n.scaleToGeodeticSurface(o.positionWC,Lgt),m=Mt.eastNorthUpToFixedFrame(g,n,Mgt);F.inverseTransformation(m,m),F.multiplyByPointAsVector(m,p,p),F.multiplyByPointAsVector(so.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let b=x.pickWorldCoordinates(d,i,!0,Rgt);if(l(b)){let T=h.distance(r.position2D,b);b.x+=T,h.clone(b,r.position2D)}}}function s(d,p){d.position.x=p}F.multiplyByPoint(so.TRANSFORM_2D,r.position,r.position2D),F.multiplyByPointAsVector(so.TRANSFORM_2D,r.direction,r.direction2D),F.multiplyByPointAsVector(so.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=Pgt;F.multiplyByPoint(so.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let u=STe(c);FB(e,u);function f(){bTe(e,t,r,s,u)}CTe(e,t,r,f)}function TTe(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=P.lerp(c,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let d=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function Fgt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,HK),a=h.clone(n.direction,yTe),c=h.clone(n.up,xTe);o._mode=ne.MORPHING;function u(){r.frustum=n.frustum.clone();let f=h.clone(r.position,pTe),d=h.clone(r.direction,_Te),p=h.clone(r.up,gTe);f.z=s.z;function g(x){bd(f,s,x.time,r.position),bd(d,a,x.time,r.direction),bd(p,c,x.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():TTe(e,0,n,u)}function CTe(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,pTe),a=h.clone(r.direction,_Te),c=h.clone(r.up,gTe),u=h.clone(n.position2D,HK),f=h.clone(n.direction2D,yTe),d=h.clone(n.up2D,xTe);function p(m){bd(s,u,m.time,r.position),bd(a,f,m.time,r.direction),bd(c,d,m.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){ATe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function ATe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Kr.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function ETe(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),eG(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE3D,r)}}function STe(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),eG(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE2D,o)}}function Bgt(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),eG(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.COLUMBUS_VIEW,r)}}var BB=iC;var kgt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Bi=Object.freeze(kgt);function oa(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function Vgt(e,t){z.clone(e.distance.startPosition,t.distance.startPosition),z.clone(e.distance.endPosition,t.distance.endPosition),z.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),z.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function vTe(e,t,n){let i=oa(Bi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new z;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new z,endPosition:new z},u.angleAndHeight={startPosition:new z,endPosition:new z},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,z.lerp(f.position1,f.position2,.5,s[i])},bn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},bn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(Vgt(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(z.clone(f.distance.endPosition,u.distance.endPosition),z.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},bn.PINCH_MOVE,t)}function wTe(e,t){let n=oa(Bi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new z,endPosition:new z,valid:!1}),s.startPosition=new z,z.clone(z.ZERO,s.startPosition),s.endPosition=new z,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,z.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},bn.WHEEL,t)}function _v(e,t,n){let i=oa(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new z;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new z,endPosition:new z,valid:!1});let c,u;n===Bi.LEFT_DRAG?(c=bn.LEFT_DOWN,u=bn.LEFT_UP):n===Bi.RIGHT_DRAG?(c=bn.RIGHT_DOWN,u=bn.RIGHT_UP):n===Bi.MIDDLE_DRAG&&(c=bn.MIDDLE_DOWN,u=bn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,z.clone(f.position,r[i])},c,t),e._eventHandler.setInputAction(function(){GK(oa(n,void 0),e);for(let f of Object.values(ia)){let d=oa(n,f);GK(d,e)}},u,t)}function GK(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function DTe(e,t){z.clone(e.startPosition,t.startPosition),z.clone(e.endPosition,t.endPosition)}function Ugt(e,t,n){let i=n._isDown,o=!1,r=oa(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==r&&(o=!0,GK(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new z,endPosition:new z,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function ITe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Bi)if(Bi.hasOwnProperty(s)){let a=Bi[s];if(l(a)){let c=oa(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new z,endPosition:new z,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new z,endPosition:new z})}}e._eventHandler.setInputAction(function(s){for(let a in Bi)if(Bi.hasOwnProperty(a)){let c=Bi[a];if(l(c)){let u=oa(c,t);Ugt(c,t,e),r[u]&&(n[u]?(DTe(i[u],o[u]),o[u].valid=!0,DTe(s,i[u]),n[u]=!1):z.clone(s.endPosition,i[u].endPosition))}}z.clone(s.endPosition,e._currentMousePosition)},bn.MOUSE_MOVE,t)}function Td(e){this._eventHandler=new of(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new z,wTe(this,void 0),vTe(this,void 0,e),_v(this,void 0,Bi.LEFT_DRAG),_v(this,void 0,Bi.RIGHT_DRAG),_v(this,void 0,Bi.MIDDLE_DRAG),ITe(this,void 0);for(let t in ia)if(ia.hasOwnProperty(t)){let n=ia[t];l(n)&&(wTe(this,n),vTe(this,n,e),_v(this,n,Bi.LEFT_DRAG),_v(this,n,Bi.RIGHT_DRAG),_v(this,n,Bi.MIDDLE_DRAG),ITe(this,n))}}Object.defineProperties(Td.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[oa(Bi.WHEEL)]||!this._update[oa(Bi.WHEEL,ia.SHIFT)]||!this._update[oa(Bi.WHEEL,ia.CTRL)]||!this._update[oa(Bi.WHEEL,ia.ALT)];return this._buttonsDown>0||e}}});Td.prototype.isMoving=function(e,t){let n=oa(e,t);return!this._update[n]};Td.prototype.getMovement=function(e,t){let n=oa(e,t);return this._movement[n]};Td.prototype.getLastMovement=function(e,t){let n=oa(e,t),i=this._lastMovement[n];if(i.valid)return i};Td.prototype.isButtonDown=function(e,t){let n=oa(e,t);return this._isDown[n]};Td.prototype.getStartMousePosition=function(e,t){if(e===Bi.WHEEL)return this._currentMousePosition;let n=oa(e,t);return this._eventStartPosition[n]};Td.prototype.getButtonPressTime=function(e,t){let n=oa(e,t);return this._pressTime[n]};Td.prototype.getButtonReleaseTime=function(e,t){let n=oa(e,t);return this._releaseTime[n]};Td.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Td.prototype.isDestroyed=function(){return!1};Td.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var kB=Td;function tG(e,t,n,i,o,r,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ge(n),this._stopObject=Ge(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(tG.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});tG.prototype.cancelTween=function(){this._tweens.remove(this)};function Gh(){this._tweens=[]}Object.defineProperties(Gh.prototype,{length:{get:function(){return this._tweens.length}}});Gh.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new tG(this);let t=e.duration/qn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/qn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,Kr.LINEAR_NONE),r=e.startObject,s=new mye(r);s.to(Ge(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new tG(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Gh.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Gh.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Gh.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Gh.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Gh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Gh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Gh.prototype.get=function(e){return this._tweens[e]};Gh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/qn.SECONDS_PER_MILLISECOND:bi();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var oC=Gh;function UB(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=Bi.LEFT_DRAG,this.zoomEventTypes=[Bi.RIGHT_DRAG,Bi.WHEEL,Bi.PINCH],this.rotateEventTypes=Bi.LEFT_DRAG,this.tiltEventTypes=[Bi.MIDDLE_DRAG,Bi.PINCH,{eventType:Bi.LEFT_DRAG,modifier:ia.CTRL},{eventType:Bi.RIGHT_DRAG,modifier:ia.CTRL}],this.lookEventTypes={eventType:Bi.LEFT_DRAG,modifier:ia.SHIFT};let t=y(e.ellipsoid,ee.default);this.minimumPickingTerrainHeight=ee.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ee.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ee.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ee.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new kB(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new oC,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new z(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new z(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new z,this._strafeEndMousePosition=new z,this._zoomMouseStart=new z(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new z,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new fe(Math.PI,P.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function zgt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Hgt(e){return z.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var Ggt=.4;function Wgt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new z,endPosition:new z,motion:new z,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<Ggt){let g=zgt(p,i),m=e.getLastMovement(t,n);if(!l(m)||Hgt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=z.clone(m.startPosition,a.startPosition),a.endPosition=z.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=z.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||z.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function jgt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var PTe=[];function xl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(PTe[0]=n,n=PTe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),jgt(e,r)):o<1&&Wgt(s,f,d,o,i,e,r))}}var nG=new mn,qgt=new h,Ygt=new z,Xgt=new h,Kgt=new z,Zgt=new h,$gt=new h,Qgt=new h,Jgt=new h,HTe=new h,eyt=new h,tyt=new h,nyt=new h,iyt=new h,oyt=new h,ryt=new h,syt=new h,ayt=new h,cyt=new h,lyt=new h,rC=new h,RTe=new h,OTe=new h,WK={orientation:new va};function QK(e,t,n,i,o,r){let s=1;l(r)&&(s=P.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=o-u,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let x=e._scene,b=x.camera,T=x.mode,C=WK.orientation;if(C.heading=b.heading,C.pitch=b.pitch,C.roll=b.roll,b.frustum instanceof rn){Math.abs(m)>0&&(b.zoomIn(m),b._adjustOrthographicFrustum(!0));return}let A=y(n.inertiaEnabled,z.equals(t,e._zoomMouseStart)),E=e._zoomingOnVector,v=e._rotatingZoom,D;if(A||(e._zoomMouseStart=z.clone(t,e._zoomMouseStart),l(e._globe)&&T===ne.SCENE2D?(D=b.getPickRay(t,nG).origin,D=h.fromElements(D.y,D.z,D.x)):l(e._globe)&&(D=Cg(e,t,qgt)),l(D)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(D,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,E=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(m);return}let O=T===ne.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!A||v){if(T===ne.SCENE2D){let R=e._zoomWorldPosition,M=b.position;if(!h.equals(R,M)&&b.positionCartographic.height<e._maxCoord.x*2){let N=b.position.x,_=h.subtract(R,M,Xgt);h.normalize(_,_);let S=h.distance(R,M)*m/(b.getMagnitude()*.5);b.move(_,S*.5),(b.position.x<0&&N>0||b.position.x>0&&N<0)&&(D=b.getPickRay(t,nG).origin,D=h.fromElements(D.y,D.z,D.x),e._zoomWorldPosition=h.clone(D,e._zoomWorldPosition))}}else if(T===ne.SCENE3D){let R=h.normalize(b.position,HTe);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(h.dot(b.direction,R))<.6)O=!0;else{let M=x.canvas,N=Kgt;N.x=M.clientWidth/2,N.y=M.clientHeight/2;let _=Cg(e,N,Zgt);if(!l(_))O=!0;else if(b.positionCartographic.height<1e6)if(h.dot(b.direction,R)>=-.5)O=!0;else{let S=tyt;h.clone(b.position,S);let w=e._zoomWorldPosition,I=eyt;if(I=h.normalize(w,I),h.dot(I,R)<0)return;let L=lyt,B=oyt;h.clone(b.direction,B),h.add(S,h.multiplyByScalar(B,1e3,rC),L);let U=ryt,V=syt;h.subtract(w,S,U),h.normalize(U,V);let G=h.dot(R,V);if(G>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-G),W=h.magnitude(S),j=h.magnitude(w),J=W-m,q=h.magnitude(U),K=Math.asin(P.clamp(q/j*Math.sin(k),-1,1)),Q=Math.asin(P.clamp(J/j*Math.sin(k),-1,1)),de=K-Q+k,ye=nyt;h.normalize(S,ye);let ce=iyt;ce=h.cross(V,ye,ce),ce=h.normalize(ce,ce),h.normalize(h.cross(ye,ce,rC),B),h.multiplyByScalar(h.normalize(L,rC),h.magnitude(L)-m,L),h.normalize(S,S),h.multiplyByScalar(S,J,S);let _e=ayt;h.multiplyByScalar(h.add(h.multiplyByScalar(ye,Math.cos(de)-1,RTe),h.multiplyByScalar(B,Math.sin(de),OTe),rC),J,_e),h.add(S,_e,S),h.normalize(L,ye),h.normalize(h.cross(ye,ce,rC),B);let xe=cyt;h.multiplyByScalar(h.add(h.multiplyByScalar(ye,Math.cos(de)-1,RTe),h.multiplyByScalar(B,Math.sin(de),OTe),rC),h.magnitude(L),xe),h.add(L,xe,L),h.clone(S,b.position),h.normalize(h.subtract(L,S,rC),b.direction),h.clone(b.direction,b.direction),h.cross(b.direction,b.up,b.right),h.cross(b.right,b.direction,b.up),b.setView(WK);return}else{let S=h.normalize(_,$gt),w=h.normalize(e._zoomWorldPosition,Qgt),I=h.dot(w,S);if(I>0&&I<1){let L=P.acosClamped(I),B=h.cross(w,S,Jgt),U=Math.abs(L)>P.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-m,V=m/U;b.rotate(B,L*V)}}}}e._rotatingZoom=!O}if(!A&&O||E){let R,M=zi.worldToWindowCoordinates(x,e._zoomWorldPosition,Ygt);T!==ne.COLUMBUS_VIEW&&z.equals(t,e._zoomMouseStart)&&l(M)?R=b.getPickRay(M,nG):R=b.getPickRay(t,nG);let N=R.direction;(T===ne.COLUMBUS_VIEW||T===ne.SCENE2D)&&h.fromElements(N.y,N.z,N.x,N),b.move(N,m),e._zoomingOnVector=!0}else b.zoomIn(m);e._cameraUnderground||b.setView(WK)}var uyt=new mn,fyt=new mn,dyt=new h;function hyt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,uyt).origin,s=o.getPickRay(n.endPosition,fyt).origin;r=h.fromElements(r.y,r.z,r.x,r),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(r,s,dyt),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function MTe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;QK(e,t,n,e.zoomFactor,o.getMagnitude())}var myt=new z,pyt=new z;function LTe(e,t,n){if(l(n.angleAndHeight)){_yt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=myt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=z.normalize(c,c);let u=pyt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=z.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(u.x);u.y<0&&(d=P.TWO_PI-d);let p=d-f;o.twistRight(p)}function _yt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function gyt(e){let t=e._scene.mapMode2D===iu.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(xl(e,e.enableTranslate,e.translateEventTypes,hyt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),xl(e,e.enableZoom,e.zoomEventTypes,MTe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&xl(e,e.enableRotate,e.tiltEventTypes,LTe,e.inertiaSpin,"_lastInertiaTiltMovement")):(xl(e,e.enableZoom,e.zoomEventTypes,MTe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&xl(e,e.enableRotate,e.translateEventTypes,LTe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var GTe=new mn,yyt=new h,xyt=new h;function Cg(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,yyt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,GTe),u=o.pickWorldCoordinates(c,i,a,xyt),f=l(s)?h.distance(s,r.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(s,n):h.clone(u,n)}var byt=new fe;function lG(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,byt);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var Tyt=new h;function WTe(e,t){let n=t.origin,i=t.direction,o=lG(e),r=h.normalize(n,Tyt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function jTe(e,t,n,i){let o=h.distance(t.origin,n),r=lG(e),s=P.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),mn.getPoint(t,o,i)}function qTe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=lG(e))):o=lG(e),mn.getPoint(t,o,i)}var Cyt=new z;function YTe(e,t){let n=t.endPosition,i=z.subtract(t.endPosition,t.startPosition,Cyt),o=e._strafeEndMousePosition;z.add(o,i,o),t.endPosition=o,JK(e,t,e._strafeStartPosition),t.endPosition=n}var NTe=new mn,Ayt=new mn,jK=new h,Eyt=new h,Syt=new h,vyt=new h,wyt=new an(h.UNIT_X,0),Dyt=new z,Iyt=new z;function Pyt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){sf(e,t,n);return}if(e._strafing){YTe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=z.clone(n.startPosition,Dyt),a=z.clone(n.endPosition,Iyt),c=o.getPickRay(s,NTe),u=h.clone(h.ZERO,vyt),f=h.UNIT_X,d;if(o.position.z<e._minimumPickingTerrainHeight&&(d=Cg(e,s,jK),l(d)&&(u.x=d.x)),r||u.x>o.position.z&&l(d)){let A=d;r&&(A=qTe(e,c,d,jK)),z.clone(t,e._strafeMousePosition),z.clone(t,e._strafeEndMousePosition),h.clone(A,e._strafeStartPosition),e._strafing=!0,JK(e,n,e._strafeStartPosition);return}let p=an.fromPointNormal(u,f,wyt);c=o.getPickRay(s,NTe);let g=$n.rayPlane(c,p,jK),m=o.getPickRay(a,Ayt),x=$n.rayPlane(m,p,Eyt);if(!l(g)||!l(x)){e._looking=!0,sf(e,t,n),z.clone(t,e._translateMousePosition);return}let b=h.subtract(g,x,Syt),T=b.x;b.x=b.y,b.y=b.z,b.z=T;let C=h.magnitude(b);C>P.EPSILON6&&(h.normalize(b,b),o.move(b,C))}var XTe=new z,rG=new mn,sG=new h,Ryt=new h,KTe=new F,Oyt=new F,Myt=new h,Lyt=new an(h.UNIT_X,0),qK=new h,KK=new fe,ZTe=new F,Nyt=new Oe,Fyt=new $,aG=new h;function Byt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){sf(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,kyt(e,t,n)):Vyt(e,t,n)}function kyt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=XTe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,rG),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,sf(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,sG);h.add(u,g,g);let m=i.mapProjection,x=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let b=m.unproject(g,KK);x.cartographicToCartesian(b,g);let T=Mt.eastNorthUpToFixedFrame(g,x,KTe),C=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=F.clone(o.transform,ZTe);o._setTransform(T),rf(e,t,n,h.UNIT_Z),o._setTransform(E),e._globe=C,e._ellipsoid=A;let v=A.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function Vyt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(z.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,sG);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=Cg(e,t,sG)),!l(s)){a=o.getPickRay(t,rG);let _=a.origin,S=a.direction,w,I=h.dot(c,S);if(Math.abs(I)>P.EPSILON6&&(w=-h.dot(c,_)/I),!l(w)||w<=0){e._looking=!0,sf(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(S,w,sG),h.add(_,s,s)}r&&(l(a)||(a=o.getPickRay(t,rG)),jTe(e,a,s,s)),z.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=XTe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,rG);let d=h.clone(h.ZERO,Myt);d.x=s.x;let p=an.fromPointNormal(d,c,Lyt),g=$n.rayPlane(a,p,Ryt),m=o._projection,x=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let b=m.unproject(s,KK);x.cartographicToCartesian(b,s);let T=Mt.eastNorthUpToFixedFrame(s,x,KTe),C;l(g)?(h.fromElements(g.y,g.z,g.x,g),b=m.unproject(g,KK),x.cartographicToCartesian(b,g),C=Mt.eastNorthUpToFixedFrame(g,x,Oyt)):C=T;let A=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,D=F.clone(o.transform,ZTe);o._setTransform(T);let O=h.cross(h.UNIT_Z,h.normalize(o.position,qK),qK),R=h.dot(o.right,O);if(rf(e,t,n,v,!1,!0),o._setTransform(C),R<0){let _=n.startPosition.y-n.endPosition.y;(r&&_<0||!r&&_>0)&&(v=void 0);let S=o.constrainedAxis;o.constrainedAxis=void 0,rf(e,t,n,v,!0,!1),o.constrainedAxis=S}else rf(e,t,n,v,!0,!1);if(l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,aG);h.equalsEpsilon(_,h.ZERO,P.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(D),e._globe=A,e._ellipsoid=E;let M=E.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let N=h.clone(o.positionWC,qK);if(e.enableCollisionDetection&&nZ(e,!0),!h.equals(o.positionWC,N)){o._setTransform(C),o.worldToCameraCoordinatesPoint(N,N);let _=h.magnitudeSquared(N);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let S=h.angleBetween(N,o.position),w=h.cross(N,o.position,N);h.normalize(w,w);let I=Oe.fromAxisAngle(w,S,Nyt),L=$.fromQuaternion(I,Fyt);$.multiplyByVector(L,o.direction,o.direction),$.multiplyByVector(L,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(D)}}var $Te=new z,QTe=new mn,JTe=new h;function Uyt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=$Te,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,QTe),u=c.origin,f=c.direction,d=o.position.z,p;d<e._minimumPickingTerrainHeight&&(p=Cg(e,a,JTe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=WTe(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}QK(e,t,n,e.zoomFactor,g)}function zyt(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))xl(e,e.enableRotate,e.rotateEventTypes,rf,e.inertiaSpin,"_lastInertiaSpinMovement"),xl(e,e.enableZoom,e.zoomEventTypes,tCe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),xl(e,e.enableTilt,e.tiltEventTypes,Byt,e.inertiaSpin,"_lastInertiaTiltMovement"),xl(e,e.enableTranslate,e.translateEventTypes,Pyt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),xl(e,e.enableZoom,e.zoomEventTypes,Uyt,e.inertiaZoom,"_lastInertiaZoomMovement"),xl(e,e.enableLook,e.lookEventTypes,sf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var Hyt=new mn,Gyt=new an(h.UNIT_X,0),Wyt=new h,jyt=new h;function JK(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Hyt),s=h.clone(o.direction,jyt);i.mode===ne.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=an.fromPointNormal(n,s,Gyt),c=$n.rayPlane(r,a,Wyt);l(c)&&(s=h.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var FTe=new h,eCe=new fe,ZK=new h,$K=new ee,qyt=new h,Yyt=new h,Xyt=new h;function Kyt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(o.transform,F.IDENTITY)){rf(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(o.position,qyt);if(z.equals(t,e._rotateMousePosition)){if(e._looking)sf(e,t,n,u);else if(e._rotating)rf(e,t,n);else if(e._strafing)YTe(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=ZK,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,$K),XK(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,eCe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=Cg(e,n.startPosition,Xyt);if(l(p)){let g=!1,m=o.getPickRay(n.startPosition,GTe);if(r)g=!0,qTe(e,m,p,p);else{let x=s.geodeticSurfaceNormal(p,Yyt);Math.abs(h.dot(m.direction,x))<.05?g=!0:g=h.magnitude(o.position)<h.magnitude(p)}g?(z.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,JK(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=ZK,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,$K),XK(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,sf(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,FTe))?(XK(e,t,n,e._ellipsoid),h.clone(FTe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,rf(e,t,n)):(e._looking=!0,sf(e,t,n,u));z.clone(t,e._rotateMousePosition)}function rf(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=d*p*Math.PI*2,x=d*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let b=e.maximumTiltAngle,T=h.dot(a.direction,i),C=Math.PI-Math.acos(T)+x;C>b&&(x-=C-b)}o||a.rotateRight(m),r||a.rotateUp(x),a.constrainedAxis=u}var YK=oe.clone(oe.UNIT_W),BTe=oe.clone(oe.UNIT_W),iG=new h,gv=new h,oG=new h,kTe=new h,Zyt=new z,$yt=new z,Qyt=new z,Jyt=new z,e0t=new mn;function XK(e,t,n,i){let o=e._scene,r=o.camera,s=z.clone(n.startPosition,Zyt),a=z.clone(n.endPosition,$yt),c=i.cartesianToCartographic(r.positionWC,eCe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,YK),!l(e._globe)&&!z.equalsEpsilon(s,e._panLastMousePosition)&&(u=Cg(e,s,YK)),!l(e._globe)&&l(u))){let d=h.subtract(u,r.positionWC,gv),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,d),gv),g=h.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,Jyt),x=z.subtract(a,s,Qyt),b=h.multiplyByScalar(r.rightWC,x.x*m.x,gv),T=h.normalize(r.positionWC,HTe),C=r.getPickRay(a,e0t).direction,A=h.subtract(C,h.projectVector(C,r.rightWC,oG),oG),E=h.angleBetween(A,r.directionWC),v=1;l(r.frustum.fov)&&(v=Math.max(Math.tan(E),.1));let D=Math.abs(h.dot(r.directionWC,T)),O=-x.y*m.y*2/Math.sqrt(v)*(1-D),R=h.multiplyByScalar(C,O,oG);D=Math.abs(h.dot(r.upWC,T));let M=h.multiplyByScalar(r.upWC,-x.y*(1-D)*m.y,kTe);f=h.add(u,b,BTe),f=h.add(f,R,f),f=h.add(f,M,f),h.clone(f,e._panLastWorldPosition),z.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(s,i,YK),f=r.pickEllipsoid(a,i,BTe)),!l(u)||!l(f)){e._rotating=!0,rf(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let d=r.constrainedAxis,p=h.mostOrthogonalAxis(d,iG);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,gv),m=h.magnitude(u),x=h.dot(d,u),b=Math.acos(x/m),T=h.multiplyByScalar(d,x,oG);h.subtract(u,T,T),h.normalize(T,T);let C=h.magnitude(f),A=h.dot(d,f),E=Math.acos(A/C),v=h.multiplyByScalar(d,A,kTe);h.subtract(f,v,v),h.normalize(v,v);let D=Math.acos(h.dot(T,p));h.dot(T,g)<0&&(D=P.TWO_PI-D);let O=Math.acos(h.dot(v,p));h.dot(v,g)<0&&(O=P.TWO_PI-O);let R=D-O,M;h.equalsEpsilon(d,r.position,P.EPSILON2)?M=r.right:M=h.cross(d,r.position,iG);let N=h.cross(d,M,iG),_=h.dot(N,h.subtract(u,d,gv)),S=h.dot(N,h.subtract(f,d,gv)),w;_>0&&S>0?w=E-b:_>0&&S<=0?h.dot(r.position,d)>0?w=-b-E:w=b+E:w=b-E,r.rotateRight(R),r.rotateUp(w)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,iG);if(d<1&&!h.equalsEpsilon(p,h.ZERO,P.EPSILON14)){let g=Math.acos(d);r.rotate(p,g)}}}var t0t=new h,n0t=new fe,VTe=0;function tCe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=$Te,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,QTe),d,p=o.cartesianToCartographic(s.position,n0t).height,g=Math.abs(VTe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=Cg(e,u,JTe));let x;if(l(d)&&(x=h.distance(f.origin,d),VTe=x),c){let T=WTe(e,f,p);l(x)?x=Math.min(x,T):x=T}l(x)||(x=p);let b=h.normalize(s.position,t0t);QK(e,t,n,e.zoomFactor,x,h.dot(b,s.direction))}var nCe=new z,cG=new mn,VB=new h,i0t=new h,iCe=new F,o0t=new F,oCe=new F,r0t=new Oe,s0t=new $,eZ=new fe,tZ=new h;function a0t(e,t,n){let o=e._scene.camera;if(!F.equals(o.transform,F.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,tZ);sf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,eZ);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,l0t(e,t,n)):u0t(e,t,n)}var c0t=new fe;function l0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,c0t).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=nCe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,cG),d,p=$n.rayEllipsoid(f,i);if(l(p))d=mn.getPoint(f,p.start,VB);else if(a>e._minimumTrackBallHeight){let C=$n.grazingAltitudeLocation(f,i);if(!l(C))return;let A=i.cartesianToCartographic(C,eZ);A.height=0,d=i.cartographicToCartesian(A,VB)}else{e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(r.position,tZ);sf(e,t,n,C),z.clone(t,e._tiltCenterMousePosition);return}let g=Mt.eastNorthUpToFixedFrame(d,i,iCe),m=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=F.clone(r.transform,oCe);r._setTransform(g),rf(e,t,n,h.UNIT_Z),r._setTransform(b),e._globe=m,e._ellipsoid=x;let T=x.maximumRadius;e._rotateFactor=1/T,e._rotateRateRangeAdjustment=T}function u0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,u;if(z.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,VB);else{if(a=Cg(e,t,VB),!l(a)){if(c=r.getPickRay(t,cG),u=$n.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,eZ).height<=e._minimumTrackBallHeight){e._looking=!0;let S=e._ellipsoid.geodeticSurfaceNormal(r.position,tZ);sf(e,t,n,S),z.clone(t,e._tiltCenterMousePosition)}return}a=mn.getPoint(c,u.start,VB)}s&&(l(c)||(c=r.getPickRay(t,cG)),jTe(e,c,a,a)),z.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=o.canvas,d=nCe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=r.getPickRay(d,cG);let p=h.magnitude(a),g=h.fromElements(p,p,p,ZK),m=ee.fromCartesian3(g,$K);if(u=$n.rayEllipsoid(c,m),!l(u))return;let x=h.magnitude(c.origin)>p?u.start:u.stop,b=mn.getPoint(c,x,i0t),T=Mt.eastNorthUpToFixedFrame(a,i,iCe),C=Mt.eastNorthUpToFixedFrame(b,m,o0t),A=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,D=F.clone(r.transform,oCe);r._setTransform(C);let O=h.cross(b,r.positionWC,aG);if(h.dot(r.rightWC,O)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let S=r.constrainedAxis;r.constrainedAxis=void 0,rf(e,t,n,v,!0,!1),r.constrainedAxis=S}else rf(e,t,n,v,!0,!1);if(r._setTransform(T),rf(e,t,n,v,!1,!0),l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,aG);h.equalsEpsilon(_,h.ZERO,P.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(D),e._globe=A,e._ellipsoid=E;let M=E.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let N=h.clone(r.positionWC,aG);if(e.enableCollisionDetection&&nZ(e,!0),!h.equals(r.positionWC,N)){r._setTransform(C),r.worldToCameraCoordinatesPoint(N,N);let _=h.magnitudeSquared(N);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let S=h.angleBetween(N,r.position),w=h.cross(N,r.position,N);h.normalize(w,w);let I=Oe.fromAxisAngle(w,S,r0t),L=$.fromQuaternion(I,s0t);$.multiplyByVector(L,r.direction,r.direction),$.multiplyByVector(L,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(D)}}var f0t=new z,d0t=new z,UTe=new mn,zTe=new mn,h0t=new h,m0t=new h;function sf(e,t,n,i){let r=e._scene.camera,s=f0t;s.x=n.startPosition.x,s.y=0;let a=d0t;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,UTe),u=r.getPickRay(a,zTe),f=0,d,p;r.frustum instanceof rn?(d=c.origin,p=u.origin,h.add(r.direction,d,d),h.add(r.direction,p,p),h.subtract(d,r.position,d),h.subtract(p,r.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(m)?r.look(m,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,UTe),u=r.getPickRay(a,zTe),f=0,r.frustum instanceof rn?(d=c.origin,p=u.origin,h.add(r.direction,d,d),h.add(r.direction,p,p),h.subtract(d,r.position,d),h.subtract(p,r.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,m),l(i)){let x=r.direction,b=h.negate(i,h0t),T=h.equalsEpsilon(x,i,P.EPSILON2),C=h.equalsEpsilon(x,b,P.EPSILON2);if(!T&&!C){g=h.dot(x,i);let A=P.acosClamped(g);f>0&&f>A&&(f=A-P.EPSILON4),g=h.dot(x,b),A=P.acosClamped(g),f<0&&-f>A&&(f=-A+P.EPSILON4);let E=h.cross(i,x,m0t);r.look(E,f)}else(T&&f<0||C&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function p0t(e){xl(e,e.enableRotate,e.rotateEventTypes,Kyt,e.inertiaSpin,"_lastInertiaSpinMovement"),xl(e,e.enableZoom,e.zoomEventTypes,tCe,e.inertiaZoom,"_lastInertiaZoomMovement"),xl(e,e.enableTilt,e.tiltEventTypes,a0t,e.inertiaSpin,"_lastInertiaTiltMovement"),xl(e,e.enableLook,e.lookEventTypes,sf)}var _0t=new F,g0t=new fe;function nZ(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===ne.SCENE2D||i===ne.MORPHING)return;let o=n.camera,r=y(n.ellipsoid,ee.WGS84),s=n.mapProjection,a,c;F.equals(o.transform,F.IDENTITY)||(a=F.clone(o.transform,_0t),c=h.magnitude(o.position),o._setTransform(F.IDENTITY));let u=g0t;i===ne.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,g=d-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===ne.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=g*.1}}l(a)&&(o._setTransform(a),f&&(h.normalize(o.position,o.position),h.negate(o.position,o.direction),h.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),h.normalize(o.direction,o.direction),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up)))}UB.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var y0t=new h,x0t=new h;UB.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=y(e.ellipsoid,ee.default)):(this._globe=void 0,this._ellipsoid=ee.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Er.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Er.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Er.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,y0t),c=h.clone(t.directionWC,x0t);if(i===ne.SCENE2D?gyt(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,zyt(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,p0t(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);nZ(this,u)}this._aggregator.reset()};UB.prototype.isDestroyed=function(){return!1};UB.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var zB=UB;var HB=`uniform sampler2D colorTexture; +`,s=new mo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new ru({name:"czm_edge_detection_composite",stages:[t,s]})}Pr.createSilhouetteStage=function(e){let t=k_t(e),n=new mo({name:"czm_silhouette_color_edges",fragmentShader:gB,uniforms:{silhouetteTexture:t.name}});return new ru({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Pr.isSilhouetteSupported=function(e){return e.context.depthTexture};Pr.createBloomStage=function(){let e=new mo({name:"czm_bloom_contrast_bias",fragmentShader:sB,uniforms:{contrast:128,brightness:-.3}}),t=wK("czm_bloom_blur"),n=new ru({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new mo({name:"czm_bloom_generate_composite",fragmentShader:oB,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new ru({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Pr.createAmbientOcclusionStage=function(){let e=new mo({name:"czm_ambient_occlusion_generate",fragmentShader:tB,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new mo({name:"czm_ambient_occlusion_composite",fragmentShader:nB,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new ru({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Pr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var V_t=`#define FXAA_QUALITY_PRESET 39 +${yB} +${dB}`;Pr.createFXAAStage=function(){return new mo({name:"czm_FXAA",fragmentShader:V_t,sampleMode:ef.LINEAR})};Pr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=eB,new mo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=uB,new mo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=fB,new mo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=_B,new mo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Pr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=mB,new mo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:H.WHITE,autoExposure:void 0,exposure:1}})};Pr.createAutoExposureStage=function(){return new xB};Pr.createBlackAndWhiteStage=function(){return new mo({name:"czm_black_and_white",fragmentShader:iB,uniforms:{gradations:5}})};Pr.createBrightnessStage=function(){return new mo({name:"czm_brightness",fragmentShader:rB,uniforms:{brightness:.5}})};Pr.createNightVisionStage=function(){return new mo({name:"czm_night_vision",fragmentShader:pB})};Pr.createDepthViewStage=function(){return new mo({name:"czm_depth_view",fragmentShader:cB})};Pr.createLensFlareStage=function(){return new mo({name:"czm_lens_flare",fragmentShader:hB,uniforms:{dirtTexture:en("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:en("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ee.WGS84.maximumRadius}})};var tf=Pr;function xg(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function TB(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function DK(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[TB(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(r[TB(d)]=!0)}}}return i.name}function bB(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=bB(e,t,n,p,o):a=DK(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<c;++u)f=TB(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=TB(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[TB(i.get(p))]=!0}return a}function U_t(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=bB(e,t,n,i,void 0);a=bB(e,t,n,o,a),a=DK(e,t,n,r,a),a=bB(e,t,n,e,a),DK(e,t,n,s,a)}else bB(e,t,n,e,void 0);return n}function z_t(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],r!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!H.equals(u,d.clearColor))continue;let m=d.stages,x=m.length,b=!1;for(let T=0;T<x;++T)if(n[m[T]]){b=!0;break}if(!b)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function H_t(e,t){let n=U_t(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=z_t(e,i,n[i]))}function IK(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function G_t(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new ei({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}xg.prototype.updateDependencies=function(){this._updateDependencies=!0};xg.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(IK(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&H_t(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,IK(this),G_t(this,e))};xg.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};xg.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};xg.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};xg.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};xg.prototype.isDestroyed=function(){return!1};xg.prototype.destroy=function(){return IK(this),ue(this)};var eC=xg;var W_t={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var bg=Object.freeze(W_t);var PK=[];function xl(){let e=tf.createFXAAStage(),t=tf.createAmbientOcclusionStage(),n=tf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=tf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=bg.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new eC(this),r={},s=PK;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(xl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return RK(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case bg.REINHARD:n=tf.createReinhardTonemappingStage(t);break;case bg.MODIFIED_REINHARD:n=tf.createModifiedReinhardTonemappingStage(t);break;case bg.FILMIC:n=tf.createFilmicTonemappingStage(t);break;case bg.PBR_NEUTRAL:n=tf.createPbrNeutralTonemappingStage(t);break;default:n=tf.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function RK(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}xl.prototype.add=function(e){let t=this._stageNames,n=PK;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};xl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=PK;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};xl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};xl.prototype.get=function(e){return RK(this),this._stages[e]};xl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};xl.prototype.getStageByName=function(e){return this._stageNames[e]};xl.prototype.update=function(e,t,n){RK(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let T=0;T<r.length;++T){let C=r[T];C.ready&&C.enabled&&C._isSupported(e)&&(o[s++]=C)}o.length=s;let a=s!==i.length;if(!a){for(let T=0;T<s;++T)if(o[T]!==i[T]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let g=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),x=d.enabled&&d._isSupported(e),b=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||x!==this._tonemappingEnabled||b!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=x,this._fxaaEnabled=b,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let C=new Uint8Array(196608);for(let A=0;A<196608;A+=3)C[A]=Math.floor(Math.random()*255);this._randomTexture=new It({context:e,pixelFormat:et.RGB,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:C,width:256,height:256},sampler:new Zt({wrapS:Cn.REPEAT,wrapT:Cn.REPEAT,minificationFilter:Kt.NEAREST,magnificationFilter:di.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let T=0;T<r.length;++T)r[T].update(e,t);s=0;for(let T=0;T<r.length;++T){let C=r[T];C.ready&&C.enabled&&C._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};xl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function tC(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}xl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return tC(t)};function lp(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){lp(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)lp(e.get(r),t,tC(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)lp(e.get(r),t,n,i,o)}xl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!d&&!p&&!m&&r===0)return;let b=t;d&&a.ready&&(lp(a,e,b,n,i),b=tC(a)),p&&c.ready&&(lp(c,e,b,n,i),b=tC(c)),g&&u.ready&&lp(u,e,b,n,i),m&&f.ready&&(lp(f,e,b,n,i),b=tC(f));let T=b;if(r>0){lp(o[0],e,b,n,i);for(let C=1;C<r;++C)lp(o[C],e,tC(o[C-1]),n,i);T=tC(o[r-1])}x&&s.ready&&lp(s,e,T,n,i)};xl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(ou,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};xl.prototype.isDestroyed=function(){return!1};xl.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var CB=xl;var j_t={SHIFT:0,CTRL:1,ALT:2},ia=Object.freeze(j_t);var q_t={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},bn=Object.freeze(q_t);function M0(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function BK(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function nC(e){if(e.shiftKey)return ia.SHIFT;if(e.ctrlKey)return ia.CTRL;if(e.altKey)return ia.ALT}var ks={LEFT:0,MIDDLE:1,RIGHT:2};function nf(e,t,n,i){function o(r){i(e,r)}zt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Y_t(e){let t=e._element,n=l(t.disableRootEvents)?t:document;zt.supportsPointerEvents()?(nf(e,"pointerdown",t,J_t),nf(e,"pointerup",t,lTe),nf(e,"pointermove",t,egt),nf(e,"pointercancel",t,lTe)):(nf(e,"mousedown",t,uTe),nf(e,"mouseup",n,fTe),nf(e,"mousemove",n,dTe),nf(e,"touchstart",t,$_t),nf(e,"touchend",n,oTe),nf(e,"touchmove",n,Q_t),nf(e,"touchcancel",n,oTe)),nf(e,"dblclick",t,K_t);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",nf(e,i,t,Z_t)}function X_t(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var eTe={position:new z};function kK(e){e._lastSeenTouchEvent=Ti()}function VK(e){return Ti()-e._lastSeenTouchEvent>zh.mouseEmulationIgnoreMilliseconds}function FK(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function uTe(e,t){if(!VK(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ks.LEFT)i=bn.LEFT_DOWN;else if(n===ks.MIDDLE)i=bn.MIDDLE_DOWN;else if(n===ks.RIGHT)i=bn.RIGHT_DOWN;else return;let o=M0(e,t,e._primaryPosition);z.clone(o,e._primaryStartPosition),z.clone(o,e._primaryPreviousPosition);let r=nC(t),s=e.getInputAction(i,r);l(s)&&(z.clone(o,eTe.position),s(eTe),t.preventDefault())}var tTe={position:new z},nTe={position:new z};function OK(e,t,n,i){let o=nC(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=M0(e,i,e._primaryPosition);if(l(r)&&(z.clone(a,tTe.position),r(tTe)),l(s)){let c=e._primaryStartPosition;FK(c,a,e._clickPixelTolerance)&&(z.clone(a,nTe.position),s(nTe))}}}function fTe(e,t){if(!VK(e))return;let n=t.button;n!==ks.LEFT&&n!==ks.MIDDLE&&n!==ks.RIGHT||(e._buttonDown[ks.LEFT]&&(OK(e,bn.LEFT_UP,bn.LEFT_CLICK,t),e._buttonDown[ks.LEFT]=!1),e._buttonDown[ks.MIDDLE]&&(OK(e,bn.MIDDLE_UP,bn.MIDDLE_CLICK,t),e._buttonDown[ks.MIDDLE]=!1),e._buttonDown[ks.RIGHT]&&(OK(e,bn.RIGHT_UP,bn.RIGHT_CLICK,t),e._buttonDown[ks.RIGHT]=!1))}var MK={startPosition:new z,endPosition:new z};function dTe(e,t){if(!VK(e))return;let n=nC(t),i=M0(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(bn.MOUSE_MOVE,n);l(r)&&(z.clone(o,MK.startPosition),z.clone(i,MK.endPosition),r(MK)),z.clone(i,o),(e._buttonDown[ks.LEFT]||e._buttonDown[ks.MIDDLE]||e._buttonDown[ks.RIGHT])&&t.preventDefault()}var iTe={position:new z};function K_t(e,t){let n=t.button,i;if(n===ks.LEFT)i=bn.LEFT_DOUBLE_CLICK;else return;let o=nC(t),r=e.getInputAction(i,o);l(r)&&(M0(e,t,iTe.position),r(iTe))}function Z_t(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=nC(t),o=e.getInputAction(bn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function $_t(e,t){kK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,M0(e,r,new z));Z8(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,z.clone(a.get(s)))}function oTe(e,t){kK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);Z8(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var rTe={position:new z},LK={position1:new z,position2:new z},sTe={position:new z},aTe={position:new z},cTe={position:new z};function Z8(e,t){let n=nC(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[ks.LEFT]){if(e._buttonDown[ks.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(bn.LEFT_UP,n),l(r)&&(z.clone(e._primaryPosition,sTe.position),r(sTe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(bn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];FK(c,u,e._clickPixelTolerance)&&(z.clone(e._primaryPosition,aTe.position),s(aTe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(bn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];z.clone(c,e._primaryPosition),z.clone(c,e._primaryStartPosition),z.clone(c,e._primaryPreviousPosition),e._buttonDown[ks.LEFT]=!0,r=e.getInputAction(bn.LEFT_DOWN,n),l(r)&&(z.clone(c,rTe.position),r(rTe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(bn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];FK(u,f,e._holdPixelTolerance)&&(z.clone(e._primaryPosition,cTe.position),s(cTe))}},zh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(bn.PINCH_START,n),l(r)&&(z.clone(i.values[0],LK.position1),z.clone(i.values[1],LK.position2),r(LK),t.preventDefault()))}function Q_t(e,t){kK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let u=a.get(s);l(u)&&M0(e,r,u)}hTe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,z.clone(a.get(s),c.get(s))}var NK={startPosition:new z,endPosition:new z},AB={distance:{startPosition:new z,endPosition:new z},angleAndHeight:{startPosition:new z,endPosition:new z}};function hTe(e,t){let n=nC(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[ks.LEFT]){let a=i.values[0];z.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(bn.MOUSE_MOVE,n),l(s)&&(z.clone(c,NK.startPosition),z.clone(a,NK.endPosition),s(NK)),z.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(bn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,x=f.y-u.y,b=Math.sqrt(m*m+x*x)*.25,T=(c.y+a.y)*.125,C=(f.y+u.y)*.125,A=Math.atan2(p,d),E=Math.atan2(x,m);z.fromElements(0,b,AB.distance.startPosition),z.fromElements(0,g,AB.distance.endPosition),z.fromElements(E,C,AB.angleAndHeight.startPosition),z.fromElements(A,T,AB.angleAndHeight.endPosition),s(AB)}}function J_t(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,M0(e,t,new z)),Z8(e,t),e._previousPositions.set(i,z.clone(n.get(i)))}else uTe(e,t)}function lTe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),Z8(e,t),e._previousPositions.remove(i)}else fTe(e,t)}function egt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;M0(e,t,o),hTe(e,t);let r=e._previousPositions;z.clone(n.get(i),r.get(i))}else dTe(e,t)}function zh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-zh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new z,this._primaryPosition=new z,this._primaryPreviousPosition=new z,this._positions=new Et,this._previousPositions=new Et,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),Y_t(this)}zh.prototype.setInputAction=function(e,t,n){let i=BK(t,n);this._inputEvents[i]=e};zh.prototype.getInputAction=function(e,t){let n=BK(e,t);return this._inputEvents[n]};zh.prototype.removeInputAction=function(e,t){let n=BK(e,t);delete this._inputEvents[n]};zh.prototype.isDestroyed=function(){return!1};zh.prototype.destroy=function(){return X_t(this),ue(this)};zh.mouseEmulationIgnoreMilliseconds=800;zh.touchHoldDelayMilliseconds=1500;var of=zh;function iC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}iC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};iC.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof nn,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?Mgt(this,e):Ugt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var tgt=new h,ngt=new h,igt=new h,ogt=new h,rgt=new h,sgt=new h,agt=new h,cgt=new fe,lgt=new F,ugt=new Ii,fgt=new nn,dgt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};iC.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(F.IDENTITY);let i=tgt,o=ngt,r=igt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,o),o),h.cross(h.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(u.positionWC,i),h.clone(u.directionWC,o),h.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,agt),d=Ot.eastNorthUpToFixedFrame(f,t,lgt);F.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,cgt),i),F.multiplyByPointAsVector(d,o,o),F.multiplyByPointAsVector(d,r,r)}}let s;this._morphToOrthographic?(s=fgt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=ugt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=dgt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Hgt(a);EB(this,c),this._previousMode===ne.SCENE2D?zgt(this,e,a,c):(a.position2D=F.multiplyByPoint(so.TRANSFORM_2D,i,ogt),a.direction2D=F.multiplyByPointAsVector(so.TRANSFORM_2D,o,rgt),a.up2D=F.multiplyByPointAsVector(so.TRANSFORM_2D,r,sgt),n._mode=ne.MORPHING,ETe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var HK={position:new h,direction:new h,up:new h,frustum:void 0},pTe=new Ii;iC.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ne.SCENE2D)Agt(this,e,t);else{let i;e>0?(i=HK,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=_Te(this,t);let o,r=n.camera;r.frustum instanceof nn?o=r.frustum.clone():(o=pTe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=P.toRadians(60)),i.frustum=o;let s=vTe(i);EB(this,s),zK(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};iC.prototype.isDestroyed=function(){return!1};iC.prototype.destroy=function(){return $8(this),ue(this)};function EB(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new of(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,bn.LEFT_DOWN),e._morphHandler.setInputAction(n,bn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,bn.RIGHT_DOWN),e._morphHandler.setInputAction(n,bn.WHEEL)}}function $8(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var hgt=new fe,mgt=new h,pgt=new F;function _Te(e,t){let n=e._scene,i=n.camera,o=HK,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,hgt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,mgt),f=Ot.eastNorthUpToFixedFrame(u,t,pgt);return F.multiplyByPointAsVector(f,i.direction,s),F.multiplyByPointAsVector(f,i.up,a),o}var _gt=new h,ggt=new h,ygt=new h,xgt=new h,bgt=new h,Tgt=new h;function zK(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,_gt),a=h.clone(r.direction,ggt),c=h.clone(r.up,ygt),u=F.multiplyByPoint(so.TRANSFORM_2D_INVERSE,n.position,xgt),f=F.multiplyByPointAsVector(so.TRANSFORM_2D_INVERSE,n.direction,bgt),d=F.multiplyByPointAsVector(so.TRANSFORM_2D_INVERSE,n.up,Tgt);function p(m){xd(s,u,m.time,r.position),xd(a,f,m.time,r.direction),xd(c,d,m.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){STe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var Cgt=new nn,gTe=new h,yTe=new h,xTe=new h,GK=new h,bTe=new h,TTe=new h;function Agt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=HK,h.fromDegrees(0,0,5*n.maximumRadius,n,r.position),h.negate(r.position,r.direction),h.normalize(r.direction,r.direction),h.clone(h.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=_Te(e,n));let s;e._morphToOrthographic?(s=Cgt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=pTe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),r.frustum=s;let a=vTe(r);EB(e,a);let c;e._morphToOrthographic?c=function(){zK(e,t,r,a)}:c=function(){ATe(e,t,r,function(){zK(e,t,r,a)})},t>0?(i._mode=ne.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,GK),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function xd(e,t,n,i){return h.lerp(e,t,n,i)}function CTe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof nn)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=r.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(d)}var Egt=new h,Sgt=new h,vgt=new h,UK=new h,wgt=new h,Dgt=new h,Igt=new Fr,Pgt=new hn,Rgt=new h,Ogt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function Mgt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,Egt),r=h.clone(i.direction,Sgt),s=h.clone(i.up,vgt),a=h.negate(h.UNIT_Z,wgt),c=h.clone(h.UNIT_Y,Dgt),u=UK;if(t>0)h.clone(h.ZERO,UK),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,UK);let b=Pgt;F.multiplyByPoint(so.TRANSFORM_2D,o,b.origin),F.multiplyByPointAsVector(so.TRANSFORM_2D,r,b.direction);let T=n.globe;if(l(T)){let C=T.pickWorldCoordinates(b,n,!0,Rgt);l(C)&&(F.multiplyByPoint(so.TRANSFORM_2D_INVERSE,C,u),u.z+=h.distance(o,u))}}let f=Igt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=Ogt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=wTe(d);EB(e,p);function g(b){xd(o,u,b.time,i.position),xd(r,a,b.time,i.direction),xd(s,c,b.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(b,T){b.position.z=T}let x=n.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){CTe(e,t,d,m,p)}});e._currentTweens.push(x)}var mTe=new fe,Lgt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Fr},Ngt={position:new h,direction:new h,up:new h,frustum:void 0},Fgt=new h,Bgt=new hn,kgt=new F,Vgt=new h;function Ugt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Lgt;if(t>0)h.clone(h.ZERO,r.position),r.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,mTe),i.mapProjection.project(mTe,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let d=Bgt;h.clone(r.position2D,d.origin);let p=h.clone(o.directionWC,d.direction),g=n.scaleToGeodeticSurface(o.positionWC,Vgt),m=Ot.eastNorthUpToFixedFrame(g,n,kgt);F.inverseTransformation(m,m),F.multiplyByPointAsVector(m,p,p),F.multiplyByPointAsVector(so.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let b=x.pickWorldCoordinates(d,i,!0,Fgt);if(l(b)){let T=h.distance(r.position2D,b);b.x+=T,h.clone(b,r.position2D)}}}function s(d,p){d.position.x=p}F.multiplyByPoint(so.TRANSFORM_2D,r.position,r.position2D),F.multiplyByPointAsVector(so.TRANSFORM_2D,r.direction,r.direction2D),F.multiplyByPointAsVector(so.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=Ngt;F.multiplyByPoint(so.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let u=wTe(c);EB(e,u);function f(){CTe(e,t,r,s,u)}ETe(e,t,r,f)}function ATe(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=P.lerp(c,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let d=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function zgt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,GK),a=h.clone(n.direction,bTe),c=h.clone(n.up,TTe);o._mode=ne.MORPHING;function u(){r.frustum=n.frustum.clone();let f=h.clone(r.position,gTe),d=h.clone(r.direction,yTe),p=h.clone(r.up,xTe);f.z=s.z;function g(x){xd(f,s,x.time,r.position),xd(d,a,x.time,r.direction),xd(p,c,x.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():ATe(e,0,n,u)}function ETe(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,gTe),a=h.clone(r.direction,yTe),c=h.clone(r.up,xTe),u=h.clone(n.position2D,GK),f=h.clone(n.direction2D,bTe),d=h.clone(n.up2D,TTe);function p(m){xd(s,u,m.time,r.position),xd(a,f,m.time,r.direction),xd(c,d,m.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){STe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function STe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Kr.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function vTe(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),$8(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE3D,r)}}function wTe(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),$8(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE2D,o)}}function Hgt(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),$8(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.COLUMBUS_VIEW,r)}}var SB=iC;var Ggt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},ki=Object.freeze(Ggt);function oa(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function Wgt(e,t){z.clone(e.distance.startPosition,t.distance.startPosition),z.clone(e.distance.endPosition,t.distance.endPosition),z.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),z.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function DTe(e,t,n){let i=oa(ki.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new z;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new z,endPosition:new z},u.angleAndHeight={startPosition:new z,endPosition:new z},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,z.lerp(f.position1,f.position2,.5,s[i])},bn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},bn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(Wgt(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(z.clone(f.distance.endPosition,u.distance.endPosition),z.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},bn.PINCH_MOVE,t)}function ITe(e,t){let n=oa(ki.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new z,endPosition:new z,valid:!1}),s.startPosition=new z,z.clone(z.ZERO,s.startPosition),s.endPosition=new z,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,z.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},bn.WHEEL,t)}function pv(e,t,n){let i=oa(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new z;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new z,endPosition:new z,valid:!1});let c,u;n===ki.LEFT_DRAG?(c=bn.LEFT_DOWN,u=bn.LEFT_UP):n===ki.RIGHT_DRAG?(c=bn.RIGHT_DOWN,u=bn.RIGHT_UP):n===ki.MIDDLE_DRAG&&(c=bn.MIDDLE_DOWN,u=bn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,z.clone(f.position,r[i])},c,t),e._eventHandler.setInputAction(function(){WK(oa(n,void 0),e);for(let f of Object.values(ia)){let d=oa(n,f);WK(d,e)}},u,t)}function WK(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function PTe(e,t){z.clone(e.startPosition,t.startPosition),z.clone(e.endPosition,t.endPosition)}function jgt(e,t,n){let i=n._isDown,o=!1,r=oa(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==r&&(o=!0,WK(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new z,endPosition:new z,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function RTe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in ki)if(ki.hasOwnProperty(s)){let a=ki[s];if(l(a)){let c=oa(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new z,endPosition:new z,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new z,endPosition:new z})}}e._eventHandler.setInputAction(function(s){for(let a in ki)if(ki.hasOwnProperty(a)){let c=ki[a];if(l(c)){let u=oa(c,t);jgt(c,t,e),r[u]&&(n[u]?(PTe(i[u],o[u]),o[u].valid=!0,PTe(s,i[u]),n[u]=!1):z.clone(s.endPosition,i[u].endPosition))}}z.clone(s.endPosition,e._currentMousePosition)},bn.MOUSE_MOVE,t)}function bd(e){this._eventHandler=new of(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new z,ITe(this,void 0),DTe(this,void 0,e),pv(this,void 0,ki.LEFT_DRAG),pv(this,void 0,ki.RIGHT_DRAG),pv(this,void 0,ki.MIDDLE_DRAG),RTe(this,void 0);for(let t in ia)if(ia.hasOwnProperty(t)){let n=ia[t];l(n)&&(ITe(this,n),DTe(this,n,e),pv(this,n,ki.LEFT_DRAG),pv(this,n,ki.RIGHT_DRAG),pv(this,n,ki.MIDDLE_DRAG),RTe(this,n))}}Object.defineProperties(bd.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[oa(ki.WHEEL)]||!this._update[oa(ki.WHEEL,ia.SHIFT)]||!this._update[oa(ki.WHEEL,ia.CTRL)]||!this._update[oa(ki.WHEEL,ia.ALT)];return this._buttonsDown>0||e}}});bd.prototype.isMoving=function(e,t){let n=oa(e,t);return!this._update[n]};bd.prototype.getMovement=function(e,t){let n=oa(e,t);return this._movement[n]};bd.prototype.getLastMovement=function(e,t){let n=oa(e,t),i=this._lastMovement[n];if(i.valid)return i};bd.prototype.isButtonDown=function(e,t){let n=oa(e,t);return this._isDown[n]};bd.prototype.getStartMousePosition=function(e,t){if(e===ki.WHEEL)return this._currentMousePosition;let n=oa(e,t);return this._eventStartPosition[n]};bd.prototype.getButtonPressTime=function(e,t){let n=oa(e,t);return this._pressTime[n]};bd.prototype.getButtonReleaseTime=function(e,t){let n=oa(e,t);return this._releaseTime[n]};bd.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};bd.prototype.isDestroyed=function(){return!1};bd.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var vB=bd;function Q8(e,t,n,i,o,r,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ge(n),this._stopObject=Ge(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(Q8.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});Q8.prototype.cancelTween=function(){this._tweens.remove(this)};function Hh(){this._tweens=[]}Object.defineProperties(Hh.prototype,{length:{get:function(){return this._tweens.length}}});Hh.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new Q8(this);let t=e.duration/qn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/qn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,Kr.LINEAR_NONE),r=e.startObject,s=new _ye(r);s.to(Ge(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new Q8(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Hh.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Hh.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Hh.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Hh.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Hh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Hh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Hh.prototype.get=function(e){return this._tweens[e]};Hh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/qn.SECONDS_PER_MILLISECOND:Ti();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var oC=Hh;function DB(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=ki.LEFT_DRAG,this.zoomEventTypes=[ki.RIGHT_DRAG,ki.WHEEL,ki.PINCH],this.rotateEventTypes=ki.LEFT_DRAG,this.tiltEventTypes=[ki.MIDDLE_DRAG,ki.PINCH,{eventType:ki.LEFT_DRAG,modifier:ia.CTRL},{eventType:ki.RIGHT_DRAG,modifier:ia.CTRL}],this.lookEventTypes={eventType:ki.LEFT_DRAG,modifier:ia.SHIFT};let t=y(e.ellipsoid,ee.default);this.minimumPickingTerrainHeight=ee.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ee.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ee.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ee.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new vB(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new oC,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new z(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new z(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new z,this._strafeEndMousePosition=new z,this._zoomMouseStart=new z(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new z,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new fe(Math.PI,P.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function qgt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Ygt(e){return z.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var Xgt=.4;function Kgt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new z,endPosition:new z,motion:new z,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<Xgt){let g=qgt(p,i),m=e.getLastMovement(t,n);if(!l(m)||Ygt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=z.clone(m.startPosition,a.startPosition),a.endPosition=z.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=z.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||z.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function Zgt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var OTe=[];function bl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(OTe[0]=n,n=OTe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),Zgt(e,r)):o<1&&Kgt(s,f,d,o,i,e,r))}}var J8=new hn,$gt=new h,Qgt=new z,Jgt=new h,eyt=new z,tyt=new h,nyt=new h,iyt=new h,oyt=new h,WTe=new h,ryt=new h,syt=new h,ayt=new h,cyt=new h,lyt=new h,uyt=new h,fyt=new h,dyt=new h,hyt=new h,myt=new h,rC=new h,MTe=new h,LTe=new h,jK={orientation:new Da};function JK(e,t,n,i,o,r){let s=1;l(r)&&(s=P.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=o-u,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let x=e._scene,b=x.camera,T=x.mode,C=jK.orientation;if(C.heading=b.heading,C.pitch=b.pitch,C.roll=b.roll,b.frustum instanceof nn){Math.abs(m)>0&&(b.zoomIn(m),b._adjustOrthographicFrustum(!0));return}let A=y(n.inertiaEnabled,z.equals(t,e._zoomMouseStart)),E=e._zoomingOnVector,v=e._rotatingZoom,D;if(A||(e._zoomMouseStart=z.clone(t,e._zoomMouseStart),l(e._globe)&&T===ne.SCENE2D?(D=b.getPickRay(t,J8).origin,D=h.fromElements(D.y,D.z,D.x)):l(e._globe)&&(D=Tg(e,t,$gt)),l(D)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(D,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,E=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(m);return}let O=T===ne.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!A||v){if(T===ne.SCENE2D){let R=e._zoomWorldPosition,M=b.position;if(!h.equals(R,M)&&b.positionCartographic.height<e._maxCoord.x*2){let N=b.position.x,_=h.subtract(R,M,Jgt);h.normalize(_,_);let S=h.distance(R,M)*m/(b.getMagnitude()*.5);b.move(_,S*.5),(b.position.x<0&&N>0||b.position.x>0&&N<0)&&(D=b.getPickRay(t,J8).origin,D=h.fromElements(D.y,D.z,D.x),e._zoomWorldPosition=h.clone(D,e._zoomWorldPosition))}}else if(T===ne.SCENE3D){let R=h.normalize(b.position,WTe);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(h.dot(b.direction,R))<.6)O=!0;else{let M=x.canvas,N=eyt;N.x=M.clientWidth/2,N.y=M.clientHeight/2;let _=Tg(e,N,tyt);if(!l(_))O=!0;else if(b.positionCartographic.height<1e6)if(h.dot(b.direction,R)>=-.5)O=!0;else{let S=syt;h.clone(b.position,S);let w=e._zoomWorldPosition,I=ryt;if(I=h.normalize(w,I),h.dot(I,R)<0)return;let L=myt,B=lyt;h.clone(b.direction,B),h.add(S,h.multiplyByScalar(B,1e3,rC),L);let U=uyt,V=fyt;h.subtract(w,S,U),h.normalize(U,V);let G=h.dot(R,V);if(G>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-G),W=h.magnitude(S),q=h.magnitude(w),J=W-m,j=h.magnitude(U),K=Math.asin(P.clamp(j/q*Math.sin(k),-1,1)),Q=Math.asin(P.clamp(J/q*Math.sin(k),-1,1)),de=K-Q+k,xe=ayt;h.normalize(S,xe);let ce=cyt;ce=h.cross(V,xe,ce),ce=h.normalize(ce,ce),h.normalize(h.cross(xe,ce,rC),B),h.multiplyByScalar(h.normalize(L,rC),h.magnitude(L)-m,L),h.normalize(S,S),h.multiplyByScalar(S,J,S);let ge=dyt;h.multiplyByScalar(h.add(h.multiplyByScalar(xe,Math.cos(de)-1,MTe),h.multiplyByScalar(B,Math.sin(de),LTe),rC),J,ge),h.add(S,ge,S),h.normalize(L,xe),h.normalize(h.cross(xe,ce,rC),B);let be=hyt;h.multiplyByScalar(h.add(h.multiplyByScalar(xe,Math.cos(de)-1,MTe),h.multiplyByScalar(B,Math.sin(de),LTe),rC),h.magnitude(L),be),h.add(L,be,L),h.clone(S,b.position),h.normalize(h.subtract(L,S,rC),b.direction),h.clone(b.direction,b.direction),h.cross(b.direction,b.up,b.right),h.cross(b.right,b.direction,b.up),b.setView(jK);return}else{let S=h.normalize(_,nyt),w=h.normalize(e._zoomWorldPosition,iyt),I=h.dot(w,S);if(I>0&&I<1){let L=P.acosClamped(I),B=h.cross(w,S,oyt),U=Math.abs(L)>P.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-m,V=m/U;b.rotate(B,L*V)}}}}e._rotatingZoom=!O}if(!A&&O||E){let R,M=Hi.worldToWindowCoordinates(x,e._zoomWorldPosition,Qgt);T!==ne.COLUMBUS_VIEW&&z.equals(t,e._zoomMouseStart)&&l(M)?R=b.getPickRay(M,J8):R=b.getPickRay(t,J8);let N=R.direction;(T===ne.COLUMBUS_VIEW||T===ne.SCENE2D)&&h.fromElements(N.y,N.z,N.x,N),b.move(N,m),e._zoomingOnVector=!0}else b.zoomIn(m);e._cameraUnderground||b.setView(jK)}var pyt=new hn,_yt=new hn,gyt=new h;function yyt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,pyt).origin,s=o.getPickRay(n.endPosition,_yt).origin;r=h.fromElements(r.y,r.z,r.x,r),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(r,s,gyt),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function NTe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;JK(e,t,n,e.zoomFactor,o.getMagnitude())}var xyt=new z,byt=new z;function FTe(e,t,n){if(l(n.angleAndHeight)){Tyt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=xyt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=z.normalize(c,c);let u=byt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=z.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(u.x);u.y<0&&(d=P.TWO_PI-d);let p=d-f;o.twistRight(p)}function Tyt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function Cyt(e){let t=e._scene.mapMode2D===iu.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(bl(e,e.enableTranslate,e.translateEventTypes,yyt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),bl(e,e.enableZoom,e.zoomEventTypes,NTe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&bl(e,e.enableRotate,e.tiltEventTypes,FTe,e.inertiaSpin,"_lastInertiaTiltMovement")):(bl(e,e.enableZoom,e.zoomEventTypes,NTe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&bl(e,e.enableRotate,e.translateEventTypes,FTe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var jTe=new hn,Ayt=new h,Eyt=new h;function Tg(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Ayt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,jTe),u=o.pickWorldCoordinates(c,i,a,Eyt),f=l(s)?h.distance(s,r.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(s,n):h.clone(u,n)}var Syt=new fe;function sG(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,Syt);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var vyt=new h;function qTe(e,t){let n=t.origin,i=t.direction,o=sG(e),r=h.normalize(n,vyt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function YTe(e,t,n,i){let o=h.distance(t.origin,n),r=sG(e),s=P.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),hn.getPoint(t,o,i)}function XTe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=sG(e))):o=sG(e),hn.getPoint(t,o,i)}var wyt=new z;function KTe(e,t){let n=t.endPosition,i=z.subtract(t.endPosition,t.startPosition,wyt),o=e._strafeEndMousePosition;z.add(o,i,o),t.endPosition=o,eZ(e,t,e._strafeStartPosition),t.endPosition=n}var BTe=new hn,Dyt=new hn,qK=new h,Iyt=new h,Pyt=new h,Ryt=new h,Oyt=new rn(h.UNIT_X,0),Myt=new z,Lyt=new z;function Nyt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){sf(e,t,n);return}if(e._strafing){KTe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=z.clone(n.startPosition,Myt),a=z.clone(n.endPosition,Lyt),c=o.getPickRay(s,BTe),u=h.clone(h.ZERO,Ryt),f=h.UNIT_X,d;if(o.position.z<e._minimumPickingTerrainHeight&&(d=Tg(e,s,qK),l(d)&&(u.x=d.x)),r||u.x>o.position.z&&l(d)){let A=d;r&&(A=XTe(e,c,d,qK)),z.clone(t,e._strafeMousePosition),z.clone(t,e._strafeEndMousePosition),h.clone(A,e._strafeStartPosition),e._strafing=!0,eZ(e,n,e._strafeStartPosition);return}let p=rn.fromPointNormal(u,f,Oyt);c=o.getPickRay(s,BTe);let g=$n.rayPlane(c,p,qK),m=o.getPickRay(a,Dyt),x=$n.rayPlane(m,p,Iyt);if(!l(g)||!l(x)){e._looking=!0,sf(e,t,n),z.clone(t,e._translateMousePosition);return}let b=h.subtract(g,x,Pyt),T=b.x;b.x=b.y,b.y=b.z,b.z=T;let C=h.magnitude(b);C>P.EPSILON6&&(h.normalize(b,b),o.move(b,C))}var ZTe=new z,nG=new hn,iG=new h,Fyt=new h,$Te=new F,Byt=new F,kyt=new h,Vyt=new rn(h.UNIT_X,0),YK=new h,ZK=new fe,QTe=new F,Uyt=new Oe,zyt=new $,oG=new h;function Hyt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){sf(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Gyt(e,t,n)):Wyt(e,t,n)}function Gyt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=ZTe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,nG),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,sf(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,iG);h.add(u,g,g);let m=i.mapProjection,x=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let b=m.unproject(g,ZK);x.cartographicToCartesian(b,g);let T=Ot.eastNorthUpToFixedFrame(g,x,$Te),C=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=F.clone(o.transform,QTe);o._setTransform(T),rf(e,t,n,h.UNIT_Z),o._setTransform(E),e._globe=C,e._ellipsoid=A;let v=A.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function Wyt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(z.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,iG);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=Tg(e,t,iG)),!l(s)){a=o.getPickRay(t,nG);let _=a.origin,S=a.direction,w,I=h.dot(c,S);if(Math.abs(I)>P.EPSILON6&&(w=-h.dot(c,_)/I),!l(w)||w<=0){e._looking=!0,sf(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(S,w,iG),h.add(_,s,s)}r&&(l(a)||(a=o.getPickRay(t,nG)),YTe(e,a,s,s)),z.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=ZTe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,nG);let d=h.clone(h.ZERO,kyt);d.x=s.x;let p=rn.fromPointNormal(d,c,Vyt),g=$n.rayPlane(a,p,Fyt),m=o._projection,x=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let b=m.unproject(s,ZK);x.cartographicToCartesian(b,s);let T=Ot.eastNorthUpToFixedFrame(s,x,$Te),C;l(g)?(h.fromElements(g.y,g.z,g.x,g),b=m.unproject(g,ZK),x.cartographicToCartesian(b,g),C=Ot.eastNorthUpToFixedFrame(g,x,Byt)):C=T;let A=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,D=F.clone(o.transform,QTe);o._setTransform(T);let O=h.cross(h.UNIT_Z,h.normalize(o.position,YK),YK),R=h.dot(o.right,O);if(rf(e,t,n,v,!1,!0),o._setTransform(C),R<0){let _=n.startPosition.y-n.endPosition.y;(r&&_<0||!r&&_>0)&&(v=void 0);let S=o.constrainedAxis;o.constrainedAxis=void 0,rf(e,t,n,v,!0,!1),o.constrainedAxis=S}else rf(e,t,n,v,!0,!1);if(l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,oG);h.equalsEpsilon(_,h.ZERO,P.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(D),e._globe=A,e._ellipsoid=E;let M=E.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let N=h.clone(o.positionWC,YK);if(e.enableCollisionDetection&&iZ(e,!0),!h.equals(o.positionWC,N)){o._setTransform(C),o.worldToCameraCoordinatesPoint(N,N);let _=h.magnitudeSquared(N);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let S=h.angleBetween(N,o.position),w=h.cross(N,o.position,N);h.normalize(w,w);let I=Oe.fromAxisAngle(w,S,Uyt),L=$.fromQuaternion(I,zyt);$.multiplyByVector(L,o.direction,o.direction),$.multiplyByVector(L,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(D)}}var JTe=new z,eCe=new hn,tCe=new h;function jyt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=JTe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,eCe),u=c.origin,f=c.direction,d=o.position.z,p;d<e._minimumPickingTerrainHeight&&(p=Tg(e,a,tCe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=qTe(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}JK(e,t,n,e.zoomFactor,g)}function qyt(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))bl(e,e.enableRotate,e.rotateEventTypes,rf,e.inertiaSpin,"_lastInertiaSpinMovement"),bl(e,e.enableZoom,e.zoomEventTypes,iCe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),bl(e,e.enableTilt,e.tiltEventTypes,Hyt,e.inertiaSpin,"_lastInertiaTiltMovement"),bl(e,e.enableTranslate,e.translateEventTypes,Nyt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),bl(e,e.enableZoom,e.zoomEventTypes,jyt,e.inertiaZoom,"_lastInertiaZoomMovement"),bl(e,e.enableLook,e.lookEventTypes,sf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var Yyt=new hn,Xyt=new rn(h.UNIT_X,0),Kyt=new h,Zyt=new h;function eZ(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Yyt),s=h.clone(o.direction,Zyt);i.mode===ne.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=rn.fromPointNormal(n,s,Xyt),c=$n.rayPlane(r,a,Kyt);l(c)&&(s=h.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var kTe=new h,nCe=new fe,$K=new h,QK=new ee,$yt=new h,Qyt=new h,Jyt=new h;function e0t(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(o.transform,F.IDENTITY)){rf(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(o.position,$yt);if(z.equals(t,e._rotateMousePosition)){if(e._looking)sf(e,t,n,u);else if(e._rotating)rf(e,t,n);else if(e._strafing)KTe(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=$K,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,QK),KK(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,nCe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=Tg(e,n.startPosition,Jyt);if(l(p)){let g=!1,m=o.getPickRay(n.startPosition,jTe);if(r)g=!0,XTe(e,m,p,p);else{let x=s.geodeticSurfaceNormal(p,Qyt);Math.abs(h.dot(m.direction,x))<.05?g=!0:g=h.magnitude(o.position)<h.magnitude(p)}g?(z.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,eZ(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=$K,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,QK),KK(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,sf(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,kTe))?(KK(e,t,n,e._ellipsoid),h.clone(kTe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,rf(e,t,n)):(e._looking=!0,sf(e,t,n,u));z.clone(t,e._rotateMousePosition)}function rf(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=d*p*Math.PI*2,x=d*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let b=e.maximumTiltAngle,T=h.dot(a.direction,i),C=Math.PI-Math.acos(T)+x;C>b&&(x-=C-b)}o||a.rotateRight(m),r||a.rotateUp(x),a.constrainedAxis=u}var XK=oe.clone(oe.UNIT_W),VTe=oe.clone(oe.UNIT_W),eG=new h,_v=new h,tG=new h,UTe=new h,t0t=new z,n0t=new z,i0t=new z,o0t=new z,r0t=new hn;function KK(e,t,n,i){let o=e._scene,r=o.camera,s=z.clone(n.startPosition,t0t),a=z.clone(n.endPosition,n0t),c=i.cartesianToCartographic(r.positionWC,nCe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,XK),!l(e._globe)&&!z.equalsEpsilon(s,e._panLastMousePosition)&&(u=Tg(e,s,XK)),!l(e._globe)&&l(u))){let d=h.subtract(u,r.positionWC,_v),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,d),_v),g=h.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,o0t),x=z.subtract(a,s,i0t),b=h.multiplyByScalar(r.rightWC,x.x*m.x,_v),T=h.normalize(r.positionWC,WTe),C=r.getPickRay(a,r0t).direction,A=h.subtract(C,h.projectVector(C,r.rightWC,tG),tG),E=h.angleBetween(A,r.directionWC),v=1;l(r.frustum.fov)&&(v=Math.max(Math.tan(E),.1));let D=Math.abs(h.dot(r.directionWC,T)),O=-x.y*m.y*2/Math.sqrt(v)*(1-D),R=h.multiplyByScalar(C,O,tG);D=Math.abs(h.dot(r.upWC,T));let M=h.multiplyByScalar(r.upWC,-x.y*(1-D)*m.y,UTe);f=h.add(u,b,VTe),f=h.add(f,R,f),f=h.add(f,M,f),h.clone(f,e._panLastWorldPosition),z.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(s,i,XK),f=r.pickEllipsoid(a,i,VTe)),!l(u)||!l(f)){e._rotating=!0,rf(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let d=r.constrainedAxis,p=h.mostOrthogonalAxis(d,eG);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,_v),m=h.magnitude(u),x=h.dot(d,u),b=Math.acos(x/m),T=h.multiplyByScalar(d,x,tG);h.subtract(u,T,T),h.normalize(T,T);let C=h.magnitude(f),A=h.dot(d,f),E=Math.acos(A/C),v=h.multiplyByScalar(d,A,UTe);h.subtract(f,v,v),h.normalize(v,v);let D=Math.acos(h.dot(T,p));h.dot(T,g)<0&&(D=P.TWO_PI-D);let O=Math.acos(h.dot(v,p));h.dot(v,g)<0&&(O=P.TWO_PI-O);let R=D-O,M;h.equalsEpsilon(d,r.position,P.EPSILON2)?M=r.right:M=h.cross(d,r.position,eG);let N=h.cross(d,M,eG),_=h.dot(N,h.subtract(u,d,_v)),S=h.dot(N,h.subtract(f,d,_v)),w;_>0&&S>0?w=E-b:_>0&&S<=0?h.dot(r.position,d)>0?w=-b-E:w=b+E:w=b-E,r.rotateRight(R),r.rotateUp(w)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,eG);if(d<1&&!h.equalsEpsilon(p,h.ZERO,P.EPSILON14)){let g=Math.acos(d);r.rotate(p,g)}}}var s0t=new h,a0t=new fe,zTe=0;function iCe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=JTe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,eCe),d,p=o.cartesianToCartographic(s.position,a0t).height,g=Math.abs(zTe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=Tg(e,u,tCe));let x;if(l(d)&&(x=h.distance(f.origin,d),zTe=x),c){let T=qTe(e,f,p);l(x)?x=Math.min(x,T):x=T}l(x)||(x=p);let b=h.normalize(s.position,s0t);JK(e,t,n,e.zoomFactor,x,h.dot(b,s.direction))}var oCe=new z,rG=new hn,wB=new h,c0t=new h,rCe=new F,l0t=new F,sCe=new F,u0t=new Oe,f0t=new $,tZ=new fe,nZ=new h;function d0t(e,t,n){let o=e._scene.camera;if(!F.equals(o.transform,F.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,nZ);sf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,tZ);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,m0t(e,t,n)):p0t(e,t,n)}var h0t=new fe;function m0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,h0t).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=oCe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,rG),d,p=$n.rayEllipsoid(f,i);if(l(p))d=hn.getPoint(f,p.start,wB);else if(a>e._minimumTrackBallHeight){let C=$n.grazingAltitudeLocation(f,i);if(!l(C))return;let A=i.cartesianToCartographic(C,tZ);A.height=0,d=i.cartographicToCartesian(A,wB)}else{e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(r.position,nZ);sf(e,t,n,C),z.clone(t,e._tiltCenterMousePosition);return}let g=Ot.eastNorthUpToFixedFrame(d,i,rCe),m=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=F.clone(r.transform,sCe);r._setTransform(g),rf(e,t,n,h.UNIT_Z),r._setTransform(b),e._globe=m,e._ellipsoid=x;let T=x.maximumRadius;e._rotateFactor=1/T,e._rotateRateRangeAdjustment=T}function p0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,u;if(z.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,wB);else{if(a=Tg(e,t,wB),!l(a)){if(c=r.getPickRay(t,rG),u=$n.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,tZ).height<=e._minimumTrackBallHeight){e._looking=!0;let S=e._ellipsoid.geodeticSurfaceNormal(r.position,nZ);sf(e,t,n,S),z.clone(t,e._tiltCenterMousePosition)}return}a=hn.getPoint(c,u.start,wB)}s&&(l(c)||(c=r.getPickRay(t,rG)),YTe(e,c,a,a)),z.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=o.canvas,d=oCe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=r.getPickRay(d,rG);let p=h.magnitude(a),g=h.fromElements(p,p,p,$K),m=ee.fromCartesian3(g,QK);if(u=$n.rayEllipsoid(c,m),!l(u))return;let x=h.magnitude(c.origin)>p?u.start:u.stop,b=hn.getPoint(c,x,c0t),T=Ot.eastNorthUpToFixedFrame(a,i,rCe),C=Ot.eastNorthUpToFixedFrame(b,m,l0t),A=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,D=F.clone(r.transform,sCe);r._setTransform(C);let O=h.cross(b,r.positionWC,oG);if(h.dot(r.rightWC,O)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let S=r.constrainedAxis;r.constrainedAxis=void 0,rf(e,t,n,v,!0,!1),r.constrainedAxis=S}else rf(e,t,n,v,!0,!1);if(r._setTransform(T),rf(e,t,n,v,!1,!0),l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,oG);h.equalsEpsilon(_,h.ZERO,P.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(D),e._globe=A,e._ellipsoid=E;let M=E.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let N=h.clone(r.positionWC,oG);if(e.enableCollisionDetection&&iZ(e,!0),!h.equals(r.positionWC,N)){r._setTransform(C),r.worldToCameraCoordinatesPoint(N,N);let _=h.magnitudeSquared(N);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let S=h.angleBetween(N,r.position),w=h.cross(N,r.position,N);h.normalize(w,w);let I=Oe.fromAxisAngle(w,S,u0t),L=$.fromQuaternion(I,f0t);$.multiplyByVector(L,r.direction,r.direction),$.multiplyByVector(L,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(D)}}var _0t=new z,g0t=new z,HTe=new hn,GTe=new hn,y0t=new h,x0t=new h;function sf(e,t,n,i){let r=e._scene.camera,s=_0t;s.x=n.startPosition.x,s.y=0;let a=g0t;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,HTe),u=r.getPickRay(a,GTe),f=0,d,p;r.frustum instanceof nn?(d=c.origin,p=u.origin,h.add(r.direction,d,d),h.add(r.direction,p,p),h.subtract(d,r.position,d),h.subtract(p,r.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(m)?r.look(m,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,HTe),u=r.getPickRay(a,GTe),f=0,r.frustum instanceof nn?(d=c.origin,p=u.origin,h.add(r.direction,d,d),h.add(r.direction,p,p),h.subtract(d,r.position,d),h.subtract(p,r.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,m),l(i)){let x=r.direction,b=h.negate(i,y0t),T=h.equalsEpsilon(x,i,P.EPSILON2),C=h.equalsEpsilon(x,b,P.EPSILON2);if(!T&&!C){g=h.dot(x,i);let A=P.acosClamped(g);f>0&&f>A&&(f=A-P.EPSILON4),g=h.dot(x,b),A=P.acosClamped(g),f<0&&-f>A&&(f=-A+P.EPSILON4);let E=h.cross(i,x,x0t);r.look(E,f)}else(T&&f<0||C&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function b0t(e){bl(e,e.enableRotate,e.rotateEventTypes,e0t,e.inertiaSpin,"_lastInertiaSpinMovement"),bl(e,e.enableZoom,e.zoomEventTypes,iCe,e.inertiaZoom,"_lastInertiaZoomMovement"),bl(e,e.enableTilt,e.tiltEventTypes,d0t,e.inertiaSpin,"_lastInertiaTiltMovement"),bl(e,e.enableLook,e.lookEventTypes,sf)}var T0t=new F,C0t=new fe;function iZ(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===ne.SCENE2D||i===ne.MORPHING)return;let o=n.camera,r=y(n.ellipsoid,ee.WGS84),s=n.mapProjection,a,c;F.equals(o.transform,F.IDENTITY)||(a=F.clone(o.transform,T0t),c=h.magnitude(o.position),o._setTransform(F.IDENTITY));let u=C0t;i===ne.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,g=d-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===ne.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=g*.1}}l(a)&&(o._setTransform(a),f&&(h.normalize(o.position,o.position),h.negate(o.position,o.direction),h.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),h.normalize(o.direction,o.direction),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up)))}DB.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var A0t=new h,E0t=new h;DB.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=y(e.ellipsoid,ee.default)):(this._globe=void 0,this._ellipsoid=ee.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Er.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Er.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Er.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,A0t),c=h.clone(t.directionWC,E0t);if(i===ne.SCENE2D?Cyt(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,qyt(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,b0t(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);iZ(this,u)}this._aggregator.reset()};DB.prototype.isDestroyed=function(){return!1};DB.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var IB=DB;var PB=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; @@ -13843,7 +13125,7 @@ void main() float t = smoothstep(0.5, 0.8, x); out_FragColor = mix(color0 + color1, color1, t); } -`;var GB=`uniform sampler2D colorTexture; +`;var RB=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; @@ -13873,7 +13155,7 @@ void main() xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function Ag(){this._sceneFramebuffer=new YT;let e=.125,t=new Array(6);t[0]=new ho({fragmentShader:ou,textureScale:e,forcePowerOfTwo:!0,sampleMode:ef.LINEAR});let n=t[1]=new ho({fragmentShader:GB,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new z,t[2]=new ho({fragmentShader:F0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new ho({fragmentShader:F0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new ho({fragmentShader:ou,sampleMode:ef.LINEAR}),this._uCenter=new z,this._uRadius=void 0,t[5]=new ho({fragmentShader:HB,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new ru({stages:t});let o=new eC(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}Ag.prototype.get=function(e){return this._stages.get(e)};Ag.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var b0t=new oe,rCe=new z,T0t=new z,sCe=new F;function C0t(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=F.computeViewportTransformation(n,0,1,sCe),u=F.multiplyByPoint(r,o,b0t),f=Mt.pointToGLWindowCoordinates(s,c,o,rCe);u.x+=P.SOLAR_RADIUS;let d=Mt.pointToGLWindowCoordinates(a,c,u,u),p=z.magnitude(z.subtract(d,f,d))*30*2,g=T0t;g.x=p,g.y=p,e._uCenter=z.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,x=t.drawingBufferHeight,b=e._stages,T=b.get(0),C=T.outputTexture.width,A=T.outputTexture.height,E=new je;E.width=C,E.height=A,c=F.computeViewportTransformation(E,0,1,sCe),f=Mt.pointToGLWindowCoordinates(s,c,o,rCe),g.x*=C/m,g.y*=A/x;let v=T.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,x);for(let D=1;D<4;++D)je.clone(v,b.get(D).scissorRectangle)}Ag.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Ag.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),C0t(this,t,n),o};Ag.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};Ag.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(ou,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Ag.prototype.isDestroyed=function(){return!1};Ag.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var WB=Ag;function aCe(){this._cachedShowFrustumsShaders={}}function A0t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function E0t(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=Ue.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`;function Cg(){this._sceneFramebuffer=new YT;let e=.125,t=new Array(6);t[0]=new mo({fragmentShader:ou,textureScale:e,forcePowerOfTwo:!0,sampleMode:ef.LINEAR});let n=t[1]=new mo({fragmentShader:RB,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new z,t[2]=new mo({fragmentShader:O0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new mo({fragmentShader:O0,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new mo({fragmentShader:ou,sampleMode:ef.LINEAR}),this._uCenter=new z,this._uRadius=void 0,t[5]=new mo({fragmentShader:PB,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new ru({stages:t});let o=new eC(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}Cg.prototype.get=function(e){return this._stages.get(e)};Cg.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var S0t=new oe,aCe=new z,v0t=new z,cCe=new F;function w0t(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=F.computeViewportTransformation(n,0,1,cCe),u=F.multiplyByPoint(r,o,S0t),f=Ot.pointToGLWindowCoordinates(s,c,o,aCe);u.x+=P.SOLAR_RADIUS;let d=Ot.pointToGLWindowCoordinates(a,c,u,u),p=z.magnitude(z.subtract(d,f,d))*30*2,g=v0t;g.x=p,g.y=p,e._uCenter=z.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,x=t.drawingBufferHeight,b=e._stages,T=b.get(0),C=T.outputTexture.width,A=T.outputTexture.height,E=new je;E.width=C,E.height=A,c=F.computeViewportTransformation(E,0,1,cCe),f=Ot.pointToGLWindowCoordinates(s,c,o,aCe),g.x*=C/m,g.y*=A/x;let v=T.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,x);for(let D=1;D<4;++D)je.clone(v,b.get(D).scissorRectangle)}Cg.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Cg.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),w0t(this,t,n),o};Cg.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};Cg.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(ou,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Cg.prototype.isDestroyed=function(){return!1};Cg.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var OB=Cg;function lCe(){this._cachedShowFrustumsShaders={}}function D0t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function I0t(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=Ue.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; `,a+=`uniform vec3 debugShowFrustumsColor; `,a+=`void main() { @@ -13882,7 +13164,7 @@ void main() `,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor; `;else a+=` out_FragColor.rgb *= debugShowCommandsColor; `,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",o.sources.push(a);let u=A0t(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var jB=new H;function S0t(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=H.fromRandom()),t._debugColor):H.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(jB.red=t.debugOverlappingFrustums&1?1:0,jB.green=t.debugOverlappingFrustums&2?1:0,jB.blue=t.debugOverlappingFrustums&4?1:0,jB.alpha=1,jB):H.WHITE}),n}var v0t=new Ze;aCe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=E0t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=Ze.shallowClone(t,v0t);r.shaderProgram=o,r.uniformMap=S0t(e,t),r.execute(e.context,n)};var qB=aCe;function sC(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new vn}sC.fromKeyframeNode=function(e,t,n,i){let o=new sC(e,t,n),{spatialNode:r,metadata:s}=i;return o._metadata=w0t(e,s,n),o._orientedBoundingBox=I0t(e,r,n,o._orientedBoundingBox),o};function w0t(e,t,n){if(!l(t))return;let{names:i,types:o}=e.provider,r={};for(let s=0;s<i.length;s++){let a=i[s],c=lt.getComponentCount(o[s]),u=t[s].slice(n*c,(n+1)*c);r[a]=u}return r}var cCe=new h,D0t=new h;function I0t(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),u=a-c*o.x,f=h.fromElements(u,c,s,cCe),d=h.divideComponents(h.subtract(f,e._paddingBefore,cCe),e.dimensions,D0t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(sC.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});sC.prototype.hasProperty=function(e){return l(this._metadata[e])};sC.prototype.getNames=function(){return Object.keys(this._metadata)};sC.prototype.getProperty=function(e){return this._metadata[e]};var YB=sC;var XB=`struct Ray { +`;a+="}",o.sources.push(a);let u=D0t(i);return $t.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var MB=new H;function P0t(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=H.fromRandom()),t._debugColor):H.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(MB.red=t.debugOverlappingFrustums&1?1:0,MB.green=t.debugOverlappingFrustums&2?1:0,MB.blue=t.debugOverlappingFrustums&4?1:0,MB.alpha=1,MB):H.WHITE}),n}var R0t=new Ze;lCe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=I0t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=Ze.shallowClone(t,R0t);r.shaderProgram=o,r.uniformMap=P0t(e,t),r.execute(e.context,n)};var LB=lCe;function sC(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new vn}sC.fromKeyframeNode=function(e,t,n,i){let o=new sC(e,t,n),{spatialNode:r,metadata:s}=i;return o._metadata=O0t(e,s,n),o._orientedBoundingBox=L0t(e,r,n,o._orientedBoundingBox),o};function O0t(e,t,n){if(!l(t))return;let{names:i,types:o}=e.provider,r={};for(let s=0;s<i.length;s++){let a=i[s],c=ct.getComponentCount(o[s]),u=t[s].slice(n*c,(n+1)*c);r[a]=u}return r}var uCe=new h,M0t=new h;function L0t(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),u=a-c*o.x,f=h.fromElements(u,c,s,uCe),d=h.divideComponents(h.subtract(f,e._paddingBefore,uCe),e.dimensions,M0t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(sC.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});sC.prototype.hasProperty=function(e){return l(this._metadata[e])};sC.prototype.getNames=function(){return Object.keys(this._metadata)};sC.prototype.getProperty=function(e){return this._metadata[e]};var NB=sC;var FB=`struct Ray { vec3 pos; vec3 dir; vec3 rawDir; @@ -13913,7 +13195,7 @@ struct PointJacobianT { vec3 point; mat3 jacobianT; }; -`;var KB=`// See Intersection.glsl for the definition of intersectScene +`;var BB=`// See Intersection.glsl for the definition of intersectScene // See IntersectionUtils.glsl for the definition of nextIntersection // See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl // for the definition of convertUvToShapeUvSpace. The appropriate function is @@ -14171,7 +13453,7 @@ void main() out_FragColor = colorAccum; #endif } -`;var ZB=`in vec2 position; +`;var kB=`in vec2 position; uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; @@ -14182,7 +13464,7 @@ void main() { vec2 scale = 0.5 * (aabbMax - aabbMin); gl_Position = vec4(position * scale + translation, 0.0, 1.0); } -`;var $B=`/* Intersection defines +`;var VB=`/* Intersection defines #define INTERSECTION_COUNT ### */ @@ -14348,7 +13630,7 @@ RayShapeIntersection nextIntersection(inout Intersections ix) { #endif // NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1 -`;var QB=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, +`;var UB=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, // setIntersectionPair, INF_HIT, NO_HIT /* intersectDepth defines (set in Scene/VoxelRenderResources.js) @@ -14371,7 +13653,7 @@ void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); } } -`;var JB=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, +`;var zB=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, // NO_HIT, setShapeIntersection /* Clipping plane defines (set in Scene/VoxelRenderResources.js) @@ -14449,7 +13731,7 @@ void intersectClippingPlanes(in Ray ray, inout Intersections ix) { setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); #endif } -`;var yv=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, +`;var gv=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, // RayShapeIntersection vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) { @@ -14551,7 +13833,7 @@ RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) return RayShapeIntersection(miss, miss); } } -`;var e3=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection, +`;var HB=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection, // NO_HIT, Intersections /* Box defines (set in Scene/VoxelBoxShape.js) @@ -14598,7 +13880,7 @@ void intersectShape(in Ray ray, inout Intersections ix) RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds); setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } -`;var t3=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections, +`;var GB=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections, // RayShapeIntersection, setSurfaceIntersection, setShapeIntersection, // intersectIntersections // See IntersectLongitude.glsl for the definitions of intersectHalfPlane, @@ -14744,7 +14026,7 @@ void intersectShape(Ray ray, inout Intersections ix) setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]); #endif } -`;var n3=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections, +`;var WB=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections, // RayShapeIntersection, setSurfaceIntersection, setShapeIntersection // See IntersectLongitude.glsl for the definitions of intersectHalfPlane, // intersectFlippedWedge, intersectRegularWedge @@ -15134,7 +14416,7 @@ RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Interse return intersection; } -`;var i3=`/* Box defines (set in Scene/VoxelBoxShape.js) +`;var jB=`/* Box defines (set in Scene/VoxelBoxShape.js) #define BOX_HAS_SHAPE_BOUNDS */ @@ -15178,7 +14460,7 @@ vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { #else return shapeUv; #endif -}`;var o3=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) +}`;var qB=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) #define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS #define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE @@ -15277,7 +14559,7 @@ vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { return vec3(radius, height, angle); } -`;var r3=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) +`;var YB=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE @@ -15416,7 +14698,7 @@ vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { return vec3(longitude, latitude, height); } -`;var s3=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js +`;var XB=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js #define OCTREE_FLAG_INTERNAL 0 #define OCTREE_FLAG_LEAF 1 #define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 @@ -15641,7 +14923,7 @@ void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData trave sampleDatas[1].tileUv = getClampedTileUv(shapePosition, sampleDatas[1].tileCoords); #endif } -`;var a3=`// See Octree.glsl for the definitions of SampleData and intMod +`;var KB=`// See Octree.glsl for the definitions of SampleData and intMod /* Megatexture defines (set in Scene/VoxelRenderResources.js) #define SAMPLE_COUNT ### @@ -15776,11 +15058,292 @@ Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_ return properties; #endif } -`;function P0t(e){let t=new Sx;this.shaderBuilder=t;let n=e._customShader,i=bt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,pe.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",pe.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([ZB]),t.addFragmentLines([n.fragmentShaderText,"#line 0",s3,XB,$B,a3]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,pe.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,pe.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,pe.FRAGMENT),t.addFragmentLines([JB])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,pe.FRAGMENT),t.addFragmentLines([QB]));let a=e._provider.shape;a==="BOX"?t.addFragmentLines([i3,e3,aC]):a==="CYLINDER"?t.addFragmentLines([o3,yv,t3,aC]):a==="ELLIPSOID"&&(t.addDefine("SHAPE_ELLIPSOID",void 0,pe.FRAGMENT),t.addFragmentLines([r3,yv,n3,aC])),t.addFragmentLines([KB]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,pe.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,pe.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,pe.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,pe.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,pe.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,pe.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,pe.FRAGMENT);let d=e._traversal;t.addDefine("SAMPLE_COUNT",`${d._sampleCount}`,pe.FRAGMENT)}var c3=P0t;function R0t(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,pe.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,pe.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],N=o[R],_=`PropertyStatistics_${M}`,S=`PropertyStatistics_${M}`;n.addStruct(_,S,pe.FRAGMENT);let w=uG(N);n.addStructField(_,w,"min"),n.addStructField(_,w,"max")}let f="Statistics",d="Statistics",p="statistics";n.addStruct(f,d,pe.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],N=`PropertyStatistics_${M}`,_=M;n.addStructField(f,N,_)}let g="Metadata",m="Metadata",x="metadata";n.addStruct(g,m,pe.FRAGMENT),n.addStructField(g,d,p);for(let R=0;R<c;R++){let M=i[R],N=o[R],_=uG(N);n.addStructField(g,_,M)}for(let R=0;R<c;R++){let M=i[R],N=o[R],_=M0t(N),S=`VoxelProperty_${M}`,w=`VoxelProperty_${M}`;n.addStruct(S,w,pe.FRAGMENT),n.addStructField(S,_,"partialDerivativeLocal"),n.addStructField(S,_,"partialDerivativeWorld"),n.addStructField(S,_,"partialDerivativeView"),n.addStructField(S,_,"partialDerivativeValid")}let b="Voxel",T="Voxel",C="voxel";n.addStruct(b,T,pe.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],N=`VoxelProperty_${M}`;n.addStructField(b,N,M)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance"),n.addStructField(b,"int","stepCount"),n.addStructField(b,"int","tileIndex"),n.addStructField(b,"int","sampleIndex");let A="FragmentInput";n.addStruct(A,"FragmentInput",pe.FRAGMENT),n.addStructField(A,m,x),n.addStructField(A,T,C);let v="Properties",D="Properties",O="properties";n.addStruct(v,D,pe.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],N=o[R],_=uG(N);n.addStructField(v,_,M)}{let R="clearProperties";n.addFunction(R,`${D} clearProperties()`,pe.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let N=i[M],_=o[M],S=r[M],w=uG(_,S);n.addFunctionLines(R,[`${O}.${N} = ${w}(0.0);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="sumProperties";n.addFunction(R,`${D} sumProperties(${D} propertiesA, ${D} propertiesB)`,pe.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let N=i[M];n.addFunctionLines(R,[`${O}.${N} = propertiesA.${N} + propertiesB.${N};`])}n.addFunctionLines(R,[`return ${O};`])}{let R="scaleProperties";n.addFunction(R,`${D} scaleProperties(${D} ${O}, float scale)`,pe.FRAGMENT),n.addFunctionLines(R,[`${D} scaledProperties = ${O};`]);for(let M=0;M<c;M++){let N=i[M];n.addFunctionLines(R,[`scaledProperties.${N} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${D} mixProperties(${D} propertiesA, ${D} propertiesB, float mixFactor)`,pe.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let N=i[M];n.addFunctionLines(R,[`${O}.${N} = mix(propertiesA.${N}, propertiesB.${N}, mixFactor);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${D} ${O}, inout ${m} ${x})`,pe.FRAGMENT);for(let M=0;M<c;M++){let N=i[M];n.addFunctionLines(R,[`${x}.${N} = ${O}.${N};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${d} ${p})`,pe.FRAGMENT);for(let M=0;M<c;M++){let N=i[M],_=o[M],S=lt.getComponentCount(_);for(let w=0;w<S;w++){let I=L0t(_,w),L=s[M][w],B=a[M][w];n.addFunctionLines(R,[`${p}.${N}.min${I} = ${lCe(L)};`,`${p}.${N}.max${I} = ${lCe(B)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${D} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,pe.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let N=i[M],_=o[M],S=r[M],w=O0t(_,S);n.addFunctionLines(R,[`properties.${N} = texture(u_megatextureTextures[${M}], texcoord)${w};`])}n.addFunctionLines(R,[`return ${O};`])}}function uG(e){if(e===lt.SCALAR)return"float";if(e===lt.VEC2)return"vec2";if(e===lt.VEC3)return"vec3";if(e===lt.VEC4)return"vec4"}function O0t(e){if(e===lt.SCALAR)return".r";if(e===lt.VEC2)return".ra";if(e===lt.VEC3)return".rgb";if(e===lt.VEC4)return""}function M0t(e){if(e===lt.SCALAR)return"vec3";if(e===lt.VEC2)return"mat2";if(e===lt.VEC3)return"mat3";if(e===lt.VEC4)return"mat4"}function lCe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function L0t(e,t){return e===lt.SCALAR?"":`[${t}]`}var l3=R0t;function N0t(e,t){let n=new c3(e);l3(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let T="getClippingPlane",C=lg(o,t),A=0,E=C.indexOf(")")+1,v=C.indexOf("{",E)+1,D=C.indexOf("}",v),O=C.slice(A,E),R=C.slice(v,D);i.addFunction(T,O,pe.FRAGMENT),i.addFunctionLines(T,[R])}let s=i.clone();s.addDefine("PICKING",void 0,pe.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,pe.FRAGMENT);let c=i.buildShaderProgram(t),u=s.buildShaderProgram(t),f=a.buildShaderProgram(t),d=Ve.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,m=new Ze({vertexArray:p,primitiveType:Me.TRIANGLES,renderState:d,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:we.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),x=Ze.shallowClone(m,new Ze);x.shaderProgram=u,x.pickOnly=!0;let b=Ze.shallowClone(m,new Ze);if(b.shaderProgram=f,b.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=m,e._drawCommandPick=x,e._drawCommandPickVoxel=b}var u3=N0t;function su(){this.orientedBoundingBox=new vn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=h.clone(su.DefaultMinBounds,new h),this._maxBounds=h.clone(su.DefaultMaxBounds,new h),this.shaderUniforms={renderMinBounds:new h,renderMaxBounds:new h,boxUvToShapeUvScale:new h,boxUvToShapeUvTranslate:new h},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var F0t=new h,iZ=new h,B0t=new $,k0t=new h,V0t=new h,U0t=new h,z0t=new h,uCe=F.fromRotationTranslation($.fromUniformScale(.5,new $),new h(.5,.5,.5),new F);su.prototype.update=function(e,t,n,i,o){i=y(i,su.DefaultMinBounds),o=y(o,su.DefaultMaxBounds);let r=su.DefaultMinBounds,s=su.DefaultMaxBounds;t=this._minBounds=h.clamp(t,r,s,this._minBounds),n=this._maxBounds=h.clamp(n,r,s,this._maxBounds),i=h.clamp(i,r,s,k0t),o=h.clamp(o,r,s,V0t);let a=h.clamp(t,i,o,U0t),c=h.clamp(n,i,o,z0t),u=F.getScale(e,iZ);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||u.x===0||u.y===0||u.z===0)return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=rZ(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:f,shaderDefines:d}=this;for(let m in d)d.hasOwnProperty(m)&&(d[m]=void 0);let p=!h.equals(t,r)||!h.equals(n,s),g=0;if(d.BOX_INTERSECTION_INDEX=g,g+=1,f.renderMinBounds=F.multiplyByPoint(uCe,a,f.renderMinBounds),f.renderMaxBounds=F.multiplyByPoint(uCe,c,f.renderMaxBounds),p){d.BOX_HAS_SHAPE_BOUNDS=!0;let m=t,x=n;f.boxUvToShapeUvScale=h.fromElements(2/(m.x===x.x?1:x.x-m.x),2/(m.y===x.y?1:x.y-m.y),2/(m.z===x.z?1:x.z-m.z),f.boxUvToShapeUvScale),f.boxUvToShapeUvTranslate=h.fromElements(-f.boxUvToShapeUvScale.x*(m.x*.5+.5),-f.boxUvToShapeUvScale.y*(m.y*.5+.5),-f.boxUvToShapeUvScale.z*(m.z*.5+.5),f.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var fG=new h,oZ=new h;su.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(P.lerp(r.x,s.x,a*t),P.lerp(r.y,s.y,a*n),P.lerp(r.z,s.z,a*i),fG),u=h.fromElements(P.lerp(r.x,s.x,a*(t+1)),P.lerp(r.y,s.y,a*(n+1)),P.lerp(r.z,s.z,a*(i+1)),oZ);return rZ(c,u,this.shapeTransform,o)};var fCe=new h;su.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,fCe),s=h.multiplyByScalar(r,o,fCe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,fG),o,fG),c=h.add(a,s,oZ),u=this._minBounds,f=this._maxBounds,d=h.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),fG),p=h.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),oZ);return rZ(d,p,this.shapeTransform,i)};su.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));su.DefaultMaxBounds=Object.freeze(new h(1,1,1));function rZ(e,t,n,i){let o=su.DefaultMinBounds,r=su.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,iZ),c=h.midpoint(e,t,F0t);i.center=F.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),iZ);let u=F.getRotation(n,B0t);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var dp=su;function cs(){this.orientedBoundingBox=new vn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._minimumRadius=cs.DefaultMinBounds.x,this._maximumRadius=cs.DefaultMaxBounds.x,this._minimumHeight=cs.DefaultMinBounds.y,this._maximumHeight=cs.DefaultMaxBounds.y,this._minimumAngle=cs.DefaultMinBounds.z,this._maximumAngle=cs.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderHeightMinMax:new z,cylinderRenderRadiusMinMax:new z,cylinderRenderAngleMinMax:new z,cylinderUvToShapeUvRadius:new z,cylinderUvToShapeUvHeight:new z,cylinderUvToShapeUvAngle:new z,cylinderShapeUvAngleMinMax:new z,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var pCe=new h;cs.prototype.update=function(e,t,n,i,o){i=y(i,cs.DefaultMinBounds),o=y(o,cs.DefaultMaxBounds);let r=cs.DefaultMinBounds.x,s=cs.DefaultMaxBounds.x,a=cs.DefaultMinBounds.y,c=cs.DefaultMaxBounds.y,u=cs.DefaultMinBounds.z,f=cs.DefaultMaxBounds.z,d=f-u,p=.5*d,g=P.EPSILON10,m=P.EPSILON3,x=P.EPSILON10,b=P.clamp(t.x,r,s),T=P.clamp(n.x,r,s),C=P.clamp(i.x,r,s),A=P.clamp(o.x,r,s),E=Math.max(b,C),v=Math.min(T,A),D=P.clamp(t.y,a,c),O=P.clamp(n.y,a,c),R=P.clamp(i.y,a,c),M=P.clamp(o.y,a,c),N=Math.max(D,R),_=Math.min(O,M),S=P.negativePiToPi(t.z),w=P.negativePiToPi(n.z),I=P.negativePiToPi(i.z),L=P.negativePiToPi(o.z),B=Math.max(S,I),U=Math.min(w,L),V=F.getScale(e,pCe);if(v===0||E>v||N>_||P.equalsEpsilon(V.x,0,void 0,g)||P.equalsEpsilon(V.y,0,void 0,g)||P.equalsEpsilon(V.z,0,void 0,g))return!1;this._minimumRadius=b,this._maximumRadius=T,this._minimumHeight=D,this._maximumHeight=O,this._minimumAngle=S,this._maximumAngle=w,this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=aZ(E,v,N,_,B,U,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let W=b===r&&T===s,j=D===a&&O===c,J=w<S,q=w-S+J*d,K=q>p+x&&q<d-x,Q=q<p-x,de=q>=p-x&&q<=p+x,ye=K||Q||de,ce=P.equalsEpsilon(S,u,void 0,m),_e=P.equalsEpsilon(w,f,void 0,m),xe=E===r,De=U<B,Ae=U-B+De*d,ke=Ae>=p-x&&Ae<d-x,ze=Ae>x&&Ae<p-x,tt=Ae<=x,wt=ke||ze||tt,{shaderUniforms:_t,shaderDefines:Be}=this;for(let Et in Be)Be.hasOwnProperty(Et)&&(Be[Et]=void 0);let Yt=0;if(Be.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Yt,Yt+=1,xe||(Be.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Be.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Yt,Yt+=1),_t.cylinderRenderRadiusMinMax=z.fromElements(E,v,_t.cylinderRenderRadiusMinMax),E===v&&(Be.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!W){Be.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Et=T-b,ut=0,tn=1;Et!==0&&(ut=1/Et,tn=-b/Et),_t.cylinderUvToShapeUvRadius=z.fromElements(ut,tn,_t.cylinderUvToShapeUvRadius)}if(!j){Be.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Et=O-D,ut=0,tn=1;Et!==0&&(ut=2/Et,tn=-(D+1)/Et),_t.cylinderUvToShapeUvHeight=z.fromElements(ut,tn,_t.cylinderUvToShapeUvHeight)}if(_t.cylinderRenderHeightMinMax=z.fromElements(N,_,_t.cylinderRenderHeightMinMax),J&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),wt&&(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Be.CYLINDER_INTERSECTION_INDEX_ANGLE=Yt,ke?(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Yt+=1):ze?(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Yt+=2):tt&&(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Yt+=2),_t.cylinderRenderAngleMinMax=z.fromElements(B,U,_t.cylinderRenderAngleMinMax)),ye){Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ce&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),_e&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Et=(S-u)/d,ut=(w-u)/d,tn=1-q/d;if(_t.cylinderShapeUvAngleMinMax=z.fromElements(Et,ut,_t.cylinderShapeUvAngleMinMax),_t.cylinderShapeUvAngleRangeZeroMid=(ut+.5*tn)%1,q<=x)_t.cylinderUvToShapeUvAngle=z.fromElements(0,1,_t.cylinderUvToShapeUvAngle);else{let Ce=d/q,Te=-(S-u)/q;_t.cylinderUvToShapeUvAngle=z.fromElements(Ce,Te,_t.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=Yt,!0};cs.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,u=this._minimumAngle,f=this._maximumAngle,d=1/Math.pow(2,e),p=P.lerp(r,s,t*d),g=P.lerp(r,s,(t+1)*d),m=P.lerp(a,c,n*d),x=P.lerp(a,c,(n+1)*d),b=P.lerp(u,f,i*d),T=P.lerp(u,f,(i+1)*d);return aZ(p,g,m,x,b,T,this.shapeTransform,o)};var dCe=new h,hCe=new h,H0t=new h;cs.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,dCe),s=h.multiplyByScalar(r,o,dCe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,hCe),o,hCe),c=h.add(a,s,H0t),u=this._minimumRadius,f=this._maximumRadius,d=this._minimumHeight,p=this._maximumHeight,g=this._minimumAngle,m=this._maximumAngle,x=P.lerp(u,f,a.x),b=P.lerp(u,f,c.x),T=P.lerp(d,p,a.y),C=P.lerp(d,p,c.y),A=P.lerp(g,m,a.z),E=P.lerp(g,m,c.z);return aZ(x,b,T,C,A,E,this.shapeTransform,i)};cs.DefaultMinBounds=Object.freeze(new h(0,-1,-P.PI));cs.DefaultMaxBounds=Object.freeze(new h(1,1,+P.PI));var G0t=5,W0t=new Array(G0t),j0t=new h,q0t=new $,Y0t=new F,X0t=new F,K0t=new F,sZ=new F,Z0t=new h,$0t=new h,Q0t=new h,_Ce=new Array(8);for(let e=0;e<8;e++)_Ce[e]=new h;function mCe(e,t,n){return Math.abs(oe.dot(e,t))<n}function J0t(e){let t=F.getColumn(e,0,Z0t),n=F.getColumn(e,1,$0t),i=F.getColumn(e,2,Q0t),o=P.EPSILON4;return mCe(t,n,o)&&mCe(n,i,o)}function ext(e,t){let n=_Ce;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)F.multiplyByPoint(e,n[i],n[i]);return vn.fromPoints(n,t)}function aZ(e,t,n,i,o,r,s,a){let c=cs.DefaultMinBounds,u=cs.DefaultMaxBounds,f=c.x,d=u.x,p=c.y,g=u.y,m=c.z,x=u.z;if(e===f&&t===d&&n===p&&i===g&&o===m&&r===x)return a.center=F.getTranslation(s,a.center),a.halfAxes=F.getMatrix3(s,a.halfAxes),a;r<o&&(r+=P.TWO_PI);let T=r-o,C=o+T*.5,A=W0t,E=0;A[E++]=o,A[E++]=r,A[E++]=C,T>P.PI&&(A[E++]=C-P.PI_OVER_TWO,A[E++]=C+P.PI_OVER_TWO);let v=1,D=1,O=-1,R=-1;for(let J=0;J<E;++J){let q=A[J]-C,K=Math.cos(q),Q=Math.sin(q),de=K*e,ye=Q*e,ce=K*t,_e=Q*t;v=Math.min(v,de),D=Math.min(D,ye),v=Math.min(v,ce),D=Math.min(D,_e),O=Math.max(O,de),R=Math.max(R,ye),O=Math.max(O,ce),R=Math.max(R,_e)}let M=O-v,N=R-D,_=i-n,S=(v+O)*.5,w=(D+R)*.5,I=(n+i)*.5,L=h.fromElements(S,w,I,j0t),B=$.fromRotationZ(C,q0t),U=h.fromElements(M,N,_,pCe),V=F.fromScale(U,K0t),G=F.fromRotation(B,X0t),k=F.fromTranslation(L,Y0t),W=F.multiplyTransformation(G,F.multiplyTransformation(k,V,sZ),sZ),j=F.multiplyTransformation(s,W,sZ);return J0t(j)?vn.fromTransformation(j,a):ext(j,a)}var hp=cs;function Eg(){this.orientedBoundingBox=new vn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._rectangle=new se,this._minimumHeight=Eg.DefaultMinBounds.z,this._maximumHeight=Eg.DefaultMaxBounds.z,this._ellipsoid=new ee,this._translation=new h,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new h,eccentricitySquared:0,evoluteScale:new z,ellipsoidInverseRadiiSquaredUv:new h,ellipsoidRenderLongitudeMinMax:new z,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidUvToShapeUvLongitude:new z,ellipsoidUvToShapeUvLatitude:new z,ellipsoidRenderLatitudeSinMinMax:new z,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new z},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var txt=new h,nxt=new h,ixt=new h,oxt=new h,rxt=new h,sxt=new h,axt=new h,cxt=new h,lxt=new $,gCe=new h,yCe=new h,uxt=new se;Eg.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=Eg;i=y(i,r),o=y(o,s);let a=P.EPSILON10,c=P.EPSILON3,u=P.EPSILON10,f=P.EPSILON10,d=P.EPSILON3,p=F.getScale(e,cxt),g=h.clone(r,txt);g.z=-h.minimumComponent(p);let m=h.clamp(t,g,s,nxt),x=h.clamp(n,g,s,ixt),b=h.clamp(i,g,s,oxt),T=h.clamp(o,g,s,rxt),C=h.maximumByComponent(m,b,sxt),A=h.minimumByComponent(x,T,axt),E=h.add(p,h.fromElements(x.z,x.z,x.z,gCe),gCe),v=h.maximumComponent(E),D=h.add(p,h.fromElements(A.z,A.z,A.z,yCe),yCe);if(C.y>A.y||C.y===s.y||A.y===r.y||C.z>A.z||P.equalsEpsilon(D,h.ZERO,void 0,a))return!1;this._rectangle=se.fromRadians(m.x,m.y,x.x,x.y),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=ee.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=x.z;let O=se.fromRadians(C.x,C.y,A.x,A.y,uxt);this.orientedBoundingBox=cZ(O,C.z,A.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=F.fromRotationTranslation($.setScale(this._rotation,E,lxt),this._translation,this.shapeTransform),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let R=s.x-r.x,M=.5*R,N=A.x<C.x,_=A.x-C.x+N*R,S=_<=u,w=_>=M-u&&_<R-u,I=_>u&&_<M-u,L=S||w||I,B=x.x<m.x,U=x.x-m.x+B*R,V=U>M+u&&U<R-u,G=U>=M-u&&U<=M+u,k=U<M-u,W=V||G||k,j=A.y<-d,J=A.y>=-d&&A.y<=+d,q=A.y>+d&&A.y<s.y-f,K=j||J||q,Q=C.y>r.y+f&&C.y<-d,de=C.y>=-d&&C.y<=+d,ye=C.y>+d,ce=Q||de||ye,_e=K||ce,xe=x.y-m.y,De=x.y<-d,Ae=x.y>=-d&&x.y<=+d,ke=x.y>+d&&x.y<s.y-f,ze=De||Ae||ke,tt=m.y>r.y+f&&m.y<-d,wt=m.y>=-d&&m.y<=+d,_t=m.y>+d,Yt=ze||(tt||wt||_t),{shaderUniforms:Et,shaderDefines:ut}=this;for(let ft in ut)ut.hasOwnProperty(ft)&&(ut[ft]=void 0);Et.ellipsoidRadiiUv=h.divideByScalar(E,v,Et.ellipsoidRadiiUv);let{x:tn,z:Ce}=Et.ellipsoidRadiiUv,Te=Ce/tn;Et.eccentricitySquared=1-Te*Te,Et.evoluteScale=z.fromElements((tn*tn-Ce*Ce)/tn,(Ce*Ce-tn*tn)/Ce,Et.evoluteScale),Et.ellipsoidInverseRadiiSquaredUv=h.divideComponents(h.ONE,h.multiplyComponents(Et.ellipsoidRadiiUv,Et.ellipsoidRadiiUv,Et.ellipsoidInverseRadiiSquaredUv),Et.ellipsoidInverseRadiiSquaredUv);let it=0;ut.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=it,it+=1,ut.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=it,it+=1,Et.clipMinMaxHeight=z.fromElements((C.z-x.z)/v,(A.z-x.z)/v,Et.clipMinMaxHeight);let ji=(x.z-m.z)/v;if(Et.ellipsoidInverseHeightDifferenceUv=1/ji,m.z===x.z&&(Et.ellipsoidInverseHeightDifferenceUv=0),L&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,ut.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=it,w?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,it+=1):I?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,it+=2):S&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,it+=2),Et.ellipsoidRenderLongitudeMinMax=z.fromElements(C.x,A.x,Et.ellipsoidRenderLongitudeMinMax)),W)if(ut.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,x.x<m.x&&(ut.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),U<=u)Et.ellipsoidUvToShapeUvLongitude=z.fromElements(0,1,Et.ellipsoidUvToShapeUvLongitude);else{let yo=R/U,Xo=-(m.x-r.x)/U;Et.ellipsoidUvToShapeUvLongitude=z.fromElements(yo,Xo,Et.ellipsoidUvToShapeUvLongitude)}if(L){let ft=P.equalsEpsilon(C.x,r.x,void 0,c),yo=P.equalsEpsilon(A.x,s.x,void 0,c);ft&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),yo&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Xo=(m.x-r.x)/R,Xa=(x.x-r.x)/R,Rr=(A.x-r.x)/R,As=1-_/R,Le=(Rr+.5*As)%1;Et.ellipsoidShapeUvLongitudeMinMaxMid=h.fromElements(Xo,Xa,Le,Et.ellipsoidShapeUvLongitudeMinMaxMid)}if(_e&&(ce&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,ut.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=it,Q?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,it+=1):de?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,it+=1):ye&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,it+=2)),K&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,ut.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=it,j?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,it+=2):J?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,it+=1):q&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,it+=1)),Et.ellipsoidRenderLatitudeSinMinMax=z.fromElements(Math.sin(C.y),Math.sin(A.y),Et.ellipsoidRenderLatitudeSinMinMax)),Yt)if(ut.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,xe<f)Et.ellipsoidUvToShapeUvLatitude=z.fromElements(0,1,Et.ellipsoidUvToShapeUvLatitude);else{let yo=(s.y-r.y)/xe,Xo=(r.y-m.y)/xe;Et.ellipsoidUvToShapeUvLatitude=z.fromElements(yo,Xo,Et.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=it,!0};var TCe=new se;Eg.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,d=(i+1)*r,p=se.subsection(this._rectangle,s,c,a,u,TCe),g=P.lerp(this._minimumHeight,this._maximumHeight,f),m=P.lerp(this._minimumHeight,this._maximumHeight,d);return cZ(p,g,m,this._ellipsoid,this._translation,this._rotation,o)};var xCe=new h,bCe=new h,fxt=new h;Eg.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,xCe),s=h.multiplyByScalar(r,o,xCe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,bCe),o,bCe),c=h.add(a,s,fxt),u=se.subsection(this._rectangle,a.x,a.y,c.x,c.y,TCe),f=P.lerp(this._minimumHeight,this._maximumHeight,a.z),d=P.lerp(this._minimumHeight,this._maximumHeight,c.z);return cZ(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function cZ(e,t,n,i,o,r,s){return s=vn.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}Eg.DefaultMinBounds=Object.freeze(new h(-P.PI,-P.PI_OVER_TWO,-ee.WGS84.minimumRadius));Eg.DefaultMaxBounds=Object.freeze(new h(P.PI,P.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var cC=Eg;var af={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};af.getMinBounds=function(e){switch(e){case af.BOX:return dp.DefaultMinBounds;case af.ELLIPSOID:return cC.DefaultMinBounds;case af.CYLINDER:return hp.DefaultMinBounds}};af.getMaxBounds=function(e){switch(e){case af.BOX:return dp.DefaultMaxBounds;case af.ELLIPSOID:return cC.DefaultMaxBounds;case af.CYLINDER:return hp.DefaultMaxBounds}};af.getShapeConstructor=function(e){switch(e){case af.BOX:return dp;case af.ELLIPSOID:return cC;case af.CYLINDER:return hp}};var ki=Object.freeze(af);function Wh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Wh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Wh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Wh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Wh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Wh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)CCe(this,t)};Wh.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,CCe(this,i),t};Wh.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],ACe(this,0)),this._array[e-1]=void 0,t};Wh.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=lZ(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&ACe(this,n)}return this._array[e-1]=void 0,t};Wh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Wh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[lZ(this,1,2)?1:2]};function dG(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function f3(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function lZ(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function CCe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=f3(e,t,i);for(o!==n&&(dG(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(f3(e,t,r)!==o)break;dG(e,t,r),t=r}}function ACe(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){f3(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;f3(e,f,r)===i&&(r=f)}}if(f3(e,r,t)===i&&(dG(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);lZ(e,r,a)===i&&dG(e,r,a)}t=r}}var lC=Wh;var ECe=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function hG(e,t){this.spatialNode=e,this.keyframe=t,this.state=ECe.UNLOADED,this.metadata=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}hG.priorityComparator=function(e,t){return e.priority-t.priority};hG.searchComparator=function(e,t){return e.keyframe-t.keyframe};hG.LoadState=ECe;var eo=hG;function k0(e,t,n,i,o){i===Vt.UNSIGNED_SHORT&&(i=Vt.FLOAT32);let r=e.floatingPointTexture;if(i===Vt.FLOAT32&&!r)throw new re("Floating point texture not supported");let s;i===Vt.FLOAT32||i===Vt.FLOAT64?s=Ke.FLOAT:i===Vt.UINT8&&(s=Ke.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?et.RED:et.LUMINANCE:n===2?a=e.webgl2?et.RG:et.LUMINANCE_ALPHA:n===3?a=et.RGB:n===4&&(a=et.RGBA);let c=512*1024*1024,u=128*1024*1024;o=Math.min(y(o,u),c);let f=Nt.maximumTextureSize,d=Vt.getSizeInBytes(i),p=Math.floor(o/(n*d)),g=Math.min(f,P.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),m=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/m),b=m*t.x,T=x*t.y,C=Math.floor(g/b),A=Math.floor(g/T);if(C===0||A===0)throw new re("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=C*A,this.regionCountPerMegatexture=new z(C,A),this.voxelCountPerRegion=new z(b,T),this.sliceCountPerRegion=new z(m,x),this.voxelSizeUv=new z(1/g,1/g),this.sliceSizeUv=new z(t.x/g,t.y/g),this.regionSizeUv=new z(b/g,T/g),this.texture=new Pt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR,magnificationFilter:di.LINEAR})});let E=Vt.toComponentDatatype(i);this.tileVoxelDataTemp=X.createTypedArray(E,b*T*n),this.nodes=new Array(this.maximumTileCount);for(let v=0;v<this.maximumTileCount;v++)this.nodes[v]=new dxt(v);for(let v=0;v<this.maximumTileCount;v++){let D=this.nodes[v];D.previousNode=v>0?this.nodes[v-1]:void 0,D.nextNode=v<this.maximumTileCount-1?this.nodes[v+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function dxt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}k0.prototype.add=function(e){if(this.isFull())throw new he("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};k0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new he("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};k0.prototype.isFull=function(){return this.emptyList===void 0};k0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Vt.UNSIGNED_SHORT&&(i=Vt.FLOAT32);let o=Vt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=P.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/c),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*o};k0.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let b=x%o.x*i.x,T=Math.floor(x/o.x)*i.y;for(let C=0;C<i.y;C++)for(let A=0;A<i.x;A++){let E=x*i.y*i.x+C*i.x+A,v=(T+C)*r.x+(b+A);for(let D=0;D<s;D++)a[v*s+D]=n[E*s+D]}}let c=this.regionCountPerMegatexture,u=r.x,f=r.y,d=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,m={source:{arrayBufferView:a,width:u,height:f},xOffset:d,yOffset:p};this.texture.copyFrom(m)};k0.prototype.isDestroyed=function(){return!1};k0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var xv=k0;function Cd(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new vn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var hxt=new h;Cd.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,hxt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Cd.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,u=r+1,f=a+1,d=t+1,p=[[d,r,s,a],[d,u,s,a],[d,r,c,a],[d,u,c,a],[d,r,s,f],[d,u,s,f],[d,r,c,f],[d,u,c,f]];this.children=p.map(([g,m,x,b])=>new Cd(g,m,x,b,this,e,this.dimensions))};Cd.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Cd.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var SCe={keyframe:0};function d3(e,t){return SCe.keyframe=e,Oo(t,SCe,eo.searchComparator)}Cd.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=mxt(i,d),g=d[p],m=o===i||i<g.keyframe?p:Math.min(p+1,d.length-1),x=d[m],b=i-g.keyframe,T=vCe(n-t.level,b);T<a&&(a=T,r=g);let C=x.keyframe-o,A=vCe(n-t.level,C);if(A<c&&(c=A,s=x),b===0&&C===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function mxt(e,t){let n=d3(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function vCe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Cd.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Cd.prototype.createKeyframeNode=function(e){let t=d3(e,this.keyframeNodes);if(t<0){t=~t;let n=new eo(this,e);this.keyframeNodes.splice(t,0,n)}};Cd.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=d3(n,this.keyframeNodes);if(i<0)throw new he("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=d3(n,this.renderableKeyframeNodes);if(o<0)throw new he("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=eo.LoadState.UNLOADED,e.metadata={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};Cd.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==eo.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadata.length!==t.length)throw new he("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadata[o])}e.state=eo.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=d3(e.keyframe,n);if(i>=0)throw new he("Keyframe already renderable");i=~i,n.splice(i,0,e)};Cd.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var h3=Cd;function Sg(e,t,n,i,o,r,s){this._primitive=e,this.megatextures=new Array(i.length);for(let m=0;m<i.length;m++){let x=i[m],b=lt.getComponentCount(x),T=o[m];this.megatextures[m]=new xv(t,n,b,T,s)}let a=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let c=e._shape;this.rootNode=new h3(0,0,0,0,void 0,c,n),this._priorityQueue=new lC({maximumLength:a,comparator:eo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(a),this._keyframeNodesInMegatexture=new Array(a),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let u=this._binaryTreeKeyframeWeighting;u[0]=0,u[r-1]=0,uZ(u,1,r-2,0);let f=9,d=2048,p=Math.floor(d/f),g=Math.ceil(a/p);this.internalNodeTexture=new Pt({context:t,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,flipY:!1,width:d,height:g,sampler:new $t({minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST})}),this.internalNodeTilesPerRow=p,this.internalNodeTexelSizeUv=new z(1/d,1/g),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new z}Sg.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function uZ(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,uZ(e,t,o-1,i+1),uZ(e,o+1,n,i+1)}Sg.simultaneousRequestCountMaximum=50;Sg.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let C=Math.floor(512),A=Math.ceil(s/C);this.leafNodeTexture=new Pt({context:r,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,flipY:!1,width:1024,height:A,sampler:new $t({minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST})}),this.leafNodeTexelSizeUv=z.fromElements(1/1024,1/A,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=C}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&wCe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=bi();gxt(this,e);let m=bi();bxt(this,d,c);let x=bi();if(this._debugPrint){let b=m-g,T=x-m,C=x-g;xxt(this,b,T,C)}};Sg.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Sg.prototype.isDestroyed=function(){return!1};Sg.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function wCe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];wCe(e,i)}}function pxt(e,t){if(e._simultaneousRequestCount>=Sg.simultaneousRequestCountMaximum)return;let n=e._primitive._provider;function i(c){e._simultaneousRequestCount--;let u=n.types.length;if(!l(c))t.state=eo.LoadState.UNAVAILABLE;else if(c===eo.LoadState.FAILED)t.state=eo.LoadState.FAILED;else if(!Array.isArray(c)||c.length!==u)t.state=eo.LoadState.FAILED;else{let f=e.megatextures;for(let d=0;d<u;d++){let{voxelCountPerTile:p,channelCount:g}=f[d],{x:m,y:x,z:b}=p,T=m*x*b,C=c[d],A=T*g;if(C.length===A)t.metadata[d]=C,t.state=eo.LoadState.RECEIVED;else{t.state=eo.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=eo.LoadState.FAILED}let{keyframe:r,spatialNode:s}=t,a=n.requestData({tileLevel:s.level,tileX:s.x,tileY:s.y,tileZ:s.z,keyframe:r});l(a)?(e._simultaneousRequestCount++,t.state=eo.LoadState.RECEIVING,a.then(i).catch(o)):t.state=eo.LoadState.FAILED}function _xt(e){return e/(1+e)}function gxt(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,r=i.screenSpaceError,s=e._priorityQueue,a=e._keyframeCount,c=P.clamp(Math.floor(e._keyframeLocation),0,a-2),u=c+1,{camera:f,context:d,pixelRatio:p}=t,{positionWC:g,frustum:m}=f,b=d.drawingBufferHeight/p/m.sseDenominator;function T(N,_){if(N.computeScreenSpaceError(g,b),_=N.visibility(t,_),_===_s.MASK_OUTSIDE)return;if(N.visitedFrameNumber=n,a===1)N.createKeyframeNode(0);else if(N.keyframeNodes.length!==a)for(let B=0;B<a;B++)N.createKeyframeNode(B);let{screenSpaceError:S,keyframeNodes:w}=N,I=_xt(S),L=!1;for(let B=0;B<w.length;B++){let U=w[B];U.priority=10*I+yxt(c,U.keyframe,u,e),U.state!==eo.LoadState.UNAVAILABLE&&U.state!==eo.LoadState.FAILED&&U.priority!==-Number.MAX_VALUE&&s.insert(U),U.state===eo.LoadState.LOADED&&(L=!0)}if(S<r||!L){N.children=void 0;return}l(N.children)||N.constructChildNodes(o);for(let B=0;B<8;B++){let U=N.children[B];T(U,_)}}s.reset(),T(e.rootNode,_s.MASK_INDETERMINATE);let C=e._highPriorityKeyframeNodes,A=0,E;for(;s.length>0;)E=s.removeMaximum(),E.highPriorityFrameNumber=n,C[A]=E,A++;let v=e._keyframeNodesInMegatexture,D=e.megatextures[0],O=D.occupiedCount;v.length=O,v.sort(function(N,_){return N.highPriorityFrameNumber===_.highPriorityFrameNumber?_.priority-N.priority:_.highPriorityFrameNumber-N.highPriorityFrameNumber});let R=0,M=0;for(let N=0;N<A;N++)if(E=C[N],!(E.state===eo.LoadState.LOADED||E.spatialNode===void 0)&&(E.state===eo.LoadState.UNLOADED&&pxt(e,E),E.state===eo.LoadState.RECEIVED)){let _=0;if(D.isFull()){_=O-1-R,R++;let S=v[_];S.spatialNode.destroyKeyframeNode(S,e.megatextures)}else _=O+M,M++;E.spatialNode.addKeyframeNodeToMegatextures(E,e.megatextures),v[_]=E}}function yxt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return P.lerp(a,s,.15+.85*s)}function xxt(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys(eo.LoadState).length,a=new Array(s),c=new Array(s),u=0;for(let T=0;T<s;T++){let C=new Array(o);a[T]=C;for(let A=0;A<o;A++)C[A]=0;c[T]=0}function f(T){let C=T.keyframeNodes;for(let A=0;A<C.length;A++){let E=C[A],v=E.keyframe,D=E.state;a[D][v]+=1,c[D]+=1,u++}if(l(T.children))for(let A=0;A<8;A++){let E=T.children[A];f(E)}}f(r);let d=`KEYFRAMES: ${a[eo.LoadState.LOADED]}`,p=`UNLOADED: ${c[eo.LoadState.UNLOADED]} | RECEIVING: ${c[eo.LoadState.RECEIVING]} | RECEIVED: ${c[eo.LoadState.RECEIVED]} | LOADED: ${c[eo.LoadState.LOADED]} | FAILED: ${c[eo.LoadState.FAILED]} | UNAVAILABLE: ${c[eo.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,g=Math.round(t*100)/100,m=Math.round(n*100)/100,x=Math.round(i*100)/100,b=`LOAD: ${g} | OCT: ${m} | ALL: ${x}`;console.log(`${d} || ${p} || ${b}`)}var mG={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function bxt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,m,x,b,T){let C=!1;if(l(g.children))for(let A=0;A<8;A++){let E=g.children[A];E.computeSurroundingRenderableKeyframeNodes(o),E.isRenderable(r)&&(C=!0)}if(C){u[T]=mG.INTERNAL<<16|m,u[x]=b,a++,b=m,T=b*9+1;for(let A=0;A<8;A++){let E=g.children[A];m=a,x=m*9+0,d(E,m,x,b,T+A)}}else{if(s){let A=c*5,E=g.renderableKeyframeNodePrevious,v=g.level-E.spatialNode.level,D=E.spatialNode.parent,O=l(D)?D.renderableKeyframeNodePrevious:E,R=Txt(g,i,n),M=v,N=1,_=E.megatextureIndex,S=O.megatextureIndex;f[A+0]=R,f[A+1]=M,f[A+2]=N,f[A+3]=_,f[A+4]=S,u[T]=mG.LEAF<<16|c}else{let A=g.renderableKeyframeNodePrevious,v=g.level-A.spatialNode.level===0?mG.LEAF:mG.PACKED_LEAF_FROM_PARENT;u[T]=v<<16|A.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&d(p,0,0,0,0),Cxt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&Axt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function Txt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return P.clamp(s,0,1)}function Cxt(e,t,n,i){let o=et.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let d=0;d<e.length;d++){let p=e[d],g=d*o;for(let m=0;m<o;m++)c[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function Axt(e,t,n,i){let o=et.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let g=e[p*r+0],m=e[p*r+1],x=e[p*r+2],b=e[p*r+3],T=e[p*r+4],C=P.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=C>>>0&255,u[p*8+1]=C>>>8&255,u[p*8+2]=m&255,u[p*8+3]=x&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=T>>>0&255,u[p*8+7]=T>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}Sg.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],u=lt.getComponentCount(a);o+=xv.getApproximateTextureMemoryByteLength(e,t,u,c)}return o};var bv=Sg;var Ext={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},Tv=Object.freeze(Ext);function Sxt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var m3=Sxt;function Cv(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}Cv.prototype.getTexture=function(e){return this._textures[e]};function vxt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}Cv.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):vxt(this,e,t)};function wxt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?pG(o,r,n):Dxt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function pG(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?ICe(e,n):new Pt({context:n,source:t,sampler:o});return DCe(o)&&r.generateMipmap(),r}function Dxt(e,t,n){let{typedArray:i,sampler:o}=e,r=DCe(o),s=o.wrapS===Cn.REPEAT||o.wrapS===Cn.MIRRORED_REPEAT||o.wrapT===Cn.REPEAT||o.wrapT===Cn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((r||s)&&!u)if(l(i)){if(e.pixelDatatype===Ke.UNSIGNED_BYTE){let d=m3(i,a,c),p=py(d);return pG({sampler:o},p,n)}}else{let d=py(t);return pG(e,d,n)}else return pG(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),ICe(e,n)}function DCe(e){return[Zt.NEAREST_MIPMAP_NEAREST,Zt.NEAREST_MIPMAP_LINEAR,Zt.LINEAR_MIPMAP_NEAREST,Zt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function ICe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Pt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}Cv.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];wxt(this,o,t)}n.length=0};Cv.prototype.isDestroyed=function(){return!1};Cv.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var p3=Cv;function _3(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,x_.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,Oy.INHERIT),this._textureManager=new p3,this._defaultTexture=void 0,this.uniformMap=Ixt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Oxt(this),Mxt(this)}function Ixt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===Tv.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=Pxt(e,i)):n[i]=Rxt(e,i)}return n}function Pxt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function Rxt(e,t){return function(){return e.uniforms[t].value}}function uC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function Oxt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,uC(r,t,o),o=e.usedVariablesVertex.featureIdSet,uC(r,n,o),o=e.usedVariablesVertex.metadataSet,uC(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,uC(s,t,o),o=e.usedVariablesFragment.featureIdSet,uC(s,n,o),o=e.usedVariablesFragment.metadataSet,uC(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;uC(s,a,c)}}function PCe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function Rc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${PCe(t)} is not available in the ${i} shader. Did you mean ${PCe(n)} instead?`;throw new he(o)}}function Mxt(e){let t=e.usedVariablesVertex.attributeSet;Rc(t,"position","positionMC","vertex"),Rc(t,"normal","normalMC","vertex"),Rc(t,"tangent","tangentMC","vertex"),Rc(t,"bitangent","bitangentMC","vertex"),Rc(t,"positionWC","positionMC","vertex"),Rc(t,"positionEC","positionMC","vertex"),Rc(t,"normalEC","normalMC","vertex"),Rc(t,"tangentEC","tangentMC","vertex"),Rc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Rc(n,"position","positionEC","fragment"),Rc(n,"normal","normalEC","fragment"),Rc(n,"tangent","tangentEC","fragment"),Rc(n,"bitangent","bitangentEC","fragment"),Rc(n,"normalMC","normalEC","fragment"),Rc(n,"tangentMC","tangentEC","fragment"),Rc(n,"bitangentMC","bitangentEC","fragment")}_3.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===Tv.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};_3.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};_3.prototype.isDestroyed=function(){return!1};_3.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var fC=_3;function mp(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,mp.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new h,this._paddingAfter=new h,this._minBounds=new h,this._minBoundsOld=new h,this._maxBounds=new h,this._maxBoundsOld=new h,this._exaggeratedMinBounds=new h,this._exaggeratedMinBoundsOld=new h,this._exaggeratedMaxBounds=new h,this._exaggeratedMaxBoundsOld=new h,this._minClippingBounds=new h,this._minClippingBoundsOld=new h,this._maxClippingBounds=new h,this._maxClippingBoundsOld=new h,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._exaggeratedModelMatrix=F.clone(this._modelMatrix),this._compoundModelMatrix=new F,this._compoundModelMatrixOld=new F,this._customShader=y(e.customShader,mp.DefaultCustomShader),this._customShaderCompilationEvent=new me,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new F,this._transformPositionUvToWorld=new F,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new uh,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new z,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new z,megatextureTextures:[],megatextureSliceDimensions:new z,megatextureTileDimensions:new z,megatextureVoxelSizeUv:new z,megatextureSliceSizeUv:new z,megatextureTileSizeUv:new z,dimensions:new h,paddingBefore:new h,paddingAfter:new h,transformPositionViewToUv:new F,transformPositionUvToView:new F,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new h,ndcSpaceAxisAlignedBoundingBox:new oe,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,stepSize:0,pickColor:new H},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;Lxt(this,i)}function Lxt(e,t){let{shape:n,minBounds:i=ki.getMinBounds(n),maxBounds:o=ki.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=ki.getMinBounds(n),e.maxClippingBounds=ki.getMaxBounds(n),e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=F.clone(e._modelMatrix,e._exaggeratedModelMatrix),OCe(e,t);let r=ki.getShapeConstructor(n);e._shape=new r,e._shapeVisible=MCe(e,e._shape,t)}Object.defineProperties(mp.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=mp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var Nxt=new h,Fxt=new oe,Bxt=new oe,kxt=new h,Vxt=new h,Uxt=new $,zxt=new $,Hxt=new F,Gxt=new F,Wxt=new F,jxt=F.fromRotationTranslation($.fromUniformScale(.5,new $),new h(.5,.5,.5),new F),qxt=F.fromRotationTranslation($.fromUniformScale(2,new $),new h(-1,-1,-1),new F);mp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Qxt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}Zxt(this,e);let i=OCe(this,t),o=this._shape;if(i&&(this._shapeVisible=MCe(this,o,t),tbt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=nbt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&ubt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),ibt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=z.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(u3(this,n),this._shaderDirty=!1);let d=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=sbt(p,d,Bxt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=oe.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;f.transformPositionViewToUv=F.multiplyTransformation(this._transformPositionWorldToUv,x,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=F.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let T=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,T,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let C=e.camera.positionWC;f.cameraPositionUv=F.multiplyByPoint(this._transformPositionWorldToUv,C,f.cameraPositionUv),f.stepSize=this._stepSizeMultiplier;let A=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;A.boundingVolume=o.boundingSphere,e.commandList.push(A)};var Yxt=new h,fZ=new h,Xxt=new fe,Kxt=new h;function Zxt(e,t){if(e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===ki.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else if(e.shape===ki.BOX){let n=h.fromElements(1,1,t.verticalExaggeration,Yxt);e._exaggeratedModelMatrix=F.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=F.multiplyByTranslation(e._exaggeratedModelMatrix,$xt(e,t),e._exaggeratedModelMatrix)}}function $xt(e,t){let{shapeTransform:n=F.IDENTITY,globalTransform:i=F.IDENTITY}=e._provider,o=F.getTranslation(n,fZ),r=F.multiplyByPoint(e._modelMatrix,o,fZ),s=F.multiplyByPoint(i,r,fZ),c=ee.WGS84.cartesianToCartographic(s,Xxt),u=0;l(c)&&(u=c.height);let f=Er.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return h.fromElements(0,0,(f-u)/t.verticalExaggeration,Kxt)}function Qxt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=H.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ge(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=h.clone(t.dimensions,i.dimensions),e._paddingBefore=h.clone(y(t.paddingBefore,h.ZERO),e._paddingBefore),i.paddingBefore=h.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=h.clone(y(t.paddingAfter,h.ZERO),e._paddingBefore),i.paddingAfter=h.clone(e._paddingAfter,i.paddingAfter),e._traversal=Jxt(e,t,n),ebt(e._traversal,i)}function OCe(e,t){let n=y(t.shapeTransform,F.IDENTITY),i=y(t.globalTransform,F.IDENTITY);return F.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),F.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),dC(e,"_compoundModelMatrix","_compoundModelMatrixOld")+dC(e,"_minBounds","_minBoundsOld")+dC(e,"_maxBounds","_maxBoundsOld")+dC(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+dC(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+dC(e,"_minClippingBounds","_minClippingBoundsOld")+dC(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function dC(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function MCe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=F.inverse(o,Hxt),s=F.getRotation(o,Uxt),a=F.getScale(o,kxt),c=h.maximumComponent(a),u=h.divideByScalar(a,c,Vxt),f=$.multiplyByScale(s,u,zxt);return e._transformPositionWorldToUv=F.multiplyTransformation(jxt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=F.multiplyTransformation(o,qxt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=F.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function Jxt(e,t,n){let i=h.clone(t.dimensions,Nxt);h.add(i,e._paddingBefore,i),h.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?bv.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new bv(e,n,i,t.types,t.componentTypes,s,r)}function ebt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=z.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=z.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=z.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=z.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=z.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=z.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function tbt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ge(n,!0)),i}function nbt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=Z.secondsDifference(i.stop,i.start),a=Z.secondsDifference(n,i.start)/r;return o+a}function ibt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=F.transpose(F.multiplyTransformation(F.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}mp.prototype.isDestroyed=function(){return!1};mp.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var RCe=new Array(new oe(-1,-1,-1,1),new oe(1,-1,-1,1),new oe(-1,1,-1,1),new oe(1,1,-1,1),new oe(-1,-1,1,1),new oe(1,-1,1,1),new oe(-1,1,1,1),new oe(1,1,1,1)),obt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),rbt=new Array(new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe);function sbt(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,Gxt),o=F.multiply(t,i,Wxt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=rbt,d=RCe.length;for(u=0;u<d;u++)F.multiplyByVector(o,RCe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,m),c=Math.max(c,m)}else for(let g=0;g<3;g++){let m=obt[u*3+g],x=f[m];if(x.z>=-x.w){let b=p.z+p.w,T=x.z+x.w,C=b/(b-T),A=oe.lerp(p,x,C,Fxt),E=A.x/A.w,v=A.y/A.w;r=Math.min(r,E),s=Math.max(s,E),a=Math.min(a,v),c=Math.max(c,v)}}}return r=P.clamp(r,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=oe.fromElements(r,a,s,c,n),n}var dZ=3e7,abt=new h(dZ,0,0),cbt=new h(0,dZ,0),lbt=new h(0,0,dZ);function ubt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,d){i.add({positions:[c,u],width:d,material:Yi.fromType("Color",{color:f})})}function r(c,u,f){let d=c.computeCorners();o(d[0],d[1],u,f),o(d[2],d[3],u,f),o(d[4],d[5],u,f),o(d[6],d[7],u,f),o(d[0],d[2],u,f),o(d[4],d[6],u,f),o(d[1],d[3],u,f),o(d[5],d[7],u,f),o(d[0],d[4],u,f),o(d[2],d[6],u,f),o(d[1],d[5],u,f),o(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[H.RED,H.LIME,H.BLUE][u%3];if(r(c.orientedBoundingBox,g,d),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}r(e._shape.orientedBoundingBox,H.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,abt,H.RED,a),o(h.ZERO,cbt,H.LIME,a),o(h.ZERO,lbt,H.BLUE,a),i.update(t)}mp.DefaultCustomShader=new fC({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;function N0t(e){let t=new Tx;this.shaderBuilder=t;let n=e._customShader,i=xt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,_e.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",_e.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([kB]),t.addFragmentLines([n.fragmentShaderText,"#line 0",XB,FB,VB,KB]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,_e.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,_e.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,_e.FRAGMENT),t.addFragmentLines([zB])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,_e.FRAGMENT),t.addFragmentLines([UB]));let a=e._provider.shape;a==="BOX"?t.addFragmentLines([jB,HB,aC]):a==="CYLINDER"?t.addFragmentLines([qB,gv,GB,aC]):a==="ELLIPSOID"&&(t.addDefine("SHAPE_ELLIPSOID",void 0,_e.FRAGMENT),t.addFragmentLines([YB,gv,WB,aC])),t.addFragmentLines([BB]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,_e.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,_e.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,_e.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,_e.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,_e.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,_e.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,_e.FRAGMENT);let d=e._traversal;t.addDefine("SAMPLE_COUNT",`${d._sampleCount}`,_e.FRAGMENT)}var ZB=N0t;function F0t(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,_e.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,_e.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],N=o[R],_=`PropertyStatistics_${M}`,S=`PropertyStatistics_${M}`;n.addStruct(_,S,_e.FRAGMENT);let w=aG(N);n.addStructField(_,w,"min"),n.addStructField(_,w,"max")}let f="Statistics",d="Statistics",p="statistics";n.addStruct(f,d,_e.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],N=`PropertyStatistics_${M}`,_=M;n.addStructField(f,N,_)}let g="Metadata",m="Metadata",x="metadata";n.addStruct(g,m,_e.FRAGMENT),n.addStructField(g,d,p);for(let R=0;R<c;R++){let M=i[R],N=o[R],_=aG(N);n.addStructField(g,_,M)}for(let R=0;R<c;R++){let M=i[R],N=o[R],_=k0t(N),S=`VoxelProperty_${M}`,w=`VoxelProperty_${M}`;n.addStruct(S,w,_e.FRAGMENT),n.addStructField(S,_,"partialDerivativeLocal"),n.addStructField(S,_,"partialDerivativeWorld"),n.addStructField(S,_,"partialDerivativeView"),n.addStructField(S,_,"partialDerivativeValid")}let b="Voxel",T="Voxel",C="voxel";n.addStruct(b,T,_e.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],N=`VoxelProperty_${M}`;n.addStructField(b,N,M)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance"),n.addStructField(b,"int","stepCount"),n.addStructField(b,"int","tileIndex"),n.addStructField(b,"int","sampleIndex");let A="FragmentInput";n.addStruct(A,"FragmentInput",_e.FRAGMENT),n.addStructField(A,m,x),n.addStructField(A,T,C);let v="Properties",D="Properties",O="properties";n.addStruct(v,D,_e.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],N=o[R],_=aG(N);n.addStructField(v,_,M)}{let R="clearProperties";n.addFunction(R,`${D} clearProperties()`,_e.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let N=i[M],_=o[M],S=r[M],w=aG(_,S);n.addFunctionLines(R,[`${O}.${N} = ${w}(0.0);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="sumProperties";n.addFunction(R,`${D} sumProperties(${D} propertiesA, ${D} propertiesB)`,_e.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let N=i[M];n.addFunctionLines(R,[`${O}.${N} = propertiesA.${N} + propertiesB.${N};`])}n.addFunctionLines(R,[`return ${O};`])}{let R="scaleProperties";n.addFunction(R,`${D} scaleProperties(${D} ${O}, float scale)`,_e.FRAGMENT),n.addFunctionLines(R,[`${D} scaledProperties = ${O};`]);for(let M=0;M<c;M++){let N=i[M];n.addFunctionLines(R,[`scaledProperties.${N} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${D} mixProperties(${D} propertiesA, ${D} propertiesB, float mixFactor)`,_e.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let N=i[M];n.addFunctionLines(R,[`${O}.${N} = mix(propertiesA.${N}, propertiesB.${N}, mixFactor);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${D} ${O}, inout ${m} ${x})`,_e.FRAGMENT);for(let M=0;M<c;M++){let N=i[M];n.addFunctionLines(R,[`${x}.${N} = ${O}.${N};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${d} ${p})`,_e.FRAGMENT);for(let M=0;M<c;M++){let N=i[M],_=o[M],S=ct.getComponentCount(_);for(let w=0;w<S;w++){let I=V0t(_,w),L=s[M][w],B=a[M][w];n.addFunctionLines(R,[`${p}.${N}.min${I} = ${fCe(L)};`,`${p}.${N}.max${I} = ${fCe(B)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${D} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,_e.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let N=i[M],_=o[M],S=r[M],w=B0t(_,S);n.addFunctionLines(R,[`properties.${N} = texture(u_megatextureTextures[${M}], texcoord)${w};`])}n.addFunctionLines(R,[`return ${O};`])}}function aG(e){if(e===ct.SCALAR)return"float";if(e===ct.VEC2)return"vec2";if(e===ct.VEC3)return"vec3";if(e===ct.VEC4)return"vec4"}function B0t(e){if(e===ct.SCALAR)return".r";if(e===ct.VEC2)return".ra";if(e===ct.VEC3)return".rgb";if(e===ct.VEC4)return""}function k0t(e){if(e===ct.SCALAR)return"vec3";if(e===ct.VEC2)return"mat2";if(e===ct.VEC3)return"mat3";if(e===ct.VEC4)return"mat4"}function fCe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function V0t(e,t){return e===ct.SCALAR?"":`[${t}]`}var $B=F0t;function U0t(e,t){let n=new ZB(e);$B(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let T="getClippingPlane",C=cg(o,t),A=0,E=C.indexOf(")")+1,v=C.indexOf("{",E)+1,D=C.indexOf("}",v),O=C.slice(A,E),R=C.slice(v,D);i.addFunction(T,O,_e.FRAGMENT),i.addFunctionLines(T,[R])}let s=i.clone();s.addDefine("PICKING",void 0,_e.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,_e.FRAGMENT);let c=i.buildShaderProgram(t),u=s.buildShaderProgram(t),f=a.buildShaderProgram(t),d=Ve.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,m=new Ze({vertexArray:p,primitiveType:Me.TRIANGLES,renderState:d,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:we.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),x=Ze.shallowClone(m,new Ze);x.shaderProgram=u,x.pickOnly=!0;let b=Ze.shallowClone(m,new Ze);if(b.shaderProgram=f,b.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=m,e._drawCommandPick=x,e._drawCommandPickVoxel=b}var QB=U0t;function su(){this.orientedBoundingBox=new vn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=h.clone(su.DefaultMinBounds,new h),this._maxBounds=h.clone(su.DefaultMaxBounds,new h),this.shaderUniforms={renderMinBounds:new h,renderMaxBounds:new h,boxUvToShapeUvScale:new h,boxUvToShapeUvTranslate:new h},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var z0t=new h,oZ=new h,H0t=new $,G0t=new h,W0t=new h,j0t=new h,q0t=new h,dCe=F.fromRotationTranslation($.fromUniformScale(.5,new $),new h(.5,.5,.5),new F);su.prototype.update=function(e,t,n,i,o){i=y(i,su.DefaultMinBounds),o=y(o,su.DefaultMaxBounds);let r=su.DefaultMinBounds,s=su.DefaultMaxBounds;t=this._minBounds=h.clamp(t,r,s,this._minBounds),n=this._maxBounds=h.clamp(n,r,s,this._maxBounds),i=h.clamp(i,r,s,G0t),o=h.clamp(o,r,s,W0t);let a=h.clamp(t,i,o,j0t),c=h.clamp(n,i,o,q0t),u=F.getScale(e,oZ);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||u.x===0||u.y===0||u.z===0)return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=sZ(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:f,shaderDefines:d}=this;for(let m in d)d.hasOwnProperty(m)&&(d[m]=void 0);let p=!h.equals(t,r)||!h.equals(n,s),g=0;if(d.BOX_INTERSECTION_INDEX=g,g+=1,f.renderMinBounds=F.multiplyByPoint(dCe,a,f.renderMinBounds),f.renderMaxBounds=F.multiplyByPoint(dCe,c,f.renderMaxBounds),p){d.BOX_HAS_SHAPE_BOUNDS=!0;let m=t,x=n;f.boxUvToShapeUvScale=h.fromElements(2/(m.x===x.x?1:x.x-m.x),2/(m.y===x.y?1:x.y-m.y),2/(m.z===x.z?1:x.z-m.z),f.boxUvToShapeUvScale),f.boxUvToShapeUvTranslate=h.fromElements(-f.boxUvToShapeUvScale.x*(m.x*.5+.5),-f.boxUvToShapeUvScale.y*(m.y*.5+.5),-f.boxUvToShapeUvScale.z*(m.z*.5+.5),f.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var cG=new h,rZ=new h;su.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(P.lerp(r.x,s.x,a*t),P.lerp(r.y,s.y,a*n),P.lerp(r.z,s.z,a*i),cG),u=h.fromElements(P.lerp(r.x,s.x,a*(t+1)),P.lerp(r.y,s.y,a*(n+1)),P.lerp(r.z,s.z,a*(i+1)),rZ);return sZ(c,u,this.shapeTransform,o)};var hCe=new h;su.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,hCe),s=h.multiplyByScalar(r,o,hCe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,cG),o,cG),c=h.add(a,s,rZ),u=this._minBounds,f=this._maxBounds,d=h.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),cG),p=h.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),rZ);return sZ(d,p,this.shapeTransform,i)};su.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));su.DefaultMaxBounds=Object.freeze(new h(1,1,1));function sZ(e,t,n,i){let o=su.DefaultMinBounds,r=su.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,oZ),c=h.midpoint(e,t,z0t);i.center=F.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),oZ);let u=F.getRotation(n,H0t);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var up=su;function cs(){this.orientedBoundingBox=new vn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._minimumRadius=cs.DefaultMinBounds.x,this._maximumRadius=cs.DefaultMaxBounds.x,this._minimumHeight=cs.DefaultMinBounds.y,this._maximumHeight=cs.DefaultMaxBounds.y,this._minimumAngle=cs.DefaultMinBounds.z,this._maximumAngle=cs.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderHeightMinMax:new z,cylinderRenderRadiusMinMax:new z,cylinderRenderAngleMinMax:new z,cylinderUvToShapeUvRadius:new z,cylinderUvToShapeUvHeight:new z,cylinderUvToShapeUvAngle:new z,cylinderShapeUvAngleMinMax:new z,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var gCe=new h;cs.prototype.update=function(e,t,n,i,o){i=y(i,cs.DefaultMinBounds),o=y(o,cs.DefaultMaxBounds);let r=cs.DefaultMinBounds.x,s=cs.DefaultMaxBounds.x,a=cs.DefaultMinBounds.y,c=cs.DefaultMaxBounds.y,u=cs.DefaultMinBounds.z,f=cs.DefaultMaxBounds.z,d=f-u,p=.5*d,g=P.EPSILON10,m=P.EPSILON3,x=P.EPSILON10,b=P.clamp(t.x,r,s),T=P.clamp(n.x,r,s),C=P.clamp(i.x,r,s),A=P.clamp(o.x,r,s),E=Math.max(b,C),v=Math.min(T,A),D=P.clamp(t.y,a,c),O=P.clamp(n.y,a,c),R=P.clamp(i.y,a,c),M=P.clamp(o.y,a,c),N=Math.max(D,R),_=Math.min(O,M),S=P.negativePiToPi(t.z),w=P.negativePiToPi(n.z),I=P.negativePiToPi(i.z),L=P.negativePiToPi(o.z),B=Math.max(S,I),U=Math.min(w,L),V=F.getScale(e,gCe);if(v===0||E>v||N>_||P.equalsEpsilon(V.x,0,void 0,g)||P.equalsEpsilon(V.y,0,void 0,g)||P.equalsEpsilon(V.z,0,void 0,g))return!1;this._minimumRadius=b,this._maximumRadius=T,this._minimumHeight=D,this._maximumHeight=O,this._minimumAngle=S,this._maximumAngle=w,this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=cZ(E,v,N,_,B,U,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let W=b===r&&T===s,q=D===a&&O===c,J=w<S,j=w-S+J*d,K=j>p+x&&j<d-x,Q=j<p-x,de=j>=p-x&&j<=p+x,xe=K||Q||de,ce=P.equalsEpsilon(S,u,void 0,m),ge=P.equalsEpsilon(w,f,void 0,m),be=E===r,De=U<B,Ae=U-B+De*d,ke=Ae>=p-x&&Ae<d-x,ze=Ae>x&&Ae<p-x,tt=Ae<=x,vt=ke||ze||tt,{shaderUniforms:pt,shaderDefines:Be}=this;for(let At in Be)Be.hasOwnProperty(At)&&(Be[At]=void 0);let qt=0;if(Be.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=qt,qt+=1,be||(Be.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Be.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=qt,qt+=1),pt.cylinderRenderRadiusMinMax=z.fromElements(E,v,pt.cylinderRenderRadiusMinMax),E===v&&(Be.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!W){Be.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let At=T-b,lt=0,jn=1;At!==0&&(lt=1/At,jn=-b/At),pt.cylinderUvToShapeUvRadius=z.fromElements(lt,jn,pt.cylinderUvToShapeUvRadius)}if(!q){Be.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let At=O-D,lt=0,jn=1;At!==0&&(lt=2/At,jn=-(D+1)/At),pt.cylinderUvToShapeUvHeight=z.fromElements(lt,jn,pt.cylinderUvToShapeUvHeight)}if(pt.cylinderRenderHeightMinMax=z.fromElements(N,_,pt.cylinderRenderHeightMinMax),J&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),vt&&(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Be.CYLINDER_INTERSECTION_INDEX_ANGLE=qt,ke?(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,qt+=1):ze?(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,qt+=2):tt&&(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,qt+=2),pt.cylinderRenderAngleMinMax=z.fromElements(B,U,pt.cylinderRenderAngleMinMax)),xe){Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ce&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),ge&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let At=(S-u)/d,lt=(w-u)/d,jn=1-j/d;if(pt.cylinderShapeUvAngleMinMax=z.fromElements(At,lt,pt.cylinderShapeUvAngleMinMax),pt.cylinderShapeUvAngleRangeZeroMid=(lt+.5*jn)%1,j<=x)pt.cylinderUvToShapeUvAngle=z.fromElements(0,1,pt.cylinderUvToShapeUvAngle);else{let sn=d/j,me=-(S-u)/j;pt.cylinderUvToShapeUvAngle=z.fromElements(sn,me,pt.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=qt,!0};cs.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,u=this._minimumAngle,f=this._maximumAngle,d=1/Math.pow(2,e),p=P.lerp(r,s,t*d),g=P.lerp(r,s,(t+1)*d),m=P.lerp(a,c,n*d),x=P.lerp(a,c,(n+1)*d),b=P.lerp(u,f,i*d),T=P.lerp(u,f,(i+1)*d);return cZ(p,g,m,x,b,T,this.shapeTransform,o)};var mCe=new h,pCe=new h,Y0t=new h;cs.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,mCe),s=h.multiplyByScalar(r,o,mCe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,pCe),o,pCe),c=h.add(a,s,Y0t),u=this._minimumRadius,f=this._maximumRadius,d=this._minimumHeight,p=this._maximumHeight,g=this._minimumAngle,m=this._maximumAngle,x=P.lerp(u,f,a.x),b=P.lerp(u,f,c.x),T=P.lerp(d,p,a.y),C=P.lerp(d,p,c.y),A=P.lerp(g,m,a.z),E=P.lerp(g,m,c.z);return cZ(x,b,T,C,A,E,this.shapeTransform,i)};cs.DefaultMinBounds=Object.freeze(new h(0,-1,-P.PI));cs.DefaultMaxBounds=Object.freeze(new h(1,1,+P.PI));var X0t=5,K0t=new Array(X0t),Z0t=new h,$0t=new $,Q0t=new F,J0t=new F,ext=new F,aZ=new F,txt=new h,nxt=new h,ixt=new h,yCe=new Array(8);for(let e=0;e<8;e++)yCe[e]=new h;function _Ce(e,t,n){return Math.abs(oe.dot(e,t))<n}function oxt(e){let t=F.getColumn(e,0,txt),n=F.getColumn(e,1,nxt),i=F.getColumn(e,2,ixt),o=P.EPSILON4;return _Ce(t,n,o)&&_Ce(n,i,o)}function rxt(e,t){let n=yCe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)F.multiplyByPoint(e,n[i],n[i]);return vn.fromPoints(n,t)}function cZ(e,t,n,i,o,r,s,a){let c=cs.DefaultMinBounds,u=cs.DefaultMaxBounds,f=c.x,d=u.x,p=c.y,g=u.y,m=c.z,x=u.z;if(e===f&&t===d&&n===p&&i===g&&o===m&&r===x)return a.center=F.getTranslation(s,a.center),a.halfAxes=F.getMatrix3(s,a.halfAxes),a;r<o&&(r+=P.TWO_PI);let T=r-o,C=o+T*.5,A=K0t,E=0;A[E++]=o,A[E++]=r,A[E++]=C,T>P.PI&&(A[E++]=C-P.PI_OVER_TWO,A[E++]=C+P.PI_OVER_TWO);let v=1,D=1,O=-1,R=-1;for(let J=0;J<E;++J){let j=A[J]-C,K=Math.cos(j),Q=Math.sin(j),de=K*e,xe=Q*e,ce=K*t,ge=Q*t;v=Math.min(v,de),D=Math.min(D,xe),v=Math.min(v,ce),D=Math.min(D,ge),O=Math.max(O,de),R=Math.max(R,xe),O=Math.max(O,ce),R=Math.max(R,ge)}let M=O-v,N=R-D,_=i-n,S=(v+O)*.5,w=(D+R)*.5,I=(n+i)*.5,L=h.fromElements(S,w,I,Z0t),B=$.fromRotationZ(C,$0t),U=h.fromElements(M,N,_,gCe),V=F.fromScale(U,ext),G=F.fromRotation(B,J0t),k=F.fromTranslation(L,Q0t),W=F.multiplyTransformation(G,F.multiplyTransformation(k,V,aZ),aZ),q=F.multiplyTransformation(s,W,aZ);return oxt(q)?vn.fromTransformation(q,a):rxt(q,a)}var fp=cs;function Ag(){this.orientedBoundingBox=new vn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._rectangle=new se,this._minimumHeight=Ag.DefaultMinBounds.z,this._maximumHeight=Ag.DefaultMaxBounds.z,this._ellipsoid=new ee,this._translation=new h,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new h,eccentricitySquared:0,evoluteScale:new z,ellipsoidInverseRadiiSquaredUv:new h,ellipsoidRenderLongitudeMinMax:new z,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidUvToShapeUvLongitude:new z,ellipsoidUvToShapeUvLatitude:new z,ellipsoidRenderLatitudeSinMinMax:new z,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new z},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var sxt=new h,axt=new h,cxt=new h,lxt=new h,uxt=new h,fxt=new h,dxt=new h,hxt=new h,mxt=new $,xCe=new h,bCe=new h,pxt=new se;Ag.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=Ag;i=y(i,r),o=y(o,s);let a=P.EPSILON10,c=P.EPSILON3,u=P.EPSILON10,f=P.EPSILON10,d=P.EPSILON3,p=F.getScale(e,hxt),g=h.clone(r,sxt);g.z=-h.minimumComponent(p);let m=h.clamp(t,g,s,axt),x=h.clamp(n,g,s,cxt),b=h.clamp(i,g,s,lxt),T=h.clamp(o,g,s,uxt),C=h.maximumByComponent(m,b,fxt),A=h.minimumByComponent(x,T,dxt),E=h.add(p,h.fromElements(x.z,x.z,x.z,xCe),xCe),v=h.maximumComponent(E),D=h.add(p,h.fromElements(A.z,A.z,A.z,bCe),bCe);if(C.y>A.y||C.y===s.y||A.y===r.y||C.z>A.z||P.equalsEpsilon(D,h.ZERO,void 0,a))return!1;this._rectangle=se.fromRadians(m.x,m.y,x.x,x.y),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=ee.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=x.z;let O=se.fromRadians(C.x,C.y,A.x,A.y,pxt);this.orientedBoundingBox=lZ(O,C.z,A.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=F.fromRotationTranslation($.setScale(this._rotation,E,mxt),this._translation,this.shapeTransform),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let R=s.x-r.x,M=.5*R,N=A.x<C.x,_=A.x-C.x+N*R,S=_<=u,w=_>=M-u&&_<R-u,I=_>u&&_<M-u,L=S||w||I,B=x.x<m.x,U=x.x-m.x+B*R,V=U>M+u&&U<R-u,G=U>=M-u&&U<=M+u,k=U<M-u,W=V||G||k,q=A.y<-d,J=A.y>=-d&&A.y<=+d,j=A.y>+d&&A.y<s.y-f,K=q||J||j,Q=C.y>r.y+f&&C.y<-d,de=C.y>=-d&&C.y<=+d,xe=C.y>+d,ce=Q||de||xe,ge=K||ce,be=x.y-m.y,De=x.y<-d,Ae=x.y>=-d&&x.y<=+d,ke=x.y>+d&&x.y<s.y-f,ze=De||Ae||ke,tt=m.y>r.y+f&&m.y<-d,vt=m.y>=-d&&m.y<=+d,pt=m.y>+d,qt=ze||(tt||vt||pt),{shaderUniforms:At,shaderDefines:lt}=this;for(let ft in lt)lt.hasOwnProperty(ft)&&(lt[ft]=void 0);At.ellipsoidRadiiUv=h.divideByScalar(E,v,At.ellipsoidRadiiUv);let{x:jn,z:sn}=At.ellipsoidRadiiUv,me=sn/jn;At.eccentricitySquared=1-me*me,At.evoluteScale=z.fromElements((jn*jn-sn*sn)/jn,(sn*sn-jn*jn)/sn,At.evoluteScale),At.ellipsoidInverseRadiiSquaredUv=h.divideComponents(h.ONE,h.multiplyComponents(At.ellipsoidRadiiUv,At.ellipsoidRadiiUv,At.ellipsoidInverseRadiiSquaredUv),At.ellipsoidInverseRadiiSquaredUv);let Ce=0;lt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ce,Ce+=1,lt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ce,Ce+=1,At.clipMinMaxHeight=z.fromElements((C.z-x.z)/v,(A.z-x.z)/v,At.clipMinMaxHeight);let mn=(x.z-m.z)/v;if(At.ellipsoidInverseHeightDifferenceUv=1/mn,m.z===x.z&&(At.ellipsoidInverseHeightDifferenceUv=0),L&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,lt.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ce,w?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ce+=1):I?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ce+=2):S&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ce+=2),At.ellipsoidRenderLongitudeMinMax=z.fromElements(C.x,A.x,At.ellipsoidRenderLongitudeMinMax)),W)if(lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,x.x<m.x&&(lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),U<=u)At.ellipsoidUvToShapeUvLongitude=z.fromElements(0,1,At.ellipsoidUvToShapeUvLongitude);else{let ao=R/U,Ro=-(m.x-r.x)/U;At.ellipsoidUvToShapeUvLongitude=z.fromElements(ao,Ro,At.ellipsoidUvToShapeUvLongitude)}if(L){let ft=P.equalsEpsilon(C.x,r.x,void 0,c),ao=P.equalsEpsilon(A.x,s.x,void 0,c);ft&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),ao&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Ro=(m.x-r.x)/R,ra=(x.x-r.x)/R,Rr=(A.x-r.x)/R,As=1-_/R,Le=(Rr+.5*As)%1;At.ellipsoidShapeUvLongitudeMinMaxMid=h.fromElements(Ro,ra,Le,At.ellipsoidShapeUvLongitudeMinMaxMid)}if(ge&&(ce&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,lt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ce,Q?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ce+=1):de?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ce+=1):xe&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ce+=2)),K&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,lt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ce,q?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ce+=2):J?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ce+=1):j&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ce+=1)),At.ellipsoidRenderLatitudeSinMinMax=z.fromElements(Math.sin(C.y),Math.sin(A.y),At.ellipsoidRenderLatitudeSinMinMax)),qt)if(lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,be<f)At.ellipsoidUvToShapeUvLatitude=z.fromElements(0,1,At.ellipsoidUvToShapeUvLatitude);else{let ao=(s.y-r.y)/be,Ro=(r.y-m.y)/be;At.ellipsoidUvToShapeUvLatitude=z.fromElements(ao,Ro,At.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Ce,!0};var ACe=new se;Ag.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,d=(i+1)*r,p=se.subsection(this._rectangle,s,c,a,u,ACe),g=P.lerp(this._minimumHeight,this._maximumHeight,f),m=P.lerp(this._minimumHeight,this._maximumHeight,d);return lZ(p,g,m,this._ellipsoid,this._translation,this._rotation,o)};var TCe=new h,CCe=new h,_xt=new h;Ag.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,TCe),s=h.multiplyByScalar(r,o,TCe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,CCe),o,CCe),c=h.add(a,s,_xt),u=se.subsection(this._rectangle,a.x,a.y,c.x,c.y,ACe),f=P.lerp(this._minimumHeight,this._maximumHeight,a.z),d=P.lerp(this._minimumHeight,this._maximumHeight,c.z);return lZ(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function lZ(e,t,n,i,o,r,s){return s=vn.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}Ag.DefaultMinBounds=Object.freeze(new h(-P.PI,-P.PI_OVER_TWO,-ee.WGS84.minimumRadius));Ag.DefaultMaxBounds=Object.freeze(new h(P.PI,P.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var cC=Ag;var af={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};af.getMinBounds=function(e){switch(e){case af.BOX:return up.DefaultMinBounds;case af.ELLIPSOID:return cC.DefaultMinBounds;case af.CYLINDER:return fp.DefaultMinBounds}};af.getMaxBounds=function(e){switch(e){case af.BOX:return up.DefaultMaxBounds;case af.ELLIPSOID:return cC.DefaultMaxBounds;case af.CYLINDER:return fp.DefaultMaxBounds}};af.getShapeConstructor=function(e){switch(e){case af.BOX:return up;case af.ELLIPSOID:return cC;case af.CYLINDER:return fp}};var Vi=Object.freeze(af);function Gh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Gh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Gh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Gh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Gh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Gh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)ECe(this,t)};Gh.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,ECe(this,i),t};Gh.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],SCe(this,0)),this._array[e-1]=void 0,t};Gh.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=uZ(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&SCe(this,n)}return this._array[e-1]=void 0,t};Gh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Gh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[uZ(this,1,2)?1:2]};function lG(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function JB(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function uZ(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function ECe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=JB(e,t,i);for(o!==n&&(lG(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(JB(e,t,r)!==o)break;lG(e,t,r),t=r}}function SCe(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){JB(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;JB(e,f,r)===i&&(r=f)}}if(JB(e,r,t)===i&&(lG(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);uZ(e,r,a)===i&&lG(e,r,a)}t=r}}var lC=Gh;var vCe=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function uG(e,t){this.spatialNode=e,this.keyframe=t,this.state=vCe.UNLOADED,this.metadata=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}uG.priorityComparator=function(e,t){return e.priority-t.priority};uG.searchComparator=function(e,t){return e.keyframe-t.keyframe};uG.LoadState=vCe;var eo=uG;function L0(e,t,n,i,o){i===kt.UNSIGNED_SHORT&&(i=kt.FLOAT32);let r=e.floatingPointTexture;if(i===kt.FLOAT32&&!r)throw new re("Floating point texture not supported");let s;i===kt.FLOAT32||i===kt.FLOAT64?s=Ke.FLOAT:i===kt.UINT8&&(s=Ke.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?et.RED:et.LUMINANCE:n===2?a=e.webgl2?et.RG:et.LUMINANCE_ALPHA:n===3?a=et.RGB:n===4&&(a=et.RGBA);let c=512*1024*1024,u=128*1024*1024;o=Math.min(y(o,u),c);let f=Lt.maximumTextureSize,d=kt.getSizeInBytes(i),p=Math.floor(o/(n*d)),g=Math.min(f,P.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),m=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/m),b=m*t.x,T=x*t.y,C=Math.floor(g/b),A=Math.floor(g/T);if(C===0||A===0)throw new re("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=C*A,this.regionCountPerMegatexture=new z(C,A),this.voxelCountPerRegion=new z(b,T),this.sliceCountPerRegion=new z(m,x),this.voxelSizeUv=new z(1/g,1/g),this.sliceSizeUv=new z(t.x/g,t.y/g),this.regionSizeUv=new z(b/g,T/g),this.texture=new It({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new Zt({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:di.LINEAR})});let E=kt.toComponentDatatype(i);this.tileVoxelDataTemp=X.createTypedArray(E,b*T*n),this.nodes=new Array(this.maximumTileCount);for(let v=0;v<this.maximumTileCount;v++)this.nodes[v]=new gxt(v);for(let v=0;v<this.maximumTileCount;v++){let D=this.nodes[v];D.previousNode=v>0?this.nodes[v-1]:void 0,D.nextNode=v<this.maximumTileCount-1?this.nodes[v+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function gxt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}L0.prototype.add=function(e){if(this.isFull())throw new he("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};L0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new he("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};L0.prototype.isFull=function(){return this.emptyList===void 0};L0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===kt.UNSIGNED_SHORT&&(i=kt.FLOAT32);let o=kt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=P.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/c),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*o};L0.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let b=x%o.x*i.x,T=Math.floor(x/o.x)*i.y;for(let C=0;C<i.y;C++)for(let A=0;A<i.x;A++){let E=x*i.y*i.x+C*i.x+A,v=(T+C)*r.x+(b+A);for(let D=0;D<s;D++)a[v*s+D]=n[E*s+D]}}let c=this.regionCountPerMegatexture,u=r.x,f=r.y,d=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,m={source:{arrayBufferView:a,width:u,height:f},xOffset:d,yOffset:p};this.texture.copyFrom(m)};L0.prototype.isDestroyed=function(){return!1};L0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var yv=L0;function Td(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new vn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var yxt=new h;Td.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,yxt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Td.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,u=r+1,f=a+1,d=t+1,p=[[d,r,s,a],[d,u,s,a],[d,r,c,a],[d,u,c,a],[d,r,s,f],[d,u,s,f],[d,r,c,f],[d,u,c,f]];this.children=p.map(([g,m,x,b])=>new Td(g,m,x,b,this,e,this.dimensions))};Td.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Td.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var wCe={keyframe:0};function e3(e,t){return wCe.keyframe=e,Mo(t,wCe,eo.searchComparator)}Td.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=xxt(i,d),g=d[p],m=o===i||i<g.keyframe?p:Math.min(p+1,d.length-1),x=d[m],b=i-g.keyframe,T=DCe(n-t.level,b);T<a&&(a=T,r=g);let C=x.keyframe-o,A=DCe(n-t.level,C);if(A<c&&(c=A,s=x),b===0&&C===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function xxt(e,t){let n=e3(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function DCe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Td.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Td.prototype.createKeyframeNode=function(e){let t=e3(e,this.keyframeNodes);if(t<0){t=~t;let n=new eo(this,e);this.keyframeNodes.splice(t,0,n)}};Td.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=e3(n,this.keyframeNodes);if(i<0)throw new he("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=e3(n,this.renderableKeyframeNodes);if(o<0)throw new he("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=eo.LoadState.UNLOADED,e.metadata={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};Td.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==eo.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadata.length!==t.length)throw new he("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadata[o])}e.state=eo.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=e3(e.keyframe,n);if(i>=0)throw new he("Keyframe already renderable");i=~i,n.splice(i,0,e)};Td.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var t3=Td;function Eg(e,t,n,i,o,r,s){this._primitive=e,this.megatextures=new Array(i.length);for(let m=0;m<i.length;m++){let x=i[m],b=ct.getComponentCount(x),T=o[m];this.megatextures[m]=new yv(t,n,b,T,s)}let a=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let c=e._shape;this.rootNode=new t3(0,0,0,0,void 0,c,n),this._priorityQueue=new lC({maximumLength:a,comparator:eo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(a),this._keyframeNodesInMegatexture=new Array(a),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let u=this._binaryTreeKeyframeWeighting;u[0]=0,u[r-1]=0,fZ(u,1,r-2,0);let f=9,d=2048,p=Math.floor(d/f),g=Math.ceil(a/p);this.internalNodeTexture=new It({context:t,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,flipY:!1,width:d,height:g,sampler:new Zt({minificationFilter:Kt.NEAREST,magnificationFilter:di.NEAREST})}),this.internalNodeTilesPerRow=p,this.internalNodeTexelSizeUv=new z(1/d,1/g),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new z}Eg.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function fZ(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,fZ(e,t,o-1,i+1),fZ(e,o+1,n,i+1)}Eg.simultaneousRequestCountMaximum=50;Eg.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let C=Math.floor(512),A=Math.ceil(s/C);this.leafNodeTexture=new It({context:r,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,flipY:!1,width:1024,height:A,sampler:new Zt({minificationFilter:Kt.NEAREST,magnificationFilter:di.NEAREST})}),this.leafNodeTexelSizeUv=z.fromElements(1/1024,1/A,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=C}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&ICe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ti();Cxt(this,e);let m=Ti();Sxt(this,d,c);let x=Ti();if(this._debugPrint){let b=m-g,T=x-m,C=x-g;Ext(this,b,T,C)}};Eg.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Eg.prototype.isDestroyed=function(){return!1};Eg.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function ICe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];ICe(e,i)}}function bxt(e,t){if(e._simultaneousRequestCount>=Eg.simultaneousRequestCountMaximum)return;let n=e._primitive._provider;function i(c){e._simultaneousRequestCount--;let u=n.types.length;if(!l(c))t.state=eo.LoadState.UNAVAILABLE;else if(c===eo.LoadState.FAILED)t.state=eo.LoadState.FAILED;else if(!Array.isArray(c)||c.length!==u)t.state=eo.LoadState.FAILED;else{let f=e.megatextures;for(let d=0;d<u;d++){let{voxelCountPerTile:p,channelCount:g}=f[d],{x:m,y:x,z:b}=p,T=m*x*b,C=c[d],A=T*g;if(C.length===A)t.metadata[d]=C,t.state=eo.LoadState.RECEIVED;else{t.state=eo.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=eo.LoadState.FAILED}let{keyframe:r,spatialNode:s}=t,a=n.requestData({tileLevel:s.level,tileX:s.x,tileY:s.y,tileZ:s.z,keyframe:r});l(a)?(e._simultaneousRequestCount++,t.state=eo.LoadState.RECEIVING,a.then(i).catch(o)):t.state=eo.LoadState.FAILED}function Txt(e){return e/(1+e)}function Cxt(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,r=i.screenSpaceError,s=e._priorityQueue,a=e._keyframeCount,c=P.clamp(Math.floor(e._keyframeLocation),0,a-2),u=c+1,{camera:f,context:d,pixelRatio:p}=t,{positionWC:g,frustum:m}=f,b=d.drawingBufferHeight/p/m.sseDenominator;function T(N,_){if(N.computeScreenSpaceError(g,b),_=N.visibility(t,_),_===_s.MASK_OUTSIDE)return;if(N.visitedFrameNumber=n,a===1)N.createKeyframeNode(0);else if(N.keyframeNodes.length!==a)for(let B=0;B<a;B++)N.createKeyframeNode(B);let{screenSpaceError:S,keyframeNodes:w}=N,I=Txt(S),L=!1;for(let B=0;B<w.length;B++){let U=w[B];U.priority=10*I+Axt(c,U.keyframe,u,e),U.state!==eo.LoadState.UNAVAILABLE&&U.state!==eo.LoadState.FAILED&&U.priority!==-Number.MAX_VALUE&&s.insert(U),U.state===eo.LoadState.LOADED&&(L=!0)}if(S<r||!L){N.children=void 0;return}l(N.children)||N.constructChildNodes(o);for(let B=0;B<8;B++){let U=N.children[B];T(U,_)}}s.reset(),T(e.rootNode,_s.MASK_INDETERMINATE);let C=e._highPriorityKeyframeNodes,A=0,E;for(;s.length>0;)E=s.removeMaximum(),E.highPriorityFrameNumber=n,C[A]=E,A++;let v=e._keyframeNodesInMegatexture,D=e.megatextures[0],O=D.occupiedCount;v.length=O,v.sort(function(N,_){return N.highPriorityFrameNumber===_.highPriorityFrameNumber?_.priority-N.priority:_.highPriorityFrameNumber-N.highPriorityFrameNumber});let R=0,M=0;for(let N=0;N<A;N++)if(E=C[N],!(E.state===eo.LoadState.LOADED||E.spatialNode===void 0)&&(E.state===eo.LoadState.UNLOADED&&bxt(e,E),E.state===eo.LoadState.RECEIVED)){let _=0;if(D.isFull()){_=O-1-R,R++;let S=v[_];S.spatialNode.destroyKeyframeNode(S,e.megatextures)}else _=O+M,M++;E.spatialNode.addKeyframeNodeToMegatextures(E,e.megatextures),v[_]=E}}function Axt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return P.lerp(a,s,.15+.85*s)}function Ext(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys(eo.LoadState).length,a=new Array(s),c=new Array(s),u=0;for(let T=0;T<s;T++){let C=new Array(o);a[T]=C;for(let A=0;A<o;A++)C[A]=0;c[T]=0}function f(T){let C=T.keyframeNodes;for(let A=0;A<C.length;A++){let E=C[A],v=E.keyframe,D=E.state;a[D][v]+=1,c[D]+=1,u++}if(l(T.children))for(let A=0;A<8;A++){let E=T.children[A];f(E)}}f(r);let d=`KEYFRAMES: ${a[eo.LoadState.LOADED]}`,p=`UNLOADED: ${c[eo.LoadState.UNLOADED]} | RECEIVING: ${c[eo.LoadState.RECEIVING]} | RECEIVED: ${c[eo.LoadState.RECEIVED]} | LOADED: ${c[eo.LoadState.LOADED]} | FAILED: ${c[eo.LoadState.FAILED]} | UNAVAILABLE: ${c[eo.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,g=Math.round(t*100)/100,m=Math.round(n*100)/100,x=Math.round(i*100)/100,b=`LOAD: ${g} | OCT: ${m} | ALL: ${x}`;console.log(`${d} || ${p} || ${b}`)}var fG={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function Sxt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,m,x,b,T){let C=!1;if(l(g.children))for(let A=0;A<8;A++){let E=g.children[A];E.computeSurroundingRenderableKeyframeNodes(o),E.isRenderable(r)&&(C=!0)}if(C){u[T]=fG.INTERNAL<<16|m,u[x]=b,a++,b=m,T=b*9+1;for(let A=0;A<8;A++){let E=g.children[A];m=a,x=m*9+0,d(E,m,x,b,T+A)}}else{if(s){let A=c*5,E=g.renderableKeyframeNodePrevious,v=g.level-E.spatialNode.level,D=E.spatialNode.parent,O=l(D)?D.renderableKeyframeNodePrevious:E,R=vxt(g,i,n),M=v,N=1,_=E.megatextureIndex,S=O.megatextureIndex;f[A+0]=R,f[A+1]=M,f[A+2]=N,f[A+3]=_,f[A+4]=S,u[T]=fG.LEAF<<16|c}else{let A=g.renderableKeyframeNodePrevious,v=g.level-A.spatialNode.level===0?fG.LEAF:fG.PACKED_LEAF_FROM_PARENT;u[T]=v<<16|A.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&d(p,0,0,0,0),wxt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&Dxt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function vxt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return P.clamp(s,0,1)}function wxt(e,t,n,i){let o=et.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let d=0;d<e.length;d++){let p=e[d],g=d*o;for(let m=0;m<o;m++)c[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function Dxt(e,t,n,i){let o=et.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let g=e[p*r+0],m=e[p*r+1],x=e[p*r+2],b=e[p*r+3],T=e[p*r+4],C=P.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=C>>>0&255,u[p*8+1]=C>>>8&255,u[p*8+2]=m&255,u[p*8+3]=x&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=T>>>0&255,u[p*8+7]=T>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}Eg.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],u=ct.getComponentCount(a);o+=yv.getApproximateTextureMemoryByteLength(e,t,u,c)}return o};var xv=Eg;var Ixt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},bv=Object.freeze(Ixt);function Pxt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var n3=Pxt;function Tv(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}Tv.prototype.getTexture=function(e){return this._textures[e]};function Rxt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}Tv.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):Rxt(this,e,t)};function Oxt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?dG(o,r,n):Mxt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function dG(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?RCe(e,n):new It({context:n,source:t,sampler:o});return PCe(o)&&r.generateMipmap(),r}function Mxt(e,t,n){let{typedArray:i,sampler:o}=e,r=PCe(o),s=o.wrapS===Cn.REPEAT||o.wrapS===Cn.MIRRORED_REPEAT||o.wrapT===Cn.REPEAT||o.wrapT===Cn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((r||s)&&!u)if(l(i)){if(e.pixelDatatype===Ke.UNSIGNED_BYTE){let d=n3(i,a,c),p=hy(d);return dG({sampler:o},p,n)}}else{let d=hy(t);return dG(e,d,n)}else return dG(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),RCe(e,n)}function PCe(e){return[Kt.NEAREST_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function RCe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new It({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}Tv.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];Oxt(this,o,t)}n.length=0};Tv.prototype.isDestroyed=function(){return!1};Tv.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var i3=Tv;function o3(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,g_.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,Py.INHERIT),this._textureManager=new i3,this._defaultTexture=void 0,this.uniformMap=Lxt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Bxt(this),kxt(this)}function Lxt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===bv.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=Nxt(e,i)):n[i]=Fxt(e,i)}return n}function Nxt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function Fxt(e,t){return function(){return e.uniforms[t].value}}function uC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function Bxt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,uC(r,t,o),o=e.usedVariablesVertex.featureIdSet,uC(r,n,o),o=e.usedVariablesVertex.metadataSet,uC(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,uC(s,t,o),o=e.usedVariablesFragment.featureIdSet,uC(s,n,o),o=e.usedVariablesFragment.metadataSet,uC(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;uC(s,a,c)}}function OCe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function Rc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${OCe(t)} is not available in the ${i} shader. Did you mean ${OCe(n)} instead?`;throw new he(o)}}function kxt(e){let t=e.usedVariablesVertex.attributeSet;Rc(t,"position","positionMC","vertex"),Rc(t,"normal","normalMC","vertex"),Rc(t,"tangent","tangentMC","vertex"),Rc(t,"bitangent","bitangentMC","vertex"),Rc(t,"positionWC","positionMC","vertex"),Rc(t,"positionEC","positionMC","vertex"),Rc(t,"normalEC","normalMC","vertex"),Rc(t,"tangentEC","tangentMC","vertex"),Rc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Rc(n,"position","positionEC","fragment"),Rc(n,"normal","normalEC","fragment"),Rc(n,"tangent","tangentEC","fragment"),Rc(n,"bitangent","bitangentEC","fragment"),Rc(n,"normalMC","normalEC","fragment"),Rc(n,"tangentMC","tangentEC","fragment"),Rc(n,"bitangentMC","bitangentEC","fragment")}o3.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===bv.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};o3.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};o3.prototype.isDestroyed=function(){return!1};o3.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var fC=o3;function dp(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,dp.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new h,this._paddingAfter=new h,this._minBounds=new h,this._minBoundsOld=new h,this._maxBounds=new h,this._maxBoundsOld=new h,this._exaggeratedMinBounds=new h,this._exaggeratedMinBoundsOld=new h,this._exaggeratedMaxBounds=new h,this._exaggeratedMaxBoundsOld=new h,this._minClippingBounds=new h,this._minClippingBoundsOld=new h,this._maxClippingBounds=new h,this._maxClippingBoundsOld=new h,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._exaggeratedModelMatrix=F.clone(this._modelMatrix),this._compoundModelMatrix=new F,this._compoundModelMatrixOld=new F,this._customShader=y(e.customShader,dp.DefaultCustomShader),this._customShaderCompilationEvent=new pe,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new F,this._transformPositionUvToWorld=new F,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new lh,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new z,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new z,megatextureTextures:[],megatextureSliceDimensions:new z,megatextureTileDimensions:new z,megatextureVoxelSizeUv:new z,megatextureSliceSizeUv:new z,megatextureTileSizeUv:new z,dimensions:new h,paddingBefore:new h,paddingAfter:new h,transformPositionViewToUv:new F,transformPositionUvToView:new F,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new h,ndcSpaceAxisAlignedBoundingBox:new oe,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,stepSize:0,pickColor:new H},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;Vxt(this,i)}function Vxt(e,t){let{shape:n,minBounds:i=Vi.getMinBounds(n),maxBounds:o=Vi.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=Vi.getMinBounds(n),e.maxClippingBounds=Vi.getMaxBounds(n),e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=F.clone(e._modelMatrix,e._exaggeratedModelMatrix),LCe(e,t);let r=Vi.getShapeConstructor(n);e._shape=new r,e._shapeVisible=NCe(e,e._shape,t)}Object.defineProperties(dp.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=dp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var Uxt=new h,zxt=new oe,Hxt=new oe,Gxt=new h,Wxt=new h,jxt=new $,qxt=new $,Yxt=new F,Xxt=new F,Kxt=new F,Zxt=F.fromRotationTranslation($.fromUniformScale(.5,new $),new h(.5,.5,.5),new F),$xt=F.fromRotationTranslation($.fromUniformScale(2,new $),new h(-1,-1,-1),new F);dp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){ibt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}tbt(this,e);let i=LCe(this,t),o=this._shape;if(i&&(this._shapeVisible=NCe(this,o,t),sbt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=abt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&pbt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),cbt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=z.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(QB(this,n),this._shaderDirty=!1);let d=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=fbt(p,d,Hxt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=oe.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;f.transformPositionViewToUv=F.multiplyTransformation(this._transformPositionWorldToUv,x,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=F.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let T=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,T,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let C=e.camera.positionWC;f.cameraPositionUv=F.multiplyByPoint(this._transformPositionWorldToUv,C,f.cameraPositionUv),f.stepSize=this._stepSizeMultiplier;let A=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;A.boundingVolume=o.boundingSphere,e.commandList.push(A)};var Qxt=new h,dZ=new h,Jxt=new fe,ebt=new h;function tbt(e,t){if(e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===Vi.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else if(e.shape===Vi.BOX){let n=h.fromElements(1,1,t.verticalExaggeration,Qxt);e._exaggeratedModelMatrix=F.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=F.multiplyByTranslation(e._exaggeratedModelMatrix,nbt(e,t),e._exaggeratedModelMatrix)}}function nbt(e,t){let{shapeTransform:n=F.IDENTITY,globalTransform:i=F.IDENTITY}=e._provider,o=F.getTranslation(n,dZ),r=F.multiplyByPoint(e._modelMatrix,o,dZ),s=F.multiplyByPoint(i,r,dZ),c=ee.WGS84.cartesianToCartographic(s,Jxt),u=0;l(c)&&(u=c.height);let f=Er.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return h.fromElements(0,0,(f-u)/t.verticalExaggeration,ebt)}function ibt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=H.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ge(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=h.clone(t.dimensions,i.dimensions),e._paddingBefore=h.clone(y(t.paddingBefore,h.ZERO),e._paddingBefore),i.paddingBefore=h.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=h.clone(y(t.paddingAfter,h.ZERO),e._paddingBefore),i.paddingAfter=h.clone(e._paddingAfter,i.paddingAfter),e._traversal=obt(e,t,n),rbt(e._traversal,i)}function LCe(e,t){let n=y(t.shapeTransform,F.IDENTITY),i=y(t.globalTransform,F.IDENTITY);return F.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),F.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),dC(e,"_compoundModelMatrix","_compoundModelMatrixOld")+dC(e,"_minBounds","_minBoundsOld")+dC(e,"_maxBounds","_maxBoundsOld")+dC(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+dC(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+dC(e,"_minClippingBounds","_minClippingBoundsOld")+dC(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function dC(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function NCe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=F.inverse(o,Yxt),s=F.getRotation(o,jxt),a=F.getScale(o,Gxt),c=h.maximumComponent(a),u=h.divideByScalar(a,c,Wxt),f=$.multiplyByScale(s,u,qxt);return e._transformPositionWorldToUv=F.multiplyTransformation(Zxt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=F.multiplyTransformation(o,$xt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=F.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function obt(e,t,n){let i=h.clone(t.dimensions,Uxt);h.add(i,e._paddingBefore,i),h.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?xv.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new xv(e,n,i,t.types,t.componentTypes,s,r)}function rbt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=z.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=z.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=z.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=z.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=z.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=z.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function sbt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ge(n,!0)),i}function abt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=Z.secondsDifference(i.stop,i.start),a=Z.secondsDifference(n,i.start)/r;return o+a}function cbt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=F.transpose(F.multiplyTransformation(F.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}dp.prototype.isDestroyed=function(){return!1};dp.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var MCe=new Array(new oe(-1,-1,-1,1),new oe(1,-1,-1,1),new oe(-1,1,-1,1),new oe(1,1,-1,1),new oe(-1,-1,1,1),new oe(1,-1,1,1),new oe(-1,1,1,1),new oe(1,1,1,1)),lbt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),ubt=new Array(new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe);function fbt(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,Xxt),o=F.multiply(t,i,Kxt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=ubt,d=MCe.length;for(u=0;u<d;u++)F.multiplyByVector(o,MCe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,m),c=Math.max(c,m)}else for(let g=0;g<3;g++){let m=lbt[u*3+g],x=f[m];if(x.z>=-x.w){let b=p.z+p.w,T=x.z+x.w,C=b/(b-T),A=oe.lerp(p,x,C,zxt),E=A.x/A.w,v=A.y/A.w;r=Math.min(r,E),s=Math.max(s,E),a=Math.min(a,v),c=Math.max(c,v)}}}return r=P.clamp(r,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=oe.fromElements(r,a,s,c,n),n}var hZ=3e7,dbt=new h(hZ,0,0),hbt=new h(0,hZ,0),mbt=new h(0,0,hZ);function pbt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,d){i.add({positions:[c,u],width:d,material:Yi.fromType("Color",{color:f})})}function r(c,u,f){let d=c.computeCorners();o(d[0],d[1],u,f),o(d[2],d[3],u,f),o(d[4],d[5],u,f),o(d[6],d[7],u,f),o(d[0],d[2],u,f),o(d[4],d[6],u,f),o(d[1],d[3],u,f),o(d[5],d[7],u,f),o(d[0],d[4],u,f),o(d[2],d[6],u,f),o(d[1],d[5],u,f),o(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[H.RED,H.LIME,H.BLUE][u%3];if(r(c.orientedBoundingBox,g,d),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}r(e._shape.orientedBoundingBox,H.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,dbt,H.RED,a),o(h.ZERO,hbt,H.LIME,a),o(h.ZERO,mbt,H.BLUE,a),i.update(t)}dp.DefaultCustomShader=new fC({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = vec3(1.0); material.alpha = 1.0; -}`});function LCe(){this.ready=!0,this.shape=ki.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[lt.SCALAR],this.componentTypes=[Vt.FLOAT32],this.maximumTileCount=1}LCe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};mp.DefaultProvider=new LCe;var V0=mp;function fbt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var g3=fbt;function dbt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var y3=dbt;function hbt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var x3=hbt;var gG=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function ci(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ge(e.contextOptions),r=l(n),s=new dP(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Hn(),this._jobScheduler=new Q2,this._frameState=new Z2(s,new z2(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new yw(s),this._ellipsoid=y(e.ellipsoid,ee.default),this._globe=void 0,this._globeTranslucencyState=new $2,this._primitives=new Yl,this._groundPrimitives=new Yl,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=ci.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new oC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new Y2(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new Jn({color:new H,stencil:0,owner:this}),this._depthClearCommand=new Jn({depth:1,owner:this}),this._stencilClearCommand=new Jn({stencil:0}),this._classificationStencilClearCommand=new Jn({stencil:0,renderState:Ve.fromCache({stencilMask:Ut.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new BB(this),this._preUpdate=new me,this._postUpdate=new me,this._renderError=new me,this._preRender=new me,this._postRender=new me,this._minimumDisableDepthTestDistance=0,this._debugInspector=new qB,this._msaaSamples=y(e.msaaSamples,4),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new me,this.morphComplete=new me,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=H.clone(H.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Di(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new Cb,this.fog=new K2,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(so.DEFAULT_VIEW_RECTANGLE=se.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new so(this),this.shadowMap=new xg({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=H.clone(H.WHITE),this._actualInvertClassificationColor=H.clone(this._invertClassificationColor),this._invertClassification=new hv,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new LB,this._brdfLutGenerator=new N2,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new zB(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,iu.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=nc.requestCompletedEvent.addEventListener(gG(this)),this._removeTaskProcessorListenerCallback=_i.taskCompletedEvent.addEventListener(gG(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new je(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new so(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new so(this),this.preloadFlightCullingVolume=void 0,this._picking=new dB(this),this._defaultView=new ZT(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Op,VCe(this,0,Z.now()),this.updateFrameState(),this.initializeFrame()}ci.defaultLogDepthBuffer=!0;function mbt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(gG(e))),n.push(t.terrainProviderChanged.addEventListener(gG(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(ci.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Nt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Nt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Yd.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,mbt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new so(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new X2(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Nt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});ci.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function pbt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function NCe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=rp.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=rp.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=rp.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=rp.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=xg.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===we.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}ci.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=o&&!u,g=c&&!f,m=(!o||!c)&&!d,x=n.pickingMetadata&&pbt(e,n);if(e.dirty=e.dirty||p||g||m||x,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:T}=i;b&&e.castShadows&&(t.shadows=xg.createCastDerivedCommand(T,e,s,r,t.shadows)),(u||p)&&(t.logDepth=rp.createLogDepthCommand(e,r,t.logDepth),NCe(this,t.logDepth.command,s)),(d||m)&&NCe(this,e,s)};var _bt=new yd({pass:Vo.RENDER}),hZ=new yd({pass:Vo.PRELOAD}),mZ=new yd({pass:Vo.PRELOAD_FLIGHT}),gbt=new yd({pass:Vo.REQUEST_RENDER_MODE_DEFER_CHECK}),FCe=new ae,pZ;function ybt(e){if(!(e._mode!==ne.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return FCe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,pZ=M2.fromBoundingSphere(FCe,e.camera.positionWC,pZ),pZ}ci.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function VCe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Z.clone(n,i.time)}ci.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=ybt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof rn||this.camera.frustum instanceof Fr),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=H.clone(this.invertClassificationColor,this._actualInvertClassificationColor),hv.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};ci.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===jt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var _G=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);_G=F.inverseTransformation(_G,_G);function xbt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(o.mode!==ne.SCENE3D){a=F.multiplyByPoint(_G,a,a);let m=o.mapProjection,x=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(x)}let c,u,{radius:f}=s;l(f)?(c=Qs.createGeometry(new Qs({radii:new h(f,f,f),vertexFormat:cn.FLAT_VERTEX_FORMAT})),u=F.fromTranslation(a)):(c=Ia.createGeometry(Ia.fromDimensions({dimensions:new h(2,2,2),vertexFormat:cn.FLAT_VERTEX_FORMAT})),u=F.fromRotationTranslation(s.halfAxes,a,new F)),t._debugVolume=new Dn({geometryInstances:new vt({geometry:Ln.toWireframe(c),modelMatrix:u,attributes:{color:new Wt(1,0,0,1)}}),appearance:new cn({flat:!0,translucent:!1}),asynchronous:!1});let d=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=rp.createLogDepthCommand(e,r).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(g)&&(n.framebuffer=g),o.commandList=d}function pp(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof Jn){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&xbt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function BCe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function UCe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function bbt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function Tbt(e,t,n,i,o){pg(i,UCe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function Cbt(e,t,n,i,o){pg(i,bbt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function Abt(e,t,n){e.context.uniformState.updatePass(we.VOXELS);let i=n.commands[we.VOXELS];i.length=n.indices[we.VOXELS],pg(i,UCe,e.camera.positionWC);for(let o=0;o<i.length;++o)pp(i[o],e,t)}var Ebt=new wi,Sbt=new gl,vbt=new rn,wbt=new Fr;function Dbt(e){let{frustum:t}=e;return l(t.fov)?t.clone(Ebt):l(t.infiniteProjectionMatrix)?t.clone(Sbt):l(t.width)?t.clone(vbt):t.clone(wbt)}function Ibt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?Tbt:Cbt}function Pbt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=Ibt(e);o.uniformState.updatePass(we.TRANSLUCENT);let f=n.commands[we.TRANSLUCENT];f.length=n.indices[we.TRANSLUCENT],u(e,pp,t,f,c)}function Rbt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[we.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[we.TRANSLUCENT];i.executeTranslucentCommands(e,pp,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,pp,t,n)}function gZ(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=Dbt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||Obt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:x,globeTranslucencyFramebuffer:b,sceneFramebuffer:T,frustumCommandsList:C}=e._view,A=C.length,E=e._globeTranslucencyState,v=e._depthClearCommand,D=e._stencilClearCommand,O=e._classificationStencilClearCommand,R=e._depthPlane,M=n.position.z;function N(S,w){r.updatePass(w);let I=S.commands[w],L=S.indices[w];for(let B=0;B<L;++B)pp(I[B],e,t);return L}function _(S,w){r.updatePass(w);let I=S.commands[w],L=S.indices[w];for(let B=0;B<L;++B)BCe(I[B],e,t)}for(let S=0;S<A;++S){let w=A-S-1,I=C[w];e.mode===ne.SCENE2D?(n.position.z=M-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=w!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&D.execute(i,t),E.translucent?(r.updatePass(we.GLOBE),E.executeGlobeCommands(I,pp,b,e,t)):N(I,we.GLOBE),p&&x.executeCopyDepth(i,t),f||(E.translucent?(r.updatePass(we.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(I,pp,b,e,t)):N(I,we.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let L;if(!g||c||f)L=N(I,we.CESIUM_3D_TILE),L>0&&(p&&(x.prepareColorTextures(i,u),x.executeUpdateDepth(i,t,x.depthStencilTexture)),f||(L=N(I,we.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let U=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,L=N(I,we.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),x.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),L=N(I,we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=U,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),L>0&&i.stencilBuffer&&O.execute(i,t),L=N(I,we.CESIUM_3D_TILE_CLASSIFICATION)}if(L>0&&i.stencilBuffer&&D.execute(i,t),Abt(e,t,I),N(I,we.OPAQUE),w!==0&&e.mode!==ne.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),Pbt(e,t,I),Rbt(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let U=e._picking.getPickDepth(e,w);U.update(i,x.depthStencilTexture),U.executeCopyDepth(i,t)}if(c||!m)continue;let B=t.framebuffer;t.framebuffer=T.getIdFramebuffer(),s.near=w!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),E.translucent?(r.updatePass(we.GLOBE),E.executeGlobeCommands(I,BCe,b,e,t)):_(I,we.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&d&&R.execute(i,t),_(I,we.CESIUM_3D_TILE),_(I,we.OPAQUE),_(I,we.TRANSLUCENT),t.framebuffer=B}}function Obt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(we.ENVIRONMENT),l(i.skyBoxCommand)&&pp(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&pp(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function zCe(e){e.context.uniformState.updatePass(we.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function Mbt(e,t){e.context.uniformState.updatePass(we.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function Lbt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[we.GLOBE,we.CESIUM_3D_TILE,we.OPAQUE,we.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=r[d].cullingVolume;if(e.isVisible(p,u))r[d].commandList.push(u),f=!0;else if(f)break}}}}function HCe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;Lbt(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:g}=d;s.updateCamera(p),c.updatePass(r,f);for(let m=0;m<g.length;++m){let x=g[m];s.updatePass(x.pass);let b=x.derivedCommands.shadows.castCommands[a];pp(b,e,d.passState)}}}}var Nbt=new h;ci.prototype.updateAndExecuteCommands=function(e,t){Xbt(this,e,t),this._environmentState.useWebVR?Fbt(this,e,t):this._frameState.mode!==ne.SCENE2D||this._mapMode2D===iu.ROTATE?U0(!0,this,e):jbt(this,e)};function Fbt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;GCe(e),n.createPotentiallyVisibleSet(e),zCe(e),r||HCe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=so.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*y(e.focalLength,5),f=y(e.eyeSeparation,u/30),d=h.multiplyByScalar(a.right,f*.5,Nbt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,gZ(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,gZ(e,t),so.clone(a,i)}var Bbt=new fe(Math.PI,P.PI_OVER_TWO),kbt=new h,Vbt=new h,Ubt=new F,zbt=new F,Hbt=new h,Gbt=new h,Wbt=new je;function jbt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=je.clone(r,Wbt);t.viewport=s;let a=Bbt,c=kbt;e.mapProjection.project(a,c);let f=h.clone(i.position,Vbt),d=F.clone(i.transform,zbt),p=i.frustum.clone();i._setTransform(F.IDENTITY);let g=F.computeViewportTransformation(s,0,1,Ubt),m=i.frustum.projectionMatrix,x=i.positionWC.y,b=h.fromElements(P.sign(x)*c.x-x,0,-i.positionWC.x,Hbt),T=Mt.pointToGLWindowCoordinates(m,g,b,Gbt);T.x=Math.floor(T.x);let C=s.x,A=s.width;if(x===0||T.x<=C||T.x>=C+A)U0(!0,e,t);else if(Math.abs(C+A*.5-T.x)<1)s.width=T.x-s.x,i.position.x*=P.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),U0(!0,e,t),s.x=T.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),U0(!1,e,t);else if(T.x>C+A*.5){s.width=T.x-C;let E=i.frustum.right;i.frustum.right=c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),U0(!0,e,t),s.x=T.x,s.width=C+A-T.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=E-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),U0(!1,e,t)}else{s.x=T.x,s.width=C+A-T.x;let E=i.frustum.left;i.frustum.left=-c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),U0(!0,e,t),s.x=C,s.width=T.x-C,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=E-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),U0(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function U0(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),GCe(t),i.createPotentiallyVisibleSet(t),e&&(zCe(t),o||HCe(t)),gZ(t,n)}var kCe=new _s;ci.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==ne.SCENE2D&&t.camera.frustum instanceof rn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(a_.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let T=r.dynamicLighting;s.setDynamicLighting(T),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let b=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(b)?b.drawCommand:void 0,n.sunComputeCommand=l(b)?b.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=u&&this.mode===ne.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!o;let d=e.mode===ne.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=kCe.planes;for(let b=0;b<5;++b)g[b]=p.planes[b];p=kCe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,x=this._specularEnvironmentCubeMap;l(m)&&x?.url!==m?(x=x&&x.destroy(),this._specularEnvironmentCubeMap=new Yd(m)):!l(m)&&l(x)&&(x.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function qbt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new op({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Ybt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===ne.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function GCe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),qbt(e),Ybt(e),e._globe&&e._globe.render(t)}function Xbt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new WB:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;H.clone(n,f.color),f.execute(i,t);let d=r.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),x=r.usePostProcess=m.ready,r.usePostProcessSelected=x&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let T;if(o.invertClassificationColor.alpha===1&&d&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let C=e._invertClassification.unclassifiedCommand,A=C.derivedCommands;A.oit=p.createDerivedCommands(C,i,A.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}ci.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?o.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=d;a&&!s&&(g=f);let m=this.postProcessStages,x=g.getColorTexture(0),b=p.getColorTexture(0),T=y(f,d).getDepthStencilTexture();m.execute(t,x,T,b),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function Kbt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function Zbt(e){if(e.mode===ne.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}ci.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===Ye.CLAMP_TO_TERRAIN||t===Ye.RELATIVE_TO_TERRAIN,i=t===Ye.CLAMP_TO_3D_TILE||t===Ye.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=this.primitives.length;for(let a=0;a<s;++a){let c=this.primitives.get(a);if(!c.isCesium3DTileset||!c.show||!c.enableCollision)continue;let u=c.getHeight(e,this);l(u)&&u>o&&(o=u)}}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var _Z=new fe;ci.prototype.updateHeight=function(e,t,n){let i=()=>{fe.clone(e,_Z);let g=this.getHeight(e,n);l(g)&&(_Z.height=g,t(_Z))},o=n===Ye.CLAMP_TO_TERRAIN||n===Ye.RELATIVE_TO_TERRAIN,r=n===Ye.CLAMP_TO_3D_TILE||n===Ye.RELATIVE_TO_3D_TILE,s;!r&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,i));let a={},c=this._ellipsoid,u=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,i,c);a[g.id]=m};if(!o){let g=this.primitives.length;for(let m=0;m<g;++m){let x=this.primitives.get(m);u(x)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(a[g.id])&&a[g.id](),delete a[g.id])});return()=>{s=s&&s(),Object.values(a).forEach(g=>g()),a={},f(),d()}};function $bt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===ne.SCENE2D||n===ne.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}ci.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=Zbt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=$bt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function Qbt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new _g({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function Jbt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function eTt(e){e.primitives.postPassesUpdate(e._frameState),nc.update()}var tTt=new H;function nTt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=_bt;let r=y(e.backgroundColor,H.BLACK);e._hdr&&(r=H.clone(r,tTt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof Op?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=je.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,Mbt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function hC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function iTt(e){return e._picking.updateMostDetailedRayPicks(e)}ci.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=Z.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(Z.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=Z.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=P.incrementWrap(t.frameNumber,15e6,1);VCe(this,o,e),t.newFrame=!0}hC(this,Jbt),this.primitives.show&&(hC(this,iTt),hC(this,oTt),hC(this,rTt),i||hC(this,sTt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),hC(this,nTt)),Qbt(this,i),hC(this,eTt),Kbt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};ci.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};ci.prototype.requestRender=function(){this._renderRequested=!0};ci.prototype.clampLineWidth=function(e){return Math.max(Nt.minimumAliasedLineWidth,Math.min(e,Nt.maximumAliasedLineWidth))};ci.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};ci.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof V0))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return YB.fromKeyframeNode(o,s,c,a)};ci.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=g3(s,t,n,i);if(!l(a))return;let c=x3(r,n,i);if(!l(c))return;let u=new y3(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};ci.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};ci.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};ci.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};ci.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function oTt(e){let t=e._frameState;hZ.camera=t.camera,hZ.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,hZ)}function rTt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;mZ.camera=e.preloadFlightCamera,mZ.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,mZ)}function sTt(e){e.primitives.updateForPass(e._frameState,gbt)}ci.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};ci.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};ci.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};ci.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};ci.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};ci.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};ci.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};ci.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};ci.prototype.cartesianToCanvasCoordinates=function(e,t){return zi.worldToWindowCoordinates(this,e,t)};ci.prototype.completeMorph=function(){this._transitioner.completeMorph()};ci.prototype.morphTo2D=function(e){e=y(e,2),this._transitioner.morphTo2D(e,this._ellipsoid)};ci.prototype.morphToColumbusView=function(e){e=y(e,2),this._transitioner.morphToColumbusView(e,this._ellipsoid)};ci.prototype.morphTo3D=function(e){e=y(e,2),this._transitioner.morphTo3D(e,this._ellipsoid)};function aTt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}ci.prototype.setTerrain=function(e){return aTt(this,e),e};ci.prototype.isDestroyed=function(){return!1};ci.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),ue(this)};var b3=ci;function Av(e){e=y(e,ee.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new Ze({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(Av.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Av.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var yZ=new F;Av.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,yZ),o=F.multiplyTransformation(i,Lo.Y_UP_TO_Z_UP,yZ),r=F.multiply(this._scaleMatrix,o,yZ);F.clone(r,this._modelMatrix);let s=e.context,a=cTt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Qs.createGeometry(new Qs({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Ie.POSITION_ONLY}));f.vertexArray=ei.fromGeometry({context:s,geometry:p,attributeLocations:Ln.createAttributeLocations(p),bufferUsage:Fe.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:un.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Ue({defines:p,sources:[Bd,uA,YP]}),m=new Ue({defines:p,sources:[Bd,uA,qP]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function cTt(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}Av.prototype.isDestroyed=function(){return!1};Av.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var T3=Av;function Sv(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new Ze({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}Sv.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==ne.SCENE3D&&i!==ne.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?gP(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}).catch(c=>{this._hasError=!0,this._error=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Cr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Ia.createGeometry(Ia.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Ie.POSITION_ONLY})),c=this._attributeLocations=Ln.createAttributeLocations(a);s.vertexArray=ei.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Fe.STATIC_DRAW}),s.renderState=Ve.fromCache({blending:un.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new Ue({defines:[t?"HDR":""],sources:[XP]});s.shaderProgram=Qt.fromCache({context:r,vertexShaderSource:KP,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};Sv.prototype.isDestroyed=function(){return!1};Sv.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};function Ev(e){return nn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}Sv.createEarthSkyBox=function(){return new Sv({sources:{positiveX:Ev("px"),negativeX:Ev("mx"),positiveY:Ev("py"),negativeY:Ev("my"),positiveZ:Ev("pz"),negativeZ:Ev("mz")}})};var C3=Sv;function E3(){this.show=!0,this._drawCommand=new Ze({primitiveType:Me.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(E3.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var lTt=new z,uTt=new z,fTt=new oe,A3=new oe;E3.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let E=Math.max(r,s);E=Math.pow(2,Math.ceil(Math.log(E)/Math.log(2))-2),E=Math.max(1,E);let v=n?o.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._texture=new Pt({context:o,width:E,height:E,pixelFormat:et.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let D=this,O={u_radiusTS:function(){return D._radiusTS}};this._commands.computeCommand=new kc({fragmentShaderSource:$P,outputTexture:this._texture,uniformMap:O,persists:!1,owner:this,postExecute:function(){D._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let E={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let D=gt.createVertexBuffer({context:o,typedArray:v,usage:Fe.STATIC_DRAW}),O=[{index:E.direction,vertexBuffer:D,componentsPerAttribute:2,normalize:!0,componentDatatype:X.UNSIGNED_BYTE}],R=gt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});a.vertexArray=new ei({context:o,attributes:O,indexBuffer:R}),a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:QP,fragmentShaderSource:ZP,attributeLocations:E}),a.renderState=Ve.fromCache({blending:un.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ne.SCENE3D?ae.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&ae.clone(d,a.boundingVolume);let p=zi.computeActualEllipsoidPosition(e,c,A3),g=h.magnitude(h.subtract(p,e.camera.position,A3)),m=o.uniformState.projection,x=fTt;x.x=0,x.y=0,x.z=-g,x.w=1;let b=F.multiplyByVector(m,x,A3),T=zi.clipToGLWindowCoordinates(t.viewport,b,lTt);x.x=P.SOLAR_RADIUS;let C=F.multiplyByVector(m,x,A3),A=zi.clipToGLWindowCoordinates(t.viewport,C,uTt);return this._size=z.magnitude(z.subtract(A,T,A3)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};E3.prototype.isDestroyed=function(){return!1};E3.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var S3=E3;var qCe=Ko(sV(),1);function dTt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); +}`});function FCe(){this.ready=!0,this.shape=Vi.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[ct.SCALAR],this.componentTypes=[kt.FLOAT32],this.maximumTileCount=1}FCe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};dp.DefaultProvider=new FCe;var N0=dp;function _bt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var r3=_bt;function gbt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var s3=gbt;function ybt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var a3=ybt;var mG=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function ci(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ge(e.contextOptions),r=l(n),s=new dP(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=zn(),this._jobScheduler=new B2,this._frameState=new N2(s,new E2(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new yw(s),this._ellipsoid=y(e.ellipsoid,ee.default),this._globe=void 0,this._globeTranslucencyState=new F2,this._primitives=new Yl,this._groundPrimitives=new Yl,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=ci.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new oC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new O2(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ei({color:new H,stencil:0,owner:this}),this._depthClearCommand=new ei({depth:1,owner:this}),this._stencilClearCommand=new ei({stencil:0}),this._classificationStencilClearCommand=new ei({stencil:0,renderState:Ve.fromCache({stencilMask:Vt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new SB(this),this._preUpdate=new pe,this._postUpdate=new pe,this._renderError=new pe,this._preRender=new pe,this._postRender=new pe,this._minimumDisableDepthTestDistance=0,this._debugInspector=new LB,this._msaaSamples=y(e.msaaSamples,4),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new pe,this.morphComplete=new pe,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=H.clone(H.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Pi(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new yb,this.fog=new L2,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(so.DEFAULT_VIEW_RECTANGLE=se.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new so(this),this.shadowMap=new yg({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=H.clone(H.WHITE),this._actualInvertClassificationColor=H.clone(this._invertClassificationColor),this._invertClassification=new fv,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new CB,this._brdfLutGenerator=new y2,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new IB(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,iu.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=ic.requestCompletedEvent.addEventListener(mG(this)),this._removeTaskProcessorListenerCallback=gi.taskCompletedEvent.addEventListener(mG(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new je(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new so(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new so(this),this.preloadFlightCullingVolume=void 0,this._picking=new J2(this),this._defaultView=new ZT(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Pp,zCe(this,0,Z.now()),this.updateFrameState(),this.initializeFrame()}ci.defaultLogDepthBuffer=!0;function xbt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(mG(e))),n.push(t.terrainProviderChanged.addEventListener(mG(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(ci.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Lt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Lt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return jd.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,xbt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new so(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new M2(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Lt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});ci.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function bbt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function BCe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=ip.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=ip.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=ip.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=ip.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=yg.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===we.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}ci.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=o&&!u,g=c&&!f,m=(!o||!c)&&!d,x=n.pickingMetadata&&bbt(e,n);if(e.dirty=e.dirty||p||g||m||x,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:T}=i;b&&e.castShadows&&(t.shadows=yg.createCastDerivedCommand(T,e,s,r,t.shadows)),(u||p)&&(t.logDepth=ip.createLogDepthCommand(e,r,t.logDepth),BCe(this,t.logDepth.command,s)),(d||m)&&BCe(this,e,s)};var Tbt=new gd({pass:Uo.RENDER}),mZ=new gd({pass:Uo.PRELOAD}),pZ=new gd({pass:Uo.PRELOAD_FLIGHT}),Cbt=new gd({pass:Uo.REQUEST_RENDER_MODE_DEFER_CHECK}),kCe=new ae,_Z;function Abt(e){if(!(e._mode!==ne.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return kCe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,_Z=p2.fromBoundingSphere(kCe,e.camera.positionWC,_Z),_Z}ci.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function zCe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Z.clone(n,i.time)}ci.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=Abt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof nn||this.camera.frustum instanceof Fr),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=H.clone(this.invertClassificationColor,this._actualInvertClassificationColor),fv.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};ci.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Wt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var hG=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);hG=F.inverseTransformation(hG,hG);function Ebt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(o.mode!==ne.SCENE3D){a=F.multiplyByPoint(hG,a,a);let m=o.mapProjection,x=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(x)}let c,u,{radius:f}=s;l(f)?(c=Qs.createGeometry(new Qs({radii:new h(f,f,f),vertexFormat:an.FLAT_VERTEX_FORMAT})),u=F.fromTranslation(a)):(c=Ra.createGeometry(Ra.fromDimensions({dimensions:new h(2,2,2),vertexFormat:an.FLAT_VERTEX_FORMAT})),u=F.fromRotationTranslation(s.halfAxes,a,new F)),t._debugVolume=new Dn({geometryInstances:new St({geometry:Ln.toWireframe(c),modelMatrix:u,attributes:{color:new Gt(1,0,0,1)}}),appearance:new an({flat:!0,translucent:!1}),asynchronous:!1});let d=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=ip.createLogDepthCommand(e,r).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(g)&&(n.framebuffer=g),o.commandList=d}function hp(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ei){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&Ebt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function VCe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function HCe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function Sbt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function vbt(e,t,n,i,o){mg(i,HCe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function wbt(e,t,n,i,o){mg(i,Sbt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function Dbt(e,t,n){e.context.uniformState.updatePass(we.VOXELS);let i=n.commands[we.VOXELS];i.length=n.indices[we.VOXELS],mg(i,HCe,e.camera.positionWC);for(let o=0;o<i.length;++o)hp(i[o],e,t)}var Ibt=new Ii,Pbt=new yl,Rbt=new nn,Obt=new Fr;function Mbt(e){let{frustum:t}=e;return l(t.fov)?t.clone(Ibt):l(t.infiniteProjectionMatrix)?t.clone(Pbt):l(t.width)?t.clone(Rbt):t.clone(Obt)}function Lbt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?vbt:wbt}function Nbt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=Lbt(e);o.uniformState.updatePass(we.TRANSLUCENT);let f=n.commands[we.TRANSLUCENT];f.length=n.indices[we.TRANSLUCENT],u(e,hp,t,f,c)}function Fbt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[we.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[we.TRANSLUCENT];i.executeTranslucentCommands(e,hp,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,hp,t,n)}function yZ(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=Mbt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||Bbt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:x,globeTranslucencyFramebuffer:b,sceneFramebuffer:T,frustumCommandsList:C}=e._view,A=C.length,E=e._globeTranslucencyState,v=e._depthClearCommand,D=e._stencilClearCommand,O=e._classificationStencilClearCommand,R=e._depthPlane,M=n.position.z;function N(S,w){r.updatePass(w);let I=S.commands[w],L=S.indices[w];for(let B=0;B<L;++B)hp(I[B],e,t);return L}function _(S,w){r.updatePass(w);let I=S.commands[w],L=S.indices[w];for(let B=0;B<L;++B)VCe(I[B],e,t)}for(let S=0;S<A;++S){let w=A-S-1,I=C[w];e.mode===ne.SCENE2D?(n.position.z=M-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=w!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&D.execute(i,t),E.translucent?(r.updatePass(we.GLOBE),E.executeGlobeCommands(I,hp,b,e,t)):N(I,we.GLOBE),p&&x.executeCopyDepth(i,t),f||(E.translucent?(r.updatePass(we.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(I,hp,b,e,t)):N(I,we.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let L;if(!g||c||f)L=N(I,we.CESIUM_3D_TILE),L>0&&(p&&(x.prepareColorTextures(i,u),x.executeUpdateDepth(i,t,x.depthStencilTexture)),f||(L=N(I,we.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let U=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,L=N(I,we.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),x.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),L=N(I,we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=U,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),L>0&&i.stencilBuffer&&O.execute(i,t),L=N(I,we.CESIUM_3D_TILE_CLASSIFICATION)}if(L>0&&i.stencilBuffer&&D.execute(i,t),Dbt(e,t,I),N(I,we.OPAQUE),w!==0&&e.mode!==ne.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),Nbt(e,t,I),Fbt(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let U=e._picking.getPickDepth(e,w);U.update(i,x.depthStencilTexture),U.executeCopyDepth(i,t)}if(c||!m)continue;let B=t.framebuffer;t.framebuffer=T.getIdFramebuffer(),s.near=w!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),E.translucent?(r.updatePass(we.GLOBE),E.executeGlobeCommands(I,VCe,b,e,t)):_(I,we.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&d&&R.execute(i,t),_(I,we.CESIUM_3D_TILE),_(I,we.OPAQUE),_(I,we.TRANSLUCENT),t.framebuffer=B}}function Bbt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(we.ENVIRONMENT),l(i.skyBoxCommand)&&hp(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&hp(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function GCe(e){e.context.uniformState.updatePass(we.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function kbt(e,t){e.context.uniformState.updatePass(we.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function Vbt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[we.GLOBE,we.CESIUM_3D_TILE,we.OPAQUE,we.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=r[d].cullingVolume;if(e.isVisible(p,u))r[d].commandList.push(u),f=!0;else if(f)break}}}}function WCe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;Vbt(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:g}=d;s.updateCamera(p),c.updatePass(r,f);for(let m=0;m<g.length;++m){let x=g[m];s.updatePass(x.pass);let b=x.derivedCommands.shadows.castCommands[a];hp(b,e,d.passState)}}}}var Ubt=new h;ci.prototype.updateAndExecuteCommands=function(e,t){Jbt(this,e,t),this._environmentState.useWebVR?zbt(this,e,t):this._frameState.mode!==ne.SCENE2D||this._mapMode2D===iu.ROTATE?F0(!0,this,e):Zbt(this,e)};function zbt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;jCe(e),n.createPotentiallyVisibleSet(e),GCe(e),r||WCe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=so.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*y(e.focalLength,5),f=y(e.eyeSeparation,u/30),d=h.multiplyByScalar(a.right,f*.5,Ubt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,yZ(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,yZ(e,t),so.clone(a,i)}var Hbt=new fe(Math.PI,P.PI_OVER_TWO),Gbt=new h,Wbt=new h,jbt=new F,qbt=new F,Ybt=new h,Xbt=new h,Kbt=new je;function Zbt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=je.clone(r,Kbt);t.viewport=s;let a=Hbt,c=Gbt;e.mapProjection.project(a,c);let f=h.clone(i.position,Wbt),d=F.clone(i.transform,qbt),p=i.frustum.clone();i._setTransform(F.IDENTITY);let g=F.computeViewportTransformation(s,0,1,jbt),m=i.frustum.projectionMatrix,x=i.positionWC.y,b=h.fromElements(P.sign(x)*c.x-x,0,-i.positionWC.x,Ybt),T=Ot.pointToGLWindowCoordinates(m,g,b,Xbt);T.x=Math.floor(T.x);let C=s.x,A=s.width;if(x===0||T.x<=C||T.x>=C+A)F0(!0,e,t);else if(Math.abs(C+A*.5-T.x)<1)s.width=T.x-s.x,i.position.x*=P.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),F0(!0,e,t),s.x=T.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),F0(!1,e,t);else if(T.x>C+A*.5){s.width=T.x-C;let E=i.frustum.right;i.frustum.right=c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),F0(!0,e,t),s.x=T.x,s.width=C+A-T.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=E-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),F0(!1,e,t)}else{s.x=T.x,s.width=C+A-T.x;let E=i.frustum.left;i.frustum.left=-c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),F0(!0,e,t),s.x=C,s.width=T.x-C,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=E-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),F0(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function F0(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),jCe(t),i.createPotentiallyVisibleSet(t),e&&(GCe(t),o||WCe(t)),yZ(t,n)}var UCe=new _s;ci.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==ne.SCENE2D&&t.camera.frustum instanceof nn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(r_.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let T=r.dynamicLighting;s.setDynamicLighting(T),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let b=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(b)?b.drawCommand:void 0,n.sunComputeCommand=l(b)?b.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=u&&this.mode===ne.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!o;let d=e.mode===ne.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=UCe.planes;for(let b=0;b<5;++b)g[b]=p.planes[b];p=UCe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,x=this._specularEnvironmentCubeMap;l(m)&&x?.url!==m?(x=x&&x.destroy(),this._specularEnvironmentCubeMap=new jd(m)):!l(m)&&l(x)&&(x.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function $bt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new np({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Qbt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===ne.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function jCe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),$bt(e),Qbt(e),e._globe&&e._globe.render(t)}function Jbt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new OB:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;H.clone(n,f.color),f.execute(i,t);let d=r.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),x=r.usePostProcess=m.ready,r.usePostProcessSelected=x&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let T;if(o.invertClassificationColor.alpha===1&&d&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let C=e._invertClassification.unclassifiedCommand,A=C.derivedCommands;A.oit=p.createDerivedCommands(C,i,A.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}ci.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?o.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=d;a&&!s&&(g=f);let m=this.postProcessStages,x=g.getColorTexture(0),b=p.getColorTexture(0),T=y(f,d).getDepthStencilTexture();m.execute(t,x,T,b),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function eTt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function tTt(e){if(e.mode===ne.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}ci.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===Ye.CLAMP_TO_TERRAIN||t===Ye.RELATIVE_TO_TERRAIN,i=t===Ye.CLAMP_TO_3D_TILE||t===Ye.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=this.primitives.length;for(let a=0;a<s;++a){let c=this.primitives.get(a);if(!c.isCesium3DTileset||!c.show||!c.enableCollision)continue;let u=c.getHeight(e,this);l(u)&&u>o&&(o=u)}}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var gZ=new fe;ci.prototype.updateHeight=function(e,t,n){let i=()=>{fe.clone(e,gZ);let g=this.getHeight(e,n);l(g)&&(gZ.height=g,t(gZ))},o=n===Ye.CLAMP_TO_TERRAIN||n===Ye.RELATIVE_TO_TERRAIN,r=n===Ye.CLAMP_TO_3D_TILE||n===Ye.RELATIVE_TO_3D_TILE,s;!r&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,i));let a={},c=this._ellipsoid,u=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,i,c);a[g.id]=m};if(!o){let g=this.primitives.length;for(let m=0;m<g;++m){let x=this.primitives.get(m);u(x)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(a[g.id])&&a[g.id](),delete a[g.id])});return()=>{s=s&&s(),Object.values(a).forEach(g=>g()),a={},f(),d()}};function nTt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===ne.SCENE2D||n===ne.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}ci.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=tTt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=nTt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function iTt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new pg({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function oTt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function rTt(e){e.primitives.postPassesUpdate(e._frameState),ic.update()}var sTt=new H;function aTt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Tbt;let r=y(e.backgroundColor,H.BLACK);e._hdr&&(r=H.clone(r,sTt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof Pp?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=je.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,kbt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function hC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function cTt(e){return e._picking.updateMostDetailedRayPicks(e)}ci.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=Z.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(Z.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=Z.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=P.incrementWrap(t.frameNumber,15e6,1);zCe(this,o,e),t.newFrame=!0}hC(this,oTt),this.primitives.show&&(hC(this,cTt),hC(this,lTt),hC(this,uTt),i||hC(this,fTt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),hC(this,aTt)),iTt(this,i),hC(this,rTt),eTt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};ci.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};ci.prototype.requestRender=function(){this._renderRequested=!0};ci.prototype.clampLineWidth=function(e){return Math.max(Lt.minimumAliasedLineWidth,Math.min(e,Lt.maximumAliasedLineWidth))};ci.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};ci.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof N0))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return NB.fromKeyframeNode(o,s,c,a)};ci.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=r3(s,t,n,i);if(!l(a))return;let c=a3(r,n,i);if(!l(c))return;let u=new s3(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};ci.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};ci.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};ci.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};ci.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function lTt(e){let t=e._frameState;mZ.camera=t.camera,mZ.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,mZ)}function uTt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;pZ.camera=e.preloadFlightCamera,pZ.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,pZ)}function fTt(e){e.primitives.updateForPass(e._frameState,Cbt)}ci.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};ci.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};ci.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};ci.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};ci.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};ci.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};ci.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};ci.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};ci.prototype.cartesianToCanvasCoordinates=function(e,t){return Hi.worldToWindowCoordinates(this,e,t)};ci.prototype.completeMorph=function(){this._transitioner.completeMorph()};ci.prototype.morphTo2D=function(e){e=y(e,2),this._transitioner.morphTo2D(e,this._ellipsoid)};ci.prototype.morphToColumbusView=function(e){e=y(e,2),this._transitioner.morphToColumbusView(e,this._ellipsoid)};ci.prototype.morphTo3D=function(e){e=y(e,2),this._transitioner.morphTo3D(e,this._ellipsoid)};function dTt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}ci.prototype.setTerrain=function(e){return dTt(this,e),e};ci.prototype.isDestroyed=function(){return!1};ci.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),ue(this)};var c3=ci;var Cv=`float interpolateByDistance(vec4 nearFarScalar, float distance) +{ + float startDistance = nearFarScalar.x; + float startValue = nearFarScalar.y; + float endDistance = nearFarScalar.z; + float endValue = nearFarScalar.w; + float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); + return mix(startValue, endValue, t); +} + +void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) +{ + float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; + + // Adjustment to the atmosphere radius applied based on the camera height. + float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; + float distanceAdjustMax = czm_ellipsoidRadii.x; + float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; + float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); + + // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit + // for the position on the ellipsoid. + float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; + float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; + + // Setup the primary ray: from the camera position to the vertex position. + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); + czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + + underTranslucentGlobe = 0.0; + + // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. + #if defined(GLOBE_TRANSLUCENT) + + // Check for intersection with the inner radius of the atmopshere. + czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); + if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { + + // Compute position on globe. + vec3 direction = normalize(positionWC); + czm_ray ellipsoidRay = czm_ray(positionWC, -direction); + czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); + vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); + + // Control the color using the camera angle. + float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); + + // Control the opacity using the distance from Earth. + opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); + vec3 horizonColor = vec3(0.1, 0.2, 0.3); + vec3 nearColor = vec3(0.0); + + rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); + + // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. + underTranslucentGlobe = 1.0; + return; + } + #endif + + computeScattering( + primaryRay, + length(cameraToPositionWC), + lightDirection, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); + + // Alter the opacity based on how close the viewer is to the ground. + // (0.0 = At edge of atmosphere, 1.0 = On ground) + float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; + float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; + opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); + + // Alter alpha based on time of day (0.0 = night , 1.0 = day) + float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; + opacity *= pow(nightAlpha, 0.5); +} +`;var l3=`in vec3 v_outerPositionWC; + +uniform vec3 u_hsbShift; + +#ifndef PER_FRAGMENT_ATMOSPHERE +in vec3 v_mieColor; +in vec3 v_rayleighColor; +in float v_opacity; +in float v_translucent; +#endif + +void main (void) +{ + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum); + + vec3 mieColor; + vec3 rayleighColor; + float opacity; + float translucent; + + #ifdef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + v_outerPositionWC, + lightDirection, + rayleighColor, + mieColor, + opacity, + translucent + ); + #else + mieColor = v_mieColor; + rayleighColor = v_rayleighColor; + opacity = v_opacity; + translucent = v_translucent; + #endif + + vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); + + #ifndef HDR + color.rgb = czm_pbrNeutralTonemapping(color.rgb); + color.rgb = czm_inverseGamma(color.rgb); + #endif + + #ifdef COLOR_CORRECT + const bool ignoreBlackPixels = true; + color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels); + #endif + + // For the parts of the sky atmosphere that are not behind a translucent globe, + // we mix in the default opacity so that the sky atmosphere still appears at distance. + // This is needed because the opacity in the sky atmosphere is initially adjusted based + // on the camera height. + if (translucent == 0.0) { + color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); + } + + out_FragColor = color; +} +`;var u3=`in vec4 position; + +out vec3 v_outerPositionWC; + +#ifndef PER_FRAGMENT_ATMOSPHERE +out vec3 v_mieColor; +out vec3 v_rayleighColor; +out float v_opacity; +out float v_translucent; +#endif + +void main(void) +{ + vec4 positionWC = czm_model * position; + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum); + + #ifndef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + positionWC.xyz, + lightDirection, + v_rayleighColor, + v_mieColor, + v_opacity, + v_translucent + ); + #endif + + v_outerPositionWC = positionWC.xyz; + gl_Position = czm_modelViewProjection * position; +} +`;function Av(e){e=y(e,ee.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new Ze({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(Av.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Av.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var xZ=new F;Av.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,xZ),o=F.multiplyTransformation(i,No.Y_UP_TO_Z_UP,xZ),r=F.multiply(this._scaleMatrix,o,xZ);F.clone(r,this._modelMatrix);let s=e.context,a=hTt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Qs.createGeometry(new Qs({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Ie.POSITION_ONLY}));f.vertexArray=ti.fromGeometry({context:s,geometry:p,attributeLocations:Ln.createAttributeLocations(p),bufferUsage:Fe.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:ln.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Ue({defines:p,sources:[eh,Cv,u3]}),m=new Ue({defines:p,sources:[eh,Cv,l3]});this._spSkyAtmosphere=$t.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function hTt(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}Av.prototype.isDestroyed=function(){return!1};Av.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var f3=Av;var d3=`uniform samplerCube u_cubeMap; + +in vec3 v_texCoord; + +void main() +{ + vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); + out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); +} +`;var h3=`in vec3 position; +out vec3 v_texCoord; + +void main() +{ + vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); + gl_Position = czm_projection * vec4(p, 1.0); + v_texCoord = position.xyz; +} +`;function Sv(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new Ze({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}Sv.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==ne.SCENE3D&&i!==ne.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?gP(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}).catch(c=>{this._hasError=!0,this._error=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Cr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Ra.createGeometry(Ra.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Ie.POSITION_ONLY})),c=this._attributeLocations=Ln.createAttributeLocations(a);s.vertexArray=ti.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Fe.STATIC_DRAW}),s.renderState=Ve.fromCache({blending:ln.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new Ue({defines:[t?"HDR":""],sources:[d3]});s.shaderProgram=$t.fromCache({context:r,vertexShaderSource:h3,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};Sv.prototype.isDestroyed=function(){return!1};Sv.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};function Ev(e){return en(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}Sv.createEarthSkyBox=function(){return new Sv({sources:{positiveX:Ev("px"),negativeX:Ev("mx"),positiveY:Ev("py"),negativeY:Ev("my"),positiveZ:Ev("pz"),negativeZ:Ev("mz")}})};var m3=Sv;var p3=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 color = texture(u_texture, v_textureCoordinates); + out_FragColor = czm_gammaCorrect(color); +} +`;var _3=`uniform float u_radiusTS; + +in vec2 v_textureCoordinates; + +vec2 rotate(vec2 p, vec2 direction) +{ + return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); +} + +vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +{ + vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); + float radius = length(rotatedPosition) * lengthScalar; + float burst = 1.0 - smoothstep(0.0, 0.55, radius); + return vec4(burst); +} + +void main() +{ + float lengthScalar = 2.0 / sqrt(2.0); + vec2 position = v_textureCoordinates - vec2(0.5); + float radius = length(position) * lengthScalar; + float surface = step(radius, u_radiusTS); + vec4 color = vec4(vec2(1.0), surface + 0.2, surface); + + float glow = 1.0 - smoothstep(0.0, 0.55, radius); + color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; + + vec4 burst = vec4(0.0); + + // The following loop has been manually unrolled for speed, to + // avoid sin() and cos(). + // + //for (float i = 0.4; i < 3.2; i += 1.047) { + // vec2 direction = vec2(sin(i), cos(i)); + // burst += 0.4 * addBurst(position, direction, lengthScalar); + // + // direction = vec2(sin(i - 0.08), cos(i - 0.08)); + // burst += 0.3 * addBurst(position, direction, lengthScalar); + //} + + burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 + burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 + burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 + + burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 + + // End of manual loop unrolling. + + color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; + + out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +} +`;var g3=`in vec2 direction; + +uniform float u_size; + +out vec2 v_textureCoordinates; + +void main() +{ + vec4 position; + if (czm_morphTime == 1.0) + { + position = vec4(czm_sunPositionWC, 1.0); + } + else + { + position = vec4(czm_sunPositionColumbusView.zxy, 1.0); + } + + vec4 positionEC = czm_view * position; + vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + + vec2 halfSize = vec2(u_size * 0.5); + halfSize *= ((direction * 2.0) - 1.0); + + gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); + + v_textureCoordinates = direction; +} +`;function x3(){this.show=!0,this._drawCommand=new Ze({primitiveType:Me.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(x3.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var mTt=new z,pTt=new z,_Tt=new oe,y3=new oe;x3.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let E=Math.max(r,s);E=Math.pow(2,Math.ceil(Math.log(E)/Math.log(2))-2),E=Math.max(1,E);let v=n?o.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._texture=new It({context:o,width:E,height:E,pixelFormat:et.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let D=this,O={u_radiusTS:function(){return D._radiusTS}};this._commands.computeCommand=new kc({fragmentShaderSource:_3,outputTexture:this._texture,uniformMap:O,persists:!1,owner:this,postExecute:function(){D._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let E={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let D=_t.createVertexBuffer({context:o,typedArray:v,usage:Fe.STATIC_DRAW}),O=[{index:E.direction,vertexBuffer:D,componentsPerAttribute:2,normalize:!0,componentDatatype:X.UNSIGNED_BYTE}],R=_t.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});a.vertexArray=new ti({context:o,attributes:O,indexBuffer:R}),a.shaderProgram=$t.fromCache({context:o,vertexShaderSource:g3,fragmentShaderSource:p3,attributeLocations:E}),a.renderState=Ve.fromCache({blending:ln.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===ne.SCENE3D?ae.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&ae.clone(d,a.boundingVolume);let p=Hi.computeActualEllipsoidPosition(e,c,y3),g=h.magnitude(h.subtract(p,e.camera.position,y3)),m=o.uniformState.projection,x=_Tt;x.x=0,x.y=0,x.z=-g,x.w=1;let b=F.multiplyByVector(m,x,y3),T=Hi.clipToGLWindowCoordinates(t.viewport,b,mTt);x.x=P.SOLAR_RADIUS;let C=F.multiplyByVector(m,x,y3),A=Hi.clipToGLWindowCoordinates(t.viewport,C,pTt);return this._size=z.magnitude(z.subtract(A,T,y3)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};x3.prototype.isDestroyed=function(){return!1};x3.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var b3=x3;var XCe=Zo(sV(),1);function gTt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); vec4 clippingPlanesEdgeColor = vec4(1.0); clippingPlanesEdgeColor.rgb = ${n}.rgb; float clippingPlanesEdgeWidth = ${n}.a; @@ -15788,7 +15351,7 @@ Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_ { out_FragColor = clippingPlanesEdgeColor; } -`}var v3=dTt;var hTt={modifyFragmentShader:function(t){return t=Ue.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +`}var T3=gTt;var yTt={modifyFragmentShader:function(t){return t=Ue.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; void main() { #ifndef SHADOW_MAP @@ -15797,9 +15360,9 @@ void main() #endif czm_splitter_main(); } -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},vv=hTt;var mC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function w3(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=H.clone(H.DARKGRAY),this._highlightColor=H.clone(H.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=mC.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,we.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.time=0,this.shadows=yn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,Br.NONE),this._splittingEnabled=!1,this._error=void 0,mTt(this,e)}Object.defineProperties(w3.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return H.clone(this._highlightColor)},set:function(e){this._highlightColor=H.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function mTt(e,t){let n=Pb.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=Kp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=mC.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=H.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var pTt=new h,_Tt=new h,gTt=new h,WCe,yG;function yTt(e){if(!l(yG)){WCe=new qCe.default(0),yG=new Array(e);for(let t=0;t<e;++t)yG[t]=WCe.random()}return yG}function xTt(e){let n=e.length/3,i=Math.min(n,20),o=yTt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,pTt),c=h.fromElements(s,s,s,_Tt);for(let f=0;f<i;++f){let d=Math.floor(o[f]*n),p=h.unpack(e,d*3,gTt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ae.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function jCe(e,t){let n=X.fromTypedArray(e);return n===X.INT||n===X.UNSIGNED_INT||n===X.DOUBLE?(yt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var bTt=new oe,TTt=new oe,CTt=new H,YCe=0,xG=1,AZ=2,XCe=3,ATt=4,xZ=new F,ETt=new F;function STt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,x=e._quantizedRange,b=e._octEncodedRange,T=e._isRGB565,C=e._isTranslucent,A=e._hasColors,E=e._hasNormals,v=e._hasBatchIds,D,O,R=[],M={};if(e._styleableShaderAttributes=M,f){let V=ATt;for(let G in u)if(u.hasOwnProperty(G)){let k=u[G],W=jCe(k.typedArray,G);D=k.componentCount,O=X.fromTypedArray(W);let j=gt.createVertexBuffer({context:n,typedArray:W,usage:Fe.STATIC_DRAW});e._geometryByteLength+=j.sizeInBytes;let J={index:V,vertexBuffer:j,componentsPerAttribute:D,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(J),M[G]={location:V,componentCount:D},++V}}let N=gt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Fe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let _;A&&(_=gt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let S;E&&(S=gt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=S.sizeInBytes);let w;v&&(c.typedArray=jCe(c.typedArray,"batchIds"),w=gt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let I=[];if(d?O=X.UNSIGNED_SHORT:p?O=x<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT:O=X.FLOAT,I.push({index:YCe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ae.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=xTt(r.typedArray)),A)if(T)I.push({index:xG,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:X.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=C?4:3;I.push({index:xG,vertexBuffer:_,componentsPerAttribute:V,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}E&&(g?(D=2,O=X.UNSIGNED_BYTE):m?(D=2,O=b<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT):(D=3,O=X.FLOAT),I.push({index:AZ,vertexBuffer:S,componentsPerAttribute:D,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&I.push({index:XCe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:X.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(R));let L=new ei({context:n,attributes:I}),B={depthTest:{enabled:!0}},U={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===we.CESIUM_3D_TILE&&(B.stencilTest=Ut.setCesium3DTileBit(),B.stencilMask=Ut.CESIUM_3D_TILE_MASK,U.stencilTest=Ut.setCesium3DTileBit(),U.stencilMask=Ut.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(B),e._translucentRenderState=Ve.fromCache(U),e._drawCommand=new Ze({boundingVolume:new ae,cull:e._cull,modelMatrix:new F,primitiveType:Me.POINTS,vertexArray:L,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:C?e._translucentRenderState:e._opaqueRenderState,pass:C?we.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function vTt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=bTt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof rn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return H.TRANSPARENT;let c=H.clone(a.edgeColor,CTt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return F.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);F.multiply(n.uniformState.view3D,c,xZ);let u=F.multiply(xZ,a.modelMatrix,xZ);return F.inverseTranspose(u,ETt)}};vv.addUniforms(e,s),(i||o||r)&&(s=bt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=TTt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function bZ(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function TZ(e,t){e=e.slice(e.indexOf(` -`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function CZ(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var wTt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function DTt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,x=e._hasNormals,b=e._hasBatchIds,T=e._backFaceCulling,C=e._normalShading,A=e._drawCommand.vertexArray,E=e.clippingPlanes,v=e._attenuation,D,O,R,M=g,N=Ge(wTt),_={},S=e._styleableShaderAttributes;for(o in S)S.hasOwnProperty(o)&&(r=S[o],N[o]=`czm_3dtiles_property_${r.location}`,_[r.location]=r);if(a){let ce={translucent:!1},_e="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";D=n.getColorShaderFunction(`getColorFromStyle${_e}`,N,ce),O=n.getShowShaderFunction(`getShowFromStyle${_e}`,N,ce),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${_e}`,N,ce),l(D)&&ce.translucent&&(M=!0)}e._styleTranslucent=M;let w=l(D),I=l(O),L=l(R),B=e.isClipped,U=[],V=[];w&&(bZ(D,U),TZ(D,V)),I&&(bZ(O,U),TZ(O,V)),L&&(bZ(R,U),TZ(R,V));let G=V.indexOf("COLOR")>=0,k=V.indexOf("NORMAL")>=0;if(k&&!x)throw new re("Style references the NORMAL semantic but the point cloud does not have normals");for(o in S)if(S.hasOwnProperty(o)){r=S[o];let ce=U.indexOf(r.location)>=0,_e=CZ(A,r.location);_e.enabled=ce}let W=m&&(!w||G);if(m){let ce=CZ(A,xG);ce.enabled=W}let j=x&&(C||T||k);if(x){let ce=CZ(A,AZ);ce.enabled=j}let J={a_position:YCe};W&&(J.a_color=xG),j&&(J.a_normal=AZ),b&&(J.a_batchId=XCe);let q="",K=U.length;for(i=0;i<K;++i){let ce=U[i];r=_[ce];let _e=r.componentCount,xe=`czm_3dtiles_property_${ce}`,De;_e===1?De="float":De=`vec${_e}`,q+=`in ${De} ${xe}; -`,J[xe]=r.location}vTt(e,t);let Q=`in vec3 a_position; +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},vv=yTt;var mC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function C3(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=H.clone(H.DARKGRAY),this._highlightColor=H.clone(H.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=mC.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,we.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.time=0,this.shadows=yn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,Br.NONE),this._splittingEnabled=!1,this._error=void 0,xTt(this,e)}Object.defineProperties(C3.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return H.clone(this._highlightColor)},set:function(e){this._highlightColor=H.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function xTt(e,t){let n=vb.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=Yp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=mC.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=H.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var bTt=new h,TTt=new h,CTt=new h,qCe,pG;function ATt(e){if(!l(pG)){qCe=new XCe.default(0),pG=new Array(e);for(let t=0;t<e;++t)pG[t]=qCe.random()}return pG}function ETt(e){let n=e.length/3,i=Math.min(n,20),o=ATt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,bTt),c=h.fromElements(s,s,s,TTt);for(let f=0;f<i;++f){let d=Math.floor(o[f]*n),p=h.unpack(e,d*3,CTt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ae.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function YCe(e,t){let n=X.fromTypedArray(e);return n===X.INT||n===X.UNSIGNED_INT||n===X.DOUBLE?(gt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var STt=new oe,vTt=new oe,wTt=new H,KCe=0,_G=1,EZ=2,ZCe=3,DTt=4,bZ=new F,ITt=new F;function PTt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,x=e._quantizedRange,b=e._octEncodedRange,T=e._isRGB565,C=e._isTranslucent,A=e._hasColors,E=e._hasNormals,v=e._hasBatchIds,D,O,R=[],M={};if(e._styleableShaderAttributes=M,f){let V=DTt;for(let G in u)if(u.hasOwnProperty(G)){let k=u[G],W=YCe(k.typedArray,G);D=k.componentCount,O=X.fromTypedArray(W);let q=_t.createVertexBuffer({context:n,typedArray:W,usage:Fe.STATIC_DRAW});e._geometryByteLength+=q.sizeInBytes;let J={index:V,vertexBuffer:q,componentsPerAttribute:D,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(J),M[G]={location:V,componentCount:D},++V}}let N=_t.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Fe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let _;A&&(_=_t.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let S;E&&(S=_t.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=S.sizeInBytes);let w;v&&(c.typedArray=YCe(c.typedArray,"batchIds"),w=_t.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let I=[];if(d?O=X.UNSIGNED_SHORT:p?O=x<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT:O=X.FLOAT,I.push({index:KCe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ae.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=ETt(r.typedArray)),A)if(T)I.push({index:_G,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:X.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=C?4:3;I.push({index:_G,vertexBuffer:_,componentsPerAttribute:V,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}E&&(g?(D=2,O=X.UNSIGNED_BYTE):m?(D=2,O=b<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT):(D=3,O=X.FLOAT),I.push({index:EZ,vertexBuffer:S,componentsPerAttribute:D,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&I.push({index:ZCe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:X.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(R));let L=new ti({context:n,attributes:I}),B={depthTest:{enabled:!0}},U={depthTest:{enabled:!0},depthMask:!1,blending:ln.ALPHA_BLEND};e._opaquePass===we.CESIUM_3D_TILE&&(B.stencilTest=Vt.setCesium3DTileBit(),B.stencilMask=Vt.CESIUM_3D_TILE_MASK,U.stencilTest=Vt.setCesium3DTileBit(),U.stencilMask=Vt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(B),e._translucentRenderState=Ve.fromCache(U),e._drawCommand=new Ze({boundingVolume:new ae,cull:e._cull,modelMatrix:new F,primitiveType:Me.POINTS,vertexArray:L,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:C?e._translucentRenderState:e._opaqueRenderState,pass:C?we.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function RTt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=STt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof nn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return H.TRANSPARENT;let c=H.clone(a.edgeColor,wTt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return F.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);F.multiply(n.uniformState.view3D,c,bZ);let u=F.multiply(bZ,a.modelMatrix,bZ);return F.inverseTranspose(u,ITt)}};vv.addUniforms(e,s),(i||o||r)&&(s=xt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=vTt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function TZ(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function CZ(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function AZ(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var OTt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function MTt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,x=e._hasNormals,b=e._hasBatchIds,T=e._backFaceCulling,C=e._normalShading,A=e._drawCommand.vertexArray,E=e.clippingPlanes,v=e._attenuation,D,O,R,M=g,N=Ge(OTt),_={},S=e._styleableShaderAttributes;for(o in S)S.hasOwnProperty(o)&&(r=S[o],N[o]=`czm_3dtiles_property_${r.location}`,_[r.location]=r);if(a){let ce={translucent:!1},ge="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";D=n.getColorShaderFunction(`getColorFromStyle${ge}`,N,ce),O=n.getShowShaderFunction(`getShowFromStyle${ge}`,N,ce),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ge}`,N,ce),l(D)&&ce.translucent&&(M=!0)}e._styleTranslucent=M;let w=l(D),I=l(O),L=l(R),B=e.isClipped,U=[],V=[];w&&(TZ(D,U),CZ(D,V)),I&&(TZ(O,U),CZ(O,V)),L&&(TZ(R,U),CZ(R,V));let G=V.indexOf("COLOR")>=0,k=V.indexOf("NORMAL")>=0;if(k&&!x)throw new re("Style references the NORMAL semantic but the point cloud does not have normals");for(o in S)if(S.hasOwnProperty(o)){r=S[o];let ce=U.indexOf(r.location)>=0,ge=AZ(A,r.location);ge.enabled=ce}let W=m&&(!w||G);if(m){let ce=AZ(A,_G);ce.enabled=W}let q=x&&(C||T||k);if(x){let ce=AZ(A,EZ);ce.enabled=q}let J={a_position:KCe};W&&(J.a_color=_G),q&&(J.a_normal=EZ),b&&(J.a_batchId=ZCe);let j="",K=U.length;for(i=0;i<K;++i){let ce=U[i];r=_[ce];let ge=r.componentCount,be=`czm_3dtiles_property_${ce}`,De;ge===1?De="float":De=`vec${ge}`,j+=`in ${De} ${be}; +`,J[be]=r.location}RTt(e,t);let Q=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; @@ -15808,7 +15371,7 @@ uniform vec4 u_highlightColor; float tiles3d_tileset_time; `,v&&(Q+=`float u_geometricError; float u_depthMultiplier; -`),Q+=q,W&&(g?Q+=`in vec4 a_color; +`),Q+=j,W&&(g?Q+=`in vec4 a_color; `:p?Q+=`in float a_color; const float SHIFT_RIGHT_11 = 1.0 / 2048.0; const float SHIFT_RIGHT_5 = 1.0 / 32.0; @@ -15817,7 +15380,7 @@ const float SHIFT_LEFT_5 = 32.0; const float NORMALIZE_6 = 1.0 / 64.0; const float NORMALIZE_5 = 1.0 / 32.0; `:Q+=`in vec3 a_color; -`),j&&(f||d?Q+=`in vec2 a_normal; +`),q&&(f||d?Q+=`in vec2 a_normal; `:Q+=`in vec3 a_normal; `),b&&(Q+=`in float a_batchId; `),(c||u||d)&&(Q+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; @@ -15841,7 +15404,7 @@ const float NORMALIZE_5 = 1.0 / 32.0; `,c||u?Q+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; `:Q+=` vec3 position = a_position; `,Q+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); -`,j?(f?Q+=` vec3 normal = czm_octDecode(a_normal); +`,q?(f?Q+=` vec3 normal = czm_octDecode(a_normal); `:d?Q+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; `:Q+=` vec3 normal = a_normal; `,Q+=` vec3 normalEC = czm_normal * normal; @@ -15854,12 +15417,12 @@ const float NORMALIZE_5 = 1.0 / 32.0; gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); `:Q+=` gl_PointSize = u_pointSize; `,Q+=` color = color * u_highlightColor; -`,j&&C&&(Q+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); +`,q&&C&&(Q+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); diffuseStrength = max(diffuseStrength, 0.4); color.xyz *= diffuseStrength * czm_lightColor; `),Q+=` v_color = color; gl_Position = czm_modelViewProjection * vec4(position, 1.0); -`,j&&T&&(Q+=` float visible = step(-normalEC.z, 0.0); +`,q&&T&&(Q+=` float visible = step(-normalEC.z, 0.0); gl_Position *= visible; gl_PointSize *= visible; `),I&&(Q+=` gl_Position.w *= float(show); @@ -15870,22 +15433,459 @@ const float NORMALIZE_5 = 1.0 / 32.0; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; `,de+=` -`,de+=lg(E,s),de+=` +`,de+=cg(E,s),de+=` `),de+=`void main() { out_FragColor = czm_gammaCorrect(v_color); -`,B&&(de+=v3("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),de+=`} -`,e.splitDirection!==Br.NONE&&(de=vv.modifyFragmentShader(de)),l(e._vertexShaderLoaded)&&(Q=e._vertexShaderLoaded(Q)),l(e._fragmentShaderLoaded)&&(de=e._fragmentShaderLoaded(de));let ye=e._drawCommand;l(ye.shaderProgram)&&ye.shaderProgram.destroy(),ye.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:Q,fragmentShaderSource:de,attributeLocations:J});try{ye.shaderProgram._bind()}catch{throw new re("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function ITt(e,t){if(e._decodingState===mC.READY)return!1;if(e._decodingState===mC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=n_.decodePointCloud(i,t);l(o)&&(e._decodingState=mC.DECODING,o.then(function(r){e._decodingState=mC.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,d=l(s)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(d){let b=r.POSITION.data.quantization,T=b.range;e._quantizedVolumeScale=h.fromElements(T,T,T),e._quantizedVolumeOffset=h.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let b in m)if(m.hasOwnProperty(b)){let T=r[b];l(g)||(g={}),g[b]={typedArray:T.array,componentCount:T.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(r){e._decodingState=mC.FAILED,e._error=r}))}return!0}var PTt=new oe,RTt=new h;w3.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(ITt(this,t))return;let i=!1,o=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(STt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){F.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,u),l(this._rtcCenter)&&F.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&F.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let d=e.mapProjection,p=F.getColumn(u,3,PTt);oe.equals(p,oe.UNIT_W)||Mt.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,f),this._cull){let d=f.center;F.multiplyByPoint(u,d,d);let p=F.getScale(u,RTt);f.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==Br.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&DTt(this,e,this._style),this._drawCommand.castShadows=yn.castShadows(this.shadows),this._drawCommand.receiveShadows=yn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?we.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};w3.prototype.isDestroyed=function(){return!1};w3.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var D3=w3;function _C(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.shadows=y(e.shadows,yn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new Am(e.shading),this.style=e.style,this.frameFailed=new me,this.frameChanged=new me,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new d_,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(_C.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function OTt(e){return`uniform vec4 czm_pickColor; -${e}`}function MTt(e){return function(t){return bt(t,{czm_pickColor:function(){return e._pickId.color}})}}function LTt(){return"czm_pickColor"}_C.prototype.makeStyleDirty=function(){this._styleDirty=!0};_C.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var NTt=new Z;function SZ(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function pC(e,t){return e._intervals.indexOf(t.start)}function FTt(e,t){let n=e._intervals,i=e._clock,o=SZ(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Z.addSeconds(i.currentTime,r*o,NTt),a=n.indexOf(s),c=pC(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function BTt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function kTt(e,t,n){let i=SZ(e),o=pC(e,t),r=pC(e,n);return i>=0?o>=r:o<=r}function ZCe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function VTt(e,t,n){let i=pC(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?F.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:bi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Se.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new D3({arrayBuffer:u,cull:!0,fragmentShaderLoaded:OTt,uniformMapLoaded:MTt(e),pickIdLoaded:LTt})}).catch(ZCe(e,c))}return r}function UTt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function zTt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if($Ce(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(bi()-t.timestamp)/1e3;UTt(e,a)}}t.touchedFrameNumber=i.frameNumber}var HTt=new F;function GTt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function WTt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var jTt=new Am;function $Ce(e,t,n,i){let o=y(e.shading,jTt),r=t.pointCloud,s=y(t.transform,F.IDENTITY);r.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,HTt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=GTt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=WTt(e);try{r.update(i)}catch(a){ZCe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function EZ(e,t,n,i){let o=VTt(e,t,i);zTt(e,o,n,i)}function qTt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function QCe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function YTt(e,t){let n=pC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function KCe(e,t,n,i,o){return l(n)?n.ready?!0:(EZ(e,t,i,o),n.ready):!1}function XTt(e,t,n,i,o){let r,s,a,c=e._intervals,u=e._frames,f=pC(e,n),d=pC(e,t);if(f>=d){for(r=f;r>=d;--r)if(s=c.get(r),a=u[r],KCe(e,s,a,i,o))return s}else for(r=f;r<=d;++r)if(s=c.get(r),a=u[r],KCe(e,s,a,i,o))return s;return t}function KTt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var wv={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};_C.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=Z.clone(e.time));let t=Math.max(Z.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&KTt(this,o,s),wv.timeSinceLoad=t,wv.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=BTt(this);if(!l(g))return;let m=!1,x=SZ(this),b=x===0;x!==this._clockMultiplier&&(m=!0,this._clockMultiplier=x),(!l(d)||b)&&(d=g),(!l(p)||m||kTt(this,g,p))&&(p=FTt(this,g)),d=XTt(this,d,g,wv,e);let T=YTt(this,d);l(T)||(EZ(this,d,wv,e),T=this._lastRenderedFrame),l(T)&&$Ce(this,T,wv,e),l(p)&&EZ(this,p,wv,e);let C=this;l(T)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(T)&&T!==this._lastRenderedFrame&&C.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return C.frameChanged.raiseEvent(C),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=T;let A=this._totalMemoryUsageInBytes,E=this.maximumMemoryUsage*1024*1024;A>E&&QCe(this,qTt(e));let D=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&D>0&&c.update(e,f,a,this.boundingSphere)};_C.prototype.isDestroyed=function(){return!1};_C.prototype.destroy=function(){return QCe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var Dv=_C;function JCe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function ZTt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function eAe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function tAe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=eAe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function nAe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Po(e,t){e=In(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Ht.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Ht.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?In(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?In(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),d=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new me,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new xh,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),tAe(this);try{let p=y(t.ellipsoid,ee.default),g=new b3({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=h.UNIT_Z,eAe(this),nAe(this);let m=t.globe;l(m)||(m=new v2(p)),m!==!1&&(g.globe=m,g.globe.shadows=y(t.terrainShadows,yn.RECEIVE_ONLY));let x=t.skyBox;!l(x)&&ee.WGS84.equals(p)&&(x=C3.createEarthSkyBox()),x!==!1&&(g.skyBox=x,g.sun=new S3,ee.WGS84.equals(p)&&(g.moon=new O2));let b=t.skyAtmosphere;!l(b)&&ee.WGS84.equals(p)&&(b=new T3(p),b.show=t.globe!==!1&&m.show),b!==!1&&(g.skyAtmosphere=b);let T=t.baseLayer;t.globe!==!1&&T!==!1&&(l(T)||(T=Wa.fromWorldImagery()),g.imageryLayers.add(T)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new of(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let C=this;this._onRenderError=function(R,M){C._useDefaultRenderLoop=!1,C._renderLoopRunning=!1,C._showRenderLoopErrors&&C.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,M)},g.renderError.addEventListener(this._onRenderError);let A=t.dataSources,E=!1;l(A)||(A=new MN,E=!0);let v=new gF({scene:g,dataSourceCollection:A}),D=new dr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=A,this._destroyDataSourceCollection=E,this._dataSourceDisplay=v,this._eventHelper=D,this._canAnimateUpdateCallback=this._updateCanAnimate,D.add(this._clock.onTick,Po.prototype._onTick,this),D.add(g.morphStart,Po.prototype._clearTrackedObject,this),D.add(A.dataSourceAdded,Po.prototype._onDataSourceAdded,this),D.add(A.dataSourceRemoved,Po.prototype._onDataSourceRemoved,this),D.add(g.postRender,Po.prototype._postRender,this);let O=A.length;for(let R=0;R<O;R++)this._dataSourceAdded(A,A.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),D.add(A.dataSourceAdded,Po.prototype._dataSourceAdded,this),D.add(A.dataSourceRemoved,Po.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Po.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&ZTt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,vZ(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(F.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,JCe(this.clock,e))}}});Po.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=Qm(n);u||(typeof n=="string"&&(n=new Error(n)),t=Qm({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} +`,B&&(de+=T3("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),de+=`} +`,e.splitDirection!==Br.NONE&&(de=vv.modifyFragmentShader(de)),l(e._vertexShaderLoaded)&&(Q=e._vertexShaderLoaded(Q)),l(e._fragmentShaderLoaded)&&(de=e._fragmentShaderLoaded(de));let xe=e._drawCommand;l(xe.shaderProgram)&&xe.shaderProgram.destroy(),xe.shaderProgram=$t.fromCache({context:s,vertexShaderSource:Q,fragmentShaderSource:de,attributeLocations:J});try{xe.shaderProgram._bind()}catch{throw new re("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function LTt(e,t){if(e._decodingState===mC.READY)return!1;if(e._decodingState===mC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=e_.decodePointCloud(i,t);l(o)&&(e._decodingState=mC.DECODING,o.then(function(r){e._decodingState=mC.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,d=l(s)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(d){let b=r.POSITION.data.quantization,T=b.range;e._quantizedVolumeScale=h.fromElements(T,T,T),e._quantizedVolumeOffset=h.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let b in m)if(m.hasOwnProperty(b)){let T=r[b];l(g)||(g={}),g[b]={typedArray:T.array,componentCount:T.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(r){e._decodingState=mC.FAILED,e._error=r}))}return!0}var NTt=new oe,FTt=new h;C3.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(LTt(this,t))return;let i=!1,o=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(PTt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){F.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,u),l(this._rtcCenter)&&F.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&F.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let d=e.mapProjection,p=F.getColumn(u,3,NTt);oe.equals(p,oe.UNIT_W)||Ot.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,f),this._cull){let d=f.center;F.multiplyByPoint(u,d,d);let p=F.getScale(u,FTt);f.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==Br.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&MTt(this,e,this._style),this._drawCommand.castShadows=yn.castShadows(this.shadows),this._drawCommand.receiveShadows=yn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?we.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};C3.prototype.isDestroyed=function(){return!1};C3.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var A3=C3;function _C(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.shadows=y(e.shadows,yn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new Cm(e.shading),this.style=e.style,this.frameFailed=new pe,this.frameChanged=new pe,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new u_,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(_C.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function BTt(e){return`uniform vec4 czm_pickColor; +${e}`}function kTt(e){return function(t){return xt(t,{czm_pickColor:function(){return e._pickId.color}})}}function VTt(){return"czm_pickColor"}_C.prototype.makeStyleDirty=function(){this._styleDirty=!0};_C.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var UTt=new Z;function vZ(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function pC(e,t){return e._intervals.indexOf(t.start)}function zTt(e,t){let n=e._intervals,i=e._clock,o=vZ(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Z.addSeconds(i.currentTime,r*o,UTt),a=n.indexOf(s),c=pC(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function HTt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function GTt(e,t,n){let i=vZ(e),o=pC(e,t),r=pC(e,n);return i>=0?o>=r:o<=r}function QCe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function WTt(e,t,n){let i=pC(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?F.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ti(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Se.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new A3({arrayBuffer:u,cull:!0,fragmentShaderLoaded:BTt,uniformMapLoaded:kTt(e),pickIdLoaded:VTt})}).catch(QCe(e,c))}return r}function jTt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function qTt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(JCe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ti()-t.timestamp)/1e3;jTt(e,a)}}t.touchedFrameNumber=i.frameNumber}var YTt=new F;function XTt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function KTt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var ZTt=new Cm;function JCe(e,t,n,i){let o=y(e.shading,ZTt),r=t.pointCloud,s=y(t.transform,F.IDENTITY);r.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,YTt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=XTt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=KTt(e);try{r.update(i)}catch(a){QCe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function SZ(e,t,n,i){let o=WTt(e,t,i);qTt(e,o,n,i)}function $Tt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function eAe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function QTt(e,t){let n=pC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function $Ce(e,t,n,i,o){return l(n)?n.ready?!0:(SZ(e,t,i,o),n.ready):!1}function JTt(e,t,n,i,o){let r,s,a,c=e._intervals,u=e._frames,f=pC(e,n),d=pC(e,t);if(f>=d){for(r=f;r>=d;--r)if(s=c.get(r),a=u[r],$Ce(e,s,a,i,o))return s}else for(r=f;r<=d;++r)if(s=c.get(r),a=u[r],$Ce(e,s,a,i,o))return s;return t}function eCt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var wv={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};_C.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=Z.clone(e.time));let t=Math.max(Z.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&eCt(this,o,s),wv.timeSinceLoad=t,wv.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=HTt(this);if(!l(g))return;let m=!1,x=vZ(this),b=x===0;x!==this._clockMultiplier&&(m=!0,this._clockMultiplier=x),(!l(d)||b)&&(d=g),(!l(p)||m||GTt(this,g,p))&&(p=zTt(this,g)),d=JTt(this,d,g,wv,e);let T=QTt(this,d);l(T)||(SZ(this,d,wv,e),T=this._lastRenderedFrame),l(T)&&JCe(this,T,wv,e),l(p)&&SZ(this,p,wv,e);let C=this;l(T)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(T)&&T!==this._lastRenderedFrame&&C.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return C.frameChanged.raiseEvent(C),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=T;let A=this._totalMemoryUsageInBytes,E=this.maximumMemoryUsage*1024*1024;A>E&&eAe(this,$Tt(e));let D=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&D>0&&c.update(e,f,a,this.boundingSphere)};_C.prototype.isDestroyed=function(){return!1};_C.prototype.destroy=function(){return eAe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var Dv=_C;function tAe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function tCt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function nAe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function iAe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=nAe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function oAe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Po(e,t){e=In(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=zt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=zt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?In(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?In(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),d=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new pe,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new yh,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),iAe(this);try{let p=y(t.ellipsoid,ee.default),g=new c3({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=h.UNIT_Z,nAe(this),oAe(this);let m=t.globe;l(m)||(m=new c2(p)),m!==!1&&(g.globe=m,g.globe.shadows=y(t.terrainShadows,yn.RECEIVE_ONLY));let x=t.skyBox;!l(x)&&ee.WGS84.equals(p)&&(x=m3.createEarthSkyBox()),x!==!1&&(g.skyBox=x,g.sun=new b3,ee.WGS84.equals(p)&&(g.moon=new m2));let b=t.skyAtmosphere;!l(b)&&ee.WGS84.equals(p)&&(b=new f3(p),b.show=t.globe!==!1&&m.show),b!==!1&&(g.skyAtmosphere=b);let T=t.baseLayer;t.globe!==!1&&T!==!1&&(l(T)||(T=qa.fromWorldImagery()),g.imageryLayers.add(T)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new of(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let C=this;this._onRenderError=function(R,M){C._useDefaultRenderLoop=!1,C._renderLoopRunning=!1,C._showRenderLoopErrors&&C.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,M)},g.renderError.addEventListener(this._onRenderError);let A=t.dataSources,E=!1;l(A)||(A=new dN,E=!0);let v=new ZN({scene:g,dataSourceCollection:A}),D=new hr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=A,this._destroyDataSourceCollection=E,this._dataSourceDisplay=v,this._eventHelper=D,this._canAnimateUpdateCallback=this._updateCanAnimate,D.add(this._clock.onTick,Po.prototype._onTick,this),D.add(g.morphStart,Po.prototype._clearTrackedObject,this),D.add(A.dataSourceAdded,Po.prototype._onDataSourceAdded,this),D.add(A.dataSourceRemoved,Po.prototype._onDataSourceRemoved,this),D.add(g.postRender,Po.prototype._postRender,this);let O=A.length;for(let R=0;R<O;R++)this._dataSourceAdded(A,A.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),D.add(A.dataSourceAdded,Po.prototype._dataSourceAdded,this),D.add(A.dataSourceRemoved,Po.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Po.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&tCt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,wZ(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(F.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,tAe(this.clock,e))}}});Po.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=Zm(n);u||(typeof n=="string"&&(n=new Error(n)),t=Zm({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} ${t} -${m}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),x.appendChild(b),x.onclick=function(T){x.removeChild(b),x.appendChild(document.createTextNode(m)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},d.appendChild(p),i.appendChild(o)};Po.prototype.isDestroyed=function(){return!1};Po.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Po.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,tAe(this),nAe(this),this._scene.requestRender())};Po.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Po.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Po.prototype._onEntityCollectionChanged,this)};Po.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Po.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Po.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var Iv=new ae;Po.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!0,Iv)===ct.DONE&&i.update(t,Iv)}};Po.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};Po.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Po.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&JCe(this.clock,e)};Po.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Po.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Po.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Po.prototype.zoomTo=function(e,t){return iAe(this,e,{offset:t},!1)};Po.prototype.flyTo=function(e,t){return iAe(this,e,t,!0)};function iAe(e,t,n,i){vZ(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof Wa){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return NT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof xs||r instanceof Dv||r instanceof V0){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function I3(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function vZ(e){let t=e._zoomPromise;l(t)&&(I3(e),e._completeZoom(!1))}Po.prototype._postRender=function(){$Tt(this),QTt(this)};function $Tt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){l(o.offset)||(o.offset=new ld(0,-.5,f.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),I3(e)}if(t instanceof Dv){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof xs||t instanceof V0){s(t.boundingSphere);return}if(t instanceof fe){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),I3(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,Iv);if(p===ct.PENDING)return;p!==ct.FAILED&&c.push(ae.clone(Iv))}if(c.length===0){vZ(e);return}e.trackedEntity=void 0;let u=ae.fromBoundingSpheres(c);e._zoomIsFlight?(I3(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(F.IDENTITY),I3(e),e._completeZoom(!0))}function QTt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=Y.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,Iv);if(r===ct.PENDING)return;let s=o.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ct.FAILED?Iv:void 0;e._entityView=new xF(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var P3=Po;function Ov(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var gC=new se;function JTt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}Ov.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)JTt(e,g,p,s)||s.push(new Pv(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,gC);let a=gC.west,c=gC.north;r.tileXYToRectangle(i,o,e,gC);let u=gC.east,f=gC.south,d=new oCt(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];wZ(g.extent,d)&&rCt(this._maximumLevel,g,d)}};Ov.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(Rv(i.extent,e)){t=i;break}}return l(t)?R3(void 0,t,e):-1};var eCt=[],tCt=[],nCt=new se,iCt=new se;Ov.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=eCt;t.length=0,e.east<e.west?(t.push(se.fromRadians(-Math.PI,e.south,e.east,e.north,nCt)),t.push(se.fromRadians(e.west,e.south,Math.PI,e.north,iCt))):t.push(e);let n=tCt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)O3(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var oAe=new fe;Ov.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,gC);return se.center(i,oAe),this.computeMaximumLevelAtPosition(oAe)>=e};Ov.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function Pv(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(Pv.prototype,{nw:{get:function(){return this._nw||(this._nw=new Pv(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new Pv(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new Pv(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new Pv(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function oCt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function wZ(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function rCt(e,t,n){for(;t.level<e;)if(bG(t.nw.extent,n))t=t.nw;else if(bG(t.ne.extent,n))t=t.ne;else if(bG(t.sw.extent,n))t=t.sw;else if(bG(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Oo(t.rectangles,n.level,sCt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function sCt(e,t){return e.level-t}function bG(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function Rv(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function R3(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&Rv(t._nw.extent,n),s=t._ne&&Rv(t._ne.extent,n),a=t._sw&&Rv(t._sw.extent,n),c=t._se&&Rv(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,R3(t,t._nw,n))),s&&(i=Math.max(i,R3(t,t._ne,n))),a&&(i=Math.max(i,R3(t,t._sw,n))),c&&(i=Math.max(i,R3(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];Rv(a,n)&&(i=a.level)}t=t.parent}return i}function O3(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||wZ(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=aCt(e[s.level],s)}O3(e,t._nw,n),O3(e,t._ne,n),O3(e,t._sw,n),O3(e,t._se,n)}function aCt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];wZ(o,t)?(o.west<t.west&&n.push(new se(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new se(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new se(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new se(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var jh=Ov;var cCt=15;function rAe(e){this.ellipsoid=y(e.ellipsoid,ee.default),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}rAe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function lCt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Tt(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=se.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Xi(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new z(r.xmin,r.ymin),s.rectangleNortheastInMeters=new z(r.xmax,r.ymax),e.tilingScheme=new as(s)}else throw new re("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new re("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?dd.LERC:dd.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new jh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new jh(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function uCt(e,t,n){try{let i=await t.fetchJson();lCt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function z0(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new me}Object.defineProperties(z0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});z0.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Se.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new rAe(t);await uCt(o,i);let r=new z0(t);return o.build(r),r._resource=n,r};z0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(DZ(this,n+1,e*2,t*2))){let d=sAe(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Ha({buffer:d[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):cCt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(a)&&a.state===Zn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Zn.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function DZ(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}z0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};z0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=DZ(this,n,e,t);if(l(i))return i;sAe(this,n,e,t)};z0.prototype.loadTileDataAvailability=function(e,t,n){};function fCt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new z(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new z(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let x=e.x;x<=p;++x)if(i[m+x]!==s){d=!0;break}d?(a.push(new z(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function dCt(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new z(0,0)];for(;a.length>0;){let c=a.pop(),u=fCt(c,n,i,o);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,r.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function sAe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new Zo({throttle:!1,throttleByServer:!0,type:ds.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=dCt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let m=e._tilesAvailable;for(let x=0;x<g.length;++x){let b=g[x];m.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return DZ(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var IZ=z0;var aAe="https://dev.virtualearth.net/REST/v1/Locations";function PZ(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Se({url:aAe,queryParameters:n}),this._credit=new Tt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(PZ.prototype,{url:{get:function(){return aAe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});PZ.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:se.fromDegrees(a,s,u,c)}})})};var RZ=PZ;function OZ(){}Object.defineProperties(OZ.prototype,{credit:{get:function(){}}});OZ.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:h.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var MZ=OZ;var hCt=new oe,cAe=new h,Mv=new h;function mCt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let u=(a-i)*o;return h.lerp(r,s,u,c)}}return function(i,o){l(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=hCt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return r===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,cAe),h.multiplyByScalar(d,.5,d),p=F.multiplyByVector(Dy.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],u=t[r+1],d=e.lastTangent,f=h.subtract(u,t[r-1],cAe),h.multiplyByScalar(f,.5,f),p=F.multiplyByVector(Dy.hermiteCoefficientMatrix,a,a)):(c=t[r-1],u=t[r],f=t[r+1],d=t[r+2],p=F.multiplyByVector(H0.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(u,p.y,Mv),h.add(o,Mv,o),h.multiplyByScalar(f,p.z,Mv),h.add(o,Mv,o),h.multiplyByScalar(d,p.w,Mv),h.add(o,Mv,o)}}var pCt=new h,_Ct=new h;function H0(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=pCt,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=_Ct,h.multiplyByScalar(t[r-1],2,o),h.subtract(t[r],o,o),h.add(o,t[r-2],o),h.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(o),this._evaluateFunction=mCt(this),this._lastTimeIndex=0}Object.defineProperties(H0.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});H0.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);H0.prototype.findTimeInterval=oo.prototype.findTimeInterval;H0.prototype.wrapTime=oo.prototype.wrapTime;H0.prototype.clampTime=oo.prototype.clampTime;H0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var LZ=H0;var TG={};TG.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let u=s+a+c,f,d,p,g,m,x;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(o-n),r.push(1),r.push(2),d!==1&&(r.push(-1),r.push(0),r.push(2),r.push(d)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(m=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(m)):!a&&i!==e?(x=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(f)):!c&&o!==e&&(d=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(d),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};TG.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let u=n-s,f=s-o,d=r-a,p=i-a,g=1/(d*u+f*p),m=t-a,x=e-s,b=(d*x+f*m)*g,T=(-p*x+u*m)*g,C=1-b-T;return l(c)?(c.x=b,c.y=T,c.z=C,c):new h(b,T,C)};TG.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),d=(a-r)*(n-e)-(s-o)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new z),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var vg=TG;function G0(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=AG(e.westIndices,o,t),this._southIndices=AG(e.southIndices,r,t),this._eastIndices=AG(e.eastIndices,o,t),this._northIndices=AG(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(G0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var CG=[];function AG(e,t,n){CG.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)CG[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(CG.sort(t),Ne.createTypedArray(n,CG)):e}var lAe="createVerticesFromQuantizedTerrainMesh",gCt=new _i(lAe),yCt=new _i(lAe,Nh.maximumAsynchronousTasks);G0.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),d=(a?yCt:gCt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,x=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Ne.createTypedArray(x,g.indices),T=new Float32Array(g.vertices),C=g.center,A=g.minimumHeight,E=g.maximumHeight,v=p._boundingSphere,D=p._orientedBoundingBox,O=y(h.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),R=g.vertexStride,M=wc.clone(g.encoding);return p._mesh=new md(C,T,b,g.indexCountWithoutSkirts,m,A,E,v,O,R,D,M,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var xCt=new _i("upsampleQuantizedTerrainMesh",Nh.maximumAsynchronousTasks);G0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=xCt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let m=c?g*.5:this._westSkirtHeight,x=u?g*.5:this._southSkirtHeight,b=c?this._eastSkirtHeight:g*.5,T=u?this._northSkirtHeight:g*.5,C=this._credits;return Promise.resolve(p).then(function(A){let E=new Uint16Array(A.vertices),v=Ne.createTypedArray(E.length/3,A.indices),D;return l(A.encodedNormals)&&(D=new Uint8Array(A.encodedNormals)),new G0({quantizedVertices:E,indices:v,encodedNormals:D,minimumHeight:A.minimumHeight,maximumHeight:A.maximumHeight,boundingSphere:ae.clone(A.boundingSphere),orientedBoundingBox:vn.clone(A.orientedBoundingBox),horizonOcclusionPoint:h.clone(A.horizonOcclusionPoint),westIndices:A.westIndices,southIndices:A.southIndices,eastIndices:A.eastIndices,northIndices:A.northIndices,westSkirtHeight:m,southSkirtHeight:x,eastSkirtHeight:b,northSkirtHeight:T,childTileMask:0,credits:C,createdByUpsampling:!0})})};var NZ=32767,uAe=new h;G0.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=NZ;let o=P.clamp((n-e.south)/e.height,0,1);return o*=NZ,l(this._mesh)?ACt(this,i,o):ECt(this,i,o)};function fAe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),d=Math.max(i,r,a);return e>=c&&e<=u&&t>=f&&t<=d}var bCt=new z,TCt=new z,CCt=new z;function ACt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=r.decodeTextureCoordinates(o,u,bCt),g=r.decodeTextureCoordinates(o,f,TCt),m=r.decodeTextureCoordinates(o,d,CCt);if(fAe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let x=vg.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,uAe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),T=r.decodeHeight(o,f),C=r.decodeHeight(o,d);return x.x*b+x.y*T+x.z*C}}}}function ECt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],m=i[d],x=o[u],b=o[f],T=o[d];if(fAe(t,n,p,x,g,b,m,T)){let C=vg.computeBarycentricCoordinates(t,n,p,x,g,b,m,T,uAe);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){let A=C.x*r[u]+C.y*r[f]+C.z*r[d];return P.lerp(e._minimumHeight,e._maximumHeight,A/NZ)}}}}G0.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};G0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var yC=G0;function SCt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function hAe(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=y(e.ellipsoid,ee.default),this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}hAe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function mAe(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new as({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}if(e.levelZeroMaximumGeometricError=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new jh(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let b=p[x],T=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let C=0;C<b.length;++C){let A=b[C],E=T-A.endY-1,v=T-A.startY-1;e.overallAvailability[x].push([A.startX,E,A.endX,v]),g.addAvailableTileRange(x,A.startX,E,A.endX,v)}}}else l(d)&&(f=new jh(e.tilingScheme,u),g=new jh(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new SCt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await kZ(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function vCt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return kZ(e,n);throw new re(i)}async function wCt(e,t,n){await mAe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new jh(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Tt(e.attribution);e.tileCredits.push(o)}return!0}async function kZ(e,t){try{let n=await e.layerJsonResource.fetchJson();return wCt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await mAe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):vCt(e,n,t)}}function qh(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new me;let t=e.credit;typeof t=="string"&&(t=new Tt(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var FZ={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function dAe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function DCt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Ha({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function ICt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,x=Uint16Array.BYTES_PER_ELEMENT,b=x*m,T=new DataView(t),C=new h(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0));a+=f;let A=T.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=T.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ae(new h(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0)),T.getFloat64(a+f,!0));a+=d;let D=new h(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0));a+=f;let O=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,O*3);a+=O*g,O>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,b=x*m);let M=R.subarray(0,O),N=R.subarray(O,2*O),_=R.subarray(O*2,3*O);Mn.zigZagDeltaDecode(M,N,_),a%x!==0&&(a+=x-a%x);let S=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=Ne.createTypedArrayFromArrayBuffer(O,t,a,S*m);a+=S*b;let I=0,L=w.length;for(let ce=0;ce<L;++ce){let _e=w[ce];w[ce]=I-_e,_e===0&&++I}let B=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let U=Ne.createTypedArrayFromArrayBuffer(O,t,a,B);a+=B*x;let V=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Ne.createTypedArrayFromArrayBuffer(O,t,a,V);a+=V*x;let k=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let W=Ne.createTypedArrayFromArrayBuffer(O,t,a,k);a+=k*x;let j=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=Ne.createTypedArrayFromArrayBuffer(O,t,a,j);a+=j*x;let q,K;for(;a<T.byteLength;){let ce=T.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let _e=T.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ce===FZ.OCT_VERTEX_NORMALS&&e._requestVertexNormals)q=new Uint8Array(t,a,O*2);else if(ce===FZ.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,a,_e);else if(ce===FZ.METADATA&&e._requestMetadata){let xe=T.getUint32(a,!0);if(xe>0){let Ae=No(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,xe).available;if(l(Ae))for(let ke=0;ke<Ae.length;++ke){let ze=n+ke+1,tt=Ae[ke],wt=e._tilingScheme.getNumberOfYTilesAtLevel(ze);for(let _t=0;_t<tt.length;++_t){let Be=tt[_t],Yt=wt-Be.endY-1,Et=wt-Be.startY-1;e.availability.addAvailableTileRange(ze,Be.startX,Yt,Be.endX,Et),r.availability.addAvailableTileRange(ze,Be.startX,Yt,Be.endX,Et)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=_e}let Q=e.getLevelMaximumGeometricError(n)*5,de=e._tilingScheme.tileXYToRectangle(i,o,n),ye=vn.fromRectangle(de,A,E,e._tilingScheme.ellipsoid);return new yC({center:C,minimumHeight:A,maximumHeight:E,boundingSphere:v,orientedBoundingBox:ye,horizonOcclusionPoint:D,quantizedVertices:R,encodedNormals:q,indices:w,westIndices:U,southIndices:G,eastIndices:W,northIndices:J,westSkirtHeight:Q,southSkirtHeight:Q,eastSkirtHeight:Q,northSkirtHeight:Q,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:K,credits:e._tileCredits})}qh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let d=VZ(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(r)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):pAe(this,e,t,n,r,i)};function pAe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new re("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=dAe(void 0)):u=dAe(c);let g=p.getDerivedResource({url:d,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?DCt(e,m,i,t,n):ICt(e,m,i,t,n,o):Promise.reject(new re("Mesh buffer doesn't exist."))})}Object.defineProperties(qh.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});qh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};qh.fromIonAssetId=async function(e,t){let n=await Cu.fromAssetId(e);return qh.fromUrl(n,t)};qh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Se.createIfNeeded(e);n.appendForwardSlash();let i=new hAe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await kZ(i);let o=new qh(t);return i.build(o),o};qh.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(VZ(this,e,t,n,i[r],r===0).result)return;return!1};qh.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=VZ(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function BZ(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function VZ(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,u=o.availability,f=BZ(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,d=o.availabilityPromiseCache[s],!l(d))){let p=new Zo({throttle:!1,throttleByServer:!0,type:ds.TERRAIN});d=pAe(e,f.x,f.y,f.level,o,p),l(d)&&(o.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=BZ(o,f.x,f.y,f.level)}return{result:!1}}qh._getAvailabilityTile=BZ;var xC=qh;function wg(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new ll(n),this._workerName="createCircleGeometry"}wg.packedLength=ll.packedLength;wg.pack=function(e,t,n){return ll.pack(e._ellipseGeometry,t,n)};var _Ae=new ll({center:new h,semiMajorAxis:1,semiMinorAxis:1}),qa={center:new h,radius:void 0,ellipsoid:ee.clone(ee.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Ie,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};wg.unpack=function(e,t,n){let i=ll.unpack(e,t,_Ae);return qa.center=h.clone(i._center,qa.center),qa.ellipsoid=ee.clone(i._ellipsoid,qa.ellipsoid),qa.ellipsoid=ee.clone(i._ellipsoid,_Ae._ellipsoid),qa.height=i._height,qa.extrudedHeight=i._extrudedHeight,qa.granularity=i._granularity,qa.vertexFormat=Ie.clone(i._vertexFormat,qa.vertexFormat),qa.stRotation=i._stRotation,qa.shadowVolume=i._shadowVolume,l(n)?(qa.semiMajorAxis=i._semiMajorAxis,qa.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new ll(qa),n):(qa.radius=i._semiMajorAxis,new wg(qa))};wg.createGeometry=function(e){return ll.createGeometry(e._ellipseGeometry)};wg.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new wg({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(wg.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var UZ=wg;function Lv(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new Hu(n),this._workerName="createCircleOutlineGeometry"}Lv.packedLength=Hu.packedLength;Lv.pack=function(e,t,n){return Hu.pack(e._ellipseGeometry,t,n)};var PCt=new Hu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),cf={center:new h,radius:void 0,ellipsoid:ee.clone(ee.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};Lv.unpack=function(e,t,n){let i=Hu.unpack(e,t,PCt);return cf.center=h.clone(i._center,cf.center),cf.ellipsoid=ee.clone(i._ellipsoid,cf.ellipsoid),cf.height=i._height,cf.extrudedHeight=i._extrudedHeight,cf.granularity=i._granularity,cf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(cf.semiMajorAxis=i._semiMajorAxis,cf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Hu(cf),n):(cf.radius=i._semiMajorAxis,new Lv(cf))};Lv.createGeometry=function(e){return Hu.createGeometry(e._ellipseGeometry)};var zZ=Lv;function Nv(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Xi({ellipsoid:y(e.ellipsoid,ee.default)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new me;let n=e.credit;typeof n=="string"&&(n=new Tt(n)),this._credit=n}Object.defineProperties(Nv.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Nv.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Ha({buffer:c,width:r,height:s})})};Nv.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Nv.prototype.getTileDataAvailable=function(e,t,n){};Nv.prototype.loadTileDataAvailability=function(e,t,n){};var HZ=Nv;function gAe(e){this.proxy=e}gAe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var GZ=gAe;var RCt={SEARCH:0,AUTOCOMPLETE:1},W0=Object.freeze(RCt);function EG(){he.throwInstantiationError()}Object.defineProperties(EG.prototype,{credit:{get:he.throwInstantiationError}});EG.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Tt.getIonCredit)};EG.prototype.geocode=he.throwInstantiationError;var Fv=EG;function yAe(){he.throwInstantiationError()}yAe.createGeometry=function(e){he.throwInstantiationError()};var WZ=yAe;var BCt=Ko(jZ(),1);function OCt(e,t){return(e&t)!==0}var Oc=OCt;var MCt=[1,2,4,8],xAe=15,LCt=16,NCt=64,FCt=128;function _p(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}_p.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new _p(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};_p.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};_p.prototype.hasSubtree=function(){return Oc(this._bits,LCt)};_p.prototype.hasImagery=function(){return Oc(this._bits,NCt)};_p.prototype.hasTerrain=function(){return Oc(this._bits,FCt)};_p.prototype.hasChildren=function(){return Oc(this._bits,xAe)};_p.prototype.hasChild=function(e){return Oc(this._bits,MCt[e])};_p.prototype.getChildBitmask=function(){return this._bits&xAe};var M3=_p;function kCt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var VCt=kCt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y +${m}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),x.appendChild(b),x.onclick=function(T){x.removeChild(b),x.appendChild(document.createTextNode(m)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},d.appendChild(p),i.appendChild(o)};Po.prototype.isDestroyed=function(){return!1};Po.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Po.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,iAe(this),oAe(this),this._scene.requestRender())};Po.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Po.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Po.prototype._onEntityCollectionChanged,this)};Po.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Po.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Po.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var Iv=new ae;Po.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!0,Iv)===at.DONE&&i.update(t,Iv)}};Po.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};Po.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Po.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&tAe(this.clock,e)};Po.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Po.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Po.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Po.prototype.zoomTo=function(e,t){return rAe(this,e,{offset:t},!1)};Po.prototype.flyTo=function(e,t){return rAe(this,e,t,!0)};function rAe(e,t,n,i){wZ(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof qa){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return NT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof xs||r instanceof Dv||r instanceof N0){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function E3(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function wZ(e){let t=e._zoomPromise;l(t)&&(E3(e),e._completeZoom(!1))}Po.prototype._postRender=function(){nCt(this),iCt(this)};function nCt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){l(o.offset)||(o.offset=new cd(0,-.5,f.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),E3(e)}if(t instanceof Dv){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof xs||t instanceof N0){s(t.boundingSphere);return}if(t instanceof fe){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),E3(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,Iv);if(p===at.PENDING)return;p!==at.FAILED&&c.push(ae.clone(Iv))}if(c.length===0){wZ(e);return}e.trackedEntity=void 0;let u=ae.fromBoundingSpheres(c);e._zoomIsFlight?(E3(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(F.IDENTITY),E3(e),e._completeZoom(!0))}function iCt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=Y.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,Iv);if(r===at.PENDING)return;let s=o.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==at.FAILED?Iv:void 0;e._entityView=new QN(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var S3=Po;var v3=`uniform sampler2D u_noiseTexture; +uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +in vec2 v_offset; +in vec3 v_maximumSize; +in vec4 v_color; +in float v_slice; +in float v_brightness; + +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); + } + return mod(value, rangeLength); +} + +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); +} + +vec2 voxelToUV(vec3 voxelIndex) { + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + + float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; + vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, + inverseNoiseTextureRows / textureSliceWidth); + vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); + float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); + float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); + + float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; + float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; + return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; +} + +// Interpolate a voxel with its neighbor (along the positive X-axis) +vec4 lerpSamplesX(vec3 voxelIndex, float x) { + vec2 uv0 = voxelToUV(voxelIndex); + vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); + vec4 sample0 = texture(u_noiseTexture, uv0); + vec4 sample1 = texture(u_noiseTexture, uv1); + return mix(sample0, sample1, x); +} + +vec4 sampleNoiseTexture(vec3 position) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); + vec3 lerpValue = fract(recenteredPos); + vec3 voxelIndex = floor(recenteredPos); + + vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); + vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); + vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); + vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); + + vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); + vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); + return mix(yLerp0, yLerp1, lerpValue.z); +} + +// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). +bool intersectSphere(vec3 origin, vec3 dir, float slice, + out vec3 point, out vec3 normal) { + float A = dot(dir, dir); + float B = dot(origin, dir); + float C = dot(origin, origin) - 0.25; + float discriminant = (B * B) - (A * C); + if(discriminant < 0.0) { + return false; + } + float root = sqrt(discriminant); + float t = (-B - root) / A; + if(t < 0.0) { + t = (-B + root) / A; + } + point = origin + t * dir; + + if(slice >= 0.0) { + point.z = (slice / 2.0) - 0.5; + if(length(point) > 0.5) { + return false; + } + } + + normal = normalize(point); + point -= czm_epsilon2 * normal; + return true; +} + +// Transforms the ray origin and direction into unit sphere space, +// then transforms the result back into the ellipsoid's space. +bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, + out vec3 point, out vec3 normal) { + if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { + return false; + } + + vec3 o = (origin - center) / scale; + vec3 d = dir / scale; + vec3 p, n; + bool intersected = intersectSphere(o, d, slice, p, n); + if(intersected) { + point = (p * scale) + center; + normal = n; + } + return intersected; +} + +// Assume that if phase shift is being called for octave i, +// the frequency is of i - 1. This saves us from doing extra +// division / multiplication operations. +vec2 phaseShift2D(vec2 p, vec2 freq) { + return (czm_pi / 2.0) * sin(freq.yx * p.yx); +} + +vec2 phaseShift3D(vec3 p, vec2 freq) { + return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); +} + +// The cloud texture function derived from Gardner's 1985 paper, +// "Visual Simulation of Clouds." +// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf +const float T0 = 0.6; // contrast of the texture pattern +const float k = 0.1; // computed to produce a maximum value of 1 +const float C0 = 0.8; // coefficient +const float FX0 = 0.6; // frequency X +const float FY0 = 0.6; // frequency Y +const int octaves = 5; + +float T(vec3 point) { + vec2 sum = vec2(0.0); + float Ci = C0; + vec2 FXY = vec2(FX0, FY0); + vec2 PXY = vec2(0.0); + for(int i = 1; i <= octaves; i++) { + PXY = phaseShift3D(point, FXY); + Ci *= 0.707; + FXY *= 2.0; + vec2 sinTerm = sin(FXY * point.xy + PXY); + sum += Ci * sinTerm + vec2(T0); + } + return k * sum.x * sum.y; +} + +const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, +const float t = 0.4; // fraction of texture shading +const float s = 0.25; // fraction of specular reflection + +float I(float Id, float Is, float It) { + return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; +} + +const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); + +vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, + float brightness) { + vec3 cloudPoint, cloudNormal; + if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, + cloudPoint, cloudNormal)) { + return vec4(0.0); + } + + float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection + float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection + float It = T(cloudPoint); // texture function + float intensity = I(Id, Is, It); + vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); + + vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); + float W = noise.x; + float W2 = noise.y; + float W3 = noise.z; + + // The dot product between the cloud's normal and the ray's direction is greatest + // in the center of the ellipsoid's surface. It decreases towards the edge. + // Thus, it is used to blur the areas leading to the edges of the ellipsoid, + // so that no harsh lines appear. + + // The first (and biggest) layer of worley noise is then subtracted from this. + // The final result is scaled up so that the base cloud is not too translucent. + float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); + float TR = pow(ndDot, 3.0) - W; // translucency + TR *= 1.3; + + // Subtracting the second and third layers of worley noise is more complicated. + // If these layers of noise were simply subtracted from the current translucency, + // the shape derived from the first layer of noise would be completely deleted. + // The erosion of this noise should thus be constricted to the edges of the cloud. + // However, because the edges of the ellipsoid were already blurred away, mapping + // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. + // The value of (0.5 - ndDot) provides the best compromise. + float minusDot = 0.5 - ndDot; + + // Even with the previous calculation, subtracting the second layer of wnoise + // erode too much of the cloud. The addition of it, however, will detailed + // volume to the cloud. As long as the noise is only added and not subtracted, + // the results are aesthetically pleasing. + + // The minusDot product is mapped in a way that it is larger at the edges of + // the ellipsoid, so a subtraction and min operation are used instead of + // an addition and max one. + TR -= min(minusDot * W2, 0.0); + + // The third level of worley noise is subtracted from the result, with some + // modifications. First, a scalar is added to minusDot so that the noise + // starts affecting the shape farther away from the center of the ellipsoid's + // surface. Then, it is scaled down so its impact is not too intense. + TR -= 0.8 * (minusDot + 0.25) * W3; + + // The texture function's shading does not correlate with the shape of the cloud + // produced by the layers of noise, so an extra shading scalar is calculated. + // The darkest areas of the cloud are assigned to be where the noise erodes + // the cloud the most. This is then interpolated based on the translucency + // and the diffuse shading term of that point in the cloud. + float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); + + // To avoid values that are too dark, this scalar is increased by a small amount + // and clamped so it never goes to zero. + shading = clamp(shading + 0.2, 0.3, 1.0); + + // Finally, the contrast of the cloud's color is increased. + vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); + return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; +} + +void main() { +#ifdef DEBUG_BILLBOARDS + out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); +#endif + // To avoid calculations with high values, + // we raycast from an arbitrarily smaller space. + vec2 coordinate = v_maximumSize.xy * v_offset; + + vec3 ellipsoidScale = 0.82 * v_maximumSize; + vec3 ellipsoidCenter = vec3(0.0); + + float zOffset = max(ellipsoidScale.z - 10.0, 0.0); + vec3 eye = vec3(0, 0, -10.0 - zOffset); + vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); + vec3 rayOrigin = eye; +#ifdef DEBUG_ELLIPSOIDS + vec3 point, normal; + if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, + point, normal)) { + out_FragColor = v_brightness * v_color; + } +#else +#ifndef DEBUG_BILLBOARDS + vec4 cloud = drawCloud(rayOrigin, rayDir, + ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); + if(cloud.w < 0.01) { + discard; + } + out_FragColor = cloud; +#endif +#endif +} +`;var w3=`#ifdef INSTANCED +in vec2 direction; +#endif +in vec4 positionHighAndScaleX; +in vec4 positionLowAndScaleY; +in vec4 packedAttribute0; +in vec4 packedAttribute1; +in vec4 color; + +out vec2 v_offset; +out vec3 v_maximumSize; +out vec4 v_color; +out float v_slice; +out float v_brightness; + +void main() { + // Unpack attributes. + vec3 positionHigh = positionHighAndScaleX.xyz; + vec3 positionLow = positionLowAndScaleY.xyz; + vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); + + float show = packedAttribute0.x; + float brightness = packedAttribute0.y; + vec2 coordinates = packedAttribute0.wz; + vec3 maximumSize = packedAttribute1.xyz; + float slice = packedAttribute1.w; + +#ifdef INSTANCED + vec2 dir = direction; +#else + vec2 dir = coordinates; +#endif + + vec2 offset = dir - vec2(0.5, 0.5); + vec2 scaledOffset = scale * offset; + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + positionEC.xy += scaledOffset; + + positionEC.xyz *= show; + gl_Position = czm_projection * positionEC; + + v_offset = offset; + v_maximumSize = maximumSize; + v_color = color; + v_slice = slice; + v_brightness = brightness; +} +`;var D3=`uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +uniform vec3 u_noiseOffset; +in vec2 v_position; + +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); + } + return mod(value, rangeLength); +} + +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); +} + +vec3 random3(vec3 p) { + float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); + float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); + return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); +} + +// Frequency corresponds to cell size. +// The higher the frequency, the smaller the cell size. +vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 cell = centerCell + offset; + cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); + cell += floor(u_noiseOffset / u_noiseDetail); + vec3 p = offset + random3(cell); + return p; +} + +float worleyNoise(vec3 p, float freq) { + vec3 centerCell = floor(p * freq); + vec3 pointInCell = fract(p * freq); + float shortestDistance = 1000.0; + + for(float z = -1.0; z <= 1.0; z++) { + for(float y = -1.0; y <= 1.0; y++) { + for(float x = -1.0; x <= 1.0; x++) { + vec3 offset = vec3(x, y, z); + vec3 point = getWorleyCellPoint(centerCell, offset, freq); + + float distance = length(pointInCell - point); + if(distance < shortestDistance) { + shortestDistance = distance; + } + } + } + } + + return shortestDistance; +} + +const float MAX_FBM_ITERATIONS = 10.0; + +float worleyFBMNoise(vec3 p, float octaves, float scale) { + float noise = 0.0; + float freq = 1.0; + float persistence = 0.625; + for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { + if(i >= octaves) { + break; + } + + noise += worleyNoise(p * scale, freq * scale) * persistence; + persistence *= 0.5; + freq *= 2.0; + } + return noise; +} + +void main() { + float textureSliceWidth = u_noiseTextureDimensions.x; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + float x = mod(v_position.x, textureSliceWidth); + float y = mod(v_position.y, textureSliceWidth); + float sliceRow = floor(v_position.y / textureSliceWidth); + float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; + + vec3 position = vec3(x, y, z); + position /= u_noiseDetail; + float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); + float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); + float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); + out_FragColor = vec4(worley0, worley1, worley2, 1.0); +} +`;var I3=`uniform vec3 u_noiseTextureDimensions; +in vec2 position; + +out vec2 v_position; + +void main() +{ + gl_Position = vec4(position, 0.1, 1.0); + + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + vec2 transformedPos = (position * 0.5) + vec2(0.5); + transformedPos *= textureSliceWidth; + transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; + transformedPos.y *= noiseTextureRows; + v_position = transformedPos; +} +`;var P3=` +in vec2 v_textureCoordinates; + +void main() +{ + czm_materialInput materialInput; + + materialInput.s = v_textureCoordinates.s; + materialInput.st = v_textureCoordinates; + materialInput.str = vec3(v_textureCoordinates, 0.0); + materialInput.normalEC = vec3(0.0, 0.0, -1.0); + + czm_material material = czm_getMaterial(materialInput); + + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +} +`;function Ov(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var gC=new se;function oCt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}Ov.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)oCt(e,g,p,s)||s.push(new Pv(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,gC);let a=gC.west,c=gC.north;r.tileXYToRectangle(i,o,e,gC);let u=gC.east,f=gC.south,d=new lCt(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];DZ(g.extent,d)&&uCt(this._maximumLevel,g,d)}};Ov.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(Rv(i.extent,e)){t=i;break}}return l(t)?R3(void 0,t,e):-1};var rCt=[],sCt=[],aCt=new se,cCt=new se;Ov.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=rCt;t.length=0,e.east<e.west?(t.push(se.fromRadians(-Math.PI,e.south,e.east,e.north,aCt)),t.push(se.fromRadians(e.west,e.south,Math.PI,e.north,cCt))):t.push(e);let n=sCt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)O3(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var sAe=new fe;Ov.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,gC);return se.center(i,sAe),this.computeMaximumLevelAtPosition(sAe)>=e};Ov.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function Pv(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(Pv.prototype,{nw:{get:function(){return this._nw||(this._nw=new Pv(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new Pv(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new Pv(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new Pv(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function lCt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function DZ(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function uCt(e,t,n){for(;t.level<e;)if(gG(t.nw.extent,n))t=t.nw;else if(gG(t.ne.extent,n))t=t.ne;else if(gG(t.sw.extent,n))t=t.sw;else if(gG(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Mo(t.rectangles,n.level,fCt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function fCt(e,t){return e.level-t}function gG(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function Rv(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function R3(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&Rv(t._nw.extent,n),s=t._ne&&Rv(t._ne.extent,n),a=t._sw&&Rv(t._sw.extent,n),c=t._se&&Rv(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,R3(t,t._nw,n))),s&&(i=Math.max(i,R3(t,t._ne,n))),a&&(i=Math.max(i,R3(t,t._sw,n))),c&&(i=Math.max(i,R3(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];Rv(a,n)&&(i=a.level)}t=t.parent}return i}function O3(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||DZ(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=dCt(e[s.level],s)}O3(e,t._nw,n),O3(e,t._ne,n),O3(e,t._sw,n),O3(e,t._se,n)}function dCt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];DZ(o,t)?(o.west<t.west&&n.push(new se(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new se(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new se(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new se(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Wh=Ov;var hCt=15;function aAe(e){this.ellipsoid=y(e.ellipsoid,ee.default),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}aAe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function mCt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new bt(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=se.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Xi(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new z(r.xmin,r.ymin),s.rectangleNortheastInMeters=new z(r.xmax,r.ymax),e.tilingScheme=new as(s)}else throw new re("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new re("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?fd.LERC:fd.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Wh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Wh(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function pCt(e,t,n){try{let i=await t.fetchJson();mCt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function B0(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new pe}Object.defineProperties(B0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});B0.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Se.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new aAe(t);await pCt(o,i);let r=new B0(t);return o.build(r),r._resource=n,r};B0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(IZ(this,n+1,e*2,t*2))){let d=cAe(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Wa({buffer:d[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):hCt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(a)&&a.state===Zn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Zn.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function IZ(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}B0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};B0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=IZ(this,n,e,t);if(l(i))return i;cAe(this,n,e,t)};B0.prototype.loadTileDataAvailability=function(e,t,n){};function _Ct(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new z(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new z(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let x=e.x;x<=p;++x)if(i[m+x]!==s){d=!0;break}d?(a.push(new z(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function gCt(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new z(0,0)];for(;a.length>0;){let c=a.pop(),u=_Ct(c,n,i,o);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,r.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function cAe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new $o({throttle:!1,throttleByServer:!0,type:ds.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=gCt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let m=e._tilesAvailable;for(let x=0;x<g.length;++x){let b=g[x];m.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return IZ(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var PZ=B0;var lAe="https://dev.virtualearth.net/REST/v1/Locations";function RZ(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Se({url:lAe,queryParameters:n}),this._credit=new bt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(RZ.prototype,{url:{get:function(){return lAe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});RZ.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:se.fromDegrees(a,s,u,c)}})})};var OZ=RZ;function MZ(){}Object.defineProperties(MZ.prototype,{credit:{get:function(){}}});MZ.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:h.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var LZ=MZ;var yCt=new oe,uAe=new h,Mv=new h;function xCt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let u=(a-i)*o;return h.lerp(r,s,u,c)}}return function(i,o){l(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=yCt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return r===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,uAe),h.multiplyByScalar(d,.5,d),p=F.multiplyByVector(vy.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],u=t[r+1],d=e.lastTangent,f=h.subtract(u,t[r-1],uAe),h.multiplyByScalar(f,.5,f),p=F.multiplyByVector(vy.hermiteCoefficientMatrix,a,a)):(c=t[r-1],u=t[r],f=t[r+1],d=t[r+2],p=F.multiplyByVector(k0.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(u,p.y,Mv),h.add(o,Mv,o),h.multiplyByScalar(f,p.z,Mv),h.add(o,Mv,o),h.multiplyByScalar(d,p.w,Mv),h.add(o,Mv,o)}}var bCt=new h,TCt=new h;function k0(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=bCt,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=TCt,h.multiplyByScalar(t[r-1],2,o),h.subtract(t[r],o,o),h.add(o,t[r-2],o),h.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(o),this._evaluateFunction=xCt(this),this._lastTimeIndex=0}Object.defineProperties(k0.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});k0.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);k0.prototype.findTimeInterval=oo.prototype.findTimeInterval;k0.prototype.wrapTime=oo.prototype.wrapTime;k0.prototype.clampTime=oo.prototype.clampTime;k0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var NZ=k0;var yG={};yG.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let u=s+a+c,f,d,p,g,m,x;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(o-n),r.push(1),r.push(2),d!==1&&(r.push(-1),r.push(0),r.push(2),r.push(d)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(m=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(m)):!a&&i!==e?(x=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(f)):!c&&o!==e&&(d=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(d),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};yG.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let u=n-s,f=s-o,d=r-a,p=i-a,g=1/(d*u+f*p),m=t-a,x=e-s,b=(d*x+f*m)*g,T=(-p*x+u*m)*g,C=1-b-T;return l(c)?(c.x=b,c.y=T,c.z=C,c):new h(b,T,C)};yG.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),d=(a-r)*(n-e)-(s-o)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new z),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Sg=yG;function V0(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=bG(e.westIndices,o,t),this._southIndices=bG(e.southIndices,r,t),this._eastIndices=bG(e.eastIndices,o,t),this._northIndices=bG(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(V0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var xG=[];function bG(e,t,n){xG.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)xG[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(xG.sort(t),Ne.createTypedArray(n,xG)):e}var fAe="createVerticesFromQuantizedTerrainMesh",CCt=new gi(fAe),ACt=new gi(fAe,Lh.maximumAsynchronousTasks);V0.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),d=(a?ACt:CCt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,x=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Ne.createTypedArray(x,g.indices),T=new Float32Array(g.vertices),C=g.center,A=g.minimumHeight,E=g.maximumHeight,v=p._boundingSphere,D=p._orientedBoundingBox,O=y(h.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),R=g.vertexStride,M=wc.clone(g.encoding);return p._mesh=new hd(C,T,b,g.indexCountWithoutSkirts,m,A,E,v,O,R,D,M,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var ECt=new gi("upsampleQuantizedTerrainMesh",Lh.maximumAsynchronousTasks);V0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=ECt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let m=c?g*.5:this._westSkirtHeight,x=u?g*.5:this._southSkirtHeight,b=c?this._eastSkirtHeight:g*.5,T=u?this._northSkirtHeight:g*.5,C=this._credits;return Promise.resolve(p).then(function(A){let E=new Uint16Array(A.vertices),v=Ne.createTypedArray(E.length/3,A.indices),D;return l(A.encodedNormals)&&(D=new Uint8Array(A.encodedNormals)),new V0({quantizedVertices:E,indices:v,encodedNormals:D,minimumHeight:A.minimumHeight,maximumHeight:A.maximumHeight,boundingSphere:ae.clone(A.boundingSphere),orientedBoundingBox:vn.clone(A.orientedBoundingBox),horizonOcclusionPoint:h.clone(A.horizonOcclusionPoint),westIndices:A.westIndices,southIndices:A.southIndices,eastIndices:A.eastIndices,northIndices:A.northIndices,westSkirtHeight:m,southSkirtHeight:x,eastSkirtHeight:b,northSkirtHeight:T,childTileMask:0,credits:C,createdByUpsampling:!0})})};var FZ=32767,dAe=new h;V0.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=FZ;let o=P.clamp((n-e.south)/e.height,0,1);return o*=FZ,l(this._mesh)?DCt(this,i,o):ICt(this,i,o)};function hAe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),d=Math.max(i,r,a);return e>=c&&e<=u&&t>=f&&t<=d}var SCt=new z,vCt=new z,wCt=new z;function DCt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=r.decodeTextureCoordinates(o,u,SCt),g=r.decodeTextureCoordinates(o,f,vCt),m=r.decodeTextureCoordinates(o,d,wCt);if(hAe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let x=Sg.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,dAe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),T=r.decodeHeight(o,f),C=r.decodeHeight(o,d);return x.x*b+x.y*T+x.z*C}}}}function ICt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],m=i[d],x=o[u],b=o[f],T=o[d];if(hAe(t,n,p,x,g,b,m,T)){let C=Sg.computeBarycentricCoordinates(t,n,p,x,g,b,m,T,dAe);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){let A=C.x*r[u]+C.y*r[f]+C.z*r[d];return P.lerp(e._minimumHeight,e._maximumHeight,A/FZ)}}}}V0.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};V0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var yC=V0;function PCt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function pAe(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=y(e.ellipsoid,ee.default),this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}pAe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function _Ae(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new as({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}if(e.levelZeroMaximumGeometricError=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new Wh(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let b=p[x],T=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let C=0;C<b.length;++C){let A=b[C],E=T-A.endY-1,v=T-A.startY-1;e.overallAvailability[x].push([A.startX,E,A.endX,v]),g.addAvailableTileRange(x,A.startX,E,A.endX,v)}}}else l(d)&&(f=new Wh(e.tilingScheme,u),g=new Wh(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new PCt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await VZ(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function RCt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return VZ(e,n);throw new re(i)}async function OCt(e,t,n){await _Ae(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Wh(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new bt(e.attribution);e.tileCredits.push(o)}return!0}async function VZ(e,t){try{let n=await e.layerJsonResource.fetchJson();return OCt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await _Ae(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):RCt(e,n,t)}}function jh(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new pe;let t=e.credit;typeof t=="string"&&(t=new bt(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var BZ={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function mAe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function MCt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Wa({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function LCt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,x=Uint16Array.BYTES_PER_ELEMENT,b=x*m,T=new DataView(t),C=new h(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0));a+=f;let A=T.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=T.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ae(new h(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0)),T.getFloat64(a+f,!0));a+=d;let D=new h(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0));a+=f;let O=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,O*3);a+=O*g,O>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,b=x*m);let M=R.subarray(0,O),N=R.subarray(O,2*O),_=R.subarray(O*2,3*O);Mn.zigZagDeltaDecode(M,N,_),a%x!==0&&(a+=x-a%x);let S=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=Ne.createTypedArrayFromArrayBuffer(O,t,a,S*m);a+=S*b;let I=0,L=w.length;for(let ce=0;ce<L;++ce){let ge=w[ce];w[ce]=I-ge,ge===0&&++I}let B=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let U=Ne.createTypedArrayFromArrayBuffer(O,t,a,B);a+=B*x;let V=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Ne.createTypedArrayFromArrayBuffer(O,t,a,V);a+=V*x;let k=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let W=Ne.createTypedArrayFromArrayBuffer(O,t,a,k);a+=k*x;let q=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=Ne.createTypedArrayFromArrayBuffer(O,t,a,q);a+=q*x;let j,K;for(;a<T.byteLength;){let ce=T.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ge=T.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ce===BZ.OCT_VERTEX_NORMALS&&e._requestVertexNormals)j=new Uint8Array(t,a,O*2);else if(ce===BZ.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,a,ge);else if(ce===BZ.METADATA&&e._requestMetadata){let be=T.getUint32(a,!0);if(be>0){let Ae=Fo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,be).available;if(l(Ae))for(let ke=0;ke<Ae.length;++ke){let ze=n+ke+1,tt=Ae[ke],vt=e._tilingScheme.getNumberOfYTilesAtLevel(ze);for(let pt=0;pt<tt.length;++pt){let Be=tt[pt],qt=vt-Be.endY-1,At=vt-Be.startY-1;e.availability.addAvailableTileRange(ze,Be.startX,qt,Be.endX,At),r.availability.addAvailableTileRange(ze,Be.startX,qt,Be.endX,At)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ge}let Q=e.getLevelMaximumGeometricError(n)*5,de=e._tilingScheme.tileXYToRectangle(i,o,n),xe=vn.fromRectangle(de,A,E,e._tilingScheme.ellipsoid);return new yC({center:C,minimumHeight:A,maximumHeight:E,boundingSphere:v,orientedBoundingBox:xe,horizonOcclusionPoint:D,quantizedVertices:R,encodedNormals:j,indices:w,westIndices:U,southIndices:G,eastIndices:W,northIndices:J,westSkirtHeight:Q,southSkirtHeight:Q,eastSkirtHeight:Q,northSkirtHeight:Q,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:K,credits:e._tileCredits})}jh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let d=UZ(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(r)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):gAe(this,e,t,n,r,i)};function gAe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new re("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=mAe(void 0)):u=mAe(c);let g=p.getDerivedResource({url:d,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?MCt(e,m,i,t,n):LCt(e,m,i,t,n,o):Promise.reject(new re("Mesh buffer doesn't exist."))})}Object.defineProperties(jh.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});jh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};jh.fromIonAssetId=async function(e,t){let n=await Cu.fromAssetId(e);return jh.fromUrl(n,t)};jh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Se.createIfNeeded(e);n.appendForwardSlash();let i=new pAe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await VZ(i);let o=new jh(t);return i.build(o),o};jh.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(UZ(this,e,t,n,i[r],r===0).result)return;return!1};jh.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=UZ(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function kZ(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function UZ(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,u=o.availability,f=kZ(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,d=o.availabilityPromiseCache[s],!l(d))){let p=new $o({throttle:!1,throttleByServer:!0,type:ds.TERRAIN});d=gAe(e,f.x,f.y,f.level,o,p),l(d)&&(o.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=kZ(o,f.x,f.y,f.level)}return{result:!1}}jh._getAvailabilityTile=kZ;var xC=jh;function vg(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new ul(n),this._workerName="createCircleGeometry"}vg.packedLength=ul.packedLength;vg.pack=function(e,t,n){return ul.pack(e._ellipseGeometry,t,n)};var yAe=new ul({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Xa={center:new h,radius:void 0,ellipsoid:ee.clone(ee.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Ie,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};vg.unpack=function(e,t,n){let i=ul.unpack(e,t,yAe);return Xa.center=h.clone(i._center,Xa.center),Xa.ellipsoid=ee.clone(i._ellipsoid,Xa.ellipsoid),Xa.ellipsoid=ee.clone(i._ellipsoid,yAe._ellipsoid),Xa.height=i._height,Xa.extrudedHeight=i._extrudedHeight,Xa.granularity=i._granularity,Xa.vertexFormat=Ie.clone(i._vertexFormat,Xa.vertexFormat),Xa.stRotation=i._stRotation,Xa.shadowVolume=i._shadowVolume,l(n)?(Xa.semiMajorAxis=i._semiMajorAxis,Xa.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new ul(Xa),n):(Xa.radius=i._semiMajorAxis,new vg(Xa))};vg.createGeometry=function(e){return ul.createGeometry(e._ellipseGeometry)};vg.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new vg({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(vg.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var zZ=vg;function Lv(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new Hu(n),this._workerName="createCircleOutlineGeometry"}Lv.packedLength=Hu.packedLength;Lv.pack=function(e,t,n){return Hu.pack(e._ellipseGeometry,t,n)};var NCt=new Hu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),cf={center:new h,radius:void 0,ellipsoid:ee.clone(ee.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};Lv.unpack=function(e,t,n){let i=Hu.unpack(e,t,NCt);return cf.center=h.clone(i._center,cf.center),cf.ellipsoid=ee.clone(i._ellipsoid,cf.ellipsoid),cf.height=i._height,cf.extrudedHeight=i._extrudedHeight,cf.granularity=i._granularity,cf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(cf.semiMajorAxis=i._semiMajorAxis,cf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Hu(cf),n):(cf.radius=i._semiMajorAxis,new Lv(cf))};Lv.createGeometry=function(e){return Hu.createGeometry(e._ellipseGeometry)};var HZ=Lv;function Nv(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Xi({ellipsoid:y(e.ellipsoid,ee.default)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe;let n=e.credit;typeof n=="string"&&(n=new bt(n)),this._credit=n}Object.defineProperties(Nv.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Nv.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Wa({buffer:c,width:r,height:s})})};Nv.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Nv.prototype.getTileDataAvailable=function(e,t,n){};Nv.prototype.loadTileDataAvailability=function(e,t,n){};var GZ=Nv;function xAe(e){this.proxy=e}xAe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var WZ=xAe;var FCt={SEARCH:0,AUTOCOMPLETE:1},U0=Object.freeze(FCt);function TG(){he.throwInstantiationError()}Object.defineProperties(TG.prototype,{credit:{get:he.throwInstantiationError}});TG.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(bt.getIonCredit)};TG.prototype.geocode=he.throwInstantiationError;var Fv=TG;function bAe(){he.throwInstantiationError()}bAe.createGeometry=function(e){he.throwInstantiationError()};var jZ=bAe;var HCt=Zo(qZ(),1);function BCt(e,t){return(e&t)!==0}var Oc=BCt;var kCt=[1,2,4,8],TAe=15,VCt=16,UCt=64,zCt=128;function mp(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}mp.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new mp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};mp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};mp.prototype.hasSubtree=function(){return Oc(this._bits,VCt)};mp.prototype.hasImagery=function(){return Oc(this._bits,UCt)};mp.prototype.hasTerrain=function(){return Oc(this._bits,zCt)};mp.prototype.hasChildren=function(){return Oc(this._bits,TAe)};mp.prototype.hasChild=function(e){return Oc(this._bits,kCt[e])};mp.prototype.getChildBitmask=function(){return this._bits&TAe};var M3=mp;function GCt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var WCt=GCt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB \f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\x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xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS >\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function lf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(lf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});lf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Se)&&(t=e.url);let n=Se.createIfNeeded(t);n.appendForwardSlash();let i=new lf;i._resource=n;try{await UCt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${TAe(i,"",1).url}: ${o}`;throw new re(r)}return i};lf.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Oc(t,r)?Oc(e,r)&&(s|=1):(s|=2,Oc(e,r)||(s|=1)),i+=s}return i};lf.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];Oc(s,2)?Oc(s,1)||(t|=r):(n|=r,Oc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};lf.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var bAe=new _i("decodeGoogleEarthEnterprisePacket");lf.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=TAe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return bAe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,x){return m.length-x.length});let g=p.length;for(let m=0;m<g;++m){let x=p[m];if(u[x]!==null){let T=M3.clone(u[x]),C=x.length;if(C===d)T.setParent(f);else if(C>1){let A=r[x.substring(0,x.length-1)];T.setParent(A)}r[x]=T}else r[x]=null}})})};lf.prototype.populateSubtree=function(e,t,n,i){let o=lf.tileXYToQuadKey(e,t,n);return XZ(this,o,i)};function XZ(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new Zo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),XZ(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new re(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new Zo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),XZ(e,t,s)}).finally(function(){delete a[o]})}lf.prototype.getTileInformation=function(e,t,n){let i=lf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};lf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function TAe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var qZ,YZ;function UCt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(YZ)){let n=nn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;YZ=sx(n).then(function(){qZ=window.cesiumGoogleEarthDbRootParser(BCt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return YZ.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=qZ.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return bAe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=qZ.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.copyrightString;l(u)&&(o[c.providerId]=new Tt(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=VCt})}var Dg=lf;function bC(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(bC.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var EAe="createVerticesFromGoogleEarthEnterpriseBuffer",zCt=new _i(EAe),HCt=new _i(EAe,Nh.maximumAsynchronousTasks),CAe=new se,KZ=new se;bC.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,CAe),t.tileXYToRectangle(n,i,o,KZ);let u=c.cartographicToCartesian(se.center(KZ)),d=40075.16/(1<<o);this._skirtHeight=Math.min(d*8,1e3);let g=(a?HCt:zCt).scheduleTask({buffer:this._buffer,nativeRectangle:CAe,rectangle:KZ,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(x){return m._mesh=new md(u,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,ae.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,vn.clone(x.orientedBoundingBox),wc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),m._minimumHeight=x.minimumHeight,m._maximumHeight=x.maximumHeight,m._buffer=void 0,m._mesh})};bC.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),o=P.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?YCt(this,i,o):ZCt(this,i,o,e)};var GCt=new _i("upsampleQuantizedTerrainMesh",Nh.maximumAsynchronousTasks);bC.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=GCt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let x=new Uint16Array(m.vertices),b=Ne.createTypedArray(x.length/3,m.indices),T=g._skirtHeight;return new yC({quantizedVertices:x,indices:b,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ae.clone(m.boundingSphere),orientedBoundingBox:vn.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:T,southSkirtHeight:T,eastSkirtHeight:T,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};bC.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};bC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var WCt=new z,jCt=new z,qCt=new z,SAe=new h;function YCt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=r.decodeTextureCoordinates(o,u,WCt),g=r.decodeTextureCoordinates(o,f,jCt),m=r.decodeTextureCoordinates(o,d,qCt),x=vg.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,SAe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),T=r.decodeHeight(o,f),C=r.decodeHeight(o,d);return x.x*b+x.y*T+x.z*C}}}var XCt=Uint16Array.BYTES_PER_ELEMENT,AAe=Uint32Array.BYTES_PER_ELEMENT,ZZ=Int32Array.BYTES_PER_ELEMENT,KCt=Float32Array.BYTES_PER_ELEMENT,$Z=Float64Array.BYTES_PER_ELEMENT;function ZCt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),u=0;for(let v=0;v<r;++v)u+=c.getUint32(u,!0),u+=AAe;u+=AAe,u+=2*$Z;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=$Z;let d=P.toRadians(c.getFloat64(u,!0)*180);u+=$Z;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=ZZ;let x=c.getInt32(u,!0)*3;u+=ZZ,u+=ZZ;let b=new Array(m),T=new Array(m),C=new Array(m),A;for(A=0;A<m;++A)b[A]=s+c.getUint8(u++)*p,T[A]=a+c.getUint8(u++)*g,C[A]=c.getFloat32(u,!0)*6371010,u+=KCt;let E=new Array(x);for(A=0;A<x;++A)E[A]=c.getUint16(u,!0),u+=XCt;for(A=0;A<x;A+=3){let v=E[A],D=E[A+1],O=E[A+2],R=b[v],M=b[D],N=b[O],_=T[v],S=T[D],w=T[O],I=vg.computeBarycentricCoordinates(t,n,R,_,M,S,N,w,SAe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*C[v]+I.y*C[D]+I.z*C[O]}}var Bv=bC;var Ad={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},SG=new Z;function vG(){this._terrainCache={},this._lastTidy=Z.now()}vG.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Z.now()}};vG.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};vG.prototype.tidy=function(){if(Z.now(SG),Z.secondsDifference(SG,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];Z.secondsDifference(SG,r.timestamp)>10&&delete e[o]}Z.clone(SG,this._lastTidy)}};function j0(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Tt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new vG,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new me}Object.defineProperties(j0.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});j0.fromMetadata=function(e,t){if(!e.terrainPresent)throw new re(`The server ${e.url} doesn't have terrain`);let n=new j0(t);return n._metadata=e,n};var $Ct=new _i("decodeGoogleEarthEnterprisePacket");function vAe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Ad.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}j0.prototype.requestTileGeometry=function(e,t,n,i){let o=Dg.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new re("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Ad.UNKNOWN);let u=r.get(o);if(l(u)){let T=s.providers[a.terrainProvider];return Promise.resolve(new Bv({buffer:u,childTileMask:vAe(o,a,s),credits:l(T)?[T]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Ad.NONE)return Promise.reject(new re("Terrain tile doesn't exist"))}else return Promise.resolve(new Ha({buffer:new Uint8Array(16*16),width:16,height:16}));let f,d=o,p=-1;switch(c){case Ad.SELF:p=a.terrainVersion;break;case Ad.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Ad.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new re("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,x,b;if(l(g[d]))x=g[d],b=m[d];else{b=i;let T=QCt(this,d,p,b).fetchArrayBuffer();if(!l(T))return;x=T.then(function(C){return l(C)?$Ct.scheduleTask({buffer:C,type:"Terrain",key:s.key},[C]).then(function(A){let E=s.getTileInformationFromQuadKey(d);E.terrainState=Ad.SELF,r.add(d,A[0]);let v=E.terrainProvider,D=A.length-1;for(let O=0;O<D;++O){let R=d+O.toString(),M=s.getTileInformationFromQuadKey(R);l(M)&&(r.add(R,A[O+1]),M.terrainState=Ad.PARENT,M.terrainProvider===0&&(M.terrainProvider=v))}}):Promise.reject(new re("Failed to load terrain."))}),g[d]=x,m[d]=b,x=x.finally(function(){delete g[d],delete m[d]})}return x.then(function(){let T=r.get(o);if(l(T)){let C=s.providers[a.terrainProvider];return new Bv({buffer:T,childTileMask:vAe(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new re("Failed to load terrain."))}).catch(function(T){return b.state===Zn.CANCELLED?(i.state=b.state,Promise.reject(T)):(a.terrainState=Ad.NONE,Promise.reject(T))})};j0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};j0.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=Dg.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===Ad.NONE)return!1;if((!l(s)||s===Ad.UNKNOWN)&&(r.terrainState=Ad.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Zo({throttle:!1,throttleByServer:!0,type:ds.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};j0.prototype.loadTileDataAvailability=function(e,t,n){};function QCt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var QZ=j0;var JCt="https://maps.googleapis.com/maps/api/geocode/json",wAe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function JZ(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._resource=new Se({url:JCt,queryParameters:{key:t}}),this._credit=new Tt(wAe,!0)}Object.defineProperties(JZ.prototype,{credit:{get:function(){return this._credit}}});JZ.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new re(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:se.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:wAe,collapsible:!1}}})};var e$=JZ;var wG={};wG.defaultApiKey=void 0;wG.mapTilesApiEndpoint=new Se({url:"https://tile.googleapis.com/v1/"});wG.getDefaultCredit=function(){return new Tt('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var TC=wG;var Mc={};Mc.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Mc.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Mc.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",OPC:"OPC",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles","3MX":"3MX","3SM":"3SM",CCCloudProject:"CCCloudProject",CCImageCollection:"CCImageCollection",CCOrientations:"CCOrientations",ContextCaptureInputs:"ContextCaptureInputs",ContextDetector:"ContextDetector",ContextScene:"ContextScene",DAE:"DAE",DGN:"DGN",DSM:"DSM",FBX:"FBX",GLB:"GLB",GLTF:"GLTF",KML:"KML",LAS:"LAS",LAZ:"LAZ",LOD:"LOD",LodTree:"LodTree",OBJ:"OBJ",OMI:"OMI",OMR:"OMR",Orthophoto:"Orthophoto",OrthophotoDSM:"OrthophotoDSM",OSGB:"OSGB",OVF:"OVF",OBT:"OBT",PLY:"PLY",PointCloud:"PointCloud",S3C:"S3C",ScanCollection:"ScanCollection",SHP:"SHP",SLPK:"SLPK",SpaceEyes3D:"SpaceEyes3D",STL:"STL",TSM:"TSM",Unstructured:"Unstructured",Other:"Other"});Mc.defaultAccessToken=void 0;Mc.apiEndpoint=new Se({url:"https://api.bentley.com"});Mc.getExports=async function(e){let t=new Se({url:`${Mc.apiEndpoint}mesh-export`,headers:{Authorization:`Bearer ${Mc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Mc.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);throw n.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${i.error.details[0].code}`):n.statusCode===403?(console.error(i.error.code,i.error.message),new re("Not allowed, forbidden")):n.statusCode===422?new re(`Unprocessable Entity:${i.error.code} ${i.error.message}`):n.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${n.statusCode}`)}};Mc.getRealityDataMetadata=async function(e,t){let n=new Se({url:`${Mc.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:`Bearer ${Mc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);throw i.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${o.error.details[0].code}`):i.statusCode===403?(console.error(o.error.code,o.error.message),new re("Not allowed, forbidden")):i.statusCode===404?new re(`Reality data not found: ${e}, ${t}`):i.statusCode===422?new re(`Unprocessable Entity:${o.error.code} ${o.error.message}`):i.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${i.statusCode}`)}};Mc.getRealityDataURL=async function(e,t,n){let i=new Se({url:`${Mc.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:`Bearer ${Mc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);throw o.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${r.error.details[0].code}`):o.statusCode===403?(console.error(r.error.code,r.error.message),new re("Not allowed, forbidden")):o.statusCode===404?new re(`Reality data not found: ${e}, ${t}`):o.statusCode===422?new re(`Unprocessable Entity:${r.error.code} ${r.error.message}`):o.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${o.statusCode}`)}};var uf=Mc;var L3={};L3.type=void 0;L3.getRequiredDataPoints=he.throwInstantiationError;L3.interpolateOrderZero=he.throwInstantiationError;L3.interpolate=he.throwInstantiationError;var t$=L3;var eAt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},Ig=Object.freeze(eAt);function n$(e){this._url=Se.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(n$.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});n$.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===W0.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=se.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var N3=n$;function tAt(e){if(!Object.values(Ig).some(t=>t===e))throw new he(`Invalid geocodeProviderType: "${e}"`)}var DAe=Object.freeze({[Ig.GOOGLE]:"google",[Ig.BING]:"bing",[Ig.DEFAULT]:void 0});function nAt(e){return DAe[e]}function iAt(e){return Object.entries(DAe).find(t=>t[1]===e)[0]}function i$(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.geocodeProviderType,Ig.DEFAULT),n=y(e.accessToken,Xd.defaultAccessToken),i=Se.createIfNeeded(y(e.server,Xd.defaultServer));i.appendForwardSlash();let o=Xd.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Tt.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new N3(r),this.geocodeProviderType=t}Object.defineProperties(i$.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return iAt(this._pelias.url.queryParameters.geocoder)},set:function(e){tAt(e);let t={...this._pelias.url.queryParameters,geocoder:nAt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});i$.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var CC=i$;function DG(){he.throwInstantiationError()}Object.defineProperties(DG.prototype,{ellipsoid:{get:he.throwInstantiationError}});DG.prototype.project=he.throwInstantiationError;DG.prototype.unproject=he.throwInstantiationError;var o$=DG;function kv(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(kv.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});kv.prototype.findTimeInterval=oo.prototype.findTimeInterval;kv.prototype.wrapTime=oo.prototype.wrapTime;kv.prototype.clampTime=oo.prototype.clampTime;kv.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var r$=kv;function s$(e,t,n){e=Se.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new Tt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(s$.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});s$.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:bt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=se.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var a$=s$;var oAt={packedLength:void 0,pack:he.throwInstantiationError,unpack:he.throwInstantiationError},c$=oAt;var rAt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:he.throwInstantiationError,unpackInterpolationResult:he.throwInstantiationError},l$=rAt;function IAe(){he.throwInstantiationError()}IAe.prototype.getURL=he.throwInstantiationError;var u$=IAe;function sAt(e,t,n,i,o,r,s){let a=Oi.numberOfPoints(e,t,o),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,x=i.blue,b=i.alpha;if(H.equals(n,i)){for(c=0;c<a;c++)r[s++]=H.floatToByte(u),r[s++]=H.floatToByte(f),r[s++]=H.floatToByte(d),r[s++]=H.floatToByte(p);return s}let T=(g-u)/a,C=(m-f)/a,A=(x-d)/a,E=(b-p)/a,v=s;for(c=0;c<a;c++)r[v++]=H.floatToByte(u+c*T),r[v++]=H.floatToByte(f+c*C),r[v++]=H.floatToByte(d+c*A),r[v++]=H.floatToByte(p+c*E);return v}function F3(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,Jt.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,ee.default),this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*H.packedLength:1,this.packedLength=o+ee.packedLength+3}F3.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=H.packedLength)H.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};F3.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=ee.unpack(e,t);t+=ee.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new F3({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var IG=new Array(2),PG=new Array(2),aAt={positions:IG,height:PG,ellipsoid:void 0,minDistance:void 0,granularity:void 0};F3.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=P.chordLength(r,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,x=0;if(o===Jt.GEODESIC||o===Jt.RHUMB){let E,v,D;o===Jt.GEODESIC?(E=P.chordLength(r,s.maximumRadius),v=Oi.numberOfPoints,D=Oi.generateArc):(E=r,v=Oi.numberOfPointsRhumbLine,D=Oi.generateRhumbArc);let O=Oi.extractHeights(t,s),R=aAt;if(o===Jt.GEODESIC?R.minDistance=a:R.granularity=r,R.ellipsoid=s,c){let M=0;for(u=0;u<f-1;u++)M+=v(t[u],t[u+1],E)+1;d=new Float64Array(M*3),g=new Uint8Array(M*4),R.positions=IG,R.height=PG;let N=0;for(u=0;u<f-1;++u){IG[0]=t[u],IG[1]=t[u+1],PG[0]=O[u],PG[1]=O[u+1];let _=D(R);if(l(n)){let S=_.length/3;m=n[u];for(let w=0;w<S;++w)g[N++]=H.floatToByte(m.red),g[N++]=H.floatToByte(m.green),g[N++]=H.floatToByte(m.blue),g[N++]=H.floatToByte(m.alpha)}d.set(_,x),x+=_.length}}else if(R.positions=t,R.height=O,d=new Float64Array(D(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let N=t[u],_=t[u+1],S=n[u],w=n[u+1];x=sAt(N,_,S,w,a,g,x)}let M=n[f-1];g[x++]=H.floatToByte(M.red),g[x++]=H.floatToByte(M.green),g[x++]=H.floatToByte(M.blue),g[x++]=H.floatToByte(M.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let E=0,v=0;for(u=0;u<f;++u){let D=t[u];if(c&&u>0&&(h.pack(D,d,E),E+=3,m=n[u-1],g[v++]=H.floatToByte(m.red),g[v++]=H.floatToByte(m.green),g[v++]=H.floatToByte(m.blue),g[v++]=H.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(D,d,E),E+=3,l(n)&&(m=n[u],g[v++]=H.floatToByte(m.red),g[v++]=H.floatToByte(m.green),g[v++]=H.floatToByte(m.blue),g[v++]=H.floatToByte(m.alpha))}}let b=new fn;b.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(b.color=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let T=(p-1)*2,C=Ne.createTypedArray(p,T),A=0;for(u=0;u<p-1;++u)C[A++]=u,C[A++]=u+1;return new at({attributes:b,indices:C,primitiveType:Me.LINES,boundingSphere:ae.fromPoints(t)})};var f$=F3;function Vv(e){let t=y(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Qs(i),this._workerName="createSphereGeometry"}Vv.packedLength=Qs.packedLength;Vv.pack=function(e,t,n){return Qs.pack(e._ellipsoidGeometry,t,n)};var cAt=new Qs,q0={radius:void 0,radii:new h,vertexFormat:new Ie,stackPartitions:void 0,slicePartitions:void 0};Vv.unpack=function(e,t,n){let i=Qs.unpack(e,t,cAt);return q0.vertexFormat=Ie.clone(i._vertexFormat,q0.vertexFormat),q0.stackPartitions=i._stackPartitions,q0.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,q0.radii),n._ellipsoidGeometry=new Qs(q0),n):(q0.radius=i._radii.x,new Vv(q0))};Vv.createGeometry=function(e){return Qs.createGeometry(e._ellipsoidGeometry)};var d$=Vv;function Y0(e){}Object.defineProperties(Y0.prototype,{ellipsoid:{get:he.throwInstantiationError},rectangle:{get:he.throwInstantiationError},projection:{get:he.throwInstantiationError}});Y0.prototype.getNumberOfXTilesAtLevel=he.throwInstantiationError;Y0.prototype.getNumberOfYTilesAtLevel=he.throwInstantiationError;Y0.prototype.rectangleToNativeRectangle=he.throwInstantiationError;Y0.prototype.tileXYToNativeRectangle=he.throwInstantiationError;Y0.prototype.tileXYToRectangle=he.throwInstantiationError;Y0.prototype.positionToTileXY=he.throwInstantiationError;var h$=Y0;function lAt(e,t){this.rectangle=e,this.maxLevel=t}function PAe(e){this.ellipsoid=y(e.ellipsoid,ee.default),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}PAe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function uAt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Xi({ellipsoid:e.ellipsoid});else throw new re(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),u=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new lAt(new se(a,c,u,f),d))}}function fAt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new re(i)}async function dAt(e,t,n){try{let i=await t.fetchXML();uAt(e,i)}catch(i){fAt(t,i,n)}}function X0(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new me,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new Tt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(X0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});X0.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new PAe(t),i=Se.createIfNeeded(e);await dAt(n,i);let o=new X0(t);return n.build(o),o._resource=i,o};X0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Ha({buffer:Id(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:hAt(a,e,t,n),structure:a._terrainDataStructure})})};X0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var RAe=new se;function hAt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=se.intersection(f,s,RAe);l(d)&&(RG(o,f,t*2,n*2,i+1)&&(a|=4),RG(o,f,t*2+1,n*2,i+1)&&(a|=8),RG(o,f,t*2,n*2+1,i+1)&&(a|=1),RG(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function RG(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(se.intersection(r,t,RAe))}X0.prototype.getTileDataAvailable=function(e,t,n){};X0.prototype.loadTileDataAvailability=function(e,t,n){};var m$=X0;function AC(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,He.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(AC.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(AC.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=mAt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});AC.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};AC.prototype.isDestroyed=function(){return!1};AC.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};AC.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=y(this.epoch,He.MINIMUM_VALUE),s=Z.secondsDifference(o,r),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function mAt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var p$=AC;var pAt={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},_$=Object.freeze(pAt);function _At(e){return e=y(e,y.EMPTY_OBJECT),xC.fromIonAssetId(2426648,{requestVertexNormals:y(e.requestVertexNormals,!1)})}var B3=_At;function gAt(e){return e=y(e,y.EMPTY_OBJECT),xC.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1),ellipsoid:ee.WGS84})}var EC=gAt;var yAt=1953029805,xAt=2917034100;function g$(e,t){if(g$.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new re("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===yAt||o===xAt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}g$.passThroughDataForTesting=!1;var k3=g$;var bAt=new h;function TAt(e,t,n,i){let o=px(e,t,n,i,bAt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var y$=TAt;function CAt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var SC=CAt;function AAt(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var x$=AAt;function EAt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var V3=EAt;var SAt=new h(1,1,1);function b$(e){e=y(e,SAt),this._dimensions=h.clone(e)}Object.defineProperties(b$.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var vAt=new h;b$.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,vAt),i=P.randomBetween(-n.x,n.x),o=P.randomBetween(-n.y,n.y),r=P.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var T$=b$;function gp(){this.featurePropertiesDirty=!1}Object.defineProperties(gp.prototype,{featuresLength:{get:function(){he.throwInstantiationError()}},pointsLength:{get:function(){he.throwInstantiationError()}},trianglesLength:{get:function(){he.throwInstantiationError()}},geometryByteLength:{get:function(){he.throwInstantiationError()}},texturesByteLength:{get:function(){he.throwInstantiationError()}},batchTableByteLength:{get:function(){he.throwInstantiationError()}},innerContents:{get:function(){he.throwInstantiationError()}},ready:{get:function(){he.throwInstantiationError()}},tileset:{get:function(){he.throwInstantiationError()}},tile:{get:function(){he.throwInstantiationError()}},url:{get:function(){he.throwInstantiationError()}},batchTable:{get:function(){he.throwInstantiationError()}},metadata:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}},group:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}}});gp.prototype.hasProperty=function(e,t){he.throwInstantiationError()};gp.prototype.getFeature=function(e){he.throwInstantiationError()};gp.prototype.applyDebugSettings=function(e,t){he.throwInstantiationError()};gp.prototype.applyStyle=function(e){he.throwInstantiationError()};gp.prototype.update=function(e,t){he.throwInstantiationError()};gp.prototype.pick=function(e,t,n){he.throwInstantiationError()};gp.prototype.isDestroyed=function(){he.throwInstantiationError()};gp.prototype.destroy=function(){he.throwInstantiationError()};var C$=gp;function Uv(e,t){this._conditionsExpression=Ge(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,DAt(this,t)}Object.defineProperties(Uv.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function wAt(e,t){this.condition=e,this.expression=t}function DAt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new wAt(new Mf(a,t),new Mf(c,t)))}e._runtimeConditions=n}Uv.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};Uv.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};Uv.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function lf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(lf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});lf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Se)&&(t=e.url);let n=Se.createIfNeeded(t);n.appendForwardSlash();let i=new lf;i._resource=n;try{await jCt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${AAe(i,"",1).url}: ${o}`;throw new re(r)}return i};lf.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Oc(t,r)?Oc(e,r)&&(s|=1):(s|=2,Oc(e,r)||(s|=1)),i+=s}return i};lf.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];Oc(s,2)?Oc(s,1)||(t|=r):(n|=r,Oc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};lf.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var CAe=new gi("decodeGoogleEarthEnterprisePacket");lf.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=AAe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return CAe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,x){return m.length-x.length});let g=p.length;for(let m=0;m<g;++m){let x=p[m];if(u[x]!==null){let T=M3.clone(u[x]),C=x.length;if(C===d)T.setParent(f);else if(C>1){let A=r[x.substring(0,x.length-1)];T.setParent(A)}r[x]=T}else r[x]=null}})})};lf.prototype.populateSubtree=function(e,t,n,i){let o=lf.tileXYToQuadKey(e,t,n);return KZ(this,o,i)};function KZ(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new $o({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),KZ(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new re(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new $o({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),KZ(e,t,s)}).finally(function(){delete a[o]})}lf.prototype.getTileInformation=function(e,t,n){let i=lf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};lf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function AAe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var YZ,XZ;function jCt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(XZ)){let n=en("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;XZ=nx(n).then(function(){YZ=window.cesiumGoogleEarthDbRootParser(HCt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return XZ.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=YZ.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return CAe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=YZ.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.copyrightString;l(u)&&(o[c.providerId]=new bt(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=WCt})}var wg=lf;function bC(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(bC.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var vAe="createVerticesFromGoogleEarthEnterpriseBuffer",qCt=new gi(vAe),YCt=new gi(vAe,Lh.maximumAsynchronousTasks),EAe=new se,ZZ=new se;bC.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,EAe),t.tileXYToRectangle(n,i,o,ZZ);let u=c.cartographicToCartesian(se.center(ZZ)),d=40075.16/(1<<o);this._skirtHeight=Math.min(d*8,1e3);let g=(a?YCt:qCt).scheduleTask({buffer:this._buffer,nativeRectangle:EAe,rectangle:ZZ,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(x){return m._mesh=new hd(u,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,ae.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,vn.clone(x.orientedBoundingBox),wc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),m._minimumHeight=x.minimumHeight,m._maximumHeight=x.maximumHeight,m._buffer=void 0,m._mesh})};bC.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),o=P.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?QCt(this,i,o):tAt(this,i,o,e)};var XCt=new gi("upsampleQuantizedTerrainMesh",Lh.maximumAsynchronousTasks);bC.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,d=e.tileXYToRectangle(o,r,s),p=XCt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let x=new Uint16Array(m.vertices),b=Ne.createTypedArray(x.length/3,m.indices),T=g._skirtHeight;return new yC({quantizedVertices:x,indices:b,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ae.clone(m.boundingSphere),orientedBoundingBox:vn.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:T,southSkirtHeight:T,eastSkirtHeight:T,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};bC.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};bC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var KCt=new z,ZCt=new z,$Ct=new z,wAe=new h;function QCt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=r.decodeTextureCoordinates(o,u,KCt),g=r.decodeTextureCoordinates(o,f,ZCt),m=r.decodeTextureCoordinates(o,d,$Ct),x=Sg.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,wAe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),T=r.decodeHeight(o,f),C=r.decodeHeight(o,d);return x.x*b+x.y*T+x.z*C}}}var JCt=Uint16Array.BYTES_PER_ELEMENT,SAe=Uint32Array.BYTES_PER_ELEMENT,$Z=Int32Array.BYTES_PER_ELEMENT,eAt=Float32Array.BYTES_PER_ELEMENT,QZ=Float64Array.BYTES_PER_ELEMENT;function tAt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),u=0;for(let v=0;v<r;++v)u+=c.getUint32(u,!0),u+=SAe;u+=SAe,u+=2*QZ;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=QZ;let d=P.toRadians(c.getFloat64(u,!0)*180);u+=QZ;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=$Z;let x=c.getInt32(u,!0)*3;u+=$Z,u+=$Z;let b=new Array(m),T=new Array(m),C=new Array(m),A;for(A=0;A<m;++A)b[A]=s+c.getUint8(u++)*p,T[A]=a+c.getUint8(u++)*g,C[A]=c.getFloat32(u,!0)*6371010,u+=eAt;let E=new Array(x);for(A=0;A<x;++A)E[A]=c.getUint16(u,!0),u+=JCt;for(A=0;A<x;A+=3){let v=E[A],D=E[A+1],O=E[A+2],R=b[v],M=b[D],N=b[O],_=T[v],S=T[D],w=T[O],I=Sg.computeBarycentricCoordinates(t,n,R,_,M,S,N,w,wAe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*C[v]+I.y*C[D]+I.z*C[O]}}var Bv=bC;var Cd={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},CG=new Z;function AG(){this._terrainCache={},this._lastTidy=Z.now()}AG.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Z.now()}};AG.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};AG.prototype.tidy=function(){if(Z.now(CG),Z.secondsDifference(CG,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];Z.secondsDifference(CG,r.timestamp)>10&&delete e[o]}Z.clone(CG,this._lastTidy)}};function z0(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new bt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new AG,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new pe}Object.defineProperties(z0.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});z0.fromMetadata=function(e,t){if(!e.terrainPresent)throw new re(`The server ${e.url} doesn't have terrain`);let n=new z0(t);return n._metadata=e,n};var nAt=new gi("decodeGoogleEarthEnterprisePacket");function DAe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Cd.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}z0.prototype.requestTileGeometry=function(e,t,n,i){let o=wg.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new re("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Cd.UNKNOWN);let u=r.get(o);if(l(u)){let T=s.providers[a.terrainProvider];return Promise.resolve(new Bv({buffer:u,childTileMask:DAe(o,a,s),credits:l(T)?[T]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Cd.NONE)return Promise.reject(new re("Terrain tile doesn't exist"))}else return Promise.resolve(new Wa({buffer:new Uint8Array(16*16),width:16,height:16}));let f,d=o,p=-1;switch(c){case Cd.SELF:p=a.terrainVersion;break;case Cd.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Cd.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new re("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,x,b;if(l(g[d]))x=g[d],b=m[d];else{b=i;let T=iAt(this,d,p,b).fetchArrayBuffer();if(!l(T))return;x=T.then(function(C){return l(C)?nAt.scheduleTask({buffer:C,type:"Terrain",key:s.key},[C]).then(function(A){let E=s.getTileInformationFromQuadKey(d);E.terrainState=Cd.SELF,r.add(d,A[0]);let v=E.terrainProvider,D=A.length-1;for(let O=0;O<D;++O){let R=d+O.toString(),M=s.getTileInformationFromQuadKey(R);l(M)&&(r.add(R,A[O+1]),M.terrainState=Cd.PARENT,M.terrainProvider===0&&(M.terrainProvider=v))}}):Promise.reject(new re("Failed to load terrain."))}),g[d]=x,m[d]=b,x=x.finally(function(){delete g[d],delete m[d]})}return x.then(function(){let T=r.get(o);if(l(T)){let C=s.providers[a.terrainProvider];return new Bv({buffer:T,childTileMask:DAe(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new re("Failed to load terrain."))}).catch(function(T){return b.state===Zn.CANCELLED?(i.state=b.state,Promise.reject(T)):(a.terrainState=Cd.NONE,Promise.reject(T))})};z0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};z0.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=wg.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===Cd.NONE)return!1;if((!l(s)||s===Cd.UNKNOWN)&&(r.terrainState=Cd.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new $o({throttle:!1,throttleByServer:!0,type:ds.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};z0.prototype.loadTileDataAvailability=function(e,t,n){};function iAt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var JZ=z0;var oAt="https://maps.googleapis.com/maps/api/geocode/json",IAe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function e$(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._resource=new Se({url:oAt,queryParameters:{key:t}}),this._credit=new bt(IAe,!0)}Object.defineProperties(e$.prototype,{credit:{get:function(){return this._credit}}});e$.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new re(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:se.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:IAe,collapsible:!1}}})};var t$=e$;var EG={};EG.defaultApiKey=void 0;EG.mapTilesApiEndpoint=new Se({url:"https://tile.googleapis.com/v1/"});EG.getDefaultCredit=function(){return new bt('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var TC=EG;var Mc={};Mc.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Mc.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Mc.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Mc.defaultAccessToken=void 0;Mc.apiEndpoint=new Se({url:"https://api.bentley.com"});Mc.getExports=async function(e){let t=new Se({url:`${Mc.apiEndpoint}mesh-export`,headers:{Authorization:`Bearer ${Mc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Mc.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);throw n.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${i.error.details[0].code}`):n.statusCode===403?(console.error(i.error.code,i.error.message),new re("Not allowed, forbidden")):n.statusCode===422?new re(`Unprocessable Entity:${i.error.code} ${i.error.message}`):n.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${n.statusCode}`)}};Mc.getRealityDataMetadata=async function(e,t){let n=new Se({url:`${Mc.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:`Bearer ${Mc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);throw i.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${o.error.details[0].code}`):i.statusCode===403?(console.error(o.error.code,o.error.message),new re("Not allowed, forbidden")):i.statusCode===404?new re(`Reality data not found: ${e}, ${t}`):i.statusCode===422?new re(`Unprocessable Entity:${o.error.code} ${o.error.message}`):i.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${i.statusCode}`)}};Mc.getRealityDataURL=async function(e,t,n){let i=new Se({url:`${Mc.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:`Bearer ${Mc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);throw o.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${r.error.details[0].code}`):o.statusCode===403?(console.error(r.error.code,r.error.message),new re("Not allowed, forbidden")):o.statusCode===404?new re(`Reality data not found: ${e}, ${t}`):o.statusCode===422?new re(`Unprocessable Entity:${r.error.code} ${r.error.message}`):o.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${o.statusCode}`)}};var Ea=Mc;var L3={};L3.type=void 0;L3.getRequiredDataPoints=he.throwInstantiationError;L3.interpolateOrderZero=he.throwInstantiationError;L3.interpolate=he.throwInstantiationError;var n$=L3;var rAt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},Dg=Object.freeze(rAt);function i$(e){this._url=Se.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(i$.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});i$.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===U0.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=se.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var N3=i$;function sAt(e){if(!Object.values(Dg).some(t=>t===e))throw new he(`Invalid geocodeProviderType: "${e}"`)}var PAe=Object.freeze({[Dg.GOOGLE]:"google",[Dg.BING]:"bing",[Dg.DEFAULT]:void 0});function aAt(e){return PAe[e]}function cAt(e){return Object.entries(PAe).find(t=>t[1]===e)[0]}function o$(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.geocodeProviderType,Dg.DEFAULT),n=y(e.accessToken,qd.defaultAccessToken),i=Se.createIfNeeded(y(e.server,qd.defaultServer));i.appendForwardSlash();let o=qd.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(bt.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new N3(r),this.geocodeProviderType=t}Object.defineProperties(o$.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return cAt(this._pelias.url.queryParameters.geocoder)},set:function(e){sAt(e);let t={...this._pelias.url.queryParameters,geocoder:aAt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});o$.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var CC=o$;function SG(){he.throwInstantiationError()}Object.defineProperties(SG.prototype,{ellipsoid:{get:he.throwInstantiationError}});SG.prototype.project=he.throwInstantiationError;SG.prototype.unproject=he.throwInstantiationError;var r$=SG;function kv(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(kv.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});kv.prototype.findTimeInterval=oo.prototype.findTimeInterval;kv.prototype.wrapTime=oo.prototype.wrapTime;kv.prototype.clampTime=oo.prototype.clampTime;kv.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var s$=kv;function a$(e,t,n){e=Se.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new bt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(a$.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});a$.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:xt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=se.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var c$=a$;var lAt={packedLength:void 0,pack:he.throwInstantiationError,unpack:he.throwInstantiationError},l$=lAt;var uAt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:he.throwInstantiationError,unpackInterpolationResult:he.throwInstantiationError},u$=uAt;function RAe(){he.throwInstantiationError()}RAe.prototype.getURL=he.throwInstantiationError;var f$=RAe;function fAt(e,t,n,i,o,r,s){let a=Li.numberOfPoints(e,t,o),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,x=i.blue,b=i.alpha;if(H.equals(n,i)){for(c=0;c<a;c++)r[s++]=H.floatToByte(u),r[s++]=H.floatToByte(f),r[s++]=H.floatToByte(d),r[s++]=H.floatToByte(p);return s}let T=(g-u)/a,C=(m-f)/a,A=(x-d)/a,E=(b-p)/a,v=s;for(c=0;c<a;c++)r[v++]=H.floatToByte(u+c*T),r[v++]=H.floatToByte(f+c*C),r[v++]=H.floatToByte(d+c*A),r[v++]=H.floatToByte(p+c*E);return v}function F3(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,Qt.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,ee.default),this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*H.packedLength:1,this.packedLength=o+ee.packedLength+3}F3.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=H.packedLength)H.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};F3.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=ee.unpack(e,t);t+=ee.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new F3({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var vG=new Array(2),wG=new Array(2),dAt={positions:vG,height:wG,ellipsoid:void 0,minDistance:void 0,granularity:void 0};F3.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=P.chordLength(r,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,x=0;if(o===Qt.GEODESIC||o===Qt.RHUMB){let E,v,D;o===Qt.GEODESIC?(E=P.chordLength(r,s.maximumRadius),v=Li.numberOfPoints,D=Li.generateArc):(E=r,v=Li.numberOfPointsRhumbLine,D=Li.generateRhumbArc);let O=Li.extractHeights(t,s),R=dAt;if(o===Qt.GEODESIC?R.minDistance=a:R.granularity=r,R.ellipsoid=s,c){let M=0;for(u=0;u<f-1;u++)M+=v(t[u],t[u+1],E)+1;d=new Float64Array(M*3),g=new Uint8Array(M*4),R.positions=vG,R.height=wG;let N=0;for(u=0;u<f-1;++u){vG[0]=t[u],vG[1]=t[u+1],wG[0]=O[u],wG[1]=O[u+1];let _=D(R);if(l(n)){let S=_.length/3;m=n[u];for(let w=0;w<S;++w)g[N++]=H.floatToByte(m.red),g[N++]=H.floatToByte(m.green),g[N++]=H.floatToByte(m.blue),g[N++]=H.floatToByte(m.alpha)}d.set(_,x),x+=_.length}}else if(R.positions=t,R.height=O,d=new Float64Array(D(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let N=t[u],_=t[u+1],S=n[u],w=n[u+1];x=fAt(N,_,S,w,a,g,x)}let M=n[f-1];g[x++]=H.floatToByte(M.red),g[x++]=H.floatToByte(M.green),g[x++]=H.floatToByte(M.blue),g[x++]=H.floatToByte(M.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let E=0,v=0;for(u=0;u<f;++u){let D=t[u];if(c&&u>0&&(h.pack(D,d,E),E+=3,m=n[u-1],g[v++]=H.floatToByte(m.red),g[v++]=H.floatToByte(m.green),g[v++]=H.floatToByte(m.blue),g[v++]=H.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(D,d,E),E+=3,l(n)&&(m=n[u],g[v++]=H.floatToByte(m.red),g[v++]=H.floatToByte(m.green),g[v++]=H.floatToByte(m.blue),g[v++]=H.floatToByte(m.alpha))}}let b=new un;b.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(b.color=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let T=(p-1)*2,C=Ne.createTypedArray(p,T),A=0;for(u=0;u<p-1;++u)C[A++]=u,C[A++]=u+1;return new st({attributes:b,indices:C,primitiveType:Me.LINES,boundingSphere:ae.fromPoints(t)})};var d$=F3;function Vv(e){let t=y(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Qs(i),this._workerName="createSphereGeometry"}Vv.packedLength=Qs.packedLength;Vv.pack=function(e,t,n){return Qs.pack(e._ellipsoidGeometry,t,n)};var hAt=new Qs,H0={radius:void 0,radii:new h,vertexFormat:new Ie,stackPartitions:void 0,slicePartitions:void 0};Vv.unpack=function(e,t,n){let i=Qs.unpack(e,t,hAt);return H0.vertexFormat=Ie.clone(i._vertexFormat,H0.vertexFormat),H0.stackPartitions=i._stackPartitions,H0.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,H0.radii),n._ellipsoidGeometry=new Qs(H0),n):(H0.radius=i._radii.x,new Vv(H0))};Vv.createGeometry=function(e){return Qs.createGeometry(e._ellipsoidGeometry)};var h$=Vv;function G0(e){}Object.defineProperties(G0.prototype,{ellipsoid:{get:he.throwInstantiationError},rectangle:{get:he.throwInstantiationError},projection:{get:he.throwInstantiationError}});G0.prototype.getNumberOfXTilesAtLevel=he.throwInstantiationError;G0.prototype.getNumberOfYTilesAtLevel=he.throwInstantiationError;G0.prototype.rectangleToNativeRectangle=he.throwInstantiationError;G0.prototype.tileXYToNativeRectangle=he.throwInstantiationError;G0.prototype.tileXYToRectangle=he.throwInstantiationError;G0.prototype.positionToTileXY=he.throwInstantiationError;var m$=G0;function mAt(e,t){this.rectangle=e,this.maxLevel=t}function OAe(e){this.ellipsoid=y(e.ellipsoid,ee.default),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}OAe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function pAt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Xi({ellipsoid:e.ellipsoid});else throw new re(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=ss.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),u=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new mAt(new se(a,c,u,f),d))}}function _At(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new re(i)}async function gAt(e,t,n){try{let i=await t.fetchXML();pAt(e,i)}catch(i){_At(t,i,n)}}function W0(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new pe,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new bt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(W0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});W0.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new OAe(t),i=Se.createIfNeeded(e);await gAt(n,i);let o=new W0(t);return n.build(o),o._resource=i,o};W0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Wa({buffer:Dd(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:yAt(a,e,t,n),structure:a._terrainDataStructure})})};W0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var MAe=new se;function yAt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=se.intersection(f,s,MAe);l(d)&&(DG(o,f,t*2,n*2,i+1)&&(a|=4),DG(o,f,t*2+1,n*2,i+1)&&(a|=8),DG(o,f,t*2,n*2+1,i+1)&&(a|=1),DG(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function DG(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(se.intersection(r,t,MAe))}W0.prototype.getTileDataAvailable=function(e,t,n){};W0.prototype.loadTileDataAvailability=function(e,t,n){};var p$=W0;function AC(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,He.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(AC.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(AC.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=xAt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});AC.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};AC.prototype.isDestroyed=function(){return!1};AC.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};AC.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=y(this.epoch,He.MINIMUM_VALUE),s=Z.secondsDifference(o,r),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function xAt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var _$=AC;var bAt={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},g$=Object.freeze(bAt);function TAt(e){return e=y(e,y.EMPTY_OBJECT),xC.fromIonAssetId(2426648,{requestVertexNormals:y(e.requestVertexNormals,!1)})}var B3=TAt;function CAt(e){return e=y(e,y.EMPTY_OBJECT),xC.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1),ellipsoid:ee.WGS84})}var EC=CAt;var AAt=1953029805,EAt=2917034100;function y$(e,t){if(y$.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new re("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===AAt||o===EAt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}y$.passThroughDataForTesting=!1;var k3=y$;var SAt=new h;function vAt(e,t,n,i){let o=fx(e,t,n,i,SAt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var x$=vAt;function wAt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var SC=wAt;function DAt(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var b$=DAt;function IAt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var V3=IAt;var PAt=new h(1,1,1);function T$(e){e=y(e,PAt),this._dimensions=h.clone(e)}Object.defineProperties(T$.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var RAt=new h;T$.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,RAt),i=P.randomBetween(-n.x,n.x),o=P.randomBetween(-n.y,n.y),r=P.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var C$=T$;function pp(){this.featurePropertiesDirty=!1}Object.defineProperties(pp.prototype,{featuresLength:{get:function(){he.throwInstantiationError()}},pointsLength:{get:function(){he.throwInstantiationError()}},trianglesLength:{get:function(){he.throwInstantiationError()}},geometryByteLength:{get:function(){he.throwInstantiationError()}},texturesByteLength:{get:function(){he.throwInstantiationError()}},batchTableByteLength:{get:function(){he.throwInstantiationError()}},innerContents:{get:function(){he.throwInstantiationError()}},ready:{get:function(){he.throwInstantiationError()}},tileset:{get:function(){he.throwInstantiationError()}},tile:{get:function(){he.throwInstantiationError()}},url:{get:function(){he.throwInstantiationError()}},batchTable:{get:function(){he.throwInstantiationError()}},metadata:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}},group:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}}});pp.prototype.hasProperty=function(e,t){he.throwInstantiationError()};pp.prototype.getFeature=function(e){he.throwInstantiationError()};pp.prototype.applyDebugSettings=function(e,t){he.throwInstantiationError()};pp.prototype.applyStyle=function(e){he.throwInstantiationError()};pp.prototype.update=function(e,t){he.throwInstantiationError()};pp.prototype.pick=function(e,t,n){he.throwInstantiationError()};pp.prototype.isDestroyed=function(){he.throwInstantiationError()};pp.prototype.destroy=function(){he.throwInstantiationError()};var A$=pp;function Uv(e,t){this._conditionsExpression=Ge(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,MAt(this,t)}Object.defineProperties(Uv.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function OAt(e,t){this.condition=e,this.expression=t}function MAt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new OAt(new Of(a,t),new Of(c,t)))}e._runtimeConditions=n}Uv.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};Uv.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};Uv.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) { return ${f}; } @@ -15893,7 +15893,7 @@ ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS { ${r} return ${i}(1.0); } -`,r};Uv.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var U3=Uv;function K0(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,IAt(this,e)}function IAt(e,t){t=y(Ge(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Mf(o[r],i))}e._meta=n,e._ready=!0}function ar(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Mf(String(t));if(typeof t=="string")return new Mf(t,n);if(l(t.conditions))return new U3(t,n)}else return;return t}function cr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ge(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(K0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=ar(this,e),this._style.show=cr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=ar(this,e),this._style.color=cr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=ar(this,e),this._style.pointSize=cr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=ar(this,e),this._style.pointOutlineColor=cr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=ar(this,e),this._style.pointOutlineWidth=cr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=ar(this,e),this._style.labelColor=cr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=ar(this,e),this._style.labelOutlineColor=cr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=ar(this,e),this._style.labelOutlineWidth=cr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=ar(this,e),this._style.font=cr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=ar(this,e),this._style.labelStyle=cr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=ar(this,e),this._style.labelText=cr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=ar(this,e),this._style.backgroundColor=cr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=ar(this,e),this._style.backgroundPadding=cr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=ar(this,e),this._style.backgroundEnabled=cr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=ar(this,e),this._style.scaleByDistance=cr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=ar(this,e),this._style.translucencyByDistance=cr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=ar(this,e),this._style.distanceDisplayCondition=cr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=ar(this,e),this._style.heightOffset=cr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=ar(this,e),this._style.anchorLineEnabled=cr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=ar(this,e),this._style.anchorLineColor=cr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=ar(this,e),this._style.image=cr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=ar(this,e),this._style.disableDepthTestDistance=cr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=ar(this,e),this._style.horizontalOrigin=cr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=ar(this,e),this._style.verticalOrigin=cr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=ar(this,e),this._style.labelHorizontalOrigin=cr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=ar(this,e),this._style.labelVerticalOrigin=cr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});K0.fromUrl=function(e){return Se.createIfNeeded(e).fetchJson(e).then(function(n){return new K0(n)})};K0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};K0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};K0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};K0.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var vC=K0;function z3(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new lC({comparator:z3.comparator})}z3.prototype.addSubtree=function(e){let t=new PAt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};z3.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};z3.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function PAt(e,t){this.subtree=e,this.stamp=t}var H3=z3;function OG(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(OG.prototype,{metadataTable:{get:function(){return this._metadataTable}}});OG.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=OAt(n);let r=await RAt(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let d=0;d<a;++d){let p=o.json.bufferViews[d],g=p.byteOffset,m=g+p.byteLength,b=r[p.buffer].subarray(g,m);s[d]=b}let c=o.json.voxelTable,u=o.json.propertyTables[c],f=new OG(e);return f._metadataTable=new Bl({count:u.count,properties:u.properties,class:i.classes[u.class],bufferViews:s}),f};function RAt(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(u){return new Uint8Array(u)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function OAt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=No(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var G3=OG;function MG(e){e=y(e,y.EMPTY_OBJECT),this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new H3}MG.fromUrl=async function(e){let t=Se.createIfNeeded(e),n=await t.fetchJson();LAt(n);let i=VAt(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=ii(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,u=new qb({metadataJson:a,schema:c}),f=new MG;UAt(f,u,s);let d=new Xb(t,o,c),{shape:p,minBounds:g,maxBounds:m,shapeTransform:x,globalTransform:b}=NAt(o);f.shape=p,f.minBounds=g,f.maxBounds=m,f.dimensions=h.unpack(r.dimensions),f.shapeTransform=x,f.globalTransform=b,f.maximumTileCount=MAt(u);let T,C;return l(r.padding)&&(T=h.unpack(r.padding.before),C=h.unpack(r.padding.after)),f.paddingBefore=T,f.paddingAfter=C,f._implicitTileset=d,Ei.unload(i),f};function MAt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(_b.TILESET_TILE_COUNT)}function LAt(e){let t=e.root;if(!l(t.content))throw new re("Root must have content");if(!ii(t.content,"3DTILES_content_voxels"))throw new re("Root tile content must have 3DTILES_content_voxels extension");if(!ii(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new re("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ii(e,"3DTILES_metadata"))throw new re("Tileset must have a metadata schema")}function NAt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=F.unpack(e.transform):n=F.clone(F.IDENTITY),l(t.box))return BAt(t.box,n);if(l(t.region))return FAt(t.region);if(ii(t,"3DTILES_bounding_volume_cylinder"))return kAt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new re("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function FAt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=F.fromScale(ee.WGS84.radii),c=new h(t,n,r),u=new h(i,o,s);return{shape:ki.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a,globalTransform:F.clone(F.IDENTITY)}}function BAt(e,t){let n=vn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:ki.BOX,minBounds:h.clone(dp.DefaultMinBounds),maxBounds:h.clone(dp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function kAt(e,t){let n=vn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:ki.CYLINDER,minBounds:h.clone(hp.DefaultMinBounds),maxBounds:h.clone(hp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function VAt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ei.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ei.getSchemaLoader({schema:i})}function UAt(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([d,p])=>{let{type:g,componentType:m}=p,x=r?.properties[d].min,b=r?.properties[d].max,T=lt.getComponentCount(g),C=OAe(x,T),A=OAe(b,T);return{id:d,type:g,componentType:m,minValue:C,maxValue:A}});e.names=a.map(d=>d.id),e.types=a.map(d=>d.type),e.componentTypes=a.map(d=>d.componentType);let c=a.map(d=>d.minValue),u=a.map(d=>d.maxValue),f=c.some(l);e.minimumValues=f?c:void 0,e.maximumValues=f?u:void 0}function OAe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function zAt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=Pm(o);return await G3.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function HAt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=Pm(a);return o=await pb.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}MG.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new Kb({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),u=c.isSubtreeRoot()&&c.level>0,f=u?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return HAt(this,f).then(function(p){return(u?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?zAt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var A$=MG;function E$(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(E$.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});E$.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=h.fromElements(i,o,r,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var W3=E$;var S$={CUMULUS:0};S$.validate=function(e){return e===S$.CUMULUS};var zv=Object.freeze(S$);function Yh(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new z(this._maximumSize.x,this._maximumSize.y);else{this._scale=z.clone(y(e.scale,new z(20,12)));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=H.clone(y(e.color,H.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var GAt=Yh.SHOW_INDEX=0,WAt=Yh.POSITION_INDEX=1,jAt=Yh.SCALE_INDEX=2,qAt=Yh.MAXIMUM_SIZE_INDEX=3,YAt=Yh.SLICE_INDEX=4,XAt=Yh.BRIGHTNESS_INDEX=5,KAt=Yh.COLOR_INDEX=6;Yh.NUMBER_OF_PROPERTIES=7;function wC(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Yh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,wC(this,GAt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),wC(this,WAt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;z.equals(t,e)||(z.clone(e,t),wC(this,jAt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),wC(this,qAt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),wC(this,KAt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,wC(this,YAt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,wC(this,XAt))}}});Yh.prototype._destroy=function(){this._cloudCollection=void 0};var ff=Yh;var df,LG=new h,ZAt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},$At={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},QAt=ff.SHOW_INDEX,JAt=ff.POSITION_INDEX,eEt=ff.SCALE_INDEX,tEt=ff.MAXIMUM_SIZE_INDEX,nEt=ff.SLICE_INDEX,iEt=ff.BRIGHTNESS_INDEX,oEt=ff.NUMBER_OF_PROPERTIES,rEt=ff.COLOR_INDEX;function Xh(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(oEt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=h.clone(y(e.noiseOffset,h.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:MAe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function MAe(e){return function(){return LG.x=e._textureSliceWidth,LG.y=e._noiseTextureRows,LG.z=1/e._noiseTextureRows,LG}}Object.defineProperties(Xh.prototype,{length:{get:function(){return w$(this),this._clouds.length}}});function LAe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Xh.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,zv.CUMULUS),n;return t===zv.CUMULUS&&(n=new ff(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Xh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Xh.prototype.removeAll=function(){LAe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function w$(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Xh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Xh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Xh.prototype.get=function(e){return w$(this),this._clouds[e]};var sEt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),aEt=new Uint16Array([0,1,2,0,2,3]);function cEt(e){let t=gt.createVertexBuffer({context:e,typedArray:sEt,usage:Fe.STATIC_DRAW}),n=gt.createIndexBuffer({context:e,typedArray:aEt,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT}];return new ei({context:e,attributes:i,indexBuffer:n})}var D$;function lEt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=gt.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function uEt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=gt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function fEt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=gt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function dEt(e,t,n){let i=[{index:df.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:df.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:df.packedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:df.packedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:df.color,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,usage:Fe.STATIC_DRAW}];n&&i.push({index:df.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:fEt(e)});let o=n?t:4*t;return new Mp(e,i,o,n)}var v$=new Gn;function NAe(e,t,n,i){let o,r=n[df.positionHighAndScaleX],s=n[df.positionLowAndScaleY],a=i.position;Gn.fromCartesian(a,v$);let c=i.scale,u=v$.high,f=v$.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),s(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),s(o+0,f.x,f.y,f.z,c.y),s(o+1,f.x,f.y,f.z,c.y),s(o+2,f.x,f.y,f.z,c.y),s(o+3,f.x,f.y,f.z,c.y))}function FAe(e,t,n,i){let o,r=n[df.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function BAe(e,t,n,i){let o,r=n[df.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function kAe(e,t,n,i){let o,r=n[df.color],s=i.color,a=H.floatToByte(s.red),c=H.floatToByte(s.green),u=H.floatToByte(s.blue),f=H.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,u,f)):(o=i._index*4,r(o+0,a,c,u,f),r(o+1,a,c,u,f),r(o+2,a,c,u,f),r(o+3,a,c,u,f))}function hEt(e,t,n,i){NAe(e,t,n,i),FAe(e,t,n,i),BAe(e,t,n,i),kAe(e,t,n,i)}function mEt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=cEt(a),o._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Pt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:et.RGBA,sampler:new $t({wrapS:Cn.REPEAT,wrapT:Cn.REPEAT,minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST})});let f=new kc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:MAe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function pEt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=dEt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];hEt(e,t,s,c)}n._vaf.commit(D$(i))}}var _Et=[];function gEt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=_Et;u.length=0,(c[JAt]||c[eEt])&&u.push(NAe),(c[QAt]||c[iEt])&&u.push(FAe),(c[tEt]||c[nEt])&&u.push(BAe),c[rEt]&&u.push(kAe);let f=u.length,d=i._vaf.writers,p,g,m;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(D$(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function yEt(e,t,n,i){let o=t.context,r=e,s=new Ue({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Ue({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=Qt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:df}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function xEt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new Ze),f.pass=we.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}Xh.prototype.update=function(e){if(w$(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&mEt(this,e,EP,AP),this._instanced=e.context.instancedArrays,df=this._instanced?$At:ZAt,D$=this._instanced?uEt:lEt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?pEt(this,e):r>0&&gEt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&yEt(this,e,CP,TP),xEt(this,e))};Xh.prototype.isDestroyed=function(){return!1};Xh.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),LAe(this._clouds),ue(this)};var I$=Xh;var bEt=P.toRadians(30);function P$(e){this._angle=y(e,bEt)}Object.defineProperties(P$.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});P$.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=h.fromElements(o,r,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var R$=P$;function j3(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } +`,r};Uv.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var U3=Uv;function j0(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,LAt(this,e)}function LAt(e,t){t=y(Ge(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Of(o[r],i))}e._meta=n,e._ready=!0}function cr(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Of(String(t));if(typeof t=="string")return new Of(t,n);if(l(t.conditions))return new U3(t,n)}else return;return t}function lr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ge(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(j0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=cr(this,e),this._style.show=lr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=cr(this,e),this._style.color=lr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=cr(this,e),this._style.pointSize=lr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=cr(this,e),this._style.pointOutlineColor=lr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=cr(this,e),this._style.pointOutlineWidth=lr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=cr(this,e),this._style.labelColor=lr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=cr(this,e),this._style.labelOutlineColor=lr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=cr(this,e),this._style.labelOutlineWidth=lr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=cr(this,e),this._style.font=lr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=cr(this,e),this._style.labelStyle=lr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=cr(this,e),this._style.labelText=lr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=cr(this,e),this._style.backgroundColor=lr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=cr(this,e),this._style.backgroundPadding=lr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=cr(this,e),this._style.backgroundEnabled=lr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=cr(this,e),this._style.scaleByDistance=lr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=cr(this,e),this._style.translucencyByDistance=lr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=cr(this,e),this._style.distanceDisplayCondition=lr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=cr(this,e),this._style.heightOffset=lr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=cr(this,e),this._style.anchorLineEnabled=lr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=cr(this,e),this._style.anchorLineColor=lr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=cr(this,e),this._style.image=lr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=cr(this,e),this._style.disableDepthTestDistance=lr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=cr(this,e),this._style.horizontalOrigin=lr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=cr(this,e),this._style.verticalOrigin=lr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=cr(this,e),this._style.labelHorizontalOrigin=lr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=cr(this,e),this._style.labelVerticalOrigin=lr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});j0.fromUrl=function(e){return Se.createIfNeeded(e).fetchJson(e).then(function(n){return new j0(n)})};j0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};j0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};j0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};j0.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var vC=j0;function z3(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new lC({comparator:z3.comparator})}z3.prototype.addSubtree=function(e){let t=new NAt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};z3.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};z3.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function NAt(e,t){this.subtree=e,this.stamp=t}var H3=z3;function IG(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(IG.prototype,{metadataTable:{get:function(){return this._metadataTable}}});IG.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=BAt(n);let r=await FAt(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let d=0;d<a;++d){let p=o.json.bufferViews[d],g=p.byteOffset,m=g+p.byteLength,b=r[p.buffer].subarray(g,m);s[d]=b}let c=o.json.voxelTable,u=o.json.propertyTables[c],f=new IG(e);return f._metadataTable=new Bl({count:u.count,properties:u.properties,class:i.classes[u.class],bufferViews:s}),f};function FAt(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(u){return new Uint8Array(u)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function BAt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Fo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var G3=IG;function PG(e){e=y(e,y.EMPTY_OBJECT),this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new H3}PG.fromUrl=async function(e){let t=Se.createIfNeeded(e),n=await t.fetchJson();VAt(n);let i=WAt(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=oi(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,u=new Hb({metadataJson:a,schema:c}),f=new PG;jAt(f,u,s);let d=new Wb(t,o,c),{shape:p,minBounds:g,maxBounds:m,shapeTransform:x,globalTransform:b}=UAt(o);f.shape=p,f.minBounds=g,f.maxBounds=m,f.dimensions=h.unpack(r.dimensions),f.shapeTransform=x,f.globalTransform=b,f.maximumTileCount=kAt(u);let T,C;return l(r.padding)&&(T=h.unpack(r.padding.before),C=h.unpack(r.padding.after)),f.paddingBefore=T,f.paddingAfter=C,f._implicitTileset=d,Si.unload(i),f};function kAt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(db.TILESET_TILE_COUNT)}function VAt(e){let t=e.root;if(!l(t.content))throw new re("Root must have content");if(!oi(t.content,"3DTILES_content_voxels"))throw new re("Root tile content must have 3DTILES_content_voxels extension");if(!oi(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new re("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!oi(e,"3DTILES_metadata"))throw new re("Tileset must have a metadata schema")}function UAt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=F.unpack(e.transform):n=F.clone(F.IDENTITY),l(t.box))return HAt(t.box,n);if(l(t.region))return zAt(t.region);if(oi(t,"3DTILES_bounding_volume_cylinder"))return GAt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new re("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function zAt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=F.fromScale(ee.WGS84.radii),c=new h(t,n,r),u=new h(i,o,s);return{shape:Vi.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a,globalTransform:F.clone(F.IDENTITY)}}function HAt(e,t){let n=vn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Vi.BOX,minBounds:h.clone(up.DefaultMinBounds),maxBounds:h.clone(up.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function GAt(e,t){let n=vn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Vi.CYLINDER,minBounds:h.clone(fp.DefaultMinBounds),maxBounds:h.clone(fp.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function WAt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Si.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Si.getSchemaLoader({schema:i})}function jAt(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([d,p])=>{let{type:g,componentType:m}=p,x=r?.properties[d].min,b=r?.properties[d].max,T=ct.getComponentCount(g),C=LAe(x,T),A=LAe(b,T);return{id:d,type:g,componentType:m,minValue:C,maxValue:A}});e.names=a.map(d=>d.id),e.types=a.map(d=>d.type),e.componentTypes=a.map(d=>d.componentType);let c=a.map(d=>d.minValue),u=a.map(d=>d.maxValue),f=c.some(l);e.minimumValues=f?c:void 0,e.maximumValues=f?u:void 0}function LAe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function qAt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=Im(o);return await G3.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function YAt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=Im(a);return o=await fb.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}PG.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new jb({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),u=c.isSubtreeRoot()&&c.level>0,f=u?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return YAt(this,f).then(function(p){return(u?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?qAt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var E$=PG;function S$(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(S$.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});S$.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=h.fromElements(i,o,r,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var W3=S$;var v$={CUMULUS:0};v$.validate=function(e){return e===v$.CUMULUS};var zv=Object.freeze(v$);function qh(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new z(this._maximumSize.x,this._maximumSize.y);else{this._scale=z.clone(y(e.scale,new z(20,12)));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=H.clone(y(e.color,H.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var XAt=qh.SHOW_INDEX=0,KAt=qh.POSITION_INDEX=1,ZAt=qh.SCALE_INDEX=2,$At=qh.MAXIMUM_SIZE_INDEX=3,QAt=qh.SLICE_INDEX=4,JAt=qh.BRIGHTNESS_INDEX=5,eEt=qh.COLOR_INDEX=6;qh.NUMBER_OF_PROPERTIES=7;function wC(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(qh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,wC(this,XAt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),wC(this,KAt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;z.equals(t,e)||(z.clone(e,t),wC(this,ZAt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),wC(this,$At))}},color:{get:function(){return this._color},set:function(e){let t=this._color;H.equals(t,e)||(H.clone(e,t),wC(this,eEt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,wC(this,QAt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,wC(this,JAt))}}});qh.prototype._destroy=function(){this._cloudCollection=void 0};var uf=qh;var ff,RG=new h,tEt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},nEt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},iEt=uf.SHOW_INDEX,oEt=uf.POSITION_INDEX,rEt=uf.SCALE_INDEX,sEt=uf.MAXIMUM_SIZE_INDEX,aEt=uf.SLICE_INDEX,cEt=uf.BRIGHTNESS_INDEX,lEt=uf.NUMBER_OF_PROPERTIES,uEt=uf.COLOR_INDEX;function Yh(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(lEt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=h.clone(y(e.noiseOffset,h.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:NAe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function NAe(e){return function(){return RG.x=e._textureSliceWidth,RG.y=e._noiseTextureRows,RG.z=1/e._noiseTextureRows,RG}}Object.defineProperties(Yh.prototype,{length:{get:function(){return D$(this),this._clouds.length}}});function FAe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Yh.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,zv.CUMULUS),n;return t===zv.CUMULUS&&(n=new uf(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Yh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Yh.prototype.removeAll=function(){FAe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function D$(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Yh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Yh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Yh.prototype.get=function(e){return D$(this),this._clouds[e]};var fEt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),dEt=new Uint16Array([0,1,2,0,2,3]);function hEt(e){let t=_t.createVertexBuffer({context:e,typedArray:fEt,usage:Fe.STATIC_DRAW}),n=_t.createIndexBuffer({context:e,typedArray:dEt,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT}];return new ti({context:e,attributes:i,indexBuffer:n})}var I$;function mEt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=_t.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function pEt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=_t.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function _Et(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=_t.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function gEt(e,t,n){let i=[{index:ff.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:ff.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:ff.packedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:ff.packedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:ff.color,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,usage:Fe.STATIC_DRAW}];n&&i.push({index:ff.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:_Et(e)});let o=n?t:4*t;return new Rp(e,i,o,n)}var w$=new Hn;function BAe(e,t,n,i){let o,r=n[ff.positionHighAndScaleX],s=n[ff.positionLowAndScaleY],a=i.position;Hn.fromCartesian(a,w$);let c=i.scale,u=w$.high,f=w$.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),s(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),s(o+0,f.x,f.y,f.z,c.y),s(o+1,f.x,f.y,f.z,c.y),s(o+2,f.x,f.y,f.z,c.y),s(o+3,f.x,f.y,f.z,c.y))}function kAe(e,t,n,i){let o,r=n[ff.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function VAe(e,t,n,i){let o,r=n[ff.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function UAe(e,t,n,i){let o,r=n[ff.color],s=i.color,a=H.floatToByte(s.red),c=H.floatToByte(s.green),u=H.floatToByte(s.blue),f=H.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,u,f)):(o=i._index*4,r(o+0,a,c,u,f),r(o+1,a,c,u,f),r(o+2,a,c,u,f),r(o+3,a,c,u,f))}function yEt(e,t,n,i){BAe(e,t,n,i),kAe(e,t,n,i),VAe(e,t,n,i),UAe(e,t,n,i)}function xEt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=hEt(a),o._spNoise=$t.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new It({context:a,width:r*r/s,height:r*s,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:et.RGBA,sampler:new Zt({wrapS:Cn.REPEAT,wrapT:Cn.REPEAT,minificationFilter:Kt.NEAREST,magnificationFilter:di.NEAREST})});let f=new kc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:NAe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function bEt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=gEt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];yEt(e,t,s,c)}n._vaf.commit(I$(i))}}var TEt=[];function CEt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=TEt;u.length=0,(c[oEt]||c[rEt])&&u.push(BAe),(c[iEt]||c[cEt])&&u.push(kAe),(c[sEt]||c[aEt])&&u.push(VAe),c[uEt]&&u.push(UAe);let f=u.length,d=i._vaf.writers,p,g,m;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(I$(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function AEt(e,t,n,i){let o=t.context,r=e,s=new Ue({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Ue({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=$t.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:ff}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:ln.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function EEt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new Ze),f.pass=we.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}Yh.prototype.update=function(e){if(D$(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&xEt(this,e,I3,D3),this._instanced=e.context.instancedArrays,ff=this._instanced?nEt:tEt,I$=this._instanced?pEt:mEt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?bEt(this,e):r>0&&CEt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&AEt(this,e,w3,v3),EEt(this,e))};Yh.prototype.isDestroyed=function(){return!1};Yh.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),FAe(this._clouds),ue(this)};var P$=Yh;var SEt=P.toRadians(30);function R$(e){this._angle=y(e,SEt)}Object.defineProperties(R$.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});R$.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=h.fromElements(o,r,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var O$=R$;function j3(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } `;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); } `;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); } `;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); } @@ -15914,7 +15914,7 @@ ${r} void main() { out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=io.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(j3.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});j3.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;j3.prototype.isTranslucent=io.prototype.isTranslucent;j3.prototype.getRenderState=io.prototype.getRenderState;var O$=j3;function NG(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}NG.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new vt({geometry:new tg({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[H.RED,H.RED],arcType:Jt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new vt({geometry:new tg({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[H.GREEN,H.GREEN],arcType:Jt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new vt({geometry:new tg({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[H.BLUE,H.BLUE],arcType:Jt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new Dn({geometryInstances:[t,n,i],appearance:new es,asynchronous:!1})}this._primitive.update(e)}};NG.prototype.isDestroyed=function(){return!1};NG.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var q3=NG;function TEt(e){this.direction=h.clone(e.direction),this.color=H.clone(y(e.color,H.WHITE)),this.intensity=y(e.intensity,1)}var M$=TEt;var Y3=`in vec3 v_positionMC; +}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=io.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(j3.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});j3.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;j3.prototype.isTranslucent=io.prototype.isTranslucent;j3.prototype.getRenderState=io.prototype.getRenderState;var M$=j3;function OG(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}OG.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new St({geometry:new J_({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[H.RED,H.RED],arcType:Qt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new St({geometry:new J_({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[H.GREEN,H.GREEN],arcType:Qt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new St({geometry:new J_({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[H.BLUE,H.BLUE],arcType:Qt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new Dn({geometryInstances:[t,n,i],appearance:new es,asynchronous:!1})}this._primitive.update(e)}};OG.prototype.isDestroyed=function(){return!1};OG.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var q3=OG;function vEt(e){this.direction=h.clone(e.direction),this.color=H.clone(y(e.color,H.WHITE)),this.intensity=y(e.intensity,1)}var L$=vEt;var Y3=`in vec3 v_positionMC; in vec3 v_positionEC; in vec2 v_st; @@ -15966,7 +15966,7 @@ void main() gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function DC(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,X3),this._fragmentShaderSource=y(e.fragmentShaderSource,Y3),this._renderState=io.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(DC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return DC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});DC.VERTEX_FORMAT=Ie.POSITION_AND_ST;DC.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;DC.prototype.isTranslucent=io.prototype.isTranslucent;DC.prototype.getRenderState=io.prototype.getRenderState;var L$=DC;function au(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,au.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,au.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,au.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,au.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,au.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new me,this._nominalFrameRate=new me,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){CEt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){AEt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}au.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};au.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new au({scene:e})),e._frameRateMonitor};Object.defineProperties(au.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});au.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};au.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};au.prototype.isDestroyed=function(){return!1};au.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function CEt(e,t){if(e._pauseCount>0)return;let n=bi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/qn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function AEt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var K3=au;var VAe=Ko(jZ(),1);function N$(){this._image=new Image}N$.prototype.isReady=function(){return!0};N$.prototype.shouldDiscardImage=function(e){return e===this._image};function IC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Tt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new N$),this._errorEvent=new me}Object.defineProperties(IC.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});IC.fromMetadata=function(e,t){if(!e.imageryPresent)throw new re(`The server ${e.url} doesn't have imagery`);let n=new IC(t);return n._metadata=e,n};IC.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};IC.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=Dg.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let u=new Zo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=EEt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){k3(r.key,u);let f=new Uint8Array(u),d,p=r.protoImagery;if((!l(p)||!p)&&(d=SEt(f)),!l(d)&&(!l(p)||p)){let g=vEt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?o:cb({uint8Array:f,format:d,flipY:!0})})};IC.prototype.pickFeatures=function(e,t,n,i,o){};function EEt(e,t,n,i,o,r){let s=Dg.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function SEt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function vEt(e){let t=VAe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new re("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var F$=IC;var wEt=new H(1,1,1,.4),DEt=new H(0,1,0,.05),IEt=new H(0,.5,0,.2);function PC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Xi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,wEt),this._glowColor=y(e.glowColor,DEt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,IEt),this._errorEvent=new me,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(PC.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});PC.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};PC.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};PC.prototype.getTileCredits=function(e,t,n){};PC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};PC.prototype.pickFeatures=function(e,t,n,i,o){};var B$=PC;function Kh(){}Kh._maxDecodingConcurrency=Math.max(Ht.hardwareConcurrency-1,1);Kh._decodeTaskProcessor=new _i("decodeI3S",Kh._maxDecodingConcurrency);Kh._promise=void 0;async function PEt(){if(await Kh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Kh._decodeTaskProcessor;throw new re("I3S decoder could not be initialized.")}Kh.decode=async function(e,t,n,i,o){return l(Kh._promise)||(Kh._promise=PEt()),Kh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let d=$.fromRotationX(-P.PI_OVER_TWO),p=new $;$.multiply(d,a,p);let g=fe.fromDegrees(c,u,f),m=ee.WGS84.cartographicToCartesian(g),x={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ee.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(x)})};var Z3=Kh;function k$(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(k$.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});k$.prototype.load=async function(){return this._data=await Zh.loadJson(this._resource),this._data};var $3=k$;function Pg(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(Pg.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function FG(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function REt(e){return e==="String"?1:FG(e)}async function OEt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}Pg.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=OEt(this).catch(function(e){console.error(e)}),this._loadPromise)};Pg.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};Pg.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};Pg.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[o].push(c)}}}};Pg.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=FG(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=FG(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Pg.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=REt(i.valueType)}if(e.byteLength<t)throw new re(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Pg.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new re(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=FG(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new re(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new re(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new re(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var Q3=Pg;function J3(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(J3.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});J3.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var MEt=new h,LEt=new h,NEt=new h,FEt=new h,BEt=new h;function V$(e,t,n,i){let o=h.subtract(i,n,MEt),r=h.cross(o,h.subtract(e,n,LEt),FEt),s=h.cross(o,h.subtract(t,n,NEt),BEt);return h.dot(r,s)>=0}var kEt=new h,VEt=new h,UEt=new h,zEt=new h,HEt=new h,GEt=new h,WEt=new h,jEt=new h,qEt=new h,YEt=new h;J3.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,m,x;l(f)?(g=f[p],m=f[p+1],x=f[p+2]):(g=p*3,m=p*3+1,x=p*3+2);let b=h.fromElements(u[g*3],u[g*3+1],u[g*3+2],kEt),T=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],VEt),C=new h(u[x*3],u[x*3+1],u[x*3+2],UEt);if(!V$(i,b,T,C)||!V$(i,T,b,C)||!V$(i,C,b,T))continue;let A=h.subtract(T,b,zEt),E=h.subtract(C,b,HEt),v=h.cross(A,E,GEt);if(h.magnitude(v)===0)continue;let D=h.normalize(v,WEt),O=h.subtract(i,b,jEt),R=Math.abs(h.dot(O,D));if(R<o){o=R,r=p;let M=h.magnitudeSquared(h.subtract(i,b,O)),N=h.magnitudeSquared(h.subtract(i,T,qEt)),_=h.magnitudeSquared(h.subtract(i,C,YEt));M<N&&M<_?(a=g,c=b,s=M):N<_?(a=m,c=T,s=N):(a=x,c=C,s=_)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function UAe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(SC(e[i])):t.push(e[i]);return t}J3.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let A=this._parent._data.mesh.material.definition;if(A>=0&&A<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[A],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let E="0";if(l(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let D=this._layer._data.textureSetDefinitions[v];for(let O=0;O<D.formats.length;O++){let R=D.formats[O];if(R.format==="jpg"){E=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${E}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=UAe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=UAe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let x=[],b=n.length;for(let C=0;C<b;C++){let A=n[C].primitives,E=A.length;for(let v=0;v<E;v++){let D=A[v];if(l(D.material)){for(;D.material>=x.length;){let R=Ge(c,!0);x.push(R)}let O=x[D.material];l(D.extra)&&D.extra.isTransparent?l(O.alphaMode)||(O.alphaMode="BLEND"):O.alphaMode==="BLEND"&&(O.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:x,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var Hv=J3;function Lc(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(Lc.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Lc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Qf(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Zh.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function zAe(e,t){let n=new Q3(e,t);return e._fields[t.name]=n,n.load()}Lc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(zAe(this,i))}return Promise.all(t)};Lc.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return zAe(this,o)}return Promise.resolve()};Lc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Lc.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Lc.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Lc(e,y(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Lc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new Hv(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new Hv(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Lc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new $3(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Lc.prototype._clearGeometryData=function(){this._geometryData=[]};Lc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=fe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=fe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let T=0;T<this._dataProvider._geoidDataList.length;T++){let C=this._dataProvider._geoidDataList[T],A=C.projection.project(n);if(A.x>C.nativeExtent.west&&A.x<C.nativeExtent.east&&A.y>C.nativeExtent.south&&A.y<C.nativeExtent.north){n.height+=$Et(A.x,A.y,C);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ee.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ee.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let T=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/T}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let T=this._data.lodThreshold;s=r/T}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let T=0;T<this._data.lodSelection.length;T++)this._data.lodSelection[T].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[T].maxError);s===1/0&&(s=1e5);let a=s*16,c=new va(0,0,0),u=Mt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Oe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new F(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),g=F.inverse(p,new F),m=F.clone(p);l(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let x=[];for(let T=0;T<this._children.length;T++)x.push(this._children[T]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Lc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Lc.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await Z3.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function XEt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function KEt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function HAe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await XEt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!KEt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Lc.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=HAe(this,t);e.push(n)}return Promise.all(e)};Qf.prototype._hookedRequestContent=Qf.prototype.requestContent;Qf.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new Se({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{HAe(e._i3sNode,n)})),e._isLoading=!1,t})}};function ZEt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function BG(e,t,n,i){let o=e+t*n;return i[o]}function $Et(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=BG(s,a,n.width,n.buffer),d=BG(c,a,n.width,n.buffer),p=BG(s,u,n.width,n.buffer),g=BG(c,u,n.width,n.buffer),m=ZEt(o,r,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Qf.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var Gv=Lc;function kG(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(kG.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function U$(e,t){let n=[];for(let i=0;i<e.length;i++){let o=H.byteToFloat(e[i]);i<3?n.push(SC(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function Wv(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=U$(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=U$(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=U$(a.color,a.transparency)))}break}}return n}function QEt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=Wv(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=Wv(o.symbol,t)}return n}}function JEt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=y(o.classMaxValue,o.classMinValue),a=y(r.classMaxValue,r.classMinValue);return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(Wv(r.symbol,t)))}return i.symbols.push(void 0),i}}kG.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=Wv(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=Wv(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=QEt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=Wv(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=JEt(i,n))}};function GAe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?GAe(s,t,n,i):s}}function eSt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function tSt(e,t,n){let i=t[n],o=eSt(e.ranges,i);return e.symbols[o]}kG.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>GAe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>tSt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var ek=kG;function cu(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Se({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(cu.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});cu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new re(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new ek(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};cu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};cu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};cu.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new Gv(this,t,!0)}else this._rootNode=new Gv(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};cu.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};cu._fetchJson=function(e){return e.fetchJson()};cu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=cu._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};cu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=se.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=se.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};cu.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Ge(e):{},e.outlineColor=H.fromCartesian4(oe.fromArray(o))),this._tileset=await xs.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};cu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};cu.prototype.filterByAttributes=function(e){this._filters=l(e)?Ge(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var RC=cu;function VG(e,t){this._dataProvider=e,this._resource=new Se({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(VG.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});VG.prototype.load=async function(){return this._data=await Zh.loadJson(this._resource),this._data};VG.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var tk=VG;function nk(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=y(n.visibility,!0),this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(nk.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});nk._fromData=async function(e,t,n,i){let o=new nk(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let u=nk._fromData(e,t,r[c],o);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Se({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Zh.loadJson(o._resource),c=new RC(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var ik=nk;var qAe=Ko(WAe(),1);function Cs(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=y(e.showFeatures,!1),this._adjustMaterialAlphaMode=y(e.adjustMaterialAlphaMode,!1),this._applySymbology=y(e.applySymbology,!1),this._calculateNormals=y(e.calculateNormals,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(Cs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});Cs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};Cs.prototype.isDestroyed=function(){return!1};Cs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Cs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Cs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Cs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function nSt(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function jAe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=nSt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=ik._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new tk(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=se.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new RC(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}Cs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Cs.loadJson(n),o=new Cs(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=jAe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await jAe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};Cs._fetchJson=function(e){return e.fetchJson()};Cs.loadJson=async function(e){let t=await Cs._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new re(t.error)}return t};Cs.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new re(`Failed to load binary: ${e.url}`);return t};Cs.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var iSt=new z;function oSt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=fe.fromRadians(t.west,t.north),a=fe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=z.fromElements(d,p,iSt),m=g.toString();if(!o.hasOwnProperty(m)){let x={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=x,i.push(x)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},x=d[g],b="Geographic";n._projection instanceof Pi&&(b="WebMercator");let T={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===dd.LERC){let C=qAe.default.decode(x._buffer);T.buffer=C.pixels[0]}else T.buffer=x._buffer;p.push(T)}return p})}async function rSt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await oSt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Cs.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=rSt(this),this._geoidDataPromise)};Cs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?se.union(e,n,e):e=se.clone(n)}this._extent=e};Cs.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Cs.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};Cs.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Zh=Cs;var z$={};z$.createTilesetFromIModelId=async function(e,t){let{exports:n}=await uf.getExports(e);if(n.length>0&&n.every(a=>a.status===uf.ExportStatus.Invalid))throw new re(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===uf.ExportStatus.Complete);if(!l(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new Se({url:r});return xs.fromUrl(s,t)};z$.createTilesetForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await uf.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![uf.RealityDataType.Cesium3DTiles,uf.RealityDataType.PNTS,uf.RealityDataType.RealityMesh3DTiles,uf.RealityDataType.Terrain3DTiles].includes(n))throw new re(`Reality data type is not a mesh type: ${n}`);let r=await uf.getRealityDataURL(e,t,i);return xs.fromUrl(r,{maximumScreenSpaceError:4})};var H$=z$;function YAe(){}Object.defineProperties(YAe.prototype,{color:{get:he.throwInstantiationError},intensity:{get:he.throwInstantiationError}});var G$=YAe;var sSt=/\/$/,XAe=new Tt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function jv(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Se.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();sSt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Tt(c))):c=XAe,this._resource=i,this._imageryProvider=new Ga({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(jv.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});jv.prototype.getTileCredits=function(e,t,n){};jv.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};jv.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};jv._defaultCredit=XAe;var W$=jv;function j$(e){}j$.prototype.isReady=function(){return!0};j$.prototype.shouldDiscardImage=function(e){return!1};var q$=j$;var aSt=new Tt("MapQuest, Open Street Map and contributors, CC-BY-SA");function zG(e){e=y(e,y.EMPTY_OBJECT);let t=Se.createIfNeeded(y(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${y(e.fileExtension,"png")}`;let n=new as({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(se.southwest(a),r),u=n.positionToTileXY(se.northeast(a),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=y(e.credit,aSt);typeof d=="string"&&(d=new Tt(d)),Ga.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(zG.prototype=Object.create(Ga.prototype),zG.prototype.constructor=zG);var Rg=zG;var cSt=new z(1,1);function Y$(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=h.clone(y(e.position,h.ZERO)),this.velocity=h.clone(y(e.velocity,h.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=H.clone(y(e.startColor,H.WHITE)),this.endColor=H.clone(y(e.endColor,H.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=z.clone(y(e.imageSize,cSt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Y$.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var KAe=new h;Y$.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,KAe),h.add(this.position,KAe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var qv=Y$;function ZAe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(ZAe.prototype,{complete:{get:function(){return this._complete}}});var X$=ZAe;function $Ae(e){}$Ae.prototype.emit=function(e){he.throwInstantiationError()};var K$=$Ae;var QAe=new z(1,1);function ok(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new W3(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._emitterModelMatrix=F.clone(y(e.emitterModelMatrix,F.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=H.clone(y(e.color,y(e.startColor,H.WHITE))),this._endColor=H.clone(y(e.color,y(e.endColor,H.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=z.clone(y(e.imageSize,y(e.minimumImageSize,QAe))),this._maximumImageSize=z.clone(y(e.imageSize,y(e.maximumImageSize,QAe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new me,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(ok.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){H.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){H.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function lSt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let d=o.length;for(let p=0;p<d;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new qv;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function uSt(e){let t=e._particlePool.pop();return l(t)||(t=new qv),t}function fSt(e,t){e._particlePool.push(t)}function dSt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function hSt(e){l(e._billboard)&&(e._billboard.show=!1)}function JAe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new H(i,o,r,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function mSt(e,t){t.startColor=H.clone(e._startColor,t.startColor),t.endColor=H.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function pSt(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var HG=new h;ok.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Ru),this._updateParticlePool&&(lSt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=Z.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?JAe(this,s):(hSt(s),fSt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=pSt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)s=uSt(this),this._emitter.emit(s),h.add(s.position,s.velocity,HG),F.multiplyByPoint(u,HG,HG),s.position=F.multiplyByPoint(u,s.position,s.position),h.subtract(HG,s.position,s.velocity),h.normalize(s.velocity,s.velocity),mSt(this,s),JAe(this,s)}if(this._billboardCollection.update(e),this._previousTime=Z.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&dSt(this)};ok.prototype.isDestroyed=function(){return!1};ok.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var Z$=ok;function hf(){he.throwInstantiationError()}hf.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(hf.prototype,{quadtree:{get:he.throwInstantiationError,set:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError}});hf.prototype.update=he.throwInstantiationError;hf.prototype.beginUpdate=he.throwInstantiationError;hf.prototype.endUpdate=he.throwInstantiationError;hf.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;hf.prototype.loadTile=he.throwInstantiationError;hf.prototype.computeTileVisibility=he.throwInstantiationError;hf.prototype.showTileThisFrame=he.throwInstantiationError;hf.prototype.computeDistanceToTile=he.throwInstantiationError;hf.prototype.isDestroyed=he.throwInstantiationError;hf.prototype.destroy=he.throwInstantiationError;var $$=hf;function Q$(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(Q$.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Q$.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(o,r,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var J$=Q$;function rk(){}rk.prototype.evaluate=function(e,t){he.throwInstantiationError()};rk.prototype.evaluateColor=function(e,t){he.throwInstantiationError()};rk.prototype.getShaderFunction=function(e,t,n,i){he.throwInstantiationError()};rk.prototype.getVariables=function(){he.throwInstantiationError()};var eQ=rk;function Yv(e){this._ready=!1,this._provider=void 0,this._errorEvent=new me,this._readyEvent=new me,gSt(this,e)}Object.defineProperties(Yv.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});Yv.fromWorldTerrain=function(e){return new Yv(EC(e))};Yv.fromWorldBathymetry=function(e){return new Yv(B3(e))};function _St(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function gSt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){_St(e._errorEvent,i)}}var sk=Yv;function Xv(){}Xv.prototype.boundingVolume=void 0;Xv.prototype.boundingSphere=void 0;Xv.prototype.distanceToCamera=function(e){he.throwInstantiationError()};Xv.prototype.intersectPlane=function(e){he.throwInstantiationError()};Xv.prototype.createDebugVolume=function(e){he.throwInstantiationError()};var tQ=Xv;function ak(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Xi({ellipsoid:e.ellipsoid}),this._color=y(e.color,H.YELLOW),this._errorEvent=new me,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(ak.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});ak.prototype.getTileCredits=function(e,t,n){};ak.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};ak.prototype.pickFeatures=function(e,t,n,i,o){};var ck=ak;function nQ(e){he.throwInstantiationError()}nQ.prototype.isReady=he.throwInstantiationError;nQ.prototype.shouldDiscardImage=he.throwInstantiationError;var iQ=nQ;var ySt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},oQ=Object.freeze(ySt);function GG(e,t){this.show=!0,l(e)||(e=new je),this.rectangle=je.clone(e),l(t)||(t=Yi.fromType(Yi.ColorType,{color:new H(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}GG.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!je.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:un.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Ue({sources:[this._material.shaderSource,n1]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=we.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};GG.prototype.isDestroyed=function(){return!1};GG.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var rQ=GG;function sQ(){he.throwInstantiationError()}Object.defineProperties(sQ.prototype,{globalTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shape:{get:he.throwInstantiationError},minBounds:{get:he.throwInstantiationError},maxBounds:{get:he.throwInstantiationError},dimensions:{get:he.throwInstantiationError},paddingBefore:{get:he.throwInstantiationError},paddingAfter:{get:he.throwInstantiationError},names:{get:he.throwInstantiationError},types:{get:he.throwInstantiationError},componentTypes:{get:he.throwInstantiationError},minimumValues:{get:he.throwInstantiationError},maximumValues:{get:he.throwInstantiationError},maximumTileCount:{get:he.throwInstantiationError},keyframeCount:{get:he.throwInstantiationError},timeIntervalCollection:{get:he.throwInstantiationError}});sQ.prototype.requestData=he.throwInstantiationError;var aQ=sQ;function OC(){he.throwInstantiationError()}Object.defineProperties(OC.prototype,{orientedBoundingBox:{get:he.throwInstantiationError},boundingSphere:{get:he.throwInstantiationError},boundTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shaderUniforms:{get:he.throwInstantiationError},shaderDefines:{get:he.throwInstantiationError},shaderMaximumIntersectionsLength:{get:he.throwInstantiationError}});OC.prototype.update=he.throwInstantiationError;OC.prototype.computeOrientedBoundingBoxForTile=he.throwInstantiationError;OC.prototype.computeOrientedBoundingBoxForSample=he.throwInstantiationError;OC.DefaultMinBounds=he.throwInstantiationError;OC.DefaultMaxBounds=he.throwInstantiationError;var cQ=OC;var xSt=new H,bSt=new H,TSt=new H,CSt=new H,eEe=new oe,lk=new Uint8Array(4);function tEe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return H.lerp(t.color,n.color,o,i)}function WG(e,t){return{height:e,color:H.clone(t)}}function nEe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?H.equals(t.color,i[n-1].color):!1,a=r?H.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?H.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function ASt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],m=P.clamp(g.height,lu._minimumHeight,lu._maximumHeight),x=H.clone(g.color,xSt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(WG(m,x))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||pg(c,function(g,m){return P.sign(g.height-m.height)});let d=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,WG(lu._minimumHeight,c[0].color)),p&&c.splice(c.length,0,WG(lu._maximumHeight,c[c.length-1].color)),c=nEe(c),i.push(c)}return i}function ESt(e){let t=ASt(e),n=[],i=[],o;function r(u,f){n.push(WG(u,f))}function s(u,f,d){let p=H.multiplyByScalar(d,1-f.alpha,CSt);p=H.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,x=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,T=d<g?i[d]:void 0,C=d>0?i[d-1]:void 0,A=d<g-1?i[d+1]:void 0;if(l(m)&&l(T)&&m.height===T.height){let E=l(A)&&T.height===A.height,v=!l(C),D=!l(A),O=l(b)&&m.height===b.height,R=!l(x),M=!l(b);E?O?(s(m.height,m.color,T.color),s(m.height,b.color,A.color)):R?(r(m.height,T.color),s(m.height,m.color,A.color)):M?(s(m.height,m.color,T.color),r(m.height,A.color)):(s(m.height,m.color,T.color),s(m.height,m.color,A.color)):v?O?(r(m.height,m.color),s(m.height,b.color,T.color)):M?(r(m.height,m.color),r(m.height,T.color)):(R||r(m.height,m.color),s(m.height,m.color,T.color)):D?O?(s(m.height,m.color,T.color),r(m.height,b.color)):R?(r(m.height,T.color),r(m.height,m.color)):M?s(m.height,m.color,T.color):(s(m.height,m.color,T.color),r(m.height,m.color)):O?(s(m.height,m.color,T.color),s(m.height,b.color,T.color)):R?(r(m.height,T.color),s(m.height,m.color,T.color)):M?(s(m.height,m.color,T.color),r(m.height,T.color)):s(m.height,m.color,T.color),f+=O?2:1,d+=E?2:1}else if(l(m)&&l(T)&&l(C)&&m.height<T.height){let E=tEe(m.height,C,T,TSt);l(x)?l(b)?s(m.height,m.color,E):(s(m.height,m.color,E),r(m.height,E)):(r(m.height,E),s(m.height,m.color,E)),f++}else if(l(T)&&l(m)&&l(x)&&T.height<m.height){let E=tEe(T.height,x,m,bSt);l(C)?l(A)?s(T.height,E,T.color):(s(T.height,E,T.color),r(T.height,E)):(r(T.height,E),s(T.height,E,T.color)),d++}else l(m)&&(!l(T)||m.height<T.height)?(l(T)&&!l(C)&&!l(b)?(r(m.height,m.color),r(m.height,lu._emptyColor),r(T.height,lu._emptyColor)):(!l(T)&&l(C)&&!l(x)&&(r(C.height,lu._emptyColor),r(m.height,lu._emptyColor)),r(m.height,m.color)),f++):l(T)&&(!l(m)||T.height<m.height)&&(r(T.height,T.color),d++)}}return nEe(n)}function lu(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=ESt(n),r=o.length,s,a,c;if(!lu._useFloatTexture(i)){a=Ke.UNSIGNED_BYTE,c=et.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)oe.packFloat(o[g].height,eEe),oe.pack(eEe,s,g*4)}else{a=Ke.FLOAT,c=i.webgl2?et.RED:et.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let f=Pt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST})}),d=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(lk),d[g*4+0]=lk[0],d[g*4+1]=lk[1],d[g*4+2]=lk[2],d[g*4+3]=lk[3];let p=Pt.create({context:i,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR,magnificationFilter:di.LINEAR})});return Yi.fromType("ElevationBand",{heights:f,colors:p})}lu._useFloatTexture=function(e){return e.floatingPointTexture};lu._maximumHeight=5906376425472;lu._minimumHeight=-5906376425472;lu._emptyColor=new H(0,0,0,0);var lQ=lu;async function SSt(e,t){t=y(t,{}),t.cacheBytes=y(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=y(t.maximumCacheOverflowBytes,1024*1024*1024),t.enableCollision=y(t.enableCollision,!0),e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(ms("createGooglePhotorealistic3DTileset(key)","createGooglePhotorealistic3DTileset(key) has been deprecated. It is replaced by createGooglePhotorealistic3DTileset({key}). It will be removed in Cesium 1.126."),e={key:e}),e.onlyUsingWithGoogleGeocoder||yt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=y(e.key,TC.defaultApiKey);if(!l(n))return vSt(t);let i,o=TC.getDefaultCredit();l(o)&&(i=[o]);let r=new Se({url:`${TC.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return xs.fromUrl(r,t)}var iEe={};async function vSt(e){let i=iEe[2275207];l(i)||(i=Cu.fromAssetId(2275207),iEe[2275207]=i);let o=await i;return xs.fromUrl(o,e)}var uQ=SSt;async function wSt(e){let t=await xs.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,H.WHITE).toCssColorString();n=new vC({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var fQ=wSt;function DSt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=F.clone(y(e.modelMatrix,F.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new vt({geometry:Ln.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Wt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new vt({geometry:Ln.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Wt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new vt({geometry:Ln.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Wt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Dn({asynchronous:!1,geometryInstances:t,appearance:new cn({flat:!0,translucent:!1})})}var dQ=DSt;var hQ=`uniform sampler2D u_depthTexture; +`;function DC(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,X3),this._fragmentShaderSource=y(e.fragmentShaderSource,Y3),this._renderState=io.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(DC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return DC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});DC.VERTEX_FORMAT=Ie.POSITION_AND_ST;DC.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;DC.prototype.isTranslucent=io.prototype.isTranslucent;DC.prototype.getRenderState=io.prototype.getRenderState;var N$=DC;function au(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,au.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,au.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,au.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,au.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,au.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new pe,this._nominalFrameRate=new pe,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){wEt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){DEt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}au.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};au.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new au({scene:e})),e._frameRateMonitor};Object.defineProperties(au.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});au.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};au.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};au.prototype.isDestroyed=function(){return!1};au.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function wEt(e,t){if(e._pauseCount>0)return;let n=Ti();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/qn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function DEt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var K3=au;var zAe=Zo(qZ(),1);function F$(){this._image=new Image}F$.prototype.isReady=function(){return!0};F$.prototype.shouldDiscardImage=function(e){return e===this._image};function IC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new bt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new F$),this._errorEvent=new pe}Object.defineProperties(IC.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});IC.fromMetadata=function(e,t){if(!e.imageryPresent)throw new re(`The server ${e.url} doesn't have imagery`);let n=new IC(t);return n._metadata=e,n};IC.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};IC.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=wg.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let u=new $o({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=IEt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){k3(r.key,u);let f=new Uint8Array(u),d,p=r.protoImagery;if((!l(p)||!p)&&(d=PEt(f)),!l(d)&&(!l(p)||p)){let g=REt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?o:ob({uint8Array:f,format:d,flipY:!0})})};IC.prototype.pickFeatures=function(e,t,n,i,o){};function IEt(e,t,n,i,o,r){let s=wg.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function PEt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function REt(e){let t=zAe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new re("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var B$=IC;var OEt=new H(1,1,1,.4),MEt=new H(0,1,0,.05),LEt=new H(0,.5,0,.2);function PC(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Xi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,OEt),this._glowColor=y(e.glowColor,MEt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,LEt),this._errorEvent=new pe,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(PC.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});PC.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};PC.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};PC.prototype.getTileCredits=function(e,t,n){};PC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};PC.prototype.pickFeatures=function(e,t,n,i,o){};var k$=PC;function Xh(){}Xh._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);Xh._decodeTaskProcessor=new gi("decodeI3S",Xh._maxDecodingConcurrency);Xh._promise=void 0;async function NEt(){if(await Xh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Xh._decodeTaskProcessor;throw new re("I3S decoder could not be initialized.")}Xh.decode=async function(e,t,n,i,o){return l(Xh._promise)||(Xh._promise=NEt()),Xh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let d=$.fromRotationX(-P.PI_OVER_TWO),p=new $;$.multiply(d,a,p);let g=fe.fromDegrees(c,u,f),m=ee.WGS84.cartographicToCartesian(g),x={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ee.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(x)})};var Z3=Xh;function V$(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(V$.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});V$.prototype.load=async function(){return this._data=await Kh.loadJson(this._resource),this._data};var $3=V$;function Ig(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(Ig.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function MG(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function FEt(e){return e==="String"?1:MG(e)}async function BEt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}Ig.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=BEt(this).catch(function(e){console.error(e)}),this._loadPromise)};Ig.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};Ig.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};Ig.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[o].push(c)}}}};Ig.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=MG(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=MG(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Ig.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=FEt(i.valueType)}if(e.byteLength<t)throw new re(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Ig.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new re(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=MG(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new re(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new re(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new re(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var Q3=Ig;function J3(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(J3.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});J3.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var kEt=new h,VEt=new h,UEt=new h,zEt=new h,HEt=new h;function U$(e,t,n,i){let o=h.subtract(i,n,kEt),r=h.cross(o,h.subtract(e,n,VEt),zEt),s=h.cross(o,h.subtract(t,n,UEt),HEt);return h.dot(r,s)>=0}var GEt=new h,WEt=new h,jEt=new h,qEt=new h,YEt=new h,XEt=new h,KEt=new h,ZEt=new h,$Et=new h,QEt=new h;J3.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,m,x;l(f)?(g=f[p],m=f[p+1],x=f[p+2]):(g=p*3,m=p*3+1,x=p*3+2);let b=h.fromElements(u[g*3],u[g*3+1],u[g*3+2],GEt),T=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],WEt),C=new h(u[x*3],u[x*3+1],u[x*3+2],jEt);if(!U$(i,b,T,C)||!U$(i,T,b,C)||!U$(i,C,b,T))continue;let A=h.subtract(T,b,qEt),E=h.subtract(C,b,YEt),v=h.cross(A,E,XEt);if(h.magnitude(v)===0)continue;let D=h.normalize(v,KEt),O=h.subtract(i,b,ZEt),R=Math.abs(h.dot(O,D));if(R<o){o=R,r=p;let M=h.magnitudeSquared(h.subtract(i,b,O)),N=h.magnitudeSquared(h.subtract(i,T,$Et)),_=h.magnitudeSquared(h.subtract(i,C,QEt));M<N&&M<_?(a=g,c=b,s=M):N<_?(a=m,c=T,s=N):(a=x,c=C,s=_)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function HAe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(SC(e[i])):t.push(e[i]);return t}J3.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let A=this._parent._data.mesh.material.definition;if(A>=0&&A<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[A],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let E="0";if(l(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let D=this._layer._data.textureSetDefinitions[v];for(let O=0;O<D.formats.length;O++){let R=D.formats[O];if(R.format==="jpg"){E=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${E}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=HAe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=HAe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let x=[],b=n.length;for(let C=0;C<b;C++){let A=n[C].primitives,E=A.length;for(let v=0;v<E;v++){let D=A[v];if(l(D.material)){for(;D.material>=x.length;){let R=Ge(c,!0);x.push(R)}let O=x[D.material];l(D.extra)&&D.extra.isTransparent?l(O.alphaMode)||(O.alphaMode="BLEND"):O.alphaMode==="BLEND"&&(O.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:x,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var Hv=J3;function Lc(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(Lc.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Lc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new $f(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Kh.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function GAe(e,t){let n=new Q3(e,t);return e._fields[t.name]=n,n.load()}Lc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(GAe(this,i))}return Promise.all(t)};Lc.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return GAe(this,o)}return Promise.resolve()};Lc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Lc.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Lc.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Lc(e,y(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Lc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new Hv(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new Hv(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Lc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new $3(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Lc.prototype._clearGeometryData=function(){this._geometryData=[]};Lc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=fe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=fe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let T=0;T<this._dataProvider._geoidDataList.length;T++){let C=this._dataProvider._geoidDataList[T],A=C.projection.project(n);if(A.x>C.nativeExtent.west&&A.x<C.nativeExtent.east&&A.y>C.nativeExtent.south&&A.y<C.nativeExtent.north){n.height+=nSt(A.x,A.y,C);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ee.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ee.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let T=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/T}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let T=this._data.lodThreshold;s=r/T}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let T=0;T<this._data.lodSelection.length;T++)this._data.lodSelection[T].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[T].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Da(0,0,0),u=Ot.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Oe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new F(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),g=F.inverse(p,new F),m=F.clone(p);l(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let x=[];for(let T=0;T<this._children.length;T++)x.push(this._children[T]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Lc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Lc.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await Z3.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function JEt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function eSt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function WAe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await JEt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!eSt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Lc.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=WAe(this,t);e.push(n)}return Promise.all(e)};$f.prototype._hookedRequestContent=$f.prototype.requestContent;$f.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new Se({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{WAe(e._i3sNode,n)})),e._isLoading=!1,t})}};function tSt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function LG(e,t,n,i){let o=e+t*n;return i[o]}function nSt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=LG(s,a,n.width,n.buffer),d=LG(c,a,n.width,n.buffer),p=LG(s,u,n.width,n.buffer),g=LG(c,u,n.width,n.buffer),m=tSt(o,r,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties($f.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var Gv=Lc;function NG(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(NG.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function z$(e,t){let n=[];for(let i=0;i<e.length;i++){let o=H.byteToFloat(e[i]);i<3?n.push(SC(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function Wv(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=z$(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=z$(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=z$(a.color,a.transparency)))}break}}return n}function iSt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=Wv(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=Wv(o.symbol,t)}return n}}function oSt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=y(o.classMaxValue,o.classMinValue),a=y(r.classMaxValue,r.classMinValue);return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(Wv(r.symbol,t)))}return i.symbols.push(void 0),i}}NG.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=Wv(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=Wv(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=iSt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=Wv(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=oSt(i,n))}};function jAe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?jAe(s,t,n,i):s}}function rSt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function sSt(e,t,n){let i=t[n],o=rSt(e.ranges,i);return e.symbols[o]}NG.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>jAe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>sSt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var ek=NG;function cu(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Se({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(cu.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});cu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new re(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new ek(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};cu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};cu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};cu.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new Gv(this,t,!0)}else this._rootNode=new Gv(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};cu.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};cu._fetchJson=function(e){return e.fetchJson()};cu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=cu._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};cu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=se.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=se.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};cu.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Ge(e):{},e.outlineColor=H.fromCartesian4(oe.fromArray(o))),this._tileset=await xs.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};cu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};cu.prototype.filterByAttributes=function(e){this._filters=l(e)?Ge(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var RC=cu;function FG(e,t){this._dataProvider=e,this._resource=new Se({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(FG.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});FG.prototype.load=async function(){return this._data=await Kh.loadJson(this._resource),this._data};FG.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var tk=FG;function nk(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=y(n.visibility,!0),this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(nk.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});nk._fromData=async function(e,t,n,i){let o=new nk(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let u=nk._fromData(e,t,r[c],o);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Se({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Kh.loadJson(o._resource),c=new RC(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var ik=nk;var XAe=Zo(qAe(),1);function Cs(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=y(e.showFeatures,!1),this._adjustMaterialAlphaMode=y(e.adjustMaterialAlphaMode,!1),this._applySymbology=y(e.applySymbology,!1),this._calculateNormals=y(e.calculateNormals,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(Cs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});Cs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};Cs.prototype.isDestroyed=function(){return!1};Cs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Cs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Cs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Cs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function aSt(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function YAe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=aSt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=ik._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new tk(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=se.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new RC(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}Cs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Cs.loadJson(n),o=new Cs(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=YAe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await YAe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};Cs._fetchJson=function(e){return e.fetchJson()};Cs.loadJson=async function(e){let t=await Cs._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new re(t.error)}return t};Cs.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new re(`Failed to load binary: ${e.url}`);return t};Cs.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var cSt=new z;function lSt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=fe.fromRadians(t.west,t.north),a=fe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=z.fromElements(d,p,cSt),m=g.toString();if(!o.hasOwnProperty(m)){let x={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=x,i.push(x)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},x=d[g],b="Geographic";n._projection instanceof Oi&&(b="WebMercator");let T={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===fd.LERC){let C=XAe.default.decode(x._buffer);T.buffer=C.pixels[0]}else T.buffer=x._buffer;p.push(T)}return p})}async function uSt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await lSt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Cs.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=uSt(this),this._geoidDataPromise)};Cs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?se.union(e,n,e):e=se.clone(n)}this._extent=e};Cs.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Cs.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};Cs.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Kh=Cs;var kG={};kG.createTilesetFromIModelId=async function(e,t){let{exports:n}=await Ea.getExports(e);if(n.length>0&&n.every(a=>a.status===Ea.ExportStatus.Invalid))throw new re(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===Ea.ExportStatus.Complete);if(!l(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new Se({url:r});return xs.fromUrl(s,t)};kG.createTilesetForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await Ea.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![Ea.RealityDataType.Cesium3DTiles,Ea.RealityDataType.PNTS,Ea.RealityDataType.RealityMesh3DTiles,Ea.RealityDataType.Terrain3DTiles].includes(n))throw new re(`Reality data type is not a mesh type: ${n}`);let r=await Ea.getRealityDataURL(e,t,i);return xs.fromUrl(r,{maximumScreenSpaceError:4})};kG.createDataSourceForRealityDataId=async function(t,n,i,o){if(!l(i)||!l(o)){let a=await Ea.getRealityDataMetadata(t,n);o=a.rootDocument,i=a.type}if(![Ea.RealityDataType.KML,Ea.RealityDataType.GeoJSON].includes(i))throw new re(`Reality data type is not a data source type: ${i}`);let s=await Ea.getRealityDataURL(t,n,o);return i===Ea.RealityDataType.GeoJSON?gT.load(s):PT.load(s)};var H$=kG;function KAe(){}Object.defineProperties(KAe.prototype,{color:{get:he.throwInstantiationError},intensity:{get:he.throwInstantiationError}});var G$=KAe;var fSt=/\/$/,ZAe=new bt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function jv(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Se.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();fSt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new bt(c))):c=ZAe,this._resource=i,this._imageryProvider=new ja({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(jv.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});jv.prototype.getTileCredits=function(e,t,n){};jv.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};jv.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};jv._defaultCredit=ZAe;var W$=jv;function j$(e){}j$.prototype.isReady=function(){return!0};j$.prototype.shouldDiscardImage=function(e){return!1};var q$=j$;var dSt=new bt("MapQuest, Open Street Map and contributors, CC-BY-SA");function VG(e){e=y(e,y.EMPTY_OBJECT);let t=Se.createIfNeeded(y(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${y(e.fileExtension,"png")}`;let n=new as({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(se.southwest(a),r),u=n.positionToTileXY(se.northeast(a),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=y(e.credit,dSt);typeof d=="string"&&(d=new bt(d)),ja.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(VG.prototype=Object.create(ja.prototype),VG.prototype.constructor=VG);var Pg=VG;var hSt=new z(1,1);function Y$(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=h.clone(y(e.position,h.ZERO)),this.velocity=h.clone(y(e.velocity,h.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=H.clone(y(e.startColor,H.WHITE)),this.endColor=H.clone(y(e.endColor,H.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=z.clone(y(e.imageSize,hSt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Y$.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var $Ae=new h;Y$.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,$Ae),h.add(this.position,$Ae,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var qv=Y$;function QAe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(QAe.prototype,{complete:{get:function(){return this._complete}}});var X$=QAe;function JAe(e){}JAe.prototype.emit=function(e){he.throwInstantiationError()};var K$=JAe;var eEe=new z(1,1);function ok(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new W3(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._emitterModelMatrix=F.clone(y(e.emitterModelMatrix,F.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=H.clone(y(e.color,y(e.startColor,H.WHITE))),this._endColor=H.clone(y(e.color,y(e.endColor,H.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=z.clone(y(e.imageSize,y(e.minimumImageSize,eEe))),this._maximumImageSize=z.clone(y(e.imageSize,y(e.maximumImageSize,eEe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new pe,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(ok.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){H.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){H.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function mSt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let d=o.length;for(let p=0;p<d;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new qv;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function pSt(e){let t=e._particlePool.pop();return l(t)||(t=new qv),t}function _St(e,t){e._particlePool.push(t)}function gSt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function ySt(e){l(e._billboard)&&(e._billboard.show=!1)}function tEe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new H(i,o,r,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function xSt(e,t){t.startColor=H.clone(e._startColor,t.startColor),t.endColor=H.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function bSt(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var UG=new h;ok.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Ru),this._updateParticlePool&&(mSt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=Z.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?tEe(this,s):(ySt(s),_St(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=bSt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)s=pSt(this),this._emitter.emit(s),h.add(s.position,s.velocity,UG),F.multiplyByPoint(u,UG,UG),s.position=F.multiplyByPoint(u,s.position,s.position),h.subtract(UG,s.position,s.velocity),h.normalize(s.velocity,s.velocity),xSt(this,s),tEe(this,s)}if(this._billboardCollection.update(e),this._previousTime=Z.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&gSt(this)};ok.prototype.isDestroyed=function(){return!1};ok.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var Z$=ok;function df(){he.throwInstantiationError()}df.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(df.prototype,{quadtree:{get:he.throwInstantiationError,set:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError}});df.prototype.update=he.throwInstantiationError;df.prototype.beginUpdate=he.throwInstantiationError;df.prototype.endUpdate=he.throwInstantiationError;df.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;df.prototype.loadTile=he.throwInstantiationError;df.prototype.computeTileVisibility=he.throwInstantiationError;df.prototype.showTileThisFrame=he.throwInstantiationError;df.prototype.computeDistanceToTile=he.throwInstantiationError;df.prototype.isDestroyed=he.throwInstantiationError;df.prototype.destroy=he.throwInstantiationError;var $$=df;function Q$(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(Q$.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Q$.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(o,r,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var J$=Q$;function rk(){}rk.prototype.evaluate=function(e,t){he.throwInstantiationError()};rk.prototype.evaluateColor=function(e,t){he.throwInstantiationError()};rk.prototype.getShaderFunction=function(e,t,n,i){he.throwInstantiationError()};rk.prototype.getVariables=function(){he.throwInstantiationError()};var eQ=rk;function Yv(e){this._ready=!1,this._provider=void 0,this._errorEvent=new pe,this._readyEvent=new pe,CSt(this,e)}Object.defineProperties(Yv.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});Yv.fromWorldTerrain=function(e){return new Yv(EC(e))};Yv.fromWorldBathymetry=function(e){return new Yv(B3(e))};function TSt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function CSt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){TSt(e._errorEvent,i)}}var sk=Yv;function Xv(){}Xv.prototype.boundingVolume=void 0;Xv.prototype.boundingSphere=void 0;Xv.prototype.distanceToCamera=function(e){he.throwInstantiationError()};Xv.prototype.intersectPlane=function(e){he.throwInstantiationError()};Xv.prototype.createDebugVolume=function(e){he.throwInstantiationError()};var tQ=Xv;function ak(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Xi({ellipsoid:e.ellipsoid}),this._color=y(e.color,H.YELLOW),this._errorEvent=new pe,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(ak.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});ak.prototype.getTileCredits=function(e,t,n){};ak.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};ak.prototype.pickFeatures=function(e,t,n,i,o){};var ck=ak;function nQ(e){he.throwInstantiationError()}nQ.prototype.isReady=he.throwInstantiationError;nQ.prototype.shouldDiscardImage=he.throwInstantiationError;var iQ=nQ;var ASt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},oQ=Object.freeze(ASt);function zG(e,t){this.show=!0,l(e)||(e=new je),this.rectangle=je.clone(e),l(t)||(t=Yi.fromType(Yi.ColorType,{color:new H(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}zG.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!je.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:ln.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Ue({sources:[this._material.shaderSource,P3]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=we.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};zG.prototype.isDestroyed=function(){return!1};zG.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var rQ=zG;function sQ(){he.throwInstantiationError()}Object.defineProperties(sQ.prototype,{globalTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shape:{get:he.throwInstantiationError},minBounds:{get:he.throwInstantiationError},maxBounds:{get:he.throwInstantiationError},dimensions:{get:he.throwInstantiationError},paddingBefore:{get:he.throwInstantiationError},paddingAfter:{get:he.throwInstantiationError},names:{get:he.throwInstantiationError},types:{get:he.throwInstantiationError},componentTypes:{get:he.throwInstantiationError},minimumValues:{get:he.throwInstantiationError},maximumValues:{get:he.throwInstantiationError},maximumTileCount:{get:he.throwInstantiationError},keyframeCount:{get:he.throwInstantiationError},timeIntervalCollection:{get:he.throwInstantiationError}});sQ.prototype.requestData=he.throwInstantiationError;var aQ=sQ;function OC(){he.throwInstantiationError()}Object.defineProperties(OC.prototype,{orientedBoundingBox:{get:he.throwInstantiationError},boundingSphere:{get:he.throwInstantiationError},boundTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shaderUniforms:{get:he.throwInstantiationError},shaderDefines:{get:he.throwInstantiationError},shaderMaximumIntersectionsLength:{get:he.throwInstantiationError}});OC.prototype.update=he.throwInstantiationError;OC.prototype.computeOrientedBoundingBoxForTile=he.throwInstantiationError;OC.prototype.computeOrientedBoundingBoxForSample=he.throwInstantiationError;OC.DefaultMinBounds=he.throwInstantiationError;OC.DefaultMaxBounds=he.throwInstantiationError;var cQ=OC;var ESt=new H,SSt=new H,vSt=new H,wSt=new H,nEe=new oe,lk=new Uint8Array(4);function iEe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return H.lerp(t.color,n.color,o,i)}function HG(e,t){return{height:e,color:H.clone(t)}}function oEe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?H.equals(t.color,i[n-1].color):!1,a=r?H.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?H.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function DSt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],m=P.clamp(g.height,lu._minimumHeight,lu._maximumHeight),x=H.clone(g.color,ESt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(HG(m,x))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||mg(c,function(g,m){return P.sign(g.height-m.height)});let d=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,HG(lu._minimumHeight,c[0].color)),p&&c.splice(c.length,0,HG(lu._maximumHeight,c[c.length-1].color)),c=oEe(c),i.push(c)}return i}function ISt(e){let t=DSt(e),n=[],i=[],o;function r(u,f){n.push(HG(u,f))}function s(u,f,d){let p=H.multiplyByScalar(d,1-f.alpha,wSt);p=H.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,x=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,T=d<g?i[d]:void 0,C=d>0?i[d-1]:void 0,A=d<g-1?i[d+1]:void 0;if(l(m)&&l(T)&&m.height===T.height){let E=l(A)&&T.height===A.height,v=!l(C),D=!l(A),O=l(b)&&m.height===b.height,R=!l(x),M=!l(b);E?O?(s(m.height,m.color,T.color),s(m.height,b.color,A.color)):R?(r(m.height,T.color),s(m.height,m.color,A.color)):M?(s(m.height,m.color,T.color),r(m.height,A.color)):(s(m.height,m.color,T.color),s(m.height,m.color,A.color)):v?O?(r(m.height,m.color),s(m.height,b.color,T.color)):M?(r(m.height,m.color),r(m.height,T.color)):(R||r(m.height,m.color),s(m.height,m.color,T.color)):D?O?(s(m.height,m.color,T.color),r(m.height,b.color)):R?(r(m.height,T.color),r(m.height,m.color)):M?s(m.height,m.color,T.color):(s(m.height,m.color,T.color),r(m.height,m.color)):O?(s(m.height,m.color,T.color),s(m.height,b.color,T.color)):R?(r(m.height,T.color),s(m.height,m.color,T.color)):M?(s(m.height,m.color,T.color),r(m.height,T.color)):s(m.height,m.color,T.color),f+=O?2:1,d+=E?2:1}else if(l(m)&&l(T)&&l(C)&&m.height<T.height){let E=iEe(m.height,C,T,vSt);l(x)?l(b)?s(m.height,m.color,E):(s(m.height,m.color,E),r(m.height,E)):(r(m.height,E),s(m.height,m.color,E)),f++}else if(l(T)&&l(m)&&l(x)&&T.height<m.height){let E=iEe(T.height,x,m,SSt);l(C)?l(A)?s(T.height,E,T.color):(s(T.height,E,T.color),r(T.height,E)):(r(T.height,E),s(T.height,E,T.color)),d++}else l(m)&&(!l(T)||m.height<T.height)?(l(T)&&!l(C)&&!l(b)?(r(m.height,m.color),r(m.height,lu._emptyColor),r(T.height,lu._emptyColor)):(!l(T)&&l(C)&&!l(x)&&(r(C.height,lu._emptyColor),r(m.height,lu._emptyColor)),r(m.height,m.color)),f++):l(T)&&(!l(m)||T.height<m.height)&&(r(T.height,T.color),d++)}}return oEe(n)}function lu(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=ISt(n),r=o.length,s,a,c;if(!lu._useFloatTexture(i)){a=Ke.UNSIGNED_BYTE,c=et.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)oe.packFloat(o[g].height,nEe),oe.pack(nEe,s,g*4)}else{a=Ke.FLOAT,c=i.webgl2?et.RED:et.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let f=It.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Zt({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Kt.NEAREST,magnificationFilter:di.NEAREST})}),d=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(lk),d[g*4+0]=lk[0],d[g*4+1]=lk[1],d[g*4+2]=lk[2],d[g*4+3]=lk[3];let p=It.create({context:i,pixelFormat:et.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:new Zt({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:di.LINEAR})});return Yi.fromType("ElevationBand",{heights:f,colors:p})}lu._useFloatTexture=function(e){return e.floatingPointTexture};lu._maximumHeight=5906376425472;lu._minimumHeight=-5906376425472;lu._emptyColor=new H(0,0,0,0);var lQ=lu;async function PSt(e,t){t=y(t,{}),t.cacheBytes=y(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=y(t.maximumCacheOverflowBytes,1024*1024*1024),t.enableCollision=y(t.enableCollision,!0),e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(ms("createGooglePhotorealistic3DTileset(key)","createGooglePhotorealistic3DTileset(key) has been deprecated. It is replaced by createGooglePhotorealistic3DTileset({key}). It will be removed in Cesium 1.126."),e={key:e}),e.onlyUsingWithGoogleGeocoder||gt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=y(e.key,TC.defaultApiKey);if(!l(n))return RSt(t);let i,o=TC.getDefaultCredit();l(o)&&(i=[o]);let r=new Se({url:`${TC.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return xs.fromUrl(r,t)}var rEe={};async function RSt(e){let i=rEe[2275207];l(i)||(i=Cu.fromAssetId(2275207),rEe[2275207]=i);let o=await i;return xs.fromUrl(o,e)}var uQ=PSt;async function OSt(e){let t=await xs.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,H.WHITE).toCssColorString();n=new vC({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var fQ=OSt;function MSt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=F.clone(y(e.modelMatrix,F.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new St({geometry:Ln.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Gt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new St({geometry:Ln.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Gt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new St({geometry:Ln.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Gt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Dn({asynchronous:!1,geometryInstances:t,appearance:new an({flat:!0,translucent:!1})})}var dQ=MSt;var hQ=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; @@ -15980,49 +15980,49 @@ void main() float scale = pow(z_ndc * 0.5 + 0.5, 8.0); out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); } -`;function ISt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,et.RGBA),this.pixelDatatype=y(e.pixelDatatype,Ke.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Se.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?Cn.REPEAT:Cn.CLAMP_TO_EDGE;this.sampler=new $t({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var mQ=ISt;var PSt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},pQ=Object.freeze(PSt);var RSt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},_Q=Object.freeze(RSt);function OSt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${Qm(s)} - with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var gQ=OSt;globalThis.CESIUM_VERSION="1.124";var uk;typeof ko<"u"&&(uk=ko);(function(){/*! +`;function LSt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,et.RGBA),this.pixelDatatype=y(e.pixelDatatype,Ke.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Se.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?Cn.REPEAT:Cn.CLAMP_TO_EDGE;this.sampler=new Zt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var mQ=LSt;var NSt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},pQ=Object.freeze(NSt);var FSt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},_Q=Object.freeze(FSt);function BSt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${Zm(s)} + with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var gQ=BSt;globalThis.CESIUM_VERSION="1.125";var uk;typeof ko<"u"&&(uk=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) - */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(_,S){return _===null||typeof _ in x?_===S:!1}function u(_,S){var w;return function(){w||(w=m.a.setTimeout(function(){w=e,_()},S))}}function f(_,S){var w;return function(){clearTimeout(w),w=m.a.setTimeout(_,S)}}function d(_,S){S&&S!=="change"?S==="beforeChange"?this.pc(_):this.gb(_,S):this.qc(_)}function p(_,S){S!==null&&S.s&&S.s()}function g(_,S){var w=this.qd,I=w[E];I.ra||(this.Qb&&this.mb[S]?(w.uc(S,_,this.mb[S]),this.mb[S]=null,--this.Qb):I.I[S]||w.uc(S,_,I.J?{da:_}:w.$c(_)),_.Ja&&_.gd())}var m=typeof s<"u"?s:{};m.b=function(_,S){for(var w=_.split("."),I=m,L=0;L<w.length-1;L++)I=I[w[L]];I[w[w.length-1]]=S},m.L=function(_,S,w){_[S]=w},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function _(q,K){for(var Q in q)L.call(q,Q)&&K(Q,q[Q])}function S(q,K){if(K)for(var Q in K)L.call(K,Q)&&(q[Q]=K[Q]);return q}function w(q,K){return q.__proto__=K,q}function I(q,K,Q,de){var ye=q[K].match(j)||[];m.a.D(Q.match(j),function(ce){m.a.Na(ye,ce,de)}),q[K]=ye.join(" ")}var L=Object.prototype.hasOwnProperty,B={__proto__:[]}instanceof Array,U=typeof Symbol=="function",V={},G={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(V,function(q,K){if(K.length)for(var Q=0,de=K.length;Q<de;Q++)G[K[Q]]=q});var k={propertychange:!0},W=n&&function(){for(var q=3,K=n.createElement("div"),Q=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++q+"]><i></i><![endif]-->",Q[0];);return 4<q?q:e}(),j=/\S+/g,J;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(q,K,Q){for(var de=0,ye=q.length;de<ye;de++)K.call(Q,q[de],de,q)},A:typeof Array.prototype.indexOf=="function"?function(q,K){return Array.prototype.indexOf.call(q,K)}:function(q,K){for(var Q=0,de=q.length;Q<de;Q++)if(q[Q]===K)return Q;return-1},Lb:function(q,K,Q){for(var de=0,ye=q.length;de<ye;de++)if(K.call(Q,q[de],de,q))return q[de];return e},Pa:function(q,K){var Q=m.a.A(q,K);0<Q?q.splice(Q,1):Q===0&&q.shift()},wc:function(q){var K=[];return q&&m.a.D(q,function(Q){0>m.a.A(K,Q)&&K.push(Q)}),K},Mb:function(q,K,Q){var de=[];if(q)for(var ye=0,ce=q.length;ye<ce;ye++)de.push(K.call(Q,q[ye],ye));return de},jb:function(q,K,Q){var de=[];if(q)for(var ye=0,ce=q.length;ye<ce;ye++)K.call(Q,q[ye],ye)&&de.push(q[ye]);return de},Nb:function(q,K){if(K instanceof Array)q.push.apply(q,K);else for(var Q=0,de=K.length;Q<de;Q++)q.push(K[Q]);return q},Na:function(q,K,Q){var de=m.a.A(m.a.bc(q),K);0>de?Q&&q.push(K):Q||q.splice(de,1)},Ba:B,extend:S,setPrototypeOf:w,Ab:B?w:S,P:_,Ga:function(q,K,Q){if(!q)return q;var de={},ye;for(ye in q)L.call(q,ye)&&(de[ye]=K.call(Q,q[ye],ye,q));return de},Tb:function(q){for(;q.firstChild;)m.removeNode(q.firstChild)},Yb:function(q){q=m.a.la(q);for(var K=(q[0]&&q[0].ownerDocument||n).createElement("div"),Q=0,de=q.length;Q<de;Q++)K.appendChild(m.oa(q[Q]));return K},Ca:function(q,K){for(var Q=0,de=q.length,ye=[];Q<de;Q++){var ce=q[Q].cloneNode(!0);ye.push(K?m.oa(ce):ce)}return ye},va:function(q,K){if(m.a.Tb(q),K)for(var Q=0,de=K.length;Q<de;Q++)q.appendChild(K[Q])},Xc:function(q,K){var Q=q.nodeType?[q]:q;if(0<Q.length){for(var de=Q[0],ye=de.parentNode,ce=0,_e=K.length;ce<_e;ce++)ye.insertBefore(K[ce],de);for(ce=0,_e=Q.length;ce<_e;ce++)m.removeNode(Q[ce])}},Ua:function(q,K){if(q.length){for(K=K.nodeType===8&&K.parentNode||K;q.length&&q[0].parentNode!==K;)q.splice(0,1);for(;1<q.length&&q[q.length-1].parentNode!==K;)q.length--;if(1<q.length){var Q=q[0],de=q[q.length-1];for(q.length=0;Q!==de;)q.push(Q),Q=Q.nextSibling;q.push(de)}}return q},Zc:function(q,K){7>W?q.setAttribute("selected",K):q.selected=K},Db:function(q){return q===null||q===e?"":q.trim?q.trim():q.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(q,K){return q=q||"",K.length>q.length?!1:q.substring(0,K.length)===K},vd:function(q,K){if(q===K)return!0;if(q.nodeType===11)return!1;if(K.contains)return K.contains(q.nodeType!==1?q.parentNode:q);if(K.compareDocumentPosition)return(K.compareDocumentPosition(q)&16)==16;for(;q&&q!=K;)q=q.parentNode;return!!q},Sb:function(q){return m.a.vd(q,q.ownerDocument.documentElement)},kd:function(q){return!!m.a.Lb(q,m.a.Sb)},R:function(q){return q&&q.tagName&&q.tagName.toLowerCase()},Ac:function(q){return m.onError?function(){try{return q.apply(this,arguments)}catch(K){throw m.onError&&m.onError(K),K}}:q},setTimeout:function(q,K){return setTimeout(m.a.Ac(q),K)},Gc:function(q){setTimeout(function(){throw m.onError&&m.onError(q),q},0)},B:function(q,K,Q){var de=m.a.Ac(Q);if(Q=k[K],m.options.useOnlyNativeEvents||Q||!o)if(Q||typeof q.addEventListener!="function")if(typeof q.attachEvent<"u"){var ye=function(_e){de.call(q,_e)},ce="on"+K;q.attachEvent(ce,ye),m.a.K.za(q,function(){q.detachEvent(ce,ye)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else q.addEventListener(K,de,!1);else J||(J=typeof o(q).on=="function"?"on":"bind"),o(q)[J](K,de)},Fb:function(q,K){if(!q||!q.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Q;if(m.a.R(q)==="input"&&q.type&&K.toLowerCase()=="click"?(Q=q.type,Q=Q=="checkbox"||Q=="radio"):Q=!1,m.options.useOnlyNativeEvents||!o||Q)if(typeof n.createEvent=="function")if(typeof q.dispatchEvent=="function")Q=n.createEvent(G[K]||"HTMLEvents"),Q.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,q),q.dispatchEvent(Q);else throw Error("The supplied element doesn't support dispatchEvent");else if(Q&&q.click)q.click();else if(typeof q.fireEvent<"u")q.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else o(q).trigger(K)},f:function(q){return m.O(q)?q():q},bc:function(q){return m.O(q)?q.v():q},Eb:function(q,K,Q){var de;K&&(typeof q.classList=="object"?(de=q.classList[Q?"add":"remove"],m.a.D(K.match(j),function(ye){de.call(q.classList,ye)})):typeof q.className.baseVal=="string"?I(q.className,"baseVal",K,Q):I(q,"className",K,Q))},Bb:function(q,K){var Q=m.a.f(K);(Q===null||Q===e)&&(Q="");var de=m.h.firstChild(q);!de||de.nodeType!=3||m.h.nextSibling(de)?m.h.va(q,[q.ownerDocument.createTextNode(Q)]):de.data=Q,m.a.Ad(q)},Yc:function(q,K){if(q.name=K,7>=W)try{var Q=q.name.replace(/[&<>'"]/g,function(de){return"&#"+de.charCodeAt(0)+";"});q.mergeAttributes(n.createElement("<input name='"+Q+"'/>"),!1)}catch{}},Ad:function(q){9<=W&&(q=q.nodeType==1?q:q.parentNode,q.style&&(q.style.zoom=q.style.zoom))},wd:function(q){if(W){var K=q.style.width;q.style.width=0,q.style.width=K}},Pd:function(q,K){q=m.a.f(q),K=m.a.f(K);for(var Q=[],de=q;de<=K;de++)Q.push(de);return Q},la:function(q){for(var K=[],Q=0,de=q.length;Q<de;Q++)K.push(q[Q]);return K},Da:function(q){return U?Symbol(q):q},Zd:W===6,$d:W===7,W,Lc:function(q,K){for(var Q=m.a.la(q.getElementsByTagName("input")).concat(m.a.la(q.getElementsByTagName("textarea"))),de=typeof K=="string"?function(_e){return _e.name===K}:function(_e){return K.test(_e.name)},ye=[],ce=Q.length-1;0<=ce;ce--)de(Q[ce])&&ye.push(Q[ce]);return ye},Nd:function(q){return typeof q=="string"&&(q=m.a.Db(q))?r&&r.parse?r.parse(q):new Function("return "+q)():null},hc:function(q,K,Q){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(m.a.f(q),K,Q)},Od:function(q,K,Q){Q=Q||{};var de=Q.params||{},ye=Q.includeFields||this.Jc,ce=q;if(typeof q=="object"&&m.a.R(q)==="form")for(var ce=q.action,_e=ye.length-1;0<=_e;_e--)for(var xe=m.a.Lc(q,ye[_e]),De=xe.length-1;0<=De;De--)de[xe[De].name]=xe[De].value;K=m.a.f(K);var Ae=n.createElement("form");Ae.style.display="none",Ae.action=ce,Ae.method="post";for(var ke in K)q=n.createElement("input"),q.type="hidden",q.name=ke,q.value=m.a.hc(m.a.f(K[ke])),Ae.appendChild(q);_(de,function(ze,tt){var wt=n.createElement("input");wt.type="hidden",wt.name=ze,wt.value=tt,Ae.appendChild(wt)}),n.body.appendChild(Ae),Q.submitter?Q.submitter(Ae):Ae.submit(),setTimeout(function(){Ae.parentNode.removeChild(Ae)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var S=this;if(arguments.length===1)return function(){return S.apply(_,arguments)};var w=Array.prototype.slice.call(arguments,1);return function(){var I=w.slice(0);return I.push.apply(I,arguments),S.apply(_,I)}}),m.a.g=new function(){var _=0,S="__ko__"+new Date().getTime(),w={},I,L;return m.a.W?(I=function(B,U){var V=B[S];if(!V||V==="null"||!w[V]){if(!U)return e;V=B[S]="ko"+_++,w[V]={}}return w[V]},L=function(B){var U=B[S];return U?(delete w[U],B[S]=null,!0):!1}):(I=function(B,U){var V=B[S];return!V&&U&&(V=B[S]={}),V},L=function(B){return B[S]?(delete B[S],!0):!1}),{get:function(B,U){var V=I(B,!1);return V&&V[U]},set:function(B,U,V){(B=I(B,V!==e))&&(B[U]=V)},Ub:function(B,U,V){return B=I(B,!0),B[U]||(B[U]=V)},clear:L,Z:function(){return _+++S}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(U,V){var G=m.a.g.get(U,I);return G===e&&V&&(G=[],m.a.g.set(U,I,G)),G}function S(U){var V=_(U,!1);if(V)for(var V=V.slice(0),G=0;G<V.length;G++)V[G](U);m.a.g.clear(U),m.a.K.cleanExternalData(U),B[U.nodeType]&&w(U.childNodes,!0)}function w(U,V){for(var G=[],k,W=0;W<U.length;W++)if((!V||U[W].nodeType===8)&&(S(G[G.length]=k=U[W]),U[W]!==k))for(;W--&&m.a.A(G,U[W])==-1;);}var I=m.a.g.Z(),L={1:!0,8:!0,9:!0},B={1:!0,9:!0};return{za:function(U,V){if(typeof V!="function")throw Error("Callback must be a function");_(U,!0).push(V)},yb:function(U,V){var G=_(U,!1);G&&(m.a.Pa(G,V),G.length==0&&m.a.g.set(U,I,e))},oa:function(U){return m.u.G(function(){L[U.nodeType]&&(S(U),B[U.nodeType]&&w(U.getElementsByTagName("*")))}),U},removeNode:function(U){m.oa(U),U.parentNode&&U.parentNode.removeChild(U)},cleanExternalData:function(U){o&&typeof o.cleanData=="function"&&o.cleanData([U])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),function(){var _=[0,"",""],S=[1,"<table>","</table>"],w=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],L={thead:S,tbody:S,tfoot:S,tr:[2,"<table><tbody>","</tbody></table>"],td:w,th:w,option:I,optgroup:I},B=8>=m.a.W;m.a.ua=function(U,V){var G;if(o){if(o.parseHTML)G=o.parseHTML(U,V)||[];else if((G=o.clean([U],V))&&G[0]){for(var k=G[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(G=V)||(G=n);var k=G.parentWindow||G.defaultView||t,W=m.a.Db(U).toLowerCase(),j=G.createElement("div"),J;for(J=(W=W.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&L[W[1]]||_,W=J[0],J="ignored<div>"+J[1]+U+J[2]+"</div>",typeof k.innerShiv=="function"?j.appendChild(k.innerShiv(J)):(B&&G.body.appendChild(j),j.innerHTML=J,B&&j.parentNode.removeChild(j));W--;)j=j.lastChild;G=m.a.la(j.lastChild.childNodes)}return G},m.a.Md=function(U,V){var G=m.a.ua(U,V);return G.length&&G[0].parentElement||m.a.Yb(G)},m.a.fc=function(U,V){if(m.a.Tb(U),V=m.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),o)o(U).html(V);else for(var G=m.a.ua(V,U.ownerDocument),k=0;k<G.length;k++)U.appendChild(G[k])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function _(w,I){if(w){if(w.nodeType==8){var L=m.aa.Uc(w.nodeValue);L!=null&&I.push({ud:w,Kd:L})}else if(w.nodeType==1)for(var L=0,B=w.childNodes,U=B.length;L<U;L++)_(B[L],I)}}var S={};return{Xb:function(w){if(typeof w!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return S[I]=w,"<!--[ko_memo:"+I+"]-->"},bd:function(w,I){var L=S[w];if(L===e)throw Error("Couldn't find any memo with ID "+w+". Perhaps it's already been unmemoized.");try{return L.apply(null,I||[]),!0}finally{delete S[w]}},cd:function(w,I){var L=[];_(w,L);for(var B=0,U=L.length;B<U;B++){var V=L[B].ud,G=[V];I&&m.a.Nb(G,I),m.aa.bd(L[B].Kd,G),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(w){return(w=w.match(/^\[ko_memo\:(.*?)\]$/))?w[1]:null}}}(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=function(){function _(){if(L){for(var V=L,G=0,k;U<L;)if(k=I[U++]){if(U>V){if(5e3<=++G){U=L,m.a.Gc(Error("'Too much recursion' after processing "+G+" task groups."));break}V=L}try{k()}catch(W){m.a.Gc(W)}}}}function S(){_(),U=L=I.length=0}var w,I=[],L=0,B=1,U=0;return t.MutationObserver?w=function(V){var G=n.createElement("div");return new MutationObserver(V).observe(G,{attributes:!0}),function(){G.classList.toggle("foo")}}(S):w=n&&"onreadystatechange"in n.createElement("script")?function(V){var G=n.createElement("script");G.onreadystatechange=function(){G.onreadystatechange=null,n.documentElement.removeChild(G),G=null,V()},n.documentElement.appendChild(G)}:function(V){setTimeout(V,0)},{scheduler:w,zb:function(V){return L||m.na.scheduler(S),I[L++]=V,B++},cancel:function(V){V=V-(B-L),V>=U&&V<L&&(I[V]=null)},resetForTesting:function(){var V=L-U;return U=L=I.length=0,V},Sd:_}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,S){_.throttleEvaluation=S;var w=null;return m.$({read:_,write:function(I){clearTimeout(w),w=m.a.setTimeout(function(){_(I)},S)}})},rateLimit:function(_,S){var w,I,L;typeof S=="number"?w=S:(w=S.timeout,I=S.method),_.Hb=!1,L=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,_.ub(function(B){return L(B,w,S)})},deferred:function(_,S){if(S!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(w){var I,L=!1;return function(){if(!L){m.na.cancel(I),I=m.na.zb(w);try{L=!0,_.notifySubscribers(e,"dirty")}finally{L=!1}}}}))},notify:function(_,S){_.equalityComparer=S=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,S,w){this.da=_,this.lc=S,this.mc=w,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(_){this.Jb=_,m.a.K.za(_,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,b),b.qb(this)};var b={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,S,w){var I=this;w=w||"change";var L=new m.ic(I,S?_.bind(S):_,function(){m.a.Pa(I.U[w],L),I.hb&&I.hb(w)});return I.Qa&&I.Qa(w),I.U[w]||(I.U[w]=[]),I.U[w].push(L),L},notifySubscribers:function(_,S){if(S=S||"change",S==="change"&&this.Gb(),this.Wa(S)){var w=S==="change"&&this.ed||this.U[S].slice(0);try{m.u.xc();for(var I=0,L;L=w[I];++I)L.Ib||L.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var S=this,w=m.O(S),I,L,B,U,V;S.gb||(S.gb=S.notifySubscribers,S.notifySubscribers=d);var G=_(function(){S.Ja=!1,w&&U===S&&(U=S.nc?S.nc():S());var k=L||V&&S.sb(B,U);V=L=I=!1,k&&S.gb(B=U)});S.qc=function(k,W){W&&S.Ja||(V=!W),S.ed=S.U.change.slice(0),S.Ja=I=!0,U=k,G()},S.pc=function(k){I||(B=k,S.gb(k,"beforeChange"))},S.rc=function(){V=!0},S.gd=function(){S.sb(B,S.v(!0))&&(L=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var S=0;return m.a.P(this.U,function(w,I){w!=="dirty"&&(S+=I.length)}),S},sb:function(_,S){return!this.equalityComparer||!this.equalityComparer(_,S)},toString:function(){return"[object Object]"},extend:function(_){var S=this;return _&&m.a.P(_,function(w,I){var L=m.Ta[w];typeof L=="function"&&(S=L(S,I)||S)}),S}};m.L(b,"init",b.qb),m.L(b,"subscribe",b.subscribe),m.L(b,"extend",b.extend),m.L(b,"getSubscriptionsCount",b.Bd),m.a.Ba&&m.a.setPrototypeOf(b,Function.prototype),m.T.fn=b,m.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function _(B){w.push(I),I=B}function S(){I=w.pop()}var w=[],I,L=0;return{xc:_,end:S,cc:function(B){if(I){if(!m.Qc(B))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,B,B.fd||(B.fd=++L))}},G:function(B,U,V){try{return _(),B.apply(U,V||[])}finally{S()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var T=m.a.Da("_latestValue");m.ta=function(_){function S(){return 0<arguments.length?(S.sb(S[T],arguments[0])&&(S.ya(),S[T]=arguments[0],S.xa()),this):(m.u.cc(S),S[T])}return S[T]=_,m.a.Ba||m.a.extend(S,m.T.fn),m.T.fn.qb(S),m.a.Ab(S,C),m.options.deferUpdates&&m.Ta.deferred(S,!0),S};var C={equalityComparer:c,v:function(){return this[T]},xa:function(){this.notifySubscribers(this[T],"spectate"),this.notifySubscribers(this[T])},ya:function(){this.notifySubscribers(this[T],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(C,m.T.fn);var A=m.ta.Ma="__ko_proto__";C[A]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[A])&&_!==C[A]&&_!==m.o.fn[A])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[A]===C[A]||_[A]===m.o.fn[A]&&_.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",C),m.L(C,"peek",C.v),m.L(C,"valueHasMutated",C.xa),m.L(C,"valueWillMutate",C.ya),m.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=m.ta(_),m.a.Ab(_,m.Ha.fn),_.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(_){for(var S=this.v(),w=[],I=typeof _!="function"||m.O(_)?function(U){return U===_}:_,L=0;L<S.length;L++){var B=S[L];if(I(B)){if(w.length===0&&this.ya(),S[L]!==B)throw Error("Array modified during remove; cannot remove item");w.push(B),S.splice(L,1),L--}}return w.length&&this.xa(),w},removeAll:function(_){if(_===e){var S=this.v(),w=S.slice(0);return this.ya(),S.splice(0,S.length),this.xa(),w}return _?this.remove(function(I){return 0<=m.a.A(_,I)}):[]},destroy:function(_){var S=this.v(),w=typeof _!="function"||m.O(_)?function(B){return B===_}:_;this.ya();for(var I=S.length-1;0<=I;I--){var L=S[I];w(L)&&(L._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(S){return 0<=m.a.A(_,S)}):[]},indexOf:function(_){var S=this();return m.a.A(S,_)},replace:function(_,S){var w=this.indexOf(_);0<=w&&(this.ya(),this.v()[w]=S,this.xa())},sorted:function(_){var S=this().slice(0);return _?S.sort(_):S.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){m.Ha.fn[_]=function(){var S=this.v();this.ya(),this.zc(S,_,arguments);var w=S[_].apply(S,arguments);return this.xa(),w===S?this:w}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var S=this();return S[_].apply(S,arguments)}}),m.Pc=function(_){return m.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(_,S){function w(){function j(){if(V){var J=[].concat(_.v()||[]),q;_.Wa("arrayChange")&&((!L||1<V)&&(L=m.a.Pb(G,J,_.Ob)),q=L),G=J,L=null,V=0,q&&q.length&&_.notifySubscribers(q,"arrayChange")}}I?j():(I=!0,U=_.subscribe(function(){++V},null,"spectate"),G=[].concat(_.v()||[]),L=null,B=_.subscribe(j))}if(_.Ob={},S&&typeof S=="object"&&m.a.extend(_.Ob,S),_.Ob.sparse=!0,!_.zc){var I=!1,L=null,B,U,V=0,G,k=_.Qa,W=_.hb;_.Qa=function(j){k&&k.call(_,j),j==="arrayChange"&&w()},_.hb=function(j){W&&W.call(_,j),j!=="arrayChange"||_.Wa("arrayChange")||(B&&B.s(),U&&U.s(),U=B=null,I=!1,G=e)},_.zc=function(j,J,q){function K(Ae,ke,ze){return Q[Q.length]={status:Ae,value:ke,index:ze}}if(I&&!V){var Q=[],de=j.length,ye=q.length,ce=0;switch(J){case"push":ce=de;case"unshift":for(J=0;J<ye;J++)K("added",q[J],ce+J);break;case"pop":ce=de-1;case"shift":de&&K("deleted",j[ce],ce);break;case"splice":J=Math.min(Math.max(0,0>q[0]?de+q[0]:q[0]),de);for(var de=ye===1?de:Math.min(J+(q[1]||0),de),ye=J+ye-2,ce=Math.max(de,ye),_e=[],xe=[],De=2;J<ce;++J,++De)J<de&&xe.push(K("deleted",j[J],J)),J<ye&&_e.push(K("added",q[De],J));m.a.Kc(xe,_e);break;default:return}L=Q}}}};var E=m.a.Da("_state");m.o=m.$=function(_,S,w){function I(){if(0<arguments.length){if(typeof L=="function")L.apply(B.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return B.ra||m.u.cc(I),(B.ka||B.J&&I.Xa())&&I.ha(),B.X}if(typeof _=="object"?w=_:(w=w||{},_&&(w.read=_)),typeof w.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var L=w.write,B={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:w.read,nb:S||w.owner,l:w.disposeWhenNodeIsRemoved||w.l||null,Sa:w.disposeWhen||w.Sa,Rb:null,I:{},V:0,Ic:null};return I[E]=B,I.Nc=typeof L=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,v),w.pure?(B.wb=!0,B.J=!0,m.a.extend(I,D)):w.deferEvaluation&&m.a.extend(I,O),m.options.deferUpdates&&m.Ta.deferred(I,!0),B.l&&(B.jc=!0,B.l.nodeType||(B.l=null)),B.J||w.deferEvaluation||I.ha(),B.l&&I.ja()&&m.a.K.za(B.l,B.Rb=function(){I.s()}),I};var v={equalityComparer:c,qa:function(){return this[E].V},Va:function(){var _=[];return m.a.P(this[E].I,function(S,w){_[w.Ka]=w.da}),_},Vb:function(_){if(!this[E].V)return!1;var S=this.Va();return m.a.A(S,_)!==-1?!0:!!m.a.Lb(S,function(w){return w.Vb&&w.Vb(_)})},uc:function(_,S,w){if(this[E].wb&&S===this)throw Error("A 'pure' computed must not be called recursively");this[E].I[_]=w,w.Ka=this[E].V++,w.La=S.ob()},Xa:function(){var _,S,w=this[E].I;for(_ in w)if(Object.prototype.hasOwnProperty.call(w,_)&&(S=w[_],this.Ia&&S.da.Ja||S.da.Dd(S.La)))return!0},Jd:function(){this.Ia&&!this[E].rb&&this.Ia(!1)},ja:function(){var _=this[E];return _.ka||0<_.V},Rd:function(){this.Ja?this[E].ka&&(this[E].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var S=_.subscribe(this.Jd,this,"dirty"),w=_.subscribe(this.Rd,this);return{da:_,s:function(){S.s(),w.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,S=_.throttleEvaluation;S&&0<=S?(clearTimeout(this[E].Ic),this[E].Ic=m.a.setTimeout(function(){_.ha(!0)},S)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var S=this[E],w=S.Sa,I=!1;if(!S.rb&&!S.ra){if(S.l&&!m.a.Sb(S.l)||w&&w()){if(!S.jc){this.s();return}}else S.jc=!1;S.rb=!0;try{I=this.zd(_)}finally{S.rb=!1}return I}},zd:function(_){var S=this[E],I=!1,w=S.wb?e:!S.V,I={qd:this,mb:S.I,Qb:S.V};m.u.xc({pd:I,od:g,o:this,Ya:w}),S.I={},S.V=0;var L=this.yd(S,I);return S.V?I=this.sb(S.X,L):(this.s(),I=!0),I&&(S.J?this.Gb():this.notifySubscribers(S.X,"beforeChange"),S.X=L,this.notifySubscribers(S.X,"spectate"),!S.J&&_&&this.notifySubscribers(S.X),this.rc&&this.rc()),w&&this.notifySubscribers(S.X,"awake"),I},yd:function(_,S){try{var w=_.Wc;return _.nb?w.call(_.nb):w()}finally{m.u.end(),S.Qb&&!_.J&&m.a.P(S.mb,p),_.sa=_.ka=!1}},v:function(_){var S=this[E];return(S.ka&&(_||!S.V)||S.J&&this.Xa())&&this.ha(),S.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[E].J||(this[E].sa?this.ha():this[E].ka=!1),this[E].X},this.Ia=function(S){this.pc(this[E].X),this[E].ka=!0,S&&(this[E].sa=!0),this.qc(this,!S)}},s:function(){var _=this[E];!_.J&&_.I&&m.a.P(_.I,function(S,w){w.s&&w.s()}),_.l&&_.Rb&&m.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},D={Qa:function(_){var S=this,w=S[E];if(!w.ra&&w.J&&_=="change"){if(w.J=!1,w.sa||S.Xa())w.I=null,w.V=0,S.ha()&&S.Gb();else{var I=[];m.a.P(w.I,function(L,B){I[B.Ka]=L}),m.a.D(I,function(L,B){var U=w.I[L],V=S.$c(U.da);V.Ka=B,V.La=U.La,w.I[L]=V}),S.Xa()&&S.ha()&&S.Gb()}w.ra||S.notifySubscribers(w.X,"awake")}},hb:function(_){var S=this[E];S.ra||_!="change"||this.Wa("change")||(m.a.P(S.I,function(w,I){I.s&&(S.I[w]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),S.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[E];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},O={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(v,m.T.fn);var R=m.ta.Ma;v[R]=m.o,m.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},m.Fd=function(_){return m.Oc(_)&&_[E]&&_[E].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",v),m.L(v,"peek",v.v),m.L(v,"dispose",v.s),m.L(v,"isActive",v.ja),m.L(v,"getDependenciesCount",v.qa),m.L(v,"getDependencies",v.Va),m.xb=function(_,S){return typeof _=="function"?m.o(_,S,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,S))},m.b("pureComputed",m.xb),function(){function _(I,L,B){if(B=B||new w,I=L(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var U=I instanceof Array?[]:{};return B.save(I,U),S(I,function(V){var G=L(I[V]);switch(typeof G){case"boolean":case"number":case"string":case"function":U[V]=G;break;case"object":case"undefined":var k=B.get(G);U[V]=k!==e?k:_(G,L,B)}}),U}function S(I,L){if(I instanceof Array){for(var B=0;B<I.length;B++)L(B);typeof I.toJSON=="function"&&L("toJSON")}else for(B in I)L(B)}function w(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(L){for(var B=0;m.O(L)&&10>B;B++)L=L();return L})},m.toJSON=function(I,L,B){return I=m.ad(I),m.a.hc(I,L,B)},w.prototype={constructor:w,save:function(I,L){var B=m.a.A(this.keys,I);0<=B?this.values[B]=L:(this.keys.push(I),this.values.push(L))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,S,w){function I(L){var B=m.xb(_,w).extend({ma:"always"}),U=B.subscribe(function(V){V&&(U.s(),L(V))});return B.notifySubscribers(B.v()),U}return typeof Promise!="function"||S?I(S.bind(w)):new Promise(I)},m.b("when",m.Wd),function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,S,w){switch(m.a.R(_)){case"option":typeof S=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=S):(m.a.g.set(_,m.c.options.$b,S),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof S=="number"?S:"");break;case"select":(S===""||S===null)&&(S=e);for(var I=-1,L=0,B=_.options.length,U;L<B;++L)if(U=m.w.M(_.options[L]),U==S||U===""&&S===e){I=L;break}(w||0<=I||S===e&&1<_.size)&&(_.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=I},0));break;default:(S===null||S===e)&&(S=""),_.value=S}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function _(V){V=m.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=` -,`;var G=[],k=V.match(I),W,j=[],J=0;if(1<k.length){for(var q=0,K;K=k[q];++q){var Q=K.charCodeAt(0);if(Q===44){if(0>=J){G.push(W&&j.length?{key:W,value:j.join("")}:{unknown:W||j.join("")}),W=J=0,j=[];continue}}else if(Q===58){if(!J&&!W&&j.length===1){W=j.pop();continue}}else{if(Q===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;Q===47&&q&&1<K.length?(Q=k[q-1].match(L))&&!B[Q[0]]&&(V=V.substr(V.indexOf(K)+1),k=V.match(I),q=-1,K="/"):Q===40||Q===123||Q===91?++J:Q===41||Q===125||Q===93?--J:W||j.length||Q!==34&&Q!==39||(K=K.slice(1,-1))}j.push(K)}if(0<J)throw Error("Unbalanced parentheses, braces, or brackets")}return G}var S=["true","false","null","undefined"],w=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),L=/[\])"'A-Za-z0-9_$]+$/,B={in:1,return:1,typeof:1},U={};return{Ra:[],wa:U,ac:_,vb:function(V,G){function k(Q,de){var ye;if(!q){var ce=m.getBindingHandler(Q);if(ce&&ce.preprocess&&!(de=ce.preprocess(de,Q,k)))return;(ce=U[Q])&&(ye=de,0<=m.a.A(S,ye)?ye=!1:(ce=ye.match(w),ye=ce===null?!1:ce[1]?"Object("+ce[1]+")"+ce[2]:ye),ce=ye),ce&&j.push("'"+(typeof U[Q]=="string"?U[Q]:Q)+"':function(_z){"+ye+"=_z}")}J&&(de="function(){return "+de+" }"),W.push("'"+Q+"':"+de)}G=G||{};var W=[],j=[],J=G.valueAccessors,q=G.bindingParams,K=typeof V=="string"?_(V):V;return m.a.D(K,function(Q){k(Q.key||Q.unknown,Q.value)}),j.length&&k("_ko_property_writers","{"+j.join(",")+" }"),W.join(",")},Id:function(V,G){for(var k=0;k<V.length;k++)if(V[k].key==G)return!0;return!1},eb:function(V,G,k,W,j){V&&m.O(V)?!m.Za(V)||j&&V.v()===W||V(W):(V=G.get("_ko_property_writers"))&&V[k]&&V[k](W)}}}(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),function(){function _(k){return k.nodeType==8&&B.test(L?k.text:k.nodeValue)}function S(k){return k.nodeType==8&&U.test(L?k.text:k.nodeValue)}function w(k,W){for(var j=k,J=1,q=[];j=j.nextSibling;){if(S(j)&&(m.a.g.set(j,G,!0),J--,J===0))return q;q.push(j),_(j)&&J++}if(!W)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function I(k,W){var j=w(k,W);return j?0<j.length?j[j.length-1].nextSibling:k.nextSibling:null}var L=n&&n.createComment("test").text==="<!--test-->",B=L?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,U=L?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},G="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(k){return _(k)?w(k):k.childNodes},Ea:function(k){if(_(k)){k=m.h.childNodes(k);for(var W=0,j=k.length;W<j;W++)m.removeNode(k[W])}else m.a.Tb(k)},va:function(k,W){if(_(k)){m.h.Ea(k);for(var j=k.nextSibling,J=0,q=W.length;J<q;J++)j.parentNode.insertBefore(W[J],j)}else m.a.va(k,W)},Vc:function(k,W){var j;_(k)?(j=k.nextSibling,k=k.parentNode):j=k.firstChild,j?W!==j&&k.insertBefore(W,j):k.appendChild(W)},Wb:function(k,W,j){j?(j=j.nextSibling,_(k)&&(k=k.parentNode),j?W!==j&&k.insertBefore(W,j):k.appendChild(W)):m.h.Vc(k,W)},firstChild:function(k){if(_(k))return!k.nextSibling||S(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&S(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(_(k)&&(k=I(k)),k.nextSibling&&S(k.nextSibling)){var W=k.nextSibling;if(S(W)&&!m.a.g.get(W,G))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:_,Vd:function(k){return(k=(L?k.text:k.nodeValue).match(B))?k[1]:null},Sc:function(k){if(V[m.a.R(k)]){var W=k.firstChild;if(W)do if(W.nodeType===1){var j;j=W.firstChild;var J=null;if(j)do if(J)J.push(j);else if(_(j)){var q=I(j,!0);q?j=q:J=[j]}else S(j)&&(J=[j]);while(j=j.nextSibling);if(j=J)for(J=W.nextSibling,q=0;q<j.length;q++)J?k.insertBefore(j[q],J):k.appendChild(j[q])}while(W=W.nextSibling)}}}}(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,S){var w=this.getBindingsString(_,S),w=w?this.parseBindingsString(w,S,_):null;return m.j.tc(w,_,S,!1)},getBindingAccessors:function(_,S){var w=this.getBindingsString(_,S),w=w?this.parseBindingsString(w,S,_,{valueAccessors:!0}):null;return m.j.tc(w,_,S,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,S,w,I){try{var L=this.nd,B=_+(I&&I.valueAccessors||""),U;if(!(U=L[B])){var V,G="with($context){with($data||{}){return{"+m.m.vb(_,I)+"}}}";V=new Function("$context","$element",G),U=L[B]=V}return U(S,w)}catch(k){throw k.message=`Unable to parse bindings. + */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(_,S){return _===null||typeof _ in x?_===S:!1}function u(_,S){var w;return function(){w||(w=m.a.setTimeout(function(){w=e,_()},S))}}function f(_,S){var w;return function(){clearTimeout(w),w=m.a.setTimeout(_,S)}}function d(_,S){S&&S!=="change"?S==="beforeChange"?this.pc(_):this.gb(_,S):this.qc(_)}function p(_,S){S!==null&&S.s&&S.s()}function g(_,S){var w=this.qd,I=w[E];I.ra||(this.Qb&&this.mb[S]?(w.uc(S,_,this.mb[S]),this.mb[S]=null,--this.Qb):I.I[S]||w.uc(S,_,I.J?{da:_}:w.$c(_)),_.Ja&&_.gd())}var m=typeof s<"u"?s:{};m.b=function(_,S){for(var w=_.split("."),I=m,L=0;L<w.length-1;L++)I=I[w[L]];I[w[w.length-1]]=S},m.L=function(_,S,w){_[S]=w},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function _(j,K){for(var Q in j)L.call(j,Q)&&K(Q,j[Q])}function S(j,K){if(K)for(var Q in K)L.call(K,Q)&&(j[Q]=K[Q]);return j}function w(j,K){return j.__proto__=K,j}function I(j,K,Q,de){var xe=j[K].match(q)||[];m.a.D(Q.match(q),function(ce){m.a.Na(xe,ce,de)}),j[K]=xe.join(" ")}var L=Object.prototype.hasOwnProperty,B={__proto__:[]}instanceof Array,U=typeof Symbol=="function",V={},G={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(V,function(j,K){if(K.length)for(var Q=0,de=K.length;Q<de;Q++)G[K[Q]]=j});var k={propertychange:!0},W=n&&function(){for(var j=3,K=n.createElement("div"),Q=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++j+"]><i></i><![endif]-->",Q[0];);return 4<j?j:e}(),q=/\S+/g,J;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(j,K,Q){for(var de=0,xe=j.length;de<xe;de++)K.call(Q,j[de],de,j)},A:typeof Array.prototype.indexOf=="function"?function(j,K){return Array.prototype.indexOf.call(j,K)}:function(j,K){for(var Q=0,de=j.length;Q<de;Q++)if(j[Q]===K)return Q;return-1},Lb:function(j,K,Q){for(var de=0,xe=j.length;de<xe;de++)if(K.call(Q,j[de],de,j))return j[de];return e},Pa:function(j,K){var Q=m.a.A(j,K);0<Q?j.splice(Q,1):Q===0&&j.shift()},wc:function(j){var K=[];return j&&m.a.D(j,function(Q){0>m.a.A(K,Q)&&K.push(Q)}),K},Mb:function(j,K,Q){var de=[];if(j)for(var xe=0,ce=j.length;xe<ce;xe++)de.push(K.call(Q,j[xe],xe));return de},jb:function(j,K,Q){var de=[];if(j)for(var xe=0,ce=j.length;xe<ce;xe++)K.call(Q,j[xe],xe)&&de.push(j[xe]);return de},Nb:function(j,K){if(K instanceof Array)j.push.apply(j,K);else for(var Q=0,de=K.length;Q<de;Q++)j.push(K[Q]);return j},Na:function(j,K,Q){var de=m.a.A(m.a.bc(j),K);0>de?Q&&j.push(K):Q||j.splice(de,1)},Ba:B,extend:S,setPrototypeOf:w,Ab:B?w:S,P:_,Ga:function(j,K,Q){if(!j)return j;var de={},xe;for(xe in j)L.call(j,xe)&&(de[xe]=K.call(Q,j[xe],xe,j));return de},Tb:function(j){for(;j.firstChild;)m.removeNode(j.firstChild)},Yb:function(j){j=m.a.la(j);for(var K=(j[0]&&j[0].ownerDocument||n).createElement("div"),Q=0,de=j.length;Q<de;Q++)K.appendChild(m.oa(j[Q]));return K},Ca:function(j,K){for(var Q=0,de=j.length,xe=[];Q<de;Q++){var ce=j[Q].cloneNode(!0);xe.push(K?m.oa(ce):ce)}return xe},va:function(j,K){if(m.a.Tb(j),K)for(var Q=0,de=K.length;Q<de;Q++)j.appendChild(K[Q])},Xc:function(j,K){var Q=j.nodeType?[j]:j;if(0<Q.length){for(var de=Q[0],xe=de.parentNode,ce=0,ge=K.length;ce<ge;ce++)xe.insertBefore(K[ce],de);for(ce=0,ge=Q.length;ce<ge;ce++)m.removeNode(Q[ce])}},Ua:function(j,K){if(j.length){for(K=K.nodeType===8&&K.parentNode||K;j.length&&j[0].parentNode!==K;)j.splice(0,1);for(;1<j.length&&j[j.length-1].parentNode!==K;)j.length--;if(1<j.length){var Q=j[0],de=j[j.length-1];for(j.length=0;Q!==de;)j.push(Q),Q=Q.nextSibling;j.push(de)}}return j},Zc:function(j,K){7>W?j.setAttribute("selected",K):j.selected=K},Db:function(j){return j===null||j===e?"":j.trim?j.trim():j.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(j,K){return j=j||"",K.length>j.length?!1:j.substring(0,K.length)===K},vd:function(j,K){if(j===K)return!0;if(j.nodeType===11)return!1;if(K.contains)return K.contains(j.nodeType!==1?j.parentNode:j);if(K.compareDocumentPosition)return(K.compareDocumentPosition(j)&16)==16;for(;j&&j!=K;)j=j.parentNode;return!!j},Sb:function(j){return m.a.vd(j,j.ownerDocument.documentElement)},kd:function(j){return!!m.a.Lb(j,m.a.Sb)},R:function(j){return j&&j.tagName&&j.tagName.toLowerCase()},Ac:function(j){return m.onError?function(){try{return j.apply(this,arguments)}catch(K){throw m.onError&&m.onError(K),K}}:j},setTimeout:function(j,K){return setTimeout(m.a.Ac(j),K)},Gc:function(j){setTimeout(function(){throw m.onError&&m.onError(j),j},0)},B:function(j,K,Q){var de=m.a.Ac(Q);if(Q=k[K],m.options.useOnlyNativeEvents||Q||!o)if(Q||typeof j.addEventListener!="function")if(typeof j.attachEvent<"u"){var xe=function(ge){de.call(j,ge)},ce="on"+K;j.attachEvent(ce,xe),m.a.K.za(j,function(){j.detachEvent(ce,xe)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else j.addEventListener(K,de,!1);else J||(J=typeof o(j).on=="function"?"on":"bind"),o(j)[J](K,de)},Fb:function(j,K){if(!j||!j.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Q;if(m.a.R(j)==="input"&&j.type&&K.toLowerCase()=="click"?(Q=j.type,Q=Q=="checkbox"||Q=="radio"):Q=!1,m.options.useOnlyNativeEvents||!o||Q)if(typeof n.createEvent=="function")if(typeof j.dispatchEvent=="function")Q=n.createEvent(G[K]||"HTMLEvents"),Q.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,j),j.dispatchEvent(Q);else throw Error("The supplied element doesn't support dispatchEvent");else if(Q&&j.click)j.click();else if(typeof j.fireEvent<"u")j.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else o(j).trigger(K)},f:function(j){return m.O(j)?j():j},bc:function(j){return m.O(j)?j.v():j},Eb:function(j,K,Q){var de;K&&(typeof j.classList=="object"?(de=j.classList[Q?"add":"remove"],m.a.D(K.match(q),function(xe){de.call(j.classList,xe)})):typeof j.className.baseVal=="string"?I(j.className,"baseVal",K,Q):I(j,"className",K,Q))},Bb:function(j,K){var Q=m.a.f(K);(Q===null||Q===e)&&(Q="");var de=m.h.firstChild(j);!de||de.nodeType!=3||m.h.nextSibling(de)?m.h.va(j,[j.ownerDocument.createTextNode(Q)]):de.data=Q,m.a.Ad(j)},Yc:function(j,K){if(j.name=K,7>=W)try{var Q=j.name.replace(/[&<>'"]/g,function(de){return"&#"+de.charCodeAt(0)+";"});j.mergeAttributes(n.createElement("<input name='"+Q+"'/>"),!1)}catch{}},Ad:function(j){9<=W&&(j=j.nodeType==1?j:j.parentNode,j.style&&(j.style.zoom=j.style.zoom))},wd:function(j){if(W){var K=j.style.width;j.style.width=0,j.style.width=K}},Pd:function(j,K){j=m.a.f(j),K=m.a.f(K);for(var Q=[],de=j;de<=K;de++)Q.push(de);return Q},la:function(j){for(var K=[],Q=0,de=j.length;Q<de;Q++)K.push(j[Q]);return K},Da:function(j){return U?Symbol(j):j},Zd:W===6,$d:W===7,W,Lc:function(j,K){for(var Q=m.a.la(j.getElementsByTagName("input")).concat(m.a.la(j.getElementsByTagName("textarea"))),de=typeof K=="string"?function(ge){return ge.name===K}:function(ge){return K.test(ge.name)},xe=[],ce=Q.length-1;0<=ce;ce--)de(Q[ce])&&xe.push(Q[ce]);return xe},Nd:function(j){return typeof j=="string"&&(j=m.a.Db(j))?r&&r.parse?r.parse(j):new Function("return "+j)():null},hc:function(j,K,Q){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(m.a.f(j),K,Q)},Od:function(j,K,Q){Q=Q||{};var de=Q.params||{},xe=Q.includeFields||this.Jc,ce=j;if(typeof j=="object"&&m.a.R(j)==="form")for(var ce=j.action,ge=xe.length-1;0<=ge;ge--)for(var be=m.a.Lc(j,xe[ge]),De=be.length-1;0<=De;De--)de[be[De].name]=be[De].value;K=m.a.f(K);var Ae=n.createElement("form");Ae.style.display="none",Ae.action=ce,Ae.method="post";for(var ke in K)j=n.createElement("input"),j.type="hidden",j.name=ke,j.value=m.a.hc(m.a.f(K[ke])),Ae.appendChild(j);_(de,function(ze,tt){var vt=n.createElement("input");vt.type="hidden",vt.name=ze,vt.value=tt,Ae.appendChild(vt)}),n.body.appendChild(Ae),Q.submitter?Q.submitter(Ae):Ae.submit(),setTimeout(function(){Ae.parentNode.removeChild(Ae)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var S=this;if(arguments.length===1)return function(){return S.apply(_,arguments)};var w=Array.prototype.slice.call(arguments,1);return function(){var I=w.slice(0);return I.push.apply(I,arguments),S.apply(_,I)}}),m.a.g=new function(){var _=0,S="__ko__"+new Date().getTime(),w={},I,L;return m.a.W?(I=function(B,U){var V=B[S];if(!V||V==="null"||!w[V]){if(!U)return e;V=B[S]="ko"+_++,w[V]={}}return w[V]},L=function(B){var U=B[S];return U?(delete w[U],B[S]=null,!0):!1}):(I=function(B,U){var V=B[S];return!V&&U&&(V=B[S]={}),V},L=function(B){return B[S]?(delete B[S],!0):!1}),{get:function(B,U){var V=I(B,!1);return V&&V[U]},set:function(B,U,V){(B=I(B,V!==e))&&(B[U]=V)},Ub:function(B,U,V){return B=I(B,!0),B[U]||(B[U]=V)},clear:L,Z:function(){return _+++S}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(U,V){var G=m.a.g.get(U,I);return G===e&&V&&(G=[],m.a.g.set(U,I,G)),G}function S(U){var V=_(U,!1);if(V)for(var V=V.slice(0),G=0;G<V.length;G++)V[G](U);m.a.g.clear(U),m.a.K.cleanExternalData(U),B[U.nodeType]&&w(U.childNodes,!0)}function w(U,V){for(var G=[],k,W=0;W<U.length;W++)if((!V||U[W].nodeType===8)&&(S(G[G.length]=k=U[W]),U[W]!==k))for(;W--&&m.a.A(G,U[W])==-1;);}var I=m.a.g.Z(),L={1:!0,8:!0,9:!0},B={1:!0,9:!0};return{za:function(U,V){if(typeof V!="function")throw Error("Callback must be a function");_(U,!0).push(V)},yb:function(U,V){var G=_(U,!1);G&&(m.a.Pa(G,V),G.length==0&&m.a.g.set(U,I,e))},oa:function(U){return m.u.G(function(){L[U.nodeType]&&(S(U),B[U.nodeType]&&w(U.getElementsByTagName("*")))}),U},removeNode:function(U){m.oa(U),U.parentNode&&U.parentNode.removeChild(U)},cleanExternalData:function(U){o&&typeof o.cleanData=="function"&&o.cleanData([U])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),function(){var _=[0,"",""],S=[1,"<table>","</table>"],w=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],L={thead:S,tbody:S,tfoot:S,tr:[2,"<table><tbody>","</tbody></table>"],td:w,th:w,option:I,optgroup:I},B=8>=m.a.W;m.a.ua=function(U,V){var G;if(o){if(o.parseHTML)G=o.parseHTML(U,V)||[];else if((G=o.clean([U],V))&&G[0]){for(var k=G[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(G=V)||(G=n);var k=G.parentWindow||G.defaultView||t,W=m.a.Db(U).toLowerCase(),q=G.createElement("div"),J;for(J=(W=W.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&L[W[1]]||_,W=J[0],J="ignored<div>"+J[1]+U+J[2]+"</div>",typeof k.innerShiv=="function"?q.appendChild(k.innerShiv(J)):(B&&G.body.appendChild(q),q.innerHTML=J,B&&q.parentNode.removeChild(q));W--;)q=q.lastChild;G=m.a.la(q.lastChild.childNodes)}return G},m.a.Md=function(U,V){var G=m.a.ua(U,V);return G.length&&G[0].parentElement||m.a.Yb(G)},m.a.fc=function(U,V){if(m.a.Tb(U),V=m.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),o)o(U).html(V);else for(var G=m.a.ua(V,U.ownerDocument),k=0;k<G.length;k++)U.appendChild(G[k])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function _(w,I){if(w){if(w.nodeType==8){var L=m.aa.Uc(w.nodeValue);L!=null&&I.push({ud:w,Kd:L})}else if(w.nodeType==1)for(var L=0,B=w.childNodes,U=B.length;L<U;L++)_(B[L],I)}}var S={};return{Xb:function(w){if(typeof w!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return S[I]=w,"<!--[ko_memo:"+I+"]-->"},bd:function(w,I){var L=S[w];if(L===e)throw Error("Couldn't find any memo with ID "+w+". Perhaps it's already been unmemoized.");try{return L.apply(null,I||[]),!0}finally{delete S[w]}},cd:function(w,I){var L=[];_(w,L);for(var B=0,U=L.length;B<U;B++){var V=L[B].ud,G=[V];I&&m.a.Nb(G,I),m.aa.bd(L[B].Kd,G),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(w){return(w=w.match(/^\[ko_memo\:(.*?)\]$/))?w[1]:null}}}(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=function(){function _(){if(L){for(var V=L,G=0,k;U<L;)if(k=I[U++]){if(U>V){if(5e3<=++G){U=L,m.a.Gc(Error("'Too much recursion' after processing "+G+" task groups."));break}V=L}try{k()}catch(W){m.a.Gc(W)}}}}function S(){_(),U=L=I.length=0}var w,I=[],L=0,B=1,U=0;return t.MutationObserver?w=function(V){var G=n.createElement("div");return new MutationObserver(V).observe(G,{attributes:!0}),function(){G.classList.toggle("foo")}}(S):w=n&&"onreadystatechange"in n.createElement("script")?function(V){var G=n.createElement("script");G.onreadystatechange=function(){G.onreadystatechange=null,n.documentElement.removeChild(G),G=null,V()},n.documentElement.appendChild(G)}:function(V){setTimeout(V,0)},{scheduler:w,zb:function(V){return L||m.na.scheduler(S),I[L++]=V,B++},cancel:function(V){V=V-(B-L),V>=U&&V<L&&(I[V]=null)},resetForTesting:function(){var V=L-U;return U=L=I.length=0,V},Sd:_}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,S){_.throttleEvaluation=S;var w=null;return m.$({read:_,write:function(I){clearTimeout(w),w=m.a.setTimeout(function(){_(I)},S)}})},rateLimit:function(_,S){var w,I,L;typeof S=="number"?w=S:(w=S.timeout,I=S.method),_.Hb=!1,L=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,_.ub(function(B){return L(B,w,S)})},deferred:function(_,S){if(S!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(w){var I,L=!1;return function(){if(!L){m.na.cancel(I),I=m.na.zb(w);try{L=!0,_.notifySubscribers(e,"dirty")}finally{L=!1}}}}))},notify:function(_,S){_.equalityComparer=S=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,S,w){this.da=_,this.lc=S,this.mc=w,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(_){this.Jb=_,m.a.K.za(_,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,b),b.qb(this)};var b={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,S,w){var I=this;w=w||"change";var L=new m.ic(I,S?_.bind(S):_,function(){m.a.Pa(I.U[w],L),I.hb&&I.hb(w)});return I.Qa&&I.Qa(w),I.U[w]||(I.U[w]=[]),I.U[w].push(L),L},notifySubscribers:function(_,S){if(S=S||"change",S==="change"&&this.Gb(),this.Wa(S)){var w=S==="change"&&this.ed||this.U[S].slice(0);try{m.u.xc();for(var I=0,L;L=w[I];++I)L.Ib||L.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var S=this,w=m.O(S),I,L,B,U,V;S.gb||(S.gb=S.notifySubscribers,S.notifySubscribers=d);var G=_(function(){S.Ja=!1,w&&U===S&&(U=S.nc?S.nc():S());var k=L||V&&S.sb(B,U);V=L=I=!1,k&&S.gb(B=U)});S.qc=function(k,W){W&&S.Ja||(V=!W),S.ed=S.U.change.slice(0),S.Ja=I=!0,U=k,G()},S.pc=function(k){I||(B=k,S.gb(k,"beforeChange"))},S.rc=function(){V=!0},S.gd=function(){S.sb(B,S.v(!0))&&(L=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var S=0;return m.a.P(this.U,function(w,I){w!=="dirty"&&(S+=I.length)}),S},sb:function(_,S){return!this.equalityComparer||!this.equalityComparer(_,S)},toString:function(){return"[object Object]"},extend:function(_){var S=this;return _&&m.a.P(_,function(w,I){var L=m.Ta[w];typeof L=="function"&&(S=L(S,I)||S)}),S}};m.L(b,"init",b.qb),m.L(b,"subscribe",b.subscribe),m.L(b,"extend",b.extend),m.L(b,"getSubscriptionsCount",b.Bd),m.a.Ba&&m.a.setPrototypeOf(b,Function.prototype),m.T.fn=b,m.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function _(B){w.push(I),I=B}function S(){I=w.pop()}var w=[],I,L=0;return{xc:_,end:S,cc:function(B){if(I){if(!m.Qc(B))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,B,B.fd||(B.fd=++L))}},G:function(B,U,V){try{return _(),B.apply(U,V||[])}finally{S()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var T=m.a.Da("_latestValue");m.ta=function(_){function S(){return 0<arguments.length?(S.sb(S[T],arguments[0])&&(S.ya(),S[T]=arguments[0],S.xa()),this):(m.u.cc(S),S[T])}return S[T]=_,m.a.Ba||m.a.extend(S,m.T.fn),m.T.fn.qb(S),m.a.Ab(S,C),m.options.deferUpdates&&m.Ta.deferred(S,!0),S};var C={equalityComparer:c,v:function(){return this[T]},xa:function(){this.notifySubscribers(this[T],"spectate"),this.notifySubscribers(this[T])},ya:function(){this.notifySubscribers(this[T],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(C,m.T.fn);var A=m.ta.Ma="__ko_proto__";C[A]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[A])&&_!==C[A]&&_!==m.o.fn[A])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[A]===C[A]||_[A]===m.o.fn[A]&&_.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",C),m.L(C,"peek",C.v),m.L(C,"valueHasMutated",C.xa),m.L(C,"valueWillMutate",C.ya),m.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=m.ta(_),m.a.Ab(_,m.Ha.fn),_.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(_){for(var S=this.v(),w=[],I=typeof _!="function"||m.O(_)?function(U){return U===_}:_,L=0;L<S.length;L++){var B=S[L];if(I(B)){if(w.length===0&&this.ya(),S[L]!==B)throw Error("Array modified during remove; cannot remove item");w.push(B),S.splice(L,1),L--}}return w.length&&this.xa(),w},removeAll:function(_){if(_===e){var S=this.v(),w=S.slice(0);return this.ya(),S.splice(0,S.length),this.xa(),w}return _?this.remove(function(I){return 0<=m.a.A(_,I)}):[]},destroy:function(_){var S=this.v(),w=typeof _!="function"||m.O(_)?function(B){return B===_}:_;this.ya();for(var I=S.length-1;0<=I;I--){var L=S[I];w(L)&&(L._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(S){return 0<=m.a.A(_,S)}):[]},indexOf:function(_){var S=this();return m.a.A(S,_)},replace:function(_,S){var w=this.indexOf(_);0<=w&&(this.ya(),this.v()[w]=S,this.xa())},sorted:function(_){var S=this().slice(0);return _?S.sort(_):S.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){m.Ha.fn[_]=function(){var S=this.v();this.ya(),this.zc(S,_,arguments);var w=S[_].apply(S,arguments);return this.xa(),w===S?this:w}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var S=this();return S[_].apply(S,arguments)}}),m.Pc=function(_){return m.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(_,S){function w(){function q(){if(V){var J=[].concat(_.v()||[]),j;_.Wa("arrayChange")&&((!L||1<V)&&(L=m.a.Pb(G,J,_.Ob)),j=L),G=J,L=null,V=0,j&&j.length&&_.notifySubscribers(j,"arrayChange")}}I?q():(I=!0,U=_.subscribe(function(){++V},null,"spectate"),G=[].concat(_.v()||[]),L=null,B=_.subscribe(q))}if(_.Ob={},S&&typeof S=="object"&&m.a.extend(_.Ob,S),_.Ob.sparse=!0,!_.zc){var I=!1,L=null,B,U,V=0,G,k=_.Qa,W=_.hb;_.Qa=function(q){k&&k.call(_,q),q==="arrayChange"&&w()},_.hb=function(q){W&&W.call(_,q),q!=="arrayChange"||_.Wa("arrayChange")||(B&&B.s(),U&&U.s(),U=B=null,I=!1,G=e)},_.zc=function(q,J,j){function K(Ae,ke,ze){return Q[Q.length]={status:Ae,value:ke,index:ze}}if(I&&!V){var Q=[],de=q.length,xe=j.length,ce=0;switch(J){case"push":ce=de;case"unshift":for(J=0;J<xe;J++)K("added",j[J],ce+J);break;case"pop":ce=de-1;case"shift":de&&K("deleted",q[ce],ce);break;case"splice":J=Math.min(Math.max(0,0>j[0]?de+j[0]:j[0]),de);for(var de=xe===1?de:Math.min(J+(j[1]||0),de),xe=J+xe-2,ce=Math.max(de,xe),ge=[],be=[],De=2;J<ce;++J,++De)J<de&&be.push(K("deleted",q[J],J)),J<xe&&ge.push(K("added",j[De],J));m.a.Kc(be,ge);break;default:return}L=Q}}}};var E=m.a.Da("_state");m.o=m.$=function(_,S,w){function I(){if(0<arguments.length){if(typeof L=="function")L.apply(B.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return B.ra||m.u.cc(I),(B.ka||B.J&&I.Xa())&&I.ha(),B.X}if(typeof _=="object"?w=_:(w=w||{},_&&(w.read=_)),typeof w.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var L=w.write,B={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:w.read,nb:S||w.owner,l:w.disposeWhenNodeIsRemoved||w.l||null,Sa:w.disposeWhen||w.Sa,Rb:null,I:{},V:0,Ic:null};return I[E]=B,I.Nc=typeof L=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,v),w.pure?(B.wb=!0,B.J=!0,m.a.extend(I,D)):w.deferEvaluation&&m.a.extend(I,O),m.options.deferUpdates&&m.Ta.deferred(I,!0),B.l&&(B.jc=!0,B.l.nodeType||(B.l=null)),B.J||w.deferEvaluation||I.ha(),B.l&&I.ja()&&m.a.K.za(B.l,B.Rb=function(){I.s()}),I};var v={equalityComparer:c,qa:function(){return this[E].V},Va:function(){var _=[];return m.a.P(this[E].I,function(S,w){_[w.Ka]=w.da}),_},Vb:function(_){if(!this[E].V)return!1;var S=this.Va();return m.a.A(S,_)!==-1?!0:!!m.a.Lb(S,function(w){return w.Vb&&w.Vb(_)})},uc:function(_,S,w){if(this[E].wb&&S===this)throw Error("A 'pure' computed must not be called recursively");this[E].I[_]=w,w.Ka=this[E].V++,w.La=S.ob()},Xa:function(){var _,S,w=this[E].I;for(_ in w)if(Object.prototype.hasOwnProperty.call(w,_)&&(S=w[_],this.Ia&&S.da.Ja||S.da.Dd(S.La)))return!0},Jd:function(){this.Ia&&!this[E].rb&&this.Ia(!1)},ja:function(){var _=this[E];return _.ka||0<_.V},Rd:function(){this.Ja?this[E].ka&&(this[E].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var S=_.subscribe(this.Jd,this,"dirty"),w=_.subscribe(this.Rd,this);return{da:_,s:function(){S.s(),w.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,S=_.throttleEvaluation;S&&0<=S?(clearTimeout(this[E].Ic),this[E].Ic=m.a.setTimeout(function(){_.ha(!0)},S)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var S=this[E],w=S.Sa,I=!1;if(!S.rb&&!S.ra){if(S.l&&!m.a.Sb(S.l)||w&&w()){if(!S.jc){this.s();return}}else S.jc=!1;S.rb=!0;try{I=this.zd(_)}finally{S.rb=!1}return I}},zd:function(_){var S=this[E],I=!1,w=S.wb?e:!S.V,I={qd:this,mb:S.I,Qb:S.V};m.u.xc({pd:I,od:g,o:this,Ya:w}),S.I={},S.V=0;var L=this.yd(S,I);return S.V?I=this.sb(S.X,L):(this.s(),I=!0),I&&(S.J?this.Gb():this.notifySubscribers(S.X,"beforeChange"),S.X=L,this.notifySubscribers(S.X,"spectate"),!S.J&&_&&this.notifySubscribers(S.X),this.rc&&this.rc()),w&&this.notifySubscribers(S.X,"awake"),I},yd:function(_,S){try{var w=_.Wc;return _.nb?w.call(_.nb):w()}finally{m.u.end(),S.Qb&&!_.J&&m.a.P(S.mb,p),_.sa=_.ka=!1}},v:function(_){var S=this[E];return(S.ka&&(_||!S.V)||S.J&&this.Xa())&&this.ha(),S.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[E].J||(this[E].sa?this.ha():this[E].ka=!1),this[E].X},this.Ia=function(S){this.pc(this[E].X),this[E].ka=!0,S&&(this[E].sa=!0),this.qc(this,!S)}},s:function(){var _=this[E];!_.J&&_.I&&m.a.P(_.I,function(S,w){w.s&&w.s()}),_.l&&_.Rb&&m.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},D={Qa:function(_){var S=this,w=S[E];if(!w.ra&&w.J&&_=="change"){if(w.J=!1,w.sa||S.Xa())w.I=null,w.V=0,S.ha()&&S.Gb();else{var I=[];m.a.P(w.I,function(L,B){I[B.Ka]=L}),m.a.D(I,function(L,B){var U=w.I[L],V=S.$c(U.da);V.Ka=B,V.La=U.La,w.I[L]=V}),S.Xa()&&S.ha()&&S.Gb()}w.ra||S.notifySubscribers(w.X,"awake")}},hb:function(_){var S=this[E];S.ra||_!="change"||this.Wa("change")||(m.a.P(S.I,function(w,I){I.s&&(S.I[w]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),S.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[E];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},O={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(v,m.T.fn);var R=m.ta.Ma;v[R]=m.o,m.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},m.Fd=function(_){return m.Oc(_)&&_[E]&&_[E].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",v),m.L(v,"peek",v.v),m.L(v,"dispose",v.s),m.L(v,"isActive",v.ja),m.L(v,"getDependenciesCount",v.qa),m.L(v,"getDependencies",v.Va),m.xb=function(_,S){return typeof _=="function"?m.o(_,S,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,S))},m.b("pureComputed",m.xb),function(){function _(I,L,B){if(B=B||new w,I=L(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var U=I instanceof Array?[]:{};return B.save(I,U),S(I,function(V){var G=L(I[V]);switch(typeof G){case"boolean":case"number":case"string":case"function":U[V]=G;break;case"object":case"undefined":var k=B.get(G);U[V]=k!==e?k:_(G,L,B)}}),U}function S(I,L){if(I instanceof Array){for(var B=0;B<I.length;B++)L(B);typeof I.toJSON=="function"&&L("toJSON")}else for(B in I)L(B)}function w(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(L){for(var B=0;m.O(L)&&10>B;B++)L=L();return L})},m.toJSON=function(I,L,B){return I=m.ad(I),m.a.hc(I,L,B)},w.prototype={constructor:w,save:function(I,L){var B=m.a.A(this.keys,I);0<=B?this.values[B]=L:(this.keys.push(I),this.values.push(L))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,S,w){function I(L){var B=m.xb(_,w).extend({ma:"always"}),U=B.subscribe(function(V){V&&(U.s(),L(V))});return B.notifySubscribers(B.v()),U}return typeof Promise!="function"||S?I(S.bind(w)):new Promise(I)},m.b("when",m.Wd),function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,S,w){switch(m.a.R(_)){case"option":typeof S=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=S):(m.a.g.set(_,m.c.options.$b,S),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof S=="number"?S:"");break;case"select":(S===""||S===null)&&(S=e);for(var I=-1,L=0,B=_.options.length,U;L<B;++L)if(U=m.w.M(_.options[L]),U==S||U===""&&S===e){I=L;break}(w||0<=I||S===e&&1<_.size)&&(_.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=I},0));break;default:(S===null||S===e)&&(S=""),_.value=S}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function _(V){V=m.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=` +,`;var G=[],k=V.match(I),W,q=[],J=0;if(1<k.length){for(var j=0,K;K=k[j];++j){var Q=K.charCodeAt(0);if(Q===44){if(0>=J){G.push(W&&q.length?{key:W,value:q.join("")}:{unknown:W||q.join("")}),W=J=0,q=[];continue}}else if(Q===58){if(!J&&!W&&q.length===1){W=q.pop();continue}}else{if(Q===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;Q===47&&j&&1<K.length?(Q=k[j-1].match(L))&&!B[Q[0]]&&(V=V.substr(V.indexOf(K)+1),k=V.match(I),j=-1,K="/"):Q===40||Q===123||Q===91?++J:Q===41||Q===125||Q===93?--J:W||q.length||Q!==34&&Q!==39||(K=K.slice(1,-1))}q.push(K)}if(0<J)throw Error("Unbalanced parentheses, braces, or brackets")}return G}var S=["true","false","null","undefined"],w=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* +|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),L=/[\])"'A-Za-z0-9_$]+$/,B={in:1,return:1,typeof:1},U={};return{Ra:[],wa:U,ac:_,vb:function(V,G){function k(Q,de){var xe;if(!j){var ce=m.getBindingHandler(Q);if(ce&&ce.preprocess&&!(de=ce.preprocess(de,Q,k)))return;(ce=U[Q])&&(xe=de,0<=m.a.A(S,xe)?xe=!1:(ce=xe.match(w),xe=ce===null?!1:ce[1]?"Object("+ce[1]+")"+ce[2]:xe),ce=xe),ce&&q.push("'"+(typeof U[Q]=="string"?U[Q]:Q)+"':function(_z){"+xe+"=_z}")}J&&(de="function(){return "+de+" }"),W.push("'"+Q+"':"+de)}G=G||{};var W=[],q=[],J=G.valueAccessors,j=G.bindingParams,K=typeof V=="string"?_(V):V;return m.a.D(K,function(Q){k(Q.key||Q.unknown,Q.value)}),q.length&&k("_ko_property_writers","{"+q.join(",")+" }"),W.join(",")},Id:function(V,G){for(var k=0;k<V.length;k++)if(V[k].key==G)return!0;return!1},eb:function(V,G,k,W,q){V&&m.O(V)?!m.Za(V)||q&&V.v()===W||V(W):(V=G.get("_ko_property_writers"))&&V[k]&&V[k](W)}}}(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),function(){function _(k){return k.nodeType==8&&B.test(L?k.text:k.nodeValue)}function S(k){return k.nodeType==8&&U.test(L?k.text:k.nodeValue)}function w(k,W){for(var q=k,J=1,j=[];q=q.nextSibling;){if(S(q)&&(m.a.g.set(q,G,!0),J--,J===0))return j;j.push(q),_(q)&&J++}if(!W)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function I(k,W){var q=w(k,W);return q?0<q.length?q[q.length-1].nextSibling:k.nextSibling:null}var L=n&&n.createComment("test").text==="<!--test-->",B=L?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,U=L?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},G="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(k){return _(k)?w(k):k.childNodes},Ea:function(k){if(_(k)){k=m.h.childNodes(k);for(var W=0,q=k.length;W<q;W++)m.removeNode(k[W])}else m.a.Tb(k)},va:function(k,W){if(_(k)){m.h.Ea(k);for(var q=k.nextSibling,J=0,j=W.length;J<j;J++)q.parentNode.insertBefore(W[J],q)}else m.a.va(k,W)},Vc:function(k,W){var q;_(k)?(q=k.nextSibling,k=k.parentNode):q=k.firstChild,q?W!==q&&k.insertBefore(W,q):k.appendChild(W)},Wb:function(k,W,q){q?(q=q.nextSibling,_(k)&&(k=k.parentNode),q?W!==q&&k.insertBefore(W,q):k.appendChild(W)):m.h.Vc(k,W)},firstChild:function(k){if(_(k))return!k.nextSibling||S(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&S(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(_(k)&&(k=I(k)),k.nextSibling&&S(k.nextSibling)){var W=k.nextSibling;if(S(W)&&!m.a.g.get(W,G))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:_,Vd:function(k){return(k=(L?k.text:k.nodeValue).match(B))?k[1]:null},Sc:function(k){if(V[m.a.R(k)]){var W=k.firstChild;if(W)do if(W.nodeType===1){var q;q=W.firstChild;var J=null;if(q)do if(J)J.push(q);else if(_(q)){var j=I(q,!0);j?q=j:J=[q]}else S(q)&&(J=[q]);while(q=q.nextSibling);if(q=J)for(J=W.nextSibling,j=0;j<q.length;j++)J?k.insertBefore(q[j],J):k.appendChild(q[j])}while(W=W.nextSibling)}}}}(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,S){var w=this.getBindingsString(_,S),w=w?this.parseBindingsString(w,S,_):null;return m.j.tc(w,_,S,!1)},getBindingAccessors:function(_,S){var w=this.getBindingsString(_,S),w=w?this.parseBindingsString(w,S,_,{valueAccessors:!0}):null;return m.j.tc(w,_,S,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,S,w,I){try{var L=this.nd,B=_+(I&&I.valueAccessors||""),U;if(!(U=L[B])){var V,G="with($context){with($data||{}){return{"+m.m.vb(_,I)+"}}}";V=new Function("$context","$element",G),U=L[B]=V}return U(S,w)}catch(k){throw k.message=`Unable to parse bindings. Bindings value: `+_+` -Message: `+k.message,k}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function _(ce){var _e=(ce=m.a.g.get(ce,ye))&&ce.N;_e&&(ce.N=null,_e.Tc())}function S(ce,_e,xe){this.node=ce,this.yc=_e,this.kb=[],this.H=!1,_e.N||m.a.K.za(ce,_),xe&&xe.N&&(xe.N.kb.push(ce),this.Kb=xe)}function w(ce){return function(){return ce}}function I(ce){return ce()}function L(ce){return m.a.Ga(m.u.G(ce),function(_e,xe){return function(){return ce()[xe]}})}function B(ce,_e,xe){return typeof ce=="function"?L(ce.bind(null,_e,xe)):m.a.Ga(ce,w)}function U(ce,_e){return L(this.getBindings.bind(this,ce,_e))}function V(ce,_e){var xe=m.h.firstChild(_e);if(xe){var De,Ae=m.ga.instance,ke=Ae.preprocessNode;if(ke){for(;De=xe;)xe=m.h.nextSibling(De),ke.call(Ae,De);xe=m.h.firstChild(_e)}for(;De=xe;)xe=m.h.nextSibling(De),G(ce,De)}m.i.ma(_e,m.i.H)}function G(ce,_e){var xe=ce,De=_e.nodeType===1;De&&m.h.Sc(_e),(De||m.ga.instance.nodeHasBindings(_e))&&(xe=W(_e,null,ce).bindingContextForDescendants),xe&&!Q[m.a.R(_e)]&&V(xe,_e)}function k(ce){var _e=[],xe={},De=[];return m.a.P(ce,function Ae(ke){if(!xe[ke]){var ze=m.getBindingHandler(ke);ze&&(ze.after&&(De.push(ke),m.a.D(ze.after,function(tt){if(ce[tt]){if(m.a.A(De,tt)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+De.join(", "));Ae(tt)}}),De.length--),_e.push({key:ke,Mc:ze})),xe[ke]=!0}}),_e}function W(ce,_e,xe){var De=m.a.g.Ub(ce,ye,{}),Ae=De.hd;if(!_e){if(Ae)throw Error("You cannot apply bindings multiple times to the same element.");De.hd=!0}Ae||(De.context=xe),De.Zb||(De.Zb={});var ke;if(_e&&typeof _e!="function")ke=_e;else{var ze=m.ga.instance,tt=ze.getBindingAccessors||U,wt=m.$(function(){return(ke=_e?_e(xe,ce):tt.call(ze,ce,xe))&&(xe[J]&&xe[J](),xe[K]&&xe[K]()),ke},null,{l:ce});ke&&wt.ja()||(wt=null)}var _t=xe,Be;if(ke){var Yt=function(){return m.a.Ga(wt?wt():ke,I)},Et=wt?function(ut){return function(){return I(wt()[ut])}}:function(ut){return ke[ut]};Yt.get=function(ut){return ke[ut]&&I(Et(ut))},Yt.has=function(ut){return ut in ke},m.i.H in ke&&m.i.subscribe(ce,m.i.H,function(){var ut=(0,ke[m.i.H])();if(ut){var tn=m.h.childNodes(ce);tn.length&&ut(tn,m.Ec(tn[0]))}}),m.i.pa in ke&&(_t=m.i.Cb(ce,xe),m.i.subscribe(ce,m.i.pa,function(){var ut=(0,ke[m.i.pa])();ut&&m.h.firstChild(ce)&&ut(ce)})),De=k(ke),m.a.D(De,function(ut){var tn=ut.Mc.init,Ce=ut.Mc.update,Te=ut.key;if(ce.nodeType===8&&!m.h.ea[Te])throw Error("The binding '"+Te+"' cannot be used with virtual elements");try{typeof tn=="function"&&m.u.G(function(){var it=tn(ce,Et(Te),Yt,_t.$data,_t);if(it&&it.controlsDescendantBindings){if(Be!==e)throw Error("Multiple bindings ("+Be+" and "+Te+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Be=Te}}),typeof Ce=="function"&&m.$(function(){Ce(ce,Et(Te),Yt,_t.$data,_t)},null,{l:ce})}catch(it){throw it.message='Unable to process binding "'+Te+": "+ke[Te]+`" -Message: `+it.message,it}})}return De=Be===e,{shouldBindDescendants:De,bindingContextForDescendants:De&&_t}}function j(ce,_e){return ce&&ce instanceof m.fa?ce:new m.fa(ce,e,e,_e)}var J=m.a.Da("_subscribable"),q=m.a.Da("_ancestorBindingInfo"),K=m.a.Da("_dataDependency");m.c={};var Q={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(ce){return m.c[ce]};var de={};m.fa=function(ce,_e,xe,De,Ae){function ke(){var Et=_t?wt():wt,ut=m.a.f(Et);return _e?(m.a.extend(ze,_e),q in _e&&(ze[q]=_e[q])):(ze.$parents=[],ze.$root=ut,ze.ko=m),ze[J]=Be,tt?ut=ze.$data:(ze.$rawData=Et,ze.$data=ut),xe&&(ze[xe]=ut),De&&De(ze,_e,ut),_e&&_e[J]&&!m.S.o().Vb(_e[J])&&_e[J](),Yt&&(ze[K]=Yt),ze.$data}var ze=this,tt=ce===de,wt=tt?e:ce,_t=typeof wt=="function"&&!m.O(wt),Be,Yt=Ae&&Ae.dataDependency;Ae&&Ae.exportDependencies?ke():(Be=m.xb(ke),Be.v(),Be.ja()?Be.equalityComparer=null:ze[J]=e)},m.fa.prototype.createChildContext=function(ce,_e,xe,De){if(!De&&_e&&typeof _e=="object"&&(De=_e,_e=De.as,xe=De.extend),_e&&De&&De.noChildContext){var Ae=typeof ce=="function"&&!m.O(ce);return new m.fa(de,this,null,function(ke){xe&&xe(ke),ke[_e]=Ae?ce():ce},De)}return new m.fa(ce,this,_e,function(ke,ze){ke.$parentContext=ze,ke.$parent=ze.$data,ke.$parents=(ze.$parents||[]).slice(0),ke.$parents.unshift(ke.$parent),xe&&xe(ke)},De)},m.fa.prototype.extend=function(ce,_e){return new m.fa(de,this,null,function(xe){m.a.extend(xe,typeof ce=="function"?ce(xe):ce)},_e)};var ye=m.a.g.Z();S.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},S.prototype.sd=function(ce){m.a.Pa(this.kb,ce),!this.kb.length&&this.H&&this.Cc()},S.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ce,_e,xe,De,Ae){var ke=m.a.g.Ub(ce,ye,{});return ke.Fa||(ke.Fa=new m.T),Ae&&Ae.notifyImmediately&&ke.Zb[_e]&&m.u.G(xe,De,[ce]),ke.Fa.subscribe(xe,De,_e)},ma:function(ce,_e){var xe=m.a.g.get(ce,ye);if(xe&&(xe.Zb[_e]=!0,xe.Fa&&xe.Fa.notifySubscribers(ce,_e),_e==m.i.H)){if(xe.N)xe.N.Cc();else if(xe.N===e&&xe.Fa&&xe.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ce,_e){var xe=m.a.g.Ub(ce,ye,{});return xe.N||(xe.N=new S(ce,xe,_e[q])),_e[q]==xe?_e:_e.extend(function(De){De[q]=xe})}},m.Td=function(ce){return(ce=m.a.g.get(ce,ye))&&ce.context},m.ib=function(ce,_e,xe){return ce.nodeType===1&&m.h.Sc(ce),W(ce,_e,j(xe))},m.ld=function(ce,_e,xe){return xe=j(xe),m.ib(ce,B(_e,xe,ce),xe)},m.Oa=function(ce,_e){_e.nodeType!==1&&_e.nodeType!==8||V(j(ce),_e)},m.vc=function(ce,_e,xe){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(_e=n.body,!_e)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!_e||_e.nodeType!==1&&_e.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");G(j(ce,xe),_e)},m.Dc=function(ce){return!ce||ce.nodeType!==1&&ce.nodeType!==8?e:m.Td(ce)},m.Ec=function(ce){return(ce=m.Dc(ce))?ce.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)}(),function(_){function S(U,V){var G=Object.prototype.hasOwnProperty.call(L,U)?L[U]:_,k;G?G.subscribe(V):(G=L[U]=new m.T,G.subscribe(V),w(U,function(W,j){var J=!(!j||!j.synchronous);B[U]={definition:W,Gd:J},delete L[U],k||J?G.notifySubscribers(W):m.na.zb(function(){G.notifySubscribers(W)})}),k=!0)}function w(U,V){I("getConfig",[U],function(G){G?I("loadComponent",[U,G],function(k){V(k,G)}):V(null,null)})}function I(U,V,G,k){k||(k=m.j.loaders.slice(0));var W=k.shift();if(W){var j=W[U];if(j){var J=!1;if(j.apply(W,V.concat(function(q){J?G(null):q!==null?G(q):I(U,V,G,k)}))!==_&&(J=!0,!W.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(U,V,G,k)}else G(null)}var L={},B={};m.j={get:function(U,V){var G=Object.prototype.hasOwnProperty.call(B,U)?B[U]:_;G?G.Gd?m.u.G(function(){V(G.definition)}):m.na.zb(function(){V(G.definition)}):S(U,V)},Bc:function(U){delete B[U]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function _(G,k,W,j){function J(){--K===0&&j(q)}var q={},K=2,Q=W.template;W=W.viewModel,Q?L(k,Q,function(de){m.j.oc("loadTemplate",[G,de],function(ye){q.template=ye,J()})}):J(),W?L(k,W,function(de){m.j.oc("loadViewModel",[G,de],function(ye){q[V]=ye,J()})}):J()}function S(G,k,W){if(typeof k=="function")W(function(J){return new k(J)});else if(typeof k[V]=="function")W(k[V]);else if("instance"in k){var j=k.instance;W(function(){return j})}else"viewModel"in k?S(G,k.viewModel,W):G("Unknown viewModel value: "+k)}function w(G){switch(m.a.R(G)){case"script":return m.a.ua(G.text);case"textarea":return m.a.ua(G.value);case"template":if(I(G.content))return m.a.Ca(G.content.childNodes)}return m.a.Ca(G.childNodes)}function I(G){return t.DocumentFragment?G instanceof DocumentFragment:G&&G.nodeType===11}function L(G,k,W){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(j){j&&typeof j=="object"&&j.Xd&&j.default&&(j=j.default),W(j)}):G("Uses require, but no AMD loader is present"):W(k)}function B(G){return function(k){throw Error("Component '"+G+"': "+k)}}var U={};m.j.register=function(G,k){if(!k)throw Error("Invalid configuration for "+G);if(m.j.tb(G))throw Error("Component "+G+" is already registered");U[G]=k},m.j.tb=function(G){return Object.prototype.hasOwnProperty.call(U,G)},m.j.unregister=function(G){delete U[G],m.j.Bc(G)},m.j.Fc={getConfig:function(G,k){k(m.j.tb(G)?U[G]:null)},loadComponent:function(G,k,W){var j=B(G);L(j,k,function(J){_(G,j,J,W)})},loadTemplate:function(G,k,W){if(G=B(G),typeof k=="string")W(m.a.ua(k));else if(k instanceof Array)W(k);else if(I(k))W(m.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)W(w(k));else if(typeof k=="string"){var j=n.getElementById(k);j?W(w(j)):G("Cannot find element with ID "+k)}else G("Unknown element type: "+k);else G("Unknown template value: "+k)},loadViewModel:function(G,k,W){S(B(G),k,W)}};var V="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=U}(),function(){function _(w,I){var L=w.getAttribute("params");if(L){var L=S.parseBindingsString(L,I,w,{valueAccessors:!0,bindingParams:!0}),L=m.a.Ga(L,function(V){return m.o(V,null,{l:w})}),B=m.a.Ga(L,function(V){var G=V.v();return V.ja()?m.o({read:function(){return m.a.f(V())},write:m.Za(G)&&function(k){V()(k)},l:w}):G});return Object.prototype.hasOwnProperty.call(B,"$raw")||(B.$raw=L),B}return{$raw:{}}}m.j.getComponentNameForNode=function(w){var I=m.a.R(w);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=m.a.W&&w.tagName===I))return I},m.j.tc=function(w,I,L,B){if(I.nodeType===1){var U=m.j.getComponentNameForNode(I);if(U){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:U,params:_(I,L)};w.component=B?function(){return V}:V}}return w};var S=new m.ga;9>m.a.W&&(m.j.register=function(w){return function(I){return w.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(w){return function(){var I=w(),L=m.j.dd,B;for(B in L);return I}}(n.createDocumentFragment))}(),function(){function _(I,L,B){if(L=L.template,!L)throw Error("Component '"+I+"' has no template");I=m.a.Ca(L),m.h.va(B,I)}function S(I,L,B){var U=I.createViewModel;return U?U.call(I,L,B):L}var w=0;m.c.component={init:function(I,L,B,U,V){function G(){var q=k&&k.dispose;typeof q=="function"&&q.call(k),j&&j.s(),W=k=j=null}var k,W,j,J=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,G),m.o(function(){var q=m.a.f(L()),K,Q;if(typeof q=="string"?K=q:(K=m.a.f(q.name),Q=m.a.f(q.params)),!K)throw Error("No component name specified");var de=m.i.Cb(I,V),ye=W=++w;m.j.get(K,function(ce){if(W===ye){if(G(),!ce)throw Error("Unknown component '"+K+"'");_(K,ce,I);var _e=S(ce,Q,{element:I,templateNodes:J});ce=de.createChildContext(_e,{extend:function(xe){xe.$component=_e,xe.$componentTemplateNodes=J}}),_e&&_e.koDescendantsComplete&&(j=m.i.subscribe(I,m.i.pa,_e.koDescendantsComplete,_e)),k=_e,m.Oa(ce,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var M={class:"className",for:"htmlFor"};m.c.attr={update:function(_,S){var w=m.a.f(S())||{};m.a.P(w,function(I,L){L=m.a.f(L);var B=I.indexOf(":"),B="lookupNamespaceURI"in _&&0<B&&_.lookupNamespaceURI(I.substr(0,B)),U=L===!1||L===null||L===e;U?B?_.removeAttributeNS(B,I):_.removeAttribute(I):L=L.toString(),8>=m.a.W&&I in M?(I=M[I],U?_.removeAttribute(I):_[I]=L):U||(B?_.setAttributeNS(B,I,L):_.setAttribute(I,L)),I==="name"&&m.a.Yc(_,U?"":L)})}},function(){m.c.checked={after:["value","attr"],init:function(_,S,w){function I(){var q=_.checked,K=B();if(!m.S.Ya()&&(q||!V&&!m.S.qa())){var Q=m.u.G(S);if(k){var de=W?Q.v():Q,ye=J;J=K,ye!==K?q&&(m.a.Na(de,K,!0),m.a.Na(de,ye,!1)):m.a.Na(de,K,q),W&&m.Za(Q)&&Q(de)}else U&&(K===e?K=q:q||(K=e)),m.m.eb(Q,w,"checked",K,!0)}}function L(){var q=m.a.f(S()),K=B();k?(_.checked=0<=m.a.A(q,K),J=K):_.checked=U&&K===e?!!q:B()===q}var B=m.xb(function(){if(w.has("checkedValue"))return m.a.f(w.get("checkedValue"));if(j)return w.has("value")?m.a.f(w.get("value")):_.value}),U=_.type=="checkbox",V=_.type=="radio";if(U||V){var G=S(),k=U&&m.a.f(G)instanceof Array,W=!(k&&G.push&&G.splice),j=V||k,J=k?B():e;V&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(I,null,{l:_}),m.a.B(_,"click",I),m.o(L,null,{l:_}),G=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,S){_.value=m.a.f(S())}}}(),m.c.class={update:function(_,S){var w=m.a.Db(m.a.f(S()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,m.a.Eb(_,w,!0)}},m.c.css={update:function(_,S){var w=m.a.f(S());w!==null&&typeof w=="object"?m.a.P(w,function(I,L){L=m.a.f(L),m.a.Eb(_,I,L)}):m.c.class.update(_,S)}},m.c.enable={update:function(_,S){var w=m.a.f(S());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,S){m.c.enable.update(_,function(){return!m.a.f(S())})}},m.c.event={init:function(_,S,w,I,L){var B=S()||{};m.a.P(B,function(U){typeof U=="string"&&m.a.B(_,U,function(V){var G,k=S()[U];if(k){try{var W=m.a.la(arguments);I=L.$data,W.unshift(I),G=k.apply(I,W)}finally{G!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}w.get(U+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var S=_(),w=m.a.bc(S);return!w||typeof w.length=="number"?{foreach:S,templateEngine:m.ba.Ma}:(m.a.f(S),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:m.ba.Ma})}},init:function(_,S){return m.c.template.init(_,m.c.foreach.Rc(S))},update:function(_,S,w,I,L){return m.c.template.update(_,m.c.foreach.Rc(S),w,I,L)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,S,w){function I(U){_.__ko_hasfocusUpdating=!0;var V=_.ownerDocument;if("activeElement"in V){var G;try{G=V.activeElement}catch{G=V.body}U=G===_}V=S(),m.m.eb(V,w,"hasfocus",U,!0),_.__ko_hasfocusLastValue=U,_.__ko_hasfocusUpdating=!1}var L=I.bind(null,!0),B=I.bind(null,!1);m.a.B(_,"focus",L),m.a.B(_,"focusin",L),m.a.B(_,"blur",B),m.a.B(_,"focusout",B),_.__ko_hasfocusLastValue=!1},update:function(_,S){var w=!!m.a.f(S());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,w?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,S){m.a.fc(_,S())}},function(){function _(S,w,I){m.c[S]={init:function(L,B,U,V,G){var k,W,j={},J,q,K;if(w){V=U.get("as");var Q=U.get("noChildContext");K=!(V&&Q),j={as:V,noChildContext:Q,exportDependencies:K}}return q=(J=U.get("completeOn")=="render")||U.has(m.i.pa),m.o(function(){var de=m.a.f(B()),ye=!I!=!de,ce=!W,_e;(K||ye!==k)&&(q&&(G=m.i.Cb(L,G)),ye&&((!w||K)&&(j.dataDependency=m.S.o()),_e=w?G.createChildContext(typeof de=="function"?de:B,j):m.S.qa()?G.extend(null,j):G),ce&&m.S.qa()&&(W=m.a.Ca(m.h.childNodes(L),!0)),ye?(ce||m.h.va(L,m.a.Ca(W)),m.Oa(_e,L)):(m.h.Ea(L),J||m.i.ma(L,m.i.H)),k=ye)},null,{l:L}),{controlsDescendantBindings:!0}}},m.m.Ra[S]=!1,m.h.ea[S]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),m.c.let={init:function(_,S,w,I,L){return S=L.extend(S),m.Oa(S,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var N={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,S,w){function I(){return m.a.jb(_.options,function(Q){return Q.selected})}function L(Q,de,ye){var ce=typeof de;return ce=="function"?de(Q):ce=="string"?Q[de]:ye}function B(Q,de){if(q&&k)m.i.ma(_,m.i.H);else if(J.length){var ye=0<=m.a.A(J,m.w.M(de[0]));m.a.Zc(de[0],ye),q&&!ye&&m.u.G(m.a.Fb,null,[_,"change"])}}var U=_.multiple,V=_.length!=0&&U?_.scrollTop:null,G=m.a.f(S()),k=w.get("valueAllowUnset")&&w.has("value"),W=w.get("optionsIncludeDestroyed");S={};var j,J=[];k||(U?J=m.a.Mb(I(),m.w.M):0<=_.selectedIndex&&J.push(m.w.M(_.options[_.selectedIndex]))),G&&(typeof G.length>"u"&&(G=[G]),j=m.a.jb(G,function(Q){return W||Q===e||Q===null||!m.a.f(Q._destroy)}),w.has("optionsCaption")&&(G=m.a.f(w.get("optionsCaption")),G!==null&&G!==e&&j.unshift(N)));var q=!1;if(S.beforeRemove=function(Q){_.removeChild(Q)},G=B,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(G=function(Q,de){B(0,de),m.u.G(w.get("optionsAfterRender"),null,[de[0],Q!==N?Q:e])}),m.a.ec(_,j,function(Q,de,ye){return ye.length&&(J=!k&&ye[0].selected?[m.w.M(ye[0])]:[],q=!0),de=_.ownerDocument.createElement("option"),Q===N?(m.a.Bb(de,w.get("optionsCaption")),m.w.cb(de,e)):(ye=L(Q,w.get("optionsValue"),Q),m.w.cb(de,m.a.f(ye)),Q=L(Q,w.get("optionsText"),ye),m.a.Bb(de,Q)),[de]},S,G),!k){var K;U?K=J.length&&I().length<J.length:K=J.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==J[0]:J.length||0<=_.selectedIndex,K&&m.u.G(m.a.Fb,null,[_,"change"])}(k||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),V&&20<Math.abs(V-_.scrollTop)&&(_.scrollTop=V)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,S,w){function I(){var U=S(),V=[];m.a.D(_.getElementsByTagName("option"),function(G){G.selected&&V.push(m.w.M(G))}),m.m.eb(U,w,"selectedOptions",V)}function L(){var U=m.a.f(S()),V=_.scrollTop;U&&typeof U.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(G){var k=0<=m.a.A(U,m.w.M(G));G.selected!=k&&m.a.Zc(G,k)}),_.scrollTop=V}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var B;m.i.subscribe(_,m.i.H,function(){B?I():(m.a.B(_,"change",I),B=m.o(L,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,S){var w=m.a.f(S()||{});m.a.P(w,function(I,L){if(L=m.a.f(L),(L===null||L===e||L===!1)&&(L=""),o)o(_).css(I,L);else if(/^--/.test(I))_.style.setProperty(I,L);else{I=I.replace(/-(\w)/g,function(U,V){return V.toUpperCase()});var B=_.style[I];_.style[I]=L,L===B||_.style[I]!=B||isNaN(L)||(_.style[I]=L+"px")}})}},m.c.submit={init:function(_,S,w,I,L){if(typeof S()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(B){var U,V=S();try{U=V.call(L.$data,_)}finally{U!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,S){m.a.Bb(_,S())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(j){if(j)return parseFloat(j[1])},S=t.navigator.userAgent,w,I,L,B,U;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(U=_(S.match(/Edge\/([^ ]+)$/)))||_(S.match(/Chrome\/([^ ]+)/))||(I=_(S.match(/Version\/([^ ]+) Safari/)))||(L=_(S.match(/Firefox\/([^ ]+)/)))||(B=m.a.W||_(S.match(/MSIE ([^ ]+)/)))||(B=_(S.match(/rv:([^ )]+)/)))}if(8<=B&&10>B)var V=m.a.g.Z(),G=m.a.g.Z(),k=function(j){var J=this.activeElement;(J=J&&m.a.g.get(J,G))&&J(j)},W=function(j,J){var q=j.ownerDocument;m.a.g.get(q,V)||(m.a.g.set(q,V,!0),m.a.B(q,"selectionchange",k)),m.a.g.set(j,G,J)};m.c.textInput={init:function(j,J,q){function K(ke,ze){m.a.B(j,ke,ze)}function Q(){var ke=m.a.f(J());(ke===null||ke===e)&&(ke=""),xe!==e&&ke===xe?m.a.setTimeout(Q,4):j.value!==ke&&(Ae=!0,j.value=ke,Ae=!1,ce=j.value)}function de(){_e||(xe=j.value,_e=m.a.setTimeout(ye,4))}function ye(){clearTimeout(_e),xe=_e=e;var ke=j.value;ce!==ke&&(ce=ke,m.m.eb(J(),q,"textInput",ke))}var ce=j.value,_e,xe,De=m.a.W==9?de:ye,Ae=!1;B&&K("keypress",ye),11>B&&K("propertychange",function(ke){Ae||ke.propertyName!=="value"||De(ke)}),B==8&&(K("keyup",ye),K("keydown",ye)),W&&(W(j,De),K("dragend",de)),(!B||9<=B)&&K("input",De),5>I&&m.a.R(j)==="textarea"?(K("keydown",de),K("paste",de),K("cut",de)):11>w?K("keydown",de):4>L?(K("DOMAutoComplete",ye),K("dragdrop",ye),K("drop",ye)):U&&j.type==="number"&&K("keydown",de),K("change",ye),K("blur",ye),m.o(Q,null,{l:j})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(j,J,q){q("textInput",j)}}}(),m.c.uniqueName={init:function(_,S){if(S()){var w="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,w)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,S,w,I,L){var B;return w.has("as")&&(B={as:w.get("as"),noChildContext:w.get("noChildContext")}),S=L.createChildContext(S,B),m.Oa(S,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,S,w){var I=m.a.R(_),L=I=="input";if(!L||_.type!="checkbox"&&_.type!="radio"){var B=[],U=w.get("valueUpdate"),V=!1,G=null;U&&(typeof U=="string"?B=[U]:B=m.a.wc(U),m.a.Pa(B,"change"));var k=function(){G=null,V=!1;var J=S(),q=m.w.M(_);m.m.eb(J,w,"value",q)};!m.a.W||!L||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(B,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){V=!0}),m.a.B(_,"focus",function(){V=!1}),m.a.B(_,"blur",function(){V&&k()})),m.a.D(B,function(J){var q=k;m.a.Ud(J,"after")&&(q=function(){G=m.w.M(_),m.a.setTimeout(k,0)},J=J.substring(5)),m.a.B(_,J,q)});var W;if(W=L&&_.type=="file"?function(){var J=m.a.f(S());J===null||J===e||J===""?_.value="":m.u.G(k)}:function(){var J=m.a.f(S()),q=m.w.M(_);G!==null&&J===G?m.a.setTimeout(W,0):(J!==q||q===e)&&(I==="select"?(q=w.get("valueAllowUnset"),m.w.cb(_,J,q),q||J===m.w.M(_)||m.u.G(k)):m.w.cb(_,J))},I==="select"){var j;m.i.subscribe(_,m.i.H,function(){j?w.get("valueAllowUnset")?W():k():(m.a.B(_,"change",k),j=m.o(W,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",k),m.o(W,null,{l:_})}else m.ib(_,{checkedValue:S})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,S){var w=m.a.f(S()),I=_.style.display!="none";w&&!I?_.style.display="":!w&&I&&(_.style.display="none")}},m.c.hidden={update:function(_,S){m.c.visible.update(_,function(){return!m.a.f(S())})}},function(_){m.c[_]={init:function(S,w,I,L,B){return m.c.event.init.call(this,S,function(){var U={};return U[_]=w(),U},I,L,B)}}}("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,S){if(typeof _=="string"){S=S||n;var w=S.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new m.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,S,w,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,S,w,I)},m.ca.prototype.isTemplateRewritten=function(_,S){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,S).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,S,w){_=this.makeTemplateSource(_,w),S=S(_.text()),_.text(S),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function _(I,L,B,U){I=m.m.ac(I);for(var V=m.m.Ra,G=0;G<I.length;G++){var k=I[G].key;if(Object.prototype.hasOwnProperty.call(V,k)){var W=V[k];if(typeof W=="function"){if(k=W(I[G].value))throw Error(k)}else if(!W)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return B="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+B.toLowerCase()+"')",U.createJavaScriptEvaluatorBlock(B)+L}var S=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,L,B){L.isTemplateRewritten(I,B)||L.rewriteTemplate(I,function(U){return m.kc.Ld(U,L)},B)},Ld:function(I,L){return I.replace(S,function(B,U,V,G,k){return _(k,U,V,L)}).replace(w,function(B,U){return _(U,"<!-- ko -->","#comment",L)})},md:function(I,L){return m.aa.Xb(function(B,U){var V=B.nextSibling;V&&V.nodeName.toLowerCase()===L&&m.ib(V,I,U)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(w){if(this.F=w){var I=m.a.R(w);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&w.content&&w.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var I=arguments[0];w==="innerHTML"?m.a.fc(this.F,I):this.F[w]=I};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(w){if(arguments.length===1)return m.a.g.get(this.F,_+w);m.a.g.set(this.F,_+w,arguments[1])};var S=m.a.g.Z();m.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var I=m.a.g.get(w,S)||{},L=I.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!L||I.jd){var B=this.text();B&&B!==I.bb&&(L=m.a.Md(B,w.ownerDocument),m.a.g.set(w,S,{lb:L,bb:B,jd:!0}))}return L}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(w,S,{lb:I})},m.C.ia=function(w){this.F=w},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var w=m.a.g.get(this.F,S)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}m.a.g.set(this.F,S,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function _(G,k,W){var j;for(k=m.h.nextSibling(k);G&&(j=G)!==k;)G=m.h.nextSibling(j),W(j,G)}function S(G,k){if(G.length){var W=G[0],j=G[G.length-1],J=W.parentNode,q=m.ga.instance,K=q.preprocessNode;if(K){if(_(W,j,function(Q,de){var ye=Q.previousSibling,ce=K.call(q,Q);ce&&(Q===W&&(W=ce[0]||de),Q===j&&(j=ce[ce.length-1]||ye))}),G.length=0,!W)return;W===j?G.push(W):(G.push(W,j),m.a.Ua(G,J))}_(W,j,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.vc(k,Q)}),_(W,j,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.aa.cd(Q,[k])}),m.a.Ua(G,J)}}function w(G){return G.nodeType?G:0<G.length?G[0]:null}function I(G,k,W,j,J){J=J||{};var q=(G&&w(G)||W||{}).ownerDocument,K=J.templateEngine||B;if(m.kc.xd(W,K,q),W=K.renderTemplate(W,j,J,q),typeof W.length!="number"||0<W.length&&typeof W[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(q=!1,k){case"replaceChildren":m.h.va(G,W),q=!0;break;case"replaceNode":m.a.Xc(G,W),q=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return q&&(S(W,j),J.afterRender&&m.u.G(J.afterRender,null,[W,j[J.as||"$data"]]),k=="replaceChildren"&&m.i.ma(G,m.i.H)),W}function L(G,k,W){return m.O(G)?G():typeof G=="function"?G(k,W):G}var B;m.gc=function(G){if(G!=e&&!(G instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");B=G},m.dc=function(G,k,W,j,J){if(W=W||{},(W.templateEngine||B)==e)throw Error("Set a template engine before calling renderTemplate");if(J=J||"replaceChildren",j){var q=w(j);return m.$(function(){var Q=k&&k instanceof m.fa?k:new m.fa(k,null,null,null,{exportDependencies:!0}),K=L(G,Q.$data,Q),Q=I(j,J,K,Q,W);J=="replaceNode"&&(j=Q,q=w(j))},null,{Sa:function(){return!q||!m.a.Sb(q)},l:q&&J=="replaceNode"?q.parentNode:q})}return m.aa.Xb(function(K){m.dc(G,k,W,K,"replaceNode")})},m.Qd=function(G,k,W,j,J){function q(xe,De){m.u.G(m.a.ec,null,[j,xe,Q,W,K,De]),m.i.ma(j,m.i.H)}function K(xe,De){S(De,de),W.afterRender&&W.afterRender(De,xe),de=null}function Q(xe,De){de=J.createChildContext(xe,{as:ye,noChildContext:W.noChildContext,extend:function(ke){ke.$index=De,ye&&(ke[ye+"Index"]=De)}});var Ae=L(G,xe,de);return I(j,"ignoreTargetNode",Ae,de,W)}var de,ye=W.as,ce=W.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!W.includeDestroyed;if(ce||W.beforeRemove||!m.Pc(k))return m.$(function(){var xe=m.a.f(k)||[];typeof xe.length>"u"&&(xe=[xe]),ce&&(xe=m.a.jb(xe,function(De){return De===e||De===null||!m.a.f(De._destroy)})),q(xe)},null,{l:j});q(k.v());var _e=k.subscribe(function(xe){q(k(),xe)},null,"arrayChange");return _e.l(j),_e};var U=m.a.g.Z(),V=m.a.g.Z();m.c.template={init:function(G,k){var W=m.a.f(k());if(typeof W=="string"||"name"in W)m.h.Ea(G);else if("nodes"in W){if(W=W.nodes||[],m.O(W))throw Error('The "nodes" option must be a plain, non-observable array.');var j=W[0]&&W[0].parentNode;j&&m.a.g.get(j,V)||(j=m.a.Yb(W),m.a.g.set(j,V,!0)),new m.C.ia(G).nodes(j)}else if(W=m.h.childNodes(G),0<W.length)j=m.a.Yb(W),new m.C.ia(G).nodes(j);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(G,k,W,j,J){var q=k();k=m.a.f(q),W=!0,j=null,typeof k=="string"?k={}:(q="name"in k?k.name:G,"if"in k&&(W=m.a.f(k.if)),W&&"ifnot"in k&&(W=!m.a.f(k.ifnot)),W&&!q&&(W=!1)),"foreach"in k?j=m.Qd(q,W&&k.foreach||[],k,G,J):W?(W=J,"data"in k&&(W=J.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),j=m.dc(q,W,k,G)):m.h.Ea(G),J=j,(k=m.a.g.get(G,U))&&typeof k.s=="function"&&k.s(),m.a.g.set(G,U,!J||J.ja&&!J.ja()?e:J)}},m.m.Ra.template=function(G){return G=m.m.ac(G),G.length==1&&G[0].unknown||m.m.Id(G,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0}(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,S,w){if(_.length&&S.length){var I,L,B,U,V;for(I=L=0;(!w||I<w)&&(U=_[L]);++L){for(B=0;V=S[B];++B)if(U.value===V.value){U.moved=V.index,V.moved=U.index,S.splice(B,1),I=B=0;break}I+=B}}},m.a.Pb=function(){function _(S,w,I,L,B){var U=Math.min,V=Math.max,G=[],k,W=S.length,j,J=w.length,q=J-W||1,K=W+J+1,Q,de,ye;for(k=0;k<=W;k++)for(de=Q,G.push(Q=[]),ye=U(J,k+q),j=V(0,k-1);j<=ye;j++)Q[j]=j?k?S[k-1]===w[j-1]?de[j-1]:U(de[j]||K,Q[j-1]||K)+1:j+1:k+1;for(U=[],V=[],q=[],k=W,j=J;k||j;)J=G[k][j]-1,j&&J===G[k][j-1]?V.push(U[U.length]={status:I,value:w[--j],index:j}):k&&J===G[k-1][j]?q.push(U[U.length]={status:L,value:S[--k],index:k}):(--j,--k,B.sparse||U.push({status:"retained",value:w[j]}));return m.a.Kc(q,V,!B.dontLimitMoves&&10*W),U.reverse()}return function(S,w,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},S=S||[],w=w||[],S.length<w.length?_(S,w,"added","deleted",I):_(w,S,"deleted","added",I)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function _(I,L,B,U,V){var G=[],k=m.$(function(){var W=L(B,V,m.a.Ua(G,I))||[];0<G.length&&(m.a.Xc(G,W),U&&m.u.G(U,null,[B,W,V])),G.length=0,m.a.Nb(G,W)},null,{l:I,Sa:function(){return!m.a.kd(G)}});return{Y:G,$:k.ja()?k:e}}var S=m.a.g.Z(),w=m.a.g.Z();m.a.ec=function(I,L,B,U,V,G){function k(ut){Ae={Aa:ut,pb:m.ta(de++)},K.push(Ae),q||De.push(Ae)}function W(ut){Ae=J[ut],de!==Ae.pb.v()&&xe.push(Ae),Ae.pb(de++),m.a.Ua(Ae.Y,I),K.push(Ae)}function j(ut,tn){if(ut)for(var Ce=0,Te=tn.length;Ce<Te;Ce++)m.a.D(tn[Ce].Y,function(it){ut(it,Ce,tn[Ce].Aa)})}L=L||[],typeof L.length>"u"&&(L=[L]),U=U||{};var J=m.a.g.get(I,S),q=!J,K=[],Q=0,de=0,ye=[],ce=[],_e=[],xe=[],De=[],Ae,ke=0;if(q)m.a.D(L,k);else{if(!G||J&&J._countWaitingForRemove){var ze=m.a.Mb(J,function(ut){return ut.Aa});G=m.a.Pb(ze,L,{dontLimitMoves:U.dontLimitMoves,sparse:!0})}for(var ze=0,tt,wt,_t;tt=G[ze];ze++)switch(wt=tt.moved,_t=tt.index,tt.status){case"deleted":for(;Q<_t;)W(Q++);wt===e&&(Ae=J[Q],Ae.$&&(Ae.$.s(),Ae.$=e),m.a.Ua(Ae.Y,I).length&&(U.beforeRemove&&(K.push(Ae),ke++,Ae.Aa===w?Ae=null:_e.push(Ae)),Ae&&ye.push.apply(ye,Ae.Y))),Q++;break;case"added":for(;de<_t;)W(Q++);wt!==e?(ce.push(K.length),W(wt)):k(tt.value)}for(;de<L.length;)W(Q++);K._countWaitingForRemove=ke}m.a.g.set(I,S,K),j(U.beforeMove,xe),m.a.D(ye,U.beforeRemove?m.oa:m.removeNode);var Be,Yt,Et;try{Et=I.ownerDocument.activeElement}catch{}if(ce.length)for(;(ze=ce.shift())!=e;){for(Ae=K[ze],Be=e;ze;)if((Yt=K[--ze].Y)&&Yt.length){Be=Yt[Yt.length-1];break}for(L=0;Q=Ae.Y[L];Be=Q,L++)m.h.Wb(I,Q,Be)}for(ze=0;Ae=K[ze];ze++){for(Ae.Y||m.a.extend(Ae,_(I,B,Ae.Aa,V,Ae.pb)),L=0;Q=Ae.Y[L];Be=Q,L++)m.h.Wb(I,Q,Be);!Ae.Ed&&V&&(V(Ae.Aa,Ae.Y,Ae.pb),Ae.Ed=!0,Be=Ae.Y[Ae.Y.length-1])}for(Et&&I.ownerDocument.activeElement!=Et&&Et.focus(),j(U.beforeRemove,_e),ze=0;ze<_e.length;++ze)_e[ze].Aa=w;j(U.afterMove,xe),j(U.afterAdd,De)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,S,w,I){return(S=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(S.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var S=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(w,I,L,B){if(B=B||n,L=L||{},2>S)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var U=w.data("precompiled");return U||(U=w.text()||"",U=o.template(null,"{{ko_with $item.koBindingContext}}"+U+"{{/ko_with}}"),w.data("precompiled",U)),w=[I.$data],I=o.extend({koBindingContext:I},L.templateOptions),I=o.tmpl(U,w,I),I.appendTo(B.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,I){n.write("<script type='text/html' id='"+w+"'>"+I+"</script>")},0<S&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var MSt=ko;typeof window<"u"?(ko=window.ko,typeof uk<"u"?window.ko=uk:delete window.ko):(ko=global.ko,typeof uk<"u"?global.ko=uk:delete global.ko);var MC=MSt;/** +Message: `+k.message,k}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function _(ce){var ge=(ce=m.a.g.get(ce,xe))&&ce.N;ge&&(ce.N=null,ge.Tc())}function S(ce,ge,be){this.node=ce,this.yc=ge,this.kb=[],this.H=!1,ge.N||m.a.K.za(ce,_),be&&be.N&&(be.N.kb.push(ce),this.Kb=be)}function w(ce){return function(){return ce}}function I(ce){return ce()}function L(ce){return m.a.Ga(m.u.G(ce),function(ge,be){return function(){return ce()[be]}})}function B(ce,ge,be){return typeof ce=="function"?L(ce.bind(null,ge,be)):m.a.Ga(ce,w)}function U(ce,ge){return L(this.getBindings.bind(this,ce,ge))}function V(ce,ge){var be=m.h.firstChild(ge);if(be){var De,Ae=m.ga.instance,ke=Ae.preprocessNode;if(ke){for(;De=be;)be=m.h.nextSibling(De),ke.call(Ae,De);be=m.h.firstChild(ge)}for(;De=be;)be=m.h.nextSibling(De),G(ce,De)}m.i.ma(ge,m.i.H)}function G(ce,ge){var be=ce,De=ge.nodeType===1;De&&m.h.Sc(ge),(De||m.ga.instance.nodeHasBindings(ge))&&(be=W(ge,null,ce).bindingContextForDescendants),be&&!Q[m.a.R(ge)]&&V(be,ge)}function k(ce){var ge=[],be={},De=[];return m.a.P(ce,function Ae(ke){if(!be[ke]){var ze=m.getBindingHandler(ke);ze&&(ze.after&&(De.push(ke),m.a.D(ze.after,function(tt){if(ce[tt]){if(m.a.A(De,tt)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+De.join(", "));Ae(tt)}}),De.length--),ge.push({key:ke,Mc:ze})),be[ke]=!0}}),ge}function W(ce,ge,be){var De=m.a.g.Ub(ce,xe,{}),Ae=De.hd;if(!ge){if(Ae)throw Error("You cannot apply bindings multiple times to the same element.");De.hd=!0}Ae||(De.context=be),De.Zb||(De.Zb={});var ke;if(ge&&typeof ge!="function")ke=ge;else{var ze=m.ga.instance,tt=ze.getBindingAccessors||U,vt=m.$(function(){return(ke=ge?ge(be,ce):tt.call(ze,ce,be))&&(be[J]&&be[J](),be[K]&&be[K]()),ke},null,{l:ce});ke&&vt.ja()||(vt=null)}var pt=be,Be;if(ke){var qt=function(){return m.a.Ga(vt?vt():ke,I)},At=vt?function(lt){return function(){return I(vt()[lt])}}:function(lt){return ke[lt]};qt.get=function(lt){return ke[lt]&&I(At(lt))},qt.has=function(lt){return lt in ke},m.i.H in ke&&m.i.subscribe(ce,m.i.H,function(){var lt=(0,ke[m.i.H])();if(lt){var jn=m.h.childNodes(ce);jn.length&<(jn,m.Ec(jn[0]))}}),m.i.pa in ke&&(pt=m.i.Cb(ce,be),m.i.subscribe(ce,m.i.pa,function(){var lt=(0,ke[m.i.pa])();lt&&m.h.firstChild(ce)&<(ce)})),De=k(ke),m.a.D(De,function(lt){var jn=lt.Mc.init,sn=lt.Mc.update,me=lt.key;if(ce.nodeType===8&&!m.h.ea[me])throw Error("The binding '"+me+"' cannot be used with virtual elements");try{typeof jn=="function"&&m.u.G(function(){var Ce=jn(ce,At(me),qt,pt.$data,pt);if(Ce&&Ce.controlsDescendantBindings){if(Be!==e)throw Error("Multiple bindings ("+Be+" and "+me+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Be=me}}),typeof sn=="function"&&m.$(function(){sn(ce,At(me),qt,pt.$data,pt)},null,{l:ce})}catch(Ce){throw Ce.message='Unable to process binding "'+me+": "+ke[me]+`" +Message: `+Ce.message,Ce}})}return De=Be===e,{shouldBindDescendants:De,bindingContextForDescendants:De&&pt}}function q(ce,ge){return ce&&ce instanceof m.fa?ce:new m.fa(ce,e,e,ge)}var J=m.a.Da("_subscribable"),j=m.a.Da("_ancestorBindingInfo"),K=m.a.Da("_dataDependency");m.c={};var Q={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(ce){return m.c[ce]};var de={};m.fa=function(ce,ge,be,De,Ae){function ke(){var At=pt?vt():vt,lt=m.a.f(At);return ge?(m.a.extend(ze,ge),j in ge&&(ze[j]=ge[j])):(ze.$parents=[],ze.$root=lt,ze.ko=m),ze[J]=Be,tt?lt=ze.$data:(ze.$rawData=At,ze.$data=lt),be&&(ze[be]=lt),De&&De(ze,ge,lt),ge&&ge[J]&&!m.S.o().Vb(ge[J])&&ge[J](),qt&&(ze[K]=qt),ze.$data}var ze=this,tt=ce===de,vt=tt?e:ce,pt=typeof vt=="function"&&!m.O(vt),Be,qt=Ae&&Ae.dataDependency;Ae&&Ae.exportDependencies?ke():(Be=m.xb(ke),Be.v(),Be.ja()?Be.equalityComparer=null:ze[J]=e)},m.fa.prototype.createChildContext=function(ce,ge,be,De){if(!De&&ge&&typeof ge=="object"&&(De=ge,ge=De.as,be=De.extend),ge&&De&&De.noChildContext){var Ae=typeof ce=="function"&&!m.O(ce);return new m.fa(de,this,null,function(ke){be&&be(ke),ke[ge]=Ae?ce():ce},De)}return new m.fa(ce,this,ge,function(ke,ze){ke.$parentContext=ze,ke.$parent=ze.$data,ke.$parents=(ze.$parents||[]).slice(0),ke.$parents.unshift(ke.$parent),be&&be(ke)},De)},m.fa.prototype.extend=function(ce,ge){return new m.fa(de,this,null,function(be){m.a.extend(be,typeof ce=="function"?ce(be):ce)},ge)};var xe=m.a.g.Z();S.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},S.prototype.sd=function(ce){m.a.Pa(this.kb,ce),!this.kb.length&&this.H&&this.Cc()},S.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ce,ge,be,De,Ae){var ke=m.a.g.Ub(ce,xe,{});return ke.Fa||(ke.Fa=new m.T),Ae&&Ae.notifyImmediately&&ke.Zb[ge]&&m.u.G(be,De,[ce]),ke.Fa.subscribe(be,De,ge)},ma:function(ce,ge){var be=m.a.g.get(ce,xe);if(be&&(be.Zb[ge]=!0,be.Fa&&be.Fa.notifySubscribers(ce,ge),ge==m.i.H)){if(be.N)be.N.Cc();else if(be.N===e&&be.Fa&&be.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ce,ge){var be=m.a.g.Ub(ce,xe,{});return be.N||(be.N=new S(ce,be,ge[j])),ge[j]==be?ge:ge.extend(function(De){De[j]=be})}},m.Td=function(ce){return(ce=m.a.g.get(ce,xe))&&ce.context},m.ib=function(ce,ge,be){return ce.nodeType===1&&m.h.Sc(ce),W(ce,ge,q(be))},m.ld=function(ce,ge,be){return be=q(be),m.ib(ce,B(ge,be,ce),be)},m.Oa=function(ce,ge){ge.nodeType!==1&&ge.nodeType!==8||V(q(ce),ge)},m.vc=function(ce,ge,be){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ge=n.body,!ge)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ge||ge.nodeType!==1&&ge.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");G(q(ce,be),ge)},m.Dc=function(ce){return!ce||ce.nodeType!==1&&ce.nodeType!==8?e:m.Td(ce)},m.Ec=function(ce){return(ce=m.Dc(ce))?ce.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)}(),function(_){function S(U,V){var G=Object.prototype.hasOwnProperty.call(L,U)?L[U]:_,k;G?G.subscribe(V):(G=L[U]=new m.T,G.subscribe(V),w(U,function(W,q){var J=!(!q||!q.synchronous);B[U]={definition:W,Gd:J},delete L[U],k||J?G.notifySubscribers(W):m.na.zb(function(){G.notifySubscribers(W)})}),k=!0)}function w(U,V){I("getConfig",[U],function(G){G?I("loadComponent",[U,G],function(k){V(k,G)}):V(null,null)})}function I(U,V,G,k){k||(k=m.j.loaders.slice(0));var W=k.shift();if(W){var q=W[U];if(q){var J=!1;if(q.apply(W,V.concat(function(j){J?G(null):j!==null?G(j):I(U,V,G,k)}))!==_&&(J=!0,!W.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(U,V,G,k)}else G(null)}var L={},B={};m.j={get:function(U,V){var G=Object.prototype.hasOwnProperty.call(B,U)?B[U]:_;G?G.Gd?m.u.G(function(){V(G.definition)}):m.na.zb(function(){V(G.definition)}):S(U,V)},Bc:function(U){delete B[U]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function _(G,k,W,q){function J(){--K===0&&q(j)}var j={},K=2,Q=W.template;W=W.viewModel,Q?L(k,Q,function(de){m.j.oc("loadTemplate",[G,de],function(xe){j.template=xe,J()})}):J(),W?L(k,W,function(de){m.j.oc("loadViewModel",[G,de],function(xe){j[V]=xe,J()})}):J()}function S(G,k,W){if(typeof k=="function")W(function(J){return new k(J)});else if(typeof k[V]=="function")W(k[V]);else if("instance"in k){var q=k.instance;W(function(){return q})}else"viewModel"in k?S(G,k.viewModel,W):G("Unknown viewModel value: "+k)}function w(G){switch(m.a.R(G)){case"script":return m.a.ua(G.text);case"textarea":return m.a.ua(G.value);case"template":if(I(G.content))return m.a.Ca(G.content.childNodes)}return m.a.Ca(G.childNodes)}function I(G){return t.DocumentFragment?G instanceof DocumentFragment:G&&G.nodeType===11}function L(G,k,W){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(q){q&&typeof q=="object"&&q.Xd&&q.default&&(q=q.default),W(q)}):G("Uses require, but no AMD loader is present"):W(k)}function B(G){return function(k){throw Error("Component '"+G+"': "+k)}}var U={};m.j.register=function(G,k){if(!k)throw Error("Invalid configuration for "+G);if(m.j.tb(G))throw Error("Component "+G+" is already registered");U[G]=k},m.j.tb=function(G){return Object.prototype.hasOwnProperty.call(U,G)},m.j.unregister=function(G){delete U[G],m.j.Bc(G)},m.j.Fc={getConfig:function(G,k){k(m.j.tb(G)?U[G]:null)},loadComponent:function(G,k,W){var q=B(G);L(q,k,function(J){_(G,q,J,W)})},loadTemplate:function(G,k,W){if(G=B(G),typeof k=="string")W(m.a.ua(k));else if(k instanceof Array)W(k);else if(I(k))W(m.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)W(w(k));else if(typeof k=="string"){var q=n.getElementById(k);q?W(w(q)):G("Cannot find element with ID "+k)}else G("Unknown element type: "+k);else G("Unknown template value: "+k)},loadViewModel:function(G,k,W){S(B(G),k,W)}};var V="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=U}(),function(){function _(w,I){var L=w.getAttribute("params");if(L){var L=S.parseBindingsString(L,I,w,{valueAccessors:!0,bindingParams:!0}),L=m.a.Ga(L,function(V){return m.o(V,null,{l:w})}),B=m.a.Ga(L,function(V){var G=V.v();return V.ja()?m.o({read:function(){return m.a.f(V())},write:m.Za(G)&&function(k){V()(k)},l:w}):G});return Object.prototype.hasOwnProperty.call(B,"$raw")||(B.$raw=L),B}return{$raw:{}}}m.j.getComponentNameForNode=function(w){var I=m.a.R(w);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=m.a.W&&w.tagName===I))return I},m.j.tc=function(w,I,L,B){if(I.nodeType===1){var U=m.j.getComponentNameForNode(I);if(U){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:U,params:_(I,L)};w.component=B?function(){return V}:V}}return w};var S=new m.ga;9>m.a.W&&(m.j.register=function(w){return function(I){return w.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(w){return function(){var I=w(),L=m.j.dd,B;for(B in L);return I}}(n.createDocumentFragment))}(),function(){function _(I,L,B){if(L=L.template,!L)throw Error("Component '"+I+"' has no template");I=m.a.Ca(L),m.h.va(B,I)}function S(I,L,B){var U=I.createViewModel;return U?U.call(I,L,B):L}var w=0;m.c.component={init:function(I,L,B,U,V){function G(){var j=k&&k.dispose;typeof j=="function"&&j.call(k),q&&q.s(),W=k=q=null}var k,W,q,J=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,G),m.o(function(){var j=m.a.f(L()),K,Q;if(typeof j=="string"?K=j:(K=m.a.f(j.name),Q=m.a.f(j.params)),!K)throw Error("No component name specified");var de=m.i.Cb(I,V),xe=W=++w;m.j.get(K,function(ce){if(W===xe){if(G(),!ce)throw Error("Unknown component '"+K+"'");_(K,ce,I);var ge=S(ce,Q,{element:I,templateNodes:J});ce=de.createChildContext(ge,{extend:function(be){be.$component=ge,be.$componentTemplateNodes=J}}),ge&&ge.koDescendantsComplete&&(q=m.i.subscribe(I,m.i.pa,ge.koDescendantsComplete,ge)),k=ge,m.Oa(ce,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var M={class:"className",for:"htmlFor"};m.c.attr={update:function(_,S){var w=m.a.f(S())||{};m.a.P(w,function(I,L){L=m.a.f(L);var B=I.indexOf(":"),B="lookupNamespaceURI"in _&&0<B&&_.lookupNamespaceURI(I.substr(0,B)),U=L===!1||L===null||L===e;U?B?_.removeAttributeNS(B,I):_.removeAttribute(I):L=L.toString(),8>=m.a.W&&I in M?(I=M[I],U?_.removeAttribute(I):_[I]=L):U||(B?_.setAttributeNS(B,I,L):_.setAttribute(I,L)),I==="name"&&m.a.Yc(_,U?"":L)})}},function(){m.c.checked={after:["value","attr"],init:function(_,S,w){function I(){var j=_.checked,K=B();if(!m.S.Ya()&&(j||!V&&!m.S.qa())){var Q=m.u.G(S);if(k){var de=W?Q.v():Q,xe=J;J=K,xe!==K?j&&(m.a.Na(de,K,!0),m.a.Na(de,xe,!1)):m.a.Na(de,K,j),W&&m.Za(Q)&&Q(de)}else U&&(K===e?K=j:j||(K=e)),m.m.eb(Q,w,"checked",K,!0)}}function L(){var j=m.a.f(S()),K=B();k?(_.checked=0<=m.a.A(j,K),J=K):_.checked=U&&K===e?!!j:B()===j}var B=m.xb(function(){if(w.has("checkedValue"))return m.a.f(w.get("checkedValue"));if(q)return w.has("value")?m.a.f(w.get("value")):_.value}),U=_.type=="checkbox",V=_.type=="radio";if(U||V){var G=S(),k=U&&m.a.f(G)instanceof Array,W=!(k&&G.push&&G.splice),q=V||k,J=k?B():e;V&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(I,null,{l:_}),m.a.B(_,"click",I),m.o(L,null,{l:_}),G=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,S){_.value=m.a.f(S())}}}(),m.c.class={update:function(_,S){var w=m.a.Db(m.a.f(S()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,m.a.Eb(_,w,!0)}},m.c.css={update:function(_,S){var w=m.a.f(S());w!==null&&typeof w=="object"?m.a.P(w,function(I,L){L=m.a.f(L),m.a.Eb(_,I,L)}):m.c.class.update(_,S)}},m.c.enable={update:function(_,S){var w=m.a.f(S());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,S){m.c.enable.update(_,function(){return!m.a.f(S())})}},m.c.event={init:function(_,S,w,I,L){var B=S()||{};m.a.P(B,function(U){typeof U=="string"&&m.a.B(_,U,function(V){var G,k=S()[U];if(k){try{var W=m.a.la(arguments);I=L.$data,W.unshift(I),G=k.apply(I,W)}finally{G!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}w.get(U+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var S=_(),w=m.a.bc(S);return!w||typeof w.length=="number"?{foreach:S,templateEngine:m.ba.Ma}:(m.a.f(S),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:m.ba.Ma})}},init:function(_,S){return m.c.template.init(_,m.c.foreach.Rc(S))},update:function(_,S,w,I,L){return m.c.template.update(_,m.c.foreach.Rc(S),w,I,L)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,S,w){function I(U){_.__ko_hasfocusUpdating=!0;var V=_.ownerDocument;if("activeElement"in V){var G;try{G=V.activeElement}catch{G=V.body}U=G===_}V=S(),m.m.eb(V,w,"hasfocus",U,!0),_.__ko_hasfocusLastValue=U,_.__ko_hasfocusUpdating=!1}var L=I.bind(null,!0),B=I.bind(null,!1);m.a.B(_,"focus",L),m.a.B(_,"focusin",L),m.a.B(_,"blur",B),m.a.B(_,"focusout",B),_.__ko_hasfocusLastValue=!1},update:function(_,S){var w=!!m.a.f(S());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,w?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,S){m.a.fc(_,S())}},function(){function _(S,w,I){m.c[S]={init:function(L,B,U,V,G){var k,W,q={},J,j,K;if(w){V=U.get("as");var Q=U.get("noChildContext");K=!(V&&Q),q={as:V,noChildContext:Q,exportDependencies:K}}return j=(J=U.get("completeOn")=="render")||U.has(m.i.pa),m.o(function(){var de=m.a.f(B()),xe=!I!=!de,ce=!W,ge;(K||xe!==k)&&(j&&(G=m.i.Cb(L,G)),xe&&((!w||K)&&(q.dataDependency=m.S.o()),ge=w?G.createChildContext(typeof de=="function"?de:B,q):m.S.qa()?G.extend(null,q):G),ce&&m.S.qa()&&(W=m.a.Ca(m.h.childNodes(L),!0)),xe?(ce||m.h.va(L,m.a.Ca(W)),m.Oa(ge,L)):(m.h.Ea(L),J||m.i.ma(L,m.i.H)),k=xe)},null,{l:L}),{controlsDescendantBindings:!0}}},m.m.Ra[S]=!1,m.h.ea[S]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),m.c.let={init:function(_,S,w,I,L){return S=L.extend(S),m.Oa(S,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var N={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,S,w){function I(){return m.a.jb(_.options,function(Q){return Q.selected})}function L(Q,de,xe){var ce=typeof de;return ce=="function"?de(Q):ce=="string"?Q[de]:xe}function B(Q,de){if(j&&k)m.i.ma(_,m.i.H);else if(J.length){var xe=0<=m.a.A(J,m.w.M(de[0]));m.a.Zc(de[0],xe),j&&!xe&&m.u.G(m.a.Fb,null,[_,"change"])}}var U=_.multiple,V=_.length!=0&&U?_.scrollTop:null,G=m.a.f(S()),k=w.get("valueAllowUnset")&&w.has("value"),W=w.get("optionsIncludeDestroyed");S={};var q,J=[];k||(U?J=m.a.Mb(I(),m.w.M):0<=_.selectedIndex&&J.push(m.w.M(_.options[_.selectedIndex]))),G&&(typeof G.length>"u"&&(G=[G]),q=m.a.jb(G,function(Q){return W||Q===e||Q===null||!m.a.f(Q._destroy)}),w.has("optionsCaption")&&(G=m.a.f(w.get("optionsCaption")),G!==null&&G!==e&&q.unshift(N)));var j=!1;if(S.beforeRemove=function(Q){_.removeChild(Q)},G=B,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(G=function(Q,de){B(0,de),m.u.G(w.get("optionsAfterRender"),null,[de[0],Q!==N?Q:e])}),m.a.ec(_,q,function(Q,de,xe){return xe.length&&(J=!k&&xe[0].selected?[m.w.M(xe[0])]:[],j=!0),de=_.ownerDocument.createElement("option"),Q===N?(m.a.Bb(de,w.get("optionsCaption")),m.w.cb(de,e)):(xe=L(Q,w.get("optionsValue"),Q),m.w.cb(de,m.a.f(xe)),Q=L(Q,w.get("optionsText"),xe),m.a.Bb(de,Q)),[de]},S,G),!k){var K;U?K=J.length&&I().length<J.length:K=J.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==J[0]:J.length||0<=_.selectedIndex,K&&m.u.G(m.a.Fb,null,[_,"change"])}(k||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),V&&20<Math.abs(V-_.scrollTop)&&(_.scrollTop=V)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,S,w){function I(){var U=S(),V=[];m.a.D(_.getElementsByTagName("option"),function(G){G.selected&&V.push(m.w.M(G))}),m.m.eb(U,w,"selectedOptions",V)}function L(){var U=m.a.f(S()),V=_.scrollTop;U&&typeof U.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(G){var k=0<=m.a.A(U,m.w.M(G));G.selected!=k&&m.a.Zc(G,k)}),_.scrollTop=V}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var B;m.i.subscribe(_,m.i.H,function(){B?I():(m.a.B(_,"change",I),B=m.o(L,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,S){var w=m.a.f(S()||{});m.a.P(w,function(I,L){if(L=m.a.f(L),(L===null||L===e||L===!1)&&(L=""),o)o(_).css(I,L);else if(/^--/.test(I))_.style.setProperty(I,L);else{I=I.replace(/-(\w)/g,function(U,V){return V.toUpperCase()});var B=_.style[I];_.style[I]=L,L===B||_.style[I]!=B||isNaN(L)||(_.style[I]=L+"px")}})}},m.c.submit={init:function(_,S,w,I,L){if(typeof S()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(B){var U,V=S();try{U=V.call(L.$data,_)}finally{U!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,S){m.a.Bb(_,S())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(q){if(q)return parseFloat(q[1])},S=t.navigator.userAgent,w,I,L,B,U;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(U=_(S.match(/Edge\/([^ ]+)$/)))||_(S.match(/Chrome\/([^ ]+)/))||(I=_(S.match(/Version\/([^ ]+) Safari/)))||(L=_(S.match(/Firefox\/([^ ]+)/)))||(B=m.a.W||_(S.match(/MSIE ([^ ]+)/)))||(B=_(S.match(/rv:([^ )]+)/)))}if(8<=B&&10>B)var V=m.a.g.Z(),G=m.a.g.Z(),k=function(q){var J=this.activeElement;(J=J&&m.a.g.get(J,G))&&J(q)},W=function(q,J){var j=q.ownerDocument;m.a.g.get(j,V)||(m.a.g.set(j,V,!0),m.a.B(j,"selectionchange",k)),m.a.g.set(q,G,J)};m.c.textInput={init:function(q,J,j){function K(ke,ze){m.a.B(q,ke,ze)}function Q(){var ke=m.a.f(J());(ke===null||ke===e)&&(ke=""),be!==e&&ke===be?m.a.setTimeout(Q,4):q.value!==ke&&(Ae=!0,q.value=ke,Ae=!1,ce=q.value)}function de(){ge||(be=q.value,ge=m.a.setTimeout(xe,4))}function xe(){clearTimeout(ge),be=ge=e;var ke=q.value;ce!==ke&&(ce=ke,m.m.eb(J(),j,"textInput",ke))}var ce=q.value,ge,be,De=m.a.W==9?de:xe,Ae=!1;B&&K("keypress",xe),11>B&&K("propertychange",function(ke){Ae||ke.propertyName!=="value"||De(ke)}),B==8&&(K("keyup",xe),K("keydown",xe)),W&&(W(q,De),K("dragend",de)),(!B||9<=B)&&K("input",De),5>I&&m.a.R(q)==="textarea"?(K("keydown",de),K("paste",de),K("cut",de)):11>w?K("keydown",de):4>L?(K("DOMAutoComplete",xe),K("dragdrop",xe),K("drop",xe)):U&&q.type==="number"&&K("keydown",de),K("change",xe),K("blur",xe),m.o(Q,null,{l:q})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(q,J,j){j("textInput",q)}}}(),m.c.uniqueName={init:function(_,S){if(S()){var w="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,w)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,S,w,I,L){var B;return w.has("as")&&(B={as:w.get("as"),noChildContext:w.get("noChildContext")}),S=L.createChildContext(S,B),m.Oa(S,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,S,w){var I=m.a.R(_),L=I=="input";if(!L||_.type!="checkbox"&&_.type!="radio"){var B=[],U=w.get("valueUpdate"),V=!1,G=null;U&&(typeof U=="string"?B=[U]:B=m.a.wc(U),m.a.Pa(B,"change"));var k=function(){G=null,V=!1;var J=S(),j=m.w.M(_);m.m.eb(J,w,"value",j)};!m.a.W||!L||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(B,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){V=!0}),m.a.B(_,"focus",function(){V=!1}),m.a.B(_,"blur",function(){V&&k()})),m.a.D(B,function(J){var j=k;m.a.Ud(J,"after")&&(j=function(){G=m.w.M(_),m.a.setTimeout(k,0)},J=J.substring(5)),m.a.B(_,J,j)});var W;if(W=L&&_.type=="file"?function(){var J=m.a.f(S());J===null||J===e||J===""?_.value="":m.u.G(k)}:function(){var J=m.a.f(S()),j=m.w.M(_);G!==null&&J===G?m.a.setTimeout(W,0):(J!==j||j===e)&&(I==="select"?(j=w.get("valueAllowUnset"),m.w.cb(_,J,j),j||J===m.w.M(_)||m.u.G(k)):m.w.cb(_,J))},I==="select"){var q;m.i.subscribe(_,m.i.H,function(){q?w.get("valueAllowUnset")?W():k():(m.a.B(_,"change",k),q=m.o(W,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",k),m.o(W,null,{l:_})}else m.ib(_,{checkedValue:S})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,S){var w=m.a.f(S()),I=_.style.display!="none";w&&!I?_.style.display="":!w&&I&&(_.style.display="none")}},m.c.hidden={update:function(_,S){m.c.visible.update(_,function(){return!m.a.f(S())})}},function(_){m.c[_]={init:function(S,w,I,L,B){return m.c.event.init.call(this,S,function(){var U={};return U[_]=w(),U},I,L,B)}}}("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,S){if(typeof _=="string"){S=S||n;var w=S.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new m.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,S,w,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,S,w,I)},m.ca.prototype.isTemplateRewritten=function(_,S){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,S).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,S,w){_=this.makeTemplateSource(_,w),S=S(_.text()),_.text(S),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function _(I,L,B,U){I=m.m.ac(I);for(var V=m.m.Ra,G=0;G<I.length;G++){var k=I[G].key;if(Object.prototype.hasOwnProperty.call(V,k)){var W=V[k];if(typeof W=="function"){if(k=W(I[G].value))throw Error(k)}else if(!W)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return B="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+B.toLowerCase()+"')",U.createJavaScriptEvaluatorBlock(B)+L}var S=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,L,B){L.isTemplateRewritten(I,B)||L.rewriteTemplate(I,function(U){return m.kc.Ld(U,L)},B)},Ld:function(I,L){return I.replace(S,function(B,U,V,G,k){return _(k,U,V,L)}).replace(w,function(B,U){return _(U,"<!-- ko -->","#comment",L)})},md:function(I,L){return m.aa.Xb(function(B,U){var V=B.nextSibling;V&&V.nodeName.toLowerCase()===L&&m.ib(V,I,U)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(w){if(this.F=w){var I=m.a.R(w);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&w.content&&w.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var I=arguments[0];w==="innerHTML"?m.a.fc(this.F,I):this.F[w]=I};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(w){if(arguments.length===1)return m.a.g.get(this.F,_+w);m.a.g.set(this.F,_+w,arguments[1])};var S=m.a.g.Z();m.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var I=m.a.g.get(w,S)||{},L=I.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!L||I.jd){var B=this.text();B&&B!==I.bb&&(L=m.a.Md(B,w.ownerDocument),m.a.g.set(w,S,{lb:L,bb:B,jd:!0}))}return L}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(w,S,{lb:I})},m.C.ia=function(w){this.F=w},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var w=m.a.g.get(this.F,S)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}m.a.g.set(this.F,S,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function _(G,k,W){var q;for(k=m.h.nextSibling(k);G&&(q=G)!==k;)G=m.h.nextSibling(q),W(q,G)}function S(G,k){if(G.length){var W=G[0],q=G[G.length-1],J=W.parentNode,j=m.ga.instance,K=j.preprocessNode;if(K){if(_(W,q,function(Q,de){var xe=Q.previousSibling,ce=K.call(j,Q);ce&&(Q===W&&(W=ce[0]||de),Q===q&&(q=ce[ce.length-1]||xe))}),G.length=0,!W)return;W===q?G.push(W):(G.push(W,q),m.a.Ua(G,J))}_(W,q,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.vc(k,Q)}),_(W,q,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.aa.cd(Q,[k])}),m.a.Ua(G,J)}}function w(G){return G.nodeType?G:0<G.length?G[0]:null}function I(G,k,W,q,J){J=J||{};var j=(G&&w(G)||W||{}).ownerDocument,K=J.templateEngine||B;if(m.kc.xd(W,K,j),W=K.renderTemplate(W,q,J,j),typeof W.length!="number"||0<W.length&&typeof W[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(j=!1,k){case"replaceChildren":m.h.va(G,W),j=!0;break;case"replaceNode":m.a.Xc(G,W),j=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return j&&(S(W,q),J.afterRender&&m.u.G(J.afterRender,null,[W,q[J.as||"$data"]]),k=="replaceChildren"&&m.i.ma(G,m.i.H)),W}function L(G,k,W){return m.O(G)?G():typeof G=="function"?G(k,W):G}var B;m.gc=function(G){if(G!=e&&!(G instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");B=G},m.dc=function(G,k,W,q,J){if(W=W||{},(W.templateEngine||B)==e)throw Error("Set a template engine before calling renderTemplate");if(J=J||"replaceChildren",q){var j=w(q);return m.$(function(){var Q=k&&k instanceof m.fa?k:new m.fa(k,null,null,null,{exportDependencies:!0}),K=L(G,Q.$data,Q),Q=I(q,J,K,Q,W);J=="replaceNode"&&(q=Q,j=w(q))},null,{Sa:function(){return!j||!m.a.Sb(j)},l:j&&J=="replaceNode"?j.parentNode:j})}return m.aa.Xb(function(K){m.dc(G,k,W,K,"replaceNode")})},m.Qd=function(G,k,W,q,J){function j(be,De){m.u.G(m.a.ec,null,[q,be,Q,W,K,De]),m.i.ma(q,m.i.H)}function K(be,De){S(De,de),W.afterRender&&W.afterRender(De,be),de=null}function Q(be,De){de=J.createChildContext(be,{as:xe,noChildContext:W.noChildContext,extend:function(ke){ke.$index=De,xe&&(ke[xe+"Index"]=De)}});var Ae=L(G,be,de);return I(q,"ignoreTargetNode",Ae,de,W)}var de,xe=W.as,ce=W.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!W.includeDestroyed;if(ce||W.beforeRemove||!m.Pc(k))return m.$(function(){var be=m.a.f(k)||[];typeof be.length>"u"&&(be=[be]),ce&&(be=m.a.jb(be,function(De){return De===e||De===null||!m.a.f(De._destroy)})),j(be)},null,{l:q});j(k.v());var ge=k.subscribe(function(be){j(k(),be)},null,"arrayChange");return ge.l(q),ge};var U=m.a.g.Z(),V=m.a.g.Z();m.c.template={init:function(G,k){var W=m.a.f(k());if(typeof W=="string"||"name"in W)m.h.Ea(G);else if("nodes"in W){if(W=W.nodes||[],m.O(W))throw Error('The "nodes" option must be a plain, non-observable array.');var q=W[0]&&W[0].parentNode;q&&m.a.g.get(q,V)||(q=m.a.Yb(W),m.a.g.set(q,V,!0)),new m.C.ia(G).nodes(q)}else if(W=m.h.childNodes(G),0<W.length)q=m.a.Yb(W),new m.C.ia(G).nodes(q);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(G,k,W,q,J){var j=k();k=m.a.f(j),W=!0,q=null,typeof k=="string"?k={}:(j="name"in k?k.name:G,"if"in k&&(W=m.a.f(k.if)),W&&"ifnot"in k&&(W=!m.a.f(k.ifnot)),W&&!j&&(W=!1)),"foreach"in k?q=m.Qd(j,W&&k.foreach||[],k,G,J):W?(W=J,"data"in k&&(W=J.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),q=m.dc(j,W,k,G)):m.h.Ea(G),J=q,(k=m.a.g.get(G,U))&&typeof k.s=="function"&&k.s(),m.a.g.set(G,U,!J||J.ja&&!J.ja()?e:J)}},m.m.Ra.template=function(G){return G=m.m.ac(G),G.length==1&&G[0].unknown||m.m.Id(G,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0}(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,S,w){if(_.length&&S.length){var I,L,B,U,V;for(I=L=0;(!w||I<w)&&(U=_[L]);++L){for(B=0;V=S[B];++B)if(U.value===V.value){U.moved=V.index,V.moved=U.index,S.splice(B,1),I=B=0;break}I+=B}}},m.a.Pb=function(){function _(S,w,I,L,B){var U=Math.min,V=Math.max,G=[],k,W=S.length,q,J=w.length,j=J-W||1,K=W+J+1,Q,de,xe;for(k=0;k<=W;k++)for(de=Q,G.push(Q=[]),xe=U(J,k+j),q=V(0,k-1);q<=xe;q++)Q[q]=q?k?S[k-1]===w[q-1]?de[q-1]:U(de[q]||K,Q[q-1]||K)+1:q+1:k+1;for(U=[],V=[],j=[],k=W,q=J;k||q;)J=G[k][q]-1,q&&J===G[k][q-1]?V.push(U[U.length]={status:I,value:w[--q],index:q}):k&&J===G[k-1][q]?j.push(U[U.length]={status:L,value:S[--k],index:k}):(--q,--k,B.sparse||U.push({status:"retained",value:w[q]}));return m.a.Kc(j,V,!B.dontLimitMoves&&10*W),U.reverse()}return function(S,w,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},S=S||[],w=w||[],S.length<w.length?_(S,w,"added","deleted",I):_(w,S,"deleted","added",I)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function _(I,L,B,U,V){var G=[],k=m.$(function(){var W=L(B,V,m.a.Ua(G,I))||[];0<G.length&&(m.a.Xc(G,W),U&&m.u.G(U,null,[B,W,V])),G.length=0,m.a.Nb(G,W)},null,{l:I,Sa:function(){return!m.a.kd(G)}});return{Y:G,$:k.ja()?k:e}}var S=m.a.g.Z(),w=m.a.g.Z();m.a.ec=function(I,L,B,U,V,G){function k(lt){Ae={Aa:lt,pb:m.ta(de++)},K.push(Ae),j||De.push(Ae)}function W(lt){Ae=J[lt],de!==Ae.pb.v()&&be.push(Ae),Ae.pb(de++),m.a.Ua(Ae.Y,I),K.push(Ae)}function q(lt,jn){if(lt)for(var sn=0,me=jn.length;sn<me;sn++)m.a.D(jn[sn].Y,function(Ce){lt(Ce,sn,jn[sn].Aa)})}L=L||[],typeof L.length>"u"&&(L=[L]),U=U||{};var J=m.a.g.get(I,S),j=!J,K=[],Q=0,de=0,xe=[],ce=[],ge=[],be=[],De=[],Ae,ke=0;if(j)m.a.D(L,k);else{if(!G||J&&J._countWaitingForRemove){var ze=m.a.Mb(J,function(lt){return lt.Aa});G=m.a.Pb(ze,L,{dontLimitMoves:U.dontLimitMoves,sparse:!0})}for(var ze=0,tt,vt,pt;tt=G[ze];ze++)switch(vt=tt.moved,pt=tt.index,tt.status){case"deleted":for(;Q<pt;)W(Q++);vt===e&&(Ae=J[Q],Ae.$&&(Ae.$.s(),Ae.$=e),m.a.Ua(Ae.Y,I).length&&(U.beforeRemove&&(K.push(Ae),ke++,Ae.Aa===w?Ae=null:ge.push(Ae)),Ae&&xe.push.apply(xe,Ae.Y))),Q++;break;case"added":for(;de<pt;)W(Q++);vt!==e?(ce.push(K.length),W(vt)):k(tt.value)}for(;de<L.length;)W(Q++);K._countWaitingForRemove=ke}m.a.g.set(I,S,K),q(U.beforeMove,be),m.a.D(xe,U.beforeRemove?m.oa:m.removeNode);var Be,qt,At;try{At=I.ownerDocument.activeElement}catch{}if(ce.length)for(;(ze=ce.shift())!=e;){for(Ae=K[ze],Be=e;ze;)if((qt=K[--ze].Y)&&qt.length){Be=qt[qt.length-1];break}for(L=0;Q=Ae.Y[L];Be=Q,L++)m.h.Wb(I,Q,Be)}for(ze=0;Ae=K[ze];ze++){for(Ae.Y||m.a.extend(Ae,_(I,B,Ae.Aa,V,Ae.pb)),L=0;Q=Ae.Y[L];Be=Q,L++)m.h.Wb(I,Q,Be);!Ae.Ed&&V&&(V(Ae.Aa,Ae.Y,Ae.pb),Ae.Ed=!0,Be=Ae.Y[Ae.Y.length-1])}for(At&&I.ownerDocument.activeElement!=At&&At.focus(),q(U.beforeRemove,ge),ze=0;ze<ge.length;++ze)ge[ze].Aa=w;q(U.afterMove,be),q(U.afterAdd,De)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,S,w,I){return(S=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(S.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var S=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(w,I,L,B){if(B=B||n,L=L||{},2>S)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var U=w.data("precompiled");return U||(U=w.text()||"",U=o.template(null,"{{ko_with $item.koBindingContext}}"+U+"{{/ko_with}}"),w.data("precompiled",U)),w=[I.$data],I=o.extend({koBindingContext:I},L.templateOptions),I=o.tmpl(U,w,I),I.appendTo(B.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,I){n.write("<script type='text/html' id='"+w+"'>"+I+"</script>")},0<S&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var kSt=ko;typeof window<"u"?(ko=window.ko,typeof uk<"u"?window.ko=uk:delete window.ko):(ko=global.ko,typeof uk<"u"?global.ko=uk:delete global.ko);var MC=kSt;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var yQ="__knockoutObservables",xQ="__knockoutSubscribable";function oEe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=rEe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===yQ||o===xQ)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&NSt(n,a)}}),e}function rEe(e,t){var n=e[yQ];return!n&&t&&(n={},Object.defineProperty(e,yQ,{value:n})),n}function LSt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),oEe.call(i,e,[t]),e}function NSt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=FSt(e,t,i))})}function FSt(e,t,n){var i=BSt(e,n);return i.subscribe(t)}function BSt(e,t){var n=t[xQ];if(!n){n=new e.subscribable,Object.defineProperty(t,xQ,{value:n});var i={};kSt(t,n,i),VSt(e,t,n,i)}return n}function kSt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function VSt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function sEe(e,t){if(!e)return null;var n=rEe(e,!1);return n&&n[t]||null}function USt(e,t){var n=sEe(e,t);n&&n.valueHasMutated()}function zSt(e){e.track=oEe,e.getObservable=sEe,e.valueHasMutated=USt,e.defineProperty=LSt}var fk={attachToKo:zSt};var aEe="http://www.w3.org/2000/svg",cEe="cesium-svgPath-svg",HSt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(aEe,"svg:svg");i.setAttribute("class",cEe);let o=document.createElementNS(aEe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${cEe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},dk=HSt;fk.attachToKo(MC);dk.register(MC);var be=MC;function hk(e){l(e)||(e=new xh),this._clock=e,this._eventHelper=new dr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=be.observable(Z.now()),this.systemTime.equalityComparer=Z.equals,this.startTime=be.observable(e.startTime),this.startTime.equalityComparer=Z.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=be.observable(e.stopTime),this.stopTime.equalityComparer=Z.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=be.observable(e.currentTime),this.currentTime.equalityComparer=Z.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=be.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=be.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=be.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=be.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=be.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),be.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(hk.prototype,{clock:{get:function(){return this._clock}}});hk.prototype.synchronize=function(){let e=this._clock;this.systemTime=Z.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};hk.prototype.isDestroyed=function(){return!1};hk.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var mk=hk;function GSt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,he.throwInstantiationError()}var bQ=GSt;var pk={};pk.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};pk.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};pk.createRangeInput=function(e,t,n,i,o,r){r=y(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};pk.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Ya=pk;function lEe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),be.track(this,["toggled","tooltip"])}Object.defineProperties(lEe.prototype,{command:{get:function(){return this._command}}});var Z0=lEe;function WSt(e,t){t=y(t,!0);let n=new me,i=new me;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,be.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var En=WSt;function jSt(e,t,n,i,o){return n.call(i,e[t]),be.getObservable(e,t).subscribe(n,i,o)}var Ca=jSt;var LC="http://www.w3.org/2000/svg",dEe="http://www.w3.org/1999/xlink",jG,_k=H.fromCssColorString("rgba(247,250,255,0.384)"),qG=H.fromCssColorString("rgba(143,191,255,0.216)"),TQ=H.fromCssColorString("rgba(153,197,255,0.098)"),YG=H.fromCssColorString("rgba(255,255,255,0.086)"),qSt=H.fromCssColorString("rgba(255,255,255,0.267)"),YSt=H.fromCssColorString("rgba(255,255,255,0)"),uEe=H.fromCssColorString("rgba(66,67,68,0.3)"),fEe=H.fromCssColorString("rgba(0,0,0,0.5)");function $0(e){return H.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var gk={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function $h(e){let t=document.createElementNS(LC,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild($h(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(dEe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function CQ(e,t,n){let i=document.createElementNS(LC,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(LC,"tspan");return o.textContent=n,i.appendChild(o),i}function XSt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var XG=new H;function ls(e,t){let n=t.alpha,i=1-n;return XG.red=e.red*i+t.red*n,XG.green=e.green*i+t.green*n,XG.blue=e.blue*i+t.blue*n,XG.toCssColorString()}function AQ(e,t,n){let i=gk[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return $h(o)}function KSt(e,t,n){let i=gk[n],o=gk.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return $h(r)}function ZSt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&jG!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-o-a.left,p=u-r-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(jG=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===jG&&(jG=void 0),n.shuttleRingDragging=!1}function Og(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Ca(t,"toggled",this.setToggled,this),Ca(t,"tooltip",this.setTooltip,this),Ca(t.command,"canExecute",this.setEnabled,this)]}Og.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};Og.prototype.isDestroyed=function(){return!1};Og.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Og.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};Og.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function Kv(e,t){e=In(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(LC,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",dEe);let s=document.createElementNS(LC,"g");this._topG=s,this._realtimeSVG=new Og(KSt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Og(AQ(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Og(AQ(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Og(AQ(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(LC,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=$h({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=gk.animation_pathSwooshFX,f=gk.animation_pathPointer,d=$h({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=$h({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=$h({tagName:"g",transform:"translate(100,100)"});this._knobOuter=$h({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=$h({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=CQ(0,-24,""),this._knobTime=CQ(0,-7,""),this._knobStatus=CQ(0,-41,"");let x=$h({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),b=document.createElementNS(LC,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(c),b.appendChild(d),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let T=this;function C(O){ZSt(T,O)}this._mouseCallback=C,c.addEventListener("mousedown",C,!0),c.addEventListener("touchstart",C,!0),d.addEventListener("mousedown",C,!0),d.addEventListener("touchstart",C,!0),n.addEventListener("mousemove",C,!0),n.addEventListener("touchmove",C,!0),n.addEventListener("mouseup",C,!0),n.addEventListener("touchend",C,!0),n.addEventListener("touchcancel",C,!0),this._shuttleRingPointer.addEventListener("mousedown",C,!0),this._shuttleRingPointer.addEventListener("touchstart",C,!0),this._knobOuter.addEventListener("mousedown",C,!0),this._knobOuter.addEventListener("touchstart",C,!0);let A=this._knobTime.childNodes[0],E=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],D;this._subscriptions=[Ca(t.pauseViewModel,"toggled",function(O){D!==O&&(D=O,D?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Ca(t,"shuttleRingAngle",function(O){XSt(T._shuttleRingPointer,T._knobOuter,O)}),Ca(t,"dateLabel",function(O){E.textContent!==O&&(E.textContent=O)}),Ca(t,"timeLabel",function(O){A.textContent!==O&&(A.textContent=O)}),Ca(t,"multiplierLabel",function(O){v.textContent!==O&&(v.textContent=O)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(Kv.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Kv.prototype.isDestroyed=function(){return!1};Kv.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return ue(this)};Kv.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};Kv.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=$0(this._themeNormal),n=$0(this._themeHover),i=$0(this._themeSelect),o=$0(this._themeDisabled),r=$0(this._themeKnob),s=$0(this._themePointer),a=$0(this._themeSwoosh),c=$0(this._themeSwooshHover),u=$h({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ls(t,_k)},{tagName:"stop",offset:"12%","stop-color":ls(t,qG)},{tagName:"stop",offset:"46%","stop-color":ls(t,TQ)},{tagName:"stop",offset:"81%","stop-color":ls(t,YG)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ls(n,_k)},{tagName:"stop",offset:"12%","stop-color":ls(n,qG)},{tagName:"stop",offset:"46%","stop-color":ls(n,TQ)},{tagName:"stop",offset:"81%","stop-color":ls(n,YG)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ls(i,_k)},{tagName:"stop",offset:"12%","stop-color":ls(i,qG)},{tagName:"stop",offset:"46%","stop-color":ls(i,TQ)},{tagName:"stop",offset:"81%","stop-color":ls(i,YG)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ls(o,qSt)},{tagName:"stop",offset:"75%","stop-color":ls(o,YSt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":ls(s,fEe)},{tagName:"stop",offset:"100%","stop-color":ls(s,fEe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":ls(r,_k)},{tagName:"stop",offset:"60%","stop-color":ls(r,uEe)},{tagName:"stop",offset:"85%","stop-color":ls(r,qG)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":ls(r,uEe)},{tagName:"stop",offset:"60%","stop-color":ls(r,_k)},{tagName:"stop",offset:"85%","stop-color":ls(r,YG)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var yk=Kv;var $St=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Q0=15,Zv=105;function hEe(e,t){return e-t}function EQ(e,t){let n=Oo(t,e,hEe);return n<0?~n:n}function QSt(e,t){if(Math.abs(e)<=Q0)return e/Q0;let n=Q0,i=Zv,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function JSt(e,t,n){if(n.clockStep===po.SYSTEM_CLOCK)return Q0;if(Math.abs(e)<=1)return e*Q0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=Q0,r=Zv,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function Ed(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Ed.defaultDateFormatter,this._timeFormatter=Ed.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,be.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Ed.defaultTicks),this.timeLabel=void 0,be.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,be.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,be.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===po.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,be.defineProperty(this,"shuttleRingAngle",{get:function(){return JSt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,Zv),-Zv);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=po.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===Zv){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=QSt(s,a);if(t.snapToTicks)u=a[EQ(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>Q0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,be.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Yr.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d=!1;if(a===Yr.LOOP_STOP)d=Z.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=Z.greaterThan(u,f)&&Z.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,be.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Yr.UNBOUNDED)return!0;let c=s.systemTime;return Z.greaterThanOrEquals(c,s.startTime)&&Z.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,be.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=En(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Z0(n,{toggled:be.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=En(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Z0(i,{toggled:be.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=En(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Z0(o,{toggled:be.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==po.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=En(function(){t._clockViewModel.clockStep=po.SYSTEM_CLOCK},be.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Z0(r,{toggled:be.computed(function(){return e.clockStep===po.SYSTEM_CLOCK}),tooltip:be.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=EQ(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=EQ(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Ed.defaultDateFormatter=function(e,t){let n=Z.toGregorianDate(e);return`${$St[n.month-1]} ${n.day} ${n.year}`};Ed.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Ed.defaultTimeFormatter=function(e,t){let n=Z.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Ed.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Ed.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(hEe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(Ed.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Ed._maxShuttleRingAngle=Zv;Ed._realtimeShuttleRingAngle=Q0;var xk=Ed;function evt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function SQ(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var tvt=new mn,nvt=new h;function bk(e,t){let n=this,i=e.canvas,o=new of(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",be.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=En(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=En(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=En(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=be.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=be.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=be.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new _g({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=En(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=be.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=En(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new q3({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=be.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=En(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=be.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=be.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=be.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=En(function(){let u=n.depthFrustum+1;return n.depthFrustum=SQ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=En(function(){let u=n.depthFrustum-1;return n.depthFrustum=SQ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=be.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=En(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new ck({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=be.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=be.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=En(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=En(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=be.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=En(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=be.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,bn.LEFT_CLICK):o.removeInputAction(bn.LEFT_CLICK)});function c(u){let f,d=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,tvt),g=r.pick(p,n._scene,nvt);if(l(g)){let m=d.cartesianToCartographic(g),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<x.length;++b){let T=x[b];if(l(T))for(let C=0;!f&&C<T.length;++C){let A=T[C];se.contains(A.rectangle,m)&&(f=A)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=En(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=be.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,bn.LEFT_CLICK):o.removeInputAction(bn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(bk.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return En(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return En(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return En(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return En(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return En(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});bk.prototype._update=function(){this.frustums&&(this.frustumStatisticText=evt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=SQ(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};bk.prototype.isDestroyed=function(){return!1};bk.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var Tk=bk;function KG(e,t){e=In(e);let n=document.createElement("div"),i=new Tk(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=Ya.createSection,c=Ya.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(b);let T=document.createElement("input");T.type="button",T.value="+",T.className="cesium-cesiumInspector-pickButton",T.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(T);let C=a(s,"Primitives","primitivesVisible","togglePrimitives"),A=document.createElement("div");A.className="cesium-cesiumInspector-pickSection",C.appendChild(A);let E=document.createElement("input");E.type="button",E.value="Pick a primitive",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(E),A.appendChild(v),A.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),A.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),A.appendChild(this._primitiveOnly);let D=a(s,"Terrain","terrainVisible","toggleTerrain"),O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",D.appendChild(O);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",O.appendChild(v);let M=document.createElement("div");O.appendChild(M);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let S=document.createElement("input");S.type="button",S.value="NE",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let L=document.createElement("div");L.className="cesium-cesiumInspector-tileText",M.className="cesium-cesiumInspector-frustumStatistics",M.appendChild(L),M.setAttribute("data-bind","visible: hasPickedTile"),L.setAttribute("data-bind","html: tileText");let B=document.createElement("div");B.className="cesium-cesiumInspector-relativeText",B.textContent="Select relative:",M.appendChild(B);let U=document.createElement("table"),V=document.createElement("tr"),G=document.createElement("tr"),k=document.createElement("td");k.appendChild(N);let W=document.createElement("td");W.appendChild(_);let j=document.createElement("td");j.appendChild(S),V.appendChild(k),V.appendChild(W),V.appendChild(j);let J=document.createElement("td"),q=document.createElement("td");q.appendChild(w);let K=document.createElement("td");K.appendChild(I),G.appendChild(J),G.appendChild(q),G.appendChild(K),U.appendChild(V),U.appendChild(G),M.appendChild(U),O.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),O.appendChild(c("Show only selected","filterTile","hasPickedTile")),D.appendChild(c("Wireframe","wireframe")),D.appendChild(c("Suspend LOD update","suspendUpdates")),D.appendChild(c("Show tile coordinates","tileCoordinates")),be.applyBindings(i,this._element)}Object.defineProperties(KG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});KG.prototype.isDestroyed=function(){return!1};KG.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var Ck=KG;function mEe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,be.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=be.getObservable(this,"imageryProviderViewModels"),r=be.pureComputed(function(){let d=o(),p={},g;for(g=0;g<d.length;g++){let b=d[g],T=b.category;l(p[T])?p[T].push(b):p[T]=[b]}let m=Object.keys(p),x=[];for(g=0;g<m.length;g++){let b=m[g];x.push({name:b,providers:p[b]})}return x});this._imageryProviders=r;let s=be.getObservable(this,"terrainProviderViewModels"),a=be.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let b=d[g],T=b.category;l(p[T])?p[T].push(b):p[T]=[b]}let m=Object.keys(p),x=[];for(g=0;g<m.length;g++){let b=m[g];x.push({name:b,providers:p[b]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,be.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g} -${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,be.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=be.observable();this._currentImageryLayers=[],be.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,x=this._globe.imageryLayers,b=!1;for(p=0;p<m;p++){let T=x.length;for(let C=0;C<T;C++){let A=x.get(C);if(A===g[p]){x.remove(A),b=!0;break}}}if(l(d)){let T=d.creationCommand();if(Array.isArray(T)){let C=T.length;for(this._currentImageryLayers=[],p=C-1;p>=0;p--){let A=Wa.fromProviderAsync(T[p]);x.add(A,0),this._currentImageryLayers.push(A)}}else{this._currentImageryLayers=[];let C=Wa.fromProviderAsync(T);if(C.name=d.name,b)x.add(C,0);else{let A=x.get(0);l(A)&&x.remove(A),x.add(C,0)}this._currentImageryLayers.push(C)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=be.observable();be.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof ep),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),b=new sk(p).readyEvent.addEventListener(T=>{g||(this._globe.depthTestAgainstTerrain=!(T instanceof ep),this._globe.terrainProvider=T,b())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=En(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(mEe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var Ak=mEe;function ZG(e,t){e=In(e);let n=new Ak(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",x.appendChild(b);let T=document.createElement("div");T.className="cesium-baseLayerPicker-categoryTitle",T.setAttribute("data-bind","text: name"),b.appendChild(T);let C=document.createElement("div");C.className="cesium-baseLayerPicker-choices",C.setAttribute("data-bind","foreach: providers"),b.appendChild(C);let A=document.createElement("div");A.className="cesium-baseLayerPicker-item",A.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),C.appendChild(A);let E=document.createElement("img");E.className="cesium-baseLayerPicker-itemIcon",E.setAttribute("data-bind","attr: { src: iconUrl }"),E.setAttribute("draggable","false"),A.appendChild(E);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),A.appendChild(v),be.applyBindings(n,i),be.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(D){i.contains(D.target)||r.contains(D.target)||(n.dropDownVisible=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(ZG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ZG.prototype.isDestroyed=function(){return!1};ZG.prototype.destroy=function(){return Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._element),be.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var Ek=ZG;function pEe(e){let t=e.creationFunction;l(t.canExecute)||(t=En(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),be.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(pEe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var us=pEe;function ivt(){let e=[],t=devicePixelRatio>=2;return e.push(new us({name:"Bing Maps Aerial",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return hg({style:dg.AERIAL})}})),e.push(new us({name:"Bing Maps Aerial with Labels",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return hg({style:dg.AERIAL_WITH_LABELS})}})),e.push(new us({name:"Bing Maps Roads",iconUrl:nn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return hg({style:dg.ROAD})}})),e.push(new us({name:"ArcGIS World Imagery",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return ug.fromBasemapType(Bh.SATELLITE,{enablePickFeatures:!1})}})),e.push(new us({name:"ArcGIS World Hillshade",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return ug.fromBasemapType(Bh.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new us({name:"Esri World Ocean",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return ug.fromBasemapType(Bh.OCEANS,{enablePickFeatures:!1})}})),e.push(new us({name:"Open\xADStreet\xADMap",iconUrl:nn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. -http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new Rg({url:"https://tile.openstreetmap.org/"})}})),e.push(new us({name:"Stadia x Stamen Watercolor",iconUrl:nn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. -https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new Rg({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + */var yQ="__knockoutObservables",xQ="__knockoutSubscribable";function sEe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=aEe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===yQ||o===xQ)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&USt(n,a)}}),e}function aEe(e,t){var n=e[yQ];return!n&&t&&(n={},Object.defineProperty(e,yQ,{value:n})),n}function VSt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),sEe.call(i,e,[t]),e}function USt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=zSt(e,t,i))})}function zSt(e,t,n){var i=HSt(e,n);return i.subscribe(t)}function HSt(e,t){var n=t[xQ];if(!n){n=new e.subscribable,Object.defineProperty(t,xQ,{value:n});var i={};GSt(t,n,i),WSt(e,t,n,i)}return n}function GSt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function WSt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function cEe(e,t){if(!e)return null;var n=aEe(e,!1);return n&&n[t]||null}function jSt(e,t){var n=cEe(e,t);n&&n.valueHasMutated()}function qSt(e){e.track=sEe,e.getObservable=cEe,e.valueHasMutated=jSt,e.defineProperty=VSt}var fk={attachToKo:qSt};var lEe="http://www.w3.org/2000/svg",uEe="cesium-svgPath-svg",YSt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(lEe,"svg:svg");i.setAttribute("class",uEe);let o=document.createElementNS(lEe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${uEe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},dk=YSt;fk.attachToKo(MC);dk.register(MC);var Te=MC;function hk(e){l(e)||(e=new yh),this._clock=e,this._eventHelper=new hr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Te.observable(Z.now()),this.systemTime.equalityComparer=Z.equals,this.startTime=Te.observable(e.startTime),this.startTime.equalityComparer=Z.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Te.observable(e.stopTime),this.stopTime.equalityComparer=Z.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Te.observable(e.currentTime),this.currentTime.equalityComparer=Z.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Te.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Te.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Te.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Te.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Te.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Te.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(hk.prototype,{clock:{get:function(){return this._clock}}});hk.prototype.synchronize=function(){let e=this._clock;this.systemTime=Z.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};hk.prototype.isDestroyed=function(){return!1};hk.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var mk=hk;function XSt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,he.throwInstantiationError()}var bQ=XSt;var pk={};pk.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};pk.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};pk.createRangeInput=function(e,t,n,i,o,r){r=y(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};pk.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Ka=pk;function fEe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Te.track(this,["toggled","tooltip"])}Object.defineProperties(fEe.prototype,{command:{get:function(){return this._command}}});var q0=fEe;function KSt(e,t){t=y(t,!0);let n=new pe,i=new pe;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Te.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var En=KSt;function ZSt(e,t,n,i,o){return n.call(i,e[t]),Te.getObservable(e,t).subscribe(n,i,o)}var Sa=ZSt;var LC="http://www.w3.org/2000/svg",mEe="http://www.w3.org/1999/xlink",GG,_k=H.fromCssColorString("rgba(247,250,255,0.384)"),WG=H.fromCssColorString("rgba(143,191,255,0.216)"),TQ=H.fromCssColorString("rgba(153,197,255,0.098)"),jG=H.fromCssColorString("rgba(255,255,255,0.086)"),$St=H.fromCssColorString("rgba(255,255,255,0.267)"),QSt=H.fromCssColorString("rgba(255,255,255,0)"),dEe=H.fromCssColorString("rgba(66,67,68,0.3)"),hEe=H.fromCssColorString("rgba(0,0,0,0.5)");function Y0(e){return H.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var gk={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Zh(e){let t=document.createElementNS(LC,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(Zh(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(mEe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function CQ(e,t,n){let i=document.createElementNS(LC,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(LC,"tspan");return o.textContent=n,i.appendChild(o),i}function JSt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var qG=new H;function ls(e,t){let n=t.alpha,i=1-n;return qG.red=e.red*i+t.red*n,qG.green=e.green*i+t.green*n,qG.blue=e.blue*i+t.blue*n,qG.toCssColorString()}function AQ(e,t,n){let i=gk[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Zh(o)}function evt(e,t,n){let i=gk[n],o=gk.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Zh(r)}function tvt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&GG!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-o-a.left,p=u-r-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(GG=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===GG&&(GG=void 0),n.shuttleRingDragging=!1}function Rg(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Sa(t,"toggled",this.setToggled,this),Sa(t,"tooltip",this.setTooltip,this),Sa(t.command,"canExecute",this.setEnabled,this)]}Rg.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};Rg.prototype.isDestroyed=function(){return!1};Rg.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Rg.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};Rg.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function Kv(e,t){e=In(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(LC,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mEe);let s=document.createElementNS(LC,"g");this._topG=s,this._realtimeSVG=new Rg(evt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Rg(AQ(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Rg(AQ(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Rg(AQ(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(LC,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Zh({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=gk.animation_pathSwooshFX,f=gk.animation_pathPointer,d=Zh({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Zh({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Zh({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Zh({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=Zh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=CQ(0,-24,""),this._knobTime=CQ(0,-7,""),this._knobStatus=CQ(0,-41,"");let x=Zh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),b=document.createElementNS(LC,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(c),b.appendChild(d),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let T=this;function C(O){tvt(T,O)}this._mouseCallback=C,c.addEventListener("mousedown",C,!0),c.addEventListener("touchstart",C,!0),d.addEventListener("mousedown",C,!0),d.addEventListener("touchstart",C,!0),n.addEventListener("mousemove",C,!0),n.addEventListener("touchmove",C,!0),n.addEventListener("mouseup",C,!0),n.addEventListener("touchend",C,!0),n.addEventListener("touchcancel",C,!0),this._shuttleRingPointer.addEventListener("mousedown",C,!0),this._shuttleRingPointer.addEventListener("touchstart",C,!0),this._knobOuter.addEventListener("mousedown",C,!0),this._knobOuter.addEventListener("touchstart",C,!0);let A=this._knobTime.childNodes[0],E=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],D;this._subscriptions=[Sa(t.pauseViewModel,"toggled",function(O){D!==O&&(D=O,D?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Sa(t,"shuttleRingAngle",function(O){JSt(T._shuttleRingPointer,T._knobOuter,O)}),Sa(t,"dateLabel",function(O){E.textContent!==O&&(E.textContent=O)}),Sa(t,"timeLabel",function(O){A.textContent!==O&&(A.textContent=O)}),Sa(t,"multiplierLabel",function(O){v.textContent!==O&&(v.textContent=O)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(Kv.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Kv.prototype.isDestroyed=function(){return!1};Kv.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return ue(this)};Kv.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};Kv.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=Y0(this._themeNormal),n=Y0(this._themeHover),i=Y0(this._themeSelect),o=Y0(this._themeDisabled),r=Y0(this._themeKnob),s=Y0(this._themePointer),a=Y0(this._themeSwoosh),c=Y0(this._themeSwooshHover),u=Zh({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ls(t,_k)},{tagName:"stop",offset:"12%","stop-color":ls(t,WG)},{tagName:"stop",offset:"46%","stop-color":ls(t,TQ)},{tagName:"stop",offset:"81%","stop-color":ls(t,jG)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ls(n,_k)},{tagName:"stop",offset:"12%","stop-color":ls(n,WG)},{tagName:"stop",offset:"46%","stop-color":ls(n,TQ)},{tagName:"stop",offset:"81%","stop-color":ls(n,jG)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ls(i,_k)},{tagName:"stop",offset:"12%","stop-color":ls(i,WG)},{tagName:"stop",offset:"46%","stop-color":ls(i,TQ)},{tagName:"stop",offset:"81%","stop-color":ls(i,jG)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":ls(o,$St)},{tagName:"stop",offset:"75%","stop-color":ls(o,QSt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":ls(s,hEe)},{tagName:"stop",offset:"100%","stop-color":ls(s,hEe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":ls(r,_k)},{tagName:"stop",offset:"60%","stop-color":ls(r,dEe)},{tagName:"stop",offset:"85%","stop-color":ls(r,WG)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":ls(r,dEe)},{tagName:"stop",offset:"60%","stop-color":ls(r,_k)},{tagName:"stop",offset:"85%","stop-color":ls(r,jG)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var yk=Kv;var nvt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],X0=15,Zv=105;function pEe(e,t){return e-t}function EQ(e,t){let n=Mo(t,e,pEe);return n<0?~n:n}function ivt(e,t){if(Math.abs(e)<=X0)return e/X0;let n=X0,i=Zv,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function ovt(e,t,n){if(n.clockStep===_o.SYSTEM_CLOCK)return X0;if(Math.abs(e)<=1)return e*X0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=X0,r=Zv,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function Ad(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Ad.defaultDateFormatter,this._timeFormatter=Ad.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Te.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Ad.defaultTicks),this.timeLabel=void 0,Te.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Te.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Te.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===_o.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Te.defineProperty(this,"shuttleRingAngle",{get:function(){return ovt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,Zv),-Zv);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===Zv){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=ivt(s,a);if(t.snapToTicks)u=a[EQ(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>X0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Te.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Yr.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d=!1;if(a===Yr.LOOP_STOP)d=Z.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=Z.greaterThan(u,f)&&Z.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,Te.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Yr.UNBOUNDED)return!0;let c=s.systemTime;return Z.greaterThanOrEquals(c,s.startTime)&&Z.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Te.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=En(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new q0(n,{toggled:Te.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=En(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new q0(i,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=En(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new q0(o,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==_o.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=En(function(){t._clockViewModel.clockStep=_o.SYSTEM_CLOCK},Te.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new q0(r,{toggled:Te.computed(function(){return e.clockStep===_o.SYSTEM_CLOCK}),tooltip:Te.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=EQ(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=En(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=EQ(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Ad.defaultDateFormatter=function(e,t){let n=Z.toGregorianDate(e);return`${nvt[n.month-1]} ${n.day} ${n.year}`};Ad.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Ad.defaultTimeFormatter=function(e,t){let n=Z.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Ad.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Ad.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(pEe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(Ad.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Ad._maxShuttleRingAngle=Zv;Ad._realtimeShuttleRingAngle=X0;var xk=Ad;function _Ee(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Te.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Te.getObservable(this,"imageryProviderViewModels"),r=Te.pureComputed(function(){let d=o(),p={},g;for(g=0;g<d.length;g++){let b=d[g],T=b.category;l(p[T])?p[T].push(b):p[T]=[b]}let m=Object.keys(p),x=[];for(g=0;g<m.length;g++){let b=m[g];x.push({name:b,providers:p[b]})}return x});this._imageryProviders=r;let s=Te.getObservable(this,"terrainProviderViewModels"),a=Te.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let b=d[g],T=b.category;l(p[T])?p[T].push(b):p[T]=[b]}let m=Object.keys(p),x=[];for(g=0;g<m.length;g++){let b=m[g];x.push({name:b,providers:p[b]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Te.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g} +${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,Te.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=Te.observable();this._currentImageryLayers=[],Te.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,x=this._globe.imageryLayers,b=!1;for(p=0;p<m;p++){let T=x.length;for(let C=0;C<T;C++){let A=x.get(C);if(A===g[p]){x.remove(A),b=!0;break}}}if(l(d)){let T=d.creationCommand();if(Array.isArray(T)){let C=T.length;for(this._currentImageryLayers=[],p=C-1;p>=0;p--){let A=qa.fromProviderAsync(T[p]);x.add(A,0),this._currentImageryLayers.push(A)}}else{this._currentImageryLayers=[];let C=qa.fromProviderAsync(T);if(C.name=d.name,b)x.add(C,0);else{let A=x.get(0);l(A)&&x.remove(A),x.add(C,0)}this._currentImageryLayers.push(C)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Te.observable();Te.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof Qm),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),b=new sk(p).readyEvent.addEventListener(T=>{g||(this._globe.depthTestAgainstTerrain=!(T instanceof Qm),this._globe.terrainProvider=T,b())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=En(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(_Ee.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var bk=_Ee;function YG(e,t){e=In(e);let n=new bk(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",x.appendChild(b);let T=document.createElement("div");T.className="cesium-baseLayerPicker-categoryTitle",T.setAttribute("data-bind","text: name"),b.appendChild(T);let C=document.createElement("div");C.className="cesium-baseLayerPicker-choices",C.setAttribute("data-bind","foreach: providers"),b.appendChild(C);let A=document.createElement("div");A.className="cesium-baseLayerPicker-item",A.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),C.appendChild(A);let E=document.createElement("img");E.className="cesium-baseLayerPicker-itemIcon",E.setAttribute("data-bind","attr: { src: iconUrl }"),E.setAttribute("draggable","false"),A.appendChild(E);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),A.appendChild(v),Te.applyBindings(n,i),Te.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(D){i.contains(D.target)||r.contains(D.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(YG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YG.prototype.isDestroyed=function(){return!1};YG.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._element),Te.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var Tk=YG;function gEe(e){let t=e.creationFunction;l(t.canExecute)||(t=En(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),Te.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(gEe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var us=gEe;function rvt(){let e=[],t=devicePixelRatio>=2;return e.push(new us({name:"Bing Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return dg({style:fg.AERIAL})}})),e.push(new us({name:"Bing Maps Aerial with Labels",iconUrl:en("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return dg({style:fg.AERIAL_WITH_LABELS})}})),e.push(new us({name:"Bing Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return dg({style:fg.ROAD})}})),e.push(new us({name:"ArcGIS World Imagery",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return lg.fromBasemapType(Fh.SATELLITE,{enablePickFeatures:!1})}})),e.push(new us({name:"ArcGIS World Hillshade",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return lg.fromBasemapType(Fh.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new us({name:"Esri World Ocean",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return lg.fromBasemapType(Fh.OCEANS,{enablePickFeatures:!1})}})),e.push(new us({name:"Open\xADStreet\xADMap",iconUrl:en("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. +http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new Pg({url:"https://tile.openstreetmap.org/"})}})),e.push(new us({name:"Stadia x Stamen Watercolor",iconUrl:en("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. +https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new Pg({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new us({name:"Stadia x Stamen Toner",iconUrl:nn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays. -https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new Rg({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new us({name:"Stadia x Stamen Toner",iconUrl:en("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays. +https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new Pg({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new us({name:"Stadia Alidade Smooth",iconUrl:nn("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine. -https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new Rg({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new us({name:"Stadia Alidade Smooth",iconUrl:en("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine. +https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new Pg({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new us({name:"Stadia Alidade Smooth Dark",iconUrl:nn("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. -https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new Rg({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new us({name:"Stadia Alidade Smooth Dark",iconUrl:en("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. +https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new Pg({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new us({name:"Sentinel-2",iconUrl:nn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return fg.fromAssetId(3954)}})),e.push(new us({name:"Blue Marble",iconUrl:nn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return fg.fromAssetId(3845)}})),e.push(new us({name:"Earth at night",iconUrl:nn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return fg.fromAssetId(3812)}})),e.push(new us({name:"Natural Earth\xA0II",iconUrl:nn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return D0.fromUrl(nn("Assets/Textures/NaturalEarthII"))}})),e}var Sk=ivt;function ovt(){let e=[];return e.push(new us({name:"WGS84 Ellipsoid",iconUrl:nn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new ep({ellipsoid:ee.WGS84})}})),e.push(new us({name:"Cesium World Terrain",iconUrl:nn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return EC({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var vk=ovt;function rvt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof xs&&(e.tileset=n.primitive),e.pickActive=!1}}function gEe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof xs&&(e.tileset=i.primitive)},bn.MOUSE_MOVE):(e._eventHandler.removeInputAction(bn.MOUSE_MOVE),e.picking=e.picking)}var svt={maximumFractionDigits:3};function wk(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,svt):Math.round(t).toLocaleString()}function Dk(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Vo.PICK]:e._statisticsPerPass[Vo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${wk(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${wk(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${wk(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function yEe(){let e=Ei.statistics;return` + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new us({name:"Sentinel-2",iconUrl:en("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return ug.fromAssetId(3954)}})),e.push(new us({name:"Blue Marble",iconUrl:en("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return ug.fromAssetId(3845)}})),e.push(new us({name:"Earth at night",iconUrl:en("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return ug.fromAssetId(3812)}})),e.push(new us({name:"Natural Earth\xA0II",iconUrl:en("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return E0.fromUrl(en("Assets/Textures/NaturalEarthII"))}})),e}var Ck=rvt;function svt(){let e=[];return e.push(new us({name:"WGS84 Ellipsoid",iconUrl:en("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Qm({ellipsoid:ee.WGS84})}})),e.push(new us({name:"Cesium World Terrain",iconUrl:en("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return EC({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var Ak=svt;function avt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function SQ(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var cvt=new hn,lvt=new h;function Ek(e,t){let n=this,i=e.canvas,o=new of(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Te.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=En(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=En(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=En(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Te.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Te.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Te.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new pg({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=En(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Te.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=En(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new q3({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Te.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=En(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Te.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Te.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Te.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=En(function(){let u=n.depthFrustum+1;return n.depthFrustum=SQ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=En(function(){let u=n.depthFrustum-1;return n.depthFrustum=SQ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Te.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=En(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new ck({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Te.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Te.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=En(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=En(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Te.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=En(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Te.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,bn.LEFT_CLICK):o.removeInputAction(bn.LEFT_CLICK)});function c(u){let f,d=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,cvt),g=r.pick(p,n._scene,lvt);if(l(g)){let m=d.cartesianToCartographic(g),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<x.length;++b){let T=x[b];if(l(T))for(let C=0;!f&&C<T.length;++C){let A=T[C];se.contains(A.rectangle,m)&&(f=A)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=En(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Te.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,bn.LEFT_CLICK):o.removeInputAction(bn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(Ek.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return En(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return En(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return En(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return En(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return En(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});Ek.prototype._update=function(){this.frustums&&(this.frustumStatisticText=avt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=SQ(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};Ek.prototype.isDestroyed=function(){return!1};Ek.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var Sk=Ek;function XG(e,t){e=In(e);let n=document.createElement("div"),i=new Sk(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=Ka.createSection,c=Ka.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(b);let T=document.createElement("input");T.type="button",T.value="+",T.className="cesium-cesiumInspector-pickButton",T.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(T);let C=a(s,"Primitives","primitivesVisible","togglePrimitives"),A=document.createElement("div");A.className="cesium-cesiumInspector-pickSection",C.appendChild(A);let E=document.createElement("input");E.type="button",E.value="Pick a primitive",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(E),A.appendChild(v),A.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),A.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),A.appendChild(this._primitiveOnly);let D=a(s,"Terrain","terrainVisible","toggleTerrain"),O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",D.appendChild(O);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",O.appendChild(v);let M=document.createElement("div");O.appendChild(M);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let S=document.createElement("input");S.type="button",S.value="NE",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let L=document.createElement("div");L.className="cesium-cesiumInspector-tileText",M.className="cesium-cesiumInspector-frustumStatistics",M.appendChild(L),M.setAttribute("data-bind","visible: hasPickedTile"),L.setAttribute("data-bind","html: tileText");let B=document.createElement("div");B.className="cesium-cesiumInspector-relativeText",B.textContent="Select relative:",M.appendChild(B);let U=document.createElement("table"),V=document.createElement("tr"),G=document.createElement("tr"),k=document.createElement("td");k.appendChild(N);let W=document.createElement("td");W.appendChild(_);let q=document.createElement("td");q.appendChild(S),V.appendChild(k),V.appendChild(W),V.appendChild(q);let J=document.createElement("td"),j=document.createElement("td");j.appendChild(w);let K=document.createElement("td");K.appendChild(I),G.appendChild(J),G.appendChild(j),G.appendChild(K),U.appendChild(V),U.appendChild(G),M.appendChild(U),O.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),O.appendChild(c("Show only selected","filterTile","hasPickedTile")),D.appendChild(c("Wireframe","wireframe")),D.appendChild(c("Suspend LOD update","suspendUpdates")),D.appendChild(c("Show tile coordinates","tileCoordinates")),Te.applyBindings(i,this._element)}Object.defineProperties(XG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});XG.prototype.isDestroyed=function(){return!1};XG.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var vk=XG;function uvt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof xs&&(e.tileset=n.primitive),e.pickActive=!1}}function xEe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof xs&&(e.tileset=i.primitive)},bn.MOUSE_MOVE):(e._eventHandler.removeInputAction(bn.MOUSE_MOVE),e.picking=e.picking)}var fvt={maximumFractionDigits:3};function wk(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,fvt):Math.round(t).toLocaleString()}function Dk(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Uo.PICK]:e._statisticsPerPass[Uo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${wk(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${wk(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${wk(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function bEe(){let e=Si.statistics;return` <ul class="cesium-cesiumInspector-statistics"> <li><strong>Geometry Memory (MB): </strong>${wk(e.geometryByteLength)}</li> <li><strong>Texture Memory (MB): </strong>${wk(e.texturesByteLength)}</li> </ul> - `}var avt=[{text:"Highlight",value:Nl.HIGHLIGHT},{text:"Replace",value:Nl.REPLACE},{text:"Mix",value:Nl.MIX}],_Ee=new H(1,1,0,.4),cvt=new H,$G=new H;function Aa(e,t){let n=this,i=e.canvas;this._eventHandler=new of(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new _g({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,be.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=be.observable({}),this.properties=[],be.defineProperty(this,"properties",function(){let k=[],W=n._properties();for(let j in W)W.hasOwnProperty(j)&&k.push(j);return k});let o=be.observable();be.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=be.observable();be.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=Nl.HIGHLIGHT;let s=be.observable(),a=be.observable();be.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(W){let j=e.pick(W.endPosition);if(j instanceof Ws?(n.feature=j,n.tile=j.content.tile):l(j)&&l(j.content)?(n.feature=void 0,n.tile=j.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(j)&&l(j.content)){let J;e.pickPositionSupported&&(J=e.pickPosition(W.endPosition),l(J)&&(n._tileset.debugPickPosition=J)),n._tileset.debugPickedTile=j.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},bn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(bn.MOUSE_MOVE))}}),this.picking=!0;let c=be.observable();be.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=be.observable();be.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=be.observable();be.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=be.observable();be.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=be.observable();be.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=be.observable();be.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,be.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=be.observable();be.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=be.observable();be.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=be.observable();be.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let T=be.observable();be.defineProperty(this,"showUrl",{get:function(){return T()},set:function(k){T(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let C=be.observable();be.defineProperty(this,"maximumScreenSpaceError",{get:function(){return C()},set:function(k){k=Number(k),isNaN(k)||(C(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let A=be.observable();be.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,be.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(A(),1/6)},set:function(k){let W=Math.pow(k,6);A(W),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=W)}});let E=be.observable();be.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let v=rvt(this),D=be.observable();be.defineProperty(this,"pickActive",{get:function(){return D()},set:function(k){D(k),k?n._eventHandler.setInputAction(v,bn.LEFT_CLICK):n._eventHandler.removeInputAction(bn.LEFT_CLICK)}});let O=be.observable();be.defineProperty(this,"pointCloudShading",{get:function(){return O()},set:function(k){O(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=be.observable();be.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let M=be.observable();be.defineProperty(this,"maximumAttenuation",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let N=be.observable();be.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=be.observable();be.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let S=be.observable();be.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return S()},set:function(k){k=Number(k),isNaN(k)||(S(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=be.observable();be.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=be.observable();be.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let L=be.observable();be.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let B=be.observable();be.defineProperty(this,"baseScreenSpaceError",{get:function(){return B()},set:function(k){k=Number(k),isNaN(k)||(B(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let U=be.observable();be.defineProperty(this,"skipLevels",{get:function(){return U()},set:function(k){k=Number(k),isNaN(k)||(U(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let V=be.observable();be.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(k){V(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let G=be.observable();be.defineProperty(this,"loadSiblings",{get:function(){return G()},set:function(k){G(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||gEe(this,!0)}Object.defineProperties(Aa.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return avt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=Dk(e,!1),this._pickStatisticsText=Dk(e,!0),this._resourceCacheStatisticsText=yEe(),gEe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,cvt):H.WHITE:t.color=$G,this._scene.requestRender()),l(e)&&(H.clone(e.color,$G),e.color=_Ee,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!vQ(t.content)&&(t.color=$G,this._scene.requestRender()),l(e)&&!vQ(e.content)&&(H.clone(e.color,$G),e.color=_Ee,this._scene.requestRender()),this._tile=e}}});function vQ(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!vQ(t[i]))return!1;return!0}return!1}Aa.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Aa.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Aa.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Aa.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Aa.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Aa.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Aa.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Aa.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Aa.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Aa.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Aa.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new vC(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Aa.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` + `}var dvt=[{text:"Highlight",value:Nl.HIGHLIGHT},{text:"Replace",value:Nl.REPLACE},{text:"Mix",value:Nl.MIX}],yEe=new H(1,1,0,.4),hvt=new H,KG=new H;function va(e,t){let n=this,i=e.canvas;this._eventHandler=new of(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new pg({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Te.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Te.observable({}),this.properties=[],Te.defineProperty(this,"properties",function(){let k=[],W=n._properties();for(let q in W)W.hasOwnProperty(q)&&k.push(q);return k});let o=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=Te.observable();Te.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=Nl.HIGHLIGHT;let s=Te.observable(),a=Te.observable();Te.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(W){let q=e.pick(W.endPosition);if(q instanceof Ws?(n.feature=q,n.tile=q.content.tile):l(q)&&l(q.content)?(n.feature=void 0,n.tile=q.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(q)&&l(q.content)){let J;e.pickPositionSupported&&(J=e.pickPosition(W.endPosition),l(J)&&(n._tileset.debugPickPosition=J)),n._tileset.debugPickedTile=q.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},bn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(bn.MOUSE_MOVE))}}),this.picking=!0;let c=Te.observable();Te.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=Te.observable();Te.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=Te.observable();Te.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=Te.observable();Te.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Te.observable();Te.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Te.observable();Te.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Te.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=Te.observable();Te.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Te.observable();Te.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=Te.observable();Te.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let T=Te.observable();Te.defineProperty(this,"showUrl",{get:function(){return T()},set:function(k){T(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let C=Te.observable();Te.defineProperty(this,"maximumScreenSpaceError",{get:function(){return C()},set:function(k){k=Number(k),isNaN(k)||(C(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let A=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Te.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(A(),1/6)},set:function(k){let W=Math.pow(k,6);A(W),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=W)}});let E=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let v=uvt(this),D=Te.observable();Te.defineProperty(this,"pickActive",{get:function(){return D()},set:function(k){D(k),k?n._eventHandler.setInputAction(v,bn.LEFT_CLICK):n._eventHandler.removeInputAction(bn.LEFT_CLICK)}});let O=Te.observable();Te.defineProperty(this,"pointCloudShading",{get:function(){return O()},set:function(k){O(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=Te.observable();Te.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let M=Te.observable();Te.defineProperty(this,"maximumAttenuation",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let N=Te.observable();Te.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=Te.observable();Te.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let S=Te.observable();Te.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return S()},set:function(k){k=Number(k),isNaN(k)||(S(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=Te.observable();Te.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Te.observable();Te.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let L=Te.observable();Te.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let B=Te.observable();Te.defineProperty(this,"baseScreenSpaceError",{get:function(){return B()},set:function(k){k=Number(k),isNaN(k)||(B(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let U=Te.observable();Te.defineProperty(this,"skipLevels",{get:function(){return U()},set:function(k){k=Number(k),isNaN(k)||(U(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let V=Te.observable();Te.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(k){V(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let G=Te.observable();Te.defineProperty(this,"loadSiblings",{get:function(){return G()},set:function(k){G(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||xEe(this,!0)}Object.defineProperties(va.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return dvt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=Dk(e,!1),this._pickStatisticsText=Dk(e,!0),this._resourceCacheStatisticsText=bEe(),xEe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,hvt):H.WHITE:t.color=KG,this._scene.requestRender()),l(e)&&(H.clone(e.color,KG),e.color=yEe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!vQ(t.content)&&(t.color=KG,this._scene.requestRender()),l(e)&&!vQ(e.content)&&(H.clone(e.color,KG),e.color=yEe,this._scene.requestRender()),this._tile=e}}});function vQ(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!vQ(t[i]))return!1;return!0}return!1}va.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};va.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};va.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};va.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};va.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};va.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};va.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};va.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};va.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};va.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};va.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new vC(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};va.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` `),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};Aa.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=Dk(e,!1),this._pickStatisticsText=Dk(e,!0),this._resourceCacheStatisticsText=yEe())};Aa.prototype.isDestroyed=function(){return!1};Aa.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){be.getObservable(e,t).dispose()}),ue(this)};Aa.getStatistics=Dk;var Ik=Aa;function QG(e,t){e=In(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new Ik(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Ya.createSection,c=Ya.createCheckbox,u=Ya.createRangeInput,f=Ya.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),T=a(s,"Optimization","optimizationVisible","toggleOptimization"),C=document.createElement("div");C.className="field-group";let A=document.createElement("label");A.className="field-label",A.appendChild(document.createTextNode("Properties: "));let E=document.createElement("div");E.setAttribute("data-bind","text: properties"),C.appendChild(A),C.appendChild(E),d.appendChild(C),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),D=document.createElement("p");D.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),D.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),D.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(D),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let O=document.createElement("div");O.setAttribute("data-bind","visible: pointCloudShading"),O.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),O.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),O.appendChild(u("Base Resolution","baseResolution",0,1,.01)),O.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(O);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),O.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let M=document.createElement("div");M.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(M);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(N),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(c("Pick Statistics","showPickStatistics"));let S=document.createElement("div");S.className="cesium-3dTilesInspector-statistics",S.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(S),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(w);let I=document.createElement("div");b.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let L=document.createElement("select");L.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(L);let B=document.createElement("textarea");B.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(B);let U=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(U);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),T.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let G=document.createElement("div");G.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),T.appendChild(G);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),T.appendChild(k);let W=document.createElement("div");W.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),T.appendChild(W),T.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),T.appendChild(c("Load siblings of visible tiles","loadSiblings")),be.applyBindings(o,n)}Object.defineProperties(QG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});QG.prototype.isDestroyed=function(){return!1};QG.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var Pk=QG;function JG(e,t){l(t)||(t=document.body),t=In(t);let n=this,i=be.observable(xr.fullscreen),o=be.observable(xr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,be.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,be.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&xr.enabled)}}),this.tooltip=void 0,be.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=En(function(){xr.fullscreen?xr.exitFullscreen():xr.requestFullscreen(n._fullscreenElement)},be.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(In(e),r.body),this._callback=function(){i(xr.fullscreen)},r.addEventListener(xr.changeEventName,this._callback)}Object.defineProperties(JG.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});JG.prototype.isDestroyed=function(){return!1};JG.prototype.destroy=function(){document.removeEventListener(xr.changeEventName,this._callback),ue(this)};var Rk=JG;var lvt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",uvt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function e5(e,t){e=In(e);let n=new Rk(t,e);n._exitFullScreenPath=uvt,n._enterFullScreenPath=lvt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),be.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(e5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});e5.prototype.isDestroyed=function(){return!1};e5.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Ok=e5;var xEe=1e3;function Sd(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new CC({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new me,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=TEe,this._handleArrowUp=bEe;let t=this;this._suggestionsVisible=be.pureComputed(function(){let o=be.getObservable(t,"_suggestions")().length>0,r=be.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=En(function(i){if(i=y(i,W0.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)_vt(t);else return mvt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?bEe(t):r?TEe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;EEe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Sd.flyToDestination),this._focusTextbox=!1,be.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=be.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Sd._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,be.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,be.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,be.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Sd.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Sd.prototype.destroy=function(){this._suggestionSubscription.dispose()};function bEe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Sd._adjustSuggestionsScroll(e,n)}function TEe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Sd._adjustSuggestionsScroll(e,i)}function fvt(e,t){let n=l(t)?t.availability:void 0;return l(n)?LT(t,[e]).then(function(i){return e=i[0],e.height+=xEe,e}):(e.height+=xEe,Promise.resolve(e))}function dvt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof se?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=se.center(t):a=NT(t,n):t=i.cartesianToCartographic(t),l(a)||(a=fvt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function hvt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function mvt(e,t,n){let i=e._searchText;if(AEe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await hvt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,DQ(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=CEe(e,Fv.getCreditsFromResult(s[0]));l(a)||wQ(e,t[o].credit);return}e._searchText=`${i} (not found)`}function wQ(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function CEe(e,t){return l(t)&&t.forEach(n=>wQ(e,n)),t}function DQ(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function pvt(e,t){let n=In(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function _vt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function AEe(e){return/^\s*$/.test(e)}function EEe(e){be.getObservable(e,"_suggestions").removeAll()}async function gvt(e){if(!e.autoComplete)return;let t=e._searchText;if(EEe(e),DQ(e),!AEe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,W0.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=Fv.getCreditsFromResult(r);o=o&&!l(s),CEe(e,s)}),o&&wQ(e,n.credit)}if(e._suggestions.length>=5)return}}Sd.flyToDestination=dvt;Sd._updateSearchSuggestions=gvt;Sd._adjustSuggestionsScroll=pvt;Sd.prototype.isDestroyed=function(){return!1};Sd.prototype.destroy=function(){return DQ(this),ue(this)};var Mk=Sd;var yvt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",xvt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function t5(e){let t=In(e.container),n=new Mk(e);n._startSearchPath=yvt,n._stopSearchPath=xvt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),be.applyBindings(n,i),be.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},Ht.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(t5.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});t5.prototype.isDestroyed=function(){return!1};t5.prototype.destroy=function(){let e=this._container;return Ht.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),be.cleanNode(this._form),be.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var Lk=t5;function SEe(e,t){this._scene=e,this._duration=t;let n=this;this._command=En(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",be.track(this,["tooltip"])}Object.defineProperties(SEe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var Nk=SEe;function n5(e,t,n){e=In(e);let i=new Nk(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),be.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(n5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});n5.prototype.isDestroyed=function(){return!1};n5.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Fk=n5;function bvt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function wEe(e,t){be.track(e);for(let n=0;n<e.sublayers.length;n++)wEe(e.sublayers[n],t)}function i5(e){return e.modelName==="FullModel"}function DEe(e){return e.modelName==="Overview"}function IEe(e){return DEe(e)||i5(e)}function vEe(e,t){if(IEe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:be.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function Tvt(e,t){if(IEe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");i5(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function Cvt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function Avt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:be.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:be.observable(!0),index:-1}],currentLayer:be.observable(),expandClickHandler:bvt,setOptionDisable:function(i,o){be.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){Tvt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){wEe(n[i],this.viewModel);let o=vEe(n[i],this.viewModel);l(o)&&(DEe(o)||!l(this.viewModel.defaultLayer)&&i5(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=vEe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=i5(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return Cvt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var Bk=Avt;function Evt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` +`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};va.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=Dk(e,!1),this._pickStatisticsText=Dk(e,!0),this._resourceCacheStatisticsText=bEe())};va.prototype.isDestroyed=function(){return!1};va.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),ue(this)};va.getStatistics=Dk;var Ik=va;function ZG(e,t){e=In(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new Ik(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Ka.createSection,c=Ka.createCheckbox,u=Ka.createRangeInput,f=Ka.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),T=a(s,"Optimization","optimizationVisible","toggleOptimization"),C=document.createElement("div");C.className="field-group";let A=document.createElement("label");A.className="field-label",A.appendChild(document.createTextNode("Properties: "));let E=document.createElement("div");E.setAttribute("data-bind","text: properties"),C.appendChild(A),C.appendChild(E),d.appendChild(C),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),D=document.createElement("p");D.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),D.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),D.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(D),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let O=document.createElement("div");O.setAttribute("data-bind","visible: pointCloudShading"),O.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),O.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),O.appendChild(u("Base Resolution","baseResolution",0,1,.01)),O.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(O);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),O.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let M=document.createElement("div");M.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(M);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(N),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(c("Pick Statistics","showPickStatistics"));let S=document.createElement("div");S.className="cesium-3dTilesInspector-statistics",S.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(S),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(w);let I=document.createElement("div");b.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let L=document.createElement("select");L.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(L);let B=document.createElement("textarea");B.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(B);let U=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(U);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),T.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let G=document.createElement("div");G.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),T.appendChild(G);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),T.appendChild(k);let W=document.createElement("div");W.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),T.appendChild(W),T.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),T.appendChild(c("Load siblings of visible tiles","loadSiblings")),Te.applyBindings(o,n)}Object.defineProperties(ZG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ZG.prototype.isDestroyed=function(){return!1};ZG.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var Pk=ZG;function $G(e,t){l(t)||(t=document.body),t=In(t);let n=this,i=Te.observable(xr.fullscreen),o=Te.observable(xr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Te.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Te.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&xr.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=En(function(){xr.fullscreen?xr.exitFullscreen():xr.requestFullscreen(n._fullscreenElement)},Te.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(In(e),r.body),this._callback=function(){i(xr.fullscreen)},r.addEventListener(xr.changeEventName,this._callback)}Object.defineProperties($G.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});$G.prototype.isDestroyed=function(){return!1};$G.prototype.destroy=function(){document.removeEventListener(xr.changeEventName,this._callback),ue(this)};var Rk=$G;var mvt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",pvt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function QG(e,t){e=In(e);let n=new Rk(t,e);n._exitFullScreenPath=pvt,n._enterFullScreenPath=mvt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Te.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(QG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});QG.prototype.isDestroyed=function(){return!1};QG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Ok=QG;var TEe=1e3;function Ed(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new CC({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new pe,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=AEe,this._handleArrowUp=CEe;let t=this;this._suggestionsVisible=Te.pureComputed(function(){let o=Te.getObservable(t,"_suggestions")().length>0,r=Te.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=En(function(i){if(i=y(i,U0.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)Tvt(t);else return xvt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?CEe(t):r?AEe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;vEe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,Ed.flyToDestination),this._focusTextbox=!1,Te.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Te.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Ed._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Te.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Te.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Te.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Ed.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Ed.prototype.destroy=function(){this._suggestionSubscription.dispose()};function CEe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Ed._adjustSuggestionsScroll(e,n)}function AEe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Ed._adjustSuggestionsScroll(e,i)}function _vt(e,t){let n=l(t)?t.availability:void 0;return l(n)?LT(t,[e]).then(function(i){return e=i[0],e.height+=TEe,e}):(e.height+=TEe,Promise.resolve(e))}function gvt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof se?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=se.center(t):a=NT(t,n):t=i.cartesianToCartographic(t),l(a)||(a=_vt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function yvt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function xvt(e,t,n){let i=e._searchText;if(SEe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await yvt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,DQ(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=EEe(e,Fv.getCreditsFromResult(s[0]));l(a)||wQ(e,t[o].credit);return}e._searchText=`${i} (not found)`}function wQ(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function EEe(e,t){return l(t)&&t.forEach(n=>wQ(e,n)),t}function DQ(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function bvt(e,t){let n=In(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function Tvt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function SEe(e){return/^\s*$/.test(e)}function vEe(e){Te.getObservable(e,"_suggestions").removeAll()}async function Cvt(e){if(!e.autoComplete)return;let t=e._searchText;if(vEe(e),DQ(e),!SEe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,U0.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=Fv.getCreditsFromResult(r);o=o&&!l(s),EEe(e,s)}),o&&wQ(e,n.credit)}if(e._suggestions.length>=5)return}}Ed.flyToDestination=gvt;Ed._updateSearchSuggestions=Cvt;Ed._adjustSuggestionsScroll=bvt;Ed.prototype.isDestroyed=function(){return!1};Ed.prototype.destroy=function(){return DQ(this),ue(this)};var Mk=Ed;var Avt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",Evt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function JG(e){let t=In(e.container),n=new Mk(e);n._startSearchPath=Avt,n._stopSearchPath=Evt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Te.applyBindings(n,i),Te.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},zt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(JG.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});JG.prototype.isDestroyed=function(){return!1};JG.prototype.destroy=function(){let e=this._container;return zt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Te.cleanNode(this._form),Te.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var Lk=JG;function wEe(e,t){this._scene=e,this._duration=t;let n=this;this._command=En(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Te.track(this,["tooltip"])}Object.defineProperties(wEe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var Nk=wEe;function e5(e,t,n){e=In(e);let i=new Nk(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(e5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});e5.prototype.isDestroyed=function(){return!1};e5.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Fk=e5;function Svt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function IEe(e,t){Te.track(e);for(let n=0;n<e.sublayers.length;n++)IEe(e.sublayers[n],t)}function t5(e){return e.modelName==="FullModel"}function PEe(e){return e.modelName==="Overview"}function REe(e){return PEe(e)||t5(e)}function DEe(e,t){if(REe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Te.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function vvt(e,t){if(REe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");t5(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function wvt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function Dvt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Te.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Te.observable(!0),index:-1}],currentLayer:Te.observable(),expandClickHandler:Svt,setOptionDisable:function(i,o){Te.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){vvt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){IEe(n[i],this.viewModel);let o=DEe(n[i],this.viewModel);l(o)&&(PEe(o)||!l(this.viewModel.defaultLayer)&&t5(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=DEe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=t5(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return wvt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var Bk=Dvt;function Ivt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` <h3>Building explorer</h3> <select data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer" @@ -16064,8 +16064,8 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let o=new Bk(t);be.track(o),be.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var IQ=Evt;var Svt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",vvt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function PQ(){this._cameraClicked=new me,this._closeClicked=new me,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",be.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,be.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?vvt:Svt}}),be.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}PQ.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(PQ.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var kk=PQ;function o5(e){e=In(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="×",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new kk;be.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=nn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=Ca(s,"description",function(d){r.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let b=x["background-color"],T=H.fromCssColorString(b);l(T)&&T.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(o5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});o5.prototype.isDestroyed=function(){return!1};o5.prototype.destroy=function(){let e=this._container;return be.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var Vk=o5;function PEe(){this.showInstructions=!1;let e=this;this._command=En(function(){e.showInstructions=!e.showInstructions}),this._showClick=En(function(){e._touch=!1}),this._showTouch=En(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",be.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(PEe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var Uk=PEe;function r5(e){let t=In(e.container),n=new Uk,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=nn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=nn("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),be.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(r5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});r5.prototype.isDestroyed=function(){return!1};r5.prototype.destroy=function(){return Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var zk=r5;function RQ(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,be.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=En(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=K3.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(RQ.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});RQ.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var Hk=RQ;function s5(e){let t=In(e.container),n=new Hk(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),be.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(s5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});s5.prototype.isDestroyed=function(){return!1};s5.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Gk=s5;function a5(e){this._scene=e,this._orthographic=e.camera.frustum instanceof rn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,be.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;be.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=En(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new dr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ne.SCENE2D||t._scene.camera.frustum instanceof rn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(a5.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});a5.prototype.isDestroyed=function(){return!1};a5.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var Wk=a5;var wvt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",Dvt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function c5(e,t){e=In(e);let n=new Wk(t);n._perspectivePath=wvt,n._orthographicPath=Dvt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),be.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(c5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});c5.prototype.isDestroyed=function(){return!1};c5.prototype.destroy=function(){return this._viewModel.destroy(),Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var jk=c5;function l5(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new dr,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",be.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,be.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ne.SCENE2D?n.tooltip2D:o===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=En(function(){e.morphTo2D(n._duration)}),this._morphTo3D=En(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=En(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(l5.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});l5.prototype.isDestroyed=function(){return!1};l5.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var qk=l5;var Ivt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",Pvt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",Rvt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function u5(e,t,n){e=In(e);let i=new qk(t,n);i._globePath=Ivt,i._flatMapPath=Pvt,i._columbusViewPath=Rvt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),be.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(u5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});u5.prototype.isDestroyed=function(){return!1};u5.prototype.destroy=function(){return this._viewModel.destroy(),Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var Yk=u5;var Ovt=new z,f5="-1000px";function Xk(e,t,n){this._scene=e,this._screenPositionX=f5,this._screenPositionY=f5,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,be.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,be.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),be.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return zi.worldToWindowCoordinates(e,i,o)}}Xk.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,Ovt);if(!l(e))this._screenPositionX=f5,this._screenPositionY=f5;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};Xk.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Kr.EXPONENTIAL_OUT})};Xk.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Kr.EXPONENTIAL_OUT})};Object.defineProperties(Xk.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var Kk=Xk;function d5(e,t){e=In(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new Kk(t,this._element,this._container);this._viewModel=c,be.applyBindings(this._viewModel,this._element)}Object.defineProperties(d5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});d5.prototype.isDestroyed=function(){return!1};d5.prototype.destroy=function(){let e=this._container;return be.cleanNode(this._element),e.removeChild(this._element),ue(this)};var Zk=d5;function NC(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}NC.prototype.getHeight=function(){return this._height};NC.prototype.getBase=function(){return this._base};NC.prototype.getStartTime=function(){return this._start};NC.prototype.getStopTime=function(){return this._stop};NC.prototype.setRange=function(e,t){this._start=e,this._stop=t};NC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=Z.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=Z.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var $k=NC;function REe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new H(.5,.5,.5,1),this.backgroundColor=i||new H(0,0,0,0)}REe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=Z.addSeconds(t.startJulian,t.duration,new Z);if(Z.lessThan(n,o)&&Z.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(Z.lessThanOrEquals(n,r)&&Z.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=Z.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new Z);!l(a)&&Z.greaterThanOrEquals(u,n)?a=s:!l(c)&&Z.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var Qk=REe;var OQ=1e12,vd={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},bl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},J0=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],Mvt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Tl(e,t){e=In(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=vd.none,this._touchMode=bl.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=Lvt(this),this._onMouseUp=Nvt(this),this._onMouseMove=Fvt(this),this._onMouseWheel=Bvt(this),this._onTouchStart=kvt(this),this._onTouchMove=Uvt(this),this._onTouchEnd=Vvt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Tl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Tl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Tl.prototype.isDestroyed=function(){return!1};Tl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};Tl.prototype.addHighlightRange=function(e,t,n){let i=new $k(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Tl.prototype.addTrack=function(e,t,n,i){let o=new Qk(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Tl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Z.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Yr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=Z.secondsDifference(o,i),s=Z.secondsDifference(i,this._startJulian),a=Z.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=Z.addSeconds(this._endJulian,s,new Z),this._startJulian=i,this._timeBarSecondsSpan=Z.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=Z.addSeconds(this._startJulian,a,new Z),this._endJulian=o,this._timeBarSecondsSpan=Z.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Tl.prototype.zoomFrom=function(e){let t=Z.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(Z.addSeconds(this._startJulian,t-t*e,new Z),Z.addSeconds(this._endJulian,n*e-n,new Z))};function MQ(e){return e<10?`0${e.toString()}`:e.toString()}Tl.prototype.makeLabel=function(e){let t=Z.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${Mvt[t.month-1]} ${t.day} ${t.year} ${MQ(t.hour)}:${MQ(t.minute)}:${MQ(t.second)}${i}`};Tl.prototype.smallestTicInPixels=7;Tl.prototype._makeTics=function(){let e=this._timeBarEle,t=Z.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=Z.addSeconds(this._startJulian,a,new Z)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=Z.addSeconds(this._startJulian,c,new Z));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),x,b=Z.toGregorianDate(g);d>31536e4?x=Z.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):d>31536e3?x=Z.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):d>86400?x=Z.fromDate(new Date(Date.UTC(b.year,0))):x=Z.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let T=Z.secondsDifference(this._startJulian,Z.addSeconds(x,m,new Z)),C=T+d;this._epochJulian=x;function A(k){return Math.floor(T/k)*k}function E(k,W){return Math.ceil(k/W+.5)*W}function v(k){return(k-T)/d}function D(k,W){return k-W*Math.round(k/W)}this._rulerEle.innerHTML=this.makeLabel(Z.addSeconds(this._endJulian,-a,new Z));let O=this._rulerEle.offsetWidth+20;O<30&&(O=180);let R=f;f-=u;let M={startTime:T,startJulian:g,epochJulian:x,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(M)});let N=0,_=0,S=0,w=O/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let I=-1,L=-1,B=J0.length,U;for(U=0;U<B;++U){let k=J0[U];if(++I,N=k,k>w&&k>f)break;L<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(L=I)}if(I>0){for(;I>0;)if(--I,Math.abs(D(N,J0[I]))<1e-5){J0[I]>=f&&(_=J0[I]);break}if(L>=0)for(;L<I;){if(Math.abs(D(_,J0[L]))<1e-5&&J0[L]>=f){S=J0[L];break}++L}}f=R,f>u&&S<1e-5&&Math.abs(f-N)>u&&(S=f,f<=N+u&&(_=0));let V=-999999,G;if(p*(S/this._timeBarSecondsSpan)>=3)for(o=A(S);o<=C;o=E(o,S))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(o=A(_);o<=C;o=E(o,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,C+=N,o=A(N);let k=Z.computeTaiMinusUtc(x);for(;o<=C;){let W=Z.addSeconds(g,o-T,new Z);if(N>2.1){let K=Z.computeTaiMinusUtc(W);Math.abs(K-k)>.1&&(o+=K-k,W=Z.addSeconds(g,o-T,new Z))}let j=Math.round(p*v(o)),J=this.makeLabel(W);this._rulerEle.innerHTML=J,G=this._rulerEle.offsetWidth,G<10&&(G=O);let q=j-(G/2-1);q>V?(V=q+G+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${j.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${q.toString()}px;">${J}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${j.toString()}px;"></span>`,o=E(o,N)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),M.y=0,this._trackList.forEach(function(k){k.render(r._context,M),M.y+=k.height})};Tl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=Z.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(Z.addSeconds(this._startJulian,this._timelineDrag,new Z),Z.addSeconds(this._endJulian,this._timelineDrag,new Z)))};Tl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=Z.addSeconds(this._startJulian,t,new Z),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function Lvt(e){return function(t){e._mouseMode!==vd.touchOnly&&(t.button===0?(e._mouseMode=vd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=vd.zoom:e._mouseMode=vd.slide)),t.preventDefault()}}function Nvt(e){return function(t){e._mouseMode=vd.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function Fvt(e){return function(t){let n;if(e._mouseMode===vd.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===vd.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(Z.addSeconds(e._startJulian,i,new Z),Z.addSeconds(e._endJulian,i,new Z))}}else e._mouseMode===vd.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function Bvt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;OQ=Math.max(Math.min(Math.abs(n),OQ),1),n/=OQ,e.zoomFrom(Math.pow(1.05,-n))}}function kvt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=vd.touchOnly,n===1?(i=Z.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=bl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=bl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=bl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=bl.ignore}}function Vvt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===bl.singleTap?(e._touchMode=bl.scrub,e._onTouchMove(t)):e._touchMode===bl.scrub&&e._onTouchMove(t),e._mouseMode=vd.touchOnly,n!==1?e._touchMode=n>0?bl.ignore:bl.none:e._touchMode===bl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function Uvt(e){return function(t){let n,i,o,r,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===bl.singleTap&&(e._touchMode=bl.slideZoom),e._mouseMode=vd.touchOnly,e._touchMode===bl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===bl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=Z.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new Z)):(n=e._touchState.centerX-r,a=Z.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new Z)),e.zoomTo(a,Z.addSeconds(a,e._timeBarSecondsSpan*c,new Z)),e._touchState.centerX=r,e._touchState.spanX=s))}}Tl.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var Jk=Tl;var MEe=Ko(OEe(),1);function zvt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function LEe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function Hvt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(LEe(),e._locked=!1),e._noSleep.disable(),xr.exitFullscreen(),n(!1)):(xr.fullscreen||xr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=zvt("landscape")),t.useWebVR=!0,n(!0)))}function h5(e,t){let n=this,i=be.observable(xr.enabled),o=be.observable(!1);this.isVRMode=void 0,be.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,be.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&xr.enabled)}}),this.tooltip=void 0,be.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=be.observable(!1);this._isOrthographic=void 0,be.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new dr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof rn)}),this._locked=!1,this._noSleep=new MEe.default,this._command=En(function(){Hvt(n,e,o,r)},be.getObservable(this,"isVREnabled")),this._vrElement=y(In(t),document.body),this._callback=function(){!xr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(LEe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(xr.changeEventName,this._callback)}Object.defineProperties(h5.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});h5.prototype.isDestroyed=function(){return!1};h5.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(xr.changeEventName,this._callback),ue(this)};var tV=h5;var Gvt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",Wvt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function m5(e,t,n){e=In(e);let i=new tV(t,n);i._exitVRPath=Wvt,i._enterVRPath=Gvt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),be.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(m5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});m5.prototype.isDestroyed=function(){return!1};m5.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var nV=m5;var NEe=new ae;function kEe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function jvt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function qvt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function FEe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof tr)return i;if(n instanceof Ws)return new tr({name:qvt(n),description:jvt(n),feature:n})}if(l(e.scene.globe))return Kvt(e,t.position)}var Yvt=new Z;function NQ(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;Z.equals(i,o)&&(o=Z.addSeconds(i,P.EPSILON2,Yvt)),e.updateFromClock(),e.zoomTo(i,o)}}}var Xvt=new h;function Kvt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new tr({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=BEe();return}let a=s[0],c=new tr({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,Xvt);c.position=new qc(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=BEe())}),r}function BEe(){return new tr({id:"None",description:"No features found."})}function Zvt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Qi(e,t){e=In(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=y(t.scene3DOnly,!1),c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new xh,u=new mk(c),f=!0);let d=new P3(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=d.scene,g=new dr;g.add(c.onTick,Qi.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let W=document.createElement("div");W.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(W),m=new Zk(W,p)}let x;if(!l(t.infoBox)||t.infoBox!==!1){let W=document.createElement("div");W.className="cesium-viewer-infoBoxContainer",o.appendChild(W),x=new Vk(W);let j=x.viewModel;g.add(j.cameraClicked,Qi.prototype._onInfoBoxCameraClicked,this),g.add(j.closeClicked,Qi.prototype._onInfoBoxClockClicked,this)}let b=document.createElement("div");b.className="cesium-viewer-toolbar",o.appendChild(b);let T;if(!l(t.geocoder)||t.geocoder!==!1){let W=document.createElement("div");W.className="cesium-viewer-geocoderContainer",b.appendChild(W);let j;typeof t.geocoder=="string"?j=[new CC({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(j=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),T=new Lk({container:W,geocoderServices:j,scene:p}),g.add(T.viewModel.search.beforeExecute,Qi.prototype._clearObjects,this)}let C;(!l(t.homeButton)||t.homeButton!==!1)&&(C=new Fk(b,p),l(T)&&g.add(C.viewModel.command.afterExecute,function(){let W=T.viewModel;W.searchText="",W.isSearchInProgress&&W.search()}),g.add(C.viewModel.command.beforeExecute,Qi.prototype._clearTrackedObject,this));let A;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(A=new Yk(b,p));let E;t.projectionPicker&&(E=new jk(b,p));let v,D;if(n){let W=y(t.imageryProviderViewModels,Sk()),j=y(t.terrainProviderViewModels,vk());v=new Ek(b,{globe:p.globe,imageryProviderViewModels:W,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:j,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),D=b.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let O;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let W=!0;try{if(l(window.localStorage)){let j=window.localStorage.getItem("cesium-hasSeenNavHelp");l(j)&&j?W=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}O=new zk({container:b,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,W)})}let R;if(!l(t.animation)||t.animation!==!1){let W=document.createElement("div");W.className="cesium-viewer-animationContainer",o.appendChild(W),R=new yk(W,new xk(u))}let M;if(!l(t.timeline)||t.timeline!==!1){let W=document.createElement("div");W.className="cesium-viewer-timelineContainer",o.appendChild(W),M=new Jk(W,c),M.addEventListener("settime",kEe,!1),M.zoomTo(c.startTime,c.stopTime)}let N,_,S;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(S=document.createElement("div"),S.className="cesium-viewer-fullscreenContainer",o.appendChild(S),N=new Ok(S,t.fullscreenElement),_=Ca(N.viewModel,"isFullscreenEnabled",function(W){S.style.display=W?"block":"none",l(M)&&(M.container.style.right=`${S.clientWidth}px`,M.resize())}));let w,I,L;if(t.vrButton){let W=document.createElement("div");W.className="cesium-viewer-vrContainer",o.appendChild(W),w=new nV(W,p,t.fullScreenElement),I=Ca(w.viewModel,"isVREnabled",function(j){W.style.display=j?"block":"none",l(N)&&(W.style.right=`${S.clientWidth}px`),l(M)&&(M.container.style.right=`${W.clientWidth}px`,M.resize())}),L=Ca(w.viewModel,"isVRMode",function(j){Zvt(i,j)})}this._baseLayerPickerDropDown=D,this._fullscreenSubscription=_,this._vrSubscription=I,this._vrModeSubscription=L,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=x,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=b,this._homeButton=C,this._sceneModePicker=A,this._projectionPicker=E,this._baseLayerPicker=v,this._navigationHelpButton=O,this._animation=R,this._timeline=M,this._fullscreenButton=N,this._vrButton=w,this._geocoder=T,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(x)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new me;let B=this._cesiumWidget.dataSources,U=this._cesiumWidget.dataSourceDisplay;g.add(B.dataSourceAdded,Qi.prototype._onDataSourceAdded,this),g.add(B.dataSourceRemoved,Qi.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,Qi.prototype.resize,this);let V=B.length;for(let W=0;W<V;W++)this._dataSourceAdded(B,B.get(W));this._dataSourceAdded(void 0,U.defaultDataSource),g.add(B.dataSourceAdded,Qi.prototype._dataSourceAdded,this),g.add(B.dataSourceRemoved,Qi.prototype._dataSourceRemoved,this);function G(W){let j=FEe(i,W);l(j)?Y.getValueOrUndefined(j.position,i.clock.currentTime)?i.trackedEntity=j:i.zoomTo(j):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(W){i.selectedEntity=FEe(i,W)}d.screenSpaceEventHandler.setInputAction(k,bn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(G,bn.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(Qi.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,NQ(this._timeline,e))}}});Qi.prototype.extend=function(e,t){e(this,t)};Qi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,x=this._vrButton,b=c.container,T=b.style;p=b.clientHeight+3,T.left=`${f}px`;let C=0;l(m)&&(C+=m.container.clientWidth),l(x)&&(C+=x.container.clientWidth),T.right=`${C}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};Qi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Qi.prototype.render=function(){this._cesiumWidget.render()};Qi.prototype.isDestroyed=function(){return!1};Qi.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(bn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(bn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",kEe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),ue(this)};Qi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Qi.prototype._onEntityCollectionChanged,this)};Qi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Qi.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Qi.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};Qi.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,NEe)!==ct.FAILED?n=NEe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=y(o.name,o.id),a.description=Y.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};Qi.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};Qi.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Qi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Qi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Qi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Qi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&NQ(this.timeline,e)};Qi.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&NQ(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Qi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Qi.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};Qi.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};Qi.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var FQ=Qi;function $vt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new Pk(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var BQ=$vt;function Qvt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new Ck(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var kQ=Qvt;function Jvt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new me,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=In(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){VEe(s,u),s=f,VQ(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?VQ(s,u):VEe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){FC(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],x=new FileReader;x.onload=ewt(e,m,c,a),x.onerror=twt(e,m),x.readAsText(m)}}VQ(s,u),e.destroy=V3(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function FC(e){e.stopPropagation(),e.preventDefault()}function VEe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",FC,!1),n.removeEventListener("dragover",FC,!1),n.removeEventListener("dragexit",FC,!1))}function VQ(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",FC,!1),e.addEventListener("dragover",FC,!1),e.addEventListener("dragexit",FC,!1)}function ewt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=ON.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=CF.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=JF.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=vF.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function twt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var UQ=Jvt;function nwt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new Gk({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var zQ=nwt;function UEe(e){let t=e.split(` + </div>`,n.appendChild(i);let o=new Bk(t);Te.track(o),Te.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var IQ=Ivt;var Pvt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",Rvt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function PQ(){this._cameraClicked=new pe,this._closeClicked=new pe,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Te.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Te.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?Rvt:Pvt}}),Te.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}PQ.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(PQ.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var kk=PQ;function n5(e){e=In(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="×",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new kk;Te.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=en("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=Sa(s,"description",function(d){r.style.height="5px",f.innerHTML=d;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let b=x["background-color"],T=H.fromCssColorString(b);l(T)&&T.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(n5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});n5.prototype.isDestroyed=function(){return!1};n5.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var Vk=n5;function RQ(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Te.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=En(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=K3.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(RQ.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});RQ.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var Uk=RQ;function i5(e){let t=In(e.container),n=new Uk(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Te.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(i5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});i5.prototype.isDestroyed=function(){return!1};i5.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var zk=i5;function OEe(){this.showInstructions=!1;let e=this;this._command=En(function(){e.showInstructions=!e.showInstructions}),this._showClick=En(function(){e._touch=!1}),this._showTouch=En(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Te.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(OEe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var Hk=OEe;function o5(e){let t=In(e.container),n=new Hk,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=en("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=en("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Te.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(o5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});o5.prototype.isDestroyed=function(){return!1};o5.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var Gk=o5;function r5(e){this._scene=e,this._orthographic=e.camera.frustum instanceof nn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Te.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Te.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=En(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new hr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ne.SCENE2D||t._scene.camera.frustum instanceof nn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=En(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(r5.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});r5.prototype.isDestroyed=function(){return!1};r5.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var Wk=r5;var Ovt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",Mvt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function s5(e,t){e=In(e);let n=new Wk(t);n._perspectivePath=Ovt,n._orthographicPath=Mvt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Te.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(s5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});s5.prototype.isDestroyed=function(){return!1};s5.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var jk=s5;function a5(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new hr,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Te.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Te.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ne.SCENE2D?n.tooltip2D:o===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=En(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=En(function(){e.morphTo2D(n._duration)}),this._morphTo3D=En(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=En(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(a5.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});a5.prototype.isDestroyed=function(){return!1};a5.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var qk=a5;var Lvt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",Nvt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",Fvt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function c5(e,t,n){e=In(e);let i=new qk(t,n);i._globePath=Lvt,i._flatMapPath=Nvt,i._columbusViewPath=Fvt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Te.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(c5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});c5.prototype.isDestroyed=function(){return!1};c5.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var Yk=c5;var Bvt=new z,l5="-1000px";function Xk(e,t,n){this._scene=e,this._screenPositionX=l5,this._screenPositionY=l5,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Te.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Te.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Te.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Hi.worldToWindowCoordinates(e,i,o)}}Xk.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,Bvt);if(!l(e))this._screenPositionX=l5,this._screenPositionY=l5;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};Xk.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Kr.EXPONENTIAL_OUT})};Xk.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Kr.EXPONENTIAL_OUT})};Object.defineProperties(Xk.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var Kk=Xk;function u5(e,t){e=In(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new Kk(t,this._element,this._container);this._viewModel=c,Te.applyBindings(this._viewModel,this._element)}Object.defineProperties(u5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});u5.prototype.isDestroyed=function(){return!1};u5.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),ue(this)};var Zk=u5;function NC(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}NC.prototype.getHeight=function(){return this._height};NC.prototype.getBase=function(){return this._base};NC.prototype.getStartTime=function(){return this._start};NC.prototype.getStopTime=function(){return this._stop};NC.prototype.setRange=function(e,t){this._start=e,this._stop=t};NC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=Z.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=Z.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var $k=NC;function MEe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new H(.5,.5,.5,1),this.backgroundColor=i||new H(0,0,0,0)}MEe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=Z.addSeconds(t.startJulian,t.duration,new Z);if(Z.lessThan(n,o)&&Z.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(Z.lessThanOrEquals(n,r)&&Z.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=Z.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new Z);!l(a)&&Z.greaterThanOrEquals(u,n)?a=s:!l(c)&&Z.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var Qk=MEe;var OQ=1e12,Sd={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Tl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},K0=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],kvt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Cl(e,t){e=In(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Sd.none,this._touchMode=Tl.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=Vvt(this),this._onMouseUp=Uvt(this),this._onMouseMove=zvt(this),this._onMouseWheel=Hvt(this),this._onTouchStart=Gvt(this),this._onTouchMove=jvt(this),this._onTouchEnd=Wvt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Cl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Cl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Cl.prototype.isDestroyed=function(){return!1};Cl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};Cl.prototype.addHighlightRange=function(e,t,n){let i=new $k(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Cl.prototype.addTrack=function(e,t,n,i){let o=new Qk(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Cl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Z.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Yr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=Z.secondsDifference(o,i),s=Z.secondsDifference(i,this._startJulian),a=Z.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=Z.addSeconds(this._endJulian,s,new Z),this._startJulian=i,this._timeBarSecondsSpan=Z.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=Z.addSeconds(this._startJulian,a,new Z),this._endJulian=o,this._timeBarSecondsSpan=Z.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Cl.prototype.zoomFrom=function(e){let t=Z.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(Z.addSeconds(this._startJulian,t-t*e,new Z),Z.addSeconds(this._endJulian,n*e-n,new Z))};function MQ(e){return e<10?`0${e.toString()}`:e.toString()}Cl.prototype.makeLabel=function(e){let t=Z.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${kvt[t.month-1]} ${t.day} ${t.year} ${MQ(t.hour)}:${MQ(t.minute)}:${MQ(t.second)}${i}`};Cl.prototype.smallestTicInPixels=7;Cl.prototype._makeTics=function(){let e=this._timeBarEle,t=Z.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=Z.addSeconds(this._startJulian,a,new Z)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=Z.addSeconds(this._startJulian,c,new Z));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),x,b=Z.toGregorianDate(g);d>31536e4?x=Z.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):d>31536e3?x=Z.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):d>86400?x=Z.fromDate(new Date(Date.UTC(b.year,0))):x=Z.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let T=Z.secondsDifference(this._startJulian,Z.addSeconds(x,m,new Z)),C=T+d;this._epochJulian=x;function A(k){return Math.floor(T/k)*k}function E(k,W){return Math.ceil(k/W+.5)*W}function v(k){return(k-T)/d}function D(k,W){return k-W*Math.round(k/W)}this._rulerEle.innerHTML=this.makeLabel(Z.addSeconds(this._endJulian,-a,new Z));let O=this._rulerEle.offsetWidth+20;O<30&&(O=180);let R=f;f-=u;let M={startTime:T,startJulian:g,epochJulian:x,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(M)});let N=0,_=0,S=0,w=O/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let I=-1,L=-1,B=K0.length,U;for(U=0;U<B;++U){let k=K0[U];if(++I,N=k,k>w&&k>f)break;L<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(L=I)}if(I>0){for(;I>0;)if(--I,Math.abs(D(N,K0[I]))<1e-5){K0[I]>=f&&(_=K0[I]);break}if(L>=0)for(;L<I;){if(Math.abs(D(_,K0[L]))<1e-5&&K0[L]>=f){S=K0[L];break}++L}}f=R,f>u&&S<1e-5&&Math.abs(f-N)>u&&(S=f,f<=N+u&&(_=0));let V=-999999,G;if(p*(S/this._timeBarSecondsSpan)>=3)for(o=A(S);o<=C;o=E(o,S))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(o=A(_);o<=C;o=E(o,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,C+=N,o=A(N);let k=Z.computeTaiMinusUtc(x);for(;o<=C;){let W=Z.addSeconds(g,o-T,new Z);if(N>2.1){let K=Z.computeTaiMinusUtc(W);Math.abs(K-k)>.1&&(o+=K-k,W=Z.addSeconds(g,o-T,new Z))}let q=Math.round(p*v(o)),J=this.makeLabel(W);this._rulerEle.innerHTML=J,G=this._rulerEle.offsetWidth,G<10&&(G=O);let j=q-(G/2-1);j>V?(V=j+G+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${q.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${j.toString()}px;">${J}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${q.toString()}px;"></span>`,o=E(o,N)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),M.y=0,this._trackList.forEach(function(k){k.render(r._context,M),M.y+=k.height})};Cl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=Z.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(Z.addSeconds(this._startJulian,this._timelineDrag,new Z),Z.addSeconds(this._endJulian,this._timelineDrag,new Z)))};Cl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=Z.addSeconds(this._startJulian,t,new Z),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function Vvt(e){return function(t){e._mouseMode!==Sd.touchOnly&&(t.button===0?(e._mouseMode=Sd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Sd.zoom:e._mouseMode=Sd.slide)),t.preventDefault()}}function Uvt(e){return function(t){e._mouseMode=Sd.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function zvt(e){return function(t){let n;if(e._mouseMode===Sd.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Sd.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(Z.addSeconds(e._startJulian,i,new Z),Z.addSeconds(e._endJulian,i,new Z))}}else e._mouseMode===Sd.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function Hvt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;OQ=Math.max(Math.min(Math.abs(n),OQ),1),n/=OQ,e.zoomFrom(Math.pow(1.05,-n))}}function Gvt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Sd.touchOnly,n===1?(i=Z.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=Tl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Tl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=Tl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Tl.ignore}}function Wvt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Tl.singleTap?(e._touchMode=Tl.scrub,e._onTouchMove(t)):e._touchMode===Tl.scrub&&e._onTouchMove(t),e._mouseMode=Sd.touchOnly,n!==1?e._touchMode=n>0?Tl.ignore:Tl.none:e._touchMode===Tl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function jvt(e){return function(t){let n,i,o,r,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Tl.singleTap&&(e._touchMode=Tl.slideZoom),e._mouseMode=Sd.touchOnly,e._touchMode===Tl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Tl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=Z.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new Z)):(n=e._touchState.centerX-r,a=Z.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new Z)),e.zoomTo(a,Z.addSeconds(a,e._timeBarSecondsSpan*c,new Z)),e._touchState.centerX=r,e._touchState.spanX=s))}}Cl.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var Jk=Cl;var NEe=Zo(LEe(),1);function qvt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function FEe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function Yvt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(FEe(),e._locked=!1),e._noSleep.disable(),xr.exitFullscreen(),n(!1)):(xr.fullscreen||xr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=qvt("landscape")),t.useWebVR=!0,n(!0)))}function f5(e,t){let n=this,i=Te.observable(xr.enabled),o=Te.observable(!1);this.isVRMode=void 0,Te.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Te.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&xr.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Te.observable(!1);this._isOrthographic=void 0,Te.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new hr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof nn)}),this._locked=!1,this._noSleep=new NEe.default,this._command=En(function(){Yvt(n,e,o,r)},Te.getObservable(this,"isVREnabled")),this._vrElement=y(In(t),document.body),this._callback=function(){!xr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(FEe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(xr.changeEventName,this._callback)}Object.defineProperties(f5.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});f5.prototype.isDestroyed=function(){return!1};f5.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(xr.changeEventName,this._callback),ue(this)};var tV=f5;var Xvt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",Kvt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function d5(e,t,n){e=In(e);let i=new tV(t,n);i._exitVRPath=Kvt,i._enterVRPath=Xvt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(d5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});d5.prototype.isDestroyed=function(){return!1};d5.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var nV=d5;var BEe=new ae;function UEe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function Zvt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function $vt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function kEe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof nr)return i;if(n instanceof Ws)return new nr({name:$vt(n),description:Zvt(n),feature:n})}if(l(e.scene.globe))return ewt(e,t.position)}var Qvt=new Z;function NQ(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;Z.equals(i,o)&&(o=Z.addSeconds(i,P.EPSILON2,Qvt)),e.updateFromClock(),e.zoomTo(i,o)}}}var Jvt=new h;function ewt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new nr({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=VEe();return}let a=s[0],c=new nr({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,Jvt);c.position=new qc(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=VEe())}),r}function VEe(){return new nr({id:"None",description:"No features found."})}function twt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Qi(e,t){e=In(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=y(t.scene3DOnly,!1),c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new yh,u=new mk(c),f=!0);let d=new S3(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=d.scene,g=new hr;g.add(c.onTick,Qi.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let W=document.createElement("div");W.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(W),m=new Zk(W,p)}let x;if(!l(t.infoBox)||t.infoBox!==!1){let W=document.createElement("div");W.className="cesium-viewer-infoBoxContainer",o.appendChild(W),x=new Vk(W);let q=x.viewModel;g.add(q.cameraClicked,Qi.prototype._onInfoBoxCameraClicked,this),g.add(q.closeClicked,Qi.prototype._onInfoBoxClockClicked,this)}let b=document.createElement("div");b.className="cesium-viewer-toolbar",o.appendChild(b);let T;if(!l(t.geocoder)||t.geocoder!==!1){let W=document.createElement("div");W.className="cesium-viewer-geocoderContainer",b.appendChild(W);let q;typeof t.geocoder=="string"?q=[new CC({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),T=new Lk({container:W,geocoderServices:q,scene:p}),g.add(T.viewModel.search.beforeExecute,Qi.prototype._clearObjects,this)}let C;(!l(t.homeButton)||t.homeButton!==!1)&&(C=new Fk(b,p),l(T)&&g.add(C.viewModel.command.afterExecute,function(){let W=T.viewModel;W.searchText="",W.isSearchInProgress&&W.search()}),g.add(C.viewModel.command.beforeExecute,Qi.prototype._clearTrackedObject,this));let A;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(A=new Yk(b,p));let E;t.projectionPicker&&(E=new jk(b,p));let v,D;if(n){let W=y(t.imageryProviderViewModels,Ck()),q=y(t.terrainProviderViewModels,Ak());v=new Tk(b,{globe:p.globe,imageryProviderViewModels:W,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),D=b.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let O;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let W=!0;try{if(l(window.localStorage)){let q=window.localStorage.getItem("cesium-hasSeenNavHelp");l(q)&&q?W=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}O=new Gk({container:b,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,W)})}let R;if(!l(t.animation)||t.animation!==!1){let W=document.createElement("div");W.className="cesium-viewer-animationContainer",o.appendChild(W),R=new yk(W,new xk(u))}let M;if(!l(t.timeline)||t.timeline!==!1){let W=document.createElement("div");W.className="cesium-viewer-timelineContainer",o.appendChild(W),M=new Jk(W,c),M.addEventListener("settime",UEe,!1),M.zoomTo(c.startTime,c.stopTime)}let N,_,S;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(S=document.createElement("div"),S.className="cesium-viewer-fullscreenContainer",o.appendChild(S),N=new Ok(S,t.fullscreenElement),_=Sa(N.viewModel,"isFullscreenEnabled",function(W){S.style.display=W?"block":"none",l(M)&&(M.container.style.right=`${S.clientWidth}px`,M.resize())}));let w,I,L;if(t.vrButton){let W=document.createElement("div");W.className="cesium-viewer-vrContainer",o.appendChild(W),w=new nV(W,p,t.fullScreenElement),I=Sa(w.viewModel,"isVREnabled",function(q){W.style.display=q?"block":"none",l(N)&&(W.style.right=`${S.clientWidth}px`),l(M)&&(M.container.style.right=`${W.clientWidth}px`,M.resize())}),L=Sa(w.viewModel,"isVRMode",function(q){twt(i,q)})}this._baseLayerPickerDropDown=D,this._fullscreenSubscription=_,this._vrSubscription=I,this._vrModeSubscription=L,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=x,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=b,this._homeButton=C,this._sceneModePicker=A,this._projectionPicker=E,this._baseLayerPicker=v,this._navigationHelpButton=O,this._animation=R,this._timeline=M,this._fullscreenButton=N,this._vrButton=w,this._geocoder=T,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(x)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new pe;let B=this._cesiumWidget.dataSources,U=this._cesiumWidget.dataSourceDisplay;g.add(B.dataSourceAdded,Qi.prototype._onDataSourceAdded,this),g.add(B.dataSourceRemoved,Qi.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,Qi.prototype.resize,this);let V=B.length;for(let W=0;W<V;W++)this._dataSourceAdded(B,B.get(W));this._dataSourceAdded(void 0,U.defaultDataSource),g.add(B.dataSourceAdded,Qi.prototype._dataSourceAdded,this),g.add(B.dataSourceRemoved,Qi.prototype._dataSourceRemoved,this);function G(W){let q=kEe(i,W);l(q)?Y.getValueOrUndefined(q.position,i.clock.currentTime)?i.trackedEntity=q:i.zoomTo(q):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(W){i.selectedEntity=kEe(i,W)}d.screenSpaceEventHandler.setInputAction(k,bn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(G,bn.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(Qi.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,NQ(this._timeline,e))}}});Qi.prototype.extend=function(e,t){e(this,t)};Qi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,x=this._vrButton,b=c.container,T=b.style;p=b.clientHeight+3,T.left=`${f}px`;let C=0;l(m)&&(C+=m.container.clientWidth),l(x)&&(C+=x.container.clientWidth),T.right=`${C}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};Qi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Qi.prototype.render=function(){this._cesiumWidget.render()};Qi.prototype.isDestroyed=function(){return!1};Qi.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(bn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(bn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",UEe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),ue(this)};Qi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Qi.prototype._onEntityCollectionChanged,this)};Qi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Qi.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Qi.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};Qi.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,BEe)!==at.FAILED?n=BEe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=y(o.name,o.id),a.description=Y.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};Qi.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};Qi.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Qi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Qi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Qi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Qi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&NQ(this.timeline,e)};Qi.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&NQ(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Qi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Qi.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};Qi.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};Qi.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var FQ=Qi;function nwt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new Pk(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var BQ=nwt;function iwt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new vk(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var kQ=iwt;function owt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new pe,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=In(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){zEe(s,u),s=f,VQ(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?VQ(s,u):zEe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){FC(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],x=new FileReader;x.onload=rwt(e,m,c,a),x.onerror=swt(e,m),x.readAsText(m)}}VQ(s,u),e.destroy=V3(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function FC(e){e.stopPropagation(),e.preventDefault()}function zEe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",FC,!1),n.removeEventListener("dragover",FC,!1),n.removeEventListener("dragexit",FC,!1))}function VQ(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",FC,!1),e.addEventListener("dragover",FC,!1),e.addEventListener("dragexit",FC,!1)}function rwt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=fN.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=gT.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=PT.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=rF.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function swt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var UQ=owt;function awt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new zk({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var zQ=awt;function HEe(e){let t=e.split(` `),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c} -`}return i}function wd(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=be.observable();return be.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=UEe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===ki.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===ki.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===ki.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.translationX=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.scaleZ=F.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)}})}var iwt=new h,owt=new h,rwt=new va,swt=new $;function yp(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,iwt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,owt),i=rwt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,swt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(wd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=UEe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,yp(t)}}}});wd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};wd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};wd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};wd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};wd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};wd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};wd.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new fC({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};wd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` +`}return i}function vd(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Te.observable();return Te.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=HEe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Vi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Vi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Vi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&_p(t)},getPrimitiveFunction:function(){t.translationX=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&_p(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&_p(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&_p(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&_p(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&_p(t)},getPrimitiveFunction:function(){t.scaleZ=F.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&_p(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&_p(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&_p(t)}})}var cwt=new h,lwt=new h,uwt=new Da,fwt=new $;function _p(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,cwt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,lwt),i=uwt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,fwt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(vd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=HEe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,_p(t)}}}});vd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};vd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};vd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};vd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};vd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};vd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};vd.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new fC({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};vd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` `),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};wd.prototype.isDestroyed=function(){return!1};wd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){be.getObservable(e,t).dispose()}),ue(this)};var iV=wd;function p5(e,t){e=In(e);let n=document.createElement("div"),i=new iV(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=Ya.createSection,a=Ya.createCheckbox,c=Ya.createRangeInput,u=Ya.createButton,f=s(r,"Display","displayVisible","toggleDisplay"),d=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),g=s(r,"Clipping","clippingVisible","toggleClipping"),m=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let x=10,b=10,T=P.PI;d.appendChild(c("Translation X","translationX",-x,+x)),d.appendChild(c("Translation Y","translationY",-x,+x)),d.appendChild(c("Translation Z","translationZ",-x,+x)),d.appendChild(c("Scale X","scaleX",0,+b)),d.appendChild(c("Scale Y","scaleY",0,+b)),d.appendChild(c("Scale Z","scaleZ",0,+b)),d.appendChild(c("Heading","angleX",-T,+T)),d.appendChild(c("Pitch","angleY",-T,+T)),d.appendChild(c("Roll","angleZ",-T,+T));let C=ki.getMinBounds(ki.BOX),A=ki.getMaxBounds(ki.BOX),E=h.fromElements(ki.getMinBounds(ki.ELLIPSOID).x,ki.getMinBounds(ki.ELLIPSOID).y,-ee.WGS84.maximumRadius,new h),v=h.fromElements(ki.getMaxBounds(ki.ELLIPSOID).x,ki.getMaxBounds(ki.ELLIPSOID).y,1e7,new h),D=ki.getMinBounds(ki.CYLINDER),O=ki.getMaxBounds(ki.CYLINDER);$v("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",C,A,"shapeIsBox",p),$v("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",E,v,"shapeIsEllipsoid",p),$v("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",D,O,"shapeIsCylinder",p),$v("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",C,A,"shapeIsBox",g),$v("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",E,v,"shapeIsEllipsoid",g),$v("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",D,O,"shapeIsCylinder",g);let R=document.createElement("div");m.appendChild(R);let M=document.createElement("textarea");M.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),R.className="cesium-cesiumInspector-styleEditor",R.appendChild(M);let N=u("Compile (Ctrl+Enter)","compileShader");R.appendChild(N);let _=document.createElement("label");_.style.display="block",_.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),R.appendChild(_),be.applyBindings(i,n)}Object.defineProperties(p5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});p5.prototype.isDestroyed=function(){return!1};p5.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function $v(e,t,n,i,o,r,s,a,c,u,f,d,p,g,m,x){let b=Ya.createRangeInput,T=p,C=g,A=x.appendChild(document.createElement("div"));A.setAttribute("data-bind",`if: ${m}`),A.appendChild(b(e,s,T.x,C.x)),A.appendChild(b(t,a,T.x,C.x)),A.appendChild(b(n,c,T.y,C.y)),A.appendChild(b(i,u,T.y,C.y)),A.appendChild(b(o,f,T.z,C.z)),A.appendChild(b(r,d,T.z,C.z))}var oV=p5;function awt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new oV(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var HQ=awt;globalThis.CESIUM_VERSION="1.124";var cwt="1.124";0&&(module.exports={AlphaMode,AlphaPipelineStage,AnchorPointDirect,AnchorPointIndirect,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,Atmosphere,AtmospherePipelineStage,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoundingVolumeSemantics,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,ClippingPolygon,ClippingPolygonCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorrelationGroup,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicAtmosphereLightingType,DynamicEnvironmentMapManager,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GeoJsonDataSource,GeoJsonLoader,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryUpdaterSet,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfGpmLoader,GltfGpmLocal,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfMeshPrimitiveGpmLoader,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,I3SBuildingSceneLayerExplorer,I3SBuildingSceneLayerExplorerViewModel,I3SDataProvider,I3SDecoder,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3SStatistics,I3SSublayer,I3SSymbology,I3dmLoader,I3dmParser,ITwinData,ITwinPlatform,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocodeProviderType,IonGeocoderService,IonImageryProvider,IonResource,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MeshPrimitiveGpmLocal,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPicking,MetadataPickingPipelineStage,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelClippingPolygonsPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelDrawCommands,ModelFeature,ModelFeatureTable,ModelGraphics,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,PickedMetadataInfo,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,PpeMetadata,PpeSource,PpeTexture,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,SensorVolumePortionToDisplay,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SpatialNode,Spdcf,SpecularEnvironmentCubeMap,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,Stereographic,StorageType,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainProvider,TerrainQuantization,TerrainState,Texture,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,TrackingReferenceFrame,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoxShape,VoxelCell,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersAtmosphereStageFS,_shadersAtmosphereStageVS,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectClippingPlanes,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelClippingPolygonsStageFS,_shadersModelClippingPolygonsStageVS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPbrNeutralTonemapping,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolygonSignedDistanceFS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorTileVS,_shadersVerticalExaggerationStageVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelUtils,_shadersVoxelVS,_shadersWater,_shadersWaterMaskMaterial,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapplyHSBShift,_shadersapproximateSphericalCoordinates,_shadersapproximateTanh,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shadersclipPolygons,_shaderscolumbusViewMorph,_shaderscomputeAtmosphereColor,_shaderscomputeGroundAtmosphereScattering,_shaderscomputePosition,_shaderscomputeScattering,_shadersconvertUvToBox,_shadersconvertUvToCylinder,_shadersconvertUvToEllipsoid,_shaderscosineAndSine,_shadersdecompressTextureCoordinates,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidTextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetDynamicAtmosphereLightDirection,_shadersgetLambertDiffuse,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmaterial,_shadersmaterialInput,_shadersmaximumComponent,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrNeutralTonemapping,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssaturation,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackClippingExtents,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,barycentricCoordinates,binarySearch,buildModuleUrl,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeVectorPolylinePositions,defaultValue,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getMetadataClassProperty,getMetadataProperty,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pickModel,pointInsideTriangle,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas}); +`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};vd.prototype.isDestroyed=function(){return!1};vd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),ue(this)};var iV=vd;function h5(e,t){e=In(e);let n=document.createElement("div"),i=new iV(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=Ka.createSection,a=Ka.createCheckbox,c=Ka.createRangeInput,u=Ka.createButton,f=s(r,"Display","displayVisible","toggleDisplay"),d=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),g=s(r,"Clipping","clippingVisible","toggleClipping"),m=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let x=10,b=10,T=P.PI;d.appendChild(c("Translation X","translationX",-x,+x)),d.appendChild(c("Translation Y","translationY",-x,+x)),d.appendChild(c("Translation Z","translationZ",-x,+x)),d.appendChild(c("Scale X","scaleX",0,+b)),d.appendChild(c("Scale Y","scaleY",0,+b)),d.appendChild(c("Scale Z","scaleZ",0,+b)),d.appendChild(c("Heading","angleX",-T,+T)),d.appendChild(c("Pitch","angleY",-T,+T)),d.appendChild(c("Roll","angleZ",-T,+T));let C=Vi.getMinBounds(Vi.BOX),A=Vi.getMaxBounds(Vi.BOX),E=h.fromElements(Vi.getMinBounds(Vi.ELLIPSOID).x,Vi.getMinBounds(Vi.ELLIPSOID).y,-ee.WGS84.maximumRadius,new h),v=h.fromElements(Vi.getMaxBounds(Vi.ELLIPSOID).x,Vi.getMaxBounds(Vi.ELLIPSOID).y,1e7,new h),D=Vi.getMinBounds(Vi.CYLINDER),O=Vi.getMaxBounds(Vi.CYLINDER);$v("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",C,A,"shapeIsBox",p),$v("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",E,v,"shapeIsEllipsoid",p),$v("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",D,O,"shapeIsCylinder",p),$v("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",C,A,"shapeIsBox",g),$v("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",E,v,"shapeIsEllipsoid",g),$v("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",D,O,"shapeIsCylinder",g);let R=document.createElement("div");m.appendChild(R);let M=document.createElement("textarea");M.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),R.className="cesium-cesiumInspector-styleEditor",R.appendChild(M);let N=u("Compile (Ctrl+Enter)","compileShader");R.appendChild(N);let _=document.createElement("label");_.style.display="block",_.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),R.appendChild(_),Te.applyBindings(i,n)}Object.defineProperties(h5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});h5.prototype.isDestroyed=function(){return!1};h5.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function $v(e,t,n,i,o,r,s,a,c,u,f,d,p,g,m,x){let b=Ka.createRangeInput,T=p,C=g,A=x.appendChild(document.createElement("div"));A.setAttribute("data-bind",`if: ${m}`),A.appendChild(b(e,s,T.x,C.x)),A.appendChild(b(t,a,T.x,C.x)),A.appendChild(b(n,c,T.y,C.y)),A.appendChild(b(i,u,T.y,C.y)),A.appendChild(b(o,f,T.z,C.z)),A.appendChild(b(r,d,T.z,C.z))}var oV=h5;function dwt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new oV(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var HQ=dwt;globalThis.CESIUM_VERSION="1.125";var hwt="1.125";0&&(module.exports={AlphaMode,AlphaPipelineStage,AnchorPointDirect,AnchorPointIndirect,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,Atmosphere,AtmospherePipelineStage,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoundingVolumeSemantics,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,ClippingPolygon,ClippingPolygonCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorrelationGroup,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicAtmosphereLightingType,DynamicEnvironmentMapManager,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GeoJsonDataSource,GeoJsonLoader,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryUpdaterSet,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfGpmLoader,GltfGpmLocal,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfMeshPrimitiveGpmLoader,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,I3SBuildingSceneLayerExplorer,I3SBuildingSceneLayerExplorerViewModel,I3SDataProvider,I3SDecoder,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3SStatistics,I3SSublayer,I3SSymbology,I3dmLoader,I3dmParser,ITwinData,ITwinPlatform,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocodeProviderType,IonGeocoderService,IonImageryProvider,IonResource,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MeshPrimitiveGpmLocal,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPicking,MetadataPickingPipelineStage,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelClippingPolygonsPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelDrawCommands,ModelFeature,ModelFeatureTable,ModelGraphics,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,PickedMetadataInfo,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,PpeMetadata,PpeSource,PpeTexture,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,SensorVolumePortionToDisplay,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SpatialNode,Spdcf,SpecularEnvironmentCubeMap,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,Stereographic,StorageType,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainProvider,TerrainQuantization,TerrainState,Texture,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,TrackingReferenceFrame,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoxShape,VoxelCell,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersAtmosphereStageFS,_shadersAtmosphereStageVS,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectClippingPlanes,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelClippingPolygonsStageFS,_shadersModelClippingPolygonsStageVS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPbrNeutralTonemapping,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolygonSignedDistanceFS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorTileVS,_shadersVerticalExaggerationStageVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelUtils,_shadersVoxelVS,_shadersWater,_shadersWaterMaskMaterial,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapplyHSBShift,_shadersapproximateSphericalCoordinates,_shadersapproximateTanh,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shadersclipPolygons,_shaderscolumbusViewMorph,_shaderscomputeAtmosphereColor,_shaderscomputeGroundAtmosphereScattering,_shaderscomputePosition,_shaderscomputeScattering,_shadersconvertUvToBox,_shadersconvertUvToCylinder,_shadersconvertUvToEllipsoid,_shaderscosineAndSine,_shadersdecompressTextureCoordinates,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidTextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetDynamicAtmosphereLightDirection,_shadersgetLambertDiffuse,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmaterial,_shadersmaterialInput,_shadersmaximumComponent,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrNeutralTonemapping,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssaturation,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackClippingExtents,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,barycentricCoordinates,binarySearch,buildModuleUrl,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeVectorPolylinePositions,defaultValue,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getMetadataClassProperty,getMetadataProperty,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pickModel,pointInsideTriangle,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas}); diff --git a/public/js/Cesium2/index.js b/public/js/Cesium2/index.js index 6c976c97b..4046e697f 100644 --- a/public/js/Cesium2/index.js +++ b/public/js/Cesium2/index.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.124 + * Version 1.125 * * Copyright 2011-2022 Cesium Contributors * @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var IAe=Object.create;var NZ=Object.defineProperty;var PAe=Object.getOwnPropertyDescriptor;var RAe=Object.getOwnPropertyNames;var OAe=Object.getPrototypeOf,MAe=Object.prototype.hasOwnProperty;var GP=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Gu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var LAe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of RAe(t))!MAe.call(e,o)&&o!==n&&NZ(e,o,{get:()=>t[o],enumerable:!(i=PAe(t,o))||i.enumerable});return e};var Ur=(e,t,n)=>(n=e!=null?IAe(OAe(e)):{},LAe(t||!e||!e.__esModule?NZ(n,"default",{value:e,enumerable:!0}):n,e));var WP=Gu(($Et,BZ)=>{var Zm=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};Zm.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Zm.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Zm.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};Zm.prototype.random_int31=function(){return this.random_int()>>>1};Zm.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Zm.prototype.random=function(){return this.random_int()*(1/4294967296)};Zm.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Zm.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};BZ.exports=Zm});var c$=Gu((nT,iT)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof nT=="object"&&nT&&!nT.nodeType&&nT,n=typeof iT=="object"&&iT&&!iT.nodeType&&iT,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,u=38,f=700,h=72,p=128,_="-",m=/^xn--/,x=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,T={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=s-a,A=Math.floor,S=String.fromCharCode,v;function D(V){throw new RangeError(T[V])}function O(V,G){for(var k=V.length,W=[];k--;)W[k]=G(V[k]);return W}function R(V,G){var k=V.split("@"),W="";k.length>1&&(W=k[0]+"@",V=k[1]),V=V.replace(b,".");var Y=V.split("."),J=O(Y,G).join(".");return W+J}function M(V){for(var G=[],k=0,W=V.length,Y,J;k<W;)Y=V.charCodeAt(k++),Y>=55296&&Y<=56319&&k<W?(J=V.charCodeAt(k++),(J&64512)==56320?G.push(((Y&1023)<<10)+(J&1023)+65536):(G.push(Y),k--)):G.push(Y);return G}function L(V){return O(V,function(G){var k="";return G>65535&&(G-=65536,k+=S(G>>>10&1023|55296),G=56320|G&1023),k+=S(G),k}).join("")}function g(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function E(V,G){return V+22+75*(V<26)-((G!=0)<<5)}function w(V,G,k){var W=0;for(V=k?A(V/f):V>>1,V+=A(V/G);V>C*c>>1;W+=s)V=A(V/C);return A(W+(C+1)*V/(V+u))}function I(V){var G=[],k=V.length,W,Y=0,J=p,j=h,K,Q,de,ye,ce,ge,xe,De,Ae;for(K=V.lastIndexOf(_),K<0&&(K=0),Q=0;Q<K;++Q)V.charCodeAt(Q)>=128&&D("not-basic"),G.push(V.charCodeAt(Q));for(de=K>0?K+1:0;de<k;){for(ye=Y,ce=1,ge=s;de>=k&&D("invalid-input"),xe=g(V.charCodeAt(de++)),(xe>=s||xe>A((r-Y)/ce))&&D("overflow"),Y+=xe*ce,De=ge<=j?a:ge>=j+c?c:ge-j,!(xe<De);ge+=s)Ae=s-De,ce>A(r/Ae)&&D("overflow"),ce*=Ae;W=G.length+1,j=w(Y-ye,W,ye==0),A(Y/W)>r-J&&D("overflow"),J+=A(Y/W),Y%=W,G.splice(Y++,0,J)}return L(G)}function N(V){var G,k,W,Y,J,j,K,Q,de,ye,ce,ge=[],xe,De,Ae,ke;for(V=M(V),xe=V.length,G=p,k=0,J=h,j=0;j<xe;++j)ce=V[j],ce<128&&ge.push(S(ce));for(W=Y=ge.length,Y&&ge.push(_);W<xe;){for(K=r,j=0;j<xe;++j)ce=V[j],ce>=G&&ce<K&&(K=ce);for(De=W+1,K-G>A((r-k)/De)&&D("overflow"),k+=(K-G)*De,G=K,j=0;j<xe;++j)if(ce=V[j],ce<G&&++k>r&&D("overflow"),ce==G){for(Q=k,de=s;ye=de<=J?a:de>=J+c?c:de-J,!(Q<ye);de+=s)ke=Q-ye,Ae=s-ye,ge.push(S(E(ye+ke%Ae,0))),Q=A(ke/Ae);ge.push(S(E(Q,0))),J=w(k,De,W==Y),k=0,++W}++k,++G}return ge.join("")}function B(V){return R(V,function(G){return m.test(G)?I(G.slice(4).toLowerCase()):G})}function H(V){return R(V,function(G){return x.test(G)?"xn--"+N(G):G})}if(o={version:"1.3.2",ucs2:{decode:M,encode:L},decode:I,encode:N,toASCII:H,toUnicode:B},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(iT.exports==t)n.exports=o;else for(v in o)o.hasOwnProperty(v)&&(t[v]=o[v]);else e.punycode=o})(nT)});var u$=Gu((l$,u1)=>{/*! +var RAe=Object.create;var NZ=Object.defineProperty;var OAe=Object.getOwnPropertyDescriptor;var MAe=Object.getOwnPropertyNames;var LAe=Object.getPrototypeOf,NAe=Object.prototype.hasOwnProperty;var YP=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Wu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var FAe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of MAe(t))!NAe.call(e,o)&&o!==n&&NZ(e,o,{get:()=>t[o],enumerable:!(i=OAe(t,o))||i.enumerable});return e};var Ur=(e,t,n)=>(n=e!=null?RAe(LAe(e)):{},FAe(t||!e||!e.__esModule?NZ(n,"default",{value:e,enumerable:!0}):n,e));var XP=Wu((tSt,BZ)=>{var $m=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};$m.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};$m.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};$m.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};$m.prototype.random_int31=function(){return this.random_int()>>>1};$m.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};$m.prototype.random=function(){return this.random_int()*(1/4294967296)};$m.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};$m.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};BZ.exports=$m});var c$=Wu((nT,iT)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof nT=="object"&&nT&&!nT.nodeType&&nT,n=typeof iT=="object"&&iT&&!iT.nodeType&&iT,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,u=38,f=700,h=72,p=128,_="-",m=/^xn--/,x=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,T={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=s-a,A=Math.floor,S=String.fromCharCode,v;function D(V){throw new RangeError(T[V])}function O(V,G){for(var k=V.length,W=[];k--;)W[k]=G(V[k]);return W}function R(V,G){var k=V.split("@"),W="";k.length>1&&(W=k[0]+"@",V=k[1]),V=V.replace(b,".");var Y=V.split("."),J=O(Y,G).join(".");return W+J}function M(V){for(var G=[],k=0,W=V.length,Y,J;k<W;)Y=V.charCodeAt(k++),Y>=55296&&Y<=56319&&k<W?(J=V.charCodeAt(k++),(J&64512)==56320?G.push(((Y&1023)<<10)+(J&1023)+65536):(G.push(Y),k--)):G.push(Y);return G}function L(V){return O(V,function(G){var k="";return G>65535&&(G-=65536,k+=S(G>>>10&1023|55296),G=56320|G&1023),k+=S(G),k}).join("")}function g(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function E(V,G){return V+22+75*(V<26)-((G!=0)<<5)}function w(V,G,k){var W=0;for(V=k?A(V/f):V>>1,V+=A(V/G);V>C*c>>1;W+=s)V=A(V/C);return A(W+(C+1)*V/(V+u))}function I(V){var G=[],k=V.length,W,Y=0,J=p,j=h,K,Q,de,xe,ce,_e,be,De,Ae;for(K=V.lastIndexOf(_),K<0&&(K=0),Q=0;Q<K;++Q)V.charCodeAt(Q)>=128&&D("not-basic"),G.push(V.charCodeAt(Q));for(de=K>0?K+1:0;de<k;){for(xe=Y,ce=1,_e=s;de>=k&&D("invalid-input"),be=g(V.charCodeAt(de++)),(be>=s||be>A((r-Y)/ce))&&D("overflow"),Y+=be*ce,De=_e<=j?a:_e>=j+c?c:_e-j,!(be<De);_e+=s)Ae=s-De,ce>A(r/Ae)&&D("overflow"),ce*=Ae;W=G.length+1,j=w(Y-xe,W,xe==0),A(Y/W)>r-J&&D("overflow"),J+=A(Y/W),Y%=W,G.splice(Y++,0,J)}return L(G)}function N(V){var G,k,W,Y,J,j,K,Q,de,xe,ce,_e=[],be,De,Ae,ke;for(V=M(V),be=V.length,G=p,k=0,J=h,j=0;j<be;++j)ce=V[j],ce<128&&_e.push(S(ce));for(W=Y=_e.length,Y&&_e.push(_);W<be;){for(K=r,j=0;j<be;++j)ce=V[j],ce>=G&&ce<K&&(K=ce);for(De=W+1,K-G>A((r-k)/De)&&D("overflow"),k+=(K-G)*De,G=K,j=0;j<be;++j)if(ce=V[j],ce<G&&++k>r&&D("overflow"),ce==G){for(Q=k,de=s;xe=de<=J?a:de>=J+c?c:de-J,!(Q<xe);de+=s)ke=Q-xe,Ae=s-xe,_e.push(S(E(xe+ke%Ae,0))),Q=A(ke/Ae);_e.push(S(E(Q,0))),J=w(k,De,W==Y),k=0,++W}++k,++G}return _e.join("")}function B(V){return R(V,function(G){return m.test(G)?I(G.slice(4).toLowerCase()):G})}function H(V){return R(V,function(G){return x.test(G)?"xn--"+N(G):G})}if(o={version:"1.3.2",ucs2:{decode:M,encode:L},decode:I,encode:N,toASCII:H,toUnicode:B},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(iT.exports==t)n.exports=o;else for(v in o)o.hasOwnProperty(v)&&(t[v]=o[v]);else e.punycode=o})(nT)});var u$=Wu((l$,m1)=>{/*! * URI.js - Mutating URLs * IPv6 Support * @@ -35,7 +35,7 @@ var IAe=Object.create;var NZ=Object.defineProperty;var PAe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof u1=="object"&&u1.exports?u1.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(l$,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,h=0;h<c;h++){f=s[h].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[h]=f.join("")}var _=-1,m=0,x=0,b=-1,T=!1;for(h=0;h<c;h++)T?s[h]==="0"?x+=1:(T=!1,x>m&&(_=b,m=x)):s[h]==="0"&&(T=!0,b=h,x=1);x>m&&(_=b,m=x),m>1&&s.splice(_,m,""),a=s.length;var C="";for(s[0]===""&&(C=":"),h=0;h<a&&(C+=s[h],h!==a-1);h++)C+=":";return s[a-1]===""&&(C+=":"),C}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var d$=Gu((f$,f1)=>{/*! + */(function(e,t){"use strict";typeof m1=="object"&&m1.exports?m1.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(l$,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,h=0;h<c;h++){f=s[h].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[h]=f.join("")}var _=-1,m=0,x=0,b=-1,T=!1;for(h=0;h<c;h++)T?s[h]==="0"?x+=1:(T=!1,x>m&&(_=b,m=x)):s[h]==="0"&&(T=!0,b=h,x=1);x>m&&(_=b,m=x),m>1&&s.splice(_,m,""),a=s.length;var C="";for(s[0]===""&&(C=":"),h=0;h<a&&(C+=s[h],h!==a-1);h++)C+=":";return s[a-1]===""&&(C+=":"),C}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var d$=Wu((f$,p1)=>{/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * @@ -47,7 +47,7 @@ var IAe=Object.create;var NZ=Object.defineProperty;var PAe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof f1=="object"&&f1.exports?f1.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(f$,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Hl=Gu((h$,d1)=>{/*! + */(function(e,t){"use strict";typeof p1=="object"&&p1.exports?p1.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(f$,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Wl=Wu((h$,g1)=>{/*! * URI.js - Mutating URLs * * Version: 1.19.11 @@ -58,26 +58,26 @@ var IAe=Object.create;var NZ=Object.defineProperty;var PAe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof d1=="object"&&d1.exports?d1.exports=t(c$(),u$(),d$()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(h$,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(E,w){var I=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof r))return I?N?new r(E,w):new r(E):new r;if(E===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?E=location.href+"":E=""}if(E===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(E),w!==void 0?this.absoluteTo(w):this}function s(E){return/^[0-9]+$/.test(E)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(E){return E.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(E){return E===void 0?"Undefined":String(Object.prototype.toString.call(E)).slice(8,-1)}function h(E){return f(E)==="Array"}function p(E,w){var I={},N,B;if(f(w)==="RegExp")I=null;else if(h(w))for(N=0,B=w.length;N<B;N++)I[w[N]]=!0;else I[w]=!0;for(N=0,B=E.length;N<B;N++){var H=I&&I[E[N]]!==void 0||!I&&w.test(E[N]);H&&(E.splice(N,1),B--,N--)}return E}function _(E,w){var I,N;if(h(w)){for(I=0,N=w.length;I<N;I++)if(!_(E,w[I]))return!1;return!0}var B=f(w);for(I=0,N=E.length;I<N;I++)if(B==="RegExp"){if(typeof E[I]=="string"&&E[I].match(w))return!0}else if(E[I]===w)return!0;return!1}function m(E,w){if(!h(E)||!h(w)||E.length!==w.length)return!1;E.sort(),w.sort();for(var I=0,N=E.length;I<N;I++)if(E[I]!==w[I])return!1;return!0}function x(E){var w=/^\/+|\/+$/g;return E.replace(w,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(E){if(!(!E||!E.nodeName)){var w=E.nodeName.toLowerCase();if(!(w==="input"&&E.type!=="image"))return r.domAttributes[w]}};function b(E){return escape(E)}function T(E){return encodeURIComponent(E).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=T,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=T,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(E,w){var I=r.encode(E+"");return w===void 0&&(w=r.escapeQuerySpace),w?I.replace(/%20/g,"+"):I},r.decodeQuery=function(E,w){E+="",w===void 0&&(w=r.escapeQuerySpace);try{return r.decode(w?E.replace(/\+/g,"%20"):E)}catch{return E}};var C={encode:"encode",decode:"decode"},A,S=function(E,w){return function(I){try{return r[w](I+"").replace(r.characters[E][w].expression,function(N){return r.characters[E][w].map[N]})}catch{return I}}};for(A in C)r[A+"PathSegment"]=S("pathname",C[A]),r[A+"UrnPathSegment"]=S("urnpath",C[A]);var v=function(E,w,I){return function(N){var B;I?B=function(k){return r[w](r[I](k))}:B=r[w];for(var H=(N+"").split(E),V=0,G=H.length;V<G;V++)H[V]=B(H[V]);return H.join(E)}};r.decodePath=v("/","decodePathSegment"),r.decodeUrnPath=v(":","decodeUrnPathSegment"),r.recodePath=v("/","encodePathSegment","decode"),r.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),r.encodeReserved=S("reserved","encode"),r.parse=function(E,w){var I;return w||(w={preventInvalidHostname:r.preventInvalidHostname}),E=E.replace(r.leading_whitespace_expression,""),E=E.replace(r.ascii_tab_whitespace,""),I=E.indexOf("#"),I>-1&&(w.fragment=E.substring(I+1)||null,E=E.substring(0,I)),I=E.indexOf("?"),I>-1&&(w.query=E.substring(I+1)||null,E=E.substring(0,I)),E=E.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),E=E.replace(/^[/\\]{2,}/i,"//"),E.substring(0,2)==="//"?(w.protocol=null,E=E.substring(2),E=r.parseAuthority(E,w)):(I=E.indexOf(":"),I>-1&&(w.protocol=E.substring(0,I)||null,w.protocol&&!w.protocol.match(r.protocol_expression)?w.protocol=void 0:E.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(E=E.substring(I+3),E=r.parseAuthority(E,w)):(E=E.substring(I+1),w.urn=!0))),w.path=E,w},r.parseHost=function(E,w){E||(E=""),E=E.replace(/\\/g,"/");var I=E.indexOf("/"),N,B;if(I===-1&&(I=E.length),E.charAt(0)==="[")N=E.indexOf("]"),w.hostname=E.substring(1,N)||null,w.port=E.substring(N+2,I)||null,w.port==="/"&&(w.port=null);else{var H=E.indexOf(":"),V=E.indexOf("/"),G=E.indexOf(":",H+1);G!==-1&&(V===-1||G<V)?(w.hostname=E.substring(0,I)||null,w.port=null):(B=E.substring(0,I).split(":"),w.hostname=B[0]||null,w.port=B[1]||null)}return w.hostname&&E.substring(I).charAt(0)!=="/"&&(I++,E="/"+E),w.preventInvalidHostname&&r.ensureValidHostname(w.hostname,w.protocol),w.port&&r.ensureValidPort(w.port),E.substring(I)||"/"},r.parseAuthority=function(E,w){return E=r.parseUserinfo(E,w),r.parseHost(E,w)},r.parseUserinfo=function(E,w){var I=E,N=E.indexOf("\\");N!==-1&&(E=E.replace(/\\/g,"/"));var B=E.indexOf("/"),H=E.lastIndexOf("@",B>-1?B:E.length-1),V;return H>-1&&(B===-1||H<B)?(V=E.substring(0,H).split(":"),w.username=V[0]?r.decode(V[0]):null,V.shift(),w.password=V[0]?r.decode(V.join(":")):null,E=I.substring(H+1)):(w.username=null,w.password=null),E},r.parseQuery=function(E,w){if(!E)return{};if(E=E.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!E)return{};for(var I={},N=E.split("&"),B=N.length,H,V,G,k=0;k<B;k++)H=N[k].split("="),V=r.decodeQuery(H.shift(),w),G=H.length?r.decodeQuery(H.join("="),w):null,V!=="__proto__"&&(c.call(I,V)?((typeof I[V]=="string"||I[V]===null)&&(I[V]=[I[V]]),I[V].push(G)):I[V]=G);return I},r.build=function(E){var w="",I=!1;return E.protocol&&(w+=E.protocol+":"),!E.urn&&(w||E.hostname)&&(w+="//",I=!0),w+=r.buildAuthority(E)||"",typeof E.path=="string"&&(E.path.charAt(0)!=="/"&&I&&(w+="/"),w+=E.path),typeof E.query=="string"&&E.query&&(w+="?"+E.query),typeof E.fragment=="string"&&E.fragment&&(w+="#"+E.fragment),w},r.buildHost=function(E){var w="";if(E.hostname)r.ip6_expression.test(E.hostname)?w+="["+E.hostname+"]":w+=E.hostname;else return"";return E.port&&(w+=":"+E.port),w},r.buildAuthority=function(E){return r.buildUserinfo(E)+r.buildHost(E)},r.buildUserinfo=function(E){var w="";return E.username&&(w+=r.encode(E.username)),E.password&&(w+=":"+r.encode(E.password)),w&&(w+="@"),w},r.buildQuery=function(E,w,I){var N="",B,H,V,G;for(H in E)if(H!=="__proto__"&&c.call(E,H))if(h(E[H]))for(B={},V=0,G=E[H].length;V<G;V++)E[H][V]!==void 0&&B[E[H][V]+""]===void 0&&(N+="&"+r.buildQueryParameter(H,E[H][V],I),w!==!0&&(B[E[H][V]+""]=!0));else E[H]!==void 0&&(N+="&"+r.buildQueryParameter(H,E[H],I));return N.substring(1)},r.buildQueryParameter=function(E,w,I){return r.encodeQuery(E,I)+(w!==null?"="+r.encodeQuery(w,I):"")},r.addQuery=function(E,w,I){if(typeof w=="object")for(var N in w)c.call(w,N)&&r.addQuery(E,N,w[N]);else if(typeof w=="string"){if(E[w]===void 0){E[w]=I;return}else typeof E[w]=="string"&&(E[w]=[E[w]]);h(I)||(I=[I]),E[w]=(E[w]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(E,w,I){if(typeof w=="object")for(var N in w)c.call(w,N)&&r.setQuery(E,N,w[N]);else if(typeof w=="string")E[w]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(E,w,I){var N,B,H;if(h(w))for(N=0,B=w.length;N<B;N++)E[w[N]]=void 0;else if(f(w)==="RegExp")for(H in E)w.test(H)&&(E[H]=void 0);else if(typeof w=="object")for(H in w)c.call(w,H)&&r.removeQuery(E,H,w[H]);else if(typeof w=="string")I!==void 0?f(I)==="RegExp"?!h(E[w])&&I.test(E[w])?E[w]=void 0:E[w]=p(E[w],I):E[w]===String(I)&&(!h(I)||I.length===1)?E[w]=void 0:h(E[w])&&(E[w]=p(E[w],I)):E[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(E,w,I,N){switch(f(w)){case"String":break;case"RegExp":for(var B in E)if(c.call(E,B)&&w.test(B)&&(I===void 0||r.hasQuery(E,B,I)))return!0;return!1;case"Object":for(var H in w)if(c.call(w,H)&&!r.hasQuery(E,H,w[H]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return w in E;case"Boolean":var V=!!(h(E[w])?E[w].length:E[w]);return I===V;case"Function":return!!I(E[w],w,E);case"Array":if(!h(E[w]))return!1;var G=N?_:m;return G(E[w],I);case"RegExp":return h(E[w])?N?_(E[w],I):!1:!!(E[w]&&E[w].match(I));case"Number":I=String(I);case"String":return h(E[w])?N?_(E[w],I):!1:E[w]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var E=[],w=[],I=0,N=0;N<arguments.length;N++){var B=new r(arguments[N]);E.push(B);for(var H=B.segment(),V=0;V<H.length;V++)typeof H[V]=="string"&&w.push(H[V]),H[V]&&I++}if(!w.length||!I)return new r("");var G=new r("").segment(w);return(E[0].path()===""||E[0].path().slice(0,1)==="/")&&G.path("/"+G.path()),G.normalize()},r.commonPath=function(E,w){var I=Math.min(E.length,w.length),N;for(N=0;N<I;N++)if(E.charAt(N)!==w.charAt(N)){N--;break}return N<1?E.charAt(0)===w.charAt(0)&&E.charAt(0)==="/"?"/":"":((E.charAt(N)!=="/"||w.charAt(N)!=="/")&&(N=E.substring(0,N).lastIndexOf("/")),E.substring(0,N+1))},r.withinString=function(E,w,I){I||(I={});var N=I.start||r.findUri.start,B=I.end||r.findUri.end,H=I.trim||r.findUri.trim,V=I.parens||r.findUri.parens,G=/[a-z0-9-]=["']?$/i;for(N.lastIndex=0;;){var k=N.exec(E);if(!k)break;var W=k.index;if(I.ignoreHtml){var Y=E.slice(Math.max(W-3,0),W);if(Y&&G.test(Y))continue}for(var J=W+E.slice(W).search(B),j=E.slice(W,J),K=-1;;){var Q=V.exec(j);if(!Q)break;var de=Q.index+Q[0].length;K=Math.max(K,de)}if(K>-1?j=j.slice(0,K)+j.slice(K).replace(H,""):j=j.replace(H,""),!(j.length<=k[0].length)&&!(I.ignore&&I.ignore.test(j))){J=W+j.length;var ye=w(j,W,J,E);if(ye===void 0){N.lastIndex=J;continue}ye=String(ye),E=E.slice(0,W)+ye+E.slice(J),N.lastIndex=W+ye.length}}return N.lastIndex=0,E},r.ensureValidHostname=function(E,w){var I=!!E,N=!!w,B=!1;if(N&&(B=_(r.hostProtocols,w)),B&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(E&&E.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(E).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(E){if(E){var w=Number(E);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+E+'" is not a valid port')}},r.noConflict=function(E){if(E){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=o);return this},a.build=function(E){return E===!0?this._deferred_build=!0:(E===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function D(E){return function(w,I){return w===void 0?this._parts[E]||"":(this._parts[E]=w||null,this.build(!I),this)}}function O(E,w){return function(I,N){return I===void 0?this._parts[E]||"":(I!==null&&(I=I+"",I.charAt(0)===w&&(I=I.substring(1))),this._parts[E]=I,this.build(!N),this)}}a.protocol=D("protocol"),a.username=D("username"),a.password=D("password"),a.hostname=D("hostname"),a.port=D("port"),a.query=O("query","?"),a.fragment=O("fragment","#"),a.search=function(E,w){var I=this.query(E,w);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(E,w){var I=this.fragment(E,w);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(E,w){if(E===void 0||E===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return E?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=E?r.recodeUrnPath(E):"":this._parts.path=E?r.recodePath(E):"/",this.build(!w),this},a.path=a.pathname,a.href=function(E,w){var I;if(E===void 0)return this.toString();this._string="",this._parts=r._parts();var N=E instanceof r,B=typeof E=="object"&&(E.hostname||E.path||E.pathname);if(E.nodeName){var H=r.getDomAttribute(E);E=E[H]||"",B=!1}if(!N&&B&&E.pathname!==void 0&&(E=E.toString()),typeof E=="string"||E instanceof String)this._parts=r.parse(String(E),this._parts);else if(N||B){var V=N?E._parts:E;for(I in V)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(E){var w=!1,I=!1,N=!1,B=!1,H=!1,V=!1,G=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,I=r.ip4_expression.test(this._parts.hostname),N=r.ip6_expression.test(this._parts.hostname),w=I||N,B=!w,H=B&&n&&n.has(this._parts.hostname),V=B&&r.idn_expression.test(this._parts.hostname),G=B&&r.punycode_expression.test(this._parts.hostname)),E.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return B;case"sld":return H;case"ip":return w;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return N;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var R=a.protocol,M=a.port,L=a.hostname;a.protocol=function(E,w){if(E&&(E=E.replace(/:(\/\/)?$/,""),!E.match(r.protocol_expression)))throw new TypeError('Protocol "'+E+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,E,w)},a.scheme=a.protocol,a.port=function(E,w){return this._parts.urn?E===void 0?"":this:(E!==void 0&&(E===0&&(E=null),E&&(E+="",E.charAt(0)===":"&&(E=E.substring(1)),r.ensureValidPort(E))),M.call(this,E,w))},a.hostname=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},N=r.parseHost(E,I);if(N!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');E=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(E,this._parts.protocol)}return L.call(this,E,w)},a.origin=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var I=this.protocol(),N=this.authority();return N?(I?I+"://":"")+this.authority():""}else{var B=r(E);return this.protocol(B.protocol()).authority(B.authority()).build(!w),this}},a.host=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(E,this._parts);if(I!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(E,this._parts);if(I!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return E[E.length-1]!=="@"&&(E+="@"),r.parseUserinfo(E,this._parts),this.build(!w),this},a.resource=function(E,w){var I;return E===void 0?this.path()+this.search()+this.hash():(I=r.parse(E),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!w),this)},a.subdomain=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var N=this._parts.hostname.length-this.domain().length,B=this._parts.hostname.substring(0,N),H=new RegExp("^"+u(B));if(E&&E.charAt(E.length-1)!=="."&&(E+="."),E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return E&&r.ensureValidHostname(E,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(H,E),this.build(!w),this}},a.domain=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(w=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var N=this._parts.hostname.length-this.tld(w).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!E)throw new TypeError("cannot set domain empty");if(E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(E,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=E;else{var B=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(B,E)}return this.build(!w),this}},a.tld=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(w=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(I+1);return w!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var B;if(E)if(E.match(/[^a-zA-Z0-9-]/))if(n&&n.is(E))B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,E);else throw new TypeError('TLD "'+E+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,E)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return E?r.decodePath(N):N}else{var B=this._parts.path.length-this.filename().length,H=this._parts.path.substring(0,B),V=new RegExp("^"+u(H));return this.is("relative")||(E||(E="/"),E.charAt(0)!=="/"&&(E="/"+E)),E&&E.charAt(E.length-1)!=="/"&&(E+="/"),E=r.recodePath(E),this._parts.path=this._parts.path.replace(V,E),this.build(!w),this}},a.filename=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(I+1);return E?r.decodePathSegment(N):N}else{var B=!1;E.charAt(0)==="/"&&(E=E.substring(1)),E.match(/\.?\//)&&(B=!0);var H=new RegExp(u(this.filename())+"$");return E=r.recodePath(E),this._parts.path=this._parts.path.replace(H,E),B?this.normalizePath(w):this.build(!w),this}},a.suffix=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),N=I.lastIndexOf("."),B,H;return N===-1?"":(B=I.substring(N+1),H=/^[a-z0-9%]+$/i.test(B)?B:"",E?r.decodePathSegment(H):H)}else{E.charAt(0)==="."&&(E=E.substring(1));var V=this.suffix(),G;if(V)E?G=new RegExp(u(V)+"$"):G=new RegExp(u("."+V)+"$");else{if(!E)return this;this._parts.path+="."+r.recodePath(E)}return G&&(E=r.recodePath(E),this._parts.path=this._parts.path.replace(G,E)),this.build(!w),this}},a.segment=function(E,w,I){var N=this._parts.urn?":":"/",B=this.path(),H=B.substring(0,1)==="/",V=B.split(N);if(E!==void 0&&typeof E!="number"&&(I=w,w=E,E=void 0),E!==void 0&&typeof E!="number")throw new Error('Bad segment "'+E+'", must be 0-based integer');if(H&&V.shift(),E<0&&(E=Math.max(V.length+E,0)),w===void 0)return E===void 0?V:V[E];if(E===null||V[E]===void 0)if(h(w)){V=[];for(var G=0,k=w.length;G<k;G++)!w[G].length&&(!V.length||!V[V.length-1].length)||(V.length&&!V[V.length-1].length&&V.pop(),V.push(x(w[G])))}else(w||typeof w=="string")&&(w=x(w),V[V.length-1]===""?V[V.length-1]=w:V.push(w));else w?V[E]=x(w):V.splice(E,1);return H&&V.unshift(""),this.path(V.join(N),I)},a.segmentCoded=function(E,w,I){var N,B,H;if(typeof E!="number"&&(I=w,w=E,E=void 0),w===void 0){if(N=this.segment(E,w,I),!h(N))N=N!==void 0?r.decode(N):void 0;else for(B=0,H=N.length;B<H;B++)N[B]=r.decode(N[B]);return N}if(!h(w))w=typeof w=="string"||w instanceof String?r.encode(w):w;else for(B=0,H=w.length;B<H;B++)w[B]=r.encode(w[B]);return this.segment(E,w,I)};var g=a.query;return a.query=function(E,w){if(E===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),N=E.call(this,I);return this._parts.query=r.buildQuery(N||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return E!==void 0&&typeof E!="string"?(this._parts.query=r.buildQuery(E,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):g.call(this,E,w)},a.setQuery=function(E,w,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="string"||E instanceof String)N[E]=w!==void 0?w:null;else if(typeof E=="object")for(var B in E)c.call(E,B)&&(N[B]=E[B]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=w),this.build(!I),this},a.addQuery=function(E,w,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(N,E,w===void 0?null:w),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=w),this.build(!I),this},a.removeQuery=function(E,w,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(N,E,w),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=w),this.build(!I),this},a.hasQuery=function(E,w,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(N,E,w,I)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(E){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!E)),this},a.normalizeHostname=function(E){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!E)),this},a.normalizePort=function(E){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!E)),this},a.normalizePath=function(E){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!E),this;if(this._parts.path==="/")return this;w=r.recodePath(w);var I,N="",B,H;for(w.charAt(0)!=="/"&&(I=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(N=w.substring(1).match(/^(\.\.\/)+/)||"",N&&(N=N[0]));B=w.search(/\/\.\.(\/|$)/),B!==-1;){if(B===0){w=w.substring(3);continue}H=w.substring(0,B).lastIndexOf("/"),H===-1&&(H=B),w=w.substring(0,H)+w.substring(B+3)}return I&&this.is("relative")&&(w=N+w.substring(1)),this._parts.path=w,this.build(!E),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(E){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!E)),this},a.normalizeFragment=function(E){return this._parts.fragment||(this._parts.fragment=null,this.build(!E)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var E=r.encode,w=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=E,r.decode=w}return this},a.unicode=function(){var E=r.encode,w=r.decode;r.encode=T,r.decode=unescape;try{this.normalize()}finally{r.encode=E,r.decode=w}return this},a.readable=function(){var E=this.clone();E.username("").password("").normalize();var w="";if(E._parts.protocol&&(w+=E._parts.protocol+"://"),E._parts.hostname&&(E.is("punycode")&&e?(w+=e.toUnicode(E._parts.hostname),E._parts.port&&(w+=":"+E._parts.port)):w+=E.host()),E._parts.hostname&&E._parts.path&&E._parts.path.charAt(0)!=="/"&&(w+="/"),w+=E.path(!0),E._parts.query){for(var I="",N=0,B=E._parts.query.split("&"),H=B.length;N<H;N++){var V=(B[N]||"").split("=");I+="&"+r.decodeQuery(V[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),V[1]!==void 0&&(I+="="+r.decodeQuery(V[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+I.substring(1)}return w+=r.decodeQuery(E.hash(),!0),w},a.absoluteTo=function(E){var w=this.clone(),I=["protocol","username","password","hostname","port"],N,B,H;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E instanceof r||(E=new r(E)),w._parts.protocol||(w._parts.protocol=E._parts.protocol,this._parts.hostname))return w;for(B=0;H=I[B];B++)w._parts[H]=E._parts[H];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(N=E.directory(),N=N||(E.path().indexOf("/")===0?"/":""),w._parts.path=(N?N+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=E._parts.path,w._parts.query||(w._parts.query=E._parts.query)),w.build(),w},a.relativeTo=function(E){var w=this.clone().normalize(),I,N,B,H,V;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E=new r(E).normalize(),I=w._parts,N=E._parts,H=w.path(),V=E.path(),H.charAt(0)!=="/")throw new Error("URI is already relative");if(V.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===N.protocol&&(I.protocol=null),I.username!==N.username||I.password!==N.password||I.protocol!==null||I.username!==null||I.password!==null)return w.build();if(I.hostname===N.hostname&&I.port===N.port)I.hostname=null,I.port=null;else return w.build();if(H===V)return I.path="",w.build();if(B=r.commonPath(H,V),!B)return w.build();var G=N.path.substring(B.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=G+I.path.substring(B.length)||"./",w.build()},a.equals=function(E){var w=this.clone(),I=new r(E),N={},B={},H={},V,G,k;if(w.normalize(),I.normalize(),w.toString()===I.toString())return!0;if(V=w.query(),G=I.query(),w.query(""),I.query(""),w.toString()!==I.toString()||V.length!==G.length)return!1;N=r.parseQuery(V,this._parts.escapeQuerySpace),B=r.parseQuery(G,this._parts.escapeQuerySpace);for(k in N)if(c.call(N,k)){if(h(N[k])){if(!m(N[k],B[k]))return!1}else if(N[k]!==B[k])return!1;H[k]=!0}for(k in B)if(c.call(B,k)&&!H[k])return!1;return!0},a.preventInvalidHostname=function(E){return this._parts.preventInvalidHostname=!!E,this},a.duplicateQueryParameters=function(E){return this._parts.duplicateQueryParameters=!!E,this},a.escapeQuerySpace=function(E){return this._parts.escapeQuerySpace=!!E,this},r})});var bae=Gu((hvn,xae)=>{"use strict";xae.exports=CWe;var Fw=1e20;function CWe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,u,f,h,p,_,m,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,s=p.height,_=h.getImageData(0,0,r,s),c=_.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,s=p.height,_=h.getImageData(0,0,r,s),c=_.data,f=4):window.ImageData&&e instanceof window.ImageData&&(_=e,r=e.width,s=e.height,c=_.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),m=0,x=Math.floor(u.length/f);m<x;m++)c[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*s),T=Array(r*s),C=Array(a),A=Array(a),S=Array(a+1),v=Array(a);for(m=0,x=r*s;m<x;m++){var D=c[m];b[m]=D===1?0:D===0?Fw:Math.pow(Math.max(0,.5-D),2),T[m]=D===1?Fw:D===0?0:Math.pow(Math.max(0,D-.5),2)}_ae(b,r,s,C,A,v,S),_ae(T,r,s,C,A,v,S);var O=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(m=0,x=r*s;m<x;m++)O[m]=Math.min(Math.max(1-((b[m]-T[m])/i+n),0),1);return O}function _ae(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(yae(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(yae(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function yae(e,t,n,i,o){n[0]=0,i[0]=-Fw,i[1]=+Fw;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+Fw}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var Sae=Gu((Pvn,UB)=>{function MWe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,f=10,h=11,p=12,_=13,m=14,x=15,b=16,T=17,C=0,A=1,S=2,v=3,D=4;function O(g,E){return 55296<=g.charCodeAt(E)&&g.charCodeAt(E)<=56319&&56320<=g.charCodeAt(E+1)&&g.charCodeAt(E+1)<=57343}function R(g,E){E===void 0&&(E=0);var w=g.charCodeAt(E);if(55296<=w&&w<=56319&&E<g.length-1){var I=w,N=g.charCodeAt(E+1);return 56320<=N&&N<=57343?(I-55296)*1024+(N-56320)+65536:I}if(56320<=w&&w<=57343&&E>=1){var I=g.charCodeAt(E-1),N=w;return 55296<=I&&I<=56319?(I-55296)*1024+(N-56320)+65536:N}return w}function M(g,E,w){var I=[g].concat(E).concat([w]),N=I[I.length-2],B=w,H=I.lastIndexOf(m);if(H>1&&I.slice(1,H).every(function(k){return k==i})&&[i,_,T].indexOf(g)==-1)return S;var V=I.lastIndexOf(o);if(V>0&&I.slice(1,V).every(function(k){return k==o})&&[p,o].indexOf(N)==-1)return I.filter(function(k){return k==o}).length%2==1?v:D;if(N==e&&B==t)return C;if(N==n||N==e||N==t)return B==m&&E.every(function(k){return k==i})?S:A;if(B==n||B==e||B==t)return A;if(N==s&&(B==s||B==a||B==u||B==f))return C;if((N==u||N==a)&&(B==a||B==c))return C;if((N==f||N==c)&&B==c)return C;if(B==i||B==x)return C;if(B==r)return C;if(N==p)return C;var G=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[_,T].indexOf(I[G])!=-1&&I.slice(G+1,-1).every(function(k){return k==i})&&B==m||N==x&&[b,T].indexOf(B)!=-1?C:E.indexOf(o)!=-1?S:N==o&&B==o?C:A}this.nextBreak=function(g,E){if(E===void 0&&(E=0),E<0)return 0;if(E>=g.length-1)return g.length;for(var w=L(R(g,E)),I=[],N=E+1;N<g.length;N++)if(!O(g,N-1)){var B=L(R(g,N));if(M(w,I,B))return N;I.push(B)}return g.length},this.splitGraphemes=function(g){for(var E=[],w=0,I;(I=this.nextBreak(g,w))<g.length;)E.push(g.slice(w,I)),w=I;return w<g.length&&E.push(g.slice(w)),E},this.iterateGraphemes=function(g){var E=0,w={next:function(){var I,N;return(N=this.nextBreak(g,E))<g.length?(I=g.slice(E,N),E=N,{value:I,done:!1}):E<g.length?(I=g.slice(E),E=g.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(g){for(var E=0,w=0,I;(I=this.nextBreak(g,w))<g.length;)w=I,E++;return w<g.length&&E++,E};function L(g){return 1536<=g&&g<=1541||g==1757||g==1807||g==2274||g==3406||g==69821||70082<=g&&g<=70083||g==72250||72326<=g&&g<=72329||g==73030?p:g==13?e:g==10?t:0<=g&&g<=9||11<=g&&g<=12||14<=g&&g<=31||127<=g&&g<=159||g==173||g==1564||g==6158||g==8203||8206<=g&&g<=8207||g==8232||g==8233||8234<=g&&g<=8238||8288<=g&&g<=8292||g==8293||8294<=g&&g<=8303||55296<=g&&g<=57343||g==65279||65520<=g&&g<=65528||65529<=g&&g<=65531||113824<=g&&g<=113827||119155<=g&&g<=119162||g==917504||g==917505||917506<=g&&g<=917535||917632<=g&&g<=917759||918e3<=g&&g<=921599?n:768<=g&&g<=879||1155<=g&&g<=1159||1160<=g&&g<=1161||1425<=g&&g<=1469||g==1471||1473<=g&&g<=1474||1476<=g&&g<=1477||g==1479||1552<=g&&g<=1562||1611<=g&&g<=1631||g==1648||1750<=g&&g<=1756||1759<=g&&g<=1764||1767<=g&&g<=1768||1770<=g&&g<=1773||g==1809||1840<=g&&g<=1866||1958<=g&&g<=1968||2027<=g&&g<=2035||2070<=g&&g<=2073||2075<=g&&g<=2083||2085<=g&&g<=2087||2089<=g&&g<=2093||2137<=g&&g<=2139||2260<=g&&g<=2273||2275<=g&&g<=2306||g==2362||g==2364||2369<=g&&g<=2376||g==2381||2385<=g&&g<=2391||2402<=g&&g<=2403||g==2433||g==2492||g==2494||2497<=g&&g<=2500||g==2509||g==2519||2530<=g&&g<=2531||2561<=g&&g<=2562||g==2620||2625<=g&&g<=2626||2631<=g&&g<=2632||2635<=g&&g<=2637||g==2641||2672<=g&&g<=2673||g==2677||2689<=g&&g<=2690||g==2748||2753<=g&&g<=2757||2759<=g&&g<=2760||g==2765||2786<=g&&g<=2787||2810<=g&&g<=2815||g==2817||g==2876||g==2878||g==2879||2881<=g&&g<=2884||g==2893||g==2902||g==2903||2914<=g&&g<=2915||g==2946||g==3006||g==3008||g==3021||g==3031||g==3072||3134<=g&&g<=3136||3142<=g&&g<=3144||3146<=g&&g<=3149||3157<=g&&g<=3158||3170<=g&&g<=3171||g==3201||g==3260||g==3263||g==3266||g==3270||3276<=g&&g<=3277||3285<=g&&g<=3286||3298<=g&&g<=3299||3328<=g&&g<=3329||3387<=g&&g<=3388||g==3390||3393<=g&&g<=3396||g==3405||g==3415||3426<=g&&g<=3427||g==3530||g==3535||3538<=g&&g<=3540||g==3542||g==3551||g==3633||3636<=g&&g<=3642||3655<=g&&g<=3662||g==3761||3764<=g&&g<=3769||3771<=g&&g<=3772||3784<=g&&g<=3789||3864<=g&&g<=3865||g==3893||g==3895||g==3897||3953<=g&&g<=3966||3968<=g&&g<=3972||3974<=g&&g<=3975||3981<=g&&g<=3991||3993<=g&&g<=4028||g==4038||4141<=g&&g<=4144||4146<=g&&g<=4151||4153<=g&&g<=4154||4157<=g&&g<=4158||4184<=g&&g<=4185||4190<=g&&g<=4192||4209<=g&&g<=4212||g==4226||4229<=g&&g<=4230||g==4237||g==4253||4957<=g&&g<=4959||5906<=g&&g<=5908||5938<=g&&g<=5940||5970<=g&&g<=5971||6002<=g&&g<=6003||6068<=g&&g<=6069||6071<=g&&g<=6077||g==6086||6089<=g&&g<=6099||g==6109||6155<=g&&g<=6157||6277<=g&&g<=6278||g==6313||6432<=g&&g<=6434||6439<=g&&g<=6440||g==6450||6457<=g&&g<=6459||6679<=g&&g<=6680||g==6683||g==6742||6744<=g&&g<=6750||g==6752||g==6754||6757<=g&&g<=6764||6771<=g&&g<=6780||g==6783||6832<=g&&g<=6845||g==6846||6912<=g&&g<=6915||g==6964||6966<=g&&g<=6970||g==6972||g==6978||7019<=g&&g<=7027||7040<=g&&g<=7041||7074<=g&&g<=7077||7080<=g&&g<=7081||7083<=g&&g<=7085||g==7142||7144<=g&&g<=7145||g==7149||7151<=g&&g<=7153||7212<=g&&g<=7219||7222<=g&&g<=7223||7376<=g&&g<=7378||7380<=g&&g<=7392||7394<=g&&g<=7400||g==7405||g==7412||7416<=g&&g<=7417||7616<=g&&g<=7673||7675<=g&&g<=7679||g==8204||8400<=g&&g<=8412||8413<=g&&g<=8416||g==8417||8418<=g&&g<=8420||8421<=g&&g<=8432||11503<=g&&g<=11505||g==11647||11744<=g&&g<=11775||12330<=g&&g<=12333||12334<=g&&g<=12335||12441<=g&&g<=12442||g==42607||42608<=g&&g<=42610||42612<=g&&g<=42621||42654<=g&&g<=42655||42736<=g&&g<=42737||g==43010||g==43014||g==43019||43045<=g&&g<=43046||43204<=g&&g<=43205||43232<=g&&g<=43249||43302<=g&&g<=43309||43335<=g&&g<=43345||43392<=g&&g<=43394||g==43443||43446<=g&&g<=43449||g==43452||g==43493||43561<=g&&g<=43566||43569<=g&&g<=43570||43573<=g&&g<=43574||g==43587||g==43596||g==43644||g==43696||43698<=g&&g<=43700||43703<=g&&g<=43704||43710<=g&&g<=43711||g==43713||43756<=g&&g<=43757||g==43766||g==44005||g==44008||g==44013||g==64286||65024<=g&&g<=65039||65056<=g&&g<=65071||65438<=g&&g<=65439||g==66045||g==66272||66422<=g&&g<=66426||68097<=g&&g<=68099||68101<=g&&g<=68102||68108<=g&&g<=68111||68152<=g&&g<=68154||g==68159||68325<=g&&g<=68326||g==69633||69688<=g&&g<=69702||69759<=g&&g<=69761||69811<=g&&g<=69814||69817<=g&&g<=69818||69888<=g&&g<=69890||69927<=g&&g<=69931||69933<=g&&g<=69940||g==70003||70016<=g&&g<=70017||70070<=g&&g<=70078||70090<=g&&g<=70092||70191<=g&&g<=70193||g==70196||70198<=g&&g<=70199||g==70206||g==70367||70371<=g&&g<=70378||70400<=g&&g<=70401||g==70460||g==70462||g==70464||g==70487||70502<=g&&g<=70508||70512<=g&&g<=70516||70712<=g&&g<=70719||70722<=g&&g<=70724||g==70726||g==70832||70835<=g&&g<=70840||g==70842||g==70845||70847<=g&&g<=70848||70850<=g&&g<=70851||g==71087||71090<=g&&g<=71093||71100<=g&&g<=71101||71103<=g&&g<=71104||71132<=g&&g<=71133||71219<=g&&g<=71226||g==71229||71231<=g&&g<=71232||g==71339||g==71341||71344<=g&&g<=71349||g==71351||71453<=g&&g<=71455||71458<=g&&g<=71461||71463<=g&&g<=71467||72193<=g&&g<=72198||72201<=g&&g<=72202||72243<=g&&g<=72248||72251<=g&&g<=72254||g==72263||72273<=g&&g<=72278||72281<=g&&g<=72283||72330<=g&&g<=72342||72344<=g&&g<=72345||72752<=g&&g<=72758||72760<=g&&g<=72765||g==72767||72850<=g&&g<=72871||72874<=g&&g<=72880||72882<=g&&g<=72883||72885<=g&&g<=72886||73009<=g&&g<=73014||g==73018||73020<=g&&g<=73021||73023<=g&&g<=73029||g==73031||92912<=g&&g<=92916||92976<=g&&g<=92982||94095<=g&&g<=94098||113821<=g&&g<=113822||g==119141||119143<=g&&g<=119145||119150<=g&&g<=119154||119163<=g&&g<=119170||119173<=g&&g<=119179||119210<=g&&g<=119213||119362<=g&&g<=119364||121344<=g&&g<=121398||121403<=g&&g<=121452||g==121461||g==121476||121499<=g&&g<=121503||121505<=g&&g<=121519||122880<=g&&g<=122886||122888<=g&&g<=122904||122907<=g&&g<=122913||122915<=g&&g<=122916||122918<=g&&g<=122922||125136<=g&&g<=125142||125252<=g&&g<=125258||917536<=g&&g<=917631||917760<=g&&g<=917999?i:127462<=g&&g<=127487?o:g==2307||g==2363||2366<=g&&g<=2368||2377<=g&&g<=2380||2382<=g&&g<=2383||2434<=g&&g<=2435||2495<=g&&g<=2496||2503<=g&&g<=2504||2507<=g&&g<=2508||g==2563||2622<=g&&g<=2624||g==2691||2750<=g&&g<=2752||g==2761||2763<=g&&g<=2764||2818<=g&&g<=2819||g==2880||2887<=g&&g<=2888||2891<=g&&g<=2892||g==3007||3009<=g&&g<=3010||3014<=g&&g<=3016||3018<=g&&g<=3020||3073<=g&&g<=3075||3137<=g&&g<=3140||3202<=g&&g<=3203||g==3262||3264<=g&&g<=3265||3267<=g&&g<=3268||3271<=g&&g<=3272||3274<=g&&g<=3275||3330<=g&&g<=3331||3391<=g&&g<=3392||3398<=g&&g<=3400||3402<=g&&g<=3404||3458<=g&&g<=3459||3536<=g&&g<=3537||3544<=g&&g<=3550||3570<=g&&g<=3571||g==3635||g==3763||3902<=g&&g<=3903||g==3967||g==4145||4155<=g&&g<=4156||4182<=g&&g<=4183||g==4228||g==6070||6078<=g&&g<=6085||6087<=g&&g<=6088||6435<=g&&g<=6438||6441<=g&&g<=6443||6448<=g&&g<=6449||6451<=g&&g<=6456||6681<=g&&g<=6682||g==6741||g==6743||6765<=g&&g<=6770||g==6916||g==6965||g==6971||6973<=g&&g<=6977||6979<=g&&g<=6980||g==7042||g==7073||7078<=g&&g<=7079||g==7082||g==7143||7146<=g&&g<=7148||g==7150||7154<=g&&g<=7155||7204<=g&&g<=7211||7220<=g&&g<=7221||g==7393||7410<=g&&g<=7411||g==7415||43043<=g&&g<=43044||g==43047||43136<=g&&g<=43137||43188<=g&&g<=43203||43346<=g&&g<=43347||g==43395||43444<=g&&g<=43445||43450<=g&&g<=43451||43453<=g&&g<=43456||43567<=g&&g<=43568||43571<=g&&g<=43572||g==43597||g==43755||43758<=g&&g<=43759||g==43765||44003<=g&&g<=44004||44006<=g&&g<=44007||44009<=g&&g<=44010||g==44012||g==69632||g==69634||g==69762||69808<=g&&g<=69810||69815<=g&&g<=69816||g==69932||g==70018||70067<=g&&g<=70069||70079<=g&&g<=70080||70188<=g&&g<=70190||70194<=g&&g<=70195||g==70197||70368<=g&&g<=70370||70402<=g&&g<=70403||g==70463||70465<=g&&g<=70468||70471<=g&&g<=70472||70475<=g&&g<=70477||70498<=g&&g<=70499||70709<=g&&g<=70711||70720<=g&&g<=70721||g==70725||70833<=g&&g<=70834||g==70841||70843<=g&&g<=70844||g==70846||g==70849||71088<=g&&g<=71089||71096<=g&&g<=71099||g==71102||71216<=g&&g<=71218||71227<=g&&g<=71228||g==71230||g==71340||71342<=g&&g<=71343||g==71350||71456<=g&&g<=71457||g==71462||72199<=g&&g<=72200||g==72249||72279<=g&&g<=72280||g==72343||g==72751||g==72766||g==72873||g==72881||g==72884||94033<=g&&g<=94078||g==119142||g==119149?r:4352<=g&&g<=4447||43360<=g&&g<=43388?s:4448<=g&&g<=4519||55216<=g&&g<=55238?a:4520<=g&&g<=4607||55243<=g&&g<=55291?c:g==44032||g==44060||g==44088||g==44116||g==44144||g==44172||g==44200||g==44228||g==44256||g==44284||g==44312||g==44340||g==44368||g==44396||g==44424||g==44452||g==44480||g==44508||g==44536||g==44564||g==44592||g==44620||g==44648||g==44676||g==44704||g==44732||g==44760||g==44788||g==44816||g==44844||g==44872||g==44900||g==44928||g==44956||g==44984||g==45012||g==45040||g==45068||g==45096||g==45124||g==45152||g==45180||g==45208||g==45236||g==45264||g==45292||g==45320||g==45348||g==45376||g==45404||g==45432||g==45460||g==45488||g==45516||g==45544||g==45572||g==45600||g==45628||g==45656||g==45684||g==45712||g==45740||g==45768||g==45796||g==45824||g==45852||g==45880||g==45908||g==45936||g==45964||g==45992||g==46020||g==46048||g==46076||g==46104||g==46132||g==46160||g==46188||g==46216||g==46244||g==46272||g==46300||g==46328||g==46356||g==46384||g==46412||g==46440||g==46468||g==46496||g==46524||g==46552||g==46580||g==46608||g==46636||g==46664||g==46692||g==46720||g==46748||g==46776||g==46804||g==46832||g==46860||g==46888||g==46916||g==46944||g==46972||g==47e3||g==47028||g==47056||g==47084||g==47112||g==47140||g==47168||g==47196||g==47224||g==47252||g==47280||g==47308||g==47336||g==47364||g==47392||g==47420||g==47448||g==47476||g==47504||g==47532||g==47560||g==47588||g==47616||g==47644||g==47672||g==47700||g==47728||g==47756||g==47784||g==47812||g==47840||g==47868||g==47896||g==47924||g==47952||g==47980||g==48008||g==48036||g==48064||g==48092||g==48120||g==48148||g==48176||g==48204||g==48232||g==48260||g==48288||g==48316||g==48344||g==48372||g==48400||g==48428||g==48456||g==48484||g==48512||g==48540||g==48568||g==48596||g==48624||g==48652||g==48680||g==48708||g==48736||g==48764||g==48792||g==48820||g==48848||g==48876||g==48904||g==48932||g==48960||g==48988||g==49016||g==49044||g==49072||g==49100||g==49128||g==49156||g==49184||g==49212||g==49240||g==49268||g==49296||g==49324||g==49352||g==49380||g==49408||g==49436||g==49464||g==49492||g==49520||g==49548||g==49576||g==49604||g==49632||g==49660||g==49688||g==49716||g==49744||g==49772||g==49800||g==49828||g==49856||g==49884||g==49912||g==49940||g==49968||g==49996||g==50024||g==50052||g==50080||g==50108||g==50136||g==50164||g==50192||g==50220||g==50248||g==50276||g==50304||g==50332||g==50360||g==50388||g==50416||g==50444||g==50472||g==50500||g==50528||g==50556||g==50584||g==50612||g==50640||g==50668||g==50696||g==50724||g==50752||g==50780||g==50808||g==50836||g==50864||g==50892||g==50920||g==50948||g==50976||g==51004||g==51032||g==51060||g==51088||g==51116||g==51144||g==51172||g==51200||g==51228||g==51256||g==51284||g==51312||g==51340||g==51368||g==51396||g==51424||g==51452||g==51480||g==51508||g==51536||g==51564||g==51592||g==51620||g==51648||g==51676||g==51704||g==51732||g==51760||g==51788||g==51816||g==51844||g==51872||g==51900||g==51928||g==51956||g==51984||g==52012||g==52040||g==52068||g==52096||g==52124||g==52152||g==52180||g==52208||g==52236||g==52264||g==52292||g==52320||g==52348||g==52376||g==52404||g==52432||g==52460||g==52488||g==52516||g==52544||g==52572||g==52600||g==52628||g==52656||g==52684||g==52712||g==52740||g==52768||g==52796||g==52824||g==52852||g==52880||g==52908||g==52936||g==52964||g==52992||g==53020||g==53048||g==53076||g==53104||g==53132||g==53160||g==53188||g==53216||g==53244||g==53272||g==53300||g==53328||g==53356||g==53384||g==53412||g==53440||g==53468||g==53496||g==53524||g==53552||g==53580||g==53608||g==53636||g==53664||g==53692||g==53720||g==53748||g==53776||g==53804||g==53832||g==53860||g==53888||g==53916||g==53944||g==53972||g==54e3||g==54028||g==54056||g==54084||g==54112||g==54140||g==54168||g==54196||g==54224||g==54252||g==54280||g==54308||g==54336||g==54364||g==54392||g==54420||g==54448||g==54476||g==54504||g==54532||g==54560||g==54588||g==54616||g==54644||g==54672||g==54700||g==54728||g==54756||g==54784||g==54812||g==54840||g==54868||g==54896||g==54924||g==54952||g==54980||g==55008||g==55036||g==55064||g==55092||g==55120||g==55148||g==55176?u:44033<=g&&g<=44059||44061<=g&&g<=44087||44089<=g&&g<=44115||44117<=g&&g<=44143||44145<=g&&g<=44171||44173<=g&&g<=44199||44201<=g&&g<=44227||44229<=g&&g<=44255||44257<=g&&g<=44283||44285<=g&&g<=44311||44313<=g&&g<=44339||44341<=g&&g<=44367||44369<=g&&g<=44395||44397<=g&&g<=44423||44425<=g&&g<=44451||44453<=g&&g<=44479||44481<=g&&g<=44507||44509<=g&&g<=44535||44537<=g&&g<=44563||44565<=g&&g<=44591||44593<=g&&g<=44619||44621<=g&&g<=44647||44649<=g&&g<=44675||44677<=g&&g<=44703||44705<=g&&g<=44731||44733<=g&&g<=44759||44761<=g&&g<=44787||44789<=g&&g<=44815||44817<=g&&g<=44843||44845<=g&&g<=44871||44873<=g&&g<=44899||44901<=g&&g<=44927||44929<=g&&g<=44955||44957<=g&&g<=44983||44985<=g&&g<=45011||45013<=g&&g<=45039||45041<=g&&g<=45067||45069<=g&&g<=45095||45097<=g&&g<=45123||45125<=g&&g<=45151||45153<=g&&g<=45179||45181<=g&&g<=45207||45209<=g&&g<=45235||45237<=g&&g<=45263||45265<=g&&g<=45291||45293<=g&&g<=45319||45321<=g&&g<=45347||45349<=g&&g<=45375||45377<=g&&g<=45403||45405<=g&&g<=45431||45433<=g&&g<=45459||45461<=g&&g<=45487||45489<=g&&g<=45515||45517<=g&&g<=45543||45545<=g&&g<=45571||45573<=g&&g<=45599||45601<=g&&g<=45627||45629<=g&&g<=45655||45657<=g&&g<=45683||45685<=g&&g<=45711||45713<=g&&g<=45739||45741<=g&&g<=45767||45769<=g&&g<=45795||45797<=g&&g<=45823||45825<=g&&g<=45851||45853<=g&&g<=45879||45881<=g&&g<=45907||45909<=g&&g<=45935||45937<=g&&g<=45963||45965<=g&&g<=45991||45993<=g&&g<=46019||46021<=g&&g<=46047||46049<=g&&g<=46075||46077<=g&&g<=46103||46105<=g&&g<=46131||46133<=g&&g<=46159||46161<=g&&g<=46187||46189<=g&&g<=46215||46217<=g&&g<=46243||46245<=g&&g<=46271||46273<=g&&g<=46299||46301<=g&&g<=46327||46329<=g&&g<=46355||46357<=g&&g<=46383||46385<=g&&g<=46411||46413<=g&&g<=46439||46441<=g&&g<=46467||46469<=g&&g<=46495||46497<=g&&g<=46523||46525<=g&&g<=46551||46553<=g&&g<=46579||46581<=g&&g<=46607||46609<=g&&g<=46635||46637<=g&&g<=46663||46665<=g&&g<=46691||46693<=g&&g<=46719||46721<=g&&g<=46747||46749<=g&&g<=46775||46777<=g&&g<=46803||46805<=g&&g<=46831||46833<=g&&g<=46859||46861<=g&&g<=46887||46889<=g&&g<=46915||46917<=g&&g<=46943||46945<=g&&g<=46971||46973<=g&&g<=46999||47001<=g&&g<=47027||47029<=g&&g<=47055||47057<=g&&g<=47083||47085<=g&&g<=47111||47113<=g&&g<=47139||47141<=g&&g<=47167||47169<=g&&g<=47195||47197<=g&&g<=47223||47225<=g&&g<=47251||47253<=g&&g<=47279||47281<=g&&g<=47307||47309<=g&&g<=47335||47337<=g&&g<=47363||47365<=g&&g<=47391||47393<=g&&g<=47419||47421<=g&&g<=47447||47449<=g&&g<=47475||47477<=g&&g<=47503||47505<=g&&g<=47531||47533<=g&&g<=47559||47561<=g&&g<=47587||47589<=g&&g<=47615||47617<=g&&g<=47643||47645<=g&&g<=47671||47673<=g&&g<=47699||47701<=g&&g<=47727||47729<=g&&g<=47755||47757<=g&&g<=47783||47785<=g&&g<=47811||47813<=g&&g<=47839||47841<=g&&g<=47867||47869<=g&&g<=47895||47897<=g&&g<=47923||47925<=g&&g<=47951||47953<=g&&g<=47979||47981<=g&&g<=48007||48009<=g&&g<=48035||48037<=g&&g<=48063||48065<=g&&g<=48091||48093<=g&&g<=48119||48121<=g&&g<=48147||48149<=g&&g<=48175||48177<=g&&g<=48203||48205<=g&&g<=48231||48233<=g&&g<=48259||48261<=g&&g<=48287||48289<=g&&g<=48315||48317<=g&&g<=48343||48345<=g&&g<=48371||48373<=g&&g<=48399||48401<=g&&g<=48427||48429<=g&&g<=48455||48457<=g&&g<=48483||48485<=g&&g<=48511||48513<=g&&g<=48539||48541<=g&&g<=48567||48569<=g&&g<=48595||48597<=g&&g<=48623||48625<=g&&g<=48651||48653<=g&&g<=48679||48681<=g&&g<=48707||48709<=g&&g<=48735||48737<=g&&g<=48763||48765<=g&&g<=48791||48793<=g&&g<=48819||48821<=g&&g<=48847||48849<=g&&g<=48875||48877<=g&&g<=48903||48905<=g&&g<=48931||48933<=g&&g<=48959||48961<=g&&g<=48987||48989<=g&&g<=49015||49017<=g&&g<=49043||49045<=g&&g<=49071||49073<=g&&g<=49099||49101<=g&&g<=49127||49129<=g&&g<=49155||49157<=g&&g<=49183||49185<=g&&g<=49211||49213<=g&&g<=49239||49241<=g&&g<=49267||49269<=g&&g<=49295||49297<=g&&g<=49323||49325<=g&&g<=49351||49353<=g&&g<=49379||49381<=g&&g<=49407||49409<=g&&g<=49435||49437<=g&&g<=49463||49465<=g&&g<=49491||49493<=g&&g<=49519||49521<=g&&g<=49547||49549<=g&&g<=49575||49577<=g&&g<=49603||49605<=g&&g<=49631||49633<=g&&g<=49659||49661<=g&&g<=49687||49689<=g&&g<=49715||49717<=g&&g<=49743||49745<=g&&g<=49771||49773<=g&&g<=49799||49801<=g&&g<=49827||49829<=g&&g<=49855||49857<=g&&g<=49883||49885<=g&&g<=49911||49913<=g&&g<=49939||49941<=g&&g<=49967||49969<=g&&g<=49995||49997<=g&&g<=50023||50025<=g&&g<=50051||50053<=g&&g<=50079||50081<=g&&g<=50107||50109<=g&&g<=50135||50137<=g&&g<=50163||50165<=g&&g<=50191||50193<=g&&g<=50219||50221<=g&&g<=50247||50249<=g&&g<=50275||50277<=g&&g<=50303||50305<=g&&g<=50331||50333<=g&&g<=50359||50361<=g&&g<=50387||50389<=g&&g<=50415||50417<=g&&g<=50443||50445<=g&&g<=50471||50473<=g&&g<=50499||50501<=g&&g<=50527||50529<=g&&g<=50555||50557<=g&&g<=50583||50585<=g&&g<=50611||50613<=g&&g<=50639||50641<=g&&g<=50667||50669<=g&&g<=50695||50697<=g&&g<=50723||50725<=g&&g<=50751||50753<=g&&g<=50779||50781<=g&&g<=50807||50809<=g&&g<=50835||50837<=g&&g<=50863||50865<=g&&g<=50891||50893<=g&&g<=50919||50921<=g&&g<=50947||50949<=g&&g<=50975||50977<=g&&g<=51003||51005<=g&&g<=51031||51033<=g&&g<=51059||51061<=g&&g<=51087||51089<=g&&g<=51115||51117<=g&&g<=51143||51145<=g&&g<=51171||51173<=g&&g<=51199||51201<=g&&g<=51227||51229<=g&&g<=51255||51257<=g&&g<=51283||51285<=g&&g<=51311||51313<=g&&g<=51339||51341<=g&&g<=51367||51369<=g&&g<=51395||51397<=g&&g<=51423||51425<=g&&g<=51451||51453<=g&&g<=51479||51481<=g&&g<=51507||51509<=g&&g<=51535||51537<=g&&g<=51563||51565<=g&&g<=51591||51593<=g&&g<=51619||51621<=g&&g<=51647||51649<=g&&g<=51675||51677<=g&&g<=51703||51705<=g&&g<=51731||51733<=g&&g<=51759||51761<=g&&g<=51787||51789<=g&&g<=51815||51817<=g&&g<=51843||51845<=g&&g<=51871||51873<=g&&g<=51899||51901<=g&&g<=51927||51929<=g&&g<=51955||51957<=g&&g<=51983||51985<=g&&g<=52011||52013<=g&&g<=52039||52041<=g&&g<=52067||52069<=g&&g<=52095||52097<=g&&g<=52123||52125<=g&&g<=52151||52153<=g&&g<=52179||52181<=g&&g<=52207||52209<=g&&g<=52235||52237<=g&&g<=52263||52265<=g&&g<=52291||52293<=g&&g<=52319||52321<=g&&g<=52347||52349<=g&&g<=52375||52377<=g&&g<=52403||52405<=g&&g<=52431||52433<=g&&g<=52459||52461<=g&&g<=52487||52489<=g&&g<=52515||52517<=g&&g<=52543||52545<=g&&g<=52571||52573<=g&&g<=52599||52601<=g&&g<=52627||52629<=g&&g<=52655||52657<=g&&g<=52683||52685<=g&&g<=52711||52713<=g&&g<=52739||52741<=g&&g<=52767||52769<=g&&g<=52795||52797<=g&&g<=52823||52825<=g&&g<=52851||52853<=g&&g<=52879||52881<=g&&g<=52907||52909<=g&&g<=52935||52937<=g&&g<=52963||52965<=g&&g<=52991||52993<=g&&g<=53019||53021<=g&&g<=53047||53049<=g&&g<=53075||53077<=g&&g<=53103||53105<=g&&g<=53131||53133<=g&&g<=53159||53161<=g&&g<=53187||53189<=g&&g<=53215||53217<=g&&g<=53243||53245<=g&&g<=53271||53273<=g&&g<=53299||53301<=g&&g<=53327||53329<=g&&g<=53355||53357<=g&&g<=53383||53385<=g&&g<=53411||53413<=g&&g<=53439||53441<=g&&g<=53467||53469<=g&&g<=53495||53497<=g&&g<=53523||53525<=g&&g<=53551||53553<=g&&g<=53579||53581<=g&&g<=53607||53609<=g&&g<=53635||53637<=g&&g<=53663||53665<=g&&g<=53691||53693<=g&&g<=53719||53721<=g&&g<=53747||53749<=g&&g<=53775||53777<=g&&g<=53803||53805<=g&&g<=53831||53833<=g&&g<=53859||53861<=g&&g<=53887||53889<=g&&g<=53915||53917<=g&&g<=53943||53945<=g&&g<=53971||53973<=g&&g<=53999||54001<=g&&g<=54027||54029<=g&&g<=54055||54057<=g&&g<=54083||54085<=g&&g<=54111||54113<=g&&g<=54139||54141<=g&&g<=54167||54169<=g&&g<=54195||54197<=g&&g<=54223||54225<=g&&g<=54251||54253<=g&&g<=54279||54281<=g&&g<=54307||54309<=g&&g<=54335||54337<=g&&g<=54363||54365<=g&&g<=54391||54393<=g&&g<=54419||54421<=g&&g<=54447||54449<=g&&g<=54475||54477<=g&&g<=54503||54505<=g&&g<=54531||54533<=g&&g<=54559||54561<=g&&g<=54587||54589<=g&&g<=54615||54617<=g&&g<=54643||54645<=g&&g<=54671||54673<=g&&g<=54699||54701<=g&&g<=54727||54729<=g&&g<=54755||54757<=g&&g<=54783||54785<=g&&g<=54811||54813<=g&&g<=54839||54841<=g&&g<=54867||54869<=g&&g<=54895||54897<=g&&g<=54923||54925<=g&&g<=54951||54953<=g&&g<=54979||54981<=g&&g<=55007||55009<=g&&g<=55035||55037<=g&&g<=55063||55065<=g&&g<=55091||55093<=g&&g<=55119||55121<=g&&g<=55147||55149<=g&&g<=55175||55177<=g&&g<=55203?f:g==9757||g==9977||9994<=g&&g<=9997||g==127877||127938<=g&&g<=127940||g==127943||127946<=g&&g<=127948||128066<=g&&g<=128067||128070<=g&&g<=128080||g==128110||128112<=g&&g<=128120||g==128124||128129<=g&&g<=128131||128133<=g&&g<=128135||g==128170||128372<=g&&g<=128373||g==128378||g==128400||128405<=g&&g<=128406||128581<=g&&g<=128583||128587<=g&&g<=128591||g==128675||128692<=g&&g<=128694||g==128704||g==128716||129304<=g&&g<=129308||129310<=g&&g<=129311||g==129318||129328<=g&&g<=129337||129341<=g&&g<=129342||129489<=g&&g<=129501?_:127995<=g&&g<=127999?m:g==8205?x:g==9792||g==9794||9877<=g&&g<=9878||g==9992||g==10084||g==127752||g==127806||g==127859||g==127891||g==127908||g==127912||g==127979||g==127981||g==128139||128187<=g&&g<=128188||g==128295||g==128300||g==128488||g==128640||g==128658?b:128102<=g&&g<=128105?T:h}return this}typeof UB<"u"&&UB.exports&&(UB.exports=MWe)});var hde=Gu((y7,x7)=>{(function(e,t){typeof y7=="object"&&typeof x7<"u"?x7.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(y7,function(){"use strict";function e(b,T,C,A,S){(function v(D,O,R,M,L){for(;M>R;){if(M-R>600){var g=M-R+1,E=O-R+1,w=Math.log(g),I=.5*Math.exp(2*w/3),N=.5*Math.sqrt(w*I*(g-I)/g)*(E-g/2<0?-1:1),B=Math.max(R,Math.floor(O-E*I/g+N)),H=Math.min(M,Math.floor(O+(g-E)*I/g+N));v(D,O,B,H,L)}var V=D[O],G=R,k=M;for(t(D,R,O),L(D[M],V)>0&&t(D,R,M);G<k;){for(t(D,G,k),G++,k--;L(D[G],V)<0;)G++;for(;L(D[k],V)>0;)k--}L(D[R],V)===0?t(D,R,k):t(D,++k,M),k<=O&&(R=k+1),O<=k&&(M=k-1)}})(b,T,C||0,A||b.length-1,S||n)}function t(b,T,C){var A=b[T];b[T]=b[C],b[C]=A}function n(b,T){return b<T?-1:b>T?1:0}var i=function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(b,T,C){if(!C)return T.indexOf(b);for(var A=0;A<T.length;A++)if(C(b,T[A]))return A;return-1}function r(b,T){s(b,0,b.children.length,T,b)}function s(b,T,C,A,S){S||(S=m(null)),S.minX=1/0,S.minY=1/0,S.maxX=-1/0,S.maxY=-1/0;for(var v=T;v<C;v++){var D=b.children[v];a(S,b.leaf?A(D):D)}return S}function a(b,T){return b.minX=Math.min(b.minX,T.minX),b.minY=Math.min(b.minY,T.minY),b.maxX=Math.max(b.maxX,T.maxX),b.maxY=Math.max(b.maxY,T.maxY),b}function c(b,T){return b.minX-T.minX}function u(b,T){return b.minY-T.minY}function f(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}function h(b){return b.maxX-b.minX+(b.maxY-b.minY)}function p(b,T){return b.minX<=T.minX&&b.minY<=T.minY&&T.maxX<=b.maxX&&T.maxY<=b.maxY}function _(b,T){return T.minX<=b.maxX&&T.minY<=b.maxY&&T.maxX>=b.minX&&T.maxY>=b.minY}function m(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(b,T,C,A,S){for(var v=[T,C];v.length;)if(!((C=v.pop())-(T=v.pop())<=A)){var D=T+Math.ceil((C-T)/A/2)*A;e(b,D,T,C,S),v.push(T,D,D,C)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var T=this.data,C=[];if(!_(b,T))return C;for(var A=this.toBBox,S=[];T;){for(var v=0;v<T.children.length;v++){var D=T.children[v],O=T.leaf?A(D):D;_(b,O)&&(T.leaf?C.push(D):p(b,O)?this._all(D,C):S.push(D))}T=S.pop()}return C},i.prototype.collides=function(b){var T=this.data;if(!_(b,T))return!1;for(var C=[];T;){for(var A=0;A<T.children.length;A++){var S=T.children[A],v=T.leaf?this.toBBox(S):S;if(_(b,v)){if(T.leaf||p(b,v))return!0;C.push(S)}}T=C.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var T=0;T<b.length;T++)this.insert(b[T]);return this}var C=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===C.height)this._splitRoot(this.data,C);else{if(this.data.height<C.height){var A=this.data;this.data=C,C=A}this._insert(C,this.data.height-C.height-1,!0)}else this.data=C;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(b,T){if(!b)return this;for(var C,A,S,v=this.data,D=this.toBBox(b),O=[],R=[];v||O.length;){if(v||(v=O.pop(),A=O[O.length-1],C=R.pop(),S=!0),v.leaf){var M=o(b,v.children,T);if(M!==-1)return v.children.splice(M,1),O.push(v),this._condense(O),this}S||v.leaf||!p(v,D)?A?(C++,v=A.children[C],S=!1):v=null:(O.push(v),R.push(C),C=0,A=v,v=v.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,T){return b.minX-T.minX},i.prototype.compareMinY=function(b,T){return b.minY-T.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,T){for(var C=[];b;)b.leaf?T.push.apply(T,b.children):C.push.apply(C,b.children),b=C.pop();return T},i.prototype._build=function(b,T,C,A){var S,v=C-T+1,D=this._maxEntries;if(v<=D)return r(S=m(b.slice(T,C+1)),this.toBBox),S;A||(A=Math.ceil(Math.log(v)/Math.log(D)),D=Math.ceil(v/Math.pow(D,A-1))),(S=m([])).leaf=!1,S.height=A;var O=Math.ceil(v/D),R=O*Math.ceil(Math.sqrt(D));x(b,T,C,R,this.compareMinX);for(var M=T;M<=C;M+=R){var L=Math.min(M+R-1,C);x(b,M,L,O,this.compareMinY);for(var g=M;g<=L;g+=O){var E=Math.min(g+O-1,L);S.children.push(this._build(b,g,E,A-1))}}return r(S,this.toBBox),S},i.prototype._chooseSubtree=function(b,T,C,A){for(;A.push(T),!T.leaf&&A.length-1!==C;){for(var S=1/0,v=1/0,D=void 0,O=0;O<T.children.length;O++){var R=T.children[O],M=f(R),L=(g=b,E=R,(Math.max(E.maxX,g.maxX)-Math.min(E.minX,g.minX))*(Math.max(E.maxY,g.maxY)-Math.min(E.minY,g.minY))-M);L<v?(v=L,S=M<S?M:S,D=R):L===v&&M<S&&(S=M,D=R)}T=D||T.children[0]}var g,E;return T},i.prototype._insert=function(b,T,C){var A=C?b:this.toBBox(b),S=[],v=this._chooseSubtree(A,this.data,T,S);for(v.children.push(b),a(v,A);T>=0&&S[T].children.length>this._maxEntries;)this._split(S,T),T--;this._adjustParentBBoxes(A,S,T)},i.prototype._split=function(b,T){var C=b[T],A=C.children.length,S=this._minEntries;this._chooseSplitAxis(C,S,A);var v=this._chooseSplitIndex(C,S,A),D=m(C.children.splice(v,C.children.length-v));D.height=C.height,D.leaf=C.leaf,r(C,this.toBBox),r(D,this.toBBox),T?b[T-1].children.push(D):this._splitRoot(C,D)},i.prototype._splitRoot=function(b,T){this.data=m([b,T]),this.data.height=b.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,T,C){for(var A,S,v,D,O,R,M,L=1/0,g=1/0,E=T;E<=C-T;E++){var w=s(b,0,E,this.toBBox),I=s(b,E,C,this.toBBox),N=(S=w,v=I,D=void 0,O=void 0,R=void 0,M=void 0,D=Math.max(S.minX,v.minX),O=Math.max(S.minY,v.minY),R=Math.min(S.maxX,v.maxX),M=Math.min(S.maxY,v.maxY),Math.max(0,R-D)*Math.max(0,M-O)),B=f(w)+f(I);N<L?(L=N,A=E,g=B<g?B:g):N===L&&B<g&&(g=B,A=E)}return A||C-T},i.prototype._chooseSplitAxis=function(b,T,C){var A=b.leaf?this.compareMinX:c,S=b.leaf?this.compareMinY:u;this._allDistMargin(b,T,C,A)<this._allDistMargin(b,T,C,S)&&b.children.sort(A)},i.prototype._allDistMargin=function(b,T,C,A){b.children.sort(A);for(var S=this.toBBox,v=s(b,0,T,S),D=s(b,C-T,C,S),O=h(v)+h(D),R=T;R<C-T;R++){var M=b.children[R];a(v,b.leaf?S(M):M),O+=h(v)}for(var L=C-T-1;L>=T;L--){var g=b.children[L];a(D,b.leaf?S(g):g),O+=h(D)}return O},i.prototype._adjustParentBBoxes=function(b,T,C){for(var A=C;A>=0;A--)a(T[A],b)},i.prototype._condense=function(b){for(var T=b.length-1,C=void 0;T>=0;T--)b[T].children.length===0?T>0?(C=b[T-1].children).splice(C.indexOf(b[T]),1):this.clear():r(b[T],this.toBBox)},i})});var VK=Gu((exports,module)=>{/*! + */(function(e,t){"use strict";typeof g1=="object"&&g1.exports?g1.exports=t(c$(),u$(),d$()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(h$,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(E,w){var I=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof r))return I?N?new r(E,w):new r(E):new r;if(E===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?E=location.href+"":E=""}if(E===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(E),w!==void 0?this.absoluteTo(w):this}function s(E){return/^[0-9]+$/.test(E)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function u(E){return E.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(E){return E===void 0?"Undefined":String(Object.prototype.toString.call(E)).slice(8,-1)}function h(E){return f(E)==="Array"}function p(E,w){var I={},N,B;if(f(w)==="RegExp")I=null;else if(h(w))for(N=0,B=w.length;N<B;N++)I[w[N]]=!0;else I[w]=!0;for(N=0,B=E.length;N<B;N++){var H=I&&I[E[N]]!==void 0||!I&&w.test(E[N]);H&&(E.splice(N,1),B--,N--)}return E}function _(E,w){var I,N;if(h(w)){for(I=0,N=w.length;I<N;I++)if(!_(E,w[I]))return!1;return!0}var B=f(w);for(I=0,N=E.length;I<N;I++)if(B==="RegExp"){if(typeof E[I]=="string"&&E[I].match(w))return!0}else if(E[I]===w)return!0;return!1}function m(E,w){if(!h(E)||!h(w)||E.length!==w.length)return!1;E.sort(),w.sort();for(var I=0,N=E.length;I<N;I++)if(E[I]!==w[I])return!1;return!0}function x(E){var w=/^\/+|\/+$/g;return E.replace(w,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(E){if(!(!E||!E.nodeName)){var w=E.nodeName.toLowerCase();if(!(w==="input"&&E.type!=="image"))return r.domAttributes[w]}};function b(E){return escape(E)}function T(E){return encodeURIComponent(E).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=T,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=T,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(E,w){var I=r.encode(E+"");return w===void 0&&(w=r.escapeQuerySpace),w?I.replace(/%20/g,"+"):I},r.decodeQuery=function(E,w){E+="",w===void 0&&(w=r.escapeQuerySpace);try{return r.decode(w?E.replace(/\+/g,"%20"):E)}catch{return E}};var C={encode:"encode",decode:"decode"},A,S=function(E,w){return function(I){try{return r[w](I+"").replace(r.characters[E][w].expression,function(N){return r.characters[E][w].map[N]})}catch{return I}}};for(A in C)r[A+"PathSegment"]=S("pathname",C[A]),r[A+"UrnPathSegment"]=S("urnpath",C[A]);var v=function(E,w,I){return function(N){var B;I?B=function(k){return r[w](r[I](k))}:B=r[w];for(var H=(N+"").split(E),V=0,G=H.length;V<G;V++)H[V]=B(H[V]);return H.join(E)}};r.decodePath=v("/","decodePathSegment"),r.decodeUrnPath=v(":","decodeUrnPathSegment"),r.recodePath=v("/","encodePathSegment","decode"),r.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),r.encodeReserved=S("reserved","encode"),r.parse=function(E,w){var I;return w||(w={preventInvalidHostname:r.preventInvalidHostname}),E=E.replace(r.leading_whitespace_expression,""),E=E.replace(r.ascii_tab_whitespace,""),I=E.indexOf("#"),I>-1&&(w.fragment=E.substring(I+1)||null,E=E.substring(0,I)),I=E.indexOf("?"),I>-1&&(w.query=E.substring(I+1)||null,E=E.substring(0,I)),E=E.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),E=E.replace(/^[/\\]{2,}/i,"//"),E.substring(0,2)==="//"?(w.protocol=null,E=E.substring(2),E=r.parseAuthority(E,w)):(I=E.indexOf(":"),I>-1&&(w.protocol=E.substring(0,I)||null,w.protocol&&!w.protocol.match(r.protocol_expression)?w.protocol=void 0:E.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(E=E.substring(I+3),E=r.parseAuthority(E,w)):(E=E.substring(I+1),w.urn=!0))),w.path=E,w},r.parseHost=function(E,w){E||(E=""),E=E.replace(/\\/g,"/");var I=E.indexOf("/"),N,B;if(I===-1&&(I=E.length),E.charAt(0)==="[")N=E.indexOf("]"),w.hostname=E.substring(1,N)||null,w.port=E.substring(N+2,I)||null,w.port==="/"&&(w.port=null);else{var H=E.indexOf(":"),V=E.indexOf("/"),G=E.indexOf(":",H+1);G!==-1&&(V===-1||G<V)?(w.hostname=E.substring(0,I)||null,w.port=null):(B=E.substring(0,I).split(":"),w.hostname=B[0]||null,w.port=B[1]||null)}return w.hostname&&E.substring(I).charAt(0)!=="/"&&(I++,E="/"+E),w.preventInvalidHostname&&r.ensureValidHostname(w.hostname,w.protocol),w.port&&r.ensureValidPort(w.port),E.substring(I)||"/"},r.parseAuthority=function(E,w){return E=r.parseUserinfo(E,w),r.parseHost(E,w)},r.parseUserinfo=function(E,w){var I=E,N=E.indexOf("\\");N!==-1&&(E=E.replace(/\\/g,"/"));var B=E.indexOf("/"),H=E.lastIndexOf("@",B>-1?B:E.length-1),V;return H>-1&&(B===-1||H<B)?(V=E.substring(0,H).split(":"),w.username=V[0]?r.decode(V[0]):null,V.shift(),w.password=V[0]?r.decode(V.join(":")):null,E=I.substring(H+1)):(w.username=null,w.password=null),E},r.parseQuery=function(E,w){if(!E)return{};if(E=E.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!E)return{};for(var I={},N=E.split("&"),B=N.length,H,V,G,k=0;k<B;k++)H=N[k].split("="),V=r.decodeQuery(H.shift(),w),G=H.length?r.decodeQuery(H.join("="),w):null,V!=="__proto__"&&(c.call(I,V)?((typeof I[V]=="string"||I[V]===null)&&(I[V]=[I[V]]),I[V].push(G)):I[V]=G);return I},r.build=function(E){var w="",I=!1;return E.protocol&&(w+=E.protocol+":"),!E.urn&&(w||E.hostname)&&(w+="//",I=!0),w+=r.buildAuthority(E)||"",typeof E.path=="string"&&(E.path.charAt(0)!=="/"&&I&&(w+="/"),w+=E.path),typeof E.query=="string"&&E.query&&(w+="?"+E.query),typeof E.fragment=="string"&&E.fragment&&(w+="#"+E.fragment),w},r.buildHost=function(E){var w="";if(E.hostname)r.ip6_expression.test(E.hostname)?w+="["+E.hostname+"]":w+=E.hostname;else return"";return E.port&&(w+=":"+E.port),w},r.buildAuthority=function(E){return r.buildUserinfo(E)+r.buildHost(E)},r.buildUserinfo=function(E){var w="";return E.username&&(w+=r.encode(E.username)),E.password&&(w+=":"+r.encode(E.password)),w&&(w+="@"),w},r.buildQuery=function(E,w,I){var N="",B,H,V,G;for(H in E)if(H!=="__proto__"&&c.call(E,H))if(h(E[H]))for(B={},V=0,G=E[H].length;V<G;V++)E[H][V]!==void 0&&B[E[H][V]+""]===void 0&&(N+="&"+r.buildQueryParameter(H,E[H][V],I),w!==!0&&(B[E[H][V]+""]=!0));else E[H]!==void 0&&(N+="&"+r.buildQueryParameter(H,E[H],I));return N.substring(1)},r.buildQueryParameter=function(E,w,I){return r.encodeQuery(E,I)+(w!==null?"="+r.encodeQuery(w,I):"")},r.addQuery=function(E,w,I){if(typeof w=="object")for(var N in w)c.call(w,N)&&r.addQuery(E,N,w[N]);else if(typeof w=="string"){if(E[w]===void 0){E[w]=I;return}else typeof E[w]=="string"&&(E[w]=[E[w]]);h(I)||(I=[I]),E[w]=(E[w]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(E,w,I){if(typeof w=="object")for(var N in w)c.call(w,N)&&r.setQuery(E,N,w[N]);else if(typeof w=="string")E[w]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(E,w,I){var N,B,H;if(h(w))for(N=0,B=w.length;N<B;N++)E[w[N]]=void 0;else if(f(w)==="RegExp")for(H in E)w.test(H)&&(E[H]=void 0);else if(typeof w=="object")for(H in w)c.call(w,H)&&r.removeQuery(E,H,w[H]);else if(typeof w=="string")I!==void 0?f(I)==="RegExp"?!h(E[w])&&I.test(E[w])?E[w]=void 0:E[w]=p(E[w],I):E[w]===String(I)&&(!h(I)||I.length===1)?E[w]=void 0:h(E[w])&&(E[w]=p(E[w],I)):E[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(E,w,I,N){switch(f(w)){case"String":break;case"RegExp":for(var B in E)if(c.call(E,B)&&w.test(B)&&(I===void 0||r.hasQuery(E,B,I)))return!0;return!1;case"Object":for(var H in w)if(c.call(w,H)&&!r.hasQuery(E,H,w[H]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return w in E;case"Boolean":var V=!!(h(E[w])?E[w].length:E[w]);return I===V;case"Function":return!!I(E[w],w,E);case"Array":if(!h(E[w]))return!1;var G=N?_:m;return G(E[w],I);case"RegExp":return h(E[w])?N?_(E[w],I):!1:!!(E[w]&&E[w].match(I));case"Number":I=String(I);case"String":return h(E[w])?N?_(E[w],I):!1:E[w]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var E=[],w=[],I=0,N=0;N<arguments.length;N++){var B=new r(arguments[N]);E.push(B);for(var H=B.segment(),V=0;V<H.length;V++)typeof H[V]=="string"&&w.push(H[V]),H[V]&&I++}if(!w.length||!I)return new r("");var G=new r("").segment(w);return(E[0].path()===""||E[0].path().slice(0,1)==="/")&&G.path("/"+G.path()),G.normalize()},r.commonPath=function(E,w){var I=Math.min(E.length,w.length),N;for(N=0;N<I;N++)if(E.charAt(N)!==w.charAt(N)){N--;break}return N<1?E.charAt(0)===w.charAt(0)&&E.charAt(0)==="/"?"/":"":((E.charAt(N)!=="/"||w.charAt(N)!=="/")&&(N=E.substring(0,N).lastIndexOf("/")),E.substring(0,N+1))},r.withinString=function(E,w,I){I||(I={});var N=I.start||r.findUri.start,B=I.end||r.findUri.end,H=I.trim||r.findUri.trim,V=I.parens||r.findUri.parens,G=/[a-z0-9-]=["']?$/i;for(N.lastIndex=0;;){var k=N.exec(E);if(!k)break;var W=k.index;if(I.ignoreHtml){var Y=E.slice(Math.max(W-3,0),W);if(Y&&G.test(Y))continue}for(var J=W+E.slice(W).search(B),j=E.slice(W,J),K=-1;;){var Q=V.exec(j);if(!Q)break;var de=Q.index+Q[0].length;K=Math.max(K,de)}if(K>-1?j=j.slice(0,K)+j.slice(K).replace(H,""):j=j.replace(H,""),!(j.length<=k[0].length)&&!(I.ignore&&I.ignore.test(j))){J=W+j.length;var xe=w(j,W,J,E);if(xe===void 0){N.lastIndex=J;continue}xe=String(xe),E=E.slice(0,W)+xe+E.slice(J),N.lastIndex=W+xe.length}}return N.lastIndex=0,E},r.ensureValidHostname=function(E,w){var I=!!E,N=!!w,B=!1;if(N&&(B=_(r.hostProtocols,w)),B&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(E&&E.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(E).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(E){if(E){var w=Number(E);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+E+'" is not a valid port')}},r.noConflict=function(E){if(E){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=o);return this},a.build=function(E){return E===!0?this._deferred_build=!0:(E===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function D(E){return function(w,I){return w===void 0?this._parts[E]||"":(this._parts[E]=w||null,this.build(!I),this)}}function O(E,w){return function(I,N){return I===void 0?this._parts[E]||"":(I!==null&&(I=I+"",I.charAt(0)===w&&(I=I.substring(1))),this._parts[E]=I,this.build(!N),this)}}a.protocol=D("protocol"),a.username=D("username"),a.password=D("password"),a.hostname=D("hostname"),a.port=D("port"),a.query=O("query","?"),a.fragment=O("fragment","#"),a.search=function(E,w){var I=this.query(E,w);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(E,w){var I=this.fragment(E,w);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(E,w){if(E===void 0||E===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return E?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=E?r.recodeUrnPath(E):"":this._parts.path=E?r.recodePath(E):"/",this.build(!w),this},a.path=a.pathname,a.href=function(E,w){var I;if(E===void 0)return this.toString();this._string="",this._parts=r._parts();var N=E instanceof r,B=typeof E=="object"&&(E.hostname||E.path||E.pathname);if(E.nodeName){var H=r.getDomAttribute(E);E=E[H]||"",B=!1}if(!N&&B&&E.pathname!==void 0&&(E=E.toString()),typeof E=="string"||E instanceof String)this._parts=r.parse(String(E),this._parts);else if(N||B){var V=N?E._parts:E;for(I in V)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(E){var w=!1,I=!1,N=!1,B=!1,H=!1,V=!1,G=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,I=r.ip4_expression.test(this._parts.hostname),N=r.ip6_expression.test(this._parts.hostname),w=I||N,B=!w,H=B&&n&&n.has(this._parts.hostname),V=B&&r.idn_expression.test(this._parts.hostname),G=B&&r.punycode_expression.test(this._parts.hostname)),E.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return B;case"sld":return H;case"ip":return w;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return N;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var R=a.protocol,M=a.port,L=a.hostname;a.protocol=function(E,w){if(E&&(E=E.replace(/:(\/\/)?$/,""),!E.match(r.protocol_expression)))throw new TypeError('Protocol "'+E+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,E,w)},a.scheme=a.protocol,a.port=function(E,w){return this._parts.urn?E===void 0?"":this:(E!==void 0&&(E===0&&(E=null),E&&(E+="",E.charAt(0)===":"&&(E=E.substring(1)),r.ensureValidPort(E))),M.call(this,E,w))},a.hostname=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},N=r.parseHost(E,I);if(N!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');E=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(E,this._parts.protocol)}return L.call(this,E,w)},a.origin=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var I=this.protocol(),N=this.authority();return N?(I?I+"://":"")+this.authority():""}else{var B=r(E);return this.protocol(B.protocol()).authority(B.authority()).build(!w),this}},a.host=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(E,this._parts);if(I!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(E,this._parts);if(I!=="/")throw new TypeError('Hostname "'+E+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return E[E.length-1]!=="@"&&(E+="@"),r.parseUserinfo(E,this._parts),this.build(!w),this},a.resource=function(E,w){var I;return E===void 0?this.path()+this.search()+this.hash():(I=r.parse(E),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!w),this)},a.subdomain=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var N=this._parts.hostname.length-this.domain().length,B=this._parts.hostname.substring(0,N),H=new RegExp("^"+u(B));if(E&&E.charAt(E.length-1)!=="."&&(E+="."),E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return E&&r.ensureValidHostname(E,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(H,E),this.build(!w),this}},a.domain=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(w=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var N=this._parts.hostname.length-this.tld(w).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!E)throw new TypeError("cannot set domain empty");if(E.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(E,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=E;else{var B=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(B,E)}return this.build(!w),this}},a.tld=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E=="boolean"&&(w=E,E=void 0),E===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(I+1);return w!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var B;if(E)if(E.match(/[^a-zA-Z0-9-]/))if(n&&n.is(E))B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,E);else throw new TypeError('TLD "'+E+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");B=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(B,E)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return E?r.decodePath(N):N}else{var B=this._parts.path.length-this.filename().length,H=this._parts.path.substring(0,B),V=new RegExp("^"+u(H));return this.is("relative")||(E||(E="/"),E.charAt(0)!=="/"&&(E="/"+E)),E&&E.charAt(E.length-1)!=="/"&&(E+="/"),E=r.recodePath(E),this._parts.path=this._parts.path.replace(V,E),this.build(!w),this}},a.filename=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(typeof E!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(I+1);return E?r.decodePathSegment(N):N}else{var B=!1;E.charAt(0)==="/"&&(E=E.substring(1)),E.match(/\.?\//)&&(B=!0);var H=new RegExp(u(this.filename())+"$");return E=r.recodePath(E),this._parts.path=this._parts.path.replace(H,E),B?this.normalizePath(w):this.build(!w),this}},a.suffix=function(E,w){if(this._parts.urn)return E===void 0?"":this;if(E===void 0||E===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),N=I.lastIndexOf("."),B,H;return N===-1?"":(B=I.substring(N+1),H=/^[a-z0-9%]+$/i.test(B)?B:"",E?r.decodePathSegment(H):H)}else{E.charAt(0)==="."&&(E=E.substring(1));var V=this.suffix(),G;if(V)E?G=new RegExp(u(V)+"$"):G=new RegExp(u("."+V)+"$");else{if(!E)return this;this._parts.path+="."+r.recodePath(E)}return G&&(E=r.recodePath(E),this._parts.path=this._parts.path.replace(G,E)),this.build(!w),this}},a.segment=function(E,w,I){var N=this._parts.urn?":":"/",B=this.path(),H=B.substring(0,1)==="/",V=B.split(N);if(E!==void 0&&typeof E!="number"&&(I=w,w=E,E=void 0),E!==void 0&&typeof E!="number")throw new Error('Bad segment "'+E+'", must be 0-based integer');if(H&&V.shift(),E<0&&(E=Math.max(V.length+E,0)),w===void 0)return E===void 0?V:V[E];if(E===null||V[E]===void 0)if(h(w)){V=[];for(var G=0,k=w.length;G<k;G++)!w[G].length&&(!V.length||!V[V.length-1].length)||(V.length&&!V[V.length-1].length&&V.pop(),V.push(x(w[G])))}else(w||typeof w=="string")&&(w=x(w),V[V.length-1]===""?V[V.length-1]=w:V.push(w));else w?V[E]=x(w):V.splice(E,1);return H&&V.unshift(""),this.path(V.join(N),I)},a.segmentCoded=function(E,w,I){var N,B,H;if(typeof E!="number"&&(I=w,w=E,E=void 0),w===void 0){if(N=this.segment(E,w,I),!h(N))N=N!==void 0?r.decode(N):void 0;else for(B=0,H=N.length;B<H;B++)N[B]=r.decode(N[B]);return N}if(!h(w))w=typeof w=="string"||w instanceof String?r.encode(w):w;else for(B=0,H=w.length;B<H;B++)w[B]=r.encode(w[B]);return this.segment(E,w,I)};var g=a.query;return a.query=function(E,w){if(E===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),N=E.call(this,I);return this._parts.query=r.buildQuery(N||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return E!==void 0&&typeof E!="string"?(this._parts.query=r.buildQuery(E,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):g.call(this,E,w)},a.setQuery=function(E,w,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof E=="string"||E instanceof String)N[E]=w!==void 0?w:null;else if(typeof E=="object")for(var B in E)c.call(E,B)&&(N[B]=E[B]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=w),this.build(!I),this},a.addQuery=function(E,w,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(N,E,w===void 0?null:w),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=w),this.build(!I),this},a.removeQuery=function(E,w,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(N,E,w),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof E!="string"&&(I=w),this.build(!I),this},a.hasQuery=function(E,w,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(N,E,w,I)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(E){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!E)),this},a.normalizeHostname=function(E){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!E)),this},a.normalizePort=function(E){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!E)),this},a.normalizePath=function(E){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!E),this;if(this._parts.path==="/")return this;w=r.recodePath(w);var I,N="",B,H;for(w.charAt(0)!=="/"&&(I=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(N=w.substring(1).match(/^(\.\.\/)+/)||"",N&&(N=N[0]));B=w.search(/\/\.\.(\/|$)/),B!==-1;){if(B===0){w=w.substring(3);continue}H=w.substring(0,B).lastIndexOf("/"),H===-1&&(H=B),w=w.substring(0,H)+w.substring(B+3)}return I&&this.is("relative")&&(w=N+w.substring(1)),this._parts.path=w,this.build(!E),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(E){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!E)),this},a.normalizeFragment=function(E){return this._parts.fragment||(this._parts.fragment=null,this.build(!E)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var E=r.encode,w=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=E,r.decode=w}return this},a.unicode=function(){var E=r.encode,w=r.decode;r.encode=T,r.decode=unescape;try{this.normalize()}finally{r.encode=E,r.decode=w}return this},a.readable=function(){var E=this.clone();E.username("").password("").normalize();var w="";if(E._parts.protocol&&(w+=E._parts.protocol+"://"),E._parts.hostname&&(E.is("punycode")&&e?(w+=e.toUnicode(E._parts.hostname),E._parts.port&&(w+=":"+E._parts.port)):w+=E.host()),E._parts.hostname&&E._parts.path&&E._parts.path.charAt(0)!=="/"&&(w+="/"),w+=E.path(!0),E._parts.query){for(var I="",N=0,B=E._parts.query.split("&"),H=B.length;N<H;N++){var V=(B[N]||"").split("=");I+="&"+r.decodeQuery(V[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),V[1]!==void 0&&(I+="="+r.decodeQuery(V[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+I.substring(1)}return w+=r.decodeQuery(E.hash(),!0),w},a.absoluteTo=function(E){var w=this.clone(),I=["protocol","username","password","hostname","port"],N,B,H;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E instanceof r||(E=new r(E)),w._parts.protocol||(w._parts.protocol=E._parts.protocol,this._parts.hostname))return w;for(B=0;H=I[B];B++)w._parts[H]=E._parts[H];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(N=E.directory(),N=N||(E.path().indexOf("/")===0?"/":""),w._parts.path=(N?N+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=E._parts.path,w._parts.query||(w._parts.query=E._parts.query)),w.build(),w},a.relativeTo=function(E){var w=this.clone().normalize(),I,N,B,H,V;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(E=new r(E).normalize(),I=w._parts,N=E._parts,H=w.path(),V=E.path(),H.charAt(0)!=="/")throw new Error("URI is already relative");if(V.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===N.protocol&&(I.protocol=null),I.username!==N.username||I.password!==N.password||I.protocol!==null||I.username!==null||I.password!==null)return w.build();if(I.hostname===N.hostname&&I.port===N.port)I.hostname=null,I.port=null;else return w.build();if(H===V)return I.path="",w.build();if(B=r.commonPath(H,V),!B)return w.build();var G=N.path.substring(B.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=G+I.path.substring(B.length)||"./",w.build()},a.equals=function(E){var w=this.clone(),I=new r(E),N={},B={},H={},V,G,k;if(w.normalize(),I.normalize(),w.toString()===I.toString())return!0;if(V=w.query(),G=I.query(),w.query(""),I.query(""),w.toString()!==I.toString()||V.length!==G.length)return!1;N=r.parseQuery(V,this._parts.escapeQuerySpace),B=r.parseQuery(G,this._parts.escapeQuerySpace);for(k in N)if(c.call(N,k)){if(h(N[k])){if(!m(N[k],B[k]))return!1}else if(N[k]!==B[k])return!1;H[k]=!0}for(k in B)if(c.call(B,k)&&!H[k])return!1;return!0},a.preventInvalidHostname=function(E){return this._parts.preventInvalidHostname=!!E,this},a.duplicateQueryParameters=function(E){return this._parts.duplicateQueryParameters=!!E,this},a.escapeQuerySpace=function(E){return this._parts.escapeQuerySpace=!!E,this},r})});var Tae=Wu((kSn,bae)=>{"use strict";bae.exports=SWe;var Nw=1e20;function SWe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,u,f,h,p,_,m,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,s=p.height,_=h.getImageData(0,0,r,s),c=_.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,s=p.height,_=h.getImageData(0,0,r,s),c=_.data,f=4):window.ImageData&&e instanceof window.ImageData&&(_=e,r=e.width,s=e.height,c=_.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*s),m=0,x=Math.floor(u.length/f);m<x;m++)c[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*s),T=Array(r*s),C=Array(a),A=Array(a),S=Array(a+1),v=Array(a);for(m=0,x=r*s;m<x;m++){var D=c[m];b[m]=D===1?0:D===0?Nw:Math.pow(Math.max(0,.5-D),2),T[m]=D===1?Nw:D===0?0:Math.pow(Math.max(0,D-.5),2)}yae(b,r,s,C,A,v,S),yae(T,r,s,C,A,v,S);var O=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(m=0,x=r*s;m<x;m++)O[m]=Math.min(Math.max(1-((b[m]-T[m])/i+n),0),1);return O}function yae(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(xae(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(xae(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function xae(e,t,n,i,o){n[0]=0,i[0]=-Nw,i[1]=+Nw;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+Nw}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var vae=Wu((tvn,gB)=>{function FWe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,u=9,f=10,h=11,p=12,_=13,m=14,x=15,b=16,T=17,C=0,A=1,S=2,v=3,D=4;function O(g,E){return 55296<=g.charCodeAt(E)&&g.charCodeAt(E)<=56319&&56320<=g.charCodeAt(E+1)&&g.charCodeAt(E+1)<=57343}function R(g,E){E===void 0&&(E=0);var w=g.charCodeAt(E);if(55296<=w&&w<=56319&&E<g.length-1){var I=w,N=g.charCodeAt(E+1);return 56320<=N&&N<=57343?(I-55296)*1024+(N-56320)+65536:I}if(56320<=w&&w<=57343&&E>=1){var I=g.charCodeAt(E-1),N=w;return 55296<=I&&I<=56319?(I-55296)*1024+(N-56320)+65536:N}return w}function M(g,E,w){var I=[g].concat(E).concat([w]),N=I[I.length-2],B=w,H=I.lastIndexOf(m);if(H>1&&I.slice(1,H).every(function(k){return k==i})&&[i,_,T].indexOf(g)==-1)return S;var V=I.lastIndexOf(o);if(V>0&&I.slice(1,V).every(function(k){return k==o})&&[p,o].indexOf(N)==-1)return I.filter(function(k){return k==o}).length%2==1?v:D;if(N==e&&B==t)return C;if(N==n||N==e||N==t)return B==m&&E.every(function(k){return k==i})?S:A;if(B==n||B==e||B==t)return A;if(N==s&&(B==s||B==a||B==u||B==f))return C;if((N==u||N==a)&&(B==a||B==c))return C;if((N==f||N==c)&&B==c)return C;if(B==i||B==x)return C;if(B==r)return C;if(N==p)return C;var G=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[_,T].indexOf(I[G])!=-1&&I.slice(G+1,-1).every(function(k){return k==i})&&B==m||N==x&&[b,T].indexOf(B)!=-1?C:E.indexOf(o)!=-1?S:N==o&&B==o?C:A}this.nextBreak=function(g,E){if(E===void 0&&(E=0),E<0)return 0;if(E>=g.length-1)return g.length;for(var w=L(R(g,E)),I=[],N=E+1;N<g.length;N++)if(!O(g,N-1)){var B=L(R(g,N));if(M(w,I,B))return N;I.push(B)}return g.length},this.splitGraphemes=function(g){for(var E=[],w=0,I;(I=this.nextBreak(g,w))<g.length;)E.push(g.slice(w,I)),w=I;return w<g.length&&E.push(g.slice(w)),E},this.iterateGraphemes=function(g){var E=0,w={next:function(){var I,N;return(N=this.nextBreak(g,E))<g.length?(I=g.slice(E,N),E=N,{value:I,done:!1}):E<g.length?(I=g.slice(E),E=g.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(g){for(var E=0,w=0,I;(I=this.nextBreak(g,w))<g.length;)w=I,E++;return w<g.length&&E++,E};function L(g){return 1536<=g&&g<=1541||g==1757||g==1807||g==2274||g==3406||g==69821||70082<=g&&g<=70083||g==72250||72326<=g&&g<=72329||g==73030?p:g==13?e:g==10?t:0<=g&&g<=9||11<=g&&g<=12||14<=g&&g<=31||127<=g&&g<=159||g==173||g==1564||g==6158||g==8203||8206<=g&&g<=8207||g==8232||g==8233||8234<=g&&g<=8238||8288<=g&&g<=8292||g==8293||8294<=g&&g<=8303||55296<=g&&g<=57343||g==65279||65520<=g&&g<=65528||65529<=g&&g<=65531||113824<=g&&g<=113827||119155<=g&&g<=119162||g==917504||g==917505||917506<=g&&g<=917535||917632<=g&&g<=917759||918e3<=g&&g<=921599?n:768<=g&&g<=879||1155<=g&&g<=1159||1160<=g&&g<=1161||1425<=g&&g<=1469||g==1471||1473<=g&&g<=1474||1476<=g&&g<=1477||g==1479||1552<=g&&g<=1562||1611<=g&&g<=1631||g==1648||1750<=g&&g<=1756||1759<=g&&g<=1764||1767<=g&&g<=1768||1770<=g&&g<=1773||g==1809||1840<=g&&g<=1866||1958<=g&&g<=1968||2027<=g&&g<=2035||2070<=g&&g<=2073||2075<=g&&g<=2083||2085<=g&&g<=2087||2089<=g&&g<=2093||2137<=g&&g<=2139||2260<=g&&g<=2273||2275<=g&&g<=2306||g==2362||g==2364||2369<=g&&g<=2376||g==2381||2385<=g&&g<=2391||2402<=g&&g<=2403||g==2433||g==2492||g==2494||2497<=g&&g<=2500||g==2509||g==2519||2530<=g&&g<=2531||2561<=g&&g<=2562||g==2620||2625<=g&&g<=2626||2631<=g&&g<=2632||2635<=g&&g<=2637||g==2641||2672<=g&&g<=2673||g==2677||2689<=g&&g<=2690||g==2748||2753<=g&&g<=2757||2759<=g&&g<=2760||g==2765||2786<=g&&g<=2787||2810<=g&&g<=2815||g==2817||g==2876||g==2878||g==2879||2881<=g&&g<=2884||g==2893||g==2902||g==2903||2914<=g&&g<=2915||g==2946||g==3006||g==3008||g==3021||g==3031||g==3072||3134<=g&&g<=3136||3142<=g&&g<=3144||3146<=g&&g<=3149||3157<=g&&g<=3158||3170<=g&&g<=3171||g==3201||g==3260||g==3263||g==3266||g==3270||3276<=g&&g<=3277||3285<=g&&g<=3286||3298<=g&&g<=3299||3328<=g&&g<=3329||3387<=g&&g<=3388||g==3390||3393<=g&&g<=3396||g==3405||g==3415||3426<=g&&g<=3427||g==3530||g==3535||3538<=g&&g<=3540||g==3542||g==3551||g==3633||3636<=g&&g<=3642||3655<=g&&g<=3662||g==3761||3764<=g&&g<=3769||3771<=g&&g<=3772||3784<=g&&g<=3789||3864<=g&&g<=3865||g==3893||g==3895||g==3897||3953<=g&&g<=3966||3968<=g&&g<=3972||3974<=g&&g<=3975||3981<=g&&g<=3991||3993<=g&&g<=4028||g==4038||4141<=g&&g<=4144||4146<=g&&g<=4151||4153<=g&&g<=4154||4157<=g&&g<=4158||4184<=g&&g<=4185||4190<=g&&g<=4192||4209<=g&&g<=4212||g==4226||4229<=g&&g<=4230||g==4237||g==4253||4957<=g&&g<=4959||5906<=g&&g<=5908||5938<=g&&g<=5940||5970<=g&&g<=5971||6002<=g&&g<=6003||6068<=g&&g<=6069||6071<=g&&g<=6077||g==6086||6089<=g&&g<=6099||g==6109||6155<=g&&g<=6157||6277<=g&&g<=6278||g==6313||6432<=g&&g<=6434||6439<=g&&g<=6440||g==6450||6457<=g&&g<=6459||6679<=g&&g<=6680||g==6683||g==6742||6744<=g&&g<=6750||g==6752||g==6754||6757<=g&&g<=6764||6771<=g&&g<=6780||g==6783||6832<=g&&g<=6845||g==6846||6912<=g&&g<=6915||g==6964||6966<=g&&g<=6970||g==6972||g==6978||7019<=g&&g<=7027||7040<=g&&g<=7041||7074<=g&&g<=7077||7080<=g&&g<=7081||7083<=g&&g<=7085||g==7142||7144<=g&&g<=7145||g==7149||7151<=g&&g<=7153||7212<=g&&g<=7219||7222<=g&&g<=7223||7376<=g&&g<=7378||7380<=g&&g<=7392||7394<=g&&g<=7400||g==7405||g==7412||7416<=g&&g<=7417||7616<=g&&g<=7673||7675<=g&&g<=7679||g==8204||8400<=g&&g<=8412||8413<=g&&g<=8416||g==8417||8418<=g&&g<=8420||8421<=g&&g<=8432||11503<=g&&g<=11505||g==11647||11744<=g&&g<=11775||12330<=g&&g<=12333||12334<=g&&g<=12335||12441<=g&&g<=12442||g==42607||42608<=g&&g<=42610||42612<=g&&g<=42621||42654<=g&&g<=42655||42736<=g&&g<=42737||g==43010||g==43014||g==43019||43045<=g&&g<=43046||43204<=g&&g<=43205||43232<=g&&g<=43249||43302<=g&&g<=43309||43335<=g&&g<=43345||43392<=g&&g<=43394||g==43443||43446<=g&&g<=43449||g==43452||g==43493||43561<=g&&g<=43566||43569<=g&&g<=43570||43573<=g&&g<=43574||g==43587||g==43596||g==43644||g==43696||43698<=g&&g<=43700||43703<=g&&g<=43704||43710<=g&&g<=43711||g==43713||43756<=g&&g<=43757||g==43766||g==44005||g==44008||g==44013||g==64286||65024<=g&&g<=65039||65056<=g&&g<=65071||65438<=g&&g<=65439||g==66045||g==66272||66422<=g&&g<=66426||68097<=g&&g<=68099||68101<=g&&g<=68102||68108<=g&&g<=68111||68152<=g&&g<=68154||g==68159||68325<=g&&g<=68326||g==69633||69688<=g&&g<=69702||69759<=g&&g<=69761||69811<=g&&g<=69814||69817<=g&&g<=69818||69888<=g&&g<=69890||69927<=g&&g<=69931||69933<=g&&g<=69940||g==70003||70016<=g&&g<=70017||70070<=g&&g<=70078||70090<=g&&g<=70092||70191<=g&&g<=70193||g==70196||70198<=g&&g<=70199||g==70206||g==70367||70371<=g&&g<=70378||70400<=g&&g<=70401||g==70460||g==70462||g==70464||g==70487||70502<=g&&g<=70508||70512<=g&&g<=70516||70712<=g&&g<=70719||70722<=g&&g<=70724||g==70726||g==70832||70835<=g&&g<=70840||g==70842||g==70845||70847<=g&&g<=70848||70850<=g&&g<=70851||g==71087||71090<=g&&g<=71093||71100<=g&&g<=71101||71103<=g&&g<=71104||71132<=g&&g<=71133||71219<=g&&g<=71226||g==71229||71231<=g&&g<=71232||g==71339||g==71341||71344<=g&&g<=71349||g==71351||71453<=g&&g<=71455||71458<=g&&g<=71461||71463<=g&&g<=71467||72193<=g&&g<=72198||72201<=g&&g<=72202||72243<=g&&g<=72248||72251<=g&&g<=72254||g==72263||72273<=g&&g<=72278||72281<=g&&g<=72283||72330<=g&&g<=72342||72344<=g&&g<=72345||72752<=g&&g<=72758||72760<=g&&g<=72765||g==72767||72850<=g&&g<=72871||72874<=g&&g<=72880||72882<=g&&g<=72883||72885<=g&&g<=72886||73009<=g&&g<=73014||g==73018||73020<=g&&g<=73021||73023<=g&&g<=73029||g==73031||92912<=g&&g<=92916||92976<=g&&g<=92982||94095<=g&&g<=94098||113821<=g&&g<=113822||g==119141||119143<=g&&g<=119145||119150<=g&&g<=119154||119163<=g&&g<=119170||119173<=g&&g<=119179||119210<=g&&g<=119213||119362<=g&&g<=119364||121344<=g&&g<=121398||121403<=g&&g<=121452||g==121461||g==121476||121499<=g&&g<=121503||121505<=g&&g<=121519||122880<=g&&g<=122886||122888<=g&&g<=122904||122907<=g&&g<=122913||122915<=g&&g<=122916||122918<=g&&g<=122922||125136<=g&&g<=125142||125252<=g&&g<=125258||917536<=g&&g<=917631||917760<=g&&g<=917999?i:127462<=g&&g<=127487?o:g==2307||g==2363||2366<=g&&g<=2368||2377<=g&&g<=2380||2382<=g&&g<=2383||2434<=g&&g<=2435||2495<=g&&g<=2496||2503<=g&&g<=2504||2507<=g&&g<=2508||g==2563||2622<=g&&g<=2624||g==2691||2750<=g&&g<=2752||g==2761||2763<=g&&g<=2764||2818<=g&&g<=2819||g==2880||2887<=g&&g<=2888||2891<=g&&g<=2892||g==3007||3009<=g&&g<=3010||3014<=g&&g<=3016||3018<=g&&g<=3020||3073<=g&&g<=3075||3137<=g&&g<=3140||3202<=g&&g<=3203||g==3262||3264<=g&&g<=3265||3267<=g&&g<=3268||3271<=g&&g<=3272||3274<=g&&g<=3275||3330<=g&&g<=3331||3391<=g&&g<=3392||3398<=g&&g<=3400||3402<=g&&g<=3404||3458<=g&&g<=3459||3536<=g&&g<=3537||3544<=g&&g<=3550||3570<=g&&g<=3571||g==3635||g==3763||3902<=g&&g<=3903||g==3967||g==4145||4155<=g&&g<=4156||4182<=g&&g<=4183||g==4228||g==6070||6078<=g&&g<=6085||6087<=g&&g<=6088||6435<=g&&g<=6438||6441<=g&&g<=6443||6448<=g&&g<=6449||6451<=g&&g<=6456||6681<=g&&g<=6682||g==6741||g==6743||6765<=g&&g<=6770||g==6916||g==6965||g==6971||6973<=g&&g<=6977||6979<=g&&g<=6980||g==7042||g==7073||7078<=g&&g<=7079||g==7082||g==7143||7146<=g&&g<=7148||g==7150||7154<=g&&g<=7155||7204<=g&&g<=7211||7220<=g&&g<=7221||g==7393||7410<=g&&g<=7411||g==7415||43043<=g&&g<=43044||g==43047||43136<=g&&g<=43137||43188<=g&&g<=43203||43346<=g&&g<=43347||g==43395||43444<=g&&g<=43445||43450<=g&&g<=43451||43453<=g&&g<=43456||43567<=g&&g<=43568||43571<=g&&g<=43572||g==43597||g==43755||43758<=g&&g<=43759||g==43765||44003<=g&&g<=44004||44006<=g&&g<=44007||44009<=g&&g<=44010||g==44012||g==69632||g==69634||g==69762||69808<=g&&g<=69810||69815<=g&&g<=69816||g==69932||g==70018||70067<=g&&g<=70069||70079<=g&&g<=70080||70188<=g&&g<=70190||70194<=g&&g<=70195||g==70197||70368<=g&&g<=70370||70402<=g&&g<=70403||g==70463||70465<=g&&g<=70468||70471<=g&&g<=70472||70475<=g&&g<=70477||70498<=g&&g<=70499||70709<=g&&g<=70711||70720<=g&&g<=70721||g==70725||70833<=g&&g<=70834||g==70841||70843<=g&&g<=70844||g==70846||g==70849||71088<=g&&g<=71089||71096<=g&&g<=71099||g==71102||71216<=g&&g<=71218||71227<=g&&g<=71228||g==71230||g==71340||71342<=g&&g<=71343||g==71350||71456<=g&&g<=71457||g==71462||72199<=g&&g<=72200||g==72249||72279<=g&&g<=72280||g==72343||g==72751||g==72766||g==72873||g==72881||g==72884||94033<=g&&g<=94078||g==119142||g==119149?r:4352<=g&&g<=4447||43360<=g&&g<=43388?s:4448<=g&&g<=4519||55216<=g&&g<=55238?a:4520<=g&&g<=4607||55243<=g&&g<=55291?c:g==44032||g==44060||g==44088||g==44116||g==44144||g==44172||g==44200||g==44228||g==44256||g==44284||g==44312||g==44340||g==44368||g==44396||g==44424||g==44452||g==44480||g==44508||g==44536||g==44564||g==44592||g==44620||g==44648||g==44676||g==44704||g==44732||g==44760||g==44788||g==44816||g==44844||g==44872||g==44900||g==44928||g==44956||g==44984||g==45012||g==45040||g==45068||g==45096||g==45124||g==45152||g==45180||g==45208||g==45236||g==45264||g==45292||g==45320||g==45348||g==45376||g==45404||g==45432||g==45460||g==45488||g==45516||g==45544||g==45572||g==45600||g==45628||g==45656||g==45684||g==45712||g==45740||g==45768||g==45796||g==45824||g==45852||g==45880||g==45908||g==45936||g==45964||g==45992||g==46020||g==46048||g==46076||g==46104||g==46132||g==46160||g==46188||g==46216||g==46244||g==46272||g==46300||g==46328||g==46356||g==46384||g==46412||g==46440||g==46468||g==46496||g==46524||g==46552||g==46580||g==46608||g==46636||g==46664||g==46692||g==46720||g==46748||g==46776||g==46804||g==46832||g==46860||g==46888||g==46916||g==46944||g==46972||g==47e3||g==47028||g==47056||g==47084||g==47112||g==47140||g==47168||g==47196||g==47224||g==47252||g==47280||g==47308||g==47336||g==47364||g==47392||g==47420||g==47448||g==47476||g==47504||g==47532||g==47560||g==47588||g==47616||g==47644||g==47672||g==47700||g==47728||g==47756||g==47784||g==47812||g==47840||g==47868||g==47896||g==47924||g==47952||g==47980||g==48008||g==48036||g==48064||g==48092||g==48120||g==48148||g==48176||g==48204||g==48232||g==48260||g==48288||g==48316||g==48344||g==48372||g==48400||g==48428||g==48456||g==48484||g==48512||g==48540||g==48568||g==48596||g==48624||g==48652||g==48680||g==48708||g==48736||g==48764||g==48792||g==48820||g==48848||g==48876||g==48904||g==48932||g==48960||g==48988||g==49016||g==49044||g==49072||g==49100||g==49128||g==49156||g==49184||g==49212||g==49240||g==49268||g==49296||g==49324||g==49352||g==49380||g==49408||g==49436||g==49464||g==49492||g==49520||g==49548||g==49576||g==49604||g==49632||g==49660||g==49688||g==49716||g==49744||g==49772||g==49800||g==49828||g==49856||g==49884||g==49912||g==49940||g==49968||g==49996||g==50024||g==50052||g==50080||g==50108||g==50136||g==50164||g==50192||g==50220||g==50248||g==50276||g==50304||g==50332||g==50360||g==50388||g==50416||g==50444||g==50472||g==50500||g==50528||g==50556||g==50584||g==50612||g==50640||g==50668||g==50696||g==50724||g==50752||g==50780||g==50808||g==50836||g==50864||g==50892||g==50920||g==50948||g==50976||g==51004||g==51032||g==51060||g==51088||g==51116||g==51144||g==51172||g==51200||g==51228||g==51256||g==51284||g==51312||g==51340||g==51368||g==51396||g==51424||g==51452||g==51480||g==51508||g==51536||g==51564||g==51592||g==51620||g==51648||g==51676||g==51704||g==51732||g==51760||g==51788||g==51816||g==51844||g==51872||g==51900||g==51928||g==51956||g==51984||g==52012||g==52040||g==52068||g==52096||g==52124||g==52152||g==52180||g==52208||g==52236||g==52264||g==52292||g==52320||g==52348||g==52376||g==52404||g==52432||g==52460||g==52488||g==52516||g==52544||g==52572||g==52600||g==52628||g==52656||g==52684||g==52712||g==52740||g==52768||g==52796||g==52824||g==52852||g==52880||g==52908||g==52936||g==52964||g==52992||g==53020||g==53048||g==53076||g==53104||g==53132||g==53160||g==53188||g==53216||g==53244||g==53272||g==53300||g==53328||g==53356||g==53384||g==53412||g==53440||g==53468||g==53496||g==53524||g==53552||g==53580||g==53608||g==53636||g==53664||g==53692||g==53720||g==53748||g==53776||g==53804||g==53832||g==53860||g==53888||g==53916||g==53944||g==53972||g==54e3||g==54028||g==54056||g==54084||g==54112||g==54140||g==54168||g==54196||g==54224||g==54252||g==54280||g==54308||g==54336||g==54364||g==54392||g==54420||g==54448||g==54476||g==54504||g==54532||g==54560||g==54588||g==54616||g==54644||g==54672||g==54700||g==54728||g==54756||g==54784||g==54812||g==54840||g==54868||g==54896||g==54924||g==54952||g==54980||g==55008||g==55036||g==55064||g==55092||g==55120||g==55148||g==55176?u:44033<=g&&g<=44059||44061<=g&&g<=44087||44089<=g&&g<=44115||44117<=g&&g<=44143||44145<=g&&g<=44171||44173<=g&&g<=44199||44201<=g&&g<=44227||44229<=g&&g<=44255||44257<=g&&g<=44283||44285<=g&&g<=44311||44313<=g&&g<=44339||44341<=g&&g<=44367||44369<=g&&g<=44395||44397<=g&&g<=44423||44425<=g&&g<=44451||44453<=g&&g<=44479||44481<=g&&g<=44507||44509<=g&&g<=44535||44537<=g&&g<=44563||44565<=g&&g<=44591||44593<=g&&g<=44619||44621<=g&&g<=44647||44649<=g&&g<=44675||44677<=g&&g<=44703||44705<=g&&g<=44731||44733<=g&&g<=44759||44761<=g&&g<=44787||44789<=g&&g<=44815||44817<=g&&g<=44843||44845<=g&&g<=44871||44873<=g&&g<=44899||44901<=g&&g<=44927||44929<=g&&g<=44955||44957<=g&&g<=44983||44985<=g&&g<=45011||45013<=g&&g<=45039||45041<=g&&g<=45067||45069<=g&&g<=45095||45097<=g&&g<=45123||45125<=g&&g<=45151||45153<=g&&g<=45179||45181<=g&&g<=45207||45209<=g&&g<=45235||45237<=g&&g<=45263||45265<=g&&g<=45291||45293<=g&&g<=45319||45321<=g&&g<=45347||45349<=g&&g<=45375||45377<=g&&g<=45403||45405<=g&&g<=45431||45433<=g&&g<=45459||45461<=g&&g<=45487||45489<=g&&g<=45515||45517<=g&&g<=45543||45545<=g&&g<=45571||45573<=g&&g<=45599||45601<=g&&g<=45627||45629<=g&&g<=45655||45657<=g&&g<=45683||45685<=g&&g<=45711||45713<=g&&g<=45739||45741<=g&&g<=45767||45769<=g&&g<=45795||45797<=g&&g<=45823||45825<=g&&g<=45851||45853<=g&&g<=45879||45881<=g&&g<=45907||45909<=g&&g<=45935||45937<=g&&g<=45963||45965<=g&&g<=45991||45993<=g&&g<=46019||46021<=g&&g<=46047||46049<=g&&g<=46075||46077<=g&&g<=46103||46105<=g&&g<=46131||46133<=g&&g<=46159||46161<=g&&g<=46187||46189<=g&&g<=46215||46217<=g&&g<=46243||46245<=g&&g<=46271||46273<=g&&g<=46299||46301<=g&&g<=46327||46329<=g&&g<=46355||46357<=g&&g<=46383||46385<=g&&g<=46411||46413<=g&&g<=46439||46441<=g&&g<=46467||46469<=g&&g<=46495||46497<=g&&g<=46523||46525<=g&&g<=46551||46553<=g&&g<=46579||46581<=g&&g<=46607||46609<=g&&g<=46635||46637<=g&&g<=46663||46665<=g&&g<=46691||46693<=g&&g<=46719||46721<=g&&g<=46747||46749<=g&&g<=46775||46777<=g&&g<=46803||46805<=g&&g<=46831||46833<=g&&g<=46859||46861<=g&&g<=46887||46889<=g&&g<=46915||46917<=g&&g<=46943||46945<=g&&g<=46971||46973<=g&&g<=46999||47001<=g&&g<=47027||47029<=g&&g<=47055||47057<=g&&g<=47083||47085<=g&&g<=47111||47113<=g&&g<=47139||47141<=g&&g<=47167||47169<=g&&g<=47195||47197<=g&&g<=47223||47225<=g&&g<=47251||47253<=g&&g<=47279||47281<=g&&g<=47307||47309<=g&&g<=47335||47337<=g&&g<=47363||47365<=g&&g<=47391||47393<=g&&g<=47419||47421<=g&&g<=47447||47449<=g&&g<=47475||47477<=g&&g<=47503||47505<=g&&g<=47531||47533<=g&&g<=47559||47561<=g&&g<=47587||47589<=g&&g<=47615||47617<=g&&g<=47643||47645<=g&&g<=47671||47673<=g&&g<=47699||47701<=g&&g<=47727||47729<=g&&g<=47755||47757<=g&&g<=47783||47785<=g&&g<=47811||47813<=g&&g<=47839||47841<=g&&g<=47867||47869<=g&&g<=47895||47897<=g&&g<=47923||47925<=g&&g<=47951||47953<=g&&g<=47979||47981<=g&&g<=48007||48009<=g&&g<=48035||48037<=g&&g<=48063||48065<=g&&g<=48091||48093<=g&&g<=48119||48121<=g&&g<=48147||48149<=g&&g<=48175||48177<=g&&g<=48203||48205<=g&&g<=48231||48233<=g&&g<=48259||48261<=g&&g<=48287||48289<=g&&g<=48315||48317<=g&&g<=48343||48345<=g&&g<=48371||48373<=g&&g<=48399||48401<=g&&g<=48427||48429<=g&&g<=48455||48457<=g&&g<=48483||48485<=g&&g<=48511||48513<=g&&g<=48539||48541<=g&&g<=48567||48569<=g&&g<=48595||48597<=g&&g<=48623||48625<=g&&g<=48651||48653<=g&&g<=48679||48681<=g&&g<=48707||48709<=g&&g<=48735||48737<=g&&g<=48763||48765<=g&&g<=48791||48793<=g&&g<=48819||48821<=g&&g<=48847||48849<=g&&g<=48875||48877<=g&&g<=48903||48905<=g&&g<=48931||48933<=g&&g<=48959||48961<=g&&g<=48987||48989<=g&&g<=49015||49017<=g&&g<=49043||49045<=g&&g<=49071||49073<=g&&g<=49099||49101<=g&&g<=49127||49129<=g&&g<=49155||49157<=g&&g<=49183||49185<=g&&g<=49211||49213<=g&&g<=49239||49241<=g&&g<=49267||49269<=g&&g<=49295||49297<=g&&g<=49323||49325<=g&&g<=49351||49353<=g&&g<=49379||49381<=g&&g<=49407||49409<=g&&g<=49435||49437<=g&&g<=49463||49465<=g&&g<=49491||49493<=g&&g<=49519||49521<=g&&g<=49547||49549<=g&&g<=49575||49577<=g&&g<=49603||49605<=g&&g<=49631||49633<=g&&g<=49659||49661<=g&&g<=49687||49689<=g&&g<=49715||49717<=g&&g<=49743||49745<=g&&g<=49771||49773<=g&&g<=49799||49801<=g&&g<=49827||49829<=g&&g<=49855||49857<=g&&g<=49883||49885<=g&&g<=49911||49913<=g&&g<=49939||49941<=g&&g<=49967||49969<=g&&g<=49995||49997<=g&&g<=50023||50025<=g&&g<=50051||50053<=g&&g<=50079||50081<=g&&g<=50107||50109<=g&&g<=50135||50137<=g&&g<=50163||50165<=g&&g<=50191||50193<=g&&g<=50219||50221<=g&&g<=50247||50249<=g&&g<=50275||50277<=g&&g<=50303||50305<=g&&g<=50331||50333<=g&&g<=50359||50361<=g&&g<=50387||50389<=g&&g<=50415||50417<=g&&g<=50443||50445<=g&&g<=50471||50473<=g&&g<=50499||50501<=g&&g<=50527||50529<=g&&g<=50555||50557<=g&&g<=50583||50585<=g&&g<=50611||50613<=g&&g<=50639||50641<=g&&g<=50667||50669<=g&&g<=50695||50697<=g&&g<=50723||50725<=g&&g<=50751||50753<=g&&g<=50779||50781<=g&&g<=50807||50809<=g&&g<=50835||50837<=g&&g<=50863||50865<=g&&g<=50891||50893<=g&&g<=50919||50921<=g&&g<=50947||50949<=g&&g<=50975||50977<=g&&g<=51003||51005<=g&&g<=51031||51033<=g&&g<=51059||51061<=g&&g<=51087||51089<=g&&g<=51115||51117<=g&&g<=51143||51145<=g&&g<=51171||51173<=g&&g<=51199||51201<=g&&g<=51227||51229<=g&&g<=51255||51257<=g&&g<=51283||51285<=g&&g<=51311||51313<=g&&g<=51339||51341<=g&&g<=51367||51369<=g&&g<=51395||51397<=g&&g<=51423||51425<=g&&g<=51451||51453<=g&&g<=51479||51481<=g&&g<=51507||51509<=g&&g<=51535||51537<=g&&g<=51563||51565<=g&&g<=51591||51593<=g&&g<=51619||51621<=g&&g<=51647||51649<=g&&g<=51675||51677<=g&&g<=51703||51705<=g&&g<=51731||51733<=g&&g<=51759||51761<=g&&g<=51787||51789<=g&&g<=51815||51817<=g&&g<=51843||51845<=g&&g<=51871||51873<=g&&g<=51899||51901<=g&&g<=51927||51929<=g&&g<=51955||51957<=g&&g<=51983||51985<=g&&g<=52011||52013<=g&&g<=52039||52041<=g&&g<=52067||52069<=g&&g<=52095||52097<=g&&g<=52123||52125<=g&&g<=52151||52153<=g&&g<=52179||52181<=g&&g<=52207||52209<=g&&g<=52235||52237<=g&&g<=52263||52265<=g&&g<=52291||52293<=g&&g<=52319||52321<=g&&g<=52347||52349<=g&&g<=52375||52377<=g&&g<=52403||52405<=g&&g<=52431||52433<=g&&g<=52459||52461<=g&&g<=52487||52489<=g&&g<=52515||52517<=g&&g<=52543||52545<=g&&g<=52571||52573<=g&&g<=52599||52601<=g&&g<=52627||52629<=g&&g<=52655||52657<=g&&g<=52683||52685<=g&&g<=52711||52713<=g&&g<=52739||52741<=g&&g<=52767||52769<=g&&g<=52795||52797<=g&&g<=52823||52825<=g&&g<=52851||52853<=g&&g<=52879||52881<=g&&g<=52907||52909<=g&&g<=52935||52937<=g&&g<=52963||52965<=g&&g<=52991||52993<=g&&g<=53019||53021<=g&&g<=53047||53049<=g&&g<=53075||53077<=g&&g<=53103||53105<=g&&g<=53131||53133<=g&&g<=53159||53161<=g&&g<=53187||53189<=g&&g<=53215||53217<=g&&g<=53243||53245<=g&&g<=53271||53273<=g&&g<=53299||53301<=g&&g<=53327||53329<=g&&g<=53355||53357<=g&&g<=53383||53385<=g&&g<=53411||53413<=g&&g<=53439||53441<=g&&g<=53467||53469<=g&&g<=53495||53497<=g&&g<=53523||53525<=g&&g<=53551||53553<=g&&g<=53579||53581<=g&&g<=53607||53609<=g&&g<=53635||53637<=g&&g<=53663||53665<=g&&g<=53691||53693<=g&&g<=53719||53721<=g&&g<=53747||53749<=g&&g<=53775||53777<=g&&g<=53803||53805<=g&&g<=53831||53833<=g&&g<=53859||53861<=g&&g<=53887||53889<=g&&g<=53915||53917<=g&&g<=53943||53945<=g&&g<=53971||53973<=g&&g<=53999||54001<=g&&g<=54027||54029<=g&&g<=54055||54057<=g&&g<=54083||54085<=g&&g<=54111||54113<=g&&g<=54139||54141<=g&&g<=54167||54169<=g&&g<=54195||54197<=g&&g<=54223||54225<=g&&g<=54251||54253<=g&&g<=54279||54281<=g&&g<=54307||54309<=g&&g<=54335||54337<=g&&g<=54363||54365<=g&&g<=54391||54393<=g&&g<=54419||54421<=g&&g<=54447||54449<=g&&g<=54475||54477<=g&&g<=54503||54505<=g&&g<=54531||54533<=g&&g<=54559||54561<=g&&g<=54587||54589<=g&&g<=54615||54617<=g&&g<=54643||54645<=g&&g<=54671||54673<=g&&g<=54699||54701<=g&&g<=54727||54729<=g&&g<=54755||54757<=g&&g<=54783||54785<=g&&g<=54811||54813<=g&&g<=54839||54841<=g&&g<=54867||54869<=g&&g<=54895||54897<=g&&g<=54923||54925<=g&&g<=54951||54953<=g&&g<=54979||54981<=g&&g<=55007||55009<=g&&g<=55035||55037<=g&&g<=55063||55065<=g&&g<=55091||55093<=g&&g<=55119||55121<=g&&g<=55147||55149<=g&&g<=55175||55177<=g&&g<=55203?f:g==9757||g==9977||9994<=g&&g<=9997||g==127877||127938<=g&&g<=127940||g==127943||127946<=g&&g<=127948||128066<=g&&g<=128067||128070<=g&&g<=128080||g==128110||128112<=g&&g<=128120||g==128124||128129<=g&&g<=128131||128133<=g&&g<=128135||g==128170||128372<=g&&g<=128373||g==128378||g==128400||128405<=g&&g<=128406||128581<=g&&g<=128583||128587<=g&&g<=128591||g==128675||128692<=g&&g<=128694||g==128704||g==128716||129304<=g&&g<=129308||129310<=g&&g<=129311||g==129318||129328<=g&&g<=129337||129341<=g&&g<=129342||129489<=g&&g<=129501?_:127995<=g&&g<=127999?m:g==8205?x:g==9792||g==9794||9877<=g&&g<=9878||g==9992||g==10084||g==127752||g==127806||g==127859||g==127891||g==127908||g==127912||g==127979||g==127981||g==128139||128187<=g&&g<=128188||g==128295||g==128300||g==128488||g==128640||g==128658?b:128102<=g&&g<=128105?T:h}return this}typeof gB<"u"&&gB.exports&&(gB.exports=FWe)});var mde=Wu((b7,T7)=>{(function(e,t){typeof b7=="object"&&typeof T7<"u"?T7.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(b7,function(){"use strict";function e(b,T,C,A,S){(function v(D,O,R,M,L){for(;M>R;){if(M-R>600){var g=M-R+1,E=O-R+1,w=Math.log(g),I=.5*Math.exp(2*w/3),N=.5*Math.sqrt(w*I*(g-I)/g)*(E-g/2<0?-1:1),B=Math.max(R,Math.floor(O-E*I/g+N)),H=Math.min(M,Math.floor(O+(g-E)*I/g+N));v(D,O,B,H,L)}var V=D[O],G=R,k=M;for(t(D,R,O),L(D[M],V)>0&&t(D,R,M);G<k;){for(t(D,G,k),G++,k--;L(D[G],V)<0;)G++;for(;L(D[k],V)>0;)k--}L(D[R],V)===0?t(D,R,k):t(D,++k,M),k<=O&&(R=k+1),O<=k&&(M=k-1)}})(b,T,C||0,A||b.length-1,S||n)}function t(b,T,C){var A=b[T];b[T]=b[C],b[C]=A}function n(b,T){return b<T?-1:b>T?1:0}var i=function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(b,T,C){if(!C)return T.indexOf(b);for(var A=0;A<T.length;A++)if(C(b,T[A]))return A;return-1}function r(b,T){s(b,0,b.children.length,T,b)}function s(b,T,C,A,S){S||(S=m(null)),S.minX=1/0,S.minY=1/0,S.maxX=-1/0,S.maxY=-1/0;for(var v=T;v<C;v++){var D=b.children[v];a(S,b.leaf?A(D):D)}return S}function a(b,T){return b.minX=Math.min(b.minX,T.minX),b.minY=Math.min(b.minY,T.minY),b.maxX=Math.max(b.maxX,T.maxX),b.maxY=Math.max(b.maxY,T.maxY),b}function c(b,T){return b.minX-T.minX}function u(b,T){return b.minY-T.minY}function f(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}function h(b){return b.maxX-b.minX+(b.maxY-b.minY)}function p(b,T){return b.minX<=T.minX&&b.minY<=T.minY&&T.maxX<=b.maxX&&T.maxY<=b.maxY}function _(b,T){return T.minX<=b.maxX&&T.minY<=b.maxY&&T.maxX>=b.minX&&T.maxY>=b.minY}function m(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(b,T,C,A,S){for(var v=[T,C];v.length;)if(!((C=v.pop())-(T=v.pop())<=A)){var D=T+Math.ceil((C-T)/A/2)*A;e(b,D,T,C,S),v.push(T,D,D,C)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var T=this.data,C=[];if(!_(b,T))return C;for(var A=this.toBBox,S=[];T;){for(var v=0;v<T.children.length;v++){var D=T.children[v],O=T.leaf?A(D):D;_(b,O)&&(T.leaf?C.push(D):p(b,O)?this._all(D,C):S.push(D))}T=S.pop()}return C},i.prototype.collides=function(b){var T=this.data;if(!_(b,T))return!1;for(var C=[];T;){for(var A=0;A<T.children.length;A++){var S=T.children[A],v=T.leaf?this.toBBox(S):S;if(_(b,v)){if(T.leaf||p(b,v))return!0;C.push(S)}}T=C.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var T=0;T<b.length;T++)this.insert(b[T]);return this}var C=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===C.height)this._splitRoot(this.data,C);else{if(this.data.height<C.height){var A=this.data;this.data=C,C=A}this._insert(C,this.data.height-C.height-1,!0)}else this.data=C;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(b,T){if(!b)return this;for(var C,A,S,v=this.data,D=this.toBBox(b),O=[],R=[];v||O.length;){if(v||(v=O.pop(),A=O[O.length-1],C=R.pop(),S=!0),v.leaf){var M=o(b,v.children,T);if(M!==-1)return v.children.splice(M,1),O.push(v),this._condense(O),this}S||v.leaf||!p(v,D)?A?(C++,v=A.children[C],S=!1):v=null:(O.push(v),R.push(C),C=0,A=v,v=v.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,T){return b.minX-T.minX},i.prototype.compareMinY=function(b,T){return b.minY-T.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,T){for(var C=[];b;)b.leaf?T.push.apply(T,b.children):C.push.apply(C,b.children),b=C.pop();return T},i.prototype._build=function(b,T,C,A){var S,v=C-T+1,D=this._maxEntries;if(v<=D)return r(S=m(b.slice(T,C+1)),this.toBBox),S;A||(A=Math.ceil(Math.log(v)/Math.log(D)),D=Math.ceil(v/Math.pow(D,A-1))),(S=m([])).leaf=!1,S.height=A;var O=Math.ceil(v/D),R=O*Math.ceil(Math.sqrt(D));x(b,T,C,R,this.compareMinX);for(var M=T;M<=C;M+=R){var L=Math.min(M+R-1,C);x(b,M,L,O,this.compareMinY);for(var g=M;g<=L;g+=O){var E=Math.min(g+O-1,L);S.children.push(this._build(b,g,E,A-1))}}return r(S,this.toBBox),S},i.prototype._chooseSubtree=function(b,T,C,A){for(;A.push(T),!T.leaf&&A.length-1!==C;){for(var S=1/0,v=1/0,D=void 0,O=0;O<T.children.length;O++){var R=T.children[O],M=f(R),L=(g=b,E=R,(Math.max(E.maxX,g.maxX)-Math.min(E.minX,g.minX))*(Math.max(E.maxY,g.maxY)-Math.min(E.minY,g.minY))-M);L<v?(v=L,S=M<S?M:S,D=R):L===v&&M<S&&(S=M,D=R)}T=D||T.children[0]}var g,E;return T},i.prototype._insert=function(b,T,C){var A=C?b:this.toBBox(b),S=[],v=this._chooseSubtree(A,this.data,T,S);for(v.children.push(b),a(v,A);T>=0&&S[T].children.length>this._maxEntries;)this._split(S,T),T--;this._adjustParentBBoxes(A,S,T)},i.prototype._split=function(b,T){var C=b[T],A=C.children.length,S=this._minEntries;this._chooseSplitAxis(C,S,A);var v=this._chooseSplitIndex(C,S,A),D=m(C.children.splice(v,C.children.length-v));D.height=C.height,D.leaf=C.leaf,r(C,this.toBBox),r(D,this.toBBox),T?b[T-1].children.push(D):this._splitRoot(C,D)},i.prototype._splitRoot=function(b,T){this.data=m([b,T]),this.data.height=b.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,T,C){for(var A,S,v,D,O,R,M,L=1/0,g=1/0,E=T;E<=C-T;E++){var w=s(b,0,E,this.toBBox),I=s(b,E,C,this.toBBox),N=(S=w,v=I,D=void 0,O=void 0,R=void 0,M=void 0,D=Math.max(S.minX,v.minX),O=Math.max(S.minY,v.minY),R=Math.min(S.maxX,v.maxX),M=Math.min(S.maxY,v.maxY),Math.max(0,R-D)*Math.max(0,M-O)),B=f(w)+f(I);N<L?(L=N,A=E,g=B<g?B:g):N===L&&B<g&&(g=B,A=E)}return A||C-T},i.prototype._chooseSplitAxis=function(b,T,C){var A=b.leaf?this.compareMinX:c,S=b.leaf?this.compareMinY:u;this._allDistMargin(b,T,C,A)<this._allDistMargin(b,T,C,S)&&b.children.sort(A)},i.prototype._allDistMargin=function(b,T,C,A){b.children.sort(A);for(var S=this.toBBox,v=s(b,0,T,S),D=s(b,C-T,C,S),O=h(v)+h(D),R=T;R<C-T;R++){var M=b.children[R];a(v,b.leaf?S(M):M),O+=h(v)}for(var L=C-T-1;L>=T;L--){var g=b.children[L];a(D,b.leaf?S(g):g),O+=h(D)}return O},i.prototype._adjustParentBBoxes=function(b,T,C){for(var A=C;A>=0;A--)a(T[A],b)},i.prototype._condense=function(b){for(var T=b.length-1,C=void 0;T>=0;T--)b[T].children.length===0?T>0?(C=b[T-1].children).splice(C.indexOf(b[T]),1):this.clear():r(b[T],this.toBBox)},i})});var UK=Wu((exports,module)=>{/*! * protobuf.js v7.4.0 (c) 2016, daniel wirtz * compiled thu, 22 aug 2024 20:30:39 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details - */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(h,p){s[a]=function(m){if(u)if(u=!1,m)p(m);else{for(var x=new Array(arguments.length-1),b=0;b<x.length;)x[b++]=arguments[b];h.apply(null,x)}};try{o.apply(r||null,s)}catch(_){u&&(u=!1,p(_))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var h=0;--f%4>1&&u.charAt(f)==="=";)++h;return Math.ceil(u.length*3)/4-h};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,h){for(var p=null,_=[],m=0,x=0,b;f<h;){var T=u[f++];switch(x){case 0:_[m++]=o[T>>2],b=(T&3)<<4,x=1;break;case 1:_[m++]=o[b|T>>4],b=(T&15)<<2,x=2;break;case 2:_[m++]=o[b|T>>6],_[m++]=o[T&63],x=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,_)),m=0)}return x&&(_[m++]=o[b],_[m++]=61,x===1&&(_[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,_.slice(0,m))),p.join("")):String.fromCharCode.apply(String,_.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,h){for(var p=h,_=0,m,x=0;x<u.length;){var b=u.charCodeAt(x++);if(b===61&&_>1)break;if((b=r[b])===undefined)throw Error(a);switch(_){case 0:m=b,_=1;break;case 1:f[h++]=m<<2|(b&48)>>4,m=b,_=2;break;case 2:f[h++]=(m&15)<<4|(b&60)>>2,m=b,_=3;break;case 3:f[h++]=(m&3)<<6|b,_=0;break}}if(_===1)throw Error(a);return h-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),h=f[3]===128;function p(b,T,C){u[0]=b,T[C]=f[0],T[C+1]=f[1],T[C+2]=f[2],T[C+3]=f[3]}function _(b,T,C){u[0]=b,T[C]=f[3],T[C+1]=f[2],T[C+2]=f[1],T[C+3]=f[0]}c.writeFloatLE=h?p:_,c.writeFloatBE=h?_:p;function m(b,T){return f[0]=b[T],f[1]=b[T+1],f[2]=b[T+2],f[3]=b[T+3],u[0]}function x(b,T){return f[3]=b[T],f[2]=b[T+1],f[1]=b[T+2],f[0]=b[T+3],u[0]}c.readFloatLE=h?m:x,c.readFloatBE=h?x:m}():function(){function u(h,p,_,m){var x=p<0?1:0;if(x&&(p=-p),p===0)h(1/p>0?0:2147483648,_,m);else if(isNaN(p))h(2143289344,_,m);else if(p>34028234663852886e22)h((x<<31|2139095040)>>>0,_,m);else if(p<11754943508222875e-54)h((x<<31|Math.round(p/1401298464324817e-60))>>>0,_,m);else{var b=Math.floor(Math.log(p)/Math.LN2),T=Math.round(p*Math.pow(2,-b)*8388608)&8388607;h((x<<31|b+127<<23|T)>>>0,_,m)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(h,p,_){var m=h(p,_),x=(m>>31)*2+1,b=m>>>23&255,T=m&8388607;return b===255?T?NaN:x*(1/0):b===0?x*1401298464324817e-60*T:x*Math.pow(2,b-150)*(T+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),h=f[7]===128;function p(b,T,C){u[0]=b,T[C]=f[0],T[C+1]=f[1],T[C+2]=f[2],T[C+3]=f[3],T[C+4]=f[4],T[C+5]=f[5],T[C+6]=f[6],T[C+7]=f[7]}function _(b,T,C){u[0]=b,T[C]=f[7],T[C+1]=f[6],T[C+2]=f[5],T[C+3]=f[4],T[C+4]=f[3],T[C+5]=f[2],T[C+6]=f[1],T[C+7]=f[0]}c.writeDoubleLE=h?p:_,c.writeDoubleBE=h?_:p;function m(b,T){return f[0]=b[T],f[1]=b[T+1],f[2]=b[T+2],f[3]=b[T+3],f[4]=b[T+4],f[5]=b[T+5],f[6]=b[T+6],f[7]=b[T+7],u[0]}function x(b,T){return f[7]=b[T],f[6]=b[T+1],f[5]=b[T+2],f[4]=b[T+3],f[3]=b[T+4],f[2]=b[T+5],f[1]=b[T+6],f[0]=b[T+7],u[0]}c.readDoubleLE=h?m:x,c.readDoubleBE=h?x:m}():function(){function u(h,p,_,m,x,b){var T=m<0?1:0;if(T&&(m=-m),m===0)h(0,x,b+p),h(1/m>0?0:2147483648,x,b+_);else if(isNaN(m))h(0,x,b+p),h(2146959360,x,b+_);else if(m>17976931348623157e292)h(0,x,b+p),h((T<<31|2146435072)>>>0,x,b+_);else{var C;if(m<22250738585072014e-324)C=m/5e-324,h(C>>>0,x,b+p),h((T<<31|C/4294967296)>>>0,x,b+_);else{var A=Math.floor(Math.log(m)/Math.LN2);A===1024&&(A=1023),C=m*Math.pow(2,-A),h(C*4503599627370496>>>0,x,b+p),h((T<<31|A+1023<<20|C*1048576&1048575)>>>0,x,b+_)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(h,p,_,m,x){var b=h(m,x+p),T=h(m,x+_),C=(T>>31)*2+1,A=T>>>20&2047,S=4294967296*(T&1048575)+b;return A===2047?S?NaN:C*(1/0):A===0?C*5e-324*S:C*Math.pow(2,A-1075)*(S+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return o(p);f+p>a&&(u=o(a),f=0);var _=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),_}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var u=null,f=[],h=0,p;s<a;)p=r[s++],p<128?f[h++]=p:p>191&&p<224?f[h++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,f[h++]=55296+(p>>10),f[h++]=56320+(p&1023)):f[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),h=0);return u?(h&&u.push(String.fromCharCode.apply(String,f.slice(0,h))),u.join("")):String.fromCharCode.apply(String,f.slice(0,h))},i.write=function(r,s,a){for(var c=a,u,f,h=0;h<r.length;++h)u=r.charCodeAt(h),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(h+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++h,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(m,x){return RangeError("index out of range: "+m.pos+" + "+(x||1)+" > "+m.len)}function c(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(c.create=function(C){return i.Buffer.isBuffer(C)?new o(C):u(C)})(b)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function h(){var m=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,m}if(this.len-this.pos>4){for(;x<5;++x)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(m,x){return(m[x-4]|m[x-3]<<8|m[x-2]<<16|m[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function _(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),b=this.pos,T=this.pos+x;if(T>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(b,T);if(b===T){var C=i.Buffer;return C?C.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,b,T)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},c._configure=function(m){o=m,c.create=f(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[x](!1)},uint64:function(){return h.call(this)[x](!0)},sint64:function(){return h.call(this).zzDecode()[x](!1)},fixed64:function(){return _.call(this)[x](!0)},sfixed64:function(){return _.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var h=this;if(!f)return i.asPromise(r,h,s,a,c,u);if(!h.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(_,m){if(_)return h.emit("error",_,s),f(_);if(m===null)return h.end(!0),undefined;if(!(m instanceof c))try{m=c[h.responseDelimited?"decodeDelimited":"decode"](m)}catch(x){return h.emit("error",x,s),f(x)}return h.emit("data",m,s),f(null,m)})}catch(p){return h.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var h=u>>>0,p=(u-h)/4294967296>>>0;return f&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,h=~this.hi>>>0;return f||(h=h+1>>>0),-(f+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:h<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),h=f.length-1;h>-1;--h)if(c[f[h]]===1&&this[f[h]]!==undefined&&this[f[h]]!==null)return f[h]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,u){return new s(c,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=h;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(A,S,v){this.fn=A,this.len=S,this.next=undefined,this.val=v}function u(){}function f(A){this.head=A.head,this.tail=A.tail,this.len=A.len,this.next=A.states}function h(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(h.create=function(){return new o})()}:function(){return new h}};h.create=p(),h.alloc=function(S){return new i.Array(S)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(S,v,D){return this.tail=this.tail.next=new c(S,v,D),this.len+=v,this};function _(A,S,v){S[v]=A&255}function m(A,S,v){for(;A>127;)S[v++]=A&127|128,A>>>=7;S[v]=A}function x(A,S){this.len=A,this.next=undefined,this.val=S}x.prototype=Object.create(c.prototype),x.prototype.fn=m,h.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new x((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},h.prototype.int32=function(S){return S<0?this._push(b,10,r.fromNumber(S)):this.uint32(S)},h.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function b(A,S,v){for(;A.hi;)S[v++]=A.lo&127|128,A.lo=(A.lo>>>7|A.hi<<25)>>>0,A.hi>>>=7;for(;A.lo>127;)S[v++]=A.lo&127|128,A.lo=A.lo>>>7;S[v++]=A.lo}h.prototype.uint64=function(S){var v=r.from(S);return this._push(b,v.length(),v)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(S){var v=r.from(S).zzEncode();return this._push(b,v.length(),v)},h.prototype.bool=function(S){return this._push(_,1,S?1:0)};function T(A,S,v){S[v]=A&255,S[v+1]=A>>>8&255,S[v+2]=A>>>16&255,S[v+3]=A>>>24}h.prototype.fixed32=function(S){return this._push(T,4,S>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(S){var v=r.from(S);return this._push(T,4,v.lo)._push(T,4,v.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},h.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var C=i.Array.prototype.set?function(S,v,D){v.set(S,D)}:function(S,v,D){for(var O=0;O<S.length;++O)v[D+O]=S[O]};h.prototype.bytes=function(S){var v=S.length>>>0;if(!v)return this._push(_,1,0);if(i.isString(S)){var D=h.alloc(v=s.length(S));s.decode(S,D,0),S=D}return this.uint32(v)._push(C,v,S)},h.prototype.string=function(S){var v=a.length(S);return v?this.uint32(v)._push(a.write,v,S):this._push(_,1,0)},h.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},h.prototype.ldelim=function(){var S=this.head,v=this.tail,D=this.len;return this.reset().uint32(D),D&&(this.tail.next=S.next,this.tail=v,this.len+=D),this},h.prototype.finish=function(){for(var S=this.head.next,v=this.constructor.alloc(this.len),D=0;S;)S.fn(S.val,v,D),D+=S.len,S=S.next;return v},h._configure=function(A){o=A,h.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var h=0;h<c.length;)u[f++]=c[h++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var ZTe=Gu((Jki,p8)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(f,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,_=c(f,h.inputOffset||0,p),m=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,x=r(_,h.pixelType||Float32Array,h.encodedMaskData,m,h.returnMask),b={width:_.width,height:_.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:_.pixels.maxValue,noDataValue:m};return x.resultMask&&(b.maskData=x.resultMask),h.returnEncodedMask&&_.mask&&(b.encodedMaskData=_.mask.bitset?_.mask.bitset:null),h.returnFileInfo&&(b.fileInfo=s(_),h.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(_))),b};var r=function(f,h,p,_,m){var x=0,b=f.pixels.numBlocksX,T=f.pixels.numBlocksY,C=Math.floor(f.width/b),A=Math.floor(f.height/T),S=2*f.maxZError,v=Number.MAX_VALUE,D;p=p||(f.mask?f.mask.bitset:null);var O,R;O=new h(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var M=new Float32Array(C*A),L,g,E=0;E<=T;E++){var w=E!==T?A:f.height%T;if(w!==0)for(var I=0;I<=b;I++){var N=I!==b?C:f.width%b;if(N!==0){var B=E*f.width*A+I*C,H=f.width-N,V=f.pixels.blocks[x],G,k,W;V.encoding<2?(V.encoding===0?G=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,S,M,f.pixels.maxValue),G=M),k=0):V.encoding===2?W=0:W=V.offset;var Y;if(p)for(g=0;g<w;g++){for(B&7&&(Y=p[B>>3],Y<<=B&7),L=0;L<N;L++)B&7||(Y=p[B>>3]),Y&128?(R&&(R[B]=1),D=V.encoding<2?G[k++]:W,v=v>D?D:v,O[B++]=D):(R&&(R[B]=0),O[B++]=_),Y<<=1;B+=H}else if(V.encoding<2)for(g=0;g<w;g++){for(L=0;L<N;L++)D=G[k++],v=v>D?D:v,O[B++]=D;B+=H}else for(v=v>W?W:v,g=0;g<w;g++){for(L=0;L<N;L++)O[B++]=W;B+=H}if(V.encoding===1&&k!==V.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:O,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var h=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},_=0;_<h;_++){var m=f.pixels.blocks[_];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,h,p){var _={},m=new Uint8Array(f,h,10);if(_.fileIdentifierString=String.fromCharCode.apply(null,m),_.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+_.fileIdentifierString;h+=10;var x=new DataView(f,h,24);if(_.fileVersion=x.getInt32(0,!0),_.imageType=x.getInt32(4,!0),_.height=x.getUint32(8,!0),_.width=x.getUint32(12,!0),_.maxZError=x.getFloat64(16,!0),h+=24,!p)if(x=new DataView(f,h,16),_.mask={},_.mask.numBlocksY=x.getUint32(0,!0),_.mask.numBlocksX=x.getUint32(4,!0),_.mask.numBytes=x.getUint32(8,!0),_.mask.maxValue=x.getFloat32(12,!0),h+=16,_.mask.numBytes>0){var b=new Uint8Array(Math.ceil(_.width*_.height/8));x=new DataView(f,h,_.mask.numBytes);var T=x.getInt16(0,!0),C=2,A=0;do{if(T>0)for(;T--;)b[A++]=x.getUint8(C++);else{var S=x.getUint8(C++);for(T=-T;T--;)b[A++]=S}T=x.getInt16(C,!0),C+=2}while(C<_.mask.numBytes);if(T!==-32768||A<b.length)throw"Unexpected end of mask RLE encoding";_.mask.bitset=b,h+=_.mask.numBytes}else _.mask.numBytes|_.mask.numBlocksY|_.mask.maxValue||(_.mask.bitset=new Uint8Array(Math.ceil(_.width*_.height/8)));x=new DataView(f,h,16),_.pixels={},_.pixels.numBlocksY=x.getUint32(0,!0),_.pixels.numBlocksX=x.getUint32(4,!0),_.pixels.numBytes=x.getUint32(8,!0),_.pixels.maxValue=x.getFloat32(12,!0),h+=16;var v=_.pixels.numBlocksX,D=_.pixels.numBlocksY,O=v+(_.width%v>0?1:0),R=D+(_.height%D>0?1:0);_.pixels.blocks=new Array(O*R);for(var M=0,L=0;L<R;L++)for(var g=0;g<O;g++){var E=0,w=f.byteLength-h;x=new DataView(f,h,Math.min(10,w));var I={};_.pixels.blocks[M++]=I;var N=x.getUint8(0);if(E++,I.encoding=N&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){h++;continue}if(N!==0&&N!==2){if(N>>=6,I.offsetType=N,N===2)I.offset=x.getInt8(1),E++;else if(N===1)I.offset=x.getInt16(1,!0),E+=2;else if(N===0)I.offset=x.getFloat32(1,!0),E+=4;else throw"Invalid block offset type";if(I.encoding===1)if(N=x.getUint8(E),E++,I.bitsPerPixel=N&63,N>>=6,I.numValidPixelsType=N,N===2)I.numValidPixels=x.getUint8(E),E++;else if(N===1)I.numValidPixels=x.getUint16(E,!0),E+=2;else if(N===0)I.numValidPixels=x.getUint32(E,!0),E+=4;else throw"Invalid valid pixel count type"}if(h+=E,I.encoding!==3){var B,H;if(I.encoding===0){var V=(_.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";B=new ArrayBuffer(V*4),H=new Uint8Array(B),H.set(new Uint8Array(f,h,V*4));var G=new Float32Array(B);I.rawData=G,h+=V*4}else if(I.encoding===1){var k=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),W=Math.ceil(k/4);B=new ArrayBuffer(W*4),H=new Uint8Array(B),H.set(new Uint8Array(f,h,k)),I.stuffedData=new Uint32Array(B),h+=k}}}return _.eofOffset=h,_},u=function(f,h,p,_,m,x,b){var T=(1<<h)-1,C=0,A,S=0,v,D,O=Math.ceil((b-_)/m),R=f.length*4-Math.ceil(h*p/8);for(f[f.length-1]<<=8*R,A=0;A<p;A++){if(S===0&&(D=f[C++],S=32),S>=h)v=D>>>S-h&T,S-=h;else{var M=h-S;v=(D&T)<<M&T,D=f[C++],S=32-M,v+=D>>>S}x[A]=v<O?_+v*m:b}return x};return o}(),t=function(){"use strict";var o={unstuff:function(c,u,f,h,p,_,m,x){var b=(1<<f)-1,T=0,C,A=0,S,v,D,O,R=c.length*4-Math.ceil(f*h/8);if(c[c.length-1]<<=8*R,p)for(C=0;C<h;C++)A===0&&(v=c[T++],A=32),A>=f?(S=v>>>A-f&b,A-=f):(D=f-A,S=(v&b)<<D&b,v=c[T++],A=32-D,S+=v>>>A),u[C]=p[S];else for(O=Math.ceil((x-_)/m),C=0;C<h;C++)A===0&&(v=c[T++],A=32),A>=f?(S=v>>>A-f&b,A-=f):(D=f-A,S=(v&b)<<D&b,v=c[T++],A=32-D,S+=v>>>A),u[C]=S<O?_+S*m:x},unstuffLUT:function(c,u,f,h,p,_){var m=(1<<u)-1,x=0,b=0,T=0,C=0,A=0,S,v=[],D=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*D;var O=Math.ceil((_-h)/p);for(b=0;b<f;b++)C===0&&(S=c[x++],C=32),C>=u?(A=S>>>C-u&m,C-=u):(T=u-C,A=(S&m)<<T&m,S=c[x++],C=32-T,A+=S>>>C),v[b]=A<O?h+A*p:_;return v.unshift(h),v},unstuff2:function(c,u,f,h,p,_,m,x){var b=(1<<f)-1,T=0,C,A=0,S=0,v,D,O;if(p)for(C=0;C<h;C++)A===0&&(D=c[T++],A=32,S=0),A>=f?(v=D>>>S&b,A-=f,S+=f):(O=f-A,v=D>>>S&b,D=c[T++],A=32-O,v|=(D&(1<<O)-1)<<f-O,S=O),u[C]=p[v];else{var R=Math.ceil((x-_)/m);for(C=0;C<h;C++)A===0&&(D=c[T++],A=32,S=0),A>=f?(v=D>>>S&b,A-=f,S+=f):(O=f-A,v=D>>>S&b,D=c[T++],A=32-O,v|=(D&(1<<O)-1)<<f-O,S=O),u[C]=v<R?_+v*m:x}return u},unstuffLUT2:function(c,u,f,h,p,_){var m=(1<<u)-1,x=0,b=0,T=0,C=0,A=0,S=0,v,D=[],O=Math.ceil((_-h)/p);for(b=0;b<f;b++)C===0&&(v=c[x++],C=32,S=0),C>=u?(A=v>>>S&m,C-=u,S+=u):(T=u-C,A=v>>>S&m,v=c[x++],C=32-T,A|=(v&(1<<T)-1)<<u-T,S=T),D[b]=A<O?h+A*p:_;return D.unshift(h),D},originalUnstuff:function(c,u,f,h){var p=(1<<f)-1,_=0,m,x=0,b,T,C,A=c.length*4-Math.ceil(f*h/8);for(c[c.length-1]<<=8*A,m=0;m<h;m++)x===0&&(T=c[_++],x=32),x>=f?(b=T>>>x-f&p,x-=f):(C=f-x,b=(T&p)<<C&p,T=c[_++],x=32-C,b+=T>>>x),u[m]=b;return u},originalUnstuff2:function(c,u,f,h){var p=(1<<f)-1,_=0,m,x=0,b=0,T,C,A;for(m=0;m<h;m++)x===0&&(C=c[_++],x=32,b=0),x>=f?(T=C>>>b&p,x-=f,b+=f):(A=f-x,T=C>>>b&p,C=c[_++],x=32-A,T|=(C&(1<<A)-1)<<f-A,b=A),u[m]=T;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,h=c.length,p=Math.floor(h/2),_=0;p;){var m=p>=359?359:p;p-=m;do u+=c[_++]<<8,f+=u+=c[_++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return h&1&&(f+=u+=c[_]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,h=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,h),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var _=new DataView(c,f,8),m=_.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=_.getUint32(4,!0),f+=4),_=new DataView(c,f,12),p.height=_.getUint32(0,!0),p.width=_.getUint32(4,!0),f+=8,m>=4?(p.numDims=_.getUint32(8,!0),f+=4):p.numDims=1,_=new DataView(c,f,40),p.numValidPixel=_.getUint32(0,!0),p.microBlockSize=_.getInt32(4,!0),p.blobSize=_.getInt32(8,!0),p.imageType=_.getInt32(12,!0),p.maxZError=_.getFloat64(16,!0),p.zMin=_.getFloat64(24,!0),p.zMax=_.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var x,b;if(m>=3&&(b=m>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,f-b,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,h=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),_=this.readSubArray(c,u.ptr,h,p),m=this.readSubArray(c,u.ptr+p,h,p);u.ptr+=2*p;var x,b=!0;for(x=0;x<f.numDims;x++)if(_[x]!==m[x]){b=!1;break}return f.minValues=_,f.maxValues=m,b},readSubArray:function(c,u,f,h){var p;if(f===Uint8Array)p=new Uint8Array(c,u,h);else{var _=new ArrayBuffer(h),m=new Uint8Array(_);m.set(new Uint8Array(c,u,h)),p=new f(_)}return p},readMask:function(c,u){var f=u.ptr,h=u.headerInfo,p=h.width*h.height,_=h.numValidPixel,m=new DataView(c,f,4),x={};if(x.numBytes=m.getUint32(0,!0),f+=4,(_===0||p===_)&&x.numBytes!==0)throw"invalid mask";var b,T;if(_===0)b=new Uint8Array(Math.ceil(p/8)),x.bitset=b,T=new Uint8Array(p),u.pixels.resultMask=T,f+=x.numBytes;else if(x.numBytes>0){b=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,x.numBytes);var C=m.getInt16(0,!0),A=2,S=0,v=0;do{if(C>0)for(;C--;)b[S++]=m.getUint8(A++);else for(v=m.getUint8(A++),C=-C;C--;)b[S++]=v;C=m.getInt16(A,!0),A+=2}while(A<x.numBytes);if(C!==-32768||S<b.length)throw"Unexpected end of mask RLE encoding";T=new Uint8Array(p);var D=0,O=0;for(O=0;O<p;O++)O&7?(D=b[O>>3],D<<=O&7):D=b[O>>3],D&128&&(T[O]=1);u.pixels.resultMask=T,x.bitset=b,f+=x.numBytes}return u.ptr=f,u.mask=x,!0},readDataOneSweep:function(c,u,f){var h=u.ptr,p=u.headerInfo,_=p.numDims,m=p.width*p.height,x=p.imageType,b=p.numValidPixel*r.getDataTypeSize(x)*_,T,C=u.pixels.resultMask;if(f===Uint8Array)T=new Uint8Array(c,h,b);else{var A=new ArrayBuffer(b),S=new Uint8Array(A);S.set(new Uint8Array(c,h,b)),T=new f(A)}if(T.length===m*_)u.pixels.resultPixels=T;else{u.pixels.resultPixels=new f(m*_);var v=0,D=0,O=0,R=0;if(_>1)for(O=0;O<_;O++)for(R=O*m,D=0;D<m;D++)C[D]&&(u.pixels.resultPixels[R+D]=T[v++]);else for(D=0;D<m;D++)C[D]&&(u.pixels.resultPixels[D]=T[v++])}return h+=b,u.ptr=h,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(c,u.ptr,16);u.ptr+=16;var p=h.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var _=h.getInt32(4,!0),m=h.getInt32(8,!0),x=h.getInt32(12,!0);if(m>=x)return!1;var b=new Uint32Array(x-m);r.decodeBits(c,u,b);var T=[],C,A,S,v;for(C=m;C<x;C++)A=C-(C<_?0:_),T[A]={first:b[C-m],second:null};var D=c.byteLength-u.ptr,O=Math.ceil(D/4),R=new ArrayBuffer(O*4),M=new Uint8Array(R);M.set(new Uint8Array(c,u.ptr,D));var L=new Uint32Array(R),g=0,E,w=0;for(E=L[0],C=m;C<x;C++)A=C-(C<_?0:_),v=T[A].first,v>0&&(T[A].second=E<<g>>>32-v,32-g>=v?(g+=v,g===32&&(g=0,w++,E=L[w])):(g+=v-32,w++,E=L[w],T[A].second|=E>>>32-g));var I=0,N=0,B=new s;for(C=0;C<T.length;C++)T[C]!==void 0&&(I=Math.max(I,T[C].first));I>=f?N=f:N=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var H=[],V,G,k,W,Y,J;for(C=m;C<x;C++)if(A=C-(C<_?0:_),v=T[A].first,v>0)if(V=[v,A],v<=N)for(G=T[A].second<<N-v,k=1<<N-v,S=0;S<k;S++)H[G|S]=V;else for(G=T[A].second,J=B,W=v-1;W>=0;W--)Y=G>>>W&1,Y?(J.right||(J.right=new s),J=J.right):(J.left||(J.left=new s),J=J.left),W===0&&!J.val&&(J.val=V[1]);return{decodeLut:H,numBitsLUTQick:N,numBitsLUT:I,tree:B,stuffedData:L,srcPtr:w,bitPos:g}},readHuffman:function(c,u,f){var h=u.headerInfo,p=h.numDims,_=u.headerInfo.height,m=u.headerInfo.width,x=m*_,b=this.readHuffmanTree(c,u),T=b.decodeLut,C=b.tree,A=b.stuffedData,S=b.srcPtr,v=b.bitPos,D=b.numBitsLUTQick,O=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,M,L,g,E=u.pixels.resultMask,w,I,N,B,H,V,G,k=0;v>0&&(S++,v=0);var W=A[S],Y=u.encodeMode===1,J=new f(x*p),j=J,K;for(K=0;K<h.numDims;K++){if(p>1&&(j=new f(J.buffer,x*K,x),k=0),u.headerInfo.numValidPixel===m*_)for(V=0,B=0;B<_;B++)for(H=0;H<m;H++,V++){if(L=0,w=W<<v>>>32-D,I=w,32-v<D&&(w|=A[S+1]>>>64-v-D,I=w),T[I])L=T[I][1],v+=T[I][0];else for(w=W<<v>>>32-O,I=w,32-v<O&&(w|=A[S+1]>>>64-v-O,I=w),M=C,G=0;G<O;G++)if(N=w>>>O-G-1&1,M=N?M.right:M.left,!(M.left||M.right)){L=M.val,v=v+G+1;break}v>=32&&(v-=32,S++,W=A[S]),g=L-R,Y?(H>0?g+=k:B>0?g+=j[V-m]:g+=k,g&=255,j[V]=g,k=g):j[V]=g}else for(V=0,B=0;B<_;B++)for(H=0;H<m;H++,V++)if(E[V]){if(L=0,w=W<<v>>>32-D,I=w,32-v<D&&(w|=A[S+1]>>>64-v-D,I=w),T[I])L=T[I][1],v+=T[I][0];else for(w=W<<v>>>32-O,I=w,32-v<O&&(w|=A[S+1]>>>64-v-O,I=w),M=C,G=0;G<O;G++)if(N=w>>>O-G-1&1,M=N?M.right:M.left,!(M.left||M.right)){L=M.val,v=v+G+1;break}v>=32&&(v-=32,S++,W=A[S]),g=L-R,Y?(H>0&&E[V-1]?g+=k:B>0&&E[V-m]?g+=j[V-m]:g+=k,g&=255,j[V]=g,k=g):j[V]=g}u.ptr=u.ptr+(S+1)*4+(v>0?4:0)}u.pixels.resultPixels=J},decodeBits:function(c,u,f,h,p){{var _=u.headerInfo,m=_.fileVersion,x=0,b=new DataView(c,u.ptr,5),T=b.getUint8(0);x++;var C=T>>6,A=C===0?4:3-C,S=(T&32)>0,v=T&31,D=0;if(A===1)D=b.getUint8(x),x++;else if(A===2)D=b.getUint16(x,!0),x+=2;else if(A===4)D=b.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var O=2*_.maxZError,R,M,L,g,E,w,I,N,B,H,V=_.numDims>1?_.maxValues[p]:_.zMax;if(S){for(u.counter.lut++,N=b.getUint8(x),B=v,x++,g=Math.ceil((N-1)*v/8),E=Math.ceil(g/4),M=new ArrayBuffer(E*4),L=new Uint8Array(M),u.ptr+=x,L.set(new Uint8Array(c,u.ptr,g)),I=new Uint32Array(M),u.ptr+=g,H=0;N-1>>>H;)H++;g=Math.ceil(D*H/8),E=Math.ceil(g/4),M=new ArrayBuffer(E*4),L=new Uint8Array(M),L.set(new Uint8Array(c,u.ptr,g)),R=new Uint32Array(M),u.ptr+=g,m>=3?w=o.unstuffLUT2(I,v,N-1,h,O,V):w=o.unstuffLUT(I,v,N-1,h,O,V),m>=3?o.unstuff2(R,f,H,D,w):o.unstuff(R,f,H,D,w)}else u.counter.bitstuffer++,H=v,u.ptr+=x,H>0&&(g=Math.ceil(D*H/8),E=Math.ceil(g/4),M=new ArrayBuffer(E*4),L=new Uint8Array(M),L.set(new Uint8Array(c,u.ptr,g)),R=new Uint32Array(M),u.ptr+=g,m>=3?h==null?o.originalUnstuff2(R,f,H,D):o.unstuff2(R,f,H,D,!1,h,O,V):h==null?o.originalUnstuff(R,f,H,D):o.unstuff(R,f,H,D,!1,h,O,V))}},readTiles:function(c,u,f){var h=u.headerInfo,p=h.width,_=h.height,m=h.microBlockSize,x=h.imageType,b=r.getDataTypeSize(x),T=Math.ceil(p/m),C=Math.ceil(_/m);u.pixels.numBlocksY=C,u.pixels.numBlocksX=T,u.pixels.ptr=0;var A=0,S=0,v=0,D=0,O=0,R=0,M=0,L=0,g=0,E=0,w=0,I=0,N=0,B=0,H=0,V=0,G,k,W,Y,J,j,K=new f(m*m),Q=_%m||m,de=p%m||m,ye,ce,ge=h.numDims,xe,De=u.pixels.resultMask,Ae=u.pixels.resultPixels;for(v=0;v<C;v++)for(O=v!==C-1?m:Q,D=0;D<T;D++)for(R=D!==T-1?m:de,w=v*p*m+D*m,I=p-R,xe=0;xe<ge;xe++){if(ge>1&&(Ae=new f(u.pixels.resultPixels.buffer,p*_*xe*b,p*_)),M=c.byteLength-u.ptr,G=new DataView(c,u.ptr,Math.min(10,M)),k={},V=0,L=G.getUint8(0),V++,g=L>>6&255,E=L>>2&15,E!==(D*m>>3&15))throw"integrity issue";if(j=L&3,j>3)throw u.ptr+=V,"Invalid block encoding ("+j+")";if(j===2){u.counter.constant++,u.ptr+=V;continue}else if(j===0){if(u.counter.uncompressed++,u.ptr+=V,N=O*R*b,B=c.byteLength-u.ptr,N=N<B?N:B,W=new ArrayBuffer(N%b===0?N:N+b-N%b),Y=new Uint8Array(W),Y.set(new Uint8Array(c,u.ptr,N)),J=new f(W),H=0,De)for(A=0;A<O;A++){for(S=0;S<R;S++)De[w]&&(Ae[w]=J[H++]),w++;w+=I}else for(A=0;A<O;A++){for(S=0;S<R;S++)Ae[w++]=J[H++];w+=I}u.ptr+=H*b}else if(ye=r.getDataTypeUsed(x,g),ce=r.getOnePixel(k,V,ye,G),V+=r.getDataTypeSize(ye),j===3)if(u.ptr+=V,u.counter.constantoffset++,De)for(A=0;A<O;A++){for(S=0;S<R;S++)De[w]&&(Ae[w]=ce),w++;w+=I}else for(A=0;A<O;A++){for(S=0;S<R;S++)Ae[w++]=ce;w+=I}else if(u.ptr+=V,r.decodeBits(c,u,K,ce,xe),V=0,De)for(A=0;A<O;A++){for(S=0;S<R;S++)De[w]&&(Ae[w]=K[V++]),w++;w+=I}else for(A=0;A<O;A++){for(S=0;S<R;S++)Ae[w++]=K[V++];w+=I}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,h=c.headerInfo.height*c.headerInfo.width,p=h*f,_=0,m=0,x=0,b=c.pixels.resultMask;if(b)if(f>1)for(_=0;_<f;_++)for(x=_*h,m=0;m<h;m++)b[m]&&(c.pixels.resultPixels[x+m]=u);else for(m=0;m<h;m++)b[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,h){var p=0;switch(f){case 0:p=h.getInt8(u);break;case 1:p=h.getUint8(u);break;case 2:p=h.getInt16(u,!0);break;case 3:p=h.getUint16(u,!0);break;case 4:p=h.getInt32(u,!0);break;case 5:p=h.getUInt32(u,!0);break;case 6:p=h.getFloat32(u,!0);break;case 7:p=h.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,h=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var _=p.headerInfo,m=_.fileVersion,x=r.getDataTypeArray(_.imageType);r.readMask(c,p),_.numValidPixel!==_.width*_.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=_.width*_.height;if(p.pixels.resultPixels=new x(b*_.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},_.numValidPixel!==0)if(_.zMax===_.zMin)r.constructConstantSurface(p);else if(m>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var T=new DataView(c,p.ptr,2),C=T.getUint8(0);if(p.ptr++,C)r.readDataOneSweep(c,p,x);else if(m>1&&_.imageType<=1&&Math.abs(_.maxZError-.5)<1e-5){var A=T.getUint8(1);if(p.ptr++,p.encodeMode=A,A>2||m<4&&A>1)throw"Invalid Huffman flag "+A;A?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:_.width,height:_.height,pixelData:p.pixels.resultPixels,minValue:_.zMin,maxValue:_.zMax,validPixelCount:_.numValidPixel,dimCount:_.numDims,dimStats:{minValues:_.minValues,maxValues:_.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(_.imageType,f)){var D=p.pixels.resultMask;for(h=0;h<b;h++)D[h]||(v.pixelData[h]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=r.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,h={};for(h.ptr=0,h.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,h),f+=h.headerInfo.blobSize,u++,h.ptr=f;return u}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var h=0,p=o.byteLength-10,_,m=[],x,b,T={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var C=u.decode(o,{inputOffset:s,encodedMaskData:_,maskData:b,returnMask:h===0,returnEncodedMask:h===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=C.fileInfo.eofOffset,h===0&&(_=C.encodedMaskData,b=C.maskData,T.width=C.width,T.height=C.height,T.dimCount=C.dimCount||1,T.pixelType=C.pixelType||C.fileInfo.pixelType,T.mask=C.maskData),f>1&&C.fileInfo.mask&&C.fileInfo.mask.numBytes>0&&m.push(C.maskData),h++,T.pixels.push(C.pixelData),T.statistics.push({minValue:C.minValue,maxValue:C.maxValue,noDataValue:C.noDataValue,dimStats:C.dimStats})}var A,S,v;if(f>1&&m.length>1){for(v=T.width*T.height,T.bandMasks=m,b=new Uint8Array(v),b.set(m[0]),A=1;A<m.length;A++)for(x=m[A],S=0;S<v;S++)b[S]=b[S]&x[S];T.maskData=b}return T}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof p8<"u"&&p8.exports?p8.exports=i:this.Lerc=i})()});var dAe=Gu((hao,fAe)=>{fAe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBC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AAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var mAe=Gu((mao,hAe)=>{var{webm:bEt,mp4:TEt}=dAe(),DZ=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,IZ=()=>"wakeLock"in navigator,PZ=class{constructor(){if(this.enabled=!1,IZ()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else DZ()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",bEt),this._addSourceToVideo(this.noSleepVideo,"mp4",TEt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return IZ()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):DZ()?(this.disable(),console.warn(` + */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,u=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(h,p){s[a]=function(m){if(u)if(u=!1,m)p(m);else{for(var x=new Array(arguments.length-1),b=0;b<x.length;)x[b++]=arguments[b];h.apply(null,x)}};try{o.apply(r||null,s)}catch(_){u&&(u=!1,p(_))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var h=0;--f%4>1&&u.charAt(f)==="=";)++h;return Math.ceil(u.length*3)/4-h};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,h){for(var p=null,_=[],m=0,x=0,b;f<h;){var T=u[f++];switch(x){case 0:_[m++]=o[T>>2],b=(T&3)<<4,x=1;break;case 1:_[m++]=o[b|T>>4],b=(T&15)<<2,x=2;break;case 2:_[m++]=o[b|T>>6],_[m++]=o[T&63],x=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,_)),m=0)}return x&&(_[m++]=o[b],_[m++]=61,x===1&&(_[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,_.slice(0,m))),p.join("")):String.fromCharCode.apply(String,_.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,h){for(var p=h,_=0,m,x=0;x<u.length;){var b=u.charCodeAt(x++);if(b===61&&_>1)break;if((b=r[b])===undefined)throw Error(a);switch(_){case 0:m=b,_=1;break;case 1:f[h++]=m<<2|(b&48)>>4,m=b,_=2;break;case 2:f[h++]=(m&15)<<4|(b&60)>>2,m=b,_=3;break;case 3:f[h++]=(m&3)<<6|b,_=0;break}}if(_===1)throw Error(a);return h-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),h=f[3]===128;function p(b,T,C){u[0]=b,T[C]=f[0],T[C+1]=f[1],T[C+2]=f[2],T[C+3]=f[3]}function _(b,T,C){u[0]=b,T[C]=f[3],T[C+1]=f[2],T[C+2]=f[1],T[C+3]=f[0]}c.writeFloatLE=h?p:_,c.writeFloatBE=h?_:p;function m(b,T){return f[0]=b[T],f[1]=b[T+1],f[2]=b[T+2],f[3]=b[T+3],u[0]}function x(b,T){return f[3]=b[T],f[2]=b[T+1],f[1]=b[T+2],f[0]=b[T+3],u[0]}c.readFloatLE=h?m:x,c.readFloatBE=h?x:m}():function(){function u(h,p,_,m){var x=p<0?1:0;if(x&&(p=-p),p===0)h(1/p>0?0:2147483648,_,m);else if(isNaN(p))h(2143289344,_,m);else if(p>34028234663852886e22)h((x<<31|2139095040)>>>0,_,m);else if(p<11754943508222875e-54)h((x<<31|Math.round(p/1401298464324817e-60))>>>0,_,m);else{var b=Math.floor(Math.log(p)/Math.LN2),T=Math.round(p*Math.pow(2,-b)*8388608)&8388607;h((x<<31|b+127<<23|T)>>>0,_,m)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(h,p,_){var m=h(p,_),x=(m>>31)*2+1,b=m>>>23&255,T=m&8388607;return b===255?T?NaN:x*(1/0):b===0?x*1401298464324817e-60*T:x*Math.pow(2,b-150)*(T+8388608)}c.readFloatLE=f.bind(null,s),c.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),h=f[7]===128;function p(b,T,C){u[0]=b,T[C]=f[0],T[C+1]=f[1],T[C+2]=f[2],T[C+3]=f[3],T[C+4]=f[4],T[C+5]=f[5],T[C+6]=f[6],T[C+7]=f[7]}function _(b,T,C){u[0]=b,T[C]=f[7],T[C+1]=f[6],T[C+2]=f[5],T[C+3]=f[4],T[C+4]=f[3],T[C+5]=f[2],T[C+6]=f[1],T[C+7]=f[0]}c.writeDoubleLE=h?p:_,c.writeDoubleBE=h?_:p;function m(b,T){return f[0]=b[T],f[1]=b[T+1],f[2]=b[T+2],f[3]=b[T+3],f[4]=b[T+4],f[5]=b[T+5],f[6]=b[T+6],f[7]=b[T+7],u[0]}function x(b,T){return f[7]=b[T],f[6]=b[T+1],f[5]=b[T+2],f[4]=b[T+3],f[3]=b[T+4],f[2]=b[T+5],f[1]=b[T+6],f[0]=b[T+7],u[0]}c.readDoubleLE=h?m:x,c.readDoubleBE=h?x:m}():function(){function u(h,p,_,m,x,b){var T=m<0?1:0;if(T&&(m=-m),m===0)h(0,x,b+p),h(1/m>0?0:2147483648,x,b+_);else if(isNaN(m))h(0,x,b+p),h(2146959360,x,b+_);else if(m>17976931348623157e292)h(0,x,b+p),h((T<<31|2146435072)>>>0,x,b+_);else{var C;if(m<22250738585072014e-324)C=m/5e-324,h(C>>>0,x,b+p),h((T<<31|C/4294967296)>>>0,x,b+_);else{var A=Math.floor(Math.log(m)/Math.LN2);A===1024&&(A=1023),C=m*Math.pow(2,-A),h(C*4503599627370496>>>0,x,b+p),h((T<<31|A+1023<<20|C*1048576&1048575)>>>0,x,b+_)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(h,p,_,m,x){var b=h(m,x+p),T=h(m,x+_),C=(T>>31)*2+1,A=T>>>20&2047,S=4294967296*(T&1048575)+b;return A===2047?S?NaN:C*(1/0):A===0?C*5e-324*S:C*Math.pow(2,A-1075)*(S+4503599627370496)}c.readDoubleLE=f.bind(null,s,0,4),c.readDoubleBE=f.bind(null,a,4,0)}(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function s(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function a(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,u=null,f=a;return function(p){if(p<1||p>c)return o(p);f+p>a&&(u=o(a),f=0);var _=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),_}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var u=null,f=[],h=0,p;s<a;)p=r[s++],p<128?f[h++]=p:p>191&&p<224?f[h++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,f[h++]=55296+(p>>10),f[h++]=56320+(p&1023)):f[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),h=0);return u?(h&&u.push(String.fromCharCode.apply(String,f.slice(0,h))),u.join("")):String.fromCharCode.apply(String,f.slice(0,h))},i.write=function(r,s,a){for(var c=a,u,f,h=0;h<r.length;++h)u=r.charCodeAt(h),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(h+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++h,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(m,x){return RangeError("index out of range: "+m.pos+" + "+(x||1)+" > "+m.len)}function c(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(c.create=function(C){return i.Buffer.isBuffer(C)?new o(C):u(C)})(b)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function h(){var m=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,m}if(this.len-this.pos>4){for(;x<5;++x)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(m,x){return(m[x-4]|m[x-3]<<8|m[x-2]<<16|m[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function _(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),b=this.pos,T=this.pos+x;if(T>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(b,T);if(b===T){var C=i.Buffer;return C?C.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,b,T)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},c._configure=function(m){o=m,c.create=f(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[x](!1)},uint64:function(){return h.call(this)[x](!0)},sint64:function(){return h.call(this).zzDecode()[x](!1)},fixed64:function(){return _.call(this)[x](!0)},sfixed64:function(){return _.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,u,f){if(!u)throw TypeError("request must be specified");var h=this;if(!f)return i.asPromise(r,h,s,a,c,u);if(!h.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(_,m){if(_)return h.emit("error",_,s),f(_);if(m===null)return h.end(!0),undefined;if(!(m instanceof c))try{m=c[h.responseDelimited?"decodeDelimited":"decode"](m)}catch(x){return h.emit("error",x,s),f(x)}return h.emit("data",m,s),f(null,m)})}catch(p){return h.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var h=u>>>0,p=(u-h)/4294967296>>>0;return f&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,h=~this.hi>>>0;return f||(h=h+1>>>0),-(f+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:h<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var u=a[c];return u!=null&&a.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(s,a,c){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!c)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,u){if(!(this instanceof a))return new a(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},u=0;u<a.length;++u)c[a[u]]=1;return function(){for(var f=Object.keys(this),h=f.length-1;h>-1;--h)if(c[f[h]]===1&&this[f[h]]!==undefined&&this[f[h]]!==null)return f[h]}},i.oneOfSetter=function(a){return function(c){for(var u=0;u<a.length;++u)a[u]!==c&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,u){return new s(c,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=h;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(A,S,v){this.fn=A,this.len=S,this.next=undefined,this.val=v}function u(){}function f(A){this.head=A.head,this.tail=A.tail,this.len=A.len,this.next=A.states}function h(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(h.create=function(){return new o})()}:function(){return new h}};h.create=p(),h.alloc=function(S){return new i.Array(S)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(S,v,D){return this.tail=this.tail.next=new c(S,v,D),this.len+=v,this};function _(A,S,v){S[v]=A&255}function m(A,S,v){for(;A>127;)S[v++]=A&127|128,A>>>=7;S[v]=A}function x(A,S){this.len=A,this.next=undefined,this.val=S}x.prototype=Object.create(c.prototype),x.prototype.fn=m,h.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new x((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},h.prototype.int32=function(S){return S<0?this._push(b,10,r.fromNumber(S)):this.uint32(S)},h.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function b(A,S,v){for(;A.hi;)S[v++]=A.lo&127|128,A.lo=(A.lo>>>7|A.hi<<25)>>>0,A.hi>>>=7;for(;A.lo>127;)S[v++]=A.lo&127|128,A.lo=A.lo>>>7;S[v++]=A.lo}h.prototype.uint64=function(S){var v=r.from(S);return this._push(b,v.length(),v)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(S){var v=r.from(S).zzEncode();return this._push(b,v.length(),v)},h.prototype.bool=function(S){return this._push(_,1,S?1:0)};function T(A,S,v){S[v]=A&255,S[v+1]=A>>>8&255,S[v+2]=A>>>16&255,S[v+3]=A>>>24}h.prototype.fixed32=function(S){return this._push(T,4,S>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(S){var v=r.from(S);return this._push(T,4,v.lo)._push(T,4,v.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},h.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var C=i.Array.prototype.set?function(S,v,D){v.set(S,D)}:function(S,v,D){for(var O=0;O<S.length;++O)v[D+O]=S[O]};h.prototype.bytes=function(S){var v=S.length>>>0;if(!v)return this._push(_,1,0);if(i.isString(S)){var D=h.alloc(v=s.length(S));s.decode(S,D,0),S=D}return this.uint32(v)._push(C,v,S)},h.prototype.string=function(S){var v=a.length(S);return v?this.uint32(v)._push(a.write,v,S):this._push(_,1,0)},h.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},h.prototype.ldelim=function(){var S=this.head,v=this.tail,D=this.len;return this.reset().uint32(D),D&&(this.tail.next=S.next,this.tail=v,this.len+=D),this},h.prototype.finish=function(){for(var S=this.head.next,v=this.constructor.alloc(this.len),D=0;S;)S.fn(S.val,v,D),D+=S.len,S=S.next;return v},h._configure=function(A){o=A,h.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var h=0;h<c.length;)u[f++]=c[h++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function s(a,c,u){a.length<40?o.utf8.write(a,c,u):c.utf8Write?c.utf8Write(a,u):c.write(a,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(s,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var QTe=Wu((oVi,g8)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(f,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,_=c(f,h.inputOffset||0,p),m=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,x=r(_,h.pixelType||Float32Array,h.encodedMaskData,m,h.returnMask),b={width:_.width,height:_.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:_.pixels.maxValue,noDataValue:m};return x.resultMask&&(b.maskData=x.resultMask),h.returnEncodedMask&&_.mask&&(b.encodedMaskData=_.mask.bitset?_.mask.bitset:null),h.returnFileInfo&&(b.fileInfo=s(_),h.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(_))),b};var r=function(f,h,p,_,m){var x=0,b=f.pixels.numBlocksX,T=f.pixels.numBlocksY,C=Math.floor(f.width/b),A=Math.floor(f.height/T),S=2*f.maxZError,v=Number.MAX_VALUE,D;p=p||(f.mask?f.mask.bitset:null);var O,R;O=new h(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var M=new Float32Array(C*A),L,g,E=0;E<=T;E++){var w=E!==T?A:f.height%T;if(w!==0)for(var I=0;I<=b;I++){var N=I!==b?C:f.width%b;if(N!==0){var B=E*f.width*A+I*C,H=f.width-N,V=f.pixels.blocks[x],G,k,W;V.encoding<2?(V.encoding===0?G=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,S,M,f.pixels.maxValue),G=M),k=0):V.encoding===2?W=0:W=V.offset;var Y;if(p)for(g=0;g<w;g++){for(B&7&&(Y=p[B>>3],Y<<=B&7),L=0;L<N;L++)B&7||(Y=p[B>>3]),Y&128?(R&&(R[B]=1),D=V.encoding<2?G[k++]:W,v=v>D?D:v,O[B++]=D):(R&&(R[B]=0),O[B++]=_),Y<<=1;B+=H}else if(V.encoding<2)for(g=0;g<w;g++){for(L=0;L<N;L++)D=G[k++],v=v>D?D:v,O[B++]=D;B+=H}else for(v=v>W?W:v,g=0;g<w;g++){for(L=0;L<N;L++)O[B++]=W;B+=H}if(V.encoding===1&&k!==V.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:O,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var h=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},_=0;_<h;_++){var m=f.pixels.blocks[_];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,h,p){var _={},m=new Uint8Array(f,h,10);if(_.fileIdentifierString=String.fromCharCode.apply(null,m),_.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+_.fileIdentifierString;h+=10;var x=new DataView(f,h,24);if(_.fileVersion=x.getInt32(0,!0),_.imageType=x.getInt32(4,!0),_.height=x.getUint32(8,!0),_.width=x.getUint32(12,!0),_.maxZError=x.getFloat64(16,!0),h+=24,!p)if(x=new DataView(f,h,16),_.mask={},_.mask.numBlocksY=x.getUint32(0,!0),_.mask.numBlocksX=x.getUint32(4,!0),_.mask.numBytes=x.getUint32(8,!0),_.mask.maxValue=x.getFloat32(12,!0),h+=16,_.mask.numBytes>0){var b=new Uint8Array(Math.ceil(_.width*_.height/8));x=new DataView(f,h,_.mask.numBytes);var T=x.getInt16(0,!0),C=2,A=0;do{if(T>0)for(;T--;)b[A++]=x.getUint8(C++);else{var S=x.getUint8(C++);for(T=-T;T--;)b[A++]=S}T=x.getInt16(C,!0),C+=2}while(C<_.mask.numBytes);if(T!==-32768||A<b.length)throw"Unexpected end of mask RLE encoding";_.mask.bitset=b,h+=_.mask.numBytes}else _.mask.numBytes|_.mask.numBlocksY|_.mask.maxValue||(_.mask.bitset=new Uint8Array(Math.ceil(_.width*_.height/8)));x=new DataView(f,h,16),_.pixels={},_.pixels.numBlocksY=x.getUint32(0,!0),_.pixels.numBlocksX=x.getUint32(4,!0),_.pixels.numBytes=x.getUint32(8,!0),_.pixels.maxValue=x.getFloat32(12,!0),h+=16;var v=_.pixels.numBlocksX,D=_.pixels.numBlocksY,O=v+(_.width%v>0?1:0),R=D+(_.height%D>0?1:0);_.pixels.blocks=new Array(O*R);for(var M=0,L=0;L<R;L++)for(var g=0;g<O;g++){var E=0,w=f.byteLength-h;x=new DataView(f,h,Math.min(10,w));var I={};_.pixels.blocks[M++]=I;var N=x.getUint8(0);if(E++,I.encoding=N&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){h++;continue}if(N!==0&&N!==2){if(N>>=6,I.offsetType=N,N===2)I.offset=x.getInt8(1),E++;else if(N===1)I.offset=x.getInt16(1,!0),E+=2;else if(N===0)I.offset=x.getFloat32(1,!0),E+=4;else throw"Invalid block offset type";if(I.encoding===1)if(N=x.getUint8(E),E++,I.bitsPerPixel=N&63,N>>=6,I.numValidPixelsType=N,N===2)I.numValidPixels=x.getUint8(E),E++;else if(N===1)I.numValidPixels=x.getUint16(E,!0),E+=2;else if(N===0)I.numValidPixels=x.getUint32(E,!0),E+=4;else throw"Invalid valid pixel count type"}if(h+=E,I.encoding!==3){var B,H;if(I.encoding===0){var V=(_.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";B=new ArrayBuffer(V*4),H=new Uint8Array(B),H.set(new Uint8Array(f,h,V*4));var G=new Float32Array(B);I.rawData=G,h+=V*4}else if(I.encoding===1){var k=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),W=Math.ceil(k/4);B=new ArrayBuffer(W*4),H=new Uint8Array(B),H.set(new Uint8Array(f,h,k)),I.stuffedData=new Uint32Array(B),h+=k}}}return _.eofOffset=h,_},u=function(f,h,p,_,m,x,b){var T=(1<<h)-1,C=0,A,S=0,v,D,O=Math.ceil((b-_)/m),R=f.length*4-Math.ceil(h*p/8);for(f[f.length-1]<<=8*R,A=0;A<p;A++){if(S===0&&(D=f[C++],S=32),S>=h)v=D>>>S-h&T,S-=h;else{var M=h-S;v=(D&T)<<M&T,D=f[C++],S=32-M,v+=D>>>S}x[A]=v<O?_+v*m:b}return x};return o}(),t=function(){"use strict";var o={unstuff:function(c,u,f,h,p,_,m,x){var b=(1<<f)-1,T=0,C,A=0,S,v,D,O,R=c.length*4-Math.ceil(f*h/8);if(c[c.length-1]<<=8*R,p)for(C=0;C<h;C++)A===0&&(v=c[T++],A=32),A>=f?(S=v>>>A-f&b,A-=f):(D=f-A,S=(v&b)<<D&b,v=c[T++],A=32-D,S+=v>>>A),u[C]=p[S];else for(O=Math.ceil((x-_)/m),C=0;C<h;C++)A===0&&(v=c[T++],A=32),A>=f?(S=v>>>A-f&b,A-=f):(D=f-A,S=(v&b)<<D&b,v=c[T++],A=32-D,S+=v>>>A),u[C]=S<O?_+S*m:x},unstuffLUT:function(c,u,f,h,p,_){var m=(1<<u)-1,x=0,b=0,T=0,C=0,A=0,S,v=[],D=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*D;var O=Math.ceil((_-h)/p);for(b=0;b<f;b++)C===0&&(S=c[x++],C=32),C>=u?(A=S>>>C-u&m,C-=u):(T=u-C,A=(S&m)<<T&m,S=c[x++],C=32-T,A+=S>>>C),v[b]=A<O?h+A*p:_;return v.unshift(h),v},unstuff2:function(c,u,f,h,p,_,m,x){var b=(1<<f)-1,T=0,C,A=0,S=0,v,D,O;if(p)for(C=0;C<h;C++)A===0&&(D=c[T++],A=32,S=0),A>=f?(v=D>>>S&b,A-=f,S+=f):(O=f-A,v=D>>>S&b,D=c[T++],A=32-O,v|=(D&(1<<O)-1)<<f-O,S=O),u[C]=p[v];else{var R=Math.ceil((x-_)/m);for(C=0;C<h;C++)A===0&&(D=c[T++],A=32,S=0),A>=f?(v=D>>>S&b,A-=f,S+=f):(O=f-A,v=D>>>S&b,D=c[T++],A=32-O,v|=(D&(1<<O)-1)<<f-O,S=O),u[C]=v<R?_+v*m:x}return u},unstuffLUT2:function(c,u,f,h,p,_){var m=(1<<u)-1,x=0,b=0,T=0,C=0,A=0,S=0,v,D=[],O=Math.ceil((_-h)/p);for(b=0;b<f;b++)C===0&&(v=c[x++],C=32,S=0),C>=u?(A=v>>>S&m,C-=u,S+=u):(T=u-C,A=v>>>S&m,v=c[x++],C=32-T,A|=(v&(1<<T)-1)<<u-T,S=T),D[b]=A<O?h+A*p:_;return D.unshift(h),D},originalUnstuff:function(c,u,f,h){var p=(1<<f)-1,_=0,m,x=0,b,T,C,A=c.length*4-Math.ceil(f*h/8);for(c[c.length-1]<<=8*A,m=0;m<h;m++)x===0&&(T=c[_++],x=32),x>=f?(b=T>>>x-f&p,x-=f):(C=f-x,b=(T&p)<<C&p,T=c[_++],x=32-C,b+=T>>>x),u[m]=b;return u},originalUnstuff2:function(c,u,f,h){var p=(1<<f)-1,_=0,m,x=0,b=0,T,C,A;for(m=0;m<h;m++)x===0&&(C=c[_++],x=32,b=0),x>=f?(T=C>>>b&p,x-=f,b+=f):(A=f-x,T=C>>>b&p,C=c[_++],x=32-A,T|=(C&(1<<A)-1)<<f-A,b=A),u[m]=T;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,h=c.length,p=Math.floor(h/2),_=0;p;){var m=p>=359?359:p;p-=m;do u+=c[_++]<<8,f+=u+=c[_++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return h&1&&(f+=u+=c[_]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,h=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,h),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var _=new DataView(c,f,8),m=_.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=_.getUint32(4,!0),f+=4),_=new DataView(c,f,12),p.height=_.getUint32(0,!0),p.width=_.getUint32(4,!0),f+=8,m>=4?(p.numDims=_.getUint32(8,!0),f+=4):p.numDims=1,_=new DataView(c,f,40),p.numValidPixel=_.getUint32(0,!0),p.microBlockSize=_.getInt32(4,!0),p.blobSize=_.getInt32(8,!0),p.imageType=_.getInt32(12,!0),p.maxZError=_.getFloat64(16,!0),p.zMin=_.getFloat64(24,!0),p.zMax=_.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var x,b;if(m>=3&&(b=m>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,f-b,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,h=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),_=this.readSubArray(c,u.ptr,h,p),m=this.readSubArray(c,u.ptr+p,h,p);u.ptr+=2*p;var x,b=!0;for(x=0;x<f.numDims;x++)if(_[x]!==m[x]){b=!1;break}return f.minValues=_,f.maxValues=m,b},readSubArray:function(c,u,f,h){var p;if(f===Uint8Array)p=new Uint8Array(c,u,h);else{var _=new ArrayBuffer(h),m=new Uint8Array(_);m.set(new Uint8Array(c,u,h)),p=new f(_)}return p},readMask:function(c,u){var f=u.ptr,h=u.headerInfo,p=h.width*h.height,_=h.numValidPixel,m=new DataView(c,f,4),x={};if(x.numBytes=m.getUint32(0,!0),f+=4,(_===0||p===_)&&x.numBytes!==0)throw"invalid mask";var b,T;if(_===0)b=new Uint8Array(Math.ceil(p/8)),x.bitset=b,T=new Uint8Array(p),u.pixels.resultMask=T,f+=x.numBytes;else if(x.numBytes>0){b=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,x.numBytes);var C=m.getInt16(0,!0),A=2,S=0,v=0;do{if(C>0)for(;C--;)b[S++]=m.getUint8(A++);else for(v=m.getUint8(A++),C=-C;C--;)b[S++]=v;C=m.getInt16(A,!0),A+=2}while(A<x.numBytes);if(C!==-32768||S<b.length)throw"Unexpected end of mask RLE encoding";T=new Uint8Array(p);var D=0,O=0;for(O=0;O<p;O++)O&7?(D=b[O>>3],D<<=O&7):D=b[O>>3],D&128&&(T[O]=1);u.pixels.resultMask=T,x.bitset=b,f+=x.numBytes}return u.ptr=f,u.mask=x,!0},readDataOneSweep:function(c,u,f){var h=u.ptr,p=u.headerInfo,_=p.numDims,m=p.width*p.height,x=p.imageType,b=p.numValidPixel*r.getDataTypeSize(x)*_,T,C=u.pixels.resultMask;if(f===Uint8Array)T=new Uint8Array(c,h,b);else{var A=new ArrayBuffer(b),S=new Uint8Array(A);S.set(new Uint8Array(c,h,b)),T=new f(A)}if(T.length===m*_)u.pixels.resultPixels=T;else{u.pixels.resultPixels=new f(m*_);var v=0,D=0,O=0,R=0;if(_>1)for(O=0;O<_;O++)for(R=O*m,D=0;D<m;D++)C[D]&&(u.pixels.resultPixels[R+D]=T[v++]);else for(D=0;D<m;D++)C[D]&&(u.pixels.resultPixels[D]=T[v++])}return h+=b,u.ptr=h,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(c,u.ptr,16);u.ptr+=16;var p=h.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var _=h.getInt32(4,!0),m=h.getInt32(8,!0),x=h.getInt32(12,!0);if(m>=x)return!1;var b=new Uint32Array(x-m);r.decodeBits(c,u,b);var T=[],C,A,S,v;for(C=m;C<x;C++)A=C-(C<_?0:_),T[A]={first:b[C-m],second:null};var D=c.byteLength-u.ptr,O=Math.ceil(D/4),R=new ArrayBuffer(O*4),M=new Uint8Array(R);M.set(new Uint8Array(c,u.ptr,D));var L=new Uint32Array(R),g=0,E,w=0;for(E=L[0],C=m;C<x;C++)A=C-(C<_?0:_),v=T[A].first,v>0&&(T[A].second=E<<g>>>32-v,32-g>=v?(g+=v,g===32&&(g=0,w++,E=L[w])):(g+=v-32,w++,E=L[w],T[A].second|=E>>>32-g));var I=0,N=0,B=new s;for(C=0;C<T.length;C++)T[C]!==void 0&&(I=Math.max(I,T[C].first));I>=f?N=f:N=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var H=[],V,G,k,W,Y,J;for(C=m;C<x;C++)if(A=C-(C<_?0:_),v=T[A].first,v>0)if(V=[v,A],v<=N)for(G=T[A].second<<N-v,k=1<<N-v,S=0;S<k;S++)H[G|S]=V;else for(G=T[A].second,J=B,W=v-1;W>=0;W--)Y=G>>>W&1,Y?(J.right||(J.right=new s),J=J.right):(J.left||(J.left=new s),J=J.left),W===0&&!J.val&&(J.val=V[1]);return{decodeLut:H,numBitsLUTQick:N,numBitsLUT:I,tree:B,stuffedData:L,srcPtr:w,bitPos:g}},readHuffman:function(c,u,f){var h=u.headerInfo,p=h.numDims,_=u.headerInfo.height,m=u.headerInfo.width,x=m*_,b=this.readHuffmanTree(c,u),T=b.decodeLut,C=b.tree,A=b.stuffedData,S=b.srcPtr,v=b.bitPos,D=b.numBitsLUTQick,O=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,M,L,g,E=u.pixels.resultMask,w,I,N,B,H,V,G,k=0;v>0&&(S++,v=0);var W=A[S],Y=u.encodeMode===1,J=new f(x*p),j=J,K;for(K=0;K<h.numDims;K++){if(p>1&&(j=new f(J.buffer,x*K,x),k=0),u.headerInfo.numValidPixel===m*_)for(V=0,B=0;B<_;B++)for(H=0;H<m;H++,V++){if(L=0,w=W<<v>>>32-D,I=w,32-v<D&&(w|=A[S+1]>>>64-v-D,I=w),T[I])L=T[I][1],v+=T[I][0];else for(w=W<<v>>>32-O,I=w,32-v<O&&(w|=A[S+1]>>>64-v-O,I=w),M=C,G=0;G<O;G++)if(N=w>>>O-G-1&1,M=N?M.right:M.left,!(M.left||M.right)){L=M.val,v=v+G+1;break}v>=32&&(v-=32,S++,W=A[S]),g=L-R,Y?(H>0?g+=k:B>0?g+=j[V-m]:g+=k,g&=255,j[V]=g,k=g):j[V]=g}else for(V=0,B=0;B<_;B++)for(H=0;H<m;H++,V++)if(E[V]){if(L=0,w=W<<v>>>32-D,I=w,32-v<D&&(w|=A[S+1]>>>64-v-D,I=w),T[I])L=T[I][1],v+=T[I][0];else for(w=W<<v>>>32-O,I=w,32-v<O&&(w|=A[S+1]>>>64-v-O,I=w),M=C,G=0;G<O;G++)if(N=w>>>O-G-1&1,M=N?M.right:M.left,!(M.left||M.right)){L=M.val,v=v+G+1;break}v>=32&&(v-=32,S++,W=A[S]),g=L-R,Y?(H>0&&E[V-1]?g+=k:B>0&&E[V-m]?g+=j[V-m]:g+=k,g&=255,j[V]=g,k=g):j[V]=g}u.ptr=u.ptr+(S+1)*4+(v>0?4:0)}u.pixels.resultPixels=J},decodeBits:function(c,u,f,h,p){{var _=u.headerInfo,m=_.fileVersion,x=0,b=new DataView(c,u.ptr,5),T=b.getUint8(0);x++;var C=T>>6,A=C===0?4:3-C,S=(T&32)>0,v=T&31,D=0;if(A===1)D=b.getUint8(x),x++;else if(A===2)D=b.getUint16(x,!0),x+=2;else if(A===4)D=b.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var O=2*_.maxZError,R,M,L,g,E,w,I,N,B,H,V=_.numDims>1?_.maxValues[p]:_.zMax;if(S){for(u.counter.lut++,N=b.getUint8(x),B=v,x++,g=Math.ceil((N-1)*v/8),E=Math.ceil(g/4),M=new ArrayBuffer(E*4),L=new Uint8Array(M),u.ptr+=x,L.set(new Uint8Array(c,u.ptr,g)),I=new Uint32Array(M),u.ptr+=g,H=0;N-1>>>H;)H++;g=Math.ceil(D*H/8),E=Math.ceil(g/4),M=new ArrayBuffer(E*4),L=new Uint8Array(M),L.set(new Uint8Array(c,u.ptr,g)),R=new Uint32Array(M),u.ptr+=g,m>=3?w=o.unstuffLUT2(I,v,N-1,h,O,V):w=o.unstuffLUT(I,v,N-1,h,O,V),m>=3?o.unstuff2(R,f,H,D,w):o.unstuff(R,f,H,D,w)}else u.counter.bitstuffer++,H=v,u.ptr+=x,H>0&&(g=Math.ceil(D*H/8),E=Math.ceil(g/4),M=new ArrayBuffer(E*4),L=new Uint8Array(M),L.set(new Uint8Array(c,u.ptr,g)),R=new Uint32Array(M),u.ptr+=g,m>=3?h==null?o.originalUnstuff2(R,f,H,D):o.unstuff2(R,f,H,D,!1,h,O,V):h==null?o.originalUnstuff(R,f,H,D):o.unstuff(R,f,H,D,!1,h,O,V))}},readTiles:function(c,u,f){var h=u.headerInfo,p=h.width,_=h.height,m=h.microBlockSize,x=h.imageType,b=r.getDataTypeSize(x),T=Math.ceil(p/m),C=Math.ceil(_/m);u.pixels.numBlocksY=C,u.pixels.numBlocksX=T,u.pixels.ptr=0;var A=0,S=0,v=0,D=0,O=0,R=0,M=0,L=0,g=0,E=0,w=0,I=0,N=0,B=0,H=0,V=0,G,k,W,Y,J,j,K=new f(m*m),Q=_%m||m,de=p%m||m,xe,ce,_e=h.numDims,be,De=u.pixels.resultMask,Ae=u.pixels.resultPixels;for(v=0;v<C;v++)for(O=v!==C-1?m:Q,D=0;D<T;D++)for(R=D!==T-1?m:de,w=v*p*m+D*m,I=p-R,be=0;be<_e;be++){if(_e>1&&(Ae=new f(u.pixels.resultPixels.buffer,p*_*be*b,p*_)),M=c.byteLength-u.ptr,G=new DataView(c,u.ptr,Math.min(10,M)),k={},V=0,L=G.getUint8(0),V++,g=L>>6&255,E=L>>2&15,E!==(D*m>>3&15))throw"integrity issue";if(j=L&3,j>3)throw u.ptr+=V,"Invalid block encoding ("+j+")";if(j===2){u.counter.constant++,u.ptr+=V;continue}else if(j===0){if(u.counter.uncompressed++,u.ptr+=V,N=O*R*b,B=c.byteLength-u.ptr,N=N<B?N:B,W=new ArrayBuffer(N%b===0?N:N+b-N%b),Y=new Uint8Array(W),Y.set(new Uint8Array(c,u.ptr,N)),J=new f(W),H=0,De)for(A=0;A<O;A++){for(S=0;S<R;S++)De[w]&&(Ae[w]=J[H++]),w++;w+=I}else for(A=0;A<O;A++){for(S=0;S<R;S++)Ae[w++]=J[H++];w+=I}u.ptr+=H*b}else if(xe=r.getDataTypeUsed(x,g),ce=r.getOnePixel(k,V,xe,G),V+=r.getDataTypeSize(xe),j===3)if(u.ptr+=V,u.counter.constantoffset++,De)for(A=0;A<O;A++){for(S=0;S<R;S++)De[w]&&(Ae[w]=ce),w++;w+=I}else for(A=0;A<O;A++){for(S=0;S<R;S++)Ae[w++]=ce;w+=I}else if(u.ptr+=V,r.decodeBits(c,u,K,ce,be),V=0,De)for(A=0;A<O;A++){for(S=0;S<R;S++)De[w]&&(Ae[w]=K[V++]),w++;w+=I}else for(A=0;A<O;A++){for(S=0;S<R;S++)Ae[w++]=K[V++];w+=I}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,h=c.headerInfo.height*c.headerInfo.width,p=h*f,_=0,m=0,x=0,b=c.pixels.resultMask;if(b)if(f>1)for(_=0;_<f;_++)for(x=_*h,m=0;m<h;m++)b[m]&&(c.pixels.resultPixels[x+m]=u);else for(m=0;m<h;m++)b[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,h){var p=0;switch(f){case 0:p=h.getInt8(u);break;case 1:p=h.getUint8(u);break;case 2:p=h.getInt16(u,!0);break;case 3:p=h.getUint16(u,!0);break;case 4:p=h.getInt32(u,!0);break;case 5:p=h.getUInt32(u,!0);break;case 6:p=h.getFloat32(u,!0);break;case 7:p=h.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,h=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var _=p.headerInfo,m=_.fileVersion,x=r.getDataTypeArray(_.imageType);r.readMask(c,p),_.numValidPixel!==_.width*_.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=_.width*_.height;if(p.pixels.resultPixels=new x(b*_.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},_.numValidPixel!==0)if(_.zMax===_.zMin)r.constructConstantSurface(p);else if(m>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var T=new DataView(c,p.ptr,2),C=T.getUint8(0);if(p.ptr++,C)r.readDataOneSweep(c,p,x);else if(m>1&&_.imageType<=1&&Math.abs(_.maxZError-.5)<1e-5){var A=T.getUint8(1);if(p.ptr++,p.encodeMode=A,A>2||m<4&&A>1)throw"Invalid Huffman flag "+A;A?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:_.width,height:_.height,pixelData:p.pixels.resultPixels,minValue:_.zMin,maxValue:_.zMax,validPixelCount:_.numValidPixel,dimCount:_.numDims,dimStats:{minValues:_.minValues,maxValues:_.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(_.imageType,f)){var D=p.pixels.resultMask;for(h=0;h<b;h++)D[h]||(v.pixelData[h]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=r.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,h={};for(h.ptr=0,h.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,h),f+=h.headerInfo.blobSize,u++,h.ptr=f;return u}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var h=0,p=o.byteLength-10,_,m=[],x,b,T={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var C=u.decode(o,{inputOffset:s,encodedMaskData:_,maskData:b,returnMask:h===0,returnEncodedMask:h===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=C.fileInfo.eofOffset,h===0&&(_=C.encodedMaskData,b=C.maskData,T.width=C.width,T.height=C.height,T.dimCount=C.dimCount||1,T.pixelType=C.pixelType||C.fileInfo.pixelType,T.mask=C.maskData),f>1&&C.fileInfo.mask&&C.fileInfo.mask.numBytes>0&&m.push(C.maskData),h++,T.pixels.push(C.pixelData),T.statistics.push({minValue:C.minValue,maxValue:C.maxValue,noDataValue:C.noDataValue,dimStats:C.dimStats})}var A,S,v;if(f>1&&m.length>1){for(v=T.width*T.height,T.bandMasks=m,b=new Uint8Array(v),b.set(m[0]),A=1;A<m.length;A++)for(x=m[A],S=0;S<v;S++)b[S]=b[S]&x[S];T.maskData=b}return T}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof g8<"u"&&g8.exports?g8.exports=i:this.Lerc=i})()});var mAe=Wu((bao,hAe)=>{hAe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK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at((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,IZ=()=>"wakeLock"in navigator,PZ=class{constructor(){if(this.enabled=!1,IZ()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else DZ()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",EEt),this._addSourceToVideo(this.noSleepVideo,"mp4",SEt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return IZ()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):DZ()?(this.disable(),console.warn(` NoSleep enabled for older iOS devices. This can interrupt active or long-running network requests from completing successfully. See https://github.com/richtr/NoSleep.js/issues/15 for more details. `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){IZ()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):DZ()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};hAe.exports=PZ});function NAe(e){return e!=null}var l=NAe;function T0(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(T0.prototype=Object.create(Error.prototype),T0.prototype.constructor=T0);T0.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};T0.throwInstantiationError=function(){throw new T0("This function defines an interface and should not be called directly.")};var he=T0;var ms={};ms.typeOf={};function FAe(e){return`${e} is required, actual value was undefined`}function Kb(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ms.defined=function(e,t){if(!l(t))throw new he(FAe(e))};ms.typeOf.func=function(e,t){if(typeof t!="function")throw new he(Kb(typeof t,"function",e))};ms.typeOf.string=function(e,t){if(typeof t!="string")throw new he(Kb(typeof t,"string",e))};ms.typeOf.number=function(e,t){if(typeof t!="number")throw new he(Kb(typeof t,"number",e))};ms.typeOf.number.lessThan=function(e,t,n){if(ms.typeOf.number(e,t),t>=n)throw new he(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ms.typeOf.number.lessThanOrEquals=function(e,t,n){if(ms.typeOf.number(e,t),t>n)throw new he(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ms.typeOf.number.greaterThan=function(e,t,n){if(ms.typeOf.number(e,t),t<=n)throw new he(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ms.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ms.typeOf.number(e,t),t<n)throw new he(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ms.typeOf.object=function(e,t){if(typeof t!="object")throw new he(Kb(typeof t,"object",e))};ms.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new he(Kb(typeof t,"boolean",e))};ms.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new he(Kb(typeof t,"bigint",e))};ms.typeOf.number.equals=function(e,t,n,i){if(ms.typeOf.number(e,n),ms.typeOf.number(t,i),n!==i)throw new he(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var xo=ms;function FZ(e,t){return e??t}FZ.EMPTY_OBJECT=Object.freeze({});var y=FZ;var OG=Ur(WP(),1);var st={};st.EPSILON1=.1;st.EPSILON2=.01;st.EPSILON3=.001;st.EPSILON4=1e-4;st.EPSILON5=1e-5;st.EPSILON6=1e-6;st.EPSILON7=1e-7;st.EPSILON8=1e-8;st.EPSILON9=1e-9;st.EPSILON10=1e-10;st.EPSILON11=1e-11;st.EPSILON12=1e-12;st.EPSILON13=1e-13;st.EPSILON14=1e-14;st.EPSILON15=1e-15;st.EPSILON16=1e-16;st.EPSILON17=1e-17;st.EPSILON18=1e-18;st.EPSILON19=1e-19;st.EPSILON20=1e-20;st.EPSILON21=1e-21;st.GRAVITATIONALPARAMETER=3986004418e5;st.SOLAR_RADIUS=6955e5;st.LUNAR_RADIUS=1737400;st.SIXTY_FOUR_KILOBYTES=64*1024;st.FOUR_GIGABYTES=4*1024*1024*1024;st.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});st.signNotZero=function(e){return e<0?-1:1};st.toSNorm=function(e,t){return t=y(t,255),Math.round((st.clamp(e,-1,1)*.5+.5)*t)};st.fromSNorm=function(e,t){return t=y(t,255),st.clamp(e,0,t)/t*2-1};st.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:st.clamp((e-t)/n,0,1)};st.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});st.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});st.lerp=function(e,t,n){return(1-n)*e+n*t};st.PI=Math.PI;st.ONE_OVER_PI=1/Math.PI;st.PI_OVER_TWO=Math.PI/2;st.PI_OVER_THREE=Math.PI/3;st.PI_OVER_FOUR=Math.PI/4;st.PI_OVER_SIX=Math.PI/6;st.THREE_PI_OVER_TWO=3*Math.PI/2;st.TWO_PI=2*Math.PI;st.ONE_OVER_TWO_PI=1/(2*Math.PI);st.RADIANS_PER_DEGREE=Math.PI/180;st.DEGREES_PER_RADIAN=180/Math.PI;st.RADIANS_PER_ARCSECOND=st.RADIANS_PER_DEGREE/3600;st.toRadians=function(e){return e*st.RADIANS_PER_DEGREE};st.toDegrees=function(e){return e*st.DEGREES_PER_RADIAN};st.convertLongitudeRange=function(e){let t=st.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};st.clampToLatitudeRange=function(e){return st.clamp(e,-1*st.PI_OVER_TWO,st.PI_OVER_TWO)};st.negativePiToPi=function(e){return e>=-st.PI&&e<=st.PI?e:st.zeroToTwoPi(e+st.PI)-st.PI};st.zeroToTwoPi=function(e){if(e>=0&&e<=st.TWO_PI)return e;let t=st.mod(e,st.TWO_PI);return Math.abs(t)<st.EPSILON14&&Math.abs(e)>st.EPSILON14?st.TWO_PI:t};st.mod=function(e,t){return st.sign(e)===st.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};st.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};st.lessThan=function(e,t,n){return e-t<-n};st.lessThanOrEquals=function(e,t,n){return e-t<n};st.greaterThan=function(e,t,n){return e-t>n};st.greaterThanOrEquals=function(e,t,n){return e-t>-n};var jP=[1];st.factorial=function(e){let t=jP.length;if(e>=t){let n=jP[t-1];for(let i=t;i<=e;i++){let o=n*i;jP.push(o),n=o}}return jP[e]};st.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};st.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};st.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};st.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};st.clamp=function(e,t,n){return e<t?t:e>n?n:e};var kZ=new OG.default;st.setRandomNumberSeed=function(e){kZ=new OG.default(e)};st.nextRandomNumber=function(){return kZ.random()};st.randomBetween=function(e,t){return st.nextRandomNumber()*(t-e)+e};st.acosClamped=function(e){return Math.acos(st.clamp(e,-1,1))};st.asinClamped=function(e){return Math.asin(st.clamp(e,-1,1))};st.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};st.logBase=function(e,t){return Math.log(e)/Math.log(t)};st.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});st.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});st.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};st.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};st.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=st.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?st.PI_OVER_TWO-i:i,i=e<0?st.PI-i:i,i=t<0?-i:i,i};var P=st;function Ze(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}Ze.fromSpherical=function(e,t){l(t)||(t=new Ze);let n=e.clock,i=e.cone,o=y(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};Ze.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new Ze(e,t,n)};Ze.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Ze(e.x,e.y,e.z)};Ze.fromCartesian4=Ze.clone;Ze.packedLength=3;Ze.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Ze.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ze),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Ze.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Ze.pack(e[o],t,o*3);return t};Ze.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=Ze.unpack(e,i,t[o])}return t};Ze.fromArray=Ze.unpack;Ze.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};Ze.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};Ze.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};Ze.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};Ze.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};Ze.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};Ze.magnitude=function(e){return Math.sqrt(Ze.magnitudeSquared(e))};var YP=new Ze;Ze.distance=function(e,t){return Ze.subtract(e,t,YP),Ze.magnitude(YP)};Ze.distanceSquared=function(e,t){return Ze.subtract(e,t,YP),Ze.magnitudeSquared(YP)};Ze.normalize=function(e,t){let n=Ze.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};Ze.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};Ze.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};Ze.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};Ze.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};Ze.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};Ze.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};Ze.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};Ze.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};Ze.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var VZ=new Ze;Ze.lerp=function(e,t,n,i){return Ze.multiplyByScalar(t,n,VZ),i=Ze.multiplyByScalar(e,1-n,i),Ze.add(VZ,i,i)};var qP=new Ze,MG=new Ze;Ze.angleBetween=function(e,t){Ze.normalize(e,qP),Ze.normalize(t,MG);let n=Ze.dot(qP,MG),i=Ze.magnitude(Ze.cross(qP,MG,qP));return Math.atan2(i,n)};var BAe=new Ze;Ze.mostOrthogonalAxis=function(e,t){let n=Ze.normalize(e,BAe);return Ze.abs(n,n),n.x<=n.y?n.x<=n.z?t=Ze.clone(Ze.UNIT_X,t):t=Ze.clone(Ze.UNIT_Z,t):n.y<=n.z?t=Ze.clone(Ze.UNIT_Y,t):t=Ze.clone(Ze.UNIT_Z,t),t};Ze.projectVector=function(e,t,n){let i=Ze.dot(e,t)/Ze.dot(t,t);return Ze.multiplyByScalar(t,i,n)};Ze.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};Ze.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};Ze.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)};Ze.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,u=o*c-r*a,f=r*s-i*c,h=i*a-o*s;return n.x=u,n.y=f,n.z=h,n};Ze.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};Ze.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(e),t=P.toRadians(t),Ze.fromRadians(e,t,n,i,o)};var Wu=new Ze,Zb=new Ze;Ze._ellipsoidRadiiSquared=new Ze(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Ze.fromRadians=function(e,t,n,i,o){n=y(n,0);let r=l(i)?i.radiiSquared:Ze._ellipsoidRadiiSquared,s=Math.cos(t);Wu.x=s*Math.cos(e),Wu.y=s*Math.sin(e),Wu.z=Math.sin(t),Wu=Ze.normalize(Wu,Wu),Ze.multiplyComponents(r,Wu,Zb);let a=Math.sqrt(Ze.dot(Wu,Zb));return Zb=Ze.divideByScalar(Zb,a,Zb),Wu=Ze.multiplyByScalar(Wu,n,Wu),l(o)||(o=new Ze),Ze.add(Zb,Wu,o)};Ze.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=Ze.fromDegrees(r,s,0,t,n[a])}return n};Ze.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=Ze.fromRadians(r,s,0,t,n[a])}return n};Ze.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=Ze.fromDegrees(r,s,a,t,n[c])}return n};Ze.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=Ze.fromRadians(r,s,a,t,n[c])}return n};Ze.ZERO=Object.freeze(new Ze(0,0,0));Ze.ONE=Object.freeze(new Ze(1,1,1));Ze.UNIT_X=Object.freeze(new Ze(1,0,0));Ze.UNIT_Y=Object.freeze(new Ze(0,1,0));Ze.UNIT_Z=Object.freeze(new Ze(0,0,1));Ze.prototype.clone=function(e){return Ze.clone(this,e)};Ze.prototype.equals=function(e){return Ze.equals(this,e)};Ze.prototype.equalsEpsilon=function(e,t,n){return Ze.equalsEpsilon(this,e,t,n)};Ze.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var d=Ze;function _t(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}_t.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new _t(e,t,n,i)};_t.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new _t(e.red,e.green,e.blue,e.alpha)};_t.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new _t(e.x,e.y,e.z,e.w)};_t.packedLength=4;_t.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};_t.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new _t),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};_t.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)_t.pack(e[o],t,o*4);return t};_t.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=_t.unpack(e,i,t[o])}return t};_t.fromArray=_t.unpack;_t.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};_t.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};_t.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};_t.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};_t.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z),a=P.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};_t.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};_t.magnitude=function(e){return Math.sqrt(_t.magnitudeSquared(e))};var XP=new _t;_t.distance=function(e,t){return _t.subtract(e,t,XP),_t.magnitude(XP)};_t.distanceSquared=function(e,t){return _t.subtract(e,t,XP),_t.magnitudeSquared(XP)};_t.normalize=function(e,t){let n=_t.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};_t.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};_t.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};_t.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};_t.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};_t.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};_t.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};_t.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};_t.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};_t.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var UZ=new _t;_t.lerp=function(e,t,n,i){return _t.multiplyByScalar(t,n,UZ),i=_t.multiplyByScalar(e,1-n,i),_t.add(UZ,i,i)};var kAe=new _t;_t.mostOrthogonalAxis=function(e,t){let n=_t.normalize(e,kAe);return _t.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=_t.clone(_t.UNIT_X,t):t=_t.clone(_t.UNIT_W,t):n.z<=n.w?t=_t.clone(_t.UNIT_Z,t):t=_t.clone(_t.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=_t.clone(_t.UNIT_Y,t):t=_t.clone(_t.UNIT_W,t):n.z<=n.w?t=_t.clone(_t.UNIT_Z,t):t=_t.clone(_t.UNIT_W,t),t};_t.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};_t.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};_t.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)&&P.equalsEpsilon(e.w,t.w,n,i)};_t.ZERO=Object.freeze(new _t(0,0,0,0));_t.ONE=Object.freeze(new _t(1,1,1,1));_t.UNIT_X=Object.freeze(new _t(1,0,0,0));_t.UNIT_Y=Object.freeze(new _t(0,1,0,0));_t.UNIT_Z=Object.freeze(new _t(0,0,1,0));_t.UNIT_W=Object.freeze(new _t(0,0,0,1));_t.prototype.clone=function(e){return _t.clone(this,e)};_t.prototype.equals=function(e){return _t.equals(this,e)};_t.prototype.equalsEpsilon=function(e,t,n){return _t.equalsEpsilon(this,e,t,n)};_t.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var LG=new Float32Array(1),ka=new Uint8Array(LG.buffer),VAe=new Uint32Array([287454020]),UAe=new Uint8Array(VAe.buffer),zZ=UAe[0]===68;_t.packFloat=function(e,t){return l(t)||(t=new _t),LG[0]=e,zZ?(t.x=ka[0],t.y=ka[1],t.z=ka[2],t.w=ka[3]):(t.x=ka[3],t.y=ka[2],t.z=ka[1],t.w=ka[0]),t};_t.unpackFloat=function(e){return zZ?(ka[0]=e.x,ka[1]=e.y,ka[2]=e.z,ka[3]=e.w):(ka[0]=e.w,ka[1]=e.z,ka[2]=e.y,ka[3]=e.x),LG[0]};var oe=_t;function Je(e,t,n,i,o,r,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(o,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(r,0),this[8]=y(c,0)}Je.packedLength=9;Je.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};Je.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Je),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};Je.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Je.pack(e[o],t,o*9);return t};Je.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=Je.unpack(e,i,t[o])}return t};Je.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new Je(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};Je.fromArray=Je.unpack;Je.fromColumnMajorArray=function(e,t){return Je.clone(e,t)};Je.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new Je(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Je.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,h=e.w*e.w,p=n-s-u+h,_=2*(i-f),m=2*(o+c),x=2*(i+f),b=-n+s-u+h,T=2*(a-r),C=2*(o-c),A=2*(a+r),S=-n-s+u+h;return l(t)?(t[0]=p,t[1]=x,t[2]=C,t[3]=_,t[4]=b,t[5]=A,t[6]=m,t[7]=T,t[8]=S,t):new Je(p,_,m,x,b,T,C,A,S)};Je.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,u=-o*s+a*r*i,f=a*s+o*r*i,h=n*s,p=o*i+a*r*s,_=-a*i+o*r*s,m=-r,x=a*n,b=o*n;return l(t)?(t[0]=c,t[1]=h,t[2]=m,t[3]=u,t[4]=p,t[5]=x,t[6]=f,t[7]=_,t[8]=b,t):new Je(c,u,f,h,p,_,m,x,b)};Je.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new Je(e.x,0,0,0,e.y,0,0,0,e.z)};Je.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new Je(e,0,0,0,e,0,0,0,e)};Je.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new Je(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};Je.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new Je(1,0,0,0,n,-i,0,i,n)};Je.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new Je(n,0,i,0,1,0,-i,0,n)};Je.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Je(n,-i,0,i,n,0,0,0,1)};Je.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};Je.getElementIndex=function(e,t){return e*3+t};Je.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};Je.setColumn=function(e,t,n,i){i=Je.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};Je.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};Je.setRow=function(e,t,n,i){return i=Je.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var zAe=new d;Je.setScale=function(e,t,n){let i=Je.getScale(e,zAe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var HAe=new d;Je.setUniformScale=function(e,t,n){let i=Je.getScale(e,HAe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var NG=new d;Je.getScale=function(e,t){return t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],NG)),t.y=d.magnitude(d.fromElements(e[3],e[4],e[5],NG)),t.z=d.magnitude(d.fromElements(e[6],e[7],e[8],NG)),t};var HZ=new d;Je.getMaximumScale=function(e){return Je.getScale(e,HZ),d.maximumComponent(HZ)};var GAe=new d;Je.setRotation=function(e,t,n){let i=Je.getScale(e,GAe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var WAe=new d;Je.getRotation=function(e,t){let n=Je.getScale(e,WAe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};Je.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=h,n};Je.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};Je.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};Je.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};Je.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};Je.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};Je.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};Je.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};Je.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=f,t};function jAe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var FG=[1,0,0],BG=[2,2,1];function qAe(e){let t=0;for(let n=0;n<3;++n){let i=e[Je.getElementIndex(BG[n],FG[n])];t+=2*i*i}return Math.sqrt(t)}function YAe(e,t){let n=P.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[Je.getElementIndex(BG[u],FG[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=FG[o],c=BG[o];if(Math.abs(e[Je.getElementIndex(c,a)])>n){let u=e[Je.getElementIndex(c,c)],f=e[Je.getElementIndex(a,a)],h=e[Je.getElementIndex(c,a)],p=(u-f)/2/h,_;p<0?_=-1/(-p+Math.sqrt(1+p*p)):_=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+_*_),s=_*r}return t=Je.clone(Je.IDENTITY,t),t[Je.getElementIndex(a,a)]=t[Je.getElementIndex(c,c)]=r,t[Je.getElementIndex(c,a)]=s,t[Je.getElementIndex(a,c)]=-s,t}var KP=new Je,GZ=new Je;Je.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=Je.clone(Je.IDENTITY,t.unitary),a=t.diagonal=Je.clone(e,t.diagonal),c=n*jAe(a);for(;r<i&&qAe(a)>c;)YAe(a,KP),Je.transpose(KP,GZ),Je.multiply(a,KP,a),Je.multiply(GZ,a,a),Je.multiply(s,KP,s),++o>2&&(++r,o=0);return t};Je.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};Je.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};Je.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],h=Je.determinant(e);t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=c*a-r*f,t[4]=n*f-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let p=1/h;return Je.multiplyByScalar(t,p,t)};var XAe=new Je;Je.inverseTranspose=function(e,t){return Je.inverse(Je.transpose(e,XAe),t)};Je.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};Je.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};Je.IDENTITY=Object.freeze(new Je(1,0,0,0,1,0,0,0,1));Je.ZERO=Object.freeze(new Je(0,0,0,0,0,0,0,0,0));Je.COLUMN0ROW0=0;Je.COLUMN0ROW1=1;Je.COLUMN0ROW2=2;Je.COLUMN1ROW0=3;Je.COLUMN1ROW1=4;Je.COLUMN1ROW2=5;Je.COLUMN2ROW0=6;Je.COLUMN2ROW1=7;Je.COLUMN2ROW2=8;Object.defineProperties(Je.prototype,{length:{get:function(){return Je.packedLength}}});Je.prototype.clone=function(e){return Je.clone(this,e)};Je.prototype.equals=function(e){return Je.equals(this,e)};Je.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};Je.prototype.equalsEpsilon=function(e,t){return Je.equalsEpsilon(this,e,t)};Je.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};pAe.exports=PZ});function BAe(e){return e!=null}var l=BAe;function T0(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(T0.prototype=Object.create(Error.prototype),T0.prototype.constructor=T0);T0.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};T0.throwInstantiationError=function(){throw new T0("This function defines an interface and should not be called directly.")};var he=T0;var ms={};ms.typeOf={};function kAe(e){return`${e} is required, actual value was undefined`}function Kb(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ms.defined=function(e,t){if(!l(t))throw new he(kAe(e))};ms.typeOf.func=function(e,t){if(typeof t!="function")throw new he(Kb(typeof t,"function",e))};ms.typeOf.string=function(e,t){if(typeof t!="string")throw new he(Kb(typeof t,"string",e))};ms.typeOf.number=function(e,t){if(typeof t!="number")throw new he(Kb(typeof t,"number",e))};ms.typeOf.number.lessThan=function(e,t,n){if(ms.typeOf.number(e,t),t>=n)throw new he(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ms.typeOf.number.lessThanOrEquals=function(e,t,n){if(ms.typeOf.number(e,t),t>n)throw new he(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ms.typeOf.number.greaterThan=function(e,t,n){if(ms.typeOf.number(e,t),t<=n)throw new he(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ms.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ms.typeOf.number(e,t),t<n)throw new he(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ms.typeOf.object=function(e,t){if(typeof t!="object")throw new he(Kb(typeof t,"object",e))};ms.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new he(Kb(typeof t,"boolean",e))};ms.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new he(Kb(typeof t,"bigint",e))};ms.typeOf.number.equals=function(e,t,n,i){if(ms.typeOf.number(e,n),ms.typeOf.number(t,i),n!==i)throw new he(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var xo=ms;function FZ(e,t){return e??t}FZ.EMPTY_OBJECT=Object.freeze({});var y=FZ;var LG=Ur(XP(),1);var rt={};rt.EPSILON1=.1;rt.EPSILON2=.01;rt.EPSILON3=.001;rt.EPSILON4=1e-4;rt.EPSILON5=1e-5;rt.EPSILON6=1e-6;rt.EPSILON7=1e-7;rt.EPSILON8=1e-8;rt.EPSILON9=1e-9;rt.EPSILON10=1e-10;rt.EPSILON11=1e-11;rt.EPSILON12=1e-12;rt.EPSILON13=1e-13;rt.EPSILON14=1e-14;rt.EPSILON15=1e-15;rt.EPSILON16=1e-16;rt.EPSILON17=1e-17;rt.EPSILON18=1e-18;rt.EPSILON19=1e-19;rt.EPSILON20=1e-20;rt.EPSILON21=1e-21;rt.GRAVITATIONALPARAMETER=3986004418e5;rt.SOLAR_RADIUS=6955e5;rt.LUNAR_RADIUS=1737400;rt.SIXTY_FOUR_KILOBYTES=64*1024;rt.FOUR_GIGABYTES=4*1024*1024*1024;rt.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});rt.signNotZero=function(e){return e<0?-1:1};rt.toSNorm=function(e,t){return t=y(t,255),Math.round((rt.clamp(e,-1,1)*.5+.5)*t)};rt.fromSNorm=function(e,t){return t=y(t,255),rt.clamp(e,0,t)/t*2-1};rt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:rt.clamp((e-t)/n,0,1)};rt.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});rt.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});rt.lerp=function(e,t,n){return(1-n)*e+n*t};rt.PI=Math.PI;rt.ONE_OVER_PI=1/Math.PI;rt.PI_OVER_TWO=Math.PI/2;rt.PI_OVER_THREE=Math.PI/3;rt.PI_OVER_FOUR=Math.PI/4;rt.PI_OVER_SIX=Math.PI/6;rt.THREE_PI_OVER_TWO=3*Math.PI/2;rt.TWO_PI=2*Math.PI;rt.ONE_OVER_TWO_PI=1/(2*Math.PI);rt.RADIANS_PER_DEGREE=Math.PI/180;rt.DEGREES_PER_RADIAN=180/Math.PI;rt.RADIANS_PER_ARCSECOND=rt.RADIANS_PER_DEGREE/3600;rt.toRadians=function(e){return e*rt.RADIANS_PER_DEGREE};rt.toDegrees=function(e){return e*rt.DEGREES_PER_RADIAN};rt.convertLongitudeRange=function(e){let t=rt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};rt.clampToLatitudeRange=function(e){return rt.clamp(e,-1*rt.PI_OVER_TWO,rt.PI_OVER_TWO)};rt.negativePiToPi=function(e){return e>=-rt.PI&&e<=rt.PI?e:rt.zeroToTwoPi(e+rt.PI)-rt.PI};rt.zeroToTwoPi=function(e){if(e>=0&&e<=rt.TWO_PI)return e;let t=rt.mod(e,rt.TWO_PI);return Math.abs(t)<rt.EPSILON14&&Math.abs(e)>rt.EPSILON14?rt.TWO_PI:t};rt.mod=function(e,t){return rt.sign(e)===rt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};rt.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};rt.lessThan=function(e,t,n){return e-t<-n};rt.lessThanOrEquals=function(e,t,n){return e-t<n};rt.greaterThan=function(e,t,n){return e-t>n};rt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var KP=[1];rt.factorial=function(e){let t=KP.length;if(e>=t){let n=KP[t-1];for(let i=t;i<=e;i++){let o=n*i;KP.push(o),n=o}}return KP[e]};rt.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};rt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};rt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};rt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};rt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var kZ=new LG.default;rt.setRandomNumberSeed=function(e){kZ=new LG.default(e)};rt.nextRandomNumber=function(){return kZ.random()};rt.randomBetween=function(e,t){return rt.nextRandomNumber()*(t-e)+e};rt.acosClamped=function(e){return Math.acos(rt.clamp(e,-1,1))};rt.asinClamped=function(e){return Math.asin(rt.clamp(e,-1,1))};rt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};rt.logBase=function(e,t){return Math.log(e)/Math.log(t)};rt.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});rt.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});rt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};rt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};rt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=rt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?rt.PI_OVER_TWO-i:i,i=e<0?rt.PI-i:i,i=t<0?-i:i,i};var P=rt;function Ze(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}Ze.fromSpherical=function(e,t){l(t)||(t=new Ze);let n=e.clock,i=e.cone,o=y(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};Ze.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new Ze(e,t,n)};Ze.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Ze(e.x,e.y,e.z)};Ze.fromCartesian4=Ze.clone;Ze.packedLength=3;Ze.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Ze.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ze),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Ze.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Ze.pack(e[o],t,o*3);return t};Ze.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=Ze.unpack(e,i,t[o])}return t};Ze.fromArray=Ze.unpack;Ze.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};Ze.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};Ze.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};Ze.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};Ze.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};Ze.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};Ze.magnitude=function(e){return Math.sqrt(Ze.magnitudeSquared(e))};var $P=new Ze;Ze.distance=function(e,t){return Ze.subtract(e,t,$P),Ze.magnitude($P)};Ze.distanceSquared=function(e,t){return Ze.subtract(e,t,$P),Ze.magnitudeSquared($P)};Ze.normalize=function(e,t){let n=Ze.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};Ze.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};Ze.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};Ze.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};Ze.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};Ze.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};Ze.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};Ze.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};Ze.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};Ze.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var VZ=new Ze;Ze.lerp=function(e,t,n,i){return Ze.multiplyByScalar(t,n,VZ),i=Ze.multiplyByScalar(e,1-n,i),Ze.add(VZ,i,i)};var ZP=new Ze,NG=new Ze;Ze.angleBetween=function(e,t){Ze.normalize(e,ZP),Ze.normalize(t,NG);let n=Ze.dot(ZP,NG),i=Ze.magnitude(Ze.cross(ZP,NG,ZP));return Math.atan2(i,n)};var VAe=new Ze;Ze.mostOrthogonalAxis=function(e,t){let n=Ze.normalize(e,VAe);return Ze.abs(n,n),n.x<=n.y?n.x<=n.z?t=Ze.clone(Ze.UNIT_X,t):t=Ze.clone(Ze.UNIT_Z,t):n.y<=n.z?t=Ze.clone(Ze.UNIT_Y,t):t=Ze.clone(Ze.UNIT_Z,t),t};Ze.projectVector=function(e,t,n){let i=Ze.dot(e,t)/Ze.dot(t,t);return Ze.multiplyByScalar(t,i,n)};Ze.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};Ze.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};Ze.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)};Ze.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,u=o*c-r*a,f=r*s-i*c,h=i*a-o*s;return n.x=u,n.y=f,n.z=h,n};Ze.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};Ze.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(e),t=P.toRadians(t),Ze.fromRadians(e,t,n,i,o)};var ju=new Ze,Zb=new Ze;Ze._ellipsoidRadiiSquared=new Ze(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Ze.fromRadians=function(e,t,n,i,o){n=y(n,0);let r=l(i)?i.radiiSquared:Ze._ellipsoidRadiiSquared,s=Math.cos(t);ju.x=s*Math.cos(e),ju.y=s*Math.sin(e),ju.z=Math.sin(t),ju=Ze.normalize(ju,ju),Ze.multiplyComponents(r,ju,Zb);let a=Math.sqrt(Ze.dot(ju,Zb));return Zb=Ze.divideByScalar(Zb,a,Zb),ju=Ze.multiplyByScalar(ju,n,ju),l(o)||(o=new Ze),Ze.add(Zb,ju,o)};Ze.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=Ze.fromDegrees(r,s,0,t,n[a])}return n};Ze.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=Ze.fromRadians(r,s,0,t,n[a])}return n};Ze.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=Ze.fromDegrees(r,s,a,t,n[c])}return n};Ze.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=Ze.fromRadians(r,s,a,t,n[c])}return n};Ze.ZERO=Object.freeze(new Ze(0,0,0));Ze.ONE=Object.freeze(new Ze(1,1,1));Ze.UNIT_X=Object.freeze(new Ze(1,0,0));Ze.UNIT_Y=Object.freeze(new Ze(0,1,0));Ze.UNIT_Z=Object.freeze(new Ze(0,0,1));Ze.prototype.clone=function(e){return Ze.clone(this,e)};Ze.prototype.equals=function(e){return Ze.equals(this,e)};Ze.prototype.equalsEpsilon=function(e,t,n){return Ze.equalsEpsilon(this,e,t,n)};Ze.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var d=Ze;function gt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}gt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new gt(e,t,n,i)};gt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new gt(e.red,e.green,e.blue,e.alpha)};gt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new gt(e.x,e.y,e.z,e.w)};gt.packedLength=4;gt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};gt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new gt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};gt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)gt.pack(e[o],t,o*4);return t};gt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=gt.unpack(e,i,t[o])}return t};gt.fromArray=gt.unpack;gt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};gt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};gt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};gt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};gt.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y),s=P.clamp(e.z,t.z,n.z),a=P.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};gt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};gt.magnitude=function(e){return Math.sqrt(gt.magnitudeSquared(e))};var QP=new gt;gt.distance=function(e,t){return gt.subtract(e,t,QP),gt.magnitude(QP)};gt.distanceSquared=function(e,t){return gt.subtract(e,t,QP),gt.magnitudeSquared(QP)};gt.normalize=function(e,t){let n=gt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};gt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};gt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};gt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};gt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};gt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};gt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};gt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};gt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};gt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var UZ=new gt;gt.lerp=function(e,t,n,i){return gt.multiplyByScalar(t,n,UZ),i=gt.multiplyByScalar(e,1-n,i),gt.add(UZ,i,i)};var UAe=new gt;gt.mostOrthogonalAxis=function(e,t){let n=gt.normalize(e,UAe);return gt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=gt.clone(gt.UNIT_X,t):t=gt.clone(gt.UNIT_W,t):n.z<=n.w?t=gt.clone(gt.UNIT_Z,t):t=gt.clone(gt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=gt.clone(gt.UNIT_Y,t):t=gt.clone(gt.UNIT_W,t):n.z<=n.w?t=gt.clone(gt.UNIT_Z,t):t=gt.clone(gt.UNIT_W,t),t};gt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};gt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};gt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)&&P.equalsEpsilon(e.z,t.z,n,i)&&P.equalsEpsilon(e.w,t.w,n,i)};gt.ZERO=Object.freeze(new gt(0,0,0,0));gt.ONE=Object.freeze(new gt(1,1,1,1));gt.UNIT_X=Object.freeze(new gt(1,0,0,0));gt.UNIT_Y=Object.freeze(new gt(0,1,0,0));gt.UNIT_Z=Object.freeze(new gt(0,0,1,0));gt.UNIT_W=Object.freeze(new gt(0,0,0,1));gt.prototype.clone=function(e){return gt.clone(this,e)};gt.prototype.equals=function(e){return gt.equals(this,e)};gt.prototype.equalsEpsilon=function(e,t,n){return gt.equalsEpsilon(this,e,t,n)};gt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var FG=new Float32Array(1),Va=new Uint8Array(FG.buffer),zAe=new Uint32Array([287454020]),HAe=new Uint8Array(zAe.buffer),zZ=HAe[0]===68;gt.packFloat=function(e,t){return l(t)||(t=new gt),FG[0]=e,zZ?(t.x=Va[0],t.y=Va[1],t.z=Va[2],t.w=Va[3]):(t.x=Va[3],t.y=Va[2],t.z=Va[1],t.w=Va[0]),t};gt.unpackFloat=function(e){return zZ?(Va[0]=e.x,Va[1]=e.y,Va[2]=e.z,Va[3]=e.w):(Va[0]=e.w,Va[1]=e.z,Va[2]=e.y,Va[3]=e.x),FG[0]};var oe=gt;function Je(e,t,n,i,o,r,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(o,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(r,0),this[8]=y(c,0)}Je.packedLength=9;Je.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};Je.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Je),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};Je.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Je.pack(e[o],t,o*9);return t};Je.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=Je.unpack(e,i,t[o])}return t};Je.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new Je(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};Je.fromArray=Je.unpack;Je.fromColumnMajorArray=function(e,t){return Je.clone(e,t)};Je.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new Je(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};Je.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,h=e.w*e.w,p=n-s-u+h,_=2*(i-f),m=2*(o+c),x=2*(i+f),b=-n+s-u+h,T=2*(a-r),C=2*(o-c),A=2*(a+r),S=-n-s+u+h;return l(t)?(t[0]=p,t[1]=x,t[2]=C,t[3]=_,t[4]=b,t[5]=A,t[6]=m,t[7]=T,t[8]=S,t):new Je(p,_,m,x,b,T,C,A,S)};Je.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,u=-o*s+a*r*i,f=a*s+o*r*i,h=n*s,p=o*i+a*r*s,_=-a*i+o*r*s,m=-r,x=a*n,b=o*n;return l(t)?(t[0]=c,t[1]=h,t[2]=m,t[3]=u,t[4]=p,t[5]=x,t[6]=f,t[7]=_,t[8]=b,t):new Je(c,u,f,h,p,_,m,x,b)};Je.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new Je(e.x,0,0,0,e.y,0,0,0,e.z)};Je.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new Je(e,0,0,0,e,0,0,0,e)};Je.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new Je(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};Je.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new Je(1,0,0,0,n,-i,0,i,n)};Je.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new Je(n,0,i,0,1,0,-i,0,n)};Je.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Je(n,-i,0,i,n,0,0,0,1)};Je.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};Je.getElementIndex=function(e,t){return e*3+t};Je.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};Je.setColumn=function(e,t,n,i){i=Je.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};Je.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};Je.setRow=function(e,t,n,i){return i=Je.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var GAe=new d;Je.setScale=function(e,t,n){let i=Je.getScale(e,GAe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var WAe=new d;Je.setUniformScale=function(e,t,n){let i=Je.getScale(e,WAe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var BG=new d;Je.getScale=function(e,t){return t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],BG)),t.y=d.magnitude(d.fromElements(e[3],e[4],e[5],BG)),t.z=d.magnitude(d.fromElements(e[6],e[7],e[8],BG)),t};var HZ=new d;Je.getMaximumScale=function(e){return Je.getScale(e,HZ),d.maximumComponent(HZ)};var jAe=new d;Je.setRotation=function(e,t,n){let i=Je.getScale(e,jAe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var qAe=new d;Je.getRotation=function(e,t){let n=Je.getScale(e,qAe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};Je.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=h,n};Je.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};Je.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};Je.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};Je.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};Je.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};Je.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};Je.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};Je.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=f,t};function YAe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var kG=[1,0,0],VG=[2,2,1];function XAe(e){let t=0;for(let n=0;n<3;++n){let i=e[Je.getElementIndex(VG[n],kG[n])];t+=2*i*i}return Math.sqrt(t)}function KAe(e,t){let n=P.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[Je.getElementIndex(VG[u],kG[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=kG[o],c=VG[o];if(Math.abs(e[Je.getElementIndex(c,a)])>n){let u=e[Je.getElementIndex(c,c)],f=e[Je.getElementIndex(a,a)],h=e[Je.getElementIndex(c,a)],p=(u-f)/2/h,_;p<0?_=-1/(-p+Math.sqrt(1+p*p)):_=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+_*_),s=_*r}return t=Je.clone(Je.IDENTITY,t),t[Je.getElementIndex(a,a)]=t[Je.getElementIndex(c,c)]=r,t[Je.getElementIndex(c,a)]=s,t[Je.getElementIndex(a,c)]=-s,t}var JP=new Je,GZ=new Je;Je.computeEigenDecomposition=function(e,t){let n=P.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=Je.clone(Je.IDENTITY,t.unitary),a=t.diagonal=Je.clone(e,t.diagonal),c=n*YAe(a);for(;r<i&&XAe(a)>c;)KAe(a,JP),Je.transpose(JP,GZ),Je.multiply(a,JP,a),Je.multiply(GZ,a,a),Je.multiply(s,JP,s),++o>2&&(++r,o=0);return t};Je.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};Je.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],u=e[8];return t*(r*u-c*s)+o*(c*i-n*u)+a*(n*s-r*i)};Je.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],u=e[7],f=e[8],h=Je.determinant(e);t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=c*a-r*f,t[4]=n*f-c*o,t[5]=r*o-n*a,t[6]=r*u-c*s,t[7]=c*i-n*u,t[8]=n*s-r*i;let p=1/h;return Je.multiplyByScalar(t,p,t)};var ZAe=new Je;Je.inverseTranspose=function(e,t){return Je.inverse(Je.transpose(e,ZAe),t)};Je.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};Je.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};Je.IDENTITY=Object.freeze(new Je(1,0,0,0,1,0,0,0,1));Je.ZERO=Object.freeze(new Je(0,0,0,0,0,0,0,0,0));Je.COLUMN0ROW0=0;Je.COLUMN0ROW1=1;Je.COLUMN0ROW2=2;Je.COLUMN1ROW0=3;Je.COLUMN1ROW1=4;Je.COLUMN1ROW2=5;Je.COLUMN2ROW0=6;Je.COLUMN2ROW1=7;Je.COLUMN2ROW2=8;Object.defineProperties(Je.prototype,{length:{get:function(){return Je.packedLength}}});Je.prototype.clone=function(e){return Je.clone(this,e)};Je.prototype.equals=function(e){return Je.equals(this,e)};Je.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};Je.prototype.equalsEpsilon=function(e,t){return Je.equalsEpsilon(this,e,t)};Je.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var $=Je;function IS(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(IS.prototype=Object.create(Error.prototype),IS.prototype.constructor=IS);IS.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var re=IS;function Qe(e,t,n,i,o,r,s,a,c,u,f,h,p,_,m,x){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(u,0),this[7]=y(_,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(m,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(h,0),this[15]=y(x,0)}Qe.packedLength=16;Qe.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};Qe.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Qe),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};Qe.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Qe.pack(e[o],t,o*16);return t};Qe.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=Qe.unpack(e,i,t[o])}return t};Qe.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new Qe(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};Qe.fromArray=Qe.unpack;Qe.fromColumnMajorArray=function(e,t){return Qe.clone(e,t)};Qe.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new Qe(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};Qe.fromRotationTranslation=function(e,t,n){return t=y(t,d.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new Qe(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};Qe.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new Qe);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,h=t.y*t.y,p=t.y*t.z,_=t.y*t.w,m=t.z*t.z,x=t.z*t.w,b=t.w*t.w,T=a-h-m+b,C=2*(c-x),A=2*(u+_),S=2*(c+x),v=-a+h-m+b,D=2*(p-f),O=2*(u-_),R=2*(p+f),M=-a-h+m+b;return i[0]=T*o,i[1]=S*o,i[2]=O*o,i[3]=0,i[4]=C*r,i[5]=v*r,i[6]=R*r,i[7]=0,i[8]=A*s,i[9]=D*s,i[10]=M*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};Qe.fromTranslationRotationScale=function(e,t){return Qe.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};Qe.fromTranslation=function(e,t){return Qe.fromRotationTranslation($.IDENTITY,e,t)};Qe.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Qe(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};Qe.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Qe(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};Qe.fromRotation=function(e,t){return l(t)||(t=new Qe),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var $b=new d,Qb=new d,PS=new d;Qe.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;d.normalize(i,$b),d.normalize(d.cross($b,o,Qb),Qb),d.normalize(d.cross(Qb,$b,PS),PS);let r=Qb.x,s=Qb.y,a=Qb.z,c=$b.x,u=$b.y,f=$b.z,h=PS.x,p=PS.y,_=PS.z,m=n.x,x=n.y,b=n.z,T=r*-m+s*-x+a*-b,C=h*-m+p*-x+_*-b,A=c*m+u*x+f*b;return l(t)?(t[0]=r,t[1]=h,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=_,t[10]=-f,t[11]=0,t[12]=T,t[13]=C,t[14]=A,t[15]=1,t):new Qe(r,s,a,T,h,p,_,C,-c,-u,-f,A,0,0,0,1)};Qe.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};Qe.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),u=1/(r-o),f=-(t+e)*a,h=-(i+n)*c,p=-(r+o)*u;return a*=2,c*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=h,s[14]=p,s[15]=1,s};Qe.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),h=-(r+o)/(r-o),p=-1,_=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=h,s[11]=p,s[12]=0,s[13]=0,s[14]=_,s[15]=0,s};Qe.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,h=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=u,r[10]=f,r[11]=h,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};Qe.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new Qe),e=y(e,y.EMPTY_OBJECT);let o=y(e.x,0),r=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,u=a*.5,f=(n-t)*.5,h=c,p=u,_=f,m=o+c,x=r+u,b=t+f,T=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=_,i[11]=0,i[12]=m,i[13]=x,i[14]=b,i[15]=T,i};Qe.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-d.dot(i,e),o[13]=-d.dot(n,e),o[14]=d.dot(t,e),o[15]=1,o};Qe.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};Qe.getElementIndex=function(e,t){return e*4+t};Qe.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};Qe.setColumn=function(e,t,n,i){i=Qe.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};Qe.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};Qe.setRow=function(e,t,n,i){return i=Qe.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};Qe.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var KAe=new d;Qe.setScale=function(e,t,n){let i=Qe.getScale(e,KAe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var ZAe=new d;Qe.setUniformScale=function(e,t,n){let i=Qe.getScale(e,ZAe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var kG=new d;Qe.getScale=function(e,t){return t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],kG)),t.y=d.magnitude(d.fromElements(e[4],e[5],e[6],kG)),t.z=d.magnitude(d.fromElements(e[8],e[9],e[10],kG)),t};var WZ=new d;Qe.getMaximumScale=function(e){return Qe.getScale(e,WZ),d.maximumComponent(WZ)};var $Ae=new d;Qe.setRotation=function(e,t,n){let i=Qe.getScale(e,$Ae);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var QAe=new d;Qe.getRotation=function(e,t){let n=Qe.getScale(e,QAe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};Qe.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],h=e[8],p=e[9],_=e[10],m=e[11],x=e[12],b=e[13],T=e[14],C=e[15],A=t[0],S=t[1],v=t[2],D=t[3],O=t[4],R=t[5],M=t[6],L=t[7],g=t[8],E=t[9],w=t[10],I=t[11],N=t[12],B=t[13],H=t[14],V=t[15],G=i*A+a*S+h*v+x*D,k=o*A+c*S+p*v+b*D,W=r*A+u*S+_*v+T*D,Y=s*A+f*S+m*v+C*D,J=i*O+a*R+h*M+x*L,j=o*O+c*R+p*M+b*L,K=r*O+u*R+_*M+T*L,Q=s*O+f*R+m*M+C*L,de=i*g+a*E+h*w+x*I,ye=o*g+c*E+p*w+b*I,ce=r*g+u*E+_*w+T*I,ge=s*g+f*E+m*w+C*I,xe=i*N+a*B+h*H+x*V,De=o*N+c*B+p*H+b*V,Ae=r*N+u*B+_*H+T*V,ke=s*N+f*B+m*H+C*V;return n[0]=G,n[1]=k,n[2]=W,n[3]=Y,n[4]=J,n[5]=j,n[6]=K,n[7]=Q,n[8]=de,n[9]=ye,n[10]=ce,n[11]=ge,n[12]=xe,n[13]=De,n[14]=Ae,n[15]=ke,n};Qe.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};Qe.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};Qe.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],h=e[10],p=e[12],_=e[13],m=e[14],x=t[0],b=t[1],T=t[2],C=t[4],A=t[5],S=t[6],v=t[8],D=t[9],O=t[10],R=t[12],M=t[13],L=t[14],g=i*x+s*b+u*T,E=o*x+a*b+f*T,w=r*x+c*b+h*T,I=i*C+s*A+u*S,N=o*C+a*A+f*S,B=r*C+c*A+h*S,H=i*v+s*D+u*O,V=o*v+a*D+f*O,G=r*v+c*D+h*O,k=i*R+s*M+u*L+p,W=o*R+a*M+f*L+_,Y=r*R+c*M+h*L+m;return n[0]=g,n[1]=E,n[2]=w,n[3]=0,n[4]=I,n[5]=N,n[6]=B,n[7]=0,n[8]=H,n[9]=V,n[10]=G,n[11]=0,n[12]=k,n[13]=W,n[14]=Y,n[15]=1,n};Qe.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],h=e[10],p=t[0],_=t[1],m=t[2],x=t[3],b=t[4],T=t[5],C=t[6],A=t[7],S=t[8],v=i*p+s*_+u*m,D=o*p+a*_+f*m,O=r*p+c*_+h*m,R=i*x+s*b+u*T,M=o*x+a*b+f*T,L=r*x+c*b+h*T,g=i*C+s*A+u*S,E=o*C+a*A+f*S,w=r*C+c*A+h*S;return n[0]=v,n[1]=D,n[2]=O,n[3]=0,n[4]=R,n[5]=M,n[6]=L,n[7]=0,n[8]=g,n[9]=E,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Qe.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};Qe.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?Qe.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};Qe.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Qe.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};Qe.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};Qe.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};Qe.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};Qe.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};Qe.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};Qe.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};Qe.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};Qe.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};Qe.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};Qe.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var JAe=new $,eEe=new $,tEe=new oe,nEe=new oe(0,0,0,1);Qe.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],u=e[13],f=e[2],h=e[6],p=e[10],_=e[14],m=e[3],x=e[7],b=e[11],T=e[15],C=p*T,A=_*b,S=h*T,v=_*x,D=h*b,O=p*x,R=f*T,M=_*m,L=f*b,g=p*m,E=f*x,w=h*m,I=C*a+v*c+D*u-(A*a+S*c+O*u),N=A*s+R*c+g*u-(C*s+M*c+L*u),B=S*s+M*a+E*u-(v*s+R*a+w*u),H=O*s+L*a+w*c-(D*s+g*a+E*c),V=A*i+S*o+O*r-(C*i+v*o+D*r),G=C*n+M*o+L*r-(A*n+R*o+g*r),k=v*n+R*i+w*r-(S*n+M*i+E*r),W=D*n+g*i+E*o-(O*n+L*i+w*o);C=o*u,A=r*c,S=i*u,v=r*a,D=i*c,O=o*a,R=n*u,M=r*s,L=n*c,g=o*s,E=n*a,w=i*s;let Y=C*x+v*b+D*T-(A*x+S*b+O*T),J=A*m+R*b+g*T-(C*m+M*b+L*T),j=S*m+M*x+E*T-(v*m+R*x+w*T),K=O*m+L*x+w*b-(D*m+g*x+E*b),Q=S*p+O*_+A*h-(D*_+C*h+v*p),de=L*_+C*f+M*p-(R*p+g*_+A*f),ye=R*h+w*_+v*f-(E*_+S*f+M*h),ce=E*p+D*f+g*h-(L*h+w*p+O*f),ge=n*I+i*N+o*B+r*H;if(Math.abs(ge)<P.EPSILON21){if($.equalsEpsilon(Qe.getMatrix3(e,JAe),eEe,P.EPSILON7)&&oe.equals(Qe.getRow(e,3,tEe),nEe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new re("matrix is not invertible because its determinate is zero.")}return ge=1/ge,t[0]=I*ge,t[1]=N*ge,t[2]=B*ge,t[3]=H*ge,t[4]=V*ge,t[5]=G*ge,t[6]=k*ge,t[7]=W*ge,t[8]=Y*ge,t[9]=J*ge,t[10]=j*ge,t[11]=K*ge,t[12]=Q*ge,t[13]=de*ge,t[14]=ye*ge,t[15]=ce*ge,t};Qe.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],u=e[9],f=e[10],h=e[12],p=e[13],_=e[14],m=-n*h-i*p-o*_,x=-r*h-s*p-a*_,b=-c*h-u*p-f*_;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=m,t[13]=x,t[14]=b,t[15]=1,t};var iEe=new Qe;Qe.inverseTranspose=function(e,t){return Qe.inverse(Qe.transpose(e,iEe),t)};Qe.IDENTITY=Object.freeze(new Qe(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));Qe.ZERO=Object.freeze(new Qe(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));Qe.COLUMN0ROW0=0;Qe.COLUMN0ROW1=1;Qe.COLUMN0ROW2=2;Qe.COLUMN0ROW3=3;Qe.COLUMN1ROW0=4;Qe.COLUMN1ROW1=5;Qe.COLUMN1ROW2=6;Qe.COLUMN1ROW3=7;Qe.COLUMN2ROW0=8;Qe.COLUMN2ROW1=9;Qe.COLUMN2ROW2=10;Qe.COLUMN2ROW3=11;Qe.COLUMN3ROW0=12;Qe.COLUMN3ROW1=13;Qe.COLUMN3ROW2=14;Qe.COLUMN3ROW3=15;Object.defineProperties(Qe.prototype,{length:{get:function(){return Qe.packedLength}}});Qe.prototype.clone=function(e){return Qe.clone(this,e)};Qe.prototype.equals=function(e){return Qe.equals(this,e)};Qe.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};Qe.prototype.equalsEpsilon=function(e,t){return Qe.equalsEpsilon(this,e,t)};Qe.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) +(${this[2]}, ${this[5]}, ${this[8]})`};var $=Je;function OS(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(OS.prototype=Object.create(Error.prototype),OS.prototype.constructor=OS);OS.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var re=OS;function Qe(e,t,n,i,o,r,s,a,c,u,f,h,p,_,m,x){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(u,0),this[7]=y(_,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(f,0),this[11]=y(m,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(h,0),this[15]=y(x,0)}Qe.packedLength=16;Qe.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};Qe.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Qe),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};Qe.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Qe.pack(e[o],t,o*16);return t};Qe.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=Qe.unpack(e,i,t[o])}return t};Qe.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new Qe(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};Qe.fromArray=Qe.unpack;Qe.fromColumnMajorArray=function(e,t){return Qe.clone(e,t)};Qe.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new Qe(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};Qe.fromRotationTranslation=function(e,t,n){return t=y(t,d.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new Qe(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};Qe.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new Qe);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,h=t.y*t.y,p=t.y*t.z,_=t.y*t.w,m=t.z*t.z,x=t.z*t.w,b=t.w*t.w,T=a-h-m+b,C=2*(c-x),A=2*(u+_),S=2*(c+x),v=-a+h-m+b,D=2*(p-f),O=2*(u-_),R=2*(p+f),M=-a-h+m+b;return i[0]=T*o,i[1]=S*o,i[2]=O*o,i[3]=0,i[4]=C*r,i[5]=v*r,i[6]=R*r,i[7]=0,i[8]=A*s,i[9]=D*s,i[10]=M*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};Qe.fromTranslationRotationScale=function(e,t){return Qe.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};Qe.fromTranslation=function(e,t){return Qe.fromRotationTranslation($.IDENTITY,e,t)};Qe.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Qe(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};Qe.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new Qe(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};Qe.fromRotation=function(e,t){return l(t)||(t=new Qe),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var $b=new d,Qb=new d,MS=new d;Qe.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;d.normalize(i,$b),d.normalize(d.cross($b,o,Qb),Qb),d.normalize(d.cross(Qb,$b,MS),MS);let r=Qb.x,s=Qb.y,a=Qb.z,c=$b.x,u=$b.y,f=$b.z,h=MS.x,p=MS.y,_=MS.z,m=n.x,x=n.y,b=n.z,T=r*-m+s*-x+a*-b,C=h*-m+p*-x+_*-b,A=c*m+u*x+f*b;return l(t)?(t[0]=r,t[1]=h,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=_,t[10]=-f,t[11]=0,t[12]=T,t[13]=C,t[14]=A,t[15]=1,t):new Qe(r,s,a,T,h,p,_,C,-c,-u,-f,A,0,0,0,1)};Qe.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};Qe.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),u=1/(r-o),f=-(t+e)*a,h=-(i+n)*c,p=-(r+o)*u;return a*=2,c*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=h,s[14]=p,s[15]=1,s};Qe.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),h=-(r+o)/(r-o),p=-1,_=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=h,s[11]=p,s[12]=0,s[13]=0,s[14]=_,s[15]=0,s};Qe.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,h=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=u,r[10]=f,r[11]=h,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};Qe.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new Qe),e=y(e,y.EMPTY_OBJECT);let o=y(e.x,0),r=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,u=a*.5,f=(n-t)*.5,h=c,p=u,_=f,m=o+c,x=r+u,b=t+f,T=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=_,i[11]=0,i[12]=m,i[13]=x,i[14]=b,i[15]=T,i};Qe.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-d.dot(i,e),o[13]=-d.dot(n,e),o[14]=d.dot(t,e),o[15]=1,o};Qe.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};Qe.getElementIndex=function(e,t){return e*4+t};Qe.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};Qe.setColumn=function(e,t,n,i){i=Qe.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};Qe.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};Qe.setRow=function(e,t,n,i){return i=Qe.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};Qe.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var $Ae=new d;Qe.setScale=function(e,t,n){let i=Qe.getScale(e,$Ae),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var QAe=new d;Qe.setUniformScale=function(e,t,n){let i=Qe.getScale(e,QAe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var UG=new d;Qe.getScale=function(e,t){return t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],UG)),t.y=d.magnitude(d.fromElements(e[4],e[5],e[6],UG)),t.z=d.magnitude(d.fromElements(e[8],e[9],e[10],UG)),t};var WZ=new d;Qe.getMaximumScale=function(e){return Qe.getScale(e,WZ),d.maximumComponent(WZ)};var JAe=new d;Qe.setRotation=function(e,t,n){let i=Qe.getScale(e,JAe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var eEe=new d;Qe.getRotation=function(e,t){let n=Qe.getScale(e,eEe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};Qe.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],u=e[6],f=e[7],h=e[8],p=e[9],_=e[10],m=e[11],x=e[12],b=e[13],T=e[14],C=e[15],A=t[0],S=t[1],v=t[2],D=t[3],O=t[4],R=t[5],M=t[6],L=t[7],g=t[8],E=t[9],w=t[10],I=t[11],N=t[12],B=t[13],H=t[14],V=t[15],G=i*A+a*S+h*v+x*D,k=o*A+c*S+p*v+b*D,W=r*A+u*S+_*v+T*D,Y=s*A+f*S+m*v+C*D,J=i*O+a*R+h*M+x*L,j=o*O+c*R+p*M+b*L,K=r*O+u*R+_*M+T*L,Q=s*O+f*R+m*M+C*L,de=i*g+a*E+h*w+x*I,xe=o*g+c*E+p*w+b*I,ce=r*g+u*E+_*w+T*I,_e=s*g+f*E+m*w+C*I,be=i*N+a*B+h*H+x*V,De=o*N+c*B+p*H+b*V,Ae=r*N+u*B+_*H+T*V,ke=s*N+f*B+m*H+C*V;return n[0]=G,n[1]=k,n[2]=W,n[3]=Y,n[4]=J,n[5]=j,n[6]=K,n[7]=Q,n[8]=de,n[9]=xe,n[10]=ce,n[11]=_e,n[12]=be,n[13]=De,n[14]=Ae,n[15]=ke,n};Qe.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};Qe.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};Qe.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],h=e[10],p=e[12],_=e[13],m=e[14],x=t[0],b=t[1],T=t[2],C=t[4],A=t[5],S=t[6],v=t[8],D=t[9],O=t[10],R=t[12],M=t[13],L=t[14],g=i*x+s*b+u*T,E=o*x+a*b+f*T,w=r*x+c*b+h*T,I=i*C+s*A+u*S,N=o*C+a*A+f*S,B=r*C+c*A+h*S,H=i*v+s*D+u*O,V=o*v+a*D+f*O,G=r*v+c*D+h*O,k=i*R+s*M+u*L+p,W=o*R+a*M+f*L+_,Y=r*R+c*M+h*L+m;return n[0]=g,n[1]=E,n[2]=w,n[3]=0,n[4]=I,n[5]=N,n[6]=B,n[7]=0,n[8]=H,n[9]=V,n[10]=G,n[11]=0,n[12]=k,n[13]=W,n[14]=Y,n[15]=1,n};Qe.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],u=e[8],f=e[9],h=e[10],p=t[0],_=t[1],m=t[2],x=t[3],b=t[4],T=t[5],C=t[6],A=t[7],S=t[8],v=i*p+s*_+u*m,D=o*p+a*_+f*m,O=r*p+c*_+h*m,R=i*x+s*b+u*T,M=o*x+a*b+f*T,L=r*x+c*b+h*T,g=i*C+s*A+u*S,E=o*C+a*A+f*S,w=r*C+c*A+h*S;return n[0]=v,n[1]=D,n[2]=O,n[3]=0,n[4]=R,n[5]=M,n[6]=L,n[7]=0,n[8]=g,n[9]=E,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Qe.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};Qe.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?Qe.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};Qe.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};Qe.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=u,n.w=f,n};Qe.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};Qe.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};Qe.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};Qe.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};Qe.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};Qe.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};Qe.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};Qe.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};Qe.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};Qe.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var tEe=new $,nEe=new $,iEe=new oe,oEe=new oe(0,0,0,1);Qe.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],u=e[13],f=e[2],h=e[6],p=e[10],_=e[14],m=e[3],x=e[7],b=e[11],T=e[15],C=p*T,A=_*b,S=h*T,v=_*x,D=h*b,O=p*x,R=f*T,M=_*m,L=f*b,g=p*m,E=f*x,w=h*m,I=C*a+v*c+D*u-(A*a+S*c+O*u),N=A*s+R*c+g*u-(C*s+M*c+L*u),B=S*s+M*a+E*u-(v*s+R*a+w*u),H=O*s+L*a+w*c-(D*s+g*a+E*c),V=A*i+S*o+O*r-(C*i+v*o+D*r),G=C*n+M*o+L*r-(A*n+R*o+g*r),k=v*n+R*i+w*r-(S*n+M*i+E*r),W=D*n+g*i+E*o-(O*n+L*i+w*o);C=o*u,A=r*c,S=i*u,v=r*a,D=i*c,O=o*a,R=n*u,M=r*s,L=n*c,g=o*s,E=n*a,w=i*s;let Y=C*x+v*b+D*T-(A*x+S*b+O*T),J=A*m+R*b+g*T-(C*m+M*b+L*T),j=S*m+M*x+E*T-(v*m+R*x+w*T),K=O*m+L*x+w*b-(D*m+g*x+E*b),Q=S*p+O*_+A*h-(D*_+C*h+v*p),de=L*_+C*f+M*p-(R*p+g*_+A*f),xe=R*h+w*_+v*f-(E*_+S*f+M*h),ce=E*p+D*f+g*h-(L*h+w*p+O*f),_e=n*I+i*N+o*B+r*H;if(Math.abs(_e)<P.EPSILON21){if($.equalsEpsilon(Qe.getMatrix3(e,tEe),nEe,P.EPSILON7)&&oe.equals(Qe.getRow(e,3,iEe),oEe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new re("matrix is not invertible because its determinate is zero.")}return _e=1/_e,t[0]=I*_e,t[1]=N*_e,t[2]=B*_e,t[3]=H*_e,t[4]=V*_e,t[5]=G*_e,t[6]=k*_e,t[7]=W*_e,t[8]=Y*_e,t[9]=J*_e,t[10]=j*_e,t[11]=K*_e,t[12]=Q*_e,t[13]=de*_e,t[14]=xe*_e,t[15]=ce*_e,t};Qe.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],u=e[9],f=e[10],h=e[12],p=e[13],_=e[14],m=-n*h-i*p-o*_,x=-r*h-s*p-a*_,b=-c*h-u*p-f*_;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=m,t[13]=x,t[14]=b,t[15]=1,t};var rEe=new Qe;Qe.inverseTranspose=function(e,t){return Qe.inverse(Qe.transpose(e,rEe),t)};Qe.IDENTITY=Object.freeze(new Qe(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));Qe.ZERO=Object.freeze(new Qe(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));Qe.COLUMN0ROW0=0;Qe.COLUMN0ROW1=1;Qe.COLUMN0ROW2=2;Qe.COLUMN0ROW3=3;Qe.COLUMN1ROW0=4;Qe.COLUMN1ROW1=5;Qe.COLUMN1ROW2=6;Qe.COLUMN1ROW3=7;Qe.COLUMN2ROW0=8;Qe.COLUMN2ROW1=9;Qe.COLUMN2ROW2=10;Qe.COLUMN2ROW3=11;Qe.COLUMN3ROW0=12;Qe.COLUMN3ROW1=13;Qe.COLUMN3ROW2=14;Qe.COLUMN3ROW3=15;Object.defineProperties(Qe.prototype,{length:{get:function(){return Qe.packedLength}}});Qe.prototype.clone=function(e){return Qe.clone(this,e)};Qe.prototype.equals=function(e){return Qe.equals(this,e)};Qe.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};Qe.prototype.equalsEpsilon=function(e,t){return Qe.equalsEpsilon(this,e,t)};Qe.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]}) (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]}) -(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var F=Qe;var oEe={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},te=Object.freeze(oEe);var rEe=new d;function Dt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Xs={};Xs[te.FLOAT]="float";Xs[te.FLOAT_VEC2]="vec2";Xs[te.FLOAT_VEC3]="vec3";Xs[te.FLOAT_VEC4]="vec4";Xs[te.INT]="int";Xs[te.INT_VEC2]="ivec2";Xs[te.INT_VEC3]="ivec3";Xs[te.INT_VEC4]="ivec4";Xs[te.BOOL]="bool";Xs[te.BOOL_VEC2]="bvec2";Xs[te.BOOL_VEC3]="bvec3";Xs[te.BOOL_VEC4]="bvec4";Xs[te.FLOAT_MAT2]="mat2";Xs[te.FLOAT_MAT3]="mat3";Xs[te.FLOAT_MAT4]="mat4";Xs[te.SAMPLER_2D]="sampler2D";Xs[te.SAMPLER_CUBE]="samplerCube";Dt.prototype.getDeclaration=function(e){let t=`uniform ${Xs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var sEe={czm_viewport:new Dt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Dt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Dt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Dt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Dt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Dt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Dt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Dt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,rEe)}}),czm_frameNumber:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Dt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Dt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Dt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Dt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Dt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Dt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Dt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Dt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Dt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Ig=sEe;function aEe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var zn=aEe;function cEe(){return!0}function lEe(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=cEe}var ue=lEe;var Ps={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};Ps.getSizeInBytes=function(e){switch(e){case Ps.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Ps.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Ps.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Ps.fromSizeInBytes=function(e){switch(e){case 2:return Ps.UNSIGNED_SHORT;case 4:return Ps.UNSIGNED_INT;case 1:return Ps.UNSIGNED_BYTE}};Ps.validate=function(e){return l(e)&&(e===Ps.UNSIGNED_BYTE||e===Ps.UNSIGNED_SHORT||e===Ps.UNSIGNED_INT)};Ps.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Ps.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Ps.fromTypedArray=function(e){if(e instanceof Uint8Array)return Ps.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Ps.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Ps.UNSIGNED_INT};var Ne=Object.freeze(Ps);var ZP={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,validate:function(e){return e===ZP.STREAM_DRAW||e===ZP.STATIC_DRAW||e===ZP.DYNAMIC_DRAW}},Fe=Object.freeze(ZP);function ju(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=zn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}ju.createVertexBuffer=function(e){return new ju({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};ju.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ne.getSizeInBytes(n),o=new ju({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(ju.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});ju.prototype._getBuffer=function(){return this._buffer};ju.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};ju.prototype.copyFromBuffer=function(e,t,n,i){let o=te.COPY_READ_BUFFER,r=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};ju.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=te.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};ju.prototype.isDestroyed=function(){return!1};ju.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var yt=ju;var Pg,Er={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},sl={};Object.defineProperties(sl,{element:{get:function(){if(sl.supportsFullscreen())return document[Er.fullscreenElement]}},changeEventName:{get:function(){if(sl.supportsFullscreen())return Er.fullscreenchange}},errorEventName:{get:function(){if(sl.supportsFullscreen())return Er.fullscreenerror}},enabled:{get:function(){if(sl.supportsFullscreen())return document[Er.fullscreenEnabled]}},fullscreen:{get:function(){if(sl.supportsFullscreen())return sl.element!==null}}});sl.supportsFullscreen=function(){if(l(Pg))return Pg;Pg=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Er.requestFullscreen="requestFullscreen",Er.exitFullscreen="exitFullscreen",Er.fullscreenEnabled="fullscreenEnabled",Er.fullscreenElement="fullscreenElement",Er.fullscreenchange="fullscreenchange",Er.fullscreenerror="fullscreenerror",Pg=!0,Pg;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(Er.requestFullscreen=n,Pg=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Er.requestFullscreen=n,Pg=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Er.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Er.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Er.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Er.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Er.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Er.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Er.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Er.fullscreenerror=n)}return Pg};sl.requestFullscreen=function(e,t){sl.supportsFullscreen()&&e[Er.requestFullscreen]({vrDisplay:t})};sl.exitFullscreen=function(){sl.supportsFullscreen()&&document[Er.exitFullscreen]()};sl._names=Er;var Sr=sl;var Va;typeof navigator<"u"?Va=navigator:Va={};function C0(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var $P,jZ;function WG(){if(!l($P)&&($P=!1,!i1())){let e=/ Chrome\/([\.0-9]+)/.exec(Va.userAgent);e!==null&&($P=!0,jZ=C0(e[1]))}return $P}function uEe(){return WG()&&jZ}var QP,qZ;function YZ(){if(!l(QP)&&(QP=!1,!WG()&&!i1()&&/ Safari\/[\.0-9]+/.test(Va.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Va.userAgent);e!==null&&(QP=!0,qZ=C0(e[1]))}return QP}function fEe(){return YZ()&&qZ}var JP,HG;function XZ(){if(!l(JP)){JP=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Va.userAgent);e!==null&&(JP=!0,HG=C0(e[1]),HG.isNightly=!!e[2])}return JP}function dEe(){return XZ()&&HG}var RS,GG;function KZ(){if(!l(RS)){RS=!1;let e;Va.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Va.userAgent),e!==null&&(RS=!0,GG=C0(e[1]))):Va.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Va.userAgent),e!==null&&(RS=!0,GG=C0(e[1])))}return RS}function hEe(){return KZ()&&GG}var e1,ZZ;function i1(){if(!l(e1)){e1=!1;let e=/ Edg\/([\.0-9]+)/.exec(Va.userAgent);e!==null&&(e1=!0,ZZ=C0(e[1]))}return e1}function mEe(){return i1()&&ZZ}var t1,jG;function o1(){if(!l(t1)){t1=!1;let e=/Firefox\/([\.0-9]+)/.exec(Va.userAgent);e!==null&&(t1=!0,jG=C0(e[1]))}return t1}var VG;function pEe(){return l(VG)||(VG=/Windows/i.test(Va.appVersion)),VG}var UG;function gEe(){return l(UG)||(UG=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),UG}function _Ee(){return o1()&&jG}var zG;function yEe(){return l(zG)||(zG=!o1()&&typeof PointerEvent<"u"&&(!l(Va.pointerEnabled)||Va.pointerEnabled)),zG}var $Z,n1;function QZ(){if(!l(n1)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;n1=l(t)&&t!=="",n1&&($Z=t)}return n1}function xEe(){return QZ()?$Z:void 0}function xc(){return xc._result}xc._promise=void 0;xc._result=void 0;xc.initialize=function(){return l(xc._promise)||(xc._promise=new Promise(e=>{let t=new Image;t.onload=function(){xc._result=t.width>0&&t.height>0,e(xc._result)},t.onerror=function(){xc._result=!1,e(xc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),xc._promise};Object.defineProperties(xc,{initialized:{get:function(){return l(xc._result)}}});var Jb=[];typeof ArrayBuffer<"u"&&(Jb.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&Jb.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&Jb.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&Jb.push(BigInt64Array),typeof BigUint64Array<"u"&&Jb.push(BigUint64Array));var qu={isChrome:WG,chromeVersion:uEe,isSafari:YZ,safariVersion:fEe,isWebkit:XZ,webkitVersion:dEe,isInternetExplorer:KZ,internetExplorerVersion:hEe,isEdge:i1,edgeVersion:mEe,isFirefox:o1,firefoxVersion:_Ee,isWindows:pEe,isIPadOrIOS:gEe,hardwareConcurrency:y(Va.hardwareConcurrency,3),supportsPointerEvents:yEe,supportsImageRenderingPixelated:QZ,supportsWebP:xc,imageRenderingValue:xEe,typedArrayTypes:Jb};qu.supportsBasis=function(e){return qu.supportsWebAssembly()&&e.context.supportsBasis};qu.supportsFullscreen=function(){return Sr.supportsFullscreen()};qu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};qu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};qu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};qu.supportsBigInt=function(){return typeof BigInt<"u"};qu.supportsWebWorkers=function(){return typeof Worker<"u"};qu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};qu.supportsWebgl2=function(e){return e.context.webgl2};qu.supportsEsmWebWorkers=function(){return!o1()||parseInt(jG)>=114};var Ht=qu;function qG(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,o){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var YG,XG,$m;Ht.supportsTypedArrays()&&(YG=new ArrayBuffer(4),XG=new Uint32Array(YG),$m=new Uint8Array(YG));ie.fromRgba=function(e,t){return XG[0]=e,ie.fromBytes($m[0],$m[1],$m[2],$m[3],t)};ie.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=qG(u,c,e+1/3),s=qG(u,c,e),a=qG(u,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new ie(r,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+P.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+P.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+P.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new ie(n,i,o,r)};var bEe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,TEe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,CEe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,AEe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){l(t)||(t=new ie),e=e.trim();let n=ie[e.toUpperCase()];if(l(n))return ie.clone(n,t),t;let i=bEe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=TEe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=CEe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=AEe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),o=ie.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};ie.prototype.toRgba=function(){return $m[0]=ie.floatToByte(this.red),$m[1]=ie.floatToByte(this.green),$m[2]=ie.floatToByte(this.blue),$m[3]=ie.floatToByte(this.alpha),XG[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var z=ie;function r1(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}r1.ALL=Object.freeze(new r1({color:new z(0,0,0,0),depth:1,stencil:0}));r1.prototype.execute=function(e,t){e.clear(this,t)};var ei=r1;var EEe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},we=Object.freeze(EEe);function JZ(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=we.COMPUTE,this.owner=e.owner}JZ.prototype.execute=function(e){e.execute(this)};var al=JZ;function Ft(e,t){this.x=y(e,0),this.y=y(t,0)}Ft.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Ft(e,t)};Ft.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Ft(e.x,e.y)};Ft.fromCartesian3=Ft.clone;Ft.fromCartesian4=Ft.clone;Ft.packedLength=2;Ft.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Ft.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ft),n.x=e[t++],n.y=e[t],n};Ft.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Ft.pack(e[o],t,o*2);return t};Ft.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Ft.unpack(e,i,t[o])}return t};Ft.fromArray=Ft.unpack;Ft.maximumComponent=function(e){return Math.max(e.x,e.y)};Ft.minimumComponent=function(e){return Math.min(e.x,e.y)};Ft.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Ft.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Ft.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Ft.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Ft.magnitude=function(e){return Math.sqrt(Ft.magnitudeSquared(e))};var s1=new Ft;Ft.distance=function(e,t){return Ft.subtract(e,t,s1),Ft.magnitude(s1)};Ft.distanceSquared=function(e,t){return Ft.subtract(e,t,s1),Ft.magnitudeSquared(s1)};Ft.normalize=function(e,t){let n=Ft.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Ft.dot=function(e,t){return e.x*t.x+e.y*t.y};Ft.cross=function(e,t){return e.x*t.y-e.y*t.x};Ft.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Ft.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Ft.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Ft.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Ft.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Ft.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Ft.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Ft.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var e$=new Ft;Ft.lerp=function(e,t,n,i){return Ft.multiplyByScalar(t,n,e$),i=Ft.multiplyByScalar(e,1-n,i),Ft.add(e$,i,i)};var t$=new Ft,n$=new Ft;Ft.angleBetween=function(e,t){return Ft.normalize(e,t$),Ft.normalize(t,n$),P.acosClamped(Ft.dot(t$,n$))};var SEe=new Ft;Ft.mostOrthogonalAxis=function(e,t){let n=Ft.normalize(e,SEe);return Ft.abs(n,n),n.x<=n.y?t=Ft.clone(Ft.UNIT_X,t):t=Ft.clone(Ft.UNIT_Y,t),t};Ft.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Ft.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Ft.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)};Ft.ZERO=Object.freeze(new Ft(0,0));Ft.ONE=Object.freeze(new Ft(1,1));Ft.UNIT_X=Object.freeze(new Ft(1,0));Ft.UNIT_Y=Object.freeze(new Ft(0,1));Ft.prototype.clone=function(e){return Ft.clone(this,e)};Ft.prototype.equals=function(e){return Ft.equals(this,e)};Ft.prototype.equalsEpsilon=function(e,t,n){return Ft.equalsEpsilon(this,e,t,n)};Ft.prototype.toString=function(){return`(${this.x}, ${this.y})`};var U=Ft;var vEe=new d,wEe=new d;function DEe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,h=r*r*c*c,p=s*s*u*u,_=a*a*f*f,m=h+p+_,x=Math.sqrt(1/m),b=d.multiplyByScalar(e,x,vEe);if(m<i)return isFinite(x)?d.clone(b,o):void 0;let T=n.x,C=n.y,A=n.z,S=wEe;S.x=b.x*T*2,S.y=b.y*C*2,S.z=b.z*A*2;let v=(1-x)*d.magnitude(e)/(.5*d.magnitude(S)),D=0,O,R,M,L,g,E,w,I,N,B,H;do{v-=D,M=1/(1+v*T),L=1/(1+v*C),g=1/(1+v*A),E=M*M,w=L*L,I=g*g,N=E*M,B=w*L,H=I*g,O=h*E+p*w+_*I-1,R=h*N*T+p*B*C+_*H*A;let V=-2*R;D=O/V}while(Math.abs(O)>P.EPSILON12);return l(o)?(o.x=r*M,o.y=s*L,o.z=a*g,o):new d(r*M,s*L,a*g)}var eT=DEe;function Ro(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Ro.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Ro(e,t,n)};Ro.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),Ro.fromRadians(e,t,n,i)};var IEe=new d,PEe=new d,REe=new d;Ro._ellipsoidOneOverRadii=new d(1/6378137,1/6378137,1/6356752314245179e-9);Ro._ellipsoidOneOverRadiiSquared=new d(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Ro._ellipsoidCenterToleranceSquared=P.EPSILON1;Ro.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:Ro._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:Ro._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:Ro._ellipsoidCenterToleranceSquared,s=eT(e,i,o,r,PEe);if(!l(s))return;let a=d.multiplyComponents(s,o,IEe);a=d.normalize(a,a);let c=d.subtract(e,s,REe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),h=P.sign(d.dot(c,e))*d.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=h,n):new Ro(u,f,h)};Ro.toCartesian=function(e,t,n){return d.fromRadians(e.longitude,e.latitude,e.height,t,n)};Ro.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Ro(e.longitude,e.latitude,e.height)};Ro.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Ro.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Ro.ZERO=Object.freeze(new Ro(0,0,0));Ro.prototype.clone=function(e){return Ro.clone(this,e)};Ro.prototype.equals=function(e){return Ro.equals(this,e)};Ro.prototype.equalsEpsilon=function(e,t){return Ro.equalsEpsilon(this,e,t)};Ro.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var fe=Ro;function o$(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new d(t,n,i),e._radiiSquared=new d(t*t,n*n,i*i),e._radiiToTheFourth=new d(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new d(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new d(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function fi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,o$(this,e,t,n)}Object.defineProperties(fi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});fi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(d.clone(n,t._radii),d.clone(e._radiiSquared,t._radiiSquared),d.clone(e._radiiToTheFourth,t._radiiToTheFourth),d.clone(e._oneOverRadii,t._oneOverRadii),d.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new fi(n.x,n.y,n.z)};fi.fromCartesian3=function(e,t){return l(t)||(t=new fi),l(e)&&o$(t,e.x,e.y,e.z),t};fi.WGS84=Object.freeze(new fi(6378137,6378137,6356752314245179e-9));fi.UNIT_SPHERE=Object.freeze(new fi(1,1,1));fi.MOON=Object.freeze(new fi(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));fi._default=fi.WGS84;Object.defineProperties(fi,{default:{get:function(){return fi._default},set:function(e){fi._default=e,d._ellipsoidRadiiSquared=e.radiiSquared,fe._ellipsoidOneOverRadii=e.oneOverRadii,fe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,fe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});fi.prototype.clone=function(e){return fi.clone(this,e)};fi.packedLength=d.packedLength;fi.pack=function(e,t,n){return n=y(n,0),d.pack(e._radii,t,n),t};fi.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t);return fi.fromCartesian3(i,n)};fi.prototype.geocentricSurfaceNormal=d.normalize;fi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new d),t.x=r,t.y=s,t.z=a,d.normalize(t,t)};fi.prototype.geodeticSurfaceNormal=function(e,t){if(!d.equalsEpsilon(e,d.ZERO,P.EPSILON14))return l(t)||(t=new d),t=d.multiplyComponents(e,this._oneOverRadiiSquared,t),d.normalize(t,t)};var OEe=new d,MEe=new d;fi.prototype.cartographicToCartesian=function(e,t){let n=OEe,i=MEe;this.geodeticSurfaceNormalCartographic(e,n),d.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(d.dot(n,i));return d.divideByScalar(i,o,i),d.multiplyByScalar(n,e.height,n),l(t)||(t=new d),d.add(i,n,t)};fi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var LEe=new d,NEe=new d,FEe=new d;fi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,NEe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,LEe),o=d.subtract(e,n,FEe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=P.sign(d.dot(o,e))*d.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new fe(r,s,a)};fi.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};fi.prototype.scaleToGeodeticSurface=function(e,t){return eT(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};fi.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new d);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return d.multiplyByScalar(e,s,t)};fi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new d),d.multiplyComponents(e,this._oneOverRadii,t)};fi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new d),d.multiplyComponents(e,this._radii,t)};fi.prototype.equals=function(e){return this===e||l(e)&&d.equals(this._radii,e._radii)};fi.prototype.toString=function(){return this._radii.toString()};fi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new d),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var BEe=new d;fi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new U);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,BEe),i=d.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return U.fromElements(1/i,1/r,t)};var kEe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],VEe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function i$(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*kEe[s];r+=VEe[s]*(n(i+a)+n(i-a))}return r*=o,r}fi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=P.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,u=s*a;return i$(i,o,function(f){let h=Math.cos(f),p=Math.sin(f);return Math.cos(f)*i$(t,n,function(_){let m=Math.cos(_),x=Math.sin(_);return Math.sqrt(u*p*p+c*(a*m*m+s*x*x)*h*h)})})};var ee=fi;function a1(e){this._ellipsoid=y(e,ee.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(a1.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});a1.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};a1.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var Ii=a1;var UEe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},jt=Object.freeze(UEe);function zEe(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Oo=zEe;function HEe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var A0=HEe;function GEe(e){return e%4===0&&e%100!==0||e%400===0}var xh=GEe;var r$=[31,28,31,30,31,30,31,31,30,31,30,31];function WEe(e,t,n,i,o,r,s,a){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,0),o=y(o,0),r=y(r,0),s=y(s,0),a=y(a,!1),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function x(){xo.typeOf.number.greaterThanOrEquals("Year",e,1),xo.typeOf.number.lessThanOrEquals("Year",e,9999),xo.typeOf.number.greaterThanOrEquals("Month",t,1),xo.typeOf.number.lessThanOrEquals("Month",t,12),xo.typeOf.number.greaterThanOrEquals("Day",n,1),xo.typeOf.number.lessThanOrEquals("Day",n,31),xo.typeOf.number.greaterThanOrEquals("Hour",i,0),xo.typeOf.number.lessThanOrEquals("Hour",i,23),xo.typeOf.number.greaterThanOrEquals("Minute",o,0),xo.typeOf.number.lessThanOrEquals("Minute",o,59),xo.typeOf.bool("IsLeapSecond",a),xo.typeOf.number.greaterThanOrEquals("Second",r,0),xo.typeOf.number.lessThanOrEquals("Second",r,a?60:59),xo.typeOf.number.greaterThanOrEquals("Millisecond",s,0),xo.typeOf.number.lessThan("Millisecond",s,1e3)}function b(){let T=t===2&&xh(e)?r$[t-1]+1:r$[t-1];if(n>T)throw new he("Month and Day represents invalid date")}}var Rg=WEe;function jEe(e,t){this.julianDate=e,this.offset=t}var qi=jEe;var qEe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},jn=Object.freeze(qEe);var YEe={UTC:0,TAI:1},Wn=Object.freeze(YEe);var a$=new Rg,KG=[31,28,31,30,31,30,31,31,30,31,30,31],ZG=29;function $G(e,t){return Rt.compare(e.julianDate,t.julianDate)}var tT=new qi;function l1(e){tT.julianDate=e;let t=Rt.leapSeconds,n=Oo(t,tT,$G);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Rt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Rt.addSeconds(e,i,e)}function s$(e,t){tT.julianDate=e;let n=Rt.leapSeconds,i=Oo(n,tT,$G);if(i<0&&(i=~i),i===0)return Rt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Rt.addSeconds(e,-n[i-1].offset,t);let o=Rt.secondsDifference(n[i].julianDate,e);if(o===0)return Rt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Rt.addSeconds(e,-n[--i].offset,t)}function Og(e,t,n){let i=t/jn.SECONDS_PER_DAY|0;return e+=i,t-=jn.SECONDS_PER_DAY*i,t<0&&(e--,t+=jn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function QG(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*jn.SECONDS_PER_HOUR+o*jn.SECONDS_PER_MINUTE+s*jn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var XEe=/^(\d{4})$/,KEe=/^(\d{4})-(\d{2})$/,ZEe=/^(\d{4})-?(\d{3})$/,$Ee=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,QEe=/^(\d{4})-?(\d{2})-?(\d{2})$/,JG=/([Z+\-])?(\d{2})?:?(\d{2})?$/,JEe=/^(\d{2})(\.\d+)?/.source+JG.source,eSe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+JG.source,tSe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+JG.source;function Rt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Wn.UTC);let i=e|0;t=t+(e-i)*jn.SECONDS_PER_DAY,Og(i,t,this),n===Wn.UTC&&l1(this)}Rt.fromGregorianDate=function(e,t){let n=QG(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(Og(n[0],n[1],t),l1(t),t):new Rt(n[0],n[1],Wn.UTC)};Rt.fromDate=function(e,t){let n=QG(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(Og(n[0],n[1],t),l1(t),t):new Rt(n[0],n[1],Wn.UTC)};Rt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,f=n[0],h=n[1],p,_;if(n=f.match(QEe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(KEe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(XEe),n!==null)i=+n[1];else{let T;if(n=f.match(ZEe),n!==null)i=+n[1],T=+n[2],_=xh(i);else if(n=f.match($Ee),n!==null){i=+n[1];let C=+n[2],A=+n[3]||0,S=new Date(Date.UTC(i,0,4));T=C*7+A-S.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(T),o=p.getUTCMonth()+1,r=p.getUTCDate()}_=xh(i);let m;if(l(h)){n=h.match(tSe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,m=5):(n=h.match(eSe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,m=4):(n=h.match(JEe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,m=3)));let T=n[m],C=+n[m+1],A=+(n[m+2]||0);switch(T){case"+":s=s-C,a=a-A;break;case"-":s=s+C,a=a+A;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=_&&o===2?ZG:KG[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=_&&o===2?ZG:KG[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=_&&o===2?ZG:KG[o-1],r+=p;let b=QG(i,o,r,s,a,c,u);return l(t)?(Og(b[0],b[1],t),l1(t)):t=new Rt(b[0],b[1],Wn.UTC),x&&Rt.addSeconds(t,1,t),t};Rt.now=function(e){return Rt.fromDate(new Date,e)};var c1=new Rt(0,0,Wn.TAI);Rt.toGregorianDate=function(e,t){let n=!1,i=s$(e,c1);l(i)||(Rt.addSeconds(e,-1,c1),i=s$(c1,c1),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let h=u+2-12*s|0,p=100*(a-49)+c+s|0,_=r/jn.SECONDS_PER_HOUR|0,m=r-_*jn.SECONDS_PER_HOUR,x=m/jn.SECONDS_PER_MINUTE|0;m=m-x*jn.SECONDS_PER_MINUTE;let b=m|0,T=(m-b)/jn.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(b+=1),l(t)?(t.year=p,t.month=h,t.day=f,t.hour=_,t.minute=x,t.second=b,t.millisecond=T,t.isLeapSecond=n,t):new Rg(p,h,f,_,x,b,T,n)};Rt.toDate=function(e){let t=Rt.toGregorianDate(e,a$),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Rt.toIso8601=function(e,t){let n=Rt.toGregorianDate(e,a$),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;return!l(t)&&u!==0?(f=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};Rt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Rt(e.dayNumber,e.secondsOfDay,Wn.TAI)};Rt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Rt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Rt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(Rt.secondsDifference(e,t))<=n};Rt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/jn.SECONDS_PER_DAY};Rt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*jn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Rt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/jn.SECONDS_PER_DAY;return n+i};Rt.computeTaiMinusUtc=function(e){tT.julianDate=e;let t=Rt.leapSeconds,n=Oo(t,tT,$G);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Rt.addSeconds=function(e,t,n){return Og(e.dayNumber,e.secondsOfDay+t,n)};Rt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*jn.SECONDS_PER_MINUTE;return Og(e.dayNumber,i,n)};Rt.addHours=function(e,t,n){let i=e.secondsOfDay+t*jn.SECONDS_PER_HOUR;return Og(e.dayNumber,i,n)};Rt.addDays=function(e,t,n){let i=e.dayNumber+t;return Og(i,e.secondsOfDay,n)};Rt.lessThan=function(e,t){return Rt.compare(e,t)<0};Rt.lessThanOrEquals=function(e,t){return Rt.compare(e,t)<=0};Rt.greaterThan=function(e,t){return Rt.compare(e,t)>0};Rt.greaterThanOrEquals=function(e,t){return Rt.compare(e,t)>=0};Rt.prototype.clone=function(e){return Rt.clone(this,e)};Rt.prototype.equals=function(e){return Rt.equals(this,e)};Rt.prototype.equalsEpsilon=function(e,t){return Rt.equalsEpsilon(this,e,t)};Rt.prototype.toString=function(){return Rt.toIso8601(this)};Rt.leapSeconds=[new qi(new Rt(2441317,43210,Wn.TAI),10),new qi(new Rt(2441499,43211,Wn.TAI),11),new qi(new Rt(2441683,43212,Wn.TAI),12),new qi(new Rt(2442048,43213,Wn.TAI),13),new qi(new Rt(2442413,43214,Wn.TAI),14),new qi(new Rt(2442778,43215,Wn.TAI),15),new qi(new Rt(2443144,43216,Wn.TAI),16),new qi(new Rt(2443509,43217,Wn.TAI),17),new qi(new Rt(2443874,43218,Wn.TAI),18),new qi(new Rt(2444239,43219,Wn.TAI),19),new qi(new Rt(2444786,43220,Wn.TAI),20),new qi(new Rt(2445151,43221,Wn.TAI),21),new qi(new Rt(2445516,43222,Wn.TAI),22),new qi(new Rt(2446247,43223,Wn.TAI),23),new qi(new Rt(2447161,43224,Wn.TAI),24),new qi(new Rt(2447892,43225,Wn.TAI),25),new qi(new Rt(2448257,43226,Wn.TAI),26),new qi(new Rt(2448804,43227,Wn.TAI),27),new qi(new Rt(2449169,43228,Wn.TAI),28),new qi(new Rt(2449534,43229,Wn.TAI),29),new qi(new Rt(2450083,43230,Wn.TAI),30),new qi(new Rt(2450630,43231,Wn.TAI),31),new qi(new Rt(2451179,43232,Wn.TAI),32),new qi(new Rt(2453736,43233,Wn.TAI),33),new qi(new Rt(2454832,43234,Wn.TAI),34),new qi(new Rt(2456109,43235,Wn.TAI),35),new qi(new Rt(2457204,43236,Wn.TAI),36),new qi(new Rt(2457754,43237,Wn.TAI),37)];var Z=Rt;var v$=Ur(Hl(),1);function nSe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var h1=nSe;function m$(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=m$(o,t)),n[i]=o}return n}var Ge=m$;function p$(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=p$(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var bt=p$;function iSe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Gl=iSe;var g$=Ur(Hl(),1);function e5(e,t){let n;return typeof document<"u"&&(n=document),e5._implementation(e,t,n)}e5._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new g$.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Qm=e5;var _$=Ur(Hl(),1);function oSe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new _$.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var m1=oSe;var y$=Ur(Hl(),1);function rSe(e){let t=new y$.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var oT=rSe;var x$={};function sSe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=x$[t];l(i)||(i={},x$[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var bh=sSe;var aSe=/^blob:/i;function cSe(e){return aSe.test(e)}var rT=cSe;var Th;function lSe(e){l(Th)||(Th=document.createElement("a")),Th.href=window.location.href;let t=Th.host,n=Th.protocol;return Th.href=e,Th.href=Th.href,n!==Th.protocol||t!==Th.host}var E0=lSe;var uSe=/^data:/i;function fSe(e){return uSe.test(e)}var Mg=fSe;function dSe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var sT=dSe;function hSe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var aT=hSe;function mSe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Yu=mSe;var pSe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},Kn=Object.freeze(pSe);var gSe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ps=Object.freeze(gSe);function p1(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,ps.OTHER),this.serverKey=e.serverKey,this.state=Kn.UNISSUED,this.deferred=void 0,this.cancelled=!1}p1.prototype.cancel=function(){this.cancelled=!0};p1.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=Kn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new p1(this)};var nr=p1;function _Se(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var g1=_Se;function b$(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=g1(this.responseHeaders))}b$.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Jm=b$;var y1=Ur(Hl(),1);function OS(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(OS.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});OS.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};OS.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function ySe(e,t){return t-e}OS.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];l(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(ySe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var me=OS;function S0(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(S0.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function t5(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}S0.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};S0.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(t5(i,o,e),e=o):r=!1}};S0.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};S0.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)t5(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};S0.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return t5(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var _1=S0;function xSe(e,t){return e.priority-t.priority}var Zi={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},cT=20,Ua=new _1({comparator:xSe});Ua.maximumLength=cT;Ua.reserve(cT);var Ch=[],ep={},bSe=typeof document<"u"?new y1.default(document.location.href):new y1.default,x1=new me;function Go(){}Go.maximumRequests=50;Go.maximumRequestsPerServer=18;Go.requestsByServer={};Go.throttleRequests=!0;Go.debugShowStatistics=!1;Go.requestCompletedEvent=x1;Object.defineProperties(Go,{statistics:{get:function(){return Zi}},priorityHeapLength:{get:function(){return cT},set:function(e){if(e<cT)for(;Ua.length>e;){let t=Ua.pop();v0(t)}cT=e,Ua.maximumLength=e,Ua.reserve(e)}}});function T$(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Go.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(Go.requestsByServer[e],Go.maximumRequestsPerServer);return ep[e]+t<=n};Go.heapHasOpenSlots=function(e){return Ua.length+e<=cT};function C$(e){return e.state===Kn.UNISSUED&&(e.state=Kn.ISSUED,e.deferred=Gl()),e.deferred.promise}function TSe(e){return function(t){if(e.state===Kn.CANCELLED)return;let n=e.deferred;--Zi.numberOfActiveRequests,--ep[e.serverKey],x1.raiseEvent(),e.state=Kn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function CSe(e){return function(t){e.state!==Kn.CANCELLED&&(++Zi.numberOfFailedRequests,--Zi.numberOfActiveRequests,--ep[e.serverKey],x1.raiseEvent(t),e.state=Kn.FAILED,e.deferred.reject(t))}}function A$(e){let t=C$(e);return e.state=Kn.ACTIVE,Ch.push(e),++Zi.numberOfActiveRequests,++Zi.numberOfActiveRequestsEver,++ep[e.serverKey],e.requestFunction().then(TSe(e)).catch(CSe(e)),t}function v0(e){let t=e.state===Kn.ACTIVE;if(e.state=Kn.CANCELLED,++Zi.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Zi.numberOfActiveRequests,--ep[e.serverKey],++Zi.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Go.update=function(){let e,t,n=0,i=Ch.length;for(e=0;e<i;++e){if(t=Ch[e],t.cancelled&&v0(t),t.state!==Kn.ACTIVE){++n;continue}n>0&&(Ch[e-n]=t)}Ch.length-=n;let o=Ua.internalArray,r=Ua.length;for(e=0;e<r;++e)T$(o[e]);Ua.resort();let s=Math.max(Go.maximumRequests-Ch.length,0),a=0;for(;a<s&&Ua.length>0;){if(t=Ua.pop(),t.cancelled){v0(t);continue}if(t.throttleByServer&&!Go.serverHasOpenSlots(t.serverKey)){v0(t);continue}A$(t),++a}ASe()};Go.getServerKey=function(e){let t=new y1.default(e);t.scheme()===""&&(t=t.absoluteTo(bSe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=ep[n];return l(i)||(ep[n]=0),n};Go.request=function(e){if(Mg(e.url)||rT(e.url))return x1.raiseEvent(),e.state=Kn.RECEIVED,e.requestFunction();if(++Zi.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Go.getServerKey(e.url)),Go.throttleRequests&&e.throttleByServer&&!Go.serverHasOpenSlots(e.serverKey))return;if(!Go.throttleRequests||!e.throttle)return A$(e);if(Ch.length>=Go.maximumRequests)return;T$(e);let t=Ua.insert(e);if(l(t)){if(t===e)return;v0(t)}return C$(e)};function ASe(){Go.debugShowStatistics&&(Zi.numberOfActiveRequests===0&&Zi.lastNumberOfActiveRequests>0&&(Zi.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Zi.numberOfAttemptedRequests}`),Zi.numberOfAttemptedRequests=0),Zi.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Zi.numberOfCancelledRequests}`),Zi.numberOfCancelledRequests=0),Zi.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Zi.numberOfCancelledActiveRequests}`),Zi.numberOfCancelledActiveRequests=0),Zi.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Zi.numberOfFailedRequests}`),Zi.numberOfFailedRequests=0)),Zi.lastNumberOfActiveRequests=Zi.numberOfActiveRequests)}Go.clearForSpecs=function(){for(;Ua.length>0;){let t=Ua.pop();v0(t)}let e=Ch.length;for(let t=0;t<e;++t)v0(Ch[t]);Ch.length=0,ep={},Zi.numberOfAttemptedRequests=0,Zi.numberOfActiveRequests=0,Zi.numberOfCancelledRequests=0,Zi.numberOfCancelledActiveRequests=0,Zi.numberOfFailedRequests=0,Zi.numberOfActiveRequestsEver=0,Zi.lastNumberOfActiveRequests=0};Go.numberOfActiveRequestsByServer=function(e){return ep[e]};Go.requestHeap=Ua;var bc=Go;var E$=Ur(Hl(),1);var MS={},lT={};MS.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(lT[n])||(lT[n]=!0)};MS.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(lT[n])&&delete lT[n]};function ESe(e){let t=new E$.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}MS.contains=function(e){let t=ESe(e);return!!(l(t)&&l(lT[t]))};MS.clear=function(){lT={}};var LS=MS;var w$=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function It(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Ah(e.templateValues,{}),this._queryParameters=Ah(e.queryParameters,{}),this.headers=Ah(e.headers,{}),this.request=y(e.request,new nr),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Ah(e,t){return l(e)?Ge(e):t}It.createIfNeeded=function(e){return e instanceof It?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new It({url:e})};var uT;It.supportsImageBitmapOptions=function(){return l(uT)?uT:typeof createImageBitmap!="function"?(uT=Promise.resolve(!1),uT):(uT=It.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=bh(t[0]),i=bh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),uT)};Object.defineProperties(It,{isBlobSupported:{get:function(){return w$}}});Object.defineProperties(It.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return oT(this._url)}},isDataUri:{get:function(){return Mg(this._url)}},isBlobUri:{get:function(){return rT(this._url)}},isCrossOriginUrl:{get:function(){return E0(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});It.prototype.toString=function(){return this.getUrlComponent(!0,!0)};It.prototype.parseUrl=function(e,t,n,i){let o=new v$.default(e),r=SSe(o.query());this._queryParameters=t?T1(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Qm(i))),this._url=o.toString()};function SSe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Yu(e)}function T1(e,t,n){if(!n)return bt(e,t);let i=Ge(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}It.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${vSe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function vSe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${aT(e)}`}It.prototype.setQueryParameters=function(e,t){t?this._queryParameters=T1(this._queryParameters,e,!1):this._queryParameters=T1(e,this._queryParameters,!1)};It.prototype.appendQueryParameters=function(e){this._queryParameters=T1(e,this._queryParameters,!0)};It.prototype.setTemplateValues=function(e,t){t?this._templateValues=bt(this._templateValues,e):this._templateValues=bt(e,this._templateValues)};It.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=bt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=bt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=bt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};It.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};It.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ge(this._queryParameters),e._templateValues=Ge(this._templateValues),e.headers=Ge(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new It({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};It.prototype.getBaseUri=function(e){return m1(this.getUrlComponent(e),e)};It.prototype.appendForwardSlash=function(){this._url=h1(this._url)};It.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};It.fetchArrayBuffer=function(e){return new It(e).fetchArrayBuffer()};It.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};It.fetchBlob=function(e){return new It(e).fetchBlob()};It.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(i5(this.request),!w$||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return n5({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,u;return It.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!l(f))return;if(u=f,a)return It.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(f);return c=new It({url:h}),n5({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function n5(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Gl();return It._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=bc.request(r);if(l(s))return s.catch(function(a){return r.state!==Kn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=Kn.UNISSUED,r.deferred=void 0,n5({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}It.fetchImage=function(e){return new It(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};It.prototype.fetchText=function(){return this.fetch({responseType:"text"})};It.fetchText=function(e){return new It(e).fetchText()};It.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};It.fetchJson=function(e){return new It(e).fetchJson()};It.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};It.fetchXML=function(e){return new It(e).fetchXML()};It.prototype.fetchJsonp=function(e){e=y(e,"callback"),i5(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return D$(this,e,t)};function D$(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=Gl();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},It._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=bc.request(o);if(l(s))return s.catch(function(a){return o.state!==Kn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=Kn.UNISSUED,o.deferred=void 0,D$(e,t,n)):Promise.reject(a)})})}It.fetchJsonp=function(e){return new It(e).fetchJsonp(e.callbackParameterName)};It.prototype._makeRequest=function(e){let t=this;i5(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=bt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=Gl(),h=It._Implementations.loadWithXhr(i,r,c,u,s,f,a);return l(h)&&l(h.abort)&&(n.cancelFunction=function(){h.abort()}),f.promise};let o=bc.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Kn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Kn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function i5(e){if(e.state===Kn.ISSUED||e.state===Kn.ACTIVE)throw new re("The Resource is already being fetched.");e.state=Kn.UNISSUED,e.deferred=void 0}var wSe=/^data:(.*?)(;base64)?,(.*)$/;function b1(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function S$(e,t){let n=b1(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function DSe(e,t){t=y(t,"");let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return b1(i,o);case"arraybuffer":return S$(i,o);case"blob":return r=S$(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(b1(i,o),n);case"json":return JSON.parse(b1(i,o));default:}}It.prototype.fetch=function(e){return e=Ah(e,{}),e.method="GET",this._makeRequest(e)};It.fetch=function(e){return new It(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It.prototype.delete=function(e){return e=Ah(e,{}),e.method="DELETE",this._makeRequest(e)};It.delete=function(e){return new It(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};It.prototype.head=function(e){return e=Ah(e,{}),e.method="HEAD",this._makeRequest(e)};It.head=function(e){return new It(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It.prototype.options=function(e){return e=Ah(e,{}),e.method="OPTIONS",this._makeRequest(e)};It.options=function(e){return new It(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It.prototype.post=function(e,t){return xo.defined("data",e),t=Ah(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};It.post=function(e){return new It(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It.prototype.put=function(e,t){return xo.defined("data",e),t=Ah(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};It.put=function(e){return new It(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It.prototype.patch=function(e,t){return xo.defined("data",e),t=Ah(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};It.patch=function(e){return new It(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};It._Implementations={};It._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(LS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};It._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;It.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){It._Implementations.loadImageElement(s,t,n);return}let c="blob",u="GET",f=Gl(),h=It._Implementations.loadWithXhr(s,c,u,void 0,void 0,f,void 0,void 0,void 0);return l(h)&&l(h.abort)&&(e.cancelFunction=function(){h.abort()}),f.promise.then(function(p){if(!l(p)){n.reject(new re(`Successfully retrieved ${s} but it contained no content.`));return}return It.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};It.createImageBitmapFromBlob=function(e,t){return xo.defined("options",t),xo.typeOf.bool("options.flipY",t.flipY),xo.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),xo.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function ISe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),r.reject(new Jm(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new Jm)})}var PSe=typeof XMLHttpRequest>"u";It._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=wSe.exec(e);if(a!==null){r.resolve(DSe(a,t));return}if(PSe){ISe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(LS.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new Jm(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,h=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let _=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};_.forEach(function(x){let b=x.split(": "),T=b.shift();m[T]=b.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(l(f)&&(!l(t)||h===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(h===""||h==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(h===""||h==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new re("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new Jm)},c.send(i),c};It._Implementations.loadAndExecuteScript=function(e,t,n){return sT(e,t).catch(function(i){n.reject(i)})};It._DefaultImplementations={};It._DefaultImplementations.createImage=It._Implementations.createImage;It._DefaultImplementations.loadWithXhr=It._Implementations.loadWithXhr;It._DefaultImplementations.loadAndExecuteScript=It._Implementations.loadAndExecuteScript;It.DEFAULT=Object.freeze(new It({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Se=It;function FS(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?I$(this,e.data):I$(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}FS.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new re(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new FS({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};FS.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new A0(0,0,0,0,0),t}});FS.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new A0(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],u=Z.lessThanOrEquals(a,e),f=!l(c),h=f||Z.greaterThanOrEquals(c,e);if(u&&h)return o=i,!f&&c.equals(e)&&++o,r=o+1,R$(this,n,this._samples,e,o,r,t),t}let s=Oo(n,e,Z.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,R$(this,n,this._samples,e,o,r,t),t};function RSe(e,t){return Z.compare(e.julianDate,t)}function I$(e,t){if(!l(t.columnNames))throw new re("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new re("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new re("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let h,p=e._addNewLeapSeconds;for(let _=0,m=u.length;_<m;_+=e._columnCount){let x=u[_+n],b=u[_+c],T=x+jn.MODIFIED_JULIAN_DATE_DIFFERENCE,C=new Z(T,b,Wn.TAI);if(f.push(C),p){if(b!==h&&l(h)){let A=Z.leapSeconds,S=Oo(A,C,RSe);if(S<0){let v=new qi(C,b);A.splice(~S,0,v)}}h=b}}}function P$(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function NS(e,t,n){return t+e*(n-t)}function R$(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return P$(e,n,o,a,s),s;if(i.equals(u))return P$(e,n,r,a,s),s;let f=Z.secondsDifference(i,c)/Z.secondsDifference(u,c),h=o*a,p=r*a,_=n[h+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],x=m-_;if(x>.5||x<-.5){let b=n[h+e._taiMinusUtcSecondsColumn],T=n[p+e._taiMinusUtcSecondsColumn];b!==T&&(u.equals(i)?_=m:m-=T-b)}return s.xPoleWander=NS(f,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=NS(f,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=NS(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=NS(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=NS(f,_,m),s}var C1=FS;function za(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}za.fromQuaternion=function(e,t){l(t)||(t=new za);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-P.asinClamped(n),t};za.fromDegrees=function(e,t,n,i){return l(i)||(i=new za),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};za.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new za(e.heading,e.pitch,e.roll)};za.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};za.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};za.prototype.clone=function(e){return za.clone(this,e)};za.prototype.equals=function(e){return za.equals(this,e)};za.prototype.equalsEpsilon=function(e,t,n){return za.equalsEpsilon(this,e,t,n)};za.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Ha=za;var O$=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function OSe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=O$.exec(i);if(o!==null)return o[1]}}var A1;function M$(e){return typeof document>"u"?e:(l(A1)||(A1=document.createElement("a")),A1.href=e,A1.href)}var w0;function L$(){if(l(w0))return w0;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(import.meta?.url)?e=Qm(".",import.meta.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(GP.toUrl)?e=Qm("..",D0("Core/buildModuleUrl.js")):e=OSe(),w0=new Se({url:M$(e)}),w0.appendForwardSlash(),w0}function MSe(e){return M$(GP.toUrl(`../${e}`))}function N$(e){return L$().getDerivedResource({url:e}).url}var E1;function D0(e){return l(E1)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(GP.toUrl)?E1=MSe:E1=N$),E1(e)}D0._cesiumScriptRegex=O$;D0._buildModuleUrlFromBaseUrl=N$;D0._clearBaseResource=function(){w0=void 0};D0.setBaseUrl=function(e){w0=Se.DEFAULT.getDerivedResource({url:e})};D0.getCesiumBaseUrl=L$;var nn=D0;function LSe(e,t,n){this.x=e,this.y=t,this.s=n}var fT=LSe;function s5(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Se.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new Z(this._sampleZeroJulianEphemerisDate,0,Wn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var NSe=new Z(0,0,Wn.TAI);function o5(e,t,n){let i=NSe;return i.dayNumber=t,i.secondsOfDay=n,Z.daysDifference(i,e._sampleZeroDateTT)}s5.prototype.preload=function(e,t,n,i){let o=o5(this,e,t),r=o5(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let h=c;h<=u;++h)f.push(r5(this,h));return Promise.all(f)};s5.prototype.computeXysRadians=function(e,t,n){let i=o5(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(r5(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(r5(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new fT(0,0,0);let f=i-s*this._stepSizeDays,h=this._work,p=this._denominators,_=this._coef,m=this._xTable,x,b;for(x=0;x<=r;++x)h[x]=f-m[x];for(x=0;x<=r;++x){for(_[x]=1,b=0;b<=r;++b)b!==x&&(_[x]*=h[b]);_[x]*=p[x];let T=(s+x)*3;n.x+=_[x]*u[T++],n.y+=_[x]*u[T++],n.s+=_[x]*u[T]}return n};function r5(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Se({url:nn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var S1=s5;function nt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var BS=new d;nt.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);BS=d.normalize(e,BS);let r=BS.x*o,s=BS.y*o,a=BS.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new nt(r,s,a,c)};var FSe=[1,2,0],BSe=new Array(3);nt.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let h=FSe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let _=h[p],m=h[_];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(_,_)]-e[$.getElementIndex(m,m)]+1);let x=BSe;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(m,_)]-e[$.getElementIndex(_,m)])*n,x[_]=(e[$.getElementIndex(_,p)]+e[$.getElementIndex(p,_)])*n,x[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new nt(i,o,r,s)};var F$=new nt,B$=new nt,a5=new nt,k$=new nt;nt.fromHeadingPitchRoll=function(e,t){return k$=nt.fromAxisAngle(d.UNIT_X,e.roll,F$),a5=nt.fromAxisAngle(d.UNIT_Y,-e.pitch,t),t=nt.multiply(a5,k$,a5),B$=nt.fromAxisAngle(d.UNIT_Z,-e.heading,F$),nt.multiply(B$,t,t)};var v1=new d,c5=new d,ad=new nt,V$=new nt,w1=new nt;nt.packedLength=4;nt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};nt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new nt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};nt.packedInterpolationLength=3;nt.convertPackedArrayForInterpolation=function(e,t,n,i){nt.unpack(e,n*4,w1),nt.conjugate(w1,w1);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;nt.unpack(e,(t+o)*4,ad),nt.multiply(ad,w1,ad),ad.w<0&&nt.negate(ad,ad),nt.computeAxis(ad,v1);let a=nt.computeAngle(ad);l(i)||(i=[]),i[s]=v1.x*a,i[s+1]=v1.y*a,i[s+2]=v1.z*a}};nt.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new nt),d.fromArray(e,0,c5);let r=d.magnitude(c5);return nt.unpack(t,i*4,V$),r===0?nt.clone(nt.IDENTITY,ad):nt.fromAxisAngle(c5,r,ad),nt.multiply(ad,V$,o)};nt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new nt(e.x,e.y,e.z,e.w)};nt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};nt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};nt.magnitude=function(e){return Math.sqrt(nt.magnitudeSquared(e))};nt.normalize=function(e,t){let n=1/nt.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};nt.inverse=function(e,t){let n=nt.magnitudeSquared(e);return t=nt.conjugate(e,t),nt.multiplyByScalar(t,1/n,t)};nt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};nt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};nt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};nt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};nt.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,h=s*a+i*f+o*u-r*c,p=s*c-i*u+o*f+r*a,_=s*u+i*c-o*a+r*f,m=s*f-i*a-o*c-r*u;return n.x=h,n.y=p,n.z=_,n.w=m,n};nt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};nt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};nt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6||Math.abs(n+1)<P.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};nt.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var l5=new nt;nt.lerp=function(e,t,n,i){return l5=nt.multiplyByScalar(t,n,l5),i=nt.multiplyByScalar(e,1-n,i),nt.add(l5,i,i)};var U$=new nt,u5=new nt,f5=new nt;nt.slerp=function(e,t,n,i){let o=nt.dot(e,t),r=t;if(o<0&&(o=-o,r=U$=nt.negate(t,U$)),1-o<P.EPSILON6)return nt.lerp(e,r,n,i);let s=Math.acos(o);return u5=nt.multiplyByScalar(e,Math.sin((1-n)*s),u5),f5=nt.multiplyByScalar(r,Math.sin(n*s),f5),i=nt.add(u5,f5,i),nt.multiplyByScalar(i,1/Math.sin(s),i)};nt.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),d.multiplyByScalar(e,i,t)};nt.exp=function(e,t){let n=d.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var kSe=new d,VSe=new d,kS=new nt,dT=new nt;nt.computeInnerQuadrangle=function(e,t,n,i){let o=nt.conjugate(t,kS);nt.multiply(o,n,dT);let r=nt.log(dT,kSe);nt.multiply(o,e,dT);let s=nt.log(dT,VSe);return d.add(r,s,r),d.multiplyByScalar(r,.25,r),d.negate(r,r),nt.exp(r,kS),nt.multiply(t,kS,i)};nt.squad=function(e,t,n,i,o,r){let s=nt.slerp(e,t,o,kS),a=nt.slerp(n,i,o,dT);return nt.slerp(s,a,2*o*(1-o),r)};var USe=new nt,z$=1.9011074535173003,D1=Ht.supportsTypedArrays()?new Float32Array(8):[],I1=Ht.supportsTypedArrays()?new Float32Array(8):[],tp=Ht.supportsTypedArrays()?new Float32Array(8):[],np=Ht.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;D1[e]=1/(t*n),I1[e]=t/n}D1[7]=z$/(8*17);I1[7]=z$*8/17;nt.fastSlerp=function(e,t,n,i){let o=nt.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let _=7;_>=0;--_)tp[_]=(D1[_]*c-I1[_])*s,np[_]=(D1[_]*u-I1[_])*s;let f=r*n*(1+tp[0]*(1+tp[1]*(1+tp[2]*(1+tp[3]*(1+tp[4]*(1+tp[5]*(1+tp[6]*(1+tp[7])))))))),h=a*(1+np[0]*(1+np[1]*(1+np[2]*(1+np[3]*(1+np[4]*(1+np[5]*(1+np[6]*(1+np[7])))))))),p=nt.multiplyByScalar(e,h,USe);return nt.multiplyByScalar(t,f,i),nt.add(p,i,i)};nt.fastSquad=function(e,t,n,i,o,r){let s=nt.fastSlerp(e,t,o,kS),a=nt.fastSlerp(n,i,o,dT);return nt.fastSlerp(s,a,2*o*(1-o),r)};nt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};nt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};nt.ZERO=Object.freeze(new nt(0,0,0,0));nt.IDENTITY=Object.freeze(new nt(0,0,0,1));nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.prototype.equalsEpsilon=function(e,t){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Oe=nt;var ai={},d5={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},hT={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},h5={},cl={east:new d,north:new d,up:new d,west:new d,south:new d,down:new d},Lg=new d,Ng=new d,Fg=new d;ai.localFrameToFixedFrameGenerator=function(e,t){if(!d5.hasOwnProperty(e)||!d5[e].hasOwnProperty(t))throw new he("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=d5[e][t],i,o=e+t;return l(h5[o])?i=h5[o]:(i=function(r,s,a){if(l(a)||(a=new F),d.equalsEpsilon(r,d.ZERO,P.EPSILON14))d.unpack(hT[e],0,Lg),d.unpack(hT[t],0,Ng),d.unpack(hT[n],0,Fg);else if(P.equalsEpsilon(r.x,0,P.EPSILON14)&&P.equalsEpsilon(r.y,0,P.EPSILON14)){let c=P.sign(r.z);d.unpack(hT[e],0,Lg),e!=="east"&&e!=="west"&&d.multiplyByScalar(Lg,c,Lg),d.unpack(hT[t],0,Ng),t!=="east"&&t!=="west"&&d.multiplyByScalar(Ng,c,Ng),d.unpack(hT[n],0,Fg),n!=="east"&&n!=="west"&&d.multiplyByScalar(Fg,c,Fg)}else{s=y(s,ee.default),s.geodeticSurfaceNormal(r,cl.up);let c=cl.up,u=cl.east;u.x=-r.y,u.y=r.x,u.z=0,d.normalize(u,cl.east),d.cross(c,u,cl.north),d.multiplyByScalar(cl.up,-1,cl.down),d.multiplyByScalar(cl.east,-1,cl.west),d.multiplyByScalar(cl.north,-1,cl.south),Lg=cl[e],Ng=cl[t],Fg=cl[n]}return a[0]=Lg.x,a[1]=Lg.y,a[2]=Lg.z,a[3]=0,a[4]=Ng.x,a[5]=Ng.y,a[6]=Ng.z,a[7]=0,a[8]=Fg.x,a[9]=Fg.y,a[10]=Fg.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},h5[o]=i),i};ai.eastNorthUpToFixedFrame=ai.localFrameToFixedFrameGenerator("east","north");ai.northEastDownToFixedFrame=ai.localFrameToFixedFrameGenerator("north","east");ai.northUpEastToFixedFrame=ai.localFrameToFixedFrameGenerator("north","up");ai.northWestUpToFixedFrame=ai.localFrameToFixedFrameGenerator("north","west");var zSe=new Oe,HSe=new d(1,1,1),GSe=new F;ai.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,ai.eastNorthUpToFixedFrame);let r=Oe.fromHeadingPitchRoll(t,zSe),s=F.fromTranslationQuaternionRotationScale(d.ZERO,r,HSe,GSe);return o=i(e,n,o),F.multiply(o,s,o)};var WSe=new F,jSe=new $;ai.headingPitchRollQuaternion=function(e,t,n,i,o){let r=ai.headingPitchRollToFixedFrame(e,t,n,i,WSe),s=F.getMatrix3(r,jSe);return Oe.fromRotationMatrix(s,o)};var qSe=new d(1,1,1),YSe=new d,H$=new F,XSe=new F,KSe=new $,ZSe=new Oe;ai.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,ee.default),n=y(n,ai.eastNorthUpToFixedFrame),l(i)||(i=new Ha);let o=F.getTranslation(e,YSe);if(d.equals(o,d.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=F.inverseTransformation(n(o,t,H$),H$),s=F.setScale(e,qSe,XSe);s=F.setTranslation(s,d.ZERO,s),r=F.multiply(r,s,r);let a=Oe.fromRotationMatrix(F.getMatrix3(r,KSe),ZSe);return a=Oe.normalize(a,a),Ha.fromQuaternion(a,i)};var $Se=6*3600+41*60+50.54841,QSe=8640184812866e-6,JSe=.093104,eve=-62e-7,tve=11772758384668e-32,nve=72921158553e-15,ive=P.TWO_PI/86400,P1=new Z;ai.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=ai.computeIcrfToFixedMatrix(e,t);return l(n)||(n=ai.computeTemeToPseudoFixedMatrix(e,t)),n};ai.computeTemeToPseudoFixedMatrix=function(e,t){P1=Z.addSeconds(e,-Z.computeTaiMinusUtc(e),P1);let n=P1.dayNumber,i=P1.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/jn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/jn.DAYS_PER_JULIAN_CENTURY;let a=($Se+o*(QSe+o*(JSe+o*eve)))*ive%P.TWO_PI,c=nve+tve*(n-24515455e-1),u=(i+jn.SECONDS_PER_DAY*.5)%jn.SECONDS_PER_DAY,f=a+c*u,h=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(h,p,0,-p,h,0,0,0,1)};ai.iau2006XysData=new S1;ai.earthOrientationParameters=C1.NONE;var g5=32.184,ove=2451545;ai.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+g5,i=e.stop.dayNumber,o=e.stop.secondsOfDay+g5;return ai.iau2006XysData.preload(t,n,i,o)};ai.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=ai.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var rve=32.184,sve=2451545,R1=new Ha,ave=new $,cve=new Z;ai.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Z.addSeconds(e,rve,cve),i=Z.totalDays(n)-sve,o=P.toRadians(12.112)-P.toRadians(.052992)*i,r=P.toRadians(24.224)-P.toRadians(.105984)*i,s=P.toRadians(227.645)+P.toRadians(13.012)*i,a=P.toRadians(261.105)+P.toRadians(13.340716)*i,c=P.toRadians(358)+P.toRadians(.9856)*i;return R1.pitch=P.toRadians(180)-P.toRadians(3.878)*Math.sin(o)-P.toRadians(.12)*Math.sin(r)+P.toRadians(.07)*Math.sin(s)-P.toRadians(.017)*Math.sin(a),R1.roll=P.toRadians(66.53-90)+P.toRadians(1.543)*Math.cos(o)+P.toRadians(.24)*Math.cos(r)-P.toRadians(.028)*Math.cos(s)+P.toRadians(.007)*Math.cos(a),R1.heading=P.toRadians(244.375-90)+P.toRadians(13.17635831)*i+P.toRadians(3.558)*Math.sin(o)+P.toRadians(.121)*Math.sin(r)-P.toRadians(.064)*Math.sin(s)+P.toRadians(.016)*Math.sin(a)+P.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(R1,ave)};ai.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=ai.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var lve=new fT(0,0,0),uve=new A0(0,0,0,0,0,0),m5=new $,p5=new $;ai.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=ai.earthOrientationParameters.compute(e,uve);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+g5,r=ai.iau2006XysData.computeXysRadians(i,o,lve);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=m5;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-r.s,p5),h=$.multiply(u,f,m5),p=e.dayNumber,_=e.secondsOfDay-Z.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,x=_/jn.SECONDS_PER_DAY,b=.779057273264+x+.00273781191135448*(m+x);b=b%1*P.TWO_PI;let T=$.fromRotationZ(b,p5),C=$.multiply(h,T,m5),A=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),D=Math.sin(n.yPoleWander),O=i-ove+o/jn.SECONDS_PER_DAY;O/=36525;let R=-47e-6*O*P.RADIANS_PER_DEGREE/3600,M=Math.cos(R),L=Math.sin(R),g=p5;return g[0]=A*M,g[1]=A*L,g[2]=v,g[3]=-S*L+D*v*M,g[4]=S*M+D*v*L,g[5]=-D*A,g[6]=-D*L-S*v*M,g[7]=D*M-S*v*L,g[8]=S*A,$.multiply(C,g,t)};var fve=new oe;ai.pointToWindowCoordinates=function(e,t,n,i){return i=ai.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ai.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let o=fve;return F.multiplyByVector(e,oe.fromElements(n.x,n.y,n.z,1,o),o),oe.multiplyByScalar(o,1/o.w,o),F.multiplyByVector(t,o,o),U.fromCartesian4(o,i)};var dve=new d,hve=new d,mve=new d;ai.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,ee.default).geodeticSurfaceNormal(e,dve),r=d.cross(t,o,hve);d.equalsEpsilon(r,d.ZERO,P.EPSILON6)&&(r=d.clone(d.UNIT_X,r));let s=d.cross(r,t,mve);return d.normalize(s,s),d.cross(t,s,r),d.negate(r,r),d.normalize(r,r),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var G$=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),W$=new fe,_5=new d,pve=new d,gve=new $,y5=new F,j$=new F;ai.basisTo2D=function(e,t,n){let i=F.getTranslation(t,pve),o=e.ellipsoid,r;if(d.equals(i,d.ZERO))r=d.clone(d.ZERO,_5);else{let f=o.cartesianToCartographic(i,W$);r=e.project(f,_5),d.fromElements(r.z,r.x,r.y,r)}let s=ai.eastNorthUpToFixedFrame(i,o,y5),a=F.inverseTransformation(s,j$),c=F.getMatrix3(t,gve),u=F.multiplyByMatrix3(a,c,n);return F.multiply(G$,u,n),F.setTranslation(n,r,n),n};ai.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=ai.eastNorthUpToFixedFrame(t,i,y5),r=F.inverseTransformation(o,j$),s=i.cartesianToCartographic(t,W$),a=e.project(s,_5);d.fromElements(a.z,a.x,a.y,a);let c=F.fromTranslation(a,y5);return F.multiply(G$,r,n),F.multiply(c,n,n),n};var Mt=ai;function vn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(vn.prototype,{width:{get:function(){return vn.computeWidth(this)}},height:{get:function(){return vn.computeHeight(this)}}});vn.packedLength=4;vn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};vn.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new vn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};vn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=P.TWO_PI),t-n};vn.computeHeight=function(e){return e.north-e.south};vn.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(y(e,0)),t=P.toRadians(y(t,0)),n=P.toRadians(y(n,0)),i=P.toRadians(y(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new vn(e,t,n,i)};vn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=y(e,0),o.south=y(t,0),o.east=y(n,0),o.north=y(i,0),o):new vn(e,t,n,i)};vn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let h=f.longitude>=0?f.longitude:f.longitude+P.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new vn(n,s,i,a)};vn.fromCartesianArray=function(e,t,n){t=y(t,ee.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let h=t.cartesianToCartographic(e[u]);i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),a=Math.min(a,h.latitude),c=Math.max(c,h.latitude);let p=h.longitude>=0?h.longitude:h.longitude+P.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>P.PI&&(o=o-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new vn(i,a,o,c)};var _ve=new d,yve=new d,xve=new d,bve=new d,Tve=new d,x5=new Array(5);for(let e=0;e<x5.length;++e)x5[e]=new d;vn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=ee.default),l(n)||(n=new vn),d.equals(i,d.ZERO))return vn.clone(vn.MAX_VALUE,n),n;let r=Mt.eastNorthUpToFixedFrame(i,t,_ve),s=F.multiplyByPointAsVector(r,d.UNIT_X,yve);d.normalize(s,s);let a=F.multiplyByPointAsVector(r,d.UNIT_Y,xve);d.normalize(a,a),d.multiplyByScalar(a,o,a),d.multiplyByScalar(s,o,s);let c=d.negate(a,Tve),u=d.negate(s,bve),f=x5,h=f[0];return d.add(i,a,h),h=f[1],d.add(i,u,h),h=f[2],d.add(i,c,h),h=f[3],d.add(i,s,h),f[4]=i,vn.fromCartesianArray(f,t,n)};vn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new vn(e.west,e.south,e.east,e.north)};vn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};vn.prototype.clone=function(e){return vn.clone(this,e)};vn.prototype.equals=function(e){return vn.equals(this,e)};vn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};vn.prototype.equalsEpsilon=function(e,t){return vn.equalsEpsilon(this,e,t)};vn._validate=function(e){};vn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new fe(e.west,e.south)};vn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new fe(e.west,e.north)};vn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new fe(e.east,e.north)};vn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new fe(e.east,e.south)};vn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=P.TWO_PI);let o=P.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new fe(o,r)};vn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.max(o,s)),c=P.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new vn(a,u,c,f)};vn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new vn(i,o,r,s)};vn.union=function(e,t,n){l(n)||(n=new vn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.min(o,s)),c=P.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};vn.expand=function(e,t,n){return l(n)||(n=new vn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};vn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=P.TWO_PI,n<0&&(n+=P.TWO_PI)),(n>o||P.equalsEpsilon(n,o,P.EPSILON14))&&(n<r||P.equalsEpsilon(n,r,P.EPSILON14))&&i>=e.south&&i<=e.north};var Cve=new fe;vn.subsample=function(e,t,n,i){t=y(t,ee.default),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=Cve;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*P.PI_OVER_TWO,vn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};vn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new vn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=P.TWO_PI+e.east-e.west;r.west=P.negativePiToPi(e.west+t*a),r.east=P.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};vn.MAX_VALUE=Object.freeze(new vn(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var se=vn;function vr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}vr.packedLength=4;vr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};vr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new vr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};vr.fromPoints=function(e,t){if(l(t)||(t=new vr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var q$=new Ii,Ave=new fe,Eve=new fe;vr.fromRectangle=function(e,t,n){if(l(n)||(n=new vr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;q$._ellipsoid=ee.default,t=y(t,q$);let i=t.project(se.southwest(e,Ave)),o=t.project(se.northeast(e,Eve));return U.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};vr.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new vr(e.x,e.y,e.width,e.height)};vr.union=function(e,t,n){l(n)||(n=new vr);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};vr.expand=function(e,t,n){n=vr.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};vr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?jt.OUTSIDE:jt.INTERSECTING};vr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};vr.prototype.clone=function(e){return vr.clone(this,e)};vr.prototype.intersect=function(e){return vr.intersect(this,e)};vr.prototype.equals=function(e){return vr.equals(this,e)};var qe=vr;var xa={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};xa.isLines=function(e){return e===xa.LINES||e===xa.LINE_LOOP||e===xa.LINE_STRIP};xa.isTriangles=function(e){return e===xa.TRIANGLES||e===xa.TRIANGLE_STRIP||e===xa.TRIANGLE_FAN};xa.validate=function(e){return e===xa.POINTS||e===xa.LINES||e===xa.LINE_LOOP||e===xa.LINE_STRIP||e===xa.TRIANGLES||e===xa.TRIANGLE_STRIP||e===xa.TRIANGLE_FAN};var Me=Object.freeze(xa);var mT=`in vec4 position; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var F=Qe;var sEe={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},te=Object.freeze(sEe);var aEe=new d;function wt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Zs={};Zs[te.FLOAT]="float";Zs[te.FLOAT_VEC2]="vec2";Zs[te.FLOAT_VEC3]="vec3";Zs[te.FLOAT_VEC4]="vec4";Zs[te.INT]="int";Zs[te.INT_VEC2]="ivec2";Zs[te.INT_VEC3]="ivec3";Zs[te.INT_VEC4]="ivec4";Zs[te.BOOL]="bool";Zs[te.BOOL_VEC2]="bvec2";Zs[te.BOOL_VEC3]="bvec3";Zs[te.BOOL_VEC4]="bvec4";Zs[te.FLOAT_MAT2]="mat2";Zs[te.FLOAT_MAT3]="mat3";Zs[te.FLOAT_MAT4]="mat4";Zs[te.SAMPLER_2D]="sampler2D";Zs[te.SAMPLER_CUBE]="samplerCube";wt.prototype.getDeclaration=function(e){let t=`uniform ${Zs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var cEe={czm_viewport:new wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new wt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new wt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new wt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,aEe)}}),czm_frameNumber:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new wt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new wt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new wt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new wt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new wt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new wt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new wt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new wt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Pg=cEe;function lEe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var zn=lEe;function uEe(){return!0}function fEe(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=uEe}var ue=fEe;var Ps={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};Ps.getSizeInBytes=function(e){switch(e){case Ps.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Ps.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Ps.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Ps.fromSizeInBytes=function(e){switch(e){case 2:return Ps.UNSIGNED_SHORT;case 4:return Ps.UNSIGNED_INT;case 1:return Ps.UNSIGNED_BYTE}};Ps.validate=function(e){return l(e)&&(e===Ps.UNSIGNED_BYTE||e===Ps.UNSIGNED_SHORT||e===Ps.UNSIGNED_INT)};Ps.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Ps.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Ps.fromTypedArray=function(e){if(e instanceof Uint8Array)return Ps.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Ps.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Ps.UNSIGNED_INT};var Ne=Object.freeze(Ps);var e1={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,validate:function(e){return e===e1.STREAM_DRAW||e===e1.STATIC_DRAW||e===e1.DYNAMIC_DRAW}},Fe=Object.freeze(e1);function qu(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=zn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}qu.createVertexBuffer=function(e){return new qu({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};qu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ne.getSizeInBytes(n),o=new qu({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(qu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});qu.prototype._getBuffer=function(){return this._buffer};qu.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};qu.prototype.copyFromBuffer=function(e,t,n,i){let o=te.COPY_READ_BUFFER,r=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};qu.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=te.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};qu.prototype.isDestroyed=function(){return!1};qu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var _t=qu;var Rg,Er={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},al={};Object.defineProperties(al,{element:{get:function(){if(al.supportsFullscreen())return document[Er.fullscreenElement]}},changeEventName:{get:function(){if(al.supportsFullscreen())return Er.fullscreenchange}},errorEventName:{get:function(){if(al.supportsFullscreen())return Er.fullscreenerror}},enabled:{get:function(){if(al.supportsFullscreen())return document[Er.fullscreenEnabled]}},fullscreen:{get:function(){if(al.supportsFullscreen())return al.element!==null}}});al.supportsFullscreen=function(){if(l(Rg))return Rg;Rg=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Er.requestFullscreen="requestFullscreen",Er.exitFullscreen="exitFullscreen",Er.fullscreenEnabled="fullscreenEnabled",Er.fullscreenElement="fullscreenElement",Er.fullscreenchange="fullscreenchange",Er.fullscreenerror="fullscreenerror",Rg=!0,Rg;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(Er.requestFullscreen=n,Rg=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Er.requestFullscreen=n,Rg=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Er.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Er.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Er.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Er.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Er.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Er.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Er.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Er.fullscreenerror=n)}return Rg};al.requestFullscreen=function(e,t){al.supportsFullscreen()&&e[Er.requestFullscreen]({vrDisplay:t})};al.exitFullscreen=function(){al.supportsFullscreen()&&document[Er.exitFullscreen]()};al._names=Er;var Sr=al;var Ua;typeof navigator<"u"?Ua=navigator:Ua={};function C0(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var t1,jZ;function qG(){if(!l(t1)&&(t1=!1,!a1())){let e=/ Chrome\/([\.0-9]+)/.exec(Ua.userAgent);e!==null&&(t1=!0,jZ=C0(e[1]))}return t1}function dEe(){return qG()&&jZ}var n1,qZ;function YZ(){if(!l(n1)&&(n1=!1,!qG()&&!a1()&&/ Safari\/[\.0-9]+/.test(Ua.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Ua.userAgent);e!==null&&(n1=!0,qZ=C0(e[1]))}return n1}function hEe(){return YZ()&&qZ}var i1,WG;function XZ(){if(!l(i1)){i1=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ua.userAgent);e!==null&&(i1=!0,WG=C0(e[1]),WG.isNightly=!!e[2])}return i1}function mEe(){return XZ()&&WG}var LS,jG;function KZ(){if(!l(LS)){LS=!1;let e;Ua.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Ua.userAgent),e!==null&&(LS=!0,jG=C0(e[1]))):Ua.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Ua.userAgent),e!==null&&(LS=!0,jG=C0(e[1])))}return LS}function pEe(){return KZ()&&jG}var o1,ZZ;function a1(){if(!l(o1)){o1=!1;let e=/ Edg\/([\.0-9]+)/.exec(Ua.userAgent);e!==null&&(o1=!0,ZZ=C0(e[1]))}return o1}function gEe(){return a1()&&ZZ}var r1,YG;function c1(){if(!l(r1)){r1=!1;let e=/Firefox\/([\.0-9]+)/.exec(Ua.userAgent);e!==null&&(r1=!0,YG=C0(e[1]))}return r1}var zG;function _Ee(){return l(zG)||(zG=/Windows/i.test(Ua.appVersion)),zG}var HG;function yEe(){return l(HG)||(HG=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),HG}function xEe(){return c1()&&YG}var GG;function bEe(){return l(GG)||(GG=!c1()&&typeof PointerEvent<"u"&&(!l(Ua.pointerEnabled)||Ua.pointerEnabled)),GG}var $Z,s1;function QZ(){if(!l(s1)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;s1=l(t)&&t!=="",s1&&($Z=t)}return s1}function TEe(){return QZ()?$Z:void 0}function bc(){return bc._result}bc._promise=void 0;bc._result=void 0;bc.initialize=function(){return l(bc._promise)||(bc._promise=new Promise(e=>{let t=new Image;t.onload=function(){bc._result=t.width>0&&t.height>0,e(bc._result)},t.onerror=function(){bc._result=!1,e(bc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),bc._promise};Object.defineProperties(bc,{initialized:{get:function(){return l(bc._result)}}});var Jb=[];typeof ArrayBuffer<"u"&&(Jb.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&Jb.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&Jb.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&Jb.push(BigInt64Array),typeof BigUint64Array<"u"&&Jb.push(BigUint64Array));var Yu={isChrome:qG,chromeVersion:dEe,isSafari:YZ,safariVersion:hEe,isWebkit:XZ,webkitVersion:mEe,isInternetExplorer:KZ,internetExplorerVersion:pEe,isEdge:a1,edgeVersion:gEe,isFirefox:c1,firefoxVersion:xEe,isWindows:_Ee,isIPadOrIOS:yEe,hardwareConcurrency:y(Ua.hardwareConcurrency,3),supportsPointerEvents:bEe,supportsImageRenderingPixelated:QZ,supportsWebP:bc,imageRenderingValue:TEe,typedArrayTypes:Jb};Yu.supportsBasis=function(e){return Yu.supportsWebAssembly()&&e.context.supportsBasis};Yu.supportsFullscreen=function(){return Sr.supportsFullscreen()};Yu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Yu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Yu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Yu.supportsBigInt=function(){return typeof BigInt<"u"};Yu.supportsWebWorkers=function(){return typeof Worker<"u"};Yu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Yu.supportsWebgl2=function(e){return e.context.webgl2};Yu.supportsEsmWebWorkers=function(){return!c1()||parseInt(YG)>=114};var zt=Yu;function XG(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ie(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}ie.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ie(e.x,e.y,e.z,e.w)};ie.fromBytes=function(e,t,n,i,o){return e=ie.byteToFloat(y(e,255)),t=ie.byteToFloat(y(t,255)),n=ie.byteToFloat(y(n,255)),i=ie.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new ie(e,t,n,i)};ie.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ie(e.red,e.green,e.blue,t)};var KG,ZG,Qm;zt.supportsTypedArrays()&&(KG=new ArrayBuffer(4),ZG=new Uint32Array(KG),Qm=new Uint8Array(KG));ie.fromRgba=function(e,t){return ZG[0]=e,ie.fromBytes(Qm[0],Qm[1],Qm[2],Qm[3],t)};ie.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=XG(u,c,e+1/3),s=XG(u,c,e),a=XG(u,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new ie(r,s,a,i)};ie.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+P.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+P.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+P.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+P.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new ie(n,i,o,r)};var CEe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,AEe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,EEe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,SEe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;ie.fromCssColorString=function(e,t){l(t)||(t=new ie),e=e.trim();let n=ie[e.toUpperCase()];if(l(n))return ie.clone(n,t),t;let i=CEe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=AEe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=EEe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=SEe.exec(e),i!==null?ie.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};ie.packedLength=4;ie.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ie.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ie),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ie.byteToFloat=function(e){return e/255};ie.floatToByte=function(e){return e===1?255:e*256|0};ie.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ie(e.red,e.green,e.blue,e.alpha)};ie.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ie.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};ie.prototype.clone=function(e){return ie.clone(this,e)};ie.prototype.equals=function(e){return ie.equals(this,e)};ie.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};ie.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ie.prototype.toCssColorString=function(){let e=ie.floatToByte(this.red),t=ie.floatToByte(this.green),n=ie.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ie.prototype.toCssHexString=function(){let e=ie.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ie.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ie.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ie.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ie.prototype.toBytes=function(e){let t=ie.floatToByte(this.red),n=ie.floatToByte(this.green),i=ie.floatToByte(this.blue),o=ie.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};ie.prototype.toRgba=function(){return Qm[0]=ie.floatToByte(this.red),Qm[1]=ie.floatToByte(this.green),Qm[2]=ie.floatToByte(this.blue),Qm[3]=ie.floatToByte(this.alpha),ZG[0]};ie.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ie.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ie.prototype.withAlpha=function(e,t){return ie.fromAlpha(this,e,t)};ie.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};ie.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};ie.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};ie.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};ie.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};ie.lerp=function(e,t,n,i){return i.red=P.lerp(e.red,t.red,n),i.green=P.lerp(e.green,t.green,n),i.blue=P.lerp(e.blue,t.blue,n),i.alpha=P.lerp(e.alpha,t.alpha,n),i};ie.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ie.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ie.ALICEBLUE=Object.freeze(ie.fromCssColorString("#F0F8FF"));ie.ANTIQUEWHITE=Object.freeze(ie.fromCssColorString("#FAEBD7"));ie.AQUA=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.AQUAMARINE=Object.freeze(ie.fromCssColorString("#7FFFD4"));ie.AZURE=Object.freeze(ie.fromCssColorString("#F0FFFF"));ie.BEIGE=Object.freeze(ie.fromCssColorString("#F5F5DC"));ie.BISQUE=Object.freeze(ie.fromCssColorString("#FFE4C4"));ie.BLACK=Object.freeze(ie.fromCssColorString("#000000"));ie.BLANCHEDALMOND=Object.freeze(ie.fromCssColorString("#FFEBCD"));ie.BLUE=Object.freeze(ie.fromCssColorString("#0000FF"));ie.BLUEVIOLET=Object.freeze(ie.fromCssColorString("#8A2BE2"));ie.BROWN=Object.freeze(ie.fromCssColorString("#A52A2A"));ie.BURLYWOOD=Object.freeze(ie.fromCssColorString("#DEB887"));ie.CADETBLUE=Object.freeze(ie.fromCssColorString("#5F9EA0"));ie.CHARTREUSE=Object.freeze(ie.fromCssColorString("#7FFF00"));ie.CHOCOLATE=Object.freeze(ie.fromCssColorString("#D2691E"));ie.CORAL=Object.freeze(ie.fromCssColorString("#FF7F50"));ie.CORNFLOWERBLUE=Object.freeze(ie.fromCssColorString("#6495ED"));ie.CORNSILK=Object.freeze(ie.fromCssColorString("#FFF8DC"));ie.CRIMSON=Object.freeze(ie.fromCssColorString("#DC143C"));ie.CYAN=Object.freeze(ie.fromCssColorString("#00FFFF"));ie.DARKBLUE=Object.freeze(ie.fromCssColorString("#00008B"));ie.DARKCYAN=Object.freeze(ie.fromCssColorString("#008B8B"));ie.DARKGOLDENROD=Object.freeze(ie.fromCssColorString("#B8860B"));ie.DARKGRAY=Object.freeze(ie.fromCssColorString("#A9A9A9"));ie.DARKGREEN=Object.freeze(ie.fromCssColorString("#006400"));ie.DARKGREY=ie.DARKGRAY;ie.DARKKHAKI=Object.freeze(ie.fromCssColorString("#BDB76B"));ie.DARKMAGENTA=Object.freeze(ie.fromCssColorString("#8B008B"));ie.DARKOLIVEGREEN=Object.freeze(ie.fromCssColorString("#556B2F"));ie.DARKORANGE=Object.freeze(ie.fromCssColorString("#FF8C00"));ie.DARKORCHID=Object.freeze(ie.fromCssColorString("#9932CC"));ie.DARKRED=Object.freeze(ie.fromCssColorString("#8B0000"));ie.DARKSALMON=Object.freeze(ie.fromCssColorString("#E9967A"));ie.DARKSEAGREEN=Object.freeze(ie.fromCssColorString("#8FBC8F"));ie.DARKSLATEBLUE=Object.freeze(ie.fromCssColorString("#483D8B"));ie.DARKSLATEGRAY=Object.freeze(ie.fromCssColorString("#2F4F4F"));ie.DARKSLATEGREY=ie.DARKSLATEGRAY;ie.DARKTURQUOISE=Object.freeze(ie.fromCssColorString("#00CED1"));ie.DARKVIOLET=Object.freeze(ie.fromCssColorString("#9400D3"));ie.DEEPPINK=Object.freeze(ie.fromCssColorString("#FF1493"));ie.DEEPSKYBLUE=Object.freeze(ie.fromCssColorString("#00BFFF"));ie.DIMGRAY=Object.freeze(ie.fromCssColorString("#696969"));ie.DIMGREY=ie.DIMGRAY;ie.DODGERBLUE=Object.freeze(ie.fromCssColorString("#1E90FF"));ie.FIREBRICK=Object.freeze(ie.fromCssColorString("#B22222"));ie.FLORALWHITE=Object.freeze(ie.fromCssColorString("#FFFAF0"));ie.FORESTGREEN=Object.freeze(ie.fromCssColorString("#228B22"));ie.FUCHSIA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.GAINSBORO=Object.freeze(ie.fromCssColorString("#DCDCDC"));ie.GHOSTWHITE=Object.freeze(ie.fromCssColorString("#F8F8FF"));ie.GOLD=Object.freeze(ie.fromCssColorString("#FFD700"));ie.GOLDENROD=Object.freeze(ie.fromCssColorString("#DAA520"));ie.GRAY=Object.freeze(ie.fromCssColorString("#808080"));ie.GREEN=Object.freeze(ie.fromCssColorString("#008000"));ie.GREENYELLOW=Object.freeze(ie.fromCssColorString("#ADFF2F"));ie.GREY=ie.GRAY;ie.HONEYDEW=Object.freeze(ie.fromCssColorString("#F0FFF0"));ie.HOTPINK=Object.freeze(ie.fromCssColorString("#FF69B4"));ie.INDIANRED=Object.freeze(ie.fromCssColorString("#CD5C5C"));ie.INDIGO=Object.freeze(ie.fromCssColorString("#4B0082"));ie.IVORY=Object.freeze(ie.fromCssColorString("#FFFFF0"));ie.KHAKI=Object.freeze(ie.fromCssColorString("#F0E68C"));ie.LAVENDER=Object.freeze(ie.fromCssColorString("#E6E6FA"));ie.LAVENDAR_BLUSH=Object.freeze(ie.fromCssColorString("#FFF0F5"));ie.LAWNGREEN=Object.freeze(ie.fromCssColorString("#7CFC00"));ie.LEMONCHIFFON=Object.freeze(ie.fromCssColorString("#FFFACD"));ie.LIGHTBLUE=Object.freeze(ie.fromCssColorString("#ADD8E6"));ie.LIGHTCORAL=Object.freeze(ie.fromCssColorString("#F08080"));ie.LIGHTCYAN=Object.freeze(ie.fromCssColorString("#E0FFFF"));ie.LIGHTGOLDENRODYELLOW=Object.freeze(ie.fromCssColorString("#FAFAD2"));ie.LIGHTGRAY=Object.freeze(ie.fromCssColorString("#D3D3D3"));ie.LIGHTGREEN=Object.freeze(ie.fromCssColorString("#90EE90"));ie.LIGHTGREY=ie.LIGHTGRAY;ie.LIGHTPINK=Object.freeze(ie.fromCssColorString("#FFB6C1"));ie.LIGHTSEAGREEN=Object.freeze(ie.fromCssColorString("#20B2AA"));ie.LIGHTSKYBLUE=Object.freeze(ie.fromCssColorString("#87CEFA"));ie.LIGHTSLATEGRAY=Object.freeze(ie.fromCssColorString("#778899"));ie.LIGHTSLATEGREY=ie.LIGHTSLATEGRAY;ie.LIGHTSTEELBLUE=Object.freeze(ie.fromCssColorString("#B0C4DE"));ie.LIGHTYELLOW=Object.freeze(ie.fromCssColorString("#FFFFE0"));ie.LIME=Object.freeze(ie.fromCssColorString("#00FF00"));ie.LIMEGREEN=Object.freeze(ie.fromCssColorString("#32CD32"));ie.LINEN=Object.freeze(ie.fromCssColorString("#FAF0E6"));ie.MAGENTA=Object.freeze(ie.fromCssColorString("#FF00FF"));ie.MAROON=Object.freeze(ie.fromCssColorString("#800000"));ie.MEDIUMAQUAMARINE=Object.freeze(ie.fromCssColorString("#66CDAA"));ie.MEDIUMBLUE=Object.freeze(ie.fromCssColorString("#0000CD"));ie.MEDIUMORCHID=Object.freeze(ie.fromCssColorString("#BA55D3"));ie.MEDIUMPURPLE=Object.freeze(ie.fromCssColorString("#9370DB"));ie.MEDIUMSEAGREEN=Object.freeze(ie.fromCssColorString("#3CB371"));ie.MEDIUMSLATEBLUE=Object.freeze(ie.fromCssColorString("#7B68EE"));ie.MEDIUMSPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FA9A"));ie.MEDIUMTURQUOISE=Object.freeze(ie.fromCssColorString("#48D1CC"));ie.MEDIUMVIOLETRED=Object.freeze(ie.fromCssColorString("#C71585"));ie.MIDNIGHTBLUE=Object.freeze(ie.fromCssColorString("#191970"));ie.MINTCREAM=Object.freeze(ie.fromCssColorString("#F5FFFA"));ie.MISTYROSE=Object.freeze(ie.fromCssColorString("#FFE4E1"));ie.MOCCASIN=Object.freeze(ie.fromCssColorString("#FFE4B5"));ie.NAVAJOWHITE=Object.freeze(ie.fromCssColorString("#FFDEAD"));ie.NAVY=Object.freeze(ie.fromCssColorString("#000080"));ie.OLDLACE=Object.freeze(ie.fromCssColorString("#FDF5E6"));ie.OLIVE=Object.freeze(ie.fromCssColorString("#808000"));ie.OLIVEDRAB=Object.freeze(ie.fromCssColorString("#6B8E23"));ie.ORANGE=Object.freeze(ie.fromCssColorString("#FFA500"));ie.ORANGERED=Object.freeze(ie.fromCssColorString("#FF4500"));ie.ORCHID=Object.freeze(ie.fromCssColorString("#DA70D6"));ie.PALEGOLDENROD=Object.freeze(ie.fromCssColorString("#EEE8AA"));ie.PALEGREEN=Object.freeze(ie.fromCssColorString("#98FB98"));ie.PALETURQUOISE=Object.freeze(ie.fromCssColorString("#AFEEEE"));ie.PALEVIOLETRED=Object.freeze(ie.fromCssColorString("#DB7093"));ie.PAPAYAWHIP=Object.freeze(ie.fromCssColorString("#FFEFD5"));ie.PEACHPUFF=Object.freeze(ie.fromCssColorString("#FFDAB9"));ie.PERU=Object.freeze(ie.fromCssColorString("#CD853F"));ie.PINK=Object.freeze(ie.fromCssColorString("#FFC0CB"));ie.PLUM=Object.freeze(ie.fromCssColorString("#DDA0DD"));ie.POWDERBLUE=Object.freeze(ie.fromCssColorString("#B0E0E6"));ie.PURPLE=Object.freeze(ie.fromCssColorString("#800080"));ie.RED=Object.freeze(ie.fromCssColorString("#FF0000"));ie.ROSYBROWN=Object.freeze(ie.fromCssColorString("#BC8F8F"));ie.ROYALBLUE=Object.freeze(ie.fromCssColorString("#4169E1"));ie.SADDLEBROWN=Object.freeze(ie.fromCssColorString("#8B4513"));ie.SALMON=Object.freeze(ie.fromCssColorString("#FA8072"));ie.SANDYBROWN=Object.freeze(ie.fromCssColorString("#F4A460"));ie.SEAGREEN=Object.freeze(ie.fromCssColorString("#2E8B57"));ie.SEASHELL=Object.freeze(ie.fromCssColorString("#FFF5EE"));ie.SIENNA=Object.freeze(ie.fromCssColorString("#A0522D"));ie.SILVER=Object.freeze(ie.fromCssColorString("#C0C0C0"));ie.SKYBLUE=Object.freeze(ie.fromCssColorString("#87CEEB"));ie.SLATEBLUE=Object.freeze(ie.fromCssColorString("#6A5ACD"));ie.SLATEGRAY=Object.freeze(ie.fromCssColorString("#708090"));ie.SLATEGREY=ie.SLATEGRAY;ie.SNOW=Object.freeze(ie.fromCssColorString("#FFFAFA"));ie.SPRINGGREEN=Object.freeze(ie.fromCssColorString("#00FF7F"));ie.STEELBLUE=Object.freeze(ie.fromCssColorString("#4682B4"));ie.TAN=Object.freeze(ie.fromCssColorString("#D2B48C"));ie.TEAL=Object.freeze(ie.fromCssColorString("#008080"));ie.THISTLE=Object.freeze(ie.fromCssColorString("#D8BFD8"));ie.TOMATO=Object.freeze(ie.fromCssColorString("#FF6347"));ie.TURQUOISE=Object.freeze(ie.fromCssColorString("#40E0D0"));ie.VIOLET=Object.freeze(ie.fromCssColorString("#EE82EE"));ie.WHEAT=Object.freeze(ie.fromCssColorString("#F5DEB3"));ie.WHITE=Object.freeze(ie.fromCssColorString("#FFFFFF"));ie.WHITESMOKE=Object.freeze(ie.fromCssColorString("#F5F5F5"));ie.YELLOW=Object.freeze(ie.fromCssColorString("#FFFF00"));ie.YELLOWGREEN=Object.freeze(ie.fromCssColorString("#9ACD32"));ie.TRANSPARENT=Object.freeze(new ie(0,0,0,0));var z=ie;function l1(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}l1.ALL=Object.freeze(new l1({color:new z(0,0,0,0),depth:1,stencil:0}));l1.prototype.execute=function(e,t){e.clear(this,t)};var ti=l1;var vEe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},we=Object.freeze(vEe);function JZ(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=we.COMPUTE,this.owner=e.owner}JZ.prototype.execute=function(e){e.execute(this)};var cl=JZ;function Nt(e,t){this.x=y(e,0),this.y=y(t,0)}Nt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Nt(e,t)};Nt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Nt(e.x,e.y)};Nt.fromCartesian3=Nt.clone;Nt.fromCartesian4=Nt.clone;Nt.packedLength=2;Nt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Nt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Nt),n.x=e[t++],n.y=e[t],n};Nt.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Nt.pack(e[o],t,o*2);return t};Nt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Nt.unpack(e,i,t[o])}return t};Nt.fromArray=Nt.unpack;Nt.maximumComponent=function(e){return Math.max(e.x,e.y)};Nt.minimumComponent=function(e){return Math.min(e.x,e.y)};Nt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Nt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Nt.clamp=function(e,t,n,i){let o=P.clamp(e.x,t.x,n.x),r=P.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Nt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Nt.magnitude=function(e){return Math.sqrt(Nt.magnitudeSquared(e))};var u1=new Nt;Nt.distance=function(e,t){return Nt.subtract(e,t,u1),Nt.magnitude(u1)};Nt.distanceSquared=function(e,t){return Nt.subtract(e,t,u1),Nt.magnitudeSquared(u1)};Nt.normalize=function(e,t){let n=Nt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Nt.dot=function(e,t){return e.x*t.x+e.y*t.y};Nt.cross=function(e,t){return e.x*t.y-e.y*t.x};Nt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Nt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Nt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Nt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Nt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Nt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Nt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Nt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var e$=new Nt;Nt.lerp=function(e,t,n,i){return Nt.multiplyByScalar(t,n,e$),i=Nt.multiplyByScalar(e,1-n,i),Nt.add(e$,i,i)};var t$=new Nt,n$=new Nt;Nt.angleBetween=function(e,t){return Nt.normalize(e,t$),Nt.normalize(t,n$),P.acosClamped(Nt.dot(t$,n$))};var wEe=new Nt;Nt.mostOrthogonalAxis=function(e,t){let n=Nt.normalize(e,wEe);return Nt.abs(n,n),n.x<=n.y?t=Nt.clone(Nt.UNIT_X,t):t=Nt.clone(Nt.UNIT_Y,t),t};Nt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Nt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Nt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.x,t.x,n,i)&&P.equalsEpsilon(e.y,t.y,n,i)};Nt.ZERO=Object.freeze(new Nt(0,0));Nt.ONE=Object.freeze(new Nt(1,1));Nt.UNIT_X=Object.freeze(new Nt(1,0));Nt.UNIT_Y=Object.freeze(new Nt(0,1));Nt.prototype.clone=function(e){return Nt.clone(this,e)};Nt.prototype.equals=function(e){return Nt.equals(this,e)};Nt.prototype.equalsEpsilon=function(e,t,n){return Nt.equalsEpsilon(this,e,t,n)};Nt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var U=Nt;var DEe=new d,IEe=new d;function PEe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,h=r*r*c*c,p=s*s*u*u,_=a*a*f*f,m=h+p+_,x=Math.sqrt(1/m),b=d.multiplyByScalar(e,x,DEe);if(m<i)return isFinite(x)?d.clone(b,o):void 0;let T=n.x,C=n.y,A=n.z,S=IEe;S.x=b.x*T*2,S.y=b.y*C*2,S.z=b.z*A*2;let v=(1-x)*d.magnitude(e)/(.5*d.magnitude(S)),D=0,O,R,M,L,g,E,w,I,N,B,H;do{v-=D,M=1/(1+v*T),L=1/(1+v*C),g=1/(1+v*A),E=M*M,w=L*L,I=g*g,N=E*M,B=w*L,H=I*g,O=h*E+p*w+_*I-1,R=h*N*T+p*B*C+_*H*A;let V=-2*R;D=O/V}while(Math.abs(O)>P.EPSILON12);return l(o)?(o.x=r*M,o.y=s*L,o.z=a*g,o):new d(r*M,s*L,a*g)}var eT=PEe;function Oo(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Oo.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Oo(e,t,n)};Oo.fromDegrees=function(e,t,n,i){return e=P.toRadians(e),t=P.toRadians(t),Oo.fromRadians(e,t,n,i)};var REe=new d,OEe=new d,MEe=new d;Oo._ellipsoidOneOverRadii=new d(1/6378137,1/6378137,1/6356752314245179e-9);Oo._ellipsoidOneOverRadiiSquared=new d(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Oo._ellipsoidCenterToleranceSquared=P.EPSILON1;Oo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:Oo._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:Oo._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:Oo._ellipsoidCenterToleranceSquared,s=eT(e,i,o,r,OEe);if(!l(s))return;let a=d.multiplyComponents(s,o,REe);a=d.normalize(a,a);let c=d.subtract(e,s,MEe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),h=P.sign(d.dot(c,e))*d.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=h,n):new Oo(u,f,h)};Oo.toCartesian=function(e,t,n){return d.fromRadians(e.longitude,e.latitude,e.height,t,n)};Oo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Oo(e.longitude,e.latitude,e.height)};Oo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Oo.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Oo.ZERO=Object.freeze(new Oo(0,0,0));Oo.prototype.clone=function(e){return Oo.clone(this,e)};Oo.prototype.equals=function(e){return Oo.equals(this,e)};Oo.prototype.equalsEpsilon=function(e,t){return Oo.equalsEpsilon(this,e,t)};Oo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var fe=Oo;function o$(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new d(t,n,i),e._radiiSquared=new d(t*t,n*n,i*i),e._radiiToTheFourth=new d(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new d(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new d(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function di(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,o$(this,e,t,n)}Object.defineProperties(di.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});di.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(d.clone(n,t._radii),d.clone(e._radiiSquared,t._radiiSquared),d.clone(e._radiiToTheFourth,t._radiiToTheFourth),d.clone(e._oneOverRadii,t._oneOverRadii),d.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new di(n.x,n.y,n.z)};di.fromCartesian3=function(e,t){return l(t)||(t=new di),l(e)&&o$(t,e.x,e.y,e.z),t};di.WGS84=Object.freeze(new di(6378137,6378137,6356752314245179e-9));di.UNIT_SPHERE=Object.freeze(new di(1,1,1));di.MOON=Object.freeze(new di(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));di._default=di.WGS84;Object.defineProperties(di,{default:{get:function(){return di._default},set:function(e){di._default=e,d._ellipsoidRadiiSquared=e.radiiSquared,fe._ellipsoidOneOverRadii=e.oneOverRadii,fe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,fe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});di.prototype.clone=function(e){return di.clone(this,e)};di.packedLength=d.packedLength;di.pack=function(e,t,n){return n=y(n,0),d.pack(e._radii,t,n),t};di.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t);return di.fromCartesian3(i,n)};di.prototype.geocentricSurfaceNormal=d.normalize;di.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new d),t.x=r,t.y=s,t.z=a,d.normalize(t,t)};di.prototype.geodeticSurfaceNormal=function(e,t){if(!d.equalsEpsilon(e,d.ZERO,P.EPSILON14))return l(t)||(t=new d),t=d.multiplyComponents(e,this._oneOverRadiiSquared,t),d.normalize(t,t)};var LEe=new d,NEe=new d;di.prototype.cartographicToCartesian=function(e,t){let n=LEe,i=NEe;this.geodeticSurfaceNormalCartographic(e,n),d.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(d.dot(n,i));return d.divideByScalar(i,o,i),d.multiplyByScalar(n,e.height,n),l(t)||(t=new d),d.add(i,n,t)};di.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var FEe=new d,BEe=new d,kEe=new d;di.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,BEe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,FEe),o=d.subtract(e,n,kEe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=P.sign(d.dot(o,e))*d.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new fe(r,s,a)};di.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};di.prototype.scaleToGeodeticSurface=function(e,t){return eT(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};di.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new d);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return d.multiplyByScalar(e,s,t)};di.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new d),d.multiplyComponents(e,this._oneOverRadii,t)};di.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new d),d.multiplyComponents(e,this._radii,t)};di.prototype.equals=function(e){return this===e||l(e)&&d.equals(this._radii,e._radii)};di.prototype.toString=function(){return this._radii.toString()};di.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new d),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var VEe=new d;di.prototype.getLocalCurvature=function(e,t){l(t)||(t=new U);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,VEe),i=d.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return U.fromElements(1/i,1/r,t)};var UEe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],zEe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function i$(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*UEe[s];r+=zEe[s]*(n(i+a)+n(i-a))}return r*=o,r}di.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=P.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,u=s*a;return i$(i,o,function(f){let h=Math.cos(f),p=Math.sin(f);return Math.cos(f)*i$(t,n,function(_){let m=Math.cos(_),x=Math.sin(_);return Math.sqrt(u*p*p+c*(a*m*m+s*x*x)*h*h)})})};var ee=di;function f1(e){this._ellipsoid=y(e,ee.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(f1.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});f1.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};f1.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var Pi=f1;var HEe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Wt=Object.freeze(HEe);function GEe(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Mo=GEe;function WEe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var A0=WEe;function jEe(e){return e%4===0&&e%100!==0||e%400===0}var xh=jEe;var r$=[31,28,31,30,31,30,31,31,30,31,30,31];function qEe(e,t,n,i,o,r,s,a){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,0),o=y(o,0),r=y(r,0),s=y(s,0),a=y(a,!1),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function x(){xo.typeOf.number.greaterThanOrEquals("Year",e,1),xo.typeOf.number.lessThanOrEquals("Year",e,9999),xo.typeOf.number.greaterThanOrEquals("Month",t,1),xo.typeOf.number.lessThanOrEquals("Month",t,12),xo.typeOf.number.greaterThanOrEquals("Day",n,1),xo.typeOf.number.lessThanOrEquals("Day",n,31),xo.typeOf.number.greaterThanOrEquals("Hour",i,0),xo.typeOf.number.lessThanOrEquals("Hour",i,23),xo.typeOf.number.greaterThanOrEquals("Minute",o,0),xo.typeOf.number.lessThanOrEquals("Minute",o,59),xo.typeOf.bool("IsLeapSecond",a),xo.typeOf.number.greaterThanOrEquals("Second",r,0),xo.typeOf.number.lessThanOrEquals("Second",r,a?60:59),xo.typeOf.number.greaterThanOrEquals("Millisecond",s,0),xo.typeOf.number.lessThan("Millisecond",s,1e3)}function b(){let T=t===2&&xh(e)?r$[t-1]+1:r$[t-1];if(n>T)throw new he("Month and Day represents invalid date")}}var Og=qEe;function YEe(e,t){this.julianDate=e,this.offset=t}var qi=YEe;var XEe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},qn=Object.freeze(XEe);var KEe={UTC:0,TAI:1},jn=Object.freeze(KEe);var a$=new Og,$G=[31,28,31,30,31,30,31,31,30,31,30,31],QG=29;function JG(e,t){return Pt.compare(e.julianDate,t.julianDate)}var tT=new qi;function h1(e){tT.julianDate=e;let t=Pt.leapSeconds,n=Mo(t,tT,JG);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Pt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Pt.addSeconds(e,i,e)}function s$(e,t){tT.julianDate=e;let n=Pt.leapSeconds,i=Mo(n,tT,JG);if(i<0&&(i=~i),i===0)return Pt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Pt.addSeconds(e,-n[i-1].offset,t);let o=Pt.secondsDifference(n[i].julianDate,e);if(o===0)return Pt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Pt.addSeconds(e,-n[--i].offset,t)}function Mg(e,t,n){let i=t/qn.SECONDS_PER_DAY|0;return e+=i,t-=qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function e5(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*qn.SECONDS_PER_HOUR+o*qn.SECONDS_PER_MINUTE+s*qn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var ZEe=/^(\d{4})$/,$Ee=/^(\d{4})-(\d{2})$/,QEe=/^(\d{4})-?(\d{3})$/,JEe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,eSe=/^(\d{4})-?(\d{2})-?(\d{2})$/,t5=/([Z+\-])?(\d{2})?:?(\d{2})?$/,tSe=/^(\d{2})(\.\d+)?/.source+t5.source,nSe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+t5.source,iSe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+t5.source;function Pt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,jn.UTC);let i=e|0;t=t+(e-i)*qn.SECONDS_PER_DAY,Mg(i,t,this),n===jn.UTC&&h1(this)}Pt.fromGregorianDate=function(e,t){let n=e5(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(Mg(n[0],n[1],t),h1(t),t):new Pt(n[0],n[1],jn.UTC)};Pt.fromDate=function(e,t){let n=e5(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(Mg(n[0],n[1],t),h1(t),t):new Pt(n[0],n[1],jn.UTC)};Pt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,u=0,f=n[0],h=n[1],p,_;if(n=f.match(eSe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match($Ee),n!==null)i=+n[1],o=+n[2];else if(n=f.match(ZEe),n!==null)i=+n[1];else{let T;if(n=f.match(QEe),n!==null)i=+n[1],T=+n[2],_=xh(i);else if(n=f.match(JEe),n!==null){i=+n[1];let C=+n[2],A=+n[3]||0,S=new Date(Date.UTC(i,0,4));T=C*7+A-S.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(T),o=p.getUTCMonth()+1,r=p.getUTCDate()}_=xh(i);let m;if(l(h)){n=h.match(iSe),n!==null?(s=+n[1],a=+n[2],c=+n[3],u=+(n[4]||0)*1e3,m=5):(n=h.match(nSe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,m=4):(n=h.match(tSe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,m=3)));let T=n[m],C=+n[m+1],A=+(n[m+2]||0);switch(T){case"+":s=s-C,a=a-A;break;case"-":s=s+C,a=a+A;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=_&&o===2?QG:$G[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=_&&o===2?QG:$G[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=_&&o===2?QG:$G[o-1],r+=p;let b=e5(i,o,r,s,a,c,u);return l(t)?(Mg(b[0],b[1],t),h1(t)):t=new Pt(b[0],b[1],jn.UTC),x&&Pt.addSeconds(t,1,t),t};Pt.now=function(e){return Pt.fromDate(new Date,e)};var d1=new Pt(0,0,jn.TAI);Pt.toGregorianDate=function(e,t){let n=!1,i=s$(e,d1);l(i)||(Pt.addSeconds(e,-1,d1),i=s$(d1,d1),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let h=u+2-12*s|0,p=100*(a-49)+c+s|0,_=r/qn.SECONDS_PER_HOUR|0,m=r-_*qn.SECONDS_PER_HOUR,x=m/qn.SECONDS_PER_MINUTE|0;m=m-x*qn.SECONDS_PER_MINUTE;let b=m|0,T=(m-b)/qn.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(b+=1),l(t)?(t.year=p,t.month=h,t.day=f,t.hour=_,t.minute=x,t.second=b,t.millisecond=T,t.isLeapSecond=n,t):new Og(p,h,f,_,x,b,T,n)};Pt.toDate=function(e){let t=Pt.toGregorianDate(e,a$),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Pt.toIso8601=function(e,t){let n=Pt.toGregorianDate(e,a$),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;if(!l(t)&&u!==0){let h=u*.01;return f=h<1e-6?h.toFixed(20).replace(".","").replace(/0+$/,""):h.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`}return!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};Pt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Pt(e.dayNumber,e.secondsOfDay,jn.TAI)};Pt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Pt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Pt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(Pt.secondsDifference(e,t))<=n};Pt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/qn.SECONDS_PER_DAY};Pt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Pt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/qn.SECONDS_PER_DAY;return n+i};Pt.computeTaiMinusUtc=function(e){tT.julianDate=e;let t=Pt.leapSeconds,n=Mo(t,tT,JG);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Pt.addSeconds=function(e,t,n){return Mg(e.dayNumber,e.secondsOfDay+t,n)};Pt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*qn.SECONDS_PER_MINUTE;return Mg(e.dayNumber,i,n)};Pt.addHours=function(e,t,n){let i=e.secondsOfDay+t*qn.SECONDS_PER_HOUR;return Mg(e.dayNumber,i,n)};Pt.addDays=function(e,t,n){let i=e.dayNumber+t;return Mg(i,e.secondsOfDay,n)};Pt.lessThan=function(e,t){return Pt.compare(e,t)<0};Pt.lessThanOrEquals=function(e,t){return Pt.compare(e,t)<=0};Pt.greaterThan=function(e,t){return Pt.compare(e,t)>0};Pt.greaterThanOrEquals=function(e,t){return Pt.compare(e,t)>=0};Pt.prototype.clone=function(e){return Pt.clone(this,e)};Pt.prototype.equals=function(e){return Pt.equals(this,e)};Pt.prototype.equalsEpsilon=function(e,t){return Pt.equalsEpsilon(this,e,t)};Pt.prototype.toString=function(){return Pt.toIso8601(this)};Pt.leapSeconds=[new qi(new Pt(2441317,43210,jn.TAI),10),new qi(new Pt(2441499,43211,jn.TAI),11),new qi(new Pt(2441683,43212,jn.TAI),12),new qi(new Pt(2442048,43213,jn.TAI),13),new qi(new Pt(2442413,43214,jn.TAI),14),new qi(new Pt(2442778,43215,jn.TAI),15),new qi(new Pt(2443144,43216,jn.TAI),16),new qi(new Pt(2443509,43217,jn.TAI),17),new qi(new Pt(2443874,43218,jn.TAI),18),new qi(new Pt(2444239,43219,jn.TAI),19),new qi(new Pt(2444786,43220,jn.TAI),20),new qi(new Pt(2445151,43221,jn.TAI),21),new qi(new Pt(2445516,43222,jn.TAI),22),new qi(new Pt(2446247,43223,jn.TAI),23),new qi(new Pt(2447161,43224,jn.TAI),24),new qi(new Pt(2447892,43225,jn.TAI),25),new qi(new Pt(2448257,43226,jn.TAI),26),new qi(new Pt(2448804,43227,jn.TAI),27),new qi(new Pt(2449169,43228,jn.TAI),28),new qi(new Pt(2449534,43229,jn.TAI),29),new qi(new Pt(2450083,43230,jn.TAI),30),new qi(new Pt(2450630,43231,jn.TAI),31),new qi(new Pt(2451179,43232,jn.TAI),32),new qi(new Pt(2453736,43233,jn.TAI),33),new qi(new Pt(2454832,43234,jn.TAI),34),new qi(new Pt(2456109,43235,jn.TAI),35),new qi(new Pt(2457204,43236,jn.TAI),36),new qi(new Pt(2457754,43237,jn.TAI),37)];var Z=Pt;var v$=Ur(Wl(),1);function oSe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var _1=oSe;function m$(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=m$(o,t)),n[i]=o}return n}var Ge=m$;function p$(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=p$(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var xt=p$;function rSe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var jl=rSe;var g$=Ur(Wl(),1);function n5(e,t){let n;return typeof document<"u"&&(n=document),n5._implementation(e,t,n)}n5._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new g$.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Jm=n5;var _$=Ur(Wl(),1);function sSe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new _$.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var y1=sSe;var y$=Ur(Wl(),1);function aSe(e){let t=new y$.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var oT=aSe;var x$={};function cSe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=x$[t];l(i)||(i={},x$[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var bh=cSe;var lSe=/^blob:/i;function uSe(e){return lSe.test(e)}var rT=uSe;var Th;function fSe(e){l(Th)||(Th=document.createElement("a")),Th.href=window.location.href;let t=Th.host,n=Th.protocol;return Th.href=e,Th.href=Th.href,n!==Th.protocol||t!==Th.host}var E0=fSe;var dSe=/^data:/i;function hSe(e){return dSe.test(e)}var Lg=hSe;function mSe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var sT=mSe;function pSe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var aT=pSe;function gSe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Xu=gSe;var _Se={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},$n=Object.freeze(_Se);var ySe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ps=Object.freeze(ySe);function x1(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,ps.OTHER),this.serverKey=e.serverKey,this.state=$n.UNISSUED,this.deferred=void 0,this.cancelled=!1}x1.prototype.cancel=function(){this.cancelled=!0};x1.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=$n.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new x1(this)};var nr=x1;function xSe(e){let t={};if(!e)return t;let n=e.split(`\r +`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var b1=xSe;function b$(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=b1(this.responseHeaders))}b$.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var ep=b$;var C1=Ur(Wl(),1);function NS(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(NS.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});NS.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};NS.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function bSe(e,t){return t-e}NS.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];l(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(bSe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var pe=NS;function S0(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(S0.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function i5(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}S0.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};S0.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(i5(i,o,e),e=o):r=!1}};S0.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};S0.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)i5(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};S0.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return i5(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var T1=S0;function TSe(e,t){return e.priority-t.priority}var Zi={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},cT=20,za=new T1({comparator:TSe});za.maximumLength=cT;za.reserve(cT);var Ch=[],tp={},CSe=typeof document<"u"?new C1.default(document.location.href):new C1.default,A1=new pe;function Go(){}Go.maximumRequests=50;Go.maximumRequestsPerServer=18;Go.requestsByServer={};Go.throttleRequests=!0;Go.debugShowStatistics=!1;Go.requestCompletedEvent=A1;Object.defineProperties(Go,{statistics:{get:function(){return Zi}},priorityHeapLength:{get:function(){return cT},set:function(e){if(e<cT)for(;za.length>e;){let t=za.pop();v0(t)}cT=e,za.maximumLength=e,za.reserve(e)}}});function T$(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Go.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(Go.requestsByServer[e],Go.maximumRequestsPerServer);return tp[e]+t<=n};Go.heapHasOpenSlots=function(e){return za.length+e<=cT};function C$(e){return e.state===$n.UNISSUED&&(e.state=$n.ISSUED,e.deferred=jl()),e.deferred.promise}function ASe(e){return function(t){if(e.state===$n.CANCELLED)return;let n=e.deferred;--Zi.numberOfActiveRequests,--tp[e.serverKey],A1.raiseEvent(),e.state=$n.RECEIVED,e.deferred=void 0,n.resolve(t)}}function ESe(e){return function(t){e.state!==$n.CANCELLED&&(++Zi.numberOfFailedRequests,--Zi.numberOfActiveRequests,--tp[e.serverKey],A1.raiseEvent(t),e.state=$n.FAILED,e.deferred.reject(t))}}function A$(e){let t=C$(e);return e.state=$n.ACTIVE,Ch.push(e),++Zi.numberOfActiveRequests,++Zi.numberOfActiveRequestsEver,++tp[e.serverKey],e.requestFunction().then(ASe(e)).catch(ESe(e)),t}function v0(e){let t=e.state===$n.ACTIVE;if(e.state=$n.CANCELLED,++Zi.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Zi.numberOfActiveRequests,--tp[e.serverKey],++Zi.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Go.update=function(){let e,t,n=0,i=Ch.length;for(e=0;e<i;++e){if(t=Ch[e],t.cancelled&&v0(t),t.state!==$n.ACTIVE){++n;continue}n>0&&(Ch[e-n]=t)}Ch.length-=n;let o=za.internalArray,r=za.length;for(e=0;e<r;++e)T$(o[e]);za.resort();let s=Math.max(Go.maximumRequests-Ch.length,0),a=0;for(;a<s&&za.length>0;){if(t=za.pop(),t.cancelled){v0(t);continue}if(t.throttleByServer&&!Go.serverHasOpenSlots(t.serverKey)){v0(t);continue}A$(t),++a}SSe()};Go.getServerKey=function(e){let t=new C1.default(e);t.scheme()===""&&(t=t.absoluteTo(CSe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=tp[n];return l(i)||(tp[n]=0),n};Go.request=function(e){if(Lg(e.url)||rT(e.url))return A1.raiseEvent(),e.state=$n.RECEIVED,e.requestFunction();if(++Zi.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Go.getServerKey(e.url)),Go.throttleRequests&&e.throttleByServer&&!Go.serverHasOpenSlots(e.serverKey))return;if(!Go.throttleRequests||!e.throttle)return A$(e);if(Ch.length>=Go.maximumRequests)return;T$(e);let t=za.insert(e);if(l(t)){if(t===e)return;v0(t)}return C$(e)};function SSe(){Go.debugShowStatistics&&(Zi.numberOfActiveRequests===0&&Zi.lastNumberOfActiveRequests>0&&(Zi.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Zi.numberOfAttemptedRequests}`),Zi.numberOfAttemptedRequests=0),Zi.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Zi.numberOfCancelledRequests}`),Zi.numberOfCancelledRequests=0),Zi.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Zi.numberOfCancelledActiveRequests}`),Zi.numberOfCancelledActiveRequests=0),Zi.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Zi.numberOfFailedRequests}`),Zi.numberOfFailedRequests=0)),Zi.lastNumberOfActiveRequests=Zi.numberOfActiveRequests)}Go.clearForSpecs=function(){for(;za.length>0;){let t=za.pop();v0(t)}let e=Ch.length;for(let t=0;t<e;++t)v0(Ch[t]);Ch.length=0,tp={},Zi.numberOfAttemptedRequests=0,Zi.numberOfActiveRequests=0,Zi.numberOfCancelledRequests=0,Zi.numberOfCancelledActiveRequests=0,Zi.numberOfFailedRequests=0,Zi.numberOfActiveRequestsEver=0,Zi.lastNumberOfActiveRequests=0};Go.numberOfActiveRequestsByServer=function(e){return tp[e]};Go.requestHeap=za;var Tc=Go;var E$=Ur(Wl(),1);var FS={},lT={};FS.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(lT[n])||(lT[n]=!0)};FS.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(lT[n])&&delete lT[n]};function vSe(e){let t=new E$.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}FS.contains=function(e){let t=vSe(e);return!!(l(t)&&l(lT[t]))};FS.clear=function(){lT={}};var BS=FS;var w$=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function Dt(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Ah(e.templateValues,{}),this._queryParameters=Ah(e.queryParameters,{}),this.headers=Ah(e.headers,{}),this.request=y(e.request,new nr),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Ah(e,t){return l(e)?Ge(e):t}Dt.createIfNeeded=function(e){return e instanceof Dt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Dt({url:e})};var uT;Dt.supportsImageBitmapOptions=function(){return l(uT)?uT:typeof createImageBitmap!="function"?(uT=Promise.resolve(!1),uT):(uT=Dt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=bh(t[0]),i=bh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),uT)};Object.defineProperties(Dt,{isBlobSupported:{get:function(){return w$}}});Object.defineProperties(Dt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return oT(this._url)}},isDataUri:{get:function(){return Lg(this._url)}},isBlobUri:{get:function(){return rT(this._url)}},isCrossOriginUrl:{get:function(){return E0(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Dt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Dt.prototype.parseUrl=function(e,t,n,i){let o=new v$.default(e),r=wSe(o.query());this._queryParameters=t?S1(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Jm(i))),this._url=o.toString()};function wSe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Xu(e)}function S1(e,t,n){if(!n)return xt(e,t);let i=Ge(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Dt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${DSe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function DSe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${aT(e)}`}Dt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=S1(this._queryParameters,e,!1):this._queryParameters=S1(e,this._queryParameters,!1)};Dt.prototype.appendQueryParameters=function(e){this._queryParameters=S1(e,this._queryParameters,!0)};Dt.prototype.setTemplateValues=function(e,t){t?this._templateValues=xt(this._templateValues,e):this._templateValues=xt(e,this._templateValues)};Dt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=xt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=xt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=xt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Dt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Dt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ge(this._queryParameters),e._templateValues=Ge(this._templateValues),e.headers=Ge(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Dt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};Dt.prototype.getBaseUri=function(e){return y1(this.getUrlComponent(e),e)};Dt.prototype.appendForwardSlash=function(){this._url=_1(this._url)};Dt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Dt.fetchArrayBuffer=function(e){return new Dt(e).fetchArrayBuffer()};Dt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Dt.fetchBlob=function(e){return new Dt(e).fetchBlob()};Dt.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(r5(this.request),!w$||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return o5({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,u;return Dt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!l(f))return;if(u=f,a)return Dt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(f);return c=new Dt({url:h}),o5({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};function o5(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=jl();return Dt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=Tc.request(r);if(l(s))return s.catch(function(a){return r.state!==$n.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=$n.UNISSUED,r.deferred=void 0,o5({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Dt.fetchImage=function(e){return new Dt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Dt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Dt.fetchText=function(e){return new Dt(e).fetchText()};Dt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Dt.fetchJson=function(e){return new Dt(e).fetchJson()};Dt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Dt.fetchXML=function(e){return new Dt(e).fetchXML()};Dt.prototype.fetchJsonp=function(e){e=y(e,"callback"),r5(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return D$(this,e,t)};function D$(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=jl();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Dt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Tc.request(o);if(l(s))return s.catch(function(a){return o.state!==$n.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=$n.UNISSUED,o.deferred=void 0,D$(e,t,n)):Promise.reject(a)})})}Dt.fetchJsonp=function(e){return new Dt(e).fetchJsonp(e.callbackParameterName)};Dt.prototype._makeRequest=function(e){let t=this;r5(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=xt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=jl(),h=Dt._Implementations.loadWithXhr(i,r,c,u,s,f,a);return l(h)&&l(h.abort)&&(n.cancelFunction=function(){h.abort()}),f.promise};let o=Tc.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==$n.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=$n.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function r5(e){if(e.state===$n.ISSUED||e.state===$n.ACTIVE)throw new re("The Resource is already being fetched.");e.state=$n.UNISSUED,e.deferred=void 0}var ISe=/^data:(.*?)(;base64)?,(.*)$/;function E1(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function S$(e,t){let n=E1(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function PSe(e,t){t=y(t,"");let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return E1(i,o);case"arraybuffer":return S$(i,o);case"blob":return r=S$(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(E1(i,o),n);case"json":return JSON.parse(E1(i,o));default:}}Dt.prototype.fetch=function(e){return e=Ah(e,{}),e.method="GET",this._makeRequest(e)};Dt.fetch=function(e){return new Dt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt.prototype.delete=function(e){return e=Ah(e,{}),e.method="DELETE",this._makeRequest(e)};Dt.delete=function(e){return new Dt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Dt.prototype.head=function(e){return e=Ah(e,{}),e.method="HEAD",this._makeRequest(e)};Dt.head=function(e){return new Dt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt.prototype.options=function(e){return e=Ah(e,{}),e.method="OPTIONS",this._makeRequest(e)};Dt.options=function(e){return new Dt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt.prototype.post=function(e,t){return xo.defined("data",e),t=Ah(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Dt.post=function(e){return new Dt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt.prototype.put=function(e,t){return xo.defined("data",e),t=Ah(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Dt.put=function(e){return new Dt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt.prototype.patch=function(e,t){return xo.defined("data",e),t=Ah(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Dt.patch=function(e){return new Dt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Dt._Implementations={};Dt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(BS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Dt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;Dt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){Dt._Implementations.loadImageElement(s,t,n);return}let c="blob",u="GET",f=jl(),h=Dt._Implementations.loadWithXhr(s,c,u,void 0,void 0,f,void 0,void 0,void 0);return l(h)&&l(h.abort)&&(e.cancelFunction=function(){h.abort()}),f.promise.then(function(p){if(!l(p)){n.reject(new re(`Successfully retrieved ${s} but it contained no content.`));return}return Dt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Dt.createImageBitmapFromBlob=function(e,t){return xo.defined("options",t),xo.typeOf.bool("options.flipY",t.flipY),xo.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),xo.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function RSe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),r.reject(new ep(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new ep)})}var OSe=typeof XMLHttpRequest>"u";Dt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=ISe.exec(e);if(a!==null){r.resolve(PSe(a,t));return}if(OSe){RSe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(BS.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new ep(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,h=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let _=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};_.forEach(function(x){let b=x.split(": "),T=b.shift();m[T]=b.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(l(f)&&(!l(t)||h===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(h===""||h==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(h===""||h==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new re("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new ep)},c.send(i),c};Dt._Implementations.loadAndExecuteScript=function(e,t,n){return sT(e,t).catch(function(i){n.reject(i)})};Dt._DefaultImplementations={};Dt._DefaultImplementations.createImage=Dt._Implementations.createImage;Dt._DefaultImplementations.loadWithXhr=Dt._Implementations.loadWithXhr;Dt._DefaultImplementations.loadAndExecuteScript=Dt._Implementations.loadAndExecuteScript;Dt.DEFAULT=Object.freeze(new Dt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Se=Dt;function VS(e){e=y(e,y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=y(e.addNewLeapSeconds,!0),l(e.data)?I$(this,e.data):I$(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}VS.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new re(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new VS({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};VS.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new A0(0,0,0,0,0),t}});VS.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new A0(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],u=Z.lessThanOrEquals(a,e),f=!l(c),h=f||Z.greaterThanOrEquals(c,e);if(u&&h)return o=i,!f&&c.equals(e)&&++o,r=o+1,R$(this,n,this._samples,e,o,r,t),t}let s=Mo(n,e,Z.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,R$(this,n,this._samples,e,o,r,t),t};function MSe(e,t){return Z.compare(e.julianDate,t)}function I$(e,t){if(!l(t.columnNames))throw new re("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new re("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new re("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let h,p=e._addNewLeapSeconds;for(let _=0,m=u.length;_<m;_+=e._columnCount){let x=u[_+n],b=u[_+c],T=x+qn.MODIFIED_JULIAN_DATE_DIFFERENCE,C=new Z(T,b,jn.TAI);if(f.push(C),p){if(b!==h&&l(h)){let A=Z.leapSeconds,S=Mo(A,C,MSe);if(S<0){let v=new qi(C,b);A.splice(~S,0,v)}}h=b}}}function P$(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function kS(e,t,n){return t+e*(n-t)}function R$(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return P$(e,n,o,a,s),s;if(i.equals(u))return P$(e,n,r,a,s),s;let f=Z.secondsDifference(i,c)/Z.secondsDifference(u,c),h=o*a,p=r*a,_=n[h+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],x=m-_;if(x>.5||x<-.5){let b=n[h+e._taiMinusUtcSecondsColumn],T=n[p+e._taiMinusUtcSecondsColumn];b!==T&&(u.equals(i)?_=m:m-=T-b)}return s.xPoleWander=kS(f,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=kS(f,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=kS(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=kS(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=kS(f,_,m),s}var v1=VS;function Ha(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}Ha.fromQuaternion=function(e,t){l(t)||(t=new Ha);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-P.asinClamped(n),t};Ha.fromDegrees=function(e,t,n,i){return l(i)||(i=new Ha),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};Ha.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Ha(e.heading,e.pitch,e.roll)};Ha.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Ha.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};Ha.prototype.clone=function(e){return Ha.clone(this,e)};Ha.prototype.equals=function(e){return Ha.equals(this,e)};Ha.prototype.equalsEpsilon=function(e,t,n){return Ha.equalsEpsilon(this,e,t,n)};Ha.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Ga=Ha;var O$=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function LSe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=O$.exec(i);if(o!==null)return o[1]}}var w1;function M$(e){return typeof document>"u"?e:(l(w1)||(w1=document.createElement("a")),w1.href=e,w1.href)}var w0;function L$(){if(l(w0))return w0;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(import.meta?.url)?e=Jm(".",import.meta.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(YP.toUrl)?e=Jm("..",D0("Core/buildModuleUrl.js")):e=LSe(),w0=new Se({url:M$(e)}),w0.appendForwardSlash(),w0}function NSe(e){return M$(YP.toUrl(`../${e}`))}function N$(e){return L$().getDerivedResource({url:e}).url}var D1;function D0(e){return l(D1)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(YP.toUrl)?D1=NSe:D1=N$),D1(e)}D0._cesiumScriptRegex=O$;D0._buildModuleUrlFromBaseUrl=N$;D0._clearBaseResource=function(){w0=void 0};D0.setBaseUrl=function(e){w0=Se.DEFAULT.getDerivedResource({url:e})};D0.getCesiumBaseUrl=L$;var en=D0;function FSe(e,t,n){this.x=e,this.y=t,this.s=n}var fT=FSe;function c5(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Se.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new Z(this._sampleZeroJulianEphemerisDate,0,jn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var BSe=new Z(0,0,jn.TAI);function s5(e,t,n){let i=BSe;return i.dayNumber=t,i.secondsOfDay=n,Z.daysDifference(i,e._sampleZeroDateTT)}c5.prototype.preload=function(e,t,n,i){let o=s5(this,e,t),r=s5(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let h=c;h<=u;++h)f.push(a5(this,h));return Promise.all(f)};c5.prototype.computeXysRadians=function(e,t,n){let i=s5(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(a5(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(a5(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new fT(0,0,0);let f=i-s*this._stepSizeDays,h=this._work,p=this._denominators,_=this._coef,m=this._xTable,x,b;for(x=0;x<=r;++x)h[x]=f-m[x];for(x=0;x<=r;++x){for(_[x]=1,b=0;b<=r;++b)b!==x&&(_[x]*=h[b]);_[x]*=p[x];let T=(s+x)*3;n.x+=_[x]*u[T++],n.y+=_[x]*u[T++],n.s+=_[x]*u[T]}return n};function a5(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Se({url:en(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[c+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var I1=c5;function nt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var US=new d;nt.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);US=d.normalize(e,US);let r=US.x*o,s=US.y*o,a=US.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new nt(r,s,a,c)};var kSe=[1,2,0],VSe=new Array(3);nt.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let h=kSe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let _=h[p],m=h[_];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(_,_)]-e[$.getElementIndex(m,m)]+1);let x=VSe;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(m,_)]-e[$.getElementIndex(_,m)])*n,x[_]=(e[$.getElementIndex(_,p)]+e[$.getElementIndex(p,_)])*n,x[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new nt(i,o,r,s)};var F$=new nt,B$=new nt,l5=new nt,k$=new nt;nt.fromHeadingPitchRoll=function(e,t){return k$=nt.fromAxisAngle(d.UNIT_X,e.roll,F$),l5=nt.fromAxisAngle(d.UNIT_Y,-e.pitch,t),t=nt.multiply(l5,k$,l5),B$=nt.fromAxisAngle(d.UNIT_Z,-e.heading,F$),nt.multiply(B$,t,t)};var P1=new d,u5=new d,ad=new nt,V$=new nt,R1=new nt;nt.packedLength=4;nt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};nt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new nt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};nt.packedInterpolationLength=3;nt.convertPackedArrayForInterpolation=function(e,t,n,i){nt.unpack(e,n*4,R1),nt.conjugate(R1,R1);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;nt.unpack(e,(t+o)*4,ad),nt.multiply(ad,R1,ad),ad.w<0&&nt.negate(ad,ad),nt.computeAxis(ad,P1);let a=nt.computeAngle(ad);l(i)||(i=[]),i[s]=P1.x*a,i[s+1]=P1.y*a,i[s+2]=P1.z*a}};nt.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new nt),d.fromArray(e,0,u5);let r=d.magnitude(u5);return nt.unpack(t,i*4,V$),r===0?nt.clone(nt.IDENTITY,ad):nt.fromAxisAngle(u5,r,ad),nt.multiply(ad,V$,o)};nt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new nt(e.x,e.y,e.z,e.w)};nt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};nt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};nt.magnitude=function(e){return Math.sqrt(nt.magnitudeSquared(e))};nt.normalize=function(e,t){let n=1/nt.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};nt.inverse=function(e,t){let n=nt.magnitudeSquared(e);return t=nt.conjugate(e,t),nt.multiplyByScalar(t,1/n,t)};nt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};nt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};nt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};nt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};nt.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,h=s*a+i*f+o*u-r*c,p=s*c-i*u+o*f+r*a,_=s*u+i*c-o*a+r*f,m=s*f-i*a-o*c-r*u;return n.x=h,n.y=p,n.z=_,n.w=m,n};nt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};nt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};nt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6||Math.abs(n+1)<P.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};nt.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var f5=new nt;nt.lerp=function(e,t,n,i){return f5=nt.multiplyByScalar(t,n,f5),i=nt.multiplyByScalar(e,1-n,i),nt.add(f5,i,i)};var U$=new nt,d5=new nt,h5=new nt;nt.slerp=function(e,t,n,i){let o=nt.dot(e,t),r=t;if(o<0&&(o=-o,r=U$=nt.negate(t,U$)),1-o<P.EPSILON6)return nt.lerp(e,r,n,i);let s=Math.acos(o);return d5=nt.multiplyByScalar(e,Math.sin((1-n)*s),d5),h5=nt.multiplyByScalar(r,Math.sin(n*s),h5),i=nt.add(d5,h5,i),nt.multiplyByScalar(i,1/Math.sin(s),i)};nt.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),d.multiplyByScalar(e,i,t)};nt.exp=function(e,t){let n=d.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var USe=new d,zSe=new d,zS=new nt,dT=new nt;nt.computeInnerQuadrangle=function(e,t,n,i){let o=nt.conjugate(t,zS);nt.multiply(o,n,dT);let r=nt.log(dT,USe);nt.multiply(o,e,dT);let s=nt.log(dT,zSe);return d.add(r,s,r),d.multiplyByScalar(r,.25,r),d.negate(r,r),nt.exp(r,zS),nt.multiply(t,zS,i)};nt.squad=function(e,t,n,i,o,r){let s=nt.slerp(e,t,o,zS),a=nt.slerp(n,i,o,dT);return nt.slerp(s,a,2*o*(1-o),r)};var HSe=new nt,z$=1.9011074535173003,O1=zt.supportsTypedArrays()?new Float32Array(8):[],M1=zt.supportsTypedArrays()?new Float32Array(8):[],np=zt.supportsTypedArrays()?new Float32Array(8):[],ip=zt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;O1[e]=1/(t*n),M1[e]=t/n}O1[7]=z$/(8*17);M1[7]=z$*8/17;nt.fastSlerp=function(e,t,n,i){let o=nt.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,u=a*a;for(let _=7;_>=0;--_)np[_]=(O1[_]*c-M1[_])*s,ip[_]=(O1[_]*u-M1[_])*s;let f=r*n*(1+np[0]*(1+np[1]*(1+np[2]*(1+np[3]*(1+np[4]*(1+np[5]*(1+np[6]*(1+np[7])))))))),h=a*(1+ip[0]*(1+ip[1]*(1+ip[2]*(1+ip[3]*(1+ip[4]*(1+ip[5]*(1+ip[6]*(1+ip[7])))))))),p=nt.multiplyByScalar(e,h,HSe);return nt.multiplyByScalar(t,f,i),nt.add(p,i,i)};nt.fastSquad=function(e,t,n,i,o,r){let s=nt.fastSlerp(e,t,o,zS),a=nt.fastSlerp(n,i,o,dT);return nt.fastSlerp(s,a,2*o*(1-o),r)};nt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};nt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};nt.ZERO=Object.freeze(new nt(0,0,0,0));nt.IDENTITY=Object.freeze(new nt(0,0,0,1));nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.prototype.equalsEpsilon=function(e,t){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Oe=nt;var ci={},m5={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},hT={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},p5={},ll={east:new d,north:new d,up:new d,west:new d,south:new d,down:new d},Ng=new d,Fg=new d,Bg=new d;ci.localFrameToFixedFrameGenerator=function(e,t){if(!m5.hasOwnProperty(e)||!m5[e].hasOwnProperty(t))throw new he("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=m5[e][t],i,o=e+t;return l(p5[o])?i=p5[o]:(i=function(r,s,a){if(l(a)||(a=new F),d.equalsEpsilon(r,d.ZERO,P.EPSILON14))d.unpack(hT[e],0,Ng),d.unpack(hT[t],0,Fg),d.unpack(hT[n],0,Bg);else if(P.equalsEpsilon(r.x,0,P.EPSILON14)&&P.equalsEpsilon(r.y,0,P.EPSILON14)){let c=P.sign(r.z);d.unpack(hT[e],0,Ng),e!=="east"&&e!=="west"&&d.multiplyByScalar(Ng,c,Ng),d.unpack(hT[t],0,Fg),t!=="east"&&t!=="west"&&d.multiplyByScalar(Fg,c,Fg),d.unpack(hT[n],0,Bg),n!=="east"&&n!=="west"&&d.multiplyByScalar(Bg,c,Bg)}else{s=y(s,ee.default),s.geodeticSurfaceNormal(r,ll.up);let c=ll.up,u=ll.east;u.x=-r.y,u.y=r.x,u.z=0,d.normalize(u,ll.east),d.cross(c,u,ll.north),d.multiplyByScalar(ll.up,-1,ll.down),d.multiplyByScalar(ll.east,-1,ll.west),d.multiplyByScalar(ll.north,-1,ll.south),Ng=ll[e],Fg=ll[t],Bg=ll[n]}return a[0]=Ng.x,a[1]=Ng.y,a[2]=Ng.z,a[3]=0,a[4]=Fg.x,a[5]=Fg.y,a[6]=Fg.z,a[7]=0,a[8]=Bg.x,a[9]=Bg.y,a[10]=Bg.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},p5[o]=i),i};ci.eastNorthUpToFixedFrame=ci.localFrameToFixedFrameGenerator("east","north");ci.northEastDownToFixedFrame=ci.localFrameToFixedFrameGenerator("north","east");ci.northUpEastToFixedFrame=ci.localFrameToFixedFrameGenerator("north","up");ci.northWestUpToFixedFrame=ci.localFrameToFixedFrameGenerator("north","west");var GSe=new Oe,WSe=new d(1,1,1),jSe=new F;ci.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,ci.eastNorthUpToFixedFrame);let r=Oe.fromHeadingPitchRoll(t,GSe),s=F.fromTranslationQuaternionRotationScale(d.ZERO,r,WSe,jSe);return o=i(e,n,o),F.multiply(o,s,o)};var qSe=new F,YSe=new $;ci.headingPitchRollQuaternion=function(e,t,n,i,o){let r=ci.headingPitchRollToFixedFrame(e,t,n,i,qSe),s=F.getMatrix3(r,YSe);return Oe.fromRotationMatrix(s,o)};var XSe=new d(1,1,1),KSe=new d,H$=new F,ZSe=new F,$Se=new $,QSe=new Oe;ci.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,ee.default),n=y(n,ci.eastNorthUpToFixedFrame),l(i)||(i=new Ga);let o=F.getTranslation(e,KSe);if(d.equals(o,d.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=F.inverseTransformation(n(o,t,H$),H$),s=F.setScale(e,XSe,ZSe);s=F.setTranslation(s,d.ZERO,s),r=F.multiply(r,s,r);let a=Oe.fromRotationMatrix(F.getMatrix3(r,$Se),QSe);return a=Oe.normalize(a,a),Ga.fromQuaternion(a,i)};var JSe=6*3600+41*60+50.54841,eve=8640184812866e-6,tve=.093104,nve=-62e-7,ive=11772758384668e-32,ove=72921158553e-15,rve=P.TWO_PI/86400,L1=new Z;ci.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=ci.computeIcrfToFixedMatrix(e,t);return l(n)||(n=ci.computeTemeToPseudoFixedMatrix(e,t)),n};ci.computeTemeToPseudoFixedMatrix=function(e,t){L1=Z.addSeconds(e,-Z.computeTaiMinusUtc(e),L1);let n=L1.dayNumber,i=L1.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/qn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/qn.DAYS_PER_JULIAN_CENTURY;let a=(JSe+o*(eve+o*(tve+o*nve)))*rve%P.TWO_PI,c=ove+ive*(n-24515455e-1),u=(i+qn.SECONDS_PER_DAY*.5)%qn.SECONDS_PER_DAY,f=a+c*u,h=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(h,p,0,-p,h,0,0,0,1)};ci.iau2006XysData=new I1;ci.earthOrientationParameters=v1.NONE;var y5=32.184,sve=2451545;ci.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+y5,i=e.stop.dayNumber,o=e.stop.secondsOfDay+y5;return ci.iau2006XysData.preload(t,n,i,o)};ci.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=ci.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var ave=32.184,cve=2451545,N1=new Ga,lve=new $,uve=new Z;ci.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Z.addSeconds(e,ave,uve),i=Z.totalDays(n)-cve,o=P.toRadians(12.112)-P.toRadians(.052992)*i,r=P.toRadians(24.224)-P.toRadians(.105984)*i,s=P.toRadians(227.645)+P.toRadians(13.012)*i,a=P.toRadians(261.105)+P.toRadians(13.340716)*i,c=P.toRadians(358)+P.toRadians(.9856)*i;return N1.pitch=P.toRadians(180)-P.toRadians(3.878)*Math.sin(o)-P.toRadians(.12)*Math.sin(r)+P.toRadians(.07)*Math.sin(s)-P.toRadians(.017)*Math.sin(a),N1.roll=P.toRadians(66.53-90)+P.toRadians(1.543)*Math.cos(o)+P.toRadians(.24)*Math.cos(r)-P.toRadians(.028)*Math.cos(s)+P.toRadians(.007)*Math.cos(a),N1.heading=P.toRadians(244.375-90)+P.toRadians(13.17635831)*i+P.toRadians(3.558)*Math.sin(o)+P.toRadians(.121)*Math.sin(r)-P.toRadians(.064)*Math.sin(s)+P.toRadians(.016)*Math.sin(a)+P.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(N1,lve)};ci.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=ci.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var fve=new fT(0,0,0),dve=new A0(0,0,0,0,0,0),g5=new $,_5=new $;ci.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=ci.earthOrientationParameters.compute(e,dve);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+y5,r=ci.iau2006XysData.computeXysRadians(i,o,fve);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=g5;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-r.s,_5),h=$.multiply(u,f,g5),p=e.dayNumber,_=e.secondsOfDay-Z.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,x=_/qn.SECONDS_PER_DAY,b=.779057273264+x+.00273781191135448*(m+x);b=b%1*P.TWO_PI;let T=$.fromRotationZ(b,_5),C=$.multiply(h,T,g5),A=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),D=Math.sin(n.yPoleWander),O=i-sve+o/qn.SECONDS_PER_DAY;O/=36525;let R=-47e-6*O*P.RADIANS_PER_DEGREE/3600,M=Math.cos(R),L=Math.sin(R),g=_5;return g[0]=A*M,g[1]=A*L,g[2]=v,g[3]=-S*L+D*v*M,g[4]=S*M+D*v*L,g[5]=-D*A,g[6]=-D*L-S*v*M,g[7]=D*M-S*v*L,g[8]=S*A,$.multiply(C,g,t)};var hve=new oe;ci.pointToWindowCoordinates=function(e,t,n,i){return i=ci.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ci.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let o=hve;return F.multiplyByVector(e,oe.fromElements(n.x,n.y,n.z,1,o),o),oe.multiplyByScalar(o,1/o.w,o),F.multiplyByVector(t,o,o),U.fromCartesian4(o,i)};var mve=new d,pve=new d,gve=new d;ci.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,ee.default).geodeticSurfaceNormal(e,mve),r=d.cross(t,o,pve);d.equalsEpsilon(r,d.ZERO,P.EPSILON6)&&(r=d.clone(d.UNIT_X,r));let s=d.cross(r,t,gve);return d.normalize(s,s),d.cross(t,s,r),d.negate(r,r),d.normalize(r,r),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var G$=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),W$=new fe,x5=new d,_ve=new d,yve=new $,b5=new F,j$=new F;ci.basisTo2D=function(e,t,n){let i=F.getTranslation(t,_ve),o=e.ellipsoid,r;if(d.equals(i,d.ZERO))r=d.clone(d.ZERO,x5);else{let f=o.cartesianToCartographic(i,W$);r=e.project(f,x5),d.fromElements(r.z,r.x,r.y,r)}let s=ci.eastNorthUpToFixedFrame(i,o,b5),a=F.inverseTransformation(s,j$),c=F.getMatrix3(t,yve),u=F.multiplyByMatrix3(a,c,n);return F.multiply(G$,u,n),F.setTranslation(n,r,n),n};ci.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=ci.eastNorthUpToFixedFrame(t,i,b5),r=F.inverseTransformation(o,j$),s=i.cartesianToCartographic(t,W$),a=e.project(s,x5);d.fromElements(a.z,a.x,a.y,a);let c=F.fromTranslation(a,b5);return F.multiply(G$,r,n),F.multiply(c,n,n),n};var Ot=ci;function vn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(vn.prototype,{width:{get:function(){return vn.computeWidth(this)}},height:{get:function(){return vn.computeHeight(this)}}});vn.packedLength=4;vn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};vn.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new vn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};vn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=P.TWO_PI),t-n};vn.computeHeight=function(e){return e.north-e.south};vn.fromDegrees=function(e,t,n,i,o){return e=P.toRadians(y(e,0)),t=P.toRadians(y(t,0)),n=P.toRadians(y(n,0)),i=P.toRadians(y(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new vn(e,t,n,i)};vn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=y(e,0),o.south=y(t,0),o.east=y(n,0),o.north=y(i,0),o):new vn(e,t,n,i)};vn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let h=f.longitude>=0?f.longitude:f.longitude+P.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>P.PI&&(i=i-P.TWO_PI),n>P.PI&&(n=n-P.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new vn(n,s,i,a)};vn.fromCartesianArray=function(e,t,n){t=y(t,ee.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let h=t.cartesianToCartographic(e[u]);i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),a=Math.min(a,h.latitude),c=Math.max(c,h.latitude);let p=h.longitude>=0?h.longitude:h.longitude+P.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>P.PI&&(o=o-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new vn(i,a,o,c)};var xve=new d,bve=new d,Tve=new d,Cve=new d,Ave=new d,T5=new Array(5);for(let e=0;e<T5.length;++e)T5[e]=new d;vn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=ee.default),l(n)||(n=new vn),d.equals(i,d.ZERO))return vn.clone(vn.MAX_VALUE,n),n;let r=Ot.eastNorthUpToFixedFrame(i,t,xve),s=F.multiplyByPointAsVector(r,d.UNIT_X,bve);d.normalize(s,s);let a=F.multiplyByPointAsVector(r,d.UNIT_Y,Tve);d.normalize(a,a),d.multiplyByScalar(a,o,a),d.multiplyByScalar(s,o,s);let c=d.negate(a,Ave),u=d.negate(s,Cve),f=T5,h=f[0];return d.add(i,a,h),h=f[1],d.add(i,u,h),h=f[2],d.add(i,c,h),h=f[3],d.add(i,s,h),f[4]=i,vn.fromCartesianArray(f,t,n)};vn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new vn(e.west,e.south,e.east,e.north)};vn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};vn.prototype.clone=function(e){return vn.clone(this,e)};vn.prototype.equals=function(e){return vn.equals(this,e)};vn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};vn.prototype.equalsEpsilon=function(e,t){return vn.equalsEpsilon(this,e,t)};vn._validate=function(e){};vn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new fe(e.west,e.south)};vn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new fe(e.west,e.north)};vn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new fe(e.east,e.north)};vn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new fe(e.east,e.south)};vn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=P.TWO_PI);let o=P.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new fe(o,r)};vn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.max(o,s)),c=P.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=a,n.south=u,n.east=c,n.north=f,n):new vn(a,u,c,f)};vn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new vn(i,o,r,s)};vn.union=function(e,t,n){l(n)||(n=new vn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=P.TWO_PI:r<s&&i>0&&(r+=P.TWO_PI),i<o&&s<0?s+=P.TWO_PI:r<s&&o<0&&(o+=P.TWO_PI);let a=P.negativePiToPi(Math.min(o,s)),c=P.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};vn.expand=function(e,t,n){return l(n)||(n=new vn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};vn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=P.TWO_PI,n<0&&(n+=P.TWO_PI)),(n>o||P.equalsEpsilon(n,o,P.EPSILON14))&&(n<r||P.equalsEpsilon(n,r,P.EPSILON14))&&i>=e.south&&i<=e.north};var Eve=new fe;vn.subsample=function(e,t,n,i){t=y(t,ee.default),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,u=Eve;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*P.PI_OVER_TWO,vn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};vn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new vn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=P.TWO_PI+e.east-e.west;r.west=P.negativePiToPi(e.west+t*a),r.east=P.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};vn.MAX_VALUE=Object.freeze(new vn(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var se=vn;function vr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}vr.packedLength=4;vr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};vr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new vr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};vr.fromPoints=function(e,t){if(l(t)||(t=new vr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var q$=new Pi,Sve=new fe,vve=new fe;vr.fromRectangle=function(e,t,n){if(l(n)||(n=new vr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;q$._ellipsoid=ee.default,t=y(t,q$);let i=t.project(se.southwest(e,Sve)),o=t.project(se.northeast(e,vve));return U.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};vr.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new vr(e.x,e.y,e.width,e.height)};vr.union=function(e,t,n){l(n)||(n=new vr);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};vr.expand=function(e,t,n){n=vr.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};vr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?Wt.OUTSIDE:Wt.INTERSECTING};vr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};vr.prototype.clone=function(e){return vr.clone(this,e)};vr.prototype.intersect=function(e){return vr.intersect(this,e)};vr.prototype.equals=function(e){return vr.equals(this,e)};var qe=vr;var ba={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};ba.isLines=function(e){return e===ba.LINES||e===ba.LINE_LOOP||e===ba.LINE_STRIP};ba.isTriangles=function(e){return e===ba.TRIANGLES||e===ba.TRIANGLE_STRIP||e===ba.TRIANGLE_FAN};ba.validate=function(e){return e===ba.POINTS||e===ba.LINES||e===ba.LINE_LOOP||e===ba.LINE_STRIP||e===ba.TRIANGLES||e===ba.TRIANGLE_STRIP||e===ba.TRIANGLE_FAN};var Me=Object.freeze(ba);var mT=`in vec4 position; in vec2 textureCoordinates; out vec2 v_textureCoordinates; @@ -87,14 +87,14 @@ void main() gl_Position = position; v_textureCoordinates = textureCoordinates; } -`;var ur={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function VS(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Me.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Ga(e,t){return(e._flags&t)===t}function Bg(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(VS.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return Ga(this,ur.CULL)},set:function(e){Ga(this,ur.CULL)!==e&&(Bg(this,ur.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Ga(this,ur.OCCLUDE)},set:function(e){Ga(this,ur.OCCLUDE)!==e&&(Bg(this,ur.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Ga(this,ur.CAST_SHADOWS)},set:function(e){Ga(this,ur.CAST_SHADOWS)!==e&&(Bg(this,ur.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Ga(this,ur.RECEIVE_SHADOWS)},set:function(e){Ga(this,ur.RECEIVE_SHADOWS)!==e&&(Bg(this,ur.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Ga(this,ur.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Ga(this,ur.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Bg(this,ur.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Ga(this,ur.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Ga(this,ur.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Bg(this,ur.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return Ga(this,ur.PICK_ONLY)},set:function(e){Ga(this,ur.PICK_ONLY)!==e&&(Bg(this,ur.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Ga(this,ur.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Ga(this,ur.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Bg(this,ur.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});VS.shallowClone=function(e,t){if(l(e))return l(t)||(t=new VS),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};VS.prototype.execute=function(e,t){e.draw(this,t)};var $e=VS;var ci={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};ci.toWebGLConstant=function(e,t){switch(e){case ci.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case ci.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case ci.UNSIGNED_INT:return te.UNSIGNED_INT;case ci.FLOAT:return te.FLOAT;case ci.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case ci.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case ci.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case ci.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case ci.UNSIGNED_SHORT_5_6_5:return ci.UNSIGNED_SHORT_5_6_5}};ci.isPacked=function(e){return e===ci.UNSIGNED_INT_24_8||e===ci.UNSIGNED_SHORT_4_4_4_4||e===ci.UNSIGNED_SHORT_5_5_5_1||e===ci.UNSIGNED_SHORT_5_6_5};ci.sizeInBytes=function(e){switch(e){case ci.UNSIGNED_BYTE:return 1;case ci.UNSIGNED_SHORT:case ci.UNSIGNED_SHORT_4_4_4_4:case ci.UNSIGNED_SHORT_5_5_5_1:case ci.UNSIGNED_SHORT_5_6_5:case ci.HALF_FLOAT:return 2;case ci.UNSIGNED_INT:case ci.FLOAT:case ci.UNSIGNED_INT_24_8:return 4}};ci.validate=function(e){return e===ci.UNSIGNED_BYTE||e===ci.UNSIGNED_SHORT||e===ci.UNSIGNED_INT||e===ci.FLOAT||e===ci.HALF_FLOAT||e===ci.UNSIGNED_INT_24_8||e===ci.UNSIGNED_SHORT_4_4_4_4||e===ci.UNSIGNED_SHORT_5_5_5_1||e===ci.UNSIGNED_SHORT_5_6_5};ci.getTypedArrayConstructor=function(e){let t=ci.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===ci.FLOAT?Float32Array:Uint32Array};var Ke=Object.freeze(ci);var rt={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};rt.componentsLength=function(e){switch(e){case rt.RGB:return 3;case rt.RGBA:return 4;case rt.LUMINANCE_ALPHA:case rt.RG:return 2;case rt.ALPHA:case rt.RED:case rt.LUMINANCE:return 1;default:return 1}};rt.validate=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL||e===rt.ALPHA||e===rt.RED||e===rt.RG||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA||e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isColorFormat=function(e){return e===rt.RED||e===rt.ALPHA||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA};rt.isDepthFormat=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL};rt.isCompressedFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isDXTFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5};rt.isPVRTCFormat=function(e){return e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1};rt.isASTCFormat=function(e){return e===rt.RGBA_ASTC};rt.isETC1Format=function(e){return e===rt.RGB_ETC1};rt.isETC2Format=function(e){return e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC};rt.isBC7Format=function(e){return e===rt.RGBA_BC7};rt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case rt.RGB_DXT1:case rt.RGBA_DXT1:case rt.RGB_ETC1:case rt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case rt.RGBA_DXT3:case rt.RGBA_DXT5:case rt.RGBA_ASTC:case rt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case rt.RGB_PVRTC_4BPPV1:case rt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case rt.RGB_PVRTC_2BPPV1:case rt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case rt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};rt.textureSizeInBytes=function(e,t,n,i){let o=rt.componentsLength(e);return Ke.isPacked(t)&&(o=1),o*Ke.sizeInBytes(t)*n*i};rt.alignmentInBytes=function(e,t,n){let i=rt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};rt.createTypedArray=function(e,t,n,i){let o=Ke.getTypedArrayConstructor(t),r=rt.componentsLength(e)*n*i;return new o(r)};rt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=rt.createTypedArray(t,n,i,o),s=rt.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let u=c*i*s,f=(o-c-1)*i*s;for(let h=0;h<a;++h)r[f+h]=e[u+h]}return r};rt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===rt.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===rt.DEPTH_COMPONENT){if(t===Ke.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===Ke.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===Ke.FLOAT)switch(e){case rt.RGBA:return te.RGBA32F;case rt.RGB:return te.RGB32F;case rt.RG:return te.RG32F;case rt.RED:return te.R32F}if(t===Ke.HALF_FLOAT)switch(e){case rt.RGBA:return te.RGBA16F;case rt.RGB:return te.RGB16F;case rt.RG:return te.RG16F;case rt.RED:return te.R16F}return e};var tt=Object.freeze(rt);var fr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(fr,{maximumCombinedTextureImageUnits:{get:function(){return fr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return fr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return fr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return fr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return fr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return fr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return fr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return fr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return fr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return fr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return fr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return fr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return fr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return fr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return fr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return fr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return fr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return fr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return fr._maximumColorAttachments}},maximumSamples:{get:function(){return fr._maximumSamples}},highpFloatSupported:{get:function(){return fr._highpFloatSupported}},highpIntSupported:{get:function(){return fr._highpIntSupported}}});var Bt=fr;function b5(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function O1(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function cd(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Bt.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0),this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;b5(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;O1(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;b5(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;O1(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;O1(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;b5(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;O1(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(cd.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});cd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};cd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};cd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};cd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};cd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};cd.prototype.getColorTexture=function(e){return this._colorTextures[e]};cd.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};cd.prototype.isDestroyed=function(){return!1};cd.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var zr=cd;var M1={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};M1.validate=function(e){return e===M1.CLOCKWISE||e===M1.COUNTER_CLOCKWISE};var gs=Object.freeze(M1);function Y$(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=Y$(e[t]));return Object.freeze(e)}var X$=Y$;function Sh(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),o=y(t.scissorTest,y.EMPTY_OBJECT),r=y(o.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),u=y(t.blending,y.EMPTY_OBJECT),f=y(u.color,y.EMPTY_OBJECT),h=y(t.stencilTest,y.EMPTY_OBJECT),p=y(h.frontOperation,y.EMPTY_OBJECT),_=y(h.backOperation,y.EMPTY_OBJECT),m=y(t.sampleCoverage,y.EMPTY_OBJECT),x=t.viewport;this.frontFace=y(t.frontFace,gs.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,te.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(o.enabled,!1),rectangle:qe.clone(r)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,te.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(u.enabled,!1),color:new z(y(f.red,0),y(f.green,0),y(f.blue,0),y(f.alpha,0)),equationRgb:y(u.equationRgb,te.FUNC_ADD),equationAlpha:y(u.equationAlpha,te.FUNC_ADD),functionSourceRgb:y(u.functionSourceRgb,te.ONE),functionSourceAlpha:y(u.functionSourceAlpha,te.ONE),functionDestinationRgb:y(u.functionDestinationRgb,te.ZERO),functionDestinationAlpha:y(u.functionDestinationAlpha,te.ZERO)},this.stencilTest={enabled:y(h.enabled,!1),frontFunction:y(h.frontFunction,te.ALWAYS),backFunction:y(h.backFunction,te.ALWAYS),reference:y(h.reference,0),mask:y(h.mask,-1),frontOperation:{fail:y(p.fail,te.KEEP),zFail:y(p.zFail,te.KEEP),zPass:y(p.zPass,te.KEEP)},backOperation:{fail:y(_.fail,te.KEEP),zFail:y(_.zFail,te.KEEP),zPass:y(_.zPass,te.KEEP)}},this.sampleCoverage={enabled:y(m.enabled,!1),value:y(m.value,1),invert:y(m.invert,!1)},this.viewport=l(x)?new qe(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var Sve=0,Eh={};Sh.fromCache=function(e){let t=JSON.stringify(e),n=Eh[t];if(l(n))return++n.referenceCount,n.state;let i=new Sh(e),o=JSON.stringify(i);return n=Eh[o],l(n)||(i.id=Sve++,n={referenceCount:0,state:i},Eh[o]=n),++n.referenceCount,Eh[t]={referenceCount:1,state:n.state},n.state};Sh.removeFromCache=function(e){let t=new Sh(e),n=JSON.stringify(t),i=Eh[n],o=JSON.stringify(e),r=Eh[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete Eh[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Eh[n]};Sh.getCache=function(){return Eh};Sh.clearCache=function(){Eh={}};function I0(e,t,n){n?e.enable(t):e.disable(t)}function K$(e,t){e.frontFace(t.frontFace)}function Z$(e,t){let n=t.cull,i=n.enabled;I0(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function $$(e,t){e.lineWidth(t.lineWidth)}function Q$(e,t){let n=t.polygonOffset,i=n.enabled;I0(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function J$(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(I0(e,e.SCISSOR_TEST,o),o){let r=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function eQ(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function tQ(e,t){let n=t.depthTest,i=n.enabled;I0(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function nQ(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function iQ(e,t){e.depthMask(t.depthMask)}function oQ(e,t){e.stencilMask(t.stencilMask)}function vve(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function rQ(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;I0(e,e.BLEND,o),o&&(vve(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function sQ(e,t){let n=t.stencilTest,i=n.enabled;if(I0(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,h=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,h);let p=n.backOperation,_=p.fail,m=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,_,m,x)}}function aQ(e,t){let n=t.sampleCoverage,i=n.enabled;I0(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var wve=new qe;function cQ(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=wve,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Sh.apply=function(e,t,n){K$(e,t),Z$(e,t),$$(e,t),Q$(e,t),eQ(e,t),tQ(e,t),nQ(e,t),iQ(e,t),oQ(e,t),sQ(e,t),aQ(e,t),J$(e,t,n),rQ(e,t,n),cQ(e,t,n)};function Dve(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(K$),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Z$),e.lineWidth!==t.lineWidth&&n.push($$),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Q$),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(eQ),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(tQ),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(nQ),e.depthMask!==t.depthMask&&n.push(iQ),e.stencilMask!==t.stencilMask&&n.push(oQ),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(sQ),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(aQ),n}Sh.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=Dve(t,n),n._applyFunctions[t.id]=f);let h=f.length;for(let p=0;p<h;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&J$(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&rQ(e,n,o),(t!==n||i!==o||i.context!==o.context)&&cQ(e,n,o)};Sh.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:qe.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?qe.clone(e.viewport):void 0}};var Ve=Sh;function Xt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Xt.packedLength=4;Xt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Xt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Xt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Xt.pack(e[o],t,o*4);return t};Xt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Xt.unpack(e,i,t[o])}return t};Xt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Xt(e[0],e[2],e[1],e[3])};Xt.fromArray=Xt.unpack;Xt.fromColumnMajorArray=function(e,t){return Xt.clone(e,t)};Xt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Xt(e[0],e[1],e[2],e[3])};Xt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Xt(e.x,0,0,e.y)};Xt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Xt(e,0,0,e)};Xt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Xt(n,-i,i,n)};Xt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Xt.getElementIndex=function(e,t){return e*2+t};Xt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Xt.setColumn=function(e,t,n,i){i=Xt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Xt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Xt.setRow=function(e,t,n,i){return i=Xt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var Ive=new U;Xt.setScale=function(e,t,n){let i=Xt.getScale(e,Ive),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var Pve=new U;Xt.setUniformScale=function(e,t,n){let i=Xt.getScale(e,Pve),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var lQ=new U;Xt.getScale=function(e,t){return t.x=U.magnitude(U.fromElements(e[0],e[1],lQ)),t.y=U.magnitude(U.fromElements(e[2],e[3],lQ)),t};var uQ=new U;Xt.getMaximumScale=function(e){return Xt.getScale(e,uQ),U.maximumComponent(uQ)};var Rve=new U;Xt.setRotation=function(e,t,n){let i=Xt.getScale(e,Rve);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var Ove=new U;Xt.getRotation=function(e,t){let n=Xt.getScale(e,Ove);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Xt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};Xt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Xt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Xt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};Xt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Xt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Xt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Xt.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};Xt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Xt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Xt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Xt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Xt.IDENTITY=Object.freeze(new Xt(1,0,0,1));Xt.ZERO=Object.freeze(new Xt(0,0,0,0));Xt.COLUMN0ROW0=0;Xt.COLUMN0ROW1=1;Xt.COLUMN1ROW0=2;Xt.COLUMN1ROW1=3;Object.defineProperties(Xt.prototype,{length:{get:function(){return Xt.packedLength}}});Xt.prototype.clone=function(e){return Xt.clone(this,e)};Xt.prototype.equals=function(e){return Xt.equals(this,e)};Xt.prototype.equalsEpsilon=function(e,t){return Xt.equalsEpsilon(this,e,t)};Xt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var Pi=Xt;function Mve(e,t,n,i){switch(t.type){case e.FLOAT:return new fQ(e,t,n,i);case e.FLOAT_VEC2:return new dQ(e,t,n,i);case e.FLOAT_VEC3:return new hQ(e,t,n,i);case e.FLOAT_VEC4:return new mQ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new T5(e,t,n,i);case e.INT:case e.BOOL:return new pQ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new gQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new _Q(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new yQ(e,t,n,i);case e.FLOAT_MAT2:return new xQ(e,t,n,i);case e.FLOAT_MAT3:return new bQ(e,t,n,i);case e.FLOAT_MAT4:return new TQ(e,t,n,i);default:throw new re(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function fQ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}fQ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function dQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}dQ.prototype.set=function(){let e=this.value;U.equals(e,this._value)||(U.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function hQ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}hQ.prototype.set=function(){let e=this.value;l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(d.equals(e,this._value)||(this._value=d.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function mQ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}mQ.prototype.set=function(){let e=this.value;l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(oe.equals(e,this._value)||(this._value=oe.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function T5(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}T5.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};T5.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function pQ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}pQ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function gQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}gQ.prototype.set=function(){let e=this.value;U.equals(e,this._value)||(U.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function _Q(e,t,n,i){this.name=n,this.value=void 0,this._value=new d,this._gl=e,this._location=i}_Q.prototype.set=function(){let e=this.value;d.equals(e,this._value)||(d.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function yQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new oe,this._gl=e,this._location=i}yQ.prototype.set=function(){let e=this.value;oe.equals(e,this._value)||(oe.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var Lve=new Float32Array(4);function xQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new Pi,this._gl=e,this._location=i}xQ.prototype.set=function(){if(!Pi.equalsArray(this.value,this._value,0)){Pi.clone(this.value,this._value);let e=Pi.toArray(this.value,Lve);this._gl.uniformMatrix2fv(this._location,!1,e)}};var Nve=new Float32Array(9);function bQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}bQ.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,Nve);this._gl.uniformMatrix3fv(this._location,!1,e)}};var Fve=new Float32Array(16);function TQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}TQ.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,Fve);this._gl.uniformMatrix4fv(this._location,!1,e)}};var L1=Mve;function Bve(e,t,n,i){switch(t.type){case e.FLOAT:return new CQ(e,t,n,i);case e.FLOAT_VEC2:return new AQ(e,t,n,i);case e.FLOAT_VEC3:return new EQ(e,t,n,i);case e.FLOAT_VEC4:return new SQ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new C5(e,t,n,i);case e.INT:case e.BOOL:return new vQ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new wQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new DQ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new IQ(e,t,n,i);case e.FLOAT_MAT2:return new PQ(e,t,n,i);case e.FLOAT_MAT3:return new RQ(e,t,n,i);case e.FLOAT_MAT4:return new OQ(e,t,n,i);default:throw new re(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function CQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}CQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function AQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}AQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];U.equalsArray(s,n,o)||(U.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function EQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}EQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):l(s.x)&&(d.equalsArray(s,n,o)||(d.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function SQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}SQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0):l(s.x)&&(oe.equalsArray(s,n,o)||(oe.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function C5(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}C5.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};C5.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function vQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}vQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function wQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}wQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];U.equalsArray(s,n,o)||(U.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function DQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}DQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];d.equalsArray(s,n,o)||(d.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function IQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}IQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];oe.equalsArray(s,n,o)||(oe.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function PQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}PQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];Pi.equalsArray(s,n,o)||(Pi.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function RQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}RQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];$.equalsArray(s,n,o)||($.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function OQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}OQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];F.equalsArray(s,n,o)||(F.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var N1=Bve;var kve=0;function ip(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=Vve(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=kve++}ip.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};ip.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(ip.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return F1(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return F1(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return F1(this),this._uniformsByName}}});function MQ(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function Vve(e,t){let n={};if(!Bt.highpFloatSupported||!Bt.highpIntSupported){let i,o,r,s,a=MQ(e),c=MQ(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let h=new RegExp(`${r}\\b`,"g");t=t.replace(h,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var vh="[Cesium WebGL] ";function Uve(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${vh}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${vh}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${vh}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${vh}Shader program link log: ${c}`),h(o,"vertex"),h(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${vh}Vertex shader compile log: ${c}`),console.error(`${vh} Vertex shader source: +`;var ur={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function HS(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Me.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Wa(e,t){return(e._flags&t)===t}function kg(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(HS.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return Wa(this,ur.CULL)},set:function(e){Wa(this,ur.CULL)!==e&&(kg(this,ur.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Wa(this,ur.OCCLUDE)},set:function(e){Wa(this,ur.OCCLUDE)!==e&&(kg(this,ur.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Wa(this,ur.CAST_SHADOWS)},set:function(e){Wa(this,ur.CAST_SHADOWS)!==e&&(kg(this,ur.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Wa(this,ur.RECEIVE_SHADOWS)},set:function(e){Wa(this,ur.RECEIVE_SHADOWS)!==e&&(kg(this,ur.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Wa(this,ur.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Wa(this,ur.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(kg(this,ur.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Wa(this,ur.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Wa(this,ur.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(kg(this,ur.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return Wa(this,ur.PICK_ONLY)},set:function(e){Wa(this,ur.PICK_ONLY)!==e&&(kg(this,ur.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Wa(this,ur.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Wa(this,ur.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(kg(this,ur.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});HS.shallowClone=function(e,t){if(l(e))return l(t)||(t=new HS),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};HS.prototype.execute=function(e,t){e.draw(this,t)};var $e=HS;var li={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};li.toWebGLConstant=function(e,t){switch(e){case li.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case li.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case li.UNSIGNED_INT:return te.UNSIGNED_INT;case li.FLOAT:return te.FLOAT;case li.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case li.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case li.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case li.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case li.UNSIGNED_SHORT_5_6_5:return li.UNSIGNED_SHORT_5_6_5}};li.isPacked=function(e){return e===li.UNSIGNED_INT_24_8||e===li.UNSIGNED_SHORT_4_4_4_4||e===li.UNSIGNED_SHORT_5_5_5_1||e===li.UNSIGNED_SHORT_5_6_5};li.sizeInBytes=function(e){switch(e){case li.UNSIGNED_BYTE:return 1;case li.UNSIGNED_SHORT:case li.UNSIGNED_SHORT_4_4_4_4:case li.UNSIGNED_SHORT_5_5_5_1:case li.UNSIGNED_SHORT_5_6_5:case li.HALF_FLOAT:return 2;case li.UNSIGNED_INT:case li.FLOAT:case li.UNSIGNED_INT_24_8:return 4}};li.validate=function(e){return e===li.UNSIGNED_BYTE||e===li.UNSIGNED_SHORT||e===li.UNSIGNED_INT||e===li.FLOAT||e===li.HALF_FLOAT||e===li.UNSIGNED_INT_24_8||e===li.UNSIGNED_SHORT_4_4_4_4||e===li.UNSIGNED_SHORT_5_5_5_1||e===li.UNSIGNED_SHORT_5_6_5};li.getTypedArrayConstructor=function(e){let t=li.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===li.FLOAT?Float32Array:Uint32Array};var Ke=Object.freeze(li);var ot={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};ot.componentsLength=function(e){switch(e){case ot.RGB:return 3;case ot.RGBA:return 4;case ot.LUMINANCE_ALPHA:case ot.RG:return 2;case ot.ALPHA:case ot.RED:case ot.LUMINANCE:return 1;default:return 1}};ot.validate=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL||e===ot.ALPHA||e===ot.RED||e===ot.RG||e===ot.RGB||e===ot.RGBA||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA||e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isColorFormat=function(e){return e===ot.RED||e===ot.ALPHA||e===ot.RGB||e===ot.RGBA||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA};ot.isDepthFormat=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL};ot.isCompressedFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isDXTFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5};ot.isPVRTCFormat=function(e){return e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1};ot.isASTCFormat=function(e){return e===ot.RGBA_ASTC};ot.isETC1Format=function(e){return e===ot.RGB_ETC1};ot.isETC2Format=function(e){return e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC};ot.isBC7Format=function(e){return e===ot.RGBA_BC7};ot.compressedTextureSizeInBytes=function(e,t,n){switch(e){case ot.RGB_DXT1:case ot.RGBA_DXT1:case ot.RGB_ETC1:case ot.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case ot.RGBA_DXT3:case ot.RGBA_DXT5:case ot.RGBA_ASTC:case ot.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case ot.RGB_PVRTC_4BPPV1:case ot.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case ot.RGB_PVRTC_2BPPV1:case ot.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case ot.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};ot.textureSizeInBytes=function(e,t,n,i){let o=ot.componentsLength(e);return Ke.isPacked(t)&&(o=1),o*Ke.sizeInBytes(t)*n*i};ot.alignmentInBytes=function(e,t,n){let i=ot.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};ot.createTypedArray=function(e,t,n,i){let o=Ke.getTypedArrayConstructor(t),r=ot.componentsLength(e)*n*i;return new o(r)};ot.flipY=function(e,t,n,i,o){if(o===1)return e;let r=ot.createTypedArray(t,n,i,o),s=ot.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let u=c*i*s,f=(o-c-1)*i*s;for(let h=0;h<a;++h)r[f+h]=e[u+h]}return r};ot.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===ot.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===ot.DEPTH_COMPONENT){if(t===Ke.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===Ke.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===Ke.FLOAT)switch(e){case ot.RGBA:return te.RGBA32F;case ot.RGB:return te.RGB32F;case ot.RG:return te.RG32F;case ot.RED:return te.R32F}if(t===Ke.HALF_FLOAT)switch(e){case ot.RGBA:return te.RGBA16F;case ot.RGB:return te.RGB16F;case ot.RG:return te.RG16F;case ot.RED:return te.R16F}return e};var tt=Object.freeze(ot);var fr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(fr,{maximumCombinedTextureImageUnits:{get:function(){return fr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return fr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return fr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return fr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return fr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return fr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return fr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return fr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return fr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return fr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return fr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return fr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return fr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return fr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return fr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return fr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return fr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return fr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return fr._maximumColorAttachments}},maximumSamples:{get:function(){return fr._maximumSamples}},highpFloatSupported:{get:function(){return fr._highpFloatSupported}},highpIntSupported:{get:function(){return fr._highpIntSupported}}});var Ft=fr;function C5(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function F1(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function cd(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Ft.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0),this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;C5(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;F1(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;C5(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;F1(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;F1(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;C5(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;F1(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(cd.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});cd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};cd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};cd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};cd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};cd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};cd.prototype.getColorTexture=function(e){return this._colorTextures[e]};cd.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};cd.prototype.isDestroyed=function(){return!1};cd.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),ue(this)};var zr=cd;var B1={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};B1.validate=function(e){return e===B1.CLOCKWISE||e===B1.COUNTER_CLOCKWISE};var gs=Object.freeze(B1);function Y$(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=Y$(e[t]));return Object.freeze(e)}var X$=Y$;function Sh(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),o=y(t.scissorTest,y.EMPTY_OBJECT),r=y(o.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),u=y(t.blending,y.EMPTY_OBJECT),f=y(u.color,y.EMPTY_OBJECT),h=y(t.stencilTest,y.EMPTY_OBJECT),p=y(h.frontOperation,y.EMPTY_OBJECT),_=y(h.backOperation,y.EMPTY_OBJECT),m=y(t.sampleCoverage,y.EMPTY_OBJECT),x=t.viewport;this.frontFace=y(t.frontFace,gs.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,te.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(o.enabled,!1),rectangle:qe.clone(r)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,te.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(u.enabled,!1),color:new z(y(f.red,0),y(f.green,0),y(f.blue,0),y(f.alpha,0)),equationRgb:y(u.equationRgb,te.FUNC_ADD),equationAlpha:y(u.equationAlpha,te.FUNC_ADD),functionSourceRgb:y(u.functionSourceRgb,te.ONE),functionSourceAlpha:y(u.functionSourceAlpha,te.ONE),functionDestinationRgb:y(u.functionDestinationRgb,te.ZERO),functionDestinationAlpha:y(u.functionDestinationAlpha,te.ZERO)},this.stencilTest={enabled:y(h.enabled,!1),frontFunction:y(h.frontFunction,te.ALWAYS),backFunction:y(h.backFunction,te.ALWAYS),reference:y(h.reference,0),mask:y(h.mask,-1),frontOperation:{fail:y(p.fail,te.KEEP),zFail:y(p.zFail,te.KEEP),zPass:y(p.zPass,te.KEEP)},backOperation:{fail:y(_.fail,te.KEEP),zFail:y(_.zFail,te.KEEP),zPass:y(_.zPass,te.KEEP)}},this.sampleCoverage={enabled:y(m.enabled,!1),value:y(m.value,1),invert:y(m.invert,!1)},this.viewport=l(x)?new qe(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var wve=0,Eh={};Sh.fromCache=function(e){let t=JSON.stringify(e),n=Eh[t];if(l(n))return++n.referenceCount,n.state;let i=new Sh(e),o=JSON.stringify(i);return n=Eh[o],l(n)||(i.id=wve++,n={referenceCount:0,state:i},Eh[o]=n),++n.referenceCount,Eh[t]={referenceCount:1,state:n.state},n.state};Sh.removeFromCache=function(e){let t=new Sh(e),n=JSON.stringify(t),i=Eh[n],o=JSON.stringify(e),r=Eh[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete Eh[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Eh[n]};Sh.getCache=function(){return Eh};Sh.clearCache=function(){Eh={}};function I0(e,t,n){n?e.enable(t):e.disable(t)}function K$(e,t){e.frontFace(t.frontFace)}function Z$(e,t){let n=t.cull,i=n.enabled;I0(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function $$(e,t){e.lineWidth(t.lineWidth)}function Q$(e,t){let n=t.polygonOffset,i=n.enabled;I0(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function J$(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(I0(e,e.SCISSOR_TEST,o),o){let r=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function eQ(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function tQ(e,t){let n=t.depthTest,i=n.enabled;I0(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function nQ(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function iQ(e,t){e.depthMask(t.depthMask)}function oQ(e,t){e.stencilMask(t.stencilMask)}function Dve(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function rQ(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;I0(e,e.BLEND,o),o&&(Dve(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function sQ(e,t){let n=t.stencilTest,i=n.enabled;if(I0(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,h=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,h);let p=n.backOperation,_=p.fail,m=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,_,m,x)}}function aQ(e,t){let n=t.sampleCoverage,i=n.enabled;I0(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var Ive=new qe;function cQ(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=Ive,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Sh.apply=function(e,t,n){K$(e,t),Z$(e,t),$$(e,t),Q$(e,t),eQ(e,t),tQ(e,t),nQ(e,t),iQ(e,t),oQ(e,t),sQ(e,t),aQ(e,t),J$(e,t,n),rQ(e,t,n),cQ(e,t,n)};function Pve(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(K$),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Z$),e.lineWidth!==t.lineWidth&&n.push($$),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Q$),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(eQ),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(tQ),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(nQ),e.depthMask!==t.depthMask&&n.push(iQ),e.stencilMask!==t.stencilMask&&n.push(oQ),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(sQ),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(aQ),n}Sh.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=Pve(t,n),n._applyFunctions[t.id]=f);let h=f.length;for(let p=0;p<h;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&J$(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&rQ(e,n,o),(t!==n||i!==o||i.context!==o.context)&&cQ(e,n,o)};Sh.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:qe.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?qe.clone(e.viewport):void 0}};var Ve=Sh;function Yt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Yt.packedLength=4;Yt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Yt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Yt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Yt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Yt.pack(e[o],t,o*4);return t};Yt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Yt.unpack(e,i,t[o])}return t};Yt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Yt(e[0],e[2],e[1],e[3])};Yt.fromArray=Yt.unpack;Yt.fromColumnMajorArray=function(e,t){return Yt.clone(e,t)};Yt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Yt(e[0],e[1],e[2],e[3])};Yt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Yt(e.x,0,0,e.y)};Yt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Yt(e,0,0,e)};Yt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Yt(n,-i,i,n)};Yt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Yt.getElementIndex=function(e,t){return e*2+t};Yt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Yt.setColumn=function(e,t,n,i){i=Yt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Yt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Yt.setRow=function(e,t,n,i){return i=Yt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var Rve=new U;Yt.setScale=function(e,t,n){let i=Yt.getScale(e,Rve),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var Ove=new U;Yt.setUniformScale=function(e,t,n){let i=Yt.getScale(e,Ove),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var lQ=new U;Yt.getScale=function(e,t){return t.x=U.magnitude(U.fromElements(e[0],e[1],lQ)),t.y=U.magnitude(U.fromElements(e[2],e[3],lQ)),t};var uQ=new U;Yt.getMaximumScale=function(e){return Yt.getScale(e,uQ),U.maximumComponent(uQ)};var Mve=new U;Yt.setRotation=function(e,t,n){let i=Yt.getScale(e,Mve);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var Lve=new U;Yt.getRotation=function(e,t){let n=Yt.getScale(e,Lve);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Yt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};Yt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Yt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Yt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};Yt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Yt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Yt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Yt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Yt.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};Yt.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Yt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Yt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Yt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Yt.IDENTITY=Object.freeze(new Yt(1,0,0,1));Yt.ZERO=Object.freeze(new Yt(0,0,0,0));Yt.COLUMN0ROW0=0;Yt.COLUMN0ROW1=1;Yt.COLUMN1ROW0=2;Yt.COLUMN1ROW1=3;Object.defineProperties(Yt.prototype,{length:{get:function(){return Yt.packedLength}}});Yt.prototype.clone=function(e){return Yt.clone(this,e)};Yt.prototype.equals=function(e){return Yt.equals(this,e)};Yt.prototype.equalsEpsilon=function(e,t){return Yt.equalsEpsilon(this,e,t)};Yt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) +(${this[1]}, ${this[3]})`};var Ri=Yt;function Nve(e,t,n,i){switch(t.type){case e.FLOAT:return new fQ(e,t,n,i);case e.FLOAT_VEC2:return new dQ(e,t,n,i);case e.FLOAT_VEC3:return new hQ(e,t,n,i);case e.FLOAT_VEC4:return new mQ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new A5(e,t,n,i);case e.INT:case e.BOOL:return new pQ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new gQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new _Q(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new yQ(e,t,n,i);case e.FLOAT_MAT2:return new xQ(e,t,n,i);case e.FLOAT_MAT3:return new bQ(e,t,n,i);case e.FLOAT_MAT4:return new TQ(e,t,n,i);default:throw new re(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function fQ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}fQ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function dQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}dQ.prototype.set=function(){let e=this.value;U.equals(e,this._value)||(U.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function hQ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}hQ.prototype.set=function(){let e=this.value;l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(d.equals(e,this._value)||(this._value=d.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function mQ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}mQ.prototype.set=function(){let e=this.value;l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(oe.equals(e,this._value)||(this._value=oe.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function A5(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}A5.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};A5.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function pQ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}pQ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function gQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}gQ.prototype.set=function(){let e=this.value;U.equals(e,this._value)||(U.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function _Q(e,t,n,i){this.name=n,this.value=void 0,this._value=new d,this._gl=e,this._location=i}_Q.prototype.set=function(){let e=this.value;d.equals(e,this._value)||(d.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function yQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new oe,this._gl=e,this._location=i}yQ.prototype.set=function(){let e=this.value;oe.equals(e,this._value)||(oe.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var Fve=new Float32Array(4);function xQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new Ri,this._gl=e,this._location=i}xQ.prototype.set=function(){if(!Ri.equalsArray(this.value,this._value,0)){Ri.clone(this.value,this._value);let e=Ri.toArray(this.value,Fve);this._gl.uniformMatrix2fv(this._location,!1,e)}};var Bve=new Float32Array(9);function bQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}bQ.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,Bve);this._gl.uniformMatrix3fv(this._location,!1,e)}};var kve=new Float32Array(16);function TQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}TQ.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,kve);this._gl.uniformMatrix4fv(this._location,!1,e)}};var k1=Nve;function Vve(e,t,n,i){switch(t.type){case e.FLOAT:return new CQ(e,t,n,i);case e.FLOAT_VEC2:return new AQ(e,t,n,i);case e.FLOAT_VEC3:return new EQ(e,t,n,i);case e.FLOAT_VEC4:return new SQ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new E5(e,t,n,i);case e.INT:case e.BOOL:return new vQ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new wQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new DQ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new IQ(e,t,n,i);case e.FLOAT_MAT2:return new PQ(e,t,n,i);case e.FLOAT_MAT3:return new RQ(e,t,n,i);case e.FLOAT_MAT4:return new OQ(e,t,n,i);default:throw new re(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function CQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}CQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function AQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}AQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];U.equalsArray(s,n,o)||(U.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function EQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}EQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):l(s.x)&&(d.equalsArray(s,n,o)||(d.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function SQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}SQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0):l(s.x)&&(oe.equalsArray(s,n,o)||(oe.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function E5(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}E5.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};E5.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function vQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}vQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function wQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}wQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];U.equalsArray(s,n,o)||(U.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function DQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}DQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];d.equalsArray(s,n,o)||(d.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function IQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}IQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];oe.equalsArray(s,n,o)||(oe.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function PQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}PQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];Ri.equalsArray(s,n,o)||(Ri.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function RQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}RQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];$.equalsArray(s,n,o)||($.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function OQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}OQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];F.equalsArray(s,n,o)||(F.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var V1=Vve;var Uve=0;function op(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=zve(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=Uve++}op.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};op.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(op.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return U1(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return U1(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return U1(this),this._uniformsByName}}});function MQ(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function zve(e,t){let n={};if(!Ft.highpFloatSupported||!Ft.highpIntSupported){let i,o,r,s,a=MQ(e),c=MQ(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let h=new RegExp(`${r}\\b`,"g");t=t.replace(h,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var vh="[Cesium WebGL] ";function Hve(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${vh}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${vh}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${vh}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${vh}Shader program link log: ${c}`),h(o,"vertex"),h(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${vh}Vertex shader compile log: ${c}`),console.error(`${vh} Vertex shader source: ${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${vh}Fragment shader compile log: ${c}`),console.error(`${vh} Fragment shader source: ${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new re(u);function h(p,_){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${vh}${_} shader translation failed.`);return}console.error(`${vh}Translated ${_} shaderSource: -${m}`)}}function zve(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function Hve(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let h=L1(e,a,u,f);n[u]=h,i.push(h),h._setSampler&&o.push(h)}}else{let f,h,p,_,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;h=f._locations,h.length<=1&&(p=f.value,_=e.getUniformLocation(t,u),_!==null&&(h.push(_),p.push(e.getUniform(t,_))))}else{h=[];for(let x=0;x<a.size;++x)_=e.getUniformLocation(t,`${u}[${x}]`),_!==null&&h.push(_);f=N1(e,a,u,h),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function Gve(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];l(a)&&(r.name=a,s=a);let c=Ig[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function Wve(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function F1(e){l(e._program)||LQ(e)}function LQ(e){let t=e._program,n=e._gl,i=Uve(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=Hve(n,i),s=Gve(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=zve(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=Wve(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let h=e._vertexShaderText,p=e._fragmentShaderText,_=/ ! = /g;e._vertexShaderText=a.replace(_," != "),e._fragmentShaderText=c.replace(_," != ");try{LQ(e),u(e._program)}catch(m){e._vertexShaderText=h,e._fragmentShaderText=p;let b=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(b?b[1]:m.message)}})}ip.prototype._bind=function(){F1(this),this._gl.useProgram(this._program)};ip.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};ip.prototype.isDestroyed=function(){return!1};ip.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};ip.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var en=ip;function B1(e){this._context=e}var US,jve=new $e({primitiveType:Me.TRIANGLES}),qve=new ei({color:new z(0,0,0,0)});function Yve(e,t){return new zr({context:e,colorTextures:[t],destroyAttachments:!1})}function Xve(e,t){return en.fromCache({context:e,vertexShaderSource:mT,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function Kve(e,t){return(!l(US)||US.viewport.width!==e||US.viewport.height!==t)&&(US=Ve.fromCache({viewport:new qe(0,0,e,t)})),US}B1.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:Xve(o,e.fragmentShaderSource),a=Yve(o,t),c=Kve(n,i),u=e.uniformMap,f=qve;f.framebuffer=a,f.renderState=c,f.execute(o);let h=jve;h.vertexArray=r,h.renderState=c,h.shaderProgram=s,h.uniformMap=u,h.framebuffer=a,h.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};B1.prototype.isDestroyed=function(){return!1};B1.prototype.destroy=function(){return ue(this)};var k1=B1;var Cn={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};Cn.getSizeInBytes=function(e){switch(e){case Cn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Cn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Cn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Cn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Cn.INT:return Int32Array.BYTES_PER_ELEMENT;case Cn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Cn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Cn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Cn.fromTypedArray=function(e){if(e instanceof Int8Array)return Cn.BYTE;if(e instanceof Uint8Array)return Cn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Cn.SHORT;if(e instanceof Uint16Array)return Cn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Cn.INT;if(e instanceof Uint32Array)return Cn.UNSIGNED_INT;if(e instanceof Float32Array)return Cn.FLOAT;if(e instanceof Float64Array)return Cn.DOUBLE};Cn.validate=function(e){return l(e)&&(e===Cn.BYTE||e===Cn.UNSIGNED_BYTE||e===Cn.SHORT||e===Cn.UNSIGNED_SHORT||e===Cn.INT||e===Cn.UNSIGNED_INT||e===Cn.FLOAT||e===Cn.DOUBLE)};Cn.createTypedArray=function(e,t){switch(e){case Cn.BYTE:return new Int8Array(t);case Cn.UNSIGNED_BYTE:return new Uint8Array(t);case Cn.SHORT:return new Int16Array(t);case Cn.UNSIGNED_SHORT:return new Uint16Array(t);case Cn.INT:return new Int32Array(t);case Cn.UNSIGNED_INT:return new Uint32Array(t);case Cn.FLOAT:return new Float32Array(t);case Cn.DOUBLE:return new Float64Array(t)}};Cn.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/Cn.getSizeInBytes(e)),e){case Cn.BYTE:return new Int8Array(t,n,i);case Cn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Cn.SHORT:return new Int16Array(t,n,i);case Cn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Cn.INT:return new Int32Array(t,n,i);case Cn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Cn.FLOAT:return new Float32Array(t,n,i);case Cn.DOUBLE:return new Float64Array(t,n,i)}};Cn.fromName=function(e){switch(e){case"BYTE":return Cn.BYTE;case"UNSIGNED_BYTE":return Cn.UNSIGNED_BYTE;case"SHORT":return Cn.SHORT;case"UNSIGNED_SHORT":return Cn.UNSIGNED_SHORT;case"INT":return Cn.INT;case"UNSIGNED_INT":return Cn.UNSIGNED_INT;case"FLOAT":return Cn.FLOAT;case"DOUBLE":return Cn.DOUBLE}};var X=Object.freeze(Cn);var NQ={};function zS(e,t){l(NQ[e])||(NQ[e]=!0,console.warn(y(t,e)))}zS.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";zS.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";zS.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";zS.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var xt=zS;function Zve(e,t){xt(e,t)}var _s=Zve;var $ve={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},ld=Object.freeze($ve);function A5(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Me.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,ld.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}A5.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var Qve=new fe,Jve=new d,FQ=new F,ewe=[new fe,new fe,new fe],twe=[new U,new U,new U],nwe=[new U,new U,new U],iwe=new d,owe=new Oe,rwe=new F,swe=new Pi;A5._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=se.center(i,Qve),s=fe.toCartesian(r,n,Jve),a=Mt.eastNorthUpToFixedFrame(s,n,FQ),c=F.inverse(a,FQ),u=twe,f=ewe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let h=iwe;for(o=0;o<3;o++)fe.toCartesian(f[o],n,h),h=F.multiplyByPointAsVector(c,h,h),u[o].x=h.x,u[o].y=h.y;let p=Oe.fromAxisAngle(d.UNIT_Z,-t,owe),_=$.fromQuaternion(p,rwe),m=e.length,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)h=F.multiplyByPointAsVector(c,e[o],h),h=$.multiplyByVector(_,h,h),x=Math.min(x,h.x),b=Math.min(b,h.y),T=Math.max(T,h.x),C=Math.max(C,h.y);let A=Pi.fromRotation(t,swe),S=nwe;S[0].x=x,S[0].y=b,S[1].x=x,S[1].y=C,S[2].x=T,S[2].y=b;let v=u[0],D=u[2].x-v.x,O=u[1].y-v.y;for(o=0;o<3;o++){let E=S[o];Pi.multiplyByVector(A,E,E),E.x=(E.x-v.x)/D,E.y=(E.y-v.y)/O}let R=S[0],M=S[1],L=S[2],g=new Array(6);return U.pack(R,g),U.pack(M,g,2),U.pack(L,g,4),g};var at=A5;function awe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var ve=awe;function pT(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(pT.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});pT.clone=function(e){if(l(e))return new pT(e._format,e._datatype,e._width,e._height,e._buffer)};pT.prototype.clone=function(){return pT.clone(this)};var V1=pT;var BQ=Ur(Hl(),1);function kQ(){if(!l(Ks._canTransferArrayBuffer)){let e=v5("transferTypedArrayTest");e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Ks._canTransferArrayBuffer=!1,Ks._canTransferArrayBuffer}Ks._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),Ks._canTransferArrayBuffer=s}})}return Ks._canTransferArrayBuffer}var S5=new me;function E5(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function v5(e){let t=new BQ.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(E0(e))s=e;else if(!n){let a=nn(`${Ks._workerModulePrefix}/${i}.js`);E0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=E5(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${E5(CESIUM_WORKERS)}"); +${m}`)}}function Gve(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function Wve(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let h=k1(e,a,u,f);n[u]=h,i.push(h),h._setSampler&&o.push(h)}}else{let f,h,p,_,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;h=f._locations,h.length<=1&&(p=f.value,_=e.getUniformLocation(t,u),_!==null&&(h.push(_),p.push(e.getUniform(t,_))))}else{h=[];for(let x=0;x<a.size;++x)_=e.getUniformLocation(t,`${u}[${x}]`),_!==null&&h.push(_);f=V1(e,a,u,h),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function jve(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];l(a)&&(r.name=a,s=a);let c=Pg[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function qve(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function U1(e){l(e._program)||LQ(e)}function LQ(e){let t=e._program,n=e._gl,i=Hve(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=Wve(n,i),s=jve(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=Gve(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=qve(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let h=e._vertexShaderText,p=e._fragmentShaderText,_=/ ! = /g;e._vertexShaderText=a.replace(_," != "),e._fragmentShaderText=c.replace(_," != ");try{LQ(e),u(e._program)}catch(m){e._vertexShaderText=h,e._fragmentShaderText=p;let b=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(b?b[1]:m.message)}})}op.prototype._bind=function(){U1(this),this._gl.useProgram(this._program)};op.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};op.prototype.isDestroyed=function(){return!1};op.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};op.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Qt=op;function z1(e){this._context=e}var GS,Yve=new $e({primitiveType:Me.TRIANGLES}),Xve=new ti({color:new z(0,0,0,0)});function Kve(e,t){return new zr({context:e,colorTextures:[t],destroyAttachments:!1})}function Zve(e,t){return Qt.fromCache({context:e,vertexShaderSource:mT,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function $ve(e,t){return(!l(GS)||GS.viewport.width!==e||GS.viewport.height!==t)&&(GS=Ve.fromCache({viewport:new qe(0,0,e,t)})),GS}z1.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:Zve(o,e.fragmentShaderSource),a=Kve(o,t),c=$ve(n,i),u=e.uniformMap,f=Xve;f.framebuffer=a,f.renderState=c,f.execute(o);let h=Yve;h.vertexArray=r,h.renderState=c,h.shaderProgram=s,h.uniformMap=u,h.framebuffer=a,h.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};z1.prototype.isDestroyed=function(){return!1};z1.prototype.destroy=function(){return ue(this)};var H1=z1;var Cn={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};Cn.getSizeInBytes=function(e){switch(e){case Cn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Cn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Cn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Cn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Cn.INT:return Int32Array.BYTES_PER_ELEMENT;case Cn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Cn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Cn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Cn.fromTypedArray=function(e){if(e instanceof Int8Array)return Cn.BYTE;if(e instanceof Uint8Array)return Cn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Cn.SHORT;if(e instanceof Uint16Array)return Cn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Cn.INT;if(e instanceof Uint32Array)return Cn.UNSIGNED_INT;if(e instanceof Float32Array)return Cn.FLOAT;if(e instanceof Float64Array)return Cn.DOUBLE};Cn.validate=function(e){return l(e)&&(e===Cn.BYTE||e===Cn.UNSIGNED_BYTE||e===Cn.SHORT||e===Cn.UNSIGNED_SHORT||e===Cn.INT||e===Cn.UNSIGNED_INT||e===Cn.FLOAT||e===Cn.DOUBLE)};Cn.createTypedArray=function(e,t){switch(e){case Cn.BYTE:return new Int8Array(t);case Cn.UNSIGNED_BYTE:return new Uint8Array(t);case Cn.SHORT:return new Int16Array(t);case Cn.UNSIGNED_SHORT:return new Uint16Array(t);case Cn.INT:return new Int32Array(t);case Cn.UNSIGNED_INT:return new Uint32Array(t);case Cn.FLOAT:return new Float32Array(t);case Cn.DOUBLE:return new Float64Array(t)}};Cn.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/Cn.getSizeInBytes(e)),e){case Cn.BYTE:return new Int8Array(t,n,i);case Cn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Cn.SHORT:return new Int16Array(t,n,i);case Cn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Cn.INT:return new Int32Array(t,n,i);case Cn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Cn.FLOAT:return new Float32Array(t,n,i);case Cn.DOUBLE:return new Float64Array(t,n,i)}};Cn.fromName=function(e){switch(e){case"BYTE":return Cn.BYTE;case"UNSIGNED_BYTE":return Cn.UNSIGNED_BYTE;case"SHORT":return Cn.SHORT;case"UNSIGNED_SHORT":return Cn.UNSIGNED_SHORT;case"INT":return Cn.INT;case"UNSIGNED_INT":return Cn.UNSIGNED_INT;case"FLOAT":return Cn.FLOAT;case"DOUBLE":return Cn.DOUBLE}};var X=Object.freeze(Cn);var NQ={};function WS(e,t){l(NQ[e])||(NQ[e]=!0,console.warn(y(t,e)))}WS.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";WS.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";WS.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";WS.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var yt=WS;function Qve(e,t){yt(e,t)}var _s=Qve;var Jve={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},ld=Object.freeze(Jve);function S5(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Me.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,ld.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}S5.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var ewe=new fe,twe=new d,FQ=new F,nwe=[new fe,new fe,new fe],iwe=[new U,new U,new U],owe=[new U,new U,new U],rwe=new d,swe=new Oe,awe=new F,cwe=new Ri;S5._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=se.center(i,ewe),s=fe.toCartesian(r,n,twe),a=Ot.eastNorthUpToFixedFrame(s,n,FQ),c=F.inverse(a,FQ),u=iwe,f=nwe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let h=rwe;for(o=0;o<3;o++)fe.toCartesian(f[o],n,h),h=F.multiplyByPointAsVector(c,h,h),u[o].x=h.x,u[o].y=h.y;let p=Oe.fromAxisAngle(d.UNIT_Z,-t,swe),_=$.fromQuaternion(p,awe),m=e.length,x=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)h=F.multiplyByPointAsVector(c,e[o],h),h=$.multiplyByVector(_,h,h),x=Math.min(x,h.x),b=Math.min(b,h.y),T=Math.max(T,h.x),C=Math.max(C,h.y);let A=Ri.fromRotation(t,cwe),S=owe;S[0].x=x,S[0].y=b,S[1].x=x,S[1].y=C,S[2].x=T,S[2].y=b;let v=u[0],D=u[2].x-v.x,O=u[1].y-v.y;for(o=0;o<3;o++){let E=S[o];Ri.multiplyByVector(A,E,E),E.x=(E.x-v.x)/D,E.y=(E.y-v.y)/O}let R=S[0],M=S[1],L=S[2],g=new Array(6);return U.pack(R,g),U.pack(M,g,2),U.pack(L,g,4),g};var st=S5;function lwe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var ve=lwe;function pT(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(pT.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});pT.clone=function(e){if(l(e))return new pT(e._format,e._datatype,e._width,e._height,e._buffer)};pT.prototype.clone=function(){return pT.clone(this)};var G1=pT;var BQ=Ur(Wl(),1);function kQ(){if(!l($s._canTransferArrayBuffer)){let e=D5("transferTypedArrayTest");e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return $s._canTransferArrayBuffer=!1,$s._canTransferArrayBuffer}$s._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),$s._canTransferArrayBuffer=s}})}return $s._canTransferArrayBuffer}var w5=new pe;function v5(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function D5(e){let t=new BQ.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(E0(e))s=e;else if(!n){let a=en(`${$s._workerModulePrefix}/${i}.js`);E0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=v5(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` + importScripts("${v5(CESIUM_WORKERS)}"); CesiumWorkers["${i}"](); - `;return r=E5(a),new Worker(r,o)}if(r=e,n||(r=nn(`${Ks._workerModulePrefix+i}.js`)),!Ht.supportsEsmWebWorkers())throw new re("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function cwe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ht.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new re(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=nn(t.fallbackModulePath),n}n.wasmBinaryFile=nn(t.wasmBinaryFile);let i=await Se.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function Ks(e,t){this._workerPath=e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var lwe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new re(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new he(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),S5.raiseEvent(s),i(s)}else S5.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},uwe=[];async function fwe(e,t,n){let i=await Promise.resolve(kQ());l(n)?i||(n.length=0):n=uwe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",lwe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:nn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function dwe(e,t,n){++e._activeTasks;try{let i=await fwe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Ks.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=v5(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return dwe(this,e,t)};Ks.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=v5(this._workerPath),i=await cwe(this,e),o=await Promise.resolve(kQ()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new re("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};Ks.prototype.isDestroyed=function(){return!1};Ks.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};Ks.taskCompletedEvent=S5;Ks._defaultWorkerModulePrefix="Workers/";Ks._workerModulePrefix=Ks._defaultWorkerModulePrefix;Ks._canTransferArrayBuffer=void 0;var _i=Ks;function op(){}op._transcodeTaskProcessor=new _i("transcodeKTX2",Number.POSITIVE_INFINITY);op._readyPromise=void 0;function hwe(){let e=op._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return op._transcodeTaskProcessor;throw new re("KTX2 transcoder could not be initialized.")});op._readyPromise=e}op.transcode=function(e,t){return l(op._readyPromise)||hwe(),op._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;r<i;r++){let s=n[r];for(let a=0;a<o.length;a++){let c=s[o[a]];s[o[a]]=new V1(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)n[r]=n[r][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var U1=op;var VQ;UQ.setKTX2SupportedFormats=function(e,t,n,i,o,r){VQ={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function UQ(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Se.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return U1.transcode(n,VQ)})}var Wl=UQ;function mwe(e,t){this.start=y(e,0),this.stop=y(t,0)}var Wa=mwe;function dn(e,t){this.center=d.clone(y(e,d.ZERO)),this.radius=y(t,0)}var I5=new d,P5=new d,R5=new d,O5=new d,M5=new d,L5=new d,N5=new d,Zs=new d,F5=new d,B5=new d,k5=new d,V5=new d,pwe=4/3*P.PI;dn.fromPoints=function(e,t){if(l(t)||(t=new dn),!l(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=d.clone(e[0],N5),i=d.clone(n,I5),o=d.clone(n,P5),r=d.clone(n,R5),s=d.clone(n,O5),a=d.clone(n,M5),c=d.clone(n,L5),u=e.length,f;for(f=1;f<u;f++){d.clone(e[f],n);let R=n.x,M=n.y,L=n.z;R<i.x&&d.clone(n,i),R>s.x&&d.clone(n,s),M<o.y&&d.clone(n,o),M>a.y&&d.clone(n,a),L<r.z&&d.clone(n,r),L>c.z&&d.clone(n,c)}let h=d.magnitudeSquared(d.subtract(s,i,Zs)),p=d.magnitudeSquared(d.subtract(a,o,Zs)),_=d.magnitudeSquared(d.subtract(c,r,Zs)),m=i,x=s,b=h;p>b&&(b=p,m=o,x=a),_>b&&(b=_,m=r,x=c);let T=F5;T.x=(m.x+x.x)*.5,T.y=(m.y+x.y)*.5,T.z=(m.z+x.z)*.5;let C=d.magnitudeSquared(d.subtract(x,T,Zs)),A=Math.sqrt(C),S=B5;S.x=i.x,S.y=o.y,S.z=r.z;let v=k5;v.x=s.x,v.y=a.y,v.z=c.z;let D=d.midpoint(S,v,V5),O=0;for(f=0;f<u;f++){d.clone(e[f],n);let R=d.magnitude(d.subtract(n,D,Zs));R>O&&(O=R);let M=d.magnitudeSquared(d.subtract(n,T,Zs));if(M>C){let L=Math.sqrt(M);A=(A+L)*.5,C=A*A;let g=L-A;T.x=(A*T.x+g*n.x)/L,T.y=(A*T.y+g*n.y)/L,T.z=(A*T.z+g*n.z)/L}}return A<O?(d.clone(T,t.center),t.radius=A):(d.clone(D,t.center),t.radius=O),t};var zQ=new Ii,gwe=new d,_we=new d,w5=new fe,D5=new fe;dn.fromRectangle2D=function(e,t,n){return dn.fromRectangleWithHeights2D(e,t,0,0,n)};dn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new dn),!l(e))return o.center=d.clone(d.ZERO,o.center),o.radius=0,o;zQ._ellipsoid=ee.default,t=y(t,zQ),se.southwest(e,w5),w5.height=n,se.northeast(e,D5),D5.height=i;let r=t.project(w5,gwe),s=t.project(D5,_we),a=s.x-r.x,c=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+c*.5,f.z=r.z+u*.5,o};var ywe=[];dn.fromRectangle3D=function(e,t,n,i){if(t=y(t,ee.default),n=y(n,0),l(i)||(i=new dn),!l(e))return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;let o=se.subsample(e,t,n,ywe);return dn.fromPoints(o,i)};dn.fromVertices=function(e,t,n,i){if(l(i)||(i=new dn),!l(e)||e.length===0)return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;t=y(t,d.ZERO),n=y(n,3);let o=N5;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=d.clone(o,I5),s=d.clone(o,P5),a=d.clone(o,R5),c=d.clone(o,O5),u=d.clone(o,M5),f=d.clone(o,L5),h=e.length,p;for(p=0;p<h;p+=n){let L=e[p]+t.x,g=e[p+1]+t.y,E=e[p+2]+t.z;o.x=L,o.y=g,o.z=E,L<r.x&&d.clone(o,r),L>c.x&&d.clone(o,c),g<s.y&&d.clone(o,s),g>u.y&&d.clone(o,u),E<a.z&&d.clone(o,a),E>f.z&&d.clone(o,f)}let _=d.magnitudeSquared(d.subtract(c,r,Zs)),m=d.magnitudeSquared(d.subtract(u,s,Zs)),x=d.magnitudeSquared(d.subtract(f,a,Zs)),b=r,T=c,C=_;m>C&&(C=m,b=s,T=u),x>C&&(C=x,b=a,T=f);let A=F5;A.x=(b.x+T.x)*.5,A.y=(b.y+T.y)*.5,A.z=(b.z+T.z)*.5;let S=d.magnitudeSquared(d.subtract(T,A,Zs)),v=Math.sqrt(S),D=B5;D.x=r.x,D.y=s.y,D.z=a.z;let O=k5;O.x=c.x,O.y=u.y,O.z=f.z;let R=d.midpoint(D,O,V5),M=0;for(p=0;p<h;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let L=d.magnitude(d.subtract(o,R,Zs));L>M&&(M=L);let g=d.magnitudeSquared(d.subtract(o,A,Zs));if(g>S){let E=Math.sqrt(g);v=(v+E)*.5,S=v*v;let w=E-v;A.x=(v*A.x+w*o.x)/E,A.y=(v*A.y+w*o.y)/E,A.z=(v*A.z+w*o.z)/E}}return v<M?(d.clone(A,i.center),i.radius=v):(d.clone(R,i.center),i.radius=M),i};dn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new dn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=d.clone(d.ZERO,n.center),n.radius=0,n;let i=N5;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=d.clone(i,I5),r=d.clone(i,P5),s=d.clone(i,R5),a=d.clone(i,O5),c=d.clone(i,M5),u=d.clone(i,L5),f=e.length,h;for(h=0;h<f;h+=3){let M=e[h]+t[h],L=e[h+1]+t[h+1],g=e[h+2]+t[h+2];i.x=M,i.y=L,i.z=g,M<o.x&&d.clone(i,o),M>a.x&&d.clone(i,a),L<r.y&&d.clone(i,r),L>c.y&&d.clone(i,c),g<s.z&&d.clone(i,s),g>u.z&&d.clone(i,u)}let p=d.magnitudeSquared(d.subtract(a,o,Zs)),_=d.magnitudeSquared(d.subtract(c,r,Zs)),m=d.magnitudeSquared(d.subtract(u,s,Zs)),x=o,b=a,T=p;_>T&&(T=_,x=r,b=c),m>T&&(T=m,x=s,b=u);let C=F5;C.x=(x.x+b.x)*.5,C.y=(x.y+b.y)*.5,C.z=(x.z+b.z)*.5;let A=d.magnitudeSquared(d.subtract(b,C,Zs)),S=Math.sqrt(A),v=B5;v.x=o.x,v.y=r.y,v.z=s.z;let D=k5;D.x=a.x,D.y=c.y,D.z=u.z;let O=d.midpoint(v,D,V5),R=0;for(h=0;h<f;h+=3){i.x=e[h]+t[h],i.y=e[h+1]+t[h+1],i.z=e[h+2]+t[h+2];let M=d.magnitude(d.subtract(i,O,Zs));M>R&&(R=M);let L=d.magnitudeSquared(d.subtract(i,C,Zs));if(L>A){let g=Math.sqrt(L);S=(S+g)*.5,A=S*S;let E=g-S;C.x=(S*C.x+E*i.x)/g,C.y=(S*C.y+E*i.y)/g,C.z=(S*C.z+E*i.z)/g}}return S<R?(d.clone(C,n.center),n.radius=S):(d.clone(O,n.center),n.radius=R),n};dn.fromCornerPoints=function(e,t,n){l(n)||(n=new dn);let i=d.midpoint(e,t,n.center);return n.radius=d.distance(i,t),n};dn.fromEllipsoid=function(e,t){return l(t)||(t=new dn),d.clone(d.ZERO,t.center),t.radius=e.maximumRadius,t};var xwe=new d;dn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new dn),!l(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return dn.clone(e[0],t);if(n===2)return dn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=dn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,d.distance(r,a.center,xwe)+a.radius)}return t.radius=s,t};var bwe=new d,Twe=new d,Cwe=new d;dn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new dn);let n=e.halfAxes,i=$.getColumn(n,0,bwe),o=$.getColumn(n,1,Twe),r=$.getColumn(n,2,Cwe);return d.add(i,o,i),d.add(i,r,i),t.center=d.clone(e.center,t.center),t.radius=d.magnitude(i),t};var Awe=new d,Ewe=new d;dn.fromTransformation=function(e,t){l(t)||(t=new dn);let n=F.getTranslation(e,Awe),i=F.getScale(e,Ewe),o=.5*d.magnitude(i);return t.center=d.clone(n,t.center),t.radius=o,t};dn.clone=function(e,t){if(l(e))return l(t)?(t.center=d.clone(e.center,t.center),t.radius=e.radius,t):new dn(e.center,e.radius)};dn.packedLength=4;dn.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};dn.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new dn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var Swe=new d,vwe=new d;dn.union=function(e,t,n){l(n)||(n=new dn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=d.subtract(r,i,Swe),c=d.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,f=d.multiplyByScalar(a,(-o+u)/c,vwe);return d.add(f,i,f),d.clone(f,n.center),n.radius=u,n};var wwe=new d;dn.expand=function(e,t,n){n=dn.clone(e,n);let i=d.magnitude(d.subtract(t,n.center,wwe));return i>n.radius&&(n.radius=i),n};dn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=d.dot(o,n)+t.distance;return r<-i?jt.OUTSIDE:r<i?jt.INTERSECTING:jt.INSIDE};dn.transform=function(e,t,n){return l(n)||(n=new dn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var Dwe=new d;dn.distanceSquaredTo=function(e,t){let n=d.subtract(e.center,t,Dwe),i=d.magnitude(n)-e.radius;return i<=0?0:i*i};dn.transformWithoutScale=function(e,t,n){return l(n)||(n=new dn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var Iwe=new d;dn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Wa);let o=d.subtract(e.center,t,Iwe),r=d.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var HQ=new d,Pwe=new d,Rwe=new d,Owe=new d,Mwe=new d,Lwe=new fe,WQ=new Array(8);for(let e=0;e<8;++e)WQ[e]=new d;var GQ=new Ii;dn.projectTo2D=function(e,t,n){GQ._ellipsoid=ee.default,t=y(t,GQ);let i=t.ellipsoid,o=e.center,r=e.radius,s;d.equals(o,d.ZERO)?s=d.clone(d.UNIT_X,HQ):s=i.geodeticSurfaceNormal(o,HQ);let a=d.cross(d.UNIT_Z,s,Pwe);d.normalize(a,a);let c=d.cross(s,a,Rwe);d.normalize(c,c),d.multiplyByScalar(s,r,s),d.multiplyByScalar(c,r,c),d.multiplyByScalar(a,r,a);let u=d.negate(c,Mwe),f=d.negate(a,Owe),h=WQ,p=h[0];d.add(s,c,p),d.add(p,a,p),p=h[1],d.add(s,c,p),d.add(p,f,p),p=h[2],d.add(s,u,p),d.add(p,f,p),p=h[3],d.add(s,u,p),d.add(p,a,p),d.negate(s,s),p=h[4],d.add(s,c,p),d.add(p,a,p),p=h[5],d.add(s,c,p),d.add(p,f,p),p=h[6],d.add(s,u,p),d.add(p,f,p),p=h[7],d.add(s,u,p),d.add(p,a,p);let _=h.length;for(let T=0;T<_;++T){let C=h[T];d.add(o,C,C);let A=i.cartesianToCartographic(C,Lwe);t.project(A,C)}n=dn.fromPoints(h,n),o=n.center;let m=o.x,x=o.y,b=o.z;return o.x=b,o.y=m,o.z=x,n};dn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};dn.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&e.radius===t.radius};dn.prototype.intersectPlane=function(e){return dn.intersectPlane(this,e)};dn.prototype.distanceSquaredTo=function(e){return dn.distanceSquaredTo(this,e)};dn.prototype.computePlaneDistances=function(e,t,n){return dn.computePlaneDistances(this,e,t,n)};dn.prototype.isOccluded=function(e){return dn.isOccluded(this,e)};dn.prototype.equals=function(e){return dn.equals(this,e)};dn.prototype.clone=function(e){return dn.clone(this,e)};dn.prototype.volume=function(){let e=this.radius;return pwe*e*e*e};var ae=dn;function Nwe(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var hn=Nwe;var Fwe={NONE:0,TOP:1,ALL:2},sn=Object.freeze(Fwe);function ts(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}ts.POSITION_ONLY=Object.freeze(new ts({position:!0}));ts.POSITION_AND_NORMAL=Object.freeze(new ts({position:!0,normal:!0}));ts.POSITION_NORMAL_AND_ST=Object.freeze(new ts({position:!0,normal:!0,st:!0}));ts.POSITION_AND_ST=Object.freeze(new ts({position:!0,st:!0}));ts.POSITION_AND_COLOR=Object.freeze(new ts({position:!0,color:!0}));ts.ALL=Object.freeze(new ts({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ts.DEFAULT=ts.POSITION_NORMAL_AND_ST;ts.packedLength=6;ts.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};ts.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ts),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};ts.clone=function(e,t){if(l(e))return l(t)||(t=new ts),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Ie=ts;var Bwe=new d;function jl(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Ie.DEFAULT);this._minimum=d.clone(t),this._maximum=d.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}jl.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=d.multiplyByScalar(t,.5,new d);return new jl({minimum:d.negate(n,new d),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};jl.fromAxisAlignedBoundingBox=function(e){return new jl({minimum:e.minimum,maximum:e.maximum})};jl.packedLength=2*d.packedLength+Ie.packedLength+1;jl.pack=function(e,t,n){return n=y(n,0),d.pack(e._minimum,t,n),d.pack(e._maximum,t,n+d.packedLength),Ie.pack(e._vertexFormat,t,n+2*d.packedLength),t[n+2*d.packedLength+Ie.packedLength]=y(e._offsetAttribute,-1),t};var qQ=new d,YQ=new d,XQ=new Ie,jQ={minimum:qQ,maximum:YQ,vertexFormat:XQ,offsetAttribute:void 0};jl.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,qQ),o=d.unpack(e,t+d.packedLength,YQ),r=Ie.unpack(e,t+2*d.packedLength,XQ),s=e[t+2*d.packedLength+Ie.packedLength];return l(n)?(n._minimum=d.clone(i,n._minimum),n._maximum=d.clone(o,n._maximum),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(jQ.offsetAttribute=s===-1?void 0:s,new jl(jQ))};jl.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(d.equals(t,n))return;let o=new hn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=d.subtract(n,t,Bwe),c=d.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===sn.NONE?0:1,h=new Uint8Array(u/3).fill(f);o.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new at({attributes:o,indices:r,primitiveType:Me.TRIANGLES,boundingSphere:new ae(d.ZERO,c),offsetAttribute:e._offsetAttribute})};var U5;jl.getUnitBox=function(){return l(U5)||(U5=jl.createGeometry(jl.fromDimensions({dimensions:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),U5};var ja=jl;var $i={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};$i.getMathType=function(e){switch(e){case $i.SCALAR:return Number;case $i.VEC2:return U;case $i.VEC3:return d;case $i.VEC4:return oe;case $i.MAT2:return Pi;case $i.MAT3:return $;case $i.MAT4:return F}};$i.getNumberOfComponents=function(e){switch(e){case $i.SCALAR:return 1;case $i.VEC2:return 2;case $i.VEC3:return 3;case $i.VEC4:case $i.MAT2:return 4;case $i.MAT3:return 9;case $i.MAT4:return 16}};$i.getAttributeLocationCount=function(e){switch(e){case $i.SCALAR:case $i.VEC2:case $i.VEC3:case $i.VEC4:return 1;case $i.MAT2:return 2;case $i.MAT3:return 3;case $i.MAT4:return 4}};$i.getGlslType=function(e){switch(e){case $i.SCALAR:return"float";case $i.VEC2:return"vec2";case $i.VEC3:return"vec3";case $i.VEC4:return"vec4";case $i.MAT2:return"mat2";case $i.MAT3:return"mat3";case $i.MAT4:return"mat4"}};var on=Object.freeze($i);var KQ=1/256,ZQ=256,go={};go.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(o)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};go.octEncode=function(e,t){return go.octEncodeInRange(e,255,t)};var HS=new U,$Q=new Uint8Array(1);function z1(e){return $Q[0]=e,$Q[0]}go.octEncodeToCartesian4=function(e,t){return go.octEncodeInRange(e,65535,HS),t.x=z1(HS.x*KQ),t.y=z1(HS.x),t.z=z1(HS.y*KQ),t.w=z1(HS.y),t};go.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*P.signNotZero(o),i.y=(1-Math.abs(o))*P.signNotZero(i.y)}return d.normalize(i,i)};go.octDecode=function(e,t,n){return go.octDecodeInRange(e,t,255,n)};go.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*ZQ+i,a=o*ZQ+r;return go.octDecodeInRange(s,a,65535,t)};go.octPackFloat=function(e){return 256*e.x+e.y};var H5=new U;go.octEncodeFloat=function(e){return go.octEncode(e,H5),go.octPackFloat(H5)};go.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return go.octDecode(i,o,t)};go.octPack=function(e,t,n,i){let o=go.octEncodeFloat(e),r=go.octEncodeFloat(t),s=go.octEncode(n,H5);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};go.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;go.octDecodeFloat(s,t),go.octDecodeFloat(c,n),go.octDecode(r,a,i)};go.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};go.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function z5(e){return e>>1^-(e&1)}go.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=z5(e[a]),r+=z5(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=z5(n[a]),n[a]=s)};go.dequantize=function(e,t,n,i){let o=on.getNumberOfComponents(n),r;switch(t){case X.BYTE:r=127;break;case X.UNSIGNED_BYTE:r=255;break;case X.SHORT:r=32767;break;case X.UNSIGNED_SHORT:r=65535;break;case X.INT:r=2147483647;break;case X.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let u=a*o+c;s[u]=Math.max(e[u]/r,-1)}return s};go.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&o,h=c&i,p=3*a;t[p]=u*r,t[p+1]=f*s,t[p+2]=h*r}return t};var Ln=go;var QQ=new d,JQ=new d,eJ=new d;function kwe(e,t,n,i,o){l(o)||(o=new d);let r,s,a,c,u,f,h,p;if(l(t.z)){if(d.equalsEpsilon(e,t,P.EPSILON14))return d.clone(d.UNIT_X,o);if(d.equalsEpsilon(e,n,P.EPSILON14))return d.clone(d.UNIT_Y,o);if(d.equalsEpsilon(e,i,P.EPSILON14))return d.clone(d.UNIT_Z,o);r=d.subtract(n,t,QQ),s=d.subtract(i,t,JQ),a=d.subtract(e,t,eJ),c=d.dot(r,r),u=d.dot(r,s),f=d.dot(r,a),h=d.dot(s,s),p=d.dot(s,a)}else{if(U.equalsEpsilon(e,t,P.EPSILON14))return d.clone(d.UNIT_X,o);if(U.equalsEpsilon(e,n,P.EPSILON14))return d.clone(d.UNIT_Y,o);if(U.equalsEpsilon(e,i,P.EPSILON14))return d.clone(d.UNIT_Z,o);r=U.subtract(n,t,QQ),s=U.subtract(i,t,JQ),a=U.subtract(e,t,eJ),c=U.dot(r,r),u=U.dot(r,s),f=U.dot(r,a),h=U.dot(s,s),p=U.dot(s,a)}o.y=h*f-u*p,o.z=c*p-u*f;let _=c*h-u*u;if(_!==0)return o.y/=_,o.z/=_,o.x=1-o.y-o.z,o}var gT=kwe;function wh(){this.high=d.clone(d.ZERO),this.low=d.clone(d.ZERO)}wh.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var rp={high:0,low:0};wh.fromCartesian=function(e,t){l(t)||(t=new wh);let n=t.high,i=t.low;return wh.encode(e.x,rp),n.x=rp.high,i.x=rp.low,wh.encode(e.y,rp),n.y=rp.high,i.y=rp.low,wh.encode(e.z,rp),n.z=rp.high,i.z=rp.low,t};var G5=new wh;wh.writeElements=function(e,t,n){wh.fromCartesian(e,G5);let i=G5.high,o=G5.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var Hn=wh;var W5={};W5.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function tJ(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}W5.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<P.EPSILON14)return[0,0];if(c>u&&u/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=tJ(o,-r,P.EPSILON14);if(s<0)return[];let a=-.5*tJ(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var ll=W5;var q5={};q5.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function j5(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,f=r*r,h=s*s,p=o*s-f,_=o*a-r*s,m=r*a-h,x=4*p*m-_*_,b,T;if(x<0){let W,Y,J;f*u>=c*h?(W=o,Y=p,J=-2*r*p+o*_):(W=a,Y=m,J=-a*_+2*s*m);let K=-(J<0?-1:1)*Math.abs(W)*Math.sqrt(-x);T=-J+K;let Q=T/2,de=Q<0?-Math.pow(-Q,1/3):Math.pow(Q,1/3),ye=T===K?-de:-Y/de;return b=Y<=0?de+ye:-J/(de*de+ye*ye+Y),f*u>=c*h?[(b-r)/o]:[-a/(b+s)]}let C=p,A=-2*r*p+o*_,S=m,v=-a*_+2*s*m,D=Math.sqrt(x),O=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*D,-A)/3);b=2*Math.sqrt(-C);let M=Math.cos(R);T=b*M;let L=b*(-M/2-O*Math.sin(R)),g=T+L>2*r?T-r:L-r,E=o,w=g/E;R=Math.abs(Math.atan2(a*D,-v)/3),b=2*Math.sqrt(-S),M=Math.cos(R),T=b*M,L=b*(-M/2-O*Math.sin(R));let I=-a,N=T+L<2*s?T+s:L+s,B=I/N,H=E*N,V=-g*N-E*I,G=g*I,k=(s*V-r*G)/(-r*V+s*H);return w<=k?w<=B?k<=B?[w,k,B]:[w,B,k]:[B,w,k]:w<=B?[k,w,B]:k<=B?[k,B,w]:[B,k,w]}q5.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return ll.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=ll.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return j5(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):j5(e,t,0,i);if(i===0)return o=ll.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return j5(e,t,n,i)};var _T=q5;var Y5={};Y5.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,f=u*n,h=i*i,p=h*i,_=o*o,m=_*o;return a*u*h-4*c*p-4*e*f*h+18*e*t*n*p-27*r*h*h+256*s*m+o*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*h+144*r*n*h)+_*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function ud(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=_T.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let h=ll.computeRealRoots(1,r,a);if(h.length===2){let p=h[0],_=h[1],m;if(p>=0&&_>=0){let x=Math.sqrt(p),b=Math.sqrt(_);return[u-b,u-x,u+x,u+b]}else{if(p>=0&&_<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&_>=0)return m=Math.sqrt(_),[u-m,u+m]}}return[]}else if(f>0){let h=Math.sqrt(f),p=(r+f-s/h)/2,_=(r+f+s/h)/2,m=ll.computeRealRoots(1,h,p),x=ll.computeRealRoots(1,-h,_);return m.length!==0?(m[0]+=u,m[1]+=u,x.length!==0?(x[0]+=u,x[1]+=u,m[1]<=x[0]?[m[0],m[1],x[0],x[1]]:x[1]<=m[0]?[x[0],x[1],m[0],m[1]]:m[0]>=x[0]&&m[1]<=x[1]?[x[0],m[0],m[1],x[1]]:x[0]>=m[0]&&x[1]<=m[1]?[m[0],x[0],x[1],m[1]]:m[0]>x[0]&&m[0]<x[1]?[x[0],m[0],x[1],m[1]]:[m[0],x[0],m[1],x[1]]):m):x.length!==0?(x[0]+=u,x[1]+=u,x):[]}}return[]}function GS(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,u=s*i-n*t*e+o,f=_T.computeRealRoots(1,a,c,u);if(f.length>0){let h=f[0],p=t-h,_=p*p,m=e/2,x=p/2,b=_-4*i,T=_+4*Math.abs(i),C=s-4*h,A=s+4*Math.abs(h),S,v;if(h<0||b*A<C*T){let E=Math.sqrt(C);S=E/2,v=E===0?0:(e*x-n)/E}else{let E=Math.sqrt(b);S=E===0?0:(e*x-n)/E,v=E/2}let D,O;m===0&&S===0?(D=0,O=0):P.sign(m)===P.sign(S)?(D=m+S,O=h/D):(O=m-S,D=h/O);let R,M;x===0&&v===0?(R=0,M=0):P.sign(x)===P.sign(v)?(R=x+v,M=i/R):(M=x-v,R=i/M);let L=ll.computeRealRoots(1,D,R),g=ll.computeRealRoots(1,O,M);if(L.length!==0)return g.length!==0?L[1]<=g[0]?[L[0],L[1],g[0],g[1]]:g[1]<=L[0]?[g[0],g[1],L[0],L[1]]:L[0]>=g[0]&&L[1]<=g[1]?[g[0],L[0],L[1],g[1]]:g[0]>=L[0]&&g[1]<=L[1]?[L[0],g[0],g[1],L[1]]:L[0]>g[0]&&L[0]<g[1]?[g[0],L[0],g[1],L[1]]:[L[0],g[0],L[1],g[1]]:L;if(g.length!==0)return g}return[]}Y5.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<P.EPSILON15)return _T.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return ud(r,s,a,c);case 1:return GS(r,s,a,c);case 2:return GS(r,s,a,c);case 3:return ud(r,s,a,c);case 4:return ud(r,s,a,c);case 5:return GS(r,s,a,c);case 6:return ud(r,s,a,c);case 7:return ud(r,s,a,c);case 8:return GS(r,s,a,c);case 9:return ud(r,s,a,c);case 10:return ud(r,s,a,c);case 11:return GS(r,s,a,c);case 12:return ud(r,s,a,c);case 13:return ud(r,s,a,c);case 14:return ud(r,s,a,c);case 15:return ud(r,s,a,c);default:return}};var H1=Y5;function G1(e,t){t=d.clone(y(t,d.ZERO)),d.equals(t,d.ZERO)||d.normalize(t,t),this.origin=d.clone(y(e,d.ZERO)),this.direction=t}G1.clone=function(e,t){if(l(e))return l(t)?(t.origin=d.clone(e.origin),t.direction=d.clone(e.direction),t):new G1(e.origin,e.direction)};G1.getPoint=function(e,t,n){return l(n)||(n=new d),n=d.multiplyByScalar(e.direction,t,n),d.add(e.origin,n,n)};var pn=G1;var Mo={};Mo.rayPlane=function(e,t,n){l(n)||(n=new d);let i=e.origin,o=e.direction,r=t.normal,s=d.dot(r,o);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-d.dot(r,i))/s;if(!(a<0))return n=d.multiplyByScalar(o,a,n),d.add(i,n,n)};var Vwe=new d,Uwe=new d,lJ=new d,nJ=new d,iJ=new d;Mo.rayTriangleParametric=function(e,t,n,i,o){o=y(o,!1);let r=e.origin,s=e.direction,a=d.subtract(n,t,Vwe),c=d.subtract(i,t,Uwe),u=d.cross(s,c,lJ),f=d.dot(a,u),h,p,_,m,x;if(o){if(f<P.EPSILON6||(h=d.subtract(r,t,nJ),_=d.dot(h,u),_<0||_>f)||(p=d.cross(h,a,iJ),m=d.dot(s,p),m<0||_+m>f))return;x=d.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let b=1/f;if(h=d.subtract(r,t,nJ),_=d.dot(h,u)*b,_<0||_>1||(p=d.cross(h,a,iJ),m=d.dot(s,p)*b,m<0||_+m>1))return;x=d.dot(c,p)*b}return x};Mo.rayTriangle=function(e,t,n,i,o,r){let s=Mo.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new d),d.multiplyByScalar(e.direction,s,r),d.add(e.origin,r,r)};var zwe=new pn;Mo.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=zwe;d.clone(e,a.origin),d.subtract(t,e,a.direction),d.normalize(a.direction,a.direction);let c=Mo.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>d.distance(e,t)))return l(s)||(s=new d),d.multiplyByScalar(a.direction,c,s),d.add(a.origin,s,s)};function Hwe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var Gwe={root0:0,root1:0};function uJ(e,t,n){l(n)||(n=new Wa);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=d.subtract(i,r,lJ),c=d.dot(o,o),u=2*d.dot(o,a),f=d.magnitudeSquared(a)-s,h=Hwe(c,u,f,Gwe);if(l(h))return n.start=h.root0,n.stop=h.root1,n}Mo.raySphere=function(e,t,n){if(n=uJ(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var Wwe=new pn;Mo.lineSegmentSphere=function(e,t,n,i){let o=Wwe;d.clone(e,o.origin);let r=d.subtract(t,e,o.direction),s=d.magnitude(r);if(d.normalize(r,r),i=uJ(o,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var jwe=new d,qwe=new d;Mo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=d.multiplyComponents(n,e.origin,jwe),o=d.multiplyComponents(n,e.direction,qwe),r=d.magnitudeSquared(i),s=d.dot(i,o),a,c,u,f,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=d.magnitudeSquared(o),u=c*a,p<u)return;if(p>u){f=s*s-u,h=-s+Math.sqrt(f);let m=h/c,x=a/h;return m<x?new Wa(m,x):{start:x,stop:m}}let _=Math.sqrt(a/c);return new Wa(_,_)}else if(r<1)return a=r-1,c=d.magnitudeSquared(o),u=c*a,f=s*s-u,h=-s+Math.sqrt(f),new Wa(0,h/c);if(s<0)return c=d.magnitudeSquared(o),new Wa(0,-s/c)};function P0(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Mo.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=o*(i*P0(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*P0(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],P.EPSILON15),h=o*(i*P0(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,_=[];if(h===0&&f===0){if(p=ll.computeRealRoots(a,c,u),p.length===0)return _;let R=p[0],M=Math.sqrt(Math.max(1-R*R,0));if(_.push(new d(i,o*R,o*-M)),_.push(new d(i,o*R,o*M)),p.length===2){let L=p[1],g=Math.sqrt(Math.max(1-L*L,0));_.push(new d(i,o*L,o*-g)),_.push(new d(i,o*L,o*g))}return _}let m=h*h,x=f*f,b=a*a,T=h*f,C=b+x,A=2*(c*a+T),S=2*u*a+c*c-x+m,v=2*(u*c-T),D=u*u-m;if(C===0&&A===0&&S===0&&v===0)return _;p=H1.computeRealRoots(C,A,S,v,D);let O=p.length;if(O===0)return _;for(let R=0;R<O;++R){let M=p[R],L=M*M,g=Math.max(1-L,0),E=Math.sqrt(g),w;P.sign(a)===P.sign(u)?w=P0(a*L+u,c*M,P.EPSILON12):P.sign(u)===P.sign(c*M)?w=P0(a*L,c*M+u,P.EPSILON12):w=P0(a*L+c*M,u,P.EPSILON12);let I=P0(f*M,h,P.EPSILON15),N=w*I;N<0?_.push(new d(i,o*M,o*E)):N>0?_.push(new d(i,o*M,o*-E)):E!==0?(_.push(new d(i,o*M,o*-E)),_.push(new d(i,o*M,o*E)),++R):_.push(new d(i,o*M,o*E))}return _};var X5=new d,oJ=new d,rJ=new d,W1=new d,Ywe=new d,Xwe=new $,Kwe=new $,Zwe=new $,$we=new $,Qwe=new $,sJ=new $,aJ=new $,cJ=new d,Jwe=new d,eDe=new fe;Mo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!d.equals(n,d.ZERO)){let D=t.geodeticSurfaceNormal(n,X5);if(d.dot(i,D)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,X5),s=d.normalize(r,r),a=d.mostOrthogonalAxis(r,W1),c=d.normalize(d.cross(a,s,oJ),oJ),u=d.normalize(d.cross(s,c,rJ),rJ),f=Xwe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let h=$.transpose(f,Kwe),p=$.fromScale(t.radii,Zwe),_=$.fromScale(t.oneOverRadii,$we),m=Qwe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let x=$.multiply($.multiply(h,_,sJ),m,sJ),b=$.multiply($.multiply(x,p,aJ),f,aJ),T=$.multiplyByVector(x,n,Ywe),C=Mo.quadraticVectorExpression(b,d.negate(T,X5),0,0,1),A,S,v=C.length;if(v>0){let D=d.clone(d.ZERO,Jwe),O=Number.NEGATIVE_INFINITY;for(let M=0;M<v;++M){A=$.multiplyByVector(p,$.multiplyByVector(f,C[M],cJ),cJ);let L=d.normalize(d.subtract(A,n,W1),W1),g=d.dot(L,i);g>O&&(O=g,D=d.clone(A,D))}let R=t.cartesianToCartographic(D,eDe);return O=P.clamp(O,0,1),S=d.magnitude(d.subtract(D,n,W1))*Math.sqrt(1-O*O),S=o?-S:S,R.height=S,t.cartographicToCartesian(R,new d)}};var tDe=new d;Mo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new d);let o=d.subtract(t,e,tDe),r=n.normal,s=d.dot(r,o);if(Math.abs(s)<P.EPSILON6)return;let a=d.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return d.multiplyByScalar(o,c,i),d.add(e,i,i),i};Mo.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=d.dot(o,e)+r<0,a=d.dot(o,t)+r<0,c=d.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,h;if((u===1||u===2)&&(f=new d,h=new d),u===1){if(s)return Mo.lineSegmentPlane(e,t,i,f),Mo.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Mo.lineSegmentPlane(t,n,i,f),Mo.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Mo.lineSegmentPlane(n,e,i,f),Mo.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return Mo.lineSegmentPlane(e,n,i,f),Mo.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}else return Mo.lineSegmentPlane(n,t,i,f),Mo.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};else return Mo.lineSegmentPlane(t,e,i,f),Mo.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,f,h],indices:[1,2,4,1,4,3,0,3,4]}};var Zn=Mo;function Rs(e,t){this.normal=d.clone(e),this.distance=t}Rs.fromPointNormal=function(e,t,n){let i=-d.dot(t,e);return l(n)?(d.clone(t,n.normal),n.distance=i,n):new Rs(t,i)};var nDe=new d;Rs.fromCartesian4=function(e,t){let n=d.fromCartesian4(e,nDe),i=e.w;return l(t)?(d.clone(n,t.normal),t.distance=i,t):new Rs(n,i)};Rs.getPointDistance=function(e,t){return d.dot(e.normal,t)+e.distance};var iDe=new d;Rs.projectPointOntoPlane=function(e,t,n){l(n)||(n=new d);let i=Rs.getPointDistance(e,t),o=d.multiplyByScalar(e.normal,i,iDe);return d.subtract(t,o,n)};var oDe=new F,rDe=new oe,sDe=new d;Rs.transform=function(e,t,n){let i=e.normal,o=e.distance,r=F.inverseTranspose(t,oDe),s=oe.fromElements(i.x,i.y,i.z,o,rDe);s=F.multiplyByVector(r,s,s);let a=d.fromCartesian4(s,sDe);return s=oe.divideByScalar(s,d.magnitude(a),s),Rs.fromCartesian4(s,n)};Rs.clone=function(e,t){return l(t)?(d.clone(e.normal,t.normal),t.distance=e.distance,t):new Rs(e.normal,e.distance)};Rs.equals=function(e,t){return e.distance===t.distance&&d.equals(e.normal,t.normal)};Rs.ORIGIN_XY_PLANE=Object.freeze(new Rs(d.UNIT_Z,0));Rs.ORIGIN_YZ_PLANE=Object.freeze(new Rs(d.UNIT_X,0));Rs.ORIGIN_ZX_PLANE=Object.freeze(new Rs(d.UNIT_Y,0));var an=Rs;var K5={};K5.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};K5.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(g,E,w,I){for(;E.length>=1;){let N=E[E.length-1];if(E.splice(E.length-1,1),g[N].numLiveTriangles>0)return N}for(;o<I;){if(g[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(g,E,w,I,N,B,H){let V=-1,G,k=-1,W=0;for(;W<w.length;){let Y=w[W];I[Y].numLiveTriangles&&(G=0,N-I[Y].timeStamp+2*I[Y].numLiveTriangles<=E&&(G=N-I[Y].timeStamp),(G>k||k===-1)&&(k=G,V=Y)),++W}return V===-1?r(I,B,g,H):V}let a=t.length,c=0,u=0,f=t[u],h=a;if(l(n))c=n+1;else{for(;u<h;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],_;for(_=0;_<c;_++)p[_]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<h;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let x=0,b=i+1;o=1;let T=[],C=[],A,S,v=0,D=[],O=a/3,R=[];for(_=0;_<O;_++)R[_]=!1;let M,L;for(;x!==-1;){T=[],S=p[x],L=S.vertexTriangles.length;for(let g=0;g<L;++g)if(m=S.vertexTriangles[g],!R[m]){R[m]=!0,u=m+m+m;for(let E=0;E<3;++E)M=t[u],T.push(M),C.push(M),D[v]=M,++v,A=p[M],--A.numLiveTriangles,b-A.timeStamp>i&&(A.timeStamp=b,++b),++u}x=s(t,i,T,p,b,C,c)}return D};var j1=K5;var Tc={};function Q1(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function aDe(e){let t=e.length,n=t/3*6,i=Ne.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)Q1(i,o,e[r],e[r+1],e[r+2]);return i}function cDe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ne.createTypedArray(t,n);Q1(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)Q1(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function lDe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ne.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)Q1(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Tc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Me.TRIANGLES:e.indices=aDe(t);break;case Me.TRIANGLE_STRIP:e.indices=cDe(t);break;case Me.TRIANGLE_FAN:e.indices=lDe(t);break}e.primitiveType=Me.LINES}return e};Tc.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ae(u.center,u.radius+n)),new at({attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Me.LINES,boundingSphere:c})};Tc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];l(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=o++);return i};Tc.reorderForPreVertexCache=function(e){let t=at.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Ne.createTypedArray(t,r),a=0,c=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[c]=f:(f=o[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let h=e.attributes;for(let p in h)if(h.hasOwnProperty(p)&&l(h[p])&&l(h[p].values)){let _=h[p],m=_.values,x=0,b=_.componentsPerAttribute,T=X.createTypedArray(_.componentDatatype,u*b);for(;x<t;){let C=i[x];if(C!==-1)for(let A=0;A<b;A++)T[b*C+A]=m[b*x+A];++x}_.values=T}}return e};Tc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Me.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=j1.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function fJ(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new ve({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function uDe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}Tc.fitToUnsignedShortIndices=function(e){let t=[],n=at.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=fJ(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Me.TRIANGLES?u=3:e.primitiveType===Me.LINES?u=2:e.primitiveType===Me.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let h=0;h<u;++h){let p=a[f+h],_=i[p];l(_)||(_=r++,i[p]=_,uDe(s,e.attributes,p)),o.push(_)}r+u>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new at({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=fJ(e.attributes))}o.length!==0&&t.push(new at({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var dJ=new d,fDe=new fe;Tc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Ii;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let h=d.fromArray(a,f,dJ),p=s.cartesianToCartographic(h,fDe),_=o.project(p,dJ);c[u++]=_.x,c[u++]=_.y,c[u++]=_.z}return e.attributes[n]=r,e.attributes[i]=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var Z5={high:0,low:0};Tc.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Hn.encode(r[f],Z5),a[f]=Z5.high,c[f]=Z5.low;let u=o.componentsPerAttribute;return e.attributes[n]=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var dd=new d;function $5(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,dd),F.multiplyByPoint(e,dd,dd),d.pack(dd,n,o)}}function Q5(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,dd),$.multiplyByVector(e,dd,dd),dd=d.normalize(dd,dd),d.pack(dd,n,o)}}var q1=new F,Y1=new $;Tc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;$5(t,n.position),$5(t,n.prevPosition),$5(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(F.inverse(t,q1),F.transpose(q1,q1),F.getMatrix3(q1,Y1),Q5(Y1,n.normal),Q5(Y1,n.tangent),Q5(Y1,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ae.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function dDe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[r]=new ve({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:X.createTypedArray(s.componentDatatype,a)}))}return i}var hDe=new d;function J5(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=dDe(e,t),h,p,_;for(i in f)if(f.hasOwnProperty(i))for(h=f[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,_=p.length,r=0;r<_;++r)h[s++]=p[r];let m;if(c){let C=0;for(o=0;o<n;++o)C+=e[o][t].indices.length;let A=at.computeNumberOfVertices(new at({attributes:f,primitiveType:Me.POINTS})),S=Ne.createTypedArray(A,C),v=0,D=0;for(o=0;o<n;++o){let O=e[o][t].indices,R=O.length;for(s=0;s<R;++s)S[v++]=D+O[s];D+=at.computeNumberOfVertices(e[o][t])}m=S}let x=new d,b=0,T;for(o=0;o<n;++o){if(T=e[o][t].boundingSphere,!l(T)){x=void 0;break}d.add(T.center,x,x)}if(l(x))for(d.divideByScalar(x,n,x),o=0;o<n;++o){T=e[o][t].boundingSphere;let C=d.magnitude(d.subtract(T.center,x,hDe))+T.radius;C>b&&(b=C)}return new at({attributes:f,indices:m,primitiveType:u,boundingSphere:l(x)?new ae(x,b):void 0})}Tc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(J5(t,"geometry")),n.length>0&&(o.push(J5(n,"westHemisphereGeometry")),o.push(J5(n,"eastHemisphereGeometry"))),o};var Xu=new d,WS=new d,yT=new d,xT=new d;Tc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],x=t[u+1],b=t[u+2],T=m*3,C=x*3,A=b*3;WS.x=i[T],WS.y=i[T+1],WS.z=i[T+2],yT.x=i[C],yT.y=i[C+1],yT.z=i[C+2],xT.x=i[A],xT.y=i[A+1],xT.z=i[A+2],s[m].count++,s[x].count++,s[b].count++,d.subtract(yT,WS,yT),d.subtract(xT,WS,xT),a[f]=d.cross(yT,xT,new d),f++}let h=0;for(u=0;u<o;u++)s[u].indexOffset+=h,h+=s[u].count;f=0;let p;for(u=0;u<r;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let _=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=s[u],d.clone(d.ZERO,Xu),p.count>0){for(f=0;f<p.count;f++)d.add(Xu,a[c[p.indexOffset+f]],Xu);d.equalsEpsilon(d.ZERO,Xu,P.EPSILON10)&&d.clone(a[c[p.indexOffset]],Xu)}d.equalsEpsilon(d.ZERO,Xu,P.EPSILON10)&&(Xu.z=1),d.normalize(Xu,Xu),_[m]=Xu.x,_[m+1]=Xu.y,_[m+2]=Xu.z}return e.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_}),e};var mDe=new d,hJ=new d,pDe=new d;Tc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,h,p;for(u=0;u<a;u+=3){let x=n[u],b=n[u+1],T=n[u+2];f=x*3,h=b*3,p=T*3;let C=x*2,A=b*2,S=T*2,v=i[f],D=i[f+1],O=i[f+2],R=r[C],M=r[C+1],L=r[A+1]-M,g=r[S+1]-M,E=1/((r[A]-R)*g-(r[S]-R)*L),w=(g*(i[h]-v)-L*(i[p]-v))*E,I=(g*(i[h+1]-D)-L*(i[p+1]-D))*E,N=(g*(i[h+2]-O)-L*(i[p+2]-O))*E;c[f]+=w,c[f+1]+=I,c[f+2]+=N,c[h]+=w,c[h+1]+=I,c[h+2]+=N,c[p]+=w,c[p+1]+=I,c[p+2]+=N}let _=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,h=f+1,p=f+2;let x=d.fromArray(o,f,mDe),b=d.fromArray(c,f,pDe),T=d.dot(x,b);d.multiplyByScalar(x,T,hJ),d.normalize(d.subtract(b,hJ,b),b),_[f]=b.x,_[h]=b.y,_[p]=b.z,d.normalize(d.cross(x,b,b),b),m[f]=b.x,m[h]=b.y,m[p]=b.z}return e.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_}),e.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m}),e};var jS=new U,fd=new d,mJ=new d,pJ=new d,X1=new U;Tc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let D=t.values;i=D.length/3;let O=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(d.fromArray(D,n*3,fd),d.equals(fd,d.ZERO)){R+=2;continue}X1=Ln.octEncodeInRange(fd,65535,X1),O[R++]=X1.x,O[R++]=X1.y}return e.attributes.compressedAttributes=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:O}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),h=l(u),p,_,m,x;s&&(p=o.values),a&&(_=r.values),f&&(m=c.values),h&&(x=u.values),i=(s?p.length:_.length)/(s?3:2);let C=i,A=a&&s?2:1;A+=f||h?1:0,C*=A;let S=new Float32Array(C),v=0;for(n=0;n<i;++n){a&&(U.fromArray(_,n*2,jS),S[v++]=Ln.compressTextureCoordinates(jS));let D=n*3;s&&l(m)&&l(x)?(d.fromArray(p,D,fd),d.fromArray(m,D,mJ),d.fromArray(x,D,pJ),Ln.octPack(fd,mJ,pJ,jS),S[v++]=jS.x,S[v++]=jS.y):(s&&(d.fromArray(p,D,fd),S[v++]=Ln.octEncodeFloat(fd)),f&&(d.fromArray(m,D,fd),S[v++]=Ln.octEncodeFloat(fd)),h&&(d.fromArray(x,D,fd),S[v++]=Ln.octEncodeFloat(fd)))}return e.attributes.compressedAttributes=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:A,values:S}),s&&delete e.attributes.normal,a&&delete e.attributes.st,h&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function gDe(e){if(l(e.indices))return e;let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function _De(e){let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function yDe(e){let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function xDe(e){if(l(e.indices))return e;let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function bDe(e){let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Me.LINES,e}function TDe(e){let t=at.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Me.LINES,e}function CDe(e){switch(e.primitiveType){case Me.TRIANGLE_FAN:return _De(e);case Me.TRIANGLE_STRIP:return yDe(e);case Me.TRIANGLES:return gDe(e);case Me.LINE_STRIP:return bDe(e);case Me.LINE_LOOP:return TDe(e);case Me.LINES:return xDe(e)}return e}function kg(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function ADe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){kg(e,e.y<0),kg(t,t.y<0),kg(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=P.sign(e.y):s=P.sign(n.y):o>r?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;kg(e,a),kg(t,a),kg(n,a)}var gJ=new d;function Ku(e,t,n,i){d.add(e,d.multiplyByScalar(d.subtract(t,e,gJ),e.y/(e.y-t.y),gJ),n),d.clone(n,i),kg(n,!0),kg(i,!1)}var R0=new d,O0=new d,M0=new d,L0=new d,e6={positions:new Array(7),indices:new Array(3*3)};function EDe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;ADe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=e6.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Ku(e,t,R0,M0),Ku(e,n,O0,L0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Ku(t,n,R0,M0),Ku(t,e,O0,L0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Ku(n,e,R0,M0),Ku(n,t,O0,L0),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Ku(n,e,R0,M0),Ku(n,t,O0,L0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Ku(t,n,R0,M0),Ku(t,e,O0,L0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Ku(e,t,R0,M0),Ku(e,n,O0,L0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=e6.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=R0,c[4]=O0,c[5]=M0,c[6]=L0,c.length=7),e6}function _J(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=X.createTypedArray(r.componentDatatype,r.values)}let i=at.computeNumberOfVertices(e);return e.indices=Ne.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function TT(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new ve({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new at({attributes:n,indices:[],primitiveType:e.primitiveType})}function o6(e,t,n){let i=l(e.geometry.boundingSphere);t=_J(t,i),n=_J(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function r6(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,f,h,p){let _=e.fromArray(u,r*t,n),m=e.fromArray(u,s*t,i),x=e.fromArray(u,a*t,o);e.multiplyByScalar(_,c.x,_),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(x,c.z,x);let b=e.add(_,m,_);e.add(b,x,b),p&&e.normalize(b,b),e.pack(b,f,h*t)}}var SDe=r6(oe,4),$1=r6(d,3),AJ=r6(U,2),vDe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>P.EPSILON6?1:0},qS=new d,t6=new d,n6=new d,wDe=new d;function K1(e,t,n,i,o,r,s,a,c,u,f,h,p,_,m,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&_===0)return;let b=d.fromArray(o,e*3,qS),T=d.fromArray(o,t*3,t6),C=d.fromArray(o,n*3,n6),A=gT(i,b,T,C,wDe);if(l(A)){if(l(r)&&$1(e,t,n,A,r,h.normal.values,x,!0),l(u)){let S=d.fromArray(u,e*3,qS),v=d.fromArray(u,t*3,t6),D=d.fromArray(u,n*3,n6);d.multiplyByScalar(S,A.x,S),d.multiplyByScalar(v,A.y,v),d.multiplyByScalar(D,A.z,D);let O;!d.equals(S,d.ZERO)||!d.equals(v,d.ZERO)||!d.equals(D,d.ZERO)?(O=d.add(S,v,S),d.add(O,D,O),d.normalize(O,O)):(O=qS,O.x=0,O.y=0,O.z=0),d.pack(O,h.extrudeDirection.values,x*3)}if(l(f)&&vDe(e,t,n,A,f,h.applyOffset.values,x),l(s)&&$1(e,t,n,A,s,h.tangent.values,x,!0),l(a)&&$1(e,t,n,A,a,h.bitangent.values,x,!0),l(c)&&AJ(e,t,n,A,c,h.st.values,x),_>0)for(let S=0;S<_;S++){let v=p[S];DDe(e,t,n,A,x,m[v],h[v])}}}function DDe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,u=s.values;switch(a){case 4:SDe(e,t,n,i,c,u,o,!1);break;case 3:$1(e,t,n,i,c,u,o,!1);break;case 2:AJ(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Dh(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var IDe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function yJ(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,h=[];for(let O in n)n.hasOwnProperty(O)&&!IDe[O]&&l(n[O])&&h.push(O);let p=h.length,_=TT(t),m=TT(t),x,b,T,C,A,S=[];S.length=i.length/3;let v=[];for(v.length=i.length/3,A=0;A<S.length;++A)S[A]=-1,v[A]=-1;let D=f.length;for(A=0;A<D;A+=3){let O=f[A],R=f[A+1],M=f[A+2],L=d.fromArray(i,O*3),g=d.fromArray(i,R*3),E=d.fromArray(i,M*3),w=EDe(L,g,E);if(l(w)&&w.positions.length>3){let I=w.positions,N=w.indices,B=N.length;for(let H=0;H<B;++H){let V=N[H],G=I[V];G.y<0?(x=m.attributes,b=m.indices,T=S):(x=_.attributes,b=_.indices,T=v),C=Dh(x,b,T,f,V<3?A+V:-1,G),K1(O,R,M,G,i,o,s,r,a,c,u,x,h,p,n,C)}}else l(w)&&(L=w.positions[0],g=w.positions[1],E=w.positions[2]),L.y<0?(x=m.attributes,b=m.indices,T=S):(x=_.attributes,b=_.indices,T=v),C=Dh(x,b,T,f,A,L),K1(O,R,M,L,i,o,s,r,a,c,u,x,h,p,n,C),C=Dh(x,b,T,f,A+1,g),K1(O,R,M,g,i,o,s,r,a,c,u,x,h,p,n,C),C=Dh(x,b,T,f,A+2,E),K1(O,R,M,E,i,o,s,r,a,c,u,x,h,p,n,C)}o6(e,m,_)}var EJ=an.fromPointNormal(d.ZERO,d.UNIT_Y),PDe=new d,RDe=new d;function bT(e,t,n,i,o,r,s){if(!l(s))return;let a=d.fromArray(i,e*3,qS);d.equalsEpsilon(a,n,P.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function xJ(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=TT(t),a=TT(t),c,u=r.length,f=[];f.length=i.length/3;let h=[];for(h.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,h[c]=-1;for(c=0;c<u;c+=2){let p=r[c],_=r[c+1],m=d.fromArray(i,p*3,qS),x=d.fromArray(i,_*3,t6),b;Math.abs(m.y)<P.EPSILON6&&(m.y<0?m.y=-P.EPSILON6:m.y=P.EPSILON6),Math.abs(x.y)<P.EPSILON6&&(x.y<0?x.y=-P.EPSILON6:x.y=P.EPSILON6);let T=s.attributes,C=s.indices,A=h,S=a.attributes,v=a.indices,D=f,O=Zn.lineSegmentPlane(m,x,EJ,n6);if(l(O)){let R=d.multiplyByScalar(d.UNIT_Y,5*P.EPSILON9,PDe);m.y<0&&(d.negate(R,R),T=a.attributes,C=a.indices,A=f,S=s.attributes,v=s.indices,D=h);let M=d.add(O,R,RDe);b=Dh(T,C,A,r,c,m),bT(p,_,m,i,b,T,o),b=Dh(T,C,A,r,-1,M),bT(p,_,M,i,b,T,o),d.negate(R,R),d.add(O,R,M),b=Dh(S,v,D,r,-1,M),bT(p,_,M,i,b,S,o),b=Dh(S,v,D,r,c+1,x),bT(p,_,x,i,b,S,o)}else{let R,M,L;m.y<0?(R=a.attributes,M=a.indices,L=f):(R=s.attributes,M=s.indices,L=h),b=Dh(R,M,L,r,c,m),bT(p,_,m,i,b,R,o),b=Dh(R,M,L,r,c+1,x),bT(p,_,x,i,b,R,o)}}o6(e,a,s)}var bJ=new U,ODe=new U,SJ=new d,vJ=new d,i6=new d,MDe=new d,LDe=new d,NDe=new d,TJ=new oe;function CJ(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=d.unpack(n,s,SJ);if(a.x>0)continue;let c=d.unpack(i,s,vJ);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):d.pack(a,i,s));let u=d.unpack(o,s,i6);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):d.pack(a,o,s))}}var FDe=5*P.EPSILON9,Z1=P.EPSILON6;function BDe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=TT(t),f=TT(t),h,p,_,m=!1,x=i.length/3;for(h=0;h<x;h+=4){let b=h,T=h+2,C=d.fromArray(i,b*3,SJ),A=d.fromArray(i,T*3,vJ);if(Math.abs(C.y)<Z1)for(C.y=Z1*(A.y<0?-1:1),i[h*3+1]=C.y,i[(h+1)*3+1]=C.y,p=b*3;p<b*3+4*3;p+=3)o[p]=i[h*3],o[p+1]=i[h*3+1],o[p+2]=i[h*3+2];if(Math.abs(A.y)<Z1)for(A.y=Z1*(C.y<0?-1:1),i[(h+2)*3+1]=A.y,i[(h+3)*3+1]=A.y,p=b*3;p<b*3+4*3;p+=3)r[p]=i[(h+2)*3],r[p+1]=i[(h+2)*3+1],r[p+2]=i[(h+2)*3+2];let S=u.attributes,v=u.indices,D=f.attributes,O=f.indices,R=Zn.lineSegmentPlane(C,A,EJ,MDe);if(l(R)){m=!0;let M=d.multiplyByScalar(d.UNIT_Y,FDe,LDe);C.y<0&&(d.negate(M,M),S=f.attributes,v=f.indices,D=u.attributes,O=u.indices);let L=d.add(R,M,NDe);S.position.values.push(C.x,C.y,C.z,C.x,C.y,C.z),S.position.values.push(L.x,L.y,L.z),S.position.values.push(L.x,L.y,L.z),S.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),S.prevPosition.values.push(C.x,C.y,C.z,C.x,C.y,C.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),d.negate(M,M),d.add(R,M,L),D.position.values.push(L.x,L.y,L.z),D.position.values.push(L.x,L.y,L.z),D.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.nextPosition.values.push(r[T*3],r[T*3+1],r[T*3+2]),D.nextPosition.values.push(r[T*3+3],r[T*3+4],r[T*3+5]);let g=U.fromArray(s,b*2,bJ),E=Math.abs(g.y);S.expandAndWidth.values.push(-1,E,1,E),S.expandAndWidth.values.push(-1,-E,1,-E),D.expandAndWidth.values.push(-1,E,1,E),D.expandAndWidth.values.push(-1,-E,1,-E);let w=d.magnitudeSquared(d.subtract(R,C,i6));if(w/=d.magnitudeSquared(d.subtract(A,C,i6)),l(c)){let I=oe.fromArray(c,b*4,TJ),N=oe.fromArray(c,T*4,TJ),B=P.lerp(I.x,N.x,w),H=P.lerp(I.y,N.y,w),V=P.lerp(I.z,N.z,w),G=P.lerp(I.w,N.w,w);for(p=b*4;p<b*4+2*4;++p)S.color.values.push(c[p]);for(S.color.values.push(B,H,V,G),S.color.values.push(B,H,V,G),D.color.values.push(B,H,V,G),D.color.values.push(B,H,V,G),p=T*4;p<T*4+2*4;++p)D.color.values.push(c[p])}if(l(a)){let I=U.fromArray(a,b*2,bJ),N=U.fromArray(a,(h+3)*2,ODe),B=P.lerp(I.x,N.x,w);for(p=b*2;p<b*2+2*2;++p)S.st.values.push(a[p]);for(S.st.values.push(B,I.y),S.st.values.push(B,N.y),D.st.values.push(B,I.y),D.st.values.push(B,N.y),p=T*2;p<T*2+2*2;++p)D.st.values.push(a[p])}_=S.position.values.length/3-4,v.push(_,_+2,_+1),v.push(_+1,_+2,_+3),_=D.position.values.length/3-4,O.push(_,_+2,_+1),O.push(_+1,_+2,_+3)}else{let M,L;for(C.y<0?(M=f.attributes,L=f.indices):(M=u.attributes,L=u.indices),M.position.values.push(C.x,C.y,C.z),M.position.values.push(C.x,C.y,C.z),M.position.values.push(A.x,A.y,A.z),M.position.values.push(A.x,A.y,A.z),p=h*3;p<h*3+4*3;++p)M.prevPosition.values.push(o[p]),M.nextPosition.values.push(r[p]);for(p=h*2;p<h*2+4*2;++p)M.expandAndWidth.values.push(s[p]),l(a)&&M.st.values.push(a[p]);if(l(c))for(p=h*4;p<h*4+4*4;++p)M.color.values.push(c[p]);_=M.position.values.length/3-4,L.push(_,_+2,_+1),L.push(_+1,_+2,_+3)}}m&&(CJ(f),CJ(u)),o6(e,f,u)}Tc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ae.intersectPlane(n,an.ORIGIN_ZX_PLANE)!==jt.INTERSECTING))return e;if(t.geometryType!==ld.NONE)switch(t.geometryType){case ld.POLYLINES:BDe(e);break;case ld.TRIANGLES:yJ(e);break;case ld.LINES:xJ(e);break}else CDe(t),t.primitiveType===Me.TRIANGLES?yJ(e):t.primitiveType===Me.LINES&&xJ(e);return e};var Nn=Tc;function YS(e,t,n,i,o,r,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(YS.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});YS.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,h=this._size,p=this._pixelFormat,_=this._internalFormat,m=this._pixelDatatype,x=this._preMultiplyAlpha,b=this._flipY,T=4;l(f)&&(T=tt.alignmentInBytes(p,m,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,T),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let C=!1;if(!this._initialized){let A;t===0&&n===0&&r===h&&s===h?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=tt.flipY(f,p,m,h,h)),A=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),A=i),C=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A=tt.createTypedArray(p,m,h,h)),a.texImage2D(u,0,_,h,h,0,p,Ke.toWebGLConstant(m,this._context),A),this._initialized=!0}C||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=tt.flipY(f,p,m,r,s)),a.texSubImage2D(u,0,t,n,r,s,p,Ke.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),a.texSubImage2D(u,0,t,n,p,Ke.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};YS.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._size),r=y(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};YS.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=y(e,0),t=y(t,0),n=y(n,this._size),i=y(i,this._size),o=y(o,0);let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var J1=YS;var eR={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===eR.DONT_CARE||e===eR.FASTEST||e===eR.NICEST}},sp=Object.freeze(eR);var tR={NEAREST:te.NEAREST,LINEAR:te.LINEAR};tR.validate=function(e){return e===tR.NEAREST||e===tR.LINEAR};var di=Object.freeze(tR);var Vg={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};Vg.validate=function(e){return e===Vg.NEAREST||e===Vg.LINEAR||e===Vg.NEAREST_MIPMAP_NEAREST||e===Vg.LINEAR_MIPMAP_NEAREST||e===Vg.NEAREST_MIPMAP_LINEAR||e===Vg.LINEAR_MIPMAP_LINEAR};var Zt=Object.freeze(Vg);var nR={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===nR.CLAMP_TO_EDGE||e===nR.REPEAT||e===nR.MIRRORED_REPEAT}},An=Object.freeze(nR);function XS(e){e=y(e,y.EMPTY_OBJECT);let{wrapS:t=An.CLAMP_TO_EDGE,wrapT:n=An.CLAMP_TO_EDGE,minificationFilter:i=Zt.LINEAR,magnificationFilter:o=di.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(XS.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});XS.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};XS.NEAREST=Object.freeze(new XS({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST}));var $t=XS;function kDe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function DJ(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function ap(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)kDe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let _=p.strideInBytes||p.componentsPerAttribute*X.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/_;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(u=!0);let h;t.vertexArrayObject&&(h=t.glCreateVertexArray(),t.glBindVertexArray(h),DJ(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=h,this._attributes=s,this._indexBuffer=o}function wJ(e){return e.values.length/e.componentsPerAttribute}function VDe(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function UDe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=wJ(e[o[0]]),t=1;t<s;++t){let u=wJ(e[o[t]]);if(u!==r)throw new re(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return X.getSizeInBytes(e[f].componentDatatype)-X.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=VDe(i);if(a>0){let u=X.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let h=r*a,p=new ArrayBuffer(h),_={};for(t=0;t<s;++t){n=o[t];let m=X.getSizeInBytes(e[n].componentDatatype);_[n]={pointer:X.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<r;++t)for(let m=0;m<s;++m){n=o[m],i=e[n];let x=i.values,b=_[n],T=b.pointer,C=i.componentsPerAttribute;for(let A=0;A<C;++A)T[b.index+A]=x[t*C+A];b.index+=b.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}ap.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Fe.DYNAMIC_DRAW),o=y(e.attributeLocations,y.EMPTY_OBJECT),r=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],h=n.attributes;if(r){let m=UDe(h);if(l(m)){u=yt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let x=m.offsetsInBytes,b=m.vertexSizeInBytes;for(a in h)h.hasOwnProperty(a)&&l(h[a])&&(c=h[a],l(c.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:b}):f.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in h)if(h.hasOwnProperty(a)&&l(h[a])){c=h[a];let m=c.componentDatatype;m===X.DOUBLE&&(m=X.FLOAT),u=void 0,l(c.values)&&(u=yt.createVertexBuffer({context:t,typedArray:X.createTypedArray(m,c.values),usage:i})),f.push({index:o[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,_=n.indices;return l(_)&&(at.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=yt.createIndexBuffer({context:t,typedArray:new Uint32Array(_),usage:i,indexDatatype:Ne.UNSIGNED_INT}):p=yt.createIndexBuffer({context:t,typedArray:new Uint16Array(_),usage:i,indexDatatype:Ne.UNSIGNED_SHORT})),new ap({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(ap.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});ap.prototype.getAttribute=function(e){return this._attributes[e]};function zDe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Bt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function HDe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&l(r.value)&&r.vertexAttrib(t)}}ap.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&zDe(this),this._hasConstantAttributes&&HDe(this,this._gl)):DJ(this._gl,this._attributes,this._indexBuffer)};ap.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};ap.prototype.isDestroyed=function(){return!1};ap.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var ti=ap;function Wo(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=tt.RGBA,pixelDatatype:o=Ke.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new $t}=e,c=e.preMultiplyAlpha||i===tt.RGB||i===tt.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let h=u,p=tt.textureSizeInBytes(i,o,h,h)*6,_=tt.toInternalFormat(i,o,t),m=t._gl,x=m.TEXTURE_CUBE_MAP,b=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=x,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let T=l(n);function C(A){return new J1(t,b,x,A,_,i,o,h,c,r,T)}this._positiveX=C(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=C(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=C(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=C(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=C(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=C(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,IJ(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(x,b),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let A of Wo.faceNames())s6(this[A],n?.[A],0);m.bindTexture(x,null)}Wo.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new zr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,y(i,0)),r._unBind(),r.destroy()};Wo.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*GDe(){yield Wo.FaceName.POSITIVEX,yield Wo.FaceName.NEGATIVEX,yield Wo.FaceName.POSITIVEY,yield Wo.FaceName.NEGATIVEY,yield Wo.FaceName.POSITIVEZ,yield Wo.FaceName.NEGATIVEZ}Wo.faceNames=function(){return GDe()};function s6(e,t,n){n=y(n,0);let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,h=f._gl;if(!l(t)){h.texImage2D(i,n,a,o,o,0,r,Ke.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,_=4;l(p)&&(_=tt.alignmentInBytes(r,s,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,_),l(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=tt.flipY(p,r,s,o,o)),h.texImage2D(i,n,a,o,o,0,r,Ke.toWebGLConstant(s,f),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),h.texImage2D(i,n,a,r,Ke.toWebGLConstant(s,f),t))}Wo.loadFace=s6;Object.defineProperties(Wo.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){IJ(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});Wo.getDirection=function(e,t){switch(e){case Wo.FaceName.POSITIVEX:return d.clone(d.UNIT_X,t);case Wo.FaceName.NEGATIVEX:return d.negate(d.UNIT_X,t);case Wo.FaceName.POSITIVEY:return d.clone(d.UNIT_Y,t);case Wo.FaceName.NEGATIVEY:return d.negate(d.UNIT_Y,t);case Wo.FaceName.POSITIVEZ:return d.clone(d.UNIT_Z,t);case Wo.FaceName.NEGATIVEZ:return d.negate(d.UNIT_Z,t)}};function IJ(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Zt.NEAREST_MIPMAP_NEAREST,Zt.NEAREST_MIPMAP_LINEAR,Zt.LINEAR_MIPMAP_NEAREST,Zt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===Ke.FLOAT&&!r.textureFloatLinear||s===Ke.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Zt.NEAREST_MIPMAP_NEAREST:Zt.NEAREST,i=di.NEAREST);let a=r._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}Wo.prototype.loadMipmaps=function(e,t){t=y(t,!1);let n=this._context._gl,i=this._texture,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){let s=e[r],a=r+1;for(let c of Wo.faceNames())s6(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};Wo.prototype.generateMipmap=function(e){e=y(e,sp.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Wo.createVertexArray=function(e){let t=ja.createGeometry(ja.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),n=this._attributeLocations=Nn.createAttributeLocations(t);return ti.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Fe.STATIC_DRAW})};Wo.prototype.isDestroyed=function(){return!1};Wo.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var wr=Wo;function WDe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Cc=WDe;var iR=`/** + `;return r=v5(a),new Worker(r,o)}if(r=e,n||(r=en(`${$s._workerModulePrefix+i}.js`)),!zt.supportsEsmWebWorkers())throw new re("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function uwe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!zt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new re(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=en(t.fallbackModulePath),n}n.wasmBinaryFile=en(t.wasmBinaryFile);let i=await Se.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function $s(e,t){this._workerPath=e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var fwe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new re(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new he(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),w5.raiseEvent(s),i(s)}else w5.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},dwe=[];async function hwe(e,t,n){let i=await Promise.resolve(kQ());l(n)?i||(n.length=0):n=dwe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",fwe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:en.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function mwe(e,t,n){++e._activeTasks;try{let i=await hwe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}$s.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=D5(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return mwe(this,e,t)};$s.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=D5(this._workerPath),i=await uwe(this,e),o=await Promise.resolve(kQ()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new re("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};$s.prototype.isDestroyed=function(){return!1};$s.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};$s.taskCompletedEvent=w5;$s._defaultWorkerModulePrefix="Workers/";$s._workerModulePrefix=$s._defaultWorkerModulePrefix;$s._canTransferArrayBuffer=void 0;var yi=$s;function rp(){}rp._transcodeTaskProcessor=new yi("transcodeKTX2",Number.POSITIVE_INFINITY);rp._readyPromise=void 0;function pwe(){let e=rp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return rp._transcodeTaskProcessor;throw new re("KTX2 transcoder could not be initialized.")});rp._readyPromise=e}rp.transcode=function(e,t){return l(rp._readyPromise)||pwe(),rp._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;r<i;r++){let s=n[r];for(let a=0;a<o.length;a++){let c=s[o[a]];s[o[a]]=new G1(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)n[r]=n[r][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var W1=rp;var VQ;UQ.setKTX2SupportedFormats=function(e,t,n,i,o,r){VQ={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function UQ(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Se.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return W1.transcode(n,VQ)})}var ql=UQ;function gwe(e,t){this.start=y(e,0),this.stop=y(t,0)}var ja=gwe;function fn(e,t){this.center=d.clone(y(e,d.ZERO)),this.radius=y(t,0)}var R5=new d,O5=new d,M5=new d,L5=new d,N5=new d,F5=new d,B5=new d,Qs=new d,k5=new d,V5=new d,U5=new d,z5=new d,_we=4/3*P.PI;fn.fromPoints=function(e,t){if(l(t)||(t=new fn),!l(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=d.clone(e[0],B5),i=d.clone(n,R5),o=d.clone(n,O5),r=d.clone(n,M5),s=d.clone(n,L5),a=d.clone(n,N5),c=d.clone(n,F5),u=e.length,f;for(f=1;f<u;f++){d.clone(e[f],n);let R=n.x,M=n.y,L=n.z;R<i.x&&d.clone(n,i),R>s.x&&d.clone(n,s),M<o.y&&d.clone(n,o),M>a.y&&d.clone(n,a),L<r.z&&d.clone(n,r),L>c.z&&d.clone(n,c)}let h=d.magnitudeSquared(d.subtract(s,i,Qs)),p=d.magnitudeSquared(d.subtract(a,o,Qs)),_=d.magnitudeSquared(d.subtract(c,r,Qs)),m=i,x=s,b=h;p>b&&(b=p,m=o,x=a),_>b&&(b=_,m=r,x=c);let T=k5;T.x=(m.x+x.x)*.5,T.y=(m.y+x.y)*.5,T.z=(m.z+x.z)*.5;let C=d.magnitudeSquared(d.subtract(x,T,Qs)),A=Math.sqrt(C),S=V5;S.x=i.x,S.y=o.y,S.z=r.z;let v=U5;v.x=s.x,v.y=a.y,v.z=c.z;let D=d.midpoint(S,v,z5),O=0;for(f=0;f<u;f++){d.clone(e[f],n);let R=d.magnitude(d.subtract(n,D,Qs));R>O&&(O=R);let M=d.magnitudeSquared(d.subtract(n,T,Qs));if(M>C){let L=Math.sqrt(M);A=(A+L)*.5,C=A*A;let g=L-A;T.x=(A*T.x+g*n.x)/L,T.y=(A*T.y+g*n.y)/L,T.z=(A*T.z+g*n.z)/L}}return A<O?(d.clone(T,t.center),t.radius=A):(d.clone(D,t.center),t.radius=O),t};var zQ=new Pi,ywe=new d,xwe=new d,I5=new fe,P5=new fe;fn.fromRectangle2D=function(e,t,n){return fn.fromRectangleWithHeights2D(e,t,0,0,n)};fn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new fn),!l(e))return o.center=d.clone(d.ZERO,o.center),o.radius=0,o;zQ._ellipsoid=ee.default,t=y(t,zQ),se.southwest(e,I5),I5.height=n,se.northeast(e,P5),P5.height=i;let r=t.project(I5,ywe),s=t.project(P5,xwe),a=s.x-r.x,c=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+c*.5,f.z=r.z+u*.5,o};var bwe=[];fn.fromRectangle3D=function(e,t,n,i){if(t=y(t,ee.default),n=y(n,0),l(i)||(i=new fn),!l(e))return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;let o=se.subsample(e,t,n,bwe);return fn.fromPoints(o,i)};fn.fromVertices=function(e,t,n,i){if(l(i)||(i=new fn),!l(e)||e.length===0)return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;t=y(t,d.ZERO),n=y(n,3);let o=B5;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=d.clone(o,R5),s=d.clone(o,O5),a=d.clone(o,M5),c=d.clone(o,L5),u=d.clone(o,N5),f=d.clone(o,F5),h=e.length,p;for(p=0;p<h;p+=n){let L=e[p]+t.x,g=e[p+1]+t.y,E=e[p+2]+t.z;o.x=L,o.y=g,o.z=E,L<r.x&&d.clone(o,r),L>c.x&&d.clone(o,c),g<s.y&&d.clone(o,s),g>u.y&&d.clone(o,u),E<a.z&&d.clone(o,a),E>f.z&&d.clone(o,f)}let _=d.magnitudeSquared(d.subtract(c,r,Qs)),m=d.magnitudeSquared(d.subtract(u,s,Qs)),x=d.magnitudeSquared(d.subtract(f,a,Qs)),b=r,T=c,C=_;m>C&&(C=m,b=s,T=u),x>C&&(C=x,b=a,T=f);let A=k5;A.x=(b.x+T.x)*.5,A.y=(b.y+T.y)*.5,A.z=(b.z+T.z)*.5;let S=d.magnitudeSquared(d.subtract(T,A,Qs)),v=Math.sqrt(S),D=V5;D.x=r.x,D.y=s.y,D.z=a.z;let O=U5;O.x=c.x,O.y=u.y,O.z=f.z;let R=d.midpoint(D,O,z5),M=0;for(p=0;p<h;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let L=d.magnitude(d.subtract(o,R,Qs));L>M&&(M=L);let g=d.magnitudeSquared(d.subtract(o,A,Qs));if(g>S){let E=Math.sqrt(g);v=(v+E)*.5,S=v*v;let w=E-v;A.x=(v*A.x+w*o.x)/E,A.y=(v*A.y+w*o.y)/E,A.z=(v*A.z+w*o.z)/E}}return v<M?(d.clone(A,i.center),i.radius=v):(d.clone(R,i.center),i.radius=M),i};fn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new fn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=d.clone(d.ZERO,n.center),n.radius=0,n;let i=B5;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=d.clone(i,R5),r=d.clone(i,O5),s=d.clone(i,M5),a=d.clone(i,L5),c=d.clone(i,N5),u=d.clone(i,F5),f=e.length,h;for(h=0;h<f;h+=3){let M=e[h]+t[h],L=e[h+1]+t[h+1],g=e[h+2]+t[h+2];i.x=M,i.y=L,i.z=g,M<o.x&&d.clone(i,o),M>a.x&&d.clone(i,a),L<r.y&&d.clone(i,r),L>c.y&&d.clone(i,c),g<s.z&&d.clone(i,s),g>u.z&&d.clone(i,u)}let p=d.magnitudeSquared(d.subtract(a,o,Qs)),_=d.magnitudeSquared(d.subtract(c,r,Qs)),m=d.magnitudeSquared(d.subtract(u,s,Qs)),x=o,b=a,T=p;_>T&&(T=_,x=r,b=c),m>T&&(T=m,x=s,b=u);let C=k5;C.x=(x.x+b.x)*.5,C.y=(x.y+b.y)*.5,C.z=(x.z+b.z)*.5;let A=d.magnitudeSquared(d.subtract(b,C,Qs)),S=Math.sqrt(A),v=V5;v.x=o.x,v.y=r.y,v.z=s.z;let D=U5;D.x=a.x,D.y=c.y,D.z=u.z;let O=d.midpoint(v,D,z5),R=0;for(h=0;h<f;h+=3){i.x=e[h]+t[h],i.y=e[h+1]+t[h+1],i.z=e[h+2]+t[h+2];let M=d.magnitude(d.subtract(i,O,Qs));M>R&&(R=M);let L=d.magnitudeSquared(d.subtract(i,C,Qs));if(L>A){let g=Math.sqrt(L);S=(S+g)*.5,A=S*S;let E=g-S;C.x=(S*C.x+E*i.x)/g,C.y=(S*C.y+E*i.y)/g,C.z=(S*C.z+E*i.z)/g}}return S<R?(d.clone(C,n.center),n.radius=S):(d.clone(O,n.center),n.radius=R),n};fn.fromCornerPoints=function(e,t,n){l(n)||(n=new fn);let i=d.midpoint(e,t,n.center);return n.radius=d.distance(i,t),n};fn.fromEllipsoid=function(e,t){return l(t)||(t=new fn),d.clone(d.ZERO,t.center),t.radius=e.maximumRadius,t};var Twe=new d;fn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new fn),!l(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return fn.clone(e[0],t);if(n===2)return fn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=fn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,d.distance(r,a.center,Twe)+a.radius)}return t.radius=s,t};var Cwe=new d,Awe=new d,Ewe=new d;fn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new fn);let n=e.halfAxes,i=$.getColumn(n,0,Cwe),o=$.getColumn(n,1,Awe),r=$.getColumn(n,2,Ewe);return d.add(i,o,i),d.add(i,r,i),t.center=d.clone(e.center,t.center),t.radius=d.magnitude(i),t};var Swe=new d,vwe=new d;fn.fromTransformation=function(e,t){l(t)||(t=new fn);let n=F.getTranslation(e,Swe),i=F.getScale(e,vwe),o=.5*d.magnitude(i);return t.center=d.clone(n,t.center),t.radius=o,t};fn.clone=function(e,t){if(l(e))return l(t)?(t.center=d.clone(e.center,t.center),t.radius=e.radius,t):new fn(e.center,e.radius)};fn.packedLength=4;fn.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};fn.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new fn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var wwe=new d,Dwe=new d;fn.union=function(e,t,n){l(n)||(n=new fn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=d.subtract(r,i,wwe),c=d.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let u=(o+c+s)*.5,f=d.multiplyByScalar(a,(-o+u)/c,Dwe);return d.add(f,i,f),d.clone(f,n.center),n.radius=u,n};var Iwe=new d;fn.expand=function(e,t,n){n=fn.clone(e,n);let i=d.magnitude(d.subtract(t,n.center,Iwe));return i>n.radius&&(n.radius=i),n};fn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=d.dot(o,n)+t.distance;return r<-i?Wt.OUTSIDE:r<i?Wt.INTERSECTING:Wt.INSIDE};fn.transform=function(e,t,n){return l(n)||(n=new fn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var Pwe=new d;fn.distanceSquaredTo=function(e,t){let n=d.subtract(e.center,t,Pwe),i=d.magnitude(n)-e.radius;return i<=0?0:i*i};fn.transformWithoutScale=function(e,t,n){return l(n)||(n=new fn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var Rwe=new d;fn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new ja);let o=d.subtract(e.center,t,Rwe),r=d.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var HQ=new d,Owe=new d,Mwe=new d,Lwe=new d,Nwe=new d,Fwe=new fe,WQ=new Array(8);for(let e=0;e<8;++e)WQ[e]=new d;var GQ=new Pi;fn.projectTo2D=function(e,t,n){GQ._ellipsoid=ee.default,t=y(t,GQ);let i=t.ellipsoid,o=e.center,r=e.radius,s;d.equals(o,d.ZERO)?s=d.clone(d.UNIT_X,HQ):s=i.geodeticSurfaceNormal(o,HQ);let a=d.cross(d.UNIT_Z,s,Owe);d.normalize(a,a);let c=d.cross(s,a,Mwe);d.normalize(c,c),d.multiplyByScalar(s,r,s),d.multiplyByScalar(c,r,c),d.multiplyByScalar(a,r,a);let u=d.negate(c,Nwe),f=d.negate(a,Lwe),h=WQ,p=h[0];d.add(s,c,p),d.add(p,a,p),p=h[1],d.add(s,c,p),d.add(p,f,p),p=h[2],d.add(s,u,p),d.add(p,f,p),p=h[3],d.add(s,u,p),d.add(p,a,p),d.negate(s,s),p=h[4],d.add(s,c,p),d.add(p,a,p),p=h[5],d.add(s,c,p),d.add(p,f,p),p=h[6],d.add(s,u,p),d.add(p,f,p),p=h[7],d.add(s,u,p),d.add(p,a,p);let _=h.length;for(let T=0;T<_;++T){let C=h[T];d.add(o,C,C);let A=i.cartesianToCartographic(C,Fwe);t.project(A,C)}n=fn.fromPoints(h,n),o=n.center;let m=o.x,x=o.y,b=o.z;return o.x=b,o.y=m,o.z=x,n};fn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};fn.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&e.radius===t.radius};fn.prototype.intersectPlane=function(e){return fn.intersectPlane(this,e)};fn.prototype.distanceSquaredTo=function(e){return fn.distanceSquaredTo(this,e)};fn.prototype.computePlaneDistances=function(e,t,n){return fn.computePlaneDistances(this,e,t,n)};fn.prototype.isOccluded=function(e){return fn.isOccluded(this,e)};fn.prototype.equals=function(e){return fn.equals(this,e)};fn.prototype.clone=function(e){return fn.clone(this,e)};fn.prototype.volume=function(){let e=this.radius;return _we*e*e*e};var ae=fn;function Bwe(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var dn=Bwe;var kwe={NONE:0,TOP:1,ALL:2},rn=Object.freeze(kwe);function ts(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}ts.POSITION_ONLY=Object.freeze(new ts({position:!0}));ts.POSITION_AND_NORMAL=Object.freeze(new ts({position:!0,normal:!0}));ts.POSITION_NORMAL_AND_ST=Object.freeze(new ts({position:!0,normal:!0,st:!0}));ts.POSITION_AND_ST=Object.freeze(new ts({position:!0,st:!0}));ts.POSITION_AND_COLOR=Object.freeze(new ts({position:!0,color:!0}));ts.ALL=Object.freeze(new ts({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ts.DEFAULT=ts.POSITION_NORMAL_AND_ST;ts.packedLength=6;ts.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};ts.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ts),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};ts.clone=function(e,t){if(l(e))return l(t)||(t=new ts),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Ie=ts;var Vwe=new d;function Yl(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Ie.DEFAULT);this._minimum=d.clone(t),this._maximum=d.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Yl.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=d.multiplyByScalar(t,.5,new d);return new Yl({minimum:d.negate(n,new d),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Yl.fromAxisAlignedBoundingBox=function(e){return new Yl({minimum:e.minimum,maximum:e.maximum})};Yl.packedLength=2*d.packedLength+Ie.packedLength+1;Yl.pack=function(e,t,n){return n=y(n,0),d.pack(e._minimum,t,n),d.pack(e._maximum,t,n+d.packedLength),Ie.pack(e._vertexFormat,t,n+2*d.packedLength),t[n+2*d.packedLength+Ie.packedLength]=y(e._offsetAttribute,-1),t};var qQ=new d,YQ=new d,XQ=new Ie,jQ={minimum:qQ,maximum:YQ,vertexFormat:XQ,offsetAttribute:void 0};Yl.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,qQ),o=d.unpack(e,t+d.packedLength,YQ),r=Ie.unpack(e,t+2*d.packedLength,XQ),s=e[t+2*d.packedLength+Ie.packedLength];return l(n)?(n._minimum=d.clone(i,n._minimum),n._maximum=d.clone(o,n._maximum),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(jQ.offsetAttribute=s===-1?void 0:s,new Yl(jQ))};Yl.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(d.equals(t,n))return;let o=new dn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=d.subtract(n,t,Vwe),c=d.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===rn.NONE?0:1,h=new Uint8Array(u/3).fill(f);o.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new st({attributes:o,indices:r,primitiveType:Me.TRIANGLES,boundingSphere:new ae(d.ZERO,c),offsetAttribute:e._offsetAttribute})};var H5;Yl.getUnitBox=function(){return l(H5)||(H5=Yl.createGeometry(Yl.fromDimensions({dimensions:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),H5};var qa=Yl;var $i={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};$i.getMathType=function(e){switch(e){case $i.SCALAR:return Number;case $i.VEC2:return U;case $i.VEC3:return d;case $i.VEC4:return oe;case $i.MAT2:return Ri;case $i.MAT3:return $;case $i.MAT4:return F}};$i.getNumberOfComponents=function(e){switch(e){case $i.SCALAR:return 1;case $i.VEC2:return 2;case $i.VEC3:return 3;case $i.VEC4:case $i.MAT2:return 4;case $i.MAT3:return 9;case $i.MAT4:return 16}};$i.getAttributeLocationCount=function(e){switch(e){case $i.SCALAR:case $i.VEC2:case $i.VEC3:case $i.VEC4:return 1;case $i.MAT2:return 2;case $i.MAT3:return 3;case $i.MAT4:return 4}};$i.getGlslType=function(e){switch(e){case $i.SCALAR:return"float";case $i.VEC2:return"vec2";case $i.VEC3:return"vec3";case $i.VEC4:return"vec4";case $i.MAT2:return"mat2";case $i.MAT3:return"mat3";case $i.MAT4:return"mat4"}};var tn=Object.freeze($i);var KQ=1/256,ZQ=256,go={};go.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(o)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};go.octEncode=function(e,t){return go.octEncodeInRange(e,255,t)};var jS=new U,$Q=new Uint8Array(1);function j1(e){return $Q[0]=e,$Q[0]}go.octEncodeToCartesian4=function(e,t){return go.octEncodeInRange(e,65535,jS),t.x=j1(jS.x*KQ),t.y=j1(jS.x),t.z=j1(jS.y*KQ),t.w=j1(jS.y),t};go.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*P.signNotZero(o),i.y=(1-Math.abs(o))*P.signNotZero(i.y)}return d.normalize(i,i)};go.octDecode=function(e,t,n){return go.octDecodeInRange(e,t,255,n)};go.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*ZQ+i,a=o*ZQ+r;return go.octDecodeInRange(s,a,65535,t)};go.octPackFloat=function(e){return 256*e.x+e.y};var W5=new U;go.octEncodeFloat=function(e){return go.octEncode(e,W5),go.octPackFloat(W5)};go.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return go.octDecode(i,o,t)};go.octPack=function(e,t,n,i){let o=go.octEncodeFloat(e),r=go.octEncodeFloat(t),s=go.octEncode(n,W5);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};go.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;go.octDecodeFloat(s,t),go.octDecodeFloat(c,n),go.octDecode(r,a,i)};go.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};go.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function G5(e){return e>>1^-(e&1)}go.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=G5(e[a]),r+=G5(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=G5(n[a]),n[a]=s)};go.dequantize=function(e,t,n,i){let o=tn.getNumberOfComponents(n),r;switch(t){case X.BYTE:r=127;break;case X.UNSIGNED_BYTE:r=255;break;case X.SHORT:r=32767;break;case X.UNSIGNED_SHORT:r=65535;break;case X.INT:r=2147483647;break;case X.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let u=a*o+c;s[u]=Math.max(e[u]/r,-1)}return s};go.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&o,h=c&i,p=3*a;t[p]=u*r,t[p+1]=f*s,t[p+2]=h*r}return t};var Ln=go;var QQ=new d,JQ=new d,eJ=new d;function Uwe(e,t,n,i,o){l(o)||(o=new d);let r,s,a,c,u,f,h,p;if(l(t.z)){if(d.equalsEpsilon(e,t,P.EPSILON14))return d.clone(d.UNIT_X,o);if(d.equalsEpsilon(e,n,P.EPSILON14))return d.clone(d.UNIT_Y,o);if(d.equalsEpsilon(e,i,P.EPSILON14))return d.clone(d.UNIT_Z,o);r=d.subtract(n,t,QQ),s=d.subtract(i,t,JQ),a=d.subtract(e,t,eJ),c=d.dot(r,r),u=d.dot(r,s),f=d.dot(r,a),h=d.dot(s,s),p=d.dot(s,a)}else{if(U.equalsEpsilon(e,t,P.EPSILON14))return d.clone(d.UNIT_X,o);if(U.equalsEpsilon(e,n,P.EPSILON14))return d.clone(d.UNIT_Y,o);if(U.equalsEpsilon(e,i,P.EPSILON14))return d.clone(d.UNIT_Z,o);r=U.subtract(n,t,QQ),s=U.subtract(i,t,JQ),a=U.subtract(e,t,eJ),c=U.dot(r,r),u=U.dot(r,s),f=U.dot(r,a),h=U.dot(s,s),p=U.dot(s,a)}o.y=h*f-u*p,o.z=c*p-u*f;let _=c*h-u*u;if(_!==0)return o.y/=_,o.z/=_,o.x=1-o.y-o.z,o}var gT=Uwe;function wh(){this.high=d.clone(d.ZERO),this.low=d.clone(d.ZERO)}wh.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var sp={high:0,low:0};wh.fromCartesian=function(e,t){l(t)||(t=new wh);let n=t.high,i=t.low;return wh.encode(e.x,sp),n.x=sp.high,i.x=sp.low,wh.encode(e.y,sp),n.y=sp.high,i.y=sp.low,wh.encode(e.z,sp),n.z=sp.high,i.z=sp.low,t};var j5=new wh;wh.writeElements=function(e,t,n){wh.fromCartesian(e,j5);let i=j5.high,o=j5.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var Hn=wh;var q5={};q5.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function tJ(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}q5.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<P.EPSILON14)return[0,0];if(c>u&&u/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=tJ(o,-r,P.EPSILON14);if(s<0)return[];let a=-.5*tJ(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var ul=q5;var X5={};X5.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function Y5(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,u=r*a,f=r*r,h=s*s,p=o*s-f,_=o*a-r*s,m=r*a-h,x=4*p*m-_*_,b,T;if(x<0){let W,Y,J;f*u>=c*h?(W=o,Y=p,J=-2*r*p+o*_):(W=a,Y=m,J=-a*_+2*s*m);let K=-(J<0?-1:1)*Math.abs(W)*Math.sqrt(-x);T=-J+K;let Q=T/2,de=Q<0?-Math.pow(-Q,1/3):Math.pow(Q,1/3),xe=T===K?-de:-Y/de;return b=Y<=0?de+xe:-J/(de*de+xe*xe+Y),f*u>=c*h?[(b-r)/o]:[-a/(b+s)]}let C=p,A=-2*r*p+o*_,S=m,v=-a*_+2*s*m,D=Math.sqrt(x),O=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*D,-A)/3);b=2*Math.sqrt(-C);let M=Math.cos(R);T=b*M;let L=b*(-M/2-O*Math.sin(R)),g=T+L>2*r?T-r:L-r,E=o,w=g/E;R=Math.abs(Math.atan2(a*D,-v)/3),b=2*Math.sqrt(-S),M=Math.cos(R),T=b*M,L=b*(-M/2-O*Math.sin(R));let I=-a,N=T+L<2*s?T+s:L+s,B=I/N,H=E*N,V=-g*N-E*I,G=g*I,k=(s*V-r*G)/(-r*V+s*H);return w<=k?w<=B?k<=B?[w,k,B]:[w,B,k]:[B,w,k]:w<=B?[k,w,B]:k<=B?[k,B,w]:[B,k,w]}X5.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return ul.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=ul.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return Y5(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):Y5(e,t,0,i);if(i===0)return o=ul.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return Y5(e,t,n,i)};var _T=X5;var K5={};K5.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,u=n*n,f=u*n,h=i*i,p=h*i,_=o*o,m=_*o;return a*u*h-4*c*p-4*e*f*h+18*e*t*n*p-27*r*h*h+256*s*m+o*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*h+144*r*n*h)+_*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function ud(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=_T.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let h=ul.computeRealRoots(1,r,a);if(h.length===2){let p=h[0],_=h[1],m;if(p>=0&&_>=0){let x=Math.sqrt(p),b=Math.sqrt(_);return[u-b,u-x,u+x,u+b]}else{if(p>=0&&_<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&_>=0)return m=Math.sqrt(_),[u-m,u+m]}}return[]}else if(f>0){let h=Math.sqrt(f),p=(r+f-s/h)/2,_=(r+f+s/h)/2,m=ul.computeRealRoots(1,h,p),x=ul.computeRealRoots(1,-h,_);return m.length!==0?(m[0]+=u,m[1]+=u,x.length!==0?(x[0]+=u,x[1]+=u,m[1]<=x[0]?[m[0],m[1],x[0],x[1]]:x[1]<=m[0]?[x[0],x[1],m[0],m[1]]:m[0]>=x[0]&&m[1]<=x[1]?[x[0],m[0],m[1],x[1]]:x[0]>=m[0]&&x[1]<=m[1]?[m[0],x[0],x[1],m[1]]:m[0]>x[0]&&m[0]<x[1]?[x[0],m[0],x[1],m[1]]:[m[0],x[0],m[1],x[1]]):m):x.length!==0?(x[0]+=u,x[1]+=u,x):[]}}return[]}function qS(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,u=s*i-n*t*e+o,f=_T.computeRealRoots(1,a,c,u);if(f.length>0){let h=f[0],p=t-h,_=p*p,m=e/2,x=p/2,b=_-4*i,T=_+4*Math.abs(i),C=s-4*h,A=s+4*Math.abs(h),S,v;if(h<0||b*A<C*T){let E=Math.sqrt(C);S=E/2,v=E===0?0:(e*x-n)/E}else{let E=Math.sqrt(b);S=E===0?0:(e*x-n)/E,v=E/2}let D,O;m===0&&S===0?(D=0,O=0):P.sign(m)===P.sign(S)?(D=m+S,O=h/D):(O=m-S,D=h/O);let R,M;x===0&&v===0?(R=0,M=0):P.sign(x)===P.sign(v)?(R=x+v,M=i/R):(M=x-v,R=i/M);let L=ul.computeRealRoots(1,D,R),g=ul.computeRealRoots(1,O,M);if(L.length!==0)return g.length!==0?L[1]<=g[0]?[L[0],L[1],g[0],g[1]]:g[1]<=L[0]?[g[0],g[1],L[0],L[1]]:L[0]>=g[0]&&L[1]<=g[1]?[g[0],L[0],L[1],g[1]]:g[0]>=L[0]&&g[1]<=L[1]?[L[0],g[0],g[1],L[1]]:L[0]>g[0]&&L[0]<g[1]?[g[0],L[0],g[1],L[1]]:[L[0],g[0],L[1],g[1]]:L;if(g.length!==0)return g}return[]}K5.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<P.EPSILON15)return _T.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return ud(r,s,a,c);case 1:return qS(r,s,a,c);case 2:return qS(r,s,a,c);case 3:return ud(r,s,a,c);case 4:return ud(r,s,a,c);case 5:return qS(r,s,a,c);case 6:return ud(r,s,a,c);case 7:return ud(r,s,a,c);case 8:return qS(r,s,a,c);case 9:return ud(r,s,a,c);case 10:return ud(r,s,a,c);case 11:return qS(r,s,a,c);case 12:return ud(r,s,a,c);case 13:return ud(r,s,a,c);case 14:return ud(r,s,a,c);case 15:return ud(r,s,a,c);default:return}};var q1=K5;function Y1(e,t){t=d.clone(y(t,d.ZERO)),d.equals(t,d.ZERO)||d.normalize(t,t),this.origin=d.clone(y(e,d.ZERO)),this.direction=t}Y1.clone=function(e,t){if(l(e))return l(t)?(t.origin=d.clone(e.origin),t.direction=d.clone(e.direction),t):new Y1(e.origin,e.direction)};Y1.getPoint=function(e,t,n){return l(n)||(n=new d),n=d.multiplyByScalar(e.direction,t,n),d.add(e.origin,n,n)};var pn=Y1;var Lo={};Lo.rayPlane=function(e,t,n){l(n)||(n=new d);let i=e.origin,o=e.direction,r=t.normal,s=d.dot(r,o);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-d.dot(r,i))/s;if(!(a<0))return n=d.multiplyByScalar(o,a,n),d.add(i,n,n)};var zwe=new d,Hwe=new d,lJ=new d,nJ=new d,iJ=new d;Lo.rayTriangleParametric=function(e,t,n,i,o){o=y(o,!1);let r=e.origin,s=e.direction,a=d.subtract(n,t,zwe),c=d.subtract(i,t,Hwe),u=d.cross(s,c,lJ),f=d.dot(a,u),h,p,_,m,x;if(o){if(f<P.EPSILON6||(h=d.subtract(r,t,nJ),_=d.dot(h,u),_<0||_>f)||(p=d.cross(h,a,iJ),m=d.dot(s,p),m<0||_+m>f))return;x=d.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let b=1/f;if(h=d.subtract(r,t,nJ),_=d.dot(h,u)*b,_<0||_>1||(p=d.cross(h,a,iJ),m=d.dot(s,p)*b,m<0||_+m>1))return;x=d.dot(c,p)*b}return x};Lo.rayTriangle=function(e,t,n,i,o,r){let s=Lo.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new d),d.multiplyByScalar(e.direction,s,r),d.add(e.origin,r,r)};var Gwe=new pn;Lo.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=Gwe;d.clone(e,a.origin),d.subtract(t,e,a.direction),d.normalize(a.direction,a.direction);let c=Lo.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>d.distance(e,t)))return l(s)||(s=new d),d.multiplyByScalar(a.direction,c,s),d.add(a.origin,s,s)};function Wwe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var jwe={root0:0,root1:0};function uJ(e,t,n){l(n)||(n=new ja);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=d.subtract(i,r,lJ),c=d.dot(o,o),u=2*d.dot(o,a),f=d.magnitudeSquared(a)-s,h=Wwe(c,u,f,jwe);if(l(h))return n.start=h.root0,n.stop=h.root1,n}Lo.raySphere=function(e,t,n){if(n=uJ(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var qwe=new pn;Lo.lineSegmentSphere=function(e,t,n,i){let o=qwe;d.clone(e,o.origin);let r=d.subtract(t,e,o.direction),s=d.magnitude(r);if(d.normalize(r,r),i=uJ(o,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var Ywe=new d,Xwe=new d;Lo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=d.multiplyComponents(n,e.origin,Ywe),o=d.multiplyComponents(n,e.direction,Xwe),r=d.magnitudeSquared(i),s=d.dot(i,o),a,c,u,f,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=d.magnitudeSquared(o),u=c*a,p<u)return;if(p>u){f=s*s-u,h=-s+Math.sqrt(f);let m=h/c,x=a/h;return m<x?new ja(m,x):{start:x,stop:m}}let _=Math.sqrt(a/c);return new ja(_,_)}else if(r<1)return a=r-1,c=d.magnitudeSquared(o),u=c*a,f=s*s-u,h=-s+Math.sqrt(f),new ja(0,h/c);if(s<0)return c=d.magnitudeSquared(o),new ja(0,-s/c)};function P0(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Lo.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=o*(i*P0(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*P0(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],P.EPSILON15),h=o*(i*P0(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,_=[];if(h===0&&f===0){if(p=ul.computeRealRoots(a,c,u),p.length===0)return _;let R=p[0],M=Math.sqrt(Math.max(1-R*R,0));if(_.push(new d(i,o*R,o*-M)),_.push(new d(i,o*R,o*M)),p.length===2){let L=p[1],g=Math.sqrt(Math.max(1-L*L,0));_.push(new d(i,o*L,o*-g)),_.push(new d(i,o*L,o*g))}return _}let m=h*h,x=f*f,b=a*a,T=h*f,C=b+x,A=2*(c*a+T),S=2*u*a+c*c-x+m,v=2*(u*c-T),D=u*u-m;if(C===0&&A===0&&S===0&&v===0)return _;p=q1.computeRealRoots(C,A,S,v,D);let O=p.length;if(O===0)return _;for(let R=0;R<O;++R){let M=p[R],L=M*M,g=Math.max(1-L,0),E=Math.sqrt(g),w;P.sign(a)===P.sign(u)?w=P0(a*L+u,c*M,P.EPSILON12):P.sign(u)===P.sign(c*M)?w=P0(a*L,c*M+u,P.EPSILON12):w=P0(a*L+c*M,u,P.EPSILON12);let I=P0(f*M,h,P.EPSILON15),N=w*I;N<0?_.push(new d(i,o*M,o*E)):N>0?_.push(new d(i,o*M,o*-E)):E!==0?(_.push(new d(i,o*M,o*-E)),_.push(new d(i,o*M,o*E)),++R):_.push(new d(i,o*M,o*E))}return _};var Z5=new d,oJ=new d,rJ=new d,X1=new d,Kwe=new d,Zwe=new $,$we=new $,Qwe=new $,Jwe=new $,eDe=new $,sJ=new $,aJ=new $,cJ=new d,tDe=new d,nDe=new fe;Lo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!d.equals(n,d.ZERO)){let D=t.geodeticSurfaceNormal(n,Z5);if(d.dot(i,D)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,Z5),s=d.normalize(r,r),a=d.mostOrthogonalAxis(r,X1),c=d.normalize(d.cross(a,s,oJ),oJ),u=d.normalize(d.cross(s,c,rJ),rJ),f=Zwe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let h=$.transpose(f,$we),p=$.fromScale(t.radii,Qwe),_=$.fromScale(t.oneOverRadii,Jwe),m=eDe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let x=$.multiply($.multiply(h,_,sJ),m,sJ),b=$.multiply($.multiply(x,p,aJ),f,aJ),T=$.multiplyByVector(x,n,Kwe),C=Lo.quadraticVectorExpression(b,d.negate(T,Z5),0,0,1),A,S,v=C.length;if(v>0){let D=d.clone(d.ZERO,tDe),O=Number.NEGATIVE_INFINITY;for(let M=0;M<v;++M){A=$.multiplyByVector(p,$.multiplyByVector(f,C[M],cJ),cJ);let L=d.normalize(d.subtract(A,n,X1),X1),g=d.dot(L,i);g>O&&(O=g,D=d.clone(A,D))}let R=t.cartesianToCartographic(D,nDe);return O=P.clamp(O,0,1),S=d.magnitude(d.subtract(D,n,X1))*Math.sqrt(1-O*O),S=o?-S:S,R.height=S,t.cartographicToCartesian(R,new d)}};var iDe=new d;Lo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new d);let o=d.subtract(t,e,iDe),r=n.normal,s=d.dot(r,o);if(Math.abs(s)<P.EPSILON6)return;let a=d.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return d.multiplyByScalar(o,c,i),d.add(e,i,i),i};Lo.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=d.dot(o,e)+r<0,a=d.dot(o,t)+r<0,c=d.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,h;if((u===1||u===2)&&(f=new d,h=new d),u===1){if(s)return Lo.lineSegmentPlane(e,t,i,f),Lo.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Lo.lineSegmentPlane(t,n,i,f),Lo.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Lo.lineSegmentPlane(n,e,i,f),Lo.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return Lo.lineSegmentPlane(e,n,i,f),Lo.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}else return Lo.lineSegmentPlane(n,t,i,f),Lo.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};else return Lo.lineSegmentPlane(t,e,i,f),Lo.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,f,h],indices:[1,2,4,1,4,3,0,3,4]}};var Qn=Lo;function Rs(e,t){this.normal=d.clone(e),this.distance=t}Rs.fromPointNormal=function(e,t,n){let i=-d.dot(t,e);return l(n)?(d.clone(t,n.normal),n.distance=i,n):new Rs(t,i)};var oDe=new d;Rs.fromCartesian4=function(e,t){let n=d.fromCartesian4(e,oDe),i=e.w;return l(t)?(d.clone(n,t.normal),t.distance=i,t):new Rs(n,i)};Rs.getPointDistance=function(e,t){return d.dot(e.normal,t)+e.distance};var rDe=new d;Rs.projectPointOntoPlane=function(e,t,n){l(n)||(n=new d);let i=Rs.getPointDistance(e,t),o=d.multiplyByScalar(e.normal,i,rDe);return d.subtract(t,o,n)};var sDe=new F,aDe=new oe,cDe=new d;Rs.transform=function(e,t,n){let i=e.normal,o=e.distance,r=F.inverseTranspose(t,sDe),s=oe.fromElements(i.x,i.y,i.z,o,aDe);s=F.multiplyByVector(r,s,s);let a=d.fromCartesian4(s,cDe);return s=oe.divideByScalar(s,d.magnitude(a),s),Rs.fromCartesian4(s,n)};Rs.clone=function(e,t){return l(t)?(d.clone(e.normal,t.normal),t.distance=e.distance,t):new Rs(e.normal,e.distance)};Rs.equals=function(e,t){return e.distance===t.distance&&d.equals(e.normal,t.normal)};Rs.ORIGIN_XY_PLANE=Object.freeze(new Rs(d.UNIT_Z,0));Rs.ORIGIN_YZ_PLANE=Object.freeze(new Rs(d.UNIT_X,0));Rs.ORIGIN_ZX_PLANE=Object.freeze(new Rs(d.UNIT_Y,0));var sn=Rs;var $5={};$5.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};$5.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(g,E,w,I){for(;E.length>=1;){let N=E[E.length-1];if(E.splice(E.length-1,1),g[N].numLiveTriangles>0)return N}for(;o<I;){if(g[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(g,E,w,I,N,B,H){let V=-1,G,k=-1,W=0;for(;W<w.length;){let Y=w[W];I[Y].numLiveTriangles&&(G=0,N-I[Y].timeStamp+2*I[Y].numLiveTriangles<=E&&(G=N-I[Y].timeStamp),(G>k||k===-1)&&(k=G,V=Y)),++W}return V===-1?r(I,B,g,H):V}let a=t.length,c=0,u=0,f=t[u],h=a;if(l(n))c=n+1;else{for(;u<h;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],_;for(_=0;_<c;_++)p[_]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<h;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let x=0,b=i+1;o=1;let T=[],C=[],A,S,v=0,D=[],O=a/3,R=[];for(_=0;_<O;_++)R[_]=!1;let M,L;for(;x!==-1;){T=[],S=p[x],L=S.vertexTriangles.length;for(let g=0;g<L;++g)if(m=S.vertexTriangles[g],!R[m]){R[m]=!0,u=m+m+m;for(let E=0;E<3;++E)M=t[u],T.push(M),C.push(M),D[v]=M,++v,A=p[M],--A.numLiveTriangles,b-A.timeStamp>i&&(A.timeStamp=b,++b),++u}x=s(t,i,T,p,b,C,c)}return D};var K1=$5;var Cc={};function nR(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function lDe(e){let t=e.length,n=t/3*6,i=Ne.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)nR(i,o,e[r],e[r+1],e[r+2]);return i}function uDe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ne.createTypedArray(t,n);nR(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)nR(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function fDe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ne.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)nR(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Cc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Me.TRIANGLES:e.indices=lDe(t);break;case Me.TRIANGLE_STRIP:e.indices=uDe(t);break;case Me.TRIANGLE_FAN:e.indices=fDe(t);break}e.primitiveType=Me.LINES}return e};Cc.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ae(u.center,u.radius+n)),new st({attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Me.LINES,boundingSphere:c})};Cc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];l(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=o++);return i};Cc.reorderForPreVertexCache=function(e){let t=st.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Ne.createTypedArray(t,r),a=0,c=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[c]=f:(f=o[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let h=e.attributes;for(let p in h)if(h.hasOwnProperty(p)&&l(h[p])&&l(h[p].values)){let _=h[p],m=_.values,x=0,b=_.componentsPerAttribute,T=X.createTypedArray(_.componentDatatype,u*b);for(;x<t;){let C=i[x];if(C!==-1)for(let A=0;A<b;A++)T[b*C+A]=m[b*x+A];++x}_.values=T}}return e};Cc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Me.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=K1.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function fJ(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new ve({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function dDe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}Cc.fitToUnsignedShortIndices=function(e){let t=[],n=st.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=fJ(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Me.TRIANGLES?u=3:e.primitiveType===Me.LINES?u=2:e.primitiveType===Me.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let h=0;h<u;++h){let p=a[f+h],_=i[p];l(_)||(_=r++,i[p]=_,dDe(s,e.attributes,p)),o.push(_)}r+u>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new st({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=fJ(e.attributes))}o.length!==0&&t.push(new st({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var dJ=new d,hDe=new fe;Cc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Pi;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let h=d.fromArray(a,f,dJ),p=s.cartesianToCartographic(h,hDe),_=o.project(p,dJ);c[u++]=_.x,c[u++]=_.y,c[u++]=_.z}return e.attributes[n]=r,e.attributes[i]=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var Q5={high:0,low:0};Cc.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Hn.encode(r[f],Q5),a[f]=Q5.high,c[f]=Q5.low;let u=o.componentsPerAttribute;return e.attributes[n]=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var dd=new d;function J5(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,dd),F.multiplyByPoint(e,dd,dd),d.pack(dd,n,o)}}function e6(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,dd),$.multiplyByVector(e,dd,dd),dd=d.normalize(dd,dd),d.pack(dd,n,o)}}var Z1=new F,$1=new $;Cc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;J5(t,n.position),J5(t,n.prevPosition),J5(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(F.inverse(t,Z1),F.transpose(Z1,Z1),F.getMatrix3(Z1,$1),e6($1,n.normal),e6($1,n.tangent),e6($1,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ae.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function mDe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[r]=new ve({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:X.createTypedArray(s.componentDatatype,a)}))}return i}var pDe=new d;function t6(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=mDe(e,t),h,p,_;for(i in f)if(f.hasOwnProperty(i))for(h=f[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,_=p.length,r=0;r<_;++r)h[s++]=p[r];let m;if(c){let C=0;for(o=0;o<n;++o)C+=e[o][t].indices.length;let A=st.computeNumberOfVertices(new st({attributes:f,primitiveType:Me.POINTS})),S=Ne.createTypedArray(A,C),v=0,D=0;for(o=0;o<n;++o){let O=e[o][t].indices,R=O.length;for(s=0;s<R;++s)S[v++]=D+O[s];D+=st.computeNumberOfVertices(e[o][t])}m=S}let x=new d,b=0,T;for(o=0;o<n;++o){if(T=e[o][t].boundingSphere,!l(T)){x=void 0;break}d.add(T.center,x,x)}if(l(x))for(d.divideByScalar(x,n,x),o=0;o<n;++o){T=e[o][t].boundingSphere;let C=d.magnitude(d.subtract(T.center,x,pDe))+T.radius;C>b&&(b=C)}return new st({attributes:f,indices:m,primitiveType:u,boundingSphere:l(x)?new ae(x,b):void 0})}Cc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(t6(t,"geometry")),n.length>0&&(o.push(t6(n,"westHemisphereGeometry")),o.push(t6(n,"eastHemisphereGeometry"))),o};var Ku=new d,YS=new d,yT=new d,xT=new d;Cc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],x=t[u+1],b=t[u+2],T=m*3,C=x*3,A=b*3;YS.x=i[T],YS.y=i[T+1],YS.z=i[T+2],yT.x=i[C],yT.y=i[C+1],yT.z=i[C+2],xT.x=i[A],xT.y=i[A+1],xT.z=i[A+2],s[m].count++,s[x].count++,s[b].count++,d.subtract(yT,YS,yT),d.subtract(xT,YS,xT),a[f]=d.cross(yT,xT,new d),f++}let h=0;for(u=0;u<o;u++)s[u].indexOffset+=h,h+=s[u].count;f=0;let p;for(u=0;u<r;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let _=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=s[u],d.clone(d.ZERO,Ku),p.count>0){for(f=0;f<p.count;f++)d.add(Ku,a[c[p.indexOffset+f]],Ku);d.equalsEpsilon(d.ZERO,Ku,P.EPSILON10)&&d.clone(a[c[p.indexOffset]],Ku)}d.equalsEpsilon(d.ZERO,Ku,P.EPSILON10)&&(Ku.z=1),d.normalize(Ku,Ku),_[m]=Ku.x,_[m+1]=Ku.y,_[m+2]=Ku.z}return e.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_}),e};var gDe=new d,hJ=new d,_De=new d;Cc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,h,p;for(u=0;u<a;u+=3){let x=n[u],b=n[u+1],T=n[u+2];f=x*3,h=b*3,p=T*3;let C=x*2,A=b*2,S=T*2,v=i[f],D=i[f+1],O=i[f+2],R=r[C],M=r[C+1],L=r[A+1]-M,g=r[S+1]-M,E=1/((r[A]-R)*g-(r[S]-R)*L),w=(g*(i[h]-v)-L*(i[p]-v))*E,I=(g*(i[h+1]-D)-L*(i[p+1]-D))*E,N=(g*(i[h+2]-O)-L*(i[p+2]-O))*E;c[f]+=w,c[f+1]+=I,c[f+2]+=N,c[h]+=w,c[h+1]+=I,c[h+2]+=N,c[p]+=w,c[p+1]+=I,c[p+2]+=N}let _=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,h=f+1,p=f+2;let x=d.fromArray(o,f,gDe),b=d.fromArray(c,f,_De),T=d.dot(x,b);d.multiplyByScalar(x,T,hJ),d.normalize(d.subtract(b,hJ,b),b),_[f]=b.x,_[h]=b.y,_[p]=b.z,d.normalize(d.cross(x,b,b),b),m[f]=b.x,m[h]=b.y,m[p]=b.z}return e.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_}),e.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m}),e};var XS=new U,fd=new d,mJ=new d,pJ=new d,Q1=new U;Cc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let D=t.values;i=D.length/3;let O=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(d.fromArray(D,n*3,fd),d.equals(fd,d.ZERO)){R+=2;continue}Q1=Ln.octEncodeInRange(fd,65535,Q1),O[R++]=Q1.x,O[R++]=Q1.y}return e.attributes.compressedAttributes=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:O}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),h=l(u),p,_,m,x;s&&(p=o.values),a&&(_=r.values),f&&(m=c.values),h&&(x=u.values),i=(s?p.length:_.length)/(s?3:2);let C=i,A=a&&s?2:1;A+=f||h?1:0,C*=A;let S=new Float32Array(C),v=0;for(n=0;n<i;++n){a&&(U.fromArray(_,n*2,XS),S[v++]=Ln.compressTextureCoordinates(XS));let D=n*3;s&&l(m)&&l(x)?(d.fromArray(p,D,fd),d.fromArray(m,D,mJ),d.fromArray(x,D,pJ),Ln.octPack(fd,mJ,pJ,XS),S[v++]=XS.x,S[v++]=XS.y):(s&&(d.fromArray(p,D,fd),S[v++]=Ln.octEncodeFloat(fd)),f&&(d.fromArray(m,D,fd),S[v++]=Ln.octEncodeFloat(fd)),h&&(d.fromArray(x,D,fd),S[v++]=Ln.octEncodeFloat(fd)))}return e.attributes.compressedAttributes=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:A,values:S}),s&&delete e.attributes.normal,a&&delete e.attributes.st,h&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function yDe(e){if(l(e.indices))return e;let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function xDe(e){let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function bDe(e){let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function TDe(e){if(l(e.indices))return e;let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function CDe(e){let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Me.LINES,e}function ADe(e){let t=st.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Me.LINES,e}function EDe(e){switch(e.primitiveType){case Me.TRIANGLE_FAN:return xDe(e);case Me.TRIANGLE_STRIP:return bDe(e);case Me.TRIANGLES:return yDe(e);case Me.LINE_STRIP:return CDe(e);case Me.LINE_LOOP:return ADe(e);case Me.LINES:return TDe(e)}return e}function Vg(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function SDe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Vg(e,e.y<0),Vg(t,t.y<0),Vg(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=P.sign(e.y):s=P.sign(n.y):o>r?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;Vg(e,a),Vg(t,a),Vg(n,a)}var gJ=new d;function Zu(e,t,n,i){d.add(e,d.multiplyByScalar(d.subtract(t,e,gJ),e.y/(e.y-t.y),gJ),n),d.clone(n,i),Vg(n,!0),Vg(i,!1)}var R0=new d,O0=new d,M0=new d,L0=new d,n6={positions:new Array(7),indices:new Array(3*3)};function vDe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;SDe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=n6.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Zu(e,t,R0,M0),Zu(e,n,O0,L0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Zu(t,n,R0,M0),Zu(t,e,O0,L0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Zu(n,e,R0,M0),Zu(n,t,O0,L0),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Zu(n,e,R0,M0),Zu(n,t,O0,L0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Zu(t,n,R0,M0),Zu(t,e,O0,L0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Zu(e,t,R0,M0),Zu(e,n,O0,L0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=n6.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=R0,c[4]=O0,c[5]=M0,c[6]=L0,c.length=7),n6}function _J(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=X.createTypedArray(r.componentDatatype,r.values)}let i=st.computeNumberOfVertices(e);return e.indices=Ne.createTypedArray(i,e.indices),t&&(e.boundingSphere=ae.fromVertices(n.position.values)),e}function TT(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new ve({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new st({attributes:n,indices:[],primitiveType:e.primitiveType})}function s6(e,t,n){let i=l(e.geometry.boundingSphere);t=_J(t,i),n=_J(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function a6(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,u,f,h,p){let _=e.fromArray(u,r*t,n),m=e.fromArray(u,s*t,i),x=e.fromArray(u,a*t,o);e.multiplyByScalar(_,c.x,_),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(x,c.z,x);let b=e.add(_,m,_);e.add(b,x,b),p&&e.normalize(b,b),e.pack(b,f,h*t)}}var wDe=a6(oe,4),tR=a6(d,3),AJ=a6(U,2),DDe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[s]=a+c+u>P.EPSILON6?1:0},KS=new d,i6=new d,o6=new d,IDe=new d;function J1(e,t,n,i,o,r,s,a,c,u,f,h,p,_,m,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&_===0)return;let b=d.fromArray(o,e*3,KS),T=d.fromArray(o,t*3,i6),C=d.fromArray(o,n*3,o6),A=gT(i,b,T,C,IDe);if(l(A)){if(l(r)&&tR(e,t,n,A,r,h.normal.values,x,!0),l(u)){let S=d.fromArray(u,e*3,KS),v=d.fromArray(u,t*3,i6),D=d.fromArray(u,n*3,o6);d.multiplyByScalar(S,A.x,S),d.multiplyByScalar(v,A.y,v),d.multiplyByScalar(D,A.z,D);let O;!d.equals(S,d.ZERO)||!d.equals(v,d.ZERO)||!d.equals(D,d.ZERO)?(O=d.add(S,v,S),d.add(O,D,O),d.normalize(O,O)):(O=KS,O.x=0,O.y=0,O.z=0),d.pack(O,h.extrudeDirection.values,x*3)}if(l(f)&&DDe(e,t,n,A,f,h.applyOffset.values,x),l(s)&&tR(e,t,n,A,s,h.tangent.values,x,!0),l(a)&&tR(e,t,n,A,a,h.bitangent.values,x,!0),l(c)&&AJ(e,t,n,A,c,h.st.values,x),_>0)for(let S=0;S<_;S++){let v=p[S];PDe(e,t,n,A,x,m[v],h[v])}}}function PDe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,u=s.values;switch(a){case 4:wDe(e,t,n,i,c,u,o,!1);break;case 3:tR(e,t,n,i,c,u,o,!1);break;case 2:AJ(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Dh(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var RDe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function yJ(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,h=[];for(let O in n)n.hasOwnProperty(O)&&!RDe[O]&&l(n[O])&&h.push(O);let p=h.length,_=TT(t),m=TT(t),x,b,T,C,A,S=[];S.length=i.length/3;let v=[];for(v.length=i.length/3,A=0;A<S.length;++A)S[A]=-1,v[A]=-1;let D=f.length;for(A=0;A<D;A+=3){let O=f[A],R=f[A+1],M=f[A+2],L=d.fromArray(i,O*3),g=d.fromArray(i,R*3),E=d.fromArray(i,M*3),w=vDe(L,g,E);if(l(w)&&w.positions.length>3){let I=w.positions,N=w.indices,B=N.length;for(let H=0;H<B;++H){let V=N[H],G=I[V];G.y<0?(x=m.attributes,b=m.indices,T=S):(x=_.attributes,b=_.indices,T=v),C=Dh(x,b,T,f,V<3?A+V:-1,G),J1(O,R,M,G,i,o,s,r,a,c,u,x,h,p,n,C)}}else l(w)&&(L=w.positions[0],g=w.positions[1],E=w.positions[2]),L.y<0?(x=m.attributes,b=m.indices,T=S):(x=_.attributes,b=_.indices,T=v),C=Dh(x,b,T,f,A,L),J1(O,R,M,L,i,o,s,r,a,c,u,x,h,p,n,C),C=Dh(x,b,T,f,A+1,g),J1(O,R,M,g,i,o,s,r,a,c,u,x,h,p,n,C),C=Dh(x,b,T,f,A+2,E),J1(O,R,M,E,i,o,s,r,a,c,u,x,h,p,n,C)}s6(e,m,_)}var EJ=sn.fromPointNormal(d.ZERO,d.UNIT_Y),ODe=new d,MDe=new d;function bT(e,t,n,i,o,r,s){if(!l(s))return;let a=d.fromArray(i,e*3,KS);d.equalsEpsilon(a,n,P.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function xJ(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=TT(t),a=TT(t),c,u=r.length,f=[];f.length=i.length/3;let h=[];for(h.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,h[c]=-1;for(c=0;c<u;c+=2){let p=r[c],_=r[c+1],m=d.fromArray(i,p*3,KS),x=d.fromArray(i,_*3,i6),b;Math.abs(m.y)<P.EPSILON6&&(m.y<0?m.y=-P.EPSILON6:m.y=P.EPSILON6),Math.abs(x.y)<P.EPSILON6&&(x.y<0?x.y=-P.EPSILON6:x.y=P.EPSILON6);let T=s.attributes,C=s.indices,A=h,S=a.attributes,v=a.indices,D=f,O=Qn.lineSegmentPlane(m,x,EJ,o6);if(l(O)){let R=d.multiplyByScalar(d.UNIT_Y,5*P.EPSILON9,ODe);m.y<0&&(d.negate(R,R),T=a.attributes,C=a.indices,A=f,S=s.attributes,v=s.indices,D=h);let M=d.add(O,R,MDe);b=Dh(T,C,A,r,c,m),bT(p,_,m,i,b,T,o),b=Dh(T,C,A,r,-1,M),bT(p,_,M,i,b,T,o),d.negate(R,R),d.add(O,R,M),b=Dh(S,v,D,r,-1,M),bT(p,_,M,i,b,S,o),b=Dh(S,v,D,r,c+1,x),bT(p,_,x,i,b,S,o)}else{let R,M,L;m.y<0?(R=a.attributes,M=a.indices,L=f):(R=s.attributes,M=s.indices,L=h),b=Dh(R,M,L,r,c,m),bT(p,_,m,i,b,R,o),b=Dh(R,M,L,r,c+1,x),bT(p,_,x,i,b,R,o)}}s6(e,a,s)}var bJ=new U,LDe=new U,SJ=new d,vJ=new d,r6=new d,NDe=new d,FDe=new d,BDe=new d,TJ=new oe;function CJ(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=d.unpack(n,s,SJ);if(a.x>0)continue;let c=d.unpack(i,s,vJ);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):d.pack(a,i,s));let u=d.unpack(o,s,r6);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):d.pack(a,o,s))}}var kDe=5*P.EPSILON9,eR=P.EPSILON6;function VDe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=TT(t),f=TT(t),h,p,_,m=!1,x=i.length/3;for(h=0;h<x;h+=4){let b=h,T=h+2,C=d.fromArray(i,b*3,SJ),A=d.fromArray(i,T*3,vJ);if(Math.abs(C.y)<eR)for(C.y=eR*(A.y<0?-1:1),i[h*3+1]=C.y,i[(h+1)*3+1]=C.y,p=b*3;p<b*3+4*3;p+=3)o[p]=i[h*3],o[p+1]=i[h*3+1],o[p+2]=i[h*3+2];if(Math.abs(A.y)<eR)for(A.y=eR*(C.y<0?-1:1),i[(h+2)*3+1]=A.y,i[(h+3)*3+1]=A.y,p=b*3;p<b*3+4*3;p+=3)r[p]=i[(h+2)*3],r[p+1]=i[(h+2)*3+1],r[p+2]=i[(h+2)*3+2];let S=u.attributes,v=u.indices,D=f.attributes,O=f.indices,R=Qn.lineSegmentPlane(C,A,EJ,NDe);if(l(R)){m=!0;let M=d.multiplyByScalar(d.UNIT_Y,kDe,FDe);C.y<0&&(d.negate(M,M),S=f.attributes,v=f.indices,D=u.attributes,O=u.indices);let L=d.add(R,M,BDe);S.position.values.push(C.x,C.y,C.z,C.x,C.y,C.z),S.position.values.push(L.x,L.y,L.z),S.position.values.push(L.x,L.y,L.z),S.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),S.prevPosition.values.push(C.x,C.y,C.z,C.x,C.y,C.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(L.x,L.y,L.z),d.negate(M,M),d.add(R,M,L),D.position.values.push(L.x,L.y,L.z),D.position.values.push(L.x,L.y,L.z),D.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.prevPosition.values.push(L.x,L.y,L.z),D.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.nextPosition.values.push(r[T*3],r[T*3+1],r[T*3+2]),D.nextPosition.values.push(r[T*3+3],r[T*3+4],r[T*3+5]);let g=U.fromArray(s,b*2,bJ),E=Math.abs(g.y);S.expandAndWidth.values.push(-1,E,1,E),S.expandAndWidth.values.push(-1,-E,1,-E),D.expandAndWidth.values.push(-1,E,1,E),D.expandAndWidth.values.push(-1,-E,1,-E);let w=d.magnitudeSquared(d.subtract(R,C,r6));if(w/=d.magnitudeSquared(d.subtract(A,C,r6)),l(c)){let I=oe.fromArray(c,b*4,TJ),N=oe.fromArray(c,T*4,TJ),B=P.lerp(I.x,N.x,w),H=P.lerp(I.y,N.y,w),V=P.lerp(I.z,N.z,w),G=P.lerp(I.w,N.w,w);for(p=b*4;p<b*4+2*4;++p)S.color.values.push(c[p]);for(S.color.values.push(B,H,V,G),S.color.values.push(B,H,V,G),D.color.values.push(B,H,V,G),D.color.values.push(B,H,V,G),p=T*4;p<T*4+2*4;++p)D.color.values.push(c[p])}if(l(a)){let I=U.fromArray(a,b*2,bJ),N=U.fromArray(a,(h+3)*2,LDe),B=P.lerp(I.x,N.x,w);for(p=b*2;p<b*2+2*2;++p)S.st.values.push(a[p]);for(S.st.values.push(B,I.y),S.st.values.push(B,N.y),D.st.values.push(B,I.y),D.st.values.push(B,N.y),p=T*2;p<T*2+2*2;++p)D.st.values.push(a[p])}_=S.position.values.length/3-4,v.push(_,_+2,_+1),v.push(_+1,_+2,_+3),_=D.position.values.length/3-4,O.push(_,_+2,_+1),O.push(_+1,_+2,_+3)}else{let M,L;for(C.y<0?(M=f.attributes,L=f.indices):(M=u.attributes,L=u.indices),M.position.values.push(C.x,C.y,C.z),M.position.values.push(C.x,C.y,C.z),M.position.values.push(A.x,A.y,A.z),M.position.values.push(A.x,A.y,A.z),p=h*3;p<h*3+4*3;++p)M.prevPosition.values.push(o[p]),M.nextPosition.values.push(r[p]);for(p=h*2;p<h*2+4*2;++p)M.expandAndWidth.values.push(s[p]),l(a)&&M.st.values.push(a[p]);if(l(c))for(p=h*4;p<h*4+4*4;++p)M.color.values.push(c[p]);_=M.position.values.length/3-4,L.push(_,_+2,_+1),L.push(_+1,_+2,_+3)}}m&&(CJ(f),CJ(u)),s6(e,f,u)}Cc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ae.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING))return e;if(t.geometryType!==ld.NONE)switch(t.geometryType){case ld.POLYLINES:VDe(e);break;case ld.TRIANGLES:yJ(e);break;case ld.LINES:xJ(e);break}else EDe(t),t.primitiveType===Me.TRIANGLES?yJ(e):t.primitiveType===Me.LINES&&xJ(e);return e};var Nn=Cc;function ZS(e,t,n,i,o,r,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(ZS.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});ZS.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,h=this._size,p=this._pixelFormat,_=this._internalFormat,m=this._pixelDatatype,x=this._preMultiplyAlpha,b=this._flipY,T=4;l(f)&&(T=tt.alignmentInBytes(p,m,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,T),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let C=!1;if(!this._initialized){let A;t===0&&n===0&&r===h&&s===h?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=tt.flipY(f,p,m,h,h)),A=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),A=i),C=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A=tt.createTypedArray(p,m,h,h)),a.texImage2D(u,0,_,h,h,0,p,Ke.toWebGLConstant(m,this._context),A),this._initialized=!0}C||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=tt.flipY(f,p,m,r,s)),a.texSubImage2D(u,0,t,n,r,s,p,Ke.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),a.texSubImage2D(u,0,t,n,p,Ke.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};ZS.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._size),r=y(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};ZS.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=y(e,0),t=y(t,0),n=y(n,this._size),i=y(i,this._size),o=y(o,0);let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var iR=ZS;var oR={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===oR.DONT_CARE||e===oR.FASTEST||e===oR.NICEST}},ap=Object.freeze(oR);var rR={NEAREST:te.NEAREST,LINEAR:te.LINEAR};rR.validate=function(e){return e===rR.NEAREST||e===rR.LINEAR};var hi=Object.freeze(rR);var Ug={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};Ug.validate=function(e){return e===Ug.NEAREST||e===Ug.LINEAR||e===Ug.NEAREST_MIPMAP_NEAREST||e===Ug.LINEAR_MIPMAP_NEAREST||e===Ug.NEAREST_MIPMAP_LINEAR||e===Ug.LINEAR_MIPMAP_LINEAR};var Kt=Object.freeze(Ug);var sR={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===sR.CLAMP_TO_EDGE||e===sR.REPEAT||e===sR.MIRRORED_REPEAT}},An=Object.freeze(sR);function $S(e){e=y(e,y.EMPTY_OBJECT);let{wrapS:t=An.CLAMP_TO_EDGE,wrapT:n=An.CLAMP_TO_EDGE,minificationFilter:i=Kt.LINEAR,magnificationFilter:o=hi.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties($S.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});$S.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};$S.NEAREST=Object.freeze(new $S({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Kt.NEAREST,magnificationFilter:hi.NEAREST}));var Zt=$S;function UDe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,X.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function DJ(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function cp(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)UDe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let _=p.strideInBytes||p.componentsPerAttribute*X.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/_;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(u=!0);let h;t.vertexArrayObject&&(h=t.glCreateVertexArray(),t.glBindVertexArray(h),DJ(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=h,this._attributes=s,this._indexBuffer=o}function wJ(e){return e.values.length/e.componentsPerAttribute}function zDe(e){return X.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function HDe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===X.DOUBLE&&(e[n].componentDatatype=X.FLOAT,e[n].values=X.createTypedArray(X.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=wJ(e[o[0]]),t=1;t<s;++t){let u=wJ(e[o[t]]);if(u!==r)throw new re(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return X.getSizeInBytes(e[f].componentDatatype)-X.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=zDe(i);if(a>0){let u=X.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let h=r*a,p=new ArrayBuffer(h),_={};for(t=0;t<s;++t){n=o[t];let m=X.getSizeInBytes(e[n].componentDatatype);_[n]={pointer:X.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<r;++t)for(let m=0;m<s;++m){n=o[m],i=e[n];let x=i.values,b=_[n],T=b.pointer,C=i.componentsPerAttribute;for(let A=0;A<C;++A)T[b.index+A]=x[t*C+A];b.index+=b.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}cp.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Fe.DYNAMIC_DRAW),o=y(e.attributeLocations,y.EMPTY_OBJECT),r=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],h=n.attributes;if(r){let m=HDe(h);if(l(m)){u=_t.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let x=m.offsetsInBytes,b=m.vertexSizeInBytes;for(a in h)h.hasOwnProperty(a)&&l(h[a])&&(c=h[a],l(c.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:b}):f.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in h)if(h.hasOwnProperty(a)&&l(h[a])){c=h[a];let m=c.componentDatatype;m===X.DOUBLE&&(m=X.FLOAT),u=void 0,l(c.values)&&(u=_t.createVertexBuffer({context:t,typedArray:X.createTypedArray(m,c.values),usage:i})),f.push({index:o[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,_=n.indices;return l(_)&&(st.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=_t.createIndexBuffer({context:t,typedArray:new Uint32Array(_),usage:i,indexDatatype:Ne.UNSIGNED_INT}):p=_t.createIndexBuffer({context:t,typedArray:new Uint16Array(_),usage:i,indexDatatype:Ne.UNSIGNED_SHORT})),new cp({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(cp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});cp.prototype.getAttribute=function(e){return this._attributes[e]};function GDe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Ft.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function WDe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&l(r.value)&&r.vertexAttrib(t)}}cp.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&GDe(this),this._hasConstantAttributes&&WDe(this,this._gl)):DJ(this._gl,this._attributes,this._indexBuffer)};cp.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};cp.prototype.isDestroyed=function(){return!1};cp.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var ni=cp;function Wo(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=tt.RGBA,pixelDatatype:o=Ke.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Zt}=e,c=e.preMultiplyAlpha||i===tt.RGB||i===tt.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let h=u,p=tt.textureSizeInBytes(i,o,h,h)*6,_=tt.toInternalFormat(i,o,t),m=t._gl,x=m.TEXTURE_CUBE_MAP,b=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=x,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let T=l(n);function C(A){return new iR(t,b,x,A,_,i,o,h,c,r,T)}this._positiveX=C(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=C(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=C(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=C(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=C(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=C(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,IJ(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(x,b),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let A of Wo.faceNames())c6(this[A],n?.[A],0);m.bindTexture(x,null)}Wo.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new zr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,y(i,0)),r._unBind(),r.destroy()};Wo.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*jDe(){yield Wo.FaceName.POSITIVEX,yield Wo.FaceName.NEGATIVEX,yield Wo.FaceName.POSITIVEY,yield Wo.FaceName.NEGATIVEY,yield Wo.FaceName.POSITIVEZ,yield Wo.FaceName.NEGATIVEZ}Wo.faceNames=function(){return jDe()};function c6(e,t,n){n=y(n,0);let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,h=f._gl;if(!l(t)){h.texImage2D(i,n,a,o,o,0,r,Ke.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,_=4;l(p)&&(_=tt.alignmentInBytes(r,s,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,_),l(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=tt.flipY(p,r,s,o,o)),h.texImage2D(i,n,a,o,o,0,r,Ke.toWebGLConstant(s,f),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),h.texImage2D(i,n,a,r,Ke.toWebGLConstant(s,f),t))}Wo.loadFace=c6;Object.defineProperties(Wo.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){IJ(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});Wo.getDirection=function(e,t){switch(e){case Wo.FaceName.POSITIVEX:return d.clone(d.UNIT_X,t);case Wo.FaceName.NEGATIVEX:return d.negate(d.UNIT_X,t);case Wo.FaceName.POSITIVEY:return d.clone(d.UNIT_Y,t);case Wo.FaceName.NEGATIVEY:return d.negate(d.UNIT_Y,t);case Wo.FaceName.POSITIVEZ:return d.clone(d.UNIT_Z,t);case Wo.FaceName.NEGATIVEZ:return d.negate(d.UNIT_Z,t)}};function IJ(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Kt.NEAREST_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===Ke.FLOAT&&!r.textureFloatLinear||s===Ke.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Kt.NEAREST_MIPMAP_NEAREST:Kt.NEAREST,i=hi.NEAREST);let a=r._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}Wo.prototype.loadMipmaps=function(e,t){t=y(t,!1);let n=this._context._gl,i=this._texture,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){let s=e[r],a=r+1;for(let c of Wo.faceNames())c6(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};Wo.prototype.generateMipmap=function(e){e=y(e,ap.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Wo.createVertexArray=function(e){let t=qa.createGeometry(qa.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),n=this._attributeLocations=Nn.createAttributeLocations(t);return ni.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Fe.STATIC_DRAW})};Wo.prototype.isDestroyed=function(){return!1};Wo.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var wr=Wo;function qDe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Ac=qDe;var aR=`/** * A built-in GLSL floating-point constant for converting radians to degrees. * * @alias czm_degreesPerRadian @@ -110,7 +110,7 @@ ${m}`)}}function zve(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttri * float deg = czm_degreesPerRadian * rad; */ const float czm_degreesPerRadian = 57.29577951308232; -`;var oR=`/** +`;var cR=`/** * A built-in GLSL vec2 constant for defining the depth range. * This is a workaround to a bug where IE11 does not implement gl_DepthRange. * @@ -124,63 +124,63 @@ const float czm_degreesPerRadian = 57.29577951308232; * */ const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); -`;var rR=`/** +`;var lR=`/** * 0.1 * * @name czm_epsilon1 * @glslConstant */ const float czm_epsilon1 = 0.1; -`;var sR=`/** +`;var uR=`/** * 0.01 * * @name czm_epsilon2 * @glslConstant */ const float czm_epsilon2 = 0.01; -`;var aR=`/** +`;var fR=`/** * 0.001 * * @name czm_epsilon3 * @glslConstant */ const float czm_epsilon3 = 0.001; -`;var cR=`/** +`;var dR=`/** * 0.0001 * * @name czm_epsilon4 * @glslConstant */ const float czm_epsilon4 = 0.0001; -`;var lR=`/** +`;var hR=`/** * 0.00001 * * @name czm_epsilon5 * @glslConstant */ const float czm_epsilon5 = 0.00001; -`;var uR=`/** +`;var mR=`/** * 0.000001 * * @name czm_epsilon6 * @glslConstant */ const float czm_epsilon6 = 0.000001; -`;var fR=`/** +`;var pR=`/** * 0.0000001 * * @name czm_epsilon7 * @glslConstant */ const float czm_epsilon7 = 0.0000001; -`;var dR=`/** +`;var gR=`/** * DOC_TBA * * @name czm_infinity * @glslConstant */ const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp? -`;var hR=`/** +`;var _R=`/** * A built-in GLSL floating-point constant for <code>1/pi</code>. * * @alias czm_oneOverPi @@ -196,7 +196,7 @@ const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto i * float pi = 1.0 / czm_oneOverPi; */ const float czm_oneOverPi = 0.3183098861837907; -`;var mR=`/** +`;var yR=`/** * A built-in GLSL floating-point constant for <code>1/2pi</code>. * * @alias czm_oneOverTwoPi @@ -212,7 +212,7 @@ const float czm_oneOverPi = 0.3183098861837907; * float pi = 2.0 * czm_oneOverTwoPi; */ const float czm_oneOverTwoPi = 0.15915494309189535; -`;var pR=`/** +`;var xR=`/** * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} * * @name czm_passCesium3DTile @@ -221,7 +221,7 @@ const float czm_oneOverTwoPi = 0.15915494309189535; * @see czm_pass */ const float czm_passCesium3DTile = 4.0; -`;var gR=`/** +`;var bR=`/** * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION} * * @name czm_passCesium3DTileClassification @@ -230,7 +230,7 @@ const float czm_passCesium3DTile = 4.0; * @see czm_pass */ const float czm_passCesium3DTileClassification = 5.0; -`;var _R=`/** +`;var TR=`/** * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW} * * @name czm_passCesium3DTileClassificationIgnoreShow @@ -239,7 +239,7 @@ const float czm_passCesium3DTileClassification = 5.0; * @see czm_pass */ const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; -`;var yR=`/** +`;var CR=`/** * The automatic GLSL constant for {@link Pass#CLASSIFICATION} * * @name czm_passClassification @@ -248,7 +248,7 @@ const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; * @see czm_pass */ const float czm_passClassification = 7.0; -`;var xR=`/** +`;var AR=`/** * The automatic GLSL constant for {@link Pass#COMPUTE} * * @name czm_passCompute @@ -257,7 +257,7 @@ const float czm_passClassification = 7.0; * @see czm_pass */ const float czm_passCompute = 1.0; -`;var bR=`/** +`;var ER=`/** * The automatic GLSL constant for {@link Pass#ENVIRONMENT} * * @name czm_passEnvironment @@ -266,7 +266,7 @@ const float czm_passCompute = 1.0; * @see czm_pass */ const float czm_passEnvironment = 0.0; -`;var TR=`/** +`;var SR=`/** * The automatic GLSL constant for {@link Pass#GLOBE} * * @name czm_passGlobe @@ -275,7 +275,7 @@ const float czm_passEnvironment = 0.0; * @see czm_pass */ const float czm_passGlobe = 2.0; -`;var CR=`/** +`;var vR=`/** * The automatic GLSL constant for {@link Pass#OPAQUE} * * @name czm_passOpaque @@ -284,7 +284,7 @@ const float czm_passGlobe = 2.0; * @see czm_pass */ const float czm_passOpaque = 7.0; -`;var AR=`/** +`;var wR=`/** * The automatic GLSL constant for {@link Pass#OVERLAY} * * @name czm_passOverlay @@ -293,7 +293,7 @@ const float czm_passOpaque = 7.0; * @see czm_pass */ const float czm_passOverlay = 10.0; -`;var ER=`/** +`;var DR=`/** * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} * * @name czm_passTerrainClassification @@ -302,7 +302,7 @@ const float czm_passOverlay = 10.0; * @see czm_pass */ const float czm_passTerrainClassification = 3.0; -`;var SR=`/** +`;var IR=`/** * The automatic GLSL constant for {@link Pass#TRANSLUCENT} * * @name czm_passTranslucent @@ -311,7 +311,7 @@ const float czm_passTerrainClassification = 3.0; * @see czm_pass */ const float czm_passTranslucent = 8.0; -`;var vR=`/** +`;var PR=`/** * The automatic GLSL constant for {@link Pass#VOXELS} * * @name czm_passVoxels @@ -320,7 +320,7 @@ const float czm_passTranslucent = 8.0; * @see czm_pass */ const float czm_passVoxels = 9.0; -`;var wR=`/** +`;var RR=`/** * A built-in GLSL floating-point constant for <code>Math.PI</code>. * * @alias czm_pi @@ -336,7 +336,7 @@ const float czm_passVoxels = 9.0; * float twoPi = 2.0 * czm_pi; */ const float czm_pi = 3.141592653589793; -`;var DR=`/** +`;var OR=`/** * A built-in GLSL floating-point constant for <code>pi/4</code>. * * @alias czm_piOverFour @@ -352,7 +352,7 @@ const float czm_pi = 3.141592653589793; * float pi = 4.0 * czm_piOverFour; */ const float czm_piOverFour = 0.7853981633974483; -`;var IR=`/** +`;var MR=`/** * A built-in GLSL floating-point constant for <code>pi/6</code>. * * @alias czm_piOverSix @@ -368,7 +368,7 @@ const float czm_piOverFour = 0.7853981633974483; * float pi = 6.0 * czm_piOverSix; */ const float czm_piOverSix = 0.5235987755982988; -`;var PR=`/** +`;var LR=`/** * A built-in GLSL floating-point constant for <code>pi/3</code>. * * @alias czm_piOverThree @@ -384,7 +384,7 @@ const float czm_piOverSix = 0.5235987755982988; * float pi = 3.0 * czm_piOverThree; */ const float czm_piOverThree = 1.0471975511965976; -`;var RR=`/** +`;var NR=`/** * A built-in GLSL floating-point constant for <code>pi/2</code>. * * @alias czm_piOverTwo @@ -400,7 +400,7 @@ const float czm_piOverThree = 1.0471975511965976; * float pi = 2.0 * czm_piOverTwo; */ const float czm_piOverTwo = 1.5707963267948966; -`;var OR=`/** +`;var FR=`/** * A built-in GLSL floating-point constant for converting degrees to radians. * * @alias czm_radiansPerDegree @@ -416,7 +416,7 @@ const float czm_piOverTwo = 1.5707963267948966; * float rad = czm_radiansPerDegree * deg; */ const float czm_radiansPerDegree = 0.017453292519943295; -`;var MR=`/** +`;var BR=`/** * The constant identifier for the 2D {@link SceneMode} * * @name czm_sceneMode2D @@ -427,7 +427,7 @@ const float czm_radiansPerDegree = 0.017453292519943295; * @see czm_sceneModeMorphing */ const float czm_sceneMode2D = 2.0; -`;var LR=`/** +`;var kR=`/** * The constant identifier for the 3D {@link SceneMode} * * @name czm_sceneMode3D @@ -438,7 +438,7 @@ const float czm_sceneMode2D = 2.0; * @see czm_sceneModeMorphing */ const float czm_sceneMode3D = 3.0; -`;var NR=`/** +`;var VR=`/** * The constant identifier for the Columbus View {@link SceneMode} * * @name czm_sceneModeColumbusView @@ -449,7 +449,7 @@ const float czm_sceneMode3D = 3.0; * @see czm_sceneModeMorphing */ const float czm_sceneModeColumbusView = 1.0; -`;var FR=`/** +`;var UR=`/** * The constant identifier for the Morphing {@link SceneMode} * * @name czm_sceneModeMorphing @@ -460,7 +460,7 @@ const float czm_sceneModeColumbusView = 1.0; * @see czm_sceneMode3D */ const float czm_sceneModeMorphing = 0.0; -`;var BR=`/** +`;var zR=`/** * A built-in GLSL floating-point constant for one solar radius. * * @alias czm_solarRadius @@ -473,7 +473,7 @@ const float czm_sceneModeMorphing = 0.0; * const float czm_solarRadius = ...; */ const float czm_solarRadius = 695500000.0; -`;var kR=`/** +`;var HR=`/** * A built-in GLSL floating-point constant for <code>3pi/2</code>. * * @alias czm_threePiOver2 @@ -489,7 +489,7 @@ const float czm_solarRadius = 695500000.0; * float pi = (2.0 / 3.0) * czm_threePiOver2; */ const float czm_threePiOver2 = 4.71238898038469; -`;var VR=`/** +`;var GR=`/** * A built-in GLSL floating-point constant for <code>2pi</code>. * * @alias czm_twoPi @@ -505,7 +505,7 @@ const float czm_threePiOver2 = 4.71238898038469; * float pi = czm_twoPi / 2.0; */ const float czm_twoPi = 6.283185307179586; -`;var UR=`/** +`;var WR=`/** * The maximum latitude, in radians, both North and South, supported by a Web Mercator * (EPSG:3857) projection. Technically, the Mercator projection is defined * for any latitude up to (but not including) 90 degrees, but it makes sense @@ -521,7 +521,7 @@ const float czm_twoPi = 6.283185307179586; * @glslConstant */ const float czm_webMercatorMaxLatitude = 1.4844222297453324; -`;var zR=`/** +`;var jR=`/** * @name czm_depthRangeStruct * @glslStruct */ @@ -530,7 +530,7 @@ struct czm_depthRangeStruct float near; float far; }; -`;var HR=`/** +`;var qR=`/** * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions. * * @name czm_material @@ -552,7 +552,7 @@ struct czm_material vec3 emission; float alpha; }; -`;var GR=`/** +`;var YR=`/** * Used as input to every material's czm_getMaterial function. * * @name czm_materialInput @@ -582,7 +582,7 @@ struct czm_materialInput float aspect; float waterMask; }; -`;var WR=`/** +`;var XR=`/** * Struct for representing a material for a {@link Model}. The model * rendering pipeline will pass this struct between material, custom shaders, * and lighting stages. This is not to be confused with {@link czm_material} @@ -627,7 +627,7 @@ struct czm_modelMaterial { // Add clearcoatF0 when KHR_materials_ior is implemented #endif }; -`;var jR=`/** +`;var KR=`/** * Struct for representing the output of a custom vertex shader. * * @name czm_modelVertexOutput @@ -643,7 +643,7 @@ struct czm_modelVertexOutput { vec3 positionMC; float pointSize; }; -`;var qR=`/** +`;var ZR=`/** * DOC_TBA * * @name czm_ray @@ -654,7 +654,7 @@ struct czm_ray vec3 origin; vec3 direction; }; -`;var YR=`/** +`;var $R=`/** * DOC_TBA * * @name czm_raySegment @@ -681,7 +681,7 @@ const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_in * @glslConstant */ const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); -`;var XR=`struct czm_shadowParameters +`;var QR=`struct czm_shadowParameters { #ifdef USE_CUBE_MAP_SHADOW vec3 texCoords; @@ -696,7 +696,7 @@ const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); float normalShadingSmooth; float darkness; }; -`;var KR=`/** +`;var JR=`/** * Converts an HSB color (hue, saturation, brightness) to RGB * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} * @@ -720,7 +720,7 @@ vec3 czm_HSBToRGB(vec3 hsb) vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www); return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y); } -`;var ZR=`/** +`;var eO=`/** * Converts an HSL color (hue, saturation, lightness) to RGB * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} * @@ -751,7 +751,7 @@ vec3 czm_HSLToRGB(vec3 hsl) float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; return (rgb - 0.5) * c + hsl.z; } -`;var $R=`/** +`;var tO=`/** * Converts an RGB color to HSB (hue, saturation, brightness) * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} * @@ -778,7 +778,7 @@ vec3 czm_RGBToHSB(vec3 rgb) float d = q.x - min(q.w, q.y); return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x); } -`;var QR=`/** +`;var nO=`/** * Converts an RGB color to HSL (hue, saturation, lightness) * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} * @@ -812,7 +812,7 @@ vec3 czm_RGBToHSL(vec3 rgb) float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7); return vec3(hcv.x, s, l); } -`;var JR=`/** +`;var iO=`/** * Converts an RGB color to CIE Yxy. * <p>The conversion is described in * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} @@ -842,7 +842,7 @@ vec3 czm_RGBToXYZ(vec3 rgb) Yxy.gb = xyz.rg / temp; return Yxy; } -`;var eO=`/** +`;var oO=`/** * Converts a CIE Yxy color to RGB. * <p>The conversion is described in * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} @@ -872,7 +872,7 @@ vec3 czm_XYZToRGB(vec3 Yxy) return XYZ2RGB * xyz; } -`;var tO=`// See: +`;var rO=`// See: // https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ vec3 czm_acesTonemapping(vec3 color) { @@ -888,7 +888,7 @@ vec3 czm_acesTonemapping(vec3 color) { return color; } -`;var nO=`/** +`;var sO=`/** * @private */ float czm_alphaWeight(float a) @@ -899,7 +899,7 @@ float czm_alphaWeight(float a) // http://jcgt.org/published/0002/02/09/ return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0)))); } -`;var iO=`/** +`;var aO=`/** * Procedural anti-aliasing by blurring two colors that meet at a sharp edge. * * @name czm_antialias @@ -938,7 +938,7 @@ vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) { return czm_antialias(color1, color2, currentColor, dist, 0.1); } -`;var oO=`/** +`;var cO=`/** * Apply a HSB color shift to an RGB color. * * @param {vec3} rgb The color in RGB space. @@ -970,7 +970,7 @@ vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) { // Convert shifted hsb back to rgb return czm_HSBToRGB(hsb); } -`;var rO=`/** +`;var lO=`/** * Approximately computes spherical coordinates given a normal. * Uses approximate inverse trigonometry for speed and consistency, * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU. @@ -988,7 +988,7 @@ vec2 czm_approximateSphericalCoordinates(vec3 normal) { float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y); return vec2(latitudeApproximation, longitudeApproximation); } -`;var sO=`/** +`;var uO=`/** * Compute a rational approximation to tanh(x) * * @param {float} x A real number input @@ -998,7 +998,7 @@ float czm_approximateTanh(float x) { float x2 = x * x; return max(-1.0, min(1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2))); } -`;var aO=`/** +`;var fO=`/** * Determines if the fragment is back facing * * @name czm_backFacing @@ -1011,7 +1011,7 @@ bool czm_backFacing() // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494. return gl_FrontFacing == false; } -`;var cO=`/** +`;var dO=`/** * Branchless ternary operator to be used when it's inexpensive to explicitly * evaluate both possibilities for a float expression. * @@ -1082,7 +1082,7 @@ vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } -`;var lO=` +`;var hO=` vec4 czm_cascadeColor(vec4 weights) { return vec4(1.0, 0.0, 0.0, 1.0) * weights.x + @@ -1090,14 +1090,14 @@ vec4 czm_cascadeColor(vec4 weights) vec4(0.0, 0.0, 1.0, 1.0) * weights.z + vec4(1.0, 0.0, 1.0, 1.0) * weights.w; } -`;var uO=` +`;var mO=` uniform vec4 shadowMap_cascadeDistances; float czm_cascadeDistance(vec4 weights) { return dot(shadowMap_cascadeDistances, weights); } -`;var fO=` +`;var pO=` uniform mat4 shadowMap_cascadeMatrices[4]; mat4 czm_cascadeMatrix(vec4 weights) @@ -1107,7 +1107,7 @@ mat4 czm_cascadeMatrix(vec4 weights) shadowMap_cascadeMatrices[2] * weights.z + shadowMap_cascadeMatrices[3] * weights.w; } -`;var dO=` +`;var gO=` uniform vec4 shadowMap_cascadeSplits[2]; vec4 czm_cascadeWeights(float depthEye) @@ -1117,7 +1117,7 @@ vec4 czm_cascadeWeights(float depthEye) vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); return near * far; } -`;var hO=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) { +`;var _O=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) { float signedDistance = texture(clippingDistance, uv).r; return (signedDistance - 0.5) * 2.0; } @@ -1154,7 +1154,7 @@ void czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 } #endif } -`;var mO=`/** +`;var yO=`/** * DOC_TBA * * @name czm_columbusViewMorph @@ -1166,7 +1166,7 @@ vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) vec3 p = mix(position2D.xyz, position3D.xyz, time); return vec4(p, 1.0); } -`;var pO=`/** +`;var xO=`/** * Compute the atmosphere color, applying Rayleigh and Mie scattering. This * builtin uses automatic uniforms so the atmophere settings are synced with the * state of the Scene, even in other contexts like Model. @@ -1254,7 +1254,7 @@ vec4 czm_computeAtmosphereColor( return vec4(color, opacity); } -`;var gO=`/** +`;var bO=`/** * Compute atmosphere scattering for the ground atmosphere and fog. This method * uses automatic uniforms so it is always synced with the scene settings. * @@ -1284,7 +1284,7 @@ void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, opacity ); } -`;var _O=`/** +`;var TO=`/** * Returns a position in model coordinates relative to eye taking into * account the current scene mode: 3D, 2D, or Columbus view. * <p> @@ -1306,7 +1306,7 @@ void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, * @see czm_translateRelativeToEye */ vec4 czm_computePosition(); -`;var yO=`/** +`;var CO=`/** * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as * the transmittance value for the ray. This function uses automatic uniforms * so the atmosphere settings are always synced with the current scene. @@ -1455,7 +1455,7 @@ void czm_computeScattering( // Compute the transmittance i.e. how much light is passing through the atmosphere. opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); } -`;var xO=`/** +`;var AO=`/** * @private */ vec2 cordic(float angle) @@ -1666,7 +1666,7 @@ vec2 czm_cosineAndSine(float angle) return cordic(angle); } } -`;var bO=`/** +`;var EO=`/** * Decompresses texture coordinates that were packed into a single float. * * @name czm_decompressTextureCoordinates @@ -1683,7 +1683,7 @@ vec2 czm_cosineAndSine(float angle) float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; return vec2(stx, sty); } -`;var TO=`// emulated noperspective +`;var SO=`// emulated noperspective #if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) out float v_WindowZ; #endif @@ -1730,7 +1730,7 @@ vec4 czm_depthClamp(vec4 coords) #endif return coords; } -`;var CO=`/** +`;var vO=`/** * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping. @@ -1763,7 +1763,7 @@ mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) bitangentEC.x, bitangentEC.y, bitangentEC.z, normalEC.x, normalEC.y, normalEC.z); } -`;var AO=`/** +`;var wO=`/** * DOC_TBA * * @name czm_ellipsoidContainsPoint @@ -1775,7 +1775,7 @@ bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; return (dot(scaled, scaled) <= 1.0); } -`;var EO=`/** +`;var DO=`/** * Approximate uv coordinates based on the ellipsoid normal. * * @name czm_ellipsoidTextureCoordinates @@ -1785,7 +1785,7 @@ vec2 czm_ellipsoidTextureCoordinates(vec3 normal) { return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); } -`;var SO=`/** +`;var IO=`/** * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code> * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s, @@ -1821,7 +1821,7 @@ bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { bool czm_equalsEpsilon(float left, float right, float epsilon) { return (abs(left - right) <= epsilon); } -`;var vO=`/** +`;var PO=`/** * DOC_TBA * * @name czm_eyeOffset @@ -1841,7 +1841,7 @@ vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) p.z += zEyeOffset.z; return p; } -`;var wO=`/** +`;var RO=`/** * Transforms a position from eye to window coordinates. The transformation * from eye to clip coordinates is done using {@link czm_projection}. * The transform from normalized device coordinates to window coordinates is @@ -1873,7 +1873,7 @@ vec4 czm_eyeToWindowCoordinates(vec4 positionEC) q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates return q; } -`;var DO=`/** +`;var OO=`/** * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input. * * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on @@ -1928,7 +1928,7 @@ float czm_fastApproximateAtan(float x, float y) { t = czm_branchFreeTernary(y < 0.0, -t, t); return t; } -`;var IO=`/** +`;var MO=`/** * Gets the color with fog at a distance from the camera. * * @name czm_fog @@ -1966,7 +1966,7 @@ vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifie float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); return mix(color, fogColor, fog); } -`;var PO=`/** +`;var LO=`/** * Converts a color from RGB space to linear space. * * @name czm_gammaCorrect @@ -1988,7 +1988,7 @@ vec4 czm_gammaCorrect(vec4 color) { #endif return color; } -`;var RO=`/** +`;var NO=`/** * DOC_TBA * * @name czm_geodeticSurfaceNormal @@ -2004,7 +2004,7 @@ vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, v { return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); } -`;var OO=`/** +`;var FO=`/** * An czm_material with default values. Every material's czm_getMaterial * should use this default material as a base for the material it returns. * The default normal value is given by materialInput.normalEC. @@ -2031,7 +2031,7 @@ czm_material czm_getDefaultMaterial(czm_materialInput materialInput) material.alpha = 1.0; return material; } -`;var MO=`/** +`;var BO=`/** * Select which direction vector to use for dynamic atmosphere lighting based on an enum value * * @name czm_getDynamicAtmosphereLightDirection @@ -2053,7 +2053,7 @@ vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) { czm_sunDirectionWC * float(lightEnum == SUNLIGHT); return normalize(lightDirection); } -`;var LO=`/** +`;var kO=`/** * Calculates the intensity of diffusely reflected light. * * @name czm_getLambertDiffuse @@ -2075,7 +2075,7 @@ float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) { return max(dot(lightDirectionEC, normalEC), 0.0); } -`;var NO=`/** +`;var VO=`/** * Calculates the specular intensity of reflected light. * * @name czm_getSpecular @@ -2104,7 +2104,7 @@ float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float // Prevent this by making sure shininess is at least czm_epsilon2. return pow(specular, max(shininess, czm_epsilon2)); } -`;var FO=`/** +`;var UO=`/** * @private */ vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) @@ -2141,7 +2141,7 @@ vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRa // average and scale to between -1 and 1 return ((noise / 4.0) - 0.5) * 2.0; } -`;var BO=`/** +`;var zO=`/** * Adjusts the hue of a color. * * @name czm_hue @@ -2171,7 +2171,7 @@ vec3 czm_hue(vec3 rgb, float adjustment) vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); return toRGB * color; } -`;var kO=`/** +`;var HO=`/** * Converts a color in linear space to RGB space. * * @name czm_inverseGamma @@ -2183,7 +2183,7 @@ vec3 czm_hue(vec3 rgb, float adjustment) vec3 czm_inverseGamma(vec3 color) { return pow(color, vec3(1.0 / czm_gamma)); } -`;var VO=`/** +`;var GO=`/** * Determines if a time interval is empty. * * @name czm_isEmpty @@ -2202,7 +2202,7 @@ bool czm_isEmpty(czm_raySegment interval) { return (interval.stop < 0.0); } -`;var UO=`/** +`;var WO=`/** * Determines if a time interval is empty. * * @name czm_isFull @@ -2221,7 +2221,7 @@ bool czm_isFull(czm_raySegment interval) { return (interval.start == 0.0 && interval.stop == czm_infinity); } -`;var zO=`/** +`;var jO=`/** * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located. * * @name czm_latitudeToWebMercatorFraction @@ -2242,7 +2242,7 @@ float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, fl return (mercatorY - southMercatorY) * oneOverMercatorHeight; } -`;var HO=`/** +`;var qO=`/** * Computes distance from an point in 2D to a line in 2D. * * @name czm_lineDistance @@ -2256,7 +2256,7 @@ float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, fl float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1); } -`;var GO=`/** +`;var YO=`/** * Converts a linear RGB color to an sRGB color. * * @param {vec3|vec4} linearIn The color in linear color space. @@ -2272,7 +2272,7 @@ vec4 czm_linearToSrgb(vec4 linearIn) vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); return vec4(srgbOut, linearIn.a); } -`;var WO=`/** +`;var XO=`/** * Computes the luminance of a color. * * @name czm_luminance @@ -2292,7 +2292,7 @@ float czm_luminance(vec3 rgb) const vec3 W = vec3(0.2125, 0.7154, 0.0721); return dot(rgb, W); } -`;var jO=`/** +`;var KO=`/** * Find the maximum component of a vector. * * @name czm_maximumComponent @@ -2313,7 +2313,7 @@ float czm_maximumComponent(vec4 v) { return max(max(max(v.x, v.y), v.z), v.w); } -`;var qO=`/** +`;var ZO=`/** * Computes the size of a pixel in meters at a distance from the eye. * <p> * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel. @@ -2374,7 +2374,7 @@ float czm_metersPerPixel(vec4 positionEC) { return czm_metersPerPixel(positionEC, czm_pixelRatio); } -`;var YO=`/** +`;var $O=`/** * Transforms a position from model to window coordinates. The transformation * from model to clip coordinates is done using {@link czm_modelViewProjection}. * The transform from normalized device coordinates to window coordinates is @@ -2411,7 +2411,7 @@ vec4 czm_modelToWindowCoordinates(vec4 position) q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates return q; } -`;var XO=`/** +`;var QO=`/** * DOC_TBA * * @name czm_multiplyWithColorBalance @@ -2429,7 +2429,7 @@ vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; } -`;var KO=`/** +`;var JO=`/** * Computes a value that scales with distance. The scaling is clamped at the near and * far distances, and does not extrapolate. This function works with the * {@link NearFarScalar} JavaScript class. @@ -2455,7 +2455,7 @@ float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) return mix(valueAtMin, valueAtMax, t); } -`;var ZO=` /** +`;var eM=` /** * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ @@ -2538,7 +2538,7 @@ float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) vector3 = czm_octDecode(vec2(x, y)); } -`;var $O=`/** +`;var tM=`/** * Packs a depth value into a vec4 that can be represented by unsigned bytes. * * @name czm_packDepth @@ -2556,7 +2556,7 @@ vec4 czm_packDepth(float depth) enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); return enc; } -`;var QO=`vec3 lambertianDiffuse(vec3 diffuseColor) +`;var nM=`vec3 lambertianDiffuse(vec3 diffuseColor) { return diffuseColor / czm_pi; } @@ -2720,7 +2720,7 @@ vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, // Lo = (diffuse + specular) * Li * NdotL return (diffuseContribution + specularContribution) * NdotL; } -`;var JO=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral +`;var iM=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral // Input color is non-negative and resides in the Linear Rec. 709 color space. // Output color is also Linear Rec. 709, but in the [0, 1] range. @@ -2743,7 +2743,7 @@ vec3 czm_pbrNeutralTonemapping(vec3 color) { float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0); return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g); } -`;var eM=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) +`;var oM=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) { return czm_getLambertDiffuse(lightDirectionEC, material.normal); } @@ -2806,7 +2806,7 @@ vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) return vec4(color, material.alpha); } -`;var tM=`/** +`;var rM=`/** * Computes distance from a point to a plane. * * @name czm_planeDistance @@ -2834,7 +2834,7 @@ float czm_planeDistance(vec4 plane, vec3 point) { float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { return (dot(planeNormal, point) + planeDistance); } -`;var nM=`/** +`;var sM=`/** * Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero. * * @name czm_pointAlongRay @@ -2853,7 +2853,7 @@ vec3 czm_pointAlongRay(czm_ray ray, float time) { return ray.origin + (time * ray.direction); } -`;var iM=`/** +`;var aM=`/** * DOC_TBA * * @name czm_rayEllipsoidIntersectionInterval @@ -2936,7 +2936,7 @@ czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_ } } } -`;var oM=`/** +`;var cM=`/** * Compute the intersection interval of a ray with a sphere. * * @name czm_raySphereIntersectionInterval @@ -2972,11 +2972,11 @@ czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float czm_raySegment result = czm_raySegment(t0, t1); return result; } -`;var rM=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) +`;var lM=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) { return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } -`;var sM=`/** +`;var uM=`/** * Reads a value previously transformed with {@link czm_writeNonPerspective} * by dividing it by \`w\`, the value used in the perspective divide. * This function is intended to be called in a fragment shader to access a @@ -3007,7 +3007,7 @@ vec3 czm_readNonPerspective(vec3 value, float oneOverW) { vec4 czm_readNonPerspective(vec4 value, float oneOverW) { return value * oneOverW; } -`;var aM=`float czm_reverseLogDepth(float logZ) +`;var fM=`float czm_reverseLogDepth(float logZ) { #ifdef LOG_DEPTH float near = czm_currentFrustum.x; @@ -3018,7 +3018,7 @@ vec4 czm_readNonPerspective(vec4 value, float oneOverW) { #endif return logZ; } -`;var cM=`/** +`;var dM=`/** * Round a floating point value. This function exists because round() doesn't * exist in GLSL 1.00. * @@ -3040,7 +3040,7 @@ vec3 czm_round(vec3 value) { vec4 czm_round(vec4 value) { return floor(value + 0.5); } -`;var lM=`/** +`;var hM=`/** * Adjusts the saturation of a color. * * @name czm_saturation @@ -3062,7 +3062,7 @@ vec3 czm_saturation(vec3 rgb, float adjustment) vec3 intensity = vec3(dot(rgb, W)); return mix(intensity, rgb, adjustment); } -`;var uM=` +`;var mM=` float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) { return czm_unpackDepth(czm_textureCube(shadowMap, d)); @@ -3086,7 +3086,7 @@ float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) { return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -`;var fM=` +`;var pM=` float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) { #ifdef USE_NORMAL_SHADING @@ -3152,7 +3152,7 @@ float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParam return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } #endif -`;var dM=`/** +`;var gM=`/** * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0. * @@ -3181,7 +3181,7 @@ vec4 czm_signNotZero(vec4 value) { return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); } -`;var hM=`/** +`;var _M=`/** * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector. * <p> * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]. @@ -3225,7 +3225,7 @@ vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) return max(L, vec3(0.0)); } -`;var mM=`/** +`;var yM=`/** * Converts an sRGB color to a linear RGB color. * * @param {vec3|vec4} srgbIn The color in sRGB space @@ -3241,7 +3241,7 @@ vec4 czm_srgbToLinear(vec4 srgbIn) vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); return vec4(linearOut, srgbIn.a); } -`;var pM=`/** +`;var xM=`/** * Creates a matrix that transforms vectors from tangent space to eye space. * * @name czm_tangentToEyeSpaceMatrix @@ -3266,7 +3266,7 @@ mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC bitangent.x, bitangent.y, bitangent.z, normal.x , normal.y , normal.z); } -`;var gM=`/** +`;var bM=`/** * A wrapper around the texture (WebGL2) / textureCube (WebGL1) * function to allow for WebGL 1 support. * @@ -3301,7 +3301,7 @@ vec4 czm_textureCube(samplerCube sampler, vec3 p, float lod) { #elif defined(GL_EXT_shader_texture_lod) return textureCubeLodEXT(sampler, p, lod); #endif -}`;var _M=`/** +}`;var TM=`/** * Transforms a plane. * * @name czm_transformPlane @@ -3316,7 +3316,7 @@ vec4 czm_transformPlane(vec4 plane, mat4 transform) { float normalMagnitude = length(transformedPlane.xyz); return transformedPlane / normalMagnitude; } -`;var yM=`/** +`;var CM=`/** * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3}, * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to * be relative to the eye. As shown in the example, the position can then be transformed in eye @@ -3361,7 +3361,7 @@ vec4 czm_translateRelativeToEye(vec3 high, vec3 low) return vec4(highDifference + lowDifference, 1.0); } -`;var xM=`/** +`;var AM=`/** * @private */ vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) @@ -3388,7 +3388,7 @@ vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirection return vec4(color, material.alpha); } -`;var bM=`/** +`;var EM=`/** * Returns the transpose of the matrix. The input <code>matrix</code> can be * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>. * @@ -3433,7 +3433,7 @@ mat4 czm_transpose(mat4 matrix) matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); } -`;var TM=`vec2 getLookupUv(vec2 dimensions, int i) { +`;var SM=`vec2 getLookupUv(vec2 dimensions, int i) { int pixY = i / int(dimensions.x); int pixX = i - (pixY * int(dimensions.x)); float pixelWidth = 1.0 / dimensions.x; @@ -3446,7 +3446,7 @@ mat4 czm_transpose(mat4 matrix) vec4 czm_unpackClippingExtents(highp sampler2D extentsTexture, int index) { vec2 textureDimensions = vec2(textureSize(extentsTexture, 0)); return texture(extentsTexture, getLookupUv(textureDimensions, index)); -}`;var CM=`/** +}`;var vM=`/** * Unpacks a vec4 depth value to a float in [0, 1) range. * * @name czm_unpackDepth @@ -3462,7 +3462,7 @@ float czm_unpackDepth(vec4 packedDepth) // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } -`;var AM=`/** +`;var wM=`/** * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4. * * @name czm_unpackFloat @@ -3486,7 +3486,7 @@ float czm_unpackFloat(vec4 packedFloat) float result = sign * exp2(exponent - 23.0) * mantissa; return result; } -`;var EM=`/** +`;var DM=`/** * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type, * so the return value is an int. * <p> @@ -3517,7 +3517,7 @@ float czm_unpackFloat(vec4 packedFloat) vec4 rounded = czm_round(packedValue * 255.0); return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); } -`;var SM=`/** +`;var IM=`/** * Transform metadata values following the EXT_structural_metadata spec * by multiplying by scale and adding the offset. Operations are always * performed component-wise, even for matrices. @@ -3555,7 +3555,7 @@ mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { return matrixCompMult(scale, value) + offset; } -`;var vM=`#ifdef LOG_DEPTH +`;var PM=`#ifdef LOG_DEPTH // 1.0 at the near plane, increasing linearly from there. out float v_depthFromNearPlusOne; #ifdef SHADOW_MAP @@ -3619,7 +3619,7 @@ void czm_vertexLogDepth(vec4 clipCoords) czm_updatePositionDepth(clipCoords); #endif } -`;var wM=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +`;var RM=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) { // Reconstruct NDC coordinates float x = 2.0 * screenCoordinate.x - 1.0; @@ -3730,7 +3730,7 @@ vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); } -`;var DM=`// emulated noperspective +`;var OM=`// emulated noperspective #if !defined(LOG_DEPTH) in float v_WindowZ; #endif @@ -3754,7 +3754,7 @@ void czm_writeDepthClamp() gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); #endif } -`;var IM=`#ifdef LOG_DEPTH +`;var MM=`#ifdef LOG_DEPTH in float v_depthFromNearPlusOne; #ifdef POLYGON_OFFSET @@ -3833,7 +3833,7 @@ void czm_writeLogDepth() { czm_writeLogDepth(v_depthFromNearPlusOne); #endif } -`;var PM=`/** +`;var LM=`/** * Transforms a value for non-perspective interpolation by multiplying * it by w, the value used in the perspective divide. This function is * intended to be called in a vertex shader to compute the value of a @@ -3865,7 +3865,7 @@ vec3 czm_writeNonPerspective(vec3 value, float w) { vec4 czm_writeNonPerspective(vec4 value, float w) { return value * w; } -`;var CT={czm_degreesPerRadian:iR,czm_depthRange:oR,czm_epsilon1:rR,czm_epsilon2:sR,czm_epsilon3:aR,czm_epsilon4:cR,czm_epsilon5:lR,czm_epsilon6:uR,czm_epsilon7:fR,czm_infinity:dR,czm_oneOverPi:hR,czm_oneOverTwoPi:mR,czm_passCesium3DTile:pR,czm_passCesium3DTileClassification:gR,czm_passCesium3DTileClassificationIgnoreShow:_R,czm_passClassification:yR,czm_passCompute:xR,czm_passEnvironment:bR,czm_passGlobe:TR,czm_passOpaque:CR,czm_passOverlay:AR,czm_passTerrainClassification:ER,czm_passTranslucent:SR,czm_passVoxels:vR,czm_pi:wR,czm_piOverFour:DR,czm_piOverSix:IR,czm_piOverThree:PR,czm_piOverTwo:RR,czm_radiansPerDegree:OR,czm_sceneMode2D:MR,czm_sceneMode3D:LR,czm_sceneModeColumbusView:NR,czm_sceneModeMorphing:FR,czm_solarRadius:BR,czm_threePiOver2:kR,czm_twoPi:VR,czm_webMercatorMaxLatitude:UR,czm_depthRangeStruct:zR,czm_material:HR,czm_materialInput:GR,czm_modelMaterial:WR,czm_modelVertexOutput:jR,czm_ray:qR,czm_raySegment:YR,czm_shadowParameters:XR,czm_HSBToRGB:KR,czm_HSLToRGB:ZR,czm_RGBToHSB:$R,czm_RGBToHSL:QR,czm_RGBToXYZ:JR,czm_XYZToRGB:eO,czm_acesTonemapping:tO,czm_alphaWeight:nO,czm_antialias:iO,czm_applyHSBShift:oO,czm_approximateSphericalCoordinates:rO,czm_approximateTanh:sO,czm_backFacing:aO,czm_branchFreeTernary:cO,czm_cascadeColor:lO,czm_cascadeDistance:uO,czm_cascadeMatrix:fO,czm_cascadeWeights:dO,czm_clipPolygons:hO,czm_columbusViewMorph:mO,czm_computeAtmosphereColor:pO,czm_computeGroundAtmosphereScattering:gO,czm_computePosition:_O,czm_computeScattering:yO,czm_cosineAndSine:xO,czm_decompressTextureCoordinates:bO,czm_depthClamp:TO,czm_eastNorthUpToEyeCoordinates:CO,czm_ellipsoidContainsPoint:AO,czm_ellipsoidTextureCoordinates:EO,czm_equalsEpsilon:SO,czm_eyeOffset:vO,czm_eyeToWindowCoordinates:wO,czm_fastApproximateAtan:DO,czm_fog:IO,czm_gammaCorrect:PO,czm_geodeticSurfaceNormal:RO,czm_getDefaultMaterial:OO,czm_getDynamicAtmosphereLightDirection:MO,czm_getLambertDiffuse:LO,czm_getSpecular:NO,czm_getWaterNoise:FO,czm_hue:BO,czm_inverseGamma:kO,czm_isEmpty:VO,czm_isFull:UO,czm_latitudeToWebMercatorFraction:zO,czm_lineDistance:HO,czm_linearToSrgb:GO,czm_luminance:WO,czm_maximumComponent:jO,czm_metersPerPixel:qO,czm_modelToWindowCoordinates:YO,czm_multiplyWithColorBalance:XO,czm_nearFarScalar:KO,czm_octDecode:ZO,czm_packDepth:$O,czm_pbrLighting:QO,czm_pbrNeutralTonemapping:JO,czm_phong:eM,czm_planeDistance:tM,czm_pointAlongRay:nM,czm_rayEllipsoidIntersectionInterval:iM,czm_raySphereIntersectionInterval:oM,czm_readDepth:rM,czm_readNonPerspective:sM,czm_reverseLogDepth:aM,czm_round:cM,czm_saturation:lM,czm_shadowDepthCompare:uM,czm_shadowVisibility:fM,czm_signNotZero:dM,czm_sphericalHarmonics:hM,czm_srgbToLinear:mM,czm_tangentToEyeSpaceMatrix:pM,czm_textureCube:gM,czm_transformPlane:_M,czm_translateRelativeToEye:yM,czm_translucentPhong:xM,czm_transpose:bM,czm_unpackClippingExtents:TM,czm_unpackDepth:CM,czm_unpackFloat:AM,czm_unpackUint:EM,czm_valueTransform:SM,czm_vertexLogDepth:vM,czm_windowToEyeCoordinates:wM,czm_writeDepthClamp:DM,czm_writeLogDepth:IM,czm_writeNonPerspective:PM};function jDe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` +`;var CT={czm_degreesPerRadian:aR,czm_depthRange:cR,czm_epsilon1:lR,czm_epsilon2:uR,czm_epsilon3:fR,czm_epsilon4:dR,czm_epsilon5:hR,czm_epsilon6:mR,czm_epsilon7:pR,czm_infinity:gR,czm_oneOverPi:_R,czm_oneOverTwoPi:yR,czm_passCesium3DTile:xR,czm_passCesium3DTileClassification:bR,czm_passCesium3DTileClassificationIgnoreShow:TR,czm_passClassification:CR,czm_passCompute:AR,czm_passEnvironment:ER,czm_passGlobe:SR,czm_passOpaque:vR,czm_passOverlay:wR,czm_passTerrainClassification:DR,czm_passTranslucent:IR,czm_passVoxels:PR,czm_pi:RR,czm_piOverFour:OR,czm_piOverSix:MR,czm_piOverThree:LR,czm_piOverTwo:NR,czm_radiansPerDegree:FR,czm_sceneMode2D:BR,czm_sceneMode3D:kR,czm_sceneModeColumbusView:VR,czm_sceneModeMorphing:UR,czm_solarRadius:zR,czm_threePiOver2:HR,czm_twoPi:GR,czm_webMercatorMaxLatitude:WR,czm_depthRangeStruct:jR,czm_material:qR,czm_materialInput:YR,czm_modelMaterial:XR,czm_modelVertexOutput:KR,czm_ray:ZR,czm_raySegment:$R,czm_shadowParameters:QR,czm_HSBToRGB:JR,czm_HSLToRGB:eO,czm_RGBToHSB:tO,czm_RGBToHSL:nO,czm_RGBToXYZ:iO,czm_XYZToRGB:oO,czm_acesTonemapping:rO,czm_alphaWeight:sO,czm_antialias:aO,czm_applyHSBShift:cO,czm_approximateSphericalCoordinates:lO,czm_approximateTanh:uO,czm_backFacing:fO,czm_branchFreeTernary:dO,czm_cascadeColor:hO,czm_cascadeDistance:mO,czm_cascadeMatrix:pO,czm_cascadeWeights:gO,czm_clipPolygons:_O,czm_columbusViewMorph:yO,czm_computeAtmosphereColor:xO,czm_computeGroundAtmosphereScattering:bO,czm_computePosition:TO,czm_computeScattering:CO,czm_cosineAndSine:AO,czm_decompressTextureCoordinates:EO,czm_depthClamp:SO,czm_eastNorthUpToEyeCoordinates:vO,czm_ellipsoidContainsPoint:wO,czm_ellipsoidTextureCoordinates:DO,czm_equalsEpsilon:IO,czm_eyeOffset:PO,czm_eyeToWindowCoordinates:RO,czm_fastApproximateAtan:OO,czm_fog:MO,czm_gammaCorrect:LO,czm_geodeticSurfaceNormal:NO,czm_getDefaultMaterial:FO,czm_getDynamicAtmosphereLightDirection:BO,czm_getLambertDiffuse:kO,czm_getSpecular:VO,czm_getWaterNoise:UO,czm_hue:zO,czm_inverseGamma:HO,czm_isEmpty:GO,czm_isFull:WO,czm_latitudeToWebMercatorFraction:jO,czm_lineDistance:qO,czm_linearToSrgb:YO,czm_luminance:XO,czm_maximumComponent:KO,czm_metersPerPixel:ZO,czm_modelToWindowCoordinates:$O,czm_multiplyWithColorBalance:QO,czm_nearFarScalar:JO,czm_octDecode:eM,czm_packDepth:tM,czm_pbrLighting:nM,czm_pbrNeutralTonemapping:iM,czm_phong:oM,czm_planeDistance:rM,czm_pointAlongRay:sM,czm_rayEllipsoidIntersectionInterval:aM,czm_raySphereIntersectionInterval:cM,czm_readDepth:lM,czm_readNonPerspective:uM,czm_reverseLogDepth:fM,czm_round:dM,czm_saturation:hM,czm_shadowDepthCompare:mM,czm_shadowVisibility:pM,czm_signNotZero:gM,czm_sphericalHarmonics:_M,czm_srgbToLinear:yM,czm_tangentToEyeSpaceMatrix:xM,czm_textureCube:bM,czm_transformPlane:TM,czm_translateRelativeToEye:CM,czm_translucentPhong:AM,czm_transpose:EM,czm_unpackClippingExtents:SM,czm_unpackDepth:vM,czm_unpackFloat:wM,czm_unpackUint:DM,czm_valueTransform:IM,czm_vertexLogDepth:PM,czm_windowToEyeCoordinates:RM,czm_writeDepthClamp:OM,czm_writeLogDepth:MM,czm_writeNonPerspective:LM};function YDe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable ${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable ${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod @@ -3875,8 +3875,8 @@ ${n}`,n=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif ${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 -${n}`,n}var RM=jDe;function PJ(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=` -`;return i})}function RJ(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=PJ(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function OJ(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&Os._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=RJ(i,Os._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),OJ(o,t)}}))}function qDe(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function YDe(e){let t=[],n=RJ("main",e,t);OJ(n,t),qDe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource} +${n}`,n}var NM=YDe;function PJ(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=` +`;return i})}function RJ(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=PJ(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function OJ(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&Os._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=RJ(i,Os._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),OJ(o,t)}}))}function XDe(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function KDe(e){let t=[],n=RJ("main",e,t);OJ(n,t),XDe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource} `;return i.replace(n.glslSource,"")}function MJ(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i<o;++i)r+=` #line 0 ${s[i]}`;r=PJ(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(x,b){return a=b,` @@ -3895,13 +3895,13 @@ ${s[i]}`;r=PJ(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(x,b){return a `),n.floatingPointTexture&&(f+=`#define OES_texture_float -`);let _="";e.includeBuiltIns&&(_=YDe(r)),f+=` +`);let _="";e.includeBuiltIns&&(_=KDe(r)),f+=` #line 0 `;let m=_+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(m)&&!/czm_out_FragColor/g.test(m)&&/out_FragColor/g.test(m)&&(f+=`layout(location = 0) out vec4 out_FragColor; `),f+=_,f+=r,n.webgl2?f=`#version 300 es -${f}`:f=RM(f,t),f}function Os(e){e=y(e,y.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=y(e.includeBuiltIns,!0)}Os.prototype.clone=function(){return new Os({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Os.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Os.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(` -`);return`${t}:${n}:${i}:${o}`};Os.prototype.createCombinedVertexShader=function(e){return MJ(this,!1,e)};Os.prototype.createCombinedFragmentShader=function(e){return MJ(this,!0,e)};Os._czmBuiltinsAndUniforms={};for(let e in CT)CT.hasOwnProperty(e)&&(Os._czmBuiltinsAndUniforms[e]=CT[e]);for(let e in Ig)if(Ig.hasOwnProperty(e)){let t=Ig[e];typeof t.getDeclaration=="function"&&(Os._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Os.createPickVertexShaderSource=function(e){return`${Os.replaceMain(e,"czm_old_main")} +${f}`:f=NM(f,t),f}function Os(e){e=y(e,y.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=y(e.includeBuiltIns,!0)}Os.prototype.clone=function(){return new Os({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Os.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Os.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(` +`);return`${t}:${n}:${i}:${o}`};Os.prototype.createCombinedVertexShader=function(e){return MJ(this,!1,e)};Os.prototype.createCombinedFragmentShader=function(e){return MJ(this,!0,e)};Os._czmBuiltinsAndUniforms={};for(let e in CT)CT.hasOwnProperty(e)&&(Os._czmBuiltinsAndUniforms[e]=CT[e]);for(let e in Pg)if(Pg.hasOwnProperty(e)){let t=Pg[e];typeof t.getDeclaration=="function"&&(Os._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Os.createPickVertexShaderSource=function(e){return`${Os.replaceMain(e,"czm_old_main")} in vec4 pickColor; out vec4 czm_pickColor; void main() @@ -3917,36 +3917,2295 @@ void main() } out_FragColor = czm_pickColor; }`;return`${n} -${i}`};function XDe(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function LJ(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function NJ(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(LJ(e,o))return o}}var KDe=["v_normalEC","v_normal"];Os.findNormalVarying=function(e){return LJ(e,"#ifdef HAS_NORMALS")?XDe(e,"HAS_NORMALS")?"v_normalEC":void 0:NJ(e,KDe)};var ZDe=["v_positionEC"];Os.findPositionVarying=function(e){return NJ(e,ZDe)};var Ue=Os;function hd(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(hd.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});hd.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function $De(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}hd.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Ue({sources:[t]})),typeof n=="string"&&(n=new Ue({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?$De(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),h=n.createCombinedFragmentShader(u),p=new en({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};hd.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){a6(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};hd.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};hd.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Ue({sources:[r]})),typeof s=="string"&&(s=new Ue({sources:[s]}));let c=this._context,u=r.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),h=new en({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function a6(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];a6(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}hd.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];a6(this,n),--this._numberOfShaders}this._shadersToRelease={}};hd.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};hd.prototype.isDestroyed=function(){return!1};hd.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var OM=hd;function md(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=tt.RGBA,pixelDatatype:o=Ke.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new $t}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===tt.RGB||i===tt.LUMINANCE,h=tt.toInternalFormat(i,o,t),p=tt.isCompressedFormat(h),_=t._gl,m=p?tt.compressedTextureSizeInBytes(i,c,u):tt.textureSizeInBytes(i,o,c,u);this._id=e.id??zn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=_.TEXTURE_2D,this._texture=_.createTexture(),this._internalFormat=h,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._dimensions=new U(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,VJ(this,a),_.activeTexture(_.TEXTURE0),_.bindTexture(this._textureTarget,this._texture),l(n)?(s?_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.NONE):_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?tt.isCompressedFormat(h)?QDe(this,n):FJ(this,n):l(n.framebuffer)?eIe(this,n):BJ(this,n),this._initialized=!0):kJ(this),_.bindTexture(this._textureTarget,null)}function QDe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=MM(c),u=MM(u),i.compressedTexImage2D(o,f+1,r,c,u,0,t.mipLevels[f])}}function FJ(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,h=tt.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,h),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=tt.flipY(p,c,u,s,a)),i.texImage2D(o,0,r,s,a,0,c,Ke.toWebGLConstant(u,n),p),l(t.mipLevels)){let _=s,m=a;for(let x=0;x<t.mipLevels.length;++x)_=MM(_),m=MM(m),i.texImage2D(o,x+1,r,_,m,0,c,Ke.toWebGLConstant(u,n),t.mipLevels[x])}}function JDe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=tt.alignmentInBytes(c,u,o);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=tt.flipY(t,c,u,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,c,Ke.toWebGLConstant(u,s),t)}function eIe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function BJ(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,Ke.toWebGLConstant(e.pixelDatatype,n),t)}function tIe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,Ke.toWebGLConstant(e.pixelDatatype,o),t)}function MM(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function kJ(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Ke.toWebGLConstant(e._pixelDatatype,t),null)}md.create=function(e){return new md(e)};md.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,{pixelFormat:i=tt.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:c}=e;return new md({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(md.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){VJ(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function VJ(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Zt.NEAREST_MIPMAP_NEAREST,Zt.NEAREST_MIPMAP_LINEAR,Zt.LINEAR_MIPMAP_NEAREST,Zt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ke.FLOAT&&!r.textureFloatLinear||a===Ke.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Zt.NEAREST_MIPMAP_NEAREST:Zt.NEAREST,i=di.NEAREST),r.webgl2&&tt.isDepthFormat(s)&&(n=Zt.NEAREST,i=di.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}md.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?FJ(this,i):BJ(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),kJ(this)),this._initialized=!0),f||(l(i.arrayBufferView)?JDe(this,i.arrayBufferView,t,n,c,u):tIe(this,i,t,n)),s.bindTexture(a,null)};md.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._width),r=y(r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};md.prototype.generateMipmap=function(e){e=y(e,sp.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};md.prototype.isDestroyed=function(){return!1};md.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var Ot=md;function N0(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(N0.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});N0.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};N0.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};N0.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};N0.prototype.isDestroyed=function(){return!1};N0.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var LM=N0;function Zu(e){this.planes=y(e,[])}var KS=[new d,new d,new d];d.clone(d.UNIT_X,KS[0]);d.clone(d.UNIT_Y,KS[1]);d.clone(d.UNIT_Z,KS[2]);var Ug=new d,nIe=new d,UJ=new an(new d(1,0,0),0);Zu.fromBoundingSphere=function(e,t){l(t)||(t=new Zu);let n=KS.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=KS[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new oe),l(f)||(f=i[s+1]=new oe),d.multiplyByScalar(c,-r,Ug),d.add(o,Ug,Ug),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-d.dot(c,Ug),d.multiplyByScalar(c,r,Ug),d.add(o,Ug,Ug),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-d.dot(d.negate(c,nIe),Ug),s+=2}return t};Zu.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(an.fromCartesian4(t[i],UJ));if(r===jt.OUTSIDE)return jt.OUTSIDE;r===jt.INTERSECTING&&(n=!0)}return n?jt.INTERSECTING:jt.INSIDE};Zu.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Zu.MASK_OUTSIDE||t===Zu.MASK_INSIDE)return t;let n=Zu.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&!(t&s))continue;let a=e.intersectPlane(an.fromCartesian4(i[o],UJ));if(a===jt.OUTSIDE)return Zu.MASK_OUTSIDE;a===jt.INTERSECTING&&(n|=s)}return n};Zu.MASK_OUTSIDE=4294967295;Zu.MASK_INSIDE=0;Zu.MASK_INDETERMINATE=2147483647;var ys=Zu;function Ih(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new ys,this._orthographicMatrix=new F}function zJ(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Ih.prototype,{projectionMatrix:{get:function(){return zJ(this),this._orthographicMatrix}}});var iIe=new d,oIe=new d,rIe=new d,c6=new d;Ih.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=d.cross(t,n,iIe);d.normalize(f,f);let h=oIe;d.multiplyByScalar(t,c,h),d.add(e,h,h);let p=rIe;d.multiplyByScalar(f,a,p),d.add(h,p,p);let _=i[0];return l(_)||(_=i[0]=new oe),_.x=f.x,_.y=f.y,_.z=f.z,_.w=-d.dot(f,p),d.multiplyByScalar(f,s,p),d.add(h,p,p),_=i[1],l(_)||(_=i[1]=new oe),_.x=-f.x,_.y=-f.y,_.z=-f.z,_.w=-d.dot(d.negate(f,c6),p),d.multiplyByScalar(n,r,p),d.add(h,p,p),_=i[2],l(_)||(_=i[2]=new oe),_.x=n.x,_.y=n.y,_.z=n.z,_.w=-d.dot(n,p),d.multiplyByScalar(n,o,p),d.add(h,p,p),_=i[3],l(_)||(_=i[3]=new oe),_.x=-n.x,_.y=-n.y,_.z=-n.z,_.w=-d.dot(d.negate(n,c6),p),_=i[4],l(_)||(_=i[4]=new oe),_.x=t.x,_.y=t.y,_.z=t.z,_.w=-d.dot(t,h),d.multiplyByScalar(t,u,p),d.add(e,p,p),_=i[5],l(_)||(_=i[5]=new oe),_.x=-t.x,_.y=-t.y,_.z=-t.z,_.w=-d.dot(d.negate(t,c6),p),this._cullingVolume};Ih.prototype.getPixelDimensions=function(e,t,n,i,o){zJ(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};Ih.prototype.clone=function(e){return l(e)||(e=new Ih),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Ih.prototype.equals=function(e){return l(e)&&e instanceof Ih&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Ih.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Ih&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Hr=Ih;function ul(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Hr,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}ul.packedLength=4;ul.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};ul.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ul),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function zg(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(ul.prototype,{projectionMatrix:{get:function(){return zg(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return zg(this),this._offCenterFrustum}}});ul.prototype.computeCullingVolume=function(e,t,n){return zg(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};ul.prototype.getPixelDimensions=function(e,t,n,i,o){return zg(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};ul.prototype.clone=function(e){return l(e)||(e=new ul),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};ul.prototype.equals=function(e){return!l(e)||!(e instanceof ul)?!1:(zg(this),zg(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};ul.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof ul)?!1:(zg(this),zg(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var rn=ul;var l6={};function sIe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var aIe=32.184,cIe=2451545;function see(e,t){t=Z.addSeconds(e,aIe,t);let n=Z.totalDays(t)-cIe;return t=Z.addSeconds(t,sIe(n),t),t}var NM=new Z(2451545,0,Wn.TAI),lIe=1e3,$u=P.RADIANS_PER_DEGREE,ql=P.RADIANS_PER_ARCSECOND,ba=14959787e4,HJ=new $;function aee(e,t,n,i,o,r,s){n<0&&(n=-n,o+=P.PI);let a=e*(1-t),c=i-o,u=o,f=fIe(r-i,t),h=uIe(t,0);gIe(c,n,u,HJ);let p=a*(1+t),_=Math.cos(f),m=Math.sin(f),x=1+t*_,b=p/x;return l(s)?(s.x=b*_,s.y=b*m,s.z=0):s=new d(b*_,b*m,0),$.multiplyByVector(HJ,s,s)}function uIe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function fIe(e,t){let n=mIe(e,t);return pIe(n,t)}var dIe=50,hIe=P.EPSILON8;function mIe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<dIe&&Math.abs(o-i)>hIe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*P.TWO_PI,o}function pIe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=P.zeroToTwoPi(r),e<0&&(r-=P.TWO_PI),r+=n*P.TWO_PI,r}function gIe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var _Ie=1.0000010178*ba,yIe=100.46645683*$u,xIe=129597742283429e-5*ql,GJ=16002,WJ=21863,jJ=32004,qJ=10931,YJ=14529,XJ=16368,KJ=15318,ZJ=32794,bIe=64*1e-7*ba,TIe=-152*1e-7*ba,CIe=62*1e-7*ba,AIe=-8*1e-7*ba,EIe=32*1e-7*ba,SIe=-41*1e-7*ba,vIe=19*1e-7*ba,wIe=-11*1e-7*ba,DIe=-150*1e-7*ba,IIe=-46*1e-7*ba,PIe=68*1e-7*ba,RIe=54*1e-7*ba,OIe=14*1e-7*ba,MIe=24*1e-7*ba,LIe=-28*1e-7*ba,NIe=22*1e-7*ba,$J=10,QJ=16002,JJ=21863,eee=10931,tee=1473,nee=32004,iee=4387,oee=73,FIe=-325*1e-7,BIe=-322*1e-7,kIe=-79*1e-7,VIe=232*1e-7,UIe=-52*1e-7,zIe=97*1e-7,HIe=55*1e-7,GIe=-41*1e-7,WIe=-105*1e-7,jIe=-137*1e-7,qIe=258*1e-7,YIe=35*1e-7,XIe=-116*1e-7,KIe=-88*1e-7,ZIe=-112*1e-7,$Ie=-80*1e-7,AT=new Z(0,0,Wn.TAI);function QIe(e,t){see(e,AT);let i=(AT.dayNumber-NM.dayNumber+(AT.secondsOfDay-NM.secondsOfDay)/jn.SECONDS_PER_DAY)/(jn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=_Ie+bIe*Math.cos(GJ*o)+DIe*Math.sin(GJ*o)+TIe*Math.cos(WJ*o)+IIe*Math.sin(WJ*o)+CIe*Math.cos(jJ*o)+PIe*Math.sin(jJ*o)+AIe*Math.cos(qJ*o)+RIe*Math.sin(qJ*o)+EIe*Math.cos(YJ*o)+OIe*Math.sin(YJ*o)+SIe*Math.cos(XJ*o)+MIe*Math.sin(XJ*o)+vIe*Math.cos(KJ*o)+LIe*Math.sin(KJ*o)+wIe*Math.cos(ZJ*o)+NIe*Math.sin(ZJ*o),s=yIe+xIe*i+FIe*Math.cos($J*o)+WIe*Math.sin($J*o)+BIe*Math.cos(QJ*o)+jIe*Math.sin(QJ*o)+kIe*Math.cos(JJ*o)+qIe*Math.sin(JJ*o)+VIe*Math.cos(eee*o)+YIe*Math.sin(eee*o)+UIe*Math.cos(tee*o)+XIe*Math.sin(tee*o)+zIe*Math.cos(nee*o)+KIe*Math.sin(nee*o)+HIe*Math.cos(iee*o)+ZIe*Math.sin(iee*o)+GIe*Math.cos(oee*o)+$Ie*Math.sin(oee*o),a=.0167086342-.0004203654*i,c=102.93734808*$u+11612.3529*ql*i,u=469.97289*ql*i,f=174.87317577*$u-8679.27034*ql*i;return aee(r,a,u,c,f,s,t)}function cee(e,t){see(e,AT);let i=(AT.dayNumber-NM.dayNumber+(AT.secondsOfDay-NM.secondsOfDay)/jn.SECONDS_PER_DAY)/jn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*$u,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*$u,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,_=125.04455501*$u,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*$u,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,T=297.85019547*$u+ql*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),C=93.27209062*$u+ql*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),A=134.96340251*$u+ql*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),S=357.52910918*$u+ql*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*$u-ql*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),D=2*T,O=4*T,R=6*T,M=2*A,L=3*A,g=4*A,E=2*C;a+=3400.4*Math.cos(D)-635.6*Math.cos(D-A)-235.6*Math.cos(A)+218.1*Math.cos(D-S)+181*Math.cos(D+A),c+=.014216*Math.cos(D-A)+.008551*Math.cos(D-M)-.001383*Math.cos(A)+.001356*Math.cos(D+A)-.001147*Math.cos(O-L)-914e-6*Math.cos(O-M)+869e-6*Math.cos(D-S-A)-627e-6*Math.cos(D)-394e-6*Math.cos(O-g)+282e-6*Math.cos(D-S-M)-279e-6*Math.cos(T-A)-236e-6*Math.cos(M)+231e-6*Math.cos(O)+229e-6*Math.cos(R-g)-201e-6*Math.cos(M-E),f+=486.26*Math.cos(D-E)-40.13*Math.cos(D)+37.51*Math.cos(E)+25.73*Math.cos(M-E)+19.97*Math.cos(D-S-E),p+=-55609*Math.sin(D-A)-34711*Math.sin(D-M)-9792*Math.sin(A)+9385*Math.sin(O-L)+7505*Math.sin(O-M)+5318*Math.sin(D+A)+3484*Math.sin(O-g)-3417*Math.sin(D-S-A)-2530*Math.sin(R-g)-2376*Math.sin(D)-2075*Math.sin(D-L)-1883*Math.sin(M)-1736*Math.sin(R-5*A)+1626*Math.sin(S)-1370*Math.sin(R-L),m+=-5392*Math.sin(D-E)-540*Math.sin(S)-441*Math.sin(D)+423*Math.sin(E)-288*Math.sin(M-E),b+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-A)-662.5*Math.sin(S)+396.3*Math.sin(A)-218*Math.sin(D-S);let w=2*v,I=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(D-E+v)*i+.614*Math.cos(D-E-v)*i-.0297*Math.cos(w)*o-.0335*Math.cos(v)*o+.0012*Math.cos(D-E+w)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(w)*r;let N=2.116*Math.sin(v)*i-.111*Math.sin(D-E-v)*i-.0015*Math.sin(v)*o;p+=N,b+=N,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(D-E+v)*i+1.12*Math.sin(D-v)*i-1.06*Math.sin(E-v)*i+.66*Math.sin(w)*o+.371*Math.sin(v)*o-.035*Math.sin(D-E+w)*o-.015*Math.sin(D-E+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(w)*r,a*=lIe;let B=u+f*ql,H=h+p*ql,V=x+b*ql,G=_+m*ql;return aee(a,c,B,H,G,V,t)}var ree=.012300034,JIe=ree/(ree+1)*-1;function ePe(e,t){return t=cee(e,t),d.multiplyByScalar(t,JIe,t)}var lee=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),ZS=new d;l6.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Z.now()),l(t)||(t=new d),ZS=QIe(e,ZS),t=d.negate(ZS,t),ePe(e,ZS),d.subtract(t,ZS,t),$.multiplyByVector(lee,t,t),t};l6.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Z.now()),t=cee(e,t),$.multiplyByVector(lee,t,t),t};var F0=l6;var FM={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};FM.getMorphTime=function(e){return e===FM.SCENE3D?1:e===FM.MORPHING?void 0:0};var ne=Object.freeze(FM);function tPe(e){e=y(e,y.EMPTY_OBJECT),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,2)}var Hg=tPe;function ET(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new qe,this._viewportCartesian4=new oe,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new U,this._currentFrustum=new U,this._frustumPlanes=new oe,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Hn,this._cameraPosition=new d,this._sunPositionWC=new d,this._sunPositionColumbusView=new d,this._sunDirectionWC=new d,this._sunDirectionEC=new d,this._moonDirectionEC=new d,this._lightDirectionWC=new d,this._lightDirectionEC=new d,this._lightColor=new d,this._lightColorHdr=new d,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new d,this._cameraRight=new d,this._cameraUp=new d,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new U,this._eyeEllipsoidNormalEC=new d,this._eyeEllipsoidCurvature=new U,this._modelToEnu=new F,this._enuToModel=new F,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new d,this._atmosphereRayleighScaleHeight=new d,this._atmosphereMieCoefficient=new d,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(ET.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!qe.equals(e,this._viewport)){qe.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return fee(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return fee(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return f6(this),this._view3D}},viewRotation:{get:function(){return f6(this),this._viewRotation}},viewRotation3D:{get:function(){return f6(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return mee(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return mee(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return dPe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return hPe(this),this._modelView}},modelView3D:{get:function(){return mPe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return bPe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return pPe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return gPe(this),this._inverseModelView3D}},viewProjection:{get:function(){return _Pe(this),this._viewProjection}},inverseViewProjection:{get:function(){return yPe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return xPe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return TPe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return CPe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return APe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return EPe(this),this._normal}},normal3D:{get:function(){return SPe(this),this._normal3D}},inverseNormal:{get:function(){return vPe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return wPe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return hee(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return hee(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,ee.default)}}});function nPe(e,t){F.clone(t,e._view),F.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function iPe(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function oPe(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function rPe(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var uee=new d,sPe=new F;function aPe(e,t){d.clone(t.positionWC,e._cameraPosition),d.clone(t.directionWC,e._cameraDirection),d.clone(t.rightWC,e._cameraRight),d.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=d.fromRadians(o.longitude,o.latitude,0,n,uee)):(e._eyeHeight=-n.maximumRadius,d.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=d.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,uee)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Mt.eastNorthUpToFixedFrame(i,n,sPe);e._enuToModel=F.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=F.inverseTransformation(e._enuToModel,e._modelToEnu),P.equalsEpsilon(n._radii.x,n._radii.y,P.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var u6=new $,cPe=new fe;function lPe(e,t){Mt.computeIcrfToCentralBodyFixedMatrix(t.time,u6);let n=F0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(u6,n,n),d.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),d.normalize(n,n),n=F0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(u6,n,n),$.multiplyByVector(e.viewRotation3D,n,n),d.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,cPe);i.project(r,e._sunPositionColumbusView)}ET.prototype.updateCamera=function(e){nPe(this,e.viewMatrix),iPe(this,e.inverseViewMatrix),aPe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof rn};ET.prototype.updateFrustum=function(e){oPe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&rPe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};ET.prototype.updatePass=function(e){this._pass=e};var uPe=[],fPe=new Hg;ET.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ne.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),lPe(this,e);let n=y(e.light,fPe);n instanceof Hg?(this._lightDirectionWC=d.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=d.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=d.normalize(d.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=d.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=d.multiplyByScalar(o,n.intensity,o);let r=d.maximumComponent(o);r>1?d.divideByScalar(o,r,this._lightColor):d.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,uPe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=d.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=d.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=d.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Mt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,h;l(u)?f.height>f.width?h=Math.tan(.5*u)*2/f.height:h=Math.tan(.5*u)*2/f.width:h=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function fee(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function dPe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function hPe(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function mPe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function pPe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function gPe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function _Pe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function yPe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function xPe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function bPe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function TPe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function CPe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function APe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function EPe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function SPe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function vPe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;F.getMatrix3(e.modelView,t),$.transpose(t,t)}}function wPe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;F.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var dee=new d;function hee(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,dee),Hn.fromCartesian(dee,e._encodedCameraPositionMC))}var DPe=new d,IPe=new d,PPe=new d,RPe=new d,OPe=new fe,MPe=new d,LPe=new F;function NPe(e,t,n,i,o,r,s,a){let c=DPe;c.x=e.y,c.y=e.z,c.z=e.x;let u=IPe;u.x=n.y,u.y=n.z,u.z=n.x;let f=PPe;f.x=i.y,f.y=i.z,f.z=i.x;let h=RPe;h.x=t.y,h.y=t.z,h.z=t.x,r===ne.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,OPe);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let _=s.ellipsoid,m=_.cartographicToCartesian(p,MPe),x=Mt.eastNorthUpToFixedFrame(m,_,LPe);return F.multiplyByPointAsVector(x,u,u),F.multiplyByPointAsVector(x,f,f),F.multiplyByPointAsVector(x,h,h),l(a)||(a=new F),a[0]=u.x,a[1]=f.x,a[2]=-h.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-h.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-h.z,a[11]=0,a[12]=-d.dot(u,m),a[13]=-d.dot(f,m),a[14]=d.dot(h,m),a[15]=1,a}function f6(e){e._view3DDirty&&(e._mode===ne.SCENE3D?F.clone(e._view,e._view3D):NPe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function mee(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var BM=ET;function Yl(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):FPe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=zn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new OM(this),this._textureCache=new LM;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Bt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Bt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Bt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Bt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Bt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Bt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Bt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Bt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Bt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Bt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Bt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Bt._minimumAliasedLineWidth=f[0],Bt._maximumAliasedLineWidth=f[1];let h=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Bt._minimumAliasedPointSize=h[0],Bt._maximumAliasedPointSize=h[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Bt._maximumViewportWidth=p[0],Bt._maximumViewportHeight=p[1];let _=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Bt._highpFloatSupported=_.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Bt._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!dr(u,["OES_standard_derivatives"]),this._blendMinmax=!!dr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!dr(u,["OES_element_index_uint"]),this._depthTexture=!!dr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!dr(u,["EXT_frag_depth"]),this._debugShaders=dr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!dr(u,["OES_texture_float"]),this._textureHalfFloat=!!dr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!dr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!dr(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!dr(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!dr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!dr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!dr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!dr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!dr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!dr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!dr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!dr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!dr(u,["EXT_texture_compression_bptc"]),Wl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?dr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Bt._maximumTextureFilterAnisotropy=l(x)?u.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,T,C,A,S,v,D,O,R,M;if(c){let w=this;b=function(){return w._gl.createVertexArray()},T=function(I){w._gl.bindVertexArray(I)},C=function(I){w._gl.deleteVertexArray(I)},A=function(I,N,B,H,V){u.drawElementsInstanced(I,N,B,H,V)},S=function(I,N,B,H){u.drawArraysInstanced(I,N,B,H)},v=function(I,N){u.vertexAttribDivisor(I,N)},D=function(I){u.drawBuffers(I)}}else O=dr(u,["OES_vertex_array_object"]),l(O)&&(b=function(){return O.createVertexArrayOES()},T=function(w){O.bindVertexArrayOES(w)},C=function(w){O.deleteVertexArrayOES(w)}),R=dr(u,["ANGLE_instanced_arrays"]),l(R)&&(A=function(w,I,N,B,H){R.drawElementsInstancedANGLE(w,I,N,B,H)},S=function(w,I,N,B){R.drawArraysInstancedANGLE(w,I,N,B)},v=function(w,I){R.vertexAttribDivisorANGLE(w,I)}),M=dr(u,["WEBGL_draw_buffers"]),l(M)&&(D=function(w){M.drawBuffersWEBGL(w)});this.glCreateVertexArray=b,this.glBindVertexArray=T,this.glDeleteVertexArray=C,this.glDrawElementsInstanced=A,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=v,this.glDrawBuffers=D,this._vertexArrayObject=!!O,this._instancedArrays=!!R,this._drawBuffers=!!M,Bt._maximumDrawBuffers=this.drawBuffers?u.getParameter(te.MAX_DRAW_BUFFERS):1,Bt._maximumColorAttachments=this.drawBuffers?u.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let L=new BM,g=new Cc(this),E=Ve.fromCache();this._defaultPassState=g,this._defaultRenderState=E,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=L,this._currentRenderState=E,this._currentPassState=g,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let w=0;w<Bt._maximumVertexAttributes;w++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ve.apply(u,E,g)}function FPe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new re("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new re("The browser supports WebGL, but initialization failed.");return r}function BPe(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function kPe(e,t,n,i){let o=`${BPe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function VPe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new re(kPe(e,t,n,i))}function UPe(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function zPe(e,t){if(!l(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,UPe(e,o,t))}return i}function dr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var HPe={};Object.defineProperties(Yl.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=zPe(this._originalGLContext,e?VPe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Ot({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Ot({context:this,pixelFormat:tt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Ot({context:this,pixelFormat:tt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new wr({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return HPe}}});function pee(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,o,t,r,n,i)}var d6;typeof WebGLRenderingContext<"u"&&(d6=[te.BACK]);function h6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=d6;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var GPe=new ei;Yl.prototype.clear=function(e,t){e=y(e,GPe),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(z.equals(this._clearColor,o)||(z.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);pee(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);h6(this,c),n.clear(i)};function WPe(e,t,n,i,o){h6(e,t),pee(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function jPe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,F.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}Yl.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),WPe(this,o,t,n,r),jPe(this,e,n,i)};Yl.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=d6;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};Yl.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),o=y(e.width,t.drawingBufferWidth),r=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=Ke.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=tt.createTypedArray(tt.RGBA,a,o,r);return h6(this,s),t.readPixels(n,i,o,r,tt.RGBA,Ke.toWebGLConstant(a,this),c),c};var gee={position:0,textureCoordinates:1};Yl.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new at({attributes:{position:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Me.TRIANGLES});e=ti.fromGeometry({context:this,geometry:t,attributeLocations:gee,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Yl.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new $e({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Me.TRIANGLES,renderState:t.renderState,shaderProgram:en.fromCache({context:this,vertexShaderSource:mT,fragmentShaderSource:e,attributeLocations:gee}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Yl.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function m6(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(m6.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});m6.prototype.destroy=function(){delete this._pickObjects[this.key]};Yl.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new re("Out of unique Pick IDs.");return this._pickObjects[t]=e,new m6(this._pickObjects,t,z.fromRgba(t))};Yl.prototype.isDestroyed=function(){return!1};Yl.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};Yl._deprecationWarning=_s;var kM=Yl;function ST(e){e=y(e,y.EMPTY_OBJECT);let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new he("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new he("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new zr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new zr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}ST.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};ST.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};ST.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};ST.prototype.isDestroyed=function(){return!1};ST.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var VM=ST;var fl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===fl.RGBA4||e===fl.RGBA8||e===fl.RGBA16F||e===fl.RGBA32F||e===fl.RGB5_A1||e===fl.RGB565||e===fl.DEPTH_COMPONENT16||e===fl.STENCIL_INDEX8||e===fl.DEPTH_STENCIL||e===fl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?fl.RGBA32F:e===te.HALF_FLOAT_OES?fl.RGBA16F:fl.RGBA8}},dl=Object.freeze(fl);function $S(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Bt.maximumRenderbufferSize,o=y(e.format,dl.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties($S.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});$S.prototype._getRenderbuffer=function(){return this._renderbuffer};$S.prototype.isDestroyed=function(){return!1};$S.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Qu=$S;function xs(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(xs.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});xs.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};xs.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,Ke.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,tt.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Ot({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:$t.NEAREST}),this._numSamples>1){let a=dl.getColorFormat(o);this._colorRenderbuffers[s]=new Qu({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Ot({context:e,width:t,height:n,pixelFormat:tt.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:$t.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Qu({context:e,width:t,height:n,format:dl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Qu({context:e,width:t,height:n,format:dl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Ot({context:e,width:t,height:n,pixelFormat:tt.DEPTH_COMPONENT,pixelDatatype:Ke.UNSIGNED_INT,sampler:$t.NEAREST}):this._depthRenderbuffer=new Qu({context:e,width:t,height:n,format:dl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new VM({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new zr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};xs.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};xs.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};xs.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};xs.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};xs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};xs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};xs.prototype.getDepthTexture=function(){return this._depthTexture};xs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};xs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};xs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};xs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};xs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};xs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};xs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};xs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};xs.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&l(o)&&!o.isDestroyed()&&o.destroy(),l(o)&&o.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var hi=xs;var B0={VERTEX:0,FRAGMENT:1,BOTH:2};B0.includesVertexShader=function(e){return e===B0.VERTEX||e===B0.BOTH};B0.includesFragmentShader=function(e){return e===B0.FRAGMENT||e===B0.BOTH};var pe=Object.freeze(B0);function p6(e){this.name=e,this.fields=[]}p6.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};p6.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var UM=p6;function g6(e){this.signature=e,this.body=[]}g6.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};g6.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var zM=g6;function Ac(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Ac.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Ac.prototype.addDefine=function(e,t,n){n=y(n,pe.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),pe.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),pe.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Ac.prototype.addStruct=function(e,t,n){this._structs[e]=new UM(t),pe.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),pe.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Ac.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Ac.prototype.addFunction=function(e,t,n){this._functions[e]=new zM(t),pe.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),pe.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Ac.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Ac.prototype.addUniform=function(e,t,n){n=y(n,pe.BOTH);let i=`uniform ${e} ${t};`;pe.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),pe.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Ac.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Ac.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=YPe(e),i};Ac.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Ac.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Ac.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Ac.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=qPe(this),i=XPe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` +${i}`};function ZDe(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function LJ(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function NJ(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(LJ(e,o))return o}}var $De=["v_normalEC","v_normal"];Os.findNormalVarying=function(e){return LJ(e,"#ifdef HAS_NORMALS")?ZDe(e,"HAS_NORMALS")?"v_normalEC":void 0:NJ(e,$De)};var QDe=["v_positionEC"];Os.findPositionVarying=function(e){return NJ(e,QDe)};var Ue=Os;function hd(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(hd.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});hd.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function JDe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}hd.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Ue({sources:[t]})),typeof n=="string"&&(n=new Ue({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?JDe(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),h=n.createCombinedFragmentShader(u),p=new Qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};hd.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){l6(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};hd.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};hd.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Ue({sources:[r]})),typeof s=="string"&&(s=new Ue({sources:[s]}));let c=this._context,u=r.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),h=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function l6(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];l6(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}hd.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l6(this,n),--this._numberOfShaders}this._shadersToRelease={}};hd.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};hd.prototype.isDestroyed=function(){return!1};hd.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var FM=hd;function md(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=tt.RGBA,pixelDatatype:o=Ke.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Zt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===tt.RGB||i===tt.LUMINANCE,h=tt.toInternalFormat(i,o,t),p=tt.isCompressedFormat(h),_=t._gl,m=p?tt.compressedTextureSizeInBytes(i,c,u):tt.textureSizeInBytes(i,o,c,u);this._id=e.id??zn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=_.TEXTURE_2D,this._texture=_.createTexture(),this._internalFormat=h,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._dimensions=new U(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,VJ(this,a),_.activeTexture(_.TEXTURE0),_.bindTexture(this._textureTarget,this._texture),l(n)?(s?_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.NONE):_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?tt.isCompressedFormat(h)?eIe(this,n):FJ(this,n):l(n.framebuffer)?nIe(this,n):BJ(this,n),this._initialized=!0):kJ(this),_.bindTexture(this._textureTarget,null)}function eIe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=BM(c),u=BM(u),i.compressedTexImage2D(o,f+1,r,c,u,0,t.mipLevels[f])}}function FJ(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,h=tt.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,h),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=tt.flipY(p,c,u,s,a)),i.texImage2D(o,0,r,s,a,0,c,Ke.toWebGLConstant(u,n),p),l(t.mipLevels)){let _=s,m=a;for(let x=0;x<t.mipLevels.length;++x)_=BM(_),m=BM(m),i.texImage2D(o,x+1,r,_,m,0,c,Ke.toWebGLConstant(u,n),t.mipLevels[x])}}function tIe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=tt.alignmentInBytes(c,u,o);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=tt.flipY(t,c,u,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,c,Ke.toWebGLConstant(u,s),t)}function nIe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function BJ(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,Ke.toWebGLConstant(e.pixelDatatype,n),t)}function iIe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,Ke.toWebGLConstant(e.pixelDatatype,o),t)}function BM(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function kJ(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Ke.toWebGLConstant(e._pixelDatatype,t),null)}md.create=function(e){return new md(e)};md.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,{pixelFormat:i=tt.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:c}=e;return new md({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(md.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){VJ(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function VJ(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Kt.NEAREST_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ke.FLOAT&&!r.textureFloatLinear||a===Ke.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Kt.NEAREST_MIPMAP_NEAREST:Kt.NEAREST,i=hi.NEAREST),r.webgl2&&tt.isDepthFormat(s)&&(n=Kt.NEAREST,i=hi.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}md.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?FJ(this,i):BJ(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),kJ(this)),this._initialized=!0),f||(l(i.arrayBufferView)?tIe(this,i.arrayBufferView,t,n,c,u):iIe(this,i,t,n)),s.bindTexture(a,null)};md.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._width),r=y(r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};md.prototype.generateMipmap=function(e){e=y(e,ap.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};md.prototype.isDestroyed=function(){return!1};md.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var Rt=md;function N0(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(N0.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});N0.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};N0.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};N0.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};N0.prototype.isDestroyed=function(){return!1};N0.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var kM=N0;function $u(e){this.planes=y(e,[])}var QS=[new d,new d,new d];d.clone(d.UNIT_X,QS[0]);d.clone(d.UNIT_Y,QS[1]);d.clone(d.UNIT_Z,QS[2]);var zg=new d,oIe=new d,UJ=new sn(new d(1,0,0),0);$u.fromBoundingSphere=function(e,t){l(t)||(t=new $u);let n=QS.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=QS[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new oe),l(f)||(f=i[s+1]=new oe),d.multiplyByScalar(c,-r,zg),d.add(o,zg,zg),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-d.dot(c,zg),d.multiplyByScalar(c,r,zg),d.add(o,zg,zg),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-d.dot(d.negate(c,oIe),zg),s+=2}return t};$u.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(sn.fromCartesian4(t[i],UJ));if(r===Wt.OUTSIDE)return Wt.OUTSIDE;r===Wt.INTERSECTING&&(n=!0)}return n?Wt.INTERSECTING:Wt.INSIDE};$u.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===$u.MASK_OUTSIDE||t===$u.MASK_INSIDE)return t;let n=$u.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&!(t&s))continue;let a=e.intersectPlane(sn.fromCartesian4(i[o],UJ));if(a===Wt.OUTSIDE)return $u.MASK_OUTSIDE;a===Wt.INTERSECTING&&(n|=s)}return n};$u.MASK_OUTSIDE=4294967295;$u.MASK_INSIDE=0;$u.MASK_INDETERMINATE=2147483647;var ys=$u;function Ih(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new ys,this._orthographicMatrix=new F}function zJ(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Ih.prototype,{projectionMatrix:{get:function(){return zJ(this),this._orthographicMatrix}}});var rIe=new d,sIe=new d,aIe=new d,u6=new d;Ih.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=d.cross(t,n,rIe);d.normalize(f,f);let h=sIe;d.multiplyByScalar(t,c,h),d.add(e,h,h);let p=aIe;d.multiplyByScalar(f,a,p),d.add(h,p,p);let _=i[0];return l(_)||(_=i[0]=new oe),_.x=f.x,_.y=f.y,_.z=f.z,_.w=-d.dot(f,p),d.multiplyByScalar(f,s,p),d.add(h,p,p),_=i[1],l(_)||(_=i[1]=new oe),_.x=-f.x,_.y=-f.y,_.z=-f.z,_.w=-d.dot(d.negate(f,u6),p),d.multiplyByScalar(n,r,p),d.add(h,p,p),_=i[2],l(_)||(_=i[2]=new oe),_.x=n.x,_.y=n.y,_.z=n.z,_.w=-d.dot(n,p),d.multiplyByScalar(n,o,p),d.add(h,p,p),_=i[3],l(_)||(_=i[3]=new oe),_.x=-n.x,_.y=-n.y,_.z=-n.z,_.w=-d.dot(d.negate(n,u6),p),_=i[4],l(_)||(_=i[4]=new oe),_.x=t.x,_.y=t.y,_.z=t.z,_.w=-d.dot(t,h),d.multiplyByScalar(t,u,p),d.add(e,p,p),_=i[5],l(_)||(_=i[5]=new oe),_.x=-t.x,_.y=-t.y,_.z=-t.z,_.w=-d.dot(d.negate(t,u6),p),this._cullingVolume};Ih.prototype.getPixelDimensions=function(e,t,n,i,o){zJ(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};Ih.prototype.clone=function(e){return l(e)||(e=new Ih),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Ih.prototype.equals=function(e){return l(e)&&e instanceof Ih&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Ih.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Ih&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Hr=Ih;function fl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Hr,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}fl.packedLength=4;fl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};fl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new fl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Hg(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(fl.prototype,{projectionMatrix:{get:function(){return Hg(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Hg(this),this._offCenterFrustum}}});fl.prototype.computeCullingVolume=function(e,t,n){return Hg(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};fl.prototype.getPixelDimensions=function(e,t,n,i,o){return Hg(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};fl.prototype.clone=function(e){return l(e)||(e=new fl),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};fl.prototype.equals=function(e){return!l(e)||!(e instanceof fl)?!1:(Hg(this),Hg(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};fl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof fl)?!1:(Hg(this),Hg(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var nn=fl;var f6={};function cIe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var lIe=32.184,uIe=2451545;function see(e,t){t=Z.addSeconds(e,lIe,t);let n=Z.totalDays(t)-uIe;return t=Z.addSeconds(t,cIe(n),t),t}var VM=new Z(2451545,0,jn.TAI),fIe=1e3,Qu=P.RADIANS_PER_DEGREE,Xl=P.RADIANS_PER_ARCSECOND,Ta=14959787e4,HJ=new $;function aee(e,t,n,i,o,r,s){n<0&&(n=-n,o+=P.PI);let a=e*(1-t),c=i-o,u=o,f=hIe(r-i,t),h=dIe(t,0);yIe(c,n,u,HJ);let p=a*(1+t),_=Math.cos(f),m=Math.sin(f),x=1+t*_,b=p/x;return l(s)?(s.x=b*_,s.y=b*m,s.z=0):s=new d(b*_,b*m,0),$.multiplyByVector(HJ,s,s)}function dIe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function hIe(e,t){let n=gIe(e,t);return _Ie(n,t)}var mIe=50,pIe=P.EPSILON8;function gIe(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<mIe&&Math.abs(o-i)>pIe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*P.TWO_PI,o}function _Ie(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=P.zeroToTwoPi(r),e<0&&(r-=P.TWO_PI),r+=n*P.TWO_PI,r}function yIe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*s,i[1]=u*o+c*r*s,i[2]=r*a,i[3]=-c*r-u*o*s,i[4]=-u*r+c*o*s,i[5]=o*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*o-u*r*s,-c*r-u*o*s,u*a,u*o+c*r*s,-u*r+c*o*s,-c*a,r*a,o*a,s),i}var xIe=1.0000010178*Ta,bIe=100.46645683*Qu,TIe=129597742283429e-5*Xl,GJ=16002,WJ=21863,jJ=32004,qJ=10931,YJ=14529,XJ=16368,KJ=15318,ZJ=32794,CIe=64*1e-7*Ta,AIe=-152*1e-7*Ta,EIe=62*1e-7*Ta,SIe=-8*1e-7*Ta,vIe=32*1e-7*Ta,wIe=-41*1e-7*Ta,DIe=19*1e-7*Ta,IIe=-11*1e-7*Ta,PIe=-150*1e-7*Ta,RIe=-46*1e-7*Ta,OIe=68*1e-7*Ta,MIe=54*1e-7*Ta,LIe=14*1e-7*Ta,NIe=24*1e-7*Ta,FIe=-28*1e-7*Ta,BIe=22*1e-7*Ta,$J=10,QJ=16002,JJ=21863,eee=10931,tee=1473,nee=32004,iee=4387,oee=73,kIe=-325*1e-7,VIe=-322*1e-7,UIe=-79*1e-7,zIe=232*1e-7,HIe=-52*1e-7,GIe=97*1e-7,WIe=55*1e-7,jIe=-41*1e-7,qIe=-105*1e-7,YIe=-137*1e-7,XIe=258*1e-7,KIe=35*1e-7,ZIe=-116*1e-7,$Ie=-88*1e-7,QIe=-112*1e-7,JIe=-80*1e-7,AT=new Z(0,0,jn.TAI);function ePe(e,t){see(e,AT);let i=(AT.dayNumber-VM.dayNumber+(AT.secondsOfDay-VM.secondsOfDay)/qn.SECONDS_PER_DAY)/(qn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=xIe+CIe*Math.cos(GJ*o)+PIe*Math.sin(GJ*o)+AIe*Math.cos(WJ*o)+RIe*Math.sin(WJ*o)+EIe*Math.cos(jJ*o)+OIe*Math.sin(jJ*o)+SIe*Math.cos(qJ*o)+MIe*Math.sin(qJ*o)+vIe*Math.cos(YJ*o)+LIe*Math.sin(YJ*o)+wIe*Math.cos(XJ*o)+NIe*Math.sin(XJ*o)+DIe*Math.cos(KJ*o)+FIe*Math.sin(KJ*o)+IIe*Math.cos(ZJ*o)+BIe*Math.sin(ZJ*o),s=bIe+TIe*i+kIe*Math.cos($J*o)+qIe*Math.sin($J*o)+VIe*Math.cos(QJ*o)+YIe*Math.sin(QJ*o)+UIe*Math.cos(JJ*o)+XIe*Math.sin(JJ*o)+zIe*Math.cos(eee*o)+KIe*Math.sin(eee*o)+HIe*Math.cos(tee*o)+ZIe*Math.sin(tee*o)+GIe*Math.cos(nee*o)+$Ie*Math.sin(nee*o)+WIe*Math.cos(iee*o)+QIe*Math.sin(iee*o)+jIe*Math.cos(oee*o)+JIe*Math.sin(oee*o),a=.0167086342-.0004203654*i,c=102.93734808*Qu+11612.3529*Xl*i,u=469.97289*Xl*i,f=174.87317577*Qu-8679.27034*Xl*i;return aee(r,a,u,c,f,s,t)}function cee(e,t){see(e,AT);let i=(AT.dayNumber-VM.dayNumber+(AT.secondsOfDay-VM.secondsOfDay)/qn.SECONDS_PER_DAY)/qn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Qu,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*Qu,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,_=125.04455501*Qu,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*Qu,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,T=297.85019547*Qu+Xl*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),C=93.27209062*Qu+Xl*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),A=134.96340251*Qu+Xl*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),S=357.52910918*Qu+Xl*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*Qu-Xl*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),D=2*T,O=4*T,R=6*T,M=2*A,L=3*A,g=4*A,E=2*C;a+=3400.4*Math.cos(D)-635.6*Math.cos(D-A)-235.6*Math.cos(A)+218.1*Math.cos(D-S)+181*Math.cos(D+A),c+=.014216*Math.cos(D-A)+.008551*Math.cos(D-M)-.001383*Math.cos(A)+.001356*Math.cos(D+A)-.001147*Math.cos(O-L)-914e-6*Math.cos(O-M)+869e-6*Math.cos(D-S-A)-627e-6*Math.cos(D)-394e-6*Math.cos(O-g)+282e-6*Math.cos(D-S-M)-279e-6*Math.cos(T-A)-236e-6*Math.cos(M)+231e-6*Math.cos(O)+229e-6*Math.cos(R-g)-201e-6*Math.cos(M-E),f+=486.26*Math.cos(D-E)-40.13*Math.cos(D)+37.51*Math.cos(E)+25.73*Math.cos(M-E)+19.97*Math.cos(D-S-E),p+=-55609*Math.sin(D-A)-34711*Math.sin(D-M)-9792*Math.sin(A)+9385*Math.sin(O-L)+7505*Math.sin(O-M)+5318*Math.sin(D+A)+3484*Math.sin(O-g)-3417*Math.sin(D-S-A)-2530*Math.sin(R-g)-2376*Math.sin(D)-2075*Math.sin(D-L)-1883*Math.sin(M)-1736*Math.sin(R-5*A)+1626*Math.sin(S)-1370*Math.sin(R-L),m+=-5392*Math.sin(D-E)-540*Math.sin(S)-441*Math.sin(D)+423*Math.sin(E)-288*Math.sin(M-E),b+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-A)-662.5*Math.sin(S)+396.3*Math.sin(A)-218*Math.sin(D-S);let w=2*v,I=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(D-E+v)*i+.614*Math.cos(D-E-v)*i-.0297*Math.cos(w)*o-.0335*Math.cos(v)*o+.0012*Math.cos(D-E+w)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(w)*r;let N=2.116*Math.sin(v)*i-.111*Math.sin(D-E-v)*i-.0015*Math.sin(v)*o;p+=N,b+=N,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(D-E+v)*i+1.12*Math.sin(D-v)*i-1.06*Math.sin(E-v)*i+.66*Math.sin(w)*o+.371*Math.sin(v)*o-.035*Math.sin(D-E+w)*o-.015*Math.sin(D-E+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(w)*r,a*=fIe;let B=u+f*Xl,H=h+p*Xl,V=x+b*Xl,G=_+m*Xl;return aee(a,c,B,H,G,V,t)}var ree=.012300034,tPe=ree/(ree+1)*-1;function nPe(e,t){return t=cee(e,t),d.multiplyByScalar(t,tPe,t)}var lee=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),JS=new d;f6.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Z.now()),l(t)||(t=new d),JS=ePe(e,JS),t=d.negate(JS,t),nPe(e,JS),d.subtract(t,JS,t),$.multiplyByVector(lee,t,t),t};f6.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Z.now()),t=cee(e,t),$.multiplyByVector(lee,t,t),t};var F0=f6;var UM={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};UM.getMorphTime=function(e){return e===UM.SCENE3D?1:e===UM.MORPHING?void 0:0};var ne=Object.freeze(UM);function iPe(e){e=y(e,y.EMPTY_OBJECT),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,2)}var Gg=iPe;function ET(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new qe,this._viewportCartesian4=new oe,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new U,this._currentFrustum=new U,this._frustumPlanes=new oe,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Hn,this._cameraPosition=new d,this._sunPositionWC=new d,this._sunPositionColumbusView=new d,this._sunDirectionWC=new d,this._sunDirectionEC=new d,this._moonDirectionEC=new d,this._lightDirectionWC=new d,this._lightDirectionEC=new d,this._lightColor=new d,this._lightColorHdr=new d,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new d,this._cameraRight=new d,this._cameraUp=new d,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new U,this._eyeEllipsoidNormalEC=new d,this._eyeEllipsoidCurvature=new U,this._modelToEnu=new F,this._enuToModel=new F,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new d,this._atmosphereRayleighScaleHeight=new d,this._atmosphereMieCoefficient=new d,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(ET.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!qe.equals(e,this._viewport)){qe.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return fee(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return fee(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return h6(this),this._view3D}},viewRotation:{get:function(){return h6(this),this._viewRotation}},viewRotation3D:{get:function(){return h6(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return mee(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return mee(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return mPe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return pPe(this),this._modelView}},modelView3D:{get:function(){return gPe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return CPe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return _Pe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return yPe(this),this._inverseModelView3D}},viewProjection:{get:function(){return xPe(this),this._viewProjection}},inverseViewProjection:{get:function(){return bPe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return TPe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return APe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return EPe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return SPe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return vPe(this),this._normal}},normal3D:{get:function(){return wPe(this),this._normal3D}},inverseNormal:{get:function(){return DPe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return IPe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return hee(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return hee(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,ee.default)}}});function oPe(e,t){F.clone(t,e._view),F.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function rPe(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function sPe(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function aPe(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var uee=new d,cPe=new F;function lPe(e,t){d.clone(t.positionWC,e._cameraPosition),d.clone(t.directionWC,e._cameraDirection),d.clone(t.rightWC,e._cameraRight),d.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=d.fromRadians(o.longitude,o.latitude,0,n,uee)):(e._eyeHeight=-n.maximumRadius,d.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=d.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,uee)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Ot.eastNorthUpToFixedFrame(i,n,cPe);e._enuToModel=F.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=F.inverseTransformation(e._enuToModel,e._modelToEnu),P.equalsEpsilon(n._radii.x,n._radii.y,P.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var d6=new $,uPe=new fe;function fPe(e,t){Ot.computeIcrfToCentralBodyFixedMatrix(t.time,d6);let n=F0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(d6,n,n),d.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),d.normalize(n,n),n=F0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(d6,n,n),$.multiplyByVector(e.viewRotation3D,n,n),d.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,uPe);i.project(r,e._sunPositionColumbusView)}ET.prototype.updateCamera=function(e){oPe(this,e.viewMatrix),rPe(this,e.inverseViewMatrix),lPe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ne.SCENE2D&&e.frustum instanceof nn};ET.prototype.updateFrustum=function(e){sPe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&aPe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};ET.prototype.updatePass=function(e){this._pass=e};var dPe=[],hPe=new Gg;ET.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ne.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),fPe(this,e);let n=y(e.light,hPe);n instanceof Gg?(this._lightDirectionWC=d.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=d.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=d.normalize(d.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=d.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=d.multiplyByScalar(o,n.intensity,o);let r=d.maximumComponent(o);r>1?d.divideByScalar(o,r,this._lightColor):d.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,dPe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=d.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=d.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=d.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Ot.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,h;l(u)?f.height>f.width?h=Math.tan(.5*u)*2/f.height:h=Math.tan(.5*u)*2/f.width:h=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function fee(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function mPe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ne.SCENE2D&&e._mode!==ne.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function pPe(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function gPe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function _Pe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function yPe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function xPe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function bPe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function TPe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function CPe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function APe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function EPe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function SPe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function vPe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function wPe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function DPe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;F.getMatrix3(e.modelView,t),$.transpose(t,t)}}function IPe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;F.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var dee=new d;function hee(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,dee),Hn.fromCartesian(dee,e._encodedCameraPositionMC))}var PPe=new d,RPe=new d,OPe=new d,MPe=new d,LPe=new fe,NPe=new d,FPe=new F;function BPe(e,t,n,i,o,r,s,a){let c=PPe;c.x=e.y,c.y=e.z,c.z=e.x;let u=RPe;u.x=n.y,u.y=n.z,u.z=n.x;let f=OPe;f.x=i.y,f.y=i.z,f.z=i.x;let h=MPe;h.x=t.y,h.y=t.z,h.z=t.x,r===ne.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,LPe);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let _=s.ellipsoid,m=_.cartographicToCartesian(p,NPe),x=Ot.eastNorthUpToFixedFrame(m,_,FPe);return F.multiplyByPointAsVector(x,u,u),F.multiplyByPointAsVector(x,f,f),F.multiplyByPointAsVector(x,h,h),l(a)||(a=new F),a[0]=u.x,a[1]=f.x,a[2]=-h.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-h.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-h.z,a[11]=0,a[12]=-d.dot(u,m),a[13]=-d.dot(f,m),a[14]=d.dot(h,m),a[15]=1,a}function h6(e){e._view3DDirty&&(e._mode===ne.SCENE3D?F.clone(e._view,e._view3D):BPe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function mee(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var zM=ET;function Kl(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):kPe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=zn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new FM(this),this._textureCache=new kM;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),Ft._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Ft._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Ft._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Ft._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Ft._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Ft._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Ft._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Ft._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Ft._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ft._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Ft._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Ft._minimumAliasedLineWidth=f[0],Ft._maximumAliasedLineWidth=f[1];let h=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Ft._minimumAliasedPointSize=h[0],Ft._maximumAliasedPointSize=h[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Ft._maximumViewportWidth=p[0],Ft._maximumViewportHeight=p[1];let _=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Ft._highpFloatSupported=_.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Ft._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!dr(u,["OES_standard_derivatives"]),this._blendMinmax=!!dr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!dr(u,["OES_element_index_uint"]),this._depthTexture=!!dr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!dr(u,["EXT_frag_depth"]),this._debugShaders=dr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!dr(u,["OES_texture_float"]),this._textureHalfFloat=!!dr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!dr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!dr(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!dr(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!dr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!dr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!dr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!dr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!dr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!dr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!dr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!dr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!dr(u,["EXT_texture_compression_bptc"]),ql.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?dr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Ft._maximumTextureFilterAnisotropy=l(x)?u.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,T,C,A,S,v,D,O,R,M;if(c){let w=this;b=function(){return w._gl.createVertexArray()},T=function(I){w._gl.bindVertexArray(I)},C=function(I){w._gl.deleteVertexArray(I)},A=function(I,N,B,H,V){u.drawElementsInstanced(I,N,B,H,V)},S=function(I,N,B,H){u.drawArraysInstanced(I,N,B,H)},v=function(I,N){u.vertexAttribDivisor(I,N)},D=function(I){u.drawBuffers(I)}}else O=dr(u,["OES_vertex_array_object"]),l(O)&&(b=function(){return O.createVertexArrayOES()},T=function(w){O.bindVertexArrayOES(w)},C=function(w){O.deleteVertexArrayOES(w)}),R=dr(u,["ANGLE_instanced_arrays"]),l(R)&&(A=function(w,I,N,B,H){R.drawElementsInstancedANGLE(w,I,N,B,H)},S=function(w,I,N,B){R.drawArraysInstancedANGLE(w,I,N,B)},v=function(w,I){R.vertexAttribDivisorANGLE(w,I)}),M=dr(u,["WEBGL_draw_buffers"]),l(M)&&(D=function(w){M.drawBuffersWEBGL(w)});this.glCreateVertexArray=b,this.glBindVertexArray=T,this.glDeleteVertexArray=C,this.glDrawElementsInstanced=A,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=v,this.glDrawBuffers=D,this._vertexArrayObject=!!O,this._instancedArrays=!!R,this._drawBuffers=!!M,Ft._maximumDrawBuffers=this.drawBuffers?u.getParameter(te.MAX_DRAW_BUFFERS):1,Ft._maximumColorAttachments=this.drawBuffers?u.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let L=new zM,g=new Ac(this),E=Ve.fromCache();this._defaultPassState=g,this._defaultRenderState=E,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=L,this._currentRenderState=E,this._currentPassState=g,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let w=0;w<Ft._maximumVertexAttributes;w++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ve.apply(u,E,g)}function kPe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new re("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new re("The browser supports WebGL, but initialization failed.");return r}function VPe(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function UPe(e,t,n,i){let o=`${VPe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function zPe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new re(UPe(e,t,n,i))}function HPe(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function GPe(e,t){if(!l(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,HPe(e,o,t))}return i}function dr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var WPe={};Object.defineProperties(Kl.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=GPe(this._originalGLContext,e?zPe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Rt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Rt({context:this,pixelFormat:tt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Rt({context:this,pixelFormat:tt.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new wr({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return WPe}}});function pee(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,o,t,r,n,i)}var m6;typeof WebGLRenderingContext<"u"&&(m6=[te.BACK]);function p6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=m6;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var jPe=new ti;Kl.prototype.clear=function(e,t){e=y(e,jPe),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(z.equals(this._clearColor,o)||(z.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);pee(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);p6(this,c),n.clear(i)};function qPe(e,t,n,i,o){p6(e,t),pee(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function YPe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,F.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}Kl.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),qPe(this,o,t,n,r),YPe(this,e,n,i)};Kl.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=m6;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};Kl.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),o=y(e.width,t.drawingBufferWidth),r=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=Ke.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=tt.createTypedArray(tt.RGBA,a,o,r);return p6(this,s),t.readPixels(n,i,o,r,tt.RGBA,Ke.toWebGLConstant(a,this),c),c};var gee={position:0,textureCoordinates:1};Kl.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new st({attributes:{position:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Me.TRIANGLES});e=ni.fromGeometry({context:this,geometry:t,attributeLocations:gee,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Kl.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new $e({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Me.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:mT,fragmentShaderSource:e,attributeLocations:gee}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Kl.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function g6(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(g6.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});g6.prototype.destroy=function(){delete this._pickObjects[this.key]};Kl.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new re("Out of unique Pick IDs.");return this._pickObjects[t]=e,new g6(this._pickObjects,t,z.fromRgba(t))};Kl.prototype.isDestroyed=function(){return!1};Kl.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};Kl._deprecationWarning=_s;var HM=Kl;function ST(e){e=y(e,y.EMPTY_OBJECT);let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new he("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new he("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new zr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new zr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}ST.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};ST.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};ST.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};ST.prototype.isDestroyed=function(){return!1};ST.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var GM=ST;var dl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===dl.RGBA4||e===dl.RGBA8||e===dl.RGBA16F||e===dl.RGBA32F||e===dl.RGB5_A1||e===dl.RGB565||e===dl.DEPTH_COMPONENT16||e===dl.STENCIL_INDEX8||e===dl.DEPTH_STENCIL||e===dl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?dl.RGBA32F:e===te.HALF_FLOAT_OES?dl.RGBA16F:dl.RGBA8}},hl=Object.freeze(dl);function ev(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Ft.maximumRenderbufferSize,o=y(e.format,hl.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(ev.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});ev.prototype._getRenderbuffer=function(){return this._renderbuffer};ev.prototype.isDestroyed=function(){return!1};ev.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Ju=ev;function xs(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(xs.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});xs.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};xs.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,Ke.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,tt.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Rt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:Zt.NEAREST}),this._numSamples>1){let a=hl.getColorFormat(o);this._colorRenderbuffers[s]=new Ju({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Rt({context:e,width:t,height:n,pixelFormat:tt.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:Zt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Ju({context:e,width:t,height:n,format:hl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Ju({context:e,width:t,height:n,format:hl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Rt({context:e,width:t,height:n,pixelFormat:tt.DEPTH_COMPONENT,pixelDatatype:Ke.UNSIGNED_INT,sampler:Zt.NEAREST}):this._depthRenderbuffer=new Ju({context:e,width:t,height:n,format:hl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new GM({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new zr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};xs.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};xs.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};xs.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};xs.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};xs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};xs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};xs.prototype.getDepthTexture=function(){return this._depthTexture};xs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};xs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};xs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};xs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};xs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};xs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};xs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};xs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};xs.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&l(o)&&!o.isDestroyed()&&o.destroy(),l(o)&&o.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var mi=xs;var B0={VERTEX:0,FRAGMENT:1,BOTH:2};B0.includesVertexShader=function(e){return e===B0.VERTEX||e===B0.BOTH};B0.includesFragmentShader=function(e){return e===B0.FRAGMENT||e===B0.BOTH};var ge=Object.freeze(B0);function _6(e){this.name=e,this.fields=[]}_6.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};_6.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var WM=_6;function y6(e){this.signature=e,this.body=[]}y6.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};y6.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var jM=y6;function Ec(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Ec.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Ec.prototype.addDefine=function(e,t,n){n=y(n,ge.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),ge.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Ec.prototype.addStruct=function(e,t,n){this._structs[e]=new WM(t),ge.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Ec.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Ec.prototype.addFunction=function(e,t,n){this._functions[e]=new jM(t),ge.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Ec.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Ec.prototype.addUniform=function(e,t,n){n=y(n,ge.BOTH);let i=`uniform ${e} ${t};`;ge.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Ec.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Ec.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=KPe(e),i};Ec.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Ec.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Ec.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Ec.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=XPe(this),i=ZPe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` `),r=new Ue({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` -`),a=new Ue({defines:this._fragmentShaderParts.defineLines,sources:[s]});return en.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Ac.prototype.clone=function(){return Ge(this,!0)};function qPe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function YPe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function XPe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var vT=Ac;function Ms(e,t,n,i){let o=Ms._verifyAttributes(t);n=y(n,0);let r=[],s={},a,c,u=o.length;for(let h=0;h<u;++h){let p=o[h];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(h,p){return X.getSizeInBytes(p.componentDatatype)-X.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let h=Ms._vertexSizeInBytes(a),p=a[0].usage,_={vertexSizeInBytes:h,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ms._createArrayViews(a,h)};this._allBuffers.push(_)}this._size=0,this._instanced=y(i,!1),this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ms._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:y(o.index,i),enabled:y(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:y(o.componentDatatype,X.FLOAT),normalize:y(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:y(o.usage,Fe.STATIC_DRAW)};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};Ms._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*X.getSizeInBytes(a.componentDatatype)}let i=n>0?X.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ms._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/X.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*X.getSizeInBytes(a)}return n};Ms.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];Ms._resize(o,this._size),Ms._appendWriters(this.writers,o)}_6(this)};Ms._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=X.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var KPe=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Ms._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=KPe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ms.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=ZPe(this,i)||t;if(t||!l(this.va)){_6(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=u*(i.vertexSizeInBytes*a);Ms._appendAttributes(f,i,h,this._instanced)}f=f.concat(this._precreated),s.push({va:new ti({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function ZPe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=yt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ms._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Ms.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)$Pe(n[i],e,t)};function $Pe(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Ms.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function _6(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Ms.prototype.isDestroyed=function(){return!1};Ms.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return _6(this),ue(this)};var Gg=Ms;function QPe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Se.createIfNeeded(t.positiveX).fetchImage(i),Se.createIfNeeded(t.negativeX).fetchImage(i),Se.createIfNeeded(t.positiveY).fetchImage(i),Se.createIfNeeded(t.negativeY).fetchImage(i),Se.createIfNeeded(t.positiveZ).fetchImage(i),Se.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new wr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var HM=QPe;var QS=`#ifdef MRT -layout (location = 0) out vec4 out_FragData_0; -layout (location = 1) out vec4 out_FragData_1; -#else -layout (location = 0) out vec4 out_FragColor; -#endif - -uniform vec4 u_bgColor; -uniform sampler2D u_depthTexture; - -in vec2 v_textureCoordinates; +`),a=new Ue({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Ec.prototype.clone=function(){return Ge(this,!0)};function XPe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function KPe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function ZPe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var vT=Ec;function Ms(e,t,n,i){let o=Ms._verifyAttributes(t);n=y(n,0);let r=[],s={},a,c,u=o.length;for(let h=0;h<u;++h){let p=o[h];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(h,p){return X.getSizeInBytes(p.componentDatatype)-X.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let h=Ms._vertexSizeInBytes(a),p=a[0].usage,_={vertexSizeInBytes:h,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ms._createArrayViews(a,h)};this._allBuffers.push(_)}this._size=0,this._instanced=y(i,!1),this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ms._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:y(o.index,i),enabled:y(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:y(o.componentDatatype,X.FLOAT),normalize:y(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:y(o.usage,Fe.STATIC_DRAW)};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};Ms._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*X.getSizeInBytes(a.componentDatatype)}let i=n>0?X.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ms._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/X.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*X.getSizeInBytes(a)}return n};Ms.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];Ms._resize(o,this._size),Ms._appendWriters(this.writers,o)}x6(this)};Ms._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=X.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var $Pe=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Ms._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=$Pe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ms.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=QPe(this,i)||t;if(t||!l(this.va)){x6(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=u*(i.vertexSizeInBytes*a);Ms._appendAttributes(f,i,h,this._instanced)}f=f.concat(this._precreated),s.push({va:new ni({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function QPe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=_t.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ms._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Ms.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)JPe(n[i],e,t)};function JPe(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Ms.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function x6(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Ms.prototype.isDestroyed=function(){return!1};Ms.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return x6(this),ue(this)};var Wg=Ms;function e1e(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Se.createIfNeeded(t.positiveX).fetchImage(i),Se.createIfNeeded(t.negativeX).fetchImage(i),Se.createIfNeeded(t.positiveY).fetchImage(i),Se.createIfNeeded(t.negativeY).fetchImage(i),Se.createIfNeeded(t.positiveZ).fetchImage(i),Se.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new wr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var qM=e1e;function jg(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new pe,this.setValue(e)}Object.defineProperties(jg.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});jg.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};jg.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};jg.prototype.equals=function(e){return this===e||e instanceof jg&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};jg.prototype.valueOf=function(){return this._value};jg.prototype.toString=function(){return String(this._value)};var Xn=jg;function t1e(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function n1e(e){return new Xn(e)}function i1e(e,t,n){return t1e(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,n1e))}var le=i1e;function tv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(tv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance"),splitDirection:le("splitDirection")});tv.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new tv(this)};tv.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var Sc=tv;function k0(){this._array=[],this._hash={}}Object.defineProperties(k0.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});k0.prototype.contains=function(e){return l(this._hash[e])};k0.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};k0.prototype.get=function(e){return this._hash[e]};k0.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};k0.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var St=k0;function Zl(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Zl.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Zl.packedLength=2;Zl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};Zl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Zl),n.near=e[t++],n.far=e[t],n};Zl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Zl.clone=function(e,t){if(l(e))return l(t)||(t=new Zl),t.near=e.near,t.far=e.far,t};Zl.prototype.clone=function(e){return Zl.clone(this,e)};Zl.prototype.equals=function(e){return Zl.equals(this,e)};var Mt=Zl;function ef(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}ef.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new ef(e.near,e.nearValue,e.far,e.farValue)};ef.packedLength=4;ef.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};ef.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ef),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};ef.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};ef.prototype.clone=function(e){return ef.clone(this,e)};ef.prototype.equals=function(e){return ef.equals(this,e)};var Bt=ef;var V0={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},Ye=Object.freeze(V0);function tf(e){return e===V0.CLAMP_TO_GROUND||e===V0.CLAMP_TO_3D_TILE||e===V0.CLAMP_TO_TERRAIN}function wT(e){return e===V0.RELATIVE_TO_GROUND||e===V0.RELATIVE_TO_3D_TILE||e===V0.RELATIVE_TO_TERRAIN}var o1e={CENTER:0,LEFT:1,RIGHT:-1},xi=Object.freeze(o1e);var r1e={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},On=Object.freeze(r1e);var s1e={DONE:0,PENDING:1,FAILED:2},at=Object.freeze(s1e);function pd(){he.throwInstantiationError()}Object.defineProperties(pd.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});pd.prototype.getValue=he.throwInstantiationError;pd.prototype.equals=he.throwInstantiationError;pd.equals=function(e,t){return e===t||l(e)&&e.equals(t)};pd.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!pd.equals(e[i],t[i]))return!1;return!0};pd.isConstant=function(e){return!l(e)||e.isConstant};pd.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};pd.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};pd.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var q=pd;var a1e={LEFT:-1,NONE:0,RIGHT:1},Gr=Object.freeze(a1e);var c1e=z.WHITE,l1e=d.ZERO,u1e=Ye.NONE,f1e=U.ZERO,d1e=1,h1e=0,m1e=d.ZERO,p1e=xi.CENTER,g1e=On.CENTER,_1e=!1,y1e=Gr.NONE,x1e=new d,b1e=new z,T1e=new d,C1e=new U,A1e=new Bt,E1e=new Bt,S1e=new Bt,v1e=new qe,w1e=new Mt;function _ee(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function qg(e,t){t.collectionChanged.addEventListener(qg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new St,this._onCollectionChanged(t,t.values,[],[])}qg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),h;if(f&&(h=q.getValueOrUndefined(s._position,e,x1e),c=q.getValueOrUndefined(a._image,e),f=l(h)&&l(c)),!f){b6(r,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u),u.show=f,(!l(u.image)||r.textureValue!==c)&&(u.image=c,r.textureValue=c),u.position=h,u.color=q.getValueOrDefault(a._color,e,c1e,b1e),u.eyeOffset=q.getValueOrDefault(a._eyeOffset,e,l1e,T1e),u.heightReference=q.getValueOrDefault(a._heightReference,e,u1e),u.pixelOffset=q.getValueOrDefault(a._pixelOffset,e,f1e,C1e),u.scale=q.getValueOrDefault(a._scale,e,d1e),u.rotation=q.getValueOrDefault(a._rotation,e,h1e),u.alignedAxis=q.getValueOrDefault(a._alignedAxis,e,m1e),u.horizontalOrigin=q.getValueOrDefault(a._horizontalOrigin,e,p1e),u.verticalOrigin=q.getValueOrDefault(a._verticalOrigin,e,g1e),u.width=q.getValueOrUndefined(a._width,e),u.height=q.getValueOrUndefined(a._height,e),u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,A1e),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,E1e),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,S1e),u.sizeInMeters=q.getValueOrDefault(a._sizeInMeters,e,_1e),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,w1e),u.disableDepthTestDistance=q.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=q.getValueOrDefault(a._splitDirection,e,y1e);let p=q.getValueOrUndefined(a._imageSubRegion,e,v1e);l(p)&&u.setImageSubRegion(u._imageId,p)}return!0};qg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return at.FAILED;let i=n.billboard;if(i.heightReference===Ye.NONE)t.center=d.clone(i.position,t.center);else{if(!l(i._clampedPosition))return at.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,at.DONE};qg.prototype.isDestroyed=function(){return!1};qg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};qg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new _ee(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new _ee(r)):(b6(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],b6(s.get(r.id),r,a),s.remove(r.id)};function b6(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var YM=qg;var D1e=new d;function Ph(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=d.clone(t),this._max=d.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Ph.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=d.multiplyByScalar(t,.5,new d);return new Ph({minimum:d.negate(n,new d),maximum:n,offsetAttribute:e.offsetAttribute})};Ph.fromAxisAlignedBoundingBox=function(e){return new Ph({minimum:e.minimum,maximum:e.maximum})};Ph.packedLength=2*d.packedLength+1;Ph.pack=function(e,t,n){return n=y(n,0),d.pack(e._min,t,n),d.pack(e._max,t,n+d.packedLength),t[n+d.packedLength*2]=y(e._offsetAttribute,-1),t};var xee=new d,bee=new d,yee={minimum:xee,maximum:bee,offsetAttribute:void 0};Ph.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,xee),o=d.unpack(e,t+d.packedLength,bee),r=e[t+d.packedLength*2];return l(n)?(n._min=d.clone(i,n._min),n._max=d.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(yee.offsetAttribute=r===-1?void 0:r,new Ph(yee))};Ph.createGeometry=function(e){let t=e._min,n=e._max;if(d.equals(t,n))return;let i=new dn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=d.subtract(n,t,D1e),a=d.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===rn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new st({attributes:i,indices:o,primitiveType:Me.LINES,boundingSphere:new ae(d.ZERO,a),offsetAttribute:e._offsetAttribute})};var Rh=Ph;function DT(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(DT.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});DT.fromColor=function(e){return new DT(e.red,e.green,e.blue,e.alpha)};DT.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};DT.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Gt=DT;function nv(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(nv.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});nv.fromDistanceDisplayCondition=function(e){return new nv(e.near,e.far)};nv.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Bn=nv;function I1e(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var vt=I1e;function jo(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?Z.clone(e.start):new Z,this.stop=l(e.stop)?Z.clone(e.stop):new Z,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(jo.prototype,{isEmpty:{get:function(){let e=Z.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var IT={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};jo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new he("options.iso8601 is an invalid ISO 8601 interval.");let i=Z.fromIso8601(n[0]),o=Z.fromIso8601(n[1]),r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(IT.start=i,IT.stop=o,IT.isStartIncluded=r,IT.isStopIncluded=s,IT.data=a,new jo(IT))};jo.toIso8601=function(e,t){return`${Z.toIso8601(e.start,t)}/${Z.toIso8601(e.stop,t)}`};jo.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new jo(e)};jo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Z.equals(e.start,t.start)&&Z.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};jo.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Z.equalsEpsilon(e.start,t.start,n)&&Z.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};jo.intersect=function(e,t,n,i){if(!l(t))return jo.clone(jo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=Z.greaterThanOrEquals(s,o)&&Z.greaterThanOrEquals(r,s),u=!c&&Z.lessThanOrEquals(s,o)&&Z.lessThanOrEquals(o,a);if(!c&&!u)return jo.clone(jo.EMPTY,n);let f=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,_=t.isStopIncluded,m=Z.lessThan(r,a);return l(n)||(n=new jo),n.start=c?s:o,n.isStartIncluded=f&&p||!Z.equals(s,o)&&(c&&p||u&&f),n.stop=m?r:a,n.isStopIncluded=m?h:h&&_||!Z.equals(a,r)&&_,n.data=l(i)?i(e.data,t.data):e.data,n};jo.contains=function(e,t){if(e.isEmpty)return!1;let n=Z.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=Z.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};jo.prototype.clone=function(e){return jo.clone(this,e)};jo.prototype.equals=function(e,t){return jo.equals(this,e,t)};jo.prototype.equalsEpsilon=function(e,t,n){return jo.equalsEpsilon(this,e,t,n)};jo.prototype.toString=function(){return jo.toIso8601(this)};jo.EMPTY=Object.freeze(new jo({start:new Z,stop:new Z,isStartIncluded:!1,isStopIncluded:!1}));var En=jo;var Tee=Object.freeze(Z.fromIso8601("0000-01-01T00:00:00Z")),Cee=Object.freeze(Z.fromIso8601("9999-12-31T24:00:00Z")),P1e=Object.freeze(new En({start:Tee,stop:Cee})),R1e={MINIMUM_VALUE:Tee,MAXIMUM_VALUE:Cee,MAXIMUM_INTERVAL:P1e},He=R1e;function iv(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(iv.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});iv.fromCartesian3=function(e){return new iv(e.x,e.y,e.z)};iv.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Qi=iv;function XM(e){e=y(e,!0),this.value=XM.toValue(e)}Object.defineProperties(XM.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});XM.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var yn=XM;var KM=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec3 v_tangentEC; +in vec3 v_bitangentEC; +in vec2 v_st; void main() { - if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) - { -#ifdef MRT - out_FragData_0 = u_bgColor; - out_FragData_1 = vec4(u_bgColor.a); -#else - out_FragColor = u_bgColor; + vec3 positionToEyeEC = -v_positionEC; + mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); #endif - return; + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = tangentToEyeMatrix; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var ZM=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec3 tangent; +in vec3 bitangent; +in vec2 st; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec3 v_tangentEC; +out vec3 v_bitangentEC; +out vec2 v_st; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_tangentEC = czm_normal * tangent; // tangent in eye coordinates + v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var $M=`in vec3 v_positionEC; +in vec3 v_normalEC; + +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var QM=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var JM=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; + +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + materialInput.st = v_st; + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var eL=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec2 st; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec2 v_st; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_st = st; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var O1e={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX},Ya=Object.freeze(O1e);var M1e={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE},vo=Object.freeze(M1e);var L1e={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ya.ADD,equationAlpha:Ya.ADD,functionSourceRgb:vo.SOURCE_ALPHA,functionSourceAlpha:vo.ONE,functionDestinationRgb:vo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ya.ADD,equationAlpha:Ya.ADD,functionSourceRgb:vo.ONE,functionSourceAlpha:vo.ONE,functionDestinationRgb:vo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Ya.ADD,equationAlpha:Ya.ADD,functionSourceRgb:vo.SOURCE_ALPHA,functionSourceAlpha:vo.ONE,functionDestinationRgb:vo.ONE,functionDestinationAlpha:vo.ONE})},ln=Object.freeze(L1e);var N1e={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK},bi=Object.freeze(N1e);function PT(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(PT.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});PT.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` +`)};PT.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};PT.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ge(this.renderState,!1);return e?(t.depthMask=!1,t.blending=ln.ALPHA_BLEND):t.depthMask=!0,t};PT.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=ln.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:bi.BACK}),l(n)&&(i=xt(n,i,!0)),i};var no=PT;var tL=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; +} +`;var nL=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + vec2 centerPixel = fract(repeat * st); + float centerBump = texture(image, centerPixel).channel; + + float imageWidth = float(imageDimensions.x); + vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); + float rightBump = texture(image, rightPixel).channel; + + float imageHeight = float(imageDimensions.y); + vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); + float topBump = texture(image, leftPixel).channel; + + vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + material.diffuse = vec3(0.01); + + return material; +} +`;var iL=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 + + // Find the distance from the closest separator (region between two colors) + float scaledWidth = fract(repeat.s * st.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(repeat.t * st.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + float value = min(scaledWidth, scaledHeight); + + vec4 currentColor = mix(lightColor, darkColor, b); + vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); + + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; +} +`;var oL=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights + float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 + + vec4 color = mix(lightColor, darkColor, b); + color = czm_gammaCorrect(color); + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; +} +`;var rL=`uniform sampler2D heights; +uniform sampler2D colors; + +// This material expects heights to be sorted from lowest to highest. + +float getHeight(int idx, float invTexSize) +{ + vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); +#ifdef OES_texture_float + return texture(heights, uv).x; +#else + return czm_unpackFloat(texture(heights, uv)); +#endif +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float height = materialInput.height; + float invTexSize = 1.0 / float(heightsDimensions.x); + + float minHeight = getHeight(0, invTexSize); + float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); + + // early-out when outside the height range + if (height < minHeight || height > maxHeight) { + material.diffuse = vec3(0.0); + material.alpha = 0.0; + return material; + } + + // Binary search to find heights above and below. + int idxBelow = 0; + int idxAbove = heightsDimensions.x; + float heightBelow = minHeight; + float heightAbove = maxHeight; + + // while loop not allowed, so use for loop with max iterations. + // maxIterations of 16 supports a texture size up to 65536 (2^16). + const int maxIterations = 16; + for (int i = 0; i < maxIterations; i++) { + if (idxBelow >= idxAbove - 1) { + break; + } + + int idxMid = (idxBelow + idxAbove) / 2; + float heightTex = getHeight(idxMid, invTexSize); + + if (height > heightTex) { + idxBelow = idxMid; + heightBelow = heightTex; + } else { + idxAbove = idxMid; + heightAbove = heightTex; + } + } + + float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); + vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); + vec4 color = texture(colors, colorUv); + + // undo preumultiplied alpha + if (color.a > 0.0) + { + color.rgb /= color.a; } - discard; + color.rgb = czm_gammaCorrect(color.rgb); + + material.diffuse = color.rgb; + material.alpha = color.a; + return material; } -`;var Ph=`uniform vec3 u_radiiAndDynamicAtmosphereColor; +`;var sL=`uniform vec4 color; +uniform float spacing; +uniform float width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float distanceToContour = mod(materialInput.height, spacing); + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float dxc = abs(dFdx(materialInput.height)); + float dyc = abs(dFdy(materialInput.height)); + float dF = max(dxc, dyc) * czm_pixelRatio * width; + float alpha = (distanceToContour < dF) ? 1.0 : 0.0; +#else + // If no derivatives available (IE 10?), use pixel ratio + float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; +#endif + + vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var aL=`uniform sampler2D image; +uniform float minimumHeight; +uniform float maximumHeight; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); + vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; +} +`;var cL=`uniform vec4 fadeInColor; +uniform vec4 fadeOutColor; +uniform float maximumDistance; +uniform bool repeat; +uniform vec2 fadeDirection; +uniform vec2 time; + +float getTime(float t, float coord) +{ + float scalar = 1.0 / maximumDistance; + float q = distance(t, coord) * scalar; + if (repeat) + { + float r = distance(t, coord + 1.0) * scalar; + float s = distance(t, coord - 1.0) * scalar; + q = min(min(r, s), q); + } + return clamp(q, 0.0, 1.0); +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float s = getTime(time.x, st.s) * fadeDirection.s; + float t = getTime(time.y, st.t) * fadeDirection.t; + + float u = length(vec2(s, t)); + vec4 color = mix(fadeInColor, fadeOutColor, u); + + color = czm_gammaCorrect(color); + material.emission = color.rgb; + material.alpha = color.a; + + return material; +} +`;var lL=`uniform vec4 color; +uniform float cellAlpha; +uniform vec2 lineCount; +uniform vec2 lineThickness; +uniform vec2 lineOffset; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + + float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); + scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); + float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); + scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); + + float value; + + // Fuzz Factor - Controls blurriness of lines +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + const float fuzz = 1.2; + vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; + + // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. + vec2 dx = abs(dFdx(st)); + vec2 dy = abs(dFdy(st)); + vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; + value = min( + smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), + smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); +#else + // If no derivatives available (IE 10?), revert to view-dependent fuzz + const float fuzz = 0.05; + + vec2 range = 0.5 - (lineThickness * 0.05); + value = min( + 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), + 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); +#endif + + // Edges taken from RimLightingMaterial.glsl + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); + float sRim = smoothstep(0.8, 1.0, dRim); + value *= (1.0 - sRim); + + vec4 halfColor; + halfColor.rgb = color.rgb * 0.5; + halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); + halfColor = czm_gammaCorrect(halfColor); + material.diffuse = halfColor.rgb; + material.emission = halfColor.rgb; + material.alpha = halfColor.a; + + return material; +} +`;var uL=`uniform sampler2D image; +uniform float strength; +uniform vec2 repeat; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec4 textureValue = texture(image, fract(repeat * materialInput.st)); + vec3 normalTangentSpace = textureValue.channels; + normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; + normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); + normalTangentSpace = normalize(normalTangentSpace); + vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; + + material.normal = normalEC; + + return material; +} +`;var fL=`uniform vec4 color; + +float getPointOnLine(vec2 p0, vec2 p1, float x) +{ + float slope = (p0.y - p1.y) / (p0.x - p1.x); + return slope * (x - p0.x) + p0.y; +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) + float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; +#else + // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head + float base = 0.975; +#endif + + vec2 center = vec2(1.0, 0.5); + float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); + float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); + + float halfWidth = 0.15; + float s = step(0.5 - halfWidth, st.t); + s *= 1.0 - step(0.5 + halfWidth, st.t); + s *= 1.0 - step(base, st.s); + + float t = step(base, materialInput.st.s); + t *= 1.0 - step(ptOnUpperLine, st.t); + t *= step(ptOnLowerLine, st.t); + + // Find the distance from the closest separator (region between two colors) + float dist; + if (st.s < base) + { + float d1 = abs(st.t - (0.5 - halfWidth)); + float d2 = abs(st.t - (0.5 + halfWidth)); + dist = min(d1, d2); + } + else + { + float d1 = czm_infinity; + if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) + { + d1 = abs(st.s - base); + } + float d2 = abs(st.t - ptOnUpperLine); + float d3 = abs(st.t - ptOnLowerLine); + dist = min(min(d1, d2), d3); + } + + vec4 outsideColor = vec4(0.0); + vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); + vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); + + outColor = czm_gammaCorrect(outColor); + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + return material; +} +`;var dL=`uniform vec4 color; +uniform vec4 gapColor; +uniform float dashLength; +uniform float dashPattern; +in float v_polylineAngle; + +const float maskLength = 16.0; + +mat2 rotate(float rad) { + float c = cos(rad); + float s = sin(rad); + return mat2( + c, s, + -s, c + ); +} + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; + + // Get the relative position within the dash from 0 to 1 + float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); + // Figure out the mask index. + float maskIndex = floor(dashPosition * maskLength); + // Test the bit mask. + float maskTest = floor(dashPattern / pow(2.0, maskIndex)); + vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; + if (fragColor.a < 0.005) { // matches 0/255 and 1/255 + discard; + } + + fragColor = czm_gammaCorrect(fragColor); + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + return material; +} +`;var hL=`uniform vec4 color; +uniform float glowPower; +uniform float taperPower; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); + + if (taperPower <= 0.99999) { + glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); + } + + vec4 fragColor; + fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); + fragColor.a = clamp(0.0, 1.0, glow) * color.a; + fragColor = czm_gammaCorrect(fragColor); + + material.emission = fragColor.rgb; + material.alpha = fragColor.a; + + return material; +} +`;var mL=`uniform vec4 color; +uniform vec4 outlineColor; +uniform float outlineWidth; + +in float v_width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec2 st = materialInput.st; + float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; + float b = step(0.5 - halfInteriorWidth, st.t); + b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); + + // Find the distance from the closest separator (region between two colors) + float d1 = abs(st.t - (0.5 - halfInteriorWidth)); + float d2 = abs(st.t - (0.5 + halfInteriorWidth)); + float dist = min(d1, d2); + + vec4 currentColor = mix(outlineColor, color, b); + vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); + outColor = czm_gammaCorrect(outColor); + + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var pL=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html + float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); + float s = smoothstep(1.0 - width, 1.0, d); + + vec4 outColor = czm_gammaCorrect(color); + vec4 outRimColor = czm_gammaCorrect(rimColor); + + material.diffuse = outColor.rgb; + material.emission = outRimColor.rgb * s; + material.alpha = mix(outColor.a, outRimColor.a, s); + + return material; +} +`;var gL=`uniform sampler2D image; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); + rampColor = czm_gammaCorrect(rampColor); + material.diffuse = rampColor.rgb; + material.alpha = rampColor.a; + return material; +} +`;var _L=`uniform vec4 evenColor; +uniform vec4 oddColor; +uniform float offset; +uniform float repeat; +uniform bool horizontal; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) + float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); + float value = fract((coord - offset) * (repeat * 0.5)); + float dist = min(value, min(abs(value - 0.5), 1.0 - value)); + + vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); + vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); + color = czm_gammaCorrect(color); + + material.diffuse = color.rgb; + material.alpha = color.a; + + return material; +} +`;var yL=`uniform vec4 waterColor; +uniform vec4 landColor; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); + outColor = czm_gammaCorrect(outColor); + + material.diffuse = outColor.rgb; + material.alpha = outColor.a; + + return material; +} +`;var xL=`// Thanks for the contribution Jonas +// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog + +uniform sampler2D specularMap; +uniform sampler2D normalMap; +uniform vec4 baseWaterColor; +uniform vec4 blendColor; +uniform float frequency; +uniform float animationSpeed; +uniform float amplitude; +uniform float specularIntensity; +uniform float fadeFactor; + +czm_material czm_getMaterial(czm_materialInput materialInput) +{ + czm_material material = czm_getDefaultMaterial(materialInput); + + float time = czm_frameNumber * animationSpeed; + + // fade is a function of the distance from the fragment and the frequency of the waves + float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); + + float specularMapValue = texture(specularMap, materialInput.st).r; + + // note: not using directional motion at this time, just set the angle to 0.0; + vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); + vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); + + // fade out the normal perturbation as we move further from the water surface + normalTangentSpace.xy /= fade; + + // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) + normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); + + normalTangentSpace = normalize(normalTangentSpace); + + // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane + float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); + + // fade out water effect as specular map value decreases + material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; + + // base color is a blend of the water and non-water color based on the value from the specular map + // may need a uniform blend factor to better control this + material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); + + // diffuse highlights are based on how perturbed the normal is + material.diffuse += (0.1 * tsPerturbationRatio); + + material.diffuse = material.diffuse; + + material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); + + material.specular = specularIntensity; + material.shininess = 10.0; + + return material; +} +`;function We(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,Kt.LINEAR),this._magnificationFilter=y(e.magnificationFilter,hi.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,F1e(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(We._uniformList[this.type])||(We._uniformList[this.type]=Object.keys(this._uniforms))}We._uniformList={};We.fromType=function(e,t){let n=new We({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};We.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};We.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(x){return x.bufferView}),u=u[0]);let h=new Zt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Rt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:h}):p=new Rt({context:e,source:u,sampler:h});let _=this._textures[n];l(_)&&_!==this._defaultTexture&&_.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let x=this.uniforms[m];x.x=p._width,x.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let u=c.images,f=new wr({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Zt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};We.prototype.isDestroyed=function(){return!1};We.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function F1e(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=Ge(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=Ge(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=Ge(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:zn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=We._materialCache.getMaterial(t.type);if(l(i)){let r=Ge(i.fabric,!0);t._template=xt(t._template,r,!0),n=i.translucent}U1e(t),l(i)||We._materialCache.addMaterial(t.type,t),H1e(t),q1e(t),X1e(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,o),n=y(e.translucent,n),l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function T6(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function Aee(e,t){}function B1e(e,t){}var k1e=["type","materials","uniforms","components","source"],V1e=["diffuse","specular","shininess","normal","emission","alpha"];function U1e(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;T6(t,k1e,Aee,!0),T6(o,V1e,Aee,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);T6(n,r,B1e,!1)}function z1e(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function H1e(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} +`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) +{ +`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&z1e(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; +`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; +`:e.shaderSource+=`material.${o} = ${t[o]}; +`}e.shaderSource+=`return material; +} +`}}var Eee={mat2:Ri,mat3:$,mat4:F},G1e=/\.ktx2$/i;function W1e(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===We.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new Zt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Rt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Rt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),a)return;let h=r instanceof Se;if(!l(n._texturePaths[e])||h&&r.url!==n._texturePaths[e].url||!h&&r!==n._texturePaths[e]){if(typeof r=="string"||h){let p=h?r:Se.createIfNeeded(r),_;G1e.test(p.url)?_=ql(p.url):_=p.fetchImage(),Promise.resolve(_).then(function(m){n._loadedImages.push({id:e,image:m})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function j1e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof wr){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===We.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Se.createIfNeeded(i.positiveX).fetchImage(),Se.createIfNeeded(i.negativeX).fetchImage(),Se.createIfNeeded(i.positiveY).fetchImage(),Se.createIfNeeded(i.negativeY).fetchImage(),Se.createIfNeeded(i.positiveZ).fetchImage(),Se.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function q1e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&See(e,n)}function See(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=Y1e(o),s;if(r==="channels")s=ov(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;K1e(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},See(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=ov(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(W1e(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(j1e(t));else if(r.indexOf("mat")!==-1){let u=new Eee[r];e._uniforms[c]=function(){return Eee[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function Y1e(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Se||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===We.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function X1e(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new We({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=xt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;ov(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=ov(e,i,a)}}function ov(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(o+=1,n)}),o}function K1e(e,t,n){return ov(e,t,t,n)}We._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};We.DefaultImageId="czm_defaultImage";We.DefaultCubeMapId="czm_defaultCubeMap";We.ColorType="Color";We._materialCache.addMaterial(We.ColorType,{fabric:{type:We.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});We.ImageType="Image";We._materialCache.addMaterial(We.ImageType,{fabric:{type:We.ImageType,uniforms:{image:We.DefaultImageId,repeat:new U(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});We.DiffuseMapType="DiffuseMap";We._materialCache.addMaterial(We.DiffuseMapType,{fabric:{type:We.DiffuseMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.AlphaMapType="AlphaMap";We._materialCache.addMaterial(We.AlphaMapType,{fabric:{type:We.AlphaMapType,uniforms:{image:We.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});We.SpecularMapType="SpecularMap";We._materialCache.addMaterial(We.SpecularMapType,{fabric:{type:We.SpecularMapType,uniforms:{image:We.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});We.EmissionMapType="EmissionMap";We._materialCache.addMaterial(We.EmissionMapType,{fabric:{type:We.EmissionMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.BumpMapType="BumpMap";We._materialCache.addMaterial(We.BumpMapType,{fabric:{type:We.BumpMapType,uniforms:{image:We.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:nL},translucent:!1});We.NormalMapType="NormalMap";We._materialCache.addMaterial(We.NormalMapType,{fabric:{type:We.NormalMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:uL},translucent:!1});We.GridType="Grid";We._materialCache.addMaterial(We.GridType,{fabric:{type:We.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:lL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});We.StripeType="Stripe";We._materialCache.addMaterial(We.StripeType,{fabric:{type:We.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:_L},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});We.CheckerboardType="Checkerboard";We._materialCache.addMaterial(We.CheckerboardType,{fabric:{type:We.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new U(5,5)},source:iL},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.DotType="Dot";We._materialCache.addMaterial(We.DotType,{fabric:{type:We.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new U(5,5)},source:oL},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.WaterType="Water";We._materialCache.addMaterial(We.WaterType,{fabric:{type:We.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:We.DefaultImageId,normalMap:We.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:xL},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});We.RimLightingType="RimLighting";We._materialCache.addMaterial(We.RimLightingType,{fabric:{type:We.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:pL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});We.FadeType="Fade";We._materialCache.addMaterial(We.FadeType,{fabric:{type:We.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:cL},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});We.PolylineArrowType="PolylineArrow";We._materialCache.addMaterial(We.PolylineArrowType,{fabric:{type:We.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:fL},translucent:!0});We.PolylineDashType="PolylineDash";We._materialCache.addMaterial(We.PolylineDashType,{fabric:{type:We.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:dL},translucent:!0});We.PolylineGlowType="PolylineGlow";We._materialCache.addMaterial(We.PolylineGlowType,{fabric:{type:We.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:hL},translucent:!0});We.PolylineOutlineType="PolylineOutline";We._materialCache.addMaterial(We.PolylineOutlineType,{fabric:{type:We.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:mL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});We.ElevationContourType="ElevationContour";We._materialCache.addMaterial(We.ElevationContourType,{fabric:{type:We.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:sL},translucent:!1});We.ElevationRampType="ElevationRamp";We._materialCache.addMaterial(We.ElevationRampType,{fabric:{type:We.ElevationRampType,uniforms:{image:We.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:aL},translucent:!1});We.SlopeRampMaterialType="SlopeRamp";We._materialCache.addMaterial(We.SlopeRampMaterialType,{fabric:{type:We.SlopeRampMaterialType,uniforms:{image:We.DefaultImageId},source:gL},translucent:!1});We.AspectRampMaterialType="AspectRamp";We._materialCache.addMaterial(We.AspectRampMaterialType,{fabric:{type:We.AspectRampMaterialType,uniforms:{image:We.DefaultImageId},source:tL},translucent:!1});We.ElevationBandType="ElevationBand";We._materialCache.addMaterial(We.ElevationBandType,{fabric:{type:We.ElevationBandType,uniforms:{heights:We.DefaultImageId,colors:We.DefaultImageId},source:rL},translucent:!0});We.WaterMaskType="WaterMask";We._materialCache.addMaterial(We.WaterMaskType,{fabric:{type:We.WaterMaskType,source:yL,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var Yi=We;function U0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,U0.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(U0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});U0.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;U0.prototype.isTranslucent=no.prototype.isTranslucent;U0.prototype.getRenderState=no.prototype.getRenderState;U0.MaterialSupport={BASIC:Object.freeze({vertexFormat:Ie.POSITION_AND_NORMAL,vertexShaderSource:QM,fragmentShaderSource:$M}),TEXTURED:Object.freeze({vertexFormat:Ie.POSITION_NORMAL_AND_ST,vertexShaderSource:eL,fragmentShaderSource:JM}),ALL:Object.freeze({vertexFormat:Ie.ALL,vertexShaderSource:ZM,fragmentShaderSource:KM})};var ao=U0;var bL=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec4 v_color; + +void main() +{ + vec3 positionToEyeEC = -v_positionEC; + + vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD + normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif + + vec4 color = czm_gammaCorrect(v_color); + + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; + + out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +} +`;var TL=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec4 color; +in float batchId; + +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec4 v_color; + +void main() +{ + vec4 p = czm_computePosition(); + + v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates + v_normalEC = czm_normal * normal; // normal in eye coordinates + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var RT=`in vec4 v_color; + +void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +} +`;var CL=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 color; +in float batchId; + +out vec4 v_color; + +void main() +{ + vec4 p = czm_computePosition(); + + v_color = color; + + gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;function lp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?CL:TL,r=i?RT:bL,s=i?lp.FLAT_VERTEX_FORMAT:lp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(lp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});lp.VERTEX_FORMAT=Ie.POSITION_AND_NORMAL;lp.FLAT_VERTEX_FORMAT=Ie.POSITION_ONLY;lp.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;lp.prototype.isTranslucent=no.prototype.isTranslucent;lp.prototype.getRenderState=no.prototype.getRenderState;var an=lp;function OT(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(OT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});OT.prototype.getType=function(e){return"Color"};var Z1e=new Z;OT.prototype.getValue=function(e,t){return l(e)||(e=Z.now(Z1e)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};OT.prototype.equals=function(e){return this===e||e instanceof OT&&q.equals(this._color,e._color)};var Ut=OT;function Yg(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ee.default),this._rectangle=y(e.rectangle,se.MAX_VALUE),this._projection=new Pi(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(Yg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Yg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Yg.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Yg.prototype.rectangleToNativeRectangle=function(e,t){let n=P.toDegrees(e.west),i=P.toDegrees(e.south),o=P.toDegrees(e.east),r=P.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new se(n,i,o,r)};Yg.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=P.toDegrees(o.west),o.south=P.toDegrees(o.south),o.east=P.toDegrees(o.east),o.north=P.toDegrees(o.north),o};Yg.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,u=(e+1)*a+o.west,f=o.height/s,h=o.north-t*f,p=o.north-(t+1)*f;return l(i)||(i=new se(c,p,u,h)),i.west=c,i.south=p,i.east=u,i.north=h,i};Yg.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!se.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=P.TWO_PI);let u=(c-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new U(u,f)};var Xi=Yg;var vee=new d,wee=new d,Dee=new fe,C6=new d,$1e=new d,Iee=new ae,Q1e=new Xi,rv=[new fe,new fe,new fe,new fe],sv=new U,Wr={};Wr.initialize=function(){let e=Wr._initPromise;return l(e)||(e=Se.fetchJson(en("Assets/approximateTerrainHeights.json")).then(function(t){Wr._terrainHeights=t}),Wr._initPromise=e),e};Wr.getMinimumMaximumHeights=function(e,t){t=y(t,ee.default);let n=Pee(e),i=Wr._defaultMinTerrainHeight,o=Wr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Wr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(se.northeast(e,Dee),vee),t.cartographicToCartesian(se.southwest(e,Dee),wee),d.midpoint(wee,vee,C6);let a=t.scaleToGeodeticSurface(C6,$1e);if(l(a)){let c=d.distance(C6,a);i=Math.min(i,-c)}else i=Wr._defaultMinTerrainHeight}return i=Math.max(Wr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Wr.getBoundingSphere=function(e,t){t=y(t,ee.default);let n=Pee(e),i=Wr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Wr._terrainHeights[r];l(s)&&(i=s[1])}let o=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,Iee),ae.union(o,Iee,o)};function Pee(e){fe.fromRadians(e.east,e.north,0,rv[0]),fe.fromRadians(e.west,e.north,0,rv[1]),fe.fromRadians(e.east,e.south,0,rv[2]),fe.fromRadians(e.west,e.south,0,rv[3]);let t=0,n=0,i=0,o=0,r=Wr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let u=rv[c];if(Q1e.positionToTileXY(u,s,sv),c===0)i=sv.x,o=sv.y;else if(i!==sv.x||o!==sv.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Wr._terrainHeightsMaxLevel=6;Wr._defaultMaxTerrainHeight=9e3;Wr._defaultMinTerrainHeight=-1e5;Wr._terrainHeights=void 0;Wr._initPromise=void 0;Object.defineProperties(Wr,{initialized:{get:function(){return l(Wr._terrainHeights)}}});var ui=Wr;function vc(e,t,n){this.minimum=d.clone(y(e,d.ZERO)),this.maximum=d.clone(y(t,d.ZERO)),l(n)?n=d.clone(n):n=d.midpoint(this.minimum,this.maximum,new d),this.center=n}vc.fromCorners=function(e,t,n){return l(n)||(n=new vc),n.minimum=d.clone(e,n.minimum),n.maximum=d.clone(t,n.maximum),n.center=d.midpoint(e,t,n.center),n};vc.fromPoints=function(e,t){if(l(t)||(t=new vc),!l(e)||e.length===0)return t.minimum=d.clone(d.ZERO,t.minimum),t.maximum=d.clone(d.ZERO,t.maximum),t.center=d.clone(d.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let h=1;h<c;h++){let p=e[h],_=p.x,m=p.y,x=p.z;n=Math.min(_,n),r=Math.max(_,r),i=Math.min(m,i),s=Math.max(m,s),o=Math.min(x,o),a=Math.max(x,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=d.midpoint(u,f,t.center),t};vc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=d.clone(e.minimum,t.minimum),t.maximum=d.clone(e.maximum,t.maximum),t.center=d.clone(e.center,t.center),t):new vc(e.minimum,e.maximum,e.center)};vc.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&d.equals(e.minimum,t.minimum)&&d.equals(e.maximum,t.maximum)};var AL=new d;vc.intersectPlane=function(e,t){AL=d.subtract(e.maximum,e.minimum,AL);let n=d.multiplyByScalar(AL,.5,AL),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=d.dot(e.center,i)+t.distance;return r-o>0?Wt.INSIDE:r+o<0?Wt.OUTSIDE:Wt.INTERSECTING};vc.prototype.clone=function(e){return vc.clone(this,e)};vc.prototype.intersectPlane=function(e){return vc.intersectPlane(this,e)};vc.prototype.equals=function(e){return vc.equals(this,e)};var z0=vc;var A6=new oe;function Oh(e,t){t=y(t,ee.default),e=t.scaleToGeodeticSurface(e);let n=Ot.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=d.fromCartesian4(F.getColumn(n,0,A6)),this._yAxis=d.fromCartesian4(F.getColumn(n,1,A6));let i=d.fromCartesian4(F.getColumn(n,2,A6));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Oh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var J1e=new z0;Oh.fromPoints=function(e,t){let n=z0.fromPoints(e,J1e);return new Oh(n.center,t)};var Ree=new pn,EL=new d;Oh.prototype.projectPointOntoPlane=function(e,t){let n=Ree;n.origin=e,d.normalize(e,n.direction);let i=Qn.rayPlane(n,this._plane,EL);if(l(i)||(d.negate(n.direction,n.direction),i=Qn.rayPlane(n,this._plane,EL)),l(i)){let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new U(r,s)}};Oh.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);l(r)&&(t[n]=r,n++)}return t.length=n,t};Oh.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=Ree;n.origin=e,d.clone(this._plane.normal,n.direction);let i=Qn.rayPlane(n,this._plane,EL);l(i)||(d.negate(n.direction,n.direction),i=Qn.rayPlane(n,this._plane,EL));let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return t.x=r,t.y=s,t};Oh.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var eRe=new d;Oh.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new d);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=eRe;return d.multiplyByScalar(o,e.x,s),t=d.add(i,s,t),d.multiplyByScalar(r,e.y,s),d.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Oh.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var ns=Oh;function Oi(e,t){this.center=d.clone(y(e,d.ZERO)),this.halfAxes=$.clone(y(t,$.ZERO))}Oi.packedLength=d.packedLength+$.packedLength;Oi.pack=function(e,t,n){return n=y(n,0),d.pack(e.center,t,n),$.pack(e.halfAxes,t,n+d.packedLength),t};Oi.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Oi),d.unpack(e,t,n.center),$.unpack(e,t+d.packedLength,n.halfAxes),n};var tRe=new d,nRe=new d,iRe=new d,oRe=new d,rRe=new d,sRe=new d,aRe=new $,cRe={unitary:new $,diagonal:new $};Oi.fromPoints=function(e,t){if(l(t)||(t=new Oi),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=d.ZERO,t;let n,i=e.length,o=d.clone(e[0],tRe);for(n=1;n<i;n++)d.add(o,e[n],o);let r=1/i;d.multiplyByScalar(o,r,o);let s=0,a=0,c=0,u=0,f=0,h=0,p;for(n=0;n<i;n++)p=d.subtract(e[n],o,nRe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,h+=p.z*p.z;s*=r,a*=r,c*=r,u*=r,f*=r,h*=r;let _=aRe;_[0]=s,_[1]=a,_[2]=c,_[3]=a,_[4]=u,_[5]=f,_[6]=c,_[7]=f,_[8]=h;let m=$.computeEigenDecomposition(_,cRe),x=$.clone(m.unitary,t.halfAxes),b=$.getColumn(x,0,oRe),T=$.getColumn(x,1,rRe),C=$.getColumn(x,2,sRe),A=-Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE,D=Number.MAX_VALUE,O=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],A=Math.max(d.dot(b,p),A),S=Math.max(d.dot(T,p),S),v=Math.max(d.dot(C,p),v),D=Math.min(d.dot(b,p),D),O=Math.min(d.dot(T,p),O),R=Math.min(d.dot(C,p),R);b=d.multiplyByScalar(b,.5*(D+A),b),T=d.multiplyByScalar(T,.5*(O+S),T),C=d.multiplyByScalar(C,.5*(R+v),C);let M=d.add(b,T,t.center);d.add(M,C,M);let L=iRe;return L.x=A-D,L.y=S-O,L.z=v-R,d.multiplyByScalar(L,.5,L),$.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var Bee=new d,lRe=new d;function Oee(e,t,n,i,o,r,s,a,c,u,f){l(f)||(f=new Oi);let h=f.halfAxes;$.setColumn(h,0,t,h),$.setColumn(h,1,n,h),$.setColumn(h,2,i,h);let p=Bee;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+u)/2;let _=lRe;_.x=(r-o)/2,_.y=(a-s)/2,_.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(h,p,p),d.add(e,p,m),$.multiplyByScale(h,_,h),f}var Mee=new fe,uRe=new d,fRe=new fe,dRe=new fe,hRe=new fe,mRe=new fe,pRe=new fe,gRe=new d,Lee=new d,_Re=new d,Nee=new d,yRe=new d,xRe=new U,bRe=new U,TRe=new U,CRe=new U,ARe=new U,ERe=new d,SRe=new d,vRe=new d,wRe=new d,DRe=new U,IRe=new d,PRe=new d,RRe=new d,ORe=new sn(d.UNIT_X,0);Oi.fromRectangle=function(e,t,n,i,o){t=y(t,0),n=y(n,0),i=y(i,ee.default);let r,s,a,c,u,f,h;if(e.width<=P.PI){let O=se.center(e,Mee),R=i.cartographicToCartesian(O,uRe),M=new ns(R,i);h=M.plane;let L=O.longitude,g=e.south<0&&e.north>0?0:O.latitude,E=fe.fromRadians(L,e.north,n,fRe),w=fe.fromRadians(e.west,e.north,n,dRe),I=fe.fromRadians(e.west,g,n,hRe),N=fe.fromRadians(e.west,e.south,n,mRe),B=fe.fromRadians(L,e.south,n,pRe),H=i.cartographicToCartesian(E,gRe),V=i.cartographicToCartesian(w,Lee),G=i.cartographicToCartesian(I,_Re),k=i.cartographicToCartesian(N,Nee),W=i.cartographicToCartesian(B,yRe),Y=M.projectPointToNearestOnPlane(H,xRe),J=M.projectPointToNearestOnPlane(V,bRe),j=M.projectPointToNearestOnPlane(G,TRe),K=M.projectPointToNearestOnPlane(k,CRe),Q=M.projectPointToNearestOnPlane(W,ARe);return r=Math.min(J.x,j.x,K.x),s=-r,c=Math.max(J.y,Y.y),a=Math.min(K.y,Q.y),w.height=N.height=t,V=i.cartographicToCartesian(w,Lee),k=i.cartographicToCartesian(N,Nee),u=Math.min(sn.getPointDistance(h,V),sn.getPointDistance(h,k)),f=n,Oee(M.origin,M.xAxis,M.yAxis,M.zAxis,r,s,a,c,u,f,o)}let p=e.south>0,_=e.north<0,m=p?e.south:_?e.north:0,x=se.center(e,Mee).longitude,b=d.fromRadians(x,m,n,i,ERe);b.z=0;let C=Math.abs(b.x)<P.EPSILON10&&Math.abs(b.y)<P.EPSILON10?d.UNIT_X:d.normalize(b,SRe),A=d.UNIT_Z,S=d.cross(C,A,vRe);h=sn.fromPointNormal(b,C,ORe);let v=d.fromRadians(x+P.PI_OVER_TWO,m,n,i,wRe);s=d.dot(sn.projectPointOntoPlane(h,v,DRe),S),r=-s,c=d.fromRadians(0,e.north,_?t:n,i,IRe).z,a=d.fromRadians(0,e.south,p?t:n,i,PRe).z;let D=d.fromRadians(e.east,m,n,i,RRe);return u=sn.getPointDistance(h,D),f=0,Oee(b,S,A,C,r,s,a,c,u,f,o)};Oi.fromTransformation=function(e,t){return l(t)||(t=new Oi),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Oi.clone=function(e,t){if(l(e))return l(t)?(d.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new Oi(e.center,e.halfAxes)};Oi.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[$.COLUMN0ROW0]+s*o[$.COLUMN0ROW1]+a*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+s*o[$.COLUMN1ROW1]+a*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+s*o[$.COLUMN2ROW1]+a*o[$.COLUMN2ROW2]),u=d.dot(i,n)+t.distance;return u<=-c?Wt.OUTSIDE:u>=c?Wt.INSIDE:Wt.INTERSECTING};var kee=new d,Vee=new d,Uee=new d,MRe=new d,Fee=new d,LRe=new d;Oi.distanceSquaredTo=function(e,t){let n=d.subtract(t,e.center,Bee),i=e.halfAxes,o=$.getColumn(i,0,kee),r=$.getColumn(i,1,Vee),s=$.getColumn(i,2,Uee),a=d.magnitude(o),c=d.magnitude(r),u=d.magnitude(s),f=!0,h=!0,p=!0;a>0?d.divideByScalar(o,a,o):f=!1,c>0?d.divideByScalar(r,c,r):h=!1,u>0?d.divideByScalar(s,u,s):p=!1;let _=!f+!h+!p,m,x,b;if(_===1){let S=o;m=r,x=s,h?p||(S=s,x=o):(S=r,m=o),b=d.cross(m,x,Fee),S===o?o=b:S===r?r=b:S===s&&(s=b)}else if(_===2){m=o,h?m=r:p&&(m=s);let S=d.UNIT_Y;S.equalsEpsilon(m,P.EPSILON3)&&(S=d.UNIT_X),x=d.cross(m,S,MRe),d.normalize(x,x),b=d.cross(m,x,Fee),d.normalize(b,b),m===o?(r=x,s=b):m===r?(s=x,o=b):m===s&&(o=x,r=b)}else _===3&&(o=d.UNIT_X,r=d.UNIT_Y,s=d.UNIT_Z);let T=LRe;T.x=d.dot(n,o),T.y=d.dot(n,r),T.z=d.dot(n,s);let C=0,A;return T.x<-a?(A=T.x+a,C+=A*A):T.x>a&&(A=T.x-a,C+=A*A),T.y<-c?(A=T.y+c,C+=A*A):T.y>c&&(A=T.y-c,C+=A*A),T.z<-u?(A=T.z+u,C+=A*A):T.z>u&&(A=T.z-u,C+=A*A),C};var NRe=new d,FRe=new d;Oi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new ja);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,kee),u=$.getColumn(a,1,Vee),f=$.getColumn(a,2,Uee),h=d.add(c,u,NRe);d.add(h,f,h),d.add(h,s,h);let p=d.subtract(h,t,FRe),_=d.dot(n,p);return o=Math.min(_,o),r=Math.max(_,r),d.add(s,c,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.add(s,c,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.add(s,c,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.subtract(s,c,h),d.add(h,u,h),d.add(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.subtract(s,c,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.subtract(s,c,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.subtract(s,c,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),i.start=o,i.stop=r,i};var BRe=new d,kRe=new d,VRe=new d;Oi.computeCorners=function(e,t){l(t)||(t=[new d,new d,new d,new d,new d,new d,new d,new d]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,BRe),r=$.getColumn(i,1,kRe),s=$.getColumn(i,2,VRe);return d.clone(n,t[0]),d.subtract(t[0],o,t[0]),d.subtract(t[0],r,t[0]),d.subtract(t[0],s,t[0]),d.clone(n,t[1]),d.subtract(t[1],o,t[1]),d.subtract(t[1],r,t[1]),d.add(t[1],s,t[1]),d.clone(n,t[2]),d.subtract(t[2],o,t[2]),d.add(t[2],r,t[2]),d.subtract(t[2],s,t[2]),d.clone(n,t[3]),d.subtract(t[3],o,t[3]),d.add(t[3],r,t[3]),d.add(t[3],s,t[3]),d.clone(n,t[4]),d.add(t[4],o,t[4]),d.subtract(t[4],r,t[4]),d.subtract(t[4],s,t[4]),d.clone(n,t[5]),d.add(t[5],o,t[5]),d.subtract(t[5],r,t[5]),d.add(t[5],s,t[5]),d.clone(n,t[6]),d.add(t[6],o,t[6]),d.add(t[6],r,t[6]),d.subtract(t[6],s,t[6]),d.clone(n,t[7]),d.add(t[7],o,t[7]),d.add(t[7],r,t[7]),d.add(t[7],s,t[7]),t};var URe=new $;Oi.computeTransformation=function(e,t){l(t)||(t=new F);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,URe);return F.fromRotationTranslation(i,n,t)};var zRe=new ae;Oi.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,zRe);return!t.isBoundingSphereVisible(n)};Oi.prototype.intersectPlane=function(e){return Oi.intersectPlane(this,e)};Oi.prototype.distanceSquaredTo=function(e){return Oi.distanceSquaredTo(this,e)};Oi.prototype.computePlaneDistances=function(e,t,n){return Oi.computePlaneDistances(this,e,t,n)};Oi.prototype.computeCorners=function(e){return Oi.computeCorners(this,e)};Oi.prototype.computeTransformation=function(e){return Oi.computeTransformation(this,e)};Oi.prototype.isOccluded=function(e){return Oi.isOccluded(this,e)};Oi.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Oi.prototype.clone=function(e){return Oi.clone(this,e)};Oi.prototype.equals=function(e){return Oi.equals(this,e)};var wn=Oi;var SL={};SL.getHeight=function(e,t,n){return(e-n)*t+n};var HRe=new fe;SL.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,HRe);if(!l(r))return d.clone(e,o);let s=SL.getHeight(r.height,n,i);return d.fromRadians(r.longitude,r.latitude,s,t,o)};var Dr=SL;var vL=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; + +#ifdef EXTRUDED_GEOMETRY +in vec3 extrudeDirection; + +uniform float u_globeMinimumAltitude; +#endif // EXTRUDED_GEOMETRY + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif // PER_INSTANCE_COLOR + +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +out vec4 v_sphericalExtents; +#else // SPHERICAL +out vec2 v_inversePlaneExtents; +out vec4 v_westPlane; +out vec4 v_southPlane; +#endif // SPHERICAL +out vec3 v_uvMinAndSphericalLongitudeRotation; +out vec3 v_uMaxAndInverseDistance; +out vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES + +void main() +{ + vec4 position = czm_computePosition(); + +#ifdef EXTRUDED_GEOMETRY + float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); + delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; + + //extrudeDirection is zero for the top layer + position = position + vec4(extrudeDirection * delta, 0.0); +#endif + +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL + v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); + v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); +#else // SPHERICAL +#ifdef COLUMBUS_VIEW_2D + vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); + vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); + + // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): + // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) + // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) + // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) + vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); + bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; + planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); + planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); + + // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) + // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) + // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) + idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; + idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); + planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); + planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); + + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; + vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; + vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; +#else // COLUMBUS_VIEW_2D + // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction + vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; + vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; + vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; +#endif // COLUMBUS_VIEW_2D + + vec3 eastWard = southEastCorner - southWestCorner; + float eastExtent = length(eastWard); + eastWard /= eastExtent; + + vec3 northWard = northWestCorner - southWestCorner; + float northExtent = length(northWard); + northWard /= northExtent; + + v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); + v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); + v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); +#endif // SPHERICAL + vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); + vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); + + v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); + v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); + v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; +#endif // TEXTURE_COORDINATES + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif + + gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); +} +`;var H0=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif + +void main(void) +{ +#ifdef VECTOR_TILE + out_FragColor = czm_gammaCorrect(u_highlightColor); +#else + out_FragColor = vec4(1.0); +#endif + czm_writeDepthClamp(); +} +`;var zee={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};zee.NUMBER_OF_CLASSIFICATION_TYPES=3;var kn=Object.freeze(zee);var GRe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},wc=Object.freeze(GRe);function WRe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var wL=WRe;function up(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=jRe(t),o=e.floatingPointTexture,r=i===Ke.FLOAT&&!o,s=qRe(t,r),a=YRe(s,t,r),c=Math.floor(Ft.maximumTextureSize/a),u=Math.min(n,c),f=a*u,h=Math.ceil(n/u),p=1/f,_=p*.5,m=1/h,x=m*.5;this._textureDimensions=new U(f,h),this._textureStep=new oe(p,_,m,x),this._pixelDatatype=r?Ke.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let b=4*f*h;this._batchValues=i===Ke.FLOAT&&!r?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(up.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function jRe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==X.UNSIGNED_BYTE){t=!0;break}return t?Ke.FLOAT:Ke.UNSIGNED_BYTE}function Gee(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?d:n===4?oe:Number}function qRe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==X.UNSIGNED_BYTE&&t?i+=4:++i}return n}function YRe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==X.UNSIGNED_BYTE&&n?o+4:o+1}var av=new oe;function XRe(e,t,n){let i=oe.unpack(e,t,av),o=oe.unpackFloat(i);i=oe.unpack(e,t+4,av);let r=oe.unpackFloat(i);i=oe.unpack(e,t+8,av);let s=oe.unpackFloat(i);i=oe.unpack(e,t+12,av);let a=oe.unpackFloat(i);return oe.fromElements(o,r,s,a,n)}function KRe(e,t,n){let i=oe.packFloat(e.x,av);oe.pack(i,t,n),i=oe.packFloat(e.y,i),oe.pack(i,t,n+4),i=oe.packFloat(e.z,i),oe.pack(i,t,n+8),i=oe.packFloat(e.w,i),oe.pack(i,t,n+12)}var Hee=new oe;up.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Ke.UNSIGNED_BYTE?a=XRe(this._batchValues,s,Hee):a=oe.unpack(this._batchValues,s,Hee);let c=Gee(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var ZRe=[void 0,void 0,new U,new d,new oe],$Re=new oe;up.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=ZRe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Gee(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=$Re;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],h=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Ke.UNSIGNED_BYTE?KRe(c,this._batchValues,h):oe.pack(c,this._batchValues,h),this._batchValuesDirty=!0};function QRe(e,t){let n=e._textureDimensions;e._texture=new Rt({context:t,pixelFormat:tt.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Zt.NEAREST,flipY:!1})}function JRe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}up.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||QRe(this,e.context),JRe(this))};up.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:xt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function eOe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float numberOfAttributes = float(${t}); + return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); +} +`:`uniform vec4 batchTextureStep; +uniform vec2 batchTextureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float stepY = batchTextureStep.z; + float centerY = batchTextureStep.w; + float numberOfAttributes = float(${t}); + float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); + float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}function tOe(e){return e===1?"float":`vec${e}`}function nOe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function iOe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=tOe(o),a=nOe(o),c=e._offsets[t],u=`${s} ${r}(float batchId) +{ + vec2 st = computeSt(batchId); + st.x += batchTextureStep.x * float(${c}); +`;return e._packFloats&&i.componentDatatype!==Ke.UNSIGNED_BYTE?u+=`vec4 textureValue; +textureValue.x = czm_unpackFloat(texture(batchTexture, st)); +textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); +textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); +textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); +`:u+=` vec4 textureValue = texture(batchTexture, st); +`,u+=` ${s} value = textureValue${a}; +`,e._pixelDatatype===Ke.UNSIGNED_BYTE&&i.componentDatatype===X.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; +`:e._pixelDatatype===Ke.FLOAT&&i.componentDatatype===X.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; +`),u+=` return value; +} +`,u}up.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; +`;t+=`${eOe(this)} +`;let n=e.length;for(let i=0;i<n;++i)t+=iOe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r} +${t} +${s}`}};up.prototype.isDestroyed=function(){return!1};up.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var MT=up;function ml(e){this._ellipsoid=y(e,ee.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(ml.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});ml.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};ml.geodeticLatitudeToMercatorAngle=function(e){e>ml.MaximumLatitude?e=ml.MaximumLatitude:e<-ml.MaximumLatitude&&(e=-ml.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};ml.MaximumLatitude=ml.mercatorAngleToGeodeticLatitude(Math.PI);ml.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=ml.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};ml.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=ml.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var Mi=ml;function oOe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!F.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Nn.transformToWorldCoordinates(e[r]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function E6(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function rOe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?E6(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(E6(i.westHemisphereGeometry,n),E6(i.eastHemisphereGeometry,n))}}function sOe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,h=t.length;for(c=0;c<h;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(oOe(t,a,o),!o)for(c=0;c<h;++c)l(t[c].geometry)&&Nn.splitLongitude(t[c]);if(rOe(t),r)for(c=0;c<h;++c){let _=t[c];l(_.geometry)?(Nn.reorderForPostVertexCache(_.geometry),Nn.reorderForPreVertexCache(_.geometry)):l(_.westHemisphereGeometry)&&l(_.eastHemisphereGeometry)&&(Nn.reorderForPostVertexCache(_.westHemisphereGeometry),Nn.reorderForPreVertexCache(_.westHemisphereGeometry),Nn.reorderForPostVertexCache(_.eastHemisphereGeometry),Nn.reorderForPreVertexCache(_.eastHemisphereGeometry))}let p=Nn.combineInstances(t);for(h=p.length,c=0;c<h;++c){u=p[c];let _=u.attributes;if(o)for(let m in _)_.hasOwnProperty(m)&&_[m].componentDatatype===X.DOUBLE&&Nn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in _)if(_.hasOwnProperty(m)&&_[m].componentDatatype===X.DOUBLE){let x=`${m}3D`,b=`${m}2D`;Nn.projectTo2D(u,m,x,b,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ae.fromVertices(u.attributes.position2D.values)),Nn.encodeAttribute(u,x,`${x}High`,`${x}Low`),Nn.encodeAttribute(u,b,`${b}High`,`${b}Low`)}s&&Nn.compressVertices(u)}if(!i){let _=[];for(h=p.length,c=0;c<h;++c)u=p[c],_=_.concat(Nn.fitToUnsignedShortIndices(u));p=_}return p}function S6(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let h=e[u][t];if(!l(h))continue;let p=h.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function aOe(e,t){let n=[];return S6(e,"geometry",t,n),S6(e,"westHemisphereGeometry",t,n),S6(e,"eastHemisphereGeometry",t,n),n}var fp={};fp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=sOe(e),t.length>0&&(n=Nn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=aOe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let h=i[f],p=h.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=h.geometry.offsetAttribute));let _=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;l(_)&&l(m)&&(l(_.boundingSphere)&&l(m.boundingSphere)&&(c[f]=ae.union(_.boundingSphere,m.boundingSphere)),l(_.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ae.union(_.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function cOe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function lOe(e,t){let n=e.length;for(let i=0;i<n;++i)cOe(e[i],t)}function uOe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*ae.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}fp.packCreateGeometryResults=function(e,t){let n=new Float64Array(uOe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ae.pack(c.boundingSphere,n,s),s+=ae.packedLength;let h=l(c.boundingSphereCV)?1:0;n[s++]=h,h&&ae.pack(c.boundingSphereCV,n,s),s+=ae.packedLength;let p=c.attributes,_=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(_.push(x),l(o[x])||(o[x]=i.length,i.push(x)));n[s++]=_.length;for(let x=0;x<_.length;x++){let b=_[x],T=p[b];n[s++]=o[b],n[s++]=T.componentDatatype,n[s++]=T.componentsPerAttribute,n[s++]=T.normalize?1:0,n[s++]=T.values.length,n.set(T.values,s),s+=T.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};fp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let h,p;n[s++]===1&&(h=ae.unpack(n,s)),s+=ae.packedLength,n[s++]===1&&(p=ae.unpack(n,s)),s+=ae.packedLength;let x,b,T,C=new dn,A=n[s++];for(i=0;i<A;i++){let v=t[n[s++]],D=n[s++];T=n[s++];let O=n[s++]!==0;x=n[s++],b=X.createTypedArray(D,x);for(let R=0;R<x;R++)b[R]=n[s++];C[v]=new ve({componentDatatype:D,componentsPerAttribute:T,normalize:O,values:b})}let S;if(x=n[s++],x>0){let v=b.length/T;for(S=Ne.createTypedArray(v,x),i=0;i<x;i++)S[i]=n[s++]}o[r++]=new st({primitiveType:c,geometryType:u,boundingSphere:h,boundingSphereCV:p,indices:S,attributes:C,offsetAttribute:f})}return o};function fOe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(F.pack(s.modelMatrix,i,o),o+=F.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function dOe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=F.unpack(t,o),s;o+=F.packedLength,l(t[o])&&(s={offset:new Qi(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}fp.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:fOe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Pi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};fp.unpackCombineGeometryParameters=function(e){let t=dOe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=fp.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let h=c[f],p=t[o];p.geometry=h,++o}}let r=ee.clone(e.ellipsoid),s=e.isGeographic?new Pi(r):new Mi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Wee(e){let t=e.length,n=1+(ae.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,ae.pack(e[r],i,o)):i[o++]=0,o+=ae.packedLength}return i}function jee(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ae.unpack(e,i)),++n,i+=ae.packedLength;return t}fp.packCombineGeometryResults=function(e,t){l(e.geometries)&&lOe(e.geometries,t);let n=Wee(e.boundingSpheres),i=Wee(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};fp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:jee(e.boundingSpheres),boundingSpheresCV:jee(e.boundingSpheresCV)}};var LT=fp;var hOe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Ir=Object.freeze(hOe);var $l={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};$l.NUMBER_OF_SHADOW_MODES=4;$l.castShadows=function(e){return e===$l.ENABLED||e===$l.CAST_ONLY};$l.receiveShadows=function(e){return e===$l.ENABLED||e===$l.RECEIVE_ONLY};$l.fromCastReceive=function(e,t){return e&&t?$l.ENABLED:e?$l.CAST_ONLY:t?$l.RECEIVE_ONLY:$l.DISABLED};var xn=Object.freeze($l);function hr(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,xn.DISABLED),this._translucent=void 0,this._state=Ir.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(hr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function mOe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var pOe=new U,gOe=new d,ete=new oe;function tte(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,pOe);if(t===3)return d.unpack(e,0,gOe);if(t===4)return oe.unpack(e,0,ete)}function _Oe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=mOe(i),s=r.length,a=[],c={},u={},f,p=i[0].attributes,_,m,x;for(_=0;_<s;++_)m=r[_],x=p[m],c[m]=_,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:X.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:X.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let b=a.length,T=new MT(t,a,o);for(_=0;_<o;++_){let C=i[_];p=C.attributes;for(let O=0;O<s;++O){m=r[O],x=p[m];let R=tte(x.value),M=c[m];T.setBatchedAttribute(_,M,R)}let A={primitive:y(C.pickPrimitive,e)};l(C.id)&&(A.id=C.id);let S=t.createPickId(A);e._pickIds.push(S);let v=S.color,D=ete;D.x=z.floatToByte(v.red),D.y=z.floatToByte(v.green),D.z=z.floatToByte(v.blue),D.w=z.floatToByte(v.alpha),T.setBatchedAttribute(_,b-1,D)}e._batchTable=T,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function yOe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new ve({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function xOe(e){let t=e.attributes,n=new dn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=yOe(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new st({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ae.clone(e.boundingSphere)})}function bOe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var TOe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;hr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=TOe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c}; +`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView; +`,r+=`in vec4 position; +`,s+=`${c} +{ + return u_modifiedModelView * position; +} + +`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} +{ + return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); +} + +`:(r+=`in vec3 ${a}2DHigh; +in vec3 ${a}2DLow; +`,s+=`${c} +{ + vec4 p; + if (czm_morphTime == 1.0) + { + p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); + } + else + { + p = czm_columbusViewMorph( + czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), + czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), + czm_morphTime); + } + return p; +} + +`)}return[o,r,t,s].join(` +`)};hr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Ue.replaceMain(t,"czm_non_show_main")} +void main() +{ + czm_non_show_main(); + gl_Position *= czm_batchTable_show(batchId); +}`:t};hr._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function qee(e){return`${Ue.replaceMain(e,"czm_non_pick_main")} +out vec4 v_pickColor; +void main() +{ + czm_non_pick_main(); + v_pickColor = czm_batchTable_pickColor(batchId); +}`}function Yee(e){return`in vec4 v_pickColor; +${e}`}hr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};hr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; +`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition(); +`;return o+=` if (czm_sceneMode == czm_sceneMode3D) +`,o+=` { +`,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` } +`,o+=` else +`,o+=` { +`,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` } +`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};hr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Ue.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() +{ + czm_non_distanceDisplayCondition_main(); + vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); + vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); + vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); + float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); +`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); +`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); + vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); + vec4 centerRTE; + if (czm_morphTime == 1.0) + { + centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); + } + else if (czm_morphTime == 0.0) + { + centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); + } + else + { + centerRTE = czm_columbusViewMorph( + czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), + czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), + czm_morphTime); + } +`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; + float distanceSq; + if (czm_sceneMode == czm_sceneMode2D) + { + distanceSq = czm_eyeHeight2D.y - radiusSq; + } + else + { + distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; + } + distanceSq = max(distanceSq, 0.0); + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; + gl_Position *= show; +}`,`${i} +${o}`};function Xee(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",h="";if(i){f+=`vec2 st; +`;let m=s>1?`${c}.x`:c;h+=` st = czm_decompressTextureCoordinates(${m}); +`}n&&o&&r?(f+=`vec3 normal; +vec3 tangent; +vec3 bitangent; +`,h+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); +`):(n&&(f+=`vec3 normal; +`,h+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); +`),o&&(f+=`vec3 tangent; +`,h+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`),r&&(f+=`vec3 bitangent; +`,h+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=Ue.replaceMain(p,"czm_non_compressed_main");let _=`void main() +{ +${h} czm_non_compressed_main(); +}`;return[u,f,p,_].join(` +`)}function COe(e){let t=Ue.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + gl_Position = czm_depthClamp(gl_Position);} +`,t}function AOe(e){let t=Ue.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { + czm_non_depth_clamp_main(); + #if defined(LOG_DEPTH) + czm_writeLogDepth(); + #else + czm_writeDepthClamp(); + #endif +} +`,t}function Kee(e,t){let n=e.vertexAttributes}function EOe(e,t){return function(){return e[t]}}var v6=Math.max(zt.hardwareConcurrency-1,1),DL,SOe=new yi("combineGeometry");function vOe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Ir.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(DL))for(DL=new Array(v6),o=0;o<v6;o++)DL[o]=new yi("createGeometry");let f;for(u=wL(u,v6),o=0;o<u.length;o++){let h=0,p=u[o],_=p.length;for(r=0;r<_;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=h,h+=y(i.constructor.packedLength,i.packedLength));let m;if(h>0){let x=new Float64Array(h);for(m=[x.buffer],r=0;r<_;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,f.offset),f.geometry=x)}c.push(DL[o].scheduleTask({subTasks:u[o]},m))}e._state=Ir.CREATING,Promise.all(c).then(function(h){e._createGeometryResults=h,e._state=Ir.CREATED}).catch(function(h){lv(e,t,Ir.FAILED,h)})}else if(e._state===Ir.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=SOe.scheduleTask(LT.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Ir.COMBINING,Promise.resolve(f).then(function(h){let p=LT.unpackCombineGeometryResults(h);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Ir.COMBINED):lv(e,t,Ir.FAILED,void 0)}).catch(function(h){lv(e,t,Ir.FAILED,h)})}}function wOe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,_;l(p.attributes)&&l(p.primitiveType)?_=xOe(p):_=p.constructor.createGeometry(p),o[c++]=bOe(s,_),r.push(s.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,h=LT.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=F.clone(h.modelMatrix,e.modelMatrix),e._pickOffsets=h.pickOffsets,e._offsetInstanceExtend=h.offsetInstanceExtend,e._instanceBoundingSpheres=h.boundingSpheres,e._instanceBoundingSpheresCV=h.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Ir.COMBINED):lv(e,t,Ir.FAILED,void 0)}function DOe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ae;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],b=e._batchTable.getBatchedAttribute(i,n,new d);x=r[i].clone(x),rte(x,b,o[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||ae.intersectPlane(x,sn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING?c.push(x):(u.push(x),f.push(x))}let h=c[0],p=f[0],_=u[0];for(i=1;i<c.length;i++)h=ae.union(h,c[i]);for(i=1;i<f.length;i++)p=ae.union(p,f[i]);for(i=1;i<u.length;i++)_=ae.union(_,u[i]);let m=[];for(l(h)&&m.push(h),l(p)&&m.push(p),l(_)&&m.push(_),i=0;i<m.length;i++){let x=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=ae.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}hr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Zee=new Hn,nte=new fe,ite=new d,ote=new ae;function IOe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,h=e._batchTable,p=e._instanceBoundingSpheres,_=p.length;for(let m=0;m<_;++m){let x=p[m];if(!l(x))continue;let b=e.modelMatrix;l(b)&&(x=ae.transform(x,b,ote));let T=x.center,C=x.radius,A=Hn.fromCartesian(T,Zee);if(h.setBatchedAttribute(m,o,A.high),h.setBatchedAttribute(m,r,A.low),!t.scene3DOnly){let S=f.cartesianToCartographic(T,nte),v=u.project(S,ite);A=Hn.fromCartesian(v,Zee),h.setBatchedAttribute(m,s,A.high),h.setBatchedAttribute(m,a,A.low)}h.setBatchedAttribute(m,c,C)}e._batchTableBoundingSpheresUpdated=!0}var w6=new d,POe=new d;function $ee(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let h=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(d.equals(h,d.ZERO)){s.setBatchedAttribute(u,i,d.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ae.transform(f,p,ote));let _=f.center;_=r.scaleToGeodeticSurface(_,POe);let m=r.cartesianToCartographic(_,nte),x=o.project(m,ite),b=d.add(h,_,w6);m=r.cartesianToCartographic(b,m);let T=o.project(m,w6),C=d.subtract(T,x,w6),A=C.x;C.x=C.z,C.z=C.y,C.y=A,s.setBatchedAttribute(u,i,C)}e._batchTableOffsetsUpdated=!0}function ROe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(ni.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Fe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ae.clone(u.boundingSphere)),e._boundingSphereWC.push(new ae),!o){let f=u.boundingSphereCV.center,h=f.x,p=f.y,_=f.z;f.x=_,f.y=h,f.z=p,e._boundingSphereCV.push(ae.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ae),e._boundingSphereMorph.push(new ae)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,lv(e,t,Ir.COMPLETE,void 0)}function OOe(e,t,n,i){let o=n.getRenderState(),r;i?(r=Ge(o,!1),r.cull={enabled:!0,face:bi.BACK},e._frontFaceRS=Ve.fromCache(r),r.cull.face=bi.FRONT,e._backFaceRS=Ve.fromCache(r)):(e._frontFaceRS=Ve.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Ge(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Ge(o,!1),r.depthTest.func=wc.GREATER,i?(r.cull={enabled:!0,face:bi.BACK},e._frontFaceDepthFailRS=Ve.fromCache(r),r.cull.face=bi.FRONT,e._backFaceDepthFailRS=Ve.fromCache(r)):(e._frontFaceDepthFailRS=Ve.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function MOe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=hr._appendOffsetToShader(e,r),r=hr._appendShowToShader(e,r),r=hr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=qee(r),r=hr._updateColorAttribute(e,r,!1),r=Xee(e,r),r=hr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Yee(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Kee(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=hr._appendShowToShader(e,r),r=hr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=qee(r),r=hr._updateColorAttribute(e,r,!0),r=Xee(e,r),r=hr._modifyShaderPosition(e,r,t.scene3DOnly),r=COe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=Yee(s),s=AOe(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Kee(e._spDepthFail,o))}var cv=new F,Qee=new d;function Jee(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=EOe(s,c));let a=xt(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return F.multiply(c,e._modelMatrix,cv),F.multiplyByPoint(cv,e.rtcCenter,Qee),F.setTranslation(cv,Qee,cv),cv}),a}function LOe(e,t,n,i,o,r,s,a){let c=Jee(e,t,n,a),u;l(e._depthFailAppearance)&&(u=Jee(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?we.TRANSLUCENT:we.OPAQUE,h=o?2:1;h*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let p=r.length,_=0;for(let m=0;m<p;++m){let x;o&&(x=r[m],l(x)||(x=r[m]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[_],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,++m),x=r[m],l(x)||(x=r[m]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[_],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,l(e._depthFailAppearance)&&(o&&(++m,x=r[m],l(x)||(x=r[m]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[_],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++m,x=r[m],l(x)||(x=r[m]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[_],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++_}}hr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!F.equals(n,e._modelMatrix))for(F.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=ae.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ae.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=ae.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function NOe(e,t,n,i,o,r,s,a){hr._updateBoundingVolumes(e,t,o);let c;t.mode===ne.SCENE3D?c=e._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ne.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let h=e.allowPicking,p=xn.castShadows(e.shadows),_=xn.receiveShadows(e.shadows),m=n.length,x=a?2:1;x*=l(e._depthFailAppearance)?2:1;for(let b=0;b<m;++b){let T=Math.floor(b/x),C=n[b];C.modelMatrix=o,C.boundingVolume=c[T],C.cull=r,C.debugShowBoundingVolume=s,C.castShadows=p,C.receiveShadows=_,h?C.pickId="v_pickColor":C.pickId=void 0,u.push(C)}}}hr.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==ne.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Ir.FAILED)return;let t=e.context;if(l(this._batchTable)||_Oe(this,t),this._batchTable.attributes.length>0){if(Ft.maximumVertexTextureImageUnits===0)throw new re("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Ir.COMPLETE&&this._state!==Ir.COMBINED&&(this.asynchronous?vOe(this,e):wOe(this,e)),this._state===Ir.COMBINED&&(IOe(this,e),$ee(this,e),ROe(this,e)),!this.show||this._state!==Ir.COMPLETE)return;this._batchTableOffsetsUpdated||$ee(this,e),this._recomputeBoundingSpheres&&DOe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&y(this._createRenderStatesFunction,OOe)(this,t,n,u),r&&y(this._createShaderProgramFunction,MOe)(this,e,n),(o||r)&&y(this._createCommandsFunction,LOe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,NOe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var FOe=new ae,BOe=new ae;function rte(e,t,n){if(n===rn.TOP){let i=ae.clone(e,FOe),o=ae.clone(e,BOe);o.center=d.add(o.center,t,o.center),e=ae.union(i,o,e)}else n===rn.ALL&&(e.center=d.add(e.center,t,e.center));return e}function kOe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=X.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function VOe(e,t,n,i,o){return function(r){let s=tte(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var UOe=new d;function zOe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&rte(i,d.fromArray(r.get(),0,UOe),e._offsetInstanceExtend[n]),l(o)&&(i=ae.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function HOe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}hr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:kOe(s,n,f),set:VOe(s,n,f,this,u)}}return zOe(this,c,n),HOe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};hr.prototype.isDestroyed=function(){return!1};hr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function lv(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Ir.COMPLETE||e._state===Ir.FAILED})}var In=hr;function GOe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var Dc=GOe;var uv=`#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +in vec4 v_sphericalExtents; +#else // SPHERICAL +in vec2 v_inversePlaneExtents; +in vec4 v_westPlane; +in vec4 v_southPlane; +#endif // SPHERICAL +in vec3 v_uvMinAndSphericalLongitudeRotation; +in vec3 v_uMaxAndInverseDistance; +in vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES + +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#endif + +#ifdef NORMAL_EC +vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { + vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); + return eyeCoordinate.xyz / eyeCoordinate.w; +} + +vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { + vec2 glFragCoordXY = gl_FragCoord.xy; + // Sample depths at both offset and negative offset + float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); + float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); + // Explicitly evaluate both paths + // Necessary for multifrustum and for edges of the screen + bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); + float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); + float useDownOrLeft = float(useUpOrRight == 0.0); + vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); + vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); + return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; +} +#endif // NORMAL_EC + +void main(void) +{ +#ifdef REQUIRES_EC + float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +#endif + +#ifdef REQUIRES_WC + vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; + vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +#endif + +#ifdef TEXTURE_COORDINATES + vec2 uv; +#ifdef SPHERICAL + // Treat world coords as a sphere normal for spherical coordinates + vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); + sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; + sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); + uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; + uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; +#else // SPHERICAL + // Unpack planes and transform to eye space + uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; + uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; +#endif // SPHERICAL +#endif // TEXTURE_COORDINATES + +#ifdef PICK +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + // Check for logDepthOrDepth != 0.0 to make sure this should be classified. + if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { + out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource + czm_writeDepthClamp(); + } +#else // CULL_FRAGMENTS + out_FragColor.a = 1.0; +#endif // CULL_FRAGMENTS +#else // PICK + +#ifdef CULL_FRAGMENTS + // When classifying translucent geometry, logDepthOrDepth == 0.0 + // indicates a region that should not be classified, possibly due to there + // being opaque pixels there in another buffer. + if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { + discard; + } +#endif + +#ifdef NORMAL_EC + // Compute normal by sampling adjacent pixels in 2x2 block in screen space + vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); + vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); + vec3 normalEC = normalize(cross(leftRight, downUp)); +#endif + + +#ifdef PER_INSTANCE_COLOR + + vec4 color = czm_gammaCorrect(v_color); +#ifdef FLAT + out_FragColor = color; +#else // FLAT + czm_materialInput materialInput; + materialInput.normalEC = normalEC; + materialInput.positionToEyeEC = -eyeCoordinate.xyz; + czm_material material = czm_getDefaultMaterial(materialInput); + material.diffuse = color.rgb; + material.alpha = color.a; + + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + +#else // PER_INSTANCE_COLOR + + // Material support. + // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or + // dependencies for culling but might not actually be used by the material. + + czm_materialInput materialInput; + +#ifdef USES_NORMAL_EC + materialInput.normalEC = normalEC; +#endif + +#ifdef USES_POSITION_TO_EYE_EC + materialInput.positionToEyeEC = -eyeCoordinate.xyz; +#endif + +#ifdef USES_TANGENT_TO_EYE + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +#endif + +#ifdef USES_ST + // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired + // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. + // Shader is provided a set of reference points for remapping. + materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; + materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +#endif + + czm_material material = czm_getMaterial(materialInput); + +#ifdef FLAT + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else // FLAT + out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + +#endif // PER_INSTANCE_COLOR + czm_writeDepthClamp(); +#endif // PICK +} +`;function nf(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new D6;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new D6;if(o.requiresTextureCoordinates=e,n instanceof an)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}nf.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof an&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof an||(o=t.material.shaderSource),new Ue({defines:i,sources:[o,uv]})};nf.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Ue({defines:n,sources:[uv],pickColorQualifier:"in"})};nf.prototype.createVertexShader=function(e,t,n,i){return hte(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};nf.prototype.createPickVertexShader=function(e,t,n,i){return hte(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var ste=new d,ate=new fe,cte={high:0,low:0};function hte(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=ate;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,ste),h=Hn.encode(f.x,cte);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`;let p=ate;p.longitude=-P.PI,p.latitude=0,p.height=0;let _=s.project(p,ste);h=Hn.encode(_.x,cte),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof an&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ue({defines:c,sources:[o]})}function D6(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(D6.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function lte(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/U.distance(t,e)}var WOe=[new U,new U,new U,new U];function mte(e,t){let n=WOe,i=U.unpack(t,0,n[0]),o=U.unpack(t,2,n[1]),r=U.unpack(t,4,n[2]);e.uMaxVmax=new Dc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/lte(i,o,r),a=1/lte(i,r,o);e.uvMinAndExtents=new Dc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var pte=new fe,gte=new d,jOe=new d,qOe=new d,IL={high:0,low:0};function _te(e,t,n){let i=pte;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,gte);i.latitude=e.north;let r=t.project(i,jOe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,qOe),a=[0,0,0,0],c=[0,0,0,0],u=Hn.encode(o.x,IL);a[0]=u.high,c[0]=u.low,u=Hn.encode(o.y,IL),a[1]=u.high,c[1]=u.low,u=Hn.encode(r.y,IL),a[2]=u.high,c[2]=u.low,u=Hn.encode(s.x,IL),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Dc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Dc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var YOe=new F,XOe=new F,ute=new d,KOe=new fe,ZOe=[new fe,new fe,new fe,new fe,new fe,new fe,new fe,new fe];function $Oe(e,t,n,i,o,r){let s=se.center(e,KOe);s.height=n;let a=fe.toCartesian(s,t,ute),c=Ot.eastNorthUpToFixedFrame(a,t,YOe),u=F.inverse(c,XOe),f=e.west,h=e.east,p=e.north,_=e.south,m=ZOe;m[0].latitude=_,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=h,m[3].latitude=_,m[3].longitude=h;let x=(f+h)*.5,b=(p+_)*.5;m[4].latitude=_,m[4].longitude=x,m[5].latitude=p,m[5].longitude=x,m[6].latitude=b,m[6].longitude=f,m[7].latitude=b,m[7].longitude=h;let T=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let M=fe.toCartesian(m[R],t,ute);F.multiplyByPoint(u,M,M),M.z=0,T=Math.min(T,M.x),C=Math.max(C,M.x),A=Math.min(A,M.y),S=Math.max(S,M.y)}let v=i;v.x=T,v.y=A,v.z=0,F.multiplyByPoint(c,v,v);let D=o;D.x=C,D.y=A,D.z=0,F.multiplyByPoint(c,D,D),d.subtract(D,v,o);let O=r;O.x=T,O.y=S,O.z=0,F.multiplyByPoint(c,O,O),d.subtract(O,v,r)}var QOe=new d,JOe=new d,eMe=new Hn;nf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=gte,s=QOe,a=JOe;$Oe(e,n,y(o,0),r,s,a);let c={};mte(c,t);let u=Hn.fromCartesian(r,eMe);return c.southWest_HIGH=new Dc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.high,[0,0,0])}),c.southWest_LOW=new Dc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.low,[0,0,0])}),c.eastward=new Dc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(s,[0,0,0])}),c.northward=new Dc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(a,[0,0,0])}),_te(e,i,c),c};var tMe=new d;function fte(e,t,n,i){let o=pte;o.latitude=e,o.longitude=t,o.height=0;let r=fe.toCartesian(o,n,tMe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=P.fastApproximateAtan2(s,r.z),c=P.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var dte=new U;nf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=fte(e.south,e.west,n,dte),r=o.x,s=o.y,a=fte(e.north,e.east,n,dte),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),r-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let h=1/(u-s),p=1/(c-r),_={sphericalExtents:new Dc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new Dc({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return mte(_,t),_te(e,i,_),_};nf.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};nf.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function nMe(e){return Math.max(e.width,e.height)>nf.MAX_WIDTH_FOR_PLANAR_EXTENTS}nf.shouldUseSphericalCoordinates=function(e){return nMe(e)};nf.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var of=nf;var iMe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Vn=Object.freeze(iMe);var oMe={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},ut=Object.freeze(oMe);var PL={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};PL.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Vn.ALWAYS,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.REPLACE},backFunction:Vn.ALWAYS,backOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.REPLACE},reference:PL.CESIUM_3D_TILE_MASK,mask:PL.CESIUM_3D_TILE_MASK}};var Vt=Object.freeze(PL);function G0(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(G0.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});G0.isSupported=function(e){return e.context.stencilBuffer};function NT(e,t){let n=t?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ut.KEEP,zFail:ut.DECREMENT_WRAP,zPass:ut.KEEP},backFunction:n,backOperation:{fail:ut.KEEP,zFail:ut.INCREMENT_WRAP,zPass:ut.KEEP},reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},depthMask:!1}}function P6(e){return{stencilTest:{enabled:e,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND}}var rMe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function sMe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(NT(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(NT(o,!0)),e._rsColorPass=Ve.fromCache(P6(o,!1)),e._rsPickPass=Ve.fromCache(rMe)}function aMe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; +`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Ue.replaceMain(s,"czm_non_compressed_main");let a=`void main() +{ +${r} czm_non_compressed_main(); +}`;return[i,o,s,a].join(` +`)}}function cMe(e,t){let n=t.context,i=e._primitive,o=vL;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=aMe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ue({defines:[a],sources:[o]}),u=new Ue({sources:[H0]}),f=e._primitive._attributeLocations,h=new of(s,r,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Ue.createPickVertexShaderSource(o);m=In._appendShowToShader(i,m),m=In._updatePickColorAttribute(m);let x=h.createPickFragmentShader(!1),b=h.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f}),s){let T=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(T)){let C=h.createPickFragmentShader(!0),A=h.createPickVertexShader([a],m,!0,t.mapProjection);T=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:A,fragmentShaderSource:C,attributeLocations:f})}e._spPick2D=T}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=In._appendShowToShader(i,o),c=new Ue({defines:[a],sources:[o]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=h.createFragmentShader(!1),_=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:_,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let x=h.createFragmentShader(!0),b=h.createVertexShader([a],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f})}e._spColor2D=m}}function lMe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let _=n._va[a++];r=t[o],l(r)||(r=t[o]=new $e({owner:e,primitiveType:n._primitiveType})),r.vertexArray=_,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=we.TERRAIN_CLASSIFICATION,s=$e.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=we.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new $e({owner:e,primitiveType:n._primitiveType})),r.vertexArray=_,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=we.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=xt(c,x._uniforms)),r.uniformMap=c,s=$e.shallowClone(r,r.derivedCommands.tileset),s.pass=we.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let b=$e.shallowClone(r,r.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=b,b=$e.shallowClone(s,s.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b}}let f=e._commandsIgnoreShow,h=e._spStencil,p=0;i=f.length=i/2;for(let _=0;_<i;++_){let m=f[_]=$e.shallowClone(t[p],f[_]);m.shaderProgram=h,m.pass=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function uMe(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,u,f,h=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),_=e._needs2DShader;for(c=0;c<o;c+=2){let m=i._va[h++];if(n&&(a=r[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=we.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=$e.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=we.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=we.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=$e.shallowClone(u,u.derivedCommands.tileset),f.pass=we.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,_){let x=$e.shallowClone(u,u.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x,x=$e.shallowClone(f,f.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=x}}}function fMe(e,t,n,i,o,r,s){lMe(e,r),uMe(e,s)}function yte(e,t){return Math.floor(e%t/2)}function I6(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function xte(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function dMe(e,t,n,i,o,r,s,a){let c=e._primitive;In._updateBoundingVolumes(c,t,o);let u;t.mode===ne.SCENE3D?u=c._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===ne.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,h=f!==kn.CESIUM_3D_TILE,p=f!==kn.TERRAIN,_=t.passes,m,x,b;if(_.render){let T=n.length;for(m=0;m<T;++m)x=u[yte(m,T)],h&&(b=n[m],I6(b,t,o,r,x,s)),p&&(b=n[m].derivedCommands.tileset,I6(b,t,o,r,x,s));if(t.invertClassification){let C=e._commandsIgnoreShow,A=C.length;for(m=0;m<A;++m)x=u[m],b=C[m],I6(b,t,o,r,x,s)}}if(_.pick){let T=i.length,C=c._pickOffsets;for(m=0;m<T;++m){let A=C[yte(m,T)];x=u[A.index],h&&(b=i[m],xte(b,t,o,r,x)),p&&(b=i[m].derivedCommands.tileset,xte(b,t,o,r,x))}}}G0.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,u=!1,f=!0,h,p=!1,_=!1;for(r>0&&(c=o[0].attributes,p=of.hasAttributesForSphericalExtents(c),_=of.hasAttributesForTextureCoordinatePlanes(c),h=c.color),s=0;s<r;s++){a=o[s];let x=a.attributes.color;l(x)&&(u=!0),f=f&&l(x)&&Gt.equals(h,x)}if(!f&&!p&&!_)throw new he("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new an({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!_,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=_,this._hasPerColorAttribute=u;let m=new Array(r);for(s=0;s<r;++s)a=o[s],m[s]=new vt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,b){n._createBoundingVolumeFunction(x,b)}),i._createRenderStatesFunction=function(x,b,T,C){sMe(n,b)},i._createShaderProgramFunction=function(x,b,T){cMe(n,b)},i._createCommandsFunction=function(x,b,T,C,A,S,v){fMe(n,void 0,void 0,!0,!1,S,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,b,T,C,A,S,v,D){n._updateAndQueueCommandsFunction(x,b,T,C,A,S,v,D)}:i._updateAndQueueCommandsFunction=function(x,b,T,C,A,S,v,D){dMe(n,b,T,C,A,S,v,D)},this._primitive=new In(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(NT(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(NT(!1,!0)),this._rsColorPass=Ve.fromCache(P6(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(NT(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(NT(!0,!0)),this._rsColorPass=Ve.fromCache(P6(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};G0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};G0.prototype.isDestroyed=function(){return!1};G0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var fv=G0;var hMe={u_globeMinimumAltitude:function(){return 55e3}};function pl(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(l(a)&&l(a.color)){t=new an({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=ui._defaultMaxTerrainHeight,this._minTerrainHeight=ui._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:hMe}}Object.defineProperties(pl.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});pl.isSupported=fv.isSupported;function bte(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Tte(e){return function(t,n){return e._minHeight}}var mMe=new d,pMe=new d,gMe=new d,_Me=new fe,yMe=new se;function RL(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let p=d.unpack(i,h,mMe),_=d.unpack(o,h,pMe),m=d.add(p,_,gMe),x=n.cartesianToCartographic(m,_Me),b=x.latitude,T=x.longitude;s=Math.min(s,b),a=Math.min(a,T),c=Math.max(c,b),u=Math.max(u,T)}let f=yMe;return f.north=c,f.south=s,f.east=u,f.west=a,f}function xMe(e,t,n){let i=ui.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function bMe(e,t,n){let i=t.mapProjection.ellipsoid,o=RL(t,n),r=wn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=ae.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);d.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function R6(e,t){return Math.floor(e%t/2)}function O6(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Cte(e,t,n,i,o,r){let s=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function TMe(e,t,n,i,o,r,s,a){let c;t.mode===ne.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==kn.CESIUM_3D_TILE,h=u!==kn.TERRAIN,p=t.passes,_=e._primitive,m,x,b;if(p.render){let T=n.length;for(m=0;m<T;++m)x=c[R6(m,T)],f&&(b=n[m],O6(e,b,t,o,r,x,s)),h&&(b=n[m].derivedCommands.tileset,O6(e,b,t,o,r,x,s));if(t.invertClassification){let C=_._commandsIgnoreShow,A=C.length;for(m=0;m<A;++m)x=c[m],b=C[m],O6(e,b,t,o,r,x,s)}}if(p.pick){let T=i.length,C;for(e._useFragmentCulling||(C=_._primitive._pickOffsets),m=0;m<T;++m){if(x=c[R6(m,T)],!e._useFragmentCulling){let A=C[R6(m,T)];x=c[A.index]}f&&(b=i[m],Cte(e,b,t,o,r,x)),h&&(b=i[m].derivedCommands.tileset,Cte(e,b,t,o,r,x))}}}pl.initializeTerrainHeights=function(){return ui.initialize()};pl.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!ui.initialized){pl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,h;for(f=0;f<c;++f){o=a[f],r=o.geometry;let x=RL(e,r);l(h)?l(x)&&se.union(h,x,h):h=se.clone(x);let b=o.id;if(l(b)&&l(x)){let T=ui.getBoundingSphere(x,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(T)}s=r.constructor,!l(s)||l(s.createShadowVolume)}xMe(this,h,i);let p=e.verticalExaggeration,_=e.verticalExaggerationRelativeHeight;this._minHeight=Dr.getHeight(this._minTerrainHeight,p,_),this._maxHeight=Dr.getHeight(this._maxTerrainHeight,p,_);let m=pl._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let x,b=!0;for(f=0;f<c;++f)if(o=a[f],r=o.geometry,h=RL(e,r),of.shouldUseSphericalCoordinates(h)){b=!1;break}for(f=0;f<c;++f){o=a[f],r=o.geometry,s=r.constructor;let T=RL(e,r),C=r.textureCoordinateRotationPoints;b?x=of.getPlanarTextureCoordinateAttributes(T,C,i,e.mapProjection,this._maxHeight):x=of.getSphericalExtentGeometryInstanceAttributes(T,C,i,e.mapProjection);let A=o.attributes;for(let S in A)A.hasOwnProperty(S)&&(x[S]=A[S]);u[f]=new vt({geometry:s.createShadowVolume(r,Tte(this),bte(this)),attributes:x,id:o.id})}}else for(f=0;f<c;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new vt({geometry:s.createShadowVolume(r,Tte(this),bte(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,b){bMe(t,x,b)},n._updateAndQueueCommandsFunction=function(x,b,T,C,A,S,v,D){TMe(t,b,T,C,A,S,v,D)},this._primitive=new fv(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};pl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};pl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};pl.prototype.isDestroyed=function(){return!1};pl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};pl._supportsMaterials=function(e){return e.depthTexture};pl.supportsMaterials=function(e){return pl._supportsMaterials(e.frameState.context)};var gl=pl;function FT(){he.throwInstantiationError()}Object.defineProperties(FT.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});FT.prototype.getType=he.throwInstantiationError;FT.prototype.getValue=he.throwInstantiationError;FT.prototype.equals=he.throwInstantiationError;var CMe=new Z;FT.getValue=function(e,t,n){let i;return l(e)||(e=Z.now(CMe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Yi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Yi.ColorType)&&(n=Yi.fromType(Yi.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var ir=FT;function W0(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}W0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!q.getValueOrDefault(t.show,n,!0)};W0.prototype._setOptions=he.throwInstantiationError;W0.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Ut,h,p=t._getIsClosed(c);if(f)h=new an({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let _=ir.getValue(e,u,this._material);this._material=_,h=new ao({material:_,translucent:_.isTranslucent(),closed:p})}if(n)c.vertexFormat=an.VERTEX_FORMAT,this._primitive=o.add(new gl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),q.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=h.vertexFormat;let _=this._geometryUpdater.createFillGeometryInstance(e);f&&(h.translucent=_.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:_,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=q.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:u,appearance:new an({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};W0.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),at.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),at.DONE):l(n)&&!n.ready||l(i)&&!i.ready?at.PENDING:at.FAILED};W0.prototype.isDestroyed=function(){return!1};W0.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ii=W0;var AMe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Xg=Object.freeze(AMe);var EMe={NONE:0,GEODESIC:1,RHUMB:2},Jt=Object.freeze(EMe);var Ate=P.EPSILON10;function SMe(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,u,f=0,h=-1;for(s=1;s<r;++s)c=e[s],t(a,c,Ate)?(l(u)||(u=e.slice(0,s),f=s-1,h=0),o&&i.push(s)):(l(u)&&(u.push(c),f=s,o&&(h=i.length)),a=c);return n&&t(e[0],e[r-1],Ate)&&(o&&(l(u)?i.splice(h,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var bo=SMe;function vMe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,r),h=c*s,p=h*h,_=1-p,m=Math.sqrt(_),x=t/4,b=x*x,T=b*x,C=b*b,A=1+x-3*b/4+5*T/4-175*C/64,S=1-x+15*b/8-35*T/8,v=1-3*x+35*b/4,D=1-5*x,O=A*f-S*Math.sin(2*f)*x/2-v*Math.sin(4*f)*b/16-D*Math.sin(6*f)*T/48-Math.sin(8*f)*5*C/512,R=e._constants;R.a=n,R.b=i,R.f=o,R.cosineHeading=r,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=h,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=_,R.cosineAlpha=m,R.u2Over4=x,R.u4Over16=b,R.u6Over64=T,R.u8Over256=C,R.a0=A,R.a1=S,R.a2=v,R.a3=D,R.distanceRatio=O}function wMe(e,t){return e*t*(4+e*(4-3*t))/16}function Ete(e,t,n,i,o,r,s){let a=wMe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function DMe(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),h=Math.cos(u),p=Math.sin(u),_=Math.cos(f),m=Math.sin(f),x=h*_,b=h*m,T=p*m,C=p*_,A=c,S=P.TWO_PI,v=Math.cos(A),D=Math.sin(A),O,R,M,L,g;do{v=Math.cos(A),D=Math.sin(A);let k=b-C*v;M=Math.sqrt(_*_*D*D+k*k),R=T+x*v,O=Math.atan2(M,R);let W;M===0?(W=0,L=1):(W=x*D/M,L=1-W*W),S=A,g=R-2*T/L,isFinite(g)||(g=0),A=c+Ete(a,W,L,O,M,R,g)}while(Math.abs(A-S)>P.EPSILON12);let E=L*(t*t-n*n)/(n*n),w=1+E*(4096+E*(E*(320-175*E)-768))/16384,I=E*(256+E*(E*(74-47*E)-128))/1024,N=g*g,B=I*M*(g+I*(R*(2*N-1)-I*g*(4*M*M-3)*(4*N-3)/6)/4),H=n*w*(O-B),V=Math.atan2(_*D,b-C*v),G=Math.atan2(h*D,b*v-C);e._distance=H,e._startHeading=V,e._endHeading=G,e._uSquared=E}var IMe=new d,M6=new d;function Ste(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,M6),IMe),r=d.normalize(i.cartographicToCartesian(n,M6),M6);DMe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=fe.clone(t,e._start),e._end=fe.clone(n,e._end),e._start.height=0,e._end.height=0,vMe(e)}function dv(e,t,n){let i=y(n,ee.default);this._ellipsoid=i,this._start=new fe,this._end=new fe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Ste(this,e,t,i)}Object.defineProperties(dv.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});dv.prototype.setEndPoints=function(e,t){Ste(this,e,t,this._ellipsoid)};dv.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};dv.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),h=i*i,p=i*h,_=n.u8Over256,m=n.u2Over4,x=n.u6Over64,b=n.u4Over16,T=2*p*_*o/3+i*(1-m+7*b/4-15*x/4+579*_/64-(b-15*x/4+187*_/16)*o-(5*x/4-115*_/16)*r-29*_*s/16)+(m/2-b+71*x/32-85*_/16)*a+(5*b/16-5*x/4+383*_/96)*c-h*((x-11*_/2)*a+5*_*c/2)+(29*x/96-29*_/16)*u+539*_*f/1536,C=Math.asin(Math.sin(T)*n.cosineAlpha),A=Math.atan(n.a/n.b*Math.tan(C));T=T-n.sigma;let S=Math.cos(2*n.sigma+T),v=Math.sin(T),D=Math.cos(T),O=n.cosineU*D,R=n.sineU*v,L=Math.atan2(v*n.sineHeading,O-R*n.cosineHeading)-Ete(n.f,n.sineAlpha,n.cosineSquaredAlpha,T,v,D,S);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=A,t.height=0,t):new fe(this._start.longitude+L,A,0)};var Kg=dv;function N6(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),h=Math.sin(4*u),p=Math.sin(6*u),_=Math.sin(8*u),m=Math.sin(10*u),x=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*_-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*x)}function PMe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,u=c*c,f=u*c,h=f*c,p=h*c,_=p*c,m=Math.sin(2*i),x=Math.cos(2*i),b=Math.sin(4*i),T=Math.cos(4*i),C=Math.sin(6*i),A=Math.cos(6*i),S=Math.sin(8*i),v=Math.cos(8*i),D=Math.sin(10*i),O=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*h/16384+1515*i*p/65536+16837*i*_/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*_/5242880)*x+(21*i*f/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*_/1048576)*T+(151*i*h/4096+4681*i*p/65536+1479*i*_/16384-453*r*_/32768)*A+(1097*i*p/65536+42783*i*_/1048576)*v+8011*i*_/1048576*O+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*h/4096-33*o*h/512+20861*p/524288-33*o*p/512+s*p/1024+28273*_/1048576-471*o*_/8192+9*s*_/4096)*m+(21*u/256+21*f/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*_/16777216-12517*o*_/131072+7*s*_/2048)*b+(151*f/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*_/786432-8607*o*_/131072)*C+(1097*h/131072+1097*p/65536+225797*_/10485760-1097*o*_/65536)*S+(8011*p/2621440+8011*_/1048576)*D+293393*_/251658240*R}function BT(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function RMe(e,t,n,i,o){let r=BT(e._ellipticity,n),s=BT(e._ellipticity,o);return Math.atan2(P.negativePiToPi(i-t),s-r)}function OMe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(o)*P.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=N6(e._ellipticity,t,o);u=(N6(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var MMe=new d,L6=new d;function vte(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,L6),MMe),r=d.normalize(i.cartographicToCartesian(n,L6),L6),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=fe.clone(t,e._start),e._start.height=0,e._end=fe.clone(n,e._end),e._end.height=0,e._heading=RMe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=OMe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function wte(e,t,n,i,o,r){if(n===0)return fe.clone(e,r);let s=o*o,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=N6(o,i,e.latitude),h=n*Math.cos(t),p=f+h;if(c=PMe(p,o,i),Math.abs(t)<P.EPSILON10)a=P.negativePiToPi(e.longitude);else{let _=BT(o,e.latitude),m=BT(o,c);u=Math.tan(t)*(m-_),a=P.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*h*h)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new fe(a,c,0)}function dp(e,t,n){let i=y(n,ee.default);this._ellipsoid=i,this._start=new fe,this._end=new fe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&vte(this,e,t,i)}Object.defineProperties(dp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});dp.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,ee.default),s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let h=wte(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new dp(e,h,r):(o.setEndPoints(e,h),o)};dp.prototype.setEndPoints=function(e,t){vte(this,e,t,this._ellipsoid)};dp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};dp.prototype.interpolateUsingSurfaceDistance=function(e,t){return wte(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};dp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(r.longitude)*Math.PI),l(t)||(t=new fe),Math.abs(P.PI_OVER_TWO-o)<=P.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-o),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,r.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,h;do{h=f;let p=n*Math.sin(h),_=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(_/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,h,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};dp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let r=BT(n,o.latitude),s=BT(n,e),a=Math.tan(i)*(s-r),c=P.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new fe(c,e,0)};var Xa=dp;var G6=[Pi,Mi],LMe=G6.length,Yte=Math.cos(P.toRadians(30)),Dte=Math.cos(P.toRadians(150)),Xte=0,Kte=1e3;function $g(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,Jt.GEODESIC),this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties($g.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});$g.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<LMe;i++)if(t instanceof G6[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var NMe=new d,Ite=new d,Pte=new d;function H6(e,t,n,i,o){let r=Ic(i,e,0,NMe),s=Ic(i,e,n,Ite),a=Ic(i,t,0,Pte),c=hp(s,r,Ite),u=hp(a,r,Pte);return d.cross(u,c,o),d.normalize(o,o)}var FMe=new fe,BMe=new d,kMe=new d,VMe=new d;function F6(e,t,n,i,o,r,s,a,c,u,f){if(o===0)return;let h;r===Jt.GEODESIC?h=new Kg(e,t,s):r===Jt.RHUMB&&(h=new Xa(e,t,s));let p=h.surfaceDistance;if(p<o)return;let _=H6(e,t,i,s,VMe),m=Math.ceil(p/o),x=p/m,b=x,T=m-1,C=a.length;for(let A=0;A<T;A++){let S=h.interpolateUsingSurfaceDistance(b,FMe),v=Ic(s,S,n,BMe),D=Ic(s,S,i,kMe);d.pack(_,a,C),d.pack(v,c,C),d.pack(D,u,C),f.push(S.latitude),f.push(S.longitude),C+=3,b+=x}}var B6=new fe;function Ic(e,t,n,i){return fe.clone(t,B6),B6.height=n,fe.toCartesian(B6,e,i)}$g.pack=function(e,t,n){let i=y(n,0),o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];d.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ee.pack(e._ellipsoid,t,i),i+=ee.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};$g.unpack=function(e,t,n){let i=y(t,0),o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=d.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=ee.unpack(e,i);i+=ee.packedLength;let f=e[i++],h=e[i++]===1;return l(n)||(n=new $g({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=h,n};function hp(e,t,n){return d.subtract(e,t,n),d.normalize(n,n),n}function Rte(e,t,n,i){return i=hp(e,t,i),i=d.cross(i,n,i),i=d.normalize(i,i),i=d.cross(n,i,i),i}var UMe=new d,zMe=new d,HMe=new d,Zte=new d,GMe=0,WMe=-1;function k6(e,t,n,i,o){let r=hp(n,t,Zte),s=Rte(e,t,r,UMe),a=Rte(i,t,r,zMe);if(P.equalsEpsilon(d.dot(s,a),WMe,P.EPSILON5))return o=d.cross(r,s,o),o=d.normalize(o,o),o;o=d.add(a,s,o),o=d.normalize(o,o);let c=d.cross(r,o,HMe);return d.dot(a,c)<GMe&&(o=d.negate(o,o)),o}var NL=sn.fromPointNormal(d.ZERO,d.UNIT_Y),jMe=new d,qMe=new d,YMe=new d,XMe=new d,KMe=new d,OL=new d,ML=new fe,Ote=new fe,Mte=new fe;$g.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new G6[e._projectionIndex](i),a=Xte,c=Kte,u,f,h=e._positions,p=h.length;p===2&&(n=!1);let _,m,x,b,T=new Xa(void 0,void 0,i),C,A,S,v=[h[0]];for(f=0;f<p-1;f++)_=h[f],m=h[f+1],C=Qn.lineSegmentPlane(_,m,NL,OL),l(C)&&!d.equalsEpsilon(C,_,P.EPSILON7)&&!d.equalsEpsilon(C,m,P.EPSILON7)&&(e.arcType===Jt.GEODESIC?v.push(d.clone(C)):e.arcType===Jt.RHUMB&&(S=i.cartesianToCartographic(C,ML).longitude,x=i.cartesianToCartographic(_,ML),b=i.cartesianToCartographic(m,Ote),T.setEndPoints(x,b),A=T.findIntersectionWithLongitude(S,Mte),C=i.cartographicToCartesian(A,OL),l(C)&&!d.equalsEpsilon(C,_,P.EPSILON7)&&!d.equalsEpsilon(C,m,P.EPSILON7)&&v.push(d.clone(C)))),v.push(m);n&&(_=h[p-1],m=h[0],C=Qn.lineSegmentPlane(_,m,NL,OL),l(C)&&!d.equalsEpsilon(C,_,P.EPSILON7)&&!d.equalsEpsilon(C,m,P.EPSILON7)&&(e.arcType===Jt.GEODESIC?v.push(d.clone(C)):e.arcType===Jt.RHUMB&&(S=i.cartesianToCartographic(C,ML).longitude,x=i.cartesianToCartographic(_,ML),b=i.cartesianToCartographic(m,Ote),T.setEndPoints(x,b),A=T.findIntersectionWithLongitude(S,Mte),C=i.cartographicToCartesian(A,OL),l(C)&&!d.equalsEpsilon(C,_,P.EPSILON7)&&!d.equalsEpsilon(C,m,P.EPSILON7)&&v.push(d.clone(C)))));let D=v.length,O=new Array(D);for(f=0;f<D;f++){let Y=fe.fromCartesian(v[f],i);Y.height=0,O[f]=Y}if(O=bo(O,fe.equalsEpsilon),D=O.length,D<2)return;let R=[],M=[],L=[],g=[],E=jMe,w=qMe,I=YMe,N=XMe,B=KMe,H=O[0],V=O[1],G=O[D-1];for(E=Ic(i,G,a,E),N=Ic(i,V,a,N),w=Ic(i,H,a,w),I=Ic(i,H,c,I),n?B=k6(E,w,I,N,B):B=H6(H,V,c,i,B),d.pack(B,M,0),d.pack(w,L,0),d.pack(I,g,0),R.push(H.latitude),R.push(H.longitude),F6(H,V,a,c,o,r,i,M,L,g,R),f=1;f<D-1;++f){E=d.clone(w,E),w=d.clone(N,w);let Y=O[f];Ic(i,Y,c,I),Ic(i,O[f+1],a,N),k6(E,w,I,N,B),u=M.length,d.pack(B,M,u),d.pack(w,L,u),d.pack(I,g,u),R.push(Y.latitude),R.push(Y.longitude),F6(O[f],O[f+1],a,c,o,r,i,M,L,g,R)}let k=O[D-1],W=O[D-2];if(w=Ic(i,k,a,w),I=Ic(i,k,c,I),n){let Y=O[0];E=Ic(i,W,a,E),N=Ic(i,Y,a,N),B=k6(E,w,I,N,B)}else B=H6(W,k,c,i,B);if(u=M.length,d.pack(B,M,u),d.pack(w,L,u),d.pack(I,g,u),R.push(k.latitude),R.push(k.longitude),n){for(F6(k,H,a,c,o,r,i,M,L,g,R),u=M.length,f=0;f<3;++f)M[u+f]=M[f],L[u+f]=L[f],g[u+f]=g[f];R.push(H.latitude),R.push(H.longitude)}return TLe(n,s,L,g,M,R,t)};var ZMe=new d,$Me=new $,QMe=new Oe;function Lte(e,t,n,i){let o=hp(n,t,ZMe),r=d.dot(o,e);if(r>Yte||r<Dte){let s=hp(i,n,Zte),a=r<Dte?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Oe.fromAxisAngle(s,a,QMe),u=$.fromQuaternion(c,$Me);return $.multiplyByVector(u,e,e),!0}return!1}var Nte=new fe,JMe=new d,Fte=new d;function hv(e,t,n,i,o){let r=fe.toCartesian(t,e._ellipsoid,JMe),s=d.add(r,n,Fte),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,Nte);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=d.subtract(r,n,Fte),u=c.cartesianToCartographic(s,Nte)),u.height=0;let f=e.project(u,o);return o=d.subtract(f,i,o),o.z=0,o=d.normalize(o,o),a&&d.negate(o,o),o}var eLe=new d,Bte=new d;function kte(e,t,n,i,o,r){let s=d.subtract(t,e,eLe);d.normalize(s,s);let a=n-Xte,c=d.multiplyByScalar(s,a,Bte);d.add(e,c,o);let u=i-Kte;c=d.multiplyByScalar(s,u,Bte),d.add(t,c,r)}var tLe=new d;function LL(e,t){let n=sn.getPointDistance(NL,e),i=sn.getPointDistance(NL,t),o=tLe;P.equalsEpsilon(n,0,P.EPSILON2)?(o=hp(t,e,o),d.multiplyByScalar(o,P.EPSILON2,o),d.add(e,o,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(o=hp(e,t,o),d.multiplyByScalar(o,P.EPSILON2,o),d.add(t,o,t))}function nLe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let o=P.sign(t.longitude);return e.longitude=o*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let o=P.sign(e.longitude);return t.longitude=o*(i-P.EPSILON11),2}return 0}var $te=new fe,Qte=new fe,Vte=new d,V6=new d,Ute=new d,zte=new d,iLe=new d,Hte=new d,oLe=[$te,Qte],rLe=new se,sLe=new d,aLe=new d,cLe=new d,lLe=new d,uLe=new d,fLe=new d,U6=new d,z6=new d,dLe=new d,hLe=new d,mLe=new d,Gte=new d,pLe=new d,gLe=new d,_Le=new Hn,yLe=new Hn,Wte=new d,xLe=new d,jte=new d,bLe=[new ae,new ae],Jte=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],qte=Jte.length;function TLe(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,f=n.length/3-1,h=f*8,p=h*4,_=f*36,m=h>65535?new Uint32Array(_):new Uint16Array(_),x=new Float64Array(h*3),b=new Float32Array(p),T=new Float32Array(p),C=new Float32Array(p),A=new Float32Array(p),S=new Float32Array(p),v,D,O,R;s&&(v=new Float32Array(p),D=new Float32Array(p),O=new Float32Array(p),R=new Float32Array(h*2));let M=r.length/2,L=0,g=$te;g.height=0;let E=Qte;E.height=0;let w=Vte,I=V6;if(s)for(c=0,a=1;a<M;a++)g.latitude=r[c],g.longitude=r[c+1],E.latitude=r[c+2],E.longitude=r[c+3],w=t.project(g,w),I=t.project(E,I),L+=d.distance(w,I),c+=2;let N=i.length/3;I=d.unpack(i,0,I);let B=0;for(c=3,a=1;a<N;a++)w=d.clone(I,w),I=d.unpack(i,c,I),B+=d.distance(w,I),c+=3;let H;c=3;let V=0,G=0,k=0,W=0,Y=!1,J=d.unpack(n,0,zte),j=d.unpack(i,0,V6),K=d.unpack(o,0,Hte);if(e){let Ae=d.unpack(n,n.length-6,Ute);Lte(K,Ae,J,j)&&(K=d.negate(K,K))}let Q=0,de=0,xe=0;for(a=0;a<f;a++){let Ae=d.clone(J,Ute),ke=d.clone(j,Vte),ze=d.clone(K,iLe);Y&&(ze=d.negate(ze,ze)),J=d.unpack(n,c,zte),j=d.unpack(i,c,V6),K=d.unpack(o,c,Hte),Y=Lte(K,Ae,J,j),g.latitude=r[V],g.longitude=r[V+1],E.latitude=r[V+2],E.longitude=r[V+3];let et,Et,ht,Be;if(s){let fi=nLe(g,E);et=t.project(g,uLe),Et=t.project(E,fLe);let Xs=hp(Et,et,Wte);Xs.y=Math.abs(Xs.y),ht=U6,Be=z6,fi===0||d.dot(Xs,d.UNIT_Y)>Yte?(ht=hv(t,g,ze,et,U6),Be=hv(t,E,K,Et,z6)):fi===1?(Be=hv(t,E,K,Et,z6),ht.x=0,ht.y=P.sign(g.longitude-Math.abs(E.longitude)),ht.z=0):(ht=hv(t,g,ze,et,U6),Be.x=0,Be.y=P.sign(g.longitude-E.longitude),Be.z=0)}let qt=d.distance(ke,j),Tt=Hn.fromCartesian(Ae,_Le),lt=d.subtract(J,Ae,dLe),Wn=d.normalize(lt,Gte),on=d.subtract(ke,Ae,hLe);on=d.normalize(on,on);let me=d.cross(Wn,on,Gte);me=d.normalize(me,me);let Ce=d.cross(on,ze,pLe);Ce=d.normalize(Ce,Ce);let hn=d.subtract(j,J,mLe);hn=d.normalize(hn,hn);let ft=d.cross(K,hn,gLe);ft=d.normalize(ft,ft);let to=qt/B,Eo=Q/B,Ys=0,Cr,hs,Le,it=0,je=0;if(s){Ys=d.distance(et,Et),Cr=Hn.fromCartesian(et,yLe),hs=d.subtract(Et,et,Wte),Le=d.normalize(hs,xLe);let fi=Le.x;Le.x=Le.y,Le.y=-fi,it=Ys/L,je=de/L}for(H=0;H<8;H++){let fi=W+H*4,Xs=G+H*2,kr=fi+3,ol=H<4?1:-1,po=H===2||H===3||H===6||H===7?1:-1;d.pack(Tt.high,b,fi),b[kr]=lt.x,d.pack(Tt.low,T,fi),T[kr]=lt.y,d.pack(Ce,C,fi),C[kr]=lt.z,d.pack(ft,A,fi),A[kr]=to*ol,d.pack(me,S,fi);let Ar=Eo*po;Ar===0&&po<0&&(Ar=9),S[kr]=Ar,s&&(v[fi]=Cr.high.x,v[fi+1]=Cr.high.y,v[fi+2]=Cr.low.x,v[fi+3]=Cr.low.y,O[fi]=-ht.y,O[fi+1]=ht.x,O[fi+2]=Be.y,O[fi+3]=-Be.x,D[fi]=hs.x,D[fi+1]=hs.y,D[fi+2]=Le.x,D[fi+3]=Le.y,R[Xs]=it*ol,Ar=je*po,Ar===0&&po<0&&(Ar=9),R[Xs+1]=Ar)}let Xe=cLe,dt=lLe,Ht=sLe,_n=aLe,So=se.fromCartographicArray(oLe,rLe),yo=ui.getMinimumMaximumHeights(So,u),Na=yo.minimumTerrainHeight,Fa=yo.maximumTerrainHeight;xe+=Math.abs(Na),xe+=Math.abs(Fa),kte(Ae,ke,Na,Fa,Xe,Ht),kte(J,j,Na,Fa,dt,_n);let _i=d.multiplyByScalar(me,P.EPSILON5,jte);d.add(Xe,_i,Xe),d.add(dt,_i,dt),d.add(Ht,_i,Ht),d.add(_n,_i,_n),LL(Xe,dt),LL(Ht,_n),d.pack(Xe,x,k),d.pack(dt,x,k+3),d.pack(_n,x,k+6),d.pack(Ht,x,k+9),_i=d.multiplyByScalar(me,-2*P.EPSILON5,jte),d.add(Xe,_i,Xe),d.add(dt,_i,dt),d.add(Ht,_i,Ht),d.add(_n,_i,_n),LL(Xe,dt),LL(Ht,_n),d.pack(Xe,x,k+12),d.pack(dt,x,k+15),d.pack(_n,x,k+18),d.pack(Ht,x,k+21),V+=2,c+=3,G+=16,k+=24,W+=32,Q+=qt,de+=Ys}c=0;let ce=0;for(a=0;a<f;a++){for(H=0;H<qte;H++)m[c+H]=Jte[H]+ce;ce+=8,c+=qte}let _e=bLe;ae.fromVertices(n,d.ZERO,3,_e[0]),ae.fromVertices(i,d.ZERO,3,_e[1]);let be=ae.fromBoundingSpheres(_e);be.radius+=xe/(f*2);let De={position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:Zg(b),startLoAndForwardOffsetY:Zg(T),startNormalAndForwardOffsetZ:Zg(C),endNormalAndTextureCoordinateNormalizationX:Zg(A),rightNormalAndTextureCoordinateNormalizationY:Zg(S)};return s&&(De.startHiLo2D=Zg(v),De.offsetAndRight2D=Zg(D),De.startEndNormals2D=Zg(O),De.texcoordNormalization2D=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new st({attributes:De,indices:m,boundingSphere:be})}function Zg(e){return new ve({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}$g._projectNormal=hv;var kT=$g;var FL=`in vec4 v_startPlaneNormalEcAndHalfWidth; +in vec4 v_endPlaneNormalEcAndBatchId; +in vec4 v_rightPlaneEC; // Technically can compute distance for this here +in vec4 v_endEcAndStartEcX; +in vec4 v_texcoordNormalizationAndStartEcYZ; + +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#endif + +void main(void) +{ + float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); + vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); + + // Discard for sky + if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } + + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + eyeCoordinate /= eyeCoordinate.w; + + float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); + // Check distance of the eye coordinate against the right-facing plane + float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); + + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); + + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME + } + + // Check distance of the eye coordinate against start and end planes with normals in the right plane. + // For computing unskewed lengthwise texture coordinate. + // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. + + // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" + vec3 alignedPlaneNormal; + + // start aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); + + // end aligned plane + alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); + alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); + distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); + +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Clamp - distance to aligned planes may be negative due to mitering, + // so fragment texture coordinate might be out-of-bounds. + float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); + s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; + float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); + + czm_materialInput materialInput; + + materialInput.s = s; + materialInput.st = vec2(s, t); + materialInput.str = vec3(s, t, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR + + // Premultiply alpha. Required for classification primitives on translucent globe. + out_FragColor.rgb *= out_FragColor.a; + + czm_writeDepthClamp(); +} +`;var BL=`in vec3 v_forwardDirectionEC; +in vec3 v_texcoordNormalizationAndHalfWidth; +in float v_batchId; + +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#else +in vec2 v_alignedPlaneDistances; +in float v_texcoordT; +#endif + +float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { + // We don't expect the ray to ever be parallel to the plane + return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); +} + +void main(void) +{ + vec4 eyeCoordinate = gl_FragCoord; + eyeCoordinate /= eyeCoordinate.w; + +#ifdef PER_INSTANCE_COLOR + out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR + // Use distances for planes aligned with segment to prevent skew in dashing + float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); + float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); + + // Clamp - distance to aligned planes may be negative due to mitering + distanceFromStart = max(0.0, distanceFromStart); + distanceFromEnd = max(0.0, distanceFromEnd); + + float s = distanceFromStart / (distanceFromStart + distanceFromEnd); + s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; + + czm_materialInput materialInput; + + materialInput.s = s; + materialInput.st = vec2(s, v_texcoordT); + materialInput.str = vec3(s, v_texcoordT, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR +} +`;var kL=`in vec3 position3DHigh; +in vec3 position3DLow; + +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; + +in float batchId; + +out vec3 v_forwardDirectionEC; +out vec3 v_texcoordNormalizationAndHalfWidth; +out float v_batchId; + +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#else +out vec2 v_alignedPlaneDistances; +out float v_texcoordT; +#endif + +// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. +// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. +void main() +{ + v_batchId = batchId; + + // Start position + vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); + vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); + vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; + + // Start plane + vec4 startPlane2D; + vec4 startPlane3D; + startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); + startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); + + // Right plane + vec4 rightPlane2D; + vec4 rightPlane3D; + rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); + rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); + + // End position + posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); + posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); + posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); + posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; + posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; + vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; + vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); + vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); + + // End plane + vec4 endPlane2D; + vec4 endPlane3D; + endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); + endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); + + // Forward direction + v_forwardDirectionEC = normalize(endEC - startEC); + + vec2 cleanTexcoordNormalization2D; + cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); + cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); + vec2 cleanTexcoordNormalization3D; + cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; + cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); + + v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#else // PER_INSTANCE_COLOR + // For computing texture coordinates + + v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); + v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); +#endif // PER_INSTANCE_COLOR + +#ifdef WIDTH_VARYING + float width = czm_batchTable_width(batchId); + float halfWidth = width * 0.5; + v_width = width; + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#else + float halfWidth = 0.5 * czm_batchTable_width(batchId); + v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#endif + + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + // Since this is morphing, compute both 3D and 2D positions and then blend. + + // ****** 3D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); + vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Nudge the top vertex upwards to prevent flickering + vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); + geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc3D.xyz += geodeticSurfaceNormal; + + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); + + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + + // ****** 2D ****** + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition + absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); + absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); + planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); + upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Nudge the top vertex upwards to prevent flickering + geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); + geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); + geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; + positionEc2D.xyz += geodeticSurfaceNormal; + + // Determine if this vertex is on the "left" or "right" + normalEC *= sign(texcoordNormalization2D.x); +#ifndef PER_INSTANCE_COLOR + // Use vertex's sidedness to compute its texture coordinate. + v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); +#endif + + // A "perfect" implementation would push along normals according to the angle against forward. + // In practice, just pushing the normal out by halfWidth is sufficient for morph views. + positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) + + // Blend for actual position + gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); + +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif +} +`;var VL=`in vec3 position3DHigh; +in vec3 position3DLow; + +// In 2D and in 3D, texture coordinate normalization component signs encodes: +// * X sign - sidedness relative to right plane +// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume +#ifndef COLUMBUS_VIEW_2D +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +#else +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +#endif + +in float batchId; + +out vec4 v_startPlaneNormalEcAndHalfWidth; +out vec4 v_endPlaneNormalEcAndBatchId; +out vec4 v_rightPlaneEC; +out vec4 v_endEcAndStartEcX; +out vec4 v_texcoordNormalizationAndStartEcYZ; + +// For materials +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif + +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif + +void main() +{ +#ifdef COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; + + vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); + vec3 ecEnd = forwardDirectionEC + ecStart; + forwardDirectionEC = normalize(forwardDirectionEC); + + // Right plane + v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + + v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); + v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; + +#else // COLUMBUS_VIEW_2D + vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; + vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); + vec3 ecEnd = ecStart + offset; + + vec3 forwardDirectionEC = normalize(offset); + + // start plane + vec4 startPlaneEC; + startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; + startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); + + // end plane + vec4 endPlaneEC; + endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; + endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); + + // Right plane + v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; + v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); + + v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); + v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; + +#endif // COLUMBUS_VIEW_2D + + v_endEcAndStartEcX.xyz = ecEnd; + v_endEcAndStartEcX.w = ecStart.x; + v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; + +#ifdef PER_INSTANCE_COLOR + v_color = czm_batchTable_color(batchId); +#endif // PER_INSTANCE_COLOR + + // Compute a normal along which to "push" the position out, extending the miter depending on view distance. + // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. + // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. + vec4 positionRelativeToEye = czm_computePosition(); + + // Check distance to the end plane and start plane, pick the plane that is closer + vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition + float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); + float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); + vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); + vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. + vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. + + // Extrude bottom vertices downward for far view distances, like for GroundPrimitives + upOrDown = cross(forwardDirectionEC, normalEC); + upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; + upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; + upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; + positionEC.xyz += upOrDown; + + v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); + + // Determine distance along normalEC to push for a volume of appropriate width. + // Make volumes about double pixel width for a conservative fit - in practice the + // extra cost here is minimal compared to the loose volume heights. + // + // N = normalEC (guaranteed "right-facing") + // R = rightEC + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + float width = czm_batchTable_width(batchId); +#ifdef WIDTH_VARYING + v_width = width; +#endif + + v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; + v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; + + v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; + v_endPlaneNormalEcAndBatchId.w = batchId; + + width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R + width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N + + // Determine if this vertex is on the "left" or "right" +#ifdef COLUMBUS_VIEW_2D + normalEC *= sign(texcoordNormalization2D.x); +#else + normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +#endif + + positionEC.xyz += width * normalEC; + gl_Position = czm_depthClamp(czm_projection * positionEC); + +#ifdef ANGLE_VARYING + // Approximate relative screen space direction of the line. + vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); + approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); + v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif +} +`;var UL=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec4 color; +in float batchId; + +out vec4 v_color; + +void main() +{ + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; + + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); + + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; + + v_color = color; +} +`;var rf=`void clipLineSegmentToNearPlane( + vec3 p0, + vec3 p1, + out vec4 positionWC, + out bool clipped, + out bool culledByNearPlane, + out vec4 clippedPositionEC) +{ + culledByNearPlane = false; + clipped = false; + + vec3 p0ToP1 = p1 - p0; + float magnitude = length(p0ToP1); + vec3 direction = normalize(p0ToP1); + + // Distance that p0 is behind the near plane. Negative means p0 is + // in front of the near plane. + float endPoint0Distance = czm_currentFrustum.x + p0.z; + + // Camera looks down -Z. + // When moving a point along +Z: LESS VISIBLE + // * Points in front of the camera move closer to the camera. + // * Points behind the camrea move farther away from the camera. + // When moving a point along -Z: MORE VISIBLE + // * Points in front of the camera move farther away from the camera. + // * Points behind the camera move closer to the camera. + + // Positive denominator: -Z, becoming more visible + // Negative denominator: +Z, becoming less visible + // Nearly zero: parallel to near plane + float denominator = -direction.z; + + if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) + { + // p0 is behind the near plane and the line to p1 is nearly parallel to + // the near plane, so cull the segment completely. + culledByNearPlane = true; + } + else if (endPoint0Distance > 0.0) + { + // p0 is behind the near plane, and the line to p1 is moving distinctly + // toward or away from it. + + // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) + float t = endPoint0Distance / denominator; + if (t < 0.0 || t > magnitude) + { + // Near plane intersection is not between the two points. + // We already confirmed p0 is behind the naer plane, so now + // we know the entire segment is behind it. + culledByNearPlane = true; + } + else + { + // Segment crosses the near plane, update p0 to lie exactly on it. + p0 = p0 + t * direction; + + // Numerical noise might put us a bit on the wrong side of the near plane. + // Don't let that happen. + p0.z = min(p0.z, -czm_currentFrustum.x); + + clipped = true; + } + } + + clippedPositionEC = vec4(p0, 1.0); + positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); +} + +vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) +{ + // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. + +#ifdef POLYLINE_DASH + // Compute the window coordinates of the points. + vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); + vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); + vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); + + // Determine the relative screen space direction of the line. + vec2 lineDir; + if (usePrevious) { + lineDir = normalize(positionWindow.xy - previousWindow.xy); + } + else { + lineDir = normalize(nextWindow.xy - positionWindow.xy); + } + angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) + + // Quantize the angle so it doesn't change rapidly between segments. + angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +#endif + + vec4 clippedPrevWC, clippedPrevEC; + bool prevSegmentClipped, prevSegmentCulled; + clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); + + vec4 clippedNextWC, clippedNextEC; + bool nextSegmentClipped, nextSegmentCulled; + clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); + + bool segmentClipped, segmentCulled; + vec4 clippedPositionWC, clippedPositionEC; + clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); + + if (segmentCulled) + { + return vec4(0.0, 0.0, 0.0, 1.0); + } + + vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); + vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); + + // If a segment was culled, we can't use the corresponding direction + // computed above. We should never see both of these be true without + // \`segmentCulled\` above also being true. + if (prevSegmentCulled) + { + directionToPrevWC = -directionToNextWC; + } + else if (nextSegmentCulled) + { + directionToNextWC = -directionToPrevWC; + } + + vec2 thisSegmentForwardWC, otherSegmentForwardWC; + if (usePrevious) + { + thisSegmentForwardWC = -directionToPrevWC; + otherSegmentForwardWC = directionToNextWC; + } + else + { + thisSegmentForwardWC = directionToNextWC; + otherSegmentForwardWC = -directionToPrevWC; + } + + vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); + + vec2 leftWC = thisSegmentLeftWC; + float expandWidth = width * 0.5; + + // When lines are split at the anti-meridian, the position may be at the + // same location as the next or previous position, and we need to handle + // that to avoid producing NaNs. + if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) + { + vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); + + vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; + float leftSumLength = length(leftSumWC); + leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); + + // The sine of the angle between the two vectors is given by the formula + // |a x b| = |a||b|sin(theta) + // which is + // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); + // Because the z components of both vectors are zero, the x and y coordinate will be zero. + // Therefore, the sine of the angle is just the z component of the cross product. + vec2 u = -thisSegmentForwardWC; + vec2 v = leftWC; + float sinAngle = abs(u.x * v.y - u.y * v.x); + expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); + } + + vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; + return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; +} + +vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) +{ + vec4 positionEC = czm_modelViewRelativeToEye * position; + vec4 prevEC = czm_modelViewRelativeToEye * previous; + vec4 nextEC = czm_modelViewRelativeToEye * next; + return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); +} +`;var W6=`${rf} +${UL}`,CLe=RT;zt.isInternetExplorer()||(W6=`#define CLIP_POLYLINE +${W6}`);function j0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=j0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,W6),this._fragmentShaderSource=y(e.fragmentShaderSource,CLe),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(j0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});j0.VERTEX_FORMAT=Ie.POSITION_ONLY;j0.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;j0.prototype.isTranslucent=no.prototype.isTranslucent;j0.prototype.getRenderState=no.prototype.getRenderState;var is=j0;var zL=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec2 st; +in float batchId; + +out float v_width; +out vec2 v_st; +out float v_polylineAngle; + +void main() +{ + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; + + vec4 p = czm_computePosition(); + vec4 prev = czm_computePrevPosition(); + vec4 next = czm_computeNextPosition(); + + float angle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; + + v_width = width; + v_st.s = st.s; + v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); + v_polylineAngle = angle; +} +`;var VT=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif + +in vec2 v_st; + +void main() +{ + czm_materialInput materialInput; + + vec2 st = v_st; + st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); + + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = vec3(st, 0.0); + + czm_material material = czm_getMaterial(materialInput); + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#ifdef VECTOR_TILE + out_FragColor *= u_highlightColor; +#endif + + czm_writeLogDepth(); +} +`;var j6=`${rf} +${zL}`,ALe=VT;zt.isInternetExplorer()||(j6=`#define CLIP_POLYLINE +${j6}`);function q0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=q0.VERTEX_FORMAT;this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,j6),this._fragmentShaderSource=y(e.fragmentShaderSource,ALe),this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(q0.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH +${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});q0.VERTEX_FORMAT=Ie.POSITION_AND_ST;q0.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;q0.prototype.isTranslucent=no.prototype.isTranslucent;q0.prototype.getRenderState=no.prototype.getRenderState;var Ca=q0;function mp(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new Ca),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=ene(!1),this._renderState3DTiles=ene(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:bi.FRONT},depthTest:{enabled:!0},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(mp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});mp.initializeTerrainHeights=function(){return ui.initialize()};function ELe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(VL);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(kL);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(FL),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",h="";l(n.material)?(h=l(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],_=new Ue({defines:u,sources:[s]}),m=new Ue({defines:p,sources:[h,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:_,fragmentShaderSource:m,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let T=new Ue({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:T,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=x;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(b)){let T=new Ue({defines:u.concat([`MAX_TERRAIN_HEIGHT ${ui._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(BL);let C=new Ue({defines:p,sources:[h,c]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:r})}e._spMorph=b}function ene(e){return Ve.fromCache({cull:{enabled:!0},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK}})}function SLe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof is?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let h=0;h<a;h++){let p=s._va[h],_=o[h];l(_)||(_=o[h]=new $e({owner:e,primitiveType:s._primitiveType})),_.vertexArray=p,_.renderState=e._renderState,_.shaderProgram=e._sp,_.uniformMap=f,_.pass=we.TERRAIN_CLASSIFICATION,_.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=$e.shallowClone(_,_.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=we.CESIUM_3D_TILE_CLASSIFICATION,_.derivedCommands.tileset=m;let x=$e.shallowClone(_,_.derivedCommands.color2D);x.shaderProgram=e._sp2D,_.derivedCommands.color2D=x;let b=$e.shallowClone(m,m.derivedCommands.color2D);b.shaderProgram=e._sp2D,m.derivedCommands.color2D=b;let T=$e.shallowClone(_,_.derivedCommands.colorMorph);T.renderState=e._renderStateMorph,T.shaderProgram=e._spMorph,T.pickId="czm_batchTable_pickColor(v_batchId)",_.derivedCommands.colorMorph=T}}function tne(e,t,n,i,o,r,s){n.mode===ne.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ne.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function vLe(e,t,n,i,o,r,s){let a=e._primitive;In._updateBoundingVolumes(a,t,o);let c;t.mode===ne.SCENE3D?c=a._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ne.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===ne.MORPHING,f=e.classificationType,h=f!==kn.CESIUM_3D_TILE,p=f!==kn.TERRAIN&&!u,_,m=t.passes;if(m.render||m.pick&&a.allowPicking){let x=n.length;for(let b=0;b<x;++b){let T=c[b];h&&(_=n[b],tne(e,_,t,o,r,T,s)),p&&(_=n[b].derivedCommands.tileset,tne(e,_,t,o,r,T,s))}}}mp.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!ui.initialized){mp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new Dc({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,kT.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new vt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){ELe(n,u,f)},i._createCommandsFunction=function(c,u,f,h,p,_,m){SLe(n,u,f,h,_,m)},i._updateAndQueueCommandsFunction=function(c,u,f,h,p,_,m,x){vLe(n,u,f,h,p,_,m)},this._primitive=new In(i)}if(this.appearance instanceof is&&!this._hasPerInstanceColors)throw new he("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};mp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};mp.isSupported=function(e){return e.frameState.context.depthTexture};mp.prototype.isDestroyed=function(){return!1};mp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var Mh=mp;var wLe=new U(1,1),DLe=!1,ILe=z.WHITE;function UT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(UT.prototype,{isConstant:{get:function(){return q.isConstant(this._image)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});UT.prototype.getType=function(e){return"Image"};var PLe=new Z;UT.prototype.getValue=function(e,t){return l(e)||(e=Z.now(PLe)),l(t)||(t={}),t.image=q.getValueOrUndefined(this._image,e),t.repeat=q.getValueOrClonedDefault(this._repeat,e,wLe,t.repeat),t.color=q.getValueOrClonedDefault(this._color,e,ILe,t.color),q.getValueOrDefault(this._transparent,e,DLe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};UT.prototype.equals=function(e){return this===e||e instanceof UT&&q.equals(this._image,e._image)&&q.equals(this._repeat,e._repeat)&&q.equals(this._color,e._color)&&q.equals(this._transparent,e._transparent)};var Y0=UT;function RLe(e){if(e instanceof z)return new Ut(e);if(typeof e=="string"||e instanceof Se||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Y0;return t.image=e,t}}function OLe(e,t){return le(e,t,RLe)}var No=OLe;function mv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(mv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:No("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});mv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new mv(this)};mv.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var zT=mv;var MLe={FIXED:0,INERTIAL:1},Ui=Object.freeze(MLe);function HT(){he.throwInstantiationError()}Object.defineProperties(HT.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError},referenceFrame:{get:he.throwInstantiationError}});HT.prototype.getValue=he.throwInstantiationError;HT.prototype.getValueInReferenceFrame=he.throwInstantiationError;HT.prototype.equals=he.throwInstantiationError;var nne=new $;HT.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new d),n===i)return d.clone(t,o);let r=Ot.computeIcrfToCentralBodyFixedMatrix(e,nne);if(n===Ui.INERTIAL)return $.multiplyByVector(r,t,o);if(n===Ui.FIXED)return $.multiplyByVector($.transpose(r,nne),t,o)};var Lh=HT;function X0(e,t){this._definitionChanged=new pe,this._value=d.clone(e),this._referenceFrame=y(t,Ui.FIXED)}Object.defineProperties(X0.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Ui.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var LLe=new Z;X0.prototype.getValue=function(e,t){return l(e)||(e=Z.now(LLe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};X0.prototype.setValue=function(e,t){let n=!1;d.equals(this._value,e)||(n=!0,this._value=d.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};X0.prototype.getValueInReferenceFrame=function(e,t,n){return Lh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};X0.prototype.equals=function(e){return this===e||e instanceof X0&&d.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var _l=X0;function pv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(pv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:No("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});pv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new pv(this)};pv.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var GT=pv;function NLe(e){return e}function FLe(e,t){return le(e,t,NLe)}var yl=FLe;function gv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(gv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:No("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});gv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new gv(this)};gv.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var WT=gv;function _v(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(_v.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:No("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});_v.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new _v(this)};_v.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var jT=_v;function yv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(yv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:No("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});yv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new yv(this)};yv.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var qT=yv;function xv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(xv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});xv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new xv(this)};xv.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Nh=xv;var BLe=new d(1,1,1),kLe=d.ZERO,VLe=Oe.IDENTITY;function ine(e,t,n){this.translation=d.clone(y(e,kLe)),this.rotation=Oe.clone(y(t,VLe)),this.scale=d.clone(y(n,BLe))}ine.prototype.equals=function(e){return this===e||l(e)&&d.equals(this.translation,e.translation)&&Oe.equals(this.rotation,e.rotation)&&d.equals(this.scale,e.scale)};var K0=ine;var q6=new K0;function bv(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(bv.prototype,{isConstant:{get:function(){return q.isConstant(this._translation)&&q.isConstant(this._rotation)&&q.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});var ULe=new Z;bv.prototype.getValue=function(e,t){return l(e)||(e=Z.now(ULe)),l(t)||(t=new K0),t.translation=q.getValueOrClonedDefault(this._translation,e,q6.translation,t.translation),t.rotation=q.getValueOrClonedDefault(this._rotation,e,q6.rotation,t.rotation),t.scale=q.getValueOrClonedDefault(this._scale,e,q6.scale,t.scale),t};bv.prototype.equals=function(e){return this===e||e instanceof bv&&q.equals(this._translation,e._translation)&&q.equals(this._rotation,e._rotation)&&q.equals(this._scale,e._scale)};var YT=bv;function pp(e,t){this._propertyNames=[],this._definitionChanged=new pe,l(e)&&this.merge(e,t)}Object.defineProperties(pp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!q.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});pp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function zLe(e){return new Xn(e)}pp.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,y(n,zLe))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};pp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var HLe=new Z;pp.prototype.getValue=function(e,t){l(e)||(e=Z.now(HLe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=q.getValueOrUndefined(this[r],e,t[r])}return t};pp.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function GLe(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!q.equals(e[s],t[s]))return!1}return!0}pp.prototype.equals=function(e){return this===e||e instanceof pp&&GLe(this,e)};var xl=pp;function one(e){return new YT(e)}function WLe(e){return new xl(e,one)}function jLe(e){return new xl(e)}function qLe(e){return new xl(e)}function Tv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Tv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),enableVerticalExaggeration:le("enableVerticalExaggeration"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),environmentMapOptions:le("environmentMapOptions",void 0,qLe),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,WLe),articulations:le("articulations",void 0,jLe),clippingPlanes:le("clippingPlanes"),customShader:le("customShader")});Tv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new Tv(this)};Tv.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.enableVerticalExaggeration=y(this.enableVerticalExaggeration,e.enableVerticalExaggeration),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.environmentMapOptions=y(this.environmentMapOptions,e.environmentMapOptions),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new xl(t,one)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new xl(n)}};var Qg=Tv;function Cv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Cv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});Cv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new Cv(this)};Cv.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var XT=Cv;function Av(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Av.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:No("material"),distanceDisplayCondition:le("distanceDisplayCondition")});Av.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Av(this)};Av.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Jg=Av;function Ev(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Ev.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:No("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Ev.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Ev(this)};Ev.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var HL=Ev;function Sv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Sv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance"),splitDirection:le("splitDirection")});Sv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new Sv(this)};Sv.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var KT=Sv;function YLe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Ka=YLe;function XLe(e){return Array.isArray(e)&&(e=new Ka(e)),new Xn(e)}function vv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(vv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,XLe),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:No("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});vv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new vv(this)};vv.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var Fh=vv;function wv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(wv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:No("material"),depthFailMaterial:No("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});wv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new wv(this)};wv.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Pc=wv;function Dv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Dv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:No("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Dv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Dv(this)};Dv.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var ZT=Dv;function Iv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Iv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:No("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});Iv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Iv(this)};Iv.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Bh=Iv;function Pv(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Pv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:No("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Pv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Pv(this)};Pv.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var e_=Pv;var KLe=new fe,Y6=[];function ZLe(e){return new _l(e)}function $Le(e){return le(e,void 0,ZLe)}function Ls(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function sf(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=zn()),this._availability=void 0,this._id=t,this._definitionChanged=new pe,this._name=e.name,this._show=y(e.show,!0),this._trackingReferenceFrame=y(e.trackingReferenceFrame,Xg.AUTODETECT),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...Y6],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function X6(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&X6(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(sf.prototype,{availability:yl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:yl("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&X6(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:yl("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&X6(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ls("billboard",Sc),box:Ls("box",zT),corridor:Ls("corridor",GT),cylinder:Ls("cylinder",WT),description:le("description"),ellipse:Ls("ellipse",jT),ellipsoid:Ls("ellipsoid",qT),label:Ls("label",Nh),model:Ls("model",Qg),tileset:Ls("tileset",XT),orientation:le("orientation"),path:Ls("path",Jg),plane:Ls("plane",HL),point:Ls("point",KT),polygon:Ls("polygon",Fh),polyline:Ls("polyline",Pc),polylineVolume:Ls("polylineVolume",ZT),properties:Ls("properties",xl),position:$Le("position"),rectangle:Ls("rectangle",Bh),viewFrom:le("viewFrom"),wall:Ls("wall",e_)});sf.registerEntityType=function(e,t){Object.defineProperties(sf.prototype,{[e]:Ls(e,t)}),Y6.includes(e)||Y6.push(e)};sf.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};sf.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,yl(e,!0))};sf.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};sf.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var rne=new $,sne=new d,ane=new Oe;sf.prototype.computeModelMatrix=function(e,t){let n=q.getValueOrUndefined(this._position,e,sne);if(!l(n))return;let i=q.getValueOrUndefined(this._orientation,e,ane);return l(i)?t=F.fromRotationTranslation($.fromQuaternion(i,rne),n,t):t=Ot.eastNorthUpToFixedFrame(n,void 0,t),t};sf.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=q.getValueOrDefault(t,e,Ye.NONE),s=q.getValueOrUndefined(this._position,e,sne);if(r===Ye.NONE||!l(s)||d.equalsEpsilon(s,d.ZERO,P.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,KLe);tf(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=q.getValueOrUndefined(this._orientation,e,ane);return l(c)?o=F.fromRotationTranslation($.fromQuaternion(c,rne),s,o):o=Ot.eastNorthUpToFixedFrame(s,void 0,o),o};sf.supportsMaterialsforEntitiesOnTerrain=function(e){return gl.supportsMaterials(e)};sf.supportsPolylinesOnTerrain=function(e){return Mh.isSupported(e)};var or=sf;var QLe=new Ut(z.WHITE),JLe=new Xn(!0),eNe=new Xn(!0),tNe=new Xn(!1),nNe=new Xn(z.BLACK),iNe=new Xn(xn.DISABLED),oNe=new Xn(new Mt),rNe=new Xn(kn.BOTH);function Rc(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new pe,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=or.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Rc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Rc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};Rc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};Rc.prototype.createFillGeometryInstance=he.throwInstantiationError;Rc.prototype.createOutlineGeometryInstance=he.throwInstantiationError;Rc.prototype.isDestroyed=function(){return!1};Rc.prototype.destroy=function(){ue(this)};Rc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(He.MINIMUM_VALUE)};Rc.prototype._isOnTerrain=function(e,t){return!1};Rc.prototype._getIsClosed=function(e){return!0};Rc.prototype._isDynamic=he.throwInstantiationError;Rc.prototype._setStaticOptions=he.throwInstantiationError;Rc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(He.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(He.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(o.material,QLe),this._fillProperty=y(r,eNe),this._showProperty=y(u,JLe),this._showOutlineProperty=y(o.outline,tNe),this._outlineColorProperty=c?y(o.outlineColor,nNe):void 0,this._shadowsProperty=y(o.shadows,iNe),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,oNe),this._classificationTypeProperty=y(o.classificationType,rNe),this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Ut);if(c&&f&&(yt(yt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let h=o.outlineWidth;this._outlineWidth=l(h)?h.getValue(He.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Rc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var oi=Rc;function $T(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties($T.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var sNe=new Z;$T.prototype.getValue=function(e,t){return l(e)||(e=Z.now(sNe)),this._callback(e,t)};$T.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};$T.prototype.equals=function(e){return this===e||e instanceof $T&&this._callback===e._callback&&this._isConstant===e._isConstant};var kh=$T;var cne=new d;function QT(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new d,this._cartographicPosition=new fe,this._normal=new d,this._definitionChanged=new pe,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(He.MINIMUM_VALUE,cne);if(!l(r)||d.equals(r,d.ZERO)||!l(e.globe))return;this._position=d.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(QT.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});QT.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(d.equals(t,d.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var aNe=new Z;QT.prototype.getValue=function(e,t){l(e)||(e=Z.now(aNe));let n=q.getValueOrDefault(this._heightReference,e,Ye.NONE),i=q.getValueOrDefault(this._extrudedHeightReference,e,Ye.NONE);if(n===Ye.NONE&&!wT(i))return this._position=d.clone(d.ZERO,this._position),d.clone(d.ZERO,t);if(this._positionProperty.isConstant)return d.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,cne);if(!l(r)||d.equals(r,d.ZERO)||!l(o.globe))return d.clone(d.ZERO,t);if(d.equalsEpsilon(this._position,r,P.EPSILON10))return d.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=d.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return d.multiplyByScalar(s,this._terrainHeight,t)};QT.prototype.isDestroyed=function(){return!1};QT.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var JT=QT;function cNe(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new kh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new JT(this._scene,s,r)}}var t_=cNe;var lne=d.ZERO,une=new d,lNe=new d,fne=new z;function uNe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Ql(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new uNe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Ql.prototype=Object.create(oi.prototype),Ql.prototype.constructor=Ql);Object.defineProperties(Ql.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Ql.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Bn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,fne)),l(a)||(a=z.WHITE),s.color=Gt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,lne,une))),new vt({id:t,geometry:qa.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Ql.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,fne),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,lne,une))),new vt({id:t,geometry:Rh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Ql.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Ql.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||oi.prototype._isHidden.call(this,e,t)};Ql.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};Ql.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(He.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Ye.NONE?rn.ALL:void 0};Ql.prototype._onEntityPropertyChanged=t_;Ql.DynamicGeometryUpdater=eC;function eC(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(eC.prototype=Object.create(ii.prototype),eC.prototype.constructor=eC);eC.prototype._isHidden=function(e,t,n){let i=q.getValueOrUndefined(e.position,n,lNe),o=this._options.dimensions;return!l(i)||!l(o)||ii.prototype._isHidden.call(this,e,t,n)};eC.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,Ye.NONE),o=this._options;o.dimensions=q.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Ye.NONE?rn.ALL:void 0};var GL=Ql;function Z0(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=y(n,Ui.FIXED),this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties(Z0.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var fNe=new Z;Z0.prototype.getValue=function(e,t){return l(e)||(e=Z.now(fNe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Z0.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Z0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Lh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Z0.prototype.equals=function(e){return this===e||e instanceof Z0&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var WL=Z0;/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */var{entries:Tne,setPrototypeOf:dne,isFrozen:dNe,getPrototypeOf:hNe,getOwnPropertyDescriptor:mNe}=Object,{freeze:Mc,seal:af,create:Cne}=Object,{apply:e9,construct:t9}=typeof Reflect<"u"&&Reflect;Mc||(Mc=function(t){return t});af||(af=function(t){return t});e9||(e9=function(t,n,i){return t.apply(n,i)});t9||(t9=function(t,n){return new t(...n)});var jL=Jl(Array.prototype.forEach),hne=Jl(Array.prototype.pop),Rv=Jl(Array.prototype.push),YL=Jl(String.prototype.toLowerCase),K6=Jl(String.prototype.toString),mne=Jl(String.prototype.match),Ov=Jl(String.prototype.replace),pNe=Jl(String.prototype.indexOf),gNe=Jl(String.prototype.trim),gd=Jl(Object.prototype.hasOwnProperty),Oc=Jl(RegExp.prototype.test),Mv=_Ne(TypeError);function Jl(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return e9(e,t,i)}}function _Ne(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return t9(e,n)}}function Si(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:YL;dne&&dne(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(dNe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function yNe(e){for(let t=0;t<e.length;t++)gd(e,t)||(e[t]=null);return e}function $0(e){let t=Cne(null);for(let[n,i]of Tne(e))gd(e,n)&&(Array.isArray(i)?t[n]=yNe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=$0(i):t[n]=i);return t}function Lv(e,t){for(;e!==null;){let i=mNe(e,t);if(i){if(i.get)return Jl(i.get);if(typeof i.value=="function")return Jl(i.value)}e=hNe(e)}function n(){return null}return n}var pne=Mc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Z6=Mc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),$6=Mc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),xNe=Mc(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Q6=Mc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),bNe=Mc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),gne=Mc(["#text"]),_ne=Mc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),J6=Mc(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),yne=Mc(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),qL=Mc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),TNe=af(/\{\{[\w\W]*|[\w\W]*\}\}/gm),CNe=af(/<%[\w\W]*|[\w\W]*%>/gm),ANe=af(/\$\{[\w\W]*}/gm),ENe=af(/^data-[\-\w.\u00B7-\uFFFF]+$/),SNe=af(/^aria-[\-\w]+$/),Ane=af(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vNe=af(/^(?:\w+script|data):/i),wNe=af(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ene=af(/^html$/i),DNe=af(/^[a-z][.\w]*(-[.\w]+)+$/i),xne=Object.freeze({__proto__:null,ARIA_ATTR:SNe,ATTR_WHITESPACE:wNe,CUSTOM_ELEMENT:DNe,DATA_ATTR:ENe,DOCTYPE_NAME:Ene,ERB_EXPR:CNe,IS_ALLOWED_URI:Ane,IS_SCRIPT_OR_DATA:vNe,MUSTACHE_EXPR:TNe,TMPLIT_EXPR:ANe}),Nv={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},INe=function(){return typeof window>"u"?null:window},PNe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},bne=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Sne(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:INe(),t=cn=>Sne(cn);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==Nv.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:_}=e,m=c.prototype,x=Lv(m,"cloneNode"),b=Lv(m,"remove"),T=Lv(m,"nextSibling"),C=Lv(m,"childNodes"),A=Lv(m,"parentNode");if(typeof s=="function"){let cn=n.createElement("template");cn.content&&cn.content.ownerDocument&&(n=cn.content.ownerDocument)}let S,v="",{implementation:D,createNodeIterator:O,createDocumentFragment:R,getElementsByTagName:M}=n,{importNode:L}=i,g=bne();t.isSupported=typeof Tne=="function"&&typeof A=="function"&&D&&D.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:E,ERB_EXPR:w,TMPLIT_EXPR:I,DATA_ATTR:N,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:G}=xne,{IS_ALLOWED_URI:k}=xne,W=null,Y=Si({},[...pne,...Z6,...$6,...Q6,...gne]),J=null,j=Si({},[..._ne,...J6,...yne,...qL]),K=Object.seal(Cne(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Q=null,de=null,xe=!0,ce=!0,_e=!1,be=!0,De=!1,Ae=!0,ke=!1,ze=!1,et=!1,Et=!1,ht=!1,Be=!1,qt=!0,Tt=!1,lt="user-content-",Wn=!0,on=!1,me={},Ce=null,hn=Si({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ft=null,to=Si({},["audio","video","img","source","image","track"]),Eo=null,Ys=Si({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Cr="http://www.w3.org/1998/Math/MathML",hs="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml",it=Le,je=!1,Xe=null,dt=Si({},[Cr,hs,Le],K6),Ht=Si({},["mi","mo","mn","ms","mtext"]),_n=Si({},["annotation-xml"]),So=Si({},["title","style","font","a","script"]),yo=null,Na=["application/xhtml+xml","text/html"],Fa="text/html",_i=null,fi=null,Xs=n.createElement("form"),kr=function(Ee){return Ee instanceof RegExp||Ee instanceof Function},ol=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(fi&&fi===Ee)){if((!Ee||typeof Ee!="object")&&(Ee={}),Ee=$0(Ee),yo=Na.indexOf(Ee.PARSER_MEDIA_TYPE)===-1?Fa:Ee.PARSER_MEDIA_TYPE,_i=yo==="application/xhtml+xml"?K6:YL,W=gd(Ee,"ALLOWED_TAGS")?Si({},Ee.ALLOWED_TAGS,_i):Y,J=gd(Ee,"ALLOWED_ATTR")?Si({},Ee.ALLOWED_ATTR,_i):j,Xe=gd(Ee,"ALLOWED_NAMESPACES")?Si({},Ee.ALLOWED_NAMESPACES,K6):dt,Eo=gd(Ee,"ADD_URI_SAFE_ATTR")?Si($0(Ys),Ee.ADD_URI_SAFE_ATTR,_i):Ys,ft=gd(Ee,"ADD_DATA_URI_TAGS")?Si($0(to),Ee.ADD_DATA_URI_TAGS,_i):to,Ce=gd(Ee,"FORBID_CONTENTS")?Si({},Ee.FORBID_CONTENTS,_i):hn,Q=gd(Ee,"FORBID_TAGS")?Si({},Ee.FORBID_TAGS,_i):{},de=gd(Ee,"FORBID_ATTR")?Si({},Ee.FORBID_ATTR,_i):{},me=gd(Ee,"USE_PROFILES")?Ee.USE_PROFILES:!1,xe=Ee.ALLOW_ARIA_ATTR!==!1,ce=Ee.ALLOW_DATA_ATTR!==!1,_e=Ee.ALLOW_UNKNOWN_PROTOCOLS||!1,be=Ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=Ee.SAFE_FOR_TEMPLATES||!1,Ae=Ee.SAFE_FOR_XML!==!1,ke=Ee.WHOLE_DOCUMENT||!1,Et=Ee.RETURN_DOM||!1,ht=Ee.RETURN_DOM_FRAGMENT||!1,Be=Ee.RETURN_TRUSTED_TYPE||!1,et=Ee.FORCE_BODY||!1,qt=Ee.SANITIZE_DOM!==!1,Tt=Ee.SANITIZE_NAMED_PROPS||!1,Wn=Ee.KEEP_CONTENT!==!1,on=Ee.IN_PLACE||!1,k=Ee.ALLOWED_URI_REGEXP||Ane,it=Ee.NAMESPACE||Le,Ht=Ee.MATHML_TEXT_INTEGRATION_POINTS||Ht,_n=Ee.HTML_INTEGRATION_POINTS||_n,K=Ee.CUSTOM_ELEMENT_HANDLING||{},Ee.CUSTOM_ELEMENT_HANDLING&&kr(Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&kr(Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&typeof Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(ce=!1),ht&&(Et=!0),me&&(W=Si({},gne),J=[],me.html===!0&&(Si(W,pne),Si(J,_ne)),me.svg===!0&&(Si(W,Z6),Si(J,J6),Si(J,qL)),me.svgFilters===!0&&(Si(W,$6),Si(J,J6),Si(J,qL)),me.mathMl===!0&&(Si(W,Q6),Si(J,yne),Si(J,qL))),Ee.ADD_TAGS&&(W===Y&&(W=$0(W)),Si(W,Ee.ADD_TAGS,_i)),Ee.ADD_ATTR&&(J===j&&(J=$0(J)),Si(J,Ee.ADD_ATTR,_i)),Ee.ADD_URI_SAFE_ATTR&&Si(Eo,Ee.ADD_URI_SAFE_ATTR,_i),Ee.FORBID_CONTENTS&&(Ce===hn&&(Ce=$0(Ce)),Si(Ce,Ee.FORBID_CONTENTS,_i)),Wn&&(W["#text"]=!0),ke&&Si(W,["html","head","body"]),W.table&&(Si(W,["tbody"]),delete Q.tbody),Ee.TRUSTED_TYPES_POLICY){if(typeof Ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw Mv('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Mv('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=Ee.TRUSTED_TYPES_POLICY,v=S.createHTML("")}else S===void 0&&(S=PNe(_,o)),S!==null&&typeof v=="string"&&(v=S.createHTML(""));Mc&&Mc(Ee),fi=Ee}},po=Si({},[...Z6,...$6,...xNe]),Ar=Si({},[...Q6,...bNe]),Zm=function(Ee){let It=A(Ee);(!It||!It.tagName)&&(It={namespaceURI:it,tagName:"template"});let mn=YL(Ee.tagName),lr=YL(It.tagName);return Xe[Ee.namespaceURI]?Ee.namespaceURI===hs?It.namespaceURI===Le?mn==="svg":It.namespaceURI===Cr?mn==="svg"&&(lr==="annotation-xml"||Ht[lr]):!!po[mn]:Ee.namespaceURI===Cr?It.namespaceURI===Le?mn==="math":It.namespaceURI===hs?mn==="math"&&_n[lr]:!!Ar[mn]:Ee.namespaceURI===Le?It.namespaceURI===hs&&!_n[lr]||It.namespaceURI===Cr&&!Ht[lr]?!1:!Ar[mn]&&(So[mn]||!po[mn]):!!(yo==="application/xhtml+xml"&&Xe[Ee.namespaceURI]):!1},Vr=function(Ee){Rv(t.removed,{element:Ee});try{A(Ee).removeChild(Ee)}catch{b(Ee)}},Uu=function(Ee,It){try{Rv(t.removed,{attribute:It.getAttributeNode(Ee),from:It})}catch{Rv(t.removed,{attribute:null,from:It})}if(It.removeAttribute(Ee),Ee==="is")if(Et||ht)try{Vr(It)}catch{}else try{It.setAttribute(Ee,"")}catch{}},Ba=function(Ee){let It=null,mn=null;if(et)Ee="<remove></remove>"+Ee;else{let xa=mne(Ee,/^[\r\n\t ]+/);mn=xa&&xa[0]}yo==="application/xhtml+xml"&&it===Le&&(Ee='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ee+"</body></html>");let lr=S?S.createHTML(Ee):Ee;if(it===Le)try{It=new p().parseFromString(lr,yo)}catch{}if(!It||!It.documentElement){It=D.createDocument(it,"template",null);try{It.documentElement.innerHTML=je?v:lr}catch{}}let ka=It.body||It.documentElement;return Ee&&mn&&ka.insertBefore(n.createTextNode(mn),ka.childNodes[0]||null),it===Le?M.call(It,ke?"html":"body")[0]:ke?It.documentElement:ka},b0=function(Ee){return O.call(Ee.ownerDocument||Ee,Ee,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ks=function(Ee){return Ee instanceof h&&(typeof Ee.nodeName!="string"||typeof Ee.textContent!="string"||typeof Ee.removeChild!="function"||!(Ee.attributes instanceof f)||typeof Ee.removeAttribute!="function"||typeof Ee.setAttribute!="function"||typeof Ee.namespaceURI!="string"||typeof Ee.insertBefore!="function"||typeof Ee.hasChildNodes!="function")},rl=function(Ee){return typeof a=="function"&&Ee instanceof a};function yc(cn,Ee,It){jL(cn,mn=>{mn.call(t,Ee,It,fi)})}let es=function(Ee){let It=null;if(yc(g.beforeSanitizeElements,Ee,null),Ks(Ee))return Vr(Ee),!0;let mn=_i(Ee.nodeName);if(yc(g.uponSanitizeElement,Ee,{tagName:mn,allowedTags:W}),Ee.hasChildNodes()&&!rl(Ee.firstElementChild)&&Oc(/<[/\w]/g,Ee.innerHTML)&&Oc(/<[/\w]/g,Ee.textContent)||Ee.nodeType===Nv.progressingInstruction||Ae&&Ee.nodeType===Nv.comment&&Oc(/<[/\w]/g,Ee.data))return Vr(Ee),!0;if(!W[mn]||Q[mn]){if(!Q[mn]&&Hu(mn)&&(K.tagNameCheck instanceof RegExp&&Oc(K.tagNameCheck,mn)||K.tagNameCheck instanceof Function&&K.tagNameCheck(mn)))return!1;if(Wn&&!Ce[mn]){let lr=A(Ee)||Ee.parentNode,ka=C(Ee)||Ee.childNodes;if(ka&&lr){let xa=ka.length;for(let sl=xa-1;sl>=0;--sl){let yh=x(ka[sl],!0);yh.__removalCount=(Ee.__removalCount||0)+1,lr.insertBefore(yh,T(Ee))}}}return Vr(Ee),!0}return Ee instanceof c&&!Zm(Ee)||(mn==="noscript"||mn==="noembed"||mn==="noframes")&&Oc(/<\/no(script|embed|frames)/i,Ee.innerHTML)?(Vr(Ee),!0):(De&&Ee.nodeType===Nv.text&&(It=Ee.textContent,jL([E,w,I],lr=>{It=Ov(It,lr," ")}),Ee.textContent!==It&&(Rv(t.removed,{element:Ee.cloneNode()}),Ee.textContent=It)),yc(g.afterSanitizeElements,Ee,null),!1)},zu=function(Ee,It,mn){if(qt&&(It==="id"||It==="name")&&(mn in n||mn in Xs))return!1;if(!(ce&&!de[It]&&Oc(N,It))){if(!(xe&&Oc(B,It))){if(!J[It]||de[It]){if(!(Hu(Ee)&&(K.tagNameCheck instanceof RegExp&&Oc(K.tagNameCheck,Ee)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Ee))&&(K.attributeNameCheck instanceof RegExp&&Oc(K.attributeNameCheck,It)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(It))||It==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&Oc(K.tagNameCheck,mn)||K.tagNameCheck instanceof Function&&K.tagNameCheck(mn))))return!1}else if(!Eo[It]){if(!Oc(k,Ov(mn,V,""))){if(!((It==="src"||It==="xlink:href"||It==="href")&&Ee!=="script"&&pNe(mn,"data:")===0&&ft[Ee])){if(!(_e&&!Oc(H,Ov(mn,V,"")))){if(mn)return!1}}}}}}return!0},Hu=function(Ee){return Ee!=="annotation-xml"&&mne(Ee,G)},Gu=function(Ee){yc(g.beforeSanitizeAttributes,Ee,null);let{attributes:It}=Ee;if(!It||Ks(Ee))return;let mn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0},lr=It.length;for(;lr--;){let ka=It[lr],{name:xa,namespaceURI:sl,value:yh}=ka,RS=_i(xa),xc=xa==="value"?yh:gNe(yh);if(mn.attrName=RS,mn.attrValue=xc,mn.keepAttr=!0,mn.forceKeepAttr=void 0,yc(g.uponSanitizeAttribute,Ee,mn),xc=mn.attrValue,Tt&&(RS==="id"||RS==="name")&&(Uu(xa,Ee),xc=lt+xc),Ae&&Oc(/((--!?|])>)|<\/(style|title)/i,xc)){Uu(xa,Ee);continue}if(mn.forceKeepAttr||(Uu(xa,Ee),!mn.keepAttr))continue;if(!be&&Oc(/\/>/i,xc)){Uu(xa,Ee);continue}De&&jL([E,w,I],LZ=>{xc=Ov(xc,LZ," ")});let MZ=_i(Ee.nodeName);if(zu(MZ,RS,xc)){if(S&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!sl)switch(_.getAttributeType(MZ,RS)){case"TrustedHTML":{xc=S.createHTML(xc);break}case"TrustedScriptURL":{xc=S.createScriptURL(xc);break}}try{sl?Ee.setAttributeNS(sl,xa,xc):Ee.setAttribute(xa,xc),Ks(Ee)?Vr(Ee):hne(t.removed)}catch{}}}yc(g.afterSanitizeAttributes,Ee,null)},Ro=function cn(Ee){let It=null,mn=b0(Ee);for(yc(g.beforeSanitizeShadowDOM,Ee,null);It=mn.nextNode();)yc(g.uponSanitizeShadowNode,It,null),es(It),Gu(It),It.content instanceof r&&cn(It.content);yc(g.afterSanitizeShadowDOM,Ee,null)};return t.sanitize=function(cn){let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},It=null,mn=null,lr=null,ka=null;if(je=!cn,je&&(cn="<!-->"),typeof cn!="string"&&!rl(cn))if(typeof cn.toString=="function"){if(cn=cn.toString(),typeof cn!="string")throw Mv("dirty is not a string, aborting")}else throw Mv("toString is not a function");if(!t.isSupported)return cn;if(ze||ol(Ee),t.removed=[],typeof cn=="string"&&(on=!1),on){if(cn.nodeName){let yh=_i(cn.nodeName);if(!W[yh]||Q[yh])throw Mv("root node is forbidden and cannot be sanitized in-place")}}else if(cn instanceof a)It=Ba("<!---->"),mn=It.ownerDocument.importNode(cn,!0),mn.nodeType===Nv.element&&mn.nodeName==="BODY"||mn.nodeName==="HTML"?It=mn:It.appendChild(mn);else{if(!Et&&!De&&!ke&&cn.indexOf("<")===-1)return S&&Be?S.createHTML(cn):cn;if(It=Ba(cn),!It)return Et?null:Be?v:""}It&&et&&Vr(It.firstChild);let xa=b0(on?cn:It);for(;lr=xa.nextNode();)es(lr),Gu(lr),lr.content instanceof r&&Ro(lr.content);if(on)return cn;if(Et){if(ht)for(ka=R.call(It.ownerDocument);It.firstChild;)ka.appendChild(It.firstChild);else ka=It;return(J.shadowroot||J.shadowrootmode)&&(ka=L.call(i,ka,!0)),ka}let sl=ke?It.outerHTML:It.innerHTML;return ke&&W["!doctype"]&&It.ownerDocument&&It.ownerDocument.doctype&&It.ownerDocument.doctype.name&&Oc(Ene,It.ownerDocument.doctype.name)&&(sl="<!DOCTYPE "+It.ownerDocument.doctype.name+`> +`+sl),De&&jL([E,w,I],yh=>{sl=Ov(sl,yh," ")}),S&&Be?S.createHTML(sl):sl},t.setConfig=function(){let cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ol(cn),ze=!0},t.clearConfig=function(){fi=null,ze=!1},t.isValidAttribute=function(cn,Ee,It){fi||ol({});let mn=_i(cn),lr=_i(Ee);return zu(mn,lr,It)},t.addHook=function(cn,Ee){typeof Ee=="function"&&Rv(g[cn],Ee)},t.removeHook=function(cn){return hne(g[cn])},t.removeHooks=function(cn){g[cn]=[]},t.removeAllHooks=function(){g=bne()},t}var vne=Sne();var RNe=0,n9={};function Vh(e,t){let n,i=e;l(n9[i])?n=n9[i]:(n=RNe++,n9[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(Vh.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=vne.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});Vh.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};Vh.prototype.equals=function(e){return Vh.equals(this,e)};Vh.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};Vh.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new Vh(e.html,t)};Vh.clone=function(e){if(l(e))return new Vh(e.html,e.showOnScreen)};var Ct=Vh;function Q0(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new pe}Object.defineProperties(Q0.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});Q0.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function i9(e){e._cubeMapBuffers=void 0}Q0.prototype.update=function(e){let{context:t}=e;if(!Q0.isSupported(t))return;if(l(this._texture)){i9(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(i9(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;ql(this._url).then(function(h){f._cubeMapBuffers=h,f._loading=!1}).catch(function(h){f.isDestroyed()||f._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT);let o=tt.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let f={};Object.values(wr.FaceName).forEach(h=>{f[h]=void 0});for(let h=r;h<a;h++)n.push(f)}let c=new Zt({minificationFilter:Kt.LINEAR_MIPMAP_LINEAR}),u=new wr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};Q0.prototype.isDestroyed=function(){return!1};Q0.prototype.destroy=function(){return i9(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var Uh=Q0;function Fv(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?U.clone(e.imageBasedLightingFactor):new U(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=U.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(Fv.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=U.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function ONe(e,t){if(Uh.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Uh(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}Fv.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;U.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(ONe(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};Fv.prototype.isDestroyed=function(){return!1};Fv.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var tC=Fv;var r9=Ur(Wl(),1);var o9,wne="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzYTBjYzY2NC0yMGEyLTQxZDYtYmI2MC1hMWE4ZTBlMGNlNjciLCJpZCI6MjU5LCJpYXQiOjE3MzU4NTEwMzF9.nshpaoC5qpRD4F5diwcjwJ3tddp1OjCSXoMrv37Ales",XL={};XL.defaultAccessToken=wne;XL.defaultServer=new Se({url:"https://api.cesium.com/"});XL.getDefaultTokenCredit=function(e){if(e===wne){if(!l(o9)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;o9=new Ct(t,!0)}return o9}};var zh=XL;function Lc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:MNe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new re("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Se.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new r9.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(Lc.prototype=Object.create(Se.prototype),Lc.prototype.constructor=Lc);Lc.fromAssetId=function(e,t){let n=Lc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Lc(i,n)})};Object.defineProperties(Lc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Lc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Lc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Ct.getIonCredit),i=zh.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Ct.clone(i)),n};Lc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Lc(t._ionEndpoint,t._ionEndpointResource)),e=Se.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Lc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Se.prototype.fetchImage.call(this,e)};Lc.prototype._makeRequest=function(e){return this._isExternal||new r9.default(this.url).authority()!==this._ionEndpointDomain?Se.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Se.prototype._makeRequest.call(this,e))};Lc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,zh.defaultServer),i=y(t.accessToken,zh.defaultAccessToken);n=Se.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function MNe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var cf=Lc;function Hh(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(Hh.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Hh.prototype.get=function(e){return this._array[e]};Hh.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Hh.prototype.peek=function(){return this._array[this._length-1]};Hh.prototype.push=function(e){let t=this.length++;this._array[t]=e};Hh.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Hh.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Hh.prototype.resize=function(e){this.length=e};Hh.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var bl=Hh;var gp={X:0,Y:1,Z:2};gp.Y_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));gp.Z_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));gp.X_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));gp.Z_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));gp.X_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));gp.Y_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));gp.fromName=function(e){return gp[e]};var Fo=Object.freeze(gp);function Dne(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(Dne.prototype,{metadata:{get:function(){return this._metadata}}});var nC=Dne;function n_(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),n_.decode(e)}n_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};n_.decodeWithFromCharCode=function(e){let t="",n=LNe(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function Bv(e,t,n){return t<=e&&e<=n}function LNe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(Bv(u,0,127)){s.push(u);continue}if(Bv(u,194,223)){i=1,t=u&31;continue}if(Bv(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(Bv(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new re("String decoding failed.")}if(!Bv(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?n_.decode=n_.decodeWithTextDecoder:n_.decode=n_.decodeWithFromCharCode;var eu=n_;function NNe(e,t){return t=y(t,0),eu(e,t,Math.min(4,e.length))}var Gh=NNe;function lf(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(lf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var kv=Uint32Array.BYTES_PER_ELEMENT;lf.fromTileType=async function(e,t,n,i,o,r){o=y(o,0);let s=new Uint8Array(i),a=new DataView(i);o+=kv;let c=a.getUint32(o,!0);if(c!==1)throw new re(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=kv,o+=kv;let u=a.getUint32(o,!0);o+=kv;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let h=[];h.length=u;for(let m=0;m<u;++m){let x=Gh(s,o),b=a.getUint32(o+kv*2,!0),T=r[x],C=`${f}${m}`,A=n.getDerivedResource({queryParameters:{compositeIndex:C}});if(l(T))h[m]=Promise.resolve(T(e,t,A,i,o));else throw new re(`Unknown tile content type, ${x}, inside Composite tile`);o+=b}let p=await Promise.all(h);return new lf(e,t,n,p)};lf.prototype.hasProperty=function(e,t){return!1};lf.prototype.getFeature=function(e){};lf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};lf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};lf.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};lf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=d.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};lf.prototype.isDestroyed=function(){return!1};lf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var KL=lf;function FNe(e,t,n){return JSON.parse(eu(e,t,n))}var Bo=FNe;function Za(e){this._id=zn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,Ft.maximumTextureSize),r=Math.ceil(t/Ft.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new U(o,r),i=new oe(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Za.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Za.DEFAULT_COLOR_VALUE=z.WHITE;Za.DEFAULT_SHOW_VALUE=!0;function Ine(e){let t=e._textureDimensions;return t.x*t.y*4}function Pne(e){if(!l(e._batchValues)){let t=Ine(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Rne(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Za.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Rne(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Pne(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Za.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Za.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var BNe=new Array(4);Za.prototype.setColor=function(e,t){if(z.equals(t,Za.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(BNe),i=n[3],o=Pne(this),r=e*4,s=Rne(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Za.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Za.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(Za.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};Za.prototype.getPickColor=function(e){return this._pickIds[e]};function One(e,t,n){let i=e._textureDimensions;return new Rt({context:t,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Zt.NEAREST})}function kNe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=Ine(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,h=c*4;r[h]=z.floatToByte(f.red),r[h+1]=z.floatToByte(f.green),r[h+2]=z.floatToByte(f.blue),r[h+3]=z.floatToByte(f.alpha)}e._pickTexture=One(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function VNe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Za.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&kNe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=One(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),VNe(this))};Za.prototype.isDestroyed=function(){return!1};Za.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Tl=Za;var UNe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zNe={SCALAR:void 0,VEC2:U,VEC3:d,VEC4:oe,MAT2:Ri,MAT3:$,MAT4:F};function HNe(e){let t=e.componentType,n;typeof t=="string"?n=X.fromName(t):n=t;let i=UNe[e.type],o=zNe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return X.createArrayBufferView(n,r,s,i*a)}}}var uf=HNe;function _p(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,GNe(this,e.extension,e.binaryBody)}Object.defineProperties(_p.prototype,{byteLength:{get:function(){return this._byteLength}}});function GNe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,h=s,p=0;l(c.byteOffset)&&(c.componentType=y(c.componentType,X.UNSIGNED_SHORT),c.type=tn.SCALAR,r=uf(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let _;if(l(u)){for(l(u.byteOffset)&&(u.componentType=y(u.componentType,X.UNSIGNED_SHORT),u.type=tn.SCALAR,r=uf(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),_=new Uint16Array(s),h=0,i=0;i<s;++i)_[i]=h,h+=u[i];p+=_.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=y(f.componentType,X.UNSIGNED_SHORT),f.type=tn.SCALAR,r=uf(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,h),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let T=a[i].length,C=a[i].instances,A=WNe(T,C,n);p+=jNe(A),a[i].instances=xt(A,C)}let x=new Array(m).fill(0),b=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],b[i]=x[o],++x[o];p+=b.byteLength,e._classes=a,e._classIds=c,e._classIndexes=b,e._parentCounts=u,e._parentIndexes=_,e._parentIds=f,e._byteLength=p}function WNe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new re("componentType is required.");if(!l(c))throw new re("type is required.");if(!l(n))throw new re(`Property ${o} requires a batch table binary.`);let u=uf(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function jNe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var qNe=[],YNe=[],XNe=0;function KNe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=qNe;c.length=Math.max(c.length,a);let u=++XNe,f=YNe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let h=n(e,t);if(l(h))return h;let p=o[t],_=s[t];for(let m=0;m<p;++m){let x=r[_+m];x!==t&&f.push(x)}}}function ZNe(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(l(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function Vv(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return KNe(e,t,n)}else return n(e,t);return ZNe(e,t,n)}_p.prototype.hasProperty=function(e,t){let n=Vv(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};_p.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(l(o[e]))return!0}return!1};_p.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,Vv(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};_p.prototype.getProperty=function(e,t){return Vv(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(l(a))return l(a.typedArray)?$Ne(a,s):Ge(a[s],!0)})};function $Ne(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}_p.prototype.setProperty=function(e,t,n){let i=Vv(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],u=a.instances[t];if(l(u))return l(u.typedArray)?QNe(u,c,n):u[c]=Ge(n,!0),!0});return l(i)};function QNe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}_p.prototype.isClass=function(e,t){let n=Vv(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};_p.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var iC=_p;var JNe={HIGHLIGHT:0,REPLACE:1,MIX:2},tu=Object.freeze(JNe);var s9=Tl.DEFAULT_COLOR_VALUE,a9=Tl.DEFAULT_SHOW_VALUE;function co(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=y(r,{});let s=eFe(n);this._properties=s,this._batchTableHierarchy=tFe(this,n,i);let a=Lne(t,s,i);this._binaryPropertiesByteLength=nFe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Tl({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}co._deprecationWarning=_s;Object.defineProperties(co.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function eFe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ge(e[n],!0));return t}function tFe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(co._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=o,i=o),!!l(i))return new iC({extension:i,binaryBody:n})}function Lne(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new re("componentType is required.");if(!l(c))throw new re("type is required.");if(!l(n))throw new re(`Property ${o} requires a batch table binary.`);let u=uf(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function nFe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}co.getBinaryProperties=function(e,t,n){return Lne(e,t,n)};co.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};co.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};co.prototype.getShow=function(e){return this._batchTexture.getShow(e)};co.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};co.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};co.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};co.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var iFe=new z;co.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(s9),this.setAllShow(a9);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?y(e.color.evaluateColor(o,iFe),s9):s9,s=l(e.show)?y(e.show.evaluate(o),a9):a9;this.setColor(i,r),this.setShow(i,s)}};function oFe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function rFe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}co.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};co.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};co.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};co.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};co.prototype.hasPropertyBySemantic=function(){return!1};co.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};co.prototype.getPropertyBySemantic=function(e,t){};co.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return oFe(i,e)}let n=this._properties[t];if(l(n))return Ge(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};co.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){rFe(r,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];l(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=Ge(n,!0)};function sFe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + return vec2(centerX + (batchId * stepX), 0.5); +} +`:`uniform vec4 tile_textureStep; +uniform vec2 tile_textureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + float stepY = tile_textureStep.z; + float centerY = tile_textureStep.w; + float xId = mod(batchId, tile_textureDimensions.x); + float yId = floor(batchId / tile_textureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}co.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Nne(o,n,!1),s;return Ft.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${r} +${sFe(i)}${s}`}};function Mne(e,t){return e=Ue.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function aFe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function Nne(e,t,n){if(!l(t))return Mne(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return Mne(e,n);let r=o[0],s=o[2];e=Ue.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) +{ + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +} +vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) +{ + vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); + vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; + return vec4(diffuse.rgb, sourceDiffuse.a); +} +`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,h=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,h),u=` vec4 source = ${f}; + tile_diffuse = tile_diffuse_final(source, tile_featureColor); + tile_main(); +`}else s==="sampler2D"&&(e=aFe(e,t),u=` tile_diffuse = tile_featureColor; + tile_main(); +`);return e=`uniform float tile_colorBlend; +vec4 tile_diffuse = vec4(1.0); +${a}${r} +${e} +void tile_color(vec4 tile_featureColor) +{ +${u}`,n&&(e+=c),e+=`} +`,e}co.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Nne(i,t,!0),Ft.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};co.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=Ue.replaceMain(e,"tile_main"),Ft.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_main(); + out_FragColor = tile_featureColor; + out_FragColor.rgb *= out_FragColor.a; +}`:e+=`uniform sampler2D tile_batchTexture; +uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +void main() +{ + tile_main(); + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } + out_FragColor = featureProperties; + out_FragColor.rgb *= out_FragColor.a; +} +`,e}};function cFe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===tu.HIGHLIGHT)return 0;if(n===tu.REPLACE)return 1;if(n===tu.MIX)return P.clamp(i,P.EPSILON4,1)}co.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return xt(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return cFe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};co.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var i_={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};co.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=lFe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===we.COMPUTE)continue;let h=f.derivedCommands.tileset;(!l(h)||f.dirty)&&(h={},f.derivedCommands.tileset=h,h.originalCommand=uFe(f),f.dirty=!1);let p=h.originalCommand;c!==i_.ALL_OPAQUE&&f.pass!==we.TRANSLUCENT&&(l(h.translucent)||(h.translucent=fFe(p))),c!==i_.ALL_TRANSLUCENT&&f.pass!==we.TRANSLUCENT&&(l(h.opaque)||(h.opaque=dFe(p)),a&&(r||(l(h.zback)||(h.zback=mFe(e.context,p)),s._backfaceCommands.push(h.zback)),(!l(h.stencil)||o._selectionDepth!==gFe(h.stencil))&&(f.renderState.depthMask?h.stencil=pFe(p,o._selectionDepth):h.stencil=h.opaque)));let _=a?h.stencil:h.opaque,m=h.translucent;f.pass!==we.TRANSLUCENT?(c===i_.ALL_OPAQUE&&(n[u]=_),c===i_.ALL_TRANSLUCENT&&(n[u]=m),c===i_.OPAQUE_AND_TRANSLUCENT&&(n[u]=_,n.push(m))):n[u]=p}};function lFe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?i_.ALL_OPAQUE:t===e.featuresLength?i_.ALL_TRANSLUCENT:i_.OPAQUE_AND_TRANSLUCENT}function uFe(e){let t=$e.shallowClone(e),n=t.pass===we.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function fFe(e){let t=$e.shallowClone(e);return t.pass=we.TRANSLUCENT,t.renderState=_Fe(e.renderState),t}function dFe(e){let t=$e.shallowClone(e);return t.renderState=yFe(e.renderState),t}function hFe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function mFe(e,t){let n=$e.shallowClone(t),i=Ge(n.renderState,!0);i.cull.enabled=!0,i.cull.face=bi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Vt.setCesium3DTileBit(),i.stencilMask=Vt.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ge(t.uniformMap);let o=new U(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=hFe(e,t.shaderProgram),n}function pFe(e,t){let n=$e.shallowClone(e),i=Ge(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Vt.SKIP_LOD_MASK,i.stencilTest.reference=Vt.CESIUM_3D_TILE_MASK|t<<Vt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ut.REPLACE,i.stencilTest.backFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ut.REPLACE,i.stencilMask=Vt.CESIUM_3D_TILE_MASK|Vt.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function gFe(e){return(e.renderState.stencilTest.reference&Vt.SKIP_LOD_MASK)>>>Vt.SKIP_LOD_BIT_SHIFT}function _Fe(e){let t=Ge(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=ln.ALPHA_BLEND,t.stencilTest=Vt.setCesium3DTileBit(),t.stencilMask=Vt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function yFe(e){let t=Ge(e,!0);return t.stencilTest=Vt.setCesium3DTileBit(),t.stencilMask=Vt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}co.prototype.update=function(e,t){this._batchTexture.update(e,t)};co.prototype.isDestroyed=function(){return!1};co.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var o_=co;function xFe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var yp=xFe;var Uv=`in vec3 position; +in float a_batchId; + +uniform mat4 u_modifiedModelViewProjection; + +void main() +{ + gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); +} +`;function ff(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(ff.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});ff.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ff.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ff.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ff.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};ff.prototype.getPropertyInherited=function(e){return ff.getPropertyInherited(this._content,this._batchId,e)};ff.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ff.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ff.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ff.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Js=ff;var c9=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},l9=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Cl=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=` +`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},bFe=new c9;Object.assign(Cl,{hooks:bFe,plugins:new l9(Cl),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Cl.max_unop_len=Cl.getMaxKeyLen(Cl.unary_ops);Cl.max_binop_len=Cl.getMaxKeyLen(Cl.binary_ops);var r_=e=>new Cl(e).parse(),TFe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Cl).filter(e=>!TFe.includes(e)&&r_[e]===void 0).forEach(e=>{r_[e]=Cl[e]});r_.Jsep=Cl;var CFe="ConditionalExpression",AFe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:CFe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};r_.plugins.register(AFe);var EFe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},mt=Object.freeze(EFe);function _d(e,t){this._expression=e,e=BFe(e,t),e=VFe(kFe(e)),r_.addBinaryOp("=~",0),r_.addBinaryOp("!~",0);let n;try{n=r_(e)}catch(i){throw new re(i)}this._runtimeAst=Ti(this,n)}Object.defineProperties(_d.prototype,{expression:{get:function(){return this._expression}}});var Pn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new U],cartesian3Array:[new d],cartesian4Array:[new oe],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new U),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new d),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new oe),this.cartesian4Array[this.cartesian4Index++]}};_d.prototype.evaluate=function(e,t){Pn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof oe?z.fromCartesian4(n,t):n instanceof U||n instanceof d||n instanceof oe?n.clone(t):n};_d.prototype.evaluateColor=function(e,t){Pn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};_d.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} +{ + return ${o}; +} +`,o};_d.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};_d.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var SFe=["!","-","+"],Fne=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],QL=/\${(.*?)}/g,vFe=/\\/g,wFe="@#%",DFe=/@#%/g,JL=new z,eN={abs:Ns(Math.abs),sqrt:Ns(Math.sqrt),cos:Ns(Math.cos),sin:Ns(Math.sin),tan:Ns(Math.tan),acos:Ns(Math.acos),asin:Ns(Math.asin),atan:Ns(Math.atan),radians:Ns(P.toRadians),degrees:Ns(P.toDegrees),sign:Ns(P.sign),floor:Ns(Math.floor),ceil:Ns(Math.ceil),round:Ns(Math.round),exp:Ns(Math.exp),exp2:Ns(PFe),log:Ns(Math.log),log2:Ns(RFe),fract:Ns(IFe),length:OFe,normalize:MFe},tN={atan2:ZL(Math.atan2,!1),pow:ZL(Math.pow,!1),min:ZL(Math.min,!0),max:ZL(Math.max,!0),distance:LFe,dot:NFe,cross:FFe},d9={clamp:Bne(P.clamp,!0),mix:Bne(P.lerp,!0)};function IFe(e){return e-Math.floor(e)}function PFe(e){return Math.pow(2,e)}function RFe(e){return P.log2(e)}function Ns(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof U)return U.fromElements(e(n.x),e(n.y),Pn.getCartesian2());if(n instanceof d)return d.fromElements(e(n.x),e(n.y),e(n.z),Pn.getCartesian3());if(n instanceof oe)return oe.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Pn.getCartesian4());throw new re(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function ZL(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof U)return U.fromElements(e(i.x,o),e(i.y,o),Pn.getCartesian2());if(i instanceof d)return d.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Pn.getCartesian3());if(i instanceof oe)return oe.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Pn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof U&&o instanceof U)return U.fromElements(e(i.x,o.x),e(i.y,o.y),Pn.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Pn.getCartesian3());if(i instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Pn.getCartesian4());throw new re(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Bne(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof U&&o instanceof U)return U.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Pn.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Pn.getCartesian3());if(i instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Pn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof U&&o instanceof U&&r instanceof U)return U.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Pn.getCartesian2());if(i instanceof d&&o instanceof d&&r instanceof d)return d.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),Pn.getCartesian3());if(i instanceof oe&&o instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Pn.getCartesian4());throw new re(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function OFe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof U)return U.magnitude(t);if(t instanceof d)return d.magnitude(t);if(t instanceof oe)return oe.magnitude(t);throw new re(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function MFe(e,t){if(typeof t=="number")return 1;if(t instanceof U)return U.normalize(t,Pn.getCartesian2());if(t instanceof d)return d.normalize(t,Pn.getCartesian3());if(t instanceof oe)return oe.normalize(t,Pn.getCartesian4());throw new re(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function LFe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof U&&n instanceof U)return U.distance(t,n);if(t instanceof d&&n instanceof d)return d.distance(t,n);if(t instanceof oe&&n instanceof oe)return oe.distance(t,n);throw new re(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function NFe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof U&&n instanceof U)return U.dot(t,n);if(t instanceof d&&n instanceof d)return d.dot(t,n);if(t instanceof oe&&n instanceof oe)return oe.dot(t,n);throw new re(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function FFe(e,t,n){if(t instanceof d&&n instanceof d)return d.cross(t,n,Pn.getCartesian3());throw new re(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function bt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,KFe(this)}function BFe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function kFe(e){return e.replace(vFe,wFe)}function f9(e){return e.replace(DFe,"\\")}function VFe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new re("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function UFe(e){let t=typeof e.value;if(e.value===null)return new bt(mt.LITERAL_NULL,null);if(t==="boolean")return new bt(mt.LITERAL_BOOLEAN,e.value);if(t==="number")return new bt(mt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new bt(mt.VARIABLE_IN_STRING,e.value):new bt(mt.LITERAL_STRING,f9(e.value))}function zFe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new re(`${o} is not a function.`);return i===0?o==="test"?new bt(mt.LITERAL_BOOLEAN,!1):new bt(mt.LITERAL_NULL,null):(s=Ti(e,c),a=Ti(e,n[0]),new bt(mt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Ti(e,c),new bt(mt.FUNCTION_CALL,o,r);throw new re(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new bt(mt.LITERAL_COLOR,o);if(r=Ti(e,n[0]),l(n[1])){let c=Ti(e,n[1]);return new bt(mt.LITERAL_COLOR,o,[r,c])}return new bt(mt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new re(`${o} requires three arguments.`);return r=[Ti(e,n[0]),Ti(e,n[1]),Ti(e,n[2])],new bt(mt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new re(`${o} requires four arguments.`);return r=[Ti(e,n[0]),Ti(e,n[1]),Ti(e,n[2]),Ti(e,n[3])],new bt(mt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=Ti(e,n[c]);return new bt(mt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new bt(mt.LITERAL_BOOLEAN,!0):new bt(mt.LITERAL_BOOLEAN,!1):(r=Ti(e,n[0]),new bt(mt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new re(`${o} requires exactly one argument.`);return r=Ti(e,n[0]),new bt(mt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new re(`${o} does not take any argument.`);return new bt(mt.UNARY,o)}else if(l(eN[o])){if(i!==1)throw new re(`${o} requires exactly one argument.`);return r=Ti(e,n[0]),new bt(mt.UNARY,o,r)}else if(l(tN[o])){if(i!==2)throw new re(`${o} requires exactly two arguments.`);return s=Ti(e,n[0]),a=Ti(e,n[1]),new bt(mt.BINARY,o,s,a)}else if(l(d9[o])){if(i!==3)throw new re(`${o} requires exactly three arguments.`);s=Ti(e,n[0]),a=Ti(e,n[1]);let c=Ti(e,n[2]);return new bt(mt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new bt(mt.LITERAL_BOOLEAN,!1):(r=Ti(e,n[0]),new bt(mt.UNARY,o,r));if(o==="Number")return i===0?new bt(mt.LITERAL_NUMBER,0):(r=Ti(e,n[0]),new bt(mt.UNARY,o,r));if(o==="String")return i===0?new bt(mt.LITERAL_STRING,""):(r=Ti(e,n[0]),new bt(mt.UNARY,o,r));if(o==="regExp")return HFe(e,t)}}throw new re(`Unexpected function call "${o}".`)}function HFe(e,t){let n=t.arguments;if(n.length===0)return new bt(mt.LITERAL_REGEX,new RegExp);let i=Ti(e,n[0]),o;if(n.length>1){let r=Ti(e,n[1]);if(u9(i)&&u9(r)){try{o=new RegExp(f9(String(i._value)),r._value)}catch(s){throw new re(s)}return new bt(mt.LITERAL_REGEX,o)}return new bt(mt.REGEX,i,r)}if(u9(i)){try{o=new RegExp(f9(String(i._value)))}catch(r){throw new re(r)}return new bt(mt.LITERAL_REGEX,o)}return new bt(mt.REGEX,i)}function GFe(e){if(YFe(e.name)){let t=XFe(e.name);return t.substr(0,8)==="tiles3d_"?new bt(mt.BUILTIN_VARIABLE,t):new bt(mt.VARIABLE,t)}else{if(e.name==="NaN")return new bt(mt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new bt(mt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new bt(mt.LITERAL_UNDEFINED,void 0)}throw new re(`${e.name} is not defined.`)}function WFe(e){let t=e.property.name;if(t==="PI")return new bt(mt.LITERAL_NUMBER,Math.PI);if(t==="E")return new bt(mt.LITERAL_NUMBER,Math.E)}function jFe(e){if(e.property.name==="POSITIVE_INFINITY")return new bt(mt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function qFe(e,t){if(t.object.name==="Math")return WFe(t);if(t.object.name==="Number")return jFe(t);let n,i=Ti(e,t.object);return t.computed?(n=Ti(e,t.property),new bt(mt.MEMBER,"brackets",i,n)):(n=new bt(mt.LITERAL_STRING,t.property.name),new bt(mt.MEMBER,"dot",i,n))}function u9(e){return e._type>=mt.LITERAL_NULL}function YFe(e){return e.substr(0,4)==="czm_"}function XFe(e){return e.substr(4)}function Ti(e,t){let n,i,o,r;if(t.type==="Literal")n=UFe(t);else if(t.type==="CallExpression")n=zFe(e,t);else if(t.type==="Identifier")n=GFe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ti(e,t.argument);if(SFe.indexOf(i)>-1)n=new bt(mt.UNARY,i,s);else throw new re(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Ti(e,t.left),r=Ti(e,t.right),Fne.indexOf(i)>-1)n=new bt(mt.BINARY,i,o,r);else throw new re(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Ti(e,t.left),r=Ti(e,t.right),Fne.indexOf(i)>-1&&(n=new bt(mt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Ti(e,t.test);o=Ti(e,t.consequent),r=Ti(e,t.alternate),n=new bt(mt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=qFe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ti(e,t.elements[a]);n=new bt(mt.ARRAY,s)}else throw t.type==="Compound"?new re("Provide exactly one expression."):new re("Cannot parse expression.");return n}function KFe(e){e._type===mt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===mt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===mt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(eN[e._value])&&(e.evaluate=$Fe(e._value)):e._type===mt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(tN[e._value])&&(e.evaluate=QFe(e._value)):e._type===mt.TERNARY?e.evaluate=JFe(e._value):e._type===mt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===mt.ARRAY?e.evaluate=e._evaluateArray:e._type===mt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===mt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===mt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===mt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===mt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===mt.REGEX?e.evaluate=e._evaluateRegExp:e._type===mt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=ZFe):e.evaluate=e._evaluateLiteral}function ZFe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function $Fe(e){let t=eN[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function QFe(e){let t=tN[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function JFe(e){let t=d9[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function nN(e,t){if(l(e))return e.getPropertyInherited(t)}bt.prototype._evaluateLiteral=function(){return this._value};bt.prototype._evaluateLiteralColor=function(e){let t=JL,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return oe.fromColor(t,Pn.getCartesian4())};bt.prototype._evaluateLiteralVector=function(e){let t=Pn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof U)t.push(c.x,c.y);else if(c instanceof d)t.push(c.x,c.y,c.z);else if(c instanceof oe)t.push(c.x,c.y,c.z,c.w);else throw new re(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new re(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new re(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new re(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return U.fromArray(t,0,Pn.getCartesian2());if(n==="vec3")return d.fromArray(t,0,Pn.getCartesian3());if(n==="vec4")return oe.fromArray(t,0,Pn.getCartesian4())};bt.prototype._evaluateLiteralString=function(){return this._value};bt.prototype._evaluateVariableString=function(e){let t=this._value,n=QL.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=nN(e,o);l(r)||(r=""),t=t.replace(i,r),n=QL.exec(t)}return t};bt.prototype._evaluateVariable=function(e){return nN(e,this._value)};function J0(e){return e._value==="feature"}bt.prototype._evaluateMemberDot=function(e){if(J0(this._left))return nN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof d||t instanceof oe){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};bt.prototype._evaluateMemberBrackets=function(e){if(J0(this._left))return nN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof d||t instanceof oe){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};bt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};bt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};bt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof U)return U.negate(t,Pn.getCartesian2());if(t instanceof d)return d.negate(t,Pn.getCartesian3());if(t instanceof oe)return oe.negate(t,Pn.getCartesian4());if(typeof t=="number")return-t;throw new re(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};bt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof U||t instanceof d||t instanceof oe||typeof t=="number"))throw new re(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};bt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};bt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};bt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};bt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};bt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new re(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};bt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new re(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};bt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.add(t,n,Pn.getCartesian2());if(n instanceof d&&t instanceof d)return d.add(t,n,Pn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.add(t,n,Pn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new re(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.subtract(t,n,Pn.getCartesian2());if(n instanceof d&&t instanceof d)return d.subtract(t,n,Pn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.subtract(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new re(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.multiplyComponents(t,n,Pn.getCartesian2());if(n instanceof U&&typeof t=="number")return U.multiplyByScalar(n,t,Pn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.multiplyByScalar(t,n,Pn.getCartesian2());if(n instanceof d&&t instanceof d)return d.multiplyComponents(t,n,Pn.getCartesian3());if(n instanceof d&&typeof t=="number")return d.multiplyByScalar(n,t,Pn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.multiplyByScalar(t,n,Pn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.multiplyComponents(t,n,Pn.getCartesian4());if(n instanceof oe&&typeof t=="number")return oe.multiplyByScalar(n,t,Pn.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.multiplyByScalar(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new re(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.divideComponents(t,n,Pn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.divideByScalar(t,n,Pn.getCartesian2());if(n instanceof d&&t instanceof d)return d.divideComponents(t,n,Pn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.divideByScalar(t,n,Pn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.divideComponents(t,n,Pn.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.divideByScalar(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new re(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.fromElements(t.x%n.x,t.y%n.y,Pn.getCartesian2());if(n instanceof d&&t instanceof d)return d.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Pn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new re(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof d&&t instanceof d||n instanceof oe&&t instanceof oe?t.equals(n):t===n};bt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof d&&t instanceof d||n instanceof oe&&t instanceof oe?!t.equals(n):t!==n};bt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new re(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};bt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};bt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};bt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};bt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};bt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};bt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};bt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};bt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};bt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new re(o)}return i};bt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new re(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};bt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new re(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new re(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};bt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new re(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};bt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof U||t instanceof d||t instanceof oe)return String(t);throw new re(`Unexpected function call "${this._value}".`)};function kne(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==mt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,o,r,s,JL)}function Vne(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==mt.LITERAL_NUMBER)return;let i=JL;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function s_(e){return e%1===0?e.toFixed(1):e.toString()}function e2e(e){let t=s_(e.red),n=s_(e.green),i=s_(e.blue);return`vec3(${t}, ${n}, ${i})`}function $L(e){let t=s_(e.red),n=s_(e.green),i=s_(e.blue),o=s_(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function Une(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function zne(e,t){return l(t[e])?t[e]:_d.NULL_SENTINEL}_d.NULL_SENTINEL="czm_infinity";bt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=Une(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=Une(this._value,e,t,this));let u,f,h;switch(a){case mt.VARIABLE:return J0(this)?void 0:zne(c,e);case mt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(eN[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new re(`Error generating style shader: "${c}" is not supported.`);return c+o;case mt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(tN[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case mt.TERNARY:if(l(d9[c]))return`${c}(${o}, ${r}, ${s})`;break;case mt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case mt.MEMBER:return J0(this._left)?zne(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case mt.FUNCTION_CALL:throw new re(`Error generating style shader: "${c}" is not supported.`);case mt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new re("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case mt.REGEX:throw new re("Error generating style shader: Regular expressions are not supported.");case mt.VARIABLE_IN_STRING:throw new re("Error generating style shader: Converting a variable to a string is not supported.");case mt.LITERAL_NULL:return _d.NULL_SENTINEL;case mt.LITERAL_BOOLEAN:return c?"true":"false";case mt.LITERAL_NUMBER:return s_(c);case mt.LITERAL_STRING:if(l(n)&&n._type===mt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||J0(n._left)))return c;if(i=z.fromCssColorString(c,JL),l(i))return e2e(i);throw new re("Error generating style shader: String literals are not supported.");case mt.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let p=u[0],_=u[1];return _!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${_})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Vne(this),l(i)?$L(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Vne(this),l(i)?$L(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=kne(this),l(i)?$L(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=kne(this),l(i)?(i.alpha!==1&&(t.translucent=!0),$L(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case mt.LITERAL_VECTOR:f=o.length,h=`${c}(`;for(let p=0;p<f;++p)h+=o[p],p<f-1&&(h+=", ");return h+=")",h;case mt.LITERAL_REGEX:throw new re("Error generating style shader: Regular expressions are not supported.");case mt.LITERAL_UNDEFINED:return _d.NULL_SENTINEL;case mt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};bt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case mt.VARIABLE:J0(this)||e.push(s);break;case mt.VARIABLE_IN_STRING:for(a=QL.exec(s);a!==null;)e.push(a[1]),a=QL.exec(s);break;case mt.LITERAL_STRING:l(t)&&t._type===mt.MEMBER&&J0(t._left)&&e.push(s);break}};var yd=_d;function xp(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,d.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,kn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(xp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var t2e={position:0,a_batchId:1};function n2e(e,t){if(l(e._va))return;let n=_t.createVertexBuffer({context:t,typedArray:e._positions,usage:Fe.STATIC_DRAW}),i=_t.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Fe.STATIC_DRAW}),o=_t.createIndexBuffer({context:t,typedArray:e._indices,usage:Fe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:X.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:X.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new ni({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ni({context:t,attributes:r,indexBuffer:_t.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Fe.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function i2e(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,t2e),o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Ue.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() +{ + czm_non_pick_main(); + out_FragColor = ${o}; +} +`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(Uv),c=n.getFragmentShaderCallback(!1,void 0,!0)(H0);o=n.getPickId();let u=new Ue({sources:[a]}),f=new Ue({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Ue({sources:[Uv]}),f=new Ue({defines:["VECTOR_TILE"],sources:[H0]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Ue.replaceMain(c,"czm_non_pick_main"),c=`${c} +void main() +{ + czm_non_pick_main(); + out_FragColor = ${o}; +} +`;let h=new Ue({sources:[a]}),p=new Ue({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i})}function Hne(e){let t=e?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ut.KEEP,zFail:ut.DECREMENT_WRAP,zPass:ut.KEEP},backFunction:t,backOperation:{fail:ut.KEEP,zFail:ut.INCREMENT_WRAP,zPass:ut.KEEP},reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},depthMask:!1}}var o2e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND},r2e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function s2e(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(Hne(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(Hne(!0)),e._rsColorPass=Ve.fromCache(o2e),e._rsPickPass=Ve.fromCache(r2e))}var ex=new F,Gne=new d;function a2e(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return F.clone(i,ex),F.multiplyByPoint(ex,e._center,Gne),F.setTranslation(ex,Gne,ex),F.multiply(o,ex,ex),ex},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function h9(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],h=s[f],p=i[h],_=o[h],m=new e.constructor(e.buffer,a*p,_);t.set(m,n),i[h]=n,n+=_}return n}function c2e(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=h9(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=h9(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let h=u;u=h9(n,s,u,i,o,f.batchIds,r),f.offset=h,f.count=u-h,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function m9(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],h=s[f],p=i[h],_=o[h];t.copyFromBuffer(e,p*a,n*a,_*a),i[h]=n,n+=_}return n}function l2e(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=m9(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let h=t.pop();if(z.equals(h.color,r.color))u=m9(a,c,u,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=u-r.offset;else{let p=u;u=m9(a,c,u,n,i,h.batchIds,o),h.offset=p,h.count=u-p,s.push(h),r=h}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function u2e(e,t){return t.color.toRgba()-e.color.toRgba()}function f2e(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(u2e),t.webgl2?l2e(e,n):c2e(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function d2e(e,t){let n=f2e(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=y(e._modelMatrix,F.IDENTITY),f=e._uniformMap,h=e._boundingVolume;for(let p=0;p<r;++p){let _=o[p].offset,m=o[p].count,x=i[p*2];l(x)||(x=i[p*2]=new $e({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=_,x.count=m,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=f,x.boundingVolume=h,x.cull=!1,x.pass=we.TERRAIN_CLASSIFICATION;let b=$e.shallowClone(x,x.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=we.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=b;let T=i[p*2+1];l(T)||(T=i[p*2+1]=new $e({owner:e})),T.vertexArray=a,T.modelMatrix=u,T.offset=_,T.count=m,T.renderState=e._rsColorPass,T.shaderProgram=c,T.uniformMap=f,T.boundingVolume=h,T.cull=!1,T.pass=we.TERRAIN_CLASSIFICATION;let C=$e.shallowClone(T,T.derivedCommands.tileset);C.pass=we.CESIUM_3D_TILE_CLASSIFICATION,T.derivedCommands.tileset=C}e._commandsDirty=!0}function h2e(e,t){if(e.classificationType===kn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let u=i[c]=$e.shallowClone(n[a],i[c]);u.shaderProgram=o,u.pass=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function m2e(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=y(e._modelMatrix,F.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],h=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new $e({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=h,p.pass=we.TERRAIN_CLASSIFICATION;let _=$e.shallowClone(p,p.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=we.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=_;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new $e({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=a,m.boundingVolume=h,m.pass=we.TERRAIN_CLASSIFICATION;let x=$e.shallowClone(m,m.derivedCommands.tileset);x.pass=we.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=x}e._pickCommandsDirty=!1}xp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Js(e,r)}};xp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function p2e(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=z.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var g2e=new z,_2e=z.WHITE,y2e=!0,x2e=/\$/;xp.prototype.applyStyle=function(e,t){if(!l(e)){p2e(this,t);return}let n=e.color,i=n instanceof yd&&!x2e.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,g2e):_2e,c.show=l(e.show)?e.show.evaluate(c):y2e}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};xp.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let x=c[f].offset,b=c[f].count;if(s>=x&&s<x+b)break}c.push(new yp({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let h=[],p=[],_=c[f].batchIds,m=_.length;for(let x=0;x<m;++x){let b=_[x];if(b===e)continue;let T=n[b];o[T]<s?h.push(b):p.push(b)}p.length!==0&&c.push(new yp({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),h.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=h):c.splice(f,1),this._batchDirty=!0};function Wne(e,t,n,i){let o=e.classificationType,r=o!==kn.CESIUM_3D_TILE,s=o!==kn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=we.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=we.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function b2e(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=we.OPAQUE,n.push(r)}}function T2e(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Me.LINES):(n=e._rsColorPass,i=Me.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}xp.prototype.update=function(e){let t=e.context;n2e(this,t),i2e(this,t),s2e(this),a2e(this,t);let n=e.passes;n.render&&(d2e(this,t),h2e(this,e),T2e(this),this._debugWireframe?b2e(e,this._commands):Wne(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(m2e(this),Wne(this,e,this._pickCommands))};xp.prototype.isDestroyed=function(){return!1};xp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var oC=xp;function nu(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=d.clone(this._boundingVolume.center):this._center=d.clone(d.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=kn.BOTH}Object.defineProperties(nu.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});nu.packedBoxLength=F.packedLength+d.packedLength;nu.packedCylinderLength=F.packedLength+2;nu.packedEllipsoidLength=F.packedLength+d.packedLength;nu.packedSphereLength=d.packedLength+1;function C2e(e){let t=new Float64Array(F.packedLength+d.packedLength),n=0;return d.pack(e._center,t,n),n+=d.packedLength,F.pack(e._modelMatrix,t,n),t}function A2e(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=ae.unpack(t,n),n+=ae.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],h=t[n++],p=t[n++],_=new Array(p);for(let m=0;m<p;++m)_[m]=t[n++];a[c]=new yp({color:u,offset:f,count:h,batchIds:_})}return i}var E2e=new yi("createVectorTileGeometries",5),S2e=new z;function v2e(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let x=e._batchTable;for(let b=0;b<m;++b){let T=x.getColor(b,S2e);u[b]=T.toRgba()}f=e._packedBuffer=C2e(e)}let h=[];l(t)&&h.push(t.buffer,n.buffer),l(i)&&h.push(i.buffer,o.buffer),l(r)&&h.push(r.buffer,s.buffer),l(a)&&h.push(a.buffer,c.buffer),h.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},_=e._verticesPromise=E2e.scheduleTask(p,h);return l(_)?_.then(function(m){if(e.isDestroyed())return;let x=new Float64Array(m.packedBuffer);A2e(e,x)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),w2e(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function w2e(e){l(e._primitive)||(e._primitive=new oC({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}nu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};nu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};nu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};nu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};nu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=v2e(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};nu.prototype.isDestroyed=function(){return!1};nu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var a_=nu;function Wh(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,P2e(this,i,o)}Object.defineProperties(Wh.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function D2e(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function I2e(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let h=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(h&&p)throw new re("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=m++;if(!l(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var tx=Uint32Array.BYTES_PER_ELEMENT;function P2e(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=tx;let r=o.getUint32(n,!0);if(r!==1)throw new re(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=tx;let s=o.getUint32(n,!0);if(n+=tx,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=tx,a===0)throw new re("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=tx;let u=o.getUint32(n,!0);n+=tx;let f=o.getUint32(n,!0);n+=tx;let h=Bo(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let _,m;u>0&&(_=Bo(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let x=y(h.BOXES_LENGTH,0),b=y(h.CYLINDERS_LENGTH,0),T=y(h.ELLIPSOIDS_LENGTH,0),C=y(h.SPHERES_LENGTH,0),A=x+b+T+C,S=new o_(e,A,_,m,D2e(e));if(e._batchTable=S,A===0)return;let v=e.tile.computedTransform,D;l(h.RTC_CENTER)&&(D=d.unpack(h.RTC_CENTER),F.multiplyByPoint(v,D,D));let O=I2e(h,p);if(x>0||b>0||T>0||C>0){let R,M,L,g;if(x>0){let E=p.byteOffset+h.BOXES.byteOffset;R=new Float32Array(p.buffer,E,a_.packedBoxLength*x)}if(b>0){let E=p.byteOffset+h.CYLINDERS.byteOffset;M=new Float32Array(p.buffer,E,a_.packedCylinderLength*b)}if(T>0){let E=p.byteOffset+h.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,E,a_.packedEllipsoidLength*T)}if(C>0){let E=p.byteOffset+h.SPHERES.byteOffset;g=new Float32Array(p.buffer,E,a_.packedSphereLength*C)}return e._geometries=new a_({boxes:R,boxBatchIds:O.boxes,cylinders:M,cylinderBatchIds:O.cylinders,ellipsoids:L,ellipsoidBatchIds:O.ellipsoids,spheres:g,sphereBatchIds:O.spheres,center:D,modelMatrix:v,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function jne(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}Wh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Wh.prototype.getFeature=function(e){return jne(this),this._features[e]};Wh.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};Wh.prototype.applyStyle=function(e){jne(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};Wh.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};Wh.prototype.pick=function(e,t,n){};Wh.prototype.isDestroyed=function(){return!1};Wh.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var iN=Wh;var p9={};p9.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),qne(i,o,r,s);return c};p9.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),qne(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function qne(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var zv=p9;var nx=30,R2e=1<<nx,O2e=1<<nx+1>>>0,g9=2*nx+1,c_=4,Kne=[],Zne=[],M2e=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],l_=1,rC=2,oN=[l_,0,0,l_|rC];function jr(e){if(!zt.supportsBigInt())throw new re("S2 required BigInt support");this._cellId=e,this._level=jr.getLevel(e)}jr.fromToken=function(e){return new jr(jr.getIdFromToken(e))};jr.isValidId=function(e){return!(e<=0||e>>BigInt(g9)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};jr.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?jr.isValidId(jr.getIdFromToken(e)):!1};jr.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};jr.getTokenFromId=function(e){let t=Math.floor(G2e(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};jr.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return nx-(t>>1)};jr.prototype.getChild=function(e){let t=Jne(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new jr(n)};jr.prototype.getParent=function(){let e=Jne(this._cellId)<<BigInt(2);return new jr(this._cellId&~e+BigInt(1)|e)};jr.prototype.getParentAtLevel=function(e){let t=z2e(e);return new jr(this._cellId&-t|t)};jr.prototype.getCenter=function(e){e=y(e,ee.WGS84);let t=L2e(this._cellId,this._level);t=d.normalize(t,t);let n=new fe.fromCartesian(t,ee.UNIT_SPHERE);return fe.toCartesian(n,e,new d)};jr.prototype.getVertex=function(e,t){t=y(t,ee.WGS84);let n=N2e(this._cellId,this._level,e);n=d.normalize(n,n);let i=new fe.fromCartesian(n,ee.UNIT_SPHERE);return fe.toCartesian(i,t,new d)};jr.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(g9-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new jr(a)};function L2e(e,t){let n=F2e(e,t);return B2e(n[0],n[1],n[2])}function N2e(e,t,n){let i=$ne(e,t),o=k2e([i[1],i[2]],t),r=n>>1&1;return Qne(i[0],o[0][r^n&1],o[1][r])}function F2e(e,t){let n=$ne(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function $ne(e){Kne.length===0&&U2e();let t=Number(e>>BigInt(g9)),n=t&l_,i=(1<<c_)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?nx-7*c_:c_))-1;n+=Number(e>>BigInt(s*2*c_+1)&BigInt(c))<<2,n=Zne[n];let u=s*c_;o+=n>>c_+2<<u,r+=(n>>2&i)<<u,n&=l_|rC}return[t,o,r]}function B2e(e,t,n){let i=Yne(t),o=Yne(n),r=rN(i),s=rN(o);return Qne(e,r,s)}function Qne(e,t,n){switch(e){case 0:return new d(1,t,n);case 1:return new d(-t,1,n);case 2:return new d(-t,-n,1);case 3:return new d(-1,-n,-t);case 4:return new d(n,-1,-t);default:return new d(n,t,-1)}}function rN(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Yne(e){return 1/O2e*e}function k2e(e,t){let n=[[],[]],i=V2e(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=rN(Xne(r)),n[o][1]=rN(Xne(s))}return n}function V2e(e){return 1<<nx-e>>>0}function Xne(e){return 1/R2e*e}function u_(e,t,n,i,o,r){if(e===c_){let s=(t<<c_)+n;Kne[(s<<2)+i]=(o<<2)+r,Zne[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=M2e[r];u_(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^oN[0]),u_(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^oN[1]),u_(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^oN[2]),u_(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^oN[3])}}function U2e(){u_(0,0,0,0,0,0),u_(0,0,0,l_,0,l_),u_(0,0,0,rC,0,rC),u_(0,0,0,l_|rC,0,l_|rC)}function Jne(e){return e&~e+BigInt(1)}function z2e(e){return BigInt(1)<<BigInt(2*(nx-e))}var H2e=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function G2e(e){return H2e[(-e&e)%BigInt(67)]}var f_=jr;function W2e(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ri=W2e;function _9(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new re(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=j2e(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function j2e(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(_9.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});_9.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var Hv=_9;function bp(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(bp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});bp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};bp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};bp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};bp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};bp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};bp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};bp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var Gv=bp;var sN={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};sN.getBranchingFactor=function(e){switch(e){case sN.OCTREE:return 8;case sN.QUADTREE:return 4}};var os=Object.freeze(sN);function ea(){}Object.defineProperties(ea.prototype,{class:{get:function(){he.throwInstantiationError()}}});ea.prototype.hasProperty=function(e){he.throwInstantiationError()};ea.prototype.hasPropertyBySemantic=function(e){he.throwInstantiationError()};ea.prototype.getPropertyIds=function(e){he.throwInstantiationError()};ea.prototype.getProperty=function(e){he.throwInstantiationError()};ea.prototype.setProperty=function(e,t){he.throwInstantiationError()};ea.prototype.getPropertyBySemantic=function(e){he.throwInstantiationError()};ea.prototype.setPropertyBySemantic=function(e,t){he.throwInstantiationError()};ea.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};ea.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};ea.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};ea.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ge(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ea.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};ea.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return ea.getProperty(o.id,t,n)};ea.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?ea.setProperty(r.id,t,n,i):!1};var Fn=ea;function Tp(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Tp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Tp.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};Tp.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};Tp.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};Tp.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};Tp.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};Tp.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};Tp.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var aN=Tp;var Lt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Lt.getMinimum=function(e){switch(e){case Lt.INT8:return-128;case Lt.UINT8:return 0;case Lt.INT16:return-32768;case Lt.UINT16:return 0;case Lt.INT32:return-2147483648;case Lt.UINT32:return 0;case Lt.INT64:return zt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Lt.UINT64:return zt.supportsBigInt()?BigInt(0):0;case Lt.FLOAT32:return-34028234663852886e22;case Lt.FLOAT64:return-Number.MAX_VALUE}};Lt.getMaximum=function(e){switch(e){case Lt.INT8:return 127;case Lt.UINT8:return 255;case Lt.INT16:return 32767;case Lt.UINT16:return 65535;case Lt.INT32:return 2147483647;case Lt.UINT32:return 4294967295;case Lt.INT64:return zt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Lt.UINT64:return zt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Lt.FLOAT32:return 34028234663852886e22;case Lt.FLOAT64:return Number.MAX_VALUE}};Lt.isIntegerType=function(e){switch(e){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.INT64:case Lt.UINT64:return!0;default:return!1}};Lt.isUnsignedIntegerType=function(e){switch(e){case Lt.UINT8:case Lt.UINT16:case Lt.UINT32:case Lt.UINT64:return!0;default:return!1}};Lt.isVectorCompatible=function(e){switch(e){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.FLOAT32:case Lt.FLOAT64:return!0;default:return!1}};Lt.normalize=function(e,t){return Math.max(Number(e)/Number(Lt.getMaximum(t)),-1)};Lt.unnormalize=function(e,t){let n=Lt.getMaximum(t),i=Lt.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Lt.INT64||t===Lt.UINT64)&&zt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Lt.applyValueTransform=function(e,t,n){return n*e+t};Lt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Lt.getSizeInBytes=function(e){switch(e){case Lt.INT8:case Lt.UINT8:return 1;case Lt.INT16:case Lt.UINT16:return 2;case Lt.INT32:case Lt.UINT32:return 4;case Lt.INT64:case Lt.UINT64:return 8;case Lt.FLOAT32:return 4;case Lt.FLOAT64:return 8}};Lt.fromComponentDatatype=function(e){switch(e){case X.BYTE:return Lt.INT8;case X.UNSIGNED_BYTE:return Lt.UINT8;case X.SHORT:return Lt.INT16;case X.UNSIGNED_SHORT:return Lt.UINT16;case X.INT:return Lt.INT32;case X.UNSIGNED_INT:return Lt.UINT32;case X.FLOAT:return Lt.FLOAT32;case X.DOUBLE:return Lt.FLOAT64}};Lt.toComponentDatatype=function(e){switch(e){case Lt.INT8:return X.BYTE;case Lt.UINT8:return X.UNSIGNED_BYTE;case Lt.INT16:return X.SHORT;case Lt.UINT16:return X.UNSIGNED_SHORT;case Lt.INT32:return X.INT;case Lt.UINT32:return X.UNSIGNED_INT;case Lt.FLOAT32:return X.FLOAT;case Lt.FLOAT64:return X.DOUBLE}};var kt=Object.freeze(Lt);var Vo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Vo.isVectorType=function(e){switch(e){case Vo.VEC2:case Vo.VEC3:case Vo.VEC4:return!0;default:return!1}};Vo.isMatrixType=function(e){switch(e){case Vo.MAT2:case Vo.MAT3:case Vo.MAT4:return!0;default:return!1}};Vo.getComponentCount=function(e){switch(e){case Vo.SCALAR:case Vo.STRING:case Vo.ENUM:case Vo.BOOLEAN:return 1;case Vo.VEC2:return 2;case Vo.VEC3:return 3;case Vo.VEC4:return 4;case Vo.MAT2:return 4;case Vo.MAT3:return 9;case Vo.MAT4:return 16}};Vo.getMathType=function(e){switch(e){case Vo.VEC2:return U;case Vo.VEC3:return d;case Vo.VEC4:return oe;case Vo.MAT2:return Ri;case Vo.MAT3:return $;case Vo.MAT4:return F;default:return}};var ct=Object.freeze(Vo);function Aa(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&kt.isIntegerType(i)&&y(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=Ge(e.min,!0),this._max=Ge(e.max,!0),this._normalized=r;let s=Ge(e.offset,!0),a=Ge(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ge(e.noData,!0),this._default=Ge(e.default,!0),this._required=y(e.required,!0),this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}Aa.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=q2e(n),o=Y2e(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=y(n.required,!1):r=!1,new Aa({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(Aa.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function q2e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===ct.SCALAR||ct.isMatrixType(t)||ct.isVectorType(t))return!1;if(l(kt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function Y2e(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===ct.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===ct.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===ct.SCALAR||ct.isMatrixType(n)||ct.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===ct.BOOLEAN||n===ct.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===ct.BOOLEAN||i===ct.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(kt[i]))return{type:ct.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(kt[n]))return{type:ct.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}Aa.prototype.normalize=function(e){return this._normalized?y9(e,this._valueType,kt.normalize):e};Aa.prototype.unnormalize=function(e){return this._normalized?y9(e,this._valueType,kt.unnormalize):e};Aa.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Aa.valueTransformInPlace(e,this._offset,this._scale,kt.applyValueTransform)};Aa.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Aa.valueTransformInPlace(e,this._offset,this._scale,kt.unapplyValueTransform)};Aa.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,o=ct.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};Aa.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!iie(e,t))return e};function iie(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!iie(e[n],t[n]))return!1;return!0}Aa.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=ct.getMathType(this._type),i=this._isArray,o=ct.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Aa.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=ct.getMathType(this._type),i=this._isArray,o=ct.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Aa.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?X2e(this,e):oie(this,e)};function X2e(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=oie(e,t[i]);if(l(o))return o}}function oie(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return ct.isVectorType(n)?K2e(t,n,i):ct.isMatrixType(n)?Z2e(t,n,i):n===ct.STRING?$2e(t):n===ct.BOOLEAN?Q2e(t):n===ct.ENUM?J2e(t,o):eBe(t,i,r)}function K2e(e,t,n){if(!kt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===ct.VEC2&&!(e instanceof U))return`vector value ${e} must be a Cartesian2`;if(t===ct.VEC3&&!(e instanceof d))return`vector value ${e} must be a Cartesian3`;if(t===ct.VEC4&&!(e instanceof oe))return`vector value ${e} must be a Cartesian4`}function Z2e(e,t,n){if(!kt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===ct.MAT2&&!(e instanceof Ri))return`matrix value ${e} must be a Matrix2`;if(t===ct.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===ct.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function $2e(e){if(typeof e!="string")return cN(e,ct.STRING)}function Q2e(e){if(typeof e!="boolean")return cN(e,ct.BOOLEAN)}function J2e(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function eBe(e,t,n){let i=typeof e;switch(t){case kt.INT8:case kt.UINT8:case kt.INT16:case kt.UINT16:case kt.INT32:case kt.UINT32:case kt.FLOAT32:case kt.FLOAT64:return i!=="number"?cN(e,t):isFinite(e)?tie(e,t,n):nie(e,t);case kt.INT64:case kt.UINT64:return i!=="number"&&i!=="bigint"?cN(e,t):i==="number"&&!isFinite(e)?nie(e,t):tie(e,t,n)}}function cN(e,t){return`value ${e} does not match type ${t}`}function eie(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function tie(e,t,n){if(n){let i=kt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?eie(e,t,n):void 0}if(e<kt.getMinimum(t)||e>kt.getMaximum(t))return eie(e,t,n)}function nie(e,t){return`value ${e} of type ${t} must be finite`}function y9(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=y9(e[i],t,n);return e}Aa.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=Aa.valueTransformInPlace(e[o],t[o],n[o],i);return e};var Cp=Aa;function Wv(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=r===ct.STRING,h=r===ct.BOOLEAN,p=0,_;if(a){let g=y(n.arrayOffsetType,n.offsetType);g=y(kt[g],kt.UINT32);let E=y(n.arrayOffsets,n.arrayOffsetBufferView);_=new x9(o[E],g,t+1),p+=_.typedArray.byteLength}let m=ct.getComponentCount(r),x;a?x=_.get(t)-_.get(0):s?x=t*i.arrayLength:x=t;let b=m*x,T;if(f){let g=y(n.stringOffsetType,n.offsetType);g=y(kt[g],kt.UINT32);let E=y(n.stringOffsets,n.stringOffsetBufferView);T=new x9(o[E],g,b+1),p+=T.typedArray.byteLength}(f||h)&&(c=kt.UINT8);let C;f?C=T.get(b)-T.get(0):h?C=Math.ceil(b/8):C=b;let A=y(n.values,n.bufferView),S=new x9(o[A],c,C);p+=S.typedArray.byteLength;let v=n.offset,D=n.scale,O=i.hasValueTransform||l(v)||l(D);v=y(v,i.offset),D=y(D,i.scale),v=rie(v),D=rie(D);let R,M,L=this;f?R=function(g){return iBe(g,L._values,L._stringOffsets)}:h?(R=function(g){return oBe(g,L._values)},M=function(g,E){rBe(g,L._values,E)}):l(u)?(R=function(g){let E=L._values.get(g);return u.namesByValue[E]},M=function(g,E){let w=u.valuesByName[E];L._values.set(g,w)}):(R=function(g){return L._values.get(g)},M=function(g,E){L._values.set(g,E)}),this._arrayOffsets=_,this._stringOffsets=T,this._values=S,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=D,this._hasValueTransform=O,this._getValue=R,this._setValue=M,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(Wv.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});Wv.prototype.get=function(e){let t=tBe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=hBe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};Wv.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=mBe(this,t),t=n.unnormalize(t),nBe(this,e,t)};Wv.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function rie(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function tBe(e,t){aie(e)&&cie(e);let n=e._classProperty,i=n.isArray,o=n.type,r=ct.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ge(s,!0):s}return!i&&r===1?e._getValue(t):sie(e,n,t)}function sie(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=ct.getComponentCount(t.type);i*=s,o*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function nBe(e,t,n){fBe(e,t,n)&&cie(e);let i=e._classProperty,o=i.isArray,r=i.type,s=ct.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Ge(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=y(i.arrayLength,1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function iBe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return eu(t.typedArray,i,o)}function oBe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function rBe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function sBe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function aBe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function cBe(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function lBe(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function uBe(e){switch(e){case kt.INT8:return X.BYTE;case kt.UINT8:return X.UNSIGNED_BYTE;case kt.INT16:return X.SHORT;case kt.UINT16:return X.UNSIGNED_SHORT;case kt.INT32:return X.INT;case kt.UINT32:return X.UNSIGNED_INT;case kt.FLOAT32:return X.FLOAT;case kt.FLOAT64:return X.DOUBLE}}function aie(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===ct.STRING||i===kt.INT64&&!zt.supportsBigInt64Array()||i===kt.UINT64&&!zt.supportsBigUint64Array()}function fBe(e,t,n){if(aie(e))return!0;let i=e._arrayOffsets;if(l(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function cie(e){e._unpackedValues=dBe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function dBe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=ct.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=sie(e,i,a);return n}function hBe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Cp.valueTransformInPlace(t,e._offset,e._scale,kt.applyValueTransform)}function mBe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Cp.valueTransformInPlace(t,e._offset,e._scale,kt.unapplyValueTransform)}function x9(e,t,n){let i=this,o,r,s;if(t===kt.INT64)zt.supportsBigInt()?zt.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return aBe(a,i)}):(yt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return sBe(a,i)});else if(t===kt.UINT64)zt.supportsBigInt()?zt.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return lBe(a,i)}):(yt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return cBe(a,i)});else{let a=uBe(t);o=X.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var lN=Wv;function xd(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new lN({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(xd.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});xd.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};xd.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};xd.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};xd.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=pBe(this._class,t),i};xd.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};xd.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};xd.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return l(o)&&(i=o[t]),l(i)?this.setProperty(e,i.id,n):!1};xd.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};xd.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function pBe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let o=i.default;return i.isArray&&(o=Ge(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var iu=xd;function d_(){}Object.defineProperties(d_.prototype,{cacheKey:{get:function(){he.throwInstantiationError()}}});d_.prototype.load=function(){he.throwInstantiationError()};d_.prototype.unload=function(){};d_.prototype.process=function(e){return!1};d_.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=` +${t.message}`);let n=new re(e);return l(t)&&(n.stack=`Original stack: +${t.stack} +Handler stack: +${n.stack}`),n};d_.prototype.isDestroyed=function(){return!1};d_.prototype.destroy=function(){return this.unload(),ue(this)};var Ki=d_;var gBe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},pt=Object.freeze(gBe);function Ap(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(Ap.prototype=Object.create(Ki.prototype),Ap.prototype.constructor=Ap);Object.defineProperties(Ap.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Ap.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=_Be(this),this._promise)};async function _Be(e){let t=e._resource;e._state=pt.LOADING;try{let n=await Ap._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=pt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=pt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Ap._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Ap.prototype.unload=function(){this._typedArray=void 0};var sC=Ap;var sJt=function(){var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G:Qdkr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;A9pLdbk;QqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbba:vbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(_){n=_.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(_){for(var m=new Uint8Array(_.length),x=0;x<_.length;++x){var b=_.charCodeAt(x);m[x]=b>96?b-97:b>64?b-39:b+4}for(var T=0,x=0;x<_.length;++x)m[T++]=m[x]<60?t[m[x]]:(m[x]-60)*64+m[++x];return m.buffer.slice(0,T)}function r(_){if(!_)throw new Error("Assertion failed")}function s(_){return new Uint8Array(_.buffer,_.byteOffset,_.byteLength)}function a(_,m,x,b){var T=n.exports.sbrk,C=T(m.length*4),A=T(x*4),S=new Uint8Array(n.exports.memory.buffer),v=s(m);S.set(v,C),b&&b(C,C,m.length,x);var D=_(A,C,m.length,x);S=new Uint8Array(n.exports.memory.buffer);var O=new Uint32Array(x);new Uint8Array(O.buffer).set(S.subarray(A,A+x*4)),v.set(S.subarray(C,C+m.length*4)),T(C-T(0));for(var R=0;R<m.length;++R)m[R]=O[m[R]];return[O,D]}function c(_,m,x,b){var T=n.exports.sbrk,C=T(x*4),A=T(x*b),S=new Uint8Array(n.exports.memory.buffer);S.set(s(m),A),_(C,A,x,b),S=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(x);return new Uint8Array(v.buffer).set(S.subarray(C,C+x*4)),T(C-T(0)),v}function u(_,m,x,b,T){var C=n.exports.sbrk,A=C(m),S=C(b*T),v=new Uint8Array(n.exports.memory.buffer);v.set(s(x),S);var D=_(A,m,S,b,T),O=new Uint8Array(D);return O.set(v.subarray(A,A+D)),C(A-C(0)),O}function f(_){for(var m=0,x=0;x<_.length;++x){var b=_[x];m=m<b?b:m}return m}function h(_,m){if(r(m==2||m==4),m==4)return new Uint32Array(_.buffer,_.byteOffset,_.byteLength/4);var x=new Uint16Array(_.buffer,_.byteOffset,_.byteLength/2);return new Uint32Array(x)}function p(_,m,x,b,T,C,A){var S=n.exports.sbrk,v=S(x*b),D=S(x*C),O=new Uint8Array(n.exports.memory.buffer);O.set(s(m),D),_(v,x,b,T,D,A);var R=new Uint8Array(x*b);return R.set(O.subarray(v,v+x*b)),S(v-S(0)),R}return{ready:i,supported:!0,reorderMesh:function(_,m,x){var b=m?x?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,_,f(_)+1,b)},reorderPoints:function(_,m){return r(_ instanceof Float32Array),r(_.length%m==0),r(m>=3),c(n.exports.meshopt_spatialSortRemap,_,_.length/m,m*4)},encodeVertexBuffer:function(_,m,x){r(x>0&&x<=256),r(x%4==0);var b=n.exports.meshopt_encodeVertexBufferBound(m,x);return u(n.exports.meshopt_encodeVertexBuffer,b,_,m,x)},encodeIndexBuffer:function(_,m,x){r(x==2||x==4),r(m%3==0);var b=h(_,x),T=n.exports.meshopt_encodeIndexBufferBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexBuffer,T,b,m,4)},encodeIndexSequence:function(_,m,x){r(x==2||x==4);var b=h(_,x),T=n.exports.meshopt_encodeIndexSequenceBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexSequence,T,b,m,4)},encodeGltfBuffer:function(_,m,x,b){var T={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(T[b]),T[b](_,m,x)},encodeFilterOct:function(_,m,x,b){return r(x==4||x==8),r(b>=1&&b<=16),p(n.exports.meshopt_encodeFilterOct,_,m,x,b,16)},encodeFilterQuat:function(_,m,x,b){return r(x==8),r(b>=4&&b<=16),p(n.exports.meshopt_encodeFilterQuat,_,m,x,b,16)},encodeFilterExp:function(_,m,x,b,T){r(x>0&&x%4==0),r(b>=1&&b<=24);var C={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,_,m,x,b,x,T?C[T]:1)}}}();var lie=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(T){r=T.instance,r.exports.__wasm_call_ctors()});function a(T){for(var C=new Uint8Array(T.length),A=0;A<T.length;++A){var S=T.charCodeAt(A);C[A]=S>96?S-97:S>64?S-39:S+4}for(var v=0,A=0;A<T.length;++A)C[v++]=C[A]<60?i[C[A]]:(C[A]-60)*64+C[++A];return C.buffer.slice(0,v)}function c(T,C,A,S,v,D,O){var R=T.exports.sbrk,M=S+3&-4,L=R(M*v),g=R(D.length),E=new Uint8Array(T.exports.memory.buffer);E.set(D,g);var w=C(L,S,v,g,D.length);if(w==0&&O&&O(L,M,v),A.set(E.subarray(L,L+S*v)),R(L-R(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function _(T){var C={object:new Worker(T),pending:0,requests:{}};return C.object.onmessage=function(A){var S=A.data;C.pending-=S.count,C.requests[S.id][S.action](S.value),delete C.requests[S.id]},C}function m(T){for(var C="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+b.name+";"+c.toString()+b.toString(),A=new Blob([C],{type:"text/javascript"}),S=URL.createObjectURL(A),v=h.length;v<T;++v)h[v]=_(S);for(var v=T;v<h.length;++v)h[v].object.postMessage({});h.length=T,URL.revokeObjectURL(S)}function x(T,C,A,S,v){for(var D=h[0],O=1;O<h.length;++O)h[O].pending<D.pending&&(D=h[O]);return new Promise(function(R,M){var L=new Uint8Array(A),g=++p;D.pending+=T,D.requests[g]={resolve:R,reject:M},D.object.postMessage({id:g,count:T,size:C,source:L,mode:S,filter:v},[L.buffer])})}function b(T){var C=T.data;if(!C.id)return self.close();self.ready.then(function(A){try{var S=new Uint8Array(C.count*C.size);c(A,A.exports[C.mode],S,C.count,C.size,C.source,A.exports[C.filter]),self.postMessage({id:C.id,count:C.count,action:"resolve",value:S},[S.buffer])}catch(v){self.postMessage({id:C.id,count:C.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(T){m(T)},decodeVertexBuffer:function(T,C,A,S,v){c(r,r.exports.meshopt_decodeVertexBuffer,T,C,A,S,r.exports[u[v]])},decodeIndexBuffer:function(T,C,A,S){c(r,r.exports.meshopt_decodeIndexBuffer,T,C,A,S)},decodeIndexSequence:function(T,C,A,S){c(r,r.exports.meshopt_decodeIndexSequence,T,C,A,S)},decodeGltfBuffer:function(T,C,A,S,v,D){c(r,r.exports[f[v]],T,C,A,S,r.exports[u[D]])},decodeGltfBufferAsync:function(T,C,A,S,v){return h.length>0?x(T,C,A,f[S],u[v]):s.then(function(){var D=new Uint8Array(T*C);return c(r,r.exports[f[S]],D,T,C,A,r.exports[u[v]]),D})}}}();var lJt=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHa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MUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyava8Fc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyara3cltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkara8LcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkarawcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecef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IdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var x=new Uint8Array(m.length),b=0;b<m.length;++b){var T=m.charCodeAt(b);x[b]=T>96?T-97:T>64?T-39:T+4}for(var C=0,b=0;b<m.length;++b)x[C++]=x[b]<60?t[x[b]]:(x[b]-60)*64+x[++b];return x.buffer.slice(0,C)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}function a(m,x,b){var T=n.exports.sbrk,C=T(x.length*4),A=T(b*4),S=new Uint8Array(n.exports.memory.buffer),v=s(x);S.set(v,C);var D=m(A,C,x.length,b);S=new Uint8Array(n.exports.memory.buffer);var O=new Uint32Array(b);new Uint8Array(O.buffer).set(S.subarray(A,A+b*4)),v.set(S.subarray(C,C+x.length*4)),T(C-T(0));for(var R=0;R<x.length;++R)x[R]=O[x[R]];return[O,D]}function c(m){for(var x=0,b=0;b<m.length;++b){var T=m[b];x=x<T?T:x}return x}function u(m,x,b,T,C,A,S,v,D){var O=n.exports.sbrk,R=O(4),M=O(b*4),L=O(C*A),g=O(b*4),E=new Uint8Array(n.exports.memory.buffer);E.set(s(T),L),E.set(s(x),g);var w=m(M,g,b,L,C,A,S,v,D,R);E=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(w);s(I).set(E.subarray(M,M+w*4));var N=new Float32Array(1);return s(N).set(E.subarray(R,R+4)),O(R-O(0)),[I,N[0]]}function f(m,x,b,T,C,A,S,v,D,O,R,M,L){var g=n.exports.sbrk,E=g(4),w=g(b*4),I=g(C*A),N=g(C*v),B=g(D.length*4),H=g(b*4),V=O?g(C):0,G=new Uint8Array(n.exports.memory.buffer);G.set(s(T),I),G.set(s(S),N),G.set(s(D),B),G.set(s(x),H),O&&G.set(s(O),V);var k=m(w,H,b,I,C,A,N,v,B,D.length,V,R,M,L,E);G=new Uint8Array(n.exports.memory.buffer);var W=new Uint32Array(k);s(W).set(G.subarray(w,w+k*4));var Y=new Float32Array(1);return s(Y).set(G.subarray(E,E+4)),g(E-g(0)),[W,Y[0]]}function h(m,x,b,T){var C=n.exports.sbrk,A=C(b*T),S=new Uint8Array(n.exports.memory.buffer);S.set(s(x),A);var v=m(A,b,T);return C(A-C(0)),v}function p(m,x,b,T,C,A,S,v){var D=n.exports.sbrk,O=D(v*4),R=D(b*T),M=D(b*A),L=new Uint8Array(n.exports.memory.buffer);L.set(s(x),R),C&&L.set(s(C),M);var g=m(O,R,b,T,M,A,S,v);L=new Uint8Array(n.exports.memory.buffer);var E=new Uint32Array(g);return s(E).set(L.subarray(O,O+g*4)),D(O-D(0)),E}var _={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(m){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0);var x=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return a(n.exports.meshopt_optimizeVertexFetchRemap,x,c(m)+1)},simplify:function(m,x,b,T,C,A){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T>=0&&T<=m.length),r(T%3==0),r(C>=0);for(var S=0,v=0;v<(A?A.length:0);++v)r(A[v]in _),r(this.useExperimentalFeatures||A[v]!="Prune"),S|=_[A[v]];var D=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),O=u(n.exports.meshopt_simplify,D,m.length,x,x.length/b,b*4,T,C,S);return O[0]=m instanceof Uint32Array?O[0]:new m.constructor(O[0]),O},simplifyWithAttributes:function(m,x,b,T,C,A,S,v,D,O){r(this.useExperimentalFeatures),r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T instanceof Float32Array),r(T.length%C==0),r(C>=0),r(S==null||S instanceof Uint8Array),r(S==null||S.length==x.length/b),r(v>=0&&v<=m.length),r(v%3==0),r(D>=0),r(Array.isArray(A)),r(C>=A.length),r(A.length<=32);for(var R=0;R<A.length;++R)r(A[R]>=0);for(var M=0,R=0;R<(O?O.length:0);++R)r(O[R]in _),M|=_[O[R]];var L=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),g=f(n.exports.meshopt_simplifyWithAttributes,L,m.length,x,x.length/b,b*4,T,C*4,new Float32Array(A),S?new Uint8Array(S):null,v,D,M);return g[0]=m instanceof Uint32Array?g[0]:new m.constructor(g[0]),g},getScale:function(m,x){return r(m instanceof Float32Array),r(m.length%x==0),r(x>=3),h(n.exports.meshopt_simplifyScale,m,m.length/x,x*4)},simplifyPoints:function(m,x,b,T,C,A){return r(this.useExperimentalFeatures),r(m instanceof Float32Array),r(m.length%x==0),r(x>=3),r(b>=0&&b<=m.length/x),T?(r(T instanceof Float32Array),r(T.length%C==0),r(C>=3),r(m.length/x==T.length/C),p(n.exports.meshopt_simplifyPoints,m,m.length/x,x*4,T,C*4,A,b)):p(n.exports.meshopt_simplifyPoints,m,m.length/x,x*4,void 0,0,0,b)}}}();var fJt=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi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AmbcbhPaChAinaAaPBdbaAclfhAaOaPcefgP9hmbkkaYJbbbZNh8MakcuaOcltalcFFFFd0Ecbyd:e1jjbHjjjjbbg8ABd9OakcwBd:Secba8AaKaCaOz:djjjb8Aakaocbyd:e1jjbHjjjjbbgPBd2aPcFeaoz:njjjbhrakc8Wfcwf9cb83ibak9cb83i8WcbhPJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgcbhlinJbbbbh3dnaPTmbJbbjZaP:Z:vh3kaka8Ea3NgaUdaaka5a3NghUd3akaEa3Ng8JUdKJbbbbh3dnagagNaYaYNa8Fa8FNMMg8KJbbbb9BmbJbbjZa8K:r:vh3kakaga3NUd8Saka8Fa3NUdyakaYa3NUd8Kdndndnakyd8WgQakydUgAakcKfaeaiakc;abfaKamara8Maqz:ejjjbgCcuSmbdnaPaD9pmbaAaraiaCcx2fgXydbfRbbcFeSfaraXclfydbfRbbcFeSfaraXcwfydbfRbbcFeSfaw9nmdkaQaAcbaeaiakc;abfaKamara8MJbbbbz:ejjjbgCcu9hmekakaaUdCakahUdzaka8JUdxakcuBdwakcFFF;7rBdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var x=new Uint8Array(m.length),b=0;b<m.length;++b){var T=m.charCodeAt(b);x[b]=T>96?T-97:T>64?T-39:T+4}for(var C=0,b=0;b<m.length;++b)x[C++]=x[b]<60?t[x[b]]:(x[b]-60)*64+x[++b];return x.buffer.slice(0,C)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}var a=48,c=16;function u(m,x){var b=m.meshlets[x*4+0],T=m.meshlets[x*4+1],C=m.meshlets[x*4+2],A=m.meshlets[x*4+3];return{vertices:m.vertices.subarray(b,b+C),triangles:m.triangles.subarray(T,T+A*3)}}function f(m,x,b,T,C,A,S){var v=n.exports.sbrk,D=n.exports.meshopt_buildMeshletsBound(m.length,C,A),O=v(D*c),R=v(D*C*4),M=v(D*A*3),L=v(m.byteLength),g=v(x.byteLength),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),L),E.set(s(x),g);var w=n.exports.meshopt_buildMeshlets(O,R,M,L,m.length,g,b,T,C,A,S);E=new Uint8Array(n.exports.memory.buffer);for(var I=E.subarray(O,O+w*c),N=new Uint32Array(I.buffer,I.byteOffset,I.byteLength/4).slice(),B=0;B<w;++B){var H=N[B*4+0],V=N[B*4+1],b=N[B*4+2],G=N[B*4+3];n.exports.meshopt_optimizeMeshlet(R+H*4,M+V,G,b)}var k=N[(w-1)*4+0],W=N[(w-1)*4+1],Y=N[(w-1)*4+2],J=N[(w-1)*4+3],j=k+Y,K=W+(J*3+3&-4),Q={meshlets:N,vertices:new Uint32Array(E.buffer,R,j).slice(),triangles:new Uint8Array(E.buffer,M,K*3).slice(),meshletCount:w};return v(O-v(0)),Q}function h(m){var x=new Float32Array(n.exports.memory.buffer,m,a/4);return{centerX:x[0],centerY:x[1],centerZ:x[2],radius:x[3],coneApexX:x[4],coneApexY:x[5],coneApexZ:x[6],coneAxisX:x[7],coneAxisY:x[8],coneAxisZ:x[9],coneCutoff:x[10]}}function p(m,x,b,T){var C=n.exports.sbrk,A=[],S=C(x.byteLength),v=C(m.vertices.byteLength),D=C(m.triangles.byteLength),O=C(a),R=new Uint8Array(n.exports.memory.buffer);R.set(s(x),S),R.set(s(m.vertices),v),R.set(s(m.triangles),D);for(var M=0;M<m.meshletCount;++M){var L=m.meshlets[M*4+0],g=m.meshlets[M*4+0+1],E=m.meshlets[M*4+0+3];n.exports.meshopt_computeMeshletBounds(O,v+L*4,D+g,E,S,b,T),A.push(h(O))}return C(S-C(0)),A}function _(m,x,b,T){var C=n.exports.sbrk,A=C(a),S=C(m.byteLength),v=C(x.byteLength),D=new Uint8Array(n.exports.memory.buffer);D.set(s(m),S),D.set(s(x),v),n.exports.meshopt_computeClusterBounds(A,S,m.length,v,b,T);var O=h(A);return C(A-C(0)),O}return{ready:i,supported:!0,buildMeshlets:function(m,x,b,T,C,A){r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T<=255||T>0),r(C<=512),r(C%4==0),A=A||0;var S=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return f(S,x,x.length/b,b*4,T,C,A)},computeClusterBounds:function(m,x,b){r(m.length%3==0),r(m.length/3<=512),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3);var T=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return _(T,x,x.length/b,b*4)},computeMeshletBounds:function(m,x,b){return r(m.meshletCount!=0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),p(m,x,x.length/b,b*4)},extractMeshlet:function(m,x){return r(x>=0&&x<m.meshletCount),u(m,x)}}}();function ix(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,h=!1,p,_,m,x;if(ri(a,"EXT_meshopt_compression")){let T=a.extensions.EXT_meshopt_compression;c=T.buffer,u=y(T.byteOffset,0),f=T.byteLength,h=!0,p=T.byteStride,_=T.count,m=T.mode,x=y(T.filter,"NONE")}let b=n.buffers[c];this._hasMeshopt=h,this._meshoptByteStride=p,this._meshoptCount=_,this._meshoptMode=m,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=b,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(ix.prototype=Object.create(Ki.prototype),ix.prototype.constructor=ix);Object.defineProperties(ix.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function yBe(e){try{let t=xBe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);lie.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=pt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load buffer view",t)}}ix.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,this._promise=yBe(this),this._promise)};function xBe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}ix.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var jv=ix;function Pr(){}Pr._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);Pr._decoderTaskProcessor=void 0;Pr._taskProcessorReady=!1;Pr._error=void 0;Pr._getDecoderTaskProcessor=function(){if(!l(Pr._decoderTaskProcessor)){let e=new yi("decodeDraco",Pr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?Pr._taskProcessorReady=!0:Pr._error=new re("Draco decoder could not be initialized.")}).catch(t=>{Pr._error=t}),Pr._decoderTaskProcessor=e}return Pr._decoderTaskProcessor};Pr.decodePointCloud=function(e){let t=Pr._getDecoderTaskProcessor();if(l(Pr._error))throw Pr._error;if(Pr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Pr.decodeBufferView=function(e){let t=Pr._getDecoderTaskProcessor();if(l(Pr._error))throw Pr._error;if(Pr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var h_=Pr;function m_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=pt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(m_.prototype=Object.create(Ki.prototype),m_.prototype.constructor=m_);Object.defineProperties(m_.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function bBe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=pt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;uie(e,n)}}m_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,this._promise=bBe(this),this._promise)};function uie(e,t){throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load Draco",t)}async function TBe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=pt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}m_.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.PROCESSING||(l(this._dracoError)&&uie(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=h_.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=TBe(this,c)};m_.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var qv=m_;function CBe(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Se.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Se.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Se({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var aC=CBe;function Ep(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(Ep.prototype=Object.create(Ki.prototype),Ep.prototype.constructor=Ep);Object.defineProperties(Ep.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Ep.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=ABe(this),this._promise):(this._promise=EBe(this),this._promise)};function fie(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function ABe(e){e._state=pt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await vBe(i);if(e.isDestroyed())return;let r=fie(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=pt.READY,e}catch(n){return e.isDestroyed()?void 0:die(e,n,"Failed to load embedded image")}}async function EBe(e){e._state=pt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await DBe(i);if(e.isDestroyed())return;let r=fie(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=pt.READY,e}catch(o){return e.isDestroyed()?void 0:die(e,o,`Failed to load image: ${n}`)}}function die(e,t,n){return e.unload(),e._state=pt.FAILED,Promise.reject(e.getError(n,t))}function SBe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new re("Image format is not recognized")}async function vBe(e){let t=SBe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return ql(n)}return Ep._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var wBe=/(^data:image\/ktx2)|(\.ktx2$)/i;function DBe(e){let t=e.getUrlComponent(!1,!0);return wBe.test(t)?ql(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Ep.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Ep._loadImageFromTypedArray=aC;var Yv=Ep;var IBe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},$a=Object.freeze(IBe);function p_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),h=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=h,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(p_.prototype=Object.create(Ki.prototype),p_.prototype.constructor=p_);Object.defineProperties(p_.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var PBe=new T9;p_.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=RBe(this),this._promise):(this._promise=OBe(this),this._promise)};async function RBe(e){e._state=pt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=pt.LOADED,e)}catch(n){if(e.isDestroyed())return;b9(e,n)}}async function OBe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=pt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=MBe(e,a),e._state=pt.PROCESSING,e}catch(s){if(e.isDestroyed())return;b9(e,s)}}function MBe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ne.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let h=r*a,p=new Uint8Array(c,u,h);c=new Uint8Array(p).buffer,u=0,_s("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Ne.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):s===Ne.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):s===Ne.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function b9(e,t){throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load index buffer",t)}function T9(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}T9.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};T9.prototype.execute=function(){this.buffer=hie(this.typedArray,this.indexDatatype,this.context)};function hie(e,t,n){let i=_t.createIndexBuffer({typedArray:e,context:n,usage:Fe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}p_.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.LOADED&&this._state!==pt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=X.fromTypedArray(t),this._indexDatatype=n)}catch(o){b9(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=PBe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,$a.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=hie(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=pt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};p_.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var Xv=p_;function LBe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Fs=LBe;function NBe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var mr=NBe;function jt(){}jt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};jt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(l(r))return r}}};jt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?jt.objectLegacy(i,n):jt.object(i,n)};jt.accessor=function(e,t){return jt.topLevel(e,"accessors",t)};jt.accessorWithSemantic=function(e,t,n){let i={};return jt.mesh(e,function(o){return jt.meshPrimitive(o,function(r){let s=jt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:jt.meshPrimitiveTarget(r,function(a){return jt.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};jt.accessorContainingVertexAttributeData=function(e,t){let n={};return jt.mesh(e,function(i){return jt.meshPrimitive(i,function(o){let r=jt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:jt.meshPrimitiveTarget(o,function(s){return jt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};jt.accessorContainingIndexData=function(e,t){let n={};return jt.mesh(e,function(i){return jt.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let s=t(r);if(l(s))return s}})})};jt.animation=function(e,t){return jt.topLevel(e,"animations",t)};jt.animationChannel=function(e,t){let n=e.channels;return jt.object(n,t)};jt.animationSampler=function(e,t){let n=e.samplers;return jt.object(n,t)};jt.buffer=function(e,t){return jt.topLevel(e,"buffers",t)};jt.bufferView=function(e,t){return jt.topLevel(e,"bufferViews",t)};jt.camera=function(e,t){return jt.topLevel(e,"cameras",t)};jt.image=function(e,t){return jt.topLevel(e,"images",t)};jt.material=function(e,t){return jt.topLevel(e,"materials",t)};jt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};jt.mesh=function(e,t){return jt.topLevel(e,"meshes",t)};jt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(l(s))return s}}};jt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};jt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(l(r))return r}}};jt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};jt.node=function(e,t){return jt.topLevel(e,"nodes",t)};jt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=jt.nodeInTree(e,u,n),l(c)))return c}}}};jt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return jt.nodeInTree(e,i,n)};jt.program=function(e,t){return mr(e,"KHR_techniques_webgl")?jt.object(e.extensions.KHR_techniques_webgl.programs,t):jt.topLevel(e,"programs",t)};jt.sampler=function(e,t){return jt.topLevel(e,"samplers",t)};jt.scene=function(e,t){return jt.topLevel(e,"scenes",t)};jt.shader=function(e,t){return mr(e,"KHR_techniques_webgl")?jt.object(e.extensions.KHR_techniques_webgl.shaders,t):jt.topLevel(e,"shaders",t)};jt.skin=function(e,t){return jt.topLevel(e,"skins",t)};jt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(l(s))return s}}};jt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};jt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};jt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};jt.technique=function(e,t){return mr(e,"KHR_techniques_webgl")?jt.object(e.extensions.KHR_techniques_webgl.techniques,t):jt.topLevel(e,"techniques",t)};jt.texture=function(e,t){return jt.topLevel(e,"textures",t)};var Pe=jt;function FBe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var df=FBe;function BBe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return X.getSizeInBytes(t.componentType)*df(t.type)}var ou=BBe;function kBe(e){Pe.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Pe.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){if(i.mode=y(i.mode,te.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Fs(e.materials,o)}})}),Pe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=ou(e,i),r.target=te.ARRAY_BUFFER}}),Pe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=te.ELEMENT_ARRAY_BUFFER}}),Pe.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&Pe.materialValue(n,function(c){l(c.index)&&ox(c)}),ox(n.emissiveTexture),ox(n.normalTexture),ox(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),ox(s.baseColorTexture),ox(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),ox(a.specularGlossinessTexture))}),Pe.animation(e,function(n){Pe.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=VBe(e);return Pe.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Pe.sampler(e,function(n){n.wrapS=y(n.wrapS,te.REPEAT),n.wrapT=y(n.wrapT,te.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function VBe(e){let t={};return Pe.animation(e,function(n){Pe.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function ox(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var uN=kBe;function UBe(e){return Pe.shader(e,function(t){fN(t)}),Pe.buffer(e,function(t){fN(t)}),Pe.image(e,function(t){fN(t)}),fN(e),e}function fN(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var rx=UBe;function zBe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var dN=zBe;function HBe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),dN(e,t),n.length===0&&delete e.extensionsUsed}}var cC=HBe;var GBe=4;function WBe(e){if(Gh(e)!=="glTF")throw new re("File is not valid binary glTF");let n=mie(e,0,5),i=n[1];if(i!==1&&i!==2)throw new re("Binary glTF version is not 1 or 2");return i===1?jBe(e,n):qBe(e,n)}function mie(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*GBe,!0);return o}function jBe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new re("Binary glTF scene format is not JSON");let r=20,s=r+i,a=eu(e,r,i),c=JSON.parse(a);rx(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let h=y(f.binary_glTF,f.KHR_binary_glTF);l(h)&&(h.extras._pipeline.source=u,delete h.uri)}return cC(c,"KHR_binary_glTF"),c}function qBe(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=mie(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=eu(u);o=JSON.parse(f),rx(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var hN=WBe;function YBe(e){return Pe.shader(e,function(t){mN(t)}),Pe.buffer(e,function(t){mN(t)}),Pe.image(e,function(t){mN(t)}),mN(e),e}function mN(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var pN=YBe;function XBe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Fs(n,t,!0)}var bd=XBe;function KBe(e){switch(e){case X.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case X.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case X.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case X.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case X.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case X.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case X.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case X.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var g_=KBe;function ZBe(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=df(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,h=i[u].extras._pipeline.source,p=t.count,_=ou(e,t),m=t.byteOffset+c.byteOffset+h.byteOffset,x=t.componentType,b=X.getSizeInBytes(x),T=new DataView(h.buffer),C=new Array(r),A=g_(x);for(let S=0;S<p;S++){A(T,m,r,b,C);for(let v=0;v<r;v++){let D=C[v];s[v]=Math.min(s[v],D),a[v]=Math.max(a[v],D)}m+=_}return{min:s,max:a}}var lC=ZBe;var $Be=[te.FUNC_ADD,te.FUNC_ADD],QBe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function pie(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var JBe=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function e3e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(JBe.indexOf(e[n])===-1)return t;return e}function t3e(e){let t={},n={},i=e.techniques;return l(i)&&(Pe.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(pie(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,$Be),blendFactors:e3e(c.blendFuncSeparate,QBe)})}pie(s,te.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),bd(e,"KHR_blend")),Pe.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Pe.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var gN=t3e;function n3e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Fs(n,t,!0),bd(e,t)}var _N=n3e;function i3e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Pe.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Pe.techniqueAttribute(a,function(h,p){f=a.parameters[h],u.attributes[p]={semantic:f.semantic}}),Pe.techniqueUniform(a,function(h,p){f=a.parameters[h],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][h]=p}),l(o[a.program]))u.program=o[a.program];else{let h=e.programs[a.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},_=e.shaders[h.fragmentShader];p.fragmentShader=Fs(r.shaders,_,!0);let m=e.shaders[h.vertexShader];p.vertexShader=Fs(r.shaders,m,!0),u.program=Fs(r.programs,p),o[a.program]=u.program}i[c]=Fs(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,bd(e,"KHR_techniques_webgl"),_N(e,"KHR_techniques_webgl"))}return Pe.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Pe.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var yN=i3e;function o3e(e,t){xo.typeOf.object("material",e),xo.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:u}=s;if(l(c)){let f=t(c.index,c);if(l(f))return f}if(l(u)){let f=t(u.index,u);if(l(f))return f}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:u,emission:f,specular:h}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(f)&&l(f.index)){let p=t(f.index,f);if(l(p))return p}if(l(h)&&l(h.index)){let p=t(h.index,h);if(l(p))return p}}}let o=Pe.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var Kv=o3e;var gie=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function r3e(e,t){return t=y(t,gie),gie.forEach(function(n){t.indexOf(n)>-1&&a3e(e,n)}),e}var s3e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function a3e(e,t){let n=s3e[t],i=e[n];if(l(i)){let o=0,r=qh[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(jh[t](e,a-o),o++)}}function jh(){}jh.accessor=function(e,t){e.accessors.splice(t,1),Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){Pe.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Pe.meshPrimitiveTarget(o,function(a){Pe.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Pe.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Pe.animation(e,function(i){Pe.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};jh.buffer=function(e,t){e.buffers.splice(t,1),Pe.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};jh.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Pe.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Pe.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Pe.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),mr(e,"KHR_draco_mesh_compression")&&Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),mr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(mr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};jh.image=function(e,t){e.images.splice(t,1),Pe.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};jh.mesh=function(e,t){e.meshes.splice(t,1),Pe.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};jh.node=function(e,t){e.nodes.splice(t,1),Pe.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Pe.animation(e,function(i){Pe.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Pe.technique(e,function(i){Pe.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Pe.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Pe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};jh.material=function(e,t){e.materials.splice(t,1),Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};jh.sampler=function(e,t){e.samplers.splice(t,1),Pe.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};jh.texture=function(e,t){if(e.textures.splice(t,1),Pe.material(e,function(i){Kv(i,function(o,r){r.index>t&&--r.index})}),mr(e,"EXT_feature_metadata")){Pe.mesh(e,function(r){Pe.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let h=0;h<f;++h){let _=u[h].featureIds.texture;_.index>t&&--_.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(mr(e,"EXT_mesh_features")&&Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),mr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function qh(){}qh.accessor=function(e){let t={};return Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){Pe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Pe.meshPrimitiveTarget(i,function(r){Pe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Pe.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Pe.animation(e,function(n){Pe.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),mr(e,"EXT_mesh_gpu_instancing")&&Pe.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),mr(e,"CESIUM_primitive_outline")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};qh.buffer=function(e){let t={};return Pe.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};qh.bufferView=function(e){let t={};if(Pe.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Pe.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Pe.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),mr(e,"KHR_draco_mesh_compression")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),mr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(mr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};qh.image=function(e){let t={};return Pe.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};qh.mesh=function(e){let t={};return Pe.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function _ie(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!_ie(e,o,n)}).length===0}qh.node=function(e){let t={};return Pe.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Pe.skinJoint(n,function(i){t[i]=!0})}),Pe.animation(e,function(n){Pe.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Pe.technique(e,function(n){Pe.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Pe.node(e,function(n,i){_ie(e,i,t)||(t[i]=!0)}),t};qh.material=function(e){let t={};return Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};qh.texture=function(e){let t={};if(Pe.material(e,function(n){Kv(n,function(i){t[i]=!0})}),mr(e,"EXT_feature_metadata")){Pe.mesh(e,function(o){Pe.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(mr(e,"EXT_mesh_features")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),mr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};qh.sampler=function(e){let t={};return Pe.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var xN=r3e;function c3e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Fs(e.buffers,n),byteOffset:0,byteLength:t.length};return Fs(e.bufferViews,o)}var bN=c3e;function l3e(e,t){let n=ou(e,t),i=X.getSizeInBytes(t.componentType),o=df(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),h=new Array(o),p=g_(t.componentType);for(let _=0;_<r;++_){p(f,u,o,i,h);for(let m=0;m<o;++m)s[_*o+m]=h[m];u+=n}return s}var TN=l3e;function u3e(e){let t;return Pe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?CN(e,i,X.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&CN(e,i,X.UNSIGNED_SHORT)}),Pe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?CN(e,i,X.UNSIGNED_BYTE):t===te.SHORT&&CN(e,i,X.UNSIGNED_SHORT)}),e}function CN(e,t,n){let i=X.createTypedArray(n,TN(e,t)),o=new Uint8Array(i.buffer);t.bufferView=bN(e,o),t.componentType=n,t.byteOffset=0}var AN=u3e;function f3e(e,t){return cC(e,t),t==="CESIUM_RTC"&&d3e(e),C9(e,t)}function d3e(e){Pe.technique(e,function(t){Pe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function C9(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)C9(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&C9(e[o],t);return i}}var uC=f3e;var EN={.8:y3e,"1.0":V3e,"2.0":void 0};function h3e(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(EN,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(EN,i)||(i="1.0"));let o=EN[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=EN[i];return t.keepLegacyExtensions||(H3e(e,t),G3e(e)),e}function bie(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;l(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function m3e(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=y(a.primitive,te.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function p3e(e){let t=e.nodes,n=new d,i=new Oe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;d.fromArray(a,0,n),Oe.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;l(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function g3e(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new d,a=new Oe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,h=u.parameters,p=u.samplers;if(l(f)){let _=f.length;for(let m=0;m<_;++m){let x=f[m];if(x.target.path==="rotation"){let b=h[p[x.sampler].output];if(l(r[b]))continue;r[b]=!0;let T=n[b],C=i[T.bufferView],S=o[C.buffer].extras._pipeline.source,v=S.byteOffset+C.byteOffset+T.byteOffset,D=T.componentType,O=T.count,R=df(T.type),M=T.count*R,L=X.createArrayBufferView(D,S.buffer,v,M);for(let g=0;g<O;g++){let E=g*R;d.unpack(L,E,s);let w=L[E+3];Oe.fromAxisAngle(s,w,a),Oe.pack(a,L,E)}}}}}}function _3e(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function y3e(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,bie(e),m3e(e),p3e(e),g3e(e),_3e(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,bd(e,"KHR_materials_common")}}function x3e(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function yie(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),l(o.name)||(o.name=i)}return n}function b3e(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,l(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=yie(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Pe.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Pe.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Pe.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Pe.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Pe.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Pe.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Pe.mesh(e,function(s){Pe.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Pe.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Pe.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},h=Fs(e.nodes,f);l(a)||(a=[],s.children=a),a.push(h)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Pe.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Pe.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Pe.animation(e,function(s){let a={};s.samplers=yie(s.samplers,a),Pe.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Pe.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Pe.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Pe.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Pe.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Pe.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Pe.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function T3e(e){Pe.animation(e,function(t){Pe.animationSampler(t,function(n){delete n.name})})}function C3e(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Pe.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function A3e(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var E3e={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function S3e(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(E3e[o])&&e.extensionsRequired.push(o)}}}function v3e(e){Pe.buffer(e,function(t){delete t.type})}function w3e(e){Pe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function D3e(e){Pe.mesh(e,function(t){Pe.meshPrimitive(t,function(n){Pe.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Pe.technique(e,function(t){Pe.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var I3e={POSITION:!0,NORMAL:!0,TANGENT:!0},P3e={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function R3e(e){let t={};Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){Pe.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let u,f=P3e[a];l(f)?(u=f+c,t[r]=u):l(I3e[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Pe.technique(e,function(n){Pe.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function O3e(e){Pe.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function E9(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:ou(e,t)}function M3e(e){Pe.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Pe.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=E9(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function L3e(e){let t,n,i,o=e.bufferViews,r={};Pe.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Pe.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,_){return p.byteOffset-_.byteOffset});let u=0,f=0,h=c.length;for(t=0;t<h;++t){let p=c[t],_=E9(e,p),m=p.byteOffset,x=p.count*_;delete p.byteStride;let b=t<h-1,T=b?E9(e,c[t+1]):void 0;if(_!==T){let C=Ge(i,!0);r[a]&&(C.byteStride=_),C.byteOffset+=u,C.byteLength=m+x-u;let A=Fs(o,C);for(n=f;n<=t;++n)p=c[n],p.bufferView=A,p.byteOffset=p.byteOffset-u;u=b?c[t+1].byteOffset:void 0,f=t+1}}}xN(e,["accessor","bufferView","buffer"])}function N3e(e){Pe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=lC(e,n);n.min=i.min,n.max=i.max}})}function Tie(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||d.fromArray(e.translation).equals(d.ZERO))&&(!l(e.scale)||d.fromArray(e.scale).equals(new d(1,1,1)))&&(!l(e.rotation)||oe.fromArray(e.rotation).equals(new oe(0,0,0,1)))&&(!l(e.matrix)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Cie(e,t){Pe.scene(e,function(n){let i=n.nodes;if(l(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Pe.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Tie(n)&&Cie(e,i))}}),delete e.nodes[t]}function F3e(e){return Pe.node(e,function(t,n){Tie(t)&&Cie(e,n)}),e}function B3e(e){Pe.animation(e,function(t){Pe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=lC(e,i);i.min=o.min,i.max=o.max}})})}function k3e(e){Pe.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=lC(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function V3e(e){e.asset=y(e.asset,{}),e.asset.version="2.0",bie(e),x3e(e),F3e(e),b3e(e),T3e(e),A3e(e),S3e(e),M3e(e),L3e(e),N3e(e),B3e(e),k3e(e),v3e(e),w3e(e),D3e(e),R3e(e),AN(e),O3e(e),gN(e),yN(e),C3e(e)}var U3e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],z3e=["u_diffuse","u_diffuse_mat"];function S9(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function v9(e){return l(e.index)}function w9(e){return Array.isArray(e)&&e.length===4}function Aie(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function H3e(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,U3e),i=y(t.baseColorFactorNames,z3e);Pe.material(e,function(o){Pe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&v9(r)?(S9(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&w9(r)&&(S9(o),o.pbrMetallicRoughness.baseColorFactor=Aie(r))})}),uC(e,"KHR_techniques_webgl"),uC(e,"KHR_blend")}function A9(e,t){l(t)&&(w9(t)?e.pbrMetallicRoughness.baseColorFactor=Aie(t):v9(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function xie(e,t){l(t)&&(w9(t)?e.emissiveFactor=t.slice(0,3):v9(t)&&(e.emissiveTexture=t))}function G3e(e){Pe.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=y(n.values,{}),o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;S9(t),n.technique==="CONSTANT"?(bd(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},A9(t,s),A9(t,o)):(A9(t,r),xie(t,o),xie(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),uC(e,"KHR_materials_common")}var SN=h3e;var Jn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function W3e(e){switch(e){case Jn.POSITION:return"positionMC";case Jn.NORMAL:return"normalMC";case Jn.TANGENT:return"tangentMC";case Jn.TEXCOORD:return"texCoord";case Jn.COLOR:return"color";case Jn.JOINTS:return"joints";case Jn.WEIGHTS:return"weights";case Jn.FEATURE_ID:return"featureId"}}Jn.hasSetIndex=function(e){switch(e){case Jn.POSITION:case Jn.NORMAL:case Jn.TANGENT:return!1;case Jn.TEXCOORD:case Jn.COLOR:case Jn.JOINTS:case Jn.WEIGHTS:case Jn.FEATURE_ID:return!0}};Jn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Jn.POSITION;case"NORMAL":return Jn.NORMAL;case"TANGENT":return Jn.TANGENT;case"TEXCOORD":return Jn.TEXCOORD;case"COLOR":return Jn.COLOR;case"JOINTS":return Jn.JOINTS;case"WEIGHTS":return Jn.WEIGHTS;case"_FEATURE_ID":return Jn.FEATURE_ID}};Jn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Jn.POSITION;case"RGBA":case"RGB":case"RGB565":return Jn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Jn.NORMAL;case"BATCH_ID":return Jn.FEATURE_ID}};Jn.getGlslType=function(e){switch(e){case Jn.POSITION:case Jn.NORMAL:case Jn.TANGENT:return"vec3";case Jn.TEXCOORD:return"vec2";case Jn.COLOR:return"vec4";case Jn.JOINTS:return"ivec4";case Jn.WEIGHTS:return"vec4";case Jn.FEATURE_ID:return"int"}};Jn.getVariableName=function(e,t){let n=W3e(e);return l(t)&&(n+=`_${t}`),n};var At=Object.freeze(Jn);function Qa(){}Qa.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${n.message}`);let o=new re(i);return l(n)&&(o.stack=`Original stack: +${n.stack} +Handler stack: +${o.stack}`),o};Qa.getNodeTransform=function(e){return l(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:d.ZERO,l(e.rotation)?e.rotation:Oe.IDENTITY,l(e.scale)?e.scale:d.ONE)};Qa.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Qa.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};Qa.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};Qa.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};Qa.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=At.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=tn.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),u;return c&&(u=r?"vec4":tn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var j3e=new d,q3e=new d;Qa.getPositionMinMax=function(e,t,n){let i=Qa.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=d.add(r,t,q3e),o=d.add(o,n,j3e)),{min:r,max:o}};Qa.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===Fo.Y?n=F.clone(Fo.Y_UP_TO_Z_UP,n):e===Fo.X&&(n=F.clone(Fo.X_UP_TO_Z_UP,n)),t===Fo.Z&&(n=F.multiplyTransformation(n,Fo.Z_UP_TO_X_UP,n)),n};var Y3e=new $;Qa.getCullFace=function(e,t){if(!Me.isTriangles(t))return bi.BACK;let n=F.getMatrix3(e,Y3e);return $.determinant(n)<0?bi.FRONT:bi.BACK};Qa.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Qa.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};Qa.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Qa.supportedExtensions[i])throw new re(`Unsupported glTF Extension: ${i}`)}};var Xt=Qa;function __(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(__.prototype=Object.create(Ki.prototype),__.prototype.constructor=__);Object.defineProperties(__.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});__.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,l(this._gltfJson)?(this._promise=Eie(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Sie(this,this._typedArray),this._promise):(this._promise=X3e(this),this._promise))};async function X3e(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;D9(e,n)}return Sie(e,t)}function D9(e,t){e.unload(),e._state=pt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function K3e(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!mr(t,"KHR_techniques_webgl")&&!mr(t,"KHR_materials_common"))return Promise.resolve();let n=[];Pe.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),SN(t)}function Z3e(e){let t=[];return Pe.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Lg(i)&&(delete n.uri,t.push(Se.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function $3e(e,t){let n=[];return Pe.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function Eie(e,t){try{rx(t),await Z3e(t),await K3e(e,t),uN(t),await $3e(e,t),pN(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new re(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&Xt.checkSupportedExtensions(i),e._gltf=t,e._state=pt.READY,e}catch(n){if(e.isDestroyed())return;D9(e,n)}}async function Sie(e,t){let n;try{Gh(t)==="glTF"?n=hN(t):n=Bo(t)}catch(i){if(e.isDestroyed())return;D9(e,i)}return Eie(e,n)}__.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};__.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var Zv=__;var Q3e={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Sp=Object.freeze(Q3e);var To={};function J3e(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function eke(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function tke(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function nke(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function ike(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function oke(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function rke(){this.attributes=[]}function ske(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function ake(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function cke(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function lke(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function uke(){this.nodes=[]}var fke={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function dke(){this.input=[],this.interpolation=void 0,this.output=[]}function hke(){this.node=void 0,this.path=void 0}function mke(){this.sampler=void 0,this.target=void 0}function pke(){this.name=void 0,this.samplers=[],this.channels=[]}function gke(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function _ke(){this.name=void 0,this.stages=[]}function vie(){this.credits=[]}function yke(){this.asset=new vie,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=F.clone(F.IDENTITY),this.extensions={}}function xke(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0}function y_(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=oe.clone(y_.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=y_.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=y_.DEFAULT_ROUGHNESS_FACTOR}y_.DEFAULT_BASE_COLOR_FACTOR=oe.ONE;y_.DEFAULT_METALLIC_FACTOR=1;y_.DEFAULT_ROUGHNESS_FACTOR=1;function sx(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=oe.clone(sx.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=d.clone(sx.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=sx.DEFAULT_GLOSSINESS_FACTOR}sx.DEFAULT_DIFFUSE_FACTOR=oe.ONE;sx.DEFAULT_SPECULAR_FACTOR=d.ONE;sx.DEFAULT_GLOSSINESS_FACTOR=1;function $v(){this.specularFactor=$v.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=d.clone($v.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}$v.DEFAULT_SPECULAR_FACTOR=1;$v.DEFAULT_SPECULAR_COLOR_FACTOR=d.ONE;function Qv(){this.anisotropyStrength=Qv.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=Qv.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}Qv.DEFAULT_ANISOTROPY_STRENGTH=0;Qv.DEFAULT_ANISOTROPY_ROTATION=0;function Jv(){this.clearcoatFactor=Jv.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=Jv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}Jv.DEFAULT_CLEARCOAT_FACTOR=0;Jv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function I9(){this.metallicRoughness=new y_,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=d.clone(I9.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Sp.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}I9.DEFAULT_EMISSIVE_FACTOR=d.ZERO;To.Quantization=J3e;To.Attribute=eke;To.Indices=tke;To.FeatureIdAttribute=nke;To.FeatureIdTexture=oke;To.FeatureIdImplicitRange=ike;To.MorphTarget=rke;To.Primitive=ske;To.Instances=ake;To.Skin=cke;To.Node=lke;To.Scene=uke;To.AnimatedPropertyType=Object.freeze(fke);To.AnimationSampler=dke;To.AnimationTarget=hke;To.AnimationChannel=mke;To.Animation=pke;To.ArticulationStage=gke;To.Articulation=_ke;To.Asset=vie;To.Components=yke;To.TextureReader=xke;To.MetallicRoughness=y_;To.SpecularGlossiness=sx;To.Specular=$v;To.Anisotropy=Qv;To.Clearcoat=Jv;To.Material=I9;var bn=To;var vN={};vN.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureId:n,supportedImageFormats:i}=e,o=t.textures[n],r=o.extensions;if(l(r)){if(i.webp&&l(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&l(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};vN.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=An.REPEAT,r=An.REPEAT,s=Kt.LINEAR,a=hi.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let h=t.samplers[f];o=y(h.wrapS,o),r=y(h.wrapT,r),s=y(h.minFilter,s),a=y(h.magFilter,a)}return i&&s!==Kt.LINEAR&&s!==Kt.NEAREST&&(s===Kt.NEAREST_MIPMAP_NEAREST||s===Kt.NEAREST_MIPMAP_LINEAR?s=Kt.NEAREST:s=Kt.LINEAR),new Zt({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var bke=new U(1,1);vN.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let{textureInfo:t,channels:n,texture:i}=e,o=y(t.texCoord,0),r,s=t.extensions?.KHR_texture_transform;if(l(s)){o=y(s.texCoord,o);let c=l(s.offset)?U.unpack(s.offset):U.ZERO,u=y(s.rotation,0),f=l(s.scale)?U.unpack(s.scale):bke;u=-u,r=new $(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new bn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var ru=vN;function Tke(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var ax=Tke;function x_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),u=i.index,f=ru.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(x_.prototype=Object.create(Ki.prototype),x_.prototype.constructor=x_);Object.defineProperties(x_.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var Cke=new P9;async function Ake(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=pt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load texture",n)}}x_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,this._promise=Ake(this),this._promise)};function P9(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}P9.prototype.set=function(e,t,n,i,o,r){this.gltf=e,this.textureInfo=t,this.textureId=n,this.image=i,this.mipLevels=o,this.context=r};P9.prototype.execute=function(){this.texture=wie(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function wie(e,t,n,i,o,r){let s=i.internalFormat,a=!1;tt.isCompressedFormat(s)&&!l(o)&&(a=!0);let c=ru.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,h=c.wrapT,p=u===Kt.NEAREST_MIPMAP_NEAREST||u===Kt.NEAREST_MIPMAP_LINEAR||u===Kt.LINEAR_MIPMAP_NEAREST||u===Kt.LINEAR_MIPMAP_LINEAR,_=!l(s)&&p,m=_||f===An.REPEAT||f===An.MIRRORED_REPEAT||h===An.REPEAT||h===An.MIRRORED_REPEAT,x=!P.isPowerOfTwo(i.width)||!P.isPowerOfTwo(i.height),b=m&&x,T;return l(s)?(!r.webgl2&&tt.isCompressedFormat(s)&&x&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),T=Rt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(b&&(i=ax(i)),T=Rt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),_&&T.generateMipmap(),T}x_.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.LOADED&&this._state!==pt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=pt.PROCESSING;let t;if(this._asynchronous){let n=Cke;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,$a.TEXTURE))return;t=n.texture}else t=wie(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=pt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};x_.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var ew=x_;function b_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=e.cacheKey,f=y(e.asynchronous,!0),h=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=h,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(b_.prototype=Object.create(Ki.prototype),b_.prototype.constructor=b_);Object.defineProperties(b_.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function Eke(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}b_.prototype.load=async function(){return l(this._promise)?this._promise:Eke(this._draco,this._attributeSemantic)?(this._promise=vke(this),this._promise):(this._promise=Dke(this),this._promise)};function Ske(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new bn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=tn.VEC2,a.normalizationRange=r;else{let c=tn.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(h){return h*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function vke(e){e._state=pt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=pt.LOADED,e)}catch{if(e.isDestroyed())return;R9(e)}}function wke(e){e._state=pt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,u=o.data.quantization;l(u)&&(e._quantization=Ske(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function Dke(e){e._state=pt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=pt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;R9(e,n)}}function R9(e,t){throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load vertex buffer",t)}function O9(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}O9.prototype.set=function(e,t){this.typedArray=e,this.context=t};O9.prototype.execute=function(){this.buffer=Die(this.typedArray,this.context)};function Die(e,t){let n=_t.createVertexBuffer({typedArray:e,context:t,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var Ike=new O9;b_.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.LOADED&&this._state!==pt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){R9(this,i)}wke(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=Ike;if(i.set(n,e.context),!e.jobScheduler.execute(i,$a.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=Die(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=pt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};b_.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var tw=b_;function nw(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(e.properties,{}),i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}nw.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=Cp.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new nw({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(nw.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});nw.BATCH_TABLE_CLASS_NAME="_batchTable";var Yh=nw;function wN(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}wN.fromJson=function(e){return new wN({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(wN.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var DN=wN;function IN(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=y(e.valueType,kt.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}IN.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(o){return DN.fromJson(o)});return new IN({id:t,values:i,valueType:kt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(IN.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var PN=IN;function RN(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}RN.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=PN.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Yh.fromJson({id:i,class:e.classes[i],enums:t}));return new RN({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(RN.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var hf=RN;function cx(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?hf.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(cx.prototype=Object.create(Ki.prototype),cx.prototype.constructor=cx);Object.defineProperties(cx.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});cx.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=Pke(this),this._promise)};async function Pke(e){let t=e._resource;e._state=pt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=hf.fromJson(n),e._state=pt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=pt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}cx.prototype.unload=function(){this._schema=void 0};var iw=cx;var Td={};function fC(e){return Jm(e.url)}function ON(e){let{byteOffset:t,byteLength:n}=e;if(ri(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function Rke(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function Iie(e,t){return`${fC(e)}-buffer-id-${t}`}function ow(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return fC(o)}return Iie(n,t)}function M9(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=ow(a,s,n,i),u=ON(r);return`${c}-range-${u}`}function Pie(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let p=i.getDerivedResource({url:s});return fC(p)}let a=e.bufferViews[r],c=a.buffer,u=e.buffers[c],f=ow(u,c,n,i),h=ON(a);return`${f}-range-${h}`}function Oke(e,t){let n=ru.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Td.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${fC(n)}`};Td.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e;return`external-buffer:${fC(t)}`};Td.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Iie(t,n)}`};Td.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t}=e;return`gltf:${fC(t)}`};Td.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ri(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=ow(a,s,i,o),u=ON(r);return`buffer-view:${c}-range-${u}`};Td.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${M9(t,n,i,o)}`};Td.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:c=!1,loadBuffer:u=!1,loadTypedArray:f=!1}=e,h="";if(c&&(h+="-dequantize"),u&&(h+="-buffer",h+=`-context-${o.context.id}`),f&&(h+="-typed-array"),l(s))return`vertex-buffer:${M9(t,s,n,i)}-draco-${a}${h}`;let p=t.bufferViews[r],_=p.buffer,m=t.buffers[_],x=ow(m,_,n,i),b=ON(p);return`vertex-buffer:${x}-range-${b}${h}`};Td.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${M9(t,s,i,o)}-draco${u}`;let f=t.accessors[n],h=f.bufferView,p=t.bufferViews[h],_=p.buffer,m=t.buffers[_],x=ow(m,_,i,o),b=Rke(f,p);return`index-buffer:${x}-accessor-${b}${u}`};Td.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${Pie(t,n,i,o)}`};Td.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=ru.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=Pie(t,c,i,o),f=Oke(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var su=Td;function rw(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}rw.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};rw.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;l(n)&&(o+=n.sizeInBytes),l(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};rw.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};rw.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var MN=rw;function Mn(){}Mn.cacheEntries={};Mn.statistics=new MN;function Mke(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Mn.get=function(e){let t=Mn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Mn.add=function(e){let t=e.cacheKey;return Mn.cacheEntries[t]=new Mke(e),e};Mn.unload=function(e){let t=e.cacheKey,n=Mn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Mn.statistics.removeLoader(e),e.destroy(),delete Mn.cacheEntries[t])};Mn.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{schema:t,resource:n}=e,i=su.getSchemaCacheKey({schema:t,resource:n}),o=Mn.get(i);return l(o)?o:(o=new iw({schema:t,resource:n,cacheKey:i}),Mn.add(o))};Mn.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n,typedArray:i}=e,o=su.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Mn.get(o);return l(r)?r:(r=new sC({typedArray:i,cacheKey:o}),Mn.add(r))};Mn.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e,n=su.getExternalBufferCacheKey({resource:t}),i=Mn.get(n);return l(i)?i:(i=new sC({resource:t,cacheKey:n}),Mn.add(i))};Mn.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=su.getGltfCacheKey({gltfResource:t}),s=Mn.get(r);return l(s)?s:(s=new Zv({resourceCache:Mn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Mn.add(s))};Mn.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=su.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return l(s)?s:(s=new jv({resourceCache:Mn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e,r=su.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return l(s)?s:(s=new qv({resourceCache:Mn,gltf:t,draco:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,asynchronous:u=!0,dequantize:f=!1,loadBuffer:h=!1,loadTypedArray:p=!1}=e,_=su.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:f,loadBuffer:h,loadTypedArray:p}),m=Mn.get(_);return l(m)?m:(m=new tw({resourceCache:Mn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,cacheKey:_,asynchronous:u,dequantize:f,loadBuffer:h,loadTypedArray:p}),Mn.add(m))};Mn.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,asynchronous:a=!0,loadBuffer:c=!1,loadTypedArray:u=!1}=e,f=su.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:c,loadTypedArray:u}),h=Mn.get(f);return l(h)?h:(h=new Xv({resourceCache:Mn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,draco:s,cacheKey:f,asynchronous:a,loadBuffer:c,loadTypedArray:u}),Mn.add(h))};Mn.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=su.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return l(s)?s:(s=new Yv({resourceCache:Mn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=su.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),u=Mn.get(c);return l(u)?u:(u=new ew({resourceCache:Mn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Mn.add(u))};Mn.clearForSpecs=function(){let e=[tw,Xv,qv,ew,Yv,jv,sC,iw,Zv],t,n=Mn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Mn.statistics.clear()};var vi=Mn;function ta(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(ta.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});ta.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};ta.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};ta.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};ta.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};ta.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};ta.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};ta.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};ta.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===os.OCTREE&&(t=3),e>>t};ta.fromSubtreeJson=async function(e,t,n,i,o){let r=new ta(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=Lke(n);let a=s.json;r._subtreeJson=a;let c;if(ri(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let C=a.tileMetadata;c=a.propertyTables[C]}let u=[];if(l(a.contentMetadata)){let C=a.contentMetadata.length;for(let A=0;A<C;A++){let S=a.contentMetadata[A];u.push(a.propertyTables[S])}}let f,h=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let C=p.class,A=h.classes[C];f=new aN({subtreeMetadata:p,class:A})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let _={constant:0};a.contentAvailabilityHeaders=[],ri(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,_));let m=Nke(a.buffers),x=Fke(a.bufferViews,m);Bke(a,x),l(c)&&Rie(c,x);for(let C=0;C<u.length;C++){let A=u[C];Rie(A,x)}let b=await kke(r,m,s.binary),T=Uke(x,b);return zke(r,a,i,T),l(c)&&(Hke(r,i,T),Wke(r)),Gke(r,i,T),jke(r),r._ready=!0,r};function Lke(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Bo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function Nke(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function Fke(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function Bke(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function Rie(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=y(r.values,r.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(r.stringOffsets,r.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(r.arrayOffsets,r.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function kke(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=Vke(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function Vke(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=vi.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function Uke(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function zke(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=ri(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=L9(t.tileAvailability,i,s,f);let h=e._contentPropertyTableJsons.length>0;f=f||h;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let _=L9(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(_)}e._childSubtreeAvailability=L9(t.childSubtreeAvailability,i,a)}function L9(e,t,n,i){if(l(e.constant))return new Hv({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new Hv({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function Hke(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new iu({class:a,count:o,properties:i.properties,bufferViews:n})}function Gke(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=o[a].availableCount,h=c.class,p=r.classes[h],_=new iu({class:p,count:f,properties:c.properties,bufferViews:n});s.push(_)}}function Oie(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function Wke(e){let t=Oie(e._tileAvailability);e._tileJumpBuffer=t}function jke(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Oie(o);t.push(r)}}ta.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new re("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};ta.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new re("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function qke(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function Yke(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}ta.prototype.getTileMetadataView=function(e){let t=qke(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new Gv({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};ta.prototype.getContentMetadataView=function(e,t){let n=Yke(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new Gv({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};ta.prototype.isDestroyed=function(){return!1};ta.prototype.destroy=function(){return l(this._bufferLoader)&&vi.unload(this._bufferLoader),ue(this)};var dC=ta;var Xke={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},hC=Object.freeze(Xke);var Cd={};Cd.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:Cd.parseBoundingVolumeSemantic("TILE",e),minimumHeight:Cd._parseMinimumHeight("TILE",e),maximumHeight:Cd._parseMaximumHeight("TILE",e)},content:{boundingVolume:Cd.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:Cd._parseMinimumHeight("CONTENT",e),maximumHeight:Cd._parseMaximumHeight("CONTENT",e)}}};Cd.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};Cd._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Cd._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var mC=Cd;function Nc(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(Nc.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Nc.fromSubtreeJson=async function(e,t,n,i,o,r){r=y(r,0);let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,u=await dC.fromSubtreeJson(n,i,s,a,c),f=new Nc(e,t,n);return f._implicitSubtree=u,Kke(f,u),f._ready=!0,f};function Kke(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=$ke(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=Zke(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=sVe(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function Zke(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function $ke(e,t,n,i){let s=Mie(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let h=1;h<f.subtreeLevels;h++){let p=t.getLevelOffset(h),_=f.branchingFactor*c.length;for(let m=0;m<_;m++){let x=p+m;if(!t.tileIsAvailableAtIndex(x)){u.push(void 0);continue}let b=t.getParentMortonIndex(m),T=c[b],C=m%f.branchingFactor,A=Mie(e,t,T,C,x);T.children.push(A),a.numberOfTilesTotal++,u.push(A)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function Lie(e,t,n){let i=hC.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Mie(e,t,n,i,o,r){let s=e._implicitTileset,a;y(r,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u,f;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let D=mC.parseAllBoundingVolumeSemantics(c);u=D.tile,f=D.content}let p=t.contentPropertyTableJsons.length,_=!1;for(let D=0;D<p;D++)if(t.contentIsAvailableAtCoordinates(a,D)){_=!0;break}let m=eVe(s,a,i,r,n,u),x=[];for(let D=0;D<s.contentCount;D++){if(!t.contentIsAvailableAtIndex(o,D))continue;let M={uri:s.contentUriTemplates[D].getDerivedResource({templateValues:a.getTemplateValues()}).url},L=tVe(m,f);l(L)&&(M.boundingVolume=L),x.push(xt(M,s.contentHeaders[D]))}let b=Lie(c,s,a),T={boundingVolume:m,geometricError:b,refine:s.refine,contents:x},C=!0,A=Ge(s.tileHeader,C);delete A.boundingVolume,delete A.transform,delete A.metadata;let S=xt(T,A,C),v=Vie(e,s.baseResource,S,n);return v.implicitCoordinates=a,v.implicitSubtree=t,v.metadata=c,v.hasImplicitContentMetadata=_,v}function LN(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ri(e,"3DTILES_bounding_volume_S2")||l(e.region))}function F9(e,t){l(t)&&(ri(e,"3DTILES_bounding_volume_S2")?Jke(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&Qke(e.region,t.minimumHeight,t.maximumHeight))}function Qke(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function Jke(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function eVe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!LN(r.boundingVolume,r)&&LN(e.boundingVolume,r)?s=Nie(e,t,n,y(i,!1),o):s=r.boundingVolume,F9(s,r),s}function tVe(e,t){let n;return l(t)&&(n=t.boundingVolume),LN(n,t)?F9(n,t):LN(e,t)&&(n=Ge(e,!0),F9(n,t)),n}function Nie(e,t,n,i,o){let r=e.boundingVolume;return ri(r,"3DTILES_bounding_volume_S2")?Fie(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:kie(r.region,t.level,t.x,t.y,t.z)}:{box:Bie(r.box,t.level,t.x,t.y,t.z)}}function Fie(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:f_.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?zv.encode2D(i,o,r):zv.encode2D(i,r,o),f=f_.fromFacePositionLevel(c,BigInt(u),i),h,p;if(l(s)){let _=(a.maximumHeight+a.minimumHeight)/2;h=n<4?a.minimumHeight:_,p=n<4?_:a.maximumHeight}else h=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:f_.getTokenFromId(f._cellId),minimumHeight:h,maximumHeight:p}}}}var nVe=new d,iVe=new d,N9=new d,oVe=new $;function Bie(e,t,n,i,o){if(t===0)return e;let r=d.unpack(e,0,iVe),s=$.unpack(e,3,oVe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,h=d.fromElements(a,a,1,nVe);l(o)&&(f=-1+(2*o+1)*a,h.z=a);let p=d.fromElements(c,u,f,N9);p=$.multiplyByVector(s,p,N9),p=d.add(p,r,N9);let _=$.clone(s);_=$.multiplyByScale(_,h,_);let m=new Array(12);return d.pack(p,m),$.pack(_,m,3),m}var rVe=new se;function kie(e,t,n,i,o){if(t===0)return e.slice();let r=se.unpack(e,0,rVe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*r.width,f=P.negativePiToPi(r.west+n*u),h=P.negativePiToPi(f+u),p=c*r.height,_=P.negativePiToPi(r.south+i*p),m=P.negativePiToPi(_+p),x=s,b=a;if(l(o)){let T=c*(a-s);x+=o*T,b=x+T}return[f,_,h,m,x,b]}function sVe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Nie(i,o,n,!1,t),s=Lie(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Vie(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function Vie(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Nc.prototype.hasProperty=function(e,t){return!1};Nc.prototype.getFeature=function(e){};Nc.prototype.applyDebugSettings=function(e,t){};Nc.prototype.applyStyle=function(e){};Nc.prototype.update=function(e,t){};Nc.prototype.pick=function(e,t,n){};Nc.prototype.isDestroyed=function(){return!1};Nc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};Nc._deriveBoundingBox=Bie;Nc._deriveBoundingRegion=kie;Nc._deriveBoundingVolumeS2=Fie;var sw=Nc;var aVe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},au=Object.freeze(aVe);function pC(e,t){this._distance=t,this._normal=new Uie(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(pC.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!d.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),d.clone(e,this._normal._cartesian3)}}});pC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new pC(e.normal,e.distance),t};pC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new pC(e.normal,e.distance)};function Uie(e,t){this._clippingPlane=t,this._cartesian3=d.clone(e)}Object.defineProperties(Uie.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var gC=pC;function Ja(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.edgeColor=z.clone(y(e.edgeColor,z.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new pe,this.planeRemoved=new pe,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?jie:qie,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function jie(e){return e===Wt.OUTSIDE}function qie(e){return e===Wt.INSIDE}Object.defineProperties(Ja.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?jie:qie)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function zie(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Ja.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){zie(n,i)},e.index=t,zie(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Ja.prototype.get=function(e){return this._planes[e]};function Yie(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}Ja.prototype.contains=function(e){return Yie(this._planes,e)!==-1};Ja.prototype.remove=function(e){let t=this._planes,n=Yie(t,e);if(n===-1)return!1;e instanceof gC&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof gC&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Ja.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof gC&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var cVe=new oe,lVe=new oe;function Hie(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=Ln.octEncodeToCartesian4(a.normal,lVe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=oe.packFloat(a.distance,cVe);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function Gie(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function Xie(e,t){let n=Ft.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var uVe=new U;Ja.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Ja.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=Xie(o,uVe);s.y*=2,i?(t=new Rt({context:n,width:s.x,height:s.y,pixelFormat:tt.RGBA,pixelDatatype:Ke.FLOAT,sampler:Zt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Rt({context:n,width:s.x,height:s.y,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:Zt.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(Gie(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Hie(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),Gie(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),Hie(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var fVe=new F,Wie=new sn(d.UNIT_X,0);Ja.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=F.multiply(t,o,fVe));let r=Wt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Wt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,o,Wie);let c=e.intersectPlane(Wie);if(c===Wt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Ja.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ja.useFloatTexture=function(e){return e.floatingPointTexture};Ja.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Ja.useFloatTexture(t)?e.length:e.length*2,r=Xie(o,n);return r.y*=2,r};Ja.prototype.isDestroyed=function(){return!1};Ja.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var bs=Ja;function V9(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=Zie(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,u;if(i&&(r=gVe(e,t,r,n)),e.length>80*n){a=1/0,c=1/0;let f=-1/0,h=-1/0;for(let p=n;p<o;p+=n){let _=e[p],m=e[p+1];_<a&&(a=_),m<c&&(c=m),_>f&&(f=_),m>h&&(h=m)}u=Math.max(f-a,h-c),u=u!==0?32767/u:0}return cw(r,s,n,a,c,u,0),s}function Zie(e,t,n,i,o){let r;if(o===wVe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=Kie(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=Kie(s/i|0,e[s],e[s+1],r);return r&&_C(r,r.next)&&(uw(r),r=r.next),r}function lx(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(_C(n,n.next)||Rr(n.prev,n,n.next)===0)){if(uw(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function cw(e,t,n,i,o,r,s){if(!e)return;!s&&r&&TVe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(r?hVe(e,i,o,r):dVe(e)){t.push(c.i,e.i,u.i),uw(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=mVe(lx(e),t),cw(e,t,n,i,o,r,2)):s===2&&pVe(e,t,n,i,o,r):cw(lx(e),t,n,i,o,r,1);break}}}function dVe(e){let t=e.prev,n=e,i=e.next;if(Rr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(o,r,s),h=Math.min(a,c,u),p=Math.max(o,r,s),_=Math.max(a,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=h&&m.y<=_&&aw(o,a,r,c,s,u,m.x,m.y)&&Rr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function hVe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Rr(o,r,s)>=0)return!1;let a=o.x,c=r.x,u=s.x,f=o.y,h=r.y,p=s.y,_=Math.min(a,c,u),m=Math.min(f,h,p),x=Math.max(a,c,u),b=Math.max(f,h,p),T=B9(_,m,t,n,i),C=B9(x,b,t,n,i),A=e.prevZ,S=e.nextZ;for(;A&&A.z>=T&&S&&S.z<=C;){if(A.x>=_&&A.x<=x&&A.y>=m&&A.y<=b&&A!==o&&A!==s&&aw(a,f,c,h,u,p,A.x,A.y)&&Rr(A.prev,A,A.next)>=0||(A=A.prevZ,S.x>=_&&S.x<=x&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&aw(a,f,c,h,u,p,S.x,S.y)&&Rr(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;A&&A.z>=T;){if(A.x>=_&&A.x<=x&&A.y>=m&&A.y<=b&&A!==o&&A!==s&&aw(a,f,c,h,u,p,A.x,A.y)&&Rr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;S&&S.z<=C;){if(S.x>=_&&S.x<=x&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&aw(a,f,c,h,u,p,S.x,S.y)&&Rr(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function mVe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!_C(i,o)&&Qie(i,n,n.next,o)&&lw(i,o)&&lw(o,i)&&(t.push(i.i,n.i,o.i),uw(n),uw(n.next),n=e=o),n=n.next}while(n!==e);return lx(n)}function pVe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&EVe(s,a)){let c=Jie(s,a);s=lx(s,s.next),c=lx(c,c.next),cw(s,t,n,i,o,r,0),cw(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function gVe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,u=Zie(e,a,c,i,!1);u===u.next&&(u.steiner=!0),o.push(AVe(u))}o.sort(_Ve);for(let r=0;r<o.length;r++)n=yVe(o[r],n);return n}function _Ve(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),o=(t.next.y-t.y)/(t.next.x-t.x);n=i-o}return n}function yVe(e,t){let n=xVe(e,t);if(!n)return t;let i=Jie(n,e);return lx(i,i.next),lx(n,n.next)}function xVe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(_C(e,n))return n;do{if(_C(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>r&&(r=h,s=n.x<n.next.x?n:n.next,h===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&$ie(o<u?i:r,o,c,u,o<u?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);lw(n,e)&&(h<f||h===f&&(n.x>s.x||n.x===s.x&&bVe(s,n)))&&(s=n,f=h)}n=n.next}while(n!==a);return s}function bVe(e,t){return Rr(e.prev,e,t.prev)<0&&Rr(t.next,e,e.next)<0}function TVe(e,t,n,i){let o=e;do o.z===0&&(o.z=B9(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,CVe(o)}function CVe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function B9(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function AVe(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function $ie(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function aw(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&$ie(e,t,n,i,o,r,s,a)}function EVe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!SVe(e,t)&&(lw(e,t)&&lw(t,e)&&vVe(e,t)&&(Rr(e.prev,e,t.prev)||Rr(e,t.prev,t))||_C(e,t)&&Rr(e.prev,e,e.next)>0&&Rr(t.prev,t,t.next)>0)}function Rr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function _C(e,t){return e.x===t.x&&e.y===t.y}function Qie(e,t,n,i){let o=FN(Rr(e,t,n)),r=FN(Rr(e,t,i)),s=FN(Rr(n,i,e)),a=FN(Rr(n,i,t));return!!(o!==r&&s!==a||o===0&&NN(e,n,t)||r===0&&NN(e,i,t)||s===0&&NN(n,e,i)||a===0&&NN(n,t,i))}function NN(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function FN(e){return e>0?1:e<0?-1:0}function SVe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Qie(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function lw(e,t){return Rr(e.prev,e,e.next)<0?Rr(e,t,e.next)>=0&&Rr(e,e.prev,t)>=0:Rr(e,t,e.prev)<0||Rr(e,e.next,t)<0}function vVe(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Jie(e,t){let n=k9(e.i,e.x,e.y),i=k9(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function Kie(e,t,n,i){let o=k9(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function uw(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function k9(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function wVe(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var DVe=new d,IVe=new d,T_={};T_.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};T_.computeWindingOrder2D=function(e){return T_.computeArea2D(e)>0?gs.COUNTER_CLOCKWISE:gs.CLOCKWISE};T_.triangulate=function(e,t){let n=U.packArray(e);return V9(n,t,2)};var ioe=new d,ooe=new d,roe=new d,eoe=new d,toe=new d,noe=new d,vp=new d,soe=new U,aoe=new U,coe=new U,yC=new U;T_.computeSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),h=0,p=0;for(a=0;a<c;a++){let A=t[a];if(u[h++]=A.x,u[h++]=A.y,u[h++]=A.z,r){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let _=[],m={},x=e.maximumRadius,b=P.chordLength(o,x),T=b*b;for(;s.length>0;){let A=s.pop(),S=s.pop(),v=s.pop(),D=d.fromArray(u,v*3,ioe),O=d.fromArray(u,S*3,ooe),R=d.fromArray(u,A*3,roe),M,L,g;r&&(M=U.fromArray(f,v*2,soe),L=U.fromArray(f,S*2,aoe),g=U.fromArray(f,A*2,coe));let E=d.multiplyByScalar(d.normalize(D,eoe),x,eoe),w=d.multiplyByScalar(d.normalize(O,toe),x,toe),I=d.multiplyByScalar(d.normalize(R,noe),x,noe),N=d.magnitudeSquared(d.subtract(E,w,vp)),B=d.magnitudeSquared(d.subtract(w,I,vp)),H=d.magnitudeSquared(d.subtract(I,E,vp)),V=Math.max(N,B,H),G,k,W;V>T?N===V?(G=`${Math.min(v,S)} ${Math.max(v,S)}`,a=m[G],l(a)||(k=d.add(D,O,vp),d.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=U.add(M,L,yC),U.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(v,a,A),s.push(a,S,A)):B===V?(G=`${Math.min(S,A)} ${Math.max(S,A)}`,a=m[G],l(a)||(k=d.add(O,R,vp),d.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=U.add(L,g,yC),U.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(S,a,v),s.push(a,A,v)):H===V&&(G=`${Math.min(A,v)} ${Math.max(A,v)}`,a=m[G],l(a)||(k=d.add(R,D,vp),d.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=U.add(g,M,yC),U.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(A,a,S),s.push(a,v,S)):(_.push(v),_.push(S),_.push(A))}let C={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:_,primitiveType:Me.TRIANGLES};return r&&(C.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new st(C)};var PVe=new fe,RVe=new fe,OVe=new fe,U9=new fe;T_.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),h=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[h++]=v.x,u[h++]=v.y,u[h++]=v.z,r){let D=i[a];f[p++]=D.x,f[p++]=D.y}}let _=[],m={},x=e.maximumRadius,b=P.chordLength(o,x),T=new Xa(void 0,void 0,e),C=new Xa(void 0,void 0,e),A=new Xa(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),D=s.pop(),O=s.pop(),R=d.fromArray(u,O*3,ioe),M=d.fromArray(u,D*3,ooe),L=d.fromArray(u,v*3,roe),g,E,w;r&&(g=U.fromArray(f,O*2,soe),E=U.fromArray(f,D*2,aoe),w=U.fromArray(f,v*2,coe));let I=e.cartesianToCartographic(R,PVe),N=e.cartesianToCartographic(M,RVe),B=e.cartesianToCartographic(L,OVe);T.setEndPoints(I,N);let H=T.surfaceDistance;C.setEndPoints(N,B);let V=C.surfaceDistance;A.setEndPoints(B,I);let G=A.surfaceDistance,k=Math.max(H,V,G),W,Y,J,j,K;k>b?H===k?(W=`${Math.min(O,D)} ${Math.max(O,D)}`,a=m[W],l(a)||(Y=T.interpolateUsingFraction(.5,U9),J=(I.height+N.height)*.5,j=d.fromRadians(Y.longitude,Y.latitude,J,e,vp),u.push(j.x,j.y,j.z),a=u.length/3-1,m[W]=a,r&&(K=U.add(g,E,yC),U.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(O,a,v),s.push(a,D,v)):V===k?(W=`${Math.min(D,v)} ${Math.max(D,v)}`,a=m[W],l(a)||(Y=C.interpolateUsingFraction(.5,U9),J=(N.height+B.height)*.5,j=d.fromRadians(Y.longitude,Y.latitude,J,e,vp),u.push(j.x,j.y,j.z),a=u.length/3-1,m[W]=a,r&&(K=U.add(E,w,yC),U.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(D,a,O),s.push(a,v,O)):G===k&&(W=`${Math.min(v,O)} ${Math.max(v,O)}`,a=m[W],l(a)||(Y=A.interpolateUsingFraction(.5,U9),J=(B.height+I.height)*.5,j=d.fromRadians(Y.longitude,Y.latitude,J,e,vp),u.push(j.x,j.y,j.z),a=u.length/3-1,m[W]=a,r&&(K=U.add(w,g,yC),U.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(v,a,D),s.push(a,O,D)):(_.push(O),_.push(D),_.push(v))}let S={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:_,primitiveType:Me.TRIANGLES};return r&&(S.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new st(S)};T_.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,ee.default);let o=DVe,r=IVe;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)d.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),d.multiplyByScalar(o,t,o),d.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var si=T_;function C_(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(C_.prototype,{length:{get:function(){return this._length}}});C_.prototype.enqueue=function(e){this._array.push(e),this._length++};C_.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};C_.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};C_.prototype.contains=function(e){return this._array.indexOf(e)!==-1};C_.prototype.clear=function(){this._array.length=this._offset=this._length=0};C_.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var ux=C_;var qo={};qo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};qo.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)o.push(a[u])}}return n};qo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=qo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var fx=new U;function foe(e,t,n,i){return U.subtract(t,e,fx),U.multiplyByScalar(fx,n/i,fx),U.add(e,fx,fx),[fx.x,fx.y]}var A_=new d;function MVe(e,t,n,i){return d.subtract(t,e,A_),d.multiplyByScalar(A_,n/i,A_),d.add(e,A_,A_),[A_.x,A_.y,A_.z]}qo.subdivideLineCount=function(e,t,n){let o=d.distance(e,t)/n,r=Math.max(0,Math.ceil(P.log2(o)));return Math.pow(2,r)};var kN=new fe,VN=new fe,LVe=new fe,NVe=new d,BN=new Xa;qo.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,kN),r=e.cartesianToCartographic(n,VN),a=new Xa(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};qo.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=qo.subdivideLineCount(n,i,o),a=U.distance(e,t),c=a/s,u=r;u.length=s*2;let f=0;for(let h=0;h<s;h++){let p=foe(e,t,h*c,a);u[f++]=p[0],u[f++]=p[1]}return u};qo.subdivideLine=function(e,t,n,i){let o=qo.subdivideLineCount(e,t,n),r=d.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let u=0;u<o;u++){let f=MVe(e,t,u*s,r);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};qo.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,kN),c=n.cartesianToCartographic(o,VN);BN.setEndPoints(a,c);let u=BN.surfaceDistance/r,f=Math.max(0,Math.ceil(P.log2(u))),h=Math.pow(2,f),p=U.distance(e,t),_=p/h,m=s;m.length=h*2;let x=0;for(let b=0;b<h;b++){let T=foe(e,t,b*_,p);m[x++]=T[0],m[x++]=T[1]}return m};qo.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,kN),s=e.cartesianToCartographic(n,VN),a=new Xa(r,s,e),c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,u),h=a.surfaceDistance/f;l(o)||(o=[]);let p=o;p.length=f*3;let _=0;for(let m=0;m<f;m++){let x=a.interpolateUsingSurfaceDistance(m*h,LVe),b=e.cartographicToCartesian(x,NVe);p[_++]=b.x,p[_++]=b.y,p[_++]=b.z}return p};var FVe=new d,BVe=new d,kVe=new d,VVe=new d;qo.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=y(i,ee.default);let r=FVe,s=BVe,a=kVe,c=VVe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let h=0;h<f;h+=3)d.fromArray(u,h,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=d.multiplyByScalar(r,n,s),s=d.add(c,s,s),u[h+f]=s.x,u[h+1+f]=s.y,u[h+2+f]=s.z,o&&(c=d.clone(a,c)),s=d.multiplyByScalar(r,t,s),s=d.add(c,s,s),u[h]=s.x,u[h+1]=s.y,u[h+2]=s.z}return e};qo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new ux;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=bo(u,d.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let h=c.holes[r],p=h.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=bo(p,d.equalsEpsilon,!0),p.length<3)continue;i.push(p);let _=0;for(l(h.holes)&&(_=h.holes.length),s=0;s<_;s++)o.enqueue(h.holes[s])}i.push(u)}return i};var UVe=new fe;function zVe(e,t,n){let i=n.cartesianToCartographic(e,kN),o=n.cartesianToCartographic(t,VN);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;BN.setEndPoints(i,o);let r=BN.findIntersectionWithLatitude(0,UVe);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>P.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function HVe(e,t,n,i){if(i===Jt.RHUMB)return zVe(e,t,n);let o=Qn.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var GVe=new fe;function WVe(e,t,n){let i=[],o,r,s,a,c,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],s=P.sign(o.z),a=P.sign(r.z);let f=h=>t.cartesianToCartographic(h,GVe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(c=HVe(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function doe(e,t,n,i,o,r,s){let a=[],c=r,u=h=>p=>p.position===h,f=[];do{let h=n[c];a.push(h);let p=i.findIndex(u(c)),_=i[p];if(!l(_)){++c;continue}let{visited:m,type:x,next:b}=_;if(_.visited=!0,x===0){if(b===0){let S=i[p-(s?1:-1)];if(S?.position===c+1)S.visited=!0;else{++c;continue}}if(!m&&s&&b>0||r===c&&!s&&b<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}m||f.push(c);let C=p+(s?1:-1),A=i[C];if(!l(A)){++c;continue}c=A.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let h of f)t=doe(e,++t,n,i,0,h,!s);return t}qo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=WVe(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;o=doe(i,o,s,a,1,0,c)}return i};qo.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new ux;c.enqueue(e);let u=l(r);for(;c.length!==0;){let f=c.dequeue(),h=f.positions,p=f.holes,_,m;if(i)for(m=h.length,_=0;_<m;_++)o.scaleToGeodeticSurface(h[_],h[_]);if(t||(h=bo(h,d.equalsEpsilon,!0)),h.length<3)continue;let x=n(h);if(!l(x))continue;let b=[],T=si.computeWindingOrder2D(x);if(T===gs.CLOCKWISE&&(x.reverse(),h=h.slice().reverse()),u){u=!1;let D=[h];if(D=r(D,D),D.length>1){for(let O of D)c.enqueue(new Ka(O,p));continue}}let C=h.slice(),A=l(p)?p.length:0,S=[],v;for(_=0;_<A;_++){let D=p[_],O=D.positions;if(i)for(m=O.length,v=0;v<m;++v)o.scaleToGeodeticSurface(O[v],O[v]);if(t||(O=bo(O,d.equalsEpsilon,!0)),O.length<3)continue;let R=n(O);if(!l(R))continue;T=si.computeWindingOrder2D(R),T===gs.CLOCKWISE&&(R.reverse(),O=O.slice().reverse()),S.push(O),b.push(C.length),C=C.concat(O),x=x.concat(R);let M=0;for(l(D.holes)&&(M=D.holes.length),v=0;v<M;v++)c.enqueue(D.holes[v])}s.push({outerRing:h,holes:S}),a.push({positions:C,positions2D:x,holes:b})}return{hierarchy:s,polygons:a}};var jVe=new U,qVe=new d,YVe=new Oe,XVe=new $;qo.computeBoundingRectangle=function(e,t,n,i,o){let r=Oe.fromAxisAngle(e,i,YVe),s=$.fromQuaternion(r,XVe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=n.length;for(let p=0;p<h;++p){let _=d.clone(n[p],qVe);$.multiplyByVector(s,_,_);let m=t(_,jVe);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=a,o.y=u,o.width=c-a,o.height=f-u,o};qo.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=si.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let h=c.length,p=new Array(h*3),_=0;for(let b=0;b<h;b++){let T=c[b];p[_++]=T.x,p[_++]=T.y,p[_++]=T.z}let m={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Me.TRIANGLES};u&&(m.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:U.packArray(f)}));let x=new st(m);return r.normal?Nn.computeNormal(x):x}if(s===Jt.GEODESIC)return si.computeSubdivision(e,c,a,f,i);if(s===Jt.RHUMB)return si.computeRhumbLineSubdivision(e,c,a,f,i)};var loe=[],uoe=[],KVe=new d,ZVe=new d;qo.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,u,f,h,p,_,m,x=e.length,b=0,T=0,C=l(t),A=C?t.positions:void 0;if(o)for(a=x*3*2,s=new Array(a*2),C&&(m=x*2*2,_=new Array(m*2)),c=0;c<x;c++)u=e[c],f=e[(c+1)%x],s[b]=s[b+a]=u.x,++b,s[b]=s[b+a]=u.y,++b,s[b]=s[b+a]=u.z,++b,s[b]=s[b+a]=f.x,++b,s[b]=s[b+a]=f.y,++b,s[b]=s[b+a]=f.z,++b,C&&(h=A[c],p=A[(c+1)%x],_[T]=_[T+m]=h.x,++T,_[T]=_[T+m]=h.y,++T,_[T]=_[T+m]=p.x,++T,_[T]=_[T+m]=p.y,++T);else{let R=P.chordLength(i,n.maximumRadius),M=0;if(r===Jt.GEODESIC)for(c=0;c<x;c++)M+=qo.subdivideLineCount(e[c],e[(c+1)%x],R);else if(r===Jt.RHUMB)for(c=0;c<x;c++)M+=qo.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],R);for(a=(M+x)*3,s=new Array(a*2),C&&(m=(M+x)*2,_=new Array(m*2)),c=0;c<x;c++){u=e[c],f=e[(c+1)%x];let L,g;C&&(h=A[c],p=A[(c+1)%x]),r===Jt.GEODESIC?(L=qo.subdivideLine(u,f,R,uoe),C&&(g=qo.subdivideTexcoordLine(h,p,u,f,R,loe))):r===Jt.RHUMB&&(L=qo.subdivideRhumbLine(n,u,f,R,uoe),C&&(g=qo.subdivideTexcoordRhumbLine(h,p,n,u,f,R,loe)));let E=L.length;for(let w=0;w<E;++w,++b)s[b]=L[w],s[b+a]=L[w];if(s[b]=f.x,s[b+a]=f.x,++b,s[b]=f.y,s[b+a]=f.y,++b,s[b]=f.z,s[b+a]=f.z,++b,C){let w=g.length;for(let I=0;I<w;++I,++T)_[T]=g[I],_[T+m]=g[I];_[T]=p.x,_[T+m]=p.x,++T,_[T]=p.y,_[T+m]=p.y,++T}}}x=s.length;let S=Ne.createTypedArray(x/3,x-e.length*6),v=0;for(x/=6,c=0;c<x;c++){let R=c,M=R+1,L=R+x,g=L+1;u=d.fromArray(s,R*3,KVe),f=d.fromArray(s,M*3,ZVe),!d.equalsEpsilon(u,f,P.EPSILON10,P.EPSILON10)&&(S[v++]=R,S[v++]=L,S[v++]=M,S[v++]=M,S[v++]=L,S[v++]=g)}let D={attributes:new dn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),indices:S,primitiveType:Me.TRIANGLES};return C&&(D.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:_})),new st(D)};var Un=qo;function Or(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Or.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Or.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=U.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(P.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=P.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=P.TWO_PI),e}}});var xC=new fe,$Ve=new d;Or.prototype.getLatitude=function(e){l(e)||(e=ee.default),xC.latitude=this.conformalLatitude,xC.longitude=this.longitude,xC.height=0;let t=this.ellipsoid.cartographicToCartesian(xC,$Ve);return e.cartesianToCartographic(t,xC),xC.latitude};var QVe=new pn,JVe=new d,eUe=new d;Or.fromCartesian=function(e,t){let n=P.signNotZero(e.z),i=Or.NORTH_POLE_TANGENT_PLANE,o=Or.SOUTH_POLE;n<0&&(i=Or.SOUTH_POLE_TANGENT_PLANE,o=Or.NORTH_POLE);let r=QVe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=d.subtract(r.origin,o,JVe),d.normalize(r.direction,r.direction);let s=Qn.rayPlane(r,i.plane,eUe),a=d.subtract(s,o,s),c=d.dot(i.xAxis,a),u=n*d.dot(i.yAxis,a);return l(t)?(t.position=new U(c,u),t.tangentPlane=i,t):new Or(new U(c,u),i)};Or.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Or.fromCartesian(e[i],t[i]);return t};Or.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Or(e.position,e.tangentPlane)};Or.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));Or.NORTH_POLE=Object.freeze(new d(0,0,.5));Or.SOUTH_POLE=Object.freeze(new d(0,0,-.5));Or.NORTH_POLE_TANGENT_PLANE=Object.freeze(new ns(Or.NORTH_POLE,Or.HALF_UNIT_SPHERE));Or.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new ns(Or.SOUTH_POLE,Or.HALF_UNIT_SPHERE));var Fc=Or;var tUe=new fe,hoe=new fe;function nUe(e,t,n,i){let r=i.cartesianToCartographic(e,tUe).height,s=i.cartesianToCartographic(t,hoe);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,hoe);a.height=r-100,i.cartographicToCartesian(a,n)}var moe=new qe,iUe=new d,oUe=new d,rUe=new d,sUe=new d,aUe=new d,cUe=new d,UN=new d,Xh=new d,bC=new d,lUe=new U,uUe=new U,fUe=new d,poe=new Oe,dUe=new $,hUe=new $;function z9(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,h=e.rotationAxis,p=e.projectTo2d,_=e.ellipsoid,m=e.stRotation,x=e.perPositionHeight,b=lUe;b.x=f.x,b.y=f.y;let T=t.st?new Float32Array(2*(s/3)):void 0,C;t.normal&&(x&&c&&!a?C=n.attributes.normal.values:C=new Float32Array(s));let A=t.tangent?new Float32Array(s):void 0,S=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,D=0,O=0,R=oUe,M=rUe,L=sUe,g=!0,E=dUe,w=hUe;if(m!==0){let B=Oe.fromAxisAngle(h,m,poe);E=$.fromQuaternion(B,E),B=Oe.fromAxisAngle(h,-m,poe),w=$.fromQuaternion(B,w)}else E=$.clone($.IDENTITY,E),w=$.clone($.IDENTITY,w);let I=0,N=0;c&&u&&(I=s/2,N=s/3,s/=2);for(let B=0;B<s;B+=3){let H=d.fromArray(o,B,fUe);if(t.st&&!l(r)){let V=$.multiplyByVector(E,H,iUe);V=_.scaleToGeodeticSurface(V,V);let G=p([V],uUe)[0];U.subtract(G,b,G);let k=P.clamp(G.x/f.width,0,1),W=P.clamp(G.y/f.height,0,1);u&&(T[D+N]=k,T[D+1+N]=W),c&&(T[D]=k,T[D+1]=W),D+=2}if(t.normal||t.tangent||t.bitangent||i){let V=O+1,G=O+2;if(a){if(B+3<s){let k=d.fromArray(o,B+3,aUe);if(g){let W=d.fromArray(o,B+s,cUe);x&&nUe(H,k,W,_),d.subtract(k,H,k),d.subtract(W,H,W),R=d.normalize(d.cross(W,k,R),R),g=!1}d.equalsEpsilon(k,H,P.EPSILON10)&&(g=!0)}(t.tangent||t.bitangent)&&(L=_.geodeticSurfaceNormal(H,L),t.tangent&&(M=d.normalize(d.cross(L,R,M),M)))}else R=_.geodeticSurfaceNormal(H,R),(t.tangent||t.bitangent)&&(x&&(UN=d.fromArray(C,O,UN),Xh=d.cross(d.UNIT_Z,UN,Xh),Xh=d.normalize($.multiplyByVector(w,Xh,Xh),Xh),t.bitangent&&(bC=d.normalize(d.cross(UN,Xh,bC),bC))),M=d.cross(d.UNIT_Z,R,M),M=d.normalize($.multiplyByVector(w,M,M),M),t.bitangent&&(L=d.normalize(d.cross(R,M,L),L)));t.normal&&(e.wall?(C[O+I]=R.x,C[V+I]=R.y,C[G+I]=R.z):u&&(C[O+I]=-R.x,C[V+I]=-R.y,C[G+I]=-R.z),(c&&!x||a)&&(C[O]=R.x,C[V]=R.y,C[G]=R.z)),i&&(a&&(R=_.geodeticSurfaceNormal(H,R)),v[O+I]=-R.x,v[V+I]=-R.y,v[G+I]=-R.z),t.tangent&&(e.wall?(A[O+I]=M.x,A[V+I]=M.y,A[G+I]=M.z):u&&(A[O+I]=-M.x,A[V+I]=-M.y,A[G+I]=-M.z),c&&(x?(A[O]=Xh.x,A[V]=Xh.y,A[G]=Xh.z):(A[O]=M.x,A[V]=M.y,A[G]=M.z))),t.bitangent&&(u&&(S[O+I]=L.x,S[V+I]=L.y,S[G+I]=L.z),c&&(x?(S[O]=bC.x,S[V]=bC.y,S[G]=bC.z):(S[O]=L.x,S[V]=L.y,S[G]=L.z))),O+=3}}t.st&&!l(r)&&(n.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T})),t.normal&&(n.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(n.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:S})),i&&(n.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,h=new Uint8Array(f);if(e.offsetAttribute===rn.TOP)c&&u||a?h=h.fill(1,0,f/2):c&&(h=h.fill(1));else{let p=e.offsetAttribute===rn.NONE?0:1;h=h.fill(p)}n.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var goe=[];function mUe(e,t,n,i,o,r,s,a,c,u){let f={walls:[]},h;if(s||a){let C=Un.createGeometryFromPositions(e,t,n,i,r,c,u),A=C.attributes.position.values,S=C.indices,v,D;if(s&&a){let O=A.concat(A);v=O.length/3,D=Ne.createTypedArray(v,S.length*2),D.set(S);let R=S.length,M=v/2;for(h=0;h<R;h+=3){let L=D[h]+M,g=D[h+1]+M,E=D[h+2]+M;D[h+R]=E,D[h+1+R]=g,D[h+2+R]=L}if(C.attributes.position.values=O,r&&c.normal){let L=C.attributes.normal.values;C.attributes.normal.values=new Float32Array(O.length),C.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=C.attributes.st.values;C.attributes.st.values=new Float32Array(v*2),C.attributes.st.values=L.concat(L)}C.indices=D}else if(a){for(v=A.length/3,D=Ne.createTypedArray(v,S.length),h=0;h<S.length;h+=3)D[h]=S[h+2],D[h+1]=S[h+1],D[h+2]=S[h];C.indices=D}f.topAndBottom=new vt({geometry:C})}let p=o.outerRing,_=ns.fromPoints(p,e),m=_.projectPointsOntoPlane(p,goe),x=si.computeWindingOrder2D(m);x===gs.CLOCKWISE&&(p=p.slice().reverse());let b=Un.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new vt({geometry:b}));let T=o.holes;for(h=0;h<T.length;h++){let C=T[h];m=_.projectPointsOntoPlane(C,goe),x=si.computeWindingOrder2D(m),x===gs.COUNTER_CLOCKWISE&&(C=C.slice().reverse()),b=Un.computeWallGeometry(C,n,e,i,r,u),f.walls.push(new vt({geometry:b}))}return f}function pf(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Ie.DEFAULT),i=y(e.ellipsoid,ee.default),o=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),u=y(e.height,0),f=y(e.extrudedHeight,u);if(!c){let h=Math.max(u,f);f=Math.min(u,f),u=h}this._vertexFormat=Ie.clone(n),this._ellipsoid=ee.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,Jt.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Un.computeHierarchyPackedLength(t,d)+ee.packedLength+Ie.packedLength+(s?Un.computeHierarchyPackedLength(s,U):1)+12}pf.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new pf(t)};pf.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=Un.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n++]=e.packedLength,t};var pUe=ee.clone(ee.UNIT_SPHERE),gUe=new Ie,_Ue={polygonHierarchy:{}};pf.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,pUe);t+=ee.packedLength;let r=Ie.unpack(e,t,gUe);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,h=e[t++]===1,p=e[t++]===1,_=e[t++]===1,m=e[t++]===1,x=e[t++],b=e[t++],T=e[t]===-1?void 0:Un.unpackPolygonHierarchy(e,t,U);l(T)?(t=T.startingIndex,delete T.startingIndex):t++;let C=e[t++];return l(n)||(n=new pf(_Ue)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=h,n._closeTop=p,n._closeBottom=_,n._shadowVolume=m,n._offsetAttribute=x===-1?void 0:x,n._arcType=b,n._textureCoordinates=T,n.packedLength=C,n};var yUe=new U,xUe=new U,bUe=new Fc;function _oe(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+P.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==Jt.RHUMB){let p=U.subtract(t.position,e.position,yUe),_=U.dot(t.position,p)/U.dot(p,p);if(_>0&&_<1){let m=U.add(t.position,U.multiplyByScalar(p,-_,p),xUe),x=Fc.clone(t,bUe);x.position=m;let b=x.getLatitude(n);r.south=Math.min(r.south,b),r.north=Math.max(r.north,b),Math.abs(c)>Math.abs(b)&&(u=b)}}let f=t.x*e.y-e.x*t.y,h=Math.sign(f);h!==0&&(h*=U.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=h),u<=0&&(o.southAngle+=h)}var yoe=new Fc,TUe=new Fc,mf={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};pf.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new se),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,mf.northAngle=0,mf.southAngle=0,mf.westOverIdl=Number.POSITIVE_INFINITY,mf.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=Fc.fromCartesian(e[0],TUe);for(let s=1;s<o;s++){let a=Fc.fromCartesian(e[s],yoe);_oe(a,r,t,n,mf,i),r=Fc.clone(a,r)}return _oe(Fc.fromCartesian(e[0],yoe),r,t,n,mf,i),i.east-i.west>mf.eastOverIdl-mf.westOverIdl&&(i.west=mf.westOverIdl,i.east=mf.eastOverIdl,i.east>P.PI&&(i.east=i.east-P.TWO_PI),i.west>P.PI&&(i.west=i.west-P.TWO_PI)),P.equalsEpsilon(Math.abs(mf.northAngle),P.TWO_PI,P.EPSILON10)&&(i.north=P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),P.equalsEpsilon(Math.abs(mf.southAngle),P.TWO_PI,P.EPSILON10)&&(i.south=-P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),i};var CUe=new Fc;function AUe(e,t,n){return e.height>=P.PI||e.width>=P.PI?Fc.fromCartesian(t[0],CUe).tangentPlane:ns.fromPoints(t,n)}var xoe=new fe;function EUe(e,t,n){return(i,o)=>{if(e.height>=P.PI||e.width>=P.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],xoe);o[s]=new U(a.longitude/P.PI,a.latitude/P.PI_OVER_TWO)}return o.length=i.length,o}return Fc.fromCartesianArray(i,o)}return ns.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function SUe(e,t,n){if(e.height>=P.PI||e.width>=P.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,xoe);return l(r)||(r=new U),r.x=s.longitude/P.PI,r.y=s.latitude/P.PI_OVER_TWO,r}return Fc.fromCartesian(o,r)};let i=ns.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function vUe(e,t,n,i){return(o,r)=>!i&&(e.height>=P.PI_OVER_TWO||e.width>=2*P.PI_OVER_THREE)?Un.splitPolygonsOnEquator(o,t,n,r):o}function wUe(e,t,n,i){if(t.height>=P.PI||t.width>=P.PI)return qe.fromRectangle(t,void 0,moe);let o=e,r=ns.fromPoints(o,n);return Un.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,moe)}pf.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,h=l(f),p=r.positions;if(p.length<3)return;let _=e.rectangle,m=Un.polygonsFromHierarchy(r,h,EUe(_,p,n),!s,n,vUe(_,n,u,s)),x=m.hierarchy,b=m.polygons,T=function(I){return I},C=h?Un.polygonsFromHierarchy(f,!0,T,!1,n).polygons:void 0;if(x.length===0)return;let A=x[0].outerRing,S=wUe(A,_,n,o),v=[],D=e._height,O=e._extrudedHeight,R=e._perPositionHeightExtrude||!P.equalsEpsilon(D,O,0,P.EPSILON2),M={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:AUe(_,A,n).plane.normal,projectTo2d:SUe(_,A,n),boundingRectangle:S,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(R)for(M.extrude=!0,M.top=a,M.bottom=c,M.shadowVolume=e._shadowVolume,M.offsetAttribute=e._offsetAttribute,L=0;L<b.length;L++){let I=mUe(n,b[L],h?C[L]:void 0,i,x[L],s,a,c,t,u),N;a&&c?(N=I.topAndBottom,M.geometry=Un.scaleToGeodeticHeightExtruded(N.geometry,D,O,n,s)):a?(N=I.topAndBottom,N.geometry.attributes.position.values=si.scaleToGeodeticHeight(N.geometry.attributes.position.values,D,n,!s),M.geometry=N.geometry):c&&(N=I.topAndBottom,N.geometry.attributes.position.values=si.scaleToGeodeticHeight(N.geometry.attributes.position.values,O,n,!0),M.geometry=N.geometry),(a||c)&&(M.wall=!1,N.geometry=z9(M),v.push(N));let B=I.walls;M.wall=!0;for(let H=0;H<B.length;H++){let V=B[H];M.geometry=Un.scaleToGeodeticHeightExtruded(V.geometry,D,O,n,s),V.geometry=z9(M),v.push(V)}}else for(L=0;L<b.length;L++){let I=new vt({geometry:Un.createGeometryFromPositions(n,b[L],h?C[L]:void 0,i,s,t,u)});if(I.geometry.attributes.position.values=si.scaleToGeodeticHeight(I.geometry.attributes.position.values,D,n,!s),M.geometry=I.geometry,I.geometry=z9(M),l(e._offsetAttribute)){let N=I.geometry.attributes.position.values.length,B=e._offsetAttribute===rn.NONE?0:1,H=new Uint8Array(N/3).fill(B);I.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:H})}v.push(I)}let g=Nn.combineInstances(v)[0];g.attributes.position.values=new Float64Array(g.attributes.position.values),g.indices=Ne.createTypedArray(g.attributes.position.values.length/3,g.indices);let E=g.attributes,w=ae.fromVertices(E.position.values);return t.position||delete E.position,new st({attributes:E,indices:g.indices,primitiveType:g.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};pf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new pf({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function DUe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return st._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(pf.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=pf.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=DUe(this)),this._textureCoordinateRotationPoints}}});var E_=pf;function dx(e){this._ellipsoid=y(e.ellipsoid,ee.default),this._positions=[...e.positions]}Object.defineProperties(dx.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});dx.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new dx({positions:e.positions,ellipsoid:e.ellipsoid})};dx.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};dx.prototype.computeRectangle=function(e){return E_.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var IUe=new se,boe=new d;dx.prototype.computeSphericalExtents=function(e){l(e)||(e=new se);let t=this.computeRectangle(IUe),n=fe.toCartesian(se.southwest(t),this.ellipsoid,boe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=P.fastApproximateAtan2(i,n.z),r=P.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=fe.toCartesian(se.northeast(t),this.ellipsoid,boe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=P.fastApproximateAtan2(i,n.z),r=P.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var fw=dx;var zN=`in vec2 v_textureCoordinates; + +uniform int u_polygonsLength; +uniform int u_extentsLength; +uniform highp sampler2D u_polygonTexture; +uniform highp sampler2D u_extentsTexture; + +int getPolygonIndex(float dimension, vec2 coord) { + vec2 uv = coord.xy * dimension; + return int(floor(uv.y) * dimension + floor(uv.x)); +} + +vec2 getLookupUv(ivec2 dimensions, int i) { + int pixY = i / dimensions.x; + int pixX = i - (pixY * dimensions.x); + float pixelWidth = 1.0 / float(dimensions.x); + float pixelHeight = 1.0 / float(dimensions.y); + float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel + float v = (float(pixY) + 0.5) * pixelHeight; + return vec2(u, v); +} + +vec4 getExtents(int i) { + return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i)); +} + +ivec2 getPositionsLengthAndExtentsIndex(int i) { + vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i); + vec4 value = texture(u_polygonTexture, uv); + return ivec2(int(value.x), int(value.y)); +} + +vec2 getPolygonPosition(int i) { + vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i); + return texture(u_polygonTexture, uv).xy; +} + +vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) { + float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y); + float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x); + return vec2(latitude, longitude); +} + +void main() { + int lastPolygonIndex = 0; + out_FragColor = vec4(1.0); + + // Get the relevant region of the texture + float dimension = float(u_extentsLength); + if (u_extentsLength > 2) { + dimension = ceil(log2(float(u_extentsLength))); + } + int regionIndex = getPolygonIndex(dimension, v_textureCoordinates); + + for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) { + ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex); + int positionsLength = positionsLengthAndExtents.x; + int polygonExtentsIndex = positionsLengthAndExtents.y; + lastPolygonIndex += 1; + + // Only compute signed distance for the relevant part of the atlas + if (polygonExtentsIndex == regionIndex) { + float clipAmount = czm_infinity; + vec4 extents = getExtents(polygonExtentsIndex); + vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension; + vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents); + float s = 1.0; + + // Check each edge for absolute distance + for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) { + vec2 a = getPolygonPosition(lastPolygonIndex + i); + vec2 b = getPolygonPosition(lastPolygonIndex + j); + + vec2 ab = b - a; + vec2 pa = p - a; + float t = dot(pa, ab) / dot(ab, ab); + t = clamp(t, 0.0, 1.0); + + vec2 pq = pa - t * ab; + float d = length(pq); + + // Inside / outside computation to determine sign + bvec3 cond = bvec3(p.y >= a.y, + p.y < b.y, + ab.x * pa.y > ab.y * pa.x); + if (all(cond) || all(not(cond))) s = -s; + if (abs(d) < abs(clipAmount)) { + clipAmount = d; + } + } + + // Normalize the range to [0,1] + vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; + // In the case where we've iterated through multiple polygons, take the minimum + out_FragColor = min(out_FragColor, result); + } + + lastPolygonIndex += positionsLength; + } +}`;function qr(e){e=y(e,y.EMPTY_OBJECT),this._polygons=[],this._totalPositions=0,this.enabled=y(e.enabled,!0),this.inverse=y(e.inverse,!1),this.polygonAdded=new pe,this.polygonRemoved=new pe,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(qr.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});qr.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};qr.prototype.get=function(e){return this._polygons[e]};qr.prototype.contains=function(e){return this._polygons.some(t=>fw.equals(t,e))};qr.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>fw.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var PUe=new se;function RUe(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=se.clone(a);f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI);let h=[r];for(let p=0;p<t.length;++p){let _=t[p];if(l(_)&&l(se.simpleIntersection(_,f))&&!se.equals(_,f)){let m=n[p];h.push(...m),m.reduce((x,b)=>se.union(e[b].computeSphericalExtents(PUe),x,x),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=se.clone(a,f),f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),p=-1}}t.push(f),n.push(h)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}qr.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function OUe(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=RUe(i),s=0;for(let[c,u]of i.entries()){let f=u.length;t[s++]=f,t[s++]=r.get(c);for(let h=0;h<f;++h){let p=u.positions[h],_=Math.hypot(p.x,p.y),m=P.fastApproximateAtan2(_,p.z),x=P.fastApproximateAtan2(p.x,p.y);t[s++]=m,t[s++]=x}}let a=0;for(let c of o){let u=1/(c.east-c.west),f=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=f,n[a++]=u}e._extentsCount=o.length}var H9=new U;qr.prototype.update=function(e){let t=e.context;if(!qr.isSupported(e))throw new re("ClippingPolygonCollections are only supported for WebGL 2.");let n=this._polygons.reduce((s,a)=>s+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let s=qr.getTextureResolution(i,this.pixelsNeededForPolygonPositions,H9);i=new Rt({context:t,width:s.x,height:s.y,pixelFormat:tt.RG,pixelDatatype:Ke.FLOAT,sampler:Zt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(l(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let s=qr.getTextureResolution(o,this.pixelsNeededForExtents,H9);o=new Rt({context:t,width:s.x,height:s.y,pixelFormat:tt.RGBA,pixelDatatype:Ke.FLOAT,sampler:Zt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(OUe(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(r)){let s=qr.getClippingDistanceTextureResolution(this,H9);r=new Rt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?tt.RED:tt.LUMINANCE,pixelDatatype:Ke.FLOAT,sampler:new Zt({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:hi.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=MUe(this)};qr.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function MUe(e){let t=e._polygonsTexture,n=e._extentsTexture;return new cl({fragmentShaderSource:zN,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var Toe=new se,LUe=new se;qr.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Wt.OUTSIDE;this.inverse&&(o=Wt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let f=e.boundingVolume.computeCorners();c=se.fromCartesianArray(f,t,Toe)}l(c)||(c=se.fromBoundingSphere(e.boundingSphere,t,Toe));let u=se.simpleIntersection(c,a,LUe);l(u)&&(o=Wt.INTERSECTING)}return o};qr.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};qr.isSupported=function(e){return e?.context.webgl2};qr.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Ft.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};qr.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Ft.maximumTextureSize,4096),t.y=Math.min(Ft.maximumTextureSize,4096),t)};qr.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):qr.getTextureResolution(n,e.pixelsNeededForExtents,t)};qr.prototype.isDestroyed=function(){return!1};qr.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),ue(this)};var Kh=qr;var dw={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};dw.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?dw.SUNLIGHT:dw.SCENE_LIGHT:dw.NONE};var S_=Object.freeze(dw);function Coe(){this.lightIntensity=10,this.rayleighCoefficient=new d(55e-7,13e-6,284e-7),this.mieCoefficient=new d(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=S_.NONE}Coe.requiresColorCorrect=function(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))};var TC=Coe;var Zh=`uniform vec3 u_radiiAndDynamicAtmosphereColor; uniform float u_atmosphereLightIntensity; uniform float u_atmosphereRayleighScaleHeight; @@ -4133,7 +6392,2151 @@ vec4 computeAtmosphereColor( return vec4(color, opacity); } -`;var GM=`uniform sampler2D u_atlas; +`;var HN=`uniform samplerCube u_radianceMap; + +in vec2 v_textureCoordinates; + + +const float twoSqrtPi = 2.0 * sqrt(czm_pi); + +// Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf +float computeShBasis(int index, vec3 s) { + if (index == 0) { // l = 0, m = 0 + return 1.0 / twoSqrtPi; + } + + if (index == 1) { // l = 1, m = -1 + return -sqrt(3.0) * s.y / twoSqrtPi; + } + + if (index == 2) { // l = 1, m = 0 + return sqrt(3.0) * s.z / twoSqrtPi; + } + + if (index == 3) { // l = 1, m = 1 + return -sqrt(3.0) * s.x / twoSqrtPi; + } + + if (index == 4) { // l = 2, m = -2 + return sqrt(15.0) * s.y * s.x / twoSqrtPi; + } + + if (index == 5) { // l = 2, m = -1 + return -sqrt(15.0) * s.y * s.z / twoSqrtPi; + } + + if (index == 6) { // l = 2, m = 0 + return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; + } + + if (index == 7) { // l = 2, m = 1 + return -sqrt(15.0) * s.x * s.z / twoSqrtPi; + } + + if (index == 8) { // l = 2, m = 2 + return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; + } + + return 0.0; +} + +float vdcRadicalInverse(int i) +{ + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) + { + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); + } + return value; +} + +vec2 hammersley2D(int i, int N) +{ + return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} + +// Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics +const int samples = 256; +const float solidAngle = 1.0 / float(samples); + +void main() { + // Get the current coefficient based on the uv + vec2 uv = v_textureCoordinates.xy * 3.0; + int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); + + for (int i = 0; i < samples; ++i) { + vec2 xi = hammersley2D(i, samples); + float phi = czm_twoPi * xi.x; + float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); + + // Generate the spherical harmonics basis from the direction + float Ylm = computeShBasis(coefficientIndex, direction); + + vec3 lookupDirection = -direction.xyz; + lookupDirection.z = -lookupDirection.z; + + vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); + + // Use the relevant function for this coefficient + out_FragColor += Ylm * color * solidAngle * sinTheta; + } + +} +`;var GN=`precision highp float; + +in vec2 v_textureCoordinates; + +uniform vec3 u_faceDirection; // Current cubemap face +uniform vec3 u_positionWC; +uniform mat4 u_enuToFixedFrame; +uniform vec4 u_brightnessSaturationGammaIntensity; +uniform vec4 u_groundColor; // alpha component represent albedo + +vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { + vec2 scaledUV = uv * 2.0 - 1.0; + + if (faceDir.x != 0.0) { + return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); + } else if (faceDir.y != 0.0) { + return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); + } else { + return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); + } +} + +void main() { + float height = length(u_positionWC); + float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; + float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); + + // Scale the position to ensure the sky color is present, even when underground. + vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); + + float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; + float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; + + vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; + vec3 normalizedDirection = normalize(direction); + + czm_ray ray = czm_ray(positionWC, normalizedDirection); + czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); + if (!czm_isEmpty(intersection)) { + intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); + } + + bool onEllipsoid = intersection.start >= 0.0; + float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); + + // Compute sky color for each position on a sphere at radius centered around the provided position's origin + vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; + + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); + vec3 mieColor; + vec3 rayleighColor; + float opacity; + czm_computeScattering( + ray, + rayLength, + lightDirectionWC, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); + + vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); + +#ifdef ATMOSPHERE_COLOR_CORRECT + const bool ignoreBlackPixels = true; + atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); +#endif + + vec3 lookupDirection = -normalizedDirection; + // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. + lookupDirection.x = -lookupDirection.x; + lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); + lookupDirection.x = -lookupDirection.x; + + // Values outside the atmopshere are rendered as black, when they should be treated as transparent + float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); + skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent + + // Blend starmap with atmopshere scattering + float intensity = u_brightnessSaturationGammaIntensity.w; + vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); + vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); + vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); + + // Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height + vec3 up = normalize(positionWC); + float occlusion = max(dot(lightDirectionWC, up), 0.05); + vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); + vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); + + vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); + + float brightness = u_brightnessSaturationGammaIntensity.x; + float saturation = u_brightnessSaturationGammaIntensity.y; + float gamma = u_brightnessSaturationGammaIntensity.z; + +#ifdef ENVIRONMENT_COLOR_CORRECT + color.rgb = mix(vec3(0.0), color.rgb, brightness); + color.rgb = czm_saturation(color.rgb, saturation); +#endif + color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0. + color.rgb = czm_gammaCorrect(color.rgb); + + out_FragColor = color; +} +`;var WN=`precision highp float; + +in vec3 v_textureCoordinates; + +uniform float u_roughness; +uniform samplerCube u_radianceTexture; +uniform vec3 u_faceDirection; + +float vdcRadicalInverse(int i) +{ + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) + { + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); + } + return value; +} + +vec2 hammersley2D(int i, int N) +{ + return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} + +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ + float alphaRoughnessSquared = alphaRoughness * alphaRoughness; + float phi = czm_twoPi * xi.x; + float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); + vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangentX = normalize(cross(upVector, N)); + vec3 tangentY = cross(N, tangentX); + return tangentX * H.x + tangentY * H.y + N * H.z; +} + +// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses +const int samples = 128; + +void main() { + vec3 normal = u_faceDirection; + vec3 V = normalize(v_textureCoordinates); + float roughness = u_roughness; + + vec4 color = vec4(0.0); + float weight = 0.0; + for (int i = 0; i < samples; ++i) { + vec2 xi = hammersley2D(i, samples); + vec3 H = importanceSampleGGX(xi, roughness, V); + vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector + + float NdotL = max(dot(V, L), 0.0); + if (NdotL > 0.0) { + color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; + weight += NdotL; + } + } + out_FragColor = color / weight; +} +`;var jN=`in vec3 position; +out vec3 v_textureCoordinates; + +uniform vec3 u_faceDirection; + +vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { + vec2 scaledUV = uv; + + if (faceDir.x != 0.0) { + return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); + } else if (faceDir.y != 0.0) { + return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); + } else { + return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); + } +} + +void main() +{ + v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); + v_textureCoordinates.y = -v_textureCoordinates.y; + v_textureCoordinates.z = -v_textureCoordinates.z; + gl_Position = vec4(position, 1.0); +} +`;function Kn(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=y(e,y.EMPTY_OBJECT);let t=Math.min(y(e.mipmapLevels,7),Math.log2(Ft.maximumCubeMapSize));this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Kn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Z;let n=Math.pow(2,t-1);this._textureDimensions=new U(n,n),this._radiiAndDynamicAtmosphereColor=new d,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=y(e.enabled,!0),this.shouldUpdate=!0,this.maximumSecondsDifference=y(e.maximumSecondsDifference,60*60),this.maximumPositionEpsilon=y(e.maximumPositionEpsilon,1e3),this.atmosphereScatteringIntensity=y(e.atmosphereScatteringIntensity,2),this.gamma=y(e.gamma,1),this.brightness=y(e.brightness,1),this.saturation=y(e.saturation,1),this.groundColor=y(e.groundColor,Kn.AVERAGE_EARTH_GROUND_COLOR),this.groundAlbedo=y(e.groundAlbedo,.31)}Object.defineProperties(Kn.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){d.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=d.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});Kn._maximumComputeCommandCount=8;Kn._activeComputeCommandCount=0;Kn._nextFrameCommandQueue=[];Kn._queueCommand=(e,t)=>{if(Kn._activeComputeCommandCount>=Kn._maximumComputeCommandCount){Kn._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Kn._activeComputeCommandCount++};Kn._updateCommandQueue=e=>{if(Kn._maximumComputeCommandCount=Math.log2(Ft.maximumCubeMapSize),Kn._nextFrameCommandQueue.length>0&&Kn._activeComputeCommandCount<Kn._maximumComputeCommandCount){let t=Kn._nextFrameCommandQueue.shift();for(;l(t)&&Kn._activeComputeCommandCount<Kn._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Kn._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Kn._activeComputeCommandCount++,t=Kn._nextFrameCommandQueue.shift()}l(t)&&Kn._nextFrameCommandQueue.push(t)}};Kn.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Kn.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var NUe=new d,FUe=new d;function BUe(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,FUe),s=1.025,a=NUe,c=l(r)?d.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!d.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(d.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Aoe=new d,kUe=new F,VUe=new oe,UUe=new z;function zUe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new wr({context:n,width:i.x,height:i.y,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:tt.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new Ue({sources:[Zh,GN]}),e._radianceMapFS=o),TC.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=Ot.eastNorthUpToFixedFrame(r,a,kUe),u=VUe;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let h of wr.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Rt({context:n,width:i.x,height:i.y,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:tt.RGBA}),e._radianceMapTextures[f]=p;let _=f,m=new cl({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>wr.getDirection(h,Aoe),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,UUe)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Kn._activeComputeCommandCount--;return}let x=e._radianceMapComputeCommands;x[_]=void 0;let b=new zr({context:n,colorTextures:[e._radianceMapTextures[_]]});b._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),b._unBind(),b.destroy(),Kn._activeComputeCommandCount--,x.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Kn._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function HUe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,u=(h,p,_,m,x)=>()=>{if(e.isDestroyed()||h.canceled){Kn._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[p]=void 0,n.copyFace(t,_,m,x),c++,Kn._activeComputeCommandCount--,_.destroy(),e._specularMapTextures[p]=void 0;let T=e._specularMapTextures.length;c>=T&&(e._irradianceCommandDirty=!0,n.sampler=new Zt({minificationFilter:Kt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},f=0;for(let h=1;h<i;++h){for(let p of wr.faceNames()){l(e._specularMapTextures[f])&&e._specularMapTextures[f].destroy();let _=e._specularMapTextures[f]=new Rt({context:a,width:r,height:s,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:tt.RGBA}),m=e._va;l(m)||(m=wr.createVertexArray(a,p),e._va=m);let x=e._convolveSP;l(x)||(x=Qt.fromCache({context:a,vertexShaderSource:jN,fragmentShaderSource:WN,attributeLocations:{positions:0}}),e._convolveSP=x);let b=new cl({shaderProgram:x,vertexArray:m,outputTexture:_,persists:!0,owner:e,uniformMap:{u_roughness:()=>h/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>wr.getDirection(p,Aoe)}});b.postExecute=u(b,f,_,p,h),e._convolutionComputeCommands[f]=b,Kn._queueCommand(b,t),++f}r/=2,s/=2}}var Eoe=new U(3,3);function GUe(e,t){let n=t.context,i=Eoe,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new Rt({context:n,width:i.x,height:i.y,pixelDatatype:Ke.FLOAT,pixelFormat:tt.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new Ue({sources:[HN]}),e._irradianceMapFS=r);let s=new cl({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Kn._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Kn._activeComputeCommandCount--},e._irradianceComputeCommand=s,Kn._queueCommand(s,t),e._irradianceTextureDirty=!0}function WUe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new zr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Eoe,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=d.unpack(r,s*4),d.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Kn.prototype.update=function(e){let t=e.mode;if(!Kn.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===ne.MORPHING){this._shouldRegenerateShaders=!1;return}Kn._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=BUe(this,e)||i===S_.SUNLIGHT&&!Z.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=Z.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(zUe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(HUe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(GUe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){WUe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Kn.prototype.isDestroyed=function(){return!1};Kn.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),ue(this)};Kn.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Kn.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(z.fromCssColorString("#717145"));Kn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new d(.35449,.35449,.35449)),d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO]);var v_=Kn;var hw={HIGHLIGHT:0,REPLACE:1,MIX:2};hw.getColorBlend=function(e,t){if(e===hw.HIGHLIGHT)return 0;if(e===hw.REPLACE)return 1;if(e===hw.MIX)return P.clamp(t,P.EPSILON4,1)};var Bc=Object.freeze(hw);var jUe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},kc=Object.freeze(jUe);var qUe={STEP:0,LINEAR:1,CUBICSPLINE:2},$h=Object.freeze(qUe);var Soe={};function mw(e){this._count=e.count,this._properties=Ge(e.properties,!0)}mw.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,Soe)};mw.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,Soe,e)};mw.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ge(n[e],!0)};mw.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ge(n,!0)};var w_=mw;function ec(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(ec.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});ec.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};ec.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};ec.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};ec.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var G9=[];ec.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(G9)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,G9)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(G9)),t};ec.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};ec.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new w_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};ec.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};ec.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};ec.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};ec.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};ec.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};ec.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};ec.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var Al=ec;function pw(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=ru.createModelTextureReader({textureInfo:r,channels:KUe(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(pw.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});pw.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(yt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(yt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==ct.SCALAR?(yt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==kt.UINT8?(yt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:ct.isVectorType(t)||t===ct.SCALAR?n!==kt.UINT8?(yt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(yt(`Property texture property ${e.id} has an unsupported type`),!1)};var YUe=[void 0,"float","vec2","vec3","vec4"],XUe=[void 0,"int","ivec2","ivec3","ivec4"];pw.prototype.getGlslType=function(){let e=this._classProperty,t=ct.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?YUe[t]:XUe[t]};pw.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function KUe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var qN=pw;function W9(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new qN({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(W9.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});W9.prototype.getProperty=function(e){return this._properties[e]};var D_=W9;function voe(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=y(i,n.offset),o=y(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(voe.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var YN=voe;function j9(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new YN({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(j9.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});j9.prototype.getProperty=function(e){return this._properties[e]};var CC=j9;function gw(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(gw.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});gw.prototype.getPropertyTable=function(e){return this._propertyTables[e]};gw.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};gw.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var na=gw;function ZUe(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=new iu({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Al({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new D_({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new CC({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new na({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var XN=ZUe;function $Ue(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],u=n.classes[c.class],f=new iu({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new Al({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new D_({id:a,propertyTexture:QUe(c),class:n.classes[c.class],textures:e.textures}))}return new na({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function QUe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:JUe(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=xt(o.texture,r,!0)}return t}function JUe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var KN=$Ue;function I_(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:u=!0}=e;this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(I_.prototype=Object.create(Ki.prototype),I_.prototype.constructor=I_);Object.defineProperties(I_.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function eze(e){try{let t=rze(e),n=uze(e),i=fze(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=pt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=pt.FAILED,e.getError("Failed to load structural metadata",t)}}I_.prototype.load=function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,this._promise=eze(this),this._promise)};function tze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function nze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function ize(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];tze(o.properties,n)}return n}function oze(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&nze(r,n)}}return n}async function rze(e){let t;l(e._extension)?t=ize(e._extension):t=oze(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=vi.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function sze(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&aze(r,t)}return t}function aze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function cze(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&lze(r,t)}}return t}function lze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function uze(e){let t;l(e._extension)?t=sze(e._extension):t=cze(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=vi.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function fze(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=vi.getSchemaLoader({resource:i})}else n=vi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}I_.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],u=t[a];u.isDestroyed()||(s[c]=u.texture)}return l(this._extension)?this._structuralMetadata=XN({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=KN({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),woe(this),this._state=pt.READY,!0};function woe(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)vi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function dze(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)vi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}I_.prototype.unload=function(){woe(this),dze(this),l(this._schemaLoader)&&vi.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var ZN=I_;var AC={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};AC.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return AC.TRANSLATION;case"ROTATION":return AC.ROTATION;case"SCALE":return AC.SCALE;case"_FEATURE_ID":return AC.FEATURE_ID}};var rs=Object.freeze(AC);var hze=65534,mze=255;function $N(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Poe(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],pze(this)}Object.defineProperties($N.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function pze(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],h=!1,p=h||n.hasEdge(c,u),_=h||n.hasEdge(u,f),m=h||n.hasEdge(f,c),x=Doe(i,c,u,f,p,_,m);for(;l(x);){let b=s[x];if(!l(b)){b=r+o.length;let T=x;for(;T>=r;)T=o[T-r];o.push(T),s[x]=b}b>hze&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>mze&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=b,t[a]=b):x===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),x=Doe(i,c,u,f,p,_,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Doe(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=q9(e,t,a,c,u);if(f===0)return t;let h=0,p=o?1:0,_=r?1:0,m=q9(e,n,h,p,_);if(m===0)return n;let x=s?1:0,b=0,T=r?1:0,C=q9(e,i,x,b,T);if(C===0)return i;let A=f&m&C,S,v,D;if(A&1)S=0,v=1,D=2;else if(A&2)S=0,D=1,v=2;else if(A&4)v=0,S=1,D=2;else if(A&8)v=0,D=1,S=2;else if(A&16)D=0,S=1,v=2;else if(A&32)D=0,v=1,S=2;else{let L=Y9(f),g=Y9(m),E=Y9(C);return L<g&&L<E?t:g<E?n:i}let O=t*3;e[O+S]=a,e[O+v]=c,e[O+D]=u;let R=n*3;e[R+S]=h,e[R+v]=p,e[R+D]=_;let M=i*3;e[M+S]=x,e[M+v]=b,e[M+D]=T}function q9(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function Y9(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}$N.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};$N.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Ft.maximumTextureSize),i=n,o=Ioe(i),r=[];for(;i>1;)i>>=1,r.push(Ioe(i));let s=new Rt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:tt.LUMINANCE,sampler:new Zt({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR_MIPMAP_LINEAR,magnificationFilter:hi.LINEAR})});return t.outlineTexture=s,s};function Ioe(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Poe(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}Poe.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var EC=$N;function Roe(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function gze(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function QN(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}QN.prototype.postProcess=function(e){this.needsOutlines&&(_ze(this),xze(this,e))};function _ze(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new EC({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ne.fromTypedArray(n.typedArray);let r=yze(o.outlineCoordinates),s=new Roe(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function yze(e){let t=new bn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=X.FLOAT,t.type=tn.VEC3,t.normalized=!1,t.count=e.length/3,t}function xze(e,t){bze(e.attributePlans,t),l(e.indicesPlan)&&Tze(e.indicesPlan,t)}function bze(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=_t.createVertexBuffer({typedArray:s,context:t,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function Tze(e,t){let n=e.indices;if(e.loadBuffer){let i=_t.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Fe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}QN.AttributeLoadPlan=Roe;QN.IndicesLoadPlan=gze;var SC=QN;function Cze(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var JN=Cze;function Ooe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Ooe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var eF=Ooe;function Moe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(Moe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var tF=Moe;function Loe(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Loe.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var nF=Loe;var Aze={Direct:"Direct",Indirect:"Indirect"},hx=Object.freeze(Aze);function Noe(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(Noe.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var _w=Noe;function Foe(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Foe.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var iF=Foe;function vC(){}function Boe(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function Eze(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d);return new eF({position:t,adjustmentParams:n})}function Sze(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d),i=Boe(e.covarianceMatrix);return new tF({position:t,adjustmentParams:n,covarianceMatrix:i})}function vze(e){let t=e.groupFlags,n=d.fromArray(e.rotationThetas,0,new d),i=[];for(let r of e.params){let s=new iF({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new nF({groupFlags:t,rotationThetas:n,params:i})}vC.load=function(e){let t=e.storageType;if(t===hx.Direct)return vC.loadDirect(e);if(t===hx.Indirect)return vC.loadIndirect(e);throw new re(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};vC.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=Eze(r);t.push(s)}let i=Boe(e.covarianceDirectUpperTriangle);return new _w({storageType:hx.Direct,anchorPointsDirect:t,covarianceDirect:i})};vC.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=Sze(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=vze(s);o.push(a)}return new _w({storageType:hx.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var oF=vC;function koe(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(koe.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var rF=koe;function Voe(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(Voe.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var sF=Voe;function Uoe(e){this._ppeTextures=e}Object.defineProperties(Uoe.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var aF=Uoe;function pr(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=y(e.asynchronous,!0);this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=pt.UNLOADED,this._promise=void 0}l(Object.create)&&(pr.prototype=Object.create(Ki.prototype),pr.prototype.constructor=pr);Object.defineProperties(pr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});pr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=pt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=pt.FAILED,this.getError("Failed to load GPM data",e)}};pr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=pt.LOADING,this._promise=this._loadResources(this),this._promise)};function wze(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}pr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=wze(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=vi.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};pr.ppeTexturesMetadataSchemaCache=new Map;pr._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,o=e.offset??0,r=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:o,scale:r,min:n.min,max:n.max}}}};pr._obtainPpeTexturesMetadataSchema=function(e){let n=pr._collectPpeTexturePropertyIdentifiers(e).toString(),i=pr.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${pr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=pr._createPpeTextureClassJson(c,a);r.classes[u]=f}return i=hf.fromJson(r),pr.ppeTexturesMetadataSchemaCache.set(n,i),i};pr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=pr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};pr._convertToStructuralMetadata=function(e,t){let n=[],i=pr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,f=a.traits.source,h=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new D_({id:s,name:a.name,propertyTexture:p,class:h,textures:t}))}return new na({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};pr.prototype.process=function(e){if(this._state===pt.READY)return!0;if(this._state!==pt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let h=t[u].process(e);i=i&&h}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],h=t[u];h.isDestroyed()||(o[f]=h.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let h=f.traits,p=new sF({min:h.min,max:h.max,source:h.source}),_=new rF({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(_)}}let a=new aF(r);this._meshPrimitiveGpmLocal=a;let c=pr._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=pt.READY,!0};pr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)vi.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};pr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var cF=pr;var{Attribute:Dze,Indices:Ize,FeatureIdAttribute:zoe,FeatureIdTexture:Hoe,FeatureIdImplicitRange:Goe,MorphTarget:Pze,Primitive:Rze,Instances:Oze,Skin:Mze,Node:Lze,AnimatedPropertyType:Nze,AnimationSampler:Fze,AnimationTarget:Bze,AnimationChannel:kze,Animation:Vze,ArticulationStage:Uze,Articulation:zze,Asset:Hze,Scene:Gze,Components:Wze,MetallicRoughness:jze,SpecularGlossiness:qze,Specular:Yze,Anisotropy:X9,Clearcoat:K9,Material:Xze}=bn,wo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Ad(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=Fo.Y,forwardAxis:a=Fo.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:u=!1,enablePick:f=!1,loadIndicesForWireframe:h=!1,loadPrimitiveOutline:p=!0,loadForClassification:_=!1,renameBatchIdSemantic:m=!1}=e,{baseResource:x=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=x,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=c,this._loadAttributesFor2D=u,this._enablePick=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._loadForClassification=_,this._renameBatchIdSemantic=m,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=wo.NOT_LOADED,this._textureState=wo.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(Ad.prototype=Object.create(Ki.prototype),Ad.prototype.constructor=Ad);Object.defineProperties(Ad.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function Kze(e){e._state=wo.LOADING,e._textureState=wo.LOADING;try{let t=vi.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=wo.LOADED,e._textureState=wo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=wo.FAILED,e._textureState=wo.FAILED,lF(e,t)}}async function Zze(e,t){zt.supportsWebP.initialized||await zt.supportsWebP.initialize(),e._supportedImageFormats=new JN({webp:zt.supportsWebP(),basis:t.context.supportsBasis});let n=J4e(e,t);return e._state=wo.PROCESSING,e._textureState=wo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(vi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}Ad.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=Kze(this),this._promise)};function lF(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function $ze(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(l(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(l(r)){let s=r.process(t);s&&(l(e._components.structuralMetadata)&&yt("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&s}n&&(e._state=wo.POST_PROCESSING)}function Qze(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&Jze(e,o)}}function Jze(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let c=r[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}Ad.prototype._process=function(e){return this._state===wo.READY?!0:(this._state===wo.PROCESSING&&$ze(this,e),this._resourcesLoaded&&this._state===wo.POST_PROCESSING&&(Qze(this,e.context),this._state=wo.PROCESSED),this._resourcesLoaded&&this._state===wo.PROCESSED?(Qoe(this),this._typedArray=void 0,this._state=wo.READY,!0):!1)};Ad.prototype._processTextures=function(e){if(this._textureState===wo.READY)return!0;if(this._textureState!==wo.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&l(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=wo.READY,this._texturesLoaded=!0,!0):!1};Ad.prototype.process=function(e){if(this._state===wo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=Zze(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=wo.FAILED;let o=this._processError;this._processError=void 0,lF(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===wo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=wo.FAILED,lF(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=wo.FAILED,lF(this,o)}return this._incrementallyLoadTextures?n:n&&i};function e4e(e,t,n,i,o,r,s){let a=e.gltfJson,u=a.accessors[t].bufferView;return vi.getVertexBufferLoader({gltf:a,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,bufferViewId:u,draco:i,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function t4e(e,t,n,i,o,r){return vi.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:r,draco:n,asynchronous:e._asynchronous,loadBuffer:i,loadTypedArray:o})}function n4e(e,t){let n=vi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Woe(e,t,n){let i=t.byteOffset,o=ou(e,t),r=t.count,s=df(t.type),a=t.componentType,c=X.getSizeInBytes(a),u=c*s,f=r*s;if(o===u)return n=new Uint8Array(n),X.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let h=X.createTypedArray(a,f),p=new DataView(n.buffer),_=new Array(s),m=g_(t.componentType);i=n.byteOffset+i;for(let x=0;x<r;++x){m(p,i,s,c,_);for(let b=0;b<s;++b)h[x*s+b]=_[b];i+=o}return h}function i4e(e,t){let n=e.type;if(n===tn.SCALAR)return t.fill(0);let i=tn.getMathType(n);return t.fill(i.clone(i.ZERO))}function o4e(e,t,n,i){let o=e.type,r=e.count;if(o===tn.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===tn.VEC4&&i)for(let s=0;s<r;s++)n[s]=Oe.unpack(t,s*4);else{let s=tn.getMathType(o),a=tn.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function r4e(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=Woe(r,n,t.typedArray);i=y(i,!1),o4e(n,s,o,i)}function uF(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=n4e(e,o),s=r4e(e,r,t,n,i);return e._loaderPromises.push(s),i}return i4e(t,i)}function cu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function s4e(e){return e===Number?0:new e}function a4e(e){switch(e){case X.BYTE:return 127;case X.UNSIGNED_BYTE:return 255;case X.SHORT:return 32767;case X.UNSIGNED_SHORT:return 65535;default:return 1}}var c4e={VEC2:new U(-1,-1),VEC3:new d(-1,-1,-1),VEC4:new oe(-1,-1,-1,-1)};function l4e(e,t){let n=a4e(e.componentDatatype),i=c4e[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function u4e(e,t,n){let i=e.decodeMatrix,o=cu(n,e.decodedMin),r=cu(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new bn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new U(i[6],i[7]),s.quantizedVolumeStepSize=new U(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new d(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new d(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new oe(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new oe(i[0],i[6],i[12],i[18])),t.quantization=s}function f4e(e,t,n,i,o){let r=e.accessors[t],s=tn.getMathType(r.type),a=y(r.normalized,!1),c=new Dze;c.name=n,c.semantic=i,c.setIndex=o,c.constant=s4e(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=cu(s,r.min),c.max=cu(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=ou(e,r),ri(r,"WEB3D_quantized_attributes")&&u4e(r.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===At.POSITION||c.semantic===At.NORMAL||c.semantic===At.TANGENT||c.semantic===At.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&l4e(c,s),c}function joe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var d4e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function Z9(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=d4e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function h4e(e){let t=e===At.POSITION,n=e===At.FEATURE_ID,i=e===At.TEXCOORD;return t||n||i}function m4e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=X.createArrayBufferView(o,t.typedArray.buffer)}}function p4e(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Woe(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function qoe(e,t,n,i,o,r,s){let a=e.gltfJson,c=a.accessors[t],u=c.bufferView,f=n.gltfSemantic,h=n.renamedSemantic,p=n.modelSemantic,_=l(p)?joe(h):void 0,x=f4e(a,t,f,p,_);if(!l(i)&&!l(u))return x;let b=e4e(e,t,f,i,o,r,s),T=e._geometryLoaders.length;e._geometryLoaders.push(b);let C=b.load();return e._loaderPromises.push(C),e._geometryCallbacks[T]=()=>{l(i)&&l(i.attributes)&&l(i.attributes[f])?m4e(x,b,o,r):p4e(a,c,x,b,o,r)},x}function Yoe(e,t,n,i,o,r,s){let a=n.modelSemantic,c=a===At.POSITION,u=a===At.FEATURE_ID,f=c&&!o&&e._loadAttributesFor2D&&!s.scene3DOnly,h=c&&e._enablePick&&!s.context.webgl2,p=e._loadForClassification&&u,_=e._loadAttributesAsTypedArray,m=!_,x=_||f||h||p,C=qoe(e,t,n,i,r?!1:m,r?!0:x,s),A=new SC.AttributeLoadPlan(C);return A.loadBuffer=m,A.loadTypedArray=x,A}function g4e(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=Z9(e,rs,i),u=c.modelSemantic,f=u===rs.TRANSLATION||u===rs.ROTATION||u===rs.SCALE,h=u===rs.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,_=e._enablePick&&!o.context.webgl2,m=!p,x=e._loadAttributesFor2D&&!o.scene3DOnly;return qoe(e,t,c,void 0,m,p||h&&(!a||x||_),o)}function _4e(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView;if(!l(n)&&!l(a))return;let c=new Ize;c.count=s.count;let u=e._loadAttributesAsTypedArray,f=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,h=e._loadForClassification&&i,_=!u,m=u||f||h,T=t4e(e,t,n,o?!1:_,o?!0:m,r),C=e._geometryLoaders.length;e._geometryLoaders.push(T);let A=T.load();e._loaderPromises.push(A),e._geometryCallbacks[C]=()=>{c.indexDatatype=T.indexDatatype,c.buffer=T.buffer,c.typedArray=T.typedArray};let S=new SC.IndicesLoadPlan(c);return S.loadBuffer=_,S.loadTypedArray=m,S}function Vc(e,t,n,i){let o=e.gltfJson,r=ru.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=vi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=ru.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=wo.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function y4e(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new qze;return l(i)&&(c.diffuseTexture=Vc(e,i,n)),l(o)&&(c.specularGlossinessTexture=Vc(e,o,n)),c.diffuseFactor=cu(oe,r),c.specularFactor=cu(d,s),c.glossinessFactor=a,c}function x4e(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new jze;return l(i)&&(c.baseColorTexture=Vc(e,i,n)),l(o)&&(c.metallicRoughnessTexture=Vc(e,o,n)),c.baseColorFactor=cu(oe,r),c.metallicFactor=s,c.roughnessFactor=a,c}function b4e(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new Yze;return l(o)&&(a.specularTexture=Vc(e,o,n)),l(s)&&(a.specularColorTexture=Vc(e,s,n)),a.specularFactor=i,a.specularColorFactor=cu(d,r),a}function T4e(e,t,n){let{anisotropyStrength:i=X9.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=X9.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new X9;return l(r)&&(s.anisotropyTexture=Vc(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function C4e(e,t,n){let{clearcoatFactor:i=K9.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=K9.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new K9;return l(o)&&(c.clearcoatTexture=Vc(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=Vc(e,s,n)),l(a)&&(c.clearcoatNormalTexture=Vc(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function A4e(e,t,n){let i=new Xze,o=y(t.extensions,y.EMPTY_OBJECT),r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=y4e(e,r,n):(l(u)&&(i.metallicRoughness=x4e(e,u,n)),l(s)&&!i.unlit&&(i.specular=b4e(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=T4e(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=C4e(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Vc(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Vc(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Vc(e,t.occlusionTexture,n)),i.emissiveFactor=cu(d,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Xoe(e,t){let n=new zoe;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function Koe(e,t,n,i){let o=new zoe,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=joe(r.attribute),o.positionalLabel=i,o}function Zoe(e,t){let n=new Goe;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function $oe(e,t,n,i){let o=new Goe,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function E4e(e,t,n,i){let o=new Hoe;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=Vc(e,r,n,Zt.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function S4e(e,t,n,i,o,r){let s=new Hoe,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=Vc(e,c,i,Zt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function v4e(e,t,n,i,o){let r=new Pze,s=void 0,a=!1;for(let c in t){if(!t.hasOwnProperty(c))continue;let u=t[c],f=Z9(e,At,c),h=Yoe(e,u,f,s,a,n,o);r.attributes.push(h.attribute),i.attributePlans.push(h)}return r}function w4e(e,t,n,i){let o=new Rze,r=new SC(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=A4e(e,e.gltfJson.materials[s],i));let a=y(t.extensions,y.EMPTY_OBJECT),c=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(u)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=D4e(e,u,r));let f=e._loadForClassification,h=a.KHR_draco_mesh_compression,p=!1,_=t.attributes;if(l(_))for(let v in _){if(!_.hasOwnProperty(v))continue;let D=_[v],O=Z9(e,At,v),R=O.modelSemantic;if(f&&!h4e(R))continue;R===At.FEATURE_ID&&(p=!0);let M=Yoe(e,D,O,h,n,c,i);r.attributePlans.push(M),o.attributes.push(M.attribute)}let m=t.targets;if(l(m)&&!f)for(let v=0;v<m.length;++v)o.morphTargets.push(v4e(e,m[v],c,r,i));let x=t.indices;if(l(x)){let v=_4e(e,x,h,p,c,i);l(v)&&(r.indicesPlan=v,o.indices=v.indices)}let b=a.EXT_structural_metadata,T=a.EXT_mesh_features,C=a.EXT_feature_metadata,A=l(C);l(T)?I4e(e,o,T,i):A&&P4e(e,o,C,i),l(b)?R4e(o,b):A&&O4e(e,o,C);let S=t.mode;if(f&&S!==Me.TRIANGLES)throw new re("Only triangle meshes can be used for classification.");return o.primitiveType=S,o}function D4e(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return uF(e,i,!1)}function I4e(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,c;l(s.texture)?c=E4e(e,s,i,a):l(s.attribute)?c=Xoe(s,a):c=Zoe(s,a),t.featureIds.push(c)}}function P4e(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,_=`featureId_${r}`;r++;let m;l(u.featureIds.attribute)?m=Koe(u,h,p,_):m=$oe(u,h,p,_),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,_=`featureId_${r}`;r++;let m=S4e(e,u,h,i,p,_);t.featureIds.push(m)}}function R4e(e,t){l(t)&&(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function O4e(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function M4e(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new Oze,r=i.attributes;if(l(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(g4e(e,f,r,u,n))}let s=y(i.extensions,y.EMPTY_OBJECT),a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?L4e(o,a):l(c)&&N4e(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function L4e(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=Xoe(o,r):s=Zoe(o,r),e.featureIds.push(s)}}function N4e(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,u=i.indexOf(c),f=o[c].count,h=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=Koe(a,u,f,h):p=$oe(a,u,f,h),t.featureIds.push(p)}}function F4e(e,t,n){let i=new Lze;i.name=t.name,i.matrix=cu(F,t.matrix),i.translation=cu(d,t.translation),i.rotation=cu(Oe,t.rotation),i.scale=cu(d,t.scale);let o=y(t.extensions,y.EMPTY_OBJECT),r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new re("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=M4e(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],u=c.primitives;for(let p=0;p<u.length;++p)i.primitives.push(w4e(e,u[p],l(i.instances),n));let f=y(t.weights,c.weights),h=i.primitives[0].morphTargets;i.morphWeights=l(f)?f.slice():new Array(h.length).fill(0)}return i}function B4e(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=F4e(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function k4e(e,t,n){let i=new Mze,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=uF(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(F.IDENTITY);return i}function V4e(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=k4e(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;l(s)&&(t[r].skin=i[s])}return i}async function U4e(e,t,n,i){let o=new ZN({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=o,o.load()}async function z4e(e,t,n,i){let o=new cF({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=o,o.load()}function H4e(e,t){let n=new Fze,i=e.gltfJson.accessors,o=i[t.input];n.input=uF(e,o);let r=t.interpolation;n.interpolation=y($h[r],$h.LINEAR);let s=i[t.output];return n.output=uF(e,s,!0),n}function G4e(e,t){let n=new Bze,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=Nze[o],n}function W4e(e,t,n){let i=new kze,o=e.sampler;return i.sampler=t[o],i.target=G4e(e.target,n),i}function j4e(e,t,n){let i=new Vze;i.name=t.name;let o=t.samplers.map(function(s,a){let c=H4e(e,s);return c.index=a,c}),r=t.channels.map(function(s){return W4e(s,o,n)});return i.samplers=o,i.channels=r,i}function q4e(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=j4e(e,o,t);return s.index=r,s})}function Y4e(e){let t=new Uze;t.name=e.name;let n=e.type.toUpperCase();return t.type=kc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function X4e(e){let t=new zze;return t.name=e.name,t.stages=e.stages.map(Y4e),t}function K4e(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(X4e):[]}function Z4e(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function $4e(e,t){let n=new Gze,i=Z4e(e);return n.nodes=i.map(function(o){return t[o]}),n}var Q4e=new d;function J4e(e,t){let n=e.gltfJson,i=y(n.extensions,y.EMPTY_OBJECT),o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let C=r.featureTables,A=r.featureTextures,S=l(C)?C:[],v=l(A)?A:[];e._sortedPropertyTableIds=Object.keys(S).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=B4e(e,t),c=V4e(e,a),u=q4e(e,a),f=K4e(n),h=$4e(n,a),p=new Wze,_=new Hze,m=n.asset.copyright;if(l(m)){let C=m.split(";").map(function(A){return new Ct(A.trim())});_.credits=C}if(p.asset=_,p.scene=h,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let C=d.fromArray(s.center,0,Q4e);p.transform=F.fromTranslation(C,p.transform)}if(e._components=p,l(o)||l(r)){let C=U4e(e,o,r,t);e._loaderPromises.push(C)}let x=i.NGA_gpm_local;if(l(x)){let C=oF.load(x);e._components.extensions.NGA_gpm_local=C}let b=n.meshes;if(l(b))for(let C of b){let A=C.primitives;if(l(A))for(let S of A){let v=S.extensions;if(l(v)){let D=v.NGA_gpm_local;if(l(D)){let O=z4e(e,n,D,t);e._loaderPromises.push(O)}}}}let T=[];return T.push.apply(T,e._loaderPromises),e._incrementallyLoadTextures||T.push.apply(T,e._texturesPromises),Promise.all(T)}function eHe(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&vi.unload(t[n]);e._textureLoaders.length=0}function Qoe(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&vi.unload(t[n]);e._bufferViewLoaders.length=0}function tHe(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&vi.unload(t[n]);e._geometryLoaders.length=0}function nHe(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function iHe(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function oHe(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}Ad.prototype.isUnloaded=function(){return this._state===wo.UNLOADED};Ad.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&vi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,eHe(this),Qoe(this),tHe(this),nHe(this),iHe(this),oHe(this),this._components=void 0,this._typedArray=void 0,this._state=wo.UNLOADED};var P_=Ad;var fF=`uniform sampler2D u_pointCloud_colorGBuffer; +uniform sampler2D u_pointCloud_depthGBuffer; +uniform vec2 u_distanceAndEdlStrength; +in vec2 v_textureCoordinates; + +vec2 neighborContribution(float log2Depth, vec2 offset) +{ + float dist = u_distanceAndEdlStrength.x; + vec2 texCoordOrig = v_textureCoordinates + offset * dist; + vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); + vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); + + float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); + float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); + + // ignore depth values that are the clear depth + if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { + return vec2(0.0); + } + + // interpolate the two adjacent depth values + float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); + vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); + return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); +} + +void main() +{ + float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); + + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); + eyeCoordinate /= eyeCoordinate.w; + + float log2Depth = log2(-eyeCoordinate.z); + + if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer + { + discard; + } + + vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); + + // sample from neighbors left, right, down, up + vec2 texelSize = 1.0 / czm_viewport.zw; + + vec2 responseAndCount = vec2(0.0); + + responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); + responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); + responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); + responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); + + float response = responseAndCount.x / responseAndCount.y; + float strength = u_distanceAndEdlStrength.y; + float shade = exp(-response * 300.0 * strength); + color.rgb *= shade; + out_FragColor = vec4(color); + + // Input and output depth are the same. + gl_FragDepth = depthOrLogDepth; +} +`;function wC(){this._framebuffer=new mi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(wC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function rHe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var $9=new U;function sHe(e,t){let n=new Ue({defines:["LOG_DEPTH_WRITE"],sources:[fF]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return $9.x=e._radius,$9.y=e._strength,$9}},o=Ve.fromCache({blending:ln.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Vt.setCesium3DTileBit(),stencilMask:Vt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:we.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ti({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:we.CESIUM_3D_TILE,owner:e})}function aHe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),sHe(e,t)}function Joe(e){return e.drawBuffers&&e.fragmentDepth}wC.isSupported=Joe;function cHe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=Ue.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() +{ + czm_point_cloud_post_process_main(); +#ifdef LOG_DEPTH + czm_writeLogDepth(); + out_FragData_1 = czm_packDepth(gl_FragDepth); +#else + out_FragData_1 = czm_packDepth(gl_FragCoord.z); +#endif +}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}wC.prototype.update=function(e,t,n,i){if(!Joe(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,aHe(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Me.POINTS||u.pass===we.TRANSLUCENT)continue;let f,h,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,h=p.originalShaderProgram),(!l(f)||u.dirty||h!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=$e.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=cHe(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};wC.prototype.isDestroyed=function(){return!1};wC.prototype.destroy=function(){return rHe(this),ue(this)};var R_=wC;function ere(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}ere.isSupported=function(e){return R_.isSupported(e.context)};var wp=ere;var Ea={},lHe=new oe(0,0,0,1),tc=new oe,uHe=new qe,Q9=new U,J9=new U;Ea.worldToWindowCoordinates=function(e,t,n){return Ea.worldWithEyeOffsetToWindowCoordinates(e,t,d.ZERO,n)};var tre=new oe,nre=new d;function yw(e,t,n,i){let o=n.viewMatrix,r=F.multiplyByVector(o,oe.fromElements(e.x,e.y,e.z,1,tre),tre),s=d.multiplyComponents(t,d.normalize(r,nre),nre);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,r,i)}var fHe=new fe(Math.PI,P.PI_OVER_TWO),dHe=new d,hHe=new d;Ea.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Ea.computeActualEllipsoidPosition(o,t,lHe);if(!l(r))return;let s=e.canvas,a=uHe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(o.mode===ne.SCENE2D){let f=e.mapProjection,h=fHe,p=f.project(h,dHe),_=d.clone(c.position,hHe),m=c.frustum.clone(),x=F.computeViewportTransformation(a,0,1,new F),b=c.frustum.projectionMatrix,T=c.positionWC.y,C=d.fromElements(P.sign(T)*p.x-T,0,-c.positionWC.x),A=Ot.pointToGLWindowCoordinates(b,x,C);if(T===0||A.x<=0||A.x>=s.clientWidth)u=!0;else{if(A.x>s.clientWidth*.5){a.width=A.x,c.frustum.right=p.x-T,tc=yw(r,n,c,tc),Ea.clipToGLWindowCoordinates(a,tc,Q9),a.x+=A.x,c.position.x=-c.position.x;let S=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-S,tc=yw(r,n,c,tc),Ea.clipToGLWindowCoordinates(a,tc,J9)}else{a.x+=A.x,a.width-=A.x,c.frustum.left=-p.x-T,tc=yw(r,n,c,tc),Ea.clipToGLWindowCoordinates(a,tc,Q9),a.x=a.x-a.width,c.position.x=-c.position.x;let S=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-S,tc=yw(r,n,c,tc),Ea.clipToGLWindowCoordinates(a,tc,J9)}d.clone(_,c.position),c.frustum=m.clone(),i=U.clone(Q9,i),(i.x<0||i.x>s.clientWidth)&&(i.x=J9.x)}}if(o.mode!==ne.SCENE2D||u){if(tc=yw(r,n,c,tc),tc.z<0&&!(c.frustum instanceof nn)&&!(c.frustum instanceof Hr))return;i=Ea.clipToGLWindowCoordinates(a,tc,i)}return i.y=s.clientHeight-i.y,i};Ea.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Ea.worldToWindowCoordinates(e,t,n),!!l(n))return Ea.transformWindowToDrawingBuffer(e,n,n)};var Dp=new d,mHe=new fe;Ea.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return d.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,mHe);if(!l(r))return;if(o.project(r,Dp),i===ne.COLUMBUS_VIEW)return d.fromElements(Dp.z,Dp.x,Dp.y,n);if(i===ne.SCENE2D)return d.fromElements(0,Dp.x,Dp.y,n);let s=e.morphTime;return d.fromElements(P.lerp(Dp.z,t.x,s),P.lerp(Dp.x,t.y,s),P.lerp(Dp.y,t.z,s),n)};var ire=new d,ore=new d,rre=new F;Ea.clipToGLWindowCoordinates=function(e,t,n){return d.divideByScalar(t,t.w,ire),F.computeViewportTransformation(e,0,1,rre),F.multiplyByPoint(rre,ire,ore),U.fromCartesian3(ore,n)};Ea.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*o,t.y*r,n)};var pHe=new oe,sre=new oe;Ea.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let _=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,_)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=oe.clone(oe.UNIT_W,pHe);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let h,p=e.camera.frustum;if(l(p.fovy)){h=F.multiplyByVector(r.inverseViewProjection,f,sre);let _=1/h.w;d.multiplyByScalar(h,_,h)}else{let _=p.offCenterFrustum;l(_)&&(p=_),h=sre,h.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(f.z*(a-c)-a-c)*.5,h.w=1,h=F.multiplyByVector(r.inverseView,h,h)}return d.fromCartesian4(h,i)};var zi=Ea;var DC={};DC._deprecationWarning=_s;var Ip=Uint32Array.BYTES_PER_ELEMENT;DC.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Ip;let r=o.getUint32(t,!0);if(r!==1)throw new re(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=Ip;let s=o.getUint32(t,!0);t+=Ip;let a=o.getUint32(t,!0);t+=Ip;let c=o.getUint32(t,!0);t+=Ip;let u=o.getUint32(t,!0);t+=Ip;let f=o.getUint32(t,!0);t+=Ip;let h;u>=570425344?(t-=Ip*2,h=a,u=c,f=0,a=0,c=0,DC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=Ip,h=u,u=a,f=c,a=0,c=0,DC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(h,0)}:(p=Bo(i,t,a),t+=a);let _=new Uint8Array(e,t,c);t+=c;let m,x;u>0&&(m=Bo(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new re("glTF byte length must be greater than 0.");let T;return t%4===0?T=new Uint8Array(e,t,b):(DC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),T=new Uint8Array(i.subarray(t,t+b))),{batchLength:h,featureTableJson:p,featureTableBinary:_,batchTableJson:m,batchTableBinary:x,gltf:T}};var dF=DC;function xw(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function are(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=X.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function gHe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=X.createTypedArray(n,i),o[t]=r),r}xw.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,X.UNSIGNED_INT),n=y(n,1),are(this,e,t,n,1,i.byteOffset)):i};xw.prototype.hasProperty=function(e){return l(this.json[e])};xw.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=X.fromName(i.componentType)),are(this,e,t,n,this.featuresLength,i.byteOffset)):gHe(this,e,t,i)};xw.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var Qh=xw;function bw(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=y(e.parseAsPropertyAttributes,!1),r=e.customAttributeOutput,s=_He(n),a;l(s.jsonProperties)&&(a=new w_({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new iC({extension:s.hierarchy,binaryBody:i}));let u=Yh.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,h,p,_;if(o){let b=xHe(t,u,f,i,r);_=b.transcodedSchema,p=[new CC({propertyAttribute:b.propertyAttributeJson,class:b.transcodedClass})]}else{let b=yHe(t,u,f,i);_=b.transcodedSchema;let T=b.featureTableJson;h=new iu({count:T.count,properties:T.properties,class:b.transcodedClass,bufferViews:b.bufferViewsTypedArrays}),p=[]}let m=[];if(l(h)||l(a)||l(c)){let b=new Al({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:a,batchTableHierarchy:c});m.push(b)}let x={schema:_,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new na(x)}function _He(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(bw._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function yHe(e,t,n,i){let o={},r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;if(!l(i))throw new re(`Property ${h} requires a batch table binary.`);let p=n[h],_=uf(p);r[h]={bufferView:a},o[h]=cre(p),s[a]=_.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let u=hf.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function xHe(e,t,n,i,o){let r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;let p=n[h];if(!l(i)&&!l(p.typedArray))throw new re(`Property ${h} requires a batch table binary.`);let _=Xt.sanitizeGlslIdentifier(h);(_===""||r.hasOwnProperty(_))&&(_=`property_${a}`,a++);let m=cre(p);m.name=h,r[_]=m;let x=_.toUpperCase();x.startsWith("_")||(x=`_${x}`);let b=p.typedArray;l(b)||(b=uf(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let T=new bn.Attribute;T.name=x,T.count=e,T.type=p.type;let C=X.fromTypedArray(b);(C===X.INT||C===X.UNSIGNED_INT||C===X.DOUBLE)&&(bw._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${x}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),b=new Float32Array(b)),T.componentDatatype=X.fromTypedArray(b),T.typedArray=b,o.push(T),s[_]={attribute:x}}let c={classes:{}};c.classes[t]={properties:r};let u=hf.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function cre(e){let t=bHe(e.componentType);return{type:e.type,componentType:t}}function bHe(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}bw._deprecationWarning=_s;bw._oneTimeWarning=yt;var O_=bw;var mx={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},THe=bn.FeatureIdAttribute;function M_(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Fo.Y),u=y(e.forwardAxis,Fo.X),f=y(e.loadAttributesAsTypedArray,!1),h=y(e.loadAttributesFor2D,!1),p=y(e.enablePick,!1),_=y(e.loadIndicesForWireframe,!1),m=y(e.loadPrimitiveOutline,!0),x=y(e.loadForClassification,!1);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=h,this._enablePick=p,this._loadIndicesForWireframe=_,this._loadPrimitiveOutline=m,this._loadForClassification=x,this._state=mx.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(M_.prototype=Object.create(Ki.prototype),M_.prototype.constructor=M_);Object.defineProperties(M_.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});M_.prototype.load=function(){if(l(this._promise))return this._promise;let e=dF.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new Qh(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(a)&&(this._transform=F.fromTranslation(d.fromArray(a))),this._batchTable={json:o,binary:r};let c=new P_({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=mx.LOADING;let u=this;return this._promise=c.load().then(function(){if(!u.isDestroyed())return u._state=mx.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return CHe(u,f)}),this._promise};function CHe(e,t){return e.unload(),e._state=mx.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}M_.prototype.process=function(e){if(this._state===mx.READY)return!0;if(this._state!==mx.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),AHe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=mx.READY,!0};function AHe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=O_({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Al({name:Yh.BATCH_TABLE_CLASS_NAME,count:i});o=new na({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)lre(r[a]);t.structuralMetadata=o}function lre(e){let t=e.children.length;for(let i=0;i<t;i++)lre(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Xt.getAttributeBySemantic(o,At.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new THe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}M_.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var hF=M_;function L_(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(L_.prototype=Object.create(Ki.prototype),L_.prototype.constructor=L_);Object.defineProperties(L_.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});L_.prototype.load=function(){return Promise.resolve(this)};L_.prototype.process=function(e){return l(this._components)||(this._components=FHe(this._geoJson,e),this._geoJson=void 0),!0};function EHe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function SHe(){this.features=[]}function eW(e){let t=e[0],n=e[1],i=y(e[2],0);return new d(t,n,i)}function tW(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=eW(e[o]);return[n]}function vHe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=tW(e[i])[0];return n}function ure(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=tW(e[i])[0];return n}function wHe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,ure(e[i]));return n}function DHe(e){return[eW(e)]}function IHe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=eW(e[i]);return n}var PHe={LineString:tW,MultiLineString:vHe,MultiPolygon:wHe,Polygon:ure,MultiPoint:IHe,Point:DHe},RHe={LineString:Me.LINES,MultiLineString:Me.LINES,MultiPolygon:Me.LINES,Polygon:Me.LINES,MultiPoint:Me.POINTS,Point:Me.POINTS};function fre(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=PHe[n],o=RHe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new EHe;o===Me.LINES?s.lines=i(r):o===Me.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function OHe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)fre(n[o],t)}var MHe={FeatureCollection:OHe,Feature:fre},mF=new d;function LHe(e,t,n){let i=0,o=0,r=e.length;for(let M=0;M<r;M++){let L=e[M];if(l(L.lines)){let g=L.lines.length;for(let E=0;E<g;E++){let w=L.lines[E];i+=w.length,o+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ne.createTypedArray(i,o),u=Ne.fromTypedArray(c),f=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,_=0;for(let M=0;M<r;M++){let L=e[M];if(!l(L.lines))continue;let g=L.lines.length;for(let E=0;E<g;E++){let w=L.lines[E],I=w.length;for(let N=0;N<I;N++){let B=w[N],H=d.fromDegrees(B.x,B.y,B.z,ee.WGS84,mF),V=F.multiplyByPoint(t,H,mF);d.minimumByComponent(f,V,f),d.maximumByComponent(h,V,h),d.pack(V,s,p*3),a[p]=M,N<I-1&&(c[_*2]=p,c[_*2+1]=p+1,_++),p++}}}let m=_t.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});m.vertexArrayDestroyable=!1;let x=_t.createVertexBuffer({typedArray:a,context:n.context,usage:Fe.STATIC_DRAW});x.vertexArrayDestroyable=!1;let b=_t.createIndexBuffer({typedArray:c,context:n.context,usage:Fe.STATIC_DRAW,indexDatatype:u});b.vertexArrayDestroyable=!1;let T=new bn.Attribute;T.semantic=At.POSITION,T.componentDatatype=X.FLOAT,T.type=tn.VEC3,T.count=i,T.min=f,T.max=h,T.buffer=m;let C=new bn.Attribute;C.semantic=At.FEATURE_ID,C.setIndex=0,C.componentDatatype=X.FLOAT,C.type=tn.SCALAR,C.count=i,C.buffer=x;let A=[T,C],S=new bn.Material;S.unlit=!0;let v=new bn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=b;let D=new bn.FeatureIdAttribute;D.featureCount=r,D.propertyTableId=0,D.setIndex=0,D.positionalLabel="featureId_0";let O=[D],R=new bn.Primitive;return R.attributes=A,R.indices=v,R.featureIds=O,R.primitiveType=Me.LINES,R.material=S,R}function NHe(e,t,n){let i=0,o=e.length;for(let A=0;A<o;A++){let S=e[A];l(S.points)&&(i+=S.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let A=0;A<o;A++){let S=e[A];if(!l(S.points))continue;let v=S.points.length;for(let D=0;D<v;D++){let O=S.points[D],R=d.fromDegrees(O.x,O.y,O.z,ee.WGS84,mF),M=F.multiplyByPoint(t,R,mF);d.minimumByComponent(a,M,a),d.maximumByComponent(c,M,c),d.pack(M,r,u*3),s[u]=A,u++}}let f=_t.createVertexBuffer({typedArray:r,context:n.context,usage:Fe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let h=_t.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});h.vertexArrayDestroyable=!1;let p=new bn.Attribute;p.semantic=At.POSITION,p.componentDatatype=X.FLOAT,p.type=tn.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let _=new bn.Attribute;_.semantic=At.FEATURE_ID,_.setIndex=0,_.componentDatatype=X.FLOAT,_.type=tn.SCALAR,_.count=i,_.buffer=h;let m=[p,_],x=new bn.Material;x.unlit=!0;let b=new bn.FeatureIdAttribute;b.featureCount=o,b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0";let T=[b],C=new bn.Primitive;return C.attributes=m,C.featureIds=T,C.primitiveType=Me.POINTS,C.material=x,C}function FHe(e,t){let n=new SHe,i=MHe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new re("GeoJSON must have at least one feature");let s={};for(let M=0;M<r;M++){let L=o[M],g=y(L.properties,y.EMPTY_OBJECT);for(let E in g)g.hasOwnProperty(E)&&(l(s[E])||(s[E]=new Array(r)))}for(let M=0;M<r;M++){let L=o[M];for(let g in s)if(s.hasOwnProperty(g)){let E=y(L.properties[g],"");s[g][M]=E}}let a=new w_({count:r,properties:s}),u=[new Al({id:0,count:r,jsonMetadataTable:a})],f=hf.fromJson({}),h=new na({schema:f,propertyTables:u}),p=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),_=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,x=!1;for(let M=0;M<r;M++){let L=o[M];if(l(L.lines)){m=!0;let g=L.lines.length;for(let E=0;E<g;E++){let w=L.lines[E],I=w.length;for(let N=0;N<I;N++)d.minimumByComponent(p,w[N],p),d.maximumByComponent(_,w[N],_)}}if(l(L.points)){x=!0;let g=L.points.length;for(let E=0;E<g;E++){let w=L.points[E];d.minimumByComponent(p,w,p),d.maximumByComponent(_,w,_)}}}let b=d.midpoint(p,_,new d),T=d.fromDegrees(b.x,b.y,b.z,ee.WGS84,new d),C=Ot.eastNorthUpToFixedFrame(T,ee.WGS84,new F),A=F.inverseTransformation(C,new F),S=[];m&&S.push(LHe(o,A,t)),x&&S.push(NHe(o,A,t));let v=new bn.Node;v.index=0,v.primitives=S;let D=[v],O=new bn.Scene;O.nodes=D;let R=new bn.Components;return R.scene=O,R.nodes=D,R.transform=C,R.structuralMetadata=h,R}L_.prototype.unload=function(){this._components=void 0};var pF=L_;var gF={};gF._deprecationWarning=_s;var N_=Uint32Array.BYTES_PER_ELEMENT;gF.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=N_;let r=o.getUint32(t,!0);if(r!==1)throw new re(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=N_;let s=o.getUint32(t,!0);t+=N_;let a=o.getUint32(t,!0);if(a===0)throw new re("featureTableJsonByteLength is zero, the feature table must be defined.");t+=N_;let c=o.getUint32(t,!0);t+=N_;let u=o.getUint32(t,!0);t+=N_;let f=o.getUint32(t,!0);t+=N_;let h=o.getUint32(t,!0);if(h!==1&&h!==0)throw new re(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${h} is not.`);t+=N_;let p=Bo(i,t,a);t+=a;let _=new Uint8Array(e,t,c);t+=c;let m,x;u>0&&(m=Bo(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new re("glTF byte length must be greater than 0.");let T;return t%4===0?T=new Uint8Array(e,t,b):(gF._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),T=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:h,featureTableJson:p,featureTableBinary:_,batchTableJson:m,batchTableBinary:x,gltf:T}};var _F=gF;var Pp={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},yF=bn.Attribute,BHe=bn.FeatureIdAttribute,hre=bn.Instances;function Rp(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Fo.Y),u=y(e.forwardAxis,Fo.X),f=y(e.loadAttributesAsTypedArray,!1),h=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),_=y(e.enablePick,!1);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=_,this._state=Pp.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(Rp.prototype=Object.create(Ki.prototype),Rp.prototype.constructor=Rp);Object.defineProperties(Rp.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Rp.prototype.load=function(){if(l(this._promise))return this._promise;let e=_F.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new Qh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new re("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(c)&&(this._transform=F.fromTranslation(d.fromArray(c))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let h=eu(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new P_(u);return this._gltfLoader=f,this._state=Pp.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=Pp.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw kHe(this,h)}),this._promise};function kHe(e,t){return e.unload(),e._state=Pp.FAILED,e.getError("Failed to load i3dm",t)}Rp.prototype.process=function(e){if(this._state===Pp.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Pp.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),zHe(this,i,e),VHe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Pp.READY,!0};function VHe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=O_({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Al({name:Yh.BATCH_TABLE_CLASS_NAME,count:i});o=new na({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var xF=new d,nW=new Array(4),UHe=new F;function zHe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",X.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=GHe(o,r),h;c&&(h=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let _=new Float32Array(r),m=d.unpackArray(f),x=new d,b=new d,T=new d,C=new d,A=new $,S=new Oe,v=new Array(4),D=new d,O=new Array(3),R=new F;if(!l(s)||d.equals(d.unpack(s),d.ZERO)){let V=ae.fromPoints(m);for(i=0;i<m.length;i++)d.subtract(m[i],V.center,xF),f[3*i+0]=xF.x,f[3*i+1]=xF.y,f[3*i+2]=xF.z;let G=F.fromTranslation(V.center,UHe);t.transform=F.multiplyTransformation(G,t.transform,t.transform)}for(i=0;i<r;i++){x=d.clone(m[i]),l(s)&&d.add(x,d.unpack(s),x),c&&(WHe(o,a,i,S,x,T,b,C,A,R),Oe.pack(S,v,0),h[4*i+0]=v[0],h[4*i+1]=v[1],h[4*i+2]=v[2],h[4*i+3]=v[3]),u&&(jHe(o,i,D),d.pack(D,O,0),p[3*i+0]=O[0],p[3*i+1]=O[1],p[3*i+2]=O[2]);let V=o.getProperty("BATCH_ID",X.UNSIGNED_SHORT,1,i);l(V)||(V=i),_[i]=V}let M=new hre;M.transformInWorldSpace=!0;let L=e._buffers,g=new yF;if(g.name="Instance Translation",g.semantic=rs.TRANSLATION,g.componentDatatype=X.FLOAT,g.type=tn.VEC3,g.count=r,g.typedArray=f,!c){let V=_t.createVertexBuffer({context:n.context,typedArray:f,usage:Fe.STATIC_DRAW});V.vertexArrayDestroyable=!1,L.push(V),g.buffer=V}if(M.attributes.push(g),c){let V=new yF;V.name="Instance Rotation",V.semantic=rs.ROTATION,V.componentDatatype=X.FLOAT,V.type=tn.VEC4,V.count=r,V.typedArray=h,M.attributes.push(V)}if(u){let V=new yF;if(V.name="Instance Scale",V.semantic=rs.SCALE,V.componentDatatype=X.FLOAT,V.type=tn.VEC3,V.count=r,c)V.typedArray=p;else{let G=_t.createVertexBuffer({context:n.context,typedArray:p,usage:Fe.STATIC_DRAW});G.vertexArrayDestroyable=!1,L.push(G),V.buffer=G}M.attributes.push(V)}let E=new yF;E.name="Instance Feature ID",E.setIndex=0,E.semantic=rs.FEATURE_ID,E.componentDatatype=X.FLOAT,E.type=tn.SCALAR,E.count=r;let w=_t.createVertexBuffer({context:n.context,typedArray:_,usage:Fe.STATIC_DRAW});w.vertexArrayDestroyable=!1,L.push(w),E.buffer=w,M.attributes.push(E);let I=new BHe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",M.featureIds.push(I);let N=t.nodes,B=N.length,H=!1;for(i=0;i<B;i++){let V=N[i];V.primitives.length>0&&(V.instances=H?HHe(M):M,H=!0)}}function HHe(e){let t=new hre;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Ge(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function GHe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",X.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(i))throw new re("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(o))throw new re("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new re("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var dre=new Array(4);function WHe(e,t,n,i,o,r,s,a,c,u){let f=e.getProperty("NORMAL_UP",X.FLOAT,3,n,nW),h=e.getProperty("NORMAL_RIGHT",X.FLOAT,3,n,dre),p=!1;if(l(f)){if(!l(h))throw new re("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");d.unpack(f,0,r),d.unpack(h,0,s),p=!0}else{let _=e.getProperty("NORMAL_UP_OCT32P",X.UNSIGNED_SHORT,2,n,nW),m=e.getProperty("NORMAL_RIGHT_OCT32P",X.UNSIGNED_SHORT,2,n,dre);if(l(_)){if(!l(m))throw new re("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Ln.octDecodeInRange(_[0],_[1],65535,r),Ln.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(Ot.eastNorthUpToFixedFrame(o,ee.WGS84,u),F.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(d.cross(s,r,a),d.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,r,c),$.setColumn(c,2,a,c)),Oe.fromRotationMatrix(c,i)}function jHe(e,t,n){n=d.fromElements(1,1,1,n);let i=e.getProperty("SCALE",X.FLOAT,1,t);l(i)&&d.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",X.FLOAT,3,t,nW);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function qHe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}Rp.prototype.isUnloaded=function(){return this._state===Pp.UNLOADED};Rp.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),qHe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Pp.UNLOADED};var bF=Rp;var YHe={STOPPED:0,ANIMATING:1},Jh=Object.freeze(YHe);function IC(){this.times=void 0,this.points=void 0,he.throwInstantiationError()}IC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof d)return d;if(e instanceof Oe)return Oe};IC.prototype.evaluate=he.throwInstantiationError;IC.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};IC.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};IC.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var io=IC;function PC(e){this._value=e,this._valueType=io.getPointType(e)}Object.defineProperties(PC.prototype,{value:{get:function(){return this._value}}});PC.prototype.findTimeInterval=function(e){};PC.prototype.wrapTime=function(e){return 0};PC.prototype.clampTime=function(e){return 0};PC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var TF=PC;function RC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=io.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(RC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});RC.prototype.findTimeInterval=io.prototype.findTimeInterval;RC.prototype.wrapTime=io.prototype.wrapTime;RC.prototype.clampTime=io.prototype.clampTime;RC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new d),d.lerp(n[o],n[o+1],r,t))};var px=RC;var mre={};mre.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new d,s[a]=new d;o[0]=n[0]/t[0],r[0]=d.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=d.subtract(r[a],d.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var Tw=mre;var pre=[],gre=[],_re=[],yre=[];function XHe(e,t,n){let i=pre,o=_re,r=gre,s=yre;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new d),d.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new d),d.subtract(e[a+1],e[a-1],c),d.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new d),d.subtract(e[a+1],e[a-1],c),d.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new d),d.clone(n,c),Tw.solve(i,r,o,s)}function KHe(e){let t=pre,n=_re,i=gre,o=yre;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new d),d.subtract(e[1],e[0],s),d.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new d),d.subtract(e[r+1],e[r-1],s),d.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new d),d.subtract(e[r],e[r-1],s),d.multiplyByScalar(s,3,s),Tw.solve(t,i,n,o)}function El(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=io.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(El.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});El.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new El({times:t,points:n,inTangents:r,outTangents:o})};El.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new px({points:n,times:t});let i=KHe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new El({times:t,points:n,inTangents:r,outTangents:o})};El.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=io.getPointType(n[0]);if(n.length<3)return new px({points:n,times:t});let s=XHe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new El({times:t,points:n,inTangents:c,outTangents:a})};El.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);El.prototype.findTimeInterval=io.prototype.findTimeInterval;var ZHe=new oe,OC=new d;El.prototype.wrapTime=io.prototype.wrapTime;El.prototype.clampTime=io.prototype.clampTime;El.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=ZHe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=F.multiplyByVector(El.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let h=this._pointType;return h===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(l(t)||(t=new h),t=h.multiplyByScalar(n[s],f.x,t),h.multiplyByScalar(n[s+1],f.y,OC),h.add(t,OC,t),h.multiplyByScalar(r[s],f.z,OC),h.add(t,OC,t),h.multiplyByScalar(o[s],f.w,OC),h.add(t,OC,t))};var gx=El;function MC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=io.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(MC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});MC.prototype.findTimeInterval=io.prototype.findTimeInterval;MC.prototype.wrapTime=io.prototype.wrapTime;MC.prototype.clampTime=io.prototype.clampTime;MC.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var CF=MC;function $He(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Oe);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return Oe.fastSlerp(a,c,s,o)}}function LC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=$He(this),this._lastTimeIndex=0}Object.defineProperties(LC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});LC.prototype.findTimeInterval=io.prototype.findTimeInterval;LC.prototype.wrapTime=io.prototype.wrapTime;LC.prototype.clampTime=io.prototype.clampTime;LC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var AF=LC;var NC=bn.AnimatedPropertyType;function iW(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,n8e(this)}Object.defineProperties(iW.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function QHe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new gx({times:e,points:n,inTangents:i,outTangents:o})}function xre(e,t,n,i){if(e.length===1&&t.length===1)return new TF(t[0]);switch(n){case $h.STEP:return new CF({times:e,points:t});case $h.CUBICSPLINE:return QHe(e,t);case $h.LINEAR:return i===NC.ROTATION?new AF({times:e,points:t}):new px({times:e,points:t})}}function JHe(e,t,n,i,o){let r=[];if(i===NC.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(a),h=c;if(n===$h.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[h],f[u+1]=t[h+o],f[u+2]=t[h+2*o],h+=o*3;else for(u=0;u<a;u++)f[u]=t[h],h+=o;r.push(xre(e,f,n,i))}}else r.push(xre(e,t,n,i));return r}var e8e=new d,t8e=new Oe;function n8e(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=JHe(i,o,r,a,u);e._splines=f,e._path=a}iW.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===NC.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===NC.TRANSLATION||n===NC.SCALE?o[n]=r.evaluate(s,e8e):n===NC.ROTATION&&(o[n]=r.evaluate(s,t8e))}}};var EF=iW;function oW(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=Z.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=Z.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,au.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new pe,this.update=new pe,this.stop=new pe,this._state=Jh.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,i8e(this)}Object.defineProperties(oW.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function i8e(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let u=r[c],f=u.target;if(!l(f))continue;let h=f.node.index,p=i._runtimeNodes[h],_=new EF({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(_)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}oW.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var SF=oW;function Op(e){this.animationAdded=new pe,this.animationRemoved=new pe,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Op.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function rW(e,t,n){let i=e._model,o=new SF(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}Op.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return rW(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return rW(this,n[i],e)};Op.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=rW(this,n[r],e);i.push(s)}return i};Op.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};Op.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};Op.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Op.prototype.get=function(e){return this._runtimeAnimations[e]};var vF=[];function o8e(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Op.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&Z.equals(e.time,this._previousTime))return!1;this._previousTime=Z.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=Z.addSeconds(y(a.startTime,o),a.delay,new Z)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,h=Z.lessThanOrEquals(c,o),p=l(f)&&Z.greaterThan(o,f),_=0;if(u!==0){let b=Z.secondsDifference(p?f:o,c);_=l(a._animationTime)?a._animationTime(u,b):b/u}let m=a.loop===au.REPEAT||a.loop===au.MIRRORED_REPEAT,x=(h||m&&!l(a.startTime))&&(_<=1||m)&&!p;if(_===a._prevAnimationDelta){let b=a._state===Jh.STOPPED;if(x!==b)continue}if(a._prevAnimationDelta=_,x||a._state===Jh.ANIMATING){if(x&&a._state===Jh.STOPPED&&(a._state=Jh.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===au.REPEAT)_=_-Math.floor(_);else if(a.loop===au.MIRRORED_REPEAT){let T=Math.floor(_),C=_-T;_=T%2===1?1-C:C}a.reverse&&(_=1-_);let b=_*u*a.multiplier;b=P.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=Jh.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&vF.push(a))}}n=vF.length;for(let s=0;s<n;++s){let a=vF[s];t.splice(t.indexOf(a),1),e.afterRender.push(o8e(this,r,a))}return vF.length=0,i};var wF=Op;function _x(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(_x.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});_x.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};_x.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};_x.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};_x.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};_x.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var DF=_x;var Cw={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Cw.getStyleCommandsNeeded=function(e,t){return t===0?Cw.ALL_OPAQUE:t===e?Cw.ALL_TRANSLUCENT:Cw.OPAQUE_AND_TRANSLUCENT};var em=Object.freeze(Cw);var F_={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};F_.is3DTiles=function(e){switch(e){case F_.TILE_GLTF:case F_.TILE_B3DM:case F_.TILE_I3DM:case F_.TILE_PNTS:case F_.TILE_GEOJSON:return!0;case F_.GLTF:return!1}};var gr=Object.freeze(F_);function Mr(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=em.ALL_OPAQUE,r8e(this)}Object.defineProperties(Mr.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function r8e(e){let t=e._model,n=gr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new Js(s,o)}else for(o=0;o<i;o++)r[o]=new DF({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Tl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Mr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=em.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Mr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Mr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Mr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Mr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Mr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Mr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Mr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Mr.prototype.getFeature=function(e){return this._features[e]};Mr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Mr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Mr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Mr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Mr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Mr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Mr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Mr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Mr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var s8e=new z;Mr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Tl.DEFAULT_COLOR_VALUE),this.setAllShow(Tl.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,s8e),Tl.DEFAULT_COLOR_VALUE):Tl.DEFAULT_COLOR_VALUE,o=l(e.show)?y(e.show.evaluate(n),Tl.DEFAULT_SHOW_VALUE):Tl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Mr.prototype.isDestroyed=function(){return!1};Mr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var IF=Mr;var bre={name:"TilesetPipelineStage"};bre.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,ge.FRAGMENT);let r={u_polygonOffset:function(){return U.ZERO}};e.uniformMap=xt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Vt.setCesium3DTileBit(),i.stencilMask=Vt.CESIUM_3D_TILE_MASK};var PF=bre;var RF=`// robust iterative solution without trig functions +// https://github.com/0xfaded/ellipse_demo/issues/1 +// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse +// +// This version uses only a single iteration for best performance. For fog +// rendering, the difference is negligible. +vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) { + vec2 p = abs(pos); + vec2 inverseRadii = 1.0 / radii; + vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii; + + // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t)) + // but store the cos and sin of t in a vec2 for efficiency. + // Initial guess: t = cos(pi/4) + vec2 tTrigs = vec2(0.70710678118); + vec2 v = radii * tTrigs; + + // Find the evolute of the ellipse (center of curvature) at v. + vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs; + // Find the (approximate) intersection of p - evolute with the ellipsoid. + vec2 q = normalize(p - evolute) * length(v - evolute); + // Update the estimate of t. + tTrigs = (q + evolute) * inverseRadii; + tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); + v = radii * tTrigs; + + return v * sign(pos); +} + +vec3 computeEllipsoidPositionWC(vec3 positionMC) { + // Get the world-space position and project onto a meridian plane of + // the ellipsoid + vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; + + vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z); + vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz); + + // Reconstruct a 3D point in world space + return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y); +} + +void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) { + + vec3 fogColor = groundAtmosphereColor.rgb; + + // If there is dynamic lighting, apply that to the fog. + const float NONE = 0.0; + if (czm_atmosphereDynamicLighting != NONE) { + float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0); + fogColor *= darken; + } + + // Tonemap if HDR rendering is disabled + #ifndef HDR + fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); + fogColor.rgb = czm_inverseGamma(fogColor.rgb); + #endif + + vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar); + color = vec4(withFog, color.a); +} + +void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) { + vec3 rayleighColor; + vec3 mieColor; + float opacity; + + vec3 positionWC; + vec3 lightDirection; + + // When the camera is in space, compute the position per-fragment for + // more accurate ground atmosphere. All other cases will use + // + // The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717 + if (false) { + positionWC = computeEllipsoidPositionWC(attributes.positionMC); + lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); + + // The fog color is derived from the ground atmosphere color + czm_computeGroundAtmosphereScattering( + positionWC, + lightDirection, + rayleighColor, + mieColor, + opacity + ); + } else { + positionWC = attributes.positionWC; + lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); + rayleighColor = v_atmosphereRayleighColor; + mieColor = v_atmosphereMieColor; + opacity = v_atmosphereOpacity; + } + + //color correct rayleigh and mie colors + const bool ignoreBlackPixels = true; + rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels); + mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels); + + vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); + + if (u_isInFog) { + float distanceToCamera = length(attributes.positionEC); + applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); + } else { + // Ground atmosphere + } +} +`;var OF=`void atmosphereStage(ProcessedAttributes attributes) { + vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); + + czm_computeGroundAtmosphereScattering( + // This assumes the geometry stage came before this. + v_positionWC, + lightDirection, + v_atmosphereRayleighColor, + v_atmosphereMieColor, + v_atmosphereOpacity + ); +} +`;var Tre={name:"AtmospherePipelineStage"};Tre.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,ge.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([OF]),i.addFragmentLines([RF]),i.addUniform("bool","u_isInFog",ge.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=d.distance(n.camera.positionWC,t.boundingSphere.center);return P.fog(o,n.fog.density)>P.EPSILON3}};var MF=Tre;var LF=`#ifdef DIFFUSE_IBL +vec3 sampleDiffuseEnvironment(vec3 cubeDir) +{ + #ifdef CUSTOM_SPHERICAL_HARMONICS + return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); + #else + return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); + #endif +} +#endif + +#ifdef SPECULAR_IBL +vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) +{ + #ifdef CUSTOM_SPECULAR_IBL + float lod = roughness * model_specularEnvironmentMapsMaximumLOD; + return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; + #else + float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; + return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; + #endif +} +vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) +{ + // see https://bruop.github.io/ibl/ at Single Scattering Results + // Roughness dependent fresnel, from Fdez-Aguera + vec3 f90 = max(vec3(1.0 - roughness), f0); + vec3 F = fresnelSchlick2(f0, f90, NdotV); + + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); + + return specularSample * (F * brdfLut.x + brdfLut.y); +} +#endif + +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +/** + * Compute the light contributions from environment maps and spherical harmonic coefficients. + * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation + * of the single- and multi-scattering terms. + * + * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position. + * @param {vec3} normalEC The surface normal in eye coordinates. + * @param {czm_modelMaterial} The material properties. + * @return {vec3} The computed HDR color. + */ +vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { + vec3 f0 = material.specular; + float roughness = material.roughness; + float specularWeight = 1.0; + #ifdef USE_SPECULAR + specularWeight = material.specularWeight; + #endif + float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); + + // see https://bruop.github.io/ibl/ at Single Scattering Results + // Roughness dependent fresnel, from Fdez-Aguera + vec3 f90 = max(vec3(1.0 - roughness), f0); + vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); + + vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; + vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); + + #ifdef DIFFUSE_IBL + vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); + vec3 irradiance = sampleDiffuseEnvironment(normalMC); + + vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; + float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); + vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); + vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; + vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; + #else + vec3 diffuseContribution = vec3(0.0); + #endif + + #ifdef USE_ANISOTROPY + // Bend normal to account for anisotropic distortion of specular reflection + vec3 anisotropyDirection = material.anisotropicB; + vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); + vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); + float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); + float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; + vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); + vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); + #else + vec3 reflectEC = reflect(-viewDirectionEC, normalEC); + #endif + + #ifdef SPECULAR_IBL + vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); + vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); + vec3 specularContribution = radiance * FssEss * model_iblFactor.y; + #else + vec3 specularContribution = vec3(0.0); + #endif + + return diffuseContribution + specularContribution; +} +#endif +`;var Cre={name:"ImageBasedLightingPipelineStage"},a8e=new U;Cre.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,ge.FRAGMENT),r.addUniform("vec2","model_iblFactor",ge.FRAGMENT),Uh.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",ge.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ge.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ge.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,ge.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",ge.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ge.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT)),r.addFragmentLines(LF);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,a8e)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=xt(c,e.uniformMap)};var NF=Cre;var c8e=P.EPSILON16;function aW(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(aW.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,c8e)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var l8e=new d,sW=new $;aW.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=l8e,o;switch(t){case kc.XROTATE:o=$.fromRotationX(P.toRadians(n),sW),e=F.multiplyByMatrix3(e,o,e);break;case kc.YROTATE:o=$.fromRotationY(P.toRadians(n),sW),e=F.multiplyByMatrix3(e,o,e);break;case kc.ZROTATE:o=$.fromRotationZ(P.toRadians(n),sW),e=F.multiplyByMatrix3(e,o,e);break;case kc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case kc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case kc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case kc.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case kc.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case kc.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case kc.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var FF=aW;function BF(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,u8e(this)}Object.defineProperties(BF.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function u8e(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new FF({stage:a,runtimeArticulation:e});o.push(c);let u=a.name;r[u]=c}}BF.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var f8e=new F,d8e=new F;BF.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,f8e),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=F.multiplyTransformation(s.originalTransform,e,d8e);s.transform=a}};var kF=BF;var VF=`void modelColorStage(inout czm_modelMaterial material) +{ + material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend); + float highlight = ceil(model_colorBlend); + material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight); + material.alpha *= model_color.a; +} +`;var FC={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};FC.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,ge.FRAGMENT),i.addFragmentLines(VF);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=we.TRANSLUCENT),i.addUniform("vec4",FC.COLOR_UNIFORM_NAME,ge.FRAGMENT),o[FC.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",FC.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),o[FC.COLOR_BLEND_UNIFORM_NAME]=function(){return Bc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=xt(o,e.uniformMap)};var yx=FC;var UF=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE +vec4 getClippingPlane( + highp sampler2D packedClippingPlanes, + int clippingPlaneNumber, + mat4 transform +) { + int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; + int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); + float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel + float v = (float(pixY) + 0.5) * pixelHeight; + vec4 plane = texture(packedClippingPlanes, vec2(u, v)); + return czm_transformPlane(plane, transform); +} +#else +// Handle uint8 clipping texture instead +vec4 getClippingPlane( + highp sampler2D packedClippingPlanes, + int clippingPlaneNumber, + mat4 transform +) { + int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each + int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; + int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); + float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); + float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel + float v = (float(pixY) + 0.5) * pixelHeight; + vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; + vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); + vec4 plane; + plane.xyz = czm_octDecode(oct, 65535.0); + plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); + return czm_transformPlane(plane, transform); +} +#endif + +float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { + vec4 position = czm_windowToEyeCoordinates(fragCoord); + vec3 clipNormal = vec3(0.0); + vec3 clipPosition = vec3(0.0); + float pixelWidth = czm_metersPerPixel(position); + + #ifdef UNION_CLIPPING_REGIONS + float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below. + #else + float clipAmount = 0.0; + bool clipped = true; + #endif + + for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { + vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); + clipNormal = clippingPlane.xyz; + clipPosition = -clippingPlane.w * clipNormal; + float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; + + #ifdef UNION_CLIPPING_REGIONS + clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); + if (amount <= 0.0) { + discard; + } + #else + clipAmount = max(amount, clipAmount); + clipped = clipped && (amount <= 0.0); + #endif + } + + #ifndef UNION_CLIPPING_REGIONS + if (clipped) { + discard; + } + #endif + + return clipAmount; +} + +void modelClippingPlanesStage(inout vec4 color) +{ + float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); + vec4 clippingPlanesEdgeColor = vec4(1.0); + clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; + float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; + + if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { + color = clippingPlanesEdgeColor; + } +} +`;var Are={name:"ModelClippingPlanesPipelineStage"},h8e=new U;Are.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ge.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ge.FRAGMENT),bs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ge.FRAGMENT);let s=bs.getTextureResolution(i,o,h8e);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ge.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ge.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ge.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ge.FRAGMENT),r.addFragmentLines(UF);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=xt(a,e.uniformMap)};var zF=Are;var HF=`void modelClippingPolygonsStage(ProcessedAttributes attributes) +{ + vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC); + sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); + + vec2 minDistance = vec2(czm_infinity); + v_regionIndex = -1; + v_clippingPosition = vec2(czm_infinity); + + for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) { + vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex); + vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz; + + vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0)); + vec2 distance = abs(rectUv - clamped) * extents.wz; + + if (minDistance.x > distance.x || minDistance.y > distance.y) { + minDistance = distance; + v_clippingPosition = rectUv; + } + + float threshold = 0.01; + if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) { + v_regionIndex = regionIndex; + } + } +} +`;var GF=`void modelClippingPolygonsStage() +{ + vec2 clippingPosition = v_clippingPosition; + int regionIndex = v_regionIndex; + czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); +} +`;var Ere={name:"ModelClippingPolygonsPipelineStage"};Ere.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ge.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ge.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ge.BOTH),o.addUniform("sampler2D","model_clippingDistance",ge.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ge.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(HF),o.addFragmentLines(GF);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=xt(r,e.uniformMap)};var WF=Ere;function Sre(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Sre.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var jF=Sre;var qF=`mat4 getInstancingTransform() +{ + mat4 instancingTransform; + + #ifdef HAS_INSTANCE_MATRICES + instancingTransform = mat4( + a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 + a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 + a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 + a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation = a_instanceTranslation; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif + + instancingTransform = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation.x, translation.y, translation.z, 1.0 + ); + #endif + + return instancingTransform; +} + +#ifdef USE_2D_INSTANCING +mat4 getInstancingTransform2D() +{ + mat4 instancingTransform2D; + + #ifdef HAS_INSTANCE_MATRICES + instancingTransform2D = mat4( + a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 + a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 + a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 + a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 + ); + #else + vec3 translation2D = vec3(0.0, 0.0, 0.0); + vec3 scale = vec3(1.0, 1.0, 1.0); + + #ifdef HAS_INSTANCE_TRANSLATION + translation2D = a_instanceTranslation2D; + #endif + #ifdef HAS_INSTANCE_SCALE + scale = a_instanceScale; + #endif + + instancingTransform2D = mat4( + scale.x, 0.0, 0.0, 0.0, + 0.0, scale.y, 0.0, 0.0, + 0.0, 0.0, scale.z, 0.0, + translation2D.x, translation2D.y, translation2D.z, 1.0 + ); + #endif + + return instancingTransform2D; +} +#endif +`;var YF=`void instancingStage(inout ProcessedAttributes attributes) +{ + vec3 positionMC = attributes.positionMC; + + mat4 instancingTransform = getInstancingTransform(); + + attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; + + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; + #endif + + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var XF=`void legacyInstancingStage( + inout ProcessedAttributes attributes, + out mat4 instanceModelView, + out mat3 instanceModelViewInverseTranspose) +{ + vec3 positionMC = attributes.positionMC; + + mat4 instancingTransform = getInstancingTransform(); + + mat4 instanceModel = instancingTransform * u_instance_nodeTransform; + instanceModelView = u_instance_modifiedModelView; + instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); + + attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; + + #ifdef USE_2D_INSTANCING + mat4 instancingTransform2D = getInstancingTransform2D(); + attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; + #endif +} +`;var KF=new F,m8e=new F,p8e=new F,wre={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Ore,_transformsToTypedArray:lW};wre.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(qF);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,h=[];P8e(e,n,i,h,u,f),M8e(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ge.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ge.VERTEX),p.u_instance_modifiedModelView=function(){let _=F.multiplyTransformation(s.modelMatrix,a.components.transform,KF);return u?F.multiplyTransformation(n.context.uniformState.view3D,_,KF):(n.mode!==ne.SCENE3D&&(_=Ot.basisTo2D(n.mapProjection,_,KF)),F.multiplyTransformation(n.context.uniformState.view,_,KF))},p.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,m8e)},r.addVertexLines(XF)):r.addVertexLines(YF),u){r.addDefine("USE_2D_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_modelView2D",ge.VERTEX);let _=n.context,m=F.fromTranslation(c.instancingReferencePoint2D,new F);p.u_modelView2D=function(){return F.multiplyTransformation(_.uniformState.view,m,p8e)}}e.uniformMap=xt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,h)};var Aw=new F,g8e=new d;function _8e(e,t,n,i,o){let r=F.multiplyTransformation(t,e,Aw);return r=F.multiplyTransformation(r,n,Aw),o=Ot.basisTo2D(i.mapProjection,r,o),o}function y8e(e,t,n,i,o){let r=F.fromTranslation(e,Aw),s=F.multiplyTransformation(t,r,Aw);s=F.multiplyTransformation(s,n,Aw);let a=F.getTranslation(s,g8e);return o=zi.computeActualEllipsoidPosition(i,a,o),o}function Dre(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=F.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(o.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var Ire=new F,Pre=new F,x8e=new F,b8e=new d;function T8e(e,t,n,i){let o=Ire,r=Pre;Dre(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],h=_8e(f,o,r,n,x8e),p=F.getTranslation(h,b8e),_=d.subtract(p,a,p);i[u]=F.setTranslation(h,_,i[u])}return i}function C8e(e,t,n,i){let o=Ire,r=Pre;Dre(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],h=y8e(f,o,r,n,f);i[u]=d.subtract(h,a,i[u])}return i}var A8e=new d,E8e=new d;function Rre(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=F.multiplyByPoint(i,n.instancingTranslationMin,A8e),r=zi.computeActualEllipsoidPosition(t,o,o),s=F.multiplyByPoint(i,n.instancingTranslationMax,E8e),a=zi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=d.lerp(r,a,.5,new d)}function lW(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function S8e(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var v8e=new d,w8e=new Oe,D8e=new d;function Ore(e,t,n){let i=new Array(t),o=Xt.getAttributeBySemantic(e,rs.TRANSLATION),r=Xt.getAttributeBySemantic(e,rs.ROTATION),s=Xt.getAttributeBySemantic(e,rs.SCALE),a=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),h=l(s),p=u?o.typedArray:new Float32Array(t*3),_=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(_=Ln.dequantize(_,r.componentDatatype,r.type,t));let m;h?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let b=0;b<t;b++){let T=new d(p[b*3],p[b*3+1],p[b*3+2],v8e);d.maximumByComponent(a,T,a),d.minimumByComponent(c,T,c);let C=new Oe(_[b*4],_[b*4+1],_[b*4+2],f?_[b*4+3]:1,w8e),A=new d(m[b*3],m[b*3+1],m[b*3+2],D8e),S=F.fromTranslationQuaternionRotationScale(T,C,A,new F);i[b]=S}let x=n.runtimeNode;return x.instancingTranslationMin=c,x.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),h&&(s.typedArray=void 0),i}function I8e(e,t,n){let i=new Array(t),o=e.typedArray,r=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new d(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,d.minimumByComponent(r,u,r),d.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function uW(e,t){let n=_t.createVertexBuffer({context:t.context,typedArray:e,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function P8e(e,t,n,i,o,r){let s=Xt.getAttributeBySemantic(n,rs.ROTATION);l(s)?R8e(e,n,i,t,o,r):O8e(e,n,i,t,o)}function R8e(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",h,p=u.instancingTransformsBuffer;if(!l(p)){h=Ore(t,a,e);let b=lW(h);p=uW(b,i),c._modelResources.push(p),r&&(u.transformsTypedArray=b),u.instancingTransformsBuffer=p}if(vre(e,p,n,f),!o)return;let _=Ge(i);_.mode=ne.COLUMBUS_VIEW,Rre(e,_);let m=u.instancingTransformsBuffer2D;if(!l(m)){let b=T8e(h,e,_,h),T=lW(b);m=uW(T,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}vre(e,m,n,"Transform2D")}function O8e(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=Xt.getAttributeBySemantic(t,rs.TRANSLATION),u=Xt.getAttributeBySemantic(t,rs.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),cW(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,h=c.typedArray;if(l(h)?f=I8e(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),cW(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let _=Ge(i);_.mode=ne.COLUMBUS_VIEW,Rre(e,_);let m=a.instancingTranslationBuffer2D;if(!l(m)){let C=C8e(f,e,_,f),A=S8e(C);r&&(a.transformsTypedArray=A),m=uW(A,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!o)return;cW(e,m,0,void 0,n,"Translation2D")}function vre(e,t,n,i){let r=X.getSizeInBytes(X.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function cW(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function M8e(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===rs.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:tn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var ZF=wre;var fW={};fW.name="ModelMatrixUpdateStage";fW.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Mre(e,t,o,e.transformToRoot),e._transformDirty=!1}};function L8e(e,t,n){e.modelMatrix=F.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Xt.getCullFace(e.modelMatrix,e.primitiveType)}function Mre(e,t,n,i){let o;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];L8e(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=F.clone(i,a._transformToRoot),Mre(a,t,n,i),a._transformDirty=!1}}var $F=fW;var Lre={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Nre,_countGeneratedBuffers:Fre};Lre.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;Nre(i,o),Fre(i,r)};function Nre(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function Fre(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var QF=Lre;function BC(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,N8e(this)}Object.defineProperties(BC.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=F.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;d.equals(n,e)||(t.translation=d.clone(e,t.translation),dW(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Oe.equals(n,e)||(t.rotation=Oe.clone(e,t.rotation),dW(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;d.equals(n,e)||(t.scale=d.clone(e,t.scale),dW(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function N8e(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new K0(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function dW(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}BC.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};BC.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(ZF),t.push(QF),n.push($F)};BC.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};BC.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new F);let r=F.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=F.inverseTransformation(r,t[o]);t[o]=F.multiplyTransformation(s,n[o],t[o])}};var JF=BC;var Bre={name:"AlphaPipelineStage"};Bre.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=y(i.pass,o.opaquePass);let r=e.renderStateOptions;i.pass===we.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=ln.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,ge.FRAGMENT),s.addUniform("float","u_alphaCutoff",ge.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var e2=Bre;var kre={name:"BatchTexturePipelineStage"};kre.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=xt(o,e.uniformMap)};var t2=kre;var Vre={name:"ClassificationPipelineStage"};Vre.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ge.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||F8e(t,o)};function F8e(e,t){let n=Xt.getAttributeBySemantic(e,At.POSITION);if(!l(n))throw new re("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=Xt.getAttributeBySemantic(e,At.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],h=r?i[0]:0,p=c[h],_=0;for(let x=1;x<s;x++){let b=r?i[x]:x,T=c[b];if(T!==p){let C=x-_,A=x;u.push(C),f.push(A),_=A,p=T}}let m=s-_;u.push(m),t.batchLengths=u,t.batchOffsets=f}var n2=Vre;var i2=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +{ + bool styleTranslucent = (featureColor.a != 1.0); + // Only render translucent features in the translucent pass (if the style or the original command has translucency). + if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) + { + // If the model has a translucent silhouette, it needs to render during the silhouette color command, + // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. + #ifdef HAS_SILHOUETTE + positionMC *= float(model_silhouettePass); + #else + positionMC *= 0.0; + #endif + } + // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. + else if (czm_pass != czm_passTranslucent && styleTranslucent) + { + positionMC *= 0.0; + } +} + +void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) +{ + float show = ceil(feature.color.a); + positionMC *= show; + + #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) + filterByPassType(positionMC, feature.color); + #endif +} +`;var o2=`void filterByPassType(vec4 featureColor) +{ + bool styleTranslucent = (featureColor.a != 1.0); + // Only render translucent features in the translucent pass (if the style or the original command has translucency). + if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) + { + // If the model has a translucent silhouette, it needs to render during the silhouette color command, + // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. + #ifdef HAS_SILHOUETTE + if(!model_silhouettePass) { + discard; + } + #else + discard; + #endif + } + // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. + else if (czm_pass != czm_passTranslucent && styleTranslucent) + { + discard; + } +} + +void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) +{ + vec4 featureColor = feature.color; + if (featureColor.a == 0.0) + { + discard; + } + + // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader. + // So, we only apply in in the fragment shader if the feature ID texture is used. + #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) + filterByPassType(featureColor); + #endif + + featureColor = czm_gammaCorrect(featureColor); + + // Classification models compute the diffuse differently. + #ifdef HAS_CLASSIFICATION + material.diffuse = featureColor.rgb * featureColor.a; + #else + float highlight = ceil(model_colorBlend); + material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); + #endif + + material.alpha *= featureColor.a; +} +`;var Ure={name:"CPUStylingPipelineStage"};Ure.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(i2),o.addFragmentLines(o2),o.addDefine("USE_CPU_STYLING",void 0,ge.BOTH),l(i.color)||(o.addUniform("float",yx.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),e.uniformMap[yx.COLOR_BLEND_UNIFORM_NAME]=function(){return Bc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",ge.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===we.TRANSLUCENT}};var r2=Ure;var zre={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};zre.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var B_=Object.freeze(zre);var s2=`void customShaderStage( + inout czm_modelVertexOutput vsOutput, + inout ProcessedAttributes attributes, + FeatureIds featureIds, + Metadata metadata, + MetadataClass metadataClass, + MetadataStatistics metadataStatistics +) { + // VertexInput and initializeInputStruct() are dynamically generated in JS, + // see CustomShaderPipelineStage.js + VertexInput vsInput; + initializeInputStruct(vsInput, attributes); + vsInput.featureIds = featureIds; + vsInput.metadata = metadata; + vsInput.metadataClass = metadataClass; + vsInput.metadataStatistics = metadataStatistics; + vertexMain(vsInput, vsOutput); + attributes.positionMC = vsOutput.positionMC; +} +`;var a2=`void customShaderStage( + inout czm_modelMaterial material, + ProcessedAttributes attributes, + FeatureIds featureIds, + Metadata metadata, + MetadataClass metadataClass, + MetadataStatistics metadataStatistics +) { + // FragmentInput and initializeInputStruct() are dynamically generated in JS, + // see CustomShaderPipelineStage.js + FragmentInput fsInput; + initializeInputStruct(fsInput, attributes); + fsInput.featureIds = featureIds; + fsInput.metadata = metadata; + fsInput.metadataClass = metadataClass; + fsInput.metadataStatistics = metadataStatistics; + fragmentMain(fsInput, material); +} +`;var c2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { + initializeFeatureIds(featureIds, attributes); + initializeFeatureIdAliases(featureIds); +} +`;var l2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +{ + initializeFeatureIds(featureIds, attributes); + initializeFeatureIdAliases(featureIds); + setFeatureIdVaryings(); +} +`;var Li={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Li.process=function(e,t,n){let i=e.shaderBuilder;B8e(i);let o=e.runtimeNode.node.instances;l(o)&&k8e(e,o,n),V8e(e,t,n),i.addVertexLines(l2),i.addFragmentLines(c2)};function B8e(e){e.addStruct(Li.STRUCT_ID_FEATURE_IDS_VS,Li.STRUCT_NAME_FEATURE_IDS,ge.VERTEX),e.addStruct(Li.STRUCT_ID_FEATURE_IDS_FS,Li.STRUCT_NAME_FEATURE_IDS,ge.FRAGMENT),e.addFunction(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Li.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.VERTEX),e.addFunction(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Li.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.FRAGMENT),e.addFunction(Li.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Li.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.VERTEX),e.addFunction(Li.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Li.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.FRAGMENT),e.addFunction(Li.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Li.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,ge.VERTEX)}function k8e(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof bn.FeatureIdAttribute?U8e(e,s,a):Hre(e,s,a,o,1,n);let c=s.label;l(c)&&Gre(e,a,c,ge.BOTH)}}function V8e(e,t,n){let i=t.featureIds,r=Xt.getAttributeBySemantic(t,At.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=ge.BOTH;a instanceof bn.FeatureIdAttribute?z8e(e,a,c):a instanceof bn.FeatureIdImplicitRange?Hre(e,a,c,r,void 0,n):(H8e(e,a,c,s,n),u=ge.FRAGMENT);let f=a.label;l(f)&&Gre(e,c,f,u)}}function U8e(e,t,n){let i=e.shaderBuilder;i.addStructField(Li.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Li.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Li.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function z8e(e,t,n){let i=e.shaderBuilder;i.addStructField(Li.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Li.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Hre(e,t,n,i,o,r){G8e(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Li.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Li.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Li.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function H8e(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return y(a.texture,o.context.defaultTexture)};let c=a.channels,u=e.shaderBuilder;u.addStructField(Li.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,ge.FRAGMENT);let h=`v_texCoord_${a.texCoord}`,p=h,_=a.transform;if(l(_)&&!$.equals(_,$.IDENTITY)){let b=`${r}Transform`;u.addUniform("mat3",b,ge.FRAGMENT),s[b]=function(){return _},p=`vec2(${b} * vec3(${h}, 1.0))`}let m=`texture(${r}, ${p}).${c}`,x=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[x])}function Gre(e,t,n,i){let o=e.shaderBuilder,r=ge.includesVertexShader(i);r&&o.addStructField(Li.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Li.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function G8e(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let u=W8e(t,n);s=_t.createVertexBuffer({context:o.context,typedArray:u,usage:Fe.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:X.FLOAT,strideInBytes:X.getSizeInBytes(X.FLOAT),offsetInBytes:0};e.attributes.push(c)}function W8e(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var xx=Li;var u2=`void metadataStage( + out Metadata metadata, + out MetadataClass metadataClass, + out MetadataStatistics metadataStatistics, + ProcessedAttributes attributes + ) +{ + initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); +} +`;var f2=`void metadataStage( + out Metadata metadata, + out MetadataClass metadataClass, + out MetadataStatistics metadataStatistics, + ProcessedAttributes attributes + ) +{ + initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); + setMetadataVaryings(); +} +`;var Ci={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Ci.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=j8e(r.propertyAttributes,t,a),u=Y8e(r.propertyTextures,a),f=c.concat(u);K8e(i,f),Q8e(i),i.addVertexLines(f2),i.addFragmentLines(u2);for(let h=0;h<c.length;h++){let p=c[h];J8e(e,p)}for(let h=0;h<u.length;h++){let p=u[h];tGe(e,p)}};function j8e(e,t,n){return l(e)?e.flatMap(i=>q8e(i,t,n)):[]}function q8e(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Xt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[h,p]=c[f],_=i(t,p.attribute),{glslType:m,variableName:x}=o(_);u[f]={metadataVariable:r(h),property:p,type:p.classProperty.type,glslType:m,variableName:x,propertyStatistics:a?.properties[h],shaderDestination:ge.BOTH}}return u}function Y8e(e,t){return l(e)?e.flatMap(n=>X8e(n,t)):[]}function X8e(e,t){let{sanitizeGlslIdentifier:n}=Xt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,u]=r[a];s[a]={metadataVariable:n(c),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:ge.FRAGMENT}}return s}function K8e(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==ct.ENUM&&i.add(u)}let o=Ci.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Ci.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,u){e.addStruct(a,a,ge.BOTH);for(let f=0;f<u.length;f++){let{shaderName:h}=u[f],p=u[f].type==="float"?$8e(c):c;e.addStructField(a,p,h)}}}var Z8e={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function $8e(e){let t=Z8e[e];return l(t)?t:e}function Q8e(e){e.addStruct(Ci.STRUCT_ID_METADATA_VS,Ci.STRUCT_NAME_METADATA,ge.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_FS,Ci.STRUCT_NAME_METADATA,ge.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_VS,Ci.STRUCT_NAME_METADATA_CLASS,ge.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_FS,Ci.STRUCT_NAME_METADATA_CLASS,ge.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_VS,Ci.STRUCT_NAME_METADATA_STATISTICS,ge.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_FS,Ci.STRUCT_NAME_METADATA_STATISTICS,ge.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.VERTEX),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_SET_METADATA_VARYINGS,Ci.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,ge.VERTEX)}function J8e(e,t){eGe(e,t),Wre(e.shaderBuilder,t),jre(e.shaderBuilder,t)}function eGe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=Yre({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:ge.BOTH,property:o});n.addStructField(Ci.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Ci.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function tGe(e,t){nGe(e,t),Wre(e.shaderBuilder,t),jre(e.shaderBuilder,t)}function nGe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:u,texture:f,transform:h}=s.textureReader,p=`u_propertyTexture_${u}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,ge.FRAGMENT),i[p]=()=>f),n.addStructField(Ci.STRUCT_ID_METADATA_FS,r,o);let _=`attributes.texCoord_${a}`,m=_;if(l(h)&&!$.equals(h,$.IDENTITY)){let A=`${p}Transform`;n.addUniform("mat3",A,ge.FRAGMENT),i[A]=function(){return h},m=`vec2(${A} * vec3(${_}, 1.0))`}let x=`texture(${p}, ${m}).${c}`,b=s.unpackInShader(x),T=Yre({valueExpression:b,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ge.FRAGMENT,property:s}),C=`metadata.${o} = ${T};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[C])}function Wre(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=qre(Ci.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,s),ge.includesVertexShader(r)&&(e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function jre(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===ct.ENUM)return;let s=Ci.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=qre(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,c),ge.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function qre(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function Yre(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,o,u),s.addUniform(c,r,u);let{offset:f,scale:h}=n;return a[o]=()=>f,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var Ed=Ci;var iGe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},bx=Object.freeze(iGe);var ia={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:yt};ia.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===bx.TRANSLUCENT?r.pass=we.TRANSLUCENT:c===bx.OPAQUE&&(r.pass=void 0);let u=fGe(s,t);if(!u.customShaderEnabled)return;if(pGe(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ge.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ge.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ge.FRAGMENT);let p=B_.getDefineName(s.mode);i.addDefine(p,void 0,ge.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let _=f[p];i.addUniform(_.type,p)}let h=s.varyings;for(let p in h)if(h.hasOwnProperty(p)){let _=h[p];i.addVarying(_,p)}e.uniformMap=xt(e.uniformMap,s.uniformMap)};function oGe(e){let t={};for(let n=0;n<e.length;n++){let i=Xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var rGe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},sGe={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function Xre(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=rGe[t],i=sGe[t];if(l(n))return{attributeField:[n,e],value:i}}function aGe(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=Kre(t,n,!1),o=Zre(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let f=[i[c].glslType,c];s.push(f),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let u=o[c],f=Xre(u);if(!l(f))return ia._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${u}, disabling custom vertex shader`),{enabled:!1};s.push(f.attributeField),r=`vsInput.attributes.${u} = ${f.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function cGe(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function lGe(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=Kre(t,n,!0),o=Zre(t,n,!0),r,s=[],a=[];for(let u in i){if(!i.hasOwnProperty(u))continue;let h=[i[u].glslType,u];s.push(h),r=`fsInput.attributes.${u} = attributes.${u};`,a.push(r)}for(let u=0;u<o.length;u++){let f=o[u],h=Xre(f);if(!l(h))return ia._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${f}, disabling custom fragment shader.`),{enabled:!1};s.push(h.attributeField),r=`fsInput.attributes.${f} = ${h.value};`,a.push(r)}let c=cGe(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var uGe={positionWC:!0,positionEC:!0};function Kre(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function Zre(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||uGe.hasOwnProperty(o))continue;let r=o;n&&o==="normalEC"?r="normalMC":n&&o==="tangentEC"&&(r="tangentMC"),e.hasOwnProperty(r)||i.push(o)}return i}function fGe(e,t){let n=oGe(t.attributes),i=aGe(e,n),o=lGe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function dGe(e,t){let n=ia.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ia.STRUCT_NAME_ATTRIBUTES,ge.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=ia.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ia.STRUCT_NAME_VERTEX_INPUT,ge.VERTEX),e.addStructField(n,ia.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,xx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Ed.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Ed.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Ed.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ia.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,ia.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,ge.VERTEX),e.addFunctionLines(r,o)}function hGe(e,t){let n=ia.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ia.STRUCT_NAME_ATTRIBUTES,ge.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=ia.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ia.STRUCT_NAME_FRAGMENT_INPUT,ge.FRAGMENT),e.addStructField(n,ia.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,xx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Ed.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Ed.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Ed.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ia.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,ia.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,ge.FRAGMENT),e.addFunctionLines(r,o)}var mGe=[];function pGe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=mGe;i.enabled&&(dGe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,s2),e.addVertexLines(r)),o.enabled&&(hGe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,a2),e.addFragmentLines(r))}var d2=ia;var Ew={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};Ew.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,ge.VERTEX),i.addFunction(Ew.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,Ew.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,ge.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===At.POSITION,h=c.semantic===At.TEXCOORD;if(r&&!f&&!h)continue;let p=Xt.getAttributeInfo(c);_Ge(i,p),gGe(e,p)}};function gGe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,ge.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,ge.VERTEX),n.addUniform(c,a,ge.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=$re(u,0),f=$re(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function $re(e,t){return e instanceof oe?e:new oe(e.x,e.y,e.z,t)}function _Ge(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=yGe(n,i):o=xGe(n),e.addFunctionLines(Ew.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function yGe(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function xGe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var h2=Ew;var m2=`void geometryStage(out ProcessedAttributes attributes) +{ + attributes.positionMC = v_positionMC; + attributes.positionEC = v_positionEC; + + #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) + attributes.positionWC = v_positionWC; + #endif + + #ifdef HAS_NORMALS + // renormalize after interpolation + attributes.normalEC = normalize(v_normalEC); + #endif + + #ifdef HAS_TANGENTS + attributes.tangentEC = normalize(v_tangentEC); + #endif + + #ifdef HAS_BITANGENTS + attributes.bitangentEC = normalize(v_bitangentEC); + #endif + + // Everything else is dynamically generated in GeometryPipelineStage + setDynamicVaryings(attributes); +} +`;var p2=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +{ + vec4 computedPosition; + + // Compute positions in different coordinate systems + vec3 positionMC = attributes.positionMC; + v_positionMC = positionMC; + v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; + + #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) + vec3 position2D = attributes.position2D; + vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; + computedPosition = czm_projection * vec4(positionEC, 1.0); + #else + computedPosition = czm_projection * vec4(v_positionEC, 1.0); + #endif + + // Sometimes the custom shader and/or style needs this + #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS) + // Note that this is a 32-bit position which may result in jitter on small + // scales. + v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; + #endif + + #ifdef HAS_NORMALS + v_normalEC = normalize(normal * attributes.normalMC); + #endif + + #ifdef HAS_TANGENTS + v_tangentEC = normalize(normal * attributes.tangentMC); + #endif + + #ifdef HAS_BITANGENTS + v_bitangentEC = normalize(normal * attributes.bitangentMC); + #endif + + // All other varyings need to be dynamically generated in + // GeometryPipelineStage + setDynamicVaryings(attributes); + + return computedPosition; +} +`;var Sw=`vec2 computeSt(float featureId) +{ + float stepX = model_textureStep.x; + float centerX = model_textureStep.y; + + #ifdef MULTILINE_BATCH_TEXTURE + float stepY = model_textureStep.z; + float centerY = model_textureStep.w; + + float xId = mod(featureId, model_textureDimensions.x); + float yId = floor(featureId / model_textureDimensions.x); + + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); + #else + return vec2(centerX + (featureId * stepX), 0.5); + #endif +} + +void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) +{ + int featureId = featureIds.SELECTED_FEATURE_ID; + + + if (featureId < model_featuresLength) + { + vec2 featureSt = computeSt(float(featureId)); + + feature.id = featureId; + feature.st = featureSt; + feature.color = texture(model_batchTexture, featureSt); + } + // Floating point comparisons can be unreliable in GLSL, so we + // increment the feature ID to make sure it's always greater + // then the model_featuresLength - a condition we check for in the + // pick ID, to avoid sampling the pick texture if the feature ID is + // greater than the number of features. + else + { + feature.id = model_featuresLength + 1; + feature.st = vec2(0.0); + feature.color = vec4(1.0); + } + + #ifdef HAS_NULL_FEATURE_ID + if (featureId == model_nullFeatureId) { + feature.id = featureId; + feature.st = vec2(0.0); + feature.color = vec4(1.0); + } + #endif +} +`;var vw={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};vw.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=bGe(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),TGe(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===ge.BOTH&&i.addVertexLines(Sw),i.addFragmentLines(Sw)};function Qre(e){return e instanceof bn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Jre(e){return e instanceof bn.FeatureIdTexture?ge.FRAGMENT:ge.BOTH}function bGe(e,t,n){let i,o;return l(t.instances)&&(o=Xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:Jre(o),featureIdDefine:Qre(o)}):(o=Xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:Jre(o),featureIdDefine:Qre(o)})}function TGe(e){e.addStructField(vw.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(vw.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(vw.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Tx=vw;var Bs={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Bs.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",ge.VERTEX),i.addStruct(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",ge.FRAGMENT),i.addStruct(Tx.STRUCT_ID_SELECTED_FEATURE,Tx.STRUCT_NAME_SELECTED_FEATURE,ge.BOTH),i.addFunction(Bs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Bs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,ge.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Bs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.VERTEX),i.addFunction(Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Bs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.FRAGMENT),o.type===gr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,ge.FRAGMENT);let r=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],h=tn.getAttributeLocationCount(f.type),p=f.semantic===At.POSITION,_;h>1?(_=e.attributeIndex,e.attributeIndex+=h):p&&!a?_=0:_=e.attributeIndex++,CGe(e,f,_,h,r,s)}RGe(i,t.attributes),t.primitiveType===Me.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(p2),i.addFragmentLines(m2)};function CGe(e,t,n,i,o,r){let s=e.shaderBuilder,a=Xt.getAttributeInfo(t),c=o&&!r;i>1?SGe(e,t,n,i):EGe(e,t,n,c),wGe(s,a,c),vGe(s,a),l(t.semantic)&&AGe(s,t),DGe(s,a,o),IGe(s,a,c),PGe(s,a)}function AGe(e,t){let{semantic:n,setIndex:i}=t;switch(n){case At.NORMAL:e.addDefine("HAS_NORMALS");break;case At.TANGENT:e.addDefine("HAS_TANGENTS");break;case At.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case At.TEXCOORD:case At.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function EGe(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===At.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===At.POSITION,f=u?0:n,h=tn.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let _=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:_,count:t.count,componentsPerAttribute:h,componentDatatype:X.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function SGe(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,u=tn.getNumberOfComponents(s)/i,f=X.getSizeInBytes(a),h=u*f,p=t.byteStride;for(let _=0;_<i;_++){let m=t.byteOffset+_*h,x={index:n+_,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(x)}}function vGe(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function wGe(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===At.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function DGe(e,t,n){let i=Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function IGe(e,t,n){let i=Bs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function PGe(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function RGe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===At.NORMAL?n=!0:r.semantic===At.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var g2=Bs;var _2=`#ifdef USE_IBL_LIGHTING +vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +{ + #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) + // Environment maps were provided, use them for IBL + vec3 viewDirection = -normalize(position); + vec3 iblColor = textureIBL(viewDirection, normal, material); + return iblColor; + #endif + + return vec3(0.0); +} +#endif + +#ifdef USE_CLEARCOAT +vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +{ + vec3 viewDirection = -normalize(position); + vec3 halfwayDirection = normalize(viewDirection + lightDirection); + vec3 normal = material.clearcoatNormal; + float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0); + + // clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5. + vec3 f0 = vec3(0.04); + vec3 f90 = vec3(1.0); + // Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h). + // This is to make it energy conserving with a simple layering function. + float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); + vec3 F = fresnelSchlick2(f0, f90, NdotV); + + // compute specular reflection from direct lighting + float roughness = material.clearcoatRoughness; + float alphaRoughness = roughness * roughness; + float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness); + vec3 directReflection = F * directStrength * NdotL; + vec3 color = lightColorHdr * directReflection; + + #ifdef SPECULAR_IBL + // Find the direction in which to sample the environment map + vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal)); + vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness); + color += iblColor * material.occlusion; + #endif + + float clearcoatFactor = material.clearcoatFactor; + vec3 clearcoatColor = color * clearcoatFactor; + + // Dim base layer based on transmission loss through clearcoat + return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor; +} +#endif + +#if defined(LIGHTING_PBR) && defined(HAS_NORMALS) +vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position) +{ + #ifdef USE_CUSTOM_LIGHT_COLOR + vec3 lightColorHdr = model_lightColorHdr; + #else + vec3 lightColorHdr = czm_lightColorHdr; + #endif + + vec3 viewDirection = -normalize(position); + vec3 normal = material.normalEC; + vec3 lightDirection = normalize(czm_lightDirectionEC); + + vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material); + vec3 directColor = lightColorHdr * directLighting; + + // Accumulate colors from base layer + vec3 color = directColor + material.emissive; + #ifdef USE_IBL_LIGHTING + color += computeIBL(position, normal, lightDirection, lightColorHdr, material); + #endif + + #ifdef USE_CLEARCOAT + color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material); + #endif + + return color; +} +#endif + +/** + * Compute the material color under the current lighting conditions. + * All other material properties are passed through so further stages + * have access to them. + * + * @param {czm_modelMaterial} material The material properties from {@MaterialStageFS} + * @param {ProcessedAttributes} attributes + */ +void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) +{ + #ifdef LIGHTING_PBR + #ifdef HAS_NORMALS + vec3 color = computePbrLighting(material, attributes.positionEC); + #else + vec3 color = material.diffuse * material.occlusion + material.emissive; + #endif + // In HDR mode, the frame buffer is in linear color space. The + // post-processing stages (see PostProcessStageCollection) will handle + // tonemapping. However, if HDR is not enabled, we must tonemap else large + // values may be clamped to 1.0 + #ifndef HDR + color = czm_pbrNeutralTonemapping(color); + #endif + #else // unlit + vec3 color = material.diffuse; + #endif + + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + // The colors resulting from point cloud styles are adjusted differently. + color = czm_gammaCorrect(color); + #elif !defined(HDR) + // If HDR is not enabled, the frame buffer stores sRGB colors rather than + // linear colors so the linear value must be converted. + color = czm_linearToSrgb(color); + #endif + + material.diffuse = color; +} +`;var OGe={UNLIT:0,PBR:1},Mp=Object.freeze(OGe);var ese={name:"LightingPipelineStage"};ese.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,ge.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",ge.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Mp.PBR?o.addDefine("LIGHTING_PBR",void 0,ge.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,ge.FRAGMENT),o.addFragmentLines(_2)};var y2=ese;var x2=`// If the style color is white, it implies the feature has not been styled. +bool isDefaultStyleColor(vec3 color) +{ + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +} + +vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) +{ + vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); + vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; + return color; +} + +vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform) +{ + return vec2(textureTransform * vec3(texCoord, 1.0)); +} + +#ifdef HAS_NORMAL_TEXTURE +vec2 getNormalTexCoords() +{ + vec2 texCoord = TEXCOORD_NORMAL; + #ifdef HAS_NORMAL_TEXTURE_TRANSFORM + texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0)); + #endif + return texCoord; +} +#endif + +#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE) +vec3 computeTangent(in vec3 position, in vec2 normalTexCoords) +{ + vec2 tex_dx = dFdx(normalTexCoords); + vec2 tex_dy = dFdy(normalTexCoords); + float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y; + vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position); + return tangent / determinant; +} +#endif + +#ifdef USE_ANISOTROPY +struct NormalInfo { + vec3 tangent; + vec3 bitangent; + vec3 normal; + vec3 geometryNormal; +}; + +NormalInfo getNormalInfo(ProcessedAttributes attributes) +{ + vec3 geometryNormal = attributes.normalEC; + #ifdef HAS_NORMAL_TEXTURE + vec2 normalTexCoords = getNormalTexCoords(); + #endif + + #ifdef HAS_BITANGENTS + vec3 tangent = attributes.tangentEC; + vec3 bitangent = attributes.bitangentEC; + #else // Assume HAS_NORMAL_TEXTURE + vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords); + tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent)); + vec3 bitangent = normalize(cross(geometryNormal, tangent)); + #endif + + #ifdef HAS_NORMAL_TEXTURE + mat3 tbn = mat3(tangent, bitangent, geometryNormal); + vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; + normalSample = 2.0 * normalSample - 1.0; + #ifdef HAS_NORMAL_TEXTURE_SCALE + normalSample.xy *= u_normalTextureScale; + #endif + vec3 normal = normalize(tbn * normalSample); + #else + vec3 normal = geometryNormal; + #endif + + #ifdef HAS_DOUBLE_SIDED_MATERIAL + if (czm_backFacing()) { + tangent *= -1.0; + bitangent *= -1.0; + normal *= -1.0; + geometryNormal *= -1.0; + } + #endif + + NormalInfo normalInfo; + normalInfo.tangent = tangent; + normalInfo.bitangent = bitangent; + normalInfo.normal = normal; + normalInfo.geometryNormal = geometryNormal; + + return normalInfo; +} +#endif + +#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) +vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) +{ + vec2 normalTexCoords = getNormalTexCoords(); + + // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set + #ifdef HAS_BITANGENTS + vec3 t = attributes.tangentEC; + vec3 b = attributes.bitangentEC; + #else + vec3 t = computeTangent(attributes.positionEC, normalTexCoords); + t = normalize(t - geometryNormal * dot(geometryNormal, t)); + vec3 b = normalize(cross(geometryNormal, t)); + #endif + + mat3 tbn = mat3(t, b, geometryNormal); + vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; + normalSample = 2.0 * normalSample - 1.0; + #ifdef HAS_NORMAL_TEXTURE_SCALE + normalSample.xy *= u_normalTextureScale; + #endif + return normalize(tbn * normalSample); +} +#endif + +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE +vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) +{ + vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL; + #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM + normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0)); + #endif + + // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set + #ifdef HAS_BITANGENTS + vec3 t = attributes.tangentEC; + vec3 b = attributes.bitangentEC; + #else + vec3 t = computeTangent(attributes.positionEC, normalTexCoords); + t = normalize(t - geometryNormal * dot(geometryNormal, t)); + vec3 b = normalize(cross(geometryNormal, t)); + #endif + + mat3 tbn = mat3(t, b, geometryNormal); + vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb; + normalSample = 2.0 * normalSample - 1.0; + #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE + normalSample.xy *= u_clearcoatNormalTextureScale; + #endif + return normalize(tbn * normalSample); +} +#endif + +#ifdef HAS_NORMALS +vec3 computeNormal(ProcessedAttributes attributes) +{ + // Geometry normal. This is already normalized + vec3 normal = attributes.normalEC; + + #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) + normal = getNormalFromTexture(attributes, normal); + #endif + + #ifdef HAS_DOUBLE_SIDED_MATERIAL + if (czm_backFacing()) { + normal = -normal; + } + #endif + + return normal; +} +#endif + +#ifdef HAS_BASE_COLOR_TEXTURE +vec4 getBaseColorFromTexture() +{ + vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; + #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM + baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); + #endif + + vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); + + #ifdef HAS_BASE_COLOR_FACTOR + baseColorWithAlpha *= u_baseColorFactor; + #endif + + return baseColorWithAlpha; +} +#endif + +#ifdef HAS_EMISSIVE_TEXTURE +vec3 getEmissiveFromTexture() +{ + vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; + #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM + emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); + #endif + + vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); + #ifdef HAS_EMISSIVE_FACTOR + emissive *= u_emissiveFactor; + #endif + + return emissive; +} +#endif + +#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) +void setSpecularGlossiness(inout czm_modelMaterial material) +{ + #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE + vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; + #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM + specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); + #endif + + vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); + vec3 specular = specularGlossiness.rgb; + float glossiness = specularGlossiness.a; + #ifdef HAS_LEGACY_SPECULAR_FACTOR + specular *= u_legacySpecularFactor; + #endif + + #ifdef HAS_GLOSSINESS_FACTOR + glossiness *= u_glossinessFactor; + #endif + #else + #ifdef HAS_LEGACY_SPECULAR_FACTOR + vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0)); + #else + vec3 specular = vec3(1.0); + #endif + + #ifdef HAS_GLOSSINESS_FACTOR + float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); + #else + float glossiness = 1.0; + #endif + #endif + + #ifdef HAS_DIFFUSE_TEXTURE + vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; + #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM + diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); + #endif + + vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); + #ifdef HAS_DIFFUSE_FACTOR + diffuse *= u_diffuseFactor; + #endif + #elif defined(HAS_DIFFUSE_FACTOR) + vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); + #else + vec4 diffuse = vec4(1.0); + #endif + + material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular)); + // the specular glossiness extension's alpha overrides anything set + // by the base material. + material.alpha = diffuse.a; + + material.specular = specular; + + // glossiness is the opposite of roughness, but easier for artists to use. + material.roughness = 1.0 - glossiness; +} +#elif defined(LIGHTING_PBR) +float setMetallicRoughness(inout czm_modelMaterial material) +{ + #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE + vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; + #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM + metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); + #endif + + vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; + float metalness = clamp(metallicRoughness.b, 0.0, 1.0); + float roughness = clamp(metallicRoughness.g, 0.0, 1.0); + #ifdef HAS_METALLIC_FACTOR + metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0); + #endif + + #ifdef HAS_ROUGHNESS_FACTOR + roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0); + #endif + #else + #ifdef HAS_METALLIC_FACTOR + float metalness = clamp(u_metallicFactor, 0.0, 1.0); + #else + float metalness = 1.0; + #endif + + #ifdef HAS_ROUGHNESS_FACTOR + float roughness = clamp(u_roughnessFactor, 0.0, 1.0); + #else + float roughness = 1.0; + #endif + #endif + + // dielectrics use f0 = 0.04, metals use albedo as f0 + const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); + vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness); + + material.specular = f0; + + // diffuse only applies to dielectrics. + material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness); + + // This is perceptual roughness. The square of this value is used for direct lighting + material.roughness = roughness; + + return metalness; +} +#ifdef USE_SPECULAR +void setSpecular(inout czm_modelMaterial material, in float metalness) +{ + #ifdef HAS_SPECULAR_TEXTURE + vec2 specularTexCoords = TEXCOORD_SPECULAR; + #ifdef HAS_SPECULAR_TEXTURE_TRANSFORM + specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform); + #endif + float specularWeight = texture(u_specularTexture, specularTexCoords).a; + #ifdef HAS_SPECULAR_FACTOR + specularWeight *= u_specularFactor; + #endif + #else + #ifdef HAS_SPECULAR_FACTOR + float specularWeight = u_specularFactor; + #else + float specularWeight = 1.0; + #endif + #endif + + #ifdef HAS_SPECULAR_COLOR_TEXTURE + vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; + #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM + specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); + #endif + vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; + vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); + #ifdef HAS_SPECULAR_COLOR_FACTOR + specularColorFactor *= u_specularColorFactor; + #endif + #else + #ifdef HAS_SPECULAR_COLOR_FACTOR + vec3 specularColorFactor = u_specularColorFactor; + #else + vec3 specularColorFactor = vec3(1.0); + #endif + #endif + material.specularWeight = specularWeight; + vec3 f0 = material.specular; + vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0)); + material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness); +} +#endif +#ifdef USE_ANISOTROPY +void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo) +{ + mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x); + float anisotropyStrength = u_anisotropy.z; + + vec2 direction = vec2(1.0, 0.0); + #ifdef HAS_ANISOTROPY_TEXTURE + vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY; + #ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM + anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); + #endif + vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; + direction = anisotropySample.rg * 2.0 - vec2(1.0); + anisotropyStrength *= anisotropySample.b; + #endif + + direction = rotation * direction; + mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal); + vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0)); + vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT); + + material.anisotropicT = anisotropicT; + material.anisotropicB = anisotropicB; + material.anisotropyStrength = anisotropyStrength; +} +#endif +#ifdef USE_CLEARCOAT +void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes) +{ + #ifdef HAS_CLEARCOAT_TEXTURE + vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; + #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM + clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); + #endif + float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; + #ifdef HAS_CLEARCOAT_FACTOR + clearcoatFactor *= u_clearcoatFactor; + #endif + #else + #ifdef HAS_CLEARCOAT_FACTOR + float clearcoatFactor = u_clearcoatFactor; + #else + // PERFORMANCE_IDEA: this case should turn the whole extension off + float clearcoatFactor = 0.0; + #endif + #endif + + #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE + vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; + #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM + clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); + #endif + float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; + #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR + clearcoatRoughness *= u_clearcoatRoughnessFactor; + #endif + #else + #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR + float clearcoatRoughness = u_clearcoatRoughnessFactor; + #else + float clearcoatRoughness = 0.0; + #endif + #endif + + material.clearcoatFactor = clearcoatFactor; + // This is perceptual roughness. The square of this value is used for direct lighting + material.clearcoatRoughness = clearcoatRoughness; + #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE + material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC); + #else + material.clearcoatNormal = attributes.normalEC; + #endif +} +#endif +#endif + +void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) +{ + #ifdef USE_ANISOTROPY + NormalInfo normalInfo = getNormalInfo(attributes); + material.normalEC = normalInfo.normal; + #elif defined(HAS_NORMALS) + material.normalEC = computeNormal(attributes); + #endif + + vec4 baseColorWithAlpha = vec4(1.0); + // Regardless of whether we use PBR, set a base color + #ifdef HAS_BASE_COLOR_TEXTURE + baseColorWithAlpha = getBaseColorFromTexture(); + #elif defined(HAS_BASE_COLOR_FACTOR) + baseColorWithAlpha = u_baseColorFactor; + #endif + + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + baseColorWithAlpha = v_pointCloudColor; + #elif defined(HAS_COLOR_0) + vec4 color = attributes.color_0; + // .pnts files store colors in the sRGB color space + #ifdef HAS_SRGB_COLOR + color = czm_srgbToLinear(color); + #endif + baseColorWithAlpha *= color; + #endif + + #ifdef USE_CPU_STYLING + baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend); + #endif + material.baseColor = baseColorWithAlpha; + material.diffuse = baseColorWithAlpha.rgb; + material.alpha = baseColorWithAlpha.a; + + #ifdef HAS_OCCLUSION_TEXTURE + vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; + #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM + occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); + #endif + material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; + #endif + + #ifdef HAS_EMISSIVE_TEXTURE + material.emissive = getEmissiveFromTexture(); + #elif defined(HAS_EMISSIVE_FACTOR) + material.emissive = u_emissiveFactor; + #endif + + #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) + setSpecularGlossiness(material); + #elif defined(LIGHTING_PBR) + float metalness = setMetallicRoughness(material); + #ifdef USE_SPECULAR + setSpecular(material, metalness); + #endif + #ifdef USE_ANISOTROPY + setAnisotropy(material, normalInfo); + #endif + #ifdef USE_CLEARCOAT + setClearcoat(material, attributes); + #endif + #endif +} +`;var{Material:MGe,MetallicRoughness:hW,SpecularGlossiness:mW,Specular:tse,Clearcoat:nse}=bn,ise={name:"MaterialPipelineStage",_processTexture:Sl,_processTextureTransform:ose};ise.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:h}=n.context;NGe(i,r,s,u,f,h,c),l(i.specularGlossiness)?FGe(i.specularGlossiness,r,s,u,c):(l(i.specular)&&Xt.supportedExtensions.KHR_materials_specular&&BGe(i.specular,r,s,u,c),l(i.anisotropy)&&Xt.supportedExtensions.KHR_materials_anisotropy&&VGe(i.anisotropy,r,s,u,c),l(i.clearcoat)&&Xt.supportedExtensions.KHR_materials_clearcoat&&UGe(i.clearcoat,r,s,u,c),zGe(i.metallicRoughness,r,s,u,c));let p=Xt.getAttributeBySemantic(t,At.NORMAL),_=e.lightingOptions;i.unlit||!p||a?_.lightingModel=Mp.UNLIT:_.lightingModel=Mp.PBR;let m=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=m;let x=e.alphaOptions;i.alphaMode===Sp.BLEND?x.pass=we.TRANSLUCENT:i.alphaMode===Sp.MASK&&(x.alphaCutoff=i.alphaCutoff),s.addFragmentLines(x2),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,ge.BOTH)};function ose(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,ge.FRAGMENT),t[s]=function(){return n.transform}}function LGe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,ge.FRAGMENT),t[s]=function(){return n.scale}}function Sl(e,t,n,i,o,r){e.addUniform("sampler2D",i,ge.FRAGMENT),t[i]=function(){return y(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,ge.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,c,ge.FRAGMENT);let f=n.transform;l(f)&&!$.equals(f,$.IDENTITY)&&ose(e,t,n,i,o);let{scale:h}=n;l(h)&&h!==1&&LGe(e,t,n,i,o)}function NGe(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:u,occlusionTexture:f}=e;l(a)&&!d.equals(a,MGe.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",ge.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,ge.FRAGMENT),l(c)&&!s&&Sl(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(u)&&!s&&Sl(n,t,u,"u_normalTexture","NORMAL",o),l(f)&&!s&&Sl(n,t,f,"u_occlusionTexture","OCCLUSION",i)}function FGe(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,ge.FRAGMENT),l(r)&&!o&&Sl(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!oe.equals(s,mW.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",ge.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,ge.FRAGMENT)),l(a)&&!o&&Sl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!d.equals(c,mW.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",ge.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),l(u)&&u!==mW.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",ge.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,ge.FRAGMENT))}function BGe(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,ge.FRAGMENT),l(r)&&!o&&Sl(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==tse.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",ge.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),l(a)&&!o&&Sl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!d.equals(c,tse.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",ge.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,ge.FRAGMENT))}var kGe=new d;function VGe(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,ge.FRAGMENT),l(a)&&!o&&Sl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",ge.FRAGMENT),t.u_anisotropy=function(){return d.fromElements(c,u,r,kGe)}}function UGe(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,ge.FRAGMENT),l(r)&&r!==nse.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",ge.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,ge.FRAGMENT)),l(s)&&!o&&Sl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==nse.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",ge.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT)),l(c)&&!o&&Sl(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!o&&Sl(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function zGe(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,ge.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&Sl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!oe.equals(s,hW.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",ge.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,ge.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&Sl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==hW.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",ge.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,ge.FRAGMENT));let u=e.roughnessFactor;l(u)&&u!==hW.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",ge.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT))}var b2=ise;var Uc={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};Uc.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Uc.METADATA_PICKING_VALUE_TYPE,"float",ge.FRAGMENT),i.addDefine(Uc.METADATA_PICKING_VALUE_STRING,"0.0",ge.FRAGMENT),i.addDefine(Uc.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",ge.FRAGMENT),i.addDefine(Uc.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",ge.FRAGMENT),i.addDefine(Uc.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",ge.FRAGMENT),i.addDefine(Uc.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",ge.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",ge.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${Uc.METADATA_PICKING_VALUE_TYPE} value = ${Uc.METADATA_PICKING_VALUE_TYPE}(${Uc.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Uc.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Uc.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Uc.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Uc.METADATA_PICKING_VALUE_COMPONENT_W};`],ge.FRAGMENT)};var gf=Uc;var T2=`void morphTargetsStage(inout ProcessedAttributes attributes) +{ + vec3 positionMC = attributes.positionMC; + attributes.positionMC = getMorphedPosition(positionMC); + + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = getMorphedNormal(normalMC); + #endif + + #ifdef HAS_TANGENTS + vec3 tangentMC = attributes.tangentMC; + attributes.tangentMC = getMorphedTangent(tangentMC); + #endif +}`;var Sa={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Sa.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,ge.VERTEX),YGe(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let h=c[f],p=h.semantic;p!==At.POSITION&&p!==At.NORMAL&&p!==At.TANGENT||(GGe(e,h,e.attributeIndex,a),e.attributeIndex++)}}XGe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,ge.VERTEX),n.addVertexLines(T2);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=xt(s,e.uniformMap)};var HGe={attributeString:void 0,functionId:void 0};function GGe(e,t,n,i){let o=e.shaderBuilder;WGe(e,t,n);let r=jGe(t,HGe);qGe(o,r,i)}function WGe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:tn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function jGe(e,t){switch(e.semantic){case At.POSITION:t.attributeString="Position",t.functionId=Sa.FUNCTION_ID_GET_MORPHED_POSITION;break;case At.NORMAL:t.attributeString="Normal",t.functionId=Sa.FUNCTION_ID_GET_MORPHED_NORMAL;break;case At.TANGENT:t.attributeString="Tangent",t.functionId=Sa.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function qGe(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function YGe(e){e.addFunction(Sa.FUNCTION_ID_GET_MORPHED_POSITION,Sa.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,ge.VERTEX),e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Sa.FUNCTION_ID_GET_MORPHED_NORMAL,Sa.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,ge.VERTEX),e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Sa.FUNCTION_ID_GET_MORPHED_TANGENT,Sa.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,ge.VERTEX),e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function XGe(e){e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Sa.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var C2=Sa;var rse={name:"PickingPipelineStage"};rse.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)KGe(e,t,a,i);else if(l(a))ZGe(e,i);else{let c=sse(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",ge.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function sse(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(gr.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function KGe(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Xt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Xt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",ge.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(f.pickTexture,f.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function ZGe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let h=0;h<n;h++){let p=sse(e,h),_=t.createPickId(p);s.push(_),i[h]=_;let m=_.color;o[h*4+0]=z.floatToByte(m.red),o[h*4+1]=z.floatToByte(m.green),o[h*4+2]=z.floatToByte(m.blue),o[h*4+3]=z.floatToByte(m.alpha)}r._pickIds=i;let a=_t.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,ge.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var A2=rse;var $Ge={ADD:0,REPLACE:1},Yo=Object.freeze($Ge);var E2=`float getPointSizeFromAttenuation(vec3 positionEC) { + // Variables are packed into a single vector to minimize gl.uniformXXX() calls + float pointSize = model_pointCloudParameters.x; + float geometricError = model_pointCloudParameters.y; + float depthMultiplier = model_pointCloudParameters.z; + + float depth = -positionEC.z; + return min((geometricError / depth) * depthMultiplier, pointSize); +} + +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); +} +#endif + +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); +} +#endif + +#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + float tiles3d_tileset_time = model_pointCloudParameters.w; + return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); +} +#elif defined(HAS_POINT_CLOUD_ATTENUATION) +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { + return getPointSizeFromAttenuation(v_positionEC); +} +#endif + +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +float pointCloudBackFaceCullingStage() { + #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) + // This needs to be computed in eye coordinates so we can't use attributes.normalMC + return step(-v_normalEC.z, 0.0); + #else + return 1.0; + #endif +} +#endif`;var QGe=new oe,cse={name:"PointCloudStylingPipelineStage"};cse.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(r)&&!u){let x=n5e(a),b=i5e(r,x);o5e(i,b);let C=r5e(b).indexOf("normalMC")>=0,A=Xt.getAttributeBySemantic(t,At.NORMAL);if(C&&!A)throw new re("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ge.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=we.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ge.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ge.VERTEX);let h,p,_;gr.is3DTiles(o.type)&&(p=!0,h=o.content,_=h.tile.refine===Yo.ADD),i.addUniform("vec4","model_pointCloudParameters",ge.VERTEX),i.addVertexLines(E2);let m=e.uniformMap;m.model_pointCloudParameters=function(){let x=QGe,b=1;p&&(b=_?5:h.tileset.memoryAdjustedScreenSpaceError),x.x=y(f.maximumAttenuation,b),x.x*=n.pixelRatio;let T=JGe(e,t,f,h);x.y=T*f.geometricErrorScale;let C=n.context,A=n.camera.frustum,S;return n.mode===ne.SCENE2D||A instanceof nn?S=Number.POSITIVE_INFINITY:S=C.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=S,p&&(x.w=h.tileset.timeSinceLoad),x}};var ase=new d;function JGe(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=Xt.getAttributeBySemantic(t,At.POSITION),r=o.count,s=e.runtimeNode.transform,a=d.subtract(o.max,o.min,ase);a=F.multiplyByPointAsVector(s,a,ase);let c=a.x*a.y*a.z;return P.cbrt(c/r)}var e5e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},t5e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function n5e(e){let t=Ge(t5e);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var pW="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function i5e(e,t){let n=e5e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${pW})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${pW})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${pW})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function o5e(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,ge.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,ge.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,ge.VERTEX),e.addVertexLines(o))}function gW(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function r5e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&gW(t,o),l(n)&&gW(n,o),l(i)&&gW(i,o),o}var S2=cse;var v2=`void primitiveOutlineStage() { + v_outlineCoordinates = a_outlineCoordinates; +} +`;var w2=`void primitiveOutlineStage(inout czm_modelMaterial material) { + if (!model_showOutline) { + return; + } + + float outlineX = + texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; + float outlineY = + texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; + float outlineZ = + texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; + float outlineness = max(outlineX, max(outlineY, outlineZ)); + + material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +} + +`;var lse={name:"PrimitiveOutlinePipelineStage"};lse.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,ge.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:tn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",ge.FRAGMENT);let a=EC.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",ge.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",ge.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(v2),i.addFragmentLines(w2)};var D2=lse;var use={name:"PrimitiveStatisticsPipelineStage",_countGeometry:fse,_count2DPositions:dse,_countMorphTargetAttributes:hse,_countMaterialTextures:mse,_countFeatureIdTextures:pse,_countBinaryMetadata:gse};use.process=function(e,t,n){let i=e.model,o=i.statistics;fse(o,t),dse(o,e.runtimePrimitive),hse(o,t),mse(o,t.material),pse(o,t.featureIds),gse(o,i)};function fse(e,t){let n=l(t.indices)?t.indices.count:Xt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Me.POINTS?e.pointsLength+=n:Me.isTriangles(i)&&(e.trianglesLength+=s5e(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function s5e(e,t){switch(e){case Me.TRIANGLES:return t/3;case Me.TRIANGLE_STRIP:case Me.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function dse(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function hse(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function mse(e,t){let n=a5e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function a5e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function pse(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof bn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function gse(e,t){let n=t.structuralMetadata;l(n)&&(c5e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function c5e(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var I2=use;var l5e=new F,u5e=new F,_se={name:"SceneMode2DPipelineStage"};_se.process=function(e,t,n){let i=Xt.getAttributeBySemantic(t,At.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=F.multiplyTransformation(s,a,l5e),u=h5e(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let h=e.runtimeNode.node.instances;if(l(h))return;if(l(i.typedArray)){let x=g5e(i,c,u,n);f.positionBuffer2D=x,r._modelResources.push(x),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,ge.VERTEX),o.addUniform("mat4","u_modelView2D",ge.VERTEX);let p=F.fromTranslation(u.center,new F),_=n.context,m={u_modelView2D:function(){return F.multiplyTransformation(_.uniformState.view,p,u5e)}};e.uniformMap=xt(m,e.uniformMap)};var f5e=new d,d5e=new d;function h5e(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,f5e),o=zi.computeActualEllipsoidPosition(n,i,i),r=F.multiplyByPoint(t,e.positionMax,d5e),s=zi.computeActualEllipsoidPosition(n,r,r);return ae.fromCornerPoints(o,s,new ae)}var yse=new d;function m5e(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=d.fromArray(e,s,yse),c=d.multiplyComponents(a,r,a),u=d.add(c,o,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function p5e(e,t,n,i){let o;l(e.quantization)?o=m5e(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let u=d.fromArray(o,c,yse);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=F.multiplyByPoint(t,u,u),h=zi.computeActualEllipsoidPosition(i,f,f),p=d.subtract(h,n,h);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function g5e(e,t,n,i){let o=Ge(i);o.mode=ne.COLUMBUS_VIEW;let r=n.center,s=p5e(e,t,r,o),a=_t.createVertexBuffer({context:i.context,typedArray:s,usage:Fe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var P2=_se;var R2=`void skinningStage(inout ProcessedAttributes attributes) +{ + mat4 skinningMatrix = getSkinningMatrix(); + mat3 skinningMatrixMat3 = mat3(skinningMatrix); + + vec4 positionMC = vec4(attributes.positionMC, 1.0); + attributes.positionMC = vec3(skinningMatrix * positionMC); + + #ifdef HAS_NORMALS + vec3 normalMC = attributes.normalMC; + attributes.normalMC = skinningMatrixMat3 * normalMC; + #endif + + #ifdef HAS_TANGENTS + vec3 tangentMC = attributes.tangentMC; + attributes.tangentMC = skinningMatrixMat3 * tangentMC; + #endif +}`;var Cx={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};Cx.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,ge.VERTEX),y5e(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,ge.VERTEX),n.addVertexLines(R2);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=xt(r,e.uniformMap)};function _5e(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===At.JOINTS||r.semantic===At.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function y5e(e,t){e.addFunction(Cx.FUNCTION_ID_GET_SKINNING_MATRIX,Cx.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,ge.VERTEX),e.addFunctionLines(Cx.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=_5e(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(Cx.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(Cx.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var O2=Cx;var M2=`void verticalExaggerationStage( + inout ProcessedAttributes attributes +) { + // Compute the distance from the camera to the local center of curvature. + vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); + vec2 vertexAzimuth = normalize(vertexPositionENU.xy); + // Curvature = 1 / radius of curvature. + float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature); + float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; + + // Compute the approximate ellipsoid normal at the vertex position. + // Uses a circular approximation for the Earth curvature along the geodesic. + vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; + vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; + vec3 vertexNormal = normalize(centerToVertex); + + // Estimate the (sine of the) angle between the camera direction and the vertex normal + float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC); + float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC); + float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance); + bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta; + + // Approximate the change in height above the ellipsoid, from camera to vertex position. + float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal); + float smallAngleVersine = 0.5 * sinTheta * sinTheta; + float versine = isSmallAngle ? smallAngleVersine : exactVersine; + float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine; + float vertexHeight = czm_eyeHeight + dHeight; + + // Transform the approximate vertex normal to model coordinates. + vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz; + vertexNormalMC = normalize(vertexNormalMC); + + // Compute the exaggeration and apply it along the approximate vertex normal. + float stretch = u_verticalExaggerationAndRelativeHeight.x; + float shift = u_verticalExaggerationAndRelativeHeight.y; + float exaggeration = (vertexHeight - shift) * (stretch - 1.0); + attributes.positionMC += exaggeration * vertexNormalMC; +} +`;var xse={name:"VerticalExaggerationPipelineStage"},x5e=new U;xse.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(M2),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,ge.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",ge.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return U.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,x5e)}};var L2=xse;var _W={};function b5e(e){let t=Ne.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function T5e(e,t){let n=t.length,i=Ne.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function C5e(e){let t=e-2,n=2+t*4,i=Ne.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function A5e(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=c}return r}function E5e(e){let t=e-2,n=2+t*4,i=Ne.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function S5e(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}_W.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Me.TRIANGLES)return i?T5e(t,n):b5e(t);if(e===Me.TRIANGLE_STRIP)return i?A5e(t,n):C5e(t);if(e===Me.TRIANGLE_FAN)return i?S5e(t,n):E5e(t)};_W.getWireframeIndicesCount=function(e,t){return e===Me.TRIANGLES?t*2:e===Me.TRIANGLE_STRIP||e===Me.TRIANGLE_FAN?2+(t-2)*4:t};var ww=_W;var bse={name:"WireframePipelineStage"};bse.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,ge.FRAGMENT);let o=e.model,r=v5e(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Me.LINES,e.count=ww.getWireframeIndicesCount(a,c)};function v5e(e,t,n){let o=Xt.getAttributeBySemantic(e,At.POSITION).count,r=n.context.webgl2,s;if(l(t)){let f=t.buffer,h=t.count;l(f)&&r?(s=f.sizeInBytes===h?new Uint8Array(h):Ne.createTypedArray(o,h),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=ww.createWireframeIndices(a,o,s),u=Ne.fromSizeInBytes(c.BYTES_PER_ELEMENT);return _t.createIndexBuffer({context:n.context,typedArray:c,usage:Fe.STATIC_DRAW,indexDatatype:u})}var N2=bse;function Tse(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}Tse.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,u=e.mode!==ne.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),_=l(r),x=!(_&&l(r.fragmentShaderText))||r.mode!==B_.REPLACE_MATERIAL,b=Xt.hasQuantizedAttributes(n.attributes),T=o.debugWireframe&&Me.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),C=o.pointCloudShading,A=l(C)&&C.attenuation,S=l(C)&&C.backFaceCulling,v=n.primitiveType===Me.POINTS&&(l(s)||A||S),D=o._enableShowOutline&&l(n.outlineCoordinates),O=w5e(o,i,n),R=l(o.classificationType);u&&t.push(P2),t.push(g2),T&&t.push(N2),R&&t.push(n2),h&&t.push(C2),p&&t.push(O2),v&&t.push(S2),b&&t.push(h2),x&&t.push(b2),t.push(xx),t.push(Ed),t.push(gf),O.hasPropertyTable&&(t.push(Tx),t.push(t2),t.push(r2)),f&&t.push(L2),_&&t.push(d2),t.push(y2),o.allowPicking&&t.push(A2),D&&t.push(D2),t.push(e2),t.push(I2)};function w5e(e,t,n){let i;return l(t.instances)&&(i=Xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var F2=Tse;function yW(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],D5e(this)}Object.defineProperties(yW.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function D5e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let u=i[c].index,f=r[u];s.push(f);let h=n[c],p=Cse(f,h,new F);a.push(p)}}function Cse(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}yW.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=Cse(i,o,e[n])}};var B2=yW;function I5e(){this.pass=void 0,this.alphaCutoff=void 0}var k2=I5e;function P5e(e){this.shaderBuilder=new vT,this.model=e,this.uniformMap={},this.alphaOptions=new k2,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var V2=P5e;var U2=`void silhouetteStage(inout vec4 color) { + if(model_silhouettePass) { + color = czm_gammaCorrect(model_silhouetteColor); + } +}`;var z2=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { + #ifdef HAS_NORMALS + if(model_silhouettePass) { + vec3 normal = normalize(czm_normal3D * attributes.normalMC); + normal.x *= czm_projection[0][0]; + normal.y *= czm_projection[1][1]; + positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; + } + #endif +} +`;var H2={name:"ModelSilhouettePipelineStage"};H2.silhouettesLength=0;H2.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++H2.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,ge.BOTH),i.addVertexLines(z2),i.addFragmentLines(U2),i.addUniform("vec4","model_silhouetteColor",ge.FRAGMENT),i.addUniform("float","model_silhouetteSize",ge.VERTEX),i.addUniform("bool","model_silhouettePass",ge.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=xt(o,e.uniformMap),e.hasSilhouette=!0};var G2=H2;var W2=`void modelSplitterStage() +{ + // Don't split when rendering the shadow map, because it is rendered from + // the perspective of a totally different camera. +#ifndef SHADOW_MAP + if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; + if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +#endif +} +`;var j2={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};j2.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ge.FRAGMENT),i.addFragmentLines(W2);let o={};i.addUniform("float",j2.SPLIT_DIRECTION_UNIFORM_NAME,ge.FRAGMENT),o[j2.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=xt(o,e.uniformMap)};var q2=j2;function R5e(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ge(e.uniformMap),this.alphaOptions=Ge(e.alphaOptions),this.renderStateOptions=Ge(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var Y2=R5e;function O5e(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,Mp.UNLIT)}var X2=O5e;function M5e(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ge(e.uniformMap),this.alphaOptions=Ge(e.alphaOptions),this.renderStateOptions=Ge(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Xt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Xt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=d.clone(i.min,new d),this.positionMax=d.clone(i.max,new d),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new X2,this.pickId=void 0}var K2=M5e;function bW(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==kn.CESIUM_3D_TILE,this._classifies3DTiles=o!==kn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],B5e(this)}function L5e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ut.KEEP,zFail:ut.DECREMENT_WRAP,zPass:ut.KEEP},backFunction:e,backOperation:{fail:ut.KEEP,zFail:ut.INCREMENT_WRAP,zPass:ut.KEEP},reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},depthMask:!1}}var N5e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND},F5e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ut.ZERO,zFail:ut.ZERO,zPass:ut.ZERO},reference:0,mask:Vt.CLASSIFICATION_MASK},stencilMask:Vt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Sse=[];function B5e(e){let t=e._command,n=Sse;if(e._useDebugWireframe){t.pass=we.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=Dw(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=we.TERRAIN_CLASSIFICATION,s=xW(t,r),a=Ase(t,r);n.length=0,n.push(s,a),e._commandListTerrain=Dw(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Ese(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=we.CESIUM_3D_TILE_CLASSIFICATION,s=xW(t,r),a=Ase(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=Dw(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Ese(e,n,e._commandList3DTilesPicking))}}function Dw(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let u=o[c],f=r[c];for(let h=0;h<a;h++){let p=t[h],_=$e.shallowClone(p);_.count=u,_.offset=f,n.push(_)}}return n}function xW(e,t){let n=$e.shallowClone(e);n.cull=!1,n.pass=t;let i=t===we.TERRAIN_CLASSIFICATION?Vn.ALWAYS:Vn.EQUAL,o=L5e(i);return n.renderState=Ve.fromCache(o),n}function Ase(e,t){let n=$e.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ve.fromCache(N5e),n}var k5e=[];function Ese(e,t,n){let i=Ve.fromCache(F5e),o=t[0],r=t[1],s=$e.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=$e.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=k5e;return c.length=0,c.push(s,a),Dw(e,c,n)}Object.defineProperties(bW.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ae.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});bW.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=xW(this._command,o),s=Sse;s.length=0,s.push(r),this._commandListIgnoreShow=Dw(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var Z2=bW;function $2(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===we.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,h=c;this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=ae.clone(t.boundingVolume),this._modelMatrix2D=new F,this._boundingVolume2D=new ae,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=h,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,V5e(this)}function Lp(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}Lp.clone=function(e){return new Lp({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function V5e(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new Lp({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Lp({command:q5e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Lp({command:Q5e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Lp({command:J5e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Lp({command:Y5e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Lp({command:X5e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties($2.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ae.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,z5e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,H5e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,G5e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,W5e(this))}}});function U5e(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ae.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function z5e(e){let t=e.shadows,n=xn.castShadows(t),i=xn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function H5e(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=Ge(r.renderState,!0);s.cull.enabled=t,r.renderState=Ve.fromCache(s)}}}function G5e(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=Ge(r.renderState,!0);s.cull.face=t,r.renderState=Ve.fromCache(s)}}}function W5e(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}$2.prototype.pushCommands=function(e,t){let n=vse(this,e);n&&!this._has2DCommands&&(j5e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(U5e(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==em.ALL_OPAQUE&&VC(t,this._translucentCommand,n),i===em.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||VC(o._backfaceCommands,this._skipLodBackfaceCommand,n),K5e(this,r,n),VC(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){VC(t,this._silhouetteModelCommand,n);return}return VC(t,this._originalCommand,n),t}};$2.prototype.pushSilhouetteCommands=function(e,t){let n=vse(this,e);return VC(t,this._silhouetteColorCommand,n),t};function VC(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function vse(e,t){if(t.mode!==ne.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*P.PI;return o<s&&r>s||o<-s&&r>-s}function kC(e,t){if(!l(t))return;let n=Lp.clone(t),i=$e.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function j5e(e){kC(e,e._originalCommand),kC(e,e._translucentCommand),kC(e,e._skipLodBackfaceCommand),kC(e,e._skipLodStencilCommand),kC(e,e._silhouetteModelCommand),kC(e,e._silhouetteColorCommand)}function q5e(e){let t=$e.shallowClone(e);t.pass=we.TRANSLUCENT;let n=Ge(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=ln.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function Y5e(e,t){let n=t._silhouetteId%255,i=$e.shallowClone(e),o=Ge(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function X5e(e,t){let n=t._silhouetteId%255,i=$e.shallowClone(e),o=Ge(e.renderState,!0);o.cull.enabled=!1,(e.pass===we.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=we.TRANSLUCENT,o.depthMask=!1,o.blending=ln.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ge(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function K5e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=Z5e(o);if(r!==s){let a=$5e(r),c=Ge(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ve.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Z5e(e){return(e.renderState.stencilTest.reference&Vt.SKIP_LOD_MASK)>>>Vt.SKIP_LOD_BIT_SHIFT}function $5e(e){return Vt.CESIUM_3D_TILE_MASK|e<<Vt.SKIP_LOD_BIT_SHIFT}function Q5e(e){let t=$e.shallowClone(e),n=Ge(e.renderState,!0);n.cull.enabled=!0,n.cull.face=bi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ge(t.uniformMap),o=new U(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ve.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function J5e(e){let t=$e.shallowClone(e),n=Ge(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Vt.SKIP_LOD_MASK,i.reference=Vt.CESIUM_3D_TILE_MASK,i.frontFunction=Vn.GREATER_OR_EQUAL,i.frontOperation.zPass=ut.REPLACE,i.backFunction=Vn.GREATER_OR_EQUAL,i.backOperation.zPass=ut.REPLACE,n.stencilMask=Vt.CESIUM_3D_TILE_MASK|Vt.SKIP_LOD_MASK,t.renderState=Ve.fromCache(n),t}var Q2=$2;var J2=`precision highp float; + +czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { + czm_modelVertexOutput vsOutput; + vsOutput.positionMC = positionMC; + vsOutput.pointSize = 1.0; + return vsOutput; +} + +void main() +{ + // Initialize the attributes struct with all + // attributes except quantized ones. + ProcessedAttributes attributes; + initializeAttributes(attributes); + + // Dequantize the quantized ones and add them to the + // attributes struct. + #ifdef USE_DEQUANTIZATION + dequantizationStage(attributes); + #endif + + #ifdef HAS_MORPH_TARGETS + morphTargetsStage(attributes); + #endif + + #ifdef HAS_SKINNING + skinningStage(attributes); + #endif + + #ifdef HAS_PRIMITIVE_OUTLINE + primitiveOutlineStage(); + #endif + + // Compute the bitangent according to the formula in the glTF spec. + // Normal and tangents can be affected by morphing and skinning, so + // the bitangent should not be computed until their values are finalized. + #ifdef HAS_BITANGENTS + attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); + #endif + + FeatureIds featureIds; + featureIdStage(featureIds, attributes); + + #ifdef HAS_SELECTED_FEATURE_ID + SelectedFeature feature; + selectedFeatureIdStage(feature, featureIds); + // Handle any show properties that come from the style. + cpuStylingStage(attributes.positionMC, feature); + #endif + + #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) + // The scene mode 2D pipeline stage and instancing stage add a different + // model view matrix to accurately project the model to 2D. However, the + // output positions and normals should be transformed by the 3D matrices + // to keep the data the same for the fragment shader. + mat4 modelView = czm_modelView3D; + mat3 normal = czm_normal3D; + #else + // These are used for individual model projection because they will + // automatically change based on the scene mode. + mat4 modelView = czm_modelView; + mat3 normal = czm_normal; + #endif + + // Update the position for this instance in place + #ifdef HAS_INSTANCING + + // The legacy instance stage is used when rendering i3dm models that + // encode instances transforms in world space, as opposed to glTF models + // that use EXT_mesh_gpu_instancing, where instance transforms are encoded + // in object space. + #ifdef USE_LEGACY_INSTANCING + mat4 instanceModelView; + mat3 instanceModelViewInverseTranspose; + + legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); + + modelView = instanceModelView; + normal = instanceModelViewInverseTranspose; + #else + instancingStage(attributes); + #endif + + #ifdef USE_PICKING + v_pickColor = a_pickColor; + #endif + + #endif + + Metadata metadata; + MetadataClass metadataClass; + MetadataStatistics metadataStatistics; + metadataStage(metadata, metadataClass, metadataStatistics, attributes); + + #ifdef HAS_VERTICAL_EXAGGERATION + verticalExaggerationStage(attributes); + #endif + + #ifdef HAS_CUSTOM_VERTEX_SHADER + czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); + customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); + #endif + + // Compute the final position in each coordinate system needed. + // This returns the value that will be assigned to gl_Position. + vec4 positionClip = geometryStage(attributes, modelView, normal); + + // This must go after the geometry stage as it needs v_positionWC + #ifdef HAS_ATMOSPHERE + atmosphereStage(attributes); + #endif + + #ifdef ENABLE_CLIPPING_POLYGONS + modelClippingPolygonsStage(attributes); + #endif + + #ifdef HAS_SILHOUETTE + silhouetteStage(attributes, positionClip); + #endif + + #ifdef HAS_POINT_CLOUD_SHOW_STYLE + float show = pointCloudShowStylingStage(attributes, metadata); + #else + float show = 1.0; + #endif + + #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING + show *= pointCloudBackFaceCullingStage(); + #endif + + #ifdef HAS_POINT_CLOUD_COLOR_STYLE + v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); + #endif + + #ifdef PRIMITIVE_TYPE_POINTS + #ifdef HAS_CUSTOM_VERTEX_SHADER + gl_PointSize = vsOutput.pointSize; + #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) + gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); + #else + gl_PointSize = 1.0; + #endif + + gl_PointSize *= show; + #endif + + // Important NOT to compute gl_Position = show * positionClip or we hit: + // https://github.com/CesiumGS/cesium/issues/11270 + // + // We will discard points with v_pointCloudShow == 0 in the fragment shader. + gl_Position = positionClip; + + #ifdef HAS_POINT_CLOUD_SHOW_STYLE + v_pointCloudShow = show; + #endif +} +`;var eB=` +precision highp float; +czm_modelMaterial defaultModelMaterial() +{ + czm_modelMaterial material; + material.diffuse = vec3(0.0); + material.specular = vec3(1.0); + material.roughness = 1.0; + material.occlusion = 1.0; + material.normalEC = vec3(0.0, 0.0, 1.0); + material.emissive = vec3(0.0); + material.alpha = 1.0; + return material; +} + +vec4 handleAlpha(vec3 color, float alpha) +{ + #ifdef ALPHA_MODE_MASK + if (alpha < u_alphaCutoff) { + discard; + } + #endif + + return vec4(color, alpha); +} + +SelectedFeature selectedFeature; + +void main() +{ + #ifdef HAS_POINT_CLOUD_SHOW_STYLE + if (v_pointCloudShow == 0.0) + { + discard; + } + #endif + + #ifdef HAS_MODEL_SPLITTER + modelSplitterStage(); + #endif + + czm_modelMaterial material = defaultModelMaterial(); + + ProcessedAttributes attributes; + geometryStage(attributes); + + FeatureIds featureIds; + featureIdStage(featureIds, attributes); + + Metadata metadata; + MetadataClass metadataClass; + MetadataStatistics metadataStatistics; + metadataStage(metadata, metadataClass, metadataStatistics, attributes); + + //======================================================================== + // When not picking metadata START + #ifndef METADATA_PICKING_ENABLED + + #ifdef HAS_SELECTED_FEATURE_ID + selectedFeatureIdStage(selectedFeature, featureIds); + #endif + + #ifndef CUSTOM_SHADER_REPLACE_MATERIAL + materialStage(material, attributes, selectedFeature); + #endif + + #ifdef HAS_CUSTOM_FRAGMENT_SHADER + customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); + #endif + + lightingStage(material, attributes); + + #ifdef HAS_SELECTED_FEATURE_ID + cpuStylingStage(material, selectedFeature); + #endif + + #ifdef HAS_MODEL_COLOR + modelColorStage(material); + #endif + + #ifdef HAS_PRIMITIVE_OUTLINE + primitiveOutlineStage(material); + #endif + + vec4 color = handleAlpha(material.diffuse, material.alpha); + + // When not picking metadata END + //======================================================================== + #else + //======================================================================== + // When picking metadata START + + vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0); + metadataPickingStage(metadata, metadataClass, metadataValues); + vec4 color = metadataValues; + + #endif + // When picking metadata END + //======================================================================== + + #ifdef HAS_CLIPPING_PLANES + modelClippingPlanesStage(color); + #endif + + #ifdef ENABLE_CLIPPING_POLYGONS + modelClippingPolygonsStage(); + #endif + + //======================================================================== + // When not picking metadata START + #ifndef METADATA_PICKING_ENABLED + + #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) + silhouetteStage(color); + #endif + + #ifdef HAS_ATMOSPHERE + atmosphereStage(color, attributes); + #endif + + #endif + // When not picking metadata END + //======================================================================== + + out_FragColor = color; +} +`;function wse(){}wse.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=e6e(e,n,t),o=t6e(e,i,t),r=e.model;return l(r.classificationType)?new Z2({primitiveRenderResources:e,command:o}):new Q2({primitiveRenderResources:e,command:o})};function e6e(e,t,n){t.addVertexLines(J2),t.addFragmentLines(eB);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function t6e(e,t,n){let i=n6e(e),o=new ni({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,c=n.mode===ne.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&r._projectTo2D)u=F.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new F),f=e.runtimePrimitive.boundingSphere2D;else{let T=c?a._computedModelMatrix:a._computedModelMatrix2D;u=F.multiplyTransformation(T,e.runtimeNode.computedTransform,new F),f=ae.transform(e.boundingSphere,u)}let h=Ge(Ve.fromCache(e.renderStateOptions),!0);h.cull.face=Xt.getCullFace(u,e.primitiveType),h=Ve.fromCache(h);let p=l(r.classificationType),_=p?!1:xn.castShadows(r.shadows),m=p?!1:xn.receiveShadows(r.shadows),x=p?void 0:e.pickId;return new $e({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:x,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:_,receiveShadows:m})}function n6e(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var tB=wse;function lu(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=Xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},i6e(this)}Object.defineProperties(lu.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function i6e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Dse(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let C=0;C<s;C++){let A=r[C],S=new kF({articulation:A,sceneGraph:e}),v=S.name;a[v]=S}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let h=n.nodes.length,p=F.IDENTITY;for(let C=0;C<h;C++){let A=n.nodes[C],S=Ise(e,A,p);e._rootNodes.push(S)}let _=t.skins,m=e._runtimeSkins,x=_.length;for(let C=0;C<x;C++){let A=_[C];m.push(new B2({skin:A,sceneGraph:e}))}let b=e._skinnedNodes,T=b.length;for(let C=0;C<T;C++){let A=b[C],S=e._runtimeNodes[A],D=c[A].skin.index;S._runtimeSkin=m[D],S.updateJointMatrices()}e.applyArticulations()}function Dse(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var o6e=new d;function r6e(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,o6e);if(!d.equals(i,d.ZERO))e._computedModelMatrix2D=Ot.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Ot.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ae.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Ise(e,t,n){let i=[],o=Xt.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let h=t.children[f],p=F.multiplyTransformation(n,o,new F),_=Ise(e,h,p);i.push(_)}let s=new JF({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new F2({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,h=new jF(f,s);f._nodesByName[u]=h}return c}var s6e=new d,a6e=new d,c6e=new d,l6e=new d;lu.prototype.buildDrawCommands=function(e){let t=this._model,n=new V2(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,s6e),c=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,a6e);for(o=0;o<this._runtimeNodes.length;o++){let u=this._runtimeNodes[o];if(!l(u))continue;u.configurePipeline();let f=u.pipelineStages,h=new Y2(n,u);for(r=0;r<f.length;r++)f[r].process(h,u.node,e);let p=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){let _=u.runtimePrimitives[r];_.configurePipeline(e);let m=_.pipelineStages,x=new K2(h,_);for(s=0;s<m.length;s++)m[s].process(x,_.primitive,e);_.boundingSphere=ae.clone(x.boundingSphere,new ae);let b=F.multiplyByPoint(p,x.positionMin,c6e),T=F.multiplyByPoint(p,x.positionMax,l6e);d.minimumByComponent(a,b,a),d.maximumByComponent(c,T,c);let C=tB.buildModelDrawCommand(x,e);_.drawCommand=C}}this._boundingSphere=ae.fromCornerPoints(a,c,new ae),this._boundingSphere=ae.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ae.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ae.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};lu.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;l(n.color)&&t.push(yx),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(NF),n.isClippingEnabled()&&t.push(zF),n.isClippingPolygonsEnabled()&&t.push(WF),n.hasSilhouette(e)&&t.push(G2),l(n.splitDirection)&&n.splitDirection!==Gr.NONE&&t.push(q2),gr.is3DTiles(n.type)&&t.push(PF),i&&t.push(MF))};lu.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==ne.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};lu.prototype.updateModelMatrix=function(e,t){Dse(this,e),t.mode!==ne.SCENE3D&&r6e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};lu.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function Pse(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);Pse(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,o)}}function nB(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];Pse(e,c,t,n,i)}}var u6e={backFaceCulling:void 0};lu.prototype.updateBackFaceCulling=function(e){let t=u6e;t.backFaceCulling=e,nB(this,!1,f6e,t)};function f6e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var d6e={shadowMode:void 0};lu.prototype.updateShadows=function(e){let t=d6e;t.shadowMode=e,nB(this,!1,h6e,t)};function h6e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var m6e={debugShowBoundingVolume:void 0};lu.prototype.updateShowBoundingVolume=function(e){let t=m6e;t.debugShowBoundingVolume=e,nB(this,!1,p6e,t)};function p6e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Rse=[],g6e={frameState:void 0,hasSilhouette:void 0};lu.prototype.pushDrawCommands=function(e){let t=Rse;t.length=0;let n=g6e;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,nB(this,!0,_6e,n),e.commandList.push.apply(e.commandList,t)};function _6e(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Rse,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}lu.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};lu.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var iB=lu;function k_(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new St}Object.defineProperties(k_.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});k_.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};k_.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};k_.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};k_.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};k_.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};k_.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var oB=k_;var Nse=Ur(XP(),1);var Ose={},Ax=Uint32Array.BYTES_PER_ELEMENT;Ose.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=Ax;let o=i.getUint32(t,!0);if(o!==1)throw new re(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=Ax,t+=Ax;let r=i.getUint32(t,!0);if(r===0)throw new re("Feature table must have a byte length greater than zero");t+=Ax;let s=i.getUint32(t,!0);t+=Ax;let a=i.getUint32(t,!0);t+=Ax;let c=i.getUint32(t,!0);t+=Ax;let u=Bo(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let h,p;a>0&&(h=Bo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let _=new Qh(u,f),m=_.getGlobalProperty("POINTS_LENGTH");if(_.featuresLength=m,!l(m))throw new re("Feature table global property: POINTS_LENGTH must be defined");let x=_.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(x)&&(x=d.unpack(x));let b=y6e(_,h);if(b.rtcCenter=x,b.pointsLength=m,!b.hasPositions){let T=x6e(_);b.positions=T,b.hasPositions=b.hasPositions||l(T)}if(!b.hasPositions)throw new re("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let T=T6e(_);b.normals=T,b.hasNormals=b.hasNormals||l(T)}if(!b.hasColors){let T=b6e(_);b.colors=T,b.hasColors=b.hasColors||l(T),b.hasConstantColor=l(b.constantColor),b.isTranslucent=l(T)&&T.isTranslucent}if(!b.hasBatchIds){let T=C6e(_);b.batchIds=T,b.hasBatchIds=b.hasBatchIds||l(T)}if(b.hasBatchIds){let T=_.getGlobalProperty("BATCH_LENGTH");if(!l(T))throw new re("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=T}return l(p)&&(p=new Uint8Array(p),b.batchTableJson=h,b.batchTableBinary=p),b};function y6e(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,u,f,h,p;if(l(s)){o=s.properties;let m=s.byteOffset,x=s.byteLength;if(!l(o)||!l(m)||!l(x))throw new re("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+x),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),h=l(o.BATCH_ID),p=l(o.RGBA)}let _;return l(i)&&(_={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:xt(o,r),dequantizeInShader:!0}),{draco:_,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:h}}function x6e(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",X.FLOAT,3),{name:At.POSITION,semantic:At.POSITION,typedArray:n,isQuantized:!1,componentDatatype:X.FLOAT,type:tn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(i))throw new re("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(r))throw new re("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:At.POSITION,semantic:At.POSITION,typedArray:n,isQuantized:!0,componentDatatype:X.FLOAT,type:tn.VEC3,quantizedRange:o,quantizedVolumeOffset:d.unpack(r),quantizedVolumeScale:d.unpack(i),quantizedComponentDatatype:X.UNSIGNED_SHORT,quantizedType:tn.VEC3}}}function b6e(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",X.UNSIGNED_BYTE,4),{name:At.COLOR,semantic:At.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:tn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",X.UNSIGNED_BYTE,3),{name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:tn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",X.UNSIGNED_SHORT,1),{name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n,componentDatatype:X.FLOAT,type:tn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",X.UNSIGNED_BYTE,4),o=i[3],r=z.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:At.COLOR,semantic:At.COLOR,setIndex:0,constantColor:r,componentDatatype:X.FLOAT,type:tn.VEC4,isQuantized:!1,isTranslucent:s}}}function T6e(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",X.FLOAT,3),{name:At.NORMAL,semantic:At.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:X.FLOAT,type:tn.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",X.UNSIGNED_BYTE,2),{name:At.NORMAL,semantic:At.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:tn.VEC2,quantizedComponentDatatype:X.UNSIGNED_BYTE,componentDatatype:X.FLOAT,type:tn.VEC3}}function C6e(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",X.UNSIGNED_SHORT,1);return{name:At.FEATURE_ID,semantic:At.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:X.fromTypedArray(n),type:tn.SCALAR}}}var UC=Ose;var A6e=bn.Components,E6e=bn.Scene,S6e=bn.Node,v6e=bn.Primitive,w6e=bn.Attribute,Mse=bn.Quantization,D6e=bn.FeatureIdAttribute,I6e=bn.Material,P6e=bn.MetallicRoughness;function V_(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=pt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(V_.prototype=Object.create(Ki.prototype),V_.prototype.constructor=V_);Object.defineProperties(V_.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});V_.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=UC.parse(this._arrayBuffer,this._byteOffset),this._state=pt.PROCESSING,this._promise=Promise.resolve(this)};V_.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===pt.READY)return!0;if(this._state===pt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=R6e(this,e.context)}return!1};function R6e(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=h_.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&O6e(e,i,r),G6e(e,t),e._state=pt.READY,e}).catch(function(r){e.unload(),e._state=pt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function O6e(e,t,n){e._state=pt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:At.POSITION,typedArray:n.POSITION.array,componentDatatype:X.FLOAT,type:tn.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=d.fromElements(c,c,c),f=d.unpack(a.minValues),h=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=h<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT,o.quantizedType=tn.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:At.NORMAL,typedArray:n.NORMAL.array,componentDatatype:X.FLOAT,type:tn.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=X.UNSIGNED_BYTE,o.quantizedType=tn.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:X.UNSIGNED_BYTE,type:tn.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:At.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:X.UNSIGNED_BYTE,type:tn.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:At.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:X.fromTypedArray(a),type:tn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let u=c.data;r[a]={byteOffset:u.byteOffset,type:M6e(u.componentsPerAttribute),componentType:L6e(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function M6e(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function L6e(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function Iw(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Mse,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Mse;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=d.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=d.divideByScalar(c,a,new d),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new w6e;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=y(t.normalized,!1),r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Ln.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=z.pack(t.constantColor,a)}else{let a=_t.createVertexBuffer({typedArray:i,context:n,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===At.POSITION&&s&&(r.typedArray=i),r}var Lse,rB;function N6e(e){if(!l(rB)){Lse=new Nse.default(0),rB=new Array(e);for(let t=0;t<e;++t)rB[t]=Lse.random()}return rB}var F6e=new d,B6e=new d,k6e=new d;function V6e(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=N6e(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=d.fromElements(s,s,s,F6e),u=d.fromElements(a,a,a,B6e),f,h,p;if(e.isQuantized)c=d.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)h=Math.floor(r[f]*i),p=d.unpack(t,h*3,k6e),d.minimumByComponent(c,p,c),d.maximumByComponent(u,p,u);e.min=d.clone(c),e.max=d.clone(u)}var U6e={name:At.COLOR,semantic:At.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:X.FLOAT,type:tn.VEC4,isQuantized:!1,isTranslucent:!1};function z6e(e,t,n){let i=[],o,r=t.positions;return l(r)&&(V6e(r),o=Iw(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=Iw(e,t.normals,n),i.push(o)),l(t.colors)?(o=Iw(e,t.colors,n),i.push(o)):(o=Iw(e,U6e,n),i.push(o)),l(t.batchIds)&&(o=Iw(e,t.batchIds,n),i.push(o)),i}function H6e(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);if(l(o)||e.hasDracoBatchTable){let s=y(n,i);return O_({count:s,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t})}return new na({schema:{},propertyTables:[]})}function G6e(e,t){let n=e._parsedContent,i=new P6e;i.metallicFactor=0,i.roughnessFactor=.9;let o=new I6e;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=Sp.BLEND);let s=!l(n.normals);o.unlit=s;let a=new v6e;if(a.attributes=z6e(e,n,t),a.primitiveType=Me.POINTS,a.material=o,l(n.batchIds)){let _=new D6e;_.propertyTableId=0,_.setIndex=0,_.positionalLabel="featureId_0",a.featureIds.push(_)}let c=new S6e;c.index=0,c.primitives=[a];let u=new E6e;u.nodes=[c],u.upAxis=Fo.Z,u.forwardAxis=Fo.X;let f=new A6e;f.scene=u,f.nodes=[c];let h=[];f.structuralMetadata=H6e(n,h),h.length>0&&W6e(e,a,h,t),l(n.rtcCenter)&&(f.transform=F.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=F.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function W6e(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=_t.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Fe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}V_.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var sB=V_;var j6e=new d,q6e=new d,Y6e=new d,X6e=new F,K6e=new F,Z6e=new F,$6e=new fe,Q6e=new ae;function Pw(e,t,n,i,o,r,s){if(!e._ready||n.mode===ne.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,u=c._runtimeNodes;for(let f=0;f<u.length;f++){let h=u[f],p=h.node,_=F.clone(h.computedTransform,X6e),m=F.clone(c.computedModelMatrix,K6e),x=p.instances;l(x)&&x.transformInWorldSpace&&(m=F.multiplyTransformation(e.modelMatrix,c.components.transform,m),_=F.multiplyTransformation(c.axisCorrectionMatrix,h.computedTransform,_));let b=F.multiplyTransformation(m,_,Z6e);n.mode!==ne.SCENE3D&&(b=Ot.basisTo2D(n.mapProjection,b,b));let T=[];if(l(x)){let A=x.attributes[0].count,S=x.attributes[0].componentDatatype,v=12,D=h.transformsTypedArray;if(!l(D)){let O=h.instancingTransformsBuffer;l(O)&&n.context.webgl2&&(D=X.createTypedArray(S,A*v),O.getBufferData(D))}if(l(D))for(let O=0;O<A;O++){let R=O*v,M=new F(D[R],D[R+1],D[R+2],D[R+3],D[R+4],D[R+5],D[R+6],D[R+7],D[R+8],D[R+9],D[R+10],D[R+11],0,0,0,1);x.transformInWorldSpace?(F.multiplyTransformation(M,_,M),F.multiplyTransformation(m,M,M)):F.multiplyTransformation(M,b,M),T.push(M)}}T.length===0&&T.push(b);let C=h.runtimePrimitives.length;for(let A=0;A<C;A++){let S=h.runtimePrimitives[A],v=S.primitive;if(l(S.boundingSphere)&&!l(x)){let Y=ae.transform(S.boundingSphere,b,Q6e),J=Qn.raySphere(t,Y);if(!l(J))continue}let D=Xt.getAttributeBySemantic(v,At.POSITION),O=D.byteOffset,R=D.byteStride,M=D.count;if(!l(v.indices))continue;let L=v.indices.typedArray;if(!l(L)){let Y=v.indices.buffer,J=v.indices.count,j=v.indices.indexDatatype;l(Y)&&n.context.webgl2&&(j===Ne.UNSIGNED_BYTE?L=new Uint8Array(J):j===Ne.UNSIGNED_SHORT?L=new Uint16Array(J):j===Ne.UNSIGNED_INT&&(L=new Uint32Array(J)),Y.getBufferData(L))}let g=D.typedArray,E=D.componentDatatype,w=D.type,I=D.quantization;l(I)&&(E=D.quantization.componentDatatype,w=D.quantization.type);let N=tn.getNumberOfComponents(w),B=X.getSizeInBytes(E),H=!l(g)&&l(R)&&R!==N*B,V=N,G=0;H&&(V=R/B,G=O/B);let k=M*V;if(!l(g)){let Y=D.buffer;l(Y)&&n.context.webgl2&&(g=X.createTypedArray(E,k),Y.getBufferData(g,H?0:O,0,k)),I&&D.normalized&&(g=Ln.dequantize(g,E,w,M))}if(!l(L)||!l(g))return;r=y(r,ee.default),i=y(i,1),o=y(o,0);let W=L.length;for(let Y=0;Y<W;Y+=3){let J=L[Y],j=L[Y+1],K=L[Y+2];for(let Q of T){let de=TW(g,J,G,V,I,Q,i,o,r,j6e),xe=TW(g,j,G,V,I,Q,i,o,r,q6e),ce=TW(g,K,G,V,I,Q,i,o,r,Y6e),_e=Qn.rayTriangleParametric(t,de,xe,ce,y(e.backFaceCulling,!0));l(_e)&&_e<a&&_e>=0&&(a=_e)}}}}if(a!==Number.MAX_VALUE){if(s=pn.getPoint(t,a,s),n.mode!==ne.SCENE3D){d.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,h=f.ellipsoid,p=f.unproject(s,$6e);h.cartographicToCartesian(p,s)}return s}}function TW(e,t,n,i,o,r,s,a,c,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],l(o))if(o.octEncoded){if(u=Ln.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let h=u.x;u.x=u.z,u.z=u.y,u.y=h}}else u=d.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=d.add(u,o.quantizedVolumeOffset,u);return u=F.multiplyByPoint(r,u,u),s!==1&&Dr.getPosition(u,c,s,a,u),u}function oo(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,gr.GLTF),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new wF(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,Bc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,z.RED);this._silhouetteColor=z.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,we.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ae,this._initialRadius=void 0,this._heightReference=y(e.heightReference,Ye.NONE),this._heightDirty=this._heightReference!==Ye.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=y(e.enableVerticalExaggeration,!0),this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new wp(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?bs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?Kh.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=d.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new tC,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new v_(e.environmentMapOptions);v_.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,xn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===gr.GLTF&&yt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new Ct(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,Gr.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this._classificationType=e.classificationType,this._statistics=new oB,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._errorEvent=new pe,this._readyEvent=new pe,this._texturesReadyEvent=new pe,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function CW(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function J6e(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new IF({model:e,propertyTable:s});n.push(a)}return n}function e9e(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=Xt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],u=Xt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function SW(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(oo.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){SW(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=SW(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return kse(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===gr.GLTF&&yt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(bs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Kh.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=d.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(v_.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});oo.prototype.getNode=function(e){return this._nodesByName[e]};oo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};oo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};oo.prototype.getExtension=function(e){return this._loader.components.extensions[e]};oo.prototype.makeStyleDirty=function(){this._styleDirty=!0};oo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var t9e=new F,n9e=new $,i9e=new F;oo.prototype.update=function(e){let t=!1;try{t=o9e(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")CW(this,n);else{let i=Xt.getError("model",this._resource,n);CW(this,i)}}if(r9e(this,e),s9e(this,e),a9e(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=Xt.getError("model",this._resource,new re("Failed to load model."));CW(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&J6e(this,i);let o=new iB({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(c9e(this),l9e(this),u9e(this,e),f9e(this),d9e(this,e),h9e(this,e),m9e(this,e),p9e(this,e),g9e(this,e),_9e(this,e),y9e(this,e),this._defaultTexture=e.context.defaultTexture,x9e(this,e),b9e(this,e),T9e(this),C9e(this,e),v9e(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),E9e(this),w9e(this,e),D9e(this),I9e(this,e)}};function o9e(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function r9e(e,t){l(e._customShader)&&e._customShader.update(t)}function s9e(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function a9e(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function c9e(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=e9e(t,e),e._styleDirty=!0,e.resetDrawCommands())}function l9e(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function u9e(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&Bse(e)}function Bse(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=em.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function f9e(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function d9e(e,t){e._silhouetteDirty&&(Vse(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function h9e(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function m9e(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function p9e(e,t){let n=0;e.isClippingPolygonsEnabled()&&(e._clippingPolygons.owner===e&&(e._clippingPolygons.update(t),e._clippingPolygons.queueCommands(t)),n=e._clippingPolygons.clippingPolygonsState),n!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=n)}function g9e(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function _9e(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function y9e(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function x9e(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function b9e(e,t){F.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix))}var U_=new d,AW=new fe;function T9e(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===Ye.NONE){e._clampedModelMatrix=void 0;return}let n=y(t.ellipsoid,ee.default),i=e.modelMatrix;U_.x=i[12],U_.y=i[13],U_.z=i[14];let o=n.cartesianToCartographic(U_);l(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(i,new F)),e._removeUpdateHeightCallback=t.updateHeight(o,Fse(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=Fse(e,n,o);fe.clone(o,AW),AW.height=r,s(AW)}e._heightDirty=!1,e._updateModelMatrix=!0}function C9e(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;kse(e,n),A9e(e,n,t)}function kse(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=d.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ae.transform(e._boundingSphere,t,e._boundingSphere)}function A9e(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);F.getTranslation(t,U_),e._sceneMode!==ne.SCENE3D&&zi.computeActualEllipsoidPosition(n,U_,U_);let s=e._boundingSphere.radius,a=P9e(U_,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function E9e(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}var S9e=new $(1,0,0,0,0,1,0,-1,0);function v9e(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),o=t.context,r=n9e,s=t9e;if(s=F.multiply(o.uniformState.view3D,i,s),r=F.getRotation(s,r),r=$.transpose(r,r),e._iblReferenceFrameMatrix=$.multiply(S9e,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=i9e;a=F.multiply(o.uniformState.view3D,i,a),a=F.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=F.inverseTranspose(a,e._clippingPlanesMatrix)}}function w9e(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function D9e(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=Ct.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=Ct.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=Ct.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function I9e(e,t){let n=O9e(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(M9e(e,t),e._sceneGraph.pushDrawCommands(t))}var EW=new ae;function P9e(e,t,n){return EW.center=e,EW.radius=t,n.camera.getPixelSize(EW,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var aB=new d;function Fse(e,t,n){return function(i){wT(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,aB);let o=e._clampedModelMatrix;F.clone(e.modelMatrix,o),o[12]=aB.x,o[13]=aB.y,o[14]=aB.z,e._heightDirty=!0}}var R9e=new d;function O9e(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===ne.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=F.getTranslation(e.modelMatrix,R9e);zi.computeActualEllipsoidPosition(t,s,s),r=d.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function M9e(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}oo.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};oo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Vse(e){return e.context.stencilBuffer}oo.prototype.hasSilhouette=function(e){return Vse(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};oo.prototype.hasSkipLevelOfDetail=function(e){if(!gr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};oo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};oo.prototype.pick=function(e,t,n,i,o){return Pw(this,e,t,n,i,o)};oo.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};oo.prototype.isDestroyed=function(){return!1};oo.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,ue(this)};oo.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};oo.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};oo.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),o=Se.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=Se.createIfNeeded(t);let r=new P_(n),a=l(e.content)?gr.TILE_GLTF:gr.GLTF,c=n.gltfResource,u=Rw(r,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(_){throw r.destroy(),Xt.getError("model",c,_)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let h=new oo(u),p=h._resource.credits;if(l(p)){let _=p.length;for(let m=0;m<_;m++)h._resourceCredits.push(Ct.clone(p[m]))}return h};oo.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new hF(t);try{await n.load();let i=Rw(n,gr.TILE_B3DM,e);return new oo(i)}catch(i){throw n.destroy(),i}};oo.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new sB(t);try{await n.load();let i=Rw(n,gr.TILE_PNTS,e);return new oo(i)}catch(i){throw n.destroy(),i}};oo.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new bF(t);try{await n.load();let i=Rw(n,gr.TILE_I3DM,e);return new oo(i)}catch(i){throw n.destroy(),i}};oo.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new pF(t),i=Rw(n,gr.TILE_GEOJSON,e);return new oo(i)};var L9e=new z;oo.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,L9e),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,SW(t,this._color)&&this.resetDrawCommands()};oo.prototype.applyStyle=function(e){let t=this.type===gr.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Bse(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function Rw(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var tm=oo;function Lr(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Lr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Lr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Lr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Lr.prototype.getExtension=function(e){return this._model.getExtension(e)};Lr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Lr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Lr.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Lr.prototype.applyStyle=function(e){this._model.style=e};Lr.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;l(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),l(s)&&l(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:au.REPEAT}),this._ready=!0)};Lr.prototype.isDestroyed=function(){return!1};Lr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Lr.fromGltf=async function(e,t,n,i){let o=new Lr(e,t,n),s=Ow(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await tm.fromGltfAsync(s);return o._model=c,o};Lr.fromB3dm=async function(e,t,n,i,o){let r=new Lr(e,t,n),a=Ow(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await tm.fromB3dm(a);return r._model=u,r};Lr.fromI3dm=async function(e,t,n,i,o){let r=new Lr(e,t,n),a=Ow(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await tm.fromI3dm(a);return r._model=c,r};Lr.fromPnts=async function(e,t,n,i,o){let r=new Lr(e,t,n),a=Ow(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await tm.fromPnts(a);return r._model=c,r};Lr.fromGeoJson=async function(e,t,n,i){let o=new Lr(e,t,n),s=Ow(e,t,o,{geoJson:i,resource:n}),a=await tm.fromGeoJson(s);return o._model=a,o};Lr.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ee.WGS84,n)};function Ow(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:we.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return xt(i,o)}var _f=Lr;function yf(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(yf.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});yf.fromJson=function(e,t,n,i){let o=new yf(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};yf.prototype.hasProperty=function(e,t){return!1};yf.prototype.getFeature=function(e){};yf.prototype.applyDebugSettings=function(e,t){};yf.prototype.applyStyle=function(e){};yf.prototype.update=function(e,t){};yf.prototype.pick=function(e,t,n){};yf.prototype.isDestroyed=function(){return!1};yf.prototype.destroy=function(){return ue(this)};var cB=yf;var lB=`uniform sampler2D u_atlas; #ifdef VECTOR_TILE uniform vec4 u_highlightColor; @@ -4341,7 +8744,7 @@ void main() #endif } -`;var WM=`#ifdef INSTANCED +`;var uB=`#ifdef INSTANCED in vec2 direction; #endif in vec4 positionHighAndScale; @@ -4777,1729 +9180,526 @@ if (lengthSq < disableDepthTestDistance) { v_color.a *= translucency; v_splitDirection = splitDirection; } -`;var jM=`in vec2 v_textureCoordinates; -const float M_PI = 3.141592653589793; - -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) - { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); - } - return value; -} - -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); -} - -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) -{ - float alphaRoughnessSquared = alphaRoughness * alphaRoughness; - float phi = 2.0 * M_PI * xi.x; - float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(upVector, N)); - vec3 tangentY = cross(N, tangentX); - return tangentX * H.x + tangentY * H.y + N * H.z; -} - -/** - * Estimate the geometric self-shadowing of the microfacets in a surface, - * using the Smith Joint GGX visibility function. - * Note: Vis = G / (4 * NdotL * NdotV) - * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3 - * see Real-Time Rendering. Page 331 to 336. - * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg) - * - * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness. - * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source. - * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera. - */ -float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) -{ - float alphaRoughnessSq = alphaRoughness * alphaRoughness; - - float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); - float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); - - float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0 - if (GGX > 0.0) - { - return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0 - } - return 0.0; -} - -vec2 integrateBrdf(float roughness, float NdotV) -{ - vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); - float A = 0.0; - float B = 0.0; - const int NumSamples = 1024; - float alphaRoughness = roughness * roughness; - for (int i = 0; i < NumSamples; i++) - { - vec2 xi = hammersley2D(i, NumSamples); - vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); - vec3 L = 2.0 * dot(V, H) * H - V; - float NdotL = clamp(L.z, 0.0, 1.0); - float NdotH = clamp(H.z, 0.0, 1.0); - float VdotH = clamp(dot(V, H), 0.0, 1.0); - if (NdotL > 0.0) - { - float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); - float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; - float Fc = pow(1.0 - VdotH, 5.0); - A += (1.0 - Fc) * G_Vis; - B += Fc * G_Vis; - } - } - return vec2(A, B) / float(NumSamples); -} - -void main() -{ - out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); -} -`;var qM=`uniform sampler2D u_noiseTexture; -uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -in vec2 v_offset; -in vec3 v_maximumSize; -in vec4 v_color; -in float v_slice; -in float v_brightness; - -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); - } - return mod(value, rangeLength); -} - -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); -} - -vec2 voxelToUV(vec3 voxelIndex) { - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - - float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; - vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, - inverseNoiseTextureRows / textureSliceWidth); - vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); - float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); - float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); - - float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; - float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; - return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; -} - -// Interpolate a voxel with its neighbor (along the positive X-axis) -vec4 lerpSamplesX(vec3 voxelIndex, float x) { - vec2 uv0 = voxelToUV(voxelIndex); - vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); - vec4 sample0 = texture(u_noiseTexture, uv0); - vec4 sample1 = texture(u_noiseTexture, uv1); - return mix(sample0, sample1, x); -} - -vec4 sampleNoiseTexture(vec3 position) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); - vec3 lerpValue = fract(recenteredPos); - vec3 voxelIndex = floor(recenteredPos); - - vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); - vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); - vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); - vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); - - vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); - vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); - return mix(yLerp0, yLerp1, lerpValue.z); -} - -// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). -bool intersectSphere(vec3 origin, vec3 dir, float slice, - out vec3 point, out vec3 normal) { - float A = dot(dir, dir); - float B = dot(origin, dir); - float C = dot(origin, origin) - 0.25; - float discriminant = (B * B) - (A * C); - if(discriminant < 0.0) { - return false; - } - float root = sqrt(discriminant); - float t = (-B - root) / A; - if(t < 0.0) { - t = (-B + root) / A; - } - point = origin + t * dir; - - if(slice >= 0.0) { - point.z = (slice / 2.0) - 0.5; - if(length(point) > 0.5) { - return false; - } - } - - normal = normalize(point); - point -= czm_epsilon2 * normal; - return true; -} - -// Transforms the ray origin and direction into unit sphere space, -// then transforms the result back into the ellipsoid's space. -bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, - out vec3 point, out vec3 normal) { - if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { - return false; - } - - vec3 o = (origin - center) / scale; - vec3 d = dir / scale; - vec3 p, n; - bool intersected = intersectSphere(o, d, slice, p, n); - if(intersected) { - point = (p * scale) + center; - normal = n; - } - return intersected; -} - -// Assume that if phase shift is being called for octave i, -// the frequency is of i - 1. This saves us from doing extra -// division / multiplication operations. -vec2 phaseShift2D(vec2 p, vec2 freq) { - return (czm_pi / 2.0) * sin(freq.yx * p.yx); -} - -vec2 phaseShift3D(vec3 p, vec2 freq) { - return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); -} - -// The cloud texture function derived from Gardner's 1985 paper, -// "Visual Simulation of Clouds." -// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf -const float T0 = 0.6; // contrast of the texture pattern -const float k = 0.1; // computed to produce a maximum value of 1 -const float C0 = 0.8; // coefficient -const float FX0 = 0.6; // frequency X -const float FY0 = 0.6; // frequency Y -const int octaves = 5; - -float T(vec3 point) { - vec2 sum = vec2(0.0); - float Ci = C0; - vec2 FXY = vec2(FX0, FY0); - vec2 PXY = vec2(0.0); - for(int i = 1; i <= octaves; i++) { - PXY = phaseShift3D(point, FXY); - Ci *= 0.707; - FXY *= 2.0; - vec2 sinTerm = sin(FXY * point.xy + PXY); - sum += Ci * sinTerm + vec2(T0); - } - return k * sum.x * sum.y; -} - -const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, -const float t = 0.4; // fraction of texture shading -const float s = 0.25; // fraction of specular reflection - -float I(float Id, float Is, float It) { - return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; -} - -const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); - -vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, - float brightness) { - vec3 cloudPoint, cloudNormal; - if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, - cloudPoint, cloudNormal)) { - return vec4(0.0); - } - - float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection - float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection - float It = T(cloudPoint); // texture function - float intensity = I(Id, Is, It); - vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); - - vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); - float W = noise.x; - float W2 = noise.y; - float W3 = noise.z; - - // The dot product between the cloud's normal and the ray's direction is greatest - // in the center of the ellipsoid's surface. It decreases towards the edge. - // Thus, it is used to blur the areas leading to the edges of the ellipsoid, - // so that no harsh lines appear. - - // The first (and biggest) layer of worley noise is then subtracted from this. - // The final result is scaled up so that the base cloud is not too translucent. - float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); - float TR = pow(ndDot, 3.0) - W; // translucency - TR *= 1.3; - - // Subtracting the second and third layers of worley noise is more complicated. - // If these layers of noise were simply subtracted from the current translucency, - // the shape derived from the first layer of noise would be completely deleted. - // The erosion of this noise should thus be constricted to the edges of the cloud. - // However, because the edges of the ellipsoid were already blurred away, mapping - // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. - // The value of (0.5 - ndDot) provides the best compromise. - float minusDot = 0.5 - ndDot; - - // Even with the previous calculation, subtracting the second layer of wnoise - // erode too much of the cloud. The addition of it, however, will detailed - // volume to the cloud. As long as the noise is only added and not subtracted, - // the results are aesthetically pleasing. - - // The minusDot product is mapped in a way that it is larger at the edges of - // the ellipsoid, so a subtraction and min operation are used instead of - // an addition and max one. - TR -= min(minusDot * W2, 0.0); - - // The third level of worley noise is subtracted from the result, with some - // modifications. First, a scalar is added to minusDot so that the noise - // starts affecting the shape farther away from the center of the ellipsoid's - // surface. Then, it is scaled down so its impact is not too intense. - TR -= 0.8 * (minusDot + 0.25) * W3; - - // The texture function's shading does not correlate with the shape of the cloud - // produced by the layers of noise, so an extra shading scalar is calculated. - // The darkest areas of the cloud are assigned to be where the noise erodes - // the cloud the most. This is then interpolated based on the translucency - // and the diffuse shading term of that point in the cloud. - float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); - - // To avoid values that are too dark, this scalar is increased by a small amount - // and clamped so it never goes to zero. - shading = clamp(shading + 0.2, 0.3, 1.0); - - // Finally, the contrast of the cloud's color is increased. - vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); - return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; -} - -void main() { -#ifdef DEBUG_BILLBOARDS - out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); -#endif - // To avoid calculations with high values, - // we raycast from an arbitrarily smaller space. - vec2 coordinate = v_maximumSize.xy * v_offset; - - vec3 ellipsoidScale = 0.82 * v_maximumSize; - vec3 ellipsoidCenter = vec3(0.0); - - float zOffset = max(ellipsoidScale.z - 10.0, 0.0); - vec3 eye = vec3(0, 0, -10.0 - zOffset); - vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); - vec3 rayOrigin = eye; -#ifdef DEBUG_ELLIPSOIDS - vec3 point, normal; - if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, - point, normal)) { - out_FragColor = v_brightness * v_color; - } -#else -#ifndef DEBUG_BILLBOARDS - vec4 cloud = drawCloud(rayOrigin, rayDir, - ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); - if(cloud.w < 0.01) { - discard; - } - out_FragColor = cloud; -#endif -#endif -} -`;var YM=`#ifdef INSTANCED -in vec2 direction; -#endif -in vec4 positionHighAndScaleX; -in vec4 positionLowAndScaleY; -in vec4 packedAttribute0; -in vec4 packedAttribute1; -in vec4 color; - -out vec2 v_offset; -out vec3 v_maximumSize; -out vec4 v_color; -out float v_slice; -out float v_brightness; - -void main() { - // Unpack attributes. - vec3 positionHigh = positionHighAndScaleX.xyz; - vec3 positionLow = positionLowAndScaleY.xyz; - vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); - - float show = packedAttribute0.x; - float brightness = packedAttribute0.y; - vec2 coordinates = packedAttribute0.wz; - vec3 maximumSize = packedAttribute1.xyz; - float slice = packedAttribute1.w; - -#ifdef INSTANCED - vec2 dir = direction; -#else - vec2 dir = coordinates; -#endif - - vec2 offset = dir - vec2(0.5, 0.5); - vec2 scaledOffset = scale * offset; - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - positionEC.xy += scaledOffset; - - positionEC.xyz *= show; - gl_Position = czm_projection * positionEC; - - v_offset = offset; - v_maximumSize = maximumSize; - v_color = color; - v_slice = slice; - v_brightness = brightness; -} -`;var XM=`uniform vec3 u_noiseTextureDimensions; -uniform float u_noiseDetail; -uniform vec3 u_noiseOffset; -in vec2 v_position; - -float wrap(float value, float rangeLength) { - if(value < 0.0) { - float absValue = abs(value); - float modValue = mod(absValue, rangeLength); - return mod(rangeLength - modValue, rangeLength); - } - return mod(value, rangeLength); -} - -vec3 wrapVec(vec3 value, float rangeLength) { - return vec3(wrap(value.x, rangeLength), - wrap(value.y, rangeLength), - wrap(value.z, rangeLength)); -} - -vec3 random3(vec3 p) { - float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); - float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); - return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); -} - -// Frequency corresponds to cell size. -// The higher the frequency, the smaller the cell size. -vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { - float textureSliceWidth = u_noiseTextureDimensions.x; - vec3 cell = centerCell + offset; - cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); - cell += floor(u_noiseOffset / u_noiseDetail); - vec3 p = offset + random3(cell); - return p; -} - -float worleyNoise(vec3 p, float freq) { - vec3 centerCell = floor(p * freq); - vec3 pointInCell = fract(p * freq); - float shortestDistance = 1000.0; - - for(float z = -1.0; z <= 1.0; z++) { - for(float y = -1.0; y <= 1.0; y++) { - for(float x = -1.0; x <= 1.0; x++) { - vec3 offset = vec3(x, y, z); - vec3 point = getWorleyCellPoint(centerCell, offset, freq); - - float distance = length(pointInCell - point); - if(distance < shortestDistance) { - shortestDistance = distance; - } - } - } - } - - return shortestDistance; -} - -const float MAX_FBM_ITERATIONS = 10.0; - -float worleyFBMNoise(vec3 p, float octaves, float scale) { - float noise = 0.0; - float freq = 1.0; - float persistence = 0.625; - for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { - if(i >= octaves) { - break; - } - - noise += worleyNoise(p * scale, freq * scale) * persistence; - persistence *= 0.5; - freq *= 2.0; - } - return noise; -} - -void main() { - float textureSliceWidth = u_noiseTextureDimensions.x; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - float x = mod(v_position.x, textureSliceWidth); - float y = mod(v_position.y, textureSliceWidth); - float sliceRow = floor(v_position.y / textureSliceWidth); - float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; - - vec3 position = vec3(x, y, z); - position /= u_noiseDetail; - float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); - float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); - float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); - out_FragColor = vec4(worley0, worley1, worley2, 1.0); -} -`;var KM=`uniform vec3 u_noiseTextureDimensions; -in vec2 position; - -out vec2 v_position; - -void main() -{ - gl_Position = vec4(position, 0.1, 1.0); - - float textureSliceWidth = u_noiseTextureDimensions.x; - float noiseTextureRows = u_noiseTextureDimensions.y; - float inverseNoiseTextureRows = u_noiseTextureDimensions.z; - vec2 transformedPos = (position * 0.5) + vec2(0.5); - transformedPos *= textureSliceWidth; - transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; - transformedPos.y *= noiseTextureRows; - v_position = transformedPos; -} -`;var ZM=`uniform sampler2D u_opaqueDepthTexture; -uniform sampler2D u_translucentDepthTexture; - -in vec2 v_textureCoordinates; - -void main() -{ - float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; - float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; - translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); - out_FragColor = czm_packDepth(translucentDepth); -} -`;var $M=`/** - * Compositing for Weighted Blended Order-Independent Transparency. See: - * - http://jcgt.org/published/0002/02/09/ - * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html - */ - -uniform sampler2D u_opaque; -uniform sampler2D u_accumulation; -uniform sampler2D u_revealage; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 opaque = texture(u_opaque, v_textureCoordinates); - vec4 accum = texture(u_accumulation, v_textureCoordinates); - float r = texture(u_revealage, v_textureCoordinates).r; - -#ifdef MRT - vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); -#else - vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); -#endif - - out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; - - if (opaque != czm_backgroundColor) - { - out_FragColor.a = 1.0; - } -} -`;var QM=`uniform samplerCube u_radianceMap; - -in vec2 v_textureCoordinates; - - -const float twoSqrtPi = 2.0 * sqrt(czm_pi); - -// Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf -float computeShBasis(int index, vec3 s) { - if (index == 0) { // l = 0, m = 0 - return 1.0 / twoSqrtPi; - } - - if (index == 1) { // l = 1, m = -1 - return -sqrt(3.0) * s.y / twoSqrtPi; - } - - if (index == 2) { // l = 1, m = 0 - return sqrt(3.0) * s.z / twoSqrtPi; - } - - if (index == 3) { // l = 1, m = 1 - return -sqrt(3.0) * s.x / twoSqrtPi; - } - - if (index == 4) { // l = 2, m = -2 - return sqrt(15.0) * s.y * s.x / twoSqrtPi; - } - - if (index == 5) { // l = 2, m = -1 - return -sqrt(15.0) * s.y * s.z / twoSqrtPi; - } - - if (index == 6) { // l = 2, m = 0 - return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; - } - - if (index == 7) { // l = 2, m = 1 - return -sqrt(15.0) * s.x * s.z / twoSqrtPi; - } - - if (index == 8) { // l = 2, m = 2 - return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; - } - - return 0.0; -} - -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) - { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); - } - return value; -} - -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); -} - -// Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics -const int samples = 256; -const float solidAngle = 1.0 / float(samples); - -void main() { - // Get the current coefficient based on the uv - vec2 uv = v_textureCoordinates.xy * 3.0; - int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); - - for (int i = 0; i < samples; ++i) { - vec2 xi = hammersley2D(i, samples); - float phi = czm_twoPi * xi.x; - float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); - - // Generate the spherical harmonics basis from the direction - float Ylm = computeShBasis(coefficientIndex, direction); - - vec3 lookupDirection = -direction.xyz; - lookupDirection.z = -lookupDirection.z; - - vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); - - // Use the relevant function for this coefficient - out_FragColor += Ylm * color * solidAngle * sinTheta; - } - -} -`;var JM=`precision highp float; - -in vec2 v_textureCoordinates; - -uniform vec3 u_faceDirection; // Current cubemap face -uniform vec3 u_positionWC; -uniform mat4 u_enuToFixedFrame; -uniform vec4 u_brightnessSaturationGammaIntensity; -uniform vec4 u_groundColor; // alpha component represent albedo - -vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { - vec2 scaledUV = uv * 2.0 - 1.0; - - if (faceDir.x != 0.0) { - return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); - } else if (faceDir.y != 0.0) { - return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); - } else { - return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); - } -} - -void main() { - float height = length(u_positionWC); - float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; - float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); - - // Scale the position to ensure the sky color is present, even when underground. - vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); - - float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; - float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; - - vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; - vec3 normalizedDirection = normalize(direction); - - czm_ray ray = czm_ray(positionWC, normalizedDirection); - czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); - if (!czm_isEmpty(intersection)) { - intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); - } - - bool onEllipsoid = intersection.start >= 0.0; - float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); - - // Compute sky color for each position on a sphere at radius centered around the provided position's origin - vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; - - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); - vec3 mieColor; - vec3 rayleighColor; - float opacity; - czm_computeScattering( - ray, - rayLength, - lightDirectionWC, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); - - vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); - -#ifdef ATMOSPHERE_COLOR_CORRECT - const bool ignoreBlackPixels = true; - atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); -#endif - - vec3 lookupDirection = -normalizedDirection; - // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. - lookupDirection.x = -lookupDirection.x; - lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); - lookupDirection.x = -lookupDirection.x; - - // Values outside the atmopshere are rendered as black, when they should be treated as transparent - float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); - skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent - - // Blend starmap with atmopshere scattering - float intensity = u_brightnessSaturationGammaIntensity.w; - vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); - vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); - vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); - - // Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height - vec3 up = normalize(positionWC); - float occlusion = max(dot(lightDirectionWC, up), 0.05); - vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); - vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); - - vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); - - float brightness = u_brightnessSaturationGammaIntensity.x; - float saturation = u_brightnessSaturationGammaIntensity.y; - float gamma = u_brightnessSaturationGammaIntensity.z; - -#ifdef ENVIRONMENT_COLOR_CORRECT - color.rgb = mix(vec3(0.0), color.rgb, brightness); - color.rgb = czm_saturation(color.rgb, saturation); -#endif - color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0. - color.rgb = czm_gammaCorrect(color.rgb); - - out_FragColor = color; -} -`;var eL=`precision highp float; - -in vec3 v_textureCoordinates; - -uniform float u_roughness; -uniform samplerCube u_radianceTexture; -uniform vec3 u_faceDirection; - -float vdcRadicalInverse(int i) -{ - float r; - float base = 2.0; - float value = 0.0; - float invBase = 1.0 / base; - float invBi = invBase; - for (int x = 0; x < 100; x++) - { - if (i <= 0) - { - break; - } - r = mod(float(i), base); - value += r * invBi; - invBi *= invBase; - i = int(float(i) * invBase); - } - return value; -} - -vec2 hammersley2D(int i, int N) -{ - return vec2(float(i) / float(N), vdcRadicalInverse(i)); -} - -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) -{ - float alphaRoughnessSquared = alphaRoughness * alphaRoughness; - float phi = czm_twoPi * xi.x; - float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); - float sinTheta = sqrt(1.0 - cosTheta * cosTheta); - vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); - vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangentX = normalize(cross(upVector, N)); - vec3 tangentY = cross(N, tangentX); - return tangentX * H.x + tangentY * H.y + N * H.z; -} - -// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses -const int samples = 128; - -void main() { - vec3 normal = u_faceDirection; - vec3 V = normalize(v_textureCoordinates); - float roughness = u_roughness; - - vec4 color = vec4(0.0); - float weight = 0.0; - for (int i = 0; i < samples; ++i) { - vec2 xi = hammersley2D(i, samples); - vec3 H = importanceSampleGGX(xi, roughness, V); - vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector - - float NdotL = max(dot(V, L), 0.0); - if (NdotL > 0.0) { - color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; - weight += NdotL; - } - } - out_FragColor = color / weight; -} -`;var tL=`in vec3 position; -out vec3 v_textureCoordinates; - -uniform vec3 u_faceDirection; - -vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { - vec2 scaledUV = uv; - - if (faceDir.x != 0.0) { - return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); - } else if (faceDir.y != 0.0) { - return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); - } else { - return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); - } -} - +`;function pi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Bt.clone(n)),l(i)&&(i=Bt.clone(i)),l(o)&&(o=Bt.clone(o)),l(r)&&(r=Mt.clone(r)),this._show=y(e.show,!0),this._position=d.clone(y(e.position,d.ZERO)),this._actualPosition=d.clone(this._position),this._pixelOffset=U.clone(y(e.pixelOffset,U.ZERO)),this._translate=new U(0,0),this._eyeOffset=d.clone(y(e.eyeOffset,d.ZERO)),this._heightReference=y(e.heightReference,Ye.NONE),this._verticalOrigin=y(e.verticalOrigin,On.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,xi.CENTER),this._scale=y(e.scale,1),this._color=z.clone(y(e.color,z.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=d.clone(y(e.alignedAxis,d.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=zn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping(),this._splitDirection=y(e.splitDirection,Gr.NONE)}var Use=pi.SHOW_INDEX=0,dB=pi.POSITION_INDEX=1,Wse=pi.PIXEL_OFFSET_INDEX=2,N9e=pi.EYE_OFFSET_INDEX=3,F9e=pi.HORIZONTAL_ORIGIN_INDEX=4,B9e=pi.VERTICAL_ORIGIN_INDEX=5,k9e=pi.SCALE_INDEX=6,hB=pi.IMAGE_INDEX_INDEX=7,zse=pi.COLOR_INDEX=8,V9e=pi.ROTATION_INDEX=9,U9e=pi.ALIGNED_AXIS_INDEX=10,z9e=pi.SCALE_BY_DISTANCE_INDEX=11,H9e=pi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,G9e=pi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,W9e=pi.DISTANCE_DISPLAY_CONDITION=14,j9e=pi.DISABLE_DEPTH_DISTANCE=15;pi.TEXTURE_COORDINATE_BOUNDS=16;var Hse=pi.SDF_INDEX=17,q9e=pi.SPLIT_DIRECTION_INDEX=18;pi.NUMBER_OF_PROPERTIES=19;function Do(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(pi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Do(this,Use))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),this._updateClamping(),Do(this,dB))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Do(this,dB))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),Do(this,Wse))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),Do(this,z9e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),Do(this,H9e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Bt.equals(t,e)||(this._pixelOffsetScaleByDistance=Bt.clone(e,t),Do(this,G9e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;d.equals(t,e)||(d.clone(e,t),Do(this,N9e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Do(this,F9e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Do(this,B9e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Do(this,k9e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Do(this,zse))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Do(this,V9e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;d.equals(t,e)||(d.clone(e,t),Do(this,U9e))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Do(this,hB))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Do(this,hB))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Do(this,zse))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),Do(this,W9e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Do(this,j9e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof Se?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(zn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Do(this,hB))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition),Do(this,dB)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Do(this,Use))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Do(this,Hse))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Do(this,Hse))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Do(this,q9e))}}});pi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};pi.prototype._updateClamping=function(){pi._updateClamping(this._billboardCollection,this)};var mB=new fe;pi._updateClamping=function(e,t){let n=e._scene;if(!l(n))return;let i=y(n.ellipsoid,ee.default),o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===Ye.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Ye.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(u){let f=i.cartographicToCartesian(u,t._clampedPosition);wT(t._heightReference)&&(t._mode===ne.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),fe.clone(s,mB);let c=n.getHeight(s,t._heightReference);l(c)&&(mB.height=c),a(mB)};pi.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(c){if(r._imageId!==t||r._image!==n||!qe.equals(r._imageSubRegion,i))return;let u=e.textureCoordinates[c];r._imageWidth=e.texture.width*u.width,r._imageHeight=e.texture.height*u.height,r._imageIndex=c,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,Do(r,hB);let f=r._billboardCollection._scene;l(f)&&f.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;let a=e.getImageIndex(t);if(l(a)&&!l(i)){s(a);return}o.then(s).catch(function(c){console.error(`Error loading image for billboard: ${c}`),r._imageIndexPromise=void 0})};pi.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};pi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&qe.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=qe.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};pi.prototype._setTranslate=function(e){let t=this._translate;U.equals(t,e)||(U.clone(e,t),Do(this,Wse))};pi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};pi.prototype._setActualPosition=function(e){l(this._clampedPosition)||d.clone(e,this._actualPosition),Do(this,dB)};var Gse=new oe;pi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(F.multiplyByPoint(i,t,Gse),zi.computeActualEllipsoidPosition(n,Gse))};var jse=new d;pi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=F.multiplyByPoint(e,t,jse),a=zi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return U.add(a,i,a),a};var fB=new U(0,0);pi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,fB),U.add(fB,this._translate,fB);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,mB);o=a.cartographicToCartesian(c,jse),i=F.IDENTITY}return pi._computeScreenSpacePosition(i,o,this._eyeOffset,fB,e,t)};pi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===xi.RIGHT?s-=i:e.horizontalOrigin===xi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===On.BOTTOM||e.verticalOrigin===On.BASELINE?a-=o:e.verticalOrigin===On.CENTER&&(a-=o*.5),l(n)||(n=new qe),n.x=s,n.y=a,n.width=i,n.height=o,n};pi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&d.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&qe.equals(this._imageSubRegion,e._imageSubRegion)&&z.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&d.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};pi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var lo=pi;var Y9e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Io=Object.freeze(Y9e);var X9e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},oa=Object.freeze(X9e);function Np(e,t,n,i,o){this.bottomLeft=y(e,U.ZERO),this.topRight=y(t,U.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var K9e=new U(16,16);function z_(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,K9e);this._context=e.context,this._pixelFormat=y(e.pixelFormat,tt.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=zn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(z_.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Rt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function Z9e(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),u=o*(a+t.height+r),f=s/c,h=a/u,p=new Np(new U(s+r,r),new U(c,a)),_=new Np(new U,new U(c,a),e._root,p),m=new Np(new U(r,a+r),new U(c,u)),x=new Np(new U,new U(c,u),_,m);for(let C=0;C<e._textureCoordinates.length;C++){let A=e._textureCoordinates[C];l(A)&&(A.x*=f,A.y*=h,A.width*=f,A.height*=h)}let b=new Rt({context:e._context,width:c,height:u,pixelFormat:e._pixelFormat}),T=new zr({context:n,colorTextures:[e._texture],destroyAttachments:!1});T._bind(),b.copyFromFramebuffer(0,0,0,0,c,u),T._unBind(),T.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=b,e._root=x}else{let s=o*(t.width+2*r),a=o*(t.height+2*r);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Rt({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new Np(new U(r,r),new U(s,a))}}function pB(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,r=i-n.width,s=o-n.height;if(r<0||s<0)return;if(r===0&&s===0)return t;if(r>s){t.childNode1=new Np(new U(t.bottomLeft.x,t.bottomLeft.y),new U(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new Np(new U(a,t.bottomLeft.y),new U(t.topRight.x,t.topRight.y)))}else{t.childNode1=new Np(new U(t.bottomLeft.x,t.bottomLeft.y),new U(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new Np(new U(t.bottomLeft.x,a),new U(t.topRight.x,t.topRight.y)))}return pB(e,t.childNode1,n)}return pB(e,t.childNode1,n)||pB(e,t.childNode2,n)}}function qse(e,t,n){let i=pB(e,e._root,t);if(l(i)){i.imageIndex=n;let o=e._texture.width,r=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/o,u=i.bottomLeft.y/r,f=s/o,h=a/r;e._textureCoordinates[n]=new qe(c,u,f,h),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else Z9e(e,t),qse(e,t,n);e._guid=zn()}function Yse(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return qse(e,t,n),n}z_.prototype.getImageIndex=function(e){return this._indexHash[e]};z_.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=Yse(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};z_.prototype.addImage=function(e,t){let n=this._idHash[e];if(l(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof Se)&&(t=Se.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(o){let r=Yse(i,o);return i._indexHash[e]=r,r}),this._idHash[e]=n,n};z_.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new re(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;let r=i._texture.width,s=i._texture.height,a=i._textureCoordinates[o],c=a.x+t.x/r,u=a.y+t.y/s,f=t.width/r,h=t.height/s,p=i._textureCoordinates.push(new qe(c,u,f,h))-1;return i._indexHash[e]=p,i._guid=zn(),p})};z_.prototype.isDestroyed=function(){return!1};z_.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Ex=z_;var $9e=lo.SHOW_INDEX,Lw=lo.POSITION_INDEX,Xse=lo.PIXEL_OFFSET_INDEX,Kse=lo.EYE_OFFSET_INDEX,Q9e=lo.HORIZONTAL_ORIGIN_INDEX,J9e=lo.VERTICAL_ORIGIN_INDEX,eWe=lo.SCALE_INDEX,Mw=lo.IMAGE_INDEX_INDEX,Zse=lo.COLOR_INDEX,tWe=lo.ROTATION_INDEX,nWe=lo.ALIGNED_AXIS_INDEX,$se=lo.SCALE_BY_DISTANCE_INDEX,Qse=lo.TRANSLUCENCY_BY_DISTANCE_INDEX,Jse=lo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,eae=lo.DISTANCE_DISPLAY_CONDITION,iWe=lo.DISABLE_DEPTH_DISTANCE,oWe=lo.TEXTURE_COORDINATE_BOUNDS,tae=lo.SDF_INDEX,nae=lo.SPLIT_DIRECTION_INDEX,OW=lo.NUMBER_OF_PROPERTIES,ro,rWe={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},sWe={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function Tf(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(OW),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,Io.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(Tf.prototype,{length:{get:function(){return MW(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function iae(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Tf.prototype.add=function(e){let t=new lo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Tf.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Tf.prototype.removeAll=function(){iae(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function MW(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Tf.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Tf.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Tf.prototype.get=function(e){return MW(this),this._billboards[e]};var vW;function aWe(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=_t.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function cWe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=_t.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function lWe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=_t.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Tf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<OW;++i){let o=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function uWe(e,t,n,i,o,r){let s=[{index:ro.positionHighAndScale,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Lw]},{index:ro.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Lw]},{index:ro.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Xse]},{index:ro.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Qse]},{index:ro.compressedAttribute2,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Zse]},{index:ro.eyeOffset,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Kse]},{index:ro.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[$se]},{index:ro.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Jse]},{index:ro.compressedAttribute3,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[eae]},{index:ro.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[oWe]},{index:ro.splitDirection,componentsPerAttribute:1,componentDatatype:X.FLOAT,usage:n[nae]}];i&&s.push({index:ro.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:lWe(e)}),l(o)&&s.push({index:ro.a_batchId,componentsPerAttribute:1,componentDatatype:X.FLOAT,bufferUsage:Fe.STATIC_DRAW}),r&&s.push({index:ro.sdf,componentsPerAttribute:2,componentDatatype:X.FLOAT,usage:n[tae]});let a=i?t:4*t;return new Wg(e,s,a,i)}var wW=new Hn;function oae(e,t,n,i,o){let r,s=i[ro.positionHighAndScale],a=i[ro.positionLowAndRotation],c=o._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Hn.fromCartesian(c,wW);let u=o.scale,f=o.rotation;f!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);let h=wW.high,p=wW.low;e._instanced?(r=o._index,s(r,h.x,h.y,h.z,u),a(r,p.x,p.y,p.z,f)):(r=o._index*4,s(r+0,h.x,h.y,h.z,u),s(r+1,h.x,h.y,h.z,u),s(r+2,h.x,h.y,h.z,u),s(r+3,h.x,h.y,h.z,u),a(r+0,p.x,p.y,p.z,f),a(r+1,p.x,p.y,p.z,f),a(r+2,p.x,p.y,p.z,f),a(r+3,p.x,p.y,p.z,f))}var bf=new U,xf=32768,zC=65536,DW=4096,nm=256,fWe=128,dWe=32,hWe=8,rae=4,mWe=1/256,sae=0,aae=2,cae=3,lae=1;function uae(e,t,n,i,o){let r,s=i[ro.compressedAttribute0],a=o.pixelOffset,c=a.x,u=a.y,f=o._translate,h=f.x,p=f.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+h),Math.abs(-u+p));let _=o.horizontalOrigin,m=o._verticalOrigin,x=o.show&&o.clusterShow;o.color.alpha===0&&(x=!1),m===On.BASELINE&&(m=On.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&_===xi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&m===On.CENTER;let b=0,T=0,C=0,A=0,S=o._imageIndex;if(S!==-1){let H=n[S];b=H.x,T=H.y,C=H.width,A=H.height}let v=b+C,D=T+A,O=Math.floor(P.clamp(c,-xf,xf)+xf)*fWe;O+=(_+1)*dWe,O+=(m+1)*hWe,O+=(x?1:0)*rae;let R=Math.floor(P.clamp(u,-xf,xf)+xf)*nm,M=Math.floor(P.clamp(h,-xf,xf)+xf)*nm,L=(P.clamp(p,-xf,xf)+xf)*mWe,g=Math.floor(L),E=Math.floor((L-g)*nm);R+=g,M+=E,bf.x=b,bf.y=T;let w=Ln.compressTextureCoordinates(bf);bf.x=v;let I=Ln.compressTextureCoordinates(bf);bf.y=D;let N=Ln.compressTextureCoordinates(bf);bf.x=b;let B=Ln.compressTextureCoordinates(bf);e._instanced?(r=o._index,s(r,O,R,M,w)):(r=o._index*4,s(r+0,O+sae,R,M,w),s(r+1,O+aae,R,M,I),s(r+2,O+cae,R,M,N),s(r+3,O+lae,R,M,B))}function fae(e,t,n,i,o){let r,s=i[ro.compressedAttribute1],a=o.alignedAxis;d.equals(a,d.ZERO)||(e._shaderAlignedAxis=!0);let c=0,u=1,f=1,h=1,p=o.translucencyByDistance;l(p)&&(c=p.near,u=p.nearValue,f=p.far,h=p.farValue,(u!==1||h!==1)&&(e._shaderTranslucencyByDistance=!0));let _=0,m=o._imageIndex;m!==-1&&(_=n[m].width);let x=e._textureAtlas.texture.width,b=Math.round(y(o.width,x*_));e._maxSize=Math.max(e._maxSize,b);let T=P.clamp(b,0,zC),C=0;Math.abs(d.magnitudeSquared(a)-1)<P.EPSILON6&&(C=Ln.octEncodeFloat(a)),u=P.clamp(u,0,1),u=u===1?255:u*255|0,T=T*nm+u,h=P.clamp(h,0,1),h=h===1?255:h*255|0,C=C*nm+h,e._instanced?(r=o._index,s(r,T,C,c,f)):(r=o._index*4,s(r+0,T,C,c,f),s(r+1,T,C,c,f),s(r+2,T,C,c,f),s(r+3,T,C,c,f))}function PW(e,t,n,i,o){let r,s=i[ro.compressedAttribute2],a=o.color,c=l(e._batchTable)?z.WHITE:o.getPickId(t.context).color,u=o.sizeInMeters?1:0,f=Math.abs(d.magnitudeSquared(o.alignedAxis)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&u===1;let h=0,p=o._imageIndex;p!==-1&&(h=n[p].height);let _=e._textureAtlas.texture.dimensions,m=Math.round(y(o.height,_.y*h));e._maxSize=Math.max(e._maxSize,m);let x=y(o._labelHorizontalOrigin,-2);x+=2;let b=m*rae+x,T=z.floatToByte(a.red),C=z.floatToByte(a.green),A=z.floatToByte(a.blue),S=T*zC+C*nm+A;T=z.floatToByte(c.red),C=z.floatToByte(c.green),A=z.floatToByte(c.blue);let v=T*zC+C*nm+A,D=z.floatToByte(a.alpha)*zC+z.floatToByte(c.alpha)*nm;D+=u*2+f,e._instanced?(r=o._index,s(r,S,v,D,b)):(r=o._index*4,s(r+0,S,v,D,b),s(r+1,S,v,D,b),s(r+2,S,v,D,b),s(r+3,S,v,D,b))}function RW(e,t,n,i,o){let r,s=i[ro.eyeOffset],a=o.eyeOffset,c=a.z;if(o._heightReference!==Ye.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let u=0,f=0,h=o._imageIndex;if(h!==-1){let _=n[h];u=_.width,f=_.height}bf.x=u,bf.y=f;let p=Ln.compressTextureCoordinates(bf);r=o._index,s(r,a.x,a.y,c,p)}else r=o._index*4,s(r+0,a.x,a.y,c,0),s(r+1,a.x,a.y,c,0),s(r+2,a.x,a.y,c,0),s(r+3,a.x,a.y,c,0)}function dae(e,t,n,i,o){let r,s=i[ro.scaleByDistance],a=0,c=1,u=1,f=1,h=o.scaleByDistance;l(h)&&(a=h.near,c=h.nearValue,u=h.far,f=h.farValue,(c!==1||f!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,u,f)):(r=o._index*4,s(r+0,a,c,u,f),s(r+1,a,c,u,f),s(r+2,a,c,u,f),s(r+3,a,c,u,f))}function hae(e,t,n,i,o){let r,s=i[ro.pixelOffsetScaleByDistance],a=0,c=1,u=1,f=1,h=o.pixelOffsetScaleByDistance;l(h)&&(a=h.near,c=h.nearValue,u=h.far,f=h.farValue,(c!==1||f!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,u,f)):(r=o._index*4,s(r+0,a,c,u,f),s(r+1,a,c,u,f),s(r+2,a,c,u,f),s(r+3,a,c,u,f))}function mae(e,t,n,i,o){let r,s=i[ro.compressedAttribute3],a=0,c=Number.MAX_VALUE,u=o.distanceDisplayCondition;l(u)&&(a=u.near,c=u.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let f=o.disableDepthTestDistance,h=tf(o.heightReference)&&t.context.depthTexture;l(f)||(f=h?5e3:0),f*=f,(h||f>0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,_;if(l(o._labelDimensions))_=o._labelDimensions.x,p=o._labelDimensions.y;else{let T=0,C=0,A=o._imageIndex;if(A!==-1){let v=n[A];T=v.height,C=v.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*T));let S=e._textureAtlas.texture.width;_=Math.round(y(o.width,S*C))}let m=Math.floor(P.clamp(_,0,DW)),x=Math.floor(P.clamp(p,0,DW)),b=m*DW+x;e._instanced?(r=o._index,s(r,a,c,f,b)):(r=o._index*4,s(r+0,a,c,f,b),s(r+1,a,c,f,b),s(r+2,a,c,f,b),s(r+3,a,c,f,b))}function pae(e,t,n,i,o){if(tf(o.heightReference)){let m=e._scene,x=t.context,b=t.globeTranslucencyState.translucent,T=l(m.globe)&&m.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!b&&T}let r,s=i[ro.textureCoordinateBoundsOrLabelTranslate];if(Ft.maximumVertexTextureImageUnits>0){let m=0,x=0;l(o._labelTranslate)&&(m=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,m,x,0,0)):(r=o._index*4,s(r+0,m,x,0,0),s(r+1,m,x,0,0),s(r+2,m,x,0,0),s(r+3,m,x,0,0));return}let a=0,c=0,u=0,f=0,h=o._imageIndex;if(h!==-1){let m=n[h];a=m.x,c=m.y,u=m.width,f=m.height}let p=a+u,_=c+f;e._instanced?(r=o._index,s(r,a,c,p,_)):(r=o._index*4,s(r+0,a,c,p,_),s(r+1,a,c,p,_),s(r+2,a,c,p,_),s(r+3,a,c,p,_))}function pWe(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[ro.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function gae(e,t,n,i,o){if(!e._sdf)return;let r,s=i[ro.sdf],a=o.outlineColor,c=o.outlineWidth,u=z.floatToByte(a.red),f=z.floatToByte(a.green),h=z.floatToByte(a.blue),p=u*zC+f*nm+h,_=c/oa.RADIUS,m=z.floatToByte(a.alpha)*zC+z.floatToByte(_)*nm;e._instanced?(r=o._index,s(r,p,m)):(r=o._index*4,s(r+0,p+sae,m),s(r+1,p+aae,m),s(r+2,p+cae,m),s(r+3,p+lae,m))}function _ae(e,t,n,i,o){let r=i[ro.splitDirection],s=0,a=o.splitDirection;l(a)&&(s=a);let c;e._instanced?(c=o._index,r(c,s)):(c=o._index*4,r(c+0,s),r(c+1,s),r(c+2,s),r(c+3,s))}function gWe(e,t,n,i,o){oae(e,t,n,i,o),uae(e,t,n,i,o),fae(e,t,n,i,o),PW(e,t,n,i,o),RW(e,t,n,i,o),dae(e,t,n,i,o),hae(e,t,n,i,o),mae(e,t,n,i,o),pae(e,t,n,i,o),pWe(e,t,n,i,o),gae(e,t,n,i,o),_ae(e,t,n,i,o)}function IW(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,h=lo._computeActualPosition(u,f,i,o);l(h)&&(u._setActualPosition(h),r?a.push(h):ae.expand(s,h,s))}r&&ae.fromPoints(a,s)}function _We(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&IW(e,i,i.length,t,r,!0)):n===ne.MORPHING?IW(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&IW(e,o,e._billboardsToUpdateIndex,t,r,!1)}function yWe(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function xWe(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; +in vec2 v_textureCoordinates; void main() -{ - v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); - v_textureCoordinates.y = -v_textureCoordinates.y; - v_textureCoordinates.z = -v_textureCoordinates.z; - gl_Position = vec4(position, 1.0); -} -`;var nL=`in vec4 positionEC; +{ + out_FragColor = texture(billboard_texture, v_textureCoordinates); +} +`,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=we.OVERLAY,i}var bWe=[];Tf.prototype.update=function(e){if(MW(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,ro=this._instanced?sWe:rWe,vW=this._instanced?cWe:aWe;let o=this._textureAtlas;if(!l(o)){o=this._textureAtlas=new Ex({context:i});for(let R=0;R<n;++R)t[R]._loadImage()}let r=o.textureCoordinates;if(r.length===0)return;_We(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let h,p=e.passes,_=p.pick;if(f||!_&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R<OW;++R)c[R]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=uWe(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let R=0;R<n;++R){let M=this._billboards[R];M._dirty=!1,gWe(this,e,r,h,M)}this._vaf.commit(vW(i))}this._billboardsToUpdateIndex=0}else if(a>0){let R=bWe;R.length=0,(c[Lw]||c[tWe]||c[eWe])&&R.push(oae),(c[Mw]||c[Xse]||c[Q9e]||c[J9e]||c[$9e])&&(R.push(uae),this._instanced&&R.push(RW)),(c[Mw]||c[nWe]||c[Qse])&&(R.push(fae),R.push(PW)),(c[Mw]||c[Zse])&&R.push(PW),c[Kse]&&R.push(RW),c[$se]&&R.push(dae),c[Jse]&&R.push(hae),(c[eae]||c[iWe]||c[Mw]||c[Lw])&&R.push(mae),(c[Mw]||c[Lw])&&R.push(pae),c[tae]&&R.push(gae),c[nae]&&R.push(_ae);let M=R.length;if(h=this._vaf.writers,a/n>.1){for(let L=0;L<a;++L){let g=s[L];g._dirty=!1;for(let E=0;E<M;++E)R[E](this,e,r,h,g)}this._vaf.commit(vW(i))}else{for(let L=0;L<a;++L){let g=s[L];g._dirty=!1;for(let E=0;E<M;++E)R[E](this,e,r,h,g);this._instanced?this._vaf.subCommit(g._index,1):this._vaf.subCommit(g._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,x=F.IDENTITY;e.mode===ne.SCENE3D?(x=this.modelMatrix,m=ae.clone(this._baseVolumeWC,this._boundingVolume)):m=ae.clone(this._baseVolume2D,this._boundingVolume),yWe(this,e,m);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===Io.OPAQUE||this._blendOption===Io.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===Io.TRANSLUCENT;this._blendOption===Io.TRANSLUCENT||this._blendOption===Io.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:R?te.LEQUAL:te.LESS},depthMask:R,blending:ln.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let T,C,A,S,v,D=Ft.maximumVertexTextureImageUnits>0;if(b||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){T=uB,C=lB,v=[],l(this._batchTable)&&(v.push("VECTOR_TILE"),T=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(T),C=this._batchTable.getFragmentShaderCallback(!1,void 0)(C)),A=new Ue({defines:v,sources:[T]}),this._instanced&&A.defines.push("INSTANCED"),this._shaderRotation&&A.defines.push("ROTATION"),this._shaderAlignedAxis&&A.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&A.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&A.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&A.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&A.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&A.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(D?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-oa.CUTOFF;this._sdf&&A.defines.push("SDF");let M=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Io.OPAQUE_AND_TRANSLUCENT&&(S=new Ue({defines:["OPAQUE",M],sources:[C]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=Qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:ro}),S=new Ue({defines:["TRANSLUCENT",M],sources:[C]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:ro})),this._blendOption===Io.OPAQUE&&(S=new Ue({defines:[M],sources:[C]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=Qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:ro})),this._blendOption===Io.TRANSLUCENT&&(S=new Ue({defines:[M],sources:[C]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:ro})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let O=e.commandList;if(p.render||p.pick){let R=this._colorCommands,M=this._blendOption===Io.OPAQUE,L=this._blendOption===Io.OPAQUE_AND_TRANSLUCENT,g=this._vaf.va,E=g.length,w=this._uniforms,I;l(this._batchTable)?(w=this._batchTable.getUniformMapCallback()(w),I=this._batchTable.getPickId()):I="v_pickColor",R.length=E;let N=L?E*2:E;for(let B=0;B<N;++B){let H=R[B];l(H)||(H=R[B]=new $e);let V=M||L&&B%2===0;H.pass=V||!L?we.OPAQUE:we.TRANSLUCENT,H.owner=this;let G=L?Math.floor(B/2):B;H.boundingVolume=m,H.modelMatrix=x,H.count=g[G].indicesCount,H.shaderProgram=V?this._sp:this._spTranslucent,H.uniformMap=w,H.vertexArray=g[G].va,H.renderState=V?this._rsOpaque:this._rsTranslucent,H.debugShowBoundingVolume=this.debugShowBoundingVolume,H.pickId=I,this._instanced&&(H.count=6,H.instanceCount=n),O.push(H)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=xWe(this,e.context)),O.push(this.debugCommand))}};Tf.prototype.isDestroyed=function(){return!1};Tf.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),iae(this._billboards),ue(this)};var Cf=Tf;function TWe(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var HC=TWe;function ra(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),GC(this)}var CWe=new fe;Object.defineProperties(ra.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=z.clone(e,this._color),GC(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,GC(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=z.clone(e,this._pointOutlineColor),GC(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,GC(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,CWe);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=z.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&GC(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ra.defaultColor=z.WHITE;ra.defaultPointOutlineColor=z.BLACK;ra.defaultPointOutlineWidth=0;ra.defaultPointSize=8;function GC(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,ra.defaultColor),i=y(e._pointOutlineColor,ra.defaultPointOutlineColor),o=y(e._pointOutlineWidth,ra.defaultPointOutlineWidth),r=y(e._pointSize,ra.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&o===c&&r===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),_=JSON.stringify([h,r,p,o]);t.setImage(_,HC(f,h,p,o,r))}ra.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ra.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ra.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ra.prototype.getPropertyInherited=function(e){return Js.getPropertyInherited(this._content,this._batchId,e)};ra.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ra.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ra.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ra.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var H_=ra;function AWe(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=r.width+u|0,h=3*a,p=h/2;c.width=f,c.height=h;let _=c.getContext("2d");_.font=n,_.fillStyle="white",_.fillRect(0,0,c.width+1,c.height+1),i&&(_.strokeStyle="black",_.lineWidth=e.lineWidth,_.strokeText(t,u/2,p)),o&&(_.fillStyle="black",_.fillText(t,u/2,p));let m=_.getImageData(0,0,f,h).data,x=m.length,b=f*4,T,C,A,S;for(T=0;T<x;++T)if(m[T]!==255){A=T/b|0;break}for(T=x-1;T>=0;--T)if(m[T]!==255){S=T/b|0;break}let v=-1;for(T=0;T<f&&v===-1;++T)for(C=0;C<h;++C){let D=T*4+C*b;if(m[D]!==255||m[D+1]!==255||m[D+2]!==255||m[D+3]!==255){v=T;break}}return{width:r.width,height:S-A,ascent:p-A,descent:S-p,minx:v-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var Sx;function EWe(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),o=y(t.fill,!0),r=y(t.strokeWidth,1),s=y(t.backgroundColor,z.TRANSPARENT),a=y(t.padding,0),c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(Sx)||(l(f.imageSmoothingEnabled)?Sx="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?Sx="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?Sx="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(Sx="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[Sx]=!1,u.style.visibility="hidden",document.body.appendChild(u);let h=AWe(f,e,n,i,o);u.dimensions=h,document.body.removeChild(u),u.style.visibility="";let p=-h.minx,_=Math.ceil(h.width)+p+c,m=h.height+c,x=m-h.ascent+a,b=m-x+c;if(u.width=_,u.height=m,f.font=n,f.lineJoin="round",f.lineWidth=r,f[Sx]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=y(t.strokeColor,z.BLACK);f.strokeStyle=T.toCssColorString(),f.strokeText(e,p+a,b)}if(o){let T=y(t.fillColor,z.WHITE);f.fillStyle=T.toCssColorString(),f.fillText(e,p+a,b)}return u}var WC=EWe;var Dae=Ur(Tae(),1);var vWe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Xo=Object.freeze(vWe);var Cae={},Aae=0,wWe=256,DWe=new z(.165,.165,.165,.8),IWe=new U(7,5),ss=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function vx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Fw(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function Bw(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Sae(e){let t=Cae[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(Bw(n,"line-height"));isNaN(i)&&(i=void 0),t={family:Bw(n,"font-family"),size:Bw(n,"font-size").replace("px",""),style:Bw(n,"font-style"),weight:Bw(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Aae<wWe&&(Cae[e._font]=t,Aae++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Sd(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Bt.clone(n)),l(i)&&(i=Bt.clone(i)),l(o)&&(o=Bt.clone(o)),l(r)&&(r=Mt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=z.clone(y(e.fillColor,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=z.clone(y(e.backgroundColor,DWe)),this._backgroundPadding=U.clone(y(e.backgroundPadding,IWe)),this._style=y(e.style,Xo.FILL),this._verticalOrigin=y(e.verticalOrigin,On.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,xi.LEFT),this._pixelOffset=U.clone(y(e.pixelOffset,U.ZERO)),this._eyeOffset=d.clone(y(e.eyeOffset,d.ZERO)),this._position=d.clone(y(e.position,d.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=y(e.heightReference,Ye.NONE),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,Sae(this),this._updateClamping()}Object.defineProperties(Sd.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!d.equals(t,e)){d.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),Fw(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Sd.filterUnsupportedCharacters(e);this._renderedText=Sd.enableRightToLeftDetection?NWe(t):t,vx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,vx(this),Sae(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),vx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),vx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,vx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,vx(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;U.equals(t,e)||(U.clone(e,t),Fw(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,vx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Bt.equals(t,e)){this._translucencyByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Bt.equals(t,e)){this._pixelOffsetScaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Bt.equals(t,e)){this._scaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!d.equals(t,e)){d.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Fw(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),Fw(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),Fw(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Mt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});Sd.prototype._updateClamping=function(){lo._updateClamping(this._labelCollection,this)};Sd.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return lo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};Sd.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===On.BOTTOM||e.verticalOrigin===On.BASELINE?o-=s:e.verticalOrigin===On.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,h=e._glyphs,p=h.length;for(let _=0;_<p;++_){let m=h[_],x=m.billboard;if(!l(x))continue;let b=t.x+x._translate.x,T=t.y-x._translate.y,C=m.dimensions.width*a,A=m.dimensions.height*a;e.verticalOrigin===On.BOTTOM||e.verticalOrigin===On.BASELINE?T-=A:e.verticalOrigin===On.CENTER&&(T-=A*.5),e._verticalOrigin===On.TOP?T+=oa.PADDING*a:(e._verticalOrigin===On.BOTTOM||e._verticalOrigin===On.BASELINE)&&(T-=oa.PADDING*a),i=Math.min(i,b),o=Math.min(o,T),u=Math.max(u,b+C),f=Math.max(f,T+A)}r=u-i,s=f-o}return l(n)||(n=new qe),n.x=i,n.y=o,n.width=r,n.height=s,n};Sd.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Sd.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&d.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&d.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Sd.prototype.isDestroyed=function(){return!1};Sd.enableRightToLeftDetection=!1;function PWe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ss.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=ss.RTL:n.test(f)?a=ss.LTR:i.test(f)?a=ss.BRACKETS:a=ss.WEAK,u===0&&(s=a),s===a&&a!==ss.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function RWe(e){return e.split("").reverse().join("")}function kw(e,t,n){return e.slice(0,t)+n+e.slice(t)}function OWe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var MWe="\u05D0-\u05EA",LWe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Eae=new RegExp(`[${MWe}${LWe}]`);function NWe(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Eae.test(o.charAt(0)),s=PWe(o,Eae),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],h=f.Type===ss.BRACKETS?OWe(f.Word):RWe(f.Word);r?f.Type===ss.RTL?(c=h+c,a=0):f.Type===ss.LTR?(c=kw(c,a,f.Word),a+=f.Word.length):(f.Type===ss.WEAK||f.Type===ss.BRACKETS)&&(f.Type===ss.WEAK&&s[u-1].Type===ss.BRACKETS?c=h+c:s[u-1].Type===ss.RTL?(c=h+c,a=0):s.length>u+1?s[u+1].Type===ss.RTL?(c=h+c,a=0):(c=kw(c,a,f.Word),a+=f.Word.length):c=kw(c,0,h)):f.Type===ss.RTL?c=kw(c,a,h):f.Type===ss.LTR?(c+=f.Word,a=c.length):(f.Type===ss.WEAK||f.Type===ss.BRACKETS)&&(u>0&&s[u-1].Type===ss.RTL?s.length>u+1?s[u+1].Type===ss.RTL?c=kw(c,a,h):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` +`)}return n}var wx=Sd;var Iae=Ur(vae(),1);function BWe(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function kWe(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var VWe=1.2,Pae="ID_WHITE_PIXEL",LW=new U(4,4),UWe=new qe(1,1,1,1);function zWe(e){let t=document.createElement("canvas");t.width=LW.x,t.height=LW.y;let n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Pae,t)}var Af={};function HWe(e,t,n,i,o,r,s){return Af.font=t,Af.fillColor=n,Af.strokeColor=i,Af.strokeWidth=o,Af.padding=oa.PADDING,s===On.CENTER?Af.textBaseline="middle":s===On.TOP?Af.textBaseline="top":Af.textBaseline="bottom",Af.fill=r===Xo.FILL||r===Xo.FILL_AND_OUTLINE,Af.stroke=r===Xo.OUTLINE||r===Xo.FILL_AND_OUTLINE,Af.backgroundColor=z.BLACK,WC(e,Af)}function NW(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function GWe(e,t,n,i){i.index=e.addImageSync(t,n)}var WWe=new Iae.default;function jWe(e,t){let n=t._renderedText,i=WWe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length,a,c,u;if(t._relativeSize=t._fontSize/oa.FONT_SIZE,o<s)for(c=o;c<s;++c)NW(e,r[c]);r.length=o;let f=t.show&&t._showBackground&&n.split(` +`).join("").length>0,h=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(l(h)||(h=p.add({collection:e,image:Pae,imageSubRegion:UWe}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=xi.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t.totalScale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition,h.disableDepthTestDistance=t._disableDepthTestDistance,h.clusterShow=t.clusterShow):l(h)&&(p.remove(h),t._backgroundBillboard=h=void 0);let _=e._glyphTextureCache;for(u=0;u<o;++u){let m=i[u],x=t._verticalOrigin,b=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+x]),T=_[b];if(!l(T)){let C=`${t._fontStyle} ${t._fontWeight} ${oa.FONT_SIZE}px ${t._fontFamily}`,A=HWe(m,C,z.WHITE,z.WHITE,0,Xo.FILL,x);if(T=new kWe(e,-1,A.dimensions),_[b]=T,A.width>0&&A.height>0){let S=(0,Dae.default)(A,{cutoff:oa.CUTOFF,radius:oa.RADIUS}),v=A.getContext("2d"),D=A.width,O=A.height,R=v.getImageData(0,0,D,O);for(let M=0;M<D;M++)for(let L=0;L<O;L++){let g=L*D+M,E=S[g]*255,w=g*4;R.data[w+0]=E,R.data[w+1]=E,R.data[w+2]=E,R.data[w+3]=E}v.putImageData(R,0,0),m!==" "&&GWe(e._textureAtlas,b,A,T)}}if(a=r[u],l(a)?T.index===-1?NW(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new BWe,r[u]=a),a.textureInfo=T,a.dimensions=T.dimensions,T.index!==-1){let C=a.billboard,A=e._spareBillboards;l(C)||(A.length>0?C=A.pop():(C=e._billboardCollection.add({collection:e}),C._labelDimensions=new U,C._labelTranslate=new U),a.billboard=C),C.show=t._show,C.position=t._position,C.eyeOffset=t._eyeOffset,C.pixelOffset=t._pixelOffset,C.horizontalOrigin=xi.LEFT,C.verticalOrigin=t._verticalOrigin,C.heightReference=t._heightReference,C.scale=t.totalScale,C.pickPrimitive=t,C.id=t._id,C.image=b,C.translucencyByDistance=t._translucencyByDistance,C.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,C.scaleByDistance=t._scaleByDistance,C.distanceDisplayCondition=t._distanceDisplayCondition,C.disableDepthTestDistance=t._disableDepthTestDistance,C._batchIndex=t._batchIndex,C.outlineColor=t.outlineColor,t.style===Xo.FILL_AND_OUTLINE?(C.color=t._fillColor,C.outlineWidth=t.outlineWidth):t.style===Xo.FILL?(C.color=t._fillColor,C.outlineWidth=0):t.style===Xo.OUTLINE&&(C.color=z.TRANSPARENT,C.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function wae(e,t,n){return t===xi.CENTER?-e/2:t===xi.RIGHT?-(e+n.x):n.x}var rr=new U,qWe=new U;function YWe(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,f=1,h,p=t.length,_=e._backgroundBillboard,m=U.clone(l(_)?e._backgroundPadding:U.ZERO,qWe);for(m.x/=e._relativeSize,m.y/=e._relativeSize,h=0;h<p;++h)n.charAt(h)===` +`?(a.push(r),++f,r=0):(i=t[h],o=i.dimensions,u=Math.max(u,o.height-o.descent),c=Math.max(c,o.descent),r+=o.width-o.minx,h<p-1&&(r+=t[h+1].dimensions.minx),s=Math.max(s,r));a.push(r);let x=u+c,b=e.totalScale,T=e._horizontalOrigin,C=e._verticalOrigin,A=0,S=a[A],v=wae(S,T,m),D=(l(e._lineHeight)?e._lineHeight:VWe*e._fontSize)/e._relativeSize,O=D*(f-1),R=s,M=x+O;l(_)&&(R+=m.x*2,M+=m.y*2,_._labelHorizontalOrigin=T),rr.x=v*b,rr.y=0;let L=!0,g=0;for(h=0;h<p;++h)if(n.charAt(h)===` +`)++A,g+=D,S=a[A],v=wae(S,T,m),rr.x=v*b,L=!0;else if(i=t[h],o=i.dimensions,C===On.TOP?(rr.y=o.height-u-m.y,rr.y+=oa.PADDING):C===On.CENTER?rr.y=(O+o.height-u)/2:C===On.BASELINE?(rr.y=O,rr.y-=oa.PADDING):(rr.y=O+c+m.y,rr.y-=oa.PADDING),rr.y=(rr.y-o.descent-g)*b,L&&(rr.x-=oa.PADDING*b,L=!1),l(i.billboard)&&(i.billboard._setTranslate(rr),i.billboard._labelDimensions.x=R,i.billboard._labelDimensions.y=M,i.billboard._labelHorizontalOrigin=T),h<p-1){let E=t[h+1];rr.x+=(o.width-o.minx+E.dimensions.minx)*b}if(l(_)&&n.split(` +`).join("").length>0&&(T===xi.CENTER?v=-s/2-m.x:T===xi.RIGHT?v=-(s+m.x*2):v=0,rr.x=v*b,C===On.TOP?rr.y=x-u-c:C===On.CENTER?rr.y=(x-u)/2-c:C===On.BASELINE?rr.y=-m.y-c:rr.y=0,rr.y=rr.y*b,_.width=R,_.height=M,_._setTranslate(rr),_._labelTranslate=U.clone(rr,_._labelTranslate)),tf(e.heightReference))for(h=0;h<p;++h){i=t[h];let E=i.billboard;l(E)&&(E._labelTranslate=U.clone(rr,E._labelTranslate))}}function Rae(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)NW(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function im(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new Cf({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new Cf({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Io.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(im.prototype,{length:{get:function(){return this._labels.length}}});im.prototype.add=function(e){let t=new wx(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};im.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Rae(this,e),!0}return!1};im.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Rae(this,e[t]);e.length=0};im.prototype.contains=function(e){return l(e)&&e._labelCollection===this};im.prototype.get=function(e){return this._labels[e]};im.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;l(this._textureAtlas)||(this._textureAtlas=new Ex({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new Ex({context:i,initialSize:LW}),n.textureAtlas=this._backgroundTextureAtlas,zWe(this._backgroundTextureAtlas));let o=this._labelsToUpdate.length;for(let s=0;s<o;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(jWe(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(YWe(a),a._repositionAllGlyphs=!1);let u=a._glyphs.length-c;this._totalGlyphCount+=u}let r=n.length>0?Io.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};im.prototype.isDestroyed=function(){return!1};im.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var Fp=im;var _B=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 position2DHigh; +in vec3 position2DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 prevPosition2DHigh; +in vec3 prevPosition2DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec3 nextPosition2DHigh; +in vec3 nextPosition2DLow; +in vec4 texCoordExpandAndBatchIndex; + +out vec2 v_st; +out float v_width; +out vec4 v_pickColor; +out float v_polylineAngle; void main() { - vec3 position; - vec3 direction; - if (czm_orthographicIn3D == 1.0) + float texCoord = texCoordExpandAndBatchIndex.x; + float expandDir = texCoordExpandAndBatchIndex.y; + bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; + float batchTableIndex = texCoordExpandAndBatchIndex.w; + + vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); + float width = widthAndShow.x + 0.5; + float show = widthAndShow.y; + + if (width < 1.0) { - vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; - vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom - vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top - position = vec3(mix(minPlane, maxPlane, uv), 0.0); - direction = vec3(0.0, 0.0, -1.0); - } - else - { - position = vec3(0.0); - direction = normalize(positionEC.xyz); + show = 0.0; } - czm_ray ray = czm_ray(position, direction); + vec4 pickColor = batchTable_getPickColor(batchTableIndex); - vec3 ellipsoid_center = czm_view[3].xyz; - - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); - if (!czm_isEmpty(intersection)) + vec4 p, prev, next; + if (czm_morphTime == 1.0) { - out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); + p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); + prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); + next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); + prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); + next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); } else { - discard; + p = czm_columbusViewMorph( + czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), + czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), + czm_morphTime); + prev = czm_columbusViewMorph( + czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), + czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), + czm_morphTime); + next = czm_columbusViewMorph( + czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), + czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), + czm_morphTime); } - czm_writeLogDepth(); -} -`;var iL=`in vec4 position; + #ifdef DISTANCE_DISPLAY_CONDITION + vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); + vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); + vec3 centerLow = centerLowAndRadius.xyz; + float radius = centerLowAndRadius.w; + vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); -out vec4 positionEC; + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + lengthSq = czm_eyeHeight2D.y; + } + else + { + vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); + lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); + } + + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + if (lengthSq < nearSq || lengthSq > farSq) + { + show = 0.0; + } + #endif + + float polylineAngle; + vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); + gl_Position = czm_viewportOrthographic * positionWC * show; + + v_st.s = texCoord; + v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); + + v_width = width; + v_pickColor = pickColor; + v_polylineAngle = polylineAngle; +} +`;var zc={};zc.numberOfPoints=function(e,t,n){let i=d.distance(e,t);return Math.ceil(i/n)};zc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var XWe=new fe;zc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,XWe).height}return i};var KWe=new F,ZWe=new d,Oae=new d,$We=new sn(d.UNIT_X,0),Mae=new d,QWe=new sn(d.UNIT_X,0),JWe=new d,eje=new d,BW=[];function Nae(e,t,n){let i=BW;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var xB=new fe,yB=new fe,G_=new d,kW=new d,tje=new d,FW=new Kg,Vw=new Xa;function nje(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,kW),u=i.scaleToGeodeticSurface(t,tje),f=zc.numberOfPoints(e,t,n),h=i.cartesianToCartographic(c,xB),p=i.cartesianToCartographic(u,yB),_=Nae(f,o,r);FW.setEndPoints(h,p);let m=FW.surfaceDistance/f,x=a;h.height=o;let b=i.cartographicToCartesian(h,G_);d.pack(b,s,x),x+=3;for(let T=1;T<f;T++){let C=FW.interpolateUsingSurfaceDistance(T*m,yB);C.height=_[T],b=i.cartographicToCartesian(C,G_),d.pack(b,s,x),x+=3}return x}function ije(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,xB),u=i.cartesianToCartographic(t,yB),f=zc.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let h=Nae(f,o,r);Vw.ellipsoid.equals(i)||(Vw=new Xa(void 0,void 0,i)),Vw.setEndPoints(c,u);let p=Vw.surfaceDistance/f,_=a;c.height=o;let m=i.cartographicToCartesian(c,G_);d.pack(m,s,_),_+=3;for(let x=1;x<f;x++){let b=Vw.interpolateUsingSurfaceDistance(x*p,yB);b.height=h[x],m=i.cartographicToCartesian(b,G_),d.pack(m,s,_),_+=3}return _}zc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,F.IDENTITY);let o=F.inverseTransformation(t,KWe),r=F.multiplyByPoint(o,d.ZERO,ZWe),s=d.normalize(F.multiplyByPointAsVector(o,d.UNIT_Y,Oae),Oae),a=sn.fromPointNormal(r,s,$We),c=d.normalize(F.multiplyByPointAsVector(o,d.UNIT_X,Mae),Mae),u=sn.fromPointNormal(r,c,QWe),f=1;n.push(d.clone(e[0]));let h=n[0],p=e.length;for(let _=1;_<p;++_){let m=e[_];if(sn.getPointDistance(u,h)<0||sn.getPointDistance(u,m)<0){let x=Qn.lineSegmentPlane(h,m,a,JWe);if(l(x)){let b=d.multiplyByScalar(s,5e-9,eje);sn.getPointDistance(a,h)<0&&d.negate(b,b),n.push(d.add(x,b,new d)),i.push(f+1),d.negate(b,b),n.push(d.add(x,b,new d)),f=1}}n.push(d.clone(e[_])),f++,h=m}i.push(f)}return{positions:n,lengths:i}};zc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ee.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],kW);if(o=r?o[0]:o,o!==0){let b=i.geodeticSurfaceNormal(x,G_);d.multiplyByScalar(b,o,b),d.add(x,b,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=y(e.granularity,P.RADIANS_PER_DEGREE);s=P.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=zc.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),h=0;for(c=0;c<n-1;c++){let x=t[c],b=t[c+1],T=r?o[c]:o,C=r?o[c+1]:o;h=nje(x,b,s,i,T,C,f,h)}BW.length=0;let p=t[n-1],_=i.cartesianToCartographic(p,xB);_.height=r?o[n-1]:o;let m=i.cartographicToCartesian(_,G_);return d.pack(m,f,u-3),f};var Lae=new fe,oje=new fe;zc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ee.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let T=i.scaleToGeodeticSurface(t[0],kW);if(o=r?o[0]:o,o!==0){let C=i.geodeticSurfaceNormal(T,G_);d.multiplyByScalar(C,o,C),d.add(T,C,T)}return[T.x,T.y,T.z]}let s=y(e.granularity,P.RADIANS_PER_DEGREE),a=0,c,u=i.cartesianToCartographic(t[0],Lae),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],oje),a+=zc.numberOfPointsRhumbLine(u,f,s),u=fe.clone(f,Lae);let h=(a+1)*3,p=new Array(h),_=0;for(c=0;c<n-1;c++){let T=t[c],C=t[c+1],A=r?o[c]:o,S=r?o[c+1]:o;_=ije(T,C,s,i,A,S,p,_)}BW.length=0;let m=t[n-1],x=i.cartesianToCartographic(m,xB);x.height=r?o[n-1]:o;let b=i.cartographicToCartesian(x,G_);return d.pack(b,p,h-3),p};zc.generateCartesianArc=function(e){let t=zc.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};zc.generateCartesianRhumbArc=function(e){let t=zc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};var Ni=zc;function uu(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Yi.fromType(Yi.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=bo(n,d.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(d.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Ni.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Bae),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var Fae=uu.POSITION_INDEX=0,rje=uu.SHOW_INDEX=1,sje=uu.WIDTH_INDEX=2,aje=uu.MATERIAL_INDEX=3,Uw=uu.POSITION_SIZE_INDEX=4,cje=uu.DISTANCE_DISPLAY_CONDITION=5,Bae=uu.NUMBER_OF_PROPERTIES=6;function Bp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(uu.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Bp(this,rje))}},positions:{get:function(){return this._positions},set:function(e){let t=bo(e,d.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(d.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Bp(this,Uw),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Bp(this,Fae),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Bp(this,aje))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Bp(this,sje))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!d.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(d.clone(t[0]))):t.length>2&&d.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Bp(this,Uw)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),Bp(this,cje))}}});uu.prototype.update=function(){let e=F.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Fae]>0||this._propertiesChanged[Uw]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=Ni.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)Bp(this,Uw);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){Bp(this,Uw);break}}};uu.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};uu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Bae-1;++t)e[t]=0};uu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var vd=uu;var lje=vd.SHOW_INDEX,uje=vd.WIDTH_INDEX,UW=vd.POSITION_INDEX,fje=vd.MATERIAL_INDEX,kae=vd.POSITION_SIZE_INDEX,dje=vd.DISTANCE_DISPLAY_CONDITION,jae=vd.NUMBER_OF_PROPERTIES,vl={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function wd(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(jae),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Fe.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(wd.prototype,{length:{get:function(){return zW(this),this._polylines.length}}});wd.prototype.add=function(e){let t=new vd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};wd.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};wd.prototype.removeAll=function(){HW(this),Zae(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};wd.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};wd.prototype.get=function(e){return zW(this),this._polylines[e]};function hje(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:X.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:X.FLOAT,componentsPerAttribute:2}];e._batchTable=new MT(t,n,e._polylines.length)}var qae=new Hn,Yae=new oe,Xae=new U;wd.prototype.update=function(e){if(zW(this),this._polylines.length===0||!this.show)return;xje(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Ft.maximumVertexTextureImageUnits===0)throw new re("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");hje(this,t),this._createBatchTable=!1}if(this._createVertexArray||pje(this))zae(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ne.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[kae]||o[fje])zae(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let h=0;h<u;++h){i=c[h],o=i._propertiesChanged;let p=i._bucket,_=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[UW]&&p.writeUpdate(_,i,this._positionBuffer,n);break}_+=f[m].lengthOfPositions}if((o[lje]||o[uje])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(o[UW]||o[kae]){let m=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=Hn.fromCartesian(m.center,qae),b=oe.fromElements(x.low.x,x.low.y,x.low.z,m.radius,Yae);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[dje]){let m=Xae;m.x=0,m.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(m.x=x.near,m.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<jae;++c)o[c]=0;let r=F.IDENTITY;e.mode===ne.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ve.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ve.fromCache({blending:ln.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;mje(this,e,c,r)}};var zw=new ae,Vae=new ae;function mje(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),_=u.length;for(let m=0;m<_;++m){let x=u[m],b=x.buckets,T=b.length;for(let C=0;C<T;++C){let A=b[C],S=A.offset,v=A.bucket.shaderProgram,D=A.bucket.polylines,O=D.length,R,M,L=0,g,E;for(let w=0;w<O;++w){let I=D[w],N=_je(I._material);if(N!==R){if(l(R)&&L>0){let G=M.isTranslucent();a>=s?(g=new $e({owner:e}),n.push(g)):g=n[a],++a,E=xt(p(M._uniforms),e._uniformMap),g.boundingVolume=ae.clone(zw,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=v,g.vertexArray=x.va,g.renderState=G?e._translucentRS:e._opaqueRS,g.pass=G?we.TRANSLUCENT:we.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=E,g.count=L,g.offset=S,S+=L,L=0,c=!0,r.push(g)}M=I._material,M.update(o),R=N}let B=I._locatorBuckets,H=B.length;for(let G=0;G<H;++G){let k=B[G];k.locator===A&&(L+=k.count)}let V;t.mode===ne.SCENE3D?V=I._boundingVolumeWC:t.mode===ne.COLUMBUS_VIEW?V=I._boundingVolume2D:t.mode===ne.SCENE2D?l(I._boundingVolume2D)&&(V=ae.clone(I._boundingVolume2D,Vae),V.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(V=ae.union(I._boundingVolumeWC,I._boundingVolume2D,Vae)),c?(c=!1,ae.clone(V,zw)):ae.union(V,zw,zw)}l(R)&&L>0&&(a>=s?(g=new $e({owner:e}),n.push(g)):g=n[a],++a,E=xt(p(M._uniforms),e._uniformMap),g.boundingVolume=ae.clone(zw,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=v,g.vertexArray=x.va,g.renderState=M.isTranslucent()?e._translucentRS:e._opaqueRS,g.pass=M.isTranslucent()?we.TRANSLUCENT:we.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=E,g.count=L,g.offset=S,c=!0,r.push(g)),R=void 0}}n.length=a}wd.prototype.isDestroyed=function(){return!1};wd.prototype.destroy=function(){return Kae(this),HW(this),Zae(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function pje(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[UW]?(i.bufferUsage!==Fe.STREAM_DRAW&&(t=!0,i.bufferUsage=Fe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Fe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Fe.STATIC_DRAW):i.frameCount--),t}var Uae=[0,0,0];function zae(e,t,n){e._createVertexArray=!1,HW(e),Kae(e),yje(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,h=e._polylineBuckets,p,_;for(p in h)h.hasOwnProperty(p)&&(_=h[p],_.updateShader(t,r,s),f+=_.lengthOfPositions);if(f>0){let m=e._mode,x=new Float32Array(6*f*3),b=new Float32Array(f*4),T,C=0,A=0,S=0;for(p in h)if(h.hasOwnProperty(p)){_=h[p],_.write(x,b,C,A,S,r,t,n),m===ne.MORPHING&&(l(T)||(T=new Float32Array(6*f*3)),_.writeForMorph(T,C));let E=_.lengthOfPositions;C+=6*E*3,A+=E*4,S+=E*4,c=_.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,D=Fe.STATIC_DRAW;e._positionBuffer=_t.createVertexBuffer({context:t,typedArray:x,usage:v});let O;l(T)&&(O=_t.createVertexBuffer({context:t,typedArray:T,usage:v})),e._texCoordExpandAndBatchIndexBuffer=_t.createVertexBuffer({context:t,typedArray:b,usage:D});let R=3*Float32Array.BYTES_PER_ELEMENT,M=4*Float32Array.BYTES_PER_ELEMENT,L=0,g=i.length;for(let E=0;E<g;++E)if(o=i[E],o.length>0){let w=new Uint16Array(o),I=_t.createIndexBuffer({context:t,typedArray:w,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});L+=a[E];let N=6*(E*(R*P.SIXTY_FOUR_KILOBYTES)-L*R),B=R+N,H=R+B,V=R+H,G=R+V,k=R+G,W=E*(M*P.SIXTY_FOUR_KILOBYTES)-L*M,Y=[{index:vl.position3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:vl.position3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:vl.position2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:vl.position2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:vl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:H,strideInBytes:6*R},{index:vl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:vl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:H,strideInBytes:6*R},{index:vl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:vl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:vl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:vl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:vl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:vl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:X.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:W}],J,j,K,Q;m===ne.SCENE3D?(j=e._positionBuffer,J="vertexBuffer",K=Uae,Q="value"):m===ne.SCENE2D||m===ne.COLUMBUS_VIEW?(j=Uae,J="value",K=e._positionBuffer,Q="vertexBuffer"):(j=O,J="vertexBuffer",K=e._positionBuffer,Q="vertexBuffer"),Y[0][J]=j,Y[1][J]=j,Y[2][Q]=K,Y[3][Q]=K,Y[4][J]=j,Y[5][J]=j,Y[6][Q]=K,Y[7][Q]=K,Y[8][J]=j,Y[9][J]=j,Y[10][Q]=K,Y[11][Q]=K;let de=new ni({context:t,attributes:Y,indexBuffer:I});e._vertexArrays.push({va:de,buckets:u[E]})}}}function gje(e,t){return t instanceof Rt?t.id:t}var bB=[];function _je(e){let t=Yi._uniformList[e.type],n=t.length;bB.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];bB[i]=r,bB[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(bB,gje)}`}function yje(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new om(c,t,n)),u.addPolyline(a)}}}function xje(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function zW(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function HW(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function Kae(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}wd.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Zae(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function VW(e,t,n){this.count=e,this.offset=t,this.bucket=n}function om(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}om.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};om.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),zt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Ue({defines:i,sources:[`in vec4 v_pickColor; +`,this.material.shaderSource,VT]}),r=t.getVertexShaderCallback()(_B),s=new Ue({defines:i,sources:[rf,r]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:vl})};function $ae(e){return d.dot(d.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===Wt.INTERSECTING}om.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ne.SCENE3D||!$ae(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var Ts=new d,Ef=new d,Sf=new d,TB=new d,bje=new oe,Tje=new U;om.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,h=f.length;for(let p=0;p<h;++p){let _=f[p],m=_.width,x=_.show&&m>0,b=_._index,T=this.getSegments(_,a),C=T.positions,A=T.lengths,S=C.length,v=_.getPickId(s).color,D=0,O=0,R;for(let H=0;H<S;++H){H===0?_._loop?R=C[S-2]:(R=TB,d.subtract(C[0],C[1],R),d.add(C[0],R,R)):R=C[H-1],d.clone(R,Ef),d.clone(C[H],Ts),H===S-1?_._loop?R=C[1]:(R=TB,d.subtract(C[S-1],C[S-2],R),d.add(C[S-1],R,R)):R=C[H+1],d.clone(R,Sf);let V=A[D];H===O+V&&(O+=V,++D);let G=H-O===0,k=H===O+A[D]-1;c===ne.SCENE2D&&(Ef.z=0,Ts.z=0,Sf.z=0),(c===ne.SCENE2D||c===ne.MORPHING)&&(G||k)&&u-Math.abs(Ts.x)<1&&((Ts.x<0&&Ef.x>0||Ts.x>0&&Ef.x<0)&&d.clone(Ts,Ef),(Ts.x<0&&Sf.x>0||Ts.x>0&&Sf.x<0)&&d.clone(Ts,Sf));let W=G?2:0,Y=k?2:4;for(let J=W;J<Y;++J){Hn.writeElements(Ts,e,n),Hn.writeElements(Ef,e,n+6),Hn.writeElements(Sf,e,n+12);let j=J-2<0?-1:1;t[o]=H/(S-1),t[o+1]=2*(J%2)-1,t[o+2]=j,t[o+3]=b,n+=6*3,o+=4}}let M=bje;M.x=z.floatToByte(v.red),M.y=z.floatToByte(v.green),M.z=z.floatToByte(v.blue),M.w=z.floatToByte(v.alpha);let L=Tje;L.x=m,L.y=x?1:0;let g=c===ne.SCENE2D?_._boundingVolume2D:_._boundingVolumeWC,E=Hn.fromCartesian(g.center,qae),w=E.high,I=oe.fromElements(E.low.x,E.low.y,E.low.z,g.radius,Yae),N=Xae;N.x=0,N.y=Number.MAX_VALUE;let B=_.distanceDisplayCondition;l(B)&&(N.x=B.near,N.y=B.far),r.setBatchedAttribute(b,0,L),r.setBatchedAttribute(b,1,M),r.attributes.length>2&&(r.setBatchedAttribute(b,2,w),r.setBatchedAttribute(b,3,I),r.setBatchedAttribute(b,4,N))}};var Cje=new d,Aje=new d,Eje=new d,Hae=new d;om.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,h=0;for(let p=0;p<u;++p){let _;p===0?s._loop?_=a[u-2]:(_=Hae,d.subtract(a[0],a[1],_),d.add(a[0],_,_)):_=a[p-1],_=F.multiplyByPoint(n,_,Aje);let m=F.multiplyByPoint(n,a[p],Cje),x;p===u-1?s._loop?x=a[1]:(x=Hae,d.subtract(a[u-1],a[u-2],x),d.add(a[u-1],x,x)):x=a[p+1],x=F.multiplyByPoint(n,x,Eje);let b=c[f];p===h+b&&(h+=b,++f);let T=p-h===0,C=p===h+c[f]-1,A=T?2:0,S=C?2:4;for(let v=A;v<S;++v)Hn.writeElements(m,e,t),Hn.writeElements(_,e,t+6),Hn.writeElements(x,e,t+12),t+=6*3}}};var Sje=new Array(1);om.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new VW(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let h=0;h<f;++h){let p=u[h];p._locatorBuckets=[];let _;if(this.mode===ne.SCENE3D){_=Sje;let x=p._actualPositions.length;if(x>0)_[0]=x;else continue}else _=p._segments.lengths;let m=_.length;if(m>0){let x=0;for(let b=0;b<m;++b){let T=_[b]-1;for(let C=0;C<T;++C)c+4>P.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new VW(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new VW(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};om.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var jC={positions:void 0,lengths:void 0},Gae=new Array(1),vje=new d,wje=new fe;om.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ne.SCENE3D)return Gae[0]=n.length,jC.positions=n,jC.lengths=Gae,jC;$ae(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=vje;for(let u=0;u<s;++u)a=n[u],c=F.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,wje)));if(o.length>0){e._boundingVolume2D=ae.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new d(u.z,u.x,u.y)}return jC.positions=o,jC.lengths=e._segments.lengths,jC};var Wae;om.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Wae,c=6*s*3;!l(a)||a.length<c?a=Wae=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,h=u.lengths,p=0,_=0,m=0,x;s=f.length;for(let b=0;b<s;++b){b===0?t._loop?x=f[s-2]:(x=TB,d.subtract(f[0],f[1],x),d.add(f[0],x,x)):x=f[b-1],d.clone(x,Ef),d.clone(f[b],Ts),b===s-1?t._loop?x=f[1]:(x=TB,d.subtract(f[s-1],f[s-2],x),d.add(f[s-1],x,x)):x=f[b+1],d.clone(x,Sf);let T=h[_];b===m+T&&(m+=T,++_);let C=b-m===0,A=b===m+h[_]-1;o===ne.SCENE2D&&(Ef.z=0,Ts.z=0,Sf.z=0),(o===ne.SCENE2D||o===ne.MORPHING)&&(C||A)&&r-Math.abs(Ts.x)<1&&((Ts.x<0&&Ef.x>0||Ts.x>0&&Ef.x<0)&&d.clone(Ts,Ef),(Ts.x<0&&Sf.x>0||Ts.x>0&&Sf.x<0)&&d.clone(Ts,Sf));let S=C?2:0,v=A?2:4;for(let D=S;D<v;++D)Hn.writeElements(Ts,a,p),Hn.writeElements(Ef,a,p+6),Hn.writeElements(Sf,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var rm=wd;function W_(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new Cf({batchTable:e.batchTable}),this._labelCollection=new Fp({batchTable:e.batchTable}),this._polylineCollection=new rm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(W_.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function Dje(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+se.packedLength+ee.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,se.pack(n,s,a),a+=se.packedLength,ee.pack(t,s,a),s}var Ije=new yi("createVectorTilePoints",5),Pje=new d;function Rje(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Dje(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=Ije.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3;for(let _=0;_<p;++_){let m=h[_],x=d.unpack(n,_*3,Pje),b=c.add();b.position=x,b._batchIndex=m;let T=u.add();T.text=" ",T.position=x,T._batchIndex=m;let C=f.add();C.positions=[d.clone(x),d.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}W_.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],u=n.get(a),f=i.get(a),h=o.get(a);t[c]=new H_(e,c,u,f,h)}};W_.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function Oje(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=H_.defaultPointSize,s.color=H_.defaultColor,s.pointOutlineColor=H_.defaultPointOutlineColor,s.pointOutlineWidth=H_.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Xo.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new U(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=xi.CENTER,s.verticalOrigin=On.CENTER,s.labelHorizontalOrigin=xi.RIGHT,s.labelVerticalOrigin=On.BASELINE}}var Mje=new z,Lje=new z,Nje=new z,Fje=new z,Bje=new z,kje=new z,Hw=new Bt,Gw=new Bt,GW=new Mt;W_.prototype.applyStyle=function(e,t){if(!l(e)){Oje(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,Mje)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Lje)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Nje)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Fje)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,Bje)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(Hw.near=a.x,Hw.nearValue=a.y,Hw.far=a.z,Hw.farValue=a.w,s.scaleByDistance=Hw):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(Gw.near=a.x,Gw.nearValue=a.y,Gw.far=a.z,Gw.farValue=a.w,s.translucencyByDistance=Gw):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(GW.near=a.x,GW.far=a.y,s.distanceDisplayCondition=GW):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,kje)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};W_.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Rje(this,e.mapProjection.ellipsoid)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};W_.prototype.isDestroyed=function(){return!1};W_.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var CB=W_;function kp(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,d.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=kn.BOTH}Object.defineProperties(kp.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function Vje(e){let t=new Float64Array(3+d.packedLength+ee.packedLength+se.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,d.pack(e._center,t,n),n+=d.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,se.pack(e._rectangle,t,n),t}function Uje(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=wn.unpack(t,n),n+=wn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],h=t[n++],p=new Array(h);for(let _=0;_<h;++_)p[_]=t[n++];s[a]=new yp({color:c,offset:u,count:f,batchIds:p})}}var zje=new yi("createVectorTilePolygons",5),Hje=new z;function Gje(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(se.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let _=e._batchTable,m=s.length;for(let x=0;x<m;++x){let b=_.getColor(x,Hje);s[x]=b.toRgba()}a=e._packedBuffer=Vje(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,h=e._polygonMaximumHeights;l(f)&&l(h)&&(f=f.slice(),h=h.slice(),c.push(f.buffer,h.buffer),u.minimumHeights=f,u.maximumHeights=h);let p=zje.scheduleTask(u,c);if(l(p))return p.then(_=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(_.packedBuffer),x=m[0];Uje(e,m),e._indices=Ne.getSizeInBytes(x)===2?new Uint16Array(_.indices):new Uint32Array(_.indices),e._indexOffsets=new Uint32Array(_.indexOffsets),e._indexCounts=new Uint32Array(_.indexCounts),e._batchedPositions=new Float32Array(_.positions),e._vertexBatchIds=new Uint16Array(_.batchIds),Wje(e),e._ready=!0}).catch(_=>{e.isDestroyed()||(e._error=_)})}function Wje(e){l(e._primitive)||(e._primitive=new oC({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}kp.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};kp.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};kp.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};kp.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};kp.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Gje(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};kp.prototype.isDestroyed=function(){return!1};kp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var AB=kp;var EB=`in vec4 currentPosition; +in vec4 previousPosition; +in vec4 nextPosition; +in vec2 expandAndWidth; +in float a_batchId; + +uniform mat4 u_modifiedModelView; void main() { - positionEC = czm_modelView * position; - gl_Position = czm_modelViewProjection * position; + float expandDir = expandAndWidth.x; + float width = abs(expandAndWidth.y) + 0.5; + bool usePrev = expandAndWidth.y < 0.0; - czm_vertexLogDepth(); + vec4 p = u_modifiedModelView * currentPosition; + vec4 prev = u_modifiedModelView * previousPosition; + vec4 next = u_modifiedModelView * nextPosition; + + float angle; + vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); + gl_Position = czm_viewportOrthographic * positionWC; } -`;var JS=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; - -in vec3 v_positionEC; - -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +`;function Dd(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Dd.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function jje(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+se.packedLength+ee.packedLength+d.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,se.pack(t,a,c),c+=se.packedLength,ee.pack(o,a,c),c+=ee.packedLength,d.pack(r,a,c),a}var qje=new yi("createVectorTilePolylines",5),qC={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Yje(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=jje(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=qje.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let h=f.indexDatatype;e._indices=h===Ne.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Xje(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Xje(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=_t.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),f=_t.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),h=_t.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),p=_t.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),_=_t.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),m=_t.createIndexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),x=[{index:qC.previousPosition,vertexBuffer:u,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:qC.currentPosition,vertexBuffer:f,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:qC.nextPosition,vertexBuffer:h,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:qC.expandAndWidth,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:2},{index:qC.a_batchId,vertexBuffer:_,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:x,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var Ww=new F,Qae=new d;function Kje(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,Ww),F.multiplyByPoint(Ww,e._center,Qae),F.setTranslation(Ww,Qae,Ww),Ww},u_highlightColor:function(){return e._highlightColor}})}function Zje(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:ln.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var $je=`uniform vec4 u_highlightColor; +void main() { - vec3 positionEC = czm_pointAlongRay(ray, intersection); - vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; - vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); - vec3 sphericalNormal = normalize(positionMC / u_radii); - vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates - vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates - - vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal); - vec3 positionToEyeEC = -positionEC; - - czm_materialInput materialInput; - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = (positionMC + u_radii) / u_radii; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef ONLY_SUN_LIGHTING - return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); -#else - return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif + out_FragColor = u_highlightColor; } +`;function Qje(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(EB),o=n.getFragmentShaderCallback(!1,void 0,!1)($je),r=new Ue({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[rf,i]}),s=new Ue({defines:["VECTOR_TILE"],sources:[o]});e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:qC})}function Jje(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new $e({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:we.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Dd.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,u=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let h=o[r],p=o[r+1]-h;for(s=0;s<p;++s){let _=(h+s)*3;f[u++]=i[_],f[u++]=i[_+1],f[u++]=i[_+2]}}return f};Dd.prototype.getPositions=function(e){return Dd.getPolylinePositions(this,e)};Dd.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Js(e,r)}};Dd.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function e7e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=z.WHITE}}var t7e=new z,n7e=z.WHITE,i7e=!0;Dd.prototype.applyStyle=function(e,t){if(!l(e)){e7e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,t7e):n7e,s.show=l(e.show)?e.show.evaluate(s):i7e}};Dd.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Yje(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Kje(this,t),Qje(this,t),Zje(this);let n=e.passes;(n.render||n.pick)&&Jje(this,e)};Dd.prototype.isDestroyed=function(){return!1};Dd.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var YC=Dd;var SB=`in vec3 startEllipsoidNormal; +in vec3 endEllipsoidNormal; +in vec4 startPositionAndHeight; +in vec4 endPositionAndHeight; +in vec4 startFaceNormalAndVertexCorner; +in vec4 endFaceNormalAndHalfWidth; +in float a_batchId; + +uniform mat4 u_modifiedModelView; +uniform vec2 u_minimumMaximumVectorHeights; + +out vec4 v_startPlaneEC; +out vec4 v_endPlaneEC; +out vec4 v_rightPlaneEC; +out float v_halfWidth; +out vec3 v_volumeUpEC; void main() { - // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii - // in the vertex shader. Only when it is larger than some constant, march along the ray. - // Otherwise perform one intersection test which will be the common case. + // vertex corner IDs + // 3-----------7 + // /| left /| + // / | 1 / | + // 2-----------6 5 end + // | / | / + // start |/ right |/ + // 0-----------4 + // + float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end + float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top - // Test if the ray intersects a sphere with the ellipsoid's maximum radius. - // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test - // may cause false negatives. This will discard fragments before marching the ray forward. - float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; - vec3 direction = normalize(v_positionEC); - vec3 ellipsoidCenter = czm_modelView[3].xyz; + vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; + vec3 right = normalize(cross(forward, startEllipsoidNormal)); - float t1 = -1.0; - float t2 = -1.0; + vec4 position = vec4(startPositionAndHeight.xyz, 1.0); + position.xyz += forward * isEnd; - float b = -2.0 * dot(direction, ellipsoidCenter); - float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; + v_volumeUpEC = czm_normal * normalize(cross(right, forward)); - float discriminant = b * b - 4.0 * c; - if (discriminant >= 0.0) { - t1 = (-b - sqrt(discriminant)) * 0.5; - t2 = (-b + sqrt(discriminant)) * 0.5; - } + // Push for volume height + float offset; + vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); - if (t1 < 0.0 && t2 < 0.0) { + // offset height to create volume + offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); + offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; + position.xyz += offset * ellipsoidNormal; + + // move from RTC to EC + position = u_modifiedModelView * position; + right = czm_normal * right; + + // Push for width in a direction that is in the start or end plane and in a plane with right + // N = normalEC ("right-facing" direction for push) + // R = right + // p = angle between N and R + // w = distance to push along R if R == N + // d = distance to push along N + // + // N R + // { p| } * cos(p) = dot(N, R) = w / d + // d | |w * d = w / dot(N, R) + // { | } + // o---------- polyline segment ----> + // + vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); + scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); + vec3 miterPushNormal = czm_normal * normalize(scratchNormal); + + offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC + offset = offset / dot(miterPushNormal, right); + position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); + + gl_Position = czm_depthClamp(czm_projection * position); + + position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); + vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; + v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); + v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); + + position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); + vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; + v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); + v_halfWidth = endFaceNormalAndHalfWidth.w; +} +`;var vB=`in vec4 v_startPlaneEC; +in vec4 v_endPlaneEC; +in vec4 v_rightPlaneEC; +in float v_halfWidth; +in vec3 v_volumeUpEC; + +uniform vec4 u_highlightColor; +void main() +{ + float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); + + // Discard for sky + if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME discard; +#endif // DEBUG_SHOW_VOLUME } - float t = min(t1, t2); - if (t < 0.0) { - t = 0.0; + vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); + eyeCoordinate /= eyeCoordinate.w; + + float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); + + // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction + halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); + + // Check distance of the eye coordinate against the right-facing plane + float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); + + // Check eye coordinate against the mitering planes + float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); + float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); + + if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME + out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); + return; +#else // DEBUG_SHOW_VOLUME + discard; +#endif // DEBUG_SHOW_VOLUME } + out_FragColor = u_highlightColor; - // March ray forward to intersection with larger sphere and find - czm_ray ray = czm_ray(t * direction, direction); + czm_writeDepthClamp(); +} +`;function Vp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new U(ui._defaultMinTerrainHeight,ui._defaultMaxTerrainHeight),this._boundingVolume=wn.fromRectangle(e.rectangle,ui._defaultMinTerrainHeight,ui._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Vp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function o7e(e,t,n){let i=ui.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;wn.fromRectangle(c,o,r,n,a)}function r7e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+se.packedLength+ee.packedLength+d.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,se.pack(t,a,c),c+=se.packedLength,ee.pack(o,a,c),c+=ee.packedLength,d.pack(r,a,c),a}var s7e=new yi("createVectorTileClampedPolylines"),j_={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function a7e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=r7e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=s7e.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let h=f.indexDatatype;e._indices=h===Ne.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),c7e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function c7e(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let h=_t.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),p=_t.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),_=_t.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),m=_t.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),x=_t.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),b=_t.createVertexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW}),T=_t.createVertexBuffer({context:t,typedArray:c,usage:Fe.STATIC_DRAW}),C=_t.createIndexBuffer({context:t,typedArray:u,usage:Fe.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),A=[{index:j_.startEllipsoidNormal,vertexBuffer:h,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:j_.endEllipsoidNormal,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:j_.startPositionAndHeight,vertexBuffer:_,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:j_.endPositionAndHeight,vertexBuffer:m,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:j_.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:j_.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:j_.a_batchId,vertexBuffer:T,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:A,indexBuffer:C}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var jw=new F,Jae=new d;function l7e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,jw),F.multiplyByPoint(jw,e._center,Jae),F.setTranslation(jw,Jae,jw),jw},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function ece(e){return Ve.fromCache({cull:{enabled:!0,face:bi.FRONT},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK}})}function u7e(e){l(e._rs)||(e._rs=ece(!1),e._rs3DTiles=ece(!0))}function f7e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(SB),o=n.getFragmentShaderCallback(!1,void 0,!0)(vB),r=new Ue({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[rf,i]}),s=new Ue({defines:["VECTOR_TILE"],sources:[o]});e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:j_})}function d7e(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new $e({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:we.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=$e.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=we.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===kn.TERRAIN||i===kn.BOTH)&&t.commandList.push(n),(i===kn.CESIUM_3D_TILE||i===kn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Vp.prototype.getPositions=function(e){return YC.getPolylinePositions(this,e)};Vp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Js(e,r)}};Vp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function h7e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=z.WHITE}}var m7e=new z,p7e=z.WHITE,g7e=!0;Vp.prototype.applyStyle=function(e,t){if(!l(e)){h7e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,m7e):p7e,s.show=l(e.show)?e.show.evaluate(s):g7e}};function _7e(e){return ui.initialize().then(function(){o7e(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Vp.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=_7e(this).then(a7e(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}l7e(this,t),f7e(this,t),u7e(this);let n=e.passes;(n.render||n.pick)&&d7e(this,e)};Vp.prototype.isDestroyed=function(){return!1};Vp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var wB=Vp;var WW=32767,y7e=new fe,x7e=new d;function b7e(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);Ln.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let h=s[f],p=a[f],_=c[f],m=P.lerp(t.west,t.east,h/WW),x=P.lerp(t.south,t.north,p/WW),b=P.lerp(n,i,_/WW),T=fe.fromRadians(m,x,b,y7e),C=o.cartographicToCartesian(T,x7e);d.pack(C,u,f*3)}return u}var DB=b7e;function Pd(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,S7e(this,i,o)}Object.defineProperties(Pd.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function T7e(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function C7e(e,t){let n,i,o,r,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(o),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new re("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var Id=Uint32Array.BYTES_PER_ELEMENT;function A7e(e){return new YC(e)}function E7e(e){return new wB(e)}function S7e(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=Id;let r=o.getUint32(n,!0);if(r!==1)throw new re(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=Id;let s=o.getUint32(n,!0);if(n+=Id,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Id,a===0)throw new re("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Id;let u=o.getUint32(n,!0);n+=Id;let f=o.getUint32(n,!0);n+=Id;let h=o.getUint32(n,!0);n+=Id;let p=o.getUint32(n,!0);n+=Id;let _=o.getUint32(n,!0);n+=Id;let m=o.getUint32(n,!0);n+=Id;let x=Bo(i,n,a);n+=a;let b=new Uint8Array(t,n,c);n+=c;let T,C;u>0&&(T=Bo(i,n,u),n+=u,f>0&&(C=new Uint8Array(t,n,f),C=new Uint8Array(C),n+=f));let A=y(x.POLYGONS_LENGTH,0),S=y(x.POLYLINES_LENGTH,0),v=y(x.POINTS_LENGTH,0),D=A+S+v,O=new o_(e,D,T,C,T7e(e));if(e._batchTable=O,D===0)return;let R=new Qh(x,b),M=R.getGlobalProperty("REGION");if(!l(M))throw new re("Feature table global property: REGION must be defined");let L=se.unpack(M),g=M[4],E=M[5],w=e._tile.computedTransform,I=R.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(I)?(I=d.unpack(I),F.multiplyByPoint(w,I,I)):(I=se.center(L),I.height=P.lerp(g,E,.5),I=ee.WGS84.cartographicToCartesian(I));let N=C7e(x,b);if(n+=(4-n%4)%4,A>0){R.featuresLength=A;let B=y(R.getPropertyArray("POLYGON_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new re("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let H=y(R.getPropertyArray("POLYGON_INDEX_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_INDEX_COUNT",X.UNSIGNED_INT,1));if(!l(H))throw new re("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=B.reduce(function(j,K){return j+K*2},0),G=H.reduce(function(j,K){return j+K},0),k=new Uint32Array(t,n,G);n+=h;let W=new Uint16Array(t,n,V);n+=p;let Y,J;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(Y=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",X.FLOAT,1),J=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",X.FLOAT,1)),e._polygons=new AB({positions:W,counts:B,indexCounts:H,indices:k,minimumHeight:g,maximumHeight:E,polygonMinimumHeights:Y,polygonMaximumHeights:J,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,batchIds:N.polygons,modelMatrix:w})}if(S>0){R.featuresLength=S;let B=y(R.getPropertyArray("POLYLINE_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYLINE_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new re("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let H=R.getPropertyArray("POLYLINE_WIDTHS",X.UNSIGNED_SHORT,1);if(!l(H)){H=new Uint16Array(S);for(let J=0;J<S;++J)H[J]=2}let V=B.reduce(function(J,j){return J+j*3},0),G=new Uint16Array(t,n,V);n+=_;let k=e._tileset,W=k.examineVectorLinesFunction;if(l(W)){let J=DB(new Uint16Array(G),L,g,E,ee.WGS84);v7e(J,B,N.polylines,O,e.url,W)}let Y=A7e;l(k.classificationType)&&(Y=E7e),e._polylines=Y({positions:G,widths:H,counts:B,batchIds:N.polylines,minimumHeight:g,maximumHeight:E,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,classificationType:k.classificationType,keepDecodedPositions:k.vectorKeepDecodedPositions})}if(v>0){let B=new Uint16Array(t,n,v*3);n+=m,e._points=new CB({positions:B,batchIds:N.points,minimumHeight:g,maximumHeight:E,rectangle:L,batchTable:O})}}function jW(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}Pd.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Pd.prototype.getFeature=function(e){return l(this._features)||jW(this),this._features[e]};Pd.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};Pd.prototype.applyStyle=function(e){l(this._features)||jW(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};Pd.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||jW(this),this._batchTable.update(e,t),this._ready=!0)};Pd.prototype.pick=function(e,t,n){};Pd.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};Pd.prototype.isDestroyed=function(){return!1};Pd.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function v7e(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,r(f,n[c],o,i)}}var IB=Pd;var tce={b3dm:function(e,t,n,i,o){return _f.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return _f.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return _f.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return KL.fromTileType(e,t,n,i,o,tce)},externalTileset:function(e,t,n,i){return cB.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new iN(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new IB(e,t,n,i,o)},subt:function(e,t,n,i,o){return sw.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return sw.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new re("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return _f.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return _f.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return _f.fromGeoJson(e,t,n,i)}},XC=tce;var w7e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Ko=Object.freeze(w7e);var Rd={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};Rd.isBinaryFormat=function(e){switch(e){case Rd.BATCHED_3D_MODEL:case Rd.INSTANCED_3D_MODEL:case Rd.COMPOSITE:case Rd.POINT_CLOUD:case Rd.VECTOR:case Rd.GEOMETRY:case Rd.IMPLICIT_SUBTREE:case Rd.VOXEL_BINARY:case Rd.GLTF_BINARY:return!0;default:return!1}};var ks=Object.freeze(Rd);var D7e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Od=Object.freeze(D7e);var Vs={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},Up=new Array(Vs.NUMBER_OF_PASSES);Up[Vs.RENDER]=Object.freeze({pass:Vs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Up[Vs.PICK]=Object.freeze({pass:Vs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Up[Vs.SHADOW]=Object.freeze({pass:Vs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Up[Vs.PRELOAD]=Object.freeze({pass:Vs.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Up[Vs.PRELOAD_FLIGHT]=Object.freeze({pass:Vs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Up[Vs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Vs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Up[Vs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Vs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Up[Vs.MOST_DETAILED_PICK]=Object.freeze({pass:Vs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Vs.getPassOptions=function(e){return Up[e]};var Uo=Object.freeze(Vs);function sm(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(sm.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});sm.prototype.hasProperty=function(e,t){return!1};sm.prototype.getFeature=function(e){};sm.prototype.applyDebugSettings=function(e,t){};sm.prototype.applyStyle=function(e){};sm.prototype.update=function(e,t){};sm.prototype.pick=function(e,t,n){};sm.prototype.isDestroyed=function(){return!1};sm.prototype.destroy=function(){return ue(this)};var qw=sm;function zp(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(zp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});zp.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};zp.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};zp.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};zp.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};zp.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};zp.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};zp.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var PB=zp;function qW(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){qW._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new PB({content:n,class:o})}}qW._oneTimeWarning=yt;var KC=qW;function I7e(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var ZC=I7e;function Hp(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Hp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Hp.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};Hp.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};Hp.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};Hp.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};Hp.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};Hp.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};Hp.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var RB=Hp;function YW(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){YW._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new RB({tile:n,class:o})}}YW._oneTimeWarning=yt;var OB=YW;function P7e(e){let t=new Uint8Array(e),n=Gh(t);if(n==="glTF"&&(n="glb"),ks.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=R7e(t);if(l(i.root))return{contentType:ks.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:ks.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:ks.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:ks.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:ks.VOXEL_JSON,jsonPayload:i};throw new re("Invalid tile content.")}function R7e(e){let t;try{t=Bo(e)}catch{throw new re("Invalid tile content.")}return t}var Gp=P7e;function vf(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=Tc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(vf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function XW(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function nce(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}vf.prototype.requestInnerContents=function(){if(!O7e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;XW(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=M7e(this,n,t,this._tile._contentState);return L7e(this)};function O7e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!Tc.serverHasOpenSlots(n,t[n]))return!1;return Tc.heapHasOpenSlots(e.length)}function M7e(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new nr({throttle:!0,throttleByServer:!0,type:ps.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===$n.CANCELLED){nce(e,i);return}return XW(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===$n.CANCELLED){nce(e,i);return}XW(e,-1),ice(e,t,f)}})}async function L7e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>N7e(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function N7e(e,t,n){if(l(t))try{let i=Gp(t);if(i.contentType===ks.EXTERNAL_TILESET)throw new re("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===ks.GEOMETRY||i.contentType===ks.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=XC[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=KC(o,u));let f=ZC(o,u);return l(f)&&(a.group=new nC({metadata:f})),a}catch(i){ice(e,n,i)}}function ice(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}vf.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};vf.prototype.hasProperty=function(e,t){return!1};vf.prototype.getFeature=function(e){};vf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};vf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};vf.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};vf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=d.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};vf.prototype.isDestroyed=function(){return!1};vf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var MB=vf;var oce=Math.cos,rce=Math.sin,F7e=Math.sqrt,KW={};KW.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,h=oce(f),p=rce(f),_=a.z*p,m=c.longitude+i*e.granYSin+o*e.granXCos,x=h*oce(m),b=h*rce(m),T=a.x*x,C=a.y*b,A=F7e(T*x+C*b+_*p);if(r.x=T/A,r.y=C/A,r.z=_/A,n){let S=e.stNwCorner;l(S)?(f=S.latitude-e.stGranYCos*i+o*e.stGranXSin,m=S.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var B7e=new Ri,wf=new d,k7e=new fe,LB=new d,Yw=new Pi;function sce(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),h=i*f,p=n*f;Yw._ellipsoid=ee.default,wf=Yw.project(e,wf),wf=d.subtract(wf,LB,wf);let _=Ri.fromRotation(t,B7e);wf=Ri.multiplyByVector(_,wf,wf),wf=d.add(wf,LB,wf),e=Yw.unproject(wf,e),r-=1,s-=1;let m=e.latitude,x=m+r*p,b=m-c*s,T=m-c*s+r*p,C=Math.max(m,x,b,T),A=Math.min(m,x,b,T),S=e.longitude,v=S+r*u,D=S+s*h,O=S+s*h+r*u,R=Math.max(S,v,D,O),M=Math.min(S,v,D,O);return{north:C,south:A,east:R,west:M,granYCos:c,granYSin:h,granXCos:u,granXSin:p,nwCorner:e}}KW.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,u=e.north,f=e.south,h=!1,p=!1;u===P.PI_OVER_TWO&&(h=!0),f===-P.PI_OVER_TWO&&(p=!0);let _,m=u-f;c>a?_=P.TWO_PI-c+a:_=a-c;let x=Math.ceil(_/t)+1,b=Math.ceil(m/t)+1,T=_/(x-1),C=m/(b-1),A=se.northwest(e,r),S=se.center(e,k7e);(n!==0||i!==0)&&(S.longitude<A.longitude&&(S.longitude+=P.TWO_PI),Yw._ellipsoid=ee.default,LB=Yw.project(S,LB));let v=C,D=T,O=0,R=0,M=se.clone(e,o),L={granYCos:v,granYSin:O,granXCos:D,granXSin:R,nwCorner:A,boundingRectangle:M,width:x,height:b,northCap:h,southCap:p};if(n!==0){let g=sce(A,n,T,C,S,x,b);u=g.north,f=g.south,a=g.east,c=g.west,L.granYCos=g.granYCos,L.granYSin=g.granYSin,L.granXCos=g.granXCos,L.granXSin=g.granXSin,M.north=u,M.south=f,M.east=a,M.west=c}if(i!==0){n=n-i;let g=se.northwest(M,s),E=sce(g,n,T,C,S,x,b);L.stGranYCos=E.granYCos,L.stGranXCos=E.granXCos,L.stGranYSin=E.granYSin,L.stGranXSin=E.granXSin,L.stNwCorner=g,L.stWest=E.west,L.stSouth=E.south}return L};var Us=KW;var V7e=new ae,U7e=new ae,z7e=new d,H7e=new se;function ace(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;r&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*o+2*a-f;let h=new Float64Array(u*3),p=0,_=0,m,x=z7e;if(r)Us.computePosition(t,n,!1,_,0,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;else for(m=0;m<o;m++)Us.computePosition(t,n,!1,_,m,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;for(m=o-1,_=1;_<i;_++)Us.computePosition(t,n,!1,_,m,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;if(_=i-1,!s)for(m=o-2;m>=0;m--)Us.computePosition(t,n,!1,_,m,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;for(m=0,_=i-2;_>0;_--)Us.computePosition(t,n,!1,_,m,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;let b=h.length/3*2,T=Ne.createTypedArray(h.length/3,b),C=0;for(let S=0;S<h.length/3-1;S++)T[C++]=S,T[C++]=S+1;T[C++]=h.length/3-1,T[C++]=0;let A=new st({attributes:new dn,primitiveType:Me.LINES});return A.attributes.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:h}),A.indices=T,A}function G7e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=ace(e,t),s=t.height,a=t.width,c=si.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let h=si.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(h,u),r.attributes.position.values=f;let p=t.northCap,_=t.southCap,m=4;p&&(m-=1),_&&(m-=1);let x=(f.length/3+m)*2,b=Ne.createTypedArray(f.length/3,x);u=f.length/6;let T=0;for(let A=0;A<u-1;A++)b[T++]=A,b[T++]=A+1,b[T++]=A+u,b[T++]=A+u+1;b[T++]=u-1,b[T++]=0,b[T++]=u+u-1,b[T++]=u,b[T++]=0,b[T++]=u;let C;if(p)C=s-1;else{let A=a-1;b[T++]=A,b[T++]=A+u,C=a+s-2}if(b[T++]=C,b[T++]=C+u,!_){let A=a+C-1;b[T++]=A,b[T]=A+u}return r.indices=b,r}function QC(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,P.RADIANS_PER_DEGREE),i=y(e.ellipsoid,ee.default),o=y(e.rotation,0),r=y(e.height,0),s=y(e.extrudedHeight,r);this._rectangle=se.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}QC.packedLength=se.packedLength+ee.packedLength+5;QC.pack=function(e,t,n){return n=y(n,0),se.pack(e._rectangle,t,n),n+=se.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var cce=new se,lce=ee.clone(ee.UNIT_SPHERE),$C={rectangle:cce,ellipsoid:lce,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};QC.unpack=function(e,t,n){t=y(t,0);let i=se.unpack(e,t,cce);t+=se.packedLength;let o=ee.unpack(e,t,lce);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=se.clone(i,n._rectangle),n._ellipsoid=ee.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):($C.granularity=r,$C.height=s,$C.rotation=a,$C.extrudedHeight=c,$C.offsetAttribute=u===-1?void 0:u,new QC($C))};var W7e=new fe;QC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Us.computeOptions(t,e._granularity,e._rotation,0,H7e,W7e),o,r;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),u;if(c){if(o=G7e(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,_=new Uint8Array(p);e._offsetAttribute===rn.TOP?_=_.fill(1,0,p/2):(u=e._offsetAttribute===rn.NONE?0:1,_=_.fill(u)),o.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}let f=ae.fromRectangle3D(t,n,s,U7e),h=ae.fromRectangle3D(t,n,a,V7e);r=ae.union(f,h)}else{if(o=ace(e,i),o.attributes.position.values=si.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===rn.NONE?0:1;let h=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=ae.fromRectangle3D(t,n,s)}return new st({attributes:o.attributes,indices:o.indices,primitiveType:Me.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var JC=QC;function tA(e){this.rectangle=se.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new d,this.northeastCornerCartesian=new d,this.westNormal=new d,this.southNormal=new d,this.eastNormal=new d,this.northNormal=new d;let t=y(e.ellipsoid,ee.WGS84);K7e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(tA.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});tA.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=wn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)};var uce=new d,NB=new d,fce=new d,j7e=new d,q7e=new d,Y7e=new d,X7e=new d,Df=new fe,dce=new sn(d.UNIT_X,0),eA=new pn;function K7e(e,t,n){n.cartographicToCartesian(se.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(se.northeast(t),e.northeastCornerCartesian),Df.longitude=t.west,Df.latitude=(t.south+t.north)*.5,Df.height=0;let i=n.cartographicToCartesian(Df,Y7e),o=d.cross(i,d.UNIT_Z,j7e);d.normalize(o,e.westNormal),Df.longitude=t.east;let r=n.cartographicToCartesian(Df,X7e),s=d.cross(d.UNIT_Z,r,uce);d.normalize(s,e.eastNormal);let a=d.subtract(i,r,uce);d.magnitude(a)===0&&(a=d.clone(o,a));let c=d.normalize(a,q7e),u=t.south,f;if(u>0){Df.longitude=(t.west+t.east)*.5,Df.latitude=u;let x=n.cartographicToCartesian(Df,eA.origin);d.clone(c,eA.direction);let b=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,dce);Qn.rayPlane(eA,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(x,NB)}else f=n.geodeticSurfaceNormalCartographic(se.southeast(t),NB);let h=d.cross(f,a,fce);d.normalize(h,e.southNormal);let p=t.north,_;if(p<0){Df.longitude=(t.west+t.east)*.5,Df.latitude=p;let x=n.cartographicToCartesian(Df,eA.origin);d.negate(c,eA.direction);let b=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,dce);Qn.rayPlane(eA,b,e.northeastCornerCartesian),_=n.geodeticSurfaceNormal(x,NB)}else _=n.geodeticSurfaceNormalCartographic(se.northwest(t),NB);let m=d.cross(a,_,fce);d.normalize(m,e.northNormal)}var Z7e=new d,$7e=new d,Q7e=new d(0,-1,0),J7e=new d(0,0,-1),hce=new d;function eqe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!se.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,_=e.eastNormal,m=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(se.southwest(e.rectangle),Z7e),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(se.northeast(e.rectangle),$7e),f.z=f.y,f.y=f.x,f.x=0,h=Q7e,_=d.UNIT_Y,p=J7e,m=d.UNIT_Z);let x=d.subtract(i,u,hce),b=d.dot(x,h),T=d.dot(x,p),C=d.subtract(i,f,hce),A=d.dot(C,_),S=d.dot(C,m);b>0?r+=b*b:A>0&&(r+=A*A),T>0?r+=T*T:S>0&&(r+=S*S)}let s,a,c;if(t.mode===ne.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}tA.prototype.distanceToCamera=function(e){let t=eqe(this,e);if(e.mode===ne.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};tA.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};tA.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new JC({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new vt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}});return new In({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var Md=tA;var Xw={},tqe=new d,mce=new d,pce=new d,gce=new d,_ce=new wn;Xw.validOutline=function(e){let n=wn.fromPoints(e,_ce).halfAxes,i=$.getColumn(n,0,mce),o=$.getColumn(n,1,pce),r=$.getColumn(n,2,gce),s=d.magnitude(i),a=d.magnitude(o),c=d.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};Xw.computeProjectTo2DArguments=function(e,t,n,i){let o=wn.fromPoints(e,_ce),r=o.halfAxes,s=$.getColumn(r,0,mce),a=$.getColumn(r,1,pce),c=$.getColumn(r,2,gce),u=d.magnitude(s),f=d.magnitude(a),h=d.magnitude(c),p=Math.min(u,f,h);if(u===0&&(f===0||h===0)||f===0&&h===0)return!1;let _,m;return(p===f||p===h)&&(_=s),p===u?_=a:p===h&&(m=a),(p===u||p===f)&&(m=c),d.normalize(_,n),d.normalize(m,i),d.clone(o.center,t),!0};function yce(e,t,n,i,o){let r=d.subtract(e,t,tqe),s=d.dot(n,r),a=d.dot(i,r);return U.fromElements(s,a,o)}Xw.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=yce(i[r],e,t,n);return o}};Xw.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return yce(i,e,t,n,o)}};var q_=Xw;function nqe(e){let t=e.length,n=new Float64Array(t*3),i=Ne.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new dn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n})});return new st({attributes:s,indices:i,primitiveType:Me.LINES})}function Dx(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Un.computeHierarchyPackedLength(t,d)+1}Dx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new Dx(t)};Dx.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,d),t[n]=e.packedLength,t};var iqe={polygonHierarchy:{}};Dx.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new Dx(iqe)),n._polygonHierarchy=i,n.packedLength=o,n};Dx.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=bo(n,d.equalsEpsilon,!0),n.length<3||!q_.validOutline(n))return;let o=Un.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new vt({geometry:nqe(o[c])});r.push(u)}let s=Nn.combineInstances(r)[0],a=ae.fromPoints(t.positions);return new st({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Ld=Dx;var FB=new fe;function Kw(e){let t=f_.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),o=y(e.ellipsoid,ee.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=dqe(t,n,i,o);this._boundingPlanes=r;let s=gqe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=ij(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=d.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=ij(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=ij(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();FB=o.cartesianToCartographic(c,FB),FB.height=(i+n)/2,this.center=o.cartographicToCartesian(FB,c),this._boundingSphere=ae.fromPoints(s)}var oqe=new d,rqe=new fe,sqe=new d,aqe=new fe,cqe=new d,lqe=new d,uqe=new d,fqe=new d;function dqe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,oqe),a=i.cartesianToCartographic(r,rqe);a.height=n;let c=i.cartographicToCartesian(a,sqe),u=sn.fromPointNormal(c,s);o[0]=u;let f=0,h,p=[],_,m;for(h=0;h<4;h++){_=e.getVertex(h),p[h]=_,m=i.cartesianToCartographic(_,aqe),m.height=t;let b=sn.getPointDistance(u,i.cartographicToCartesian(m,cqe));b<f&&(f=b)}let x=sn.clone(u);for(x.normal=d.negate(x.normal,x.normal),x.distance=x.distance*-1+f,o[1]=x,h=0;h<4;h++){_=p[h];let b=p[(h+1)%4],T=i.geodeticSurfaceNormal(_,lqe),C=d.subtract(b,_,fqe),A=d.cross(C,T,uqe);A=d.normalize(A,A),o[2+h]=sn.fromPointNormal(_,A)}return o}var Ix=new d,Px=new d,Rx=new d,ZW=new d,$W=new d,QW=new d,hqe=new d,mqe=new d,pqe=new d,JW=new d,ej=new d,tj=new d,Y_=new d,am=new $;function xce(e,t,n){Ix=e.normal,Px=t.normal,Rx=n.normal,ZW=d.multiplyByScalar(e.normal,-e.distance,ZW),$W=d.multiplyByScalar(t.normal,-t.distance,$W),QW=d.multiplyByScalar(n.normal,-n.distance,QW),JW=d.multiplyByScalar(d.cross(Px,Rx,hqe),d.dot(ZW,Ix),JW),ej=d.multiplyByScalar(d.cross(Rx,Ix,mqe),d.dot($W,Px),ej),tj=d.multiplyByScalar(d.cross(Ix,Px,pqe),d.dot(QW,Rx),tj),am[0]=Ix.x,am[1]=Px.x,am[2]=Rx.x,am[3]=Ix.y,am[4]=Px.y,am[5]=Rx.y,am[6]=Ix.z,am[7]=Px.z,am[8]=Rx.z;let i=$.determinant(am);return Y_=d.add(JW,ej,Y_),Y_=d.add(Y_,tj,Y_),new d(Y_.x/i,Y_.y/i,Y_.z/i)}function gqe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=xce(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=xce(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var nj=new d,nA=new d;function ij(e,t){let n=[];for(let i=0;i<4;i++)nj=d.subtract(t[(i+1)%4],t[i],nj),nA=d.cross(e.normal,nj,nA),nA=d.normalize(nA,nA),n[i]=d.clone(nA);return n}Object.defineProperties(Kw.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var oj=new d;Kw.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;sn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):sn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,sn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=rj(sn.projectPointOntoPlane(c,t,oj),i[0],c,o),d.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=bce(t,p[0],p[1]),d.distance(a,t)}let f=Number.MAX_VALUE,h;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=rj(sn.projectPointOntoPlane(c,t,oj),i[r],c,this._edgeNormals[n[r]]),h=d.distanceSquared(a,t),h<f&&(f=h);return Math.sqrt(f)}else if(n.length>3)return a=rj(sn.projectPointOntoPlane(this._boundingPlanes[1],t,oj),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),d.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?d.distance(t,this._vertices[(n[1]-2+u)%4]):d.distance(t,this._vertices[4+(n[1]-2+u)%4])};var _qe=new d,yqe=new d;function bce(e,t,n){let i=d.subtract(n,t,_qe),o=d.subtract(e,t,yqe),r=d.dot(i,o);if(r<=0)return t;let s=d.dot(i,i);return r>=s?n:(r=r/s,new d((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var xqe=new sn(d.UNIT_X,0);function rj(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let u=sn.fromPointNormal(t[c],i[c],xqe);sn.getPointDistance(u,e)<0||(a=bce(e,t[c],t[(c+1)%4]),r=d.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}Kw.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)d.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Wt.INSIDE:n===this._vertices.length?Wt.OUTSIDE:Wt.INTERSECTING};Kw.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new Ld({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Ld.createGeometry(n),o=new vt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}}),r=new Ld({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Ld.createGeometry(r),a=new vt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Ld({polygonHierarchy:{positions:this._planeVertices[2+u]}}),h=Ld.createGeometry(f);c[u]=new vt({geometry:h,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}})}return new In({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var BB=Kw;var bqe=new d(1,1,1),kB=Math.cos,VB=Math.sin;function iA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,bqe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,P.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),u=Math.round(y(e.subdivisions,128));this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}iA.packedLength=2*d.packedLength+8;iA.pack=function(e,t,n){return n=y(n,0),d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var Tce=new d,Cce=new d,Wp={radii:Tce,innerRadii:Cce,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};iA.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,Tce);t+=d.packedLength;let o=d.unpack(e,t,Cce);t+=d.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=h,n._offsetAttribute=p===-1?void 0:p,n):(Wp.minimumClock=r,Wp.maximumClock=s,Wp.minimumCone=a,Wp.maximumCone=c,Wp.stackPartitions=u,Wp.slicePartitions=f,Wp.subdivisions=h,Wp.offsetAttribute=p===-1?void 0:p,new iA(Wp))};iA.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ee.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-r)/P.PI),u<2&&(u=2),f<2&&(f=2);let h=0,p=1,_=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,x=!1;_&&(p=2,r>0&&(m=!0,h+=u),s<Math.PI&&(x=!0,h+=u));let b=a*p*(f+u),T=new Float64Array(b*3),C=2*(b+h-(u+f)*p),A=Ne.createTypedArray(b,C),S,v,D,O,R=0,M=new Array(f),L=new Array(f);for(S=0;S<f;S++)O=r+S*(s-r)/(f-1),M[S]=VB(O),L[S]=kB(O);let g=new Array(a),E=new Array(a);for(S=0;S<a;S++)D=i+S*(o-i)/(a-1),g[S]=VB(D),E[S]=kB(D);for(S=0;S<f;S++)for(v=0;v<a;v++)T[R++]=t.x*M[S]*E[v],T[R++]=t.y*M[S]*g[v],T[R++]=t.z*L[S];if(_)for(S=0;S<f;S++)for(v=0;v<a;v++)T[R++]=n.x*M[S]*E[v],T[R++]=n.y*M[S]*g[v],T[R++]=n.z*L[S];for(M.length=a,L.length=a,S=0;S<a;S++)O=r+S*(s-r)/(a-1),M[S]=VB(O),L[S]=kB(O);for(g.length=u,E.length=u,S=0;S<u;S++)D=i+S*(o-i)/(u-1),g[S]=VB(D),E[S]=kB(D);for(S=0;S<a;S++)for(v=0;v<u;v++)T[R++]=t.x*M[S]*E[v],T[R++]=t.y*M[S]*g[v],T[R++]=t.z*L[S];if(_)for(S=0;S<a;S++)for(v=0;v<u;v++)T[R++]=n.x*M[S]*E[v],T[R++]=n.y*M[S]*g[v],T[R++]=n.z*L[S];for(R=0,S=0;S<f*p;S++){let N=S*a;for(v=0;v<a-1;v++)A[R++]=N+v,A[R++]=N+v+1}let w=f*a*p;for(S=0;S<u;S++)for(v=0;v<a-1;v++)A[R++]=w+S+v*u,A[R++]=w+S+(v+1)*u;if(_)for(w=f*a*p+u*a,S=0;S<u;S++)for(v=0;v<a-1;v++)A[R++]=w+S+v*u,A[R++]=w+S+(v+1)*u;if(_){let N=f*a*p,B=N+a*u;if(m)for(S=0;S<u;S++)A[R++]=N+S,A[R++]=B+S;if(x)for(N+=a*u-u,B+=a*u-u,S=0;S<u;S++)A[R++]=N+S,A[R++]=B+S}let I=new dn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T})});if(l(e._offsetAttribute)){let N=T.length,B=e._offsetAttribute===rn.NONE?0:1,H=new Uint8Array(N/3).fill(B);I.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:H})}return new st({attributes:I,indices:A,primitiveType:Me.LINES,boundingSphere:ae.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var If=iA;function oA(e){let t=y(e.radius,1),i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new If(i),this._workerName="createSphereOutlineGeometry"}oA.packedLength=If.packedLength;oA.pack=function(e,t,n){return If.pack(e._ellipsoidGeometry,t,n)};var Tqe=new If,Ox={radius:void 0,radii:new d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};oA.unpack=function(e,t,n){let i=If.unpack(e,t,Tqe);return Ox.stackPartitions=i._stackPartitions,Ox.slicePartitions=i._slicePartitions,Ox.subdivisions=i._subdivisions,l(n)?(d.clone(i._radii,Ox.radii),n._ellipsoidGeometry=new If(Ox),n):(Ox.radius=i._radii.x,new oA(Ox))};oA.createGeometry=function(e){return If.createGeometry(e._ellipsoidGeometry)};var X_=oA;function rA(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ae(e,t)}Object.defineProperties(rA.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});rA.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,d.distance(t.center,e.camera.positionWC)-t.radius)};rA.prototype.intersectPlane=function(e){return ae.intersectPlane(this._boundingSphere,e)};rA.prototype.update=function(e,t){d.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};rA.prototype.createDebugVolume=function(e){let t=new X_({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new vt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Gt.fromColor(e)}});return new In({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var K_=rA;var Cqe=new d,Aqe=new d,Eqe=new d,Sqe=new d;function Mx(e,t,n){n=d.cross(e,t,n);let i=d.magnitude(n);return d.multiplyByScalar(n,P.EPSILON7/i,n)}function sj(e,t){let n=d.normalize(e,Sqe),i=d.equalsEpsilon(n,d.UNIT_X,P.EPSILON6)?d.UNIT_Y:d.UNIT_X;return Mx(e,i,t)}function Ace(e){let t=$.getColumn(e,0,Cqe),n=$.getColumn(e,1,Aqe),i=$.getColumn(e,2,Eqe),o=d.equals(t,d.ZERO),r=d.equals(n,d.ZERO),s=d.equals(i,d.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(o&&!r&&!s?t=Mx(n,i,t):!o&&r&&!s?n=Mx(t,i,n):!o&&!r&&s?i=Mx(n,t,i):o?r?s||(t=sj(i,t),n=Mx(i,t,n)):(t=sj(n,t),i=Mx(n,t,i)):(n=sj(t,n),i=Mx(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function sA(e,t){t=Ace(t),this._orientedBoundingBox=new wn(e,t),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(sA.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});sA.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};sA.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};sA.prototype.update=function(e,t){d.clone(e,this._orientedBoundingBox.center),t=Ace(t),$.clone(t,this._orientedBoundingBox.halfAxes),ae.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};sA.prototype.createDebugVolume=function(e){let t=new Rh({minimum:new d(-1,-1,-1),maximum:new d(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new vt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Gt.fromColor(e)}});return new In({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var Pf=sA;function Zo(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||ri(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=F.multiply(a,this.transform,new F),u=l(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(u,this.transform,new F),this.computedTransform=c,this.metadata=OB(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let h;l(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,Zo._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&Zo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Yo.REPLACE:Yo.ADD):l(i)?p=i.refine:p=Yo.REPLACE,this.refine=p,this.children=[],this.parent=i;let _,m=!1,x,b,T;if(t=Se.createIfNeeded(t),r)x=Ko.UNLOADED,b=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(Zo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(Zo._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),_=new qw(e,this),m=!0,x=Ko.READY):(x=Ko.UNLOADED,b=t.getDerivedResource({url:v}),T=Tc.getServerKey(b.getUrlComponent()))}else _=new qw(e,this),m=!0,x=Ko.READY;this._content=_,this._contentResource=b,this._contentState=x,this._expiredContent=void 0,this._serverKey=T,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let C=n.expire,A,S;l(C)&&(A=C.duration,l(C.date)&&(S=Z.fromIso8601(C.date))),this.expireDuration=A,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=Od.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new Z,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Zo._deprecationWarning=_s;Object.defineProperties(Zo.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Ko.READY}},contentUnloaded:{get:function(){return this._contentState===Ko.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Ko.EXPIRED}},contentFailed:{get:function(){return this._contentState===Ko.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Z_=new d;function vqe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=d.multiplyByScalar(s.directionWC,e._centerZDepth,Z_),c=d.add(s.positionWC,a,Z_),u=d.subtract(c,r,Z_);if(d.magnitude(u)>o){let S=d.normalize(u,Z_),v=d.multiplyByScalar(S,o,Z_),D=d.add(r,v,Z_),O=d.subtract(D,s.positionWC,Z_),R=d.normalize(O,Z_);e._foveatedFactor=1-Math.abs(d.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Yo.REPLACE,_=n.isSkippingLevelOfDetail;if(p&&!_||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&_||n._pass===Uo.PRELOAD_FLIGHT||n._pass===Uo.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*m;if(e._foveatedFactor<=x)return!1;let b=m-x,T=P.clamp((e._foveatedFactor-x)/b,0,1),C=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,T),A=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-C<=A}var wce=new Z;Zo.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,h=c.drawingBufferHeight*o,p;if(e.mode===ne.SCENE2D||u instanceof nn){let _=u.offCenterFrustum;l(_)&&(u=_);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,h);p=s/m}else{let _=Math.max(this._distanceToCamera,P.EPSILON7),m=u.sseDenominator;if(p=s*h/(_*m),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,T=P.fog(_,x)*b;p-=T}}return p/=e.pixelRatio,p};function wqe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function Dqe(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}Zo.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:ys.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==ys.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Dqe(n,this),this._priorityProgressiveResolution=wqe(n,this),this.priorityDeferred=vqe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Zo.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Z.now(wce);Z.lessThan(this.expireDate,e)&&(this._contentState=Ko.EXPIRED,this._expiredContent=this._content)}};function Iqe(e){if(!l(e.expireDuration))return;let t=Z.now(wce);Z.addSeconds(t,e.expireDuration,t),l(e.expireDate)?Z.lessThan(e.expireDate,t)&&Z.clone(t,e.expireDate):e.expireDate=Z.clone(t)}function Pqe(e){return function(){return e._priority}}Zo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Rqe(this):Mqe(this)};function Rqe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ri(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new MB(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Ko.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Ko.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Ko.FAILED,o})}async function Oqe(e,t,n,i,o){let r=e._contentState;e._contentState=Ko.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===$n.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Ko.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===$n.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await Lqe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Ko.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Ko.FAILED,a}}function Mqe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new nr({throttle:!0,throttleByServer:!0,type:ps.TILES3D,priorityFunction:Pqe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return Oqe(e,o,i,n,r)}async function Lqe(e,t){let n=Gp(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===ks.GEOMETRY||n.contentType===ks.VECTOR,(n.contentType===ks.IMPLICIT_SUBTREE||n.contentType===ks.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===ks.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=XC[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=KC(i,s));let a=ZC(i,s);return l(a)&&(o.group=new nC({metadata:a})),o}Zo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Zo.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Ko.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var Dce=new ae;function cj(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,Dce);e._boundingVolume2D=new K_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Nqe(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,Dce);e._contentBoundingVolume2D=new K_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Zo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=cj(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Wt.INSIDE,a===Wt.OUTSIDE)return ys.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Wt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Zo.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Wt.INSIDE;if(this._visibilityPlaneMask===ys.MASK_INSIDE)return Wt.INSIDE;let t=e.cullingVolume,n=Nqe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Wt.INSIDE,s===Wt.OUTSIDE)return Wt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Wt.OUTSIDE,s===Wt.INSIDE)return Wt.OUTSIDE}return t.computeVisibility(n)};Zo.prototype.distanceToTile=function(e){return cj(this,e).distanceToCamera(e)};var Fqe=new d;Zo.prototype.distanceToTileCenter=function(e){let n=cj(this,e).boundingVolume,i=d.subtract(n.center,e.camera.positionWC,Fqe);return d.dot(e.camera.directionWC,i)};Zo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Ice=new $,Pce=new d,Bqe=new $,lj=new d,Rce=new se,Oce=new wn,aj=new F;function kqe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],lj),o=$.fromArray(e,3,Bqe);i=F.multiplyByPoint(t,i,i);let r=F.getMatrix3(t,Ice);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new Pf(i,o)}function Vqe(e,t,n,i){let o=se.unpack(e,0,Rce),r=e[4],s=e[5],a=wn.fromRectangle(o,r,s,ee.WGS84,Oce),c=a.center,u=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,aj),aj),c=F.multiplyByPoint(t,c,c);let f=F.getMatrix3(t,Ice);return u=$.multiply(f,u,u),l(i)&&i instanceof Pf?(i.update(c,u),i):new Pf(c,u)}function Uqe(e,t,n,i){if(!F.equalsEpsilon(t,n,P.EPSILON8))return Vqe(e,t,n,i);let o=se.unpack(e,0,Rce);return l(i)?(i.rectangle=se.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Md({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function zqe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],lj),o=e[3];i=F.multiplyByPoint(t,i,i);let r=F.getScale(t,Pce),s=d.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new K_(i,o)}Zo.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=mC.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new re("boundingVolume must be defined");if(ri(e,"3DTILES_bounding_volume_S2"))return new BB(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=kqe(r,t,n);return this._verticalExaggeration!==1&&Ece(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=Uqe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Pf?Ece(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Dr.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Dr.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ee.WGS84))),c}if(l(a)){let c=zqe(a,t,n);if(this._verticalExaggeration!==1){let u=Dr.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,lj),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new re("boundingVolume must contain a sphere, region, or box")};var Hqe=d.unpackArray(new Array(8*3).fill(0));function Ece(e,t,n){let i=e.boundingVolume.computeCorners(Hqe).map(r=>Dr.getPosition(r,ee.WGS84,t,n,r)),o=wn.fromPoints(i,Oce);e.update(o.center,o.halfAxes)}Zo.prototype.updateTransform=function(e,t){e=y(e,F.IDENTITY);let n=F.multiplyTransformation(e,this.transform,aj),i=!F.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&F.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};Zo.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,Pce),t=d.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Gqe(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Gt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function Wqe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Ko.FAILED,o}}function jqe(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function qqe(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}Zo.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;jqe(this,e),qqe(this,e),Gqe(this,e,t,n),Wqe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===we.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var Sce=[];Zo.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Iqe(this),this._selectedFrame=0,this.lastStyleTime=0,Z.now(this._loadTimestamp),this._contentState=Ko.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Sce;try{this._content.update(e,t)}catch(i){throw this._contentState=Ko.FAILED,i}Sce.length=0,t.commandList=n};function vce(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function UB(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}Zo.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,u=o,f=c+u,h=r,p=Math.pow(10,f),_=f+h,m=r,x=Math.pow(10,_),b=_+m,T=Math.pow(10,b),C=UB(this._depth,n.depth,i.depth);C=t?1-C:C;let S=!e.isSkippingLevelOfDetail&&this.refine===Yo.REPLACE?UB(this._priorityHolder._distanceToCamera,n.distance,i.distance):UB(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=vce(S,a,s),D=this._priorityProgressiveResolution?0:p,O=UB(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=vce(O,u,c),M=this.priorityDeferred?x:0,L=e._pass===Uo.PRELOAD_FLIGHT?0:T;this._priority=C+v+D+R+M+L};Zo.prototype.isDestroyed=function(){return!1};Zo.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var Nd=Zo;function jp(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(jp.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});jp.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};jp.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};jp.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};jp.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};jp.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};jp.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};jp.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var Zw=jp;function qp(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(qp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});qp.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};qp.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};qp.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};qp.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};qp.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};qp.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};qp.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var zB=qp;function Mce(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),o;l(i)&&(o=new zB({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new Zw({group:f,class:n.classes[f.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(a.hasOwnProperty(f)){let h=a[f];s.push(new Zw({id:f,group:a[f],class:n.classes[h.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Mce.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var aA=Mce;var Lce={},Yqe=new d;Lce.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Pf||i instanceof Md){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Od.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Pf||a instanceof Md)){e._optimChildrenWithinParent=Od.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=d.subtract(c.center,o.center,Yqe),f=d.magnitude(u);d.divideByScalar(u,f,u);let h=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(h<=p+f){e._optimChildrenWithinParent=Od.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Od.USE_OPTIMIZATION};var HB=Lce;function $w(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties($w.prototype,{length:{get:function(){return this._length}}});function Xqe(e,t,n){this.item=e,this.previous=t,this.next=n}$w.prototype.add=function(e){let t=new Xqe(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Nce(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}$w.prototype.remove=function(e){l(e)&&(Nce(this,e),--this._length)};$w.prototype.splice=function(e,t){if(e===t)return;Nce(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var GB=$w;function Lx(){this._list=new GB,this._sentinel=this._list.add(),this._trimTiles=!1}Lx.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Lx.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Lx.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Lx.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Lx.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};Lx.prototype.trim=function(){this._trimTiles=!0};var WB=Lx;function jB(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function fj(e,t){let n;return t==="_loadTimestamp"?n=Z.toDate(e).getTime():n=e,n}jB.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=fj(e,n),this._referenceMaximum[n]=fj(t,n)};function Kqe(e,t){let n=e.tilePropertyName;if(l(n)){let i=fj(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var uj=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];jB.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Kqe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+P.EPSILON7,c=P.clamp(i-o,0,s)/s,u=uj.length-1,f=c*u,h=Math.floor(f),p=Math.ceil(f),_=f-h,m=uj[h],x=uj[p],b=z.clone(z.WHITE);b.red=P.lerp(m.red,x.red,_),b.green=P.lerp(m.green,x.green,_),b.blue=P.lerp(m.blue,x.blue,_),e._debugColor=b};jB.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var qB=jB;function cA(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}cA.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};cA.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};cA.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof _f))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};cA.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof _f))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};cA.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.texturesReferenceCounterById={...e.texturesReferenceCounterById},t.batchTableByteLength=e.batchTableByteLength};var $_=cA;function Qw(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(Qw.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});Qw.prototype.makeDirty=function(){this._styleDirty=!0};Qw.prototype.resetDirty=function(){this._styleDirty=!1};Qw.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var YB=Qw;function Zqe(e,t,n){let i=ri(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!ri(o,"3DTILES_bounding_volume_S2")&&!ri(o,"3DTILES_bounding_volume_cylinder"))throw new re("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new Se({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=$qe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Ge(a,!0));let c=new Se({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Qqe(t),this.subdivisionScheme=os[i.subdivisionScheme],this.branchingFactor=os.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function $qe(e){if(ri(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function Qqe(e){let t=Ge(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var lA=Zqe;var Jw={};function Fce(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function dj(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Bce(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function hj(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}Jw.encode2D=function(e,t){return(Fce(e)|Fce(t)<<1)>>>0};Jw.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Bce(e),t[1]=Bce(e>>1),t};Jw.encode3D=function(e,t,n){return dj(e)|dj(t)<<1|dj(n)<<2};Jw.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=hj(e),t[1]=hj(e>>1),t[2]=hj(e>>2),t};var Nx=Jw;function zo(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===os.OCTREE&&(this.z=e.z)}Object.defineProperties(zo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===os.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===os.OCTREE?Nx.encode3D(this.x,this.y,this.z):Nx.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===os.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});zo.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===os.OCTREE){let o=(this.z<<e.level)+e.z;return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};zo.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===os.OCTREE){let r=Math.floor(this.z/t);return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};zo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===os.OCTREE){let r=e.z%n;return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};zo.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===os.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};zo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};zo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};zo.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===os.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};zo.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===os.OCTREE?this.z===e.z:!0)};zo.prototype.isImplicitTilesetRoot=function(){return this.level===0};zo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};zo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};zo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===os.OCTREE&&(e.z=this.z),e};var kce=[0,0,0];zo.fromMortonIndex=function(e,t,n,i){let o;return e===os.OCTREE?(o=Nx.decode3D(i,kce),new zo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Nx.decode2D(i,kce),new zo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};zo.fromTileIndex=function(e,t,n){let i,o,r;return e===os.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(P.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),zo.fromMortonIndex(e,t,i,r)};var uA=zo;function Yp(){}Yp.selectTiles=function(e,t){he.throwInstantiationError()};Yp.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Yp.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Yp.selectTile=function(e,t){if(e.contentVisibility(t)===Wt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};Yp.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Yp.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Yp.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Jqe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Jqe(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}Yp.updateTile=function(e,t){Vce(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,nYe(e),e._shouldSelect=!1,e._finalResolution=!0};function Vce(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];Vce(r,t),e._visible=r._visible;return}if(eYe(e,t)){e._visible=!1;return}let i=e.refine===Yo.REPLACE,o=e._optimChildrenWithinParent===Od.USE_OPTIMIZATION;if(i&&o&&n&&!tYe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function eYe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Yo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function tYe(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function nYe(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var sa=Yp;function Uce(){}var eD={stack:new bl,stackMaximumLength:0};Uce.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=sa,s=eD.stack;for(s.push(i);s.length>0;){eD.stackMaximumLength=Math.max(eD.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Yo.ADD,u=a.refine===Yo.REPLACE,f=iYe(a);f&&oYe(a,s,t),(c||u&&!f)&&(rYe(e,a),o(a,t),sYe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return eD.stack.trim(eD.stackMaximumLength),n};function iYe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function oYe(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function rYe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function sYe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Wt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var XB=Uce;function zce(){}var tD={stack:new bl,stackMaximumLength:0},nD={stack:new bl,stackMaximumLength:0};zce.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(sa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;cYe(n,t),tD.stack.trim(tD.stackMaximumLength),nD.stack.trim(nD.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function mj(e,t){e.contentAvailable&&sa.selectTile(e,t)}function aYe(e,t,n){let i=e.refine===Yo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=sa;for(let m=0;m<r.length;++m)s(r[m],n);r.sort(sa.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,h=!1,p=-1,_=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let x=r[m];if(x.isVisible?(t.push(x),x._foveatedFactor<_&&(p=m,_=x._foveatedFactor),h=!0):(u||o.loadSiblings)&&(x._foveatedFactor<_&&(p=m,_=x._foveatedFactor),a(x,n),c(x,n)),u){let b;x._inRequestVolume?x.hasRenderableContent?b=x.contentAvailable:b=lYe(x,n):b=!1,f=f&&b}}if(h||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let x=(e._wasMinPriorityChild||e===o.root)&&_<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;x._foveatedFactor=Math.min(m._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(m._distanceToCamera,x._distanceToCamera);for(let b=0;b<r.length;++b)r[b]._priorityHolder=x}return f}function cYe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=sa,a=tD.stack;for(a.push(e);a.length>0;){tD.stackMaximumLength=Math.max(tD.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?aYe(c,a,t)&&f:!1;let h=!c._refines&&f;c.hasRenderableContent?c.refine===Yo.ADD?(mj(c,t),o(c,t)):c.refine===Yo.REPLACE&&(o(c,t),h&&mj(c,t)):(n._emptyTiles.push(c),o(c,t),h&&mj(c,t)),r(c,t),s(c,t)}}function lYe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=sa,s=!0,a=nD.stack;for(a.push(e);a.length>0;){nD.stackMaximumLength=Math.max(nD.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,h=!c.hasRenderableContent&&n(c);if(!h&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),h)for(let p=0;p<f;++p){let _=u[p];a.push(_)}}return e.hasEmptyContent||s}var KB=zce;function Hce(){}var iD={stack:new bl,stackMaximumLength:0},oD={stack:new bl,stackMaximumLength:0},Xp={stack:new bl,stackMaximumLength:0,ancestorStack:new bl,ancestorStackMaximumLength:0},uYe=2;Hce.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(sa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;gYe(n,t),_Ye(n,t),iD.stack.trim(iD.stackMaximumLength),oD.stack.trim(oD.stackMaximumLength),Xp.stack.trim(Xp.stackMaximumLength),Xp.ancestorStack.trim(Xp.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function fYe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=sa,r=oD.stack;for(r.push(e);r.length>0;){oD.stackMaximumLength=Math.max(oD.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<uYe&&r.push(u))}}}function ZB(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:fYe(e,t)}function dYe(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function hYe(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function mYe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=sa;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(sa.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function pYe(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function gYe(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=sa,c=iD.stack;for(c.push(e);c.length>0;){iD.stackMaximumLength=Math.max(iD.stackMaximumLength,c.length);let u=c.pop();dYe(u,t);let f=u.parent,h=!l(f)||f._refines;u._refines=o(u)?mYe(u,c,t)&&h:!1;let p=!u._refines&&h;u.hasRenderableContent?u.refine===Yo.ADD?(ZB(u,t),r(u,t)):u.refine===Yo.REPLACE&&(pYe(u,i)?(r(u,t),p&&ZB(u,t)):p?(ZB(u,t),r(u,t)):hYe(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&ZB(u,t)),s(u,t),a(u,t)}}function _Ye(e,t){let{selectTile:n,canTraverse:i}=sa,{stack:o,ancestorStack:r}=Xp,s;for(o.push(e);o.length>0||r.length>0;){if(Xp.stackMaximumLength=Math.max(Xp.stackMaximumLength,o.length),Xp.ancestorStackMaximumLength=Math.max(Xp.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Yo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let h=u[f];h.isVisible&&o.push(h)}}}}var $B=Hce;function $o(e){e=y(e,y.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new WB,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new bl,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=y(e.cacheBytes,512*1024*1024);let t=y(e.maximumCacheOverflowBytes,512*1024*1024);this._maximumCacheOverflowBytes=t,this._styleEngine=new YB,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._addHeightCallbacks=[],this._statistics=new $_,this._statisticsLast=new $_,this._statisticsPerPass=new Array(Uo.NUMBER_OF_PASSES);for(let o=0;o<Uo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new $_;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new qB(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=P.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!0),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,P.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=y(e.dynamicScreenSpaceErrorDensity,2e-4),this.dynamicScreenSpaceErrorFactor=y(e.dynamicScreenSpaceErrorFactor,24),this.dynamicScreenSpaceErrorHeightFalloff=y(e.dynamicScreenSpaceErrorHeightFalloff,.25),this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,xn.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=tu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new wp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new R_,this.loadProgress=new pe,this.allTilesLoaded=new pe,this.initialTilesLoaded=new pe,this.tileLoad=new pe,this.tileUnload=new pe,this.tileFailed=new pe,this.tileVisible=new pe,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,l(e.clippingPlanes)&&bs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&Kh.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new tC,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new v_(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this.splitDirection=y(e.splitDirection,Gr.NONE),this.enableCollision=y(e.enableCollision,!1),this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&yt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties($o.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Kh.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return _s("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,Zce(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});$o.fromIonAssetId=async function(e,t){let n=await cf.fromAssetId(e);return $o.fromUrl(n,t)};$o.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await $o.loadJson(n),r=await yYe(n,o),s=new $o(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,Zce(s);let c=l(o.asset.gltfUpAxis)?Fo.fromName(o.asset.gltfUpAxis):Fo.Y,u=y(t.modelUpAxis,c),f=y(t.modelForwardAxis,Fo.X);s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,F.IDENTITY).boundingSphere.center,_=s._ellipsoid.cartesianToCartographic(p);return l(_)&&_.height>ui._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Ot.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s};$o.loadJson=function(e){return Se.createIfNeeded(e).fetchJson()};$o.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};$o.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new re("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new re("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&$o.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=Gce(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Yo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let h=u[f],p=Gce(this,e,h,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&HB.checkChildrenWithinParent(c)}return s};function Gce(e,t,n,i){if(!(l(n.implicitTiling)||ri(n,"3DTILES_implicit_tiling")))return new Nd(e,t,n,i);let r=e.schema,s=new lA(t,n,r),a=new uA({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Ge(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let h=new Nd(e,t,f,i);return h.implicitTileset=s,h.implicitCoordinates=a,h}async function yYe(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=vi.getSchemaLoader({resource:e});else if(l(n.schema))i=vi.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new aA({schema:i.schema,metadataJson:n});return vi.unload(i),o}var Wce=new d,xYe=new fe,bYe=new F,TYe=new d,CYe=new d,AYe=new d,EYe=new d;function SYe(e,t){let n,i,o,r,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Md)n=d.normalize(a.positionWC,Wce),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let x=F.inverseTransformation(c.computedTransform,bYe),b=t.mapProjection.ellipsoid,T=u.boundingVolume,C=F.multiplyByPoint(x,T.center,TYe);if(d.magnitude(C)>b.minimumRadius){let A=fe.fromCartesian(C,b,xYe);n=d.normalize(a.positionWC,Wce),i=a.directionWC,o=a.positionCartographic.height,r=0,s=A.height*2}else{let A=F.multiplyByPoint(x,a.positionWC,CYe);if(n=d.UNIT_Z,i=F.multiplyByPointAsVector(x,a.directionWC,AYe),i=d.normalize(i,i),o=A.z,u instanceof Pf){let S=$.getColumn(T.halfAxes,2,EYe),v=d.magnitude(S);r=C.z-v,s=C.z+v}else if(u instanceof K_){let S=T.radius;r=C.z-S,s=C.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*f,p=s,_=P.clamp((o-h)/(p-h),0,1),m=1-Math.abs(d.dot(i,n));m=m*(1-_),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function vYe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{Yce(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?UYe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function qce(e,t){return e._priority-t._priority}$o.prototype.postPassesUpdate=function(e){l(this._root)&&(wYe(this,e),HYe(this,e),this._cache.unloadTiles(this,Kce),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};$o.prototype.prePassesUpdate=function(e){if(!l(this._root))return;LYe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=Z.clone(e.time)),this._timeSinceLoad=Math.max(Z.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&SYe(this,e),e.newFrame&&this._cache.reset()};function wYe(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==Ko.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function DYe(e){let t=e._requestedTiles;t.sort(qce);for(let n=0;n<t.length;++n)vYe(e,t[n])}function Yce(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function IYe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Ko.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var PYe=new fe,RYe=new fe,OYe=new d;function MYe(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=fe.clone(r.positionCartographic,PYe),c=fe.fromCartesian(o.center,s,RYe);l(c)&&(a.height=c.height);let u=fe.toCartesian(a,s,OYe);d.distance(u,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function LYe(e,t){IYe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,Yce(f,e,u)}}e.totalMemoryUsageInBytes<i?FYe(e):a&&n.length>0&&NYe(e)}function NYe(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(qce)}function FYe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var QB=new d,BYe={maximumFractionDigits:3};function jce(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,BYe):Math.round(t).toLocaleString()}function pj(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=d.clone(i,QB);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=d.normalize(i,QB);r=d.multiplyByScalar(r,.75*n,QB),o=d.add(r,i,QB)}return o}function gj(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=` +Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=` +Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=` +Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=` +Triangles: ${e.content.trianglesLength}`,o++),i+=` +Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=` +Texture Memory: ${jce(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${jce(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` +- ${s[a]}`;o+=s.length}else i+=` +Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function kYe(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:pj(e.debugPickedTile),a=gj(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];gj(a,e,pj(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&gj(a,e,pj(a))}}e._tileDebugLabels.update(t)}function VYe(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ti({stencil:0,pass:we.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:Vt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,h=i.length;for(let m=0;m<s.length;++m){let x=s[m];f&&u.raiseEvent(x),MYe(e,x,t),x.update(e,t,n),c.incrementSelectionCounts(x.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let _=i.length-h;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,x=m.length;i.length+=x;for(let b=_-1;b>=0;--b)i[h+x+b]=i[h+b];for(let b=0;b<x;++b)i[h+b]=m[b]}_=i.length-r,c.numberOfCommands=_,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&_>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Fp),kYe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Xce=[];function UYe(e,t){let n=t,i=Xce;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(zYe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Kce(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function zYe(e,t){e._cache.unloadTile(e,t,Kce),t.destroy()}$o.prototype.trimLoadedTiles=function(){this._cache.trim()};function HYe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;$_.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function GYe(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function WYe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function jYe(e,t,n,i){if(t.mode===ne.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,GYe(e),WYe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&DYe(e),VYe(e,t,i),$_.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function Zce(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Ct.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new Ct(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}$o.prototype.getTraversal=function(e){let{pass:t}=e;return t===Uo.MOST_DETAILED_PRELOAD||t===Uo.MOST_DETAILED_PICK?XB:this.isSkippingLevelOfDetail?$B:KB};$o.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};$o.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Uo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Uo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Uo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Uo.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),u=c.length;if(e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r),s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=jYe(this,e,h,s)),a&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};$o.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};$o.prototype.isDestroyed=function(){return!1};$o.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=Xce;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,ue(this)};$o.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};$o.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!$o.supportedExtensions[e[t]])throw new re(`Unsupported 3D Tiles Extension: ${e[t]}`)};var qYe=new pn,YYe=new d,XYe=new fe;$o.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=qYe,o=n.cartographicToCartesian(e,i.direction);d.normalize(i.direction,i.direction),i.direction=d.normalize(o,i.direction),i.direction=d.negate(o,i.direction),i.origin=d.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,YYe);if(l(r))return n.cartesianToCartographic(r,XYe)?.height};$o.prototype.updateHeight=function(e,t,n){n=y(n,ee.WGS84);let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var KYe=new ja,ZYe=new d;$o.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let u=i[c],f=Qn.raySphere(e,u.contentBoundingVolume.boundingSphere,KYe);!l(f)||!l(u.content)||r.push(u)}let s=r.length;r.sort((c,u)=>{let f=ae.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),h=ae.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-h});let a;for(let c=0;c<s;++c){let f=r[c].content.pick(e,t,ZYe);if(l(f))return a=d.clone(f,n),a}};var Cs=$o;var $Ye=new F;function Q_(e,t){t.collectionChanged.addEventListener(Q_.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new St,this._onCollectionChanged(t,t.values,[],[])}Q_.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),h;f&&(h=s.computeModelMatrix(e,$Ye),c=Se.createIfNeeded(q.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],QYe(c,n,s,i)),l(p)&&(p.show=!0,l(h)&&(p.modelMatrix=h),p.maximumScreenSpaceError=q.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};Q_.prototype.isDestroyed=function(){return!1};Q_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Q_.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)_j(this,e[i],t,n);return ue(this)};Q_.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return at.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ae.clone(i.boundingSphere,t),at.DONE):at.FAILED:at.PENDING};Q_.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(_j(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],_j(this,r,a,c),s.remove(r.id)};function _j(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function QYe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await Cs.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var JB=Q_;var JYe=z.WHITE,eXe=z.BLACK,tXe=new U(2,2);function fA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(fA.prototype,{isConstant:{get:function(){return q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});fA.prototype.getType=function(e){return"Checkerboard"};var nXe=new Z;fA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(nXe)),l(t)||(t={}),t.lightColor=q.getValueOrClonedDefault(this._evenColor,e,JYe,t.lightColor),t.darkColor=q.getValueOrClonedDefault(this._oddColor,e,eXe,t.darkColor),t.repeat=q.getValueOrDefault(this._repeat,e,tXe),t};fA.prototype.equals=function(e){return this===e||e instanceof fA&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._repeat,e._repeat)};var rD=fA;var $ce={id:void 0};function sD(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function nc(e){this._owner=e,this._entities=new St,this._addedEntities=new St,this._removedEntities=new St,this._changedEntities=new St,this._suspendCount=0,this._collectionChanged=new pe,this._id=zn(),this._show=!0,this._firing=!1,this._refire=!1}nc.prototype.suspendEvents=function(){this._suspendCount++};nc.prototype.resumeEvents=function(){this._suspendCount--,sD(this)};Object.defineProperties(nc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});nc.prototype.computeAvailability=function(){let e=He.MAXIMUM_VALUE,t=He.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;Z.lessThan(a,e)&&!a.equals(He.MINIMUM_VALUE)&&(e=a),Z.greaterThan(c,t)&&!c.equals(He.MAXIMUM_VALUE)&&(t=c)}}return He.MAXIMUM_VALUE.equals(e)&&(e=He.MINIMUM_VALUE),He.MINIMUM_VALUE.equals(t)&&(t=He.MAXIMUM_VALUE),new En({start:e,stop:t})};nc.prototype.add=function(e){e instanceof or||(e=new or(e));let t=e.id,n=this._entities;if(n.contains(t))throw new he(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(nc.prototype._onEntityDefinitionChanged,this),sD(this),e};nc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};nc.prototype.contains=function(e){return this._entities.get(e.id)===e};nc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(nc.prototype._onEntityDefinitionChanged,this),sD(this),!0):!1};nc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(nc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),sD(this)};nc.prototype.getById=function(e){return this._entities.get(e)};nc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||($ce.id=e,t=new or($ce),this.add(t)),t};nc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),sD(this)};var aa=nc;var e3={id:void 0},dA=new Array(2);function yj(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function Qce(e,t,n,i){dA[0]=n,dA[1]=i.id,t[JSON.stringify(dA)]=i.definitionChanged.addEventListener(Nr.prototype._onDefinitionChanged,e)}function Jce(e,t,n,i){dA[0]=n,dA[1]=i.id;let o=JSON.stringify(dA);t[o](),t[o]=void 0}function J_(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,u,f=e._composite,h=new aa(e),p=e._eventHash,_;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(Nr.prototype._onCollectionChanged,e),a=u.values,_=u.id,c=a.length-1;c>-1;c--)s=a[c],Jce(e,p,_,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(Nr.prototype._onCollectionChanged,e),a=u.values,_=u.id,c=a.length-1;c>-1;c--){s=a[c],Qce(e,p,_,s);let x=h.getById(s.id);l(x)||(x=f.getById(s.id),l(x)?yj(x):(e3.id=s.id,x=new or(e3)),h.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=h.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function Nr(e,t){this._owner=t,this._composite=new aa(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=zn(),this._eventHash={},J_(this),this._shouldRecomposite=!1}Object.defineProperties(Nr.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Nr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),J_(this)};Nr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),J_(this),!0):!1};Nr.prototype.removeAllCollections=function(){this._collections.length=0,J_(this)};Nr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Nr.prototype.contains=function(e){return this._composite.contains(e)};Nr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Nr.prototype.getCollection=function(e){return this._collections[e]};Nr.prototype.getCollectionsLength=function(){return this._collections.length};function t3(e,t){return e.indexOf(t)}function ele(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,J_(e)}Nr.prototype.raiseCollection=function(e){let t=t3(this._collections,e);ele(this,t,t+1)};Nr.prototype.lowerCollection=function(e){let t=t3(this._collections,e);ele(this,t,t-1)};Nr.prototype.raiseCollectionToTop=function(e){let t=t3(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),J_(this))};Nr.prototype.lowerCollectionToBottom=function(e){let t=t3(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),J_(this))};Nr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Nr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(J_(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Nr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Nr.prototype.getById=function(e){return this._composite.getById(e)};Nr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,u,f=n.length,h=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];Jce(this,h,p,m);let x=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),yj(u)),u.merge(c));l(u)||r.removeById(x),u=void 0}let _=t.length;for(s=0;s<_;s++){let m=t[s];Qce(this,h,p,m);let x=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),l(u)?yj(u):(e3.id=x,u=new or(e3),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};Nr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),u=c[t],f=!l(u),h=!0;for(let p=s-1;p>=0;p--){let _=o[p].getById(e.id);if(l(_)){let m=_[t];if(l(m)){if(h)if(h=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var tle=Nr;function xj(){this._removalFunctions=[]}xj.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};xj.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var _r=xj;function Cj(e,t){return Z.compare(e.start,t.start)}function Fr(e){if(this._intervals=[],this._changedEvent=new pe,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Fr.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Fr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Fr))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!En.equals(n[r],i[r],t))return!1;return!0};Fr.prototype.get=function(e){return this._intervals[e]};Fr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Fr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Fr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Fr.prototype.contains=function(e){return this.indexOf(e)>=0};var bj=new En;Fr.prototype.indexOf=function(e){let t=this._intervals;bj.start=e,bj.stop=e;let n=Mo(t,bj,Cj);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&En.contains(t[n-1],e)?n-1:~n)};Fr.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};Fr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||Z.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Mo(n,e,Cj);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=Z.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(Z.greaterThan(e.stop,n[i-1].stop)?e=new En({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new En({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=Z.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new En({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new En({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=Z.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new En({start:e.start,stop:Z.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:Z.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new En({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Fr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Mo(t,e,Cj);n<0&&(n=~n);let i=!1;for(n>0&&(Z.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(Z.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new En({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new En({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new En({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&Z.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new En({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new En({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(Z.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new En({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Fr.prototype.intersect=function(e,t,n){let i=new Fr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],u=a[r];if(Z.lessThan(c.stop,u.start))++o;else if(Z.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=En.intersect(c,u,new En,n);f.isEmpty||i.addInterval(f,t)}Z.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};Fr.fromJulianDateArray=function(e,t){l(t)||(t=new Fr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),u,f=0;a&&(++f,u=new En({start:He.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let h=0;h<i-1;++h){let p=n[h],_=n[h+1];u=new En({start:p,stop:_,isStartIncluded:t.length===f?r:!0,isStopIncluded:h===i-2?s:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),p=_}return c&&(u=new En({start:n[i-1],stop:He.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var ic=new Og,aD=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Tj(e,t,n){l(n)||(n=new Z),Z.toGregorianDate(e,ic);let i=ic.millisecond+t.millisecond,o=ic.second+t.second,r=ic.minute+t.minute,s=ic.hour+t.hour,a=ic.day+t.day,c=ic.month+t.month,u=ic.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),aD[2]=xh(u)?29:28;a>aD[c]||c>=13;)a>aD[c]&&(a-=aD[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),aD[2]=xh(u)?29:28;return ic.millisecond=i,ic.second=o,ic.minute=r,ic.hour=s,ic.day=a,ic.month=c,ic.year=u,Z.fromGregorianDate(ic,n)}var iXe=new Z,oXe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function nle(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(oXe);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),Z.toGregorianDate(Z.fromIso8601(e,iXe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var cD=new Og;Fr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=Z.fromIso8601(n[0]),o=Z.fromIso8601(n[1]),r=[];if(!nle(n[2],cD))r.push(i,o);else{let s=Z.clone(i);for(r.push(s);Z.compare(s,o)<0;)s=Tj(s,cD),Z.compare(o,s)<=0&&Z.clone(o,s),r.push(s)}return Fr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Fr.fromIso8601DateArray=function(e,t){return Fr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return Z.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Fr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let u=0;u<c;++u)(nle(i[u],cD)||u===0)&&(o&&l(a)?s=Tj(a,cD):s=Tj(n,cD),r.push(s),a=s);return Fr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Yr=Fr;function rXe(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function Fx(){this._eventHelper=new _r,this._definitionChanged=new pe,this._intervals=new Yr,this._intervals.changedEvent.addEventListener(Fx.prototype._intervalsChanged,this)}Object.defineProperties(Fx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var sXe=new Z;Fx.prototype.getValue=function(e,t){l(e)||(e=Z.now(sXe));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Fx.prototype.equals=function(e){return this===e||e instanceof Fx&&this._intervals.equals(e._intervals,q.equals)};Fx.prototype._intervalsChanged=function(){rXe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Hc=Fx;function ey(){this._definitionChanged=new pe,this._composite=new Hc,this._composite.definitionChanged.addEventListener(ey.prototype._raiseDefinitionChanged,this)}Object.defineProperties(ey.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});ey.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var aXe=new Z;ey.prototype.getValue=function(e,t){l(e)||(e=Z.now(aXe));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};ey.prototype.equals=function(e){return this===e||e instanceof ey&&this._composite.equals(e._composite,q.equals)};ey.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var lD=ey;function ty(e){this._referenceFrame=y(e,Ui.FIXED),this._definitionChanged=new pe,this._composite=new Hc,this._composite.definitionChanged.addEventListener(ty.prototype._raiseDefinitionChanged,this)}Object.defineProperties(ty.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var cXe=new Z;ty.prototype.getValue=function(e,t){return l(e)||(e=Z.now(cXe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};ty.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};ty.prototype.equals=function(e){return this===e||e instanceof ty&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,q.equals)};ty.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var va=ty;var lXe={ROUNDED:0,MITERED:1,BEVELED:2},Fi=Object.freeze(lXe);var ca=[new d,new d],uXe=new d,fXe=new d,dXe=new d,hXe=new d,mXe=new d,pXe=new d,gXe=new d,_Xe=new d,yXe=new d,hA=new d,n3=new d,uD={},Aj=new fe;function xXe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];Aj=t.cartesianToCartographic(o,Aj),n[i]=Aj.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function Ej(e,t,n,i){let o=e[0],r=e[1],s=d.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let h=(n-t)/a;for(u=1;u<a;u++){let p=t+u*h;c[u]=p}return c[0]=t,c.push(n),c}var i3=new d,o3=new d;function bXe(e,t,n,i){let o=new ns(n,i),r=o.projectPointOntoPlane(d.add(n,e,i3),i3),s=o.projectPointOntoPlane(d.add(n,t,o3),o3),a=U.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var TXe=new d(-1,0,0),Bx=new F,CXe=new F,Sj=new $,AXe=$.IDENTITY.clone(),EXe=new d,SXe=new oe,ile=new d;function Kp(e,t,n,i,o,r,s,a){let c=EXe,u=SXe;Bx=Ot.eastNorthUpToFixedFrame(e,o,Bx),c=F.multiplyByPointAsVector(Bx,TXe,c),c=d.normalize(c,c);let f=bXe(c,t,e,o);Sj=$.fromRotationZ(f,Sj),ile.z=r,Bx=F.multiplyTransformation(Bx,F.fromRotationTranslation(Sj,ile,CXe),Bx);let h=AXe;h[0]=s;for(let p=0;p<a;p++)for(let _=0;_<n.length;_+=3)u=d.fromArray(n,_,u),u=$.multiplyByVector(h,u,u),u=F.multiplyByPoint(Bx,u,u),i.push(u.x,u.y,u.z);return i}var vXe=new d;function vj(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=d.fromArray(e,a,vXe);i=Kp(c,t,n,i,o,r[a/3],s,1)}return i}function wXe(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function ole(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var rle=new Oe,sle=new d,ale=new $;function cle(e,t,n,i,o,r,s,a,c,u){let f=d.angleBetween(d.subtract(t,e,hA),d.subtract(n,e,n3)),h=i===Fi.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;o?p=$.fromQuaternion(Oe.fromAxisAngle(d.negate(e,hA),f/(h+1),rle),ale):p=$.fromQuaternion(Oe.fromAxisAngle(e,f/(h+1),rle),ale);let _,m;if(t=d.clone(t,sle),h>0){let x=u?2:1;for(let b=0;b<h;b++)t=$.multiplyByVector(p,t,t),_=d.subtract(t,e,hA),_=d.normalize(_,_),o||(_=d.negate(_,_)),m=r.scaleToGeodeticSurface(t,n3),s=Kp(m,_,a,s,r,c,1,x)}else _=d.subtract(t,e,hA),_=d.normalize(_,_),o||(_=d.negate(_,_)),m=r.scaleToGeodeticSurface(t,n3),s=Kp(m,_,a,s,r,c,1,1),n=d.clone(n,sle),_=d.subtract(n,e,hA),_=d.normalize(_,_),o||(_=d.negate(_,_)),m=r.scaleToGeodeticSurface(n,n3),s=Kp(m,_,a,s,r,c,1,1);return s}uD.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];U.equals(r,s)||n.push(s)}return n};uD.angleIsGreaterThanPi=function(e,t,n,i){let o=new ns(n,i),r=o.projectPointOntoPlane(d.add(n,e,i3),i3),s=o.projectPointOntoPlane(d.add(n,t,o3),o3);return s.x*r.y-s.y*r.x>=0};var DXe=new d,IXe=new d;uD.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=xXe(e,r),a=i._granularity,c=i._cornerType,u=o?wXe(t,n):ole(t,n),f=o?ole(t,n):void 0,h=n.height/2,p=n.width/2,_=e.length,m=[],x=o?[]:void 0,b=uXe,T=fXe,C=dXe,A=hXe,S=mXe,v=pXe,D=gXe,O=_Xe,R=yXe,M=e[0],L=e[1];A=r.geodeticSurfaceNormal(M,A),b=d.subtract(L,M,b),b=d.normalize(b,b),O=d.cross(A,b,O),O=d.normalize(O,O);let g=s[0],E=s[1];o&&(x=Kp(M,O,f,x,r,g+h,1,1)),R=d.clone(M,R),M=L,T=d.negate(b,T);let w,I;for(let H=1;H<_-1;H++){let V=o?2:1;if(L=e[H+1],M.equals(L)){yt("Positions are too close and are considered equivalent with rounding error.");continue}b=d.subtract(L,M,b),b=d.normalize(b,b),A=r.geodeticSurfaceNormal(M,A);let G=d.multiplyByScalar(A,d.dot(b,A),DXe);d.subtract(b,G,G),d.normalize(G,G);let k=d.multiplyByScalar(A,d.dot(T,A),IXe);if(d.subtract(T,k,k),d.normalize(k,k),!P.equalsEpsilon(Math.abs(d.dot(G,k)),1,P.EPSILON7)){C=d.add(b,T,C),C=d.normalize(C,C),C=d.cross(C,A,C),C=d.cross(A,C,C),C=d.normalize(C,C);let Y=1/Math.max(.25,d.magnitude(d.cross(C,T,hA))),J=uD.angleIsGreaterThanPi(b,T,M,r);J?(S=d.add(M,d.multiplyByScalar(C,Y*p,C),S),v=d.add(S,d.multiplyByScalar(O,p,v),v),ca[0]=d.clone(R,ca[0]),ca[1]=d.clone(v,ca[1]),w=Ej(ca,g+h,E+h,a),I=Ni.generateArc({positions:ca,granularity:a,ellipsoid:r}),m=vj(I,O,u,m,r,w,1),O=d.cross(A,b,O),O=d.normalize(O,O),D=d.add(S,d.multiplyByScalar(O,p,D),D),c===Fi.ROUNDED||c===Fi.BEVELED?cle(S,v,D,c,J,r,m,u,E+h,o):(C=d.negate(C,C),m=Kp(M,C,u,m,r,E+h,Y,V)),R=d.clone(D,R)):(S=d.add(M,d.multiplyByScalar(C,Y*p,C),S),v=d.add(S,d.multiplyByScalar(O,-p,v),v),ca[0]=d.clone(R,ca[0]),ca[1]=d.clone(v,ca[1]),w=Ej(ca,g+h,E+h,a),I=Ni.generateArc({positions:ca,granularity:a,ellipsoid:r}),m=vj(I,O,u,m,r,w,1),O=d.cross(A,b,O),O=d.normalize(O,O),D=d.add(S,d.multiplyByScalar(O,-p,D),D),c===Fi.ROUNDED||c===Fi.BEVELED?cle(S,v,D,c,J,r,m,u,E+h,o):m=Kp(M,C,u,m,r,E+h,Y,V),R=d.clone(D,R)),T=d.negate(b,T)}else m=Kp(R,O,u,m,r,g+h,1,1),R=M;g=E,E=s[H+1],M=L}ca[0]=d.clone(R,ca[0]),ca[1]=d.clone(M,ca[1]),w=Ej(ca,g+h,E+h,a),I=Ni.generateArc({positions:ca,granularity:a,ellipsoid:r}),m=vj(I,O,u,m,r,w,1),o&&(x=Kp(M,O,f,x,r,E+h,1,1)),_=m.length;let N=o?_+x.length:_,B=new Float64Array(N);return B.set(m),o&&B.set(x,_),B};var cm=uD;var Dj={},mA=new d,hle=new d,PXe=new d,lle=new d,Gc=[new d,new d],mle=new d,ple=new d,gle=new d,RXe=new d,OXe=new d,MXe=new d,LXe=new d,NXe=new d,FXe=new d,BXe=new d,ule=new Oe,fle=new $;function r3(e,t,n,i,o){let r=d.angleBetween(d.subtract(t,e,mA),d.subtract(n,e,hle)),s=i===Fi.BEVELED?1:Math.ceil(r/P.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;o?u=$.fromQuaternion(Oe.fromAxisAngle(d.negate(e,mA),r/s,ule),fle):u=$.fromQuaternion(Oe.fromAxisAngle(e,r/s,ule),fle);let f=0;t=d.clone(t,mA);for(let h=0;h<s;h++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function kXe(e){let t=mle,n=ple,i=gle,o=e[1];n=d.fromArray(e[1],o.length-3,n),i=d.fromArray(e[0],0,i),t=d.midpoint(n,i,t);let r=r3(t,n,i,Fi.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=d.fromArray(a,a.length-3,n),i=d.fromArray(o,0,i),t=d.midpoint(n,i,t);let c=r3(t,n,i,Fi.ROUNDED,!1);return[r,c]}function dle(e,t,n,i){let o=mA;return i?o=d.add(e,t,o):(t=d.negate(t,t),o=d.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function wj(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=d.multiplyByScalar(t,n,mA),a=d.negate(s,hle),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let h=d.fromArray(e,f,PXe),p=d.add(h,a,lle);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let _=d.add(h,s,lle);r[u--]=_.z,r[u--]=_.y,r[u--]=_.x}return i.push(o,r),i}Dj.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var VXe=new d,UXe=new d;Dj.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=mle,c=ple,u=gle,f=RXe,h=OXe,p=MXe,_=LXe,m=NXe,x=FXe,b=BXe,T=[],C=s?[]:void 0,A=s?[]:void 0,S=n[0],v=n[1];c=d.normalize(d.subtract(v,S,c),c),a=i.geodeticSurfaceNormal(S,a),f=d.normalize(d.cross(a,c,f),f),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),_=d.clone(S,_),S=v,u=d.negate(c,u);let D,O=[],R,M=n.length;for(R=1;R<M-1;R++){a=i.geodeticSurfaceNormal(S,a),v=n[R+1],c=d.normalize(d.subtract(v,S,c),c);let g=d.multiplyByScalar(a,d.dot(c,a),VXe);d.subtract(c,g,g),d.normalize(g,g);let E=d.multiplyByScalar(a,d.dot(u,a),UXe);if(d.subtract(u,E,E),d.normalize(E,E),!P.equalsEpsilon(Math.abs(d.dot(g,E)),1,P.EPSILON7)){h=d.normalize(d.add(c,u,h),h),h=d.cross(h,a,h),h=d.cross(a,h,h),h=d.normalize(h,h);let I=o/Math.max(.25,d.magnitude(d.cross(h,u,mA))),N=cm.angleIsGreaterThanPi(c,u,S,i);h=d.multiplyByScalar(h,I,h),N?(m=d.add(S,h,m),b=d.add(m,d.multiplyByScalar(f,o,b),b),x=d.add(m,d.multiplyByScalar(f,o*2,x),x),Gc[0]=d.clone(_,Gc[0]),Gc[1]=d.clone(b,Gc[1]),D=Ni.generateArc({positions:Gc,granularity:t,ellipsoid:i}),T=wj(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),p=d.clone(x,p),f=d.normalize(d.cross(a,c,f),f),x=d.add(m,d.multiplyByScalar(f,o*2,x),x),_=d.add(m,d.multiplyByScalar(f,o,_),_),r===Fi.ROUNDED||r===Fi.BEVELED?O.push({leftPositions:r3(m,p,x,r,N)}):O.push({leftPositions:dle(S,d.negate(h,h),x,N)})):(x=d.add(S,h,x),b=d.add(x,d.negate(d.multiplyByScalar(f,o,b),b),b),m=d.add(x,d.negate(d.multiplyByScalar(f,o*2,m),m),m),Gc[0]=d.clone(_,Gc[0]),Gc[1]=d.clone(b,Gc[1]),D=Ni.generateArc({positions:Gc,granularity:t,ellipsoid:i}),T=wj(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),p=d.clone(m,p),f=d.normalize(d.cross(a,c,f),f),m=d.add(x,d.negate(d.multiplyByScalar(f,o*2,m),m),m),_=d.add(x,d.negate(d.multiplyByScalar(f,o,_),_),_),r===Fi.ROUNDED||r===Fi.BEVELED?O.push({rightPositions:r3(x,p,m,r,N)}):O.push({rightPositions:dle(S,h,m,N)})),u=d.negate(c,u)}S=v}a=i.geodeticSurfaceNormal(S,a),Gc[0]=d.clone(_,Gc[0]),Gc[1]=d.clone(S,Gc[1]),D=Ni.generateArc({positions:Gc,granularity:t,ellipsoid:i}),T=wj(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z));let L;return r===Fi.ROUNDED&&(L=kXe(T)),{positions:T,corners:O,lefts:C,normals:A,endPositions:L}};var Hi=Dj;var xle=new d,ble=new d,s3=new d,a3=new d,zXe=new d,Tle=new d,ny=new d,pA=new d;function Cle(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Fd(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,u=d.normalize(d.cross(n,t,ny),ny);r.normal&&Hi.addAttribute(s,t,i,o),r.tangent&&Hi.addAttribute(a,u,i,o),r.bitangent&&Hi.addAttribute(c,n,i,o)}function Ale(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new dn,u,f=0,h=0,p,_=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,_+=m*2,h+=i[p+1].length-3;for(f+=3,h+=3,p=0;p<o.length;p++){u=o[p];let Q=o[p].leftPositions;l(Q)?(m=Q.length,f+=m,_+=m):(m=o[p].rightPositions.length,h+=m,_+=m)}let x=l(r),b;x&&(b=r[0].length-3,f+=b,h+=b,b/=3,_+=b*6);let T=f+h,C=new Float64Array(T),A=t.normal?new Float32Array(T):void 0,S=t.tangent?new Float32Array(T):void 0,v=t.bitangent?new Float32Array(T):void 0,D={normals:A,tangents:S,bitangents:v},O=0,R=T-1,M,L,g,E,w=xle,I=ble,N,B,H=b/2,V=Ne.createTypedArray(T/3,_),G=0;if(x){B=s3,N=a3;let Q=r[0];for(w=d.fromArray(a,0,w),I=d.fromArray(s,0,I),p=0;p<H;p++)B=d.fromArray(Q,(H-1-p)*3,B),N=d.fromArray(Q,(H+p)*3,N),Hi.addAttribute(C,N,O),Hi.addAttribute(C,B,void 0,R),Fd(D,w,I,O,R,t),L=O/3,E=L+1,M=(R-2)/3,g=M-1,V[G++]=M,V[G++]=L,V[G++]=g,V[G++]=g,V[G++]=L,V[G++]=E,O+=3,R-=3}let k=0,W=0,Y=i[k++],J=i[k++];C.set(Y,O),C.set(J,R-J.length+1),I=d.fromArray(s,W,I);let j,K;for(m=J.length-3,p=0;p<m;p+=3)j=n.geodeticSurfaceNormal(d.fromArray(Y,p,ny),ny),K=n.geodeticSurfaceNormal(d.fromArray(J,m-p,pA),pA),w=d.normalize(d.add(j,K,w),w),Fd(D,w,I,O,R,t),L=O/3,E=L+1,M=(R-2)/3,g=M-1,V[G++]=M,V[G++]=L,V[G++]=g,V[G++]=g,V[G++]=L,V[G++]=E,O+=3,R-=3;for(j=n.geodeticSurfaceNormal(d.fromArray(Y,m,ny),ny),K=n.geodeticSurfaceNormal(d.fromArray(J,m,pA),pA),w=d.normalize(d.add(j,K,w),w),W+=3,p=0;p<o.length;p++){let Q;u=o[p];let de=u.leftPositions,xe=u.rightPositions,ce,_e,be=Tle,De=s3,Ae=a3;if(w=d.fromArray(a,W,w),l(de)){for(Fd(D,w,I,void 0,R,t),R-=3,ce=E,_e=g,Q=0;Q<de.length/3;Q++)be=d.fromArray(de,Q*3,be),V[G++]=ce,V[G++]=_e-Q-1,V[G++]=_e-Q,Hi.addAttribute(C,be,void 0,R),De=d.fromArray(C,(_e-Q-1)*3,De),Ae=d.fromArray(C,ce*3,Ae),I=d.normalize(d.subtract(De,Ae,I),I),Fd(D,w,I,void 0,R,t),R-=3;be=d.fromArray(C,ce*3,be),De=d.subtract(d.fromArray(C,_e*3,De),be,De),Ae=d.subtract(d.fromArray(C,(_e-Q)*3,Ae),be,Ae),I=d.normalize(d.add(De,Ae,I),I),Fd(D,w,I,O,void 0,t),O+=3}else{for(Fd(D,w,I,O,void 0,t),O+=3,ce=g,_e=E,Q=0;Q<xe.length/3;Q++)be=d.fromArray(xe,Q*3,be),V[G++]=ce,V[G++]=_e+Q,V[G++]=_e+Q+1,Hi.addAttribute(C,be,O),De=d.fromArray(C,ce*3,De),Ae=d.fromArray(C,(_e+Q)*3,Ae),I=d.normalize(d.subtract(De,Ae,I),I),Fd(D,w,I,O,void 0,t),O+=3;be=d.fromArray(C,ce*3,be),De=d.subtract(d.fromArray(C,(_e+Q)*3,De),be,De),Ae=d.subtract(d.fromArray(C,_e*3,Ae),be,Ae),I=d.normalize(d.negate(d.add(Ae,De,I),I),I),Fd(D,w,I,void 0,R,t),R-=3}for(Y=i[k++],J=i[k++],Y.splice(0,3),J.splice(J.length-3,3),C.set(Y,O),C.set(J,R-J.length+1),m=J.length-3,W+=3,I=d.fromArray(s,W,I),Q=0;Q<J.length;Q+=3)j=n.geodeticSurfaceNormal(d.fromArray(Y,Q,ny),ny),K=n.geodeticSurfaceNormal(d.fromArray(J,m-Q,pA),pA),w=d.normalize(d.add(j,K,w),w),Fd(D,w,I,O,R,t),E=O/3,L=E-1,g=(R-2)/3,M=g+1,V[G++]=M,V[G++]=L,V[G++]=g,V[G++]=g,V[G++]=L,V[G++]=E,O+=3,R-=3;O-=3,R+=3}if(w=d.fromArray(a,a.length-3,w),Fd(D,w,I,O,R,t),x){O+=3,R-=3,B=s3,N=a3;let Q=r[1];for(p=0;p<H;p++)B=d.fromArray(Q,(b-p-1)*3,B),N=d.fromArray(Q,p*3,N),Hi.addAttribute(C,B,void 0,R),Hi.addAttribute(C,N,O),Fd(D,w,I,O,R,t),E=O/3,L=E-1,g=(R-2)/3,M=g+1,V[G++]=M,V[G++]=L,V[G++]=g,V[G++]=g,V[G++]=L,V[G++]=E,O+=3,R-=3}if(c.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C}),t.st){let Q=new Float32Array(T/3*2),de,xe,ce=0;if(x){f/=3,h/=3;let _e=Math.PI/(b+1);xe=1/(f-b+1),de=1/(h-b+1);let be,De=b/2;for(p=De+1;p<b+1;p++)be=P.PI_OVER_TWO+_e*p,Q[ce++]=de*(1+Math.cos(be)),Q[ce++]=.5*(1+Math.sin(be));for(p=1;p<h-b+1;p++)Q[ce++]=p*de,Q[ce++]=0;for(p=b;p>De;p--)be=P.PI_OVER_TWO-p*_e,Q[ce++]=1-de*(1+Math.cos(be)),Q[ce++]=.5*(1+Math.sin(be));for(p=De;p>0;p--)be=P.PI_OVER_TWO-_e*p,Q[ce++]=1-xe*(1+Math.cos(be)),Q[ce++]=.5*(1+Math.sin(be));for(p=f-b;p>0;p--)Q[ce++]=p*xe,Q[ce++]=1;for(p=1;p<De+1;p++)be=P.PI_OVER_TWO+_e*p,Q[ce++]=xe*(1+Math.cos(be)),Q[ce++]=.5*(1+Math.sin(be))}else{for(f/=3,h/=3,xe=1/(f-1),de=1/(h-1),p=0;p<h;p++)Q[ce++]=p*de,Q[ce++]=0;for(p=f;p>0;p--)Q[ce++]=(p-1)*xe,Q[ce++]=1}c.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:Q})}return t.normal&&(c.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.normals})),t.tangent&&(c.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.tangents})),t.bitangent&&(c.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.bitangents})),{attributes:c,indices:V}}function HXe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,h=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,_=xle,m=ble,x=s3,b=a3,T=zXe,C=Tle,A=c;for(u=0;u<s;u+=3){let S=A+c;_=d.fromArray(n,u,_),m=d.fromArray(n,u+s,m),x=d.fromArray(n,(u+3)%s,x),m=d.subtract(m,_,m),x=d.subtract(x,_,x),b=d.normalize(d.cross(m,x,b),b),t.normal&&(Hi.addAttribute(f,b,S),Hi.addAttribute(f,b,S+3),Hi.addAttribute(f,b,A),Hi.addAttribute(f,b,A+3)),(t.tangent||t.bitangent)&&(C=d.fromArray(i,u,C),t.bitangent&&(Hi.addAttribute(p,C,S),Hi.addAttribute(p,C,S+3),Hi.addAttribute(p,C,A),Hi.addAttribute(p,C,A+3)),t.tangent&&(T=d.normalize(d.cross(C,b,T),T),Hi.addAttribute(h,T,S),Hi.addAttribute(h,T,S+3),Hi.addAttribute(h,T,A),Hi.addAttribute(h,T,A+3))),A+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let S=e.tangent.values;h.set(S),h.set(S,s),e.tangent.values=h}}if(t.st){let f=e.st.values,h=new Float32Array(a*6);h.set(f),h.set(f,a);let p=a*2;for(let _=0;_<2;_++){for(h[p++]=f[0],h[p++]=f[1],u=2;u<a;u+=2){let m=f[u],x=f[u+1];h[p++]=m,h[p++]=x,h[p++]=m,h[p++]=x}h[p++]=f[0],h[p++]=f[1]}e.st.values=h}return e}function Ij(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function GXe(e,t){let n=new Ie({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=Hi.computePositions(e),r=Ale(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,h=f.length,p=new Float64Array(h*6),_=new Float64Array(h);_.set(f);let m=new Float64Array(h*4);f=si.scaleToGeodeticHeight(f,s,i),m=Ij(f,0,m),_=si.scaleToGeodeticHeight(_,a,i),m=Ij(_,h*2,m),p.set(f),p.set(_,h),p.set(m,h*2),c.position.values=p,c=HXe(c,t);let x,b=h/3;if(e.shadowVolume){let M=c.normal.values;h=M.length;let L=new Float32Array(h*6);for(x=0;x<h;x++)M[x]=-M[x];L.set(M,h),L=Ij(M,h*4,L),c.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let M=new Uint8Array(b*6);if(e.offsetAttribute===rn.TOP)M=M.fill(1,0,b).fill(1,b*2,b*4);else{let L=e.offsetAttribute===rn.NONE?0:1;M=M.fill(L)}c.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}let T=u.length,C=b+b,A=Ne.createTypedArray(p.length/3,T*2+C*3);A.set(u);let S=T;for(x=0;x<T;x+=3){let M=u[x],L=u[x+1],g=u[x+2];A[S++]=g+b,A[S++]=L+b,A[S++]=M+b}let v,D,O,R;for(x=0;x<C;x+=2)v=x+C,D=v+C,O=v+1,R=D+1,A[S++]=v,A[S++]=D,A[S++]=O,A[S++]=O,A[S++]=D,A[S++]=R;return{attributes:c,indices:A}}var _le=new d,fD=new d,Of=new fe;function yle(e,t,n,i,o,r){let s=d.subtract(t,e,_le);d.normalize(s,s);let a=n.geodeticSurfaceNormal(e,fD),c=d.cross(s,a,_le);d.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,h=r.latitude,p=r.longitude;d.add(e,c,fD),n.cartesianToCartographic(fD,Of);let _=Of.latitude,m=Of.longitude;u=Math.min(u,_),f=Math.min(f,m),h=Math.max(h,_),p=Math.max(p,m),d.subtract(e,c,fD),n.cartesianToCartographic(fD,Of),_=Of.latitude,m=Of.longitude,u=Math.min(u,_),f=Math.min(f,m),h=Math.max(h,_),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=h,r.longitude=p}var Rf=new d,dD=new d,wl=new fe,Dl=new fe;function Ele(e,t,n,i,o){e=Cle(e,t);let r=bo(e,d.equalsEpsilon),s=r.length;if(s<2||n<=0)return new se;let a=n*.5;wl.latitude=Number.POSITIVE_INFINITY,wl.longitude=Number.POSITIVE_INFINITY,Dl.latitude=Number.NEGATIVE_INFINITY,Dl.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Fi.ROUNDED){let p=r[0];d.subtract(p,r[1],Rf),d.normalize(Rf,Rf),d.multiplyByScalar(Rf,a,Rf),d.add(p,Rf,dD),t.cartesianToCartographic(dD,Of),c=Of.latitude,u=Of.longitude,wl.latitude=Math.min(wl.latitude,c),wl.longitude=Math.min(wl.longitude,u),Dl.latitude=Math.max(Dl.latitude,c),Dl.longitude=Math.max(Dl.longitude,u)}for(let p=0;p<s-1;++p)yle(r[p],r[p+1],t,a,wl,Dl);let f=r[s-1];d.subtract(f,r[s-2],Rf),d.normalize(Rf,Rf),d.multiplyByScalar(Rf,a,Rf),d.add(f,Rf,dD),yle(f,dD,t,a,wl,Dl),i===Fi.ROUNDED&&(t.cartesianToCartographic(dD,Of),c=Of.latitude,u=Of.longitude,wl.latitude=Math.min(wl.latitude,c),wl.longitude=Math.min(wl.longitude,u),Dl.latitude=Math.max(Dl.latitude,c),Dl.longitude=Math.max(Dl.longitude,u));let h=l(o)?o:new se;return h.north=Dl.latitude,h.south=wl.latitude,h.east=Dl.longitude,h.west=wl.longitude,h}function $p(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Fi.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*d.packedLength+ee.packedLength+Ie.packedLength+7}$p.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Sle=ee.clone(ee.UNIT_SPHERE),vle=new Ie,Zp={positions:void 0,ellipsoid:Sle,vertexFormat:vle,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};$p.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=d.packedLength)o[m]=d.unpack(e,t);let r=ee.unpack(e,t,Sle);t+=ee.packedLength;let s=Ie.unpack(e,t,vle);t+=Ie.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++]===1,_=e[t];return l(n)?(n._positions=o,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Ie.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=h,n._shadowVolume=p,n._offsetAttribute=_===-1?void 0:_,n):(Zp.positions=o,Zp.width=a,Zp.height=c,Zp.extrudedHeight=u,Zp.cornerType=f,Zp.granularity=h,Zp.shadowVolume=p,Zp.offsetAttribute=_===-1?void 0:_,new $p(Zp))};$p.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,o=y(e.ellipsoid,ee.default),r=y(e.cornerType,Fi.ROUNDED);return Ele(n,o,i,r,t)};$p.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Cle(t,i);let o=bo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=GXe(u,c);else{let _=Hi.computePositions(u);if(f=Ale(_,c,i),f.attributes.position.values=si.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let m=e._offsetAttribute===rn.NONE?0:1,x=f.attributes.position.values.length,b=new Uint8Array(x/3).fill(m);f.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let h=f.attributes,p=ae.fromVertices(h.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new st({attributes:h,indices:f.indices,primitiveType:Me.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};$p.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new $p({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties($p.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Ele(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var gA=$p;var wle=new d,Dle=new d,WXe=new d;function jXe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Ile(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new dn,a,c=0,u=0,f,h=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,h+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){a=o[f];let N=o[f].leftPositions;l(N)?(p=N.length,c+=p,h+=p/3*2):(p=o[f].rightPositions.length,u+=p,h+=p/3*2)}let _=l(r),m;_&&(m=r[0].length-3,c+=m,u+=m,m/=3,h+=m*4);let x=c+u,b=new Float64Array(x),T=0,C=x-1,A,S,v,D,O,R,M=m/2,L=Ne.createTypedArray(x/3,h+4),g=0;if(L[g++]=T/3,L[g++]=(C-2)/3,_){n.push(T/3),R=wle,O=Dle;let N=r[0];for(f=0;f<M;f++)R=d.fromArray(N,(M-1-f)*3,R),O=d.fromArray(N,(M+f)*3,O),Hi.addAttribute(b,O,T),Hi.addAttribute(b,R,void 0,C),S=T/3,D=S+1,A=(C-2)/3,v=A-1,L[g++]=A,L[g++]=v,L[g++]=S,L[g++]=D,T+=3,C-=3}let E=0,w=i[E++],I=i[E++];for(b.set(w,T),b.set(I,C-I.length+1),p=I.length-3,n.push(T/3,(C-2)/3),f=0;f<p;f+=3)S=T/3,D=S+1,A=(C-2)/3,v=A-1,L[g++]=A,L[g++]=v,L[g++]=S,L[g++]=D,T+=3,C-=3;for(f=0;f<o.length;f++){let N;a=o[f];let B=a.leftPositions,H=a.rightPositions,V,G=WXe;if(l(B)){for(C-=3,V=v,n.push(D),N=0;N<B.length/3;N++)G=d.fromArray(B,N*3,G),L[g++]=V-N-1,L[g++]=V-N,Hi.addAttribute(b,G,void 0,C),C-=3;n.push(V-Math.floor(B.length/6)),t===Fi.BEVELED&&n.push((C-2)/3+1),T+=3}else{for(T+=3,V=D,n.push(v),N=0;N<H.length/3;N++)G=d.fromArray(H,N*3,G),L[g++]=V+N,L[g++]=V+N+1,Hi.addAttribute(b,G,T),T+=3;n.push(V+Math.floor(H.length/6)),t===Fi.BEVELED&&n.push(T/3-1),C-=3}for(w=i[E++],I=i[E++],w.splice(0,3),I.splice(I.length-3,3),b.set(w,T),b.set(I,C-I.length+1),p=I.length-3,N=0;N<I.length;N+=3)D=T/3,S=D-1,v=(C-2)/3,A=v+1,L[g++]=A,L[g++]=v,L[g++]=S,L[g++]=D,T+=3,C-=3;T-=3,C+=3,n.push(T/3,(C-2)/3)}if(_){T+=3,C-=3,R=wle,O=Dle;let N=r[1];for(f=0;f<M;f++)R=d.fromArray(N,(m-f-1)*3,R),O=d.fromArray(N,f*3,O),Hi.addAttribute(b,R,void 0,C),Hi.addAttribute(b,O,T),D=T/3,S=D-1,v=(C-2)/3,A=v+1,L[g++]=A,L[g++]=v,L[g++]=S,L[g++]=D,T+=3,C-=3;n.push(T/3)}else n.push(T/3,(C-2)/3);return L[g++]=T/3,L[g++]=(C-2)/3,s.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:s,indices:L,wallIndices:n}}function qXe(e){let t=e.ellipsoid,n=Hi.computePositions(e),i=Ile(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,h=new Float64Array(f);h.set(u);let p=new Float64Array(f*2);if(u=si.scaleToGeodeticHeight(u,r,t),h=si.scaleToGeodeticHeight(h,s,t),p.set(u),p.set(h,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let A=new Uint8Array(f*2);if(e.offsetAttribute===rn.TOP)A=A.fill(1,0,f);else{let S=e.offsetAttribute===rn.NONE?0:1;A=A.fill(S)}a.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}let _,m=c.length,x=Ne.createTypedArray(p.length/3,(m+o.length)*2);x.set(c);let b=m;for(_=0;_<m;_+=2){let A=c[_],S=c[_+1];x[b++]=A+f,x[b++]=S+f}let T,C;for(_=0;_<o.length;_++)T=o[_],C=T+f,x[b++]=T,x[b++]=C;return{attributes:a,indices:x}}function hD(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Fi.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*d.packedLength+ee.packedLength+6}hD.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var Ple=ee.clone(ee.UNIT_SPHERE),iy={positions:void 0,ellipsoid:Ple,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};hD.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=d.packedLength)o[p]=d.unpack(e,t);let r=ee.unpack(e,t,Ple);t+=ee.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t];return l(n)?(n._positions=o,n._ellipsoid=ee.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=h===-1?void 0:h,n):(iy.positions=o,iy.width=s,iy.height=a,iy.extrudedHeight=c,iy.cornerType=u,iy.granularity=f,iy.offsetAttribute=h===-1?void 0:h,new hD(iy))};hD.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=jXe(t,i);let o=bo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=qXe(c);else{let p=Hi.computePositions(c);if(u=Ile(p,c.cornerType),u.attributes.position.values=si.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let _=u.attributes.position.values.length,m=e._offsetAttribute===rn.NONE?0:1,x=new Uint8Array(_/3).fill(m);u.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let f=u.attributes,h=ae.fromVertices(f.position.values,void 0,3);return new st({attributes:f,indices:u.indices,primitiveType:Me.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var c3=hD;var YXe=new Xn(0);function Wc(e){oi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Wc.prototype=Object.create(oi.prototype),Wc.prototype.constructor=Wc);Object.defineProperties(Wc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Wc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&gl.isSupported(this._scene)};Wc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Wc.prototype._computeCenter=he.throwInstantiationError;Wc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&yt(yt.geometryZIndex),this._zIndex=y(o.zIndex,YXe),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new kh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new JT(this._scene,a,r,s)}};Wc.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),oi.prototype.destroy.call(this)};Wc.getGeometryHeight=function(e,t){if(!l(e)){t!==Ye.NONE&&yt(yt.geometryHeightReference);return}return tf(t)?0:e};Wc.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==Ye.NONE&&yt(yt.geometryExtrudedHeightReference);return}return tf(t)?Wc.CLAMP_TO_GROUND:e};Wc.CLAMP_TO_GROUND="clamp";Wc.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=Ye.NONE),(!l(n)||!l(i))&&(i=Ye.NONE);let o=0;if(t!==Ye.NONE&&o++,i===Ye.RELATIVE_TO_GROUND&&o++,o===2)return rn.ALL;if(o===1)return rn.TOP};var Gn=Wc;var Rle=new z,Ole=d.ZERO,Mle=new d,Lle=new se;function XXe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Bd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new XXe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Bd.prototype=Object.create(Gn.prototype),Bd.prototype.constructor=Bd);Bd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Rle)),l(o)||(o=z.WHITE),i.color=Gt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Ole,Mle))),new vt({id:t,geometry:new gA(this._options),attributes:i})};Bd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Rle),o={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Ole,Mle))),new vt({id:t,geometry:new c3(this._options),attributes:o})};Bd.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return d.clone(n[Math.floor(n.length/2)],t)};Bd.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||oi.prototype._isHidden.call(this,e,t)};Bd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.width)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};Bd.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,He.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),o=q.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),r=q.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(He.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(He.MINIMUM_VALUE),s.granularity=q.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),s.cornerType=q.getValueOrUndefined(t.cornerType,He.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=ui.getMinimumMaximumHeights(gA.computeRectangle(s,Lle)).minimumTerrainHeight),s.extrudedHeight=o};Bd.DynamicGeometryUpdater=_A;function _A(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(_A.prototype=Object.create(ii.prototype),_A.prototype.constructor=_A);_A.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ii.prototype._isHidden.call(this,e,t,n)};_A.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,Ye.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.positions=q.getValueOrUndefined(t.positions,n),i.width=q.getValueOrUndefined(t.width,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(gA.computeRectangle(i,Lle)).minimumTerrainHeight),i.extrudedHeight=s};var l3=Bd;function u3(){he.throwInstantiationError()}Object.defineProperties(u3.prototype,{name:{get:he.throwInstantiationError},clock:{get:he.throwInstantiationError},entities:{get:he.throwInstantiationError},isLoading:{get:he.throwInstantiationError},changedEvent:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},loadingEvent:{get:he.throwInstantiationError},show:{get:he.throwInstantiationError},clustering:{get:he.throwInstantiationError}});u3.prototype.update=function(e){he.throwInstantiationError()};u3.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Xr=u3;function lm(e,t){this._ellipsoid=e,this._cameraPosition=new d,this._cameraPositionInScaledSpace=new d,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(lm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=d.magnitudeSquared(n)-1;d.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Nle=new d;lm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Nle);return Rj(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};lm.prototype.isScaledSpacePointVisible=function(e){return Rj(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var KXe=new d;lm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=KXe,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),Rj(e,o,i)};lm.prototype.computeHorizonCullingPoint=function(e,t,n){return kle(this._ellipsoid,e,t,n)};var Fle=ee.clone(ee.UNIT_SPHERE);lm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Ble(this._ellipsoid,n,Fle);return kle(o,e,t,i)};lm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return Vle(this._ellipsoid,e,t,n,i,o)};lm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Ble(this._ellipsoid,o,Fle);return Vle(s,e,t,n,i,r)};var ZXe=[];lm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=se.subsample(e,t,0,ZXe),o=ae.fromPoints(i);if(!(d.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var $Xe=new d;function Ble(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=d.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,$Xe);e=ee.fromCartesian3(i,n)}return e}function kle(e,t,n,i){l(i)||(i=new d);let o=Hle(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=Ule(e,c,o);if(u<0)return;r=Math.max(r,u)}return zle(o,r,i)}var f3=new d;function Vle(e,t,n,i,o,r){l(r)||(r=new d),i=y(i,3),o=y(o,d.ZERO);let s=Hle(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){f3.x=n[c]+o.x,f3.y=n[c+1]+o.y,f3.z=n[c+2]+o.z;let f=Ule(e,f3,s);if(f<0)return;a=Math.max(a,f)}return zle(s,a,r)}function Rj(e,t,n){let i=t,o=n,r=d.subtract(e,i,Nle),s=-d.dot(r,i);return!(o<0?s>0:s>o&&s*s/d.magnitudeSquared(r)>o)}var QXe=new d,JXe=new d;function Ule(e,t,n){let i=e.transformPositionToScaledSpace(t,QXe),o=d.magnitudeSquared(i),r=Math.sqrt(o),s=d.divideByScalar(i,r,JXe);o=Math.max(1,o),r=Math.max(1,r);let a=d.dot(s,n),c=d.magnitude(d.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-c*f)}function zle(e,t,n){if(!(t<=0||t===1/0||t!==t))return d.multiplyByScalar(e,t,n)}var Pj=new d;function Hle(e,t){return d.equals(t,d.ZERO)?t:(e.transformPositionToScaledSpace(t,Pj),d.normalize(Pj,Pj))}var oy=lm;function yr(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Bt.clone(n)),l(i)&&(i=Bt.clone(i)),l(o)&&(o=Mt.clone(o)),this._show=y(e.show,!0),this._position=d.clone(y(e.position,d.ZERO)),this._actualPosition=d.clone(this._position),this._color=z.clone(y(e.color,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=y(e.splitDirection,Gr.NONE)}var Gle=yr.SHOW_INDEX=0,qle=yr.POSITION_INDEX=1,eKe=yr.COLOR_INDEX=2,tKe=yr.OUTLINE_COLOR_INDEX=3,nKe=yr.OUTLINE_WIDTH_INDEX=4,iKe=yr.PIXEL_SIZE_INDEX=5,oKe=yr.SCALE_BY_DISTANCE_INDEX=6,rKe=yr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,sKe=yr.DISTANCE_DISPLAY_CONDITION_INDEX=8,aKe=yr.DISABLE_DEPTH_DISTANCE_INDEX=9,cKe=yr.SPLIT_DIRECTION_INDEX=10;yr.NUMBER_OF_PROPERTIES=11;function fu(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(yr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,fu(this,Gle))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),fu(this,qle))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),fu(this,oKe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),fu(this,rKe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,fu(this,iKe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),fu(this,eKe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),fu(this,tKe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,fu(this,nKe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Mt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),fu(this,sKe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,fu(this,aKe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,fu(this,Gle))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,fu(this,cKe))}}});yr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};yr.prototype._getActualPosition=function(){return this._actualPosition};yr.prototype._setActualPosition=function(e){d.clone(e,this._actualPosition),fu(this,qle)};var Wle=new oe;yr._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(F.multiplyByPoint(n,e,Wle),zi.computeActualEllipsoidPosition(t,Wle))};var jle=new oe;yr._computeScreenSpacePosition=function(e,t,n,i){let o=F.multiplyByVector(e,oe.fromElements(t.x,t.y,t.z,1,jle),jle);return zi.worldToWindowCoordinates(n,o,i)};yr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,o=yr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};yr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new qe),n.x=r,n.y=s,n.width=a,n.height=c,n};yr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&d.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};yr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var zs=yr;var kx=`in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerPercent; +in float v_pixelDistance; +in vec4 v_pickColor; +in float v_splitDirection; - vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); +void main() +{ + if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; + if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; - czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); + // The distance in UV space from this fragment to the center of the point, at most 0.5. + float distanceToCenter = length(gl_PointCoord - vec2(0.5)); + // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. + float maxDistance = max(0.0, 0.5 - v_pixelDistance); + float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); + float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); - if (czm_isEmpty(intersection)) + vec4 color = mix(v_outlineColor, v_color, innerAlpha); + color.a *= wholeAlpha; + +// Fully transparent parts of the billboard are not pickable. +#if !defined(OPAQUE) && !defined(TRANSLUCENT) + if (color.a < 0.005) // matches 0/255 and 1/255 { discard; } - - // If the viewer is outside, compute outsideFaceColor, with normals facing outward. - vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); - - // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. - vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); - - out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); - out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); - -#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) - t = (intersection.start != 0.0) ? intersection.start : intersection.stop; - vec3 positionEC = czm_pointAlongRay(ray, t); - vec4 positionCC = czm_projection * vec4(positionEC, 1.0); -#ifdef LOG_DEPTH - czm_writeLogDepth(1.0 + positionCC.w); #else - float z = positionCC.z / positionCC.w; - - float n = czm_depthRange.near; - float f = czm_depthRange.far; - - gl_FragDepth = (z * (f - n) + f + n) * 0.5; +// The billboard is rendered twice. The opaque pass discards translucent fragments +// and the translucent pass discards opaque fragments. +#ifdef OPAQUE + if (color.a < 0.995) // matches < 254/255 + { + discard; + } +#else + if (color.a >= 0.995) // matches 254/255 and 255/255 + { + discard; + } #endif #endif + + out_FragColor = czm_gammaCorrect(color); + czm_writeLogDepth(); } -`;var ev=`in vec3 position; +`;var d3=`uniform float u_maxTotalPointSize; -uniform vec3 u_radii; +in vec4 positionHighAndSize; +in vec4 positionLowAndOutline; +in vec4 compressedAttribute0; // color, outlineColor, pick color +in vec4 compressedAttribute1; // show, translucency by distance, some free space +in vec4 scaleByDistance; // near, nearScale, far, farScale +in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection -out vec3 v_positionEC; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerPercent; +out float v_pixelDistance; +out vec4 v_pickColor; +out float v_splitDirection; + +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; void main() { - // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. - // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, - // but doing it here allows us to change the radii without rewriting the vertex data, and - // allows all ellipsoids to reuse the same vertex data. - vec4 p = vec4(u_radii * position, 1.0); + // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates - gl_Position = czm_modelViewProjection * p; // position in clip coordinates + // unpack attributes + vec3 positionHigh = positionHighAndSize.xyz; + vec3 positionLow = positionLowAndOutline.xyz; + float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; + float totalSize = positionHighAndSize.w + outlineWidthBothSides; + float outlinePercent = outlineWidthBothSides / totalSize; + // Scale in response to browser-zoom. + totalSize *= czm_pixelRatio; - // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums - // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the - // ellipsoid (does not write depth) that was rendered in the farther frustum. - // - // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates - // artifacts since some fragments can be alpha blended twice. This is solved by only rendering - // the ellipsoid in the closest frustum to the viewer. - gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); + float temp = compressedAttribute1.x * SHIFT_RIGHT8; + float show = floor(temp); +#ifdef EYE_DISTANCE_TRANSLUCENCY + vec4 translucencyByDistance; + translucencyByDistance.x = compressedAttribute1.z; + translucencyByDistance.z = compressedAttribute1.w; + + translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; + + temp = compressedAttribute1.y * SHIFT_RIGHT8; + translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +#endif + + /////////////////////////////////////////////////////////////////////////// + + vec4 color; + vec4 outlineColor; + vec4 pickColor; + + // compressedAttribute0.z => pickColor.rgb + + temp = compressedAttribute0.z * SHIFT_RIGHT8; + pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor.r = floor(temp); + + // compressedAttribute0.x => color.rgb + + temp = compressedAttribute0.x * SHIFT_RIGHT8; + color.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + color.g = (temp - floor(temp)) * SHIFT_LEFT8; + color.r = floor(temp); + + // compressedAttribute0.y => outlineColor.rgb + + temp = compressedAttribute0.y * SHIFT_RIGHT8; + outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor.r = floor(temp); + + // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a + + temp = compressedAttribute0.w * SHIFT_RIGHT8; + pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + pickColor = pickColor / 255.0; + + temp = floor(temp) * SHIFT_RIGHT8; + outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; + outlineColor /= 255.0; + color.a = floor(temp); + color /= 255.0; + + /////////////////////////////////////////////////////////////////////////// + + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + + /////////////////////////////////////////////////////////////////////////// + +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) + float lengthSq; + if (czm_sceneMode == czm_sceneMode2D) + { + // 2D camera distance is a special case + // treat all billboards as flattened to the z=0.0 plane + lengthSq = czm_eyeHeight2D.y; + } + else + { + lengthSq = dot(positionEC.xyz, positionEC.xyz); + } +#endif + +#ifdef EYE_DISTANCE_SCALING + totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); +#endif + if (totalSize > 0.0) { + // Add padding for anti-aliasing on both sides. + totalSize += 3.0; + } + + // Clamp to max point size. + totalSize = min(totalSize, u_maxTotalPointSize); + // If size is too small, push vertex behind near plane for clipping. + // Note that context.minimumAliasedPointSize "will be at most 1.0". + if (totalSize < 1.0) + { + positionEC.xyz = vec3(0.0); + totalSize = 1.0; + } + + float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY + translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); + // push vertex behind near plane for clipping + if (translucency < 0.004) + { + positionEC.xyz = vec3(0.0); + } +#endif + +#ifdef DISTANCE_DISPLAY_CONDITION + float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; + float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; + if (lengthSq < nearSq || lengthSq > farSq) { + // push vertex behind camera to force it to be clipped + positionEC.xyz = vec3(0.0, 0.0, 1.0); + } +#endif + + gl_Position = czm_projection * positionEC; czm_vertexLogDepth(); -} -`;/** - * @license - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */var oL=`/** - * @license - * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of NVIDIA CORPORATION nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples -// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h - -// Steps used to integrate into Cesium: -// * The following defines are set: -// #define FXAA_PC 1 -// #define FXAA_WEBGL_1 1 -// #define FXAA_GREEN_AS_LUMA 1 -// #define FXAA_EARLY_EXIT 1 -// #define FXAA_GLSL_120 1 -// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. -// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace -// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. -// * There are no implicit conversions from ivec* to vec* so replace: -// #define FxaaInt2 ivec2 -// with -// #define FxaaInt2 vec2 -// * The texture2DLod function is only available in vertex shaders so replace: -// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) -// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) -// with -// #define FxaaTexTop(t, p) texture(t, p) -// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) -// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. -// * The following parameters to FxaaPixelShader are unused and can be removed: -// fxaaConsolePosPos -// fxaaConsoleRcpFrameOpt -// fxaaConsoleRcpFrameOpt2 -// fxaaConsole360RcpFrameOpt2 -// fxaaConsoleEdgeSharpness -// fxaaConsoleEdgeThreshold -// fxaaConsoleEdgeThresholdMi -// fxaaConsole360ConstDir - -// -// Choose the quality preset. -// This needs to be compiled into the shader as it effects code. -// Best option to include multiple presets is to -// in each shader define the preset, then include this file. -// -// OPTIONS -// ----------------------------------------------------------------------- -// 10 to 15 - default medium dither (10=fastest, 15=highest quality) -// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) -// 39 - no dither, very expensive -// -// NOTES -// ----------------------------------------------------------------------- -// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) -// 13 = about same speed as FXAA 3.9 and better than 12 -// 23 = closest to FXAA 3.9 visually and performance wise -// _ = the lowest digit is directly related to performance -// _ = the highest digit is directly related to style -// -//#define FXAA_QUALITY_PRESET 12 - - -#if (FXAA_QUALITY_PRESET == 10) - #define FXAA_QUALITY_PS 3 - #define FXAA_QUALITY_P0 1.5 - #define FXAA_QUALITY_P1 3.0 - #define FXAA_QUALITY_P2 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 11) - #define FXAA_QUALITY_PS 4 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 3.0 - #define FXAA_QUALITY_P3 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 12) - #define FXAA_QUALITY_PS 5 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 4.0 - #define FXAA_QUALITY_P4 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 13) - #define FXAA_QUALITY_PS 6 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 4.0 - #define FXAA_QUALITY_P5 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 14) - #define FXAA_QUALITY_PS 7 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 4.0 - #define FXAA_QUALITY_P6 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 15) - #define FXAA_QUALITY_PS 8 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 4.0 - #define FXAA_QUALITY_P7 12.0 -#endif -#if (FXAA_QUALITY_PRESET == 20) - #define FXAA_QUALITY_PS 3 - #define FXAA_QUALITY_P0 1.5 - #define FXAA_QUALITY_P1 2.0 - #define FXAA_QUALITY_P2 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 21) - #define FXAA_QUALITY_PS 4 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 22) - #define FXAA_QUALITY_PS 5 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 23) - #define FXAA_QUALITY_PS 6 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 24) - #define FXAA_QUALITY_PS 7 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 3.0 - #define FXAA_QUALITY_P6 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 25) - #define FXAA_QUALITY_PS 8 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 4.0 - #define FXAA_QUALITY_P7 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 26) - #define FXAA_QUALITY_PS 9 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 4.0 - #define FXAA_QUALITY_P8 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 27) - #define FXAA_QUALITY_PS 10 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 4.0 - #define FXAA_QUALITY_P9 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 28) - #define FXAA_QUALITY_PS 11 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 4.0 - #define FXAA_QUALITY_P10 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 29) - #define FXAA_QUALITY_PS 12 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.5 - #define FXAA_QUALITY_P2 2.0 - #define FXAA_QUALITY_P3 2.0 - #define FXAA_QUALITY_P4 2.0 - #define FXAA_QUALITY_P5 2.0 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 2.0 - #define FXAA_QUALITY_P10 4.0 - #define FXAA_QUALITY_P11 8.0 -#endif -#if (FXAA_QUALITY_PRESET == 39) - #define FXAA_QUALITY_PS 12 - #define FXAA_QUALITY_P0 1.0 - #define FXAA_QUALITY_P1 1.0 - #define FXAA_QUALITY_P2 1.0 - #define FXAA_QUALITY_P3 1.0 - #define FXAA_QUALITY_P4 1.0 - #define FXAA_QUALITY_P5 1.5 - #define FXAA_QUALITY_P6 2.0 - #define FXAA_QUALITY_P7 2.0 - #define FXAA_QUALITY_P8 2.0 - #define FXAA_QUALITY_P9 2.0 - #define FXAA_QUALITY_P10 4.0 - #define FXAA_QUALITY_P11 8.0 -#endif - -#define FxaaBool bool -#define FxaaFloat float -#define FxaaFloat2 vec2 -#define FxaaFloat3 vec3 -#define FxaaFloat4 vec4 -#define FxaaHalf float -#define FxaaHalf2 vec2 -#define FxaaHalf3 vec3 -#define FxaaHalf4 vec4 -#define FxaaInt2 vec2 -#define FxaaTex sampler2D - -#define FxaaSat(x) clamp(x, 0.0, 1.0) -#define FxaaTexTop(t, p) texture(t, p) -#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) - -FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } - -FxaaFloat4 FxaaPixelShader( - // - // Use noperspective interpolation here (turn off perspective interpolation). - // {xy} = center of pixel - FxaaFloat2 pos, - // - // Input color texture. - // {rgb_} = color in linear or perceptual color space - // if (FXAA_GREEN_AS_LUMA == 0) - // {___a} = luma in perceptual color space (not linear) - FxaaTex tex, - // - // Only used on FXAA Quality. - // This must be from a constant/uniform. - // {x_} = 1.0/screenWidthInPixels - // {_y} = 1.0/screenHeightInPixels - FxaaFloat2 fxaaQualityRcpFrame, - // - // Only used on FXAA Quality. - // This used to be the FXAA_QUALITY_SUBPIX define. - // It is here now to allow easier tuning. - // Choose the amount of sub-pixel aliasing removal. - // This can effect sharpness. - // 1.00 - upper limit (softer) - // 0.75 - default amount of filtering - // 0.50 - lower limit (sharper, less sub-pixel aliasing removal) - // 0.25 - almost off - // 0.00 - completely off - FxaaFloat fxaaQualitySubpix, - // - // Only used on FXAA Quality. - // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define. - // It is here now to allow easier tuning. - // The minimum amount of local contrast required to apply algorithm. - // 0.333 - too little (faster) - // 0.250 - low quality - // 0.166 - default - // 0.125 - high quality - // 0.063 - overkill (slower) - FxaaFloat fxaaQualityEdgeThreshold, - // - // Only used on FXAA Quality. - // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define. - // It is here now to allow easier tuning. - // Trims the algorithm from processing darks. - // 0.0833 - upper limit (default, the start of visible unfiltered edges) - // 0.0625 - high quality (faster) - // 0.0312 - visible limit (slower) - // Special notes when using FXAA_GREEN_AS_LUMA, - // Likely want to set this to zero. - // As colors that are mostly not-green - // will appear very dark in the green channel! - // Tune by looking at mostly non-green content, - // then start at zero and increase until aliasing is a problem. - FxaaFloat fxaaQualityEdgeThresholdMin -) { -/*--------------------------------------------------------------------------*/ - FxaaFloat2 posM; - posM.x = pos.x; - posM.y = pos.y; - FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); - #define lumaM rgbyM.y - FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); -/*--------------------------------------------------------------------------*/ - FxaaFloat maxSM = max(lumaS, lumaM); - FxaaFloat minSM = min(lumaS, lumaM); - FxaaFloat maxESM = max(lumaE, maxSM); - FxaaFloat minESM = min(lumaE, minSM); - FxaaFloat maxWN = max(lumaN, lumaW); - FxaaFloat minWN = min(lumaN, lumaW); - FxaaFloat rangeMax = max(maxWN, maxESM); - FxaaFloat rangeMin = min(minWN, minESM); - FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; - FxaaFloat range = rangeMax - rangeMin; - FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); - FxaaBool earlyExit = range < rangeMaxClamped; -/*--------------------------------------------------------------------------*/ - if(earlyExit) - return rgbyM; -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); - FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNS = lumaN + lumaS; - FxaaFloat lumaWE = lumaW + lumaE; - FxaaFloat subpixRcpRange = 1.0/range; - FxaaFloat subpixNSWE = lumaNS + lumaWE; - FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; - FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNESE = lumaNE + lumaSE; - FxaaFloat lumaNWNE = lumaNW + lumaNE; - FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; - FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; -/*--------------------------------------------------------------------------*/ - FxaaFloat lumaNWSW = lumaNW + lumaSW; - FxaaFloat lumaSWSE = lumaSW + lumaSE; - FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); - FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); - FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; - FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; - FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; - FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; -/*--------------------------------------------------------------------------*/ - FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; - FxaaFloat lengthSign = fxaaQualityRcpFrame.x; - FxaaBool horzSpan = edgeHorz >= edgeVert; - FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; -/*--------------------------------------------------------------------------*/ - if(!horzSpan) lumaN = lumaW; - if(!horzSpan) lumaS = lumaE; - if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; - FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; -/*--------------------------------------------------------------------------*/ - FxaaFloat gradientN = lumaN - lumaM; - FxaaFloat gradientS = lumaS - lumaM; - FxaaFloat lumaNN = lumaN + lumaM; - FxaaFloat lumaSS = lumaS + lumaM; - FxaaBool pairN = abs(gradientN) >= abs(gradientS); - FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); - if(pairN) lengthSign = -lengthSign; - FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); -/*--------------------------------------------------------------------------*/ - FxaaFloat2 posB; - posB.x = posM.x; - posB.y = posM.y; - FxaaFloat2 offNP; - offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; - offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; - if(!horzSpan) posB.x += lengthSign * 0.5; - if( horzSpan) posB.y += lengthSign * 0.5; -/*--------------------------------------------------------------------------*/ - FxaaFloat2 posN; - posN.x = posB.x - offNP.x * FXAA_QUALITY_P0; - posN.y = posB.y - offNP.y * FXAA_QUALITY_P0; - FxaaFloat2 posP; - posP.x = posB.x + offNP.x * FXAA_QUALITY_P0; - posP.y = posB.y + offNP.y * FXAA_QUALITY_P0; - FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; - FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); - FxaaFloat subpixE = subpixC * subpixC; - FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); -/*--------------------------------------------------------------------------*/ - if(!pairN) lumaNN = lumaSS; - FxaaFloat gradientScaled = gradient * 1.0/4.0; - FxaaFloat lumaMM = lumaM - lumaNN * 0.5; - FxaaFloat subpixF = subpixD * subpixE; - FxaaBool lumaMLTZero = lumaMM < 0.0; -/*--------------------------------------------------------------------------*/ - lumaEndN -= lumaNN * 0.5; - lumaEndP -= lumaNN * 0.5; - FxaaBool doneN = abs(lumaEndN) >= gradientScaled; - FxaaBool doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1; - FxaaBool doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1; -/*--------------------------------------------------------------------------*/ - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 3) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 4) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 5) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 6) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 7) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 8) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 9) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 10) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 11) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; -/*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY_PS > 12) - if(doneNP) { - if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); - if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); - if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; - if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; - doneN = abs(lumaEndN) >= gradientScaled; - doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; - doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ +#ifdef DISABLE_DEPTH_DISTANCE + float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; + if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) + { + disableDepthTestDistance = czm_minimumDisableDepthTestDistance; } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ - } - #endif -/*--------------------------------------------------------------------------*/ + + if (disableDepthTestDistance != 0.0) + { + // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. + float zclip = gl_Position.z / gl_Position.w; + bool clipped = (zclip < -1.0 || zclip > 1.0); + if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) + { + // Position z on the near plane. + gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH + czm_vertexLogDepth(vec4(czm_currentFrustum.x)); +#endif } - #endif -/*--------------------------------------------------------------------------*/ } -/*--------------------------------------------------------------------------*/ - FxaaFloat dstN = posM.x - posN.x; - FxaaFloat dstP = posP.x - posM.x; - if(!horzSpan) dstN = posM.y - posN.y; - if(!horzSpan) dstP = posP.y - posM.y; -/*--------------------------------------------------------------------------*/ - FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; - FxaaFloat spanLength = (dstP + dstN); - FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; - FxaaFloat spanLengthRcp = 1.0/spanLength; -/*--------------------------------------------------------------------------*/ - FxaaBool directionN = dstN < dstP; - FxaaFloat dst = min(dstN, dstP); - FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; - FxaaFloat subpixG = subpixF * subpixF; - FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; - FxaaFloat subpixH = subpixG * fxaaQualitySubpix; -/*--------------------------------------------------------------------------*/ - FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; - FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); - if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; - if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; - return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); +#endif + + v_color = color; + v_color.a *= translucency * show; + v_outlineColor = outlineColor; + v_outlineColor.a *= translucency * show; + + v_innerPercent = 1.0 - outlinePercent; + v_pixelDistance = 2.0 / totalSize; + gl_PointSize = totalSize * show; + gl_Position *= show; + + v_pickColor = pickColor; + v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; } -`;var rL=`uniform vec4 u_initialColor; +`;var lKe=zs.SHOW_INDEX,Lj=zs.POSITION_INDEX,Yle=zs.COLOR_INDEX,uKe=zs.OUTLINE_COLOR_INDEX,fKe=zs.OUTLINE_WIDTH_INDEX,dKe=zs.PIXEL_SIZE_INDEX,Xle=zs.SCALE_BY_DISTANCE_INDEX,Kle=zs.TRANSLUCENCY_BY_DISTANCE_INDEX,Zle=zs.DISTANCE_DISPLAY_CONDITION_INDEX,hKe=zs.DISABLE_DEPTH_DISTANCE_INDEX,mKe=zs.SPLIT_DIRECTION_INDEX,Nj=zs.NUMBER_OF_PROPERTIES,oc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Mf(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(Nj),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Io.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Mf.prototype,{length:{get:function(){return Fj(this),this._pointPrimitives.length}}});function $le(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Mf.prototype.add=function(e){let t=new zs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Mf.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Mf.prototype.removeAll=function(){$le(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function Fj(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}Mf.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Mf.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Mf.prototype.get=function(e){return Fj(this),this._pointPrimitives[e]};Mf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Nj;++i){let o=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function pKe(e,t,n){return new Wg(e,[{index:oc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Lj]},{index:oc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Lj]},{index:oc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Yle]},{index:oc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Kle]},{index:oc.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Xle]},{index:oc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Zle]}],t)}var Oj=new Hn;function Qle(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Hn.fromCartesian(r,Oj);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[oc.positionHighAndSize],u=Oj.high;c(o,u.x,u.y,u.z,s);let f=n[oc.positionLowAndOutline],h=Oj.low;f(o,h.x,h.y,h.z,a)}var h3=65536,mD=256;function Jle(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=z.floatToByte(r.red),u=z.floatToByte(r.green),f=z.floatToByte(r.blue),h=c*h3+u*mD+f;c=z.floatToByte(a.red),u=z.floatToByte(a.green),f=z.floatToByte(a.blue);let p=c*h3+u*mD+f;c=z.floatToByte(s.red),u=z.floatToByte(s.green),f=z.floatToByte(s.blue);let _=c*h3+u*mD+f,m=z.floatToByte(r.alpha)*h3+z.floatToByte(a.alpha)*mD+z.floatToByte(s.alpha),x=n[oc.compressedAttribute0];x(o,h,p,_,m)}function eue(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let h=(f?1:0)*mD+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,_=n[oc.compressedAttribute1];_(o,h,p,r,a)}function tue(e,t,n,i){let o=i._index,r=n[oc.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,u)}function nue(e,t,n,i){let o=i._index,r=n[oc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,h=i.splitDirection;l(h)&&(f=h),r(o,s,a,u,f)}function gKe(e,t,n,i){Qle(e,t,n,i),Jle(e,t,n,i),eue(e,t,n,i),tue(e,t,n,i),nue(e,t,n,i)}function Mj(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,h=zs._computeActualPosition(f,i,o);l(h)&&(u._setActualPosition(h),r?a.push(h):ae.expand(s,h,s))}r&&ae.fromPoints(a,s)}function _Ke(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&Mj(e,i,i.length,t,r,!0)):n===ne.MORPHING?Mj(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&Mj(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function yKe(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var xKe=[];Mf.prototype.update=function(e){if(Fj(this),!this.show)return;this._maxTotalPointSize=Ft.maximumAliasedPointSize,_Ke(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<Nj;++v)r[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=pKe(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let D=this._pointPrimitives[v];D._dirty=!1,gKe(this,c,a,D)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let v=xKe;v.length=0,(r[Lj]||r[fKe]||r[dKe])&&v.push(Qle),(r[Yle]||r[uKe])&&v.push(Jle),(r[lKe]||r[Kle])&&v.push(eue),r[Xle]&&v.push(tue),(r[Zle]||r[hKe]||r[mKe])&&v.push(nue);let D=v.length;if(a=this._vaf.writers,o/n>.1){for(let O=0;O<o;++O){let R=i[O];R._dirty=!1;for(let M=0;M<D;++M)v[M](this,c,a,R)}this._vaf.commit()}else{for(let O=0;O<o;++O){let R=i[O];R._dirty=!1;for(let M=0;M<D;++M)v[M](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=F.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,h=ae.clone(this._baseVolumeWC,this._boundingVolume)):h=ae.clone(this._baseVolume2D,this._boundingVolume),yKe(this,e,h);let _=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,_&&(this._blendOption===Io.OPAQUE||this._blendOption===Io.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Io.TRANSLUCENT||this._blendOption===Io.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:ln.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,x;(_||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Ue({sources:[d3]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Io.OPAQUE_AND_TRANSLUCENT&&(x=new Ue({defines:["OPAQUE"],sources:[kx]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:oc}),x=new Ue({defines:["TRANSLUCENT"],sources:[kx]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:oc})),this._blendOption===Io.OPAQUE&&(x=new Ue({sources:[kx]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:oc})),this._blendOption===Io.TRANSLUCENT&&(x=new Ue({sources:[kx]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:oc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,T,C,A,S=e.commandList;if(u.render||f){let v=this._colorCommands,D=this._blendOption===Io.OPAQUE,O=this._blendOption===Io.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,T=b.length,v.length=T;let R=O?T*2:T;for(A=0;A<R;++A){let M=D||O&&A%2===0;C=v[A],l(C)||(C=v[A]=new $e),C.primitiveType=Me.POINTS,C.pass=M||!O?we.OPAQUE:we.TRANSLUCENT,C.owner=this;let L=O?Math.floor(A/2):A;C.boundingVolume=h,C.modelMatrix=p,C.shaderProgram=M?this._sp:this._spTranslucent,C.uniformMap=this._uniforms,C.vertexArray=b[L].va,C.renderState=M?this._rsOpaque:this._rsTranslucent,C.debugShowBoundingVolume=this.debugShowBoundingVolume,C.pickId="v_pickColor",S.push(C)}}};Mf.prototype.isDestroyed=function(){return!1};Mf.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),$le(this._pointPrimitives),ue(this)};var pD=Mf;var iue=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Bj=1,gD=8,yD=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==Bj)throw new Error(`Got v${o} data when expected v${Bj}.`);let r=iue[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=iue.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,gD,t),this.coords=new this.ArrayType(this.data,gD+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(gD+s+a+c),this.ids=new this.IndexArrayType(this.data,gD,t),this.coords=new this.ArrayType(this.data,gD+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Bj<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Vj(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,h=c.pop()||0,p=c.pop()||0;if(h-p<=a){for(let b=p;b<=h;b++){let T=s[2*b],C=s[2*b+1];T>=t&&T<=i&&C>=n&&C<=o&&u.push(r[b])}continue}let _=p+h>>1,m=s[2*_],x=s[2*_+1];m>=t&&m<=i&&x>=n&&x<=o&&u.push(r[_]),(f===0?t<=m:n<=x)&&(c.push(p),c.push(_-1),c.push(1-f)),(f===0?i>=m:o>=x)&&(c.push(_+1),c.push(h),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let b=p;b<=h;b++)oue(r[2*b],r[2*b+1],t,n)<=u&&c.push(o[b]);continue}let _=p+h>>1,m=r[2*_],x=r[2*_+1];oue(m,x,t,n)<=u&&c.push(o[_]),(f===0?t-i<=m:n-i<=x)&&(a.push(p),a.push(_-1),a.push(1-f)),(f===0?t+i>=m:n+i>=x)&&(a.push(_+1),a.push(h),a.push(1-f))}return c}};function Vj(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;rue(e,t,s,i,o,r),Vj(e,t,n,i,s-1,1-r),Vj(e,t,n,s+1,o,1-r)}function rue(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),_=.5*Math.sqrt(h*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+_)),x=Math.min(o,Math.floor(n+(u-f)*p/u+_));rue(e,t,n,m,x,r)}let s=t[2*n+r],a=i,c=o;for(_D(e,t,i,n),t[2*o+r]>s&&_D(e,t,i,o);a<c;){for(_D(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?_D(e,t,i,c):(c++,_D(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function _D(e,t,n,i){kj(e,n,i),kj(t,2*n,2*i),kj(t,2*n+1,2*i+1)}function kj(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function oue(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function kd(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new pe,this.show=y(e.show,!0)}function sue(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var bKe=new qe;function aue(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=wx.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=lo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=zs.getScreenSpaceBoundingBox(e,t,o)),sue(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&lue(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=wx.getScreenSpaceBoundingBox(s,t,bKe);sue(a,n),o=qe.union(o,a,o)}return o}function TKe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&lue(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function cue(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function lue(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function Uj(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===ne.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),u=o._clusterBillboards&&l(a.id._billboard),f=o._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let h=a.computeScreenSpacePosition(n);l(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}var CKe=new qe,AKe=new qe,EKe=new qe;function SKe(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new Fp({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Cf({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new pD;let u=e._pixelRange,f=e._minimumClusterSize,h=e._previousClusters,p=[],_=e._previousHeight,m=n.camera.positionCartographic.height,x=n.ellipsoid,b=n.camera.positionWC,T=new oy(x,b),C=[];e._clusterLabels&&Uj(i,C,n,T,e),e._clusterBillboards&&Uj(o,C,n,T,e),e._clusterPoints&&Uj(r,C,n,T,e);let A,S,v,D,O,R,M,L,g,E,w,I;if(C.length>0){let N=new yD(C.length,64,Uint32Array);for(let B=0;B<C.length;++B)N.add(C[B].coord.x,C[B].coord.y);if(N.finish(),m<_)for(v=h.length,A=0;A<v;++A){let B=h[A];if(!T.isPointVisible(B.position))continue;let H=lo._computeScreenSpacePosition(F.IDENTITY,B.position,d.ZERO,U.ZERO,n);if(!l(H))continue;let V=1-m/_,G=B.width=B.width*V,k=B.height=B.height*V;G=Math.max(G,B.minimumWidth),k=Math.max(k,B.minimumHeight);let W=H.x-G*.5,Y=H.y-k*.5,J=H.x+G,j=H.y+k;for(O=N.range(W,Y,J,j),R=O.length,E=0,g=[],S=0;S<R;++S)M=O[S],L=C[M],L.clustered||(++E,w=L.collection,I=L.index,g.push(w.get(I).id));if(E>=f)for(cue(B.position,E,g,e),p.push(B),S=0;S<R;++S)C[O[S]].clustered=!0}for(v=C.length,A=0;A<v;++A){let B=C[A];if(B.clustered)continue;B.clustered=!0,w=B.collection,I=B.index;let H=w.get(I);D=aue(H,B.coord,u,e,CKe);let V=qe.clone(D,AKe);O=N.range(D.x,D.y,D.x+D.width,D.y+D.height),R=O.length;let G=d.clone(H.position);for(E=1,g=[H.id],S=0;S<R;++S)if(M=O[S],L=C[M],!L.clustered){let k=L.collection.get(L.index),W=aue(k,L.coord,u,e,EKe);d.add(k.position,G,G),qe.union(V,W,V),++E,g.push(k.id)}if(E>=f){let k=d.multiplyByScalar(G,1/E,G);for(cue(k,E,g,e),p.push({position:k,width:V.width,height:V.height,minimumWidth:D.width,minimumHeight:D.height}),S=0;S<R;++S)C[O[S]].clustered=!0}else TKe(H,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}kd.prototype._initialize=function(e){this._scene=e;let t=SKe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(kd.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function Hj(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function Gj(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}kd.prototype.getLabel=Hj("_labelCollection",Fp,"_unusedLabelIndices","labelIndex");kd.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,Gj(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};kd.prototype.getBillboard=Hj("_billboardCollection",Cf,"_unusedBillboardIndices","billboardIndex");kd.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,Gj(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};kd.prototype.getPoint=Hj("_pointCollection",pD,"_unusedPointIndices","pointIndex");kd.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,Gj(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function zj(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function vKe(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,zj(e._labelCollection),zj(e._billboardCollection),zj(e._pointCollection))}kd.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,vKe(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};kd.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Lf=kd;function Wj(e){this._name=e,this._clock=void 0,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new aa(this),this._entityCluster=new Lf}Object.defineProperties(Wj.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Xr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});Wj.prototype.update=function(e){return!0};var m3=Wj;var uue={};uue.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,u=new Float64Array(c*3),f,h=0,p=0,_=o?a*3:0,m=o?(a+i)*3:i*3;for(f=0;f<i;f++){let x=f/i*P.TWO_PI,b=Math.cos(x),T=Math.sin(x),C=b*n,A=T*n,S=b*t,v=T*t;u[p+_]=C,u[p+_+1]=A,u[p+_+2]=s,u[p+m]=S,u[p+m+1]=v,u[p+m+2]=r,p+=3,o&&(u[h++]=C,u[h++]=A,u[h++]=s,u[h++]=S,u[h++]=v,u[h++]=r)}return u};var yA=uue;var jj=new U,wKe=new d,DKe=new d,IKe=new d,PKe=new d;function Qp(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Ie.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Qp.packedLength=Ie.packedLength+5;Qp.pack=function(e,t,n){return n=y(n,0),Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var fue=new Ie,xA={vertexFormat:fue,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Qp.unpack=function(e,t,n){t=y(t,0);let i=Ie.unpack(e,t,fue);t+=Ie.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(xA.length=o,xA.topRadius=r,xA.bottomRadius=s,xA.slices=a,xA.offsetAttribute=c===-1?void 0:c,new Qp(xA))};Qp.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,u=yA.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,h=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,_=o.bitangent?new Float32Array(c*3):void 0,m,x=o.normal||o.tangent||o.bitangent;if(x){let O=o.tangent||o.bitangent,R=0,M=0,L=0,g=Math.atan2(i-n,t),E=wKe;E.z=Math.sin(g);let w=Math.cos(g),I=IKe,N=DKe;for(m=0;m<r;m++){let B=m/r*P.TWO_PI,H=w*Math.cos(B),V=w*Math.sin(B);x&&(E.x=H,E.y=V,O&&(I=d.normalize(d.cross(d.UNIT_Z,E,I),I)),o.normal&&(h[R++]=E.x,h[R++]=E.y,h[R++]=E.z,h[R++]=E.x,h[R++]=E.y,h[R++]=E.z),o.tangent&&(p[M++]=I.x,p[M++]=I.y,p[M++]=I.z,p[M++]=I.x,p[M++]=I.y,p[M++]=I.z),o.bitangent&&(N=d.normalize(d.cross(E,I,N),N),_[L++]=N.x,_[L++]=N.y,_[L++]=N.z,_[L++]=N.x,_[L++]=N.y,_[L++]=N.z))}for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=-1),o.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),o.bitangent&&(_[L++]=0,_[L++]=-1,_[L++]=0);for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=1),o.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),o.bitangent&&(_[L++]=0,_[L++]=1,_[L++]=0)}let b=12*r-12,T=Ne.createTypedArray(c,b),C=0,A=0;for(m=0;m<r-1;m++)T[C++]=A,T[C++]=A+2,T[C++]=A+3,T[C++]=A,T[C++]=A+3,T[C++]=A+1,A+=2;for(T[C++]=s-2,T[C++]=0,T[C++]=1,T[C++]=s-2,T[C++]=1,T[C++]=s-1,m=1;m<r-1;m++)T[C++]=s+m+1,T[C++]=s+m,T[C++]=s;for(m=1;m<r-1;m++)T[C++]=a,T[C++]=a+m,T[C++]=a+m+1;let S=0;if(o.st){let O=Math.max(n,i);for(m=0;m<c;m++){let R=d.fromArray(u,m*3,PKe);f[S++]=(R.x+O)/(2*O),f[S++]=(R.y+O)/(2*O)}}let v=new dn;o.position&&(v.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(v.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(v.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(v.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(v.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),jj.x=t*.5,jj.y=Math.max(i,n);let D=new ae(d.ZERO,U.magnitude(jj));if(l(e._offsetAttribute)){t=u.length;let O=e._offsetAttribute===rn.NONE?0:1,R=new Uint8Array(t/3).fill(O);v.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new st({attributes:v,indices:T,primitiveType:Me.TRIANGLES,boundingSphere:D,offsetAttribute:e._offsetAttribute})};var qj;Qp.getUnitCylinder=function(){return l(qj)||(qj=Qp.createGeometry(new Qp({topRadius:1,bottomRadius:1,length:1,vertexFormat:Ie.POSITION_ONLY}))),qj};var p3=Qp;var Yj=new U;function bA(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.slices,128),r=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}bA.packedLength=6;bA.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Vx={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};bA.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(Vx.length=i,Vx.topRadius=o,Vx.bottomRadius=r,Vx.slices=s,Vx.numberOfVerticalLines=a,Vx.offsetAttribute=c===-1?void 0:c,new bA(Vx))};bA.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=yA.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let x=Math.min(r,o);u=Math.round(o/x),c+=x}let f=Ne.createTypedArray(s,c*2),h=0,p;for(p=0;p<o-1;p++)f[h++]=p,f[h++]=p+1,f[h++]=p+o,f[h++]=p+1+o;if(f[h++]=o-1,f[h++]=0,f[h++]=o+o-1,f[h++]=o,r>0)for(p=0;p<o;p+=u)f[h++]=p,f[h++]=p+o;let _=new dn;_.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:a}),Yj.x=t*.5,Yj.y=Math.max(i,n);let m=new ae(d.ZERO,U.magnitude(Yj));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===rn.NONE?0:1,b=new Uint8Array(t/3).fill(x);_.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}return new st({attributes:_,indices:f,primitiveType:Me.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var g3=bA;var due=d.ZERO,hue=new d,RKe=new d,mue=new z;function OKe(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function du(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new OKe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(du.prototype=Object.create(oi.prototype),du.prototype.constructor=du);Object.defineProperties(du.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});du.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Bn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,mue)),l(a)||(a=z.WHITE),s.color=Gt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,due,hue))),new vt({id:t,geometry:new p3(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};du.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,mue),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,due,hue))),new vt({id:t,geometry:new g3(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};du.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};du.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||oi.prototype._isHidden.call(this,e,t)};du.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!q.isConstant(t.slices)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)};du.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(He.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(He.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(He.MINIMUM_VALUE),i.slices=q.getValueOrUndefined(t.slices,He.MINIMUM_VALUE),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,He.MINIMUM_VALUE),i.offsetAttribute=n!==Ye.NONE?rn.ALL:void 0};du.prototype._onEntityPropertyChanged=t_;du.DynamicGeometryUpdater=TA;function TA(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(TA.prototype=Object.create(ii.prototype),TA.prototype.constructor=TA);TA.prototype._isHidden=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(e.position,n,RKe);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ii.prototype._isHidden.call(this,e,t,n)};TA.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,Ye.NONE),o=this._options;o.length=q.getValueOrUndefined(t.length,n),o.topRadius=q.getValueOrUndefined(t.topRadius,n),o.bottomRadius=q.getValueOrUndefined(t.bottomRadius,n),o.slices=q.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Ye.NONE?rn.ALL:void 0};var _3=du;var MKe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Kr=Object.freeze(MKe);var LKe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},_o=Object.freeze(LKe);var NKe={NONE:0,HOLD:1,EXTRAPOLATE:2},Nf=Object.freeze(NKe);var pue=Ur(Wl(),1);function FKe(e){let t=new pue.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var ry=FKe;var BKe=P.factorial;function Xj(e,t,n,i,o,r){let s=0,a,c,u;if(i>0){for(c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(r.push(c),s+=Xj(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var y3={type:"Hermite"};y3.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};y3.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,u,f,h=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let b=new Array(h);for(p[r]=b,s=0;s<h;s++)b[s]=[]}let _=h,m=new Array(_);for(r=0;r<_;r++)m[r]=r;let x=h-1;for(c=0;c<i;c++){for(s=0;s<_;s++)f=m[s]*i+c,p[c][0].push(n[f]);for(r=1;r<_;r++){let b=!1;for(s=0;s<_-r;s++){let T=t[m[s]],C=t[m[s+r]],A;C-T<=0?(f=m[s]*i+i*r+c,A=n[f],p[c][r].push(A/BKe(r))):(A=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(A/(C-T))),b=b||A!==0}b||(x=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=x;r++){let b=Xj(e,m,t,a,r,[]);for(c=0;c<i;c++){let T=p[c][r][0];o[c+a*i]+=T*b}}return o};var kKe=[];y3.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let T=0;T<a;T++)s[T]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let T=0;T<o+1;T++)u[f*(o+1)+T]=f;let h=u.length,p=kKe,_=VKe(p,u,t,n,i,o),m=[],x=h*(h+1)/2,b=Math.min(_,r);for(let T=0;T<=b;T++)for(f=T;f<=_;f++){m.length=0;let C=Xj(e,u,t,T,f,m),A=Math.floor(f*(1-f)/2)+h*f;for(let S=0;S<i;S++){let v=Math.floor(S*x),D=p[v+A];s[S+T*i]+=D*C}}return s};function VKe(e,t,n,i,o,r){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let h=0;h<o;h++){let p=Math.floor(h*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+h,e[p+s]=i[a];for(let _=1;_<u;_++){let m=0,x=Math.floor(_*(1-_)/2)+u*_,b=!1;for(s=0;s<u-_;s++){let T=n[t[s]],C=n[t[s+_]],A,S;if(C-T<=0)a=t[s]*o*(r+1)+o*_+h,A=i[a],S=A/P.factorial(_),e[p+x+m]=S,m++;else{let v=Math.floor((_-1)*(2-_)/2)+u*(_-1);A=e[p+v+s+1]-e[p+v+s],S=A/(C-T),e[p+x+m]=S,m++}b=b||A!==0}b&&(c=Math.max(c,_))}}return c}var x3=y3;var Kj={type:"Lagrange"};Kj.getRequiredDataPoints=function(e){return Math.max(e+1,2)};Kj.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let u=t[r]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var b3=Kj;var Zj={type:"Linear"};Zj.getRequiredDataPoints=function(e){return 2};Zj.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],u=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-c*a)/(u-c);return o};var CA=Zj;function rc(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}rc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new rc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};rc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new rc(e.clock,e.cone,e.magnitude)};rc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new rc(e.clock,e.cone,1)};rc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};rc.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};rc.prototype.equals=function(e){return rc.equals(this,e)};rc.prototype.clone=function(e){return rc.clone(this,e)};rc.prototype.equalsEpsilon=function(e,t){return rc.equalsEpsilon(this,e,t)};rc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var T3=rc;var ID=Ur(Wl(),1);var $j;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?$j=function(){return performance.now()}:$j=function(){return Date.now()};var Ai=$j;function Qj(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=Z.clone(t):l(n)?t=Z.clone(n):l(i)?t=Z.addDays(i,-1,new Z):t=Z.now(),l(n)?n=Z.clone(n):n=Z.clone(t),l(i)?i=Z.clone(i):i=Z.addDays(n,1,new Z),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,Kr.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new pe,this.onStop=new pe,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ai(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,_o.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(Qj.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Z.equals(this._currentTime,e)||(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===_o.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=Z.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});Qj.prototype.tick=function(){let e=Ai(),t=Z.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===_o.SYSTEM_CLOCK)t=Z.now(t);else{let i=this._multiplier;if(n===_o.TICK_DEPENDENT)t=Z.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=Z.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===Kr.CLAMPED)Z.lessThan(t,r)?t=Z.clone(r,t):Z.greaterThan(t,s)&&(t=Z.clone(s,t),this.onStop.raiseEvent(this));else if(o===Kr.LOOP_STOP)for(Z.lessThan(t,r)&&(t=Z.clone(r,t));Z.greaterThan(t,s);)t=Z.addSeconds(r,Z.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var um=Qj;function Ux(){this._definitionChanged=new pe,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(Ux.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:yl("startTime"),stopTime:yl("stopTime"),currentTime:yl("currentTime"),clockRange:yl("clockRange"),clockStep:yl("clockStep"),multiplier:yl("multiplier")});Ux.prototype.clone=function(e){return l(e)||(e=new Ux),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};Ux.prototype.equals=function(e){return this===e||l(e)&&Z.equals(this.startTime,e.startTime)&&Z.equals(this.stopTime,e.stopTime)&&Z.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};Ux.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};Ux.prototype.getValue=function(e){return l(e)||(e=new um),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var fm=Ux;var UKe=z.WHITE,zKe=.1,HKe=new U(8,8),GKe=new U(0,0),WKe=new U(1,1);function AA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(AA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._cellAlpha)&&q.isConstant(this._lineCount)&&q.isConstant(this._lineThickness)&&q.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});AA.prototype.getType=function(e){return"Grid"};var jKe=new Z;AA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(jKe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,UKe,t.color),t.cellAlpha=q.getValueOrDefault(this._cellAlpha,e,zKe),t.lineCount=q.getValueOrClonedDefault(this._lineCount,e,HKe,t.lineCount),t.lineThickness=q.getValueOrClonedDefault(this._lineThickness,e,WKe,t.lineThickness),t.lineOffset=q.getValueOrClonedDefault(this._lineOffset,e,GKe,t.lineOffset),t};AA.prototype.equals=function(e){return this===e||e instanceof AA&&q.equals(this._color,e._color)&&q.equals(this._cellAlpha,e._cellAlpha)&&q.equals(this._lineCount,e._lineCount)&&q.equals(this._lineThickness,e._lineThickness)&&q.equals(this._lineOffset,e._lineOffset)};var xD=AA;function EA(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(EA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});EA.prototype.getType=function(e){return"PolylineArrow"};var qKe=new Z;EA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(qKe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};EA.prototype.equals=function(e){return this===e||e instanceof EA&&q.equals(this._color,e._color)};var bD=EA;var YKe=z.WHITE,XKe=z.TRANSPARENT,KKe=16,ZKe=255;function SA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(SA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._gapColor)&&q.isConstant(this._dashLength)&&q.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});SA.prototype.getType=function(e){return"PolylineDash"};var $Ke=new Z;SA.prototype.getValue=function(e,t){return l(e)||(e=Z.now($Ke)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,YKe,t.color),t.gapColor=q.getValueOrClonedDefault(this._gapColor,e,XKe,t.gapColor),t.dashLength=q.getValueOrDefault(this._dashLength,e,KKe,t.dashLength),t.dashPattern=q.getValueOrDefault(this._dashPattern,e,ZKe,t.dashPattern),t};SA.prototype.equals=function(e){return this===e||e instanceof SA&&q.equals(this._color,e._color)&&q.equals(this._gapColor,e._gapColor)&&q.equals(this._dashLength,e._dashLength)&&q.equals(this._dashPattern,e._dashPattern)};var TD=SA;var QKe=z.WHITE,JKe=.25,eZe=1;function vA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(vA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});vA.prototype.getType=function(e){return"PolylineGlow"};var tZe=new Z;vA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(tZe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,QKe,t.color),t.glowPower=q.getValueOrDefault(this._glowPower,e,JKe,t.glowPower),t.taperPower=q.getValueOrDefault(this._taperPower,e,eZe,t.taperPower),t};vA.prototype.equals=function(e){return this===e||e instanceof vA&&q.equals(this._color,e._color)&&q.equals(this._glowPower,e._glowPower)&&q.equals(this._taperPower,e._taperPower)};var CD=vA;var nZe=z.WHITE,iZe=z.BLACK,oZe=1;function wA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(wA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._outlineColor)&&q.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});wA.prototype.getType=function(e){return"PolylineOutline"};var rZe=new Z;wA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(rZe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,nZe,t.color),t.outlineColor=q.getValueOrClonedDefault(this._outlineColor,e,iZe,t.outlineColor),t.outlineWidth=q.getValueOrDefault(this._outlineWidth,e,oZe),t};wA.prototype.equals=function(e){return this===e||e instanceof wA&&q.equals(this._color,e._color)&&q.equals(this._outlineColor,e._outlineColor)&&q.equals(this._outlineWidth,e._outlineWidth)};var zx=wA;function Jp(e,t){this._value=void 0,this._definitionChanged=new pe,this._eventHelper=new _r,this._referenceFrame=y(t,Ui.FIXED),this.setValue(e)}Object.defineProperties(Jp.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var sZe=new Z;Jp.prototype.getValue=function(e,t){return l(e)||(e=Z.now(sZe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Jp.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};Jp.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Jp.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Jp.prototype.equals=function(e){return this===e||e instanceof Jp&&this._referenceFrame===e._referenceFrame&&q.arrayEquals(this._value,e._value)};Jp.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var sy=Jp;function ay(e){this._value=void 0,this._definitionChanged=new pe,this._eventHelper=new _r,this.setValue(e)}Object.defineProperties(ay.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var aZe=new Z;ay.prototype.getValue=function(e,t){l(e)||(e=Z.now(aZe));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};ay.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,ay.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};ay.prototype.equals=function(e){return this===e||e instanceof ay&&q.arrayEquals(this._value,e._value)};ay.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var AD=ay;function Hx(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(hu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function hu(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new pe,e.collectionChanged.addEventListener(hu.prototype._onCollectionChanged,this)}Object.defineProperties(hu.prototype,{isConstant:{get:function(){return q.isConstant(Hx(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Hx(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return Hx(this)}}});hu.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new hu(e,n,i)};var cZe=new Z;hu.prototype.getValue=function(e,t){let n=Hx(this);return l(e)||(e=Z.now(cZe)),l(n)?n.getValue(e,t):void 0};hu.prototype.getValueInReferenceFrame=function(e,t,n){let i=Hx(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};hu.prototype.getType=function(e){let t=Hx(this);return l(t)?t.getType(e):void 0};hu.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};hu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};hu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(hu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=Hx(this),l(i)&&this._definitionChanged.raiseEvent(this))};var cy=hu;var lZe={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(n,e.length);let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-P.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+P.TWO_PI:o}},Vd=lZe;var gue={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function _ue(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function yue(e,t){return e instanceof Z?e:typeof e=="string"?Z.fromIso8601(e):Z.addSeconds(t,e,new Z)}var Jj=[],e7=[];function C3(e,t,n,i,o){let r=0,s,a,c,u,f,h;for(;r<i.length;){f=yue(i[r],e),c=Mo(t,f,Z.compare);let p=0,_=0;if(c<0){for(c=~c,u=c*o,a=void 0,h=t[c];r<i.length&&(f=yue(i[r],e),!(l(a)&&Z.compare(a,f)>=0||l(h)&&Z.compare(f,h)>=0));){for(Jj[p++]=f,r=r+1,s=0;s<o;s++)e7[_++]=i[r],r=r+1;a=f}p>0&&(e7.length=_,_ue(n,u,e7),Jj.length=p,_ue(t,c,Jj))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function Ff(e,t){let n=e;n===Number&&(n=gue);let i=n.packedLength,o=y(n.packedInterpolationLength,i),r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=gue);let f=u.packedLength;i+=f,o+=y(u.packedInterpolationLength,f),s[c]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=CA,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new pe,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=Nf.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Nf.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Ff.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var uZe=new Z;Ff.prototype.getValue=function(e,t){l(e)||(e=Z.now(uZe));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Mo(n,e,Z.compare);if(a<0){if(a=~a,a===0){let S=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Nf.NONE||o!==0&&Z.secondsDifference(S,e)>o)return;if(this._backwardExtrapolationType===Nf.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let S=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Nf.NONE||o!==0&&Z.secondsDifference(e,S)>o)return;if(this._forwardExtrapolationType===Nf.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,h=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,c.length=S,u.length=S*h)}let _=this._numberOfPoints-1;if(_<1)return;let m=0,x=i-1;if(x-m+1>=_+1){let S=a-(_/2|0)-1;S<m&&(S=m);let v=S+_;v>x&&(v=x,S=v-_,S<m&&(S=m)),m=S,x=v}let T=x-m+1;for(let S=0;S<T;++S)c[S]=Z.secondsDifference(n[m+S],n[x]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,m,x,u);else{let S=0,v=this._packedLength,D=m*v,O=(x+1)*v;for(;D<O;)u[S]=s[D],D++,S++}let C=Z.secondsDifference(e,n[x]),A;if(p===0||!l(f.interpolate))A=f.interpolateOrderZero(C,c,u,h,this._interpolationResult);else{let S=Math.floor(h/(p+1));A=f.interpolate(C,c,u,S,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(A,s,m,x,t):r.unpack(A,0,t)}return r.unpack(s,a*this._packedLength,t)};Ff.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Ff.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}C3(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Ff.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let u=n[c],f=i.length;for(let h=0;h<f;h++)i[h].pack(u[h],a,a.length)}C3(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Ff.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Ff.prototype.addSamplesPackedArray=function(e,t){C3(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Ff.prototype.removeSample=function(e){let t=Mo(this._times,e,Z.compare);return t<0?!1:(xue(this,t,1),!0)};function xue(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Ff.prototype.removeSamples=function(e){let t=this._times,n=Mo(t,e.start,Z.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Mo(t,e.stop,Z.compare);i<0?i=~i:e.isStopIncluded&&++i,xue(this,n,i-n)};Ff.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!Z.equals(a[r],c[r]))return!1;let u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};Ff._mergeNewSamples=C3;var Bf=Ff;function kf(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=d}this._numberOfDerivatives=t,this._property=new Bf(d,n),this._definitionChanged=new pe,this._referenceFrame=y(e,Ui.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(kf.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var fZe=new Z;kf.prototype.getValue=function(e,t){return l(e)||(e=Z.now(fZe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};kf.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Lh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};kf.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};kf.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};kf.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};kf.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};kf.prototype.removeSample=function(e){return this._property.removeSample(e)};kf.prototype.removeSamples=function(e){this._property.removeSamples(e)};kf.prototype.equals=function(e){return this===e||e instanceof kf&&q.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var wa=kf;var dZe={HORIZONTAL:0,VERTICAL:1},dm=Object.freeze(dZe);var hZe=dm.HORIZONTAL,mZe=z.WHITE,pZe=z.BLACK,gZe=0,_Ze=1;function DA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new pe,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(DA.prototype,{isConstant:{get:function(){return q.isConstant(this._orientation)&&q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._offset)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});DA.prototype.getType=function(e){return"Stripe"};var yZe=new Z;DA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(yZe)),l(t)||(t={}),t.horizontal=q.getValueOrDefault(this._orientation,e,hZe)===dm.HORIZONTAL,t.evenColor=q.getValueOrClonedDefault(this._evenColor,e,mZe,t.evenColor),t.oddColor=q.getValueOrClonedDefault(this._oddColor,e,pZe,t.oddColor),t.offset=q.getValueOrDefault(this._offset,e,gZe),t.repeat=q.getValueOrDefault(this._repeat,e,_Ze),t};DA.prototype.equals=function(e){return this===e||e instanceof DA&&q.equals(this._orientation,e._orientation)&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._offset,e._offset)&&q.equals(this._repeat,e._repeat)};var ED=DA;function ly(e){this._definitionChanged=new pe,this._intervals=new Yr,this._intervals.changedEvent.addEventListener(ly.prototype._intervalsChanged,this),this._referenceFrame=y(e,Ui.FIXED)}Object.defineProperties(ly.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var xZe=new Z;ly.prototype.getValue=function(e,t){return l(e)||(e=Z.now(xZe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};ly.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Lh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};ly.prototype.equals=function(e){return this===e||e instanceof ly&&this._intervals.equals(e._intervals,q.equals)&&this._referenceFrame===e._referenceFrame};ly.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var uy=ly;function Gx(){this._definitionChanged=new pe,this._intervals=new Yr,this._intervals.changedEvent.addEventListener(Gx.prototype._intervalsChanged,this)}Object.defineProperties(Gx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var bZe=new Z;Gx.prototype.getValue=function(e,t){l(e)||(e=Z.now(bZe));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};Gx.prototype.equals=function(e){return this===e||e instanceof Gx&&this._intervals.equals(e._intervals,q.equals)};Gx.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var fy=Gx;function IA(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new pe,this._normalize=y(t,!0),this.position=e}Object.defineProperties(IA.prototype,{isConstant:{get:function(){return q.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var TZe=new d,bue=new d,Tue=new Z,CZe=new Z,t7=1/60;IA.prototype.getValue=function(e,t){return this._getValue(e,t)};IA.prototype._getValue=function(e,t,n){l(e)||(e=Z.now(CZe)),l(t)||(t=new d);let i=this._position;if(q.isConstant(i))return this._normalize?void 0:d.clone(d.ZERO,t);let o=i.getValue(e,TZe),r=i.getValue(Z.addSeconds(e,t7,Tue),bue);if(!l(o)||!l(r)&&(r=o,o=i.getValue(Z.addSeconds(e,-t7,Tue),bue),!l(o)))return;if(d.equals(o,r))return this._normalize?void 0:d.clone(d.ZERO,t);l(n)&&o.clone(n);let s=d.subtract(r,o,t);return this._normalize?d.normalize(s,t):d.divideByScalar(s,t7,t)};IA.prototype.equals=function(e){return this===e||e instanceof IA&&q.equals(this._position,e._position)};var dy=IA;function SD(e,t){this._velocityVectorProperty=new dy(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new pe,this.ellipsoid=y(t,ee.default);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(SD.prototype,{isConstant:{get:function(){return q.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var Cue=new d,AZe=new d,Aue=new $,EZe=new Z;SD.prototype.getValue=function(e,t){l(e)||(e=Z.now(EZe));let n=this._velocityVectorProperty._getValue(e,AZe,Cue);if(l(n))return Ot.rotationMatrixFromPositionVelocity(Cue,n,this._ellipsoid,Aue),Oe.fromRotationMatrix(Aue,t)};SD.prototype.equals=function(e){return this===e||e instanceof SD&&q.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var A3=SD;var eg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};eg.validate=function(e){return e===eg.COMPLETE||e===eg.BELOW_ELLIPSOID_HORIZON||e===eg.ABOVE_ELLIPSOID_HORIZON};eg.toString=function(e){switch(e){case eg.COMPLETE:return"COMPLETE";case eg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case eg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new he("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var vD=eg;function hy(){}hy.packedLength=d.packedLength;hy.unpack=d.unpack;hy.pack=d.pack;var n7;function wD(e,t){return t[0]==="#"&&(t=n7+t),cy.fromString(e,t)}function Eue(e,t,n){if(l(n.reference))return wD(t,n.reference);if(l(n.velocityReference)){let i=wD(t,n.velocityReference);switch(e){case d:case hy:return new dy(i,e===hy);case Oe:return new A3(i)}}throw new re(`${JSON.stringify(n)} is not valid CZML.`)}function SZe(e,t){return new kh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Bi=new d,jc=new T3,sc=new fe,Wx=new En,E3=new Oe;function vZe(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=z.byteToFloat(n[o+1]),t[o+2]=z.byteToFloat(n[o+2]),t[o+3]=z.byteToFloat(n[o+3]),t[o+4]=z.byteToFloat(n[o+4]);return t}function Sue(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):Se.createIfNeeded(n)}function wZe(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===se.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=P.toRadians(n[o+1]),t[o+2]=P.toRadians(n[o+2]),t[o+3]=P.toRadians(n[o+3]),t[o+4]=P.toRadians(n[o+4]);return t}function DZe(e){let t=e.length;if(jc.magnitude=1,t===2)return jc.clock=e[0],jc.cone=e[1],d.fromSpherical(jc,Bi),[Bi.x,Bi.y,Bi.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],jc.clock=e[i+1],jc.cone=e[i+2],d.fromSpherical(jc,Bi),n[o+1]=Bi.x,n[o+2]=Bi.y,n[o+3]=Bi.z;return n}function IZe(e){let t=e.length;if(t===3)return jc.clock=e[0],jc.cone=e[1],jc.magnitude=e[2],d.fromSpherical(jc,Bi),[Bi.x,Bi.y,Bi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],jc.clock=e[i+1],jc.cone=e[i+2],jc.magnitude=e[i+3],d.fromSpherical(jc,Bi),n[i+1]=Bi.x,n[i+2]=Bi.y,n[i+3]=Bi.z;return n}function PZe(e){let t=e.length;if(t===3)return sc.longitude=e[0],sc.latitude=e[1],sc.height=e[2],ee.default.cartographicToCartesian(sc,Bi),[Bi.x,Bi.y,Bi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],sc.longitude=e[i+1],sc.latitude=e[i+2],sc.height=e[i+3],ee.default.cartographicToCartesian(sc,Bi),n[i+1]=Bi.x,n[i+2]=Bi.y,n[i+3]=Bi.z;return n}function RZe(e){let t=e.length;if(t===3)return sc.longitude=P.toRadians(e[0]),sc.latitude=P.toRadians(e[1]),sc.height=e[2],ee.default.cartographicToCartesian(sc,Bi),[Bi.x,Bi.y,Bi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],sc.longitude=P.toRadians(e[i+1]),sc.latitude=P.toRadians(e[i+2]),sc.height=e[i+3],ee.default.cartographicToCartesian(sc,Bi),n[i+1]=Bi.x,n[i+2]=Bi.y,n[i+3]=Bi.z;return n}function i7(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return DZe(o);let r=e.spherical;if(l(r))return IZe(r);let s=e.cartographicRadians;if(l(s))return PZe(s);let a=e.cartographicDegrees;if(l(a))return RZe(a);throw new re(`${JSON.stringify(e)} is not a valid CZML interval.`)}function vue(e,t){d.unpack(e,t,Bi),d.normalize(Bi,Bi),d.pack(Bi,e,t)}function OZe(e){let t=i7(e);if(t.length===3)return vue(t,0),t;for(let n=1;n<t.length;n+=4)vue(t,n);return t}function wue(e,t){Oe.unpack(e,t,E3),Oe.normalize(E3,E3),Oe.pack(E3,e,t)}function MZe(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return wue(t,0),t;for(let n=1;n<t.length;n+=5)wue(t,n)}return t}function Due(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?qe:e.hasOwnProperty("cartesian2")?U:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?d:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?hy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?Jt:e.hasOwnProperty("classificationType")?kn:e.hasOwnProperty("colorBlendMode")?Bc:e.hasOwnProperty("cornerType")?Fi:e.hasOwnProperty("heightReference")?Ye:e.hasOwnProperty("horizontalOrigin")?xi:e.hasOwnProperty("date")?Z:e.hasOwnProperty("labelStyle")?Xo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Bt:e.hasOwnProperty("distanceDisplayCondition")?Mt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Oe:e.hasOwnProperty("shadowMode")?xn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?dm:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?se:e.hasOwnProperty("uri")?ID.default:e.hasOwnProperty("verticalOrigin")?On:Object}function LZe(e,t,n){switch(e){case Jt:return Jt[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case qe:return t.boundingRectangle;case U:return t.cartesian2;case d:return i7(t);case hy:return OZe(t);case z:return vZe(t);case kn:return kn[y(t.classificationType,t)];case Bc:return Bc[y(t.colorBlendMode,t)];case Fi:return Fi[y(t.cornerType,t)];case Ye:return Ye[y(t.heightReference,t)];case xi:return xi[y(t.horizontalOrigin,t)];case Image:return Sue(t,n);case Z:return Z.fromIso8601(y(t.date,t));case Xo:return Xo[y(t.labelStyle,t)];case Number:return y(t.number,t);case Bt:return t.nearFarScalar;case Mt:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case Oe:return MZe(t);case Vd:return y(t.number,t);case vD:return vD[y(t.portionToDisplay,t)];case xn:return xn[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case dm:return dm[y(t.stripeOrientation,t)];case se:return wZe(t);case ID.default:return Sue(t,n);case On:return On[y(t.verticalOrigin,t)];default:throw new re(`Unknown CzmlDataSource interval type: ${e}`)}}var NZe={HERMITE:x3,LAGRANGE:b3,LINEAR:CA};function S3(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:NZe[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=Nf[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=Nf[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Iue={iso8601:void 0};function sr(e){if(l(e))return Iue.iso8601=e,En.fromIso8601(Iue)}function o7(e){let t=He.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Pue(e){let t=new Hc;return t.intervals.addInterval(o7(e)),t}function Rue(e){let t=new va(e.referenceFrame);return t.intervals.addInterval(o7(e)),t}function v3(e,t,n,i,o,r,s){let a=sr(i.interval);l(o)&&(l(a)?a=En.intersect(a,o,Wx):a=o);let c,u,f,h=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(He.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return Hue(t[n],a)}let _=!1;if(h){if(u=LZe(e,i,r),!l(u))return;c=y(e.packedLength,1),f=y(u.length,1),_=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==Vd;if(!_&&!p){h?t[n]=new Xn(m?e.unpack(u,0):u):t[n]=Eue(e,s,i);return}let x=t[n],b,T=i.epoch;if(l(T)&&(b=Z.fromIso8601(T)),_&&!p){x instanceof Bf||(t[n]=x=new Bf(e)),x.addSamplesPackedArray(u,b),S3(i,x);return}let C;if(!_&&p){a=a.clone(),h?a.data=m?e.unpack(u,0):u:a.data=Eue(e,s,i),l(x)||(t[n]=x=h?new fy:new Hc),h&&x instanceof fy?x.intervals.addInterval(a):x instanceof Hc?(h&&(a.data=new Xn(a.data)),x.intervals.addInterval(a)):(t[n]=x=Pue(x),h&&(a.data=new Xn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new Hc),x instanceof Hc||(t[n]=x=Pue(x));let A=x.intervals;C=A.findInterval(a),(!l(C)||!(C.data instanceof Bf))&&(C=a.clone(),C.data=new Bf(e),A.addInterval(C)),C.data.addSamplesPackedArray(u,b),S3(i,C.data)}function Hue(e,t){if(e instanceof Bf){e.removeSamples(t);return}else if(e instanceof fy){e.intervals.removeInterval(t);return}else if(e instanceof Hc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=En.intersect(n.get(i),t,Wx);o.isEmpty||Hue(o.data,t)}n.removeInterval(t);return}}function ye(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)v3(e,t,n,i[a],o,r,s);else v3(e,t,n,i,o,r,s)}function Oue(e,t,n,i,o,r){let s=sr(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,Wx):s=i);let a=l(n.cartesianVelocity)?1:0,c=d.packedLength*(a+1),u,f,h=!l(n.reference),p=l(s)&&!s.equals(He.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return Gue(e[t],s)}let _,m=!1;if(h&&(l(n.referenceFrame)&&(_=Ui[n.referenceFrame]),_=y(_,Ui.FIXED),u=i7(n),f=y(u.length,1),m=f>c),!m&&!p){h?e[t]=new _l(d.unpack(u),_):e[t]=wD(r,n.reference);return}let x=e[t],b,T=n.epoch;if(l(T)&&(b=Z.fromIso8601(T)),m&&!p){(!(x instanceof wa)||l(_)&&x.referenceFrame!==_)&&(e[t]=x=new wa(_,a)),x.addSamplesPackedArray(u,b),S3(n,x);return}let C;if(!m&&p){s=s.clone(),h?s.data=d.unpack(u):s.data=wD(r,n.reference),l(x)||(h?x=new uy(_):x=new va(_),e[t]=x),h&&x instanceof uy&&l(_)&&x.referenceFrame===_?x.intervals.addInterval(s):x instanceof va?(h&&(s.data=new _l(s.data,_)),x.intervals.addInterval(s)):(e[t]=x=Rue(x),h&&(s.data=new _l(s.data,_)),x.intervals.addInterval(s));return}l(x)?x instanceof va||(e[t]=x=Rue(x)):e[t]=x=new va(_);let A=x.intervals;C=A.findInterval(s),(!l(C)||!(C.data instanceof wa)||l(_)&&C.data.referenceFrame!==_)&&(C=s.clone(),C.data=new wa(_,a),A.addInterval(C)),C.data.addSamplesPackedArray(u,b),S3(n,C.data)}function Gue(e,t){if(e instanceof wa){e.removeSamples(t);return}else if(e instanceof uy){e.intervals.removeInterval(t);return}else if(e instanceof va){let n=e.intervals;for(let i=0;i<n.length;++i){let o=En.intersect(n.get(i),t,Wx);o.isEmpty||Gue(o.data,t)}n.removeInterval(t);return}}function Wue(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Oue(e,t,n[s],i,o,r);else Oue(e,t,n,i,o,r)}function Mue(e,t,n,i){l(n.references)?w3(e,t,n.references,n.interval,i,AD,Hc):(l(n.cartesian2)?n.array=U.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=U.unpackArray(n.cartesian)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i))}function Lue(e,t,n,i,o,r){let s=sr(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,Wx):s=i);let a=e[t],c,u;if(l(s)){a instanceof lD||(a=new lD,e[t]=a);let h=a.intervals;u=h.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),h.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Ut||(c=new Ut),f=n.solidColor,ye(z,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof xD||(c=new xD),f=n.grid,ye(z,c,"color",f.color,void 0,o,r),ye(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),ye(U,c,"lineCount",f.lineCount,void 0,o,r),ye(U,c,"lineThickness",f.lineThickness,void 0,o,r),ye(U,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Y0||(c=new Y0),f=n.image,ye(Image,c,"image",f.image,void 0,o,r),ye(U,c,"repeat",f.repeat,void 0,o,r),ye(z,c,"color",f.color,void 0,o,r),ye(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof ED||(c=new ED),f=n.stripe,ye(dm,c,"orientation",f.orientation,void 0,o,r),ye(z,c,"evenColor",f.evenColor,void 0,o,r),ye(z,c,"oddColor",f.oddColor,void 0,o,r),ye(Number,c,"offset",f.offset,void 0,o,r),ye(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof zx||(c=new zx),f=n.polylineOutline,ye(z,c,"color",f.color,void 0,o,r),ye(z,c,"outlineColor",f.outlineColor,void 0,o,r),ye(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof CD||(c=new CD),f=n.polylineGlow,ye(z,c,"color",f.color,void 0,o,r),ye(Number,c,"glowPower",f.glowPower,void 0,o,r),ye(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof bD||(c=new bD),f=n.polylineArrow,ye(z,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof TD||(c=new TD),f=n.polylineDash,ye(z,c,"color",f.color,void 0,void 0,r),ye(z,c,"gapColor",f.gapColor,void 0,void 0,r),ye(Number,c,"dashLength",f.dashLength,void 0,o,r),ye(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof rD||(c=new rD),f=n.checkerboard,ye(z,c,"evenColor",f.evenColor,void 0,o,r),ye(z,c,"oddColor",f.oddColor,void 0,o,r),ye(U,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function mu(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Lue(e,t,n[s],i,o,r);else Lue(e,t,n,i,o,r)}function FZe(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function BZe(e,t,n,i){let o=t.description;l(o)&&ye(String,e,"description",o,void 0,i,n)}function kZe(e,t,n,i){let o=t.position;l(o)&&Wue(e,"position",o,void 0,i,n)}function VZe(e,t,n,i){let o=t.viewFrom;l(o)&&ye(d,e,"viewFrom",o,void 0,i,n)}function UZe(e,t,n,i){let o=t.orientation;l(o)&&ye(Oe,e,"orientation",o,void 0,i,n)}function zZe(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new xl);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)v3(Due(s[a]),e.properties,r,s[a],void 0,i,n);else v3(Due(s),e.properties,r,s,void 0,i,n)}}}function w3(e,t,n,i,o,r,s){let a=n.map(function(c){return wD(o,c)});if(l(i)){i=sr(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(o7(c)),e[t]=c=u}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function Nue(e,t,n,i){let o=n.references;l(o)?w3(e,t,o,n.interval,i,AD,Hc):ye(Array,e,t,n,void 0,void 0,i)}function Fue(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Nue(e,t,n[o],i);else Nue(e,t,n,i)}function Bue(e,t,n,i){let o=n.references;l(o)?w3(e,t,o,n.interval,i,sy,va):(l(n.cartesian)?n.array=d.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=d.fromRadiansArrayHeights(n.cartographicRadians,ee.default):l(n.cartographicDegrees)&&(n.array=d.fromDegreesArrayHeights(n.cartographicDegrees,ee.default)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i))}function PD(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Bue(e,t,n[o],i);else Bue(e,t,n,i)}function HZe(e){return d.unpackArray(e)}function GZe(e){return d.fromRadiansArrayHeights(e,ee.default)}function WZe(e){return d.fromDegreesArrayHeights(e,ee.default)}function kue(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return w3(a,"positions",s,n.interval,i,sy,va),a.positions});e[t]=new sy(r)}else l(n.cartesian)?n.array=n.cartesian.map(HZe):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(GZe):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(WZe)),l(n.array)&&ye(Array,e,t,n,void 0,void 0,i)}function jZe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)kue(e,t,n[o],i);else kue(e,t,n,i)}function qZe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Mue(e,t,n[o],i);else Mue(e,t,n,i)}function YZe(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new Yr),r.addInterval(sr(o[s]));else r=new Yr,r.addInterval(sr(o));e.availability=r}function XZe(e,t,n,i,o){l(t)&&ye(hy,e,"alignedAxis",t,n,i,o)}function KZe(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=sr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new Sc),ye(Boolean,s,"show",o.show,r,i,n),ye(Image,s,"image",o.image,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(U,s,"pixelOffset",o.pixelOffset,r,i,n),ye(d,s,"eyeOffset",o.eyeOffset,r,i,n),ye(xi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ye(On,s,"verticalOrigin",o.verticalOrigin,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(z,s,"color",o.color,r,i,n),ye(Vd,s,"rotation",o.rotation,r,i,n),XZe(s,o.alignedAxis,r,i,n),ye(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ye(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ye(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ye(qe,s,"imageSubRegion",o.imageSubRegion,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function ZZe(e,t,n,i){let o=t.box;if(!l(o))return;let r=sr(o.interval),s=e.box;l(s)||(e.box=s=new zT),ye(Boolean,s,"show",o.show,r,i,n),ye(d,s,"dimensions",o.dimensions,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),mu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function $Ze(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=sr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new GT),ye(Boolean,s,"show",o.show,r,i,n),PD(s,"positions",o.positions,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(Fi,s,"cornerType",o.cornerType,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),mu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(kn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function QZe(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=sr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new WT),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"length",o.length,r,i,n),ye(Number,s,"topRadius",o.topRadius,r,i,n),ye(Number,s,"bottomRadius",o.bottomRadius,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),mu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ye(Number,s,"slices",o.slices,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function JZe(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new re("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new re("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function e$e(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=sr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new jT),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),ye(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(Vd,s,"rotation",o.rotation,r,i,n),ye(Vd,s,"stRotation",o.stRotation,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),mu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(kn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function t$e(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=sr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new qT),ye(Boolean,s,"show",o.show,r,i,n),ye(d,s,"radii",o.radii,r,i,n),ye(d,s,"innerRadii",o.innerRadii,r,i,n),ye(Number,s,"minimumClock",o.minimumClock,r,i,n),ye(Number,s,"maximumClock",o.maximumClock,r,i,n),ye(Number,s,"minimumCone",o.minimumCone,r,i,n),ye(Number,s,"maximumCone",o.maximumCone,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),mu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"stackPartitions",o.stackPartitions,r,i,n),ye(Number,s,"slicePartitions",o.slicePartitions,r,i,n),ye(Number,s,"subdivisions",o.subdivisions,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function n$e(e,t,n,i){let o=t.label;if(!l(o))return;let r=sr(o.interval),s=e.label;l(s)||(e.label=s=new Nh),ye(Boolean,s,"show",o.show,r,i,n),ye(String,s,"text",o.text,r,i,n),ye(String,s,"font",o.font,r,i,n),ye(Xo,s,"style",o.style,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(Boolean,s,"showBackground",o.showBackground,r,i,n),ye(z,s,"backgroundColor",o.backgroundColor,r,i,n),ye(U,s,"backgroundPadding",o.backgroundPadding,r,i,n),ye(U,s,"pixelOffset",o.pixelOffset,r,i,n),ye(d,s,"eyeOffset",o.eyeOffset,r,i,n),ye(xi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),ye(On,s,"verticalOrigin",o.verticalOrigin,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(z,s,"fillColor",o.fillColor,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ye(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),ye(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function i$e(e,t,n,i){let o=t.model;if(!l(o))return;let r=sr(o.interval),s=e.model;l(s)||(e.model=s=new Qg),ye(Boolean,s,"show",o.show,r,i,n),ye(ID.default,s,"uri",o.gltf,r,i,n),ye(Number,s,"scale",o.scale,r,i,n),ye(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),ye(Number,s,"maximumScale",o.maximumScale,r,i,n),ye(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),ye(Boolean,s,"runAnimations",o.runAnimations,r,i,n),ye(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(z,s,"silhouetteColor",o.silhouetteColor,r,i,n),ye(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),ye(z,s,"color",o.color,r,i,n),ye(Bc,s,"colorBlendMode",o.colorBlendMode,r,i,n),ye(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)Vue(s,u[a],r,i,n);else Vue(s,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)Uue(s,f[a],r,i,n);else Uue(s,f,r,i,n)}function Vue(e,t,n,i,o){let r=sr(t.interval);l(n)&&(l(r)?r=En.intersect(r,n,Wx):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let h=t[f];if(!l(h))continue;l(s)||(e.nodeTransformations=s=new xl),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new YT),ye(d,p,"translation",h.translation,r,i,o),ye(Oe,p,"rotation",h.rotation,r,i,o),ye(d,p,"scale",h.scale,r,i,o)}}function Uue(e,t,n,i,o){let r=sr(t.interval);l(n)&&(l(r)?r=En.intersect(r,n,Wx):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let h=t[f];l(h)&&(l(s)||(e.articulations=s=new xl),s.hasProperty(f)||s.addProperty(f),ye(Number,s,f,h,r,i,o))}}function o$e(e,t,n,i){let o=t.path;if(!l(o))return;let r=sr(o.interval),s=e.path;l(s)||(e.path=s=new Jg),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"leadTime",o.leadTime,r,i,n),ye(Number,s,"trailTime",o.trailTime,r,i,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"resolution",o.resolution,r,i,n),mu(s,"material",o.material,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function r$e(e,t,n,i){let o=t.point;if(!l(o))return;let r=sr(o.interval),s=e.point;l(s)||(e.point=s=new KT),ye(Boolean,s,"show",o.show,r,i,n),ye(Number,s,"pixelSize",o.pixelSize,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(z,s,"color",o.color,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),ye(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function DD(e){this.polygon=e,this._definitionChanged=new pe}Object.defineProperties(DD.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});DD.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new Ka(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Ka(n,i)};DD.prototype.equals=function(e){return this===e||e instanceof DD&&q.equals(this.polygon._positions,e.polygon._positions)&&q.equals(this.polygon._holes,e.polygon._holes)};function s$e(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=sr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Fh),ye(Boolean,s,"show",o.show,r,i,n),PD(s,"_positions",o.positions,n),jZe(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new DD(s)),ye(Number,s,"height",o.height,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(Vd,s,"stRotation",o.stRotation,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),mu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),ye(Boolean,s,"closeTop",o.closeTop,r,i,n),ye(Boolean,s,"closeBottom",o.closeBottom,r,i,n),ye(Jt,s,"arcType",o.arcType,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(kn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function a$e(e){return e?Jt.GEODESIC:Jt.NONE}function c$e(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=sr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new Pc),ye(Boolean,s,"show",o.show,r,i,n),PD(s,"positions",o.positions,n),ye(Number,s,"width",o.width,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),mu(s,"material",o.material,r,i,n),mu(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),ye(Jt,s,"arcType",o.arcType,r,i,n),ye(Boolean,s,"clampToGround",o.clampToGround,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(kn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};ye(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=SZe(a.followSurface,a$e)}}function l$e(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=sr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new ZT),PD(s,"positions",o.positions,n),qZe(s,"shape",o.shape,n),ye(Boolean,s,"show",o.show,r,i,n),ye(Fi,s,"cornerType",o.cornerType,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),mu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function u$e(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=sr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Bh),ye(Boolean,s,"show",o.show,r,i,n),ye(se,s,"coordinates",o.coordinates,r,i,n),ye(Number,s,"height",o.height,r,i,n),ye(Ye,s,"heightReference",o.heightReference,r,i,n),ye(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),ye(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),ye(Vd,s,"rotation",o.rotation,r,i,n),ye(Vd,s,"stRotation",o.stRotation,r,i,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),mu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),ye(kn,s,"classificationType",o.classificationType,r,i,n),ye(Number,s,"zIndex",o.zIndex,r,i,n)}function f$e(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=sr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new XT),ye(Boolean,s,"show",o.show,r,i,n),ye(ID.default,s,"uri",o.uri,r,i,n),ye(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function d$e(e,t,n,i){let o=t.wall;if(!l(o))return;let r=sr(o.interval),s=e.wall;l(s)||(e.wall=s=new e_),ye(Boolean,s,"show",o.show,r,i,n),PD(s,"positions",o.positions,n),Fue(s,"minimumHeights",o.minimumHeights,n),Fue(s,"maximumHeights",o.maximumHeights,n),ye(Number,s,"granularity",o.granularity,r,i,n),ye(Boolean,s,"fill",o.fill,r,i,n),mu(s,"material",o.material,r,i,n),ye(Boolean,s,"outline",o.outline,r,i,n),ye(z,s,"outlineColor",o.outlineColor,r,i,n),ye(Number,s,"outlineWidth",o.outlineWidth,r,i,n),ye(xn,s,"shadows",o.shadows,r,i,n),ye(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function zue(e,t,n,i,o){let r=e.id;if(l(r)||(r=zn()),n7=r,!l(o._version)&&r!=="document")throw new re("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")JZe(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}n7=void 0}function h$e(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(He.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Z.secondsDifference(s,r),c=Math.round(a/120);return t=new fm,t.startTime=Z.clone(r),t.stopTime=Z.clone(s),t.clockRange=Kr.LOOP_STOP,t.multiplier=c,t.currentTime=Z.clone(r),t.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new fm,t.startTime=He.MINIMUM_VALUE.clone(),t.stopTime=He.MAXIMUM_VALUE.clone(),t.currentTime=He.MINIMUM_VALUE.clone(),t.clockRange=Kr.LOOP_STOP,t.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=sr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=Z.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Kr[n.range],Kr.LOOP_STOP)),l(n.step)&&(t.clockStep=y(_o[n.step],_o.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function jue(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Ct(s)),e._credit=s,typeof t=="string"||t instanceof Se){t=Se.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return r=Se.createIfNeeded(r),Xr.setLoading(e,!0),Promise.resolve(o).then(function(a){return m$e(e,a,r,i)}).catch(function(a){return Xr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function m$e(e,t,n,i){Xr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new que,o.removeAll()),as._processCzml(t,o,n,void 0,e);let r=h$e(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=ry(n.getUrlComponent()),r=!0),Xr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function que(){this.name=void 0,this.clock=void 0}function as(e){this._name=e,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._clock=void 0,this._documentPacket=new que,this._version=void 0,this._entityCollection=new aa(this),this._entityCluster=new Lf,this._credit=void 0,this._resourceCredits=[]}as.load=function(e,t){return new as().load(e,t)};Object.defineProperties(as.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});as.updaters=[KZe,ZZe,$Ze,QZe,e$e,t$e,n$e,i$e,FZe,BZe,o$e,r$e,s$e,c$e,l$e,zZe,u$e,kZe,f$e,VZe,d$e,UZe,YZe];as.registerUpdater=function(e){as.updaters.includes(e)||as.updaters.push(e)};as.unregisterUpdater=function(e){if(as.updaters.includes(e)){let t=as.updaters.indexOf(e);as.updaters.splice(t,1)}};as.prototype.process=function(e,t){return jue(this,e,t,!1)};as.prototype.load=function(e,t){return jue(this,e,t,!0)};as.prototype.update=function(e){return!0};as.processPacketData=ye;as.processPositionPacketData=Wue;as.processMaterialPacketData=mu;as._processCzml=function(e,t,n,i,o){if(i=y(i,as.updaters),Array.isArray(e))for(let r=0,s=e.length;r<s;++r)zue(e[r],t,i,n,o);else zue(e,t,i,n,o)};var D3=as;function qc(){this._dataSources=[],this._dataSourceAdded=new pe,this._dataSourceRemoved=new pe,this._dataSourceMoved=new pe}Object.defineProperties(qc.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});qc.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};qc.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};qc.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};qc.prototype.contains=function(e){return this.indexOf(e)!==-1};qc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};qc.prototype.get=function(e){return this._dataSources[e]};qc.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function I3(e,t){return e.indexOf(t)}function Yue(e,t,n){let i=e._dataSources,o=i.length-1;if(t=P.clamp(t,0,o),n=P.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}qc.prototype.raise=function(e){let t=I3(this._dataSources,e);Yue(this,t,t+1)};qc.prototype.lower=function(e){let t=I3(this._dataSources,e);Yue(this,t,t-1)};qc.prototype.raiseToTop=function(e){let t=I3(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};qc.prototype.lowerToBottom=function(e){let t=I3(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};qc.prototype.isDestroyed=function(){return!1};qc.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var P3=qc;function la(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=zn(),this._primitiveAdded=new pe,this._primitiveRemoved=new pe,this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(la.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});la.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e};la.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};la.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};la.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};la.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function R3(e,t){return e._primitives.indexOf(t)}la.prototype.raise=function(e){if(l(e)){let t=R3(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};la.prototype.raiseToTop=function(e){if(l(e)){let t=R3(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};la.prototype.lower=function(e){if(l(e)){let t=R3(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};la.prototype.lowerToBottom=function(e){if(l(e)){let t=R3(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};la.prototype.get=function(e){return this._primitives[e]};la.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};la.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};la.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};la.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};la.prototype.isDestroyed=function(){return!1};la.prototype.destroy=function(){return this.removeAll(),ue(this)};var pu=la;function hm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(hm.prototype,{length:{get:function(){return this._length}}});hm.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new pu({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};hm.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};hm.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};hm.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};hm.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};hm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};hm.prototype.isDestroyed=function(){return!1};hm.prototype.destroy=function(){return this.removeAll(),ue(this)};var O3=hm;function PA(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new St}PA.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};PA.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};PA.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};PA.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};PA.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):at.FAILED};var RA=PA;var s7={},M3=new d,Xue=new d,Kue=new Oe,Zue=new $;function OA(e,t,n,i,o,r,s,a,c,u){let f=e+t;d.multiplyByScalar(i,Math.cos(f),M3),d.multiplyByScalar(n,Math.sin(f),Xue),d.add(M3,Xue,M3);let h=Math.cos(e);h=h*h;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(s*h+o*p)/a;return Oe.fromAxisAngle(M3,m,Kue),$.fromQuaternion(Kue,Zue),$.multiplyByVector(Zue,c,u),d.normalize(u,u),d.multiplyByScalar(u,a,u),u}var $ue=new d,Que=new d,r7=new d,p$e=new d;s7.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let h=f+1,p=f+2,_=d.fromArray(e,f,$ue);i.scaleToGeodeticSurface(_,_);let m=d.clone(_,Que),x=i.geodeticSurfaceNormal(_,p$e),b=d.multiplyByScalar(x,o,r7);d.add(_,b,_),n&&(d.multiplyByScalar(x,r,b),d.add(m,b,m),a[f+u]=m.x,a[h+u]=m.y,a[p+u]=m.z),a[f]=_.x,a[h]=_.y,a[p]=_.z}return a};var g$e=new d,_$e=new d,y$e=new d;s7.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=o*o,f=o*i,h=d.magnitude(s),p=d.normalize(s,g$e),_=d.cross(d.UNIT_Z,s,_$e);_=d.normalize(_,_);let m=d.cross(p,_,y$e),x=1+Math.ceil(P.PI_OVER_TWO/a),b=P.PI_OVER_TWO/(x-1),T=P.PI_OVER_TWO-x*b;T<0&&(x-=Math.ceil(Math.abs(T)/b));let C=2*(x*(x+2)),A=t?new Array(C*3):void 0,S=0,v=$ue,D=Que,O=x*4*3,R=O-1,M=0,L=n?new Array(O):void 0,g,E,w,I,N;for(T=P.PI_OVER_TWO,v=OA(T,r,m,_,c,f,u,h,p,v),t&&(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z),n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x),T=P.PI_OVER_TWO-b,g=1;g<x+1;++g){if(v=OA(T,r,m,_,c,f,u,h,p,v),D=OA(Math.PI-T,r,m,_,c,f,u,h,p,D),t){for(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z,w=2*g+2,E=1;E<w-1;++E)I=E/(w-1),N=d.lerp(v,D,I,r7),A[S++]=N.x,A[S++]=N.y,A[S++]=N.z;A[S++]=D.x,A[S++]=D.y,A[S++]=D.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[M++]=D.x,L[M++]=D.y,L[M++]=D.z),T=P.PI_OVER_TWO-(g+1)*b}for(g=x;g>1;--g){if(T=P.PI_OVER_TWO-(g-1)*b,v=OA(-T,r,m,_,c,f,u,h,p,v),D=OA(T+Math.PI,r,m,_,c,f,u,h,p,D),t){for(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z,w=2*(g-1)+2,E=1;E<w-1;++E)I=E/(w-1),N=d.lerp(v,D,I,r7),A[S++]=N.x,A[S++]=N.y,A[S++]=N.z;A[S++]=D.x,A[S++]=D.y,A[S++]=D.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[M++]=D.x,L[M++]=D.y,L[M++]=D.z)}T=P.PI_OVER_TWO,v=OA(-T,r,m,_,c,f,u,h,p,v);let B={};return t&&(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z,B.positions=A,B.numPts=x),n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,B.outerPositions=L),B};var gu=s7;var MA=new d,a7=new d,c7=new d,Jue=new d,As=new U,efe=new $,x$e=new $,l7=new Oe,tfe=new d,nfe=new d,ife=new d,F3=new fe,ofe=new d,rfe=new U,sfe=new U;function afe(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,h=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,_=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,x=f?new Float32Array(u*3):void 0,b=0,T=tfe,C=nfe,A=ife,S=new Pi(a),v=S.project(a.cartesianToCartographic(o,F3),ofe),D=a.scaleToGeodeticSurface(o,MA);a.geodeticSurfaceNormal(D,D);let O=efe,R=x$e;if(c!==0){let N=Oe.fromAxisAngle(D,c,l7);O=$.fromQuaternion(N,O),N=Oe.fromAxisAngle(D,-c,l7),R=$.fromQuaternion(N,R)}else O=$.clone($.IDENTITY,O),R=$.clone($.IDENTITY,R);let M=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,rfe),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,sfe),g=e.length,E=n?g:0,w=E/3*2;for(let N=0;N<g;N+=3){let B=N+1,H=N+2,V=d.fromArray(e,N,MA);if(i.st){let G=$.multiplyByVector(O,V,a7),k=S.project(a.cartesianToCartographic(G,F3),c7);d.subtract(k,v,k),As.x=(k.x+r)/(2*r),As.y=(k.y+s)/(2*s),M.x=Math.min(As.x,M.x),M.y=Math.min(As.y,M.y),L.x=Math.max(As.x,L.x),L.y=Math.max(As.y,L.y),n&&(h[b+w]=As.x,h[b+1+w]=As.y),h[b++]=As.x,h[b++]=As.y}(i.normal||i.tangent||i.bitangent||f)&&(T=a.geodeticSurfaceNormal(V,T),f&&(x[N+E]=-T.x,x[B+E]=-T.y,x[H+E]=-T.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(C=d.normalize(d.cross(d.UNIT_Z,T,C),C),$.multiplyByVector(R,C,C)),i.normal&&(p[N]=T.x,p[B]=T.y,p[H]=T.z,n&&(p[N+E]=-T.x,p[B+E]=-T.y,p[H+E]=-T.z)),i.tangent&&(_[N]=C.x,_[B]=C.y,_[H]=C.z,n&&(_[N+E]=-C.x,_[B+E]=-C.y,_[H+E]=-C.z)),i.bitangent&&(A=d.normalize(d.cross(T,C,A),A),m[N]=A.x,m[B]=A.y,m[H]=A.z,n&&(m[N+E]=A.x,m[B+E]=A.y,m[H+E]=A.z))))}if(i.st){g=h.length;for(let N=0;N<g;N+=2)h[N]=(h[N]-M.x)/(L.x-M.x),h[N+1]=(h[N+1]-M.y)/(L.y-M.y)}let I=new dn;if(i.position){let N=gu.raisePositionsToHeight(e,t,n);I.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:N})}if(i.st&&(I.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(I.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_})),i.bitangent&&(I.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===rn.TOP)N=N.fill(1,0,u/2);else{let B=t.offsetAttribute===rn.NONE?0:1;N=N.fill(B)}I.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return I}function cfe(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var jx=new d;function b$e(e){let t=e.center;jx=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,jx),e.height,jx),jx=d.add(t,jx,jx);let n=new ae(jx,e.semiMajorAxis),i=gu.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=afe(o,e,!1),a=cfe(r);return a=Ne.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function T$e(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,h=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,_=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,x=n.bitangent?new Float32Array(f*3):void 0,b=t.shadowVolume,T=b?new Float32Array(f*3):void 0,C=0,A=tfe,S=nfe,v=ife,D=new Pi(s),O=D.project(s.cartesianToCartographic(i,F3),ofe),R=s.scaleToGeodeticSurface(i,MA);s.geodeticSurfaceNormal(R,R);let M=Oe.fromAxisAngle(R,u,l7),L=$.fromQuaternion(M,efe),g=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,rfe),E=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,sfe),w=e.length,I=w/3*2;for(let B=0;B<w;B+=3){let H=B+1,V=B+2,G=d.fromArray(e,B,MA),k;if(n.st){let Y=$.multiplyByVector(L,G,a7),J=D.project(s.cartesianToCartographic(Y,F3),c7);d.subtract(J,O,J),As.x=(J.x+o)/(2*o),As.y=(J.y+r)/(2*r),g.x=Math.min(As.x,g.x),g.y=Math.min(As.y,g.y),E.x=Math.max(As.x,E.x),E.y=Math.max(As.y,E.y),p[C+I]=As.x,p[C+1+I]=As.y,p[C++]=As.x,p[C++]=As.y}G=s.scaleToGeodeticSurface(G,G),k=d.clone(G,a7),A=s.geodeticSurfaceNormal(G,A),b&&(T[B+w]=-A.x,T[H+w]=-A.y,T[V+w]=-A.z);let W=d.multiplyByScalar(A,a,Jue);if(G=d.add(G,W,G),W=d.multiplyByScalar(A,c,W),k=d.add(k,W,k),n.position&&(h[B+w]=k.x,h[H+w]=k.y,h[V+w]=k.z,h[B]=G.x,h[H]=G.y,h[V]=G.z),n.normal||n.tangent||n.bitangent){v=d.clone(A,v);let Y=d.fromArray(e,(B+3)%w,Jue);d.subtract(Y,G,Y);let J=d.subtract(k,G,c7);A=d.normalize(d.cross(J,Y,A),A),n.normal&&(_[B]=A.x,_[H]=A.y,_[V]=A.z,_[B+w]=A.x,_[H+w]=A.y,_[V+w]=A.z),n.tangent&&(S=d.normalize(d.cross(v,A,S),S),m[B]=S.x,m[H]=S.y,m[V]=S.z,m[B+w]=S.x,m[B+1+w]=S.y,m[B+2+w]=S.z),n.bitangent&&(x[B]=v.x,x[H]=v.y,x[V]=v.z,x[B+w]=v.x,x[H+w]=v.y,x[V+w]=v.z)}}if(n.st){w=p.length;for(let B=0;B<w;B+=2)p[B]=(p[B]-g.x)/(E.x-g.x),p[B+1]=(p[B+1]-g.y)/(E.y-g.y)}let N=new dn;if(n.position&&(N.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(N.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(N.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_})),n.tangent&&(N.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(N.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),b&&(N.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),l(t.offsetAttribute)){let B=new Uint8Array(f);if(t.offsetAttribute===rn.TOP)B=B.fill(1,0,f/2);else{let H=t.offsetAttribute===rn.NONE?0:1;B=B.fill(H)}N.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return N}function C$e(e){let t=e.length/3,n=Ne.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var L3=new ae,N3=new ae;function A$e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,MA),e.height,MA);L3.center=d.add(t,o,L3.center),L3.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N3.center=d.add(t,o,N3.center),N3.radius=i;let r=gu.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,u=ae.union(L3,N3),f=afe(s,e,!0),h=cfe(a),p=h.length;h.length=p*2;let _=s.length/3;for(let S=0;S<p;S+=3)h[S+p]=h[S+2]+_,h[S+1+p]=h[S+1]+_,h[S+2+p]=h[S]+_;let m=Ne.createTypedArray(_*2/3,h),x=new st({attributes:f,indices:m,primitiveType:Me.TRIANGLES}),b=T$e(c,e);h=C$e(c);let T=Ne.createTypedArray(c.length*2/3,h),C=new st({attributes:b,indices:T,primitiveType:Me.TRIANGLES}),A=Nn.combineInstances([new vt({geometry:x}),new vt({geometry:C})]);return{boundingSphere:u,attributes:A[0].attributes,indices:A[0].indices}}function lfe(e,t,n,i,o,r,s){let c=gu.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=d.fromArray(c,p*3);let h=se.fromCartesianArray(f,r,s);return h.width>P.PI&&(h.north=h.north>0?P.PI_OVER_TWO-P.EPSILON7:h.north,h.south=h.south<0?P.EPSILON7-P.PI_OVER_TWO:h.south,h.east=P.PI,h.west=-P.PI),h}function pm(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ee.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Ie.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ee.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Ie.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}pm.packedLength=d.packedLength+ee.packedLength+Ie.packedLength+9;pm.pack=function(e,t,n){return n=y(n,0),d.pack(e._center,t,n),n+=d.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var ufe=new d,ffe=new ee,dfe=new Ie,mm={center:ufe,ellipsoid:ffe,vertexFormat:dfe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};pm.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,ufe);t+=d.packedLength;let o=ee.unpack(e,t,ffe);t+=ee.packedLength;let r=Ie.unpack(e,t,dfe);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++],_=e[t++]===1,m=e[t];return l(n)?(n._center=d.clone(i,n._center),n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=_,n._offsetAttribute=m===-1?void 0:m,n):(mm.height=f,mm.extrudedHeight=p,mm.granularity=h,mm.stRotation=u,mm.rotation=c,mm.semiMajorAxis=s,mm.semiMinorAxis=a,mm.shadowVolume=_,mm.offsetAttribute=m===-1?void 0:m,new pm(mm))};pm.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,ee.default),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,P.RADIANS_PER_DEGREE),a=y(e.rotation,0);return lfe(n,o,r,a,s,i,t)};pm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=A$e(o);else if(r=b$e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===rn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new st({attributes:r.attributes,indices:r.indices,primitiveType:Me.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};pm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new pm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};function E$e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=gu.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=d.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return st._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(pm.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=lfe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=E$e(this)),this._textureCoordinateRotationPoints}}});var Il=pm;var hfe=new d,qx=new d;function S$e(e){let t=e.center;qx=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,qx),e.height,qx),qx=d.add(t,qx,qx);let n=new ae(qx,e.semiMajorAxis),i=gu.computeEllipsePositions(e,!1,!0).outerPositions,o=new dn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:gu.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ne.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var B3=new ae,k3=new ae;function v$e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,hfe),e.height,hfe);B3.center=d.add(t,o,B3.center),B3.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),k3.center=d.add(t,o,k3.center),k3.radius=i;let r=gu.computeEllipsePositions(e,!1,!0).outerPositions,s=new dn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:gu.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ae.union(B3,k3),c=r.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===rn.TOP)m=m.fill(1,0,c/2);else{let x=e.offsetAttribute===rn.NONE?0:1;m=m.fill(x)}s.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=y(e.numberOfVerticalLines,16);u=P.clamp(u,0,c/2);let f=Ne.createTypedArray(c,c*2+u*2);c/=2;let h=0,p;for(p=0;p<c;++p)f[h++]=p,f[h++]=(p+1)%c,f[h++]=p+c,f[h++]=(p+1)%c+c;let _;if(u>0){let m=Math.min(u,c);_=Math.round(c/m);let x=Math.min(_*u,c);for(p=0;p<x;p+=_)f[h++]=p,f[h++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function LA(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ee.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ee.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}LA.packedLength=d.packedLength+ee.packedLength+8;LA.pack=function(e,t,n){return n=y(n,0),d.pack(e._center,t,n),n+=d.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var mfe=new d,pfe=new ee,tg={center:mfe,ellipsoid:pfe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};LA.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,mfe);t+=d.packedLength;let o=ee.unpack(e,t,pfe);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._center=d.clone(i,n._center),n._ellipsoid=ee.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=h,n._offsetAttribute=p===-1?void 0:p,n):(tg.height=c,tg.extrudedHeight=f,tg.granularity=u,tg.rotation=a,tg.semiMajorAxis=r,tg.semiMinorAxis=s,tg.numberOfVerticalLines=h,tg.offsetAttribute=p===-1?void 0:p,new LA(tg))};LA.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=v$e(o);else if(r=S$e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===rn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new st({attributes:r.attributes,indices:r.indices,primitiveType:Me.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Vf=LA;var gfe=new z,_fe=d.ZERO,yfe=new d,xfe=new se;function w$e(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Ud(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new w$e(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Ud.prototype=Object.create(Gn.prototype),Ud.prototype.constructor=Ud);Ud.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,gfe)),l(o)||(o=z.WHITE),i.color=Gt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,_fe,yfe))),new vt({id:t,geometry:new Il(this._options),attributes:i})};Ud.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,gfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,_fe,yfe))),new vt({id:t,geometry:new Vf(this._options),attributes:r})};Ud.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Ud.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||oi.prototype._isHidden.call(this,e,t)};Ud.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!q.isConstant(t.rotation)||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};Ud.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,He.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),o=q.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),r=q.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(He.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(He.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(He.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=q.getValueOrUndefined(t.rotation,He.MINIMUM_VALUE),s.granularity=q.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),s.stRotation=q.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),s.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,He.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=ui.getMinimumMaximumHeights(Il.computeRectangle(s,xfe)).minimumTerrainHeight),s.extrudedHeight=o};Ud.DynamicGeometryUpdater=NA;function NA(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(NA.prototype=Object.create(ii.prototype),NA.prototype.constructor=NA);NA.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ii.prototype._isHidden.call(this,e,t,n)};NA.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,Ye.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.center=q.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=q.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=q.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(Il.computeRectangle(i,xfe)).minimumTerrainHeight),i.extrudedHeight=s};var V3=Ud;var D$e=new d,I$e=new d,P$e=new d,R$e=new d,O$e=new d,M$e=new d(1,1,1),bfe=Math.cos,Tfe=Math.sin;function ng(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,M$e),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,P.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),u=y(e.vertexFormat,Ie.DEFAULT);this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Ie.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}ng.packedLength=2*d.packedLength+Ie.packedLength+7;ng.pack=function(e,t,n){return n=y(n,0),d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var Cfe=new d,Afe=new d,Efe=new Ie,my={radii:Cfe,innerRadii:Afe,vertexFormat:Efe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};ng.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,Cfe);t+=d.packedLength;let o=d.unpack(e,t,Afe);t+=d.packedLength;let r=Ie.unpack(e,t,Efe);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=h,n._offsetAttribute=p===-1?void 0:p,n):(my.minimumClock=s,my.maximumClock=a,my.minimumCone=c,my.maximumCone=u,my.stackPartitions=f,my.slicePartitions=h,my.offsetAttribute=p===-1?void 0:p,new ng(my))};ng.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/P.TWO_PI),u=Math.round(u*Math.abs(s-r)/P.PI),c<2&&(c=2),u<2&&(u=2);let f,h,p=0,_=[r],m=[i];for(f=0;f<u;f++)_.push(r+f*(s-r)/(u-1));for(_.push(s),h=0;h<c;h++)m.push(i+h*(o-i)/(c-1));m.push(o);let x=_.length,b=m.length,T=0,C=1,A=n.x!==t.x||n.y!==t.y||n.z!==t.z,S=!1,v=!1,D=!1;A&&(C=2,r>0&&(S=!0,T+=c-1),s<Math.PI&&(v=!0,T+=c-1),(o-i)%P.TWO_PI?(D=!0,T+=(u-1)*2+1):T+=1);let O=b*x*C,R=new Float64Array(O*3),M=new Array(O).fill(!1),L=new Array(O).fill(!1),g=c*u*C,E=6*(g+T+1-(c+u)*C),w=Ne.createTypedArray(g,E),I=a.normal?new Float32Array(O*3):void 0,N=a.tangent?new Float32Array(O*3):void 0,B=a.bitangent?new Float32Array(O*3):void 0,H=a.st?new Float32Array(O*2):void 0,V=new Array(x),G=new Array(x);for(f=0;f<x;f++)V[f]=Tfe(_[f]),G[f]=bfe(_[f]);let k=new Array(b),W=new Array(b);for(h=0;h<b;h++)W[h]=bfe(m[h]),k[h]=Tfe(m[h]);for(f=0;f<x;f++)for(h=0;h<b;h++)R[p++]=t.x*V[f]*W[h],R[p++]=t.y*V[f]*k[h],R[p++]=t.z*G[f];let Y=O/2;if(A)for(f=0;f<x;f++)for(h=0;h<b;h++)R[p++]=n.x*V[f]*W[h],R[p++]=n.y*V[f]*k[h],R[p++]=n.z*G[f],M[Y]=!0,f>0&&f!==x-1&&h!==0&&h!==b-1&&(L[Y]=!0),Y++;p=0;let J,j;for(f=1;f<x-2;f++)for(J=f*b,j=(f+1)*b,h=1;h<b-2;h++)w[p++]=j+h,w[p++]=j+h+1,w[p++]=J+h+1,w[p++]=j+h,w[p++]=J+h+1,w[p++]=J+h;if(A){let et=x*b;for(f=1;f<x-2;f++)for(J=et+f*b,j=et+(f+1)*b,h=1;h<b-2;h++)w[p++]=j+h,w[p++]=J+h,w[p++]=J+h+1,w[p++]=j+h,w[p++]=J+h+1,w[p++]=j+h+1}let K,Q;if(A){if(S)for(Q=x*b,f=1;f<b-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Q+f+1,w[p++]=f,w[p++]=Q+f+1,w[p++]=Q+f;if(v)for(K=x*b-b,Q=x*b*C-b,f=1;f<b-2;f++)w[p++]=K+f+1,w[p++]=K+f,w[p++]=Q+f,w[p++]=K+f+1,w[p++]=Q+f,w[p++]=Q+f+1}if(D){for(f=1;f<x-2;f++)Q=b*x+b*f,K=b*f,w[p++]=Q,w[p++]=K+b,w[p++]=K,w[p++]=Q,w[p++]=Q+b,w[p++]=K+b;for(f=1;f<x-2;f++)Q=b*x+b*(f+1)-1,K=b*(f+1)-1,w[p++]=K+b,w[p++]=Q,w[p++]=K,w[p++]=K+b,w[p++]=Q+b,w[p++]=Q}let de=new dn;a.position&&(de.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:R}));let xe=0,ce=0,_e=0,be=0,De=O/2,Ae,ke=ee.fromCartesian3(t),ze=ee.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<O;f++){Ae=M[f]?ze:ke;let et=d.fromArray(R,f*3,D$e),Et=Ae.geodeticSurfaceNormal(et,I$e);if(L[f]&&d.negate(Et,Et),a.st){let ht=U.negate(Et,O$e);H[xe++]=Math.atan2(ht.y,ht.x)/P.TWO_PI+.5,H[xe++]=Math.asin(Et.z)/Math.PI+.5}if(a.normal&&(I[ce++]=Et.x,I[ce++]=Et.y,I[ce++]=Et.z),a.tangent||a.bitangent){let ht=P$e,Be=0,qt;if(M[f]&&(Be=De),!S&&f>=Be&&f<Be+b*2?qt=d.UNIT_X:qt=d.UNIT_Z,d.cross(qt,Et,ht),d.normalize(ht,ht),a.tangent&&(N[_e++]=ht.x,N[_e++]=ht.y,N[_e++]=ht.z),a.bitangent){let Tt=d.cross(Et,ht,R$e);d.normalize(Tt,Tt),B[be++]=Tt.x,B[be++]=Tt.y,B[be++]=Tt.z}}}a.st&&(de.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:H})),a.normal&&(de.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(de.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(de.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:B}))}if(l(e._offsetAttribute)){let et=R.length,Et=e._offsetAttribute===rn.NONE?0:1,ht=new Uint8Array(et/3).fill(Et);de.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:ht})}return new st({attributes:de,indices:w,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromEllipsoid(ke),offsetAttribute:e._offsetAttribute})};var u7;ng.getUnitEllipsoid=function(){return l(u7)||(u7=ng.createGeometry(new ng({radii:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),u7};var ua=ng;var L$e=new Ut(z.WHITE),f7=d.ZERO,d7=new d,N$e=new d,F$e=new d,h7=new z,B$e=new d(1,1,1);function k$e(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function _u(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new k$e(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(_u.prototype=Object.create(oi.prototype),_u.prototype.constructor=_u);Object.defineProperties(_u.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});_u.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new yn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Bn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,h7)),l(f)||(f=z.WHITE),r=Gt.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,f7,d7))),new vt({id:i,geometry:new ua(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};_u.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,h7),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new yn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(r),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,f7,d7))),new vt({id:i,geometry:new If(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};_u.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};_u.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||oi.prototype._isHidden.call(this,e,t)};_u.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.radii.isConstant||!q.isConstant(t.innerRadii)||!q.isConstant(t.stackPartitions)||!q.isConstant(t.slicePartitions)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.minimumClock)||!q.isConstant(t.maximumClock)||!q.isConstant(t.minimumCone)||!q.isConstant(t.maximumCone)||!q.isConstant(t.subdivisions)};_u.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(He.MINIMUM_VALUE,i.radii),i.innerRadii=q.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=q.getValueOrUndefined(t.minimumClock,He.MINIMUM_VALUE),i.maximumClock=q.getValueOrUndefined(t.maximumClock,He.MINIMUM_VALUE),i.minimumCone=q.getValueOrUndefined(t.minimumCone,He.MINIMUM_VALUE),i.maximumCone=q.getValueOrUndefined(t.maximumCone,He.MINIMUM_VALUE),i.stackPartitions=q.getValueOrUndefined(t.stackPartitions,He.MINIMUM_VALUE),i.slicePartitions=q.getValueOrUndefined(t.slicePartitions,He.MINIMUM_VALUE),i.subdivisions=q.getValueOrUndefined(t.subdivisions,He.MINIMUM_VALUE),i.offsetAttribute=n!==Ye.NONE?rn.ALL:void 0};_u.prototype._onEntityPropertyChanged=t_;_u.DynamicGeometryUpdater=RD;function RD(e,t,n){ii.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new d,this._material={}}l(Object.create)&&(RD.prototype=Object.create(ii.prototype),RD.prototype.constructor=RD);RD.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!q.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=q.getValueOrUndefined(n.radii,e,N$e),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=q.getValueOrDefault(n.fill,e,!0),s=q.getValueOrDefault(n.outline,e,!1),a=q.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,h7),c=ir.getValue(e,y(n.material,L$e),this._material),u=q.getValueOrUndefined(n.innerRadii,e,F$e),f=q.getValueOrUndefined(n.minimumClock,e),h=q.getValueOrUndefined(n.maximumClock,e),p=q.getValueOrUndefined(n.minimumCone,e),_=q.getValueOrUndefined(n.maximumCone,e),m=q.getValueOrUndefined(n.stackPartitions,e),x=q.getValueOrUndefined(n.slicePartitions,e),b=q.getValueOrUndefined(n.subdivisions,e),T=q.getValueOrDefault(n.outlineWidth,e,1),C=q.getValueOrDefault(n.heightReference,e,Ye.NONE),A=C!==Ye.NONE?rn.ALL:void 0,S=this._scene.mode,v=S===ne.SCENE3D&&C===Ye.NONE,D=this._options,O=this._geometryUpdater.shadowsProperty.getValue(e),M=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=q.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,f7,d7);if(!v||this._lastSceneMode!==S||!l(this._primitive)||D.stackPartitions!==m||D.slicePartitions!==x||l(u)&&!d.equals(D.innerRadii!==u)||D.minimumClock!==f||D.maximumClock!==h||D.minimumCone!==p||D.maximumCone!==_||D.subdivisions!==b||this._lastOutlineWidth!==T||D.offsetAttribute!==A){let E=this._primitives;E.removeAndDestroy(this._primitive),E.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=T,D.stackPartitions=m,D.slicePartitions=x,D.subdivisions=b,D.offsetAttribute=A,D.radii=d.clone(v?B$e:i,D.radii),l(u)?v?D.innerRadii=d.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,D.innerRadii):D.innerRadii=d.clone(u,D.innerRadii):D.innerRadii=void 0,D.minimumClock=f,D.maximumClock=h,D.minimumCone=p,D.maximumCone=_;let w=new ao({material:c,translucent:c.isTranslucent(),closed:!0});D.vertexFormat=w.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=E.add(new In({geometryInstances:I,appearance:w,asynchronous:!1,shadows:O}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=E.add(new In({geometryInstances:N,appearance:new an({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(T)}}),asynchronous:!1,shadows:O})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=M,this._lastOffset=d.clone(L,this._lastOffset)}else if(this._primitive.ready){let E=this._primitive,w=this._outlinePrimitive;E.show=!0,w.show=!0,E.appearance.material=c;let I=this._attributes;l(I)||(I=E.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=yn.toValue(r,I.show),this._lastShow=r);let N=this._outlineAttributes;l(N)||(N=w.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=yn.toValue(s,N.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(N.color=Gt.toValue(a,N.color),z.clone(a,this._lastOutlineColor)),Mt.equals(M,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=Bn.toValue(M,I.distanceDisplayCondition),N.distanceDisplayCondition=Bn.toValue(M,N.distanceDisplayCondition),Mt.clone(M,this._lastDistanceDisplayCondition)),d.equals(L,this._lastOffset)||(I.offset=Qi.toValue(L,I.offset),N.offset=Qi.toValue(L,I.offset),d.clone(L,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=F.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var U3=_u;function FA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Ie.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}FA.packedLength=Ie.packedLength;FA.pack=function(e,t,n){return n=y(n,0),Ie.pack(e._vertexFormat,t,n),t};var Sfe=new Ie,V$e={vertexFormat:Sfe};FA.unpack=function(e,t,n){t=y(t,0);let i=Ie.unpack(e,t,Sfe);return l(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n):new FA(V$e)};var z3=new d(-.5,-.5,0),H3=new d(.5,.5,0);FA.createGeometry=function(e){let t=e._vertexFormat,n=new dn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=z3.x,o[1]=z3.y,o[2]=0,o[3]=H3.x,o[4]=z3.y,o[5]=0,o[6]=H3.x,o[7]=H3.y,o[8]=0,o[9]=z3.x,o[10]=H3.y,o[11]=0,n.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new st({attributes:n,indices:i,primitiveType:Me.TRIANGLES,boundingSphere:new ae(d.ZERO,Math.sqrt(2))})};var G3=FA;function BA(){this._workerName="createPlaneOutlineGeometry"}BA.packedLength=0;BA.pack=function(e,t){return t};BA.unpack=function(e,t,n){return l(n)?n:new BA};var py=new d(-.5,-.5,0),W3=new d(.5,.5,0);BA.createGeometry=function(){let e=new dn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=py.x,n[1]=py.y,n[2]=py.z,n[3]=W3.x,n[4]=py.y,n[5]=py.z,n[6]=W3.x,n[7]=W3.y,n[8]=py.z,n[9]=py.x,n[10]=W3.y,n[11]=py.z,e.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new st({attributes:e,indices:t,primitiveType:Me.LINES,boundingSphere:new ae(d.ZERO,Math.sqrt(2))})};var j3=BA;var U$e=new d,vfe=new z;function z$e(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Uf(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new z$e(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Uf.prototype=Object.create(oi.prototype),Uf.prototype.constructor=Uf);Uf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Bn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let _;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(_=this._materialProperty.color.getValue(e,vfe)),l(_)||(_=z.WHITE),o=Gt.fromColor(_),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),h=q.getValueOrDefault(c.plane,e,u.plane),p=q.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=h,u.dimensions=p,f=m7(h,p,f,f),new vt({id:t,geometry:new G3(this._options),modelMatrix:f,attributes:i})};Uf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,vfe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=q.getValueOrDefault(r.plane,e,s.plane),u=q.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=m7(c,u,a,a),new vt({id:t,geometry:new j3,modelMatrix:a,attributes:{show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o)}})};Uf.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||oi.prototype._isHidden.call(this,e,t)};Uf.prototype._getIsClosed=function(e){return!1};Uf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};Uf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?an.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(He.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(He.MINIMUM_VALUE,i.dimensions)};Uf.DynamicGeometryUpdater=kA;function kA(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(kA.prototype=Object.create(ii.prototype),kA.prototype.constructor=kA);kA.prototype._isHidden=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(e.position,n,U$e);return!l(o)||!l(i.plane)||!l(i.dimensions)||ii.prototype._isHidden.call(this,e,t,n)};kA.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=q.getValueOrDefault(t.plane,n,i.plane),i.dimensions=q.getValueOrUndefined(t.dimensions,n,i.dimensions)};var H$e=new d,G$e=new d,W$e=new d,j$e=new d,q$e=new $,Y$e=new $,X$e=new F;function m7(e,t,n,i){let o=e.normal,r=e.distance,s=d.multiplyByScalar(o,-r,W$e),a=d.clone(d.UNIT_Z,G$e);P.equalsEpsilon(Math.abs(d.dot(a,o)),1,P.EPSILON8)&&(a=d.clone(d.UNIT_Y,a));let c=d.cross(a,o,H$e);a=d.cross(o,c,a),d.normalize(c,c),d.normalize(a,a);let u=q$e;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,o,u);let f=d.fromElements(t.x,t.y,1,j$e),h=$.multiplyByScale(u,f,Y$e),p=F.fromRotationTranslation(h,s,X$e);return F.multiplyTransformation(n,p,i)}Uf.createPrimitiveMatrix=m7;var q3=Uf;var K$e=new d,Z$e=new qe,$$e=new U,Q$e=new U,J$e=new d,eQe=new d,tQe=new d,OD=new d,nQe=new d,iQe=new d,wfe=new Oe,oQe=new $,rQe=new $,sQe=new d;function aQe(e,t,n,i,o,r,s,a,c){let u=e.positions,f=si.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let h=Ne.createTypedArray(u.length,f.length);h.set(f);let p=oQe;if(i!==0){let g=Oe.fromAxisAngle(s,i,wfe);if(p=$.fromQuaternion(g,p),t.tangent||t.bitangent){g=Oe.fromAxisAngle(s,-i,wfe);let E=$.fromQuaternion(g,rQe);a=d.normalize($.multiplyByVector(E,a,a),a),t.bitangent&&(c=d.normalize(d.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let _=Q$e;t.st&&(_.x=n.x,_.y=n.y);let m=u.length,x=m*3,b=new Float64Array(x),T=t.normal?new Float32Array(x):void 0,C=t.tangent?new Float32Array(x):void 0,A=t.bitangent?new Float32Array(x):void 0,S=t.st?new Float32Array(m*2):void 0,v=0,D=0,O=0,R=0,M=0;for(let g=0;g<m;g++){let E=u[g];if(b[v++]=E.x,b[v++]=E.y,b[v++]=E.z,t.st)if(l(o)&&o.positions.length===m)S[M++]=o.positions[g].x,S[M++]=o.positions[g].y;else{let w=$.multiplyByVector(p,E,K$e),I=r(w,$$e);U.subtract(I,_,I);let N=P.clamp(I.x/n.width,0,1),B=P.clamp(I.y/n.height,0,1);S[M++]=N,S[M++]=B}t.normal&&(T[D++]=s.x,T[D++]=s.y,T[D++]=s.z),t.tangent&&(C[R++]=a.x,C[R++]=a.y,C[R++]=a.z),t.bitangent&&(A[O++]=c.x,A[O++]=c.y,A[O++]=c.z)}let L=new dn;return t.position&&(L.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b})),t.normal&&(L.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.tangent&&(L.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.bitangent&&(L.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.st&&(L.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:S})),new st({attributes:L,indices:h,primitiveType:Me.TRIANGLES})}function Yx(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Ie.DEFAULT);this._vertexFormat=Ie.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Un.computeHierarchyPackedLength(t,d)+Ie.packedLength+ee.packedLength+(l(n)?Un.computeHierarchyPackedLength(n,U):1)+2}Yx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new Yx(t)};Yx.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Un.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n++]=e.packedLength,t};var cQe=ee.clone(ee.UNIT_SPHERE),lQe=new Ie,uQe={polygonHierarchy:{}};Yx.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,cQe);t+=ee.packedLength;let r=Ie.unpack(e,t,lQe);t+=Ie.packedLength;let s=e[t++],a=e[t]===-1?void 0:Un.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new Yx(uQe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};Yx.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=bo(s,d.equalsEpsilon,!0),s.length<3)return;let a=J$e,c=eQe,u=tQe,f=nQe,h=iQe;if(!q_.computeProjectTo2DArguments(s,OD,f,h))return;if(a=d.cross(f,h,a),a=d.normalize(a,a),!d.equalsEpsilon(OD,d.ZERO,P.EPSILON6)){let M=e._ellipsoid.geodeticSurfaceNormal(OD,sQe);d.dot(a,M)<0&&(a=d.negate(a,a),f=d.negate(f,f))}let _=q_.createProjectPointsTo2DFunction(OD,f,h),m=q_.createProjectPointTo2DFunction(OD,f,h);t.tangent&&(c=d.clone(f,c)),t.bitangent&&(u=d.clone(h,u));let x=Un.polygonsFromHierarchy(n,r,_,!1),b=x.hierarchy,T=x.polygons,C=function(M){return M},A=r?Un.polygonsFromHierarchy(o,!0,C,!1).polygons:void 0;if(b.length===0)return;s=b[0].outerRing;let S=ae.fromPoints(s),v=Un.computeBoundingRectangle(a,m,s,i,Z$e),D=[];for(let M=0;M<T.length;M++){let L=new vt({geometry:aQe(T[M],t,v,i,r?A[M]:void 0,m,a,c,u)});D.push(L)}let O=Nn.combineInstances(D)[0];O.attributes.position.values=new Float64Array(O.attributes.position.values),O.indices=Ne.createTypedArray(O.attributes.position.values.length/3,O.indices);let R=O.attributes;return t.position||delete R.position,new st({attributes:R,indices:O.indices,primitiveType:O.primitiveType,boundingSphere:S})};var Y3=Yx;var Dfe=[],X3=[];function fQe(e,t,n,i,o){let s=ns.fromPoints(t,e).projectPointsOntoPlane(t,Dfe);si.computeWindingOrder2D(s)===gs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,h=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],x=t[(u+1)%f];c[h++]=m.x,c[h++]=m.y,c[h++]=m.z,c[h++]=x.x,c[h++]=x.y,c[h++]=x.z}else{let m=0;if(o===Jt.GEODESIC)for(u=0;u<f;u++)m+=Un.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===Jt.RHUMB)for(u=0;u<f;u++)m+=Un.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let x;o===Jt.GEODESIC?x=Un.subdivideLine(t[u],t[(u+1)%f],n,X3):o===Jt.RHUMB&&(x=Un.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,X3));let b=x.length;for(let T=0;T<b;++T)c[h++]=x[T]}}f=c.length/3;let p=f*2,_=Ne.createTypedArray(f,p);for(h=0,u=0;u<f-1;u++)_[h++]=u,_[h++]=u+1;return _[h++]=f-1,_[h++]=0,new vt({geometry:new st({attributes:new dn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:_,primitiveType:Me.LINES})})}function dQe(e,t,n,i,o){let s=ns.fromPoints(t,e).projectPointsOntoPlane(t,Dfe);si.computeWindingOrder2D(s)===gs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,h=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){h[u]=p/3;let b=t[u],T=t[(u+1)%f];c[p++]=b.x,c[p++]=b.y,c[p++]=b.z,c[p++]=T.x,c[p++]=T.y,c[p++]=T.z}else{let b=0;if(o===Jt.GEODESIC)for(u=0;u<f;u++)b+=Un.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===Jt.RHUMB)for(u=0;u<f;u++)b+=Un.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(b*3*2),u=0;u<f;++u){h[u]=p/3;let T;o===Jt.GEODESIC?T=Un.subdivideLine(t[u],t[(u+1)%f],n,X3):o===Jt.RHUMB&&(T=Un.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,X3));let C=T.length;for(let A=0;A<C;++A)c[p++]=T[A]}}f=c.length/(3*2);let _=h.length,m=(f*2+_)*2,x=Ne.createTypedArray(f+_,m);for(p=0,u=0;u<f;++u)x[p++]=u,x[p++]=(u+1)%f,x[p++]=u+f,x[p++]=(u+1)%f+f;for(u=0;u<_;u++){let b=h[u];x[p++]=b,x[p++]=b+f}return new vt({geometry:new st({attributes:new dn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Me.LINES})})}function Xx(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,ee.default),i=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.perPositionHeight,!1),r=o&&l(e.extrudedHeight),s=y(e.arcType,Jt.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!r){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=ee.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Un.computeHierarchyPackedLength(t,d)+ee.packedLength+8}Xx.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var hQe=ee.clone(ee.UNIT_SPHERE),mQe={polygonHierarchy:{}};Xx.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,hQe);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],h=e[t++],p=e[t];return l(n)||(n=new Xx(mQe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=h===-1?void 0:h,n.packedLength=p,n};Xx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new Xx(t)};Xx.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Un.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],u=P.chordLength(n,t.maximumRadius),f=e._height,h=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,h,0,P.EPSILON2),_,m;if(p)for(m=0;m<s.length;m++){if(a=dQe(t,s[m],u,o,r),a.geometry=Un.scaleToGeodeticHeightExtruded(a.geometry,f,h,t,o),l(e._offsetAttribute)){let T=a.geometry.attributes.position.values.length/3,C=new Uint8Array(T);e._offsetAttribute===rn.TOP?C=C.fill(1,0,T/2):(_=e._offsetAttribute===rn.NONE?0:1,C=C.fill(_)),a.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}c.push(a)}else for(m=0;m<s.length;m++){if(a=fQe(t,s[m],u,o,r),a.geometry.attributes.position.values=si.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let T=a.geometry.attributes.position.values.length;_=e._offsetAttribute===rn.NONE?0:1;let C=new Uint8Array(T/3).fill(_);a.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}c.push(a)}let x=Nn.combineInstances(c)[0],b=ae.fromVertices(x.attributes.position.values);return new st({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};var K3=Xx;var Ife="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Pfe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Rfe=new z,Ofe=d.ZERO,Mfe=new d,Lfe=new se,pQe=[],gQe=new U;function _Qe(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function yu(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new _Qe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(yu.prototype=Object.create(Gn.prototype),yu.prototype.constructor=yu);yu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Rfe)),l(s)||(s=z.WHITE),o.color=Gt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Ofe,Mfe)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new Y3(i):r=new E_(i),new vt({id:t,geometry:r,attributes:o})};yu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Rfe),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(o),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Ofe,Mfe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Ld(i):a=new K3(i),new vt({id:t,geometry:a,attributes:s})};yu.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=ns.fromPoints(i,o),s=r.projectPointsOntoPlane(i,pQe),a=s.length,c=0,u=a-1,f=new U;for(let p=0;p<a;u=p++){let _=s[p],m=s[u],x=_.x*m.y-m.x*_.y,b=U.add(_,m,gQe);b=U.multiplyByScalar(b,x,b),f=U.add(f,b,f),c+=x}let h=1/(c*3);return f=U.multiplyByScalar(f,h,f),r.projectPointOntoEllipsoid(f,t)};yu.prototype._isHidden=function(e,t){return!l(t.hierarchy)||oi.prototype._isHidden.call(this,e,t)};yu.prototype._isOnTerrain=function(e,t){let n=Gn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(He.MINIMUM_VALUE):!0);return n&&!o};yu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.textureCoordinates)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.perPositionHeight)||!q.isConstant(t.closeTop)||!q.isConstant(t.closeBottom)||!q.isConstant(t.zIndex)||!q.isConstant(t.arcType)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};yu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?an.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(He.MINIMUM_VALUE),r=q.getValueOrUndefined(t.height,He.MINIMUM_VALUE),s=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),a=q.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),c=q.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE),u=q.getValueOrDefault(t.perPositionHeight,He.MINIMUM_VALUE,!1);r=Gn.getGeometryHeight(r,s);let f;if(u?(l(r)&&(r=void 0,yt(Ife)),s!==Ye.NONE&&u&&(r=void 0,yt(Pfe))):(l(a)&&!l(r)&&(r=0),f=Gn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=q.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),i.stRotation=q.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=q.getValueOrDefault(t.closeTop,He.MINIMUM_VALUE,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,He.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=q.getValueOrDefault(t.arcType,He.MINIMUM_VALUE,Jt.GEODESIC),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,He.MINIMUM_VALUE),a=Gn.getGeometryExtrudedHeight(a,c),a===Gn.CLAMP_TO_GROUND){let h=E_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Lfe);a=ui.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=a};yu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};yu.DynamicGeometryUpdater=VA;function VA(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(VA.prototype=Object.create(ii.prototype),VA.prototype.constructor=VA);VA.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ii.prototype._isHidden.call(this,e,t,n)};VA.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=q.getValueOrUndefined(t.hierarchy,n);let o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,Ye.NONE),s=q.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),c=q.getValueOrUndefined(t.perPositionHeight,n);o=Gn.getGeometryHeight(o,s);let u;if(c?(l(o)&&(o=void 0,yt(Ife)),r!==Ye.NONE&&c&&(o=void 0,yt(Pfe))):(l(a)&&!l(o)&&(o=0),u=Gn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=q.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=q.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=q.getValueOrDefault(t.arcType,n,Jt.GEODESIC),a=Gn.getGeometryExtrudedHeight(a,s),a===Gn.CLAMP_TO_GROUND){let f=E_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Lfe);a=ui.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var Z3=yu;function yQe(e,t,n,i){let o=new dn;i.position&&(o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=si.triangulate(t),u=(a-1)*r*6+c.length*2,f=Ne.createTypedArray(s,u),h,p,_,m,x,b,T=r*2,C=0;for(h=0;h<a-1;h++){for(p=0;p<r-1;p++)_=p*2+h*r*2,b=_+T,m=_+1,x=m+T,f[C++]=m,f[C++]=_,f[C++]=x,f[C++]=x,f[C++]=_,f[C++]=b;_=r*2-2+h*r*2,m=_+1,x=m+T,b=_+T,f[C++]=m,f[C++]=_,f[C++]=x,f[C++]=x,f[C++]=_,f[C++]=b}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),D=1/(a-1),O=1/n.height,R=n.height/2,M,L,g=0;for(h=0;h<a;h++){for(M=h*D,L=O*(t[0].y+R),v[g++]=M,v[g++]=L,p=1;p<r;p++)L=O*(t[p].y+R),v[g++]=M,v[g++]=L,v[g++]=M,v[g++]=L;L=O*(t[0].y+R),v[g++]=M,v[g++]=L}for(p=0;p<r;p++)M=0,L=O*(t[p].y+R),v[g++]=M,v[g++]=L;for(p=0;p<r;p++)M=(a-1)*D,L=O*(t[p].y+R),v[g++]=M,v[g++]=L;o.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let A=s-r*2;for(h=0;h<c.length;h+=3){let v=c[h]+A,D=c[h+1]+A,O=c[h+2]+A;f[C++]=v,f[C++]=D,f[C++]=O,f[C++]=O+r,f[C++]=D+r,f[C++]=v+r}let S=new st({attributes:o,indices:f,boundingSphere:ae.fromVertices(e),primitiveType:Me.TRIANGLES});if(i.normal&&(S=Nn.computeNormal(S)),i.tangent||i.bitangent){try{S=Nn.computeTangentAndBitangent(S)}catch{yt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(S.attributes.tangent=void 0),i.bitangent||(S.attributes.bitangent=void 0),i.st||(S.attributes.st=void 0)}return S}function LD(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._cornerType=y(e.cornerType,Fi.ROUNDED),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+Ie.packedLength+2}LD.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Nfe=ee.clone(ee.UNIT_SPHERE),Ffe=new Ie,MD={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Nfe,vertexFormat:Ffe,cornerType:void 0,granularity:void 0};LD.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,Nfe);t+=ee.packedLength;let c=Ie.unpack(e,t,Ffe);t+=Ie.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(MD.polylinePositions=r,MD.shapePositions=s,MD.cornerType=u,MD.granularity=f,new LD(MD))};var xQe=new qe;LD.createGeometry=function(e){let t=e._positions,n=bo(t,d.equalsEpsilon),i=e._shape;if(i=cm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===gs.CLOCKWISE&&i.reverse();let o=qe.fromPoints(i,xQe),r=cm.computePositions(n,i,o,e,!0);return yQe(r,i,o,e._vertexFormat)};var $3=LD;function bQe(e,t){let n=new dn;n.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Ne.createTypedArray(o,2*i*(s+1)),c,u,f=0;c=0;let h=c*i;for(u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,c=s-1,h=c*i,u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,c=0;c<s-1;c++){let _=i*c,m=_+i;for(u=0;u<i;u++)a[f++]=u+_,a[f++]=u+m}return new st({attributes:n,indices:Ne.createTypedArray(o,a),boundingSphere:ae.fromVertices(e),primitiveType:Me.LINES})}function FD(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._cornerType=y(e.cornerType,Fi.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+2}FD.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Bfe=ee.clone(ee.UNIT_SPHERE),ND={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Bfe,height:void 0,cornerType:void 0,granularity:void 0};FD.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,Bfe);t+=ee.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(ND.polylinePositions=r,ND.shapePositions=s,ND.cornerType=c,ND.granularity=u,new FD(ND))};var TQe=new qe;FD.createGeometry=function(e){let t=e._positions,n=bo(t,d.equalsEpsilon),i=e._shape;if(i=cm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===gs.CLOCKWISE&&i.reverse();let o=qe.fromPoints(i,TQe),r=cm.computePositions(n,i,o,e,!1);return bQe(r,i)};var Q3=FD;var kfe=new z;function CQe(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function gm(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new CQe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(gm.prototype=Object.create(oi.prototype),gm.prototype.constructor=gm);gm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Bn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,kfe)),l(c)||(c=z.WHITE),o=Gt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new vt({id:t,geometry:new $3(this._options),attributes:i})};gm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,kfe),o=this._distanceDisplayConditionProperty.getValue(e);return new vt({id:t,geometry:new Q3(this._options),attributes:{show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o)}})};gm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||oi.prototype._isHidden.call(this,e,t)};gm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!q.isConstant(t.granularity)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)};gm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Ut;o.vertexFormat=r?an.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(He.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(He.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(He.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(He.MINIMUM_VALUE):void 0};gm.DynamicGeometryUpdater=UA;function UA(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(UA.prototype=Object.create(ii.prototype),UA.prototype.constructor=UA);UA.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ii.prototype._isHidden.call(this,e,t,n)};UA.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=q.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=q.getValueOrUndefined(t.shape,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n)};var J3=gm;var p7=new d,zfe=new d,Hfe=new d,Gfe=new d,Wfe=new se,AQe=new U,EQe=new ae,SQe=new ae;function jfe(e,t){let n=new st({attributes:new dn,primitiveType:Me.TRIANGLES});return n.attributes.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function vQe(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,u=Gfe,f=Hfe,h=zfe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let _=d.fromArray(e,p,p7),m=c+1,x=c+2;h=n.geodeticSurfaceNormal(_,h),(t.tangent||t.bitangent)&&(d.cross(d.UNIT_Z,h,f),$.multiplyByVector(i,f,f),d.normalize(f,f),t.bitangent&&d.normalize(d.cross(h,f,u),u)),t.normal&&(r[c]=h.x,r[m]=h.y,r[x]=h.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[x]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[x]=u.z),c+=3}return jfe(t,{positions:e,normals:r,tangents:s,bitangents:a})}var g7=new d,qfe=new d;function wQe(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,h=Gfe,p=Hfe,_=zfe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let x=d.fromArray(e,m,p7),b=d.fromArray(e,(m+6)%i,g7);if(f){let T=d.fromArray(e,(m+3)%i,qfe);d.subtract(b,x,b),d.subtract(T,x,T),_=d.normalize(d.cross(T,b,_),_),f=!1}d.equalsEpsilon(b,x,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(x,h),t.tangent&&(p=d.normalize(d.cross(h,_,p),p))),t.normal&&(o[a++]=_.x,o[a++]=_.y,o[a++]=_.z,o[a++]=_.x,o[a++]=_.y,o[a++]=_.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[u++]=h.x,s[u++]=h.y,s[u++]=h.z,s[u++]=h.x,s[u++]=h.y,s[u++]=h.z)}return jfe(t,{positions:e,normals:o,tangents:r,bitangents:s})}function Yfe(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,u=o,f=o,h=0;s&&(c=1,f-=1,h+=1),a&&(u-=1,f-=1,h+=1),h+=r*f;let p=n.position?new Float64Array(h*3):void 0,_=n.st?new Float32Array(h*2):void 0,m=0,x=0,b=p7,T=AQe,C=Number.MAX_VALUE,A=Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let E=c;E<u;++E)for(let w=0;w<r;++w)Us.computePosition(t,i,n.st,E,w,b,T),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(_[x++]=T.x,_[x++]=T.y,C=Math.min(C,T.x),A=Math.min(A,T.y),S=Math.max(S,T.x),v=Math.max(v,T.y));if(s&&(Us.computePosition(t,i,n.st,0,0,b,T),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(_[x++]=T.x,_[x++]=T.y,C=T.x,A=T.y,S=T.x,v=T.y)),a&&(Us.computePosition(t,i,n.st,o-1,0,b,T),p[m++]=b.x,p[m++]=b.y,p[m]=b.z,n.st&&(_[x++]=T.x,_[x]=T.y,C=Math.min(C,T.x),A=Math.min(A,T.y),S=Math.max(S,T.x),v=Math.max(v,T.y))),n.st&&(C<0||A<0||S>1||v>1))for(let E=0;E<_.length;E+=2)_[E]=(_[E]-C)/(S-C),_[E+1]=(_[E+1]-A)/(v-A);let D=vQe(p,n,i,t.tangentRotationMatrix),O=6*(r-1)*(f-1);s&&(O+=3*(r-1)),a&&(O+=3*(r-1));let R=Ne.createTypedArray(h,O),M=0,L=0,g;for(g=0;g<f-1;++g){for(let E=0;E<r-1;++E){let w=M,I=w+r,N=I+1,B=w+1;R[L++]=w,R[L++]=I,R[L++]=B,R[L++]=B,R[L++]=I,R[L++]=N,++M}++M}if(s||a){let E=h-1,w=h-1;s&&a&&(E=h-2);let I,N;if(M=0,s)for(g=0;g<r-1;g++)I=M,N=I+1,R[L++]=E,R[L++]=I,R[L++]=N,++M;if(a)for(M=(f-1)*r,g=0;g<r-1;g++)I=M,N=I+1,R[L++]=I,R[L++]=w,R[L++]=N,++M}return D.indices=R,n.st&&(D.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:_})),D}function zA(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function HA(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var _7=new Ie;function DQe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Be=Ie.clone(o,_7);Be.normal=!0,e._vertexFormat=Be}let h=Yfe(e,t);n&&(e._vertexFormat=o);let p=si.scaleToGeodeticHeight(h.attributes.position.values,s,a,!1);p=new Float64Array(p);let _=p.length,m=_*2,x=new Float64Array(m);x.set(p);let b=si.scaleToGeodeticHeight(h.attributes.position.values,r,a);x.set(b,_),h.attributes.position.values=x;let T=o.normal?new Float32Array(m):void 0,C=o.tangent?new Float32Array(m):void 0,A=o.bitangent?new Float32Array(m):void 0,S=o.st?new Float32Array(m/3*2):void 0,v,D;if(o.normal){for(D=h.attributes.normal.values,T.set(D),f=0;f<_;f++)D[f]=-D[f];T.set(D,_),h.attributes.normal.values=T}if(n){D=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let Be=new Float32Array(m);for(f=0;f<_;f++)D[f]=-D[f];Be.set(D,_),h.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:Be})}let O,R=l(i);if(R){let Be=_/3*2,qt=new Uint8Array(Be);i===rn.TOP?qt=qt.fill(1,0,Be/2):(O=i===rn.NONE?0:1,qt=qt.fill(O)),h.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:qt})}if(o.tangent){let Be=h.attributes.tangent.values;for(C.set(Be),f=0;f<_;f++)Be[f]=-Be[f];C.set(Be,_),h.attributes.tangent.values=C}if(o.bitangent){let Be=h.attributes.bitangent.values;A.set(Be),A.set(Be,_),h.attributes.bitangent.values=A}o.st&&(v=h.attributes.st.values,S.set(v),S.set(v,_/3*2),h.attributes.st.values=S);let M=h.indices,L=M.length,g=_/3,E=Ne.createTypedArray(m/3,L*2);for(E.set(M),f=0;f<L;f+=3)E[f+L]=M[f+2]+g,E[f+1+L]=M[f+1]+g,E[f+2+L]=M[f]+g;h.indices=E;let w=t.northCap,I=t.southCap,N=c,B=2,H=0,V=4,G=4;w&&(B-=1,N-=1,H+=1,V-=2,G-=1),I&&(B-=1,N-=1,H+=1,V-=2,G-=1),H+=B*u+2*N-V;let k=(H+G)*2,W=new Float64Array(k*3),Y=n?new Float32Array(k*3):void 0,J=R?new Uint8Array(k):void 0,j=o.st?new Float32Array(k*2):void 0,K=i===rn.TOP;R&&!K&&(O=i===rn.ALL?1:0,J=J.fill(O));let Q=0,de=0,xe=0,ce=0,_e=u*N,be;for(f=0;f<_e;f+=u)be=f*3,W=zA(W,Q,be,p,b),Q+=6,o.st&&(j=HA(j,de,f*2,v),de+=4),n&&(xe+=3,Y[xe++]=D[be],Y[xe++]=D[be+1],Y[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1);if(I){let Be=w?_e+1:_e;for(be=Be*3,f=0;f<2;f++)W=zA(W,Q,be,p,b),Q+=6,o.st&&(j=HA(j,de,Be*2,v),de+=4),n&&(xe+=3,Y[xe++]=D[be],Y[xe++]=D[be+1],Y[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1)}else for(f=_e-u;f<_e;f++)be=f*3,W=zA(W,Q,be,p,b),Q+=6,o.st&&(j=HA(j,de,f*2,v),de+=4),n&&(xe+=3,Y[xe++]=D[be],Y[xe++]=D[be+1],Y[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1);for(f=_e-1;f>0;f-=u)be=f*3,W=zA(W,Q,be,p,b),Q+=6,o.st&&(j=HA(j,de,f*2,v),de+=4),n&&(xe+=3,Y[xe++]=D[be],Y[xe++]=D[be+1],Y[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1);if(w){let Be=_e;for(be=Be*3,f=0;f<2;f++)W=zA(W,Q,be,p,b),Q+=6,o.st&&(j=HA(j,de,Be*2,v),de+=4),n&&(xe+=3,Y[xe++]=D[be],Y[xe++]=D[be+1],Y[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1)}else for(f=u-1;f>=0;f--)be=f*3,W=zA(W,Q,be,p,b),Q+=6,o.st&&(j=HA(j,de,f*2,v),de+=4),n&&(xe+=3,Y[xe++]=D[be],Y[xe++]=D[be+1],Y[xe++]=D[be+2]),K&&(J[ce++]=1,ce+=1);let De=wQe(W,o,a);o.st&&(De.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:j})),n&&(De.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:Y})),R&&(De.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:J}));let Ae=Ne.createTypedArray(k,H*6),ke,ze,et,Et;_=W.length/3;let ht=0;for(f=0;f<_-1;f+=2){ke=f,Et=(ke+2)%_;let Be=d.fromArray(W,ke*3,g7),qt=d.fromArray(W,Et*3,qfe);d.equalsEpsilon(Be,qt,P.EPSILON10)||(ze=(ke+1)%_,et=(ze+2)%_,Ae[ht++]=ke,Ae[ht++]=ze,Ae[ht++]=Et,Ae[ht++]=Et,Ae[ht++]=ze,Ae[ht++]=et)}return De.indices=Ae,De=Nn.combineInstances([new vt({geometry:h}),new vt({geometry:De})]),De[0]}var IQe=[new d,new d,new d,new d],Xfe=new fe,PQe=new fe;function y7(e,t,n,i,o){if(n===0)return se.clone(e,o);let r=Us.computeOptions(e,t,n,0,Wfe,Xfe),s=r.height,a=r.width,c=IQe;return Us.computePosition(r,i,!1,0,0,c[0]),Us.computePosition(r,i,!1,0,a-1,c[1]),Us.computePosition(r,i,!1,s-1,0,c[2]),Us.computePosition(r,i,!1,s-1,a-1,c[3]),se.fromCartesianArray(c,i,o)}function _m(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=se.clone(t),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}_m.packedLength=se.packedLength+ee.packedLength+Ie.packedLength+7;_m.pack=function(e,t,n){return n=y(n,0),se.pack(e._rectangle,t,n),n+=se.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Kfe=new se,Zfe=ee.clone(ee.UNIT_SPHERE),gy={rectangle:Kfe,ellipsoid:Zfe,vertexFormat:_7,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};_m.unpack=function(e,t,n){t=y(t,0);let i=se.unpack(e,t,Kfe);t+=se.packedLength;let o=ee.unpack(e,t,Zfe);t+=ee.packedLength;let r=Ie.unpack(e,t,_7);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++]===1,p=e[t];return l(n)?(n._rectangle=se.clone(i,n._rectangle),n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=h,n._offsetAttribute=p===-1?void 0:p,n):(gy.granularity=s,gy.height=a,gy.rotation=c,gy.stRotation=u,gy.extrudedHeight=f,gy.shadowVolume=h,gy.offsetAttribute=p===-1?void 0:p,new _m(gy))};_m.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.ellipsoid,ee.default),r=y(e.rotation,0);return y7(n,i,r,o,t)};var RQe=new $,Vfe=new Oe,OQe=new fe;_m.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Us.computeOptions(t,e._granularity,i,o,Wfe,Xfe,PQe),a=RQe;if(o!==0||i!==0){let _=se.center(t,OQe),m=n.geodeticSurfaceNormalCartographic(_,g7);Oe.fromAxisAngle(m,-o,Vfe),$.fromQuaternion(Vfe,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!P.equalsEpsilon(c,u,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let h,p;if(t=e._rectangle,f){h=DQe(e,s);let _=ae.fromRectangle3D(t,n,c,SQe),m=ae.fromRectangle3D(t,n,u,EQe);p=ae.union(_,m)}else{if(h=Yfe(e,s),h.attributes.position.values=si.scaleToGeodeticHeight(h.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let _=h.attributes.position.values.length,m=e._offsetAttribute===rn.NONE?0:1,x=new Uint8Array(_/3).fill(m);h.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=ae.fromRectangle3D(t,n,c)}return r.position||delete h.attributes.position,new st({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};_m.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new _m({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};var Ufe=new se,MQe=[new U,new U,new U],LQe=new Ri,NQe=new fe;function FQe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=se.clone(e._rectangle,Ufe),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=y7(t,n,o,i,Ufe),s=MQe;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=Ri.fromRotation(e._stRotation,LQe),u=se.center(a,NQe);for(let m=0;m<3;++m){let x=s[m];x.x-=u.longitude,x.y-=u.latitude,Ri.multiplyByVector(c,x,x),x.x+=u.longitude,x.y+=u.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let f=s[0],h=s[1],p=s[2],_=new Array(6);return U.pack(f,_),U.pack(h,_,2),U.pack(p,_,4),_}Object.defineProperties(_m.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=y7(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=FQe(this)),this._textureCoordinateRotationPoints}}});var GA=_m;var $fe=new z,Qfe=d.ZERO,Jfe=new d,ede=new se,BQe=new se,kQe=new fe;function VQe(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function zd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new VQe(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(zd.prototype=Object.create(Gn.prototype),zd.prototype.constructor=zd);zd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,$fe)),l(o)||(o=z.WHITE),i.color=Gt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Qfe,Jfe))),new vt({id:t,geometry:new GA(this._options),attributes:i})};zd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,$fe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Qfe,Jfe))),new vt({id:t,geometry:new JC(this._options),attributes:r})};zd.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.rectangle.coordinates,e,BQe);if(!l(n))return;let i=se.center(n,kQe);return fe.toCartesian(i,ee.default,t)};zd.prototype._isHidden=function(e,t){return!l(t.coordinates)||oi.prototype._isHidden.call(this,e,t)};zd.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.rotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};zd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=q.getValueOrUndefined(t.height,He.MINIMUM_VALUE),o=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),r=q.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),s=q.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?an.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(He.MINIMUM_VALUE,a.rectangle),a.granularity=q.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),a.stRotation=q.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),a.rotation=q.getValueOrUndefined(t.rotation,He.MINIMUM_VALUE),a.offsetAttribute=Gn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Gn.getGeometryHeight(i,o),r=Gn.getGeometryExtrudedHeight(r,s),r===Gn.CLAMP_TO_GROUND&&(r=ui.getMinimumMaximumHeights(GA.computeRectangle(a,ede)).minimumTerrainHeight),a.extrudedHeight=r};zd.DynamicGeometryUpdater=WA;function WA(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(WA.prototype=Object.create(ii.prototype),WA.prototype.constructor=WA);WA.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ii.prototype._isHidden.call(this,e,t,n)};WA.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,Ye.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=q.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(GA.computeRectangle(i,ede)).minimumTerrainHeight),i.extrudedHeight=s};var ek=zd;var tde={};function UQe(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var zQe=new fe,HQe=new fe;function GQe(e,t,n,i){t=bo(t,d.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),u=new Array(o),f=t[0];a[0]=f;let h=e.cartesianToCartographic(f,zQe);s&&(h.height=n[0]),c[0]=h.height,r?u[0]=i[0]:u[0]=0;let p=c[0],_=u[0],m=p===_,x=1;for(let b=1;b<o;++b){let T=t[b],C=e.cartesianToCartographic(T,HQe);s&&(C.height=n[b]),m=m&&C.height===0,UQe(h,C)?h.height<C.height&&(c[x-1]=C.height):(a[x]=T,c[x]=C.height,r?u[x]=i[b]:u[x]=0,m=m&&c[x]===u[x],fe.clone(C,h),++x)}if(!(m||x<2))return a.length=x,c.length=x,u.length=x,{positions:a,topHeights:c,bottomHeights:u}}var WQe=new Array(2),jQe=new Array(2),qQe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};tde.computePositions=function(e,t,n,i,o,r){let s=GQe(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,h=P.chordLength(o,e.maximumRadius),p=qQe;if(p.minDistance=h,p.ellipsoid=e,r){let _=0,m;for(m=0;m<a-1;m++)_+=Ni.numberOfPoints(t[m],t[m+1],h)+1;u=new Float64Array(_*3),f=new Float64Array(_*3);let x=WQe,b=jQe;p.positions=x,p.height=b;let T=0;for(m=0;m<a-1;m++){x[0]=t[m],x[1]=t[m+1],b[0]=n[m],b[1]=n[m+1];let C=Ni.generateArc(p);u.set(C,T),b[0]=i[m],b[1]=i[m+1],f.set(Ni.generateArc(p),T),T+=C.length}}else p.positions=t,p.height=n,u=new Float64Array(Ni.generateArc(p)),p.height=i,f=new Float64Array(Ni.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var jA=tde;var x7=new d,tk=new d,YQe=new d,nde=new d,XQe=new d,KQe=new d,ZQe=new d;function Kx(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.ellipsoid,ee.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Ie.clone(o),this._granularity=r,this._ellipsoid=ee.clone(s),this._workerName="createWallGeometry";let a=1+t.length*d.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ee.packedLength+Ie.packedLength+1}Kx.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._granularity,t};var ide=ee.clone(ee.UNIT_SPHERE),ode=new Ie,BD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:ide,vertexFormat:ode,granularity:void 0};Kx.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ee.unpack(e,t,ide);t+=ee.packedLength;let u=Ie.unpack(e,t,ode);t+=Ie.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._vertexFormat=Ie.clone(u,n._vertexFormat),n._granularity=f,n):(BD.positions=r,BD.minimumHeights=s,BD.maximumHeights=a,BD.granularity=f,new Kx(BD))};Kx.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new Kx(c)};Kx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=jA.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,h=u.length,p=h*2,_=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,x=o.tangent?new Float32Array(p):void 0,b=o.bitangent?new Float32Array(p):void 0,T=o.st?new Float32Array(p/3*2):void 0,C=0,A=0,S=0,v=0,D=0,O=ZQe,R=KQe,M=XQe,L=!0;h/=3;let g,E=0,w=1/(h-f-1);for(g=0;g<h;++g){let V=g*3,G=d.fromArray(u,V,x7),k=d.fromArray(c,V,tk);if(o.position&&(_[C++]=k.x,_[C++]=k.y,_[C++]=k.z,_[C++]=G.x,_[C++]=G.y,_[C++]=G.z),o.st&&(T[D++]=E,T[D++]=0,T[D++]=E,T[D++]=1),o.normal||o.tangent||o.bitangent){let W=d.clone(d.ZERO,nde),Y=d.subtract(G,s.geodeticSurfaceNormal(G,tk),tk);if(g+1<h&&(W=d.fromArray(u,V+3,nde)),L){let J=d.subtract(W,G,YQe),j=d.subtract(Y,G,x7);O=d.normalize(d.cross(j,J,O),O),L=!1}d.equalsEpsilon(G,W,P.EPSILON10)?L=!0:(E+=w,o.tangent&&(R=d.normalize(d.subtract(W,G,R),R)),o.bitangent&&(M=d.normalize(d.cross(O,R,M),M))),o.normal&&(m[A++]=O.x,m[A++]=O.y,m[A++]=O.z,m[A++]=O.x,m[A++]=O.y,m[A++]=O.z),o.tangent&&(x[v++]=R.x,x[v++]=R.y,x[v++]=R.z,x[v++]=R.x,x[v++]=R.y,x[v++]=R.z),o.bitangent&&(b[S++]=M.x,b[S++]=M.y,b[S++]=M.z,b[S++]=M.x,b[S++]=M.y,b[S++]=M.z)}}let I=new dn;o.position&&(I.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:_})),o.normal&&(I.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(I.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),o.bitangent&&(I.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(I.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T}));let N=p/3;p-=6*(f+1);let B=Ne.createTypedArray(N,p),H=0;for(g=0;g<N-2;g+=2){let V=g,G=g+2,k=d.fromArray(_,V*3,x7),W=d.fromArray(_,G*3,tk);if(d.equalsEpsilon(k,W,P.EPSILON10))continue;let Y=g+1,J=g+3;B[H++]=Y,B[H++]=V,B[H++]=J,B[H++]=J,B[H++]=V,B[H++]=G}return new st({attributes:I,indices:B,primitiveType:Me.TRIANGLES,boundingSphere:new ae.fromVertices(_)})};var nk=Kx;var rde=new d,sde=new d;function Zx(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.ellipsoid,ee.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ee.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*d.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ee.packedLength+1}Zx.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n]=e._granularity,t};var ade=ee.clone(ee.UNIT_SPHERE),kD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:ade,granularity:void 0};Zx.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ee.unpack(e,t,ade);t+=ee.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._granularity=u,n):(kD.positions=r,kD.minimumHeights=s,kD.maximumHeights=a,kD.granularity=u,new Zx(kD))};Zx.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new Zx(c)};Zx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=jA.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,h=new Float64Array(f),p=0;u/=3;let _;for(_=0;_<u;++_){let C=_*3,A=d.fromArray(c,C,rde),S=d.fromArray(a,C,sde);h[p++]=S.x,h[p++]=S.y,h[p++]=S.z,h[p++]=A.x,h[p++]=A.y,h[p++]=A.z}let m=new dn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:h})}),x=f/3;f=2*x-4+x;let b=Ne.createTypedArray(x,f),T=0;for(_=0;_<x-2;_+=2){let C=_,A=_+2,S=d.fromArray(h,C*3,rde),v=d.fromArray(h,A*3,sde);if(d.equalsEpsilon(S,v,P.EPSILON10))continue;let D=_+1,O=_+3;b[T++]=D,b[T++]=C,b[T++]=D,b[T++]=O,b[T++]=C,b[T++]=A}return b[T++]=x-2,b[T++]=x-1,new st({attributes:m,indices:b,primitiveType:Me.LINES,boundingSphere:new ae.fromVertices(h)})};var ik=Zx;var cde=new z;function $Qe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Hd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new $Qe(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Hd.prototype=Object.create(oi.prototype),Hd.prototype.constructor=Hd);Hd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Bn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,cde)),l(c)||(c=z.WHITE),o=Gt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new vt({id:t,geometry:new nk(this._options),attributes:i})};Hd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,cde),o=this._distanceDisplayConditionProperty.getValue(e);return new vt({id:t,geometry:new ik(this._options),attributes:{show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o)}})};Hd.prototype._isHidden=function(e,t){return!l(t.positions)||oi.prototype._isHidden.call(this,e,t)};Hd.prototype._getIsClosed=function(e){return!1};Hd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.minimumHeights)||!q.isConstant(t.maximumHeights)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.granularity)};Hd.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Ut,s=this._options;s.vertexFormat=r?an.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(He.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(He.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(He.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(He.MINIMUM_VALUE):void 0};Hd.DynamicGeometryUpdater=qA;function qA(e,t,n){ii.call(this,e,t,n)}l(Object.create)&&(qA.prototype=Object.create(ii.prototype),qA.prototype.constructor=qA);qA.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ii.prototype._isHidden.call(this,e,t,n)};qA.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=q.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=q.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=q.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=q.getValueOrUndefined(t.granularity,n)};var ok=Hd;var $x=[GL,_3,l3,V3,U3,q3,Z3,J3,ek,ok];function Qx(e,t){this.entity=e,this.scene=t;let n=new Array($x.length),i=new pe,o=new _r;for(let r=0;r<n.length;r++){let s=new $x[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(Qx.prototype._onEntityPropertyChanged,this)}Qx.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};Qx.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};Qx.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};Qx.registerUpdater=function(e){$x.includes(e)||$x.push(e)};Qx.unregisterUpdater=function(e){if($x.includes(e)){let t=$x.indexOf(e);$x.splice(t,1)}};var YA=Qx;var lde=new z,QQe=new Mt,JQe=new Mt,eJe=d.ZERO,tJe=new d;function Gd(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.updaters=new St,this.updatersWithAttributes=new St,this.attributes=new St,this.subscriptions=new St,this.showsUpdated=new St,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(Gd.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Gd.prototype.onMaterialChanged=function(){this.invalidated=!0};Gd.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Gd.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Gd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Gd.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=ir.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=ir.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||c){let b=u.fillMaterialProperty.color,T=q.getValueOrDefault(b,e,z.WHITE,lde);z.equals(h._lastColor,T)||(h._lastColor=z.clone(T,h._lastColor),h.color=Gt.toValue(T,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Ut&&(!u.depthFailMaterialProperty.isConstant||c)){let b=u.depthFailMaterialProperty.color,T=q.getValueOrDefault(b,e,z.WHITE,lde);z.equals(h._lastDepthFailColor,T)||(h._lastDepthFailColor=z.clone(T,h._lastDepthFailColor),h.depthFailColor=Gt.toValue(T,h.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let b=q.getValueOrDefault(m,e,JQe,QQe);Mt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(b,h.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,eJe,tJe);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Qi.toValue(b,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Gd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=yn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Gd.prototype.contains=function(e){return this.updaters.contains(e.id)};Gd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?at.FAILED:(i.boundingSphere.clone(t),at.DONE)};Gd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function XA(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}XA.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new Gd(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function ude(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}XA.prototype.remove=function(e){ude(this._solidItems,e)||ude(this._translucentItems,e)};function fde(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function rk(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}XA.prototype.update=function(e){let t=rk(this,this._solidItems,e,!0);t=rk(this,this._translucentItems,e,t)&&t;let n=fde(this,this._solidItems,e),i=fde(this,this._translucentItems,e);return(n||i)&&(t=rk(this,this._solidItems,e,t)&&t,t=rk(this,this._translucentItems,e,t)&&t),t};function dde(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return at.FAILED}XA.prototype.getBoundingSphere=function(e,t){let n=dde(this._solidItems,e,t);return n===at.FAILED?dde(this._translucentItems,e,t):n};function hde(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}XA.prototype.removeAllPrimitives=function(){hde(this._solidItems),hde(this._translucentItems)};var Wd=XA;var nJe=new Mt,iJe=new Mt,oJe=d.ZERO,rJe=new d;function jd(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new St,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new St,this.attributes=new St,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(jd.prototype.onMaterialChanged,this),this.subscriptions=new St,this.showsUpdated=new St}jd.prototype.onMaterialChanged=function(){this.invalidated=!0};jd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};jd.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty)||!q.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};jd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var sJe=new z;jd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=ir.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=ir.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=ir.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=ir.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Ut&&!c.depthFailMaterialProperty.isConstant){let b=c.depthFailMaterialProperty.color,T=q.getValueOrDefault(b,e,z.WHITE,sJe);z.equals(h._lastDepthFailColor,T)||(h._lastDepthFailColor=z.clone(T,h._lastDepthFailColor),h.depthFailColor=Gt.toValue(T,h.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let b=q.getValueOrDefault(m,e,iJe,nJe);Mt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(b,h.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,oJe,rJe);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Qi.toValue(b,h.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};jd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=yn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};jd.prototype.contains=function(e){return this.updaters.contains(e.id)};jd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?at.FAILED:(i.boundingSphere.clone(t),at.DONE)};jd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function KA(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}KA.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new jd(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};KA.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};KA.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};KA.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return at.FAILED};KA.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var qd=KA;var pde=Ur(mde(),1);function sk(){this._tree=new pde.default}function Jx(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}Jx.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};sk.prototype.insert=function(e,t){let n=Jx.fromRectangleAndId(e,t,new Jx);this._tree.insert(n)};function aJe(e,t){return e.id===t.id}var cJe=new Jx;sk.prototype.remove=function(e,t){let n=Jx.fromRectangleAndId(e,t,cJe);this._tree.remove(n,aJe)};var lJe=new Jx;sk.prototype.collides=function(e){let t=Jx.fromRectangleAndId("",e,lJe);return this._tree.collides(t)};var ZA=sk;var uJe=new z,fJe=new Mt,dJe=new Mt;function ig(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.updaters=new St,this.updatersWithAttributes=new St,this.attributes=new St,this.subscriptions=new St,this.showsUpdated=new St,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new ZA}ig.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};ig.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};ig.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};ig.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new gl({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||c){let x=u.fillMaterialProperty.color,b=q.getValueOrDefault(x,e,z.WHITE,uJe);z.equals(h._lastColor,b)||(h._lastColor=z.clone(b,h._lastColor),h.color=Gt.toValue(b,h.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let x=q.getValueOrDefault(m,e,dJe,fJe);Mt.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(x,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};ig.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=yn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};ig.prototype.contains=function(e){return this.updaters.contains(e.id)};ig.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),at.DONE):at.FAILED};ig.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function $A(e,t){this._batches=[],this._primitives=e,this._classificationType=t}$A.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=q.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new ig(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};$A.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};$A.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};$A.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return at.FAILED};$A.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var VD=$A;var hJe=new Mt,mJe=new Mt;function zf(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new St,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.material=void 0,this.updatersWithAttributes=new St,this.attributes=new St,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(zf.prototype.onMaterialChanged,this),this.subscriptions=new St,this.showsUpdated=new St,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new ZA}zf.prototype.onMaterialChanged=function(){this.invalidated=!0};zf.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};zf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:l(t)&&t.equals(n)};zf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};zf.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};zf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=ir.getValue(e,this.materialProperty,this.material),n=new gl({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=ir.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let x=q.getValueOrDefault(m,e,mJe,hJe);Mt.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(x,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};zf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=yn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};zf.prototype.contains=function(e){return this.updaters.contains(e.id)};zf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?at.FAILED:(i.boundingSphere.clone(t),at.DONE)};zf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function QA(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}QA.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=of.shouldUseSphericalCoordinates(o.geometry.rectangle),s=q.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new zf(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};QA.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};QA.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};QA.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return at.FAILED};QA.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var ak=QA;var pJe=new z,gJe=new Mt,_Je=new Mt,yJe=d.ZERO,xJe=new d;function og(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.updaters=new St,this.updatersWithAttributes=new St,this.attributes=new St,this.itemsToRemove=[],this.subscriptions=new St,this.showsUpdated=new St}og.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};og.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};og.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new an({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.outlineColorProperty.isConstant||c){let b=u.outlineColorProperty,T=q.getValueOrDefault(b,e,z.WHITE,pJe);z.equals(h._lastColor,T)||(h._lastColor=z.clone(T,h._lastColor),h.color=Gt.toValue(T,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let b=q.getValueOrDefault(m,e,_Je,gJe);Mt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(b,h.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,yJe,xJe);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Qi.toValue(b,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};og.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=yn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};og.prototype.contains=function(e){return this.updaters.contains(e.id)};og.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?at.FAILED:(i.boundingSphere.clone(t),at.DONE)};og.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function JA(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new St,this._translucentBatches=new St}JA.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new og(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new og(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};JA.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};JA.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,u,f=!0,h=!1;do{for(h=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(h);return f};JA.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return at.FAILED};JA.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var UD=JA;var bJe=[];function Pl(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new St,this._removedObjects=new St,this._changedObjects=new St;let o=xn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=or.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new UD(n,e,s,!1),this._outlineBatches[o+s]=new UD(n,e,s,!0),this._closedColorBatches[s]=new Wd(n,an,void 0,!0,s,!0),this._closedColorBatches[o+s]=new Wd(n,an,void 0,!0,s,!1),this._closedMaterialBatches[s]=new qd(n,ao,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new qd(n,ao,void 0,!0,s,!1),this._openColorBatches[s]=new Wd(n,an,void 0,!1,s,!0),this._openColorBatches[o+s]=new Wd(n,an,void 0,!1,s,!1),this._openMaterialBatches[s]=new qd(n,ao,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new qd(n,ao,void 0,!1,s,!1);let a=kn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new ak(i,s,ao)),c[s]=new VD(i,s);else for(s=0;s<a;++s)c[s]=new VD(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new RA(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new St,this._updaterSets=new St,this._entityCollection=t,t.collectionChanged.addEventListener(Pl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,bJe)}Pl.registerUpdater=function(e){YA.registerUpdater(e)};Pl.unregisterUpdater=function(e){YA.unregisterUpdater(e)};Pl.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f,h=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(x){h._removeUpdater(x),h._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new YA(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(x){h._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Pl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,_=this._batches,m=_.length;for(a=0;a<m;a++)p=_[a].update(e)&&p;return p};var TJe=[],CJe=new ae;Pl.prototype.getBoundingSphere=function(e,t){let n=TJe,i=CJe,o=0,r=at.DONE,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let h=u[f];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(h,i),r===at.PENDING)return at.PENDING;r===at.DONE&&(n[o]=ae.clone(i,n[o]),o++)}}return o===0?at.FAILED:(n.length=o,ae.fromBoundingSpheres(n,t),at.DONE)};Pl.prototype.isDestroyed=function(){return!1};Pl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Pl.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),ue(this)};Pl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Pl.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=xn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Ut?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Ut?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Ut?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Pl._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Pl.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var ck=Pl;var AJe=1,EJe="30px sans-serif",SJe=Xo.FILL,vJe=z.WHITE,wJe=z.BLACK,DJe=1,IJe=!1,PJe=new z(.165,.165,.165,.8),RJe=new U(7,5),OJe=U.ZERO,MJe=d.ZERO,LJe=Ye.NONE,NJe=xi.CENTER,FJe=On.CENTER,BJe=new d,kJe=new z,VJe=new z,UJe=new z,zJe=new U,HJe=new d,GJe=new U,WJe=new Bt,jJe=new Bt,qJe=new Bt,YJe=new Mt;function gde(e){this.entity=e,this.label=void 0,this.index=void 0}function _y(e,t){t.collectionChanged.addEventListener(_y.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new St,this._onCollectionChanged(t,t.values,[],[])}_y.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,u=r.label,f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),h;if(f&&(h=q.getValueOrUndefined(s._position,e,BJe),c=q.getValueOrUndefined(a._text,e),f=l(h)&&l(c)),!f){C7(r,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,_=q.getValueOrDefault(a._heightReference,e,LJe);l(u)||(u=n.getLabel(s),u.id=s,r.label=u,p=d.equals(u.position,h)&&u.heightReference===_),u.show=!0,u.position=h,u.text=c,u.scale=q.getValueOrDefault(a._scale,e,AJe),u.font=q.getValueOrDefault(a._font,e,EJe),u.style=q.getValueOrDefault(a._style,e,SJe),u.fillColor=q.getValueOrDefault(a._fillColor,e,vJe,kJe),u.outlineColor=q.getValueOrDefault(a._outlineColor,e,wJe,VJe),u.outlineWidth=q.getValueOrDefault(a._outlineWidth,e,DJe),u.showBackground=q.getValueOrDefault(a._showBackground,e,IJe),u.backgroundColor=q.getValueOrDefault(a._backgroundColor,e,PJe,UJe),u.backgroundPadding=q.getValueOrDefault(a._backgroundPadding,e,RJe,zJe),u.pixelOffset=q.getValueOrDefault(a._pixelOffset,e,OJe,GJe),u.eyeOffset=q.getValueOrDefault(a._eyeOffset,e,MJe,HJe),u.heightReference=_,u.horizontalOrigin=q.getValueOrDefault(a._horizontalOrigin,e,NJe),u.verticalOrigin=q.getValueOrDefault(a._verticalOrigin,e,FJe),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,WJe),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,jJe),u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,qJe),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,YJe),u.disableDepthTestDistance=q.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};_y.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return at.FAILED;let i=n.label;return t.center=d.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,at.DONE};_y.prototype.isDestroyed=function(){return!1};_y.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_y.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};_y.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new gde(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new gde(r)):(C7(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],C7(s.get(r.id),r,a),s.remove(r.id)};function C7(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var lk=_y;var XJe=1,KJe=!0,ZJe=0,$Je=!0,QJe=!0,JJe=xn.ENABLED,eet=Ye.NONE,tet=z.RED,net=0,iet=z.WHITE,oet=Bc.HIGHLIGHT,ret=.5,set=new U(1,1),_de={maximumPositionEpsilon:Number.POSITIVE_INFINITY},aet=new F,cet=new F,yde=new z,xde=new Array(4),uet=new d;function yy(e,t){t.collectionChanged.addEventListener(yy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new St,this._onCollectionChanged(t,t.values,[],[])}async function fet(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await tm.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}yy.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),h;if(f&&(h=s.computeModelMatrix(e,aet),c=Se.createIfNeeded(q.getValueOrUndefined(a._uri,e)),f=l(h)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{..._de}},n[s.id]=u;let m=q.getValueOrDefault(a._incrementallyLoadTextures,e,$Je),x=q.getValueOrDefault(a._environmentMapOptions,e,_de,u.environmentMapOptionsScratch);fet(this,s,c,m,x)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=q.getValueOrDefault(a._scale,e,XJe),p.enableVerticalExaggeration=q.getValueOrDefault(a._enableVerticalExaggeration,e,KJe),p.minimumPixelSize=q.getValueOrDefault(a._minimumPixelSize,e,ZJe),p.maximumScale=q.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(h,p.modelMatrix),p.shadows=q.getValueOrDefault(a._shadows,e,JJe),p.heightReference=q.getValueOrDefault(a._heightReference,e,eet),p.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=q.getValueOrDefault(a._silhouetteColor,e,tet,yde),p.silhouetteSize=q.getValueOrDefault(a._silhouetteSize,e,net),p.color=q.getValueOrDefault(a._color,e,iet,yde),p.colorBlendMode=q.getValueOrDefault(a._colorBlendMode,e,oet),p.colorBlendAmount=q.getValueOrDefault(a._colorBlendAmount,e,ret),p.clippingPlanes=q.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=q.getValueOrDefault(a._clampAnimations,e,QJe),p.imageBasedLighting.imageBasedLightingFactor=q.getValueOrDefault(a._imageBasedLightingFactor,e,set);let _=q.getValueOrUndefined(a._lightColor,e);if(l(_)&&(z.pack(_,xde,0),_=d.unpack(xde,0,uet)),p.lightColor=_,p.customShader=q.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=q.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:au.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let x=q.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(x)){let C=Object.keys(x);for(let A=0,S=C.length;A<S;++A){let v=C[A],D=x[v];if(!l(D))continue;let O=p.getNode(v);if(!l(O))continue;let R=F.fromTranslationRotationScale(D,cet);O.matrix=F.multiply(O.originalMatrix,R,R)}}let b=!1,T=q.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(T)){let C=Object.keys(T);for(let A=0,S=C.length;A<S;++A){let v=C[A],D=T[v];l(D)&&(b=!0,p.setArticulationStage(v,D))}}b&&p.applyArticulations()}}return!0};yy.prototype.isDestroyed=function(){return!1};yy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(yy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)A7(this,e[i],t,n);return ue(this)};var uk=new d,det=new fe;yy.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return at.FAILED;if(n.loadFailed)return at.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return at.PENDING;if(!i.ready||!n.modelUpdated)return at.PENDING;let o=this._scene,r=y(o.ellipsoid,ee.default);if(i.heightReference!==Ye.NONE){let a=i.modelMatrix;uk.x=a[12],uk.y=a[13],uk.z=a[14];let c=r.cartesianToCartographic(uk,det),u=o.getHeight(c,i.heightReference);return l(u)&&(tf(i.heightReference)?c.height=u:c.height+=u),ae.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),at.DONE}return ae.clone(i.boundingSphere,t),at.DONE};yy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(het(r,a),s.set(r.id,r)):(A7(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],A7(this,r,a,c),s.remove(r.id)};function A7(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function het(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var fk=yy;function xy(e){this._definitionChanged=new pe,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(xy.prototype,{isConstant:{get:function(){return q.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Ui.FIXED}}});var met=new Z;xy.prototype.getValue=function(e,t){return l(e)||(e=Z.now(met)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};xy.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};xy.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ee.default.scaleToGeodeticSurface(n,n):void 0};xy.prototype.equals=function(e){return this===e||e instanceof xy&&this._value===e._value};xy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var rg=xy;var pet=60,get=1,Tde=new En,E7=new En,S7=new En;function bde(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function _et(e,t,n,i,o,r,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,r,c[u]),l(f)&&(c[u++]=f);let h=!l(o)||Z.lessThanOrEquals(o,t)||Z.greaterThanOrEquals(o,n),p=0,_=i.length,m=i[p],x=n,b=!1,T,C,A;for(;p<_;){if(!h&&Z.greaterThanOrEquals(m,o)&&(f=e.getValueInReferenceFrame(o,r,c[u]),l(f)&&(c[u++]=f),h=!0),Z.greaterThan(m,t)&&Z.lessThan(m,x)&&!m.equals(o)&&(f=e.getValueInReferenceFrame(m,r,c[u]),l(f)&&(c[u++]=f)),p<_-1){if(s>0&&!b){let S=i[p+1],v=Z.secondsDifference(S,m);b=v>s,b&&(T=Math.ceil(v/s),C=0,A=v/Math.max(T,2),T=Math.max(T-1,1))}if(b&&C<T){m=Z.addSeconds(m,A,new Z),C++;continue}}b=!1,p++,m=i[p]}return f=e.getValueInReferenceFrame(n,r,c[u]),l(f)&&(c[u++]=f),u}function yet(e,t,n,i,o,r,s,a){let c,u=0,f=s,h=t,p=!l(i)||Z.lessThanOrEquals(i,t)||Z.greaterThanOrEquals(i,n);for(;Z.lessThan(h,n);)!p&&Z.greaterThanOrEquals(h,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(h,o,a[f]),l(c)&&(a[f]=c,f++),u++,h=Z.addSeconds(t,r*u,new Z);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function xet(e,t,n,i,o,r,s,a){let c,u=0,f=s,h=t,p=Math.max(r,60),_=!l(i)||Z.lessThanOrEquals(i,t)||Z.greaterThanOrEquals(i,n);for(;Z.lessThan(h,n);)!_&&Z.greaterThanOrEquals(h,i)&&(_=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(h,o,a[f]),l(c)&&(a[f]=c,f++),u++,h=Z.addSeconds(t,p*u,new Z);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function bet(e,t,n,i,o,r,s,a){S7.start=t,S7.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!En.intersect(h,S7,Tde).isEmpty){let p=h.start;h.isStartIncluded||(h.isStopIncluded?p=h.stop:p=Z.addSeconds(h.start,Z.secondsDifference(h.stop,h.start)/2,new Z));let _=e.getValueInReferenceFrame(p,o,a[c]);l(_)&&(a[c]=_,c++)}}return c}function Tet(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function Cet(e,t,n,i,o,r,s,a){E7.start=t,E7.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!En.intersect(h,E7,Tde).isEmpty){let p=h.start,_=h.stop,m=t;Z.greaterThan(p,m)&&(m=p);let x=n;Z.lessThan(_,x)&&(x=_),c=Cde(h.data,m,x,i,o,r,c,a)}}return c}function Cde(e,t,n,i,o,r,s,a){for(;e instanceof cy;)e=e.resolvedProperty;if(e instanceof wa){let c=e._property._times;s=_et(e,t,n,c,i,o,r,s,a)}else e instanceof WL?s=yet(e,t,n,i,o,r,s,a):e instanceof va?s=Cet(e,t,n,i,o,r,s,a):e instanceof uy?s=bet(e,t,n,i,o,r,s,a):e instanceof _l||e instanceof rg&&q.isConstant(e)?s=Tet(e,t,n,i,o,r,s,a):s=xet(e,t,n,i,o,r,s,a);return s}function Ade(e,t,n,i,o,r,s){l(s)||(s=[]);let a=Cde(e,t,n,i,o,r,0,s);return s.length=a,s}var Aet=new $;function zD(e,t){this._unusedIndexes=[],this._polylineCollection=new rm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}zD.prototype.update=function(e){if(this._referenceFrame===Ui.INERTIAL){let t=Ot.computeIcrfToCentralBodyFixedMatrix(e,Aet);F.fromRotationTranslation(t,d.ZERO,this._polylineCollection.modelMatrix)}};zD.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let h=q.getValueOrUndefined(i._leadTime,e),p=q.getValueOrUndefined(i._trailTime,e),_=n._availability,m=l(_),x=l(h),b=l(p);if(u=m||x&&b,u){if(b&&(r=Z.addSeconds(e,-p,new Z)),x&&(s=Z.addSeconds(e,h,new Z)),m){let T=_.start,C=_.stop;(!b||Z.greaterThan(T,r))&&(r=T),(!x||Z.lessThan(C,s))&&(s=C)}u=Z.lessThan(r,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let h=this._unusedIndexes;if(h.length>0){let _=h.pop();c=this._polylineCollection.get(_),t.index=_}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=q.getValueOrDefault(i._resolution,e,pet);c.show=!0,c.positions=Ade(o,r,s,e,this._referenceFrame,f,c.positions.slice()),c.material=ir.getValue(e,i._material,c.material),c.width=q.getValueOrDefault(i._width,e,get),c.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};zD.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};zD.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function by(e,t){t.collectionChanged.addEventListener(by.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new St,this._onCollectionChanged(t,t.values,[],[])}by.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,u=Ui.FIXED;this._scene.mode===ne.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(f)||(f=new zD(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,l(f)&&f.updateObject(e,r)}return!0};by.prototype.isDestroyed=function(){return!1};by.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(by.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};by.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new bde(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new bde(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};by._subSample=Ade;var dk=by;var Ede=z.WHITE,Sde=z.BLACK,vde=0,wde=1,Dde=0,Ide=Gr.NONE,Pde=new z,Eet=new d,Rde=new z,Ode=new Bt,Mde=new Bt,Lde=new Mt;function Nde(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function Ty(e,t){t.collectionChanged.addEventListener(Ty.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new St,this._onCollectionChanged(t,t.values,[],[])}Ty.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,u=r.billboard,f=q.getValueOrDefault(a._heightReference,e,Ye.NONE),h=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),p;if(h&&(p=q.getValueOrUndefined(s._position,e,Eet),h=l(p)),!h){HD(r,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0);let _=!1,m=!1;if(f!==Ye.NONE&&!l(u)?(l(c)&&(HD(r,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,_=!0,m=d.equals(u.position,p)&&u.heightReference===f):f===Ye.NONE&&!l(c)&&(l(u)&&(HD(r,s,n),u=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,Ode),c.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Mde),c.color=q.getValueOrDefault(a._color,e,Ede,Pde),c.outlineColor=q.getValueOrDefault(a._outlineColor,e,Sde,Rde),c.outlineWidth=q.getValueOrDefault(a._outlineWidth,e,vde),c.pixelSize=q.getValueOrDefault(a._pixelSize,e,wde),c.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Lde),c.disableDepthTestDistance=q.getValueOrDefault(a._disableDepthTestDistance,e,Dde),c.splitDirection=q.getValueOrDefault(a._splitDirection,e,Ide);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,Ode),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Mde),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Lde),u.disableDepthTestDistance=q.getValueOrDefault(a._disableDepthTestDistance,e,Dde),u.splitDirection=q.getValueOrDefault(a._splitDirection,e,Ide),u.heightReference=f;let x=q.getValueOrDefault(a._color,e,Ede,Pde),b=q.getValueOrDefault(a._outlineColor,e,Sde,Rde),T=Math.round(q.getValueOrDefault(a._outlineWidth,e,vde)),C=Math.max(1,Math.round(q.getValueOrDefault(a._pixelSize,e,wde)));if(T>0?(u.scale=1,_=_||T!==r.outlineWidth||C!==r.pixelSize||!z.equals(x,r.color)||!z.equals(b,r.outlineColor)):(u.scale=C/50,C=50,_=_||T!==r.outlineWidth||!z.equals(x,r.color)||!z.equals(b,r.outlineColor)),_){r.color=z.clone(x,r.color),r.outlineColor=z.clone(b,r.outlineColor),r.pixelSize=C,r.outlineWidth=T;let A=x.alpha,S=x.toCssColorString(),v=b.toCssColorString(),D=JSON.stringify([S,C,v,T]);u.setImage(D,HC(A,S,v,T,C))}m&&u._updateClamping()}}return!0};Ty.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return at.FAILED;if(l(n.pointPrimitive))t.center=d.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return at.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,at.DONE};Ty.prototype.isDestroyed=function(){return!1};Ty.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ty.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};Ty.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new Nde(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Nde(r)):(HD(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],HD(s.get(r.id),r,a),s.remove(r.id)};function HD(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var hk=Ty;var Ude=[];function vet(e,t,n,i,o){let r=Ude;r.length=o;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,h=i.red,p=i.green,_=i.blue,m=i.alpha;if(z.equals(n,i)){for(s=0;s<o;s++)r[s]=z.clone(n);return r}let x=(h-a)/o,b=(p-c)/o,T=(_-u)/o,C=(m-f)/o;for(s=0;s<o;s++)r[s]=new z(a+s*x,c+s*b,u+s*T,f+s*C);return r}function GD(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),o=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._arcType=y(e.arcType,Jt.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._workerName="createPolylineGeometry";let r=1+t.length*d.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+ee.packedLength+Ie.packedLength+4}GD.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var zde=ee.clone(ee.UNIT_SPHERE),Hde=new Ie,eb={positions:void 0,colors:void 0,ellipsoid:zde,vertexFormat:Hde,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};GD.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,zde);t+=ee.packedLength;let c=Ie.unpack(e,t,Hde);t+=Ie.packedLength;let u=e[t++],f=e[t++]===1,h=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=h,n._granularity=p,n):(eb.positions=r,eb.colors=s,eb.width=u,eb.colorsPerVertex=f,eb.arcType=h,eb.granularity=p,new GD(eb))};var Fde=new d,Bde=new d,kde=new d,Vde=new d;GD.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,h=[],p=bo(e._positions,d.equalsEpsilon,!1,h);if(l(i)&&h.length>0){let N=0,B=h[0];i=i.filter(function(H,V){let G=!1;return o?G=V===B||V===0&&B===1:G=V+1===B,G?(N++,B=h[N],!1):!0})}let _=p.length;if(_<2||t<=0)return;if(r===Jt.GEODESIC||r===Jt.RHUMB){let N,B;r===Jt.GEODESIC?(N=P.chordLength(s,a.maximumRadius),B=Ni.numberOfPoints):(N=s,B=Ni.numberOfPointsRhumbLine);let H=Ni.extractHeights(p,a);if(l(i)){let V=1;for(c=0;c<_-1;++c)V+=B(p[c],p[c+1],N);let G=new Array(V),k=0;for(c=0;c<_-1;++c){let W=p[c],Y=p[c+1],J=i[c],j=B(W,Y,N);if(o&&c<V){let K=i[c+1],Q=vet(W,Y,J,K,j),de=Q.length;for(u=0;u<de;++u)G[k++]=Q[u]}else for(u=0;u<j;++u)G[k++]=z.clone(J)}G[k]=z.clone(i[i.length-1]),i=G,Ude.length=0}r===Jt.GEODESIC?p=Ni.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:H}):p=Ni.generateCartesianRhumbArc({positions:p,granularity:N,ellipsoid:a,height:H})}_=p.length;let m=_*4-4,x=new Float64Array(m*3),b=new Float64Array(m*3),T=new Float64Array(m*3),C=new Float32Array(m*2),A=n.st?new Float32Array(m*2):void 0,S=l(i)?new Uint8Array(m*4):void 0,v=0,D=0,O=0,R=0,M;for(u=0;u<_;++u){u===0?(M=Fde,d.subtract(p[0],p[1],M),d.add(p[0],M,M)):M=p[u-1],d.clone(M,kde),d.clone(p[u],Bde),u===_-1?(M=Fde,d.subtract(p[_-1],p[_-2],M),d.add(p[_-1],M,M)):M=p[u+1],d.clone(M,Vde);let N,B;l(S)&&(u!==0&&!o?N=i[u-1]:N=i[u],u!==_-1&&(B=i[u]));let H=u===0?2:0,V=u===_-1?2:4;for(f=H;f<V;++f){d.pack(Bde,x,v),d.pack(kde,b,v),d.pack(Vde,T,v),v+=3;let G=f-2<0?-1:1;if(C[D++]=2*(f%2)-1,C[D++]=G*t,n.st&&(A[O++]=u/(_-1),A[O++]=Math.max(C[D-2],0)),l(S)){let k=f<2?N:B;S[R++]=z.floatToByte(k.red),S[R++]=z.floatToByte(k.green),S[R++]=z.floatToByte(k.blue),S[R++]=z.floatToByte(k.alpha)}}}let L=new dn;L.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x}),L.prevPosition=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),L.nextPosition=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T}),L.expandAndWidth=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:C}),n.st&&(L.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:A})),l(S)&&(L.color=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));let g=Ne.createTypedArray(m,_*6-6),E=0,w=0,I=_-1;for(u=0;u<I;++u)g[w++]=E,g[w++]=E+2,g[w++]=E+1,g[w++]=E+1,g[w++]=E+2,g[w++]=E+3,E+=4;return new st({attributes:L,indices:g,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromPoints(p),geometryType:ld.POLYLINES})};var Cy=GD;var wet=new Xn(0),mk={},Gde=new z,Det=new Ut(z.WHITE),Iet=new Xn(!0),Pet=new Xn(xn.DISABLED),Ret=new Xn(new Mt),Oet=new Xn(kn.BOTH);function Met(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Let(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Yd(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Yd.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new pe,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new Met,this._groundGeometryOptions=new Let,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=or.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Yd.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Yd.prototype.isOutlineVisible=function(e){return!1};Yd.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};Yd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new yn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Bn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Ut&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Gde)),l(a)||(a=z.WHITE),s.color=Gt.fromColor(a)),this.clampToGround?new vt({id:t,geometry:new kT(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Ut&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,Gde)),l(a)||(a=z.WHITE),s.depthFailColor=Gt.fromColor(a)),new vt({id:t,geometry:new Cy(this._geometryOptions),attributes:s}))};Yd.prototype.createOutlineGeometryInstance=function(e){};Yd.prototype.isDestroyed=function(){return!1};Yd.prototype.destroy=function(){this._entitySubscription(),ue(this)};Yd.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(He.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=y(o.material,Det),u=c instanceof Ut;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=y(s,Iet),this._shadowsProperty=y(o.shadows,Pet),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,Ret),this._classificationTypeProperty=y(o.classificationType,Oet),this._fillEnabled=!0,this._zIndex=y(a,wet);let f=o.width,h=o.arcType,p=o.clampToGround,_=o.granularity;if(!r.isConstant||!q.isConstant(f)||!q.isConstant(h)||!q.isConstant(_)||!q.isConstant(p)||!q.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,x=r.getValue(He.MINIMUM_VALUE,m.positions);if(!l(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let b;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Ut)?b=is.VERTEX_FORMAT:b=Ca.VERTEX_FORMAT,m.vertexFormat=b,m.positions=x,m.width=l(f)?f.getValue(He.MINIMUM_VALUE):void 0,m.arcType=l(h)?h.getValue(He.MINIMUM_VALUE):void 0,m.granularity=l(_)?_.getValue(He.MINIMUM_VALUE):void 0;let T=this._groundGeometryOptions;T.positions=x,T.width=m.width,T.arcType=m.arcType,T.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(He.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&yt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Yd.prototype.createDynamicUpdater=function(e,t){return new WD(e,t,this)};var eE={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function WD(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function Wde(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=mk[n];!l(i)||i.isDestroyed()?(i=new rm,mk[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}WD.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=q.getValueOrUndefined(o,e,this._positions);t._clampToGround=q.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=q.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=q.getValueOrDefault(i._arcType,e,Jt.GEODESIC),t._groundGeometryOptions.granularity=q.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let h=t.fillMaterialProperty,p;if(h instanceof Ut)p=new is;else{let _=ir.getValue(e,h,this._material);p=new Ca({material:_,translucent:_.isTranslucent()}),this._material=_}this._groundPolylinePrimitive=s.add(new Mh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),q.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=Wde(this);if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=Jt.GEODESIC;c=q.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==Jt.NONE&&l(u)&&(eE.ellipsoid=f,eE.positions=r,eE.granularity=q.getValueOrUndefined(i._granularity,e),eE.height=Ni.extractHeights(r,f),c===Jt.GEODESIC?r=Ni.generateCartesianArc(eE):r=Ni.generateCartesianRhumbArc(eE)),a.show=!0,a.positions=r.slice(),a.material=ir.getValue(e,t.fillMaterialProperty,a.material),a.width=q.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};WD.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ae.clone(n.boundingSphere,e),at.DONE}return l(t)&&!t.ready?at.PENDING:at.DONE}else{let t=Wde(this);if(t.show&&t.positions.length>0)return ae.fromPoints(t.positions,e),at.DONE}return at.FAILED};WD.prototype.isDestroyed=function(){return!1};WD.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=mk[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete mk[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var pk=Yd;var Net=new z,Fet=new Mt,Bet=new Mt;function Xd(e,t,n,i,o){let r;n instanceof Ut?r=is:r=Ca,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new St,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new St,this.material=void 0,this.updatersWithAttributes=new St,this.attributes=new St,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Xd.prototype.onMaterialChanged,this),this.subscriptions=new St,this.showsUpdated=new St,this.zIndex=i,this._asynchronous=o}Xd.prototype.onMaterialChanged=function(){this.invalidated=!0};Xd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:l(t)&&t.equals(n)};Xd.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Xd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Xd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Mh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Ca&&(this.material=ir.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Ca&&(this.material=ir.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,b=q.getValueOrDefault(x,e,z.WHITE,Net);z.equals(h._lastColor,b)||(h._lastColor=z.clone(b,h._lastColor),h.color=Gt.toValue(b,h.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let x=q.getValueOrDefault(m,e,Bet,Fet);Mt.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(x,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Xd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=yn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Xd.prototype.contains=function(e){return this.updaters.contains(e.id)};Xd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return at.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?at.FAILED:(i.boundingSphere.clone(t),at.DONE)};Xd.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function tE(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}tE.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=q.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new Xd(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};tE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};tE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};tE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return at.FAILED};tE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var gk=tE;var ket=[];function jde(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function qde(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Ut?1:2);let r;l(i)&&(r=i+o*xn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Ut?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function ym(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new St,this._removedObjects=new St,this._changedObjects=new St;let o,r=xn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new Wd(n,is,void 0,!1,o),this._materialBatches[o]=new qd(n,Ca,void 0,!1,o),this._colorBatches[o+r]=new Wd(n,is,is,!1,o),this._materialBatches[o+r]=new qd(n,Ca,is,!1,o),this._colorBatches[o+r*2]=new Wd(n,is,Ca,!1,o),this._materialBatches[o+r*2]=new qd(n,Ca,Ca,!1,o);this._dynamicBatch=new RA(n,i);let s=kn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new gk(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new St,this._updaters=new St,this._entityCollection=t,t.collectionChanged.addEventListener(ym.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,ket)}ym.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(jde(this,f),qde(this,e,f)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaters.get(u),jde(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new pk(c,this._scene),this._updaters.set(u,f),qde(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(ym._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,_=p.length;for(a=0;a<_;a++)h=p[a].update(e)&&h;return h};var Vet=[],Uet=new ae;ym.prototype.getBoundingSphere=function(e,t){let n=Vet,i=Uet,o=0,r=at.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(c,i),r===at.PENDING)return at.PENDING;r===at.DONE&&(n[o]=ae.clone(i,n[o]),o++)}return o===0?at.FAILED:(n.length=o,ae.fromBoundingSpheres(n,t),at.DONE)};ym.prototype.isDestroyed=function(){return!1};ym.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ym.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};ym._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};ym.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var _k=ym;function Rl(e){gl.initializeTerrainHeights(),Mh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new _r,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Rl.defaultVisualizersCallback);let i=!1,o=new pu,r=new pu;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new m3;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var nE=[];Rl.registerVisualizer=function(e){nE.includes(e)||nE.push(e)};Rl.unregisterVisualizer=function(e){if(nE.includes(e)){let t=nE.indexOf(e);nE.splice(t,1)}};Rl.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new YM(t,i),new ck(e,i,n._primitives,n._groundPrimitives),new lk(t,i),new fk(e,i),new JB(e,i),new hk(t,i),new dk(e,i),new _k(e,i,n._primitives,n._groundPrimitives),...nE.map(o=>new o(e,i))]};Object.defineProperties(Rl.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Rl.prototype.isDestroyed=function(){return!1};Rl.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};Rl.prototype.update=function(e){if(!ui.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=t,t};Rl.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var zet=[],Het=new ae;Rl.prototype.getBoundingSphere=function(e,t,n){if(!this._ready&&!t)return at.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let _=p.get(i);if(_.entities.contains(e)){r=_;break}}}if(!l(r))return at.FAILED;let s=zet,a=Het,c=0,u=at.DONE,f=r._visualizers,h=f.length;for(i=0;i<h;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===at.PENDING)return at.PENDING;u===at.DONE&&(s[c]=ae.clone(a,s[c]),c++)}}return c===0?at.FAILED:(s.length=c,ae.fromBoundingSpheres(s,n),at.DONE)};Rl.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new pu),s=o.add(new O3);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Rl.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Rl.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var yk=Rl;function v7(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}v7.clone=function(e,t){if(l(e))return l(t)||(t=new v7),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Kd=v7;var Yde=new $,Xde=new $,Kde=new $,Get=new F,xk=new d,Zde=new d,w7=new d,D7=new d,$de=new d,Qde=new d,Wet=new Oe,jet=new d,qet=new $,iE=new Z,Yet=1.25;function Xet(e,t,n,i,o,r,s,a,c,u){let f=e.scene.mode,h=o.getValue(c,e._lastCartesian);if(l(h)){let p=!1,_=!1,m,x,b;if(f===ne.SCENE3D){Z.addSeconds(c,.001,iE);let O=o.getValue(iE,xk);if(l(O)||(Z.addSeconds(c,-.001,iE),O=o.getValue(iE,xk),_=!0),l(O)){let R=Ot.computeFixedToIcrfMatrix(c,Yde),M=Ot.computeFixedToIcrfMatrix(iE,Xde),L;!l(R)||!l(M)?(L=Ot.computeTemeToPseudoFixedMatrix(c,Kde),R=$.transpose(L,Yde),M=Ot.computeTemeToPseudoFixedMatrix(iE,Xde),$.transpose(M,M)):L=$.transpose(R,Kde);let g=$.multiplyByVector(R,h,$de),E=$.multiplyByVector(M,O,Qde);d.subtract(g,E,D7);let w=d.magnitude(D7)*1e3,I=P.GRAVITATIONALPARAMETER,N=-I/(w*w-2*I/d.magnitude(g));N<0||N>Yet*u.maximumRadius?(m=Zde,d.normalize(h,m),d.negate(m,m),b=d.clone(d.UNIT_Z,w7),x=d.cross(b,m,xk),d.magnitude(x)>P.EPSILON7&&(d.normalize(m,m),d.normalize(x,x),b=d.cross(m,x,w7),d.normalize(b,b),p=!0)):d.equalsEpsilon(h,O,P.EPSILON7)||(b=Zde,d.normalize(g,b),d.normalize(E,E),x=d.cross(b,E,w7),_&&(x=d.multiplyByScalar(x,-1,x)),d.equalsEpsilon(x,d.ZERO,P.EPSILON7)||(m=d.cross(x,b,xk),$.multiplyByVector(L,m,m),$.multiplyByVector(L,x,x),$.multiplyByVector(L,b,b),d.normalize(m,m),d.normalize(x,x),d.normalize(b,b),p=!0))}}l(e.boundingSphere)&&(h=e.boundingSphere.center);let T,C,A;i&&(T=d.clone(t.position,D7),C=d.clone(t.direction,$de),A=d.clone(t.up,Qde));let S=Get,v;l(s)&&(v=s.getValue(c,Wet));let D=r.getValue(c,jet);if(a===Xg.INERTIAL&&l(v))F.fromTranslationQuaternionRotationScale(h,v,d.ONE,S);else if(a===Xg.VELOCITY&&l(D)){let O=Ot.rotationMatrixFromPositionVelocity(h,D,u,qet);F.fromRotationTranslation(O,h,S)}else a===Xg.ENU||!p?Ot.eastNorthUpToFixedFrame(h,u,S):(S[0]=m.x,S[1]=m.y,S[2]=m.z,S[3]=0,S[4]=x.x,S[5]=x.y,S[6]=x.z,S[7]=0,S[8]=b.x,S[9]=b.y,S[10]=b.z,S[11]=0,S[12]=h.x,S[13]=h.y,S[14]=h.z,S[15]=0);t._setTransform(S),i&&(d.clone(T,t.position),d.clone(C,t.direction),d.clone(A,t.up),d.cross(C,A,t.right))}if(n){let p=f===ne.SCENE2D||d.equals(e._offset3D,d.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function jD(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,ee.default),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new d,this._defaultOffset3D=void 0,this._velocityProperty=new dy(e.position,!0),this._offset3D=new d}Object.defineProperties(jD,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=d.clone(e,new d)}}});jD.defaultOffset3D=new d(-14e3,3500,3500);var bk=new Kd,Ket=new d;jD.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ne.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,h=o!==this._mode,p=n.camera,_=f||h,m=!0;if(f){let x=r.viewFrom,b=l(x);if(!b&&l(t)){bk.pitch=-P.PI_OVER_FOUR,bk.range=0;let T=a.getValue(e,Ket);if(l(T)){let C=2-1/Math.max(1,d.magnitude(T)/i.maximumRadius);bk.pitch*=C}p.viewBoundingSphere(t,bk),this.boundingSphere=t,_=!1,m=!1}else(!b||!l(x.getValue(e,this._offset3D)))&&d.clone(jD._defaultOffset3D,this._offset3D)}else!h&&this._mode!==ne.SCENE2D&&d.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Xet(this,p,_,m,a,c,u,s,e,i)};var Tk=jD;function YD(){this._cache={}}YD.prototype.fromColor=function(e,t){return Ck(void 0,void 0,e,t,this._cache)};YD.prototype.fromUrl=function(e,t,n){return Ck(e,void 0,t,n,this._cache)};YD.prototype.fromMakiIconId=function(e,t,n){return Ck(en(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};YD.prototype.fromText=function(e,t,n){return Ck(void 0,e,t,n,this._cache)};var Zet=new z;function $et(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Zet).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function Jde(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var qD=new Array(4);function Ck(e,t,n,i,o){qD[0]=e,qD[1]=t,qD[2]=n,qD[3]=i;let r=JSON.stringify(qD),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if($et(c,n,i),l(e)){let f=Se.createIfNeeded(e).fetchImage().then(function(h){return Jde(c,h,i),o[r]=a,a});return o[r]=f,f}else if(l(t)){let u=WC(t,{font:`bold ${i}px sans-serif`});Jde(c,u,i)}return o[r]=a,a}var Ay=YD;function I7(e){return e}function Ak(e){if(e==null)return I7;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var u=2,f=a.length,h=new Array(f);for(h[0]=(t+=a[0])*i+r,h[1]=(n+=a[1])*o+s;u<f;)h[u]=a[u],++u;return h}}function ehe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function P7(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return the(e,n)})}:the(e,t)}function the(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=R7(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function R7(e,t){var n=Ak(e.transform),i=e.arcs;function o(f,h){h.length&&h.pop();for(var p=i[f<0?~f:f],_=0,m=p.length;_<m;++_)h.push(n(p[_],_));f<0&&ehe(h,m)}function r(f){return n(f)}function s(f){for(var h=[],p=0,_=f.length;p<_;++p)o(f[p],h);return h.length<2&&h.push(h[0]),h}function a(f){for(var h=s(f);h.length<4;)h.push(h[0]);return h}function c(f){return f.map(a)}function u(f){var h=f.type,p;switch(h){case"GeometryCollection":return{type:h,geometries:f.geometries.map(u)};case"Point":p=r(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(r);break;case"LineString":p=s(f.arcs);break;case"MultiLineString":p=f.arcs.map(s);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:h,coordinates:p}}return u(t)}function Ek(e){return d.fromDegrees(e[0],e[1],e[2])}var O7={"urn:ogc:def:crs:OGC:1.3:CRS84":Ek,"EPSG:4326":Ek,"urn:ogc:def:crs:EPSG::4326":Ek},nhe={},ihe={},M7=48,L7,N7=z.ROYALBLUE,F7=z.YELLOW,B7=2,k7=z.fromBytes(255,255,0,100),V7=!1,ntt={small:24,medium:48,large:64},itt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function ohe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||itt.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${ohe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function ott(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function rtt(e,t){return new kh(ott(ohe,e,t),!0)}function Sk(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=zn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let h=f.toLowerCase();if(u>1&&h==="title"){u=1,s=f;break}else u>2&&h==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new Xn(c):n(r,s))}return o}function U7(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var rhe={Feature:ahe,FeatureCollection:stt,GeometryCollection:che,LineString:hhe,MultiLineString:mhe,MultiPoint:fhe,MultiPolygon:_he,Point:uhe,Polygon:ghe,Topology:yhe},she={GeometryCollection:che,LineString:hhe,MultiLineString:mhe,MultiPoint:fhe,MultiPolygon:_he,Point:uhe,Polygon:ghe,Topology:yhe};function ahe(e,t,n,i,o){if(t.geometry===null){Sk(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new re("feature.geometry is required.");let r=t.geometry.type,s=she[r];if(!l(s))throw new re(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function stt(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)ahe(e,r[s],void 0,i,o)}function che(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],u=c.type,f=she[u];if(!l(f))throw new re(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function lhe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let _=c["marker-color"];l(_)&&(s=z.fromCssColorString(_)),a=y(ntt[c["marker-size"]],a);let m=c["marker-symbol"];l(m)&&(r=m)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new Sc;f.verticalOrigin=new Xn(On.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=Ye.CLAMP_TO_GROUND);let h=Sk(t,e._entityCollection,o.describe);h.billboard=f,h.position=new _l(n(i));let p=Promise.resolve(u).then(function(_){f.image=new Xn(_)}).catch(function(){f.image=new Xn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function uhe(e,t,n,i,o){lhe(e,t,i,n.coordinates,o)}function fhe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)lhe(e,t,i,r[s],o)}function dhe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new Xn(f));let h,p=a.stroke;l(p)&&(h=z.fromCssColorString(p));let _=a["stroke-opacity"];l(_)&&_!==1&&(l(h)||(h=r.color.getValue().clone()),h.alpha=_),l(h)&&(r=new Ut(h))}let c=Sk(t,e._entityCollection,o.describe),u=new Pc;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new Xn(U7(i,n)),u.arcType=Jt.RHUMB}function hhe(e,t,n,i,o){dhe(e,t,i,n.coordinates,o)}function mhe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)dhe(e,t,i,r[s],o)}function phe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let _=c["stroke-width"];l(_)&&(a=new Xn(_));let m,x=c.stroke;l(x)&&(m=z.fromCssColorString(x));let b=c["stroke-opacity"];l(b)&&b!==1&&(l(m)||(m=r.getValue().clone()),m.alpha=b),l(m)&&(r=new Xn(m));let T,C=c.fill,A=s.color.getValue();l(C)&&(T=z.fromCssColorString(C),T.alpha=A.alpha),b=c["fill-opacity"],l(b)&&b!==A.alpha&&(l(T)||(T=A.clone()),T.alpha=b),l(T)&&(s=new Ut(T))}let u=new Fh;u.outline=new Xn(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=Jt.RHUMB;let f=[];for(let _=1,m=i.length;_<m;_++)f.push(new Ka(U7(i[_],n)));let h=i[0];u.hierarchy=new Xn(new Ka(U7(h,n),f)),h[0].length>2?u.perPositionHeight=new Xn(!0):o.clampToGround||(u.height=0);let p=Sk(t,e._entityCollection,o.describe);p.polygon=u}function ghe(e,t,n,i,o){phe(e,t,i,n.coordinates,o)}function _he(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)phe(e,t,i,r[s],o)}function yhe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=P7(n,n.objects[r]),a=rhe[s.type];a(e,s,s,i,o)}}function Ey(e){this._name=e,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new aa(this),this._promises=[],this._pinBuilder=new Ay,this._entityCluster=new Lf,this._credit=void 0,this._resourceCredits=[]}Ey.load=function(e,t){return new Ey().load(e,t)};Object.defineProperties(Ey,{markerSize:{get:function(){return M7},set:function(e){M7=e}},markerSymbol:{get:function(){return L7},set:function(e){L7=e}},markerColor:{get:function(){return N7},set:function(e){N7=e}},stroke:{get:function(){return F7},set:function(e){F7=e}},strokeWidth:{get:function(){return B7},set:function(e){B7=e}},fill:{get:function(){return k7},set:function(e){k7=e}},clampToGround:{get:function(){return V7},set:function(e){V7=e}},crsNames:{get:function(){return O7}},crsLinkHrefs:{get:function(){return nhe}},crsLinkTypes:{get:function(){return ihe}}});Object.defineProperties(Ey.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Ey.prototype.load=function(e,t){return xhe(this,e,t,!0)};Ey.prototype.process=function(e,t){return xhe(this,e,t,!1)};function xhe(e,t,n,i){Xr.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let o=n.credit;typeof o=="string"&&(o=new Ct(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Se){t=Se.createIfNeeded(t),r=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:y(n.describe,rtt),markerSize:y(n.markerSize,M7),markerSymbol:y(n.markerSymbol,L7),markerColor:y(n.markerColor,N7),strokeWidthProperty:new Xn(y(n.strokeWidth,B7)),strokeMaterialProperty:new Ut(y(n.stroke,F7)),fillMaterialProperty:new Ut(y(n.fill,k7)),clampToGround:y(n.clampToGround,V7)},Promise.resolve(r).then(function(a){return att(e,a,n,s,i)}).catch(function(a){throw Xr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Ey.prototype.update=function(e){return!0};function att(e,t,n,i,o){let r;l(i)&&(r=ry(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=rhe[t.type];if(!l(s))throw new re(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?Ek:null;if(l(a)){if(!l(a.properties))throw new re("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=O7[u.name],!l(c))throw new re(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=nhe[u.href];if(l(f)||(f=ihe[u.type]),!l(f))throw new re(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=O7[`EPSG:${u.code}`],!l(c))throw new re(`Unknown crs EPSG code: ${u.code}`)}else throw new re(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Xr.setLoading(e,!1),e})})}var oE=Ey;var bhe="4.1.0";function ctt(e){return e===void 0}function xu(e){return typeof e=="boolean"}function The(e,t){for(var n in t)t.hasOwnProperty(n)&&ctt(e[n])&&(e[n]=t[n]);return e}function Che(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Ho(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function Sy(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function xm(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var vy=/[A-Za-z]/,Hs=/[\d]/;var bu=/\s/,vk=/['"]/,Ahe=/[\x00-\x1F\x7F]/,Ehe=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09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0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,ltt=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,utt=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,ftt=Ehe+ltt+utt,She=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,G$n=new RegExp("[".concat(Ehe+She,"]")),z7=ftt+She,Zd=new RegExp("[".concat(z7,"]"));var wk=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(bu):[],o=t.split(bu),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(bu):[],o=t.split(bu),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();function vhe(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(C){var A={},S=C,v=S.match(/^([a-z]+):\/\//i);return v&&(A.scheme=v[1],S=S.substr(v[0].length)),v=S.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(A.host=v[1],S=S.substr(v[0].length)),v=S.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(A.path=v[1],S=S.substr(v[0].length)),v=S.match(/^\?(.*?)(?=(#|$))/i),v&&(A.query=v[1],S=S.substr(v[0].length)),v=S.match(/^#(.*?)$/i),v&&(A.fragment=v[1]),A},s=function(C){var A="";return C.scheme&&C.host&&(A+=C.scheme+"://"),C.host&&(A+=C.host),C.path&&(A+="/"+C.path),C.query&&(A+="?"+C.query),C.fragment&&(A+="#"+C.fragment),A},a=function(C,A){var S=A/2,v=Math.ceil(S),D=-1*Math.floor(S),O="";return D<0&&(O=C.substr(D)),C.substr(0,v)+n+O};if(e.length<=t)return e;var c=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var h="";if(u.host&&(h+=u.host),h.length>=c)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,c+i):a(h,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((h+p).length>=c){if((h+p).length==t)return(h+p).substr(0,t);var _=c-h.length;return(h+a(p,_)).substr(0,c+i)}else h+=p;if(u.fragment){var m="#"+u.fragment;if((h+m).length>=c){if((h+m).length==t)return(h+m).substr(0,t);var x=c-h.length;return(h+a(m,x)).substr(0,c+i)}else h+=m}if(u.scheme&&u.host){var b=u.scheme+"://";if((h+b).length<c)return(b+h).substr(0,t)}if(h.length<=t)return h;var T="";return c>0&&(T=h.substr(-1*Math.floor(c/2))),(h.substr(0,Math.ceil(c/2))+n+T).substr(0,c+i)}function whe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}function Dhe(e,t,n){return Che(e,t,n)}var Ihe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new wk({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?vhe(t,i):o==="middle"?whe(t,i):Dhe(t,i)},e}();var H7=function(e,t){return H7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},H7(e,t)};function bm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");H7(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Gs=function(){return Gs=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Gs.apply(this,arguments)};var Tm=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();var dtt="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bentley|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|lipsy|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",Phe=new RegExp("^"+dtt+"$");var htt=/[\/?#]/,mtt=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,Rhe=/[?!:,.;^]/,G7=/https?:\/\//i,Ohe=new RegExp("^"+G7.source,"i"),Mhe=new RegExp(Rhe.source+"$"),ptt=/^(javascript|vbscript):/i,gtt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,_tt=/^(?:\/\/)?([^/#?:]+)/;function rE(e){return vy.test(e)}function W7(e){return vy.test(e)||Hs.test(e)||e==="+"||e==="-"||e==="."}function sg(e){return Zd.test(e)}function Dk(e){return e==="_"||sg(e)}function j7(e){return Zd.test(e)||mtt.test(e)||Rhe.test(e)}function Ik(e){return htt.test(e)}function q7(e){return Phe.test(e.toLowerCase())}function Lhe(e){if(ptt.test(e))return!1;var t=e.match(gtt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!vy.test(i))}function Nhe(e){var t=e.match(_tt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!q7(o)}var ytt=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,xtt=/[:/?#]/;function Fhe(e){var t=e.split(xtt,1)[0];return ytt.test(t)}var btt=/^(https?:\/\/)?(www\.)?/i,Ttt=/^\/\//,Bhe=function(e){bm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=Ett(n)),this.stripPrefix.scheme&&(n=Ctt(n)),this.stripPrefix.www&&(n=Att(n)),this.stripTrailingSlash&&(n=Stt(n)),this.decodePercentEncoding&&(n=vtt(n)),n},t}(Tm);function Ctt(e){return e.replace(Ohe,"")}function Att(e){return e.replace(btt,"$1")}function Ett(e){return e.replace(Ttt,"")}function Stt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function vtt(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}var khe=/^mailto:/i,wtt=new RegExp("[".concat(z7,"!#$%&'*+/=?^_`{|}~-]"));function Vhe(e){return Zd.test(e)}function Pk(e){return wtt.test(e)}function Uhe(e){var t=e.split(".").pop()||"";return q7(t)}var zhe=function(e){bm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Tm);function Y7(e){return e==="_"||Zd.test(e)}function Hhe(e){return e.length<=140}var Ghe=["twitter","facebook","instagram","tiktok","youtube"];var Whe=function(e){bm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:throw xm(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Tm);var Dtt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/},Itt=/[-\w.]/;function X7(e){return Itt.test(e)}function jhe(e,t){var n=Dtt[t];return n.test(e)}var qhe=["twitter","instagram","soundcloud","tiktok","youtube"];var Yhe=function(e){bm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:throw xm(this.serviceName),new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Tm);var Ptt=/[-. ]/,Rtt=/[-. ()]/,Ott=/[,;]/,Mtt=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,Ltt=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,Ntt=new RegExp("^".concat(Mtt.source,"|").concat(Ltt.source,"$"));function K7(e){return Ptt.test(e)}function Rk(e){return Ott.test(e)}function Xhe(e){var t=e.charAt(0)==="+"||Rtt.test(e);return t&&Ntt.test(e)}var Khe=function(e){bm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Tm);function Qhe(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],u=e.length,f=[],h=0;h<u;h++){var p=e.charAt(h);if(f.length===0)T(p);else{for(var _=f.length-1;_>=0;_--){var m=f[_];switch(m.state){case 11:O(m,p);break;case 12:R(m,p);break;case 0:C(m,p);break;case 1:A(m,p);break;case 2:S(m,p);break;case 3:v(m,p);break;case 4:D(m,p);break;case 5:M(m,p);break;case 6:L(m,p);break;case 7:g(m,p);break;case 13:E(m,p);break;case 14:w(m,p);break;case 8:I(m,p);break;case 9:N(m,p);break;case 10:B(m,p);break;case 15:H(m,p);break;case 16:V(m,p);break;case 17:G(m,p);break;case 18:k(m,p);break;case 19:W(m,p);break;case 20:Y(m,p);break;case 21:J(m,p);break;case 22:j(m,p);break;case 23:K(m,p);break;case 24:Q(m,p);break;case 25:de(m,p);break;case 26:xe(m,p);break;case 27:ce(m,p);break;case 28:_e(m,p);break;case 29:be(m,p);break;case 30:De(m,p);break;case 31:Ae(m,p);break;case 32:ze(m,p);break;case 33:et(m,p);break;case 34:Et(m,p);break;case 35:ht(m,p);break;case 36:Be(m,p);break;case 37:ke(m,p);break;case 38:qt(m,p);break;case 39:Tt(m,p);break;case 40:lt(m,p);break;case 41:Wn(m,p);break;default:xm(m.state)}}if(h>0&&rE(p)){var x=e.charAt(h-1);!rE(x)&&!f.some(Htt)&&f.push(Ok(h,0))}}}for(var b=f.length-1;b>=0;b--)f.forEach(function(me){return on(me)});return c;function T(me){if(me==="#")f.push(Utt(h,28));else if(me==="@")f.push(ztt(h,30));else if(me==="/")f.push(Z7(h,11));else if(me==="+")f.push($7(h,37));else if(me==="(")f.push($7(h,32));else{if(Hs.test(me)&&(f.push($7(h,38)),f.push(ktt(h,13))),Vhe(me)){var Ce=me.toLowerCase()==="m"?15:22;f.push(Vtt(h,Ce))}rE(me)&&f.push(Ok(h,0)),Zd.test(me)&&f.push(Z7(h,5))}}function C(me,Ce){Ce===":"?me.state=2:Ce==="-"?me.state=1:W7(Ce)||Ho(f,me)}function A(me,Ce){Ce==="-"||(Ce==="/"?(Ho(f,me),f.push(Z7(h,11))):W7(Ce)?me.state=0:Ho(f,me))}function S(me,Ce){Ce==="/"?me.state=3:Ce==="."?Ho(f,me):sg(Ce)?(me.state=5,rE(Ce)&&f.push(Ok(h,0))):Ho(f,me)}function v(me,Ce){Ce==="/"?me.state=4:j7(Ce)?(me.state=10,me.acceptStateReached=!0):on(me)}function D(me,Ce){Ce==="/"?me.state=10:sg(Ce)?(me.state=5,me.acceptStateReached=!0):Ho(f,me)}function O(me,Ce){Ce==="/"?me.state=12:Ho(f,me)}function R(me,Ce){sg(Ce)?me.state=5:Ho(f,me)}function M(me,Ce){Ce==="."?me.state=7:Ce==="-"?me.state=6:Ce===":"?me.state=8:Ik(Ce)?me.state=10:Dk(Ce)||on(me)}function L(me,Ce){Ce==="-"||(Ce==="."?on(me):sg(Ce)?me.state=5:on(me))}function g(me,Ce){Ce==="."?on(me):sg(Ce)?(me.state=5,me.acceptStateReached=!0):on(me)}function E(me,Ce){Ce==="."?me.state=14:Ce===":"?me.state=8:Hs.test(Ce)||(Ik(Ce)?me.state=10:Zd.test(Ce)?Ho(f,me):on(me))}function w(me,Ce){Hs.test(Ce)?(me.octetsEncountered++,me.octetsEncountered===4&&(me.acceptStateReached=!0),me.state=13):on(me)}function I(me,Ce){Hs.test(Ce)?me.state=9:on(me)}function N(me,Ce){Hs.test(Ce)||(Ik(Ce)?me.state=10:on(me))}function B(me,Ce){j7(Ce)||on(me)}function H(me,Ce){Ce.toLowerCase()==="a"?me.state=16:j(me,Ce)}function V(me,Ce){Ce.toLowerCase()==="i"?me.state=17:j(me,Ce)}function G(me,Ce){Ce.toLowerCase()==="l"?me.state=18:j(me,Ce)}function k(me,Ce){Ce.toLowerCase()==="t"?me.state=19:j(me,Ce)}function W(me,Ce){Ce.toLowerCase()==="o"?me.state=20:j(me,Ce)}function Y(me,Ce){Ce.toLowerCase()===":"?me.state=21:j(me,Ce)}function J(me,Ce){Pk(Ce)?me.state=22:Ho(f,me)}function j(me,Ce){Ce==="."?me.state=23:Ce==="@"?me.state=24:Pk(Ce)?me.state=22:Ho(f,me)}function K(me,Ce){Ce==="."?Ho(f,me):Ce==="@"?Ho(f,me):Pk(Ce)?me.state=22:Ho(f,me)}function Q(me,Ce){sg(Ce)?me.state=25:Ho(f,me)}function de(me,Ce){Ce==="."?me.state=27:Ce==="-"?me.state=26:Dk(Ce)||on(me)}function xe(me,Ce){Ce==="-"||Ce==="."?on(me):Dk(Ce)?me.state=25:on(me)}function ce(me,Ce){Ce==="."||Ce==="-"?on(me):sg(Ce)?(me.state=25,me.acceptStateReached=!0):on(me)}function _e(me,Ce){Y7(Ce)?(me.state=29,me.acceptStateReached=!0):Ho(f,me)}function be(me,Ce){Y7(Ce)||on(me)}function De(me,Ce){X7(Ce)?(me.state=31,me.acceptStateReached=!0):Ho(f,me)}function Ae(me,Ce){X7(Ce)||(Zd.test(Ce)?Ho(f,me):on(me))}function ke(me,Ce){Hs.test(Ce)?me.state=38:(Ho(f,me),T(Ce))}function ze(me,Ce){Hs.test(Ce)?me.state=33:Ho(f,me),T(Ce)}function et(me,Ce){Hs.test(Ce)?me.state=34:Ho(f,me)}function Et(me,Ce){Hs.test(Ce)?me.state=35:Ho(f,me)}function ht(me,Ce){Ce===")"?me.state=36:Ho(f,me)}function Be(me,Ce){Hs.test(Ce)?me.state=38:K7(Ce)?me.state=39:Ho(f,me)}function qt(me,Ce){me.acceptStateReached=!0,Rk(Ce)?me.state=40:Ce==="#"?me.state=41:Hs.test(Ce)||(Ce==="("?me.state=32:K7(Ce)?me.state=39:(on(me),rE(Ce)&&f.push(Ok(h,0))))}function Tt(me,Ce){Hs.test(Ce)?me.state=38:Ce==="("?me.state=32:(on(me),T(Ce))}function lt(me,Ce){Rk(Ce)||(Ce==="#"?me.state=41:Hs.test(Ce)?me.state=38:on(me))}function Wn(me,Ce){Rk(Ce)?me.state=40:Hs.test(Ce)?Ho(f,me):on(me)}function on(me){if(Ho(f,me),!!me.acceptStateReached){var Ce=me.startIdx,hn=e.slice(me.startIdx,h);if(hn=Btt(hn),me.type==="url"){var ft=e.charAt(me.startIdx-1);if(ft==="@")return;var to=me.matchType;if(to==="scheme"){var Eo=G7.exec(hn);if(Eo&&(Ce=Ce+Eo.index,hn=hn.slice(Eo.index)),!Lhe(hn))return}else if(to==="tld"){if(!Nhe(hn))return}else if(to==="ipV4"){if(!Fhe(hn))return}else xm(to);c.push(new Bhe({tagBuilder:n,matchedText:hn,offset:Ce,urlMatchType:to,url:hn,protocolRelativeMatch:hn.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(me.type==="email")Uhe(hn)&&c.push(new zhe({tagBuilder:n,matchedText:hn,offset:Ce,email:hn.replace(khe,"")}));else if(me.type==="hashtag")Hhe(hn)&&c.push(new Whe({tagBuilder:n,matchedText:hn,offset:Ce,serviceName:s,hashtag:hn.slice(1)}));else if(me.type==="mention")jhe(hn,a)&&c.push(new Yhe({tagBuilder:n,matchedText:hn,offset:Ce,serviceName:a,mention:hn.slice(1)}));else if(me.type==="phone"){if(hn=hn.replace(/ +$/g,""),Xhe(hn)){var Ys=hn.replace(/[^0-9,;#]/g,"");c.push(new Khe({tagBuilder:n,matchedText:hn,offset:Ce,number:Ys,plusSign:hn.charAt(0)==="+"}))}}else xm(me)}}}var Ftt=/[\(\{\[]/,Zhe=/[\)\}\]]/,$he={")":"(","}":"{","]":"["};function Btt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Ftt.test(i)?t[i]++:Zhe.test(i)&&t[$he[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),Zhe.test(r)){var s=$he[r];if(t[s]<0)t[s]++,o--;else break}else if(Mhe.test(r))o--;else break;return e.slice(0,o+1)}function Ok(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function Z7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function ktt(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Vtt(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Utt(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function ztt(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function $7(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Htt(e){return e.type==="url"&&e.matchType==="scheme"}function Jhe(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Cm,c=0,u=e.length,f=0,h=0,p=a;c<u;){var _=e.charAt(c);switch(f){case 0:m(_);break;case 1:x(_);break;case 2:T(_);break;case 3:b(_);break;case 4:C(_);break;case 5:A(_);break;case 6:S(_);break;case 7:v(_);break;case 8:D(_);break;case 9:O(_);break;case 10:R(_);break;case 11:M(_);break;case 12:L(_);break;case 13:g(_);break;case 14:E(_);break;case 15:w(_);break;case 16:I(_);break;case 17:N(_);break;case 18:B(_);break;case 19:H(_);break;case 20:V(_);break;default:xm(f)}c++}h<c&&Y();function m(K){K==="<"&&k()}function x(K){K==="!"?f=13:K==="/"?(f=2,p=new Cm(Gs(Gs({},p),{isClosing:!0}))):K==="<"?k():vy.test(K)?(f=3,p=new Cm(Gs(Gs({},p),{isOpening:!0}))):(f=0,p=a)}function b(K){bu.test(K)?(p=new Cm(Gs(Gs({},p),{name:J()})),f=4):K==="<"?k():K==="/"?(p=new Cm(Gs(Gs({},p),{name:J()})),f=12):K===">"?(p=new Cm(Gs(Gs({},p),{name:J()})),W()):!vy.test(K)&&!Hs.test(K)&&K!==":"&&G()}function T(K){K===">"?G():vy.test(K)?f=3:G()}function C(K){bu.test(K)||(K==="/"?f=12:K===">"?W():K==="<"?k():K==="="||vk.test(K)||Ahe.test(K)?G():f=5)}function A(K){bu.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?W():K==="<"?k():vk.test(K)&&G()}function S(K){bu.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?W():K==="<"?k():vk.test(K)?G():f=5)}function v(K){bu.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?G():K==="<"?k():f=10)}function D(K){K==='"'&&(f=11)}function O(K){K==="'"&&(f=11)}function R(K){bu.test(K)?f=4:K===">"?W():K==="<"&&k()}function M(K){bu.test(K)?f=4:K==="/"?f=12:K===">"?W():K==="<"?k():(f=4,j())}function L(K){K===">"?(p=new Cm(Gs(Gs({},p),{isClosing:!0})),W()):f=4}function g(K){e.substr(c,2)==="--"?(c+=2,p=new Cm(Gs(Gs({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Cm(Gs(Gs({},p),{type:"doctype"})),f=20):G()}function E(K){K==="-"?f=15:K===">"?G():f=16}function w(K){K==="-"?f=18:K===">"?G():f=16}function I(K){K==="-"&&(f=17)}function N(K){K==="-"?f=18:f=16}function B(K){K===">"?W():K==="!"?f=19:K==="-"||(f=16)}function H(K){K==="-"?f=17:K===">"?W():f=16}function V(K){K===">"?W():K==="<"&&k()}function G(){f=0,p=a}function k(){f=1,p=new Cm({idx:c})}function W(){var K=e.slice(h,p.idx);K&&o(K,h),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),G(),h=c+1}function Y(){var K=e.slice(h,c);o(K,h),h=c+1}function J(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function j(){c--}}var Cm=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var Gtt=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=Wtt(t.urls),this.email=xu(t.email)?t.email:this.email,this.phone=xu(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=xu(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=jtt(t.stripPrefix),this.stripTrailingSlash=xu(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=xu(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&qhe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Ghe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=qtt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return Jhe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(h,p){if(p%2===0){var _=n.parseText(h,f);r.push.apply(r,_)}f+=h.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||Sy(t,function(n){return n.getType()==="hashtag"}),this.email||Sy(t,function(n){return n.getType()==="email"}),this.phone||Sy(t,function(n){return n.getType()==="phone"}),this.mention||Sy(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||Sy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Sy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Sy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=Qhe(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof wk)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Ihe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=bhe,e}(),eme=Gtt;function Wtt(e){return e==null&&(e=!0),xu(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:xu(e.schemeMatches)?e.schemeMatches:!0,tldMatches:xu(e.tldMatches)?e.tldMatches:!0,ipV4Matches:xu(e.ipV4Matches)?e.ipV4Matches:!0}}function jtt(e){return e==null&&(e=!0),xu(e)?{scheme:e,www:e}:{scheme:xu(e.scheme)?e.scheme:!0,www:xu(e.www)?e.www:!0}}function qtt(e){return typeof e=="number"?{length:e,location:"end"}:The(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var Mk=eme;var lme;typeof DOMParser<"u"&&(lme=new DOMParser);var Ytt=new Mk({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),Lk=32,tme=2414016,nme=1,ime=16093e3,ome=.1,Xtt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Co={gpx:Xtt};function Ktt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function Q7(e,t){let n=ZD(e,"id");return n=l(n)?n:zn(),t.getOrCreateEntity(n)}function J7(e){let t=rme(e,"lon"),n=rme(e,"lat"),i=XD(e,"ele",Co.gpx);return d.fromDegrees(t,n,i)}function rme(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function ZD(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function wy(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function eq(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function XD(e,t,n){let i=wy(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Ol(e,t,n){let i=wy(e,t,n);if(l(i))return i.textContent.trim()}function ume(e){let t=new Sc;return t.width=Lk,t.height=Lk,t.scaleByDistance=new Bt(tme,nme,ime,ome),t.pixelOffsetScaleByDistance=new Bt(tme,nme,ime,ome),t.verticalOrigin=new Xn(On.BOTTOM),t.image=e,t}function Ztt(){let e=new Nh;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=xi.LEFT,e.font="16px sans-serif",e.style=Xo.FILL_AND_OUTLINE,e}function fme(e){let t=new Pc;return t.width=4,t.material=new zx,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var sme={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},KD;typeof document<"u"&&(KD=document.createElement("div"));function tq(e,t){let n,i="",o=Object.keys(sme),r=o.length;for(n=0;n<r;n++){let f=o[n],h=sme[f];h.value=y(Ol(e,h.tag,Co.gpx),""),l(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!l(i)||i==="")return;i=Ytt.link(i),KD.innerHTML=i;let s=KD.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${KD.innerHTML}</div>`,KD.innerHTML="",u}function dme(e,t,n,i){let o=J7(t),r=Q7(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,Lk);r.billboard=ume(s);let a=Ol(t,"name",Co.gpx);r.name=a,r.label=Ztt(),r.label.text=a,r.description=tq(t,r),i.clampToGround&&(r.billboard.heightReference=Ye.CLAMP_TO_GROUND,r.label.heightReference=Ye.CLAMP_TO_GROUND)}function $tt(e,t,n,i){let o=Q7(t,n);o.description=tq(t,o);let r=eq(t,"rtept",Co.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)dme(e,r[a],n,i),s[a]=J7(r[a]);o.polyline=fme(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Qtt(e,t,n,i){let o=Q7(t,n);o.description=tq(t,o);let r=eq(t,"trkseg",Co.gpx),s=[],a=[],c,u=!0,f=new wa;for(let h=0;h<r.length;h++)c=Jtt(r[h]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let h=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,Lk);o.billboard=ume(h),o.position=f,i.clampToGround&&(o.billboard.heightReference=Ye.CLAMP_TO_GROUND),o.availability=new Yr,o.availability.addInterval(new En({start:a[0],stop:a[a.length-1]}))}o.polyline=fme(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Jtt(e){let t={positions:[],times:[]},n=eq(e,"trkpt",Co.gpx),i;for(let o=0;o<n.length;o++){let r=J7(n[o]);t.positions.push(r),i=Ol(n[o],"time",Co.gpx),l(i)&&t.times.push(Z.fromIso8601(i))}return t}function ent(e){let t=wy(e,"metadata",Co.gpx);if(l(t)){let n={name:Ol(t,"name",Co.gpx),desc:Ol(t,"desc",Co.gpx),author:tnt(t),copyright:int(t),link:hme(t),time:Ol(t,"time",Co.gpx),keywords:Ol(t,"keywords",Co.gpx),bounds:ont(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function tnt(e){let t=wy(e,"author",Co.gpx);if(l(t)){let n={name:Ol(t,"name",Co.gpx),email:nnt(t),link:hme(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function nnt(e){let t=wy(e,"email",Co.gpx);if(l(t)){let n=Ol(t,"id",Co.gpx),i=Ol(t,"domain",Co.gpx);return`${n}@${i}`}}function hme(e){let t=wy(e,"link",Co.gpx);if(l(t)){let n={href:ZD(t,"href"),text:Ol(t,"text",Co.gpx),mimeType:Ol(t,"type",Co.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function int(e){let t=wy(e,"copyright",Co.gpx);if(l(t)){let n={author:ZD(t,"author"),year:Ol(t,"year",Co.gpx),license:Ol(t,"license",Co.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function ont(e){let t=wy(e,"bounds",Co.gpx);if(l(t)){let n={minLat:XD(t,"minlat",Co.gpx),maxLat:XD(t,"maxlat",Co.gpx),minLon:XD(t,"minlon",Co.gpx),maxLon:XD(t,"maxlon",Co.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var ame={wpt:dme,rte:$tt,trk:Qtt};function rnt(e,t,n,i){let o=Object.keys(ame),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=ame[a],u=t.childNodes,f=u.length;for(let h=0;h<f;h++){let p=u[h];p.localName===a&&Co.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function cme(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=ZD(o,"version"),s=ZD(o,"creator"),a,c=ent(o);l(c)&&(a=c.name),o.localName==="gpx"?rnt(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),h=f.start,p=f.stop,_=Z.equals(h,He.MINIMUM_VALUE),m=Z.equals(p,He.MAXIMUM_VALUE);if(!_||!m){let b;_&&(b=new Date,b.setHours(0,0,0,0),h=Z.fromDate(b)),m&&(b=new Date,b.setHours(24,0,0,0),p=Z.fromDate(b)),u=new fm,u.startTime=h,u.stopTime=p,u.currentTime=Z.clone(h),u.clockRange=Kr.LOOP_STOP,u.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(p,h)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),snt(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==r&&(e._version=r,x=!0),u!==e._clock&&(x=!0,e._clock=u),x&&e._changed.raiseEvent(e),Xr.setLoading(e,!1),e}function snt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function ant(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=n;if(typeof n=="string"||n instanceof Se){n=Se.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?Ktt(r).then(function(s){let a,c;try{a=lme.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new re(u)}return cme(e,a,i)}):cme(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function sE(){this._changed=new pe,this._error=new pe,this._loading=new pe,this._clock=void 0,this._entityCollection=new aa(this),this._entityCluster=new Lf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Ay}sE.load=function(e,t){return new sE().load(e,t)};Object.defineProperties(sE.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});sE.prototype.update=function(e){return!0};sE.prototype.load=function(e,t){if(!l(e))throw new he("data is required.");t=y(t,y.EMPTY_OBJECT),Xr.setLoading(this,!0);let n=this._name,i=this;return ant(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Z.equals(s,He.MINIMUM_VALUE),u=Z.equals(a,He.MAXIMUM_VALUE);if(!c||!u){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=Z.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=Z.fromDate(h)),o=new fm,o.startTime=s,o.stopTime=a,o.currentTime=Z.clone(s),o.clockRange=Kr.LOOP_STOP,o.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Xr.setLoading(i,!1),i}).catch(function(o){return Xr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var Nk=sE;function cnt(e,t){this.position=e,this.headingPitchRoll=t}var Fk=cnt;var gI=Ur(Wl(),1);function Gk(e){return Wk(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function Wk(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?Wk(n):n),[])}var mme=[0,1,2,3].concat(...Gk([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function ar(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,h,p,_,m,x,b=0;for(_=0;_<=15;_++)o.bl_count[_]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)h=o.heap[f],_=r[r[h*2+1]*2+1]+1,_>u&&(_=u,b++),r[h*2+1]=_,!(h>e.max_code)&&(o.bl_count[_]++,m=0,h>=c&&(m=a[h-c]),x=r[h*2],o.opt_len+=x*(_+m),s&&(o.static_len+=x*(s[h*2+1]+m)));if(b!==0){do{for(_=u-1;o.bl_count[_]===0;)_--;o.bl_count[_]--,o.bl_count[_+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(_=u;_!==0;_--)for(h=o.bl_count[_];h!==0;)p=o.heap[--f],!(p>e.max_code)&&(r[p*2+1]!=_&&(o.opt_len+=(_-r[p*2+1])*r[p*2],r[p*2+1]=_),h--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,u,f,h;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=r;f++)h=o[f*2+1],h!==0&&(o[f*2]=n(a[h]++,h))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,h;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=f=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)h=o.heap[++o.heap_len]=f<2?++f:0,r[h*2]=1,o.depth[h]=0,o.opt_len--,s&&(o.static_len-=s[h*2+1]);for(e.max_code=f,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);h=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=u,r[h*2]=r[c*2]+r[u*2],o.depth[h]=Math.max(o.depth[c],o.depth[u])+1,r[c*2+1]=r[u*2+1]=h,o.heap[1]=h++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}ar._length_code=[0,1,2,3,4,5,6,7].concat(...Gk([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));ar.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];ar.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];ar.d_code=function(e){return e<256?mme[e]:mme[256+(e>>>7)]};ar.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];ar.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];ar.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];ar.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Da(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var lnt=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],unt=Gk([[144,8],[112,9],[24,7],[8,8]]);Da.static_ltree=Wk(lnt.map((e,t)=>[e,unt[t]]));var fnt=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],dnt=Gk([[30,5]]);Da.static_dtree=Wk(fnt.map((e,t)=>[e,dnt[t]]));Da.static_l_desc=new Da(Da.static_ltree,ar.extra_lbits,257,286,15);Da.static_d_desc=new Da(Da.static_dtree,ar.extra_dbits,0,30,15);Da.static_bl_desc=new Da(null,ar.extra_blbits,0,19,7);var hnt=9,mnt=8;function Am(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var gme=0,zk=1,tb=2,$d=[new Am(0,0,0,0,gme),new Am(4,4,8,4,zk),new Am(4,5,16,8,zk),new Am(4,6,32,32,zk),new Am(4,4,16,16,tb),new Am(8,16,32,32,tb),new Am(8,16,128,128,tb),new Am(8,32,128,256,tb),new Am(32,128,258,1024,tb),new Am(32,258,258,4096,tb)],Bk=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Hf=0,kk=1,$D=2,Vk=3,pnt=32,nq=42,Uk=113,QD=666,iq=8,gnt=0,oq=1,_nt=2,xr=3,Hk=258,Tu=Hk+xr+1;function pme(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function ynt(){let e=this,t,n,i,o,r,s,a,c,u,f,h,p,_,m,x,b,T,C,A,S,v,D,O,R,M,L,g,E,w,I,N,B,H,V=new ar,G=new ar,k=new ar;e.depth=[];let W,Y,J,j,K,Q;e.bl_count=[],e.heap=[],N=[],B=[],H=[];function de(){u=2*r,h[_-1]=0;for(let Le=0;Le<_-1;Le++)h[Le]=0;L=$d[g].max_lazy,w=$d[g].good_length,I=$d[g].nice_length,M=$d[g].max_chain,v=0,T=0,O=0,C=R=xr-1,S=0,p=0}function xe(){let Le;for(Le=0;Le<286;Le++)N[Le*2]=0;for(Le=0;Le<30;Le++)B[Le*2]=0;for(Le=0;Le<19;Le++)H[Le*2]=0;N[256*2]=1,e.opt_len=e.static_len=0,Y=J=0}function ce(){V.dyn_tree=N,V.stat_desc=Da.static_l_desc,G.dyn_tree=B,G.stat_desc=Da.static_d_desc,k.dyn_tree=H,k.stat_desc=Da.static_bl_desc,K=0,Q=0,j=8,xe()}e.pqdownheap=function(Le,it){let je=e.heap,Xe=je[it],dt=it<<1;for(;dt<=e.heap_len&&(dt<e.heap_len&&pme(Le,je[dt+1],je[dt],e.depth)&&dt++,!pme(Le,Xe,je[dt],e.depth));)je[it]=je[dt],it=dt,dt<<=1;je[it]=Xe};function _e(Le,it){let je=-1,Xe,dt=Le[0*2+1],Ht=0,_n=7,So=4;dt===0&&(_n=138,So=3),Le[(it+1)*2+1]=65535;for(let yo=0;yo<=it;yo++)Xe=dt,dt=Le[(yo+1)*2+1],!(++Ht<_n&&Xe==dt)&&(Ht<So?H[Xe*2]+=Ht:Xe!==0?(Xe!=je&&H[Xe*2]++,H[16*2]++):Ht<=10?H[17*2]++:H[18*2]++,Ht=0,je=Xe,dt===0?(_n=138,So=3):Xe==dt?(_n=6,So=3):(_n=7,So=4))}function be(){let Le;for(_e(N,V.max_code),_e(B,G.max_code),k.build_tree(e),Le=18;Le>=3&&H[ar.bl_order[Le]*2+1]===0;Le--);return e.opt_len+=3*(Le+1)+5+5+4,Le}function De(Le){e.pending_buf[e.pending++]=Le}function Ae(Le){De(Le&255),De(Le>>>8&255)}function ke(Le){De(Le>>8&255),De(Le&255&255)}function ze(Le,it){let je,Xe=it;Q>16-Xe?(je=Le,K|=je<<Q&65535,Ae(K),K=je>>>16-Q,Q+=Xe-16):(K|=Le<<Q&65535,Q+=Xe)}function et(Le,it){let je=Le*2;ze(it[je]&65535,it[je+1]&65535)}function Et(Le,it){let je,Xe=-1,dt,Ht=Le[0*2+1],_n=0,So=7,yo=4;for(Ht===0&&(So=138,yo=3),je=0;je<=it;je++)if(dt=Ht,Ht=Le[(je+1)*2+1],!(++_n<So&&dt==Ht)){if(_n<yo)do et(dt,H);while(--_n!==0);else dt!==0?(dt!=Xe&&(et(dt,H),_n--),et(16,H),ze(_n-3,2)):_n<=10?(et(17,H),ze(_n-3,3)):(et(18,H),ze(_n-11,7));_n=0,Xe=dt,Ht===0?(So=138,yo=3):dt==Ht?(So=6,yo=3):(So=7,yo=4)}}function ht(Le,it,je){let Xe;for(ze(Le-257,5),ze(it-1,5),ze(je-4,4),Xe=0;Xe<je;Xe++)ze(H[ar.bl_order[Xe]*2+1],3);Et(N,Le-1),Et(B,it-1)}function Be(){Q==16?(Ae(K),K=0,Q=0):Q>=8&&(De(K&255),K>>>=8,Q-=8)}function qt(){ze(oq<<1,3),et(256,Da.static_ltree),Be(),1+j+10-Q<9&&(ze(oq<<1,3),et(256,Da.static_ltree),Be()),j=7}function Tt(Le,it){let je,Xe,dt;if(e.dist_buf[Y]=Le,e.lc_buf[Y]=it&255,Y++,Le===0?N[it*2]++:(J++,Le--,N[(ar._length_code[it]+256+1)*2]++,B[ar.d_code(Le)*2]++),!(Y&8191)&&g>2){for(je=Y*8,Xe=v-T,dt=0;dt<30;dt++)je+=B[dt*2]*(5+ar.extra_dbits[dt]);if(je>>>=3,J<Math.floor(Y/2)&&je<Math.floor(Xe/2))return!0}return Y==W-1}function lt(Le,it){let je,Xe,dt=0,Ht,_n;if(Y!==0)do je=e.dist_buf[dt],Xe=e.lc_buf[dt],dt++,je===0?et(Xe,Le):(Ht=ar._length_code[Xe],et(Ht+256+1,Le),_n=ar.extra_lbits[Ht],_n!==0&&(Xe-=ar.base_length[Ht],ze(Xe,_n)),je--,Ht=ar.d_code(je),et(Ht,it),_n=ar.extra_dbits[Ht],_n!==0&&(je-=ar.base_dist[Ht],ze(je,_n)));while(dt<Y);et(256,Le),j=Le[256*2+1]}function Wn(){Q>8?Ae(K):Q>0&&De(K&255),K=0,Q=0}function on(Le,it,je){Wn(),j=8,je&&(Ae(it),Ae(~it)),e.pending_buf.set(c.subarray(Le,Le+it),e.pending),e.pending+=it}function me(Le,it,je){ze((gnt<<1)+(je?1:0),3),on(Le,it,!0)}function Ce(Le,it,je){let Xe,dt,Ht=0;g>0?(V.build_tree(e),G.build_tree(e),Ht=be(),Xe=e.opt_len+3+7>>>3,dt=e.static_len+3+7>>>3,dt<=Xe&&(Xe=dt)):Xe=dt=it+5,it+4<=Xe&&Le!=-1?me(Le,it,je):dt==Xe?(ze((oq<<1)+(je?1:0),3),lt(Da.static_ltree,Da.static_dtree)):(ze((_nt<<1)+(je?1:0),3),ht(V.max_code+1,G.max_code+1,Ht+1),lt(N,B)),xe(),je&&Wn()}function hn(Le){Ce(T>=0?T:-1,v-T,Le),T=v,t.flush_pending()}function ft(){let Le,it,je,Xe;do{if(Xe=u-O-v,Xe===0&&v===0&&O===0)Xe=r;else if(Xe==-1)Xe--;else if(v>=r+r-Tu){c.set(c.subarray(r,r+r),0),D-=r,v-=r,T-=r,Le=_,je=Le;do it=h[--je]&65535,h[je]=it>=r?it-r:0;while(--Le!==0);Le=r,je=Le;do it=f[--je]&65535,f[je]=it>=r?it-r:0;while(--Le!==0);Xe+=r}if(t.avail_in===0)return;Le=t.read_buf(c,v+O,Xe),O+=Le,O>=xr&&(p=c[v]&255,p=(p<<b^c[v+1]&255)&x)}while(O<Tu&&t.avail_in!==0)}function to(Le){let it=65535,je;for(it>i-5&&(it=i-5);;){if(O<=1){if(ft(),O===0&&Le==0)return Hf;if(O===0)break}if(v+=O,O=0,je=T+it,(v===0||v>=je)&&(O=v-je,v=je,hn(!1),t.avail_out===0)||v-T>=r-Tu&&(hn(!1),t.avail_out===0))return Hf}return hn(Le==4),t.avail_out===0?Le==4?$D:Hf:Le==4?Vk:kk}function Eo(Le){let it=M,je=v,Xe,dt,Ht=R,_n=v>r-Tu?v-(r-Tu):0,So=I,yo=a,Na=v+Hk,Fa=c[je+Ht-1],_i=c[je+Ht];R>=w&&(it>>=2),So>O&&(So=O);do if(Xe=Le,!(c[Xe+Ht]!=_i||c[Xe+Ht-1]!=Fa||c[Xe]!=c[je]||c[++Xe]!=c[je+1])){je+=2,Xe++;do;while(c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&je<Na);if(dt=Hk-(Na-je),je=Na-Hk,dt>Ht){if(D=Le,Ht=dt,dt>=So)break;Fa=c[je+Ht-1],_i=c[je+Ht]}}while((Le=f[Le&yo]&65535)>_n&&--it!==0);return Ht<=O?Ht:O}function Ys(Le){let it=0,je;for(;;){if(O<Tu){if(ft(),O<Tu&&Le==0)return Hf;if(O===0)break}if(O>=xr&&(p=(p<<b^c[v+(xr-1)]&255)&x,it=h[p]&65535,f[v&a]=h[p],h[p]=v),it!==0&&(v-it&65535)<=r-Tu&&E!=2&&(C=Eo(it)),C>=xr)if(je=Tt(v-D,C-xr),O-=C,C<=L&&O>=xr){C--;do v++,p=(p<<b^c[v+(xr-1)]&255)&x,it=h[p]&65535,f[v&a]=h[p],h[p]=v;while(--C!==0);v++}else v+=C,C=0,p=c[v]&255,p=(p<<b^c[v+1]&255)&x;else je=Tt(0,c[v]&255),O--,v++;if(je&&(hn(!1),t.avail_out===0))return Hf}return hn(Le==4),t.avail_out===0?Le==4?$D:Hf:Le==4?Vk:kk}function Cr(Le){let it=0,je,Xe;for(;;){if(O<Tu){if(ft(),O<Tu&&Le==0)return Hf;if(O===0)break}if(O>=xr&&(p=(p<<b^c[v+(xr-1)]&255)&x,it=h[p]&65535,f[v&a]=h[p],h[p]=v),R=C,A=D,C=xr-1,it!==0&&R<L&&(v-it&65535)<=r-Tu&&(E!=2&&(C=Eo(it)),C<=5&&(E==1||C==xr&&v-D>4096)&&(C=xr-1)),R>=xr&&C<=R){Xe=v+O-xr,je=Tt(v-1-A,R-xr),O-=R-1,R-=2;do++v<=Xe&&(p=(p<<b^c[v+(xr-1)]&255)&x,it=h[p]&65535,f[v&a]=h[p],h[p]=v);while(--R!==0);if(S=0,C=xr-1,v++,je&&(hn(!1),t.avail_out===0))return Hf}else if(S!==0){if(je=Tt(0,c[v-1]&255),je&&hn(!1),v++,O--,t.avail_out===0)return Hf}else S=1,v++,O--}return S!==0&&(je=Tt(0,c[v-1]&255),S=0),hn(Le==4),t.avail_out===0?Le==4?$D:Hf:Le==4?Vk:kk}function hs(Le){return Le.total_in=Le.total_out=0,Le.msg=null,e.pending=0,e.pending_out=0,n=Uk,o=0,ce(),de(),0}e.deflateInit=function(Le,it,je,Xe,dt,Ht){return Xe||(Xe=iq),dt||(dt=mnt),Ht||(Ht=0),Le.msg=null,it==-1&&(it=6),dt<1||dt>hnt||Xe!=iq||je<9||je>15||it<0||it>9||Ht<0||Ht>2?-2:(Le.dstate=e,s=je,r=1<<s,a=r-1,m=dt+7,_=1<<m,x=_-1,b=Math.floor((m+xr-1)/xr),c=new Uint8Array(r*2),f=[],h=[],W=1<<dt+6,e.pending_buf=new Uint8Array(W*4),i=W*4,e.dist_buf=new Uint16Array(W),e.lc_buf=new Uint8Array(W),g=it,E=Ht,hs(Le))},e.deflateEnd=function(){return n!=nq&&n!=Uk&&n!=QD?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,h=null,f=null,c=null,e.dstate=null,n==Uk?-3:0)},e.deflateParams=function(Le,it,je){let Xe=0;return it==-1&&(it=6),it<0||it>9||je<0||je>2?-2:($d[g].func!=$d[it].func&&Le.total_in!==0&&(Xe=Le.deflate(1)),g!=it&&(g=it,L=$d[g].max_lazy,w=$d[g].good_length,I=$d[g].nice_length,M=$d[g].max_chain),E=je,Xe)},e.deflateSetDictionary=function(Le,it,je){let Xe=je,dt,Ht=0;if(!it||n!=nq)return-2;if(Xe<xr)return 0;for(Xe>r-Tu&&(Xe=r-Tu,Ht=je-Xe),c.set(it.subarray(Ht,Ht+Xe),0),v=Xe,T=Xe,p=c[0]&255,p=(p<<b^c[1]&255)&x,dt=0;dt<=Xe-xr;dt++)p=(p<<b^c[dt+(xr-1)]&255)&x,f[dt&a]=h[p],h[p]=dt;return 0},e.deflate=function(Le,it){let je,Xe,dt,Ht,_n;if(it>4||it<0)return-2;if(!Le.next_out||!Le.next_in&&Le.avail_in!==0||n==QD&&it!=4)return Le.msg=Bk[4],-2;if(Le.avail_out===0)return Le.msg=Bk[7],-5;if(t=Le,Ht=o,o=it,n==nq&&(Xe=iq+(s-8<<4)<<8,dt=(g-1&255)>>1,dt>3&&(dt=3),Xe|=dt<<6,v!==0&&(Xe|=pnt),Xe+=31-Xe%31,n=Uk,ke(Xe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&it<=Ht&&it!=4)return t.msg=Bk[7],-5;if(n==QD&&t.avail_in!==0)return Le.msg=Bk[7],-5;if(t.avail_in!==0||O!==0||it!=0&&n!=QD){switch(_n=-1,$d[g].func){case gme:_n=to(it);break;case zk:_n=Ys(it);break;case tb:_n=Cr(it);break;default:}if((_n==$D||_n==Vk)&&(n=QD),_n==Hf||_n==$D)return t.avail_out===0&&(o=-1),0;if(_n==kk){if(it==1)qt();else if(me(0,0,!1),it==3)for(je=0;je<_;je++)h[je]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return it!=4?0:1}}function _me(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}_me.prototype={deflateInit(e,t){let n=this;return n.dstate=new ynt,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function yme(e){let t=this,n=new _me,i=xnt(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let u,f,h=0,p=0,_=0,m=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(r)):m.push(r.subarray(0,n.next_out_index))),_+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=h&&(c(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(_),m.forEach(function(x){f.set(x,p),p+=x.length})):f=m[0]?new Uint8Array(m[0]):new Uint8Array,f}},t.flush=function(){let a,c,u=0,f=0,h=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&h.push(r.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),h.forEach(function(p){c.set(p,u),u+=p.length}),c}}function xnt(e){return e+5*(Math.floor(e/16383)+1)}var Cu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],kme=1440,bnt=0,Tnt=4,Cnt=9,Ant=5,Ent=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Snt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],vnt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],wnt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],Dnt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Int=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Dy=15;function cq(){let e=this,t,n,i,o,r,s;function a(u,f,h,p,_,m,x,b,T,C,A){let S,v,D,O,R,M,L,g,E,w,I,N,B,H,V;w=0,R=h;do i[u[f+w]]++,w++,R--;while(R!==0);if(i[0]==h)return x[0]=-1,b[0]=0,0;for(g=b[0],M=1;M<=Dy&&i[M]===0;M++);for(L=M,g<M&&(g=M),R=Dy;R!==0&&i[R]===0;R--);for(D=R,g>R&&(g=R),b[0]=g,H=1<<M;M<R;M++,H<<=1)if((H-=i[M])<0)return-3;if((H-=i[R])<0)return-3;for(i[R]+=H,s[1]=M=0,w=1,B=2;--R!==0;)s[B]=M+=i[w],B++,w++;R=0,w=0;do(M=u[f+w])!==0&&(A[s[M]++]=R),w++;while(++R<h);for(h=s[D],s[0]=R=0,w=0,O=-1,N=-g,r[0]=0,I=0,V=0;L<=D;L++)for(S=i[L];S--!==0;){for(;L>N+g;){if(O++,N+=g,V=D-N,V=V>g?g:V,(v=1<<(M=L-N))>S+1&&(v-=S+1,B=L,M<V))for(;++M<V&&!((v<<=1)<=i[++B]);)v-=i[B];if(V=1<<M,C[0]+V>kme)return-3;r[O]=I=C[0],C[0]+=V,O!==0?(s[O]=R,o[0]=M,o[1]=g,M=R>>>N-g,o[2]=I-r[O-1]-M,T.set(o,(r[O-1]+M)*3)):x[0]=I}for(o[1]=L-N,w>=h?o[0]=192:A[w]<p?(o[0]=A[w]<256?0:96,o[2]=A[w++]):(o[0]=m[A[w]-p]+16+64,o[2]=_[A[w++]-p]),v=1<<L-N,M=R>>>N;M<V;M+=v)T.set(o,(I+M)*3);for(M=1<<L-1;R&M;M>>>=1)R^=M;for(R^=M,E=(1<<N)-1;(R&E)!=s[O];)O--,N-=g,E=(1<<N)-1}return H!==0&&D!=1?-5:0}function c(u){let f;for(t||(t=[],n=[],i=new Int32Array(Dy+1),o=[],r=new Int32Array(Dy),s=new Int32Array(Dy+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<Dy+1;f++)i[f]=0;for(f=0;f<3;f++)o[f]=0;r.set(i.subarray(0,Dy),0),s.set(i.subarray(0,Dy+1),0)}e.inflate_trees_bits=function(u,f,h,p,_){let m;return c(19),t[0]=0,m=a(u,0,19,19,null,null,h,f,p,t,n),m==-3?_.msg="oversubscribed dynamic bit lengths tree":(m==-5||f[0]===0)&&(_.msg="incomplete dynamic bit lengths tree",m=-3),m},e.inflate_trees_dynamic=function(u,f,h,p,_,m,x,b,T){let C;return c(288),t[0]=0,C=a(h,0,u,257,vnt,wnt,m,p,b,t,n),C!=0||p[0]===0?(C==-3?T.msg="oversubscribed literal/length tree":C!=-4&&(T.msg="incomplete literal/length tree",C=-3),C):(c(288),C=a(h,u,f,0,Dnt,Int,x,_,b,t,n),C!=0||_[0]===0&&u>257?(C==-3?T.msg="oversubscribed distance tree":C==-5?(T.msg="incomplete distance tree",C=-3):C!=-4&&(T.msg="empty distance tree with lengths",C=-3),C):0)}}cq.inflate_trees_fixed=function(e,t,n,i){return e[0]=Cnt,t[0]=Ant,n[0]=Ent,i[0]=Snt,0};var jk=0,xme=1,bme=2,Tme=3,Cme=4,Ame=5,Eme=6,rq=7,Sme=8,qk=9;function Pnt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,u=0,f=0,h,p=0,_,m=0;function x(b,T,C,A,S,v,D,O){let R,M,L,g,E,w,I,N,B,H,V,G,k,W,Y,J;I=O.next_in_index,N=O.avail_in,E=D.bitb,w=D.bitk,B=D.write,H=B<D.read?D.read-B-1:D.end-B,V=Cu[b],G=Cu[T];do{for(;w<20;)N--,E|=(O.read_byte(I++)&255)<<w,w+=8;if(R=E&V,M=C,L=A,J=(L+R)*3,(g=M[J])===0){E>>=M[J+1],w-=M[J+1],D.win[B++]=M[J+2],H--;continue}do{if(E>>=M[J+1],w-=M[J+1],g&16){for(g&=15,k=M[J+2]+(E&Cu[g]),E>>=g,w-=g;w<15;)N--,E|=(O.read_byte(I++)&255)<<w,w+=8;R=E&G,M=S,L=v,J=(L+R)*3,g=M[J];do if(E>>=M[J+1],w-=M[J+1],g&16){for(g&=15;w<g;)N--,E|=(O.read_byte(I++)&255)<<w,w+=8;if(W=M[J+2]+(E&Cu[g]),E>>=g,w-=g,H-=k,B>=W)Y=B-W,B-Y>0&&2>B-Y?(D.win[B++]=D.win[Y++],D.win[B++]=D.win[Y++],k-=2):(D.win.set(D.win.subarray(Y,Y+2),B),B+=2,Y+=2,k-=2);else{Y=B-W;do Y+=D.end;while(Y<0);if(g=D.end-Y,k>g){if(k-=g,B-Y>0&&g>B-Y)do D.win[B++]=D.win[Y++];while(--g!==0);else D.win.set(D.win.subarray(Y,Y+g),B),B+=g,Y+=g,g=0;Y=0}}if(B-Y>0&&k>B-Y)do D.win[B++]=D.win[Y++];while(--k!==0);else D.win.set(D.win.subarray(Y,Y+k),B),B+=k,Y+=k,k=0;break}else if(!(g&64))R+=M[J+2],R+=E&Cu[g],J=(L+R)*3,g=M[J];else return O.msg="invalid distance code",k=O.avail_in-N,k=w>>3<k?w>>3:k,N+=k,I-=k,w-=k<<3,D.bitb=E,D.bitk=w,O.avail_in=N,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,-3;while(!0);break}if(g&64)return g&32?(k=O.avail_in-N,k=w>>3<k?w>>3:k,N+=k,I-=k,w-=k<<3,D.bitb=E,D.bitk=w,O.avail_in=N,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,1):(O.msg="invalid literal/length code",k=O.avail_in-N,k=w>>3<k?w>>3:k,N+=k,I-=k,w-=k<<3,D.bitb=E,D.bitk=w,O.avail_in=N,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,-3);if(R+=M[J+2],R+=E&Cu[g],J=(L+R)*3,(g=M[J])===0){E>>=M[J+1],w-=M[J+1],D.win[B++]=M[J+2],H--;break}}while(!0)}while(H>=258&&N>=10);return k=O.avail_in-N,k=w>>3<k?w>>3:k,N+=k,I-=k,w-=k<<3,D.bitb=E,D.bitk=w,O.avail_in=N,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,0}e.init=function(b,T,C,A,S,v){t=jk,u=b,f=T,h=C,p=A,_=S,m=v,i=null},e.proc=function(b,T,C){let A,S,v,D=0,O=0,R=0,M,L,g,E;for(R=T.next_in_index,M=T.avail_in,D=b.bitb,O=b.bitk,L=b.write,g=L<b.read?b.read-L-1:b.end-L;;)switch(t){case jk:if(g>=258&&M>=10&&(b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,C=x(u,f,h,p,_,m,b,T),R=T.next_in_index,M=T.avail_in,D=b.bitb,O=b.bitk,L=b.write,g=L<b.read?b.read-L-1:b.end-L,C!=0)){t=C==1?rq:qk;break}r=u,i=h,o=p,t=xme;case xme:for(A=r;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}if(S=(o+(D&Cu[A]))*3,D>>>=i[S+1],O-=i[S+1],v=i[S],v===0){s=i[S+2],t=Eme;break}if(v&16){a=v&15,n=i[S+2],t=bme;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}if(v&32){t=rq;break}return t=qk,T.msg="invalid literal/length code",C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);case bme:for(A=a;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}n+=D&Cu[A],D>>=A,O-=A,r=f,i=_,o=m,t=Tme;case Tme:for(A=r;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}if(S=(o+(D&Cu[A]))*3,D>>=i[S+1],O-=i[S+1],v=i[S],v&16){a=v&15,c=i[S+2],t=Cme;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}return t=qk,T.msg="invalid distance code",C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);case Cme:for(A=a;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}c+=D&Cu[A],D>>=A,O-=A,t=Ame;case Ame:for(E=L-c;E<0;)E+=b.end;for(;n!==0;){if(g===0&&(L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0&&(b.write=L,C=b.inflate_flush(T,C),L=b.write,g=L<b.read?b.read-L-1:b.end-L,L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0)))return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);b.win[L++]=b.win[E++],g--,E==b.end&&(E=0),n--}t=jk;break;case Eme:if(g===0&&(L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0&&(b.write=L,C=b.inflate_flush(T,C),L=b.write,g=L<b.read?b.read-L-1:b.end-L,L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0)))return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);C=0,b.win[L++]=s,g--,t=jk;break;case rq:if(O>7&&(O-=8,M++,R--),b.write=L,C=b.inflate_flush(T,C),L=b.write,g=L<b.read?b.read-L-1:b.end-L,b.read!=b.write)return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);t=Sme;case Sme:return C=1,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);case qk:return C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);default:return C=-2,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C)}},e.free=function(){}}var vme=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],aE=0,sq=1,wme=2,Dme=3,Ime=4,Pme=5,Yk=6,Xk=7,Rme=8,nb=9;function Rnt(e,t){let n=this,i=aE,o=0,r=0,s=0,a,c=[0],u=[0],f=new Pnt,h=0,p=new Int32Array(kme*3),_=0,m=new cq;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,b){b&&(b[0]=_),i==Yk&&f.free(x),i=aE,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,b){let T,C,A;return C=x.next_out_index,A=n.read,T=(A<=n.write?n.write:n.end)-A,T>x.avail_out&&(T=x.avail_out),T!==0&&b==-5&&(b=0),x.avail_out-=T,x.total_out+=T,x.next_out.set(n.win.subarray(A,A+T),C),C+=T,A+=T,A==n.end&&(A=0,n.write==n.end&&(n.write=0),T=n.write-A,T>x.avail_out&&(T=x.avail_out),T!==0&&b==-5&&(b=0),x.avail_out-=T,x.total_out+=T,x.next_out.set(n.win.subarray(A,A+T),C),C+=T,A+=T),x.next_out_index=C,n.read=A,b},n.proc=function(x,b){let T,C,A,S,v,D,O,R;for(S=x.next_in_index,v=x.avail_in,C=n.bitb,A=n.bitk,D=n.write,O=D<n.read?n.read-D-1:n.end-D;;){let M,L,g,E,w,I,N,B;switch(i){case aE:for(;A<3;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}switch(T=C&7,h=T&1,T>>>1){case 0:C>>>=3,A-=3,T=A&7,C>>>=T,A-=T,i=sq;break;case 1:M=[],L=[],g=[[]],E=[[]],cq.inflate_trees_fixed(M,L,g,E),f.init(M[0],L[0],g[0],0,E[0],0),C>>>=3,A-=3,i=Yk;break;case 2:C>>>=3,A-=3,i=Dme;break;case 3:return C>>>=3,A-=3,i=nb,x.msg="invalid block type",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b)}break;case sq:for(;A<32;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}if((~C>>>16&65535)!=(C&65535))return i=nb,x.msg="invalid stored block lengths",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);o=C&65535,C=A=0,i=o!==0?wme:h!==0?Xk:aE;break;case wme:if(v===0||O===0&&(D==n.end&&n.read!==0&&(D=0,O=D<n.read?n.read-D-1:n.end-D),O===0&&(n.write=D,b=n.inflate_flush(x,b),D=n.write,O=D<n.read?n.read-D-1:n.end-D,D==n.end&&n.read!==0&&(D=0,O=D<n.read?n.read-D-1:n.end-D),O===0)))return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);if(b=0,T=o,T>v&&(T=v),T>O&&(T=O),n.win.set(x.read_buf(S,T),D),S+=T,v-=T,D+=T,O-=T,(o-=T)!==0)break;i=h!==0?Xk:aE;break;case Dme:for(;A<14;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}if(r=T=C&16383,(T&31)>29||(T>>5&31)>29)return i=nb,x.msg="too many length or distance symbols",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);if(T=258+(T&31)+(T>>5&31),!a||a.length<T)a=[];else for(R=0;R<T;R++)a[R]=0;C>>>=14,A-=14,s=0,i=Ime;case Ime:for(;s<4+(r>>>10);){for(;A<3;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}a[vme[s++]]=C&7,C>>>=3,A-=3}for(;s<19;)a[vme[s++]]=0;if(c[0]=7,T=m.inflate_trees_bits(a,c,u,p,x),T!=0)return b=T,b==-3&&(a=null,i=nb),n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);s=0,i=Pme;case Pme:for(;T=r,!(s>=258+(T&31)+(T>>5&31));){let H,V;for(T=c[0];A<T;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}if(T=p[(u[0]+(C&Cu[T]))*3+1],V=p[(u[0]+(C&Cu[T]))*3+2],V<16)C>>>=T,A-=T,a[s++]=V;else{for(R=V==18?7:V-14,H=V==18?11:3;A<T+R;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}if(C>>>=T,A-=T,H+=C&Cu[R],C>>>=R,A-=R,R=s,T=r,R+H>258+(T&31)+(T>>5&31)||V==16&&R<1)return a=null,i=nb,x.msg="invalid bit length repeat",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);V=V==16?a[R-1]:0;do a[R++]=V;while(--H!==0);s=R}}if(u[0]=-1,w=[],I=[],N=[],B=[],w[0]=9,I[0]=6,T=r,T=m.inflate_trees_dynamic(257+(T&31),1+(T>>5&31),a,w,I,N,B,p,x),T!=0)return T==-3&&(a=null,i=nb),b=T,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);f.init(w[0],I[0],p,N[0],p,B[0]),i=Yk;case Yk:if(n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,(b=f.proc(n,x,b))!=1)return n.inflate_flush(x,b);if(b=0,f.free(x),S=x.next_in_index,v=x.avail_in,C=n.bitb,A=n.bitk,D=n.write,O=D<n.read?n.read-D-1:n.end-D,h===0){i=aE;break}i=Xk;case Xk:if(n.write=D,b=n.inflate_flush(x,b),D=n.write,O=D<n.read?n.read-D-1:n.end-D,n.read!=n.write)return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);i=Rme;case Rme:return b=1,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);case nb:return b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);default:return b=-2,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b)}}},n.free=function(x){n.reset(x,null),n.win=null,p=null},n.set_dictionary=function(x,b,T){n.win.set(x.subarray(b,b+T),0),n.read=n.write=T},n.sync_point=function(){return i==sq?1:0}}var Ont=32,Mnt=8,Lnt=0,Ome=1,Mme=2,Lme=3,Nme=4,Fme=5,aq=6,JD=7,Bme=12,Iy=13,Nnt=[0,0,255,255];function Fnt(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=JD,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new Rnt(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==Tnt?-5:0,o=-5;;)switch(s.mode){case Lnt:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=Mnt){s.mode=Iy,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Iy,n.msg="invalid win size",s.marker=5;break}s.mode=Ome;case Ome:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=Iy,n.msg="incorrect header check",s.marker=5;break}if(!(r&Ont)){s.mode=JD;break}s.mode=Mme;case Mme:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=Lme;case Lme:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=Nme;case Nme:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=Fme;case Fme:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=aq,2);case aq:return s.mode=Iy,n.msg="need dictionary",s.marker=0,-2;case JD:if(o=s.blocks.proc(n,o),o==-3){s.mode=Iy,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=Bme;case Bme:return n.avail_in=0,1;case Iy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=aq)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=JD,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=Iy&&(c.mode=Iy,c.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=c.marker;i!==0&&r<4;)n.read_byte(o)==Nnt[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,c.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=JD,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function Vme(){}Vme.prototype={inflateInit(e){let t=this;return t.istate=new Fnt,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};function Ume(e){let t=this,n=new Vme,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=bnt,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let u=[],f,h,p=0,_=0,m=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),f=n.inflate(o),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(r)):u.push(r.subarray(0,n.next_out_index))),m+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(h=new Uint8Array(m),u.forEach(function(x){h.set(x,_),_+=x.length})):h=u[0]?new Uint8Array(u[0]):new Uint8Array,h}},t.flush=function(){n.inflateEnd()}}var cE="/",lq=new Date(2107,11,31),uq=new Date(1980,0,1),Ei=void 0,Au="undefined",ag="function";var eI=class{constructor(t){return class extends TransformStream{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var Bnt=64,zme=2;try{typeof navigator!=Au&&navigator.hardwareConcurrency&&(zme=navigator.hardwareConcurrency)}catch{}var knt={chunkSize:512*1024,maxWorkers:zme,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Ei,CompressionStreamNative:typeof CompressionStream!=Au&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Au&&DecompressionStream},Ry=Object.assign({},knt);function tI(){return Ry}function Kk(e){return Math.max(e.chunkSize,Bnt)}function lE(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:u,DecompressionStream:f,workerScripts:h}=e;if(Py("baseURL",t),Py("chunkSize",n),Py("maxWorkers",i),Py("terminateWorkerTimeout",o),Py("useCompressionStream",r),Py("useWebWorkers",s),a&&(Ry.CompressionStream=new eI(a)),c&&(Ry.DecompressionStream=new eI(c)),Py("CompressionStream",u),Py("DecompressionStream",f),h!==Ei){let{deflate:p,inflate:_}=h;if((p||_)&&(Ry.workerScripts||(Ry.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");Ry.workerScripts.deflate=p}if(_){if(!Array.isArray(_))throw new Error("workerScripts.inflate must be an array");Ry.workerScripts.inflate=_}}}function Py(e,t){t!==Ei&&(Ry[e]=t)}var Hme=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;Hme[e]=t}var cg=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^Hme[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var nI=class extends TransformStream{constructor(){let t,n=new cg;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};function uE(e){if(typeof TextEncoder==Au){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var Yc={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Yc.getPartial(n);return i===32?e.concat(t):Yc._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+Yc.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=Yc.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=Yc.getPartial(o);return i.push(Yc.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},iI={bytes:{fromBits(e){let n=Yc.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(Yc.partial(8*(n&3),i)),t}}},Gme={};Gme.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=iI.utf8String.toBits(e));let n=t._buffer=Yc.concat(t._buffer,e),i=t._length,o=t._length=i+Yc.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=Yc.concat(t,[Yc.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var fq={};fq.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[f]=h,i[h]=f,u=o[c=o[a=o[f]]];let p=u*16843009^c*65537^a*257^f*16843008,_=o[h]*257^h*16843008;for(let m=0;m<4;m++)e[m][f]=_=_<<24^_>>>8,t[m][h]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],u=r[3],f=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],_=e[2]^n[2],m=e[t?1:3]^n[3],x=4,b,T,C;for(let A=0;A<i;A++)b=s[h>>>24]^a[p>>16&255]^c[_>>8&255]^u[m&255]^n[x],T=s[p>>>24]^a[_>>16&255]^c[m>>8&255]^u[h&255]^n[x+1],C=s[_>>>24]^a[m>>16&255]^c[h>>8&255]^u[p&255]^n[x+2],m=s[m>>>24]^a[h>>16&255]^c[p>>8&255]^u[_&255]^n[x+3],x+=4,h=b,p=T,_=C;for(let A=0;A<4;A++)o[t?3&-A:A]=f[h>>>24]<<24^f[p>>16&255]<<16^f[_>>8&255]<<8^f[m&255]^n[x++],b=h,h=p,p=_,_=m,m=b;return o}};var Wme={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},dq={};dq.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=Yc.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return Yc.clamp(t,o)}};var Oy={importKey(e){return new Oy.hmacSha1(iI.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,u,f=new ArrayBuffer(o),h=new DataView(f),p=0,_=Yc;for(t=iI.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(_.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)h.setInt32(p,r[a]),p+=4}return f.slice(0,i/8)}};Oy.hmacSha1=class{constructor(e){let t=this,n=t._hash=Gme.sha1,i=[[],[]];t._baseHash=[new n,new n];let o=t._baseHash[0].blockSize/32;e.length>o&&(e=new n().update(e).finalize());for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var Vnt=typeof crypto!=Au&&typeof crypto.getRandomValues==ag,My="Invalid password",ib="Invalid signature",lg="zipjs-abort-check-password";function Zk(e){return Vnt?crypto.getRandomValues(e):Wme.getRandomValues(e)}var fE=16,Unt="raw",Yme={name:"PBKDF2"},znt={name:"HMAC"},Hnt="SHA-1",Gnt=Object.assign({hash:znt},Yme),hq=Object.assign({iterations:1e3,hash:{name:Hnt}},Yme),Wnt=["deriveBits"],rI=[8,12,16],oI=[16,24,32],Ly=10,jnt=[0,0,0,0],Jk=typeof crypto!=Au,cI=Jk&&crypto.subtle,Xme=Jk&&typeof cI!=Au,Em=iI.bytes,qnt=fq.aes,Ynt=dq.ctrGladman,Xnt=Oy.hmacSha1,jme=Jk&&Xme&&typeof cI.importKey==ag,qme=Jk&&Xme&&typeof cI.deriveBits==ag,$k=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:$me(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:h,ready:p}=c;u?(await Knt(c,f,u,Gf(s,0,rI[f]+2)),s=Gf(s,rI[f]+2),r?a.error(new Error(lg)):h()):await p;let _=new Uint8Array(s.length-Ly-(s.length-Ly)%fE);a.enqueue(Kme(c,s,_,0,Ly,!0))},async flush(s){let{signed:a,ctr:c,hmac:u,pending:f,ready:h}=this;if(u&&c){await h;let p=Gf(f,0,f.length-Ly),_=Gf(f,f.length-Ly),m=new Uint8Array;if(p.length){let x=aI(Em,p);u.update(x);let b=c.update(x);m=sI(Em,b)}if(a){let x=Gf(sI(Em,u.digest()),0,Ly);for(let b=0;b<Ly;b++)if(x[b]!=_[b])throw new Error(ib)}s.enqueue(m)}}})}},Qk=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:$me(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:u,resolveReady:f,ready:h}=a,p=new Uint8Array;c?(p=await Znt(a,u,c),f()):await h;let _=new Uint8Array(p.length+r.length-r.length%fE);_.set(p,0),s.enqueue(Kme(a,r,_,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(c.length){let h=s.update(aI(Em,c));a.update(h),f=sI(Em,h)}o.signature=sI(Em,a.digest()).slice(0,Ly),r.enqueue(mq(f,o.signature))}}}),o=this}};function Kme(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,u=t.length-o;c.length&&(t=mq(c,t),n=Jnt(n,u-u%fE));let f;for(f=0;f<=u-fE;f+=fE){let h=aI(Em,Gf(t,f,f+fE));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(sI(Em,p),f+i)}return e.pending=Gf(t,f),n}async function Knt(e,t,n,i){let o=await Zme(e,t,n,Gf(i,0,rI[t])),r=Gf(i,rI[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(My)}async function Znt(e,t,n){let i=Zk(new Uint8Array(rI[t])),o=await Zme(e,t,n,i);return mq(i,o)}async function Zme(e,t,n,i){e.password=null;let o=await $nt(Unt,n,Gnt,!1,Wnt),r=await Qnt(Object.assign({salt:i},hq),o,8*(oI[t]*2+2)),s=new Uint8Array(r),a=aI(Em,Gf(s,0,oI[t])),c=aI(Em,Gf(s,oI[t],oI[t]*2)),u=Gf(s,oI[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new Ynt(new qnt(a),Array.from(jnt)),hmac:new Xnt(c)}),u}async function $nt(e,t,n,i,o){if(jme)try{return await cI.importKey(e,t,n,i,o)}catch{return jme=!1,Oy.importKey(t)}else return Oy.importKey(t)}async function Qnt(e,t,n){if(qme)try{return await cI.deriveBits(e,t,n)}catch{return qme=!1,Oy.pbkdf2(t,e.salt,hq.iterations,n)}else return Oy.pbkdf2(t,e.salt,hq.iterations,n)}function $me(e,t){return t===Ei?uE(e):t}function mq(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function Jnt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Gf(e,t,n){return e.subarray(t,n)}function sI(e,t){return e.fromBits(t)}function aI(e,t){return e.toBits(t)}var dE=12,eV=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),tpe(this,t)},transform(o,r){let s=this;if(s.password){let a=Qme(s,o.subarray(0,dE));if(s.password=null,a[dE-1]!=s.passwordVerification)throw new Error(My);o=o.subarray(dE)}i?r.error(new Error(lg)):r.enqueue(Qme(s,o))}})}},tV=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),tpe(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=Zk(new Uint8Array(dE));c[dE-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(Jme(r,c),0),a=dE}else s=new Uint8Array(i.length),a=0;s.set(Jme(r,i),a),o.enqueue(s)}})}};function Qme(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=npe(e)^t[i],pq(e,n[i]);return n}function Jme(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=npe(e)^t[i],pq(e,t[i]);return n}function tpe(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new cg(n[0]),crcKey2:new cg(n[2])});for(let i=0;i<t.length;i++)pq(e,t.charCodeAt(i))}function pq(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=epe(Math.imul(epe(i+ipe(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function npe(e){let t=e.keys[2]|2;return ipe(Math.imul(t,t^1)>>>8)}function ipe(e){return e&255}function epe(e){return e&4294967295}var ope="deflate-raw",nV=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:u,level:f}=t,h=this,p,_,m=rpe(super.readable);(!s||c)&&u&&(p=new nI,m=Sm(m,p)),r&&(m=ape(m,a,{level:f,chunkSize:n},o,i)),s&&(c?m=Sm(m,new tV(t)):(_=new Qk(t),m=Sm(m,_))),spe(h,m,()=>{let x;s&&!c&&(x=_.signature),(!s||c)&&u&&(x=new DataView(p.value.buffer).getUint32(0)),h.signature=x})}},iV=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:u,useCompressionStream:f}=t,h,p,_=rpe(super.readable);s&&(r?_=Sm(_,new eV(t)):(p=new $k(t),_=Sm(_,p))),u&&(_=ape(_,f,{chunkSize:n},o,i)),(!s||r)&&a&&(h=new nI,_=Sm(_,h)),spe(this,_,()=>{if((!s||r)&&a){let m=new DataView(h.value.buffer);if(c!=m.getUint32(0,!1))throw new Error(ib)}})}};function rpe(e){return Sm(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function spe(e,t,n){t=Sm(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function ape(e,t,n,i,o){try{let r=t&&i?i:o;e=Sm(e,new r(ope,n))}catch{if(t)try{e=Sm(e,new o(ope,n))}catch{return e}else return e}return e}function Sm(e,t){return e.pipeThrough(t)}var cpe="message",lpe="start",upe="pull",gq="data",fpe="ack",_q="close",sV="deflate",aV="inflate";var oV=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(sV)?r=nV:o.startsWith(aV)&&(r=iV);let s=0,a=0,c=new r(t,n),u=super.readable,f=new TransformStream({transform(p,_){p&&p.length&&(a+=p.length,_.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),h=new TransformStream({transform(p,_){p&&p.length&&(s+=p.length,_.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(f).pipeThrough(c).pipeThrough(h)}})}},rV=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var mpe=typeof Worker!=Au;var hE=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:u},f){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new rV(r.chunkSize)).pipeThrough(new xq(n,s),{signal:h}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:_,busy:m}=t;_?(m?t.resolveTerminated=p:(_.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,f(t)}}),(a&&mpe?eit:ppe)(t,r)}},xq=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await yq(n,o)},async transform(a,c){s+=a.length,i&&await yq(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await yq(r,s)}})}};async function yq(e,...t){try{await e(...t)}catch{}}function ppe(e,t){return{run:()=>tit(e,t)}}function eit(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=oit(e.scripts[0],n,e)}catch{return mpe=!1,ppe(e,t)}Object.assign(e,{worker:o,interface:{run:()=>nit(e,{chunkSize:i})}})}return e.interface}async function tit({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new oV(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}finally{i()}}async function nit(e,t){let n,i,o=new Promise((p,_)=>{n=p,i=_});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:u}=iit(e.writable),f=cV({type:lpe,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);f||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let h=await o;return f||await c.getWriter().close(),await u,h}function iit(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var dpe=!0,hpe=!0;function oit(e,t,n){let i={type:"module"},o,r;typeof e==ag&&(e=e());try{o=new URL(e,t)}catch{o=e}if(dpe)try{r=new Worker(o)}catch{dpe=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(cpe,s=>rit(s,n)),r}function cV(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,c.push(e.value)),o&&hpe?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{hpe=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function rit({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:h}=t;try{if(s){let{message:_,stack:m,code:x,name:b}=s,T=new Error(_);Object.assign(T,{stack:m,code:x,name:b}),p(T)}else{if(n==upe){let{value:_,done:m}=await a.read();cV({type:gq,value:_,done:m,messageId:o},t)}n==gq&&(await c.ready,await c.write(new Uint8Array(i)),cV({type:fpe,messageId:o},t)),n==_q&&p(null,r)}}catch(_){cV({type:_q,messageId:o},t),p(_)}function p(_,m){_?f(_):u(m),c&&c.releaseLock(),h()}}var ob=[],bq=[];var gpe=0;async function lV(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:c,signed:u,encrypted:f}=n,{workerScripts:h,maxWorkers:p}=i;t.transferStreams=o||o===Ei;let _=!c&&!u&&!f&&!t.transferStreams;return t.useWebWorkers=!_&&(r||r===Ei&&i.useWebWorkers),t.scripts=t.useWebWorkers&&h?h[a]:[],n.useCompressionStream=s||s===Ei&&i.useCompressionStream,(await m()).run();async function m(){let b=ob.find(T=>!T.busy);if(b)return _pe(b),new hE(b,e,t,x);if(ob.length<p){let T={indexWorker:gpe};return gpe++,ob.push(T),new hE(T,e,t,x)}else return new Promise(T=>bq.push({resolve:T,stream:e,workerOptions:t}))}function x(b){if(bq.length){let[{resolve:T,stream:C,workerOptions:A}]=bq.splice(0,1);T(new hE(b,C,A,x))}else b.worker?(_pe(b),sit(b,t)):ob=ob.filter(T=>T!=b)}}function sit(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{ob=ob.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function _pe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var ait="Writer iterator completed too soon",cit="text/plain";var lit="Content-Type";var uit=64*1024,Aq="writable",mE=class{constructor(){this.size=0}init(){this.initialized=!0}},uV=class extends mE{get readable(){let t=this,{chunkSize:n=uit}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this;o.enqueue(await Ia(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},Tq=class extends mE{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,Aq,{get(){return n}})}writeUint8Array(){}};var fV=class extends Tq{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length>2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},ug=class extends uV{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return s.byteLength>n&&(s=s.slice(t,o)),new Uint8Array(s)}},lI=class extends mE{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([lit,t]),Object.defineProperty(n,Aq,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},dV=class extends ug{constructor(t){super(new Blob([t],{type:cit}))}},hV=class extends lI{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var Cq=class extends uV{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;c>=r[a].size;)c-=r[a].size,a++;let u=r[a],f=u.size;if(c+n<=f)s=await Ia(u,c,n);else{let h=f-c;s=new Uint8Array(n),s.set(await Ia(u,c,h)),s.set(await o.readUint8Array(t+h,n-h,i),h)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},mV=class extends mE{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(f){let{availableSize:h}=i;if(s)f.length>=h?(await c(f.slice(0,h)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.slice(h))):await c(f);else{let{value:p,done:_}=await t.next();if(_&&!p)throw new Error(ait);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await wm(o),r=p.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,Aq,{get(){return a}});async function c(f){let h=f.length;h&&(await s.ready,await s.write(f),o.size+=h,i.size+=h,i.availableSize-=h)}async function u(){r.size=o.size,await s.close()}}};async function wm(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function pV(e){return Array.isArray(e)&&(e=new Cq(e)),e instanceof ReadableStream&&(e={readable:e}),e}function gV(e){e.writable===Ei&&typeof e.next==ag&&(e=new mV(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Ei&&(t.size=0),e instanceof mV||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Ia(e,t,n,i){return e.readUint8Array(t,n,i)}var ype="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),fit=ype.length==256;function xpe(e){if(fit){let t="";for(let n=0;n<e.length;n++)t+=ype[e[n]];return t}else return new TextDecoder().decode(e)}function uI(e,t){return t&&t.trim().toLowerCase()=="cp437"?xpe(e):new TextDecoder(t).decode(e)}var Eq="filename",Sq="rawFilename",vq="comment",wq="rawComment",Dq="uncompressedSize",Iq="compressedSize",Pq="offset",_V="diskNumberStart",pE="lastModDate",yV="rawLastModDate",fI="lastAccessDate",bpe="rawLastAccessDate",dI="creationDate",Tpe="rawCreationDate",Rq="internalFileAttribute",Oq="externalFileAttribute",Mq="msDosCompatible",xV="zip64",Lq="encrypted",Nq="version",Fq="versionMadeBy",Bq="zipCrypto",dit=[Eq,Sq,Iq,Dq,pE,yV,vq,wq,fI,dI,Pq,_V,_V,Rq,Oq,Mq,xV,Lq,Nq,Fq,Bq,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],Ny=class{constructor(t){dit.forEach(n=>this[n]=t[n])}};var kq="File format is not recognized",git="End of central directory not found",_it="End of Zip64 central directory locator not found",yit="Central directory header not found",xit="Local file header not found",bit="Zip64 extra field not found",Tit="File contains encrypted entry",Cit="Encryption method not supported",Cpe="Compression method not supported",Ape="Split zip file",Epe="utf-8",Spe="cp437",Ait=[[Dq,4294967295],[Iq,4294967295],[Pq,4294967295],[_V,65535]],Eit={[65535]:{getValue:cs,bytes:4},[4294967295]:{getValue:bV,bytes:8}},wV=class{constructor(t,n={}){Object.assign(this,{reader:pV(t),options:n,config:tI()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await wm(i),(i.size===Ei||!i.readUint8Array)&&(i=new ug(await new Response(i.readable).blob()),await wm(i)),i.size<22)throw new Error(kq);i.chunkSize=Kk(o);let r=await Iit(i,101010256,i.size,22,65535*16);if(!r){let L=await Ia(i,0,4),g=da(L);throw cs(g)==134695760?new Error(Ape):new Error(git)}let s=da(r),a=cs(s,12),c=cs(s,16),u=r.offset,f=fa(s,20),h=u+22+f,p=fa(s,4),_=i.lastDiskNumber||0,m=fa(s,6),x=fa(s,8),b=0,T=0;if(c==4294967295||a==4294967295||x==65535||m==65535){let L=await Ia(i,r.offset-20,20),g=da(L);if(cs(g,0)==117853008){c=bV(g,8);let E=await Ia(i,c,56,-1),w=da(E),I=r.offset-20-56;if(cs(w,0)!=101075792&&c!=I){let N=c;c=I,b=c-N,E=await Ia(i,c,56,-1),w=da(E)}if(cs(w,0)!=101075792)throw new Error(_it);p==65535&&(p=cs(w,16)),m==65535&&(m=cs(w,20)),x==65535&&(x=bV(w,32)),a==4294967295&&(a=bV(w,40)),c-=a}}if(c>=i.size&&(b=i.size-c-a-22,c=i.size-a-22),_!=p)throw new Error(Ape);if(c<0)throw new Error(kq);let C=0,A=await Ia(i,c,a,m),S=da(A);if(a){let L=r.offset-a;if(cs(S,C)!=33639248&&c!=L){let g=c;c=L,b+=c-g,A=await Ia(i,c,a,m),S=da(A)}}let v=r.offset-c-(i.lastDiskOffset||0);if(a!=v&&v>=0&&(a=v,A=await Ia(i,c,a,m),S=da(A)),c<0||c>=i.size)throw new Error(kq);let D=Xc(n,t,"filenameEncoding"),O=Xc(n,t,"commentEncoding");for(let L=0;L<x;L++){let g=new Uq(i,o,n.options);if(cs(S,C)!=33639248)throw new Error(yit);wpe(g,S,C+6);let E=!!g.bitFlag.languageEncodingFlag,w=C+46,I=w+g.filenameLength,N=I+g.extraFieldLength,B=fa(S,C+4),H=(B&0)==0,V=A.subarray(w,I),G=fa(S,C+32),k=N+G,W=A.subarray(N,k),Y=E,J=E,j=H&&(gE(S,C+38)&16)==16,K=cs(S,C+42)+b;Object.assign(g,{versionMadeBy:B,msDosCompatible:H,compressedSize:0,uncompressedSize:0,commentLength:G,directory:j,offset:K,diskNumberStart:fa(S,C+34),internalFileAttribute:fa(S,C+36),externalFileAttribute:cs(S,C+38),rawFilename:V,filenameUTF8:Y,commentUTF8:J,rawExtraField:A.subarray(I,N)});let Q=Xc(n,t,"decodeText")||uI,de=Y?Epe:D||Spe,xe=J?Epe:O||Spe,ce=Q(V,de);ce===Ei&&(ce=uI(V,de));let _e=Q(W,xe);_e===Ei&&(_e=uI(W,xe)),Object.assign(g,{rawComment:W,filename:ce,comment:_e,directory:j||ce.endsWith(cE)}),T=Math.max(K,T),Dpe(g,g,S,C+6),g.zipCrypto=g.encrypted&&!g.extraFieldAES;let be=new Ny(g);be.getData=(Ae,ke)=>g.getData(Ae,be,ke),C=k;let{onprogress:De}=t;if(De)try{await De(L+1,x,new Ny(g))}catch{}yield be}let R=Xc(n,t,"extractPrependedData"),M=Xc(n,t,"extractAppendedData");return R&&(n.prependedData=T>0?await Ia(i,0,T):new Uint8Array),n.comment=f?await Ia(i,u+22,f):new Uint8Array,M&&(n.appendedData=h<i.size?await Ia(i,h,i.size-h):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var Uq=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:c,compressionMethod:u,config:f,bitFlag:h,signature:p,rawLastModDate:_,uncompressedSize:m,compressedSize:x}=o,b=n.localDirectory={},T=await Ia(r,s,30,a),C=da(T),A=Xc(o,i,"password"),S=Xc(o,i,"rawPassword"),v=Xc(o,i,"passThrough");if(A=A&&A.length&&A,S=S&&S.length&&S,c&&c.originalCompressionMethod!=99)throw new Error(Cpe);if(u!=0&&u!=8&&!v)throw new Error(Cpe);if(cs(C,0)!=67324752)throw new Error(xit);wpe(b,C,4),b.rawExtraField=b.extraFieldLength?await Ia(r,s+30+b.filenameLength,b.extraFieldLength,a):new Uint8Array,Dpe(o,b,C,4,!0),Object.assign(n,{lastAccessDate:b.lastAccessDate,creationDate:b.creationDate});let D=o.encrypted&&b.encrypted&&!v,O=D&&!c;if(v||(n.zipCrypto=O),D){if(!O&&c.strength===Ei)throw new Error(Cit);if(!A&&!S)throw new Error(Tit)}let R=s+30+b.filenameLength+b.extraFieldLength,M=x,L=r.readable;Object.assign(L,{diskNumberStart:a,offset:R,size:M});let g=Xc(o,i,"signal"),E=Xc(o,i,"checkPasswordOnly");E&&(t=new WritableStream),t=gV(t),await wm(t,v?x:m);let{writable:w}=t,{onstart:I,onprogress:N,onend:B}=i,H={options:{codecType:aV,password:A,rawPassword:S,zipCrypto:O,encryptionStrength:c&&c.strength,signed:Xc(o,i,"checkSignature")&&!v,passwordVerification:O&&(h.dataDescriptor?_>>>8&255:p>>>24&255),signature:p,compressed:u!=0&&!v,encrypted:o.encrypted&&!v,useWebWorkers:Xc(o,i,"useWebWorkers"),useCompressionStream:Xc(o,i,"useCompressionStream"),transferStreams:Xc(o,i,"transferStreams"),checkPasswordOnly:E},config:f,streamOptions:{signal:g,size:M,onstart:I,onprogress:N,onend:B}},V=0;try{({outputSize:V}=await lV({readable:L,writable:w},H))}catch(G){if(!E||G.message!=lg)throw G}finally{let G=Xc(o,i,"preventClose");w.size+=V,!G&&!w.locked&&await w.getWriter().close()}return E?Ei:t.getData?t.getData():w}};function wpe(e,t,n){let i=e.rawBitFlag=fa(t,n+2),o=(i&1)==1,r=cs(t,n+6);Object.assign(e,{encrypted:o,version:fa(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:Pit(r),filenameLength:fa(t,n+22),extraFieldLength:fa(t,n+24)})}function Dpe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=da(new Uint8Array(r)),c=0;try{for(;c<r.length;){let T=fa(a,c),C=fa(a,c+2);s.set(T,{type:T,data:r.slice(c+4,c+4+C)}),c+=4+C}}catch{}let u=fa(n,i+4);Object.assign(t,{signature:cs(n,i+10),uncompressedSize:cs(n,i+18),compressedSize:cs(n,i+14)});let f=s.get(1);f&&(Sit(f,t),t.extraFieldZip64=f);let h=s.get(28789);h&&(vpe(h,Eq,Sq,t,e),t.extraFieldUnicodePath=h);let p=s.get(25461);p&&(vpe(p,vq,wq,t,e),t.extraFieldUnicodeComment=p);let _=s.get(39169);_?(vit(_,t,u),t.extraFieldAES=_):t.compressionMethod=u;let m=s.get(10);m&&(wit(m,t),t.extraFieldNTFS=m);let x=s.get(21589);x&&(Dit(x,t,o),t.extraFieldExtendedTimestamp=x);let b=s.get(6534);b&&(t.extraFieldUSDZ=b)}function Sit(e,t){t.zip64=!0;let n=da(e.data),i=Ait.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[s,a]=i[o];if(t[s]==a){let c=Eit[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(bit)}}function vpe(e,t,n,i,o){let r=da(e.data),s=new cg;s.append(o[n]);let a=da(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=cs(r,1);Object.assign(e,{version:gE(r,0),[t]:uI(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==cs(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function vit(e,t,n){let i=da(e.data),o=gE(i,4);Object.assign(e,{vendorVersion:gE(i,0),vendorId:gE(i,2),strength:o,originalCompressionMethod:n,compressionMethod:fa(i,5)}),t.compressionMethod=e.compressionMethod}function wit(e,t){let n=da(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=fa(n,i),s=fa(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=da(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=Vq(s),f=Vq(a),h=Vq(c),p={lastModDate:u,lastAccessDate:f,creationDate:h};Object.assign(e,p),Object.assign(t,p)}}catch{}}function Dit(e,t,n){let i=da(e.data),o=gE(i,0),r=[],s=[];n?((o&1)==1&&(r.push(pE),s.push(yV)),(o&2)==2&&(r.push(fI),s.push(bpe)),(o&4)==4&&(r.push(dI),s.push(Tpe))):e.data.length>=5&&(r.push(pE),s.push(yV));let a=1;r.forEach((c,u)=>{if(e.data.length>=a+4){let f=cs(i,a);t[c]=e[c]=new Date(f*1e3);let h=s[u];e[h]=f}a+=4})}async function Iit(e,t,n,i,o){let r=new Uint8Array(4),s=da(r);Rit(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,h=await Ia(e,f,u);for(let p=h.length-i;p>=0;p--)if(h[p]==r[0]&&h[p+1]==r[1]&&h[p+2]==r[2]&&h[p+3]==r[3])return{offset:f+p,buffer:h.slice(p,p+i).buffer}}}function Xc(e,t,n){return t[n]===Ei?e.options[n]:t[n]}function Pit(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function Vq(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function gE(e,t){return e.getUint8(t)}function fa(e,t){return e.getUint16(t,!0)}function cs(e,t){return e.getUint32(t,!0)}function bV(e,t){return Number(e.getBigUint64(t,!0))}function Rit(e,t,n){e.setUint32(t,n,!0)}function da(e){return new DataView(e.buffer)}var Nit="File already exists",Fit="Zip file comment exceeds 64KB",Bit="File entry comment exceeds 64KB",kit="File entry name exceeds 64KB",Rpe="Version exceeds 65535",Vit="The strength must equal 1, 2, or 3",Uit="Extra field type exceeds 65535",zit="Extra field data exceeds 64KB",eY="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Hit="Undefined uncompressed size",Ope=new Uint8Array([7,0,2,0,65,69,3,0,0]),Qq=0,Mpe=[],PV=class{constructor(t,n={}){t=gV(t);let i=t.availableSize!==Ei&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Ei&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:tI(),files:new Map,filenames:new Set,offset:n.offset===Ei?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;Qq<s.maxWorkers?Qq++:await new Promise(c=>Mpe.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(Nit);return o.filenames.add(t),a=Git(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=Mpe.shift();c?c():Qq--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await Qit(this,t,n),uo(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function Git(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(cE)?t+=cE:i.directory=t.endsWith(cE);let o=uo(e,i,"encodeText",uE),r=o(t);if(r===Ei&&(r=uE(t)),Wi(r)>65535)throw new Error(kit);let s=i.comment||"",a=o(s);if(a===Ei&&(a=uE(s)),Wi(a)>65535)throw new Error(Bit);let c=uo(e,i,Nq,20);if(c>65535)throw new Error(Rpe);let u=uo(e,i,Fq,20);if(u>65535)throw new Error(Rpe);let f=uo(e,i,pE,new Date),h=uo(e,i,fI),p=uo(e,i,dI),_=uo(e,i,Mq,!0),m=uo(e,i,Rq,0),x=uo(e,i,Oq,0),b=uo(e,i,"passThrough"),T,C;b||(T=uo(e,i,"password"),C=uo(e,i,"rawPassword"));let A=uo(e,i,"encryptionStrength",3),S=uo(e,i,Bq),v=uo(e,i,"extendedTimestamp",!0),D=uo(e,i,"keepOrder",!0),O=uo(e,i,"level"),R=uo(e,i,"useWebWorkers"),M=uo(e,i,"bufferedWrite"),L=uo(e,i,"dataDescriptorSignature",!1),g=uo(e,i,"signal"),E=uo(e,i,"useUnicodeFileNames",!0),w=uo(e,i,"useCompressionStream"),I=uo(e,i,"compressionMethod"),N=uo(e,i,"dataDescriptor",!0),B=uo(e,i,xV);if(!S&&(T!==Ei||C!==Ei)&&!(A>=1&&A<=3))throw new Error(Vit);let H=new Uint8Array,{extraField:V}=i;if(V){let Et=0,ht=0;V.forEach(Be=>Et+=4+Wi(Be)),H=new Uint8Array(Et),V.forEach((Be,qt)=>{if(qt>65535)throw new Error(Uit);if(Wi(Be)>65535)throw new Error(zit);Es(H,new Uint16Array([qt]),ht),Es(H,new Uint16Array([Wi(Be)]),ht+2),Es(H,Be,ht+4),ht+=4+Wi(Be)})}let G=0,k=0,W=0;if(b&&({uncompressedSize:W}=i,W===Ei))throw new Error(Hit);let Y=B===!0;n&&(n=pV(n),await wm(n),b?G=Lpe(W):n.size===Ei?(N=!0,(B||B===Ei)&&(B=!0,W=G=4294967296)):(W=n.size,G=Lpe(W)));let{diskOffset:J,diskNumber:j,maxSize:K}=e.writer,Q=Y||W>4294967295,de=Y||G>4294967295,xe=Y||e.offset+e.pendingEntriesSize-J>4294967295,_e=uo(e,i,"supportZip64SplitFile",!0)&&Y||j+Math.ceil(e.pendingEntriesSize/K)>65535;if(xe||Q||de||_e){if(B===!1||!D)throw new Error(eY);B=!0}B=B||!1;let be=uo(e,i,Lq),{signature:De}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:c,versionMadeBy:u,lastModDate:f,lastAccessDate:h,creationDate:p,rawExtraField:H,zip64:B,zip64UncompressedSize:Q,zip64CompressedSize:de,zip64Offset:xe,zip64DiskNumberStart:_e,password:T,rawPassword:C,level:!w&&e.config.CompressionStream===Ei&&e.config.CompressionStreamNative===Ei?0:O,useWebWorkers:R,encryptionStrength:A,extendedTimestamp:v,zipCrypto:S,bufferedWrite:M,keepOrder:D,useUnicodeFileNames:E,dataDescriptor:N,dataDescriptorSignature:L,signal:g,msDosCompatible:_,internalFileAttribute:m,externalFileAttribute:x,useCompressionStream:w,passThrough:b,encrypted:!!(T&&Wi(T)||C&&Wi(C))||b&&be,signature:De,compressionMethod:I});let Ae=qit(i),ke=Xit(i),ze=Wi(Ae.localHeaderArray,ke.dataDescriptorArray);k=ze+G,e.options.usdz&&(k+=k+64),e.pendingEntriesSize+=k;let et;try{et=await Wit(e,t,n,{headerInfo:Ae,dataDescriptorInfo:ke,metadataSize:ze},i)}finally{e.pendingEntriesSize-=k}return Object.assign(et,{name:t,comment:s,extraField:V}),new Ny(et)}async function Wit(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:u}=o,{headerInfo:f}=i,{usdz:h}=e.options,p=Array.from(r.values()).pop(),_={},m,x,b,T,C,A,S;r.set(t,_);try{let R;a&&(R=p&&p.lock,v()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!h?(A=new TransformStream,S=new Response(A.readable).blob(),A.writable.size=0,m=!0,e.bufferedWrites++,await wm(s)):(A=s,await D()),await wm(A);let{writable:M}=s,{diskOffset:L}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let E=new Uint8Array(4),w=Pa(E);Gi(w,0,134695760),await Dm(M,E),e.offset+=4}h&&Yit(i,e.offset-L),m||(await R,await O(M));let{diskNumber:g}=s;if(C=!0,_.diskNumberStart=g,_=await jit(n,A,_,i,e.config,o),C=!1,r.set(t,_),_.filename=t,m){await A.writable.getWriter().close();let E=await S;await R,await D(),T=!0,c||(E=await Zit(_,E,M,o)),await O(M),_.diskNumberStart=s.diskNumber,L=s.diskOffset,await E.stream().pipeTo(M,{preventClose:!0,preventAbort:!0,signal:u}),M.size+=E.size,T=!1}if(_.offset=e.offset-L,_.zip64)$it(_,o);else if(_.offset>4294967295)throw new Error(eY);return e.offset+=_.size,_}catch(R){if(m&&T||!m&&C){if(e.hasCorruptedEntries=!0,R)try{R.corruptedEntry=!0}catch{}m?e.offset+=A.writable.size:e.offset=A.writable.size}throw r.delete(t),R}finally{m&&e.bufferedWrites--,b&&b(),x&&x()}function v(){_.lock=new Promise(R=>b=R)}async function D(){e.writerLocked=!0;let{lockWriter:R}=e;e.lockWriter=new Promise(M=>x=()=>{e.writerLocked=!1,M()}),await R}async function O(R){Wi(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Dm(R,new Uint8Array))}}async function jit(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=o,{localHeaderArray:f,headerArray:h,lastModDate:p,rawLastModDate:_,encrypted:m,compressed:x,version:b,compressionMethod:T,rawExtraFieldExtendedTimestamp:C,extraFieldExtendedTimestampFlag:A,rawExtraFieldNTFS:S,rawExtraFieldAES:v}=a,{dataDescriptorArray:D}=c,{rawFilename:O,lastAccessDate:R,creationDate:M,password:L,rawPassword:g,level:E,zip64:w,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:B,zip64DiskNumberStart:H,zipCrypto:V,dataDescriptor:G,directory:k,versionMadeBy:W,rawComment:Y,rawExtraField:J,useWebWorkers:j,onstart:K,onprogress:Q,onend:de,signal:xe,encryptionStrength:ce,extendedTimestamp:_e,msDosCompatible:be,internalFileAttribute:De,externalFileAttribute:Ae,useCompressionStream:ke,passThrough:ze}=s,et={lock:i,versionMadeBy:W,zip64:w,directory:!!k,filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:Y,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:S,rawExtraFieldAES:v,rawExtraField:J,extendedTimestamp:_e,msDosCompatible:be,internalFileAttribute:De,externalFileAttribute:Ae,diskNumberStart:n},{signature:Et,uncompressedSize:ht}=s,Be=0;ze||(ht=0);let{writable:qt}=t;if(e){e.chunkSize=Kk(r),await Dm(qt,f);let lt=e.readable,Wn=lt.size=e.size,on={options:{codecType:sV,level:E,rawPassword:g,password:L,encryptionStrength:ce,zipCrypto:m&&V,passwordVerification:m&&V&&_>>8&255,signed:!ze,compressed:x&&!ze,encrypted:m&&!ze,useWebWorkers:j,useCompressionStream:ke,transferStreams:!1},config:r,streamOptions:{signal:xe,size:Wn,onstart:K,onprogress:Q,onend:de}},me=await lV({readable:lt,writable:qt},on);Be=me.outputSize,ze||(ht=me.inputSize,Et=me.signature),qt.size+=ht}else await Dm(qt,f);let Tt;if(w){let lt=4;I&&(lt+=8),N&&(lt+=8),B&&(lt+=8),H&&(lt+=4),Tt=new Uint8Array(lt)}else Tt=new Uint8Array;return Kit({signature:Et,rawExtraFieldZip64:Tt,compressedSize:Be,uncompressedSize:ht,headerInfo:a,dataDescriptorInfo:c},s),G&&await Dm(qt,D),Object.assign(et,{uncompressedSize:ht,compressedSize:Be,lastModDate:p,rawLastModDate:_,creationDate:M,lastAccessDate:R,encrypted:m,zipCrypto:V,size:u+Be,compressionMethod:T,version:b,headerArray:h,signature:Et,rawExtraFieldZip64:Tt,extraFieldExtendedTimestampFlag:A,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:B,zip64DiskNumberStart:H}),et}function qit(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:h,encryptionStrength:p,extendedTimestamp:_,encrypted:m}=e,{version:x,compressionMethod:b}=e,T=!f&&(r>0||r===Ei&&b!==0),C;if(m&&!a){C=new Uint8Array(Wi(Ope)+2);let B=Pa(C);Ji(B,0,39169),Es(C,Ope,2),RV(B,8,p)}else C=new Uint8Array;let A,S,v;if(_){S=new Uint8Array(9+(i?4:0)+(o?4:0));let B=Pa(S);Ji(B,0,21589),Ji(B,2,Wi(S)-4),v=1+(i?2:0)+(o?4:0),RV(B,4,v);let H=5;Gi(B,H,Math.floor(n.getTime()/1e3)),H+=4,i&&(Gi(B,H,Math.floor(i.getTime()/1e3)),H+=4),o&&Gi(B,H,Math.floor(o.getTime()/1e3));try{A=new Uint8Array(36);let V=Pa(A),G=Jq(n);Ji(V,0,10),Ji(V,2,32),Ji(V,8,1),Ji(V,10,24),Ml(V,12,G),Ml(V,20,Jq(i)||G),Ml(V,28,Jq(o)||G)}catch{A=new Uint8Array}}else A=S=new Uint8Array;let D=0;c&&(D=D|2048),u&&(D=D|8),b===Ei&&(b=T?8:0),b==8&&(r>=1&&r<3&&(D=D|6),r>=3&&r<5&&(D=D|1),r===9&&(D=D|2)),s&&(x=x>45?x:45),m&&(D=D|1,a||(x=x>51?x:51,C[9]=b,b=99));let O=new Uint8Array(26),R=Pa(O);Ji(R,0,x),Ji(R,2,D),Ji(R,4,b);let M=new Uint32Array(1),L=Pa(M),g;n<uq?g=uq:n>lq?g=lq:g=n,Ji(L,0,(g.getHours()<<6|g.getMinutes())<<5|g.getSeconds()/2),Ji(L,2,(g.getFullYear()-1980<<4|g.getMonth()+1)<<5|g.getDate());let E=M[0];Gi(R,6,E),Ji(R,22,Wi(t));let w=Wi(C,S,A,h);Ji(R,24,w);let I=new Uint8Array(30+Wi(t)+w),N=Pa(I);return Gi(N,0,67324752),Es(I,O,4),Es(I,t,30),Es(I,C,30+Wi(t)),Es(I,S,30+Wi(t,C)),Es(I,A,30+Wi(t,C,S)),Es(I,h,30+Wi(t,C,S,A)),{localHeaderArray:I,headerArray:O,headerView:R,lastModDate:n,rawLastModDate:E,encrypted:m,compressed:T,version:x,compressionMethod:b,extraFieldExtendedTimestampFlag:v,rawExtraFieldExtendedTimestamp:S,rawExtraFieldNTFS:A,rawExtraFieldAES:C,extraFieldLength:w}}function Yit(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Pa(i),s=64-(t+Wi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Pa(a);Ji(c,0,6534),Ji(c,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array(Wi(u)+s),Es(i,u),Es(i,a,Wi(u)),r=Pa(i),Ji(r,28,o+s),e.metadataSize+=s}function Xit(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=Pa(o),i&&(s=4,Gi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function Kit(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:u}=s,{dataDescriptorView:f,dataDescriptorOffset:h}=a,{zip64:p,zip64UncompressedSize:_,zip64CompressedSize:m,zipCrypto:x,dataDescriptor:b}=t;if((!u||x)&&n!==Ei&&(Gi(c,10,n),b&&Gi(f,h,n)),p){let T=Pa(i);Ji(T,0,1),Ji(T,2,Wi(i)-4);let C=4;_&&(Gi(c,18,4294967295),Ml(T,C,BigInt(r)),C+=8),m&&(Gi(c,14,4294967295),Ml(T,C,BigInt(o))),b&&(Ml(f,h+4,BigInt(o)),Ml(f,h+12,BigInt(r)))}else Gi(c,14,o),Gi(c,18,r),b&&(Gi(f,h+4,o),Gi(f,h+8,r))}async function Zit(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&Gi(r,14,e.signature),e.zip64?(Gi(r,18,4294967295),Gi(r,22,4294967295)):(Gi(r,18,e.compressedSize),Gi(r,22,e.uncompressedSize)),await Dm(n,new Uint8Array(o)),t.slice(o.byteLength)}function $it(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,u=Pa(n),f=4;r&&(f+=8),s&&(f+=8),a&&(Ml(u,f,BigInt(i)),f+=8),c&&Gi(u,f,o)}async function Qit(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,u=0,f=e.offset-r,h=i.size;for(let[,v]of i){let{rawFilename:D,rawExtraFieldZip64:O,rawExtraFieldAES:R,rawComment:M,rawExtraFieldNTFS:L,rawExtraField:g,extendedTimestamp:E,extraFieldExtendedTimestampFlag:w,lastModDate:I}=v,N;if(E){N=new Uint8Array(9);let B=Pa(N);Ji(B,0,21589),Ji(B,2,5),RV(B,4,w),Gi(B,5,Math.floor(I.getTime()/1e3))}else N=new Uint8Array;v.rawExtraFieldCDExtendedTimestamp=N,u+=46+Wi(D,M,O,R,L,N,g)}let p=new Uint8Array(u),_=Pa(p);await wm(o);let m=0;for(let[v,D]of Array.from(i.values()).entries()){let{offset:O,rawFilename:R,rawExtraFieldZip64:M,rawExtraFieldAES:L,rawExtraFieldCDExtendedTimestamp:g,rawExtraFieldNTFS:E,rawExtraField:w,rawComment:I,versionMadeBy:N,headerArray:B,directory:H,zip64:V,zip64UncompressedSize:G,zip64CompressedSize:k,zip64DiskNumberStart:W,zip64Offset:Y,msDosCompatible:J,internalFileAttribute:j,externalFileAttribute:K,diskNumberStart:Q,uncompressedSize:de,compressedSize:xe}=D,ce=Wi(M,L,g,E,w);Gi(_,c,33639248),Ji(_,c+4,N);let _e=Pa(B);G||Gi(_e,18,de),k||Gi(_e,14,xe),Es(p,B,c+6),Ji(_,c+30,ce),Ji(_,c+32,Wi(I)),Ji(_,c+34,V&&W?65535:Q),Ji(_,c+36,j),K?Gi(_,c+38,K):H&&J&&RV(_,c+38,16),Gi(_,c+42,V&&Y?4294967295:O),Es(p,R,c+46),Es(p,M,c+46+Wi(R)),Es(p,L,c+46+Wi(R,M)),Es(p,g,c+46+Wi(R,M,L)),Es(p,E,c+46+Wi(R,M,L,g)),Es(p,w,c+46+Wi(R,M,L,g,E)),Es(p,I,c+46+Wi(R)+ce);let be=46+Wi(R,I)+ce;if(c-m>o.availableSize&&(o.availableSize=0,await Dm(s,p.slice(m,c)),m=c),c+=be,n.onprogress)try{await n.onprogress(v+1,i.size,new Ny(D))}catch{}}await Dm(s,m?p.slice(m):p);let x=o.diskNumber,{availableSize:b}=o;b<22&&x++;let T=uo(e,n,xV);if(f>4294967295||u>4294967295||h>65535||x>65535){if(T===!1)throw new Error(eY);T=!0}let C=new Uint8Array(T?98:22),A=Pa(C);c=0,T&&(Gi(A,0,101075792),Ml(A,4,BigInt(44)),Ji(A,12,45),Ji(A,14,45),Gi(A,16,x),Gi(A,20,a),Ml(A,24,BigInt(h)),Ml(A,32,BigInt(h)),Ml(A,40,BigInt(u)),Ml(A,48,BigInt(f)),Gi(A,56,117853008),Ml(A,64,BigInt(f)+BigInt(u)),Gi(A,72,x+1),uo(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),h=65535,f=4294967295,u=4294967295,c+=76),Gi(A,c,101010256),Ji(A,c+4,x),Ji(A,c+6,a),Ji(A,c+8,h),Ji(A,c+10,h),Gi(A,c+12,u),Gi(A,c+16,f);let S=Wi(t);if(S)if(S<=65535)Ji(A,c+20,S);else throw new Error(Fit);await Dm(s,C),S&&await Dm(s,t)}async function Dm(e,t){let n=e.getWriter();try{await n.ready,e.size+=Wi(t),await n.write(t)}finally{n.releaseLock()}}function Jq(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function uo(e,t,n,i){let o=t[n]===Ei?e.options[n]:t[n];return o===Ei?i:o}function Lpe(e){return e+5*(Math.floor(e/16383)+1)}function RV(e,t,n){e.setUint8(t,n)}function Ji(e,t,n){e.setUint16(t,n,!0)}function Gi(e,t,n){e.setUint32(t,n,!0)}function Ml(e,t,n){e.setBigUint64(t,n,!0)}function Es(e,t,n){e.set(t,n)}function Pa(e){return new DataView(e.buffer)}function Wi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}lE({Deflate:yme,Inflate:Ume});function Jit(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Rn=Jit;function eot(e,t){this.position=e,this.headingPitchRange=t}var OV=eot;function MV(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new pe,this.tourEnd=new pe,this.entryStart=new pe,this.entryEnd=new pe,this._activeEntries=[]}MV.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};MV.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;Bpe.call(this,e,t,function(i){n.playlistIndex=0,i||Fpe(n._activeEntries),n.tourEnd.raiseEvent(i)})};MV.prototype.stop=function(){Fpe(this._activeEntries)};function Fpe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function Bpe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=tot.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function tot(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,Bpe.call(this,e,t,n)}}var LV=MV;var wi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-wi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?wi.Bounce.In(e*2)*.5:wi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),pI=function(){return performance.now()},not=function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=pI()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e}(),_E={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=_E.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=_E.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=_E.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=_E.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},kpe=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),tY=new not,Vpe=function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=wi.Linear.None,this._interpolationFunction=_E.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=kpe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=tY,tY.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=pI()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var h=i[s];if(h.length===0)continue;for(var p=[a],_=0,m=h.length;_<m;_+=1){var x=this._handleRelativeValue(a,h[_]);if(isNaN(x)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(x)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var b=a;for(var T in b)n[s][T]=b[T];o[s]=c?[]:{};var h=i[s];if(!this._isDynamic){var C={};for(var T in h)C[T]=h[T];i[s]=h=C}this._setupProperties(b,n[s],h,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=pI()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=pI()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=wi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=_E.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=pI()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var x=Math.trunc(s/a),b=s-x*a,T=Math.min(b/i._duration,1);return T===0&&s===i._duration?1:T},f=u(),h=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var _=0,m=this._chainedTweens.length;_<m;_++)this._chainedTweens[_].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),u=Array.isArray(a),f=!c&&u;f?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var Pti=kpe.nextId,Im=tY,Rti=Im.getAll.bind(Im),Oti=Im.removeAll.bind(Im),Mti=Im.add.bind(Im),Lti=Im.remove.bind(Im),Nti=Im.update.bind(Im);var iot={LINEAR_NONE:wi.Linear.None,QUADRATIC_IN:wi.Quadratic.In,QUADRATIC_OUT:wi.Quadratic.Out,QUADRATIC_IN_OUT:wi.Quadratic.InOut,CUBIC_IN:wi.Cubic.In,CUBIC_OUT:wi.Cubic.Out,CUBIC_IN_OUT:wi.Cubic.InOut,QUARTIC_IN:wi.Quartic.In,QUARTIC_OUT:wi.Quartic.Out,QUARTIC_IN_OUT:wi.Quartic.InOut,QUINTIC_IN:wi.Quintic.In,QUINTIC_OUT:wi.Quintic.Out,QUINTIC_IN_OUT:wi.Quintic.InOut,SINUSOIDAL_IN:wi.Sinusoidal.In,SINUSOIDAL_OUT:wi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:wi.Sinusoidal.InOut,EXPONENTIAL_IN:wi.Exponential.In,EXPONENTIAL_OUT:wi.Exponential.Out,EXPONENTIAL_IN_OUT:wi.Exponential.InOut,CIRCULAR_IN:wi.Circular.In,CIRCULAR_OUT:wi.Circular.Out,CIRCULAR_IN_OUT:wi.Circular.InOut,ELASTIC_IN:wi.Elastic.In,ELASTIC_OUT:wi.Elastic.Out,ELASTIC_IN_OUT:wi.Elastic.InOut,BACK_IN:wi.Back.In,BACK_OUT:wi.Back.Out,BACK_IN_OUT:wi.Back.InOut,BOUNCE_IN:wi.Bounce.In,BOUNCE_OUT:wi.Bounce.Out,BOUNCE_IN_OUT:wi.Bounce.InOut},$r=Object.freeze(iot);function NV(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}NV.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ae(this.view.position);t.flyToBoundingSphere(o,i)}};NV.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};NV.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=$r.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=xt(t,e)),t};var FV=NV;function nY(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}nY.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};nY.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var BV=nY;var Kpe={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=oT(t),Kpe[t]}},lY;typeof DOMParser<"u"&&(lY=new DOMParser);var oot=new Mk({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Fy=32,Upe=2414016,zpe=1,Hpe=16093e3,Gpe=.1,Wpe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],jpe=["http://www.google.com/kml/ext/2.2"],rot=["http://www.w3.org/2005/Atom"],Re={kml:Wpe,gx:jpe,atom:rot,kmlgx:Wpe.concat(jpe)},uY={Document:rge,Folder:Eot,Placemark:Sot,NetworkLink:Lot,GroundOverlay:Rot,PhotoOverlay:cge,ScreenOverlay:Pot,Tour:wot};function Pm(e){this._dataSource=e,this._deferred=jl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Pm.prototype,{dataSource:{get:function(){return this._dataSource}}});Pm.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Pm.prototype.addPromise=function(e){this._promises.push(e)};Pm.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Pm.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=vu._getTimestamp()),this._process(e)};Pm.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=vu._getTimestamp(),e._process(!0)},0)};Pm.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};Pm.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Pm.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=uY[i.localName];if(l(o)&&(Re.kml.indexOf(i.namespaceURI)!==-1||Re.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||vu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function sot(e){let t=e.slice(0,Math.min(4,e.size)),n=jl(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function aot(e){let t=jl(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function Zpe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function $pe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function cot(e,t){return Promise.resolve(e.getData(new hV)).then(function(n){n=Zpe(n),n=$pe(n),t.kml=lY.parseFromString(n,"application/xml")})}function iY(e,t){let n=y(Kpe.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new fV(n))).then(function(i){t[e.filename]=i})}function Eu(e,t,n,i){let o=i.keys,r=new gI.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let h=new gI.default(u).absoluteTo(r).toString(),p=o.indexOf(h);if(p!==-1){let _=o[p];c.setAttribute(n,i[_]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",_)}}}}function Su(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=fY(a,i);l(c)&&s.setAttribute(n,c.url)}}function Qpe(e,t,n){let i=Ss(e,"id");i=l(i)&&i.length!==0?i:zn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=zn(),l(n)&&(i=n+i)),o=t.add(new or({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new kot),o}function _I(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function zV(e,t){if(!l(e))return d.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return d.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,d.fromDegrees(i,o,r,t)}function kV(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=zV(n[s],t);return o}function By(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ss(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Di(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function qpe(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Qd(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Zn(e,t,n){let i=Di(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Dn(e,t,n){let i=Di(e,t,n);if(l(i))return i.textContent.trim()}function Jd(e,t,n){let i=Di(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function fY(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new Se({url:o});else{let r=new gI.default(t.getUrlComponent()),s=new gI.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Se({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Ll={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function aY(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(Ll.maximumRed=r,Ll.red=void 0):(Ll.maximumRed=void 0,Ll.red=0),o>0?(Ll.maximumGreen=o,Ll.green=void 0):(Ll.maximumGreen=void 0,Ll.green=0),i>0?(Ll.maximumBlue=i,Ll.blue=void 0):(Ll.maximumBlue=void 0,Ll.blue=0),Ll.alpha=n,z.fromRandom(Ll)):new z(r,o,i,n)}function rb(e,t,n){let i=Dn(e,t,n);if(l(i))return aY(i,Dn(e,"colorMode",n)==="random")}function lot(e){let t=Di(e,"TimeStamp",Re.kmlgx),n=Dn(t,"when",Re.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=Z.fromIso8601(n),o=new Yr;return o.addInterval(new En({start:i,stop:He.MAXIMUM_VALUE})),o}function uot(e){let t=Di(e,"TimeSpan",Re.kmlgx);if(!l(t))return;let n,i=Di(t,"begin",Re.kmlgx),o=l(i)?Z.fromIso8601(i.textContent):void 0,r=Di(t,"end",Re.kmlgx),s=l(r)?Z.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(Z.lessThan(s,o)){let a=o;o=s,s=a}n=new Yr,n.addInterval(new En({start:o,stop:s}))}else l(o)?(n=new Yr,n.addInterval(new En({start:o,stop:He.MAXIMUM_VALUE}))):l(s)&&(n=new Yr,n.addInterval(new En({start:He.MINIMUM_VALUE,stop:s})));return n}function Jpe(){let e=new Sc;return e.width=Fy,e.height=Fy,e.scaleByDistance=new Bt(Upe,zpe,Hpe,Gpe),e.pixelOffsetScaleByDistance=new Bt(Upe,zpe,Hpe,Gpe),e}function dY(){let e=new Fh;return e.outline=!0,e.outlineColor=z.WHITE,e}function ege(){let e=new Nh;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=xi.LEFT,e.font="16px sans-serif",e.style=Xo.FILL_AND_OUTLINE,e}function hY(e,t,n,i,o){let r=Dn(e,"href",Re.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y(Zn(e,"x",Re.gx),0),u=y(Zn(e,"y",Re.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=fY(r,n,i);if(o){let a=Dn(e,"refreshMode",Re.kml),c=Dn(e,"viewRefreshMode",Re.kml);a==="onInterval"||a==="onExpire"?yt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&yt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(Dn(e,"viewBoundScale",Re.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=y(Dn(e,"viewFormat",Re.kml),f),p=Dn(e,"httpQuery",Re.kml);l(h)&&s.setQueryParameters(Xu(UV(h))),l(p)&&s.setQueryParameters(Xu(UV(p)));let _=t._ellipsoid;return pY(s,t.camera,t.canvas,u,t._lastCameraView.bbox,_),s}return s}function fot(e,t,n,i,o){let r=Zn(t,"scale",Re.kml),s=Zn(t,"heading",Re.kml),a=rb(t,"color",Re.kml),c=Di(t,"Icon",Re.kml),u=hY(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=Zn(c,"x",Re.gx),h=Zn(c,"y",Re.gx),p=Zn(c,"w",Re.gx),_=Zn(c,"h",Re.gx),m=Di(t,"hotSpot",Re.kml),x=By(m,"x"),b=By(m,"y"),T=Ss(m,"xunits"),C=Ss(m,"yunits"),A=n.billboard;l(A)||(A=Jpe(),n.billboard=A),A.image=u,A.scale=r,A.color=a,(l(f)||l(h)||l(p)||l(_))&&(A.imageSubRegion=new qe(f,h,p,_)),l(s)&&s!==0&&(A.rotation=P.toRadians(-s),A.alignedAxis=d.UNIT_Z),r=y(r,1);let S,v;l(x)&&(T==="pixels"?S=-x*r:T==="insetPixels"?S=(x-Fy)*r:T==="fraction"&&(S=-x*Fy*r),S+=Fy*.5*r),l(b)&&(C==="pixels"?v=b*r:C==="insetPixels"?v=(-b+Fy)*r:C==="fraction"&&(v=b*Fy*r),v-=Fy*.5*r),(l(S)||l(v))&&(A.pixelOffset=new U(S,v))}function VV(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")fot(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=ege(),n.label=c),c.scale=y(Zn(a,"scale",Re.kml),c.scale),c.fillColor=y(rb(a,"color",Re.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Pc,n.polyline=c),c.width=Zn(a,"width",Re.kml),c.material=rb(a,"color",Re.kml),l(rb(a,"outerColor",Re.gx))&&yt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Zn(a,"outerWidth",Re.gx))&&yt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Zn(a,"physicalWidth",Re.gx))&&yt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Jd(a,"labelVisibility",Re.gx))&&yt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=dY(),n.polygon=c),c.material=y(rb(a,"color",Re.kml),c.material),c.fill=y(Jd(a,"fill",Re.kml),c.fill),c.outline=y(Jd(a,"outline",Re.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y(aY(Dn(a,"bgColor",Re.kml)),z.WHITE),u=y(aY(Dn(a,"textColor",Re.kml)),z.BLACK),f=Dn(a,"text",Re.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Dn(a,"listItemType",Re.kml);(c==="radioFolder"||c==="checkOffOnly")&&yt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function dot(e,t,n,i,o){let r=new or,s,a=-1,c=t.childNodes,u=c.length;for(let h=0;h<u;h++){let p=c[h];(p.localName==="Style"||p.localName==="StyleMap")&&(a=h)}if(a!==-1){let h=c[a];if(h.localName==="Style")VV(e,h,r,i,o);else{let p=Qd(h,"Pair",Re.kml);for(let _=0;_<p.length;_++){let m=p[_],x=Dn(m,"key",Re.kml);if(x==="normal"){let b=Dn(m,"styleUrl",Re.kml);if(l(b))s=n.getById(b),l(s)||(s=n.getById(`#${b}`)),l(s)&&r.merge(s);else{let T=Di(m,"Style",Re.kml);VV(e,T,r,i,o)}}else yt(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let f=Dn(t,"styleUrl",Re.kml);if(l(f)){let h=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),_=p[0];h=`${i.getDerivedResource({url:_}).getUrlComponent()}#${p[1]}`}s=n.getById(h),l(s)||(s=n.getById(`#${h}`)),l(s)&&r.merge(s)}return r}function hot(e,t,n){return t.fetchXML().then(function(i){return tge(e,i,n,t,!0)})}function tge(e,t,n,i,o,r){let s,a,c,u,f=qpe(t,"Style",Re.kml);if(l(f)){let x=f.length;for(s=0;s<x;s++)u=f[s],a=Ss(u,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new or({id:a}),n.add(c),VV(e,u,c,i,r)))}let h=qpe(t,"StyleMap",Re.kml);if(l(h)){let x=h.length;for(s=0;s<x;s++){let b=h[s];if(a=Ss(b,"id"),l(a)){let T=Qd(b,"Pair",Re.kml);for(let C=0;C<T.length;C++){let A=T[C],S=Dn(A,"key",Re.kml);if(S==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Dn(A,"styleUrl",Re.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),o&&l(i)&&(v=i.getUrlComponent()+v);let D=n.getById(v);l(D)&&c.merge(D)}else u=Di(A,"Style",Re.kml),VV(e,u,c,i,r)}}else yt(`kml-styleMap-${S}`,`KML - Unsupported StyleMap key: ${S}`)}}}}let p=[],_=t.getElementsByTagName("styleUrl"),m=_.length;for(s=0;s<m;s++){let x=_[s].textContent;if(x[0]!=="#"){let b=x.split("#");if(b.length===2){let T=b[0],C=i.getDerivedResource({url:T});p.push(hot(e,C,n))}}}return p}function mY(e,t,n){let i=new cy(e,t.id,["position"]),o=new rg(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Pc,t.polyline.positions=new sy([i,o])}function nge(e,t){return!l(e)&&!l(t)||e==="clampToGround"?Ye.CLAMP_TO_GROUND:e==="relativeToGround"?Ye.RELATIVE_TO_GROUND:e==="absolute"?Ye.NONE:t==="clampToSeaFloor"?(yt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Ye.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(yt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Ye.RELATIVE_TO_GROUND):(l(e)?yt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):yt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Ye.CLAMP_TO_GROUND)}function mot(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new rg(e))}function pot(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function HV(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():ege(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():Jpe(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(z.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new U(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function ige(e,t){let n=e.path;l(n)||(n=new Jg,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function got(e,t,n,i,o){let r=Dn(n,"coordinates",Re.kml),s=Dn(n,"altitudeMode",Re.kml),a=Dn(n,"altitudeMode",Re.gx),c=Jd(n,"extrude",Re.kml),u=e._ellipsoid,f=zV(r,u);return i.position=f,HV(e,i,o,nge(s,a)),c&&_I(s,a)&&mY(t,i,o),!0}function Ype(e,t,n,i,o){let r=Di(n,"coordinates",Re.kml),s=Dn(n,"altitudeMode",Re.kml),a=Dn(n,"altitudeMode",Re.gx),c=Jd(n,"extrude",Re.kml),u=Jd(n,"tessellate",Re.kml),f=_I(s,a),h=Zn(n,"drawOrder",Re.gx),p=e._ellipsoid,_=kV(r,p),m=o.polyline;if(f&&c){let x=new e_;i.wall=x,x.positions=_;let b=o.polygon;l(b)&&(x.fill=b.fill,x.material=b.material),x.outline=!0,l(m)?(x.outlineColor=l(m.material)?m.material.color:z.WHITE,x.outlineWidth=m.width):l(b)&&(x.outlineColor=l(b.material)?b.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let x=new Pc;x.clampToGround=!0,i.polyline=x,x.positions=_,l(m)?(x.material=l(m.material)?m.material.color.getValue(He.MINIMUM_VALUE):z.WHITE,x.width=y(m.width,1)):(x.material=z.WHITE,x.width=1),x.zIndex=h}else l(h)&&yt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&yt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new Pc,i.polyline=m,m.positions=pot(_,s,a,p),(!u||f)&&(m.arcType=Jt.NONE);return!0}function _ot(e,t,n,i,o){let r=Di(n,"outerBoundaryIs",Re.kml),s=Di(r,"LinearRing",Re.kml),a=Di(s,"coordinates",Re.kml),c=e._ellipsoid,u=kV(a,c),f=Jd(n,"extrude",Re.kml),h=Dn(n,"altitudeMode",Re.kml),p=Dn(n,"altitudeMode",Re.gx),_=_I(h,p),m=l(o.polygon)?o.polygon.clone():dY(),x=o.polyline;if(l(x)&&(m.outlineColor=l(x.material)?x.material.color:z.WHITE,m.outlineWidth=x.width),i.polygon=m,_?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let b=new Ka(u),T=Qd(n,"innerBoundaryIs",Re.kml);for(let C=0;C<T.length;C++){s=Qd(T[C],"LinearRing",Re.kml);for(let A=0;A<s.length;A++)a=Di(s[A],"coordinates",Re.kml),u=kV(a,c),l(u)&&b.holes.push(new Ka(u))}m.hierarchy=b}return!0}function yot(e,t,n,i,o){let r=Dn(n,"altitudeMode",Re.kml),s=Dn(n,"altitudeMode",Re.gx),a=Qd(n,"coord",Re.gx),c=Qd(n,"angles",Re.gx),u=Qd(n,"when",Re.kml),f=Jd(n,"extrude",Re.kml),h=_I(r,s),p=e._ellipsoid;c.length>0&&yt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let _=Math.min(a.length,u.length),m=[],x=[];for(let T=0;T<_;T++){let C=zV(a[T].textContent,p);m.push(C),x.push(Z.fromIso8601(u[T].textContent))}let b=new wa;return b.addSamples(x,m),i.position=b,HV(e,i,o,nge(r,s)),ige(i,o),i.availability=new Yr,u.length>0&&i.availability.addInterval(new En({start:x[0],stop:x[x.length-1]})),h&&f&&mY(t,i,o),!0}function Xpe(e,t,n,i,o,r,s,a,c){let u=e[0],f=e[e.length-1],h=new wa;h.addSamples(e,t),n.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:mot(h,s,a)})),i.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function xot(e,t,n,i,o){let r=Jd(n,"interpolate",Re.gx),s=Qd(n,"Track",Re.gx),a,c,u,f=!1,h=new fy,p=new Yr,_=new va,m=e._ellipsoid;for(let x=0,b=s.length;x<b;x++){let T=s[x],C=Qd(T,"when",Re.kml),A=Qd(T,"coord",Re.gx),S=Dn(T,"altitudeMode",Re.kml),v=Dn(T,"altitudeMode",Re.gx),D=_I(S,v),O=Jd(T,"extrude",Re.kml),R=Math.min(A.length,C.length),M=[];a=[];for(let L=0;L<R;L++){let g=zV(A[L].textContent,m);M.push(g),a.push(Z.fromIso8601(C[L].textContent))}r&&(l(c)&&Xpe([c,a[0]],[u,M[0]],_,p,h,!1,"absolute",void 0,!1),c=a[R-1],u=M[M.length-1]),Xpe(a,M,_,p,h,D&&O,S,v,!0),f=f||D&&O}return i.availability=p,i.position=_,HV(e,i,o),ige(i,o),f&&(mY(t,i,o),i.polyline.show=h),!0}var oge={Point:got,LineString:Ype,LinearRing:Ype,Polygon:_ot,Track:yot,MultiTrack:xot,MultiGeometry:bot,Model:Tot};function bot(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),h=oge[f.localName];if(l(h)){let p=Qpe(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,f,p,o)&&(a=!0)}}return a}function Tot(e,t,n,i,o){return yt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Cot(e,t){let n=Di(e,"ExtendedData",Re.kml);if(!l(n))return;l(Di(n,"SchemaData",Re.kml))&&yt("kml-schemaData","KML - SchemaData is unsupported"),l(Ss(n,"xmlns:prefix"))&&yt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Qd(n,"Data",Re.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Ss(a,"name");l(c)&&(i[c]={displayName:Dn(a,"displayName",Re.kml),value:Dn(a,"value",Re.kml)})}}t.kml.extendedData=i}var fo;typeof document<"u"&&(fo=document.createElement("div"));function Aot(e,t,n,i,o){let r,s,a,c=t.kml,u=c.extendedData,f=Dn(e,"description",Re.kml),h=y(t.balloonStyle,n.balloonStyle),p=z.WHITE,_=z.BLACK,m=f;l(h)&&(p=y(h.bgColor,z.WHITE),_=y(h.textColor,z.BLACK),m=y(h.text,f));let x;if(l(m)){if(m=m.replace("$[name]",y(t.name,"")),m=m.replace("$[description]",y(f,"")),m=m.replace("$[address]",y(c.address,"")),m=m.replace("$[Snippet]",y(c.snippet,"")),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let C=m.match(/\$\[.+?\]/g);if(C!==null)for(r=0;r<C.length;r++){let A=C[r],S=A.substr(2,A.length-3),v=/\/displayName$/.test(S);S=S.replace(/\/displayName$/,""),x=u[S],l(x)&&(x=v?x.displayName:x.value),l(x)&&(m=m.replace(A,y(x,"")))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],x=u[s],m+=`<tr><th>${y(x.displayName,s)}</th><td>${y(x.value,"")}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=oot.link(m),fo.innerHTML=m;let b=fo.querySelectorAll("a");for(r=0;r<b.length;r++)b[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Eu(fo,"a","href",i),Eu(fo,"link","href",i),Eu(fo,"area","href",i),Eu(fo,"img","src",i),Eu(fo,"iframe","src",i),Eu(fo,"video","src",i),Eu(fo,"audio","src",i),Eu(fo,"source","src",i),Eu(fo,"track","src",i),Eu(fo,"input","src",i),Eu(fo,"embed","src",i),Eu(fo,"script","src",i),Eu(fo,"video","poster",i)),Su(fo,"a","href",o),Su(fo,"link","href",o),Su(fo,"area","href",o),Su(fo,"img","src",o),Su(fo,"iframe","src",o),Su(fo,"video","src",o),Su(fo,"audio","src",o),Su(fo,"source","src",o),Su(fo,"track","src",o),Su(fo,"input","src",o),Su(fo,"embed","src",o),Su(fo,"script","src",o),Su(fo,"video","poster",o);let T='<div class="cesium-infoBox-description-lighter" style="';T+="overflow:auto;",T+="word-wrap:break-word;",T+=`background-color:${p.toCssColorString()};`,T+=`color:${_.toCssColorString()};`,T+='">',T+=`${fo.innerHTML}</div>`,fo.innerHTML="",t.description=T}function GV(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=Qpe(t,i,n.context),c=a.kml,u=dot(e,t,n.styleCollection,r,s),f=Dn(t,"name",Re.kml);a.name=f,a.parent=o;let h=uot(t);l(h)||(h=lot(t)),a.availability=h,_Y(a);function p(A){return A?A.show&&p(A.parent):!0}let _=Jd(t,"visibility",Re.kml);a.show=p(o)&&y(_,!0);let m=Di(t,"author",Re.atom),x=c.author;x.name=Dn(m,"name",Re.atom),x.uri=Dn(m,"uri",Re.atom),x.email=Dn(m,"email",Re.atom);let b=Di(t,"link",Re.atom),T=c.link;T.href=Ss(b,"href"),T.hreflang=Ss(b,"hreflang"),T.rel=Ss(b,"rel"),T.type=Ss(b,"type"),T.title=Ss(b,"title"),T.length=Ss(b,"length"),c.address=Dn(t,"address",Re.kml),c.phoneNumber=Dn(t,"phoneNumber",Re.kml),c.snippet=Dn(t,"Snippet",Re.kml),Cot(t,a),Aot(t,a,u,s,r);let C=e._ellipsoid;return age(t,a,C),sge(t,a,C),l(Di(t,"Region",Re.kml))&&yt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function rge(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Eot(e,t,n,i){let o=GV(e,t,n),r=Ge(n);r.parentEntity=o.entity,rge(e,t,r,i)}function Sot(e,t,n,i){let o=GV(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let h=c.item(u),p=oge[h.localName];l(p)&&(p(e,n.entityCollection,h,r,s,r.id),a=!0)}a||(r.merge(s),HV(e,r,s))}var vot={FlyTo:Iot,Wait:Dot,SoundCue:oY,AnimatedUpdate:oY,TourControl:oY};function wot(e,t,n,i){let o=Dn(t,"name",Re.kml),r=Ss(t,"id"),s=new LV(o,r),a=Di(t,"Playlist",Re.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let h=u[f];if(h.localName){let p=vot[h.localName];p?p(s,h,c):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(s)}function oY(e,t){yt(`KML Tour unsupported node ${t.localName}`)}function Dot(e,t){let n=Zn(t,"duration",Re.gx);e.addPlaylistEntry(new BV(n))}function Iot(e,t,n){let i=Zn(t,"duration",Re.gx),o=Dn(t,"flyToMode",Re.gx),r={kml:{}};age(t,r,n),sge(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new FV(i,o,s);e.addPlaylistEntry(a)}function sge(e,t,n){let i=Di(e,"Camera",Re.kml);if(l(i)){let o=y(Zn(i,"longitude",Re.kml),0),r=y(Zn(i,"latitude",Re.kml),0),s=y(Zn(i,"altitude",Re.kml),0),a=y(Zn(i,"heading",Re.kml),0),c=y(Zn(i,"tilt",Re.kml),0),u=y(Zn(i,"roll",Re.kml),0),f=d.fromDegrees(o,r,s,n),h=Ga.fromDegrees(a,c-90,u);t.kml.camera=new Fk(f,h)}}function age(e,t,n){let i=Di(e,"LookAt",Re.kml);if(l(i)){let o=y(Zn(i,"longitude",Re.kml),0),r=y(Zn(i,"latitude",Re.kml),0),s=y(Zn(i,"altitude",Re.kml),0),a=Zn(i,"heading",Re.kml),c=Zn(i,"tilt",Re.kml),u=y(Zn(i,"range",Re.kml),0);c=P.toRadians(y(c,0)),a=P.toRadians(y(a,0));let f=new Kd(a,c-P.PI_OVER_TWO,u),h=d.fromDegrees(o,r,s,n);t.kml.lookAt=new OV(h,f)}}function Pot(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Di(t,"Icon",Re.kml),c=hY(a,e,r,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],h=Di(t,"screenXY",Re.kml),p=Di(t,"overlayXY",Re.kml),_=Di(t,"size",Re.kml),m,x,b,T,C,A;l(_)&&(m=By(_,"x"),x=By(_,"y"),b=Ss(_,"xunits"),T=Ss(_,"yunits"),l(m)&&m!==-1&&m!==0&&(b==="fraction"?C=`width: ${Math.floor(m*100)}%`:b==="pixels"&&(C=`width: ${m}px`),f.push(C)),l(x)&&x!==-1&&x!==0&&(T==="fraction"?A=`height: ${Math.floor(x*100)}%`:T==="pixels"&&(A=`height: ${x}px`),f.push(A))),u.style=f.join(";");let S=0,v=u.height;l(p)&&(m=By(p,"x"),x=By(p,"y"),b=Ss(p,"xunits"),T=Ss(p,"yunits"),l(m)&&(b==="fraction"?S=m*u.width:(b==="pixels"||b==="insetPixels")&&(S=m)),l(x)&&(T==="fraction"?v=x*u.height:(T==="pixels"||T==="insetPixels")&&(v=x))),l(h)&&(m=By(h,"x"),x=By(h,"y"),b=Ss(h,"xunits"),T=Ss(h,"yunits"),l(m)&&(b==="fraction"?C=`left: calc(${Math.floor(m*100)}% - ${S}px)`:b==="pixels"?C=`left: ${m-S}px`:b==="insetPixels"&&(C=`right: ${m-S}px`),f.push(C)),l(x)&&(T==="fraction"?A=`bottom: calc(${Math.floor(x*100)}% - ${v}px)`:T==="pixels"?A=`bottom: ${x-v}px`:T==="insetPixels"&&(A=`top: ${x-v}px`),f.push(A))),u.style=f.join(";")},o.appendChild(u)}function Rot(e,t,n,i){let r=GV(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=kV(Di(t,"LatLonQuad",Re.gx),c),f=Zn(t,"drawOrder",Re.kml);if(l(u))s=dY(),s.hierarchy=new Ka(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new Bh,s.zIndex=f,r.rectangle=s;let m=Di(t,"LatLonBox",Re.kml);if(l(m)){let x=Zn(m,"west",Re.kml),b=Zn(m,"south",Re.kml),T=Zn(m,"east",Re.kml),C=Zn(m,"north",Re.kml);l(x)&&(x=P.negativePiToPi(P.toRadians(x))),l(b)&&(b=P.clampToLatitudeRange(P.toRadians(b))),l(T)&&(T=P.negativePiToPi(P.toRadians(T))),l(C)&&(C=P.clampToLatitudeRange(P.toRadians(C))),s.coordinates=new se(x,b,T,C);let A=Zn(m,"rotation",Re.kml);if(l(A)){let S=P.toRadians(A);s.rotation=S,s.stRotation=S}}}let h=Di(t,"Icon",Re.kml),p=hY(h,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&yt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=Zn(h,"x",Re.gx),x=Zn(h,"y",Re.gx),b=Zn(h,"w",Re.gx),T=Zn(h,"h",Re.gx);(l(m)||l(x)||l(b)||l(T))&&yt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=rb(t,"color",Re.kml),s.material.transparent=!0}else s.material=rb(t,"color",Re.kml);let _=Dn(t,"altitudeMode",Re.kml);l(_)?_==="absolute"?(s.height=Zn(t,"altitude",Re.kml),s.zIndex=void 0):_!=="clampToGround"&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${_}`):(_=Dn(t,"altitudeMode",Re.gx),_==="relativeToSeaFloor"?(yt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Zn(t,"altitude",Re.kml),s.zIndex=void 0):_==="clampToSeaFloor"?yt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(_)&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${_}`))}function cge(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),yt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var ky={INTERVAL:0,EXPIRE:1,STOP:2};function UV(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Oot=new se,yE=new fe,rY=new U,Mot=new d;function pY(e,t,n,i,o,r){function s(u){return u<-P.PI_OVER_TWO?-P.PI_OVER_TWO:u>P.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=aT(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(o=y(o,Oot),l(n)&&(rY.x=n.clientWidth*.5,rY.y=n.clientHeight*.5,u=t.pickEllipsoid(rY,r,Mot)),l(u)?f=r.cartesianToCartographic(u,yE):(f=se.center(o,yE),u=r.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let T=o.width*i*.5,C=o.height*i*.5;o=new se(a(f.longitude-T),s(f.latitude-C),a(f.longitude+T),s(f.latitude+C))}c=c.replace("[bboxWest]",P.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(o.north).toString());let h=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",h),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",d.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",h),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,yE),c=c.replace("[cameraLon]",P.toDegrees(yE.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(yE.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(yE.height).toString());let _=t.frustum,m=_.aspectRatio,x="",b="";if(l(m)){let T=P.toDegrees(_.fov);m>1?(x=T,b=T/m):(b=T,x=T*m)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",b.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Xu(c))}function Lot(e,t,n,i){let r=GV(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Di(t,"Link",Re.kml);if(l(c)||(c=Di(t,"Url",Re.kml)),l(c)){let u=Dn(c,"href",Re.kml),f,h;if(l(u)){let p=u;if(u=fY(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Dn(c,"viewRefreshMode",Re.kml),f==="onRegion"){yt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=y(Dn(c,"viewBoundScale",Re.kml),1);let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",T=y(Dn(c,"viewFormat",Re.kml),b),C=Dn(c,"httpQuery",Re.kml);l(T)&&u.setQueryParameters(Xu(UV(T))),l(C)&&u.setQueryParameters(Xu(UV(C)));let A=e._ellipsoid;pY(u,e.camera,e.canvas,h,e._lastCameraView.bbox,A)}let _={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new aa,x=gY(e,m,u,_).then(function(b){let T=e._entityCollection,C=m.values;T.suspendEvents();for(let v=0;v<C.length;v++){let D=C[v];l(D.parent)||(D.parent=r,_Y(D)),T.add(D)}T.resumeEvents();let A=Dn(c,"refreshMode",Re.kml),S=y(Zn(c,"refreshInterval",Re.kml),0);if(A==="onInterval"&&S>0||A==="onExpire"||f==="onStop"){let v=Di(b,"NetworkLinkControl",Re.kml),D=l(v),O=Z.now(),R={id:zn(),href:u,cookie:{},lastUpdated:O,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:O},M=0;if(D&&(R.cookie=Xu(y(Dn(v,"cookie",Re.kml),"")),M=y(Zn(v,"minRefreshPeriod",Re.kml),0)),A==="onInterval")D&&(S=Math.max(M,S)),R.refreshMode=ky.INTERVAL,R.time=S;else if(A==="onExpire"){let L;if(D&&(L=Dn(v,"expires",Re.kml)),l(L))try{let g=Z.fromIso8601(L),E=Z.secondsDifference(g,O);E>0&&E<M&&Z.addSeconds(O,M,g),R.refreshMode=ky.EXPIRE,R.time=g}catch{yt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else yt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=ky.STOP,R.time=y(Zn(c,"viewRefreshTime",Re.kml),0)):yt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(b){yt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,b)});i.addPromise(x)}}}function Not(e,t,n,i){let o=uY[t.localName];return l(o)?o(e,t,n,i):cge(e,t,n,i)}function cY(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Di(a,"Document",Re.kml),u=Dn(c,"name",Re.kml);l(u)||(u=ry(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new vu._DeferredLoading(e),h=new aa(e);return Promise.all(tge(e,n,h,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let x=0;x<m.length;x++){let b=m[x];if(l(uY[b.localName])){p=b;break}}}let _={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),Not(e,p,_,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function Fot(e,t,n,i,o){let r=en("ThirdParty/Workers/z-worker-pako.js");lE({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new wV(new ug(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],u={},f;for(let h=0;h<a.length;h++){let p=a[h];p.directory||(/\.kml$/i.test(p.filename)&&(!l(f)||!/\//i.test(p.filename))?(l(f)&&c.push(iY(f,u)),f=p):c.push(iY(p,u)))}return l(f)&&c.push(cot(f,u)),Promise.all(c).then(function(){if(s.close(),!l(u.kml))throw new re("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),cY(e,t,u.kml,i,u,o)})})}function gY(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Se){n=Se.createIfNeeded(n),c=n.fetchBlob(),o=y(o,n.clone());let u=e._resourceCredits,f=n.credits;if(l(f)){let h=f.length;for(let p=0;p<h;p++)u.push(f[p])}}else o=y(o,Se.DEFAULT.clone());return o=Se.createIfNeeded(o),l(a)&&(a=Rn(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?sot(u).then(function(f){return f?Fot(e,t,u,o,a):aot(u).then(function(h){h=Zpe(h),h=$pe(h);let p,_;try{p=lY.parseFromString(h,"application/xml")}catch(m){_=m.toString()}if(l(_)||p.body||p.documentElement.tagName==="parsererror"){let m=l(_)?_:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new re(m)}return cY(e,t,p,o,r,a,s)})}):cY(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function vu(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new pe,this._error=new pe,this._loading=new pe,this._refresh=new pe,this._unsupportedNode=new pe,this._clock=void 0,this._entityCollection=new aa(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Ay,this._networkLinks=new St,this._entityCluster=new Lf,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?d.clone(t.positionWC):void 0,direction:l(t)?d.clone(t.directionWC):void 0,up:l(t)?d.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():se.clone(se.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,ee.default);let i=e.credit;typeof i=="string"&&(i=new Ct(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}vu.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new vu(t).load(e,t)};Object.defineProperties(vu.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});vu.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),Xr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return gY(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Z.equals(s,He.MINIMUM_VALUE),u=Z.equals(a,He.MAXIMUM_VALUE);if(!c||!u){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=Z.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=Z.fromDate(h)),o=new fm,o.startTime=s,o.stopTime=a,o.currentTime=Z.clone(s),o.clockRange=Kr.LOOP_STOP,o.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Xr.setLoading(i,!1),i}).catch(function(o){return Xr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};vu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function _Y(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function Bot(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Di(r,"NetworkLinkControl",Re.kml),c=l(a),u=0;if(c){if(l(Di(a,"Update",Re.kml))){yt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Xu(y(Dn(a,"cookie",Re.kml),"")),u=y(Zn(a,"minRefreshPeriod",Re.kml),0)}let f=Z.now(),h=t.refreshMode;if(h===ky.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(h===ky.EXPIRE){let O;if(l(a)&&(O=Dn(a,"expires",Re.kml)),l(O))try{let R=Z.fromIso8601(O),M=Z.secondsDifference(R,f);M>0&&M<u&&Z.addSeconds(f,u,R),t.time=R}catch{yt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else yt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,_=e._entityCollection,m=n.values;function x(O){_.remove(O);let R=O._children,M=R.length;for(let L=0;L<M;++L)x(R[L])}_.suspendEvents();let b=_.values.slice(),T;for(T=0;T<b.length;++T){let O=b[T];O.parent===p&&(O.parent=void 0,x(O))}for(_.resumeEvents(),_.suspendEvents(),T=0;T<m.length;T++){let O=m[T];l(O.parent)||(O.parent=p,_Y(O)),_.add(O)}_.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let C=_.computeAvailability(),A=C.start,S=C.stop,v=Z.equals(A,He.MINIMUM_VALUE),D=Z.equals(S,He.MAXIMUM_VALUE);if(!v||!D){let O=e._clock;(O.startTime!==A||O.stopTime!==S)&&(O.startTime=A,O.stopTime=S,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var sY=new St;vu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=Z.now(),i=this;sY.removeAll();function o(f){let h=f._children,p=h.length;for(let _=0;_<p;++_){let m=h[_];sY.set(m.id,m),o(m)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,P.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,P.EPSILON7)&&a.upWC.equalsEpsilon(s.up,P.EPSILON7))&&(s.position=d.clone(a.positionWC),s.direction=d.clone(a.directionWC),s.up=d.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new St,u=!1;return t.values.forEach(function(f){let h=f.entity;if(!sY.contains(h.id)){if(!f.updating){let p=!1;if(f.refreshMode===ky.INTERVAL?Z.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===ky.EXPIRE?Z.greaterThan(n,f.time)&&(p=!0):f.refreshMode===ky.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&Z.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(h),f.updating=!0;let _=new aa,m=f.href.clone();m.setQueryParameters(f.cookie);let x=y(i._ellipsoid,ee.default);pY(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,x),gY(i,_,m,{context:h.id}).then(Bot(i,f,_,c,m)).catch(function(b){let T=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(T),i._error.raiseEvent(i,T)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function kot(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}vu._DeferredLoading=Pm;vu._getTimestamp=Ai;var xE=vu;function yI(){he.throwInstantiationError()}yI.prototype.update=he.throwInstantiationError;yI.prototype.getBoundingSphere=he.throwInstantiationError;yI.prototype.isDestroyed=he.throwInstantiationError;yI.prototype.destroy=he.throwInstantiationError;var lge=yI;var yY=32,Vot="http://www.opengis.net/kml/2.2",th="http://www.google.com/kml/ext/2.2",Uot="http://www.w3.org/2000/xmlns/";function WV(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var zot=/^data:image\/([^,;]+)/;WV.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Se){if(e=Se.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(zot);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function Hot(e,t){return function(n){e._files[t]=n}}WV.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new re("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(Hot(this,r))}return o};Object.defineProperties(WV.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function jV(e){this._time=e}jV.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};jV.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return ab(n)};jV.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function xY(){this._ids={},this._styles={},this._count=0}xY.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};xY.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function dge(){this._ids={}}dge.prototype.get=function(e){if(!l(e))return this.get(zn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function bY(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=bY._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(Uot,"xmlns:gx",th);let a=r.createElement("Document");s.appendChild(a),mge(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?Got(f,c.files):{kml:f,externalFiles:c.files}})}function Got(e,t){let n=en("ThirdParty/Workers/z-worker-pako.js");lE({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new lI,o=new PV(i);return o.add("doc.kml",new dV(e)).then(function(){let r=Object.keys(t);return hge(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function hge(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new ug(n[o])).then(function(){return hge(e,t,n,i+1)})}bY._createState=function(e){let t=e.entities,n=new xY,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===He.MINIMUM_VALUE?r.stop===He.MAXIMUM_VALUE?r=new En:Z.addSeconds(r.stop,-10*s,r.start):r.stop===He.MAXIMUM_VALUE&&Z.addSeconds(r.start,10*s,r.stop);let a=new WV(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Vot,"kml"),ellipsoid:y(e.ellipsoid,ee.default),idManager:new dge,styleCache:n,externalFileHandler:a,time:o,valueGetter:new jV(o),sampleDuration:s,defaultAvailability:new Yr([r])}};function mge(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let h=0;h<a;++h){let p=n[h];c=[],u=[],f=[],Wot(e,p,u,f),jot(e,p.polyline,u,f),fge(e,p.rectangle,u,f,c),fge(e,p.polygon,u,f,c),Kot(e,p,p.model,u,f);let _,m=p.availability;l(m)&&(_=i.createElement("TimeSpan"),Z.equals(m.start,He.MINIMUM_VALUE)||_.appendChild(un(i,"begin",Z.toIso8601(m.start))),Z.equals(m.stop,He.MAXIMUM_VALUE)||_.appendChild(un(i,"end",Z.toIso8601(m.stop))));for(let T=0;T<c.length;++T){let C=c[T];C.setAttribute("id",s.get(p.id)),C.appendChild(un(i,"name",p.name)),C.appendChild(un(i,"visibility",p.show)),C.appendChild(un(i,"description",p.description)),l(_)&&C.appendChild(_),t.appendChild(C)}let x=u.length;if(x>0){let T=i.createElement("Placemark");T.setAttribute("id",s.get(p.id));let C=p.name,A=p.label;if(l(A)){let v=i.createElement("LabelStyle"),D=r.get(A.text);C=l(D)&&D.length>0?D:C;let O=r.getColor(A.fillColor);l(O)&&(v.appendChild(un(i,"color",O)),v.appendChild(un(i,"colorMode","normal")));let R=r.get(A.scale);l(R)&&v.appendChild(un(i,"scale",R)),f.push(v)}T.appendChild(un(i,"name",C)),T.appendChild(un(i,"visibility",p.show)),T.appendChild(un(i,"description",p.description)),l(_)&&T.appendChild(_),t.appendChild(T);let S=f.length;if(S>0){let v=i.createElement("Style");for(let D=0;D<S;++D)v.appendChild(f[D]);T.appendChild(un(i,"styleUrl",o.get(v)))}if(u.length===1)T.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let D=0;D<x;++D)v.appendChild(u[D]);T.appendChild(v)}}let b=p._children;if(b.length>0){let T=i.createElement("Folder");T.setAttribute("id",s.get(p.id)),T.appendChild(un(i,"name",p.name)),T.appendChild(un(i,"visibility",p.show)),T.appendChild(un(i,"description",p.description)),t.appendChild(T),mge(e,T,b)}}}var Nl=new d,Kc=new fe,eh=new Z;function Wot(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){pge(e,t,a,n,i);return}s.get(c,void 0,Nl);let u=un(o,"coordinates",sb(Nl,r)),f=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(cb(e,a.heightReference)),f.appendChild(h),f.appendChild(u),n.push(f);let p=a instanceof Sc?_ge(e,a):gge(e,a);i.push(p)}function pge(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof va?(c=u.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let h=n instanceof Qg,p,_,m,x=[];for(p=0;p<c.length;++p){let T=c.get(p),C=f?u:T.data,A=r.createElement("altitudeMode");C instanceof rg?(C=C._value,A.appendChild(cb(e,Ye.CLAMP_TO_GROUND))):l(n)?A.appendChild(cb(e,n.heightReference)):A.appendChild(cb(e,Ye.NONE));let S=[],v=[];if(C.isConstant){a.get(C,void 0,Nl);let O=un(r,"coordinates",sb(Nl,s));S.push(Z.toIso8601(T.start)),v.push(O),S.push(Z.toIso8601(T.stop)),v.push(O)}else if(C instanceof wa)for(m=C._property._times,_=0;_<m.length;++_)S.push(Z.toIso8601(m[_])),C.getValueInReferenceFrame(m[_],Ui.FIXED,Nl),v.push(sb(Nl,s));else if(C instanceof Bf){m=C._times;let O=C._values;for(_=0;_<m.length;++_)S.push(Z.toIso8601(m[_])),d.fromArray(O,_*3,Nl),v.push(sb(Nl,s))}else{let O=e.sampleDuration;T.start.clone(eh),T.isStartIncluded||Z.addSeconds(eh,O,eh);let R=T.stop;for(;Z.lessThan(eh,R);)C.getValue(eh,Nl),S.push(Z.toIso8601(eh)),v.push(sb(Nl,s)),Z.addSeconds(eh,O,eh);T.isStopIncluded&&Z.equals(eh,R)&&(C.getValue(eh,Nl),S.push(Z.toIso8601(eh)),v.push(sb(Nl,s)))}let D=r.createElementNS(th,"Track");D.appendChild(A);for(let O=0;O<S.length;++O){let R=un(r,"when",S[O]),M=un(r,"coord",v[O],th);D.appendChild(R),D.appendChild(M)}h&&D.appendChild(yge(e,n)),x.push(D)}if(x.length===1)i.push(x[0]);else if(x.length>1){let T=r.createElementNS(th,"MultiTrack");for(p=0;p<x.length;++p)T.appendChild(x[p]);i.push(T)}if(l(n)&&!h){let T=n instanceof Sc?_ge(e,n):gge(e,n);o.push(T)}let b=t.path;if(l(b)){let T=a.get(b.width),C=b.material;if(l(C)||l(T)){let A=r.createElement("LineStyle");l(T)&&A.appendChild(un(r,"width",T)),TY(e,C,A),o.push(A)}}}function gge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(un(n,"color",r)),o.appendChild(un(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(un(n,"scale",s/yY)),o}function _ge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(un(n,"href",s));let _=i.get(t.imageSubRegion);l(_)&&(p.appendChild(un(n,"x",_.x,th)),p.appendChild(un(n,"y",_.y,th)),p.appendChild(un(n,"w",_.width,th)),p.appendChild(un(n,"h",_.height,th))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(un(n,"color",a)),r.appendChild(un(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(un(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=y(c,1),U.divideByScalar(u,c,u);let p=i.get(t.width,yY),_=i.get(t.height,yY),m=i.get(t.horizontalOrigin,xi.CENTER);m===xi.CENTER?u.x-=p*.5:m===xi.RIGHT&&(u.x-=p);let x=i.get(t.verticalOrigin,On.CENTER);x===On.TOP?u.y+=_:x===On.CENTER&&(u.y+=_*.5);let b=n.createElement("hotSpot");b.setAttribute("x",-u.x),b.setAttribute("y",u.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),r.appendChild(b)}let f=i.get(t.rotation),h=i.get(t.alignedAxis);return l(f)&&d.equals(d.UNIT_Z,h)&&(f=P.toDegrees(-f),f===0&&(f=360),r.appendChild(un(n,"heading",f))),r}function jot(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(un(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let h=t.positions,p=s.get(h),_=un(o,"coordinates",sb(p,r));a.appendChild(_);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(un(o,"drawOrder",m,th)),n.push(a);let x=o.createElement("LineStyle"),b=s.get(t.width);l(b)&&x.appendChild(un(o,"width",b)),TY(e,t.material,x),i.push(x)}function qot(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],u=[se.northeast,se.southeast,se.southwest,se.northwest];for(let _=0;_<4;++_)u[_](a,Kc),c.push(`${P.toDegrees(Kc.longitude)},${P.toDegrees(Kc.latitude)},${r}`);let f=un(i,"coordinates",c.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),h.appendChild(p),[h]}function uge(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)fe.fromCartesian(t[f],r,Kc),s.push(`${P.toDegrees(Kc.longitude)},${P.toDegrees(Kc.latitude)},${i?Kc.height:n}`);let c=un(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function Yot(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,h=i.createElement("outerBoundaryIs");h.appendChild(uge(e,f,r,s)),a.push(h);let p=u.holes;if(l(p)){let _=p.length;for(let m=0;m<_;++m){let x=i.createElement("innerBoundaryIs");x.appendChild(uge(e,p[m].positions,r,s)),a.push(x)}}return a}function fge(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Bh;if(a&&s.getMaterialType(t.material)==="Image"){Xot(e,t,o);return}let c=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(un(r,"extrude",!0));let f=a?qot(e,t,u):Yot(e,t,u),h=f.length;for(let b=0;b<h;++b)c.appendChild(f[b]);let p=r.createElement("altitudeMode");p.appendChild(cb(e,t.heightReference)),c.appendChild(p),n.push(c);let _=r.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&_.appendChild(un(r,"fill",m)),TY(e,t.material,_);let x=s.get(t.outline,!1);if(x){_.appendChild(un(r,"outline",x));let b=r.createElement("LineStyle"),T=s.get(t.outlineWidth,1);b.appendChild(un(r,"width",T));let C=s.getColor(t.outlineColor,z.BLACK);b.appendChild(un(r,"color",C)),b.appendChild(un(r,"colorMode","normal")),i.push(b)}i.push(_)}function Xot(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(cb(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(un(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(un(i,"north",P.toDegrees(u.north))),f.appendChild(un(i,"south",P.toDegrees(u.south))),f.appendChild(un(i,"east",P.toDegrees(u.east))),f.appendChild(un(i,"west",P.toDegrees(u.west))),s.appendChild(f);let h=o.get(t.material),p=r.texture(h.image),_=i.createElement("Icon");_.appendChild(un(i,"href",p)),s.appendChild(_);let m=h.color;l(m)&&s.appendChild(un(i,"color",ab(h.color))),n.push(s)}function yge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(un(n,"x",s)),u.appendChild(un(n,"y",s)),u.appendChild(un(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(un(n,"href",c)),r.appendChild(a),r}function Kot(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){pge(e,t,n,i,o);return}let u=yge(e,n),f=r.createElement("altitudeMode");f.appendChild(cb(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,Nl),fe.fromCartesian(Nl,s,Kc);let h=r.createElement("Location");h.appendChild(un(r,"longitude",P.toDegrees(Kc.longitude))),h.appendChild(un(r,"latitude",P.toDegrees(Kc.latitude))),h.appendChild(un(r,"altitude",Kc.height)),u.appendChild(h),i.push(u)}function TY(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,u;switch(a){case"Image":s=ab(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=ab(r.color);break;case"PolylineOutline":s=ab(r.color),c=ab(r.outlineColor),u=r.outlineWidth,n.appendChild(un(i,"outerColor",c,th)),n.appendChild(un(i,"outerWidth",u,th));break;case"Stripe":s=ab(r.oddColor);break}l(s)&&(n.appendChild(un(i,"color",s)),n.appendChild(un(i,"colorMode","normal")))}function cb(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,Ye.NONE),r;switch(o){case Ye.NONE:r=n.createTextNode("absolute");break;case Ye.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case Ye.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function sb(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)fe.fromCartesian(e[o],t,Kc),i.push(`${P.toDegrees(Kc.longitude)},${P.toDegrees(Kc.latitude)},${Kc.height}`);return i.join(" ")}function un(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function ab(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var xge=bY;function Zot(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=` +${o}`),t}var fg=Zot;async function $ot(e,t,n,i){return l(i)||(i=!1),ert(e,t,n,i)}function Qot(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(Tge(i)):r=o.then(Tge(i)).catch(trt(i)),e.shift(),t.push(r),!0}function Jot(e){return new Promise(function(t){setTimeout(t,e)})}function CY(e,t,n){return e.length?Qot(e,t,n)?CY(e,t,n):Jot(100).then(()=>CY(e,t,n)):Promise.resolve()}function ert(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let h={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[f]=h,s.push(h)}a[f].positions.push(n[r])}let c=[];return CY(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function bge(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function Tge(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!bge(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];bge(s,i,n)}}):Promise.resolve()}}function trt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var qV=$ot;var AY=new U;async function Cge(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=r.computeMaximumLevelAtPosition(u);if(o[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,AY);let p=e.loadTileDataAvailability(AY.x,AY.y,1);l(p)&&s.push(p)}let h=i[f];l(h)||(i[f]=h=[]),h.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return qV(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];r.computeMaximumLevelAtPosition(u)!==o[c]&&a.push(u)}return a.length>0&&await Cge(e,a,n),t}var bE=Cge;async function EY(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return r;let c=[se.center(e),se.southeast(e),se.southwest(e),se.northeast(e),se.northwest(e)],u=await EY._sampleTerrainMostDetailed(n,c),f=!1,h=u.reduce(function(_,m){return l(m.height)?(f=!0,Math.max(m.height,_)):_},-Number.MAX_VALUE),p=r;return f&&(p.height+=h),p}EY._sampleTerrainMostDetailed=bE;var TE=EY;var nrt={NONE:0,LERC:1},nh=Object.freeze(nrt);var irt={NONE:0,BITS12:1},ha=Object.freeze(irt);var lb=new d,ort=new d,Wf=new U,YV=new F,rrt=new F,srt=Math.pow(2,12);function ac(e,t,n,i,o,r,s,a,c,u){let f=ha.NONE,h,p;if(l(t)&&l(n)&&l(i)&&l(o)){let _=t.minimum,m=t.maximum,x=d.subtract(m,_,ort),b=i-n;Math.max(d.maximumComponent(x),b)<srt-1?f=ha.BITS12:f=ha.NONE,h=F.inverseTransformation(o,new F);let C=d.negate(_,lb);F.multiply(F.fromTranslation(C,YV),h,h);let A=lb;A.x=1/x.x,A.y=1/x.y,A.z=1/x.z,F.multiply(F.fromScale(A,YV),h,h),p=F.clone(o),F.setTranslation(p,d.ZERO,p),o=F.clone(o,new F);let S=F.fromTranslation(_,YV),v=F.fromScale(x,rrt),D=F.multiply(S,v,YV);F.multiply(o,D,o),F.multiply(p,D,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=d.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(u,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}ac.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,u=i.y;if(this.quantization===ha.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,lb),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,h=P.clamp((o-this.minimumHeight)/f,0,1);U.fromElements(n.x,n.y,Wf);let p=Ln.compressTextureCoordinates(Wf);U.fromElements(n.z,h,Wf);let _=Ln.compressTextureCoordinates(Wf);U.fromElements(c,u,Wf);let m=Ln.compressTextureCoordinates(Wf);if(e[t++]=p,e[t++]=_,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,Wf);let x=Ln.compressTextureCoordinates(Wf);e[t++]=x}}else d.subtract(n,this.center,lb),e[t++]=lb.x,e[t++]=lb.y,e[t++]=lb.z,e[t++]=o,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Ln.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var art=new d,Age=new d;ac.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let f=0;f<i;f++){let h=s*i+f,p=s*r+f;t[p]=e[h]}let a=this.decodePosition(t,s,art),c=n.geodeticSurfaceNormal(a,Age),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};ac.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};ac.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new d),t*=this.stride,this.quantization===ha.BITS12){let i=Ln.decompressTextureCoordinates(e[t],Wf);n.x=i.x,n.y=i.y;let o=Ln.decompressTextureCoordinates(e[t+1],Wf);return n.z=o.x,F.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],d.add(n,this.center,n)};ac.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,Age),a=this.decodeHeight(e,t),c=Dr.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};ac.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===ha.BITS12?Ln.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};ac.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===ha.BITS12?Ln.decompressTextureCoordinates(e[t+1],Wf).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};ac.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===ha.BITS12?Ln.decompressTextureCoordinates(e[t+3],Wf).x:e[t+6]};ac.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return U.fromElements(o,r,n)};ac.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};ac.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case ha.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var XV={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},KV={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};ac.prototype.getAttributes=function(e){let t=X.FLOAT,n=X.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===ha.NONE){s(XV.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(XV.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(XV.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(KV.compressed0,a?4:3),c&&s(KV.compressed1,1),this.hasGeodeticSurfaceNormals&&s(KV.geodeticSurfaceNormal,3)}return r};ac.prototype.getAttributeLocations=function(){return this.quantization===ha.NONE?XV:KV};ac.clone=function(e,t){if(l(e))return l(t)||(t=new ac),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=d.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Zc=ac;var Rm={};Rm.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var SY=new d,crt=new F,lrt=new d,urt=new d;Rm.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,u=e.width,f=e.height,h=e.skirtHeight,p=h>0,_=y(e.isGeographic,!0),m=y(e.ellipsoid,ee.default),x=1/m.maximumRadius,b=se.clone(e.nativeRectangle),T=se.clone(e.rectangle),C,A,S,v;l(T)?(C=T.west,A=T.south,S=T.east,v=T.north):_?(C=a(b.west),A=a(b.south),S=a(b.east),v=a(b.north)):(C=b.west*x,A=s-2*o(r(-b.south*x)),S=b.east*x,v=s-2*o(r(-b.north*x)));let D=e.relativeToCenter,O=l(D);D=O?D:d.ZERO;let R=y(e.includeWebMercatorT,!1),M=y(e.exaggeration,1),L=y(e.exaggerationRelativeHeight,0),E=M!==1,w=y(e.structure,Rm.DEFAULT_STRUCTURE),I=y(w.heightScale,Rm.DEFAULT_STRUCTURE.heightScale),N=y(w.heightOffset,Rm.DEFAULT_STRUCTURE.heightOffset),B=y(w.elementsPerHeight,Rm.DEFAULT_STRUCTURE.elementsPerHeight),H=y(w.stride,Rm.DEFAULT_STRUCTURE.stride),V=y(w.elementMultiplier,Rm.DEFAULT_STRUCTURE.elementMultiplier),G=y(w.isBigEndian,Rm.DEFAULT_STRUCTURE.isBigEndian),k=se.computeWidth(b),W=se.computeHeight(b),Y=k/(u-1),J=W/(f-1);_||(k*=x,W*=x);let j=m.radiiSquared,K=j.x,Q=j.y,de=j.z,xe=65536,ce=-65536,_e=Ot.eastNorthUpToFixedFrame(D,m),be=F.inverseTransformation(_e,crt),De,Ae;R&&(De=Mi.geodeticLatitudeToMercatorAngle(A),Ae=1/(Mi.geodeticLatitudeToMercatorAngle(v)-De));let ke=lrt;ke.x=Number.POSITIVE_INFINITY,ke.y=Number.POSITIVE_INFINITY,ke.z=Number.POSITIVE_INFINITY;let ze=urt;ze.x=Number.NEGATIVE_INFINITY,ze.y=Number.NEGATIVE_INFINITY,ze.z=Number.NEGATIVE_INFINITY;let et=Number.POSITIVE_INFINITY,Et=u*f,ht=h>0?u*2+f*2:0,Be=Et+ht,qt=new Array(Be),Tt=new Array(Be),lt=new Array(Be),Wn=R?new Array(Be):[],on=E?new Array(Be):[],me=0,Ce=f,hn=0,ft=u;p&&(--me,++Ce,--hn,++ft);let to=1e-5;for(let Xe=me;Xe<Ce;++Xe){let dt=Xe;dt<0&&(dt=0),dt>=f&&(dt=f-1);let Ht=b.north-J*dt;_?Ht=a(Ht):Ht=s-2*o(r(-Ht*x));let _n=(Ht-A)/(v-A);_n=P.clamp(_n,0,1);let So=Xe===me,yo=Xe===Ce-1;h>0&&(So?Ht+=to*W:yo&&(Ht-=to*W));let Na=t(Ht),Fa=n(Ht),_i=de*Fa,fi;R&&(fi=(Mi.geodeticLatitudeToMercatorAngle(Ht)-De)*Ae);for(let Xs=hn;Xs<ft;++Xs){let kr=Xs;kr<0&&(kr=0),kr>=u&&(kr=u-1);let ol=dt*(u*H)+kr*H,po;if(B===1)po=c[ol];else{po=0;let Ro;if(G)for(Ro=0;Ro<B;++Ro)po=po*V+c[ol+Ro];else for(Ro=B-1;Ro>=0;--Ro)po=po*V+c[ol+Ro]}po=po*I+N,ce=Math.max(ce,po),xe=Math.min(xe,po);let Ar=b.west+Y*kr;_?Ar=a(Ar):Ar=Ar*x;let Zm=(Ar-C)/(S-C);Zm=P.clamp(Zm,0,1);let Vr=dt*u+kr;if(h>0){let Ro=Xs===hn,cn=Xs===ft-1,Ee=So||yo||Ro||cn;if((So||yo)&&(Ro||cn))continue;Ee&&(po-=h,Ro?(Vr=Et+(f-dt-1),Ar-=to*k):yo?Vr=Et+f+(u-kr-1):cn?(Vr=Et+f+u+dt,Ar+=to*k):So&&(Vr=Et+f+u+f+kr))}let Uu=Na*t(Ar),Ba=Na*n(Ar),b0=K*Uu,Ks=Q*Ba,yc=1/i(b0*Uu+Ks*Ba+_i*Fa),es=b0*yc,zu=Ks*yc,Hu=_i*yc,Gu=new d;Gu.x=es+Uu*po,Gu.y=zu+Ba*po,Gu.z=Hu+Fa*po,F.multiplyByPoint(be,Gu,SY),d.minimumByComponent(SY,ke,ke),d.maximumByComponent(SY,ze,ze),et=Math.min(et,po),qt[Vr]=Gu,lt[Vr]=new U(Zm,_n),Tt[Vr]=po,R&&(Wn[Vr]=fi),E&&(on[Vr]=m.geodeticSurfaceNormal(Gu))}}let Eo=ae.fromPoints(qt),Ys;l(T)&&(Ys=wn.fromRectangle(T,xe,ce,m));let Cr;O&&(Cr=new oy(m).computeHorizonCullingPointPossiblyUnderEllipsoid(D,qt,xe));let hs=new z0(ke,ze,D),Le=new Zc(D,hs,et,ce,_e,!1,R,E,M,L),it=new Float32Array(Be*Le.stride),je=0;for(let Xe=0;Xe<Be;++Xe)je=Le.encode(it,je,qt[Xe],lt[Xe],Tt[Xe],void 0,Wn[Xe],on[Xe]);return{vertices:it,maximumHeight:ce,minimumHeight:xe,encoding:Le,boundingSphere3D:Eo,orientedBoundingBox:Ys,occludeePointInScaledSpace:Cr}};var xI=Rm;function Vy(){he.throwInstantiationError()}Object.defineProperties(Vy.prototype,{credits:{get:he.throwInstantiationError},waterMask:{get:he.throwInstantiationError}});Vy.prototype.interpolateHeight=he.throwInstantiationError;Vy.prototype.isChildAvailable=he.throwInstantiationError;Vy.prototype.createMesh=he.throwInstantiationError;Vy.prototype.upsample=he.throwInstantiationError;Vy.prototype.wasCreatedByUpsampling=he.throwInstantiationError;Vy.maximumAsynchronousTasks=5;var Om=Vy;function frt(e,t,n,i,o,r,s,a,c,u,f,h,p,_,m,x){this.center=e,this.vertices=t,this.stride=y(u,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=h,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=_,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=x}var ih=frt;function $c(){he.throwInstantiationError()}Object.defineProperties($c.prototype,{errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},hasWaterMask:{get:he.throwInstantiationError},hasVertexNormals:{get:he.throwInstantiationError},availability:{get:he.throwInstantiationError}});var Ege=[];$c.getRegularGridIndices=function(e,t){let n=Ege[e];l(n)||(Ege[e]=n=[]);let i=n[t];return l(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),Dge(e,t,i,0)),i};var Sge=[];$c.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Sge[e];l(n)||(Sge[e]=n=[]);let i=n[t];if(!l(i)){let o=$c.getRegularGridIndices(e,t),r=wge(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var vge=[];$c.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=vge[e];l(n)||(vge[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,u=r+a,f=wge(e,t),h=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,_=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,x=Ne.createTypedArray(c,u);Dge(e,t,x,0),$c.addSkirtIndices(h,p,_,m,o,x,r),i=n[t]={indices:x,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:_,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};$c.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=ZV(e,a,r,s),a+=e.length,s=ZV(t,a,r,s),a+=t.length,s=ZV(n,a,r,s),a+=n.length,ZV(i,a,r,s)};function wge(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function Dge(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function ZV(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}$c.heightmapTerrainQuality=.25;$c.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*$c.heightmapTerrainQuality/(t*n)};$c.prototype.requestTileGeometry=he.throwInstantiationError;$c.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;$c.prototype.getTileDataAvailable=he.throwInstantiationError;$c.prototype.loadTileDataAvailability=he.throwInstantiationError;var ls=$c;function dg(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,nh.NONE);let t=xI.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===nh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(dg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var Ige="createVerticesFromHeightmap",drt=new yi(Ige),hrt=new yi(Ige,Om.maximumAsynchronousTasks);dg.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),h=c.cartographicToCartesian(se.center(f)),p=this._structure,m=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let b=(a?hrt:drt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:h,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Pi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(b))return;let T=this;return Promise.resolve(b).then(function(C){let A;T._skirtHeight>0?A=ls.getRegularGridAndSkirtIndicesAndEdgeIndices(C.gridWidth,C.gridHeight):A=ls.getRegularGridIndicesAndEdgeIndices(C.gridWidth,C.gridHeight);let S=C.gridWidth*C.gridHeight;return T._mesh=new ih(h,new Float32Array(C.vertices),A.indices,A.indexCountWithoutSkirts,S,C.minimumHeight,C.maximumHeight,ae.clone(C.boundingSphere3D),d.clone(C.occludeePointInScaledSpace),C.numberOfAttributes,wn.clone(C.orientedBoundingBox),Zc.clone(C.encoding),A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),T._buffer=void 0,T._mesh})};dg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(se.center(u)),h=this._structure,_=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(_*4,1e3);let m=xI.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Pi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=ls.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=ls.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=m.gridWidth*m.gridHeight;return this._mesh=new ih(f,m.vertices,x.indices,x.indexCountWithoutSkirts,b,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};dg.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,h=r.heightScale,p=l(this._mesh),_=this._encoding===nh.LERC;if(!p&&_)return;let x;if(p){let b=this._mesh.vertices,T=this._mesh.encoding;x=Pge(b,T,f,h,e,i,o,t,n)}else x=mrt(this._buffer,a,c,s,u,e,i,o,t,n),x=x*h+f;return x};dg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,h=f.stride,p=new this._bufferType(c*u*h),_=a.vertices,m=a.encoding,x=e.tileXYToRectangle(t,n,i),b=e.tileXYToRectangle(o,r,s),T=f.heightOffset,C=f.heightScale,A=f.elementsPerHeight,S=f.elementMultiplier,v=f.isBigEndian,D=Math.pow(S,A-1);for(let O=0;O<u;++O){let R=P.lerp(b.north,b.south,O/(u-1));for(let M=0;M<c;++M){let L=P.lerp(b.west,b.east,M/(c-1)),g=Pge(_,m,T,C,x,c,u,L,R);g=g<f.lowestEncodedHeight?f.lowestEncodedHeight:g,g=g>f.highestEncodedHeight?f.highestEncodedHeight:g,prt(p,A,S,D,h,v,O*c+M,g)}}return Promise.resolve(new dg({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};dg.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};dg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function mrt(e,t,n,i,o,r,s,a,c,u){let f=(c-r.west)*(s-1)/(r.east-r.west),h=(u-r.south)*(a-1)/(r.north-r.south),p=f|0,_=p+1;_>=s&&(_=s-1,p=s-2);let m=h|0,x=m+1;x>=a&&(x=a-1,m=a-2);let b=f-p,T=h-m;m=a-1-m,x=a-1-x;let C=$V(e,t,n,i,o,m*s+p),A=$V(e,t,n,i,o,m*s+_),S=$V(e,t,n,i,o,x*s+p),v=$V(e,t,n,i,o,x*s+_);return Rge(b,T,C,A,S,v)}function Pge(e,t,n,i,o,r,s,a,c){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(s-1)/(o.north-o.south),h=u|0,p=h+1;p>=r&&(p=r-1,h=r-2);let _=f|0,m=_+1;m>=s&&(m=s-1,_=s-2);let x=u-h,b=f-_;_=s-1-_,m=s-1-m;let T=(t.decodeHeight(e,_*r+h)-n)/i,C=(t.decodeHeight(e,_*r+p)-n)/i,A=(t.decodeHeight(e,m*r+h)-n)/i,S=(t.decodeHeight(e,m*r+p)-n)/i;return Rge(x,b,T,C,A,S)}function Rge(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function $V(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function prt(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var cc=dg;function CE(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Xi({ellipsoid:y(e.ellipsoid,ee.default)})),this._levelZeroMaximumGeometricError=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe}Object.defineProperties(CE.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});CE.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new cc({buffer:new Uint8Array(16*16),width:16,height:16}))};CE.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};CE.prototype.getTileDataAvailable=function(e,t,n){};CE.prototype.loadTileDataAvailability=function(e,t,n){};var hg=CE;var QV=`uniform vec4 u_initialColor; #if TEXTURE_UNITS > 0 uniform sampler2D u_dayTextures[TEXTURE_UNITS]; @@ -7160,7 +10360,7 @@ vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat } #endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var sL=`#ifdef QUANTIZATION_BITS12 +`;var JV=`#ifdef QUANTIZATION_BITS12 in vec4 compressed0; in float compressed1; #else @@ -7445,7 +10645,7 @@ void main() v_height = height; #endif } -`;var tv=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +`;var bI=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); @@ -7463,4970 +10663,8 @@ void main() opacity ); } -`;var k0=`in vec4 v_color; -in vec4 v_outlineColor; -in float v_innerPercent; -in float v_pixelDistance; -in vec4 v_pickColor; -in float v_splitDirection; - -void main() -{ - if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; - - // The distance in UV space from this fragment to the center of the point, at most 0.5. - float distanceToCenter = length(gl_PointCoord - vec2(0.5)); - // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. - float maxDistance = max(0.0, 0.5 - v_pixelDistance); - float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); - float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); - - vec4 color = mix(v_outlineColor, v_color, innerAlpha); - color.a *= wholeAlpha; - -// Fully transparent parts of the billboard are not pickable. -#if !defined(OPAQUE) && !defined(TRANSLUCENT) - if (color.a < 0.005) // matches 0/255 and 1/255 - { - discard; - } -#else -// The billboard is rendered twice. The opaque pass discards translucent fragments -// and the translucent pass discards opaque fragments. -#ifdef OPAQUE - if (color.a < 0.995) // matches < 254/255 - { - discard; - } -#else - if (color.a >= 0.995) // matches 254/255 and 255/255 - { - discard; - } -#endif -#endif - - out_FragColor = czm_gammaCorrect(color); - czm_writeLogDepth(); -} -`;var aL=`uniform float u_maxTotalPointSize; - -in vec4 positionHighAndSize; -in vec4 positionLowAndOutline; -in vec4 compressedAttribute0; // color, outlineColor, pick color -in vec4 compressedAttribute1; // show, translucency by distance, some free space -in vec4 scaleByDistance; // near, nearScale, far, farScale -in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection - -out vec4 v_color; -out vec4 v_outlineColor; -out float v_innerPercent; -out float v_pixelDistance; -out vec4 v_pickColor; -out float v_splitDirection; - -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; - -void main() -{ - // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition - - // unpack attributes - vec3 positionHigh = positionHighAndSize.xyz; - vec3 positionLow = positionLowAndOutline.xyz; - float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; - float totalSize = positionHighAndSize.w + outlineWidthBothSides; - float outlinePercent = outlineWidthBothSides / totalSize; - // Scale in response to browser-zoom. - totalSize *= czm_pixelRatio; - - float temp = compressedAttribute1.x * SHIFT_RIGHT8; - float show = floor(temp); - -#ifdef EYE_DISTANCE_TRANSLUCENCY - vec4 translucencyByDistance; - translucencyByDistance.x = compressedAttribute1.z; - translucencyByDistance.z = compressedAttribute1.w; - - translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; - - temp = compressedAttribute1.y * SHIFT_RIGHT8; - translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif - - /////////////////////////////////////////////////////////////////////////// - - vec4 color; - vec4 outlineColor; - vec4 pickColor; - - // compressedAttribute0.z => pickColor.rgb - - temp = compressedAttribute0.z * SHIFT_RIGHT8; - pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor.r = floor(temp); - - // compressedAttribute0.x => color.rgb - - temp = compressedAttribute0.x * SHIFT_RIGHT8; - color.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - color.g = (temp - floor(temp)) * SHIFT_LEFT8; - color.r = floor(temp); - - // compressedAttribute0.y => outlineColor.rgb - - temp = compressedAttribute0.y * SHIFT_RIGHT8; - outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor.r = floor(temp); - - // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a - - temp = compressedAttribute0.w * SHIFT_RIGHT8; - pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - pickColor = pickColor / 255.0; - - temp = floor(temp) * SHIFT_RIGHT8; - outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; - outlineColor /= 255.0; - color.a = floor(temp); - color /= 255.0; - - /////////////////////////////////////////////////////////////////////////// - - vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); - vec4 positionEC = czm_modelViewRelativeToEye * p; - - /////////////////////////////////////////////////////////////////////////// - -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - // 2D camera distance is a special case - // treat all billboards as flattened to the z=0.0 plane - lengthSq = czm_eyeHeight2D.y; - } - else - { - lengthSq = dot(positionEC.xyz, positionEC.xyz); - } -#endif - -#ifdef EYE_DISTANCE_SCALING - totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); -#endif - if (totalSize > 0.0) { - // Add padding for anti-aliasing on both sides. - totalSize += 3.0; - } - - // Clamp to max point size. - totalSize = min(totalSize, u_maxTotalPointSize); - // If size is too small, push vertex behind near plane for clipping. - // Note that context.minimumAliasedPointSize "will be at most 1.0". - if (totalSize < 1.0) - { - positionEC.xyz = vec3(0.0); - totalSize = 1.0; - } - - float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY - translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); - // push vertex behind near plane for clipping - if (translucency < 0.004) - { - positionEC.xyz = vec3(0.0); - } -#endif - -#ifdef DISTANCE_DISPLAY_CONDITION - float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; - float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; - if (lengthSq < nearSq || lengthSq > farSq) { - // push vertex behind camera to force it to be clipped - positionEC.xyz = vec3(0.0, 0.0, 1.0); - } -#endif - - gl_Position = czm_projection * positionEC; - czm_vertexLogDepth(); - -#ifdef DISABLE_DEPTH_DISTANCE - float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; - if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) - { - disableDepthTestDistance = czm_minimumDisableDepthTestDistance; - } - - if (disableDepthTestDistance != 0.0) - { - // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. - float zclip = gl_Position.z / gl_Position.w; - bool clipped = (zclip < -1.0 || zclip > 1.0); - if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) - { - // Position z on the near plane. - gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH - czm_vertexLogDepth(vec4(czm_currentFrustum.x)); -#endif - } - } -#endif - - v_color = color; - v_color.a *= translucency * show; - v_outlineColor = outlineColor; - v_outlineColor.a *= translucency * show; - - v_innerPercent = 1.0 - outlinePercent; - v_pixelDistance = 2.0 / totalSize; - gl_PointSize = totalSize * show; - gl_Position *= show; - - v_pickColor = pickColor; - v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; -} -`;var cL=`in vec2 v_textureCoordinates; - -uniform int u_polygonsLength; -uniform int u_extentsLength; -uniform highp sampler2D u_polygonTexture; -uniform highp sampler2D u_extentsTexture; - -int getPolygonIndex(float dimension, vec2 coord) { - vec2 uv = coord.xy * dimension; - return int(floor(uv.y) * dimension + floor(uv.x)); -} - -vec2 getLookupUv(ivec2 dimensions, int i) { - int pixY = i / dimensions.x; - int pixX = i - (pixY * dimensions.x); - float pixelWidth = 1.0 / float(dimensions.x); - float pixelHeight = 1.0 / float(dimensions.y); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - return vec2(u, v); -} - -vec4 getExtents(int i) { - return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i)); -} - -ivec2 getPositionsLengthAndExtentsIndex(int i) { - vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i); - vec4 value = texture(u_polygonTexture, uv); - return ivec2(int(value.x), int(value.y)); -} - -vec2 getPolygonPosition(int i) { - vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i); - return texture(u_polygonTexture, uv).xy; -} - -vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) { - float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y); - float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x); - return vec2(latitude, longitude); -} - -void main() { - int lastPolygonIndex = 0; - out_FragColor = vec4(1.0); - - // Get the relevant region of the texture - float dimension = float(u_extentsLength); - if (u_extentsLength > 2) { - dimension = ceil(log2(float(u_extentsLength))); - } - int regionIndex = getPolygonIndex(dimension, v_textureCoordinates); - - for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) { - ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex); - int positionsLength = positionsLengthAndExtents.x; - int polygonExtentsIndex = positionsLengthAndExtents.y; - lastPolygonIndex += 1; - - // Only compute signed distance for the relevant part of the atlas - if (polygonExtentsIndex == regionIndex) { - float clipAmount = czm_infinity; - vec4 extents = getExtents(polygonExtentsIndex); - vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension; - vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents); - float s = 1.0; - - // Check each edge for absolute distance - for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) { - vec2 a = getPolygonPosition(lastPolygonIndex + i); - vec2 b = getPolygonPosition(lastPolygonIndex + j); - - vec2 ab = b - a; - vec2 pa = p - a; - float t = dot(pa, ab) / dot(ab, ab); - t = clamp(t, 0.0, 1.0); - - vec2 pq = pa - t * ab; - float d = length(pq); - - // Inside / outside computation to determine sign - bvec3 cond = bvec3(p.y >= a.y, - p.y < b.y, - ab.x * pa.y > ab.y * pa.x); - if (all(cond) || all(not(cond))) s = -s; - if (abs(d) < abs(clipAmount)) { - clipAmount = d; - } - } - - // Normalize the range to [0,1] - vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; - // In the case where we've iterated through multiple polygons, take the minimum - out_FragColor = min(out_FragColor, result); - } - - lastPolygonIndex += positionsLength; - } -}`;var Ju=`void clipLineSegmentToNearPlane( - vec3 p0, - vec3 p1, - out vec4 positionWC, - out bool clipped, - out bool culledByNearPlane, - out vec4 clippedPositionEC) -{ - culledByNearPlane = false; - clipped = false; - - vec3 p0ToP1 = p1 - p0; - float magnitude = length(p0ToP1); - vec3 direction = normalize(p0ToP1); - - // Distance that p0 is behind the near plane. Negative means p0 is - // in front of the near plane. - float endPoint0Distance = czm_currentFrustum.x + p0.z; - - // Camera looks down -Z. - // When moving a point along +Z: LESS VISIBLE - // * Points in front of the camera move closer to the camera. - // * Points behind the camrea move farther away from the camera. - // When moving a point along -Z: MORE VISIBLE - // * Points in front of the camera move farther away from the camera. - // * Points behind the camera move closer to the camera. - - // Positive denominator: -Z, becoming more visible - // Negative denominator: +Z, becoming less visible - // Nearly zero: parallel to near plane - float denominator = -direction.z; - - if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) - { - // p0 is behind the near plane and the line to p1 is nearly parallel to - // the near plane, so cull the segment completely. - culledByNearPlane = true; - } - else if (endPoint0Distance > 0.0) - { - // p0 is behind the near plane, and the line to p1 is moving distinctly - // toward or away from it. - - // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) - float t = endPoint0Distance / denominator; - if (t < 0.0 || t > magnitude) - { - // Near plane intersection is not between the two points. - // We already confirmed p0 is behind the naer plane, so now - // we know the entire segment is behind it. - culledByNearPlane = true; - } - else - { - // Segment crosses the near plane, update p0 to lie exactly on it. - p0 = p0 + t * direction; - - // Numerical noise might put us a bit on the wrong side of the near plane. - // Don't let that happen. - p0.z = min(p0.z, -czm_currentFrustum.x); - - clipped = true; - } - } - - clippedPositionEC = vec4(p0, 1.0); - positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); -} - -vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) -{ - // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. - -#ifdef POLYLINE_DASH - // Compute the window coordinates of the points. - vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); - vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); - vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); - - // Determine the relative screen space direction of the line. - vec2 lineDir; - if (usePrevious) { - lineDir = normalize(positionWindow.xy - previousWindow.xy); - } - else { - lineDir = normalize(nextWindow.xy - positionWindow.xy); - } - angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) - - // Quantize the angle so it doesn't change rapidly between segments. - angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; -#endif - - vec4 clippedPrevWC, clippedPrevEC; - bool prevSegmentClipped, prevSegmentCulled; - clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); - - vec4 clippedNextWC, clippedNextEC; - bool nextSegmentClipped, nextSegmentCulled; - clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); - - bool segmentClipped, segmentCulled; - vec4 clippedPositionWC, clippedPositionEC; - clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); - - if (segmentCulled) - { - return vec4(0.0, 0.0, 0.0, 1.0); - } - - vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); - vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); - - // If a segment was culled, we can't use the corresponding direction - // computed above. We should never see both of these be true without - // \`segmentCulled\` above also being true. - if (prevSegmentCulled) - { - directionToPrevWC = -directionToNextWC; - } - else if (nextSegmentCulled) - { - directionToNextWC = -directionToPrevWC; - } - - vec2 thisSegmentForwardWC, otherSegmentForwardWC; - if (usePrevious) - { - thisSegmentForwardWC = -directionToPrevWC; - otherSegmentForwardWC = directionToNextWC; - } - else - { - thisSegmentForwardWC = directionToNextWC; - otherSegmentForwardWC = -directionToPrevWC; - } - - vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); - - vec2 leftWC = thisSegmentLeftWC; - float expandWidth = width * 0.5; - - // When lines are split at the anti-meridian, the position may be at the - // same location as the next or previous position, and we need to handle - // that to avoid producing NaNs. - if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) - { - vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); - - vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; - float leftSumLength = length(leftSumWC); - leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); - - // The sine of the angle between the two vectors is given by the formula - // |a x b| = |a||b|sin(theta) - // which is - // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); - // Because the z components of both vectors are zero, the x and y coordinate will be zero. - // Therefore, the sine of the angle is just the z component of the cross product. - vec2 u = -thisSegmentForwardWC; - vec2 v = leftWC; - float sinAngle = abs(u.x * v.y - u.y * v.x); - expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); - } - - vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; - return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; -} - -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) -{ - vec4 positionEC = czm_modelViewRelativeToEye * position; - vec4 prevEC = czm_modelViewRelativeToEye * previous; - vec4 nextEC = czm_modelViewRelativeToEye * next; - return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); -} -`;var wT=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif - -in vec2 v_st; - -void main() -{ - czm_materialInput materialInput; - - vec2 st = v_st; - st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); - - materialInput.s = st.s; - materialInput.st = st; - materialInput.str = vec3(st, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#ifdef VECTOR_TILE - out_FragColor *= u_highlightColor; -#endif - - czm_writeLogDepth(); -} -`;var lL=`in vec4 v_startPlaneNormalEcAndHalfWidth; -in vec4 v_endPlaneNormalEcAndBatchId; -in vec4 v_rightPlaneEC; // Technically can compute distance for this here -in vec4 v_endEcAndStartEcX; -in vec4 v_texcoordNormalizationAndStartEcYZ; - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif - -void main(void) -{ - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); - - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; - - float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); - - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - // Check distance of the eye coordinate against start and end planes with normals in the right plane. - // For computing unskewed lengthwise texture coordinate. - // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. - - // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" - vec3 alignedPlaneNormal; - - // start aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); - - // end aligned plane - alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); - alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); - distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); - -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Clamp - distance to aligned planes may be negative due to mitering, - // so fragment texture coordinate might be out-of-bounds. - float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); - s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; - float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); - - czm_materialInput materialInput; - - materialInput.s = s; - materialInput.st = vec2(s, t); - materialInput.str = vec3(s, t, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - - czm_writeDepthClamp(); -} -`;var uL=`in vec3 v_forwardDirectionEC; -in vec3 v_texcoordNormalizationAndHalfWidth; -in float v_batchId; - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#else -in vec2 v_alignedPlaneDistances; -in float v_texcoordT; -#endif - -float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { - // We don't expect the ray to ever be parallel to the plane - return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); -} - -void main(void) -{ - vec4 eyeCoordinate = gl_FragCoord; - eyeCoordinate /= eyeCoordinate.w; - -#ifdef PER_INSTANCE_COLOR - out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR - // Use distances for planes aligned with segment to prevent skew in dashing - float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); - float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); - - // Clamp - distance to aligned planes may be negative due to mitering - distanceFromStart = max(0.0, distanceFromStart); - distanceFromEnd = max(0.0, distanceFromEnd); - - float s = distanceFromStart / (distanceFromStart + distanceFromEnd); - s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; - - czm_materialInput materialInput; - - materialInput.s = s; - materialInput.st = vec2(s, v_texcoordT); - materialInput.str = vec3(s, v_texcoordT, 0.0); - - czm_material material = czm_getMaterial(materialInput); - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR -} -`;var fL=`in vec3 position3DHigh; -in vec3 position3DLow; - -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; - -in float batchId; - -out vec3 v_forwardDirectionEC; -out vec3 v_texcoordNormalizationAndHalfWidth; -out float v_batchId; - -// For materials -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#else -out vec2 v_alignedPlaneDistances; -out float v_texcoordT; -#endif - -// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. -// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. -void main() -{ - v_batchId = batchId; - - // Start position - vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); - vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); - vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - - // Start plane - vec4 startPlane2D; - vec4 startPlane3D; - startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); - startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); - - // Right plane - vec4 rightPlane2D; - vec4 rightPlane3D; - rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); - rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); - - // End position - posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); - posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); - posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); - posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; - posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; - vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; - vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); - vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); - - // End plane - vec4 endPlane2D; - vec4 endPlane3D; - endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); - endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); - - // Forward direction - v_forwardDirectionEC = normalize(endEC - startEC); - - vec2 cleanTexcoordNormalization2D; - cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); - cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); - vec2 cleanTexcoordNormalization3D; - cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; - cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); - - v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#else // PER_INSTANCE_COLOR - // For computing texture coordinates - - v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); - v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); -#endif // PER_INSTANCE_COLOR - -#ifdef WIDTH_VARYING - float width = czm_batchTable_width(batchId); - float halfWidth = width * 0.5; - v_width = width; - v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#else - float halfWidth = 0.5 * czm_batchTable_width(batchId); - v_texcoordNormalizationAndHalfWidth.z = halfWidth; -#endif - - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - // Since this is morphing, compute both 3D and 2D positions and then blend. - - // ****** 3D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); - vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Nudge the top vertex upwards to prevent flickering - vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); - geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc3D.xyz += geodeticSurfaceNormal; - - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); - - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - - // ****** 2D ****** - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition - absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); - absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); - planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); - upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Nudge the top vertex upwards to prevent flickering - geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); - geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); - geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; - positionEc2D.xyz += geodeticSurfaceNormal; - - // Determine if this vertex is on the "left" or "right" - normalEC *= sign(texcoordNormalization2D.x); -#ifndef PER_INSTANCE_COLOR - // Use vertex's sidedness to compute its texture coordinate. - v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); -#endif - - // A "perfect" implementation would push along normals according to the angle against forward. - // In practice, just pushing the normal out by halfWidth is sufficient for morph views. - positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) - - // Blend for actual position - gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); - -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var dL=`in vec3 position3DHigh; -in vec3 position3DLow; - -// In 2D and in 3D, texture coordinate normalization component signs encodes: -// * X sign - sidedness relative to right plane -// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume -#ifndef COLUMBUS_VIEW_2D -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -#else -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -#endif - -in float batchId; - -out vec4 v_startPlaneNormalEcAndHalfWidth; -out vec4 v_endPlaneNormalEcAndBatchId; -out vec4 v_rightPlaneEC; -out vec4 v_endEcAndStartEcX; -out vec4 v_texcoordNormalizationAndStartEcYZ; - -// For materials -#ifdef WIDTH_VARYING -out float v_width; -#endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; -#endif - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif - -void main() -{ -#ifdef COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; - - vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); - vec3 ecEnd = forwardDirectionEC + ecStart; - forwardDirectionEC = normalize(forwardDirectionEC); - - // Right plane - v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - - v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); - v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; - -#else // COLUMBUS_VIEW_2D - vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; - vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); - vec3 ecEnd = ecStart + offset; - - vec3 forwardDirectionEC = normalize(offset); - - // start plane - vec4 startPlaneEC; - startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; - startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); - - // end plane - vec4 endPlaneEC; - endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; - endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); - - // Right plane - v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; - v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); - - v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); - v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; - -#endif // COLUMBUS_VIEW_2D - - v_endEcAndStartEcX.xyz = ecEnd; - v_endEcAndStartEcX.w = ecStart.x; - v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif // PER_INSTANCE_COLOR - - // Compute a normal along which to "push" the position out, extending the miter depending on view distance. - // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. - // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. - vec4 positionRelativeToEye = czm_computePosition(); - - // Check distance to the end plane and start plane, pick the plane that is closer - vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition - float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); - float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); - vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); - vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. - vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. - - // Extrude bottom vertices downward for far view distances, like for GroundPrimitives - upOrDown = cross(forwardDirectionEC, normalEC); - upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; - upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; - upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; - positionEC.xyz += upOrDown; - - v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); - - // Determine distance along normalEC to push for a volume of appropriate width. - // Make volumes about double pixel width for a conservative fit - in practice the - // extra cost here is minimal compared to the loose volume heights. - // - // N = normalEC (guaranteed "right-facing") - // R = rightEC - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - float width = czm_batchTable_width(batchId); -#ifdef WIDTH_VARYING - v_width = width; -#endif - - v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; - v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; - - v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; - v_endPlaneNormalEcAndBatchId.w = batchId; - - width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R - width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N - - // Determine if this vertex is on the "left" or "right" -#ifdef COLUMBUS_VIEW_2D - normalEC *= sign(texcoordNormalization2D.x); -#else - normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); -#endif - - positionEC.xyz += width * normalEC; - gl_Position = czm_depthClamp(czm_projection * positionEC); - -#ifdef ANGLE_VARYING - // Approximate relative screen space direction of the line. - vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); - approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); - v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); -#endif -} -`;var hL=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 position2DHigh; -in vec3 position2DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 prevPosition2DHigh; -in vec3 prevPosition2DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec3 nextPosition2DHigh; -in vec3 nextPosition2DLow; -in vec4 texCoordExpandAndBatchIndex; - -out vec2 v_st; -out float v_width; -out vec4 v_pickColor; -out float v_polylineAngle; - -void main() -{ - float texCoord = texCoordExpandAndBatchIndex.x; - float expandDir = texCoordExpandAndBatchIndex.y; - bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; - float batchTableIndex = texCoordExpandAndBatchIndex.w; - - vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); - float width = widthAndShow.x + 0.5; - float show = widthAndShow.y; - - if (width < 1.0) - { - show = 0.0; - } - - vec4 pickColor = batchTable_getPickColor(batchTableIndex); - - vec4 p, prev, next; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); - prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); - next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); - prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); - next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), - czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), - czm_morphTime); - prev = czm_columbusViewMorph( - czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), - czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), - czm_morphTime); - next = czm_columbusViewMorph( - czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), - czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), - czm_morphTime); - } - - #ifdef DISTANCE_DISPLAY_CONDITION - vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); - vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); - vec3 centerLow = centerLowAndRadius.xyz; - float radius = centerLowAndRadius.w; - vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); - - float lengthSq; - if (czm_sceneMode == czm_sceneMode2D) - { - lengthSq = czm_eyeHeight2D.y; - } - else - { - vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); - lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); - } - - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - if (lengthSq < nearSq || lengthSq > farSq) - { - show = 0.0; - } - #endif - - float polylineAngle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); - gl_Position = czm_viewportOrthographic * positionWC * show; - - v_st.s = texCoord; - v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); - - v_width = width; - v_pickColor = pickColor; - v_polylineAngle = polylineAngle; -} -`;var mL=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - out_FragColor = texture(u_texture, v_textureCoordinates); -} -`;var pL=`in vec4 position; -in float webMercatorT; - -uniform vec2 u_textureDimensions; - -out vec2 v_textureCoordinates; - -void main() -{ - v_textureCoordinates = vec2(position.x, webMercatorT); - gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); -} -`;var nv=`#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -in vec4 v_sphericalExtents; -#else // SPHERICAL -in vec2 v_inversePlaneExtents; -in vec4 v_westPlane; -in vec4 v_southPlane; -#endif // SPHERICAL -in vec3 v_uvMinAndSphericalLongitudeRotation; -in vec3 v_uMaxAndInverseDistance; -in vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES - -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif - -#ifdef NORMAL_EC -vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); - return eyeCoordinate.xyz / eyeCoordinate.w; -} - -vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { - vec2 glFragCoordXY = gl_FragCoord.xy; - // Sample depths at both offset and negative offset - float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); - float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); - // Explicitly evaluate both paths - // Necessary for multifrustum and for edges of the screen - bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); - float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); - float useDownOrLeft = float(useUpOrRight == 0.0); - vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); - vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); - return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; -} -#endif // NORMAL_EC - -void main(void) -{ -#ifdef REQUIRES_EC - float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -#endif - -#ifdef REQUIRES_WC - vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; - vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; -#endif - -#ifdef TEXTURE_COORDINATES - vec2 uv; -#ifdef SPHERICAL - // Treat world coords as a sphere normal for spherical coordinates - vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); - sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; - sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); - uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; - uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; -#else // SPHERICAL - // Unpack planes and transform to eye space - uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; - uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; -#endif // SPHERICAL -#endif // TEXTURE_COORDINATES - -#ifdef PICK -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - // Check for logDepthOrDepth != 0.0 to make sure this should be classified. - if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { - out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource - czm_writeDepthClamp(); - } -#else // CULL_FRAGMENTS - out_FragColor.a = 1.0; -#endif // CULL_FRAGMENTS -#else // PICK - -#ifdef CULL_FRAGMENTS - // When classifying translucent geometry, logDepthOrDepth == 0.0 - // indicates a region that should not be classified, possibly due to there - // being opaque pixels there in another buffer. - if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { - discard; - } -#endif - -#ifdef NORMAL_EC - // Compute normal by sampling adjacent pixels in 2x2 block in screen space - vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); - vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); - vec3 normalEC = normalize(cross(leftRight, downUp)); -#endif - - -#ifdef PER_INSTANCE_COLOR - - vec4 color = czm_gammaCorrect(v_color); -#ifdef FLAT - out_FragColor = color; -#else // FLAT - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = -eyeCoordinate.xyz; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - -#else // PER_INSTANCE_COLOR - - // Material support. - // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or - // dependencies for culling but might not actually be used by the material. - - czm_materialInput materialInput; - -#ifdef USES_NORMAL_EC - materialInput.normalEC = normalEC; -#endif - -#ifdef USES_POSITION_TO_EYE_EC - materialInput.positionToEyeEC = -eyeCoordinate.xyz; -#endif - -#ifdef USES_TANGENT_TO_EYE - materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); -#endif - -#ifdef USES_ST - // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired - // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. - // Shader is provided a set of reference points for remapping. - materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; - materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; -#endif - - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else // FLAT - out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT - - // Premultiply alpha. Required for classification primitives on translucent globe. - out_FragColor.rgb *= out_FragColor.a; - -#endif // PER_INSTANCE_COLOR - czm_writeDepthClamp(); -#endif // PICK -} -`;var gL=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; - -#ifdef EXTRUDED_GEOMETRY -in vec3 extrudeDirection; - -uniform float u_globeMinimumAltitude; -#endif // EXTRUDED_GEOMETRY - -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif // PER_INSTANCE_COLOR - -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -out vec4 v_sphericalExtents; -#else // SPHERICAL -out vec2 v_inversePlaneExtents; -out vec4 v_westPlane; -out vec4 v_southPlane; -#endif // SPHERICAL -out vec3 v_uvMinAndSphericalLongitudeRotation; -out vec3 v_uMaxAndInverseDistance; -out vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES - -void main() -{ - vec4 position = czm_computePosition(); - -#ifdef EXTRUDED_GEOMETRY - float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); - delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; - - //extrudeDirection is zero for the top layer - position = position + vec4(extrudeDirection * delta, 0.0); -#endif - -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL - v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); - v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); -#else // SPHERICAL -#ifdef COLUMBUS_VIEW_2D - vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); - vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); - - // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): - // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) - // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) - // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) - vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); - bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; - planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); - planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); - - // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) - // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) - // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) - idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; - idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); - planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); - planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); - - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; - vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; - vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; -#else // COLUMBUS_VIEW_2D - // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction - vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; - vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; - vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; -#endif // COLUMBUS_VIEW_2D - - vec3 eastWard = southEastCorner - southWestCorner; - float eastExtent = length(eastWard); - eastWard /= eastExtent; - - vec3 northWard = northWestCorner - southWestCorner; - float northExtent = length(northWard); - northWard /= northExtent; - - v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); - v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); - v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); -#endif // SPHERICAL - vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); - vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); - - v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); - v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); - v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; -#endif // TEXTURE_COORDINATES - -#ifdef PER_INSTANCE_COLOR - v_color = czm_batchTable_color(batchId); -#endif - - gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); -} -`;var V0=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif - -void main(void) -{ -#ifdef VECTOR_TILE - out_FragColor = czm_gammaCorrect(u_highlightColor); -#else - out_FragColor = vec4(1.0); -#endif - czm_writeDepthClamp(); -} -`;var iv=`float interpolateByDistance(vec4 nearFarScalar, float distance) -{ - float startDistance = nearFarScalar.x; - float startValue = nearFarScalar.y; - float endDistance = nearFarScalar.z; - float endValue = nearFarScalar.w; - float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); - return mix(startValue, endValue, t); -} - -void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) -{ - float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; - - // Adjustment to the atmosphere radius applied based on the camera height. - float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; - float distanceAdjustMax = czm_ellipsoidRadii.x; - float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; - float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); - - // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit - // for the position on the ellipsoid. - float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; - float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; - - // Setup the primary ray: from the camera position to the vertex position. - vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; - vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); - czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); - - underTranslucentGlobe = 0.0; - - // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. - #if defined(GLOBE_TRANSLUCENT) - - // Check for intersection with the inner radius of the atmopshere. - czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); - if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { - - // Compute position on globe. - vec3 direction = normalize(positionWC); - czm_ray ellipsoidRay = czm_ray(positionWC, -direction); - czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); - vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); - - // Control the color using the camera angle. - float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); - - // Control the opacity using the distance from Earth. - opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); - vec3 horizonColor = vec3(0.1, 0.2, 0.3); - vec3 nearColor = vec3(0.0); - - rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); - - // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. - underTranslucentGlobe = 1.0; - return; - } - #endif - - computeScattering( - primaryRay, - length(cameraToPositionWC), - lightDirection, - atmosphereInnerRadius, - rayleighColor, - mieColor, - opacity - ); - - // Alter the opacity based on how close the viewer is to the ground. - // (0.0 = At edge of atmosphere, 1.0 = On ground) - float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; - float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; - opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); - - // Alter alpha based on time of day (0.0 = night , 1.0 = day) - float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; - opacity *= pow(nightAlpha, 0.5); -} -`;var _L=`in vec3 v_outerPositionWC; - -uniform vec3 u_hsbShift; - -#ifndef PER_FRAGMENT_ATMOSPHERE -in vec3 v_mieColor; -in vec3 v_rayleighColor; -in float v_opacity; -in float v_translucent; -#endif - -void main (void) -{ - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum); - - vec3 mieColor; - vec3 rayleighColor; - float opacity; - float translucent; - - #ifdef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - v_outerPositionWC, - lightDirection, - rayleighColor, - mieColor, - opacity, - translucent - ); - #else - mieColor = v_mieColor; - rayleighColor = v_rayleighColor; - opacity = v_opacity; - translucent = v_translucent; - #endif - - vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); - - #ifndef HDR - color.rgb = czm_pbrNeutralTonemapping(color.rgb); - color.rgb = czm_inverseGamma(color.rgb); - #endif - - #ifdef COLOR_CORRECT - const bool ignoreBlackPixels = true; - color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels); - #endif - - // For the parts of the sky atmosphere that are not behind a translucent globe, - // we mix in the default opacity so that the sky atmosphere still appears at distance. - // This is needed because the opacity in the sky atmosphere is initially adjusted based - // on the camera height. - if (translucent == 0.0) { - color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); - } - - out_FragColor = color; -} -`;var yL=`in vec4 position; - -out vec3 v_outerPositionWC; - -#ifndef PER_FRAGMENT_ATMOSPHERE -out vec3 v_mieColor; -out vec3 v_rayleighColor; -out float v_opacity; -out float v_translucent; -#endif - -void main(void) -{ - vec4 positionWC = czm_model * position; - float lightEnum = u_radiiAndDynamicAtmosphereColor.z; - vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum); - - #ifndef PER_FRAGMENT_ATMOSPHERE - computeAtmosphereScattering( - positionWC.xyz, - lightDirection, - v_rayleighColor, - v_mieColor, - v_opacity, - v_translucent - ); - #endif - - v_outerPositionWC = positionWC.xyz; - gl_Position = czm_modelViewProjection * position; -} -`;var xL=`uniform samplerCube u_cubeMap; - -in vec3 v_texCoord; - -void main() -{ - vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); - out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); -} -`;var bL=`in vec3 position; -out vec3 v_texCoord; - -void main() -{ - vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); - gl_Position = czm_projection * vec4(p, 1.0); - v_texCoord = position.xyz; -} -`;var TL=`uniform sampler2D u_texture; - -in vec2 v_textureCoordinates; - -void main() -{ - vec4 color = texture(u_texture, v_textureCoordinates); - out_FragColor = czm_gammaCorrect(color); -} -`;var CL=`uniform float u_radiusTS; - -in vec2 v_textureCoordinates; - -vec2 rotate(vec2 p, vec2 direction) -{ - return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); -} - -vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) -{ - vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); - float radius = length(rotatedPosition) * lengthScalar; - float burst = 1.0 - smoothstep(0.0, 0.55, radius); - return vec4(burst); -} - -void main() -{ - float lengthScalar = 2.0 / sqrt(2.0); - vec2 position = v_textureCoordinates - vec2(0.5); - float radius = length(position) * lengthScalar; - float surface = step(radius, u_radiusTS); - vec4 color = vec4(vec2(1.0), surface + 0.2, surface); - - float glow = 1.0 - smoothstep(0.0, 0.55, radius); - color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; - - vec4 burst = vec4(0.0); - - // The following loop has been manually unrolled for speed, to - // avoid sin() and cos(). - // - //for (float i = 0.4; i < 3.2; i += 1.047) { - // vec2 direction = vec2(sin(i), cos(i)); - // burst += 0.4 * addBurst(position, direction, lengthScalar); - // - // direction = vec2(sin(i - 0.08), cos(i - 0.08)); - // burst += 0.3 * addBurst(position, direction, lengthScalar); - //} - - burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 - burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 - burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - - burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 - burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 - - // End of manual loop unrolling. - - color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; - - out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); -} -`;var AL=`in vec2 direction; - -uniform float u_size; - -out vec2 v_textureCoordinates; - -void main() -{ - vec4 position; - if (czm_morphTime == 1.0) - { - position = vec4(czm_sunPositionWC, 1.0); - } - else - { - position = vec4(czm_sunPositionColumbusView.zxy, 1.0); - } - - vec4 positionEC = czm_view * position; - vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); - - vec2 halfSize = vec2(u_size * 0.5); - halfSize *= ((direction * 2.0) - 1.0); - - gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); - - v_textureCoordinates = direction; -} -`;var EL=`in vec4 v_startPlaneEC; -in vec4 v_endPlaneEC; -in vec4 v_rightPlaneEC; -in float v_halfWidth; -in vec3 v_volumeUpEC; - -uniform vec4 u_highlightColor; -void main() -{ - float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); - - // Discard for sky - if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - eyeCoordinate /= eyeCoordinate.w; - - float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); - - // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction - halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); - - // Check distance of the eye coordinate against the right-facing plane - float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); - - // Check eye coordinate against the mitering planes - float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); - float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); - - if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME - out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); - return; -#else // DEBUG_SHOW_VOLUME - discard; -#endif // DEBUG_SHOW_VOLUME - } - out_FragColor = u_highlightColor; - - czm_writeDepthClamp(); -} -`;var SL=`in vec3 startEllipsoidNormal; -in vec3 endEllipsoidNormal; -in vec4 startPositionAndHeight; -in vec4 endPositionAndHeight; -in vec4 startFaceNormalAndVertexCorner; -in vec4 endFaceNormalAndHalfWidth; -in float a_batchId; - -uniform mat4 u_modifiedModelView; -uniform vec2 u_minimumMaximumVectorHeights; - -out vec4 v_startPlaneEC; -out vec4 v_endPlaneEC; -out vec4 v_rightPlaneEC; -out float v_halfWidth; -out vec3 v_volumeUpEC; - -void main() -{ - // vertex corner IDs - // 3-----------7 - // /| left /| - // / | 1 / | - // 2-----------6 5 end - // | / | / - // start |/ right |/ - // 0-----------4 - // - float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end - float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top - - vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; - vec3 right = normalize(cross(forward, startEllipsoidNormal)); - - vec4 position = vec4(startPositionAndHeight.xyz, 1.0); - position.xyz += forward * isEnd; - - v_volumeUpEC = czm_normal * normalize(cross(right, forward)); - - // Push for volume height - float offset; - vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); - - // offset height to create volume - offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); - offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; - position.xyz += offset * ellipsoidNormal; - - // move from RTC to EC - position = u_modifiedModelView * position; - right = czm_normal * right; - - // Push for width in a direction that is in the start or end plane and in a plane with right - // N = normalEC ("right-facing" direction for push) - // R = right - // p = angle between N and R - // w = distance to push along R if R == N - // d = distance to push along N - // - // N R - // { p| } * cos(p) = dot(N, R) = w / d - // d | |w * d = w / dot(N, R) - // { | } - // o---------- polyline segment ----> - // - vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); - scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); - vec3 miterPushNormal = czm_normal * normalize(scratchNormal); - - offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC - offset = offset / dot(miterPushNormal, right); - position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); - - gl_Position = czm_depthClamp(czm_projection * position); - - position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); - vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; - v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); - v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); - - position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); - vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; - v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); - v_halfWidth = endFaceNormalAndHalfWidth.w; -} -`;var vL=`in vec4 currentPosition; -in vec4 previousPosition; -in vec4 nextPosition; -in vec2 expandAndWidth; -in float a_batchId; - -uniform mat4 u_modifiedModelView; - -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; - - vec4 p = u_modifiedModelView * currentPosition; - vec4 prev = u_modifiedModelView * previousPosition; - vec4 next = u_modifiedModelView * nextPosition; - - float angle; - vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; -} -`;var ov=`in vec3 position; -in float a_batchId; - -uniform mat4 u_modifiedModelViewProjection; - -void main() -{ - gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;var wL=` -in vec2 v_textureCoordinates; - -void main() -{ - czm_materialInput materialInput; - - materialInput.s = v_textureCoordinates.s; - materialInput.st = v_textureCoordinates; - materialInput.str = vec3(v_textureCoordinates, 0.0); - materialInput.normalEC = vec3(0.0, 0.0, -1.0); - - czm_material material = czm_getMaterial(materialInput); - - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -} -`;function Wg(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new me,this.setValue(e)}Object.defineProperties(Wg.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Wg.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Wg.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};Wg.prototype.equals=function(e){return this===e||e instanceof Wg&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Wg.prototype.valueOf=function(){return this._value};Wg.prototype.toString=function(){return String(this._value)};var Yn=Wg;function JPe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function e1e(e){return new Yn(e)}function t1e(e,t,n){return JPe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,e1e))}var le=t1e;function rv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(rv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance"),splitDirection:le("splitDirection")});rv.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new rv(this)};rv.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var Ec=rv;function U0(){this._array=[],this._hash={}}Object.defineProperties(U0.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});U0.prototype.contains=function(e){return l(this._hash[e])};U0.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};U0.prototype.get=function(e){return this._hash[e]};U0.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};U0.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var vt=U0;function Xl(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Xl.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Xl.packedLength=2;Xl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};Xl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xl),n.near=e[t++],n.far=e[t],n};Xl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Xl.clone=function(e,t){if(l(e))return l(t)||(t=new Xl),t.near=e.near,t.far=e.far,t};Xl.prototype.clone=function(e){return Xl.clone(this,e)};Xl.prototype.equals=function(e){return Xl.equals(this,e)};var Lt=Xl;function ef(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}ef.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new ef(e.near,e.nearValue,e.far,e.farValue)};ef.packedLength=4;ef.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};ef.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ef),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};ef.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};ef.prototype.clone=function(e){return ef.clone(this,e)};ef.prototype.equals=function(e){return ef.equals(this,e)};var kt=ef;var z0={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},Ye=Object.freeze(z0);function tf(e){return e===z0.CLAMP_TO_GROUND||e===z0.CLAMP_TO_3D_TILE||e===z0.CLAMP_TO_TERRAIN}function DT(e){return e===z0.RELATIVE_TO_GROUND||e===z0.RELATIVE_TO_3D_TILE||e===z0.RELATIVE_TO_TERRAIN}var n1e={CENTER:0,LEFT:1,RIGHT:-1},yi=Object.freeze(n1e);var i1e={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},On=Object.freeze(i1e);var o1e={DONE:0,PENDING:1,FAILED:2},ct=Object.freeze(o1e);function pd(){he.throwInstantiationError()}Object.defineProperties(pd.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});pd.prototype.getValue=he.throwInstantiationError;pd.prototype.equals=he.throwInstantiationError;pd.equals=function(e,t){return e===t||l(e)&&e.equals(t)};pd.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!pd.equals(e[i],t[i]))return!1;return!0};pd.isConstant=function(e){return!l(e)||e.isConstant};pd.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};pd.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};pd.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var q=pd;var r1e={LEFT:-1,NONE:0,RIGHT:1},Gr=Object.freeze(r1e);var s1e=z.WHITE,a1e=d.ZERO,c1e=Ye.NONE,l1e=U.ZERO,u1e=1,f1e=0,d1e=d.ZERO,h1e=yi.CENTER,m1e=On.CENTER,p1e=!1,g1e=Gr.NONE,_1e=new d,y1e=new z,x1e=new d,b1e=new U,T1e=new kt,C1e=new kt,A1e=new kt,E1e=new qe,S1e=new Lt;function _ee(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function jg(e,t){t.collectionChanged.addEventListener(jg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new vt,this._onCollectionChanged(t,t.values,[],[])}jg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),h;if(f&&(h=q.getValueOrUndefined(s._position,e,_1e),c=q.getValueOrUndefined(a._image,e),f=l(h)&&l(c)),!f){y6(r,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u),u.show=f,(!l(u.image)||r.textureValue!==c)&&(u.image=c,r.textureValue=c),u.position=h,u.color=q.getValueOrDefault(a._color,e,s1e,y1e),u.eyeOffset=q.getValueOrDefault(a._eyeOffset,e,a1e,x1e),u.heightReference=q.getValueOrDefault(a._heightReference,e,c1e),u.pixelOffset=q.getValueOrDefault(a._pixelOffset,e,l1e,b1e),u.scale=q.getValueOrDefault(a._scale,e,u1e),u.rotation=q.getValueOrDefault(a._rotation,e,f1e),u.alignedAxis=q.getValueOrDefault(a._alignedAxis,e,d1e),u.horizontalOrigin=q.getValueOrDefault(a._horizontalOrigin,e,h1e),u.verticalOrigin=q.getValueOrDefault(a._verticalOrigin,e,m1e),u.width=q.getValueOrUndefined(a._width,e),u.height=q.getValueOrUndefined(a._height,e),u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,T1e),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,C1e),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,A1e),u.sizeInMeters=q.getValueOrDefault(a._sizeInMeters,e,p1e),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,S1e),u.disableDepthTestDistance=q.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=q.getValueOrDefault(a._splitDirection,e,g1e);let p=q.getValueOrUndefined(a._imageSubRegion,e,E1e);l(p)&&u.setImageSubRegion(u._imageId,p)}return!0};jg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return ct.FAILED;let i=n.billboard;if(i.heightReference===Ye.NONE)t.center=d.clone(i.position,t.center);else{if(!l(i._clampedPosition))return ct.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,ct.DONE};jg.prototype.isDestroyed=function(){return!1};jg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(jg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};jg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new _ee(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new _ee(r)):(y6(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],y6(s.get(r.id),r,a),s.remove(r.id)};function y6(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var DL=jg;var v1e=new d;function Rh(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=d.clone(t),this._max=d.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Rh.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=d.multiplyByScalar(t,.5,new d);return new Rh({minimum:d.negate(n,new d),maximum:n,offsetAttribute:e.offsetAttribute})};Rh.fromAxisAlignedBoundingBox=function(e){return new Rh({minimum:e.minimum,maximum:e.maximum})};Rh.packedLength=2*d.packedLength+1;Rh.pack=function(e,t,n){return n=y(n,0),d.pack(e._min,t,n),d.pack(e._max,t,n+d.packedLength),t[n+d.packedLength*2]=y(e._offsetAttribute,-1),t};var xee=new d,bee=new d,yee={minimum:xee,maximum:bee,offsetAttribute:void 0};Rh.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,xee),o=d.unpack(e,t+d.packedLength,bee),r=e[t+d.packedLength*2];return l(n)?(n._min=d.clone(i,n._min),n._max=d.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(yee.offsetAttribute=r===-1?void 0:r,new Rh(yee))};Rh.createGeometry=function(e){let t=e._min,n=e._max;if(d.equals(t,n))return;let i=new hn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=d.subtract(n,t,v1e),a=d.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===sn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new at({attributes:i,indices:o,primitiveType:Me.LINES,boundingSphere:new ae(d.ZERO,a),offsetAttribute:e._offsetAttribute})};var Oh=Rh;function IT(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(IT.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});IT.fromColor=function(e){return new IT(e.red,e.green,e.blue,e.alpha)};IT.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};IT.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Wt=IT;function sv(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(sv.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});sv.fromDistanceDisplayCondition=function(e){return new sv(e.near,e.far)};sv.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Bn=sv;function w1e(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var wt=w1e;function jo(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?Z.clone(e.start):new Z,this.stop=l(e.stop)?Z.clone(e.stop):new Z,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(jo.prototype,{isEmpty:{get:function(){let e=Z.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var PT={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};jo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new he("options.iso8601 is an invalid ISO 8601 interval.");let i=Z.fromIso8601(n[0]),o=Z.fromIso8601(n[1]),r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(PT.start=i,PT.stop=o,PT.isStartIncluded=r,PT.isStopIncluded=s,PT.data=a,new jo(PT))};jo.toIso8601=function(e,t){return`${Z.toIso8601(e.start,t)}/${Z.toIso8601(e.stop,t)}`};jo.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new jo(e)};jo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Z.equals(e.start,t.start)&&Z.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};jo.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Z.equalsEpsilon(e.start,t.start,n)&&Z.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};jo.intersect=function(e,t,n,i){if(!l(t))return jo.clone(jo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=Z.greaterThanOrEquals(s,o)&&Z.greaterThanOrEquals(r,s),u=!c&&Z.lessThanOrEquals(s,o)&&Z.lessThanOrEquals(o,a);if(!c&&!u)return jo.clone(jo.EMPTY,n);let f=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,_=t.isStopIncluded,m=Z.lessThan(r,a);return l(n)||(n=new jo),n.start=c?s:o,n.isStartIncluded=f&&p||!Z.equals(s,o)&&(c&&p||u&&f),n.stop=m?r:a,n.isStopIncluded=m?h:h&&_||!Z.equals(a,r)&&_,n.data=l(i)?i(e.data,t.data):e.data,n};jo.contains=function(e,t){if(e.isEmpty)return!1;let n=Z.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=Z.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};jo.prototype.clone=function(e){return jo.clone(this,e)};jo.prototype.equals=function(e,t){return jo.equals(this,e,t)};jo.prototype.equalsEpsilon=function(e,t,n){return jo.equalsEpsilon(this,e,t,n)};jo.prototype.toString=function(){return jo.toIso8601(this)};jo.EMPTY=Object.freeze(new jo({start:new Z,stop:new Z,isStartIncluded:!1,isStopIncluded:!1}));var En=jo;var Tee=Object.freeze(Z.fromIso8601("0000-01-01T00:00:00Z")),Cee=Object.freeze(Z.fromIso8601("9999-12-31T24:00:00Z")),D1e=Object.freeze(new En({start:Tee,stop:Cee})),I1e={MINIMUM_VALUE:Tee,MAXIMUM_VALUE:Cee,MAXIMUM_INTERVAL:D1e},He=I1e;function av(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(av.prototype,{componentDatatype:{get:function(){return X.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});av.fromCartesian3=function(e){return new av(e.x,e.y,e.z)};av.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Qi=av;function IL(e){e=y(e,!0),this.value=IL.toValue(e)}Object.defineProperties(IL.prototype,{componentDatatype:{get:function(){return X.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});IL.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var yn=IL;var PL=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.tangentToEyeMatrix = tangentToEyeMatrix; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var RL=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec3 tangent; -in vec3 bitangent; -in vec2 st; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec3 v_tangentEC; -out vec3 v_bitangentEC; -out vec2 v_st; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_tangentEC = czm_normal * tangent; // tangent in eye coordinates - v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var OL=`in vec3 v_positionEC; -in vec3 v_normalEC; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var ML=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var LL=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - materialInput.st = v_st; - czm_material material = czm_getMaterial(materialInput); - -#ifdef FLAT - out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var NL=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec2 st; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec2 v_st; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_st = st; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var P1e={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX},qa=Object.freeze(P1e);var R1e={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE},So=Object.freeze(R1e);var O1e={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:qa.ADD,equationAlpha:qa.ADD,functionSourceRgb:So.SOURCE_ALPHA,functionSourceAlpha:So.ONE,functionDestinationRgb:So.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:So.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:qa.ADD,equationAlpha:qa.ADD,functionSourceRgb:So.ONE,functionSourceAlpha:So.ONE,functionDestinationRgb:So.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:So.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:qa.ADD,equationAlpha:qa.ADD,functionSourceRgb:So.SOURCE_ALPHA,functionSourceAlpha:So.ONE,functionDestinationRgb:So.ONE,functionDestinationAlpha:So.ONE})},un=Object.freeze(O1e);var M1e={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK},xi=Object.freeze(M1e);function RT(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(RT.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});RT.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};RT.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};RT.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ge(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};RT.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=un.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:xi.BACK}),l(n)&&(i=bt(n,i,!0)),i};var to=RT;var FL=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var BL=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - vec2 centerPixel = fract(repeat * st); - float centerBump = texture(image, centerPixel).channel; - - float imageWidth = float(imageDimensions.x); - vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0))); - float rightBump = texture(image, rightPixel).channel; - - float imageHeight = float(imageDimensions.y); - vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight))); - float topBump = texture(image, leftPixel).channel; - - vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0))); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - material.diffuse = vec3(0.01); - - return material; -} -`;var kL=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0 - - // Find the distance from the closest separator (region between two colors) - float scaledWidth = fract(repeat.s * st.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(repeat.t * st.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - float value = min(scaledWidth, scaledHeight); - - vec4 currentColor = mix(lightColor, darkColor, b); - vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03); - - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var VL=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights - float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0 - - vec4 color = mix(lightColor, darkColor, b); - color = czm_gammaCorrect(color); - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var UL=`uniform sampler2D heights; -uniform sampler2D colors; - -// This material expects heights to be sorted from lowest to highest. - -float getHeight(int idx, float invTexSize) -{ - vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); -#ifdef OES_texture_float - return texture(heights, uv).x; -#else - return czm_unpackFloat(texture(heights, uv)); -#endif -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float height = materialInput.height; - float invTexSize = 1.0 / float(heightsDimensions.x); - - float minHeight = getHeight(0, invTexSize); - float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize); - - // early-out when outside the height range - if (height < minHeight || height > maxHeight) { - material.diffuse = vec3(0.0); - material.alpha = 0.0; - return material; - } - - // Binary search to find heights above and below. - int idxBelow = 0; - int idxAbove = heightsDimensions.x; - float heightBelow = minHeight; - float heightAbove = maxHeight; - - // while loop not allowed, so use for loop with max iterations. - // maxIterations of 16 supports a texture size up to 65536 (2^16). - const int maxIterations = 16; - for (int i = 0; i < maxIterations; i++) { - if (idxBelow >= idxAbove - 1) { - break; - } - - int idxMid = (idxBelow + idxAbove) / 2; - float heightTex = getHeight(idxMid, invTexSize); - - if (height > heightTex) { - idxBelow = idxMid; - heightBelow = heightTex; - } else { - idxAbove = idxMid; - heightAbove = heightTex; - } - } - - float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); - vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); - vec4 color = texture(colors, colorUv); - - // undo preumultiplied alpha - if (color.a > 0.0) - { - color.rgb /= color.a; - } - - color.rgb = czm_gammaCorrect(color.rgb); - - material.diffuse = color.rgb; - material.alpha = color.a; - return material; -} -`;var zL=`uniform vec4 color; -uniform float spacing; -uniform float width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float distanceToContour = mod(materialInput.height, spacing); - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float dxc = abs(dFdx(materialInput.height)); - float dyc = abs(dFdy(materialInput.height)); - float dF = max(dxc, dyc) * czm_pixelRatio * width; - float alpha = (distanceToContour < dF) ? 1.0 : 0.0; -#else - // If no derivatives available (IE 10?), use pixel ratio - float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; -#endif - - vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var HL=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); - vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var GL=`uniform vec4 fadeInColor; -uniform vec4 fadeOutColor; -uniform float maximumDistance; -uniform bool repeat; -uniform vec2 fadeDirection; -uniform vec2 time; - -float getTime(float t, float coord) -{ - float scalar = 1.0 / maximumDistance; - float q = distance(t, coord) * scalar; - if (repeat) - { - float r = distance(t, coord + 1.0) * scalar; - float s = distance(t, coord - 1.0) * scalar; - q = min(min(r, s), q); - } - return clamp(q, 0.0, 1.0); -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float s = getTime(time.x, st.s) * fadeDirection.s; - float t = getTime(time.y, st.t) * fadeDirection.t; - - float u = length(vec2(s, t)); - vec4 color = mix(fadeInColor, fadeOutColor, u); - - color = czm_gammaCorrect(color); - material.emission = color.rgb; - material.alpha = color.a; - - return material; -} -`;var WL=`uniform vec4 color; -uniform float cellAlpha; -uniform vec2 lineCount; -uniform vec2 lineThickness; -uniform vec2 lineOffset; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - - float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); - scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); - float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); - scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); - - float value; - - // Fuzz Factor - Controls blurriness of lines -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - const float fuzz = 1.2; - vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; - - // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. - vec2 dx = abs(dFdx(st)); - vec2 dy = abs(dFdy(st)); - vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; - value = min( - smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), - smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); -#else - // If no derivatives available (IE 10?), revert to view-dependent fuzz - const float fuzz = 0.05; - - vec2 range = 0.5 - (lineThickness * 0.05); - value = min( - 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), - 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); -#endif - - // Edges taken from RimLightingMaterial.glsl - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); - float sRim = smoothstep(0.8, 1.0, dRim); - value *= (1.0 - sRim); - - vec4 halfColor; - halfColor.rgb = color.rgb * 0.5; - halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); - halfColor = czm_gammaCorrect(halfColor); - material.diffuse = halfColor.rgb; - material.emission = halfColor.rgb; - material.alpha = halfColor.a; - - return material; -} -`;var jL=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec4 textureValue = texture(image, fract(repeat * materialInput.st)); - vec3 normalTangentSpace = textureValue.channels; - normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; - normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); - normalTangentSpace = normalize(normalTangentSpace); - vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; - - material.normal = normalEC; - - return material; -} -`;var qL=`uniform vec4 color; - -float getPointOnLine(vec2 p0, vec2 p1, float x) -{ - float slope = (p0.y - p1.y) / (p0.x - p1.x); - return slope * (x - p0.x) + p0.y; -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) - float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; -#else - // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head - float base = 0.975; -#endif - - vec2 center = vec2(1.0, 0.5); - float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); - float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); - - float halfWidth = 0.15; - float s = step(0.5 - halfWidth, st.t); - s *= 1.0 - step(0.5 + halfWidth, st.t); - s *= 1.0 - step(base, st.s); - - float t = step(base, materialInput.st.s); - t *= 1.0 - step(ptOnUpperLine, st.t); - t *= step(ptOnLowerLine, st.t); - - // Find the distance from the closest separator (region between two colors) - float dist; - if (st.s < base) - { - float d1 = abs(st.t - (0.5 - halfWidth)); - float d2 = abs(st.t - (0.5 + halfWidth)); - dist = min(d1, d2); - } - else - { - float d1 = czm_infinity; - if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) - { - d1 = abs(st.s - base); - } - float d2 = abs(st.t - ptOnUpperLine); - float d3 = abs(st.t - ptOnLowerLine); - dist = min(min(d1, d2), d3); - } - - vec4 outsideColor = vec4(0.0); - vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); - vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); - - outColor = czm_gammaCorrect(outColor); - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - return material; -} -`;var YL=`uniform vec4 color; -uniform vec4 gapColor; -uniform float dashLength; -uniform float dashPattern; -in float v_polylineAngle; - -const float maskLength = 16.0; - -mat2 rotate(float rad) { - float c = cos(rad); - float s = sin(rad); - return mat2( - c, s, - -s, c - ); -} - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; - - // Get the relative position within the dash from 0 to 1 - float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); - // Figure out the mask index. - float maskIndex = floor(dashPosition * maskLength); - // Test the bit mask. - float maskTest = floor(dashPattern / pow(2.0, maskIndex)); - vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; - if (fragColor.a < 0.005) { // matches 0/255 and 1/255 - discard; - } - - fragColor = czm_gammaCorrect(fragColor); - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - return material; -} -`;var XL=`uniform vec4 color; -uniform float glowPower; -uniform float taperPower; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); - - if (taperPower <= 0.99999) { - glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); - } - - vec4 fragColor; - fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); - fragColor.a = clamp(0.0, 1.0, glow) * color.a; - fragColor = czm_gammaCorrect(fragColor); - - material.emission = fragColor.rgb; - material.alpha = fragColor.a; - - return material; -} -`;var KL=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; - -in float v_width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec2 st = materialInput.st; - float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; - float b = step(0.5 - halfInteriorWidth, st.t); - b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); - - // Find the distance from the closest separator (region between two colors) - float d1 = abs(st.t - (0.5 - halfInteriorWidth)); - float d2 = abs(st.t - (0.5 + halfInteriorWidth)); - float dist = min(d1, d2); - - vec4 currentColor = mix(outlineColor, color, b); - vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); - outColor = czm_gammaCorrect(outColor); - - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var ZL=`uniform vec4 color; -uniform vec4 rimColor; -uniform float width; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html - float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); - float s = smoothstep(1.0 - width, 1.0, d); - - vec4 outColor = czm_gammaCorrect(color); - vec4 outRimColor = czm_gammaCorrect(rimColor); - - material.diffuse = outColor.rgb; - material.emission = outRimColor.rgb * s; - material.alpha = mix(outColor.a, outRimColor.a, s); - - return material; -} -`;var $L=`uniform sampler2D image; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); - rampColor = czm_gammaCorrect(rampColor); - material.diffuse = rampColor.rgb; - material.alpha = rampColor.a; - return material; -} -`;var QL=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) - float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); - float value = fract((coord - offset) * (repeat * 0.5)); - float dist = min(value, min(abs(value - 0.5), 1.0 - value)); - - vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); - vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); - color = czm_gammaCorrect(color); - - material.diffuse = color.rgb; - material.alpha = color.a; - - return material; -} -`;var JL=`uniform vec4 waterColor; -uniform vec4 landColor; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); - outColor = czm_gammaCorrect(outColor); - - material.diffuse = outColor.rgb; - material.alpha = outColor.a; - - return material; -} -`;var eN=`// Thanks for the contribution Jonas -// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog - -uniform sampler2D specularMap; -uniform sampler2D normalMap; -uniform vec4 baseWaterColor; -uniform vec4 blendColor; -uniform float frequency; -uniform float animationSpeed; -uniform float amplitude; -uniform float specularIntensity; -uniform float fadeFactor; - -czm_material czm_getMaterial(czm_materialInput materialInput) -{ - czm_material material = czm_getDefaultMaterial(materialInput); - - float time = czm_frameNumber * animationSpeed; - - // fade is a function of the distance from the fragment and the frequency of the waves - float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); - - float specularMapValue = texture(specularMap, materialInput.st).r; - - // note: not using directional motion at this time, just set the angle to 0.0; - vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); - vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); - - // fade out the normal perturbation as we move further from the water surface - normalTangentSpace.xy /= fade; - - // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) - normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); - - normalTangentSpace = normalize(normalTangentSpace); - - // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane - float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); - - // fade out water effect as specular map value decreases - material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; - - // base color is a blend of the water and non-water color based on the value from the specular map - // may need a uniform blend factor to better control this - material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); - - // diffuse highlights are based on how perturbed the normal is - material.diffuse += (0.1 * tsPerturbationRatio); - - material.diffuse = material.diffuse; - - material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); - - material.specular = specularIntensity; - material.shininess = 10.0; - - return material; -} -`;function We(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,Zt.LINEAR),this._magnificationFilter=y(e.magnificationFilter,di.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,L1e(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(We._uniformList[this.type])||(We._uniformList[this.type]=Object.keys(this._uniforms))}We._uniformList={};We.fromType=function(e,t){let n=new We({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};We.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};We.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(x){return x.bufferView}),u=u[0]);let h=new $t({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Ot({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:h}):p=new Ot({context:e,source:u,sampler:h});let _=this._textures[n];l(_)&&_!==this._defaultTexture&&_.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let x=this.uniforms[m];x.x=p._width,x.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let u=c.images,f=new wr({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new $t({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};We.prototype.isDestroyed=function(){return!1};We.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function L1e(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=Ge(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=Ge(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=Ge(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:zn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=We._materialCache.getMaterial(t.type);if(l(i)){let r=Ge(i.fabric,!0);t._template=bt(t._template,r,!0),n=i.translucent}k1e(t),l(i)||We._materialCache.addMaterial(t.type,t),U1e(t),W1e(t),q1e(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,o),n=y(e.translucent,n),l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function x6(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function Aee(e,t){}function N1e(e,t){}var F1e=["type","materials","uniforms","components","source"],B1e=["diffuse","specular","shininess","normal","emission","alpha"];function k1e(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;x6(t,F1e,Aee,!0),x6(o,B1e,Aee,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);x6(n,r,N1e,!1)}function V1e(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function U1e(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} -`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) -{ -`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&V1e(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; -`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; -`:e.shaderSource+=`material.${o} = ${t[o]}; -`}e.shaderSource+=`return material; -} -`}}var Eee={mat2:Pi,mat3:$,mat4:F},z1e=/\.ktx2$/i;function H1e(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===We.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new $t({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Ot({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Ot&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),a)return;let h=r instanceof Se;if(!l(n._texturePaths[e])||h&&r.url!==n._texturePaths[e].url||!h&&r!==n._texturePaths[e]){if(typeof r=="string"||h){let p=h?r:Se.createIfNeeded(r),_;z1e.test(p.url)?_=Wl(p.url):_=p.fetchImage(),Promise.resolve(_).then(function(m){n._loadedImages.push({id:e,image:m})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function G1e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof wr){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===We.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Se.createIfNeeded(i.positiveX).fetchImage(),Se.createIfNeeded(i.negativeX).fetchImage(),Se.createIfNeeded(i.positiveY).fetchImage(),Se.createIfNeeded(i.negativeY).fetchImage(),Se.createIfNeeded(i.positiveZ).fetchImage(),Se.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function W1e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&See(e,n)}function See(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=j1e(o),s;if(r==="channels")s=cv(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;Y1e(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},See(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=cv(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(H1e(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(G1e(t));else if(r.indexOf("mat")!==-1){let u=new Eee[r];e._uniforms[c]=function(){return Eee[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function j1e(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Se||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===We.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function q1e(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new We({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=bt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;cv(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=cv(e,i,a)}}function cv(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(o+=1,n)}),o}function Y1e(e,t,n){return cv(e,t,t,n)}We._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};We.DefaultImageId="czm_defaultImage";We.DefaultCubeMapId="czm_defaultCubeMap";We.ColorType="Color";We._materialCache.addMaterial(We.ColorType,{fabric:{type:We.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});We.ImageType="Image";We._materialCache.addMaterial(We.ImageType,{fabric:{type:We.ImageType,uniforms:{image:We.DefaultImageId,repeat:new U(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});We.DiffuseMapType="DiffuseMap";We._materialCache.addMaterial(We.DiffuseMapType,{fabric:{type:We.DiffuseMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.AlphaMapType="AlphaMap";We._materialCache.addMaterial(We.AlphaMapType,{fabric:{type:We.AlphaMapType,uniforms:{image:We.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});We.SpecularMapType="SpecularMap";We._materialCache.addMaterial(We.SpecularMapType,{fabric:{type:We.SpecularMapType,uniforms:{image:We.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});We.EmissionMapType="EmissionMap";We._materialCache.addMaterial(We.EmissionMapType,{fabric:{type:We.EmissionMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});We.BumpMapType="BumpMap";We._materialCache.addMaterial(We.BumpMapType,{fabric:{type:We.BumpMapType,uniforms:{image:We.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:BL},translucent:!1});We.NormalMapType="NormalMap";We._materialCache.addMaterial(We.NormalMapType,{fabric:{type:We.NormalMapType,uniforms:{image:We.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:jL},translucent:!1});We.GridType="Grid";We._materialCache.addMaterial(We.GridType,{fabric:{type:We.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:WL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});We.StripeType="Stripe";We._materialCache.addMaterial(We.StripeType,{fabric:{type:We.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:QL},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});We.CheckerboardType="Checkerboard";We._materialCache.addMaterial(We.CheckerboardType,{fabric:{type:We.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new U(5,5)},source:kL},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.DotType="Dot";We._materialCache.addMaterial(We.DotType,{fabric:{type:We.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new U(5,5)},source:VL},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});We.WaterType="Water";We._materialCache.addMaterial(We.WaterType,{fabric:{type:We.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:We.DefaultImageId,normalMap:We.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:eN},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});We.RimLightingType="RimLighting";We._materialCache.addMaterial(We.RimLightingType,{fabric:{type:We.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:ZL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});We.FadeType="Fade";We._materialCache.addMaterial(We.FadeType,{fabric:{type:We.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:GL},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});We.PolylineArrowType="PolylineArrow";We._materialCache.addMaterial(We.PolylineArrowType,{fabric:{type:We.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:qL},translucent:!0});We.PolylineDashType="PolylineDash";We._materialCache.addMaterial(We.PolylineDashType,{fabric:{type:We.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:YL},translucent:!0});We.PolylineGlowType="PolylineGlow";We._materialCache.addMaterial(We.PolylineGlowType,{fabric:{type:We.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:XL},translucent:!0});We.PolylineOutlineType="PolylineOutline";We._materialCache.addMaterial(We.PolylineOutlineType,{fabric:{type:We.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:KL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});We.ElevationContourType="ElevationContour";We._materialCache.addMaterial(We.ElevationContourType,{fabric:{type:We.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:zL},translucent:!1});We.ElevationRampType="ElevationRamp";We._materialCache.addMaterial(We.ElevationRampType,{fabric:{type:We.ElevationRampType,uniforms:{image:We.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:HL},translucent:!1});We.SlopeRampMaterialType="SlopeRamp";We._materialCache.addMaterial(We.SlopeRampMaterialType,{fabric:{type:We.SlopeRampMaterialType,uniforms:{image:We.DefaultImageId},source:$L},translucent:!1});We.AspectRampMaterialType="AspectRamp";We._materialCache.addMaterial(We.AspectRampMaterialType,{fabric:{type:We.AspectRampMaterialType,uniforms:{image:We.DefaultImageId},source:FL},translucent:!1});We.ElevationBandType="ElevationBand";We._materialCache.addMaterial(We.ElevationBandType,{fabric:{type:We.ElevationBandType,uniforms:{heights:We.DefaultImageId,colors:We.DefaultImageId},source:UL},translucent:!0});We.WaterMaskType="WaterMask";We._materialCache.addMaterial(We.WaterMaskType,{fabric:{type:We.WaterMaskType,source:JL,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var Yi=We;function H0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,H0.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=to.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(H0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});H0.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;H0.prototype.isTranslucent=to.prototype.isTranslucent;H0.prototype.getRenderState=to.prototype.getRenderState;H0.MaterialSupport={BASIC:Object.freeze({vertexFormat:Ie.POSITION_AND_NORMAL,vertexShaderSource:ML,fragmentShaderSource:OL}),TEXTURED:Object.freeze({vertexFormat:Ie.POSITION_NORMAL_AND_ST,vertexShaderSource:NL,fragmentShaderSource:LL}),ALL:Object.freeze({vertexFormat:Ie.ALL,vertexShaderSource:RL,fragmentShaderSource:PL})};var so=H0;var tN=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec4 v_color; - -void main() -{ - vec3 positionToEyeEC = -v_positionEC; - - vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD - normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif - - vec4 color = czm_gammaCorrect(v_color); - - czm_materialInput materialInput; - materialInput.normalEC = normalEC; - materialInput.positionToEyeEC = positionToEyeEC; - czm_material material = czm_getDefaultMaterial(materialInput); - material.diffuse = color.rgb; - material.alpha = color.a; - - out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -} -`;var nN=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec4 color; -in float batchId; - -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec4 v_color; - -void main() -{ - vec4 p = czm_computePosition(); - - v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates - v_normalEC = czm_normal * normal; // normal in eye coordinates - v_color = color; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var OT=`in vec4 v_color; - -void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -} -`;var iN=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 color; -in float batchId; - -out vec4 v_color; - -void main() -{ - vec4 p = czm_computePosition(); - - v_color = color; - - gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function cp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?iN:nN,r=i?OT:tN,s=i?cp.FLAT_VERTEX_FORMAT:cp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=to.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(cp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});cp.VERTEX_FORMAT=Ie.POSITION_AND_NORMAL;cp.FLAT_VERTEX_FORMAT=Ie.POSITION_ONLY;cp.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;cp.prototype.isTranslucent=to.prototype.isTranslucent;cp.prototype.getRenderState=to.prototype.getRenderState;var cn=cp;function MT(e){this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(MT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});MT.prototype.getType=function(e){return"Color"};var X1e=new Z;MT.prototype.getValue=function(e,t){return l(e)||(e=Z.now(X1e)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};MT.prototype.equals=function(e){return this===e||e instanceof MT&&q.equals(this._color,e._color)};var zt=MT;function qg(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ee.default),this._rectangle=y(e.rectangle,se.MAX_VALUE),this._projection=new Ii(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(qg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});qg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};qg.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};qg.prototype.rectangleToNativeRectangle=function(e,t){let n=P.toDegrees(e.west),i=P.toDegrees(e.south),o=P.toDegrees(e.east),r=P.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new se(n,i,o,r)};qg.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=P.toDegrees(o.west),o.south=P.toDegrees(o.south),o.east=P.toDegrees(o.east),o.north=P.toDegrees(o.north),o};qg.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,u=(e+1)*a+o.west,f=o.height/s,h=o.north-t*f,p=o.north-(t+1)*f;return l(i)||(i=new se(c,p,u,h)),i.west=c,i.south=p,i.east=u,i.north=h,i};qg.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!se.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=P.TWO_PI);let u=(c-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new U(u,f)};var Xi=qg;var vee=new d,wee=new d,Dee=new fe,b6=new d,K1e=new d,Iee=new ae,Z1e=new Xi,lv=[new fe,new fe,new fe,new fe],uv=new U,Wr={};Wr.initialize=function(){let e=Wr._initPromise;return l(e)||(e=Se.fetchJson(nn("Assets/approximateTerrainHeights.json")).then(function(t){Wr._terrainHeights=t}),Wr._initPromise=e),e};Wr.getMinimumMaximumHeights=function(e,t){t=y(t,ee.default);let n=Pee(e),i=Wr._defaultMinTerrainHeight,o=Wr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Wr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(se.northeast(e,Dee),vee),t.cartographicToCartesian(se.southwest(e,Dee),wee),d.midpoint(wee,vee,b6);let a=t.scaleToGeodeticSurface(b6,K1e);if(l(a)){let c=d.distance(b6,a);i=Math.min(i,-c)}else i=Wr._defaultMinTerrainHeight}return i=Math.max(Wr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Wr.getBoundingSphere=function(e,t){t=y(t,ee.default);let n=Pee(e),i=Wr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Wr._terrainHeights[r];l(s)&&(i=s[1])}let o=ae.fromRectangle3D(e,t,0);return ae.fromRectangle3D(e,t,i,Iee),ae.union(o,Iee,o)};function Pee(e){fe.fromRadians(e.east,e.north,0,lv[0]),fe.fromRadians(e.west,e.north,0,lv[1]),fe.fromRadians(e.east,e.south,0,lv[2]),fe.fromRadians(e.west,e.south,0,lv[3]);let t=0,n=0,i=0,o=0,r=Wr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let u=lv[c];if(Z1e.positionToTileXY(u,s,uv),c===0)i=uv.x,o=uv.y;else if(i!==uv.x||o!==uv.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Wr._terrainHeightsMaxLevel=6;Wr._defaultMaxTerrainHeight=9e3;Wr._defaultMinTerrainHeight=-1e5;Wr._terrainHeights=void 0;Wr._initPromise=void 0;Object.defineProperties(Wr,{initialized:{get:function(){return l(Wr._terrainHeights)}}});var li=Wr;function Sc(e,t,n){this.minimum=d.clone(y(e,d.ZERO)),this.maximum=d.clone(y(t,d.ZERO)),l(n)?n=d.clone(n):n=d.midpoint(this.minimum,this.maximum,new d),this.center=n}Sc.fromCorners=function(e,t,n){return l(n)||(n=new Sc),n.minimum=d.clone(e,n.minimum),n.maximum=d.clone(t,n.maximum),n.center=d.midpoint(e,t,n.center),n};Sc.fromPoints=function(e,t){if(l(t)||(t=new Sc),!l(e)||e.length===0)return t.minimum=d.clone(d.ZERO,t.minimum),t.maximum=d.clone(d.ZERO,t.maximum),t.center=d.clone(d.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let h=1;h<c;h++){let p=e[h],_=p.x,m=p.y,x=p.z;n=Math.min(_,n),r=Math.max(_,r),i=Math.min(m,i),s=Math.max(m,s),o=Math.min(x,o),a=Math.max(x,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=d.midpoint(u,f,t.center),t};Sc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=d.clone(e.minimum,t.minimum),t.maximum=d.clone(e.maximum,t.maximum),t.center=d.clone(e.center,t.center),t):new Sc(e.minimum,e.maximum,e.center)};Sc.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&d.equals(e.minimum,t.minimum)&&d.equals(e.maximum,t.maximum)};var oN=new d;Sc.intersectPlane=function(e,t){oN=d.subtract(e.maximum,e.minimum,oN);let n=d.multiplyByScalar(oN,.5,oN),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=d.dot(e.center,i)+t.distance;return r-o>0?jt.INSIDE:r+o<0?jt.OUTSIDE:jt.INTERSECTING};Sc.prototype.clone=function(e){return Sc.clone(this,e)};Sc.prototype.intersectPlane=function(e){return Sc.intersectPlane(this,e)};Sc.prototype.equals=function(e){return Sc.equals(this,e)};var G0=Sc;var T6=new oe;function Mh(e,t){t=y(t,ee.default),e=t.scaleToGeodeticSurface(e);let n=Mt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=d.fromCartesian4(F.getColumn(n,0,T6)),this._yAxis=d.fromCartesian4(F.getColumn(n,1,T6));let i=d.fromCartesian4(F.getColumn(n,2,T6));this._plane=an.fromPointNormal(e,i)}Object.defineProperties(Mh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var $1e=new G0;Mh.fromPoints=function(e,t){let n=G0.fromPoints(e,$1e);return new Mh(n.center,t)};var Ree=new pn,rN=new d;Mh.prototype.projectPointOntoPlane=function(e,t){let n=Ree;n.origin=e,d.normalize(e,n.direction);let i=Zn.rayPlane(n,this._plane,rN);if(l(i)||(d.negate(n.direction,n.direction),i=Zn.rayPlane(n,this._plane,rN)),l(i)){let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new U(r,s)}};Mh.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);l(r)&&(t[n]=r,n++)}return t.length=n,t};Mh.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=Ree;n.origin=e,d.clone(this._plane.normal,n.direction);let i=Zn.rayPlane(n,this._plane,rN);l(i)||(d.negate(n.direction,n.direction),i=Zn.rayPlane(n,this._plane,rN));let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return t.x=r,t.y=s,t};Mh.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var Q1e=new d;Mh.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new d);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=Q1e;return d.multiplyByScalar(o,e.x,s),t=d.add(i,s,t),d.multiplyByScalar(r,e.y,s),d.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Mh.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var ns=Mh;function Ri(e,t){this.center=d.clone(y(e,d.ZERO)),this.halfAxes=$.clone(y(t,$.ZERO))}Ri.packedLength=d.packedLength+$.packedLength;Ri.pack=function(e,t,n){return n=y(n,0),d.pack(e.center,t,n),$.pack(e.halfAxes,t,n+d.packedLength),t};Ri.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ri),d.unpack(e,t,n.center),$.unpack(e,t+d.packedLength,n.halfAxes),n};var J1e=new d,eRe=new d,tRe=new d,nRe=new d,iRe=new d,oRe=new d,rRe=new $,sRe={unitary:new $,diagonal:new $};Ri.fromPoints=function(e,t){if(l(t)||(t=new Ri),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=d.ZERO,t;let n,i=e.length,o=d.clone(e[0],J1e);for(n=1;n<i;n++)d.add(o,e[n],o);let r=1/i;d.multiplyByScalar(o,r,o);let s=0,a=0,c=0,u=0,f=0,h=0,p;for(n=0;n<i;n++)p=d.subtract(e[n],o,eRe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,h+=p.z*p.z;s*=r,a*=r,c*=r,u*=r,f*=r,h*=r;let _=rRe;_[0]=s,_[1]=a,_[2]=c,_[3]=a,_[4]=u,_[5]=f,_[6]=c,_[7]=f,_[8]=h;let m=$.computeEigenDecomposition(_,sRe),x=$.clone(m.unitary,t.halfAxes),b=$.getColumn(x,0,nRe),T=$.getColumn(x,1,iRe),C=$.getColumn(x,2,oRe),A=-Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE,D=Number.MAX_VALUE,O=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],A=Math.max(d.dot(b,p),A),S=Math.max(d.dot(T,p),S),v=Math.max(d.dot(C,p),v),D=Math.min(d.dot(b,p),D),O=Math.min(d.dot(T,p),O),R=Math.min(d.dot(C,p),R);b=d.multiplyByScalar(b,.5*(D+A),b),T=d.multiplyByScalar(T,.5*(O+S),T),C=d.multiplyByScalar(C,.5*(R+v),C);let M=d.add(b,T,t.center);d.add(M,C,M);let L=tRe;return L.x=A-D,L.y=S-O,L.z=v-R,d.multiplyByScalar(L,.5,L),$.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var Bee=new d,aRe=new d;function Oee(e,t,n,i,o,r,s,a,c,u,f){l(f)||(f=new Ri);let h=f.halfAxes;$.setColumn(h,0,t,h),$.setColumn(h,1,n,h),$.setColumn(h,2,i,h);let p=Bee;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+u)/2;let _=aRe;_.x=(r-o)/2,_.y=(a-s)/2,_.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(h,p,p),d.add(e,p,m),$.multiplyByScale(h,_,h),f}var Mee=new fe,cRe=new d,lRe=new fe,uRe=new fe,fRe=new fe,dRe=new fe,hRe=new fe,mRe=new d,Lee=new d,pRe=new d,Nee=new d,gRe=new d,_Re=new U,yRe=new U,xRe=new U,bRe=new U,TRe=new U,CRe=new d,ARe=new d,ERe=new d,SRe=new d,vRe=new U,wRe=new d,DRe=new d,IRe=new d,PRe=new an(d.UNIT_X,0);Ri.fromRectangle=function(e,t,n,i,o){t=y(t,0),n=y(n,0),i=y(i,ee.default);let r,s,a,c,u,f,h;if(e.width<=P.PI){let O=se.center(e,Mee),R=i.cartographicToCartesian(O,cRe),M=new ns(R,i);h=M.plane;let L=O.longitude,g=e.south<0&&e.north>0?0:O.latitude,E=fe.fromRadians(L,e.north,n,lRe),w=fe.fromRadians(e.west,e.north,n,uRe),I=fe.fromRadians(e.west,g,n,fRe),N=fe.fromRadians(e.west,e.south,n,dRe),B=fe.fromRadians(L,e.south,n,hRe),H=i.cartographicToCartesian(E,mRe),V=i.cartographicToCartesian(w,Lee),G=i.cartographicToCartesian(I,pRe),k=i.cartographicToCartesian(N,Nee),W=i.cartographicToCartesian(B,gRe),Y=M.projectPointToNearestOnPlane(H,_Re),J=M.projectPointToNearestOnPlane(V,yRe),j=M.projectPointToNearestOnPlane(G,xRe),K=M.projectPointToNearestOnPlane(k,bRe),Q=M.projectPointToNearestOnPlane(W,TRe);return r=Math.min(J.x,j.x,K.x),s=-r,c=Math.max(J.y,Y.y),a=Math.min(K.y,Q.y),w.height=N.height=t,V=i.cartographicToCartesian(w,Lee),k=i.cartographicToCartesian(N,Nee),u=Math.min(an.getPointDistance(h,V),an.getPointDistance(h,k)),f=n,Oee(M.origin,M.xAxis,M.yAxis,M.zAxis,r,s,a,c,u,f,o)}let p=e.south>0,_=e.north<0,m=p?e.south:_?e.north:0,x=se.center(e,Mee).longitude,b=d.fromRadians(x,m,n,i,CRe);b.z=0;let C=Math.abs(b.x)<P.EPSILON10&&Math.abs(b.y)<P.EPSILON10?d.UNIT_X:d.normalize(b,ARe),A=d.UNIT_Z,S=d.cross(C,A,ERe);h=an.fromPointNormal(b,C,PRe);let v=d.fromRadians(x+P.PI_OVER_TWO,m,n,i,SRe);s=d.dot(an.projectPointOntoPlane(h,v,vRe),S),r=-s,c=d.fromRadians(0,e.north,_?t:n,i,wRe).z,a=d.fromRadians(0,e.south,p?t:n,i,DRe).z;let D=d.fromRadians(e.east,m,n,i,IRe);return u=an.getPointDistance(h,D),f=0,Oee(b,S,A,C,r,s,a,c,u,f,o)};Ri.fromTransformation=function(e,t){return l(t)||(t=new Ri),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Ri.clone=function(e,t){if(l(e))return l(t)?(d.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new Ri(e.center,e.halfAxes)};Ri.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[$.COLUMN0ROW0]+s*o[$.COLUMN0ROW1]+a*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+s*o[$.COLUMN1ROW1]+a*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+s*o[$.COLUMN2ROW1]+a*o[$.COLUMN2ROW2]),u=d.dot(i,n)+t.distance;return u<=-c?jt.OUTSIDE:u>=c?jt.INSIDE:jt.INTERSECTING};var kee=new d,Vee=new d,Uee=new d,RRe=new d,Fee=new d,ORe=new d;Ri.distanceSquaredTo=function(e,t){let n=d.subtract(t,e.center,Bee),i=e.halfAxes,o=$.getColumn(i,0,kee),r=$.getColumn(i,1,Vee),s=$.getColumn(i,2,Uee),a=d.magnitude(o),c=d.magnitude(r),u=d.magnitude(s),f=!0,h=!0,p=!0;a>0?d.divideByScalar(o,a,o):f=!1,c>0?d.divideByScalar(r,c,r):h=!1,u>0?d.divideByScalar(s,u,s):p=!1;let _=!f+!h+!p,m,x,b;if(_===1){let S=o;m=r,x=s,h?p||(S=s,x=o):(S=r,m=o),b=d.cross(m,x,Fee),S===o?o=b:S===r?r=b:S===s&&(s=b)}else if(_===2){m=o,h?m=r:p&&(m=s);let S=d.UNIT_Y;S.equalsEpsilon(m,P.EPSILON3)&&(S=d.UNIT_X),x=d.cross(m,S,RRe),d.normalize(x,x),b=d.cross(m,x,Fee),d.normalize(b,b),m===o?(r=x,s=b):m===r?(s=x,o=b):m===s&&(o=x,r=b)}else _===3&&(o=d.UNIT_X,r=d.UNIT_Y,s=d.UNIT_Z);let T=ORe;T.x=d.dot(n,o),T.y=d.dot(n,r),T.z=d.dot(n,s);let C=0,A;return T.x<-a?(A=T.x+a,C+=A*A):T.x>a&&(A=T.x-a,C+=A*A),T.y<-c?(A=T.y+c,C+=A*A):T.y>c&&(A=T.y-c,C+=A*A),T.z<-u?(A=T.z+u,C+=A*A):T.z>u&&(A=T.z-u,C+=A*A),C};var MRe=new d,LRe=new d;Ri.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Wa);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,kee),u=$.getColumn(a,1,Vee),f=$.getColumn(a,2,Uee),h=d.add(c,u,MRe);d.add(h,f,h),d.add(h,s,h);let p=d.subtract(h,t,LRe),_=d.dot(n,p);return o=Math.min(_,o),r=Math.max(_,r),d.add(s,c,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.add(s,c,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.add(s,c,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.subtract(s,c,h),d.add(h,u,h),d.add(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.subtract(s,c,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.subtract(s,c,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),d.subtract(s,c,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),_=d.dot(n,p),o=Math.min(_,o),r=Math.max(_,r),i.start=o,i.stop=r,i};var NRe=new d,FRe=new d,BRe=new d;Ri.computeCorners=function(e,t){l(t)||(t=[new d,new d,new d,new d,new d,new d,new d,new d]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,NRe),r=$.getColumn(i,1,FRe),s=$.getColumn(i,2,BRe);return d.clone(n,t[0]),d.subtract(t[0],o,t[0]),d.subtract(t[0],r,t[0]),d.subtract(t[0],s,t[0]),d.clone(n,t[1]),d.subtract(t[1],o,t[1]),d.subtract(t[1],r,t[1]),d.add(t[1],s,t[1]),d.clone(n,t[2]),d.subtract(t[2],o,t[2]),d.add(t[2],r,t[2]),d.subtract(t[2],s,t[2]),d.clone(n,t[3]),d.subtract(t[3],o,t[3]),d.add(t[3],r,t[3]),d.add(t[3],s,t[3]),d.clone(n,t[4]),d.add(t[4],o,t[4]),d.subtract(t[4],r,t[4]),d.subtract(t[4],s,t[4]),d.clone(n,t[5]),d.add(t[5],o,t[5]),d.subtract(t[5],r,t[5]),d.add(t[5],s,t[5]),d.clone(n,t[6]),d.add(t[6],o,t[6]),d.add(t[6],r,t[6]),d.subtract(t[6],s,t[6]),d.clone(n,t[7]),d.add(t[7],o,t[7]),d.add(t[7],r,t[7]),d.add(t[7],s,t[7]),t};var kRe=new $;Ri.computeTransformation=function(e,t){l(t)||(t=new F);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,kRe);return F.fromRotationTranslation(i,n,t)};var VRe=new ae;Ri.isOccluded=function(e,t){let n=ae.fromOrientedBoundingBox(e,VRe);return!t.isBoundingSphereVisible(n)};Ri.prototype.intersectPlane=function(e){return Ri.intersectPlane(this,e)};Ri.prototype.distanceSquaredTo=function(e){return Ri.distanceSquaredTo(this,e)};Ri.prototype.computePlaneDistances=function(e,t,n){return Ri.computePlaneDistances(this,e,t,n)};Ri.prototype.computeCorners=function(e){return Ri.computeCorners(this,e)};Ri.prototype.computeTransformation=function(e){return Ri.computeTransformation(this,e)};Ri.prototype.isOccluded=function(e){return Ri.isOccluded(this,e)};Ri.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Ri.prototype.clone=function(e){return Ri.clone(this,e)};Ri.prototype.equals=function(e){return Ri.equals(this,e)};var wn=Ri;var sN={};sN.getHeight=function(e,t,n){return(e-n)*t+n};var URe=new fe;sN.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,URe);if(!l(r))return d.clone(e,o);let s=sN.getHeight(r.height,n,i);return d.fromRadians(r.longitude,r.latitude,s,t,o)};var Dr=sN;var zee={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};zee.NUMBER_OF_CLASSIFICATION_TYPES=3;var kn=Object.freeze(zee);var zRe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},vc=Object.freeze(zRe);function HRe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var aN=HRe;function lp(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=GRe(t),o=e.floatingPointTexture,r=i===Ke.FLOAT&&!o,s=WRe(t,r),a=jRe(s,t,r),c=Math.floor(Bt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,h=Math.ceil(n/u),p=1/f,_=p*.5,m=1/h,x=m*.5;this._textureDimensions=new U(f,h),this._textureStep=new oe(p,_,m,x),this._pixelDatatype=r?Ke.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let b=4*f*h;this._batchValues=i===Ke.FLOAT&&!r?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(lp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function GRe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==X.UNSIGNED_BYTE){t=!0;break}return t?Ke.FLOAT:Ke.UNSIGNED_BYTE}function Gee(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?d:n===4?oe:Number}function WRe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==X.UNSIGNED_BYTE&&t?i+=4:++i}return n}function jRe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==X.UNSIGNED_BYTE&&n?o+4:o+1}var fv=new oe;function qRe(e,t,n){let i=oe.unpack(e,t,fv),o=oe.unpackFloat(i);i=oe.unpack(e,t+4,fv);let r=oe.unpackFloat(i);i=oe.unpack(e,t+8,fv);let s=oe.unpackFloat(i);i=oe.unpack(e,t+12,fv);let a=oe.unpackFloat(i);return oe.fromElements(o,r,s,a,n)}function YRe(e,t,n){let i=oe.packFloat(e.x,fv);oe.pack(i,t,n),i=oe.packFloat(e.y,i),oe.pack(i,t,n+4),i=oe.packFloat(e.z,i),oe.pack(i,t,n+8),i=oe.packFloat(e.w,i),oe.pack(i,t,n+12)}var Hee=new oe;lp.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Ke.UNSIGNED_BYTE?a=qRe(this._batchValues,s,Hee):a=oe.unpack(this._batchValues,s,Hee);let c=Gee(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var XRe=[void 0,void 0,new U,new d,new oe],KRe=new oe;lp.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=XRe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Gee(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=KRe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],h=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Ke.UNSIGNED_BYTE?YRe(c,this._batchValues,h):oe.pack(c,this._batchValues,h),this._batchValuesDirty=!0};function ZRe(e,t){let n=e._textureDimensions;e._texture=new Ot({context:t,pixelFormat:tt.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:$t.NEAREST,flipY:!1})}function $Re(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}lp.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||ZRe(this,e.context),$Re(this))};lp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:bt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function QRe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float numberOfAttributes = float(${t}); - return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); -} -`:`uniform vec4 batchTextureStep; -uniform vec2 batchTextureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float stepY = batchTextureStep.z; - float centerY = batchTextureStep.w; - float numberOfAttributes = float(${t}); - float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); - float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}function JRe(e){return e===1?"float":`vec${e}`}function eOe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function tOe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=JRe(o),a=eOe(o),c=e._offsets[t],u=`${s} ${r}(float batchId) -{ - vec2 st = computeSt(batchId); - st.x += batchTextureStep.x * float(${c}); -`;return e._packFloats&&i.componentDatatype!==Ke.UNSIGNED_BYTE?u+=`vec4 textureValue; -textureValue.x = czm_unpackFloat(texture(batchTexture, st)); -textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); -textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); -textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); -`:u+=` vec4 textureValue = texture(batchTexture, st); -`,u+=` ${s} value = textureValue${a}; -`,e._pixelDatatype===Ke.UNSIGNED_BYTE&&i.componentDatatype===X.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; -`:e._pixelDatatype===Ke.FLOAT&&i.componentDatatype===X.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; -`),u+=` return value; -} -`,u}lp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${QRe(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=tOe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r} -${t} -${s}`}};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var LT=lp;function hl(e){this._ellipsoid=y(e,ee.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(hl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});hl.mercatorAngleToGeodeticLatitude=function(e){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};hl.geodeticLatitudeToMercatorAngle=function(e){e>hl.MaximumLatitude?e=hl.MaximumLatitude:e<-hl.MaximumLatitude&&(e=-hl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};hl.MaximumLatitude=hl.mercatorAngleToGeodeticLatitude(Math.PI);hl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=hl.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};hl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=hl.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new fe(i,o,r)};var Oi=hl;function nOe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!F.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Nn.transformToWorldCoordinates(e[r]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function C6(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function iOe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?C6(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(C6(i.westHemisphereGeometry,n),C6(i.eastHemisphereGeometry,n))}}function oOe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,h=t.length;for(c=0;c<h;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(nOe(t,a,o),!o)for(c=0;c<h;++c)l(t[c].geometry)&&Nn.splitLongitude(t[c]);if(iOe(t),r)for(c=0;c<h;++c){let _=t[c];l(_.geometry)?(Nn.reorderForPostVertexCache(_.geometry),Nn.reorderForPreVertexCache(_.geometry)):l(_.westHemisphereGeometry)&&l(_.eastHemisphereGeometry)&&(Nn.reorderForPostVertexCache(_.westHemisphereGeometry),Nn.reorderForPreVertexCache(_.westHemisphereGeometry),Nn.reorderForPostVertexCache(_.eastHemisphereGeometry),Nn.reorderForPreVertexCache(_.eastHemisphereGeometry))}let p=Nn.combineInstances(t);for(h=p.length,c=0;c<h;++c){u=p[c];let _=u.attributes;if(o)for(let m in _)_.hasOwnProperty(m)&&_[m].componentDatatype===X.DOUBLE&&Nn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in _)if(_.hasOwnProperty(m)&&_[m].componentDatatype===X.DOUBLE){let x=`${m}3D`,b=`${m}2D`;Nn.projectTo2D(u,m,x,b,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ae.fromVertices(u.attributes.position2D.values)),Nn.encodeAttribute(u,x,`${x}High`,`${x}Low`),Nn.encodeAttribute(u,b,`${b}High`,`${b}Low`)}s&&Nn.compressVertices(u)}if(!i){let _=[];for(h=p.length,c=0;c<h;++c)u=p[c],_=_.concat(Nn.fitToUnsignedShortIndices(u));p=_}return p}function A6(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let h=e[u][t];if(!l(h))continue;let p=h.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function rOe(e,t){let n=[];return A6(e,"geometry",t,n),A6(e,"westHemisphereGeometry",t,n),A6(e,"eastHemisphereGeometry",t,n),n}var up={};up.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=oOe(e),t.length>0&&(n=Nn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=rOe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let h=i[f],p=h.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=h.geometry.offsetAttribute));let _=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;l(_)&&l(m)&&(l(_.boundingSphere)&&l(m.boundingSphere)&&(c[f]=ae.union(_.boundingSphere,m.boundingSphere)),l(_.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ae.union(_.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function sOe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function aOe(e,t){let n=e.length;for(let i=0;i<n;++i)sOe(e[i],t)}function cOe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*ae.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}up.packCreateGeometryResults=function(e,t){let n=new Float64Array(cOe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ae.pack(c.boundingSphere,n,s),s+=ae.packedLength;let h=l(c.boundingSphereCV)?1:0;n[s++]=h,h&&ae.pack(c.boundingSphereCV,n,s),s+=ae.packedLength;let p=c.attributes,_=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(_.push(x),l(o[x])||(o[x]=i.length,i.push(x)));n[s++]=_.length;for(let x=0;x<_.length;x++){let b=_[x],T=p[b];n[s++]=o[b],n[s++]=T.componentDatatype,n[s++]=T.componentsPerAttribute,n[s++]=T.normalize?1:0,n[s++]=T.values.length,n.set(T.values,s),s+=T.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};up.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let h,p;n[s++]===1&&(h=ae.unpack(n,s)),s+=ae.packedLength,n[s++]===1&&(p=ae.unpack(n,s)),s+=ae.packedLength;let x,b,T,C=new hn,A=n[s++];for(i=0;i<A;i++){let v=t[n[s++]],D=n[s++];T=n[s++];let O=n[s++]!==0;x=n[s++],b=X.createTypedArray(D,x);for(let R=0;R<x;R++)b[R]=n[s++];C[v]=new ve({componentDatatype:D,componentsPerAttribute:T,normalize:O,values:b})}let S;if(x=n[s++],x>0){let v=b.length/T;for(S=Ne.createTypedArray(v,x),i=0;i<x;i++)S[i]=n[s++]}o[r++]=new at({primitiveType:c,geometryType:u,boundingSphere:h,boundingSphereCV:p,indices:S,attributes:C,offsetAttribute:f})}return o};function lOe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(F.pack(s.modelMatrix,i,o),o+=F.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function uOe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=F.unpack(t,o),s;o+=F.packedLength,l(t[o])&&(s={offset:new Qi(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}up.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:lOe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Ii,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};up.unpackCombineGeometryParameters=function(e){let t=uOe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=up.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let h=c[f],p=t[o];p.geometry=h,++o}}let r=ee.clone(e.ellipsoid),s=e.isGeographic?new Ii(r):new Oi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Wee(e){let t=e.length,n=1+(ae.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,ae.pack(e[r],i,o)):i[o++]=0,o+=ae.packedLength}return i}function jee(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ae.unpack(e,i)),++n,i+=ae.packedLength;return t}up.packCombineGeometryResults=function(e,t){l(e.geometries)&&aOe(e.geometries,t);let n=Wee(e.boundingSpheres),i=Wee(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};up.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:jee(e.boundingSpheres),boundingSpheresCV:jee(e.boundingSpheresCV)}};var NT=up;var fOe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Ir=Object.freeze(fOe);var Kl={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Kl.NUMBER_OF_SHADOW_MODES=4;Kl.castShadows=function(e){return e===Kl.ENABLED||e===Kl.CAST_ONLY};Kl.receiveShadows=function(e){return e===Kl.ENABLED||e===Kl.RECEIVE_ONLY};Kl.fromCastReceive=function(e,t){return e&&t?Kl.ENABLED:e?Kl.CAST_ONLY:t?Kl.RECEIVE_ONLY:Kl.DISABLED};var xn=Object.freeze(Kl);function hr(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,xn.DISABLED),this._translucent=void 0,this._state=Ir.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(hr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function dOe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var hOe=new U,mOe=new d,ete=new oe;function tte(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,hOe);if(t===3)return d.unpack(e,0,mOe);if(t===4)return oe.unpack(e,0,ete)}function pOe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=dOe(i),s=r.length,a=[],c={},u={},f,p=i[0].attributes,_,m,x;for(_=0;_<s;++_)m=r[_],x=p[m],c[m]=_,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:X.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:X.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let b=a.length,T=new LT(t,a,o);for(_=0;_<o;++_){let C=i[_];p=C.attributes;for(let O=0;O<s;++O){m=r[O],x=p[m];let R=tte(x.value),M=c[m];T.setBatchedAttribute(_,M,R)}let A={primitive:y(C.pickPrimitive,e)};l(C.id)&&(A.id=C.id);let S=t.createPickId(A);e._pickIds.push(S);let v=S.color,D=ete;D.x=z.floatToByte(v.red),D.y=z.floatToByte(v.green),D.z=z.floatToByte(v.blue),D.w=z.floatToByte(v.alpha),T.setBatchedAttribute(_,b-1,D)}e._batchTable=T,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function gOe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new ve({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function _Oe(e){let t=e.attributes,n=new hn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=gOe(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new at({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ae.clone(e.boundingSphere)})}function yOe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var xOe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;hr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=xOe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c}; -`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView; -`,r+=`in vec4 position; -`,s+=`${c} -{ - return u_modifiedModelView * position; -} - -`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} -{ - return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); -} - -`:(r+=`in vec3 ${a}2DHigh; -in vec3 ${a}2DLow; -`,s+=`${c} -{ - vec4 p; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), - czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), - czm_morphTime); - } - return p; -} - -`)}return[o,r,t,s].join(` -`)};hr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Ue.replaceMain(t,"czm_non_show_main")} -void main() -{ - czm_non_show_main(); - gl_Position *= czm_batchTable_show(batchId); -}`:t};hr._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function qee(e){return`${Ue.replaceMain(e,"czm_non_pick_main")} -out vec4 v_pickColor; -void main() -{ - czm_non_pick_main(); - v_pickColor = czm_batchTable_pickColor(batchId); -}`}function Yee(e){return`in vec4 v_pickColor; -${e}`}hr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};hr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; -`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition(); -`;return o+=` if (czm_sceneMode == czm_sceneMode3D) -`,o+=` { -`,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` } -`,o+=` else -`,o+=` { -`,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` } -`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};hr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Ue.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() -{ - czm_non_distanceDisplayCondition_main(); - vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); - vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); - vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); - float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); -`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); -`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); - vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); - vec4 centerRTE; - if (czm_morphTime == 1.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); - } - else if (czm_morphTime == 0.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); - } - else - { - centerRTE = czm_columbusViewMorph( - czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), - czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), - czm_morphTime); - } -`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; - float distanceSq; - if (czm_sceneMode == czm_sceneMode2D) - { - distanceSq = czm_eyeHeight2D.y - radiusSq; - } - else - { - distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; - } - distanceSq = max(distanceSq, 0.0); - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${o}`};function Xee(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",h="";if(i){f+=`vec2 st; -`;let m=s>1?`${c}.x`:c;h+=` st = czm_decompressTextureCoordinates(${m}); -`}n&&o&&r?(f+=`vec3 normal; -vec3 tangent; -vec3 bitangent; -`,h+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(f+=`vec3 normal; -`,h+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); -`),o&&(f+=`vec3 tangent; -`,h+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`),r&&(f+=`vec3 bitangent; -`,h+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=Ue.replaceMain(p,"czm_non_compressed_main");let _=`void main() -{ -${h} czm_non_compressed_main(); -}`;return[u,f,p,_].join(` -`)}function bOe(e){let t=Ue.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - gl_Position = czm_depthClamp(gl_Position);} -`,t}function TOe(e){let t=Ue.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { - czm_non_depth_clamp_main(); - #if defined(LOG_DEPTH) - czm_writeLogDepth(); - #else - czm_writeDepthClamp(); - #endif -} -`,t}function Kee(e,t){let n=e.vertexAttributes}function COe(e,t){return function(){return e[t]}}var E6=Math.max(Ht.hardwareConcurrency-1,1),cN,AOe=new _i("combineGeometry");function EOe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Ir.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(cN))for(cN=new Array(E6),o=0;o<E6;o++)cN[o]=new _i("createGeometry");let f;for(u=aN(u,E6),o=0;o<u.length;o++){let h=0,p=u[o],_=p.length;for(r=0;r<_;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=h,h+=y(i.constructor.packedLength,i.packedLength));let m;if(h>0){let x=new Float64Array(h);for(m=[x.buffer],r=0;r<_;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,f.offset),f.geometry=x)}c.push(cN[o].scheduleTask({subTasks:u[o]},m))}e._state=Ir.CREATING,Promise.all(c).then(function(h){e._createGeometryResults=h,e._state=Ir.CREATED}).catch(function(h){hv(e,t,Ir.FAILED,h)})}else if(e._state===Ir.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=AOe.scheduleTask(NT.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Ir.COMBINING,Promise.resolve(f).then(function(h){let p=NT.unpackCombineGeometryResults(h);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Ir.COMBINED):hv(e,t,Ir.FAILED,void 0)}).catch(function(h){hv(e,t,Ir.FAILED,h)})}}function SOe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,_;l(p.attributes)&&l(p.primitiveType)?_=_Oe(p):_=p.constructor.createGeometry(p),o[c++]=yOe(s,_),r.push(s.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,h=NT.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=F.clone(h.modelMatrix,e.modelMatrix),e._pickOffsets=h.pickOffsets,e._offsetInstanceExtend=h.offsetInstanceExtend,e._instanceBoundingSpheres=h.boundingSpheres,e._instanceBoundingSpheresCV=h.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Ir.COMBINED):hv(e,t,Ir.FAILED,void 0)}function vOe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ae;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],b=e._batchTable.getBatchedAttribute(i,n,new d);x=r[i].clone(x),rte(x,b,o[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||ae.intersectPlane(x,an.ORIGIN_ZX_PLANE)!==jt.INTERSECTING?c.push(x):(u.push(x),f.push(x))}let h=c[0],p=f[0],_=u[0];for(i=1;i<c.length;i++)h=ae.union(h,c[i]);for(i=1;i<f.length;i++)p=ae.union(p,f[i]);for(i=1;i<u.length;i++)_=ae.union(_,u[i]);let m=[];for(l(h)&&m.push(h),l(p)&&m.push(p),l(_)&&m.push(_),i=0;i<m.length;i++){let x=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=ae.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}hr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Zee=new Hn,nte=new fe,ite=new d,ote=new ae;function wOe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,h=e._batchTable,p=e._instanceBoundingSpheres,_=p.length;for(let m=0;m<_;++m){let x=p[m];if(!l(x))continue;let b=e.modelMatrix;l(b)&&(x=ae.transform(x,b,ote));let T=x.center,C=x.radius,A=Hn.fromCartesian(T,Zee);if(h.setBatchedAttribute(m,o,A.high),h.setBatchedAttribute(m,r,A.low),!t.scene3DOnly){let S=f.cartesianToCartographic(T,nte),v=u.project(S,ite);A=Hn.fromCartesian(v,Zee),h.setBatchedAttribute(m,s,A.high),h.setBatchedAttribute(m,a,A.low)}h.setBatchedAttribute(m,c,C)}e._batchTableBoundingSpheresUpdated=!0}var S6=new d,DOe=new d;function $ee(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let h=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(d.equals(h,d.ZERO)){s.setBatchedAttribute(u,i,d.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ae.transform(f,p,ote));let _=f.center;_=r.scaleToGeodeticSurface(_,DOe);let m=r.cartesianToCartographic(_,nte),x=o.project(m,ite),b=d.add(h,_,S6);m=r.cartesianToCartographic(b,m);let T=o.project(m,S6),C=d.subtract(T,x,S6),A=C.x;C.x=C.z,C.z=C.y,C.y=A,s.setBatchedAttribute(u,i,C)}e._batchTableOffsetsUpdated=!0}function IOe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(ti.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Fe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ae.clone(u.boundingSphere)),e._boundingSphereWC.push(new ae),!o){let f=u.boundingSphereCV.center,h=f.x,p=f.y,_=f.z;f.x=_,f.y=h,f.z=p,e._boundingSphereCV.push(ae.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ae),e._boundingSphereMorph.push(new ae)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,hv(e,t,Ir.COMPLETE,void 0)}function POe(e,t,n,i){let o=n.getRenderState(),r;i?(r=Ge(o,!1),r.cull={enabled:!0,face:xi.BACK},e._frontFaceRS=Ve.fromCache(r),r.cull.face=xi.FRONT,e._backFaceRS=Ve.fromCache(r)):(e._frontFaceRS=Ve.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Ge(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Ge(o,!1),r.depthTest.func=vc.GREATER,i?(r.cull={enabled:!0,face:xi.BACK},e._frontFaceDepthFailRS=Ve.fromCache(r),r.cull.face=xi.FRONT,e._backFaceDepthFailRS=Ve.fromCache(r)):(e._frontFaceDepthFailRS=Ve.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function ROe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=hr._appendOffsetToShader(e,r),r=hr._appendShowToShader(e,r),r=hr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=qee(r),r=hr._updateColorAttribute(e,r,!1),r=Xee(e,r),r=hr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Yee(s),e._sp=en.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Kee(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=hr._appendShowToShader(e,r),r=hr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=qee(r),r=hr._updateColorAttribute(e,r,!0),r=Xee(e,r),r=hr._modifyShaderPosition(e,r,t.scene3DOnly),r=bOe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=Yee(s),s=TOe(s),e._spDepthFail=en.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Kee(e._spDepthFail,o))}var dv=new F,Qee=new d;function Jee(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=COe(s,c));let a=bt(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return F.multiply(c,e._modelMatrix,dv),F.multiplyByPoint(dv,e.rtcCenter,Qee),F.setTranslation(dv,Qee,dv),dv}),a}function OOe(e,t,n,i,o,r,s,a){let c=Jee(e,t,n,a),u;l(e._depthFailAppearance)&&(u=Jee(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?we.TRANSLUCENT:we.OPAQUE,h=o?2:1;h*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let p=r.length,_=0;for(let m=0;m<p;++m){let x;o&&(x=r[m],l(x)||(x=r[m]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[_],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,++m),x=r[m],l(x)||(x=r[m]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[_],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=f,l(e._depthFailAppearance)&&(o&&(++m,x=r[m],l(x)||(x=r[m]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[_],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++m,x=r[m],l(x)||(x=r[m]=new $e({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[_],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=u,x.pass=f),++_}}hr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!F.equals(n,e._modelMatrix))for(F.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=ae.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ae.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=ae.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function MOe(e,t,n,i,o,r,s,a){hr._updateBoundingVolumes(e,t,o);let c;t.mode===ne.SCENE3D?c=e._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ne.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let h=e.allowPicking,p=xn.castShadows(e.shadows),_=xn.receiveShadows(e.shadows),m=n.length,x=a?2:1;x*=l(e._depthFailAppearance)?2:1;for(let b=0;b<m;++b){let T=Math.floor(b/x),C=n[b];C.modelMatrix=o,C.boundingVolume=c[T],C.cull=r,C.debugShowBoundingVolume=s,C.castShadows=p,C.receiveShadows=_,h?C.pickId="v_pickColor":C.pickId=void 0,u.push(C)}}}hr.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==ne.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Ir.FAILED)return;let t=e.context;if(l(this._batchTable)||pOe(this,t),this._batchTable.attributes.length>0){if(Bt.maximumVertexTextureImageUnits===0)throw new re("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Ir.COMPLETE&&this._state!==Ir.COMBINED&&(this.asynchronous?EOe(this,e):SOe(this,e)),this._state===Ir.COMBINED&&(wOe(this,e),$ee(this,e),IOe(this,e)),!this.show||this._state!==Ir.COMPLETE)return;this._batchTableOffsetsUpdated||$ee(this,e),this._recomputeBoundingSpheres&&vOe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&y(this._createRenderStatesFunction,POe)(this,t,n,u),r&&y(this._createShaderProgramFunction,ROe)(this,e,n),(o||r)&&y(this._createCommandsFunction,OOe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,MOe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var LOe=new ae,NOe=new ae;function rte(e,t,n){if(n===sn.TOP){let i=ae.clone(e,LOe),o=ae.clone(e,NOe);o.center=d.add(o.center,t,o.center),e=ae.union(i,o,e)}else n===sn.ALL&&(e.center=d.add(e.center,t,e.center));return e}function FOe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=X.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function BOe(e,t,n,i,o){return function(r){let s=tte(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var kOe=new d;function VOe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&rte(i,d.fromArray(r.get(),0,kOe),e._offsetInstanceExtend[n]),l(o)&&(i=ae.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function UOe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}hr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:FOe(s,n,f),set:BOe(s,n,f,this,u)}}return VOe(this,c,n),UOe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};hr.prototype.isDestroyed=function(){return!1};hr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,ue(this)};function hv(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Ir.COMPLETE||e._state===Ir.FAILED})}var In=hr;function zOe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var wc=zOe;function nf(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new v6;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new v6;if(o.requiresTextureCoordinates=e,n instanceof cn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource} -${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}nf.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof cn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof cn||(o=t.material.shaderSource),new Ue({defines:i,sources:[o,nv]})};nf.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Ue({defines:n,sources:[nv],pickColorQualifier:"in"})};nf.prototype.createVertexShader=function(e,t,n,i){return hte(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};nf.prototype.createPickVertexShader=function(e,t,n,i){return hte(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var ste=new d,ate=new fe,cte={high:0,low:0};function hte(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=ate;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,ste),h=Hn.encode(f.x,cte);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`;let p=ate;p.longitude=-P.PI,p.latitude=0,p.height=0;let _=s.project(p,ste);h=Hn.encode(_.x,cte),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof cn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ue({defines:c,sources:[o]})}function v6(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(v6.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function lte(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/U.distance(t,e)}var HOe=[new U,new U,new U,new U];function mte(e,t){let n=HOe,i=U.unpack(t,0,n[0]),o=U.unpack(t,2,n[1]),r=U.unpack(t,4,n[2]);e.uMaxVmax=new wc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/lte(i,o,r),a=1/lte(i,r,o);e.uvMinAndExtents=new wc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var pte=new fe,gte=new d,GOe=new d,WOe=new d,lN={high:0,low:0};function _te(e,t,n){let i=pte;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,gte);i.latitude=e.north;let r=t.project(i,GOe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,WOe),a=[0,0,0,0],c=[0,0,0,0],u=Hn.encode(o.x,lN);a[0]=u.high,c[0]=u.low,u=Hn.encode(o.y,lN),a[1]=u.high,c[1]=u.low,u=Hn.encode(r.y,lN),a[2]=u.high,c[2]=u.low,u=Hn.encode(s.x,lN),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new wc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new wc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var jOe=new F,qOe=new F,ute=new d,YOe=new fe,XOe=[new fe,new fe,new fe,new fe,new fe,new fe,new fe,new fe];function KOe(e,t,n,i,o,r){let s=se.center(e,YOe);s.height=n;let a=fe.toCartesian(s,t,ute),c=Mt.eastNorthUpToFixedFrame(a,t,jOe),u=F.inverse(c,qOe),f=e.west,h=e.east,p=e.north,_=e.south,m=XOe;m[0].latitude=_,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=h,m[3].latitude=_,m[3].longitude=h;let x=(f+h)*.5,b=(p+_)*.5;m[4].latitude=_,m[4].longitude=x,m[5].latitude=p,m[5].longitude=x,m[6].latitude=b,m[6].longitude=f,m[7].latitude=b,m[7].longitude=h;let T=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let M=fe.toCartesian(m[R],t,ute);F.multiplyByPoint(u,M,M),M.z=0,T=Math.min(T,M.x),C=Math.max(C,M.x),A=Math.min(A,M.y),S=Math.max(S,M.y)}let v=i;v.x=T,v.y=A,v.z=0,F.multiplyByPoint(c,v,v);let D=o;D.x=C,D.y=A,D.z=0,F.multiplyByPoint(c,D,D),d.subtract(D,v,o);let O=r;O.x=T,O.y=S,O.z=0,F.multiplyByPoint(c,O,O),d.subtract(O,v,r)}var ZOe=new d,$Oe=new d,QOe=new Hn;nf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=gte,s=ZOe,a=$Oe;KOe(e,n,y(o,0),r,s,a);let c={};mte(c,t);let u=Hn.fromCartesian(r,QOe);return c.southWest_HIGH=new wc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.high,[0,0,0])}),c.southWest_LOW=new wc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.low,[0,0,0])}),c.eastward=new wc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(s,[0,0,0])}),c.northward=new wc({componentDatatype:X.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(a,[0,0,0])}),_te(e,i,c),c};var JOe=new d;function fte(e,t,n,i){let o=pte;o.latitude=e,o.longitude=t,o.height=0;let r=fe.toCartesian(o,n,JOe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=P.fastApproximateAtan2(s,r.z),c=P.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var dte=new U;nf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=fte(e.south,e.west,n,dte),r=o.x,s=o.y,a=fte(e.north,e.east,n,dte),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),r-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let h=1/(u-s),p=1/(c-r),_={sphericalExtents:new wc({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new wc({componentDatatype:X.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return mte(_,t),_te(e,i,_),_};nf.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};nf.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function eMe(e){return Math.max(e.width,e.height)>nf.MAX_WIDTH_FOR_PLANAR_EXTENTS}nf.shouldUseSphericalCoordinates=function(e){return eMe(e)};nf.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var of=nf;var tMe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS},Vn=Object.freeze(tMe);var nMe={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP},dt=Object.freeze(nMe);var uN={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};uN.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Vn.ALWAYS,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.REPLACE},backFunction:Vn.ALWAYS,backOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.REPLACE},reference:uN.CESIUM_3D_TILE_MASK,mask:uN.CESIUM_3D_TILE_MASK}};var Ut=Object.freeze(uN);function W0(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(W0.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});W0.isSupported=function(e){return e.context.stencilBuffer};function FT(e,t){let n=t?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:dt.KEEP,zFail:dt.DECREMENT_WRAP,zPass:dt.KEEP},backFunction:n,backOperation:{fail:dt.KEEP,zFail:dt.INCREMENT_WRAP,zPass:dt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:vc.LESS_OR_EQUAL},depthMask:!1}}function D6(e){return{stencilTest:{enabled:e,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var iMe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function oMe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(FT(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(FT(o,!0)),e._rsColorPass=Ve.fromCache(D6(o,!1)),e._rsPickPass=Ve.fromCache(iMe)}function rMe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; -`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Ue.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${r} czm_non_compressed_main(); -}`;return[i,o,s,a].join(` -`)}}function sMe(e,t){let n=t.context,i=e._primitive,o=gL;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=rMe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ue({defines:[a],sources:[o]}),u=new Ue({sources:[V0]}),f=e._primitive._attributeLocations,h=new of(s,r,e.appearance);if(e._spStencil=en.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Ue.createPickVertexShaderSource(o);m=In._appendShowToShader(i,m),m=In._updatePickColorAttribute(m);let x=h.createPickFragmentShader(!1),b=h.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=en.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f}),s){let T=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(T)){let C=h.createPickFragmentShader(!0),A=h.createPickVertexShader([a],m,!0,t.mapProjection);T=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:A,fragmentShaderSource:C,attributeLocations:f})}e._spPick2D=T}}else e._spPick=en.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=In._appendShowToShader(i,o),c=new Ue({defines:[a],sources:[o]}),e._sp=en.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=h.createFragmentShader(!1),_=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=en.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:_,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let x=h.createFragmentShader(!0),b=h.createVertexShader([a],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:f})}e._spColor2D=m}}function aMe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let _=n._va[a++];r=t[o],l(r)||(r=t[o]=new $e({owner:e,primitiveType:n._primitiveType})),r.vertexArray=_,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=we.TERRAIN_CLASSIFICATION,s=$e.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=we.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new $e({owner:e,primitiveType:n._primitiveType})),r.vertexArray=_,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=we.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=bt(c,x._uniforms)),r.uniformMap=c,s=$e.shallowClone(r,r.derivedCommands.tileset),s.pass=we.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let b=$e.shallowClone(r,r.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=b,b=$e.shallowClone(s,s.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b}}let f=e._commandsIgnoreShow,h=e._spStencil,p=0;i=f.length=i/2;for(let _=0;_<i;++_){let m=f[_]=$e.shallowClone(t[p],f[_]);m.shaderProgram=h,m.pass=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function cMe(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,u,f,h=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),_=e._needs2DShader;for(c=0;c<o;c+=2){let m=i._va[h++];if(n&&(a=r[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=we.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=$e.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=we.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=we.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=$e.shallowClone(u,u.derivedCommands.tileset),f.pass=we.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,_){let x=$e.shallowClone(u,u.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x,x=$e.shallowClone(f,f.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=x}}}function lMe(e,t,n,i,o,r,s){aMe(e,r),cMe(e,s)}function yte(e,t){return Math.floor(e%t/2)}function w6(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function xte(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function uMe(e,t,n,i,o,r,s,a){let c=e._primitive;In._updateBoundingVolumes(c,t,o);let u;t.mode===ne.SCENE3D?u=c._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===ne.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,h=f!==kn.CESIUM_3D_TILE,p=f!==kn.TERRAIN,_=t.passes,m,x,b;if(_.render){let T=n.length;for(m=0;m<T;++m)x=u[yte(m,T)],h&&(b=n[m],w6(b,t,o,r,x,s)),p&&(b=n[m].derivedCommands.tileset,w6(b,t,o,r,x,s));if(t.invertClassification){let C=e._commandsIgnoreShow,A=C.length;for(m=0;m<A;++m)x=u[m],b=C[m],w6(b,t,o,r,x,s)}}if(_.pick){let T=i.length,C=c._pickOffsets;for(m=0;m<T;++m){let A=C[yte(m,T)];x=u[A.index],h&&(b=i[m],xte(b,t,o,r,x)),p&&(b=i[m].derivedCommands.tileset,xte(b,t,o,r,x))}}}W0.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,u=!1,f=!0,h,p=!1,_=!1;for(r>0&&(c=o[0].attributes,p=of.hasAttributesForSphericalExtents(c),_=of.hasAttributesForTextureCoordinatePlanes(c),h=c.color),s=0;s<r;s++){a=o[s];let x=a.attributes.color;l(x)&&(u=!0),f=f&&l(x)&&Wt.equals(h,x)}if(!f&&!p&&!_)throw new he("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new cn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!_,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=_,this._hasPerColorAttribute=u;let m=new Array(r);for(s=0;s<r;++s)a=o[s],m[s]=new wt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,b){n._createBoundingVolumeFunction(x,b)}),i._createRenderStatesFunction=function(x,b,T,C){oMe(n,b)},i._createShaderProgramFunction=function(x,b,T){sMe(n,b)},i._createCommandsFunction=function(x,b,T,C,A,S,v){lMe(n,void 0,void 0,!0,!1,S,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,b,T,C,A,S,v,D){n._updateAndQueueCommandsFunction(x,b,T,C,A,S,v,D)}:i._updateAndQueueCommandsFunction=function(x,b,T,C,A,S,v,D){uMe(n,b,T,C,A,S,v,D)},this._primitive=new In(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(FT(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(FT(!1,!0)),this._rsColorPass=Ve.fromCache(D6(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(FT(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(FT(!0,!0)),this._rsColorPass=Ve.fromCache(D6(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};W0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};W0.prototype.isDestroyed=function(){return!1};W0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var mv=W0;var fMe={u_globeMinimumAltitude:function(){return 55e3}};function ml(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(l(a)&&l(a.color)){t=new cn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=li._defaultMaxTerrainHeight,this._minTerrainHeight=li._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:fMe}}Object.defineProperties(ml.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});ml.isSupported=mv.isSupported;function bte(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Tte(e){return function(t,n){return e._minHeight}}var dMe=new d,hMe=new d,mMe=new d,pMe=new fe,gMe=new se;function fN(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let p=d.unpack(i,h,dMe),_=d.unpack(o,h,hMe),m=d.add(p,_,mMe),x=n.cartesianToCartographic(m,pMe),b=x.latitude,T=x.longitude;s=Math.min(s,b),a=Math.min(a,T),c=Math.max(c,b),u=Math.max(u,T)}let f=gMe;return f.north=c,f.south=s,f.east=u,f.west=a,f}function _Me(e,t,n){let i=li.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function yMe(e,t,n){let i=t.mapProjection.ellipsoid,o=fN(t,n),r=wn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=ae.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);d.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function I6(e,t){return Math.floor(e%t/2)}function P6(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Cte(e,t,n,i,o,r){let s=e._primitive;n.mode!==ne.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function xMe(e,t,n,i,o,r,s,a){let c;t.mode===ne.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==kn.CESIUM_3D_TILE,h=u!==kn.TERRAIN,p=t.passes,_=e._primitive,m,x,b;if(p.render){let T=n.length;for(m=0;m<T;++m)x=c[I6(m,T)],f&&(b=n[m],P6(e,b,t,o,r,x,s)),h&&(b=n[m].derivedCommands.tileset,P6(e,b,t,o,r,x,s));if(t.invertClassification){let C=_._commandsIgnoreShow,A=C.length;for(m=0;m<A;++m)x=c[m],b=C[m],P6(e,b,t,o,r,x,s)}}if(p.pick){let T=i.length,C;for(e._useFragmentCulling||(C=_._primitive._pickOffsets),m=0;m<T;++m){if(x=c[I6(m,T)],!e._useFragmentCulling){let A=C[I6(m,T)];x=c[A.index]}f&&(b=i[m],Cte(e,b,t,o,r,x)),h&&(b=i[m].derivedCommands.tileset,Cte(e,b,t,o,r,x))}}}ml.initializeTerrainHeights=function(){return li.initialize()};ml.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!li.initialized){ml.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,h;for(f=0;f<c;++f){o=a[f],r=o.geometry;let x=fN(e,r);l(h)?l(x)&&se.union(h,x,h):h=se.clone(x);let b=o.id;if(l(b)&&l(x)){let T=li.getBoundingSphere(x,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(T)}s=r.constructor,!l(s)||l(s.createShadowVolume)}_Me(this,h,i);let p=e.verticalExaggeration,_=e.verticalExaggerationRelativeHeight;this._minHeight=Dr.getHeight(this._minTerrainHeight,p,_),this._maxHeight=Dr.getHeight(this._maxTerrainHeight,p,_);let m=ml._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let x,b=!0;for(f=0;f<c;++f)if(o=a[f],r=o.geometry,h=fN(e,r),of.shouldUseSphericalCoordinates(h)){b=!1;break}for(f=0;f<c;++f){o=a[f],r=o.geometry,s=r.constructor;let T=fN(e,r),C=r.textureCoordinateRotationPoints;b?x=of.getPlanarTextureCoordinateAttributes(T,C,i,e.mapProjection,this._maxHeight):x=of.getSphericalExtentGeometryInstanceAttributes(T,C,i,e.mapProjection);let A=o.attributes;for(let S in A)A.hasOwnProperty(S)&&(x[S]=A[S]);u[f]=new wt({geometry:s.createShadowVolume(r,Tte(this),bte(this)),attributes:x,id:o.id})}}else for(f=0;f<c;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new wt({geometry:s.createShadowVolume(r,Tte(this),bte(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,b){yMe(t,x,b)},n._updateAndQueueCommandsFunction=function(x,b,T,C,A,S,v,D){xMe(t,b,T,C,A,S,v,D)},this._primitive=new mv(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};ml.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};ml.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};ml.prototype.isDestroyed=function(){return!1};ml.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};ml._supportsMaterials=function(e){return e.depthTexture};ml.supportsMaterials=function(e){return ml._supportsMaterials(e.frameState.context)};var pl=ml;function BT(){he.throwInstantiationError()}Object.defineProperties(BT.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError}});BT.prototype.getType=he.throwInstantiationError;BT.prototype.getValue=he.throwInstantiationError;BT.prototype.equals=he.throwInstantiationError;var bMe=new Z;BT.getValue=function(e,t,n){let i;return l(e)||(e=Z.now(bMe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Yi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Yi.ColorType)&&(n=Yi.fromType(Yi.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var ir=BT;function j0(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}j0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!q.getValueOrDefault(t.show,n,!0)};j0.prototype._setOptions=he.throwInstantiationError;j0.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof zt,h,p=t._getIsClosed(c);if(f)h=new cn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let _=ir.getValue(e,u,this._material);this._material=_,h=new so({material:_,translucent:_.isTranslucent(),closed:p})}if(n)c.vertexFormat=cn.VERTEX_FORMAT,this._primitive=o.add(new pl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),q.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=h.vertexFormat;let _=this._geometryUpdater.createFillGeometryInstance(e);f&&(h.translucent=_.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:_,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=q.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:u,appearance:new cn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};j0.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ct.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ae.clone(o.boundingSphere,e),ct.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ct.PENDING:ct.FAILED};j0.prototype.isDestroyed=function(){return!1};j0.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ni=j0;var TMe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Yg=Object.freeze(TMe);var CMe={NONE:0,GEODESIC:1,RHUMB:2},tn=Object.freeze(CMe);var Ate=P.EPSILON10;function AMe(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,u,f=0,h=-1;for(s=1;s<r;++s)c=e[s],t(a,c,Ate)?(l(u)||(u=e.slice(0,s),f=s-1,h=0),o&&i.push(s)):(l(u)&&(u.push(c),f=s,o&&(h=i.length)),a=c);return n&&t(e[0],e[r-1],Ate)&&(o&&(l(u)?i.splice(h,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var bo=AMe;function EMe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,r),h=c*s,p=h*h,_=1-p,m=Math.sqrt(_),x=t/4,b=x*x,T=b*x,C=b*b,A=1+x-3*b/4+5*T/4-175*C/64,S=1-x+15*b/8-35*T/8,v=1-3*x+35*b/4,D=1-5*x,O=A*f-S*Math.sin(2*f)*x/2-v*Math.sin(4*f)*b/16-D*Math.sin(6*f)*T/48-Math.sin(8*f)*5*C/512,R=e._constants;R.a=n,R.b=i,R.f=o,R.cosineHeading=r,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=h,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=_,R.cosineAlpha=m,R.u2Over4=x,R.u4Over16=b,R.u6Over64=T,R.u8Over256=C,R.a0=A,R.a1=S,R.a2=v,R.a3=D,R.distanceRatio=O}function SMe(e,t){return e*t*(4+e*(4-3*t))/16}function Ete(e,t,n,i,o,r,s){let a=SMe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function vMe(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),h=Math.cos(u),p=Math.sin(u),_=Math.cos(f),m=Math.sin(f),x=h*_,b=h*m,T=p*m,C=p*_,A=c,S=P.TWO_PI,v=Math.cos(A),D=Math.sin(A),O,R,M,L,g;do{v=Math.cos(A),D=Math.sin(A);let k=b-C*v;M=Math.sqrt(_*_*D*D+k*k),R=T+x*v,O=Math.atan2(M,R);let W;M===0?(W=0,L=1):(W=x*D/M,L=1-W*W),S=A,g=R-2*T/L,isFinite(g)||(g=0),A=c+Ete(a,W,L,O,M,R,g)}while(Math.abs(A-S)>P.EPSILON12);let E=L*(t*t-n*n)/(n*n),w=1+E*(4096+E*(E*(320-175*E)-768))/16384,I=E*(256+E*(E*(74-47*E)-128))/1024,N=g*g,B=I*M*(g+I*(R*(2*N-1)-I*g*(4*M*M-3)*(4*N-3)/6)/4),H=n*w*(O-B),V=Math.atan2(_*D,b-C*v),G=Math.atan2(h*D,b*v-C);e._distance=H,e._startHeading=V,e._endHeading=G,e._uSquared=E}var wMe=new d,R6=new d;function Ste(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,R6),wMe),r=d.normalize(i.cartographicToCartesian(n,R6),R6);vMe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=fe.clone(t,e._start),e._end=fe.clone(n,e._end),e._start.height=0,e._end.height=0,EMe(e)}function pv(e,t,n){let i=y(n,ee.default);this._ellipsoid=i,this._start=new fe,this._end=new fe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Ste(this,e,t,i)}Object.defineProperties(pv.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});pv.prototype.setEndPoints=function(e,t){Ste(this,e,t,this._ellipsoid)};pv.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};pv.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),h=i*i,p=i*h,_=n.u8Over256,m=n.u2Over4,x=n.u6Over64,b=n.u4Over16,T=2*p*_*o/3+i*(1-m+7*b/4-15*x/4+579*_/64-(b-15*x/4+187*_/16)*o-(5*x/4-115*_/16)*r-29*_*s/16)+(m/2-b+71*x/32-85*_/16)*a+(5*b/16-5*x/4+383*_/96)*c-h*((x-11*_/2)*a+5*_*c/2)+(29*x/96-29*_/16)*u+539*_*f/1536,C=Math.asin(Math.sin(T)*n.cosineAlpha),A=Math.atan(n.a/n.b*Math.tan(C));T=T-n.sigma;let S=Math.cos(2*n.sigma+T),v=Math.sin(T),D=Math.cos(T),O=n.cosineU*D,R=n.sineU*v,L=Math.atan2(v*n.sineHeading,O-R*n.cosineHeading)-Ete(n.f,n.sineAlpha,n.cosineSquaredAlpha,T,v,D,S);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=A,t.height=0,t):new fe(this._start.longitude+L,A,0)};var Xg=pv;function M6(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),h=Math.sin(4*u),p=Math.sin(6*u),_=Math.sin(8*u),m=Math.sin(10*u),x=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*_-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*x)}function DMe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,u=c*c,f=u*c,h=f*c,p=h*c,_=p*c,m=Math.sin(2*i),x=Math.cos(2*i),b=Math.sin(4*i),T=Math.cos(4*i),C=Math.sin(6*i),A=Math.cos(6*i),S=Math.sin(8*i),v=Math.cos(8*i),D=Math.sin(10*i),O=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*h/16384+1515*i*p/65536+16837*i*_/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*_/5242880)*x+(21*i*f/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*_/1048576)*T+(151*i*h/4096+4681*i*p/65536+1479*i*_/16384-453*r*_/32768)*A+(1097*i*p/65536+42783*i*_/1048576)*v+8011*i*_/1048576*O+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*h/4096-33*o*h/512+20861*p/524288-33*o*p/512+s*p/1024+28273*_/1048576-471*o*_/8192+9*s*_/4096)*m+(21*u/256+21*f/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*_/16777216-12517*o*_/131072+7*s*_/2048)*b+(151*f/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*_/786432-8607*o*_/131072)*C+(1097*h/131072+1097*p/65536+225797*_/10485760-1097*o*_/65536)*S+(8011*p/2621440+8011*_/1048576)*D+293393*_/251658240*R}function kT(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function IMe(e,t,n,i,o){let r=kT(e._ellipticity,n),s=kT(e._ellipticity,o);return Math.atan2(P.negativePiToPi(i-t),s-r)}function PMe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,u=0;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(o)*P.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=M6(e._ellipticity,t,o);u=(M6(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var RMe=new d,O6=new d;function vte(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,O6),RMe),r=d.normalize(i.cartographicToCartesian(n,O6),O6),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=fe.clone(t,e._start),e._start.height=0,e._end=fe.clone(n,e._end),e._end.height=0,e._heading=IMe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=PMe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function wte(e,t,n,i,o,r){if(n===0)return fe.clone(e,r);let s=o*o,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=M6(o,i,e.latitude),h=n*Math.cos(t),p=f+h;if(c=DMe(p,o,i),Math.abs(t)<P.EPSILON10)a=P.negativePiToPi(e.longitude);else{let _=kT(o,e.latitude),m=kT(o,c);u=Math.tan(t)*(m-_),a=P.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*h*h)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new fe(a,c,0)}function fp(e,t,n){let i=y(n,ee.default);this._ellipsoid=i,this._start=new fe,this._end=new fe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&vte(this,e,t,i)}Object.defineProperties(fp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});fp.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,ee.default),s=r.maximumRadius,a=r.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let h=wte(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new fp(e,h,r):(o.setEndPoints(e,h),o)};fp.prototype.setEndPoints=function(e,t){vte(this,e,t,this._ellipsoid)};fp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};fp.prototype.interpolateUsingSurfaceDistance=function(e,t){return wte(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};fp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(r.longitude)*Math.PI),l(t)||(t=new fe),Math.abs(P.PI_OVER_TWO-o)<=P.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-o),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,r.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,h;do{h=f;let p=n*Math.sin(h),_=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(_/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,h,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};fp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let r=kT(n,o.latitude),s=kT(n,e),a=Math.tan(i)*(s-r),c=P.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new fe(c,e,0)};var Ya=fp;var z6=[Ii,Oi],OMe=z6.length,Yte=Math.cos(P.toRadians(30)),Dte=Math.cos(P.toRadians(150)),Xte=0,Kte=1e3;function Zg(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,tn.GEODESIC),this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Zg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});Zg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<OMe;i++)if(t instanceof z6[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var MMe=new d,Ite=new d,Pte=new d;function U6(e,t,n,i,o){let r=Dc(i,e,0,MMe),s=Dc(i,e,n,Ite),a=Dc(i,t,0,Pte),c=dp(s,r,Ite),u=dp(a,r,Pte);return d.cross(u,c,o),d.normalize(o,o)}var LMe=new fe,NMe=new d,FMe=new d,BMe=new d;function L6(e,t,n,i,o,r,s,a,c,u,f){if(o===0)return;let h;r===tn.GEODESIC?h=new Xg(e,t,s):r===tn.RHUMB&&(h=new Ya(e,t,s));let p=h.surfaceDistance;if(p<o)return;let _=U6(e,t,i,s,BMe),m=Math.ceil(p/o),x=p/m,b=x,T=m-1,C=a.length;for(let A=0;A<T;A++){let S=h.interpolateUsingSurfaceDistance(b,LMe),v=Dc(s,S,n,NMe),D=Dc(s,S,i,FMe);d.pack(_,a,C),d.pack(v,c,C),d.pack(D,u,C),f.push(S.latitude),f.push(S.longitude),C+=3,b+=x}}var N6=new fe;function Dc(e,t,n,i){return fe.clone(t,N6),N6.height=n,fe.toCartesian(N6,e,i)}Zg.pack=function(e,t,n){let i=y(n,0),o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];d.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ee.pack(e._ellipsoid,t,i),i+=ee.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};Zg.unpack=function(e,t,n){let i=y(t,0),o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=d.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=ee.unpack(e,i);i+=ee.packedLength;let f=e[i++],h=e[i++]===1;return l(n)||(n=new Zg({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=h,n};function dp(e,t,n){return d.subtract(e,t,n),d.normalize(n,n),n}function Rte(e,t,n,i){return i=dp(e,t,i),i=d.cross(i,n,i),i=d.normalize(i,i),i=d.cross(n,i,i),i}var kMe=new d,VMe=new d,UMe=new d,Zte=new d,zMe=0,HMe=-1;function F6(e,t,n,i,o){let r=dp(n,t,Zte),s=Rte(e,t,r,kMe),a=Rte(i,t,r,VMe);if(P.equalsEpsilon(d.dot(s,a),HMe,P.EPSILON5))return o=d.cross(r,s,o),o=d.normalize(o,o),o;o=d.add(a,s,o),o=d.normalize(o,o);let c=d.cross(r,o,UMe);return d.dot(a,c)<zMe&&(o=d.negate(o,o)),o}var pN=an.fromPointNormal(d.ZERO,d.UNIT_Y),GMe=new d,WMe=new d,jMe=new d,qMe=new d,YMe=new d,dN=new d,hN=new fe,Ote=new fe,Mte=new fe;Zg.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new z6[e._projectionIndex](i),a=Xte,c=Kte,u,f,h=e._positions,p=h.length;p===2&&(n=!1);let _,m,x,b,T=new Ya(void 0,void 0,i),C,A,S,v=[h[0]];for(f=0;f<p-1;f++)_=h[f],m=h[f+1],C=Zn.lineSegmentPlane(_,m,pN,dN),l(C)&&!d.equalsEpsilon(C,_,P.EPSILON7)&&!d.equalsEpsilon(C,m,P.EPSILON7)&&(e.arcType===tn.GEODESIC?v.push(d.clone(C)):e.arcType===tn.RHUMB&&(S=i.cartesianToCartographic(C,hN).longitude,x=i.cartesianToCartographic(_,hN),b=i.cartesianToCartographic(m,Ote),T.setEndPoints(x,b),A=T.findIntersectionWithLongitude(S,Mte),C=i.cartographicToCartesian(A,dN),l(C)&&!d.equalsEpsilon(C,_,P.EPSILON7)&&!d.equalsEpsilon(C,m,P.EPSILON7)&&v.push(d.clone(C)))),v.push(m);n&&(_=h[p-1],m=h[0],C=Zn.lineSegmentPlane(_,m,pN,dN),l(C)&&!d.equalsEpsilon(C,_,P.EPSILON7)&&!d.equalsEpsilon(C,m,P.EPSILON7)&&(e.arcType===tn.GEODESIC?v.push(d.clone(C)):e.arcType===tn.RHUMB&&(S=i.cartesianToCartographic(C,hN).longitude,x=i.cartesianToCartographic(_,hN),b=i.cartesianToCartographic(m,Ote),T.setEndPoints(x,b),A=T.findIntersectionWithLongitude(S,Mte),C=i.cartographicToCartesian(A,dN),l(C)&&!d.equalsEpsilon(C,_,P.EPSILON7)&&!d.equalsEpsilon(C,m,P.EPSILON7)&&v.push(d.clone(C)))));let D=v.length,O=new Array(D);for(f=0;f<D;f++){let Y=fe.fromCartesian(v[f],i);Y.height=0,O[f]=Y}if(O=bo(O,fe.equalsEpsilon),D=O.length,D<2)return;let R=[],M=[],L=[],g=[],E=GMe,w=WMe,I=jMe,N=qMe,B=YMe,H=O[0],V=O[1],G=O[D-1];for(E=Dc(i,G,a,E),N=Dc(i,V,a,N),w=Dc(i,H,a,w),I=Dc(i,H,c,I),n?B=F6(E,w,I,N,B):B=U6(H,V,c,i,B),d.pack(B,M,0),d.pack(w,L,0),d.pack(I,g,0),R.push(H.latitude),R.push(H.longitude),L6(H,V,a,c,o,r,i,M,L,g,R),f=1;f<D-1;++f){E=d.clone(w,E),w=d.clone(N,w);let Y=O[f];Dc(i,Y,c,I),Dc(i,O[f+1],a,N),F6(E,w,I,N,B),u=M.length,d.pack(B,M,u),d.pack(w,L,u),d.pack(I,g,u),R.push(Y.latitude),R.push(Y.longitude),L6(O[f],O[f+1],a,c,o,r,i,M,L,g,R)}let k=O[D-1],W=O[D-2];if(w=Dc(i,k,a,w),I=Dc(i,k,c,I),n){let Y=O[0];E=Dc(i,W,a,E),N=Dc(i,Y,a,N),B=F6(E,w,I,N,B)}else B=U6(W,k,c,i,B);if(u=M.length,d.pack(B,M,u),d.pack(w,L,u),d.pack(I,g,u),R.push(k.latitude),R.push(k.longitude),n){for(L6(k,H,a,c,o,r,i,M,L,g,R),u=M.length,f=0;f<3;++f)M[u+f]=M[f],L[u+f]=L[f],g[u+f]=g[f];R.push(H.latitude),R.push(H.longitude)}return xLe(n,s,L,g,M,R,t)};var XMe=new d,KMe=new $,ZMe=new Oe;function Lte(e,t,n,i){let o=dp(n,t,XMe),r=d.dot(o,e);if(r>Yte||r<Dte){let s=dp(i,n,Zte),a=r<Dte?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Oe.fromAxisAngle(s,a,ZMe),u=$.fromQuaternion(c,KMe);return $.multiplyByVector(u,e,e),!0}return!1}var Nte=new fe,$Me=new d,Fte=new d;function gv(e,t,n,i,o){let r=fe.toCartesian(t,e._ellipsoid,$Me),s=d.add(r,n,Fte),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,Nte);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=d.subtract(r,n,Fte),u=c.cartesianToCartographic(s,Nte)),u.height=0;let f=e.project(u,o);return o=d.subtract(f,i,o),o.z=0,o=d.normalize(o,o),a&&d.negate(o,o),o}var QMe=new d,Bte=new d;function kte(e,t,n,i,o,r){let s=d.subtract(t,e,QMe);d.normalize(s,s);let a=n-Xte,c=d.multiplyByScalar(s,a,Bte);d.add(e,c,o);let u=i-Kte;c=d.multiplyByScalar(s,u,Bte),d.add(t,c,r)}var JMe=new d;function mN(e,t){let n=an.getPointDistance(pN,e),i=an.getPointDistance(pN,t),o=JMe;P.equalsEpsilon(n,0,P.EPSILON2)?(o=dp(t,e,o),d.multiplyByScalar(o,P.EPSILON2,o),d.add(e,o,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(o=dp(e,t,o),d.multiplyByScalar(o,P.EPSILON2,o),d.add(t,o,t))}function eLe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let o=P.sign(t.longitude);return e.longitude=o*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let o=P.sign(e.longitude);return t.longitude=o*(i-P.EPSILON11),2}return 0}var $te=new fe,Qte=new fe,Vte=new d,B6=new d,Ute=new d,zte=new d,tLe=new d,Hte=new d,nLe=[$te,Qte],iLe=new se,oLe=new d,rLe=new d,sLe=new d,aLe=new d,cLe=new d,lLe=new d,k6=new d,V6=new d,uLe=new d,fLe=new d,dLe=new d,Gte=new d,hLe=new d,mLe=new d,pLe=new Hn,gLe=new Hn,Wte=new d,_Le=new d,jte=new d,yLe=[new ae,new ae],Jte=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],qte=Jte.length;function xLe(e,t,n,i,o,r,s){let a,c,u=t._ellipsoid,f=n.length/3-1,h=f*8,p=h*4,_=f*36,m=h>65535?new Uint32Array(_):new Uint16Array(_),x=new Float64Array(h*3),b=new Float32Array(p),T=new Float32Array(p),C=new Float32Array(p),A=new Float32Array(p),S=new Float32Array(p),v,D,O,R;s&&(v=new Float32Array(p),D=new Float32Array(p),O=new Float32Array(p),R=new Float32Array(h*2));let M=r.length/2,L=0,g=$te;g.height=0;let E=Qte;E.height=0;let w=Vte,I=B6;if(s)for(c=0,a=1;a<M;a++)g.latitude=r[c],g.longitude=r[c+1],E.latitude=r[c+2],E.longitude=r[c+3],w=t.project(g,w),I=t.project(E,I),L+=d.distance(w,I),c+=2;let N=i.length/3;I=d.unpack(i,0,I);let B=0;for(c=3,a=1;a<N;a++)w=d.clone(I,w),I=d.unpack(i,c,I),B+=d.distance(w,I),c+=3;let H;c=3;let V=0,G=0,k=0,W=0,Y=!1,J=d.unpack(n,0,zte),j=d.unpack(i,0,B6),K=d.unpack(o,0,Hte);if(e){let Ae=d.unpack(n,n.length-6,Ute);Lte(K,Ae,J,j)&&(K=d.negate(K,K))}let Q=0,de=0,ye=0;for(a=0;a<f;a++){let Ae=d.clone(J,Ute),ke=d.clone(j,Vte),ze=d.clone(K,tLe);Y&&(ze=d.negate(ze,ze)),J=d.unpack(n,c,zte),j=d.unpack(i,c,B6),K=d.unpack(o,c,Hte),Y=Lte(K,Ae,J,j),g.latitude=r[V],g.longitude=r[V+1],E.latitude=r[V+2],E.longitude=r[V+3];let et,St,mt,Be;if(s){let ui=eLe(g,E);et=t.project(g,cLe),St=t.project(E,lLe);let Ys=dp(St,et,Wte);Ys.y=Math.abs(Ys.y),mt=k6,Be=V6,ui===0||d.dot(Ys,d.UNIT_Y)>Yte?(mt=gv(t,g,ze,et,k6),Be=gv(t,E,K,St,V6)):ui===1?(Be=gv(t,E,K,St,V6),mt.x=0,mt.y=P.sign(g.longitude-Math.abs(E.longitude)),mt.z=0):(mt=gv(t,g,ze,et,k6),Be.x=0,Be.y=P.sign(g.longitude-E.longitude),Be.z=0)}let Yt=d.distance(ke,j),Ct=Hn.fromCartesian(Ae,pLe),ut=d.subtract(J,Ae,uLe),Jt=d.normalize(ut,Gte),Ce=d.subtract(ke,Ae,fLe);Ce=d.normalize(Ce,Ce);let Te=d.cross(Jt,Ce,Gte);Te=d.normalize(Te,Te);let it=d.cross(Ce,ze,hLe);it=d.normalize(it,it);let Vi=d.subtract(j,J,dLe);Vi=d.normalize(Vi,Vi);let ft=d.cross(K,Vi,mLe);ft=d.normalize(ft,ft);let mo=Yt/B,Ho=Q/B,Ma=0,Cr,hs,Le,ot=0,je=0;if(s){Ma=d.distance(et,St),Cr=Hn.fromCartesian(et,gLe),hs=d.subtract(St,et,Wte),Le=d.normalize(hs,_Le);let ui=Le.x;Le.x=Le.y,Le.y=-ui,ot=Ma/L,je=de/L}for(H=0;H<8;H++){let ui=W+H*4,Ys=G+H*2,kr=ui+3,il=H<4?1:-1,po=H===2||H===3||H===6||H===7?1:-1;d.pack(Ct.high,b,ui),b[kr]=ut.x,d.pack(Ct.low,T,ui),T[kr]=ut.y,d.pack(it,C,ui),C[kr]=ut.z,d.pack(ft,A,ui),A[kr]=mo*il,d.pack(Te,S,ui);let Ar=Ho*po;Ar===0&&po<0&&(Ar=9),S[kr]=Ar,s&&(v[ui]=Cr.high.x,v[ui+1]=Cr.high.y,v[ui+2]=Cr.low.x,v[ui+3]=Cr.low.y,O[ui]=-mt.y,O[ui+1]=mt.x,O[ui+2]=Be.y,O[ui+3]=-Be.x,D[ui]=hs.x,D[ui+1]=hs.y,D[ui+2]=Le.x,D[ui+3]=Le.y,R[Ys]=ot*il,Ar=je*po,Ar===0&&po<0&&(Ar=9),R[Ys+1]=Ar)}let Xe=sLe,ht=aLe,Gt=oLe,_n=rLe,Eo=se.fromCartographicArray(nLe,iLe),yo=li.getMinimumMaximumHeights(Eo,u),La=yo.minimumTerrainHeight,Na=yo.maximumTerrainHeight;ye+=Math.abs(La),ye+=Math.abs(Na),kte(Ae,ke,La,Na,Xe,Gt),kte(J,j,La,Na,ht,_n);let gi=d.multiplyByScalar(Te,P.EPSILON5,jte);d.add(Xe,gi,Xe),d.add(ht,gi,ht),d.add(Gt,gi,Gt),d.add(_n,gi,_n),mN(Xe,ht),mN(Gt,_n),d.pack(Xe,x,k),d.pack(ht,x,k+3),d.pack(_n,x,k+6),d.pack(Gt,x,k+9),gi=d.multiplyByScalar(Te,-2*P.EPSILON5,jte),d.add(Xe,gi,Xe),d.add(ht,gi,ht),d.add(Gt,gi,Gt),d.add(_n,gi,_n),mN(Xe,ht),mN(Gt,_n),d.pack(Xe,x,k+12),d.pack(ht,x,k+15),d.pack(_n,x,k+18),d.pack(Gt,x,k+21),V+=2,c+=3,G+=16,k+=24,W+=32,Q+=Yt,de+=Ma}c=0;let ce=0;for(a=0;a<f;a++){for(H=0;H<qte;H++)m[c+H]=Jte[H]+ce;ce+=8,c+=qte}let ge=yLe;ae.fromVertices(n,d.ZERO,3,ge[0]),ae.fromVertices(i,d.ZERO,3,ge[1]);let xe=ae.fromBoundingSpheres(ge);xe.radius+=ye/(f*2);let De={position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:Kg(b),startLoAndForwardOffsetY:Kg(T),startNormalAndForwardOffsetZ:Kg(C),endNormalAndTextureCoordinateNormalizationX:Kg(A),rightNormalAndTextureCoordinateNormalizationY:Kg(S)};return s&&(De.startHiLo2D=Kg(v),De.offsetAndRight2D=Kg(D),De.startEndNormals2D=Kg(O),De.texcoordNormalization2D=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new at({attributes:De,indices:m,boundingSphere:xe})}function Kg(e){return new ve({componentDatatype:X.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Zg._projectNormal=gv;var VT=Zg;var gN=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec4 color; -in float batchId; - -out vec4 v_color; - -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; - - vec4 p = czm_computePosition(); - vec4 prev = czm_computePrevPosition(); - vec4 next = czm_computeNextPosition(); - - float angle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; - - v_color = color; -} -`;var H6=`${Ju} -${gN}`,bLe=OT;Ht.isInternetExplorer()||(H6=`#define CLIP_POLYLINE -${H6}`);function q0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=q0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,H6),this._fragmentShaderSource=y(e.fragmentShaderSource,bLe),this._renderState=to.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(q0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});q0.VERTEX_FORMAT=Ie.POSITION_ONLY;q0.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;q0.prototype.isTranslucent=to.prototype.isTranslucent;q0.prototype.getRenderState=to.prototype.getRenderState;var is=q0;var _N=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; -in float batchId; - -out float v_width; -out vec2 v_st; -out float v_polylineAngle; - -void main() -{ - float expandDir = expandAndWidth.x; - float width = abs(expandAndWidth.y) + 0.5; - bool usePrev = expandAndWidth.y < 0.0; - - vec4 p = czm_computePosition(); - vec4 prev = czm_computePrevPosition(); - vec4 next = czm_computeNextPosition(); - - float angle; - vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); - gl_Position = czm_viewportOrthographic * positionWC; - - v_width = width; - v_st.s = st.s; - v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); - v_polylineAngle = angle; -} -`;var G6=`${Ju} -${_N}`,TLe=wT;Ht.isInternetExplorer()||(G6=`#define CLIP_POLYLINE -${G6}`);function Y0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Y0.VERTEX_FORMAT;this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,G6),this._fragmentShaderSource=y(e.fragmentShaderSource,TLe),this._renderState=to.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Y0.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH -${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Y0.VERTEX_FORMAT=Ie.POSITION_AND_ST;Y0.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;Y0.prototype.isTranslucent=to.prototype.isTranslucent;Y0.prototype.getRenderState=to.prototype.getRenderState;var Ta=Y0;function hp(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new Ta),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=ene(!1),this._renderState3DTiles=ene(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(hp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});hp.initializeTerrainHeights=function(){return li.initialize()};function CLe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(dL);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(fL);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(lL),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",h="";l(n.material)?(h=l(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],_=new Ue({defines:u,sources:[s]}),m=new Ue({defines:p,sources:[h,c]});e._sp=en.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:_,fragmentShaderSource:m,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let T=new Ue({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:T,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=x;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(b)){let T=new Ue({defines:u.concat([`MAX_TERRAIN_HEIGHT ${li._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(uL);let C=new Ue({defines:p,sources:[h,c]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:r})}e._spMorph=b}function ene(e){return Ve.fromCache({cull:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})}function ALe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof is?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let h=0;h<a;h++){let p=s._va[h],_=o[h];l(_)||(_=o[h]=new $e({owner:e,primitiveType:s._primitiveType})),_.vertexArray=p,_.renderState=e._renderState,_.shaderProgram=e._sp,_.uniformMap=f,_.pass=we.TERRAIN_CLASSIFICATION,_.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=$e.shallowClone(_,_.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=we.CESIUM_3D_TILE_CLASSIFICATION,_.derivedCommands.tileset=m;let x=$e.shallowClone(_,_.derivedCommands.color2D);x.shaderProgram=e._sp2D,_.derivedCommands.color2D=x;let b=$e.shallowClone(m,m.derivedCommands.color2D);b.shaderProgram=e._sp2D,m.derivedCommands.color2D=b;let T=$e.shallowClone(_,_.derivedCommands.colorMorph);T.renderState=e._renderStateMorph,T.shaderProgram=e._spMorph,T.pickId="czm_batchTable_pickColor(v_batchId)",_.derivedCommands.colorMorph=T}}function tne(e,t,n,i,o,r,s){n.mode===ne.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ne.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function ELe(e,t,n,i,o,r,s){let a=e._primitive;In._updateBoundingVolumes(a,t,o);let c;t.mode===ne.SCENE3D?c=a._boundingSphereWC:t.mode===ne.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ne.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===ne.MORPHING,f=e.classificationType,h=f!==kn.CESIUM_3D_TILE,p=f!==kn.TERRAIN&&!u,_,m=t.passes;if(m.render||m.pick&&a.allowPicking){let x=n.length;for(let b=0;b<x;++b){let T=c[b];h&&(_=n[b],tne(e,_,t,o,r,T,s)),p&&(_=n[b].derivedCommands.tileset,tne(e,_,t,o,r,T,s))}}}hp.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!li.initialized){hp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new wc({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,VT.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new wt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){CLe(n,u,f)},i._createCommandsFunction=function(c,u,f,h,p,_,m){ALe(n,u,f,h,_,m)},i._updateAndQueueCommandsFunction=function(c,u,f,h,p,_,m,x){ELe(n,u,f,h,p,_,m)},this._primitive=new In(i)}if(this.appearance instanceof is&&!this._hasPerInstanceColors)throw new he("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};hp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};hp.isSupported=function(e){return e.frameState.context.depthTexture};hp.prototype.isDestroyed=function(){return!1};hp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var Lh=hp;var SLe=new U(1,1),vLe=!1,wLe=z.WHITE;function UT(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(UT.prototype,{isConstant:{get:function(){return q.isConstant(this._image)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});UT.prototype.getType=function(e){return"Image"};var DLe=new Z;UT.prototype.getValue=function(e,t){return l(e)||(e=Z.now(DLe)),l(t)||(t={}),t.image=q.getValueOrUndefined(this._image,e),t.repeat=q.getValueOrClonedDefault(this._repeat,e,SLe,t.repeat),t.color=q.getValueOrClonedDefault(this._color,e,wLe,t.color),q.getValueOrDefault(this._transparent,e,vLe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};UT.prototype.equals=function(e){return this===e||e instanceof UT&&q.equals(this._image,e._image)&&q.equals(this._repeat,e._repeat)&&q.equals(this._color,e._color)&&q.equals(this._transparent,e._transparent)};var X0=UT;function ILe(e){if(e instanceof z)return new zt(e);if(typeof e=="string"||e instanceof Se||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new X0;return t.image=e,t}}function PLe(e,t){return le(e,t,ILe)}var Lo=PLe;function _v(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(_v.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});_v.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new _v(this)};_v.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var zT=_v;var RLe={FIXED:0,INERTIAL:1},Ui=Object.freeze(RLe);function HT(){he.throwInstantiationError()}Object.defineProperties(HT.prototype,{isConstant:{get:he.throwInstantiationError},definitionChanged:{get:he.throwInstantiationError},referenceFrame:{get:he.throwInstantiationError}});HT.prototype.getValue=he.throwInstantiationError;HT.prototype.getValueInReferenceFrame=he.throwInstantiationError;HT.prototype.equals=he.throwInstantiationError;var nne=new $;HT.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new d),n===i)return d.clone(t,o);let r=Mt.computeIcrfToCentralBodyFixedMatrix(e,nne);if(n===Ui.INERTIAL)return $.multiplyByVector(r,t,o);if(n===Ui.FIXED)return $.multiplyByVector($.transpose(r,nne),t,o)};var Nh=HT;function K0(e,t){this._definitionChanged=new me,this._value=d.clone(e),this._referenceFrame=y(t,Ui.FIXED)}Object.defineProperties(K0.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Ui.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var OLe=new Z;K0.prototype.getValue=function(e,t){return l(e)||(e=Z.now(OLe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};K0.prototype.setValue=function(e,t){let n=!1;d.equals(this._value,e)||(n=!0,this._value=d.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};K0.prototype.getValueInReferenceFrame=function(e,t,n){return Nh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};K0.prototype.equals=function(e){return this===e||e instanceof K0&&d.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var gl=K0;function yv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(yv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});yv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new yv(this)};yv.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var GT=yv;function MLe(e){return e}function LLe(e,t){return le(e,t,MLe)}var _l=LLe;function xv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(xv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});xv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new xv(this)};xv.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var WT=xv;function bv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(bv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});bv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new bv(this)};bv.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var jT=bv;function Tv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Tv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Tv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Tv(this)};Tv.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var qT=Tv;function Cv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Cv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});Cv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new Cv(this)};Cv.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Fh=Cv;var NLe=new d(1,1,1),FLe=d.ZERO,BLe=Oe.IDENTITY;function ine(e,t,n){this.translation=d.clone(y(e,FLe)),this.rotation=Oe.clone(y(t,BLe)),this.scale=d.clone(y(n,NLe))}ine.prototype.equals=function(e){return this===e||l(e)&&d.equals(this.translation,e.translation)&&Oe.equals(this.rotation,e.rotation)&&d.equals(this.scale,e.scale)};var Z0=ine;var W6=new Z0;function Av(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(Av.prototype,{isConstant:{get:function(){return q.isConstant(this._translation)&&q.isConstant(this._rotation)&&q.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});var kLe=new Z;Av.prototype.getValue=function(e,t){return l(e)||(e=Z.now(kLe)),l(t)||(t=new Z0),t.translation=q.getValueOrClonedDefault(this._translation,e,W6.translation,t.translation),t.rotation=q.getValueOrClonedDefault(this._rotation,e,W6.rotation,t.rotation),t.scale=q.getValueOrClonedDefault(this._scale,e,W6.scale,t.scale),t};Av.prototype.equals=function(e){return this===e||e instanceof Av&&q.equals(this._translation,e._translation)&&q.equals(this._rotation,e._rotation)&&q.equals(this._scale,e._scale)};var YT=Av;function mp(e,t){this._propertyNames=[],this._definitionChanged=new me,l(e)&&this.merge(e,t)}Object.defineProperties(mp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!q.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});mp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function VLe(e){return new Yn(e)}mp.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,y(n,VLe))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};mp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var ULe=new Z;mp.prototype.getValue=function(e,t){l(e)||(e=Z.now(ULe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=q.getValueOrUndefined(this[r],e,t[r])}return t};mp.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function zLe(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!q.equals(e[s],t[s]))return!1}return!0}mp.prototype.equals=function(e){return this===e||e instanceof mp&&zLe(this,e)};var Zl=mp;function one(e){return new YT(e)}function HLe(e){return new Zl(e,one)}function GLe(e){return new Zl(e)}function Ev(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Ev.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),enableVerticalExaggeration:le("enableVerticalExaggeration"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,HLe),articulations:le("articulations",void 0,GLe),clippingPlanes:le("clippingPlanes"),customShader:le("customShader")});Ev.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new Ev(this)};Ev.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.enableVerticalExaggeration=y(this.enableVerticalExaggeration,e.enableVerticalExaggeration),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Zl(t,one)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Zl(n)}};var $g=Ev;function Sv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Sv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});Sv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new Sv(this)};Sv.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var XT=Sv;function vv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(vv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:Lo("material"),distanceDisplayCondition:le("distanceDisplayCondition")});vv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new vv(this)};vv.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Qg=vv;function wv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(wv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});wv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new wv(this)};wv.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var yN=wv;function Dv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Dv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance"),splitDirection:le("splitDirection")});Dv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new Dv(this)};Dv.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var KT=Dv;function WLe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Xa=WLe;function jLe(e){return Array.isArray(e)&&(e=new Xa(e)),new Yn(e)}function Iv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Iv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,jLe),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});Iv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new Iv(this)};Iv.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var Bh=Iv;function Pv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Pv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:Lo("material"),depthFailMaterial:Lo("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});Pv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Pv(this)};Pv.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Ic=Pv;function Rv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Rv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Rv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Rv(this)};Rv.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var ZT=Rv;function Ov(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Ov.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});Ov.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Ov(this)};Ov.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var kh=Ov;function Mv(e){this._definitionChanged=new me,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(Mv.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:Lo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});Mv.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Mv(this)};Mv.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Jg=Mv;var qLe=new fe,j6=[];function YLe(e){return new gl(e)}function XLe(e){return le(e,void 0,YLe)}function Ls(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function rf(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=zn()),this._availability=void 0,this._id=t,this._definitionChanged=new me,this._name=e.name,this._show=y(e.show,!0),this._trackingReferenceFrame=y(e.trackingReferenceFrame,Yg.AUTODETECT),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...j6],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function q6(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&q6(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(rf.prototype,{availability:_l("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:_l("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&q6(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:_l("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&q6(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ls("billboard",Ec),box:Ls("box",zT),corridor:Ls("corridor",GT),cylinder:Ls("cylinder",WT),description:le("description"),ellipse:Ls("ellipse",jT),ellipsoid:Ls("ellipsoid",qT),label:Ls("label",Fh),model:Ls("model",$g),tileset:Ls("tileset",XT),orientation:le("orientation"),path:Ls("path",Qg),plane:Ls("plane",yN),point:Ls("point",KT),polygon:Ls("polygon",Bh),polyline:Ls("polyline",Ic),polylineVolume:Ls("polylineVolume",ZT),properties:Ls("properties",Zl),position:XLe("position"),rectangle:Ls("rectangle",kh),viewFrom:le("viewFrom"),wall:Ls("wall",Jg)});rf.registerEntityType=function(e,t){Object.defineProperties(rf.prototype,{[e]:Ls(e,t)}),j6.includes(e)||j6.push(e)};rf.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};rf.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,_l(e,!0))};rf.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};rf.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var rne=new $,sne=new d,ane=new Oe;rf.prototype.computeModelMatrix=function(e,t){let n=q.getValueOrUndefined(this._position,e,sne);if(!l(n))return;let i=q.getValueOrUndefined(this._orientation,e,ane);return l(i)?t=F.fromRotationTranslation($.fromQuaternion(i,rne),n,t):t=Mt.eastNorthUpToFixedFrame(n,void 0,t),t};rf.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=q.getValueOrDefault(t,e,Ye.NONE),s=q.getValueOrUndefined(this._position,e,sne);if(r===Ye.NONE||!l(s)||d.equalsEpsilon(s,d.ZERO,P.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,qLe);tf(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=q.getValueOrUndefined(this._orientation,e,ane);return l(c)?o=F.fromRotationTranslation($.fromQuaternion(c,rne),s,o):o=Mt.eastNorthUpToFixedFrame(s,void 0,o),o};rf.supportsMaterialsforEntitiesOnTerrain=function(e){return pl.supportsMaterials(e)};rf.supportsPolylinesOnTerrain=function(e){return Lh.isSupported(e)};var or=rf;var KLe=new zt(z.WHITE),ZLe=new Yn(!0),$Le=new Yn(!0),QLe=new Yn(!1),JLe=new Yn(z.BLACK),eNe=new Yn(xn.DISABLED),tNe=new Yn(new Lt),nNe=new Yn(kn.BOTH);function Pc(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new me,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=or.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Pc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Pc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};Pc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};Pc.prototype.createFillGeometryInstance=he.throwInstantiationError;Pc.prototype.createOutlineGeometryInstance=he.throwInstantiationError;Pc.prototype.isDestroyed=function(){return!1};Pc.prototype.destroy=function(){ue(this)};Pc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(He.MINIMUM_VALUE)};Pc.prototype._isOnTerrain=function(e,t){return!1};Pc.prototype._getIsClosed=function(e){return!0};Pc.prototype._isDynamic=he.throwInstantiationError;Pc.prototype._setStaticOptions=he.throwInstantiationError;Pc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(He.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(He.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(o.material,KLe),this._fillProperty=y(r,$Le),this._showProperty=y(u,ZLe),this._showOutlineProperty=y(o.outline,QLe),this._outlineColorProperty=c?y(o.outlineColor,JLe):void 0,this._shadowsProperty=y(o.shadows,eNe),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,tNe),this._classificationTypeProperty=y(o.classificationType,nNe),this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof zt);if(c&&f&&(xt(xt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let h=o.outlineWidth;this._outlineWidth=l(h)?h.getValue(He.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Pc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ii=Pc;function $T(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new me,this.setCallback(e,t)}Object.defineProperties($T.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var iNe=new Z;$T.prototype.getValue=function(e,t){return l(e)||(e=Z.now(iNe)),this._callback(e,t)};$T.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};$T.prototype.equals=function(e){return this===e||e instanceof $T&&this._callback===e._callback&&this._isConstant===e._isConstant};var Vh=$T;var cne=new d;function QT(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new d,this._cartographicPosition=new fe,this._normal=new d,this._definitionChanged=new me,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(He.MINIMUM_VALUE,cne);if(!l(r)||d.equals(r,d.ZERO)||!l(e.globe))return;this._position=d.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(QT.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});QT.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(d.equals(t,d.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var oNe=new Z;QT.prototype.getValue=function(e,t){l(e)||(e=Z.now(oNe));let n=q.getValueOrDefault(this._heightReference,e,Ye.NONE),i=q.getValueOrDefault(this._extrudedHeightReference,e,Ye.NONE);if(n===Ye.NONE&&!DT(i))return this._position=d.clone(d.ZERO,this._position),d.clone(d.ZERO,t);if(this._positionProperty.isConstant)return d.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,cne);if(!l(r)||d.equals(r,d.ZERO)||!l(o.globe))return d.clone(d.ZERO,t);if(d.equalsEpsilon(this._position,r,P.EPSILON10))return d.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=d.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return d.multiplyByScalar(s,this._terrainHeight,t)};QT.prototype.isDestroyed=function(){return!1};QT.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var JT=QT;function rNe(e,t,n,i){if(ii.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new Vh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new JT(this._scene,s,r)}}var e_=rNe;var lne=d.ZERO,une=new d,sNe=new d,fne=new z;function aNe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function $l(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new aNe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&($l.prototype=Object.create(ii.prototype),$l.prototype.constructor=$l);Object.defineProperties($l.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});$l.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Bn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof zt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,fne)),l(a)||(a=z.WHITE),s.color=Wt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,lne,une))),new wt({id:t,geometry:ja.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};$l.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,fne),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,lne,une))),new wt({id:t,geometry:Oh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};$l.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};$l.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ii.prototype._isHidden.call(this,e,t)};$l.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};$l.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof zt?cn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(He.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Ye.NONE?sn.ALL:void 0};$l.prototype._onEntityPropertyChanged=e_;$l.DynamicGeometryUpdater=eC;function eC(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(eC.prototype=Object.create(ni.prototype),eC.prototype.constructor=eC);eC.prototype._isHidden=function(e,t,n){let i=q.getValueOrUndefined(e.position,n,sNe),o=this._options.dimensions;return!l(i)||!l(o)||ni.prototype._isHidden.call(this,e,t,n)};eC.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,Ye.NONE),o=this._options;o.dimensions=q.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Ye.NONE?sn.ALL:void 0};var xN=$l;function $0(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=y(n,Ui.FIXED),this._definitionChanged=new me,this.setCallback(e,t)}Object.defineProperties($0.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var cNe=new Z;$0.prototype.getValue=function(e,t){return l(e)||(e=Z.now(cNe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};$0.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};$0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Nh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};$0.prototype.equals=function(e){return this===e||e instanceof $0&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var bN=$0;/*! @license DOMPurify 3.2.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.2/LICENSE */var{entries:Tne,setPrototypeOf:dne,isFrozen:lNe,getPrototypeOf:uNe,getOwnPropertyDescriptor:fNe}=Object,{freeze:Oc,seal:sf,create:Cne}=Object,{apply:Q6,construct:J6}=typeof Reflect<"u"&&Reflect;Oc||(Oc=function(t){return t});sf||(sf=function(t){return t});Q6||(Q6=function(t,n,i){return t.apply(n,i)});J6||(J6=function(t,n){return new t(...n)});var TN=Ql(Array.prototype.forEach),hne=Ql(Array.prototype.pop),Lv=Ql(Array.prototype.push),AN=Ql(String.prototype.toLowerCase),Y6=Ql(String.prototype.toString),mne=Ql(String.prototype.match),Nv=Ql(String.prototype.replace),dNe=Ql(String.prototype.indexOf),hNe=Ql(String.prototype.trim),gd=Ql(Object.prototype.hasOwnProperty),Rc=Ql(RegExp.prototype.test),Fv=mNe(TypeError);function Ql(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return Q6(e,t,i)}}function mNe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return J6(e,n)}}function Ai(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:AN;dne&&dne(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(lNe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function pNe(e){for(let t=0;t<e.length;t++)gd(e,t)||(e[t]=null);return e}function Q0(e){let t=Cne(null);for(let[n,i]of Tne(e))gd(e,n)&&(Array.isArray(i)?t[n]=pNe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=Q0(i):t[n]=i);return t}function Bv(e,t){for(;e!==null;){let i=fNe(e,t);if(i){if(i.get)return Ql(i.get);if(typeof i.value=="function")return Ql(i.value)}e=uNe(e)}function n(){return null}return n}var pne=Oc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),X6=Oc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),K6=Oc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),gNe=Oc(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Z6=Oc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),_Ne=Oc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),gne=Oc(["#text"]),_ne=Oc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),$6=Oc(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),yne=Oc(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),CN=Oc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yNe=sf(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xNe=sf(/<%[\w\W]*|[\w\W]*%>/gm),bNe=sf(/\${[\w\W]*}/gm),TNe=sf(/^data-[\-\w.\u00B7-\uFFFF]/),CNe=sf(/^aria-[\-\w]+$/),Ane=sf(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ANe=sf(/^(?:\w+script|data):/i),ENe=sf(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ene=sf(/^html$/i),SNe=sf(/^[a-z][.\w]*(-[.\w]+)+$/i),xne=Object.freeze({__proto__:null,ARIA_ATTR:CNe,ATTR_WHITESPACE:ENe,CUSTOM_ELEMENT:SNe,DATA_ATTR:TNe,DOCTYPE_NAME:Ene,ERB_EXPR:xNe,IS_ALLOWED_URI:Ane,IS_SCRIPT_OR_DATA:ANe,MUSTACHE_EXPR:yNe,TMPLIT_EXPR:bNe}),kv={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},vNe=function(){return typeof window>"u"?null:window},wNe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},bne=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Sne(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vNe(),t=ln=>Sne(ln);if(t.version="3.2.2",t.removed=[],!e||!e.document||e.document.nodeType!==kv.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:c,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:_}=e,m=c.prototype,x=Bv(m,"cloneNode"),b=Bv(m,"remove"),T=Bv(m,"nextSibling"),C=Bv(m,"childNodes"),A=Bv(m,"parentNode");if(typeof s=="function"){let ln=n.createElement("template");ln.content&&ln.content.ownerDocument&&(n=ln.content.ownerDocument)}let S,v="",{implementation:D,createNodeIterator:O,createDocumentFragment:R,getElementsByTagName:M}=n,{importNode:L}=i,g=bne();t.isSupported=typeof Tne=="function"&&typeof A=="function"&&D&&D.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:E,ERB_EXPR:w,TMPLIT_EXPR:I,DATA_ATTR:N,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:G}=xne,{IS_ALLOWED_URI:k}=xne,W=null,Y=Ai({},[...pne,...X6,...K6,...Z6,...gne]),J=null,j=Ai({},[..._ne,...$6,...yne,...CN]),K=Object.seal(Cne(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Q=null,de=null,ye=!0,ce=!0,ge=!1,xe=!0,De=!1,Ae=!0,ke=!1,ze=!1,et=!1,St=!1,mt=!1,Be=!1,Yt=!0,Ct=!1,ut="user-content-",Jt=!0,Ce=!1,Te={},it=null,Vi=Ai({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ft=null,mo=Ai({},["audio","video","img","source","image","track"]),Ho=null,Ma=Ai({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Cr="http://www.w3.org/1998/Math/MathML",hs="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml",ot=Le,je=!1,Xe=null,ht=Ai({},[Cr,hs,Le],Y6),Gt=Ai({},["mi","mo","mn","ms","mtext"]),_n=Ai({},["annotation-xml"]),Eo=Ai({},["title","style","font","a","script"]),yo=null,La=["application/xhtml+xml","text/html"],Na="text/html",gi=null,ui=null,Ys=n.createElement("form"),kr=function(Ee){return Ee instanceof RegExp||Ee instanceof Function},il=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ui&&ui===Ee)){if((!Ee||typeof Ee!="object")&&(Ee={}),Ee=Q0(Ee),yo=La.indexOf(Ee.PARSER_MEDIA_TYPE)===-1?Na:Ee.PARSER_MEDIA_TYPE,gi=yo==="application/xhtml+xml"?Y6:AN,W=gd(Ee,"ALLOWED_TAGS")?Ai({},Ee.ALLOWED_TAGS,gi):Y,J=gd(Ee,"ALLOWED_ATTR")?Ai({},Ee.ALLOWED_ATTR,gi):j,Xe=gd(Ee,"ALLOWED_NAMESPACES")?Ai({},Ee.ALLOWED_NAMESPACES,Y6):ht,Ho=gd(Ee,"ADD_URI_SAFE_ATTR")?Ai(Q0(Ma),Ee.ADD_URI_SAFE_ATTR,gi):Ma,ft=gd(Ee,"ADD_DATA_URI_TAGS")?Ai(Q0(mo),Ee.ADD_DATA_URI_TAGS,gi):mo,it=gd(Ee,"FORBID_CONTENTS")?Ai({},Ee.FORBID_CONTENTS,gi):Vi,Q=gd(Ee,"FORBID_TAGS")?Ai({},Ee.FORBID_TAGS,gi):{},de=gd(Ee,"FORBID_ATTR")?Ai({},Ee.FORBID_ATTR,gi):{},Te=gd(Ee,"USE_PROFILES")?Ee.USE_PROFILES:!1,ye=Ee.ALLOW_ARIA_ATTR!==!1,ce=Ee.ALLOW_DATA_ATTR!==!1,ge=Ee.ALLOW_UNKNOWN_PROTOCOLS||!1,xe=Ee.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=Ee.SAFE_FOR_TEMPLATES||!1,Ae=Ee.SAFE_FOR_XML!==!1,ke=Ee.WHOLE_DOCUMENT||!1,St=Ee.RETURN_DOM||!1,mt=Ee.RETURN_DOM_FRAGMENT||!1,Be=Ee.RETURN_TRUSTED_TYPE||!1,et=Ee.FORCE_BODY||!1,Yt=Ee.SANITIZE_DOM!==!1,Ct=Ee.SANITIZE_NAMED_PROPS||!1,Jt=Ee.KEEP_CONTENT!==!1,Ce=Ee.IN_PLACE||!1,k=Ee.ALLOWED_URI_REGEXP||Ane,ot=Ee.NAMESPACE||Le,Gt=Ee.MATHML_TEXT_INTEGRATION_POINTS||Gt,_n=Ee.HTML_INTEGRATION_POINTS||_n,K=Ee.CUSTOM_ELEMENT_HANDLING||{},Ee.CUSTOM_ELEMENT_HANDLING&&kr(Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&kr(Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=Ee.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ee.CUSTOM_ELEMENT_HANDLING&&typeof Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=Ee.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),De&&(ce=!1),mt&&(St=!0),Te&&(W=Ai({},gne),J=[],Te.html===!0&&(Ai(W,pne),Ai(J,_ne)),Te.svg===!0&&(Ai(W,X6),Ai(J,$6),Ai(J,CN)),Te.svgFilters===!0&&(Ai(W,K6),Ai(J,$6),Ai(J,CN)),Te.mathMl===!0&&(Ai(W,Z6),Ai(J,yne),Ai(J,CN))),Ee.ADD_TAGS&&(W===Y&&(W=Q0(W)),Ai(W,Ee.ADD_TAGS,gi)),Ee.ADD_ATTR&&(J===j&&(J=Q0(J)),Ai(J,Ee.ADD_ATTR,gi)),Ee.ADD_URI_SAFE_ATTR&&Ai(Ho,Ee.ADD_URI_SAFE_ATTR,gi),Ee.FORBID_CONTENTS&&(it===Vi&&(it=Q0(it)),Ai(it,Ee.FORBID_CONTENTS,gi)),Jt&&(W["#text"]=!0),ke&&Ai(W,["html","head","body"]),W.table&&(Ai(W,["tbody"]),delete Q.tbody),Ee.TRUSTED_TYPES_POLICY){if(typeof Ee.TRUSTED_TYPES_POLICY.createHTML!="function")throw Fv('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ee.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Fv('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=Ee.TRUSTED_TYPES_POLICY,v=S.createHTML("")}else S===void 0&&(S=wNe(_,o)),S!==null&&typeof v=="string"&&(v=S.createHTML(""));Oc&&Oc(Ee),ui=Ee}},po=Ai({},[...X6,...K6,...gNe]),Ar=Ai({},[...Z6,..._Ne]),Km=function(Ee){let Pt=A(Ee);(!Pt||!Pt.tagName)&&(Pt={namespaceURI:ot,tagName:"template"});let mn=AN(Ee.tagName),lr=AN(Pt.tagName);return Xe[Ee.namespaceURI]?Ee.namespaceURI===hs?Pt.namespaceURI===Le?mn==="svg":Pt.namespaceURI===Cr?mn==="svg"&&(lr==="annotation-xml"||Gt[lr]):!!po[mn]:Ee.namespaceURI===Cr?Pt.namespaceURI===Le?mn==="math":Pt.namespaceURI===hs?mn==="math"&&_n[lr]:!!Ar[mn]:Ee.namespaceURI===Le?Pt.namespaceURI===hs&&!_n[lr]||Pt.namespaceURI===Cr&&!Gt[lr]?!1:!Ar[mn]&&(Eo[mn]||!po[mn]):!!(yo==="application/xhtml+xml"&&Xe[Ee.namespaceURI]):!1},Vr=function(Ee){Lv(t.removed,{element:Ee});try{A(Ee).removeChild(Ee)}catch{b(Ee)}},Vu=function(Ee,Pt){try{Lv(t.removed,{attribute:Pt.getAttributeNode(Ee),from:Pt})}catch{Lv(t.removed,{attribute:null,from:Pt})}if(Pt.removeAttribute(Ee),Ee==="is")if(St||mt)try{Vr(Pt)}catch{}else try{Pt.setAttribute(Ee,"")}catch{}},Fa=function(Ee){let Pt=null,mn=null;if(et)Ee="<remove></remove>"+Ee;else{let ya=mne(Ee,/^[\r\n\t ]+/);mn=ya&&ya[0]}yo==="application/xhtml+xml"&&ot===Le&&(Ee='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ee+"</body></html>");let lr=S?S.createHTML(Ee):Ee;if(ot===Le)try{Pt=new p().parseFromString(lr,yo)}catch{}if(!Pt||!Pt.documentElement){Pt=D.createDocument(ot,"template",null);try{Pt.documentElement.innerHTML=je?v:lr}catch{}}let Ba=Pt.body||Pt.documentElement;return Ee&&mn&&Ba.insertBefore(n.createTextNode(mn),Ba.childNodes[0]||null),ot===Le?M.call(Pt,ke?"html":"body")[0]:ke?Pt.documentElement:Ba},b0=function(Ee){return O.call(Ee.ownerDocument||Ee,Ee,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},_a=function(Ee){return Ee instanceof h&&(typeof Ee.nodeName!="string"||typeof Ee.textContent!="string"||typeof Ee.removeChild!="function"||!(Ee.attributes instanceof f)||typeof Ee.removeAttribute!="function"||typeof Ee.setAttribute!="function"||typeof Ee.namespaceURI!="string"||typeof Ee.insertBefore!="function"||typeof Ee.hasChildNodes!="function")},ol=function(Ee){return typeof a=="function"&&Ee instanceof a};function _c(ln,Ee,Pt){TN(ln,mn=>{mn.call(t,Ee,Pt,ui)})}let es=function(Ee){let Pt=null;if(_c(g.beforeSanitizeElements,Ee,null),_a(Ee))return Vr(Ee),!0;let mn=gi(Ee.nodeName);if(_c(g.uponSanitizeElement,Ee,{tagName:mn,allowedTags:W}),Ee.hasChildNodes()&&!ol(Ee.firstElementChild)&&Rc(/<[/\w]/g,Ee.innerHTML)&&Rc(/<[/\w]/g,Ee.textContent)||Ee.nodeType===kv.progressingInstruction||Ae&&Ee.nodeType===kv.comment&&Rc(/<[/\w]/g,Ee.data))return Vr(Ee),!0;if(!W[mn]||Q[mn]){if(!Q[mn]&&zu(mn)&&(K.tagNameCheck instanceof RegExp&&Rc(K.tagNameCheck,mn)||K.tagNameCheck instanceof Function&&K.tagNameCheck(mn)))return!1;if(Jt&&!it[mn]){let lr=A(Ee)||Ee.parentNode,Ba=C(Ee)||Ee.childNodes;if(Ba&&lr){let ya=Ba.length;for(let rl=ya-1;rl>=0;--rl){let yh=x(Ba[rl],!0);yh.__removalCount=(Ee.__removalCount||0)+1,lr.insertBefore(yh,T(Ee))}}}return Vr(Ee),!0}return Ee instanceof c&&!Km(Ee)||(mn==="noscript"||mn==="noembed"||mn==="noframes")&&Rc(/<\/no(script|embed|frames)/i,Ee.innerHTML)?(Vr(Ee),!0):(De&&Ee.nodeType===kv.text&&(Pt=Ee.textContent,TN([E,w,I],lr=>{Pt=Nv(Pt,lr," ")}),Ee.textContent!==Pt&&(Lv(t.removed,{element:Ee.cloneNode()}),Ee.textContent=Pt)),_c(g.afterSanitizeElements,Ee,null),!1)},Uu=function(Ee,Pt,mn){if(Yt&&(Pt==="id"||Pt==="name")&&(mn in n||mn in Ys))return!1;if(!(ce&&!de[Pt]&&Rc(N,Pt))){if(!(ye&&Rc(B,Pt))){if(!J[Pt]||de[Pt]){if(!(zu(Ee)&&(K.tagNameCheck instanceof RegExp&&Rc(K.tagNameCheck,Ee)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Ee))&&(K.attributeNameCheck instanceof RegExp&&Rc(K.attributeNameCheck,Pt)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(Pt))||Pt==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&Rc(K.tagNameCheck,mn)||K.tagNameCheck instanceof Function&&K.tagNameCheck(mn))))return!1}else if(!Ho[Pt]){if(!Rc(k,Nv(mn,V,""))){if(!((Pt==="src"||Pt==="xlink:href"||Pt==="href")&&Ee!=="script"&&dNe(mn,"data:")===0&&ft[Ee])){if(!(ge&&!Rc(H,Nv(mn,V,"")))){if(mn)return!1}}}}}}return!0},zu=function(Ee){return Ee!=="annotation-xml"&&mne(Ee,G)},Hu=function(Ee){_c(g.beforeSanitizeAttributes,Ee,null);let{attributes:Pt}=Ee;if(!Pt)return;let mn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0},lr=Pt.length;for(;lr--;){let Ba=Pt[lr],{name:ya,namespaceURI:rl,value:yh}=Ba,DS=gi(ya),yc=ya==="value"?yh:hNe(yh);if(mn.attrName=DS,mn.attrValue=yc,mn.keepAttr=!0,mn.forceKeepAttr=void 0,_c(g.uponSanitizeAttribute,Ee,mn),yc=mn.attrValue,Ct&&(DS==="id"||DS==="name")&&(Vu(ya,Ee),yc=ut+yc),Ae&&Rc(/((--!?|])>)|<\/(style|title)/i,yc)){Vu(ya,Ee);continue}if(mn.forceKeepAttr||(Vu(ya,Ee),!mn.keepAttr))continue;if(!xe&&Rc(/\/>/i,yc)){Vu(ya,Ee);continue}De&&TN([E,w,I],LZ=>{yc=Nv(yc,LZ," ")});let MZ=gi(Ee.nodeName);if(Uu(MZ,DS,yc)){if(S&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!rl)switch(_.getAttributeType(MZ,DS)){case"TrustedHTML":{yc=S.createHTML(yc);break}case"TrustedScriptURL":{yc=S.createScriptURL(yc);break}}try{rl?Ee.setAttributeNS(rl,ya,yc):Ee.setAttribute(ya,yc),_a(Ee)?Vr(Ee):hne(t.removed)}catch{}}}_c(g.afterSanitizeAttributes,Ee,null)},Po=function ln(Ee){let Pt=null,mn=b0(Ee);for(_c(g.beforeSanitizeShadowDOM,Ee,null);Pt=mn.nextNode();)_c(g.uponSanitizeShadowNode,Pt,null),!es(Pt)&&(Pt.content instanceof r&&ln(Pt.content),Hu(Pt));_c(g.afterSanitizeShadowDOM,Ee,null)};return t.sanitize=function(ln){let Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Pt=null,mn=null,lr=null,Ba=null;if(je=!ln,je&&(ln="<!-->"),typeof ln!="string"&&!ol(ln))if(typeof ln.toString=="function"){if(ln=ln.toString(),typeof ln!="string")throw Fv("dirty is not a string, aborting")}else throw Fv("toString is not a function");if(!t.isSupported)return ln;if(ze||il(Ee),t.removed=[],typeof ln=="string"&&(Ce=!1),Ce){if(ln.nodeName){let yh=gi(ln.nodeName);if(!W[yh]||Q[yh])throw Fv("root node is forbidden and cannot be sanitized in-place")}}else if(ln instanceof a)Pt=Fa("<!---->"),mn=Pt.ownerDocument.importNode(ln,!0),mn.nodeType===kv.element&&mn.nodeName==="BODY"||mn.nodeName==="HTML"?Pt=mn:Pt.appendChild(mn);else{if(!St&&!De&&!ke&&ln.indexOf("<")===-1)return S&&Be?S.createHTML(ln):ln;if(Pt=Fa(ln),!Pt)return St?null:Be?v:""}Pt&&et&&Vr(Pt.firstChild);let ya=b0(Ce?ln:Pt);for(;lr=ya.nextNode();)es(lr)||(lr.content instanceof r&&Po(lr.content),Hu(lr));if(Ce)return ln;if(St){if(mt)for(Ba=R.call(Pt.ownerDocument);Pt.firstChild;)Ba.appendChild(Pt.firstChild);else Ba=Pt;return(J.shadowroot||J.shadowrootmode)&&(Ba=L.call(i,Ba,!0)),Ba}let rl=ke?Pt.outerHTML:Pt.innerHTML;return ke&&W["!doctype"]&&Pt.ownerDocument&&Pt.ownerDocument.doctype&&Pt.ownerDocument.doctype.name&&Rc(Ene,Pt.ownerDocument.doctype.name)&&(rl="<!DOCTYPE "+Pt.ownerDocument.doctype.name+`> -`+rl),De&&TN([E,w,I],yh=>{rl=Nv(rl,yh," ")}),S&&Be?S.createHTML(rl):rl},t.setConfig=function(){let ln=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};il(ln),ze=!0},t.clearConfig=function(){ui=null,ze=!1},t.isValidAttribute=function(ln,Ee,Pt){ui||il({});let mn=gi(ln),lr=gi(Ee);return Uu(mn,lr,Pt)},t.addHook=function(ln,Ee){typeof Ee=="function"&&Lv(g[ln],Ee)},t.removeHook=function(ln){return hne(g[ln])},t.removeHooks=function(ln){g[ln]=[]},t.removeAllHooks=function(){g=bne()},t}var vne=Sne();var DNe=0,e9={};function Uh(e,t){let n,i=e;l(e9[i])?n=e9[i]:(n=DNe++,e9[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(Uh.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=vne.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});Uh.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};Uh.prototype.equals=function(e){return Uh.equals(this,e)};Uh.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};Uh.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new Uh(e.html,t)};Uh.clone=function(e){if(l(e))return new Uh(e.html,e.showOnScreen)};var At=Uh;function J0(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new me}Object.defineProperties(J0.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});J0.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function t9(e){e._cubeMapBuffers=void 0}J0.prototype.update=function(e){let{context:t}=e;if(!J0.isSupported(t))return;if(l(this._texture)){t9(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(t9(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;Wl(this._url).then(function(h){f._cubeMapBuffers=h,f._loading=!1}).catch(function(h){f.isDestroyed()||f._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT);let o=tt.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let f={};Object.values(wr.FaceName).forEach(h=>{f[h]=void 0});for(let h=r;h<a;h++)n.push(f)}let c=new $t({minificationFilter:Zt.LINEAR_MIPMAP_LINEAR}),u=new wr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};J0.prototype.isDestroyed=function(){return!1};J0.prototype.destroy=function(){return t9(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var zh=J0;function Vv(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?U.clone(e.imageBasedLightingFactor):new U(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=U.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(Vv.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=U.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function INe(e,t){if(zh.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new zh(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}Vv.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;U.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(INe(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};Vv.prototype.isDestroyed=function(){return!1};Vv.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var tC=Vv;var i9=Ur(Hl(),1);var n9,wne="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0ZDdmNWJiNy0wMmNlLTQ1MWUtODM2YS02NGM1MTBlOGMwMWQiLCJpZCI6MjU5LCJpYXQiOjE3MzMxNTc4OTV9.B3URHf0VdHDtGckb-hv7uqATdn8KfvkiuoAFZUq8tAo",EN={};EN.defaultAccessToken=wne;EN.defaultServer=new Se({url:"https://api.cesium.com/"});EN.getDefaultTokenCredit=function(e){if(e===wne){if(!l(n9)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;n9=new At(t,!0)}return n9}};var Hh=EN;function Mc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:PNe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new re("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Se.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new i9.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(Mc.prototype=Object.create(Se.prototype),Mc.prototype.constructor=Mc);Mc.fromAssetId=function(e,t){let n=Mc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Mc(i,n)})};Object.defineProperties(Mc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Mc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Mc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(At.getIonCredit),i=Hh.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(At.clone(i)),n};Mc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Mc(t._ionEndpoint,t._ionEndpointResource)),e=Se.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Mc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Se.prototype.fetchImage.call(this,e)};Mc.prototype._makeRequest=function(e){return this._isExternal||new i9.default(this.url).authority()!==this._ionEndpointDomain?Se.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Se.prototype._makeRequest.call(this,e))};Mc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,Hh.defaultServer),i=y(t.accessToken,Hh.defaultAccessToken);n=Se.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function PNe(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var af=Mc;function Gh(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(Gh.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Gh.prototype.get=function(e){return this._array[e]};Gh.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Gh.prototype.peek=function(){return this._array[this._length-1]};Gh.prototype.push=function(e){let t=this.length++;this._array[t]=e};Gh.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Gh.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Gh.prototype.resize=function(e){this.length=e};Gh.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var yl=Gh;var pp={X:0,Y:1,Z:2};pp.Y_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));pp.Z_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));pp.X_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));pp.Z_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));pp.X_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));pp.Y_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));pp.fromName=function(e){return pp[e]};var No=Object.freeze(pp);function Dne(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(Dne.prototype,{metadata:{get:function(){return this._metadata}}});var nC=Dne;function t_(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),t_.decode(e)}t_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};t_.decodeWithFromCharCode=function(e){let t="",n=RNe(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function Uv(e,t,n){return t<=e&&e<=n}function RNe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(Uv(u,0,127)){s.push(u);continue}if(Uv(u,194,223)){i=1,t=u&31;continue}if(Uv(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(Uv(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new re("String decoding failed.")}if(!Uv(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?t_.decode=t_.decodeWithTextDecoder:t_.decode=t_.decodeWithFromCharCode;var Jl=t_;function ONe(e,t){return t=y(t,0),Jl(e,t,Math.min(4,e.length))}var Wh=ONe;function cf(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(cf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var zv=Uint32Array.BYTES_PER_ELEMENT;cf.fromTileType=async function(e,t,n,i,o,r){o=y(o,0);let s=new Uint8Array(i),a=new DataView(i);o+=zv;let c=a.getUint32(o,!0);if(c!==1)throw new re(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=zv,o+=zv;let u=a.getUint32(o,!0);o+=zv;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let h=[];h.length=u;for(let m=0;m<u;++m){let x=Wh(s,o),b=a.getUint32(o+zv*2,!0),T=r[x],C=`${f}${m}`,A=n.getDerivedResource({queryParameters:{compositeIndex:C}});if(l(T))h[m]=Promise.resolve(T(e,t,A,i,o));else throw new re(`Unknown tile content type, ${x}, inside Composite tile`);o+=b}let p=await Promise.all(h);return new cf(e,t,n,p)};cf.prototype.hasProperty=function(e,t){return!1};cf.prototype.getFeature=function(e){};cf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};cf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};cf.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};cf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=d.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};cf.prototype.isDestroyed=function(){return!1};cf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var SN=cf;function MNe(e,t,n){return JSON.parse(Jl(e,t,n))}var Fo=MNe;function Ka(e){this._id=zn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,Bt.maximumTextureSize),r=Math.ceil(t/Bt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,u=c*.5;n=new U(o,r),i=new oe(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Ka.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Ka.DEFAULT_COLOR_VALUE=z.WHITE;Ka.DEFAULT_SHOW_VALUE=!0;function Ine(e){let t=e._textureDimensions;return t.x*t.y*4}function Pne(e){if(!l(e._batchValues)){let t=Ine(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Rne(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Ka.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Rne(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Pne(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Ka.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Ka.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var LNe=new Array(4);Ka.prototype.setColor=function(e,t){if(z.equals(t,Ka.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(LNe),i=n[3],o=Pne(this),r=e*4,s=Rne(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Ka.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Ka.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(Ka.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};Ka.prototype.getPickColor=function(e){return this._pickIds[e]};function One(e,t,n){let i=e._textureDimensions;return new Ot({context:t,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:$t.NEAREST})}function NNe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=Ine(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,h=c*4;r[h]=z.floatToByte(f.red),r[h+1]=z.floatToByte(f.green),r[h+2]=z.floatToByte(f.blue),r[h+3]=z.floatToByte(f.alpha)}e._pickTexture=One(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function FNe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Ka.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&NNe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=One(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),FNe(this))};Ka.prototype.isDestroyed=function(){return!1};Ka.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var xl=Ka;var BNe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kNe={SCALAR:void 0,VEC2:U,VEC3:d,VEC4:oe,MAT2:Pi,MAT3:$,MAT4:F};function VNe(e){let t=e.componentType,n;typeof t=="string"?n=X.fromName(t):n=t;let i=BNe[e.type],o=kNe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return X.createArrayBufferView(n,r,s,i*a)}}}var lf=VNe;function gp(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,UNe(this,e.extension,e.binaryBody)}Object.defineProperties(gp.prototype,{byteLength:{get:function(){return this._byteLength}}});function UNe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,h=s,p=0;l(c.byteOffset)&&(c.componentType=y(c.componentType,X.UNSIGNED_SHORT),c.type=on.SCALAR,r=lf(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let _;if(l(u)){for(l(u.byteOffset)&&(u.componentType=y(u.componentType,X.UNSIGNED_SHORT),u.type=on.SCALAR,r=lf(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),_=new Uint16Array(s),h=0,i=0;i<s;++i)_[i]=h,h+=u[i];p+=_.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=y(f.componentType,X.UNSIGNED_SHORT),f.type=on.SCALAR,r=lf(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,h),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let T=a[i].length,C=a[i].instances,A=zNe(T,C,n);p+=HNe(A),a[i].instances=bt(A,C)}let x=new Array(m).fill(0),b=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],b[i]=x[o],++x[o];p+=b.byteLength,e._classes=a,e._classIds=c,e._classIndexes=b,e._parentCounts=u,e._parentIndexes=_,e._parentIds=f,e._byteLength=p}function zNe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new re("componentType is required.");if(!l(c))throw new re("type is required.");if(!l(n))throw new re(`Property ${o} requires a batch table binary.`);let u=lf(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function HNe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var GNe=[],WNe=[],jNe=0;function qNe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=GNe;c.length=Math.max(c.length,a);let u=++jNe,f=WNe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let h=n(e,t);if(l(h))return h;let p=o[t],_=s[t];for(let m=0;m<p;++m){let x=r[_+m];x!==t&&f.push(x)}}}function YNe(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(l(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function Hv(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return qNe(e,t,n)}else return n(e,t);return YNe(e,t,n)}gp.prototype.hasProperty=function(e,t){let n=Hv(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};gp.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(l(o[e]))return!0}return!1};gp.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,Hv(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};gp.prototype.getProperty=function(e,t){return Hv(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(l(a))return l(a.typedArray)?XNe(a,s):Ge(a[s],!0)})};function XNe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}gp.prototype.setProperty=function(e,t,n){let i=Hv(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],u=a.instances[t];if(l(u))return l(u.typedArray)?KNe(u,c,n):u[c]=Ge(n,!0),!0});return l(i)};function KNe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}gp.prototype.isClass=function(e,t){let n=Hv(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};gp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var iC=gp;var ZNe={HIGHLIGHT:0,REPLACE:1,MIX:2},eu=Object.freeze(ZNe);var o9=xl.DEFAULT_COLOR_VALUE,r9=xl.DEFAULT_SHOW_VALUE;function ao(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=y(r,{});let s=$Ne(n);this._properties=s,this._batchTableHierarchy=QNe(this,n,i);let a=Lne(t,s,i);this._binaryPropertiesByteLength=JNe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new xl({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}ao._deprecationWarning=_s;Object.defineProperties(ao.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function $Ne(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ge(e[n],!0));return t}function QNe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(ao._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=o,i=o),!!l(i))return new iC({extension:i,binaryBody:n})}function Lne(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new re("componentType is required.");if(!l(c))throw new re("type is required.");if(!l(n))throw new re(`Property ${o} requires a batch table binary.`);let u=lf(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function JNe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}ao.getBinaryProperties=function(e,t,n){return Lne(e,t,n)};ao.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ao.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ao.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ao.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ao.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ao.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ao.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var eFe=new z;ao.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(o9),this.setAllShow(r9);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?y(e.color.evaluateColor(o,eFe),o9):o9,s=l(e.show)?y(e.show.evaluate(o),r9):r9;this.setColor(i,r),this.setShow(i,s)}};function tFe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function nFe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}ao.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};ao.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};ao.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};ao.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};ao.prototype.hasPropertyBySemantic=function(){return!1};ao.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};ao.prototype.getPropertyBySemantic=function(e,t){};ao.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return tFe(i,e)}let n=this._properties[t];if(l(n))return Ge(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};ao.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){nFe(r,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];l(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=Ge(n,!0)};function iFe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - return vec2(centerX + (batchId * stepX), 0.5); -} -`:`uniform vec4 tile_textureStep; -uniform vec2 tile_textureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - float stepY = tile_textureStep.z; - float centerY = tile_textureStep.w; - float xId = mod(batchId, tile_textureDimensions.x); - float yId = floor(batchId / tile_textureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}ao.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Nne(o,n,!1),s;return Bt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; -`),s+=`uniform sampler2D tile_batchTexture; -out vec4 tile_featureColor; -out vec2 tile_featureSt; -void main() -{ - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; -void main() -{ - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${r} -${iFe(i)}${s}`}};function Mne(e,t){return e=Ue.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function oFe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function Nne(e,t,n){if(!l(t))return Mne(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return Mne(e,n);let r=o[0],s=o[2];e=Ue.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} -vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) -{ - vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); - vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; - return vec4(diffuse.rgb, sourceDiffuse.a); -} -`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,h=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,h),u=` vec4 source = ${f}; - tile_diffuse = tile_diffuse_final(source, tile_featureColor); - tile_main(); -`}else s==="sampler2D"&&(e=oFe(e,t),u=` tile_diffuse = tile_featureColor; - tile_main(); -`);return e=`uniform float tile_colorBlend; -vec4 tile_diffuse = vec4(1.0); -${a}${r} -${e} -void tile_color(vec4 tile_featureColor) -{ -${u}`,n&&(e+=c),e+=`} -`,e}ao.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Nne(i,t,!0),Bt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};ao.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=Ue.replaceMain(e,"tile_main"),Bt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_main(); - out_FragColor = tile_featureColor; - out_FragColor.rgb *= out_FragColor.a; -}`:e+=`uniform sampler2D tile_batchTexture; -uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -void main() -{ - tile_main(); - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } - out_FragColor = featureProperties; - out_FragColor.rgb *= out_FragColor.a; -} -`,e}};function rFe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===eu.HIGHLIGHT)return 0;if(n===eu.REPLACE)return 1;if(n===eu.MIX)return P.clamp(i,P.EPSILON4,1)}ao.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return bt(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return rFe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};ao.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var n_={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};ao.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=sFe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===we.COMPUTE)continue;let h=f.derivedCommands.tileset;(!l(h)||f.dirty)&&(h={},f.derivedCommands.tileset=h,h.originalCommand=aFe(f),f.dirty=!1);let p=h.originalCommand;c!==n_.ALL_OPAQUE&&f.pass!==we.TRANSLUCENT&&(l(h.translucent)||(h.translucent=cFe(p))),c!==n_.ALL_TRANSLUCENT&&f.pass!==we.TRANSLUCENT&&(l(h.opaque)||(h.opaque=lFe(p)),a&&(r||(l(h.zback)||(h.zback=fFe(e.context,p)),s._backfaceCommands.push(h.zback)),(!l(h.stencil)||o._selectionDepth!==hFe(h.stencil))&&(f.renderState.depthMask?h.stencil=dFe(p,o._selectionDepth):h.stencil=h.opaque)));let _=a?h.stencil:h.opaque,m=h.translucent;f.pass!==we.TRANSLUCENT?(c===n_.ALL_OPAQUE&&(n[u]=_),c===n_.ALL_TRANSLUCENT&&(n[u]=m),c===n_.OPAQUE_AND_TRANSLUCENT&&(n[u]=_,n.push(m))):n[u]=p}};function sFe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?n_.ALL_OPAQUE:t===e.featuresLength?n_.ALL_TRANSLUCENT:n_.OPAQUE_AND_TRANSLUCENT}function aFe(e){let t=$e.shallowClone(e),n=t.pass===we.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function cFe(e){let t=$e.shallowClone(e);return t.pass=we.TRANSLUCENT,t.renderState=mFe(e.renderState),t}function lFe(e){let t=$e.shallowClone(e);return t.renderState=pFe(e.renderState),t}function uFe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function fFe(e,t){let n=$e.shallowClone(t),i=Ge(n.renderState,!0);i.cull.enabled=!0,i.cull.face=xi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Ut.setCesium3DTileBit(),i.stencilMask=Ut.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ge(t.uniformMap);let o=new U(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=uFe(e,t.shaderProgram),n}function dFe(e,t){let n=$e.shallowClone(e),i=Ge(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Ut.SKIP_LOD_MASK,i.stencilTest.reference=Ut.CESIUM_3D_TILE_MASK|t<<Ut.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=dt.REPLACE,i.stencilTest.backFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=dt.REPLACE,i.stencilMask=Ut.CESIUM_3D_TILE_MASK|Ut.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function hFe(e){return(e.renderState.stencilTest.reference&Ut.SKIP_LOD_MASK)>>>Ut.SKIP_LOD_BIT_SHIFT}function mFe(e){let t=Ge(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=Ut.setCesium3DTileBit(),t.stencilMask=Ut.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function pFe(e){let t=Ge(e,!0);return t.stencilTest=Ut.setCesium3DTileBit(),t.stencilMask=Ut.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}ao.prototype.update=function(e,t){this._batchTexture.update(e,t)};ao.prototype.isDestroyed=function(){return!1};ao.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var i_=ao;function gFe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var _p=gFe;function uf(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(uf.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});uf.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};uf.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};uf.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};uf.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let u=e.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};uf.prototype.getPropertyInherited=function(e){return uf.getPropertyInherited(this._content,this._batchId,e)};uf.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};uf.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};uf.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};uf.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var $s=uf;var s9=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},a9=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},bl=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=` -`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},_Fe=new s9;Object.assign(bl,{hooks:_Fe,plugins:new a9(bl),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});bl.max_unop_len=bl.getMaxKeyLen(bl.unary_ops);bl.max_binop_len=bl.getMaxKeyLen(bl.binary_ops);var o_=e=>new bl(e).parse(),yFe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(bl).filter(e=>!yFe.includes(e)&&o_[e]===void 0).forEach(e=>{o_[e]=bl[e]});o_.Jsep=bl;var xFe="ConditionalExpression",bFe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:xFe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};o_.plugins.register(bFe);var TFe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},pt=Object.freeze(TFe);function _d(e,t){this._expression=e,e=LFe(e,t),e=FFe(NFe(e)),o_.addBinaryOp("=~",0),o_.addBinaryOp("!~",0);let n;try{n=o_(e)}catch(i){throw new re(i)}this._runtimeAst=bi(this,n)}Object.defineProperties(_d.prototype,{expression:{get:function(){return this._expression}}});var Pn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new U],cartesian3Array:[new d],cartesian4Array:[new oe],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new U),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new d),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new oe),this.cartesian4Array[this.cartesian4Index++]}};_d.prototype.evaluate=function(e,t){Pn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof oe?z.fromCartesian4(n,t):n instanceof U||n instanceof d||n instanceof oe?n.clone(t):n};_d.prototype.evaluateColor=function(e,t){Pn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};_d.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} -{ - return ${o}; -} -`,o};_d.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};_d.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var CFe=["!","-","+"],Fne=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],DN=/\${(.*?)}/g,AFe=/\\/g,EFe="@#%",SFe=/@#%/g,IN=new z,PN={abs:Ns(Math.abs),sqrt:Ns(Math.sqrt),cos:Ns(Math.cos),sin:Ns(Math.sin),tan:Ns(Math.tan),acos:Ns(Math.acos),asin:Ns(Math.asin),atan:Ns(Math.atan),radians:Ns(P.toRadians),degrees:Ns(P.toDegrees),sign:Ns(P.sign),floor:Ns(Math.floor),ceil:Ns(Math.ceil),round:Ns(Math.round),exp:Ns(Math.exp),exp2:Ns(wFe),log:Ns(Math.log),log2:Ns(DFe),fract:Ns(vFe),length:IFe,normalize:PFe},RN={atan2:vN(Math.atan2,!1),pow:vN(Math.pow,!1),min:vN(Math.min,!0),max:vN(Math.max,!0),distance:RFe,dot:OFe,cross:MFe},u9={clamp:Bne(P.clamp,!0),mix:Bne(P.lerp,!0)};function vFe(e){return e-Math.floor(e)}function wFe(e){return Math.pow(2,e)}function DFe(e){return P.log2(e)}function Ns(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof U)return U.fromElements(e(n.x),e(n.y),Pn.getCartesian2());if(n instanceof d)return d.fromElements(e(n.x),e(n.y),e(n.z),Pn.getCartesian3());if(n instanceof oe)return oe.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Pn.getCartesian4());throw new re(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function vN(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof U)return U.fromElements(e(i.x,o),e(i.y,o),Pn.getCartesian2());if(i instanceof d)return d.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Pn.getCartesian3());if(i instanceof oe)return oe.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Pn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof U&&o instanceof U)return U.fromElements(e(i.x,o.x),e(i.y,o.y),Pn.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Pn.getCartesian3());if(i instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Pn.getCartesian4());throw new re(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Bne(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof U&&o instanceof U)return U.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Pn.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Pn.getCartesian3());if(i instanceof oe&&o instanceof oe)return oe.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Pn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof U&&o instanceof U&&r instanceof U)return U.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Pn.getCartesian2());if(i instanceof d&&o instanceof d&&r instanceof d)return d.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),Pn.getCartesian3());if(i instanceof oe&&o instanceof oe&&r instanceof oe)return oe.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Pn.getCartesian4());throw new re(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function IFe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof U)return U.magnitude(t);if(t instanceof d)return d.magnitude(t);if(t instanceof oe)return oe.magnitude(t);throw new re(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function PFe(e,t){if(typeof t=="number")return 1;if(t instanceof U)return U.normalize(t,Pn.getCartesian2());if(t instanceof d)return d.normalize(t,Pn.getCartesian3());if(t instanceof oe)return oe.normalize(t,Pn.getCartesian4());throw new re(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function RFe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof U&&n instanceof U)return U.distance(t,n);if(t instanceof d&&n instanceof d)return d.distance(t,n);if(t instanceof oe&&n instanceof oe)return oe.distance(t,n);throw new re(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function OFe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof U&&n instanceof U)return U.dot(t,n);if(t instanceof d&&n instanceof d)return d.dot(t,n);if(t instanceof oe&&n instanceof oe)return oe.dot(t,n);throw new re(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function MFe(e,t,n){if(t instanceof d&&n instanceof d)return d.cross(t,n,Pn.getCartesian3());throw new re(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Tt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,qFe(this)}function LFe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function NFe(e){return e.replace(AFe,EFe)}function l9(e){return e.replace(SFe,"\\")}function FFe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new re("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function BFe(e){let t=typeof e.value;if(e.value===null)return new Tt(pt.LITERAL_NULL,null);if(t==="boolean")return new Tt(pt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Tt(pt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Tt(pt.VARIABLE_IN_STRING,e.value):new Tt(pt.LITERAL_STRING,l9(e.value))}function kFe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new re(`${o} is not a function.`);return i===0?o==="test"?new Tt(pt.LITERAL_BOOLEAN,!1):new Tt(pt.LITERAL_NULL,null):(s=bi(e,c),a=bi(e,n[0]),new Tt(pt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=bi(e,c),new Tt(pt.FUNCTION_CALL,o,r);throw new re(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Tt(pt.LITERAL_COLOR,o);if(r=bi(e,n[0]),l(n[1])){let c=bi(e,n[1]);return new Tt(pt.LITERAL_COLOR,o,[r,c])}return new Tt(pt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new re(`${o} requires three arguments.`);return r=[bi(e,n[0]),bi(e,n[1]),bi(e,n[2])],new Tt(pt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new re(`${o} requires four arguments.`);return r=[bi(e,n[0]),bi(e,n[1]),bi(e,n[2]),bi(e,n[3])],new Tt(pt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=bi(e,n[c]);return new Tt(pt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Tt(pt.LITERAL_BOOLEAN,!0):new Tt(pt.LITERAL_BOOLEAN,!1):(r=bi(e,n[0]),new Tt(pt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new re(`${o} requires exactly one argument.`);return r=bi(e,n[0]),new Tt(pt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new re(`${o} does not take any argument.`);return new Tt(pt.UNARY,o)}else if(l(PN[o])){if(i!==1)throw new re(`${o} requires exactly one argument.`);return r=bi(e,n[0]),new Tt(pt.UNARY,o,r)}else if(l(RN[o])){if(i!==2)throw new re(`${o} requires exactly two arguments.`);return s=bi(e,n[0]),a=bi(e,n[1]),new Tt(pt.BINARY,o,s,a)}else if(l(u9[o])){if(i!==3)throw new re(`${o} requires exactly three arguments.`);s=bi(e,n[0]),a=bi(e,n[1]);let c=bi(e,n[2]);return new Tt(pt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Tt(pt.LITERAL_BOOLEAN,!1):(r=bi(e,n[0]),new Tt(pt.UNARY,o,r));if(o==="Number")return i===0?new Tt(pt.LITERAL_NUMBER,0):(r=bi(e,n[0]),new Tt(pt.UNARY,o,r));if(o==="String")return i===0?new Tt(pt.LITERAL_STRING,""):(r=bi(e,n[0]),new Tt(pt.UNARY,o,r));if(o==="regExp")return VFe(e,t)}}throw new re(`Unexpected function call "${o}".`)}function VFe(e,t){let n=t.arguments;if(n.length===0)return new Tt(pt.LITERAL_REGEX,new RegExp);let i=bi(e,n[0]),o;if(n.length>1){let r=bi(e,n[1]);if(c9(i)&&c9(r)){try{o=new RegExp(l9(String(i._value)),r._value)}catch(s){throw new re(s)}return new Tt(pt.LITERAL_REGEX,o)}return new Tt(pt.REGEX,i,r)}if(c9(i)){try{o=new RegExp(l9(String(i._value)))}catch(r){throw new re(r)}return new Tt(pt.LITERAL_REGEX,o)}return new Tt(pt.REGEX,i)}function UFe(e){if(WFe(e.name)){let t=jFe(e.name);return t.substr(0,8)==="tiles3d_"?new Tt(pt.BUILTIN_VARIABLE,t):new Tt(pt.VARIABLE,t)}else{if(e.name==="NaN")return new Tt(pt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Tt(pt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Tt(pt.LITERAL_UNDEFINED,void 0)}throw new re(`${e.name} is not defined.`)}function zFe(e){let t=e.property.name;if(t==="PI")return new Tt(pt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Tt(pt.LITERAL_NUMBER,Math.E)}function HFe(e){if(e.property.name==="POSITIVE_INFINITY")return new Tt(pt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function GFe(e,t){if(t.object.name==="Math")return zFe(t);if(t.object.name==="Number")return HFe(t);let n,i=bi(e,t.object);return t.computed?(n=bi(e,t.property),new Tt(pt.MEMBER,"brackets",i,n)):(n=new Tt(pt.LITERAL_STRING,t.property.name),new Tt(pt.MEMBER,"dot",i,n))}function c9(e){return e._type>=pt.LITERAL_NULL}function WFe(e){return e.substr(0,4)==="czm_"}function jFe(e){return e.substr(4)}function bi(e,t){let n,i,o,r;if(t.type==="Literal")n=BFe(t);else if(t.type==="CallExpression")n=kFe(e,t);else if(t.type==="Identifier")n=UFe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=bi(e,t.argument);if(CFe.indexOf(i)>-1)n=new Tt(pt.UNARY,i,s);else throw new re(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=bi(e,t.left),r=bi(e,t.right),Fne.indexOf(i)>-1)n=new Tt(pt.BINARY,i,o,r);else throw new re(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=bi(e,t.left),r=bi(e,t.right),Fne.indexOf(i)>-1&&(n=new Tt(pt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=bi(e,t.test);o=bi(e,t.consequent),r=bi(e,t.alternate),n=new Tt(pt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=GFe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=bi(e,t.elements[a]);n=new Tt(pt.ARRAY,s)}else throw t.type==="Compound"?new re("Provide exactly one expression."):new re("Cannot parse expression.");return n}function qFe(e){e._type===pt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===pt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===pt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(PN[e._value])&&(e.evaluate=XFe(e._value)):e._type===pt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(RN[e._value])&&(e.evaluate=KFe(e._value)):e._type===pt.TERNARY?e.evaluate=ZFe(e._value):e._type===pt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===pt.ARRAY?e.evaluate=e._evaluateArray:e._type===pt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===pt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===pt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===pt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===pt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===pt.REGEX?e.evaluate=e._evaluateRegExp:e._type===pt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=YFe):e.evaluate=e._evaluateLiteral}function YFe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function XFe(e){let t=PN[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function KFe(e){let t=RN[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function ZFe(e){let t=u9[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function ON(e,t){if(l(e))return e.getPropertyInherited(t)}Tt.prototype._evaluateLiteral=function(){return this._value};Tt.prototype._evaluateLiteralColor=function(e){let t=IN,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return oe.fromColor(t,Pn.getCartesian4())};Tt.prototype._evaluateLiteralVector=function(e){let t=Pn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof U)t.push(c.x,c.y);else if(c instanceof d)t.push(c.x,c.y,c.z);else if(c instanceof oe)t.push(c.x,c.y,c.z,c.w);else throw new re(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new re(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new re(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new re(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return U.fromArray(t,0,Pn.getCartesian2());if(n==="vec3")return d.fromArray(t,0,Pn.getCartesian3());if(n==="vec4")return oe.fromArray(t,0,Pn.getCartesian4())};Tt.prototype._evaluateLiteralString=function(){return this._value};Tt.prototype._evaluateVariableString=function(e){let t=this._value,n=DN.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=ON(e,o);l(r)||(r=""),t=t.replace(i,r),n=DN.exec(t)}return t};Tt.prototype._evaluateVariable=function(e){return ON(e,this._value)};function ex(e){return e._value==="feature"}Tt.prototype._evaluateMemberDot=function(e){if(ex(this._left))return ON(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof d||t instanceof oe){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Tt.prototype._evaluateMemberBrackets=function(e){if(ex(this._left))return ON(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof d||t instanceof oe){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Tt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Tt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Tt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof U)return U.negate(t,Pn.getCartesian2());if(t instanceof d)return d.negate(t,Pn.getCartesian3());if(t instanceof oe)return oe.negate(t,Pn.getCartesian4());if(typeof t=="number")return-t;throw new re(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Tt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof U||t instanceof d||t instanceof oe||typeof t=="number"))throw new re(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Tt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Tt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Tt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Tt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new re(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Tt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new re(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Tt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new re(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new re(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Tt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.add(t,n,Pn.getCartesian2());if(n instanceof d&&t instanceof d)return d.add(t,n,Pn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.add(t,n,Pn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new re(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.subtract(t,n,Pn.getCartesian2());if(n instanceof d&&t instanceof d)return d.subtract(t,n,Pn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.subtract(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new re(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.multiplyComponents(t,n,Pn.getCartesian2());if(n instanceof U&&typeof t=="number")return U.multiplyByScalar(n,t,Pn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.multiplyByScalar(t,n,Pn.getCartesian2());if(n instanceof d&&t instanceof d)return d.multiplyComponents(t,n,Pn.getCartesian3());if(n instanceof d&&typeof t=="number")return d.multiplyByScalar(n,t,Pn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.multiplyByScalar(t,n,Pn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.multiplyComponents(t,n,Pn.getCartesian4());if(n instanceof oe&&typeof t=="number")return oe.multiplyByScalar(n,t,Pn.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.multiplyByScalar(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new re(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.divideComponents(t,n,Pn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.divideByScalar(t,n,Pn.getCartesian2());if(n instanceof d&&t instanceof d)return d.divideComponents(t,n,Pn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.divideByScalar(t,n,Pn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.divideComponents(t,n,Pn.getCartesian4());if(t instanceof oe&&typeof n=="number")return oe.divideByScalar(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new re(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.fromElements(t.x%n.x,t.y%n.y,Pn.getCartesian2());if(n instanceof d&&t instanceof d)return d.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Pn.getCartesian3());if(n instanceof oe&&t instanceof oe)return oe.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new re(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof d&&t instanceof d||n instanceof oe&&t instanceof oe?t.equals(n):t===n};Tt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof d&&t instanceof d||n instanceof oe&&t instanceof oe?!t.equals(n):t!==n};Tt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new re(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Tt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Tt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Tt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Tt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Tt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Tt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Tt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Tt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Tt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new re(o)}return i};Tt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new re(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Tt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new re(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new re(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new re(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Tt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof U||t instanceof d||t instanceof oe)return String(t);throw new re(`Unexpected function call "${this._value}".`)};function kne(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==pt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,o,r,s,IN)}function Vne(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==pt.LITERAL_NUMBER)return;let i=IN;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function r_(e){return e%1===0?e.toFixed(1):e.toString()}function $Fe(e){let t=r_(e.red),n=r_(e.green),i=r_(e.blue);return`vec3(${t}, ${n}, ${i})`}function wN(e){let t=r_(e.red),n=r_(e.green),i=r_(e.blue),o=r_(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function Une(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function zne(e,t){return l(t[e])?t[e]:_d.NULL_SENTINEL}_d.NULL_SENTINEL="czm_infinity";Tt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=Une(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=Une(this._value,e,t,this));let u,f,h;switch(a){case pt.VARIABLE:return ex(this)?void 0:zne(c,e);case pt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(PN[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new re(`Error generating style shader: "${c}" is not supported.`);return c+o;case pt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(RN[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case pt.TERNARY:if(l(u9[c]))return`${c}(${o}, ${r}, ${s})`;break;case pt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case pt.MEMBER:return ex(this._left)?zne(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case pt.FUNCTION_CALL:throw new re(`Error generating style shader: "${c}" is not supported.`);case pt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new re("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case pt.REGEX:throw new re("Error generating style shader: Regular expressions are not supported.");case pt.VARIABLE_IN_STRING:throw new re("Error generating style shader: Converting a variable to a string is not supported.");case pt.LITERAL_NULL:return _d.NULL_SENTINEL;case pt.LITERAL_BOOLEAN:return c?"true":"false";case pt.LITERAL_NUMBER:return r_(c);case pt.LITERAL_STRING:if(l(n)&&n._type===pt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||ex(n._left)))return c;if(i=z.fromCssColorString(c,IN),l(i))return $Fe(i);throw new re("Error generating style shader: String literals are not supported.");case pt.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let p=u[0],_=u[1];return _!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${_})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=Vne(this),l(i)?wN(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=Vne(this),l(i)?wN(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=kne(this),l(i)?wN(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=kne(this),l(i)?(i.alpha!==1&&(t.translucent=!0),wN(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case pt.LITERAL_VECTOR:f=o.length,h=`${c}(`;for(let p=0;p<f;++p)h+=o[p],p<f-1&&(h+=", ");return h+=")",h;case pt.LITERAL_REGEX:throw new re("Error generating style shader: Regular expressions are not supported.");case pt.LITERAL_UNDEFINED:return _d.NULL_SENTINEL;case pt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Tt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case pt.VARIABLE:ex(this)||e.push(s);break;case pt.VARIABLE_IN_STRING:for(a=DN.exec(s);a!==null;)e.push(a[1]),a=DN.exec(s);break;case pt.LITERAL_STRING:l(t)&&t._type===pt.MEMBER&&ex(t._left)&&e.push(s);break}};var yd=_d;function yp(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,d.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,kn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(yp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var QFe={position:0,a_batchId:1};function JFe(e,t){if(l(e._va))return;let n=yt.createVertexBuffer({context:t,typedArray:e._positions,usage:Fe.STATIC_DRAW}),i=yt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Fe.STATIC_DRAW}),o=yt.createIndexBuffer({context:t,typedArray:e._indices,usage:Fe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:X.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:X.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new ti({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ti({context:t,attributes:r,indexBuffer:yt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Fe.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function e2e(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,QFe),o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Ue.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() -{ - czm_non_pick_main(); - out_FragColor = ${o}; -} -`,e._spPick=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(ov),c=n.getFragmentShaderCallback(!1,void 0,!0)(V0);o=n.getPickId();let u=new Ue({sources:[a]}),f=new Ue({defines:["VECTOR_TILE"],sources:[c]});e._sp=en.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Ue({sources:[ov]}),f=new Ue({defines:["VECTOR_TILE"],sources:[V0]}),e._spStencil=en.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Ue.replaceMain(c,"czm_non_pick_main"),c=`${c} -void main() -{ - czm_non_pick_main(); - out_FragColor = ${o}; -} -`;let h=new Ue({sources:[a]}),p=new Ue({defines:["VECTOR_TILE"],sources:[c]});e._spPick=en.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i})}function Hne(e){let t=e?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:dt.KEEP,zFail:dt.DECREMENT_WRAP,zPass:dt.KEEP},backFunction:t,backOperation:{fail:dt.KEEP,zFail:dt.INCREMENT_WRAP,zPass:dt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:vc.LESS_OR_EQUAL},depthMask:!1}}var t2e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},n2e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function i2e(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(Hne(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(Hne(!0)),e._rsColorPass=Ve.fromCache(t2e),e._rsPickPass=Ve.fromCache(n2e))}var tx=new F,Gne=new d;function o2e(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return F.clone(i,tx),F.multiplyByPoint(tx,e._center,Gne),F.setTranslation(tx,Gne,tx),F.multiply(o,tx,tx),tx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function f9(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],h=s[f],p=i[h],_=o[h],m=new e.constructor(e.buffer,a*p,_);t.set(m,n),i[h]=n,n+=_}return n}function r2e(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=f9(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=f9(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let h=u;u=f9(n,s,u,i,o,f.batchIds,r),f.offset=h,f.count=u-h,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function d9(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],h=s[f],p=i[h],_=o[h];t.copyFromBuffer(e,p*a,n*a,_*a),i[h]=n,n+=_}return n}function s2e(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=d9(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let h=t.pop();if(z.equals(h.color,r.color))u=d9(a,c,u,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=u-r.offset;else{let p=u;u=d9(a,c,u,n,i,h.batchIds,o),h.offset=p,h.count=u-p,s.push(h),r=h}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function a2e(e,t){return t.color.toRgba()-e.color.toRgba()}function c2e(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(a2e),t.webgl2?s2e(e,n):r2e(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function l2e(e,t){let n=c2e(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=y(e._modelMatrix,F.IDENTITY),f=e._uniformMap,h=e._boundingVolume;for(let p=0;p<r;++p){let _=o[p].offset,m=o[p].count,x=i[p*2];l(x)||(x=i[p*2]=new $e({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=_,x.count=m,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=f,x.boundingVolume=h,x.cull=!1,x.pass=we.TERRAIN_CLASSIFICATION;let b=$e.shallowClone(x,x.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=we.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=b;let T=i[p*2+1];l(T)||(T=i[p*2+1]=new $e({owner:e})),T.vertexArray=a,T.modelMatrix=u,T.offset=_,T.count=m,T.renderState=e._rsColorPass,T.shaderProgram=c,T.uniformMap=f,T.boundingVolume=h,T.cull=!1,T.pass=we.TERRAIN_CLASSIFICATION;let C=$e.shallowClone(T,T.derivedCommands.tileset);C.pass=we.CESIUM_3D_TILE_CLASSIFICATION,T.derivedCommands.tileset=C}e._commandsDirty=!0}function u2e(e,t){if(e.classificationType===kn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let u=i[c]=$e.shallowClone(n[a],i[c]);u.shaderProgram=o,u.pass=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function f2e(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=y(e._modelMatrix,F.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],h=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new $e({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=h,p.pass=we.TERRAIN_CLASSIFICATION;let _=$e.shallowClone(p,p.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=we.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=_;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new $e({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=a,m.boundingVolume=h,m.pass=we.TERRAIN_CLASSIFICATION;let x=$e.shallowClone(m,m.derivedCommands.tileset);x.pass=we.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=x}e._pickCommandsDirty=!1}yp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new $s(e,r)}};yp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function d2e(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=z.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var h2e=new z,m2e=z.WHITE,p2e=!0,g2e=/\$/;yp.prototype.applyStyle=function(e,t){if(!l(e)){d2e(this,t);return}let n=e.color,i=n instanceof yd&&!g2e.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,h2e):m2e,c.show=l(e.show)?e.show.evaluate(c):p2e}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};yp.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let x=c[f].offset,b=c[f].count;if(s>=x&&s<x+b)break}c.push(new _p({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let h=[],p=[],_=c[f].batchIds,m=_.length;for(let x=0;x<m;++x){let b=_[x];if(b===e)continue;let T=n[b];o[T]<s?h.push(b):p.push(b)}p.length!==0&&c.push(new _p({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),h.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=h):c.splice(f,1),this._batchDirty=!0};function Wne(e,t,n,i){let o=e.classificationType,r=o!==kn.CESIUM_3D_TILE,s=o!==kn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=we.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=we.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function _2e(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=we.OPAQUE,n.push(r)}}function y2e(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Me.LINES):(n=e._rsColorPass,i=Me.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}yp.prototype.update=function(e){let t=e.context;JFe(this,t),e2e(this,t),i2e(this),o2e(this,t);let n=e.passes;n.render&&(l2e(this,t),u2e(this,e),y2e(this),this._debugWireframe?_2e(e,this._commands):Wne(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(f2e(this),Wne(this,e,this._pickCommands))};yp.prototype.isDestroyed=function(){return!1};yp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var oC=yp;function tu(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=d.clone(this._boundingVolume.center):this._center=d.clone(d.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=kn.BOTH}Object.defineProperties(tu.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});tu.packedBoxLength=F.packedLength+d.packedLength;tu.packedCylinderLength=F.packedLength+2;tu.packedEllipsoidLength=F.packedLength+d.packedLength;tu.packedSphereLength=d.packedLength+1;function x2e(e){let t=new Float64Array(F.packedLength+d.packedLength),n=0;return d.pack(e._center,t,n),n+=d.packedLength,F.pack(e._modelMatrix,t,n),t}function b2e(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=ae.unpack(t,n),n+=ae.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],h=t[n++],p=t[n++],_=new Array(p);for(let m=0;m<p;++m)_[m]=t[n++];a[c]=new _p({color:u,offset:f,count:h,batchIds:_})}return i}var T2e=new _i("createVectorTileGeometries",5),C2e=new z;function A2e(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let x=e._batchTable;for(let b=0;b<m;++b){let T=x.getColor(b,C2e);u[b]=T.toRgba()}f=e._packedBuffer=x2e(e)}let h=[];l(t)&&h.push(t.buffer,n.buffer),l(i)&&h.push(i.buffer,o.buffer),l(r)&&h.push(r.buffer,s.buffer),l(a)&&h.push(a.buffer,c.buffer),h.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},_=e._verticesPromise=T2e.scheduleTask(p,h);return l(_)?_.then(function(m){if(e.isDestroyed())return;let x=new Float64Array(m.packedBuffer);b2e(e,x)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),E2e(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function E2e(e){l(e._primitive)||(e._primitive=new oC({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}tu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};tu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};tu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};tu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};tu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=A2e(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};tu.prototype.isDestroyed=function(){return!1};tu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var s_=tu;function jh(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,w2e(this,i,o)}Object.defineProperties(jh.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function S2e(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function v2e(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),u=y(e.ELLIPSOIDS_LENGTH,0),f=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let h=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(h&&p)throw new re("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=m++;if(!l(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var nx=Uint32Array.BYTES_PER_ELEMENT;function w2e(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=nx;let r=o.getUint32(n,!0);if(r!==1)throw new re(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=nx;let s=o.getUint32(n,!0);if(n+=nx,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=nx,a===0)throw new re("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=nx;let u=o.getUint32(n,!0);n+=nx;let f=o.getUint32(n,!0);n+=nx;let h=Fo(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let _,m;u>0&&(_=Fo(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let x=y(h.BOXES_LENGTH,0),b=y(h.CYLINDERS_LENGTH,0),T=y(h.ELLIPSOIDS_LENGTH,0),C=y(h.SPHERES_LENGTH,0),A=x+b+T+C,S=new i_(e,A,_,m,S2e(e));if(e._batchTable=S,A===0)return;let v=e.tile.computedTransform,D;l(h.RTC_CENTER)&&(D=d.unpack(h.RTC_CENTER),F.multiplyByPoint(v,D,D));let O=v2e(h,p);if(x>0||b>0||T>0||C>0){let R,M,L,g;if(x>0){let E=p.byteOffset+h.BOXES.byteOffset;R=new Float32Array(p.buffer,E,s_.packedBoxLength*x)}if(b>0){let E=p.byteOffset+h.CYLINDERS.byteOffset;M=new Float32Array(p.buffer,E,s_.packedCylinderLength*b)}if(T>0){let E=p.byteOffset+h.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,E,s_.packedEllipsoidLength*T)}if(C>0){let E=p.byteOffset+h.SPHERES.byteOffset;g=new Float32Array(p.buffer,E,s_.packedSphereLength*C)}return e._geometries=new s_({boxes:R,boxBatchIds:O.boxes,cylinders:M,cylinderBatchIds:O.cylinders,ellipsoids:L,ellipsoidBatchIds:O.ellipsoids,spheres:g,sphereBatchIds:O.spheres,center:D,modelMatrix:v,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function jne(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}jh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};jh.prototype.getFeature=function(e){return jne(this),this._features[e]};jh.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};jh.prototype.applyStyle=function(e){jne(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};jh.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};jh.prototype.pick=function(e,t,n){};jh.prototype.isDestroyed=function(){return!1};jh.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var MN=jh;var h9={};h9.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),qne(i,o,r,s);return c};h9.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),qne(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function qne(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var Gv=h9;var ix=30,D2e=1<<ix,I2e=1<<ix+1>>>0,m9=2*ix+1,a_=4,Kne=[],Zne=[],P2e=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],c_=1,rC=2,LN=[c_,0,0,c_|rC];function jr(e){if(!Ht.supportsBigInt())throw new re("S2 required BigInt support");this._cellId=e,this._level=jr.getLevel(e)}jr.fromToken=function(e){return new jr(jr.getIdFromToken(e))};jr.isValidId=function(e){return!(e<=0||e>>BigInt(m9)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};jr.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?jr.isValidId(jr.getIdFromToken(e)):!1};jr.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};jr.getTokenFromId=function(e){let t=Math.floor(U2e(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};jr.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return ix-(t>>1)};jr.prototype.getChild=function(e){let t=Jne(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new jr(n)};jr.prototype.getParent=function(){let e=Jne(this._cellId)<<BigInt(2);return new jr(this._cellId&~e+BigInt(1)|e)};jr.prototype.getParentAtLevel=function(e){let t=k2e(e);return new jr(this._cellId&-t|t)};jr.prototype.getCenter=function(e){e=y(e,ee.WGS84);let t=R2e(this._cellId,this._level);t=d.normalize(t,t);let n=new fe.fromCartesian(t,ee.UNIT_SPHERE);return fe.toCartesian(n,e,new d)};jr.prototype.getVertex=function(e,t){t=y(t,ee.WGS84);let n=O2e(this._cellId,this._level,e);n=d.normalize(n,n);let i=new fe.fromCartesian(n,ee.UNIT_SPHERE);return fe.toCartesian(i,t,new d)};jr.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(m9-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new jr(a)};function R2e(e,t){let n=M2e(e,t);return L2e(n[0],n[1],n[2])}function O2e(e,t,n){let i=$ne(e,t),o=N2e([i[1],i[2]],t),r=n>>1&1;return Qne(i[0],o[0][r^n&1],o[1][r])}function M2e(e,t){let n=$ne(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function $ne(e){Kne.length===0&&B2e();let t=Number(e>>BigInt(m9)),n=t&c_,i=(1<<a_)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?ix-7*a_:a_))-1;n+=Number(e>>BigInt(s*2*a_+1)&BigInt(c))<<2,n=Zne[n];let u=s*a_;o+=n>>a_+2<<u,r+=(n>>2&i)<<u,n&=c_|rC}return[t,o,r]}function L2e(e,t,n){let i=Yne(t),o=Yne(n),r=NN(i),s=NN(o);return Qne(e,r,s)}function Qne(e,t,n){switch(e){case 0:return new d(1,t,n);case 1:return new d(-t,1,n);case 2:return new d(-t,-n,1);case 3:return new d(-1,-n,-t);case 4:return new d(n,-1,-t);default:return new d(n,t,-1)}}function NN(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Yne(e){return 1/I2e*e}function N2e(e,t){let n=[[],[]],i=F2e(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=NN(Xne(r)),n[o][1]=NN(Xne(s))}return n}function F2e(e){return 1<<ix-e>>>0}function Xne(e){return 1/D2e*e}function l_(e,t,n,i,o,r){if(e===a_){let s=(t<<a_)+n;Kne[(s<<2)+i]=(o<<2)+r,Zne[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=P2e[r];l_(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^LN[0]),l_(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^LN[1]),l_(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^LN[2]),l_(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^LN[3])}}function B2e(){l_(0,0,0,0,0,0),l_(0,0,0,c_,0,c_),l_(0,0,0,rC,0,rC),l_(0,0,0,c_|rC,0,c_|rC)}function Jne(e){return e&~e+BigInt(1)}function k2e(e){return BigInt(1)<<BigInt(2*(ix-e))}var V2e=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function U2e(e){return V2e[(-e&e)%BigInt(67)]}var u_=jr;function z2e(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var oi=z2e;function p9(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new re(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=H2e(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function H2e(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(p9.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});p9.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var Wv=p9;function xp(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(xp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});xp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};xp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};xp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};xp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};xp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};xp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};xp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var jv=xp;var FN={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};FN.getBranchingFactor=function(e){switch(e){case FN.OCTREE:return 8;case FN.QUADTREE:return 4}};var os=Object.freeze(FN);function Qs(){}Object.defineProperties(Qs.prototype,{class:{get:function(){he.throwInstantiationError()}}});Qs.prototype.hasProperty=function(e){he.throwInstantiationError()};Qs.prototype.hasPropertyBySemantic=function(e){he.throwInstantiationError()};Qs.prototype.getPropertyIds=function(e){he.throwInstantiationError()};Qs.prototype.getProperty=function(e){he.throwInstantiationError()};Qs.prototype.setProperty=function(e,t){he.throwInstantiationError()};Qs.prototype.getPropertyBySemantic=function(e){he.throwInstantiationError()};Qs.prototype.setPropertyBySemantic=function(e,t){he.throwInstantiationError()};Qs.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};Qs.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};Qs.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};Qs.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ge(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};Qs.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};Qs.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return Qs.getProperty(o.id,t,n)};Qs.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?Qs.setProperty(r.id,t,n,i):!1};var Fn=Qs;function bp(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(bp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});bp.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};bp.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};bp.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};bp.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};bp.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};bp.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};bp.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var BN=bp;var Nt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Nt.getMinimum=function(e){switch(e){case Nt.INT8:return-128;case Nt.UINT8:return 0;case Nt.INT16:return-32768;case Nt.UINT16:return 0;case Nt.INT32:return-2147483648;case Nt.UINT32:return 0;case Nt.INT64:return Ht.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Nt.UINT64:return Ht.supportsBigInt()?BigInt(0):0;case Nt.FLOAT32:return-34028234663852886e22;case Nt.FLOAT64:return-Number.MAX_VALUE}};Nt.getMaximum=function(e){switch(e){case Nt.INT8:return 127;case Nt.UINT8:return 255;case Nt.INT16:return 32767;case Nt.UINT16:return 65535;case Nt.INT32:return 2147483647;case Nt.UINT32:return 4294967295;case Nt.INT64:return Ht.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Nt.UINT64:return Ht.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Nt.FLOAT32:return 34028234663852886e22;case Nt.FLOAT64:return Number.MAX_VALUE}};Nt.isIntegerType=function(e){switch(e){case Nt.INT8:case Nt.UINT8:case Nt.INT16:case Nt.UINT16:case Nt.INT32:case Nt.UINT32:case Nt.INT64:case Nt.UINT64:return!0;default:return!1}};Nt.isUnsignedIntegerType=function(e){switch(e){case Nt.UINT8:case Nt.UINT16:case Nt.UINT32:case Nt.UINT64:return!0;default:return!1}};Nt.isVectorCompatible=function(e){switch(e){case Nt.INT8:case Nt.UINT8:case Nt.INT16:case Nt.UINT16:case Nt.INT32:case Nt.UINT32:case Nt.FLOAT32:case Nt.FLOAT64:return!0;default:return!1}};Nt.normalize=function(e,t){return Math.max(Number(e)/Number(Nt.getMaximum(t)),-1)};Nt.unnormalize=function(e,t){let n=Nt.getMaximum(t),i=Nt.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Nt.INT64||t===Nt.UINT64)&&Ht.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Nt.applyValueTransform=function(e,t,n){return n*e+t};Nt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Nt.getSizeInBytes=function(e){switch(e){case Nt.INT8:case Nt.UINT8:return 1;case Nt.INT16:case Nt.UINT16:return 2;case Nt.INT32:case Nt.UINT32:return 4;case Nt.INT64:case Nt.UINT64:return 8;case Nt.FLOAT32:return 4;case Nt.FLOAT64:return 8}};Nt.fromComponentDatatype=function(e){switch(e){case X.BYTE:return Nt.INT8;case X.UNSIGNED_BYTE:return Nt.UINT8;case X.SHORT:return Nt.INT16;case X.UNSIGNED_SHORT:return Nt.UINT16;case X.INT:return Nt.INT32;case X.UNSIGNED_INT:return Nt.UINT32;case X.FLOAT:return Nt.FLOAT32;case X.DOUBLE:return Nt.FLOAT64}};Nt.toComponentDatatype=function(e){switch(e){case Nt.INT8:return X.BYTE;case Nt.UINT8:return X.UNSIGNED_BYTE;case Nt.INT16:return X.SHORT;case Nt.UINT16:return X.UNSIGNED_SHORT;case Nt.INT32:return X.INT;case Nt.UINT32:return X.UNSIGNED_INT;case Nt.FLOAT32:return X.FLOAT;case Nt.FLOAT64:return X.DOUBLE}};var Vt=Object.freeze(Nt);var Bo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Bo.isVectorType=function(e){switch(e){case Bo.VEC2:case Bo.VEC3:case Bo.VEC4:return!0;default:return!1}};Bo.isMatrixType=function(e){switch(e){case Bo.MAT2:case Bo.MAT3:case Bo.MAT4:return!0;default:return!1}};Bo.getComponentCount=function(e){switch(e){case Bo.SCALAR:case Bo.STRING:case Bo.ENUM:case Bo.BOOLEAN:return 1;case Bo.VEC2:return 2;case Bo.VEC3:return 3;case Bo.VEC4:return 4;case Bo.MAT2:return 4;case Bo.MAT3:return 9;case Bo.MAT4:return 16}};Bo.getMathType=function(e){switch(e){case Bo.VEC2:return U;case Bo.VEC3:return d;case Bo.VEC4:return oe;case Bo.MAT2:return Pi;case Bo.MAT3:return $;case Bo.MAT4:return F;default:return}};var lt=Object.freeze(Bo);function Ca(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&Vt.isIntegerType(i)&&y(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=Ge(e.min,!0),this._max=Ge(e.max,!0),this._normalized=r;let s=Ge(e.offset,!0),a=Ge(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ge(e.noData,!0),this._default=Ge(e.default,!0),this._required=y(e.required,!0),this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}Ca.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=G2e(n),o=W2e(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=y(n.required,!1):r=!1,new Ca({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(Ca.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function G2e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===lt.SCALAR||lt.isMatrixType(t)||lt.isVectorType(t))return!1;if(l(Vt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function W2e(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===lt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===lt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===lt.SCALAR||lt.isMatrixType(n)||lt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===lt.BOOLEAN||n===lt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===lt.BOOLEAN||i===lt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Vt[i]))return{type:lt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(Vt[n]))return{type:lt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}Ca.prototype.normalize=function(e){return this._normalized?g9(e,this._valueType,Vt.normalize):e};Ca.prototype.unnormalize=function(e){return this._normalized?g9(e,this._valueType,Vt.unnormalize):e};Ca.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ca.valueTransformInPlace(e,this._offset,this._scale,Vt.applyValueTransform)};Ca.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ca.valueTransformInPlace(e,this._offset,this._scale,Vt.unapplyValueTransform)};Ca.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,o=lt.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};Ca.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!iie(e,t))return e};function iie(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!iie(e[n],t[n]))return!1;return!0}Ca.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=lt.getMathType(this._type),i=this._isArray,o=lt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Ca.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=lt.getMathType(this._type),i=this._isArray,o=lt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Ca.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?j2e(this,e):oie(this,e)};function j2e(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=oie(e,t[i]);if(l(o))return o}}function oie(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return lt.isVectorType(n)?q2e(t,n,i):lt.isMatrixType(n)?Y2e(t,n,i):n===lt.STRING?X2e(t):n===lt.BOOLEAN?K2e(t):n===lt.ENUM?Z2e(t,o):$2e(t,i,r)}function q2e(e,t,n){if(!Vt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===lt.VEC2&&!(e instanceof U))return`vector value ${e} must be a Cartesian2`;if(t===lt.VEC3&&!(e instanceof d))return`vector value ${e} must be a Cartesian3`;if(t===lt.VEC4&&!(e instanceof oe))return`vector value ${e} must be a Cartesian4`}function Y2e(e,t,n){if(!Vt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===lt.MAT2&&!(e instanceof Pi))return`matrix value ${e} must be a Matrix2`;if(t===lt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===lt.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function X2e(e){if(typeof e!="string")return kN(e,lt.STRING)}function K2e(e){if(typeof e!="boolean")return kN(e,lt.BOOLEAN)}function Z2e(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function $2e(e,t,n){let i=typeof e;switch(t){case Vt.INT8:case Vt.UINT8:case Vt.INT16:case Vt.UINT16:case Vt.INT32:case Vt.UINT32:case Vt.FLOAT32:case Vt.FLOAT64:return i!=="number"?kN(e,t):isFinite(e)?tie(e,t,n):nie(e,t);case Vt.INT64:case Vt.UINT64:return i!=="number"&&i!=="bigint"?kN(e,t):i==="number"&&!isFinite(e)?nie(e,t):tie(e,t,n)}}function kN(e,t){return`value ${e} does not match type ${t}`}function eie(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function tie(e,t,n){if(n){let i=Vt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?eie(e,t,n):void 0}if(e<Vt.getMinimum(t)||e>Vt.getMaximum(t))return eie(e,t,n)}function nie(e,t){return`value ${e} of type ${t} must be finite`}function g9(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=g9(e[i],t,n);return e}Ca.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=Ca.valueTransformInPlace(e[o],t[o],n[o],i);return e};var Tp=Ca;function qv(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=r===lt.STRING,h=r===lt.BOOLEAN,p=0,_;if(a){let g=y(n.arrayOffsetType,n.offsetType);g=y(Vt[g],Vt.UINT32);let E=y(n.arrayOffsets,n.arrayOffsetBufferView);_=new _9(o[E],g,t+1),p+=_.typedArray.byteLength}let m=lt.getComponentCount(r),x;a?x=_.get(t)-_.get(0):s?x=t*i.arrayLength:x=t;let b=m*x,T;if(f){let g=y(n.stringOffsetType,n.offsetType);g=y(Vt[g],Vt.UINT32);let E=y(n.stringOffsets,n.stringOffsetBufferView);T=new _9(o[E],g,b+1),p+=T.typedArray.byteLength}(f||h)&&(c=Vt.UINT8);let C;f?C=T.get(b)-T.get(0):h?C=Math.ceil(b/8):C=b;let A=y(n.values,n.bufferView),S=new _9(o[A],c,C);p+=S.typedArray.byteLength;let v=n.offset,D=n.scale,O=i.hasValueTransform||l(v)||l(D);v=y(v,i.offset),D=y(D,i.scale),v=rie(v),D=rie(D);let R,M,L=this;f?R=function(g){return eBe(g,L._values,L._stringOffsets)}:h?(R=function(g){return tBe(g,L._values)},M=function(g,E){nBe(g,L._values,E)}):l(u)?(R=function(g){let E=L._values.get(g);return u.namesByValue[E]},M=function(g,E){let w=u.valuesByName[E];L._values.set(g,w)}):(R=function(g){return L._values.get(g)},M=function(g,E){L._values.set(g,E)}),this._arrayOffsets=_,this._stringOffsets=T,this._values=S,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=D,this._hasValueTransform=O,this._getValue=R,this._setValue=M,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(qv.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});qv.prototype.get=function(e){let t=Q2e(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=uBe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};qv.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=fBe(this,t),t=n.unnormalize(t),J2e(this,e,t)};qv.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function rie(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function Q2e(e,t){aie(e)&&cie(e);let n=e._classProperty,i=n.isArray,o=n.type,r=lt.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ge(s,!0):s}return!i&&r===1?e._getValue(t):sie(e,n,t)}function sie(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=lt.getComponentCount(t.type);i*=s,o*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function J2e(e,t,n){cBe(e,t,n)&&cie(e);let i=e._classProperty,o=i.isArray,r=i.type,s=lt.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Ge(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=y(i.arrayLength,1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function eBe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Jl(t.typedArray,i,o)}function tBe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function nBe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function iBe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function oBe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function rBe(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function sBe(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function aBe(e){switch(e){case Vt.INT8:return X.BYTE;case Vt.UINT8:return X.UNSIGNED_BYTE;case Vt.INT16:return X.SHORT;case Vt.UINT16:return X.UNSIGNED_SHORT;case Vt.INT32:return X.INT;case Vt.UINT32:return X.UNSIGNED_INT;case Vt.FLOAT32:return X.FLOAT;case Vt.FLOAT64:return X.DOUBLE}}function aie(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===lt.STRING||i===Vt.INT64&&!Ht.supportsBigInt64Array()||i===Vt.UINT64&&!Ht.supportsBigUint64Array()}function cBe(e,t,n){if(aie(e))return!0;let i=e._arrayOffsets;if(l(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function cie(e){e._unpackedValues=lBe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function lBe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=lt.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=sie(e,i,a);return n}function uBe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Tp.valueTransformInPlace(t,e._offset,e._scale,Vt.applyValueTransform)}function fBe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Tp.valueTransformInPlace(t,e._offset,e._scale,Vt.unapplyValueTransform)}function _9(e,t,n){let i=this,o,r,s;if(t===Vt.INT64)Ht.supportsBigInt()?Ht.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return oBe(a,i)}):(xt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return iBe(a,i)});else if(t===Vt.UINT64)Ht.supportsBigInt()?Ht.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return sBe(a,i)}):(xt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return rBe(a,i)});else{let a=aBe(t);o=X.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var VN=qv;function xd(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new VN({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(xd.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});xd.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};xd.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};xd.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};xd.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=dBe(this._class,t),i};xd.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};xd.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};xd.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return l(o)&&(i=o[t]),l(i)?this.setProperty(e,i.id,n):!1};xd.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};xd.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function dBe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let o=i.default;return i.isArray&&(o=Ge(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var nu=xd;function f_(){}Object.defineProperties(f_.prototype,{cacheKey:{get:function(){he.throwInstantiationError()}}});f_.prototype.load=function(){he.throwInstantiationError()};f_.prototype.unload=function(){};f_.prototype.process=function(e){return!1};f_.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=` -${t.message}`);let n=new re(e);return l(t)&&(n.stack=`Original stack: -${t.stack} -Handler stack: -${n.stack}`),n};f_.prototype.isDestroyed=function(){return!1};f_.prototype.destroy=function(){return this.unload(),ue(this)};var Ki=f_;var hBe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},gt=Object.freeze(hBe);function Cp(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Cp.prototype=Object.create(Ki.prototype),Cp.prototype.constructor=Cp);Object.defineProperties(Cp.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Cp.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=mBe(this),this._promise)};async function mBe(e){let t=e._resource;e._state=gt.LOADING;try{let n=await Cp._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Cp._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Cp.prototype.unload=function(){this._typedArray=void 0};var sC=Cp;var GJt=function(){var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G:Qdkr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79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heaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbba:vbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(_){n=_.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(_){for(var m=new Uint8Array(_.length),x=0;x<_.length;++x){var b=_.charCodeAt(x);m[x]=b>96?b-97:b>64?b-39:b+4}for(var T=0,x=0;x<_.length;++x)m[T++]=m[x]<60?t[m[x]]:(m[x]-60)*64+m[++x];return m.buffer.slice(0,T)}function r(_){if(!_)throw new Error("Assertion failed")}function s(_){return new Uint8Array(_.buffer,_.byteOffset,_.byteLength)}function a(_,m,x,b){var T=n.exports.sbrk,C=T(m.length*4),A=T(x*4),S=new Uint8Array(n.exports.memory.buffer),v=s(m);S.set(v,C),b&&b(C,C,m.length,x);var D=_(A,C,m.length,x);S=new Uint8Array(n.exports.memory.buffer);var O=new Uint32Array(x);new Uint8Array(O.buffer).set(S.subarray(A,A+x*4)),v.set(S.subarray(C,C+m.length*4)),T(C-T(0));for(var R=0;R<m.length;++R)m[R]=O[m[R]];return[O,D]}function c(_,m,x,b){var T=n.exports.sbrk,C=T(x*4),A=T(x*b),S=new Uint8Array(n.exports.memory.buffer);S.set(s(m),A),_(C,A,x,b),S=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(x);return new Uint8Array(v.buffer).set(S.subarray(C,C+x*4)),T(C-T(0)),v}function u(_,m,x,b,T){var C=n.exports.sbrk,A=C(m),S=C(b*T),v=new Uint8Array(n.exports.memory.buffer);v.set(s(x),S);var D=_(A,m,S,b,T),O=new Uint8Array(D);return O.set(v.subarray(A,A+D)),C(A-C(0)),O}function f(_){for(var m=0,x=0;x<_.length;++x){var b=_[x];m=m<b?b:m}return m}function h(_,m){if(r(m==2||m==4),m==4)return new Uint32Array(_.buffer,_.byteOffset,_.byteLength/4);var x=new Uint16Array(_.buffer,_.byteOffset,_.byteLength/2);return new Uint32Array(x)}function p(_,m,x,b,T,C,A){var S=n.exports.sbrk,v=S(x*b),D=S(x*C),O=new Uint8Array(n.exports.memory.buffer);O.set(s(m),D),_(v,x,b,T,D,A);var R=new Uint8Array(x*b);return R.set(O.subarray(v,v+x*b)),S(v-S(0)),R}return{ready:i,supported:!0,reorderMesh:function(_,m,x){var b=m?x?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,_,f(_)+1,b)},reorderPoints:function(_,m){return r(_ instanceof Float32Array),r(_.length%m==0),r(m>=3),c(n.exports.meshopt_spatialSortRemap,_,_.length/m,m*4)},encodeVertexBuffer:function(_,m,x){r(x>0&&x<=256),r(x%4==0);var b=n.exports.meshopt_encodeVertexBufferBound(m,x);return u(n.exports.meshopt_encodeVertexBuffer,b,_,m,x)},encodeIndexBuffer:function(_,m,x){r(x==2||x==4),r(m%3==0);var b=h(_,x),T=n.exports.meshopt_encodeIndexBufferBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexBuffer,T,b,m,4)},encodeIndexSequence:function(_,m,x){r(x==2||x==4);var b=h(_,x),T=n.exports.meshopt_encodeIndexSequenceBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexSequence,T,b,m,4)},encodeGltfBuffer:function(_,m,x,b){var T={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(T[b]),T[b](_,m,x)},encodeFilterOct:function(_,m,x,b){return r(x==4||x==8),r(b>=1&&b<=16),p(n.exports.meshopt_encodeFilterOct,_,m,x,b,16)},encodeFilterQuat:function(_,m,x,b){return r(x==8),r(b>=4&&b<=16),p(n.exports.meshopt_encodeFilterQuat,_,m,x,b,16)},encodeFilterExp:function(_,m,x,b,T){r(x>0&&x%4==0),r(b>=1&&b<=24);var C={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,_,m,x,b,x,T?C[T]:1)}}}();var lie=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOi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:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(T){r=T.instance,r.exports.__wasm_call_ctors()});function a(T){for(var C=new Uint8Array(T.length),A=0;A<T.length;++A){var S=T.charCodeAt(A);C[A]=S>96?S-97:S>64?S-39:S+4}for(var v=0,A=0;A<T.length;++A)C[v++]=C[A]<60?i[C[A]]:(C[A]-60)*64+C[++A];return C.buffer.slice(0,v)}function c(T,C,A,S,v,D,O){var R=T.exports.sbrk,M=S+3&-4,L=R(M*v),g=R(D.length),E=new Uint8Array(T.exports.memory.buffer);E.set(D,g);var w=C(L,S,v,g,D.length);if(w==0&&O&&O(L,M,v),A.set(E.subarray(L,L+S*v)),R(L-R(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function _(T){var C={object:new Worker(T),pending:0,requests:{}};return C.object.onmessage=function(A){var S=A.data;C.pending-=S.count,C.requests[S.id][S.action](S.value),delete C.requests[S.id]},C}function m(T){for(var C="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+b.name+";"+c.toString()+b.toString(),A=new Blob([C],{type:"text/javascript"}),S=URL.createObjectURL(A),v=h.length;v<T;++v)h[v]=_(S);for(var v=T;v<h.length;++v)h[v].object.postMessage({});h.length=T,URL.revokeObjectURL(S)}function x(T,C,A,S,v){for(var D=h[0],O=1;O<h.length;++O)h[O].pending<D.pending&&(D=h[O]);return new Promise(function(R,M){var L=new Uint8Array(A),g=++p;D.pending+=T,D.requests[g]={resolve:R,reject:M},D.object.postMessage({id:g,count:T,size:C,source:L,mode:S,filter:v},[L.buffer])})}function b(T){var C=T.data;if(!C.id)return self.close();self.ready.then(function(A){try{var S=new Uint8Array(C.count*C.size);c(A,A.exports[C.mode],S,C.count,C.size,C.source,A.exports[C.filter]),self.postMessage({id:C.id,count:C.count,action:"resolve",value:S},[S.buffer])}catch(v){self.postMessage({id:C.id,count:C.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(T){m(T)},decodeVertexBuffer:function(T,C,A,S,v){c(r,r.exports.meshopt_decodeVertexBuffer,T,C,A,S,r.exports[u[v]])},decodeIndexBuffer:function(T,C,A,S){c(r,r.exports.meshopt_decodeIndexBuffer,T,C,A,S)},decodeIndexSequence:function(T,C,A,S){c(r,r.exports.meshopt_decodeIndexSequence,T,C,A,S)},decodeGltfBuffer:function(T,C,A,S,v,D){c(r,r.exports[f[v]],T,C,A,S,r.exports[u[D]])},decodeGltfBufferAsync:function(T,C,A,S,v){return h.length>0?x(T,C,A,f[S],u[v]):s.then(function(){var D=new Uint8Array(T*C);return c(r,r.exports[f[S]],D,T,C,A,r.exports[u[v]]),D})}}}();var qJt=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd;S1jjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgYcx2fgeIdbaaaHydbgKcx2fgOIdbg8P:tgIaaaHcwfydbgLcx2fgCIdlaOIdlg8R:tg8SNaCIdba8P:tgRaeIdla8R:tg8UN:tg8Va8VNa8UaCIdwaOIdwg8W:tg8XNa8SaeIdwa8W:tg8UN:tg8Sa8SNa8UaRNa8XaIN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaKcdtfydbc8S2fgea8SaR:rgRa8SNNg8UaeIdbMUdbaeaIaRaINg8YNg8XaeIdlMUdlaea8VaRa8VNg8ZNg80aeIdwMUdwaea8Ya8SNg8YaeIdxMUdxaea8Za8SNg81aeIdzMUdzaea8ZaINg8ZaeIdCMUdCaea8SaRa8Va8WNa8Sa8PNa8RaINMM:mg8RNg8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gOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nmba8Lcj1jjbfRbbcFeGmekaAcufhYdnaAaL9hmbaYcFeGce0mbahaifydbaH9hmekdndnaAclSmbaLcl9hmekdnaYcFeGce0mbahaifydbaH9hmdkaLcufcFeGce0mbagawfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgYEBdlaA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BaBa8S9DEhBkaKa9ifhKaicefgial9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var x=new Uint8Array(m.length),b=0;b<m.length;++b){var T=m.charCodeAt(b);x[b]=T>96?T-97:T>64?T-39:T+4}for(var C=0,b=0;b<m.length;++b)x[C++]=x[b]<60?t[x[b]]:(x[b]-60)*64+x[++b];return x.buffer.slice(0,C)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}function a(m,x,b){var T=n.exports.sbrk,C=T(x.length*4),A=T(b*4),S=new Uint8Array(n.exports.memory.buffer),v=s(x);S.set(v,C);var D=m(A,C,x.length,b);S=new Uint8Array(n.exports.memory.buffer);var O=new Uint32Array(b);new Uint8Array(O.buffer).set(S.subarray(A,A+b*4)),v.set(S.subarray(C,C+x.length*4)),T(C-T(0));for(var R=0;R<x.length;++R)x[R]=O[x[R]];return[O,D]}function c(m){for(var x=0,b=0;b<m.length;++b){var T=m[b];x=x<T?T:x}return x}function u(m,x,b,T,C,A,S,v,D){var O=n.exports.sbrk,R=O(4),M=O(b*4),L=O(C*A),g=O(b*4),E=new Uint8Array(n.exports.memory.buffer);E.set(s(T),L),E.set(s(x),g);var w=m(M,g,b,L,C,A,S,v,D,R);E=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(w);s(I).set(E.subarray(M,M+w*4));var N=new Float32Array(1);return s(N).set(E.subarray(R,R+4)),O(R-O(0)),[I,N[0]]}function f(m,x,b,T,C,A,S,v,D,O,R,M,L){var g=n.exports.sbrk,E=g(4),w=g(b*4),I=g(C*A),N=g(C*v),B=g(D.length*4),H=g(b*4),V=O?g(C):0,G=new Uint8Array(n.exports.memory.buffer);G.set(s(T),I),G.set(s(S),N),G.set(s(D),B),G.set(s(x),H),O&&G.set(s(O),V);var k=m(w,H,b,I,C,A,N,v,B,D.length,V,R,M,L,E);G=new Uint8Array(n.exports.memory.buffer);var W=new Uint32Array(k);s(W).set(G.subarray(w,w+k*4));var Y=new Float32Array(1);return s(Y).set(G.subarray(E,E+4)),g(E-g(0)),[W,Y[0]]}function h(m,x,b,T){var C=n.exports.sbrk,A=C(b*T),S=new Uint8Array(n.exports.memory.buffer);S.set(s(x),A);var v=m(A,b,T);return C(A-C(0)),v}function p(m,x,b,T,C,A,S,v){var D=n.exports.sbrk,O=D(v*4),R=D(b*T),M=D(b*A),L=new Uint8Array(n.exports.memory.buffer);L.set(s(x),R),C&&L.set(s(C),M);var g=m(O,R,b,T,M,A,S,v);L=new Uint8Array(n.exports.memory.buffer);var E=new Uint32Array(g);return s(E).set(L.subarray(O,O+g*4)),D(O-D(0)),E}var _={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(m){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0);var x=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return a(n.exports.meshopt_optimizeVertexFetchRemap,x,c(m)+1)},simplify:function(m,x,b,T,C,A){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T>=0&&T<=m.length),r(T%3==0),r(C>=0);for(var S=0,v=0;v<(A?A.length:0);++v)r(A[v]in _),r(this.useExperimentalFeatures||A[v]!="Prune"),S|=_[A[v]];var D=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),O=u(n.exports.meshopt_simplify,D,m.length,x,x.length/b,b*4,T,C,S);return O[0]=m instanceof Uint32Array?O[0]:new m.constructor(O[0]),O},simplifyWithAttributes:function(m,x,b,T,C,A,S,v,D,O){r(this.useExperimentalFeatures),r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T instanceof Float32Array),r(T.length%C==0),r(C>=0),r(S==null||S instanceof Uint8Array),r(S==null||S.length==x.length/b),r(v>=0&&v<=m.length),r(v%3==0),r(D>=0),r(Array.isArray(A)),r(C>=A.length),r(A.length<=32);for(var R=0;R<A.length;++R)r(A[R]>=0);for(var M=0,R=0;R<(O?O.length:0);++R)r(O[R]in _),M|=_[O[R]];var L=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),g=f(n.exports.meshopt_simplifyWithAttributes,L,m.length,x,x.length/b,b*4,T,C*4,new Float32Array(A),S?new Uint8Array(S):null,v,D,M);return g[0]=m instanceof Uint32Array?g[0]:new m.constructor(g[0]),g},getScale:function(m,x){return r(m instanceof Float32Array),r(m.length%x==0),r(x>=3),h(n.exports.meshopt_simplifyScale,m,m.length/x,x*4)},simplifyPoints:function(m,x,b,T,C,A){return r(this.useExperimentalFeatures),r(m instanceof Float32Array),r(m.length%x==0),r(x>=3),r(b>=0&&b<=m.length/x),T?(r(T instanceof Float32Array),r(T.length%C==0),r(C>=3),r(m.length/x==T.length/C),p(n.exports.meshopt_simplifyPoints,m,m.length/x,x*4,T,C*4,A,b)):p(n.exports.meshopt_simplifyPoints,m,m.length/x,x*4,void 0,0,0,b)}}}();var XJt=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjj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w9nmdkaQaAcbaeaiakc;abfaKamara8MJbbbbz:ejjjbgCcu9hmekakaaUdCakahUdzaka8JUdxakcuBdwakcFFF;7rBdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var x=new Uint8Array(m.length),b=0;b<m.length;++b){var T=m.charCodeAt(b);x[b]=T>96?T-97:T>64?T-39:T+4}for(var C=0,b=0;b<m.length;++b)x[C++]=x[b]<60?t[x[b]]:(x[b]-60)*64+x[++b];return x.buffer.slice(0,C)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}var a=48,c=16;function u(m,x){var b=m.meshlets[x*4+0],T=m.meshlets[x*4+1],C=m.meshlets[x*4+2],A=m.meshlets[x*4+3];return{vertices:m.vertices.subarray(b,b+C),triangles:m.triangles.subarray(T,T+A*3)}}function f(m,x,b,T,C,A,S){var v=n.exports.sbrk,D=n.exports.meshopt_buildMeshletsBound(m.length,C,A),O=v(D*c),R=v(D*C*4),M=v(D*A*3),L=v(m.byteLength),g=v(x.byteLength),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),L),E.set(s(x),g);var w=n.exports.meshopt_buildMeshlets(O,R,M,L,m.length,g,b,T,C,A,S);E=new Uint8Array(n.exports.memory.buffer);for(var I=E.subarray(O,O+w*c),N=new Uint32Array(I.buffer,I.byteOffset,I.byteLength/4).slice(),B=0;B<w;++B){var H=N[B*4+0],V=N[B*4+1],b=N[B*4+2],G=N[B*4+3];n.exports.meshopt_optimizeMeshlet(R+H*4,M+V,G,b)}var k=N[(w-1)*4+0],W=N[(w-1)*4+1],Y=N[(w-1)*4+2],J=N[(w-1)*4+3],j=k+Y,K=W+(J*3+3&-4),Q={meshlets:N,vertices:new Uint32Array(E.buffer,R,j).slice(),triangles:new Uint8Array(E.buffer,M,K*3).slice(),meshletCount:w};return v(O-v(0)),Q}function h(m){var x=new Float32Array(n.exports.memory.buffer,m,a/4);return{centerX:x[0],centerY:x[1],centerZ:x[2],radius:x[3],coneApexX:x[4],coneApexY:x[5],coneApexZ:x[6],coneAxisX:x[7],coneAxisY:x[8],coneAxisZ:x[9],coneCutoff:x[10]}}function p(m,x,b,T){var C=n.exports.sbrk,A=[],S=C(x.byteLength),v=C(m.vertices.byteLength),D=C(m.triangles.byteLength),O=C(a),R=new Uint8Array(n.exports.memory.buffer);R.set(s(x),S),R.set(s(m.vertices),v),R.set(s(m.triangles),D);for(var M=0;M<m.meshletCount;++M){var L=m.meshlets[M*4+0],g=m.meshlets[M*4+0+1],E=m.meshlets[M*4+0+3];n.exports.meshopt_computeMeshletBounds(O,v+L*4,D+g,E,S,b,T),A.push(h(O))}return C(S-C(0)),A}function _(m,x,b,T){var C=n.exports.sbrk,A=C(a),S=C(m.byteLength),v=C(x.byteLength),D=new Uint8Array(n.exports.memory.buffer);D.set(s(m),S),D.set(s(x),v),n.exports.meshopt_computeClusterBounds(A,S,m.length,v,b,T);var O=h(A);return C(A-C(0)),O}return{ready:i,supported:!0,buildMeshlets:function(m,x,b,T,C,A){r(m.length%3==0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),r(T<=255||T>0),r(C<=512),r(C%4==0),A=A||0;var S=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return f(S,x,x.length/b,b*4,T,C,A)},computeClusterBounds:function(m,x,b){r(m.length%3==0),r(m.length/3<=512),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3);var T=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return _(T,x,x.length/b,b*4)},computeMeshletBounds:function(m,x,b){return r(m.meshletCount!=0),r(x instanceof Float32Array),r(x.length%b==0),r(b>=3),p(m,x,x.length/b,b*4)},extractMeshlet:function(m,x){return r(x>=0&&x<m.meshletCount),u(m,x)}}}();function ox(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,u=a.byteOffset,f=a.byteLength,h=!1,p,_,m,x;if(oi(a,"EXT_meshopt_compression")){let T=a.extensions.EXT_meshopt_compression;c=T.buffer,u=y(T.byteOffset,0),f=T.byteLength,h=!0,p=T.byteStride,_=T.count,m=T.mode,x=y(T.filter,"NONE")}let b=n.buffers[c];this._hasMeshopt=h,this._meshoptByteStride=p,this._meshoptCount=_,this._meshoptMode=m,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=b,this._bufferId=c,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(ox.prototype=Object.create(Ki.prototype),ox.prototype.constructor=ox);Object.defineProperties(ox.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function pBe(e){try{let t=gBe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);lie.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=gt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load buffer view",t)}}ox.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=pBe(this),this._promise)};function gBe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}ox.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var Yv=ox;function Pr(){}Pr._maxDecodingConcurrency=Math.max(Ht.hardwareConcurrency-1,1);Pr._decoderTaskProcessor=void 0;Pr._taskProcessorReady=!1;Pr._error=void 0;Pr._getDecoderTaskProcessor=function(){if(!l(Pr._decoderTaskProcessor)){let e=new _i("decodeDraco",Pr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?Pr._taskProcessorReady=!0:Pr._error=new re("Draco decoder could not be initialized.")}).catch(t=>{Pr._error=t}),Pr._decoderTaskProcessor=e}return Pr._decoderTaskProcessor};Pr.decodePointCloud=function(e){let t=Pr._getDecoderTaskProcessor();if(l(Pr._error))throw Pr._error;if(Pr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Pr.decodeBufferView=function(e){let t=Pr._getDecoderTaskProcessor();if(l(Pr._error))throw Pr._error;if(Pr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var d_=Pr;function h_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=gt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(h_.prototype=Object.create(Ki.prototype),h_.prototype.constructor=h_);Object.defineProperties(h_.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function _Be(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;uie(e,n)}}h_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=_Be(this),this._promise)};function uie(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load Draco",t)}async function yBe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}h_.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(l(this._dracoError)&&uie(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=d_.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=yBe(this,c)};h_.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var Xv=h_;function xBe(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Se.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Se.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Se({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var aC=xBe;function Ap(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Ap.prototype=Object.create(Ki.prototype),Ap.prototype.constructor=Ap);Object.defineProperties(Ap.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Ap.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=bBe(this),this._promise):(this._promise=TBe(this),this._promise)};function fie(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function bBe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await ABe(i);if(e.isDestroyed())return;let r=fie(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(n){return e.isDestroyed()?void 0:die(e,n,"Failed to load embedded image")}}async function TBe(e){e._state=gt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await SBe(i);if(e.isDestroyed())return;let r=fie(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(o){return e.isDestroyed()?void 0:die(e,o,`Failed to load image: ${n}`)}}function die(e,t,n){return e.unload(),e._state=gt.FAILED,Promise.reject(e.getError(n,t))}function CBe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new re("Image format is not recognized")}async function ABe(e){let t=CBe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Wl(n)}return Ap._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var EBe=/(^data:image\/ktx2)|(\.ktx2$)/i;function SBe(e){let t=e.getUrlComponent(!1,!0);return EBe.test(t)?Wl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Ap.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Ap._loadImageFromTypedArray=aC;var Kv=Ap;var vBe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Za=Object.freeze(vBe);function m_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),u=y(e.loadBuffer,!1),f=y(e.loadTypedArray,!1),h=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=h,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(m_.prototype=Object.create(Ki.prototype),m_.prototype.constructor=m_);Object.defineProperties(m_.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var wBe=new x9;m_.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=DBe(this),this._promise):(this._promise=IBe(this),this._promise)};async function DBe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;y9(e,n)}}async function IBe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=gt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=PBe(e,a),e._state=gt.PROCESSING,e}catch(s){if(e.isDestroyed())return;y9(e,s)}}function PBe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ne.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let h=r*a,p=new Uint8Array(c,u,h);c=new Uint8Array(p).buffer,u=0,_s("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Ne.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):s===Ne.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):s===Ne.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function y9(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load index buffer",t)}function x9(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}x9.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};x9.prototype.execute=function(){this.buffer=hie(this.typedArray,this.indexDatatype,this.context)};function hie(e,t,n){let i=yt.createIndexBuffer({typedArray:e,context:n,usage:Fe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}m_.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=X.fromTypedArray(t),this._indexDatatype=n)}catch(o){y9(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=wBe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Za.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=hie(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};m_.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var Zv=m_;function RBe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Fs=RBe;function OBe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var mr=OBe;function qt(){}qt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};qt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(l(r))return r}}};qt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?qt.objectLegacy(i,n):qt.object(i,n)};qt.accessor=function(e,t){return qt.topLevel(e,"accessors",t)};qt.accessorWithSemantic=function(e,t,n){let i={};return qt.mesh(e,function(o){return qt.meshPrimitive(o,function(r){let s=qt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:qt.meshPrimitiveTarget(r,function(a){return qt.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};qt.accessorContainingVertexAttributeData=function(e,t){let n={};return qt.mesh(e,function(i){return qt.meshPrimitive(i,function(o){let r=qt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:qt.meshPrimitiveTarget(o,function(s){return qt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};qt.accessorContainingIndexData=function(e,t){let n={};return qt.mesh(e,function(i){return qt.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let s=t(r);if(l(s))return s}})})};qt.animation=function(e,t){return qt.topLevel(e,"animations",t)};qt.animationChannel=function(e,t){let n=e.channels;return qt.object(n,t)};qt.animationSampler=function(e,t){let n=e.samplers;return qt.object(n,t)};qt.buffer=function(e,t){return qt.topLevel(e,"buffers",t)};qt.bufferView=function(e,t){return qt.topLevel(e,"bufferViews",t)};qt.camera=function(e,t){return qt.topLevel(e,"cameras",t)};qt.image=function(e,t){return qt.topLevel(e,"images",t)};qt.material=function(e,t){return qt.topLevel(e,"materials",t)};qt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};qt.mesh=function(e,t){return qt.topLevel(e,"meshes",t)};qt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(l(s))return s}}};qt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};qt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(l(r))return r}}};qt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};qt.node=function(e,t){return qt.topLevel(e,"nodes",t)};qt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=qt.nodeInTree(e,u,n),l(c)))return c}}}};qt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return qt.nodeInTree(e,i,n)};qt.program=function(e,t){return mr(e,"KHR_techniques_webgl")?qt.object(e.extensions.KHR_techniques_webgl.programs,t):qt.topLevel(e,"programs",t)};qt.sampler=function(e,t){return qt.topLevel(e,"samplers",t)};qt.scene=function(e,t){return qt.topLevel(e,"scenes",t)};qt.shader=function(e,t){return mr(e,"KHR_techniques_webgl")?qt.object(e.extensions.KHR_techniques_webgl.shaders,t):qt.topLevel(e,"shaders",t)};qt.skin=function(e,t){return qt.topLevel(e,"skins",t)};qt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(l(s))return s}}};qt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};qt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};qt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};qt.technique=function(e,t){return mr(e,"KHR_techniques_webgl")?qt.object(e.extensions.KHR_techniques_webgl.techniques,t):qt.topLevel(e,"techniques",t)};qt.texture=function(e,t){return qt.topLevel(e,"textures",t)};var Pe=qt;function MBe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var ff=MBe;function LBe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return X.getSizeInBytes(t.componentType)*ff(t.type)}var iu=LBe;function NBe(e){Pe.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Pe.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){if(i.mode=y(i.mode,te.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Fs(e.materials,o)}})}),Pe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=iu(e,i),r.target=te.ARRAY_BUFFER}}),Pe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=te.ELEMENT_ARRAY_BUFFER}}),Pe.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=y(u.transparency,1),c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=y(u.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&Pe.materialValue(n,function(c){l(c.index)&&rx(c)}),rx(n.emissiveTexture),rx(n.normalTexture),rx(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),rx(s.baseColorTexture),rx(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),rx(a.specularGlossinessTexture))}),Pe.animation(e,function(n){Pe.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=FBe(e);return Pe.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Pe.sampler(e,function(n){n.wrapS=y(n.wrapS,te.REPEAT),n.wrapT=y(n.wrapT,te.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function FBe(e){let t={};return Pe.animation(e,function(n){Pe.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function rx(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var UN=NBe;function BBe(e){return Pe.shader(e,function(t){zN(t)}),Pe.buffer(e,function(t){zN(t)}),Pe.image(e,function(t){zN(t)}),zN(e),e}function zN(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var sx=BBe;function kBe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var HN=kBe;function VBe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),HN(e,t),n.length===0&&delete e.extensionsUsed}}var cC=VBe;var UBe=4;function zBe(e){if(Wh(e)!=="glTF")throw new re("File is not valid binary glTF");let n=mie(e,0,5),i=n[1];if(i!==1&&i!==2)throw new re("Binary glTF version is not 1 or 2");return i===1?HBe(e,n):GBe(e,n)}function mie(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*UBe,!0);return o}function HBe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new re("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Jl(e,r,i),c=JSON.parse(a);sx(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let h=y(f.binary_glTF,f.KHR_binary_glTF);l(h)&&(h.extras._pipeline.source=u,delete h.uri)}return cC(c,"KHR_binary_glTF"),c}function GBe(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=mie(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=Jl(u);o=JSON.parse(f),sx(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var GN=zBe;function WBe(e){return Pe.shader(e,function(t){WN(t)}),Pe.buffer(e,function(t){WN(t)}),Pe.image(e,function(t){WN(t)}),WN(e),e}function WN(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var jN=WBe;function jBe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Fs(n,t,!0)}var bd=jBe;function qBe(e){switch(e){case X.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case X.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case X.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case X.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case X.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case X.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case X.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case X.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var p_=qBe;function YBe(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=ff(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,h=i[u].extras._pipeline.source,p=t.count,_=iu(e,t),m=t.byteOffset+c.byteOffset+h.byteOffset,x=t.componentType,b=X.getSizeInBytes(x),T=new DataView(h.buffer),C=new Array(r),A=p_(x);for(let S=0;S<p;S++){A(T,m,r,b,C);for(let v=0;v<r;v++){let D=C[v];s[v]=Math.min(s[v],D),a[v]=Math.max(a[v],D)}m+=_}return{min:s,max:a}}var lC=YBe;var XBe=[te.FUNC_ADD,te.FUNC_ADD],KBe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function pie(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var ZBe=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function $Be(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(ZBe.indexOf(e[n])===-1)return t;return e}function QBe(e){let t={},n={},i=e.techniques;return l(i)&&(Pe.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(pie(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,XBe),blendFactors:$Be(c.blendFuncSeparate,KBe)})}pie(s,te.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),bd(e,"KHR_blend")),Pe.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Pe.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var qN=QBe;function JBe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Fs(n,t,!0),bd(e,t)}var YN=JBe;function e3e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Pe.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Pe.techniqueAttribute(a,function(h,p){f=a.parameters[h],u.attributes[p]={semantic:f.semantic}}),Pe.techniqueUniform(a,function(h,p){f=a.parameters[h],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][h]=p}),l(o[a.program]))u.program=o[a.program];else{let h=e.programs[a.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},_=e.shaders[h.fragmentShader];p.fragmentShader=Fs(r.shaders,_,!0);let m=e.shaders[h.vertexShader];p.vertexShader=Fs(r.shaders,m,!0),u.program=Fs(r.programs,p),o[a.program]=u.program}i[c]=Fs(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,bd(e,"KHR_techniques_webgl"),YN(e,"KHR_techniques_webgl"))}return Pe.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Pe.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let u=n[r.technique][c];l(u)&&(s.values[u]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var XN=e3e;function t3e(e,t){xo.typeOf.object("material",e),xo.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:u}=s;if(l(c)){let f=t(c.index,c);if(l(f))return f}if(l(u)){let f=t(u.index,u);if(l(f))return f}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:u,emission:f,specular:h}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(f)&&l(f.index)){let p=t(f.index,f);if(l(p))return p}if(l(h)&&l(h.index)){let p=t(h.index,h);if(l(p))return p}}}let o=Pe.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var $v=t3e;var gie=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function n3e(e,t){return t=y(t,gie),gie.forEach(function(n){t.indexOf(n)>-1&&o3e(e,n)}),e}var i3e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function o3e(e,t){let n=i3e[t],i=e[n];if(l(i)){let o=0,r=Yh[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(qh[t](e,a-o),o++)}}function qh(){}qh.accessor=function(e,t){e.accessors.splice(t,1),Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){Pe.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Pe.meshPrimitiveTarget(o,function(a){Pe.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Pe.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Pe.animation(e,function(i){Pe.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};qh.buffer=function(e,t){e.buffers.splice(t,1),Pe.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};qh.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Pe.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Pe.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Pe.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),mr(e,"KHR_draco_mesh_compression")&&Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),mr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(mr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};qh.image=function(e,t){e.images.splice(t,1),Pe.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};qh.mesh=function(e,t){e.meshes.splice(t,1),Pe.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};qh.node=function(e,t){e.nodes.splice(t,1),Pe.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Pe.animation(e,function(i){Pe.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Pe.technique(e,function(i){Pe.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Pe.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Pe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};qh.material=function(e,t){e.materials.splice(t,1),Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};qh.sampler=function(e,t){e.samplers.splice(t,1),Pe.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};qh.texture=function(e,t){if(e.textures.splice(t,1),Pe.material(e,function(i){$v(i,function(o,r){r.index>t&&--r.index})}),mr(e,"EXT_feature_metadata")){Pe.mesh(e,function(r){Pe.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let h=0;h<f;++h){let _=u[h].featureIds.texture;_.index>t&&--_.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(mr(e,"EXT_mesh_features")&&Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),mr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function Yh(){}Yh.accessor=function(e){let t={};return Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){Pe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Pe.meshPrimitiveTarget(i,function(r){Pe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Pe.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Pe.animation(e,function(n){Pe.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),mr(e,"EXT_mesh_gpu_instancing")&&Pe.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),mr(e,"CESIUM_primitive_outline")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Yh.buffer=function(e){let t={};return Pe.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Yh.bufferView=function(e){let t={};if(Pe.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Pe.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Pe.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),mr(e,"KHR_draco_mesh_compression")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),mr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(mr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Yh.image=function(e){let t={};return Pe.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Yh.mesh=function(e){let t={};return Pe.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function _ie(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!_ie(e,o,n)}).length===0}Yh.node=function(e){let t={};return Pe.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Pe.skinJoint(n,function(i){t[i]=!0})}),Pe.animation(e,function(n){Pe.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Pe.technique(e,function(n){Pe.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Pe.node(e,function(n,i){_ie(e,i,t)||(t[i]=!0)}),t};Yh.material=function(e){let t={};return Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Yh.texture=function(e){let t={};if(Pe.material(e,function(n){$v(n,function(i){t[i]=!0})}),mr(e,"EXT_feature_metadata")){Pe.mesh(e,function(o){Pe.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(mr(e,"EXT_mesh_features")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),mr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};Yh.sampler=function(e){let t={};return Pe.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var KN=n3e;function r3e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Fs(e.buffers,n),byteOffset:0,byteLength:t.length};return Fs(e.bufferViews,o)}var ZN=r3e;function s3e(e,t){let n=iu(e,t),i=X.getSizeInBytes(t.componentType),o=ff(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),h=new Array(o),p=p_(t.componentType);for(let _=0;_<r;++_){p(f,u,o,i,h);for(let m=0;m<o;++m)s[_*o+m]=h[m];u+=n}return s}var $N=s3e;function a3e(e){let t;return Pe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?QN(e,i,X.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&QN(e,i,X.UNSIGNED_SHORT)}),Pe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?QN(e,i,X.UNSIGNED_BYTE):t===te.SHORT&&QN(e,i,X.UNSIGNED_SHORT)}),e}function QN(e,t,n){let i=X.createTypedArray(n,$N(e,t)),o=new Uint8Array(i.buffer);t.bufferView=ZN(e,o),t.componentType=n,t.byteOffset=0}var JN=a3e;function c3e(e,t){return cC(e,t),t==="CESIUM_RTC"&&l3e(e),b9(e,t)}function l3e(e){Pe.technique(e,function(t){Pe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function b9(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)b9(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&b9(e[o],t);return i}}var uC=c3e;var eF={.8:p3e,"1.0":F3e,"2.0":void 0};function u3e(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(eF,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(eF,i)||(i="1.0"));let o=eF[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=eF[i];return t.keepLegacyExtensions||(V3e(e,t),U3e(e)),e}function bie(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;l(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function f3e(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=y(a.primitive,te.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function d3e(e){let t=e.nodes,n=new d,i=new Oe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;d.fromArray(a,0,n),Oe.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;l(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function h3e(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new d,a=new Oe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,h=u.parameters,p=u.samplers;if(l(f)){let _=f.length;for(let m=0;m<_;++m){let x=f[m];if(x.target.path==="rotation"){let b=h[p[x.sampler].output];if(l(r[b]))continue;r[b]=!0;let T=n[b],C=i[T.bufferView],S=o[C.buffer].extras._pipeline.source,v=S.byteOffset+C.byteOffset+T.byteOffset,D=T.componentType,O=T.count,R=ff(T.type),M=T.count*R,L=X.createArrayBufferView(D,S.buffer,v,M);for(let g=0;g<O;g++){let E=g*R;d.unpack(L,E,s);let w=L[E+3];Oe.fromAxisAngle(s,w,a),Oe.pack(a,L,E)}}}}}}function m3e(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function p3e(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,bie(e),f3e(e),d3e(e),h3e(e),m3e(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,bd(e,"KHR_materials_common")}}function g3e(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function yie(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),l(o.name)||(o.name=i)}return n}function _3e(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,l(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=yie(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Pe.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Pe.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Pe.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Pe.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Pe.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Pe.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Pe.mesh(e,function(s){Pe.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Pe.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Pe.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},h=Fs(e.nodes,f);l(a)||(a=[],s.children=a),a.push(h)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Pe.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Pe.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Pe.animation(e,function(s){let a={};s.samplers=yie(s.samplers,a),Pe.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Pe.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Pe.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Pe.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Pe.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Pe.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Pe.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function y3e(e){Pe.animation(e,function(t){Pe.animationSampler(t,function(n){delete n.name})})}function x3e(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Pe.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function b3e(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var T3e={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function C3e(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(T3e[o])&&e.extensionsRequired.push(o)}}}function A3e(e){Pe.buffer(e,function(t){delete t.type})}function E3e(e){Pe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function S3e(e){Pe.mesh(e,function(t){Pe.meshPrimitive(t,function(n){Pe.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Pe.technique(e,function(t){Pe.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var v3e={POSITION:!0,NORMAL:!0,TANGENT:!0},w3e={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function D3e(e){let t={};Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){Pe.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let u,f=w3e[a];l(f)?(u=f+c,t[r]=u):l(v3e[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Pe.technique(e,function(n){Pe.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function I3e(e){Pe.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function C9(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:iu(e,t)}function P3e(e){Pe.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Pe.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=C9(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function R3e(e){let t,n,i,o=e.bufferViews,r={};Pe.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Pe.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,_){return p.byteOffset-_.byteOffset});let u=0,f=0,h=c.length;for(t=0;t<h;++t){let p=c[t],_=C9(e,p),m=p.byteOffset,x=p.count*_;delete p.byteStride;let b=t<h-1,T=b?C9(e,c[t+1]):void 0;if(_!==T){let C=Ge(i,!0);r[a]&&(C.byteStride=_),C.byteOffset+=u,C.byteLength=m+x-u;let A=Fs(o,C);for(n=f;n<=t;++n)p=c[n],p.bufferView=A,p.byteOffset=p.byteOffset-u;u=b?c[t+1].byteOffset:void 0,f=t+1}}}KN(e,["accessor","bufferView","buffer"])}function O3e(e){Pe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=lC(e,n);n.min=i.min,n.max=i.max}})}function Tie(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||d.fromArray(e.translation).equals(d.ZERO))&&(!l(e.scale)||d.fromArray(e.scale).equals(new d(1,1,1)))&&(!l(e.rotation)||oe.fromArray(e.rotation).equals(new oe(0,0,0,1)))&&(!l(e.matrix)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Cie(e,t){Pe.scene(e,function(n){let i=n.nodes;if(l(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Pe.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Tie(n)&&Cie(e,i))}}),delete e.nodes[t]}function M3e(e){return Pe.node(e,function(t,n){Tie(t)&&Cie(e,n)}),e}function L3e(e){Pe.animation(e,function(t){Pe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=lC(e,i);i.min=o.min,i.max=o.max}})})}function N3e(e){Pe.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=lC(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function F3e(e){e.asset=y(e.asset,{}),e.asset.version="2.0",bie(e),g3e(e),M3e(e),_3e(e),y3e(e),b3e(e),C3e(e),P3e(e),R3e(e),O3e(e),L3e(e),N3e(e),A3e(e),E3e(e),S3e(e),D3e(e),JN(e),I3e(e),qN(e),XN(e),x3e(e)}var B3e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],k3e=["u_diffuse","u_diffuse_mat"];function A9(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function E9(e){return l(e.index)}function S9(e){return Array.isArray(e)&&e.length===4}function Aie(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function V3e(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,B3e),i=y(t.baseColorFactorNames,k3e);Pe.material(e,function(o){Pe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&E9(r)?(A9(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&S9(r)&&(A9(o),o.pbrMetallicRoughness.baseColorFactor=Aie(r))})}),uC(e,"KHR_techniques_webgl"),uC(e,"KHR_blend")}function T9(e,t){l(t)&&(S9(t)?e.pbrMetallicRoughness.baseColorFactor=Aie(t):E9(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function xie(e,t){l(t)&&(S9(t)?e.emissiveFactor=t.slice(0,3):E9(t)&&(e.emissiveTexture=t))}function U3e(e){Pe.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=y(n.values,{}),o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;A9(t),n.technique==="CONSTANT"?(bd(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},T9(t,s),T9(t,o)):(T9(t,r),xie(t,o),xie(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),uC(e,"KHR_materials_common")}var tF=u3e;var $n={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function z3e(e){switch(e){case $n.POSITION:return"positionMC";case $n.NORMAL:return"normalMC";case $n.TANGENT:return"tangentMC";case $n.TEXCOORD:return"texCoord";case $n.COLOR:return"color";case $n.JOINTS:return"joints";case $n.WEIGHTS:return"weights";case $n.FEATURE_ID:return"featureId"}}$n.hasSetIndex=function(e){switch(e){case $n.POSITION:case $n.NORMAL:case $n.TANGENT:return!1;case $n.TEXCOORD:case $n.COLOR:case $n.JOINTS:case $n.WEIGHTS:case $n.FEATURE_ID:return!0}};$n.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return $n.POSITION;case"NORMAL":return $n.NORMAL;case"TANGENT":return $n.TANGENT;case"TEXCOORD":return $n.TEXCOORD;case"COLOR":return $n.COLOR;case"JOINTS":return $n.JOINTS;case"WEIGHTS":return $n.WEIGHTS;case"_FEATURE_ID":return $n.FEATURE_ID}};$n.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return $n.POSITION;case"RGBA":case"RGB":case"RGB565":return $n.COLOR;case"NORMAL":case"NORMAL_OCT16P":return $n.NORMAL;case"BATCH_ID":return $n.FEATURE_ID}};$n.getGlslType=function(e){switch(e){case $n.POSITION:case $n.NORMAL:case $n.TANGENT:return"vec3";case $n.TEXCOORD:return"vec2";case $n.COLOR:return"vec4";case $n.JOINTS:return"ivec4";case $n.WEIGHTS:return"vec4";case $n.FEATURE_ID:return"int"}};$n.getVariableName=function(e,t){let n=z3e(e);return l(t)&&(n+=`_${t}`),n};var Et=Object.freeze($n);function $a(){}$a.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` -${n.message}`);let o=new re(i);return l(n)&&(o.stack=`Original stack: -${n.stack} -Handler stack: -${o.stack}`),o};$a.getNodeTransform=function(e){return l(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:d.ZERO,l(e.rotation)?e.rotation:Oe.IDENTITY,l(e.scale)?e.scale:d.ONE)};$a.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};$a.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};$a.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};$a.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};$a.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=Et.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=on.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),u;return c&&(u=r?"vec4":on.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var H3e=new d,G3e=new d;$a.getPositionMinMax=function(e,t,n){let i=$a.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=d.add(r,t,G3e),o=d.add(o,n,H3e)),{min:r,max:o}};$a.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===No.Y?n=F.clone(No.Y_UP_TO_Z_UP,n):e===No.X&&(n=F.clone(No.X_UP_TO_Z_UP,n)),t===No.Z&&(n=F.multiplyTransformation(n,No.Z_UP_TO_X_UP,n)),n};var W3e=new $;$a.getCullFace=function(e,t){if(!Me.isTriangles(t))return xi.BACK;let n=F.getMatrix3(e,W3e);return $.determinant(n)<0?xi.FRONT:xi.BACK};$a.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};$a.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};$a.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!$a.supportedExtensions[i])throw new re(`Unsupported glTF Extension: ${i}`)}};var Kt=$a;function g_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(g_.prototype=Object.create(Ki.prototype),g_.prototype.constructor=g_);Object.defineProperties(g_.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});g_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=gt.LOADING,l(this._gltfJson)?(this._promise=Eie(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Sie(this,this._typedArray),this._promise):(this._promise=j3e(this),this._promise))};async function j3e(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;v9(e,n)}return Sie(e,t)}function v9(e,t){e.unload(),e._state=gt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function q3e(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!mr(t,"KHR_techniques_webgl")&&!mr(t,"KHR_materials_common"))return Promise.resolve();let n=[];Pe.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),tF(t)}function Y3e(e){let t=[];return Pe.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Mg(i)&&(delete n.uri,t.push(Se.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function X3e(e,t){let n=[];return Pe.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function Eie(e,t){try{sx(t),await Y3e(t),await q3e(e,t),UN(t),await X3e(e,t),jN(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new re(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&Kt.checkSupportedExtensions(i),e._gltf=t,e._state=gt.READY,e}catch(n){if(e.isDestroyed())return;v9(e,n)}}async function Sie(e,t){let n;try{Wh(t)==="glTF"?n=GN(t):n=Fo(t)}catch(i){if(e.isDestroyed())return;v9(e,i)}return Eie(e,n)}g_.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};g_.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var Qv=g_;var K3e={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Ep=Object.freeze(K3e);var To={};function Z3e(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function $3e(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function Q3e(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function J3e(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function eke(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function tke(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function nke(){this.attributes=[]}function ike(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function oke(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function rke(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function ske(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function ake(){this.nodes=[]}var cke={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function lke(){this.input=[],this.interpolation=void 0,this.output=[]}function uke(){this.node=void 0,this.path=void 0}function fke(){this.sampler=void 0,this.target=void 0}function dke(){this.name=void 0,this.samplers=[],this.channels=[]}function hke(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function mke(){this.name=void 0,this.stages=[]}function vie(){this.credits=[]}function pke(){this.asset=new vie,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=F.clone(F.IDENTITY),this.extensions={}}function gke(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0}function __(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=oe.clone(__.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=__.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=__.DEFAULT_ROUGHNESS_FACTOR}__.DEFAULT_BASE_COLOR_FACTOR=oe.ONE;__.DEFAULT_METALLIC_FACTOR=1;__.DEFAULT_ROUGHNESS_FACTOR=1;function ax(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=oe.clone(ax.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=d.clone(ax.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=ax.DEFAULT_GLOSSINESS_FACTOR}ax.DEFAULT_DIFFUSE_FACTOR=oe.ONE;ax.DEFAULT_SPECULAR_FACTOR=d.ONE;ax.DEFAULT_GLOSSINESS_FACTOR=1;function Jv(){this.specularFactor=Jv.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=d.clone(Jv.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}Jv.DEFAULT_SPECULAR_FACTOR=1;Jv.DEFAULT_SPECULAR_COLOR_FACTOR=d.ONE;function ew(){this.anisotropyStrength=ew.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=ew.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}ew.DEFAULT_ANISOTROPY_STRENGTH=0;ew.DEFAULT_ANISOTROPY_ROTATION=0;function tw(){this.clearcoatFactor=tw.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=tw.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}tw.DEFAULT_CLEARCOAT_FACTOR=0;tw.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function w9(){this.metallicRoughness=new __,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=d.clone(w9.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Ep.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}w9.DEFAULT_EMISSIVE_FACTOR=d.ZERO;To.Quantization=Z3e;To.Attribute=$3e;To.Indices=Q3e;To.FeatureIdAttribute=J3e;To.FeatureIdTexture=tke;To.FeatureIdImplicitRange=eke;To.MorphTarget=nke;To.Primitive=ike;To.Instances=oke;To.Skin=rke;To.Node=ske;To.Scene=ake;To.AnimatedPropertyType=Object.freeze(cke);To.AnimationSampler=lke;To.AnimationTarget=uke;To.AnimationChannel=fke;To.Animation=dke;To.ArticulationStage=hke;To.Articulation=mke;To.Asset=vie;To.Components=pke;To.TextureReader=gke;To.MetallicRoughness=__;To.SpecularGlossiness=ax;To.Specular=Jv;To.Anisotropy=ew;To.Clearcoat=tw;To.Material=w9;var bn=To;var nF={};nF.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureId:n,supportedImageFormats:i}=e,o=t.textures[n],r=o.extensions;if(l(r)){if(i.webp&&l(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&l(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};nF.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=An.REPEAT,r=An.REPEAT,s=Zt.LINEAR,a=di.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let h=t.samplers[f];o=y(h.wrapS,o),r=y(h.wrapT,r),s=y(h.minFilter,s),a=y(h.magFilter,a)}return i&&s!==Zt.LINEAR&&s!==Zt.NEAREST&&(s===Zt.NEAREST_MIPMAP_NEAREST||s===Zt.NEAREST_MIPMAP_LINEAR?s=Zt.NEAREST:s=Zt.LINEAR),new $t({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var _ke=new U(1,1);nF.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let{textureInfo:t,channels:n,texture:i}=e,o=y(t.texCoord,0),r,s=t.extensions?.KHR_texture_transform;if(l(s)){o=y(s.texCoord,o);let c=l(s.offset)?U.unpack(s.offset):U.ZERO,u=y(s.rotation,0),f=l(s.scale)?U.unpack(s.scale):_ke;u=-u,r=new $(Math.cos(u)*f.x,-Math.sin(u)*f.y,c.x,Math.sin(u)*f.x,Math.cos(u)*f.y,c.y,0,0,1)}let a=new bn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var ou=nF;function yke(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var cx=yke;function y_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),u=i.index,f=ou.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(y_.prototype=Object.create(Ki.prototype),y_.prototype.constructor=y_);Object.defineProperties(y_.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var xke=new D9;async function bke(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load texture",n)}}y_.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=bke(this),this._promise)};function D9(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}D9.prototype.set=function(e,t,n,i,o,r){this.gltf=e,this.textureInfo=t,this.textureId=n,this.image=i,this.mipLevels=o,this.context=r};D9.prototype.execute=function(){this.texture=wie(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function wie(e,t,n,i,o,r){let s=i.internalFormat,a=!1;tt.isCompressedFormat(s)&&!l(o)&&(a=!0);let c=ou.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,h=c.wrapT,p=u===Zt.NEAREST_MIPMAP_NEAREST||u===Zt.NEAREST_MIPMAP_LINEAR||u===Zt.LINEAR_MIPMAP_NEAREST||u===Zt.LINEAR_MIPMAP_LINEAR,_=!l(s)&&p,m=_||f===An.REPEAT||f===An.MIRRORED_REPEAT||h===An.REPEAT||h===An.MIRRORED_REPEAT,x=!P.isPowerOfTwo(i.width)||!P.isPowerOfTwo(i.height),b=m&&x,T;return l(s)?(!r.webgl2&&tt.isCompressedFormat(s)&&x&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),T=Ot.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(b&&(i=cx(i)),T=Ot.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),_&&T.generateMipmap(),T}y_.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=gt.PROCESSING;let t;if(this._asynchronous){let n=xke;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Za.TEXTURE))return;t=n.texture}else t=wie(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=gt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};y_.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var nw=y_;function x_(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,u=e.cacheKey,f=y(e.asynchronous,!0),h=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=h,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(x_.prototype=Object.create(Ki.prototype),x_.prototype.constructor=x_);Object.defineProperties(x_.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function Tke(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}x_.prototype.load=async function(){return l(this._promise)?this._promise:Tke(this._draco,this._attributeSemantic)?(this._promise=Ake(this),this._promise):(this._promise=Ske(this),this._promise)};function Cke(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new bn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=on.VEC2,a.normalizationRange=r;else{let c=on.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(h){return h*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function Ake(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch{if(e.isDestroyed())return;I9(e)}}function Eke(e){e._state=gt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,u=o.data.quantization;l(u)&&(e._quantization=Cke(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function Ske(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;I9(e,n)}}function I9(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load vertex buffer",t)}function P9(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}P9.prototype.set=function(e,t){this.typedArray=e,this.context=t};P9.prototype.execute=function(){this.buffer=Die(this.typedArray,this.context)};function Die(e,t){let n=yt.createVertexBuffer({typedArray:e,context:t,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var vke=new P9;x_.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){I9(this,i)}Eke(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=vke;if(i.set(n,e.context),!e.jobScheduler.execute(i,Za.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=Die(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};x_.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var iw=x_;function ow(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(e.properties,{}),i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}ow.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=Tp.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new ow({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(ow.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});ow.BATCH_TABLE_CLASS_NAME="_batchTable";var Xh=ow;function iF(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}iF.fromJson=function(e){return new iF({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(iF.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var oF=iF;function rF(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=y(e.valueType,Vt.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}rF.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(o){return oF.fromJson(o)});return new rF({id:t,values:i,valueType:Vt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(rF.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var sF=rF;function aF(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ge(e.extras,!0),this._extensions=Ge(e.extensions,!0)}aF.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=sF.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Xh.fromJson({id:i,class:e.classes[i],enums:t}));return new aF({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(aF.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var df=aF;function lx(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?df.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(lx.prototype=Object.create(Ki.prototype),lx.prototype.constructor=lx);Object.defineProperties(lx.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});lx.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=wke(this),this._promise)};async function wke(e){let t=e._resource;e._state=gt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=df.fromJson(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}lx.prototype.unload=function(){this._schema=void 0};var rw=lx;var Td={};function fC(e){return Qm(e.url)}function cF(e){let{byteOffset:t,byteLength:n}=e;if(oi(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function Dke(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function Iie(e,t){return`${fC(e)}-buffer-id-${t}`}function sw(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return fC(o)}return Iie(n,t)}function R9(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=sw(a,s,n,i),u=cF(r);return`${c}-range-${u}`}function Pie(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let p=i.getDerivedResource({url:s});return fC(p)}let a=e.bufferViews[r],c=a.buffer,u=e.buffers[c],f=sw(u,c,n,i),h=cF(a);return`${f}-range-${h}`}function Ike(e,t){let n=ou.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Td.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${fC(n)}`};Td.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e;return`external-buffer:${fC(t)}`};Td.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Iie(t,n)}`};Td.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t}=e;return`gltf:${fC(t)}`};Td.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];oi(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=sw(a,s,i,o),u=cF(r);return`buffer-view:${c}-range-${u}`};Td.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${R9(t,n,i,o)}`};Td.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:c=!1,loadBuffer:u=!1,loadTypedArray:f=!1}=e,h="";if(c&&(h+="-dequantize"),u&&(h+="-buffer",h+=`-context-${o.context.id}`),f&&(h+="-typed-array"),l(s))return`vertex-buffer:${R9(t,s,n,i)}-draco-${a}${h}`;let p=t.bufferViews[r],_=p.buffer,m=t.buffers[_],x=sw(m,_,n,i),b=cF(p);return`vertex-buffer:${x}-range-${b}${h}`};Td.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${R9(t,s,i,o)}-draco${u}`;let f=t.accessors[n],h=f.bufferView,p=t.bufferViews[h],_=p.buffer,m=t.buffers[_],x=sw(m,_,i,o),b=Dke(f,p);return`index-buffer:${x}-accessor-${b}${u}`};Td.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${Pie(t,n,i,o)}`};Td.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=ou.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=Pie(t,c,i,o),f=Ike(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var ru=Td;function aw(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}aw.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};aw.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;l(n)&&(o+=n.sizeInBytes),l(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};aw.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};aw.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var lF=aw;function Mn(){}Mn.cacheEntries={};Mn.statistics=new lF;function Pke(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Mn.get=function(e){let t=Mn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Mn.add=function(e){let t=e.cacheKey;return Mn.cacheEntries[t]=new Pke(e),e};Mn.unload=function(e){let t=e.cacheKey,n=Mn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Mn.statistics.removeLoader(e),e.destroy(),delete Mn.cacheEntries[t])};Mn.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{schema:t,resource:n}=e,i=ru.getSchemaCacheKey({schema:t,resource:n}),o=Mn.get(i);return l(o)?o:(o=new rw({schema:t,resource:n,cacheKey:i}),Mn.add(o))};Mn.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n,typedArray:i}=e,o=ru.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Mn.get(o);return l(r)?r:(r=new sC({typedArray:i,cacheKey:o}),Mn.add(r))};Mn.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e,n=ru.getExternalBufferCacheKey({resource:t}),i=Mn.get(n);return l(i)?i:(i=new sC({resource:t,cacheKey:n}),Mn.add(i))};Mn.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=ru.getGltfCacheKey({gltfResource:t}),s=Mn.get(r);return l(s)?s:(s=new Qv({resourceCache:Mn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Mn.add(s))};Mn.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=ru.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return l(s)?s:(s=new Yv({resourceCache:Mn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e,r=ru.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return l(s)?s:(s=new Xv({resourceCache:Mn,gltf:t,draco:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,asynchronous:u=!0,dequantize:f=!1,loadBuffer:h=!1,loadTypedArray:p=!1}=e,_=ru.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:f,loadBuffer:h,loadTypedArray:p}),m=Mn.get(_);return l(m)?m:(m=new iw({resourceCache:Mn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,cacheKey:_,asynchronous:u,dequantize:f,loadBuffer:h,loadTypedArray:p}),Mn.add(m))};Mn.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,asynchronous:a=!0,loadBuffer:c=!1,loadTypedArray:u=!1}=e,f=ru.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:c,loadTypedArray:u}),h=Mn.get(f);return l(h)?h:(h=new Zv({resourceCache:Mn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,draco:s,cacheKey:f,asynchronous:a,loadBuffer:c,loadTypedArray:u}),Mn.add(h))};Mn.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=ru.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return l(s)?s:(s=new Kv({resourceCache:Mn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=ru.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),u=Mn.get(c);return l(u)?u:(u=new nw({resourceCache:Mn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Mn.add(u))};Mn.clearForSpecs=function(){let e=[iw,Zv,Xv,nw,Kv,Yv,sC,rw,Qv],t,n=Mn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Mn.statistics.clear()};var Ei=Mn;function Js(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(Js.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});Js.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Js.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Js.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};Js.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Js.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Js.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Js.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Js.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===os.OCTREE&&(t=3),e>>t};Js.fromSubtreeJson=async function(e,t,n,i,o){let r=new Js(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=Rke(n);let a=s.json;r._subtreeJson=a;let c;if(oi(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let C=a.tileMetadata;c=a.propertyTables[C]}let u=[];if(l(a.contentMetadata)){let C=a.contentMetadata.length;for(let A=0;A<C;A++){let S=a.contentMetadata[A];u.push(a.propertyTables[S])}}let f,h=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let C=p.class,A=h.classes[C];f=new BN({subtreeMetadata:p,class:A})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let _={constant:0};a.contentAvailabilityHeaders=[],oi(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,_));let m=Oke(a.buffers),x=Mke(a.bufferViews,m);Lke(a,x),l(c)&&Rie(c,x);for(let C=0;C<u.length;C++){let A=u[C];Rie(A,x)}let b=await Nke(r,m,s.binary),T=Bke(x,b);return kke(r,a,i,T),l(c)&&(Vke(r,i,T),zke(r)),Uke(r,i,T),Hke(r),r._ready=!0,r};function Rke(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Fo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function Oke(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function Mke(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function Lke(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function Rie(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=y(r.values,r.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(r.stringOffsets,r.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(r.arrayOffsets,r.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function Nke(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=Fke(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function Fke(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Ei.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function Bke(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function kke(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=oi(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=O9(t.tileAvailability,i,s,f);let h=e._contentPropertyTableJsons.length>0;f=f||h;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let _=O9(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(_)}e._childSubtreeAvailability=O9(t.childSubtreeAvailability,i,a)}function O9(e,t,n,i){if(l(e.constant))return new Wv({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new Wv({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function Vke(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new nu({class:a,count:o,properties:i.properties,bufferViews:n})}function Uke(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=o[a].availableCount,h=c.class,p=r.classes[h],_=new nu({class:p,count:f,properties:c.properties,bufferViews:n});s.push(_)}}function Oie(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function zke(e){let t=Oie(e._tileAvailability);e._tileJumpBuffer=t}function Hke(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Oie(o);t.push(r)}}Js.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new re("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};Js.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new re("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function Gke(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function Wke(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}Js.prototype.getTileMetadataView=function(e){let t=Gke(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new jv({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Js.prototype.getContentMetadataView=function(e,t){let n=Wke(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new jv({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};Js.prototype.isDestroyed=function(){return!1};Js.prototype.destroy=function(){return l(this._bufferLoader)&&Ei.unload(this._bufferLoader),ue(this)};var dC=Js;var jke={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},hC=Object.freeze(jke);var Cd={};Cd.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:Cd.parseBoundingVolumeSemantic("TILE",e),minimumHeight:Cd._parseMinimumHeight("TILE",e),maximumHeight:Cd._parseMaximumHeight("TILE",e)},content:{boundingVolume:Cd.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:Cd._parseMinimumHeight("CONTENT",e),maximumHeight:Cd._parseMaximumHeight("CONTENT",e)}}};Cd.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};Cd._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Cd._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var mC=Cd;function Lc(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(Lc.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Lc.fromSubtreeJson=async function(e,t,n,i,o,r){r=y(r,0);let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,u=await dC.fromSubtreeJson(n,i,s,a,c),f=new Lc(e,t,n);return f._implicitSubtree=u,qke(f,u),f._ready=!0,f};function qke(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=Xke(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=Yke(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=iVe(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function Yke(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function Xke(e,t,n,i){let s=Mie(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let h=1;h<f.subtreeLevels;h++){let p=t.getLevelOffset(h),_=f.branchingFactor*c.length;for(let m=0;m<_;m++){let x=p+m;if(!t.tileIsAvailableAtIndex(x)){u.push(void 0);continue}let b=t.getParentMortonIndex(m),T=c[b],C=m%f.branchingFactor,A=Mie(e,t,T,C,x);T.children.push(A),a.numberOfTilesTotal++,u.push(A)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function Lie(e,t,n){let i=hC.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Mie(e,t,n,i,o,r){let s=e._implicitTileset,a;y(r,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u,f;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let D=mC.parseAllBoundingVolumeSemantics(c);u=D.tile,f=D.content}let p=t.contentPropertyTableJsons.length,_=!1;for(let D=0;D<p;D++)if(t.contentIsAvailableAtCoordinates(a,D)){_=!0;break}let m=$ke(s,a,i,r,n,u),x=[];for(let D=0;D<s.contentCount;D++){if(!t.contentIsAvailableAtIndex(o,D))continue;let M={uri:s.contentUriTemplates[D].getDerivedResource({templateValues:a.getTemplateValues()}).url},L=Qke(m,f);l(L)&&(M.boundingVolume=L),x.push(bt(M,s.contentHeaders[D]))}let b=Lie(c,s,a),T={boundingVolume:m,geometricError:b,refine:s.refine,contents:x},C=!0,A=Ge(s.tileHeader,C);delete A.boundingVolume,delete A.transform,delete A.metadata;let S=bt(T,A,C),v=Vie(e,s.baseResource,S,n);return v.implicitCoordinates=a,v.implicitSubtree=t,v.metadata=c,v.hasImplicitContentMetadata=_,v}function uF(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(oi(e,"3DTILES_bounding_volume_S2")||l(e.region))}function L9(e,t){l(t)&&(oi(e,"3DTILES_bounding_volume_S2")?Zke(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&Kke(e.region,t.minimumHeight,t.maximumHeight))}function Kke(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function Zke(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function $ke(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!uF(r.boundingVolume,r)&&uF(e.boundingVolume,r)?s=Nie(e,t,n,y(i,!1),o):s=r.boundingVolume,L9(s,r),s}function Qke(e,t){let n;return l(t)&&(n=t.boundingVolume),uF(n,t)?L9(n,t):uF(e,t)&&(n=Ge(e,!0),L9(n,t)),n}function Nie(e,t,n,i,o){let r=e.boundingVolume;return oi(r,"3DTILES_bounding_volume_S2")?Fie(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:kie(r.region,t.level,t.x,t.y,t.z)}:{box:Bie(r.box,t.level,t.x,t.y,t.z)}}function Fie(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:u_.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?Gv.encode2D(i,o,r):Gv.encode2D(i,r,o),f=u_.fromFacePositionLevel(c,BigInt(u),i),h,p;if(l(s)){let _=(a.maximumHeight+a.minimumHeight)/2;h=n<4?a.minimumHeight:_,p=n<4?_:a.maximumHeight}else h=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:u_.getTokenFromId(f._cellId),minimumHeight:h,maximumHeight:p}}}}var Jke=new d,eVe=new d,M9=new d,tVe=new $;function Bie(e,t,n,i,o){if(t===0)return e;let r=d.unpack(e,0,eVe),s=$.unpack(e,3,tVe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,h=d.fromElements(a,a,1,Jke);l(o)&&(f=-1+(2*o+1)*a,h.z=a);let p=d.fromElements(c,u,f,M9);p=$.multiplyByVector(s,p,M9),p=d.add(p,r,M9);let _=$.clone(s);_=$.multiplyByScale(_,h,_);let m=new Array(12);return d.pack(p,m),$.pack(_,m,3),m}var nVe=new se;function kie(e,t,n,i,o){if(t===0)return e.slice();let r=se.unpack(e,0,nVe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*r.width,f=P.negativePiToPi(r.west+n*u),h=P.negativePiToPi(f+u),p=c*r.height,_=P.negativePiToPi(r.south+i*p),m=P.negativePiToPi(_+p),x=s,b=a;if(l(o)){let T=c*(a-s);x+=o*T,b=x+T}return[f,_,h,m,x,b]}function iVe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Nie(i,o,n,!1,t),s=Lie(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Vie(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function Vie(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Lc.prototype.hasProperty=function(e,t){return!1};Lc.prototype.getFeature=function(e){};Lc.prototype.applyDebugSettings=function(e,t){};Lc.prototype.applyStyle=function(e){};Lc.prototype.update=function(e,t){};Lc.prototype.pick=function(e,t,n){};Lc.prototype.isDestroyed=function(){return!1};Lc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};Lc._deriveBoundingBox=Bie;Lc._deriveBoundingRegion=kie;Lc._deriveBoundingVolumeS2=Fie;var cw=Lc;var oVe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},su=Object.freeze(oVe);function pC(e,t){this._distance=t,this._normal=new Uie(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(pC.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!d.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),d.clone(e,this._normal._cartesian3)}}});pC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new pC(e.normal,e.distance),t};pC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new pC(e.normal,e.distance)};function Uie(e,t){this._clippingPlane=t,this._cartesian3=d.clone(e)}Object.defineProperties(Uie.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var gC=pC;function Qa(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.edgeColor=z.clone(y(e.edgeColor,z.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new me,this.planeRemoved=new me,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?jie:qie,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function jie(e){return e===jt.OUTSIDE}function qie(e){return e===jt.INSIDE}Object.defineProperties(Qa.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?jie:qie)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function zie(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Qa.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){zie(n,i)},e.index=t,zie(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Qa.prototype.get=function(e){return this._planes[e]};function Yie(e,t){let n=e.length;for(let i=0;i<n;++i)if(an.equals(e[i],t))return i;return-1}Qa.prototype.contains=function(e){return Yie(this._planes,e)!==-1};Qa.prototype.remove=function(e){let t=this._planes,n=Yie(t,e);if(n===-1)return!1;e instanceof gC&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof gC&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Qa.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof gC&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var rVe=new oe,sVe=new oe;function Hie(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=Ln.octEncodeToCartesian4(a.normal,sVe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=oe.packFloat(a.distance,rVe);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function Gie(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function Xie(e,t){let n=Bt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var aVe=new U;Qa.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Qa.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=Xie(o,aVe);s.y*=2,i?(t=new Ot({context:n,width:s.x,height:s.y,pixelFormat:tt.RGBA,pixelDatatype:Ke.FLOAT,sampler:$t.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Ot({context:n,width:s.x,height:s.y,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:$t.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(Gie(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Hie(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),Gie(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),Hie(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var cVe=new F,Wie=new an(d.UNIT_X,0);Qa.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=F.multiply(t,o,cVe));let r=jt.INSIDE;!this.unionClippingRegions&&i>0&&(r=jt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];an.transform(a,o,Wie);let c=e.intersectPlane(Wie);if(c===jt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Qa.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Qa.useFloatTexture=function(e){return e.floatingPointTexture};Qa.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Qa.useFloatTexture(t)?e.length:e.length*2,r=Xie(o,n);return r.y*=2,r};Qa.prototype.isDestroyed=function(){return!1};Qa.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var bs=Qa;function B9(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=Zie(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,u;if(i&&(r=hVe(e,t,r,n)),e.length>80*n){a=1/0,c=1/0;let f=-1/0,h=-1/0;for(let p=n;p<o;p+=n){let _=e[p],m=e[p+1];_<a&&(a=_),m<c&&(c=m),_>f&&(f=_),m>h&&(h=m)}u=Math.max(f-a,h-c),u=u!==0?32767/u:0}return lw(r,s,n,a,c,u,0),s}function Zie(e,t,n,i,o){let r;if(o===EVe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=Kie(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=Kie(s/i|0,e[s],e[s+1],r);return r&&hF(r,r.next)&&(fw(r),r=r.next),r}function ux(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(hF(n,n.next)||Rr(n.prev,n,n.next)===0)){if(fw(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function lw(e,t,n,i,o,r,s){if(!e)return;!s&&r&&yVe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(r?uVe(e,i,o,r):lVe(e)){t.push(c.i,e.i,u.i),fw(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=fVe(ux(e),t),lw(e,t,n,i,o,r,2)):s===2&&dVe(e,t,n,i,o,r):lw(ux(e),t,n,i,o,r,1);break}}}function lVe(e){let t=e.prev,n=e,i=e.next;if(Rr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=o<r?o<s?o:s:r<s?r:s,h=a<c?a<u?a:u:c<u?c:u,p=o>r?o>s?o:s:r>s?r:s,_=a>c?a>u?a:u:c>u?c:u,m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=h&&m.y<=_&&_C(o,a,r,c,s,u,m.x,m.y)&&Rr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function uVe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Rr(o,r,s)>=0)return!1;let a=o.x,c=r.x,u=s.x,f=o.y,h=r.y,p=s.y,_=a<c?a<u?a:u:c<u?c:u,m=f<h?f<p?f:p:h<p?h:p,x=a>c?a>u?a:u:c>u?c:u,b=f>h?f>p?f:p:h>p?h:p,T=N9(_,m,t,n,i),C=N9(x,b,t,n,i),A=e.prevZ,S=e.nextZ;for(;A&&A.z>=T&&S&&S.z<=C;){if(A.x>=_&&A.x<=x&&A.y>=m&&A.y<=b&&A!==o&&A!==s&&_C(a,f,c,h,u,p,A.x,A.y)&&Rr(A.prev,A,A.next)>=0||(A=A.prevZ,S.x>=_&&S.x<=x&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&_C(a,f,c,h,u,p,S.x,S.y)&&Rr(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;A&&A.z>=T;){if(A.x>=_&&A.x<=x&&A.y>=m&&A.y<=b&&A!==o&&A!==s&&_C(a,f,c,h,u,p,A.x,A.y)&&Rr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;S&&S.z<=C;){if(S.x>=_&&S.x<=x&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&_C(a,f,c,h,u,p,S.x,S.y)&&Rr(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function fVe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!hF(i,o)&&$ie(i,n,n.next,o)&&uw(i,o)&&uw(o,i)&&(t.push(i.i,n.i,o.i),fw(n),fw(n.next),n=e=o),n=n.next}while(n!==e);return ux(n)}function dVe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&TVe(s,a)){let c=Qie(s,a);s=ux(s,s.next),c=ux(c,c.next),lw(s,t,n,i,o,r,0),lw(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function hVe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,u=Zie(e,a,c,i,!1);u===u.next&&(u.steiner=!0),o.push(bVe(u))}o.sort(mVe);for(let r=0;r<o.length;r++)n=pVe(o[r],n);return n}function mVe(e,t){return e.x-t.x}function pVe(e,t){let n=gVe(e,t);if(!n)return t;let i=Qie(n,e);return ux(i,i.next),ux(n,n.next)}function gVe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>r&&(r=h,s=n.x<n.next.x?n:n.next,h===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&_C(o<u?i:r,o,c,u,o<u?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);uw(n,e)&&(h<f||h===f&&(n.x>s.x||n.x===s.x&&_Ve(s,n)))&&(s=n,f=h)}n=n.next}while(n!==a);return s}function _Ve(e,t){return Rr(e.prev,e,t.prev)<0&&Rr(t.next,e,e.next)<0}function yVe(e,t,n,i){let o=e;do o.z===0&&(o.z=N9(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,xVe(o)}function xVe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function N9(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function bVe(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function _C(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function TVe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!CVe(e,t)&&(uw(e,t)&&uw(t,e)&&AVe(e,t)&&(Rr(e.prev,e,t.prev)||Rr(e,t.prev,t))||hF(e,t)&&Rr(e.prev,e,e.next)>0&&Rr(t.prev,t,t.next)>0)}function Rr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function hF(e,t){return e.x===t.x&&e.y===t.y}function $ie(e,t,n,i){let o=dF(Rr(e,t,n)),r=dF(Rr(e,t,i)),s=dF(Rr(n,i,e)),a=dF(Rr(n,i,t));return!!(o!==r&&s!==a||o===0&&fF(e,n,t)||r===0&&fF(e,i,t)||s===0&&fF(n,e,i)||a===0&&fF(n,t,i))}function fF(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function dF(e){return e>0?1:e<0?-1:0}function CVe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&$ie(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function uw(e,t){return Rr(e.prev,e,e.next)<0?Rr(e,t,e.next)>=0&&Rr(e,e.prev,t)>=0:Rr(e,t,e.prev)<0||Rr(e,e.next,t)<0}function AVe(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Qie(e,t){let n=F9(e.i,e.x,e.y),i=F9(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function Kie(e,t,n,i){let o=F9(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function fw(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function F9(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function EVe(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var SVe=new d,vVe=new d,b_={};b_.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};b_.computeWindingOrder2D=function(e){return b_.computeArea2D(e)>0?gs.COUNTER_CLOCKWISE:gs.CLOCKWISE};b_.triangulate=function(e,t){let n=U.packArray(e);return B9(n,t,2)};var noe=new d,ioe=new d,ooe=new d,Jie=new d,eoe=new d,toe=new d,Sp=new d,roe=new U,soe=new U,aoe=new U,yC=new U;b_.computeSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),h=0,p=0;for(a=0;a<c;a++){let A=t[a];if(u[h++]=A.x,u[h++]=A.y,u[h++]=A.z,r){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let _=[],m={},x=e.maximumRadius,b=P.chordLength(o,x),T=b*b;for(;s.length>0;){let A=s.pop(),S=s.pop(),v=s.pop(),D=d.fromArray(u,v*3,noe),O=d.fromArray(u,S*3,ioe),R=d.fromArray(u,A*3,ooe),M,L,g;r&&(M=U.fromArray(f,v*2,roe),L=U.fromArray(f,S*2,soe),g=U.fromArray(f,A*2,aoe));let E=d.multiplyByScalar(d.normalize(D,Jie),x,Jie),w=d.multiplyByScalar(d.normalize(O,eoe),x,eoe),I=d.multiplyByScalar(d.normalize(R,toe),x,toe),N=d.magnitudeSquared(d.subtract(E,w,Sp)),B=d.magnitudeSquared(d.subtract(w,I,Sp)),H=d.magnitudeSquared(d.subtract(I,E,Sp)),V=Math.max(N,B,H),G,k,W;V>T?N===V?(G=`${Math.min(v,S)} ${Math.max(v,S)}`,a=m[G],l(a)||(k=d.add(D,O,Sp),d.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=U.add(M,L,yC),U.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(v,a,A),s.push(a,S,A)):B===V?(G=`${Math.min(S,A)} ${Math.max(S,A)}`,a=m[G],l(a)||(k=d.add(O,R,Sp),d.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=U.add(L,g,yC),U.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(S,a,v),s.push(a,A,v)):H===V&&(G=`${Math.min(A,v)} ${Math.max(A,v)}`,a=m[G],l(a)||(k=d.add(R,D,Sp),d.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[G]=a,r&&(W=U.add(g,M,yC),U.multiplyByScalar(W,.5,W),f.push(W.x,W.y))),s.push(A,a,S),s.push(a,v,S)):(_.push(v),_.push(S),_.push(A))}let C={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:_,primitiveType:Me.TRIANGLES};return r&&(C.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new at(C)};var wVe=new fe,DVe=new fe,IVe=new fe,k9=new fe;b_.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,P.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),h=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[h++]=v.x,u[h++]=v.y,u[h++]=v.z,r){let D=i[a];f[p++]=D.x,f[p++]=D.y}}let _=[],m={},x=e.maximumRadius,b=P.chordLength(o,x),T=new Ya(void 0,void 0,e),C=new Ya(void 0,void 0,e),A=new Ya(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),D=s.pop(),O=s.pop(),R=d.fromArray(u,O*3,noe),M=d.fromArray(u,D*3,ioe),L=d.fromArray(u,v*3,ooe),g,E,w;r&&(g=U.fromArray(f,O*2,roe),E=U.fromArray(f,D*2,soe),w=U.fromArray(f,v*2,aoe));let I=e.cartesianToCartographic(R,wVe),N=e.cartesianToCartographic(M,DVe),B=e.cartesianToCartographic(L,IVe);T.setEndPoints(I,N);let H=T.surfaceDistance;C.setEndPoints(N,B);let V=C.surfaceDistance;A.setEndPoints(B,I);let G=A.surfaceDistance,k=Math.max(H,V,G),W,Y,J,j,K;k>b?H===k?(W=`${Math.min(O,D)} ${Math.max(O,D)}`,a=m[W],l(a)||(Y=T.interpolateUsingFraction(.5,k9),J=(I.height+N.height)*.5,j=d.fromRadians(Y.longitude,Y.latitude,J,e,Sp),u.push(j.x,j.y,j.z),a=u.length/3-1,m[W]=a,r&&(K=U.add(g,E,yC),U.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(O,a,v),s.push(a,D,v)):V===k?(W=`${Math.min(D,v)} ${Math.max(D,v)}`,a=m[W],l(a)||(Y=C.interpolateUsingFraction(.5,k9),J=(N.height+B.height)*.5,j=d.fromRadians(Y.longitude,Y.latitude,J,e,Sp),u.push(j.x,j.y,j.z),a=u.length/3-1,m[W]=a,r&&(K=U.add(E,w,yC),U.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(D,a,O),s.push(a,v,O)):G===k&&(W=`${Math.min(v,O)} ${Math.max(v,O)}`,a=m[W],l(a)||(Y=A.interpolateUsingFraction(.5,k9),J=(B.height+I.height)*.5,j=d.fromRadians(Y.longitude,Y.latitude,J,e,Sp),u.push(j.x,j.y,j.z),a=u.length/3-1,m[W]=a,r&&(K=U.add(w,g,yC),U.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),s.push(v,a,D),s.push(a,O,D)):(_.push(O),_.push(D),_.push(v))}let S={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})},indices:_,primitiveType:Me.TRIANGLES};return r&&(S.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),new at(S)};b_.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,ee.default);let o=SVe,r=vVe;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)d.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),d.multiplyByScalar(o,t,o),d.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var ri=b_;function T_(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(T_.prototype,{length:{get:function(){return this._length}}});T_.prototype.enqueue=function(e){this._array.push(e),this._length++};T_.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};T_.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};T_.prototype.contains=function(e){return this._array.indexOf(e)!==-1};T_.prototype.clear=function(){this._array.length=this._offset=this._length=0};T_.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var fx=T_;var qo={};qo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};qo.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)o.push(a[u])}}return n};qo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=qo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var dx=new U;function uoe(e,t,n,i){return U.subtract(t,e,dx),U.multiplyByScalar(dx,n/i,dx),U.add(e,dx,dx),[dx.x,dx.y]}var C_=new d;function PVe(e,t,n,i){return d.subtract(t,e,C_),d.multiplyByScalar(C_,n/i,C_),d.add(e,C_,C_),[C_.x,C_.y,C_.z]}qo.subdivideLineCount=function(e,t,n){let o=d.distance(e,t)/n,r=Math.max(0,Math.ceil(P.log2(o)));return Math.pow(2,r)};var pF=new fe,gF=new fe,RVe=new fe,OVe=new d,mF=new Ya;qo.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,pF),r=e.cartesianToCartographic(n,gF),a=new Ya(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};qo.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=qo.subdivideLineCount(n,i,o),a=U.distance(e,t),c=a/s,u=r;u.length=s*2;let f=0;for(let h=0;h<s;h++){let p=uoe(e,t,h*c,a);u[f++]=p[0],u[f++]=p[1]}return u};qo.subdivideLine=function(e,t,n,i){let o=qo.subdivideLineCount(e,t,n),r=d.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let u=0;u<o;u++){let f=PVe(e,t,u*s,r);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};qo.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,pF),c=n.cartesianToCartographic(o,gF);mF.setEndPoints(a,c);let u=mF.surfaceDistance/r,f=Math.max(0,Math.ceil(P.log2(u))),h=Math.pow(2,f),p=U.distance(e,t),_=p/h,m=s;m.length=h*2;let x=0;for(let b=0;b<h;b++){let T=uoe(e,t,b*_,p);m[x++]=T[0],m[x++]=T[1]}return m};qo.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,pF),s=e.cartesianToCartographic(n,gF),a=new Ya(r,s,e),c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,u),h=a.surfaceDistance/f;l(o)||(o=[]);let p=o;p.length=f*3;let _=0;for(let m=0;m<f;m++){let x=a.interpolateUsingSurfaceDistance(m*h,RVe),b=e.cartographicToCartesian(x,OVe);p[_++]=b.x,p[_++]=b.y,p[_++]=b.z}return p};var MVe=new d,LVe=new d,NVe=new d,FVe=new d;qo.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=y(i,ee.default);let r=MVe,s=LVe,a=NVe,c=FVe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let h=0;h<f;h+=3)d.fromArray(u,h,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=d.multiplyByScalar(r,n,s),s=d.add(c,s,s),u[h+f]=s.x,u[h+1+f]=s.y,u[h+2+f]=s.z,o&&(c=d.clone(a,c)),s=d.multiplyByScalar(r,t,s),s=d.add(c,s,s),u[h]=s.x,u[h+1]=s.y,u[h+2]=s.z}return e};qo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new fx;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=bo(u,d.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let h=c.holes[r],p=h.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=bo(p,d.equalsEpsilon,!0),p.length<3)continue;i.push(p);let _=0;for(l(h.holes)&&(_=h.holes.length),s=0;s<_;s++)o.enqueue(h.holes[s])}i.push(u)}return i};var BVe=new fe;function kVe(e,t,n){let i=n.cartesianToCartographic(e,pF),o=n.cartesianToCartographic(t,gF);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;mF.setEndPoints(i,o);let r=mF.findIntersectionWithLatitude(0,BVe);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>P.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function VVe(e,t,n,i){if(i===tn.RHUMB)return kVe(e,t,n);let o=Zn.lineSegmentPlane(e,t,an.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var UVe=new fe;function zVe(e,t,n){let i=[],o,r,s,a,c,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],s=P.sign(o.z),a=P.sign(r.z);let f=h=>t.cartesianToCartographic(h,UVe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(c=VVe(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function foe(e,t,n,i,o,r,s){let a=[],c=r,u=h=>p=>p.position===h,f=[];do{let h=n[c];a.push(h);let p=i.findIndex(u(c)),_=i[p];if(!l(_)){++c;continue}let{visited:m,type:x,next:b}=_;if(_.visited=!0,x===0){if(b===0){let S=i[p-(s?1:-1)];if(S?.position===c+1)S.visited=!0;else{++c;continue}}if(!m&&s&&b>0||r===c&&!s&&b<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}m||f.push(c);let C=p+(s?1:-1),A=i[C];if(!l(A)){++c;continue}c=A.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let h of f)t=foe(e,++t,n,i,0,h,!s);return t}qo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=zVe(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;o=foe(i,o,s,a,1,0,c)}return i};qo.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new fx;c.enqueue(e);let u=l(r);for(;c.length!==0;){let f=c.dequeue(),h=f.positions,p=f.holes,_,m;if(i)for(m=h.length,_=0;_<m;_++)o.scaleToGeodeticSurface(h[_],h[_]);if(t||(h=bo(h,d.equalsEpsilon,!0)),h.length<3)continue;let x=n(h);if(!l(x))continue;let b=[],T=ri.computeWindingOrder2D(x);if(T===gs.CLOCKWISE&&(x.reverse(),h=h.slice().reverse()),u){u=!1;let D=[h];if(D=r(D,D),D.length>1){for(let O of D)c.enqueue(new Xa(O,p));continue}}let C=h.slice(),A=l(p)?p.length:0,S=[],v;for(_=0;_<A;_++){let D=p[_],O=D.positions;if(i)for(m=O.length,v=0;v<m;++v)o.scaleToGeodeticSurface(O[v],O[v]);if(t||(O=bo(O,d.equalsEpsilon,!0)),O.length<3)continue;let R=n(O);if(!l(R))continue;T=ri.computeWindingOrder2D(R),T===gs.CLOCKWISE&&(R.reverse(),O=O.slice().reverse()),S.push(O),b.push(C.length),C=C.concat(O),x=x.concat(R);let M=0;for(l(D.holes)&&(M=D.holes.length),v=0;v<M;v++)c.enqueue(D.holes[v])}s.push({outerRing:h,holes:S}),a.push({positions:C,positions2D:x,holes:b})}return{hierarchy:s,polygons:a}};var HVe=new U,GVe=new d,WVe=new Oe,jVe=new $;qo.computeBoundingRectangle=function(e,t,n,i,o){let r=Oe.fromAxisAngle(e,i,WVe),s=$.fromQuaternion(r,jVe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=n.length;for(let p=0;p<h;++p){let _=d.clone(n[p],GVe);$.multiplyByVector(s,_,_);let m=t(_,HVe);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=a,o.y=u,o.width=c-a,o.height=f-u,o};qo.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=ri.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let h=c.length,p=new Array(h*3),_=0;for(let b=0;b<h;b++){let T=c[b];p[_++]=T.x,p[_++]=T.y,p[_++]=T.z}let m={attributes:{position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Me.TRIANGLES};u&&(m.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:U.packArray(f)}));let x=new at(m);return r.normal?Nn.computeNormal(x):x}if(s===tn.GEODESIC)return ri.computeSubdivision(e,c,a,f,i);if(s===tn.RHUMB)return ri.computeRhumbLineSubdivision(e,c,a,f,i)};var coe=[],loe=[],qVe=new d,YVe=new d;qo.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,u,f,h,p,_,m,x=e.length,b=0,T=0,C=l(t),A=C?t.positions:void 0;if(o)for(a=x*3*2,s=new Array(a*2),C&&(m=x*2*2,_=new Array(m*2)),c=0;c<x;c++)u=e[c],f=e[(c+1)%x],s[b]=s[b+a]=u.x,++b,s[b]=s[b+a]=u.y,++b,s[b]=s[b+a]=u.z,++b,s[b]=s[b+a]=f.x,++b,s[b]=s[b+a]=f.y,++b,s[b]=s[b+a]=f.z,++b,C&&(h=A[c],p=A[(c+1)%x],_[T]=_[T+m]=h.x,++T,_[T]=_[T+m]=h.y,++T,_[T]=_[T+m]=p.x,++T,_[T]=_[T+m]=p.y,++T);else{let R=P.chordLength(i,n.maximumRadius),M=0;if(r===tn.GEODESIC)for(c=0;c<x;c++)M+=qo.subdivideLineCount(e[c],e[(c+1)%x],R);else if(r===tn.RHUMB)for(c=0;c<x;c++)M+=qo.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],R);for(a=(M+x)*3,s=new Array(a*2),C&&(m=(M+x)*2,_=new Array(m*2)),c=0;c<x;c++){u=e[c],f=e[(c+1)%x];let L,g;C&&(h=A[c],p=A[(c+1)%x]),r===tn.GEODESIC?(L=qo.subdivideLine(u,f,R,loe),C&&(g=qo.subdivideTexcoordLine(h,p,u,f,R,coe))):r===tn.RHUMB&&(L=qo.subdivideRhumbLine(n,u,f,R,loe),C&&(g=qo.subdivideTexcoordRhumbLine(h,p,n,u,f,R,coe)));let E=L.length;for(let w=0;w<E;++w,++b)s[b]=L[w],s[b+a]=L[w];if(s[b]=f.x,s[b+a]=f.x,++b,s[b]=f.y,s[b+a]=f.y,++b,s[b]=f.z,s[b+a]=f.z,++b,C){let w=g.length;for(let I=0;I<w;++I,++T)_[T]=g[I],_[T+m]=g[I];_[T]=p.x,_[T+m]=p.x,++T,_[T]=p.y,_[T+m]=p.y,++T}}}x=s.length;let S=Ne.createTypedArray(x/3,x-e.length*6),v=0;for(x/=6,c=0;c<x;c++){let R=c,M=R+1,L=R+x,g=L+1;u=d.fromArray(s,R*3,qVe),f=d.fromArray(s,M*3,YVe),!d.equalsEpsilon(u,f,P.EPSILON10,P.EPSILON10)&&(S[v++]=R,S[v++]=L,S[v++]=M,S[v++]=M,S[v++]=L,S[v++]=g)}let D={attributes:new hn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),indices:S,primitiveType:Me.TRIANGLES};return C&&(D.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:_})),new at(D)};var Un=qo;function Or(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Or.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Or.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=U.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(P.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=P.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=P.TWO_PI),e}}});var xC=new fe,XVe=new d;Or.prototype.getLatitude=function(e){l(e)||(e=ee.default),xC.latitude=this.conformalLatitude,xC.longitude=this.longitude,xC.height=0;let t=this.ellipsoid.cartographicToCartesian(xC,XVe);return e.cartesianToCartographic(t,xC),xC.latitude};var KVe=new pn,ZVe=new d,$Ve=new d;Or.fromCartesian=function(e,t){let n=P.signNotZero(e.z),i=Or.NORTH_POLE_TANGENT_PLANE,o=Or.SOUTH_POLE;n<0&&(i=Or.SOUTH_POLE_TANGENT_PLANE,o=Or.NORTH_POLE);let r=KVe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=d.subtract(r.origin,o,ZVe),d.normalize(r.direction,r.direction);let s=Zn.rayPlane(r,i.plane,$Ve),a=d.subtract(s,o,s),c=d.dot(i.xAxis,a),u=n*d.dot(i.yAxis,a);return l(t)?(t.position=new U(c,u),t.tangentPlane=i,t):new Or(new U(c,u),i)};Or.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Or.fromCartesian(e[i],t[i]);return t};Or.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Or(e.position,e.tangentPlane)};Or.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));Or.NORTH_POLE=Object.freeze(new d(0,0,.5));Or.SOUTH_POLE=Object.freeze(new d(0,0,-.5));Or.NORTH_POLE_TANGENT_PLANE=Object.freeze(new ns(Or.NORTH_POLE,Or.HALF_UNIT_SPHERE));Or.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new ns(Or.SOUTH_POLE,Or.HALF_UNIT_SPHERE));var Nc=Or;var QVe=new fe,doe=new fe;function JVe(e,t,n,i){let r=i.cartesianToCartographic(e,QVe).height,s=i.cartesianToCartographic(t,doe);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,doe);a.height=r-100,i.cartographicToCartesian(a,n)}var hoe=new qe,eUe=new d,tUe=new d,nUe=new d,iUe=new d,oUe=new d,rUe=new d,_F=new d,Kh=new d,bC=new d,sUe=new U,aUe=new U,cUe=new d,moe=new Oe,lUe=new $,uUe=new $;function V9(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,h=e.rotationAxis,p=e.projectTo2d,_=e.ellipsoid,m=e.stRotation,x=e.perPositionHeight,b=sUe;b.x=f.x,b.y=f.y;let T=t.st?new Float32Array(2*(s/3)):void 0,C;t.normal&&(x&&c&&!a?C=n.attributes.normal.values:C=new Float32Array(s));let A=t.tangent?new Float32Array(s):void 0,S=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,D=0,O=0,R=tUe,M=nUe,L=iUe,g=!0,E=lUe,w=uUe;if(m!==0){let B=Oe.fromAxisAngle(h,m,moe);E=$.fromQuaternion(B,E),B=Oe.fromAxisAngle(h,-m,moe),w=$.fromQuaternion(B,w)}else E=$.clone($.IDENTITY,E),w=$.clone($.IDENTITY,w);let I=0,N=0;c&&u&&(I=s/2,N=s/3,s/=2);for(let B=0;B<s;B+=3){let H=d.fromArray(o,B,cUe);if(t.st&&!l(r)){let V=$.multiplyByVector(E,H,eUe);V=_.scaleToGeodeticSurface(V,V);let G=p([V],aUe)[0];U.subtract(G,b,G);let k=P.clamp(G.x/f.width,0,1),W=P.clamp(G.y/f.height,0,1);u&&(T[D+N]=k,T[D+1+N]=W),c&&(T[D]=k,T[D+1]=W),D+=2}if(t.normal||t.tangent||t.bitangent||i){let V=O+1,G=O+2;if(a){if(B+3<s){let k=d.fromArray(o,B+3,oUe);if(g){let W=d.fromArray(o,B+s,rUe);x&&JVe(H,k,W,_),d.subtract(k,H,k),d.subtract(W,H,W),R=d.normalize(d.cross(W,k,R),R),g=!1}d.equalsEpsilon(k,H,P.EPSILON10)&&(g=!0)}(t.tangent||t.bitangent)&&(L=_.geodeticSurfaceNormal(H,L),t.tangent&&(M=d.normalize(d.cross(L,R,M),M)))}else R=_.geodeticSurfaceNormal(H,R),(t.tangent||t.bitangent)&&(x&&(_F=d.fromArray(C,O,_F),Kh=d.cross(d.UNIT_Z,_F,Kh),Kh=d.normalize($.multiplyByVector(w,Kh,Kh),Kh),t.bitangent&&(bC=d.normalize(d.cross(_F,Kh,bC),bC))),M=d.cross(d.UNIT_Z,R,M),M=d.normalize($.multiplyByVector(w,M,M),M),t.bitangent&&(L=d.normalize(d.cross(R,M,L),L)));t.normal&&(e.wall?(C[O+I]=R.x,C[V+I]=R.y,C[G+I]=R.z):u&&(C[O+I]=-R.x,C[V+I]=-R.y,C[G+I]=-R.z),(c&&!x||a)&&(C[O]=R.x,C[V]=R.y,C[G]=R.z)),i&&(a&&(R=_.geodeticSurfaceNormal(H,R)),v[O+I]=-R.x,v[V+I]=-R.y,v[G+I]=-R.z),t.tangent&&(e.wall?(A[O+I]=M.x,A[V+I]=M.y,A[G+I]=M.z):u&&(A[O+I]=-M.x,A[V+I]=-M.y,A[G+I]=-M.z),c&&(x?(A[O]=Kh.x,A[V]=Kh.y,A[G]=Kh.z):(A[O]=M.x,A[V]=M.y,A[G]=M.z))),t.bitangent&&(u&&(S[O+I]=L.x,S[V+I]=L.y,S[G+I]=L.z),c&&(x?(S[O]=bC.x,S[V]=bC.y,S[G]=bC.z):(S[O]=L.x,S[V]=L.y,S[G]=L.z))),O+=3}}t.st&&!l(r)&&(n.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T})),t.normal&&(n.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(n.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:S})),i&&(n.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,h=new Uint8Array(f);if(e.offsetAttribute===sn.TOP)c&&u||a?h=h.fill(1,0,f/2):c&&(h=h.fill(1));else{let p=e.offsetAttribute===sn.NONE?0:1;h=h.fill(p)}n.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var poe=[];function fUe(e,t,n,i,o,r,s,a,c,u){let f={walls:[]},h;if(s||a){let C=Un.createGeometryFromPositions(e,t,n,i,r,c,u),A=C.attributes.position.values,S=C.indices,v,D;if(s&&a){let O=A.concat(A);v=O.length/3,D=Ne.createTypedArray(v,S.length*2),D.set(S);let R=S.length,M=v/2;for(h=0;h<R;h+=3){let L=D[h]+M,g=D[h+1]+M,E=D[h+2]+M;D[h+R]=E,D[h+1+R]=g,D[h+2+R]=L}if(C.attributes.position.values=O,r&&c.normal){let L=C.attributes.normal.values;C.attributes.normal.values=new Float32Array(O.length),C.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=C.attributes.st.values;C.attributes.st.values=new Float32Array(v*2),C.attributes.st.values=L.concat(L)}C.indices=D}else if(a){for(v=A.length/3,D=Ne.createTypedArray(v,S.length),h=0;h<S.length;h+=3)D[h]=S[h+2],D[h+1]=S[h+1],D[h+2]=S[h];C.indices=D}f.topAndBottom=new wt({geometry:C})}let p=o.outerRing,_=ns.fromPoints(p,e),m=_.projectPointsOntoPlane(p,poe),x=ri.computeWindingOrder2D(m);x===gs.CLOCKWISE&&(p=p.slice().reverse());let b=Un.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new wt({geometry:b}));let T=o.holes;for(h=0;h<T.length;h++){let C=T[h];m=_.projectPointsOntoPlane(C,poe),x=ri.computeWindingOrder2D(m),x===gs.COUNTER_CLOCKWISE&&(C=C.slice().reverse()),b=Un.computeWallGeometry(C,n,e,i,r,u),f.walls.push(new wt({geometry:b}))}return f}function mf(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Ie.DEFAULT),i=y(e.ellipsoid,ee.default),o=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),u=y(e.height,0),f=y(e.extrudedHeight,u);if(!c){let h=Math.max(u,f);f=Math.min(u,f),u=h}this._vertexFormat=Ie.clone(n),this._ellipsoid=ee.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,tn.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Un.computeHierarchyPackedLength(t,d)+ee.packedLength+Ie.packedLength+(s?Un.computeHierarchyPackedLength(s,U):1)+12}mf.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new mf(t)};mf.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=Un.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n++]=e.packedLength,t};var dUe=ee.clone(ee.UNIT_SPHERE),hUe=new Ie,mUe={polygonHierarchy:{}};mf.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,dUe);t+=ee.packedLength;let r=Ie.unpack(e,t,hUe);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,h=e[t++]===1,p=e[t++]===1,_=e[t++]===1,m=e[t++]===1,x=e[t++],b=e[t++],T=e[t]===-1?void 0:Un.unpackPolygonHierarchy(e,t,U);l(T)?(t=T.startingIndex,delete T.startingIndex):t++;let C=e[t++];return l(n)||(n=new mf(mUe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=h,n._closeTop=p,n._closeBottom=_,n._shadowVolume=m,n._offsetAttribute=x===-1?void 0:x,n._arcType=b,n._textureCoordinates=T,n.packedLength=C,n};var pUe=new U,gUe=new U,_Ue=new Nc;function goe(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+P.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==tn.RHUMB){let p=U.subtract(t.position,e.position,pUe),_=U.dot(t.position,p)/U.dot(p,p);if(_>0&&_<1){let m=U.add(t.position,U.multiplyByScalar(p,-_,p),gUe),x=Nc.clone(t,_Ue);x.position=m;let b=x.getLatitude(n);r.south=Math.min(r.south,b),r.north=Math.max(r.north,b),Math.abs(c)>Math.abs(b)&&(u=b)}}let f=t.x*e.y-e.x*t.y,h=Math.sign(f);h!==0&&(h*=U.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=h),u<=0&&(o.southAngle+=h)}var _oe=new Nc,yUe=new Nc,hf={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};mf.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new se),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,hf.northAngle=0,hf.southAngle=0,hf.westOverIdl=Number.POSITIVE_INFINITY,hf.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=Nc.fromCartesian(e[0],yUe);for(let s=1;s<o;s++){let a=Nc.fromCartesian(e[s],_oe);goe(a,r,t,n,hf,i),r=Nc.clone(a,r)}return goe(Nc.fromCartesian(e[0],_oe),r,t,n,hf,i),i.east-i.west>hf.eastOverIdl-hf.westOverIdl&&(i.west=hf.westOverIdl,i.east=hf.eastOverIdl,i.east>P.PI&&(i.east=i.east-P.TWO_PI),i.west>P.PI&&(i.west=i.west-P.TWO_PI)),P.equalsEpsilon(Math.abs(hf.northAngle),P.TWO_PI,P.EPSILON10)&&(i.north=P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),P.equalsEpsilon(Math.abs(hf.southAngle),P.TWO_PI,P.EPSILON10)&&(i.south=-P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),i};var xUe=new Nc;function bUe(e,t,n){return e.height>=P.PI||e.width>=P.PI?Nc.fromCartesian(t[0],xUe).tangentPlane:ns.fromPoints(t,n)}var yoe=new fe;function TUe(e,t,n){return(i,o)=>{if(e.height>=P.PI||e.width>=P.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],yoe);o[s]=new U(a.longitude/P.PI,a.latitude/P.PI_OVER_TWO)}return o.length=i.length,o}return Nc.fromCartesianArray(i,o)}return ns.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function CUe(e,t,n){if(e.height>=P.PI||e.width>=P.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,yoe);return l(r)||(r=new U),r.x=s.longitude/P.PI,r.y=s.latitude/P.PI_OVER_TWO,r}return Nc.fromCartesian(o,r)};let i=ns.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function AUe(e,t,n,i){return(o,r)=>!i&&(e.height>=P.PI_OVER_TWO||e.width>=2*P.PI_OVER_THREE)?Un.splitPolygonsOnEquator(o,t,n,r):o}function EUe(e,t,n,i){if(t.height>=P.PI||t.width>=P.PI)return qe.fromRectangle(t,void 0,hoe);let o=e,r=ns.fromPoints(o,n);return Un.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,hoe)}mf.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,h=l(f),p=r.positions;if(p.length<3)return;let _=e.rectangle,m=Un.polygonsFromHierarchy(r,h,TUe(_,p,n),!s,n,AUe(_,n,u,s)),x=m.hierarchy,b=m.polygons,T=function(I){return I},C=h?Un.polygonsFromHierarchy(f,!0,T,!1,n).polygons:void 0;if(x.length===0)return;let A=x[0].outerRing,S=EUe(A,_,n,o),v=[],D=e._height,O=e._extrudedHeight,R=e._perPositionHeightExtrude||!P.equalsEpsilon(D,O,0,P.EPSILON2),M={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:bUe(_,A,n).plane.normal,projectTo2d:CUe(_,A,n),boundingRectangle:S,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(R)for(M.extrude=!0,M.top=a,M.bottom=c,M.shadowVolume=e._shadowVolume,M.offsetAttribute=e._offsetAttribute,L=0;L<b.length;L++){let I=fUe(n,b[L],h?C[L]:void 0,i,x[L],s,a,c,t,u),N;a&&c?(N=I.topAndBottom,M.geometry=Un.scaleToGeodeticHeightExtruded(N.geometry,D,O,n,s)):a?(N=I.topAndBottom,N.geometry.attributes.position.values=ri.scaleToGeodeticHeight(N.geometry.attributes.position.values,D,n,!s),M.geometry=N.geometry):c&&(N=I.topAndBottom,N.geometry.attributes.position.values=ri.scaleToGeodeticHeight(N.geometry.attributes.position.values,O,n,!0),M.geometry=N.geometry),(a||c)&&(M.wall=!1,N.geometry=V9(M),v.push(N));let B=I.walls;M.wall=!0;for(let H=0;H<B.length;H++){let V=B[H];M.geometry=Un.scaleToGeodeticHeightExtruded(V.geometry,D,O,n,s),V.geometry=V9(M),v.push(V)}}else for(L=0;L<b.length;L++){let I=new wt({geometry:Un.createGeometryFromPositions(n,b[L],h?C[L]:void 0,i,s,t,u)});if(I.geometry.attributes.position.values=ri.scaleToGeodeticHeight(I.geometry.attributes.position.values,D,n,!s),M.geometry=I.geometry,I.geometry=V9(M),l(e._offsetAttribute)){let N=I.geometry.attributes.position.values.length,B=e._offsetAttribute===sn.NONE?0:1,H=new Uint8Array(N/3).fill(B);I.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:H})}v.push(I)}let g=Nn.combineInstances(v)[0];g.attributes.position.values=new Float64Array(g.attributes.position.values),g.indices=Ne.createTypedArray(g.attributes.position.values.length/3,g.indices);let E=g.attributes,w=ae.fromVertices(E.position.values);return t.position||delete E.position,new at({attributes:E,indices:g.indices,primitiveType:g.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};mf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new mf({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function SUe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return at._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(mf.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=mf.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=SUe(this)),this._textureCoordinateRotationPoints}}});var A_=mf;function hx(e){this._ellipsoid=y(e.ellipsoid,ee.default),this._positions=[...e.positions]}Object.defineProperties(hx.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});hx.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new hx({positions:e.positions,ellipsoid:e.ellipsoid})};hx.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};hx.prototype.computeRectangle=function(e){return A_.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var vUe=new se,xoe=new d;hx.prototype.computeSphericalExtents=function(e){l(e)||(e=new se);let t=this.computeRectangle(vUe),n=fe.toCartesian(se.southwest(t),this.ellipsoid,xoe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=P.fastApproximateAtan2(i,n.z),r=P.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=fe.toCartesian(se.northeast(t),this.ellipsoid,xoe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=P.fastApproximateAtan2(i,n.z),r=P.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var dw=hx;function qr(e){e=y(e,y.EMPTY_OBJECT),this._polygons=[],this._totalPositions=0,this.enabled=y(e.enabled,!0),this.inverse=y(e.inverse,!1),this.polygonAdded=new me,this.polygonRemoved=new me,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(qr.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});qr.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};qr.prototype.get=function(e){return this._polygons[e]};qr.prototype.contains=function(e){return this._polygons.some(t=>dw.equals(t,e))};qr.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>dw.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var wUe=new se;function DUe(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=se.clone(a);f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI);let h=[r];for(let p=0;p<t.length;++p){let _=t[p];if(l(_)&&l(se.simpleIntersection(_,f))&&!se.equals(_,f)){let m=n[p];h.push(...m),m.reduce((x,b)=>se.union(e[b].computeSphericalExtents(wUe),x,x),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=se.clone(a,f),f.south-=c,f.west-=u,f.north+=c,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),p=-1}}t.push(f),n.push(h)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}qr.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function IUe(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=DUe(i),s=0;for(let[c,u]of i.entries()){let f=u.length;t[s++]=f,t[s++]=r.get(c);for(let h=0;h<f;++h){let p=u.positions[h],_=Math.hypot(p.x,p.y),m=P.fastApproximateAtan2(_,p.z),x=P.fastApproximateAtan2(p.x,p.y);t[s++]=m,t[s++]=x}}let a=0;for(let c of o){let u=1/(c.east-c.west),f=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=f,n[a++]=u}e._extentsCount=o.length}var U9=new U;qr.prototype.update=function(e){let t=e.context;if(!qr.isSupported(e))throw new re("ClippingPolygonCollections are only supported for WebGL 2.");let n=this._polygons.reduce((s,a)=>s+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let s=qr.getTextureResolution(i,this.pixelsNeededForPolygonPositions,U9);i=new Ot({context:t,width:s.x,height:s.y,pixelFormat:tt.RG,pixelDatatype:Ke.FLOAT,sampler:$t.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(l(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let s=qr.getTextureResolution(o,this.pixelsNeededForExtents,U9);o=new Ot({context:t,width:s.x,height:s.y,pixelFormat:tt.RGBA,pixelDatatype:Ke.FLOAT,sampler:$t.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(IUe(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(r)){let s=qr.getClippingDistanceTextureResolution(this,U9);r=new Ot({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?tt.RED:tt.LUMINANCE,pixelDatatype:Ke.FLOAT,sampler:new $t({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR,magnificationFilter:di.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=PUe(this)};qr.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function PUe(e){let t=e._polygonsTexture,n=e._extentsTexture;return new al({fragmentShaderSource:cL,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var boe=new se,RUe=new se;qr.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=jt.OUTSIDE;this.inverse&&(o=jt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let f=e.boundingVolume.computeCorners();c=se.fromCartesianArray(f,t,boe)}l(c)||(c=se.fromBoundingSphere(e.boundingSphere,t,boe));let u=se.simpleIntersection(c,a,RUe);l(u)&&(o=jt.INTERSECTING)}return o};qr.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};qr.isSupported=function(e){return e?.context.webgl2};qr.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Bt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};qr.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Bt.maximumTextureSize,4096),t.y=Math.min(Bt.maximumTextureSize,4096),t)};qr.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):qr.getTextureResolution(n,e.pixelsNeededForExtents,t)};qr.prototype.isDestroyed=function(){return!1};qr.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),ue(this)};var Zh=qr;var hw={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};hw.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?hw.SUNLIGHT:hw.SCENE_LIGHT:hw.NONE};var E_=Object.freeze(hw);function Toe(){this.lightIntensity=10,this.rayleighCoefficient=new d(55e-7,13e-6,284e-7),this.mieCoefficient=new d(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=E_.NONE}Toe.requiresColorCorrect=function(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))};var TC=Toe;function Qn(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,e=y(e,y.EMPTY_OBJECT);let t=Math.min(y(e.mipmapLevels,10),Math.log2(Bt.maximumCubeMapSize));this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Qn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Z;let n=Math.pow(2,t-1);this._textureDimensions=new U(n,n),this._radiiAndDynamicAtmosphereColor=new d,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=y(e.enabled,!0),this.shouldUpdate=!0,this.maximumSecondsDifference=y(e.maximumSecondsDifference,60*60),this.maximumPositionEpsilon=y(e.maximumPositionEpsilon,1e3),this.atmosphereScatteringIntensity=y(e.atmosphereScatteringIntensity,2),this.gamma=y(e.gamma,1),this.brightness=y(e.brightness,1),this.saturation=y(e.saturation,1),this.groundColor=y(e.groundColor,Qn.AVERAGE_EARTH_GROUND_COLOR),this.groundAlbedo=y(e.groundAlbedo,.31)}Object.defineProperties(Qn.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){d.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=d.clone(e,this._position),this.reset())}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});Qn._maximumComputeCommandCount=8;Qn._activeComputeCommandCount=0;Qn._nextFrameCommandQueue=[];Qn._queueCommand=(e,t)=>{if(Qn._activeComputeCommandCount>=Qn._maximumComputeCommandCount){Qn._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Qn._activeComputeCommandCount++};Qn._updateCommandQueue=e=>{if(Qn._maximumComputeCommandCount=Math.log2(Bt.maximumCubeMapSize),Qn._nextFrameCommandQueue.length>0&&Qn._activeComputeCommandCount<Qn._maximumComputeCommandCount){let t=Qn._nextFrameCommandQueue.shift();for(;l(t)&&Qn._activeComputeCommandCount<Qn._maximumComputeCommandCount;){if(t.canceled){t=Qn._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Qn._activeComputeCommandCount++,t=Qn._nextFrameCommandQueue.shift()}}};Qn.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Qn.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0,Qn._activeComputeCommandCount--),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0,Qn._activeComputeCommandCount--),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,Qn._activeComputeCommandCount--,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0};var OUe=new d,MUe=new d;function LUe(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,MUe),s=1.025,a=OUe,c=l(r)?d.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!d.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(d.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Coe=new d,NUe=new F,FUe=new oe,BUe=new z;function kUe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new wr({context:n,width:i.x,height:i.y,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:tt.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new Ue({sources:[Ph,JM]}),e._radianceMapFS=o),TC.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=Mt.eastNorthUpToFixedFrame(r,a,NUe),u=FUe;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let h of wr.faceNames()){let p=e._radianceMapTextures[f];l(p)&&p.destroy(),p=new Ot({context:n,width:i.x,height:i.y,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:tt.RGBA}),e._radianceMapTextures[f]=p;let _=f,m=new al({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>wr.getDirection(h,Coe),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,BUe)},persists:!0,owner:e,postExecute:()=>{let x=e._radianceMapComputeCommands;if(!l(x[_]))return;x[_]=void 0;let b=new zr({context:n,colorTextures:[e._radianceMapTextures[_]],destroyAttachments:!1});b._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),b._unBind(),b.destroy(),Qn._activeComputeCommandCount--,x.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)}});e._radianceMapComputeCommands[f]=m,Qn._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function VUe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,u=(h,p,_,m)=>()=>{let x=e._convolutionComputeCommands;!l(x[h])||x[h].canceled||(x[h]=void 0,n.copyFace(t,p,_,m),c++,Qn._activeComputeCommandCount--,c===e._specularMapTextures.length&&(e._irradianceCommandDirty=!0,n.sampler=new $t({minificationFilter:Zt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0))},f=0;for(let h=1;h<i;++h){for(let p of wr.faceNames()){let _=e._specularMapTextures[f]=new Ot({context:a,width:r,height:s,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:tt.RGBA}),m=e._va;l(m)||(m=wr.createVertexArray(a,p),e._va=m);let x=e._convolveSP;l(x)||(x=en.fromCache({context:a,vertexShaderSource:tL,fragmentShaderSource:eL,attributeLocations:{positions:0}}),e._convolveSP=x);let b=new al({shaderProgram:x,vertexArray:m,outputTexture:_,persists:!0,owner:e,uniformMap:{u_roughness:()=>h/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>wr.getDirection(p,Coe)},postExecute:u(f,_,p,h)});e._convolutionComputeCommands[f]=b,Qn._queueCommand(b,t),++f}r/=2,s/=2}}var Aoe=new U(3,3);function UUe(e,t){let n=t.context,i=Aoe,o=e._irradianceMapTexture;l(o)||(o=new Ot({context:n,width:i.x,height:i.y,pixelDatatype:Ke.FLOAT,pixelFormat:tt.RGBA}),e._irradianceMapTexture=o);let r=e._irradianceMapFS;l(r)||(r=new Ue({sources:[QM]}),e._irradianceMapFS=r);let s=new al({fragmentShaderSource:r,outputTexture:o,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture},postExecute:()=>{l(e._irradianceComputeCommand)&&(e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,Qn._activeComputeCommandCount--)}});e._irradianceComputeCommand=s,Qn._queueCommand(s,t),e._irradianceTextureDirty=!0}function zUe(e,t){let n=t.context,i=new zr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Aoe,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=d.unpack(r,s*4),d.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._shouldRegenerateShaders=!0}Qn.prototype.update=function(e){let t=e.mode;if(!Qn.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===ne.MORPHING){this._shouldRegenerateShaders=!1;return}Qn._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting;if((LUe(this,e)||i===E_.SUNLIGHT&&!Z.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference))&&(this.reset(),this._lastTime=Z.clone(e.time,this._lastTime)),this._radianceMapDirty&&(kUe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(VUe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(UUe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){zUe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Qn.prototype.isDestroyed=function(){return!1};Qn.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&this._irradianceMapTexture.destroy(),ue(this)};Qn.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Qn.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(z.fromCssColorString("#717145"));Qn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new d(.35449,.35449,.35449)),d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO]);var S_=Qn;var mw={HIGHLIGHT:0,REPLACE:1,MIX:2};mw.getColorBlend=function(e,t){if(e===mw.HIGHLIGHT)return 0;if(e===mw.REPLACE)return 1;if(e===mw.MIX)return P.clamp(t,P.EPSILON4,1)};var Fc=Object.freeze(mw);var HUe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},Bc=Object.freeze(HUe);var GUe={STEP:0,LINEAR:1,CUBICSPLINE:2},$h=Object.freeze(GUe);var Eoe={};function pw(e){this._count=e.count,this._properties=Ge(e.properties,!0)}pw.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,Eoe)};pw.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,Eoe,e)};pw.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ge(n[e],!0)};pw.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ge(n,!0)};var v_=pw;function Ja(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(Ja.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});Ja.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};Ja.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Ja.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};Ja.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var z9=[];Ja.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(z9)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,z9)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(z9)),t};Ja.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};Ja.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new v_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Ja.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Ja.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Ja.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Ja.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Ja.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Ja.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Ja.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var Tl=Ja;function gw(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=ou.createModelTextureReader({textureInfo:r,channels:qUe(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(gw.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});gw.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(xt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(xt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==lt.SCALAR?(xt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Vt.UINT8?(xt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:lt.isVectorType(t)||t===lt.SCALAR?n!==Vt.UINT8?(xt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(xt(`Property texture property ${e.id} has an unsupported type`),!1)};var WUe=[void 0,"float","vec2","vec3","vec4"],jUe=[void 0,"int","ivec2","ivec3","ivec4"];gw.prototype.getGlslType=function(){let e=this._classProperty,t=lt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?WUe[t]:jUe[t]};gw.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function qUe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var yF=gw;function H9(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new yF({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(H9.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});H9.prototype.getProperty=function(e){return this._properties[e]};var w_=H9;function Soe(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=y(i,n.offset),o=y(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Soe.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var xF=Soe;function G9(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new xF({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(G9.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});G9.prototype.getProperty=function(e){return this._properties[e]};var CC=G9;function _w(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(_w.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});_w.prototype.getPropertyTable=function(e){return this._propertyTables[e]};_w.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};_w.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var ea=_w;function YUe(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=new nu({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Tl({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new w_({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new CC({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new ea({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var bF=YUe;function XUe(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],u=n.classes[c.class],f=new nu({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new Tl({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new w_({id:a,propertyTexture:KUe(c),class:n.classes[c.class],textures:e.textures}))}return new ea({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function KUe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:ZUe(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=bt(o.texture,r,!0)}return t}function ZUe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var TF=XUe;function D_(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:u=!0}=e;this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(D_.prototype=Object.create(Ki.prototype),D_.prototype.constructor=D_);Object.defineProperties(D_.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function $Ue(e){try{let t=nze(e),n=aze(e),i=cze(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=gt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load structural metadata",t)}}D_.prototype.load=function(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=$Ue(this),this._promise)};function QUe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function JUe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function eze(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];QUe(o.properties,n)}return n}function tze(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&JUe(r,n)}}return n}async function nze(e){let t;l(e._extension)?t=eze(e._extension):t=tze(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Ei.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function ize(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&oze(r,t)}return t}function oze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function rze(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&sze(r,t)}}return t}function sze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function aze(e){let t;l(e._extension)?t=ize(e._extension):t=rze(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Ei.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function cze(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Ei.getSchemaLoader({resource:i})}else n=Ei.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}D_.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[c]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],u=t[a];u.isDestroyed()||(s[c]=u.texture)}return l(this._extension)?this._structuralMetadata=bF({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=TF({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),voe(this),this._state=gt.READY,!0};function voe(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ei.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function lze(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ei.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}D_.prototype.unload=function(){voe(this),lze(this),l(this._schemaLoader)&&Ei.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var CF=D_;var AC={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};AC.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return AC.TRANSLATION;case"ROTATION":return AC.ROTATION;case"SCALE":return AC.SCALE;case"_FEATURE_ID":return AC.FEATURE_ID}};var rs=Object.freeze(AC);var uze=65534,fze=255;function AF(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Ioe(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],dze(this)}Object.defineProperties(AF.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function dze(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],h=!1,p=h||n.hasEdge(c,u),_=h||n.hasEdge(u,f),m=h||n.hasEdge(f,c),x=woe(i,c,u,f,p,_,m);for(;l(x);){let b=s[x];if(!l(b)){b=r+o.length;let T=x;for(;T>=r;)T=o[T-r];o.push(T),s[x]=b}b>uze&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>fze&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=b,t[a]=b):x===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),x=woe(i,c,u,f,p,_,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function woe(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,u=0,f=W9(e,t,a,c,u);if(f===0)return t;let h=0,p=o?1:0,_=r?1:0,m=W9(e,n,h,p,_);if(m===0)return n;let x=s?1:0,b=0,T=r?1:0,C=W9(e,i,x,b,T);if(C===0)return i;let A=f&m&C,S,v,D;if(A&1)S=0,v=1,D=2;else if(A&2)S=0,D=1,v=2;else if(A&4)v=0,S=1,D=2;else if(A&8)v=0,D=1,S=2;else if(A&16)D=0,S=1,v=2;else if(A&32)D=0,v=1,S=2;else{let L=j9(f),g=j9(m),E=j9(C);return L<g&&L<E?t:g<E?n:i}let O=t*3;e[O+S]=a,e[O+v]=c,e[O+D]=u;let R=n*3;e[R+S]=h,e[R+v]=p,e[R+D]=_;let M=i*3;e[M+S]=x,e[M+v]=b,e[M+D]=T}function W9(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function j9(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}AF.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};AF.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Bt.maximumTextureSize),i=n,o=Doe(i),r=[];for(;i>1;)i>>=1,r.push(Doe(i));let s=new Ot({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:tt.LUMINANCE,sampler:new $t({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR_MIPMAP_LINEAR,magnificationFilter:di.LINEAR})});return t.outlineTexture=s,s};function Doe(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Ioe(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}Ioe.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var EC=AF;function Poe(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function hze(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function EF(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}EF.prototype.postProcess=function(e){this.needsOutlines&&(mze(this),gze(this,e))};function mze(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new EC({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ne.fromTypedArray(n.typedArray);let r=pze(o.outlineCoordinates),s=new Poe(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function pze(e){let t=new bn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=X.FLOAT,t.type=on.VEC3,t.normalized=!1,t.count=e.length/3,t}function gze(e,t){_ze(e.attributePlans,t),l(e.indicesPlan)&&yze(e.indicesPlan,t)}function _ze(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=yt.createVertexBuffer({typedArray:s,context:t,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function yze(e,t){let n=e.indices;if(e.loadBuffer){let i=yt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Fe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}EF.AttributeLoadPlan=Poe;EF.IndicesLoadPlan=hze;var SC=EF;function xze(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var SF=xze;function Roe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Roe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var vF=Roe;function Ooe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(Ooe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var wF=Ooe;function Moe(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Moe.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var DF=Moe;var bze={Direct:"Direct",Indirect:"Indirect"},mx=Object.freeze(bze);function Loe(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(Loe.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var yw=Loe;function Noe(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Noe.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var IF=Noe;function vC(){}function Foe(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function Tze(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d);return new vF({position:t,adjustmentParams:n})}function Cze(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d),i=Foe(e.covarianceMatrix);return new wF({position:t,adjustmentParams:n,covarianceMatrix:i})}function Aze(e){let t=e.groupFlags,n=d.fromArray(e.rotationThetas,0,new d),i=[];for(let r of e.params){let s=new IF({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new DF({groupFlags:t,rotationThetas:n,params:i})}vC.load=function(e){let t=e.storageType;if(t===mx.Direct)return vC.loadDirect(e);if(t===mx.Indirect)return vC.loadIndirect(e);throw new re(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};vC.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=Tze(r);t.push(s)}let i=Foe(e.covarianceDirectUpperTriangle);return new yw({storageType:mx.Direct,anchorPointsDirect:t,covarianceDirect:i})};vC.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=Cze(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=Aze(s);o.push(a)}return new yw({storageType:mx.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var PF=vC;function Boe(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(Boe.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var RF=Boe;function koe(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(koe.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var OF=koe;function Voe(e){this._ppeTextures=e}Object.defineProperties(Voe.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var MF=Voe;function pr(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=y(e.asynchronous,!0);this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(pr.prototype=Object.create(Ki.prototype),pr.prototype.constructor=pr);Object.defineProperties(pr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});pr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=gt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=gt.FAILED,this.getError("Failed to load GPM data",e)}};pr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=this._loadResources(this),this._promise)};function Eze(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}pr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=Eze(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Ei.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};pr.ppeTexturesMetadataSchemaCache=new Map;pr._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,o=e.offset??0,r=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:o,scale:r,min:n.min,max:n.max}}}};pr._obtainPpeTexturesMetadataSchema=function(e){let n=pr._collectPpeTexturePropertyIdentifiers(e).toString(),i=pr.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${pr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=pr._createPpeTextureClassJson(c,a);r.classes[u]=f}return i=df.fromJson(r),pr.ppeTexturesMetadataSchemaCache.set(n,i),i};pr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=pr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};pr._convertToStructuralMetadata=function(e,t){let n=[],i=pr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,f=a.traits.source,h=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new w_({id:s,name:a.name,propertyTexture:p,class:h,textures:t}))}return new ea({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};pr.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let h=t[u].process(e);i=i&&h}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],h=t[u];h.isDestroyed()||(o[f]=h.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let h=f.traits,p=new OF({min:h.min,max:h.max,source:h.source}),_=new RF({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(_)}}let a=new MF(r);this._meshPrimitiveGpmLocal=a;let c=pr._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=gt.READY,!0};pr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Ei.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};pr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var LF=pr;var{Attribute:Sze,Indices:vze,FeatureIdAttribute:Uoe,FeatureIdTexture:zoe,FeatureIdImplicitRange:Hoe,MorphTarget:wze,Primitive:Dze,Instances:Ize,Skin:Pze,Node:Rze,AnimatedPropertyType:Oze,AnimationSampler:Mze,AnimationTarget:Lze,AnimationChannel:Nze,Animation:Fze,ArticulationStage:Bze,Articulation:kze,Asset:Vze,Scene:Uze,Components:zze,MetallicRoughness:Hze,SpecularGlossiness:Gze,Specular:Wze,Anisotropy:q9,Clearcoat:Y9,Material:jze}=bn,vo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Ad(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=No.Y,forwardAxis:a=No.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:u=!1,enablePick:f=!1,loadIndicesForWireframe:h=!1,loadPrimitiveOutline:p=!0,loadForClassification:_=!1,renameBatchIdSemantic:m=!1}=e,{baseResource:x=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=x,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=c,this._loadAttributesFor2D=u,this._enablePick=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._loadForClassification=_,this._renameBatchIdSemantic=m,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=vo.NOT_LOADED,this._textureState=vo.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(Ad.prototype=Object.create(Ki.prototype),Ad.prototype.constructor=Ad);Object.defineProperties(Ad.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function qze(e){e._state=vo.LOADING,e._textureState=vo.LOADING;try{let t=Ei.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=vo.LOADED,e._textureState=vo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=vo.FAILED,e._textureState=vo.FAILED,NF(e,t)}}async function Yze(e,t){Ht.supportsWebP.initialized||await Ht.supportsWebP.initialize(),e._supportedImageFormats=new SF({webp:Ht.supportsWebP(),basis:t.context.supportsBasis});let n=Z4e(e,t);return e._state=vo.PROCESSING,e._textureState=vo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ei.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}Ad.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=qze(this),this._promise)};function NF(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function Xze(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(l(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(l(r)){let s=r.process(t);s&&(l(e._components.structuralMetadata)&&xt("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&s}n&&(e._state=vo.POST_PROCESSING)}function Kze(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&Zze(e,o)}}function Zze(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let c=r[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}Ad.prototype._process=function(e){return this._state===vo.READY?!0:(this._state===vo.PROCESSING&&Xze(this,e),this._resourcesLoaded&&this._state===vo.POST_PROCESSING&&(Kze(this,e.context),this._state=vo.PROCESSED),this._resourcesLoaded&&this._state===vo.PROCESSED?($oe(this),this._typedArray=void 0,this._state=vo.READY,!0):!1)};Ad.prototype._processTextures=function(e){if(this._textureState===vo.READY)return!0;if(this._textureState!==vo.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&l(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=vo.READY,this._texturesLoaded=!0,!0):!1};Ad.prototype.process=function(e){if(this._state===vo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=Yze(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=vo.FAILED;let o=this._processError;this._processError=void 0,NF(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===vo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=vo.FAILED,NF(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=vo.FAILED,NF(this,o)}return this._incrementallyLoadTextures?n:n&&i};function $ze(e,t,n,i,o,r,s){let a=e.gltfJson,u=a.accessors[t].bufferView;return Ei.getVertexBufferLoader({gltf:a,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,bufferViewId:u,draco:i,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function Qze(e,t,n,i,o,r){return Ei.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:r,draco:n,asynchronous:e._asynchronous,loadBuffer:i,loadTypedArray:o})}function Jze(e,t){let n=Ei.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Goe(e,t,n){let i=t.byteOffset,o=iu(e,t),r=t.count,s=ff(t.type),a=t.componentType,c=X.getSizeInBytes(a),u=c*s,f=r*s;if(o===u)return n=new Uint8Array(n),X.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let h=X.createTypedArray(a,f),p=new DataView(n.buffer),_=new Array(s),m=p_(t.componentType);i=n.byteOffset+i;for(let x=0;x<r;++x){m(p,i,s,c,_);for(let b=0;b<s;++b)h[x*s+b]=_[b];i+=o}return h}function e4e(e,t){let n=e.type;if(n===on.SCALAR)return t.fill(0);let i=on.getMathType(n);return t.fill(i.clone(i.ZERO))}function t4e(e,t,n,i){let o=e.type,r=e.count;if(o===on.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===on.VEC4&&i)for(let s=0;s<r;s++)n[s]=Oe.unpack(t,s*4);else{let s=on.getMathType(o),a=on.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function n4e(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=Goe(r,n,t.typedArray);i=y(i,!1),t4e(n,s,o,i)}function FF(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=Jze(e,o),s=n4e(e,r,t,n,i);return e._loaderPromises.push(s),i}return e4e(t,i)}function au(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function i4e(e){return e===Number?0:new e}function o4e(e){switch(e){case X.BYTE:return 127;case X.UNSIGNED_BYTE:return 255;case X.SHORT:return 32767;case X.UNSIGNED_SHORT:return 65535;default:return 1}}var r4e={VEC2:new U(-1,-1),VEC3:new d(-1,-1,-1),VEC4:new oe(-1,-1,-1,-1)};function s4e(e,t){let n=o4e(e.componentDatatype),i=r4e[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function a4e(e,t,n){let i=e.decodeMatrix,o=au(n,e.decodedMin),r=au(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new bn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new U(i[6],i[7]),s.quantizedVolumeStepSize=new U(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new d(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new d(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new oe(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new oe(i[0],i[6],i[12],i[18])),t.quantization=s}function c4e(e,t,n,i,o){let r=e.accessors[t],s=on.getMathType(r.type),a=y(r.normalized,!1),c=new Sze;c.name=n,c.semantic=i,c.setIndex=o,c.constant=i4e(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=au(s,r.min),c.max=au(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=iu(e,r),oi(r,"WEB3D_quantized_attributes")&&a4e(r.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===Et.POSITION||c.semantic===Et.NORMAL||c.semantic===Et.TANGENT||c.semantic===Et.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&s4e(c,s),c}function Woe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var l4e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function X9(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=l4e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function u4e(e){let t=e===Et.POSITION,n=e===Et.FEATURE_ID,i=e===Et.TEXCOORD;return t||n||i}function f4e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=X.createArrayBufferView(o,t.typedArray.buffer)}}function d4e(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Goe(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function joe(e,t,n,i,o,r,s){let a=e.gltfJson,c=a.accessors[t],u=c.bufferView,f=n.gltfSemantic,h=n.renamedSemantic,p=n.modelSemantic,_=l(p)?Woe(h):void 0,x=c4e(a,t,f,p,_);if(!l(i)&&!l(u))return x;let b=$ze(e,t,f,i,o,r,s),T=e._geometryLoaders.length;e._geometryLoaders.push(b);let C=b.load();return e._loaderPromises.push(C),e._geometryCallbacks[T]=()=>{l(i)&&l(i.attributes)&&l(i.attributes[f])?f4e(x,b,o,r):d4e(a,c,x,b,o,r)},x}function qoe(e,t,n,i,o,r,s){let a=n.modelSemantic,c=a===Et.POSITION,u=a===Et.FEATURE_ID,f=c&&!o&&e._loadAttributesFor2D&&!s.scene3DOnly,h=c&&e._enablePick&&!s.context.webgl2,p=e._loadForClassification&&u,_=e._loadAttributesAsTypedArray,m=!_,x=_||f||h||p,C=joe(e,t,n,i,r?!1:m,r?!0:x,s),A=new SC.AttributeLoadPlan(C);return A.loadBuffer=m,A.loadTypedArray=x,A}function h4e(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=X9(e,rs,i),u=c.modelSemantic,f=u===rs.TRANSLATION||u===rs.ROTATION||u===rs.SCALE,h=u===rs.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,_=e._enablePick&&!o.context.webgl2,m=!p,x=e._loadAttributesFor2D&&!o.scene3DOnly;return joe(e,t,c,void 0,m,p||h&&(!a||x||_),o)}function m4e(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView;if(!l(n)&&!l(a))return;let c=new vze;c.count=s.count;let u=e._loadAttributesAsTypedArray,f=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,h=e._loadForClassification&&i,_=!u,m=u||f||h,T=Qze(e,t,n,o?!1:_,o?!0:m,r),C=e._geometryLoaders.length;e._geometryLoaders.push(T);let A=T.load();e._loaderPromises.push(A),e._geometryCallbacks[C]=()=>{c.indexDatatype=T.indexDatatype,c.buffer=T.buffer,c.typedArray=T.typedArray};let S=new SC.IndicesLoadPlan(c);return S.loadBuffer=_,S.loadTypedArray=m,S}function kc(e,t,n,i){let o=e.gltfJson,r=ou.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Ei.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=ou.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=vo.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function p4e(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new Gze;return l(i)&&(c.diffuseTexture=kc(e,i,n)),l(o)&&(c.specularGlossinessTexture=kc(e,o,n)),c.diffuseFactor=au(oe,r),c.specularFactor=au(d,s),c.glossinessFactor=a,c}function g4e(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new Hze;return l(i)&&(c.baseColorTexture=kc(e,i,n)),l(o)&&(c.metallicRoughnessTexture=kc(e,o,n)),c.baseColorFactor=au(oe,r),c.metallicFactor=s,c.roughnessFactor=a,c}function _4e(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new Wze;return l(o)&&(a.specularTexture=kc(e,o,n)),l(s)&&(a.specularColorTexture=kc(e,s,n)),a.specularFactor=i,a.specularColorFactor=au(d,r),a}function y4e(e,t,n){let{anisotropyStrength:i=q9.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=q9.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new q9;return l(r)&&(s.anisotropyTexture=kc(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function x4e(e,t,n){let{clearcoatFactor:i=Y9.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Y9.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new Y9;return l(o)&&(c.clearcoatTexture=kc(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=kc(e,s,n)),l(a)&&(c.clearcoatNormalTexture=kc(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function b4e(e,t,n){let i=new jze,o=y(t.extensions,y.EMPTY_OBJECT),r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=p4e(e,r,n):(l(u)&&(i.metallicRoughness=g4e(e,u,n)),l(s)&&!i.unlit&&(i.specular=_4e(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=y4e(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=x4e(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=kc(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=kc(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=kc(e,t.occlusionTexture,n)),i.emissiveFactor=au(d,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Yoe(e,t){let n=new Uoe;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function Xoe(e,t,n,i){let o=new Uoe,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Woe(r.attribute),o.positionalLabel=i,o}function Koe(e,t){let n=new Hoe;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function Zoe(e,t,n,i){let o=new Hoe,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function T4e(e,t,n,i){let o=new zoe;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=kc(e,r,n,$t.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function C4e(e,t,n,i,o,r){let s=new zoe,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=kc(e,c,i,$t.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function A4e(e,t,n,i,o){let r=new wze,s=void 0,a=!1;for(let c in t){if(!t.hasOwnProperty(c))continue;let u=t[c],f=X9(e,Et,c),h=qoe(e,u,f,s,a,n,o);r.attributes.push(h.attribute),i.attributePlans.push(h)}return r}function E4e(e,t,n,i){let o=new Dze,r=new SC(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=b4e(e,e.gltfJson.materials[s],i));let a=y(t.extensions,y.EMPTY_OBJECT),c=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(u)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=S4e(e,u,r));let f=e._loadForClassification,h=a.KHR_draco_mesh_compression,p=!1,_=t.attributes;if(l(_))for(let v in _){if(!_.hasOwnProperty(v))continue;let D=_[v],O=X9(e,Et,v),R=O.modelSemantic;if(f&&!u4e(R))continue;R===Et.FEATURE_ID&&(p=!0);let M=qoe(e,D,O,h,n,c,i);r.attributePlans.push(M),o.attributes.push(M.attribute)}let m=t.targets;if(l(m)&&!f)for(let v=0;v<m.length;++v)o.morphTargets.push(A4e(e,m[v],c,r,i));let x=t.indices;if(l(x)){let v=m4e(e,x,h,p,c,i);l(v)&&(r.indicesPlan=v,o.indices=v.indices)}let b=a.EXT_structural_metadata,T=a.EXT_mesh_features,C=a.EXT_feature_metadata,A=l(C);l(T)?v4e(e,o,T,i):A&&w4e(e,o,C,i),l(b)?D4e(o,b):A&&I4e(e,o,C);let S=t.mode;if(f&&S!==Me.TRIANGLES)throw new re("Only triangle meshes can be used for classification.");return o.primitiveType=S,o}function S4e(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return FF(e,i,!1)}function v4e(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,c;l(s.texture)?c=T4e(e,s,i,a):l(s.attribute)?c=Yoe(s,a):c=Koe(s,a),t.featureIds.push(c)}}function w4e(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,_=`featureId_${r}`;r++;let m;l(u.featureIds.attribute)?m=Xoe(u,h,p,_):m=Zoe(u,h,p,_),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,_=`featureId_${r}`;r++;let m=C4e(e,u,h,i,p,_);t.featureIds.push(m)}}function D4e(e,t){l(t)&&(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function I4e(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function P4e(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new Ize,r=i.attributes;if(l(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(h4e(e,f,r,u,n))}let s=y(i.extensions,y.EMPTY_OBJECT),a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?R4e(o,a):l(c)&&O4e(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function R4e(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=Yoe(o,r):s=Koe(o,r),e.featureIds.push(s)}}function O4e(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,u=i.indexOf(c),f=o[c].count,h=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=Xoe(a,u,f,h):p=Zoe(a,u,f,h),t.featureIds.push(p)}}function M4e(e,t,n){let i=new Rze;i.name=t.name,i.matrix=au(F,t.matrix),i.translation=au(d,t.translation),i.rotation=au(Oe,t.rotation),i.scale=au(d,t.scale);let o=y(t.extensions,y.EMPTY_OBJECT),r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new re("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=P4e(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],u=c.primitives;for(let p=0;p<u.length;++p)i.primitives.push(E4e(e,u[p],l(i.instances),n));let f=y(t.weights,c.weights),h=i.primitives[0].morphTargets;i.morphWeights=l(f)?f.slice():new Array(h.length).fill(0)}return i}function L4e(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=M4e(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function N4e(e,t,n){let i=new Pze,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=FF(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(F.IDENTITY);return i}function F4e(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=N4e(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;l(s)&&(t[r].skin=i[s])}return i}async function B4e(e,t,n,i){let o=new CF({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=o,o.load()}async function k4e(e,t,n,i){let o=new LF({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=o,o.load()}function V4e(e,t){let n=new Mze,i=e.gltfJson.accessors,o=i[t.input];n.input=FF(e,o);let r=t.interpolation;n.interpolation=y($h[r],$h.LINEAR);let s=i[t.output];return n.output=FF(e,s,!0),n}function U4e(e,t){let n=new Lze,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=Oze[o],n}function z4e(e,t,n){let i=new Nze,o=e.sampler;return i.sampler=t[o],i.target=U4e(e.target,n),i}function H4e(e,t,n){let i=new Fze;i.name=t.name;let o=t.samplers.map(function(s,a){let c=V4e(e,s);return c.index=a,c}),r=t.channels.map(function(s){return z4e(s,o,n)});return i.samplers=o,i.channels=r,i}function G4e(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=H4e(e,o,t);return s.index=r,s})}function W4e(e){let t=new Bze;t.name=e.name;let n=e.type.toUpperCase();return t.type=Bc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function j4e(e){let t=new kze;return t.name=e.name,t.stages=e.stages.map(W4e),t}function q4e(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(j4e):[]}function Y4e(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function X4e(e,t){let n=new Uze,i=Y4e(e);return n.nodes=i.map(function(o){return t[o]}),n}var K4e=new d;function Z4e(e,t){let n=e.gltfJson,i=y(n.extensions,y.EMPTY_OBJECT),o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let C=r.featureTables,A=r.featureTextures,S=l(C)?C:[],v=l(A)?A:[];e._sortedPropertyTableIds=Object.keys(S).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=L4e(e,t),c=F4e(e,a),u=G4e(e,a),f=q4e(n),h=X4e(n,a),p=new zze,_=new Vze,m=n.asset.copyright;if(l(m)){let C=m.split(";").map(function(A){return new At(A.trim())});_.credits=C}if(p.asset=_,p.scene=h,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let C=d.fromArray(s.center,0,K4e);p.transform=F.fromTranslation(C,p.transform)}if(e._components=p,l(o)||l(r)){let C=B4e(e,o,r,t);e._loaderPromises.push(C)}let x=i.NGA_gpm_local;if(l(x)){let C=PF.load(x);e._components.extensions.NGA_gpm_local=C}let b=n.meshes;if(l(b))for(let C of b){let A=C.primitives;if(l(A))for(let S of A){let v=S.extensions;if(l(v)){let D=v.NGA_gpm_local;if(l(D)){let O=k4e(e,n,D,t);e._loaderPromises.push(O)}}}}let T=[];return T.push.apply(T,e._loaderPromises),e._incrementallyLoadTextures||T.push.apply(T,e._texturesPromises),Promise.all(T)}function $4e(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ei.unload(t[n]);e._textureLoaders.length=0}function $oe(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ei.unload(t[n]);e._bufferViewLoaders.length=0}function Q4e(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ei.unload(t[n]);e._geometryLoaders.length=0}function J4e(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function eHe(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function tHe(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}Ad.prototype.isUnloaded=function(){return this._state===vo.UNLOADED};Ad.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ei.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,$4e(this),$oe(this),Q4e(this),J4e(this),eHe(this),tHe(this),this._components=void 0,this._typedArray=void 0,this._state=vo.UNLOADED};var I_=Ad;var BF=`uniform sampler2D u_pointCloud_colorGBuffer; -uniform sampler2D u_pointCloud_depthGBuffer; -uniform vec2 u_distanceAndEdlStrength; -in vec2 v_textureCoordinates; - -vec2 neighborContribution(float log2Depth, vec2 offset) -{ - float dist = u_distanceAndEdlStrength.x; - vec2 texCoordOrig = v_textureCoordinates + offset * dist; - vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); - vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); - - float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); - float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); - - // ignore depth values that are the clear depth - if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { - return vec2(0.0); - } - - // interpolate the two adjacent depth values - float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); - vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); - return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); -} - -void main() -{ - float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); - - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); - eyeCoordinate /= eyeCoordinate.w; - - float log2Depth = log2(-eyeCoordinate.z); - - if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer - { - discard; - } - - vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); - - // sample from neighbors left, right, down, up - vec2 texelSize = 1.0 / czm_viewport.zw; - - vec2 responseAndCount = vec2(0.0); - - responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); - responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); - responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); - responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); - - float response = responseAndCount.x / responseAndCount.y; - float strength = u_distanceAndEdlStrength.y; - float shade = exp(-response * 300.0 * strength); - color.rgb *= shade; - out_FragColor = vec4(color); - - // Input and output depth are the same. - gl_FragDepth = depthOrLogDepth; -} -`;function wC(){this._framebuffer=new hi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(wC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function nHe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var K9=new U;function iHe(e,t){let n=new Ue({defines:["LOG_DEPTH_WRITE"],sources:[BF]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return K9.x=e._radius,K9.y=e._strength,K9}},o=Ve.fromCache({blending:un.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Ut.setCesium3DTileBit(),stencilMask:Ut.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:we.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ei({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:we.CESIUM_3D_TILE,owner:e})}function oHe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),iHe(e,t)}function Qoe(e){return e.drawBuffers&&e.fragmentDepth}wC.isSupported=Qoe;function rHe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; -layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=Ue.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() -{ - czm_point_cloud_post_process_main(); -#ifdef LOG_DEPTH - czm_writeLogDepth(); - out_FragData_1 = czm_packDepth(gl_FragDepth); -#else - out_FragData_1 = czm_packDepth(gl_FragCoord.z); -#endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}wC.prototype.update=function(e,t,n,i){if(!Qoe(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,oHe(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Me.POINTS||u.pass===we.TRANSLUCENT)continue;let f,h,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,h=p.originalShaderProgram),(!l(f)||u.dirty||h!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=$e.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=rHe(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};wC.prototype.isDestroyed=function(){return!1};wC.prototype.destroy=function(){return nHe(this),ue(this)};var P_=wC;function Joe(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}Joe.isSupported=function(e){return P_.isSupported(e.context)};var vp=Joe;var Aa={},sHe=new oe(0,0,0,1),ec=new oe,aHe=new qe,Z9=new U,$9=new U;Aa.worldToWindowCoordinates=function(e,t,n){return Aa.worldWithEyeOffsetToWindowCoordinates(e,t,d.ZERO,n)};var ere=new oe,tre=new d;function xw(e,t,n,i){let o=n.viewMatrix,r=F.multiplyByVector(o,oe.fromElements(e.x,e.y,e.z,1,ere),ere),s=d.multiplyComponents(t,d.normalize(r,tre),tre);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,r,i)}var cHe=new fe(Math.PI,P.PI_OVER_TWO),lHe=new d,uHe=new d;Aa.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Aa.computeActualEllipsoidPosition(o,t,sHe);if(!l(r))return;let s=e.canvas,a=aHe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(o.mode===ne.SCENE2D){let f=e.mapProjection,h=cHe,p=f.project(h,lHe),_=d.clone(c.position,uHe),m=c.frustum.clone(),x=F.computeViewportTransformation(a,0,1,new F),b=c.frustum.projectionMatrix,T=c.positionWC.y,C=d.fromElements(P.sign(T)*p.x-T,0,-c.positionWC.x),A=Mt.pointToGLWindowCoordinates(b,x,C);if(T===0||A.x<=0||A.x>=s.clientWidth)u=!0;else{if(A.x>s.clientWidth*.5){a.width=A.x,c.frustum.right=p.x-T,ec=xw(r,n,c,ec),Aa.clipToGLWindowCoordinates(a,ec,Z9),a.x+=A.x,c.position.x=-c.position.x;let S=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-S,ec=xw(r,n,c,ec),Aa.clipToGLWindowCoordinates(a,ec,$9)}else{a.x+=A.x,a.width-=A.x,c.frustum.left=-p.x-T,ec=xw(r,n,c,ec),Aa.clipToGLWindowCoordinates(a,ec,Z9),a.x=a.x-a.width,c.position.x=-c.position.x;let S=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-S,ec=xw(r,n,c,ec),Aa.clipToGLWindowCoordinates(a,ec,$9)}d.clone(_,c.position),c.frustum=m.clone(),i=U.clone(Z9,i),(i.x<0||i.x>s.clientWidth)&&(i.x=$9.x)}}if(o.mode!==ne.SCENE2D||u){if(ec=xw(r,n,c,ec),ec.z<0&&!(c.frustum instanceof rn)&&!(c.frustum instanceof Hr))return;i=Aa.clipToGLWindowCoordinates(a,ec,i)}return i.y=s.clientHeight-i.y,i};Aa.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Aa.worldToWindowCoordinates(e,t,n),!!l(n))return Aa.transformWindowToDrawingBuffer(e,n,n)};var wp=new d,fHe=new fe;Aa.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===ne.SCENE3D)return d.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,fHe);if(!l(r))return;if(o.project(r,wp),i===ne.COLUMBUS_VIEW)return d.fromElements(wp.z,wp.x,wp.y,n);if(i===ne.SCENE2D)return d.fromElements(0,wp.x,wp.y,n);let s=e.morphTime;return d.fromElements(P.lerp(wp.z,t.x,s),P.lerp(wp.x,t.y,s),P.lerp(wp.y,t.z,s),n)};var nre=new d,ire=new d,ore=new F;Aa.clipToGLWindowCoordinates=function(e,t,n){return d.divideByScalar(t,t.w,nre),F.computeViewportTransformation(e,0,1,ore),F.multiplyByPoint(ore,nre,ire),U.fromCartesian3(ire,n)};Aa.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*o,t.y*r,n)};var dHe=new oe,rre=new oe;Aa.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let _=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,_)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=oe.clone(oe.UNIT_W,dHe);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let h,p=e.camera.frustum;if(l(p.fovy)){h=F.multiplyByVector(r.inverseViewProjection,f,rre);let _=1/h.w;d.multiplyByScalar(h,_,h)}else{let _=p.offCenterFrustum;l(_)&&(p=_),h=rre,h.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(f.z*(a-c)-a-c)*.5,h.w=1,h=F.multiplyByVector(r.inverseView,h,h)}return d.fromCartesian4(h,i)};var zi=Aa;var DC={};DC._deprecationWarning=_s;var Dp=Uint32Array.BYTES_PER_ELEMENT;DC.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Dp;let r=o.getUint32(t,!0);if(r!==1)throw new re(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=Dp;let s=o.getUint32(t,!0);t+=Dp;let a=o.getUint32(t,!0);t+=Dp;let c=o.getUint32(t,!0);t+=Dp;let u=o.getUint32(t,!0);t+=Dp;let f=o.getUint32(t,!0);t+=Dp;let h;u>=570425344?(t-=Dp*2,h=a,u=c,f=0,a=0,c=0,DC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=Dp,h=u,u=a,f=c,a=0,c=0,DC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(h,0)}:(p=Fo(i,t,a),t+=a);let _=new Uint8Array(e,t,c);t+=c;let m,x;u>0&&(m=Fo(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new re("glTF byte length must be greater than 0.");let T;return t%4===0?T=new Uint8Array(e,t,b):(DC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),T=new Uint8Array(i.subarray(t,t+b))),{batchLength:h,featureTableJson:p,featureTableBinary:_,batchTableJson:m,batchTableBinary:x,gltf:T}};var kF=DC;function bw(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function sre(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=X.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function hHe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=X.createTypedArray(n,i),o[t]=r),r}bw.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,X.UNSIGNED_INT),n=y(n,1),sre(this,e,t,n,1,i.byteOffset)):i};bw.prototype.hasProperty=function(e){return l(this.json[e])};bw.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=X.fromName(i.componentType)),sre(this,e,t,n,this.featuresLength,i.byteOffset)):hHe(this,e,t,i)};bw.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var Qh=bw;function Tw(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=y(e.parseAsPropertyAttributes,!1),r=e.customAttributeOutput,s=mHe(n),a;l(s.jsonProperties)&&(a=new v_({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new iC({extension:s.hierarchy,binaryBody:i}));let u=Xh.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,h,p,_;if(o){let b=gHe(t,u,f,i,r);_=b.transcodedSchema,p=[new CC({propertyAttribute:b.propertyAttributeJson,class:b.transcodedClass})]}else{let b=pHe(t,u,f,i);_=b.transcodedSchema;let T=b.featureTableJson;h=new nu({count:T.count,properties:T.properties,class:b.transcodedClass,bufferViews:b.bufferViewsTypedArrays}),p=[]}let m=[];if(l(h)||l(a)||l(c)){let b=new Tl({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:a,batchTableHierarchy:c});m.push(b)}let x={schema:_,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new ea(x)}function mHe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(Tw._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function pHe(e,t,n,i){let o={},r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;if(!l(i))throw new re(`Property ${h} requires a batch table binary.`);let p=n[h],_=lf(p);r[h]={bufferView:a},o[h]=are(p),s[a]=_.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let u=df.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function gHe(e,t,n,i,o){let r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;let p=n[h];if(!l(i)&&!l(p.typedArray))throw new re(`Property ${h} requires a batch table binary.`);let _=Kt.sanitizeGlslIdentifier(h);(_===""||r.hasOwnProperty(_))&&(_=`property_${a}`,a++);let m=are(p);m.name=h,r[_]=m;let x=_.toUpperCase();x.startsWith("_")||(x=`_${x}`);let b=p.typedArray;l(b)||(b=lf(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let T=new bn.Attribute;T.name=x,T.count=e,T.type=p.type;let C=X.fromTypedArray(b);(C===X.INT||C===X.UNSIGNED_INT||C===X.DOUBLE)&&(Tw._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${x}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),b=new Float32Array(b)),T.componentDatatype=X.fromTypedArray(b),T.typedArray=b,o.push(T),s[_]={attribute:x}}let c={classes:{}};c.classes[t]={properties:r};let u=df.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function are(e){let t=_He(e.componentType);return{type:e.type,componentType:t}}function _He(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}Tw._deprecationWarning=_s;Tw._oneTimeWarning=xt;var R_=Tw;var px={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},yHe=bn.FeatureIdAttribute;function O_(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,No.Y),u=y(e.forwardAxis,No.X),f=y(e.loadAttributesAsTypedArray,!1),h=y(e.loadAttributesFor2D,!1),p=y(e.enablePick,!1),_=y(e.loadIndicesForWireframe,!1),m=y(e.loadPrimitiveOutline,!0),x=y(e.loadForClassification,!1);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=h,this._enablePick=p,this._loadIndicesForWireframe=_,this._loadPrimitiveOutline=m,this._loadForClassification=x,this._state=px.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(O_.prototype=Object.create(Ki.prototype),O_.prototype.constructor=O_);Object.defineProperties(O_.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});O_.prototype.load=function(){if(l(this._promise))return this._promise;let e=kF.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new Qh(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(a)&&(this._transform=F.fromTranslation(d.fromArray(a))),this._batchTable={json:o,binary:r};let c=new I_({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=px.LOADING;let u=this;return this._promise=c.load().then(function(){if(!u.isDestroyed())return u._state=px.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return xHe(u,f)}),this._promise};function xHe(e,t){return e.unload(),e._state=px.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}O_.prototype.process=function(e){if(this._state===px.READY)return!0;if(this._state!==px.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),bHe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=px.READY,!0};function bHe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=R_({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Tl({name:Xh.BATCH_TABLE_CLASS_NAME,count:i});o=new ea({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)cre(r[a]);t.structuralMetadata=o}function cre(e){let t=e.children.length;for(let i=0;i<t;i++)cre(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Kt.getAttributeBySemantic(o,Et.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new yHe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}O_.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var VF=O_;function M_(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(M_.prototype=Object.create(Ki.prototype),M_.prototype.constructor=M_);Object.defineProperties(M_.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});M_.prototype.load=function(){return Promise.resolve(this)};M_.prototype.process=function(e){return l(this._components)||(this._components=MHe(this._geoJson,e),this._geoJson=void 0),!0};function THe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function CHe(){this.features=[]}function Q9(e){let t=e[0],n=e[1],i=y(e[2],0);return new d(t,n,i)}function J9(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=Q9(e[o]);return[n]}function AHe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=J9(e[i])[0];return n}function lre(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=J9(e[i])[0];return n}function EHe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,lre(e[i]));return n}function SHe(e){return[Q9(e)]}function vHe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=Q9(e[i]);return n}var wHe={LineString:J9,MultiLineString:AHe,MultiPolygon:EHe,Polygon:lre,MultiPoint:vHe,Point:SHe},DHe={LineString:Me.LINES,MultiLineString:Me.LINES,MultiPolygon:Me.LINES,Polygon:Me.LINES,MultiPoint:Me.POINTS,Point:Me.POINTS};function ure(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=wHe[n],o=DHe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new THe;o===Me.LINES?s.lines=i(r):o===Me.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function IHe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)ure(n[o],t)}var PHe={FeatureCollection:IHe,Feature:ure},UF=new d;function RHe(e,t,n){let i=0,o=0,r=e.length;for(let M=0;M<r;M++){let L=e[M];if(l(L.lines)){let g=L.lines.length;for(let E=0;E<g;E++){let w=L.lines[E];i+=w.length,o+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ne.createTypedArray(i,o),u=Ne.fromTypedArray(c),f=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,_=0;for(let M=0;M<r;M++){let L=e[M];if(!l(L.lines))continue;let g=L.lines.length;for(let E=0;E<g;E++){let w=L.lines[E],I=w.length;for(let N=0;N<I;N++){let B=w[N],H=d.fromDegrees(B.x,B.y,B.z,ee.WGS84,UF),V=F.multiplyByPoint(t,H,UF);d.minimumByComponent(f,V,f),d.maximumByComponent(h,V,h),d.pack(V,s,p*3),a[p]=M,N<I-1&&(c[_*2]=p,c[_*2+1]=p+1,_++),p++}}}let m=yt.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});m.vertexArrayDestroyable=!1;let x=yt.createVertexBuffer({typedArray:a,context:n.context,usage:Fe.STATIC_DRAW});x.vertexArrayDestroyable=!1;let b=yt.createIndexBuffer({typedArray:c,context:n.context,usage:Fe.STATIC_DRAW,indexDatatype:u});b.vertexArrayDestroyable=!1;let T=new bn.Attribute;T.semantic=Et.POSITION,T.componentDatatype=X.FLOAT,T.type=on.VEC3,T.count=i,T.min=f,T.max=h,T.buffer=m;let C=new bn.Attribute;C.semantic=Et.FEATURE_ID,C.setIndex=0,C.componentDatatype=X.FLOAT,C.type=on.SCALAR,C.count=i,C.buffer=x;let A=[T,C],S=new bn.Material;S.unlit=!0;let v=new bn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=b;let D=new bn.FeatureIdAttribute;D.featureCount=r,D.propertyTableId=0,D.setIndex=0,D.positionalLabel="featureId_0";let O=[D],R=new bn.Primitive;return R.attributes=A,R.indices=v,R.featureIds=O,R.primitiveType=Me.LINES,R.material=S,R}function OHe(e,t,n){let i=0,o=e.length;for(let A=0;A<o;A++){let S=e[A];l(S.points)&&(i+=S.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let A=0;A<o;A++){let S=e[A];if(!l(S.points))continue;let v=S.points.length;for(let D=0;D<v;D++){let O=S.points[D],R=d.fromDegrees(O.x,O.y,O.z,ee.WGS84,UF),M=F.multiplyByPoint(t,R,UF);d.minimumByComponent(a,M,a),d.maximumByComponent(c,M,c),d.pack(M,r,u*3),s[u]=A,u++}}let f=yt.createVertexBuffer({typedArray:r,context:n.context,usage:Fe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let h=yt.createVertexBuffer({typedArray:s,context:n.context,usage:Fe.STATIC_DRAW});h.vertexArrayDestroyable=!1;let p=new bn.Attribute;p.semantic=Et.POSITION,p.componentDatatype=X.FLOAT,p.type=on.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let _=new bn.Attribute;_.semantic=Et.FEATURE_ID,_.setIndex=0,_.componentDatatype=X.FLOAT,_.type=on.SCALAR,_.count=i,_.buffer=h;let m=[p,_],x=new bn.Material;x.unlit=!0;let b=new bn.FeatureIdAttribute;b.featureCount=o,b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0";let T=[b],C=new bn.Primitive;return C.attributes=m,C.featureIds=T,C.primitiveType=Me.POINTS,C.material=x,C}function MHe(e,t){let n=new CHe,i=PHe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new re("GeoJSON must have at least one feature");let s={};for(let M=0;M<r;M++){let L=o[M],g=y(L.properties,y.EMPTY_OBJECT);for(let E in g)g.hasOwnProperty(E)&&(l(s[E])||(s[E]=new Array(r)))}for(let M=0;M<r;M++){let L=o[M];for(let g in s)if(s.hasOwnProperty(g)){let E=y(L.properties[g],"");s[g][M]=E}}let a=new v_({count:r,properties:s}),u=[new Tl({id:0,count:r,jsonMetadataTable:a})],f=df.fromJson({}),h=new ea({schema:f,propertyTables:u}),p=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),_=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,x=!1;for(let M=0;M<r;M++){let L=o[M];if(l(L.lines)){m=!0;let g=L.lines.length;for(let E=0;E<g;E++){let w=L.lines[E],I=w.length;for(let N=0;N<I;N++)d.minimumByComponent(p,w[N],p),d.maximumByComponent(_,w[N],_)}}if(l(L.points)){x=!0;let g=L.points.length;for(let E=0;E<g;E++){let w=L.points[E];d.minimumByComponent(p,w,p),d.maximumByComponent(_,w,_)}}}let b=d.midpoint(p,_,new d),T=d.fromDegrees(b.x,b.y,b.z,ee.WGS84,new d),C=Mt.eastNorthUpToFixedFrame(T,ee.WGS84,new F),A=F.inverseTransformation(C,new F),S=[];m&&S.push(RHe(o,A,t)),x&&S.push(OHe(o,A,t));let v=new bn.Node;v.index=0,v.primitives=S;let D=[v],O=new bn.Scene;O.nodes=D;let R=new bn.Components;return R.scene=O,R.nodes=D,R.transform=C,R.structuralMetadata=h,R}M_.prototype.unload=function(){this._components=void 0};var zF=M_;var HF={};HF._deprecationWarning=_s;var L_=Uint32Array.BYTES_PER_ELEMENT;HF.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=L_;let r=o.getUint32(t,!0);if(r!==1)throw new re(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=L_;let s=o.getUint32(t,!0);t+=L_;let a=o.getUint32(t,!0);if(a===0)throw new re("featureTableJsonByteLength is zero, the feature table must be defined.");t+=L_;let c=o.getUint32(t,!0);t+=L_;let u=o.getUint32(t,!0);t+=L_;let f=o.getUint32(t,!0);t+=L_;let h=o.getUint32(t,!0);if(h!==1&&h!==0)throw new re(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${h} is not.`);t+=L_;let p=Fo(i,t,a);t+=a;let _=new Uint8Array(e,t,c);t+=c;let m,x;u>0&&(m=Fo(i,t,u),t+=u,f>0&&(x=new Uint8Array(e,t,f),x=new Uint8Array(x),t+=f));let b=n+s-t;if(b===0)throw new re("glTF byte length must be greater than 0.");let T;return t%4===0?T=new Uint8Array(e,t,b):(HF._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),T=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:h,featureTableJson:p,featureTableBinary:_,batchTableJson:m,batchTableBinary:x,gltf:T}};var GF=HF;var Ip={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},WF=bn.Attribute,LHe=bn.FeatureIdAttribute,dre=bn.Instances;function Pp(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,No.Y),u=y(e.forwardAxis,No.X),f=y(e.loadAttributesAsTypedArray,!1),h=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),_=y(e.enablePick,!1);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=_,this._state=Ip.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(Pp.prototype=Object.create(Ki.prototype),Pp.prototype.constructor=Pp);Object.defineProperties(Pp.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Pp.prototype.load=function(){if(l(this._promise))return this._promise;let e=GF.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new Qh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new re("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(c)&&(this._transform=F.fromTranslation(d.fromArray(c))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let h=Jl(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new I_(u);return this._gltfLoader=f,this._state=Ip.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=Ip.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw NHe(this,h)}),this._promise};function NHe(e,t){return e.unload(),e._state=Ip.FAILED,e.getError("Failed to load i3dm",t)}Pp.prototype.process=function(e){if(this._state===Ip.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Ip.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),kHe(this,i,e),FHe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Ip.READY,!0};function FHe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=R_({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Tl({name:Xh.BATCH_TABLE_CLASS_NAME,count:i});o=new ea({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var jF=new d,eW=new Array(4),BHe=new F;function kHe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",X.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=UHe(o,r),h;c&&(h=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let _=new Float32Array(r),m=d.unpackArray(f),x=new d,b=new d,T=new d,C=new d,A=new $,S=new Oe,v=new Array(4),D=new d,O=new Array(3),R=new F;if(!l(s)||d.equals(d.unpack(s),d.ZERO)){let V=ae.fromPoints(m);for(i=0;i<m.length;i++)d.subtract(m[i],V.center,jF),f[3*i+0]=jF.x,f[3*i+1]=jF.y,f[3*i+2]=jF.z;let G=F.fromTranslation(V.center,BHe);t.transform=F.multiplyTransformation(G,t.transform,t.transform)}for(i=0;i<r;i++){x=d.clone(m[i]),l(s)&&d.add(x,d.unpack(s),x),c&&(zHe(o,a,i,S,x,T,b,C,A,R),Oe.pack(S,v,0),h[4*i+0]=v[0],h[4*i+1]=v[1],h[4*i+2]=v[2],h[4*i+3]=v[3]),u&&(HHe(o,i,D),d.pack(D,O,0),p[3*i+0]=O[0],p[3*i+1]=O[1],p[3*i+2]=O[2]);let V=o.getProperty("BATCH_ID",X.UNSIGNED_SHORT,1,i);l(V)||(V=i),_[i]=V}let M=new dre;M.transformInWorldSpace=!0;let L=e._buffers,g=new WF;if(g.name="Instance Translation",g.semantic=rs.TRANSLATION,g.componentDatatype=X.FLOAT,g.type=on.VEC3,g.count=r,g.typedArray=f,!c){let V=yt.createVertexBuffer({context:n.context,typedArray:f,usage:Fe.STATIC_DRAW});V.vertexArrayDestroyable=!1,L.push(V),g.buffer=V}if(M.attributes.push(g),c){let V=new WF;V.name="Instance Rotation",V.semantic=rs.ROTATION,V.componentDatatype=X.FLOAT,V.type=on.VEC4,V.count=r,V.typedArray=h,M.attributes.push(V)}if(u){let V=new WF;if(V.name="Instance Scale",V.semantic=rs.SCALE,V.componentDatatype=X.FLOAT,V.type=on.VEC3,V.count=r,c)V.typedArray=p;else{let G=yt.createVertexBuffer({context:n.context,typedArray:p,usage:Fe.STATIC_DRAW});G.vertexArrayDestroyable=!1,L.push(G),V.buffer=G}M.attributes.push(V)}let E=new WF;E.name="Instance Feature ID",E.setIndex=0,E.semantic=rs.FEATURE_ID,E.componentDatatype=X.FLOAT,E.type=on.SCALAR,E.count=r;let w=yt.createVertexBuffer({context:n.context,typedArray:_,usage:Fe.STATIC_DRAW});w.vertexArrayDestroyable=!1,L.push(w),E.buffer=w,M.attributes.push(E);let I=new LHe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",M.featureIds.push(I);let N=t.nodes,B=N.length,H=!1;for(i=0;i<B;i++){let V=N[i];V.primitives.length>0&&(V.instances=H?VHe(M):M,H=!0)}}function VHe(e){let t=new dre;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Ge(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function UHe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",X.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(i))throw new re("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(o))throw new re("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new re("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var fre=new Array(4);function zHe(e,t,n,i,o,r,s,a,c,u){let f=e.getProperty("NORMAL_UP",X.FLOAT,3,n,eW),h=e.getProperty("NORMAL_RIGHT",X.FLOAT,3,n,fre),p=!1;if(l(f)){if(!l(h))throw new re("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");d.unpack(f,0,r),d.unpack(h,0,s),p=!0}else{let _=e.getProperty("NORMAL_UP_OCT32P",X.UNSIGNED_SHORT,2,n,eW),m=e.getProperty("NORMAL_RIGHT_OCT32P",X.UNSIGNED_SHORT,2,n,fre);if(l(_)){if(!l(m))throw new re("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Ln.octDecodeInRange(_[0],_[1],65535,r),Ln.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(Mt.eastNorthUpToFixedFrame(o,ee.WGS84,u),F.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(d.cross(s,r,a),d.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,r,c),$.setColumn(c,2,a,c)),Oe.fromRotationMatrix(c,i)}function HHe(e,t,n){n=d.fromElements(1,1,1,n);let i=e.getProperty("SCALE",X.FLOAT,1,t);l(i)&&d.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",X.FLOAT,3,t,eW);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function GHe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}Pp.prototype.isUnloaded=function(){return this._state===Ip.UNLOADED};Pp.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),GHe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Ip.UNLOADED};var qF=Pp;var WHe={STOPPED:0,ANIMATING:1},Jh=Object.freeze(WHe);function IC(){this.times=void 0,this.points=void 0,he.throwInstantiationError()}IC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof d)return d;if(e instanceof Oe)return Oe};IC.prototype.evaluate=he.throwInstantiationError;IC.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};IC.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};IC.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var no=IC;function PC(e){this._value=e,this._valueType=no.getPointType(e)}Object.defineProperties(PC.prototype,{value:{get:function(){return this._value}}});PC.prototype.findTimeInterval=function(e){};PC.prototype.wrapTime=function(e){return 0};PC.prototype.clampTime=function(e){return 0};PC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var YF=PC;function RC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=no.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(RC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});RC.prototype.findTimeInterval=no.prototype.findTimeInterval;RC.prototype.wrapTime=no.prototype.wrapTime;RC.prototype.clampTime=no.prototype.clampTime;RC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new d),d.lerp(n[o],n[o+1],r,t))};var gx=RC;var hre={};hre.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new d,s[a]=new d;o[0]=n[0]/t[0],r[0]=d.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=d.subtract(r[a],d.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var Cw=hre;var mre=[],pre=[],gre=[],_re=[];function jHe(e,t,n){let i=mre,o=gre,r=pre,s=_re;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new d),d.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new d),d.subtract(e[a+1],e[a-1],c),d.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new d),d.subtract(e[a+1],e[a-1],c),d.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new d),d.clone(n,c),Cw.solve(i,r,o,s)}function qHe(e){let t=mre,n=gre,i=pre,o=_re;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new d),d.subtract(e[1],e[0],s),d.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new d),d.subtract(e[r+1],e[r-1],s),d.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new d),d.subtract(e[r],e[r-1],s),d.multiplyByScalar(s,3,s),Cw.solve(t,i,n,o)}function Cl(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=no.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Cl.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});Cl.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Cl({times:t,points:n,inTangents:r,outTangents:o})};Cl.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new gx({points:n,times:t});let i=qHe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Cl({times:t,points:n,inTangents:r,outTangents:o})};Cl.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=no.getPointType(n[0]);if(n.length<3)return new gx({points:n,times:t});let s=jHe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Cl({times:t,points:n,inTangents:c,outTangents:a})};Cl.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Cl.prototype.findTimeInterval=no.prototype.findTimeInterval;var YHe=new oe,OC=new d;Cl.prototype.wrapTime=no.prototype.wrapTime;Cl.prototype.clampTime=no.prototype.clampTime;Cl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=YHe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=F.multiplyByVector(Cl.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let h=this._pointType;return h===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(l(t)||(t=new h),t=h.multiplyByScalar(n[s],f.x,t),h.multiplyByScalar(n[s+1],f.y,OC),h.add(t,OC,t),h.multiplyByScalar(r[s],f.z,OC),h.add(t,OC,t),h.multiplyByScalar(o[s],f.w,OC),h.add(t,OC,t))};var _x=Cl;function MC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=no.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(MC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});MC.prototype.findTimeInterval=no.prototype.findTimeInterval;MC.prototype.wrapTime=no.prototype.wrapTime;MC.prototype.clampTime=no.prototype.clampTime;MC.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var XF=MC;function XHe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Oe);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return Oe.fastSlerp(a,c,s,o)}}function LC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=XHe(this),this._lastTimeIndex=0}Object.defineProperties(LC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});LC.prototype.findTimeInterval=no.prototype.findTimeInterval;LC.prototype.wrapTime=no.prototype.wrapTime;LC.prototype.clampTime=no.prototype.clampTime;LC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var KF=LC;var NC=bn.AnimatedPropertyType;function tW(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,JHe(this)}Object.defineProperties(tW.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function KHe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new _x({times:e,points:n,inTangents:i,outTangents:o})}function yre(e,t,n,i){if(e.length===1&&t.length===1)return new YF(t[0]);switch(n){case $h.STEP:return new XF({times:e,points:t});case $h.CUBICSPLINE:return KHe(e,t);case $h.LINEAR:return i===NC.ROTATION?new KF({times:e,points:t}):new gx({times:e,points:t})}}function ZHe(e,t,n,i,o){let r=[];if(i===NC.WEIGHTS){let a=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(a),h=c;if(n===$h.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[h],f[u+1]=t[h+o],f[u+2]=t[h+2*o],h+=o*3;else for(u=0;u<a;u++)f[u]=t[h],h+=o;r.push(yre(e,f,n,i))}}else r.push(yre(e,t,n,i));return r}var $He=new d,QHe=new Oe;function JHe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=ZHe(i,o,r,a,u);e._splines=f,e._path=a}tW.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===NC.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===NC.TRANSLATION||n===NC.SCALE?o[n]=r.evaluate(s,$He):n===NC.ROTATION&&(o[n]=r.evaluate(s,QHe))}}};var ZF=tW;function nW(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=Z.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=Z.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,su.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new me,this.update=new me,this.stop=new me,this._state=Jh.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,e8e(this)}Object.defineProperties(nW.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function e8e(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let u=r[c],f=u.target;if(!l(f))continue;let h=f.node.index,p=i._runtimeNodes[h],_=new ZF({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(_)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}nW.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var $F=nW;function Rp(e){this.animationAdded=new me,this.animationRemoved=new me,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Rp.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function iW(e,t,n){let i=e._model,o=new $F(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}Rp.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return iW(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return iW(this,n[i],e)};Rp.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=iW(this,n[r],e);i.push(s)}return i};Rp.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};Rp.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};Rp.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Rp.prototype.get=function(e){return this._runtimeAnimations[e]};var QF=[];function t8e(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Rp.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&Z.equals(e.time,this._previousTime))return!1;this._previousTime=Z.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=Z.addSeconds(y(a.startTime,o),a.delay,new Z)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,h=Z.lessThanOrEquals(c,o),p=l(f)&&Z.greaterThan(o,f),_=0;if(u!==0){let b=Z.secondsDifference(p?f:o,c);_=l(a._animationTime)?a._animationTime(u,b):b/u}let m=a.loop===su.REPEAT||a.loop===su.MIRRORED_REPEAT,x=(h||m&&!l(a.startTime))&&(_<=1||m)&&!p;if(_===a._prevAnimationDelta){let b=a._state===Jh.STOPPED;if(x!==b)continue}if(a._prevAnimationDelta=_,x||a._state===Jh.ANIMATING){if(x&&a._state===Jh.STOPPED&&(a._state=Jh.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===su.REPEAT)_=_-Math.floor(_);else if(a.loop===su.MIRRORED_REPEAT){let T=Math.floor(_),C=_-T;_=T%2===1?1-C:C}a.reverse&&(_=1-_);let b=_*u*a.multiplier;b=P.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=Jh.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&QF.push(a))}}n=QF.length;for(let s=0;s<n;++s){let a=QF[s];t.splice(t.indexOf(a),1),e.afterRender.push(t8e(this,r,a))}return QF.length=0,i};var JF=Rp;function yx(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(yx.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});yx.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};yx.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};yx.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};yx.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};yx.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var e2=yx;var Aw={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Aw.getStyleCommandsNeeded=function(e,t){return t===0?Aw.ALL_OPAQUE:t===e?Aw.ALL_TRANSLUCENT:Aw.OPAQUE_AND_TRANSLUCENT};var em=Object.freeze(Aw);var N_={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};N_.is3DTiles=function(e){switch(e){case N_.TILE_GLTF:case N_.TILE_B3DM:case N_.TILE_I3DM:case N_.TILE_PNTS:case N_.TILE_GEOJSON:return!0;case N_.GLTF:return!1}};var gr=Object.freeze(N_);function Mr(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=em.ALL_OPAQUE,n8e(this)}Object.defineProperties(Mr.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function n8e(e){let t=e._model,n=gr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new $s(s,o)}else for(o=0;o<i;o++)r[o]=new e2({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new xl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Mr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=em.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Mr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Mr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Mr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Mr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Mr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Mr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Mr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Mr.prototype.getFeature=function(e){return this._features[e]};Mr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Mr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Mr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Mr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Mr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Mr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Mr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Mr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Mr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var i8e=new z;Mr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(xl.DEFAULT_COLOR_VALUE),this.setAllShow(xl.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,i8e),xl.DEFAULT_COLOR_VALUE):xl.DEFAULT_COLOR_VALUE,o=l(e.show)?y(e.show.evaluate(n),xl.DEFAULT_SHOW_VALUE):xl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Mr.prototype.isDestroyed=function(){return!1};Mr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var t2=Mr;var xre={name:"TilesetPipelineStage"};xre.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,pe.FRAGMENT);let r={u_polygonOffset:function(){return U.ZERO}};e.uniformMap=bt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Ut.setCesium3DTileBit(),i.stencilMask=Ut.CESIUM_3D_TILE_MASK};var n2=xre;var i2=`// robust iterative solution without trig functions -// https://github.com/0xfaded/ellipse_demo/issues/1 -// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse -// -// This version uses only a single iteration for best performance. For fog -// rendering, the difference is negligible. -vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) { - vec2 p = abs(pos); - vec2 inverseRadii = 1.0 / radii; - vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii; - - // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t)) - // but store the cos and sin of t in a vec2 for efficiency. - // Initial guess: t = cos(pi/4) - vec2 tTrigs = vec2(0.70710678118); - vec2 v = radii * tTrigs; - - // Find the evolute of the ellipse (center of curvature) at v. - vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs; - // Find the (approximate) intersection of p - evolute with the ellipsoid. - vec2 q = normalize(p - evolute) * length(v - evolute); - // Update the estimate of t. - tTrigs = (q + evolute) * inverseRadii; - tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); - v = radii * tTrigs; - - return v * sign(pos); -} - -vec3 computeEllipsoidPositionWC(vec3 positionMC) { - // Get the world-space position and project onto a meridian plane of - // the ellipsoid - vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; - - vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z); - vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz); - - // Reconstruct a 3D point in world space - return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y); -} - -void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) { - - vec3 fogColor = groundAtmosphereColor.rgb; - - // If there is dynamic lighting, apply that to the fog. - const float NONE = 0.0; - if (czm_atmosphereDynamicLighting != NONE) { - float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0); - fogColor *= darken; - } - - // Tonemap if HDR rendering is disabled - #ifndef HDR - fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); - fogColor.rgb = czm_inverseGamma(fogColor.rgb); - #endif - - vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar); - color = vec4(withFog, color.a); -} - -void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) { - vec3 rayleighColor; - vec3 mieColor; - float opacity; - - vec3 positionWC; - vec3 lightDirection; - - // When the camera is in space, compute the position per-fragment for - // more accurate ground atmosphere. All other cases will use - // - // The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717 - if (false) { - positionWC = computeEllipsoidPositionWC(attributes.positionMC); - lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); - - // The fog color is derived from the ground atmosphere color - czm_computeGroundAtmosphereScattering( - positionWC, - lightDirection, - rayleighColor, - mieColor, - opacity - ); - } else { - positionWC = attributes.positionWC; - lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); - rayleighColor = v_atmosphereRayleighColor; - mieColor = v_atmosphereMieColor; - opacity = v_atmosphereOpacity; - } - - //color correct rayleigh and mie colors - const bool ignoreBlackPixels = true; - rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels); - mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels); - - vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); - - if (u_isInFog) { - float distanceToCamera = length(attributes.positionEC); - applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); - } else { - // Ground atmosphere - } -} -`;var o2=`void atmosphereStage(ProcessedAttributes attributes) { - vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); - - czm_computeGroundAtmosphereScattering( - // This assumes the geometry stage came before this. - v_positionWC, - lightDirection, - v_atmosphereRayleighColor, - v_atmosphereMieColor, - v_atmosphereOpacity - ); -} -`;var bre={name:"AtmospherePipelineStage"};bre.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,pe.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,pe.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([o2]),i.addFragmentLines([i2]),i.addUniform("bool","u_isInFog",pe.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=d.distance(n.camera.positionWC,t.boundingSphere.center);return P.fog(o,n.fog.density)>P.EPSILON3}};var r2=bre;var s2=`#ifdef DIFFUSE_IBL -vec3 sampleDiffuseEnvironment(vec3 cubeDir) -{ - #ifdef CUSTOM_SPHERICAL_HARMONICS - return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); - #else - return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); - #endif -} -#endif - -#ifdef SPECULAR_IBL -vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) -{ - #ifdef CUSTOM_SPECULAR_IBL - float lod = roughness * model_specularEnvironmentMapsMaximumLOD; - return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; - #else - float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; - return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; - #endif -} -vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) -{ - // see https://bruop.github.io/ibl/ at Single Scattering Results - // Roughness dependent fresnel, from Fdez-Aguera - vec3 f90 = max(vec3(1.0 - roughness), f0); - vec3 F = fresnelSchlick2(f0, f90, NdotV); - - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); - - return specularSample * (F * brdfLut.x + brdfLut.y); -} -#endif - -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -/** - * Compute the light contributions from environment maps and spherical harmonic coefficients. - * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation - * of the single- and multi-scattering terms. - * - * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position. - * @param {vec3} normalEC The surface normal in eye coordinates. - * @param {czm_modelMaterial} The material properties. - * @return {vec3} The computed HDR color. - */ -vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { - vec3 f0 = material.specular; - float roughness = material.roughness; - float specularWeight = 1.0; - #ifdef USE_SPECULAR - specularWeight = material.specularWeight; - #endif - float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); - - // see https://bruop.github.io/ibl/ at Single Scattering Results - // Roughness dependent fresnel, from Fdez-Aguera - vec3 f90 = max(vec3(1.0 - roughness), f0); - vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); - - vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; - vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); - - #ifdef DIFFUSE_IBL - vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); - vec3 irradiance = sampleDiffuseEnvironment(normalMC); - - vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; - float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); - vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); - vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; - vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; - #else - vec3 diffuseContribution = vec3(0.0); - #endif - - #ifdef USE_ANISOTROPY - // Bend normal to account for anisotropic distortion of specular reflection - vec3 anisotropyDirection = material.anisotropicB; - vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); - vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); - float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); - float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; - vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); - vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); - #else - vec3 reflectEC = reflect(-viewDirectionEC, normalEC); - #endif - - #ifdef SPECULAR_IBL - vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); - vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); - vec3 specularContribution = radiance * FssEss * model_iblFactor.y; - #else - vec3 specularContribution = vec3(0.0); - #endif - - return diffuseContribution + specularContribution; -} -#endif -`;var Tre={name:"ImageBasedLightingPipelineStage"},o8e=new U;Tre.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,pe.FRAGMENT),r.addUniform("vec2","model_iblFactor",pe.FRAGMENT),zh.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",pe.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,pe.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,pe.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,pe.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",pe.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,pe.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,pe.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,pe.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",pe.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",pe.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,pe.FRAGMENT)),r.addFragmentLines(s2);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,o8e)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=bt(c,e.uniformMap)};var a2=Tre;var r8e=P.EPSILON16;function rW(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(rW.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,r8e)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var s8e=new d,oW=new $;rW.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=s8e,o;switch(t){case Bc.XROTATE:o=$.fromRotationX(P.toRadians(n),oW),e=F.multiplyByMatrix3(e,o,e);break;case Bc.YROTATE:o=$.fromRotationY(P.toRadians(n),oW),e=F.multiplyByMatrix3(e,o,e);break;case Bc.ZROTATE:o=$.fromRotationZ(P.toRadians(n),oW),e=F.multiplyByMatrix3(e,o,e);break;case Bc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case Bc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case Bc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case Bc.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case Bc.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case Bc.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case Bc.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var c2=rW;function l2(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,a8e(this)}Object.defineProperties(l2.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function a8e(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new c2({stage:a,runtimeArticulation:e});o.push(c);let u=a.name;r[u]=c}}l2.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var c8e=new F,l8e=new F;l2.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,c8e),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=F.multiplyTransformation(s.originalTransform,e,l8e);s.transform=a}};var u2=l2;var f2=`void modelColorStage(inout czm_modelMaterial material) -{ - material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend); - float highlight = ceil(model_colorBlend); - material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight); - material.alpha *= model_color.a; -} -`;var FC={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};FC.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,pe.FRAGMENT),i.addFragmentLines(f2);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=we.TRANSLUCENT),i.addUniform("vec4",FC.COLOR_UNIFORM_NAME,pe.FRAGMENT),o[FC.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",FC.COLOR_BLEND_UNIFORM_NAME,pe.FRAGMENT),o[FC.COLOR_BLEND_UNIFORM_NAME]=function(){return Fc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=bt(o,e.uniformMap)};var xx=FC;var d2=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE -vec4 getClippingPlane( - highp sampler2D packedClippingPlanes, - int clippingPlaneNumber, - mat4 transform -) { - int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; - int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - vec4 plane = texture(packedClippingPlanes, vec2(u, v)); - return czm_transformPlane(plane, transform); -} -#else -// Handle uint8 clipping texture instead -vec4 getClippingPlane( - highp sampler2D packedClippingPlanes, - int clippingPlaneNumber, - mat4 transform -) { - int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each - int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; - int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); - float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); - float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel - float v = (float(pixY) + 0.5) * pixelHeight; - vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; - vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); - vec4 plane; - plane.xyz = czm_octDecode(oct, 65535.0); - plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); - return czm_transformPlane(plane, transform); -} -#endif - -float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { - vec4 position = czm_windowToEyeCoordinates(fragCoord); - vec3 clipNormal = vec3(0.0); - vec3 clipPosition = vec3(0.0); - float pixelWidth = czm_metersPerPixel(position); - - #ifdef UNION_CLIPPING_REGIONS - float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below. - #else - float clipAmount = 0.0; - bool clipped = true; - #endif - - for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { - vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); - clipNormal = clippingPlane.xyz; - clipPosition = -clippingPlane.w * clipNormal; - float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; - - #ifdef UNION_CLIPPING_REGIONS - clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); - if (amount <= 0.0) { - discard; - } - #else - clipAmount = max(amount, clipAmount); - clipped = clipped && (amount <= 0.0); - #endif - } - - #ifndef UNION_CLIPPING_REGIONS - if (clipped) { - discard; - } - #endif - - return clipAmount; -} - -void modelClippingPlanesStage(inout vec4 color) -{ - float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; - float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; - - if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { - color = clippingPlanesEdgeColor; - } -} -`;var Cre={name:"ModelClippingPlanesPipelineStage"},u8e=new U;Cre.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,pe.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,pe.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,pe.FRAGMENT),bs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,pe.FRAGMENT);let s=bs.getTextureResolution(i,o,u8e);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,pe.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,pe.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",pe.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",pe.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",pe.FRAGMENT),r.addFragmentLines(d2);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=bt(a,e.uniformMap)};var h2=Cre;var m2=`void modelClippingPolygonsStage(ProcessedAttributes attributes) -{ - vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC); - sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); - - vec2 minDistance = vec2(czm_infinity); - v_regionIndex = -1; - v_clippingPosition = vec2(czm_infinity); - - for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) { - vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex); - vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz; - - vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0)); - vec2 distance = abs(rectUv - clamped) * extents.wz; - - if (minDistance.x > distance.x || minDistance.y > distance.y) { - minDistance = distance; - v_clippingPosition = rectUv; - } - - float threshold = 0.01; - if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) { - v_regionIndex = regionIndex; - } - } -} -`;var p2=`void modelClippingPolygonsStage() -{ - vec2 clippingPosition = v_clippingPosition; - int regionIndex = v_regionIndex; - czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); -} -`;var Are={name:"ModelClippingPolygonsPipelineStage"};Are.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,pe.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,pe.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,pe.BOTH),o.addUniform("sampler2D","model_clippingDistance",pe.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",pe.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(m2),o.addFragmentLines(p2);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=bt(r,e.uniformMap)};var g2=Are;function Ere(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Ere.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var _2=Ere;var y2=`mat4 getInstancingTransform() -{ - mat4 instancingTransform; - - #ifdef HAS_INSTANCE_MATRICES - instancingTransform = mat4( - a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 - a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 - a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 - a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation = a_instanceTranslation; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif - - instancingTransform = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation.x, translation.y, translation.z, 1.0 - ); - #endif - - return instancingTransform; -} - -#ifdef USE_2D_INSTANCING -mat4 getInstancingTransform2D() -{ - mat4 instancingTransform2D; - - #ifdef HAS_INSTANCE_MATRICES - instancingTransform2D = mat4( - a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 - a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 - a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 - a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 - ); - #else - vec3 translation2D = vec3(0.0, 0.0, 0.0); - vec3 scale = vec3(1.0, 1.0, 1.0); - - #ifdef HAS_INSTANCE_TRANSLATION - translation2D = a_instanceTranslation2D; - #endif - #ifdef HAS_INSTANCE_SCALE - scale = a_instanceScale; - #endif - - instancingTransform2D = mat4( - scale.x, 0.0, 0.0, 0.0, - 0.0, scale.y, 0.0, 0.0, - 0.0, 0.0, scale.z, 0.0, - translation2D.x, translation2D.y, translation2D.z, 1.0 - ); - #endif - - return instancingTransform2D; -} -#endif -`;var x2=`void instancingStage(inout ProcessedAttributes attributes) -{ - vec3 positionMC = attributes.positionMC; - - mat4 instancingTransform = getInstancingTransform(); - - attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; - - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; - #endif - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var b2=`void legacyInstancingStage( - inout ProcessedAttributes attributes, - out mat4 instanceModelView, - out mat3 instanceModelViewInverseTranspose) -{ - vec3 positionMC = attributes.positionMC; - - mat4 instancingTransform = getInstancingTransform(); - - mat4 instanceModel = instancingTransform * u_instance_nodeTransform; - instanceModelView = u_instance_modifiedModelView; - instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); - - attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; - - #ifdef USE_2D_INSTANCING - mat4 instancingTransform2D = getInstancingTransform2D(); - attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; - #endif -} -`;var T2=new F,f8e=new F,d8e=new F,vre={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Rre,_transformsToTypedArray:aW};vre.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(y2);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,h=[];w8e(e,n,i,h,u,f),P8e(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,pe.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",pe.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",pe.VERTEX),p.u_instance_modifiedModelView=function(){let _=F.multiplyTransformation(s.modelMatrix,a.components.transform,T2);return u?F.multiplyTransformation(n.context.uniformState.view3D,_,T2):(n.mode!==ne.SCENE3D&&(_=Mt.basisTo2D(n.mapProjection,_,T2)),F.multiplyTransformation(n.context.uniformState.view,_,T2))},p.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,f8e)},r.addVertexLines(b2)):r.addVertexLines(x2),u){r.addDefine("USE_2D_INSTANCING",void 0,pe.VERTEX),r.addUniform("mat4","u_modelView2D",pe.VERTEX);let _=n.context,m=F.fromTranslation(c.instancingReferencePoint2D,new F);p.u_modelView2D=function(){return F.multiplyTransformation(_.uniformState.view,m,d8e)}}e.uniformMap=bt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,h)};var Ew=new F,h8e=new d;function m8e(e,t,n,i,o){let r=F.multiplyTransformation(t,e,Ew);return r=F.multiplyTransformation(r,n,Ew),o=Mt.basisTo2D(i.mapProjection,r,o),o}function p8e(e,t,n,i,o){let r=F.fromTranslation(e,Ew),s=F.multiplyTransformation(t,r,Ew);s=F.multiplyTransformation(s,n,Ew);let a=F.getTranslation(s,h8e);return o=zi.computeActualEllipsoidPosition(i,a,o),o}function wre(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=F.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(o.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var Dre=new F,Ire=new F,g8e=new F,_8e=new d;function y8e(e,t,n,i){let o=Dre,r=Ire;wre(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],h=m8e(f,o,r,n,g8e),p=F.getTranslation(h,_8e),_=d.subtract(p,a,p);i[u]=F.setTranslation(h,_,i[u])}return i}function x8e(e,t,n,i){let o=Dre,r=Ire;wre(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],h=p8e(f,o,r,n,f);i[u]=d.subtract(h,a,i[u])}return i}var b8e=new d,T8e=new d;function Pre(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=F.multiplyByPoint(i,n.instancingTranslationMin,b8e),r=zi.computeActualEllipsoidPosition(t,o,o),s=F.multiplyByPoint(i,n.instancingTranslationMax,T8e),a=zi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=d.lerp(r,a,.5,new d)}function aW(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function C8e(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var A8e=new d,E8e=new Oe,S8e=new d;function Rre(e,t,n){let i=new Array(t),o=Kt.getAttributeBySemantic(e,rs.TRANSLATION),r=Kt.getAttributeBySemantic(e,rs.ROTATION),s=Kt.getAttributeBySemantic(e,rs.SCALE),a=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),h=l(s),p=u?o.typedArray:new Float32Array(t*3),_=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(_=Ln.dequantize(_,r.componentDatatype,r.type,t));let m;h?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let b=0;b<t;b++){let T=new d(p[b*3],p[b*3+1],p[b*3+2],A8e);d.maximumByComponent(a,T,a),d.minimumByComponent(c,T,c);let C=new Oe(_[b*4],_[b*4+1],_[b*4+2],f?_[b*4+3]:1,E8e),A=new d(m[b*3],m[b*3+1],m[b*3+2],S8e),S=F.fromTranslationQuaternionRotationScale(T,C,A,new F);i[b]=S}let x=n.runtimeNode;return x.instancingTranslationMin=c,x.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),h&&(s.typedArray=void 0),i}function v8e(e,t,n){let i=new Array(t),o=e.typedArray,r=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new d(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,d.minimumByComponent(r,u,r),d.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function cW(e,t){let n=yt.createVertexBuffer({context:t.context,typedArray:e,usage:Fe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function w8e(e,t,n,i,o,r){let s=Kt.getAttributeBySemantic(n,rs.ROTATION);l(s)?D8e(e,n,i,t,o,r):I8e(e,n,i,t,o)}function D8e(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",h,p=u.instancingTransformsBuffer;if(!l(p)){h=Rre(t,a,e);let b=aW(h);p=cW(b,i),c._modelResources.push(p),r&&(u.transformsTypedArray=b),u.instancingTransformsBuffer=p}if(Sre(e,p,n,f),!o)return;let _=Ge(i);_.mode=ne.COLUMBUS_VIEW,Pre(e,_);let m=u.instancingTransformsBuffer2D;if(!l(m)){let b=y8e(h,e,_,h),T=aW(b);m=cW(T,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}Sre(e,m,n,"Transform2D")}function I8e(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=Kt.getAttributeBySemantic(t,rs.TRANSLATION),u=Kt.getAttributeBySemantic(t,rs.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),sW(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,h=c.typedArray;if(l(h)?f=v8e(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),sW(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let _=Ge(i);_.mode=ne.COLUMBUS_VIEW,Pre(e,_);let m=a.instancingTranslationBuffer2D;if(!l(m)){let C=x8e(f,e,_,f),A=C8e(C);r&&(a.transformsTypedArray=A),m=cW(A,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!o)return;sW(e,m,0,void 0,n,"Translation2D")}function Sre(e,t,n,i){let r=X.getSizeInBytes(X.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function sW(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:X.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function P8e(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===rs.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:on.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var C2=vre;var lW={};lW.name="ModelMatrixUpdateStage";lW.update=function(e,t,n){let i=n.mode!==ne.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Ore(e,t,o,e.transformToRoot),e._transformDirty=!1}};function R8e(e,t,n){e.modelMatrix=F.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Kt.getCullFace(e.modelMatrix,e.primitiveType)}function Ore(e,t,n,i){let o;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];R8e(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=F.clone(i,a._transformToRoot),Ore(a,t,n,i),a._transformDirty=!1}}var A2=lW;var Mre={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Lre,_countGeneratedBuffers:Nre};Mre.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;Lre(i,o),Nre(i,r)};function Lre(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function Nre(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var E2=Mre;function BC(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,O8e(this)}Object.defineProperties(BC.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=F.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;d.equals(n,e)||(t.translation=d.clone(e,t.translation),uW(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Oe.equals(n,e)||(t.rotation=Oe.clone(e,t.rotation),uW(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;d.equals(n,e)||(t.scale=d.clone(e,t.scale),uW(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function O8e(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new Z0(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function uW(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}BC.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};BC.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(C2),t.push(E2),n.push(A2)};BC.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};BC.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new F);let r=F.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=F.inverseTransformation(r,t[o]);t[o]=F.multiplyTransformation(s,n[o],t[o])}};var S2=BC;var Fre={name:"AlphaPipelineStage"};Fre.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=y(i.pass,o.opaquePass);let r=e.renderStateOptions;i.pass===we.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=un.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,pe.FRAGMENT),s.addUniform("float","u_alphaCutoff",pe.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var v2=Fre;var Bre={name:"BatchTexturePipelineStage"};Bre.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=bt(o,e.uniformMap)};var w2=Bre;var kre={name:"ClassificationPipelineStage"};kre.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,pe.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||M8e(t,o)};function M8e(e,t){let n=Kt.getAttributeBySemantic(e,Et.POSITION);if(!l(n))throw new re("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=Kt.getAttributeBySemantic(e,Et.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],h=r?i[0]:0,p=c[h],_=0;for(let x=1;x<s;x++){let b=r?i[x]:x,T=c[b];if(T!==p){let C=x-_,A=x;u.push(C),f.push(A),_=A,p=T}}let m=s-_;u.push(m),t.batchLengths=u,t.batchOffsets=f}var D2=kre;var I2=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) -{ - bool styleTranslucent = (featureColor.a != 1.0); - // Only render translucent features in the translucent pass (if the style or the original command has translucency). - if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) - { - // If the model has a translucent silhouette, it needs to render during the silhouette color command, - // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. - #ifdef HAS_SILHOUETTE - positionMC *= float(model_silhouettePass); - #else - positionMC *= 0.0; - #endif - } - // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. - else if (czm_pass != czm_passTranslucent && styleTranslucent) - { - positionMC *= 0.0; - } -} - -void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) -{ - float show = ceil(feature.color.a); - positionMC *= show; - - #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) - filterByPassType(positionMC, feature.color); - #endif -} -`;var P2=`void filterByPassType(vec4 featureColor) -{ - bool styleTranslucent = (featureColor.a != 1.0); - // Only render translucent features in the translucent pass (if the style or the original command has translucency). - if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) - { - // If the model has a translucent silhouette, it needs to render during the silhouette color command, - // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent. - #ifdef HAS_SILHOUETTE - if(!model_silhouettePass) { - discard; - } - #else - discard; - #endif - } - // If the current pass is not the translucent pass and the style is not translucent, don't render the feature. - else if (czm_pass != czm_passTranslucent && styleTranslucent) - { - discard; - } -} - -void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) -{ - vec4 featureColor = feature.color; - if (featureColor.a == 0.0) - { - discard; - } - - // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader. - // So, we only apply in in the fragment shader if the feature ID texture is used. - #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) - filterByPassType(featureColor); - #endif - - featureColor = czm_gammaCorrect(featureColor); - - // Classification models compute the diffuse differently. - #ifdef HAS_CLASSIFICATION - material.diffuse = featureColor.rgb * featureColor.a; - #else - float highlight = ceil(model_colorBlend); - material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); - #endif - - material.alpha *= featureColor.a; -} -`;var Vre={name:"CPUStylingPipelineStage"};Vre.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(I2),o.addFragmentLines(P2),o.addDefine("USE_CPU_STYLING",void 0,pe.BOTH),l(i.color)||(o.addUniform("float",xx.COLOR_BLEND_UNIFORM_NAME,pe.FRAGMENT),e.uniformMap[xx.COLOR_BLEND_UNIFORM_NAME]=function(){return Fc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",pe.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===we.TRANSLUCENT}};var R2=Vre;var Ure={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};Ure.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var F_=Object.freeze(Ure);var O2=`void customShaderStage( - inout czm_modelVertexOutput vsOutput, - inout ProcessedAttributes attributes, - FeatureIds featureIds, - Metadata metadata, - MetadataClass metadataClass, - MetadataStatistics metadataStatistics -) { - // VertexInput and initializeInputStruct() are dynamically generated in JS, - // see CustomShaderPipelineStage.js - VertexInput vsInput; - initializeInputStruct(vsInput, attributes); - vsInput.featureIds = featureIds; - vsInput.metadata = metadata; - vsInput.metadataClass = metadataClass; - vsInput.metadataStatistics = metadataStatistics; - vertexMain(vsInput, vsOutput); - attributes.positionMC = vsOutput.positionMC; -} -`;var M2=`void customShaderStage( - inout czm_modelMaterial material, - ProcessedAttributes attributes, - FeatureIds featureIds, - Metadata metadata, - MetadataClass metadataClass, - MetadataStatistics metadataStatistics -) { - // FragmentInput and initializeInputStruct() are dynamically generated in JS, - // see CustomShaderPipelineStage.js - FragmentInput fsInput; - initializeInputStruct(fsInput, attributes); - fsInput.featureIds = featureIds; - fsInput.metadata = metadata; - fsInput.metadataClass = metadataClass; - fsInput.metadataStatistics = metadataStatistics; - fragmentMain(fsInput, material); -} -`;var L2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); -} -`;var N2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) -{ - initializeFeatureIds(featureIds, attributes); - initializeFeatureIdAliases(featureIds); - setFeatureIdVaryings(); -} -`;var Mi={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Mi.process=function(e,t,n){let i=e.shaderBuilder;L8e(i);let o=e.runtimeNode.node.instances;l(o)&&N8e(e,o,n),F8e(e,t,n),i.addVertexLines(N2),i.addFragmentLines(L2)};function L8e(e){e.addStruct(Mi.STRUCT_ID_FEATURE_IDS_VS,Mi.STRUCT_NAME_FEATURE_IDS,pe.VERTEX),e.addStruct(Mi.STRUCT_ID_FEATURE_IDS_FS,Mi.STRUCT_NAME_FEATURE_IDS,pe.FRAGMENT),e.addFunction(Mi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Mi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,pe.VERTEX),e.addFunction(Mi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Mi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,pe.FRAGMENT),e.addFunction(Mi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Mi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,pe.VERTEX),e.addFunction(Mi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Mi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,pe.FRAGMENT),e.addFunction(Mi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Mi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,pe.VERTEX)}function N8e(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof bn.FeatureIdAttribute?B8e(e,s,a):zre(e,s,a,o,1,n);let c=s.label;l(c)&&Hre(e,a,c,pe.BOTH)}}function F8e(e,t,n){let i=t.featureIds,r=Kt.getAttributeBySemantic(t,Et.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=pe.BOTH;a instanceof bn.FeatureIdAttribute?k8e(e,a,c):a instanceof bn.FeatureIdImplicitRange?zre(e,a,c,r,void 0,n):(V8e(e,a,c,s,n),u=pe.FRAGMENT);let f=a.label;l(f)&&Hre(e,c,f,u)}}function B8e(e,t,n){let i=e.shaderBuilder;i.addStructField(Mi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Mi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Mi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function k8e(e,t,n){let i=e.shaderBuilder;i.addStructField(Mi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Mi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function zre(e,t,n,i,o,r){U8e(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Mi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Mi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Mi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function V8e(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return y(a.texture,o.context.defaultTexture)};let c=a.channels,u=e.shaderBuilder;u.addStructField(Mi.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,pe.FRAGMENT);let h=`v_texCoord_${a.texCoord}`,p=h,_=a.transform;if(l(_)&&!$.equals(_,$.IDENTITY)){let b=`${r}Transform`;u.addUniform("mat3",b,pe.FRAGMENT),s[b]=function(){return _},p=`vec2(${b} * vec3(${h}, 1.0))`}let m=`texture(${r}, ${p}).${c}`,x=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[x])}function Hre(e,t,n,i){let o=e.shaderBuilder,r=pe.includesVertexShader(i);r&&o.addStructField(Mi.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Mi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Mi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function U8e(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let u=z8e(t,n);s=yt.createVertexBuffer({context:o.context,typedArray:u,usage:Fe.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:X.FLOAT,strideInBytes:X.getSizeInBytes(X.FLOAT),offsetInBytes:0};e.attributes.push(c)}function z8e(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var bx=Mi;var F2=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) -{ - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); -} -`;var B2=`void metadataStage( - out Metadata metadata, - out MetadataClass metadataClass, - out MetadataStatistics metadataStatistics, - ProcessedAttributes attributes - ) -{ - initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); - setMetadataVaryings(); -} -`;var Ti={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Ti.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=H8e(r.propertyAttributes,t,a),u=W8e(r.propertyTextures,a),f=c.concat(u);q8e(i,f),K8e(i),i.addVertexLines(B2),i.addFragmentLines(F2);for(let h=0;h<c.length;h++){let p=c[h];Z8e(e,p)}for(let h=0;h<u.length;h++){let p=u[h];Q8e(e,p)}};function H8e(e,t,n){return l(e)?e.flatMap(i=>G8e(i,t,n)):[]}function G8e(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Kt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[h,p]=c[f],_=i(t,p.attribute),{glslType:m,variableName:x}=o(_);u[f]={metadataVariable:r(h),property:p,type:p.classProperty.type,glslType:m,variableName:x,propertyStatistics:a?.properties[h],shaderDestination:pe.BOTH}}return u}function W8e(e,t){return l(e)?e.flatMap(n=>j8e(n,t)):[]}function j8e(e,t){let{sanitizeGlslIdentifier:n}=Kt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,u]=r[a];s[a]={metadataVariable:n(c),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:pe.FRAGMENT}}return s}function q8e(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==lt.ENUM&&i.add(u)}let o=Ti.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Ti.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,u){e.addStruct(a,a,pe.BOTH);for(let f=0;f<u.length;f++){let{shaderName:h}=u[f],p=u[f].type==="float"?X8e(c):c;e.addStructField(a,p,h)}}}var Y8e={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function X8e(e){let t=Y8e[e];return l(t)?t:e}function K8e(e){e.addStruct(Ti.STRUCT_ID_METADATA_VS,Ti.STRUCT_NAME_METADATA,pe.VERTEX),e.addStruct(Ti.STRUCT_ID_METADATA_FS,Ti.STRUCT_NAME_METADATA,pe.FRAGMENT),e.addStruct(Ti.STRUCT_ID_METADATA_CLASS_VS,Ti.STRUCT_NAME_METADATA_CLASS,pe.VERTEX),e.addStruct(Ti.STRUCT_ID_METADATA_CLASS_FS,Ti.STRUCT_NAME_METADATA_CLASS,pe.FRAGMENT),e.addStruct(Ti.STRUCT_ID_METADATA_STATISTICS_VS,Ti.STRUCT_NAME_METADATA_STATISTICS,pe.VERTEX),e.addStruct(Ti.STRUCT_ID_METADATA_STATISTICS_FS,Ti.STRUCT_NAME_METADATA_STATISTICS,pe.FRAGMENT),e.addFunction(Ti.FUNCTION_ID_INITIALIZE_METADATA_VS,Ti.FUNCTION_SIGNATURE_INITIALIZE_METADATA,pe.VERTEX),e.addFunction(Ti.FUNCTION_ID_INITIALIZE_METADATA_FS,Ti.FUNCTION_SIGNATURE_INITIALIZE_METADATA,pe.FRAGMENT),e.addFunction(Ti.FUNCTION_ID_SET_METADATA_VARYINGS,Ti.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,pe.VERTEX)}function Z8e(e,t){$8e(e,t),Gre(e.shaderBuilder,t),Wre(e.shaderBuilder,t)}function $8e(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=qre({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:pe.BOTH,property:o});n.addStructField(Ti.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Ti.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function Q8e(e,t){J8e(e,t),Gre(e.shaderBuilder,t),Wre(e.shaderBuilder,t)}function J8e(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:u,texture:f,transform:h}=s.textureReader,p=`u_propertyTexture_${u}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,pe.FRAGMENT),i[p]=()=>f),n.addStructField(Ti.STRUCT_ID_METADATA_FS,r,o);let _=`attributes.texCoord_${a}`,m=_;if(l(h)&&!$.equals(h,$.IDENTITY)){let A=`${p}Transform`;n.addUniform("mat3",A,pe.FRAGMENT),i[A]=function(){return h},m=`vec2(${A} * vec3(${_}, 1.0))`}let x=`texture(${p}, ${m}).${c}`,b=s.unpackInShader(x),T=qre({valueExpression:b,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:pe.FRAGMENT,property:s}),C=`metadata.${o} = ${T};`;n.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_FS,[C])}function Gre(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=jre(Ti.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Ti.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_FS,s),pe.includesVertexShader(r)&&(e.addStructField(Ti.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Wre(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===lt.ENUM)return;let s=Ti.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=jre(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Ti.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_FS,c),pe.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ti.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ti.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function jre(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function qre(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,o,u),s.addUniform(c,r,u);let{offset:f,scale:h}=n;return a[o]=()=>f,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var Ed=Ti;var eGe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Tx=Object.freeze(eGe);var ta={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:xt};ta.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Tx.TRANSLUCENT?r.pass=we.TRANSLUCENT:c===Tx.OPAQUE&&(r.pass=void 0);let u=cGe(s,t);if(!u.customShaderEnabled)return;if(dGe(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,pe.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,pe.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,pe.FRAGMENT);let p=F_.getDefineName(s.mode);i.addDefine(p,void 0,pe.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let _=f[p];i.addUniform(_.type,p)}let h=s.varyings;for(let p in h)if(h.hasOwnProperty(p)){let _=h[p];i.addVarying(_,p)}e.uniformMap=bt(e.uniformMap,s.uniformMap)};function tGe(e){let t={};for(let n=0;n<e.length;n++){let i=Kt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var nGe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},iGe={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function Yre(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=nGe[t],i=iGe[t];if(l(n))return{attributeField:[n,e],value:i}}function oGe(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=Xre(t,n,!1),o=Kre(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let f=[i[c].glslType,c];s.push(f),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let u=o[c],f=Yre(u);if(!l(f))return ta._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${u}, disabling custom vertex shader`),{enabled:!1};s.push(f.attributeField),r=`vsInput.attributes.${u} = ${f.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function rGe(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function sGe(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=Xre(t,n,!0),o=Kre(t,n,!0),r,s=[],a=[];for(let u in i){if(!i.hasOwnProperty(u))continue;let h=[i[u].glslType,u];s.push(h),r=`fsInput.attributes.${u} = attributes.${u};`,a.push(r)}for(let u=0;u<o.length;u++){let f=o[u],h=Yre(f);if(!l(h))return ta._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${f}, disabling custom fragment shader.`),{enabled:!1};s.push(h.attributeField),r=`fsInput.attributes.${f} = ${h.value};`,a.push(r)}let c=rGe(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var aGe={positionWC:!0,positionEC:!0};function Xre(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function Kre(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||aGe.hasOwnProperty(o))continue;let r=o;n&&o==="normalEC"?r="normalMC":n&&o==="tangentEC"&&(r="tangentMC"),e.hasOwnProperty(r)||i.push(o)}return i}function cGe(e,t){let n=tGe(t.attributes),i=oGe(e,n),o=sGe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function lGe(e,t){let n=ta.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ta.STRUCT_NAME_ATTRIBUTES,pe.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=ta.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ta.STRUCT_NAME_VERTEX_INPUT,pe.VERTEX),e.addStructField(n,ta.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,bx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Ed.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Ed.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Ed.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ta.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,ta.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,pe.VERTEX),e.addFunctionLines(r,o)}function uGe(e,t){let n=ta.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ta.STRUCT_NAME_ATTRIBUTES,pe.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=ta.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ta.STRUCT_NAME_FRAGMENT_INPUT,pe.FRAGMENT),e.addStructField(n,ta.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,bx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Ed.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Ed.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Ed.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ta.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,ta.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,pe.FRAGMENT),e.addFunctionLines(r,o)}var fGe=[];function dGe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=fGe;i.enabled&&(lGe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,O2),e.addVertexLines(r)),o.enabled&&(uGe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,M2),e.addFragmentLines(r))}var k2=ta;var Sw={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};Sw.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,pe.VERTEX),i.addFunction(Sw.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,Sw.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,pe.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===Et.POSITION,h=c.semantic===Et.TEXCOORD;if(r&&!f&&!h)continue;let p=Kt.getAttributeInfo(c);mGe(i,p),hGe(e,p)}};function hGe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,pe.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,pe.VERTEX),n.addUniform(c,a,pe.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=Zre(u,0),f=Zre(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Zre(e,t){return e instanceof oe?e:new oe(e.x,e.y,e.z,t)}function mGe(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=pGe(n,i):o=gGe(n),e.addFunctionLines(Sw.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function pGe(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function gGe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var V2=Sw;var U2=`void geometryStage(out ProcessedAttributes attributes) -{ - attributes.positionMC = v_positionMC; - attributes.positionEC = v_positionEC; - - #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) - attributes.positionWC = v_positionWC; - #endif - - #ifdef HAS_NORMALS - // renormalize after interpolation - attributes.normalEC = normalize(v_normalEC); - #endif - - #ifdef HAS_TANGENTS - attributes.tangentEC = normalize(v_tangentEC); - #endif - - #ifdef HAS_BITANGENTS - attributes.bitangentEC = normalize(v_bitangentEC); - #endif - - // Everything else is dynamically generated in GeometryPipelineStage - setDynamicVaryings(attributes); -} -`;var z2=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) -{ - vec4 computedPosition; - - // Compute positions in different coordinate systems - vec3 positionMC = attributes.positionMC; - v_positionMC = positionMC; - v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; - - #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) - vec3 position2D = attributes.position2D; - vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; - computedPosition = czm_projection * vec4(positionEC, 1.0); - #else - computedPosition = czm_projection * vec4(v_positionEC, 1.0); - #endif - - // Sometimes the custom shader and/or style needs this - #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS) - // Note that this is a 32-bit position which may result in jitter on small - // scales. - v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; - #endif - - #ifdef HAS_NORMALS - v_normalEC = normalize(normal * attributes.normalMC); - #endif - - #ifdef HAS_TANGENTS - v_tangentEC = normalize(normal * attributes.tangentMC); - #endif - - #ifdef HAS_BITANGENTS - v_bitangentEC = normalize(normal * attributes.bitangentMC); - #endif - - // All other varyings need to be dynamically generated in - // GeometryPipelineStage - setDynamicVaryings(attributes); - - return computedPosition; -} -`;var vw=`vec2 computeSt(float featureId) -{ - float stepX = model_textureStep.x; - float centerX = model_textureStep.y; - - #ifdef MULTILINE_BATCH_TEXTURE - float stepY = model_textureStep.z; - float centerY = model_textureStep.w; - - float xId = mod(featureId, model_textureDimensions.x); - float yId = floor(featureId / model_textureDimensions.x); - - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); - #else - return vec2(centerX + (featureId * stepX), 0.5); - #endif -} - -void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) -{ - int featureId = featureIds.SELECTED_FEATURE_ID; - - - if (featureId < model_featuresLength) - { - vec2 featureSt = computeSt(float(featureId)); - - feature.id = featureId; - feature.st = featureSt; - feature.color = texture(model_batchTexture, featureSt); - } - // Floating point comparisons can be unreliable in GLSL, so we - // increment the feature ID to make sure it's always greater - // then the model_featuresLength - a condition we check for in the - // pick ID, to avoid sampling the pick texture if the feature ID is - // greater than the number of features. - else - { - feature.id = model_featuresLength + 1; - feature.st = vec2(0.0); - feature.color = vec4(1.0); - } - - #ifdef HAS_NULL_FEATURE_ID - if (featureId == model_nullFeatureId) { - feature.id = featureId; - feature.st = vec2(0.0); - feature.color = vec4(1.0); - } - #endif -} -`;var ww={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};ww.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=_Ge(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),yGe(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===pe.BOTH&&i.addVertexLines(vw),i.addFragmentLines(vw)};function $re(e){return e instanceof bn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Qre(e){return e instanceof bn.FeatureIdTexture?pe.FRAGMENT:pe.BOTH}function _Ge(e,t,n){let i,o;return l(t.instances)&&(o=Kt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:Qre(o),featureIdDefine:$re(o)}):(o=Kt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:Qre(o),featureIdDefine:$re(o)})}function yGe(e){e.addStructField(ww.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(ww.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(ww.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Cx=ww;var Bs={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Bs.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",pe.VERTEX),i.addStruct(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",pe.FRAGMENT),i.addStruct(Cx.STRUCT_ID_SELECTED_FEATURE,Cx.STRUCT_NAME_SELECTED_FEATURE,pe.BOTH),i.addFunction(Bs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Bs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,pe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Bs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,pe.VERTEX),i.addFunction(Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Bs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,pe.FRAGMENT),o.type===gr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,pe.FRAGMENT);let r=n.mode!==ne.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],h=on.getAttributeLocationCount(f.type),p=f.semantic===Et.POSITION,_;h>1?(_=e.attributeIndex,e.attributeIndex+=h):p&&!a?_=0:_=e.attributeIndex++,xGe(e,f,_,h,r,s)}DGe(i,t.attributes),t.primitiveType===Me.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(z2),i.addFragmentLines(U2)};function xGe(e,t,n,i,o,r){let s=e.shaderBuilder,a=Kt.getAttributeInfo(t),c=o&&!r;i>1?CGe(e,t,n,i):TGe(e,t,n,c),EGe(s,a,c),AGe(s,a),l(t.semantic)&&bGe(s,t),SGe(s,a,o),vGe(s,a,c),wGe(s,a)}function bGe(e,t){let{semantic:n,setIndex:i}=t;switch(n){case Et.NORMAL:e.addDefine("HAS_NORMALS");break;case Et.TANGENT:e.addDefine("HAS_TANGENTS");break;case Et.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case Et.TEXCOORD:case Et.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function TGe(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===Et.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===Et.POSITION,f=u?0:n,h=on.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let _=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:_,count:t.count,componentsPerAttribute:h,componentDatatype:X.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function CGe(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,u=on.getNumberOfComponents(s)/i,f=X.getSizeInBytes(a),h=u*f,p=t.byteStride;for(let _=0;_<i;_++){let m=t.byteOffset+_*h,x={index:n+_,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(x)}}function AGe(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function EGe(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===Et.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function SGe(e,t,n){let i=Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function vGe(e,t,n){let i=Bs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function wGe(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function DGe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===Et.NORMAL?n=!0:r.semantic===Et.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var H2=Bs;var G2=`#ifdef USE_IBL_LIGHTING -vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) -{ - #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) - // Environment maps were provided, use them for IBL - vec3 viewDirection = -normalize(position); - vec3 iblColor = textureIBL(viewDirection, normal, material); - return iblColor; - #endif - - return vec3(0.0); -} -#endif - -#ifdef USE_CLEARCOAT -vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) -{ - vec3 viewDirection = -normalize(position); - vec3 halfwayDirection = normalize(viewDirection + lightDirection); - vec3 normal = material.clearcoatNormal; - float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0); - - // clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5. - vec3 f0 = vec3(0.04); - vec3 f90 = vec3(1.0); - // Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h). - // This is to make it energy conserving with a simple layering function. - float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); - vec3 F = fresnelSchlick2(f0, f90, NdotV); - - // compute specular reflection from direct lighting - float roughness = material.clearcoatRoughness; - float alphaRoughness = roughness * roughness; - float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness); - vec3 directReflection = F * directStrength * NdotL; - vec3 color = lightColorHdr * directReflection; - - #ifdef SPECULAR_IBL - // Find the direction in which to sample the environment map - vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal)); - vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness); - color += iblColor * material.occlusion; - #endif - - float clearcoatFactor = material.clearcoatFactor; - vec3 clearcoatColor = color * clearcoatFactor; - - // Dim base layer based on transmission loss through clearcoat - return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor; -} -#endif - -#if defined(LIGHTING_PBR) && defined(HAS_NORMALS) -vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position) -{ - #ifdef USE_CUSTOM_LIGHT_COLOR - vec3 lightColorHdr = model_lightColorHdr; - #else - vec3 lightColorHdr = czm_lightColorHdr; - #endif - - vec3 viewDirection = -normalize(position); - vec3 normal = material.normalEC; - vec3 lightDirection = normalize(czm_lightDirectionEC); - - vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material); - vec3 directColor = lightColorHdr * directLighting; - - // Accumulate colors from base layer - vec3 color = directColor + material.emissive; - #ifdef USE_IBL_LIGHTING - color += computeIBL(position, normal, lightDirection, lightColorHdr, material); - #endif - - #ifdef USE_CLEARCOAT - color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material); - #endif - - return color; -} -#endif - -/** - * Compute the material color under the current lighting conditions. - * All other material properties are passed through so further stages - * have access to them. - * - * @param {czm_modelMaterial} material The material properties from {@MaterialStageFS} - * @param {ProcessedAttributes} attributes - */ -void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) -{ - #ifdef LIGHTING_PBR - #ifdef HAS_NORMALS - vec3 color = computePbrLighting(material, attributes.positionEC); - #else - vec3 color = material.diffuse * material.occlusion + material.emissive; - #endif - // In HDR mode, the frame buffer is in linear color space. The - // post-processing stages (see PostProcessStageCollection) will handle - // tonemapping. However, if HDR is not enabled, we must tonemap else large - // values may be clamped to 1.0 - #ifndef HDR - color = czm_pbrNeutralTonemapping(color); - #endif - #else // unlit - vec3 color = material.diffuse; - #endif - - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - // The colors resulting from point cloud styles are adjusted differently. - color = czm_gammaCorrect(color); - #elif !defined(HDR) - // If HDR is not enabled, the frame buffer stores sRGB colors rather than - // linear colors so the linear value must be converted. - color = czm_linearToSrgb(color); - #endif - - material.diffuse = color; -} -`;var IGe={UNLIT:0,PBR:1},Op=Object.freeze(IGe);var Jre={name:"LightingPipelineStage"};Jre.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,pe.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",pe.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Op.PBR?o.addDefine("LIGHTING_PBR",void 0,pe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,pe.FRAGMENT),o.addFragmentLines(G2)};var W2=Jre;var j2=`// If the style color is white, it implies the feature has not been styled. -bool isDefaultStyleColor(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} - -vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) -{ - vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); - vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; - return color; -} - -vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform) -{ - return vec2(textureTransform * vec3(texCoord, 1.0)); -} - -#ifdef HAS_NORMAL_TEXTURE -vec2 getNormalTexCoords() -{ - vec2 texCoord = TEXCOORD_NORMAL; - #ifdef HAS_NORMAL_TEXTURE_TRANSFORM - texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0)); - #endif - return texCoord; -} -#endif - -#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE) -vec3 computeTangent(in vec3 position, in vec2 normalTexCoords) -{ - vec2 tex_dx = dFdx(normalTexCoords); - vec2 tex_dy = dFdy(normalTexCoords); - float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y; - vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position); - return tangent / determinant; -} -#endif - -#ifdef USE_ANISOTROPY -struct NormalInfo { - vec3 tangent; - vec3 bitangent; - vec3 normal; - vec3 geometryNormal; -}; - -NormalInfo getNormalInfo(ProcessedAttributes attributes) -{ - vec3 geometryNormal = attributes.normalEC; - #ifdef HAS_NORMAL_TEXTURE - vec2 normalTexCoords = getNormalTexCoords(); - #endif - - #ifdef HAS_BITANGENTS - vec3 tangent = attributes.tangentEC; - vec3 bitangent = attributes.bitangentEC; - #else // Assume HAS_NORMAL_TEXTURE - vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords); - tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent)); - vec3 bitangent = normalize(cross(geometryNormal, tangent)); - #endif - - #ifdef HAS_NORMAL_TEXTURE - mat3 tbn = mat3(tangent, bitangent, geometryNormal); - vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; - normalSample = 2.0 * normalSample - 1.0; - #ifdef HAS_NORMAL_TEXTURE_SCALE - normalSample.xy *= u_normalTextureScale; - #endif - vec3 normal = normalize(tbn * normalSample); - #else - vec3 normal = geometryNormal; - #endif - - #ifdef HAS_DOUBLE_SIDED_MATERIAL - if (czm_backFacing()) { - tangent *= -1.0; - bitangent *= -1.0; - normal *= -1.0; - geometryNormal *= -1.0; - } - #endif - - NormalInfo normalInfo; - normalInfo.tangent = tangent; - normalInfo.bitangent = bitangent; - normalInfo.normal = normal; - normalInfo.geometryNormal = geometryNormal; - - return normalInfo; -} -#endif - -#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) -vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) -{ - vec2 normalTexCoords = getNormalTexCoords(); - - // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set - #ifdef HAS_BITANGENTS - vec3 t = attributes.tangentEC; - vec3 b = attributes.bitangentEC; - #else - vec3 t = computeTangent(attributes.positionEC, normalTexCoords); - t = normalize(t - geometryNormal * dot(geometryNormal, t)); - vec3 b = normalize(cross(geometryNormal, t)); - #endif - - mat3 tbn = mat3(t, b, geometryNormal); - vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; - normalSample = 2.0 * normalSample - 1.0; - #ifdef HAS_NORMAL_TEXTURE_SCALE - normalSample.xy *= u_normalTextureScale; - #endif - return normalize(tbn * normalSample); -} -#endif - -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE -vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) -{ - vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL; - #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM - normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0)); - #endif - - // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set - #ifdef HAS_BITANGENTS - vec3 t = attributes.tangentEC; - vec3 b = attributes.bitangentEC; - #else - vec3 t = computeTangent(attributes.positionEC, normalTexCoords); - t = normalize(t - geometryNormal * dot(geometryNormal, t)); - vec3 b = normalize(cross(geometryNormal, t)); - #endif - - mat3 tbn = mat3(t, b, geometryNormal); - vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb; - normalSample = 2.0 * normalSample - 1.0; - #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE - normalSample.xy *= u_clearcoatNormalTextureScale; - #endif - return normalize(tbn * normalSample); -} -#endif - -#ifdef HAS_NORMALS -vec3 computeNormal(ProcessedAttributes attributes) -{ - // Geometry normal. This is already normalized - vec3 normal = attributes.normalEC; - - #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) - normal = getNormalFromTexture(attributes, normal); - #endif - - #ifdef HAS_DOUBLE_SIDED_MATERIAL - if (czm_backFacing()) { - normal = -normal; - } - #endif - - return normal; -} -#endif - -#ifdef HAS_BASE_COLOR_TEXTURE -vec4 getBaseColorFromTexture() -{ - vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; - #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM - baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); - #endif - - vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); - - #ifdef HAS_BASE_COLOR_FACTOR - baseColorWithAlpha *= u_baseColorFactor; - #endif - - return baseColorWithAlpha; -} -#endif - -#ifdef HAS_EMISSIVE_TEXTURE -vec3 getEmissiveFromTexture() -{ - vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; - #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM - emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); - #endif - - vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); - #ifdef HAS_EMISSIVE_FACTOR - emissive *= u_emissiveFactor; - #endif - - return emissive; -} -#endif - -#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) -void setSpecularGlossiness(inout czm_modelMaterial material) -{ - #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE - vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; - #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM - specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); - #endif - - vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); - vec3 specular = specularGlossiness.rgb; - float glossiness = specularGlossiness.a; - #ifdef HAS_LEGACY_SPECULAR_FACTOR - specular *= u_legacySpecularFactor; - #endif - - #ifdef HAS_GLOSSINESS_FACTOR - glossiness *= u_glossinessFactor; - #endif - #else - #ifdef HAS_LEGACY_SPECULAR_FACTOR - vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0)); - #else - vec3 specular = vec3(1.0); - #endif - - #ifdef HAS_GLOSSINESS_FACTOR - float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); - #else - float glossiness = 1.0; - #endif - #endif - - #ifdef HAS_DIFFUSE_TEXTURE - vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; - #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM - diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); - #endif - - vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); - #ifdef HAS_DIFFUSE_FACTOR - diffuse *= u_diffuseFactor; - #endif - #elif defined(HAS_DIFFUSE_FACTOR) - vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); - #else - vec4 diffuse = vec4(1.0); - #endif - - material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular)); - // the specular glossiness extension's alpha overrides anything set - // by the base material. - material.alpha = diffuse.a; - - material.specular = specular; - - // glossiness is the opposite of roughness, but easier for artists to use. - material.roughness = 1.0 - glossiness; -} -#elif defined(LIGHTING_PBR) -float setMetallicRoughness(inout czm_modelMaterial material) -{ - #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE - vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; - #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM - metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); - #endif - - vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; - float metalness = clamp(metallicRoughness.b, 0.0, 1.0); - float roughness = clamp(metallicRoughness.g, 0.0, 1.0); - #ifdef HAS_METALLIC_FACTOR - metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0); - #endif - - #ifdef HAS_ROUGHNESS_FACTOR - roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0); - #endif - #else - #ifdef HAS_METALLIC_FACTOR - float metalness = clamp(u_metallicFactor, 0.0, 1.0); - #else - float metalness = 1.0; - #endif - - #ifdef HAS_ROUGHNESS_FACTOR - float roughness = clamp(u_roughnessFactor, 0.0, 1.0); - #else - float roughness = 1.0; - #endif - #endif - - // dielectrics use f0 = 0.04, metals use albedo as f0 - const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); - vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness); - - material.specular = f0; - - // diffuse only applies to dielectrics. - material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness); - - // This is perceptual roughness. The square of this value is used for direct lighting - material.roughness = roughness; - - return metalness; -} -#ifdef USE_SPECULAR -void setSpecular(inout czm_modelMaterial material, in float metalness) -{ - #ifdef HAS_SPECULAR_TEXTURE - vec2 specularTexCoords = TEXCOORD_SPECULAR; - #ifdef HAS_SPECULAR_TEXTURE_TRANSFORM - specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform); - #endif - float specularWeight = texture(u_specularTexture, specularTexCoords).a; - #ifdef HAS_SPECULAR_FACTOR - specularWeight *= u_specularFactor; - #endif - #else - #ifdef HAS_SPECULAR_FACTOR - float specularWeight = u_specularFactor; - #else - float specularWeight = 1.0; - #endif - #endif - - #ifdef HAS_SPECULAR_COLOR_TEXTURE - vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; - #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM - specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); - #endif - vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; - vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); - #ifdef HAS_SPECULAR_COLOR_FACTOR - specularColorFactor *= u_specularColorFactor; - #endif - #else - #ifdef HAS_SPECULAR_COLOR_FACTOR - vec3 specularColorFactor = u_specularColorFactor; - #else - vec3 specularColorFactor = vec3(1.0); - #endif - #endif - material.specularWeight = specularWeight; - vec3 f0 = material.specular; - vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0)); - material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness); -} -#endif -#ifdef USE_ANISOTROPY -void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo) -{ - mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x); - float anisotropyStrength = u_anisotropy.z; - - vec2 direction = vec2(1.0, 0.0); - #ifdef HAS_ANISOTROPY_TEXTURE - vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY; - #ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM - anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); - #endif - vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; - direction = anisotropySample.rg * 2.0 - vec2(1.0); - anisotropyStrength *= anisotropySample.b; - #endif - - direction = rotation * direction; - mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal); - vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0)); - vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT); - - material.anisotropicT = anisotropicT; - material.anisotropicB = anisotropicB; - material.anisotropyStrength = anisotropyStrength; -} -#endif -#ifdef USE_CLEARCOAT -void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes) -{ - #ifdef HAS_CLEARCOAT_TEXTURE - vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; - #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM - clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); - #endif - float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; - #ifdef HAS_CLEARCOAT_FACTOR - clearcoatFactor *= u_clearcoatFactor; - #endif - #else - #ifdef HAS_CLEARCOAT_FACTOR - float clearcoatFactor = u_clearcoatFactor; - #else - // PERFORMANCE_IDEA: this case should turn the whole extension off - float clearcoatFactor = 0.0; - #endif - #endif - - #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE - vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; - #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM - clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); - #endif - float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; - #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR - clearcoatRoughness *= u_clearcoatRoughnessFactor; - #endif - #else - #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR - float clearcoatRoughness = u_clearcoatRoughnessFactor; - #else - float clearcoatRoughness = 0.0; - #endif - #endif - - material.clearcoatFactor = clearcoatFactor; - // This is perceptual roughness. The square of this value is used for direct lighting - material.clearcoatRoughness = clearcoatRoughness; - #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE - material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC); - #else - material.clearcoatNormal = attributes.normalEC; - #endif -} -#endif -#endif - -void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) -{ - #ifdef USE_ANISOTROPY - NormalInfo normalInfo = getNormalInfo(attributes); - material.normalEC = normalInfo.normal; - #elif defined(HAS_NORMALS) - material.normalEC = computeNormal(attributes); - #endif - - vec4 baseColorWithAlpha = vec4(1.0); - // Regardless of whether we use PBR, set a base color - #ifdef HAS_BASE_COLOR_TEXTURE - baseColorWithAlpha = getBaseColorFromTexture(); - #elif defined(HAS_BASE_COLOR_FACTOR) - baseColorWithAlpha = u_baseColorFactor; - #endif - - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - baseColorWithAlpha = v_pointCloudColor; - #elif defined(HAS_COLOR_0) - vec4 color = attributes.color_0; - // .pnts files store colors in the sRGB color space - #ifdef HAS_SRGB_COLOR - color = czm_srgbToLinear(color); - #endif - baseColorWithAlpha *= color; - #endif - - #ifdef USE_CPU_STYLING - baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend); - #endif - material.baseColor = baseColorWithAlpha; - material.diffuse = baseColorWithAlpha.rgb; - material.alpha = baseColorWithAlpha.a; - - #ifdef HAS_OCCLUSION_TEXTURE - vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; - #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM - occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); - #endif - material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; - #endif - - #ifdef HAS_EMISSIVE_TEXTURE - material.emissive = getEmissiveFromTexture(); - #elif defined(HAS_EMISSIVE_FACTOR) - material.emissive = u_emissiveFactor; - #endif - - #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) - setSpecularGlossiness(material); - #elif defined(LIGHTING_PBR) - float metalness = setMetallicRoughness(material); - #ifdef USE_SPECULAR - setSpecular(material, metalness); - #endif - #ifdef USE_ANISOTROPY - setAnisotropy(material, normalInfo); - #endif - #ifdef USE_CLEARCOAT - setClearcoat(material, attributes); - #endif - #endif -} -`;var{Material:PGe,MetallicRoughness:fW,SpecularGlossiness:dW,Specular:ese,Clearcoat:tse}=bn,nse={name:"MaterialPipelineStage",_processTexture:Al,_processTextureTransform:ise};nse.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:h}=n.context;OGe(i,r,s,u,f,h,c),l(i.specularGlossiness)?MGe(i.specularGlossiness,r,s,u,c):(l(i.specular)&&Kt.supportedExtensions.KHR_materials_specular&&LGe(i.specular,r,s,u,c),l(i.anisotropy)&&Kt.supportedExtensions.KHR_materials_anisotropy&&FGe(i.anisotropy,r,s,u,c),l(i.clearcoat)&&Kt.supportedExtensions.KHR_materials_clearcoat&&BGe(i.clearcoat,r,s,u,c),kGe(i.metallicRoughness,r,s,u,c));let p=Kt.getAttributeBySemantic(t,Et.NORMAL),_=e.lightingOptions;i.unlit||!p||a?_.lightingModel=Op.UNLIT:_.lightingModel=Op.PBR;let m=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=m;let x=e.alphaOptions;i.alphaMode===Ep.BLEND?x.pass=we.TRANSLUCENT:i.alphaMode===Ep.MASK&&(x.alphaCutoff=i.alphaCutoff),s.addFragmentLines(j2),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,pe.BOTH)};function ise(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,pe.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,pe.FRAGMENT),t[s]=function(){return n.transform}}function RGe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,pe.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,pe.FRAGMENT),t[s]=function(){return n.scale}}function Al(e,t,n,i,o,r){e.addUniform("sampler2D",i,pe.FRAGMENT),t[i]=function(){return y(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,pe.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,c,pe.FRAGMENT);let f=n.transform;l(f)&&!$.equals(f,$.IDENTITY)&&ise(e,t,n,i,o);let{scale:h}=n;l(h)&&h!==1&&RGe(e,t,n,i,o)}function OGe(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:u,occlusionTexture:f}=e;l(a)&&!d.equals(a,PGe.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",pe.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,pe.FRAGMENT),l(c)&&!s&&Al(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(u)&&!s&&Al(n,t,u,"u_normalTexture","NORMAL",o),l(f)&&!s&&Al(n,t,f,"u_occlusionTexture","OCCLUSION",i)}function MGe(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,pe.FRAGMENT),l(r)&&!o&&Al(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!oe.equals(s,dW.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",pe.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,pe.FRAGMENT)),l(a)&&!o&&Al(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!d.equals(c,dW.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",pe.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,pe.FRAGMENT)),l(u)&&u!==dW.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",pe.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,pe.FRAGMENT))}function LGe(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,pe.FRAGMENT),l(r)&&!o&&Al(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==ese.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",pe.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,pe.FRAGMENT)),l(a)&&!o&&Al(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!d.equals(c,ese.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",pe.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,pe.FRAGMENT))}var NGe=new d;function FGe(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,pe.FRAGMENT),l(a)&&!o&&Al(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",pe.FRAGMENT),t.u_anisotropy=function(){return d.fromElements(c,u,r,NGe)}}function BGe(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,pe.FRAGMENT),l(r)&&r!==tse.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",pe.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,pe.FRAGMENT)),l(s)&&!o&&Al(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==tse.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",pe.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,pe.FRAGMENT)),l(c)&&!o&&Al(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!o&&Al(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function kGe(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,pe.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&Al(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!oe.equals(s,fW.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",pe.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,pe.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&Al(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==fW.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",pe.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,pe.FRAGMENT));let u=e.roughnessFactor;l(u)&&u!==fW.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",pe.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,pe.FRAGMENT))}var q2=nse;var Vc={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};Vc.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Vc.METADATA_PICKING_VALUE_TYPE,"float",pe.FRAGMENT),i.addDefine(Vc.METADATA_PICKING_VALUE_STRING,"0.0",pe.FRAGMENT),i.addDefine(Vc.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",pe.FRAGMENT),i.addDefine(Vc.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",pe.FRAGMENT),i.addDefine(Vc.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",pe.FRAGMENT),i.addDefine(Vc.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",pe.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",pe.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${Vc.METADATA_PICKING_VALUE_TYPE} value = ${Vc.METADATA_PICKING_VALUE_TYPE}(${Vc.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Vc.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Vc.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Vc.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Vc.METADATA_PICKING_VALUE_COMPONENT_W};`],pe.FRAGMENT)};var pf=Vc;var Y2=`void morphTargetsStage(inout ProcessedAttributes attributes) -{ - vec3 positionMC = attributes.positionMC; - attributes.positionMC = getMorphedPosition(positionMC); - - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = getMorphedNormal(normalMC); - #endif - - #ifdef HAS_TANGENTS - vec3 tangentMC = attributes.tangentMC; - attributes.tangentMC = getMorphedTangent(tangentMC); - #endif -}`;var Ea={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Ea.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,pe.VERTEX),WGe(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let h=c[f],p=h.semantic;p!==Et.POSITION&&p!==Et.NORMAL&&p!==Et.TANGENT||(UGe(e,h,e.attributeIndex,a),e.attributeIndex++)}}jGe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,pe.VERTEX),n.addVertexLines(Y2);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=bt(s,e.uniformMap)};var VGe={attributeString:void 0,functionId:void 0};function UGe(e,t,n,i){let o=e.shaderBuilder;zGe(e,t,n);let r=HGe(t,VGe);GGe(o,r,i)}function zGe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:on.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function HGe(e,t){switch(e.semantic){case Et.POSITION:t.attributeString="Position",t.functionId=Ea.FUNCTION_ID_GET_MORPHED_POSITION;break;case Et.NORMAL:t.attributeString="Normal",t.functionId=Ea.FUNCTION_ID_GET_MORPHED_NORMAL;break;case Et.TANGENT:t.attributeString="Tangent",t.functionId=Ea.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function GGe(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function WGe(e){e.addFunction(Ea.FUNCTION_ID_GET_MORPHED_POSITION,Ea.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,pe.VERTEX),e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Ea.FUNCTION_ID_GET_MORPHED_NORMAL,Ea.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,pe.VERTEX),e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Ea.FUNCTION_ID_GET_MORPHED_TANGENT,Ea.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,pe.VERTEX),e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function jGe(e){e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var X2=Ea;var ose={name:"PickingPipelineStage"};ose.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)qGe(e,t,a,i);else if(l(a))YGe(e,i);else{let c=rse(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",pe.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function rse(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(gr.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function qGe(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Kt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Kt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",pe.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(f.pickTexture,f.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function YGe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let h=0;h<n;h++){let p=rse(e,h),_=t.createPickId(p);s.push(_),i[h]=_;let m=_.color;o[h*4+0]=z.floatToByte(m.red),o[h*4+1]=z.floatToByte(m.green),o[h*4+2]=z.floatToByte(m.blue),o[h*4+3]=z.floatToByte(m.alpha)}r._pickIds=i;let a=yt.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,pe.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var K2=ose;var XGe={ADD:0,REPLACE:1},Yo=Object.freeze(XGe);var Z2=`float getPointSizeFromAttenuation(vec3 positionEC) { - // Variables are packed into a single vector to minimize gl.uniformXXX() calls - float pointSize = model_pointCloudParameters.x; - float geometricError = model_pointCloudParameters.y; - float depthMultiplier = model_pointCloudParameters.z; - - float depth = -positionEC.z; - return min((geometricError / depth) * depthMultiplier, pointSize); -} - -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); -} -#endif - -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); -} -#endif - -#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - float tiles3d_tileset_time = model_pointCloudParameters.w; - return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); -} -#elif defined(HAS_POINT_CLOUD_ATTENUATION) -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { - return getPointSizeFromAttenuation(v_positionEC); -} -#endif - -#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING -float pointCloudBackFaceCullingStage() { - #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) - // This needs to be computed in eye coordinates so we can't use attributes.normalMC - return step(-v_normalEC.z, 0.0); - #else - return 1.0; - #endif -} -#endif`;var KGe=new oe,ase={name:"PointCloudStylingPipelineStage"};ase.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(r)&&!u){let x=JGe(a),b=e5e(r,x);t5e(i,b);let C=n5e(b).indexOf("normalMC")>=0,A=Kt.getAttributeBySemantic(t,Et.NORMAL);if(C&&!A)throw new re("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,pe.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=we.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,pe.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,pe.VERTEX);let h,p,_;gr.is3DTiles(o.type)&&(p=!0,h=o.content,_=h.tile.refine===Yo.ADD),i.addUniform("vec4","model_pointCloudParameters",pe.VERTEX),i.addVertexLines(Z2);let m=e.uniformMap;m.model_pointCloudParameters=function(){let x=KGe,b=1;p&&(b=_?5:h.tileset.memoryAdjustedScreenSpaceError),x.x=y(f.maximumAttenuation,b),x.x*=n.pixelRatio;let T=ZGe(e,t,f,h);x.y=T*f.geometricErrorScale;let C=n.context,A=n.camera.frustum,S;return n.mode===ne.SCENE2D||A instanceof rn?S=Number.POSITIVE_INFINITY:S=C.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=S,p&&(x.w=h.tileset.timeSinceLoad),x}};var sse=new d;function ZGe(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=Kt.getAttributeBySemantic(t,Et.POSITION),r=o.count,s=e.runtimeNode.transform,a=d.subtract(o.max,o.min,sse);a=F.multiplyByPointAsVector(s,a,sse);let c=a.x*a.y*a.z;return P.cbrt(c/r)}var $Ge={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},QGe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function JGe(e){let t=Ge(QGe);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var hW="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function e5e(e,t){let n=$Ge,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${hW})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${hW})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${hW})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function t5e(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,pe.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,pe.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,pe.VERTEX),e.addVertexLines(o))}function mW(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function n5e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&mW(t,o),l(n)&&mW(n,o),l(i)&&mW(i,o),o}var $2=ase;var Q2=`void primitiveOutlineStage() { - v_outlineCoordinates = a_outlineCoordinates; -} -`;var J2=`void primitiveOutlineStage(inout czm_modelMaterial material) { - if (!model_showOutline) { - return; - } - - float outlineX = - texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; - float outlineY = - texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; - float outlineZ = - texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; - float outlineness = max(outlineX, max(outlineY, outlineZ)); - - material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); -} - -`;var cse={name:"PrimitiveOutlinePipelineStage"};cse.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,pe.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:on.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",pe.FRAGMENT);let a=EC.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",pe.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",pe.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(Q2),i.addFragmentLines(J2)};var eB=cse;var lse={name:"PrimitiveStatisticsPipelineStage",_countGeometry:use,_count2DPositions:fse,_countMorphTargetAttributes:dse,_countMaterialTextures:hse,_countFeatureIdTextures:mse,_countBinaryMetadata:pse};lse.process=function(e,t,n){let i=e.model,o=i.statistics;use(o,t),fse(o,e.runtimePrimitive),dse(o,t),hse(o,t.material),mse(o,t.featureIds),pse(o,i)};function use(e,t){let n=l(t.indices)?t.indices.count:Kt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Me.POINTS?e.pointsLength+=n:Me.isTriangles(i)&&(e.trianglesLength+=i5e(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function i5e(e,t){switch(e){case Me.TRIANGLES:return t/3;case Me.TRIANGLE_STRIP:case Me.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function fse(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function dse(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function hse(e,t){let n=o5e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function o5e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function mse(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof bn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function pse(e,t){let n=t.structuralMetadata;l(n)&&(r5e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function r5e(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var tB=lse;var s5e=new F,a5e=new F,gse={name:"SceneMode2DPipelineStage"};gse.process=function(e,t,n){let i=Kt.getAttributeBySemantic(t,Et.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=F.multiplyTransformation(s,a,s5e),u=u5e(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let h=e.runtimeNode.node.instances;if(l(h))return;if(l(i.typedArray)){let x=h5e(i,c,u,n);f.positionBuffer2D=x,r._modelResources.push(x),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,pe.VERTEX),o.addUniform("mat4","u_modelView2D",pe.VERTEX);let p=F.fromTranslation(u.center,new F),_=n.context,m={u_modelView2D:function(){return F.multiplyTransformation(_.uniformState.view,p,a5e)}};e.uniformMap=bt(m,e.uniformMap)};var c5e=new d,l5e=new d;function u5e(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,c5e),o=zi.computeActualEllipsoidPosition(n,i,i),r=F.multiplyByPoint(t,e.positionMax,l5e),s=zi.computeActualEllipsoidPosition(n,r,r);return ae.fromCornerPoints(o,s,new ae)}var _se=new d;function f5e(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=d.fromArray(e,s,_se),c=d.multiplyComponents(a,r,a),u=d.add(c,o,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function d5e(e,t,n,i){let o;l(e.quantization)?o=f5e(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let u=d.fromArray(o,c,_se);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=F.multiplyByPoint(t,u,u),h=zi.computeActualEllipsoidPosition(i,f,f),p=d.subtract(h,n,h);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function h5e(e,t,n,i){let o=Ge(i);o.mode=ne.COLUMBUS_VIEW;let r=n.center,s=d5e(e,t,r,o),a=yt.createVertexBuffer({context:i.context,typedArray:s,usage:Fe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var nB=gse;var iB=`void skinningStage(inout ProcessedAttributes attributes) -{ - mat4 skinningMatrix = getSkinningMatrix(); - mat3 skinningMatrixMat3 = mat3(skinningMatrix); - - vec4 positionMC = vec4(attributes.positionMC, 1.0); - attributes.positionMC = vec3(skinningMatrix * positionMC); - - #ifdef HAS_NORMALS - vec3 normalMC = attributes.normalMC; - attributes.normalMC = skinningMatrixMat3 * normalMC; - #endif - - #ifdef HAS_TANGENTS - vec3 tangentMC = attributes.tangentMC; - attributes.tangentMC = skinningMatrixMat3 * tangentMC; - #endif -}`;var Ax={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};Ax.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,pe.VERTEX),p5e(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,pe.VERTEX),n.addVertexLines(iB);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=bt(r,e.uniformMap)};function m5e(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===Et.JOINTS||r.semantic===Et.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function p5e(e,t){e.addFunction(Ax.FUNCTION_ID_GET_SKINNING_MATRIX,Ax.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,pe.VERTEX),e.addFunctionLines(Ax.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=m5e(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(Ax.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(Ax.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var oB=Ax;var rB=`void verticalExaggerationStage( - inout ProcessedAttributes attributes -) { - // Compute the distance from the camera to the local center of curvature. - vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); - vec2 vertexAzimuth = normalize(vertexPositionENU.xy); - // Curvature = 1 / radius of curvature. - float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature); - float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; - - // Compute the approximate ellipsoid normal at the vertex position. - // Uses a circular approximation for the Earth curvature along the geodesic. - vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; - vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; - vec3 vertexNormal = normalize(centerToVertex); - - // Estimate the (sine of the) angle between the camera direction and the vertex normal - float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC); - float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC); - float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance); - bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta; - - // Approximate the change in height above the ellipsoid, from camera to vertex position. - float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal); - float smallAngleVersine = 0.5 * sinTheta * sinTheta; - float versine = isSmallAngle ? smallAngleVersine : exactVersine; - float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine; - float vertexHeight = czm_eyeHeight + dHeight; - - // Transform the approximate vertex normal to model coordinates. - vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz; - vertexNormalMC = normalize(vertexNormalMC); - - // Compute the exaggeration and apply it along the approximate vertex normal. - float stretch = u_verticalExaggerationAndRelativeHeight.x; - float shift = u_verticalExaggerationAndRelativeHeight.y; - float exaggeration = (vertexHeight - shift) * (stretch - 1.0); - attributes.positionMC += exaggeration * vertexNormalMC; -} -`;var yse={name:"VerticalExaggerationPipelineStage"},g5e=new U;yse.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(rB),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,pe.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",pe.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return U.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,g5e)}};var sB=yse;var pW={};function _5e(e){let t=Ne.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function y5e(e,t){let n=t.length,i=Ne.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function x5e(e){let t=e-2,n=2+t*4,i=Ne.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function b5e(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=c}return r}function T5e(e){let t=e-2,n=2+t*4,i=Ne.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function C5e(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}pW.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Me.TRIANGLES)return i?y5e(t,n):_5e(t);if(e===Me.TRIANGLE_STRIP)return i?b5e(t,n):x5e(t);if(e===Me.TRIANGLE_FAN)return i?C5e(t,n):T5e(t)};pW.getWireframeIndicesCount=function(e,t){return e===Me.TRIANGLES?t*2:e===Me.TRIANGLE_STRIP||e===Me.TRIANGLE_FAN?2+(t-2)*4:t};var Dw=pW;var xse={name:"WireframePipelineStage"};xse.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,pe.FRAGMENT);let o=e.model,r=A5e(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Me.LINES,e.count=Dw.getWireframeIndicesCount(a,c)};function A5e(e,t,n){let o=Kt.getAttributeBySemantic(e,Et.POSITION).count,r=n.context.webgl2,s;if(l(t)){let f=t.buffer,h=t.count;l(f)&&r?(s=f.sizeInBytes===h?new Uint8Array(h):Ne.createTypedArray(o,h),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=Dw.createWireframeIndices(a,o,s),u=Ne.fromSizeInBytes(c.BYTES_PER_ELEMENT);return yt.createIndexBuffer({context:n.context,typedArray:c,usage:Fe.STATIC_DRAW,indexDatatype:u})}var aB=xse;function bse(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}bse.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,u=e.mode!==ne.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),_=l(r),x=!(_&&l(r.fragmentShaderText))||r.mode!==F_.REPLACE_MATERIAL,b=Kt.hasQuantizedAttributes(n.attributes),T=o.debugWireframe&&Me.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),C=o.pointCloudShading,A=l(C)&&C.attenuation,S=l(C)&&C.backFaceCulling,v=n.primitiveType===Me.POINTS&&(l(s)||A||S),D=o._enableShowOutline&&l(n.outlineCoordinates),O=E5e(o,i,n),R=l(o.classificationType);u&&t.push(nB),t.push(H2),T&&t.push(aB),R&&t.push(D2),h&&t.push(X2),p&&t.push(oB),v&&t.push($2),b&&t.push(V2),x&&t.push(q2),t.push(bx),t.push(Ed),t.push(pf),O.hasPropertyTable&&(t.push(Cx),t.push(w2),t.push(R2)),f&&t.push(sB),_&&t.push(k2),t.push(W2),o.allowPicking&&t.push(K2),D&&t.push(eB),t.push(v2),t.push(tB)};function E5e(e,t,n){let i;return l(t.instances)&&(i=Kt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Kt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var cB=bse;function gW(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],S5e(this)}Object.defineProperties(gW.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function S5e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let u=i[c].index,f=r[u];s.push(f);let h=n[c],p=Tse(f,h,new F);a.push(p)}}function Tse(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}gW.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=Tse(i,o,e[n])}};var lB=gW;function v5e(){this.pass=void 0,this.alphaCutoff=void 0}var uB=v5e;function w5e(e){this.shaderBuilder=new vT,this.model=e,this.uniformMap={},this.alphaOptions=new uB,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:vc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var fB=w5e;var dB=`void silhouetteStage(inout vec4 color) { - if(model_silhouettePass) { - color = czm_gammaCorrect(model_silhouetteColor); - } -}`;var hB=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { - #ifdef HAS_NORMALS - if(model_silhouettePass) { - vec3 normal = normalize(czm_normal3D * attributes.normalMC); - normal.x *= czm_projection[0][0]; - normal.y *= czm_projection[1][1]; - positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; - } - #endif -} -`;var mB={name:"ModelSilhouettePipelineStage"};mB.silhouettesLength=0;mB.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++mB.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,pe.BOTH),i.addVertexLines(hB),i.addFragmentLines(dB),i.addUniform("vec4","model_silhouetteColor",pe.FRAGMENT),i.addUniform("float","model_silhouetteSize",pe.VERTEX),i.addUniform("bool","model_silhouettePass",pe.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=bt(o,e.uniformMap),e.hasSilhouette=!0};var pB=mB;var gB=`void modelSplitterStage() -{ - // Don't split when rendering the shadow map, because it is rendered from - // the perspective of a totally different camera. -#ifndef SHADOW_MAP - if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; - if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -#endif -} -`;var _B={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};_B.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,pe.FRAGMENT),i.addFragmentLines(gB);let o={};i.addUniform("float",_B.SPLIT_DIRECTION_UNIFORM_NAME,pe.FRAGMENT),o[_B.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=bt(o,e.uniformMap)};var yB=_B;function D5e(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ge(e.uniformMap),this.alphaOptions=Ge(e.alphaOptions),this.renderStateOptions=Ge(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var xB=D5e;function I5e(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,Op.UNLIT)}var bB=I5e;function P5e(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ge(e.uniformMap),this.alphaOptions=Ge(e.alphaOptions),this.renderStateOptions=Ge(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Kt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Kt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=d.clone(i.min,new d),this.positionMax=d.clone(i.max,new d),this.boundingSphere=ae.fromCornerPoints(this.positionMin,this.positionMax,new ae),this.lightingOptions=new bB,this.pickId=void 0}var TB=P5e;function yW(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==kn.CESIUM_3D_TILE,this._classifies3DTiles=o!==kn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],L5e(this)}function R5e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:dt.KEEP,zFail:dt.DECREMENT_WRAP,zPass:dt.KEEP},backFunction:e,backOperation:{fail:dt.KEEP,zFail:dt.INCREMENT_WRAP,zPass:dt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:vc.LESS_OR_EQUAL},depthMask:!1}}var O5e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},M5e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:dt.ZERO,zFail:dt.ZERO,zPass:dt.ZERO},reference:0,mask:Ut.CLASSIFICATION_MASK},stencilMask:Ut.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Ese=[];function L5e(e){let t=e._command,n=Ese;if(e._useDebugWireframe){t.pass=we.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=Iw(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=we.TERRAIN_CLASSIFICATION,s=_W(t,r),a=Cse(t,r);n.length=0,n.push(s,a),e._commandListTerrain=Iw(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Ase(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=we.CESIUM_3D_TILE_CLASSIFICATION,s=_W(t,r),a=Cse(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=Iw(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Ase(e,n,e._commandList3DTilesPicking))}}function Iw(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let u=o[c],f=r[c];for(let h=0;h<a;h++){let p=t[h],_=$e.shallowClone(p);_.count=u,_.offset=f,n.push(_)}}return n}function _W(e,t){let n=$e.shallowClone(e);n.cull=!1,n.pass=t;let i=t===we.TERRAIN_CLASSIFICATION?Vn.ALWAYS:Vn.EQUAL,o=R5e(i);return n.renderState=Ve.fromCache(o),n}function Cse(e,t){let n=$e.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ve.fromCache(O5e),n}var N5e=[];function Ase(e,t,n){let i=Ve.fromCache(M5e),o=t[0],r=t[1],s=$e.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=$e.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=N5e;return c.length=0,c.push(s,a),Iw(e,c,n)}Object.defineProperties(yW.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ae.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});yW.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=_W(this._command,o),s=Ese;s.length=0,s.push(r),this._commandListIgnoreShow=Iw(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var CB=yW;function AB(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===we.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,h=c;this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=ae.clone(t.boundingVolume),this._modelMatrix2D=new F,this._boundingVolume2D=new ae,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=h,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,F5e(this)}function Mp(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}Mp.clone=function(e){return new Mp({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function F5e(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new Mp({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Mp({command:G5e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Mp({command:K5e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Mp({command:Z5e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Mp({command:W5e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Mp({command:j5e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(AB.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ae.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,k5e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,V5e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,U5e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,z5e(this))}}});function B5e(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ae.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function k5e(e){let t=e.shadows,n=xn.castShadows(t),i=xn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function V5e(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=Ge(r.renderState,!0);s.cull.enabled=t,r.renderState=Ve.fromCache(s)}}}function U5e(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=Ge(r.renderState,!0);s.cull.face=t,r.renderState=Ve.fromCache(s)}}}function z5e(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}AB.prototype.pushCommands=function(e,t){let n=Sse(this,e);n&&!this._has2DCommands&&(H5e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(B5e(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==em.ALL_OPAQUE&&VC(t,this._translucentCommand,n),i===em.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||VC(o._backfaceCommands,this._skipLodBackfaceCommand,n),q5e(this,r,n),VC(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){VC(t,this._silhouetteModelCommand,n);return}return VC(t,this._originalCommand,n),t}};AB.prototype.pushSilhouetteCommands=function(e,t){let n=Sse(this,e);return VC(t,this._silhouetteColorCommand,n),t};function VC(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function Sse(e,t){if(t.mode!==ne.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*P.PI;return o<s&&r>s||o<-s&&r>-s}function kC(e,t){if(!l(t))return;let n=Mp.clone(t),i=$e.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function H5e(e){kC(e,e._originalCommand),kC(e,e._translucentCommand),kC(e,e._skipLodBackfaceCommand),kC(e,e._skipLodStencilCommand),kC(e,e._silhouetteModelCommand),kC(e,e._silhouetteColorCommand)}function G5e(e){let t=$e.shallowClone(e);t.pass=we.TRANSLUCENT;let n=Ge(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function W5e(e,t){let n=t._silhouetteId%255,i=$e.shallowClone(e),o=Ge(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function j5e(e,t){let n=t._silhouetteId%255,i=$e.shallowClone(e),o=Ge(e.renderState,!0);o.cull.enabled=!1,(e.pass===we.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=we.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ge(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function q5e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=Y5e(o);if(r!==s){let a=X5e(r),c=Ge(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ve.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Y5e(e){return(e.renderState.stencilTest.reference&Ut.SKIP_LOD_MASK)>>>Ut.SKIP_LOD_BIT_SHIFT}function X5e(e){return Ut.CESIUM_3D_TILE_MASK|e<<Ut.SKIP_LOD_BIT_SHIFT}function K5e(e){let t=$e.shallowClone(e),n=Ge(e.renderState,!0);n.cull.enabled=!0,n.cull.face=xi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ge(t.uniformMap),o=new U(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ve.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function Z5e(e){let t=$e.shallowClone(e),n=Ge(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Ut.SKIP_LOD_MASK,i.reference=Ut.CESIUM_3D_TILE_MASK,i.frontFunction=Vn.GREATER_OR_EQUAL,i.frontOperation.zPass=dt.REPLACE,i.backFunction=Vn.GREATER_OR_EQUAL,i.backOperation.zPass=dt.REPLACE,n.stencilMask=Ut.CESIUM_3D_TILE_MASK|Ut.SKIP_LOD_MASK,t.renderState=Ve.fromCache(n),t}var EB=AB;var SB=`precision highp float; - -czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { - czm_modelVertexOutput vsOutput; - vsOutput.positionMC = positionMC; - vsOutput.pointSize = 1.0; - return vsOutput; -} - -void main() -{ - // Initialize the attributes struct with all - // attributes except quantized ones. - ProcessedAttributes attributes; - initializeAttributes(attributes); - - // Dequantize the quantized ones and add them to the - // attributes struct. - #ifdef USE_DEQUANTIZATION - dequantizationStage(attributes); - #endif - - #ifdef HAS_MORPH_TARGETS - morphTargetsStage(attributes); - #endif - - #ifdef HAS_SKINNING - skinningStage(attributes); - #endif - - #ifdef HAS_PRIMITIVE_OUTLINE - primitiveOutlineStage(); - #endif - - // Compute the bitangent according to the formula in the glTF spec. - // Normal and tangents can be affected by morphing and skinning, so - // the bitangent should not be computed until their values are finalized. - #ifdef HAS_BITANGENTS - attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); - #endif - - FeatureIds featureIds; - featureIdStage(featureIds, attributes); - - #ifdef HAS_SELECTED_FEATURE_ID - SelectedFeature feature; - selectedFeatureIdStage(feature, featureIds); - // Handle any show properties that come from the style. - cpuStylingStage(attributes.positionMC, feature); - #endif - - #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) - // The scene mode 2D pipeline stage and instancing stage add a different - // model view matrix to accurately project the model to 2D. However, the - // output positions and normals should be transformed by the 3D matrices - // to keep the data the same for the fragment shader. - mat4 modelView = czm_modelView3D; - mat3 normal = czm_normal3D; - #else - // These are used for individual model projection because they will - // automatically change based on the scene mode. - mat4 modelView = czm_modelView; - mat3 normal = czm_normal; - #endif - - // Update the position for this instance in place - #ifdef HAS_INSTANCING - - // The legacy instance stage is used when rendering i3dm models that - // encode instances transforms in world space, as opposed to glTF models - // that use EXT_mesh_gpu_instancing, where instance transforms are encoded - // in object space. - #ifdef USE_LEGACY_INSTANCING - mat4 instanceModelView; - mat3 instanceModelViewInverseTranspose; - - legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); - - modelView = instanceModelView; - normal = instanceModelViewInverseTranspose; - #else - instancingStage(attributes); - #endif - - #ifdef USE_PICKING - v_pickColor = a_pickColor; - #endif - - #endif - - Metadata metadata; - MetadataClass metadataClass; - MetadataStatistics metadataStatistics; - metadataStage(metadata, metadataClass, metadataStatistics, attributes); - - #ifdef HAS_VERTICAL_EXAGGERATION - verticalExaggerationStage(attributes); - #endif - - #ifdef HAS_CUSTOM_VERTEX_SHADER - czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); - customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); - #endif - - // Compute the final position in each coordinate system needed. - // This returns the value that will be assigned to gl_Position. - vec4 positionClip = geometryStage(attributes, modelView, normal); - - // This must go after the geometry stage as it needs v_positionWC - #ifdef HAS_ATMOSPHERE - atmosphereStage(attributes); - #endif - - #ifdef ENABLE_CLIPPING_POLYGONS - modelClippingPolygonsStage(attributes); - #endif - - #ifdef HAS_SILHOUETTE - silhouetteStage(attributes, positionClip); - #endif - - #ifdef HAS_POINT_CLOUD_SHOW_STYLE - float show = pointCloudShowStylingStage(attributes, metadata); - #else - float show = 1.0; - #endif - - #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING - show *= pointCloudBackFaceCullingStage(); - #endif - - #ifdef HAS_POINT_CLOUD_COLOR_STYLE - v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); - #endif - - #ifdef PRIMITIVE_TYPE_POINTS - #ifdef HAS_CUSTOM_VERTEX_SHADER - gl_PointSize = vsOutput.pointSize; - #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) - gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); - #else - gl_PointSize = 1.0; - #endif - - gl_PointSize *= show; - #endif - - // Important NOT to compute gl_Position = show * positionClip or we hit: - // https://github.com/CesiumGS/cesium/issues/11270 - // - // We will discard points with v_pointCloudShow == 0 in the fragment shader. - gl_Position = positionClip; - - #ifdef HAS_POINT_CLOUD_SHOW_STYLE - v_pointCloudShow = show; - #endif -} -`;var vB=` -precision highp float; -czm_modelMaterial defaultModelMaterial() -{ - czm_modelMaterial material; - material.diffuse = vec3(0.0); - material.specular = vec3(1.0); - material.roughness = 1.0; - material.occlusion = 1.0; - material.normalEC = vec3(0.0, 0.0, 1.0); - material.emissive = vec3(0.0); - material.alpha = 1.0; - return material; -} - -vec4 handleAlpha(vec3 color, float alpha) -{ - #ifdef ALPHA_MODE_MASK - if (alpha < u_alphaCutoff) { - discard; - } - #endif - - return vec4(color, alpha); -} - -SelectedFeature selectedFeature; - -void main() -{ - #ifdef HAS_POINT_CLOUD_SHOW_STYLE - if (v_pointCloudShow == 0.0) - { - discard; - } - #endif - - #ifdef HAS_MODEL_SPLITTER - modelSplitterStage(); - #endif - - czm_modelMaterial material = defaultModelMaterial(); - - ProcessedAttributes attributes; - geometryStage(attributes); - - FeatureIds featureIds; - featureIdStage(featureIds, attributes); - - Metadata metadata; - MetadataClass metadataClass; - MetadataStatistics metadataStatistics; - metadataStage(metadata, metadataClass, metadataStatistics, attributes); - - //======================================================================== - // When not picking metadata START - #ifndef METADATA_PICKING_ENABLED - - #ifdef HAS_SELECTED_FEATURE_ID - selectedFeatureIdStage(selectedFeature, featureIds); - #endif - - #ifndef CUSTOM_SHADER_REPLACE_MATERIAL - materialStage(material, attributes, selectedFeature); - #endif - - #ifdef HAS_CUSTOM_FRAGMENT_SHADER - customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); - #endif - - lightingStage(material, attributes); - - #ifdef HAS_SELECTED_FEATURE_ID - cpuStylingStage(material, selectedFeature); - #endif - - #ifdef HAS_MODEL_COLOR - modelColorStage(material); - #endif - - #ifdef HAS_PRIMITIVE_OUTLINE - primitiveOutlineStage(material); - #endif - - vec4 color = handleAlpha(material.diffuse, material.alpha); - - // When not picking metadata END - //======================================================================== - #else - //======================================================================== - // When picking metadata START - - vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0); - metadataPickingStage(metadata, metadataClass, metadataValues); - vec4 color = metadataValues; - - #endif - // When picking metadata END - //======================================================================== - - #ifdef HAS_CLIPPING_PLANES - modelClippingPlanesStage(color); - #endif - - #ifdef ENABLE_CLIPPING_POLYGONS - modelClippingPolygonsStage(); - #endif - - //======================================================================== - // When not picking metadata START - #ifndef METADATA_PICKING_ENABLED - - #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) - silhouetteStage(color); - #endif - - #ifdef HAS_ATMOSPHERE - atmosphereStage(color, attributes); - #endif - - #endif - // When not picking metadata END - //======================================================================== - - out_FragColor = color; -} -`;function vse(){}vse.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=$5e(e,n,t),o=Q5e(e,i,t),r=e.model;return l(r.classificationType)?new CB({primitiveRenderResources:e,command:o}):new EB({primitiveRenderResources:e,command:o})};function $5e(e,t,n){t.addVertexLines(SB),t.addFragmentLines(vB);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function Q5e(e,t,n){let i=J5e(e),o=new ti({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,c=n.mode===ne.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&r._projectTo2D)u=F.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new F),f=e.runtimePrimitive.boundingSphere2D;else{let T=c?a._computedModelMatrix:a._computedModelMatrix2D;u=F.multiplyTransformation(T,e.runtimeNode.computedTransform,new F),f=ae.transform(e.boundingSphere,u)}let h=Ge(Ve.fromCache(e.renderStateOptions),!0);h.cull.face=Kt.getCullFace(u,e.primitiveType),h=Ve.fromCache(h);let p=l(r.classificationType),_=p?!1:xn.castShadows(r.shadows),m=p?!1:xn.receiveShadows(r.shadows),x=p?void 0:e.pickId;return new $e({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:x,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:_,receiveShadows:m})}function J5e(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var wB=vse;function cu(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=Kt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},e6e(this)}Object.defineProperties(cu.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function e6e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;wse(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let C=0;C<s;C++){let A=r[C],S=new u2({articulation:A,sceneGraph:e}),v=S.name;a[v]=S}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let h=n.nodes.length,p=F.IDENTITY;for(let C=0;C<h;C++){let A=n.nodes[C],S=Dse(e,A,p);e._rootNodes.push(S)}let _=t.skins,m=e._runtimeSkins,x=_.length;for(let C=0;C<x;C++){let A=_[C];m.push(new lB({skin:A,sceneGraph:e}))}let b=e._skinnedNodes,T=b.length;for(let C=0;C<T;C++){let A=b[C],S=e._runtimeNodes[A],D=c[A].skin.index;S._runtimeSkin=m[D],S.updateJointMatrices()}e.applyArticulations()}function wse(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var t6e=new d;function n6e(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,t6e);if(!d.equals(i,d.ZERO))e._computedModelMatrix2D=Mt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Mt.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ae.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Dse(e,t,n){let i=[],o=Kt.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let h=t.children[f],p=F.multiplyTransformation(n,o,new F),_=Dse(e,h,p);i.push(_)}let s=new S2({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new cB({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,h=new _2(f,s);f._nodesByName[u]=h}return c}var i6e=new d,o6e=new d,r6e=new d,s6e=new d;cu.prototype.buildDrawCommands=function(e){let t=this._model,n=new fB(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,i6e),c=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,o6e);for(o=0;o<this._runtimeNodes.length;o++){let u=this._runtimeNodes[o];if(!l(u))continue;u.configurePipeline();let f=u.pipelineStages,h=new xB(n,u);for(r=0;r<f.length;r++)f[r].process(h,u.node,e);let p=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){let _=u.runtimePrimitives[r];_.configurePipeline(e);let m=_.pipelineStages,x=new TB(h,_);for(s=0;s<m.length;s++)m[s].process(x,_.primitive,e);_.boundingSphere=ae.clone(x.boundingSphere,new ae);let b=F.multiplyByPoint(p,x.positionMin,r6e),T=F.multiplyByPoint(p,x.positionMax,s6e);d.minimumByComponent(a,b,a),d.maximumByComponent(c,T,c);let C=wB.buildModelDrawCommand(x,e);_.drawCommand=C}}this._boundingSphere=ae.fromCornerPoints(a,c,new ae),this._boundingSphere=ae.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ae.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ae.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};cu.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;l(n.color)&&t.push(xx),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(a2),n.isClippingEnabled()&&t.push(h2),n.isClippingPolygonsEnabled()&&t.push(g2),n.hasSilhouette(e)&&t.push(pB),l(n.splitDirection)&&n.splitDirection!==Gr.NONE&&t.push(yB),gr.is3DTiles(n.type)&&t.push(n2),i&&t.push(r2))};cu.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==ne.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};cu.prototype.updateModelMatrix=function(e,t){wse(this,e),t.mode!==ne.SCENE3D&&n6e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};cu.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function Ise(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);Ise(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,o)}}function DB(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];Ise(e,c,t,n,i)}}var a6e={backFaceCulling:void 0};cu.prototype.updateBackFaceCulling=function(e){let t=a6e;t.backFaceCulling=e,DB(this,!1,c6e,t)};function c6e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var l6e={shadowMode:void 0};cu.prototype.updateShadows=function(e){let t=l6e;t.shadowMode=e,DB(this,!1,u6e,t)};function u6e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var f6e={debugShowBoundingVolume:void 0};cu.prototype.updateShowBoundingVolume=function(e){let t=f6e;t.debugShowBoundingVolume=e,DB(this,!1,d6e,t)};function d6e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Pse=[],h6e={frameState:void 0,hasSilhouette:void 0};cu.prototype.pushDrawCommands=function(e){let t=Pse;t.length=0;let n=h6e;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,DB(this,!0,m6e,n),e.commandList.push.apply(e.commandList,t)};function m6e(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Pse,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}cu.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};cu.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var IB=cu;function B_(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new vt}Object.defineProperties(B_.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});B_.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};B_.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};B_.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};B_.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};B_.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};B_.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var PB=B_;var Lse=Ur(WP(),1);var Rse={},Ex=Uint32Array.BYTES_PER_ELEMENT;Rse.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=Ex;let o=i.getUint32(t,!0);if(o!==1)throw new re(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=Ex,t+=Ex;let r=i.getUint32(t,!0);if(r===0)throw new re("Feature table must have a byte length greater than zero");t+=Ex;let s=i.getUint32(t,!0);t+=Ex;let a=i.getUint32(t,!0);t+=Ex;let c=i.getUint32(t,!0);t+=Ex;let u=Fo(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let h,p;a>0&&(h=Fo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let _=new Qh(u,f),m=_.getGlobalProperty("POINTS_LENGTH");if(_.featuresLength=m,!l(m))throw new re("Feature table global property: POINTS_LENGTH must be defined");let x=_.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(x)&&(x=d.unpack(x));let b=p6e(_,h);if(b.rtcCenter=x,b.pointsLength=m,!b.hasPositions){let T=g6e(_);b.positions=T,b.hasPositions=b.hasPositions||l(T)}if(!b.hasPositions)throw new re("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let T=y6e(_);b.normals=T,b.hasNormals=b.hasNormals||l(T)}if(!b.hasColors){let T=_6e(_);b.colors=T,b.hasColors=b.hasColors||l(T),b.hasConstantColor=l(b.constantColor),b.isTranslucent=l(T)&&T.isTranslucent}if(!b.hasBatchIds){let T=x6e(_);b.batchIds=T,b.hasBatchIds=b.hasBatchIds||l(T)}if(b.hasBatchIds){let T=_.getGlobalProperty("BATCH_LENGTH");if(!l(T))throw new re("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=T}return l(p)&&(p=new Uint8Array(p),b.batchTableJson=h,b.batchTableBinary=p),b};function p6e(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,u,f,h,p;if(l(s)){o=s.properties;let m=s.byteOffset,x=s.byteLength;if(!l(o)||!l(m)||!l(x))throw new re("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+x),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),h=l(o.BATCH_ID),p=l(o.RGBA)}let _;return l(i)&&(_={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:bt(o,r),dequantizeInShader:!0}),{draco:_,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:h}}function g6e(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",X.FLOAT,3),{name:Et.POSITION,semantic:Et.POSITION,typedArray:n,isQuantized:!1,componentDatatype:X.FLOAT,type:on.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",X.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",X.FLOAT,3);if(!l(i))throw new re("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",X.FLOAT,3);if(!l(r))throw new re("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:Et.POSITION,semantic:Et.POSITION,typedArray:n,isQuantized:!0,componentDatatype:X.FLOAT,type:on.VEC3,quantizedRange:o,quantizedVolumeOffset:d.unpack(r),quantizedVolumeScale:d.unpack(i),quantizedComponentDatatype:X.UNSIGNED_SHORT,quantizedType:on.VEC3}}}function _6e(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",X.UNSIGNED_BYTE,4),{name:Et.COLOR,semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:on.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",X.UNSIGNED_BYTE,3),{name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.UNSIGNED_BYTE,type:on.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",X.UNSIGNED_SHORT,1),{name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n,componentDatatype:X.FLOAT,type:on.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",X.UNSIGNED_BYTE,4),o=i[3],r=z.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:Et.COLOR,semantic:Et.COLOR,setIndex:0,constantColor:r,componentDatatype:X.FLOAT,type:on.VEC4,isQuantized:!1,isTranslucent:s}}}function y6e(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",X.FLOAT,3),{name:Et.NORMAL,semantic:Et.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:X.FLOAT,type:on.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",X.UNSIGNED_BYTE,2),{name:Et.NORMAL,semantic:Et.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:on.VEC2,quantizedComponentDatatype:X.UNSIGNED_BYTE,componentDatatype:X.FLOAT,type:on.VEC3}}function x6e(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",X.UNSIGNED_SHORT,1);return{name:Et.FEATURE_ID,semantic:Et.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:X.fromTypedArray(n),type:on.SCALAR}}}var UC=Rse;var b6e=bn.Components,T6e=bn.Scene,C6e=bn.Node,A6e=bn.Primitive,E6e=bn.Attribute,Ose=bn.Quantization,S6e=bn.FeatureIdAttribute,v6e=bn.Material,w6e=bn.MetallicRoughness;function k_(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=gt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(k_.prototype=Object.create(Ki.prototype),k_.prototype.constructor=k_);Object.defineProperties(k_.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});k_.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=UC.parse(this._arrayBuffer,this._byteOffset),this._state=gt.PROCESSING,this._promise=Promise.resolve(this)};k_.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===gt.READY)return!0;if(this._state===gt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=D6e(this,e.context)}return!1};function D6e(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=d_.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&I6e(e,i,r),U6e(e,t),e._state=gt.READY,e}).catch(function(r){e.unload(),e._state=gt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function I6e(e,t,n){e._state=gt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:Et.POSITION,typedArray:n.POSITION.array,componentDatatype:X.FLOAT,type:on.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=d.fromElements(c,c,c),f=d.unpack(a.minValues),h=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=h<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT,o.quantizedType=on.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:Et.NORMAL,typedArray:n.NORMAL.array,componentDatatype:X.FLOAT,type:on.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=X.UNSIGNED_BYTE,o.quantizedType=on.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:X.UNSIGNED_BYTE,type:on.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:Et.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:X.UNSIGNED_BYTE,type:on.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:Et.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:X.fromTypedArray(a),type:on.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let u=c.data;r[a]={byteOffset:u.byteOffset,type:P6e(u.componentsPerAttribute),componentType:R6e(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function P6e(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function R6e(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function Pw(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Ose,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Ose;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=d.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=d.divideByScalar(c,a,new d),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new E6e;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=y(t.normalized,!1),r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Ln.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=z.pack(t.constantColor,a)}else{let a=yt.createVertexBuffer({typedArray:i,context:n,usage:Fe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===Et.POSITION&&s&&(r.typedArray=i),r}var Mse,RB;function O6e(e){if(!l(RB)){Mse=new Lse.default(0),RB=new Array(e);for(let t=0;t<e;++t)RB[t]=Mse.random()}return RB}var M6e=new d,L6e=new d,N6e=new d;function F6e(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=O6e(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=d.fromElements(s,s,s,M6e),u=d.fromElements(a,a,a,L6e),f,h,p;if(e.isQuantized)c=d.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)h=Math.floor(r[f]*i),p=d.unpack(t,h*3,N6e),d.minimumByComponent(c,p,c),d.maximumByComponent(u,p,u);e.min=d.clone(c),e.max=d.clone(u)}var B6e={name:Et.COLOR,semantic:Et.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:X.FLOAT,type:on.VEC4,isQuantized:!1,isTranslucent:!1};function k6e(e,t,n){let i=[],o,r=t.positions;return l(r)&&(F6e(r),o=Pw(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=Pw(e,t.normals,n),i.push(o)),l(t.colors)?(o=Pw(e,t.colors,n),i.push(o)):(o=Pw(e,B6e,n),i.push(o)),l(t.batchIds)&&(o=Pw(e,t.batchIds,n),i.push(o)),i}function V6e(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);if(l(o)||e.hasDracoBatchTable){let s=y(n,i);return R_({count:s,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t})}return new ea({schema:{},propertyTables:[]})}function U6e(e,t){let n=e._parsedContent,i=new w6e;i.metallicFactor=0,i.roughnessFactor=.9;let o=new v6e;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=Ep.BLEND);let s=!l(n.normals);o.unlit=s;let a=new A6e;if(a.attributes=k6e(e,n,t),a.primitiveType=Me.POINTS,a.material=o,l(n.batchIds)){let _=new S6e;_.propertyTableId=0,_.setIndex=0,_.positionalLabel="featureId_0",a.featureIds.push(_)}let c=new C6e;c.index=0,c.primitives=[a];let u=new T6e;u.nodes=[c],u.upAxis=No.Z,u.forwardAxis=No.X;let f=new b6e;f.scene=u,f.nodes=[c];let h=[];f.structuralMetadata=V6e(n,h),h.length>0&&z6e(e,a,h,t),l(n.rtcCenter)&&(f.transform=F.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=F.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function z6e(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=yt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Fe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}k_.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var OB=k_;var H6e=new d,G6e=new d,W6e=new d,j6e=new F,q6e=new F,Y6e=new F,X6e=new fe,K6e=new ae;function Rw(e,t,n,i,o,r,s){if(!e._ready||n.mode===ne.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,u=c._runtimeNodes;for(let f=0;f<u.length;f++){let h=u[f],p=h.node,_=F.clone(h.computedTransform,j6e),m=F.clone(c.computedModelMatrix,q6e),x=p.instances;l(x)&&x.transformInWorldSpace&&(m=F.multiplyTransformation(e.modelMatrix,c.components.transform,m),_=F.multiplyTransformation(c.axisCorrectionMatrix,h.computedTransform,_));let b=F.multiplyTransformation(m,_,Y6e);n.mode!==ne.SCENE3D&&(b=Mt.basisTo2D(n.mapProjection,b,b));let T=[];if(l(x)){let A=x.attributes[0].count,S=x.attributes[0].componentDatatype,v=12,D=h.transformsTypedArray;if(!l(D)){let O=h.instancingTransformsBuffer;l(O)&&n.context.webgl2&&(D=X.createTypedArray(S,A*v),O.getBufferData(D))}if(l(D))for(let O=0;O<A;O++){let R=O*v,M=new F(D[R],D[R+1],D[R+2],D[R+3],D[R+4],D[R+5],D[R+6],D[R+7],D[R+8],D[R+9],D[R+10],D[R+11],0,0,0,1);x.transformInWorldSpace?(F.multiplyTransformation(M,_,M),F.multiplyTransformation(m,M,M)):F.multiplyTransformation(M,b,M),T.push(M)}}T.length===0&&T.push(b);let C=h.runtimePrimitives.length;for(let A=0;A<C;A++){let S=h.runtimePrimitives[A],v=S.primitive;if(l(S.boundingSphere)&&!l(x)){let Y=ae.transform(S.boundingSphere,b,K6e),J=Zn.raySphere(t,Y);if(!l(J))continue}let D=Kt.getAttributeBySemantic(v,Et.POSITION),O=D.byteOffset,R=D.byteStride,M=D.count;if(!l(v.indices))continue;let L=v.indices.typedArray;if(!l(L)){let Y=v.indices.buffer,J=v.indices.count,j=v.indices.indexDatatype;l(Y)&&n.context.webgl2&&(j===Ne.UNSIGNED_BYTE?L=new Uint8Array(J):j===Ne.UNSIGNED_SHORT?L=new Uint16Array(J):j===Ne.UNSIGNED_INT&&(L=new Uint32Array(J)),Y.getBufferData(L))}let g=D.typedArray,E=D.componentDatatype,w=D.type,I=D.quantization;l(I)&&(E=D.quantization.componentDatatype,w=D.quantization.type);let N=on.getNumberOfComponents(w),B=X.getSizeInBytes(E),H=!l(g)&&l(R)&&R!==N*B,V=N,G=0;H&&(V=R/B,G=O/B);let k=M*V;if(!l(g)){let Y=D.buffer;l(Y)&&n.context.webgl2&&(g=X.createTypedArray(E,k),Y.getBufferData(g,H?0:O,0,k)),I&&D.normalized&&(g=Ln.dequantize(g,E,w,M))}if(!l(L)||!l(g))return;r=y(r,ee.default),i=y(i,1),o=y(o,0);let W=L.length;for(let Y=0;Y<W;Y+=3){let J=L[Y],j=L[Y+1],K=L[Y+2];for(let Q of T){let de=xW(g,J,G,V,I,Q,i,o,r,H6e),ye=xW(g,j,G,V,I,Q,i,o,r,G6e),ce=xW(g,K,G,V,I,Q,i,o,r,W6e),ge=Zn.rayTriangleParametric(t,de,ye,ce,y(e.backFaceCulling,!0));l(ge)&&ge<a&&ge>=0&&(a=ge)}}}}if(a!==Number.MAX_VALUE){if(s=pn.getPoint(t,a,s),n.mode!==ne.SCENE3D){d.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,h=f.ellipsoid,p=f.unproject(s,X6e);h.cartographicToCartesian(p,s)}return s}}function xW(e,t,n,i,o,r,s,a,c,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],l(o))if(o.octEncoded){if(u=Ln.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let h=u.x;u.x=u.z,u.z=u.y,u.y=h}}else u=d.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=d.add(u,o.quantizedVolumeOffset,u);return u=F.multiplyByPoint(r,u,u),s!==1&&Dr.getPosition(u,c,s,a,u),u}function io(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,gr.GLTF),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new JF(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,Fc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,z.RED);this._silhouetteColor=z.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,we.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ae,this._initialRadius=void 0,this._heightReference=y(e.heightReference,Ye.NONE),this._heightDirty=this._heightReference!==Ye.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=y(e.enableVerticalExaggeration,!0),this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new vp(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?bs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?Zh.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=d.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new tC,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new S_(e.environmentMapOptions);S_.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,xn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===gr.GLTF&&xt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new At(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,Gr.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this._classificationType=e.classificationType,this._statistics=new PB,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._errorEvent=new me,this._readyEvent=new me,this._texturesReadyEvent=new me,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function bW(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Z6e(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new t2({model:e,propertyTable:s});n.push(a)}return n}function $6e(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=Kt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],u=Kt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function AW(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(io.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){AW(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=AW(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Bse(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===gr.GLTF&&xt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(bs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Zh.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=d.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(S_.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});io.prototype.getNode=function(e){return this._nodesByName[e]};io.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};io.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};io.prototype.getExtension=function(e){return this._loader.components.extensions[e]};io.prototype.makeStyleDirty=function(){this._styleDirty=!0};io.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var Q6e=new F,J6e=new $,e9e=new F;io.prototype.update=function(e){let t=!1;try{t=t9e(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")bW(this,n);else{let i=Kt.getError("model",this._resource,n);bW(this,i)}}if(n9e(this,e),i9e(this,e),o9e(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=Kt.getError("model",this._resource,new re("Failed to load model."));bW(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&Z6e(this,i);let o=new IB({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ne.MORPHING)){if(r9e(this),s9e(this),a9e(this,e),c9e(this),l9e(this,e),u9e(this,e),f9e(this,e),d9e(this,e),h9e(this,e),m9e(this,e),p9e(this,e),this._defaultTexture=e.context.defaultTexture,g9e(this,e),_9e(this,e),y9e(this),x9e(this,e),A9e(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),T9e(this),E9e(this,e),S9e(this),v9e(this,e)}};function t9e(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function n9e(e,t){l(e._customShader)&&e._customShader.update(t)}function i9e(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function o9e(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function r9e(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=$6e(t,e),e._styleDirty=!0,e.resetDrawCommands())}function s9e(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function a9e(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&Fse(e)}function Fse(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=em.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function c9e(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function l9e(e,t){e._silhouetteDirty&&(kse(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function u9e(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function f9e(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function d9e(e,t){let n=0;e.isClippingPolygonsEnabled()&&(e._clippingPolygons.owner===e&&(e._clippingPolygons.update(t),e._clippingPolygons.queueCommands(t)),n=e._clippingPolygons.clippingPolygonsState),n!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=n)}function h9e(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function m9e(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function p9e(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function g9e(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function _9e(e,t){F.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix))}var V_=new d,TW=new fe;function y9e(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===Ye.NONE){e._clampedModelMatrix=void 0;return}let n=y(t.ellipsoid,ee.default),i=e.modelMatrix;V_.x=i[12],V_.y=i[13],V_.z=i[14];let o=n.cartesianToCartographic(V_);l(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(i,new F)),e._removeUpdateHeightCallback=t.updateHeight(o,Nse(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=Nse(e,n,o);fe.clone(o,TW),TW.height=r,s(TW)}e._heightDirty=!1,e._updateModelMatrix=!0}function x9e(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Bse(e,n),b9e(e,n,t)}function Bse(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=d.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ae.transform(e._boundingSphere,t,e._boundingSphere)}function b9e(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);F.getTranslation(t,V_),e._sceneMode!==ne.SCENE3D&&zi.computeActualEllipsoidPosition(n,V_,V_);let s=e._boundingSphere.radius,a=w9e(V_,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function T9e(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}var C9e=new $(1,0,0,0,0,1,0,-1,0);function A9e(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),o=t.context,r=J6e,s=Q6e;if(s=F.multiply(o.uniformState.view3D,i,s),r=F.getRotation(s,r),r=$.transpose(r,r),e._iblReferenceFrameMatrix=$.multiply(C9e,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=e9e;a=F.multiply(o.uniformState.view3D,i,a),a=F.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=F.inverseTranspose(a,e._clippingPlanesMatrix)}}function E9e(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function S9e(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=At.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=At.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=At.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function v9e(e,t){let n=I9e(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(P9e(e,t),e._sceneGraph.pushDrawCommands(t))}var CW=new ae;function w9e(e,t,n){return CW.center=e,CW.radius=t,n.camera.getPixelSize(CW,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var MB=new d;function Nse(e,t,n){return function(i){DT(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,MB);let o=e._clampedModelMatrix;F.clone(e.modelMatrix,o),o[12]=MB.x,o[13]=MB.y,o[14]=MB.z,e._heightDirty=!0}}var D9e=new d;function I9e(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===ne.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=F.getTranslation(e.modelMatrix,D9e);zi.computeActualEllipsoidPosition(t,s,s),r=d.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function P9e(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}io.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};io.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function kse(e){return e.context.stencilBuffer}io.prototype.hasSilhouette=function(e){return kse(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};io.prototype.hasSkipLevelOfDetail=function(e){if(!gr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};io.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};io.prototype.pick=function(e,t,n,i,o){return Rw(this,e,t,n,i,o)};io.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};io.prototype.isDestroyed=function(){return!1};io.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,ue(this)};io.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};io.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};io.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),o=Se.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=Se.createIfNeeded(t);let r=new I_(n),a=l(e.content)?gr.TILE_GLTF:gr.GLTF,c=n.gltfResource,u=Ow(r,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(_){throw r.destroy(),Kt.getError("model",c,_)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let h=new io(u),p=h._resource.credits;if(l(p)){let _=p.length;for(let m=0;m<_;m++)h._resourceCredits.push(At.clone(p[m]))}return h};io.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new VF(t);try{await n.load();let i=Ow(n,gr.TILE_B3DM,e);return new io(i)}catch(i){throw n.destroy(),i}};io.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new OB(t);try{await n.load();let i=Ow(n,gr.TILE_PNTS,e);return new io(i)}catch(i){throw n.destroy(),i}};io.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new qF(t);try{await n.load();let i=Ow(n,gr.TILE_I3DM,e);return new io(i)}catch(i){throw n.destroy(),i}};io.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new zF(t),i=Ow(n,gr.TILE_GEOJSON,e);return new io(i)};var R9e=new z;io.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,R9e),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,AW(t,this._color)&&this.resetDrawCommands()};io.prototype.applyStyle=function(e){let t=this.type===gr.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Fse(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function Ow(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var tm=io;function Lr(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Lr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Lr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Lr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Lr.prototype.getExtension=function(e){return this._model.getExtension(e)};Lr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};Lr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};Lr.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};Lr.prototype.applyStyle=function(e){this._model.style=e};Lr.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;l(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),l(s)&&l(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:su.REPEAT}),this._ready=!0)};Lr.prototype.isDestroyed=function(){return!1};Lr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};Lr.fromGltf=async function(e,t,n,i){let o=new Lr(e,t,n),s=Mw(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await tm.fromGltfAsync(s);return o._model=c,o};Lr.fromB3dm=async function(e,t,n,i,o){let r=new Lr(e,t,n),a=Mw(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let u=await tm.fromB3dm(a);return r._model=u,r};Lr.fromI3dm=async function(e,t,n,i,o){let r=new Lr(e,t,n),a=Mw(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await tm.fromI3dm(a);return r._model=c,r};Lr.fromPnts=async function(e,t,n,i,o){let r=new Lr(e,t,n),a=Mw(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await tm.fromPnts(a);return r._model=c,r};Lr.fromGeoJson=async function(e,t,n,i){let o=new Lr(e,t,n),s=Mw(e,t,o,{geoJson:i,resource:n}),a=await tm.fromGeoJson(s);return o._model=a,o};Lr.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ee.WGS84,n)};function Mw(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:we.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return bt(i,o)}var gf=Lr;function _f(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(_f.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});_f.fromJson=function(e,t,n,i){let o=new _f(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};_f.prototype.hasProperty=function(e,t){return!1};_f.prototype.getFeature=function(e){};_f.prototype.applyDebugSettings=function(e,t){};_f.prototype.applyStyle=function(e){};_f.prototype.update=function(e,t){};_f.prototype.pick=function(e,t,n){};_f.prototype.isDestroyed=function(){return!1};_f.prototype.destroy=function(){return ue(this)};var LB=_f;function mi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=Lt.clone(r)),this._show=y(e.show,!0),this._position=d.clone(y(e.position,d.ZERO)),this._actualPosition=d.clone(this._position),this._pixelOffset=U.clone(y(e.pixelOffset,U.ZERO)),this._translate=new U(0,0),this._eyeOffset=d.clone(y(e.eyeOffset,d.ZERO)),this._heightReference=y(e.heightReference,Ye.NONE),this._verticalOrigin=y(e.verticalOrigin,On.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,yi.CENTER),this._scale=y(e.scale,1),this._color=z.clone(y(e.color,z.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=d.clone(y(e.alignedAxis,d.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=zn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ne.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping(),this._splitDirection=y(e.splitDirection,Gr.NONE)}var Vse=mi.SHOW_INDEX=0,FB=mi.POSITION_INDEX=1,Gse=mi.PIXEL_OFFSET_INDEX=2,O9e=mi.EYE_OFFSET_INDEX=3,M9e=mi.HORIZONTAL_ORIGIN_INDEX=4,L9e=mi.VERTICAL_ORIGIN_INDEX=5,N9e=mi.SCALE_INDEX=6,BB=mi.IMAGE_INDEX_INDEX=7,Use=mi.COLOR_INDEX=8,F9e=mi.ROTATION_INDEX=9,B9e=mi.ALIGNED_AXIS_INDEX=10,k9e=mi.SCALE_BY_DISTANCE_INDEX=11,V9e=mi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,U9e=mi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,z9e=mi.DISTANCE_DISPLAY_CONDITION=14,H9e=mi.DISABLE_DEPTH_DISTANCE=15;mi.TEXTURE_COORDINATE_BOUNDS=16;var zse=mi.SDF_INDEX=17,G9e=mi.SPLIT_DIRECTION_INDEX=18;mi.NUMBER_OF_PROPERTIES=19;function wo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(mi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,wo(this,Vse))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),this._updateClamping(),wo(this,FB))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),wo(this,FB))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),wo(this,Gse))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),wo(this,k9e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),wo(this,V9e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;kt.equals(t,e)||(this._pixelOffsetScaleByDistance=kt.clone(e,t),wo(this,U9e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;d.equals(t,e)||(d.clone(e,t),wo(this,O9e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,wo(this,M9e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,wo(this,L9e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,wo(this,N9e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),wo(this,Use))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,wo(this,F9e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;d.equals(t,e)||(d.clone(e,t),wo(this,B9e))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,wo(this,BB))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,wo(this,BB))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,wo(this,Use))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Lt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),wo(this,z9e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,wo(this,H9e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof Se?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(zn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,wo(this,BB))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition),wo(this,FB)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,wo(this,Vse))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),wo(this,zse))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,wo(this,zse))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,wo(this,G9e))}}});mi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};mi.prototype._updateClamping=function(){mi._updateClamping(this._billboardCollection,this)};var kB=new fe;mi._updateClamping=function(e,t){let n=e._scene;if(!l(n))return;let i=y(n.ellipsoid,ee.default),o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===Ye.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Ye.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(u){let f=i.cartographicToCartesian(u,t._clampedPosition);DT(t._heightReference)&&(t._mode===ne.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),fe.clone(s,kB);let c=n.getHeight(s,t._heightReference);l(c)&&(kB.height=c),a(kB)};mi.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(c){if(r._imageId!==t||r._image!==n||!qe.equals(r._imageSubRegion,i))return;let u=e.textureCoordinates[c];r._imageWidth=e.texture.width*u.width,r._imageHeight=e.texture.height*u.height,r._imageIndex=c,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,wo(r,BB);let f=r._billboardCollection._scene;l(f)&&f.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;let a=e.getImageIndex(t);if(l(a)&&!l(i)){s(a);return}o.then(s).catch(function(c){console.error(`Error loading image for billboard: ${c}`),r._imageIndexPromise=void 0})};mi.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};mi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&qe.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=qe.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};mi.prototype._setTranslate=function(e){let t=this._translate;U.equals(t,e)||(U.clone(e,t),wo(this,Gse))};mi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};mi.prototype._setActualPosition=function(e){l(this._clampedPosition)||d.clone(e,this._actualPosition),wo(this,FB)};var Hse=new oe;mi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ne.SCENE3D?t:(F.multiplyByPoint(i,t,Hse),zi.computeActualEllipsoidPosition(n,Hse))};var Wse=new d;mi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=F.multiplyByPoint(e,t,Wse),a=zi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return U.add(a,i,a),a};var NB=new U(0,0);mi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,NB),U.add(NB,this._translate,NB);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ne.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,kB);o=a.cartographicToCartesian(c,Wse),i=F.IDENTITY}return mi._computeScreenSpacePosition(i,o,this._eyeOffset,NB,e,t)};mi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===yi.RIGHT?s-=i:e.horizontalOrigin===yi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===On.BOTTOM||e.verticalOrigin===On.BASELINE?a-=o:e.verticalOrigin===On.CENTER&&(a-=o*.5),l(n)||(n=new qe),n.x=s,n.y=a,n.width=i,n.height=o,n};mi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&d.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&qe.equals(this._imageSubRegion,e._imageSubRegion)&&z.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&d.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};mi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var co=mi;var W9e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Do=Object.freeze(W9e);var j9e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},na=Object.freeze(j9e);function Lp(e,t,n,i,o){this.bottomLeft=y(e,U.ZERO),this.topRight=y(t,U.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var q9e=new U(16,16);function U_(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,q9e);this._context=e.context,this._pixelFormat=y(e.pixelFormat,tt.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=zn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(U_.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Ot({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function Y9e(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),u=o*(a+t.height+r),f=s/c,h=a/u,p=new Lp(new U(s+r,r),new U(c,a)),_=new Lp(new U,new U(c,a),e._root,p),m=new Lp(new U(r,a+r),new U(c,u)),x=new Lp(new U,new U(c,u),_,m);for(let C=0;C<e._textureCoordinates.length;C++){let A=e._textureCoordinates[C];l(A)&&(A.x*=f,A.y*=h,A.width*=f,A.height*=h)}let b=new Ot({context:e._context,width:c,height:u,pixelFormat:e._pixelFormat}),T=new zr({context:n,colorTextures:[e._texture],destroyAttachments:!1});T._bind(),b.copyFromFramebuffer(0,0,0,0,c,u),T._unBind(),T.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=b,e._root=x}else{let s=o*(t.width+2*r),a=o*(t.height+2*r);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Ot({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new Lp(new U(r,r),new U(s,a))}}function VB(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,r=i-n.width,s=o-n.height;if(r<0||s<0)return;if(r===0&&s===0)return t;if(r>s){t.childNode1=new Lp(new U(t.bottomLeft.x,t.bottomLeft.y),new U(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new Lp(new U(a,t.bottomLeft.y),new U(t.topRight.x,t.topRight.y)))}else{t.childNode1=new Lp(new U(t.bottomLeft.x,t.bottomLeft.y),new U(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new Lp(new U(t.bottomLeft.x,a),new U(t.topRight.x,t.topRight.y)))}return VB(e,t.childNode1,n)}return VB(e,t.childNode1,n)||VB(e,t.childNode2,n)}}function jse(e,t,n){let i=VB(e,e._root,t);if(l(i)){i.imageIndex=n;let o=e._texture.width,r=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/o,u=i.bottomLeft.y/r,f=s/o,h=a/r;e._textureCoordinates[n]=new qe(c,u,f,h),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else Y9e(e,t),jse(e,t,n);e._guid=zn()}function qse(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return jse(e,t,n),n}U_.prototype.getImageIndex=function(e){return this._indexHash[e]};U_.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=qse(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};U_.prototype.addImage=function(e,t){let n=this._idHash[e];if(l(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof Se)&&(t=Se.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(o){let r=qse(i,o);return i._indexHash[e]=r,r}),this._idHash[e]=n,n};U_.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new re(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;let r=i._texture.width,s=i._texture.height,a=i._textureCoordinates[o],c=a.x+t.x/r,u=a.y+t.y/s,f=t.width/r,h=t.height/s,p=i._textureCoordinates.push(new qe(c,u,f,h))-1;return i._indexHash[e]=p,i._guid=zn(),p})};U_.prototype.isDestroyed=function(){return!1};U_.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Sx=U_;var X9e=co.SHOW_INDEX,Nw=co.POSITION_INDEX,Yse=co.PIXEL_OFFSET_INDEX,Xse=co.EYE_OFFSET_INDEX,K9e=co.HORIZONTAL_ORIGIN_INDEX,Z9e=co.VERTICAL_ORIGIN_INDEX,$9e=co.SCALE_INDEX,Lw=co.IMAGE_INDEX_INDEX,Kse=co.COLOR_INDEX,Q9e=co.ROTATION_INDEX,J9e=co.ALIGNED_AXIS_INDEX,Zse=co.SCALE_BY_DISTANCE_INDEX,$se=co.TRANSLUCENCY_BY_DISTANCE_INDEX,Qse=co.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Jse=co.DISTANCE_DISPLAY_CONDITION,eWe=co.DISABLE_DEPTH_DISTANCE,tWe=co.TEXTURE_COORDINATE_BOUNDS,eae=co.SDF_INDEX,tae=co.SPLIT_DIRECTION_INDEX,PW=co.NUMBER_OF_PROPERTIES,oo,nWe={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},iWe={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function bf(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(PW),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,Do.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(bf.prototype,{length:{get:function(){return RW(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function nae(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}bf.prototype.add=function(e){let t=new co(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};bf.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};bf.prototype.removeAll=function(){nae(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function RW(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}bf.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};bf.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};bf.prototype.get=function(e){return RW(this),this._billboards[e]};var EW;function oWe(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=yt.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function rWe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=yt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function sWe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=yt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}bf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<PW;++i){let o=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function aWe(e,t,n,i,o,r){let s=[{index:oo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Nw]},{index:oo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Nw]},{index:oo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Yse]},{index:oo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[$se]},{index:oo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Kse]},{index:oo.eyeOffset,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Xse]},{index:oo.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Zse]},{index:oo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Qse]},{index:oo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Jse]},{index:oo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[tWe]},{index:oo.splitDirection,componentsPerAttribute:1,componentDatatype:X.FLOAT,usage:n[tae]}];i&&s.push({index:oo.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:sWe(e)}),l(o)&&s.push({index:oo.a_batchId,componentsPerAttribute:1,componentDatatype:X.FLOAT,bufferUsage:Fe.STATIC_DRAW}),r&&s.push({index:oo.sdf,componentsPerAttribute:2,componentDatatype:X.FLOAT,usage:n[eae]});let a=i?t:4*t;return new Gg(e,s,a,i)}var SW=new Hn;function iae(e,t,n,i,o){let r,s=i[oo.positionHighAndScale],a=i[oo.positionLowAndRotation],c=o._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Hn.fromCartesian(c,SW);let u=o.scale,f=o.rotation;f!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);let h=SW.high,p=SW.low;e._instanced?(r=o._index,s(r,h.x,h.y,h.z,u),a(r,p.x,p.y,p.z,f)):(r=o._index*4,s(r+0,h.x,h.y,h.z,u),s(r+1,h.x,h.y,h.z,u),s(r+2,h.x,h.y,h.z,u),s(r+3,h.x,h.y,h.z,u),a(r+0,p.x,p.y,p.z,f),a(r+1,p.x,p.y,p.z,f),a(r+2,p.x,p.y,p.z,f),a(r+3,p.x,p.y,p.z,f))}var xf=new U,yf=32768,zC=65536,vW=4096,nm=256,cWe=128,lWe=32,uWe=8,oae=4,fWe=1/256,rae=0,sae=2,aae=3,cae=1;function lae(e,t,n,i,o){let r,s=i[oo.compressedAttribute0],a=o.pixelOffset,c=a.x,u=a.y,f=o._translate,h=f.x,p=f.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+h),Math.abs(-u+p));let _=o.horizontalOrigin,m=o._verticalOrigin,x=o.show&&o.clusterShow;o.color.alpha===0&&(x=!1),m===On.BASELINE&&(m=On.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&_===yi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&m===On.CENTER;let b=0,T=0,C=0,A=0,S=o._imageIndex;if(S!==-1){let H=n[S];b=H.x,T=H.y,C=H.width,A=H.height}let v=b+C,D=T+A,O=Math.floor(P.clamp(c,-yf,yf)+yf)*cWe;O+=(_+1)*lWe,O+=(m+1)*uWe,O+=(x?1:0)*oae;let R=Math.floor(P.clamp(u,-yf,yf)+yf)*nm,M=Math.floor(P.clamp(h,-yf,yf)+yf)*nm,L=(P.clamp(p,-yf,yf)+yf)*fWe,g=Math.floor(L),E=Math.floor((L-g)*nm);R+=g,M+=E,xf.x=b,xf.y=T;let w=Ln.compressTextureCoordinates(xf);xf.x=v;let I=Ln.compressTextureCoordinates(xf);xf.y=D;let N=Ln.compressTextureCoordinates(xf);xf.x=b;let B=Ln.compressTextureCoordinates(xf);e._instanced?(r=o._index,s(r,O,R,M,w)):(r=o._index*4,s(r+0,O+rae,R,M,w),s(r+1,O+sae,R,M,I),s(r+2,O+aae,R,M,N),s(r+3,O+cae,R,M,B))}function uae(e,t,n,i,o){let r,s=i[oo.compressedAttribute1],a=o.alignedAxis;d.equals(a,d.ZERO)||(e._shaderAlignedAxis=!0);let c=0,u=1,f=1,h=1,p=o.translucencyByDistance;l(p)&&(c=p.near,u=p.nearValue,f=p.far,h=p.farValue,(u!==1||h!==1)&&(e._shaderTranslucencyByDistance=!0));let _=0,m=o._imageIndex;m!==-1&&(_=n[m].width);let x=e._textureAtlas.texture.width,b=Math.round(y(o.width,x*_));e._maxSize=Math.max(e._maxSize,b);let T=P.clamp(b,0,zC),C=0;Math.abs(d.magnitudeSquared(a)-1)<P.EPSILON6&&(C=Ln.octEncodeFloat(a)),u=P.clamp(u,0,1),u=u===1?255:u*255|0,T=T*nm+u,h=P.clamp(h,0,1),h=h===1?255:h*255|0,C=C*nm+h,e._instanced?(r=o._index,s(r,T,C,c,f)):(r=o._index*4,s(r+0,T,C,c,f),s(r+1,T,C,c,f),s(r+2,T,C,c,f),s(r+3,T,C,c,f))}function DW(e,t,n,i,o){let r,s=i[oo.compressedAttribute2],a=o.color,c=l(e._batchTable)?z.WHITE:o.getPickId(t.context).color,u=o.sizeInMeters?1:0,f=Math.abs(d.magnitudeSquared(o.alignedAxis)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&u===1;let h=0,p=o._imageIndex;p!==-1&&(h=n[p].height);let _=e._textureAtlas.texture.dimensions,m=Math.round(y(o.height,_.y*h));e._maxSize=Math.max(e._maxSize,m);let x=y(o._labelHorizontalOrigin,-2);x+=2;let b=m*oae+x,T=z.floatToByte(a.red),C=z.floatToByte(a.green),A=z.floatToByte(a.blue),S=T*zC+C*nm+A;T=z.floatToByte(c.red),C=z.floatToByte(c.green),A=z.floatToByte(c.blue);let v=T*zC+C*nm+A,D=z.floatToByte(a.alpha)*zC+z.floatToByte(c.alpha)*nm;D+=u*2+f,e._instanced?(r=o._index,s(r,S,v,D,b)):(r=o._index*4,s(r+0,S,v,D,b),s(r+1,S,v,D,b),s(r+2,S,v,D,b),s(r+3,S,v,D,b))}function IW(e,t,n,i,o){let r,s=i[oo.eyeOffset],a=o.eyeOffset,c=a.z;if(o._heightReference!==Ye.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let u=0,f=0,h=o._imageIndex;if(h!==-1){let _=n[h];u=_.width,f=_.height}xf.x=u,xf.y=f;let p=Ln.compressTextureCoordinates(xf);r=o._index,s(r,a.x,a.y,c,p)}else r=o._index*4,s(r+0,a.x,a.y,c,0),s(r+1,a.x,a.y,c,0),s(r+2,a.x,a.y,c,0),s(r+3,a.x,a.y,c,0)}function fae(e,t,n,i,o){let r,s=i[oo.scaleByDistance],a=0,c=1,u=1,f=1,h=o.scaleByDistance;l(h)&&(a=h.near,c=h.nearValue,u=h.far,f=h.farValue,(c!==1||f!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,u,f)):(r=o._index*4,s(r+0,a,c,u,f),s(r+1,a,c,u,f),s(r+2,a,c,u,f),s(r+3,a,c,u,f))}function dae(e,t,n,i,o){let r,s=i[oo.pixelOffsetScaleByDistance],a=0,c=1,u=1,f=1,h=o.pixelOffsetScaleByDistance;l(h)&&(a=h.near,c=h.nearValue,u=h.far,f=h.farValue,(c!==1||f!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,u,f)):(r=o._index*4,s(r+0,a,c,u,f),s(r+1,a,c,u,f),s(r+2,a,c,u,f),s(r+3,a,c,u,f))}function hae(e,t,n,i,o){let r,s=i[oo.compressedAttribute3],a=0,c=Number.MAX_VALUE,u=o.distanceDisplayCondition;l(u)&&(a=u.near,c=u.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let f=o.disableDepthTestDistance,h=tf(o.heightReference)&&t.context.depthTexture;l(f)||(f=h?5e3:0),f*=f,(h||f>0)&&(e._shaderDisableDepthDistance=!0,f===Number.POSITIVE_INFINITY&&(f=-1));let p,_;if(l(o._labelDimensions))_=o._labelDimensions.x,p=o._labelDimensions.y;else{let T=0,C=0,A=o._imageIndex;if(A!==-1){let v=n[A];T=v.height,C=v.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*T));let S=e._textureAtlas.texture.width;_=Math.round(y(o.width,S*C))}let m=Math.floor(P.clamp(_,0,vW)),x=Math.floor(P.clamp(p,0,vW)),b=m*vW+x;e._instanced?(r=o._index,s(r,a,c,f,b)):(r=o._index*4,s(r+0,a,c,f,b),s(r+1,a,c,f,b),s(r+2,a,c,f,b),s(r+3,a,c,f,b))}function mae(e,t,n,i,o){if(tf(o.heightReference)){let m=e._scene,x=t.context,b=t.globeTranslucencyState.translucent,T=l(m.globe)&&m.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!b&&T}let r,s=i[oo.textureCoordinateBoundsOrLabelTranslate];if(Bt.maximumVertexTextureImageUnits>0){let m=0,x=0;l(o._labelTranslate)&&(m=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,m,x,0,0)):(r=o._index*4,s(r+0,m,x,0,0),s(r+1,m,x,0,0),s(r+2,m,x,0,0),s(r+3,m,x,0,0));return}let a=0,c=0,u=0,f=0,h=o._imageIndex;if(h!==-1){let m=n[h];a=m.x,c=m.y,u=m.width,f=m.height}let p=a+u,_=c+f;e._instanced?(r=o._index,s(r,a,c,p,_)):(r=o._index*4,s(r+0,a,c,p,_),s(r+1,a,c,p,_),s(r+2,a,c,p,_),s(r+3,a,c,p,_))}function dWe(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[oo.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function pae(e,t,n,i,o){if(!e._sdf)return;let r,s=i[oo.sdf],a=o.outlineColor,c=o.outlineWidth,u=z.floatToByte(a.red),f=z.floatToByte(a.green),h=z.floatToByte(a.blue),p=u*zC+f*nm+h,_=c/na.RADIUS,m=z.floatToByte(a.alpha)*zC+z.floatToByte(_)*nm;e._instanced?(r=o._index,s(r,p,m)):(r=o._index*4,s(r+0,p+rae,m),s(r+1,p+sae,m),s(r+2,p+aae,m),s(r+3,p+cae,m))}function gae(e,t,n,i,o){let r=i[oo.splitDirection],s=0,a=o.splitDirection;l(a)&&(s=a);let c;e._instanced?(c=o._index,r(c,s)):(c=o._index*4,r(c+0,s),r(c+1,s),r(c+2,s),r(c+3,s))}function hWe(e,t,n,i,o){iae(e,t,n,i,o),lae(e,t,n,i,o),uae(e,t,n,i,o),DW(e,t,n,i,o),IW(e,t,n,i,o),fae(e,t,n,i,o),dae(e,t,n,i,o),hae(e,t,n,i,o),mae(e,t,n,i,o),dWe(e,t,n,i,o),pae(e,t,n,i,o),gae(e,t,n,i,o)}function wW(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,h=co._computeActualPosition(u,f,i,o);l(h)&&(u._setActualPosition(h),r?a.push(h):ae.expand(s,h,s))}r&&ae.fromPoints(a,s)}function mWe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&wW(e,i,i.length,t,r,!0)):n===ne.MORPHING?wW(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&wW(e,o,e._billboardsToUpdateIndex,t,r,!1)}function pWe(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function gWe(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; -in vec2 v_textureCoordinates; -void main() -{ - out_FragColor = texture(billboard_texture, v_textureCoordinates); -} -`,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=we.OVERLAY,i}var _We=[];bf.prototype.update=function(e){if(RW(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,oo=this._instanced?iWe:nWe,EW=this._instanced?rWe:oWe;let o=this._textureAtlas;if(!l(o)){o=this._textureAtlas=new Sx({context:i});for(let R=0;R<n;++R)t[R]._loadImage()}let r=o.textureCoordinates;if(r.length===0)return;mWe(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let h,p=e.passes,_=p.pick;if(f||!_&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R<PW;++R)c[R]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=aWe(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let R=0;R<n;++R){let M=this._billboards[R];M._dirty=!1,hWe(this,e,r,h,M)}this._vaf.commit(EW(i))}this._billboardsToUpdateIndex=0}else if(a>0){let R=_We;R.length=0,(c[Nw]||c[Q9e]||c[$9e])&&R.push(iae),(c[Lw]||c[Yse]||c[K9e]||c[Z9e]||c[X9e])&&(R.push(lae),this._instanced&&R.push(IW)),(c[Lw]||c[J9e]||c[$se])&&(R.push(uae),R.push(DW)),(c[Lw]||c[Kse])&&R.push(DW),c[Xse]&&R.push(IW),c[Zse]&&R.push(fae),c[Qse]&&R.push(dae),(c[Jse]||c[eWe]||c[Lw]||c[Nw])&&R.push(hae),(c[Lw]||c[Nw])&&R.push(mae),c[eae]&&R.push(pae),c[tae]&&R.push(gae);let M=R.length;if(h=this._vaf.writers,a/n>.1){for(let L=0;L<a;++L){let g=s[L];g._dirty=!1;for(let E=0;E<M;++E)R[E](this,e,r,h,g)}this._vaf.commit(EW(i))}else{for(let L=0;L<a;++L){let g=s[L];g._dirty=!1;for(let E=0;E<M;++E)R[E](this,e,r,h,g);this._instanced?this._vaf.subCommit(g._index,1):this._vaf.subCommit(g._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,x=F.IDENTITY;e.mode===ne.SCENE3D?(x=this.modelMatrix,m=ae.clone(this._baseVolumeWC,this._boundingVolume)):m=ae.clone(this._baseVolume2D,this._boundingVolume),pWe(this,e,m);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===Do.OPAQUE||this._blendOption===Do.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===Do.TRANSLUCENT;this._blendOption===Do.TRANSLUCENT||this._blendOption===Do.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:R?te.LEQUAL:te.LESS},depthMask:R,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let T,C,A,S,v,D=Bt.maximumVertexTextureImageUnits>0;if(b||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){T=WM,C=GM,v=[],l(this._batchTable)&&(v.push("VECTOR_TILE"),T=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(T),C=this._batchTable.getFragmentShaderCallback(!1,void 0)(C)),A=new Ue({defines:v,sources:[T]}),this._instanced&&A.defines.push("INSTANCED"),this._shaderRotation&&A.defines.push("ROTATION"),this._shaderAlignedAxis&&A.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&A.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&A.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&A.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&A.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&A.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(D?A.defines.push("VERTEX_DEPTH_CHECK"):A.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-na.CUTOFF;this._sdf&&A.defines.push("SDF");let M=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Do.OPAQUE_AND_TRANSLUCENT&&(S=new Ue({defines:["OPAQUE",M],sources:[C]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=en.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:oo}),S=new Ue({defines:["TRANSLUCENT",M],sources:[C]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=en.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:oo})),this._blendOption===Do.OPAQUE&&(S=new Ue({defines:[M],sources:[C]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=en.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:oo})),this._blendOption===Do.TRANSLUCENT&&(S=new Ue({defines:[M],sources:[C]}),this._shaderClampToGround&&(D?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=en.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:A,fragmentShaderSource:S,attributeLocations:oo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let O=e.commandList;if(p.render||p.pick){let R=this._colorCommands,M=this._blendOption===Do.OPAQUE,L=this._blendOption===Do.OPAQUE_AND_TRANSLUCENT,g=this._vaf.va,E=g.length,w=this._uniforms,I;l(this._batchTable)?(w=this._batchTable.getUniformMapCallback()(w),I=this._batchTable.getPickId()):I="v_pickColor",R.length=E;let N=L?E*2:E;for(let B=0;B<N;++B){let H=R[B];l(H)||(H=R[B]=new $e);let V=M||L&&B%2===0;H.pass=V||!L?we.OPAQUE:we.TRANSLUCENT,H.owner=this;let G=L?Math.floor(B/2):B;H.boundingVolume=m,H.modelMatrix=x,H.count=g[G].indicesCount,H.shaderProgram=V?this._sp:this._spTranslucent,H.uniformMap=w,H.vertexArray=g[G].va,H.renderState=V?this._rsOpaque:this._rsTranslucent,H.debugShowBoundingVolume=this.debugShowBoundingVolume,H.pickId=I,this._instanced&&(H.count=6,H.instanceCount=n),O.push(H)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=gWe(this,e.context)),O.push(this.debugCommand))}};bf.prototype.isDestroyed=function(){return!1};bf.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),nae(this._billboards),ue(this)};var Tf=bf;function yWe(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var HC=yWe;function ia(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),GC(this)}var xWe=new fe;Object.defineProperties(ia.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=z.clone(e,this._color),GC(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,GC(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=z.clone(e,this._pointOutlineColor),GC(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,GC(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,xWe);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=z.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&GC(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ia.defaultColor=z.WHITE;ia.defaultPointOutlineColor=z.BLACK;ia.defaultPointOutlineWidth=0;ia.defaultPointSize=8;function GC(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,ia.defaultColor),i=y(e._pointOutlineColor,ia.defaultPointOutlineColor),o=y(e._pointOutlineWidth,ia.defaultPointOutlineWidth),r=y(e._pointSize,ia.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&o===c&&r===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),_=JSON.stringify([h,r,p,o]);t.setImage(_,HC(f,h,p,o,r))}ia.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ia.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ia.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ia.prototype.getPropertyInherited=function(e){return $s.getPropertyInherited(this._content,this._batchId,e)};ia.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ia.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ia.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ia.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var z_=ia;function bWe(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),u=100,f=r.width+u|0,h=3*a,p=h/2;c.width=f,c.height=h;let _=c.getContext("2d");_.font=n,_.fillStyle="white",_.fillRect(0,0,c.width+1,c.height+1),i&&(_.strokeStyle="black",_.lineWidth=e.lineWidth,_.strokeText(t,u/2,p)),o&&(_.fillStyle="black",_.fillText(t,u/2,p));let m=_.getImageData(0,0,f,h).data,x=m.length,b=f*4,T,C,A,S;for(T=0;T<x;++T)if(m[T]!==255){A=T/b|0;break}for(T=x-1;T>=0;--T)if(m[T]!==255){S=T/b|0;break}let v=-1;for(T=0;T<f&&v===-1;++T)for(C=0;C<h;++C){let D=T*4+C*b;if(m[D]!==255||m[D+1]!==255||m[D+2]!==255||m[D+3]!==255){v=T;break}}return{width:r.width,height:S-A,ascent:p-A,descent:S-p,minx:v-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var vx;function TWe(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),o=y(t.fill,!0),r=y(t.strokeWidth,1),s=y(t.backgroundColor,z.TRANSPARENT),a=y(t.padding,0),c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(vx)||(l(f.imageSmoothingEnabled)?vx="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?vx="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?vx="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(vx="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[vx]=!1,u.style.visibility="hidden",document.body.appendChild(u);let h=bWe(f,e,n,i,o);u.dimensions=h,document.body.removeChild(u),u.style.visibility="";let p=-h.minx,_=Math.ceil(h.width)+p+c,m=h.height+c,x=m-h.ascent+a,b=m-x+c;if(u.width=_,u.height=m,f.font=n,f.lineJoin="round",f.lineWidth=r,f[vx]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=y(t.strokeColor,z.BLACK);f.strokeStyle=T.toCssColorString(),f.strokeText(e,p+a,b)}if(o){let T=y(t.fillColor,z.WHITE);f.fillStyle=T.toCssColorString(),f.fillText(e,p+a,b)}return u}var WC=TWe;var wae=Ur(bae(),1);var AWe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Xo=Object.freeze(AWe);var Tae={},Cae=0,EWe=256,SWe=new z(.165,.165,.165,.8),vWe=new U(7,5),ss=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function wx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Bw(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function kw(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Eae(e){let t=Tae[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(kw(n,"line-height"));isNaN(i)&&(i=void 0),t={family:kw(n,"font-family"),size:kw(n,"font-size").replace("px",""),style:kw(n,"font-style"),weight:kw(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Cae<EWe&&(Tae[e._font]=t,Cae++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Sd(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=Lt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=z.clone(y(e.fillColor,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=z.clone(y(e.backgroundColor,SWe)),this._backgroundPadding=U.clone(y(e.backgroundPadding,vWe)),this._style=y(e.style,Xo.FILL),this._verticalOrigin=y(e.verticalOrigin,On.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,yi.LEFT),this._pixelOffset=U.clone(y(e.pixelOffset,U.ZERO)),this._eyeOffset=d.clone(y(e.eyeOffset,d.ZERO)),this._position=d.clone(y(e.position,d.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=y(e.heightReference,Ye.NONE),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,Eae(this),this._updateClamping()}Object.defineProperties(Sd.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!d.equals(t,e)){d.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),Bw(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Sd.filterUnsupportedCharacters(e);this._renderedText=Sd.enableRightToLeftDetection?OWe(t):t,wx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,wx(this),Eae(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),wx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),wx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,wx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,wx(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;U.equals(t,e)||(U.clone(e,t),Bw(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,wx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!kt.equals(t,e)){this._translucencyByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!kt.equals(t,e)){this._pixelOffsetScaleByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!kt.equals(t,e)){this._scaleByDistance=kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!d.equals(t,e)){d.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Bw(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),Bw(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),Bw(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Lt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});Sd.prototype._updateClamping=function(){co._updateClamping(this._labelCollection,this)};Sd.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return co._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};Sd.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===On.BOTTOM||e.verticalOrigin===On.BASELINE?o-=s:e.verticalOrigin===On.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,h=e._glyphs,p=h.length;for(let _=0;_<p;++_){let m=h[_],x=m.billboard;if(!l(x))continue;let b=t.x+x._translate.x,T=t.y-x._translate.y,C=m.dimensions.width*a,A=m.dimensions.height*a;e.verticalOrigin===On.BOTTOM||e.verticalOrigin===On.BASELINE?T-=A:e.verticalOrigin===On.CENTER&&(T-=A*.5),e._verticalOrigin===On.TOP?T+=na.PADDING*a:(e._verticalOrigin===On.BOTTOM||e._verticalOrigin===On.BASELINE)&&(T-=na.PADDING*a),i=Math.min(i,b),o=Math.min(o,T),u=Math.max(u,b+C),f=Math.max(f,T+A)}r=u-i,s=f-o}return l(n)||(n=new qe),n.x=i,n.y=o,n.width=r,n.height=s,n};Sd.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Sd.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&d.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&d.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Sd.prototype.isDestroyed=function(){return!1};Sd.enableRightToLeftDetection=!1;function wWe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ss.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=ss.RTL:n.test(f)?a=ss.LTR:i.test(f)?a=ss.BRACKETS:a=ss.WEAK,u===0&&(s=a),s===a&&a!==ss.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function DWe(e){return e.split("").reverse().join("")}function Vw(e,t,n){return e.slice(0,t)+n+e.slice(t)}function IWe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var PWe="\u05D0-\u05EA",RWe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Aae=new RegExp(`[${PWe}${RWe}]`);function OWe(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Aae.test(o.charAt(0)),s=wWe(o,Aae),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],h=f.Type===ss.BRACKETS?IWe(f.Word):DWe(f.Word);r?f.Type===ss.RTL?(c=h+c,a=0):f.Type===ss.LTR?(c=Vw(c,a,f.Word),a+=f.Word.length):(f.Type===ss.WEAK||f.Type===ss.BRACKETS)&&(f.Type===ss.WEAK&&s[u-1].Type===ss.BRACKETS?c=h+c:s[u-1].Type===ss.RTL?(c=h+c,a=0):s.length>u+1?s[u+1].Type===ss.RTL?(c=h+c,a=0):(c=Vw(c,a,f.Word),a+=f.Word.length):c=Vw(c,0,h)):f.Type===ss.RTL?c=Vw(c,a,h):f.Type===ss.LTR?(c+=f.Word,a=c.length):(f.Type===ss.WEAK||f.Type===ss.BRACKETS)&&(u>0&&s[u-1].Type===ss.RTL?s.length>u+1?s[u+1].Type===ss.RTL?c=Vw(c,a,h):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` -`)}return n}var Dx=Sd;var Dae=Ur(Sae(),1);function LWe(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function NWe(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var FWe=1.2,Iae="ID_WHITE_PIXEL",OW=new U(4,4),BWe=new qe(1,1,1,1);function kWe(e){let t=document.createElement("canvas");t.width=OW.x,t.height=OW.y;let n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Iae,t)}var Cf={};function VWe(e,t,n,i,o,r,s){return Cf.font=t,Cf.fillColor=n,Cf.strokeColor=i,Cf.strokeWidth=o,Cf.padding=na.PADDING,s===On.CENTER?Cf.textBaseline="middle":s===On.TOP?Cf.textBaseline="top":Cf.textBaseline="bottom",Cf.fill=r===Xo.FILL||r===Xo.FILL_AND_OUTLINE,Cf.stroke=r===Xo.OUTLINE||r===Xo.FILL_AND_OUTLINE,Cf.backgroundColor=z.BLACK,WC(e,Cf)}function MW(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function UWe(e,t,n,i){i.index=e.addImageSync(t,n)}var zWe=new Dae.default;function HWe(e,t){let n=t._renderedText,i=zWe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length,a,c,u;if(t._relativeSize=t._fontSize/na.FONT_SIZE,o<s)for(c=o;c<s;++c)MW(e,r[c]);r.length=o;let f=t.show&&t._showBackground&&n.split(` -`).join("").length>0,h=t._backgroundBillboard,p=e._backgroundBillboardCollection;f?(l(h)||(h=p.add({collection:e,image:Iae,imageSubRegion:BWe}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=yi.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t.totalScale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition,h.disableDepthTestDistance=t._disableDepthTestDistance,h.clusterShow=t.clusterShow):l(h)&&(p.remove(h),t._backgroundBillboard=h=void 0);let _=e._glyphTextureCache;for(u=0;u<o;++u){let m=i[u],x=t._verticalOrigin,b=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+x]),T=_[b];if(!l(T)){let C=`${t._fontStyle} ${t._fontWeight} ${na.FONT_SIZE}px ${t._fontFamily}`,A=VWe(m,C,z.WHITE,z.WHITE,0,Xo.FILL,x);if(T=new NWe(e,-1,A.dimensions),_[b]=T,A.width>0&&A.height>0){let S=(0,wae.default)(A,{cutoff:na.CUTOFF,radius:na.RADIUS}),v=A.getContext("2d"),D=A.width,O=A.height,R=v.getImageData(0,0,D,O);for(let M=0;M<D;M++)for(let L=0;L<O;L++){let g=L*D+M,E=S[g]*255,w=g*4;R.data[w+0]=E,R.data[w+1]=E,R.data[w+2]=E,R.data[w+3]=E}v.putImageData(R,0,0),m!==" "&&UWe(e._textureAtlas,b,A,T)}}if(a=r[u],l(a)?T.index===-1?MW(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new LWe,r[u]=a),a.textureInfo=T,a.dimensions=T.dimensions,T.index!==-1){let C=a.billboard,A=e._spareBillboards;l(C)||(A.length>0?C=A.pop():(C=e._billboardCollection.add({collection:e}),C._labelDimensions=new U,C._labelTranslate=new U),a.billboard=C),C.show=t._show,C.position=t._position,C.eyeOffset=t._eyeOffset,C.pixelOffset=t._pixelOffset,C.horizontalOrigin=yi.LEFT,C.verticalOrigin=t._verticalOrigin,C.heightReference=t._heightReference,C.scale=t.totalScale,C.pickPrimitive=t,C.id=t._id,C.image=b,C.translucencyByDistance=t._translucencyByDistance,C.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,C.scaleByDistance=t._scaleByDistance,C.distanceDisplayCondition=t._distanceDisplayCondition,C.disableDepthTestDistance=t._disableDepthTestDistance,C._batchIndex=t._batchIndex,C.outlineColor=t.outlineColor,t.style===Xo.FILL_AND_OUTLINE?(C.color=t._fillColor,C.outlineWidth=t.outlineWidth):t.style===Xo.FILL?(C.color=t._fillColor,C.outlineWidth=0):t.style===Xo.OUTLINE&&(C.color=z.TRANSPARENT,C.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function vae(e,t,n){return t===yi.CENTER?-e/2:t===yi.RIGHT?-(e+n.x):n.x}var rr=new U,GWe=new U;function WWe(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,u=0,f=1,h,p=t.length,_=e._backgroundBillboard,m=U.clone(l(_)?e._backgroundPadding:U.ZERO,GWe);for(m.x/=e._relativeSize,m.y/=e._relativeSize,h=0;h<p;++h)n.charAt(h)===` -`?(a.push(r),++f,r=0):(i=t[h],o=i.dimensions,u=Math.max(u,o.height-o.descent),c=Math.max(c,o.descent),r+=o.width-o.minx,h<p-1&&(r+=t[h+1].dimensions.minx),s=Math.max(s,r));a.push(r);let x=u+c,b=e.totalScale,T=e._horizontalOrigin,C=e._verticalOrigin,A=0,S=a[A],v=vae(S,T,m),D=(l(e._lineHeight)?e._lineHeight:FWe*e._fontSize)/e._relativeSize,O=D*(f-1),R=s,M=x+O;l(_)&&(R+=m.x*2,M+=m.y*2,_._labelHorizontalOrigin=T),rr.x=v*b,rr.y=0;let L=!0,g=0;for(h=0;h<p;++h)if(n.charAt(h)===` -`)++A,g+=D,S=a[A],v=vae(S,T,m),rr.x=v*b,L=!0;else if(i=t[h],o=i.dimensions,C===On.TOP?(rr.y=o.height-u-m.y,rr.y+=na.PADDING):C===On.CENTER?rr.y=(O+o.height-u)/2:C===On.BASELINE?(rr.y=O,rr.y-=na.PADDING):(rr.y=O+c+m.y,rr.y-=na.PADDING),rr.y=(rr.y-o.descent-g)*b,L&&(rr.x-=na.PADDING*b,L=!1),l(i.billboard)&&(i.billboard._setTranslate(rr),i.billboard._labelDimensions.x=R,i.billboard._labelDimensions.y=M,i.billboard._labelHorizontalOrigin=T),h<p-1){let E=t[h+1];rr.x+=(o.width-o.minx+E.dimensions.minx)*b}if(l(_)&&n.split(` -`).join("").length>0&&(T===yi.CENTER?v=-s/2-m.x:T===yi.RIGHT?v=-(s+m.x*2):v=0,rr.x=v*b,C===On.TOP?rr.y=x-u-c:C===On.CENTER?rr.y=(x-u)/2-c:C===On.BASELINE?rr.y=-m.y-c:rr.y=0,rr.y=rr.y*b,_.width=R,_.height=M,_._setTranslate(rr),_._labelTranslate=U.clone(rr,_._labelTranslate)),tf(e.heightReference))for(h=0;h<p;++h){i=t[h];let E=i.billboard;l(E)&&(E._labelTranslate=U.clone(rr,E._labelTranslate))}}function Pae(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)MW(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function im(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new Tf({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new Tf({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Do.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(im.prototype,{length:{get:function(){return this._labels.length}}});im.prototype.add=function(e){let t=new Dx(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};im.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Pae(this,e),!0}return!1};im.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Pae(this,e[t]);e.length=0};im.prototype.contains=function(e){return l(e)&&e._labelCollection===this};im.prototype.get=function(e){return this._labels[e]};im.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;l(this._textureAtlas)||(this._textureAtlas=new Sx({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new Sx({context:i,initialSize:OW}),n.textureAtlas=this._backgroundTextureAtlas,kWe(this._backgroundTextureAtlas));let o=this._labelsToUpdate.length;for(let s=0;s<o;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(HWe(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(WWe(a),a._repositionAllGlyphs=!1);let u=a._glyphs.length-c;this._totalGlyphCount+=u}let r=n.length>0?Do.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};im.prototype.isDestroyed=function(){return!1};im.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),ue(this)};var Np=im;var Uc={};Uc.numberOfPoints=function(e,t,n){let i=d.distance(e,t);return Math.ceil(i/n)};Uc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var jWe=new fe;Uc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,jWe).height}return i};var qWe=new F,YWe=new d,Rae=new d,XWe=new an(d.UNIT_X,0),Oae=new d,KWe=new an(d.UNIT_X,0),ZWe=new d,$We=new d,NW=[];function Lae(e,t,n){let i=NW;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var HB=new fe,zB=new fe,H_=new d,FW=new d,QWe=new d,LW=new Xg,Uw=new Ya;function JWe(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,FW),u=i.scaleToGeodeticSurface(t,QWe),f=Uc.numberOfPoints(e,t,n),h=i.cartesianToCartographic(c,HB),p=i.cartesianToCartographic(u,zB),_=Lae(f,o,r);LW.setEndPoints(h,p);let m=LW.surfaceDistance/f,x=a;h.height=o;let b=i.cartographicToCartesian(h,H_);d.pack(b,s,x),x+=3;for(let T=1;T<f;T++){let C=LW.interpolateUsingSurfaceDistance(T*m,zB);C.height=_[T],b=i.cartographicToCartesian(C,H_),d.pack(b,s,x),x+=3}return x}function eje(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,HB),u=i.cartesianToCartographic(t,zB),f=Uc.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let h=Lae(f,o,r);Uw.ellipsoid.equals(i)||(Uw=new Ya(void 0,void 0,i)),Uw.setEndPoints(c,u);let p=Uw.surfaceDistance/f,_=a;c.height=o;let m=i.cartographicToCartesian(c,H_);d.pack(m,s,_),_+=3;for(let x=1;x<f;x++){let b=Uw.interpolateUsingSurfaceDistance(x*p,zB);b.height=h[x],m=i.cartographicToCartesian(b,H_),d.pack(m,s,_),_+=3}return _}Uc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,F.IDENTITY);let o=F.inverseTransformation(t,qWe),r=F.multiplyByPoint(o,d.ZERO,YWe),s=d.normalize(F.multiplyByPointAsVector(o,d.UNIT_Y,Rae),Rae),a=an.fromPointNormal(r,s,XWe),c=d.normalize(F.multiplyByPointAsVector(o,d.UNIT_X,Oae),Oae),u=an.fromPointNormal(r,c,KWe),f=1;n.push(d.clone(e[0]));let h=n[0],p=e.length;for(let _=1;_<p;++_){let m=e[_];if(an.getPointDistance(u,h)<0||an.getPointDistance(u,m)<0){let x=Zn.lineSegmentPlane(h,m,a,ZWe);if(l(x)){let b=d.multiplyByScalar(s,5e-9,$We);an.getPointDistance(a,h)<0&&d.negate(b,b),n.push(d.add(x,b,new d)),i.push(f+1),d.negate(b,b),n.push(d.add(x,b,new d)),f=1}}n.push(d.clone(e[_])),f++,h=m}i.push(f)}return{positions:n,lengths:i}};Uc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ee.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],FW);if(o=r?o[0]:o,o!==0){let b=i.geodeticSurfaceNormal(x,H_);d.multiplyByScalar(b,o,b),d.add(x,b,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=y(e.granularity,P.RADIANS_PER_DEGREE);s=P.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Uc.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),h=0;for(c=0;c<n-1;c++){let x=t[c],b=t[c+1],T=r?o[c]:o,C=r?o[c+1]:o;h=JWe(x,b,s,i,T,C,f,h)}NW.length=0;let p=t[n-1],_=i.cartesianToCartographic(p,HB);_.height=r?o[n-1]:o;let m=i.cartographicToCartesian(_,H_);return d.pack(m,f,u-3),f};var Mae=new fe,tje=new fe;Uc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ee.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let T=i.scaleToGeodeticSurface(t[0],FW);if(o=r?o[0]:o,o!==0){let C=i.geodeticSurfaceNormal(T,H_);d.multiplyByScalar(C,o,C),d.add(T,C,T)}return[T.x,T.y,T.z]}let s=y(e.granularity,P.RADIANS_PER_DEGREE),a=0,c,u=i.cartesianToCartographic(t[0],Mae),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],tje),a+=Uc.numberOfPointsRhumbLine(u,f,s),u=fe.clone(f,Mae);let h=(a+1)*3,p=new Array(h),_=0;for(c=0;c<n-1;c++){let T=t[c],C=t[c+1],A=r?o[c]:o,S=r?o[c+1]:o;_=eje(T,C,s,i,A,S,p,_)}NW.length=0;let m=t[n-1],x=i.cartesianToCartographic(m,HB);x.height=r?o[n-1]:o;let b=i.cartographicToCartesian(x,H_);return d.pack(b,p,h-3),p};Uc.generateCartesianArc=function(e){let t=Uc.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};Uc.generateCartesianRhumbArc=function(e){let t=Uc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};var Li=Uc;function lu(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Yi.fromType(Yi.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=bo(n,d.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(d.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Li.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Fae),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ae.fromPoints(this._actualPositions),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ae}var Nae=lu.POSITION_INDEX=0,nje=lu.SHOW_INDEX=1,ije=lu.WIDTH_INDEX=2,oje=lu.MATERIAL_INDEX=3,zw=lu.POSITION_SIZE_INDEX=4,rje=lu.DISTANCE_DISPLAY_CONDITION=5,Fae=lu.NUMBER_OF_PROPERTIES=6;function Fp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(lu.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Fp(this,nje))}},positions:{get:function(){return this._positions},set:function(e){let t=bo(e,d.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(d.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Fp(this,zw),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ae.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ae.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Fp(this,Nae),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Fp(this,oje))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Fp(this,ije))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!d.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(d.clone(t[0]))):t.length>2&&d.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Fp(this,zw)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Lt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),Fp(this,rje))}}});lu.prototype.update=function(){let e=F.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Nae]>0||this._propertiesChanged[zw]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=Li.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ae.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)Fp(this,zw);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){Fp(this,zw);break}}};lu.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};lu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Fae-1;++t)e[t]=0};lu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var vd=lu;var sje=vd.SHOW_INDEX,aje=vd.WIDTH_INDEX,kW=vd.POSITION_INDEX,cje=vd.MATERIAL_INDEX,Bae=vd.POSITION_SIZE_INDEX,lje=vd.DISTANCE_DISPLAY_CONDITION,Wae=vd.NUMBER_OF_PROPERTIES,El={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function wd(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Wae),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Fe.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(wd.prototype,{length:{get:function(){return VW(this),this._polylines.length}}});wd.prototype.add=function(e){let t=new vd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};wd.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};wd.prototype.removeAll=function(){UW(this),Kae(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};wd.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};wd.prototype.get=function(e){return VW(this),this._polylines[e]};function uje(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:X.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:X.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:X.FLOAT,componentsPerAttribute:2}];e._batchTable=new LT(t,n,e._polylines.length)}var jae=new Hn,qae=new oe,Yae=new U;wd.prototype.update=function(e){if(VW(this),this._polylines.length===0||!this.show)return;gje(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Bt.maximumVertexTextureImageUnits===0)throw new re("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");uje(this,t),this._createBatchTable=!1}if(this._createVertexArray||dje(this))Uae(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ne.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[Bae]||o[cje])Uae(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let h=0;h<u;++h){i=c[h],o=i._propertiesChanged;let p=i._bucket,_=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[kW]&&p.writeUpdate(_,i,this._positionBuffer,n);break}_+=f[m].lengthOfPositions}if((o[sje]||o[aje])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(o[kW]||o[Bae]){let m=e.mode===ne.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=Hn.fromCartesian(m.center,jae),b=oe.fromElements(x.low.x,x.low.y,x.low.z,m.radius,qae);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[lje]){let m=Yae;m.x=0,m.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(m.x=x.near,m.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<Wae;++c)o[c]=0;let r=F.IDENTITY;e.mode===ne.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ve.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ve.fromCache({blending:un.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;fje(this,e,c,r)}};var Hw=new ae,kae=new ae;function fje(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),_=u.length;for(let m=0;m<_;++m){let x=u[m],b=x.buckets,T=b.length;for(let C=0;C<T;++C){let A=b[C],S=A.offset,v=A.bucket.shaderProgram,D=A.bucket.polylines,O=D.length,R,M,L=0,g,E;for(let w=0;w<O;++w){let I=D[w],N=mje(I._material);if(N!==R){if(l(R)&&L>0){let G=M.isTranslucent();a>=s?(g=new $e({owner:e}),n.push(g)):g=n[a],++a,E=bt(p(M._uniforms),e._uniformMap),g.boundingVolume=ae.clone(Hw,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=v,g.vertexArray=x.va,g.renderState=G?e._translucentRS:e._opaqueRS,g.pass=G?we.TRANSLUCENT:we.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=E,g.count=L,g.offset=S,S+=L,L=0,c=!0,r.push(g)}M=I._material,M.update(o),R=N}let B=I._locatorBuckets,H=B.length;for(let G=0;G<H;++G){let k=B[G];k.locator===A&&(L+=k.count)}let V;t.mode===ne.SCENE3D?V=I._boundingVolumeWC:t.mode===ne.COLUMBUS_VIEW?V=I._boundingVolume2D:t.mode===ne.SCENE2D?l(I._boundingVolume2D)&&(V=ae.clone(I._boundingVolume2D,kae),V.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(V=ae.union(I._boundingVolumeWC,I._boundingVolume2D,kae)),c?(c=!1,ae.clone(V,Hw)):ae.union(V,Hw,Hw)}l(R)&&L>0&&(a>=s?(g=new $e({owner:e}),n.push(g)):g=n[a],++a,E=bt(p(M._uniforms),e._uniformMap),g.boundingVolume=ae.clone(Hw,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=v,g.vertexArray=x.va,g.renderState=M.isTranslucent()?e._translucentRS:e._opaqueRS,g.pass=M.isTranslucent()?we.TRANSLUCENT:we.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=E,g.count=L,g.offset=S,c=!0,r.push(g)),R=void 0}}n.length=a}wd.prototype.isDestroyed=function(){return!1};wd.prototype.destroy=function(){return Xae(this),UW(this),Kae(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function dje(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[kW]?(i.bufferUsage!==Fe.STREAM_DRAW&&(t=!0,i.bufferUsage=Fe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Fe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Fe.STATIC_DRAW):i.frameCount--),t}var Vae=[0,0,0];function Uae(e,t,n){e._createVertexArray=!1,UW(e),Xae(e),pje(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,h=e._polylineBuckets,p,_;for(p in h)h.hasOwnProperty(p)&&(_=h[p],_.updateShader(t,r,s),f+=_.lengthOfPositions);if(f>0){let m=e._mode,x=new Float32Array(6*f*3),b=new Float32Array(f*4),T,C=0,A=0,S=0;for(p in h)if(h.hasOwnProperty(p)){_=h[p],_.write(x,b,C,A,S,r,t,n),m===ne.MORPHING&&(l(T)||(T=new Float32Array(6*f*3)),_.writeForMorph(T,C));let E=_.lengthOfPositions;C+=6*E*3,A+=E*4,S+=E*4,c=_.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,D=Fe.STATIC_DRAW;e._positionBuffer=yt.createVertexBuffer({context:t,typedArray:x,usage:v});let O;l(T)&&(O=yt.createVertexBuffer({context:t,typedArray:T,usage:v})),e._texCoordExpandAndBatchIndexBuffer=yt.createVertexBuffer({context:t,typedArray:b,usage:D});let R=3*Float32Array.BYTES_PER_ELEMENT,M=4*Float32Array.BYTES_PER_ELEMENT,L=0,g=i.length;for(let E=0;E<g;++E)if(o=i[E],o.length>0){let w=new Uint16Array(o),I=yt.createIndexBuffer({context:t,typedArray:w,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});L+=a[E];let N=6*(E*(R*P.SIXTY_FOUR_KILOBYTES)-L*R),B=R+N,H=R+B,V=R+H,G=R+V,k=R+G,W=E*(M*P.SIXTY_FOUR_KILOBYTES)-L*M,Y=[{index:El.position3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:El.position3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:El.position2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:El.position2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:El.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:H,strideInBytes:6*R},{index:El.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:El.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:H,strideInBytes:6*R},{index:El.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:El.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:El.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:El.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:El.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:X.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:El.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:X.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:W}],J,j,K,Q;m===ne.SCENE3D?(j=e._positionBuffer,J="vertexBuffer",K=Vae,Q="value"):m===ne.SCENE2D||m===ne.COLUMBUS_VIEW?(j=Vae,J="value",K=e._positionBuffer,Q="vertexBuffer"):(j=O,J="vertexBuffer",K=e._positionBuffer,Q="vertexBuffer"),Y[0][J]=j,Y[1][J]=j,Y[2][Q]=K,Y[3][Q]=K,Y[4][J]=j,Y[5][J]=j,Y[6][Q]=K,Y[7][Q]=K,Y[8][J]=j,Y[9][J]=j,Y[10][Q]=K,Y[11][Q]=K;let de=new ti({context:t,attributes:Y,indexBuffer:I});e._vertexArrays.push({va:de,buckets:u[E]})}}}function hje(e,t){return t instanceof Ot?t.id:t}var GB=[];function mje(e){let t=Yi._uniformList[e.type],n=t.length;GB.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];GB[i]=r,GB[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(GB,hje)}`}function pje(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new om(c,t,n)),u.addPolyline(a)}}}function gje(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function VW(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function UW(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function Xae(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}wd.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Kae(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function BW(e,t,n){this.count=e,this.offset=t,this.bucket=n}function om(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}om.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};om.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),Ht.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Ue({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,wT]}),r=t.getVertexShaderCallback()(hL),s=new Ue({defines:i,sources:[Ju,r]});this.shaderProgram=en.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:El})};function Zae(e){return d.dot(d.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(an.ORIGIN_ZX_PLANE)===jt.INTERSECTING}om.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ne.SCENE3D||!Zae(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var Ts=new d,Af=new d,Ef=new d,WB=new d,_je=new oe,yje=new U;om.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,h=f.length;for(let p=0;p<h;++p){let _=f[p],m=_.width,x=_.show&&m>0,b=_._index,T=this.getSegments(_,a),C=T.positions,A=T.lengths,S=C.length,v=_.getPickId(s).color,D=0,O=0,R;for(let H=0;H<S;++H){H===0?_._loop?R=C[S-2]:(R=WB,d.subtract(C[0],C[1],R),d.add(C[0],R,R)):R=C[H-1],d.clone(R,Af),d.clone(C[H],Ts),H===S-1?_._loop?R=C[1]:(R=WB,d.subtract(C[S-1],C[S-2],R),d.add(C[S-1],R,R)):R=C[H+1],d.clone(R,Ef);let V=A[D];H===O+V&&(O+=V,++D);let G=H-O===0,k=H===O+A[D]-1;c===ne.SCENE2D&&(Af.z=0,Ts.z=0,Ef.z=0),(c===ne.SCENE2D||c===ne.MORPHING)&&(G||k)&&u-Math.abs(Ts.x)<1&&((Ts.x<0&&Af.x>0||Ts.x>0&&Af.x<0)&&d.clone(Ts,Af),(Ts.x<0&&Ef.x>0||Ts.x>0&&Ef.x<0)&&d.clone(Ts,Ef));let W=G?2:0,Y=k?2:4;for(let J=W;J<Y;++J){Hn.writeElements(Ts,e,n),Hn.writeElements(Af,e,n+6),Hn.writeElements(Ef,e,n+12);let j=J-2<0?-1:1;t[o]=H/(S-1),t[o+1]=2*(J%2)-1,t[o+2]=j,t[o+3]=b,n+=6*3,o+=4}}let M=_je;M.x=z.floatToByte(v.red),M.y=z.floatToByte(v.green),M.z=z.floatToByte(v.blue),M.w=z.floatToByte(v.alpha);let L=yje;L.x=m,L.y=x?1:0;let g=c===ne.SCENE2D?_._boundingVolume2D:_._boundingVolumeWC,E=Hn.fromCartesian(g.center,jae),w=E.high,I=oe.fromElements(E.low.x,E.low.y,E.low.z,g.radius,qae),N=Yae;N.x=0,N.y=Number.MAX_VALUE;let B=_.distanceDisplayCondition;l(B)&&(N.x=B.near,N.y=B.far),r.setBatchedAttribute(b,0,L),r.setBatchedAttribute(b,1,M),r.attributes.length>2&&(r.setBatchedAttribute(b,2,w),r.setBatchedAttribute(b,3,I),r.setBatchedAttribute(b,4,N))}};var xje=new d,bje=new d,Tje=new d,zae=new d;om.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,h=0;for(let p=0;p<u;++p){let _;p===0?s._loop?_=a[u-2]:(_=zae,d.subtract(a[0],a[1],_),d.add(a[0],_,_)):_=a[p-1],_=F.multiplyByPoint(n,_,bje);let m=F.multiplyByPoint(n,a[p],xje),x;p===u-1?s._loop?x=a[1]:(x=zae,d.subtract(a[u-1],a[u-2],x),d.add(a[u-1],x,x)):x=a[p+1],x=F.multiplyByPoint(n,x,Tje);let b=c[f];p===h+b&&(h+=b,++f);let T=p-h===0,C=p===h+c[f]-1,A=T?2:0,S=C?2:4;for(let v=A;v<S;++v)Hn.writeElements(m,e,t),Hn.writeElements(_,e,t+6),Hn.writeElements(x,e,t+12),t+=6*3}}};var Cje=new Array(1);om.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new BW(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let h=0;h<f;++h){let p=u[h];p._locatorBuckets=[];let _;if(this.mode===ne.SCENE3D){_=Cje;let x=p._actualPositions.length;if(x>0)_[0]=x;else continue}else _=p._segments.lengths;let m=_.length;if(m>0){let x=0;for(let b=0;b<m;++b){let T=_[b]-1;for(let C=0;C<T;++C)c+4>P.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new BW(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new BW(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};om.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var jC={positions:void 0,lengths:void 0},Hae=new Array(1),Aje=new d,Eje=new fe;om.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ne.SCENE3D)return Hae[0]=n.length,jC.positions=n,jC.lengths=Hae,jC;Zae(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=Aje;for(let u=0;u<s;++u)a=n[u],c=F.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,Eje)));if(o.length>0){e._boundingVolume2D=ae.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new d(u.z,u.x,u.y)}return jC.positions=o,jC.lengths=e._segments.lengths,jC};var Gae;om.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Gae,c=6*s*3;!l(a)||a.length<c?a=Gae=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,h=u.lengths,p=0,_=0,m=0,x;s=f.length;for(let b=0;b<s;++b){b===0?t._loop?x=f[s-2]:(x=WB,d.subtract(f[0],f[1],x),d.add(f[0],x,x)):x=f[b-1],d.clone(x,Af),d.clone(f[b],Ts),b===s-1?t._loop?x=f[1]:(x=WB,d.subtract(f[s-1],f[s-2],x),d.add(f[s-1],x,x)):x=f[b+1],d.clone(x,Ef);let T=h[_];b===m+T&&(m+=T,++_);let C=b-m===0,A=b===m+h[_]-1;o===ne.SCENE2D&&(Af.z=0,Ts.z=0,Ef.z=0),(o===ne.SCENE2D||o===ne.MORPHING)&&(C||A)&&r-Math.abs(Ts.x)<1&&((Ts.x<0&&Af.x>0||Ts.x>0&&Af.x<0)&&d.clone(Ts,Af),(Ts.x<0&&Ef.x>0||Ts.x>0&&Ef.x<0)&&d.clone(Ts,Ef));let S=C?2:0,v=A?2:4;for(let D=S;D<v;++D)Hn.writeElements(Ts,a,p),Hn.writeElements(Af,a,p+6),Hn.writeElements(Ef,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var rm=wd;function G_(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new Tf({batchTable:e.batchTable}),this._labelCollection=new Np({batchTable:e.batchTable}),this._polylineCollection=new rm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(G_.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function Sje(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+se.packedLength+ee.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,se.pack(n,s,a),a+=se.packedLength,ee.pack(t,s,a),s}var vje=new _i("createVectorTilePoints",5),wje=new d;function Dje(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Sje(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=vje.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3;for(let _=0;_<p;++_){let m=h[_],x=d.unpack(n,_*3,wje),b=c.add();b.position=x,b._batchIndex=m;let T=u.add();T.text=" ",T.position=x,T._batchIndex=m;let C=f.add();C.positions=[d.clone(x),d.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}G_.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],u=n.get(a),f=i.get(a),h=o.get(a);t[c]=new z_(e,c,u,f,h)}};G_.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function Ije(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=z_.defaultPointSize,s.color=z_.defaultColor,s.pointOutlineColor=z_.defaultPointOutlineColor,s.pointOutlineWidth=z_.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Xo.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new U(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=yi.CENTER,s.verticalOrigin=On.CENTER,s.labelHorizontalOrigin=yi.RIGHT,s.labelVerticalOrigin=On.BASELINE}}var Pje=new z,Rje=new z,Oje=new z,Mje=new z,Lje=new z,Nje=new z,Gw=new kt,Ww=new kt,zW=new Lt;G_.prototype.applyStyle=function(e,t){if(!l(e)){Ije(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,Pje)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Rje)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Oje)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Mje)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,Lje)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(Gw.near=a.x,Gw.nearValue=a.y,Gw.far=a.z,Gw.farValue=a.w,s.scaleByDistance=Gw):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(Ww.near=a.x,Ww.nearValue=a.y,Ww.far=a.z,Ww.farValue=a.w,s.translucencyByDistance=Ww):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(zW.near=a.x,zW.far=a.y,s.distanceDisplayCondition=zW):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,Nje)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};G_.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Dje(this,e.mapProjection.ellipsoid)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};G_.prototype.isDestroyed=function(){return!1};G_.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var jB=G_;function Bp(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,d.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=kn.BOTH}Object.defineProperties(Bp.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function Fje(e){let t=new Float64Array(3+d.packedLength+ee.packedLength+se.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,d.pack(e._center,t,n),n+=d.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,se.pack(e._rectangle,t,n),t}function Bje(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=wn.unpack(t,n),n+=wn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],h=t[n++],p=new Array(h);for(let _=0;_<h;++_)p[_]=t[n++];s[a]=new _p({color:c,offset:u,count:f,batchIds:p})}}var kje=new _i("createVectorTilePolygons",5),Vje=new z;function Uje(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(se.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let _=e._batchTable,m=s.length;for(let x=0;x<m;++x){let b=_.getColor(x,Vje);s[x]=b.toRgba()}a=e._packedBuffer=Fje(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,h=e._polygonMaximumHeights;l(f)&&l(h)&&(f=f.slice(),h=h.slice(),c.push(f.buffer,h.buffer),u.minimumHeights=f,u.maximumHeights=h);let p=kje.scheduleTask(u,c);if(l(p))return p.then(_=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(_.packedBuffer),x=m[0];Bje(e,m),e._indices=Ne.getSizeInBytes(x)===2?new Uint16Array(_.indices):new Uint32Array(_.indices),e._indexOffsets=new Uint32Array(_.indexOffsets),e._indexCounts=new Uint32Array(_.indexCounts),e._batchedPositions=new Float32Array(_.positions),e._vertexBatchIds=new Uint16Array(_.batchIds),zje(e),e._ready=!0}).catch(_=>{e.isDestroyed()||(e._error=_)})}function zje(e){l(e._primitive)||(e._primitive=new oC({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}Bp.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Bp.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Bp.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Bp.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Bp.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Uje(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Bp.prototype.isDestroyed=function(){return!1};Bp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var qB=Bp;function Dd(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Dd.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Hje(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+se.packedLength+ee.packedLength+d.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,se.pack(t,a,c),c+=se.packedLength,ee.pack(o,a,c),c+=ee.packedLength,d.pack(r,a,c),a}var Gje=new _i("createVectorTilePolylines",5),qC={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Wje(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=Hje(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Gje.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let h=f.indexDatatype;e._indices=h===Ne.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),jje(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function jje(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=yt.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),f=yt.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),h=yt.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),p=yt.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),_=yt.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),m=yt.createIndexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),x=[{index:qC.previousPosition,vertexBuffer:u,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:qC.currentPosition,vertexBuffer:f,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:qC.nextPosition,vertexBuffer:h,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:qC.expandAndWidth,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:2},{index:qC.a_batchId,vertexBuffer:_,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ti({context:t,attributes:x,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var jw=new F,$ae=new d;function qje(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,jw),F.multiplyByPoint(jw,e._center,$ae),F.setTranslation(jw,$ae,jw),jw},u_highlightColor:function(){return e._highlightColor}})}function Yje(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var Xje=`uniform vec4 u_highlightColor; -void main() -{ - out_FragColor = u_highlightColor; -} -`;function Kje(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(vL),o=n.getFragmentShaderCallback(!1,void 0,!1)(Xje),r=new Ue({defines:["VECTOR_TILE",Ht.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Ju,i]}),s=new Ue({defines:["VECTOR_TILE"],sources:[o]});e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:qC})}function Zje(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new $e({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:we.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Dd.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,u=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let h=o[r],p=o[r+1]-h;for(s=0;s<p;++s){let _=(h+s)*3;f[u++]=i[_],f[u++]=i[_+1],f[u++]=i[_+2]}}return f};Dd.prototype.getPositions=function(e){return Dd.getPolylinePositions(this,e)};Dd.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new $s(e,r)}};Dd.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function $je(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=z.WHITE}}var Qje=new z,Jje=z.WHITE,e7e=!0;Dd.prototype.applyStyle=function(e,t){if(!l(e)){$je(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,Qje):Jje,s.show=l(e.show)?e.show.evaluate(s):e7e}};Dd.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Wje(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}qje(this,t),Kje(this,t),Yje(this);let n=e.passes;(n.render||n.pick)&&Zje(this,e)};Dd.prototype.isDestroyed=function(){return!1};Dd.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var YC=Dd;function kp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new U(li._defaultMinTerrainHeight,li._defaultMaxTerrainHeight),this._boundingVolume=wn.fromRectangle(e.rectangle,li._defaultMinTerrainHeight,li._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(kp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function t7e(e,t,n){let i=li.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;wn.fromRectangle(c,o,r,n,a)}function n7e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+se.packedLength+ee.packedLength+d.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,se.pack(t,a,c),c+=se.packedLength,ee.pack(o,a,c),c+=ee.packedLength,d.pack(r,a,c),a}var i7e=new _i("createVectorTileClampedPolylines"),W_={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function o7e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=n7e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=i7e.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let h=f.indexDatatype;e._indices=h===Ne.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),r7e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function r7e(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let h=yt.createVertexBuffer({context:t,typedArray:n,usage:Fe.STATIC_DRAW}),p=yt.createVertexBuffer({context:t,typedArray:i,usage:Fe.STATIC_DRAW}),_=yt.createVertexBuffer({context:t,typedArray:o,usage:Fe.STATIC_DRAW}),m=yt.createVertexBuffer({context:t,typedArray:r,usage:Fe.STATIC_DRAW}),x=yt.createVertexBuffer({context:t,typedArray:s,usage:Fe.STATIC_DRAW}),b=yt.createVertexBuffer({context:t,typedArray:a,usage:Fe.STATIC_DRAW}),T=yt.createVertexBuffer({context:t,typedArray:c,usage:Fe.STATIC_DRAW}),C=yt.createIndexBuffer({context:t,typedArray:u,usage:Fe.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),A=[{index:W_.startEllipsoidNormal,vertexBuffer:h,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:W_.endEllipsoidNormal,vertexBuffer:p,componentDatatype:X.FLOAT,componentsPerAttribute:3},{index:W_.startPositionAndHeight,vertexBuffer:_,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:W_.endPositionAndHeight,vertexBuffer:m,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:W_.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:W_.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:X.FLOAT,componentsPerAttribute:4},{index:W_.a_batchId,vertexBuffer:T,componentDatatype:X.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ti({context:t,attributes:A,indexBuffer:C}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var qw=new F,Qae=new d;function s7e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,qw),F.multiplyByPoint(qw,e._center,Qae),F.setTranslation(qw,Qae,qw),qw},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Jae(e){return Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})}function a7e(e){l(e._rs)||(e._rs=Jae(!1),e._rs3DTiles=Jae(!0))}function c7e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(SL),o=n.getFragmentShaderCallback(!1,void 0,!0)(EL),r=new Ue({defines:["VECTOR_TILE",Ht.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Ju,i]}),s=new Ue({defines:["VECTOR_TILE"],sources:[o]});e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:W_})}function l7e(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new $e({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:we.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=$e.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=we.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===kn.TERRAIN||i===kn.BOTH)&&t.commandList.push(n),(i===kn.CESIUM_3D_TILE||i===kn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}kp.prototype.getPositions=function(e){return YC.getPolylinePositions(this,e)};kp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new $s(e,r)}};kp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function u7e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=z.WHITE}}var f7e=new z,d7e=z.WHITE,h7e=!0;kp.prototype.applyStyle=function(e,t){if(!l(e)){u7e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,f7e):d7e,s.show=l(e.show)?e.show.evaluate(s):h7e}};function m7e(e){return li.initialize().then(function(){t7e(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}kp.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=m7e(this).then(o7e(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}s7e(this,t),c7e(this,t),a7e(this);let n=e.passes;(n.render||n.pick)&&l7e(this,e)};kp.prototype.isDestroyed=function(){return!1};kp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var YB=kp;var HW=32767,p7e=new fe,g7e=new d;function _7e(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);Ln.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let h=s[f],p=a[f],_=c[f],m=P.lerp(t.west,t.east,h/HW),x=P.lerp(t.south,t.north,p/HW),b=P.lerp(n,i,_/HW),T=fe.fromRadians(m,x,b,p7e),C=o.cartographicToCartesian(T,g7e);d.pack(C,u,f*3)}return u}var XB=_7e;function Pd(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,C7e(this,i,o)}Object.defineProperties(Pd.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function y7e(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function x7e(e,t){let n,i,o,r,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(o),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new re("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var Id=Uint32Array.BYTES_PER_ELEMENT;function b7e(e){return new YC(e)}function T7e(e){return new YB(e)}function C7e(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=Id;let r=o.getUint32(n,!0);if(r!==1)throw new re(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=Id;let s=o.getUint32(n,!0);if(n+=Id,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Id,a===0)throw new re("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Id;let u=o.getUint32(n,!0);n+=Id;let f=o.getUint32(n,!0);n+=Id;let h=o.getUint32(n,!0);n+=Id;let p=o.getUint32(n,!0);n+=Id;let _=o.getUint32(n,!0);n+=Id;let m=o.getUint32(n,!0);n+=Id;let x=Fo(i,n,a);n+=a;let b=new Uint8Array(t,n,c);n+=c;let T,C;u>0&&(T=Fo(i,n,u),n+=u,f>0&&(C=new Uint8Array(t,n,f),C=new Uint8Array(C),n+=f));let A=y(x.POLYGONS_LENGTH,0),S=y(x.POLYLINES_LENGTH,0),v=y(x.POINTS_LENGTH,0),D=A+S+v,O=new i_(e,D,T,C,y7e(e));if(e._batchTable=O,D===0)return;let R=new Qh(x,b),M=R.getGlobalProperty("REGION");if(!l(M))throw new re("Feature table global property: REGION must be defined");let L=se.unpack(M),g=M[4],E=M[5],w=e._tile.computedTransform,I=R.getGlobalProperty("RTC_CENTER",X.FLOAT,3);l(I)?(I=d.unpack(I),F.multiplyByPoint(w,I,I)):(I=se.center(L),I.height=P.lerp(g,E,.5),I=ee.WGS84.cartographicToCartesian(I));let N=x7e(x,b);if(n+=(4-n%4)%4,A>0){R.featuresLength=A;let B=y(R.getPropertyArray("POLYGON_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new re("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let H=y(R.getPropertyArray("POLYGON_INDEX_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYGON_INDEX_COUNT",X.UNSIGNED_INT,1));if(!l(H))throw new re("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=B.reduce(function(j,K){return j+K*2},0),G=H.reduce(function(j,K){return j+K},0),k=new Uint32Array(t,n,G);n+=h;let W=new Uint16Array(t,n,V);n+=p;let Y,J;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(Y=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",X.FLOAT,1),J=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",X.FLOAT,1)),e._polygons=new qB({positions:W,counts:B,indexCounts:H,indices:k,minimumHeight:g,maximumHeight:E,polygonMinimumHeights:Y,polygonMaximumHeights:J,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,batchIds:N.polygons,modelMatrix:w})}if(S>0){R.featuresLength=S;let B=y(R.getPropertyArray("POLYLINE_COUNTS",X.UNSIGNED_INT,1),R.getPropertyArray("POLYLINE_COUNT",X.UNSIGNED_INT,1));if(!l(B))throw new re("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let H=R.getPropertyArray("POLYLINE_WIDTHS",X.UNSIGNED_SHORT,1);if(!l(H)){H=new Uint16Array(S);for(let J=0;J<S;++J)H[J]=2}let V=B.reduce(function(J,j){return J+j*3},0),G=new Uint16Array(t,n,V);n+=_;let k=e._tileset,W=k.examineVectorLinesFunction;if(l(W)){let J=XB(new Uint16Array(G),L,g,E,ee.WGS84);A7e(J,B,N.polylines,O,e.url,W)}let Y=b7e;l(k.classificationType)&&(Y=T7e),e._polylines=Y({positions:G,widths:H,counts:B,batchIds:N.polylines,minimumHeight:g,maximumHeight:E,center:I,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:O,classificationType:k.classificationType,keepDecodedPositions:k.vectorKeepDecodedPositions})}if(v>0){let B=new Uint16Array(t,n,v*3);n+=m,e._points=new jB({positions:B,batchIds:N.points,minimumHeight:g,maximumHeight:E,rectangle:L,batchTable:O})}}function GW(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}Pd.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Pd.prototype.getFeature=function(e){return l(this._features)||GW(this),this._features[e]};Pd.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};Pd.prototype.applyStyle=function(e){l(this._features)||GW(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};Pd.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||GW(this),this._batchTable.update(e,t),this._ready=!0)};Pd.prototype.pick=function(e,t,n){};Pd.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};Pd.prototype.isDestroyed=function(){return!1};Pd.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function A7e(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,r(f,n[c],o,i)}}var KB=Pd;var ece={b3dm:function(e,t,n,i,o){return gf.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return gf.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return gf.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return SN.fromTileType(e,t,n,i,o,ece)},externalTileset:function(e,t,n,i){return LB.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new MN(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new KB(e,t,n,i,o)},subt:function(e,t,n,i,o){return cw.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return cw.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new re("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return gf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return gf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return gf.fromGeoJson(e,t,n,i)}},XC=ece;var E7e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Ko=Object.freeze(E7e);var Rd={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};Rd.isBinaryFormat=function(e){switch(e){case Rd.BATCHED_3D_MODEL:case Rd.INSTANCED_3D_MODEL:case Rd.COMPOSITE:case Rd.POINT_CLOUD:case Rd.VECTOR:case Rd.GEOMETRY:case Rd.IMPLICIT_SUBTREE:case Rd.VOXEL_BINARY:case Rd.GLTF_BINARY:return!0;default:return!1}};var ks=Object.freeze(Rd);var S7e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Od=Object.freeze(S7e);var Vs={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},Vp=new Array(Vs.NUMBER_OF_PASSES);Vp[Vs.RENDER]=Object.freeze({pass:Vs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Vp[Vs.PICK]=Object.freeze({pass:Vs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Vp[Vs.SHADOW]=Object.freeze({pass:Vs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Vp[Vs.PRELOAD]=Object.freeze({pass:Vs.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Vp[Vs.PRELOAD_FLIGHT]=Object.freeze({pass:Vs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Vp[Vs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Vs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Vp[Vs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Vs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Vp[Vs.MOST_DETAILED_PICK]=Object.freeze({pass:Vs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Vs.getPassOptions=function(e){return Vp[e]};var Vo=Object.freeze(Vs);function sm(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(sm.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});sm.prototype.hasProperty=function(e,t){return!1};sm.prototype.getFeature=function(e){};sm.prototype.applyDebugSettings=function(e,t){};sm.prototype.applyStyle=function(e){};sm.prototype.update=function(e,t){};sm.prototype.pick=function(e,t,n){};sm.prototype.isDestroyed=function(){return!1};sm.prototype.destroy=function(){return ue(this)};var Yw=sm;function Up(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Up.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Up.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};Up.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};Up.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};Up.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};Up.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};Up.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};Up.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var ZB=Up;function WW(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){WW._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new ZB({content:n,class:o})}}WW._oneTimeWarning=xt;var KC=WW;function v7e(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var ZC=v7e;function zp(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(zp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});zp.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};zp.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};zp.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};zp.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};zp.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};zp.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};zp.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var $B=zp;function jW(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){jW._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new $B({tile:n,class:o})}}jW._oneTimeWarning=xt;var QB=jW;function w7e(e){let t=new Uint8Array(e),n=Wh(t);if(n==="glTF"&&(n="glb"),ks.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=D7e(t);if(l(i.root))return{contentType:ks.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:ks.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:ks.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:ks.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:ks.VOXEL_JSON,jsonPayload:i};throw new re("Invalid tile content.")}function D7e(e){let t;try{t=Fo(e)}catch{throw new re("Invalid tile content.")}return t}var Hp=w7e;function Sf(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=bc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(Sf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function qW(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function tce(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}Sf.prototype.requestInnerContents=function(){if(!I7e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;qW(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=P7e(this,n,t,this._tile._contentState);return R7e(this)};function I7e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!bc.serverHasOpenSlots(n,t[n]))return!1;return bc.heapHasOpenSlots(e.length)}function P7e(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new nr({throttle:!0,throttleByServer:!0,type:ps.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Kn.CANCELLED){tce(e,i);return}return qW(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Kn.CANCELLED){tce(e,i);return}qW(e,-1),nce(e,t,f)}})}async function R7e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>O7e(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function O7e(e,t,n){if(l(t))try{let i=Hp(t);if(i.contentType===ks.EXTERNAL_TILESET)throw new re("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===ks.GEOMETRY||i.contentType===ks.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=XC[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=KC(o,u));let f=ZC(o,u);return l(f)&&(a.group=new nC({metadata:f})),a}catch(i){nce(e,n,i)}}function nce(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}Sf.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};Sf.prototype.hasProperty=function(e,t){return!1};Sf.prototype.getFeature=function(e){};Sf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Sf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Sf.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};Sf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let u=d.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};Sf.prototype.isDestroyed=function(){return!1};Sf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var JB=Sf;var ice=Math.cos,oce=Math.sin,M7e=Math.sqrt,YW={};YW.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,h=ice(f),p=oce(f),_=a.z*p,m=c.longitude+i*e.granYSin+o*e.granXCos,x=h*ice(m),b=h*oce(m),T=a.x*x,C=a.y*b,A=M7e(T*x+C*b+_*p);if(r.x=T/A,r.y=C/A,r.z=_/A,n){let S=e.stNwCorner;l(S)?(f=S.latitude-e.stGranYCos*i+o*e.stGranXSin,m=S.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var L7e=new Pi,vf=new d,N7e=new fe,e3=new d,Xw=new Ii;function rce(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),h=i*f,p=n*f;Xw._ellipsoid=ee.default,vf=Xw.project(e,vf),vf=d.subtract(vf,e3,vf);let _=Pi.fromRotation(t,L7e);vf=Pi.multiplyByVector(_,vf,vf),vf=d.add(vf,e3,vf),e=Xw.unproject(vf,e),r-=1,s-=1;let m=e.latitude,x=m+r*p,b=m-c*s,T=m-c*s+r*p,C=Math.max(m,x,b,T),A=Math.min(m,x,b,T),S=e.longitude,v=S+r*u,D=S+s*h,O=S+s*h+r*u,R=Math.max(S,v,D,O),M=Math.min(S,v,D,O);return{north:C,south:A,east:R,west:M,granYCos:c,granYSin:h,granXCos:u,granXSin:p,nwCorner:e}}YW.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,u=e.north,f=e.south,h=!1,p=!1;u===P.PI_OVER_TWO&&(h=!0),f===-P.PI_OVER_TWO&&(p=!0);let _,m=u-f;c>a?_=P.TWO_PI-c+a:_=a-c;let x=Math.ceil(_/t)+1,b=Math.ceil(m/t)+1,T=_/(x-1),C=m/(b-1),A=se.northwest(e,r),S=se.center(e,N7e);(n!==0||i!==0)&&(S.longitude<A.longitude&&(S.longitude+=P.TWO_PI),Xw._ellipsoid=ee.default,e3=Xw.project(S,e3));let v=C,D=T,O=0,R=0,M=se.clone(e,o),L={granYCos:v,granYSin:O,granXCos:D,granXSin:R,nwCorner:A,boundingRectangle:M,width:x,height:b,northCap:h,southCap:p};if(n!==0){let g=rce(A,n,T,C,S,x,b);u=g.north,f=g.south,a=g.east,c=g.west,L.granYCos=g.granYCos,L.granYSin=g.granYSin,L.granXCos=g.granXCos,L.granXSin=g.granXSin,M.north=u,M.south=f,M.east=a,M.west=c}if(i!==0){n=n-i;let g=se.northwest(M,s),E=rce(g,n,T,C,S,x,b);L.stGranYCos=E.granYCos,L.stGranXCos=E.granXCos,L.stGranYSin=E.granYSin,L.stGranXSin=E.granXSin,L.stNwCorner=g,L.stWest=E.west,L.stSouth=E.south}return L};var Us=YW;var F7e=new ae,B7e=new ae,k7e=new d,V7e=new se;function sce(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;r&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*o+2*a-f;let h=new Float64Array(u*3),p=0,_=0,m,x=k7e;if(r)Us.computePosition(t,n,!1,_,0,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;else for(m=0;m<o;m++)Us.computePosition(t,n,!1,_,m,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;for(m=o-1,_=1;_<i;_++)Us.computePosition(t,n,!1,_,m,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;if(_=i-1,!s)for(m=o-2;m>=0;m--)Us.computePosition(t,n,!1,_,m,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;for(m=0,_=i-2;_>0;_--)Us.computePosition(t,n,!1,_,m,x),h[p++]=x.x,h[p++]=x.y,h[p++]=x.z;let b=h.length/3*2,T=Ne.createTypedArray(h.length/3,b),C=0;for(let S=0;S<h.length/3-1;S++)T[C++]=S,T[C++]=S+1;T[C++]=h.length/3-1,T[C++]=0;let A=new at({attributes:new hn,primitiveType:Me.LINES});return A.attributes.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:h}),A.indices=T,A}function U7e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=sce(e,t),s=t.height,a=t.width,c=ri.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let h=ri.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(h,u),r.attributes.position.values=f;let p=t.northCap,_=t.southCap,m=4;p&&(m-=1),_&&(m-=1);let x=(f.length/3+m)*2,b=Ne.createTypedArray(f.length/3,x);u=f.length/6;let T=0;for(let A=0;A<u-1;A++)b[T++]=A,b[T++]=A+1,b[T++]=A+u,b[T++]=A+u+1;b[T++]=u-1,b[T++]=0,b[T++]=u+u-1,b[T++]=u,b[T++]=0,b[T++]=u;let C;if(p)C=s-1;else{let A=a-1;b[T++]=A,b[T++]=A+u,C=a+s-2}if(b[T++]=C,b[T++]=C+u,!_){let A=a+C-1;b[T++]=A,b[T]=A+u}return r.indices=b,r}function QC(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,P.RADIANS_PER_DEGREE),i=y(e.ellipsoid,ee.default),o=y(e.rotation,0),r=y(e.height,0),s=y(e.extrudedHeight,r);this._rectangle=se.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}QC.packedLength=se.packedLength+ee.packedLength+5;QC.pack=function(e,t,n){return n=y(n,0),se.pack(e._rectangle,t,n),n+=se.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var ace=new se,cce=ee.clone(ee.UNIT_SPHERE),$C={rectangle:ace,ellipsoid:cce,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};QC.unpack=function(e,t,n){t=y(t,0);let i=se.unpack(e,t,ace);t+=se.packedLength;let o=ee.unpack(e,t,cce);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=se.clone(i,n._rectangle),n._ellipsoid=ee.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):($C.granularity=r,$C.height=s,$C.rotation=a,$C.extrudedHeight=c,$C.offsetAttribute=u===-1?void 0:u,new QC($C))};var z7e=new fe;QC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Us.computeOptions(t,e._granularity,e._rotation,0,V7e,z7e),o,r;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),u;if(c){if(o=U7e(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,_=new Uint8Array(p);e._offsetAttribute===sn.TOP?_=_.fill(1,0,p/2):(u=e._offsetAttribute===sn.NONE?0:1,_=_.fill(u)),o.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}let f=ae.fromRectangle3D(t,n,s,B7e),h=ae.fromRectangle3D(t,n,a,F7e);r=ae.union(f,h)}else{if(o=sce(e,i),o.attributes.position.values=ri.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===sn.NONE?0:1;let h=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=ae.fromRectangle3D(t,n,s)}return new at({attributes:o.attributes,indices:o.indices,primitiveType:Me.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var JC=QC;function tA(e){this.rectangle=se.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new d,this.northeastCornerCartesian=new d,this.westNormal=new d,this.southNormal=new d,this.eastNormal=new d,this.northNormal=new d;let t=y(e.ellipsoid,ee.WGS84);q7e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(tA.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});tA.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=wn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)};var lce=new d,t3=new d,uce=new d,H7e=new d,G7e=new d,W7e=new d,j7e=new d,wf=new fe,fce=new an(d.UNIT_X,0),eA=new pn;function q7e(e,t,n){n.cartographicToCartesian(se.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(se.northeast(t),e.northeastCornerCartesian),wf.longitude=t.west,wf.latitude=(t.south+t.north)*.5,wf.height=0;let i=n.cartographicToCartesian(wf,W7e),o=d.cross(i,d.UNIT_Z,H7e);d.normalize(o,e.westNormal),wf.longitude=t.east;let r=n.cartographicToCartesian(wf,j7e),s=d.cross(d.UNIT_Z,r,lce);d.normalize(s,e.eastNormal);let a=d.subtract(i,r,lce);d.magnitude(a)===0&&(a=d.clone(o,a));let c=d.normalize(a,G7e),u=t.south,f;if(u>0){wf.longitude=(t.west+t.east)*.5,wf.latitude=u;let x=n.cartographicToCartesian(wf,eA.origin);d.clone(c,eA.direction);let b=an.fromPointNormal(e.southwestCornerCartesian,e.westNormal,fce);Zn.rayPlane(eA,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(x,t3)}else f=n.geodeticSurfaceNormalCartographic(se.southeast(t),t3);let h=d.cross(f,a,uce);d.normalize(h,e.southNormal);let p=t.north,_;if(p<0){wf.longitude=(t.west+t.east)*.5,wf.latitude=p;let x=n.cartographicToCartesian(wf,eA.origin);d.negate(c,eA.direction);let b=an.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,fce);Zn.rayPlane(eA,b,e.northeastCornerCartesian),_=n.geodeticSurfaceNormal(x,t3)}else _=n.geodeticSurfaceNormalCartographic(se.northwest(t),t3);let m=d.cross(a,_,uce);d.normalize(m,e.northNormal)}var Y7e=new d,X7e=new d,K7e=new d(0,-1,0),Z7e=new d(0,0,-1),dce=new d;function $7e(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!se.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,_=e.eastNormal,m=e.northNormal;t.mode!==ne.SCENE3D&&(u=t.mapProjection.project(se.southwest(e.rectangle),Y7e),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(se.northeast(e.rectangle),X7e),f.z=f.y,f.y=f.x,f.x=0,h=K7e,_=d.UNIT_Y,p=Z7e,m=d.UNIT_Z);let x=d.subtract(i,u,dce),b=d.dot(x,h),T=d.dot(x,p),C=d.subtract(i,f,dce),A=d.dot(C,_),S=d.dot(C,m);b>0?r+=b*b:A>0&&(r+=A*A),T>0?r+=T*T:S>0&&(r+=S*S)}let s,a,c;if(t.mode===ne.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}tA.prototype.distanceToCamera=function(e){let t=$7e(this,e);if(e.mode===ne.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};tA.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};tA.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new JC({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new wt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Wt.fromColor(e)}});return new In({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var Md=tA;var Kw={},Q7e=new d,hce=new d,mce=new d,pce=new d,gce=new wn;Kw.validOutline=function(e){let n=wn.fromPoints(e,gce).halfAxes,i=$.getColumn(n,0,hce),o=$.getColumn(n,1,mce),r=$.getColumn(n,2,pce),s=d.magnitude(i),a=d.magnitude(o),c=d.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};Kw.computeProjectTo2DArguments=function(e,t,n,i){let o=wn.fromPoints(e,gce),r=o.halfAxes,s=$.getColumn(r,0,hce),a=$.getColumn(r,1,mce),c=$.getColumn(r,2,pce),u=d.magnitude(s),f=d.magnitude(a),h=d.magnitude(c),p=Math.min(u,f,h);if(u===0&&(f===0||h===0)||f===0&&h===0)return!1;let _,m;return(p===f||p===h)&&(_=s),p===u?_=a:p===h&&(m=a),(p===u||p===f)&&(m=c),d.normalize(_,n),d.normalize(m,i),d.clone(o.center,t),!0};function _ce(e,t,n,i,o){let r=d.subtract(e,t,Q7e),s=d.dot(n,r),a=d.dot(i,r);return U.fromElements(s,a,o)}Kw.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=_ce(i[r],e,t,n);return o}};Kw.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return _ce(i,e,t,n,o)}};var j_=Kw;function J7e(e){let t=e.length,n=new Float64Array(t*3),i=Ne.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new hn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n})});return new at({attributes:s,indices:i,primitiveType:Me.LINES})}function Ix(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Un.computeHierarchyPackedLength(t,d)+1}Ix.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new Ix(t)};Ix.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,d),t[n]=e.packedLength,t};var eqe={polygonHierarchy:{}};Ix.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new Ix(eqe)),n._polygonHierarchy=i,n.packedLength=o,n};Ix.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=bo(n,d.equalsEpsilon,!0),n.length<3||!j_.validOutline(n))return;let o=Un.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new wt({geometry:J7e(o[c])});r.push(u)}let s=Nn.combineInstances(r)[0],a=ae.fromPoints(t.positions);return new at({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Ld=Ix;var n3=new fe;function Zw(e){let t=u_.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),o=y(e.ellipsoid,ee.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=lqe(t,n,i,o);this._boundingPlanes=r;let s=hqe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=tj(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=d.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=tj(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=tj(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();n3=o.cartesianToCartographic(c,n3),n3.height=(i+n)/2,this.center=o.cartographicToCartesian(n3,c),this._boundingSphere=ae.fromPoints(s)}var tqe=new d,nqe=new fe,iqe=new d,oqe=new fe,rqe=new d,sqe=new d,aqe=new d,cqe=new d;function lqe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,tqe),a=i.cartesianToCartographic(r,nqe);a.height=n;let c=i.cartographicToCartesian(a,iqe),u=an.fromPointNormal(c,s);o[0]=u;let f=0,h,p=[],_,m;for(h=0;h<4;h++){_=e.getVertex(h),p[h]=_,m=i.cartesianToCartographic(_,oqe),m.height=t;let b=an.getPointDistance(u,i.cartographicToCartesian(m,rqe));b<f&&(f=b)}let x=an.clone(u);for(x.normal=d.negate(x.normal,x.normal),x.distance=x.distance*-1+f,o[1]=x,h=0;h<4;h++){_=p[h];let b=p[(h+1)%4],T=i.geodeticSurfaceNormal(_,sqe),C=d.subtract(b,_,cqe),A=d.cross(C,T,aqe);A=d.normalize(A,A),o[2+h]=an.fromPointNormal(_,A)}return o}var Px=new d,Rx=new d,Ox=new d,XW=new d,KW=new d,ZW=new d,uqe=new d,fqe=new d,dqe=new d,$W=new d,QW=new d,JW=new d,q_=new d,am=new $;function yce(e,t,n){Px=e.normal,Rx=t.normal,Ox=n.normal,XW=d.multiplyByScalar(e.normal,-e.distance,XW),KW=d.multiplyByScalar(t.normal,-t.distance,KW),ZW=d.multiplyByScalar(n.normal,-n.distance,ZW),$W=d.multiplyByScalar(d.cross(Rx,Ox,uqe),d.dot(XW,Px),$W),QW=d.multiplyByScalar(d.cross(Ox,Px,fqe),d.dot(KW,Rx),QW),JW=d.multiplyByScalar(d.cross(Px,Rx,dqe),d.dot(ZW,Ox),JW),am[0]=Px.x,am[1]=Rx.x,am[2]=Ox.x,am[3]=Px.y,am[4]=Rx.y,am[5]=Ox.y,am[6]=Px.z,am[7]=Rx.z,am[8]=Ox.z;let i=$.determinant(am);return q_=d.add($W,QW,q_),q_=d.add(q_,JW,q_),new d(q_.x/i,q_.y/i,q_.z/i)}function hqe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=yce(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=yce(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var ej=new d,nA=new d;function tj(e,t){let n=[];for(let i=0;i<4;i++)ej=d.subtract(t[(i+1)%4],t[i],ej),nA=d.cross(e.normal,ej,nA),nA=d.normalize(nA,nA),n[i]=d.clone(nA);return n}Object.defineProperties(Zw.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var nj=new d;Zw.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;an.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):an.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,an.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=ij(an.projectPointOntoPlane(c,t,nj),i[0],c,o),d.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=xce(t,p[0],p[1]),d.distance(a,t)}let f=Number.MAX_VALUE,h;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=ij(an.projectPointOntoPlane(c,t,nj),i[r],c,this._edgeNormals[n[r]]),h=d.distanceSquared(a,t),h<f&&(f=h);return Math.sqrt(f)}else if(n.length>3)return a=ij(an.projectPointOntoPlane(this._boundingPlanes[1],t,nj),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),d.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?d.distance(t,this._vertices[(n[1]-2+u)%4]):d.distance(t,this._vertices[4+(n[1]-2+u)%4])};var mqe=new d,pqe=new d;function xce(e,t,n){let i=d.subtract(n,t,mqe),o=d.subtract(e,t,pqe),r=d.dot(i,o);if(r<=0)return t;let s=d.dot(i,i);return r>=s?n:(r=r/s,new d((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var gqe=new an(d.UNIT_X,0);function ij(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let u=an.fromPointNormal(t[c],i[c],gqe);an.getPointDistance(u,e)<0||(a=xce(e,t[c],t[(c+1)%4]),r=d.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}Zw.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)d.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?jt.INSIDE:n===this._vertices.length?jt.OUTSIDE:jt.INTERSECTING};Zw.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new Ld({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Ld.createGeometry(n),o=new wt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Wt.fromColor(e)}}),r=new Ld({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Ld.createGeometry(r),a=new wt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Wt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Ld({polygonHierarchy:{positions:this._planeVertices[2+u]}}),h=Ld.createGeometry(f);c[u]=new wt({geometry:h,id:"outline",modelMatrix:t,attributes:{color:Wt.fromColor(e)}})}return new In({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var i3=Zw;var _qe=new d(1,1,1),o3=Math.cos,r3=Math.sin;function iA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,_qe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,P.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),u=Math.round(y(e.subdivisions,128));this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}iA.packedLength=2*d.packedLength+8;iA.pack=function(e,t,n){return n=y(n,0),d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var bce=new d,Tce=new d,Gp={radii:bce,innerRadii:Tce,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};iA.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,bce);t+=d.packedLength;let o=d.unpack(e,t,Tce);t+=d.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=h,n._offsetAttribute=p===-1?void 0:p,n):(Gp.minimumClock=r,Gp.maximumClock=s,Gp.minimumCone=a,Gp.maximumCone=c,Gp.stackPartitions=u,Gp.slicePartitions=f,Gp.subdivisions=h,Gp.offsetAttribute=p===-1?void 0:p,new iA(Gp))};iA.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ee.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-r)/P.PI),u<2&&(u=2),f<2&&(f=2);let h=0,p=1,_=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,x=!1;_&&(p=2,r>0&&(m=!0,h+=u),s<Math.PI&&(x=!0,h+=u));let b=a*p*(f+u),T=new Float64Array(b*3),C=2*(b+h-(u+f)*p),A=Ne.createTypedArray(b,C),S,v,D,O,R=0,M=new Array(f),L=new Array(f);for(S=0;S<f;S++)O=r+S*(s-r)/(f-1),M[S]=r3(O),L[S]=o3(O);let g=new Array(a),E=new Array(a);for(S=0;S<a;S++)D=i+S*(o-i)/(a-1),g[S]=r3(D),E[S]=o3(D);for(S=0;S<f;S++)for(v=0;v<a;v++)T[R++]=t.x*M[S]*E[v],T[R++]=t.y*M[S]*g[v],T[R++]=t.z*L[S];if(_)for(S=0;S<f;S++)for(v=0;v<a;v++)T[R++]=n.x*M[S]*E[v],T[R++]=n.y*M[S]*g[v],T[R++]=n.z*L[S];for(M.length=a,L.length=a,S=0;S<a;S++)O=r+S*(s-r)/(a-1),M[S]=r3(O),L[S]=o3(O);for(g.length=u,E.length=u,S=0;S<u;S++)D=i+S*(o-i)/(u-1),g[S]=r3(D),E[S]=o3(D);for(S=0;S<a;S++)for(v=0;v<u;v++)T[R++]=t.x*M[S]*E[v],T[R++]=t.y*M[S]*g[v],T[R++]=t.z*L[S];if(_)for(S=0;S<a;S++)for(v=0;v<u;v++)T[R++]=n.x*M[S]*E[v],T[R++]=n.y*M[S]*g[v],T[R++]=n.z*L[S];for(R=0,S=0;S<f*p;S++){let N=S*a;for(v=0;v<a-1;v++)A[R++]=N+v,A[R++]=N+v+1}let w=f*a*p;for(S=0;S<u;S++)for(v=0;v<a-1;v++)A[R++]=w+S+v*u,A[R++]=w+S+(v+1)*u;if(_)for(w=f*a*p+u*a,S=0;S<u;S++)for(v=0;v<a-1;v++)A[R++]=w+S+v*u,A[R++]=w+S+(v+1)*u;if(_){let N=f*a*p,B=N+a*u;if(m)for(S=0;S<u;S++)A[R++]=N+S,A[R++]=B+S;if(x)for(N+=a*u-u,B+=a*u-u,S=0;S<u;S++)A[R++]=N+S,A[R++]=B+S}let I=new hn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T})});if(l(e._offsetAttribute)){let N=T.length,B=e._offsetAttribute===sn.NONE?0:1,H=new Uint8Array(N/3).fill(B);I.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:H})}return new at({attributes:I,indices:A,primitiveType:Me.LINES,boundingSphere:ae.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Df=iA;function oA(e){let t=y(e.radius,1),i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Df(i),this._workerName="createSphereOutlineGeometry"}oA.packedLength=Df.packedLength;oA.pack=function(e,t,n){return Df.pack(e._ellipsoidGeometry,t,n)};var yqe=new Df,Mx={radius:void 0,radii:new d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};oA.unpack=function(e,t,n){let i=Df.unpack(e,t,yqe);return Mx.stackPartitions=i._stackPartitions,Mx.slicePartitions=i._slicePartitions,Mx.subdivisions=i._subdivisions,l(n)?(d.clone(i._radii,Mx.radii),n._ellipsoidGeometry=new Df(Mx),n):(Mx.radius=i._radii.x,new oA(Mx))};oA.createGeometry=function(e){return Df.createGeometry(e._ellipsoidGeometry)};var Y_=oA;function rA(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ae(e,t)}Object.defineProperties(rA.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});rA.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,d.distance(t.center,e.camera.positionWC)-t.radius)};rA.prototype.intersectPlane=function(e){return ae.intersectPlane(this._boundingSphere,e)};rA.prototype.update=function(e,t){d.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};rA.prototype.createDebugVolume=function(e){let t=new Y_({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new wt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Wt.fromColor(e)}});return new In({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var X_=rA;var xqe=new d,bqe=new d,Tqe=new d,Cqe=new d;function Lx(e,t,n){n=d.cross(e,t,n);let i=d.magnitude(n);return d.multiplyByScalar(n,P.EPSILON7/i,n)}function oj(e,t){let n=d.normalize(e,Cqe),i=d.equalsEpsilon(n,d.UNIT_X,P.EPSILON6)?d.UNIT_Y:d.UNIT_X;return Lx(e,i,t)}function Cce(e){let t=$.getColumn(e,0,xqe),n=$.getColumn(e,1,bqe),i=$.getColumn(e,2,Tqe),o=d.equals(t,d.ZERO),r=d.equals(n,d.ZERO),s=d.equals(i,d.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(o&&!r&&!s?t=Lx(n,i,t):!o&&r&&!s?n=Lx(t,i,n):!o&&!r&&s?i=Lx(n,t,i):o?r?s||(t=oj(i,t),n=Lx(i,t,n)):(t=oj(n,t),i=Lx(n,t,i)):(n=oj(t,n),i=Lx(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function sA(e,t){t=Cce(t),this._orientedBoundingBox=new wn(e,t),this._boundingSphere=ae.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(sA.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});sA.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};sA.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};sA.prototype.update=function(e,t){d.clone(e,this._orientedBoundingBox.center),t=Cce(t),$.clone(t,this._orientedBoundingBox.halfAxes),ae.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};sA.prototype.createDebugVolume=function(e){let t=new Oh({minimum:new d(-1,-1,-1),maximum:new d(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new wt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Wt.fromColor(e)}});return new In({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var If=sA;function Zo(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||oi(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=F.multiply(a,this.transform,new F),u=l(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(u,this.transform,new F),this.computedTransform=c,this.metadata=QB(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let h;l(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,Zo._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&Zo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Yo.REPLACE:Yo.ADD):l(i)?p=i.refine:p=Yo.REPLACE,this.refine=p,this.children=[],this.parent=i;let _,m=!1,x,b,T;if(t=Se.createIfNeeded(t),r)x=Ko.UNLOADED,b=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(Zo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(Zo._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),_=new Yw(e,this),m=!0,x=Ko.READY):(x=Ko.UNLOADED,b=t.getDerivedResource({url:v}),T=bc.getServerKey(b.getUrlComponent()))}else _=new Yw(e,this),m=!0,x=Ko.READY;this._content=_,this._contentResource=b,this._contentState=x,this._expiredContent=void 0,this._serverKey=T,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let C=n.expire,A,S;l(C)&&(A=C.duration,l(C.date)&&(S=Z.fromIso8601(C.date))),this.expireDuration=A,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=Od.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new Z,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Zo._deprecationWarning=_s;Object.defineProperties(Zo.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Ko.READY}},contentUnloaded:{get:function(){return this._contentState===Ko.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Ko.EXPIRED}},contentFailed:{get:function(){return this._contentState===Ko.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var K_=new d;function Aqe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=d.multiplyByScalar(s.directionWC,e._centerZDepth,K_),c=d.add(s.positionWC,a,K_),u=d.subtract(c,r,K_);if(d.magnitude(u)>o){let S=d.normalize(u,K_),v=d.multiplyByScalar(S,o,K_),D=d.add(r,v,K_),O=d.subtract(D,s.positionWC,K_),R=d.normalize(O,K_);e._foveatedFactor=1-Math.abs(d.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Yo.REPLACE,_=n.isSkippingLevelOfDetail;if(p&&!_||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&_||n._pass===Vo.PRELOAD_FLIGHT||n._pass===Vo.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*m;if(e._foveatedFactor<=x)return!1;let b=m-x,T=P.clamp((e._foveatedFactor-x)/b,0,1),C=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,T),A=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-C<=A}var vce=new Z;Zo.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,h=c.drawingBufferHeight*o,p;if(e.mode===ne.SCENE2D||u instanceof rn){let _=u.offCenterFrustum;l(_)&&(u=_);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,h);p=s/m}else{let _=Math.max(this._distanceToCamera,P.EPSILON7),m=u.sseDenominator;if(p=s*h/(_*m),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,T=P.fog(_,x)*b;p-=T}}return p/=e.pixelRatio,p};function Eqe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function Sqe(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}Zo.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:ys.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==ys.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Sqe(n,this),this._priorityProgressiveResolution=Eqe(n,this),this.priorityDeferred=Aqe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Zo.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Z.now(vce);Z.lessThan(this.expireDate,e)&&(this._contentState=Ko.EXPIRED,this._expiredContent=this._content)}};function vqe(e){if(!l(e.expireDuration))return;let t=Z.now(vce);Z.addSeconds(t,e.expireDuration,t),l(e.expireDate)?Z.lessThan(e.expireDate,t)&&Z.clone(t,e.expireDate):e.expireDate=Z.clone(t)}function wqe(e){return function(){return e._priority}}Zo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Dqe(this):Pqe(this)};function Dqe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=oi(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new JB(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Ko.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Ko.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Ko.FAILED,o})}async function Iqe(e,t,n,i,o){let r=e._contentState;e._contentState=Ko.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Kn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Ko.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Kn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await Rqe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Ko.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Ko.FAILED,a}}function Pqe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new nr({throttle:!0,throttleByServer:!0,type:ps.TILES3D,priorityFunction:wqe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return Iqe(e,o,i,n,r)}async function Rqe(e,t){let n=Hp(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===ks.GEOMETRY||n.contentType===ks.VECTOR,(n.contentType===ks.IMPLICIT_SUBTREE||n.contentType===ks.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===ks.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=XC[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=KC(i,s));let a=ZC(i,s);return l(a)&&(o.group=new nC({metadata:a})),o}Zo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Zo.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Ko.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var wce=new ae;function sj(e,t){if(t.mode!==ne.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,wce);e._boundingVolume2D=new X_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Oqe(e,t){if(t.mode!==ne.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ae.projectTo2D(n,t.mapProjection,wce);e._contentBoundingVolume2D=new X_(i.center,i.radius)}return t.mode!==ne.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Zo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=sj(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==jt.INSIDE,a===jt.OUTSIDE)return ys.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==jt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Zo.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return jt.INSIDE;if(this._visibilityPlaneMask===ys.MASK_INSIDE)return jt.INSIDE;let t=e.cullingVolume,n=Oqe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==jt.INSIDE,s===jt.OUTSIDE)return jt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==jt.OUTSIDE,s===jt.INSIDE)return jt.OUTSIDE}return t.computeVisibility(n)};Zo.prototype.distanceToTile=function(e){return sj(this,e).distanceToCamera(e)};var Mqe=new d;Zo.prototype.distanceToTileCenter=function(e){let n=sj(this,e).boundingVolume,i=d.subtract(n.center,e.camera.positionWC,Mqe);return d.dot(e.camera.directionWC,i)};Zo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Dce=new $,Ice=new d,Lqe=new $,aj=new d,Pce=new se,Rce=new wn,rj=new F;function Nqe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],aj),o=$.fromArray(e,3,Lqe);i=F.multiplyByPoint(t,i,i);let r=F.getMatrix3(t,Dce);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new If(i,o)}function Fqe(e,t,n,i){let o=se.unpack(e,0,Pce),r=e[4],s=e[5],a=wn.fromRectangle(o,r,s,ee.WGS84,Rce),c=a.center,u=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,rj),rj),c=F.multiplyByPoint(t,c,c);let f=F.getMatrix3(t,Dce);return u=$.multiply(f,u,u),l(i)&&i instanceof If?(i.update(c,u),i):new If(c,u)}function Bqe(e,t,n,i){if(!F.equalsEpsilon(t,n,P.EPSILON8))return Fqe(e,t,n,i);let o=se.unpack(e,0,Pce);return l(i)?(i.rectangle=se.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Md({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function kqe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],aj),o=e[3];i=F.multiplyByPoint(t,i,i);let r=F.getScale(t,Ice),s=d.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new X_(i,o)}Zo.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=mC.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new re("boundingVolume must be defined");if(oi(e,"3DTILES_bounding_volume_S2"))return new i3(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=Nqe(r,t,n);return this._verticalExaggeration!==1&&Ace(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=Bqe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof If?Ace(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Dr.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Dr.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ee.WGS84))),c}if(l(a)){let c=kqe(a,t,n);if(this._verticalExaggeration!==1){let u=Dr.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,aj),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new re("boundingVolume must contain a sphere, region, or box")};var Vqe=d.unpackArray(new Array(8*3).fill(0));function Ace(e,t,n){let i=e.boundingVolume.computeCorners(Vqe).map(r=>Dr.getPosition(r,ee.WGS84,t,n,r)),o=wn.fromPoints(i,Rce);e.update(o.center,o.halfAxes)}Zo.prototype.updateTransform=function(e,t){e=y(e,F.IDENTITY);let n=F.multiplyTransformation(e,this.transform,rj),i=!F.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&F.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};Zo.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,Ice),t=d.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Uqe(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Wt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function zqe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Ko.FAILED,o}}function Hqe(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function Gqe(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}Zo.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;Hqe(this,e),Gqe(this,e),Uqe(this,e,t,n),zqe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===we.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var Ece=[];Zo.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(vqe(this),this._selectedFrame=0,this.lastStyleTime=0,Z.now(this._loadTimestamp),this._contentState=Ko.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Ece;try{this._content.update(e,t)}catch(i){throw this._contentState=Ko.FAILED,i}Ece.length=0,t.commandList=n};function Sce(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function s3(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}Zo.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,u=o,f=c+u,h=r,p=Math.pow(10,f),_=f+h,m=r,x=Math.pow(10,_),b=_+m,T=Math.pow(10,b),C=s3(this._depth,n.depth,i.depth);C=t?1-C:C;let S=!e.isSkippingLevelOfDetail&&this.refine===Yo.REPLACE?s3(this._priorityHolder._distanceToCamera,n.distance,i.distance):s3(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=Sce(S,a,s),D=this._priorityProgressiveResolution?0:p,O=s3(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=Sce(O,u,c),M=this.priorityDeferred?x:0,L=e._pass===Vo.PRELOAD_FLIGHT?0:T;this._priority=C+v+D+R+M+L};Zo.prototype.isDestroyed=function(){return!1};Zo.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var Nd=Zo;function Wp(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Wp.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Wp.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};Wp.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};Wp.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};Wp.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};Wp.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};Wp.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};Wp.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var $w=Wp;function jp(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});jp.prototype.hasProperty=function(e){return Fn.hasProperty(e,this._properties,this._class)};jp.prototype.hasPropertyBySemantic=function(e){return Fn.hasPropertyBySemantic(e,this._properties,this._class)};jp.prototype.getPropertyIds=function(e){return Fn.getPropertyIds(this._properties,this._class,e)};jp.prototype.getProperty=function(e){return Fn.getProperty(e,this._properties,this._class)};jp.prototype.setProperty=function(e,t){return Fn.setProperty(e,t,this._properties,this._class)};jp.prototype.getPropertyBySemantic=function(e){return Fn.getPropertyBySemantic(e,this._properties,this._class)};jp.prototype.setPropertyBySemantic=function(e,t){return Fn.setPropertyBySemantic(e,t,this._properties,this._class)};var a3=jp;function Oce(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),o;l(i)&&(o=new a3({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new $w({group:f,class:n.classes[f.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(a.hasOwnProperty(f)){let h=a[f];s.push(new $w({id:f,group:a[f],class:n.classes[h.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Oce.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var aA=Oce;var Mce={},Wqe=new d;Mce.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof If||i instanceof Md){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Od.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof If||a instanceof Md)){e._optimChildrenWithinParent=Od.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=d.subtract(c.center,o.center,Wqe),f=d.magnitude(u);d.divideByScalar(u,f,u);let h=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(h<=p+f){e._optimChildrenWithinParent=Od.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Od.USE_OPTIMIZATION};var c3=Mce;function Qw(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(Qw.prototype,{length:{get:function(){return this._length}}});function jqe(e,t,n){this.item=e,this.previous=t,this.next=n}Qw.prototype.add=function(e){let t=new jqe(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Lce(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}Qw.prototype.remove=function(e){l(e)&&(Lce(this,e),--this._length)};Qw.prototype.splice=function(e,t){if(e===t)return;Lce(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var l3=Qw;function Nx(){this._list=new l3,this._sentinel=this._list.add(),this._trimTiles=!1}Nx.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Nx.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Nx.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Nx.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Nx.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};Nx.prototype.trim=function(){this._trimTiles=!0};var u3=Nx;function f3(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function lj(e,t){let n;return t==="_loadTimestamp"?n=Z.toDate(e).getTime():n=e,n}f3.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=lj(e,n),this._referenceMaximum[n]=lj(t,n)};function qqe(e,t){let n=e.tilePropertyName;if(l(n)){let i=lj(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var cj=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];f3.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=qqe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+P.EPSILON7,c=P.clamp(i-o,0,s)/s,u=cj.length-1,f=c*u,h=Math.floor(f),p=Math.ceil(f),_=f-h,m=cj[h],x=cj[p],b=z.clone(z.WHITE);b.red=P.lerp(m.red,x.red,_),b.green=P.lerp(m.green,x.green,_),b.blue=P.lerp(m.blue,x.blue,_),e._debugColor=b};f3.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var d3=f3;function cA(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}cA.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};cA.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};cA.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof gf))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};cA.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof gf))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};cA.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.texturesReferenceCounterById={...e.texturesReferenceCounterById},t.batchTableByteLength=e.batchTableByteLength};var Z_=cA;function Jw(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(Jw.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});Jw.prototype.makeDirty=function(){this._styleDirty=!0};Jw.prototype.resetDirty=function(){this._styleDirty=!1};Jw.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var h3=Jw;function Yqe(e,t,n){let i=oi(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!oi(o,"3DTILES_bounding_volume_S2")&&!oi(o,"3DTILES_bounding_volume_cylinder"))throw new re("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new Se({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=Xqe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Ge(a,!0));let c=new Se({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Kqe(t),this.subdivisionScheme=os[i.subdivisionScheme],this.branchingFactor=os.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Xqe(e){if(oi(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function Kqe(e){let t=Ge(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var lA=Yqe;var eD={};function Nce(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function uj(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Fce(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function fj(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}eD.encode2D=function(e,t){return(Nce(e)|Nce(t)<<1)>>>0};eD.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Fce(e),t[1]=Fce(e>>1),t};eD.encode3D=function(e,t,n){return uj(e)|uj(t)<<1|uj(n)<<2};eD.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=fj(e),t[1]=fj(e>>1),t[2]=fj(e>>2),t};var Fx=eD;function Uo(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===os.OCTREE&&(this.z=e.z)}Object.defineProperties(Uo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===os.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===os.OCTREE?Fx.encode3D(this.x,this.y,this.z):Fx.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===os.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Uo.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===os.OCTREE){let o=(this.z<<e.level)+e.z;return new Uo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Uo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Uo.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===os.OCTREE){let r=Math.floor(this.z/t);return new Uo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Uo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Uo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===os.OCTREE){let r=e.z%n;return new Uo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Uo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Uo.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===os.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Uo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Uo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Uo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Uo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Uo.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===os.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Uo.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===os.OCTREE?this.z===e.z:!0)};Uo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Uo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Uo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Uo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===os.OCTREE&&(e.z=this.z),e};var Bce=[0,0,0];Uo.fromMortonIndex=function(e,t,n,i){let o;return e===os.OCTREE?(o=Fx.decode3D(i,Bce),new Uo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Fx.decode2D(i,Bce),new Uo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Uo.fromTileIndex=function(e,t,n){let i,o,r;return e===os.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(P.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Uo.fromMortonIndex(e,t,i,r)};var uA=Uo;function qp(){}qp.selectTiles=function(e,t){he.throwInstantiationError()};qp.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};qp.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};qp.selectTile=function(e,t){if(e.contentVisibility(t)===jt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};qp.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};qp.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};qp.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Zqe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Zqe(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}qp.updateTile=function(e,t){kce(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Jqe(e),e._shouldSelect=!1,e._finalResolution=!0};function kce(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];kce(r,t),e._visible=r._visible;return}if($qe(e,t)){e._visible=!1;return}let i=e.refine===Yo.REPLACE,o=e._optimChildrenWithinParent===Od.USE_OPTIMIZATION;if(i&&o&&n&&!Qqe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function $qe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Yo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function Qqe(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function Jqe(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var oa=qp;function Vce(){}var tD={stack:new yl,stackMaximumLength:0};Vce.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=oa,s=tD.stack;for(s.push(i);s.length>0;){tD.stackMaximumLength=Math.max(tD.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Yo.ADD,u=a.refine===Yo.REPLACE,f=eYe(a);f&&tYe(a,s,t),(c||u&&!f)&&(nYe(e,a),o(a,t),iYe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return tD.stack.trim(tD.stackMaximumLength),n};function eYe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function tYe(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function nYe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function iYe(e,t){e.contentAvailable&&e.contentVisibility(t)!==jt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var m3=Vce;function Uce(){}var nD={stack:new yl,stackMaximumLength:0},iD={stack:new yl,stackMaximumLength:0};Uce.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(oa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;rYe(n,t),nD.stack.trim(nD.stackMaximumLength),iD.stack.trim(iD.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function dj(e,t){e.contentAvailable&&oa.selectTile(e,t)}function oYe(e,t,n){let i=e.refine===Yo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=oa;for(let m=0;m<r.length;++m)s(r[m],n);r.sort(oa.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,h=!1,p=-1,_=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let x=r[m];if(x.isVisible?(t.push(x),x._foveatedFactor<_&&(p=m,_=x._foveatedFactor),h=!0):(u||o.loadSiblings)&&(x._foveatedFactor<_&&(p=m,_=x._foveatedFactor),a(x,n),c(x,n)),u){let b;x._inRequestVolume?x.hasRenderableContent?b=x.contentAvailable:b=sYe(x,n):b=!1,f=f&&b}}if(h||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let x=(e._wasMinPriorityChild||e===o.root)&&_<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;x._foveatedFactor=Math.min(m._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(m._distanceToCamera,x._distanceToCamera);for(let b=0;b<r.length;++b)r[b]._priorityHolder=x}return f}function rYe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=oa,a=nD.stack;for(a.push(e);a.length>0;){nD.stackMaximumLength=Math.max(nD.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?oYe(c,a,t)&&f:!1;let h=!c._refines&&f;c.hasRenderableContent?c.refine===Yo.ADD?(dj(c,t),o(c,t)):c.refine===Yo.REPLACE&&(o(c,t),h&&dj(c,t)):(n._emptyTiles.push(c),o(c,t),h&&dj(c,t)),r(c,t),s(c,t)}}function sYe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=oa,s=!0,a=iD.stack;for(a.push(e);a.length>0;){iD.stackMaximumLength=Math.max(iD.stackMaximumLength,a.length);let c=a.pop(),u=c.children,f=u.length,h=!c.hasRenderableContent&&n(c);if(!h&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),h)for(let p=0;p<f;++p){let _=u[p];a.push(_)}}return e.hasEmptyContent||s}var p3=Uce;function zce(){}var oD={stack:new yl,stackMaximumLength:0},rD={stack:new yl,stackMaximumLength:0},Yp={stack:new yl,stackMaximumLength:0,ancestorStack:new yl,ancestorStackMaximumLength:0},aYe=2;zce.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(oa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;hYe(n,t),mYe(n,t),oD.stack.trim(oD.stackMaximumLength),rD.stack.trim(rD.stackMaximumLength),Yp.stack.trim(Yp.stackMaximumLength),Yp.ancestorStack.trim(Yp.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function cYe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=oa,r=rD.stack;for(r.push(e);r.length>0;){rD.stackMaximumLength=Math.max(rD.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<aYe&&r.push(u))}}}function g3(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:cYe(e,t)}function lYe(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function uYe(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function fYe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=oa;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(oa.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function dYe(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function hYe(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=oa,c=oD.stack;for(c.push(e);c.length>0;){oD.stackMaximumLength=Math.max(oD.stackMaximumLength,c.length);let u=c.pop();lYe(u,t);let f=u.parent,h=!l(f)||f._refines;u._refines=o(u)?fYe(u,c,t)&&h:!1;let p=!u._refines&&h;u.hasRenderableContent?u.refine===Yo.ADD?(g3(u,t),r(u,t)):u.refine===Yo.REPLACE&&(dYe(u,i)?(r(u,t),p&&g3(u,t)):p?(g3(u,t),r(u,t)):uYe(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&g3(u,t)),s(u,t),a(u,t)}}function mYe(e,t){let{selectTile:n,canTraverse:i}=oa,{stack:o,ancestorStack:r}=Yp,s;for(o.push(e);o.length>0||r.length>0;){if(Yp.stackMaximumLength=Math.max(Yp.stackMaximumLength,o.length),Yp.ancestorStackMaximumLength=Math.max(Yp.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Yo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let h=u[f];h.isVisible&&o.push(h)}}}}var _3=zce;function $o(e){e=y(e,y.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new u3,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new yl,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=y(e.cacheBytes,512*1024*1024);let t=y(e.maximumCacheOverflowBytes,512*1024*1024);this._maximumCacheOverflowBytes=t,this._styleEngine=new h3,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Z_,this._statisticsLast=new Z_,this._statisticsPerPass=new Array(Vo.NUMBER_OF_PASSES);for(let o=0;o<Vo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new Z_;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new d3(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=P.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,ee.WGS84),this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!0),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,P.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=y(e.dynamicScreenSpaceErrorDensity,2e-4),this.dynamicScreenSpaceErrorFactor=y(e.dynamicScreenSpaceErrorFactor,24),this.dynamicScreenSpaceErrorHeightFalloff=y(e.dynamicScreenSpaceErrorHeightFalloff,.25),this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,xn.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=eu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new vp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new P_,this.loadProgress=new me,this.allTilesLoaded=new me,this.initialTilesLoaded=new me,this.tileLoad=new me,this.tileUnload=new me,this.tileFailed=new me,this.tileVisible=new me,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,l(e.clippingPlanes)&&bs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&Zh.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new tC,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new S_(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,z.BLACK),this.splitDirection=y(e.splitDirection,Gr.NONE),this.enableCollision=y(e.enableCollision,!1),this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&xt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties($o.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Zh.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return _s("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,Kce(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});$o.fromIonAssetId=async function(e,t){let n=await af.fromAssetId(e);return $o.fromUrl(n,t)};$o.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await $o.loadJson(n),r=await pYe(n,o),s=new $o(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,Kce(s);let c=l(o.asset.gltfUpAxis)?No.fromName(o.asset.gltfUpAxis):No.Y,u=y(t.modelUpAxis,c),f=y(t.modelForwardAxis,No.X);s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,F.IDENTITY).boundingSphere.center,_=s._ellipsoid.cartesianToCartographic(p);return l(_)&&_.height>li._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Mt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s};$o.loadJson=function(e){return Se.createIfNeeded(e).fetchJson()};$o.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};$o.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new re("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new re("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&$o.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=Hce(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Yo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let h=u[f],p=Hce(this,e,h,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&c3.checkChildrenWithinParent(c)}return s};function Hce(e,t,n,i){if(!(l(n.implicitTiling)||oi(n,"3DTILES_implicit_tiling")))return new Nd(e,t,n,i);let r=e.schema,s=new lA(t,n,r),a=new uA({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Ge(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let h=new Nd(e,t,f,i);return h.implicitTileset=s,h.implicitCoordinates=a,h}async function pYe(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ei.getSchemaLoader({resource:e});else if(l(n.schema))i=Ei.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new aA({schema:i.schema,metadataJson:n});return Ei.unload(i),o}var Gce=new d,gYe=new fe,_Ye=new F,yYe=new d,xYe=new d,bYe=new d,TYe=new d;function CYe(e,t){let n,i,o,r,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Md)n=d.normalize(a.positionWC,Gce),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let x=F.inverseTransformation(c.computedTransform,_Ye),b=t.mapProjection.ellipsoid,T=u.boundingVolume,C=F.multiplyByPoint(x,T.center,yYe);if(d.magnitude(C)>b.minimumRadius){let A=fe.fromCartesian(C,b,gYe);n=d.normalize(a.positionWC,Gce),i=a.directionWC,o=a.positionCartographic.height,r=0,s=A.height*2}else{let A=F.multiplyByPoint(x,a.positionWC,xYe);if(n=d.UNIT_Z,i=F.multiplyByPointAsVector(x,a.directionWC,bYe),i=d.normalize(i,i),o=A.z,u instanceof If){let S=$.getColumn(T.halfAxes,2,TYe),v=d.magnitude(S);r=C.z-v,s=C.z+v}else if(u instanceof X_){let S=T.radius;r=C.z-S,s=C.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*f,p=s,_=P.clamp((o-h)/(p-h),0,1),m=1-Math.abs(d.dot(i,n));m=m*(1-_),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function AYe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{qce(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?BYe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function jce(e,t){return e._priority-t._priority}$o.prototype.postPassesUpdate=function(e){l(this._root)&&(EYe(this,e),VYe(this,e),this._cache.unloadTiles(this,Xce),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};$o.prototype.prePassesUpdate=function(e){if(!l(this._root))return;RYe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=Z.clone(e.time)),this._timeSinceLoad=Math.max(Z.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&CYe(this,e),e.newFrame&&this._cache.reset()};function EYe(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==Ko.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function SYe(e){let t=e._requestedTiles;t.sort(jce);for(let n=0;n<t.length;++n)AYe(e,t[n])}function qce(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function vYe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Ko.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var wYe=new fe,DYe=new fe,IYe=new d;function PYe(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=fe.clone(r.positionCartographic,wYe),c=fe.fromCartesian(o.center,s,DYe);l(c)&&(a.height=c.height);let u=fe.toCartesian(a,s,IYe);d.distance(u,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function RYe(e,t){vYe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,qce(f,e,u)}}e.totalMemoryUsageInBytes<i?MYe(e):a&&n.length>0&&OYe(e)}function OYe(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(jce)}function MYe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var y3=new d,LYe={maximumFractionDigits:3};function Wce(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,LYe):Math.round(t).toLocaleString()}function hj(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=d.clone(i,y3);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=d.normalize(i,y3);r=d.multiplyByScalar(r,.75*n,y3),o=d.add(r,i,y3)}return o}function mj(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=` -Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=` -Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=` -Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=` -Triangles: ${e.content.trianglesLength}`,o++),i+=` -Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=` -Texture Memory: ${Wce(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${Wce(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` -Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` -- ${s[a]}`;o+=s.length}else i+=` -Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function NYe(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:hj(e.debugPickedTile),a=mj(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];mj(a,e,hj(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&mj(a,e,hj(a))}}e._tileDebugLabels.update(t)}function FYe(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ei({stencil:0,pass:we.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:Ut.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,h=i.length;for(let m=0;m<s.length;++m){let x=s[m];f&&u.raiseEvent(x),PYe(e,x,t),x.update(e,t,n),c.incrementSelectionCounts(x.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let _=i.length-h;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,x=m.length;i.length+=x;for(let b=_-1;b>=0;--b)i[h+x+b]=i[h+b];for(let b=0;b<x;++b)i[h+b]=m[b]}_=i.length-r,c.numberOfCommands=_,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&_>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Np),NYe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Yce=[];function BYe(e,t){let n=t,i=Yce;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(kYe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Xce(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function kYe(e,t){e._cache.unloadTile(e,t,Xce),t.destroy()}$o.prototype.trimLoadedTiles=function(){this._cache.trim()};function VYe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Z_.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function UYe(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function zYe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function HYe(e,t,n,i){if(t.mode===ne.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,UYe(e),zYe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&SYe(e),FYe(e,t,i),Z_.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function Kce(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(At.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new At(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}$o.prototype.getTraversal=function(e){let{pass:t}=e;return t===Vo.MOST_DETAILED_PRELOAD||t===Vo.MOST_DETAILED_PICK?m3:this.isSkippingLevelOfDetail?_3:p3};$o.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};$o.prototype.updateForPass=function(e,t){let n=t.pass;if(n===Vo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Vo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Vo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Vo.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),u=c.length;if(e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r),s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=HYe(this,e,h,s)),a&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};$o.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};$o.prototype.isDestroyed=function(){return!1};$o.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=Yce;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,ue(this)};$o.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};$o.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!$o.supportedExtensions[e[t]])throw new re(`Unsupported 3D Tiles Extension: ${e[t]}`)};var GYe=new pn,WYe=new d,jYe=new fe;$o.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=GYe,o=n.cartographicToCartesian(e,i.direction);d.normalize(i.direction,i.direction),i.direction=d.normalize(o,i.direction),i.direction=d.negate(o,i.direction),i.origin=d.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,WYe);if(l(r))return n.cartesianToCartographic(r,jYe)?.height};$o.prototype.updateHeight=function(e,t,n){n=y(n,ee.WGS84);let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var qYe=new Wa,YYe=new d;$o.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let u=i[c],f=Zn.raySphere(e,u.contentBoundingVolume.boundingSphere,qYe);!l(f)||!l(u.content)||r.push(u)}let s=r.length;r.sort((c,u)=>{let f=ae.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),h=ae.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-h});let a;for(let c=0;c<s;++c){let f=r[c].content.pick(e,t,YYe);if(l(f))return a=d.clone(f,n),a}};var Cs=$o;var XYe=new F;function $_(e,t){t.collectionChanged.addEventListener($_.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new vt,this._onCollectionChanged(t,t.values,[],[])}$_.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),h;f&&(h=s.computeModelMatrix(e,XYe),c=Se.createIfNeeded(q.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],KYe(c,n,s,i)),l(p)&&(p.show=!0,l(h)&&(p.modelMatrix=h),p.maximumScreenSpaceError=q.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};$_.prototype.isDestroyed=function(){return!1};$_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener($_.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)pj(this,e[i],t,n);return ue(this)};$_.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return ct.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ae.clone(i.boundingSphere,t),ct.DONE):ct.FAILED:ct.PENDING};$_.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(pj(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],pj(this,r,a,c),s.remove(r.id)};function pj(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function KYe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await Cs.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var x3=$_;var ZYe=z.WHITE,$Ye=z.BLACK,QYe=new U(2,2);function fA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(fA.prototype,{isConstant:{get:function(){return q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});fA.prototype.getType=function(e){return"Checkerboard"};var JYe=new Z;fA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(JYe)),l(t)||(t={}),t.lightColor=q.getValueOrClonedDefault(this._evenColor,e,ZYe,t.lightColor),t.darkColor=q.getValueOrClonedDefault(this._oddColor,e,$Ye,t.darkColor),t.repeat=q.getValueOrDefault(this._repeat,e,QYe),t};fA.prototype.equals=function(e){return this===e||e instanceof fA&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._repeat,e._repeat)};var sD=fA;var Zce={id:void 0};function aD(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function tc(e){this._owner=e,this._entities=new vt,this._addedEntities=new vt,this._removedEntities=new vt,this._changedEntities=new vt,this._suspendCount=0,this._collectionChanged=new me,this._id=zn(),this._show=!0,this._firing=!1,this._refire=!1}tc.prototype.suspendEvents=function(){this._suspendCount++};tc.prototype.resumeEvents=function(){this._suspendCount--,aD(this)};Object.defineProperties(tc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});tc.prototype.computeAvailability=function(){let e=He.MAXIMUM_VALUE,t=He.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;Z.lessThan(a,e)&&!a.equals(He.MINIMUM_VALUE)&&(e=a),Z.greaterThan(c,t)&&!c.equals(He.MAXIMUM_VALUE)&&(t=c)}}return He.MAXIMUM_VALUE.equals(e)&&(e=He.MINIMUM_VALUE),He.MINIMUM_VALUE.equals(t)&&(t=He.MAXIMUM_VALUE),new En({start:e,stop:t})};tc.prototype.add=function(e){e instanceof or||(e=new or(e));let t=e.id,n=this._entities;if(n.contains(t))throw new he(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(tc.prototype._onEntityDefinitionChanged,this),aD(this),e};tc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};tc.prototype.contains=function(e){return this._entities.get(e.id)===e};tc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(tc.prototype._onEntityDefinitionChanged,this),aD(this),!0):!1};tc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(tc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),aD(this)};tc.prototype.getById=function(e){return this._entities.get(e)};tc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Zce.id=e,t=new or(Zce),this.add(t)),t};tc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),aD(this)};var ra=tc;var b3={id:void 0},dA=new Array(2);function gj(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function $ce(e,t,n,i){dA[0]=n,dA[1]=i.id,t[JSON.stringify(dA)]=i.definitionChanged.addEventListener(Nr.prototype._onDefinitionChanged,e)}function Qce(e,t,n,i){dA[0]=n,dA[1]=i.id;let o=JSON.stringify(dA);t[o](),t[o]=void 0}function Q_(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,u,f=e._composite,h=new ra(e),p=e._eventHash,_;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(Nr.prototype._onCollectionChanged,e),a=u.values,_=u.id,c=a.length-1;c>-1;c--)s=a[c],Qce(e,p,_,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(Nr.prototype._onCollectionChanged,e),a=u.values,_=u.id,c=a.length-1;c>-1;c--){s=a[c],$ce(e,p,_,s);let x=h.getById(s.id);l(x)||(x=f.getById(s.id),l(x)?gj(x):(b3.id=s.id,x=new or(b3)),h.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=h.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function Nr(e,t){this._owner=t,this._composite=new ra(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=zn(),this._eventHash={},Q_(this),this._shouldRecomposite=!1}Object.defineProperties(Nr.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Nr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),Q_(this)};Nr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Q_(this),!0):!1};Nr.prototype.removeAllCollections=function(){this._collections.length=0,Q_(this)};Nr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Nr.prototype.contains=function(e){return this._composite.contains(e)};Nr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Nr.prototype.getCollection=function(e){return this._collections[e]};Nr.prototype.getCollectionsLength=function(){return this._collections.length};function T3(e,t){return e.indexOf(t)}function Jce(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,Q_(e)}Nr.prototype.raiseCollection=function(e){let t=T3(this._collections,e);Jce(this,t,t+1)};Nr.prototype.lowerCollection=function(e){let t=T3(this._collections,e);Jce(this,t,t-1)};Nr.prototype.raiseCollectionToTop=function(e){let t=T3(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Q_(this))};Nr.prototype.lowerCollectionToBottom=function(e){let t=T3(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Q_(this))};Nr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Nr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Q_(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Nr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Nr.prototype.getById=function(e){return this._composite.getById(e)};Nr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,u,f=n.length,h=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];Qce(this,h,p,m);let x=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),gj(u)),u.merge(c));l(u)||r.removeById(x),u=void 0}let _=t.length;for(s=0;s<_;s++){let m=t[s];$ce(this,h,p,m);let x=m.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(u)||(u=r.getById(x),l(u)?gj(u):(b3.id=x,u=new or(b3),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};Nr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),u=c[t],f=!l(u),h=!0;for(let p=s-1;p>=0;p--){let _=o[p].getById(e.id);if(l(_)){let m=_[t];if(l(m)){if(h)if(h=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var ele=Nr;function _j(){this._removalFunctions=[]}_j.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};_j.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var _r=_j;function bj(e,t){return Z.compare(e.start,t.start)}function Fr(e){if(this._intervals=[],this._changedEvent=new me,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Fr.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Fr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Fr))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!En.equals(n[r],i[r],t))return!1;return!0};Fr.prototype.get=function(e){return this._intervals[e]};Fr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Fr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Fr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Fr.prototype.contains=function(e){return this.indexOf(e)>=0};var yj=new En;Fr.prototype.indexOf=function(e){let t=this._intervals;yj.start=e,yj.stop=e;let n=Oo(t,yj,bj);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&En.contains(t[n-1],e)?n-1:~n)};Fr.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};Fr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||Z.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Oo(n,e,bj);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=Z.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(Z.greaterThan(e.stop,n[i-1].stop)?e=new En({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new En({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=Z.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new En({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new En({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=Z.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new En({start:e.start,stop:Z.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:Z.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new En({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Fr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Oo(t,e,bj);n<0&&(n=~n);let i=!1;for(n>0&&(Z.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(Z.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new En({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new En({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new En({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&Z.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new En({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new En({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(Z.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new En({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Fr.prototype.intersect=function(e,t,n){let i=new Fr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],u=a[r];if(Z.lessThan(c.stop,u.start))++o;else if(Z.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=En.intersect(c,u,new En,n);f.isEmpty||i.addInterval(f,t)}Z.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};Fr.fromJulianDateArray=function(e,t){l(t)||(t=new Fr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),u,f=0;a&&(++f,u=new En({start:He.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let h=0;h<i-1;++h){let p=n[h],_=n[h+1];u=new En({start:p,stop:_,isStartIncluded:t.length===f?r:!0,isStopIncluded:h===i-2?s:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),p=_}return c&&(u=new En({start:n[i-1],stop:He.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var nc=new Rg,cD=[0,31,28,31,30,31,30,31,31,30,31,30,31];function xj(e,t,n){l(n)||(n=new Z),Z.toGregorianDate(e,nc);let i=nc.millisecond+t.millisecond,o=nc.second+t.second,r=nc.minute+t.minute,s=nc.hour+t.hour,a=nc.day+t.day,c=nc.month+t.month,u=nc.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),cD[2]=xh(u)?29:28;a>cD[c]||c>=13;)a>cD[c]&&(a-=cD[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),cD[2]=xh(u)?29:28;return nc.millisecond=i,nc.second=o,nc.minute=r,nc.hour=s,nc.day=a,nc.month=c,nc.year=u,Z.fromGregorianDate(nc,n)}var eXe=new Z,tXe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function tle(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(tXe);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),Z.toGregorianDate(Z.fromIso8601(e,eXe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var lD=new Rg;Fr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=Z.fromIso8601(n[0]),o=Z.fromIso8601(n[1]),r=[];if(!tle(n[2],lD))r.push(i,o);else{let s=Z.clone(i);for(r.push(s);Z.compare(s,o)<0;)s=xj(s,lD),Z.compare(o,s)<=0&&Z.clone(o,s),r.push(s)}return Fr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Fr.fromIso8601DateArray=function(e,t){return Fr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return Z.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Fr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let u=0;u<c;++u)(tle(i[u],lD)||u===0)&&(o&&l(a)?s=xj(a,lD):s=xj(n,lD),r.push(s),a=s);return Fr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Yr=Fr;function nXe(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function Bx(){this._eventHelper=new _r,this._definitionChanged=new me,this._intervals=new Yr,this._intervals.changedEvent.addEventListener(Bx.prototype._intervalsChanged,this)}Object.defineProperties(Bx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var iXe=new Z;Bx.prototype.getValue=function(e,t){l(e)||(e=Z.now(iXe));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Bx.prototype.equals=function(e){return this===e||e instanceof Bx&&this._intervals.equals(e._intervals,q.equals)};Bx.prototype._intervalsChanged=function(){nXe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var zc=Bx;function J_(){this._definitionChanged=new me,this._composite=new zc,this._composite.definitionChanged.addEventListener(J_.prototype._raiseDefinitionChanged,this)}Object.defineProperties(J_.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});J_.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var oXe=new Z;J_.prototype.getValue=function(e,t){l(e)||(e=Z.now(oXe));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};J_.prototype.equals=function(e){return this===e||e instanceof J_&&this._composite.equals(e._composite,q.equals)};J_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var uD=J_;function ey(e){this._referenceFrame=y(e,Ui.FIXED),this._definitionChanged=new me,this._composite=new zc,this._composite.definitionChanged.addEventListener(ey.prototype._raiseDefinitionChanged,this)}Object.defineProperties(ey.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var rXe=new Z;ey.prototype.getValue=function(e,t){return l(e)||(e=Z.now(rXe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};ey.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};ey.prototype.equals=function(e){return this===e||e instanceof ey&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,q.equals)};ey.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Sa=ey;var sXe={ROUNDED:0,MITERED:1,BEVELED:2},Ni=Object.freeze(sXe);var sa=[new d,new d],aXe=new d,cXe=new d,lXe=new d,uXe=new d,fXe=new d,dXe=new d,hXe=new d,mXe=new d,pXe=new d,hA=new d,C3=new d,fD={},Tj=new fe;function gXe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];Tj=t.cartesianToCartographic(o,Tj),n[i]=Tj.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function Cj(e,t,n,i){let o=e[0],r=e[1],s=d.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let h=(n-t)/a;for(u=1;u<a;u++){let p=t+u*h;c[u]=p}return c[0]=t,c.push(n),c}var A3=new d,E3=new d;function _Xe(e,t,n,i){let o=new ns(n,i),r=o.projectPointOntoPlane(d.add(n,e,A3),A3),s=o.projectPointOntoPlane(d.add(n,t,E3),E3),a=U.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var yXe=new d(-1,0,0),kx=new F,xXe=new F,Aj=new $,bXe=$.IDENTITY.clone(),TXe=new d,CXe=new oe,nle=new d;function Xp(e,t,n,i,o,r,s,a){let c=TXe,u=CXe;kx=Mt.eastNorthUpToFixedFrame(e,o,kx),c=F.multiplyByPointAsVector(kx,yXe,c),c=d.normalize(c,c);let f=_Xe(c,t,e,o);Aj=$.fromRotationZ(f,Aj),nle.z=r,kx=F.multiplyTransformation(kx,F.fromRotationTranslation(Aj,nle,xXe),kx);let h=bXe;h[0]=s;for(let p=0;p<a;p++)for(let _=0;_<n.length;_+=3)u=d.fromArray(n,_,u),u=$.multiplyByVector(h,u,u),u=F.multiplyByPoint(kx,u,u),i.push(u.x,u.y,u.z);return i}var AXe=new d;function Ej(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=d.fromArray(e,a,AXe);i=Xp(c,t,n,i,o,r[a/3],s,1)}return i}function EXe(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function ile(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var ole=new Oe,rle=new d,sle=new $;function ale(e,t,n,i,o,r,s,a,c,u){let f=d.angleBetween(d.subtract(t,e,hA),d.subtract(n,e,C3)),h=i===Ni.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;o?p=$.fromQuaternion(Oe.fromAxisAngle(d.negate(e,hA),f/(h+1),ole),sle):p=$.fromQuaternion(Oe.fromAxisAngle(e,f/(h+1),ole),sle);let _,m;if(t=d.clone(t,rle),h>0){let x=u?2:1;for(let b=0;b<h;b++)t=$.multiplyByVector(p,t,t),_=d.subtract(t,e,hA),_=d.normalize(_,_),o||(_=d.negate(_,_)),m=r.scaleToGeodeticSurface(t,C3),s=Xp(m,_,a,s,r,c,1,x)}else _=d.subtract(t,e,hA),_=d.normalize(_,_),o||(_=d.negate(_,_)),m=r.scaleToGeodeticSurface(t,C3),s=Xp(m,_,a,s,r,c,1,1),n=d.clone(n,rle),_=d.subtract(n,e,hA),_=d.normalize(_,_),o||(_=d.negate(_,_)),m=r.scaleToGeodeticSurface(n,C3),s=Xp(m,_,a,s,r,c,1,1);return s}fD.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];U.equals(r,s)||n.push(s)}return n};fD.angleIsGreaterThanPi=function(e,t,n,i){let o=new ns(n,i),r=o.projectPointOntoPlane(d.add(n,e,A3),A3),s=o.projectPointOntoPlane(d.add(n,t,E3),E3);return s.x*r.y-s.y*r.x>=0};var SXe=new d,vXe=new d;fD.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=gXe(e,r),a=i._granularity,c=i._cornerType,u=o?EXe(t,n):ile(t,n),f=o?ile(t,n):void 0,h=n.height/2,p=n.width/2,_=e.length,m=[],x=o?[]:void 0,b=aXe,T=cXe,C=lXe,A=uXe,S=fXe,v=dXe,D=hXe,O=mXe,R=pXe,M=e[0],L=e[1];A=r.geodeticSurfaceNormal(M,A),b=d.subtract(L,M,b),b=d.normalize(b,b),O=d.cross(A,b,O),O=d.normalize(O,O);let g=s[0],E=s[1];o&&(x=Xp(M,O,f,x,r,g+h,1,1)),R=d.clone(M,R),M=L,T=d.negate(b,T);let w,I;for(let H=1;H<_-1;H++){let V=o?2:1;if(L=e[H+1],M.equals(L)){xt("Positions are too close and are considered equivalent with rounding error.");continue}b=d.subtract(L,M,b),b=d.normalize(b,b),A=r.geodeticSurfaceNormal(M,A);let G=d.multiplyByScalar(A,d.dot(b,A),SXe);d.subtract(b,G,G),d.normalize(G,G);let k=d.multiplyByScalar(A,d.dot(T,A),vXe);if(d.subtract(T,k,k),d.normalize(k,k),!P.equalsEpsilon(Math.abs(d.dot(G,k)),1,P.EPSILON7)){C=d.add(b,T,C),C=d.normalize(C,C),C=d.cross(C,A,C),C=d.cross(A,C,C),C=d.normalize(C,C);let Y=1/Math.max(.25,d.magnitude(d.cross(C,T,hA))),J=fD.angleIsGreaterThanPi(b,T,M,r);J?(S=d.add(M,d.multiplyByScalar(C,Y*p,C),S),v=d.add(S,d.multiplyByScalar(O,p,v),v),sa[0]=d.clone(R,sa[0]),sa[1]=d.clone(v,sa[1]),w=Cj(sa,g+h,E+h,a),I=Li.generateArc({positions:sa,granularity:a,ellipsoid:r}),m=Ej(I,O,u,m,r,w,1),O=d.cross(A,b,O),O=d.normalize(O,O),D=d.add(S,d.multiplyByScalar(O,p,D),D),c===Ni.ROUNDED||c===Ni.BEVELED?ale(S,v,D,c,J,r,m,u,E+h,o):(C=d.negate(C,C),m=Xp(M,C,u,m,r,E+h,Y,V)),R=d.clone(D,R)):(S=d.add(M,d.multiplyByScalar(C,Y*p,C),S),v=d.add(S,d.multiplyByScalar(O,-p,v),v),sa[0]=d.clone(R,sa[0]),sa[1]=d.clone(v,sa[1]),w=Cj(sa,g+h,E+h,a),I=Li.generateArc({positions:sa,granularity:a,ellipsoid:r}),m=Ej(I,O,u,m,r,w,1),O=d.cross(A,b,O),O=d.normalize(O,O),D=d.add(S,d.multiplyByScalar(O,-p,D),D),c===Ni.ROUNDED||c===Ni.BEVELED?ale(S,v,D,c,J,r,m,u,E+h,o):m=Xp(M,C,u,m,r,E+h,Y,V),R=d.clone(D,R)),T=d.negate(b,T)}else m=Xp(R,O,u,m,r,g+h,1,1),R=M;g=E,E=s[H+1],M=L}sa[0]=d.clone(R,sa[0]),sa[1]=d.clone(M,sa[1]),w=Cj(sa,g+h,E+h,a),I=Li.generateArc({positions:sa,granularity:a,ellipsoid:r}),m=Ej(I,O,u,m,r,w,1),o&&(x=Xp(M,O,f,x,r,E+h,1,1)),_=m.length;let N=o?_+x.length:_,B=new Float64Array(N);return B.set(m),o&&B.set(x,_),B};var cm=fD;var vj={},mA=new d,dle=new d,wXe=new d,cle=new d,Hc=[new d,new d],hle=new d,mle=new d,ple=new d,DXe=new d,IXe=new d,PXe=new d,RXe=new d,OXe=new d,MXe=new d,LXe=new d,lle=new Oe,ule=new $;function S3(e,t,n,i,o){let r=d.angleBetween(d.subtract(t,e,mA),d.subtract(n,e,dle)),s=i===Ni.BEVELED?1:Math.ceil(r/P.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;o?u=$.fromQuaternion(Oe.fromAxisAngle(d.negate(e,mA),r/s,lle),ule):u=$.fromQuaternion(Oe.fromAxisAngle(e,r/s,lle),ule);let f=0;t=d.clone(t,mA);for(let h=0;h<s;h++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function NXe(e){let t=hle,n=mle,i=ple,o=e[1];n=d.fromArray(e[1],o.length-3,n),i=d.fromArray(e[0],0,i),t=d.midpoint(n,i,t);let r=S3(t,n,i,Ni.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=d.fromArray(a,a.length-3,n),i=d.fromArray(o,0,i),t=d.midpoint(n,i,t);let c=S3(t,n,i,Ni.ROUNDED,!1);return[r,c]}function fle(e,t,n,i){let o=mA;return i?o=d.add(e,t,o):(t=d.negate(t,t),o=d.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function Sj(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=d.multiplyByScalar(t,n,mA),a=d.negate(s,dle),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let h=d.fromArray(e,f,wXe),p=d.add(h,a,cle);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let _=d.add(h,s,cle);r[u--]=_.z,r[u--]=_.y,r[u--]=_.x}return i.push(o,r),i}vj.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var FXe=new d,BXe=new d;vj.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=hle,c=mle,u=ple,f=DXe,h=IXe,p=PXe,_=RXe,m=OXe,x=MXe,b=LXe,T=[],C=s?[]:void 0,A=s?[]:void 0,S=n[0],v=n[1];c=d.normalize(d.subtract(v,S,c),c),a=i.geodeticSurfaceNormal(S,a),f=d.normalize(d.cross(a,c,f),f),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),_=d.clone(S,_),S=v,u=d.negate(c,u);let D,O=[],R,M=n.length;for(R=1;R<M-1;R++){a=i.geodeticSurfaceNormal(S,a),v=n[R+1],c=d.normalize(d.subtract(v,S,c),c);let g=d.multiplyByScalar(a,d.dot(c,a),FXe);d.subtract(c,g,g),d.normalize(g,g);let E=d.multiplyByScalar(a,d.dot(u,a),BXe);if(d.subtract(u,E,E),d.normalize(E,E),!P.equalsEpsilon(Math.abs(d.dot(g,E)),1,P.EPSILON7)){h=d.normalize(d.add(c,u,h),h),h=d.cross(h,a,h),h=d.cross(a,h,h),h=d.normalize(h,h);let I=o/Math.max(.25,d.magnitude(d.cross(h,u,mA))),N=cm.angleIsGreaterThanPi(c,u,S,i);h=d.multiplyByScalar(h,I,h),N?(m=d.add(S,h,m),b=d.add(m,d.multiplyByScalar(f,o,b),b),x=d.add(m,d.multiplyByScalar(f,o*2,x),x),Hc[0]=d.clone(_,Hc[0]),Hc[1]=d.clone(b,Hc[1]),D=Li.generateArc({positions:Hc,granularity:t,ellipsoid:i}),T=Sj(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),p=d.clone(x,p),f=d.normalize(d.cross(a,c,f),f),x=d.add(m,d.multiplyByScalar(f,o*2,x),x),_=d.add(m,d.multiplyByScalar(f,o,_),_),r===Ni.ROUNDED||r===Ni.BEVELED?O.push({leftPositions:S3(m,p,x,r,N)}):O.push({leftPositions:fle(S,d.negate(h,h),x,N)})):(x=d.add(S,h,x),b=d.add(x,d.negate(d.multiplyByScalar(f,o,b),b),b),m=d.add(x,d.negate(d.multiplyByScalar(f,o*2,m),m),m),Hc[0]=d.clone(_,Hc[0]),Hc[1]=d.clone(b,Hc[1]),D=Li.generateArc({positions:Hc,granularity:t,ellipsoid:i}),T=Sj(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z)),p=d.clone(m,p),f=d.normalize(d.cross(a,c,f),f),m=d.add(x,d.negate(d.multiplyByScalar(f,o*2,m),m),m),_=d.add(x,d.negate(d.multiplyByScalar(f,o,_),_),_),r===Ni.ROUNDED||r===Ni.BEVELED?O.push({rightPositions:S3(x,p,m,r,N)}):O.push({rightPositions:fle(S,h,m,N)})),u=d.negate(c,u)}S=v}a=i.geodeticSurfaceNormal(S,a),Hc[0]=d.clone(_,Hc[0]),Hc[1]=d.clone(S,Hc[1]),D=Li.generateArc({positions:Hc,granularity:t,ellipsoid:i}),T=Sj(D,f,o,T),s&&(C.push(f.x,f.y,f.z),A.push(a.x,a.y,a.z));let L;return r===Ni.ROUNDED&&(L=NXe(T)),{positions:T,corners:O,lefts:C,normals:A,endPositions:L}};var Hi=vj;var yle=new d,xle=new d,v3=new d,w3=new d,kXe=new d,ble=new d,ty=new d,pA=new d;function Tle(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Fd(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,u=d.normalize(d.cross(n,t,ty),ty);r.normal&&Hi.addAttribute(s,t,i,o),r.tangent&&Hi.addAttribute(a,u,i,o),r.bitangent&&Hi.addAttribute(c,n,i,o)}function Cle(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new hn,u,f=0,h=0,p,_=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,_+=m*2,h+=i[p+1].length-3;for(f+=3,h+=3,p=0;p<o.length;p++){u=o[p];let Q=o[p].leftPositions;l(Q)?(m=Q.length,f+=m,_+=m):(m=o[p].rightPositions.length,h+=m,_+=m)}let x=l(r),b;x&&(b=r[0].length-3,f+=b,h+=b,b/=3,_+=b*6);let T=f+h,C=new Float64Array(T),A=t.normal?new Float32Array(T):void 0,S=t.tangent?new Float32Array(T):void 0,v=t.bitangent?new Float32Array(T):void 0,D={normals:A,tangents:S,bitangents:v},O=0,R=T-1,M,L,g,E,w=yle,I=xle,N,B,H=b/2,V=Ne.createTypedArray(T/3,_),G=0;if(x){B=v3,N=w3;let Q=r[0];for(w=d.fromArray(a,0,w),I=d.fromArray(s,0,I),p=0;p<H;p++)B=d.fromArray(Q,(H-1-p)*3,B),N=d.fromArray(Q,(H+p)*3,N),Hi.addAttribute(C,N,O),Hi.addAttribute(C,B,void 0,R),Fd(D,w,I,O,R,t),L=O/3,E=L+1,M=(R-2)/3,g=M-1,V[G++]=M,V[G++]=L,V[G++]=g,V[G++]=g,V[G++]=L,V[G++]=E,O+=3,R-=3}let k=0,W=0,Y=i[k++],J=i[k++];C.set(Y,O),C.set(J,R-J.length+1),I=d.fromArray(s,W,I);let j,K;for(m=J.length-3,p=0;p<m;p+=3)j=n.geodeticSurfaceNormal(d.fromArray(Y,p,ty),ty),K=n.geodeticSurfaceNormal(d.fromArray(J,m-p,pA),pA),w=d.normalize(d.add(j,K,w),w),Fd(D,w,I,O,R,t),L=O/3,E=L+1,M=(R-2)/3,g=M-1,V[G++]=M,V[G++]=L,V[G++]=g,V[G++]=g,V[G++]=L,V[G++]=E,O+=3,R-=3;for(j=n.geodeticSurfaceNormal(d.fromArray(Y,m,ty),ty),K=n.geodeticSurfaceNormal(d.fromArray(J,m,pA),pA),w=d.normalize(d.add(j,K,w),w),W+=3,p=0;p<o.length;p++){let Q;u=o[p];let de=u.leftPositions,ye=u.rightPositions,ce,ge,xe=ble,De=v3,Ae=w3;if(w=d.fromArray(a,W,w),l(de)){for(Fd(D,w,I,void 0,R,t),R-=3,ce=E,ge=g,Q=0;Q<de.length/3;Q++)xe=d.fromArray(de,Q*3,xe),V[G++]=ce,V[G++]=ge-Q-1,V[G++]=ge-Q,Hi.addAttribute(C,xe,void 0,R),De=d.fromArray(C,(ge-Q-1)*3,De),Ae=d.fromArray(C,ce*3,Ae),I=d.normalize(d.subtract(De,Ae,I),I),Fd(D,w,I,void 0,R,t),R-=3;xe=d.fromArray(C,ce*3,xe),De=d.subtract(d.fromArray(C,ge*3,De),xe,De),Ae=d.subtract(d.fromArray(C,(ge-Q)*3,Ae),xe,Ae),I=d.normalize(d.add(De,Ae,I),I),Fd(D,w,I,O,void 0,t),O+=3}else{for(Fd(D,w,I,O,void 0,t),O+=3,ce=g,ge=E,Q=0;Q<ye.length/3;Q++)xe=d.fromArray(ye,Q*3,xe),V[G++]=ce,V[G++]=ge+Q,V[G++]=ge+Q+1,Hi.addAttribute(C,xe,O),De=d.fromArray(C,ce*3,De),Ae=d.fromArray(C,(ge+Q)*3,Ae),I=d.normalize(d.subtract(De,Ae,I),I),Fd(D,w,I,O,void 0,t),O+=3;xe=d.fromArray(C,ce*3,xe),De=d.subtract(d.fromArray(C,(ge+Q)*3,De),xe,De),Ae=d.subtract(d.fromArray(C,ge*3,Ae),xe,Ae),I=d.normalize(d.negate(d.add(Ae,De,I),I),I),Fd(D,w,I,void 0,R,t),R-=3}for(Y=i[k++],J=i[k++],Y.splice(0,3),J.splice(J.length-3,3),C.set(Y,O),C.set(J,R-J.length+1),m=J.length-3,W+=3,I=d.fromArray(s,W,I),Q=0;Q<J.length;Q+=3)j=n.geodeticSurfaceNormal(d.fromArray(Y,Q,ty),ty),K=n.geodeticSurfaceNormal(d.fromArray(J,m-Q,pA),pA),w=d.normalize(d.add(j,K,w),w),Fd(D,w,I,O,R,t),E=O/3,L=E-1,g=(R-2)/3,M=g+1,V[G++]=M,V[G++]=L,V[G++]=g,V[G++]=g,V[G++]=L,V[G++]=E,O+=3,R-=3;O-=3,R+=3}if(w=d.fromArray(a,a.length-3,w),Fd(D,w,I,O,R,t),x){O+=3,R-=3,B=v3,N=w3;let Q=r[1];for(p=0;p<H;p++)B=d.fromArray(Q,(b-p-1)*3,B),N=d.fromArray(Q,p*3,N),Hi.addAttribute(C,B,void 0,R),Hi.addAttribute(C,N,O),Fd(D,w,I,O,R,t),E=O/3,L=E-1,g=(R-2)/3,M=g+1,V[G++]=M,V[G++]=L,V[G++]=g,V[G++]=g,V[G++]=L,V[G++]=E,O+=3,R-=3}if(c.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:C}),t.st){let Q=new Float32Array(T/3*2),de,ye,ce=0;if(x){f/=3,h/=3;let ge=Math.PI/(b+1);ye=1/(f-b+1),de=1/(h-b+1);let xe,De=b/2;for(p=De+1;p<b+1;p++)xe=P.PI_OVER_TWO+ge*p,Q[ce++]=de*(1+Math.cos(xe)),Q[ce++]=.5*(1+Math.sin(xe));for(p=1;p<h-b+1;p++)Q[ce++]=p*de,Q[ce++]=0;for(p=b;p>De;p--)xe=P.PI_OVER_TWO-p*ge,Q[ce++]=1-de*(1+Math.cos(xe)),Q[ce++]=.5*(1+Math.sin(xe));for(p=De;p>0;p--)xe=P.PI_OVER_TWO-ge*p,Q[ce++]=1-ye*(1+Math.cos(xe)),Q[ce++]=.5*(1+Math.sin(xe));for(p=f-b;p>0;p--)Q[ce++]=p*ye,Q[ce++]=1;for(p=1;p<De+1;p++)xe=P.PI_OVER_TWO+ge*p,Q[ce++]=ye*(1+Math.cos(xe)),Q[ce++]=.5*(1+Math.sin(xe))}else{for(f/=3,h/=3,ye=1/(f-1),de=1/(h-1),p=0;p<h;p++)Q[ce++]=p*de,Q[ce++]=0;for(p=f;p>0;p--)Q[ce++]=(p-1)*ye,Q[ce++]=1}c.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:Q})}return t.normal&&(c.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.normals})),t.tangent&&(c.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.tangents})),t.bitangent&&(c.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:D.bitangents})),{attributes:c,indices:V}}function VXe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,h=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,_=yle,m=xle,x=v3,b=w3,T=kXe,C=ble,A=c;for(u=0;u<s;u+=3){let S=A+c;_=d.fromArray(n,u,_),m=d.fromArray(n,u+s,m),x=d.fromArray(n,(u+3)%s,x),m=d.subtract(m,_,m),x=d.subtract(x,_,x),b=d.normalize(d.cross(m,x,b),b),t.normal&&(Hi.addAttribute(f,b,S),Hi.addAttribute(f,b,S+3),Hi.addAttribute(f,b,A),Hi.addAttribute(f,b,A+3)),(t.tangent||t.bitangent)&&(C=d.fromArray(i,u,C),t.bitangent&&(Hi.addAttribute(p,C,S),Hi.addAttribute(p,C,S+3),Hi.addAttribute(p,C,A),Hi.addAttribute(p,C,A+3)),t.tangent&&(T=d.normalize(d.cross(C,b,T),T),Hi.addAttribute(h,T,S),Hi.addAttribute(h,T,S+3),Hi.addAttribute(h,T,A),Hi.addAttribute(h,T,A+3))),A+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let S=e.tangent.values;h.set(S),h.set(S,s),e.tangent.values=h}}if(t.st){let f=e.st.values,h=new Float32Array(a*6);h.set(f),h.set(f,a);let p=a*2;for(let _=0;_<2;_++){for(h[p++]=f[0],h[p++]=f[1],u=2;u<a;u+=2){let m=f[u],x=f[u+1];h[p++]=m,h[p++]=x,h[p++]=m,h[p++]=x}h[p++]=f[0],h[p++]=f[1]}e.st.values=h}return e}function wj(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function UXe(e,t){let n=new Ie({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=Hi.computePositions(e),r=Cle(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,h=f.length,p=new Float64Array(h*6),_=new Float64Array(h);_.set(f);let m=new Float64Array(h*4);f=ri.scaleToGeodeticHeight(f,s,i),m=wj(f,0,m),_=ri.scaleToGeodeticHeight(_,a,i),m=wj(_,h*2,m),p.set(f),p.set(_,h),p.set(m,h*2),c.position.values=p,c=VXe(c,t);let x,b=h/3;if(e.shadowVolume){let M=c.normal.values;h=M.length;let L=new Float32Array(h*6);for(x=0;x<h;x++)M[x]=-M[x];L.set(M,h),L=wj(M,h*4,L),c.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let M=new Uint8Array(b*6);if(e.offsetAttribute===sn.TOP)M=M.fill(1,0,b).fill(1,b*2,b*4);else{let L=e.offsetAttribute===sn.NONE?0:1;M=M.fill(L)}c.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}let T=u.length,C=b+b,A=Ne.createTypedArray(p.length/3,T*2+C*3);A.set(u);let S=T;for(x=0;x<T;x+=3){let M=u[x],L=u[x+1],g=u[x+2];A[S++]=g+b,A[S++]=L+b,A[S++]=M+b}let v,D,O,R;for(x=0;x<C;x+=2)v=x+C,D=v+C,O=v+1,R=D+1,A[S++]=v,A[S++]=D,A[S++]=O,A[S++]=O,A[S++]=D,A[S++]=R;return{attributes:c,indices:A}}var gle=new d,dD=new d,Rf=new fe;function _le(e,t,n,i,o,r){let s=d.subtract(t,e,gle);d.normalize(s,s);let a=n.geodeticSurfaceNormal(e,dD),c=d.cross(s,a,gle);d.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,h=r.latitude,p=r.longitude;d.add(e,c,dD),n.cartesianToCartographic(dD,Rf);let _=Rf.latitude,m=Rf.longitude;u=Math.min(u,_),f=Math.min(f,m),h=Math.max(h,_),p=Math.max(p,m),d.subtract(e,c,dD),n.cartesianToCartographic(dD,Rf),_=Rf.latitude,m=Rf.longitude,u=Math.min(u,_),f=Math.min(f,m),h=Math.max(h,_),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=h,r.longitude=p}var Pf=new d,hD=new d,Sl=new fe,vl=new fe;function Ale(e,t,n,i,o){e=Tle(e,t);let r=bo(e,d.equalsEpsilon),s=r.length;if(s<2||n<=0)return new se;let a=n*.5;Sl.latitude=Number.POSITIVE_INFINITY,Sl.longitude=Number.POSITIVE_INFINITY,vl.latitude=Number.NEGATIVE_INFINITY,vl.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Ni.ROUNDED){let p=r[0];d.subtract(p,r[1],Pf),d.normalize(Pf,Pf),d.multiplyByScalar(Pf,a,Pf),d.add(p,Pf,hD),t.cartesianToCartographic(hD,Rf),c=Rf.latitude,u=Rf.longitude,Sl.latitude=Math.min(Sl.latitude,c),Sl.longitude=Math.min(Sl.longitude,u),vl.latitude=Math.max(vl.latitude,c),vl.longitude=Math.max(vl.longitude,u)}for(let p=0;p<s-1;++p)_le(r[p],r[p+1],t,a,Sl,vl);let f=r[s-1];d.subtract(f,r[s-2],Pf),d.normalize(Pf,Pf),d.multiplyByScalar(Pf,a,Pf),d.add(f,Pf,hD),_le(f,hD,t,a,Sl,vl),i===Ni.ROUNDED&&(t.cartesianToCartographic(hD,Rf),c=Rf.latitude,u=Rf.longitude,Sl.latitude=Math.min(Sl.latitude,c),Sl.longitude=Math.min(Sl.longitude,u),vl.latitude=Math.max(vl.latitude,c),vl.longitude=Math.max(vl.longitude,u));let h=l(o)?o:new se;return h.north=vl.latitude,h.south=Sl.latitude,h.east=vl.longitude,h.west=Sl.longitude,h}function Zp(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Ni.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*d.packedLength+ee.packedLength+Ie.packedLength+7}Zp.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Ele=ee.clone(ee.UNIT_SPHERE),Sle=new Ie,Kp={positions:void 0,ellipsoid:Ele,vertexFormat:Sle,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Zp.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=d.packedLength)o[m]=d.unpack(e,t);let r=ee.unpack(e,t,Ele);t+=ee.packedLength;let s=Ie.unpack(e,t,Sle);t+=Ie.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++]===1,_=e[t];return l(n)?(n._positions=o,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Ie.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=h,n._shadowVolume=p,n._offsetAttribute=_===-1?void 0:_,n):(Kp.positions=o,Kp.width=a,Kp.height=c,Kp.extrudedHeight=u,Kp.cornerType=f,Kp.granularity=h,Kp.shadowVolume=p,Kp.offsetAttribute=_===-1?void 0:_,new Zp(Kp))};Zp.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,o=y(e.ellipsoid,ee.default),r=y(e.cornerType,Ni.ROUNDED);return Ale(n,o,i,r,t)};Zp.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Tle(t,i);let o=bo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=UXe(u,c);else{let _=Hi.computePositions(u);if(f=Cle(_,c,i),f.attributes.position.values=ri.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let m=e._offsetAttribute===sn.NONE?0:1,x=f.attributes.position.values.length,b=new Uint8Array(x/3).fill(m);f.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let h=f.attributes,p=ae.fromVertices(h.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new at({attributes:h,indices:f.indices,primitiveType:Me.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Zp.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Zp({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Zp.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Ale(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var gA=Zp;var vle=new d,wle=new d,zXe=new d;function HXe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Dle(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new hn,a,c=0,u=0,f,h=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,h+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){a=o[f];let N=o[f].leftPositions;l(N)?(p=N.length,c+=p,h+=p/3*2):(p=o[f].rightPositions.length,u+=p,h+=p/3*2)}let _=l(r),m;_&&(m=r[0].length-3,c+=m,u+=m,m/=3,h+=m*4);let x=c+u,b=new Float64Array(x),T=0,C=x-1,A,S,v,D,O,R,M=m/2,L=Ne.createTypedArray(x/3,h+4),g=0;if(L[g++]=T/3,L[g++]=(C-2)/3,_){n.push(T/3),R=vle,O=wle;let N=r[0];for(f=0;f<M;f++)R=d.fromArray(N,(M-1-f)*3,R),O=d.fromArray(N,(M+f)*3,O),Hi.addAttribute(b,O,T),Hi.addAttribute(b,R,void 0,C),S=T/3,D=S+1,A=(C-2)/3,v=A-1,L[g++]=A,L[g++]=v,L[g++]=S,L[g++]=D,T+=3,C-=3}let E=0,w=i[E++],I=i[E++];for(b.set(w,T),b.set(I,C-I.length+1),p=I.length-3,n.push(T/3,(C-2)/3),f=0;f<p;f+=3)S=T/3,D=S+1,A=(C-2)/3,v=A-1,L[g++]=A,L[g++]=v,L[g++]=S,L[g++]=D,T+=3,C-=3;for(f=0;f<o.length;f++){let N;a=o[f];let B=a.leftPositions,H=a.rightPositions,V,G=zXe;if(l(B)){for(C-=3,V=v,n.push(D),N=0;N<B.length/3;N++)G=d.fromArray(B,N*3,G),L[g++]=V-N-1,L[g++]=V-N,Hi.addAttribute(b,G,void 0,C),C-=3;n.push(V-Math.floor(B.length/6)),t===Ni.BEVELED&&n.push((C-2)/3+1),T+=3}else{for(T+=3,V=D,n.push(v),N=0;N<H.length/3;N++)G=d.fromArray(H,N*3,G),L[g++]=V+N,L[g++]=V+N+1,Hi.addAttribute(b,G,T),T+=3;n.push(V+Math.floor(H.length/6)),t===Ni.BEVELED&&n.push(T/3-1),C-=3}for(w=i[E++],I=i[E++],w.splice(0,3),I.splice(I.length-3,3),b.set(w,T),b.set(I,C-I.length+1),p=I.length-3,N=0;N<I.length;N+=3)D=T/3,S=D-1,v=(C-2)/3,A=v+1,L[g++]=A,L[g++]=v,L[g++]=S,L[g++]=D,T+=3,C-=3;T-=3,C+=3,n.push(T/3,(C-2)/3)}if(_){T+=3,C-=3,R=vle,O=wle;let N=r[1];for(f=0;f<M;f++)R=d.fromArray(N,(m-f-1)*3,R),O=d.fromArray(N,f*3,O),Hi.addAttribute(b,R,void 0,C),Hi.addAttribute(b,O,T),D=T/3,S=D-1,v=(C-2)/3,A=v+1,L[g++]=A,L[g++]=v,L[g++]=S,L[g++]=D,T+=3,C-=3;n.push(T/3)}else n.push(T/3,(C-2)/3);return L[g++]=T/3,L[g++]=(C-2)/3,s.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:s,indices:L,wallIndices:n}}function GXe(e){let t=e.ellipsoid,n=Hi.computePositions(e),i=Dle(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,h=new Float64Array(f);h.set(u);let p=new Float64Array(f*2);if(u=ri.scaleToGeodeticHeight(u,r,t),h=ri.scaleToGeodeticHeight(h,s,t),p.set(u),p.set(h,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let A=new Uint8Array(f*2);if(e.offsetAttribute===sn.TOP)A=A.fill(1,0,f);else{let S=e.offsetAttribute===sn.NONE?0:1;A=A.fill(S)}a.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}let _,m=c.length,x=Ne.createTypedArray(p.length/3,(m+o.length)*2);x.set(c);let b=m;for(_=0;_<m;_+=2){let A=c[_],S=c[_+1];x[b++]=A+f,x[b++]=S+f}let T,C;for(_=0;_<o.length;_++)T=o[_],C=T+f,x[b++]=T,x[b++]=C;return{attributes:a,indices:x}}function mD(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Ni.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*d.packedLength+ee.packedLength+6}mD.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var Ile=ee.clone(ee.UNIT_SPHERE),ny={positions:void 0,ellipsoid:Ile,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};mD.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=d.packedLength)o[p]=d.unpack(e,t);let r=ee.unpack(e,t,Ile);t+=ee.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t];return l(n)?(n._positions=o,n._ellipsoid=ee.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=h===-1?void 0:h,n):(ny.positions=o,ny.width=s,ny.height=a,ny.extrudedHeight=c,ny.cornerType=u,ny.granularity=f,ny.offsetAttribute=h===-1?void 0:h,new mD(ny))};mD.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=HXe(t,i);let o=bo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(r,s,0,P.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=GXe(c);else{let p=Hi.computePositions(c);if(u=Dle(p,c.cornerType),u.attributes.position.values=ri.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let _=u.attributes.position.values.length,m=e._offsetAttribute===sn.NONE?0:1,x=new Uint8Array(_/3).fill(m);u.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let f=u.attributes,h=ae.fromVertices(f.position.values,void 0,3);return new at({attributes:f,indices:u.indices,primitiveType:Me.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var D3=mD;var WXe=new Yn(0);function Gc(e){ii.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Gc.prototype=Object.create(ii.prototype),Gc.prototype.constructor=Gc);Object.defineProperties(Gc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Gc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&pl.isSupported(this._scene)};Gc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Gc.prototype._computeCenter=he.throwInstantiationError;Gc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ii.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&xt(xt.geometryZIndex),this._zIndex=y(o.zIndex,WXe),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new Vh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new JT(this._scene,a,r,s)}};Gc.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ii.prototype.destroy.call(this)};Gc.getGeometryHeight=function(e,t){if(!l(e)){t!==Ye.NONE&&xt(xt.geometryHeightReference);return}return tf(t)?0:e};Gc.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==Ye.NONE&&xt(xt.geometryExtrudedHeightReference);return}return tf(t)?Gc.CLAMP_TO_GROUND:e};Gc.CLAMP_TO_GROUND="clamp";Gc.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=Ye.NONE),(!l(n)||!l(i))&&(i=Ye.NONE);let o=0;if(t!==Ye.NONE&&o++,i===Ye.RELATIVE_TO_GROUND&&o++,o===2)return sn.ALL;if(o===1)return sn.TOP};var Gn=Gc;var Ple=new z,Rle=d.ZERO,Ole=new d,Mle=new se;function jXe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Bd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new jXe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Bd.prototype=Object.create(Gn.prototype),Bd.prototype.constructor=Bd);Bd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Ple)),l(o)||(o=z.WHITE),i.color=Wt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Rle,Ole))),new wt({id:t,geometry:new gA(this._options),attributes:i})};Bd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Ple),o={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Rle,Ole))),new wt({id:t,geometry:new D3(this._options),attributes:o})};Bd.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return d.clone(n[Math.floor(n.length/2)],t)};Bd.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||ii.prototype._isHidden.call(this,e,t)};Bd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.width)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};Bd.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,He.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),o=q.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),r=q.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof zt?cn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(He.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(He.MINIMUM_VALUE),s.granularity=q.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),s.cornerType=q.getValueOrUndefined(t.cornerType,He.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=li.getMinimumMaximumHeights(gA.computeRectangle(s,Mle)).minimumTerrainHeight),s.extrudedHeight=o};Bd.DynamicGeometryUpdater=_A;function _A(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(_A.prototype=Object.create(ni.prototype),_A.prototype.constructor=_A);_A.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ni.prototype._isHidden.call(this,e,t,n)};_A.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,Ye.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.positions=q.getValueOrUndefined(t.positions,n),i.width=q.getValueOrUndefined(t.width,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(gA.computeRectangle(i,Mle)).minimumTerrainHeight),i.extrudedHeight=s};var I3=Bd;function P3(){he.throwInstantiationError()}Object.defineProperties(P3.prototype,{name:{get:he.throwInstantiationError},clock:{get:he.throwInstantiationError},entities:{get:he.throwInstantiationError},isLoading:{get:he.throwInstantiationError},changedEvent:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},loadingEvent:{get:he.throwInstantiationError},show:{get:he.throwInstantiationError},clustering:{get:he.throwInstantiationError}});P3.prototype.update=function(e){he.throwInstantiationError()};P3.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Xr=P3;function lm(e,t){this._ellipsoid=e,this._cameraPosition=new d,this._cameraPositionInScaledSpace=new d,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(lm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=d.magnitudeSquared(n)-1;d.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Lle=new d;lm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Lle);return Ij(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};lm.prototype.isScaledSpacePointVisible=function(e){return Ij(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var qXe=new d;lm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=qXe,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),Ij(e,o,i)};lm.prototype.computeHorizonCullingPoint=function(e,t,n){return Ble(this._ellipsoid,e,t,n)};var Nle=ee.clone(ee.UNIT_SPHERE);lm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Fle(this._ellipsoid,n,Nle);return Ble(o,e,t,i)};lm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return kle(this._ellipsoid,e,t,n,i,o)};lm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Fle(this._ellipsoid,o,Nle);return kle(s,e,t,n,i,r)};var YXe=[];lm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=se.subsample(e,t,0,YXe),o=ae.fromPoints(i);if(!(d.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var XXe=new d;function Fle(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=d.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,XXe);e=ee.fromCartesian3(i,n)}return e}function Ble(e,t,n,i){l(i)||(i=new d);let o=zle(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=Vle(e,c,o);if(u<0)return;r=Math.max(r,u)}return Ule(o,r,i)}var R3=new d;function kle(e,t,n,i,o,r){l(r)||(r=new d),i=y(i,3),o=y(o,d.ZERO);let s=zle(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){R3.x=n[c]+o.x,R3.y=n[c+1]+o.y,R3.z=n[c+2]+o.z;let f=Vle(e,R3,s);if(f<0)return;a=Math.max(a,f)}return Ule(s,a,r)}function Ij(e,t,n){let i=t,o=n,r=d.subtract(e,i,Lle),s=-d.dot(r,i);return!(o<0?s>0:s>o&&s*s/d.magnitudeSquared(r)>o)}var KXe=new d,ZXe=new d;function Vle(e,t,n){let i=e.transformPositionToScaledSpace(t,KXe),o=d.magnitudeSquared(i),r=Math.sqrt(o),s=d.divideByScalar(i,r,ZXe);o=Math.max(1,o),r=Math.max(1,r);let a=d.dot(s,n),c=d.magnitude(d.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-c*f)}function Ule(e,t,n){if(!(t<=0||t===1/0||t!==t))return d.multiplyByScalar(e,t,n)}var Dj=new d;function zle(e,t){return d.equals(t,d.ZERO)?t:(e.transformPositionToScaledSpace(t,Dj),d.normalize(Dj,Dj))}var iy=lm;function yr(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=Lt.clone(o)),this._show=y(e.show,!0),this._position=d.clone(y(e.position,d.ZERO)),this._actualPosition=d.clone(this._position),this._color=z.clone(y(e.color,z.WHITE)),this._outlineColor=z.clone(y(e.outlineColor,z.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=y(e.splitDirection,Gr.NONE)}var Hle=yr.SHOW_INDEX=0,jle=yr.POSITION_INDEX=1,$Xe=yr.COLOR_INDEX=2,QXe=yr.OUTLINE_COLOR_INDEX=3,JXe=yr.OUTLINE_WIDTH_INDEX=4,eKe=yr.PIXEL_SIZE_INDEX=5,tKe=yr.SCALE_BY_DISTANCE_INDEX=6,nKe=yr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,iKe=yr.DISTANCE_DISPLAY_CONDITION_INDEX=8,oKe=yr.DISABLE_DEPTH_DISTANCE_INDEX=9,rKe=yr.SPLIT_DIRECTION_INDEX=10;yr.NUMBER_OF_PROPERTIES=11;function uu(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(yr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,uu(this,Hle))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),uu(this,jle))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),uu(this,tKe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),uu(this,nKe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,uu(this,eKe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),uu(this,$Xe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),uu(this,QXe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,uu(this,JXe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Lt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),uu(this,iKe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,uu(this,oKe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,uu(this,Hle))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,uu(this,rKe))}}});yr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};yr.prototype._getActualPosition=function(){return this._actualPosition};yr.prototype._setActualPosition=function(e){d.clone(e,this._actualPosition),uu(this,jle)};var Gle=new oe;yr._computeActualPosition=function(e,t,n){return t.mode===ne.SCENE3D?e:(F.multiplyByPoint(n,e,Gle),zi.computeActualEllipsoidPosition(t,Gle))};var Wle=new oe;yr._computeScreenSpacePosition=function(e,t,n,i){let o=F.multiplyByVector(e,oe.fromElements(t.x,t.y,t.z,1,Wle),Wle);return zi.worldToWindowCoordinates(n,o,i)};yr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,o=yr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};yr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new qe),n.x=r,n.y=s,n.width=a,n.height=c,n};yr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&d.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};yr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var zs=yr;var sKe=zs.SHOW_INDEX,Oj=zs.POSITION_INDEX,qle=zs.COLOR_INDEX,aKe=zs.OUTLINE_COLOR_INDEX,cKe=zs.OUTLINE_WIDTH_INDEX,lKe=zs.PIXEL_SIZE_INDEX,Yle=zs.SCALE_BY_DISTANCE_INDEX,Xle=zs.TRANSLUCENCY_BY_DISTANCE_INDEX,Kle=zs.DISTANCE_DISPLAY_CONDITION_INDEX,uKe=zs.DISABLE_DEPTH_DISTANCE_INDEX,fKe=zs.SPLIT_DIRECTION_INDEX,Mj=zs.NUMBER_OF_PROPERTIES,ic={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Of(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(Mj),this._maxPixelSize=1,this._baseVolume=new ae,this._baseVolumeWC=new ae,this._baseVolume2D=new ae,this._boundingVolume=new ae,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Do.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ne.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW,Fe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Of.prototype,{length:{get:function(){return Lj(this),this._pointPrimitives.length}}});function Zle(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Of.prototype.add=function(e){let t=new zs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Of.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Of.prototype.removeAll=function(){Zle(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function Lj(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}Of.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Of.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Of.prototype.get=function(e){return Lj(this),this._pointPrimitives[e]};Of.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Mj;++i){let o=n[i]===0?Fe.STATIC_DRAW:Fe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function dKe(e,t,n){return new Gg(e,[{index:ic.positionHighAndSize,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Oj]},{index:ic.positionLowAndShow,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Oj]},{index:ic.compressedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[qle]},{index:ic.compressedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Xle]},{index:ic.scaleByDistance,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Yle]},{index:ic.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:n[Kle]}],t)}var Pj=new Hn;function $le(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===ne.SCENE3D&&(ae.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Hn.fromCartesian(r,Pj);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[ic.positionHighAndSize],u=Pj.high;c(o,u.x,u.y,u.z,s);let f=n[ic.positionLowAndOutline],h=Pj.low;f(o,h.x,h.y,h.z,a)}var O3=65536,pD=256;function Qle(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=z.floatToByte(r.red),u=z.floatToByte(r.green),f=z.floatToByte(r.blue),h=c*O3+u*pD+f;c=z.floatToByte(a.red),u=z.floatToByte(a.green),f=z.floatToByte(a.blue);let p=c*O3+u*pD+f;c=z.floatToByte(s.red),u=z.floatToByte(s.green),f=z.floatToByte(s.blue);let _=c*O3+u*pD+f,m=z.floatToByte(r.alpha)*O3+z.floatToByte(a.alpha)*pD+z.floatToByte(s.alpha),x=n[ic.compressedAttribute0];x(o,h,p,_,m)}function Jle(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let h=(f?1:0)*pD+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,_=n[ic.compressedAttribute1];_(o,h,p,r,a)}function eue(e,t,n,i){let o=i._index,r=n[ic.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,u)}function tue(e,t,n,i){let o=i._index,r=n[ic.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,h=i.splitDirection;l(h)&&(f=h),r(o,s,a,u,f)}function hKe(e,t,n,i){$le(e,t,n,i),Qle(e,t,n,i),Jle(e,t,n,i),eue(e,t,n,i),tue(e,t,n,i)}function Rj(e,t,n,i,o,r){let s;i.mode===ne.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,h=zs._computeActualPosition(f,i,o);l(h)&&(u._setActualPosition(h),r?a.push(h):ae.expand(s,h,s))}r&&ae.fromPoints(a,s)}function mKe(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ne.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ne.SCENE3D||n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&Rj(e,i,i.length,t,r,!0)):n===ne.MORPHING?Rj(e,i,i.length,t,r,!0):(n===ne.SCENE2D||n===ne.COLUMBUS_VIEW)&&Rj(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function pKe(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var gKe=[];Of.prototype.update=function(e){if(Lj(this),!this.show)return;this._maxTotalPointSize=Bt.maximumAliasedPointSize,mKe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<Mj;++v)r[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=dKe(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let D=this._pointPrimitives[v];D._dirty=!1,hKe(this,c,a,D)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let v=gKe;v.length=0,(r[Oj]||r[cKe]||r[lKe])&&v.push($le),(r[qle]||r[aKe])&&v.push(Qle),(r[sKe]||r[Xle])&&v.push(Jle),r[Yle]&&v.push(eue),(r[Kle]||r[uKe]||r[fKe])&&v.push(tue);let D=v.length;if(a=this._vaf.writers,o/n>.1){for(let O=0;O<o;++O){let R=i[O];R._dirty=!1;for(let M=0;M<D;++M)v[M](this,c,a,R)}this._vaf.commit()}else{for(let O=0;O<o;++O){let R=i[O];R._dirty=!1;for(let M=0;M<D;++M)v[M](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ae.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=F.IDENTITY;e.mode===ne.SCENE3D?(p=this.modelMatrix,h=ae.clone(this._baseVolumeWC,this._boundingVolume)):h=ae.clone(this._baseVolume2D,this._boundingVolume),pKe(this,e,h);let _=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,_&&(this._blendOption===Do.OPAQUE||this._blendOption===Do.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Do.TRANSLUCENT||this._blendOption===Do.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,x;(_||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Ue({sources:[aL]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Do.OPAQUE_AND_TRANSLUCENT&&(x=new Ue({defines:["OPAQUE"],sources:[k0]}),this._sp=en.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:ic}),x=new Ue({defines:["TRANSLUCENT"],sources:[k0]}),this._spTranslucent=en.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:ic})),this._blendOption===Do.OPAQUE&&(x=new Ue({sources:[k0]}),this._sp=en.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:ic})),this._blendOption===Do.TRANSLUCENT&&(x=new Ue({sources:[k0]}),this._spTranslucent=en.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:x,attributeLocations:ic})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,T,C,A,S=e.commandList;if(u.render||f){let v=this._colorCommands,D=this._blendOption===Do.OPAQUE,O=this._blendOption===Do.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,T=b.length,v.length=T;let R=O?T*2:T;for(A=0;A<R;++A){let M=D||O&&A%2===0;C=v[A],l(C)||(C=v[A]=new $e),C.primitiveType=Me.POINTS,C.pass=M||!O?we.OPAQUE:we.TRANSLUCENT,C.owner=this;let L=O?Math.floor(A/2):A;C.boundingVolume=h,C.modelMatrix=p,C.shaderProgram=M?this._sp:this._spTranslucent,C.uniformMap=this._uniforms,C.vertexArray=b[L].va,C.renderState=M?this._rsOpaque:this._rsTranslucent,C.debugShowBoundingVolume=this.debugShowBoundingVolume,C.pickId="v_pickColor",S.push(C)}}};Of.prototype.isDestroyed=function(){return!1};Of.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Zle(this._pointPrimitives),ue(this)};var gD=Of;var nue=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Nj=1,_D=8,xD=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==Nj)throw new Error(`Got v${o} data when expected v${Nj}.`);let r=nue[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=nue.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,_D,t),this.coords=new this.ArrayType(this.data,_D+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(_D+s+a+c),this.ids=new this.IndexArrayType(this.data,_D,t),this.coords=new this.ArrayType(this.data,_D+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Nj<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Bj(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,h=c.pop()||0,p=c.pop()||0;if(h-p<=a){for(let b=p;b<=h;b++){let T=s[2*b],C=s[2*b+1];T>=t&&T<=i&&C>=n&&C<=o&&u.push(r[b])}continue}let _=p+h>>1,m=s[2*_],x=s[2*_+1];m>=t&&m<=i&&x>=n&&x<=o&&u.push(r[_]),(f===0?t<=m:n<=x)&&(c.push(p),c.push(_-1),c.push(1-f)),(f===0?i>=m:o>=x)&&(c.push(_+1),c.push(h),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],u=i*i;for(;a.length;){let f=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let b=p;b<=h;b++)iue(r[2*b],r[2*b+1],t,n)<=u&&c.push(o[b]);continue}let _=p+h>>1,m=r[2*_],x=r[2*_+1];iue(m,x,t,n)<=u&&c.push(o[_]),(f===0?t-i<=m:n-i<=x)&&(a.push(p),a.push(_-1),a.push(1-f)),(f===0?t+i>=m:n+i>=x)&&(a.push(_+1),a.push(h),a.push(1-f))}return c}};function Bj(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;oue(e,t,s,i,o,r),Bj(e,t,n,i,s-1,1-r),Bj(e,t,n,s+1,o,1-r)}function oue(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),_=.5*Math.sqrt(h*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+_)),x=Math.min(o,Math.floor(n+(u-f)*p/u+_));oue(e,t,n,m,x,r)}let s=t[2*n+r],a=i,c=o;for(yD(e,t,i,n),t[2*o+r]>s&&yD(e,t,i,o);a<c;){for(yD(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?yD(e,t,i,c):(c++,yD(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function yD(e,t,n,i){Fj(e,n,i),Fj(t,2*n,2*i),Fj(t,2*n+1,2*i+1)}function Fj(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function iue(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function kd(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new me,this.show=y(e.show,!0)}function rue(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var _Ke=new qe;function sue(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Dx.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=co.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=zs.getScreenSpaceBoundingBox(e,t,o)),rue(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&cue(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Dx.getScreenSpaceBoundingBox(s,t,_Ke);rue(a,n),o=qe.union(o,a,o)}return o}function yKe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&cue(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function aue(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function cue(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function kj(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===ne.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),u=o._clusterBillboards&&l(a.id._billboard),f=o._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let h=a.computeScreenSpacePosition(n);l(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}var xKe=new qe,bKe=new qe,TKe=new qe;function CKe(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new Np({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Tf({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new gD;let u=e._pixelRange,f=e._minimumClusterSize,h=e._previousClusters,p=[],_=e._previousHeight,m=n.camera.positionCartographic.height,x=n.ellipsoid,b=n.camera.positionWC,T=new iy(x,b),C=[];e._clusterLabels&&kj(i,C,n,T,e),e._clusterBillboards&&kj(o,C,n,T,e),e._clusterPoints&&kj(r,C,n,T,e);let A,S,v,D,O,R,M,L,g,E,w,I;if(C.length>0){let N=new xD(C.length,64,Uint32Array);for(let B=0;B<C.length;++B)N.add(C[B].coord.x,C[B].coord.y);if(N.finish(),m<_)for(v=h.length,A=0;A<v;++A){let B=h[A];if(!T.isPointVisible(B.position))continue;let H=co._computeScreenSpacePosition(F.IDENTITY,B.position,d.ZERO,U.ZERO,n);if(!l(H))continue;let V=1-m/_,G=B.width=B.width*V,k=B.height=B.height*V;G=Math.max(G,B.minimumWidth),k=Math.max(k,B.minimumHeight);let W=H.x-G*.5,Y=H.y-k*.5,J=H.x+G,j=H.y+k;for(O=N.range(W,Y,J,j),R=O.length,E=0,g=[],S=0;S<R;++S)M=O[S],L=C[M],L.clustered||(++E,w=L.collection,I=L.index,g.push(w.get(I).id));if(E>=f)for(aue(B.position,E,g,e),p.push(B),S=0;S<R;++S)C[O[S]].clustered=!0}for(v=C.length,A=0;A<v;++A){let B=C[A];if(B.clustered)continue;B.clustered=!0,w=B.collection,I=B.index;let H=w.get(I);D=sue(H,B.coord,u,e,xKe);let V=qe.clone(D,bKe);O=N.range(D.x,D.y,D.x+D.width,D.y+D.height),R=O.length;let G=d.clone(H.position);for(E=1,g=[H.id],S=0;S<R;++S)if(M=O[S],L=C[M],!L.clustered){let k=L.collection.get(L.index),W=sue(k,L.coord,u,e,TKe);d.add(k.position,G,G),qe.union(V,W,V),++E,g.push(k.id)}if(E>=f){let k=d.multiplyByScalar(G,1/E,G);for(aue(k,E,g,e),p.push({position:k,width:V.width,height:V.height,minimumWidth:D.width,minimumHeight:D.height}),S=0;S<R;++S)C[O[S]].clustered=!0}else yKe(H,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}kd.prototype._initialize=function(e){this._scene=e;let t=CKe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(kd.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function Uj(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function zj(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}kd.prototype.getLabel=Uj("_labelCollection",Np,"_unusedLabelIndices","labelIndex");kd.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,zj(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};kd.prototype.getBillboard=Uj("_billboardCollection",Tf,"_unusedBillboardIndices","billboardIndex");kd.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,zj(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};kd.prototype.getPoint=Uj("_pointCollection",gD,"_unusedPointIndices","pointIndex");kd.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,zj(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function Vj(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function AKe(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,Vj(e._labelCollection),Vj(e._billboardCollection),Vj(e._pointCollection))}kd.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,AKe(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};kd.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Mf=kd;function Hj(e){this._name=e,this._clock=void 0,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._entityCollection=new ra(this),this._entityCluster=new Mf}Object.defineProperties(Hj.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Xr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});Hj.prototype.update=function(e){return!0};var M3=Hj;var lue={};lue.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,u=new Float64Array(c*3),f,h=0,p=0,_=o?a*3:0,m=o?(a+i)*3:i*3;for(f=0;f<i;f++){let x=f/i*P.TWO_PI,b=Math.cos(x),T=Math.sin(x),C=b*n,A=T*n,S=b*t,v=T*t;u[p+_]=C,u[p+_+1]=A,u[p+_+2]=s,u[p+m]=S,u[p+m+1]=v,u[p+m+2]=r,p+=3,o&&(u[h++]=C,u[h++]=A,u[h++]=s,u[h++]=S,u[h++]=v,u[h++]=r)}return u};var yA=lue;var Gj=new U,EKe=new d,SKe=new d,vKe=new d,wKe=new d;function $p(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Ie.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}$p.packedLength=Ie.packedLength+5;$p.pack=function(e,t,n){return n=y(n,0),Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var uue=new Ie,xA={vertexFormat:uue,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};$p.unpack=function(e,t,n){t=y(t,0);let i=Ie.unpack(e,t,uue);t+=Ie.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(xA.length=o,xA.topRadius=r,xA.bottomRadius=s,xA.slices=a,xA.offsetAttribute=c===-1?void 0:c,new $p(xA))};$p.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,u=yA.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,h=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,_=o.bitangent?new Float32Array(c*3):void 0,m,x=o.normal||o.tangent||o.bitangent;if(x){let O=o.tangent||o.bitangent,R=0,M=0,L=0,g=Math.atan2(i-n,t),E=EKe;E.z=Math.sin(g);let w=Math.cos(g),I=vKe,N=SKe;for(m=0;m<r;m++){let B=m/r*P.TWO_PI,H=w*Math.cos(B),V=w*Math.sin(B);x&&(E.x=H,E.y=V,O&&(I=d.normalize(d.cross(d.UNIT_Z,E,I),I)),o.normal&&(h[R++]=E.x,h[R++]=E.y,h[R++]=E.z,h[R++]=E.x,h[R++]=E.y,h[R++]=E.z),o.tangent&&(p[M++]=I.x,p[M++]=I.y,p[M++]=I.z,p[M++]=I.x,p[M++]=I.y,p[M++]=I.z),o.bitangent&&(N=d.normalize(d.cross(E,I,N),N),_[L++]=N.x,_[L++]=N.y,_[L++]=N.z,_[L++]=N.x,_[L++]=N.y,_[L++]=N.z))}for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=-1),o.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),o.bitangent&&(_[L++]=0,_[L++]=-1,_[L++]=0);for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=1),o.tangent&&(p[M++]=1,p[M++]=0,p[M++]=0),o.bitangent&&(_[L++]=0,_[L++]=1,_[L++]=0)}let b=12*r-12,T=Ne.createTypedArray(c,b),C=0,A=0;for(m=0;m<r-1;m++)T[C++]=A,T[C++]=A+2,T[C++]=A+3,T[C++]=A,T[C++]=A+3,T[C++]=A+1,A+=2;for(T[C++]=s-2,T[C++]=0,T[C++]=1,T[C++]=s-2,T[C++]=1,T[C++]=s-1,m=1;m<r-1;m++)T[C++]=s+m+1,T[C++]=s+m,T[C++]=s;for(m=1;m<r-1;m++)T[C++]=a,T[C++]=a+m,T[C++]=a+m+1;let S=0;if(o.st){let O=Math.max(n,i);for(m=0;m<c;m++){let R=d.fromArray(u,m*3,wKe);f[S++]=(R.x+O)/(2*O),f[S++]=(R.y+O)/(2*O)}}let v=new hn;o.position&&(v.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(v.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(v.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(v.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(v.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:f})),Gj.x=t*.5,Gj.y=Math.max(i,n);let D=new ae(d.ZERO,U.magnitude(Gj));if(l(e._offsetAttribute)){t=u.length;let O=e._offsetAttribute===sn.NONE?0:1,R=new Uint8Array(t/3).fill(O);v.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new at({attributes:v,indices:T,primitiveType:Me.TRIANGLES,boundingSphere:D,offsetAttribute:e._offsetAttribute})};var Wj;$p.getUnitCylinder=function(){return l(Wj)||(Wj=$p.createGeometry(new $p({topRadius:1,bottomRadius:1,length:1,vertexFormat:Ie.POSITION_ONLY}))),Wj};var L3=$p;var jj=new U;function bA(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.slices,128),r=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}bA.packedLength=6;bA.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Vx={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};bA.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(Vx.length=i,Vx.topRadius=o,Vx.bottomRadius=r,Vx.slices=s,Vx.numberOfVerticalLines=a,Vx.offsetAttribute=c===-1?void 0:c,new bA(Vx))};bA.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=yA.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let x=Math.min(r,o);u=Math.round(o/x),c+=x}let f=Ne.createTypedArray(s,c*2),h=0,p;for(p=0;p<o-1;p++)f[h++]=p,f[h++]=p+1,f[h++]=p+o,f[h++]=p+1+o;if(f[h++]=o-1,f[h++]=0,f[h++]=o+o-1,f[h++]=o,r>0)for(p=0;p<o;p+=u)f[h++]=p,f[h++]=p+o;let _=new hn;_.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:a}),jj.x=t*.5,jj.y=Math.max(i,n);let m=new ae(d.ZERO,U.magnitude(jj));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===sn.NONE?0:1,b=new Uint8Array(t/3).fill(x);_.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}return new at({attributes:_,indices:f,primitiveType:Me.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var N3=bA;var fue=d.ZERO,due=new d,DKe=new d,hue=new z;function IKe(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function fu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new IKe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(fu.prototype=Object.create(ii.prototype),fu.prototype.constructor=fu);Object.defineProperties(fu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});fu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Bn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof zt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,hue)),l(a)||(a=z.WHITE),s.color=Wt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,fue,due))),new wt({id:t,geometry:new L3(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};fu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,hue),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,fue,due))),new wt({id:t,geometry:new N3(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};fu.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};fu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||ii.prototype._isHidden.call(this,e,t)};fu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!q.isConstant(t.slices)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)};fu.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof zt?cn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(He.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(He.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(He.MINIMUM_VALUE),i.slices=q.getValueOrUndefined(t.slices,He.MINIMUM_VALUE),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,He.MINIMUM_VALUE),i.offsetAttribute=n!==Ye.NONE?sn.ALL:void 0};fu.prototype._onEntityPropertyChanged=e_;fu.DynamicGeometryUpdater=TA;function TA(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(TA.prototype=Object.create(ni.prototype),TA.prototype.constructor=TA);TA.prototype._isHidden=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(e.position,n,DKe);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ni.prototype._isHidden.call(this,e,t,n)};TA.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,Ye.NONE),o=this._options;o.length=q.getValueOrUndefined(t.length,n),o.topRadius=q.getValueOrUndefined(t.topRadius,n),o.bottomRadius=q.getValueOrUndefined(t.bottomRadius,n),o.slices=q.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Ye.NONE?sn.ALL:void 0};var F3=fu;var PKe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Kr=Object.freeze(PKe);var RKe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},_o=Object.freeze(RKe);var OKe={NONE:0,HOLD:1,EXTRAPOLATE:2},Lf=Object.freeze(OKe);var mue=Ur(Hl(),1);function MKe(e){let t=new mue.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var oy=MKe;var LKe=P.factorial;function qj(e,t,n,i,o,r){let s=0,a,c,u;if(i>0){for(c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(r.push(c),s+=qj(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,u=0;u<r.length&&!a;u++)c===r[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var B3={type:"Hermite"};B3.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};B3.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,u,f,h=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let b=new Array(h);for(p[r]=b,s=0;s<h;s++)b[s]=[]}let _=h,m=new Array(_);for(r=0;r<_;r++)m[r]=r;let x=h-1;for(c=0;c<i;c++){for(s=0;s<_;s++)f=m[s]*i+c,p[c][0].push(n[f]);for(r=1;r<_;r++){let b=!1;for(s=0;s<_-r;s++){let T=t[m[s]],C=t[m[s+r]],A;C-T<=0?(f=m[s]*i+i*r+c,A=n[f],p[c][r].push(A/LKe(r))):(A=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(A/(C-T))),b=b||A!==0}b||(x=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=x;r++){let b=qj(e,m,t,a,r,[]);for(c=0;c<i;c++){let T=p[c][r][0];o[c+a*i]+=T*b}}return o};var NKe=[];B3.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let T=0;T<a;T++)s[T]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let T=0;T<o+1;T++)u[f*(o+1)+T]=f;let h=u.length,p=NKe,_=FKe(p,u,t,n,i,o),m=[],x=h*(h+1)/2,b=Math.min(_,r);for(let T=0;T<=b;T++)for(f=T;f<=_;f++){m.length=0;let C=qj(e,u,t,T,f,m),A=Math.floor(f*(1-f)/2)+h*f;for(let S=0;S<i;S++){let v=Math.floor(S*x),D=p[v+A];s[S+T*i]+=D*C}}return s};function FKe(e,t,n,i,o,r){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let h=0;h<o;h++){let p=Math.floor(h*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+h,e[p+s]=i[a];for(let _=1;_<u;_++){let m=0,x=Math.floor(_*(1-_)/2)+u*_,b=!1;for(s=0;s<u-_;s++){let T=n[t[s]],C=n[t[s+_]],A,S;if(C-T<=0)a=t[s]*o*(r+1)+o*_+h,A=i[a],S=A/P.factorial(_),e[p+x+m]=S,m++;else{let v=Math.floor((_-1)*(2-_)/2)+u*(_-1);A=e[p+v+s+1]-e[p+v+s],S=A/(C-T),e[p+x+m]=S,m++}b=b||A!==0}b&&(c=Math.max(c,_))}}return c}var k3=B3;var Yj={type:"Lagrange"};Yj.getRequiredDataPoints=function(e){return Math.max(e+1,2)};Yj.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let u=t[r]-t[s];c*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var V3=Yj;var Xj={type:"Linear"};Xj.getRequiredDataPoints=function(e){return 2};Xj.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],u=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-c*a)/(u-c);return o};var CA=Xj;function oc(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}oc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new oc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};oc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new oc(e.clock,e.cone,e.magnitude)};oc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new oc(e.clock,e.cone,1)};oc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};oc.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};oc.prototype.equals=function(e){return oc.equals(this,e)};oc.prototype.clone=function(e){return oc.clone(this,e)};oc.prototype.equalsEpsilon=function(e,t){return oc.equalsEpsilon(this,e,t)};oc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var U3=oc;var PD=Ur(Hl(),1);var Kj;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?Kj=function(){return performance.now()}:Kj=function(){return Date.now()};var Ci=Kj;function Zj(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=Z.clone(t):l(n)?t=Z.clone(n):l(i)?t=Z.addDays(i,-1,new Z):t=Z.now(),l(n)?n=Z.clone(n):n=Z.clone(t),l(i)?i=Z.clone(i):i=Z.addDays(n,1,new Z),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,Kr.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new me,this.onStop=new me,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ci(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,_o.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(Zj.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Z.equals(this._currentTime,e)||(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===_o.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=Z.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});Zj.prototype.tick=function(){let e=Ci(),t=Z.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===_o.SYSTEM_CLOCK)t=Z.now(t);else{let i=this._multiplier;if(n===_o.TICK_DEPENDENT)t=Z.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=Z.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===Kr.CLAMPED)Z.lessThan(t,r)?t=Z.clone(r,t):Z.greaterThan(t,s)&&(t=Z.clone(s,t),this.onStop.raiseEvent(this));else if(o===Kr.LOOP_STOP)for(Z.lessThan(t,r)&&(t=Z.clone(r,t));Z.greaterThan(t,s);)t=Z.addSeconds(r,Z.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var um=Zj;function Ux(){this._definitionChanged=new me,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(Ux.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:_l("startTime"),stopTime:_l("stopTime"),currentTime:_l("currentTime"),clockRange:_l("clockRange"),clockStep:_l("clockStep"),multiplier:_l("multiplier")});Ux.prototype.clone=function(e){return l(e)||(e=new Ux),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};Ux.prototype.equals=function(e){return this===e||l(e)&&Z.equals(this.startTime,e.startTime)&&Z.equals(this.stopTime,e.stopTime)&&Z.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};Ux.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};Ux.prototype.getValue=function(e){return l(e)||(e=new um),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var fm=Ux;var BKe=z.WHITE,kKe=.1,VKe=new U(8,8),UKe=new U(0,0),zKe=new U(1,1);function AA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(AA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._cellAlpha)&&q.isConstant(this._lineCount)&&q.isConstant(this._lineThickness)&&q.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});AA.prototype.getType=function(e){return"Grid"};var HKe=new Z;AA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(HKe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,BKe,t.color),t.cellAlpha=q.getValueOrDefault(this._cellAlpha,e,kKe),t.lineCount=q.getValueOrClonedDefault(this._lineCount,e,VKe,t.lineCount),t.lineThickness=q.getValueOrClonedDefault(this._lineThickness,e,zKe,t.lineThickness),t.lineOffset=q.getValueOrClonedDefault(this._lineOffset,e,UKe,t.lineOffset),t};AA.prototype.equals=function(e){return this===e||e instanceof AA&&q.equals(this._color,e._color)&&q.equals(this._cellAlpha,e._cellAlpha)&&q.equals(this._lineCount,e._lineCount)&&q.equals(this._lineThickness,e._lineThickness)&&q.equals(this._lineOffset,e._lineOffset)};var bD=AA;function EA(e){this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(EA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});EA.prototype.getType=function(e){return"PolylineArrow"};var GKe=new Z;EA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(GKe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};EA.prototype.equals=function(e){return this===e||e instanceof EA&&q.equals(this._color,e._color)};var TD=EA;var WKe=z.WHITE,jKe=z.TRANSPARENT,qKe=16,YKe=255;function SA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(SA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._gapColor)&&q.isConstant(this._dashLength)&&q.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});SA.prototype.getType=function(e){return"PolylineDash"};var XKe=new Z;SA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(XKe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,WKe,t.color),t.gapColor=q.getValueOrClonedDefault(this._gapColor,e,jKe,t.gapColor),t.dashLength=q.getValueOrDefault(this._dashLength,e,qKe,t.dashLength),t.dashPattern=q.getValueOrDefault(this._dashPattern,e,YKe,t.dashPattern),t};SA.prototype.equals=function(e){return this===e||e instanceof SA&&q.equals(this._color,e._color)&&q.equals(this._gapColor,e._gapColor)&&q.equals(this._dashLength,e._dashLength)&&q.equals(this._dashPattern,e._dashPattern)};var CD=SA;var KKe=z.WHITE,ZKe=.25,$Ke=1;function vA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(vA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});vA.prototype.getType=function(e){return"PolylineGlow"};var QKe=new Z;vA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(QKe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,KKe,t.color),t.glowPower=q.getValueOrDefault(this._glowPower,e,ZKe,t.glowPower),t.taperPower=q.getValueOrDefault(this._taperPower,e,$Ke,t.taperPower),t};vA.prototype.equals=function(e){return this===e||e instanceof vA&&q.equals(this._color,e._color)&&q.equals(this._glowPower,e._glowPower)&&q.equals(this._taperPower,e._taperPower)};var AD=vA;var JKe=z.WHITE,eZe=z.BLACK,tZe=1;function wA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(wA.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._outlineColor)&&q.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});wA.prototype.getType=function(e){return"PolylineOutline"};var nZe=new Z;wA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(nZe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,JKe,t.color),t.outlineColor=q.getValueOrClonedDefault(this._outlineColor,e,eZe,t.outlineColor),t.outlineWidth=q.getValueOrDefault(this._outlineWidth,e,tZe),t};wA.prototype.equals=function(e){return this===e||e instanceof wA&&q.equals(this._color,e._color)&&q.equals(this._outlineColor,e._outlineColor)&&q.equals(this._outlineWidth,e._outlineWidth)};var zx=wA;function Qp(e,t){this._value=void 0,this._definitionChanged=new me,this._eventHelper=new _r,this._referenceFrame=y(t,Ui.FIXED),this.setValue(e)}Object.defineProperties(Qp.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var iZe=new Z;Qp.prototype.getValue=function(e,t){return l(e)||(e=Z.now(iZe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Qp.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};Qp.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Qp.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Qp.prototype.equals=function(e){return this===e||e instanceof Qp&&this._referenceFrame===e._referenceFrame&&q.arrayEquals(this._value,e._value)};Qp.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ry=Qp;function sy(e){this._value=void 0,this._definitionChanged=new me,this._eventHelper=new _r,this.setValue(e)}Object.defineProperties(sy.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var oZe=new Z;sy.prototype.getValue=function(e,t){l(e)||(e=Z.now(oZe));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};sy.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,sy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};sy.prototype.equals=function(e){return this===e||e instanceof sy&&q.arrayEquals(this._value,e._value)};sy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ED=sy;function Hx(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(du.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function du(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new me,e.collectionChanged.addEventListener(du.prototype._onCollectionChanged,this)}Object.defineProperties(du.prototype,{isConstant:{get:function(){return q.isConstant(Hx(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Hx(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return Hx(this)}}});du.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new du(e,n,i)};var rZe=new Z;du.prototype.getValue=function(e,t){let n=Hx(this);return l(e)||(e=Z.now(rZe)),l(n)?n.getValue(e,t):void 0};du.prototype.getValueInReferenceFrame=function(e,t,n){let i=Hx(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};du.prototype.getType=function(e){let t=Hx(this);return l(t)?t.getType(e):void 0};du.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};du.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};du.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(du.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=Hx(this),l(i)&&this._definitionChanged.raiseEvent(this))};var ay=du;var sZe={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(n,e.length);let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-P.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+P.TWO_PI:o}},Vd=sZe;var pue={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function gue(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function _ue(e,t){return e instanceof Z?e:typeof e=="string"?Z.fromIso8601(e):Z.addSeconds(t,e,new Z)}var $j=[],Qj=[];function z3(e,t,n,i,o){let r=0,s,a,c,u,f,h;for(;r<i.length;){f=_ue(i[r],e),c=Oo(t,f,Z.compare);let p=0,_=0;if(c<0){for(c=~c,u=c*o,a=void 0,h=t[c];r<i.length&&(f=_ue(i[r],e),!(l(a)&&Z.compare(a,f)>=0||l(h)&&Z.compare(f,h)>=0));){for($j[p++]=f,r=r+1,s=0;s<o;s++)Qj[_++]=i[r],r=r+1;a=f}p>0&&(Qj.length=_,gue(n,u,Qj),$j.length=p,gue(t,c,$j))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function Nf(e,t){let n=e;n===Number&&(n=pue);let i=n.packedLength,o=y(n.packedInterpolationLength,i),r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=pue);let f=u.packedLength;i+=f,o+=y(u.packedInterpolationLength,f),s[c]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=CA,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new me,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=Lf.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Lf.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Nf.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var aZe=new Z;Nf.prototype.getValue=function(e,t){l(e)||(e=Z.now(aZe));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Oo(n,e,Z.compare);if(a<0){if(a=~a,a===0){let S=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Lf.NONE||o!==0&&Z.secondsDifference(S,e)>o)return;if(this._backwardExtrapolationType===Lf.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let S=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Lf.NONE||o!==0&&Z.secondsDifference(e,S)>o)return;if(this._forwardExtrapolationType===Lf.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,h=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,c.length=S,u.length=S*h)}let _=this._numberOfPoints-1;if(_<1)return;let m=0,x=i-1;if(x-m+1>=_+1){let S=a-(_/2|0)-1;S<m&&(S=m);let v=S+_;v>x&&(v=x,S=v-_,S<m&&(S=m)),m=S,x=v}let T=x-m+1;for(let S=0;S<T;++S)c[S]=Z.secondsDifference(n[m+S],n[x]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,m,x,u);else{let S=0,v=this._packedLength,D=m*v,O=(x+1)*v;for(;D<O;)u[S]=s[D],D++,S++}let C=Z.secondsDifference(e,n[x]),A;if(p===0||!l(f.interpolate))A=f.interpolateOrderZero(C,c,u,h,this._interpolationResult);else{let S=Math.floor(h/(p+1));A=f.interpolate(C,c,u,S,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(A,s,m,x,t):r.unpack(A,0,t)}return r.unpack(s,a*this._packedLength,t)};Nf.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Nf.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}z3(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Nf.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let u=n[c],f=i.length;for(let h=0;h<f;h++)i[h].pack(u[h],a,a.length)}z3(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Nf.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Nf.prototype.addSamplesPackedArray=function(e,t){z3(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Nf.prototype.removeSample=function(e){let t=Oo(this._times,e,Z.compare);return t<0?!1:(yue(this,t,1),!0)};function yue(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Nf.prototype.removeSamples=function(e){let t=this._times,n=Oo(t,e.start,Z.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Oo(t,e.stop,Z.compare);i<0?i=~i:e.isStopIncluded&&++i,yue(this,n,i-n)};Nf.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!Z.equals(a[r],c[r]))return!1;let u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};Nf._mergeNewSamples=z3;var Ff=Nf;function Bf(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=d}this._numberOfDerivatives=t,this._property=new Ff(d,n),this._definitionChanged=new me,this._referenceFrame=y(e,Ui.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Bf.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var cZe=new Z;Bf.prototype.getValue=function(e,t){return l(e)||(e=Z.now(cZe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Bf.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Nh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Bf.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Bf.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Bf.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Bf.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Bf.prototype.removeSample=function(e){return this._property.removeSample(e)};Bf.prototype.removeSamples=function(e){this._property.removeSamples(e)};Bf.prototype.equals=function(e){return this===e||e instanceof Bf&&q.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var va=Bf;var lZe={HORIZONTAL:0,VERTICAL:1},dm=Object.freeze(lZe);var uZe=dm.HORIZONTAL,fZe=z.WHITE,dZe=z.BLACK,hZe=0,mZe=1;function DA(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new me,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(DA.prototype,{isConstant:{get:function(){return q.isConstant(this._orientation)&&q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._offset)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});DA.prototype.getType=function(e){return"Stripe"};var pZe=new Z;DA.prototype.getValue=function(e,t){return l(e)||(e=Z.now(pZe)),l(t)||(t={}),t.horizontal=q.getValueOrDefault(this._orientation,e,uZe)===dm.HORIZONTAL,t.evenColor=q.getValueOrClonedDefault(this._evenColor,e,fZe,t.evenColor),t.oddColor=q.getValueOrClonedDefault(this._oddColor,e,dZe,t.oddColor),t.offset=q.getValueOrDefault(this._offset,e,hZe),t.repeat=q.getValueOrDefault(this._repeat,e,mZe),t};DA.prototype.equals=function(e){return this===e||e instanceof DA&&q.equals(this._orientation,e._orientation)&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._offset,e._offset)&&q.equals(this._repeat,e._repeat)};var SD=DA;function cy(e){this._definitionChanged=new me,this._intervals=new Yr,this._intervals.changedEvent.addEventListener(cy.prototype._intervalsChanged,this),this._referenceFrame=y(e,Ui.FIXED)}Object.defineProperties(cy.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var gZe=new Z;cy.prototype.getValue=function(e,t){return l(e)||(e=Z.now(gZe)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};cy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Nh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};cy.prototype.equals=function(e){return this===e||e instanceof cy&&this._intervals.equals(e._intervals,q.equals)&&this._referenceFrame===e._referenceFrame};cy.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var ly=cy;function Gx(){this._definitionChanged=new me,this._intervals=new Yr,this._intervals.changedEvent.addEventListener(Gx.prototype._intervalsChanged,this)}Object.defineProperties(Gx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var _Ze=new Z;Gx.prototype.getValue=function(e,t){l(e)||(e=Z.now(_Ze));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};Gx.prototype.equals=function(e){return this===e||e instanceof Gx&&this._intervals.equals(e._intervals,q.equals)};Gx.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var uy=Gx;function IA(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new me,this._normalize=y(t,!0),this.position=e}Object.defineProperties(IA.prototype,{isConstant:{get:function(){return q.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var yZe=new d,xue=new d,bue=new Z,xZe=new Z,Jj=1/60;IA.prototype.getValue=function(e,t){return this._getValue(e,t)};IA.prototype._getValue=function(e,t,n){l(e)||(e=Z.now(xZe)),l(t)||(t=new d);let i=this._position;if(q.isConstant(i))return this._normalize?void 0:d.clone(d.ZERO,t);let o=i.getValue(e,yZe),r=i.getValue(Z.addSeconds(e,Jj,bue),xue);if(!l(o)||!l(r)&&(r=o,o=i.getValue(Z.addSeconds(e,-Jj,bue),xue),!l(o)))return;if(d.equals(o,r))return this._normalize?void 0:d.clone(d.ZERO,t);l(n)&&o.clone(n);let s=d.subtract(r,o,t);return this._normalize?d.normalize(s,t):d.divideByScalar(s,Jj,t)};IA.prototype.equals=function(e){return this===e||e instanceof IA&&q.equals(this._position,e._position)};var fy=IA;function vD(e,t){this._velocityVectorProperty=new fy(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new me,this.ellipsoid=y(t,ee.default);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(vD.prototype,{isConstant:{get:function(){return q.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var Tue=new d,bZe=new d,Cue=new $,TZe=new Z;vD.prototype.getValue=function(e,t){l(e)||(e=Z.now(TZe));let n=this._velocityVectorProperty._getValue(e,bZe,Tue);if(l(n))return Mt.rotationMatrixFromPositionVelocity(Tue,n,this._ellipsoid,Cue),Oe.fromRotationMatrix(Cue,t)};vD.prototype.equals=function(e){return this===e||e instanceof vD&&q.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var H3=vD;var Jp={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Jp.validate=function(e){return e===Jp.COMPLETE||e===Jp.BELOW_ELLIPSOID_HORIZON||e===Jp.ABOVE_ELLIPSOID_HORIZON};Jp.toString=function(e){switch(e){case Jp.COMPLETE:return"COMPLETE";case Jp.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Jp.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new he("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var wD=Jp;function dy(){}dy.packedLength=d.packedLength;dy.unpack=d.unpack;dy.pack=d.pack;var e7;function DD(e,t){return t[0]==="#"&&(t=e7+t),ay.fromString(e,t)}function Aue(e,t,n){if(l(n.reference))return DD(t,n.reference);if(l(n.velocityReference)){let i=DD(t,n.velocityReference);switch(e){case d:case dy:return new fy(i,e===dy);case Oe:return new H3(i)}}throw new re(`${JSON.stringify(n)} is not valid CZML.`)}function CZe(e,t){return new Vh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Fi=new d,Wc=new U3,rc=new fe,Wx=new En,G3=new Oe;function AZe(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=z.byteToFloat(n[o+1]),t[o+2]=z.byteToFloat(n[o+2]),t[o+3]=z.byteToFloat(n[o+3]),t[o+4]=z.byteToFloat(n[o+4]);return t}function Eue(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):Se.createIfNeeded(n)}function EZe(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===se.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=P.toRadians(n[o+1]),t[o+2]=P.toRadians(n[o+2]),t[o+3]=P.toRadians(n[o+3]),t[o+4]=P.toRadians(n[o+4]);return t}function SZe(e){let t=e.length;if(Wc.magnitude=1,t===2)return Wc.clock=e[0],Wc.cone=e[1],d.fromSpherical(Wc,Fi),[Fi.x,Fi.y,Fi.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],Wc.clock=e[i+1],Wc.cone=e[i+2],d.fromSpherical(Wc,Fi),n[o+1]=Fi.x,n[o+2]=Fi.y,n[o+3]=Fi.z;return n}function vZe(e){let t=e.length;if(t===3)return Wc.clock=e[0],Wc.cone=e[1],Wc.magnitude=e[2],d.fromSpherical(Wc,Fi),[Fi.x,Fi.y,Fi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Wc.clock=e[i+1],Wc.cone=e[i+2],Wc.magnitude=e[i+3],d.fromSpherical(Wc,Fi),n[i+1]=Fi.x,n[i+2]=Fi.y,n[i+3]=Fi.z;return n}function wZe(e){let t=e.length;if(t===3)return rc.longitude=e[0],rc.latitude=e[1],rc.height=e[2],ee.default.cartographicToCartesian(rc,Fi),[Fi.x,Fi.y,Fi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],rc.longitude=e[i+1],rc.latitude=e[i+2],rc.height=e[i+3],ee.default.cartographicToCartesian(rc,Fi),n[i+1]=Fi.x,n[i+2]=Fi.y,n[i+3]=Fi.z;return n}function DZe(e){let t=e.length;if(t===3)return rc.longitude=P.toRadians(e[0]),rc.latitude=P.toRadians(e[1]),rc.height=e[2],ee.default.cartographicToCartesian(rc,Fi),[Fi.x,Fi.y,Fi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],rc.longitude=P.toRadians(e[i+1]),rc.latitude=P.toRadians(e[i+2]),rc.height=e[i+3],ee.default.cartographicToCartesian(rc,Fi),n[i+1]=Fi.x,n[i+2]=Fi.y,n[i+3]=Fi.z;return n}function t7(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return SZe(o);let r=e.spherical;if(l(r))return vZe(r);let s=e.cartographicRadians;if(l(s))return wZe(s);let a=e.cartographicDegrees;if(l(a))return DZe(a);throw new re(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Sue(e,t){d.unpack(e,t,Fi),d.normalize(Fi,Fi),d.pack(Fi,e,t)}function IZe(e){let t=t7(e);if(t.length===3)return Sue(t,0),t;for(let n=1;n<t.length;n+=4)Sue(t,n);return t}function vue(e,t){Oe.unpack(e,t,G3),Oe.normalize(G3,G3),Oe.pack(G3,e,t)}function PZe(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return vue(t,0),t;for(let n=1;n<t.length;n+=5)vue(t,n)}return t}function wue(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?qe:e.hasOwnProperty("cartesian2")?U:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?d:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?dy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?tn:e.hasOwnProperty("classificationType")?kn:e.hasOwnProperty("colorBlendMode")?Fc:e.hasOwnProperty("cornerType")?Ni:e.hasOwnProperty("heightReference")?Ye:e.hasOwnProperty("horizontalOrigin")?yi:e.hasOwnProperty("date")?Z:e.hasOwnProperty("labelStyle")?Xo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?kt:e.hasOwnProperty("distanceDisplayCondition")?Lt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Oe:e.hasOwnProperty("shadowMode")?xn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?dm:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?se:e.hasOwnProperty("uri")?PD.default:e.hasOwnProperty("verticalOrigin")?On:Object}function RZe(e,t,n){switch(e){case tn:return tn[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case qe:return t.boundingRectangle;case U:return t.cartesian2;case d:return t7(t);case dy:return IZe(t);case z:return AZe(t);case kn:return kn[y(t.classificationType,t)];case Fc:return Fc[y(t.colorBlendMode,t)];case Ni:return Ni[y(t.cornerType,t)];case Ye:return Ye[y(t.heightReference,t)];case yi:return yi[y(t.horizontalOrigin,t)];case Image:return Eue(t,n);case Z:return Z.fromIso8601(y(t.date,t));case Xo:return Xo[y(t.labelStyle,t)];case Number:return y(t.number,t);case kt:return t.nearFarScalar;case Lt:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case Oe:return PZe(t);case Vd:return y(t.number,t);case wD:return wD[y(t.portionToDisplay,t)];case xn:return xn[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case dm:return dm[y(t.stripeOrientation,t)];case se:return EZe(t);case PD.default:return Eue(t,n);case On:return On[y(t.verticalOrigin,t)];default:throw new re(`Unknown CzmlDataSource interval type: ${e}`)}}var OZe={HERMITE:k3,LAGRANGE:V3,LINEAR:CA};function W3(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:OZe[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=Lf[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=Lf[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Due={iso8601:void 0};function sr(e){if(l(e))return Due.iso8601=e,En.fromIso8601(Due)}function n7(e){let t=He.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Iue(e){let t=new zc;return t.intervals.addInterval(n7(e)),t}function Pue(e){let t=new Sa(e.referenceFrame);return t.intervals.addInterval(n7(e)),t}function j3(e,t,n,i,o,r,s){let a=sr(i.interval);l(o)&&(l(a)?a=En.intersect(a,o,Wx):a=o);let c,u,f,h=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(He.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return zue(t[n],a)}let _=!1;if(h){if(u=RZe(e,i,r),!l(u))return;c=y(e.packedLength,1),f=y(u.length,1),_=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==Vd;if(!_&&!p){h?t[n]=new Yn(m?e.unpack(u,0):u):t[n]=Aue(e,s,i);return}let x=t[n],b,T=i.epoch;if(l(T)&&(b=Z.fromIso8601(T)),_&&!p){x instanceof Ff||(t[n]=x=new Ff(e)),x.addSamplesPackedArray(u,b),W3(i,x);return}let C;if(!_&&p){a=a.clone(),h?a.data=m?e.unpack(u,0):u:a.data=Aue(e,s,i),l(x)||(t[n]=x=h?new uy:new zc),h&&x instanceof uy?x.intervals.addInterval(a):x instanceof zc?(h&&(a.data=new Yn(a.data)),x.intervals.addInterval(a)):(t[n]=x=Iue(x),h&&(a.data=new Yn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new zc),x instanceof zc||(t[n]=x=Iue(x));let A=x.intervals;C=A.findInterval(a),(!l(C)||!(C.data instanceof Ff))&&(C=a.clone(),C.data=new Ff(e),A.addInterval(C)),C.data.addSamplesPackedArray(u,b),W3(i,C.data)}function zue(e,t){if(e instanceof Ff){e.removeSamples(t);return}else if(e instanceof uy){e.intervals.removeInterval(t);return}else if(e instanceof zc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=En.intersect(n.get(i),t,Wx);o.isEmpty||zue(o.data,t)}n.removeInterval(t);return}}function _e(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)j3(e,t,n,i[a],o,r,s);else j3(e,t,n,i,o,r,s)}function Rue(e,t,n,i,o,r){let s=sr(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,Wx):s=i);let a=l(n.cartesianVelocity)?1:0,c=d.packedLength*(a+1),u,f,h=!l(n.reference),p=l(s)&&!s.equals(He.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return Hue(e[t],s)}let _,m=!1;if(h&&(l(n.referenceFrame)&&(_=Ui[n.referenceFrame]),_=y(_,Ui.FIXED),u=t7(n),f=y(u.length,1),m=f>c),!m&&!p){h?e[t]=new gl(d.unpack(u),_):e[t]=DD(r,n.reference);return}let x=e[t],b,T=n.epoch;if(l(T)&&(b=Z.fromIso8601(T)),m&&!p){(!(x instanceof va)||l(_)&&x.referenceFrame!==_)&&(e[t]=x=new va(_,a)),x.addSamplesPackedArray(u,b),W3(n,x);return}let C;if(!m&&p){s=s.clone(),h?s.data=d.unpack(u):s.data=DD(r,n.reference),l(x)||(h?x=new ly(_):x=new Sa(_),e[t]=x),h&&x instanceof ly&&l(_)&&x.referenceFrame===_?x.intervals.addInterval(s):x instanceof Sa?(h&&(s.data=new gl(s.data,_)),x.intervals.addInterval(s)):(e[t]=x=Pue(x),h&&(s.data=new gl(s.data,_)),x.intervals.addInterval(s));return}l(x)?x instanceof Sa||(e[t]=x=Pue(x)):e[t]=x=new Sa(_);let A=x.intervals;C=A.findInterval(s),(!l(C)||!(C.data instanceof va)||l(_)&&C.data.referenceFrame!==_)&&(C=s.clone(),C.data=new va(_,a),A.addInterval(C)),C.data.addSamplesPackedArray(u,b),W3(n,C.data)}function Hue(e,t){if(e instanceof va){e.removeSamples(t);return}else if(e instanceof ly){e.intervals.removeInterval(t);return}else if(e instanceof Sa){let n=e.intervals;for(let i=0;i<n.length;++i){let o=En.intersect(n.get(i),t,Wx);o.isEmpty||Hue(o.data,t)}n.removeInterval(t);return}}function Gue(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Rue(e,t,n[s],i,o,r);else Rue(e,t,n,i,o,r)}function Oue(e,t,n,i){l(n.references)?q3(e,t,n.references,n.interval,i,ED,zc):(l(n.cartesian2)?n.array=U.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=U.unpackArray(n.cartesian)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i))}function Mue(e,t,n,i,o,r){let s=sr(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,Wx):s=i);let a=e[t],c,u;if(l(s)){a instanceof uD||(a=new uD,e[t]=a);let h=a.intervals;u=h.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),h.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof zt||(c=new zt),f=n.solidColor,_e(z,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof bD||(c=new bD),f=n.grid,_e(z,c,"color",f.color,void 0,o,r),_e(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),_e(U,c,"lineCount",f.lineCount,void 0,o,r),_e(U,c,"lineThickness",f.lineThickness,void 0,o,r),_e(U,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof X0||(c=new X0),f=n.image,_e(Image,c,"image",f.image,void 0,o,r),_e(U,c,"repeat",f.repeat,void 0,o,r),_e(z,c,"color",f.color,void 0,o,r),_e(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof SD||(c=new SD),f=n.stripe,_e(dm,c,"orientation",f.orientation,void 0,o,r),_e(z,c,"evenColor",f.evenColor,void 0,o,r),_e(z,c,"oddColor",f.oddColor,void 0,o,r),_e(Number,c,"offset",f.offset,void 0,o,r),_e(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof zx||(c=new zx),f=n.polylineOutline,_e(z,c,"color",f.color,void 0,o,r),_e(z,c,"outlineColor",f.outlineColor,void 0,o,r),_e(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof AD||(c=new AD),f=n.polylineGlow,_e(z,c,"color",f.color,void 0,o,r),_e(Number,c,"glowPower",f.glowPower,void 0,o,r),_e(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof TD||(c=new TD),f=n.polylineArrow,_e(z,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof CD||(c=new CD),f=n.polylineDash,_e(z,c,"color",f.color,void 0,void 0,r),_e(z,c,"gapColor",f.gapColor,void 0,void 0,r),_e(Number,c,"dashLength",f.dashLength,void 0,o,r),_e(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof sD||(c=new sD),f=n.checkerboard,_e(z,c,"evenColor",f.evenColor,void 0,o,r),_e(z,c,"oddColor",f.oddColor,void 0,o,r),_e(U,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function hu(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Mue(e,t,n[s],i,o,r);else Mue(e,t,n,i,o,r)}function MZe(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function LZe(e,t,n,i){let o=t.description;l(o)&&_e(String,e,"description",o,void 0,i,n)}function NZe(e,t,n,i){let o=t.position;l(o)&&Gue(e,"position",o,void 0,i,n)}function FZe(e,t,n,i){let o=t.viewFrom;l(o)&&_e(d,e,"viewFrom",o,void 0,i,n)}function BZe(e,t,n,i){let o=t.orientation;l(o)&&_e(Oe,e,"orientation",o,void 0,i,n)}function kZe(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Zl);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)j3(wue(s[a]),e.properties,r,s[a],void 0,i,n);else j3(wue(s),e.properties,r,s,void 0,i,n)}}}function q3(e,t,n,i,o,r,s){let a=n.map(function(c){return DD(o,c)});if(l(i)){i=sr(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(n7(c)),e[t]=c=u}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function Lue(e,t,n,i){let o=n.references;l(o)?q3(e,t,o,n.interval,i,ED,zc):_e(Array,e,t,n,void 0,void 0,i)}function Nue(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Lue(e,t,n[o],i);else Lue(e,t,n,i)}function Fue(e,t,n,i){let o=n.references;l(o)?q3(e,t,o,n.interval,i,ry,Sa):(l(n.cartesian)?n.array=d.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=d.fromRadiansArrayHeights(n.cartographicRadians,ee.default):l(n.cartographicDegrees)&&(n.array=d.fromDegreesArrayHeights(n.cartographicDegrees,ee.default)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i))}function RD(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Fue(e,t,n[o],i);else Fue(e,t,n,i)}function VZe(e){return d.unpackArray(e)}function UZe(e){return d.fromRadiansArrayHeights(e,ee.default)}function zZe(e){return d.fromDegreesArrayHeights(e,ee.default)}function Bue(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return q3(a,"positions",s,n.interval,i,ry,Sa),a.positions});e[t]=new ry(r)}else l(n.cartesian)?n.array=n.cartesian.map(VZe):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(UZe):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(zZe)),l(n.array)&&_e(Array,e,t,n,void 0,void 0,i)}function HZe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Bue(e,t,n[o],i);else Bue(e,t,n,i)}function GZe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Oue(e,t,n[o],i);else Oue(e,t,n,i)}function WZe(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new Yr),r.addInterval(sr(o[s]));else r=new Yr,r.addInterval(sr(o));e.availability=r}function jZe(e,t,n,i,o){l(t)&&_e(dy,e,"alignedAxis",t,n,i,o)}function qZe(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=sr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new Ec),_e(Boolean,s,"show",o.show,r,i,n),_e(Image,s,"image",o.image,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(U,s,"pixelOffset",o.pixelOffset,r,i,n),_e(d,s,"eyeOffset",o.eyeOffset,r,i,n),_e(yi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),_e(On,s,"verticalOrigin",o.verticalOrigin,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(z,s,"color",o.color,r,i,n),_e(Vd,s,"rotation",o.rotation,r,i,n),jZe(s,o.alignedAxis,r,i,n),_e(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),_e(qe,s,"imageSubRegion",o.imageSubRegion,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function YZe(e,t,n,i){let o=t.box;if(!l(o))return;let r=sr(o.interval),s=e.box;l(s)||(e.box=s=new zT),_e(Boolean,s,"show",o.show,r,i,n),_e(d,s,"dimensions",o.dimensions,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),hu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function XZe(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=sr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new GT),_e(Boolean,s,"show",o.show,r,i,n),RD(s,"positions",o.positions,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(Ni,s,"cornerType",o.cornerType,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),hu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(kn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function KZe(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=sr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new WT),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"length",o.length,r,i,n),_e(Number,s,"topRadius",o.topRadius,r,i,n),_e(Number,s,"bottomRadius",o.bottomRadius,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),hu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),_e(Number,s,"slices",o.slices,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function ZZe(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new re("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new re("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function $Ze(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=sr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new jT),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),_e(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(Vd,s,"rotation",o.rotation,r,i,n),_e(Vd,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),hu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(kn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function QZe(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=sr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new qT),_e(Boolean,s,"show",o.show,r,i,n),_e(d,s,"radii",o.radii,r,i,n),_e(d,s,"innerRadii",o.innerRadii,r,i,n),_e(Number,s,"minimumClock",o.minimumClock,r,i,n),_e(Number,s,"maximumClock",o.maximumClock,r,i,n),_e(Number,s,"minimumCone",o.minimumCone,r,i,n),_e(Number,s,"maximumCone",o.maximumCone,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),hu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"stackPartitions",o.stackPartitions,r,i,n),_e(Number,s,"slicePartitions",o.slicePartitions,r,i,n),_e(Number,s,"subdivisions",o.subdivisions,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function JZe(e,t,n,i){let o=t.label;if(!l(o))return;let r=sr(o.interval),s=e.label;l(s)||(e.label=s=new Fh),_e(Boolean,s,"show",o.show,r,i,n),_e(String,s,"text",o.text,r,i,n),_e(String,s,"font",o.font,r,i,n),_e(Xo,s,"style",o.style,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(Boolean,s,"showBackground",o.showBackground,r,i,n),_e(z,s,"backgroundColor",o.backgroundColor,r,i,n),_e(U,s,"backgroundPadding",o.backgroundPadding,r,i,n),_e(U,s,"pixelOffset",o.pixelOffset,r,i,n),_e(d,s,"eyeOffset",o.eyeOffset,r,i,n),_e(yi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),_e(On,s,"verticalOrigin",o.verticalOrigin,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(z,s,"fillColor",o.fillColor,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),_e(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function e$e(e,t,n,i){let o=t.model;if(!l(o))return;let r=sr(o.interval),s=e.model;l(s)||(e.model=s=new $g),_e(Boolean,s,"show",o.show,r,i,n),_e(PD.default,s,"uri",o.gltf,r,i,n),_e(Number,s,"scale",o.scale,r,i,n),_e(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),_e(Number,s,"maximumScale",o.maximumScale,r,i,n),_e(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),_e(Boolean,s,"runAnimations",o.runAnimations,r,i,n),_e(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(z,s,"silhouetteColor",o.silhouetteColor,r,i,n),_e(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),_e(z,s,"color",o.color,r,i,n),_e(Fc,s,"colorBlendMode",o.colorBlendMode,r,i,n),_e(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)kue(s,u[a],r,i,n);else kue(s,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)Vue(s,f[a],r,i,n);else Vue(s,f,r,i,n)}function kue(e,t,n,i,o){let r=sr(t.interval);l(n)&&(l(r)?r=En.intersect(r,n,Wx):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let h=t[f];if(!l(h))continue;l(s)||(e.nodeTransformations=s=new Zl),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new YT),_e(d,p,"translation",h.translation,r,i,o),_e(Oe,p,"rotation",h.rotation,r,i,o),_e(d,p,"scale",h.scale,r,i,o)}}function Vue(e,t,n,i,o){let r=sr(t.interval);l(n)&&(l(r)?r=En.intersect(r,n,Wx):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let h=t[f];l(h)&&(l(s)||(e.articulations=s=new Zl),s.hasProperty(f)||s.addProperty(f),_e(Number,s,f,h,r,i,o))}}function t$e(e,t,n,i){let o=t.path;if(!l(o))return;let r=sr(o.interval),s=e.path;l(s)||(e.path=s=new Qg),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"leadTime",o.leadTime,r,i,n),_e(Number,s,"trailTime",o.trailTime,r,i,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"resolution",o.resolution,r,i,n),hu(s,"material",o.material,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function n$e(e,t,n,i){let o=t.point;if(!l(o))return;let r=sr(o.interval),s=e.point;l(s)||(e.point=s=new KT),_e(Boolean,s,"show",o.show,r,i,n),_e(Number,s,"pixelSize",o.pixelSize,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(z,s,"color",o.color,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),_e(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function ID(e){this.polygon=e,this._definitionChanged=new me}Object.defineProperties(ID.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});ID.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new Xa(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Xa(n,i)};ID.prototype.equals=function(e){return this===e||e instanceof ID&&q.equals(this.polygon._positions,e.polygon._positions)&&q.equals(this.polygon._holes,e.polygon._holes)};function i$e(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=sr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Bh),_e(Boolean,s,"show",o.show,r,i,n),RD(s,"_positions",o.positions,n),HZe(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new ID(s)),_e(Number,s,"height",o.height,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(Vd,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),hu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),_e(Boolean,s,"closeTop",o.closeTop,r,i,n),_e(Boolean,s,"closeBottom",o.closeBottom,r,i,n),_e(tn,s,"arcType",o.arcType,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(kn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function o$e(e){return e?tn.GEODESIC:tn.NONE}function r$e(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=sr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new Ic),_e(Boolean,s,"show",o.show,r,i,n),RD(s,"positions",o.positions,n),_e(Number,s,"width",o.width,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),hu(s,"material",o.material,r,i,n),hu(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),_e(tn,s,"arcType",o.arcType,r,i,n),_e(Boolean,s,"clampToGround",o.clampToGround,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(kn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};_e(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=CZe(a.followSurface,o$e)}}function s$e(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=sr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new ZT),RD(s,"positions",o.positions,n),GZe(s,"shape",o.shape,n),_e(Boolean,s,"show",o.show,r,i,n),_e(Ni,s,"cornerType",o.cornerType,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),hu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function a$e(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=sr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new kh),_e(Boolean,s,"show",o.show,r,i,n),_e(se,s,"coordinates",o.coordinates,r,i,n),_e(Number,s,"height",o.height,r,i,n),_e(Ye,s,"heightReference",o.heightReference,r,i,n),_e(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),_e(Ye,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),_e(Vd,s,"rotation",o.rotation,r,i,n),_e(Vd,s,"stRotation",o.stRotation,r,i,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),hu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),_e(kn,s,"classificationType",o.classificationType,r,i,n),_e(Number,s,"zIndex",o.zIndex,r,i,n)}function c$e(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=sr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new XT),_e(Boolean,s,"show",o.show,r,i,n),_e(PD.default,s,"uri",o.uri,r,i,n),_e(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function l$e(e,t,n,i){let o=t.wall;if(!l(o))return;let r=sr(o.interval),s=e.wall;l(s)||(e.wall=s=new Jg),_e(Boolean,s,"show",o.show,r,i,n),RD(s,"positions",o.positions,n),Nue(s,"minimumHeights",o.minimumHeights,n),Nue(s,"maximumHeights",o.maximumHeights,n),_e(Number,s,"granularity",o.granularity,r,i,n),_e(Boolean,s,"fill",o.fill,r,i,n),hu(s,"material",o.material,r,i,n),_e(Boolean,s,"outline",o.outline,r,i,n),_e(z,s,"outlineColor",o.outlineColor,r,i,n),_e(Number,s,"outlineWidth",o.outlineWidth,r,i,n),_e(xn,s,"shadows",o.shadows,r,i,n),_e(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Uue(e,t,n,i,o){let r=e.id;if(l(r)||(r=zn()),e7=r,!l(o._version)&&r!=="document")throw new re("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")ZZe(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}e7=void 0}function u$e(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(He.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Z.secondsDifference(s,r),c=Math.round(a/120);return t=new fm,t.startTime=Z.clone(r),t.stopTime=Z.clone(s),t.clockRange=Kr.LOOP_STOP,t.multiplier=c,t.currentTime=Z.clone(r),t.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new fm,t.startTime=He.MINIMUM_VALUE.clone(),t.stopTime=He.MAXIMUM_VALUE.clone(),t.currentTime=He.MINIMUM_VALUE.clone(),t.clockRange=Kr.LOOP_STOP,t.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=sr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=Z.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Kr[n.range],Kr.LOOP_STOP)),l(n.step)&&(t.clockStep=y(_o[n.step],_o.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Wue(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new At(s)),e._credit=s,typeof t=="string"||t instanceof Se){t=Se.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return r=Se.createIfNeeded(r),Xr.setLoading(e,!0),Promise.resolve(o).then(function(a){return f$e(e,a,r,i)}).catch(function(a){return Xr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function f$e(e,t,n,i){Xr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new jue,o.removeAll()),as._processCzml(t,o,n,void 0,e);let r=u$e(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=oy(n.getUrlComponent()),r=!0),Xr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function jue(){this.name=void 0,this.clock=void 0}function as(e){this._name=e,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._clock=void 0,this._documentPacket=new jue,this._version=void 0,this._entityCollection=new ra(this),this._entityCluster=new Mf,this._credit=void 0,this._resourceCredits=[]}as.load=function(e,t){return new as().load(e,t)};Object.defineProperties(as.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});as.updaters=[qZe,YZe,XZe,KZe,$Ze,QZe,JZe,e$e,MZe,LZe,t$e,n$e,i$e,r$e,s$e,kZe,a$e,NZe,c$e,FZe,l$e,BZe,WZe];as.registerUpdater=function(e){as.updaters.includes(e)||as.updaters.push(e)};as.unregisterUpdater=function(e){if(as.updaters.includes(e)){let t=as.updaters.indexOf(e);as.updaters.splice(t,1)}};as.prototype.process=function(e,t){return Wue(this,e,t,!1)};as.prototype.load=function(e,t){return Wue(this,e,t,!0)};as.prototype.update=function(e){return!0};as.processPacketData=_e;as.processPositionPacketData=Gue;as.processMaterialPacketData=hu;as._processCzml=function(e,t,n,i,o){if(i=y(i,as.updaters),Array.isArray(e))for(let r=0,s=e.length;r<s;++r)Uue(e[r],t,i,n,o);else Uue(e,t,i,n,o)};var Y3=as;function jc(){this._dataSources=[],this._dataSourceAdded=new me,this._dataSourceRemoved=new me,this._dataSourceMoved=new me}Object.defineProperties(jc.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});jc.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};jc.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};jc.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};jc.prototype.contains=function(e){return this.indexOf(e)!==-1};jc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};jc.prototype.get=function(e){return this._dataSources[e]};jc.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function X3(e,t){return e.indexOf(t)}function que(e,t,n){let i=e._dataSources,o=i.length-1;if(t=P.clamp(t,0,o),n=P.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}jc.prototype.raise=function(e){let t=X3(this._dataSources,e);que(this,t,t+1)};jc.prototype.lower=function(e){let t=X3(this._dataSources,e);que(this,t,t-1)};jc.prototype.raiseToTop=function(e){let t=X3(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};jc.prototype.lowerToBottom=function(e){let t=X3(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};jc.prototype.isDestroyed=function(){return!1};jc.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var K3=jc;function aa(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=zn(),this._primitiveAdded=new me,this._primitiveRemoved=new me,this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(aa.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});aa.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e};aa.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};aa.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};aa.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};aa.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function Z3(e,t){return e._primitives.indexOf(t)}aa.prototype.raise=function(e){if(l(e)){let t=Z3(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};aa.prototype.raiseToTop=function(e){if(l(e)){let t=Z3(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};aa.prototype.lower=function(e){if(l(e)){let t=Z3(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};aa.prototype.lowerToBottom=function(e){if(l(e)){let t=Z3(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};aa.prototype.get=function(e){return this._primitives[e]};aa.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};aa.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};aa.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};aa.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};aa.prototype.isDestroyed=function(){return!1};aa.prototype.destroy=function(){return this.removeAll(),ue(this)};var mu=aa;function hm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(hm.prototype,{length:{get:function(){return this._length}}});hm.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new mu({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};hm.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};hm.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};hm.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};hm.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};hm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};hm.prototype.isDestroyed=function(){return!1};hm.prototype.destroy=function(){return this.removeAll(),ue(this)};var $3=hm;function PA(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new vt}PA.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};PA.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};PA.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};PA.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};PA.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):ct.FAILED};var RA=PA;var o7={},Q3=new d,Yue=new d,Xue=new Oe,Kue=new $;function OA(e,t,n,i,o,r,s,a,c,u){let f=e+t;d.multiplyByScalar(i,Math.cos(f),Q3),d.multiplyByScalar(n,Math.sin(f),Yue),d.add(Q3,Yue,Q3);let h=Math.cos(e);h=h*h;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(s*h+o*p)/a;return Oe.fromAxisAngle(Q3,m,Xue),$.fromQuaternion(Xue,Kue),$.multiplyByVector(Kue,c,u),d.normalize(u,u),d.multiplyByScalar(u,a,u),u}var Zue=new d,$ue=new d,i7=new d,d$e=new d;o7.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let h=f+1,p=f+2,_=d.fromArray(e,f,Zue);i.scaleToGeodeticSurface(_,_);let m=d.clone(_,$ue),x=i.geodeticSurfaceNormal(_,d$e),b=d.multiplyByScalar(x,o,i7);d.add(_,b,_),n&&(d.multiplyByScalar(x,r,b),d.add(m,b,m),a[f+u]=m.x,a[h+u]=m.y,a[p+u]=m.z),a[f]=_.x,a[h]=_.y,a[p]=_.z}return a};var h$e=new d,m$e=new d,p$e=new d;o7.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=o*o,f=o*i,h=d.magnitude(s),p=d.normalize(s,h$e),_=d.cross(d.UNIT_Z,s,m$e);_=d.normalize(_,_);let m=d.cross(p,_,p$e),x=1+Math.ceil(P.PI_OVER_TWO/a),b=P.PI_OVER_TWO/(x-1),T=P.PI_OVER_TWO-x*b;T<0&&(x-=Math.ceil(Math.abs(T)/b));let C=2*(x*(x+2)),A=t?new Array(C*3):void 0,S=0,v=Zue,D=$ue,O=x*4*3,R=O-1,M=0,L=n?new Array(O):void 0,g,E,w,I,N;for(T=P.PI_OVER_TWO,v=OA(T,r,m,_,c,f,u,h,p,v),t&&(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z),n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x),T=P.PI_OVER_TWO-b,g=1;g<x+1;++g){if(v=OA(T,r,m,_,c,f,u,h,p,v),D=OA(Math.PI-T,r,m,_,c,f,u,h,p,D),t){for(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z,w=2*g+2,E=1;E<w-1;++E)I=E/(w-1),N=d.lerp(v,D,I,i7),A[S++]=N.x,A[S++]=N.y,A[S++]=N.z;A[S++]=D.x,A[S++]=D.y,A[S++]=D.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[M++]=D.x,L[M++]=D.y,L[M++]=D.z),T=P.PI_OVER_TWO-(g+1)*b}for(g=x;g>1;--g){if(T=P.PI_OVER_TWO-(g-1)*b,v=OA(-T,r,m,_,c,f,u,h,p,v),D=OA(T+Math.PI,r,m,_,c,f,u,h,p,D),t){for(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z,w=2*(g-1)+2,E=1;E<w-1;++E)I=E/(w-1),N=d.lerp(v,D,I,i7),A[S++]=N.x,A[S++]=N.y,A[S++]=N.z;A[S++]=D.x,A[S++]=D.y,A[S++]=D.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[M++]=D.x,L[M++]=D.y,L[M++]=D.z)}T=P.PI_OVER_TWO,v=OA(-T,r,m,_,c,f,u,h,p,v);let B={};return t&&(A[S++]=v.x,A[S++]=v.y,A[S++]=v.z,B.positions=A,B.numPts=x),n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,B.outerPositions=L),B};var pu=o7;var MA=new d,r7=new d,s7=new d,Que=new d,As=new U,Jue=new $,g$e=new $,a7=new Oe,efe=new d,tfe=new d,nfe=new d,tk=new fe,ife=new d,ofe=new U,rfe=new U;function sfe(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,h=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,_=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,x=f?new Float32Array(u*3):void 0,b=0,T=efe,C=tfe,A=nfe,S=new Ii(a),v=S.project(a.cartesianToCartographic(o,tk),ife),D=a.scaleToGeodeticSurface(o,MA);a.geodeticSurfaceNormal(D,D);let O=Jue,R=g$e;if(c!==0){let N=Oe.fromAxisAngle(D,c,a7);O=$.fromQuaternion(N,O),N=Oe.fromAxisAngle(D,-c,a7),R=$.fromQuaternion(N,R)}else O=$.clone($.IDENTITY,O),R=$.clone($.IDENTITY,R);let M=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,ofe),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,rfe),g=e.length,E=n?g:0,w=E/3*2;for(let N=0;N<g;N+=3){let B=N+1,H=N+2,V=d.fromArray(e,N,MA);if(i.st){let G=$.multiplyByVector(O,V,r7),k=S.project(a.cartesianToCartographic(G,tk),s7);d.subtract(k,v,k),As.x=(k.x+r)/(2*r),As.y=(k.y+s)/(2*s),M.x=Math.min(As.x,M.x),M.y=Math.min(As.y,M.y),L.x=Math.max(As.x,L.x),L.y=Math.max(As.y,L.y),n&&(h[b+w]=As.x,h[b+1+w]=As.y),h[b++]=As.x,h[b++]=As.y}(i.normal||i.tangent||i.bitangent||f)&&(T=a.geodeticSurfaceNormal(V,T),f&&(x[N+E]=-T.x,x[B+E]=-T.y,x[H+E]=-T.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(C=d.normalize(d.cross(d.UNIT_Z,T,C),C),$.multiplyByVector(R,C,C)),i.normal&&(p[N]=T.x,p[B]=T.y,p[H]=T.z,n&&(p[N+E]=-T.x,p[B+E]=-T.y,p[H+E]=-T.z)),i.tangent&&(_[N]=C.x,_[B]=C.y,_[H]=C.z,n&&(_[N+E]=-C.x,_[B+E]=-C.y,_[H+E]=-C.z)),i.bitangent&&(A=d.normalize(d.cross(T,C,A),A),m[N]=A.x,m[B]=A.y,m[H]=A.z,n&&(m[N+E]=A.x,m[B+E]=A.y,m[H+E]=A.z))))}if(i.st){g=h.length;for(let N=0;N<g;N+=2)h[N]=(h[N]-M.x)/(L.x-M.x),h[N+1]=(h[N+1]-M.y)/(L.y-M.y)}let I=new hn;if(i.position){let N=pu.raisePositionsToHeight(e,t,n);I.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:N})}if(i.st&&(I.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(I.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_})),i.bitangent&&(I.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===sn.TOP)N=N.fill(1,0,u/2);else{let B=t.offsetAttribute===sn.NONE?0:1;N=N.fill(B)}I.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return I}function afe(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var jx=new d;function _$e(e){let t=e.center;jx=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,jx),e.height,jx),jx=d.add(t,jx,jx);let n=new ae(jx,e.semiMajorAxis),i=pu.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=sfe(o,e,!1),a=afe(r);return a=Ne.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function y$e(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,h=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,_=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,x=n.bitangent?new Float32Array(f*3):void 0,b=t.shadowVolume,T=b?new Float32Array(f*3):void 0,C=0,A=efe,S=tfe,v=nfe,D=new Ii(s),O=D.project(s.cartesianToCartographic(i,tk),ife),R=s.scaleToGeodeticSurface(i,MA);s.geodeticSurfaceNormal(R,R);let M=Oe.fromAxisAngle(R,u,a7),L=$.fromQuaternion(M,Jue),g=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,ofe),E=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,rfe),w=e.length,I=w/3*2;for(let B=0;B<w;B+=3){let H=B+1,V=B+2,G=d.fromArray(e,B,MA),k;if(n.st){let Y=$.multiplyByVector(L,G,r7),J=D.project(s.cartesianToCartographic(Y,tk),s7);d.subtract(J,O,J),As.x=(J.x+o)/(2*o),As.y=(J.y+r)/(2*r),g.x=Math.min(As.x,g.x),g.y=Math.min(As.y,g.y),E.x=Math.max(As.x,E.x),E.y=Math.max(As.y,E.y),p[C+I]=As.x,p[C+1+I]=As.y,p[C++]=As.x,p[C++]=As.y}G=s.scaleToGeodeticSurface(G,G),k=d.clone(G,r7),A=s.geodeticSurfaceNormal(G,A),b&&(T[B+w]=-A.x,T[H+w]=-A.y,T[V+w]=-A.z);let W=d.multiplyByScalar(A,a,Que);if(G=d.add(G,W,G),W=d.multiplyByScalar(A,c,W),k=d.add(k,W,k),n.position&&(h[B+w]=k.x,h[H+w]=k.y,h[V+w]=k.z,h[B]=G.x,h[H]=G.y,h[V]=G.z),n.normal||n.tangent||n.bitangent){v=d.clone(A,v);let Y=d.fromArray(e,(B+3)%w,Que);d.subtract(Y,G,Y);let J=d.subtract(k,G,s7);A=d.normalize(d.cross(J,Y,A),A),n.normal&&(_[B]=A.x,_[H]=A.y,_[V]=A.z,_[B+w]=A.x,_[H+w]=A.y,_[V+w]=A.z),n.tangent&&(S=d.normalize(d.cross(v,A,S),S),m[B]=S.x,m[H]=S.y,m[V]=S.z,m[B+w]=S.x,m[B+1+w]=S.y,m[B+2+w]=S.z),n.bitangent&&(x[B]=v.x,x[H]=v.y,x[V]=v.z,x[B+w]=v.x,x[H+w]=v.y,x[V+w]=v.z)}}if(n.st){w=p.length;for(let B=0;B<w;B+=2)p[B]=(p[B]-g.x)/(E.x-g.x),p[B+1]=(p[B+1]-g.y)/(E.y-g.y)}let N=new hn;if(n.position&&(N.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(N.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(N.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_})),n.tangent&&(N.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(N.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),b&&(N.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),l(t.offsetAttribute)){let B=new Uint8Array(f);if(t.offsetAttribute===sn.TOP)B=B.fill(1,0,f/2);else{let H=t.offsetAttribute===sn.NONE?0:1;B=B.fill(H)}N.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return N}function x$e(e){let t=e.length/3,n=Ne.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var J3=new ae,ek=new ae;function b$e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,MA),e.height,MA);J3.center=d.add(t,o,J3.center),J3.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),ek.center=d.add(t,o,ek.center),ek.radius=i;let r=pu.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,u=ae.union(J3,ek),f=sfe(s,e,!0),h=afe(a),p=h.length;h.length=p*2;let _=s.length/3;for(let S=0;S<p;S+=3)h[S+p]=h[S+2]+_,h[S+1+p]=h[S+1]+_,h[S+2+p]=h[S]+_;let m=Ne.createTypedArray(_*2/3,h),x=new at({attributes:f,indices:m,primitiveType:Me.TRIANGLES}),b=y$e(c,e);h=x$e(c);let T=Ne.createTypedArray(c.length*2/3,h),C=new at({attributes:b,indices:T,primitiveType:Me.TRIANGLES}),A=Nn.combineInstances([new wt({geometry:x}),new wt({geometry:C})]);return{boundingSphere:u,attributes:A[0].attributes,indices:A[0].indices}}function cfe(e,t,n,i,o,r,s){let c=pu.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=d.fromArray(c,p*3);let h=se.fromCartesianArray(f,r,s);return h.width>P.PI&&(h.north=h.north>0?P.PI_OVER_TWO-P.EPSILON7:h.north,h.south=h.south<0?P.EPSILON7-P.PI_OVER_TWO:h.south,h.east=P.PI,h.west=-P.PI),h}function pm(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ee.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Ie.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ee.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Ie.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}pm.packedLength=d.packedLength+ee.packedLength+Ie.packedLength+9;pm.pack=function(e,t,n){return n=y(n,0),d.pack(e._center,t,n),n+=d.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var lfe=new d,ufe=new ee,ffe=new Ie,mm={center:lfe,ellipsoid:ufe,vertexFormat:ffe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};pm.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,lfe);t+=d.packedLength;let o=ee.unpack(e,t,ufe);t+=ee.packedLength;let r=Ie.unpack(e,t,ffe);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++],_=e[t++]===1,m=e[t];return l(n)?(n._center=d.clone(i,n._center),n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=_,n._offsetAttribute=m===-1?void 0:m,n):(mm.height=f,mm.extrudedHeight=p,mm.granularity=h,mm.stRotation=u,mm.rotation=c,mm.semiMajorAxis=s,mm.semiMinorAxis=a,mm.shadowVolume=_,mm.offsetAttribute=m===-1?void 0:m,new pm(mm))};pm.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,ee.default),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,P.RADIANS_PER_DEGREE),a=y(e.rotation,0);return cfe(n,o,r,a,s,i,t)};pm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=b$e(o);else if(r=_$e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===sn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new at({attributes:r.attributes,indices:r.indices,primitiveType:Me.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};pm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new pm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};function T$e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=pu.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=d.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return at._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(pm.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=cfe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=T$e(this)),this._textureCoordinateRotationPoints}}});var wl=pm;var dfe=new d,qx=new d;function C$e(e){let t=e.center;qx=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,qx),e.height,qx),qx=d.add(t,qx,qx);let n=new ae(qx,e.semiMajorAxis),i=pu.computeEllipsePositions(e,!1,!0).outerPositions,o=new hn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:pu.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ne.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var nk=new ae,ik=new ae;function A$e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,dfe),e.height,dfe);nk.center=d.add(t,o,nk.center),nk.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),ik.center=d.add(t,o,ik.center),ik.radius=i;let r=pu.computeEllipsePositions(e,!1,!0).outerPositions,s=new hn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:pu.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ae.union(nk,ik),c=r.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===sn.TOP)m=m.fill(1,0,c/2);else{let x=e.offsetAttribute===sn.NONE?0:1;m=m.fill(x)}s.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=y(e.numberOfVerticalLines,16);u=P.clamp(u,0,c/2);let f=Ne.createTypedArray(c,c*2+u*2);c/=2;let h=0,p;for(p=0;p<c;++p)f[h++]=p,f[h++]=(p+1)%c,f[h++]=p+c,f[h++]=(p+1)%c+c;let _;if(u>0){let m=Math.min(u,c);_=Math.round(c/m);let x=Math.min(_*u,c);for(p=0;p<x;p+=_)f[h++]=p,f[h++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function LA(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ee.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ee.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}LA.packedLength=d.packedLength+ee.packedLength+8;LA.pack=function(e,t,n){return n=y(n,0),d.pack(e._center,t,n),n+=d.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var hfe=new d,mfe=new ee,eg={center:hfe,ellipsoid:mfe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};LA.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,hfe);t+=d.packedLength;let o=ee.unpack(e,t,mfe);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._center=d.clone(i,n._center),n._ellipsoid=ee.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=h,n._offsetAttribute=p===-1?void 0:p,n):(eg.height=c,eg.extrudedHeight=f,eg.granularity=u,eg.rotation=a,eg.semiMajorAxis=r,eg.semiMinorAxis=s,eg.numberOfVerticalLines=h,eg.offsetAttribute=p===-1?void 0:p,new LA(eg))};LA.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=A$e(o);else if(r=C$e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===sn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new at({attributes:r.attributes,indices:r.indices,primitiveType:Me.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var kf=LA;var pfe=new z,gfe=d.ZERO,_fe=new d,yfe=new se;function E$e(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Ud(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new E$e(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Ud.prototype=Object.create(Gn.prototype),Ud.prototype.constructor=Ud);Ud.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,pfe)),l(o)||(o=z.WHITE),i.color=Wt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,gfe,_fe))),new wt({id:t,geometry:new wl(this._options),attributes:i})};Ud.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,pfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,gfe,_fe))),new wt({id:t,geometry:new kf(this._options),attributes:r})};Ud.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Ud.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||ii.prototype._isHidden.call(this,e,t)};Ud.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!q.isConstant(t.rotation)||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};Ud.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,He.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),o=q.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),r=q.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof zt?cn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(He.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(He.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(He.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=q.getValueOrUndefined(t.rotation,He.MINIMUM_VALUE),s.granularity=q.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),s.stRotation=q.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),s.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,He.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=li.getMinimumMaximumHeights(wl.computeRectangle(s,yfe)).minimumTerrainHeight),s.extrudedHeight=o};Ud.DynamicGeometryUpdater=NA;function NA(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(NA.prototype=Object.create(ni.prototype),NA.prototype.constructor=NA);NA.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ni.prototype._isHidden.call(this,e,t,n)};NA.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,Ye.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.center=q.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=q.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=q.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(wl.computeRectangle(i,yfe)).minimumTerrainHeight),i.extrudedHeight=s};var ok=Ud;var S$e=new d,v$e=new d,w$e=new d,D$e=new d,I$e=new d,P$e=new d(1,1,1),xfe=Math.cos,bfe=Math.sin;function tg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,P$e),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,P.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,P.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),u=y(e.vertexFormat,Ie.DEFAULT);this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Ie.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}tg.packedLength=2*d.packedLength+Ie.packedLength+7;tg.pack=function(e,t,n){return n=y(n,0),d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var Tfe=new d,Cfe=new d,Afe=new Ie,hy={radii:Tfe,innerRadii:Cfe,vertexFormat:Afe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};tg.unpack=function(e,t,n){t=y(t,0);let i=d.unpack(e,t,Tfe);t+=d.packedLength;let o=d.unpack(e,t,Cfe);t+=d.packedLength;let r=Ie.unpack(e,t,Afe);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=h,n._offsetAttribute=p===-1?void 0:p,n):(hy.minimumClock=s,hy.maximumClock=a,hy.minimumCone=c,hy.maximumCone=u,hy.stackPartitions=f,hy.slicePartitions=h,hy.offsetAttribute=p===-1?void 0:p,new tg(hy))};tg.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/P.TWO_PI),u=Math.round(u*Math.abs(s-r)/P.PI),c<2&&(c=2),u<2&&(u=2);let f,h,p=0,_=[r],m=[i];for(f=0;f<u;f++)_.push(r+f*(s-r)/(u-1));for(_.push(s),h=0;h<c;h++)m.push(i+h*(o-i)/(c-1));m.push(o);let x=_.length,b=m.length,T=0,C=1,A=n.x!==t.x||n.y!==t.y||n.z!==t.z,S=!1,v=!1,D=!1;A&&(C=2,r>0&&(S=!0,T+=c-1),s<Math.PI&&(v=!0,T+=c-1),(o-i)%P.TWO_PI?(D=!0,T+=(u-1)*2+1):T+=1);let O=b*x*C,R=new Float64Array(O*3),M=new Array(O).fill(!1),L=new Array(O).fill(!1),g=c*u*C,E=6*(g+T+1-(c+u)*C),w=Ne.createTypedArray(g,E),I=a.normal?new Float32Array(O*3):void 0,N=a.tangent?new Float32Array(O*3):void 0,B=a.bitangent?new Float32Array(O*3):void 0,H=a.st?new Float32Array(O*2):void 0,V=new Array(x),G=new Array(x);for(f=0;f<x;f++)V[f]=bfe(_[f]),G[f]=xfe(_[f]);let k=new Array(b),W=new Array(b);for(h=0;h<b;h++)W[h]=xfe(m[h]),k[h]=bfe(m[h]);for(f=0;f<x;f++)for(h=0;h<b;h++)R[p++]=t.x*V[f]*W[h],R[p++]=t.y*V[f]*k[h],R[p++]=t.z*G[f];let Y=O/2;if(A)for(f=0;f<x;f++)for(h=0;h<b;h++)R[p++]=n.x*V[f]*W[h],R[p++]=n.y*V[f]*k[h],R[p++]=n.z*G[f],M[Y]=!0,f>0&&f!==x-1&&h!==0&&h!==b-1&&(L[Y]=!0),Y++;p=0;let J,j;for(f=1;f<x-2;f++)for(J=f*b,j=(f+1)*b,h=1;h<b-2;h++)w[p++]=j+h,w[p++]=j+h+1,w[p++]=J+h+1,w[p++]=j+h,w[p++]=J+h+1,w[p++]=J+h;if(A){let et=x*b;for(f=1;f<x-2;f++)for(J=et+f*b,j=et+(f+1)*b,h=1;h<b-2;h++)w[p++]=j+h,w[p++]=J+h,w[p++]=J+h+1,w[p++]=j+h,w[p++]=J+h+1,w[p++]=j+h+1}let K,Q;if(A){if(S)for(Q=x*b,f=1;f<b-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Q+f+1,w[p++]=f,w[p++]=Q+f+1,w[p++]=Q+f;if(v)for(K=x*b-b,Q=x*b*C-b,f=1;f<b-2;f++)w[p++]=K+f+1,w[p++]=K+f,w[p++]=Q+f,w[p++]=K+f+1,w[p++]=Q+f,w[p++]=Q+f+1}if(D){for(f=1;f<x-2;f++)Q=b*x+b*f,K=b*f,w[p++]=Q,w[p++]=K+b,w[p++]=K,w[p++]=Q,w[p++]=Q+b,w[p++]=K+b;for(f=1;f<x-2;f++)Q=b*x+b*(f+1)-1,K=b*(f+1)-1,w[p++]=K+b,w[p++]=Q,w[p++]=K,w[p++]=K+b,w[p++]=Q+b,w[p++]=Q}let de=new hn;a.position&&(de.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:R}));let ye=0,ce=0,ge=0,xe=0,De=O/2,Ae,ke=ee.fromCartesian3(t),ze=ee.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<O;f++){Ae=M[f]?ze:ke;let et=d.fromArray(R,f*3,S$e),St=Ae.geodeticSurfaceNormal(et,v$e);if(L[f]&&d.negate(St,St),a.st){let mt=U.negate(St,I$e);H[ye++]=Math.atan2(mt.y,mt.x)/P.TWO_PI+.5,H[ye++]=Math.asin(St.z)/Math.PI+.5}if(a.normal&&(I[ce++]=St.x,I[ce++]=St.y,I[ce++]=St.z),a.tangent||a.bitangent){let mt=w$e,Be=0,Yt;if(M[f]&&(Be=De),!S&&f>=Be&&f<Be+b*2?Yt=d.UNIT_X:Yt=d.UNIT_Z,d.cross(Yt,St,mt),d.normalize(mt,mt),a.tangent&&(N[ge++]=mt.x,N[ge++]=mt.y,N[ge++]=mt.z),a.bitangent){let Ct=d.cross(St,mt,D$e);d.normalize(Ct,Ct),B[xe++]=Ct.x,B[xe++]=Ct.y,B[xe++]=Ct.z}}}a.st&&(de.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:H})),a.normal&&(de.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(de.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(de.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:B}))}if(l(e._offsetAttribute)){let et=R.length,St=e._offsetAttribute===sn.NONE?0:1,mt=new Uint8Array(et/3).fill(St);de.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:mt})}return new at({attributes:de,indices:w,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromEllipsoid(ke),offsetAttribute:e._offsetAttribute})};var c7;tg.getUnitEllipsoid=function(){return l(c7)||(c7=tg.createGeometry(new tg({radii:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),c7};var ca=tg;var R$e=new zt(z.WHITE),l7=d.ZERO,u7=new d,O$e=new d,M$e=new d,f7=new z,L$e=new d(1,1,1);function N$e(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function gu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new N$e(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(gu.prototype=Object.create(ii.prototype),gu.prototype.constructor=gu);Object.defineProperties(gu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});gu.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new yn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Bn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof zt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,f7)),l(f)||(f=z.WHITE),r=Wt.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,l7,u7))),new wt({id:i,geometry:new ca(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};gu.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,f7),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new yn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(r),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,l7,u7))),new wt({id:i,geometry:new Df(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};gu.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};gu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||ii.prototype._isHidden.call(this,e,t)};gu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.radii.isConstant||!q.isConstant(t.innerRadii)||!q.isConstant(t.stackPartitions)||!q.isConstant(t.slicePartitions)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.minimumClock)||!q.isConstant(t.maximumClock)||!q.isConstant(t.minimumCone)||!q.isConstant(t.maximumCone)||!q.isConstant(t.subdivisions)};gu.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof zt?cn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(He.MINIMUM_VALUE,i.radii),i.innerRadii=q.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=q.getValueOrUndefined(t.minimumClock,He.MINIMUM_VALUE),i.maximumClock=q.getValueOrUndefined(t.maximumClock,He.MINIMUM_VALUE),i.minimumCone=q.getValueOrUndefined(t.minimumCone,He.MINIMUM_VALUE),i.maximumCone=q.getValueOrUndefined(t.maximumCone,He.MINIMUM_VALUE),i.stackPartitions=q.getValueOrUndefined(t.stackPartitions,He.MINIMUM_VALUE),i.slicePartitions=q.getValueOrUndefined(t.slicePartitions,He.MINIMUM_VALUE),i.subdivisions=q.getValueOrUndefined(t.subdivisions,He.MINIMUM_VALUE),i.offsetAttribute=n!==Ye.NONE?sn.ALL:void 0};gu.prototype._onEntityPropertyChanged=e_;gu.DynamicGeometryUpdater=OD;function OD(e,t,n){ni.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new d,this._material={}}l(Object.create)&&(OD.prototype=Object.create(ni.prototype),OD.prototype.constructor=OD);OD.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!q.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=q.getValueOrUndefined(n.radii,e,O$e),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=q.getValueOrDefault(n.fill,e,!0),s=q.getValueOrDefault(n.outline,e,!1),a=q.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,f7),c=ir.getValue(e,y(n.material,R$e),this._material),u=q.getValueOrUndefined(n.innerRadii,e,M$e),f=q.getValueOrUndefined(n.minimumClock,e),h=q.getValueOrUndefined(n.maximumClock,e),p=q.getValueOrUndefined(n.minimumCone,e),_=q.getValueOrUndefined(n.maximumCone,e),m=q.getValueOrUndefined(n.stackPartitions,e),x=q.getValueOrUndefined(n.slicePartitions,e),b=q.getValueOrUndefined(n.subdivisions,e),T=q.getValueOrDefault(n.outlineWidth,e,1),C=q.getValueOrDefault(n.heightReference,e,Ye.NONE),A=C!==Ye.NONE?sn.ALL:void 0,S=this._scene.mode,v=S===ne.SCENE3D&&C===Ye.NONE,D=this._options,O=this._geometryUpdater.shadowsProperty.getValue(e),M=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=q.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,l7,u7);if(!v||this._lastSceneMode!==S||!l(this._primitive)||D.stackPartitions!==m||D.slicePartitions!==x||l(u)&&!d.equals(D.innerRadii!==u)||D.minimumClock!==f||D.maximumClock!==h||D.minimumCone!==p||D.maximumCone!==_||D.subdivisions!==b||this._lastOutlineWidth!==T||D.offsetAttribute!==A){let E=this._primitives;E.removeAndDestroy(this._primitive),E.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=T,D.stackPartitions=m,D.slicePartitions=x,D.subdivisions=b,D.offsetAttribute=A,D.radii=d.clone(v?L$e:i,D.radii),l(u)?v?D.innerRadii=d.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,D.innerRadii):D.innerRadii=d.clone(u,D.innerRadii):D.innerRadii=void 0,D.minimumClock=f,D.maximumClock=h,D.minimumCone=p,D.maximumCone=_;let w=new so({material:c,translucent:c.isTranslucent(),closed:!0});D.vertexFormat=w.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=E.add(new In({geometryInstances:I,appearance:w,asynchronous:!1,shadows:O}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=E.add(new In({geometryInstances:N,appearance:new cn({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(T)}}),asynchronous:!1,shadows:O})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=M,this._lastOffset=d.clone(L,this._lastOffset)}else if(this._primitive.ready){let E=this._primitive,w=this._outlinePrimitive;E.show=!0,w.show=!0,E.appearance.material=c;let I=this._attributes;l(I)||(I=E.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=yn.toValue(r,I.show),this._lastShow=r);let N=this._outlineAttributes;l(N)||(N=w.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=yn.toValue(s,N.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(N.color=Wt.toValue(a,N.color),z.clone(a,this._lastOutlineColor)),Lt.equals(M,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=Bn.toValue(M,I.distanceDisplayCondition),N.distanceDisplayCondition=Bn.toValue(M,N.distanceDisplayCondition),Lt.clone(M,this._lastDistanceDisplayCondition)),d.equals(L,this._lastOffset)||(I.offset=Qi.toValue(L,I.offset),N.offset=Qi.toValue(L,I.offset),d.clone(L,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=F.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var rk=gu;function FA(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Ie.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}FA.packedLength=Ie.packedLength;FA.pack=function(e,t,n){return n=y(n,0),Ie.pack(e._vertexFormat,t,n),t};var Efe=new Ie,F$e={vertexFormat:Efe};FA.unpack=function(e,t,n){t=y(t,0);let i=Ie.unpack(e,t,Efe);return l(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n):new FA(F$e)};var sk=new d(-.5,-.5,0),ak=new d(.5,.5,0);FA.createGeometry=function(e){let t=e._vertexFormat,n=new hn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=sk.x,o[1]=sk.y,o[2]=0,o[3]=ak.x,o[4]=sk.y,o[5]=0,o[6]=ak.x,o[7]=ak.y,o[8]=0,o[9]=sk.x,o[10]=ak.y,o[11]=0,n.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new at({attributes:n,indices:i,primitiveType:Me.TRIANGLES,boundingSphere:new ae(d.ZERO,Math.sqrt(2))})};var ck=FA;function BA(){this._workerName="createPlaneOutlineGeometry"}BA.packedLength=0;BA.pack=function(e,t){return t};BA.unpack=function(e,t,n){return l(n)?n:new BA};var my=new d(-.5,-.5,0),lk=new d(.5,.5,0);BA.createGeometry=function(){let e=new hn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=my.x,n[1]=my.y,n[2]=my.z,n[3]=lk.x,n[4]=my.y,n[5]=my.z,n[6]=lk.x,n[7]=lk.y,n[8]=my.z,n[9]=my.x,n[10]=lk.y,n[11]=my.z,e.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new at({attributes:e,indices:t,primitiveType:Me.LINES,boundingSphere:new ae(d.ZERO,Math.sqrt(2))})};var uk=BA;var B$e=new d,Sfe=new z;function k$e(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Vf(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new k$e(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Vf.prototype=Object.create(ii.prototype),Vf.prototype.constructor=Vf);Vf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Bn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof zt){let _;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(_=this._materialProperty.color.getValue(e,Sfe)),l(_)||(_=z.WHITE),o=Wt.fromColor(_),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),h=q.getValueOrDefault(c.plane,e,u.plane),p=q.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=h,u.dimensions=p,f=d7(h,p,f,f),new wt({id:t,geometry:new ck(this._options),modelMatrix:f,attributes:i})};Vf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Sfe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=q.getValueOrDefault(r.plane,e,s.plane),u=q.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=d7(c,u,a,a),new wt({id:t,geometry:new uk,modelMatrix:a,attributes:{show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o)}})};Vf.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||ii.prototype._isHidden.call(this,e,t)};Vf.prototype._getIsClosed=function(e){return!1};Vf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};Vf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof zt,i=this._options;i.vertexFormat=n?cn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(He.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(He.MINIMUM_VALUE,i.dimensions)};Vf.DynamicGeometryUpdater=kA;function kA(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(kA.prototype=Object.create(ni.prototype),kA.prototype.constructor=kA);kA.prototype._isHidden=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(e.position,n,B$e);return!l(o)||!l(i.plane)||!l(i.dimensions)||ni.prototype._isHidden.call(this,e,t,n)};kA.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=q.getValueOrDefault(t.plane,n,i.plane),i.dimensions=q.getValueOrUndefined(t.dimensions,n,i.dimensions)};var V$e=new d,U$e=new d,z$e=new d,H$e=new d,G$e=new $,W$e=new $,j$e=new F;function d7(e,t,n,i){let o=e.normal,r=e.distance,s=d.multiplyByScalar(o,-r,z$e),a=d.clone(d.UNIT_Z,U$e);P.equalsEpsilon(Math.abs(d.dot(a,o)),1,P.EPSILON8)&&(a=d.clone(d.UNIT_Y,a));let c=d.cross(a,o,V$e);a=d.cross(o,c,a),d.normalize(c,c),d.normalize(a,a);let u=G$e;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,o,u);let f=d.fromElements(t.x,t.y,1,H$e),h=$.multiplyByScale(u,f,W$e),p=F.fromRotationTranslation(h,s,j$e);return F.multiplyTransformation(n,p,i)}Vf.createPrimitiveMatrix=d7;var fk=Vf;var q$e=new d,Y$e=new qe,X$e=new U,K$e=new U,Z$e=new d,$$e=new d,Q$e=new d,MD=new d,J$e=new d,eQe=new d,vfe=new Oe,tQe=new $,nQe=new $,iQe=new d;function oQe(e,t,n,i,o,r,s,a,c){let u=e.positions,f=ri.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let h=Ne.createTypedArray(u.length,f.length);h.set(f);let p=tQe;if(i!==0){let g=Oe.fromAxisAngle(s,i,vfe);if(p=$.fromQuaternion(g,p),t.tangent||t.bitangent){g=Oe.fromAxisAngle(s,-i,vfe);let E=$.fromQuaternion(g,nQe);a=d.normalize($.multiplyByVector(E,a,a),a),t.bitangent&&(c=d.normalize(d.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let _=K$e;t.st&&(_.x=n.x,_.y=n.y);let m=u.length,x=m*3,b=new Float64Array(x),T=t.normal?new Float32Array(x):void 0,C=t.tangent?new Float32Array(x):void 0,A=t.bitangent?new Float32Array(x):void 0,S=t.st?new Float32Array(m*2):void 0,v=0,D=0,O=0,R=0,M=0;for(let g=0;g<m;g++){let E=u[g];if(b[v++]=E.x,b[v++]=E.y,b[v++]=E.z,t.st)if(l(o)&&o.positions.length===m)S[M++]=o.positions[g].x,S[M++]=o.positions[g].y;else{let w=$.multiplyByVector(p,E,q$e),I=r(w,X$e);U.subtract(I,_,I);let N=P.clamp(I.x/n.width,0,1),B=P.clamp(I.y/n.height,0,1);S[M++]=N,S[M++]=B}t.normal&&(T[D++]=s.x,T[D++]=s.y,T[D++]=s.z),t.tangent&&(C[R++]=a.x,C[R++]=a.y,C[R++]=a.z),t.bitangent&&(A[O++]=c.x,A[O++]=c.y,A[O++]=c.z)}let L=new hn;return t.position&&(L.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b})),t.normal&&(L.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:T})),t.tangent&&(L.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:C})),t.bitangent&&(L.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),t.st&&(L.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:S})),new at({attributes:L,indices:h,primitiveType:Me.TRIANGLES})}function Yx(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Ie.DEFAULT);this._vertexFormat=Ie.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Un.computeHierarchyPackedLength(t,d)+Ie.packedLength+ee.packedLength+(l(n)?Un.computeHierarchyPackedLength(n,U):1)+2}Yx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new Yx(t)};Yx.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Un.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n++]=e.packedLength,t};var rQe=ee.clone(ee.UNIT_SPHERE),sQe=new Ie,aQe={polygonHierarchy:{}};Yx.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,rQe);t+=ee.packedLength;let r=Ie.unpack(e,t,sQe);t+=Ie.packedLength;let s=e[t++],a=e[t]===-1?void 0:Un.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new Yx(aQe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};Yx.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=bo(s,d.equalsEpsilon,!0),s.length<3)return;let a=Z$e,c=$$e,u=Q$e,f=J$e,h=eQe;if(!j_.computeProjectTo2DArguments(s,MD,f,h))return;if(a=d.cross(f,h,a),a=d.normalize(a,a),!d.equalsEpsilon(MD,d.ZERO,P.EPSILON6)){let M=e._ellipsoid.geodeticSurfaceNormal(MD,iQe);d.dot(a,M)<0&&(a=d.negate(a,a),f=d.negate(f,f))}let _=j_.createProjectPointsTo2DFunction(MD,f,h),m=j_.createProjectPointTo2DFunction(MD,f,h);t.tangent&&(c=d.clone(f,c)),t.bitangent&&(u=d.clone(h,u));let x=Un.polygonsFromHierarchy(n,r,_,!1),b=x.hierarchy,T=x.polygons,C=function(M){return M},A=r?Un.polygonsFromHierarchy(o,!0,C,!1).polygons:void 0;if(b.length===0)return;s=b[0].outerRing;let S=ae.fromPoints(s),v=Un.computeBoundingRectangle(a,m,s,i,Y$e),D=[];for(let M=0;M<T.length;M++){let L=new wt({geometry:oQe(T[M],t,v,i,r?A[M]:void 0,m,a,c,u)});D.push(L)}let O=Nn.combineInstances(D)[0];O.attributes.position.values=new Float64Array(O.attributes.position.values),O.indices=Ne.createTypedArray(O.attributes.position.values.length/3,O.indices);let R=O.attributes;return t.position||delete R.position,new at({attributes:R,indices:O.indices,primitiveType:O.primitiveType,boundingSphere:S})};var dk=Yx;var wfe=[],hk=[];function cQe(e,t,n,i,o){let s=ns.fromPoints(t,e).projectPointsOntoPlane(t,wfe);ri.computeWindingOrder2D(s)===gs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,h=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],x=t[(u+1)%f];c[h++]=m.x,c[h++]=m.y,c[h++]=m.z,c[h++]=x.x,c[h++]=x.y,c[h++]=x.z}else{let m=0;if(o===tn.GEODESIC)for(u=0;u<f;u++)m+=Un.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===tn.RHUMB)for(u=0;u<f;u++)m+=Un.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let x;o===tn.GEODESIC?x=Un.subdivideLine(t[u],t[(u+1)%f],n,hk):o===tn.RHUMB&&(x=Un.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,hk));let b=x.length;for(let T=0;T<b;++T)c[h++]=x[T]}}f=c.length/3;let p=f*2,_=Ne.createTypedArray(f,p);for(h=0,u=0;u<f-1;u++)_[h++]=u,_[h++]=u+1;return _[h++]=f-1,_[h++]=0,new wt({geometry:new at({attributes:new hn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:_,primitiveType:Me.LINES})})}function lQe(e,t,n,i,o){let s=ns.fromPoints(t,e).projectPointsOntoPlane(t,wfe);ri.computeWindingOrder2D(s)===gs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,h=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){h[u]=p/3;let b=t[u],T=t[(u+1)%f];c[p++]=b.x,c[p++]=b.y,c[p++]=b.z,c[p++]=T.x,c[p++]=T.y,c[p++]=T.z}else{let b=0;if(o===tn.GEODESIC)for(u=0;u<f;u++)b+=Un.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===tn.RHUMB)for(u=0;u<f;u++)b+=Un.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(b*3*2),u=0;u<f;++u){h[u]=p/3;let T;o===tn.GEODESIC?T=Un.subdivideLine(t[u],t[(u+1)%f],n,hk):o===tn.RHUMB&&(T=Un.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,hk));let C=T.length;for(let A=0;A<C;++A)c[p++]=T[A]}}f=c.length/(3*2);let _=h.length,m=(f*2+_)*2,x=Ne.createTypedArray(f+_,m);for(p=0,u=0;u<f;++u)x[p++]=u,x[p++]=(u+1)%f,x[p++]=u+f,x[p++]=(u+1)%f+f;for(u=0;u<_;u++){let b=h[u];x[p++]=b,x[p++]=b+f}return new wt({geometry:new at({attributes:new hn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Me.LINES})})}function Xx(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,ee.default),i=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.perPositionHeight,!1),r=o&&l(e.extrudedHeight),s=y(e.arcType,tn.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!r){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=ee.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Un.computeHierarchyPackedLength(t,d)+ee.packedLength+8}Xx.pack=function(e,t,n){return n=y(n,0),n=Un.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var uQe=ee.clone(ee.UNIT_SPHERE),fQe={polygonHierarchy:{}};Xx.unpack=function(e,t,n){t=y(t,0);let i=Un.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ee.unpack(e,t,uQe);t+=ee.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],h=e[t++],p=e[t];return l(n)||(n=new Xx(fQe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=h===-1?void 0:h,n.packedLength=p,n};Xx.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new Xx(t)};Xx.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Un.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],u=P.chordLength(n,t.maximumRadius),f=e._height,h=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,h,0,P.EPSILON2),_,m;if(p)for(m=0;m<s.length;m++){if(a=lQe(t,s[m],u,o,r),a.geometry=Un.scaleToGeodeticHeightExtruded(a.geometry,f,h,t,o),l(e._offsetAttribute)){let T=a.geometry.attributes.position.values.length/3,C=new Uint8Array(T);e._offsetAttribute===sn.TOP?C=C.fill(1,0,T/2):(_=e._offsetAttribute===sn.NONE?0:1,C=C.fill(_)),a.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}c.push(a)}else for(m=0;m<s.length;m++){if(a=cQe(t,s[m],u,o,r),a.geometry.attributes.position.values=ri.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let T=a.geometry.attributes.position.values.length;_=e._offsetAttribute===sn.NONE?0:1;let C=new Uint8Array(T/3).fill(_);a.geometry.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}c.push(a)}let x=Nn.combineInstances(c)[0],b=ae.fromVertices(x.attributes.position.values);return new at({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};var mk=Xx;var Dfe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Ife="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Pfe=new z,Rfe=d.ZERO,Ofe=new d,Mfe=new se,dQe=[],hQe=new U;function mQe(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function _u(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new mQe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(_u.prototype=Object.create(Gn.prototype),_u.prototype.constructor=_u);_u.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Pfe)),l(s)||(s=z.WHITE),o.color=Wt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Rfe,Ofe)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new dk(i):r=new A_(i),new wt({id:t,geometry:r,attributes:o})};_u.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Pfe),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(o),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Rfe,Ofe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Ld(i):a=new mk(i),new wt({id:t,geometry:a,attributes:s})};_u.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=ns.fromPoints(i,o),s=r.projectPointsOntoPlane(i,dQe),a=s.length,c=0,u=a-1,f=new U;for(let p=0;p<a;u=p++){let _=s[p],m=s[u],x=_.x*m.y-m.x*_.y,b=U.add(_,m,hQe);b=U.multiplyByScalar(b,x,b),f=U.add(f,b,f),c+=x}let h=1/(c*3);return f=U.multiplyByScalar(f,h,f),r.projectPointOntoEllipsoid(f,t)};_u.prototype._isHidden=function(e,t){return!l(t.hierarchy)||ii.prototype._isHidden.call(this,e,t)};_u.prototype._isOnTerrain=function(e,t){let n=Gn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(He.MINIMUM_VALUE):!0);return n&&!o};_u.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.textureCoordinates)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.perPositionHeight)||!q.isConstant(t.closeTop)||!q.isConstant(t.closeBottom)||!q.isConstant(t.zIndex)||!q.isConstant(t.arcType)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};_u.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof zt,i=this._options;i.vertexFormat=n?cn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(He.MINIMUM_VALUE),r=q.getValueOrUndefined(t.height,He.MINIMUM_VALUE),s=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),a=q.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),c=q.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE),u=q.getValueOrDefault(t.perPositionHeight,He.MINIMUM_VALUE,!1);r=Gn.getGeometryHeight(r,s);let f;if(u?(l(r)&&(r=void 0,xt(Dfe)),s!==Ye.NONE&&u&&(r=void 0,xt(Ife))):(l(a)&&!l(r)&&(r=0),f=Gn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=q.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),i.stRotation=q.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=q.getValueOrDefault(t.closeTop,He.MINIMUM_VALUE,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,He.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=q.getValueOrDefault(t.arcType,He.MINIMUM_VALUE,tn.GEODESIC),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,He.MINIMUM_VALUE),a=Gn.getGeometryExtrudedHeight(a,c),a===Gn.CLAMP_TO_GROUND){let h=A_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Mfe);a=li.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=a};_u.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};_u.DynamicGeometryUpdater=VA;function VA(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(VA.prototype=Object.create(ni.prototype),VA.prototype.constructor=VA);VA.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ni.prototype._isHidden.call(this,e,t,n)};VA.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=q.getValueOrUndefined(t.hierarchy,n);let o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,Ye.NONE),s=q.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),c=q.getValueOrUndefined(t.perPositionHeight,n);o=Gn.getGeometryHeight(o,s);let u;if(c?(l(o)&&(o=void 0,xt(Dfe)),r!==Ye.NONE&&c&&(o=void 0,xt(Ife))):(l(a)&&!l(o)&&(o=0),u=Gn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=q.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=q.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=q.getValueOrDefault(t.arcType,n,tn.GEODESIC),a=Gn.getGeometryExtrudedHeight(a,s),a===Gn.CLAMP_TO_GROUND){let f=A_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Mfe);a=li.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var pk=_u;function pQe(e,t,n,i){let o=new hn;i.position&&(o.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=ri.triangulate(t),u=(a-1)*r*6+c.length*2,f=Ne.createTypedArray(s,u),h,p,_,m,x,b,T=r*2,C=0;for(h=0;h<a-1;h++){for(p=0;p<r-1;p++)_=p*2+h*r*2,b=_+T,m=_+1,x=m+T,f[C++]=m,f[C++]=_,f[C++]=x,f[C++]=x,f[C++]=_,f[C++]=b;_=r*2-2+h*r*2,m=_+1,x=m+T,b=_+T,f[C++]=m,f[C++]=_,f[C++]=x,f[C++]=x,f[C++]=_,f[C++]=b}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),D=1/(a-1),O=1/n.height,R=n.height/2,M,L,g=0;for(h=0;h<a;h++){for(M=h*D,L=O*(t[0].y+R),v[g++]=M,v[g++]=L,p=1;p<r;p++)L=O*(t[p].y+R),v[g++]=M,v[g++]=L,v[g++]=M,v[g++]=L;L=O*(t[0].y+R),v[g++]=M,v[g++]=L}for(p=0;p<r;p++)M=0,L=O*(t[p].y+R),v[g++]=M,v[g++]=L;for(p=0;p<r;p++)M=(a-1)*D,L=O*(t[p].y+R),v[g++]=M,v[g++]=L;o.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let A=s-r*2;for(h=0;h<c.length;h+=3){let v=c[h]+A,D=c[h+1]+A,O=c[h+2]+A;f[C++]=v,f[C++]=D,f[C++]=O,f[C++]=O+r,f[C++]=D+r,f[C++]=v+r}let S=new at({attributes:o,indices:f,boundingSphere:ae.fromVertices(e),primitiveType:Me.TRIANGLES});if(i.normal&&(S=Nn.computeNormal(S)),i.tangent||i.bitangent){try{S=Nn.computeTangentAndBitangent(S)}catch{xt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(S.attributes.tangent=void 0),i.bitangent||(S.attributes.bitangent=void 0),i.st||(S.attributes.st=void 0)}return S}function ND(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._cornerType=y(e.cornerType,Ni.ROUNDED),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+Ie.packedLength+2}ND.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Lfe=ee.clone(ee.UNIT_SPHERE),Nfe=new Ie,LD={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Lfe,vertexFormat:Nfe,cornerType:void 0,granularity:void 0};ND.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,Lfe);t+=ee.packedLength;let c=Ie.unpack(e,t,Nfe);t+=Ie.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(LD.polylinePositions=r,LD.shapePositions=s,LD.cornerType=u,LD.granularity=f,new ND(LD))};var gQe=new qe;ND.createGeometry=function(e){let t=e._positions,n=bo(t,d.equalsEpsilon),i=e._shape;if(i=cm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ri.computeWindingOrder2D(i)===gs.CLOCKWISE&&i.reverse();let o=qe.fromPoints(i,gQe),r=cm.computePositions(n,i,o,e,!0);return pQe(r,i,o,e._vertexFormat)};var gk=ND;function _Qe(e,t){let n=new hn;n.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Ne.createTypedArray(o,2*i*(s+1)),c,u,f=0;c=0;let h=c*i;for(u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,c=s-1,h=c*i,u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,c=0;c<s-1;c++){let _=i*c,m=_+i;for(u=0;u<i;u++)a[f++]=u+_,a[f++]=u+m}return new at({attributes:n,indices:Ne.createTypedArray(o,a),boundingSphere:ae.fromVertices(e),primitiveType:Me.LINES})}function BD(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._cornerType=y(e.cornerType,Ni.ROUNDED),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+2}BD.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Ffe=ee.clone(ee.UNIT_SPHERE),FD={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Ffe,height:void 0,cornerType:void 0,granularity:void 0};BD.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,Ffe);t+=ee.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(FD.polylinePositions=r,FD.shapePositions=s,FD.cornerType=c,FD.granularity=u,new BD(FD))};var yQe=new qe;BD.createGeometry=function(e){let t=e._positions,n=bo(t,d.equalsEpsilon),i=e._shape;if(i=cm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ri.computeWindingOrder2D(i)===gs.CLOCKWISE&&i.reverse();let o=qe.fromPoints(i,yQe),r=cm.computePositions(n,i,o,e,!1);return _Qe(r,i)};var _k=BD;var Bfe=new z;function xQe(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function gm(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new xQe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(gm.prototype=Object.create(ii.prototype),gm.prototype.constructor=gm);gm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Bn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof zt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Bfe)),l(c)||(c=z.WHITE),o=Wt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new wt({id:t,geometry:new gk(this._options),attributes:i})};gm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Bfe),o=this._distanceDisplayConditionProperty.getValue(e);return new wt({id:t,geometry:new _k(this._options),attributes:{show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o)}})};gm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||ii.prototype._isHidden.call(this,e,t)};gm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!q.isConstant(t.granularity)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)};gm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof zt;o.vertexFormat=r?cn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(He.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(He.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(He.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(He.MINIMUM_VALUE):void 0};gm.DynamicGeometryUpdater=UA;function UA(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(UA.prototype=Object.create(ni.prototype),UA.prototype.constructor=UA);UA.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ni.prototype._isHidden.call(this,e,t,n)};UA.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=q.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=q.getValueOrUndefined(t.shape,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n)};var yk=gm;var h7=new d,Ufe=new d,zfe=new d,Hfe=new d,Gfe=new se,bQe=new U,TQe=new ae,CQe=new ae;function Wfe(e,t){let n=new at({attributes:new hn,primitiveType:Me.TRIANGLES});return n.attributes.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function AQe(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,u=Hfe,f=zfe,h=Ufe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let _=d.fromArray(e,p,h7),m=c+1,x=c+2;h=n.geodeticSurfaceNormal(_,h),(t.tangent||t.bitangent)&&(d.cross(d.UNIT_Z,h,f),$.multiplyByVector(i,f,f),d.normalize(f,f),t.bitangent&&d.normalize(d.cross(h,f,u),u)),t.normal&&(r[c]=h.x,r[m]=h.y,r[x]=h.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[x]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[x]=u.z),c+=3}return Wfe(t,{positions:e,normals:r,tangents:s,bitangents:a})}var m7=new d,jfe=new d;function EQe(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,h=Hfe,p=zfe,_=Ufe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let x=d.fromArray(e,m,h7),b=d.fromArray(e,(m+6)%i,m7);if(f){let T=d.fromArray(e,(m+3)%i,jfe);d.subtract(b,x,b),d.subtract(T,x,T),_=d.normalize(d.cross(T,b,_),_),f=!1}d.equalsEpsilon(b,x,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(x,h),t.tangent&&(p=d.normalize(d.cross(h,_,p),p))),t.normal&&(o[a++]=_.x,o[a++]=_.y,o[a++]=_.z,o[a++]=_.x,o[a++]=_.y,o[a++]=_.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[u++]=h.x,s[u++]=h.y,s[u++]=h.z,s[u++]=h.x,s[u++]=h.y,s[u++]=h.z)}return Wfe(t,{positions:e,normals:o,tangents:r,bitangents:s})}function qfe(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,u=o,f=o,h=0;s&&(c=1,f-=1,h+=1),a&&(u-=1,f-=1,h+=1),h+=r*f;let p=n.position?new Float64Array(h*3):void 0,_=n.st?new Float32Array(h*2):void 0,m=0,x=0,b=h7,T=bQe,C=Number.MAX_VALUE,A=Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let E=c;E<u;++E)for(let w=0;w<r;++w)Us.computePosition(t,i,n.st,E,w,b,T),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(_[x++]=T.x,_[x++]=T.y,C=Math.min(C,T.x),A=Math.min(A,T.y),S=Math.max(S,T.x),v=Math.max(v,T.y));if(s&&(Us.computePosition(t,i,n.st,0,0,b,T),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(_[x++]=T.x,_[x++]=T.y,C=T.x,A=T.y,S=T.x,v=T.y)),a&&(Us.computePosition(t,i,n.st,o-1,0,b,T),p[m++]=b.x,p[m++]=b.y,p[m]=b.z,n.st&&(_[x++]=T.x,_[x]=T.y,C=Math.min(C,T.x),A=Math.min(A,T.y),S=Math.max(S,T.x),v=Math.max(v,T.y))),n.st&&(C<0||A<0||S>1||v>1))for(let E=0;E<_.length;E+=2)_[E]=(_[E]-C)/(S-C),_[E+1]=(_[E+1]-A)/(v-A);let D=AQe(p,n,i,t.tangentRotationMatrix),O=6*(r-1)*(f-1);s&&(O+=3*(r-1)),a&&(O+=3*(r-1));let R=Ne.createTypedArray(h,O),M=0,L=0,g;for(g=0;g<f-1;++g){for(let E=0;E<r-1;++E){let w=M,I=w+r,N=I+1,B=w+1;R[L++]=w,R[L++]=I,R[L++]=B,R[L++]=B,R[L++]=I,R[L++]=N,++M}++M}if(s||a){let E=h-1,w=h-1;s&&a&&(E=h-2);let I,N;if(M=0,s)for(g=0;g<r-1;g++)I=M,N=I+1,R[L++]=E,R[L++]=I,R[L++]=N,++M;if(a)for(M=(f-1)*r,g=0;g<r-1;g++)I=M,N=I+1,R[L++]=I,R[L++]=w,R[L++]=N,++M}return D.indices=R,n.st&&(D.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:_})),D}function zA(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function HA(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var p7=new Ie;function SQe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Be=Ie.clone(o,p7);Be.normal=!0,e._vertexFormat=Be}let h=qfe(e,t);n&&(e._vertexFormat=o);let p=ri.scaleToGeodeticHeight(h.attributes.position.values,s,a,!1);p=new Float64Array(p);let _=p.length,m=_*2,x=new Float64Array(m);x.set(p);let b=ri.scaleToGeodeticHeight(h.attributes.position.values,r,a);x.set(b,_),h.attributes.position.values=x;let T=o.normal?new Float32Array(m):void 0,C=o.tangent?new Float32Array(m):void 0,A=o.bitangent?new Float32Array(m):void 0,S=o.st?new Float32Array(m/3*2):void 0,v,D;if(o.normal){for(D=h.attributes.normal.values,T.set(D),f=0;f<_;f++)D[f]=-D[f];T.set(D,_),h.attributes.normal.values=T}if(n){D=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let Be=new Float32Array(m);for(f=0;f<_;f++)D[f]=-D[f];Be.set(D,_),h.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:Be})}let O,R=l(i);if(R){let Be=_/3*2,Yt=new Uint8Array(Be);i===sn.TOP?Yt=Yt.fill(1,0,Be/2):(O=i===sn.NONE?0:1,Yt=Yt.fill(O)),h.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:Yt})}if(o.tangent){let Be=h.attributes.tangent.values;for(C.set(Be),f=0;f<_;f++)Be[f]=-Be[f];C.set(Be,_),h.attributes.tangent.values=C}if(o.bitangent){let Be=h.attributes.bitangent.values;A.set(Be),A.set(Be,_),h.attributes.bitangent.values=A}o.st&&(v=h.attributes.st.values,S.set(v),S.set(v,_/3*2),h.attributes.st.values=S);let M=h.indices,L=M.length,g=_/3,E=Ne.createTypedArray(m/3,L*2);for(E.set(M),f=0;f<L;f+=3)E[f+L]=M[f+2]+g,E[f+1+L]=M[f+1]+g,E[f+2+L]=M[f]+g;h.indices=E;let w=t.northCap,I=t.southCap,N=c,B=2,H=0,V=4,G=4;w&&(B-=1,N-=1,H+=1,V-=2,G-=1),I&&(B-=1,N-=1,H+=1,V-=2,G-=1),H+=B*u+2*N-V;let k=(H+G)*2,W=new Float64Array(k*3),Y=n?new Float32Array(k*3):void 0,J=R?new Uint8Array(k):void 0,j=o.st?new Float32Array(k*2):void 0,K=i===sn.TOP;R&&!K&&(O=i===sn.ALL?1:0,J=J.fill(O));let Q=0,de=0,ye=0,ce=0,ge=u*N,xe;for(f=0;f<ge;f+=u)xe=f*3,W=zA(W,Q,xe,p,b),Q+=6,o.st&&(j=HA(j,de,f*2,v),de+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1);if(I){let Be=w?ge+1:ge;for(xe=Be*3,f=0;f<2;f++)W=zA(W,Q,xe,p,b),Q+=6,o.st&&(j=HA(j,de,Be*2,v),de+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1)}else for(f=ge-u;f<ge;f++)xe=f*3,W=zA(W,Q,xe,p,b),Q+=6,o.st&&(j=HA(j,de,f*2,v),de+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1);for(f=ge-1;f>0;f-=u)xe=f*3,W=zA(W,Q,xe,p,b),Q+=6,o.st&&(j=HA(j,de,f*2,v),de+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1);if(w){let Be=ge;for(xe=Be*3,f=0;f<2;f++)W=zA(W,Q,xe,p,b),Q+=6,o.st&&(j=HA(j,de,Be*2,v),de+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1)}else for(f=u-1;f>=0;f--)xe=f*3,W=zA(W,Q,xe,p,b),Q+=6,o.st&&(j=HA(j,de,f*2,v),de+=4),n&&(ye+=3,Y[ye++]=D[xe],Y[ye++]=D[xe+1],Y[ye++]=D[xe+2]),K&&(J[ce++]=1,ce+=1);let De=EQe(W,o,a);o.st&&(De.attributes.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:j})),n&&(De.attributes.extrudeDirection=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:Y})),R&&(De.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:J}));let Ae=Ne.createTypedArray(k,H*6),ke,ze,et,St;_=W.length/3;let mt=0;for(f=0;f<_-1;f+=2){ke=f,St=(ke+2)%_;let Be=d.fromArray(W,ke*3,m7),Yt=d.fromArray(W,St*3,jfe);d.equalsEpsilon(Be,Yt,P.EPSILON10)||(ze=(ke+1)%_,et=(ze+2)%_,Ae[mt++]=ke,Ae[mt++]=ze,Ae[mt++]=St,Ae[mt++]=St,Ae[mt++]=ze,Ae[mt++]=et)}return De.indices=Ae,De=Nn.combineInstances([new wt({geometry:h}),new wt({geometry:De})]),De[0]}var vQe=[new d,new d,new d,new d],Yfe=new fe,wQe=new fe;function g7(e,t,n,i,o){if(n===0)return se.clone(e,o);let r=Us.computeOptions(e,t,n,0,Gfe,Yfe),s=r.height,a=r.width,c=vQe;return Us.computePosition(r,i,!1,0,0,c[0]),Us.computePosition(r,i,!1,0,a-1,c[1]),Us.computePosition(r,i,!1,s-1,0,c[2]),Us.computePosition(r,i,!1,s-1,a-1,c[3]),se.fromCartesianArray(c,i,o)}function _m(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=se.clone(t),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}_m.packedLength=se.packedLength+ee.packedLength+Ie.packedLength+7;_m.pack=function(e,t,n){return n=y(n,0),se.pack(e._rectangle,t,n),n+=se.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Xfe=new se,Kfe=ee.clone(ee.UNIT_SPHERE),py={rectangle:Xfe,ellipsoid:Kfe,vertexFormat:p7,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};_m.unpack=function(e,t,n){t=y(t,0);let i=se.unpack(e,t,Xfe);t+=se.packedLength;let o=ee.unpack(e,t,Kfe);t+=ee.packedLength;let r=Ie.unpack(e,t,p7);t+=Ie.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++]===1,p=e[t];return l(n)?(n._rectangle=se.clone(i,n._rectangle),n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=h,n._offsetAttribute=p===-1?void 0:p,n):(py.granularity=s,py.height=a,py.rotation=c,py.stRotation=u,py.extrudedHeight=f,py.shadowVolume=h,py.offsetAttribute=p===-1?void 0:p,new _m(py))};_m.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,P.RADIANS_PER_DEGREE),o=y(e.ellipsoid,ee.default),r=y(e.rotation,0);return g7(n,i,r,o,t)};var DQe=new $,kfe=new Oe,IQe=new fe;_m.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Us.computeOptions(t,e._granularity,i,o,Gfe,Yfe,wQe),a=DQe;if(o!==0||i!==0){let _=se.center(t,IQe),m=n.geodeticSurfaceNormalCartographic(_,m7);Oe.fromAxisAngle(m,-o,kfe),$.fromQuaternion(kfe,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!P.equalsEpsilon(c,u,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let h,p;if(t=e._rectangle,f){h=SQe(e,s);let _=ae.fromRectangle3D(t,n,c,CQe),m=ae.fromRectangle3D(t,n,u,TQe);p=ae.union(_,m)}else{if(h=qfe(e,s),h.attributes.position.values=ri.scaleToGeodeticHeight(h.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let _=h.attributes.position.values.length,m=e._offsetAttribute===sn.NONE?0:1,x=new Uint8Array(_/3).fill(m);h.attributes.applyOffset=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=ae.fromRectangle3D(t,n,c)}return r.position||delete h.attributes.position,new at({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};_m.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new _m({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};var Vfe=new se,PQe=[new U,new U,new U],RQe=new Pi,OQe=new fe;function MQe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=se.clone(e._rectangle,Vfe),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=g7(t,n,o,i,Vfe),s=PQe;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=Pi.fromRotation(e._stRotation,RQe),u=se.center(a,OQe);for(let m=0;m<3;++m){let x=s[m];x.x-=u.longitude,x.y-=u.latitude,Pi.multiplyByVector(c,x,x),x.x+=u.longitude,x.y+=u.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let f=s[0],h=s[1],p=s[2],_=new Array(6);return U.pack(f,_),U.pack(h,_,2),U.pack(p,_,4),_}Object.defineProperties(_m.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=g7(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=MQe(this)),this._textureCoordinateRotationPoints}}});var GA=_m;var Zfe=new z,$fe=d.ZERO,Qfe=new d,Jfe=new se,LQe=new se,NQe=new fe;function FQe(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function zd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new FQe(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(zd.prototype=Object.create(Gn.prototype),zd.prototype.constructor=zd);zd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof zt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Zfe)),l(o)||(o=z.WHITE),i.color=Wt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,$fe,Qfe))),new wt({id:t,geometry:new GA(this._options),attributes:i})};zd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Zfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,$fe,Qfe))),new wt({id:t,geometry:new JC(this._options),attributes:r})};zd.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.rectangle.coordinates,e,LQe);if(!l(n))return;let i=se.center(n,NQe);return fe.toCartesian(i,ee.default,t)};zd.prototype._isHidden=function(e,t){return!l(t.coordinates)||ii.prototype._isHidden.call(this,e,t)};zd.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.rotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof zt)};zd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof zt,i=q.getValueOrUndefined(t.height,He.MINIMUM_VALUE),o=q.getValueOrDefault(t.heightReference,He.MINIMUM_VALUE,Ye.NONE),r=q.getValueOrUndefined(t.extrudedHeight,He.MINIMUM_VALUE),s=q.getValueOrDefault(t.extrudedHeightReference,He.MINIMUM_VALUE,Ye.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?cn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(He.MINIMUM_VALUE,a.rectangle),a.granularity=q.getValueOrUndefined(t.granularity,He.MINIMUM_VALUE),a.stRotation=q.getValueOrUndefined(t.stRotation,He.MINIMUM_VALUE),a.rotation=q.getValueOrUndefined(t.rotation,He.MINIMUM_VALUE),a.offsetAttribute=Gn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Gn.getGeometryHeight(i,o),r=Gn.getGeometryExtrudedHeight(r,s),r===Gn.CLAMP_TO_GROUND&&(r=li.getMinimumMaximumHeights(GA.computeRectangle(a,Jfe)).minimumTerrainHeight),a.extrudedHeight=r};zd.DynamicGeometryUpdater=WA;function WA(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(WA.prototype=Object.create(ni.prototype),WA.prototype.constructor=WA);WA.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ni.prototype._isHidden.call(this,e,t,n)};WA.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,Ye.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),a=q.getValueOrDefault(t.extrudedHeightReference,n,Ye.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=q.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(GA.computeRectangle(i,Jfe)).minimumTerrainHeight),i.extrudedHeight=s};var xk=zd;var ede={};function BQe(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var kQe=new fe,VQe=new fe;function UQe(e,t,n,i){t=bo(t,d.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),u=new Array(o),f=t[0];a[0]=f;let h=e.cartesianToCartographic(f,kQe);s&&(h.height=n[0]),c[0]=h.height,r?u[0]=i[0]:u[0]=0;let p=c[0],_=u[0],m=p===_,x=1;for(let b=1;b<o;++b){let T=t[b],C=e.cartesianToCartographic(T,VQe);s&&(C.height=n[b]),m=m&&C.height===0,BQe(h,C)?h.height<C.height&&(c[x-1]=C.height):(a[x]=T,c[x]=C.height,r?u[x]=i[b]:u[x]=0,m=m&&c[x]===u[x],fe.clone(C,h),++x)}if(!(m||x<2))return a.length=x,c.length=x,u.length=x,{positions:a,topHeights:c,bottomHeights:u}}var zQe=new Array(2),HQe=new Array(2),GQe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};ede.computePositions=function(e,t,n,i,o,r){let s=UQe(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,h=P.chordLength(o,e.maximumRadius),p=GQe;if(p.minDistance=h,p.ellipsoid=e,r){let _=0,m;for(m=0;m<a-1;m++)_+=Li.numberOfPoints(t[m],t[m+1],h)+1;u=new Float64Array(_*3),f=new Float64Array(_*3);let x=zQe,b=HQe;p.positions=x,p.height=b;let T=0;for(m=0;m<a-1;m++){x[0]=t[m],x[1]=t[m+1],b[0]=n[m],b[1]=n[m+1];let C=Li.generateArc(p);u.set(C,T),b[0]=i[m],b[1]=i[m+1],f.set(Li.generateArc(p),T),T+=C.length}}else p.positions=t,p.height=n,u=new Float64Array(Li.generateArc(p)),p.height=i,f=new Float64Array(Li.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var jA=ede;var _7=new d,bk=new d,WQe=new d,tde=new d,jQe=new d,qQe=new d,YQe=new d;function Kx(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e.granularity,P.RADIANS_PER_DEGREE),s=y(e.ellipsoid,ee.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Ie.clone(o),this._granularity=r,this._ellipsoid=ee.clone(s),this._workerName="createWallGeometry";let a=1+t.length*d.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ee.packedLength+Ie.packedLength+1}Kx.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._granularity,t};var nde=ee.clone(ee.UNIT_SPHERE),ide=new Ie,kD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:nde,vertexFormat:ide,granularity:void 0};Kx.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ee.unpack(e,t,nde);t+=ee.packedLength;let u=Ie.unpack(e,t,ide);t+=Ie.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._vertexFormat=Ie.clone(u,n._vertexFormat),n._granularity=f,n):(kD.positions=r,kD.minimumHeights=s,kD.maximumHeights=a,kD.granularity=f,new Kx(kD))};Kx.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new Kx(c)};Kx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=jA.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,h=u.length,p=h*2,_=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,x=o.tangent?new Float32Array(p):void 0,b=o.bitangent?new Float32Array(p):void 0,T=o.st?new Float32Array(p/3*2):void 0,C=0,A=0,S=0,v=0,D=0,O=YQe,R=qQe,M=jQe,L=!0;h/=3;let g,E=0,w=1/(h-f-1);for(g=0;g<h;++g){let V=g*3,G=d.fromArray(u,V,_7),k=d.fromArray(c,V,bk);if(o.position&&(_[C++]=k.x,_[C++]=k.y,_[C++]=k.z,_[C++]=G.x,_[C++]=G.y,_[C++]=G.z),o.st&&(T[D++]=E,T[D++]=0,T[D++]=E,T[D++]=1),o.normal||o.tangent||o.bitangent){let W=d.clone(d.ZERO,tde),Y=d.subtract(G,s.geodeticSurfaceNormal(G,bk),bk);if(g+1<h&&(W=d.fromArray(u,V+3,tde)),L){let J=d.subtract(W,G,WQe),j=d.subtract(Y,G,_7);O=d.normalize(d.cross(j,J,O),O),L=!1}d.equalsEpsilon(G,W,P.EPSILON10)?L=!0:(E+=w,o.tangent&&(R=d.normalize(d.subtract(W,G,R),R)),o.bitangent&&(M=d.normalize(d.cross(O,R,M),M))),o.normal&&(m[A++]=O.x,m[A++]=O.y,m[A++]=O.z,m[A++]=O.x,m[A++]=O.y,m[A++]=O.z),o.tangent&&(x[v++]=R.x,x[v++]=R.y,x[v++]=R.z,x[v++]=R.x,x[v++]=R.y,x[v++]=R.z),o.bitangent&&(b[S++]=M.x,b[S++]=M.y,b[S++]=M.z,b[S++]=M.x,b[S++]=M.y,b[S++]=M.z)}}let I=new hn;o.position&&(I.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:_})),o.normal&&(I.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(I.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:x})),o.bitangent&&(I.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(I.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:T}));let N=p/3;p-=6*(f+1);let B=Ne.createTypedArray(N,p),H=0;for(g=0;g<N-2;g+=2){let V=g,G=g+2,k=d.fromArray(_,V*3,_7),W=d.fromArray(_,G*3,bk);if(d.equalsEpsilon(k,W,P.EPSILON10))continue;let Y=g+1,J=g+3;B[H++]=Y,B[H++]=V,B[H++]=J,B[H++]=J,B[H++]=V,B[H++]=G}return new at({attributes:I,indices:B,primitiveType:Me.TRIANGLES,boundingSphere:new ae.fromVertices(_)})};var Tk=Kx;var ode=new d,rde=new d;function Zx(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.granularity,P.RADIANS_PER_DEGREE),r=y(e.ellipsoid,ee.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ee.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*d.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ee.packedLength+1}Zx.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n]=e._granularity,t};var sde=ee.clone(ee.UNIT_SPHERE),VD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:sde,granularity:void 0};Zx.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ee.unpack(e,t,sde);t+=ee.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._granularity=u,n):(VD.positions=r,VD.minimumHeights=s,VD.maximumHeights=a,VD.granularity=u,new Zx(VD))};Zx.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new Zx(c)};Zx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=jA.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,h=new Float64Array(f),p=0;u/=3;let _;for(_=0;_<u;++_){let C=_*3,A=d.fromArray(c,C,ode),S=d.fromArray(a,C,rde);h[p++]=S.x,h[p++]=S.y,h[p++]=S.z,h[p++]=A.x,h[p++]=A.y,h[p++]=A.z}let m=new hn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:h})}),x=f/3;f=2*x-4+x;let b=Ne.createTypedArray(x,f),T=0;for(_=0;_<x-2;_+=2){let C=_,A=_+2,S=d.fromArray(h,C*3,ode),v=d.fromArray(h,A*3,rde);if(d.equalsEpsilon(S,v,P.EPSILON10))continue;let D=_+1,O=_+3;b[T++]=D,b[T++]=C,b[T++]=D,b[T++]=O,b[T++]=C,b[T++]=A}return b[T++]=x-2,b[T++]=x-1,new at({attributes:m,indices:b,primitiveType:Me.LINES,boundingSphere:new ae.fromVertices(h)})};var Ck=Zx;var ade=new z;function XQe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Hd(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new XQe(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Hd.prototype=Object.create(ii.prototype),Hd.prototype.constructor=Hd);Hd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Bn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof zt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,ade)),l(c)||(c=z.WHITE),o=Wt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new wt({id:t,geometry:new Tk(this._options),attributes:i})};Hd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,ade),o=this._distanceDisplayConditionProperty.getValue(e);return new wt({id:t,geometry:new Ck(this._options),attributes:{show:new yn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Wt.fromColor(i),distanceDisplayCondition:Bn.fromDistanceDisplayCondition(o)}})};Hd.prototype._isHidden=function(e,t){return!l(t.positions)||ii.prototype._isHidden.call(this,e,t)};Hd.prototype._getIsClosed=function(e){return!1};Hd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.minimumHeights)||!q.isConstant(t.maximumHeights)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.granularity)};Hd.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof zt,s=this._options;s.vertexFormat=r?cn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(He.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(He.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(He.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(He.MINIMUM_VALUE):void 0};Hd.DynamicGeometryUpdater=qA;function qA(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(qA.prototype=Object.create(ni.prototype),qA.prototype.constructor=qA);qA.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ni.prototype._isHidden.call(this,e,t,n)};qA.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=q.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=q.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=q.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=q.getValueOrUndefined(t.granularity,n)};var Ak=Hd;var $x=[xN,F3,I3,ok,rk,fk,pk,yk,xk,Ak];function Qx(e,t){this.entity=e,this.scene=t;let n=new Array($x.length),i=new me,o=new _r;for(let r=0;r<n.length;r++){let s=new $x[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(Qx.prototype._onEntityPropertyChanged,this)}Qx.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};Qx.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};Qx.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};Qx.registerUpdater=function(e){$x.includes(e)||$x.push(e)};Qx.unregisterUpdater=function(e){if($x.includes(e)){let t=$x.indexOf(e);$x.splice(t,1)}};var YA=Qx;var cde=new z,KQe=new Lt,ZQe=new Lt,$Qe=d.ZERO,QQe=new d;function Gd(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new vt,this.updaters=new vt,this.updatersWithAttributes=new vt,this.attributes=new vt,this.subscriptions=new vt,this.showsUpdated=new vt,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(Gd.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Gd.prototype.onMaterialChanged=function(){this.invalidated=!0};Gd.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Gd.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Gd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Gd.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=ir.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof zt)&&(this.depthFailMaterial=ir.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||c){let b=u.fillMaterialProperty.color,T=q.getValueOrDefault(b,e,z.WHITE,cde);z.equals(h._lastColor,T)||(h._lastColor=z.clone(T,h._lastColor),h.color=Wt.toValue(T,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof zt&&(!u.depthFailMaterialProperty.isConstant||c)){let b=u.depthFailMaterialProperty.color,T=q.getValueOrDefault(b,e,z.WHITE,cde);z.equals(h._lastDepthFailColor,T)||(h._lastDepthFailColor=z.clone(T,h._lastDepthFailColor),h.depthFailColor=Wt.toValue(T,h.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let b=q.getValueOrDefault(m,e,ZQe,KQe);Lt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(b,h.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,$Qe,QQe);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Qi.toValue(b,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Gd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=yn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Gd.prototype.contains=function(e){return this.updaters.contains(e.id)};Gd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ct.FAILED:(i.boundingSphere.clone(t),ct.DONE)};Gd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function XA(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}XA.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new Gd(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function lde(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}XA.prototype.remove=function(e){lde(this._solidItems,e)||lde(this._translucentItems,e)};function ude(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function Ek(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}XA.prototype.update=function(e){let t=Ek(this,this._solidItems,e,!0);t=Ek(this,this._translucentItems,e,t)&&t;let n=ude(this,this._solidItems,e),i=ude(this,this._translucentItems,e);return(n||i)&&(t=Ek(this,this._solidItems,e,t)&&t,t=Ek(this,this._translucentItems,e,t)&&t),t};function fde(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return ct.FAILED}XA.prototype.getBoundingSphere=function(e,t){let n=fde(this._solidItems,e,t);return n===ct.FAILED?fde(this._translucentItems,e,t):n};function dde(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}XA.prototype.removeAllPrimitives=function(){dde(this._solidItems),dde(this._translucentItems)};var Wd=XA;var JQe=new Lt,eJe=new Lt,tJe=d.ZERO,nJe=new d;function jd(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new vt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new vt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new vt,this.attributes=new vt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(jd.prototype.onMaterialChanged,this),this.subscriptions=new vt,this.showsUpdated=new vt}jd.prototype.onMaterialChanged=function(){this.invalidated=!0};jd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};jd.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty)||!q.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};jd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var iJe=new z;jd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=ir.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=ir.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=ir.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof zt)&&(this.depthFailMaterial=ir.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof zt&&!c.depthFailMaterialProperty.isConstant){let b=c.depthFailMaterialProperty.color,T=q.getValueOrDefault(b,e,z.WHITE,iJe);z.equals(h._lastDepthFailColor,T)||(h._lastDepthFailColor=z.clone(T,h._lastDepthFailColor),h.depthFailColor=Wt.toValue(T,h.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let b=q.getValueOrDefault(m,e,eJe,JQe);Lt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(b,h.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,tJe,nJe);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Qi.toValue(b,h.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};jd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=yn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};jd.prototype.contains=function(e){return this.updaters.contains(e.id)};jd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ct.FAILED:(i.boundingSphere.clone(t),ct.DONE)};jd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function KA(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}KA.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new jd(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};KA.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};KA.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};KA.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ct.FAILED};KA.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var qd=KA;var mde=Ur(hde(),1);function Sk(){this._tree=new mde.default}function Jx(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}Jx.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};Sk.prototype.insert=function(e,t){let n=Jx.fromRectangleAndId(e,t,new Jx);this._tree.insert(n)};function oJe(e,t){return e.id===t.id}var rJe=new Jx;Sk.prototype.remove=function(e,t){let n=Jx.fromRectangleAndId(e,t,rJe);this._tree.remove(n,oJe)};var sJe=new Jx;Sk.prototype.collides=function(e){let t=Jx.fromRectangleAndId("",e,sJe);return this._tree.collides(t)};var ZA=Sk;var aJe=new z,cJe=new Lt,lJe=new Lt;function ng(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new vt,this.updaters=new vt,this.updatersWithAttributes=new vt,this.attributes=new vt,this.subscriptions=new vt,this.showsUpdated=new vt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new ZA}ng.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};ng.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};ng.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};ng.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new pl({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||c){let x=u.fillMaterialProperty.color,b=q.getValueOrDefault(x,e,z.WHITE,aJe);z.equals(h._lastColor,b)||(h._lastColor=z.clone(b,h._lastColor),h.color=Wt.toValue(b,h.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let x=q.getValueOrDefault(m,e,lJe,cJe);Lt.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(x,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};ng.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=yn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};ng.prototype.contains=function(e){return this.updaters.contains(e.id)};ng.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),ct.DONE):ct.FAILED};ng.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function $A(e,t){this._batches=[],this._primitives=e,this._classificationType=t}$A.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=q.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new ng(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};$A.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};$A.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};$A.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ct.FAILED};$A.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var UD=$A;var uJe=new Lt,fJe=new Lt;function Uf(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new vt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new vt,this.material=void 0,this.updatersWithAttributes=new vt,this.attributes=new vt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Uf.prototype.onMaterialChanged,this),this.subscriptions=new vt,this.showsUpdated=new vt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new ZA}Uf.prototype.onMaterialChanged=function(){this.invalidated=!0};Uf.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Uf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof zt&&t instanceof zt?!0:l(t)&&t.equals(n)};Uf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Uf.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};Uf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=ir.getValue(e,this.materialProperty,this.material),n=new pl({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=ir.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let x=q.getValueOrDefault(m,e,fJe,uJe);Lt.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(x,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Uf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=yn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Uf.prototype.contains=function(e){return this.updaters.contains(e.id)};Uf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ct.FAILED:(i.boundingSphere.clone(t),ct.DONE)};Uf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function QA(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}QA.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=of.shouldUseSphericalCoordinates(o.geometry.rectangle),s=q.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new Uf(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};QA.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};QA.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};QA.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ct.FAILED};QA.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var vk=QA;var dJe=new z,hJe=new Lt,mJe=new Lt,pJe=d.ZERO,gJe=new d;function ig(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new vt,this.updaters=new vt,this.updatersWithAttributes=new vt,this.attributes=new vt,this.itemsToRemove=[],this.subscriptions=new vt,this.showsUpdated=new vt}ig.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};ig.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};ig.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new cn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.outlineColorProperty.isConstant||c){let b=u.outlineColorProperty,T=q.getValueOrDefault(b,e,z.WHITE,dJe);z.equals(h._lastColor,T)||(h._lastColor=z.clone(T,h._lastColor),h.color=Wt.toValue(T,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let b=q.getValueOrDefault(m,e,mJe,hJe);Lt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(b,h.distanceDisplayCondition))}let x=u.terrainOffsetProperty;if(!q.isConstant(x)){let b=q.getValueOrDefault(x,e,pJe,gJe);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Qi.toValue(b,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};ig.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=yn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};ig.prototype.contains=function(e){return this.updaters.contains(e.id)};ig.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ct.FAILED:(i.boundingSphere.clone(t),ct.DONE)};ig.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function JA(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new vt,this._translucentBatches=new vt}JA.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new ig(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new ig(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};JA.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};JA.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,u,f=!0,h=!1;do{for(h=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(h);return f};JA.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return ct.FAILED};JA.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var zD=JA;var _Je=[];function Dl(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new vt,this._removedObjects=new vt,this._changedObjects=new vt;let o=xn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=or.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new zD(n,e,s,!1),this._outlineBatches[o+s]=new zD(n,e,s,!0),this._closedColorBatches[s]=new Wd(n,cn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new Wd(n,cn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new qd(n,so,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new qd(n,so,void 0,!0,s,!1),this._openColorBatches[s]=new Wd(n,cn,void 0,!1,s,!0),this._openColorBatches[o+s]=new Wd(n,cn,void 0,!1,s,!1),this._openMaterialBatches[s]=new qd(n,so,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new qd(n,so,void 0,!1,s,!1);let a=kn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new vk(i,s,so)),c[s]=new UD(i,s);else for(s=0;s<a;++s)c[s]=new UD(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new RA(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new vt,this._updaterSets=new vt,this._entityCollection=t,t.collectionChanged.addEventListener(Dl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,_Je)}Dl.registerUpdater=function(e){YA.registerUpdater(e)};Dl.unregisterUpdater=function(e){YA.unregisterUpdater(e)};Dl.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f,h=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(x){h._removeUpdater(x),h._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new YA(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(x){h._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Dl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,_=this._batches,m=_.length;for(a=0;a<m;a++)p=_[a].update(e)&&p;return p};var yJe=[],xJe=new ae;Dl.prototype.getBoundingSphere=function(e,t){let n=yJe,i=xJe,o=0,r=ct.DONE,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let h=u[f];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(h,i),r===ct.PENDING)return ct.PENDING;r===ct.DONE&&(n[o]=ae.clone(i,n[o]),o++)}}return o===0?ct.FAILED:(n.length=o,ae.fromBoundingSpheres(n,t),ct.DONE)};Dl.prototype.isDestroyed=function(){return!1};Dl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Dl.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),ue(this)};Dl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Dl.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=xn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof zt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof zt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof zt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Dl._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Dl.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var wk=Dl;var bJe=1,TJe="30px sans-serif",CJe=Xo.FILL,AJe=z.WHITE,EJe=z.BLACK,SJe=1,vJe=!1,wJe=new z(.165,.165,.165,.8),DJe=new U(7,5),IJe=U.ZERO,PJe=d.ZERO,RJe=Ye.NONE,OJe=yi.CENTER,MJe=On.CENTER,LJe=new d,NJe=new z,FJe=new z,BJe=new z,kJe=new U,VJe=new d,UJe=new U,zJe=new kt,HJe=new kt,GJe=new kt,WJe=new Lt;function pde(e){this.entity=e,this.label=void 0,this.index=void 0}function gy(e,t){t.collectionChanged.addEventListener(gy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new vt,this._onCollectionChanged(t,t.values,[],[])}gy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,u=r.label,f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),h;if(f&&(h=q.getValueOrUndefined(s._position,e,LJe),c=q.getValueOrUndefined(a._text,e),f=l(h)&&l(c)),!f){b7(r,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,_=q.getValueOrDefault(a._heightReference,e,RJe);l(u)||(u=n.getLabel(s),u.id=s,r.label=u,p=d.equals(u.position,h)&&u.heightReference===_),u.show=!0,u.position=h,u.text=c,u.scale=q.getValueOrDefault(a._scale,e,bJe),u.font=q.getValueOrDefault(a._font,e,TJe),u.style=q.getValueOrDefault(a._style,e,CJe),u.fillColor=q.getValueOrDefault(a._fillColor,e,AJe,NJe),u.outlineColor=q.getValueOrDefault(a._outlineColor,e,EJe,FJe),u.outlineWidth=q.getValueOrDefault(a._outlineWidth,e,SJe),u.showBackground=q.getValueOrDefault(a._showBackground,e,vJe),u.backgroundColor=q.getValueOrDefault(a._backgroundColor,e,wJe,BJe),u.backgroundPadding=q.getValueOrDefault(a._backgroundPadding,e,DJe,kJe),u.pixelOffset=q.getValueOrDefault(a._pixelOffset,e,IJe,UJe),u.eyeOffset=q.getValueOrDefault(a._eyeOffset,e,PJe,VJe),u.heightReference=_,u.horizontalOrigin=q.getValueOrDefault(a._horizontalOrigin,e,OJe),u.verticalOrigin=q.getValueOrDefault(a._verticalOrigin,e,MJe),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,zJe),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,HJe),u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,GJe),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,WJe),u.disableDepthTestDistance=q.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};gy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return ct.FAILED;let i=n.label;return t.center=d.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,ct.DONE};gy.prototype.isDestroyed=function(){return!1};gy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(gy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};gy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new pde(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new pde(r)):(b7(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],b7(s.get(r.id),r,a),s.remove(r.id)};function b7(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var Dk=gy;var jJe=1,qJe=!0,YJe=0,XJe=!0,KJe=!0,ZJe=xn.ENABLED,$Je=Ye.NONE,QJe=z.RED,JJe=0,eet=z.WHITE,tet=Fc.HIGHLIGHT,net=.5,iet=new U(1,1),oet=new F,ret=new F,gde=new z,_de=new Array(4),set=new d;function _y(e,t){t.collectionChanged.addEventListener(_y.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new vt,this._onCollectionChanged(t,t.values,[],[])}async function aet(e,t,n,i){let o=e._primitives,r=e._modelHash;try{let s=await tm.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(r[t.id]))return;s.id=t,o.add(s),r[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(r[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(r[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(r[t.id]))return;console.log(s),r[t.id].loadFailed=!0}}_y.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),h;if(f&&(h=s.computeModelMatrix(e,oet),c=Se.createIfNeeded(q.getValueOrUndefined(a._uri,e)),f=l(h)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1},n[s.id]=u;let m=q.getValueOrDefault(a._incrementallyLoadTextures,e,XJe);aet(this,s,c,m)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=q.getValueOrDefault(a._scale,e,jJe),p.enableVerticalExaggeration=q.getValueOrDefault(a._enableVerticalExaggeration,e,qJe),p.minimumPixelSize=q.getValueOrDefault(a._minimumPixelSize,e,YJe),p.maximumScale=q.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(h,p.modelMatrix),p.shadows=q.getValueOrDefault(a._shadows,e,ZJe),p.heightReference=q.getValueOrDefault(a._heightReference,e,$Je),p.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=q.getValueOrDefault(a._silhouetteColor,e,QJe,gde),p.silhouetteSize=q.getValueOrDefault(a._silhouetteSize,e,JJe),p.color=q.getValueOrDefault(a._color,e,eet,gde),p.colorBlendMode=q.getValueOrDefault(a._colorBlendMode,e,tet),p.colorBlendAmount=q.getValueOrDefault(a._colorBlendAmount,e,net),p.clippingPlanes=q.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=q.getValueOrDefault(a._clampAnimations,e,KJe),p.imageBasedLighting.imageBasedLightingFactor=q.getValueOrDefault(a._imageBasedLightingFactor,e,iet);let _=q.getValueOrUndefined(a._lightColor,e);if(l(_)&&(z.pack(_,_de,0),_=d.unpack(_de,0,set)),p.lightColor=_,p.customShader=q.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=q.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:su.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let x=q.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(x)){let C=Object.keys(x);for(let A=0,S=C.length;A<S;++A){let v=C[A],D=x[v];if(!l(D))continue;let O=p.getNode(v);if(!l(O))continue;let R=F.fromTranslationRotationScale(D,ret);O.matrix=F.multiply(O.originalMatrix,R,R)}}let b=!1,T=q.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(T)){let C=Object.keys(T);for(let A=0,S=C.length;A<S;++A){let v=C[A],D=T[v];l(D)&&(b=!0,p.setArticulationStage(v,D))}}b&&p.applyArticulations()}}return!0};_y.prototype.isDestroyed=function(){return!1};_y.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_y.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)T7(this,e[i],t,n);return ue(this)};var Ik=new d,cet=new fe;_y.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return ct.FAILED;if(n.loadFailed)return ct.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return ct.PENDING;if(!i.ready||!n.modelUpdated)return ct.PENDING;let o=this._scene,r=y(o.ellipsoid,ee.default);if(i.heightReference!==Ye.NONE){let a=i.modelMatrix;Ik.x=a[12],Ik.y=a[13],Ik.z=a[14];let c=r.cartesianToCartographic(Ik,cet),u=o.getHeight(c,i.heightReference);return l(u)&&(tf(i.heightReference)?c.height=u:c.height+=u),ae.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),ct.DONE}return ae.clone(i.boundingSphere,t),ct.DONE};_y.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(uet(r,a),s.set(r.id,r)):(T7(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],T7(this,r,a,c),s.remove(r.id)};function T7(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function uet(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var Pk=_y;function yy(e){this._definitionChanged=new me,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(yy.prototype,{isConstant:{get:function(){return q.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Ui.FIXED}}});var fet=new Z;yy.prototype.getValue=function(e,t){return l(e)||(e=Z.now(fet)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};yy.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};yy.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ee.default.scaleToGeodeticSurface(n,n):void 0};yy.prototype.equals=function(e){return this===e||e instanceof yy&&this._value===e._value};yy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var og=yy;var det=60,het=1,xde=new En,C7=new En,A7=new En;function yde(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function met(e,t,n,i,o,r,s,a,c){let u=a,f;f=e.getValueInReferenceFrame(t,r,c[u]),l(f)&&(c[u++]=f);let h=!l(o)||Z.lessThanOrEquals(o,t)||Z.greaterThanOrEquals(o,n),p=0,_=i.length,m=i[p],x=n,b=!1,T,C,A;for(;p<_;){if(!h&&Z.greaterThanOrEquals(m,o)&&(f=e.getValueInReferenceFrame(o,r,c[u]),l(f)&&(c[u++]=f),h=!0),Z.greaterThan(m,t)&&Z.lessThan(m,x)&&!m.equals(o)&&(f=e.getValueInReferenceFrame(m,r,c[u]),l(f)&&(c[u++]=f)),p<_-1){if(s>0&&!b){let S=i[p+1],v=Z.secondsDifference(S,m);b=v>s,b&&(T=Math.ceil(v/s),C=0,A=v/Math.max(T,2),T=Math.max(T-1,1))}if(b&&C<T){m=Z.addSeconds(m,A,new Z),C++;continue}}b=!1,p++,m=i[p]}return f=e.getValueInReferenceFrame(n,r,c[u]),l(f)&&(c[u++]=f),u}function pet(e,t,n,i,o,r,s,a){let c,u=0,f=s,h=t,p=!l(i)||Z.lessThanOrEquals(i,t)||Z.greaterThanOrEquals(i,n);for(;Z.lessThan(h,n);)!p&&Z.greaterThanOrEquals(h,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(h,o,a[f]),l(c)&&(a[f]=c,f++),u++,h=Z.addSeconds(t,r*u,new Z);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function get(e,t,n,i,o,r,s,a){let c,u=0,f=s,h=t,p=Math.max(r,60),_=!l(i)||Z.lessThanOrEquals(i,t)||Z.greaterThanOrEquals(i,n);for(;Z.lessThan(h,n);)!_&&Z.greaterThanOrEquals(h,i)&&(_=!0,c=e.getValueInReferenceFrame(i,o,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(h,o,a[f]),l(c)&&(a[f]=c,f++),u++,h=Z.addSeconds(t,p*u,new Z);return c=e.getValueInReferenceFrame(n,o,a[f]),l(c)&&(a[f]=c,f++),f}function _et(e,t,n,i,o,r,s,a){A7.start=t,A7.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!En.intersect(h,A7,xde).isEmpty){let p=h.start;h.isStartIncluded||(h.isStopIncluded?p=h.stop:p=Z.addSeconds(h.start,Z.secondsDifference(h.stop,h.start)/2,new Z));let _=e.getValueInReferenceFrame(p,o,a[c]);l(_)&&(a[c]=_,c++)}}return c}function yet(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function xet(e,t,n,i,o,r,s,a){C7.start=t,C7.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!En.intersect(h,C7,xde).isEmpty){let p=h.start,_=h.stop,m=t;Z.greaterThan(p,m)&&(m=p);let x=n;Z.lessThan(_,x)&&(x=_),c=bde(h.data,m,x,i,o,r,c,a)}}return c}function bde(e,t,n,i,o,r,s,a){for(;e instanceof ay;)e=e.resolvedProperty;if(e instanceof va){let c=e._property._times;s=met(e,t,n,c,i,o,r,s,a)}else e instanceof bN?s=pet(e,t,n,i,o,r,s,a):e instanceof Sa?s=xet(e,t,n,i,o,r,s,a):e instanceof ly?s=_et(e,t,n,i,o,r,s,a):e instanceof gl||e instanceof og&&q.isConstant(e)?s=yet(e,t,n,i,o,r,s,a):s=get(e,t,n,i,o,r,s,a);return s}function Tde(e,t,n,i,o,r,s){l(s)||(s=[]);let a=bde(e,t,n,i,o,r,0,s);return s.length=a,s}var bet=new $;function HD(e,t){this._unusedIndexes=[],this._polylineCollection=new rm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}HD.prototype.update=function(e){if(this._referenceFrame===Ui.INERTIAL){let t=Mt.computeIcrfToCentralBodyFixedMatrix(e,bet);F.fromRotationTranslation(t,d.ZERO,this._polylineCollection.modelMatrix)}};HD.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let h=q.getValueOrUndefined(i._leadTime,e),p=q.getValueOrUndefined(i._trailTime,e),_=n._availability,m=l(_),x=l(h),b=l(p);if(u=m||x&&b,u){if(b&&(r=Z.addSeconds(e,-p,new Z)),x&&(s=Z.addSeconds(e,h,new Z)),m){let T=_.start,C=_.stop;(!b||Z.greaterThan(T,r))&&(r=T),(!x||Z.lessThan(C,s))&&(s=C)}u=Z.lessThan(r,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let h=this._unusedIndexes;if(h.length>0){let _=h.pop();c=this._polylineCollection.get(_),t.index=_}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=q.getValueOrDefault(i._resolution,e,det);c.show=!0,c.positions=Tde(o,r,s,e,this._referenceFrame,f,c.positions.slice()),c.material=ir.getValue(e,i._material,c.material),c.width=q.getValueOrDefault(i._width,e,het),c.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};HD.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};HD.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function xy(e,t){t.collectionChanged.addEventListener(xy.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new vt,this._onCollectionChanged(t,t.values,[],[])}xy.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,u=Ui.FIXED;this._scene.mode===ne.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(c===f&&l(f)){f.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(f)||(f=new HD(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,l(f)&&f.updateObject(e,r)}return!0};xy.prototype.isDestroyed=function(){return!1};xy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(xy.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};xy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new yde(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new yde(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};xy._subSample=Tde;var Rk=xy;var Cde=z.WHITE,Ade=z.BLACK,Ede=0,Sde=1,vde=0,wde=Gr.NONE,Dde=new z,Tet=new d,Ide=new z,Pde=new kt,Rde=new kt,Ode=new Lt;function Mde(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function by(e,t){t.collectionChanged.addEventListener(by.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new vt,this._onCollectionChanged(t,t.values,[],[])}by.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,u=r.billboard,f=q.getValueOrDefault(a._heightReference,e,Ye.NONE),h=s.isShowing&&s.isAvailable(e)&&q.getValueOrDefault(a._show,e,!0),p;if(h&&(p=q.getValueOrUndefined(s._position,e,Tet),h=l(p)),!h){GD(r,s,n);continue}q.isConstant(s._position)||(n._clusterDirty=!0);let _=!1,m=!1;if(f!==Ye.NONE&&!l(u)?(l(c)&&(GD(r,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,_=!0,m=d.equals(u.position,p)&&u.heightReference===f):f===Ye.NONE&&!l(c)&&(l(u)&&(GD(r,s,n),u=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,Pde),c.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Rde),c.color=q.getValueOrDefault(a._color,e,Cde,Dde),c.outlineColor=q.getValueOrDefault(a._outlineColor,e,Ade,Ide),c.outlineWidth=q.getValueOrDefault(a._outlineWidth,e,Ede),c.pixelSize=q.getValueOrDefault(a._pixelSize,e,Sde),c.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Ode),c.disableDepthTestDistance=q.getValueOrDefault(a._disableDepthTestDistance,e,vde),c.splitDirection=q.getValueOrDefault(a._splitDirection,e,wde);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=q.getValueOrUndefined(a._scaleByDistance,e,Pde),u.translucencyByDistance=q.getValueOrUndefined(a._translucencyByDistance,e,Rde),u.distanceDisplayCondition=q.getValueOrUndefined(a._distanceDisplayCondition,e,Ode),u.disableDepthTestDistance=q.getValueOrDefault(a._disableDepthTestDistance,e,vde),u.splitDirection=q.getValueOrDefault(a._splitDirection,e,wde),u.heightReference=f;let x=q.getValueOrDefault(a._color,e,Cde,Dde),b=q.getValueOrDefault(a._outlineColor,e,Ade,Ide),T=Math.round(q.getValueOrDefault(a._outlineWidth,e,Ede)),C=Math.max(1,Math.round(q.getValueOrDefault(a._pixelSize,e,Sde)));if(T>0?(u.scale=1,_=_||T!==r.outlineWidth||C!==r.pixelSize||!z.equals(x,r.color)||!z.equals(b,r.outlineColor)):(u.scale=C/50,C=50,_=_||T!==r.outlineWidth||!z.equals(x,r.color)||!z.equals(b,r.outlineColor)),_){r.color=z.clone(x,r.color),r.outlineColor=z.clone(b,r.outlineColor),r.pixelSize=C,r.outlineWidth=T;let A=x.alpha,S=x.toCssColorString(),v=b.toCssColorString(),D=JSON.stringify([S,C,v,T]);u.setImage(D,HC(A,S,v,T,C))}m&&u._updateClamping()}}return!0};by.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return ct.FAILED;if(l(n.pointPrimitive))t.center=d.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ct.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,ct.DONE};by.prototype.isDestroyed=function(){return!1};by.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(by.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};by.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new Mde(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Mde(r)):(GD(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],GD(s.get(r.id),r,a),s.remove(r.id)};function GD(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var Ok=by;var kde=[];function Cet(e,t,n,i,o){let r=kde;r.length=o;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,h=i.red,p=i.green,_=i.blue,m=i.alpha;if(z.equals(n,i)){for(s=0;s<o;s++)r[s]=z.clone(n);return r}let x=(h-a)/o,b=(p-c)/o,T=(_-u)/o,C=(m-f)/o;for(s=0;s<o;s++)r[s]=new z(a+s*x,c+s*b,u+s*T,f+s*C);return r}function WD(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),o=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Ie.clone(y(e.vertexFormat,Ie.DEFAULT)),this._arcType=y(e.arcType,tn.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=ee.clone(y(e.ellipsoid,ee.default)),this._workerName="createPolylineGeometry";let r=1+t.length*d.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+ee.packedLength+Ie.packedLength+4}WD.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Vde=ee.clone(ee.UNIT_SPHERE),Ude=new Ie,eb={positions:void 0,colors:void 0,ellipsoid:Vde,vertexFormat:Ude,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};WD.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,Vde);t+=ee.packedLength;let c=Ie.unpack(e,t,Ude);t+=Ie.packedLength;let u=e[t++],f=e[t++]===1,h=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=h,n._granularity=p,n):(eb.positions=r,eb.colors=s,eb.width=u,eb.colorsPerVertex=f,eb.arcType=h,eb.granularity=p,new WD(eb))};var Lde=new d,Nde=new d,Fde=new d,Bde=new d;WD.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,h=[],p=bo(e._positions,d.equalsEpsilon,!1,h);if(l(i)&&h.length>0){let N=0,B=h[0];i=i.filter(function(H,V){let G=!1;return o?G=V===B||V===0&&B===1:G=V+1===B,G?(N++,B=h[N],!1):!0})}let _=p.length;if(_<2||t<=0)return;if(r===tn.GEODESIC||r===tn.RHUMB){let N,B;r===tn.GEODESIC?(N=P.chordLength(s,a.maximumRadius),B=Li.numberOfPoints):(N=s,B=Li.numberOfPointsRhumbLine);let H=Li.extractHeights(p,a);if(l(i)){let V=1;for(c=0;c<_-1;++c)V+=B(p[c],p[c+1],N);let G=new Array(V),k=0;for(c=0;c<_-1;++c){let W=p[c],Y=p[c+1],J=i[c],j=B(W,Y,N);if(o&&c<V){let K=i[c+1],Q=Cet(W,Y,J,K,j),de=Q.length;for(u=0;u<de;++u)G[k++]=Q[u]}else for(u=0;u<j;++u)G[k++]=z.clone(J)}G[k]=z.clone(i[i.length-1]),i=G,kde.length=0}r===tn.GEODESIC?p=Li.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:H}):p=Li.generateCartesianRhumbArc({positions:p,granularity:N,ellipsoid:a,height:H})}_=p.length;let m=_*4-4,x=new Float64Array(m*3),b=new Float64Array(m*3),T=new Float64Array(m*3),C=new Float32Array(m*2),A=n.st?new Float32Array(m*2):void 0,S=l(i)?new Uint8Array(m*4):void 0,v=0,D=0,O=0,R=0,M;for(u=0;u<_;++u){u===0?(M=Lde,d.subtract(p[0],p[1],M),d.add(p[0],M,M)):M=p[u-1],d.clone(M,Fde),d.clone(p[u],Nde),u===_-1?(M=Lde,d.subtract(p[_-1],p[_-2],M),d.add(p[_-1],M,M)):M=p[u+1],d.clone(M,Bde);let N,B;l(S)&&(u!==0&&!o?N=i[u-1]:N=i[u],u!==_-1&&(B=i[u]));let H=u===0?2:0,V=u===_-1?2:4;for(f=H;f<V;++f){d.pack(Nde,x,v),d.pack(Fde,b,v),d.pack(Bde,T,v),v+=3;let G=f-2<0?-1:1;if(C[D++]=2*(f%2)-1,C[D++]=G*t,n.st&&(A[O++]=u/(_-1),A[O++]=Math.max(C[D-2],0)),l(S)){let k=f<2?N:B;S[R++]=z.floatToByte(k.red),S[R++]=z.floatToByte(k.green),S[R++]=z.floatToByte(k.blue),S[R++]=z.floatToByte(k.alpha)}}}let L=new hn;L.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:x}),L.prevPosition=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:b}),L.nextPosition=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:T}),L.expandAndWidth=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:C}),n.st&&(L.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:A})),l(S)&&(L.color=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));let g=Ne.createTypedArray(m,_*6-6),E=0,w=0,I=_-1;for(u=0;u<I;++u)g[w++]=E,g[w++]=E+2,g[w++]=E+1,g[w++]=E+1,g[w++]=E+2,g[w++]=E+3,E+=4;return new at({attributes:L,indices:g,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromPoints(p),geometryType:ld.POLYLINES})};var Ty=WD;var Aet=new Yn(0),Mk={},zde=new z,Eet=new zt(z.WHITE),vet=new Yn(!0),wet=new Yn(xn.DISABLED),Det=new Yn(new Lt),Iet=new Yn(kn.BOTH);function Pet(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Ret(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Yd(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Yd.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new me,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new Pet,this._groundGeometryOptions=new Ret,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=or.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Yd.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Yd.prototype.isOutlineVisible=function(e){return!1};Yd.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};Yd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new yn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Bn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof zt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,zde)),l(a)||(a=z.WHITE),s.color=Wt.fromColor(a)),this.clampToGround?new wt({id:t,geometry:new VT(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof zt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,zde)),l(a)||(a=z.WHITE),s.depthFailColor=Wt.fromColor(a)),new wt({id:t,geometry:new Ty(this._geometryOptions),attributes:s}))};Yd.prototype.createOutlineGeometryInstance=function(e){};Yd.prototype.isDestroyed=function(){return!1};Yd.prototype.destroy=function(){this._entitySubscription(),ue(this)};Yd.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(He.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=y(o.material,Eet),u=c instanceof zt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=y(s,vet),this._shadowsProperty=y(o.shadows,wet),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,Det),this._classificationTypeProperty=y(o.classificationType,Iet),this._fillEnabled=!0,this._zIndex=y(a,Aet);let f=o.width,h=o.arcType,p=o.clampToGround,_=o.granularity;if(!r.isConstant||!q.isConstant(f)||!q.isConstant(h)||!q.isConstant(_)||!q.isConstant(p)||!q.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,x=r.getValue(He.MINIMUM_VALUE,m.positions);if(!l(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let b;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof zt)?b=is.VERTEX_FORMAT:b=Ta.VERTEX_FORMAT,m.vertexFormat=b,m.positions=x,m.width=l(f)?f.getValue(He.MINIMUM_VALUE):void 0,m.arcType=l(h)?h.getValue(He.MINIMUM_VALUE):void 0,m.granularity=l(_)?_.getValue(He.MINIMUM_VALUE):void 0;let T=this._groundGeometryOptions;T.positions=x,T.width=m.width,T.arcType=m.arcType,T.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(He.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&xt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Yd.prototype.createDynamicUpdater=function(e,t){return new jD(e,t,this)};var eE={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function jD(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function Hde(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=Mk[n];!l(i)||i.isDestroyed()?(i=new rm,Mk[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}jD.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=q.getValueOrUndefined(o,e,this._positions);t._clampToGround=q.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=q.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=q.getValueOrDefault(i._arcType,e,tn.GEODESIC),t._groundGeometryOptions.granularity=q.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let h=t.fillMaterialProperty,p;if(h instanceof zt)p=new is;else{let _=ir.getValue(e,h,this._material);p=new Ta({material:_,translucent:_.isTranslucent()}),this._material=_}this._groundPolylinePrimitive=s.add(new Lh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),q.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=Hde(this);if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=tn.GEODESIC;c=q.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==tn.NONE&&l(u)&&(eE.ellipsoid=f,eE.positions=r,eE.granularity=q.getValueOrUndefined(i._granularity,e),eE.height=Li.extractHeights(r,f),c===tn.GEODESIC?r=Li.generateCartesianArc(eE):r=Li.generateCartesianRhumbArc(eE)),a.show=!0,a.positions=r.slice(),a.material=ir.getValue(e,t.fillMaterialProperty,a.material),a.width=q.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};jD.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ae.clone(n.boundingSphere,e),ct.DONE}return l(t)&&!t.ready?ct.PENDING:ct.DONE}else{let t=Hde(this);if(t.show&&t.positions.length>0)return ae.fromPoints(t.positions,e),ct.DONE}return ct.FAILED};jD.prototype.isDestroyed=function(){return!1};jD.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Mk[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Mk[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var Lk=Yd;var Oet=new z,Met=new Lt,Let=new Lt;function Xd(e,t,n,i,o){let r;n instanceof zt?r=is:r=Ta,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new vt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new vt,this.material=void 0,this.updatersWithAttributes=new vt,this.attributes=new vt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Xd.prototype.onMaterialChanged,this),this.subscriptions=new vt,this.showsUpdated=new vt,this.zIndex=i,this._asynchronous=o}Xd.prototype.onMaterialChanged=function(){this.invalidated=!0};Xd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof zt&&t instanceof zt?!0:l(t)&&t.equals(n)};Xd.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Xd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Xd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Lh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Ta&&(this.material=ir.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Ta&&(this.material=ir.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,b=q.getValueOrDefault(x,e,z.WHITE,Oet);z.equals(h._lastColor,b)||(h._lastColor=z.clone(b,h._lastColor),h.color=Wt.toValue(b,h.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),_=h.show[0]===1;p!==_&&(h.show=yn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let x=q.getValueOrDefault(m,e,Let,Met);Lt.equals(x,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(x,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=Bn.toValue(x,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Xd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,u=a.show[0]===1;c!==u&&(a.show=yn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Xd.prototype.contains=function(e){return this.updaters.contains(e.id)};Xd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ct.FAILED:(i.boundingSphere.clone(t),ct.DONE)};Xd.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function tE(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}tE.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=q.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new Xd(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};tE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};tE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};tE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ct.FAILED};tE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Nk=tE;var Net=[];function Gde(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function Wde(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof zt?1:2);let r;l(i)&&(r=i+o*xn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof zt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function ym(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new vt,this._removedObjects=new vt,this._changedObjects=new vt;let o,r=xn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new Wd(n,is,void 0,!1,o),this._materialBatches[o]=new qd(n,Ta,void 0,!1,o),this._colorBatches[o+r]=new Wd(n,is,is,!1,o),this._materialBatches[o+r]=new qd(n,Ta,is,!1,o),this._colorBatches[o+r*2]=new Wd(n,is,Ta,!1,o),this._materialBatches[o+r*2]=new qd(n,Ta,Ta,!1,o);this._dynamicBatch=new RA(n,i);let s=kn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new Nk(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new vt,this._updaters=new vt,this._entityCollection=t,t.collectionChanged.addEventListener(ym.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Net)}ym.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(Gde(this,f),Wde(this,e,f)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],u=c.id,f=this._updaters.get(u),Gde(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new Lk(c,this._scene),this._updaters.set(u,f),Wde(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(ym._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,_=p.length;for(a=0;a<_;a++)h=p[a].update(e)&&h;return h};var Fet=[],Bet=new ae;ym.prototype.getBoundingSphere=function(e,t){let n=Fet,i=Bet,o=0,r=ct.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(c,i),r===ct.PENDING)return ct.PENDING;r===ct.DONE&&(n[o]=ae.clone(i,n[o]),o++)}return o===0?ct.FAILED:(n.length=o,ae.fromBoundingSpheres(n,t),ct.DONE)};ym.prototype.isDestroyed=function(){return!1};ym.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ym.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};ym._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};ym.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var Fk=ym;function Il(e){pl.initializeTerrainHeights(),Lh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new _r,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Il.defaultVisualizersCallback);let i=!1,o=new mu,r=new mu;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new M3;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var nE=[];Il.registerVisualizer=function(e){nE.includes(e)||nE.push(e)};Il.unregisterVisualizer=function(e){if(nE.includes(e)){let t=nE.indexOf(e);nE.splice(t,1)}};Il.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new DL(t,i),new wk(e,i,n._primitives,n._groundPrimitives),new Dk(t,i),new Pk(e,i),new x3(e,i),new Ok(t,i),new Rk(e,i),new Fk(e,i,n._primitives,n._groundPrimitives),...nE.map(o=>new o(e,i))]};Object.defineProperties(Il.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Il.prototype.isDestroyed=function(){return!1};Il.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};Il.prototype.update=function(e){if(!li.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=t,t};Il.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var ket=[],Vet=new ae;Il.prototype.getBoundingSphere=function(e,t,n){if(!this._ready&&!t)return ct.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let _=p.get(i);if(_.entities.contains(e)){r=_;break}}}if(!l(r))return ct.FAILED;let s=ket,a=Vet,c=0,u=ct.DONE,f=r._visualizers,h=f.length;for(i=0;i<h;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===ct.PENDING)return ct.PENDING;u===ct.DONE&&(s[c]=ae.clone(a,s[c]),c++)}}return c===0?ct.FAILED:(s.length=c,ae.fromBoundingSpheres(s,n),ct.DONE)};Il.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new mu),s=o.add(new $3);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Il.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Il.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var Bk=Il;function E7(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}E7.clone=function(e,t){if(l(e))return l(t)||(t=new E7),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Kd=E7;var jde=new $,qde=new $,Yde=new $,Uet=new F,kk=new d,Xde=new d,S7=new d,v7=new d,Kde=new d,Zde=new d,zet=new Oe,Het=new d,Get=new $,iE=new Z,Wet=1.25;function jet(e,t,n,i,o,r,s,a,c,u){let f=e.scene.mode,h=o.getValue(c,e._lastCartesian);if(l(h)){let p=!1,_=!1,m,x,b;if(f===ne.SCENE3D){Z.addSeconds(c,.001,iE);let O=o.getValue(iE,kk);if(l(O)||(Z.addSeconds(c,-.001,iE),O=o.getValue(iE,kk),_=!0),l(O)){let R=Mt.computeFixedToIcrfMatrix(c,jde),M=Mt.computeFixedToIcrfMatrix(iE,qde),L;!l(R)||!l(M)?(L=Mt.computeTemeToPseudoFixedMatrix(c,Yde),R=$.transpose(L,jde),M=Mt.computeTemeToPseudoFixedMatrix(iE,qde),$.transpose(M,M)):L=$.transpose(R,Yde);let g=$.multiplyByVector(R,h,Kde),E=$.multiplyByVector(M,O,Zde);d.subtract(g,E,v7);let w=d.magnitude(v7)*1e3,I=P.GRAVITATIONALPARAMETER,N=-I/(w*w-2*I/d.magnitude(g));N<0||N>Wet*u.maximumRadius?(m=Xde,d.normalize(h,m),d.negate(m,m),b=d.clone(d.UNIT_Z,S7),x=d.cross(b,m,kk),d.magnitude(x)>P.EPSILON7&&(d.normalize(m,m),d.normalize(x,x),b=d.cross(m,x,S7),d.normalize(b,b),p=!0)):d.equalsEpsilon(h,O,P.EPSILON7)||(b=Xde,d.normalize(g,b),d.normalize(E,E),x=d.cross(b,E,S7),_&&(x=d.multiplyByScalar(x,-1,x)),d.equalsEpsilon(x,d.ZERO,P.EPSILON7)||(m=d.cross(x,b,kk),$.multiplyByVector(L,m,m),$.multiplyByVector(L,x,x),$.multiplyByVector(L,b,b),d.normalize(m,m),d.normalize(x,x),d.normalize(b,b),p=!0))}}l(e.boundingSphere)&&(h=e.boundingSphere.center);let T,C,A;i&&(T=d.clone(t.position,v7),C=d.clone(t.direction,Kde),A=d.clone(t.up,Zde));let S=Uet,v;l(s)&&(v=s.getValue(c,zet));let D=r.getValue(c,Het);if(a===Yg.INERTIAL&&l(v))F.fromTranslationQuaternionRotationScale(h,v,d.ONE,S);else if(a===Yg.VELOCITY&&l(D)){let O=Mt.rotationMatrixFromPositionVelocity(h,D,u,Get);F.fromRotationTranslation(O,h,S)}else a===Yg.ENU||!p?Mt.eastNorthUpToFixedFrame(h,u,S):(S[0]=m.x,S[1]=m.y,S[2]=m.z,S[3]=0,S[4]=x.x,S[5]=x.y,S[6]=x.z,S[7]=0,S[8]=b.x,S[9]=b.y,S[10]=b.z,S[11]=0,S[12]=h.x,S[13]=h.y,S[14]=h.z,S[15]=0);t._setTransform(S),i&&(d.clone(T,t.position),d.clone(C,t.direction),d.clone(A,t.up),d.cross(C,A,t.right))}if(n){let p=f===ne.SCENE2D||d.equals(e._offset3D,d.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function qD(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,ee.default),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new d,this._defaultOffset3D=void 0,this._velocityProperty=new fy(e.position,!0),this._offset3D=new d}Object.defineProperties(qD,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=d.clone(e,new d)}}});qD.defaultOffset3D=new d(-14e3,3500,3500);var Vk=new Kd,qet=new d;qD.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ne.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,h=o!==this._mode,p=n.camera,_=f||h,m=!0;if(f){let x=r.viewFrom,b=l(x);if(!b&&l(t)){Vk.pitch=-P.PI_OVER_FOUR,Vk.range=0;let T=a.getValue(e,qet);if(l(T)){let C=2-1/Math.max(1,d.magnitude(T)/i.maximumRadius);Vk.pitch*=C}p.viewBoundingSphere(t,Vk),this.boundingSphere=t,_=!1,m=!1}else(!b||!l(x.getValue(e,this._offset3D)))&&d.clone(qD._defaultOffset3D,this._offset3D)}else!h&&this._mode!==ne.SCENE2D&&d.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,jet(this,p,_,m,a,c,u,s,e,i)};var Uk=qD;function XD(){this._cache={}}XD.prototype.fromColor=function(e,t){return zk(void 0,void 0,e,t,this._cache)};XD.prototype.fromUrl=function(e,t,n){return zk(e,void 0,t,n,this._cache)};XD.prototype.fromMakiIconId=function(e,t,n){return zk(nn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};XD.prototype.fromText=function(e,t,n){return zk(void 0,e,t,n,this._cache)};var Yet=new z;function Xet(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Yet).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function $de(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var YD=new Array(4);function zk(e,t,n,i,o){YD[0]=e,YD[1]=t,YD[2]=n,YD[3]=i;let r=JSON.stringify(YD),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(Xet(c,n,i),l(e)){let f=Se.createIfNeeded(e).fetchImage().then(function(h){return $de(c,h,i),o[r]=a,a});return o[r]=f,f}else if(l(t)){let u=WC(t,{font:`bold ${i}px sans-serif`});$de(c,u,i)}return o[r]=a,a}var Cy=XD;function w7(e){return e}function Hk(e){if(e==null)return w7;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var u=2,f=a.length,h=new Array(f);for(h[0]=(t+=a[0])*i+r,h[1]=(n+=a[1])*o+s;u<f;)h[u]=a[u],++u;return h}}function Qde(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function D7(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Jde(e,n)})}:Jde(e,t)}function Jde(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=I7(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function I7(e,t){var n=Hk(e.transform),i=e.arcs;function o(f,h){h.length&&h.pop();for(var p=i[f<0?~f:f],_=0,m=p.length;_<m;++_)h.push(n(p[_],_));f<0&&Qde(h,m)}function r(f){return n(f)}function s(f){for(var h=[],p=0,_=f.length;p<_;++p)o(f[p],h);return h.length<2&&h.push(h[0]),h}function a(f){for(var h=s(f);h.length<4;)h.push(h[0]);return h}function c(f){return f.map(a)}function u(f){var h=f.type,p;switch(h){case"GeometryCollection":return{type:h,geometries:f.geometries.map(u)};case"Point":p=r(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(r);break;case"LineString":p=s(f.arcs);break;case"MultiLineString":p=f.arcs.map(s);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:h,coordinates:p}}return u(t)}function Gk(e){return d.fromDegrees(e[0],e[1],e[2])}var P7={"urn:ogc:def:crs:OGC:1.3:CRS84":Gk,"EPSG:4326":Gk,"urn:ogc:def:crs:EPSG::4326":Gk},ehe={},the={},R7=48,O7,M7=z.ROYALBLUE,L7=z.YELLOW,N7=2,F7=z.fromBytes(255,255,0,100),B7=!1,Jet={small:24,medium:48,large:64},ett=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function nhe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||ett.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${nhe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function ttt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function ntt(e,t){return new Vh(ttt(nhe,e,t),!0)}function Wk(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=zn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let h=f.toLowerCase();if(u>1&&h==="title"){u=1,s=f;break}else u>2&&h==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new Yn(c):n(r,s))}return o}function k7(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var ihe={Feature:rhe,FeatureCollection:itt,GeometryCollection:she,LineString:fhe,MultiLineString:dhe,MultiPoint:lhe,MultiPolygon:phe,Point:che,Polygon:mhe,Topology:ghe},ohe={GeometryCollection:she,LineString:fhe,MultiLineString:dhe,MultiPoint:lhe,MultiPolygon:phe,Point:che,Polygon:mhe,Topology:ghe};function rhe(e,t,n,i,o){if(t.geometry===null){Wk(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new re("feature.geometry is required.");let r=t.geometry.type,s=ohe[r];if(!l(s))throw new re(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function itt(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)rhe(e,r[s],void 0,i,o)}function she(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],u=c.type,f=ohe[u];if(!l(f))throw new re(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function ahe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let _=c["marker-color"];l(_)&&(s=z.fromCssColorString(_)),a=y(Jet[c["marker-size"]],a);let m=c["marker-symbol"];l(m)&&(r=m)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new Ec;f.verticalOrigin=new Yn(On.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=Ye.CLAMP_TO_GROUND);let h=Wk(t,e._entityCollection,o.describe);h.billboard=f,h.position=new gl(n(i));let p=Promise.resolve(u).then(function(_){f.image=new Yn(_)}).catch(function(){f.image=new Yn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function che(e,t,n,i,o){ahe(e,t,i,n.coordinates,o)}function lhe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)ahe(e,t,i,r[s],o)}function uhe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new Yn(f));let h,p=a.stroke;l(p)&&(h=z.fromCssColorString(p));let _=a["stroke-opacity"];l(_)&&_!==1&&(l(h)||(h=r.color.getValue().clone()),h.alpha=_),l(h)&&(r=new zt(h))}let c=Wk(t,e._entityCollection,o.describe),u=new Ic;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new Yn(k7(i,n)),u.arcType=tn.RHUMB}function fhe(e,t,n,i,o){uhe(e,t,i,n.coordinates,o)}function dhe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)uhe(e,t,i,r[s],o)}function hhe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let _=c["stroke-width"];l(_)&&(a=new Yn(_));let m,x=c.stroke;l(x)&&(m=z.fromCssColorString(x));let b=c["stroke-opacity"];l(b)&&b!==1&&(l(m)||(m=r.getValue().clone()),m.alpha=b),l(m)&&(r=new Yn(m));let T,C=c.fill,A=s.color.getValue();l(C)&&(T=z.fromCssColorString(C),T.alpha=A.alpha),b=c["fill-opacity"],l(b)&&b!==A.alpha&&(l(T)||(T=A.clone()),T.alpha=b),l(T)&&(s=new zt(T))}let u=new Bh;u.outline=new Yn(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=tn.RHUMB;let f=[];for(let _=1,m=i.length;_<m;_++)f.push(new Xa(k7(i[_],n)));let h=i[0];u.hierarchy=new Yn(new Xa(k7(h,n),f)),h[0].length>2?u.perPositionHeight=new Yn(!0):o.clampToGround||(u.height=0);let p=Wk(t,e._entityCollection,o.describe);p.polygon=u}function mhe(e,t,n,i,o){hhe(e,t,i,n.coordinates,o)}function phe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)hhe(e,t,i,r[s],o)}function ghe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=D7(n,n.objects[r]),a=ihe[s.type];a(e,s,s,i,o)}}function Ay(e){this._name=e,this._changed=new me,this._error=new me,this._isLoading=!1,this._loading=new me,this._entityCollection=new ra(this),this._promises=[],this._pinBuilder=new Cy,this._entityCluster=new Mf,this._credit=void 0,this._resourceCredits=[]}Ay.load=function(e,t){return new Ay().load(e,t)};Object.defineProperties(Ay,{markerSize:{get:function(){return R7},set:function(e){R7=e}},markerSymbol:{get:function(){return O7},set:function(e){O7=e}},markerColor:{get:function(){return M7},set:function(e){M7=e}},stroke:{get:function(){return L7},set:function(e){L7=e}},strokeWidth:{get:function(){return N7},set:function(e){N7=e}},fill:{get:function(){return F7},set:function(e){F7=e}},clampToGround:{get:function(){return B7},set:function(e){B7=e}},crsNames:{get:function(){return P7}},crsLinkHrefs:{get:function(){return ehe}},crsLinkTypes:{get:function(){return the}}});Object.defineProperties(Ay.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Ay.prototype.load=function(e,t){return _he(this,e,t,!0)};Ay.prototype.process=function(e,t){return _he(this,e,t,!1)};function _he(e,t,n,i){Xr.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let o=n.credit;typeof o=="string"&&(o=new At(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Se){t=Se.createIfNeeded(t),r=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:y(n.describe,ntt),markerSize:y(n.markerSize,R7),markerSymbol:y(n.markerSymbol,O7),markerColor:y(n.markerColor,M7),strokeWidthProperty:new Yn(y(n.strokeWidth,N7)),strokeMaterialProperty:new zt(y(n.stroke,L7)),fillMaterialProperty:new zt(y(n.fill,F7)),clampToGround:y(n.clampToGround,B7)},Promise.resolve(r).then(function(a){return ott(e,a,n,s,i)}).catch(function(a){throw Xr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Ay.prototype.update=function(e){return!0};function ott(e,t,n,i,o){let r;l(i)&&(r=oy(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=ihe[t.type];if(!l(s))throw new re(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?Gk:null;if(l(a)){if(!l(a.properties))throw new re("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=P7[u.name],!l(c))throw new re(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=ehe[u.href];if(l(f)||(f=the[u.type]),!l(f))throw new re(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=P7[`EPSG:${u.code}`],!l(c))throw new re(`Unknown crs EPSG code: ${u.code}`)}else throw new re(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Xr.setLoading(e,!1),e})})}var jk=Ay;var yhe="4.0.0";function rtt(e){return e===void 0}function yu(e){return typeof e=="boolean"}function xhe(e,t){for(var n in t)t.hasOwnProperty(n)&&rtt(e[n])&&(e[n]=t[n]);return e}function bhe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function zo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function Ey(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Sy(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var vy=/[A-Za-z]/,Hs=/[\d]/;var xu=/\s/,qk=/['"]/,The=/[\x00-\x1F\x7F]/,Che=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,stt=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,att=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,ctt=Che+stt+att,Ahe=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,dQn=new RegExp("[".concat(Che+Ahe,"]")),V7=ctt+Ahe,Zd=new RegExp("[".concat(V7,"]"));var Yk=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(xu):[],o=t.split(xu),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(xu):[],o=t.split(xu),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();function Ehe(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(C){var A={},S=C,v=S.match(/^([a-z]+):\/\//i);return v&&(A.scheme=v[1],S=S.substr(v[0].length)),v=S.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(A.host=v[1],S=S.substr(v[0].length)),v=S.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(A.path=v[1],S=S.substr(v[0].length)),v=S.match(/^\?(.*?)(?=(#|$))/i),v&&(A.query=v[1],S=S.substr(v[0].length)),v=S.match(/^#(.*?)$/i),v&&(A.fragment=v[1]),A},s=function(C){var A="";return C.scheme&&C.host&&(A+=C.scheme+"://"),C.host&&(A+=C.host),C.path&&(A+="/"+C.path),C.query&&(A+="?"+C.query),C.fragment&&(A+="#"+C.fragment),A},a=function(C,A){var S=A/2,v=Math.ceil(S),D=-1*Math.floor(S),O="";return D<0&&(O=C.substr(D)),C.substr(0,v)+n+O};if(e.length<=t)return e;var c=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var h="";if(u.host&&(h+=u.host),h.length>=c)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,c+i):a(h,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((h+p).length>=c){if((h+p).length==t)return(h+p).substr(0,t);var _=c-h.length;return(h+a(p,_)).substr(0,c+i)}else h+=p;if(u.fragment){var m="#"+u.fragment;if((h+m).length>=c){if((h+m).length==t)return(h+m).substr(0,t);var x=c-h.length;return(h+a(m,x)).substr(0,c+i)}else h+=m}if(u.scheme&&u.host){var b=u.scheme+"://";if((h+b).length<c)return(b+h).substr(0,t)}if(h.length<=t)return h;var T="";return c>0&&(T=h.substr(-1*Math.floor(c/2))),(h.substr(0,Math.ceil(c/2))+n+T).substr(0,c+i)}function She(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}function vhe(e,t,n){return bhe(e,t,n)}var whe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new Yk({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?Ehe(t,i):o==="middle"?She(t,i):vhe(t,i)},e}();var U7=function(e,t){return U7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},U7(e,t)};function xm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");U7(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Gs=function(){return Gs=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Gs.apply(this,arguments)};var bm=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();var ltt="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u062A\u0635\u0627\u0644\u0627\u062A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u8BFA\u57FA\u4E9A|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",Dhe=new RegExp("^"+ltt+"$");var utt=/[\/?#]/,ftt=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,Ihe=/[?!:,.;^]/,z7=/https?:\/\//i,Phe=new RegExp("^"+z7.source,"i"),Rhe=new RegExp(Ihe.source+"$"),dtt=/^(javascript|vbscript):/i,htt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,mtt=/^(?:\/\/)?([^/#?:]+)/;function Xk(e){return vy.test(e)}function H7(e){return vy.test(e)||Hs.test(e)||e==="+"||e==="-"||e==="."}function rg(e){return Zd.test(e)}function Kk(e){return e==="_"||rg(e)}function G7(e){return Zd.test(e)||ftt.test(e)||Ihe.test(e)}function Zk(e){return utt.test(e)}function W7(e){return Dhe.test(e.toLowerCase())}function Ohe(e){if(dtt.test(e))return!1;var t=e.match(htt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!vy.test(i))}function Mhe(e){var t=e.match(mtt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!W7(o)}var ptt=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,gtt=/[:/?#]/;function Lhe(e){var t=e.split(gtt,1)[0];return ptt.test(t)}var _tt=/^(https?:\/\/)?(www\.)?/i,ytt=/^\/\//,Nhe=function(e){xm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=Ttt(n)),this.stripPrefix.scheme&&(n=xtt(n)),this.stripPrefix.www&&(n=btt(n)),this.stripTrailingSlash&&(n=Ctt(n)),this.decodePercentEncoding&&(n=Att(n)),n},t}(bm);function xtt(e){return e.replace(Phe,"")}function btt(e){return e.replace(_tt,"$1")}function Ttt(e){return e.replace(ytt,"")}function Ctt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function Att(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}var Fhe=/^mailto:/i,Ett=new RegExp("[".concat(V7,"!#$%&'*+/=?^_`{|}~-]"));function Bhe(e){return Zd.test(e)}function $k(e){return Ett.test(e)}function khe(e){var t=e.split(".").pop()||"";return W7(t)}var Vhe=function(e){xm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(bm);function j7(e){return e==="_"||Zd.test(e)}function Uhe(e){return e.length<=140}var zhe=["twitter","facebook","instagram","tiktok"];var Hhe=function(e){xm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;default:throw Sy(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(bm);var Stt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},vtt=/[-\w.]/;function q7(e){return vtt.test(e)}function Ghe(e,t){var n=Stt[t];return n.test(e)}var Whe=["twitter","instagram","soundcloud","tiktok"];var jhe=function(e){xm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(bm);var wtt=/[-. ]/,Dtt=/[-. ()]/,Itt=/[,;]/,Ptt=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,Rtt=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,Ott=new RegExp("^".concat(Ptt.source,"|").concat(Rtt.source,"$"));function Y7(e){return wtt.test(e)}function Qk(e){return Itt.test(e)}function qhe(e){var t=e.charAt(0)==="+"||Dtt.test(e);return t&&Ott.test(e)}var Yhe=function(e){xm(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(bm);function Zhe(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],u=e.length,f=[],h=0;h<u;h++){var p=e.charAt(h);if(f.length===0)b(p);else for(var _=f.length-1;_>=0;_--){var m=f[_];switch(m.state){case 11:D(m,p);break;case 12:O(m,p);break;case 0:T(m,p);break;case 1:C(m,p);break;case 2:A(m,p);break;case 3:S(m,p);break;case 4:v(m,p);break;case 5:R(m,p);break;case 6:M(m,p);break;case 7:L(m,p);break;case 13:g(m,p);break;case 14:E(m,p);break;case 8:w(m,p);break;case 9:I(m,p);break;case 10:N(m,p);break;case 15:B(m,p);break;case 16:H(m,p);break;case 17:V(m,p);break;case 18:G(m,p);break;case 19:k(m,p);break;case 20:W(m,p);break;case 21:Y(m,p);break;case 22:J(m,p);break;case 23:j(m,p);break;case 24:K(m,p);break;case 25:Q(m,p);break;case 26:de(m,p);break;case 27:ye(m,p);break;case 28:ce(m,p);break;case 29:ge(m,p);break;case 30:xe(m,p);break;case 31:De(m,p);break;case 32:ke(m,p);break;case 33:ze(m,p);break;case 34:et(m,p);break;case 35:St(m,p);break;case 36:mt(m,p);break;case 37:Ae(m,p);break;case 38:Be(m,p);break;case 39:Yt(m,p);break;case 40:Ct(m,p);break;case 41:ut(m,p);break;default:Sy(m.state)}}}for(var x=f.length-1;x>=0;x--)f.forEach(function(Ce){return Jt(Ce)});return c;function b(Ce){if(Ce==="#")f.push(Btt(h,28));else if(Ce==="@")f.push(ktt(h,30));else if(Ce==="/")f.push(K7(h,11));else if(Ce==="+")f.push(Z7(h,37));else if(Ce==="(")f.push(Z7(h,32));else{if(Hs.test(Ce)&&(f.push(Z7(h,38)),f.push(Ntt(h,13))),Bhe(Ce)){var Te=Ce.toLowerCase()==="m"?15:22;f.push(Ftt(h,Te))}Xk(Ce)&&f.push(X7(h,0)),Zd.test(Ce)&&f.push(K7(h,5))}}function T(Ce,Te){Te===":"?Ce.state=2:Te==="-"?Ce.state=1:H7(Te)||zo(f,Ce)}function C(Ce,Te){Te==="-"||(Te==="/"?(zo(f,Ce),f.push(K7(h,11))):H7(Te)?Ce.state=0:zo(f,Ce))}function A(Ce,Te){Te==="/"?Ce.state=3:Te==="."?zo(f,Ce):rg(Te)?(Ce.state=5,Xk(Te)&&f.push(X7(h,0))):zo(f,Ce)}function S(Ce,Te){Te==="/"?Ce.state=4:G7(Te)?(Ce.state=10,Ce.acceptStateReached=!0):Jt(Ce)}function v(Ce,Te){Te==="/"?Ce.state=10:rg(Te)?(Ce.state=5,Ce.acceptStateReached=!0):zo(f,Ce)}function D(Ce,Te){Te==="/"?Ce.state=12:zo(f,Ce)}function O(Ce,Te){rg(Te)?Ce.state=5:zo(f,Ce)}function R(Ce,Te){Te==="."?Ce.state=7:Te==="-"?Ce.state=6:Te===":"?Ce.state=8:Zk(Te)?Ce.state=10:Kk(Te)||Jt(Ce)}function M(Ce,Te){Te==="-"||(Te==="."?Jt(Ce):rg(Te)?Ce.state=5:Jt(Ce))}function L(Ce,Te){Te==="."?Jt(Ce):rg(Te)?(Ce.state=5,Ce.acceptStateReached=!0):Jt(Ce)}function g(Ce,Te){Te==="."?Ce.state=14:Te===":"?Ce.state=8:Hs.test(Te)||(Zk(Te)?Ce.state=10:Zd.test(Te)?zo(f,Ce):Jt(Ce))}function E(Ce,Te){Hs.test(Te)?(Ce.octetsEncountered++,Ce.octetsEncountered===4&&(Ce.acceptStateReached=!0),Ce.state=13):Jt(Ce)}function w(Ce,Te){Hs.test(Te)?Ce.state=9:Jt(Ce)}function I(Ce,Te){Hs.test(Te)||(Zk(Te)?Ce.state=10:Jt(Ce))}function N(Ce,Te){G7(Te)||Jt(Ce)}function B(Ce,Te){Te.toLowerCase()==="a"?Ce.state=16:J(Ce,Te)}function H(Ce,Te){Te.toLowerCase()==="i"?Ce.state=17:J(Ce,Te)}function V(Ce,Te){Te.toLowerCase()==="l"?Ce.state=18:J(Ce,Te)}function G(Ce,Te){Te.toLowerCase()==="t"?Ce.state=19:J(Ce,Te)}function k(Ce,Te){Te.toLowerCase()==="o"?Ce.state=20:J(Ce,Te)}function W(Ce,Te){Te.toLowerCase()===":"?Ce.state=21:J(Ce,Te)}function Y(Ce,Te){$k(Te)?Ce.state=22:zo(f,Ce)}function J(Ce,Te){Te==="."?Ce.state=23:Te==="@"?Ce.state=24:$k(Te)?Ce.state=22:zo(f,Ce)}function j(Ce,Te){Te==="."?zo(f,Ce):Te==="@"?zo(f,Ce):$k(Te)?Ce.state=22:zo(f,Ce)}function K(Ce,Te){rg(Te)?Ce.state=25:zo(f,Ce)}function Q(Ce,Te){Te==="."?Ce.state=27:Te==="-"?Ce.state=26:Kk(Te)||Jt(Ce)}function de(Ce,Te){Te==="-"||Te==="."?Jt(Ce):Kk(Te)?Ce.state=25:Jt(Ce)}function ye(Ce,Te){Te==="."||Te==="-"?Jt(Ce):rg(Te)?(Ce.state=25,Ce.acceptStateReached=!0):Jt(Ce)}function ce(Ce,Te){j7(Te)?(Ce.state=29,Ce.acceptStateReached=!0):zo(f,Ce)}function ge(Ce,Te){j7(Te)||Jt(Ce)}function xe(Ce,Te){q7(Te)?(Ce.state=31,Ce.acceptStateReached=!0):zo(f,Ce)}function De(Ce,Te){q7(Te)||(Zd.test(Te)?zo(f,Ce):Jt(Ce))}function Ae(Ce,Te){Hs.test(Te)?Ce.state=38:(zo(f,Ce),b(Te))}function ke(Ce,Te){Hs.test(Te)?Ce.state=33:zo(f,Ce),b(Te)}function ze(Ce,Te){Hs.test(Te)?Ce.state=34:zo(f,Ce)}function et(Ce,Te){Hs.test(Te)?Ce.state=35:zo(f,Ce)}function St(Ce,Te){Te===")"?Ce.state=36:zo(f,Ce)}function mt(Ce,Te){Hs.test(Te)?Ce.state=38:Y7(Te)?Ce.state=39:zo(f,Ce)}function Be(Ce,Te){Ce.acceptStateReached=!0,Qk(Te)?Ce.state=40:Te==="#"?Ce.state=41:Hs.test(Te)||(Te==="("?Ce.state=32:Y7(Te)?Ce.state=39:(Jt(Ce),Xk(Te)&&f.push(X7(h,0))))}function Yt(Ce,Te){Hs.test(Te)?Ce.state=38:Te==="("?Ce.state=32:(Jt(Ce),b(Te))}function Ct(Ce,Te){Qk(Te)||(Te==="#"?Ce.state=41:Hs.test(Te)?Ce.state=38:Jt(Ce))}function ut(Ce,Te){Qk(Te)?Ce.state=40:Hs.test(Te)?zo(f,Ce):Jt(Ce)}function Jt(Ce){if(zo(f,Ce),!!Ce.acceptStateReached){var Te=Ce.startIdx,it=e.slice(Ce.startIdx,h);if(it=Ltt(it),Ce.type==="url"){var Vi=e.charAt(Ce.startIdx-1);if(Vi==="@")return;var ft=Ce.matchType;if(ft==="scheme"){var mo=z7.exec(it);if(mo&&(Te=Te+mo.index,it=it.slice(mo.index)),!Ohe(it))return}else if(ft==="tld"){if(!Mhe(it))return}else if(ft==="ipV4"){if(!Lhe(it))return}else Sy(ft);c.push(new Nhe({tagBuilder:n,matchedText:it,offset:Te,urlMatchType:ft,url:it,protocolRelativeMatch:it.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(Ce.type==="email")khe(it)&&c.push(new Vhe({tagBuilder:n,matchedText:it,offset:Te,email:it.replace(Fhe,"")}));else if(Ce.type==="hashtag")Uhe(it)&&c.push(new Hhe({tagBuilder:n,matchedText:it,offset:Te,serviceName:s,hashtag:it.slice(1)}));else if(Ce.type==="mention")Ghe(it,a)&&c.push(new jhe({tagBuilder:n,matchedText:it,offset:Te,serviceName:a,mention:it.slice(1)}));else if(Ce.type==="phone"){if(it=it.replace(/ +$/g,""),qhe(it)){var Ho=it.replace(/[^0-9,;#]/g,"");c.push(new Yhe({tagBuilder:n,matchedText:it,offset:Te,number:Ho,plusSign:it.charAt(0)==="+"}))}}else Sy(Ce)}}}var Mtt=/[\(\{\[]/,Xhe=/[\)\}\]]/,Khe={")":"(","}":"{","]":"["};function Ltt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Mtt.test(i)?t[i]++:Xhe.test(i)&&t[Khe[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),Xhe.test(r)){var s=Khe[r];if(t[s]<0)t[s]++,o--;else break}else if(Rhe.test(r))o--;else break;return e.slice(0,o+1)}function X7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function K7(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Ntt(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Ftt(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Btt(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function ktt(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function Z7(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function $he(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Tm,c=0,u=e.length,f=0,h=0,p=a;c<u;){var _=e.charAt(c);switch(f){case 0:m(_);break;case 1:x(_);break;case 2:T(_);break;case 3:b(_);break;case 4:C(_);break;case 5:A(_);break;case 6:S(_);break;case 7:v(_);break;case 8:D(_);break;case 9:O(_);break;case 10:R(_);break;case 11:M(_);break;case 12:L(_);break;case 13:g(_);break;case 14:E(_);break;case 15:w(_);break;case 16:I(_);break;case 17:N(_);break;case 18:B(_);break;case 19:H(_);break;case 20:V(_);break;default:Sy(f)}c++}h<c&&Y();function m(K){K==="<"&&k()}function x(K){K==="!"?f=13:K==="/"?(f=2,p=new Tm(Gs(Gs({},p),{isClosing:!0}))):K==="<"?k():vy.test(K)?(f=3,p=new Tm(Gs(Gs({},p),{isOpening:!0}))):(f=0,p=a)}function b(K){xu.test(K)?(p=new Tm(Gs(Gs({},p),{name:J()})),f=4):K==="<"?k():K==="/"?(p=new Tm(Gs(Gs({},p),{name:J()})),f=12):K===">"?(p=new Tm(Gs(Gs({},p),{name:J()})),W()):!vy.test(K)&&!Hs.test(K)&&K!==":"&&G()}function T(K){K===">"?G():vy.test(K)?f=3:G()}function C(K){xu.test(K)||(K==="/"?f=12:K===">"?W():K==="<"?k():K==="="||qk.test(K)||The.test(K)?G():f=5)}function A(K){xu.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?W():K==="<"?k():qk.test(K)&&G()}function S(K){xu.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?W():K==="<"?k():qk.test(K)?G():f=5)}function v(K){xu.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?G():K==="<"?k():f=10)}function D(K){K==='"'&&(f=11)}function O(K){K==="'"&&(f=11)}function R(K){xu.test(K)?f=4:K===">"?W():K==="<"&&k()}function M(K){xu.test(K)?f=4:K==="/"?f=12:K===">"?W():K==="<"?k():(f=4,j())}function L(K){K===">"?(p=new Tm(Gs(Gs({},p),{isClosing:!0})),W()):f=4}function g(K){e.substr(c,2)==="--"?(c+=2,p=new Tm(Gs(Gs({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Tm(Gs(Gs({},p),{type:"doctype"})),f=20):G()}function E(K){K==="-"?f=15:K===">"?G():f=16}function w(K){K==="-"?f=18:K===">"?G():f=16}function I(K){K==="-"&&(f=17)}function N(K){K==="-"?f=18:f=16}function B(K){K===">"?W():K==="!"?f=19:K==="-"||(f=16)}function H(K){K==="-"?f=17:K===">"?W():f=16}function V(K){K===">"?W():K==="<"&&k()}function G(){f=0,p=a}function k(){f=1,p=new Tm({idx:c})}function W(){var K=e.slice(h,p.idx);K&&o(K,h),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),G(),h=c+1}function Y(){var K=e.slice(h,c);o(K,h),h=c+1}function J(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function j(){c--}}var Tm=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var Vtt=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=Utt(t.urls),this.email=yu(t.email)?t.email:this.email,this.phone=yu(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=yu(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=ztt(t.stripPrefix),this.stripTrailingSlash=yu(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=yu(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Whe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&zhe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Htt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return $he(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(h,p){if(p%2===0){var _=n.parseText(h,f);r.push.apply(r,_)}f+=h.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||Ey(t,function(n){return n.getType()==="hashtag"}),this.email||Ey(t,function(n){return n.getType()==="email"}),this.phone||Ey(t,function(n){return n.getType()==="phone"}),this.mention||Ey(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||Ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=Zhe(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof Yk)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new whe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=yhe,e}(),Qhe=Vtt;function Utt(e){return e==null&&(e=!0),yu(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:yu(e.schemeMatches)?e.schemeMatches:!0,tldMatches:yu(e.tldMatches)?e.tldMatches:!0,ipV4Matches:yu(e.ipV4Matches)?e.ipV4Matches:!0}}function ztt(e){return e==null&&(e=!0),yu(e)?{scheme:e,www:e}:{scheme:yu(e.scheme)?e.scheme:!0,www:yu(e.www)?e.www:!0}}function Htt(e){return typeof e=="number"?{length:e,location:"end"}:xhe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var Jk=Qhe;var ame;typeof DOMParser<"u"&&(ame=new DOMParser);var Gtt=new Jk({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),eV=32,Jhe=2414016,eme=1,tme=16093e3,nme=.1,Wtt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Co={gpx:Wtt};function jtt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function $7(e,t){let n=$D(e,"id");return n=l(n)?n:zn(),t.getOrCreateEntity(n)}function Q7(e){let t=ime(e,"lon"),n=ime(e,"lat"),i=KD(e,"ele",Co.gpx);return d.fromDegrees(t,n,i)}function ime(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function $D(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function wy(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function J7(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function KD(e,t,n){let i=wy(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Pl(e,t,n){let i=wy(e,t,n);if(l(i))return i.textContent.trim()}function cme(e){let t=new Ec;return t.width=eV,t.height=eV,t.scaleByDistance=new kt(Jhe,eme,tme,nme),t.pixelOffsetScaleByDistance=new kt(Jhe,eme,tme,nme),t.verticalOrigin=new Yn(On.BOTTOM),t.image=e,t}function qtt(){let e=new Fh;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=yi.LEFT,e.font="16px sans-serif",e.style=Xo.FILL_AND_OUTLINE,e}function lme(e){let t=new Ic;return t.width=4,t.material=new zx,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var ome={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},ZD;typeof document<"u"&&(ZD=document.createElement("div"));function eq(e,t){let n,i="",o=Object.keys(ome),r=o.length;for(n=0;n<r;n++){let f=o[n],h=ome[f];h.value=y(Pl(e,h.tag,Co.gpx),""),l(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!l(i)||i==="")return;i=Gtt.link(i),ZD.innerHTML=i;let s=ZD.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${ZD.innerHTML}</div>`,ZD.innerHTML="",u}function ume(e,t,n,i){let o=Q7(t),r=$7(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,eV);r.billboard=cme(s);let a=Pl(t,"name",Co.gpx);r.name=a,r.label=qtt(),r.label.text=a,r.description=eq(t,r),i.clampToGround&&(r.billboard.heightReference=Ye.CLAMP_TO_GROUND,r.label.heightReference=Ye.CLAMP_TO_GROUND)}function Ytt(e,t,n,i){let o=$7(t,n);o.description=eq(t,o);let r=J7(t,"rtept",Co.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)ume(e,r[a],n,i),s[a]=Q7(r[a]);o.polyline=lme(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Xtt(e,t,n,i){let o=$7(t,n);o.description=eq(t,o);let r=J7(t,"trkseg",Co.gpx),s=[],a=[],c,u=!0,f=new va;for(let h=0;h<r.length;h++)c=Ktt(r[h]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let h=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,eV);o.billboard=cme(h),o.position=f,i.clampToGround&&(o.billboard.heightReference=Ye.CLAMP_TO_GROUND),o.availability=new Yr,o.availability.addInterval(new En({start:a[0],stop:a[a.length-1]}))}o.polyline=lme(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Ktt(e){let t={positions:[],times:[]},n=J7(e,"trkpt",Co.gpx),i;for(let o=0;o<n.length;o++){let r=Q7(n[o]);t.positions.push(r),i=Pl(n[o],"time",Co.gpx),l(i)&&t.times.push(Z.fromIso8601(i))}return t}function Ztt(e){let t=wy(e,"metadata",Co.gpx);if(l(t)){let n={name:Pl(t,"name",Co.gpx),desc:Pl(t,"desc",Co.gpx),author:$tt(t),copyright:Jtt(t),link:fme(t),time:Pl(t,"time",Co.gpx),keywords:Pl(t,"keywords",Co.gpx),bounds:ent(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function $tt(e){let t=wy(e,"author",Co.gpx);if(l(t)){let n={name:Pl(t,"name",Co.gpx),email:Qtt(t),link:fme(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function Qtt(e){let t=wy(e,"email",Co.gpx);if(l(t)){let n=Pl(t,"id",Co.gpx),i=Pl(t,"domain",Co.gpx);return`${n}@${i}`}}function fme(e){let t=wy(e,"link",Co.gpx);if(l(t)){let n={href:$D(t,"href"),text:Pl(t,"text",Co.gpx),mimeType:Pl(t,"type",Co.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function Jtt(e){let t=wy(e,"copyright",Co.gpx);if(l(t)){let n={author:$D(t,"author"),year:Pl(t,"year",Co.gpx),license:Pl(t,"license",Co.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function ent(e){let t=wy(e,"bounds",Co.gpx);if(l(t)){let n={minLat:KD(t,"minlat",Co.gpx),maxLat:KD(t,"maxlat",Co.gpx),minLon:KD(t,"minlon",Co.gpx),maxLon:KD(t,"maxlon",Co.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var rme={wpt:ume,rte:Ytt,trk:Xtt};function tnt(e,t,n,i){let o=Object.keys(rme),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=rme[a],u=t.childNodes,f=u.length;for(let h=0;h<f;h++){let p=u[h];p.localName===a&&Co.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function sme(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=$D(o,"version"),s=$D(o,"creator"),a,c=Ztt(o);l(c)&&(a=c.name),o.localName==="gpx"?tnt(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),h=f.start,p=f.stop,_=Z.equals(h,He.MINIMUM_VALUE),m=Z.equals(p,He.MAXIMUM_VALUE);if(!_||!m){let b;_&&(b=new Date,b.setHours(0,0,0,0),h=Z.fromDate(b)),m&&(b=new Date,b.setHours(24,0,0,0),p=Z.fromDate(b)),u=new fm,u.startTime=h,u.stopTime=p,u.currentTime=Z.clone(h),u.clockRange=Kr.LOOP_STOP,u.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(p,h)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),nnt(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==r&&(e._version=r,x=!0),u!==e._clock&&(x=!0,e._clock=u),x&&e._changed.raiseEvent(e),Xr.setLoading(e,!1),e}function nnt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function int(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=n;if(typeof n=="string"||n instanceof Se){n=Se.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?jtt(r).then(function(s){let a,c;try{a=ame.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new re(u)}return sme(e,a,i)}):sme(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function oE(){this._changed=new me,this._error=new me,this._loading=new me,this._clock=void 0,this._entityCollection=new ra(this),this._entityCluster=new Mf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Cy}oE.load=function(e,t){return new oE().load(e,t)};Object.defineProperties(oE.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});oE.prototype.update=function(e){return!0};oE.prototype.load=function(e,t){if(!l(e))throw new he("data is required.");t=y(t,y.EMPTY_OBJECT),Xr.setLoading(this,!0);let n=this._name,i=this;return int(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Z.equals(s,He.MINIMUM_VALUE),u=Z.equals(a,He.MAXIMUM_VALUE);if(!c||!u){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=Z.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=Z.fromDate(h)),o=new fm,o.startTime=s,o.stopTime=a,o.currentTime=Z.clone(s),o.clockRange=Kr.LOOP_STOP,o.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Xr.setLoading(i,!1),i}).catch(function(o){return Xr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var tV=oE;function ont(e,t){this.position=e,this.headingPitchRoll=t}var nV=ont;var _I=Ur(Hl(),1);function lV(e){return uV(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function uV(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?uV(n):n),[])}var dme=[0,1,2,3].concat(...lV([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function ar(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,h,p,_,m,x,b=0;for(_=0;_<=15;_++)o.bl_count[_]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)h=o.heap[f],_=r[r[h*2+1]*2+1]+1,_>u&&(_=u,b++),r[h*2+1]=_,!(h>e.max_code)&&(o.bl_count[_]++,m=0,h>=c&&(m=a[h-c]),x=r[h*2],o.opt_len+=x*(_+m),s&&(o.static_len+=x*(s[h*2+1]+m)));if(b!==0){do{for(_=u-1;o.bl_count[_]===0;)_--;o.bl_count[_]--,o.bl_count[_+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(_=u;_!==0;_--)for(h=o.bl_count[_];h!==0;)p=o.heap[--f],!(p>e.max_code)&&(r[p*2+1]!=_&&(o.opt_len+=(_-r[p*2+1])*r[p*2],r[p*2+1]=_),h--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,u,f,h;for(u=1;u<=15;u++)a[u]=c=c+s[u-1]<<1;for(f=0;f<=r;f++)h=o[f*2+1],h!==0&&(o[f*2]=n(a[h]++,h))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,u,f=-1,h;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=f=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)h=o.heap[++o.heap_len]=f<2?++f:0,r[h*2]=1,o.depth[h]=0,o.opt_len--,s&&(o.static_len-=s[h*2+1]);for(e.max_code=f,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);h=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=u,r[h*2]=r[c*2]+r[u*2],o.depth[h]=Math.max(o.depth[c],o.depth[u])+1,r[c*2+1]=r[u*2+1]=h,o.heap[1]=h++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}ar._length_code=[0,1,2,3,4,5,6,7].concat(...lV([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));ar.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];ar.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];ar.d_code=function(e){return e<256?dme[e]:dme[256+(e>>>7)]};ar.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];ar.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];ar.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];ar.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function wa(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var rnt=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],snt=lV([[144,8],[112,9],[24,7],[8,8]]);wa.static_ltree=uV(rnt.map((e,t)=>[e,snt[t]]));var ant=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],cnt=lV([[30,5]]);wa.static_dtree=uV(ant.map((e,t)=>[e,cnt[t]]));wa.static_l_desc=new wa(wa.static_ltree,ar.extra_lbits,257,286,15);wa.static_d_desc=new wa(wa.static_dtree,ar.extra_dbits,0,30,15);wa.static_bl_desc=new wa(null,ar.extra_blbits,0,19,7);var lnt=9,unt=8;function Cm(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var mme=0,aV=1,tb=2,$d=[new Cm(0,0,0,0,mme),new Cm(4,4,8,4,aV),new Cm(4,5,16,8,aV),new Cm(4,6,32,32,aV),new Cm(4,4,16,16,tb),new Cm(8,16,32,32,tb),new Cm(8,16,128,128,tb),new Cm(8,32,128,256,tb),new Cm(32,128,258,1024,tb),new Cm(32,258,258,4096,tb)],iV=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],zf=0,oV=1,QD=2,rV=3,fnt=32,tq=42,sV=113,JD=666,nq=8,dnt=0,iq=1,hnt=2,xr=3,cV=258,bu=cV+xr+1;function hme(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function mnt(){let e=this,t,n,i,o,r,s,a,c,u,f,h,p,_,m,x,b,T,C,A,S,v,D,O,R,M,L,g,E,w,I,N,B,H,V=new ar,G=new ar,k=new ar;e.depth=[];let W,Y,J,j,K,Q;e.bl_count=[],e.heap=[],N=[],B=[],H=[];function de(){u=2*r,h[_-1]=0;for(let Le=0;Le<_-1;Le++)h[Le]=0;L=$d[g].max_lazy,w=$d[g].good_length,I=$d[g].nice_length,M=$d[g].max_chain,v=0,T=0,O=0,C=R=xr-1,S=0,p=0}function ye(){let Le;for(Le=0;Le<286;Le++)N[Le*2]=0;for(Le=0;Le<30;Le++)B[Le*2]=0;for(Le=0;Le<19;Le++)H[Le*2]=0;N[256*2]=1,e.opt_len=e.static_len=0,Y=J=0}function ce(){V.dyn_tree=N,V.stat_desc=wa.static_l_desc,G.dyn_tree=B,G.stat_desc=wa.static_d_desc,k.dyn_tree=H,k.stat_desc=wa.static_bl_desc,K=0,Q=0,j=8,ye()}e.pqdownheap=function(Le,ot){let je=e.heap,Xe=je[ot],ht=ot<<1;for(;ht<=e.heap_len&&(ht<e.heap_len&&hme(Le,je[ht+1],je[ht],e.depth)&&ht++,!hme(Le,Xe,je[ht],e.depth));)je[ot]=je[ht],ot=ht,ht<<=1;je[ot]=Xe};function ge(Le,ot){let je=-1,Xe,ht=Le[0*2+1],Gt=0,_n=7,Eo=4;ht===0&&(_n=138,Eo=3),Le[(ot+1)*2+1]=65535;for(let yo=0;yo<=ot;yo++)Xe=ht,ht=Le[(yo+1)*2+1],!(++Gt<_n&&Xe==ht)&&(Gt<Eo?H[Xe*2]+=Gt:Xe!==0?(Xe!=je&&H[Xe*2]++,H[16*2]++):Gt<=10?H[17*2]++:H[18*2]++,Gt=0,je=Xe,ht===0?(_n=138,Eo=3):Xe==ht?(_n=6,Eo=3):(_n=7,Eo=4))}function xe(){let Le;for(ge(N,V.max_code),ge(B,G.max_code),k.build_tree(e),Le=18;Le>=3&&H[ar.bl_order[Le]*2+1]===0;Le--);return e.opt_len+=3*(Le+1)+5+5+4,Le}function De(Le){e.pending_buf[e.pending++]=Le}function Ae(Le){De(Le&255),De(Le>>>8&255)}function ke(Le){De(Le>>8&255),De(Le&255&255)}function ze(Le,ot){let je,Xe=ot;Q>16-Xe?(je=Le,K|=je<<Q&65535,Ae(K),K=je>>>16-Q,Q+=Xe-16):(K|=Le<<Q&65535,Q+=Xe)}function et(Le,ot){let je=Le*2;ze(ot[je]&65535,ot[je+1]&65535)}function St(Le,ot){let je,Xe=-1,ht,Gt=Le[0*2+1],_n=0,Eo=7,yo=4;for(Gt===0&&(Eo=138,yo=3),je=0;je<=ot;je++)if(ht=Gt,Gt=Le[(je+1)*2+1],!(++_n<Eo&&ht==Gt)){if(_n<yo)do et(ht,H);while(--_n!==0);else ht!==0?(ht!=Xe&&(et(ht,H),_n--),et(16,H),ze(_n-3,2)):_n<=10?(et(17,H),ze(_n-3,3)):(et(18,H),ze(_n-11,7));_n=0,Xe=ht,Gt===0?(Eo=138,yo=3):ht==Gt?(Eo=6,yo=3):(Eo=7,yo=4)}}function mt(Le,ot,je){let Xe;for(ze(Le-257,5),ze(ot-1,5),ze(je-4,4),Xe=0;Xe<je;Xe++)ze(H[ar.bl_order[Xe]*2+1],3);St(N,Le-1),St(B,ot-1)}function Be(){Q==16?(Ae(K),K=0,Q=0):Q>=8&&(De(K&255),K>>>=8,Q-=8)}function Yt(){ze(iq<<1,3),et(256,wa.static_ltree),Be(),1+j+10-Q<9&&(ze(iq<<1,3),et(256,wa.static_ltree),Be()),j=7}function Ct(Le,ot){let je,Xe,ht;if(e.dist_buf[Y]=Le,e.lc_buf[Y]=ot&255,Y++,Le===0?N[ot*2]++:(J++,Le--,N[(ar._length_code[ot]+256+1)*2]++,B[ar.d_code(Le)*2]++),!(Y&8191)&&g>2){for(je=Y*8,Xe=v-T,ht=0;ht<30;ht++)je+=B[ht*2]*(5+ar.extra_dbits[ht]);if(je>>>=3,J<Math.floor(Y/2)&&je<Math.floor(Xe/2))return!0}return Y==W-1}function ut(Le,ot){let je,Xe,ht=0,Gt,_n;if(Y!==0)do je=e.dist_buf[ht],Xe=e.lc_buf[ht],ht++,je===0?et(Xe,Le):(Gt=ar._length_code[Xe],et(Gt+256+1,Le),_n=ar.extra_lbits[Gt],_n!==0&&(Xe-=ar.base_length[Gt],ze(Xe,_n)),je--,Gt=ar.d_code(je),et(Gt,ot),_n=ar.extra_dbits[Gt],_n!==0&&(je-=ar.base_dist[Gt],ze(je,_n)));while(ht<Y);et(256,Le),j=Le[256*2+1]}function Jt(){Q>8?Ae(K):Q>0&&De(K&255),K=0,Q=0}function Ce(Le,ot,je){Jt(),j=8,je&&(Ae(ot),Ae(~ot)),e.pending_buf.set(c.subarray(Le,Le+ot),e.pending),e.pending+=ot}function Te(Le,ot,je){ze((dnt<<1)+(je?1:0),3),Ce(Le,ot,!0)}function it(Le,ot,je){let Xe,ht,Gt=0;g>0?(V.build_tree(e),G.build_tree(e),Gt=xe(),Xe=e.opt_len+3+7>>>3,ht=e.static_len+3+7>>>3,ht<=Xe&&(Xe=ht)):Xe=ht=ot+5,ot+4<=Xe&&Le!=-1?Te(Le,ot,je):ht==Xe?(ze((iq<<1)+(je?1:0),3),ut(wa.static_ltree,wa.static_dtree)):(ze((hnt<<1)+(je?1:0),3),mt(V.max_code+1,G.max_code+1,Gt+1),ut(N,B)),ye(),je&&Jt()}function Vi(Le){it(T>=0?T:-1,v-T,Le),T=v,t.flush_pending()}function ft(){let Le,ot,je,Xe;do{if(Xe=u-O-v,Xe===0&&v===0&&O===0)Xe=r;else if(Xe==-1)Xe--;else if(v>=r+r-bu){c.set(c.subarray(r,r+r),0),D-=r,v-=r,T-=r,Le=_,je=Le;do ot=h[--je]&65535,h[je]=ot>=r?ot-r:0;while(--Le!==0);Le=r,je=Le;do ot=f[--je]&65535,f[je]=ot>=r?ot-r:0;while(--Le!==0);Xe+=r}if(t.avail_in===0)return;Le=t.read_buf(c,v+O,Xe),O+=Le,O>=xr&&(p=c[v]&255,p=(p<<b^c[v+1]&255)&x)}while(O<bu&&t.avail_in!==0)}function mo(Le){let ot=65535,je;for(ot>i-5&&(ot=i-5);;){if(O<=1){if(ft(),O===0&&Le==0)return zf;if(O===0)break}if(v+=O,O=0,je=T+ot,(v===0||v>=je)&&(O=v-je,v=je,Vi(!1),t.avail_out===0)||v-T>=r-bu&&(Vi(!1),t.avail_out===0))return zf}return Vi(Le==4),t.avail_out===0?Le==4?QD:zf:Le==4?rV:oV}function Ho(Le){let ot=M,je=v,Xe,ht,Gt=R,_n=v>r-bu?v-(r-bu):0,Eo=I,yo=a,La=v+cV,Na=c[je+Gt-1],gi=c[je+Gt];R>=w&&(ot>>=2),Eo>O&&(Eo=O);do if(Xe=Le,!(c[Xe+Gt]!=gi||c[Xe+Gt-1]!=Na||c[Xe]!=c[je]||c[++Xe]!=c[je+1])){je+=2,Xe++;do;while(c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&c[++je]==c[++Xe]&&je<La);if(ht=cV-(La-je),je=La-cV,ht>Gt){if(D=Le,Gt=ht,ht>=Eo)break;Na=c[je+Gt-1],gi=c[je+Gt]}}while((Le=f[Le&yo]&65535)>_n&&--ot!==0);return Gt<=O?Gt:O}function Ma(Le){let ot=0,je;for(;;){if(O<bu){if(ft(),O<bu&&Le==0)return zf;if(O===0)break}if(O>=xr&&(p=(p<<b^c[v+(xr-1)]&255)&x,ot=h[p]&65535,f[v&a]=h[p],h[p]=v),ot!==0&&(v-ot&65535)<=r-bu&&E!=2&&(C=Ho(ot)),C>=xr)if(je=Ct(v-D,C-xr),O-=C,C<=L&&O>=xr){C--;do v++,p=(p<<b^c[v+(xr-1)]&255)&x,ot=h[p]&65535,f[v&a]=h[p],h[p]=v;while(--C!==0);v++}else v+=C,C=0,p=c[v]&255,p=(p<<b^c[v+1]&255)&x;else je=Ct(0,c[v]&255),O--,v++;if(je&&(Vi(!1),t.avail_out===0))return zf}return Vi(Le==4),t.avail_out===0?Le==4?QD:zf:Le==4?rV:oV}function Cr(Le){let ot=0,je,Xe;for(;;){if(O<bu){if(ft(),O<bu&&Le==0)return zf;if(O===0)break}if(O>=xr&&(p=(p<<b^c[v+(xr-1)]&255)&x,ot=h[p]&65535,f[v&a]=h[p],h[p]=v),R=C,A=D,C=xr-1,ot!==0&&R<L&&(v-ot&65535)<=r-bu&&(E!=2&&(C=Ho(ot)),C<=5&&(E==1||C==xr&&v-D>4096)&&(C=xr-1)),R>=xr&&C<=R){Xe=v+O-xr,je=Ct(v-1-A,R-xr),O-=R-1,R-=2;do++v<=Xe&&(p=(p<<b^c[v+(xr-1)]&255)&x,ot=h[p]&65535,f[v&a]=h[p],h[p]=v);while(--R!==0);if(S=0,C=xr-1,v++,je&&(Vi(!1),t.avail_out===0))return zf}else if(S!==0){if(je=Ct(0,c[v-1]&255),je&&Vi(!1),v++,O--,t.avail_out===0)return zf}else S=1,v++,O--}return S!==0&&(je=Ct(0,c[v-1]&255),S=0),Vi(Le==4),t.avail_out===0?Le==4?QD:zf:Le==4?rV:oV}function hs(Le){return Le.total_in=Le.total_out=0,Le.msg=null,e.pending=0,e.pending_out=0,n=sV,o=0,ce(),de(),0}e.deflateInit=function(Le,ot,je,Xe,ht,Gt){return Xe||(Xe=nq),ht||(ht=unt),Gt||(Gt=0),Le.msg=null,ot==-1&&(ot=6),ht<1||ht>lnt||Xe!=nq||je<9||je>15||ot<0||ot>9||Gt<0||Gt>2?-2:(Le.dstate=e,s=je,r=1<<s,a=r-1,m=ht+7,_=1<<m,x=_-1,b=Math.floor((m+xr-1)/xr),c=new Uint8Array(r*2),f=[],h=[],W=1<<ht+6,e.pending_buf=new Uint8Array(W*4),i=W*4,e.dist_buf=new Uint16Array(W),e.lc_buf=new Uint8Array(W),g=ot,E=Gt,hs(Le))},e.deflateEnd=function(){return n!=tq&&n!=sV&&n!=JD?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,h=null,f=null,c=null,e.dstate=null,n==sV?-3:0)},e.deflateParams=function(Le,ot,je){let Xe=0;return ot==-1&&(ot=6),ot<0||ot>9||je<0||je>2?-2:($d[g].func!=$d[ot].func&&Le.total_in!==0&&(Xe=Le.deflate(1)),g!=ot&&(g=ot,L=$d[g].max_lazy,w=$d[g].good_length,I=$d[g].nice_length,M=$d[g].max_chain),E=je,Xe)},e.deflateSetDictionary=function(Le,ot,je){let Xe=je,ht,Gt=0;if(!ot||n!=tq)return-2;if(Xe<xr)return 0;for(Xe>r-bu&&(Xe=r-bu,Gt=je-Xe),c.set(ot.subarray(Gt,Gt+Xe),0),v=Xe,T=Xe,p=c[0]&255,p=(p<<b^c[1]&255)&x,ht=0;ht<=Xe-xr;ht++)p=(p<<b^c[ht+(xr-1)]&255)&x,f[ht&a]=h[p],h[p]=ht;return 0},e.deflate=function(Le,ot){let je,Xe,ht,Gt,_n;if(ot>4||ot<0)return-2;if(!Le.next_out||!Le.next_in&&Le.avail_in!==0||n==JD&&ot!=4)return Le.msg=iV[4],-2;if(Le.avail_out===0)return Le.msg=iV[7],-5;if(t=Le,Gt=o,o=ot,n==tq&&(Xe=nq+(s-8<<4)<<8,ht=(g-1&255)>>1,ht>3&&(ht=3),Xe|=ht<<6,v!==0&&(Xe|=fnt),Xe+=31-Xe%31,n=sV,ke(Xe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&ot<=Gt&&ot!=4)return t.msg=iV[7],-5;if(n==JD&&t.avail_in!==0)return Le.msg=iV[7],-5;if(t.avail_in!==0||O!==0||ot!=0&&n!=JD){switch(_n=-1,$d[g].func){case mme:_n=mo(ot);break;case aV:_n=Ma(ot);break;case tb:_n=Cr(ot);break;default:}if((_n==QD||_n==rV)&&(n=JD),_n==zf||_n==QD)return t.avail_out===0&&(o=-1),0;if(_n==oV){if(ot==1)Yt();else if(Te(0,0,!1),ot==3)for(je=0;je<_;je++)h[je]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return ot!=4?0:1}}function pme(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}pme.prototype={deflateInit(e,t){let n=this;return n.dstate=new mnt,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function gme(e){let t=this,n=new pme,i=pnt(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let u,f,h=0,p=0,_=0,m=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(r)):m.push(r.subarray(0,n.next_out_index))),_+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=h&&(c(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(_),m.forEach(function(x){f.set(x,p),p+=x.length})):f=m[0]?new Uint8Array(m[0]):new Uint8Array,f}},t.flush=function(){let a,c,u=0,f=0,h=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&h.push(r.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(f),h.forEach(function(p){c.set(p,u),u+=p.length}),c}}function pnt(e){return e+5*(Math.floor(e/16383)+1)}var Tu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Fme=1440,gnt=0,_nt=4,ynt=9,xnt=5,bnt=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Tnt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Cnt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Ant=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],Ent=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Snt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Dy=15;function aq(){let e=this,t,n,i,o,r,s;function a(u,f,h,p,_,m,x,b,T,C,A){let S,v,D,O,R,M,L,g,E,w,I,N,B,H,V;w=0,R=h;do i[u[f+w]]++,w++,R--;while(R!==0);if(i[0]==h)return x[0]=-1,b[0]=0,0;for(g=b[0],M=1;M<=Dy&&i[M]===0;M++);for(L=M,g<M&&(g=M),R=Dy;R!==0&&i[R]===0;R--);for(D=R,g>R&&(g=R),b[0]=g,H=1<<M;M<R;M++,H<<=1)if((H-=i[M])<0)return-3;if((H-=i[R])<0)return-3;for(i[R]+=H,s[1]=M=0,w=1,B=2;--R!==0;)s[B]=M+=i[w],B++,w++;R=0,w=0;do(M=u[f+w])!==0&&(A[s[M]++]=R),w++;while(++R<h);for(h=s[D],s[0]=R=0,w=0,O=-1,N=-g,r[0]=0,I=0,V=0;L<=D;L++)for(S=i[L];S--!==0;){for(;L>N+g;){if(O++,N+=g,V=D-N,V=V>g?g:V,(v=1<<(M=L-N))>S+1&&(v-=S+1,B=L,M<V))for(;++M<V&&!((v<<=1)<=i[++B]);)v-=i[B];if(V=1<<M,C[0]+V>Fme)return-3;r[O]=I=C[0],C[0]+=V,O!==0?(s[O]=R,o[0]=M,o[1]=g,M=R>>>N-g,o[2]=I-r[O-1]-M,T.set(o,(r[O-1]+M)*3)):x[0]=I}for(o[1]=L-N,w>=h?o[0]=192:A[w]<p?(o[0]=A[w]<256?0:96,o[2]=A[w++]):(o[0]=m[A[w]-p]+16+64,o[2]=_[A[w++]-p]),v=1<<L-N,M=R>>>N;M<V;M+=v)T.set(o,(I+M)*3);for(M=1<<L-1;R&M;M>>>=1)R^=M;for(R^=M,E=(1<<N)-1;(R&E)!=s[O];)O--,N-=g,E=(1<<N)-1}return H!==0&&D!=1?-5:0}function c(u){let f;for(t||(t=[],n=[],i=new Int32Array(Dy+1),o=[],r=new Int32Array(Dy),s=new Int32Array(Dy+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<Dy+1;f++)i[f]=0;for(f=0;f<3;f++)o[f]=0;r.set(i.subarray(0,Dy),0),s.set(i.subarray(0,Dy+1),0)}e.inflate_trees_bits=function(u,f,h,p,_){let m;return c(19),t[0]=0,m=a(u,0,19,19,null,null,h,f,p,t,n),m==-3?_.msg="oversubscribed dynamic bit lengths tree":(m==-5||f[0]===0)&&(_.msg="incomplete dynamic bit lengths tree",m=-3),m},e.inflate_trees_dynamic=function(u,f,h,p,_,m,x,b,T){let C;return c(288),t[0]=0,C=a(h,0,u,257,Cnt,Ant,m,p,b,t,n),C!=0||p[0]===0?(C==-3?T.msg="oversubscribed literal/length tree":C!=-4&&(T.msg="incomplete literal/length tree",C=-3),C):(c(288),C=a(h,u,f,0,Ent,Snt,x,_,b,t,n),C!=0||_[0]===0&&u>257?(C==-3?T.msg="oversubscribed distance tree":C==-5?(T.msg="incomplete distance tree",C=-3):C!=-4&&(T.msg="empty distance tree with lengths",C=-3),C):0)}}aq.inflate_trees_fixed=function(e,t,n,i){return e[0]=ynt,t[0]=xnt,n[0]=bnt,i[0]=Tnt,0};var fV=0,_me=1,yme=2,xme=3,bme=4,Tme=5,Cme=6,oq=7,Ame=8,dV=9;function vnt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,u=0,f=0,h,p=0,_,m=0;function x(b,T,C,A,S,v,D,O){let R,M,L,g,E,w,I,N,B,H,V,G,k,W,Y,J;I=O.next_in_index,N=O.avail_in,E=D.bitb,w=D.bitk,B=D.write,H=B<D.read?D.read-B-1:D.end-B,V=Tu[b],G=Tu[T];do{for(;w<20;)N--,E|=(O.read_byte(I++)&255)<<w,w+=8;if(R=E&V,M=C,L=A,J=(L+R)*3,(g=M[J])===0){E>>=M[J+1],w-=M[J+1],D.win[B++]=M[J+2],H--;continue}do{if(E>>=M[J+1],w-=M[J+1],g&16){for(g&=15,k=M[J+2]+(E&Tu[g]),E>>=g,w-=g;w<15;)N--,E|=(O.read_byte(I++)&255)<<w,w+=8;R=E&G,M=S,L=v,J=(L+R)*3,g=M[J];do if(E>>=M[J+1],w-=M[J+1],g&16){for(g&=15;w<g;)N--,E|=(O.read_byte(I++)&255)<<w,w+=8;if(W=M[J+2]+(E&Tu[g]),E>>=g,w-=g,H-=k,B>=W)Y=B-W,B-Y>0&&2>B-Y?(D.win[B++]=D.win[Y++],D.win[B++]=D.win[Y++],k-=2):(D.win.set(D.win.subarray(Y,Y+2),B),B+=2,Y+=2,k-=2);else{Y=B-W;do Y+=D.end;while(Y<0);if(g=D.end-Y,k>g){if(k-=g,B-Y>0&&g>B-Y)do D.win[B++]=D.win[Y++];while(--g!==0);else D.win.set(D.win.subarray(Y,Y+g),B),B+=g,Y+=g,g=0;Y=0}}if(B-Y>0&&k>B-Y)do D.win[B++]=D.win[Y++];while(--k!==0);else D.win.set(D.win.subarray(Y,Y+k),B),B+=k,Y+=k,k=0;break}else if(!(g&64))R+=M[J+2],R+=E&Tu[g],J=(L+R)*3,g=M[J];else return O.msg="invalid distance code",k=O.avail_in-N,k=w>>3<k?w>>3:k,N+=k,I-=k,w-=k<<3,D.bitb=E,D.bitk=w,O.avail_in=N,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,-3;while(!0);break}if(g&64)return g&32?(k=O.avail_in-N,k=w>>3<k?w>>3:k,N+=k,I-=k,w-=k<<3,D.bitb=E,D.bitk=w,O.avail_in=N,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,1):(O.msg="invalid literal/length code",k=O.avail_in-N,k=w>>3<k?w>>3:k,N+=k,I-=k,w-=k<<3,D.bitb=E,D.bitk=w,O.avail_in=N,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,-3);if(R+=M[J+2],R+=E&Tu[g],J=(L+R)*3,(g=M[J])===0){E>>=M[J+1],w-=M[J+1],D.win[B++]=M[J+2],H--;break}}while(!0)}while(H>=258&&N>=10);return k=O.avail_in-N,k=w>>3<k?w>>3:k,N+=k,I-=k,w-=k<<3,D.bitb=E,D.bitk=w,O.avail_in=N,O.total_in+=I-O.next_in_index,O.next_in_index=I,D.write=B,0}e.init=function(b,T,C,A,S,v){t=fV,u=b,f=T,h=C,p=A,_=S,m=v,i=null},e.proc=function(b,T,C){let A,S,v,D=0,O=0,R=0,M,L,g,E;for(R=T.next_in_index,M=T.avail_in,D=b.bitb,O=b.bitk,L=b.write,g=L<b.read?b.read-L-1:b.end-L;;)switch(t){case fV:if(g>=258&&M>=10&&(b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,C=x(u,f,h,p,_,m,b,T),R=T.next_in_index,M=T.avail_in,D=b.bitb,O=b.bitk,L=b.write,g=L<b.read?b.read-L-1:b.end-L,C!=0)){t=C==1?oq:dV;break}r=u,i=h,o=p,t=_me;case _me:for(A=r;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}if(S=(o+(D&Tu[A]))*3,D>>>=i[S+1],O-=i[S+1],v=i[S],v===0){s=i[S+2],t=Cme;break}if(v&16){a=v&15,n=i[S+2],t=yme;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}if(v&32){t=oq;break}return t=dV,T.msg="invalid literal/length code",C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);case yme:for(A=a;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}n+=D&Tu[A],D>>=A,O-=A,r=f,i=_,o=m,t=xme;case xme:for(A=r;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}if(S=(o+(D&Tu[A]))*3,D>>=i[S+1],O-=i[S+1],v=i[S],v&16){a=v&15,c=i[S+2],t=bme;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}return t=dV,T.msg="invalid distance code",C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);case bme:for(A=a;O<A;){if(M!==0)C=0;else return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);M--,D|=(T.read_byte(R++)&255)<<O,O+=8}c+=D&Tu[A],D>>=A,O-=A,t=Tme;case Tme:for(E=L-c;E<0;)E+=b.end;for(;n!==0;){if(g===0&&(L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0&&(b.write=L,C=b.inflate_flush(T,C),L=b.write,g=L<b.read?b.read-L-1:b.end-L,L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0)))return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);b.win[L++]=b.win[E++],g--,E==b.end&&(E=0),n--}t=fV;break;case Cme:if(g===0&&(L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0&&(b.write=L,C=b.inflate_flush(T,C),L=b.write,g=L<b.read?b.read-L-1:b.end-L,L==b.end&&b.read!==0&&(L=0,g=L<b.read?b.read-L-1:b.end-L),g===0)))return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);C=0,b.win[L++]=s,g--,t=fV;break;case oq:if(O>7&&(O-=8,M++,R--),b.write=L,C=b.inflate_flush(T,C),L=b.write,g=L<b.read?b.read-L-1:b.end-L,b.read!=b.write)return b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);t=Ame;case Ame:return C=1,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);case dV:return C=-3,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C);default:return C=-2,b.bitb=D,b.bitk=O,T.avail_in=M,T.total_in+=R-T.next_in_index,T.next_in_index=R,b.write=L,b.inflate_flush(T,C)}},e.free=function(){}}var Eme=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rE=0,rq=1,Sme=2,vme=3,wme=4,Dme=5,hV=6,mV=7,Ime=8,nb=9;function wnt(e,t){let n=this,i=rE,o=0,r=0,s=0,a,c=[0],u=[0],f=new vnt,h=0,p=new Int32Array(Fme*3),_=0,m=new aq;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,b){b&&(b[0]=_),i==hV&&f.free(x),i=rE,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,b){let T,C,A;return C=x.next_out_index,A=n.read,T=(A<=n.write?n.write:n.end)-A,T>x.avail_out&&(T=x.avail_out),T!==0&&b==-5&&(b=0),x.avail_out-=T,x.total_out+=T,x.next_out.set(n.win.subarray(A,A+T),C),C+=T,A+=T,A==n.end&&(A=0,n.write==n.end&&(n.write=0),T=n.write-A,T>x.avail_out&&(T=x.avail_out),T!==0&&b==-5&&(b=0),x.avail_out-=T,x.total_out+=T,x.next_out.set(n.win.subarray(A,A+T),C),C+=T,A+=T),x.next_out_index=C,n.read=A,b},n.proc=function(x,b){let T,C,A,S,v,D,O,R;for(S=x.next_in_index,v=x.avail_in,C=n.bitb,A=n.bitk,D=n.write,O=D<n.read?n.read-D-1:n.end-D;;){let M,L,g,E,w,I,N,B;switch(i){case rE:for(;A<3;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}switch(T=C&7,h=T&1,T>>>1){case 0:C>>>=3,A-=3,T=A&7,C>>>=T,A-=T,i=rq;break;case 1:M=[],L=[],g=[[]],E=[[]],aq.inflate_trees_fixed(M,L,g,E),f.init(M[0],L[0],g[0],0,E[0],0),C>>>=3,A-=3,i=hV;break;case 2:C>>>=3,A-=3,i=vme;break;case 3:return C>>>=3,A-=3,i=nb,x.msg="invalid block type",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b)}break;case rq:for(;A<32;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}if((~C>>>16&65535)!=(C&65535))return i=nb,x.msg="invalid stored block lengths",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);o=C&65535,C=A=0,i=o!==0?Sme:h!==0?mV:rE;break;case Sme:if(v===0||O===0&&(D==n.end&&n.read!==0&&(D=0,O=D<n.read?n.read-D-1:n.end-D),O===0&&(n.write=D,b=n.inflate_flush(x,b),D=n.write,O=D<n.read?n.read-D-1:n.end-D,D==n.end&&n.read!==0&&(D=0,O=D<n.read?n.read-D-1:n.end-D),O===0)))return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);if(b=0,T=o,T>v&&(T=v),T>O&&(T=O),n.win.set(x.read_buf(S,T),D),S+=T,v-=T,D+=T,O-=T,(o-=T)!==0)break;i=h!==0?mV:rE;break;case vme:for(;A<14;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}if(r=T=C&16383,(T&31)>29||(T>>5&31)>29)return i=nb,x.msg="too many length or distance symbols",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);if(T=258+(T&31)+(T>>5&31),!a||a.length<T)a=[];else for(R=0;R<T;R++)a[R]=0;C>>>=14,A-=14,s=0,i=wme;case wme:for(;s<4+(r>>>10);){for(;A<3;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}a[Eme[s++]]=C&7,C>>>=3,A-=3}for(;s<19;)a[Eme[s++]]=0;if(c[0]=7,T=m.inflate_trees_bits(a,c,u,p,x),T!=0)return b=T,b==-3&&(a=null,i=nb),n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);s=0,i=Dme;case Dme:for(;T=r,!(s>=258+(T&31)+(T>>5&31));){let H,V;for(T=c[0];A<T;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}if(T=p[(u[0]+(C&Tu[T]))*3+1],V=p[(u[0]+(C&Tu[T]))*3+2],V<16)C>>>=T,A-=T,a[s++]=V;else{for(R=V==18?7:V-14,H=V==18?11:3;A<T+R;){if(v!==0)b=0;else return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);v--,C|=(x.read_byte(S++)&255)<<A,A+=8}if(C>>>=T,A-=T,H+=C&Tu[R],C>>>=R,A-=R,R=s,T=r,R+H>258+(T&31)+(T>>5&31)||V==16&&R<1)return a=null,i=nb,x.msg="invalid bit length repeat",b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);V=V==16?a[R-1]:0;do a[R++]=V;while(--H!==0);s=R}}if(u[0]=-1,w=[],I=[],N=[],B=[],w[0]=9,I[0]=6,T=r,T=m.inflate_trees_dynamic(257+(T&31),1+(T>>5&31),a,w,I,N,B,p,x),T!=0)return T==-3&&(a=null,i=nb),b=T,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);f.init(w[0],I[0],p,N[0],p,B[0]),i=hV;case hV:if(n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,(b=f.proc(n,x,b))!=1)return n.inflate_flush(x,b);if(b=0,f.free(x),S=x.next_in_index,v=x.avail_in,C=n.bitb,A=n.bitk,D=n.write,O=D<n.read?n.read-D-1:n.end-D,h===0){i=rE;break}i=mV;case mV:if(n.write=D,b=n.inflate_flush(x,b),D=n.write,O=D<n.read?n.read-D-1:n.end-D,n.read!=n.write)return n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);i=Ime;case Ime:return b=1,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);case nb:return b=-3,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b);default:return b=-2,n.bitb=C,n.bitk=A,x.avail_in=v,x.total_in+=S-x.next_in_index,x.next_in_index=S,n.write=D,n.inflate_flush(x,b)}}},n.free=function(x){n.reset(x,null),n.win=null,p=null},n.set_dictionary=function(x,b,T){n.win.set(x.subarray(b,b+T),0),n.read=n.write=T},n.sync_point=function(){return i==rq?1:0}}var Dnt=32,Int=8,Pnt=0,Pme=1,Rme=2,Ome=3,Mme=4,Lme=5,sq=6,eI=7,Nme=12,Iy=13,Rnt=[0,0,255,255];function Ont(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=eI,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new wnt(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==_nt?-5:0,o=-5;;)switch(s.mode){case Pnt:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=Int){s.mode=Iy,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Iy,n.msg="invalid win size",s.marker=5;break}s.mode=Pme;case Pme:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=Iy,n.msg="incorrect header check",s.marker=5;break}if(!(r&Dnt)){s.mode=eI;break}s.mode=Rme;case Rme:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=Ome;case Ome:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=Mme;case Mme:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=Lme;case Lme:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=sq,2);case sq:return s.mode=Iy,n.msg="need dictionary",s.marker=0,-2;case eI:if(o=s.blocks.proc(n,o),o==-3){s.mode=Iy,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=Nme;case Nme:return n.avail_in=0,1;case Iy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=sq)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=eI,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=Iy&&(c.mode=Iy,c.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=c.marker;i!==0&&r<4;)n.read_byte(o)==Rnt[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,c.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=eI,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function Bme(){}Bme.prototype={inflateInit(e){let t=this;return t.istate=new Ont,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};function kme(e){let t=this,n=new Bme,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=gnt,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let u=[],f,h,p=0,_=0,m=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),f=n.inflate(o),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(r)):u.push(r.subarray(0,n.next_out_index))),m+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(h=new Uint8Array(m),u.forEach(function(x){h.set(x,_),_+=x.length})):h=u[0]?new Uint8Array(u[0]):new Uint8Array,h}},t.flush=function(){n.inflateEnd()}}var sE="/",cq=new Date(2107,11,31),lq=new Date(1980,0,1),Si=void 0,Cu="undefined",sg="function";var tI=class{constructor(t){return class extends TransformStream{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var Mnt=64,Vme=2;try{typeof navigator!=Cu&&navigator.hardwareConcurrency&&(Vme=navigator.hardwareConcurrency)}catch{}var Lnt={chunkSize:512*1024,maxWorkers:Vme,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Si,CompressionStreamNative:typeof CompressionStream!=Cu&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Cu&&DecompressionStream},Ry=Object.assign({},Lnt);function nI(){return Ry}function pV(e){return Math.max(e.chunkSize,Mnt)}function aE(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:u,DecompressionStream:f,workerScripts:h}=e;if(Py("baseURL",t),Py("chunkSize",n),Py("maxWorkers",i),Py("terminateWorkerTimeout",o),Py("useCompressionStream",r),Py("useWebWorkers",s),a&&(Ry.CompressionStream=new tI(a)),c&&(Ry.DecompressionStream=new tI(c)),Py("CompressionStream",u),Py("DecompressionStream",f),h!==Si){let{deflate:p,inflate:_}=h;if((p||_)&&(Ry.workerScripts||(Ry.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");Ry.workerScripts.deflate=p}if(_){if(!Array.isArray(_))throw new Error("workerScripts.inflate must be an array");Ry.workerScripts.inflate=_}}}function Py(e,t){t!==Si&&(Ry[e]=t)}var Ume=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;Ume[e]=t}var ag=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^Ume[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var iI=class extends TransformStream{constructor(){let t,n=new ag;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};function cE(e){if(typeof TextEncoder==Cu){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var qc={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=qc.getPartial(n);return i===32?e.concat(t):qc._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+qc.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=qc.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=qc.getPartial(o);return i.push(qc.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},oI={bytes:{fromBits(e){let n=qc.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(qc.partial(8*(n&3),i)),t}}},zme={};zme.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=oI.utf8String.toBits(e));let n=t._buffer=qc.concat(t._buffer,e),i=t._length,o=t._length=i+qc.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=qc.concat(t,[qc.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var uq={};uq.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[f]=h,i[h]=f,u=o[c=o[a=o[f]]];let p=u*16843009^c*65537^a*257^f*16843008,_=o[h]*257^h*16843008;for(let m=0;m<4;m++)e[m][f]=_=_<<24^_>>>8,t[m][h]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],u=r[3],f=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],_=e[2]^n[2],m=e[t?1:3]^n[3],x=4,b,T,C;for(let A=0;A<i;A++)b=s[h>>>24]^a[p>>16&255]^c[_>>8&255]^u[m&255]^n[x],T=s[p>>>24]^a[_>>16&255]^c[m>>8&255]^u[h&255]^n[x+1],C=s[_>>>24]^a[m>>16&255]^c[h>>8&255]^u[p&255]^n[x+2],m=s[m>>>24]^a[h>>16&255]^c[p>>8&255]^u[_&255]^n[x+3],x+=4,h=b,p=T,_=C;for(let A=0;A<4;A++)o[t?3&-A:A]=f[h>>>24]<<24^f[p>>16&255]<<16^f[_>>8&255]<<8^f[m&255]^n[x++],b=h,h=p,p=_,_=m,m=b;return o}};var Hme={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},fq={};fq.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=qc.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return qc.clamp(t,o)}};var Oy={importKey(e){return new Oy.hmacSha1(oI.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,u,f=new ArrayBuffer(o),h=new DataView(f),p=0,_=qc;for(t=oI.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(_.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)h.setInt32(p,r[a]),p+=4}return f.slice(0,i/8)}};Oy.hmacSha1=class{constructor(e){let t=this,n=t._hash=zme.sha1,i=[[],[]];t._baseHash=[new n,new n];let o=t._baseHash[0].blockSize/32;e.length>o&&(e=new n().update(e).finalize());for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var Nnt=typeof crypto!=Cu&&typeof crypto.getRandomValues==sg,My="Invalid password",ib="Invalid signature",cg="zipjs-abort-check-password";function gV(e){return Nnt?crypto.getRandomValues(e):Hme.getRandomValues(e)}var lE=16,Fnt="raw",jme={name:"PBKDF2"},Bnt={name:"HMAC"},knt="SHA-1",Vnt=Object.assign({hash:Bnt},jme),dq=Object.assign({iterations:1e3,hash:{name:knt}},jme),Unt=["deriveBits"],sI=[8,12,16],rI=[16,24,32],Ly=10,znt=[0,0,0,0],xV=typeof crypto!=Cu,lI=xV&&crypto.subtle,qme=xV&&typeof lI!=Cu,Am=oI.bytes,Hnt=uq.aes,Gnt=fq.ctrGladman,Wnt=Oy.hmacSha1,Gme=xV&&qme&&typeof lI.importKey==sg,Wme=xV&&qme&&typeof lI.deriveBits==sg,_V=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:Kme(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:h,ready:p}=c;u?(await jnt(c,f,u,Hf(s,0,sI[f]+2)),s=Hf(s,sI[f]+2),r?a.error(new Error(cg)):h()):await p;let _=new Uint8Array(s.length-Ly-(s.length-Ly)%lE);a.enqueue(Yme(c,s,_,0,Ly,!0))},async flush(s){let{signed:a,ctr:c,hmac:u,pending:f,ready:h}=this;if(u&&c){await h;let p=Hf(f,0,f.length-Ly),_=Hf(f,f.length-Ly),m=new Uint8Array;if(p.length){let x=cI(Am,p);u.update(x);let b=c.update(x);m=aI(Am,b)}if(a){let x=Hf(aI(Am,u.digest()),0,Ly);for(let b=0;b<Ly;b++)if(x[b]!=_[b])throw new Error(ib)}s.enqueue(m)}}})}},yV=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:Kme(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:u,resolveReady:f,ready:h}=a,p=new Uint8Array;c?(p=await qnt(a,u,c),f()):await h;let _=new Uint8Array(p.length+r.length-r.length%lE);_.set(p,0),s.enqueue(Yme(a,r,_,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(c.length){let h=s.update(cI(Am,c));a.update(h),f=aI(Am,h)}o.signature=aI(Am,a.digest()).slice(0,Ly),r.enqueue(hq(f,o.signature))}}}),o=this}};function Yme(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,u=t.length-o;c.length&&(t=hq(c,t),n=Knt(n,u-u%lE));let f;for(f=0;f<=u-lE;f+=lE){let h=cI(Am,Hf(t,f,f+lE));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(aI(Am,p),f+i)}return e.pending=Hf(t,f),n}async function jnt(e,t,n,i){let o=await Xme(e,t,n,Hf(i,0,sI[t])),r=Hf(i,sI[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(My)}async function qnt(e,t,n){let i=gV(new Uint8Array(sI[t])),o=await Xme(e,t,n,i);return hq(i,o)}async function Xme(e,t,n,i){e.password=null;let o=await Ynt(Fnt,n,Vnt,!1,Unt),r=await Xnt(Object.assign({salt:i},dq),o,8*(rI[t]*2+2)),s=new Uint8Array(r),a=cI(Am,Hf(s,0,rI[t])),c=cI(Am,Hf(s,rI[t],rI[t]*2)),u=Hf(s,rI[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new Gnt(new Hnt(a),Array.from(znt)),hmac:new Wnt(c)}),u}async function Ynt(e,t,n,i,o){if(Gme)try{return await lI.importKey(e,t,n,i,o)}catch{return Gme=!1,Oy.importKey(t)}else return Oy.importKey(t)}async function Xnt(e,t,n){if(Wme)try{return await lI.deriveBits(e,t,n)}catch{return Wme=!1,Oy.pbkdf2(t,e.salt,dq.iterations,n)}else return Oy.pbkdf2(t,e.salt,dq.iterations,n)}function Kme(e,t){return t===Si?cE(e):t}function hq(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function Knt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Hf(e,t,n){return e.subarray(t,n)}function aI(e,t){return e.fromBits(t)}function cI(e,t){return e.toBits(t)}var uE=12,bV=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Jme(this,t)},transform(o,r){let s=this;if(s.password){let a=Zme(s,o.subarray(0,uE));if(s.password=null,a[uE-1]!=s.passwordVerification)throw new Error(My);o=o.subarray(uE)}i?r.error(new Error(cg)):r.enqueue(Zme(s,o))}})}},TV=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Jme(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=gV(new Uint8Array(uE));c[uE-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set($me(r,c),0),a=uE}else s=new Uint8Array(i.length),a=0;s.set($me(r,i),a),o.enqueue(s)}})}};function Zme(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=epe(e)^t[i],mq(e,n[i]);return n}function $me(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=epe(e)^t[i],mq(e,t[i]);return n}function Jme(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new ag(n[0]),crcKey2:new ag(n[2])});for(let i=0;i<t.length;i++)mq(e,t.charCodeAt(i))}function mq(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Qme(Math.imul(Qme(i+tpe(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function epe(e){let t=e.keys[2]|2;return tpe(Math.imul(t,t^1)>>>8)}function tpe(e){return e&255}function Qme(e){return e&4294967295}var npe="deflate-raw",CV=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:u,level:f}=t,h=this,p,_,m=ipe(super.readable);(!s||c)&&u&&(p=new iI,m=Em(m,p)),r&&(m=rpe(m,a,{level:f,chunkSize:n},o,i)),s&&(c?m=Em(m,new TV(t)):(_=new yV(t),m=Em(m,_))),ope(h,m,()=>{let x;s&&!c&&(x=_.signature),(!s||c)&&u&&(x=new DataView(p.value.buffer).getUint32(0)),h.signature=x})}},AV=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:u,useCompressionStream:f}=t,h,p,_=ipe(super.readable);s&&(r?_=Em(_,new bV(t)):(p=new _V(t),_=Em(_,p))),u&&(_=rpe(_,f,{chunkSize:n},o,i)),(!s||r)&&a&&(h=new iI,_=Em(_,h)),ope(this,_,()=>{if((!s||r)&&a){let m=new DataView(h.value.buffer);if(c!=m.getUint32(0,!1))throw new Error(ib)}})}};function ipe(e){return Em(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function ope(e,t,n){t=Em(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function rpe(e,t,n,i,o){try{let r=t&&i?i:o;e=Em(e,new r(npe,n))}catch{if(t)try{e=Em(e,new o(npe,n))}catch{return e}else return e}return e}function Em(e,t){return e.pipeThrough(t)}var spe="message",ape="start",cpe="pull",pq="data",lpe="ack",gq="close",vV="deflate",wV="inflate";var EV=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(vV)?r=CV:o.startsWith(wV)&&(r=AV);let s=0,a=0,c=new r(t,n),u=super.readable,f=new TransformStream({transform(p,_){p&&p.length&&(a+=p.length,_.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),h=new TransformStream({transform(p,_){p&&p.length&&(s+=p.length,_.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(f).pipeThrough(c).pipeThrough(h)}})}},SV=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var dpe=typeof Worker!=Cu;var fE=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:u},f){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new SV(r.chunkSize)).pipeThrough(new yq(n,s),{signal:h}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:_,busy:m}=t;_?(m?t.resolveTerminated=p:(_.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,f(t)}}),(a&&dpe?Znt:hpe)(t,r)}},yq=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await _q(n,o)},async transform(a,c){s+=a.length,i&&await _q(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await _q(r,s)}})}};async function _q(e,...t){try{await e(...t)}catch{}}function hpe(e,t){return{run:()=>$nt(e,t)}}function Znt(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=eit(e.scripts[0],n,e)}catch{return dpe=!1,hpe(e,t)}Object.assign(e,{worker:o,interface:{run:()=>Qnt(e,{chunkSize:i})}})}return e.interface}async function $nt({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new EV(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}finally{i()}}async function Qnt(e,t){let n,i,o=new Promise((p,_)=>{n=p,i=_});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:u}=Jnt(e.writable),f=DV({type:ape,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);f||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let h=await o;return f||await c.getWriter().close(),await u,h}function Jnt(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var upe=!0,fpe=!0;function eit(e,t,n){let i={type:"module"},o,r;typeof e==sg&&(e=e());try{o=new URL(e,t)}catch{o=e}if(upe)try{r=new Worker(o)}catch{upe=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(spe,s=>tit(s,n)),r}function DV(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,c.push(e.value)),o&&fpe?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{fpe=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function tit({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:h}=t;try{if(s){let{message:_,stack:m,code:x,name:b}=s,T=new Error(_);Object.assign(T,{stack:m,code:x,name:b}),p(T)}else{if(n==cpe){let{value:_,done:m}=await a.read();DV({type:pq,value:_,done:m,messageId:o},t)}n==pq&&(await c.ready,await c.write(new Uint8Array(i)),DV({type:lpe,messageId:o},t)),n==gq&&p(null,r)}}catch(_){DV({type:gq,messageId:o},t),p(_)}function p(_,m){_?f(_):u(m),c&&c.releaseLock(),h()}}var ob=[],xq=[];var mpe=0;async function IV(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:c,signed:u,encrypted:f}=n,{workerScripts:h,maxWorkers:p}=i;t.transferStreams=o||o===Si;let _=!c&&!u&&!f&&!t.transferStreams;return t.useWebWorkers=!_&&(r||r===Si&&i.useWebWorkers),t.scripts=t.useWebWorkers&&h?h[a]:[],n.useCompressionStream=s||s===Si&&i.useCompressionStream,(await m()).run();async function m(){let b=ob.find(T=>!T.busy);if(b)return ppe(b),new fE(b,e,t,x);if(ob.length<p){let T={indexWorker:mpe};return mpe++,ob.push(T),new fE(T,e,t,x)}else return new Promise(T=>xq.push({resolve:T,stream:e,workerOptions:t}))}function x(b){if(xq.length){let[{resolve:T,stream:C,workerOptions:A}]=xq.splice(0,1);T(new fE(b,C,A,x))}else b.worker?(ppe(b),nit(b,t)):ob=ob.filter(T=>T!=b)}}function nit(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{ob=ob.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function ppe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var iit="Writer iterator completed too soon",oit="text/plain";var rit="Content-Type";var sit=64*1024,Cq="writable",dE=class{constructor(){this.size=0}init(){this.initialized=!0}},PV=class extends dE{get readable(){let t=this,{chunkSize:n=sit}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this;o.enqueue(await Da(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},bq=class extends dE{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,Cq,{get(){return n}})}writeUint8Array(){}};var RV=class extends bq{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length>2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},lg=class extends PV{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return s.byteLength>n&&(s=s.slice(t,o)),new Uint8Array(s)}},uI=class extends dE{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([rit,t]),Object.defineProperty(n,Cq,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},OV=class extends lg{constructor(t){super(new Blob([t],{type:oit}))}},MV=class extends uI{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var Tq=class extends PV{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;c>=r[a].size;)c-=r[a].size,a++;let u=r[a],f=u.size;if(c+n<=f)s=await Da(u,c,n);else{let h=f-c;s=new Uint8Array(n),s.set(await Da(u,c,h)),s.set(await o.readUint8Array(t+h,n-h,i),h)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},LV=class extends dE{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(f){let{availableSize:h}=i;if(s)f.length>=h?(await c(f.slice(0,h)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.slice(h))):await c(f);else{let{value:p,done:_}=await t.next();if(_&&!p)throw new Error(iit);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await vm(o),r=p.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,Cq,{get(){return a}});async function c(f){let h=f.length;h&&(await s.ready,await s.write(f),o.size+=h,i.size+=h,i.availableSize-=h)}async function u(){r.size=o.size,await s.close()}}};async function vm(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function NV(e){return Array.isArray(e)&&(e=new Tq(e)),e instanceof ReadableStream&&(e={readable:e}),e}function FV(e){e.writable===Si&&typeof e.next==sg&&(e=new LV(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Si&&(t.size=0),e instanceof LV||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Da(e,t,n,i){return e.readUint8Array(t,n,i)}var gpe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),ait=gpe.length==256;function _pe(e){if(ait){let t="";for(let n=0;n<e.length;n++)t+=gpe[e[n]];return t}else return new TextDecoder().decode(e)}function fI(e,t){return t&&t.trim().toLowerCase()=="cp437"?_pe(e):new TextDecoder(t).decode(e)}var Aq="filename",Eq="rawFilename",Sq="comment",vq="rawComment",wq="uncompressedSize",Dq="compressedSize",Iq="offset",BV="diskNumberStart",hE="lastModDate",kV="rawLastModDate",dI="lastAccessDate",ype="rawLastAccessDate",hI="creationDate",xpe="rawCreationDate",Pq="internalFileAttribute",Rq="externalFileAttribute",Oq="msDosCompatible",VV="zip64",Mq="encrypted",Lq="version",Nq="versionMadeBy",Fq="zipCrypto",cit=[Aq,Eq,Dq,wq,hE,kV,Sq,vq,dI,hI,Iq,BV,BV,Pq,Rq,Oq,VV,Mq,Lq,Nq,Fq,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],Ny=class{constructor(t){cit.forEach(n=>this[n]=t[n])}};var Bq="File format is not recognized",dit="End of central directory not found",hit="End of Zip64 central directory locator not found",mit="Central directory header not found",pit="Local file header not found",git="Zip64 extra field not found",_it="File contains encrypted entry",yit="Encryption method not supported",bpe="Compression method not supported",Tpe="Split zip file",Cpe="utf-8",Ape="cp437",xit=[[wq,4294967295],[Dq,4294967295],[Iq,4294967295],[BV,65535]],bit={[65535]:{getValue:cs,bytes:4},[4294967295]:{getValue:UV,bytes:8}},YV=class{constructor(t,n={}){Object.assign(this,{reader:NV(t),options:n,config:nI()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await vm(i),(i.size===Si||!i.readUint8Array)&&(i=new lg(await new Response(i.readable).blob()),await vm(i)),i.size<22)throw new Error(Bq);i.chunkSize=pV(o);let r=await Sit(i,101010256,i.size,22,65535*16);if(!r){let L=await Da(i,0,4),g=ua(L);throw cs(g)==134695760?new Error(Tpe):new Error(dit)}let s=ua(r),a=cs(s,12),c=cs(s,16),u=r.offset,f=la(s,20),h=u+22+f,p=la(s,4),_=i.lastDiskNumber||0,m=la(s,6),x=la(s,8),b=0,T=0;if(c==4294967295||a==4294967295||x==65535||m==65535){let L=await Da(i,r.offset-20,20),g=ua(L);if(cs(g,0)==117853008){c=UV(g,8);let E=await Da(i,c,56,-1),w=ua(E),I=r.offset-20-56;if(cs(w,0)!=101075792&&c!=I){let N=c;c=I,b=c-N,E=await Da(i,c,56,-1),w=ua(E)}if(cs(w,0)!=101075792)throw new Error(hit);p==65535&&(p=cs(w,16)),m==65535&&(m=cs(w,20)),x==65535&&(x=UV(w,32)),a==4294967295&&(a=UV(w,40)),c-=a}}if(c>=i.size&&(b=i.size-c-a-22,c=i.size-a-22),_!=p)throw new Error(Tpe);if(c<0)throw new Error(Bq);let C=0,A=await Da(i,c,a,m),S=ua(A);if(a){let L=r.offset-a;if(cs(S,C)!=33639248&&c!=L){let g=c;c=L,b+=c-g,A=await Da(i,c,a,m),S=ua(A)}}let v=r.offset-c-(i.lastDiskOffset||0);if(a!=v&&v>=0&&(a=v,A=await Da(i,c,a,m),S=ua(A)),c<0||c>=i.size)throw new Error(Bq);let D=Yc(n,t,"filenameEncoding"),O=Yc(n,t,"commentEncoding");for(let L=0;L<x;L++){let g=new Vq(i,o,n.options);if(cs(S,C)!=33639248)throw new Error(mit);Spe(g,S,C+6);let E=!!g.bitFlag.languageEncodingFlag,w=C+46,I=w+g.filenameLength,N=I+g.extraFieldLength,B=la(S,C+4),H=(B&0)==0,V=A.subarray(w,I),G=la(S,C+32),k=N+G,W=A.subarray(N,k),Y=E,J=E,j=H&&(mE(S,C+38)&16)==16,K=cs(S,C+42)+b;Object.assign(g,{versionMadeBy:B,msDosCompatible:H,compressedSize:0,uncompressedSize:0,commentLength:G,directory:j,offset:K,diskNumberStart:la(S,C+34),internalFileAttribute:la(S,C+36),externalFileAttribute:cs(S,C+38),rawFilename:V,filenameUTF8:Y,commentUTF8:J,rawExtraField:A.subarray(I,N)});let Q=Yc(n,t,"decodeText")||fI,de=Y?Cpe:D||Ape,ye=J?Cpe:O||Ape,ce=Q(V,de);ce===Si&&(ce=fI(V,de));let ge=Q(W,ye);ge===Si&&(ge=fI(W,ye)),Object.assign(g,{rawComment:W,filename:ce,comment:ge,directory:j||ce.endsWith(sE)}),T=Math.max(K,T),await vpe(g,g,S,C+6),g.zipCrypto=g.encrypted&&!g.extraFieldAES;let xe=new Ny(g);xe.getData=(Ae,ke)=>g.getData(Ae,xe,ke),C=k;let{onprogress:De}=t;if(De)try{await De(L+1,x,new Ny(g))}catch{}yield xe}let R=Yc(n,t,"extractPrependedData"),M=Yc(n,t,"extractAppendedData");return R&&(n.prependedData=T>0?await Da(i,0,T):new Uint8Array),n.comment=f?await Da(i,u+22,f):new Uint8Array,M&&(n.appendedData=h<i.size?await Da(i,h,i.size-h):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var Vq=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:c,compressionMethod:u,config:f,bitFlag:h,signature:p,rawLastModDate:_,uncompressedSize:m,compressedSize:x}=o,b=n.localDirectory={},T=await Da(r,s,30,a),C=ua(T),A=Yc(o,i,"password"),S=Yc(o,i,"rawPassword"),v=Yc(o,i,"passThrough");if(A=A&&A.length&&A,S=S&&S.length&&S,c&&c.originalCompressionMethod!=99)throw new Error(bpe);if(u!=0&&u!=8&&!v)throw new Error(bpe);if(cs(C,0)!=67324752)throw new Error(pit);Spe(b,C,4),b.rawExtraField=b.extraFieldLength?await Da(r,s+30+b.filenameLength,b.extraFieldLength,a):new Uint8Array,await vpe(o,b,C,4,!0),Object.assign(n,{lastAccessDate:b.lastAccessDate,creationDate:b.creationDate});let D=o.encrypted&&b.encrypted&&!v,O=D&&!c;if(v||(n.zipCrypto=O),D){if(!O&&c.strength===Si)throw new Error(yit);if(!A&&!S)throw new Error(_it)}let R=s+30+b.filenameLength+b.extraFieldLength,M=x,L=r.readable;Object.assign(L,{diskNumberStart:a,offset:R,size:M});let g=Yc(o,i,"signal"),E=Yc(o,i,"checkPasswordOnly");E&&(t=new WritableStream),t=FV(t),await vm(t,v?x:m);let{writable:w}=t,{onstart:I,onprogress:N,onend:B}=i,H={options:{codecType:wV,password:A,rawPassword:S,zipCrypto:O,encryptionStrength:c&&c.strength,signed:Yc(o,i,"checkSignature")&&!v,passwordVerification:O&&(h.dataDescriptor?_>>>8&255:p>>>24&255),signature:p,compressed:u!=0&&!v,encrypted:o.encrypted&&!v,useWebWorkers:Yc(o,i,"useWebWorkers"),useCompressionStream:Yc(o,i,"useCompressionStream"),transferStreams:Yc(o,i,"transferStreams"),checkPasswordOnly:E},config:f,streamOptions:{signal:g,size:M,onstart:I,onprogress:N,onend:B}},V=0;try{({outputSize:V}=await IV({readable:L,writable:w},H))}catch(G){if(!E||G.message!=cg)throw G}finally{let G=Yc(o,i,"preventClose");w.size+=V,!G&&!w.locked&&await w.getWriter().close()}return E?Si:t.getData?t.getData():w}};function Spe(e,t,n){let i=e.rawBitFlag=la(t,n+2),o=(i&1)==1,r=cs(t,n+6);Object.assign(e,{encrypted:o,version:la(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:vit(r),filenameLength:la(t,n+22),extraFieldLength:la(t,n+24)})}async function vpe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=ua(new Uint8Array(r)),c=0;try{for(;c<r.length;){let T=la(a,c),C=la(a,c+2);s.set(T,{type:T,data:r.slice(c+4,c+4+C)}),c+=4+C}}catch{}let u=la(n,i+4);Object.assign(t,{signature:cs(n,i+10),uncompressedSize:cs(n,i+18),compressedSize:cs(n,i+14)});let f=s.get(1);f&&(Tit(f,t),t.extraFieldZip64=f);let h=s.get(28789);h&&(await Epe(h,Aq,Eq,t,e),t.extraFieldUnicodePath=h);let p=s.get(25461);p&&(await Epe(p,Sq,vq,t,e),t.extraFieldUnicodeComment=p);let _=s.get(39169);_?(Cit(_,t,u),t.extraFieldAES=_):t.compressionMethod=u;let m=s.get(10);m&&(Ait(m,t),t.extraFieldNTFS=m);let x=s.get(21589);x&&(Eit(x,t,o),t.extraFieldExtendedTimestamp=x);let b=s.get(6534);b&&(t.extraFieldUSDZ=b)}function Tit(e,t){t.zip64=!0;let n=ua(e.data),i=xit.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[s,a]=i[o];if(t[s]==a){let c=bit[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(git)}}async function Epe(e,t,n,i,o){let r=ua(e.data),s=new ag;s.append(o[n]);let a=ua(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=cs(r,1);Object.assign(e,{version:mE(r,0),[t]:fI(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==cs(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function Cit(e,t,n){let i=ua(e.data),o=mE(i,4);Object.assign(e,{vendorVersion:mE(i,0),vendorId:mE(i,2),strength:o,originalCompressionMethod:n,compressionMethod:la(i,5)}),t.compressionMethod=e.compressionMethod}function Ait(e,t){let n=ua(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=la(n,i),s=la(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=ua(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=kq(s),f=kq(a),h=kq(c),p={lastModDate:u,lastAccessDate:f,creationDate:h};Object.assign(e,p),Object.assign(t,p)}}catch{}}function Eit(e,t,n){let i=ua(e.data),o=mE(i,0),r=[],s=[];n?((o&1)==1&&(r.push(hE),s.push(kV)),(o&2)==2&&(r.push(dI),s.push(ype)),(o&4)==4&&(r.push(hI),s.push(xpe))):e.data.length>=5&&(r.push(hE),s.push(kV));let a=1;r.forEach((c,u)=>{if(e.data.length>=a+4){let f=cs(i,a);t[c]=e[c]=new Date(f*1e3);let h=s[u];e[h]=f}a+=4})}async function Sit(e,t,n,i,o){let r=new Uint8Array(4),s=ua(r);wit(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(u){let f=n-u,h=await Da(e,f,u);for(let p=h.length-i;p>=0;p--)if(h[p]==r[0]&&h[p+1]==r[1]&&h[p+2]==r[2]&&h[p+3]==r[3])return{offset:f+p,buffer:h.slice(p,p+i).buffer}}}function Yc(e,t,n){return t[n]===Si?e.options[n]:t[n]}function vit(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function kq(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function mE(e,t){return e.getUint8(t)}function la(e,t){return e.getUint16(t,!0)}function cs(e,t){return e.getUint32(t,!0)}function UV(e,t){return Number(e.getBigUint64(t,!0))}function wit(e,t,n){e.setUint32(t,n,!0)}function ua(e){return new DataView(e.buffer)}var Rit="File already exists",Oit="Zip file comment exceeds 64KB",Mit="File entry comment exceeds 64KB",Lit="File entry name exceeds 64KB",Ipe="Version exceeds 65535",Nit="The strength must equal 1, 2, or 3",Fit="Extra field type exceeds 65535",Bit="Extra field data exceeds 64KB",Jq="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",kit="Undefined uncompressed size",Ppe=new Uint8Array([7,0,2,0,65,69,3,0,0]),$q=0,Rpe=[],ZV=class{constructor(t,n={}){t=FV(t);let i=t.availableSize!==Si&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Si&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:nI(),files:new Map,filenames:new Set,offset:n.offset===Si?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;$q<s.maxWorkers?$q++:await new Promise(c=>Rpe.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(Rit);return o.filenames.add(t),a=Vit(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=Rpe.shift();c?c():$q--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await Xit(this,t,n),lo(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function Vit(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(sE)?t+=sE:i.directory=t.endsWith(sE);let o=lo(e,i,"encodeText",cE),r=o(t);if(r===Si&&(r=cE(t)),Wi(r)>65535)throw new Error(Lit);let s=i.comment||"",a=o(s);if(a===Si&&(a=cE(s)),Wi(a)>65535)throw new Error(Mit);let c=lo(e,i,Lq,20);if(c>65535)throw new Error(Ipe);let u=lo(e,i,Nq,20);if(u>65535)throw new Error(Ipe);let f=lo(e,i,hE,new Date),h=lo(e,i,dI),p=lo(e,i,hI),_=lo(e,i,Oq,!0),m=lo(e,i,Pq,0),x=lo(e,i,Rq,0),b=lo(e,i,"passThrough"),T,C;b||(T=lo(e,i,"password"),C=lo(e,i,"rawPassword"));let A=lo(e,i,"encryptionStrength",3),S=lo(e,i,Fq),v=lo(e,i,"extendedTimestamp",!0),D=lo(e,i,"keepOrder",!0),O=lo(e,i,"level"),R=lo(e,i,"useWebWorkers"),M=lo(e,i,"bufferedWrite"),L=lo(e,i,"dataDescriptorSignature",!1),g=lo(e,i,"signal"),E=lo(e,i,"useUnicodeFileNames",!0),w=lo(e,i,"useCompressionStream"),I=lo(e,i,"compressionMethod"),N=lo(e,i,"dataDescriptor",!0),B=lo(e,i,VV);if(!S&&(T!==Si||C!==Si)&&!(A>=1&&A<=3))throw new Error(Nit);let H=new Uint8Array,{extraField:V}=i;if(V){let St=0,mt=0;V.forEach(Be=>St+=4+Wi(Be)),H=new Uint8Array(St),V.forEach((Be,Yt)=>{if(Yt>65535)throw new Error(Fit);if(Wi(Be)>65535)throw new Error(Bit);Es(H,new Uint16Array([Yt]),mt),Es(H,new Uint16Array([Wi(Be)]),mt+2),Es(H,Be,mt+4),mt+=4+Wi(Be)})}let G=0,k=0,W=0;if(b&&({uncompressedSize:W}=i,W===Si))throw new Error(kit);let Y=B===!0;n&&(n=NV(n),await vm(n),b?G=Ope(W):n.size===Si?(N=!0,(B||B===Si)&&(B=!0,W=G=4294967296)):(W=n.size,G=Ope(W)));let{diskOffset:J,diskNumber:j,maxSize:K}=e.writer,Q=Y||W>4294967295,de=Y||G>4294967295,ye=Y||e.offset+e.pendingEntriesSize-J>4294967295,ge=lo(e,i,"supportZip64SplitFile",!0)&&Y||j+Math.ceil(e.pendingEntriesSize/K)>65535;if(ye||Q||de||ge){if(B===!1||!D)throw new Error(Jq);B=!0}B=B||!1;let xe=lo(e,i,Mq),{signature:De}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:c,versionMadeBy:u,lastModDate:f,lastAccessDate:h,creationDate:p,rawExtraField:H,zip64:B,zip64UncompressedSize:Q,zip64CompressedSize:de,zip64Offset:ye,zip64DiskNumberStart:ge,password:T,rawPassword:C,level:!w&&e.config.CompressionStream===Si&&e.config.CompressionStreamNative===Si?0:O,useWebWorkers:R,encryptionStrength:A,extendedTimestamp:v,zipCrypto:S,bufferedWrite:M,keepOrder:D,useUnicodeFileNames:E,dataDescriptor:N,dataDescriptorSignature:L,signal:g,msDosCompatible:_,internalFileAttribute:m,externalFileAttribute:x,useCompressionStream:w,passThrough:b,encrypted:!!(T&&Wi(T)||C&&Wi(C))||b&&xe,signature:De,compressionMethod:I});let Ae=Hit(i),ke=Wit(i),ze=Wi(Ae.localHeaderArray,ke.dataDescriptorArray);k=ze+G,e.options.usdz&&(k+=k+64),e.pendingEntriesSize+=k;let et;try{et=await Uit(e,t,n,{headerInfo:Ae,dataDescriptorInfo:ke,metadataSize:ze},i)}finally{e.pendingEntriesSize-=k}return Object.assign(et,{name:t,comment:s,extraField:V}),new Ny(et)}async function Uit(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:u}=o,{headerInfo:f}=i,{usdz:h}=e.options,p=Array.from(r.values()).pop(),_={},m,x,b,T,C,A,S;r.set(t,_);try{let R;a&&(R=p&&p.lock,v()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!h?(A=new TransformStream,S=new Response(A.readable).blob(),A.writable.size=0,m=!0,e.bufferedWrites++,await vm(s)):(A=s,await D()),await vm(A);let{writable:M}=s,{diskOffset:L}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let E=new Uint8Array(4),w=Ia(E);Gi(w,0,134695760),await wm(M,E),e.offset+=4}h&&Git(i,e.offset-L),m||(await R,await O(M));let{diskNumber:g}=s;if(C=!0,_.diskNumberStart=g,_=await zit(n,A,_,i,e.config,o),C=!1,r.set(t,_),_.filename=t,m){await A.writable.getWriter().close();let E=await S;await R,await D(),T=!0,c||(E=await qit(_,E,M,o)),await O(M),_.diskNumberStart=s.diskNumber,L=s.diskOffset,await E.stream().pipeTo(M,{preventClose:!0,preventAbort:!0,signal:u}),M.size+=E.size,T=!1}if(_.offset=e.offset-L,_.zip64)Yit(_,o);else if(_.offset>4294967295)throw new Error(Jq);return e.offset+=_.size,_}catch(R){if(m&&T||!m&&C){if(e.hasCorruptedEntries=!0,R)try{R.corruptedEntry=!0}catch{}m?e.offset+=A.writable.size:e.offset=A.writable.size}throw r.delete(t),R}finally{m&&e.bufferedWrites--,b&&b(),x&&x()}function v(){_.lock=new Promise(R=>b=R)}async function D(){e.writerLocked=!0;let{lockWriter:R}=e;e.lockWriter=new Promise(M=>x=()=>{e.writerLocked=!1,M()}),await R}async function O(R){Wi(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await wm(R,new Uint8Array))}}async function zit(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=o,{localHeaderArray:f,headerArray:h,lastModDate:p,rawLastModDate:_,encrypted:m,compressed:x,version:b,compressionMethod:T,rawExtraFieldExtendedTimestamp:C,extraFieldExtendedTimestampFlag:A,rawExtraFieldNTFS:S,rawExtraFieldAES:v}=a,{dataDescriptorArray:D}=c,{rawFilename:O,lastAccessDate:R,creationDate:M,password:L,rawPassword:g,level:E,zip64:w,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:B,zip64DiskNumberStart:H,zipCrypto:V,dataDescriptor:G,directory:k,versionMadeBy:W,rawComment:Y,rawExtraField:J,useWebWorkers:j,onstart:K,onprogress:Q,onend:de,signal:ye,encryptionStrength:ce,extendedTimestamp:ge,msDosCompatible:xe,internalFileAttribute:De,externalFileAttribute:Ae,useCompressionStream:ke,passThrough:ze}=s,et={lock:i,versionMadeBy:W,zip64:w,directory:!!k,filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:Y,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:S,rawExtraFieldAES:v,rawExtraField:J,extendedTimestamp:ge,msDosCompatible:xe,internalFileAttribute:De,externalFileAttribute:Ae,diskNumberStart:n},{signature:St,uncompressedSize:mt}=s,Be=0;ze||(mt=0);let{writable:Yt}=t;if(e){e.chunkSize=pV(r),await wm(Yt,f);let ut=e.readable,Jt=ut.size=e.size,Ce={options:{codecType:vV,level:E,rawPassword:g,password:L,encryptionStrength:ce,zipCrypto:m&&V,passwordVerification:m&&V&&_>>8&255,signed:!ze,compressed:x&&!ze,encrypted:m&&!ze,useWebWorkers:j,useCompressionStream:ke,transferStreams:!1},config:r,streamOptions:{signal:ye,size:Jt,onstart:K,onprogress:Q,onend:de}},Te=await IV({readable:ut,writable:Yt},Ce);Be=Te.outputSize,ze||(mt=Te.inputSize,St=Te.signature),Yt.size+=mt}else await wm(Yt,f);let Ct;if(w){let ut=4;I&&(ut+=8),N&&(ut+=8),B&&(ut+=8),H&&(ut+=4),Ct=new Uint8Array(ut)}else Ct=new Uint8Array;return jit({signature:St,rawExtraFieldZip64:Ct,compressedSize:Be,uncompressedSize:mt,headerInfo:a,dataDescriptorInfo:c},s),G&&await wm(Yt,D),Object.assign(et,{uncompressedSize:mt,compressedSize:Be,lastModDate:p,rawLastModDate:_,creationDate:M,lastAccessDate:R,encrypted:m,zipCrypto:V,size:u+Be,compressionMethod:T,version:b,headerArray:h,signature:St,rawExtraFieldZip64:Ct,extraFieldExtendedTimestampFlag:A,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:B,zip64DiskNumberStart:H}),et}function Hit(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:h,encryptionStrength:p,extendedTimestamp:_,encrypted:m}=e,x=r!==0&&!f,{version:b,compressionMethod:T}=e,C;if(m&&!a){C=new Uint8Array(Wi(Ppe)+2);let B=Ia(C);Ji(B,0,39169),Es(C,Ppe,2),$V(B,8,p)}else C=new Uint8Array;let A,S,v;if(_){S=new Uint8Array(9+(i?4:0)+(o?4:0));let B=Ia(S);Ji(B,0,21589),Ji(B,2,Wi(S)-4),v=1+(i?2:0)+(o?4:0),$V(B,4,v);let H=5;Gi(B,H,Math.floor(n.getTime()/1e3)),H+=4,i&&(Gi(B,H,Math.floor(i.getTime()/1e3)),H+=4),o&&Gi(B,H,Math.floor(o.getTime()/1e3));try{A=new Uint8Array(36);let V=Ia(A),G=Qq(n);Ji(V,0,10),Ji(V,2,32),Ji(V,8,1),Ji(V,10,24),Rl(V,12,G),Rl(V,20,Qq(i)||G),Rl(V,28,Qq(o)||G)}catch{A=new Uint8Array}}else A=S=new Uint8Array;let D=0;c&&(D=D|2048),u&&(D=D|8),T===Si&&(T=x?8:0),T==8&&(r>=1&&r<3&&(D=D|6),r>=3&&r<5&&(D=D|1),r===9&&(D=D|2)),s&&(b=b>45?b:45),m&&(D=D|1,a||(b=b>51?b:51,C[9]=T,T=99));let O=new Uint8Array(26),R=Ia(O);Ji(R,0,b),Ji(R,2,D),Ji(R,4,T);let M=new Uint32Array(1),L=Ia(M),g;n<lq?g=lq:n>cq?g=cq:g=n,Ji(L,0,(g.getHours()<<6|g.getMinutes())<<5|g.getSeconds()/2),Ji(L,2,(g.getFullYear()-1980<<4|g.getMonth()+1)<<5|g.getDate());let E=M[0];Gi(R,6,E),Ji(R,22,Wi(t));let w=Wi(C,S,A,h);Ji(R,24,w);let I=new Uint8Array(30+Wi(t)+w),N=Ia(I);return Gi(N,0,67324752),Es(I,O,4),Es(I,t,30),Es(I,C,30+Wi(t)),Es(I,S,30+Wi(t,C)),Es(I,A,30+Wi(t,C,S)),Es(I,h,30+Wi(t,C,S,A)),{localHeaderArray:I,headerArray:O,headerView:R,lastModDate:n,rawLastModDate:E,encrypted:m,compressed:x,version:b,compressionMethod:T,extraFieldExtendedTimestampFlag:v,rawExtraFieldExtendedTimestamp:S,rawExtraFieldNTFS:A,rawExtraFieldAES:C,extraFieldLength:w}}function Git(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ia(i),s=64-(t+Wi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Ia(a);Ji(c,0,6534),Ji(c,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array(Wi(u)+s),Es(i,u),Es(i,a,Wi(u)),r=Ia(i),Ji(r,28,o+s),e.metadataSize+=s}function Wit(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=Ia(o),i&&(s=4,Gi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function jit(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:u}=s,{dataDescriptorView:f,dataDescriptorOffset:h}=a,{zip64:p,zip64UncompressedSize:_,zip64CompressedSize:m,zipCrypto:x,dataDescriptor:b}=t;if((!u||x)&&n!==Si&&(Gi(c,10,n),b&&Gi(f,h,n)),p){let T=Ia(i);Ji(T,0,1),Ji(T,2,Wi(i)-4);let C=4;_&&(Gi(c,18,4294967295),Rl(T,C,BigInt(r)),C+=8),m&&(Gi(c,14,4294967295),Rl(T,C,BigInt(o))),b&&(Rl(f,h+4,BigInt(o)),Rl(f,h+12,BigInt(r)))}else Gi(c,14,o),Gi(c,18,r),b&&(Gi(f,h+4,o),Gi(f,h+8,r))}async function qit(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&Gi(r,14,e.signature),e.zip64?(Gi(r,18,4294967295),Gi(r,22,4294967295)):(Gi(r,18,e.compressedSize),Gi(r,22,e.uncompressedSize)),await wm(n,new Uint8Array(o)),t.slice(o.byteLength)}function Yit(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,u=Ia(n),f=4;r&&(f+=8),s&&(f+=8),a&&(Rl(u,f,BigInt(i)),f+=8),c&&Gi(u,f,o)}async function Xit(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,u=0,f=e.offset-r,h=i.size;for(let[,v]of i){let{rawFilename:D,rawExtraFieldZip64:O,rawExtraFieldAES:R,rawComment:M,rawExtraFieldNTFS:L,rawExtraField:g,extendedTimestamp:E,extraFieldExtendedTimestampFlag:w,lastModDate:I}=v,N;if(E){N=new Uint8Array(9);let B=Ia(N);Ji(B,0,21589),Ji(B,2,5),$V(B,4,w),Gi(B,5,Math.floor(I.getTime()/1e3))}else N=new Uint8Array;v.rawExtraFieldCDExtendedTimestamp=N,u+=46+Wi(D,M,O,R,L,N,g)}let p=new Uint8Array(u),_=Ia(p);await vm(o);let m=0;for(let[v,D]of Array.from(i.values()).entries()){let{offset:O,rawFilename:R,rawExtraFieldZip64:M,rawExtraFieldAES:L,rawExtraFieldCDExtendedTimestamp:g,rawExtraFieldNTFS:E,rawExtraField:w,rawComment:I,versionMadeBy:N,headerArray:B,directory:H,zip64:V,zip64UncompressedSize:G,zip64CompressedSize:k,zip64DiskNumberStart:W,zip64Offset:Y,msDosCompatible:J,internalFileAttribute:j,externalFileAttribute:K,diskNumberStart:Q,uncompressedSize:de,compressedSize:ye}=D,ce=Wi(M,L,g,E,w);Gi(_,c,33639248),Ji(_,c+4,N);let ge=Ia(B);G||Gi(ge,18,de),k||Gi(ge,14,ye),Es(p,B,c+6),Ji(_,c+30,ce),Ji(_,c+32,Wi(I)),Ji(_,c+34,V&&W?65535:Q),Ji(_,c+36,j),K?Gi(_,c+38,K):H&&J&&$V(_,c+38,16),Gi(_,c+42,V&&Y?4294967295:O),Es(p,R,c+46),Es(p,M,c+46+Wi(R)),Es(p,L,c+46+Wi(R,M)),Es(p,g,c+46+Wi(R,M,L)),Es(p,E,c+46+Wi(R,M,L,g)),Es(p,w,c+46+Wi(R,M,L,g,E)),Es(p,I,c+46+Wi(R)+ce);let xe=46+Wi(R,I)+ce;if(c-m>o.availableSize&&(o.availableSize=0,await wm(s,p.slice(m,c)),m=c),c+=xe,n.onprogress)try{await n.onprogress(v+1,i.size,new Ny(D))}catch{}}await wm(s,m?p.slice(m):p);let x=o.diskNumber,{availableSize:b}=o;b<22&&x++;let T=lo(e,n,VV);if(f>4294967295||u>4294967295||h>65535||x>65535){if(T===!1)throw new Error(Jq);T=!0}let C=new Uint8Array(T?98:22),A=Ia(C);c=0,T&&(Gi(A,0,101075792),Rl(A,4,BigInt(44)),Ji(A,12,45),Ji(A,14,45),Gi(A,16,x),Gi(A,20,a),Rl(A,24,BigInt(h)),Rl(A,32,BigInt(h)),Rl(A,40,BigInt(u)),Rl(A,48,BigInt(f)),Gi(A,56,117853008),Rl(A,64,BigInt(f)+BigInt(u)),Gi(A,72,x+1),lo(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),h=65535,f=4294967295,u=4294967295,c+=76),Gi(A,c,101010256),Ji(A,c+4,x),Ji(A,c+6,a),Ji(A,c+8,h),Ji(A,c+10,h),Gi(A,c+12,u),Gi(A,c+16,f);let S=Wi(t);if(S)if(S<=65535)Ji(A,c+20,S);else throw new Error(Oit);await wm(s,C),S&&await wm(s,t)}async function wm(e,t){let n=e.getWriter();try{await n.ready,e.size+=Wi(t),await n.write(t)}finally{n.releaseLock()}}function Qq(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function lo(e,t,n,i){let o=t[n]===Si?e.options[n]:t[n];return o===Si?i:o}function Ope(e){return e+5*(Math.floor(e/16383)+1)}function $V(e,t,n){e.setUint8(t,n)}function Ji(e,t,n){e.setUint16(t,n,!0)}function Gi(e,t,n){e.setUint32(t,n,!0)}function Rl(e,t,n){e.setBigUint64(t,n,!0)}function Es(e,t,n){e.set(t,n)}function Ia(e){return new DataView(e.buffer)}function Wi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}aE({Deflate:gme,Inflate:kme});function Kit(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Rn=Kit;function Zit(e,t){this.position=e,this.headingPitchRange=t}var QV=Zit;function JV(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new me,this.tourEnd=new me,this.entryStart=new me,this.entryEnd=new me,this._activeEntries=[]}JV.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};JV.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;Npe.call(this,e,t,function(i){n.playlistIndex=0,i||Lpe(n._activeEntries),n.tourEnd.raiseEvent(i)})};JV.prototype.stop=function(){Lpe(this._activeEntries)};function Lpe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function Npe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=$it.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function $it(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,Npe.call(this,e,t,n)}}var eU=JV;var vi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-vi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?vi.Bounce.In(e*2)*.5:vi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),gI=function(){return performance.now()},Qit=function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=gI()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e}(),pE={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=pE.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=pE.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=pE.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=pE.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},Fpe=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),eY=new Qit,Bpe=function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=vi.Linear.None,this._interpolationFunction=pE.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Fpe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=eY,eY.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=gI()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var h=i[s];if(h.length===0)continue;for(var p=[a],_=0,m=h.length;_<m;_+=1){var x=this._handleRelativeValue(a,h[_]);if(isNaN(x)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(x)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var b=a;for(var T in b)n[s][T]=b[T];o[s]=c?[]:{};var h=i[s];if(!this._isDynamic){var C={};for(var T in h)C[T]=h[T];i[s]=h=C}this._setupProperties(b,n[s],h,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=gI()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=gI()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=vi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=pE.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=gI()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var x=Math.trunc(s/a),b=s-x*a,T=Math.min(b/i._duration,1);return T===0&&s===i._duration?1:T},f=u(),h=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var _=0,m=this._chainedTweens.length;_<m;_++)this._chainedTweens[_].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),u=Array.isArray(a),f=!c&&u;f?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var Qti=Fpe.nextId,Dm=eY,Jti=Dm.getAll.bind(Dm),eni=Dm.removeAll.bind(Dm),tni=Dm.add.bind(Dm),nni=Dm.remove.bind(Dm),ini=Dm.update.bind(Dm);var Jit={LINEAR_NONE:vi.Linear.None,QUADRATIC_IN:vi.Quadratic.In,QUADRATIC_OUT:vi.Quadratic.Out,QUADRATIC_IN_OUT:vi.Quadratic.InOut,CUBIC_IN:vi.Cubic.In,CUBIC_OUT:vi.Cubic.Out,CUBIC_IN_OUT:vi.Cubic.InOut,QUARTIC_IN:vi.Quartic.In,QUARTIC_OUT:vi.Quartic.Out,QUARTIC_IN_OUT:vi.Quartic.InOut,QUINTIC_IN:vi.Quintic.In,QUINTIC_OUT:vi.Quintic.Out,QUINTIC_IN_OUT:vi.Quintic.InOut,SINUSOIDAL_IN:vi.Sinusoidal.In,SINUSOIDAL_OUT:vi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:vi.Sinusoidal.InOut,EXPONENTIAL_IN:vi.Exponential.In,EXPONENTIAL_OUT:vi.Exponential.Out,EXPONENTIAL_IN_OUT:vi.Exponential.InOut,CIRCULAR_IN:vi.Circular.In,CIRCULAR_OUT:vi.Circular.Out,CIRCULAR_IN_OUT:vi.Circular.InOut,ELASTIC_IN:vi.Elastic.In,ELASTIC_OUT:vi.Elastic.Out,ELASTIC_IN_OUT:vi.Elastic.InOut,BACK_IN:vi.Back.In,BACK_OUT:vi.Back.Out,BACK_IN_OUT:vi.Back.InOut,BOUNCE_IN:vi.Bounce.In,BOUNCE_OUT:vi.Bounce.Out,BOUNCE_IN_OUT:vi.Bounce.InOut},$r=Object.freeze(Jit);function tU(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}tU.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ae(this.view.position);t.flyToBoundingSphere(o,i)}};tU.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};tU.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=$r.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=bt(t,e)),t};var nU=tU;function tY(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}tY.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};tY.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var iU=tY;var Ype={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=oT(t),Ype[t]}},cY;typeof DOMParser<"u"&&(cY=new DOMParser);var eot=new Jk({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Fy=32,kpe=2414016,Vpe=1,Upe=16093e3,zpe=.1,Hpe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Gpe=["http://www.google.com/kml/ext/2.2"],tot=["http://www.w3.org/2005/Atom"],Re={kml:Hpe,gx:Gpe,atom:tot,kmlgx:Hpe.concat(Gpe)},lY={Document:ige,Folder:bot,Placemark:Tot,NetworkLink:Pot,GroundOverlay:wot,PhotoOverlay:sge,ScreenOverlay:vot,Tour:Aot};function Im(e){this._dataSource=e,this._deferred=Gl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Im.prototype,{dataSource:{get:function(){return this._dataSource}}});Im.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Im.prototype.addPromise=function(e){this._promises.push(e)};Im.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Im.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Su._getTimestamp()),this._process(e)};Im.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Su._getTimestamp(),e._process(!0)},0)};Im.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};Im.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Im.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=lY[i.localName];if(l(o)&&(Re.kml.indexOf(i.namespaceURI)!==-1||Re.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Su._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function not(e){let t=e.slice(0,Math.min(4,e.size)),n=Gl(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function iot(e){let t=Gl(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function Xpe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function Kpe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function oot(e,t){return Promise.resolve(e.getData(new MV)).then(function(n){n=Xpe(n),n=Kpe(n),t.kml=cY.parseFromString(n,"application/xml")})}function nY(e,t){let n=y(Ype.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new RV(n))).then(function(i){t[e.filename]=i})}function Au(e,t,n,i){let o=i.keys,r=new _I.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let h=new _I.default(u).absoluteTo(r).toString(),p=o.indexOf(h);if(p!==-1){let _=o[p];c.setAttribute(n,i[_]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",_)}}}}function Eu(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=uY(a,i);l(c)&&s.setAttribute(n,c.url)}}function Zpe(e,t,n){let i=Ss(e,"id");i=l(i)&&i.length!==0?i:zn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=zn(),l(n)&&(i=n+i)),o=t.add(new or({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new Lot),o}function yI(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function aU(e,t){if(!l(e))return d.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return d.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,d.fromDegrees(i,o,r,t)}function oU(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=aU(n[s],t);return o}function By(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ss(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function wi(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Wpe(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Qd(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Xn(e,t,n){let i=wi(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Dn(e,t,n){let i=wi(e,t,n);if(l(i))return i.textContent.trim()}function Jd(e,t,n){let i=wi(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function uY(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new Se({url:o});else{let r=new _I.default(t.getUrlComponent()),s=new _I.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Se({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Ol={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function sY(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(Ol.maximumRed=r,Ol.red=void 0):(Ol.maximumRed=void 0,Ol.red=0),o>0?(Ol.maximumGreen=o,Ol.green=void 0):(Ol.maximumGreen=void 0,Ol.green=0),i>0?(Ol.maximumBlue=i,Ol.blue=void 0):(Ol.maximumBlue=void 0,Ol.blue=0),Ol.alpha=n,z.fromRandom(Ol)):new z(r,o,i,n)}function rb(e,t,n){let i=Dn(e,t,n);if(l(i))return sY(i,Dn(e,"colorMode",n)==="random")}function rot(e){let t=wi(e,"TimeStamp",Re.kmlgx),n=Dn(t,"when",Re.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=Z.fromIso8601(n),o=new Yr;return o.addInterval(new En({start:i,stop:He.MAXIMUM_VALUE})),o}function sot(e){let t=wi(e,"TimeSpan",Re.kmlgx);if(!l(t))return;let n,i=wi(t,"begin",Re.kmlgx),o=l(i)?Z.fromIso8601(i.textContent):void 0,r=wi(t,"end",Re.kmlgx),s=l(r)?Z.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(Z.lessThan(s,o)){let a=o;o=s,s=a}n=new Yr,n.addInterval(new En({start:o,stop:s}))}else l(o)?(n=new Yr,n.addInterval(new En({start:o,stop:He.MAXIMUM_VALUE}))):l(s)&&(n=new Yr,n.addInterval(new En({start:He.MINIMUM_VALUE,stop:s})));return n}function $pe(){let e=new Ec;return e.width=Fy,e.height=Fy,e.scaleByDistance=new kt(kpe,Vpe,Upe,zpe),e.pixelOffsetScaleByDistance=new kt(kpe,Vpe,Upe,zpe),e}function fY(){let e=new Bh;return e.outline=!0,e.outlineColor=z.WHITE,e}function Qpe(){let e=new Fh;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=yi.LEFT,e.font="16px sans-serif",e.style=Xo.FILL_AND_OUTLINE,e}function dY(e,t,n,i,o){let r=Dn(e,"href",Re.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y(Xn(e,"x",Re.gx),0),u=y(Xn(e,"y",Re.gx),0);c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=uY(r,n,i);if(o){let a=Dn(e,"refreshMode",Re.kml),c=Dn(e,"viewRefreshMode",Re.kml);a==="onInterval"||a==="onExpire"?xt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&xt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=y(Dn(e,"viewBoundScale",Re.kml),1),f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=y(Dn(e,"viewFormat",Re.kml),f),p=Dn(e,"httpQuery",Re.kml);l(h)&&s.setQueryParameters(Yu(sU(h))),l(p)&&s.setQueryParameters(Yu(sU(p)));let _=t._ellipsoid;return mY(s,t.camera,t.canvas,u,t._lastCameraView.bbox,_),s}return s}function aot(e,t,n,i,o){let r=Xn(t,"scale",Re.kml),s=Xn(t,"heading",Re.kml),a=rb(t,"color",Re.kml),c=wi(t,"Icon",Re.kml),u=dY(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=Xn(c,"x",Re.gx),h=Xn(c,"y",Re.gx),p=Xn(c,"w",Re.gx),_=Xn(c,"h",Re.gx),m=wi(t,"hotSpot",Re.kml),x=By(m,"x"),b=By(m,"y"),T=Ss(m,"xunits"),C=Ss(m,"yunits"),A=n.billboard;l(A)||(A=$pe(),n.billboard=A),A.image=u,A.scale=r,A.color=a,(l(f)||l(h)||l(p)||l(_))&&(A.imageSubRegion=new qe(f,h,p,_)),l(s)&&s!==0&&(A.rotation=P.toRadians(-s),A.alignedAxis=d.UNIT_Z),r=y(r,1);let S,v;l(x)&&(T==="pixels"?S=-x*r:T==="insetPixels"?S=(x-Fy)*r:T==="fraction"&&(S=-x*Fy*r),S+=Fy*.5*r),l(b)&&(C==="pixels"?v=b*r:C==="insetPixels"?v=(-b+Fy)*r:C==="fraction"&&(v=b*Fy*r),v-=Fy*.5*r),(l(S)||l(v))&&(A.pixelOffset=new U(S,v))}function rU(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")aot(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=Qpe(),n.label=c),c.scale=y(Xn(a,"scale",Re.kml),c.scale),c.fillColor=y(rb(a,"color",Re.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Ic,n.polyline=c),c.width=Xn(a,"width",Re.kml),c.material=rb(a,"color",Re.kml),l(rb(a,"outerColor",Re.gx))&&xt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Xn(a,"outerWidth",Re.gx))&&xt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Xn(a,"physicalWidth",Re.gx))&&xt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Jd(a,"labelVisibility",Re.gx))&&xt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=fY(),n.polygon=c),c.material=y(rb(a,"color",Re.kml),c.material),c.fill=y(Jd(a,"fill",Re.kml),c.fill),c.outline=y(Jd(a,"outline",Re.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y(sY(Dn(a,"bgColor",Re.kml)),z.WHITE),u=y(sY(Dn(a,"textColor",Re.kml)),z.BLACK),f=Dn(a,"text",Re.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Dn(a,"listItemType",Re.kml);(c==="radioFolder"||c==="checkOffOnly")&&xt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function cot(e,t,n,i,o){let r=new or,s,a=-1,c=t.childNodes,u=c.length;for(let h=0;h<u;h++){let p=c[h];(p.localName==="Style"||p.localName==="StyleMap")&&(a=h)}if(a!==-1){let h=c[a];if(h.localName==="Style")rU(e,h,r,i,o);else{let p=Qd(h,"Pair",Re.kml);for(let _=0;_<p.length;_++){let m=p[_],x=Dn(m,"key",Re.kml);if(x==="normal"){let b=Dn(m,"styleUrl",Re.kml);if(l(b))s=n.getById(b),l(s)||(s=n.getById(`#${b}`)),l(s)&&r.merge(s);else{let T=wi(m,"Style",Re.kml);rU(e,T,r,i,o)}}else xt(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let f=Dn(t,"styleUrl",Re.kml);if(l(f)){let h=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),_=p[0];h=`${i.getDerivedResource({url:_}).getUrlComponent()}#${p[1]}`}s=n.getById(h),l(s)||(s=n.getById(`#${h}`)),l(s)&&r.merge(s)}return r}function lot(e,t,n){return t.fetchXML().then(function(i){return Jpe(e,i,n,t,!0)})}function Jpe(e,t,n,i,o,r){let s,a,c,u,f=Wpe(t,"Style",Re.kml);if(l(f)){let x=f.length;for(s=0;s<x;s++)u=f[s],a=Ss(u,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new or({id:a}),n.add(c),rU(e,u,c,i,r)))}let h=Wpe(t,"StyleMap",Re.kml);if(l(h)){let x=h.length;for(s=0;s<x;s++){let b=h[s];if(a=Ss(b,"id"),l(a)){let T=Qd(b,"Pair",Re.kml);for(let C=0;C<T.length;C++){let A=T[C],S=Dn(A,"key",Re.kml);if(S==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Dn(A,"styleUrl",Re.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),o&&l(i)&&(v=i.getUrlComponent()+v);let D=n.getById(v);l(D)&&c.merge(D)}else u=wi(A,"Style",Re.kml),rU(e,u,c,i,r)}}else xt(`kml-styleMap-${S}`,`KML - Unsupported StyleMap key: ${S}`)}}}}let p=[],_=t.getElementsByTagName("styleUrl"),m=_.length;for(s=0;s<m;s++){let x=_[s].textContent;if(x[0]!=="#"){let b=x.split("#");if(b.length===2){let T=b[0],C=i.getDerivedResource({url:T});p.push(lot(e,C,n))}}}return p}function hY(e,t,n){let i=new ay(e,t.id,["position"]),o=new og(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Ic,t.polyline.positions=new ry([i,o])}function ege(e,t){return!l(e)&&!l(t)||e==="clampToGround"?Ye.CLAMP_TO_GROUND:e==="relativeToGround"?Ye.RELATIVE_TO_GROUND:e==="absolute"?Ye.NONE:t==="clampToSeaFloor"?(xt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Ye.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(xt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Ye.RELATIVE_TO_GROUND):(l(e)?xt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):xt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Ye.CLAMP_TO_GROUND)}function uot(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new og(e))}function fot(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function cU(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():Qpe(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():$pe(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(z.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new U(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function tge(e,t){let n=e.path;l(n)||(n=new Qg,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function dot(e,t,n,i,o){let r=Dn(n,"coordinates",Re.kml),s=Dn(n,"altitudeMode",Re.kml),a=Dn(n,"altitudeMode",Re.gx),c=Jd(n,"extrude",Re.kml),u=e._ellipsoid,f=aU(r,u);return i.position=f,cU(e,i,o,ege(s,a)),c&&yI(s,a)&&hY(t,i,o),!0}function jpe(e,t,n,i,o){let r=wi(n,"coordinates",Re.kml),s=Dn(n,"altitudeMode",Re.kml),a=Dn(n,"altitudeMode",Re.gx),c=Jd(n,"extrude",Re.kml),u=Jd(n,"tessellate",Re.kml),f=yI(s,a),h=Xn(n,"drawOrder",Re.gx),p=e._ellipsoid,_=oU(r,p),m=o.polyline;if(f&&c){let x=new Jg;i.wall=x,x.positions=_;let b=o.polygon;l(b)&&(x.fill=b.fill,x.material=b.material),x.outline=!0,l(m)?(x.outlineColor=l(m.material)?m.material.color:z.WHITE,x.outlineWidth=m.width):l(b)&&(x.outlineColor=l(b.material)?b.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let x=new Ic;x.clampToGround=!0,i.polyline=x,x.positions=_,l(m)?(x.material=l(m.material)?m.material.color.getValue(He.MINIMUM_VALUE):z.WHITE,x.width=y(m.width,1)):(x.material=z.WHITE,x.width=1),x.zIndex=h}else l(h)&&xt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&xt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new Ic,i.polyline=m,m.positions=fot(_,s,a,p),(!u||f)&&(m.arcType=tn.NONE);return!0}function hot(e,t,n,i,o){let r=wi(n,"outerBoundaryIs",Re.kml),s=wi(r,"LinearRing",Re.kml),a=wi(s,"coordinates",Re.kml),c=e._ellipsoid,u=oU(a,c),f=Jd(n,"extrude",Re.kml),h=Dn(n,"altitudeMode",Re.kml),p=Dn(n,"altitudeMode",Re.gx),_=yI(h,p),m=l(o.polygon)?o.polygon.clone():fY(),x=o.polyline;if(l(x)&&(m.outlineColor=l(x.material)?x.material.color:z.WHITE,m.outlineWidth=x.width),i.polygon=m,_?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let b=new Xa(u),T=Qd(n,"innerBoundaryIs",Re.kml);for(let C=0;C<T.length;C++){s=Qd(T[C],"LinearRing",Re.kml);for(let A=0;A<s.length;A++)a=wi(s[A],"coordinates",Re.kml),u=oU(a,c),l(u)&&b.holes.push(new Xa(u))}m.hierarchy=b}return!0}function mot(e,t,n,i,o){let r=Dn(n,"altitudeMode",Re.kml),s=Dn(n,"altitudeMode",Re.gx),a=Qd(n,"coord",Re.gx),c=Qd(n,"angles",Re.gx),u=Qd(n,"when",Re.kml),f=Jd(n,"extrude",Re.kml),h=yI(r,s),p=e._ellipsoid;c.length>0&&xt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let _=Math.min(a.length,u.length),m=[],x=[];for(let T=0;T<_;T++){let C=aU(a[T].textContent,p);m.push(C),x.push(Z.fromIso8601(u[T].textContent))}let b=new va;return b.addSamples(x,m),i.position=b,cU(e,i,o,ege(r,s)),tge(i,o),i.availability=new Yr,u.length>0&&i.availability.addInterval(new En({start:x[0],stop:x[x.length-1]})),h&&f&&hY(t,i,o),!0}function qpe(e,t,n,i,o,r,s,a,c){let u=e[0],f=e[e.length-1],h=new va;h.addSamples(e,t),n.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:uot(h,s,a)})),i.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function pot(e,t,n,i,o){let r=Jd(n,"interpolate",Re.gx),s=Qd(n,"Track",Re.gx),a,c,u,f=!1,h=new uy,p=new Yr,_=new Sa,m=e._ellipsoid;for(let x=0,b=s.length;x<b;x++){let T=s[x],C=Qd(T,"when",Re.kml),A=Qd(T,"coord",Re.gx),S=Dn(T,"altitudeMode",Re.kml),v=Dn(T,"altitudeMode",Re.gx),D=yI(S,v),O=Jd(T,"extrude",Re.kml),R=Math.min(A.length,C.length),M=[];a=[];for(let L=0;L<R;L++){let g=aU(A[L].textContent,m);M.push(g),a.push(Z.fromIso8601(C[L].textContent))}r&&(l(c)&&qpe([c,a[0]],[u,M[0]],_,p,h,!1,"absolute",void 0,!1),c=a[R-1],u=M[M.length-1]),qpe(a,M,_,p,h,D&&O,S,v,!0),f=f||D&&O}return i.availability=p,i.position=_,cU(e,i,o),tge(i,o),f&&(hY(t,i,o),i.polyline.show=h),!0}var nge={Point:dot,LineString:jpe,LinearRing:jpe,Polygon:hot,Track:mot,MultiTrack:pot,MultiGeometry:got,Model:_ot};function got(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),h=nge[f.localName];if(l(h)){let p=Zpe(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,f,p,o)&&(a=!0)}}return a}function _ot(e,t,n,i,o){return xt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function yot(e,t){let n=wi(e,"ExtendedData",Re.kml);if(!l(n))return;l(wi(n,"SchemaData",Re.kml))&&xt("kml-schemaData","KML - SchemaData is unsupported"),l(Ss(n,"xmlns:prefix"))&&xt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Qd(n,"Data",Re.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Ss(a,"name");l(c)&&(i[c]={displayName:Dn(a,"displayName",Re.kml),value:Dn(a,"value",Re.kml)})}}t.kml.extendedData=i}var uo;typeof document<"u"&&(uo=document.createElement("div"));function xot(e,t,n,i,o){let r,s,a,c=t.kml,u=c.extendedData,f=Dn(e,"description",Re.kml),h=y(t.balloonStyle,n.balloonStyle),p=z.WHITE,_=z.BLACK,m=f;l(h)&&(p=y(h.bgColor,z.WHITE),_=y(h.textColor,z.BLACK),m=y(h.text,f));let x;if(l(m)){if(m=m.replace("$[name]",y(t.name,"")),m=m.replace("$[description]",y(f,"")),m=m.replace("$[address]",y(c.address,"")),m=m.replace("$[Snippet]",y(c.snippet,"")),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let C=m.match(/\$\[.+?\]/g);if(C!==null)for(r=0;r<C.length;r++){let A=C[r],S=A.substr(2,A.length-3),v=/\/displayName$/.test(S);S=S.replace(/\/displayName$/,""),x=u[S],l(x)&&(x=v?x.displayName:x.value),l(x)&&(m=m.replace(A,y(x,"")))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],x=u[s],m+=`<tr><th>${y(x.displayName,s)}</th><td>${y(x.value,"")}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=eot.link(m),uo.innerHTML=m;let b=uo.querySelectorAll("a");for(r=0;r<b.length;r++)b[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Au(uo,"a","href",i),Au(uo,"link","href",i),Au(uo,"area","href",i),Au(uo,"img","src",i),Au(uo,"iframe","src",i),Au(uo,"video","src",i),Au(uo,"audio","src",i),Au(uo,"source","src",i),Au(uo,"track","src",i),Au(uo,"input","src",i),Au(uo,"embed","src",i),Au(uo,"script","src",i),Au(uo,"video","poster",i)),Eu(uo,"a","href",o),Eu(uo,"link","href",o),Eu(uo,"area","href",o),Eu(uo,"img","src",o),Eu(uo,"iframe","src",o),Eu(uo,"video","src",o),Eu(uo,"audio","src",o),Eu(uo,"source","src",o),Eu(uo,"track","src",o),Eu(uo,"input","src",o),Eu(uo,"embed","src",o),Eu(uo,"script","src",o),Eu(uo,"video","poster",o);let T='<div class="cesium-infoBox-description-lighter" style="';T+="overflow:auto;",T+="word-wrap:break-word;",T+=`background-color:${p.toCssColorString()};`,T+=`color:${_.toCssColorString()};`,T+='">',T+=`${uo.innerHTML}</div>`,uo.innerHTML="",t.description=T}function lU(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=Zpe(t,i,n.context),c=a.kml,u=cot(e,t,n.styleCollection,r,s),f=Dn(t,"name",Re.kml);a.name=f,a.parent=o;let h=sot(t);l(h)||(h=rot(t)),a.availability=h,gY(a);function p(A){return A?A.show&&p(A.parent):!0}let _=Jd(t,"visibility",Re.kml);a.show=p(o)&&y(_,!0);let m=wi(t,"author",Re.atom),x=c.author;x.name=Dn(m,"name",Re.atom),x.uri=Dn(m,"uri",Re.atom),x.email=Dn(m,"email",Re.atom);let b=wi(t,"link",Re.atom),T=c.link;T.href=Ss(b,"href"),T.hreflang=Ss(b,"hreflang"),T.rel=Ss(b,"rel"),T.type=Ss(b,"type"),T.title=Ss(b,"title"),T.length=Ss(b,"length"),c.address=Dn(t,"address",Re.kml),c.phoneNumber=Dn(t,"phoneNumber",Re.kml),c.snippet=Dn(t,"Snippet",Re.kml),yot(t,a),xot(t,a,u,s,r);let C=e._ellipsoid;return rge(t,a,C),oge(t,a,C),l(wi(t,"Region",Re.kml))&&xt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function ige(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function bot(e,t,n,i){let o=lU(e,t,n),r=Ge(n);r.parentEntity=o.entity,ige(e,t,r,i)}function Tot(e,t,n,i){let o=lU(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let h=c.item(u),p=nge[h.localName];l(p)&&(p(e,n.entityCollection,h,r,s,r.id),a=!0)}a||(r.merge(s),cU(e,r,s))}var Cot={FlyTo:Sot,Wait:Eot,SoundCue:iY,AnimatedUpdate:iY,TourControl:iY};function Aot(e,t,n,i){let o=Dn(t,"name",Re.kml),r=Ss(t,"id"),s=new eU(o,r),a=wi(t,"Playlist",Re.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let h=u[f];if(h.localName){let p=Cot[h.localName];p?p(s,h,c):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(s)}function iY(e,t){xt(`KML Tour unsupported node ${t.localName}`)}function Eot(e,t){let n=Xn(t,"duration",Re.gx);e.addPlaylistEntry(new iU(n))}function Sot(e,t,n){let i=Xn(t,"duration",Re.gx),o=Dn(t,"flyToMode",Re.gx),r={kml:{}};rge(t,r,n),oge(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new nU(i,o,s);e.addPlaylistEntry(a)}function oge(e,t,n){let i=wi(e,"Camera",Re.kml);if(l(i)){let o=y(Xn(i,"longitude",Re.kml),0),r=y(Xn(i,"latitude",Re.kml),0),s=y(Xn(i,"altitude",Re.kml),0),a=y(Xn(i,"heading",Re.kml),0),c=y(Xn(i,"tilt",Re.kml),0),u=y(Xn(i,"roll",Re.kml),0),f=d.fromDegrees(o,r,s,n),h=Ha.fromDegrees(a,c-90,u);t.kml.camera=new nV(f,h)}}function rge(e,t,n){let i=wi(e,"LookAt",Re.kml);if(l(i)){let o=y(Xn(i,"longitude",Re.kml),0),r=y(Xn(i,"latitude",Re.kml),0),s=y(Xn(i,"altitude",Re.kml),0),a=Xn(i,"heading",Re.kml),c=Xn(i,"tilt",Re.kml),u=y(Xn(i,"range",Re.kml),0);c=P.toRadians(y(c,0)),a=P.toRadians(y(a,0));let f=new Kd(a,c-P.PI_OVER_TWO,u),h=d.fromDegrees(o,r,s,n);t.kml.lookAt=new QV(h,f)}}function vot(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=wi(t,"Icon",Re.kml),c=dY(a,e,r,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],h=wi(t,"screenXY",Re.kml),p=wi(t,"overlayXY",Re.kml),_=wi(t,"size",Re.kml),m,x,b,T,C,A;l(_)&&(m=By(_,"x"),x=By(_,"y"),b=Ss(_,"xunits"),T=Ss(_,"yunits"),l(m)&&m!==-1&&m!==0&&(b==="fraction"?C=`width: ${Math.floor(m*100)}%`:b==="pixels"&&(C=`width: ${m}px`),f.push(C)),l(x)&&x!==-1&&x!==0&&(T==="fraction"?A=`height: ${Math.floor(x*100)}%`:T==="pixels"&&(A=`height: ${x}px`),f.push(A))),u.style=f.join(";");let S=0,v=u.height;l(p)&&(m=By(p,"x"),x=By(p,"y"),b=Ss(p,"xunits"),T=Ss(p,"yunits"),l(m)&&(b==="fraction"?S=m*u.width:(b==="pixels"||b==="insetPixels")&&(S=m)),l(x)&&(T==="fraction"?v=x*u.height:(T==="pixels"||T==="insetPixels")&&(v=x))),l(h)&&(m=By(h,"x"),x=By(h,"y"),b=Ss(h,"xunits"),T=Ss(h,"yunits"),l(m)&&(b==="fraction"?C=`left: calc(${Math.floor(m*100)}% - ${S}px)`:b==="pixels"?C=`left: ${m-S}px`:b==="insetPixels"&&(C=`right: ${m-S}px`),f.push(C)),l(x)&&(T==="fraction"?A=`bottom: calc(${Math.floor(x*100)}% - ${v}px)`:T==="pixels"?A=`bottom: ${x-v}px`:T==="insetPixels"&&(A=`top: ${x-v}px`),f.push(A))),u.style=f.join(";")},o.appendChild(u)}function wot(e,t,n,i){let r=lU(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=oU(wi(t,"LatLonQuad",Re.gx),c),f=Xn(t,"drawOrder",Re.kml);if(l(u))s=fY(),s.hierarchy=new Xa(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new kh,s.zIndex=f,r.rectangle=s;let m=wi(t,"LatLonBox",Re.kml);if(l(m)){let x=Xn(m,"west",Re.kml),b=Xn(m,"south",Re.kml),T=Xn(m,"east",Re.kml),C=Xn(m,"north",Re.kml);l(x)&&(x=P.negativePiToPi(P.toRadians(x))),l(b)&&(b=P.clampToLatitudeRange(P.toRadians(b))),l(T)&&(T=P.negativePiToPi(P.toRadians(T))),l(C)&&(C=P.clampToLatitudeRange(P.toRadians(C))),s.coordinates=new se(x,b,T,C);let A=Xn(m,"rotation",Re.kml);if(l(A)){let S=P.toRadians(A);s.rotation=S,s.stRotation=S}}}let h=wi(t,"Icon",Re.kml),p=dY(h,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&xt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=Xn(h,"x",Re.gx),x=Xn(h,"y",Re.gx),b=Xn(h,"w",Re.gx),T=Xn(h,"h",Re.gx);(l(m)||l(x)||l(b)||l(T))&&xt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=rb(t,"color",Re.kml),s.material.transparent=!0}else s.material=rb(t,"color",Re.kml);let _=Dn(t,"altitudeMode",Re.kml);l(_)?_==="absolute"?(s.height=Xn(t,"altitude",Re.kml),s.zIndex=void 0):_!=="clampToGround"&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${_}`):(_=Dn(t,"altitudeMode",Re.gx),_==="relativeToSeaFloor"?(xt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Xn(t,"altitude",Re.kml),s.zIndex=void 0):_==="clampToSeaFloor"?xt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(_)&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${_}`))}function sge(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),xt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var ky={INTERVAL:0,EXPIRE:1,STOP:2};function sU(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Dot=new se,gE=new fe,oY=new U,Iot=new d;function mY(e,t,n,i,o,r){function s(u){return u<-P.PI_OVER_TWO?-P.PI_OVER_TWO:u>P.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=aT(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ne.MORPHING){let u,f;if(o=y(o,Dot),l(n)&&(oY.x=n.clientWidth*.5,oY.y=n.clientHeight*.5,u=t.pickEllipsoid(oY,r,Iot)),l(u)?f=r.cartesianToCartographic(u,gE):(f=se.center(o,gE),u=r.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let T=o.width*i*.5,C=o.height*i*.5;o=new se(a(f.longitude-T),s(f.latitude-C),a(f.longitude+T),s(f.latitude+C))}c=c.replace("[bboxWest]",P.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(o.north).toString());let h=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",h),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",d.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",h),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,gE),c=c.replace("[cameraLon]",P.toDegrees(gE.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(gE.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(gE.height).toString());let _=t.frustum,m=_.aspectRatio,x="",b="";if(l(m)){let T=P.toDegrees(_.fov);m>1?(x=T,b=T/m):(b=T,x=T*m)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",b.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Yu(c))}function Pot(e,t,n,i){let r=lU(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=wi(t,"Link",Re.kml);if(l(c)||(c=wi(t,"Url",Re.kml)),l(c)){let u=Dn(c,"href",Re.kml),f,h;if(l(u)){let p=u;if(u=uY(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Dn(c,"viewRefreshMode",Re.kml),f==="onRegion"){xt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=y(Dn(c,"viewBoundScale",Re.kml),1);let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",T=y(Dn(c,"viewFormat",Re.kml),b),C=Dn(c,"httpQuery",Re.kml);l(T)&&u.setQueryParameters(Yu(sU(T))),l(C)&&u.setQueryParameters(Yu(sU(C)));let A=e._ellipsoid;mY(u,e.camera,e.canvas,h,e._lastCameraView.bbox,A)}let _={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new ra,x=pY(e,m,u,_).then(function(b){let T=e._entityCollection,C=m.values;T.suspendEvents();for(let v=0;v<C.length;v++){let D=C[v];l(D.parent)||(D.parent=r,gY(D)),T.add(D)}T.resumeEvents();let A=Dn(c,"refreshMode",Re.kml),S=y(Xn(c,"refreshInterval",Re.kml),0);if(A==="onInterval"&&S>0||A==="onExpire"||f==="onStop"){let v=wi(b,"NetworkLinkControl",Re.kml),D=l(v),O=Z.now(),R={id:zn(),href:u,cookie:{},lastUpdated:O,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:O},M=0;if(D&&(R.cookie=Yu(y(Dn(v,"cookie",Re.kml),"")),M=y(Xn(v,"minRefreshPeriod",Re.kml),0)),A==="onInterval")D&&(S=Math.max(M,S)),R.refreshMode=ky.INTERVAL,R.time=S;else if(A==="onExpire"){let L;if(D&&(L=Dn(v,"expires",Re.kml)),l(L))try{let g=Z.fromIso8601(L),E=Z.secondsDifference(g,O);E>0&&E<M&&Z.addSeconds(O,M,g),R.refreshMode=ky.EXPIRE,R.time=g}catch{xt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else xt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=ky.STOP,R.time=y(Xn(c,"viewRefreshTime",Re.kml),0)):xt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(b){xt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,b)});i.addPromise(x)}}}function Rot(e,t,n,i){let o=lY[t.localName];return l(o)?o(e,t,n,i):sge(e,t,n,i)}function aY(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:wi(a,"Document",Re.kml),u=Dn(c,"name",Re.kml);l(u)||(u=oy(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Su._DeferredLoading(e),h=new ra(e);return Promise.all(Jpe(e,n,h,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let x=0;x<m.length;x++){let b=m[x];if(l(lY[b.localName])){p=b;break}}}let _={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),Rot(e,p,_,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function Oot(e,t,n,i,o){let r=nn("ThirdParty/Workers/z-worker-pako.js");aE({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new YV(new lg(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],u={},f;for(let h=0;h<a.length;h++){let p=a[h];p.directory||(/\.kml$/i.test(p.filename)&&(!l(f)||!/\//i.test(p.filename))?(l(f)&&c.push(nY(f,u)),f=p):c.push(nY(p,u)))}return l(f)&&c.push(oot(f,u)),Promise.all(c).then(function(){if(s.close(),!l(u.kml))throw new re("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),aY(e,t,u.kml,i,u,o)})})}function pY(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Se){n=Se.createIfNeeded(n),c=n.fetchBlob(),o=y(o,n.clone());let u=e._resourceCredits,f=n.credits;if(l(f)){let h=f.length;for(let p=0;p<h;p++)u.push(f[p])}}else o=y(o,Se.DEFAULT.clone());return o=Se.createIfNeeded(o),l(a)&&(a=Rn(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?not(u).then(function(f){return f?Oot(e,t,u,o,a):iot(u).then(function(h){h=Xpe(h),h=Kpe(h);let p,_;try{p=cY.parseFromString(h,"application/xml")}catch(m){_=m.toString()}if(l(_)||p.body||p.documentElement.tagName==="parsererror"){let m=l(_)?_:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new re(m)}return aY(e,t,p,o,r,a,s)})}):aY(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function Su(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new me,this._error=new me,this._loading=new me,this._refresh=new me,this._unsupportedNode=new me,this._clock=void 0,this._entityCollection=new ra(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Cy,this._networkLinks=new vt,this._entityCluster=new Mf,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?d.clone(t.positionWC):void 0,direction:l(t)?d.clone(t.directionWC):void 0,up:l(t)?d.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():se.clone(se.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,ee.default);let i=e.credit;typeof i=="string"&&(i=new At(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Su.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new Su(t).load(e,t)};Object.defineProperties(Su.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Su.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),Xr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return pY(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Z.equals(s,He.MINIMUM_VALUE),u=Z.equals(a,He.MAXIMUM_VALUE);if(!c||!u){let h;c&&(h=new Date,h.setHours(0,0,0,0),s=Z.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=Z.fromDate(h)),o=new fm,o.startTime=s,o.stopTime=a,o.currentTime=Z.clone(s),o.clockRange=Kr.LOOP_STOP,o.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Z.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Xr.setLoading(i,!1),i}).catch(function(o){return Xr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Su.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function gY(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function Mot(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=wi(r,"NetworkLinkControl",Re.kml),c=l(a),u=0;if(c){if(l(wi(a,"Update",Re.kml))){xt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Yu(y(Dn(a,"cookie",Re.kml),"")),u=y(Xn(a,"minRefreshPeriod",Re.kml),0)}let f=Z.now(),h=t.refreshMode;if(h===ky.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(h===ky.EXPIRE){let O;if(l(a)&&(O=Dn(a,"expires",Re.kml)),l(O))try{let R=Z.fromIso8601(O),M=Z.secondsDifference(R,f);M>0&&M<u&&Z.addSeconds(f,u,R),t.time=R}catch{xt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else xt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,_=e._entityCollection,m=n.values;function x(O){_.remove(O);let R=O._children,M=R.length;for(let L=0;L<M;++L)x(R[L])}_.suspendEvents();let b=_.values.slice(),T;for(T=0;T<b.length;++T){let O=b[T];O.parent===p&&(O.parent=void 0,x(O))}for(_.resumeEvents(),_.suspendEvents(),T=0;T<m.length;T++){let O=m[T];l(O.parent)||(O.parent=p,gY(O)),_.add(O)}_.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let C=_.computeAvailability(),A=C.start,S=C.stop,v=Z.equals(A,He.MINIMUM_VALUE),D=Z.equals(S,He.MAXIMUM_VALUE);if(!v||!D){let O=e._clock;(O.startTime!==A||O.stopTime!==S)&&(O.startTime=A,O.stopTime=S,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var rY=new vt;Su.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=Z.now(),i=this;rY.removeAll();function o(f){let h=f._children,p=h.length;for(let _=0;_<p;++_){let m=h[_];rY.set(m.id,m),o(m)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,P.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,P.EPSILON7)&&a.upWC.equalsEpsilon(s.up,P.EPSILON7))&&(s.position=d.clone(a.positionWC),s.direction=d.clone(a.directionWC),s.up=d.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new vt,u=!1;return t.values.forEach(function(f){let h=f.entity;if(!rY.contains(h.id)){if(!f.updating){let p=!1;if(f.refreshMode===ky.INTERVAL?Z.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===ky.EXPIRE?Z.greaterThan(n,f.time)&&(p=!0):f.refreshMode===ky.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&Z.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(h),f.updating=!0;let _=new ra,m=f.href.clone();m.setQueryParameters(f.cookie);let x=y(i._ellipsoid,ee.default);mY(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,x),pY(i,_,m,{context:h.id}).then(Mot(i,f,_,c,m)).catch(function(b){let T=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(T),i._error.raiseEvent(i,T)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function Lot(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}Su._DeferredLoading=Im;Su._getTimestamp=Ci;var uU=Su;function xI(){he.throwInstantiationError()}xI.prototype.update=he.throwInstantiationError;xI.prototype.getBoundingSphere=he.throwInstantiationError;xI.prototype.isDestroyed=he.throwInstantiationError;xI.prototype.destroy=he.throwInstantiationError;var age=xI;var _Y=32,Not="http://www.opengis.net/kml/2.2",th="http://www.google.com/kml/ext/2.2",Fot="http://www.w3.org/2000/xmlns/";function fU(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Bot=/^data:image\/([^,;]+)/;fU.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Se){if(e=Se.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Bot);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function kot(e,t){return function(n){e._files[t]=n}}fU.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new re("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(kot(this,r))}return o};Object.defineProperties(fU.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function dU(e){this._time=e}dU.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};dU.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return ab(n)};dU.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function yY(){this._ids={},this._styles={},this._count=0}yY.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};yY.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function uge(){this._ids={}}uge.prototype.get=function(e){if(!l(e))return this.get(zn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function xY(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=xY._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(Fot,"xmlns:gx",th);let a=r.createElement("Document");s.appendChild(a),dge(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?Vot(f,c.files):{kml:f,externalFiles:c.files}})}function Vot(e,t){let n=nn("ThirdParty/Workers/z-worker-pako.js");aE({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new uI,o=new ZV(i);return o.add("doc.kml",new OV(e)).then(function(){let r=Object.keys(t);return fge(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function fge(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new lg(n[o])).then(function(){return fge(e,t,n,i+1)})}xY._createState=function(e){let t=e.entities,n=new yY,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===He.MINIMUM_VALUE?r.stop===He.MAXIMUM_VALUE?r=new En:Z.addSeconds(r.stop,-10*s,r.start):r.stop===He.MAXIMUM_VALUE&&Z.addSeconds(r.start,10*s,r.stop);let a=new fU(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Not,"kml"),ellipsoid:y(e.ellipsoid,ee.default),idManager:new uge,styleCache:n,externalFileHandler:a,time:o,valueGetter:new dU(o),sampleDuration:s,defaultAvailability:new Yr([r])}};function dge(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let h=0;h<a;++h){let p=n[h];c=[],u=[],f=[],Uot(e,p,u,f),zot(e,p.polyline,u,f),lge(e,p.rectangle,u,f,c),lge(e,p.polygon,u,f,c),jot(e,p,p.model,u,f);let _,m=p.availability;l(m)&&(_=i.createElement("TimeSpan"),Z.equals(m.start,He.MINIMUM_VALUE)||_.appendChild(fn(i,"begin",Z.toIso8601(m.start))),Z.equals(m.stop,He.MAXIMUM_VALUE)||_.appendChild(fn(i,"end",Z.toIso8601(m.stop))));for(let T=0;T<c.length;++T){let C=c[T];C.setAttribute("id",s.get(p.id)),C.appendChild(fn(i,"name",p.name)),C.appendChild(fn(i,"visibility",p.show)),C.appendChild(fn(i,"description",p.description)),l(_)&&C.appendChild(_),t.appendChild(C)}let x=u.length;if(x>0){let T=i.createElement("Placemark");T.setAttribute("id",s.get(p.id));let C=p.name,A=p.label;if(l(A)){let v=i.createElement("LabelStyle"),D=r.get(A.text);C=l(D)&&D.length>0?D:C;let O=r.getColor(A.fillColor);l(O)&&(v.appendChild(fn(i,"color",O)),v.appendChild(fn(i,"colorMode","normal")));let R=r.get(A.scale);l(R)&&v.appendChild(fn(i,"scale",R)),f.push(v)}T.appendChild(fn(i,"name",C)),T.appendChild(fn(i,"visibility",p.show)),T.appendChild(fn(i,"description",p.description)),l(_)&&T.appendChild(_),t.appendChild(T);let S=f.length;if(S>0){let v=i.createElement("Style");for(let D=0;D<S;++D)v.appendChild(f[D]);T.appendChild(fn(i,"styleUrl",o.get(v)))}if(u.length===1)T.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let D=0;D<x;++D)v.appendChild(u[D]);T.appendChild(v)}}let b=p._children;if(b.length>0){let T=i.createElement("Folder");T.setAttribute("id",s.get(p.id)),T.appendChild(fn(i,"name",p.name)),T.appendChild(fn(i,"visibility",p.show)),T.appendChild(fn(i,"description",p.description)),t.appendChild(T),dge(e,T,b)}}}var Ml=new d,Xc=new fe,eh=new Z;function Uot(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){hge(e,t,a,n,i);return}s.get(c,void 0,Ml);let u=fn(o,"coordinates",sb(Ml,r)),f=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(cb(e,a.heightReference)),f.appendChild(h),f.appendChild(u),n.push(f);let p=a instanceof Ec?pge(e,a):mge(e,a);i.push(p)}function hge(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof Sa?(c=u.intervals,f=!1):c=y(t.availability,e.defaultAvailability);let h=n instanceof $g,p,_,m,x=[];for(p=0;p<c.length;++p){let T=c.get(p),C=f?u:T.data,A=r.createElement("altitudeMode");C instanceof og?(C=C._value,A.appendChild(cb(e,Ye.CLAMP_TO_GROUND))):l(n)?A.appendChild(cb(e,n.heightReference)):A.appendChild(cb(e,Ye.NONE));let S=[],v=[];if(C.isConstant){a.get(C,void 0,Ml);let O=fn(r,"coordinates",sb(Ml,s));S.push(Z.toIso8601(T.start)),v.push(O),S.push(Z.toIso8601(T.stop)),v.push(O)}else if(C instanceof va)for(m=C._property._times,_=0;_<m.length;++_)S.push(Z.toIso8601(m[_])),C.getValueInReferenceFrame(m[_],Ui.FIXED,Ml),v.push(sb(Ml,s));else if(C instanceof Ff){m=C._times;let O=C._values;for(_=0;_<m.length;++_)S.push(Z.toIso8601(m[_])),d.fromArray(O,_*3,Ml),v.push(sb(Ml,s))}else{let O=e.sampleDuration;T.start.clone(eh),T.isStartIncluded||Z.addSeconds(eh,O,eh);let R=T.stop;for(;Z.lessThan(eh,R);)C.getValue(eh,Ml),S.push(Z.toIso8601(eh)),v.push(sb(Ml,s)),Z.addSeconds(eh,O,eh);T.isStopIncluded&&Z.equals(eh,R)&&(C.getValue(eh,Ml),S.push(Z.toIso8601(eh)),v.push(sb(Ml,s)))}let D=r.createElementNS(th,"Track");D.appendChild(A);for(let O=0;O<S.length;++O){let R=fn(r,"when",S[O]),M=fn(r,"coord",v[O],th);D.appendChild(R),D.appendChild(M)}h&&D.appendChild(gge(e,n)),x.push(D)}if(x.length===1)i.push(x[0]);else if(x.length>1){let T=r.createElementNS(th,"MultiTrack");for(p=0;p<x.length;++p)T.appendChild(x[p]);i.push(T)}if(l(n)&&!h){let T=n instanceof Ec?pge(e,n):mge(e,n);o.push(T)}let b=t.path;if(l(b)){let T=a.get(b.width),C=b.material;if(l(C)||l(T)){let A=r.createElement("LineStyle");l(T)&&A.appendChild(fn(r,"width",T)),bY(e,C,A),o.push(A)}}}function mge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(fn(n,"color",r)),o.appendChild(fn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(fn(n,"scale",s/_Y)),o}function pge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(fn(n,"href",s));let _=i.get(t.imageSubRegion);l(_)&&(p.appendChild(fn(n,"x",_.x,th)),p.appendChild(fn(n,"y",_.y,th)),p.appendChild(fn(n,"w",_.width,th)),p.appendChild(fn(n,"h",_.height,th))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(fn(n,"color",a)),r.appendChild(fn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(fn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=y(c,1),U.divideByScalar(u,c,u);let p=i.get(t.width,_Y),_=i.get(t.height,_Y),m=i.get(t.horizontalOrigin,yi.CENTER);m===yi.CENTER?u.x-=p*.5:m===yi.RIGHT&&(u.x-=p);let x=i.get(t.verticalOrigin,On.CENTER);x===On.TOP?u.y+=_:x===On.CENTER&&(u.y+=_*.5);let b=n.createElement("hotSpot");b.setAttribute("x",-u.x),b.setAttribute("y",u.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),r.appendChild(b)}let f=i.get(t.rotation),h=i.get(t.alignedAxis);return l(f)&&d.equals(d.UNIT_Z,h)&&(f=P.toDegrees(-f),f===0&&(f=360),r.appendChild(fn(n,"heading",f))),r}function zot(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(fn(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let h=t.positions,p=s.get(h),_=fn(o,"coordinates",sb(p,r));a.appendChild(_);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(fn(o,"drawOrder",m,th)),n.push(a);let x=o.createElement("LineStyle"),b=s.get(t.width);l(b)&&x.appendChild(fn(o,"width",b)),bY(e,t.material,x),i.push(x)}function Hot(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],u=[se.northeast,se.southeast,se.southwest,se.northwest];for(let _=0;_<4;++_)u[_](a,Xc),c.push(`${P.toDegrees(Xc.longitude)},${P.toDegrees(Xc.latitude)},${r}`);let f=fn(i,"coordinates",c.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),h.appendChild(p),[h]}function cge(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)fe.fromCartesian(t[f],r,Xc),s.push(`${P.toDegrees(Xc.longitude)},${P.toDegrees(Xc.latitude)},${i?Xc.height:n}`);let c=fn(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function Got(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,h=i.createElement("outerBoundaryIs");h.appendChild(cge(e,f,r,s)),a.push(h);let p=u.holes;if(l(p)){let _=p.length;for(let m=0;m<_;++m){let x=i.createElement("innerBoundaryIs");x.appendChild(cge(e,p[m].positions,r,s)),a.push(x)}}return a}function lge(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof kh;if(a&&s.getMaterialType(t.material)==="Image"){Wot(e,t,o);return}let c=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(fn(r,"extrude",!0));let f=a?Hot(e,t,u):Got(e,t,u),h=f.length;for(let b=0;b<h;++b)c.appendChild(f[b]);let p=r.createElement("altitudeMode");p.appendChild(cb(e,t.heightReference)),c.appendChild(p),n.push(c);let _=r.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&_.appendChild(fn(r,"fill",m)),bY(e,t.material,_);let x=s.get(t.outline,!1);if(x){_.appendChild(fn(r,"outline",x));let b=r.createElement("LineStyle"),T=s.get(t.outlineWidth,1);b.appendChild(fn(r,"width",T));let C=s.getColor(t.outlineColor,z.BLACK);b.appendChild(fn(r,"color",C)),b.appendChild(fn(r,"colorMode","normal")),i.push(b)}i.push(_)}function Wot(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(cb(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(fn(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(fn(i,"north",P.toDegrees(u.north))),f.appendChild(fn(i,"south",P.toDegrees(u.south))),f.appendChild(fn(i,"east",P.toDegrees(u.east))),f.appendChild(fn(i,"west",P.toDegrees(u.west))),s.appendChild(f);let h=o.get(t.material),p=r.texture(h.image),_=i.createElement("Icon");_.appendChild(fn(i,"href",p)),s.appendChild(_);let m=h.color;l(m)&&s.appendChild(fn(i,"color",ab(h.color))),n.push(s)}function gge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(fn(n,"x",s)),u.appendChild(fn(n,"y",s)),u.appendChild(fn(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(fn(n,"href",c)),r.appendChild(a),r}function jot(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){hge(e,t,n,i,o);return}let u=gge(e,n),f=r.createElement("altitudeMode");f.appendChild(cb(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,Ml),fe.fromCartesian(Ml,s,Xc);let h=r.createElement("Location");h.appendChild(fn(r,"longitude",P.toDegrees(Xc.longitude))),h.appendChild(fn(r,"latitude",P.toDegrees(Xc.latitude))),h.appendChild(fn(r,"altitude",Xc.height)),u.appendChild(h),i.push(u)}function bY(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,u;switch(a){case"Image":s=ab(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=ab(r.color);break;case"PolylineOutline":s=ab(r.color),c=ab(r.outlineColor),u=r.outlineWidth,n.appendChild(fn(i,"outerColor",c,th)),n.appendChild(fn(i,"outerWidth",u,th));break;case"Stripe":s=ab(r.oddColor);break}l(s)&&(n.appendChild(fn(i,"color",s)),n.appendChild(fn(i,"colorMode","normal")))}function cb(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,Ye.NONE),r;switch(o){case Ye.NONE:r=n.createTextNode("absolute");break;case Ye.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case Ye.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function sb(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)fe.fromCartesian(e[o],t,Xc),i.push(`${P.toDegrees(Xc.longitude)},${P.toDegrees(Xc.latitude)},${Xc.height}`);return i.join(" ")}function fn(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function ab(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var _ge=xY;function qot(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=` -${o}`),t}var ug=qot;async function Yot(e,t,n,i){return l(i)||(i=!1),Zot(e,t,n,i)}function Xot(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(xge(i)):r=o.then(xge(i)).catch($ot(i)),e.shift(),t.push(r),!0}function Kot(e){return new Promise(function(t){setTimeout(t,e)})}function TY(e,t,n){return e.length?Xot(e,t,n)?TY(e,t,n):Kot(100).then(()=>TY(e,t,n)):Promise.resolve()}function Zot(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let h={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[f]=h,s.push(h)}a[f].positions.push(n[r])}let c=[];return TY(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function yge(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function xge(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!yge(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];yge(s,i,n)}}):Promise.resolve()}}function $ot(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var hU=Yot;var CY=new U;async function bge(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=r.computeMaximumLevelAtPosition(u);if(o[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,CY);let p=e.loadTileDataAvailability(CY.x,CY.y,1);l(p)&&s.push(p)}let h=i[f];l(h)||(i[f]=h=[]),h.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return hU(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];r.computeMaximumLevelAtPosition(u)!==o[c]&&a.push(u)}return a.length>0&&await bge(e,a,n),t}var _E=bge;async function AY(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ne.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===ne.SCENE2D)return r;let c=[se.center(e),se.southeast(e),se.southwest(e),se.northeast(e),se.northwest(e)],u=await AY._sampleTerrainMostDetailed(n,c),f=!1,h=u.reduce(function(_,m){return l(m.height)?(f=!0,Math.max(m.height,_)):_},-Number.MAX_VALUE),p=r;return f&&(p.height+=h),p}AY._sampleTerrainMostDetailed=_E;var yE=AY;var Qot={NONE:0,LERC:1},nh=Object.freeze(Qot);var Jot={NONE:0,BITS12:1},fa=Object.freeze(Jot);var lb=new d,ert=new d,Gf=new U,mU=new F,trt=new F,nrt=Math.pow(2,12);function sc(e,t,n,i,o,r,s,a,c,u){let f=fa.NONE,h,p;if(l(t)&&l(n)&&l(i)&&l(o)){let _=t.minimum,m=t.maximum,x=d.subtract(m,_,ert),b=i-n;Math.max(d.maximumComponent(x),b)<nrt-1?f=fa.BITS12:f=fa.NONE,h=F.inverseTransformation(o,new F);let C=d.negate(_,lb);F.multiply(F.fromTranslation(C,mU),h,h);let A=lb;A.x=1/x.x,A.y=1/x.y,A.z=1/x.z,F.multiply(F.fromScale(A,mU),h,h),p=F.clone(o),F.setTranslation(p,d.ZERO,p),o=F.clone(o,new F);let S=F.fromTranslation(_,mU),v=F.fromScale(x,trt),D=F.multiply(S,v,mU);F.multiply(o,D,o),F.multiply(p,D,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=d.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(u,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}sc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,u=i.y;if(this.quantization===fa.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,lb),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,h=P.clamp((o-this.minimumHeight)/f,0,1);U.fromElements(n.x,n.y,Gf);let p=Ln.compressTextureCoordinates(Gf);U.fromElements(n.z,h,Gf);let _=Ln.compressTextureCoordinates(Gf);U.fromElements(c,u,Gf);let m=Ln.compressTextureCoordinates(Gf);if(e[t++]=p,e[t++]=_,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,Gf);let x=Ln.compressTextureCoordinates(Gf);e[t++]=x}}else d.subtract(n,this.center,lb),e[t++]=lb.x,e[t++]=lb.y,e[t++]=lb.z,e[t++]=o,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Ln.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var irt=new d,Tge=new d;sc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let f=0;f<i;f++){let h=s*i+f,p=s*r+f;t[p]=e[h]}let a=this.decodePosition(t,s,irt),c=n.geodeticSurfaceNormal(a,Tge),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};sc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};sc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new d),t*=this.stride,this.quantization===fa.BITS12){let i=Ln.decompressTextureCoordinates(e[t],Gf);n.x=i.x,n.y=i.y;let o=Ln.decompressTextureCoordinates(e[t+1],Gf);return n.z=o.x,F.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],d.add(n,this.center,n)};sc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,Tge),a=this.decodeHeight(e,t),c=Dr.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};sc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===fa.BITS12?Ln.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};sc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===fa.BITS12?Ln.decompressTextureCoordinates(e[t+1],Gf).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};sc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===fa.BITS12?Ln.decompressTextureCoordinates(e[t+3],Gf).x:e[t+6]};sc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return U.fromElements(o,r,n)};sc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};sc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case fa.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var pU={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},gU={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};sc.prototype.getAttributes=function(e){let t=X.FLOAT,n=X.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===fa.NONE){s(pU.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(pU.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(pU.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(gU.compressed0,a?4:3),c&&s(gU.compressed1,1),this.hasGeodeticSurfaceNormals&&s(gU.geodeticSurfaceNormal,3)}return r};sc.prototype.getAttributeLocations=function(){return this.quantization===fa.NONE?pU:gU};sc.clone=function(e,t){if(l(e))return l(t)||(t=new sc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=d.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Kc=sc;var Pm={};Pm.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var EY=new d,ort=new F,rrt=new d,srt=new d;Pm.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,u=e.width,f=e.height,h=e.skirtHeight,p=h>0,_=y(e.isGeographic,!0),m=y(e.ellipsoid,ee.default),x=1/m.maximumRadius,b=se.clone(e.nativeRectangle),T=se.clone(e.rectangle),C,A,S,v;l(T)?(C=T.west,A=T.south,S=T.east,v=T.north):_?(C=a(b.west),A=a(b.south),S=a(b.east),v=a(b.north)):(C=b.west*x,A=s-2*o(r(-b.south*x)),S=b.east*x,v=s-2*o(r(-b.north*x)));let D=e.relativeToCenter,O=l(D);D=O?D:d.ZERO;let R=y(e.includeWebMercatorT,!1),M=y(e.exaggeration,1),L=y(e.exaggerationRelativeHeight,0),E=M!==1,w=y(e.structure,Pm.DEFAULT_STRUCTURE),I=y(w.heightScale,Pm.DEFAULT_STRUCTURE.heightScale),N=y(w.heightOffset,Pm.DEFAULT_STRUCTURE.heightOffset),B=y(w.elementsPerHeight,Pm.DEFAULT_STRUCTURE.elementsPerHeight),H=y(w.stride,Pm.DEFAULT_STRUCTURE.stride),V=y(w.elementMultiplier,Pm.DEFAULT_STRUCTURE.elementMultiplier),G=y(w.isBigEndian,Pm.DEFAULT_STRUCTURE.isBigEndian),k=se.computeWidth(b),W=se.computeHeight(b),Y=k/(u-1),J=W/(f-1);_||(k*=x,W*=x);let j=m.radiiSquared,K=j.x,Q=j.y,de=j.z,ye=65536,ce=-65536,ge=Mt.eastNorthUpToFixedFrame(D,m),xe=F.inverseTransformation(ge,ort),De,Ae;R&&(De=Oi.geodeticLatitudeToMercatorAngle(A),Ae=1/(Oi.geodeticLatitudeToMercatorAngle(v)-De));let ke=rrt;ke.x=Number.POSITIVE_INFINITY,ke.y=Number.POSITIVE_INFINITY,ke.z=Number.POSITIVE_INFINITY;let ze=srt;ze.x=Number.NEGATIVE_INFINITY,ze.y=Number.NEGATIVE_INFINITY,ze.z=Number.NEGATIVE_INFINITY;let et=Number.POSITIVE_INFINITY,St=u*f,mt=h>0?u*2+f*2:0,Be=St+mt,Yt=new Array(Be),Ct=new Array(Be),ut=new Array(Be),Jt=R?new Array(Be):[],Ce=E?new Array(Be):[],Te=0,it=f,Vi=0,ft=u;p&&(--Te,++it,--Vi,++ft);let mo=1e-5;for(let Xe=Te;Xe<it;++Xe){let ht=Xe;ht<0&&(ht=0),ht>=f&&(ht=f-1);let Gt=b.north-J*ht;_?Gt=a(Gt):Gt=s-2*o(r(-Gt*x));let _n=(Gt-A)/(v-A);_n=P.clamp(_n,0,1);let Eo=Xe===Te,yo=Xe===it-1;h>0&&(Eo?Gt+=mo*W:yo&&(Gt-=mo*W));let La=t(Gt),Na=n(Gt),gi=de*Na,ui;R&&(ui=(Oi.geodeticLatitudeToMercatorAngle(Gt)-De)*Ae);for(let Ys=Vi;Ys<ft;++Ys){let kr=Ys;kr<0&&(kr=0),kr>=u&&(kr=u-1);let il=ht*(u*H)+kr*H,po;if(B===1)po=c[il];else{po=0;let Po;if(G)for(Po=0;Po<B;++Po)po=po*V+c[il+Po];else for(Po=B-1;Po>=0;--Po)po=po*V+c[il+Po]}po=po*I+N,ce=Math.max(ce,po),ye=Math.min(ye,po);let Ar=b.west+Y*kr;_?Ar=a(Ar):Ar=Ar*x;let Km=(Ar-C)/(S-C);Km=P.clamp(Km,0,1);let Vr=ht*u+kr;if(h>0){let Po=Ys===Vi,ln=Ys===ft-1,Ee=Eo||yo||Po||ln;if((Eo||yo)&&(Po||ln))continue;Ee&&(po-=h,Po?(Vr=St+(f-ht-1),Ar-=mo*k):yo?Vr=St+f+(u-kr-1):ln?(Vr=St+f+u+ht,Ar+=mo*k):Eo&&(Vr=St+f+u+f+kr))}let Vu=La*t(Ar),Fa=La*n(Ar),b0=K*Vu,_a=Q*Fa,_c=1/i(b0*Vu+_a*Fa+gi*Na),es=b0*_c,Uu=_a*_c,zu=gi*_c,Hu=new d;Hu.x=es+Vu*po,Hu.y=Uu+Fa*po,Hu.z=zu+Na*po,F.multiplyByPoint(xe,Hu,EY),d.minimumByComponent(EY,ke,ke),d.maximumByComponent(EY,ze,ze),et=Math.min(et,po),Yt[Vr]=Hu,ut[Vr]=new U(Km,_n),Ct[Vr]=po,R&&(Jt[Vr]=ui),E&&(Ce[Vr]=m.geodeticSurfaceNormal(Hu))}}let Ho=ae.fromPoints(Yt),Ma;l(T)&&(Ma=wn.fromRectangle(T,ye,ce,m));let Cr;O&&(Cr=new iy(m).computeHorizonCullingPointPossiblyUnderEllipsoid(D,Yt,ye));let hs=new G0(ke,ze,D),Le=new Kc(D,hs,et,ce,ge,!1,R,E,M,L),ot=new Float32Array(Be*Le.stride),je=0;for(let Xe=0;Xe<Be;++Xe)je=Le.encode(ot,je,Yt[Xe],ut[Xe],Ct[Xe],void 0,Jt[Xe],Ce[Xe]);return{vertices:ot,maximumHeight:ce,minimumHeight:ye,encoding:Le,boundingSphere3D:Ho,orientedBoundingBox:Ma,occludeePointInScaledSpace:Cr}};var bI=Pm;function Vy(){he.throwInstantiationError()}Object.defineProperties(Vy.prototype,{credits:{get:he.throwInstantiationError},waterMask:{get:he.throwInstantiationError}});Vy.prototype.interpolateHeight=he.throwInstantiationError;Vy.prototype.isChildAvailable=he.throwInstantiationError;Vy.prototype.createMesh=he.throwInstantiationError;Vy.prototype.upsample=he.throwInstantiationError;Vy.prototype.wasCreatedByUpsampling=he.throwInstantiationError;Vy.maximumAsynchronousTasks=5;var Rm=Vy;function art(e,t,n,i,o,r,s,a,c,u,f,h,p,_,m,x){this.center=e,this.vertices=t,this.stride=y(u,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=f,this.encoding=h,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=_,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=x}var ih=art;function Zc(){he.throwInstantiationError()}Object.defineProperties(Zc.prototype,{errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},hasWaterMask:{get:he.throwInstantiationError},hasVertexNormals:{get:he.throwInstantiationError},availability:{get:he.throwInstantiationError}});var Cge=[];Zc.getRegularGridIndices=function(e,t){let n=Cge[e];l(n)||(Cge[e]=n=[]);let i=n[t];return l(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),vge(e,t,i,0)),i};var Age=[];Zc.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Age[e];l(n)||(Age[e]=n=[]);let i=n[t];if(!l(i)){let o=Zc.getRegularGridIndices(e,t),r=Sge(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var Ege=[];Zc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Ege[e];l(n)||(Ege[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,u=r+a,f=Sge(e,t),h=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,_=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,x=Ne.createTypedArray(c,u);vge(e,t,x,0),Zc.addSkirtIndices(h,p,_,m,o,x,r),i=n[t]={indices:x,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:_,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};Zc.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=_U(e,a,r,s),a+=e.length,s=_U(t,a,r,s),a+=t.length,s=_U(n,a,r,s),a+=n.length,_U(i,a,r,s)};function Sge(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function vge(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function _U(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}Zc.heightmapTerrainQuality=.25;Zc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Zc.heightmapTerrainQuality/(t*n)};Zc.prototype.requestTileGeometry=he.throwInstantiationError;Zc.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;Zc.prototype.getTileDataAvailable=he.throwInstantiationError;Zc.prototype.loadTileDataAvailability=he.throwInstantiationError;var ls=Zc;function fg(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,nh.NONE);let t=bI.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===nh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(fg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var wge="createVerticesFromHeightmap",crt=new _i(wge),lrt=new _i(wge,Rm.maximumAsynchronousTasks);fg.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),h=c.cartographicToCartesian(se.center(f)),p=this._structure,m=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let b=(a?lrt:crt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:h,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ii,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(b))return;let T=this;return Promise.resolve(b).then(function(C){let A;T._skirtHeight>0?A=ls.getRegularGridAndSkirtIndicesAndEdgeIndices(C.gridWidth,C.gridHeight):A=ls.getRegularGridIndicesAndEdgeIndices(C.gridWidth,C.gridHeight);let S=C.gridWidth*C.gridHeight;return T._mesh=new ih(h,new Float32Array(C.vertices),A.indices,A.indexCountWithoutSkirts,S,C.minimumHeight,C.maximumHeight,ae.clone(C.boundingSphere3D),d.clone(C.occludeePointInScaledSpace),C.numberOfAttributes,wn.clone(C.orientedBoundingBox),Kc.clone(C.encoding),A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.northIndicesWestToEast),T._buffer=void 0,T._mesh})};fg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(se.center(u)),h=this._structure,_=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(_*4,1e3);let m=bI.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ii,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=ls.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=ls.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=m.gridWidth*m.gridHeight;return this._mesh=new ih(f,m.vertices,x.indices,x.indexCountWithoutSkirts,b,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};fg.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,h=r.heightScale,p=l(this._mesh),_=this._encoding===nh.LERC;if(!p&&_)return;let x;if(p){let b=this._mesh.vertices,T=this._mesh.encoding;x=Dge(b,T,f,h,e,i,o,t,n)}else x=urt(this._buffer,a,c,s,u,e,i,o,t,n),x=x*h+f;return x};fg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,h=f.stride,p=new this._bufferType(c*u*h),_=a.vertices,m=a.encoding,x=e.tileXYToRectangle(t,n,i),b=e.tileXYToRectangle(o,r,s),T=f.heightOffset,C=f.heightScale,A=f.elementsPerHeight,S=f.elementMultiplier,v=f.isBigEndian,D=Math.pow(S,A-1);for(let O=0;O<u;++O){let R=P.lerp(b.north,b.south,O/(u-1));for(let M=0;M<c;++M){let L=P.lerp(b.west,b.east,M/(c-1)),g=Dge(_,m,T,C,x,c,u,L,R);g=g<f.lowestEncodedHeight?f.lowestEncodedHeight:g,g=g>f.highestEncodedHeight?f.highestEncodedHeight:g,frt(p,A,S,D,h,v,O*c+M,g)}}return Promise.resolve(new fg({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};fg.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};fg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function urt(e,t,n,i,o,r,s,a,c,u){let f=(c-r.west)*(s-1)/(r.east-r.west),h=(u-r.south)*(a-1)/(r.north-r.south),p=f|0,_=p+1;_>=s&&(_=s-1,p=s-2);let m=h|0,x=m+1;x>=a&&(x=a-1,m=a-2);let b=f-p,T=h-m;m=a-1-m,x=a-1-x;let C=yU(e,t,n,i,o,m*s+p),A=yU(e,t,n,i,o,m*s+_),S=yU(e,t,n,i,o,x*s+p),v=yU(e,t,n,i,o,x*s+_);return Ige(b,T,C,A,S,v)}function Dge(e,t,n,i,o,r,s,a,c){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(s-1)/(o.north-o.south),h=u|0,p=h+1;p>=r&&(p=r-1,h=r-2);let _=f|0,m=_+1;m>=s&&(m=s-1,_=s-2);let x=u-h,b=f-_;_=s-1-_,m=s-1-m;let T=(t.decodeHeight(e,_*r+h)-n)/i,C=(t.decodeHeight(e,_*r+p)-n)/i,A=(t.decodeHeight(e,m*r+h)-n)/i,S=(t.decodeHeight(e,m*r+p)-n)/i;return Ige(x,b,T,C,A,S)}function Ige(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function yU(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function frt(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var ac=fg;function xE(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Xi({ellipsoid:y(e.ellipsoid,ee.default)})),this._levelZeroMaximumGeometricError=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new me}Object.defineProperties(xE.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});xE.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new ac({buffer:new Uint8Array(16*16),width:16,height:16}))};xE.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};xE.prototype.getTileDataAvailable=function(e,t,n){};xE.prototype.loadTileDataAvailability=function(e,t,n){};var dg=xE;var drt=new U;function hrt(e,t){let n=e.unionClippingRegions,i=e.length,o=bs.useFloatTexture(t),r=bs.getTextureResolution(e,t,drt),s=r.x,a=r.y,c=o?grt(s,a):_rt(s,a);return c+=` -`,c+=n?mrt(i):prt(i),c}function mrt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +`;var grt=new U;function _rt(e,t){let n=e.unionClippingRegions,i=e.length,o=bs.useFloatTexture(t),r=bs.getTextureResolution(e,t,grt),s=r.x,a=r.y,c=o?brt(s,a):Trt(s,a);return c+=` +`,c+=n?yrt(i):xrt(i),c}function yrt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { vec4 position = czm_windowToEyeCoordinates(fragCoord); vec3 clipNormal = vec3(0.0); @@ -12452,7 +10690,7 @@ ${o}`),t}var ug=qot;async function Yot(e,t,n,i){return l(i)||(i=!1),Zot(e,t,n,i) } return clipAmount; } -`}function prt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +`}function xrt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { bool clipped = true; vec4 position = czm_windowToEyeCoordinates(fragCoord); @@ -12475,7 +10713,7 @@ ${o}`),t}var ug=qot;async function Yot(e,t,n,i){return l(i)||(i=!1),Zot(e,t,n,i) } return clipAmount; } -`}function grt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`}function brt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int pixY = clippingPlaneNumber / ${e}; int pixX = clippingPlaneNumber - (pixY * ${e}); @@ -12484,7 +10722,7 @@ ${o}`),t}var ug=qot;async function Yot(e,t,n,i){return l(i)||(i=!1),Zot(e,t,n,i) vec4 plane = texture(packedClippingPlanes, vec2(u, v)); return czm_transformPlane(plane, transform); } -`}function _rt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`}function Trt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int clippingPlaneStartIndex = clippingPlaneNumber * 2; int pixY = clippingPlaneStartIndex / ${e}; @@ -12498,23 +10736,23 @@ ${o}`),t}var ug=qot;async function Yot(e,t,n,i){return l(i)||(i=!1),Zot(e,t,n,i) plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v))); return czm_transformPlane(plane, transform); } -`}var Uy=hrt;function yrt(e,t,n,i,o,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o,this.clippingPolygonShaderState=r}function SY(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function xrt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case ne.SCENE3D:o=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:o=n;break;case ne.MORPHING:o=i;break}return o}function brt(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) { +`}var Uy=_rt;function Crt(e,t,n,i,o,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o,this.clippingPolygonShaderState=r}function vY(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function Art(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case ne.SCENE3D:o=t;break;case ne.SCENE2D:case ne.COLUMBUS_VIEW:o=n;break;case ne.MORPHING:o=i;break}return o}function Ert(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) { czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex); }`:`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) { - }`}function Trt(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) { + }`}function Srt(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) { return czm_unpackClippingExtents(extentsTexture, index); }`:`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) { return vec4(); - }`}function Crt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}SY.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,_=e.showReflectiveOcean,m=e.showOceanWaves,x=e.enableLighting,b=e.dynamicAtmosphereLighting,T=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,A=e.perFragmentGroundAtmosphere,S=e.hasVertexNormals,v=e.useWebMercatorProjection,D=e.enableFog,O=e.enableClippingPlanes,R=e.clippingPlanes,M=e.enableClippingPolygons,L=e.clippingPolygons,g=e.clippedByBoundaries,E=e.hasImageryLayerCutout,w=e.colorCorrect,I=e.highlightFillTile,N=e.colorToAlpha,B=e.hasGeodeticSurfaceNormals,H=e.hasExaggeration,V=e.showUndergroundColor,G=e.translucent,k=0,W="",J=n.renderedMesh.encoding;J.quantization===fa.BITS12&&(k=1,W="QUANTIZATION_BITS12");let K=0,Q="";g&&(K=1,Q="TILE_LIMIT_RECTANGLE");let de=0,ye="";E&&(de=1,ye="APPLY_IMAGERY_CUTOUT");let ce=t.mode,ge=ce|o<<2|r<<3|s<<4|a<<5|c<<6|u<<7|p<<8|_<<9|m<<10|x<<11|b<<12|T<<13|C<<14|A<<15|S<<16|v<<17|D<<18|k<<19|h<<20|O<<21|M<<22|K<<23|de<<24|w<<25|I<<26|N<<27|B<<28|H<<29|V<<30|G<<31|f<<32,xe=0;l(R)&&R.length>0&&(xe=O?R.clippingPlanesState:0);let De=0;l(L)&&L.length>0&&(De=M?L.clippingPolygonsState:0);let Ae=n.surfaceShader;if(l(Ae)&&Ae.numberOfDayTextures===i&&Ae.flags===ge&&Ae.material===this.material&&Ae.clippingShaderState===xe&&Ae.clippingPolygonShaderState===De)return Ae.shaderProgram;let ke=this._shadersByTexturesFlags[i];if(l(ke)||(ke=this._shadersByTexturesFlags[i]=[]),Ae=ke[ge],!l(Ae)||Ae.material!==this.material||Ae.clippingShaderState!==xe||Ae.clippingPolygonShaderState!==De){let ze=this.baseVertexShaderSource.clone(),et=this.baseFragmentShaderSource.clone();xe!==0&&et.sources.unshift(Uy(R,t.context)),De!==0&&(et.sources.unshift(brt(t.context)),ze.sources.unshift(Trt(t.context))),ze.defines.push(W),et.defines.push(`TEXTURE_UNITS ${i}`,Q,ye),o&&et.defines.push("APPLY_BRIGHTNESS"),r&&et.defines.push("APPLY_CONTRAST"),s&&et.defines.push("APPLY_HUE"),a&&et.defines.push("APPLY_SATURATION"),c&&et.defines.push("APPLY_GAMMA"),u&&et.defines.push("APPLY_ALPHA"),f&&et.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&et.defines.push("HAS_WATER_MASK"),_&&(et.defines.push("SHOW_REFLECTIVE_OCEAN"),ze.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&et.defines.push("SHOW_OCEAN_WAVES"),N&&et.defines.push("APPLY_COLOR_TO_ALPHA"),V&&(ze.defines.push("UNDERGROUND_COLOR"),et.defines.push("UNDERGROUND_COLOR")),G&&(ze.defines.push("TRANSLUCENT"),et.defines.push("TRANSLUCENT")),x&&(S?(ze.defines.push("ENABLE_VERTEX_LIGHTING"),et.defines.push("ENABLE_VERTEX_LIGHTING")):(ze.defines.push("ENABLE_DAYNIGHT_SHADING"),et.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(ze.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),et.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),T&&(ze.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),et.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(ze.defines.push("GROUND_ATMOSPHERE"),et.defines.push("GROUND_ATMOSPHERE"),A&&(ze.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),et.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),ze.defines.push("INCLUDE_WEB_MERCATOR_Y"),et.defines.push("INCLUDE_WEB_MERCATOR_Y"),D&&(ze.defines.push("FOG"),et.defines.push("FOG")),h&&et.defines.push("APPLY_SPLIT"),O&&et.defines.push("ENABLE_CLIPPING_PLANES"),M&&(et.defines.push("ENABLE_CLIPPING_POLYGONS"),ze.defines.push("ENABLE_CLIPPING_POLYGONS"),L.inverse&&et.defines.push("CLIPPING_INVERSE"),et.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`),ze.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`)),w&&et.defines.push("COLOR_CORRECT"),I&&et.defines.push("HIGHLIGHT_FILL_TILE"),B&&ze.defines.push("GEODETIC_SURFACE_NORMALS"),H&&ze.defines.push("EXAGGERATION");let St=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) + }`}function vrt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}vY.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,_=e.showReflectiveOcean,m=e.showOceanWaves,x=e.enableLighting,b=e.dynamicAtmosphereLighting,T=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,A=e.perFragmentGroundAtmosphere,S=e.hasVertexNormals,v=e.useWebMercatorProjection,D=e.enableFog,O=e.enableClippingPlanes,R=e.clippingPlanes,M=e.enableClippingPolygons,L=e.clippingPolygons,g=e.clippedByBoundaries,E=e.hasImageryLayerCutout,w=e.colorCorrect,I=e.highlightFillTile,N=e.colorToAlpha,B=e.hasGeodeticSurfaceNormals,H=e.hasExaggeration,V=e.showUndergroundColor,G=e.translucent,k=0,W="",J=n.renderedMesh.encoding;J.quantization===ha.BITS12&&(k=1,W="QUANTIZATION_BITS12");let K=0,Q="";g&&(K=1,Q="TILE_LIMIT_RECTANGLE");let de=0,xe="";E&&(de=1,xe="APPLY_IMAGERY_CUTOUT");let ce=t.mode,_e=ce|o<<2|r<<3|s<<4|a<<5|c<<6|u<<7|p<<8|_<<9|m<<10|x<<11|b<<12|T<<13|C<<14|A<<15|S<<16|v<<17|D<<18|k<<19|h<<20|O<<21|M<<22|K<<23|de<<24|w<<25|I<<26|N<<27|B<<28|H<<29|V<<30|G<<31|f<<32,be=0;l(R)&&R.length>0&&(be=O?R.clippingPlanesState:0);let De=0;l(L)&&L.length>0&&(De=M?L.clippingPolygonsState:0);let Ae=n.surfaceShader;if(l(Ae)&&Ae.numberOfDayTextures===i&&Ae.flags===_e&&Ae.material===this.material&&Ae.clippingShaderState===be&&Ae.clippingPolygonShaderState===De)return Ae.shaderProgram;let ke=this._shadersByTexturesFlags[i];if(l(ke)||(ke=this._shadersByTexturesFlags[i]=[]),Ae=ke[_e],!l(Ae)||Ae.material!==this.material||Ae.clippingShaderState!==be||Ae.clippingPolygonShaderState!==De){let ze=this.baseVertexShaderSource.clone(),et=this.baseFragmentShaderSource.clone();be!==0&&et.sources.unshift(Uy(R,t.context)),De!==0&&(et.sources.unshift(Ert(t.context)),ze.sources.unshift(Srt(t.context))),ze.defines.push(W),et.defines.push(`TEXTURE_UNITS ${i}`,Q,xe),o&&et.defines.push("APPLY_BRIGHTNESS"),r&&et.defines.push("APPLY_CONTRAST"),s&&et.defines.push("APPLY_HUE"),a&&et.defines.push("APPLY_SATURATION"),c&&et.defines.push("APPLY_GAMMA"),u&&et.defines.push("APPLY_ALPHA"),f&&et.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&et.defines.push("HAS_WATER_MASK"),_&&(et.defines.push("SHOW_REFLECTIVE_OCEAN"),ze.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&et.defines.push("SHOW_OCEAN_WAVES"),N&&et.defines.push("APPLY_COLOR_TO_ALPHA"),V&&(ze.defines.push("UNDERGROUND_COLOR"),et.defines.push("UNDERGROUND_COLOR")),G&&(ze.defines.push("TRANSLUCENT"),et.defines.push("TRANSLUCENT")),x&&(S?(ze.defines.push("ENABLE_VERTEX_LIGHTING"),et.defines.push("ENABLE_VERTEX_LIGHTING")):(ze.defines.push("ENABLE_DAYNIGHT_SHADING"),et.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(ze.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),et.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),T&&(ze.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),et.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(ze.defines.push("GROUND_ATMOSPHERE"),et.defines.push("GROUND_ATMOSPHERE"),A&&(ze.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),et.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),ze.defines.push("INCLUDE_WEB_MERCATOR_Y"),et.defines.push("INCLUDE_WEB_MERCATOR_Y"),D&&(ze.defines.push("FOG"),et.defines.push("FOG")),h&&et.defines.push("APPLY_SPLIT"),O&&et.defines.push("ENABLE_CLIPPING_PLANES"),M&&(et.defines.push("ENABLE_CLIPPING_POLYGONS"),ze.defines.push("ENABLE_CLIPPING_POLYGONS"),L.inverse&&et.defines.push("CLIPPING_INVERSE"),et.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`),ze.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`)),w&&et.defines.push("COLOR_CORRECT"),I&&et.defines.push("HIGHLIGHT_FILL_TILE"),B&&ze.defines.push("GEODETIC_SURFACE_NORMALS"),H&&ze.defines.push("EXAGGERATION");let Et=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) { vec4 color = initialColor; -`;E&&(St+=` vec4 cutoutAndColorResult; +`;E&&(Et+=` vec4 cutoutAndColorResult; bool texelUnclipped; -`);for(let Be=0;Be<i;++Be)E?St+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Be}]; +`);for(let Be=0;Be<i;++Be)E?Et+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Be}]; texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; cutoutAndColorResult = sampleAndBlend( -`:St+=` color = sampleAndBlend( -`,St+=` color, +`:Et+=` color = sampleAndBlend( +`,Et+=` color, u_dayTextures[${Be}], u_dayTextureUseWebMercatorT[${Be}] ? textureCoordinates.xz : textureCoordinates.xy, u_dayTextureTexCoordsRectangle[${Be}], @@ -12530,9 +10768,261 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, ${h?`u_dayTextureSplit[${Be}]`:"0.0"}, ${N?`u_colorsToAlpha[${Be}]`:"vec4(0.0)"}, nightBlend ); -`,E&&(St+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); -`);St+=` return color; - }`,et.sources.push(St),ze.sources.push(xrt(ce)),ze.sources.push(Crt(v));let mt=en.fromCache({context:t.context,vertexShaderSource:ze,fragmentShaderSource:et,attributeLocations:J.getAttributeLocations()});Ae=ke[ge]=new yrt(i,ge,this.material,mt,xe,De)}return n.surfaceShader=Ae,Ae.shaderProgram};SY.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var xU=SY;var Art={NONE:-1,PARTIAL:0,FULL:1},br=Object.freeze(Art);function bU(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}bU.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new bU(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${ug(i)}`),c};bU.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Io=bU;var Ert={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},si=Object.freeze(Ert);var Srt={START:0,LOADING:1,DONE:2,FAILED:3},da=Object.freeze(Srt);var vrt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},fo=Object.freeze(vrt);function Qo(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new d,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=fo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ae,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(Qo.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===fo.RECEIVING||e===fo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==si.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var wrt=new fe;function vY(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,wrt);s=n.project(c,r),s=d.fromElements(s.z,s.x,s.y,r)}return s}var Drt=new d,Irt=new d,Prt=new d;Qo.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,u=a.length,f=Number.MAX_VALUE;for(let h=0;h<u;h+=3){let p=a[h],_=a[h+1],m=a[h+2],x=vY(c,t,n,s,p,Drt),b=vY(c,t,n,s,_,Irt),T=vY(c,t,n,s,m,Prt),C=Zn.rayTriangleParametric(e,x,b,T,i);l(C)&&C<f&&C>=0&&(f=C)}return f!==Number.MAX_VALUE?pn.getPoint(e,f,o):void 0};Qo.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=fo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};Qo.prototype.freeVertexArray=function(){Qo._freeVertexArray(this.vertexArray),this.vertexArray=void 0,Qo._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};Qo.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new Qo),e.state===da.START&&(Rrt(e,t,n),e.state=da.LOADING)};Qo.processStateMachine=function(e,t,n,i,o,r,s){Qo.initialize(e,n,i);let a=e.data;if(e.state===da.LOADING&&Ort(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===fo.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let h=e._loadedCallbacks,p={};for(let _ in h)h.hasOwnProperty(_)&&(h[_](e)||(p[_]=h[_]));e._loadedCallbacks=p,e.state=da.DONE}c&&(e.renderable=!0)};Qo.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let h=c[u];if(!l(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===si.PLACEHOLDER){let _=h.loadingImagery.imageryLayer;if(_.ready){h.freeResources(),c.splice(u,1),_._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);a=a&&p,s=s||p||l(h.readyImagery),r=r&&l(h.loadingImagery)&&(h.loadingImagery.state===si.FAILED||h.loadingImagery.state===si.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function Pge(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=Kc.clone(s);c.hasGeodeticSurfaceNormals=t,c=Kc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(Qo._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Qo._createVertexArrayForMesh(i.context,o)):(Qo._freeVertexArray(e.vertexArray),e.vertexArray=Qo._createVertexArrayForMesh(i.context,o)),Qo._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}Qo.prototype.addGeodeticSurfaceNormals=function(e,t){Pge(this,!0,e,t)};Qo.prototype.removeGeodeticSurfaceNormals=function(e){Pge(this,!1,void 0,e)};Qo.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let h=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(h,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let h=e.customData,p=h.length;for(let _=0;_<p;_++){let m=h[_];m.level=-1}}}};function Rrt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=fo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Ort(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===fo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||Qo.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===fo.FAILED&&Mrt(s,e,t,n,e.x,e.y,e.level),s.terrainState===fo.UNLOADED&&Lrt(s,n,e.x,e.y,e.level),s.terrainState===fo.RECEIVED&&Frt(s,t,n,e.x,e.y,e.level),s.terrainState===fo.TRANSFORMED&&(Brt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=fo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Vrt(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function Mrt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=da.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,h=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,h,o,r,s);l(p)&&(e.terrainState=fo.RECEIVING,Promise.resolve(p).then(function(_){l(_)&&(e.terrainData=_,e.terrainState=fo.RECEIVED)}).catch(function(){e.terrainState=fo.FAILED}))}function Lrt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=fo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=fo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Kn.CANCELLED){e.terrainData=void 0,e.terrainState=fo.UNLOADED,e.request=void 0;return}e.terrainState=fo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Io.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let c=new nr({throttle:!1,throttleByServer:!0,type:ps.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=fo.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=fo.UNLOADED,e.request=void 0)}a()}var Nrt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Frt(e,t,n,i,o,r){let s=n.tilingScheme,a=Nrt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=fo.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=fo.TRANSFORMED}).catch(function(){e.terrainState=fo.FAILED}))}Qo._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=yt.createVertexBuffer({context:e,typedArray:n,usage:Fe.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=yt.createIndexBuffer({context:e,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ti({context:e,attributes:o,indexBuffer:s})};Qo._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Brt(e,t,n,i,o,r,s){e.vertexArray=Qo._createVertexArrayForMesh(t,e.mesh),e.terrainState=fo.READY,e.fill=e.fill&&e.fill.destroy(s)}function krt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Ot.create({context:e,pixelFormat:tt.LUMINANCE,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new $t({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR,magnificationFilter:di.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Vrt(e,t){let n=t.terrainData.waterMask,i=krt(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Ot.create({context:e,pixelFormat:tt.LUMINANCE,pixelDatatype:Ke.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,oe.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}Qo.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};Qo.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var oh=Qo;function zy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ee.default),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Oi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new U(-i,-i),this._rectangleNortheastInMeters=new U(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new se(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(zy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});zy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};zy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};zy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(se.southwest(e)),o=n.project(se.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new se(i.x,i.y,o.x,o.y)};zy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,h=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=h,i.east=c,i.north=f,i):new se(a,h,c,f)};zy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new U(o.west,o.south)),a=r.unproject(new U(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};zy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!se.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,_=this._rectangleNortheastInMeters.y-h.y,m=p/a|0;m>=o&&(m=o-1);let x=_/u|0;return x>=r&&(x=r-1),l(n)?(n.x=m,n.y=x,n):new U(m,x)};var us=zy;var wY,Rge="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSrZYLHFXe7j_lQcsSJKc8-7rwh0IFSNWLGZErkzXRnYjMjURTz-hGiKMEeAJIZBG7uiYEn0Mt1rrwlJGIpirZQC4iO428519DlO3QC9DnRBqLXGTBhirgoU7-Z2209sy87s49kw6NOC8_Eew6nCLf-pZ883DRPRyAYH7LC8cvRLInud0EdndtUFa4y83TamrA.AT1_ahjrWDrq",bE={};bE.defaultAccessToken=Rge;bE.defaultWorldImageryServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});bE.defaultWorldHillshadeServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});bE.defaultWorldOceanServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});bE.getDefaultTokenCredit=function(e){if(e===Rge){if(!l(wY)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';wY=new At(t,!0)}return wY}};var Wf=bE;function DY(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Se.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=bh(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,h=u.length;a&&f<h;++f){let p=u[f],_=p.x*4+p.y*c;s[_+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}DY.prototype.isReady=function(){return this._isReady};DY.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=bh(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var TU=DY;function IY(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}IY.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};IY.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Om=IY;function TE(){he.throwInstantiationError()}Object.defineProperties(TE.prototype,{rectangle:{get:he.throwInstantiationError},tileWidth:{get:he.throwInstantiationError},tileHeight:{get:he.throwInstantiationError},maximumLevel:{get:he.throwInstantiationError},minimumLevel:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},tileDiscardPolicy:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},proxy:{get:he.throwInstantiationError},hasAlphaChannel:{get:he.throwInstantiationError}});TE.prototype.getTileCredits=function(e,t,n){he.throwInstantiationError()};TE.prototype.requestImage=function(e,t,n,i){he.throwInstantiationError()};TE.prototype.pickFeatures=function(e,t,n,i,o){he.throwInstantiationError()};var Urt=/\.ktx2$/i;TE.loadImage=function(e,t){let n=Se.createIfNeeded(t);return Urt.test(n.url)?Wl(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Ll=TE;var zrt={SATELLITE:1,OCEANS:2,HILLSHADE:3},Mm=Object.freeze(zrt);function Oge(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new Xi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new At(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}Oge.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new TU({missingImageUrl:Mge(e,0,0,this.maximumLevel).url,pixelsToCheck:[new U(0,0),new U(200,20),new U(20,200),new U(80,110),new U(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Hrt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new us({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Xi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new re(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Oi,o=e.fullExtent,r=i.unproject(new d(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new d(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new se(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=se.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new re(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new At(e.copyrightText)]:t.credit=new At(e.copyrightText))}function Grt(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new re(n)}async function Wrt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Hrt(i,t)}catch(i){Grt(e,i)}}function Lm(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Xi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new At(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new me}Lm.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case Mm.SATELLITE:{n=y(t.token,Wf.defaultAccessToken),i=Se.createIfNeeded(Wf.defaultWorldImageryServer),i.appendForwardSlash();let r=Wf.getDefaultTokenCredit(n);l(r)&&(o=At.clone(r))}break;case Mm.OCEANS:{n=y(t.token,Wf.defaultAccessToken),i=Se.createIfNeeded(Wf.defaultWorldOceanServer),i.appendForwardSlash();let r=Wf.getDefaultTokenCredit(n);l(r)&&(o=At.clone(r))}break;case Mm.HILLSHADE:{n=y(t.token,Wf.defaultAccessToken),i=Se.createIfNeeded(Wf.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Wf.getDefaultTokenCredit(n);l(r)&&(o=At.clone(r))}break;default:}return Lm.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Mge(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Ii?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(Lm.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Lm.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Lm(t);i._resource=n;let o=new Oge(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await Wrt(n,o),o.build(i),i};Lm.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Lm.prototype.requestImage=function(e,t,n,i){return Ll.loadImage(this,Mge(this,e,t,n,i))};Lm.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ii)s=P.toDegrees(i),a=P.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new fe(i,o,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let _=[],m=p.results;if(!l(m))return _;for(let x=0;x<m.length;++x){let b=m[x],T=new Om;if(T.data=b,T.name=b.value,T.properties=b.attributes,T.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let C=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(C===4326||C===4283)T.position=fe.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(C===102100||C===900913||C===3857){let A=new Oi;T.position=A.unproject(new d(b.geometry.x,b.geometry.y,b.geometry.z))}}_.push(T)}return _})};Lm._metadataCache={};var Hy=Lm;var jrt={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},TI=Object.freeze(jrt);function CI(e){}CI.prototype.isReady=function(){return!0};CI.prototype.shouldDiscardImage=function(e){return CI.EMPTY_IMAGE===e};var CU;Object.defineProperties(CI,{EMPTY_IMAGE:{get:function(){return l(CU)||(CU=new Image,CU.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),CU}}});var AI=CI;function Lge(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}Lge.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof At)break;o.credit=new At(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],u=c.bbox;c.bbox=new se(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}};function qrt(e,t){if(e.resourceSets.length!==1)throw new re("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function Yrt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new re(i)}async function Xrt(e,t,n){let i=e.url,o=vs._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),vs._metadataCache[i]=o);try{let r=await o;return qrt(r,t)}catch(r){Yrt(e,r,n)}}function vs(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,TI.AERIAL),this._mapLayer=e.mapLayer,this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new AI),this._proxy=e.proxy,this._credit=new At(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${vs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new us({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new me}Object.defineProperties(vs.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});vs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,TI.AERIAL),o=Se.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new vs(t);a._resource=o;let c=new Lge(t);return await Xrt(s,c),c.build(a),a};var Krt=new se;vs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Krt);return Qrt(this._attributionList,n,i)};vs.prototype.requestImage=function(e,t,n,i){let o=Ll.loadImage(this,Zrt(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?AI.EMPTY_IMAGE:Promise.reject(r)})};vs.prototype.pickFeatures=function(e,t,n,i,o){};vs.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};vs.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};vs._logoUrl=void 0;Object.defineProperties(vs,{logoUrl:{get:function(){return l(vs._logoUrl)||(vs._logoUrl=nn("Assets/Images/bing_maps_credit.png")),vs._logoUrl},set:function(e){vs._logoUrl=e}}});function Zrt(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:vs.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var $rt=new se;function Qrt(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let h=a[u];if(t>=h.zoomMin&&t<=h.zoomMax){let p=se.intersection(n,h.bbox,$rt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}vs._metadataCache={};var AU=vs;var Nge=/{[^}]+}/g,Fge={x:nst,y:ost,z:ast,s:cst,reverseX:ist,reverseY:rst,reverseZ:sst,westDegrees:lst,southDegrees:ust,eastDegrees:fst,northDegrees:dst,westProjected:hst,southProjected:mst,eastProjected:pst,northProjected:gst,width:_st,height:yst},Jrt=bt(Fge,{i:xst,j:bst,reverseI:Tst,reverseJ:Cst,longitudeDegrees:Est,latitudeDegrees:Sst,longitudeProjected:vst,latitudeProjected:wst,format:Ist});function EI(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new me;let t=Se.createIfNeeded(e.url),n=Se.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new us({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=se.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new At(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=bt(Fge,r),a=bt(Jrt,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(EI.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});EI.prototype.getTileCredits=function(e,t,n){};EI.prototype.requestImage=function(e,t,n,i){return Ll.loadImage(this,est(this,e,t,n,i))};EI.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=tst(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var EU=!1,vu=new se,SU=!1,SI=new se;function est(e,t,n,i,o){EU=!1,SU=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},u=s.match(Nge);return l(u)&&u.forEach(function(f){let h=f.substring(1,f.length-1);l(a[h])&&(c[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var PY=!1,AE=new U,RY=!1;function tst(e,t,n,i,o,r,s){EU=!1,SU=!1,PY=!1,RY=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},h=c.match(Nge);return l(h)&&h.forEach(function(p){let _=p.substring(1,p.length-1);l(u[_])&&(f[_]=u[_](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function EE(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function nst(e,t,n,i){return EE(e,"{x}",t)}function ist(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return EE(e,"{reverseX}",o)}function ost(e,t,n,i){return EE(e,"{y}",n)}function rst(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return EE(e,"{reverseY}",o)}function sst(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return EE(e,"{reverseZ}",r)}function ast(e,t,n,i){return EE(e,"{z}",i)}function cst(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function vU(e,t,n,i){EU||(e.tilingScheme.tileXYToRectangle(t,n,i,vu),vu.west=P.toDegrees(vu.west),vu.south=P.toDegrees(vu.south),vu.east=P.toDegrees(vu.east),vu.north=P.toDegrees(vu.north),EU=!0)}function lst(e,t,n,i){return vU(e,t,n,i),vu.west}function ust(e,t,n,i){return vU(e,t,n,i),vu.south}function fst(e,t,n,i){return vU(e,t,n,i),vu.east}function dst(e,t,n,i){return vU(e,t,n,i),vu.north}function wU(e,t,n,i){SU||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,SI),SU=!0)}function hst(e,t,n,i){return wU(e,t,n,i),SI.west}function mst(e,t,n,i){return wU(e,t,n,i),SI.south}function pst(e,t,n,i){return wU(e,t,n,i),SI.east}function gst(e,t,n,i){return wU(e,t,n,i),SI.north}function _st(e,t,n,i){return e.tileWidth}function yst(e,t,n,i){return e.tileHeight}function xst(e,t,n,i,o,r,s){return DU(e,t,n,i,o,r),AE.x}function bst(e,t,n,i,o,r,s){return DU(e,t,n,i,o,r),AE.y}function Tst(e,t,n,i,o,r,s){return DU(e,t,n,i,o,r),e.tileWidth-AE.x-1}function Cst(e,t,n,i,o,r,s){return DU(e,t,n,i,o,r),e.tileHeight-AE.y-1}var Ast=new se,CE=new d;function DU(e,t,n,i,o,r,s){if(PY)return;OY(e,t,n,i,o,r);let a=CE,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Ast);AE.x=e.tileWidth*(a.x-c.west)/c.width|0,AE.y=e.tileHeight*(c.north-a.y)/c.height|0,PY=!0}function Est(e,t,n,i,o,r,s){return P.toDegrees(o)}function Sst(e,t,n,i,o,r,s){return P.toDegrees(r)}function vst(e,t,n,i,o,r,s){return OY(e,t,n,i,o,r),CE.x}function wst(e,t,n,i,o,r,s){return OY(e,t,n,i,o,r),CE.y}var Dst=new fe;function OY(e,t,n,i,o,r,s){if(!RY){if(e.tilingScheme.projection instanceof Ii)CE.x=P.toDegrees(o),CE.y=P.toDegrees(r);else{let a=Dst;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,CE)}RY=!0}}function Ist(e,t,n,i,o,r,s){return s}var cc=EI;function jf(e){cc.call(this,e)}jf._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return jf._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Jm)return jf._metadataFailure(e,t);throw o}};jf.fromUrl=async function(e,t){let n=Se.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let r=await jf._requestMetadata(t,i,o);return new jf(r)};l(Object.create)&&(jf.prototype=Object.create(cc.prototype),jf.prototype.constructor=jf);function Bge(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function kge(e,t,n){let i=e.positionToTileXY(se.southwest(t),n),o=e.positionToTileXY(se.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}jf._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,h,p=[],_=e.childNodes[0].childNodes;for(let R=0;R<_.length;R++)if(r.test(_.item(R).nodeName))u=_.item(R);else if(a.test(_.item(R).nodeName)){h=_.item(R);let M=_.item(R).childNodes;for(let L=0;L<M.length;L++)s.test(M.item(L).nodeName)&&p.push(M.item(L))}else c.test(_.item(R).nodeName)&&(f=_.item(R));let m;if(!l(h)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Io.reportError(void 0,o,o.errorEvent,m),new re(m);let x=y(t.fileExtension,u.getAttribute("extension")),b=y(t.tileWidth,parseInt(u.getAttribute("width"),10)),T=y(t.tileHeight,parseInt(u.getAttribute("height"),10)),C=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),A=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),S=h.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(S==="geodetic"||S==="global-geodetic")v=new Xi({ellipsoid:t.ellipsoid});else if(S==="mercator"||S==="global-mercator")v=new us({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${S}.`,l(o)&&Io.reportError(void 0,o,o.errorEvent,m),new re(m);let D=se.clone(t.rectangle);if(!l(D)){let R,M,L,g;y(t.flipXY,!1)?(L=new U(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),g=new U(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new U(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),g=new U(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=S==="geodetic"||S==="mercator";if(v.projection instanceof Ii||w)R=fe.fromDegrees(L.x,L.y),M=fe.fromDegrees(g.x,g.y);else{let I=v.projection;R=I.unproject(L),M=I.unproject(g)}D=new se(R.longitude,R.latitude,M.longitude,M.latitude)}return D=Bge(D,v),C=kge(v,D,C),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:v,rectangle:D,tileWidth:b,tileHeight:T,minimumLevel:C,maximumLevel:A,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};jf._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),o=y(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new us({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=Bge(a,s);let c=kge(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var ub=jf;function Vge(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Vge.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Pst(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new re(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new re(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new us({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new re(o)}return!0}function Rst(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new re(i)}async function Ost(e,t,n){try{let i=await e.fetchText();Pst(i,t)}catch(i){Rst(i,e,n)}}function Nl(e){e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new At(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Nl.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new me}Object.defineProperties(Nl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Nl.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=Se.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new Vge(n);s.channel=t,await Ost(r,s);let a=new Nl(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Nl.prototype.getTileCredits=function(e,t,n){};Nl.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Ll.loadImage(this,o)};Nl.prototype.pickFeatures=function(e,t,n,i,o){};Nl._logoUrl=void 0;Object.defineProperties(Nl,{logoUrl:{get:function(){return l(Nl._logoUrl)||(Nl._logoUrl=nn("Assets/Images/google_earth_credit.png")),Nl._logoUrl},set:function(e){Nl._logoUrl=e}}});var IU=Nl;var Mst=/\/$/,Uge=new At('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function SE(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Se.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Mst.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new At(s))):s=Uge,this._resource=i,this._imageryProvider=new cc({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(SE.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});SE.prototype.getTileCredits=function(e,t,n){};SE.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};SE.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};SE._defaultCredit=Uge;var PU=SE;function fb(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,se.MAX_VALUE),n=new Xi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new me;let i=e.credit;typeof i=="string"&&(i=new At(i)),this._credit=i;let o=Se.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(fb.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function Lst(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Io.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return MY(e,n,r);throw l(n)&&(n._hasError=!0),new re(o)}async function MY(e,t,n){try{return await Ll.loadImage(null,e)}catch(i){return Lst(e,i,t,n)}}fb.fromUrl=async function(e,t){let n=Se.createIfNeeded(e),i=await MY(n);t=y(t,y.EMPTY_OBJECT);let o=new fb({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};fb.prototype.getTileCredits=function(e,t,n){};fb.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await MY(this._resource,this);return this._image=o,Io.reportSuccess(this._errorEvent),o}return this._image};fb.prototype.pickFeatures=function(e,t,n,i,o){};var RU=fb;function Nst(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Fst:e==="xml"?n=Ust:(e==="html"||e==="text")&&(n=zge)),this.callback=n}function Fst(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Om;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=fe.fromDegrees(s,a)}t.push(r)}return t}var LY="http://www.mapinfo.com/mxp",Bst="http://www.esri.com/wms",kst="http://www.opengis.net/wfs",Vst="http://www.opengis.net/gml";function Ust(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===LY)return zst(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Bst)return Hst(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===kst)return Gst(e);if(t.localName==="ServiceExceptionReport")throw new re(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Wst(e):jst(e)}function zst(e){let t=[],i=e.documentElement.getElementsByTagNameNS(LY,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(LY,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let h=f.getAttribute("ref"),p=f.textContent.trim();s[h]=p}}let c=new Om;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Hst(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(OU(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(OU(a,i))}}return n}function Gst(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Vst,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};NY(r,s),t.push(OU(r,s))}return t}function Wst(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new re("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};NY(s,a),t.push(OU(s,a))}}return t}function NY(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&NY(o,t)&&(t[o.localName]=o.textContent)}return n}function OU(e,t){let n=new Om;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function jst(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Om;return o.data=e,o.description=n.innerHTML,[o]}var qst=/<body>\s*<\/body>/im,Yst=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Xst=/<title>([\s\S]*)<\/title>/im;function zge(e){if(qst.test(e)||Yst.test(e))return;let t,n=Xst.exec(e);n&&n.length>1&&(t=n[1]);let i=new Om;return i.name=t,i.description=e,i.data=e,[i]}var vE=Nst;function vI(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(vI.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});vI.prototype.getFromCache=function(e,t,n,i){let o=Hge(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};vI.prototype.checkApproachingInterval=function(e,t,n,i){let o=Hge(e,t,n),r=this._tilesRequestedForInterval,s=Gge(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!Wge(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};vI.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=Gge(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=Wge(this,c,r),a||s.push(c)}}};function Hge(e,t,n){return`${e}-${t}-${n}`}function Kst(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Gge(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=Z.secondsDifference(c.stop,i),++a):(s=Z.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function Wge(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=Kst(s),c=new nr({throttle:!1,throttleByServer:!0,type:ps.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(r[s]={promise:u,request:c},!0):!1}var wE=vI;var Zst=[3034,3035,3042,3043,3044],$st=[4471,4559];function rh(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new he("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=Se.createIfNeeded(e.url),n=Se.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(rh.DefaultParameters,!0),n.setQueryParameters(rh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(jge(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(jge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new wE({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return qge(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Oi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!$st.includes(a)||Zst.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Oi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new cc({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Xi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,rh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function qge(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function Qst(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(rh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});rh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};rh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=qge(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};rh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return Qst(this,e,t,n,i,o,s)};rh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});rh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});rh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new vE("json","application/json")),Object.freeze(new vE("xml","text/xml")),Object.freeze(new vE("text","text/html"))]);function jge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var MU=rh;var Jst=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function wI(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Se.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(Jst),this._useKvp=!0;else{let h={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(h),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new us({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new wE({clock:e.clock,times:e.times,requestImageFunction:function(h,p,_,m,x){return Yge(s,h,p,_,m,x)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(se.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(se.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new me;let f=e.credit;this._credit=typeof f=="string"?new At(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function Yge(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),l(u)&&h.setTemplateValues(u),l(f)&&h.setTemplateValues(f);else{let _={};_.tilematrix=a,_.layer=e._layer,_.style=e._style,_.tilerow=n,_.tilecol=t,_.tilematrixset=e._tileMatrixSetID,_.format=e._format,l(u)&&(_=bt(_,u)),l(f)&&(_=bt(_,f)),p={s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({queryParameters:_,request:o}),h.setTemplateValues(p)}return Ll.loadImage(e,h)}Object.defineProperties(wI.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}}});wI.prototype.getTileCredits=function(e,t,n){};wI.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Yge(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};wI.prototype.pickFeatures=function(e,t,n,i,o){};var LU=wI;var eat={ARCGIS_MAPSERVER:Hy.fromUrl,BING:async(e,t)=>AU.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,IU.fromUrl(e,n,t)},MAPBOX:(e,t)=>new PU({url:e,...t}),SINGLE_TILE:RU.fromUrl,TMS:ub.fromUrl,URL_TEMPLATE:(e,t)=>new cc({url:e,...t}),WMS:(e,t)=>new MU({url:e,...t}),WMTS:(e,t)=>new LU({url:e,...t})};function Nm(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new me}Object.defineProperties(Nm.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});Nm.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=af._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Nm._endpointCache[i];l(o)||(o=n.fetchJson(),Nm._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new re(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await ub.fromUrl(new af(r,n));else{let u=eat[a];if(!l(u))throw new re(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},h=f.url;delete f.url,s=await u(h,f)}let c=new Nm(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=af.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};Nm.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Nm.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Nm.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Nm._endpointCache={};var Gy=Nm;var tat={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},Wy=Object.freeze(tat);function nat(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,Wy.AERIAL);return Gy.fromAssetId(t)}var jy=nat;function DE(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=si.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}DE.createPlaceholder=function(e){let t=new DE(e,0,0,0);return t.addReference(),t.state=si.PLACEHOLDER,t};DE.prototype.addReference=function(){++this.referenceCount};DE.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};DE.prototype.processStateMachine=function(e,t,n){this.state===si.UNLOADED&&!n&&(this.state=si.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===si.RECEIVED&&(this.state=si.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===si.READY&&t&&!this.texture;(this.state===si.TEXTURE_LOADED||i)&&(this.state=si.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var DI=DE;function FY(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}FY.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};FY.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===si.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==si.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==si.FAILED&&r.state!==si.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===si.FAILED||i.state===si.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var II=FY;function pi(e,t){this._imageryProvider=e,this._readyEvent=new me,this._errorEvent=new me,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,pi.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,pi.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,pi.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,pi.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,pi.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,pi.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,pi.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,pi.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,se.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new II(DI.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,pi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(pi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});pi.DEFAULT_BRIGHTNESS=1;pi.DEFAULT_CONTRAST=1;pi.DEFAULT_HUE=0;pi.DEFAULT_SATURATION=1;pi.DEFAULT_GAMMA=1;pi.DEFAULT_SPLIT=Gr.NONE;pi.DEFAULT_MINIFICATION_FILTER=Zt.LINEAR;pi.DEFAULT_MAGNIFICATION_FILTER=di.LINEAR;pi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;pi.fromProviderAsync=function(e,t){let n=new pi(void 0,t);return aat(n,Promise.resolve(e)),n};pi.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),pi.fromProviderAsync(jy({style:e.style}),e)};pi.prototype.isBaseLayer=function(){return this._isBaseLayer};pi.prototype.isDestroyed=function(){return!1};pi.prototype.destroy=function(){return ue(this)};var Zge=new se,Xge=new se,BY=new se,$ge=new se;pi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return se.intersection(e.rectangle,t)};pi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Oi&&e.rectangle.north<Oi.MaximumLatitude&&e.rectangle.south>-Oi.MaximumLatitude,s=se.intersection(o.rectangle,this._rectangle,Zge),a=se.intersection(e.rectangle,s,Xge);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,I=e.rectangle;a=Xge,I.south>=w.north?a.north=a.south=w.north:I.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(I.south,w.south),a.north=Math.min(I.north,w.north)),I.west>=w.east?a.west=a.east=w.east:I.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(I.west,w.west),a.east=Math.min(I.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),h=rat(this,f,c);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),l(o.minimumLevel)){let w=o.minimumLevel;h<w&&(h=w)}let _=o.tilingScheme,m=_.positionToTileXY(se.northwest(a),h),x=_.positionToTileXY(se.southeast(a),h),b=e.rectangle.width/512,T=e.rectangle.height/512,C=_.tileXYToRectangle(m.x,m.y,h);Math.abs(C.south-e.rectangle.north)<T&&m.y<x.y&&++m.y,Math.abs(C.east-e.rectangle.west)<b&&m.x<x.x&&++m.x;let A=_.tileXYToRectangle(x.x,x.y,h);Math.abs(A.north-e.rectangle.south)<T&&x.y>m.y&&--x.y,Math.abs(A.west-e.rectangle.east)<b&&x.x>m.x&&--x.x;let S=se.clone(e.rectangle,$ge),v=_.tileXYToRectangle(m.x,m.y,h),D=se.intersection(v,s,BY),O;r?(_.rectangleToNativeRectangle(S,S),_.rectangleToNativeRectangle(v,v),_.rectangleToNativeRectangle(D,D),_.rectangleToNativeRectangle(s,s),O=_.tileXYToNativeRectangle.bind(_),b=S.width/512,T=S.height/512):O=_.tileXYToRectangle.bind(_);let R,M=0,L=1,g;!this.isBaseLayer()&&Math.abs(D.west-S.west)>=b&&(M=Math.min(1,(D.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(D.north-S.north)>=T&&(L=Math.max(0,(D.north-S.south)/S.height));let E=L;for(let w=m.x;w<=x.x;w++)if(R=M,v=O(w,m.y,h),D=se.simpleIntersection(v,s,BY),!!l(D)){M=Math.min(1,(D.east-S.west)/S.width),w===x.x&&(this.isBaseLayer()||Math.abs(D.east-S.east)<b)&&(M=1),L=E;for(let I=m.y;I<=x.y;I++){if(g=L,v=O(w,I,h),D=se.simpleIntersection(v,s,BY),!l(D))continue;L=Math.max(0,(D.south-S.south)/S.height),I===x.y&&(this.isBaseLayer()||Math.abs(D.south-S.south)<T)&&(L=0);let N=new oe(R,L,M,g),B=this.getImageryFromCache(w,I,h);i.imagery.splice(n,0,new II(B,N,r)),++n}}return!0};pi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,Zge),i=c.rectangleToNativeRectangle(i,$ge)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new oe(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};pi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=si.RECEIVED,e.request=void 0,Io.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Kn.CANCELLED){e.state=si.UNLOADED,e.request=void 0;return}e.state=si.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Io.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new nr({throttle:!1,throttleByServer:!0,type:ps.IMAGERY});e.request=s,e.state=si.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=si.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};pi.prototype._createTextureWebGL=function(e,t){let n=new $t({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Ot({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Ot({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?tt.RGBA:tt.RGB,sampler:n})};pi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=si.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=si.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Oi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=si.TEXTURE_LOADED};function Kge(e,t,n){return`${e}:${t}:${n}`}pi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Zt.LINEAR&&i===di.LINEAR&&!tt.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=Zt.LINEAR_MIPMAP_LINEAR;let r=Bt.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=Kge(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new $t({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(sp.NICEST),t.sampler=u}else{let r=Kge(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new $t({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};pi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Ii)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new al({persists:!0,owner:this,preExecute:function(c){oat(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=si.READY,t.releaseReference()},canceled:function(){t.state=si.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=si.READY};pi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};pi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};pi.prototype.getImageryFromCache=function(e,t,n,i){let o=Qge(e,t,n),r=this._imageryCache[o];return l(r)||(r=new DI(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};pi.prototype.removeImageryFromCache=function(e){let t=Qge(e.x,e.y,e.level);delete this._imageryCache[t]};function Qge(e,t,n){return JSON.stringify([e,t,n])}var NU={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},iat=Ht.supportsTypedArrays()?new Float32Array(2*64):void 0;function oat(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),T=0;for(let D=0;D<64;++D){let O=D/63;b[T++]=0,b[T++]=O,b[T++]=1,b[T++]=O}let C={position:0,webMercatorT:1},A=ls.getRegularGridIndices(2,64),S=yt.createIndexBuffer({context:t,typedArray:A,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});o.vertexArray=new ti({context:t,attributes:[{index:C.position,vertexBuffer:yt.createVertexBuffer({context:t,typedArray:b,usage:Fe.STATIC_DRAW}),componentsPerAttribute:2},{index:C.webMercatorT,vertexBuffer:yt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Fe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let v=new Ue({sources:[pL]});o.shaderProgram=en.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:mL,attributeLocations:C}),o.sampler=new $t({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR,magnificationFilter:di.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;NU.textureDimensions.x=r,NU.textureDimensions.y=s,NU.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),h=new Ot({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(r)&&P.isPowerOfTwo(s)&&h.generateMipmap(sp.NICEST);let p=i.south,_=i.north,m=iat,x=0;for(let b=0;b<64;++b){let T=b/63,C=P.lerp(p,_,T);a=Math.sin(C);let S=(.5*Math.log((1+a)/(1-a))-c)*f;m[x++]=S,m[x++]=S}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=NU,e.vertexArray=o.vertexArray}function rat(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ii?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function sat(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function aat(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){sat(e._errorEvent,i)}}var lc=pi;var cat={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},gn=cat;var Jge={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=Jge.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},qn=Jge;function PE(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe}PE.prototype.update=function(e,t,n){this.changedThisFrame&&(s_e(e,t,this.tile,n),this.changedThisFrame=!1)};PE.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};PE.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):oh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var lat=new fx;PE.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=lat;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),h=c.findTileToEast(r),p=c.findTileToNorth(r);ws(e,n,c,u,s,gn.EAST,!1,a,i),ws(e,n,c,f,s,gn.NORTH,!1,a,i),ws(e,n,c,h,s,gn.WEST,!1,a,i),ws(e,n,c,p,s,gn.SOUTH,!1,a,i);let _=u.findTileToNorth(r),m=u.findTileToSouth(r),x=h.findTileToNorth(r),b=h.findTileToSouth(r);ws(e,n,c,_,s,gn.SOUTHEAST,!1,a,i),ws(e,n,c,x,s,gn.SOUTHWEST,!1,a,i),ws(e,n,c,m,s,gn.NORTHEAST,!1,a,i),ws(e,n,c,b,s,gn.NORTHWEST,!1,a,i),c=a.dequeue()}};function ws(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||qn.wasKicked(u._lastSelectionResult)||qn.originalResult(u._lastSelectionResult)===qn.CULLED);){if(s)return;let f=u.parent;if(r>=gn.NORTHWEST&&f!==void 0)switch(r){case gn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case gn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case gn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case gn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===qn.RENDERED){if(l(u.data.vertexArray))return;uat(e,t,n,u,r,o,a,c);return}if(qn.originalResult(i._lastSelectionResult)!==qn.CULLED)switch(r){case gn.WEST:ws(e,t,n,i.northwestChild,o,r,!0,a,c),ws(e,t,n,i.southwestChild,o,r,!0,a,c);break;case gn.EAST:ws(e,t,n,i.southeastChild,o,r,!0,a,c),ws(e,t,n,i.northeastChild,o,r,!0,a,c);break;case gn.SOUTH:ws(e,t,n,i.southwestChild,o,r,!0,a,c),ws(e,t,n,i.southeastChild,o,r,!0,a,c);break;case gn.NORTH:ws(e,t,n,i.northeastChild,o,r,!0,a,c),ws(e,t,n,i.northwestChild,o,r,!0,a,c);break;case gn.NORTHWEST:ws(e,t,n,i.northwestChild,o,r,!0,a,c);break;case gn.NORTHEAST:ws(e,t,n,i.northeastChild,o,r,!0,a,c);break;case gn.SOUTHWEST:ws(e,t,n,i.southwestChild,o,r,!0,a,c);break;case gn.SOUTHEAST:ws(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new he("Invalid edge")}}}function uat(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new PE(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),fat(e,t,n,i,o,a)}function fat(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(s_e(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case gn.WEST:u=s.westMeshes,f=s.westTiles;break;case gn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case gn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case gn.NORTH:u=s.northMeshes,f=s.northTiles;break;case gn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case gn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case gn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case gn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let h,p,_,m,x=n.rectangle,b,T=i.rectangle;switch(o){case gn.WEST:for(b=(T.north-T.south)*P.EPSILON5,h=0;h<f.length&&(_=f[h],m=_.rectangle,!P.greaterThan(x.north,m.south,b));++h);for(p=h;p<f.length&&(_=f[p],m=_.rectangle,!P.greaterThanOrEquals(x.south,m.north,b));++p);break;case gn.SOUTH:for(b=(T.east-T.west)*P.EPSILON5,h=0;h<f.length&&(_=f[h],m=_.rectangle,!P.lessThan(x.west,m.east,b));++h);for(p=h;p<f.length&&(_=f[p],m=_.rectangle,!P.lessThanOrEquals(x.east,m.west,b));++p);break;case gn.EAST:for(b=(T.north-T.south)*P.EPSILON5,h=0;h<f.length&&(_=f[h],m=_.rectangle,!P.lessThan(x.south,m.north,b));++h);for(p=h;p<f.length&&(_=f[p],m=_.rectangle,!P.lessThanOrEquals(x.north,m.south,b));++p);break;case gn.NORTH:for(b=(T.east-T.west)*P.EPSILON5,h=0;h<f.length&&(_=f[h],m=_.rectangle,!P.greaterThan(x.east,m.west,b));++h);for(p=h;p<f.length&&(_=f[p],m=_.rectangle,!P.greaterThanOrEquals(x.west,m.east,b));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||u[h]!==a,u[h]=a,f[h]=n):(s.changedThisFrame=!0,u.splice(h,p-h,a),f.splice(h,p-h,n))}var db=new fe,dat=new fe,IE=new d,zY=new d,kY=new U,VY=new U,wu=new U;function HU(){this.height=0,this.encodedNormal=new U}function FU(e,t,n,i,o,r,s,a,c){if(l(o))return o;let u;if(l(r)&&l(s))u=(r.height+s.height)*.5;else if(l(r))u=r.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,_=0;l(h)&&(p=h.minimumHeight,_=h.maximumHeight),u=(p+_)*.5}return a_e(e,t,n,i,u,c),c}var hat={minimumHeight:0,maximumHeight:0},mat=new d,e_e=new HU,t_e=new HU,n_e=new HU,i_e=new HU,pat=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,gat={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function s_e(e,t,n,i){oh.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,h=kU(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,n_e),p=kU(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,e_e),_=kU(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,t_e),m=kU(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,i_e);h=FU(r,f,0,1,h,p,m,_,n_e),p=FU(r,f,0,0,p,h,_,m,e_e),_=FU(r,f,1,1,_,p,m,h,t_e),m=FU(r,f,1,1,m,_,h,p,i_e);let x=p.height,b=_.height,T=h.height,C=m.height,A=Math.min(x,b,T,C),S=Math.max(x,b,T,C),v=(A+S)*.5,D,O,R=e.getLevelMaximumGeometricError(n.level),M=f.maximumRadius-R,L=Math.acos(M/f.maximumRadius)*4;if(L*=1.5,s.width>L&&S-A<=R){let w=new ac({width:9,height:9,buffer:pat,structure:{heightOffset:S}}),I=gat;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,r.mesh=w._createMeshSync(I)}else{let w=u,I=se.center(s,dat);I.height=v;let N=f.cartographicToCartesian(I,mat),B=new Kc(N,void 0,void 0,void 0,void 0,!0,!0,w,a,c),H=5,V;for(V=r.westMeshes,D=0,O=V.length;D<O;++D)H+=V[D].eastIndicesNorthToSouth.length;for(V=r.southMeshes,D=0,O=V.length;D<O;++D)H+=V[D].northIndicesWestToEast.length;for(V=r.eastMeshes,D=0,O=V.length;D<O;++D)H+=V[D].westIndicesSouthToNorth.length;for(V=r.northMeshes,D=0,O=V.length;D<O;++D)H+=V[D].southIndicesEastToWest.length;let G=hat;G.minimumHeight=A,G.maximumHeight=S;let k=B.stride,W=new Float32Array(H*k),Y=0,J=Y;Y=BU(f,s,B,W,Y,0,1,h.height,h.encodedNormal,1,G),Y=UU(r,f,B,W,Y,r.westTiles,r.westMeshes,gn.EAST,G);let j=Y;Y=BU(f,s,B,W,Y,0,0,p.height,p.encodedNormal,0,G),Y=UU(r,f,B,W,Y,r.southTiles,r.southMeshes,gn.NORTH,G);let K=Y;Y=BU(f,s,B,W,Y,1,0,_.height,_.encodedNormal,0,G),Y=UU(r,f,B,W,Y,r.eastTiles,r.eastMeshes,gn.WEST,G);let Q=Y;Y=BU(f,s,B,W,Y,1,1,m.height,m.encodedNormal,1,G),Y=UU(r,f,B,W,Y,r.northTiles,r.northMeshes,gn.SOUTH,G),A=G.minimumHeight,S=G.maximumHeight;let de=wn.fromRectangle(s,A,S,n.tilingScheme.ellipsoid),ye=Oi.geodeticLatitudeToMercatorAngle(s.south),ce=1/(Oi.geodeticLatitudeToMercatorAngle(s.north)-ye),ge=(Oi.geodeticLatitudeToMercatorAngle(I.latitude)-ye)*ce,xe=f.geodeticSurfaceNormalCartographic(db,zY),De=Ln.octEncode(xe,kY),Ae=Y;B.encode(W,Y*k,de.center,U.fromElements(.5,.5,wu),v,De,ge,xe),++Y;let ke=Y,ze=ke<256?1:2,et=(ke-1)*3,St=et*ze,mt=(W.length-ke*k)*Float32Array.BYTES_PER_ELEMENT,Be;if(mt>=St){let Te=ke*k*Float32Array.BYTES_PER_ELEMENT;Be=ke<256?new Uint8Array(W.buffer,Te,et):new Uint16Array(W.buffer,Te,et)}else Be=ke<256?new Uint8Array(et):new Uint16Array(et);W=new Float32Array(W.buffer,0,ke*k);let Yt=0;for(D=0;D<ke-2;++D)Be[Yt++]=Ae,Be[Yt++]=D,Be[Yt++]=D+1;Be[Yt++]=Ae,Be[Yt++]=D,Be[Yt++]=0;let Ct=[];for(D=j;D>=J;--D)Ct.push(D);let ut=[];for(D=K;D>=j;--D)ut.push(D);let Jt=[];for(D=Q;D>=K;--D)Jt.push(D);let Ce=[];for(Ce.push(0),D=Ae-1;D>=Q;--D)Ce.push(D);r.mesh=new ih(B.center,W,Be,et,ke,A,S,ae.fromOrientedBoundingBox(de),Aat(e,de.center,s,A,S),B.stride,de,B,Ct,ut,Jt,Ce)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=oh._createVertexArrayForMesh(g,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let E=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=o._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(r.waterMaskTexture=w.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,w,r.waterMaskTranslationAndScale))}l(E)&&(--E.referenceCount,E.referenceCount===0&&E.destroy())}function BU(e,t,n,i,o,r,s,a,c,u,f){let h=db;h.longitude=P.lerp(t.west,t.east,r),h.latitude=P.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,IE),_;n.hasGeodeticSurfaceNormals&&(_=e.geodeticSurfaceNormal(p,zY));let m=VY;return m.x=r,m.y=s,n.encode(i,o*n.stride,p,m,a,c,u,_),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var zU=new se;function PI(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=se.clone(e.rectangle,zU),o.west-=P.TWO_PI,o.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=se.clone(e.rectangle,zU),o.west+=P.TWO_PI,o.east+=P.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,h=(r.north-o.south)/u,p=(n.x-a)/(c-a),_=(n.y-f)/(h-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(_)<Math.EPSILON5?_=0:Math.abs(_-1)<Math.EPSILON5&&(_=1),i.x=p,i.y=_,i}var _at=new U;function UY(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var yat=new U,xat=new d;function bat(e,t,n,i,o,r,s,a,c,u){let f=i.encoding,h=i.vertices,p=PI(t,n,f.decodeTextureCoordinates(h,o,wu),wu),_=PI(t,n,f.decodeTextureCoordinates(h,r,VY),VY),m;c?m=(s-p.x)/(_.x-p.x):m=(a-p.y)/(_.y-p.y);let x=f.decodeHeight(h,o),b=f.decodeHeight(h,r),T=n.rectangle;db.longitude=P.lerp(T.west,T.east,s),db.latitude=P.lerp(T.south,T.north,a),u.height=db.height=P.lerp(x,b,m);let C;if(f.hasVertexNormals){let A=f.getOctEncodedNormal(h,o,_at),S=f.getOctEncodedNormal(h,r,yat),v=Ln.octDecode(A.x,A.y,IE),D=Ln.octDecode(S.x,S.y,xat);C=d.lerp(v,D,m,IE),d.normalize(C,C),Ln.octEncode(C,u.encodedNormal)}else C=e.geodeticSurfaceNormalCartographic(db,IE),Ln.octEncode(C,u.encodedNormal)}function a_e(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(db,IE);Ln.octEncode(s,r.encodedNormal)}function kU(e,t,n,i,o,r,s,a,c,u,f){if(r_e(e,t,a,s,!1,n,i,f)||r_e(e,t,u,c,!0,n,i,f))return f;let p;if(HY(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],UY(r,p,n,i,f),f;let _;if(n===0?i===0?_=VU(e.westMeshes,e.westTiles,gn.EAST,e.southMeshes,e.southTiles,gn.NORTH,n,i):_=VU(e.northMeshes,e.northTiles,gn.SOUTH,e.westMeshes,e.westTiles,gn.EAST,n,i):i===0?_=VU(e.southMeshes,e.southTiles,gn.NORTH,e.eastMeshes,e.eastTiles,gn.WEST,n,i):_=VU(e.eastMeshes,e.eastTiles,gn.WEST,e.northMeshes,e.northTiles,gn.SOUTH,n,i),l(_))return a_e(e,t,n,i,_,f),f}function VU(e,t,n,i,o,r,s,a){let c=o_e(e,t,!1,n,s,a),u=o_e(i,o,!0,r,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function UU(e,t,n,i,o,r,s,a,c){for(let u=0;u<r.length;++u)o=Tat(e,t,n,i,o,r[u],s[u],a,c);return o}function Tat(e,t,n,i,o,r,s,a,c){let u=r.rectangle;a===gn.EAST&&e.tile.x===0?(u=se.clone(r.rectangle,zU),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===gn.WEST&&r.x===0&&(u=se.clone(r.rectangle,zU),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,wu),h=wu.x,p=wu.y);let _,m;switch(a){case gn.WEST:_=s.westIndicesSouthToNorth,m=!1;break;case gn.NORTH:_=s.northIndicesWestToEast,m=!0;break;case gn.EAST:_=s.eastIndicesNorthToSouth,m=!1;break;case gn.SOUTH:_=s.southIndicesEastToWest,m=!0;break}let x=r,b=e.tile,T=s.encoding,C=s.vertices,A=n.stride,S,v;T.hasWebMercatorT&&(S=Oi.geodeticLatitudeToMercatorAngle(f.south),v=1/(Oi.geodeticLatitudeToMercatorAngle(f.north)-S));for(let D=0;D<_.length;++D){let O=_[D],R=T.decodeTextureCoordinates(C,O,wu);PI(x,b,R,R);let M=R.x,L=R.y,g=m?M:L;if(g<0||g>1||Math.abs(M-h)<P.EPSILON5&&Math.abs(L-p)<P.EPSILON5)continue;let E=Math.abs(M)<P.EPSILON5||Math.abs(M-1)<P.EPSILON5,w=Math.abs(L)<P.EPSILON5||Math.abs(L-1)<P.EPSILON5;if(E&&w)continue;let I=T.decodePosition(C,O,IE),N=T.decodeHeight(C,O),B;T.hasVertexNormals?B=T.getOctEncodedNormal(C,O,kY):(B=kY,B.x=0,B.y=0);let H=L;if(T.hasWebMercatorT){let G=P.lerp(f.south,f.north,L);H=(Oi.geodeticLatitudeToMercatorAngle(G)-S)*v}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,zY)),n.encode(i,o*A,I,R,N,B,H,V),c.minimumHeight=Math.min(c.minimumHeight,N),c.maximumHeight=Math.max(c.maximumHeight,N),++o}return o}function o_e(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],h=t[u];if(!HY(h,f))continue;let p;switch(i){case gn.WEST:p=f.westIndicesSouthToNorth;break;case gn.SOUTH:p=f.southIndicesEastToWest;break;case gn.EAST:p=f.eastIndicesNorthToSouth;break;case gn.NORTH:p=f.northIndicesWestToEast;break}let _=p[n?0:p.length-1];if(l(_))return f.encoding.decodeHeight(f.vertices,_)}}function HY(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function r_e(e,t,n,i,o,r,s,a){let c,u,f,h,p,_=i[o?0:n.length-1],m=n[o?0:n.length-1];if(HY(_,m)&&(r===0?s===0?(c=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(c=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):s===0?(c=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(c=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){h=o?0:c.length-1,p=c[h],m.encoding.decodeTextureCoordinates(m.vertices,p,wu);let x=PI(_,e.tile,wu,wu);if(x.x===r&&x.y===s)return UY(m,p,r,s,a),!0;if(h=Oo(c,u?r:s,function(b,T){m.encoding.decodeTextureCoordinates(m.vertices,b,wu);let C=PI(_,e.tile,wu,wu);return f?u?C.x-r:C.y-s:u?r-C.x:s-C.y}),h<0){if(h=~h,h>0&&h<c.length)return bat(t,_,e.tile,m,c[h-1],c[h],r,s,u,a),!0}else return UY(m,c[h],r,s,a),!0}return!1}var Cat=[new d,new d,new d,new d];function Aat(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Cat;return d.fromRadians(n.west,n.south,o,a,c[0]),d.fromRadians(n.east,n.south,o,a,c[1]),d.fromRadians(n.west,n.north,o,a,c[2]),d.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var RI=PE;function Jo(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=xn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new me,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(Jo.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(Jo.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(Jo.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(Jo.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new me,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=se.clone(se.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(Jo.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=oe.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Zh.setOwner(e,this,"_clippingPolygons")}}});function Eat(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}Jo.prototype.update=function(e){this._imageryLayers._update()};function Sat(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}Jo.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Eat)})),Sat(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)oh._freeVertexArray(t[i]);t.length=0};Jo.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};Jo.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:vc.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:vc.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=Ge(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=Ge(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&RI.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let u=0,f=c.length;u<f;++u){let h=c[u],p=h.data.tileBoundingRegion;Kat(this,h,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function d_e(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}Jo.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)d_e(t[n],e)};Jo.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};Jo.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};Jo.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===qn.CULLED_BUT_NEEDED,o=n.terrainState),oh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==br.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,oh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var vat=new ae,h_e=new se,wat=new se,Dat=new fe;function WU(e,t){if(t.west<t.east)return t;let n=se.clone(t,wat);return se.center(e,Dat).longitude>0?n.east=P.PI:n.west=-P.PI,n}function m_e(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!se.equals(e.cartographicLimitRectangle,se.MAX_VALUE))}Jo.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=m_e(this,t);if(t.fog.enabled&&!o&&P.fog(i,t.fog.density)>=1)return br.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return br.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let u=WU(e.rectangle,this.cartographicLimitRectangle),f=se.simpleIntersection(u,e.rectangle,h_e);if(!l(f))return br.NONE;if(se.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=vat,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),d.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(r.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!l(c))return br.PARTIAL;let h=this._clippingPlanes;if(l(h)&&h.enabled){let b=h.computeIntersectionWithBoundingVolume(c);if(e.isClipped=b!==jt.INSIDE,b===jt.OUTSIDE)return br.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(s);e.isClipped=b!==jt.OUTSIDE}let _,m=a.computeVisibility(c);if(m===jt.OUTSIDE?_=br.NONE:m===jt.INTERSECTING?_=br.PARTIAL:m===jt.INSIDE&&(_=br.FULL),_===br.NONE)return _;let x=t.mode===ne.SCENE3D&&t.camera.frustum instanceof rn;if(t.mode===ne.SCENE3D&&!x&&l(n)&&!o){let b=r.occludeePointInScaledSpace;return!l(b)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?_:br.NONE}return _};Jo.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Iat=[],Pat=[];Jo.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Iat;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===fo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let h=s[a],p=h.loadingImagery,_=!l(p)||p.state===si.FAILED||p.state===si.INVALID,m=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[m]=_&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=Pat;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let h=f.pop(),p=h._lastSelectionResultFrame===u?h._lastSelectionResult:qn.NONE;if(p===qn.RENDERED){let _=h.data;if(!l(_))continue;if(!o&&h.data.terrainState===fo.READY)return!1;let m=h.data.imagery;for(a=0,c=m.length;a<c;++a){let x=m[a],b=x.loadingImagery,T=!l(b)||b.state===si.FAILED||b.state===si.INVALID,C=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(T&&!i[C])return!1}}else p===qn.REFINED&&f.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var Rat=new d;Jo.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=d.subtract(i.center,o,Rat),a=d.magnitude(s);return a<P.EPSILON5?0:(d.divideByScalar(s,a,s),(1-d.dot(s,r))*e._distance)};var c_e=new F,GU=new F,Oat=new oe,Mat=new oe,Lat=new oe,Nat=new d,l_e=new d,Fat=new d,Bat=new d;Jo.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var kat=[new d,new d,new d,new d];function u_e(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=kat;return d.fromRadians(n.west,n.south,o,a,c[0]),d.fromRadians(n.east,n.south,o,a,c[1]),d.fromRadians(n.west,n.north,o,a,c[2]),d.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}Jo.prototype.computeDistanceToTile=function(e,t){Vat(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-s);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function Vat(e,t,n){let i=e.data;i===void 0&&(i=e.data=new oh);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Md({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,u=e,f=i.mesh,h=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,c=!0;else if(h!==void 0&&h._minimumHeight!==void 0&&h._maximumHeight!==void 0)r.minimumHeight=h._minimumHeight,r.maximumHeight=h._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let _=p.data;if(_!==void 0){let m=_.mesh,x=_.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,_=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Dr.getHeight(r.minimumHeight,p,_),r.maximumHeight=Dr.getHeight(r.maximumHeight,p,_)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=wn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ae.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=d.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=u_e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=u_e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}Jo.prototype.isDestroyed=function(){return!1};Jo.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function Uat(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(o=a[u],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}Jo.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,h=0;for(a=0;a<u;++a){let _=c[a];if(y(_.readyImagery,_.loadingImagery).imageryLayer===e)f===-1&&(f=a),++h;else if(f!==-1)break}if(f===-1)return;let p=f+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Uat(h,e,n),s.state=da.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=da.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==qn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};Jo.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};Jo.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};Jo.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var zat=new F,Hat=new F;function f_e(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=F.multiplyByPoint(i,this.properties.rtc,l_e);return F.setTranslation(i,o,c_e),c_e},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=F.multiplyByPoint(i,this.properties.rtc,l_e);return F.setTranslation(i,r,GU),F.multiply(o,GU,GU),GU},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?F.multiply(e.context.uniformState.view,i.modelMatrix,zat):F.IDENTITY;return F.inverseTranspose(o,Hat)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new oe(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new U(65e5,9e6),nightFadeDistance:new U(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new d(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new d(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new d,center3D:void 0,rtc:new d,modifiedModelView:new F,tileRectangle:new oe,verticalExaggerationAndRelativeHeight:new U(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new U,southMercatorYAndOneOverHeight:new U,waterMask:void 0,waterMaskTranslationAndScale:new oe,minMaxHeight:new U,scaleAndBias:new F,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new oe,frontFaceAlphaByDistance:new oe,backFaceAlphaByDistance:new oe,localizedTranslucencyRectangle:new oe,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new oe,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?bt(n,t.materialUniformMap):n}function Gat(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Wat(e,r,o),i.wireframeVertexArray.mesh=o}}function Wat(e,t,n){let o={indices:n.indices,primitiveType:Me.TRIANGLES};Nn.toWireframe(o);let r=o.indices,s=yt.createIndexBuffer({context:e,typedArray:r,usage:Fe.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ti({context:e,attributes:t._attributes,indexBuffer:s})}var p_e,g_e,jU;(function(){let e=new wt({geometry:Oh.fromDimensions({dimensions:new d(2,2,2)})}),t=new wt({geometry:new Y_({radius:1})}),n=new F,i,o;function r(s){return new In({geometryInstances:s,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})}p_e=function(s,a){return s===i||(jU(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Wt.fromColor(a),o=r(e)),o},g_e=function(s,a){return s===i||(jU(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Wt.fromColor(a),o=r(t)),o},jU=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var jat=new oe(0,0,0,0),qat={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Yat=z.TRANSPARENT,Xat=new kt;function Kat(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new RI(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let Te=r.credits;for(let it=0,Vi=Te.length;it<Vi;++it)o.addCreditToNextFrame(Te[it])}let s=Bt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,h=f.translucent,p=f.frontFaceAlphaByDistance,_=f.backFaceAlphaByDistance,m=f.rectangle,x=y(e.undergroundColor,Yat),b=y(e.undergroundColorAlphaByDistance,Xat),T=m_e(e,n)&&n.mode===ne.SCENE3D&&x.alpha>0&&(b.nearValue>0||b.farValue>0),C=e.lambertDiffuseMultiplier,A=e.vertexShadowDarkness,S=e.hasWaterMask&&l(a),v=S&&e.showWaterEffect,D=e.oceanNormalMap,O=v&&l(D),R=e.terrainProvider,M=l(R)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,g=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,E=xn.castShadows(e.shadows)&&!h,w=xn.receiveShadows(e.shadows)&&!h,I=e.hueShift,N=e.saturationShift,B=e.brightnessShift,H=!(P.equalsEpsilon(I,0,P.EPSILON7)&&P.equalsEpsilon(N,0,P.EPSILON7)&&P.equalsEpsilon(B,0,P.EPSILON7)),V=!1;if(g){let Te=d.magnitude(n.camera.positionWC),it=e.nightFadeOutDistance;V=Te>it}S&&--s,O&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let G=i.renderedMesh,k=G.center,W=G.encoding,Y=i.tileBoundingRegion,J=n.verticalExaggeration,j=n.verticalExaggerationRelativeHeight,K=J!==1,Q=W.hasGeodeticSurfaceNormals,de=Oat,ye=0,ce=0,ge=0,xe=0,De=!1;if(n.mode!==ne.SCENE3D){let Te=n.mapProjection,it=Te.project(se.southwest(t.rectangle),Fat),Vi=Te.project(se.northeast(t.rectangle),Bat);if(de.x=it.x,de.y=it.y,de.z=Vi.x,de.w=Vi.y,n.mode!==ne.MORPHING&&(k=Nat,k.x=0,k.y=(de.z+de.x)*.5,k.z=(de.w+de.y)*.5,de.x-=k.y,de.y-=k.z,de.z-=k.y,de.w-=k.z),n.mode===ne.SCENE2D&&W.quantization===fa.BITS12){let ft=1/(Math.pow(2,12)-1)*.5,mo=(de.z-de.x)*ft,Ho=(de.w-de.y)*ft;de.x-=mo,de.y-=Ho,de.z+=mo,de.w+=Ho}Te instanceof Oi&&(ye=t.rectangle.south,ce=t.rectangle.north,ge=Oi.geodeticLatitudeToMercatorAngle(ye),xe=1/(Oi.geodeticLatitudeToMercatorAngle(ce)-ge),De=!0)}let Ae=qat;Ae.frameState=n,Ae.surfaceTile=i,Ae.hasWaterMask=S,Ae.showReflectiveOcean=v,Ae.showOceanWaves=O,Ae.enableLighting=e.enableLighting,Ae.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ae.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ae.showGroundAtmosphere=g,Ae.atmosphereLightIntensity=e.atmosphereLightIntensity,Ae.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ae.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ae.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ae.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ae.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ae.perFragmentGroundAtmosphere=V,Ae.hasVertexNormals=M,Ae.useWebMercatorProjection=De,Ae.clippedByBoundaries=i.clippedByBoundaries,Ae.hasGeodeticSurfaceNormals=Q,Ae.hasExaggeration=K;let ke=i.imagery,ze=0,et=ke.length,St=e.showSkirts&&!u&&!h,mt=e.backFaceCulling&&!u&&!h,Be=mt?e._renderState:e._disableCullingRenderState,Yt=mt?e._blendRenderState:e._disableCullingBlendRenderState,Ct=Be,ut=e._firstPassInitialColor,Jt=n.context;if(l(e._debug.boundingSphereTile)||jU(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let Te=e._drawCommands.length;for(let it=0;it<Te;++it)e._uniformMaps[it]=f_e(n,e)}do{let Te=0,it,Vi;if(e._drawCommands.length<=e._usedDrawCommands?(it=new $e,it.owner=t,it.cull=!1,it.boundingVolume=new ae,it.orientedBoundingBox=void 0,Vi=f_e(n,e),e._drawCommands.push(it),e._uniformMaps.push(Vi)):(it=e._drawCommands[e._usedDrawCommands],Vi=e._uniformMaps[e._usedDrawCommands]),it.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let _a=Y.boundingVolume,ol=Y.boundingSphere;l(_a)?p_e(_a,z.RED).update(n):l(ol)&&g_e(ol,z.RED).update(n)}let ft=Vi.properties;oe.clone(ut,ft.initialColor),ft.oceanNormalMap=D,ft.lightingFadeDistance.x=e.lightingFadeOutDistance,ft.lightingFadeDistance.y=e.lightingFadeInDistance,ft.nightFadeDistance.x=e.nightFadeOutDistance,ft.nightFadeDistance.y=e.nightFadeInDistance,ft.atmosphereLightIntensity=e.atmosphereLightIntensity,ft.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ft.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ft.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ft.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ft.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ft.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let mo=u?_:p,Ho=u?p:_;l(mo)&&(oe.fromElements(mo.near,mo.nearValue,mo.far,mo.farValue,ft.frontFaceAlphaByDistance),oe.fromElements(Ho.near,Ho.nearValue,Ho.far,Ho.farValue,ft.backFaceAlphaByDistance)),oe.fromElements(b.near,b.nearValue,b.far,b.farValue,ft.undergroundColorAlphaByDistance),z.clone(x,ft.undergroundColor),ft.lambertDiffuseMultiplier=C,ft.vertexShadowDarkness=A;let Ma=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Ma&&z.clone(e.fillHighlightColor,ft.fillHighlightColor),ft.verticalExaggerationAndRelativeHeight.x=J,ft.verticalExaggerationAndRelativeHeight.y=j,ft.center3D=G.center,d.clone(k,ft.rtc),oe.clone(de,ft.tileRectangle),ft.southAndNorthLatitude.x=ye,ft.southAndNorthLatitude.y=ce,ft.southMercatorYAndOneOverHeight.x=ge,ft.southMercatorYAndOneOverHeight.y=xe;let Cr=Mat,hs=WU(t.rectangle,e.cartographicLimitRectangle),Le=Lat,ot=WU(t.rectangle,m);d.fromElements(I,N,B,ft.hsbShift);let je=t.rectangle,Xe=1/je.width,ht=1/je.height;Cr.x=(hs.west-je.west)*Xe,Cr.y=(hs.south-je.south)*ht,Cr.z=(hs.east-je.west)*Xe,Cr.w=(hs.north-je.south)*ht,oe.clone(Cr,ft.localizedCartographicLimitRectangle),Le.x=(ot.west-je.west)*Xe,Le.y=(ot.south-je.south)*ht,Le.z=(ot.east-je.west)*Xe,Le.w=(ot.north-je.south)*ht,oe.clone(Le,ft.localizedTranslucencyRectangle);let Gt=L&&P.fog(t._distance,n.fog.density)>P.EPSILON3;H=H&&(Gt||g);let _n=!1,Eo=!1,yo=!1,La=!1,Na=!1,gi=!1,ui=!1,Ys=!1,kr=!1,il=!1;for(;Te<s&&ze<et;){let _a=ke[ze],ol=_a.readyImagery;if(++ze,!l(ol)||ol.imageryLayer.alpha===0)continue;let _c=_a.useWebMercatorT?ol.textureWebMercator:ol.texture,es=ol.imageryLayer;l(_a.textureTranslationAndScale)||(_a.textureTranslationAndScale=es._calculateTextureTranslationAndScale(t,_a)),ft.dayTextures[Te]=_c,ft.dayTextureTranslationAndScale[Te]=_a.textureTranslationAndScale,ft.dayTextureTexCoordsRectangle[Te]=_a.textureCoordinateRectangle,ft.dayTextureUseWebMercatorT[Te]=_a.useWebMercatorT,ft.dayTextureAlpha[Te]=es.alpha,gi=gi||ft.dayTextureAlpha[Te]!==1,ft.dayTextureNightAlpha[Te]=es.nightAlpha,ui=ui||ft.dayTextureNightAlpha[Te]!==1,ft.dayTextureDayAlpha[Te]=es.dayAlpha,ui=ui||ft.dayTextureDayAlpha[Te]!==1,ft.dayTextureBrightness[Te]=es.brightness,_n=_n||ft.dayTextureBrightness[Te]!==lc.DEFAULT_BRIGHTNESS,ft.dayTextureContrast[Te]=es.contrast,Eo=Eo||ft.dayTextureContrast[Te]!==lc.DEFAULT_CONTRAST,ft.dayTextureHue[Te]=es.hue,yo=yo||ft.dayTextureHue[Te]!==lc.DEFAULT_HUE,ft.dayTextureSaturation[Te]=es.saturation,La=La||ft.dayTextureSaturation[Te]!==lc.DEFAULT_SATURATION,ft.dayTextureOneOverGamma[Te]=1/es.gamma,Na=Na||ft.dayTextureOneOverGamma[Te]!==1/lc.DEFAULT_GAMMA,ft.dayTextureSplit[Te]=es.splitDirection,Ys=Ys||ft.dayTextureSplit[Te]!==0;let Uu=ft.dayTextureCutoutRectangles[Te];if(l(Uu)||(Uu=ft.dayTextureCutoutRectangles[Te]=new oe),oe.clone(oe.ZERO,Uu),l(es.cutoutRectangle)){let Po=WU(je,es.cutoutRectangle),ln=se.simpleIntersection(Po,je,h_e);kr=l(ln)||kr,Uu.x=(Po.west-je.west)*Xe,Uu.y=(Po.south-je.south)*ht,Uu.z=(Po.east-je.west)*Xe,Uu.w=(Po.north-je.south)*ht}let zu=ft.colorsToAlpha[Te];l(zu)||(zu=ft.colorsToAlpha[Te]=new oe);let Hu=l(es.colorToAlpha)&&es.colorToAlphaThreshold>0;if(il=il||Hu,Hu){let Po=es.colorToAlpha;zu.x=Po.red,zu.y=Po.green,zu.z=Po.blue,zu.w=es.colorToAlphaThreshold}else zu.w=-1;if(l(ol.credits)){let Po=ol.credits;for(let ln=0,Ee=Po.length;ln<Ee;++ln)o.addCreditToNextFrame(Po[ln])}++Te}ft.dayTextures.length=Te,ft.waterMask=a,oe.clone(c,ft.waterMaskTranslationAndScale),ft.minMaxHeight.x=W.minimumHeight,ft.minMaxHeight.y=W.maximumHeight,F.clone(W.matrix,ft.scaleAndBias);let po=e._clippingPlanes,Ar=l(po)&&po.enabled&&t.isClipped;Ar&&(ft.clippingPlanesEdgeColor=z.clone(po.edgeColor,ft.clippingPlanesEdgeColor),ft.clippingPlanesEdgeWidth=po.edgeWidth);let Km=e._clippingPolygons,Vr=l(Km)&&Km.enabled&&t.isClipped;Ae.numberOfDayTextures=Te,Ae.applyBrightness=_n,Ae.applyContrast=Eo,Ae.applyHue=yo,Ae.applySaturation=La,Ae.applyGamma=Na,Ae.applyAlpha=gi,Ae.applyDayNightAlpha=ui,Ae.applySplit=Ys,Ae.enableFog=Gt,Ae.enableClippingPlanes=Ar,Ae.clippingPlanes=po,Ae.enableClippingPolygons=Vr,Ae.clippingPolygons=Km,Ae.hasImageryLayerCutout=kr,Ae.colorCorrect=H,Ae.highlightFillTile=Ma,Ae.colorToAlpha=il,Ae.showUndergroundColor=T,Ae.translucent=h;let Vu=i.renderedMesh.indices.length;St||(Vu=i.renderedMesh.indexCountWithoutSkirts),it.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ae),it.castShadows=E,it.receiveShadows=w,it.renderState=Ct,it.primitiveType=Me.TRIANGLES,it.vertexArray=i.vertexArray||i.fill.vertexArray,it.count=Vu,it.uniformMap=Vi,it.pass=we.GLOBE,e._debug.wireframe&&(Gat(Jt,e,t),l(i.wireframeVertexArray)&&(it.vertexArray=i.wireframeVertexArray,it.primitiveType=Me.LINES,it.count=Vu*2));let Fa=it.boundingVolume,b0=it.orientedBoundingBox;n.mode!==ne.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,Y.minimumHeight,Y.maximumHeight,Fa),d.fromElements(Fa.center.z,Fa.center.x,Fa.center.y,Fa.center),n.mode===ne.MORPHING&&(Fa=ae.union(Y.boundingSphere,Fa,Fa))):(it.boundingVolume=ae.clone(Y.boundingSphere,Fa),it.orientedBoundingBox=wn.clone(Y.boundingVolume,b0)),it.dirty=!0,h&&f.updateDerivedCommands(it,n),d_e(it,n),Ct=Yt,ut=jat}while(ze<et)}var qU=Jo;function __e(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=se.clone(se.MAX_VALUE)}Object.defineProperties(__e.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=kt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=kt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=se.clone(se.MAX_VALUE)),se.clone(e,this._rectangle)}}});var YU=__e;function Ds(){this._layers=[],this.layerAdded=new me,this.layerRemoved=new me,this.layerMoved=new me,this.layerShownOrHidden=new me}Object.defineProperties(Ds.prototype,{length:{get:function(){return this._layers.length}}});Ds.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Ds.prototype.addImageryProvider=function(e,t){let n=new lc(e);return this.add(n,t),n};Ds.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Ds.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Ds.prototype.contains=function(e){return this.indexOf(e)!==-1};Ds.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ds.prototype.get=function(e){return this._layers[e]};function XU(e,t){return e.indexOf(t)}function y_e(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Ds.prototype.raise=function(e){let t=XU(this._layers,e);y_e(this,t,t+1)};Ds.prototype.lower=function(e){let t=XU(this._layers,e);y_e(this,t,t-1)};Ds.prototype.raiseToTop=function(e){let t=XU(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Ds.prototype.lowerToBottom=function(e){let t=XU(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Zat=new se;function x_e(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];se.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!se.contains(u.rectangle,t))continue;let h=Zat,p=1/1024;h.west=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),h.east=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),h.south=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),h.north=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),se.contains(h,t)&&i(u)}}Ds.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(x_e(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Ds.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(x_e(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=r[c];if(l(u)&&u.length>0)for(let h=0;h<u.length;++h){let p=u[h];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};Ds.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ds.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ds.prototype.isDestroyed=function(){return!1};Ds.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Ds.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var KU=Ds;function b_e(e){this._ellipsoid=new iy(e.ellipsoid,d.ZERO)}Object.defineProperties(b_e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var ZU=b_e;function $c(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=qn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=da.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}$c.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new $c({tilingScheme:e,x:s,y:r,level:0});return i};$c.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],se.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],se.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties($c.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new $c({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new $c({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new $c({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new $c({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<da.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});$c.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};$c.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};$c.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};$c.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};$c.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};$c.prototype.freeResources=function(){this.state=da.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),$U(this._southwestChild),this._southwestChild=void 0,$U(this._southeastChild),this._southeastChild=void 0,$U(this._northwestChild),this._northwestChild=void 0,$U(this._northeastChild),this._northeastChild=void 0};function $U(e){l(e)&&e.freeResources()}var QU=$c;function JU(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}JU.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};JU.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),T_e(this,t)),t=i}};function T_e(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}JU.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&T_e(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var ez=JU;function qf(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new ez,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new ZU({ellipsoid:n}),this._tileLoadProgressEvent=new me,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(qf.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});qf.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function $at(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,A_e(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}qf.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==da.START&&e(t),t=t.replacementNext};qf.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};qf.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};qf.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function A_e(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}qf.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&($at(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),A_e(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};qf.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),tct(this,e),fct(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Qat(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=me.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}qf.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(act(this,e),uct(this,e),Qat(this,e))};qf.prototype.isDestroyed=function(){return!1};qf.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var MI,C_e=new fe;function Jat(e,t){let n=se.center(e.rectangle,C_e),i=n.longitude-MI.longitude,o=n.latitude-MI.latitude;n=se.center(t.rectangle,C_e);let r=n.longitude-MI.longitude,s=n.latitude-MI.latitude;return i*i+o*o-(r*r+s*s)}var ect=new d,OI=[];function tct(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles)){let x=r.tilingScheme;if(l(x)){let b=r.tilingScheme;e._levelZeroTiles=QU.createLevelZeroTiles(b);let T=e._levelZeroTiles.length;if(OI.length<T)for(OI=new Array(T),o=0;o<T;++o)OI[o]===void 0&&(OI[o]=new LI)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;MI=t.camera.positionCartographic,a.sort(Jat);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,h=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(h,u,f);u.length=0,f.length=0}let _=t.camera;e._cameraPositionCartographic=_.positionCartographic;let m=F.getTranslation(_.transform,ect);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Pa(e,s,r,t,c,!1,OI[o]):(hg(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}function hg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function LI(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function E_e(){this.southwest=new LI,this.southeast=new LI,this.northwest=new LI,this.northeast=new LI}E_e.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var jY=new Array(31);for(let e=0;e<jY.length;++e)jY[e]=new E_e;function nct(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=rct(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:qn.NONE,_=e.tileProvider;if(s||i){let m=qn.originalResult(p)===qn.RENDERED,x=qn.originalResult(p)===qn.CULLED||p===qn.NONE,b=n.state===da.DONE,T=m||x||b;if(T||l(_.canRenderWithoutLosingDetail)&&(T=_.canRenderWithoutLosingDetail(n)),T){s&&hg(e,e._tileLoadQueueMedium,n,t),tz(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===qn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=qn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&hg(e,e._tileLoadQueueHigh,n,t)}if(_.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){tz(e,n),hg(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===qn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=qn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=qn.REFINED;let x=e._tilesToRender.length,b=e._tileLoadQueueLow.length,T=e._tileLoadQueueMedium.length,C=e._tileLoadQueueHigh.length,A=e._tileToUpdateHeights.length;if(ict(e,a,c,u,f,t,i,o),x!==e._tilesToRender.length){let S=o.allAreRenderable,v=o.anyWereRenderedLastFrame,D=o.notYetRenderableCount,O=!1;if(!S&&!v){let R=e._tilesToRender;for(let L=x;L<R.length;++L){let g=R[L];for(;g!==void 0&&g._lastSelectionResult!==qn.KICKED&&g!==n;)g._lastSelectionResult=qn.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=A,tz(e,n),n._lastSelectionResult=qn.RENDERED;let M=p===qn.RENDERED;!M&&D>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=T,e._tileLoadQueueHigh.length=C,hg(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,O=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=M,M||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!O&&hg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=qn.RENDERED,tz(e,n),hg(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===qn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function ict(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,h=jY[t.level],p=h.southwest,_=h.southeast,m=h.northwest,x=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Pa(e,t,u,r,f,s,p),Pa(e,n,u,r,f,s,_),Pa(e,i,u,r,f,s,m),Pa(e,o,u,r,f,s,x)):(Pa(e,i,u,r,f,s,m),Pa(e,t,u,r,f,s,p),Pa(e,o,u,r,f,s,x),Pa(e,n,u,r,f,s,_)):c.latitude<t.rectangle.north?(Pa(e,n,u,r,f,s,_),Pa(e,t,u,r,f,s,p),Pa(e,o,u,r,f,s,x),Pa(e,i,u,r,f,s,m)):(Pa(e,o,u,r,f,s,x),Pa(e,i,u,r,f,s,m),Pa(e,n,u,r,f,s,_),Pa(e,t,u,r,f,s,p)),h.combine(a)}function oct(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&se.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&se.contains(n,e._cameraReferenceFrameOriginCartographic)}function Pa(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==br.NONE)return nct(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,oct(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&hg(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:qn.NONE;c!==qn.CULLED_BUT_NEEDED&&c!==qn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=qn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(hg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=qn.CULLED):t._lastSelectionResult=qn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function rct(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof rn||t.camera.frustum instanceof Hr)return sct(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=P.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function sct(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),h=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(h-=P.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function tz(e,t){e._tilesToRender.push(t)}function act(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=Ci()+e._loadQueueTimeSlice,s=e._tileProvider,a=GY(e,t,s,r,n,!1);a=GY(e,t,s,r,i,a),GY(e,t,s,r,o,a)}function cct(e,t){return e._loadPriority-t._loadPriority}function GY(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(cct);for(let s=0,a=o.length;s<a&&(Ci()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var RE=new pn,WY=new fe,qy=new d,lct=[];function uct(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=lct;n.length=0;let i=e._tileToUpdateHeights,o=Ci(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let h=i[0];if(!l(h.data)||!l(h.data.mesh)){let x=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:qn.NONE;(x===qn.RENDERED||x===qn.CULLED_BUT_NEEDED)&&n.push(h),i.shift(),e._lastTileIndex=0;continue}let p=h.customData,_=p.length,m=!1;for(f=e._lastTileIndex;f<_;++f){let x=p[f],b=h.data.terrainData,T=l(b)&&b.wasCreatedByUpsampling();if(h.level>x.level&&!T){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=d.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let A=u.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,RE.direction),S=u.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,RE.origin);if(!l(S)){let v=0;l(h.data.tileBoundingRegion)&&(v=h.data.tileBoundingRegion.minimumHeight);let D=Math.min(v,-11500),O=d.multiplyByScalar(A,Math.abs(D)+1,qy);d.subtract(x.positionOnEllipsoidSurface,O,RE.origin)}}else fe.clone(x.positionCartographic,WY),WY.height=-11500,c.project(WY,qy),d.fromElements(qy.z,qy.x,qy.y,qy),d.clone(qy,RE.origin),d.clone(d.UNIT_X,RE.direction);let C=h.data.pick(RE,a,c,!1,qy);l(C)&&(l(x.callback)&&x.callback(C),x.level=h.level)}if(Ci()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function fct(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var nz=qf;function sh(e){e=y(e,ee.default);let t=new dg({ellipsoid:e}),n=new KU;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new xU,this._material=void 0,this._surface=new nz({tileProvider:new qU({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new me,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new kt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new YU,YY(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Se({url:nn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ee.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=P.PI*e.minimumRadius,this.nightFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*P.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=xn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(sh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=se.clone(se.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&YY(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,YY(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=kt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function YY(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Ph,tv];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(rL),e._surfaceShaderSet.baseVertexShaderSource=new Ue({sources:[Ph,tv,sL],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ue({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function dct(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),o=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var hct=[],mct={start:0,stop:0};sh.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=hct;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let _=p.pickBoundingSphere;if(o!==ne.SCENE3D)p.pickBoundingSphere=_=ae.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,_),d.fromElements(_.center.z,_.center.x,_.center.y,_.center);else if(l(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,_);else continue;let m=Zn.raySphere(e,_,mct);l(m)&&s.push(p)}s.sort(dct(e.origin));let h;for(c=s.length,f=0;f<c&&(h=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(h));++f);return h};var pct=new fe;sh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=d.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,pct);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var gct=new d,S_e=new d,_ct=new fe,yct=new pn;function qY(e,t){return l(e)&&se.contains(e.rectangle,t)?e:void 0}sh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!se.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=qY(n._southwestChild,e)||qY(n._southeastChild,e)||qY(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=d.fromRadians(e.longitude,e.latitude,0,a,gct),u=yct,f=a.geodeticSurfaceNormal(c,u.direction),h=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(h)){let _;l(n.data.tileBoundingRegion)&&(_=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(y(_,0),-11500),x=d.multiplyByScalar(f,Math.abs(m)+1,S_e);d.subtract(c,x,u.origin)}let p=n.data.pick(u,void 0,s,!1,S_e);if(l(p))return a.cartesianToCartographic(p,_ct).height};sh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};sh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Ot({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ne.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};sh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};sh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};sh.prototype.isDestroyed=function(){return!1};sh.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var iz=sh;function xct(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var oz=xct;var V_e={},bct=32.184,Tct=2451545,v_e=-.0529921,w_e=-.1059842,D_e=13.0120009,I_e=13.3407154,P_e=.9856003,R_e=26.4057084,O_e=13.064993,M_e=.3287146,L_e=1.7484877,N_e=-.1589763,F_e=.0036096,B_e=.1643573,k_e=12.9590088,XY=new Z;V_e.ComputeMoon=function(e,t){l(e)||(e=Z.now()),XY=Z.addSeconds(e,bct,XY);let n=Z.totalDays(XY)-Tct,i=n/jn.DAYS_PER_JULIAN_CENTURY,o=(125.045+v_e*n)*P.RADIANS_PER_DEGREE,r=(250.089+w_e*n)*P.RADIANS_PER_DEGREE,s=(260.008+D_e*n)*P.RADIANS_PER_DEGREE,a=(176.625+I_e*n)*P.RADIANS_PER_DEGREE,c=(357.529+P_e*n)*P.RADIANS_PER_DEGREE,u=(311.589+R_e*n)*P.RADIANS_PER_DEGREE,f=(134.963+O_e*n)*P.RADIANS_PER_DEGREE,h=(276.617+M_e*n)*P.RADIANS_PER_DEGREE,p=(34.226+L_e*n)*P.RADIANS_PER_DEGREE,_=(15.134+N_e*n)*P.RADIANS_PER_DEGREE,m=(119.743+F_e*n)*P.RADIANS_PER_DEGREE,x=(239.961+B_e*n)*P.RADIANS_PER_DEGREE,b=(25.053+k_e*n)*P.RADIANS_PER_DEGREE,T=Math.sin(o),C=Math.sin(r),A=Math.sin(s),S=Math.sin(a),v=Math.sin(c),D=Math.sin(u),O=Math.sin(f),R=Math.sin(h),M=Math.sin(p),L=Math.sin(_),g=Math.sin(m),E=Math.sin(x),w=Math.sin(b),I=Math.cos(o),N=Math.cos(r),B=Math.cos(s),H=Math.cos(a),V=Math.cos(c),G=Math.cos(u),k=Math.cos(f),W=Math.cos(h),Y=Math.cos(p),J=Math.cos(_),j=Math.cos(m),K=Math.cos(x),Q=Math.cos(b),de=(269.9949+.0031*i-3.8787*T-.1204*C+.07*A-.0172*S+.0072*D-.0052*L+.0043*w)*P.RADIANS_PER_DEGREE,ye=(66.5392+.013*i+1.5419*I+.0239*N-.0278*B+.0068*H-.0029*G+9e-4*k+8e-4*J-9e-4*Q)*P.RADIANS_PER_DEGREE,ce=(38.3213+13.17635815*n-14e-13*n*n+3.561*T+.1208*C-.0642*A+.0158*S+.0252*v-.0066*D-.0047*O-.0046*R+.0028*M+.0052*L+.004*g+.0019*E-.0044*w)*P.RADIANS_PER_DEGREE,ge=(13.17635815-14e-13*(2*n)+3.561*I*v_e+.1208*N*w_e-.0642*B*D_e+.0158*H*I_e+.0252*V*P_e-.0066*G*R_e-.0047*k*O_e-.0046*W*M_e+.0028*Y*L_e+.0052*J*N_e+.004*j*F_e+.0019*K*B_e-.0044*Q*k_e)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new oz),t.rightAscension=de,t.declination=ye,t.rotation=ce,t.rotationRate=ge,t};var rz=V_e;function U_e(e){(!l(e)||typeof e!="function")&&(e=rz.ComputeMoon),this._computeFunction=e}var Cct=new d,Act=new d,Ect=new d;function Sct(e,t,n){let i=Cct;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=Ect;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=d.cross(r,i,Act);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var vct=new $,wct=new Oe;U_e.prototype.evaluate=function(e,t){l(e)||(e=Z.now());let n=this._computeFunction(e),i=Sct(n.rightAscension,n.declination,t),o=P.zeroToTwoPi(n.rotation),r=Oe.fromAxisAngle(d.UNIT_Z,o,wct),s=$.fromQuaternion(Oe.conjugate(r,r),vct);return $.multiply(s,i,i)};var sz=U_e;var KY={position:0};function az(e){e=y(e,y.EMPTY_OBJECT),this.center=d.clone(y(e.center,d.ZERO)),this._center=new d,this.radii=d.clone(e.radii),this._radii=new d,this._oneOverEllipsoidRadiiSquared=new d,this._boundingSphere=new ae,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=y(e.show,!0),this.material=y(e.material,Yi.fromType(Yi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new $e({owner:y(e._owner,this)}),this._pickCommand=new $e({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function Dct(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=ja.createGeometry(ja.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY}));return t=ti.fromGeometry({context:e,geometry:n,attributeLocations:KY,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}az.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Dct(t));let o=!1,r=this.radii;if(!d.equals(this._radii,r)){d.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!F.equals(this.modelMatrix,this._modelMatrix)||!d.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),d.clone(this.center,this._center),F.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(d.clone(d.ZERO,this._boundingSphere.center),this._boundingSphere.radius=d.maximumComponent(r),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,h,p;(s||a||i||u)&&(h=new Ue({sources:[ev]}),p=new Ue({sources:[this.material.shaderSource,JS]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:KY}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=bt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let _=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?we.TRANSLUCENT:we.OPAQUE,_.push(f)),m.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(h=new Ue({sources:[ev]}),p=new Ue({sources:[this.material.shaderSource,JS],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=en.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:KY}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=bt(bt(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?we.TRANSLUCENT:we.OPAQUE,_.push(x)}};az.prototype.isDestroyed=function(){return!1};az.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var cz=az;function NI(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=nn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,ee.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new cz({radii:this.ellipsoid.radii,material:Yi.fromType(Yi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new sz}Object.defineProperties(NI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var lz=new $,Ict=new $,Pct=new d,uz=[];NI.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Mt.computeIcrfToFixedMatrix(n,lz))||Mt.computeTemeToPseudoFixedMatrix(n,lz);let i=this._axes.evaluate(n,Ict);$.transpose(i,i),$.multiply(lz,i,i);let o=F0.computeMoonPositionInEarthInertialFrame(n,Pct);$.multiplyByVector(lz,o,o),F.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=uz,uz.length=0,t.update(e),e.commandList=r,uz.length===1?uz[0]:void 0};NI.prototype.isDestroyed=function(){return!1};NI.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var fz=NI;var ZY=[],$Y=[];function Rct(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=ZY,u=$Y,f,h;for(f=0;f<s;++f)c[f]=e[i+f];for(h=0;h<a;++h)u[h]=e[o+h+1];f=0,h=0;for(let p=i;p<=r;++p){let _=c[f],m=u[h];f<s&&(h>=a||t(_,m,n)<=0)?(e[p]=_,++f):h<a&&(e[p]=m,++h)}}function QY(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);QY(e,t,n,i,r),QY(e,t,n,r+1,o),Rct(e,t,n,i,r,o)}function Oct(e,t,n){let i=e.length,o=Math.ceil(i*.5);ZY.length=o,$Y.length=o,QY(e,t,n,0,i-1),ZY.length=0,$Y.length=0}var Yy=Oct;function uc(e,t){this._occluderPosition=d.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var dz=new d;Object.defineProperties(uc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=d.clone(e,this._cameraPosition);let t=d.subtract(this._occluderPosition,e,dz),n=d.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=d.multiplyByScalar(t,n,dz);let a=o*o*n;s=d.add(e,d.multiplyByScalar(r,a,dz),dz)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});uc.fromBoundingSphere=function(e,t,n){return l(n)?(d.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new uc(e,t)};var H_e=new d;uc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=d.subtract(e,this._occluderPosition,H_e),n=this._occluderRadius;if(n=d.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=d.subtract(e,this._cameraPosition,t),n*n>d.magnitudeSquared(t)}return!1};var Mct=new d;uc.prototype.isBoundingSphereVisible=function(e){let t=d.clone(e.center,Mct),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,H_e),o=this._occluderRadius-n;if(o=d.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i),o*o+n*n>d.magnitudeSquared(i)):!1;if(o>0){i=d.subtract(t,this._cameraPosition,i);let r=d.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var Lct=new d;uc.prototype.computeVisibility=function(e){let t=d.clone(e.center),n=e.radius;if(n>this._occluderRadius)return br.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,Lct),o=this._occluderRadius-n,r=d.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i);let s=d.magnitudeSquared(i);return o*o+n*n<s?br.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?br.FULL:br.PARTIAL):(i=d.subtract(t,this._horizonPlanePosition,i),d.dot(i,this._horizonPlaneNormal)>-n?br.PARTIAL:br.FULL))}}return br.NONE};var hz=new d;uc.computeOccludeePoint=function(e,t,n){let i=d.clone(t),o=d.clone(e.center),r=e.radius,s=n.length,a=d.normalize(d.subtract(i,o,hz),hz),c=-d.dot(a,o),u=uc._anyRotationVector(o,a,c),f=uc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let h;for(let _=1;_<s;++_){if(h=uc._horizonToPlaneNormalDotProduct(e,a,c,u,n[_]),!h)return;h<f&&(f=h)}if(f<.0017453283658983088)return;let p=r/f;return d.add(o,d.multiplyByScalar(a,p,hz),hz)};var Nct=[];uc.computeOccludeePointFromRectangle=function(e,t){t=y(t,ee.default);let n=se.subsample(e,t,0,Nct),i=ae.fromPoints(n),o=d.ZERO;if(!d.equals(o,i.center))return uc.computeOccludeePoint(new ae(o,t.minimumRadius),i.center,n)};var Fct=new d;uc._anyRotationVector=function(e,t,n){let i=d.abs(t,Fct),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new d,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=d.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=d.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=d.UNIT_Z);let a=(d.dot(t,i)+n)/-d.dot(t,s);return d.normalize(d.subtract(d.add(i,d.multiplyByScalar(s,a,r),i),e,i),i)};var Bct=new d;uc._rotationVector=function(e,t,n,i,o){let r=d.subtract(i,e,Bct);if(r=d.normalize(r,r),d.dot(t,r)<.9999999847691291){let s=d.cross(t,r,r);if(d.magnitude(s)>P.EPSILON13)return d.normalize(s,new d)}return o};var JY=new d,kct=new d,mz=new d,z_e=new d;uc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=d.clone(o,JY),s=d.clone(e.center,kct),a=e.radius,c=d.subtract(s,r,mz),u=d.magnitudeSquared(c),f=a*a;if(u<f)return!1;let h=u-f,p=Math.sqrt(h),m=1/Math.sqrt(u),b=p*m*p;c=d.normalize(c,c);let T=d.add(r,d.multiplyByScalar(c,b,z_e),z_e),C=Math.sqrt(h-b*b),A=this._rotationVector(s,t,n,r,i),S=d.fromElements(A.x*A.x*c.x+(A.x*A.y-A.z)*c.y+(A.x*A.z+A.y)*c.z,(A.x*A.y+A.z)*c.x+A.y*A.y*c.y+(A.y*A.z-A.x)*c.z,(A.x*A.z-A.y)*c.x+(A.y*A.z+A.x)*c.y+A.z*A.z*c.z,JY);S=d.normalize(S,S);let v=d.multiplyByScalar(S,C,JY);A=d.normalize(d.subtract(d.add(T,v,mz),s,mz),mz);let D=d.dot(t,A);A=d.normalize(d.subtract(d.subtract(T,v,A),s,A),A);let O=d.dot(t,A);return D<O?D:O};var pz=uc;function Fm(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new ys,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function eX(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Fm.prototype,{projectionMatrix:{get:function(){return eX(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return eX(this),this._infinitePerspective}}});var Vct=new d,Uct=new d,zct=new d,Hct=new d;Fm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=d.cross(t,n,Vct),h=Uct;d.multiplyByScalar(t,c,h),d.add(e,h,h);let p=zct;d.multiplyByScalar(t,u,p),d.add(e,p,p);let _=Hct;d.multiplyByScalar(f,a,_),d.add(h,_,_),d.subtract(_,e,_),d.normalize(_,_),d.cross(_,n,_),d.normalize(_,_);let m=i[0];return l(m)||(m=i[0]=new oe),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-d.dot(_,e),d.multiplyByScalar(f,s,_),d.add(h,_,_),d.subtract(_,e,_),d.cross(n,_,_),d.normalize(_,_),m=i[1],l(m)||(m=i[1]=new oe),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-d.dot(_,e),d.multiplyByScalar(n,r,_),d.add(h,_,_),d.subtract(_,e,_),d.cross(f,_,_),d.normalize(_,_),m=i[2],l(m)||(m=i[2]=new oe),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-d.dot(_,e),d.multiplyByScalar(n,o,_),d.add(h,_,_),d.subtract(_,e,_),d.cross(_,f,_),d.normalize(_,_),m=i[3],l(m)||(m=i[3]=new oe),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-d.dot(_,e),m=i[4],l(m)||(m=i[4]=new oe),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-d.dot(t,h),d.negate(t,_),m=i[5],l(m)||(m=i[5]=new oe),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-d.dot(_,p),this._cullingVolume};Fm.prototype.getPixelDimensions=function(e,t,n,i,o){eX(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};Fm.prototype.clone=function(e){return l(e)||(e=new Fm),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Fm.prototype.equals=function(e){return l(e)&&e instanceof Fm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Fm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Fm&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Fl=Fm;function Bl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Fl,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}Bl.packedLength=6;Bl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};Bl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Bl),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function ah(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(Bl.prototype,{projectionMatrix:{get:function(){return ah(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return ah(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return ah(this),this._fovy}},sseDenominator:{get:function(){return ah(this),this._sseDenominator}},offCenterFrustum:{get:function(){return ah(this),this._offCenterFrustum}}});Bl.prototype.computeCullingVolume=function(e,t,n){return ah(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Bl.prototype.getPixelDimensions=function(e,t,n,i,o){return ah(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Bl.prototype.clone=function(e){return l(e)||(e=new Bl),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Bl.prototype.equals=function(e){return!l(e)||!(e instanceof Bl)?!1:(ah(this),ah(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Bl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Bl)?!1:(ah(this),ah(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Di=Bl;function FI(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(FI.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Gct(e,t,n){let i=t.createViewportQuadCommand(jM,{framebuffer:n,renderState:Ve.fromCache({viewport:new qe(0,0,256,256)})});e._drawCommand=i}FI.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Ot({context:t,width:256,height:256,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:$t.NEAREST});this._colorTexture=n;let i=new zr({context:t,colorTextures:[n],destroyAttachments:!1});Gct(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};FI.prototype.isDestroyed=function(){return!1};FI.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var gz=FI;var q_e={};function Wct(e,t,n){let i,o,r;if(e instanceof Di){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof Fl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var jct=new d,G_e=new d;function Y_e(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let h=(f-r)/c;return P.lerp(-P.PI_OVER_TWO,t,1-h)}}return function(o){return P.lerp(e,t,o)}}function nX(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,u=e.up,f=e.right,h=e.frustum,p=d.subtract(a,c,jct),_=d.magnitude(d.multiplyByScalar(u,d.dot(p,u),G_e)),m=d.magnitude(d.multiplyByScalar(f,d.dot(p,f),G_e));r=Math.min(Wct(h,_,m)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return P.lerp(n,i,a)}}function BI(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var X_e=new d;function qct(e,t,n,i,o,r,s,a){let c=e.camera,u=d.clone(c.position,X_e),f=c.pitch,h=BI(c.heading,i),p=BI(c.roll,r),_=nX(c,n,u.z,n.z,s),m=Y_e(f,o,_,a);function x(b){let T=b.time/t;c.setView({orientation:{heading:P.lerp(h,i,T),pitch:m(T),roll:P.lerp(p,r,T)}}),U.lerp(u,n,T,c.position),c.position.z=_(T)}return x}function Yct(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function Xct(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var Kct=new fe,Zct=new fe;function $ct(e,t,n,i,o,r,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,_=fe.clone(f.positionCartographic,Kct),m=f.pitch,x=BI(f.heading,i),b=BI(f.roll,r),T=p.cartesianToCartographic(n,Zct);_.longitude=P.zeroToTwoPi(_.longitude),T.longitude=P.zeroToTwoPi(T.longitude);let C=!1;if(l(a)){let D=P.zeroToTwoPi(a),O=Math.min(_.longitude,T.longitude),R=Math.max(_.longitude,T.longitude),M=D>=O&&D<=R;if(l(c)){let L=Math.abs(_.longitude-T.longitude),g=P.TWO_PI-L;(M?L:g)<(M?g:L)*c&&!M&&(C=!0)}else M||(C=!0)}C?Yct(_,T):Xct(_,T);let A=nX(f,n,_.height,T.height,s),S=Y_e(m,o,A,u);function v(){let D=_.longitude,O=T.longitude,R=_.latitude,M=T.latitude;return function(g){let E=g.time/t,w=d.fromRadians(P.lerp(D,O,E),P.lerp(R,M,E),A(E),p);f.setView({destination:w,orientation:{heading:P.lerp(x,i,E),pitch:S(E),roll:P.lerp(b,r,E)}})}}return v()}function Qct(e,t,n,i,o,r,s){let a=e.camera,c=d.clone(a.position,X_e),u=BI(a.heading,i),f=a.frustum.right-a.frustum.left,h=nX(a,n,f,n.z,s);function p(_){let m=_.time/t;a.setView({orientation:{heading:P.lerp(u,i,m)}}),U.lerp(c,n,m,a.position);let x=h(m),b=a.frustum,T=b.top/b.right,C=(x-(b.right-b.left))*.5;b.right+=C,b.left-=C,b.top=T*b.right,b.bottom=-b.top}return p}var W_e=new fe,Jct=new d;function tX(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function j_e(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}q_e.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ne.MORPHING)return tX();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,W_e),n=r.project(W_e,Jct));let p=e.camera,_=t.endTransform;l(_)&&p._setTransform(_);let m=t.duration;l(m)||(m=Math.ceil(d.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let x=y(t.heading,0),b=y(t.pitch,-P.PI_OVER_TWO),T=y(t.roll,0),C=e.screenSpaceCameraController;C.enableInputs=!1;let A=j_e(C,t.complete),S=j_e(C,t.cancel),v=p.frustum,D=e.mode===ne.SCENE2D;if(D=D&&U.equalsEpsilon(p.position,n,P.EPSILON6),D=D&&P.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,P.EPSILON6),D=D||e.mode!==ne.SCENE2D&&d.equalsEpsilon(n,p.position,P.EPSILON10),D=D&&P.equalsEpsilon(P.negativePiToPi(x),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(b),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(T),P.negativePiToPi(p.roll),P.EPSILON10),D)return tX(A,S);let O=new Array(4);if(O[ne.SCENE2D]=Qct,O[ne.SCENE3D]=$ct,O[ne.COLUMBUS_VIEW]=qct,m<=0)return tX(function(){O[i](e,1,n,x,b,T,a,c,u,f)({time:1}),typeof A=="function"&&A()},S);let R=O[i](e,m,n,x,b,T,a,c,u,f);if(!l(h)){let M=p.positionCartographic.height,L=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;M>L&&M>11500?h=$r.CUBIC_OUT:h=$r.QUINTIC_IN_OUT}return{duration:m,easingFunction:h,startObject:{time:0},stopObject:{time:m},update:R,complete:A,cancel:S}};var _z=q_e;var elt={ROTATE:0,INFINITE_SCROLL:1},Du=Object.freeze(elt);function Qt(e){this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.IDENTITY),this._transformChanged=!1,this.position=new d,this._position=new d,this._positionWC=new d,this._positionCartographic=new fe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new d,this._direction=new d,this._directionWC=new d,this.up=new d,this._up=new d,this._upWC=new d,this.right=new d,this._right=new d,this._rightWC=new d,this.frustum=new Di,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new me,this._moveEnd=new me,this._changed=new me,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new F,this._invViewMatrix=new F,nye(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new fe(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,mye(this,Qt.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=d.magnitude(this.position);n+=n*Qt.DEFAULT_VIEW_FACTOR,d.normalize(this.position,this.position),d.multiplyByScalar(this.position,n,this.position)}Qt.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Qt.TRANSFORM_2D_INVERSE=F.inverseTransformation(Qt.TRANSFORM_2D,new F);Qt.DEFAULT_VIEW_RECTANGLE=se.fromDegrees(-95,-20,-70,90);Qt.DEFAULT_VIEW_FACTOR=.5;Qt.DEFAULT_OFFSET=new Kd(0,-P.PI_OVER_FOUR,0);function nye(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function tlt(e){if(!l(e._oldPositionWC))e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=d.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=d.magnitude(t),e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ci()):e.timeSinceMoved=Math.max(Ci()-e._lastMovedTimestamp,0)/1e3}}Qt.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};Qt.prototype._updateCameraChanged=function(){let e=this;if(tlt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%P.TWO_PI;s=s>P.PI?P.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,_=e._changedPosition,m=e.frustum,x=e._changedFrustum,b=p.x+m.left,T=p.x+m.right,C=_.x+x.left,A=_.x+x.right,S=p.y+m.bottom,v=p.y+m.top,D=_.y+x.bottom,O=_.y+x.top,R=Math.max(b,C),M=Math.min(T,A),L=Math.max(S,D),g=Math.min(v,O),E;if(R>=M||L>=v)E=1;else{let w=x;b<C&&T>A&&S<D&&v>O&&(w=m),E=1-(M-R)*(g-L)/((w.right-w.left)*(w.top-w.bottom))}E>t&&(e._changed.raiseEvent(E),e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection);return}let c=P.acosClamped(d.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let h=d.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||h>t)&&(e._changed.raiseEvent(Math.max(u,h)),e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection))};function nlt(e){Mt.basisTo2D(e._projection,e._transform,e._actualTransform)}var ilt=new fe,olt=new d,yz=new d,rlt=new oe,slt=new oe,alt=new oe,clt=new oe,llt=new oe;function ult(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,rlt),o=n.cartesianToCartographic(i,ilt),r=t.project(o,olt),s=slt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=oe.clone(oe.UNIT_X,llt),c=oe.add(F.getColumn(e._transform,0,yz),i,yz);n.cartesianToCartographic(c,o),t.project(o,r);let u=alt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,d.subtract(u,s,u),u.x=0;let f=clt;if(d.magnitudeSquared(u)>P.EPSILON10)d.cross(a,u,f);else{let h=oe.add(F.getColumn(e._transform,1,yz),i,yz);n.cartesianToCartographic(h,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,d.subtract(f,s,f),f.x=0,d.magnitudeSquared(f)<P.EPSILON10&&(oe.clone(oe.UNIT_Y,u),oe.clone(oe.UNIT_Z,f))}d.cross(f,a,u),d.normalize(u,u),d.cross(a,u,f),d.normalize(f,f),F.setColumn(e._actualTransform,0,u,e._actualTransform),F.setColumn(e._actualTransform,1,f,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var iX=new d;function dc(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!d.equals(o,e.position)||n;r&&(o=d.clone(e.position,e._position));let s=e._direction,a=!d.equals(s,e.direction);a&&(d.normalize(e.direction,e.direction),s=d.clone(e.direction,e._direction));let c=e._up,u=!d.equals(c,e.up);u&&(d.normalize(e.up,e.up),c=d.clone(e.up,e._up));let f=e._right,h=!d.equals(f,e.right);h&&(d.normalize(e.right,e.right),f=d.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone(Qt.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?nlt(e):ult(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let _=e._actualTransform;if(r||p)if(e._positionWC=F.multiplyByPoint(_,o,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=iX;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===ne.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||h){let m=d.dot(s,d.cross(c,f,iX));if(Math.abs(1-m)>P.EPSILON2){let x=1/d.magnitudeSquared(c),b=d.dot(c,s)*x,T=d.multiplyByScalar(s,b,iX);c=d.normalize(d.subtract(c,T,e._up),e._up),d.clone(c,e.up),f=d.cross(s,c,e._right),d.clone(f,e.right)}}(a||p)&&(e._directionWC=F.multiplyByPointAsVector(_,s,e._directionWC),d.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=F.multiplyByPointAsVector(_,c,e._upWC),d.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=F.multiplyByPointAsVector(_,f,e._rightWC),d.normalize(e._rightWC,e._rightWC)),(r||a||u||h||p)&&nye(e)}function iye(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function oye(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function rye(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var Tz=new F,Cz=new F;Object.defineProperties(Qt.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return dc(this),this._invTransform}},viewMatrix:{get:function(){return dc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return dc(this),this._invViewMatrix}},positionCartographic:{get:function(){return dc(this),this._positionCartographic}},positionWC:{get:function(){return dc(this),this._positionWC}},directionWC:{get:function(){return dc(this),this._directionWC}},upWC:{get:function(){return dc(this),this._upWC}},rightWC:{get:function(){return dc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,Tz),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,Cz);this._setTransform(n);let i=iye(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,Tz),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,Cz);this._setTransform(n);let i=oye(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,Tz),n=Mt.eastNorthUpToFixedFrame(this.positionWC,e,Cz);this._setTransform(n);let i=rye(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});Qt.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===ne.SCENE2D&&lye(this,this.position)};var flt=new d,dlt=new d,hlt=new d;Qt.prototype._setTransform=function(e){let t=d.clone(this.positionWC,flt),n=d.clone(this.upWC,dlt),i=d.clone(this.directionWC,hlt);F.clone(e,this._transform),this._transformChanged=!0,dc(this);let o=this._actualInvTransform;F.multiplyByPoint(o,t,this.position),F.multiplyByPointAsVector(o,i,this.direction),F.multiplyByPointAsVector(o,n,this.up),d.cross(this.direction,this.up,this.right),dc(this)};var mlt=new U,plt=new pn,glt=new d,_lt=new d;function sye(e){if(!F.equals(F.IDENTITY,e.transform))return d.magnitude(e.position);let t=e._scene,n=t.globe,i=mlt;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,plt);o=n.pickWorldCoordinates(a,t,!0,glt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,_lt));let s;if(l(o)||l(r)){let a=l(r)?d.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?d.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}Qt.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof rn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=sye(this)))};var Az=new d,cX=new F,ylt=new F,lX=new Oe,uX=new $,aye=new fe;function xlt(e,t,n){let i=F.clone(e.transform,cX),o=Mt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,ylt);e._setTransform(o),d.clone(d.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let r=Oe.fromHeadingPitchRoll(n,lX),s=$.fromQuaternion(r,uX);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function blt(e,t,n,i){let o=F.clone(e.transform,cX);if(e._setTransform(F.IDENTITY),!d.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,aye);t=a.project(c,Az)}d.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let r=Oe.fromHeadingPitchRoll(n,lX),s=$.fromQuaternion(r,uX);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Tlt(e,t,n,i){let o=F.clone(e.transform,cX);if(e._setTransform(F.IDENTITY),!d.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,aye);t=c.project(u,Az)}U.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Du.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let r=Oe.fromHeadingPitchRoll(n,lX),s=$.fromQuaternion(r,uX);$.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Clt=new d,Alt=new d,Elt=new d;function cye(e,t,n,i){let o=d.clone(n.direction,Clt),r=d.clone(n.up,Alt);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Mt.eastNorthUpToFixedFrame(t,a,Tz),u=F.inverseTransformation(c,Cz);F.multiplyByPointAsVector(u,o,o),F.multiplyByPointAsVector(u,r,r)}let s=d.cross(o,r,Elt);return i.heading=iye(o,r),i.pitch=oye(o),i.roll=rye(o,r,s),i}var aX={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},OE=new Ha;Qt.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,d.clone(this.positionWC,Az));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,Az),i=!1),l(t.direction)&&(t=cye(this,o,t,aX.orientation)),OE.heading=y(t.heading,0),OE.pitch=y(t.pitch,-P.PI_OVER_TWO),OE.roll=y(t.roll,0),n===ne.SCENE3D?xlt(this,o,OE):n===ne.SCENE2D?Tlt(this,o,OE,i):blt(this,o,OE,i)};var Slt=new d;Qt.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:Qt.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates(Qt.DEFAULT_VIEW_RECTANGLE),i=d.magnitude(n);i+=i*Qt.DEFAULT_VIEW_FACTOR,d.normalize(n,n),d.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new d(0,-1,1);i=d.multiplyByScalar(d.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(d.normalize(i,Slt).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};Qt.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new oe),dc(this),F.multiplyByVector(this._actualInvTransform,e,t)};Qt.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new d),dc(this),F.multiplyByPoint(this._actualInvTransform,e,t)};Qt.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new d),dc(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};Qt.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new oe),dc(this),F.multiplyByVector(this._actualTransform,e,t)};Qt.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new d),dc(this),F.multiplyByPoint(this._actualTransform,e,t)};Qt.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new d),dc(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function lye(e,t){let n=e._scene.mapMode2D===Du.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var K_e=new d;Qt.prototype.move=function(e,t){let n=this.position;d.multiplyByScalar(e,t,K_e),d.add(n,K_e,n),this._mode===ne.SCENE2D&&lye(this,n),this._adjustOrthographicFrustum(!0)};Qt.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?Ez(this,e):this.move(this.direction,e)};Qt.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?Ez(this,-e):this.move(this.direction,-e)};Qt.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};Qt.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};Qt.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};Qt.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};Qt.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,-e)};Qt.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,e)};Qt.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,-e)};Qt.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,e)};var vlt=new Oe,wlt=new $;Qt.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Oe.fromAxisAngle(e,-n,vlt),o=$.fromQuaternion(i,wlt),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};Qt.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};Qt.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Dlt=new Oe,Ilt=new $;Qt.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Oe.fromAxisAngle(e,-n,Dlt),o=$.fromQuaternion(i,Ilt);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),d.cross(this.direction,this.up,this.right),d.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};Qt.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),uye(this,e)};Qt.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),uye(this,-e)};var Plt=new d,Rlt=new d,Olt=new d,Z_e=new d;function uye(e,t){let n=e.position;if(l(e.constrainedAxis)&&!d.equalsEpsilon(e.position,d.ZERO,P.EPSILON2)){let i=d.normalize(n,Plt),o=d.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),r=d.equalsEpsilon(i,d.negate(e.constrainedAxis,Z_e),P.EPSILON2);if(!o&&!r){let s=d.normalize(e.constrainedAxis,Rlt),a=d.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=d.dot(i,d.negate(s,Z_e)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=d.cross(s,i,Olt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}Qt.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),fye(this,-e)};Qt.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),fye(this,e)};function fye(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function Ez(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Du.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Du.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function dye(e,t){e.move(e.direction,t)}Qt.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?Ez(this,e):dye(this,e)};Qt.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?Ez(this,-e):dye(this,-e)};Qt.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return d.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Mlt=new F;Qt.prototype.lookAt=function(e,t){let n=this._scene,i=y(n.ellipsoid,ee.default),o=Mt.eastNorthUpToFixedFrame(e,i,Mlt);this.lookAtTransform(o,t)};var Llt=new d,Nlt=new Oe,Flt=new Oe,Blt=new $;function hye(e,t,n){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let i=Oe.fromAxisAngle(d.UNIT_Y,-t,Nlt),o=Oe.fromAxisAngle(d.UNIT_Z,-e,Flt),r=Oe.multiply(o,i,o),s=$.fromQuaternion(r,Blt),a=d.clone(d.UNIT_X,Llt);return $.multiplyByVector(s,a,a),d.negate(a,a),d.multiplyByScalar(a,n,a),a}Qt.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=hye(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){U.clone(U.ZERO,this.position),d.negate(n,this.up),this.up.z=0,d.magnitudeSquared(this.up)<P.EPSILON10&&d.clone(d.UNIT_Y,this.up),d.normalize(this.up,this.up),this._setTransform(F.IDENTITY),d.negate(d.UNIT_Z,this.direction),d.cross(this.direction,this.up,this.right),d.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=d.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}d.clone(n,this.position),d.negate(this.position,this.direction),d.normalize(this.direction,this.direction),d.cross(this.direction,d.UNIT_Z,this.right),d.magnitudeSquared(this.right)<P.EPSILON10&&d.clone(d.UNIT_X,this.right),d.normalize(this.right,this.right),d.cross(this.right,this.direction,this.up),d.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var kI=new fe,klt=new fe,Vlt=new d,Ult=new d,zlt=new d,Hlt=new d,Glt=new d,Wlt=new d,jlt=new d,oX=new d,qlt={direction:new d,right:new d,up:new d},$_e;function fc(e,t,n,i){return Math.abs(d.dot(t,n))/i-d.dot(e,n)}function mye(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:qlt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=P.TWO_PI);let f=(c+u)*.5,h;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)h=0;else{let M=kI;M.longitude=f,M.latitude=s,M.height=0;let L=klt;L.longitude=f,L.latitude=a,L.height=0;let g=$_e;(!l(g)||g.ellipsoid!==o)&&($_e=g=new Xg(void 0,void 0,o)),g.setEndPoints(M,L),h=g.interpolateUsingFraction(.5,kI).latitude}let p=kI;p.longitude=f,p.latitude=h,p.height=0;let _=o.cartographicToCartesian(p,jlt),m=kI;m.longitude=u,m.latitude=s;let x=o.cartographicToCartesian(m,Vlt);m.longitude=c;let b=o.cartographicToCartesian(m,zlt);m.longitude=f;let T=o.cartographicToCartesian(m,Glt);m.latitude=a;let C=o.cartographicToCartesian(m,Wlt);m.longitude=u;let A=o.cartographicToCartesian(m,Hlt);m.longitude=c;let S=o.cartographicToCartesian(m,Ult);d.subtract(b,_,b),d.subtract(A,_,A),d.subtract(x,_,x),d.subtract(S,_,S),d.subtract(T,_,T),d.subtract(C,_,C);let v=o.geodeticSurfaceNormal(_,r.direction);d.negate(v,v);let D=d.cross(v,d.UNIT_Z,r.right);d.normalize(D,D);let O=d.cross(D,v,r.up),R;if(e.frustum instanceof rn){let M=Math.max(d.distance(x,b),d.distance(A,S)),L=Math.max(d.distance(x,A),d.distance(b,S)),g,E,w=e.frustum._offCenterFrustum,I=w.right/w.top,N=L*I;M>N?(g=M,E=g/I):(E=L,g=N),R=Math.max(g,E)}else{let M=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*M;if(R=Math.max(fc(v,O,b,M),fc(v,O,A,M),fc(v,O,x,M),fc(v,O,S,M),fc(v,O,T,M),fc(v,O,C,M),fc(v,D,b,L),fc(v,D,A,L),fc(v,D,x,L),fc(v,D,S,L),fc(v,D,T,L),fc(v,D,C,L)),a<0&&s>0){let g=kI;g.longitude=c,g.latitude=0,g.height=0;let E=o.cartographicToCartesian(g,oX);d.subtract(E,_,E),R=Math.max(R,fc(v,O,E,M),fc(v,D,E,L)),g.longitude=u,E=o.cartographicToCartesian(g,oX),d.subtract(E,_,E),R=Math.max(R,fc(v,O,E,M),fc(v,D,E,L))}}return d.add(_,d.multiplyByScalar(v,-R,oX),n)}var Ylt=new fe,Xlt=new d,Klt=new d;function Zlt(e,t,n){let i=e._projection;t.west>t.east&&(t=se.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Ylt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Xlt);F.multiplyByPoint(o,a,a),F.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Klt);if(F.multiplyByPoint(o,c,c),F.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var $lt=new fe,Qlt=new d,Jlt=new d;function eut(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Du.INFINITE_SCROLL?o+=P.TWO_PI:(t=se.MAX_VALUE,o=t.east));let r=$lt;r.longitude=o,r.latitude=t.north;let s=i.project(r,Qlt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,Jlt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,h,p=e.frustum.right/e.frustum.top,_=u*p;return c>_?(f=c,h=f/p):(h=u,f=_),u=Math.max(2*f,2*h),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}Qt.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new d),n===ne.SCENE3D)return mye(this,e,t);if(n===ne.COLUMBUS_VIEW)return Zlt(this,e,t);if(n===ne.SCENE2D)return eut(this,e,t)};var tut=new pn;function nut(e,t,n,i){n=y(n,ee.default);let o=e.getPickRay(t,tut),r=Zn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return pn.getPoint(o,s,i)}var iut=new pn;function out(e,t,n,i){let r=e.getPickRay(t,iut).origin;r=d.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var rut=new pn;function sut(e,t,n,i){let o=e.getPickRay(t,rut),r=-o.origin.x/o.direction.x;pn.getPoint(o,r,i);let s=n.unproject(new d(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}Qt.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new d),t=y(t,ee.default),this._mode===ne.SCENE3D)n=nut(this,e,t,n);else if(this._mode===ne.SCENE2D)n=out(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=sut(this,e,this._projection,n);else return;return n}};var aut=new d,cut=new d,lut=new d;function uut(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,h=e.positionWC;d.clone(h,n.origin);let p=d.multiplyByScalar(e.directionWC,c,aut);d.add(h,p,p);let _=d.multiplyByScalar(e.rightWC,u*c*a,cut),m=d.multiplyByScalar(e.upWC,f*c*s,lut),x=d.add(p,_,n.direction);return d.add(x,m,x),d.subtract(x,h,x),d.normalize(x,x),n}var xz=new d;function fut(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return d.clone(e.position,f),d.multiplyByScalar(e.right,c,xz),d.add(xz,f,f),d.multiplyByScalar(e.up,u,xz),d.add(xz,f,f),d.clone(e.directionWC,n.direction),(e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D)&&d.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}Qt.prototype.getPickRay=function(e,t){l(t)||(t=new pn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?uut(this,e,t):fut(this,e,t)};var dut=new d,hut=new d;Qt.prototype.distanceToBoundingSphere=function(e){let t=d.subtract(this.positionWC,e.center,dut),n=d.multiplyByScalar(this.directionWC,d.dot(t,this.directionWC),hut);return Math.max(0,d.magnitude(n)-e.radius)};var mut=new U;Qt.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,mut);return Math.max(o.x,o.y)};function put(e,t,n,i,o,r){let s=d.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let u=d.lerp(t,s,c.time,new d);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:$r.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var gut=new d,Q_e=new d,_ut=new d,yut=new d;function xut(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(d.UNIT_X,gut),r=-d.dot(o,n)/d.dot(o,i),s=d.add(n,d.multiplyByScalar(i,r,Q_e),Q_e);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,_ut);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=d.magnitude(d.subtract(n,s,yut)),f=c*u,h=a*u,p=e._maxCoord.x,_=e._maxCoord.y,m=Math.max(f-p,p),x=Math.max(h-_,_);if(n.z<-m||n.z>m||n.y<-x||n.y>x){let b=s.y<-m||s.y>m,T=s.z<-x||s.z>x;if(b||T)return put(e,n,s,m,x,t)}}Qt.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return xut(this,e)};var but=new d,Ws={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};Qt.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};Qt.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Ws.destination,e.orientation.heading=Ws.heading,e.orientation.pitch=Ws.pitch,e.orientation.roll=Ws.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};Qt.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof se;i&&(t=this.getRectangleCameraCoordinates(t,but));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=cye(this,t,o,aX.orientation)),l(e.duration)&&e.duration<=0){let f=aX;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;Ws.destination=t,Ws.heading=o.heading,Ws.pitch=o.pitch,Ws.roll=o.roll,Ws.duration=e.duration,Ws.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Ws.cancel=e.cancel,Ws.endTransform=e.endTransform,Ws.convert=i?!1:e.convert,Ws.maximumHeight=e.maximumHeight,Ws.pitchAdjustHeight=e.pitchAdjustHeight,Ws.flyOverLongitude=e.flyOverLongitude,Ws.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ws.easingFunction=e.easingFunction;let a=this._scene,c=_z.createTween(a,Ws);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=Qt.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Tut(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Cut(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var Aut=100;function pye(e,t,n){n=Kd.clone(l(n)?n:Qt.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=Aut:e.frustum instanceof rn||e._mode===ne.SCENE2D?n.range=Cut(e,s):n.range=Tut(e,s),n.range=P.clamp(n.range,i,o)}return n}Qt.prototype.viewBoundingSphere=function(e,t){t=pye(this,e,t),this.lookAt(e.center,t)};var Eut=new F,Sut=new d,vut=new d,wut=new d,Dut=new d,Iut=new oe,Put=new Oe,Rut=new $;Qt.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=pye(this,e,t.offset),o;n?o=d.multiplyByScalar(d.UNIT_Z,i.range,Sut):o=hye(i.heading,i.pitch,i.range);let r=this._scene,s=y(r.ellipsoid,ee.default),a=Mt.eastNorthUpToFixedFrame(e.center,s,Eut);F.multiplyByPoint(a,o,o);let c,u;if(!n){if(c=d.subtract(e.center,o,vut),d.normalize(c,c),u=F.multiplyByPointAsVector(a,d.UNIT_Z,wut),1-Math.abs(d.dot(c,u))<P.EPSILON6){let h=Oe.fromAxisAngle(c,i.heading,Put),p=$.fromQuaternion(h,Rut);d.fromCartesian4(F.getColumn(a,1,Iut),u),$.multiplyByVector(p,u,u)}let f=d.cross(c,u,Dut);d.cross(f,c,u),d.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var J_e=new d,eye=new d,rX=new d,tye=new d,VI=[new d,new d,new d,new d];function Out(e,t){let n=t.radii,i=e.positionWC,o=d.multiplyComponents(t.oneOverRadii,i,J_e),r=d.magnitude(o),s=d.normalize(o,eye),a,c;d.equalsEpsilon(s,d.UNIT_Z,P.EPSILON10)?(a=new d(0,1,0),c=new d(0,0,1)):(a=d.normalize(d.cross(d.UNIT_Z,s,rX),rX),c=d.normalize(d.cross(s,a,tye),tye));let u=Math.sqrt(d.magnitudeSquared(o)-1),f=d.multiplyByScalar(s,1/r,J_e),h=u/r,p=d.multiplyByScalar(a,h,eye),_=d.multiplyByScalar(c,h,rX),m=d.add(f,_,VI[0]);d.subtract(m,p,m),d.multiplyComponents(n,m,m);let x=d.subtract(f,_,VI[1]);d.subtract(x,p,x),d.multiplyComponents(n,x,x);let b=d.subtract(f,_,VI[2]);d.add(b,p,b),d.multiplyComponents(n,b,b);let T=d.add(f,_,VI[3]);return d.add(T,p,T),d.multiplyComponents(n,T,T),VI}var sX=new U,Mut=new d,Xy=[new fe,new fe,new fe,new fe];function bz(e,t,n,i,o,r){sX.x=e,sX.y=t;let s=i.pickEllipsoid(sX,o,Mut);return l(s)?(Xy[n]=o.cartesianToCartographic(s,Xy[n]),1):(Xy[n]=o.cartesianToCartographic(r[n],Xy[n]),0)}Qt.prototype.computeViewRectangle=function(e,t){e=y(e,ee.default);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ae(d.ZERO,e.maximumRadius);if(n.computeVisibility(i)===jt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,u=Out(this,e);if(c+=bz(0,0,0,this,e,u),c+=bz(0,a,1,this,e,u),c+=bz(s,a,2,this,e,u),c+=bz(s,0,3,this,e,u),c<2)return se.MAX_VALUE;t=se.fromCartographicArray(Xy,t);let f=0,h=Xy[3].longitude;for(let p=0;p<4;++p){let _=Xy[p].longitude,m=Math.abs(_-h);m>P.PI?f+=P.TWO_PI-m:f+=m,h=_}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,Xy[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};Qt.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof Di)return;let e=this._scene;this.frustum=new Di,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};Qt.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof rn)return;let e=sye(this),t=this._scene;this.frustum=new rn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};Qt.clone=function(e,t){return l(t)||(t=new Qt(e._scene)),d.clone(e.position,t.position),d.clone(e.direction,t.direction),d.clone(e.up,t.up),d.clone(e.right,t.right),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var ro=Qt;function Lut(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var ch=Lut;var bye=Ur(Hl(),1),gye=576,Nut=100,UI="#ffffff",Sz="#48b";function Tye(e,t){this.credit=e,this.count=y(t,1)}function Fut(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(At.equals(o,t))return!0}return!1}function But(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;At.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Cye="cesium-credit-delimiter";function _ye(e){let t=document.createElement("span");return t.textContent=e,t.className=Cye,t}function yye(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function xye(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(_ye(n));else{let f=o[u];f.className!==Cye&&e.replaceChild(_ye(n),f)}}let c=a.element;if(o.length<=r)e.appendChild(yye(c,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(yye(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function kut(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<gye?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=gye&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Vut(e){let t=` +`,E&&(Et+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); +`);Et+=` return color; + }`,et.sources.push(Et),ze.sources.push(Art(ce)),ze.sources.push(vrt(v));let ht=Qt.fromCache({context:t.context,vertexShaderSource:ze,fragmentShaderSource:et,attributeLocations:J.getAttributeLocations()});Ae=ke[_e]=new Crt(i,_e,this.material,ht,be,De)}return n.surfaceShader=Ae,Ae.shaderProgram};vY.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var eU=vY;var wrt={NONE:-1,PARTIAL:0,FULL:1},br=Object.freeze(wrt);function tU(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}tU.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new tU(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${fg(i)}`),c};tU.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Po=tU;var Drt={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ai=Object.freeze(Drt);var Irt={START:0,LOADING:1,DONE:2,FAILED:3},ma=Object.freeze(Irt);var Prt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},ho=Object.freeze(Prt);function Qo(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new d,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=ho.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ae,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(Qo.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===ho.RECEIVING||e===ho.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==ai.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var Rrt=new fe;function wY(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==ne.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,Rrt);s=n.project(c,r),s=d.fromElements(s.z,s.x,s.y,r)}return s}var Ort=new d,Mrt=new d,Lrt=new d;Qo.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,u=a.length,f=Number.MAX_VALUE;for(let h=0;h<u;h+=3){let p=a[h],_=a[h+1],m=a[h+2],x=wY(c,t,n,s,p,Ort),b=wY(c,t,n,s,_,Mrt),T=wY(c,t,n,s,m,Lrt),C=Qn.rayTriangleParametric(e,x,b,T,i);l(C)&&C<f&&C>=0&&(f=C)}return f!==Number.MAX_VALUE?pn.getPoint(e,f,o):void 0};Qo.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=ho.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};Qo.prototype.freeVertexArray=function(){Qo._freeVertexArray(this.vertexArray),this.vertexArray=void 0,Qo._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};Qo.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new Qo),e.state===ma.START&&(Nrt(e,t,n),e.state=ma.LOADING)};Qo.processStateMachine=function(e,t,n,i,o,r,s){Qo.initialize(e,n,i);let a=e.data;if(e.state===ma.LOADING&&Frt(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let u=a.terrainState===ho.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let h=e._loadedCallbacks,p={};for(let _ in h)h.hasOwnProperty(_)&&(h[_](e)||(p[_]=h[_]));e._loadedCallbacks=p,e.state=ma.DONE}c&&(e.renderable=!0)};Qo.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let h=c[u];if(!l(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===ai.PLACEHOLDER){let _=h.loadingImagery.imageryLayer;if(_.ready){h.freeResources(),c.splice(u,1),_._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);a=a&&p,s=s||p||l(h.readyImagery),r=r&&l(h.loadingImagery)&&(h.loadingImagery.state===ai.FAILED||h.loadingImagery.state===ai.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function Oge(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=Zc.clone(s);c.hasGeodeticSurfaceNormals=t,c=Zc.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(Qo._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Qo._createVertexArrayForMesh(i.context,o)):(Qo._freeVertexArray(e.vertexArray),e.vertexArray=Qo._createVertexArrayForMesh(i.context,o)),Qo._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}Qo.prototype.addGeodeticSurfaceNormals=function(e,t){Oge(this,!0,e,t)};Qo.prototype.removeGeodeticSurfaceNormals=function(e){Oge(this,!1,void 0,e)};Qo.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!c.hasGeodeticSurfaceNormals){let h=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(h,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let h=e.customData,p=h.length;for(let _=0;_<p;_++){let m=h[_];m.level=-1}}}};function Nrt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=ho.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Frt(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===ho.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||Qo.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===ho.FAILED&&Brt(s,e,t,n,e.x,e.y,e.level),s.terrainState===ho.UNLOADED&&krt(s,n,e.x,e.y,e.level),s.terrainState===ho.RECEIVED&&Urt(s,t,n,e.x,e.y,e.level),s.terrainState===ho.TRANSFORMED&&(zrt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=ho.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Grt(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function Brt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=ma.FAILED;return}let c=a.data.terrainData,u=a.x,f=a.y,h=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,h,o,r,s);l(p)&&(e.terrainState=ho.RECEIVING,Promise.resolve(p).then(function(_){l(_)&&(e.terrainData=_,e.terrainState=ho.RECEIVED)}).catch(function(){e.terrainState=ho.FAILED}))}function krt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=ho.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=ho.RECEIVED,e.request=void 0}function s(c){if(e.request.state===$n.CANCELLED){e.terrainData=void 0,e.terrainState=ho.UNLOADED,e.request=void 0;return}e.terrainState=ho.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Po.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let c=new nr({throttle:!1,throttleByServer:!0,type:ps.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=ho.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=ho.UNLOADED,e.request=void 0)}a()}var Vrt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Urt(e,t,n,i,o,r){let s=n.tilingScheme,a=Vrt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=ho.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=ho.TRANSFORMED}).catch(function(){e.terrainState=ho.FAILED}))}Qo._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=_t.createVertexBuffer({context:e,typedArray:n,usage:Fe.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=_t.createIndexBuffer({context:e,typedArray:a,usage:Fe.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ni({context:e,attributes:o,indexBuffer:s})};Qo._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function zrt(e,t,n,i,o,r,s){e.vertexArray=Qo._createVertexArrayForMesh(t,e.mesh),e.terrainState=ho.READY,e.fill=e.fill&&e.fill.destroy(s)}function Hrt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Rt.create({context:e,pixelFormat:tt.LUMINANCE,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Zt({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:hi.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Grt(e,t){let n=t.terrainData.waterMask,i=Hrt(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Rt.create({context:e,pixelFormat:tt.LUMINANCE,pixelDatatype:Ke.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,oe.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}Qo.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};Qo.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var oh=Qo;function zy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ee.default),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Mi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new U(-i,-i),this._rectangleNortheastInMeters=new U(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new se(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(zy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});zy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};zy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};zy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(se.southwest(e)),o=n.project(se.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new se(i.x,i.y,o.x,o.y)};zy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,h=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=a,i.south=h,i.east=c,i.north=f,i):new se(a,h,c,f)};zy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new U(o.west,o.south)),a=r.unproject(new U(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};zy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!se.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,_=this._rectangleNortheastInMeters.y-h.y,m=p/a|0;m>=o&&(m=o-1);let x=_/u|0;return x>=r&&(x=r-1),l(n)?(n.x=m,n.y=x,n):new U(m,x)};var us=zy;var DY,Mge="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSFctdVnwhKUPPSRxMpNygUNlP8JmGGUdPJSkOUNGzOjDGJ6_IBw0ZIYb2CxiR6SbKR4hMj3np1HXa_Idxv_txLhu62WcUsFQSTBvq7ktym5DNKxqVmIzBnPljNsM8ff9hCKEXq0LTd8VzkHqjVA7-ig_wg7BqJGg7vUMgG1QseyUAjpmY2OaEv9rA8aeBjRrc.AT1_8nZ92i8c",AE={};AE.defaultAccessToken=Mge;AE.defaultWorldImageryServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});AE.defaultWorldHillshadeServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});AE.defaultWorldOceanServer=new Se({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});AE.getDefaultTokenCredit=function(e){if(e===Mge){if(!l(DY)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';DY=new Ct(t,!0)}return DY}};var jf=AE;function IY(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Se.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=bh(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,h=u.length;a&&f<h;++f){let p=u[f],_=p.x*4+p.y*c;s[_+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}IY.prototype.isReady=function(){return this._isReady};IY.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=bh(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var nU=IY;function PY(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}PY.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};PY.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Mm=PY;function EE(){he.throwInstantiationError()}Object.defineProperties(EE.prototype,{rectangle:{get:he.throwInstantiationError},tileWidth:{get:he.throwInstantiationError},tileHeight:{get:he.throwInstantiationError},maximumLevel:{get:he.throwInstantiationError},minimumLevel:{get:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},tileDiscardPolicy:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError},credit:{get:he.throwInstantiationError},proxy:{get:he.throwInstantiationError},hasAlphaChannel:{get:he.throwInstantiationError}});EE.prototype.getTileCredits=function(e,t,n){he.throwInstantiationError()};EE.prototype.requestImage=function(e,t,n,i){he.throwInstantiationError()};EE.prototype.pickFeatures=function(e,t,n,i,o){he.throwInstantiationError()};var Wrt=/\.ktx2$/i;EE.loadImage=function(e,t){let n=Se.createIfNeeded(t);return Wrt.test(n.url)?ql(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Fl=EE;var jrt={SATELLITE:1,OCEANS:2,HILLSHADE:3},Lm=Object.freeze(jrt);function Lge(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new Xi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Ct(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}Lge.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new nU({missingImageUrl:Nge(e,0,0,this.maximumLevel).url,pixelsToCheck:[new U(0,0),new U(200,20),new U(20,200),new U(80,110),new U(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function qrt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new us({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Xi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new re(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Mi,o=e.fullExtent,r=i.unproject(new d(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new d(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new se(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=se.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new re(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Ct(e.copyrightText)]:t.credit=new Ct(e.copyrightText))}function Yrt(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new re(n)}async function Xrt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();qrt(i,t)}catch(i){Yrt(e,i)}}function Nm(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Xi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new pe}Nm.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case Lm.SATELLITE:{n=y(t.token,jf.defaultAccessToken),i=Se.createIfNeeded(jf.defaultWorldImageryServer),i.appendForwardSlash();let r=jf.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;case Lm.OCEANS:{n=y(t.token,jf.defaultAccessToken),i=Se.createIfNeeded(jf.defaultWorldOceanServer),i.appendForwardSlash();let r=jf.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;case Lm.HILLSHADE:{n=y(t.token,jf.defaultAccessToken),i=Se.createIfNeeded(jf.defaultWorldHillshadeServer),i.appendForwardSlash();let r=jf.getDefaultTokenCredit(n);l(r)&&(o=Ct.clone(r))}break;default:}return Nm.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Nge(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Pi?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(Nm.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Nm.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Nm(t);i._resource=n;let o=new Lge(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await Xrt(n,o),o.build(i),i};Nm.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Nm.prototype.requestImage=function(e,t,n,i){return Fl.loadImage(this,Nge(this,e,t,n,i))};Nm.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Pi)s=P.toDegrees(i),a=P.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new fe(i,o,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let _=[],m=p.results;if(!l(m))return _;for(let x=0;x<m.length;++x){let b=m[x],T=new Mm;if(T.data=b,T.name=b.value,T.properties=b.attributes,T.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let C=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(C===4326||C===4283)T.position=fe.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(C===102100||C===900913||C===3857){let A=new Mi;T.position=A.unproject(new d(b.geometry.x,b.geometry.y,b.geometry.z))}}_.push(T)}return _})};Nm._metadataCache={};var Hy=Nm;var Krt={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},TI=Object.freeze(Krt);function CI(e){}CI.prototype.isReady=function(){return!0};CI.prototype.shouldDiscardImage=function(e){return CI.EMPTY_IMAGE===e};var iU;Object.defineProperties(CI,{EMPTY_IMAGE:{get:function(){return l(iU)||(iU=new Image,iU.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),iU}}});var AI=CI;function Fge(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}Fge.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof Ct)break;o.credit=new Ct(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],u=c.bbox;c.bbox=new se(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}};function Zrt(e,t){if(e.resourceSets.length!==1)throw new re("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function $rt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Po.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new re(i)}async function Qrt(e,t,n){let i=e.url,o=vs._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),vs._metadataCache[i]=o);try{let r=await o;return Zrt(r,t)}catch(r){$rt(e,r,n)}}function vs(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,TI.AERIAL),this._mapLayer=e.mapLayer,this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new AI),this._proxy=e.proxy,this._credit=new Ct(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${vs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new us({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new pe}Object.defineProperties(vs.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});vs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,TI.AERIAL),o=Se.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new vs(t);a._resource=o;let c=new Fge(t);return await Qrt(s,c),c.build(a),a};var Jrt=new se;vs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Jrt);return nst(this._attributionList,n,i)};vs.prototype.requestImage=function(e,t,n,i){let o=Fl.loadImage(this,est(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?AI.EMPTY_IMAGE:Promise.reject(r)})};vs.prototype.pickFeatures=function(e,t,n,i,o){};vs.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};vs.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};vs._logoUrl=void 0;Object.defineProperties(vs,{logoUrl:{get:function(){return l(vs._logoUrl)||(vs._logoUrl=en("Assets/Images/bing_maps_credit.png")),vs._logoUrl},set:function(e){vs._logoUrl=e}}});function est(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:vs.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var tst=new se;function nst(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let h=a[u];if(t>=h.zoomMin&&t<=h.zoomMax){let p=se.intersection(n,h.bbox,tst);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}vs._metadataCache={};var oU=vs;var Bge=/{[^}]+}/g,kge={x:sst,y:cst,z:fst,s:dst,reverseX:ast,reverseY:lst,reverseZ:ust,westDegrees:hst,southDegrees:mst,eastDegrees:pst,northDegrees:gst,westProjected:_st,southProjected:yst,eastProjected:xst,northProjected:bst,width:Tst,height:Cst},ist=xt(kge,{i:Ast,j:Est,reverseI:Sst,reverseJ:vst,longitudeDegrees:Dst,latitudeDegrees:Ist,longitudeProjected:Pst,latitudeProjected:Rst,format:Mst});function EI(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new pe;let t=Se.createIfNeeded(e.url),n=Se.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new us({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=se.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Ct(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=xt(kge,r),a=xt(ist,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(EI.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});EI.prototype.getTileCredits=function(e,t,n){};EI.prototype.requestImage=function(e,t,n,i){return Fl.loadImage(this,ost(this,e,t,n,i))};EI.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=rst(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var rU=!1,wu=new se,sU=!1,SI=new se;function ost(e,t,n,i,o){rU=!1,sU=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},u=s.match(Bge);return l(u)&&u.forEach(function(f){let h=f.substring(1,f.length-1);l(a[h])&&(c[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var RY=!1,vE=new U,OY=!1;function rst(e,t,n,i,o,r,s){rU=!1,sU=!1,RY=!1,OY=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},h=c.match(Bge);return l(h)&&h.forEach(function(p){let _=p.substring(1,p.length-1);l(u[_])&&(f[_]=u[_](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function wE(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function sst(e,t,n,i){return wE(e,"{x}",t)}function ast(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return wE(e,"{reverseX}",o)}function cst(e,t,n,i){return wE(e,"{y}",n)}function lst(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return wE(e,"{reverseY}",o)}function ust(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return wE(e,"{reverseZ}",r)}function fst(e,t,n,i){return wE(e,"{z}",i)}function dst(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function aU(e,t,n,i){rU||(e.tilingScheme.tileXYToRectangle(t,n,i,wu),wu.west=P.toDegrees(wu.west),wu.south=P.toDegrees(wu.south),wu.east=P.toDegrees(wu.east),wu.north=P.toDegrees(wu.north),rU=!0)}function hst(e,t,n,i){return aU(e,t,n,i),wu.west}function mst(e,t,n,i){return aU(e,t,n,i),wu.south}function pst(e,t,n,i){return aU(e,t,n,i),wu.east}function gst(e,t,n,i){return aU(e,t,n,i),wu.north}function cU(e,t,n,i){sU||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,SI),sU=!0)}function _st(e,t,n,i){return cU(e,t,n,i),SI.west}function yst(e,t,n,i){return cU(e,t,n,i),SI.south}function xst(e,t,n,i){return cU(e,t,n,i),SI.east}function bst(e,t,n,i){return cU(e,t,n,i),SI.north}function Tst(e,t,n,i){return e.tileWidth}function Cst(e,t,n,i){return e.tileHeight}function Ast(e,t,n,i,o,r,s){return lU(e,t,n,i,o,r),vE.x}function Est(e,t,n,i,o,r,s){return lU(e,t,n,i,o,r),vE.y}function Sst(e,t,n,i,o,r,s){return lU(e,t,n,i,o,r),e.tileWidth-vE.x-1}function vst(e,t,n,i,o,r,s){return lU(e,t,n,i,o,r),e.tileHeight-vE.y-1}var wst=new se,SE=new d;function lU(e,t,n,i,o,r,s){if(RY)return;MY(e,t,n,i,o,r);let a=SE,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,wst);vE.x=e.tileWidth*(a.x-c.west)/c.width|0,vE.y=e.tileHeight*(c.north-a.y)/c.height|0,RY=!0}function Dst(e,t,n,i,o,r,s){return P.toDegrees(o)}function Ist(e,t,n,i,o,r,s){return P.toDegrees(r)}function Pst(e,t,n,i,o,r,s){return MY(e,t,n,i,o,r),SE.x}function Rst(e,t,n,i,o,r,s){return MY(e,t,n,i,o,r),SE.y}var Ost=new fe;function MY(e,t,n,i,o,r,s){if(!OY){if(e.tilingScheme.projection instanceof Pi)SE.x=P.toDegrees(o),SE.y=P.toDegrees(r);else{let a=Ost;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,SE)}OY=!0}}function Mst(e,t,n,i,o,r,s){return s}var lc=EI;function qf(e){lc.call(this,e)}qf._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return qf._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof ep)return qf._metadataFailure(e,t);throw o}};qf.fromUrl=async function(e,t){let n=Se.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let r=await qf._requestMetadata(t,i,o);return new qf(r)};l(Object.create)&&(qf.prototype=Object.create(lc.prototype),qf.prototype.constructor=qf);function Vge(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function Uge(e,t,n){let i=e.positionToTileXY(se.southwest(t),n),o=e.positionToTileXY(se.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}qf._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,h,p=[],_=e.childNodes[0].childNodes;for(let R=0;R<_.length;R++)if(r.test(_.item(R).nodeName))u=_.item(R);else if(a.test(_.item(R).nodeName)){h=_.item(R);let M=_.item(R).childNodes;for(let L=0;L<M.length;L++)s.test(M.item(L).nodeName)&&p.push(M.item(L))}else c.test(_.item(R).nodeName)&&(f=_.item(R));let m;if(!l(h)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Po.reportError(void 0,o,o.errorEvent,m),new re(m);let x=y(t.fileExtension,u.getAttribute("extension")),b=y(t.tileWidth,parseInt(u.getAttribute("width"),10)),T=y(t.tileHeight,parseInt(u.getAttribute("height"),10)),C=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),A=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),S=h.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(S==="geodetic"||S==="global-geodetic")v=new Xi({ellipsoid:t.ellipsoid});else if(S==="mercator"||S==="global-mercator")v=new us({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${S}.`,l(o)&&Po.reportError(void 0,o,o.errorEvent,m),new re(m);let D=se.clone(t.rectangle);if(!l(D)){let R,M,L,g;y(t.flipXY,!1)?(L=new U(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),g=new U(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new U(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),g=new U(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=S==="geodetic"||S==="mercator";if(v.projection instanceof Pi||w)R=fe.fromDegrees(L.x,L.y),M=fe.fromDegrees(g.x,g.y);else{let I=v.projection;R=I.unproject(L),M=I.unproject(g)}D=new se(R.longitude,R.latitude,M.longitude,M.latitude)}return D=Vge(D,v),C=Uge(v,D,C),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:v,rectangle:D,tileWidth:b,tileHeight:T,minimumLevel:C,maximumLevel:A,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};qf._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),o=y(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new us({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=Vge(a,s);let c=Uge(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var ub=qf;function zge(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}zge.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Lst(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new re(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new re(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new us({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new re(o)}return!0}function Nst(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Po.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new re(i)}async function Fst(e,t,n){try{let i=await e.fetchText();Lst(i,t)}catch(i){Nst(i,e,n)}}function Bl(e){e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new Ct(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Bl.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new pe}Object.defineProperties(Bl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Bl.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=Se.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new zge(n);s.channel=t,await Fst(r,s);let a=new Bl(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Bl.prototype.getTileCredits=function(e,t,n){};Bl.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Fl.loadImage(this,o)};Bl.prototype.pickFeatures=function(e,t,n,i,o){};Bl._logoUrl=void 0;Object.defineProperties(Bl,{logoUrl:{get:function(){return l(Bl._logoUrl)||(Bl._logoUrl=en("Assets/Images/google_earth_credit.png")),Bl._logoUrl},set:function(e){Bl._logoUrl=e}}});var uU=Bl;var Bst=/\/$/,Hge=new Ct('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function DE(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Se.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Bst.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Ct(s))):s=Hge,this._resource=i,this._imageryProvider=new lc({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(DE.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});DE.prototype.getTileCredits=function(e,t,n){};DE.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};DE.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};DE._defaultCredit=Hge;var fU=DE;function fb(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,se.MAX_VALUE),n=new Xi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new pe;let i=e.credit;typeof i=="string"&&(i=new Ct(i)),this._credit=i;let o=Se.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(fb.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function kst(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Po.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return LY(e,n,r);throw l(n)&&(n._hasError=!0),new re(o)}async function LY(e,t,n){try{return await Fl.loadImage(null,e)}catch(i){return kst(e,i,t,n)}}fb.fromUrl=async function(e,t){let n=Se.createIfNeeded(e),i=await LY(n);t=y(t,y.EMPTY_OBJECT);let o=new fb({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};fb.prototype.getTileCredits=function(e,t,n){};fb.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await LY(this._resource,this);return this._image=o,Po.reportSuccess(this._errorEvent),o}return this._image};fb.prototype.pickFeatures=function(e,t,n,i,o){};var dU=fb;function Vst(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Ust:e==="xml"?n=Wst:(e==="html"||e==="text")&&(n=Gge)),this.callback=n}function Ust(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Mm;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=fe.fromDegrees(s,a)}t.push(r)}return t}var NY="http://www.mapinfo.com/mxp",zst="http://www.esri.com/wms",Hst="http://www.opengis.net/wfs",Gst="http://www.opengis.net/gml";function Wst(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===NY)return jst(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===zst)return qst(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Hst)return Yst(e);if(t.localName==="ServiceExceptionReport")throw new re(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Xst(e):Kst(e)}function jst(e){let t=[],i=e.documentElement.getElementsByTagNameNS(NY,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(NY,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let h=f.getAttribute("ref"),p=f.textContent.trim();s[h]=p}}let c=new Mm;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function qst(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(hU(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(hU(a,i))}}return n}function Yst(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Gst,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};FY(r,s),t.push(hU(r,s))}return t}function Xst(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new re("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};FY(s,a),t.push(hU(s,a))}}return t}function FY(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&FY(o,t)&&(t[o.localName]=o.textContent)}return n}function hU(e,t){let n=new Mm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Kst(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Mm;return o.data=e,o.description=n.innerHTML,[o]}var Zst=/<body>\s*<\/body>/im,$st=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Qst=/<title>([\s\S]*)<\/title>/im;function Gge(e){if(Zst.test(e)||$st.test(e))return;let t,n=Qst.exec(e);n&&n.length>1&&(t=n[1]);let i=new Mm;return i.name=t,i.description=e,i.data=e,[i]}var IE=Vst;function vI(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(vI.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});vI.prototype.getFromCache=function(e,t,n,i){let o=Wge(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};vI.prototype.checkApproachingInterval=function(e,t,n,i){let o=Wge(e,t,n),r=this._tilesRequestedForInterval,s=jge(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!qge(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};vI.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=jge(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=qge(this,c,r),a||s.push(c)}}};function Wge(e,t,n){return`${e}-${t}-${n}`}function Jst(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function jge(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=Z.secondsDifference(c.stop,i),++a):(s=Z.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function qge(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=Jst(s),c=new nr({throttle:!1,throttleByServer:!0,type:ps.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(r[s]={promise:u,request:c},!0):!1}var PE=vI;var eat=[3034,3035,3042,3043,3044],tat=[4471,4559];function rh(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new he("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=Se.createIfNeeded(e.url),n=Se.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(rh.DefaultParameters,!0),n.setQueryParameters(rh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Yge(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Yge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new PE({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return Xge(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Mi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!tat.includes(a)||eat.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Mi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new lc({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Xi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,rh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function Xge(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function nat(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(rh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});rh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};rh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Xge(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};rh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return nat(this,e,t,n,i,o,s)};rh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});rh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});rh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new IE("json","application/json")),Object.freeze(new IE("xml","text/xml")),Object.freeze(new IE("text","text/html"))]);function Yge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var mU=rh;var iat=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function wI(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Se.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(iat),this._useKvp=!0;else{let h={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(h),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new us({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new PE({clock:e.clock,times:e.times,requestImageFunction:function(h,p,_,m,x){return Kge(s,h,p,_,m,x)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(se.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(se.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new pe;let f=e.credit;this._credit=typeof f=="string"?new Ct(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function Kge(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,u=e._dimensions,f=l(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),l(u)&&h.setTemplateValues(u),l(f)&&h.setTemplateValues(f);else{let _={};_.tilematrix=a,_.layer=e._layer,_.style=e._style,_.tilerow=n,_.tilecol=t,_.tilematrixset=e._tileMatrixSetID,_.format=e._format,l(u)&&(_=xt(_,u)),l(f)&&(_=xt(_,f)),p={s:c[(t+n+i)%c.length]},h=e._resource.getDerivedResource({queryParameters:_,request:o}),h.setTemplateValues(p)}return Fl.loadImage(e,h)}Object.defineProperties(wI.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}}});wI.prototype.getTileCredits=function(e,t,n){};wI.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Kge(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};wI.prototype.pickFeatures=function(e,t,n,i,o){};var pU=wI;var oat={ARCGIS_MAPSERVER:Hy.fromUrl,BING:async(e,t)=>oU.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,uU.fromUrl(e,n,t)},MAPBOX:(e,t)=>new fU({url:e,...t}),SINGLE_TILE:dU.fromUrl,TMS:ub.fromUrl,URL_TEMPLATE:(e,t)=>new lc({url:e,...t}),WMS:(e,t)=>new mU({url:e,...t}),WMTS:(e,t)=>new pU({url:e,...t})};function Fm(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new pe}Object.defineProperties(Fm.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});Fm.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=cf._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Fm._endpointCache[i];l(o)||(o=n.fetchJson(),Fm._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new re(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await ub.fromUrl(new cf(r,n));else{let u=oat[a];if(!l(u))throw new re(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},h=f.url;delete f.url,s=await u(h,f)}let c=new Fm(t);return s.errorEvent.addEventListener(function(u){u.provider=c,c._errorEvent.raiseEvent(u)}),c._tileCredits=cf.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};Fm.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Fm.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Fm.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Fm._endpointCache={};var Gy=Fm;var rat={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},Wy=Object.freeze(rat);function sat(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,Wy.AERIAL);return Gy.fromAssetId(t)}var jy=sat;var gU=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + out_FragColor = texture(u_texture, v_textureCoordinates); +} +`;var _U=`in vec4 position; +in float webMercatorT; + +uniform vec2 u_textureDimensions; + +out vec2 v_textureCoordinates; + +void main() +{ + v_textureCoordinates = vec2(position.x, webMercatorT); + gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); +} +`;function RE(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ai.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}RE.createPlaceholder=function(e){let t=new RE(e,0,0,0);return t.addReference(),t.state=ai.PLACEHOLDER,t};RE.prototype.addReference=function(){++this.referenceCount};RE.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};RE.prototype.processStateMachine=function(e,t,n){this.state===ai.UNLOADED&&!n&&(this.state=ai.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ai.RECEIVED&&(this.state=ai.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ai.READY&&t&&!this.texture;(this.state===ai.TEXTURE_LOADED||i)&&(this.state=ai.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var DI=RE;function BY(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}BY.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};BY.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ai.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==ai.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==ai.FAILED&&r.state!==ai.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ai.FAILED||i.state===ai.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var II=BY;function gi(e,t){this._imageryProvider=e,this._readyEvent=new pe,this._errorEvent=new pe,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,gi.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,gi.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,gi.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,gi.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,gi.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,gi.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,gi.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,gi.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,se.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new II(DI.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,gi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(gi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});gi.DEFAULT_BRIGHTNESS=1;gi.DEFAULT_CONTRAST=1;gi.DEFAULT_HUE=0;gi.DEFAULT_SATURATION=1;gi.DEFAULT_GAMMA=1;gi.DEFAULT_SPLIT=Gr.NONE;gi.DEFAULT_MINIFICATION_FILTER=Kt.LINEAR;gi.DEFAULT_MAGNIFICATION_FILTER=hi.LINEAR;gi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;gi.fromProviderAsync=function(e,t){let n=new gi(void 0,t);return fat(n,Promise.resolve(e)),n};gi.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),gi.fromProviderAsync(jy({style:e.style}),e)};gi.prototype.isBaseLayer=function(){return this._isBaseLayer};gi.prototype.isDestroyed=function(){return!1};gi.prototype.destroy=function(){return ue(this)};var Qge=new se,Zge=new se,kY=new se,Jge=new se;gi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return se.intersection(e.rectangle,t)};gi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Mi&&e.rectangle.north<Mi.MaximumLatitude&&e.rectangle.south>-Mi.MaximumLatitude,s=se.intersection(o.rectangle,this._rectangle,Qge),a=se.intersection(e.rectangle,s,Zge);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,I=e.rectangle;a=Zge,I.south>=w.north?a.north=a.south=w.north:I.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(I.south,w.south),a.north=Math.min(I.north,w.north)),I.west>=w.east?a.west=a.east=w.east:I.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(I.west,w.west),a.east=Math.min(I.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),h=lat(this,f,c);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),l(o.minimumLevel)){let w=o.minimumLevel;h<w&&(h=w)}let _=o.tilingScheme,m=_.positionToTileXY(se.northwest(a),h),x=_.positionToTileXY(se.southeast(a),h),b=e.rectangle.width/512,T=e.rectangle.height/512,C=_.tileXYToRectangle(m.x,m.y,h);Math.abs(C.south-e.rectangle.north)<T&&m.y<x.y&&++m.y,Math.abs(C.east-e.rectangle.west)<b&&m.x<x.x&&++m.x;let A=_.tileXYToRectangle(x.x,x.y,h);Math.abs(A.north-e.rectangle.south)<T&&x.y>m.y&&--x.y,Math.abs(A.west-e.rectangle.east)<b&&x.x>m.x&&--x.x;let S=se.clone(e.rectangle,Jge),v=_.tileXYToRectangle(m.x,m.y,h),D=se.intersection(v,s,kY),O;r?(_.rectangleToNativeRectangle(S,S),_.rectangleToNativeRectangle(v,v),_.rectangleToNativeRectangle(D,D),_.rectangleToNativeRectangle(s,s),O=_.tileXYToNativeRectangle.bind(_),b=S.width/512,T=S.height/512):O=_.tileXYToRectangle.bind(_);let R,M=0,L=1,g;!this.isBaseLayer()&&Math.abs(D.west-S.west)>=b&&(M=Math.min(1,(D.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(D.north-S.north)>=T&&(L=Math.max(0,(D.north-S.south)/S.height));let E=L;for(let w=m.x;w<=x.x;w++)if(R=M,v=O(w,m.y,h),D=se.simpleIntersection(v,s,kY),!!l(D)){M=Math.min(1,(D.east-S.west)/S.width),w===x.x&&(this.isBaseLayer()||Math.abs(D.east-S.east)<b)&&(M=1),L=E;for(let I=m.y;I<=x.y;I++){if(g=L,v=O(w,I,h),D=se.simpleIntersection(v,s,kY),!l(D))continue;L=Math.max(0,(D.south-S.south)/S.height),I===x.y&&(this.isBaseLayer()||Math.abs(D.south-S.south)<T)&&(L=0);let N=new oe(R,L,M,g),B=this.getImageryFromCache(w,I,h);i.imagery.splice(n,0,new II(B,N,r)),++n}}return!0};gi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,Qge),i=c.rectangleToNativeRectangle(i,Jge)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new oe(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};gi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=ai.RECEIVED,e.request=void 0,Po.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===$n.CANCELLED){e.state=ai.UNLOADED,e.request=void 0;return}e.state=ai.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Po.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new nr({throttle:!1,throttleByServer:!0,type:ps.IMAGERY});e.request=s,e.state=ai.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=ai.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};gi.prototype._createTextureWebGL=function(e,t){let n=new Zt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Rt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Rt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?tt.RGBA:tt.RGB,sampler:n})};gi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=ai.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ai.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Mi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ai.TEXTURE_LOADED};function $ge(e,t,n){return`${e}:${t}:${n}`}gi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Kt.LINEAR&&i===hi.LINEAR&&!tt.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=Kt.LINEAR_MIPMAP_LINEAR;let r=Ft.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=$ge(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new Zt({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(ap.NICEST),t.sampler=u}else{let r=$ge(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new Zt({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};gi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Pi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new cl({persists:!0,owner:this,preExecute:function(c){cat(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ai.READY,t.releaseReference()},canceled:function(){t.state=ai.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ai.READY};gi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};gi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};gi.prototype.getImageryFromCache=function(e,t,n,i){let o=e_e(e,t,n),r=this._imageryCache[o];return l(r)||(r=new DI(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};gi.prototype.removeImageryFromCache=function(e){let t=e_e(e.x,e.y,e.level);delete this._imageryCache[t]};function e_e(e,t,n){return JSON.stringify([e,t,n])}var yU={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},aat=zt.supportsTypedArrays()?new Float32Array(2*64):void 0;function cat(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),T=0;for(let D=0;D<64;++D){let O=D/63;b[T++]=0,b[T++]=O,b[T++]=1,b[T++]=O}let C={position:0,webMercatorT:1},A=ls.getRegularGridIndices(2,64),S=_t.createIndexBuffer({context:t,typedArray:A,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});o.vertexArray=new ni({context:t,attributes:[{index:C.position,vertexBuffer:_t.createVertexBuffer({context:t,typedArray:b,usage:Fe.STATIC_DRAW}),componentsPerAttribute:2},{index:C.webMercatorT,vertexBuffer:_t.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Fe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let v=new Ue({sources:[_U]});o.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:gU,attributeLocations:C}),o.sampler=new Zt({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:hi.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;yU.textureDimensions.x=r,yU.textureDimensions.y=s,yU.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),h=new Rt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(r)&&P.isPowerOfTwo(s)&&h.generateMipmap(ap.NICEST);let p=i.south,_=i.north,m=aat,x=0;for(let b=0;b<64;++b){let T=b/63,C=P.lerp(p,_,T);a=Math.sin(C);let S=(.5*Math.log((1+a)/(1-a))-c)*f;m[x++]=S,m[x++]=S}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=yU,e.vertexArray=o.vertexArray}function lat(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Pi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function uat(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function fat(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){uat(e._errorEvent,i)}}var uc=gi;var dat={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},gn=dat;var t_e={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=t_e.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Yn=t_e;function ME(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new oe}ME.prototype.update=function(e,t,n){this.changedThisFrame&&(c_e(e,t,this.tile,n),this.changedThisFrame=!1)};ME.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};ME.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):oh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var hat=new ux;ME.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=hat;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),h=c.findTileToEast(r),p=c.findTileToNorth(r);ws(e,n,c,u,s,gn.EAST,!1,a,i),ws(e,n,c,f,s,gn.NORTH,!1,a,i),ws(e,n,c,h,s,gn.WEST,!1,a,i),ws(e,n,c,p,s,gn.SOUTH,!1,a,i);let _=u.findTileToNorth(r),m=u.findTileToSouth(r),x=h.findTileToNorth(r),b=h.findTileToSouth(r);ws(e,n,c,_,s,gn.SOUTHEAST,!1,a,i),ws(e,n,c,x,s,gn.SOUTHWEST,!1,a,i),ws(e,n,c,m,s,gn.NORTHEAST,!1,a,i),ws(e,n,c,b,s,gn.NORTHWEST,!1,a,i),c=a.dequeue()}};function ws(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||Yn.wasKicked(u._lastSelectionResult)||Yn.originalResult(u._lastSelectionResult)===Yn.CULLED);){if(s)return;let f=u.parent;if(r>=gn.NORTHWEST&&f!==void 0)switch(r){case gn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case gn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case gn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case gn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Yn.RENDERED){if(l(u.data.vertexArray))return;mat(e,t,n,u,r,o,a,c);return}if(Yn.originalResult(i._lastSelectionResult)!==Yn.CULLED)switch(r){case gn.WEST:ws(e,t,n,i.northwestChild,o,r,!0,a,c),ws(e,t,n,i.southwestChild,o,r,!0,a,c);break;case gn.EAST:ws(e,t,n,i.southeastChild,o,r,!0,a,c),ws(e,t,n,i.northeastChild,o,r,!0,a,c);break;case gn.SOUTH:ws(e,t,n,i.southwestChild,o,r,!0,a,c),ws(e,t,n,i.southeastChild,o,r,!0,a,c);break;case gn.NORTH:ws(e,t,n,i.northeastChild,o,r,!0,a,c),ws(e,t,n,i.northwestChild,o,r,!0,a,c);break;case gn.NORTHWEST:ws(e,t,n,i.northwestChild,o,r,!0,a,c);break;case gn.NORTHEAST:ws(e,t,n,i.northeastChild,o,r,!0,a,c);break;case gn.SOUTHWEST:ws(e,t,n,i.southwestChild,o,r,!0,a,c);break;case gn.SOUTHEAST:ws(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new he("Invalid edge")}}}function mat(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new ME(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),pat(e,t,n,i,o,a)}function pat(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(c_e(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case gn.WEST:u=s.westMeshes,f=s.westTiles;break;case gn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case gn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case gn.NORTH:u=s.northMeshes,f=s.northTiles;break;case gn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case gn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case gn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case gn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let h,p,_,m,x=n.rectangle,b,T=i.rectangle;switch(o){case gn.WEST:for(b=(T.north-T.south)*P.EPSILON5,h=0;h<f.length&&(_=f[h],m=_.rectangle,!P.greaterThan(x.north,m.south,b));++h);for(p=h;p<f.length&&(_=f[p],m=_.rectangle,!P.greaterThanOrEquals(x.south,m.north,b));++p);break;case gn.SOUTH:for(b=(T.east-T.west)*P.EPSILON5,h=0;h<f.length&&(_=f[h],m=_.rectangle,!P.lessThan(x.west,m.east,b));++h);for(p=h;p<f.length&&(_=f[p],m=_.rectangle,!P.lessThanOrEquals(x.east,m.west,b));++p);break;case gn.EAST:for(b=(T.north-T.south)*P.EPSILON5,h=0;h<f.length&&(_=f[h],m=_.rectangle,!P.lessThan(x.south,m.north,b));++h);for(p=h;p<f.length&&(_=f[p],m=_.rectangle,!P.lessThanOrEquals(x.north,m.south,b));++p);break;case gn.NORTH:for(b=(T.east-T.west)*P.EPSILON5,h=0;h<f.length&&(_=f[h],m=_.rectangle,!P.greaterThan(x.east,m.west,b));++h);for(p=h;p<f.length&&(_=f[p],m=_.rectangle,!P.greaterThanOrEquals(x.west,m.east,b));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||u[h]!==a,u[h]=a,f[h]=n):(s.changedThisFrame=!0,u.splice(h,p-h,a),f.splice(h,p-h,n))}var db=new fe,gat=new fe,OE=new d,HY=new d,VY=new U,UY=new U,Du=new U;function SU(){this.height=0,this.encodedNormal=new U}function xU(e,t,n,i,o,r,s,a,c){if(l(o))return o;let u;if(l(r)&&l(s))u=(r.height+s.height)*.5;else if(l(r))u=r.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,_=0;l(h)&&(p=h.minimumHeight,_=h.maximumHeight),u=(p+_)*.5}return l_e(e,t,n,i,u,c),c}var _at={minimumHeight:0,maximumHeight:0},yat=new d,n_e=new SU,i_e=new SU,o_e=new SU,r_e=new SU,xat=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,bat={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function c_e(e,t,n,i){oh.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,h=TU(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,o_e),p=TU(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,n_e),_=TU(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,i_e),m=TU(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,r_e);h=xU(r,f,0,1,h,p,m,_,o_e),p=xU(r,f,0,0,p,h,_,m,n_e),_=xU(r,f,1,1,_,p,m,h,i_e),m=xU(r,f,1,1,m,_,h,p,r_e);let x=p.height,b=_.height,T=h.height,C=m.height,A=Math.min(x,b,T,C),S=Math.max(x,b,T,C),v=(A+S)*.5,D,O,R=e.getLevelMaximumGeometricError(n.level),M=f.maximumRadius-R,L=Math.acos(M/f.maximumRadius)*4;if(L*=1.5,s.width>L&&S-A<=R){let w=new cc({width:9,height:9,buffer:xat,structure:{heightOffset:S}}),I=bat;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,r.mesh=w._createMeshSync(I)}else{let w=u,I=se.center(s,gat);I.height=v;let N=f.cartographicToCartesian(I,yat),B=new Zc(N,void 0,void 0,void 0,void 0,!0,!0,w,a,c),H=5,V;for(V=r.westMeshes,D=0,O=V.length;D<O;++D)H+=V[D].eastIndicesNorthToSouth.length;for(V=r.southMeshes,D=0,O=V.length;D<O;++D)H+=V[D].northIndicesWestToEast.length;for(V=r.eastMeshes,D=0,O=V.length;D<O;++D)H+=V[D].westIndicesSouthToNorth.length;for(V=r.northMeshes,D=0,O=V.length;D<O;++D)H+=V[D].southIndicesEastToWest.length;let G=_at;G.minimumHeight=A,G.maximumHeight=S;let k=B.stride,W=new Float32Array(H*k),Y=0,J=Y;Y=bU(f,s,B,W,Y,0,1,h.height,h.encodedNormal,1,G),Y=AU(r,f,B,W,Y,r.westTiles,r.westMeshes,gn.EAST,G);let j=Y;Y=bU(f,s,B,W,Y,0,0,p.height,p.encodedNormal,0,G),Y=AU(r,f,B,W,Y,r.southTiles,r.southMeshes,gn.NORTH,G);let K=Y;Y=bU(f,s,B,W,Y,1,0,_.height,_.encodedNormal,0,G),Y=AU(r,f,B,W,Y,r.eastTiles,r.eastMeshes,gn.WEST,G);let Q=Y;Y=bU(f,s,B,W,Y,1,1,m.height,m.encodedNormal,1,G),Y=AU(r,f,B,W,Y,r.northTiles,r.northMeshes,gn.SOUTH,G),A=G.minimumHeight,S=G.maximumHeight;let de=wn.fromRectangle(s,A,S,n.tilingScheme.ellipsoid),xe=Mi.geodeticLatitudeToMercatorAngle(s.south),ce=1/(Mi.geodeticLatitudeToMercatorAngle(s.north)-xe),_e=(Mi.geodeticLatitudeToMercatorAngle(I.latitude)-xe)*ce,be=f.geodeticSurfaceNormalCartographic(db,HY),De=Ln.octEncode(be,VY),Ae=Y;B.encode(W,Y*k,de.center,U.fromElements(.5,.5,Du),v,De,_e,be),++Y;let ke=Y,ze=ke<256?1:2,et=(ke-1)*3,Et=et*ze,ht=(W.length-ke*k)*Float32Array.BYTES_PER_ELEMENT,Be;if(ht>=Et){let me=ke*k*Float32Array.BYTES_PER_ELEMENT;Be=ke<256?new Uint8Array(W.buffer,me,et):new Uint16Array(W.buffer,me,et)}else Be=ke<256?new Uint8Array(et):new Uint16Array(et);W=new Float32Array(W.buffer,0,ke*k);let qt=0;for(D=0;D<ke-2;++D)Be[qt++]=Ae,Be[qt++]=D,Be[qt++]=D+1;Be[qt++]=Ae,Be[qt++]=D,Be[qt++]=0;let Tt=[];for(D=j;D>=J;--D)Tt.push(D);let lt=[];for(D=K;D>=j;--D)lt.push(D);let Wn=[];for(D=Q;D>=K;--D)Wn.push(D);let on=[];for(on.push(0),D=Ae-1;D>=Q;--D)on.push(D);r.mesh=new ih(B.center,W,Be,et,ke,A,S,ae.fromOrientedBoundingBox(de),wat(e,de.center,s,A,S),B.stride,de,B,Tt,lt,Wn,on)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=oh._createVertexArrayForMesh(g,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let E=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=o._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(r.waterMaskTexture=w.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,w,r.waterMaskTranslationAndScale))}l(E)&&(--E.referenceCount,E.referenceCount===0&&E.destroy())}function bU(e,t,n,i,o,r,s,a,c,u,f){let h=db;h.longitude=P.lerp(t.west,t.east,r),h.latitude=P.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,OE),_;n.hasGeodeticSurfaceNormals&&(_=e.geodeticSurfaceNormal(p,HY));let m=UY;return m.x=r,m.y=s,n.encode(i,o*n.stride,p,m,a,c,u,_),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var EU=new se;function PI(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=se.clone(e.rectangle,EU),o.west-=P.TWO_PI,o.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=se.clone(e.rectangle,EU),o.west+=P.TWO_PI,o.east+=P.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,h=(r.north-o.south)/u,p=(n.x-a)/(c-a),_=(n.y-f)/(h-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(_)<Math.EPSILON5?_=0:Math.abs(_-1)<Math.EPSILON5&&(_=1),i.x=p,i.y=_,i}var Tat=new U;function zY(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var Cat=new U,Aat=new d;function Eat(e,t,n,i,o,r,s,a,c,u){let f=i.encoding,h=i.vertices,p=PI(t,n,f.decodeTextureCoordinates(h,o,Du),Du),_=PI(t,n,f.decodeTextureCoordinates(h,r,UY),UY),m;c?m=(s-p.x)/(_.x-p.x):m=(a-p.y)/(_.y-p.y);let x=f.decodeHeight(h,o),b=f.decodeHeight(h,r),T=n.rectangle;db.longitude=P.lerp(T.west,T.east,s),db.latitude=P.lerp(T.south,T.north,a),u.height=db.height=P.lerp(x,b,m);let C;if(f.hasVertexNormals){let A=f.getOctEncodedNormal(h,o,Tat),S=f.getOctEncodedNormal(h,r,Cat),v=Ln.octDecode(A.x,A.y,OE),D=Ln.octDecode(S.x,S.y,Aat);C=d.lerp(v,D,m,OE),d.normalize(C,C),Ln.octEncode(C,u.encodedNormal)}else C=e.geodeticSurfaceNormalCartographic(db,OE),Ln.octEncode(C,u.encodedNormal)}function l_e(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(db,OE);Ln.octEncode(s,r.encodedNormal)}function TU(e,t,n,i,o,r,s,a,c,u,f){if(a_e(e,t,a,s,!1,n,i,f)||a_e(e,t,u,c,!0,n,i,f))return f;let p;if(GY(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],zY(r,p,n,i,f),f;let _;if(n===0?i===0?_=CU(e.westMeshes,e.westTiles,gn.EAST,e.southMeshes,e.southTiles,gn.NORTH,n,i):_=CU(e.northMeshes,e.northTiles,gn.SOUTH,e.westMeshes,e.westTiles,gn.EAST,n,i):i===0?_=CU(e.southMeshes,e.southTiles,gn.NORTH,e.eastMeshes,e.eastTiles,gn.WEST,n,i):_=CU(e.eastMeshes,e.eastTiles,gn.WEST,e.northMeshes,e.northTiles,gn.SOUTH,n,i),l(_))return l_e(e,t,n,i,_,f),f}function CU(e,t,n,i,o,r,s,a){let c=s_e(e,t,!1,n,s,a),u=s_e(i,o,!0,r,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function AU(e,t,n,i,o,r,s,a,c){for(let u=0;u<r.length;++u)o=Sat(e,t,n,i,o,r[u],s[u],a,c);return o}function Sat(e,t,n,i,o,r,s,a,c){let u=r.rectangle;a===gn.EAST&&e.tile.x===0?(u=se.clone(r.rectangle,EU),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===gn.WEST&&r.x===0&&(u=se.clone(r.rectangle,EU),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Du),h=Du.x,p=Du.y);let _,m;switch(a){case gn.WEST:_=s.westIndicesSouthToNorth,m=!1;break;case gn.NORTH:_=s.northIndicesWestToEast,m=!0;break;case gn.EAST:_=s.eastIndicesNorthToSouth,m=!1;break;case gn.SOUTH:_=s.southIndicesEastToWest,m=!0;break}let x=r,b=e.tile,T=s.encoding,C=s.vertices,A=n.stride,S,v;T.hasWebMercatorT&&(S=Mi.geodeticLatitudeToMercatorAngle(f.south),v=1/(Mi.geodeticLatitudeToMercatorAngle(f.north)-S));for(let D=0;D<_.length;++D){let O=_[D],R=T.decodeTextureCoordinates(C,O,Du);PI(x,b,R,R);let M=R.x,L=R.y,g=m?M:L;if(g<0||g>1||Math.abs(M-h)<P.EPSILON5&&Math.abs(L-p)<P.EPSILON5)continue;let E=Math.abs(M)<P.EPSILON5||Math.abs(M-1)<P.EPSILON5,w=Math.abs(L)<P.EPSILON5||Math.abs(L-1)<P.EPSILON5;if(E&&w)continue;let I=T.decodePosition(C,O,OE),N=T.decodeHeight(C,O),B;T.hasVertexNormals?B=T.getOctEncodedNormal(C,O,VY):(B=VY,B.x=0,B.y=0);let H=L;if(T.hasWebMercatorT){let G=P.lerp(f.south,f.north,L);H=(Mi.geodeticLatitudeToMercatorAngle(G)-S)*v}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,HY)),n.encode(i,o*A,I,R,N,B,H,V),c.minimumHeight=Math.min(c.minimumHeight,N),c.maximumHeight=Math.max(c.maximumHeight,N),++o}return o}function s_e(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],h=t[u];if(!GY(h,f))continue;let p;switch(i){case gn.WEST:p=f.westIndicesSouthToNorth;break;case gn.SOUTH:p=f.southIndicesEastToWest;break;case gn.EAST:p=f.eastIndicesNorthToSouth;break;case gn.NORTH:p=f.northIndicesWestToEast;break}let _=p[n?0:p.length-1];if(l(_))return f.encoding.decodeHeight(f.vertices,_)}}function GY(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function a_e(e,t,n,i,o,r,s,a){let c,u,f,h,p,_=i[o?0:n.length-1],m=n[o?0:n.length-1];if(GY(_,m)&&(r===0?s===0?(c=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(c=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):s===0?(c=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(c=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){h=o?0:c.length-1,p=c[h],m.encoding.decodeTextureCoordinates(m.vertices,p,Du);let x=PI(_,e.tile,Du,Du);if(x.x===r&&x.y===s)return zY(m,p,r,s,a),!0;if(h=Mo(c,u?r:s,function(b,T){m.encoding.decodeTextureCoordinates(m.vertices,b,Du);let C=PI(_,e.tile,Du,Du);return f?u?C.x-r:C.y-s:u?r-C.x:s-C.y}),h<0){if(h=~h,h>0&&h<c.length)return Eat(t,_,e.tile,m,c[h-1],c[h],r,s,u,a),!0}else return zY(m,c[h],r,s,a),!0}return!1}var vat=[new d,new d,new d,new d];function wat(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=vat;return d.fromRadians(n.west,n.south,o,a,c[0]),d.fromRadians(n.east,n.south,o,a,c[1]),d.fromRadians(n.west,n.north,o,a,c[2]),d.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var RI=ME;function Jo(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=xn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new pe,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(Jo.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(Jo.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(Jo.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(Jo.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new pe,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=se.clone(se.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(Jo.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=oe.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Kh.setOwner(e,this,"_clippingPolygons")}}});function Dat(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}Jo.prototype.update=function(e){this._imageryLayers._update()};function Iat(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}Jo.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Dat)})),Iat(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)oh._freeVertexArray(t[i]);t.length=0};Jo.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};Jo.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:wc.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:wc.LESS_OR_EQUAL},blending:ln.ALPHA_BLEND});let s=Ge(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=Ge(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&RI.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let u=0,f=c.length;u<f;++u){let h=c[u],p=h.data.tileBoundingRegion;Jat(this,h,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function m_e(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}Jo.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)m_e(t[n],e)};Jo.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};Jo.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};Jo.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Yn.CULLED_BUT_NEEDED,o=n.terrainState),oh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==br.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,oh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Pat=new ae,p_e=new se,Rat=new se,Oat=new fe;function wU(e,t){if(t.west<t.east)return t;let n=se.clone(t,Rat);return se.center(e,Oat).longitude>0?n.east=P.PI:n.west=-P.PI,n}function g_e(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!se.equals(e.cartographicLimitRectangle,se.MAX_VALUE))}Jo.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=g_e(this,t);if(t.fog.enabled&&!o&&P.fog(i,t.fog.density)>=1)return br.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return br.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let u=wU(e.rectangle,this.cartographicLimitRectangle),f=se.simpleIntersection(u,e.rectangle,p_e);if(!l(f))return br.NONE;if(se.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ne.SCENE3D&&(c=Pat,ae.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),d.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ne.MORPHING&&l(r.renderedMesh)&&(c=ae.union(s.boundingSphere,c,c))),!l(c))return br.PARTIAL;let h=this._clippingPlanes;if(l(h)&&h.enabled){let b=h.computeIntersectionWithBoundingVolume(c);if(e.isClipped=b!==Wt.INSIDE,b===Wt.OUTSIDE)return br.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(s);e.isClipped=b!==Wt.OUTSIDE}let _,m=a.computeVisibility(c);if(m===Wt.OUTSIDE?_=br.NONE:m===Wt.INTERSECTING?_=br.PARTIAL:m===Wt.INSIDE&&(_=br.FULL),_===br.NONE)return _;let x=t.mode===ne.SCENE3D&&t.camera.frustum instanceof nn;if(t.mode===ne.SCENE3D&&!x&&l(n)&&!o){let b=r.occludeePointInScaledSpace;return!l(b)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?_:br.NONE}return _};Jo.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Mat=[],Lat=[];Jo.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Mat;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===ho.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let h=s[a],p=h.loadingImagery,_=!l(p)||p.state===ai.FAILED||p.state===ai.INVALID,m=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[m]=_&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=Lat;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let h=f.pop(),p=h._lastSelectionResultFrame===u?h._lastSelectionResult:Yn.NONE;if(p===Yn.RENDERED){let _=h.data;if(!l(_))continue;if(!o&&h.data.terrainState===ho.READY)return!1;let m=h.data.imagery;for(a=0,c=m.length;a<c;++a){let x=m[a],b=x.loadingImagery,T=!l(b)||b.state===ai.FAILED||b.state===ai.INVALID,C=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(T&&!i[C])return!1}}else p===Yn.REFINED&&f.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var Nat=new d;Jo.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=d.subtract(i.center,o,Nat),a=d.magnitude(s);return a<P.EPSILON5?0:(d.divideByScalar(s,a,s),(1-d.dot(s,r))*e._distance)};var u_e=new F,vU=new F,Fat=new oe,Bat=new oe,kat=new oe,Vat=new d,f_e=new d,Uat=new d,zat=new d;Jo.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let u=i[a];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Hat=[new d,new d,new d,new d];function d_e(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Hat;return d.fromRadians(n.west,n.south,o,a,c[0]),d.fromRadians(n.east,n.south,o,a,c[1]),d.fromRadians(n.west,n.north,o,a,c[2]),d.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}Jo.prototype.computeDistanceToTile=function(e,t){Gat(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-s);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function Gat(e,t,n){let i=e.data;i===void 0&&(i=e.data=new oh);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Md({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,u=e,f=i.mesh,h=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,c=!0;else if(h!==void 0&&h._minimumHeight!==void 0&&h._maximumHeight!==void 0)r.minimumHeight=h._minimumHeight,r.maximumHeight=h._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let _=p.data;if(_!==void 0){let m=_.mesh,x=_.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,_=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=Dr.getHeight(r.minimumHeight,p,_),r.maximumHeight=Dr.getHeight(r.maximumHeight,p,_)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=wn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ae.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=d.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=d_e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=d_e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}Jo.prototype.isDestroyed=function(){return!1};Jo.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function Wat(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(o=a[u],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}Jo.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,u=c.length,f=-1,h=0;for(a=0;a<u;++a){let _=c[a];if(y(_.readyImagery,_.loadingImagery).imageryLayer===e)f===-1&&(f=a),++h;else if(f!==-1)break}if(f===-1)return;let p=f+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Wat(h,e,n),s.state=ma.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=ma.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Yn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};Jo.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};Jo.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};Jo.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var jat=new F,qat=new F;function h_e(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=F.multiplyByPoint(i,this.properties.rtc,f_e);return F.setTranslation(i,o,u_e),u_e},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=F.multiplyByPoint(i,this.properties.rtc,f_e);return F.setTranslation(i,r,vU),F.multiply(o,vU,vU),vU},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?F.multiply(e.context.uniformState.view,i.modelMatrix,jat):F.IDENTITY;return F.inverseTranspose(o,qat)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new oe(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new U(65e5,9e6),nightFadeDistance:new U(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new d(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new d(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new d,center3D:void 0,rtc:new d,modifiedModelView:new F,tileRectangle:new oe,verticalExaggerationAndRelativeHeight:new U(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new U,southMercatorYAndOneOverHeight:new U,waterMask:void 0,waterMaskTranslationAndScale:new oe,minMaxHeight:new U,scaleAndBias:new F,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new oe,frontFaceAlphaByDistance:new oe,backFaceAlphaByDistance:new oe,localizedTranslucencyRectangle:new oe,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new oe,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?xt(n,t.materialUniformMap):n}function Yat(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Xat(e,r,o),i.wireframeVertexArray.mesh=o}}function Xat(e,t,n){let o={indices:n.indices,primitiveType:Me.TRIANGLES};Nn.toWireframe(o);let r=o.indices,s=_t.createIndexBuffer({context:e,typedArray:r,usage:Fe.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ni({context:e,attributes:t._attributes,indexBuffer:s})}var __e,y_e,DU;(function(){let e=new vt({geometry:Rh.fromDimensions({dimensions:new d(2,2,2)})}),t=new vt({geometry:new X_({radius:1})}),n=new F,i,o;function r(s){return new In({geometryInstances:s,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}__e=function(s,a){return s===i||(DU(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Gt.fromColor(a),o=r(e)),o},y_e=function(s,a){return s===i||(DU(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Gt.fromColor(a),o=r(t)),o},DU=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Kat=new oe(0,0,0,0),Zat={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},$at=z.TRANSPARENT,Qat=new Bt;function Jat(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new RI(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let me=r.credits;for(let Ce=0,hn=me.length;Ce<hn;++Ce)o.addCreditToNextFrame(me[Ce])}let s=Ft.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,h=f.translucent,p=f.frontFaceAlphaByDistance,_=f.backFaceAlphaByDistance,m=f.rectangle,x=y(e.undergroundColor,$at),b=y(e.undergroundColorAlphaByDistance,Qat),T=g_e(e,n)&&n.mode===ne.SCENE3D&&x.alpha>0&&(b.nearValue>0||b.farValue>0),C=e.lambertDiffuseMultiplier,A=e.vertexShadowDarkness,S=e.hasWaterMask&&l(a),v=S&&e.showWaterEffect,D=e.oceanNormalMap,O=v&&l(D),R=e.terrainProvider,M=l(R)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,g=e.showGroundAtmosphere&&n.mode===ne.SCENE3D,E=xn.castShadows(e.shadows)&&!h,w=xn.receiveShadows(e.shadows)&&!h,I=e.hueShift,N=e.saturationShift,B=e.brightnessShift,H=!(P.equalsEpsilon(I,0,P.EPSILON7)&&P.equalsEpsilon(N,0,P.EPSILON7)&&P.equalsEpsilon(B,0,P.EPSILON7)),V=!1;if(g){let me=d.magnitude(n.camera.positionWC),Ce=e.nightFadeOutDistance;V=me>Ce}S&&--s,O&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let G=i.renderedMesh,k=G.center,W=G.encoding,Y=i.tileBoundingRegion,J=n.verticalExaggeration,j=n.verticalExaggerationRelativeHeight,K=J!==1,Q=W.hasGeodeticSurfaceNormals,de=Fat,xe=0,ce=0,_e=0,be=0,De=!1;if(n.mode!==ne.SCENE3D){let me=n.mapProjection,Ce=me.project(se.southwest(t.rectangle),Uat),hn=me.project(se.northeast(t.rectangle),zat);if(de.x=Ce.x,de.y=Ce.y,de.z=hn.x,de.w=hn.y,n.mode!==ne.MORPHING&&(k=Vat,k.x=0,k.y=(de.z+de.x)*.5,k.z=(de.w+de.y)*.5,de.x-=k.y,de.y-=k.z,de.z-=k.y,de.w-=k.z),n.mode===ne.SCENE2D&&W.quantization===ha.BITS12){let ft=1/(Math.pow(2,12)-1)*.5,to=(de.z-de.x)*ft,Eo=(de.w-de.y)*ft;de.x-=to,de.y-=Eo,de.z+=to,de.w+=Eo}me instanceof Mi&&(xe=t.rectangle.south,ce=t.rectangle.north,_e=Mi.geodeticLatitudeToMercatorAngle(xe),be=1/(Mi.geodeticLatitudeToMercatorAngle(ce)-_e),De=!0)}let Ae=Zat;Ae.frameState=n,Ae.surfaceTile=i,Ae.hasWaterMask=S,Ae.showReflectiveOcean=v,Ae.showOceanWaves=O,Ae.enableLighting=e.enableLighting,Ae.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ae.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ae.showGroundAtmosphere=g,Ae.atmosphereLightIntensity=e.atmosphereLightIntensity,Ae.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ae.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ae.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ae.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ae.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ae.perFragmentGroundAtmosphere=V,Ae.hasVertexNormals=M,Ae.useWebMercatorProjection=De,Ae.clippedByBoundaries=i.clippedByBoundaries,Ae.hasGeodeticSurfaceNormals=Q,Ae.hasExaggeration=K;let ke=i.imagery,ze=0,et=ke.length,Et=e.showSkirts&&!u&&!h,ht=e.backFaceCulling&&!u&&!h,Be=ht?e._renderState:e._disableCullingRenderState,qt=ht?e._blendRenderState:e._disableCullingBlendRenderState,Tt=Be,lt=e._firstPassInitialColor,Wn=n.context;if(l(e._debug.boundingSphereTile)||DU(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let me=e._drawCommands.length;for(let Ce=0;Ce<me;++Ce)e._uniformMaps[Ce]=h_e(n,e)}do{let me=0,Ce,hn;if(e._drawCommands.length<=e._usedDrawCommands?(Ce=new $e,Ce.owner=t,Ce.cull=!1,Ce.boundingVolume=new ae,Ce.orientedBoundingBox=void 0,hn=h_e(n,e),e._drawCommands.push(Ce),e._uniformMaps.push(hn)):(Ce=e._drawCommands[e._usedDrawCommands],hn=e._uniformMaps[e._usedDrawCommands]),Ce.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Ks=Y.boundingVolume,rl=Y.boundingSphere;l(Ks)?__e(Ks,z.RED).update(n):l(rl)&&y_e(rl,z.RED).update(n)}let ft=hn.properties;oe.clone(lt,ft.initialColor),ft.oceanNormalMap=D,ft.lightingFadeDistance.x=e.lightingFadeOutDistance,ft.lightingFadeDistance.y=e.lightingFadeInDistance,ft.nightFadeDistance.x=e.nightFadeOutDistance,ft.nightFadeDistance.y=e.nightFadeInDistance,ft.atmosphereLightIntensity=e.atmosphereLightIntensity,ft.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ft.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ft.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ft.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ft.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ft.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let to=u?_:p,Eo=u?p:_;l(to)&&(oe.fromElements(to.near,to.nearValue,to.far,to.farValue,ft.frontFaceAlphaByDistance),oe.fromElements(Eo.near,Eo.nearValue,Eo.far,Eo.farValue,ft.backFaceAlphaByDistance)),oe.fromElements(b.near,b.nearValue,b.far,b.farValue,ft.undergroundColorAlphaByDistance),z.clone(x,ft.undergroundColor),ft.lambertDiffuseMultiplier=C,ft.vertexShadowDarkness=A;let Ys=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Ys&&z.clone(e.fillHighlightColor,ft.fillHighlightColor),ft.verticalExaggerationAndRelativeHeight.x=J,ft.verticalExaggerationAndRelativeHeight.y=j,ft.center3D=G.center,d.clone(k,ft.rtc),oe.clone(de,ft.tileRectangle),ft.southAndNorthLatitude.x=xe,ft.southAndNorthLatitude.y=ce,ft.southMercatorYAndOneOverHeight.x=_e,ft.southMercatorYAndOneOverHeight.y=be;let Cr=Bat,hs=wU(t.rectangle,e.cartographicLimitRectangle),Le=kat,it=wU(t.rectangle,m);d.fromElements(I,N,B,ft.hsbShift);let je=t.rectangle,Xe=1/je.width,dt=1/je.height;Cr.x=(hs.west-je.west)*Xe,Cr.y=(hs.south-je.south)*dt,Cr.z=(hs.east-je.west)*Xe,Cr.w=(hs.north-je.south)*dt,oe.clone(Cr,ft.localizedCartographicLimitRectangle),Le.x=(it.west-je.west)*Xe,Le.y=(it.south-je.south)*dt,Le.z=(it.east-je.west)*Xe,Le.w=(it.north-je.south)*dt,oe.clone(Le,ft.localizedTranslucencyRectangle);let Ht=L&&P.fog(t._distance,n.fog.density)>P.EPSILON3;H=H&&(Ht||g);let _n=!1,So=!1,yo=!1,Na=!1,Fa=!1,_i=!1,fi=!1,Xs=!1,kr=!1,ol=!1;for(;me<s&&ze<et;){let Ks=ke[ze],rl=Ks.readyImagery;if(++ze,!l(rl)||rl.imageryLayer.alpha===0)continue;let yc=Ks.useWebMercatorT?rl.textureWebMercator:rl.texture,es=rl.imageryLayer;l(Ks.textureTranslationAndScale)||(Ks.textureTranslationAndScale=es._calculateTextureTranslationAndScale(t,Ks)),ft.dayTextures[me]=yc,ft.dayTextureTranslationAndScale[me]=Ks.textureTranslationAndScale,ft.dayTextureTexCoordsRectangle[me]=Ks.textureCoordinateRectangle,ft.dayTextureUseWebMercatorT[me]=Ks.useWebMercatorT,ft.dayTextureAlpha[me]=es.alpha,_i=_i||ft.dayTextureAlpha[me]!==1,ft.dayTextureNightAlpha[me]=es.nightAlpha,fi=fi||ft.dayTextureNightAlpha[me]!==1,ft.dayTextureDayAlpha[me]=es.dayAlpha,fi=fi||ft.dayTextureDayAlpha[me]!==1,ft.dayTextureBrightness[me]=es.brightness,_n=_n||ft.dayTextureBrightness[me]!==uc.DEFAULT_BRIGHTNESS,ft.dayTextureContrast[me]=es.contrast,So=So||ft.dayTextureContrast[me]!==uc.DEFAULT_CONTRAST,ft.dayTextureHue[me]=es.hue,yo=yo||ft.dayTextureHue[me]!==uc.DEFAULT_HUE,ft.dayTextureSaturation[me]=es.saturation,Na=Na||ft.dayTextureSaturation[me]!==uc.DEFAULT_SATURATION,ft.dayTextureOneOverGamma[me]=1/es.gamma,Fa=Fa||ft.dayTextureOneOverGamma[me]!==1/uc.DEFAULT_GAMMA,ft.dayTextureSplit[me]=es.splitDirection,Xs=Xs||ft.dayTextureSplit[me]!==0;let zu=ft.dayTextureCutoutRectangles[me];if(l(zu)||(zu=ft.dayTextureCutoutRectangles[me]=new oe),oe.clone(oe.ZERO,zu),l(es.cutoutRectangle)){let Ro=wU(je,es.cutoutRectangle),cn=se.simpleIntersection(Ro,je,p_e);kr=l(cn)||kr,zu.x=(Ro.west-je.west)*Xe,zu.y=(Ro.south-je.south)*dt,zu.z=(Ro.east-je.west)*Xe,zu.w=(Ro.north-je.south)*dt}let Hu=ft.colorsToAlpha[me];l(Hu)||(Hu=ft.colorsToAlpha[me]=new oe);let Gu=l(es.colorToAlpha)&&es.colorToAlphaThreshold>0;if(ol=ol||Gu,Gu){let Ro=es.colorToAlpha;Hu.x=Ro.red,Hu.y=Ro.green,Hu.z=Ro.blue,Hu.w=es.colorToAlphaThreshold}else Hu.w=-1;if(l(rl.credits)){let Ro=rl.credits;for(let cn=0,Ee=Ro.length;cn<Ee;++cn)o.addCreditToNextFrame(Ro[cn])}++me}ft.dayTextures.length=me,ft.waterMask=a,oe.clone(c,ft.waterMaskTranslationAndScale),ft.minMaxHeight.x=W.minimumHeight,ft.minMaxHeight.y=W.maximumHeight,F.clone(W.matrix,ft.scaleAndBias);let po=e._clippingPlanes,Ar=l(po)&&po.enabled&&t.isClipped;Ar&&(ft.clippingPlanesEdgeColor=z.clone(po.edgeColor,ft.clippingPlanesEdgeColor),ft.clippingPlanesEdgeWidth=po.edgeWidth);let Zm=e._clippingPolygons,Vr=l(Zm)&&Zm.enabled&&t.isClipped;Ae.numberOfDayTextures=me,Ae.applyBrightness=_n,Ae.applyContrast=So,Ae.applyHue=yo,Ae.applySaturation=Na,Ae.applyGamma=Fa,Ae.applyAlpha=_i,Ae.applyDayNightAlpha=fi,Ae.applySplit=Xs,Ae.enableFog=Ht,Ae.enableClippingPlanes=Ar,Ae.clippingPlanes=po,Ae.enableClippingPolygons=Vr,Ae.clippingPolygons=Zm,Ae.hasImageryLayerCutout=kr,Ae.colorCorrect=H,Ae.highlightFillTile=Ys,Ae.colorToAlpha=ol,Ae.showUndergroundColor=T,Ae.translucent=h;let Uu=i.renderedMesh.indices.length;Et||(Uu=i.renderedMesh.indexCountWithoutSkirts),Ce.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ae),Ce.castShadows=E,Ce.receiveShadows=w,Ce.renderState=Tt,Ce.primitiveType=Me.TRIANGLES,Ce.vertexArray=i.vertexArray||i.fill.vertexArray,Ce.count=Uu,Ce.uniformMap=hn,Ce.pass=we.GLOBE,e._debug.wireframe&&(Yat(Wn,e,t),l(i.wireframeVertexArray)&&(Ce.vertexArray=i.wireframeVertexArray,Ce.primitiveType=Me.LINES,Ce.count=Uu*2));let Ba=Ce.boundingVolume,b0=Ce.orientedBoundingBox;n.mode!==ne.SCENE3D?(ae.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,Y.minimumHeight,Y.maximumHeight,Ba),d.fromElements(Ba.center.z,Ba.center.x,Ba.center.y,Ba.center),n.mode===ne.MORPHING&&(Ba=ae.union(Y.boundingSphere,Ba,Ba))):(Ce.boundingVolume=ae.clone(Y.boundingSphere,Ba),Ce.orientedBoundingBox=wn.clone(Y.boundingVolume,b0)),Ce.dirty=!0,h&&f.updateDerivedCommands(Ce,n),m_e(Ce,n),Tt=qt,lt=Kat}while(ze<et)}var IU=Jo;function x_e(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=se.clone(se.MAX_VALUE)}Object.defineProperties(x_e.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Bt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Bt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=se.clone(se.MAX_VALUE)),se.clone(e,this._rectangle)}}});var PU=x_e;function Ds(){this._layers=[],this.layerAdded=new pe,this.layerRemoved=new pe,this.layerMoved=new pe,this.layerShownOrHidden=new pe}Object.defineProperties(Ds.prototype,{length:{get:function(){return this._layers.length}}});Ds.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Ds.prototype.addImageryProvider=function(e,t){let n=new uc(e);return this.add(n,t),n};Ds.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Ds.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Ds.prototype.contains=function(e){return this.indexOf(e)!==-1};Ds.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ds.prototype.get=function(e){return this._layers[e]};function RU(e,t){return e.indexOf(t)}function b_e(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Ds.prototype.raise=function(e){let t=RU(this._layers,e);b_e(this,t,t+1)};Ds.prototype.lower=function(e){let t=RU(this._layers,e);b_e(this,t,t-1)};Ds.prototype.raiseToTop=function(e){let t=RU(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Ds.prototype.lowerToBottom=function(e){let t=RU(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var ect=new se;function T_e(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];se.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!se.contains(u.rectangle,t))continue;let h=ect,p=1/1024;h.west=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),h.east=P.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),h.south=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),h.north=P.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),se.contains(h,t)&&i(u)}}Ds.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(T_e(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Ds.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(T_e(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let u=s[c],f=r[c];if(l(u)&&u.length>0)for(let h=0;h<u.length;++h){let p=u[h];p.imageryLayer=f,l(p.position)||(p.position=i),a.push(p)}}return a})};Ds.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ds.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ds.prototype.isDestroyed=function(){return!1};Ds.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Ds.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var OU=Ds;function C_e(e){this._ellipsoid=new oy(e.ellipsoid,d.ZERO)}Object.defineProperties(C_e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var MU=C_e;function Qc(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Yn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=ma.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Qc.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new Qc({tilingScheme:e,x:s,y:r,level:0});return i};Qc.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],se.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],se.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(Qc.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new Qc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new Qc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new Qc({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new Qc({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<ma.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Qc.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};Qc.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};Qc.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};Qc.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};Qc.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};Qc.prototype.freeResources=function(){this.state=ma.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),LU(this._southwestChild),this._southwestChild=void 0,LU(this._southeastChild),this._southeastChild=void 0,LU(this._northwestChild),this._northwestChild=void 0,LU(this._northeastChild),this._northeastChild=void 0};function LU(e){l(e)&&e.freeResources()}var NU=Qc;function FU(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}FU.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};FU.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),A_e(this,t)),t=i}};function A_e(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}FU.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&A_e(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var BU=FU;function Yf(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new BU,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new MU({ellipsoid:n}),this._tileLoadProgressEvent=new pe,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Yf.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Yf.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function tct(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,S_e(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Yf.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==ma.START&&e(t),t=t.replacementNext};Yf.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};Yf.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Yf.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function S_e(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Yf.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(tct(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),S_e(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};Yf.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),rct(this,e),pct(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function nct(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=pe.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}Yf.prototype.endFrame=function(e){!e.passes.render||e.mode===ne.MORPHING||(fct(this,e),mct(this,e),nct(this,e))};Yf.prototype.isDestroyed=function(){return!1};Yf.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var MI,E_e=new fe;function ict(e,t){let n=se.center(e.rectangle,E_e),i=n.longitude-MI.longitude,o=n.latitude-MI.latitude;n=se.center(t.rectangle,E_e);let r=n.longitude-MI.longitude,s=n.latitude-MI.latitude;return i*i+o*o-(r*r+s*s)}var oct=new d,OI=[];function rct(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles)){let x=r.tilingScheme;if(l(x)){let b=r.tilingScheme;e._levelZeroTiles=NU.createLevelZeroTiles(b);let T=e._levelZeroTiles.length;if(OI.length<T)for(OI=new Array(T),o=0;o<T;++o)OI[o]===void 0&&(OI[o]=new LI)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;MI=t.camera.positionCartographic,a.sort(ict);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,h=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(h,u,f);u.length=0,f.length=0}let _=t.camera;e._cameraPositionCartographic=_.positionCartographic;let m=F.getTranslation(_.transform,oct);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ra(e,s,r,t,c,!1,OI[o]):(mg(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}function mg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function LI(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function v_e(){this.southwest=new LI,this.southeast=new LI,this.northwest=new LI,this.northeast=new LI}v_e.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var qY=new Array(31);for(let e=0;e<qY.length;++e)qY[e]=new v_e;function sct(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=lct(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:Yn.NONE,_=e.tileProvider;if(s||i){let m=Yn.originalResult(p)===Yn.RENDERED,x=Yn.originalResult(p)===Yn.CULLED||p===Yn.NONE,b=n.state===ma.DONE,T=m||x||b;if(T||l(_.canRenderWithoutLosingDetail)&&(T=_.canRenderWithoutLosingDetail(n)),T){s&&mg(e,e._tileLoadQueueMedium,n,t),kU(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&mg(e,e._tileLoadQueueHigh,n,t)}if(_.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){kU(e,n),mg(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.REFINED;let x=e._tilesToRender.length,b=e._tileLoadQueueLow.length,T=e._tileLoadQueueMedium.length,C=e._tileLoadQueueHigh.length,A=e._tileToUpdateHeights.length;if(act(e,a,c,u,f,t,i,o),x!==e._tilesToRender.length){let S=o.allAreRenderable,v=o.anyWereRenderedLastFrame,D=o.notYetRenderableCount,O=!1;if(!S&&!v){let R=e._tilesToRender;for(let L=x;L<R.length;++L){let g=R[L];for(;g!==void 0&&g._lastSelectionResult!==Yn.KICKED&&g!==n;)g._lastSelectionResult=Yn.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=A,kU(e,n),n._lastSelectionResult=Yn.RENDERED;let M=p===Yn.RENDERED;!M&&D>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=T,e._tileLoadQueueHigh.length=C,mg(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,O=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=M,M||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!O&&mg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,kU(e,n),mg(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function act(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,h=qY[t.level],p=h.southwest,_=h.southeast,m=h.northwest,x=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Ra(e,t,u,r,f,s,p),Ra(e,n,u,r,f,s,_),Ra(e,i,u,r,f,s,m),Ra(e,o,u,r,f,s,x)):(Ra(e,i,u,r,f,s,m),Ra(e,t,u,r,f,s,p),Ra(e,o,u,r,f,s,x),Ra(e,n,u,r,f,s,_)):c.latitude<t.rectangle.north?(Ra(e,n,u,r,f,s,_),Ra(e,t,u,r,f,s,p),Ra(e,o,u,r,f,s,x),Ra(e,i,u,r,f,s,m)):(Ra(e,o,u,r,f,s,x),Ra(e,i,u,r,f,s,m),Ra(e,n,u,r,f,s,_),Ra(e,t,u,r,f,s,p)),h.combine(a)}function cct(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&se.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&se.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ra(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==br.NONE)return sct(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,cct(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&mg(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Yn.NONE;c!==Yn.CULLED_BUT_NEEDED&&c!==Yn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Yn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(mg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Yn.CULLED):t._lastSelectionResult=Yn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function lct(e,t,n){if(t.mode===ne.SCENE2D||t.camera.frustum instanceof nn||t.camera.frustum instanceof Hr)return uct(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=P.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function uct(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),h=u/f;return t.fog.enabled&&t.mode!==ne.SCENE2D&&(h-=P.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function kU(e,t){e._tilesToRender.push(t)}function fct(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=Ai()+e._loadQueueTimeSlice,s=e._tileProvider,a=WY(e,t,s,r,n,!1);a=WY(e,t,s,r,i,a),WY(e,t,s,r,o,a)}function dct(e,t){return e._loadPriority-t._loadPriority}function WY(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(dct);for(let s=0,a=o.length;s<a&&(Ai()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var LE=new pn,jY=new fe,qy=new d,hct=[];function mct(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=hct;n.length=0;let i=e._tileToUpdateHeights,o=Ai(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let h=i[0];if(!l(h.data)||!l(h.data.mesh)){let x=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:Yn.NONE;(x===Yn.RENDERED||x===Yn.CULLED_BUT_NEEDED)&&n.push(h),i.shift(),e._lastTileIndex=0;continue}let p=h.customData,_=p.length,m=!1;for(f=e._lastTileIndex;f<_;++f){let x=p[f],b=h.data.terrainData,T=l(b)&&b.wasCreatedByUpsampling();if(h.level>x.level&&!T){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=d.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,u)),a===ne.SCENE3D){let A=u.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,LE.direction),S=u.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,LE.origin);if(!l(S)){let v=0;l(h.data.tileBoundingRegion)&&(v=h.data.tileBoundingRegion.minimumHeight);let D=Math.min(v,-11500),O=d.multiplyByScalar(A,Math.abs(D)+1,qy);d.subtract(x.positionOnEllipsoidSurface,O,LE.origin)}}else fe.clone(x.positionCartographic,jY),jY.height=-11500,c.project(jY,qy),d.fromElements(qy.z,qy.x,qy.y,qy),d.clone(qy,LE.origin),d.clone(d.UNIT_X,LE.direction);let C=h.data.pick(LE,a,c,!1,qy);l(C)&&(l(x.callback)&&x.callback(C),x.level=h.level)}if(Ai()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function pct(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var VU=Yf;function sh(e){e=y(e,ee.default);let t=new hg({ellipsoid:e}),n=new OU;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new eU,this._material=void 0,this._surface=new VU({tileProvider:new IU({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new pe,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new Bt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new PU,XY(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Se({url:en("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ee.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=P.PI*e.minimumRadius,this.nightFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*P.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=xn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(sh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=se.clone(se.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&XY(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,XY(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Bt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function XY(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Zh,bI];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(QV),e._surfaceShaderSet.baseVertexShaderSource=new Ue({sources:[Zh,bI,JV],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ue({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function gct(e){return function(t,n){let i=ae.distanceSquaredTo(t.pickBoundingSphere,e),o=ae.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var _ct=[],yct={start:0,stop:0};sh.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=_ct;s.length=0;let a=this._surface._tilesToRender,c=a.length,u,f;for(f=0;f<c;++f){u=a[f];let p=u.data;if(!l(p))continue;let _=p.pickBoundingSphere;if(o!==ne.SCENE3D)p.pickBoundingSphere=_=ae.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,_),d.fromElements(_.center.z,_.center.x,_.center.y,_.center);else if(l(p.renderedMesh))ae.clone(p.tileBoundingRegion.boundingSphere,_);else continue;let m=Qn.raySphere(e,_,yct);l(m)&&s.push(p)}s.sort(gct(e.origin));let h;for(c=s.length,f=0;f<c&&(h=s[f].pick(e,t.mode,t.mapProjection,n,i),!l(h));++f);return h};var xct=new fe;sh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ne.SCENE3D){n=d.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,xct);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var bct=new d,w_e=new d,Tct=new fe,Cct=new pn;function YY(e,t){return l(e)&&se.contains(e.rectangle,t)?e:void 0}sh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!se.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=YY(n._southwestChild,e)||YY(n._southeastChild,e)||YY(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=d.fromRadians(e.longitude,e.latitude,0,a,bct),u=Cct,f=a.geodeticSurfaceNormal(c,u.direction),h=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(h)){let _;l(n.data.tileBoundingRegion)&&(_=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(y(_,0),-11500),x=d.multiplyByScalar(f,Math.abs(m)+1,w_e);d.subtract(c,x,u.origin)}let p=n.data.pick(u,void 0,s,!1,w_e);if(l(p))return a.cartesianToCartographic(p,Tct).height};sh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};sh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Rt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ne.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};sh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};sh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};sh.prototype.isDestroyed=function(){return!1};sh.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var UU=sh;function Act(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var zU=Act;var z_e={},Ect=32.184,Sct=2451545,D_e=-.0529921,I_e=-.1059842,P_e=13.0120009,R_e=13.3407154,O_e=.9856003,M_e=26.4057084,L_e=13.064993,N_e=.3287146,F_e=1.7484877,B_e=-.1589763,k_e=.0036096,V_e=.1643573,U_e=12.9590088,KY=new Z;z_e.ComputeMoon=function(e,t){l(e)||(e=Z.now()),KY=Z.addSeconds(e,Ect,KY);let n=Z.totalDays(KY)-Sct,i=n/qn.DAYS_PER_JULIAN_CENTURY,o=(125.045+D_e*n)*P.RADIANS_PER_DEGREE,r=(250.089+I_e*n)*P.RADIANS_PER_DEGREE,s=(260.008+P_e*n)*P.RADIANS_PER_DEGREE,a=(176.625+R_e*n)*P.RADIANS_PER_DEGREE,c=(357.529+O_e*n)*P.RADIANS_PER_DEGREE,u=(311.589+M_e*n)*P.RADIANS_PER_DEGREE,f=(134.963+L_e*n)*P.RADIANS_PER_DEGREE,h=(276.617+N_e*n)*P.RADIANS_PER_DEGREE,p=(34.226+F_e*n)*P.RADIANS_PER_DEGREE,_=(15.134+B_e*n)*P.RADIANS_PER_DEGREE,m=(119.743+k_e*n)*P.RADIANS_PER_DEGREE,x=(239.961+V_e*n)*P.RADIANS_PER_DEGREE,b=(25.053+U_e*n)*P.RADIANS_PER_DEGREE,T=Math.sin(o),C=Math.sin(r),A=Math.sin(s),S=Math.sin(a),v=Math.sin(c),D=Math.sin(u),O=Math.sin(f),R=Math.sin(h),M=Math.sin(p),L=Math.sin(_),g=Math.sin(m),E=Math.sin(x),w=Math.sin(b),I=Math.cos(o),N=Math.cos(r),B=Math.cos(s),H=Math.cos(a),V=Math.cos(c),G=Math.cos(u),k=Math.cos(f),W=Math.cos(h),Y=Math.cos(p),J=Math.cos(_),j=Math.cos(m),K=Math.cos(x),Q=Math.cos(b),de=(269.9949+.0031*i-3.8787*T-.1204*C+.07*A-.0172*S+.0072*D-.0052*L+.0043*w)*P.RADIANS_PER_DEGREE,xe=(66.5392+.013*i+1.5419*I+.0239*N-.0278*B+.0068*H-.0029*G+9e-4*k+8e-4*J-9e-4*Q)*P.RADIANS_PER_DEGREE,ce=(38.3213+13.17635815*n-14e-13*n*n+3.561*T+.1208*C-.0642*A+.0158*S+.0252*v-.0066*D-.0047*O-.0046*R+.0028*M+.0052*L+.004*g+.0019*E-.0044*w)*P.RADIANS_PER_DEGREE,_e=(13.17635815-14e-13*(2*n)+3.561*I*D_e+.1208*N*I_e-.0642*B*P_e+.0158*H*R_e+.0252*V*O_e-.0066*G*M_e-.0047*k*L_e-.0046*W*N_e+.0028*Y*F_e+.0052*J*B_e+.004*j*k_e+.0019*K*V_e-.0044*Q*U_e)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new zU),t.rightAscension=de,t.declination=xe,t.rotation=ce,t.rotationRate=_e,t};var HU=z_e;function H_e(e){(!l(e)||typeof e!="function")&&(e=HU.ComputeMoon),this._computeFunction=e}var vct=new d,wct=new d,Dct=new d;function Ict(e,t,n){let i=vct;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=Dct;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=d.cross(r,i,wct);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var Pct=new $,Rct=new Oe;H_e.prototype.evaluate=function(e,t){l(e)||(e=Z.now());let n=this._computeFunction(e),i=Ict(n.rightAscension,n.declination,t),o=P.zeroToTwoPi(n.rotation),r=Oe.fromAxisAngle(d.UNIT_Z,o,Rct),s=$.fromQuaternion(Oe.conjugate(r,r),Pct);return $.multiply(s,i,i)};var GU=H_e;var NI=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; + +in vec3 v_positionEC; + +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +{ + vec3 positionEC = czm_pointAlongRay(ray, intersection); + vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; + vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); + vec3 sphericalNormal = normalize(positionMC / u_radii); + vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates + vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates + + vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal); + vec3 positionToEyeEC = -positionEC; + + czm_materialInput materialInput; + materialInput.s = st.s; + materialInput.st = st; + materialInput.str = (positionMC + u_radii) / u_radii; + materialInput.normalEC = normalEC; + materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); + materialInput.positionToEyeEC = positionToEyeEC; + czm_material material = czm_getMaterial(materialInput); + +#ifdef ONLY_SUN_LIGHTING + return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); +#else + return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} + +void main() +{ + // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii + // in the vertex shader. Only when it is larger than some constant, march along the ray. + // Otherwise perform one intersection test which will be the common case. + + // Test if the ray intersects a sphere with the ellipsoid's maximum radius. + // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test + // may cause false negatives. This will discard fragments before marching the ray forward. + float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; + vec3 direction = normalize(v_positionEC); + vec3 ellipsoidCenter = czm_modelView[3].xyz; + + float t1 = -1.0; + float t2 = -1.0; + + float b = -2.0 * dot(direction, ellipsoidCenter); + float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; + + float discriminant = b * b - 4.0 * c; + if (discriminant >= 0.0) { + t1 = (-b - sqrt(discriminant)) * 0.5; + t2 = (-b + sqrt(discriminant)) * 0.5; + } + + if (t1 < 0.0 && t2 < 0.0) { + discard; + } + + float t = min(t1, t2); + if (t < 0.0) { + t = 0.0; + } + + // March ray forward to intersection with larger sphere and find + czm_ray ray = czm_ray(t * direction, direction); + + vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); + + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); + + if (czm_isEmpty(intersection)) + { + discard; + } + + // If the viewer is outside, compute outsideFaceColor, with normals facing outward. + vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); + + // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. + vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); + + out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); + out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); + +#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) + t = (intersection.start != 0.0) ? intersection.start : intersection.stop; + vec3 positionEC = czm_pointAlongRay(ray, t); + vec4 positionCC = czm_projection * vec4(positionEC, 1.0); +#ifdef LOG_DEPTH + czm_writeLogDepth(1.0 + positionCC.w); +#else + float z = positionCC.z / positionCC.w; + + float n = czm_depthRange.near; + float f = czm_depthRange.far; + + gl_FragDepth = (z * (f - n) + f + n) * 0.5; +#endif +#endif +} +`;var FI=`in vec3 position; + +uniform vec3 u_radii; + +out vec3 v_positionEC; + +void main() +{ + // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. + // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, + // but doing it here allows us to change the radii without rewriting the vertex data, and + // allows all ellipsoids to reuse the same vertex data. + vec4 p = vec4(u_radii * position, 1.0); + + v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates + gl_Position = czm_modelViewProjection * p; // position in clip coordinates + + // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums + // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the + // ellipsoid (does not write depth) that was rendered in the farther frustum. + // + // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates + // artifacts since some fragments can be alpha blended twice. This is solved by only rendering + // the ellipsoid in the closest frustum to the viewer. + gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); + + czm_vertexLogDepth(); +} +`;var ZY={position:0};function WU(e){e=y(e,y.EMPTY_OBJECT),this.center=d.clone(y(e.center,d.ZERO)),this._center=new d,this.radii=d.clone(e.radii),this._radii=new d,this._oneOverEllipsoidRadiiSquared=new d,this._boundingSphere=new ae,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=y(e.show,!0),this.material=y(e.material,Yi.fromType(Yi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new $e({owner:y(e._owner,this)}),this._pickCommand=new $e({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function Oct(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=qa.createGeometry(qa.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY}));return t=ni.fromGeometry({context:e,geometry:n,attributeLocations:ZY,bufferUsage:Fe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}WU.prototype.update=function(e){if(!this.show||e.mode!==ne.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:bi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?ln.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Oct(t));let o=!1,r=this.radii;if(!d.equals(this._radii,r)){d.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!F.equals(this.modelMatrix,this._modelMatrix)||!d.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),d.clone(this.center,this._center),F.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(d.clone(d.ZERO,this._boundingSphere.center),this._boundingSphere.radius=d.maximumComponent(r),ae.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,h,p;(s||a||i||u)&&(h=new Ue({sources:[FI]}),p=new Ue({sources:[this.material.shaderSource,NI]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:ZY}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=xt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let _=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?we.TRANSLUCENT:we.OPAQUE,_.push(f)),m.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(h=new Ue({sources:[FI]}),p=new Ue({sources:[this.material.shaderSource,NI],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:ZY}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=xt(xt(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?we.TRANSLUCENT:we.OPAQUE,_.push(x)}};WU.prototype.isDestroyed=function(){return!1};WU.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var jU=WU;function BI(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=en("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,ee.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new jU({radii:this.ellipsoid.radii,material:Yi.fromType(Yi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new GU}Object.defineProperties(BI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var qU=new $,Mct=new $,Lct=new d,YU=[];BI.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Ot.computeIcrfToFixedMatrix(n,qU))||Ot.computeTemeToPseudoFixedMatrix(n,qU);let i=this._axes.evaluate(n,Mct);$.transpose(i,i),$.multiply(qU,i,i);let o=F0.computeMoonPositionInEarthInertialFrame(n,Lct);$.multiplyByVector(qU,o,o),F.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=YU,YU.length=0,t.update(e),e.commandList=r,YU.length===1?YU[0]:void 0};BI.prototype.isDestroyed=function(){return!1};BI.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var XU=BI;var $Y=[],QY=[];function Nct(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=$Y,u=QY,f,h;for(f=0;f<s;++f)c[f]=e[i+f];for(h=0;h<a;++h)u[h]=e[o+h+1];f=0,h=0;for(let p=i;p<=r;++p){let _=c[f],m=u[h];f<s&&(h>=a||t(_,m,n)<=0)?(e[p]=_,++f):h<a&&(e[p]=m,++h)}}function JY(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);JY(e,t,n,i,r),JY(e,t,n,r+1,o),Nct(e,t,n,i,r,o)}function Fct(e,t,n){let i=e.length,o=Math.ceil(i*.5);$Y.length=o,QY.length=o,JY(e,t,n,0,i-1),$Y.length=0,QY.length=0}var Yy=Fct;function fc(e,t){this._occluderPosition=d.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var KU=new d;Object.defineProperties(fc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=d.clone(e,this._cameraPosition);let t=d.subtract(this._occluderPosition,e,KU),n=d.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=d.multiplyByScalar(t,n,KU);let a=o*o*n;s=d.add(e,d.multiplyByScalar(r,a,KU),KU)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});fc.fromBoundingSphere=function(e,t,n){return l(n)?(d.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new fc(e,t)};var W_e=new d;fc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=d.subtract(e,this._occluderPosition,W_e),n=this._occluderRadius;if(n=d.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=d.subtract(e,this._cameraPosition,t),n*n>d.magnitudeSquared(t)}return!1};var Bct=new d;fc.prototype.isBoundingSphereVisible=function(e){let t=d.clone(e.center,Bct),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,W_e),o=this._occluderRadius-n;if(o=d.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i),o*o+n*n>d.magnitudeSquared(i)):!1;if(o>0){i=d.subtract(t,this._cameraPosition,i);let r=d.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var kct=new d;fc.prototype.computeVisibility=function(e){let t=d.clone(e.center),n=e.radius;if(n>this._occluderRadius)return br.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,kct),o=this._occluderRadius-n,r=d.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i);let s=d.magnitudeSquared(i);return o*o+n*n<s?br.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?br.FULL:br.PARTIAL):(i=d.subtract(t,this._horizonPlanePosition,i),d.dot(i,this._horizonPlaneNormal)>-n?br.PARTIAL:br.FULL))}}return br.NONE};var ZU=new d;fc.computeOccludeePoint=function(e,t,n){let i=d.clone(t),o=d.clone(e.center),r=e.radius,s=n.length,a=d.normalize(d.subtract(i,o,ZU),ZU),c=-d.dot(a,o),u=fc._anyRotationVector(o,a,c),f=fc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let h;for(let _=1;_<s;++_){if(h=fc._horizonToPlaneNormalDotProduct(e,a,c,u,n[_]),!h)return;h<f&&(f=h)}if(f<.0017453283658983088)return;let p=r/f;return d.add(o,d.multiplyByScalar(a,p,ZU),ZU)};var Vct=[];fc.computeOccludeePointFromRectangle=function(e,t){t=y(t,ee.default);let n=se.subsample(e,t,0,Vct),i=ae.fromPoints(n),o=d.ZERO;if(!d.equals(o,i.center))return fc.computeOccludeePoint(new ae(o,t.minimumRadius),i.center,n)};var Uct=new d;fc._anyRotationVector=function(e,t,n){let i=d.abs(t,Uct),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new d,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=d.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=d.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=d.UNIT_Z);let a=(d.dot(t,i)+n)/-d.dot(t,s);return d.normalize(d.subtract(d.add(i,d.multiplyByScalar(s,a,r),i),e,i),i)};var zct=new d;fc._rotationVector=function(e,t,n,i,o){let r=d.subtract(i,e,zct);if(r=d.normalize(r,r),d.dot(t,r)<.9999999847691291){let s=d.cross(t,r,r);if(d.magnitude(s)>P.EPSILON13)return d.normalize(s,new d)}return o};var eX=new d,Hct=new d,$U=new d,G_e=new d;fc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=d.clone(o,eX),s=d.clone(e.center,Hct),a=e.radius,c=d.subtract(s,r,$U),u=d.magnitudeSquared(c),f=a*a;if(u<f)return!1;let h=u-f,p=Math.sqrt(h),m=1/Math.sqrt(u),b=p*m*p;c=d.normalize(c,c);let T=d.add(r,d.multiplyByScalar(c,b,G_e),G_e),C=Math.sqrt(h-b*b),A=this._rotationVector(s,t,n,r,i),S=d.fromElements(A.x*A.x*c.x+(A.x*A.y-A.z)*c.y+(A.x*A.z+A.y)*c.z,(A.x*A.y+A.z)*c.x+A.y*A.y*c.y+(A.y*A.z-A.x)*c.z,(A.x*A.z-A.y)*c.x+(A.y*A.z+A.x)*c.y+A.z*A.z*c.z,eX);S=d.normalize(S,S);let v=d.multiplyByScalar(S,C,eX);A=d.normalize(d.subtract(d.add(T,v,$U),s,$U),$U);let D=d.dot(t,A);A=d.normalize(d.subtract(d.subtract(T,v,A),s,A),A);let O=d.dot(t,A);return D<O?D:O};var QU=fc;function Bm(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new ys,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function tX(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Bm.prototype,{projectionMatrix:{get:function(){return tX(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return tX(this),this._infinitePerspective}}});var Gct=new d,Wct=new d,jct=new d,qct=new d;Bm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=d.cross(t,n,Gct),h=Wct;d.multiplyByScalar(t,c,h),d.add(e,h,h);let p=jct;d.multiplyByScalar(t,u,p),d.add(e,p,p);let _=qct;d.multiplyByScalar(f,a,_),d.add(h,_,_),d.subtract(_,e,_),d.normalize(_,_),d.cross(_,n,_),d.normalize(_,_);let m=i[0];return l(m)||(m=i[0]=new oe),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-d.dot(_,e),d.multiplyByScalar(f,s,_),d.add(h,_,_),d.subtract(_,e,_),d.cross(n,_,_),d.normalize(_,_),m=i[1],l(m)||(m=i[1]=new oe),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-d.dot(_,e),d.multiplyByScalar(n,r,_),d.add(h,_,_),d.subtract(_,e,_),d.cross(f,_,_),d.normalize(_,_),m=i[2],l(m)||(m=i[2]=new oe),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-d.dot(_,e),d.multiplyByScalar(n,o,_),d.add(h,_,_),d.subtract(_,e,_),d.cross(_,f,_),d.normalize(_,_),m=i[3],l(m)||(m=i[3]=new oe),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-d.dot(_,e),m=i[4],l(m)||(m=i[4]=new oe),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-d.dot(t,h),d.negate(t,_),m=i[5],l(m)||(m=i[5]=new oe),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-d.dot(_,p),this._cullingVolume};Bm.prototype.getPixelDimensions=function(e,t,n,i,o){tX(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};Bm.prototype.clone=function(e){return l(e)||(e=new Bm),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Bm.prototype.equals=function(e){return l(e)&&e instanceof Bm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Bm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Bm&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var kl=Bm;function Vl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new kl,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}Vl.packedLength=6;Vl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};Vl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Vl),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function ah(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(Vl.prototype,{projectionMatrix:{get:function(){return ah(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return ah(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return ah(this),this._fovy}},sseDenominator:{get:function(){return ah(this),this._sseDenominator}},offCenterFrustum:{get:function(){return ah(this),this._offCenterFrustum}}});Vl.prototype.computeCullingVolume=function(e,t,n){return ah(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Vl.prototype.getPixelDimensions=function(e,t,n,i,o){return ah(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Vl.prototype.clone=function(e){return l(e)||(e=new Vl),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Vl.prototype.equals=function(e){return!l(e)||!(e instanceof Vl)?!1:(ah(this),ah(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Vl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Vl)?!1:(ah(this),ah(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ii=Vl;var JU=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; + +float vdcRadicalInverse(int i) +{ + float r; + float base = 2.0; + float value = 0.0; + float invBase = 1.0 / base; + float invBi = invBase; + for (int x = 0; x < 100; x++) + { + if (i <= 0) + { + break; + } + r = mod(float(i), base); + value += r * invBi; + invBi *= invBase; + i = int(float(i) * invBase); + } + return value; +} + +vec2 hammersley2D(int i, int N) +{ + return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} + +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ + float alphaRoughnessSquared = alphaRoughness * alphaRoughness; + float phi = 2.0 * M_PI * xi.x; + float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); + float sinTheta = sqrt(1.0 - cosTheta * cosTheta); + vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); + vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangentX = normalize(cross(upVector, N)); + vec3 tangentY = cross(N, tangentX); + return tangentX * H.x + tangentY * H.y + N * H.z; +} + +/** + * Estimate the geometric self-shadowing of the microfacets in a surface, + * using the Smith Joint GGX visibility function. + * Note: Vis = G / (4 * NdotL * NdotV) + * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3 + * see Real-Time Rendering. Page 331 to 336. + * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg) + * + * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness. + * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source. + * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera. + */ +float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) +{ + float alphaRoughnessSq = alphaRoughness * alphaRoughness; + + float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); + float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); + + float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0 + if (GGX > 0.0) + { + return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0 + } + return 0.0; +} + +vec2 integrateBrdf(float roughness, float NdotV) +{ + vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); + float A = 0.0; + float B = 0.0; + const int NumSamples = 1024; + float alphaRoughness = roughness * roughness; + for (int i = 0; i < NumSamples; i++) + { + vec2 xi = hammersley2D(i, NumSamples); + vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); + vec3 L = 2.0 * dot(V, H) * H - V; + float NdotL = clamp(L.z, 0.0, 1.0); + float NdotH = clamp(H.z, 0.0, 1.0); + float VdotH = clamp(dot(V, H), 0.0, 1.0); + if (NdotL > 0.0) + { + float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); + float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; + float Fc = pow(1.0 - VdotH, 5.0); + A += (1.0 - Fc) * G_Vis; + B += Fc * G_Vis; + } + } + return vec2(A, B) / float(NumSamples); +} + +void main() +{ + out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); +} +`;function kI(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(kI.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Yct(e,t,n){let i=t.createViewportQuadCommand(JU,{framebuffer:n,renderState:Ve.fromCache({viewport:new qe(0,0,256,256)})});e._drawCommand=i}kI.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Rt({context:t,width:256,height:256,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:Zt.NEAREST});this._colorTexture=n;let i=new zr({context:t,colorTextures:[n],destroyAttachments:!1});Yct(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};kI.prototype.isDestroyed=function(){return!1};kI.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var ez=kI;var X_e={};function Xct(e,t,n){let i,o,r;if(e instanceof Ii){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof kl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var Kct=new d,j_e=new d;function K_e(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let h=(f-r)/c;return P.lerp(-P.PI_OVER_TWO,t,1-h)}}return function(o){return P.lerp(e,t,o)}}function iX(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,u=e.up,f=e.right,h=e.frustum,p=d.subtract(a,c,Kct),_=d.magnitude(d.multiplyByScalar(u,d.dot(p,u),j_e)),m=d.magnitude(d.multiplyByScalar(f,d.dot(p,f),j_e));r=Math.min(Xct(h,_,m)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return P.lerp(n,i,a)}}function VI(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var Z_e=new d;function Zct(e,t,n,i,o,r,s,a){let c=e.camera,u=d.clone(c.position,Z_e),f=c.pitch,h=VI(c.heading,i),p=VI(c.roll,r),_=iX(c,n,u.z,n.z,s),m=K_e(f,o,_,a);function x(b){let T=b.time/t;c.setView({orientation:{heading:P.lerp(h,i,T),pitch:m(T),roll:P.lerp(p,r,T)}}),U.lerp(u,n,T,c.position),c.position.z=_(T)}return x}function $ct(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function Qct(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var Jct=new fe,elt=new fe;function tlt(e,t,n,i,o,r,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,_=fe.clone(f.positionCartographic,Jct),m=f.pitch,x=VI(f.heading,i),b=VI(f.roll,r),T=p.cartesianToCartographic(n,elt);_.longitude=P.zeroToTwoPi(_.longitude),T.longitude=P.zeroToTwoPi(T.longitude);let C=!1;if(l(a)){let D=P.zeroToTwoPi(a),O=Math.min(_.longitude,T.longitude),R=Math.max(_.longitude,T.longitude),M=D>=O&&D<=R;if(l(c)){let L=Math.abs(_.longitude-T.longitude),g=P.TWO_PI-L;(M?L:g)<(M?g:L)*c&&!M&&(C=!0)}else M||(C=!0)}C?$ct(_,T):Qct(_,T);let A=iX(f,n,_.height,T.height,s),S=K_e(m,o,A,u);function v(){let D=_.longitude,O=T.longitude,R=_.latitude,M=T.latitude;return function(g){let E=g.time/t,w=d.fromRadians(P.lerp(D,O,E),P.lerp(R,M,E),A(E),p);f.setView({destination:w,orientation:{heading:P.lerp(x,i,E),pitch:S(E),roll:P.lerp(b,r,E)}})}}return v()}function nlt(e,t,n,i,o,r,s){let a=e.camera,c=d.clone(a.position,Z_e),u=VI(a.heading,i),f=a.frustum.right-a.frustum.left,h=iX(a,n,f,n.z,s);function p(_){let m=_.time/t;a.setView({orientation:{heading:P.lerp(u,i,m)}}),U.lerp(c,n,m,a.position);let x=h(m),b=a.frustum,T=b.top/b.right,C=(x-(b.right-b.left))*.5;b.right+=C,b.left-=C,b.top=T*b.right,b.bottom=-b.top}return p}var q_e=new fe,ilt=new d;function nX(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Y_e(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}X_e.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ne.MORPHING)return nX();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==ne.SCENE3D&&(s.cartesianToCartographic(n,q_e),n=r.project(q_e,ilt));let p=e.camera,_=t.endTransform;l(_)&&p._setTransform(_);let m=t.duration;l(m)||(m=Math.ceil(d.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let x=y(t.heading,0),b=y(t.pitch,-P.PI_OVER_TWO),T=y(t.roll,0),C=e.screenSpaceCameraController;C.enableInputs=!1;let A=Y_e(C,t.complete),S=Y_e(C,t.cancel),v=p.frustum,D=e.mode===ne.SCENE2D;if(D=D&&U.equalsEpsilon(p.position,n,P.EPSILON6),D=D&&P.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,P.EPSILON6),D=D||e.mode!==ne.SCENE2D&&d.equalsEpsilon(n,p.position,P.EPSILON10),D=D&&P.equalsEpsilon(P.negativePiToPi(x),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(b),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(T),P.negativePiToPi(p.roll),P.EPSILON10),D)return nX(A,S);let O=new Array(4);if(O[ne.SCENE2D]=nlt,O[ne.SCENE3D]=tlt,O[ne.COLUMBUS_VIEW]=Zct,m<=0)return nX(function(){O[i](e,1,n,x,b,T,a,c,u,f)({time:1}),typeof A=="function"&&A()},S);let R=O[i](e,m,n,x,b,T,a,c,u,f);if(!l(h)){let M=p.positionCartographic.height,L=i===ne.SCENE3D?s.cartesianToCartographic(n).height:n.z;M>L&&M>11500?h=$r.CUBIC_OUT:h=$r.QUINTIC_IN_OUT}return{duration:m,easingFunction:h,startObject:{time:0},stopObject:{time:m},update:R,complete:A,cancel:S}};var tz=X_e;var olt={ROTATE:0,INFINITE_SCROLL:1},Iu=Object.freeze(olt);function $t(e){this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.IDENTITY),this._transformChanged=!1,this.position=new d,this._position=new d,this._positionWC=new d,this._positionCartographic=new fe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new d,this._direction=new d,this._directionWC=new d,this.up=new d,this._up=new d,this._upWC=new d,this.right=new d,this._right=new d,this._rightWC=new d,this.frustum=new Ii,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new pe,this._moveEnd=new pe,this._changed=new pe,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new F,this._invViewMatrix=new F,oye(this),this._mode=ne.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new fe(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,gye(this,$t.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=d.magnitude(this.position);n+=n*$t.DEFAULT_VIEW_FACTOR,d.normalize(this.position,this.position),d.multiplyByScalar(this.position,n,this.position)}$t.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);$t.TRANSFORM_2D_INVERSE=F.inverseTransformation($t.TRANSFORM_2D,new F);$t.DEFAULT_VIEW_RECTANGLE=se.fromDegrees(-95,-20,-70,90);$t.DEFAULT_VIEW_FACTOR=.5;$t.DEFAULT_OFFSET=new Kd(0,-P.PI_OVER_FOUR,0);function oye(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function rlt(e){if(!l(e._oldPositionWC))e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=d.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=d.magnitude(t),e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ai()):e.timeSinceMoved=Math.max(Ai()-e._lastMovedTimestamp,0)/1e3}}$t.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ne.SCENE2D};$t.prototype._updateCameraChanged=function(){let e=this;if(rlt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%P.TWO_PI;s=s>P.PI?P.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===ne.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,_=e._changedPosition,m=e.frustum,x=e._changedFrustum,b=p.x+m.left,T=p.x+m.right,C=_.x+x.left,A=_.x+x.right,S=p.y+m.bottom,v=p.y+m.top,D=_.y+x.bottom,O=_.y+x.top,R=Math.max(b,C),M=Math.min(T,A),L=Math.max(S,D),g=Math.min(v,O),E;if(R>=M||L>=v)E=1;else{let w=x;b<C&&T>A&&S<D&&v>O&&(w=m),E=1-(M-R)*(g-L)/((w.right-w.left)*(w.top-w.bottom))}E>t&&(e._changed.raiseEvent(E),e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection);return}let c=P.acosClamped(d.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let h=d.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||h>t)&&(e._changed.raiseEvent(Math.max(u,h)),e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection))};function slt(e){Ot.basisTo2D(e._projection,e._transform,e._actualTransform)}var alt=new fe,clt=new d,nz=new d,llt=new oe,ult=new oe,flt=new oe,dlt=new oe,hlt=new oe;function mlt(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,llt),o=n.cartesianToCartographic(i,alt),r=t.project(o,clt),s=ult;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=oe.clone(oe.UNIT_X,hlt),c=oe.add(F.getColumn(e._transform,0,nz),i,nz);n.cartesianToCartographic(c,o),t.project(o,r);let u=flt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,d.subtract(u,s,u),u.x=0;let f=dlt;if(d.magnitudeSquared(u)>P.EPSILON10)d.cross(a,u,f);else{let h=oe.add(F.getColumn(e._transform,1,nz),i,nz);n.cartesianToCartographic(h,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,d.subtract(f,s,f),f.x=0,d.magnitudeSquared(f)<P.EPSILON10&&(oe.clone(oe.UNIT_Y,u),oe.clone(oe.UNIT_Z,f))}d.cross(f,a,u),d.normalize(u,u),d.cross(a,u,f),d.normalize(f,f),F.setColumn(e._actualTransform,0,u,e._actualTransform),F.setColumn(e._actualTransform,1,f,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var oX=new d;function hc(e){let t=e._mode,n=!1,i=0;t===ne.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!d.equals(o,e.position)||n;r&&(o=d.clone(e.position,e._position));let s=e._direction,a=!d.equals(s,e.direction);a&&(d.normalize(e.direction,e.direction),s=d.clone(e.direction,e._direction));let c=e._up,u=!d.equals(c,e.up);u&&(d.normalize(e.up,e.up),c=d.clone(e.up,e._up));let f=e._right,h=!d.equals(f,e.right);h&&(d.normalize(e.right,e.right),f=d.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone($t.TRANSFORM_2D,e._actualTransform):e._mode===ne.COLUMBUS_VIEW?slt(e):mlt(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let _=e._actualTransform;if(r||p)if(e._positionWC=F.multiplyByPoint(_,o,e._positionWC),t===ne.SCENE3D||t===ne.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=oX;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===ne.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||h){let m=d.dot(s,d.cross(c,f,oX));if(Math.abs(1-m)>P.EPSILON2){let x=1/d.magnitudeSquared(c),b=d.dot(c,s)*x,T=d.multiplyByScalar(s,b,oX);c=d.normalize(d.subtract(c,T,e._up),e._up),d.clone(c,e.up),f=d.cross(s,c,e._right),d.clone(f,e.right)}}(a||p)&&(e._directionWC=F.multiplyByPointAsVector(_,s,e._directionWC),d.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=F.multiplyByPointAsVector(_,c,e._upWC),d.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=F.multiplyByPointAsVector(_,f,e._rightWC),d.normalize(e._rightWC,e._rightWC)),(r||a||u||h||p)&&oye(e)}function rye(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function sye(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function aye(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var rz=new F,sz=new F;Object.defineProperties($t.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return hc(this),this._invTransform}},viewMatrix:{get:function(){return hc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return hc(this),this._invViewMatrix}},positionCartographic:{get:function(){return hc(this),this._positionCartographic}},positionWC:{get:function(){return hc(this),this._positionWC}},directionWC:{get:function(){return hc(this),this._directionWC}},upWC:{get:function(){return hc(this),this._upWC}},rightWC:{get:function(){return hc(this),this._rightWC}},heading:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,rz),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,sz);this._setTransform(n);let i=rye(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,rz),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,sz);this._setTransform(n);let i=sye(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ne.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,rz),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,sz);this._setTransform(n);let i=aye(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});$t.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ne.MORPHING,t=this._mode===ne.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===ne.SCENE2D&&fye(this,this.position)};var plt=new d,glt=new d,_lt=new d;$t.prototype._setTransform=function(e){let t=d.clone(this.positionWC,plt),n=d.clone(this.upWC,glt),i=d.clone(this.directionWC,_lt);F.clone(e,this._transform),this._transformChanged=!0,hc(this);let o=this._actualInvTransform;F.multiplyByPoint(o,t,this.position),F.multiplyByPointAsVector(o,i,this.direction),F.multiplyByPointAsVector(o,n,this.up),d.cross(this.direction,this.up,this.right),hc(this)};var ylt=new U,xlt=new pn,blt=new d,Tlt=new d;function cye(e){if(!F.equals(F.IDENTITY,e.transform))return d.magnitude(e.position);let t=e._scene,n=t.globe,i=ylt;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,xlt);o=n.pickWorldCoordinates(a,t,!0,blt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,Tlt));let s;if(l(o)||l(r)){let a=l(r)?d.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?d.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}$t.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof nn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=cye(this)))};var az=new d,lX=new F,Clt=new F,uX=new Oe,fX=new $,lye=new fe;function Alt(e,t,n){let i=F.clone(e.transform,lX),o=Ot.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Clt);e._setTransform(o),d.clone(d.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let r=Oe.fromHeadingPitchRoll(n,uX),s=$.fromQuaternion(r,fX);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Elt(e,t,n,i){let o=F.clone(e.transform,lX);if(e._setTransform(F.IDENTITY),!d.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,lye);t=a.project(c,az)}d.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let r=Oe.fromHeadingPitchRoll(n,uX),s=$.fromQuaternion(r,fX);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Slt(e,t,n,i){let o=F.clone(e.transform,lX);if(e._setTransform(F.IDENTITY),!d.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,lye);t=c.project(u,az)}U.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Iu.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let r=Oe.fromHeadingPitchRoll(n,uX),s=$.fromQuaternion(r,fX);$.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right)}e._setTransform(o)}var vlt=new d,wlt=new d,Dlt=new d;function uye(e,t,n,i){let o=d.clone(n.direction,vlt),r=d.clone(n.up,wlt);if(e._scene.mode===ne.SCENE3D){let a=e._projection.ellipsoid,c=Ot.eastNorthUpToFixedFrame(t,a,rz),u=F.inverseTransformation(c,sz);F.multiplyByPointAsVector(u,o,o),F.multiplyByPointAsVector(u,r,r)}let s=d.cross(o,r,Dlt);return i.heading=rye(o,r),i.pitch=sye(o),i.roll=aye(o,r,s),i}var cX={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},NE=new Ga;$t.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===ne.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,d.clone(this.positionWC,az));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,az),i=!1),l(t.direction)&&(t=uye(this,o,t,cX.orientation)),NE.heading=y(t.heading,0),NE.pitch=y(t.pitch,-P.PI_OVER_TWO),NE.roll=y(t.roll,0),n===ne.SCENE3D?Alt(this,o,NE):n===ne.SCENE2D?Slt(this,o,NE,i):Elt(this,o,NE,i)};var Ilt=new d;$t.prototype.flyHome=function(e){let t=this._mode;if(t===ne.MORPHING&&this._scene.completeMorph(),t===ne.SCENE2D)this.flyTo({destination:$t.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===ne.SCENE3D){let n=this.getRectangleCameraCoordinates($t.DEFAULT_VIEW_RECTANGLE),i=d.magnitude(n);i+=i*$t.DEFAULT_VIEW_FACTOR,d.normalize(n,n),d.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===ne.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new d(0,-1,1);i=d.multiplyByScalar(d.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(d.normalize(i,Ilt).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};$t.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new oe),hc(this),F.multiplyByVector(this._actualInvTransform,e,t)};$t.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new d),hc(this),F.multiplyByPoint(this._actualInvTransform,e,t)};$t.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new d),hc(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};$t.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new oe),hc(this),F.multiplyByVector(this._actualTransform,e,t)};$t.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new d),hc(this),F.multiplyByPoint(this._actualTransform,e,t)};$t.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new d),hc(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function fye(e,t){let n=e._scene.mapMode2D===Iu.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var $_e=new d;$t.prototype.move=function(e,t){let n=this.position;d.multiplyByScalar(e,t,$_e),d.add(n,$_e,n),this._mode===ne.SCENE2D&&fye(this,n),this._adjustOrthographicFrustum(!0)};$t.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?cz(this,e):this.move(this.direction,e)};$t.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===ne.SCENE2D?cz(this,-e):this.move(this.direction,-e)};$t.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};$t.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};$t.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};$t.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};$t.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,-e)};$t.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.up,e)};$t.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,-e)};$t.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==ne.SCENE2D&&this.look(this.right,e)};var Plt=new Oe,Rlt=new $;$t.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=Oe.fromAxisAngle(e,-n,Plt),o=$.fromQuaternion(i,Rlt),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};$t.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};$t.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Olt=new Oe,Mlt=new $;$t.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=Oe.fromAxisAngle(e,-n,Olt),o=$.fromQuaternion(i,Mlt);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),d.cross(this.direction,this.up,this.right),d.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};$t.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),dye(this,e)};$t.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),dye(this,-e)};var Llt=new d,Nlt=new d,Flt=new d,Q_e=new d;function dye(e,t){let n=e.position;if(l(e.constrainedAxis)&&!d.equalsEpsilon(e.position,d.ZERO,P.EPSILON2)){let i=d.normalize(n,Llt),o=d.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),r=d.equalsEpsilon(i,d.negate(e.constrainedAxis,Q_e),P.EPSILON2);if(!o&&!r){let s=d.normalize(e.constrainedAxis,Nlt),a=d.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=d.dot(i,d.negate(s,Q_e)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=d.cross(s,i,Flt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}$t.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),hye(this,-e)};$t.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),hye(this,e)};function hye(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function cz(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Iu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Iu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function mye(e,t){e.move(e.direction,t)}$t.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?cz(this,e):mye(this,e)};$t.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===ne.SCENE2D?cz(this,-e):mye(this,-e)};$t.prototype.getMagnitude=function(){if(this._mode===ne.SCENE3D)return d.magnitude(this.position);if(this._mode===ne.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ne.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Blt=new F;$t.prototype.lookAt=function(e,t){let n=this._scene,i=y(n.ellipsoid,ee.default),o=Ot.eastNorthUpToFixedFrame(e,i,Blt);this.lookAtTransform(o,t)};var klt=new d,Vlt=new Oe,Ult=new Oe,zlt=new $;function pye(e,t,n){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let i=Oe.fromAxisAngle(d.UNIT_Y,-t,Vlt),o=Oe.fromAxisAngle(d.UNIT_Z,-e,Ult),r=Oe.multiply(o,i,o),s=$.fromQuaternion(r,zlt),a=d.clone(d.UNIT_X,klt);return $.multiplyByVector(s,a,a),d.negate(a,a),d.multiplyByScalar(a,n,a),a}$t.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=pye(t.heading,t.pitch,t.range):n=t,this._mode===ne.SCENE2D){U.clone(U.ZERO,this.position),d.negate(n,this.up),this.up.z=0,d.magnitudeSquared(this.up)<P.EPSILON10&&d.clone(d.UNIT_Y,this.up),d.normalize(this.up,this.up),this._setTransform(F.IDENTITY),d.negate(d.UNIT_Z,this.direction),d.cross(this.direction,this.up,this.right),d.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=d.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}d.clone(n,this.position),d.negate(this.position,this.direction),d.normalize(this.direction,this.direction),d.cross(this.direction,d.UNIT_Z,this.right),d.magnitudeSquared(this.right)<P.EPSILON10&&d.clone(d.UNIT_X,this.right),d.normalize(this.right,this.right),d.cross(this.right,this.direction,this.up),d.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var UI=new fe,Hlt=new fe,Glt=new d,Wlt=new d,jlt=new d,qlt=new d,Ylt=new d,Xlt=new d,Klt=new d,rX=new d,Zlt={direction:new d,right:new d,up:new d},J_e;function dc(e,t,n,i){return Math.abs(d.dot(t,n))/i-d.dot(e,n)}function gye(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Zlt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=P.TWO_PI);let f=(c+u)*.5,h;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)h=0;else{let M=UI;M.longitude=f,M.latitude=s,M.height=0;let L=Hlt;L.longitude=f,L.latitude=a,L.height=0;let g=J_e;(!l(g)||g.ellipsoid!==o)&&(J_e=g=new Kg(void 0,void 0,o)),g.setEndPoints(M,L),h=g.interpolateUsingFraction(.5,UI).latitude}let p=UI;p.longitude=f,p.latitude=h,p.height=0;let _=o.cartographicToCartesian(p,Klt),m=UI;m.longitude=u,m.latitude=s;let x=o.cartographicToCartesian(m,Glt);m.longitude=c;let b=o.cartographicToCartesian(m,jlt);m.longitude=f;let T=o.cartographicToCartesian(m,Ylt);m.latitude=a;let C=o.cartographicToCartesian(m,Xlt);m.longitude=u;let A=o.cartographicToCartesian(m,qlt);m.longitude=c;let S=o.cartographicToCartesian(m,Wlt);d.subtract(b,_,b),d.subtract(A,_,A),d.subtract(x,_,x),d.subtract(S,_,S),d.subtract(T,_,T),d.subtract(C,_,C);let v=o.geodeticSurfaceNormal(_,r.direction);d.negate(v,v);let D=d.cross(v,d.UNIT_Z,r.right);d.normalize(D,D);let O=d.cross(D,v,r.up),R;if(e.frustum instanceof nn){let M=Math.max(d.distance(x,b),d.distance(A,S)),L=Math.max(d.distance(x,A),d.distance(b,S)),g,E,w=e.frustum._offCenterFrustum,I=w.right/w.top,N=L*I;M>N?(g=M,E=g/I):(E=L,g=N),R=Math.max(g,E)}else{let M=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*M;if(R=Math.max(dc(v,O,b,M),dc(v,O,A,M),dc(v,O,x,M),dc(v,O,S,M),dc(v,O,T,M),dc(v,O,C,M),dc(v,D,b,L),dc(v,D,A,L),dc(v,D,x,L),dc(v,D,S,L),dc(v,D,T,L),dc(v,D,C,L)),a<0&&s>0){let g=UI;g.longitude=c,g.latitude=0,g.height=0;let E=o.cartographicToCartesian(g,rX);d.subtract(E,_,E),R=Math.max(R,dc(v,O,E,M),dc(v,D,E,L)),g.longitude=u,E=o.cartographicToCartesian(g,rX),d.subtract(E,_,E),R=Math.max(R,dc(v,O,E,M),dc(v,D,E,L))}}return d.add(_,d.multiplyByScalar(v,-R,rX),n)}var $lt=new fe,Qlt=new d,Jlt=new d;function eut(e,t,n){let i=e._projection;t.west>t.east&&(t=se.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=$lt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Qlt);F.multiplyByPoint(o,a,a),F.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Jlt);if(F.multiplyByPoint(o,c,c),F.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var tut=new fe,nut=new d,iut=new d;function out(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Iu.INFINITE_SCROLL?o+=P.TWO_PI:(t=se.MAX_VALUE,o=t.east));let r=tut;r.longitude=o,r.latitude=t.north;let s=i.project(r,nut);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,iut),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,h,p=e.frustum.right/e.frustum.top,_=u*p;return c>_?(f=c,h=f/p):(h=u,f=_),u=Math.max(2*f,2*h),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}$t.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new d),n===ne.SCENE3D)return gye(this,e,t);if(n===ne.COLUMBUS_VIEW)return eut(this,e,t);if(n===ne.SCENE2D)return out(this,e,t)};var rut=new pn;function sut(e,t,n,i){n=y(n,ee.default);let o=e.getPickRay(t,rut),r=Qn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return pn.getPoint(o,s,i)}var aut=new pn;function cut(e,t,n,i){let r=e.getPickRay(t,aut).origin;r=d.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var lut=new pn;function uut(e,t,n,i){let o=e.getPickRay(t,lut),r=-o.origin.x/o.direction.x;pn.getPoint(o,r,i);let s=n.unproject(new d(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}$t.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new d),t=y(t,ee.default),this._mode===ne.SCENE3D)n=sut(this,e,t,n);else if(this._mode===ne.SCENE2D)n=cut(this,e,this._projection,n);else if(this._mode===ne.COLUMBUS_VIEW)n=uut(this,e,this._projection,n);else return;return n}};var fut=new d,dut=new d,hut=new d;function mut(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,h=e.positionWC;d.clone(h,n.origin);let p=d.multiplyByScalar(e.directionWC,c,fut);d.add(h,p,p);let _=d.multiplyByScalar(e.rightWC,u*c*a,dut),m=d.multiplyByScalar(e.upWC,f*c*s,hut),x=d.add(p,_,n.direction);return d.add(x,m,x),d.subtract(x,h,x),d.normalize(x,x),n}var iz=new d;function put(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return d.clone(e.position,f),d.multiplyByScalar(e.right,c,iz),d.add(iz,f,f),d.multiplyByScalar(e.up,u,iz),d.add(iz,f,f),d.clone(e.directionWC,n.direction),(e._mode===ne.COLUMBUS_VIEW||e._mode===ne.SCENE2D)&&d.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}$t.prototype.getPickRay=function(e,t){l(t)||(t=new pn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?mut(this,e,t):put(this,e,t)};var gut=new d,_ut=new d;$t.prototype.distanceToBoundingSphere=function(e){let t=d.subtract(this.positionWC,e.center,gut),n=d.multiplyByScalar(this.directionWC,d.dot(t,this.directionWC),_ut);return Math.max(0,d.magnitude(n)-e.radius)};var yut=new U;$t.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,yut);return Math.max(o.x,o.y)};function xut(e,t,n,i,o,r){let s=d.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let u=d.lerp(t,s,c.time,new d);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:$r.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var but=new d,eye=new d,Tut=new d,Cut=new d;function Aut(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(d.UNIT_X,but),r=-d.dot(o,n)/d.dot(o,i),s=d.add(n,d.multiplyByScalar(i,r,eye),eye);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Tut);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=d.magnitude(d.subtract(n,s,Cut)),f=c*u,h=a*u,p=e._maxCoord.x,_=e._maxCoord.y,m=Math.max(f-p,p),x=Math.max(h-_,_);if(n.z<-m||n.z>m||n.y<-x||n.y>x){let b=s.y<-m||s.y>m,T=s.z<-x||s.z>x;if(b||T)return xut(e,n,s,m,x,t)}}$t.prototype.createCorrectPositionTween=function(e){if(this._mode===ne.COLUMBUS_VIEW)return Aut(this,e)};var Eut=new d,Ws={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};$t.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};$t.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Ws.destination,e.orientation.heading=Ws.heading,e.orientation.pitch=Ws.pitch,e.orientation.roll=Ws.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};$t.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===ne.MORPHING)return;this.cancelFlight();let i=t instanceof se;i&&(t=this.getRectangleCameraCoordinates(t,Eut));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=uye(this,t,o,cX.orientation)),l(e.duration)&&e.duration<=0){let f=cX;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;Ws.destination=t,Ws.heading=o.heading,Ws.pitch=o.pitch,Ws.roll=o.roll,Ws.duration=e.duration,Ws.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Ws.cancel=e.cancel,Ws.endTransform=e.endTransform,Ws.convert=i?!1:e.convert,Ws.maximumHeight=e.maximumHeight,Ws.pitchAdjustHeight=e.pitchAdjustHeight,Ws.flyOverLongitude=e.flyOverLongitude,Ws.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ws.easingFunction=e.easingFunction;let a=this._scene,c=tz.createTween(a,Ws);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==ne.SCENE2D&&(l(u)||(u=$t.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Sut(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function vut(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var wut=100;function _ye(e,t,n){n=Kd.clone(l(n)?n:$t.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=wut:e.frustum instanceof nn||e._mode===ne.SCENE2D?n.range=vut(e,s):n.range=Sut(e,s),n.range=P.clamp(n.range,i,o)}return n}$t.prototype.viewBoundingSphere=function(e,t){t=_ye(this,e,t),this.lookAt(e.center,t)};var Dut=new F,Iut=new d,Put=new d,Rut=new d,Out=new d,Mut=new oe,Lut=new Oe,Nut=new $;$t.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===ne.SCENE2D||this._mode===ne.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=_ye(this,e,t.offset),o;n?o=d.multiplyByScalar(d.UNIT_Z,i.range,Iut):o=pye(i.heading,i.pitch,i.range);let r=this._scene,s=y(r.ellipsoid,ee.default),a=Ot.eastNorthUpToFixedFrame(e.center,s,Dut);F.multiplyByPoint(a,o,o);let c,u;if(!n){if(c=d.subtract(e.center,o,Put),d.normalize(c,c),u=F.multiplyByPointAsVector(a,d.UNIT_Z,Rut),1-Math.abs(d.dot(c,u))<P.EPSILON6){let h=Oe.fromAxisAngle(c,i.heading,Lut),p=$.fromQuaternion(h,Nut);d.fromCartesian4(F.getColumn(a,1,Mut),u),$.multiplyByVector(p,u,u)}let f=d.cross(c,u,Out);d.cross(f,c,u),d.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var tye=new d,nye=new d,sX=new d,iye=new d,zI=[new d,new d,new d,new d];function Fut(e,t){let n=t.radii,i=e.positionWC,o=d.multiplyComponents(t.oneOverRadii,i,tye),r=d.magnitude(o),s=d.normalize(o,nye),a,c;d.equalsEpsilon(s,d.UNIT_Z,P.EPSILON10)?(a=new d(0,1,0),c=new d(0,0,1)):(a=d.normalize(d.cross(d.UNIT_Z,s,sX),sX),c=d.normalize(d.cross(s,a,iye),iye));let u=Math.sqrt(d.magnitudeSquared(o)-1),f=d.multiplyByScalar(s,1/r,tye),h=u/r,p=d.multiplyByScalar(a,h,nye),_=d.multiplyByScalar(c,h,sX),m=d.add(f,_,zI[0]);d.subtract(m,p,m),d.multiplyComponents(n,m,m);let x=d.subtract(f,_,zI[1]);d.subtract(x,p,x),d.multiplyComponents(n,x,x);let b=d.subtract(f,_,zI[2]);d.add(b,p,b),d.multiplyComponents(n,b,b);let T=d.add(f,_,zI[3]);return d.add(T,p,T),d.multiplyComponents(n,T,T),zI}var aX=new U,But=new d,Xy=[new fe,new fe,new fe,new fe];function oz(e,t,n,i,o,r){aX.x=e,aX.y=t;let s=i.pickEllipsoid(aX,o,But);return l(s)?(Xy[n]=o.cartesianToCartographic(s,Xy[n]),1):(Xy[n]=o.cartesianToCartographic(r[n],Xy[n]),0)}$t.prototype.computeViewRectangle=function(e,t){e=y(e,ee.default);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ae(d.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Wt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,u=Fut(this,e);if(c+=oz(0,0,0,this,e,u),c+=oz(0,a,1,this,e,u),c+=oz(s,a,2,this,e,u),c+=oz(s,0,3,this,e,u),c<2)return se.MAX_VALUE;t=se.fromCartographicArray(Xy,t);let f=0,h=Xy[3].longitude;for(let p=0;p<4;++p){let _=Xy[p].longitude,m=Math.abs(_-h);m>P.PI?f+=P.TWO_PI-m:f+=m,h=_}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,Xy[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};$t.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof Ii)return;let e=this._scene;this.frustum=new Ii,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};$t.prototype.switchToOrthographicFrustum=function(){if(this._mode===ne.SCENE2D||this.frustum instanceof nn)return;let e=cye(this),t=this._scene;this.frustum=new nn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};$t.clone=function(e,t){return l(t)||(t=new $t(e._scene)),d.clone(e.position,t.position),d.clone(e.direction,t.direction),d.clone(e.up,t.up),d.clone(e.right,t.right),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var so=$t;function kut(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var ch=kut;var Cye=Ur(Wl(),1),yye=576,Vut=100,HI="#ffffff",lz="#48b";function Aye(e,t){this.credit=e,this.count=y(t,1)}function Uut(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Ct.equals(o,t))return!0}return!1}function zut(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Ct.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Eye="cesium-credit-delimiter";function xye(e){let t=document.createElement("span");return t.textContent=e,t.className=Eye,t}function bye(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Tye(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(xye(n));else{let f=o[u];f.className!==Eye&&e.replaceChild(xye(n),f)}}let c=a.element;if(o.length<=r)e.appendChild(bye(c,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(bye(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Hut(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<yye?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=yye&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Gut(e){let t=` .cesium-credit-lightbox-overlay { display: none; z-index: 1; @@ -12546,19 +11036,19 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, .cesium-credit-lightbox { background-color: #303336; - color: ${UI}; + color: ${HI}; position: relative; - min-height: ${Nut}px; + min-height: ${Vut}px; margin: auto; } .cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited, .cesium-credit-wrapper a, .cesium-credit-wrapper a:visited { - color: ${UI}; + color: ${HI}; } .cesium-credit-lightbox > ul > li a:hover { - color: ${Sz}; + color: ${lz}; } .cesium-credit-lightbox.cesium-credit-lightbox-expanded { border: 1px solid #444; @@ -12578,10 +11068,10 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, position: absolute; top: 0; right: 6px; - color: ${UI}; + color: ${HI}; } .cesium-credit-lightbox-close:hover { - color: ${Sz}; + color: ${lz}; } .cesium-credit-lightbox > ul { margin: 0; @@ -12600,14 +11090,14 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, padding-left: 5px; cursor: pointer; text-decoration: underline; - color: ${UI}; + color: ${HI}; } .cesium-credit-expand-link:hover { - color: ${Sz}; + color: ${lz}; } .cesium-credit-text { - color: ${UI}; + color: ${HI}; } .cesium-credit-delimiter { @@ -12620,13 +11110,60 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, } .cesium-credit-textContainer a:hover { - color: ${Sz} + color: ${lz} } .cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { padding-left: 5px; } -`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function cr(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(m){r.contains(m.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Vut(e);let _=At.clone(cr.cesiumCredit);this._delimiter=y(t,"\u2022"),this._screenContainer=h,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=_,this._previousCesiumCredit=void 0,this._currentCesiumCredit=_,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new vt,lightboxCredits:new vt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function Aye(e,t,n,i){i=y(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Tye(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}cr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=At.clone(Eye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,Aye(this,t,e)};cr.prototype.addStaticCredit=function(e){let t=this._staticCredits;Fut(t,e)||t.push(e)};cr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};cr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};cr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};cr.prototype.update=function(){this._expanded&&kut(this)};cr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&At.equals(cr.cesiumCredit,this._cesiumCredit)||Aye(this,s,r,Number.MAX_VALUE)}At.equals(cr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=At.clone(cr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};cr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;xye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",xye(this._creditList,t,void 0,"li"),But(this)};cr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};cr.prototype.isDestroyed=function(){return!1};cr._cesiumCredit=void 0;cr._cesiumCreditInitialized=!1;var vz;function Eye(){if(!l(vz)){let e=nn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new bye.default(e).path()),vz=new At(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return cr._cesiumCreditInitialized||(cr._cesiumCredit=vz,cr._cesiumCreditInitialized=!0),vz}Object.defineProperties(cr,{cesiumCredit:{get:function(){return Eye(),cr._cesiumCredit},set:function(e){cr._cesiumCredit=e,cr._cesiumCreditInitialized=!0}}});cr.CreditDisplayElement=Tye;var wz=cr;var Dz=0,Uut=1;function hb(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e._drawNearPlane,!0),s,a;t instanceof Di?(s=Dz,a=Di.packedLength):t instanceof rn&&(s=Uut,a=rn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Oe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+d.packedLength+Oe.packedLength+Ie.packedLength}hb.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Dz?(Di.pack(o,t,n),n+=Di.packedLength):(rn.pack(o,t,n),n+=rn.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Oe.pack(e._orientation,t,n),n+=Oe.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._drawNearPlane?1:0,t};var zut=new Di,Hut=new rn,Gut=new Oe,Wut=new d,jut=new Ie;hb.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===Dz?(o=Di.unpack(e,t,zut),t+=Di.packedLength):(o=rn.unpack(e,t,Hut),t+=rn.packedLength);let r=d.unpack(e,t,Wut);t+=d.packedLength;let s=Oe.unpack(e,t,Gut);t+=Oe.packedLength;let a=Ie.unpack(e,t,jut);t+=Ie.packedLength;let c=e[t]===1;if(!l(n))return new hb({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Oe.clone(s,n._orientation),n._vertexFormat=Ie.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function ME(e,t,n,i,o,r,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var qut=new $,Yut=new F,fX=new F,Sye=new d,vye=new d,wye=new d,Xut=new d,Kut=new d,Zut=new d,Ky=new Array(3),zI=new Array(4);zI[0]=new oe(-1,-1,1,1);zI[1]=new oe(1,-1,1,1);zI[2]=new oe(1,1,1,1);zI[3]=new oe(-1,1,1,1);var Dye=new Array(4);for(let e=0;e<4;++e)Dye[e]=new oe;hb._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,qut),u=y(r,Sye),f=y(s,vye),h=y(a,wye);u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),h=$.getColumn(c,2,h),d.normalize(u,u),d.normalize(f,f),d.normalize(h,h),d.negate(u,u);let p=F.computeView(e,h,f,u,Yut),_,m,x=i.projectionMatrix;if(n===Dz){let b=F.multiply(x,p,fX);m=F.inverse(b,fX)}else _=F.inverseTransformation(p,fX);l(m)?(Ky[0]=i.near,Ky[1]=i.far):(Ky[0]=0,Ky[1]=i.near,Ky[2]=i.far);for(let b=0;b<2;++b)for(let T=0;T<4;++T){let C=oe.clone(zI[T],Dye[T]);if(l(m)){C=F.multiplyByVector(m,C,C);let A=1/C.w;d.multiplyByScalar(C,A,C),d.subtract(C,e,C),d.normalize(C,C);let S=d.dot(h,C);d.multiplyByScalar(C,Ky[b]/S,C),d.add(C,e,C)}else{let A=i.offCenterFrustum;l(A)&&(i=A);let S=Ky[b],v=Ky[b+1];C.x=(C.x*(i.right-i.left)+i.left+i.right)*.5,C.y=(C.y*(i.top-i.bottom)+i.bottom+i.top)*.5,C.z=(C.z*(S-v)-S-v)*.5,C.w=1,F.multiplyByVector(_,C,C)}o[12*b+T*3]=C.x,o[12*b+T*3+1]=C.y,o[12*b+T*3+2]=C.z}};hb.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);hb._computeNearFarPlanes(i,o,t,n,c);let u=3*4*2;c[u]=c[3*4],c[u+1]=c[3*4+1],c[u+2]=c[3*4+2],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[3*3],c[u+7]=c[3*3+1],c[u+8]=c[3*3+2],c[u+9]=c[3*7],c[u+10]=c[3*7+1],c[u+11]=c[3*7+2],u+=3*4,c[u]=c[3*5],c[u+1]=c[3*5+1],c[u+2]=c[3*5+2],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[3*4],c[u+10]=c[3*4+1],c[u+11]=c[3*4+2],u+=3*4,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[3*5],c[u+4]=c[3*5+1],c[u+5]=c[3*5+2],c[u+6]=c[3*6],c[u+7]=c[3*6+1],c[u+8]=c[3*6+2],c[u+9]=c[3*2],c[u+10]=c[3*2+1],c[u+11]=c[3*2+2],u+=3*4,c[u]=c[3*2],c[u+1]=c[3*2+1],c[u+2]=c[3*2+2],c[u+3]=c[3*6],c[u+4]=c[3*6+1],c[u+5]=c[3*6+2],c[u+6]=c[3*7],c[u+7]=c[3*7+1],c[u+8]=c[3*7+2],c[u+9]=c[3*3],c[u+10]=c[3*3+1],c[u+11]=c[3*3+2],r||(c=c.subarray(3*4));let f=new hn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,_=l(s.tangent)?new Float32Array(3*4*a):void 0,m=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,b=Sye,T=vye,C=wye,A=d.negate(b,Xut),S=d.negate(T,Kut),v=d.negate(C,Zut);u=0,r&&(ME(u,p,_,m,x,v,b,T),u+=3*4),ME(u,p,_,m,x,C,A,T),u+=3*4,ME(u,p,_,m,x,A,v,T),u+=3*4,ME(u,p,_,m,x,S,v,A),u+=3*4,ME(u,p,_,m,x,b,C,T),u+=3*4,ME(u,p,_,m,x,T,C,A),l(p)&&(f.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),l(_)&&(f.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_})),l(m)&&(f.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),l(x)&&(f.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:x}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let _=p*6,m=p*4;h[_]=m,h[_+1]=m+1,h[_+2]=m+2,h[_+3]=m,h[_+4]=m+2,h[_+5]=m+3}return new at({attributes:f,indices:h,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromVertices(c)})};var LE=hb;var dX=0,$ut=1;function HI(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e._drawNearPlane,!0),r,s;t instanceof Di?(r=dX,s=Di.packedLength):t instanceof rn&&(r=$ut,s=rn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Oe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+d.packedLength+Oe.packedLength}HI.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===dX?(Di.pack(o,t,n),n+=Di.packedLength):(rn.pack(o,t,n),n+=rn.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Oe.pack(e._orientation,t,n),n+=Oe.packedLength,t[n]=e._drawNearPlane?1:0,t};var Qut=new Di,Jut=new rn,eft=new Oe,tft=new d;HI.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===dX?(o=Di.unpack(e,t,Qut),t+=Di.packedLength):(o=rn.unpack(e,t,Jut),t+=rn.packedLength);let r=d.unpack(e,t,tft);t+=d.packedLength;let s=Oe.unpack(e,t,eft);t+=Oe.packedLength;let a=e[t]===1;if(!l(n))return new HI({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Oe.clone(s,n._orientation),n._drawNearPlane=a,n};HI.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);LE._computeNearFarPlanes(i,o,t,n,s);let a=new hn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=r?2:1,h=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,u=p*4,h[c]=u,h[c+1]=u+1,h[c+2]=u+1,h[c+3]=u+2,h[c+4]=u+2,h[c+5]=u+3,h[c+6]=u+3,h[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,h[c]=u,h[c+1]=u+4,h[c+2]=u+1,h[c+3]=u+5,h[c+4]=u+2,h[c+5]=u+6,h[c+6]=u+3,h[c+7]=u+7;return new at({attributes:a,indices:h,primitiveType:Me.LINES,boundingSphere:ae.fromVertices(s)})};var Iz=HI;function Pz(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,z.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var nft=new d,ift=new $,oft=new Oe,rft=new Di,sft=new Fl,aft=new rn,cft=new Hr,lft=new z,uft=[1,1e5];Pz.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Di?a=rft:s instanceof Fl?a=sft:s instanceof rn?a=aft:a=cft,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=uft,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,h=r.directionWC,p=r.upWC,_=r.rightWC;_=d.negate(_,nft);let m=ift;$.setColumn(m,0,_,m),$.setColumn(m,1,p,m),$.setColumn(m,2,h,m);let x=Oe.fromRotationMatrix(m,oft);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new In({geometryInstances:new wt({geometry:new LE({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Wt.fromColor(z.fromAlpha(this._color,.1,lft))},id:this.id,pickPrimitive:this}),appearance:new cn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new wt({geometry:new Iz({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Wt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};Pz.prototype.isDestroyed=function(){return!1};Pz.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var mg=Pz;function WI(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var GI=Ht.supportsTypedArrays()?new Float32Array(12):[],Iye=new d,Pye=new d,hX=new d,Rye=new d,Rz=new d;function fft(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof rn)o=d.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=d.multiplyComponents(e.oneOverRadii,h,Iye),_=d.normalize(p,Pye),m=d.normalize(d.cross(d.UNIT_Z,p,hX),hX),x=d.normalize(d.cross(_,m,Rye),Rye),b=d.magnitude(p),T=Math.sqrt(b*b-1);o=d.multiplyByScalar(_,1/b,Iye);let C=T/b;r=d.multiplyByScalar(m,C,Pye),s=d.multiplyByScalar(x,C,hX)}let a=d.add(o,s,Rz);d.subtract(a,r,a),d.multiplyComponents(n,a,a),d.pack(a,GI,0);let c=d.subtract(o,s,Rz);d.subtract(c,r,c),d.multiplyComponents(n,c,c),d.pack(c,GI,3);let u=d.add(o,s,Rz);d.add(u,r,u),d.multiplyComponents(n,u,u),d.pack(u,GI,6);let f=d.subtract(o,s,Rz);return d.add(f,r,f),d.multiplyComponents(n,f,f),d.pack(f,GI,9),GI}WI.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ee(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new $e({renderState:this._rs,boundingVolume:new ae(d.ZERO,i.maximumRadius),pass:we.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Ue({sources:[iL]}),a=new Ue({sources:[nL]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=en.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=fft(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new at({attributes:{position:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Me.TRIANGLES});this._va=ti.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Fe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};WI.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};WI.prototype.isDestroyed=function(){return!1};WI.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Oz=WI;function FE(){}var dft=/\bgl_FragDepth\b/,hft=/\bdiscard\b/;function mft(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(dft.test(r[a])||hft.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() +`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function cr(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(m){r.contains(m.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Gut(e);let _=Ct.clone(cr.cesiumCredit);this._delimiter=y(t,"\u2022"),this._screenContainer=h,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=_,this._previousCesiumCredit=void 0,this._currentCesiumCredit=_,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new St,lightboxCredits:new St},this._defaultCredit=void 0,this.viewport=n,this.container=e}function Sye(e,t,n,i){i=y(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Aye(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}cr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Ct.clone(vye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,Sye(this,t,e)};cr.prototype.addStaticCredit=function(e){let t=this._staticCredits;Uut(t,e)||t.push(e)};cr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};cr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};cr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};cr.prototype.update=function(){this._expanded&&Hut(this)};cr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Ct.equals(cr.cesiumCredit,this._cesiumCredit)||Sye(this,s,r,Number.MAX_VALUE)}Ct.equals(cr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Ct.clone(cr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};cr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Tye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Tye(this._creditList,t,void 0,"li"),zut(this)};cr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};cr.prototype.isDestroyed=function(){return!1};cr._cesiumCredit=void 0;cr._cesiumCreditInitialized=!1;var uz;function vye(){if(!l(uz)){let e=en("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Cye.default(e).path()),uz=new Ct(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return cr._cesiumCreditInitialized||(cr._cesiumCredit=uz,cr._cesiumCreditInitialized=!0),uz}Object.defineProperties(cr,{cesiumCredit:{get:function(){return vye(),cr._cesiumCredit},set:function(e){cr._cesiumCredit=e,cr._cesiumCreditInitialized=!0}}});cr.CreditDisplayElement=Aye;var fz=cr;var dz=0,Wut=1;function hb(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e.vertexFormat,Ie.DEFAULT),r=y(e._drawNearPlane,!0),s,a;t instanceof Ii?(s=dz,a=Ii.packedLength):t instanceof nn&&(s=Wut,a=nn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Oe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+d.packedLength+Oe.packedLength+Ie.packedLength}hb.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===dz?(Ii.pack(o,t,n),n+=Ii.packedLength):(nn.pack(o,t,n),n+=nn.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Oe.pack(e._orientation,t,n),n+=Oe.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._drawNearPlane?1:0,t};var jut=new Ii,qut=new nn,Yut=new Oe,Xut=new d,Kut=new Ie;hb.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===dz?(o=Ii.unpack(e,t,jut),t+=Ii.packedLength):(o=nn.unpack(e,t,qut),t+=nn.packedLength);let r=d.unpack(e,t,Xut);t+=d.packedLength;let s=Oe.unpack(e,t,Yut);t+=Oe.packedLength;let a=Ie.unpack(e,t,Kut);t+=Ie.packedLength;let c=e[t]===1;if(!l(n))return new hb({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Oe.clone(s,n._orientation),n._vertexFormat=Ie.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function FE(e,t,n,i,o,r,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var Zut=new $,$ut=new F,dX=new F,wye=new d,Dye=new d,Iye=new d,Qut=new d,Jut=new d,eft=new d,Ky=new Array(3),GI=new Array(4);GI[0]=new oe(-1,-1,1,1);GI[1]=new oe(1,-1,1,1);GI[2]=new oe(1,1,1,1);GI[3]=new oe(-1,1,1,1);var Pye=new Array(4);for(let e=0;e<4;++e)Pye[e]=new oe;hb._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,Zut),u=y(r,wye),f=y(s,Dye),h=y(a,Iye);u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),h=$.getColumn(c,2,h),d.normalize(u,u),d.normalize(f,f),d.normalize(h,h),d.negate(u,u);let p=F.computeView(e,h,f,u,$ut),_,m,x=i.projectionMatrix;if(n===dz){let b=F.multiply(x,p,dX);m=F.inverse(b,dX)}else _=F.inverseTransformation(p,dX);l(m)?(Ky[0]=i.near,Ky[1]=i.far):(Ky[0]=0,Ky[1]=i.near,Ky[2]=i.far);for(let b=0;b<2;++b)for(let T=0;T<4;++T){let C=oe.clone(GI[T],Pye[T]);if(l(m)){C=F.multiplyByVector(m,C,C);let A=1/C.w;d.multiplyByScalar(C,A,C),d.subtract(C,e,C),d.normalize(C,C);let S=d.dot(h,C);d.multiplyByScalar(C,Ky[b]/S,C),d.add(C,e,C)}else{let A=i.offCenterFrustum;l(A)&&(i=A);let S=Ky[b],v=Ky[b+1];C.x=(C.x*(i.right-i.left)+i.left+i.right)*.5,C.y=(C.y*(i.top-i.bottom)+i.bottom+i.top)*.5,C.z=(C.z*(S-v)-S-v)*.5,C.w=1,F.multiplyByVector(_,C,C)}o[12*b+T*3]=C.x,o[12*b+T*3+1]=C.y,o[12*b+T*3+2]=C.z}};hb.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);hb._computeNearFarPlanes(i,o,t,n,c);let u=3*4*2;c[u]=c[3*4],c[u+1]=c[3*4+1],c[u+2]=c[3*4+2],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[3*3],c[u+7]=c[3*3+1],c[u+8]=c[3*3+2],c[u+9]=c[3*7],c[u+10]=c[3*7+1],c[u+11]=c[3*7+2],u+=3*4,c[u]=c[3*5],c[u+1]=c[3*5+1],c[u+2]=c[3*5+2],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[3*4],c[u+10]=c[3*4+1],c[u+11]=c[3*4+2],u+=3*4,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[3*5],c[u+4]=c[3*5+1],c[u+5]=c[3*5+2],c[u+6]=c[3*6],c[u+7]=c[3*6+1],c[u+8]=c[3*6+2],c[u+9]=c[3*2],c[u+10]=c[3*2+1],c[u+11]=c[3*2+2],u+=3*4,c[u]=c[3*2],c[u+1]=c[3*2+1],c[u+2]=c[3*2+2],c[u+3]=c[3*6],c[u+4]=c[3*6+1],c[u+5]=c[3*6+2],c[u+6]=c[3*7],c[u+7]=c[3*7+1],c[u+8]=c[3*7+2],c[u+9]=c[3*3],c[u+10]=c[3*3+1],c[u+11]=c[3*3+2],r||(c=c.subarray(3*4));let f=new dn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,_=l(s.tangent)?new Float32Array(3*4*a):void 0,m=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,b=wye,T=Dye,C=Iye,A=d.negate(b,Qut),S=d.negate(T,Jut),v=d.negate(C,eft);u=0,r&&(FE(u,p,_,m,x,v,b,T),u+=3*4),FE(u,p,_,m,x,C,A,T),u+=3*4,FE(u,p,_,m,x,A,v,T),u+=3*4,FE(u,p,_,m,x,S,v,A),u+=3*4,FE(u,p,_,m,x,b,C,T),u+=3*4,FE(u,p,_,m,x,T,C,A),l(p)&&(f.normal=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:p})),l(_)&&(f.tangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:_})),l(m)&&(f.bitangent=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:m})),l(x)&&(f.st=new ve({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:x}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let _=p*6,m=p*4;h[_]=m,h[_+1]=m+1,h[_+2]=m+2,h[_+3]=m,h[_+4]=m+2,h[_+5]=m+3}return new st({attributes:f,indices:h,primitiveType:Me.TRIANGLES,boundingSphere:ae.fromVertices(c)})};var BE=hb;var hX=0,tft=1;function WI(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e._drawNearPlane,!0),r,s;t instanceof Ii?(r=hX,s=Ii.packedLength):t instanceof nn&&(r=tft,s=nn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Oe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+d.packedLength+Oe.packedLength}WI.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===hX?(Ii.pack(o,t,n),n+=Ii.packedLength):(nn.pack(o,t,n),n+=nn.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Oe.pack(e._orientation,t,n),n+=Oe.packedLength,t[n]=e._drawNearPlane?1:0,t};var nft=new Ii,ift=new nn,oft=new Oe,rft=new d;WI.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===hX?(o=Ii.unpack(e,t,nft),t+=Ii.packedLength):(o=nn.unpack(e,t,ift),t+=nn.packedLength);let r=d.unpack(e,t,rft);t+=d.packedLength;let s=Oe.unpack(e,t,oft);t+=Oe.packedLength;let a=e[t]===1;if(!l(n))return new WI({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Oe.clone(s,n._orientation),n._drawNearPlane=a,n};WI.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);BE._computeNearFarPlanes(i,o,t,n,s);let a=new dn({position:new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=r?2:1,h=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,u=p*4,h[c]=u,h[c+1]=u+1,h[c+2]=u+1,h[c+3]=u+2,h[c+4]=u+2,h[c+5]=u+3,h[c+6]=u+3,h[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,h[c]=u,h[c+1]=u+4,h[c+2]=u+1,h[c+3]=u+5,h[c+4]=u+2,h[c+5]=u+6,h[c+6]=u+3,h[c+7]=u+7;return new st({attributes:a,indices:h,primitiveType:Me.LINES,boundingSphere:ae.fromVertices(s)})};var hz=WI;function mz(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,z.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var sft=new d,aft=new $,cft=new Oe,lft=new Ii,uft=new kl,fft=new nn,dft=new Hr,hft=new z,mft=[1,1e5];mz.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Ii?a=lft:s instanceof kl?a=uft:s instanceof nn?a=fft:a=dft,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=mft,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,h=r.directionWC,p=r.upWC,_=r.rightWC;_=d.negate(_,sft);let m=aft;$.setColumn(m,0,_,m),$.setColumn(m,1,p,m),$.setColumn(m,2,h,m);let x=Oe.fromRotationMatrix(m,cft);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new In({geometryInstances:new vt({geometry:new BE({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Gt.fromColor(z.fromAlpha(this._color,.1,hft))},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new vt({geometry:new hz({origin:f,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Gt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};mz.prototype.isDestroyed=function(){return!1};mz.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var pg=mz;var pz=`in vec4 positionEC; + +void main() +{ + vec3 position; + vec3 direction; + if (czm_orthographicIn3D == 1.0) + { + vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; + vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom + vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top + position = vec3(mix(minPlane, maxPlane, uv), 0.0); + direction = vec3(0.0, 0.0, -1.0); + } + else + { + position = vec3(0.0); + direction = normalize(positionEC.xyz); + } + + czm_ray ray = czm_ray(position, direction); + + vec3 ellipsoid_center = czm_view[3].xyz; + + czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); + if (!czm_isEmpty(intersection)) + { + out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); + } + else + { + discard; + } + + czm_writeLogDepth(); +} +`;var gz=`in vec4 position; + +out vec4 positionEC; + +void main() +{ + positionEC = czm_modelView * position; + gl_Position = czm_projection * positionEC; + + czm_vertexLogDepth(); +} +`;function qI(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var jI=zt.supportsTypedArrays()?new Float32Array(12):[],Rye=new d,Oye=new d,mX=new d,Mye=new d,_z=new d;function pft(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof nn)o=d.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=d.multiplyComponents(e.oneOverRadii,h,Rye),_=d.normalize(p,Oye),m=d.normalize(d.cross(d.UNIT_Z,p,mX),mX),x=d.normalize(d.cross(_,m,Mye),Mye),b=d.magnitude(p),T=Math.sqrt(b*b-1);o=d.multiplyByScalar(_,1/b,Rye);let C=T/b;r=d.multiplyByScalar(m,C,Oye),s=d.multiplyByScalar(x,C,mX)}let a=d.add(o,s,_z);d.subtract(a,r,a),d.multiplyComponents(n,a,a),d.pack(a,jI,0);let c=d.subtract(o,s,_z);d.subtract(c,r,c),d.multiplyComponents(n,c,c),d.pack(c,jI,3);let u=d.add(o,s,_z);d.add(u,r,u),d.multiplyComponents(n,u,u),d.pack(u,jI,6);let f=d.subtract(o,s,_z);return d.add(f,r,f),d.multiplyComponents(n,f,f),d.pack(f,jI,9),jI}qI.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ne.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ee(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new $e({renderState:this._rs,boundingVolume:new ae(d.ZERO,i.maximumRadius),pass:we.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Ue({sources:[gz]}),a=new Ue({sources:[pz]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=pft(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new st({attributes:{position:new ve({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Me.TRIANGLES});this._va=ni.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Fe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};qI.prototype.execute=function(e,t){this._mode===ne.SCENE3D&&this._command.execute(e,t)};qI.prototype.isDestroyed=function(){return!1};qI.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var yz=qI;function VE(){}var gft=/\bgl_FragDepth\b/,_ft=/\bdiscard\b/;function yft(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(gft.test(r[a])||_ft.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() { out_FragColor = vec4(1.0); } @@ -12635,31 +11172,31 @@ ${o?`u_dayTextureBrightness[${Be}]`:"0.0"}, out_FragColor = vec4(1.0); czm_writeLogDepth(); } -`;i=new Ue({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function pft(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ve.fromCache(o);return n[t.id]=r,r}FE.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=$e.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=mft(n,t.shaderProgram),i.depthOnlyCommand.renderState=pft(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var gft=/\s+czm_writeLogDepth\(/,_ft=/\s+czm_vertexLogDepth\(/;function yft(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let f=0;f<c.length;++f)if(_ft.test(c[f])){a=!0;break}if(!a){for(let h=0;h<c.length;++h)c[h]=Ue.replaceMain(c[h],"czm_log_depth_main");c.push(` +`;i=new Ue({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function xft(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ve.fromCache(o);return n[t.id]=r,r}VE.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=$e.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=yft(n,t.shaderProgram),i.depthOnlyCommand.renderState=xft(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var bft=/\s+czm_writeLogDepth\(/,Tft=/\s+czm_vertexLogDepth\(/;function Cft(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let f=0;f<c.length;++f)if(Tft.test(c[f])){a=!0;break}if(!a){for(let h=0;h<c.length;++h)c[h]=Ue.replaceMain(c[h],"czm_log_depth_main");c.push(` void main() { czm_log_depth_main(); czm_vertexLogDepth(); } -`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)gft.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Ue.replaceMain(c[f],"czm_log_depth_main");u=` +`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)bft.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Ue.replaceMain(c[f],"czm_log_depth_main");u=` void main() { czm_log_depth_main(); czm_writeLogDepth(); } -`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}FE.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=$e.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=yft(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function xft(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(_=>_.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () +`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}VE.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=$e.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Cft(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Aft(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(_=>_.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () { czm_non_pick_main(); if (${c}.a == 0.0) { discard; } ${c} = ${n}; -} `,f=r.length,h=new Array(f+1);for(let _=0;_<f;++_)h[_]=Ue.replaceMain(r[_],"czm_non_pick_main");h[f]=u;let p=new Ue({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function Oye(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ve.fromCache(o);return n[t.id]=r,r}FE.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=$e.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=xft(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Oye(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function NE(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function Mye(e){return e.isArray?e.arrayLength:lt.getComponentCount(e.type)}function bft(e){let t=Mye(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function Lye(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function Nye(e,t){let n=Vt.getMaximum(t);return`(${e}) / float(${n})`}function Tft(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=Lye(n,i,o)}return e.normalized||(n=Nye(n,e.componentType)),n}function Cft(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=Lye(o,r,s)}return e.normalized||(o=Nye(o,e.componentType)),o}function Aft(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=bft(u),h=["0.0","0.0","0.0","0.0"],p=Mye(u);if(p===1)h[0]=Tft(u,c);else{let b=["x","y","z","w"];for(let T=0;T<p;T++)h[T]=Cft(u,c,b[T])}let _=t.fragmentShaderSource.defines.slice();_.push(pf.METADATA_PICKING_ENABLED),NE(_,pf.METADATA_PICKING_VALUE_TYPE,f),NE(_,pf.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),NE(_,pf.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),NE(_,pf.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),NE(_,pf.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),NE(_,pf.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let m=new Ue({sources:t.fragmentShaderSource.sources,defines:_});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}FE.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=$e.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Aft(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Oye(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function Eft(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}FE.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=$e.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Eft(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var pg=FE;function Mz(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(o),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var Sft=new Oe,Fye=new Oe,vft=new $;function wft(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Oe.fromAxisAngle(o,n,Fye),c=Oe.fromAxisAngle(r,i,Sft),u=Oe.multiply(c,a,c),f=Oe.fromAxisAngle(s,t,Fye);Oe.multiply(f,u,u);let h=$.fromQuaternion(u,vft);$.multiplyByVector(h,r,r),$.multiplyByVector(h,s,s),$.multiplyByVector(h,o,o)}Mz.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;wft(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};Mz.prototype.isDestroyed=function(){return!1};Mz.prototype.destroy=function(){return this._removeListener(),ue(this)};var Lz=Mz;function mX(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(mX.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var Dft=new d;mX.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==ne.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,P.EPSILON4),-Math.max(this._heightFalloff,0)),s=d.normalize(n.positionWC,Dft),a=Math.abs(d.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var Nz=mX;function Ift(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var Fz=Ift;var ha={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},mb=ha.DERIVED_COMMANDS_MAXIMUM_LENGTH,qye=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function pb(){this._frontFaceAlphaByDistance=new kt(0,1,0,1),this._backFaceAlphaByDistance=new kt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=se.clone(se.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(mb),this._derivedBlendCommandTypes=new Array(mb),this._derivedPickCommandTypes=new Array(mb),this._derivedCommandTypesToUpdate=new Array(mb),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(pb.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});pb.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=Bye(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=Bye(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=kye(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=kye(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Mft(this,e,t),this._sunVisibleThroughGlobe=Pft(this,e),this._environmentVisible=Rft(this,e),this._useDepthPlane=Oft(this,e),this._numberOfTextureUniforms=Lft(this),this._rectangle=se.clone(t.translucency.rectangle,this._rectangle),Nft(this,e)};function Bye(e,t,n,i){return e?l(n)?(kt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function kye(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Pft(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Rft(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Oft(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Mft(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function Lft(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Nft(e,t){e._derivedCommandsLength=pX(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=pX(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=pX(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<mb;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=Zft())}function pX(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?ha.PICK_FRONT_FACE:u?ha.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ha.TRANSLUCENT_FRONT_FACE,h=i?ha.PICK_BACK_FACE:u?ha.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ha.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(o[r++]=ha.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=ha.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=h):(o[r++]=h,o[r++]=f)):c?(n||(o[r++]=ha.DEPTH_ONLY_BACK_FACE),o[r++]=ha.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=ha.DEPTH_ONLY_FRONT_FACE),o[r++]=ha.OPAQUE_BACK_FACE,o[r++]=f),r)}function Yf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Vye(e,t){return e.indexOf(t)>-1}function Fft(e,t){Yf(e.defines,"TRANSLUCENT"),Yf(t.defines,"TRANSLUCENT")}function Bft(e,t){Yf(e.defines,"GROUND_ATMOSPHERE"),Yf(t.defines,"GROUND_ATMOSPHERE"),Yf(e.defines,"FOG"),Yf(t.defines,"FOG"),Yf(e.defines,"TRANSLUCENT"),Yf(t.defines,"TRANSLUCENT")}function gX(e,t){if(Vye(t.defines,"TILE_LIMIT_RECTANGLE")||Vye(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +} `,f=r.length,h=new Array(f+1);for(let _=0;_<f;++_)h[_]=Ue.replaceMain(r[_],"czm_non_pick_main");h[f]=u;let p=new Ue({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function Lye(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ve.fromCache(o);return n[t.id]=r,r}VE.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=$e.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Aft(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Lye(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function kE(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function Nye(e){return e.isArray?e.arrayLength:ct.getComponentCount(e.type)}function Eft(e){let t=Nye(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function Fye(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function Bye(e,t){let n=kt.getMaximum(t);return`(${e}) / float(${n})`}function Sft(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=Fye(n,i,o)}return e.normalized||(n=Bye(n,e.componentType)),n}function vft(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=Fye(o,r,s)}return e.normalized||(o=Bye(o,e.componentType)),o}function wft(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=Eft(u),h=["0.0","0.0","0.0","0.0"],p=Nye(u);if(p===1)h[0]=Sft(u,c);else{let b=["x","y","z","w"];for(let T=0;T<p;T++)h[T]=vft(u,c,b[T])}let _=t.fragmentShaderSource.defines.slice();_.push(gf.METADATA_PICKING_ENABLED),kE(_,gf.METADATA_PICKING_VALUE_TYPE,f),kE(_,gf.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),kE(_,gf.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),kE(_,gf.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),kE(_,gf.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),kE(_,gf.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let m=new Ue({sources:t.fragmentShaderSource.sources,defines:_});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}VE.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=$e.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=wft(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Lye(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function Dft(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}VE.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=$e.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Dft(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var gg=VE;function xz(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(o),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var Ift=new Oe,kye=new Oe,Pft=new $;function Rft(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Oe.fromAxisAngle(o,n,kye),c=Oe.fromAxisAngle(r,i,Ift),u=Oe.multiply(c,a,c),f=Oe.fromAxisAngle(s,t,kye);Oe.multiply(f,u,u);let h=$.fromQuaternion(u,Pft);$.multiplyByVector(h,r,r),$.multiplyByVector(h,s,s),$.multiplyByVector(h,o,o)}xz.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;Rft(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};xz.prototype.isDestroyed=function(){return!1};xz.prototype.destroy=function(){return this._removeListener(),ue(this)};var bz=xz;function pX(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(pX.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var Oft=new d;pX.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==ne.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,P.EPSILON4),-Math.max(this._heightFalloff,0)),s=d.normalize(n.positionWC,Oft),a=Math.abs(d.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var Tz=pX;function Mft(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=ne.SCENE3D,this.morphTime=ne.getMorphTime(ne.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var Cz=Mft;var pa={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},mb=pa.DERIVED_COMMANDS_MAXIMUM_LENGTH,Xye=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function pb(){this._frontFaceAlphaByDistance=new Bt(0,1,0,1),this._backFaceAlphaByDistance=new Bt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=se.clone(se.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(mb),this._derivedBlendCommandTypes=new Array(mb),this._derivedPickCommandTypes=new Array(mb),this._derivedCommandTypesToUpdate=new Array(mb),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(pb.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});pb.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=Vye(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=Vye(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Uye(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Uye(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Bft(this,e,t),this._sunVisibleThroughGlobe=Lft(this,e),this._environmentVisible=Nft(this,e),this._useDepthPlane=Fft(this,e),this._numberOfTextureUniforms=kft(this),this._rectangle=se.clone(t.translucency.rectangle,this._rectangle),Vft(this,e)};function Vye(e,t,n,i){return e?l(n)?(Bt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function Uye(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Lft(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Nft(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Fft(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Bft(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ne.SCENE2D&&t.context.depthTexture}function kft(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Vft(e,t){e._derivedCommandsLength=gX(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=gX(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=gX(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<mb;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=edt())}function gX(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?pa.PICK_FRONT_FACE:u?pa.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:pa.TRANSLUCENT_FRONT_FACE,h=i?pa.PICK_BACK_FACE:u?pa.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:pa.TRANSLUCENT_BACK_FACE;return t.mode===ne.SCENE2D?(o[r++]=pa.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=pa.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=h):(o[r++]=h,o[r++]=f)):c?(n||(o[r++]=pa.DEPTH_ONLY_BACK_FACE),o[r++]=pa.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=pa.DEPTH_ONLY_FRONT_FACE),o[r++]=pa.OPAQUE_BACK_FACE,o[r++]=f),r)}function Xf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function zye(e,t){return e.indexOf(t)>-1}function Uft(e,t){Xf(e.defines,"TRANSLUCENT"),Xf(t.defines,"TRANSLUCENT")}function zft(e,t){Xf(e.defines,"GROUND_ATMOSPHERE"),Xf(t.defines,"GROUND_ATMOSPHERE"),Xf(e.defines,"FOG"),Xf(t.defines,"FOG"),Xf(e.defines,"TRANSLUCENT"),Xf(t.defines,"TRANSLUCENT")}function _X(e,t){if(zye(t.defines,"TILE_LIMIT_RECTANGLE")||zye(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() { out_FragColor = vec4(1.0); } -`;t.sources=[n]}function _X(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Ue.replaceMain(n[r],"czm_globe_translucency_main");n.push(` +`;t.sources=[n]}function yX(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Ue.replaceMain(n[r],"czm_globe_translucency_main");n.push(` uniform sampler2D u_classificationTexture; void main() @@ -12686,7 +11223,7 @@ void main() } out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); } -`)}function Yye(e,t){_X(e,t),Yf(e.defines,"GROUND_ATMOSPHERE"),Yf(t.defines,"GROUND_ATMOSPHERE"),Yf(e.defines,"FOG"),Yf(t.defines,"FOG")}function kft(e,t){_X(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Vft(e,t){Yye(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Uye(e,t){let n=`uniform sampler2D u_classificationTexture; +`)}function Kye(e,t){yX(e,t),Xf(e.defines,"GROUND_ATMOSPHERE"),Xf(t.defines,"GROUND_ATMOSPHERE"),Xf(e.defines,"FOG"),Xf(t.defines,"FOG")}function Hft(e,t){yX(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Gft(e,t){Kye(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Hye(e,t){let n=`uniform sampler2D u_classificationTexture; void main() { vec2 st = gl_FragCoord.xy / czm_viewport.zw; @@ -12697,7 +11234,7 @@ void main() } out_FragColor = pickColor; } -`;t.sources=[n]}function Uft(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function zft(e){e.cull.face=xi.BACK,e.cull.enabled=!0}function Hft(e){e.cull.face=xi.FRONT,e.cull.enabled=!0}function Gft(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Wft(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function jft(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function zye(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function Hye(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function qft(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Yft(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Xft(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ve.getState(e);i(s),r=Ve.fromCache(s),o[e.id]=r}return r}function BE(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Kft(e,t,n,i,o){return l(o)?!i&&l(n)?n:bt(t,o(e),!1):t}function lh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Zft(){return[new lh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:Fft,getRenderStateFunction:zft,getUniformMapFunction:void 0}),new lh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:Bft,getRenderStateFunction:Hft,getUniformMapFunction:void 0}),new lh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:gX,getRenderStateFunction:Gft,getUniformMapFunction:void 0}),new lh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:gX,getRenderStateFunction:Wft,getUniformMapFunction:void 0}),new lh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:gX,getRenderStateFunction:jft,getUniformMapFunction:void 0}),new lh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:_X,getRenderStateFunction:zye,getUniformMapFunction:BE}),new lh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Yye,getRenderStateFunction:Hye,getUniformMapFunction:BE}),new lh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:kft,getRenderStateFunction:zye,getUniformMapFunction:BE}),new lh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Vft,getRenderStateFunction:Hye,getUniformMapFunction:BE}),new lh({pass:we.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Uye,getRenderStateFunction:qft,getUniformMapFunction:BE}),new lh({pass:we.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Uye,getRenderStateFunction:Yft,getUniformMapFunction:BE})]}var Gye=new Array(mb),Wye=new Array(mb);pb.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)Wye[o]=this._derivedCommandPacks[n[o]],Gye[o]=qye[n[o]];$ft(this,e,i,n,Gye,Wye,t)}};function $ft(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),h=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),_=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;_&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),x&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let T=r[b],C=i[b],A=o[b],S=a[A],v,D,O;l(S)?(v=S.uniformMap,D=S.shaderProgram,O=S.renderState):(v=void 0,D=void 0,O=void 0),S=$e.shallowClone(t,S),a[A]=S;let R=y(S.derivedCommands.uniformMapDirtyFrame,0),M=y(S.derivedCommands.shaderProgramDirtyFrame,0),L=y(S.derivedCommands.renderStateDirtyFrame,0),g=_||R<f,E=m||M<h,w=x||L<p;g&&(S.derivedCommands.uniformMapDirtyFrame=u),E&&(S.derivedCommands.shaderProgramDirtyFrame=u),w&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=C,S.pass=T.pass,S.pickOnly=T.pickOnly,S.uniformMap=Kft(e,t.uniformMap,v,g,T.getUniformMapFunction),S.shaderProgram=Uft(s.context,t.shaderProgram,D,E,T.getShaderProgramFunction,A),S.renderState=Xft(t.renderState,O,w,T.getRenderStateFunction,T.renderStateCache)}}}pb.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=qye[o[a]];n.commandList.push(s[c])}};function Xye(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function jye(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var Qft=[ha.OPAQUE_FRONT_FACE,ha.OPAQUE_BACK_FACE],Jft=[ha.DEPTH_ONLY_FRONT_FACE,ha.DEPTH_ONLY_BACK_FACE,ha.DEPTH_ONLY_FRONT_AND_BACK_FACE];pb.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[we.GLOBE],a=e.indices[we.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),Xye(s,a,t,i,o,Qft))};pb.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[we.GLOBE],c=e.indices[we.GLOBE],u=e.commands[we.TERRAIN_CLASSIFICATION],f=e.indices[we.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&jye(u,f,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let _=s.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,Xye(a,c,t,i,o,Jft),r.depthTexture){let x=n.packDepth(r,o);s.globeDepthTexture=x}jye(u,f,t,i,o),s.globeDepthTexture=_,o.framebuffer=m};var Bz=pb;var Iu=`uniform sampler2D colorTexture; +`;t.sources=[n]}function Wft(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function jft(e){e.cull.face=bi.BACK,e.cull.enabled=!0}function qft(e){e.cull.face=bi.FRONT,e.cull.enabled=!0}function Yft(e){e.cull.face=bi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Xft(e){e.cull.face=bi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Kft(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Gye(e){e.cull.face=bi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=ln.ALPHA_BLEND}function Wye(e){e.cull.face=bi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=ln.ALPHA_BLEND}function Zft(e){e.cull.face=bi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function $ft(e){e.cull.face=bi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Qft(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ve.getState(e);i(s),r=Ve.fromCache(s),o[e.id]=r}return r}function UE(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Jft(e,t,n,i,o){return l(o)?!i&&l(n)?n:xt(t,o(e),!1):t}function lh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function edt(){return[new lh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:Uft,getRenderStateFunction:jft,getUniformMapFunction:void 0}),new lh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:zft,getRenderStateFunction:qft,getUniformMapFunction:void 0}),new lh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:_X,getRenderStateFunction:Yft,getUniformMapFunction:void 0}),new lh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:_X,getRenderStateFunction:Xft,getUniformMapFunction:void 0}),new lh({pass:we.GLOBE,pickOnly:!1,getShaderProgramFunction:_X,getRenderStateFunction:Kft,getUniformMapFunction:void 0}),new lh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:yX,getRenderStateFunction:Gye,getUniformMapFunction:UE}),new lh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Kye,getRenderStateFunction:Wye,getUniformMapFunction:UE}),new lh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Hft,getRenderStateFunction:Gye,getUniformMapFunction:UE}),new lh({pass:we.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Gft,getRenderStateFunction:Wye,getUniformMapFunction:UE}),new lh({pass:we.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Hye,getRenderStateFunction:Zft,getUniformMapFunction:UE}),new lh({pass:we.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Hye,getRenderStateFunction:$ft,getUniformMapFunction:UE})]}var jye=new Array(mb),qye=new Array(mb);pb.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)qye[o]=this._derivedCommandPacks[n[o]],jye[o]=Xye[n[o]];tdt(this,e,i,n,jye,qye,t)}};function tdt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=y(a.uniformMapDirtyFrame,0),h=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),_=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;_&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),x&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let T=r[b],C=i[b],A=o[b],S=a[A],v,D,O;l(S)?(v=S.uniformMap,D=S.shaderProgram,O=S.renderState):(v=void 0,D=void 0,O=void 0),S=$e.shallowClone(t,S),a[A]=S;let R=y(S.derivedCommands.uniformMapDirtyFrame,0),M=y(S.derivedCommands.shaderProgramDirtyFrame,0),L=y(S.derivedCommands.renderStateDirtyFrame,0),g=_||R<f,E=m||M<h,w=x||L<p;g&&(S.derivedCommands.uniformMapDirtyFrame=u),E&&(S.derivedCommands.shaderProgramDirtyFrame=u),w&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=C,S.pass=T.pass,S.pickOnly=T.pickOnly,S.uniformMap=Jft(e,t.uniformMap,v,g,T.getUniformMapFunction),S.shaderProgram=Wft(s.context,t.shaderProgram,D,E,T.getShaderProgramFunction,A),S.renderState=Qft(t.renderState,O,w,T.getRenderStateFunction,T.renderStateCache)}}}pb.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=Xye[o[a]];n.commandList.push(s[c])}};function Zye(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function Yye(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var ndt=[pa.OPAQUE_FRONT_FACE,pa.OPAQUE_BACK_FACE],idt=[pa.DEPTH_ONLY_FRONT_FACE,pa.DEPTH_ONLY_BACK_FACE,pa.DEPTH_ONLY_FRONT_AND_BACK_FACE];pb.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[we.GLOBE],a=e.indices[we.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),Zye(s,a,t,i,o,ndt))};pb.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[we.GLOBE],c=e.indices[we.GLOBE],u=e.commands[we.TERRAIN_CLASSIFICATION],f=e.indices[we.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&Yye(u,f,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let _=s.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,Zye(a,c,t,i,o,idt),r.depthTexture){let x=n.packDepth(r,o);s.globeDepthTexture=x}Yye(u,f,t,i,o),s.globeDepthTexture=_,o.framebuffer=m};var Az=pb;var Pu=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -12705,7 +11242,7 @@ void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); } -`;function Bm(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ei({color:new z(0,0,0,0),owner:this}),this._clearCommand=new ei({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Bm.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Bm.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var edt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},backFunction:Vn.NEVER,reference:0,mask:Ut.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},tdt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},backFunction:Vn.NEVER,reference:0,mask:Ut.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},ndt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ut.setCesium3DTileBit(),stencilMask:Ut.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},idt=`uniform sampler2D colorTexture; +`;function km(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new mi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new mi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ti({color:new z(0,0,0,0),owner:this}),this._clearCommand=new ti({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(km.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});km.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var odt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},backFunction:Vn.NEVER,reference:0,mask:Vt.CLASSIFICATION_MASK},blending:ln.ALPHA_BLEND},rdt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},backFunction:Vn.NEVER,reference:0,mask:Vt.CLASSIFICATION_MASK},blending:ln.ALPHA_BLEND},sdt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Vt.setCesium3DTileBit(),stencilMask:Vt.CESIUM_3D_TILE_MASK,blending:ln.ALPHA_BLEND},adt=`uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; @@ -12733,7 +11270,7 @@ void main() out_FragColor = color * highlightColor; gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; } -`,odt=`uniform sampler2D colorTexture; +`,cdt=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { @@ -12748,7 +11285,7 @@ void main() out_FragColor = color; #endif } -`;Bm.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Ot({context:e,width:s,height:a,pixelFormat:tt.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Qu({context:e,width:s,height:a,format:dl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(edt),this._rsClassified=Ve.fromCache(tdt),this._rsDefault=Ve.fromCache(ndt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?odt:idt,f=new Ue({defines:["UNCLASSIFIED"],sources:[u]}),h=new Ue({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Iu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Bm.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Bm.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Bm.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Bm.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Bm.prototype.isDestroyed=function(){return!1};Bm.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var jI=Bm;function kz(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(kz.prototype,{total:{get:function(){return this._total}}});function Zy(e){let t=new Array(Za.NUMBER_OF_JOB_TYPES);t[Za.TEXTURE]=new kz(l(e)?e[Za.TEXTURE]:10),t[Za.PROGRAM]=new kz(l(e)?e[Za.PROGRAM]:10),t[Za.BUFFER]=new kz(l(e)?e[Za.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}Zy.getTimestamp=Ci;Object.defineProperties(Zy.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Zy.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Zy.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};Zy.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Zy.getTimestamp();e.execute();let a=Zy.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var Vz=Zy;function Uz(e){e=y(e,y.EMPTY_OBJECT);let t=Rn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Ci(),this._lastMsSampleTime=Ci(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(Uz.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});Uz.prototype.update=function(e){let t=Ci(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};Uz.prototype.destroy=function(){return ue(this)};var $y=Uz;var ma={};ma.decodeRawMetadataValue=function(e,t,n){switch(e){case Vt.INT8:return t.getInt8(n);case Vt.UINT8:return t.getUint8(n);case Vt.INT16:return t.getInt16(n,!0);case Vt.UINT16:return t.getUint16(n,!0);case Vt.INT32:return t.getInt32(n,!0);case Vt.UINT32:return t.getUint32(n,!0);case Vt.INT64:return t.getBigInt64(n,!0);case Vt.UINT64:return t.getBigUint64(n,!0);case Vt.FLOAT32:return t.getFloat32(n,!0);case Vt.FLOAT64:return t.getFloat64(n,!0)}throw new re(`Invalid component type: ${e}`)};ma.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=ma.decodeRawMetadataValue(i,t,n);return e.normalized?Vt.normalize(o,i):o};ma.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Vt.getSizeInBytes(i),r=e.type,s=lt.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,_=ma.decodeRawMetadataValueComponent(e,t,p);f[h]=_}return f}let c=n*a;return ma.decodeRawMetadataValueComponent(e,t,c)};ma.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=ma.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return ma.decodeRawMetadataValueElement(e,n,0)};ma.convertToObjectType=function(e,t){if(!l(t)||e===lt.SCALAR||e===lt.STRING||e===lt.BOOLEAN||e===lt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case lt.VEC2:return U.unpack(n,0,new U);case lt.VEC3:return d.unpack(n,0,new d);case lt.VEC4:return oe.unpack(n,0,new oe);case lt.MAT2:return Pi.unpack(n,0,new Pi);case lt.MAT3:return $.unpack(n,0,new $);case lt.MAT4:return F.unpack(n,0,new F)}throw new re(`Invalid metadata object type: ${e}`)};ma.convertFromObjectType=function(e,t){if(!l(t)||e===lt.SCALAR||e===lt.STRING||e===lt.BOOLEAN||e===lt.ENUM)return t;switch(e){case lt.VEC2:return U.pack(t,Array(2));case lt.VEC3:return d.pack(t,Array(3));case lt.VEC4:return oe.pack(t,Array(4));case lt.MAT2:return Pi.pack(t,Array(4));case lt.MAT3:return $.pack(t,Array(9));case lt.MAT4:return F.pack(t,Array(16))}throw new re(`Invalid metadata object type: ${e}`)};ma.decodeMetadataValues=function(e,t,n){let i=ma.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=ma.convertFromObjectType(e.type,t.offset),s=ma.convertFromObjectType(e.type,t.scale);i=Tp.valueTransformInPlace(i,r,s,Vt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],u=ma.convertToObjectType(e.type,c);s[a]=u}return s}return ma.convertToObjectType(e.type,i)};var zz=Object.freeze(ma);function gb(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(gb.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function rdt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function sdt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; +`;km.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Rt({context:e,width:s,height:a,pixelFormat:tt.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Ju({context:e,width:s,height:a,format:hl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(odt),this._rsClassified=Ve.fromCache(rdt),this._rsDefault=Ve.fromCache(sdt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?cdt:adt,f=new Ue({defines:["UNCLASSIFIED"],sources:[u]}),h=new Ue({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Pu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};km.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};km.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};km.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};km.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};km.prototype.isDestroyed=function(){return!1};km.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var YI=km;function Ez(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(Ez.prototype,{total:{get:function(){return this._total}}});function Zy(e){let t=new Array($a.NUMBER_OF_JOB_TYPES);t[$a.TEXTURE]=new Ez(l(e)?e[$a.TEXTURE]:10),t[$a.PROGRAM]=new Ez(l(e)?e[$a.PROGRAM]:10),t[$a.BUFFER]=new Ez(l(e)?e[$a.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}Zy.getTimestamp=Ai;Object.defineProperties(Zy.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Zy.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Zy.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};Zy.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Zy.getTimestamp();e.execute();let a=Zy.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var Sz=Zy;function vz(e){e=y(e,y.EMPTY_OBJECT);let t=Rn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Ai(),this._lastMsSampleTime=Ai(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(vz.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});vz.prototype.update=function(e){let t=Ai(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};vz.prototype.destroy=function(){return ue(this)};var $y=vz;var ga={};ga.decodeRawMetadataValue=function(e,t,n){switch(e){case kt.INT8:return t.getInt8(n);case kt.UINT8:return t.getUint8(n);case kt.INT16:return t.getInt16(n,!0);case kt.UINT16:return t.getUint16(n,!0);case kt.INT32:return t.getInt32(n,!0);case kt.UINT32:return t.getUint32(n,!0);case kt.INT64:return t.getBigInt64(n,!0);case kt.UINT64:return t.getBigUint64(n,!0);case kt.FLOAT32:return t.getFloat32(n,!0);case kt.FLOAT64:return t.getFloat64(n,!0)}throw new re(`Invalid component type: ${e}`)};ga.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=ga.decodeRawMetadataValue(i,t,n);return e.normalized?kt.normalize(o,i):o};ga.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=kt.getSizeInBytes(i),r=e.type,s=ct.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,_=ga.decodeRawMetadataValueComponent(e,t,p);f[h]=_}return f}let c=n*a;return ga.decodeRawMetadataValueComponent(e,t,c)};ga.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=ga.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return ga.decodeRawMetadataValueElement(e,n,0)};ga.convertToObjectType=function(e,t){if(!l(t)||e===ct.SCALAR||e===ct.STRING||e===ct.BOOLEAN||e===ct.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case ct.VEC2:return U.unpack(n,0,new U);case ct.VEC3:return d.unpack(n,0,new d);case ct.VEC4:return oe.unpack(n,0,new oe);case ct.MAT2:return Ri.unpack(n,0,new Ri);case ct.MAT3:return $.unpack(n,0,new $);case ct.MAT4:return F.unpack(n,0,new F)}throw new re(`Invalid metadata object type: ${e}`)};ga.convertFromObjectType=function(e,t){if(!l(t)||e===ct.SCALAR||e===ct.STRING||e===ct.BOOLEAN||e===ct.ENUM)return t;switch(e){case ct.VEC2:return U.pack(t,Array(2));case ct.VEC3:return d.pack(t,Array(3));case ct.VEC4:return oe.pack(t,Array(4));case ct.MAT2:return Ri.pack(t,Array(4));case ct.MAT3:return $.pack(t,Array(9));case ct.MAT4:return F.pack(t,Array(16))}throw new re(`Invalid metadata object type: ${e}`)};ga.decodeMetadataValues=function(e,t,n){let i=ga.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=ga.convertFromObjectType(e.type,t.offset),s=ga.convertFromObjectType(e.type,t.scale);i=Cp.valueTransformInPlace(i,r,s,kt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],u=ga.convertToObjectType(e.type,c);s[a]=u}return s}return ga.convertToObjectType(e.type,i)};var wz=Object.freeze(ga);function gb(){this._framebuffer=new mi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(gb.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function ldt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function udt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -12760,7 +11297,7 @@ void main() out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0, czm_packDepth(depth), globeDepthPacked); } -`,{renderState:Ve.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}gb.prototype.update=function(e,t){rdt(this,e,t),sdt(this,e,t)};var adt=new oe,cdt=new oe(1,1/255,1/65025,1/16581375);gb.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=oe.unpack(i,0,adt);return oe.divideByScalar(o,255,o),oe.dot(o,cdt)};gb.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};gb.prototype.isDestroyed=function(){return!1};gb.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var Hz=gb;function ldt(e,t){this.near=y(e,0),this.far=y(t,0);let n=we.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var Gz=ldt;var _b=`uniform highp sampler2D u_depthTexture; +`,{renderState:Ve.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}gb.prototype.update=function(e,t){ldt(this,e,t),udt(this,e,t)};var fdt=new oe,ddt=new oe(1,1/255,1/65025,1/16581375);gb.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=oe.unpack(i,0,fdt);return oe.divideByScalar(o,255,o),oe.dot(o,ddt)};gb.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};gb.prototype.isDestroyed=function(){return!1};gb.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var Dz=gb;function hdt(e,t){this.near=y(e,0),this.far=y(t,0);let n=we.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var Iz=hdt;var _b=`uniform highp sampler2D u_depthTexture; in vec2 v_textureCoordinates; @@ -12768,18 +11305,76 @@ void main() { out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;function km(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new qe,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(km.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function Kye(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!qe.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,qe.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=qe.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!qe.equals(r,e._rs.viewport)||a)&&(e._rs=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:dt.KEEP,zFail:dt.KEEP,zPass:dt.KEEP},backFunction:Vn.NEVER,reference:Ut.CESIUM_3D_TILE_MASK,mask:Ut.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(_b,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(_b,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ei({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}km.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),Kye(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};km.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};km.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};km.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),Kye(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};km.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};km.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};km.prototype.isDestroyed=function(){return!1};km.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var Wz=km;function yb(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new qe,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(yb.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function udt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function fdt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function ddt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!qe.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,qe.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=qe.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!qe.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(_b,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ei({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}yb.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;fdt(this,n,o,r,e),ddt(this,n,o,r,i),this._useHdr=e};yb.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};yb.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};yb.prototype.isDestroyed=function(){return!1};yb.prototype.destroy=function(){return udt(this),ue(this)};var jz=yb;function gg(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new ei({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ei({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ei({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new ei({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new qe,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Zye(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function yX(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function $ye(e){Zye(e),yX(e)}function hdt(e,t,n,i){Zye(e),e._accumulationTexture=new Ot({context:t,width:n,height:i,pixelFormat:tt.RGBA,pixelDatatype:Ke.FLOAT}),e._revealageTexture=new Ot({context:t,pixelFormat:tt.RGBA,pixelDatatype:Ke.FLOAT,width:n,height:i,flipY:!1})}function mdt(e,t){yX(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(yX(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&($ye(e),e._translucentMultipassSupport=!1,i=!1)}return i}gg.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,hdt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!mdt(this,e))return;this._useHDR=i;let f=this,h,p;l(this._compositeCommand)||(h=new Ue({sources:[$M]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new Ue({defines:["MRT"],sources:[QS]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new Ue({sources:[QS]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let _=!qe.equals(this._viewport,t.viewport),m=_!==this._useScissorTest;this._useScissorTest=_,qe.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=qe.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!qe.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var pdt={enabled:!0,color:new z(0,0,0,0),equationRgb:qa.ADD,equationAlpha:qa.ADD,functionSourceRgb:So.ONE,functionDestinationRgb:So.ONE,functionSourceAlpha:So.ZERO,functionDestinationAlpha:So.ONE_MINUS_SOURCE_ALPHA},gdt={enabled:!0,color:new z(0,0,0,0),equationRgb:qa.ADD,equationAlpha:qa.ADD,functionSourceRgb:So.ONE,functionDestinationRgb:So.ONE,functionSourceAlpha:So.ONE,functionDestinationAlpha:So.ONE},_dt={enabled:!0,color:new z(0,0,0,0),equationRgb:qa.ADD,equationAlpha:qa.ADD,functionSourceRgb:So.ZERO,functionDestinationRgb:So.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:So.ZERO,functionDestinationAlpha:So.ONE_MINUS_SOURCE_ALPHA};function xX(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function ydt(e,t,n){return xX(t,pdt,e._translucentRenderStateCache,n)}function xdt(e,t,n){return xX(t,gdt,e._translucentRenderStateCache,n)}function bdt(e,t,n){return xX(t,_dt,e._alphaRenderStateCache,n)}var Tdt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`;function Vm(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new mi,this._tempCopyDepthFramebuffer=new mi,this._updateDepthFramebuffer=new mi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new qe,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Vm.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function $ye(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!qe.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,qe.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=qe.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!qe.equals(r,e._rs.viewport)||a)&&(e._rs=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:ln.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ut.KEEP,zFail:ut.KEEP,zPass:ut.KEEP},backFunction:Vn.NEVER,reference:Vt.CESIUM_3D_TILE_MASK,mask:Vt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(_b,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Pu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(_b,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Pu,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ti({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Vm.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),$ye(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};Vm.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Vm.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Vm.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),$ye(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};Vm.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Vm.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Vm.prototype.isDestroyed=function(){return!1};Vm.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var Pz=Vm;function yb(){this._framebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new mi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new qe,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(yb.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function mdt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function pdt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function gdt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!qe.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,qe.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=qe.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!qe.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(_b,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ti({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}yb.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;pdt(this,n,o,r,e),gdt(this,n,o,r,i),this._useHdr=e};yb.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};yb.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};yb.prototype.isDestroyed=function(){return!1};yb.prototype.destroy=function(){return mdt(this),ue(this)};var Rz=yb;var XI=`#ifdef MRT +layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1; +#else +layout (location = 0) out vec4 out_FragColor; +#endif + +uniform vec4 u_bgColor; +uniform sampler2D u_depthTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) + { +#ifdef MRT + out_FragData_0 = u_bgColor; + out_FragData_1 = vec4(u_bgColor.a); +#else + out_FragColor = u_bgColor; +#endif + return; + } + + discard; +} +`;var Oz=`/** + * Compositing for Weighted Blended Order-Independent Transparency. See: + * - http://jcgt.org/published/0002/02/09/ + * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html + */ + +uniform sampler2D u_opaque; +uniform sampler2D u_accumulation; +uniform sampler2D u_revealage; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 opaque = texture(u_opaque, v_textureCoordinates); + vec4 accum = texture(u_accumulation, v_textureCoordinates); + float r = texture(u_revealage, v_textureCoordinates).r; + +#ifdef MRT + vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); +#else + vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); +#endif + + out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; + + if (opaque != czm_backgroundColor) + { + out_FragColor.a = 1.0; + } +} +`;function _g(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new mi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new mi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new mi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new mi({createColorAttachments:!1}),this._opaqueClearCommand=new ti({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ti({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ti({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new ti({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new qe,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Qye(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function xX(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function Jye(e){Qye(e),xX(e)}function _dt(e,t,n,i){Qye(e),e._accumulationTexture=new Rt({context:t,width:n,height:i,pixelFormat:tt.RGBA,pixelDatatype:Ke.FLOAT}),e._revealageTexture=new Rt({context:t,pixelFormat:tt.RGBA,pixelDatatype:Ke.FLOAT,width:n,height:i,flipY:!1})}function ydt(e,t){xX(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(xX(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(Jye(e),e._translucentMultipassSupport=!1,i=!1)}return i}_g.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,_dt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!ydt(this,e))return;this._useHDR=i;let f=this,h,p;l(this._compositeCommand)||(h=new Ue({sources:[Oz]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new Ue({defines:["MRT"],sources:[XI]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new Ue({sources:[XI]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let _=!qe.equals(this._viewport,t.viewport),m=_!==this._useScissorTest;this._useScissorTest=_,qe.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=qe.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!qe.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var xdt={enabled:!0,color:new z(0,0,0,0),equationRgb:Ya.ADD,equationAlpha:Ya.ADD,functionSourceRgb:vo.ONE,functionDestinationRgb:vo.ONE,functionSourceAlpha:vo.ZERO,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA},bdt={enabled:!0,color:new z(0,0,0,0),equationRgb:Ya.ADD,equationAlpha:Ya.ADD,functionSourceRgb:vo.ONE,functionDestinationRgb:vo.ONE,functionSourceAlpha:vo.ONE,functionDestinationAlpha:vo.ONE},Tdt={enabled:!0,color:new z(0,0,0,0),equationRgb:Ya.ADD,equationAlpha:Ya.ADD,functionSourceRgb:vo.ZERO,functionDestinationRgb:vo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:vo.ZERO,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA};function bX(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function Cdt(e,t,n){return bX(t,xdt,e._translucentRenderStateCache,n)}function Adt(e,t,n){return bX(t,bdt,e._translucentRenderStateCache,n)}function Edt(e,t,n){return bX(t,Tdt,e._alphaRenderStateCache,n)}var Sdt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragData_0 = vec4(Ci * wzi, ai); out_FragData_1 = vec4(ai * wzi); -`,Cdt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`,vdt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragColor = vec4(Ci, ai) * wzi; -`,Adt=` float ai = czm_out_FragColor.a; +`,wdt=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); -`;function bX(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Ue.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; +`;function TX(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Ue.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor; bool czm_discard = false; `);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let h=c[f];u=`layout (location = ${h[1]}) out vec4 ${h[0]}; ${u}`}return a.sources.push(u),a.sources.push(`void main() @@ -12790,7 +11385,7 @@ ${u}`}return a.sources.push(u),a.sources.push(`void main() discard; } ${i}} -`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Edt(e,t){return bX(e,t,"translucentMRT",Tdt)}function Sdt(e,t){return bX(e,t,"translucentMultipass",Cdt)}function vdt(e,t){return bX(e,t,"alphaMultipass",Adt)}gg.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=$e.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Edt(t,e.shaderProgram),n.translucentCommand.renderState=ydt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=$e.shallowClone(e,n.translucentCommand),n.alphaCommand=$e.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Sdt(t,e.shaderProgram),n.translucentCommand.renderState=xdt(this,t,e.renderState),n.alphaCommand.shaderProgram=vdt(t,e.shaderProgram),n.alphaCommand.renderState=bdt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function wdt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let _=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(b,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(x,t,i,_)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.alphaCommand:x.derivedCommands.oit.alphaCommand;n(b,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(x,t,i,_)}i.framebuffer=h}function Ddt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let _=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(b,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(x,t,i,_)}i.framebuffer=h}gg.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Ddt(this,e,t,n,i,o);return}wdt(this,e,t,n,i,o)};gg.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};gg.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};gg.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};gg.prototype.isDestroyed=function(){return!1};gg.prototype.destroy=function(){return $ye(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var qz=gg;function qI(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(qI.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Idt(e){e._framebuffer.destroy()}function Pdt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Cc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new qe},o.viewport=new qe,e._passState=o}qI.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&Pdt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};qI.prototype.isDestroyed=function(){return!1};qI.prototype.destroy=function(){return Idt(this),ue(this)};var Yz=qI;function kE(e){let t=new Cc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new qe},t.viewport=new qe,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}kE.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return qe.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var YI=new z;kE.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),u=0,f=0,h=0,p=-1;for(let _=0;_<s;++_){if(-a<=u&&u<=a&&-c<=f&&f<=c){let m=4*((c-f)*t+u+a);YI.red=z.byteToFloat(o[m]),YI.green=z.byteToFloat(o[m+1]),YI.blue=z.byteToFloat(o[m+2]),YI.alpha=z.byteToFloat(o[m+3]);let x=i.getObjectByPickColor(YI);if(l(x))return x}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=h;h=-p,p=m}u+=h,f+=p}};kE.prototype.readCenterPixel=function(e){let t=y(e.width,1),n=y(e.height,1),o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};kE.prototype.isDestroyed=function(){return!1};kE.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var Xz=kE;function _g(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new ei({color:new z(0,0,0,0),depth:1,owner:this})}function Rdt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(_g.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});_g.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};_g.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};_g.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};_g.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};_g.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};_g.prototype.isDestroyed=function(){return!1};_g.prototype.destroy=function(){return Rdt(this),ue(this)};var VE=_g;function xb(){}xb.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};xb.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Ue.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=Ue.replaceMain(o[u],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; +`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Ddt(e,t){return TX(e,t,"translucentMRT",Sdt)}function Idt(e,t){return TX(e,t,"translucentMultipass",vdt)}function Pdt(e,t){return TX(e,t,"alphaMultipass",wdt)}_g.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=$e.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Ddt(t,e.shaderProgram),n.translucentCommand.renderState=Cdt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=$e.shallowClone(e,n.translucentCommand),n.alphaCommand=$e.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Idt(t,e.shaderProgram),n.translucentCommand.renderState=Adt(this,t,e.renderState),n.alphaCommand.shaderProgram=Pdt(t,e.shaderProgram),n.alphaCommand.renderState=Edt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function Rdt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let _=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(b,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(x,t,i,_)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.alphaCommand:x.derivedCommands.oit.alphaCommand;n(b,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(x,t,i,_)}i.framebuffer=h}function Odt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let _=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let x=o[m];x=c?x.derivedCommands.logDepth.command:x,x=f?x.derivedCommands.hdr.command:x;let b=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(b,t,i,_)}if(l(r)){let m=r.unclassifiedCommand,x=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(x,t,i,_)}i.framebuffer=h}_g.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Odt(this,e,t,n,i,o);return}Rdt(this,e,t,n,i,o)};_g.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};_g.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};_g.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};_g.prototype.isDestroyed=function(){return!1};_g.prototype.destroy=function(){return Jye(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var Mz=_g;function KI(){this._framebuffer=new mi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(KI.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Mdt(e){e._framebuffer.destroy()}function Ldt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Ac(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new qe},o.viewport=new qe,e._passState=o}KI.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&Ldt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};KI.prototype.isDestroyed=function(){return!1};KI.prototype.destroy=function(){return Mdt(this),ue(this)};var Lz=KI;function zE(e){let t=new Ac(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new qe},t.viewport=new qe,this._context=e,this._fb=new mi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}zE.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return qe.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var ZI=new z;zE.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),u=0,f=0,h=0,p=-1;for(let _=0;_<s;++_){if(-a<=u&&u<=a&&-c<=f&&f<=c){let m=4*((c-f)*t+u+a);ZI.red=z.byteToFloat(o[m]),ZI.green=z.byteToFloat(o[m+1]),ZI.blue=z.byteToFloat(o[m+2]),ZI.alpha=z.byteToFloat(o[m+3]);let x=i.getObjectByPickColor(ZI);if(l(x))return x}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=h;h=-p,p=m}u+=h,f+=p}};zE.prototype.readCenterPixel=function(e){let t=y(e.width,1),n=y(e.height,1),o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};zE.prototype.isDestroyed=function(){return!1};zE.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var Nz=zE;function yg(){this._numSamples=1,this._colorFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new mi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new ti({color:new z(0,0,0,0),depth:1,owner:this})}function Ndt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(yg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});yg.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};yg.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};yg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};yg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};yg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};yg.prototype.isDestroyed=function(){return!1};yg.prototype.destroy=function(){return Ndt(this),ue(this)};var HE=yg;function xb(){}xb.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};xb.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Ue.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=Ue.replaceMain(o[u],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; void main() { czm_shadow_cast_main(); @@ -12927,7 +11522,7 @@ ${m?` // Draw cascade colors for debugging float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,S+=` out_FragColor.rgb *= visibility; } -`,C.push(S),new Ue({defines:T,sources:C})};var yg=xb;function Vm(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Ht.isInternetExplorer()||Ht.isEdge()||(Ht.isChrome()||Ht.isFirefox())&&Ht.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new F,this._shadowMapTexture=void 0,this._lightDirectionEC=new d,this._lightPositionEC=new oe,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new Kz,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Hr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new oe,new oe],this._cascadeMatrices=[new F,new F,new F,new F],this._cascadeDistances=new oe;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new Odt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,CX(this),this._clearCommand=new ei({depth:1,color:new z}),this._clearPassState=new Cc(t),this._size=y(e.size,2048),this.size=this._size}Vm.MAXIMUM_DISTANCE=2e4;function Odt(e){this.camera=new Kz,this.passState=new Cc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function TX(e,t){return Ve.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function CX(e){let t=!e._usesDepthTexture;e._primitiveRenderState=TX(t,e._primitiveBias),e._terrainRenderState=TX(t,e._terrainBias),e._pointRenderState=TX(t,e._pointBias)}Vm.prototype.debugCreateRenderStates=function(){CX(this)};Object.defineProperties(Vm.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){kdt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function AX(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Mdt(e,t){let n=new Qu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:dl.DEPTH_COMPONENT16}),i=new Ot({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:$t.NEAREST}),o=new zr({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Ldt(e,t){let n=new Ot({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:tt.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:$t.NEAREST}),i=new zr({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Ndt(e,t){let n=new Qu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:dl.DEPTH_COMPONENT16}),i=new wr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:$t.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new zr({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function e0e(e,t){e._isPointLight?Ndt(e,t):e._usesDepthTexture?Ldt(e,t):Mdt(e,t)}function Fdt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,CX(e),AX(e),e0e(e,t))}function Bdt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(AX(e),e0e(e,t),Fdt(e,t),t0e(e,t))}function t0e(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function kdt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Bt.maximumCubeMapSize>=t?t:Bt.maximumCubeMapSize,o.x=t,o.y=t;let r=new qe(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Bt.maximumTextureSize>=t?t:Bt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new qe(0,0,t,t)):i===4&&(t=Bt.maximumTextureSize>=t*2?t:Bt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new qe(0,0,t,t),n[1].passState.viewport=new qe(t,0,t,t),n[2].passState.viewport=new qe(0,t,t,t),n[3].passState.viewport=new qe(t,t,t,t));e._clearPassState.viewport=new qe(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,u=a.y/o.y,f=a.width/o.x,h=a.height/o.y;s.textureOffsets=new F(f,0,0,c,0,h,0,u,0,0,1,0,0,0,0,1)}}var Vdt=new qe;function Udt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,C.push(S),new Ue({defines:T,sources:C})};var xg=xb;function Um(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(zt.isInternetExplorer()||zt.isEdge()||(zt.isChrome()||zt.isFirefox())&&zt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new F,this._shadowMapTexture=void 0,this._lightDirectionEC=new d,this._lightPositionEC=new oe,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new Fz,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ae,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Hr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new oe,new oe],this._cascadeMatrices=[new F,new F,new F,new F],this._cascadeDistances=new oe;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new Fdt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,AX(this),this._clearCommand=new ti({depth:1,color:new z}),this._clearPassState=new Ac(t),this._size=y(e.size,2048),this.size=this._size}Um.MAXIMUM_DISTANCE=2e4;function Fdt(e){this.camera=new Fz,this.passState=new Ac(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function CX(e,t){return Ve.fromCache({cull:{enabled:!0,face:bi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function AX(e){let t=!e._usesDepthTexture;e._primitiveRenderState=CX(t,e._primitiveBias),e._terrainRenderState=CX(t,e._terrainBias),e._pointRenderState=CX(t,e._pointBias)}Um.prototype.debugCreateRenderStates=function(){AX(this)};Object.defineProperties(Um.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){Hdt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function EX(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Bdt(e,t){let n=new Ju({context:t,width:e._textureSize.x,height:e._textureSize.y,format:hl.DEPTH_COMPONENT16}),i=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:Zt.NEAREST}),o=new zr({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function kdt(e,t){let n=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:tt.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:Zt.NEAREST}),i=new zr({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Vdt(e,t){let n=new Ju({context:t,width:e._textureSize.x,height:e._textureSize.y,format:hl.DEPTH_COMPONENT16}),i=new wr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,sampler:Zt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new zr({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function n0e(e,t){e._isPointLight?Vdt(e,t):e._usesDepthTexture?kdt(e,t):Bdt(e,t)}function Udt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,AX(e),EX(e),n0e(e,t))}function zdt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(EX(e),n0e(e,t),Udt(e,t),i0e(e,t))}function i0e(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Hdt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Ft.maximumCubeMapSize>=t?t:Ft.maximumCubeMapSize,o.x=t,o.y=t;let r=new qe(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Ft.maximumTextureSize>=t?t:Ft.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new qe(0,0,t,t)):i===4&&(t=Ft.maximumTextureSize>=t*2?t:Ft.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new qe(0,0,t,t),n[1].passState.viewport=new qe(t,0,t,t),n[2].passState.viewport=new qe(0,t,t,t),n[3].passState.viewport=new qe(t,t,t,t));e._clearPassState.viewport=new qe(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,u=a.y/o.y,f=a.width/o.x,h=a.height/o.y;s.textureOffsets=new F(f,0,0,c,0,h,0,u,0,0,1,0,0,0,0,1)}}var Gdt=new qe;function Wdt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -12988,7 +11583,19 @@ ${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCo `:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); `} out_FragColor = vec4(vec3(shadow), 1.0); } -`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=we.OVERLAY,i}function zdt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Vdt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Udt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!qe.equals(a.renderState.viewport,s))&&(a.renderState=Ve.fromCache({viewport:qe.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Um=new Array(8);Um[0]=new oe(-1,-1,-1,1);Um[1]=new oe(1,-1,-1,1);Um[2]=new oe(1,1,-1,1);Um[3]=new oe(-1,1,-1,1);Um[4]=new oe(-1,-1,1,1);Um[5]=new oe(1,-1,1,1);Um[6]=new oe(1,1,1,1);Um[7]=new oe(-1,1,1,1);var Qy=new F,EX=new Array(8);for(let e=0;e<8;++e)EX[e]=new oe;function Hdt(e,t){let n=new wt({geometry:new Oh({minimum:new d(-.5,-.5,-.5),maximum:new d(.5,.5,.5)}),attributes:{color:Wt.fromColor(t)}}),i=new wt({geometry:new Y_({radius:.5}),attributes:{color:Wt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Gdt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],Wdt=new d;function jdt(e,t){zdt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new mg({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new mg({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new mg({camera:e._passes[i].camera,color:Gdt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Oe.IDENTITY,r=e._pointLightRadius*2,s=d.fromElements(r,r,r,Wdt),a=F.fromTranslationQuaternionRotationScale(i,o,s,Qy);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Hdt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new mg({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function Kz(){this.viewMatrix=new F,this.inverseViewMatrix=new F,this.frustum=void 0,this.positionCartographic=new fe,this.positionWC=new d,this.directionWC=d.clone(d.UNIT_Z),this.upWC=d.clone(d.UNIT_Y),this.rightWC=d.clone(d.UNIT_X),this.viewProjectionMatrix=new F}Kz.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),fe.clone(e.positionCartographic,this.positionCartographic),d.clone(e.positionWC,this.positionWC),d.clone(e.directionWC,this.directionWC),d.clone(e.upWC,this.upWC),d.clone(e.rightWC,this.rightWC)};var qdt=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);Kz.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(qdt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Ydt=new Array(5),Xdt=new Di,Kdt=new Array(4),n0e=new d,i0e=new d;function Zdt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,u=r/o,f=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,f=.9);let p=Kdt,_=Ydt;for(_[0]=o,_[s]=r,a=0;a<s;++a){let L=(a+1)/s,g=o*Math.pow(u,L),E=o+c*L,w=P.lerp(E,g,f);_[a+1]=w,p[a]=w-_[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=_[0];for(a=0;a<s-1;++a)L+=p[a],_[a+1]=L}oe.unpack(_,0,e._cascadeSplits[0]),oe.unpack(_,1,e._cascadeSplits[1]),oe.unpack(p,0,e._cascadeDistances);let m=n.frustum,x=m.left,b=m.right,T=m.bottom,C=m.top,A=m.near,S=m.far,v=n.positionWC,D=n.directionWC,O=n.upWC,R=i.frustum.clone(Xdt),M=n.getViewProjection();for(a=0;a<s;++a){R.near=_[a],R.far=_[a+1];let L=F.multiply(R.projectionMatrix,i.viewMatrix,Qy),g=F.inverse(L,Qy),E=F.multiply(M,g,Qy),w=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,n0e),I=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,i0e);for(let G=0;G<8;++G){let k=oe.clone(Um[G],EX[G]);F.multiplyByVector(E,k,k),d.divideByScalar(k,k.w,k),d.minimumByComponent(k,w,w),d.maximumByComponent(k,I,I)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let N=e._passes[a],B=N.camera;B.clone(n);let H=B.frustum;H.left=x+w.x*(b-x),H.right=x+I.x*(b-x),H.bottom=T+w.y*(C-T),H.top=T+I.y*(C-T),H.near=A+w.z*(S-A),H.far=A+I.z*(S-A),N.cullingVolume=B.frustum.computeCullingVolume(v,D,O);let V=e._cascadeMatrices[a];F.multiply(B.getViewProjection(),i.inverseViewMatrix,V),F.multiply(N.textureOffsets,V,V)}}var $dt=new F,Qdt=new d,Jdt=new d,Qye=new d;function eht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,Qy),r=F.inverse(o,Qy),s=n.directionWC,a=i.directionWC;d.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=d.cross(s,a,Qdt);a=d.cross(c,s,Jdt),d.normalize(a,a),d.normalize(c,c);let u=d.fromElements(0,0,0,Qye),f=F.computeView(u,s,a,c,$dt),h=F.multiply(f,r,Qy),p=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,n0e),_=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,i0e);for(let S=0;S<8;++S){let v=oe.clone(Um[S],EX[S]);F.multiplyByVector(h,v,v),d.divideByScalar(v,v.w,v),d.minimumByComponent(v,p,p),d.maximumByComponent(v,_,_)}_.z+=1e3,p.z-=10;let m=Qye;m.x=-(.5*(p.x+_.x)),m.y=-(.5*(p.y+_.y)),m.z=-_.z;let x=F.fromTranslation(m,Qy);f=F.multiply(x,f,f);let b=.5*(_.x-p.x),T=.5*(_.y-p.y),C=_.z-p.z,A=n.frustum;A.left=-b,A.right=b,A.bottom=-T,A.top=T,A.near=.01,A.far=C,F.clone(f,n.viewMatrix),F.inverse(f,n.inverseViewMatrix),F.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),d.clone(s,n.directionWC),d.clone(a,n.upWC),d.clone(c,n.rightWC)}var tht=[new d(-1,0,0),new d(0,-1,0),new d(0,0,-1),new d(1,0,0),new d(0,1,0),new d(0,0,1)],nht=[new d(0,-1,0),new d(0,0,-1),new d(0,-1,0),new d(0,-1,0),new d(0,0,1),new d(0,-1,0)],iht=[new d(0,0,1),new d(1,0,0),new d(-1,0,0),new d(0,0,-1),new d(1,0,0),new d(1,0,0)];function oht(e,t){let n=new Di;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=tht[i],o.upWC=nht[i],o.rightWC=iht[i],F.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),F.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var rht=new d,sht=new d,o0e=new ae,Jye=o0e.center;function aht(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=o0e;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,rht),s=d.negate(i.directionWC,sht),a=d.dot(r,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=d.add(i.positionWC,d.multiplyByScalar(i.directionWC,r,Jye),Jye);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere)}}function cht(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?d.clone(i.directionWC,r.directionWC):e._isPointLight?d.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;F.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),d.normalize(s,s),d.negate(s,s),F.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=ro.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,aht(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Vm.prototype.update=function(e){if(cht(this,e),this._needsUpdate)if(Bdt(this,e.context),this._isPointLight&&oht(this,e),this._cascadesEnabled&&(eht(this,e),this._numberOfCascades>1&&Zdt(this,e)),this._isPointLight)this._shadowMapCullingVolume=ys.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&jdt(this,e)};Vm.prototype.updatePass=function(e,t){t0e(this,e,t)};var lht=new U;function r0e(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=lht;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,oe.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return oe.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new oe,combinedUniforms2:new oe};return bt(t,o,!1)}function uht(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=$e.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===we.GLOBE,h=n.pass!==we.TRANSLUCENT,p=e._isPointLight,_=e._usesDepthTexture,m=yg.getShadowCastShaderKeyword(p,f,_,h);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!l(s)){let b=u.vertexShaderSource,T=u.fragmentShaderSource,C=yg.createShadowCastVertexShader(b,p,f),A=yg.createShadowCastFragmentShader(T,p,_,h);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ge(a,!1),a.cull=Ge(a.cull,!1),a.cull.enabled=!1,a=Ve.fromCache(a)),c=r0e(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}Vm.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===we.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;l(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=$e.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let _=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(h)||m||n||_){let x=yg.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(h=i.shaderCache.getDerivedShaderProgram(s,x),!l(h)){let b=yg.createShadowReceiveVertexShader(a,u,f),T=yg.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);h=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:b,fragmentShaderSource:T,attributeLocations:s._attributeLocations})}p=r0e(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};Vm.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=uht(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};Vm.prototype.isDestroyed=function(){return!1};Vm.prototype.destroy=function(){AX(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var Jy=Vm;var UE=`uniform sampler2D colorTexture; +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=we.OVERLAY,i}function jdt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Gdt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Wdt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!qe.equals(a.renderState.viewport,s))&&(a.renderState=Ve.fromCache({viewport:qe.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var zm=new Array(8);zm[0]=new oe(-1,-1,-1,1);zm[1]=new oe(1,-1,-1,1);zm[2]=new oe(1,1,-1,1);zm[3]=new oe(-1,1,-1,1);zm[4]=new oe(-1,-1,1,1);zm[5]=new oe(1,-1,1,1);zm[6]=new oe(1,1,1,1);zm[7]=new oe(-1,1,1,1);var Qy=new F,SX=new Array(8);for(let e=0;e<8;++e)SX[e]=new oe;function qdt(e,t){let n=new vt({geometry:new Rh({minimum:new d(-.5,-.5,-.5),maximum:new d(.5,.5,.5)}),attributes:{color:Gt.fromColor(t)}}),i=new vt({geometry:new X_({radius:.5}),attributes:{color:Gt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Ydt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],Xdt=new d;function Kdt(e,t){jdt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new pg({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new pg({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new pg({camera:e._passes[i].camera,color:Ydt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Oe.IDENTITY,r=e._pointLightRadius*2,s=d.fromElements(r,r,r,Xdt),a=F.fromTranslationQuaternionRotationScale(i,o,s,Qy);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=qdt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new pg({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function Fz(){this.viewMatrix=new F,this.inverseViewMatrix=new F,this.frustum=void 0,this.positionCartographic=new fe,this.positionWC=new d,this.directionWC=d.clone(d.UNIT_Z),this.upWC=d.clone(d.UNIT_Y),this.rightWC=d.clone(d.UNIT_X),this.viewProjectionMatrix=new F}Fz.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),fe.clone(e.positionCartographic,this.positionCartographic),d.clone(e.positionWC,this.positionWC),d.clone(e.directionWC,this.directionWC),d.clone(e.upWC,this.upWC),d.clone(e.rightWC,this.rightWC)};var Zdt=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);Fz.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(Zdt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var $dt=new Array(5),Qdt=new Ii,Jdt=new Array(4),o0e=new d,r0e=new d;function eht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,u=r/o,f=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,f=.9);let p=Jdt,_=$dt;for(_[0]=o,_[s]=r,a=0;a<s;++a){let L=(a+1)/s,g=o*Math.pow(u,L),E=o+c*L,w=P.lerp(E,g,f);_[a+1]=w,p[a]=w-_[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=_[0];for(a=0;a<s-1;++a)L+=p[a],_[a+1]=L}oe.unpack(_,0,e._cascadeSplits[0]),oe.unpack(_,1,e._cascadeSplits[1]),oe.unpack(p,0,e._cascadeDistances);let m=n.frustum,x=m.left,b=m.right,T=m.bottom,C=m.top,A=m.near,S=m.far,v=n.positionWC,D=n.directionWC,O=n.upWC,R=i.frustum.clone(Qdt),M=n.getViewProjection();for(a=0;a<s;++a){R.near=_[a],R.far=_[a+1];let L=F.multiply(R.projectionMatrix,i.viewMatrix,Qy),g=F.inverse(L,Qy),E=F.multiply(M,g,Qy),w=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,o0e),I=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,r0e);for(let G=0;G<8;++G){let k=oe.clone(zm[G],SX[G]);F.multiplyByVector(E,k,k),d.divideByScalar(k,k.w,k),d.minimumByComponent(k,w,w),d.maximumByComponent(k,I,I)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let N=e._passes[a],B=N.camera;B.clone(n);let H=B.frustum;H.left=x+w.x*(b-x),H.right=x+I.x*(b-x),H.bottom=T+w.y*(C-T),H.top=T+I.y*(C-T),H.near=A+w.z*(S-A),H.far=A+I.z*(S-A),N.cullingVolume=B.frustum.computeCullingVolume(v,D,O);let V=e._cascadeMatrices[a];F.multiply(B.getViewProjection(),i.inverseViewMatrix,V),F.multiply(N.textureOffsets,V,V)}}var tht=new F,nht=new d,iht=new d,e0e=new d;function oht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,Qy),r=F.inverse(o,Qy),s=n.directionWC,a=i.directionWC;d.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=d.cross(s,a,nht);a=d.cross(c,s,iht),d.normalize(a,a),d.normalize(c,c);let u=d.fromElements(0,0,0,e0e),f=F.computeView(u,s,a,c,tht),h=F.multiply(f,r,Qy),p=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,o0e),_=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,r0e);for(let S=0;S<8;++S){let v=oe.clone(zm[S],SX[S]);F.multiplyByVector(h,v,v),d.divideByScalar(v,v.w,v),d.minimumByComponent(v,p,p),d.maximumByComponent(v,_,_)}_.z+=1e3,p.z-=10;let m=e0e;m.x=-(.5*(p.x+_.x)),m.y=-(.5*(p.y+_.y)),m.z=-_.z;let x=F.fromTranslation(m,Qy);f=F.multiply(x,f,f);let b=.5*(_.x-p.x),T=.5*(_.y-p.y),C=_.z-p.z,A=n.frustum;A.left=-b,A.right=b,A.bottom=-T,A.top=T,A.near=.01,A.far=C,F.clone(f,n.viewMatrix),F.inverse(f,n.inverseViewMatrix),F.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),d.clone(s,n.directionWC),d.clone(a,n.upWC),d.clone(c,n.rightWC)}var rht=[new d(-1,0,0),new d(0,-1,0),new d(0,0,-1),new d(1,0,0),new d(0,1,0),new d(0,0,1)],sht=[new d(0,-1,0),new d(0,0,-1),new d(0,-1,0),new d(0,-1,0),new d(0,0,1),new d(0,-1,0)],aht=[new d(0,0,1),new d(1,0,0),new d(-1,0,0),new d(0,0,-1),new d(1,0,0),new d(1,0,0)];function cht(e,t){let n=new Ii;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=rht[i],o.upWC=sht[i],o.rightWC=aht[i],F.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),F.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var lht=new d,uht=new d,s0e=new ae,t0e=s0e.center;function fht(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=s0e;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,lht),s=d.negate(i.directionWC,uht),a=d.dot(r,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=d.add(i.positionWC,d.multiplyByScalar(i.directionWC,r,t0e),t0e);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ae.clone(o,e._boundingSphere)}}function dht(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?d.clone(i.directionWC,r.directionWC):e._isPointLight?d.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;F.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),d.normalize(s,s),d.negate(s,s),F.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=so.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,fht(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Um.prototype.update=function(e){if(dht(this,e),this._needsUpdate)if(zdt(this,e.context),this._isPointLight&&cht(this,e),this._cascadesEnabled&&(oht(this,e),this._numberOfCascades>1&&eht(this,e)),this._isPointLight)this._shadowMapCullingVolume=ys.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Kdt(this,e)};Um.prototype.updatePass=function(e,t){i0e(this,e,t)};var hht=new U;function a0e(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=hht;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,oe.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return oe.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new oe,combinedUniforms2:new oe};return xt(t,o,!1)}function mht(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=$e.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===we.GLOBE,h=n.pass!==we.TRANSLUCENT,p=e._isPointLight,_=e._usesDepthTexture,m=xg.getShadowCastShaderKeyword(p,f,_,h);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!l(s)){let b=u.vertexShaderSource,T=u.fragmentShaderSource,C=xg.createShadowCastVertexShader(b,p,f),A=xg.createShadowCastFragmentShader(T,p,_,h);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ge(a,!1),a.cull=Ge(a.cull,!1),a.cull.enabled=!1,a=Ve.fromCache(a)),c=a0e(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}Um.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===we.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;l(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=$e.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let _=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(h)||m||n||_){let x=xg.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(h=i.shaderCache.getDerivedShaderProgram(s,x),!l(h)){let b=xg.createShadowReceiveVertexShader(a,u,f),T=xg.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);h=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:b,fragmentShaderSource:T,attributeLocations:s._attributeLocations})}p=a0e(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};Um.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=mht(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};Um.prototype.isDestroyed=function(){return!1};Um.prototype.destroy=function(){EX(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var Jy=Um;var Bz=`uniform sampler2D u_opaqueDepthTexture; +uniform sampler2D u_translucentDepthTexture; + +in vec2 v_textureCoordinates; + +void main() +{ + float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; + float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; + translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); + out_FragColor = czm_packDepth(translucentDepth); +} +`;var GE=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; @@ -13019,7 +11626,7 @@ void main() out_FragColor = color; #endif } -`;var fht=!1;function e0(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ei({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ei({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new qe,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(e0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function s0e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function a0e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function dht(e,t,n,i){s0e(e),e._translucentDepthStencilTexture=new Ot({context:t,width:n,height:i,pixelFormat:tt.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:$t.NEAREST})}function hht(e,t,n,i){a0e(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function mht(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(dht(e,t,o,r),hht(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Ue({sources:[ZM]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Ue({sources:[UE]}),a={colorTexture:function(){return e._textureToComposite}},fht&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,h=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new Ue({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),_=$e.shallowClone(f);_.shaderProgram=p,f.derivedCommands.pick=_}l(e._copyCommand)||(s=new Ue({sources:[UE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Ue({sources:[UE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!qe.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,qe.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=qe.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!qe.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!qe.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,reference:Ut.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!qe.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}e0.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){mht(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};e0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(we.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[we.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[we.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};e0.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),pht(this,e,t)};function pht(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}e0.prototype.isSupported=function(){return this._supported};e0.prototype.isDestroyed=function(){return!1};e0.prototype.destroy=function(){return s0e(this),a0e(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var Zz=e0;function ght(){this.command=void 0,this.near=void 0,this.far=void 0}function $z(e,t,n){let i=e.context,o;i.depthTexture&&(o=new Wz);let r;e._useOIT&&i.depthTexture&&(r=new qz(i));let s=new Cc(i);s.viewport=qe.clone(n),this.camera=t,this._cameraClone=ro.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new Xz(i),this.pickDepthFramebuffer=new Yz,this.sceneFramebuffer=new VE,this.globeDepth=o,this.globeTranslucencyFramebuffer=new jz,this.oit=r,this.translucentTileClassification=new Zz(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var SX=new d,vX=new d;function _ht(e,t,n){let i=Math.max(d.maximumComponent(d.abs(e.position,SX)),d.maximumComponent(d.abs(t.position,vX))),o=1/Math.max(1,i);return d.multiplyByScalar(e.position,o,SX),d.multiplyByScalar(t.position,o,vX),d.equalsEpsilon(SX,vX,n)&&d.equalsEpsilon(e.direction,t.direction,n)&&d.equalsEpsilon(e.up,t.up,n)&&d.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}$z.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return _ht(t,n,P.EPSILON15)?(this._cameraStartFired&&Ci()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ci(),ro.clone(t,n),!0)};function yht(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===ne.SCENE2D,u=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=f;for(let p=0;p<f;++p){let _,m;c?(_=Math.min(i-u,n+p*u),m=Math.min(i,_+u)):(_=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*_));let x=h[p];l(x)?(x.near=_,x.far=m):x=h[p]=new Gz(_,m)}}function xht(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var c0e=new ys,bht=new Wa;$z.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let M=0;M<f.length;++M)for(let L=0;L<we.NUMBER_OF_PASSES;++L)f[M].indices[L]=0;c.length=0,u.length=0;let h=this._commandExtents,p=h.length,_=0,m=+Number.MAX_VALUE,x=-Number.MAX_VALUE,{shadowsEnabled:b}=o,T=+Number.MAX_VALUE,C=-Number.MAX_VALUE,A=Number.MAX_VALUE,S=t.mode===ne.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,D=c0e.planes;for(let M=0;M<5;++M)D[M]=v.planes[M];v=c0e;for(let M=0;M<i.length;++M){let L=i[M],{pass:g,boundingVolume:E}=L;if(g===we.COMPUTE)c.push(L);else if(g===we.OVERLAY)u.push(L);else{let w,I;if(l(E)){if(!e.isVisible(v,L,S))continue;let B=E.computePlaneDistances(r,s,bht);if(w=B.start,I=B.stop,m=Math.min(m,w),x=Math.max(x,I),b&&L.receiveShadows&&w<Jy.MAXIMUM_DISTANCE&&!(g===we.GLOBE&&w<-100&&I>100)){let H=I-w;g!==we.GLOBE&&w<100&&(A=Math.min(A,H)),T=Math.min(T,w),C=Math.max(C,I)}}else L instanceof ei?(w=a.near,I=a.far):(w=a.near,I=a.far,m=Math.min(m,w),x=Math.max(x,I));let N=h[_];l(N)||(N=h[_]=new ght),N.command=L,N.near=w,N.far=I,_++}}b&&(T=Math.min(Math.max(T,a.near),a.far),C=Math.max(Math.min(C,a.far),T),o.nearPlane=T,o.farPlane=C,o.closestObjectSize=A),yht(this,e,m,x);for(let M=0;M<_;M++)xht(this,e,h[M]);if(_<p)for(let M=_;M<p;M++){let L=h[M];if(!l(L.command))break;L.command=void 0}let O=f.length,{frustumSplits:R}=t;R.length=O+1;for(let M=0;M<O;++M)R[M]=f[M].near,M===O-1&&(R[M+1]=f[M].far)};$z.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var zE=$z;var u0e=.1,Tht=new ch({pass:Vo.MOST_DETAILED_PRELOAD}),Cht=new ch({pass:Vo.MOST_DETAILED_PICK}),XI=new ch({pass:Vo.PICK});function js(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new qe(0,0,1,1),n=new ro(e);n.frustum=new rn({width:u0e,aspectRatio:1,near:.1}),this._pickOffscreenView=new zE(e,n,t)}js.prototype.update=function(){this._pickPositionCacheDirty=!0};js.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new Hz,n[t]=i),i};var Aht=new Hr,Eht=new d,Qz=new d,Sht=new U,vht=new F;function wht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=F.clone(r.transform,vht);r._setTransform(F.IDENTITY);let h=d.clone(r.position,Eht);d.multiplyByScalar(r.right,c,Qz),d.add(Qz,h,h),d.multiplyByScalar(r.up,u,Qz),d.add(Qz,h,h),r._setTransform(f),e.mode===ne.SCENE2D&&d.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,Sht),_=Aht;return _.right=p.x*.5,_.left=-_.right,_.top=p.y*.5,_.bottom=-_.top,_.near=s.near,_.far=s.far,_.computeCullingVolume(h,r.directionWC,r.upWC)}var Dht=new Fl,Iht=new U;function Pht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,_=h*a*c,m=s.getPixelDimensions(o.width,o.height,1,1,Iht),x=m.x*n*.5,b=m.y*i*.5,T=Dht;return T.top=_+b,T.bottom=_-b,T.right=p+x,T.left=p-x,T.near=a,T.far=s.far,T.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function Jz(e,t,n,i,o){let r=e.camera.frustum;return r instanceof rn||r instanceof Hr?wht(e,t,n,i,o):Pht(e,t,n,i,o)}var e4=new qe(0,0,3,3),t4=new U,KI=new z(0,0,0,0);function wX(e,t,n,i,o){return o.width=y(n,3),o.height=y(i,o.width),o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}js.prototype.pick=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=qe.clone(a,u.viewport);let f=zi.transformWindowToDrawingBuffer(e,t,t4),h=wX(o.drawingBufferHeight,f,n,i,e4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=Jz(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=XI,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(h,a),e.updateAndExecuteCommands(u,KI),e.resolveFramebuffers(u);let p=c.end(h);return o.endFrame(),p};js.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=qe.clone(a,u.viewport);let f=zi.transformWindowToDrawingBuffer(e,t,t4),h=wX(o.drawingBufferHeight,f,n,i,e4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=Jz(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=XI,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(h,a),e.updateAndExecuteCommands(u,KI),e.resolveFramebuffers(u);let p=c.readCenterPixel(h);return o.endFrame(),p};js.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=qe.clone(s,c.viewport);let u=zi.transformWindowToDrawingBuffer(e,t,t4),f=wX(i.drawingBufferHeight,u,1,1,e4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=Jz(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=XI,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,KI);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=h;let p=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,zz.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function Rht(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=qe.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=Jz(e,t,1,1,s),o.tilesetPassState=XI,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,KI),e.resolveFramebuffers(c),i.endFrame()}var Oht=new Di,Mht=new Fl,Lht=new rn,Nht=new Hr;js.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return d.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let u=zi.transformWindowToDrawingBuffer(e,t,t4);e.pickTranslucentDepth?Rht(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(Oht):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(Mht):l(s.frustum.width)?f=s.frustum.clone(Lht):f=s.frustum.clone(Nht);let{frustumCommandsList:h}=a,p=h.length;for(let _=0;_<p;++_){let x=this.getPickDepth(e,_).getDepth(o,u.x,u.y);if(l(x)&&x>0&&x<1){let b=h[_],T;return e.mode===ne.SCENE2D?(T=s.position.z,s.position.z=T-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,c.update(r),c.updateFrustum(f)):(f.near=b.near*(_!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,c.updateFrustum(f)),n=zi.drawingBufferToWorldCoordinates(e,u,x,n),e.mode===ne.SCENE2D&&(s.position.z=T,c.update(r)),this._pickPositionCache[i]=d.clone(n),n}}this._pickPositionCache[i]=void 0};var Fht=new fe;js.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){d.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,Fht);o.cartographicToCartesian(r,n)}return n};function f0e(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,h=c.exclude;if(l(f)&&!l(u)){o.push(c);break}if(!l(u)||!l(u.primitive)||!h&&(o.push(c),0>=--e))break;let p=u.primitive,_=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(_=!0,i.show=yn.toValue(!1,i.show),s.push(i))),u instanceof $s&&(_=!0,u.show=!1,a.push(u)),_||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=yn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}js.prototype.drillPick=function(e,t,n,i,o){let r=this;return f0e(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var l0e=new d,Bht=new d;function kht(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function d0e(e,t,n,i){let o=t.direction,r=d.mostOrthogonalAxis(o,l0e),s=d.cross(o,r,l0e),a=d.cross(o,s,Bht);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,u0e),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Vht(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=d0e(e,o,r,a),u=Tht;u.camera=a,u.cullingVolume=c;let f=!0,h=s.length;for(let p=0;p<h;++p){let _=s[p];_.show&&t.primitives.contains(_)&&(_.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}js.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Vht(this,e,t[n])&&t.splice(n--,1)};function h0e(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof mu&&h0e(o,t,n))}}function n4(e,t,n,i,o,r){let s=[];if(h0e(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new kht(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Uht(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function zht(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,d0e(e,n,o,f.camera);let h=qe.clone(f.viewport,e4),p=f.pickFramebuffer.begin(h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=Cht:c.tilesetPassState=XI,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,KI),t.resolveFramebuffers(p);let _,m=f.pickFramebuffer.end(h);if(t.context.depthTexture){let{frustumCommandsList:x}=f,b=x.length;for(let T=0;T<b;++T){let A=e.getPickDepth(t,T).getDepth(a,0,0);if(l(A)&&A>0&&A<1){let S=x[T],v=S.near*(T!==0?t.opaqueFrustumNearOffset:1),D=S.far,O=v+A*(D-v);_=pn.getPoint(n,O);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(_))return{object:m,position:_,exclude:!l(_)&&r||Uht(m,i)}}function m0e(e,t,n,i,o,r,s,a){return f0e(i,function(){return zht(e,t,n,o,r,s,a)})}function HE(e,t,n,i,o,r,s){let a=m0e(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function p0e(e,t,n,i,o,r,s,a){return m0e(e,t,n,i,o,r,s,a)}function i4(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}js.prototype.pickFromRay=function(e,t,n,i){return HE(this,e,t,n,i,!1,!1)};js.prototype.drillPickFromRay=function(e,t,n,i,o){return p0e(this,e,t,n,i,o,!1,!1)};js.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=pn.clone(t),n=l(n)?n.slice():n,i4(e,n4(o,e,t,n,i,function(){return HE(o,e,t,n,i,!1,!0)}))};js.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=pn.clone(t),i=l(i)?i.slice():i,i4(e,n4(r,e,t,i,o,function(){return p0e(r,e,t,n,i,o,!1,!0)}))};var Hht=new d,Ght=new d,Wht=new pn,g0e=new fe;function DX(e,t){let n=e.ellipsoid,i=li._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,Ght),r=fe.toCartesian(t,n,Hht),s=Wht;s.origin=r,s.direction=o;let a=new pn;return pn.getPoint(s,i,a.origin),d.negate(o,a.direction),a}function _0e(e,t){let n=e.ellipsoid,i=fe.fromCartesian(t,n,g0e);return DX(e,i)}function y0e(e,t){let n=e.ellipsoid;return fe.fromCartesian(t,n,g0e).height}function jht(e,t,n,i,o){let r=DX(t,n);return n4(e,t,r,i,o,function(){let s=HE(e,t,r,i,o,!0,!0);if(l(s))return y0e(t,s.position)})}function qht(e,t,n,i,o,r){let s=_0e(t,n);return n4(e,t,s,i,o,function(){let a=HE(e,t,s,i,o,!0,!0);if(l(a))return d.clone(a.position,r)})}js.prototype.sampleHeight=function(e,t,n,i){let o=DX(e,t),r=HE(this,e,o,n,i,!0,!1);if(l(r))return y0e(e,r.position)};js.prototype.clampToHeight=function(e,t,n,i,o){let r=_0e(e,t),s=HE(this,e,r,n,i,!0,!1);if(l(s))return d.clone(s.position,o)};js.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=jht(this,e,t[s],n,i);return i4(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};js.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=qht(this,e,t[s],n,i,t[s]);return i4(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};js.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var o4=js;var r4=`uniform sampler2D colorTexture; +`;var pht=!1;function e0(e){this._drawClassificationFBO=new mi({createDepthAttachments:!1}),this._accumulationFBO=new mi({createDepthAttachments:!1}),this._packFBO=new mi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ti({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ti({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new qe,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(e0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function c0e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function l0e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function ght(e,t,n,i){c0e(e),e._translucentDepthStencilTexture=new Rt({context:t,width:n,height:i,pixelFormat:tt.DEPTH_STENCIL,pixelDatatype:Ke.UNSIGNED_INT_24_8,sampler:Zt.NEAREST})}function _ht(e,t,n,i){l0e(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function yht(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(ght(e,t,o,r),_ht(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Ue({sources:[Bz]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Ue({sources:[GE]}),a={colorTexture:function(){return e._textureToComposite}},pht&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,h=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new Ue({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),_=$e.shallowClone(f);_.shaderProgram=p,f.derivedCommands.pick=_}l(e._copyCommand)||(s=new Ue({sources:[GE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Ue({sources:[GE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!qe.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,qe.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=qe.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!qe.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!qe.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,reference:Vt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!qe.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:ln.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}e0.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){yht(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};e0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(we.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[we.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[we.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};e0.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),xht(this,e,t)};function xht(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}e0.prototype.isSupported=function(){return this._supported};e0.prototype.isDestroyed=function(){return!1};e0.prototype.destroy=function(){return c0e(this),l0e(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var kz=e0;function bht(){this.command=void 0,this.near=void 0,this.far=void 0}function Vz(e,t,n){let i=e.context,o;i.depthTexture&&(o=new Pz);let r;e._useOIT&&i.depthTexture&&(r=new Mz(i));let s=new Ac(i);s.viewport=qe.clone(n),this.camera=t,this._cameraClone=so.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new Nz(i),this.pickDepthFramebuffer=new Lz,this.sceneFramebuffer=new HE,this.globeDepth=o,this.globeTranslucencyFramebuffer=new Rz,this.oit=r,this.translucentTileClassification=new kz(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var vX=new d,wX=new d;function Tht(e,t,n){let i=Math.max(d.maximumComponent(d.abs(e.position,vX)),d.maximumComponent(d.abs(t.position,wX))),o=1/Math.max(1,i);return d.multiplyByScalar(e.position,o,vX),d.multiplyByScalar(t.position,o,wX),d.equalsEpsilon(vX,wX,n)&&d.equalsEpsilon(e.direction,t.direction,n)&&d.equalsEpsilon(e.up,t.up,n)&&d.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}Vz.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Tht(t,n,P.EPSILON15)?(this._cameraStartFired&&Ai()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ai(),so.clone(t,n),!0)};function Cht(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===ne.SCENE2D,u=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=f;for(let p=0;p<f;++p){let _,m;c?(_=Math.min(i-u,n+p*u),m=Math.min(i,_+u)):(_=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*_));let x=h[p];l(x)?(x.near=_,x.far=m):x=h[p]=new Iz(_,m)}}function Aht(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var u0e=new ys,Eht=new ja;Vz.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let M=0;M<f.length;++M)for(let L=0;L<we.NUMBER_OF_PASSES;++L)f[M].indices[L]=0;c.length=0,u.length=0;let h=this._commandExtents,p=h.length,_=0,m=+Number.MAX_VALUE,x=-Number.MAX_VALUE,{shadowsEnabled:b}=o,T=+Number.MAX_VALUE,C=-Number.MAX_VALUE,A=Number.MAX_VALUE,S=t.mode===ne.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,D=u0e.planes;for(let M=0;M<5;++M)D[M]=v.planes[M];v=u0e;for(let M=0;M<i.length;++M){let L=i[M],{pass:g,boundingVolume:E}=L;if(g===we.COMPUTE)c.push(L);else if(g===we.OVERLAY)u.push(L);else{let w,I;if(l(E)){if(!e.isVisible(v,L,S))continue;let B=E.computePlaneDistances(r,s,Eht);if(w=B.start,I=B.stop,m=Math.min(m,w),x=Math.max(x,I),b&&L.receiveShadows&&w<Jy.MAXIMUM_DISTANCE&&!(g===we.GLOBE&&w<-100&&I>100)){let H=I-w;g!==we.GLOBE&&w<100&&(A=Math.min(A,H)),T=Math.min(T,w),C=Math.max(C,I)}}else L instanceof ti?(w=a.near,I=a.far):(w=a.near,I=a.far,m=Math.min(m,w),x=Math.max(x,I));let N=h[_];l(N)||(N=h[_]=new bht),N.command=L,N.near=w,N.far=I,_++}}b&&(T=Math.min(Math.max(T,a.near),a.far),C=Math.max(Math.min(C,a.far),T),o.nearPlane=T,o.farPlane=C,o.closestObjectSize=A),Cht(this,e,m,x);for(let M=0;M<_;M++)Aht(this,e,h[M]);if(_<p)for(let M=_;M<p;M++){let L=h[M];if(!l(L.command))break;L.command=void 0}let O=f.length,{frustumSplits:R}=t;R.length=O+1;for(let M=0;M<O;++M)R[M]=f[M].near,M===O-1&&(R[M+1]=f[M].far)};Vz.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var WE=Vz;var d0e=.1,Sht=new ch({pass:Uo.MOST_DETAILED_PRELOAD}),vht=new ch({pass:Uo.MOST_DETAILED_PICK}),$I=new ch({pass:Uo.PICK});function js(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new qe(0,0,1,1),n=new so(e);n.frustum=new nn({width:d0e,aspectRatio:1,near:.1}),this._pickOffscreenView=new WE(e,n,t)}js.prototype.update=function(){this._pickPositionCacheDirty=!0};js.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new Dz,n[t]=i),i};var wht=new Hr,Dht=new d,Uz=new d,Iht=new U,Pht=new F;function Rht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=F.clone(r.transform,Pht);r._setTransform(F.IDENTITY);let h=d.clone(r.position,Dht);d.multiplyByScalar(r.right,c,Uz),d.add(Uz,h,h),d.multiplyByScalar(r.up,u,Uz),d.add(Uz,h,h),r._setTransform(f),e.mode===ne.SCENE2D&&d.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,Iht),_=wht;return _.right=p.x*.5,_.left=-_.right,_.top=p.y*.5,_.bottom=-_.top,_.near=s.near,_.far=s.far,_.computeCullingVolume(h,r.directionWC,r.upWC)}var Oht=new kl,Mht=new U;function Lht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,_=h*a*c,m=s.getPixelDimensions(o.width,o.height,1,1,Mht),x=m.x*n*.5,b=m.y*i*.5,T=Oht;return T.top=_+b,T.bottom=_-b,T.right=p+x,T.left=p-x,T.near=a,T.far=s.far,T.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function zz(e,t,n,i,o){let r=e.camera.frustum;return r instanceof nn||r instanceof Hr?Rht(e,t,n,i,o):Lht(e,t,n,i,o)}var Hz=new qe(0,0,3,3),Gz=new U,QI=new z(0,0,0,0);function DX(e,t,n,i,o){return o.width=y(n,3),o.height=y(i,o.width),o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}js.prototype.pick=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=qe.clone(a,u.viewport);let f=zi.transformWindowToDrawingBuffer(e,t,Gz),h=DX(o.drawingBufferHeight,f,n,i,Hz);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=zz(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=$I,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(h,a),e.updateAndExecuteCommands(u,QI),e.resolveFramebuffers(u);let p=c.end(h);return o.endFrame(),p};js.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=qe.clone(a,u.viewport);let f=zi.transformWindowToDrawingBuffer(e,t,Gz),h=DX(o.drawingBufferHeight,f,n,i,Hz);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=zz(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=$I,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(h,a),e.updateAndExecuteCommands(u,QI),e.resolveFramebuffers(u);let p=c.readCenterPixel(h);return o.endFrame(),p};js.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=qe.clone(s,c.viewport);let u=zi.transformWindowToDrawingBuffer(e,t,Gz),f=DX(i.drawingBufferHeight,u,1,1,Hz);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=zz(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=$I,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,QI);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=h;let p=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,wz.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function Nht(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=qe.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=zz(e,t,1,1,s),o.tilesetPassState=$I,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,QI),e.resolveFramebuffers(c),i.endFrame()}var Fht=new Ii,Bht=new kl,kht=new nn,Vht=new Hr;js.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return d.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let u=zi.transformWindowToDrawingBuffer(e,t,Gz);e.pickTranslucentDepth?Nht(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(Fht):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(Bht):l(s.frustum.width)?f=s.frustum.clone(kht):f=s.frustum.clone(Vht);let{frustumCommandsList:h}=a,p=h.length;for(let _=0;_<p;++_){let x=this.getPickDepth(e,_).getDepth(o,u.x,u.y);if(l(x)&&x>0&&x<1){let b=h[_],T;return e.mode===ne.SCENE2D?(T=s.position.z,s.position.z=T-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,c.update(r),c.updateFrustum(f)):(f.near=b.near*(_!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,c.updateFrustum(f)),n=zi.drawingBufferToWorldCoordinates(e,u,x,n),e.mode===ne.SCENE2D&&(s.position.z=T,c.update(r)),this._pickPositionCache[i]=d.clone(n),n}}this._pickPositionCache[i]=void 0};var Uht=new fe;js.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ne.SCENE3D){d.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,Uht);o.cartographicToCartesian(r,n)}return n};function h0e(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let u=c.object,f=c.position,h=c.exclude;if(l(f)&&!l(u)){o.push(c);break}if(!l(u)||!l(u.primitive)||!h&&(o.push(c),0>=--e))break;let p=u.primitive,_=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),l(i)&&l(i.show)&&(_=!0,i.show=yn.toValue(!1,i.show),s.push(i))),u instanceof Js&&(_=!0,u.show=!1,a.push(u)),_||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=yn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}js.prototype.drillPick=function(e,t,n,i,o){let r=this;return h0e(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var f0e=new d,zht=new d;function Hht(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function m0e(e,t,n,i){let o=t.direction,r=d.mostOrthogonalAxis(o,f0e),s=d.cross(o,r,f0e),a=d.cross(o,s,zht);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,d0e),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Ght(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=m0e(e,o,r,a),u=Sht;u.camera=a,u.cullingVolume=c;let f=!0,h=s.length;for(let p=0;p<h;++p){let _=s[p];_.show&&t.primitives.contains(_)&&(_.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}js.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Ght(this,e,t[n])&&t.splice(n--,1)};function p0e(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof pu&&p0e(o,t,n))}}function Wz(e,t,n,i,o,r){let s=[];if(p0e(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Hht(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Wht(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function jht(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,m0e(e,n,o,f.camera);let h=qe.clone(f.viewport,Hz),p=f.pickFramebuffer.begin(h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=vht:c.tilesetPassState=$I,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,QI),t.resolveFramebuffers(p);let _,m=f.pickFramebuffer.end(h);if(t.context.depthTexture){let{frustumCommandsList:x}=f,b=x.length;for(let T=0;T<b;++T){let A=e.getPickDepth(t,T).getDepth(a,0,0);if(l(A)&&A>0&&A<1){let S=x[T],v=S.near*(T!==0?t.opaqueFrustumNearOffset:1),D=S.far,O=v+A*(D-v);_=pn.getPoint(n,O);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(_))return{object:m,position:_,exclude:!l(_)&&r||Wht(m,i)}}function g0e(e,t,n,i,o,r,s,a){return h0e(i,function(){return jht(e,t,n,o,r,s,a)})}function jE(e,t,n,i,o,r,s){let a=g0e(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function _0e(e,t,n,i,o,r,s,a){return g0e(e,t,n,i,o,r,s,a)}function jz(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}js.prototype.pickFromRay=function(e,t,n,i){return jE(this,e,t,n,i,!1,!1)};js.prototype.drillPickFromRay=function(e,t,n,i,o){return _0e(this,e,t,n,i,o,!1,!1)};js.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=pn.clone(t),n=l(n)?n.slice():n,jz(e,Wz(o,e,t,n,i,function(){return jE(o,e,t,n,i,!1,!0)}))};js.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=pn.clone(t),i=l(i)?i.slice():i,jz(e,Wz(r,e,t,i,o,function(){return _0e(r,e,t,n,i,o,!1,!0)}))};var qht=new d,Yht=new d,Xht=new pn,y0e=new fe;function IX(e,t){let n=e.ellipsoid,i=ui._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,Yht),r=fe.toCartesian(t,n,qht),s=Xht;s.origin=r,s.direction=o;let a=new pn;return pn.getPoint(s,i,a.origin),d.negate(o,a.direction),a}function x0e(e,t){let n=e.ellipsoid,i=fe.fromCartesian(t,n,y0e);return IX(e,i)}function b0e(e,t){let n=e.ellipsoid;return fe.fromCartesian(t,n,y0e).height}function Kht(e,t,n,i,o){let r=IX(t,n);return Wz(e,t,r,i,o,function(){let s=jE(e,t,r,i,o,!0,!0);if(l(s))return b0e(t,s.position)})}function Zht(e,t,n,i,o,r){let s=x0e(t,n);return Wz(e,t,s,i,o,function(){let a=jE(e,t,s,i,o,!0,!0);if(l(a))return d.clone(a.position,r)})}js.prototype.sampleHeight=function(e,t,n,i){let o=IX(e,t),r=jE(this,e,o,n,i,!0,!1);if(l(r))return b0e(e,r.position)};js.prototype.clampToHeight=function(e,t,n,i,o){let r=x0e(e,t),s=jE(this,e,r,n,i,!0,!1);if(l(s))return d.clone(s.position,o)};js.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Kht(this,e,t[s],n,i);return jz(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};js.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Zht(this,e,t[s],n,i,t[s]);return jz(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};js.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var qz=js;var Yz=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13044,7 +11651,7 @@ void main() out_FragColor = vec4(color, fragmentColor.a); } -`;var s4=`precision highp float; +`;var Xz=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; @@ -13188,7 +11795,7 @@ void main(void) ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var a4=`uniform sampler2D colorTexture; +`;var Kz=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -13199,7 +11806,7 @@ void main(void) vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var c4=`uniform sampler2D colorTexture; +`;var Zz=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; @@ -13218,7 +11825,7 @@ void main(void) darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var l4=`uniform sampler2D colorTexture; +`;var $z=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; @@ -13238,7 +11845,7 @@ void main(void) vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var u4=`uniform sampler2D colorTexture; +`;var Qz=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; @@ -13249,7 +11856,7 @@ void main(void) vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var f4=`uniform sampler2D colorTexture; +`;var Jz=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; @@ -13266,7 +11873,7 @@ void main(void) sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); out_FragColor = vec4(sceneColor, 1.0); } -`;var d4=`uniform sampler2D colorTexture; +`;var e4=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -13305,7 +11912,7 @@ void main(void) float d = computeDepthBlur(-posInCamera.z); out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); } -`;var h4=`uniform sampler2D depthTexture; +`;var t4=`uniform sampler2D depthTexture; in vec2 v_textureCoordinates; @@ -13314,7 +11921,7 @@ void main(void) float depth = czm_readDepth(depthTexture, v_textureCoordinates); out_FragColor = vec4(vec3(depth), 1.0); } -`;var m4=`uniform sampler2D depthTexture; +`;var n4=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; @@ -13374,7 +11981,7 @@ void main(void) float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } -`;var p4=`uniform sampler2D colorTexture; +`;var i4=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13414,7 +12021,7 @@ void main() c = czm_inverseGamma(c / w); out_FragColor = vec4(c, fragmentColor.a); } -`;var g4=`uniform sampler2D colorTexture; +`;var o4=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13439,7 +12046,7 @@ void main() out_FragColor = vec4(color, fragmentColor.a); } -`;var _4=`in vec2 v_textureCoordinates; +`;var r4=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; @@ -13507,7 +12114,7 @@ void main() out_FragColor = result; } -`;var y4=`uniform sampler2D colorTexture; +`;var s4=`uniform sampler2D colorTexture; uniform sampler2D dirtTexture; uniform sampler2D starTexture; uniform vec2 dirtTextureDimensions; @@ -13660,7 +12267,7 @@ void main(void) out_FragColor = result; } -`;var x4=`uniform sampler2D colorTexture; +`;var a4=`uniform sampler2D colorTexture; uniform vec3 white; in vec2 v_textureCoordinates; @@ -13688,7 +12295,7 @@ void main() color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var b4=`uniform sampler2D colorTexture; +`;var c4=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13704,7 +12311,7 @@ void main(void) vec3 green = vec3(0.0, 1.0, 0.0); out_FragColor = vec4((noiseValue + rgb) * green, 1.0); } -`;var T4=`uniform sampler2D colorTexture; +`;var l4=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -13731,7 +12338,7 @@ void main() color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var C4=`uniform sampler2D colorTexture; +`;var u4=`uniform sampler2D colorTexture; uniform sampler2D silhouetteTexture; in vec2 v_textureCoordinates; @@ -13742,7 +12349,682 @@ void main(void) vec4 color = texture(colorTexture, v_textureCoordinates); out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); } -`;function Tb(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new U,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(Tb.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function x0e(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Yht(e,t){x0e(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new hi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function b0e(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Xht(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function Kht(e,t){let n=`uniform sampler2D colorTexture; +`;/** + * @license + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */var f4=`/** + * @license + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples +// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h + +// Steps used to integrate into Cesium: +// * The following defines are set: +// #define FXAA_PC 1 +// #define FXAA_WEBGL_1 1 +// #define FXAA_GREEN_AS_LUMA 1 +// #define FXAA_EARLY_EXIT 1 +// #define FXAA_GLSL_120 1 +// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. +// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace +// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. +// * There are no implicit conversions from ivec* to vec* so replace: +// #define FxaaInt2 ivec2 +// with +// #define FxaaInt2 vec2 +// * The texture2DLod function is only available in vertex shaders so replace: +// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) +// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) +// with +// #define FxaaTexTop(t, p) texture(t, p) +// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) +// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. +// * The following parameters to FxaaPixelShader are unused and can be removed: +// fxaaConsolePosPos +// fxaaConsoleRcpFrameOpt +// fxaaConsoleRcpFrameOpt2 +// fxaaConsole360RcpFrameOpt2 +// fxaaConsoleEdgeSharpness +// fxaaConsoleEdgeThreshold +// fxaaConsoleEdgeThresholdMi +// fxaaConsole360ConstDir + +// +// Choose the quality preset. +// This needs to be compiled into the shader as it effects code. +// Best option to include multiple presets is to +// in each shader define the preset, then include this file. +// +// OPTIONS +// ----------------------------------------------------------------------- +// 10 to 15 - default medium dither (10=fastest, 15=highest quality) +// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) +// 39 - no dither, very expensive +// +// NOTES +// ----------------------------------------------------------------------- +// 12 = slightly faster then FXAA 3.9 and higher edge quality (default) +// 13 = about same speed as FXAA 3.9 and better than 12 +// 23 = closest to FXAA 3.9 visually and performance wise +// _ = the lowest digit is directly related to performance +// _ = the highest digit is directly related to style +// +//#define FXAA_QUALITY_PRESET 12 + + +#if (FXAA_QUALITY_PRESET == 10) + #define FXAA_QUALITY_PS 3 + #define FXAA_QUALITY_P0 1.5 + #define FXAA_QUALITY_P1 3.0 + #define FXAA_QUALITY_P2 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 11) + #define FXAA_QUALITY_PS 4 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 3.0 + #define FXAA_QUALITY_P3 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 12) + #define FXAA_QUALITY_PS 5 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 4.0 + #define FXAA_QUALITY_P4 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 13) + #define FXAA_QUALITY_PS 6 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 4.0 + #define FXAA_QUALITY_P5 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 14) + #define FXAA_QUALITY_PS 7 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 4.0 + #define FXAA_QUALITY_P6 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 15) + #define FXAA_QUALITY_PS 8 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 4.0 + #define FXAA_QUALITY_P7 12.0 +#endif +#if (FXAA_QUALITY_PRESET == 20) + #define FXAA_QUALITY_PS 3 + #define FXAA_QUALITY_P0 1.5 + #define FXAA_QUALITY_P1 2.0 + #define FXAA_QUALITY_P2 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 21) + #define FXAA_QUALITY_PS 4 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 22) + #define FXAA_QUALITY_PS 5 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 23) + #define FXAA_QUALITY_PS 6 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 24) + #define FXAA_QUALITY_PS 7 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 3.0 + #define FXAA_QUALITY_P6 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 25) + #define FXAA_QUALITY_PS 8 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 4.0 + #define FXAA_QUALITY_P7 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 26) + #define FXAA_QUALITY_PS 9 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 4.0 + #define FXAA_QUALITY_P8 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 27) + #define FXAA_QUALITY_PS 10 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 4.0 + #define FXAA_QUALITY_P9 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 28) + #define FXAA_QUALITY_PS 11 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 4.0 + #define FXAA_QUALITY_P10 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 29) + #define FXAA_QUALITY_PS 12 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.5 + #define FXAA_QUALITY_P2 2.0 + #define FXAA_QUALITY_P3 2.0 + #define FXAA_QUALITY_P4 2.0 + #define FXAA_QUALITY_P5 2.0 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 2.0 + #define FXAA_QUALITY_P10 4.0 + #define FXAA_QUALITY_P11 8.0 +#endif +#if (FXAA_QUALITY_PRESET == 39) + #define FXAA_QUALITY_PS 12 + #define FXAA_QUALITY_P0 1.0 + #define FXAA_QUALITY_P1 1.0 + #define FXAA_QUALITY_P2 1.0 + #define FXAA_QUALITY_P3 1.0 + #define FXAA_QUALITY_P4 1.0 + #define FXAA_QUALITY_P5 1.5 + #define FXAA_QUALITY_P6 2.0 + #define FXAA_QUALITY_P7 2.0 + #define FXAA_QUALITY_P8 2.0 + #define FXAA_QUALITY_P9 2.0 + #define FXAA_QUALITY_P10 4.0 + #define FXAA_QUALITY_P11 8.0 +#endif + +#define FxaaBool bool +#define FxaaFloat float +#define FxaaFloat2 vec2 +#define FxaaFloat3 vec3 +#define FxaaFloat4 vec4 +#define FxaaHalf float +#define FxaaHalf2 vec2 +#define FxaaHalf3 vec3 +#define FxaaHalf4 vec4 +#define FxaaInt2 vec2 +#define FxaaTex sampler2D + +#define FxaaSat(x) clamp(x, 0.0, 1.0) +#define FxaaTexTop(t, p) texture(t, p) +#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) + +FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } + +FxaaFloat4 FxaaPixelShader( + // + // Use noperspective interpolation here (turn off perspective interpolation). + // {xy} = center of pixel + FxaaFloat2 pos, + // + // Input color texture. + // {rgb_} = color in linear or perceptual color space + // if (FXAA_GREEN_AS_LUMA == 0) + // {___a} = luma in perceptual color space (not linear) + FxaaTex tex, + // + // Only used on FXAA Quality. + // This must be from a constant/uniform. + // {x_} = 1.0/screenWidthInPixels + // {_y} = 1.0/screenHeightInPixels + FxaaFloat2 fxaaQualityRcpFrame, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY_SUBPIX define. + // It is here now to allow easier tuning. + // Choose the amount of sub-pixel aliasing removal. + // This can effect sharpness. + // 1.00 - upper limit (softer) + // 0.75 - default amount of filtering + // 0.50 - lower limit (sharper, less sub-pixel aliasing removal) + // 0.25 - almost off + // 0.00 - completely off + FxaaFloat fxaaQualitySubpix, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define. + // It is here now to allow easier tuning. + // The minimum amount of local contrast required to apply algorithm. + // 0.333 - too little (faster) + // 0.250 - low quality + // 0.166 - default + // 0.125 - high quality + // 0.063 - overkill (slower) + FxaaFloat fxaaQualityEdgeThreshold, + // + // Only used on FXAA Quality. + // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define. + // It is here now to allow easier tuning. + // Trims the algorithm from processing darks. + // 0.0833 - upper limit (default, the start of visible unfiltered edges) + // 0.0625 - high quality (faster) + // 0.0312 - visible limit (slower) + // Special notes when using FXAA_GREEN_AS_LUMA, + // Likely want to set this to zero. + // As colors that are mostly not-green + // will appear very dark in the green channel! + // Tune by looking at mostly non-green content, + // then start at zero and increase until aliasing is a problem. + FxaaFloat fxaaQualityEdgeThresholdMin +) { +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posM; + posM.x = pos.x; + posM.y = pos.y; + FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); + #define lumaM rgbyM.y + FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); +/*--------------------------------------------------------------------------*/ + FxaaFloat maxSM = max(lumaS, lumaM); + FxaaFloat minSM = min(lumaS, lumaM); + FxaaFloat maxESM = max(lumaE, maxSM); + FxaaFloat minESM = min(lumaE, minSM); + FxaaFloat maxWN = max(lumaN, lumaW); + FxaaFloat minWN = min(lumaN, lumaW); + FxaaFloat rangeMax = max(maxWN, maxESM); + FxaaFloat rangeMin = min(minWN, minESM); + FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; + FxaaFloat range = rangeMax - rangeMin; + FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); + FxaaBool earlyExit = range < rangeMaxClamped; +/*--------------------------------------------------------------------------*/ + if(earlyExit) + return rgbyM; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); + FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNS = lumaN + lumaS; + FxaaFloat lumaWE = lumaW + lumaE; + FxaaFloat subpixRcpRange = 1.0/range; + FxaaFloat subpixNSWE = lumaNS + lumaWE; + FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; + FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNESE = lumaNE + lumaSE; + FxaaFloat lumaNWNE = lumaNW + lumaNE; + FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; + FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; +/*--------------------------------------------------------------------------*/ + FxaaFloat lumaNWSW = lumaNW + lumaSW; + FxaaFloat lumaSWSE = lumaSW + lumaSE; + FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); + FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); + FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; + FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; + FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; + FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; +/*--------------------------------------------------------------------------*/ + FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; + FxaaFloat lengthSign = fxaaQualityRcpFrame.x; + FxaaBool horzSpan = edgeHorz >= edgeVert; + FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; +/*--------------------------------------------------------------------------*/ + if(!horzSpan) lumaN = lumaW; + if(!horzSpan) lumaS = lumaE; + if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; + FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; +/*--------------------------------------------------------------------------*/ + FxaaFloat gradientN = lumaN - lumaM; + FxaaFloat gradientS = lumaS - lumaM; + FxaaFloat lumaNN = lumaN + lumaM; + FxaaFloat lumaSS = lumaS + lumaM; + FxaaBool pairN = abs(gradientN) >= abs(gradientS); + FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); + if(pairN) lengthSign = -lengthSign; + FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posB; + posB.x = posM.x; + posB.y = posM.y; + FxaaFloat2 offNP; + offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; + offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; + if(!horzSpan) posB.x += lengthSign * 0.5; + if( horzSpan) posB.y += lengthSign * 0.5; +/*--------------------------------------------------------------------------*/ + FxaaFloat2 posN; + posN.x = posB.x - offNP.x * FXAA_QUALITY_P0; + posN.y = posB.y - offNP.y * FXAA_QUALITY_P0; + FxaaFloat2 posP; + posP.x = posB.x + offNP.x * FXAA_QUALITY_P0; + posP.y = posB.y + offNP.y * FXAA_QUALITY_P0; + FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; + FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); + FxaaFloat subpixE = subpixC * subpixC; + FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); +/*--------------------------------------------------------------------------*/ + if(!pairN) lumaNN = lumaSS; + FxaaFloat gradientScaled = gradient * 1.0/4.0; + FxaaFloat lumaMM = lumaM - lumaNN * 0.5; + FxaaFloat subpixF = subpixD * subpixE; + FxaaBool lumaMLTZero = lumaMM < 0.0; +/*--------------------------------------------------------------------------*/ + lumaEndN -= lumaNN * 0.5; + lumaEndP -= lumaNN * 0.5; + FxaaBool doneN = abs(lumaEndN) >= gradientScaled; + FxaaBool doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1; + FxaaBool doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1; +/*--------------------------------------------------------------------------*/ + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 3) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 4) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 5) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 6) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 7) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 8) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 9) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 10) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 11) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; +/*--------------------------------------------------------------------------*/ + #if (FXAA_QUALITY_PS > 12) + if(doneNP) { + if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); + if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); + if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; + if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; + doneN = abs(lumaEndN) >= gradientScaled; + doneP = abs(lumaEndP) >= gradientScaled; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; + doneNP = (!doneN) || (!doneP); + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } + #endif +/*--------------------------------------------------------------------------*/ + } +/*--------------------------------------------------------------------------*/ + FxaaFloat dstN = posM.x - posN.x; + FxaaFloat dstP = posP.x - posM.x; + if(!horzSpan) dstN = posM.y - posN.y; + if(!horzSpan) dstP = posP.y - posM.y; +/*--------------------------------------------------------------------------*/ + FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; + FxaaFloat spanLength = (dstP + dstN); + FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; + FxaaFloat spanLengthRcp = 1.0/spanLength; +/*--------------------------------------------------------------------------*/ + FxaaBool directionN = dstN < dstP; + FxaaFloat dst = min(dstN, dstP); + FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; + FxaaFloat subpixG = subpixF * subpixF; + FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; + FxaaFloat subpixH = subpixG * fxaaQualitySubpix; +/*--------------------------------------------------------------------------*/ + FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; + FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); + if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; + if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; + return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); +} +`;function Tb(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new mi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new U,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(Tb.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function T0e(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function $ht(e,t){T0e(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new mi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function C0e(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Qht(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function Jht(e,t){let n=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float sampleTexture(vec2 offset) { `;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); @@ -13779,7 +13061,7 @@ void main() { color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); `),n+=` out_FragColor = vec4(color); } -`,n}function Zht(e,t){b0e(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Kht(r,i),{framebuffer:n[r].framebuffer,uniformMap:Xht(e,r)});e._commands=o}Tb.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ei({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};Tb.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Yht(this,e),Zht(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};Tb.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};Tb.prototype.isDestroyed=function(){return!1};Tb.prototype.destroy=function(){return x0e(this),b0e(this),ue(this)};var A4=Tb;var $ht={NEAREST:0,LINEAR:1},Xf=$ht;function Cb(e){e=y(e,y.EMPTY_OBJECT);let{name:t=zn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=Xf.NEAREST,pixelFormat:a=tt.RGBA,pixelDatatype:c=Ke.UNSIGNED_BYTE,clearColor:u=z.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let h=new Cc;h.scissorTest={enabled:!0,rectangle:l(f)?qe.clone(f):new qe},this._passState=h,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(Cb.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var Qht=/uniform\s+sampler2D\s+depthTexture/g;Cb.prototype._isSupported=function(e){return!Qht.test(this._fragmentShader)||e.depthTexture};function Jht(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof Ot&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Ot&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function emt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function tmt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function nmt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=emt(e,r),n[r]=Jht(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Ot||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=tmt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=bt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function imt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,n}function emt(e,t){C0e(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Jht(r,i),{framebuffer:n[r].framebuffer,uniformMap:Qht(e,r)});e._commands=o}Tb.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ti({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};Tb.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,$ht(this,e),emt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};Tb.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};Tb.prototype.isDestroyed=function(){return!1};Tb.prototype.destroy=function(){return T0e(this),C0e(this),ue(this)};var d4=Tb;var tmt={NEAREST:0,LINEAR:1},Kf=tmt;function Cb(e){e=y(e,y.EMPTY_OBJECT);let{name:t=zn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=Kf.NEAREST,pixelFormat:a=tt.RGBA,pixelDatatype:c=Ke.UNSIGNED_BYTE,clearColor:u=z.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let h=new Ac;h.scissorTest={enabled:!0,rectangle:l(f)?qe.clone(f):new qe},this._passState=h,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(Cb.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var nmt=/uniform\s+sampler2D\s+depthTexture/g;Cb.prototype._isSupported=function(e){return!nmt.test(this._fragmentShader)||e.depthTexture};function imt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof Rt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Rt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function omt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function rmt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function smt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=omt(e,r),n[r]=imt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Rt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=rmt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=xt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function amt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE uniform sampler2D czm_idTexture; uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; @@ -13803,8 +13085,8 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function omt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=imt(n,o)}let i=new Ue({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function rmt(e){let t=e._sampleMode,n,i;t===Xf.LINEAR?(n=Zt.LINEAR,i=di.LINEAR):(n=Zt.NEAREST,i=di.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new $t({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function smt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function amt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function cmt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new Ot({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],u=r[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=amt(e,u);else if(typeof u=="string"){let h=new Se({url:u});s.push(h.fetchImage().then(smt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function T0e(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof Ot&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function lmt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function umt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];l(a.pickIds)?i+=a.pickIds.length:l(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Ot({context:t,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:$t.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,u=c.length;for(let f=0;f<u;++f){let h=c[f].color;r[o]=z.floatToByte(h.red),r[o+1]=z.floatToByte(h.green),r[o+2]=z.floatToByte(h.blue),r[o+3]=z.floatToByte(h.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=z.floatToByte(c.red),r[o+1]=z.floatToByte(c.green),r[o+2]=z.floatToByte(c.blue),r[o+3]=z.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new Ot({context:t,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:$t.NEAREST})}Cb.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&T0e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=lmt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,umt(this,e),nmt(this),cmt(this,e),omt(this,e),rmt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new qe(0,0,i.width,i.height)}))),this._command.renderState=o};Cb.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,$t.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};Cb.prototype.isDestroyed=function(){return!1};Cb.prototype.destroy=function(){return T0e(this),ue(this)};var ho=Cb;function Ab(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=zn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(Ab.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});Ab.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};Ab.prototype.get=function(e){return this._stages[e]};function fmt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}Ab.prototype.update=function(e,t){this._selectedDirty=fmt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};Ab.prototype.isDestroyed=function(){return!1};Ab.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Pu=Ab;var Tr={};function IX(e){let o=`#define USE_STEP_SIZE -${bb}`,r=new ho({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Xf.LINEAR}),s=new ho({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Xf.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Pu({name:e,stages:[r,s],uniforms:a})}Tr.createBlurStage=function(){return IX("czm_blur")};Tr.createDepthOfFieldStage=function(){let e=IX("czm_depth_of_field_blur"),t=new ho({name:"czm_depth_of_field_composite",fragmentShader:d4,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Pu({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Tr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Tr.createEdgeDetectionStage=function(){let e=zn();return new ho({name:`czm_edge_detection_${e}`,fragmentShader:m4,uniforms:{length:.25,color:z.clone(z.BLACK)}})};Tr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function dmt(e){if(!l(e))return Tr.createEdgeDetectionStage();let t=new Pu({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +${e}`}function cmt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=amt(n,o)}let i=new Ue({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function lmt(e){let t=e._sampleMode,n,i;t===Kf.LINEAR?(n=Kt.LINEAR,i=hi.LINEAR):(n=Kt.NEAREST,i=hi.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Zt({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function umt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function fmt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function dmt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new Rt({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],u=r[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=fmt(e,u);else if(typeof u=="string"){let h=new Se({url:u});s.push(h.fetchImage().then(umt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function A0e(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof Rt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function hmt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function mmt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];l(a.pickIds)?i+=a.pickIds.length:l(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Rt({context:t,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:Zt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,u=c.length;for(let f=0;f<u;++f){let h=c[f].color;r[o]=z.floatToByte(h.red),r[o+1]=z.floatToByte(h.green),r[o+2]=z.floatToByte(h.blue),r[o+3]=z.floatToByte(h.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=z.floatToByte(c.red),r[o+1]=z.floatToByte(c.green),r[o+2]=z.floatToByte(c.blue),r[o+3]=z.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new Rt({context:t,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:Zt.NEAREST})}Cb.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&A0e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=hmt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,mmt(this,e),smt(this),dmt(this,e),cmt(this,e),lmt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new qe(0,0,i.width,i.height)}))),this._command.renderState=o};Cb.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,Zt.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};Cb.prototype.isDestroyed=function(){return!1};Cb.prototype.destroy=function(){return A0e(this),ue(this)};var mo=Cb;function Ab(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=zn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(Ab.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});Ab.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};Ab.prototype.get=function(e){return this._stages[e]};function pmt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}Ab.prototype.update=function(e,t){this._selectedDirty=pmt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};Ab.prototype.isDestroyed=function(){return!1};Ab.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Ru=Ab;var Tr={};function PX(e){let o=`#define USE_STEP_SIZE +${bb}`,r=new mo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Kf.LINEAR}),s=new mo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Kf.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Ru({name:e,stages:[r,s],uniforms:a})}Tr.createBlurStage=function(){return PX("czm_blur")};Tr.createDepthOfFieldStage=function(){let e=PX("czm_depth_of_field_blur"),t=new mo({name:"czm_depth_of_field_composite",fragmentShader:e4,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Ru({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Tr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Tr.createEdgeDetectionStage=function(){let e=zn();return new mo({name:`czm_edge_detection_${e}`,fragmentShader:n4,uniforms:{length:.25,color:z.clone(z.BLACK)}})};Tr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function gmt(e){if(!l(e))return Tr.createEdgeDetectionStage();let t=new Ru({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; `,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); if (edge${a}.a > 0.0) { @@ -13819,14 +13101,14 @@ void main() { ${o} } out_FragColor = color; } -`,s=new ho({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Pu({name:"czm_edge_detection_composite",stages:[t,s]})}Tr.createSilhouetteStage=function(e){let t=dmt(e),n=new ho({name:"czm_silhouette_color_edges",fragmentShader:C4,uniforms:{silhouetteTexture:t.name}});return new Pu({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Tr.isSilhouetteSupported=function(e){return e.context.depthTexture};Tr.createBloomStage=function(){let e=new ho({name:"czm_bloom_contrast_bias",fragmentShader:f4,uniforms:{contrast:128,brightness:-.3}}),t=IX("czm_bloom_blur"),n=new Pu({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new ho({name:"czm_bloom_generate_composite",fragmentShader:l4,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new Pu({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Tr.createAmbientOcclusionStage=function(){let e=new ho({name:"czm_ambient_occlusion_generate",fragmentShader:s4,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new ho({name:"czm_ambient_occlusion_composite",fragmentShader:a4,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new Pu({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Tr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var hmt=`#define FXAA_QUALITY_PRESET 39 -${oL} -${_4}`;Tr.createFXAAStage=function(){return new ho({name:"czm_FXAA",fragmentShader:hmt,sampleMode:Xf.LINEAR})};Tr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=r4,new ho({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=p4,new ho({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=g4,new ho({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=T4,new ho({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=x4,new ho({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};Tr.createAutoExposureStage=function(){return new A4};Tr.createBlackAndWhiteStage=function(){return new ho({name:"czm_black_and_white",fragmentShader:c4,uniforms:{gradations:5}})};Tr.createBrightnessStage=function(){return new ho({name:"czm_brightness",fragmentShader:u4,uniforms:{brightness:.5}})};Tr.createNightVisionStage=function(){return new ho({name:"czm_night_vision",fragmentShader:b4})};Tr.createDepthViewStage=function(){return new ho({name:"czm_depth_view",fragmentShader:h4})};Tr.createLensFlareStage=function(){return new ho({name:"czm_lens_flare",fragmentShader:y4,uniforms:{dirtTexture:nn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:nn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ee.WGS84.maximumRadius}})};var Kf=Tr;function xg(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function $I(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function PX(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[$I(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let h=e.getStageByName(f);l(h)&&(r[$I(h)]=!0)}}}return i.name}function ZI(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let h=0;h<c;++h){let p=i.get(h);l(p.length)?a=ZI(e,t,n,p,o):a=PX(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<c;++u)f=$I(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=$I(i.get(u));let h=n[f];for(let p=0;p<u;++p)h[$I(i.get(p))]=!0}return a}function mmt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=ZI(e,t,n,i,void 0);a=ZI(e,t,n,o,a),a=PX(e,t,n,r,a),a=ZI(e,t,n,e,a),PX(e,t,n,s,a)}else ZI(e,t,n,e,void 0);return n}function pmt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,h,p=e._framebuffers,_=p.length;for(f=0;f<_;++f){if(h=p[f],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||c!==h.pixelDatatype||!z.equals(u,h.clearColor))continue;let m=h.stages,x=m.length,b=!1;for(let T=0;T<x;++T)if(n[m[T]]){b=!0;break}if(!b)break}return l(h)&&f<_?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(h),h)}function gmt(e,t){let n=mmt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=pmt(e,i,n[i]))}function RX(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function _mt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),h=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(h)||(h=P.nextPowerOfTwo(h)),u=h,f=h),a.buffer.update(t,u,f),a.clear=new ei({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}xg.prototype.updateDependencies=function(){this._updateDependencies=!0};xg.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(RX(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&gmt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,RX(this),_mt(this,e))};xg.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};xg.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};xg.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};xg.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};xg.prototype.isDestroyed=function(){return!1};xg.prototype.destroy=function(){return RX(this),ue(this)};var GE=xg;var ymt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var t0=Object.freeze(ymt);var OX=[];function Qc(){let e=Kf.createFXAAStage(),t=Kf.createAmbientOcclusionStage(),n=Kf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Kf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=t0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new GE(this),r={},s=OX;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(Qc.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return MX(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case t0.REINHARD:n=Kf.createReinhardTonemappingStage(t);break;case t0.MODIFIED_REINHARD:n=Kf.createModifiedReinhardTonemappingStage(t);break;case t0.FILMIC:n=Kf.createFilmicTonemappingStage(t);break;case t0.PBR_NEUTRAL:n=Kf.createPbrNeutralTonemappingStage(t);break;default:n=Kf.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function MX(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}Qc.prototype.add=function(e){let t=this._stageNames,n=OX;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Qc.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=OX;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Qc.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Qc.prototype.get=function(e){return MX(this),this._stages[e]};Qc.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Qc.prototype.getStageByName=function(e){return this._stageNames[e]};Qc.prototype.update=function(e,t,n){MX(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let T=0;T<r.length;++T){let C=r[T];C.ready&&C.enabled&&C._isSupported(e)&&(o[s++]=C)}o.length=s;let a=s!==i.length;if(!a){for(let T=0;T<s;++T)if(o[T]!==i[T]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let _=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),x=h.enabled&&h._isSupported(e),b=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||_!==this._aoEnabled||m!==this._bloomEnabled||x!==this._tonemappingEnabled||b!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=_,this._bloomEnabled=m,this._tonemappingEnabled=x,this._fxaaEnabled=b,this._textureCacheDirty=!1),l(this._randomTexture)&&!_&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&_){let C=new Uint8Array(196608);for(let A=0;A<196608;A+=3)C[A]=Math.floor(Math.random()*255);this._randomTexture=new Ot({context:e,pixelFormat:tt.RGB,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:C,width:256,height:256},sampler:new $t({wrapS:An.REPEAT,wrapT:An.REPEAT,minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),h.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let T=0;T<r.length;++T)r[T].update(e,t);s=0;for(let T=0;T<r.length;++T){let C=r[T];C.ready&&C.enabled&&C._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};Qc.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function Eb(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Qc.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return Eb(t)};function zm(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){zm(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)zm(e.get(r),t,Eb(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)zm(e.get(r),t,n,i,o)}Qc.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,h=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),_=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!h&&!p&&!m&&r===0)return;let b=t;h&&a.ready&&(zm(a,e,b,n,i),b=Eb(a)),p&&c.ready&&(zm(c,e,b,n,i),b=Eb(c)),_&&u.ready&&zm(u,e,b,n,i),m&&f.ready&&(zm(f,e,b,n,i),b=Eb(f));let T=b;if(r>0){zm(o[0],e,b,n,i);for(let C=1;C<r;++C)zm(o[C],e,Eb(o[C-1]),n,i);T=Eb(o[r-1])}x&&s.ready&&zm(s,e,T,n,i)};Qc.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Qc.prototype.isDestroyed=function(){return!1};Qc.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var E4=Qc;var xmt={SHIFT:0,CTRL:1,ALT:2},pa=Object.freeze(xmt);var bmt={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Tn=Object.freeze(bmt);function n0(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function VX(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function Sb(e){if(e.shiftKey)return pa.SHIFT;if(e.ctrlKey)return pa.CTRL;if(e.altKey)return pa.ALT}var Is={LEFT:0,MIDDLE:1,RIGHT:2};function Ru(e,t,n,i){function o(r){i(e,r)}Ht.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Tmt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Ht.supportsPointerEvents()?(Ru(e,"pointerdown",t,wmt),Ru(e,"pointerup",t,R0e),Ru(e,"pointermove",t,Dmt),Ru(e,"pointercancel",t,R0e)):(Ru(e,"mousedown",t,O0e),Ru(e,"mouseup",n,M0e),Ru(e,"mousemove",n,L0e),Ru(e,"touchstart",t,Smt),Ru(e,"touchend",n,v0e),Ru(e,"touchmove",n,vmt),Ru(e,"touchcancel",n,v0e)),Ru(e,"dblclick",t,Amt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Ru(e,i,t,Emt)}function Cmt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var C0e={position:new U};function UX(e){e._lastSeenTouchEvent=Ci()}function zX(e){return Ci()-e._lastSeenTouchEvent>uh.mouseEmulationIgnoreMilliseconds}function kX(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function O0e(e,t){if(!zX(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Is.LEFT)i=Tn.LEFT_DOWN;else if(n===Is.MIDDLE)i=Tn.MIDDLE_DOWN;else if(n===Is.RIGHT)i=Tn.RIGHT_DOWN;else return;let o=n0(e,t,e._primaryPosition);U.clone(o,e._primaryStartPosition),U.clone(o,e._primaryPreviousPosition);let r=Sb(t),s=e.getInputAction(i,r);l(s)&&(U.clone(o,C0e.position),s(C0e),t.preventDefault())}var A0e={position:new U},E0e={position:new U};function LX(e,t,n,i){let o=Sb(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=n0(e,i,e._primaryPosition);if(l(r)&&(U.clone(a,A0e.position),r(A0e)),l(s)){let c=e._primaryStartPosition;kX(c,a,e._clickPixelTolerance)&&(U.clone(a,E0e.position),s(E0e))}}}function M0e(e,t){if(!zX(e))return;let n=t.button;n!==Is.LEFT&&n!==Is.MIDDLE&&n!==Is.RIGHT||(e._buttonDown[Is.LEFT]&&(LX(e,Tn.LEFT_UP,Tn.LEFT_CLICK,t),e._buttonDown[Is.LEFT]=!1),e._buttonDown[Is.MIDDLE]&&(LX(e,Tn.MIDDLE_UP,Tn.MIDDLE_CLICK,t),e._buttonDown[Is.MIDDLE]=!1),e._buttonDown[Is.RIGHT]&&(LX(e,Tn.RIGHT_UP,Tn.RIGHT_CLICK,t),e._buttonDown[Is.RIGHT]=!1))}var NX={startPosition:new U,endPosition:new U};function L0e(e,t){if(!zX(e))return;let n=Sb(t),i=n0(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Tn.MOUSE_MOVE,n);l(r)&&(U.clone(o,NX.startPosition),U.clone(i,NX.endPosition),r(NX)),U.clone(i,o),(e._buttonDown[Is.LEFT]||e._buttonDown[Is.MIDDLE]||e._buttonDown[Is.RIGHT])&&t.preventDefault()}var S0e={position:new U};function Amt(e,t){let n=t.button,i;if(n===Is.LEFT)i=Tn.LEFT_DOUBLE_CLICK;else return;let o=Sb(t),r=e.getInputAction(i,o);l(r)&&(n0(e,t,S0e.position),r(S0e))}function Emt(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=Sb(t),o=e.getInputAction(Tn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function Smt(e,t){UX(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,n0(e,r,new U));S4(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,U.clone(a.get(s)))}function v0e(e,t){UX(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);S4(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var w0e={position:new U},FX={position1:new U,position2:new U},D0e={position:new U},I0e={position:new U},P0e={position:new U};function S4(e,t){let n=Sb(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Is.LEFT]){if(e._buttonDown[Is.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Tn.LEFT_UP,n),l(r)&&(U.clone(e._primaryPosition,D0e.position),r(D0e)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Tn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];kX(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,I0e.position),s(I0e))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Tn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];U.clone(c,e._primaryPosition),U.clone(c,e._primaryStartPosition),U.clone(c,e._primaryPreviousPosition),e._buttonDown[Is.LEFT]=!0,r=e.getInputAction(Tn.LEFT_DOWN,n),l(r)&&(U.clone(c,w0e.position),r(w0e)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Tn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];kX(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,P0e.position),s(P0e))}},uh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Tn.PINCH_START,n),l(r)&&(U.clone(i.values[0],FX.position1),U.clone(i.values[1],FX.position2),r(FX),t.preventDefault()))}function vmt(e,t){UX(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let u=a.get(s);l(u)&&n0(e,r,u)}N0e(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,U.clone(a.get(s),c.get(s))}var BX={startPosition:new U,endPosition:new U},QI={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function N0e(e,t){let n=Sb(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Is.LEFT]){let a=i.values[0];U.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Tn.MOUSE_MOVE,n),l(s)&&(U.clone(c,BX.startPosition),U.clone(a,BX.endPosition),s(BX)),U.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Tn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],h=c.x-a.x,p=c.y-a.y,_=Math.sqrt(h*h+p*p)*.25,m=f.x-u.x,x=f.y-u.y,b=Math.sqrt(m*m+x*x)*.25,T=(c.y+a.y)*.125,C=(f.y+u.y)*.125,A=Math.atan2(p,h),S=Math.atan2(x,m);U.fromElements(0,b,QI.distance.startPosition),U.fromElements(0,_,QI.distance.endPosition),U.fromElements(S,C,QI.angleAndHeight.startPosition),U.fromElements(A,T,QI.angleAndHeight.endPosition),s(QI)}}function wmt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,n0(e,t,new U)),S4(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else O0e(e,t)}function R0e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),S4(e,t),e._previousPositions.remove(i)}else M0e(e,t)}function Dmt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;n0(e,t,o),N0e(e,t);let r=e._previousPositions;U.clone(n.get(i),r.get(i))}else L0e(e,t)}function uh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-uh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new vt,this._previousPositions=new vt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),Tmt(this)}uh.prototype.setInputAction=function(e,t,n){let i=VX(t,n);this._inputEvents[i]=e};uh.prototype.getInputAction=function(e,t){let n=VX(e,t);return this._inputEvents[n]};uh.prototype.removeInputAction=function(e,t){let n=VX(e,t);delete this._inputEvents[n]};uh.prototype.isDestroyed=function(){return!1};uh.prototype.destroy=function(){return Cmt(this),ue(this)};uh.mouseEmulationIgnoreMilliseconds=800;uh.touchHoldDelayMilliseconds=1500;var Zf=uh;function vb(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}vb.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};vb.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof rn,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?apt(this,e):mpt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Imt=new d,Pmt=new d,Rmt=new d,Omt=new d,Mmt=new d,Lmt=new d,Nmt=new d,Fmt=new fe,Bmt=new F,kmt=new Di,Vmt=new rn,Umt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};vb.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(F.IDENTITY);let i=Imt,o=Pmt,r=Rmt;if(e>0)i.x=0,i.y=-1,i.z=1,i=d.multiplyByScalar(d.normalize(i,i),5*t.maximumRadius,i),d.negate(d.normalize(i,o),o),d.cross(d.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)d.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,d.negate(d.UNIT_Z,o),d.clone(d.UNIT_Y,r);else{d.clone(u.positionWC,i),d.clone(u.directionWC,o),d.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,Nmt),h=Mt.eastNorthUpToFixedFrame(f,t,Bmt);F.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,Fmt),i),F.multiplyByPointAsVector(h,o,o),F.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=Vmt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=kmt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=Umt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=gpt(a);JI(this,c),this._previousMode===ne.SCENE2D?ppt(this,e,a,c):(a.position2D=F.multiplyByPoint(ro.TRANSFORM_2D,i,Omt),a.direction2D=F.multiplyByPointAsVector(ro.TRANSFORM_2D,o,Mmt),a.up2D=F.multiplyByPointAsVector(ro.TRANSFORM_2D,r,Lmt),n._mode=ne.MORPHING,q0e(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var WX={position:new d,direction:new d,up:new d,frustum:void 0},B0e=new Di;vb.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ne.SCENE2D)$mt(this,e,t);else{let i;e>0?(i=WX,d.fromDegrees(0,0,5*t.maximumRadius,t,i.position),d.negate(i.position,i.direction),d.normalize(i.direction,i.direction),d.clone(d.UNIT_Z,i.up)):i=k0e(this,t);let o,r=n.camera;r.frustum instanceof rn?o=r.frustum.clone():(o=B0e,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=P.toRadians(60)),i.frustum=o;let s=X0e(i);JI(this,s),GX(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};vb.prototype.isDestroyed=function(){return!1};vb.prototype.destroy=function(){return v4(this),ue(this)};function JI(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Zf(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Tn.LEFT_DOWN),e._morphHandler.setInputAction(n,Tn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Tn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Tn.WHEEL)}}function v4(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var zmt=new fe,Hmt=new d,Gmt=new F;function k0e(e,t){let n=e._scene,i=n.camera,o=WX,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,zmt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,Hmt),f=Mt.eastNorthUpToFixedFrame(u,t,Gmt);return F.multiplyByPointAsVector(f,i.direction,s),F.multiplyByPointAsVector(f,i.up,a),o}var Wmt=new d,jmt=new d,qmt=new d,Ymt=new d,Xmt=new d,Kmt=new d;function GX(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(r.position,Wmt),a=d.clone(r.direction,jmt),c=d.clone(r.up,qmt),u=F.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,n.position,Ymt),f=F.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.direction,Xmt),h=F.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.up,Kmt);function p(m){$f(s,u,m.time,r.position),$f(a,f,m.time,r.direction),$f(c,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let _=o.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Y0e(e,o,0,1,t,i)}});e._currentTweens.push(_)}var Zmt=new rn,V0e=new d,U0e=new d,z0e=new d,jX=new d,H0e=new d,G0e=new d;function $mt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=WX,d.fromDegrees(0,0,5*n.maximumRadius,n,r.position),d.negate(r.position,r.direction),d.normalize(r.direction,r.direction),d.clone(d.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=k0e(e,n));let s;e._morphToOrthographic?(s=Zmt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=B0e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),r.frustum=s;let a=X0e(r);JI(e,a);let c;e._morphToOrthographic?c=function(){GX(e,t,r,a)}:c=function(){j0e(e,t,r,function(){GX(e,t,r,a)})},t>0?(i._mode=ne.SCENE2D,o.flyTo({duration:t,destination:d.fromDegrees(0,0,5*n.maximumRadius,n,jX),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function $f(e,t,n,i){return d.lerp(e,t,n,i)}function W0e(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof rn)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let _=u/Math.tan(s.frustum.fov*.5);i(s,_)}let h=r.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var Qmt=new d,Jmt=new d,ept=new d,HX=new d,tpt=new d,npt=new d,ipt=new Hr,opt=new pn,rpt=new d,spt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function apt(e,t){t*=.5;let n=e._scene,i=n.camera,o=d.clone(i.position,Qmt),r=d.clone(i.direction,Jmt),s=d.clone(i.up,ept),a=d.negate(d.UNIT_Z,tpt),c=d.clone(d.UNIT_Y,npt),u=HX;if(t>0)d.clone(d.ZERO,HX),u.z=5*n.ellipsoid.maximumRadius;else{d.clone(o,HX);let b=opt;F.multiplyByPoint(ro.TRANSFORM_2D,o,b.origin),F.multiplyByPointAsVector(ro.TRANSFORM_2D,r,b.direction);let T=n.globe;if(l(T)){let C=T.pickWorldCoordinates(b,n,!0,rpt);l(C)&&(F.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,C,u),u.z+=d.distance(o,u))}}let f=ipt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let h=spt;h.position=u,h.direction=a,h.up=c,h.frustum=f;let p=K0e(h);JI(e,p);function _(b){$f(o,u,b.time,i.position),$f(r,a,b.time,i.direction),$f(s,c,b.time,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(b,T){b.position.z=T}let x=n.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:_,complete:function(){W0e(e,t,h,m,p)}});e._currentTweens.push(x)}var F0e=new fe,cpt={position:new d,direction:new d,up:new d,position2D:new d,direction2D:new d,up2D:new d,frustum:new Hr},lpt={position:new d,direction:new d,up:new d,frustum:void 0},upt=new d,fpt=new pn,dpt=new F,hpt=new d;function mpt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=cpt;if(t>0)d.clone(d.ZERO,r.position),r.position.z=5*n.maximumRadius,d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,F0e),i.mapProjection.project(F0e,r.position),d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);let h=fpt;d.clone(r.position2D,h.origin);let p=d.clone(o.directionWC,h.direction),_=n.scaleToGeodeticSurface(o.positionWC,hpt),m=Mt.eastNorthUpToFixedFrame(_,n,dpt);F.inverseTransformation(m,m),F.multiplyByPointAsVector(m,p,p),F.multiplyByPointAsVector(ro.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let b=x.pickWorldCoordinates(h,i,!0,upt);if(l(b)){let T=d.distance(r.position2D,b);b.x+=T,d.clone(b,r.position2D)}}}function s(h,p){h.position.x=p}F.multiplyByPoint(ro.TRANSFORM_2D,r.position,r.position2D),F.multiplyByPointAsVector(ro.TRANSFORM_2D,r.direction,r.direction2D),F.multiplyByPointAsVector(ro.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=lpt;F.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,r.position2D,c.position),d.clone(r.direction,c.direction),d.clone(r.up,c.up),c.frustum=a;let u=K0e(c);JI(e,u);function f(){W0e(e,t,r,s,u)}q0e(e,t,r,f)}function j0e(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=P.lerp(c,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(h)}function ppt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(n.position,jX),a=d.clone(n.direction,H0e),c=d.clone(n.up,G0e);o._mode=ne.MORPHING;function u(){r.frustum=n.frustum.clone();let f=d.clone(r.position,V0e),h=d.clone(r.direction,U0e),p=d.clone(r.up,z0e);f.z=s.z;function _(x){$f(f,s,x.time,r.position),$f(h,a,x.time,r.direction),$f(p,c,x.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:_,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():j0e(e,0,n,u)}function q0e(e,t,n,i){let o=e._scene,r=o.camera,s=d.clone(r.position,V0e),a=d.clone(r.direction,U0e),c=d.clone(r.up,z0e),u=d.clone(n.position2D,jX),f=d.clone(n.direction2D,H0e),h=d.clone(n.up2D,G0e);function p(m){$f(s,u,m.time,r.position),$f(a,f,m.time,r.direction),$f(c,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let _=o.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Y0e(e,o,1,0,t,i)}});e._currentTweens.push(_)}function Y0e(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:$r.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function X0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),v4(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE3D,r)}}function K0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),v4(t);let i=n.camera;d.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE2D,o)}}function gpt(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),v4(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.COLUMBUS_VIEW,r)}}var w4=vb;var _pt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Bi=Object.freeze(_pt);function qs(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function ypt(e,t){U.clone(e.distance.startPosition,t.distance.startPosition),U.clone(e.distance.endPosition,t.distance.endPosition),U.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),U.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function Z0e(e,t,n){let i=qs(Bi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new U;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new U,endPosition:new U},u.angleAndHeight={startPosition:new U,endPosition:new U},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,U.lerp(f.position1,f.position2,.5,s[i])},Tn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Tn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(ypt(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(U.clone(f.distance.endPosition,u.distance.endPosition),U.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let h=u.angleAndHeight.endPosition.x,p=u.prevAngle,_=Math.PI*2;for(;h>=p+Math.PI;)h-=_;for(;h<p-Math.PI;)h+=_;u.angleAndHeight.endPosition.x=-h*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Tn.PINCH_MOVE,t)}function $0e(e,t){let n=qs(Bi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new U,endPosition:new U,valid:!1}),s.startPosition=new U,U.clone(U.ZERO,s.startPosition),s.endPosition=new U,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,U.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Tn.WHEEL,t)}function WE(e,t,n){let i=qs(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new U;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new U,endPosition:new U,valid:!1});let c,u;n===Bi.LEFT_DRAG?(c=Tn.LEFT_DOWN,u=Tn.LEFT_UP):n===Bi.RIGHT_DRAG?(c=Tn.RIGHT_DOWN,u=Tn.RIGHT_UP):n===Bi.MIDDLE_DRAG&&(c=Tn.MIDDLE_DOWN,u=Tn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,U.clone(f.position,r[i])},c,t),e._eventHandler.setInputAction(function(){qX(qs(n,void 0),e);for(let f of Object.values(pa)){let h=qs(n,f);qX(h,e)}},u,t)}function qX(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function Q0e(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function xpt(e,t,n){let i=n._isDown,o=!1,r=qs(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==r&&(o=!0,qX(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new U,endPosition:new U,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function J0e(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Bi)if(Bi.hasOwnProperty(s)){let a=Bi[s];if(l(a)){let c=qs(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new U,endPosition:new U,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new U,endPosition:new U})}}e._eventHandler.setInputAction(function(s){for(let a in Bi)if(Bi.hasOwnProperty(a)){let c=Bi[a];if(l(c)){let u=qs(c,t);xpt(c,t,e),r[u]&&(n[u]?(Q0e(i[u],o[u]),o[u].valid=!0,Q0e(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},Tn.MOUSE_MOVE,t)}function Qf(e){this._eventHandler=new Zf(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,$0e(this,void 0),Z0e(this,void 0,e),WE(this,void 0,Bi.LEFT_DRAG),WE(this,void 0,Bi.RIGHT_DRAG),WE(this,void 0,Bi.MIDDLE_DRAG),J0e(this,void 0);for(let t in pa)if(pa.hasOwnProperty(t)){let n=pa[t];l(n)&&($0e(this,n),Z0e(this,n,e),WE(this,n,Bi.LEFT_DRAG),WE(this,n,Bi.RIGHT_DRAG),WE(this,n,Bi.MIDDLE_DRAG),J0e(this,n))}}Object.defineProperties(Qf.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[qs(Bi.WHEEL)]||!this._update[qs(Bi.WHEEL,pa.SHIFT)]||!this._update[qs(Bi.WHEEL,pa.CTRL)]||!this._update[qs(Bi.WHEEL,pa.ALT)];return this._buttonsDown>0||e}}});Qf.prototype.isMoving=function(e,t){let n=qs(e,t);return!this._update[n]};Qf.prototype.getMovement=function(e,t){let n=qs(e,t);return this._movement[n]};Qf.prototype.getLastMovement=function(e,t){let n=qs(e,t),i=this._lastMovement[n];if(i.valid)return i};Qf.prototype.isButtonDown=function(e,t){let n=qs(e,t);return this._isDown[n]};Qf.prototype.getStartMousePosition=function(e,t){if(e===Bi.WHEEL)return this._currentMousePosition;let n=qs(e,t);return this._eventStartPosition[n]};Qf.prototype.getButtonPressTime=function(e,t){let n=qs(e,t);return this._pressTime[n]};Qf.prototype.getButtonReleaseTime=function(e,t){let n=qs(e,t);return this._releaseTime[n]};Qf.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Qf.prototype.isDestroyed=function(){return!1};Qf.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var D4=Qf;function I4(e,t,n,i,o,r,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ge(n),this._stopObject=Ge(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(I4.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});I4.prototype.cancelTween=function(){this._tweens.remove(this)};function fh(){this._tweens=[]}Object.defineProperties(fh.prototype,{length:{get:function(){return this._tweens.length}}});fh.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new I4(this);let t=e.duration/jn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/jn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,$r.LINEAR_NONE),r=e.startObject,s=new Bpe(r);s.to(Ge(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new I4(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};fh.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};fh.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};fh.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};fh.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};fh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};fh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};fh.prototype.get=function(e){return this._tweens[e]};fh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/jn.SECONDS_PER_MILLISECOND:Ci();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var jE=fh;function tP(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=Bi.LEFT_DRAG,this.zoomEventTypes=[Bi.RIGHT_DRAG,Bi.WHEEL,Bi.PINCH],this.rotateEventTypes=Bi.LEFT_DRAG,this.tiltEventTypes=[Bi.MIDDLE_DRAG,Bi.PINCH,{eventType:Bi.LEFT_DRAG,modifier:pa.CTRL},{eventType:Bi.RIGHT_DRAG,modifier:pa.CTRL}],this.lookEventTypes={eventType:Bi.LEFT_DRAG,modifier:pa.SHIFT};let t=y(e.ellipsoid,ee.default);this.minimumPickingTerrainHeight=ee.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ee.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ee.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ee.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new D4(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new jE,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new U(-1,-1),this._tiltCenter=new d,this._rotateMousePosition=new U(-1,-1),this._rotateStartPosition=new d,this._strafeStartPosition=new d,this._strafeMousePosition=new U,this._strafeEndMousePosition=new U,this._zoomMouseStart=new U(-1,-1),this._zoomWorldPosition=new d,this._useZoomWorldPosition=!1,this._panLastMousePosition=new U,this._panLastWorldPosition=new d,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new fe(Math.PI,P.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function bpt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Tpt(e){return U.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var Cpt=.4;function Apt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new U,endPosition:new U,motion:new U,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<Cpt){let _=bpt(p,i),m=e.getLastMovement(t,n);if(!l(m)||Tpt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=U.clone(m.startPosition,a.startPosition),a.endPosition=U.multiplyByScalar(a.motion,_,a.endPosition),a.endPosition=U.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||U.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function Ept(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var exe=[];function Jc(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(exe[0]=n,n=exe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,h=u.modifier,p=s.isMoving(f,h)&&s.getMovement(f,h),_=s.getStartMousePosition(f,h);e.enableInputs&&t&&(p?(i(e,_,p),Ept(e,r)):o<1&&Apt(s,f,h,o,i,e,r))}}var P4=new pn,Spt=new d,vpt=new U,wpt=new d,Dpt=new U,Ipt=new d,Ppt=new d,Rpt=new d,Opt=new d,dxe=new d,Mpt=new d,Lpt=new d,Npt=new d,Fpt=new d,Bpt=new d,kpt=new d,Vpt=new d,Upt=new d,zpt=new d,Hpt=new d,wb=new d,txe=new d,nxe=new d,YX={orientation:new Ha};function tK(e,t,n,i,o,r){let s=1;l(r)&&(s=P.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,h=o-u,p=i*h;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let _=a/e._scene.canvas.clientHeight;_=Math.min(_,e.maximumMovementRatio);let m=p*_;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let x=e._scene,b=x.camera,T=x.mode,C=YX.orientation;if(C.heading=b.heading,C.pitch=b.pitch,C.roll=b.roll,b.frustum instanceof rn){Math.abs(m)>0&&(b.zoomIn(m),b._adjustOrthographicFrustum(!0));return}let A=y(n.inertiaEnabled,U.equals(t,e._zoomMouseStart)),S=e._zoomingOnVector,v=e._rotatingZoom,D;if(A||(e._zoomMouseStart=U.clone(t,e._zoomMouseStart),l(e._globe)&&T===ne.SCENE2D?(D=b.getPickRay(t,P4).origin,D=d.fromElements(D.y,D.z,D.x)):l(e._globe)&&(D=bg(e,t,Spt)),l(D)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=d.clone(D,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(m);return}let O=T===ne.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!A||v){if(T===ne.SCENE2D){let R=e._zoomWorldPosition,M=b.position;if(!d.equals(R,M)&&b.positionCartographic.height<e._maxCoord.x*2){let L=b.position.x,g=d.subtract(R,M,wpt);d.normalize(g,g);let E=d.distance(R,M)*m/(b.getMagnitude()*.5);b.move(g,E*.5),(b.position.x<0&&L>0||b.position.x>0&&L<0)&&(D=b.getPickRay(t,P4).origin,D=d.fromElements(D.y,D.z,D.x),e._zoomWorldPosition=d.clone(D,e._zoomWorldPosition))}}else if(T===ne.SCENE3D){let R=d.normalize(b.position,dxe);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(d.dot(b.direction,R))<.6)O=!0;else{let M=x.canvas,L=Dpt;L.x=M.clientWidth/2,L.y=M.clientHeight/2;let g=bg(e,L,Ipt);if(!l(g))O=!0;else if(b.positionCartographic.height<1e6)if(d.dot(b.direction,R)>=-.5)O=!0;else{let E=Lpt;d.clone(b.position,E);let w=e._zoomWorldPosition,I=Mpt;if(I=d.normalize(w,I),d.dot(I,R)<0)return;let N=Hpt,B=Bpt;d.clone(b.direction,B),d.add(E,d.multiplyByScalar(B,1e3,wb),N);let H=kpt,V=Vpt;d.subtract(w,E,H),d.normalize(H,V);let G=d.dot(R,V);if(G>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-G),W=d.magnitude(E),Y=d.magnitude(w),J=W-m,j=d.magnitude(H),K=Math.asin(P.clamp(j/Y*Math.sin(k),-1,1)),Q=Math.asin(P.clamp(J/Y*Math.sin(k),-1,1)),de=K-Q+k,ye=Npt;d.normalize(E,ye);let ce=Fpt;ce=d.cross(V,ye,ce),ce=d.normalize(ce,ce),d.normalize(d.cross(ye,ce,wb),B),d.multiplyByScalar(d.normalize(N,wb),d.magnitude(N)-m,N),d.normalize(E,E),d.multiplyByScalar(E,J,E);let ge=Upt;d.multiplyByScalar(d.add(d.multiplyByScalar(ye,Math.cos(de)-1,txe),d.multiplyByScalar(B,Math.sin(de),nxe),wb),J,ge),d.add(E,ge,E),d.normalize(N,ye),d.normalize(d.cross(ye,ce,wb),B);let xe=zpt;d.multiplyByScalar(d.add(d.multiplyByScalar(ye,Math.cos(de)-1,txe),d.multiplyByScalar(B,Math.sin(de),nxe),wb),d.magnitude(N),xe),d.add(N,xe,N),d.clone(E,b.position),d.normalize(d.subtract(N,E,wb),b.direction),d.clone(b.direction,b.direction),d.cross(b.direction,b.up,b.right),d.cross(b.right,b.direction,b.up),b.setView(YX);return}else{let E=d.normalize(g,Ppt),w=d.normalize(e._zoomWorldPosition,Rpt),I=d.dot(w,E);if(I>0&&I<1){let N=P.acosClamped(I),B=d.cross(w,E,Opt),H=Math.abs(N)>P.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-m,V=m/H;b.rotate(B,N*V)}}}}e._rotatingZoom=!O}if(!A&&O||S){let R,M=zi.worldToWindowCoordinates(x,e._zoomWorldPosition,vpt);T!==ne.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(M)?R=b.getPickRay(M,P4):R=b.getPickRay(t,P4);let L=R.direction;(T===ne.COLUMBUS_VIEW||T===ne.SCENE2D)&&d.fromElements(L.y,L.z,L.x,L),b.move(L,m),e._zoomingOnVector=!0}else b.zoomIn(m);e._cameraUnderground||b.setView(YX)}var Gpt=new pn,Wpt=new pn,jpt=new d;function qpt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,Gpt).origin,s=o.getPickRay(n.endPosition,Wpt).origin;r=d.fromElements(r.y,r.z,r.x,r),s=d.fromElements(s.y,s.z,s.x,s);let a=d.subtract(r,s,jpt),c=d.magnitude(a);c>0&&(d.normalize(a,a),o.move(a,c))}function ixe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;tK(e,t,n,e.zoomFactor,o.getMagnitude())}var Ypt=new U,Xpt=new U;function oxe(e,t,n){if(l(n.angleAndHeight)){Kpt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=Ypt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=Xpt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=U.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let h=P.acosClamped(u.x);u.y<0&&(h=P.TWO_PI-h);let p=h-f;o.twistRight(p)}function Kpt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function Zpt(e){let t=e._scene.mapMode2D===Du.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(Jc(e,e.enableTranslate,e.translateEventTypes,qpt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Jc(e,e.enableZoom,e.zoomEventTypes,ixe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Jc(e,e.enableRotate,e.tiltEventTypes,oxe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Jc(e,e.enableZoom,e.zoomEventTypes,ixe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Jc(e,e.enableRotate,e.translateEventTypes,oxe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var hxe=new pn,$pt=new d,Qpt=new d;function bg(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,$pt)),!l(o))return d.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,hxe),u=o.pickWorldCoordinates(c,i,a,Qpt),f=l(s)?d.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=l(u)?d.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<h?d.clone(s,n):d.clone(u,n)}var Jpt=new fe;function B4(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,Jpt);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var egt=new d;function mxe(e,t){let n=t.origin,i=t.direction,o=B4(e),r=d.normalize(n,egt),s=Math.abs(d.dot(r,i));return s=Math.max(s,.5)*2,o*s}function pxe(e,t,n,i){let o=d.distance(t.origin,n),r=B4(e),s=P.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),pn.getPoint(t,o,i)}function gxe(e,t,n,i){let o;return l(n)?(o=d.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=B4(e))):o=B4(e),pn.getPoint(t,o,i)}var tgt=new U;function _xe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,tgt),o=e._strafeEndMousePosition;U.add(o,i,o),t.endPosition=o,nK(e,t,e._strafeStartPosition),t.endPosition=n}var rxe=new pn,ngt=new pn,XX=new d,igt=new d,ogt=new d,rgt=new d,sgt=new an(d.UNIT_X,0),agt=new U,cgt=new U;function lgt(e,t,n){if(d.equals(t,e._translateMousePosition)||(e._looking=!1),d.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Mu(e,t,n);return}if(e._strafing){_xe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=U.clone(n.startPosition,agt),a=U.clone(n.endPosition,cgt),c=o.getPickRay(s,rxe),u=d.clone(d.ZERO,rgt),f=d.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=bg(e,s,XX),l(h)&&(u.x=h.x)),r||u.x>o.position.z&&l(h)){let A=h;r&&(A=gxe(e,c,h,XX)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),d.clone(A,e._strafeStartPosition),e._strafing=!0,nK(e,n,e._strafeStartPosition);return}let p=an.fromPointNormal(u,f,sgt);c=o.getPickRay(s,rxe);let _=Zn.rayPlane(c,p,XX),m=o.getPickRay(a,ngt),x=Zn.rayPlane(m,p,igt);if(!l(_)||!l(x)){e._looking=!0,Mu(e,t,n),U.clone(t,e._translateMousePosition);return}let b=d.subtract(_,x,ogt),T=b.x;b.x=b.y,b.y=b.z,b.z=T;let C=d.magnitude(b);C>P.EPSILON6&&(d.normalize(b,b),o.move(b,C))}var yxe=new U,M4=new pn,L4=new d,ugt=new d,xxe=new F,fgt=new F,dgt=new d,hgt=new an(d.UNIT_X,0),KX=new d,QX=new fe,bxe=new F,mgt=new Oe,pgt=new $,N4=new d;function ggt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Mu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,_gt(e,t,n)):ygt(e,t,n)}function _gt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=yxe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,M4),c=d.UNIT_X,u=a.origin,f=a.direction,h,p=d.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(h=-d.dot(c,u)/p),!l(h)||h<=0){e._looking=!0,Mu(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let _=d.multiplyByScalar(f,h,L4);d.add(u,_,_);let m=i.mapProjection,x=m.ellipsoid;d.fromElements(_.y,_.z,_.x,_);let b=m.unproject(_,QX);x.cartographicToCartesian(b,_);let T=Mt.eastNorthUpToFixedFrame(_,x,xxe),C=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=F.clone(o.transform,bxe);o._setTransform(T),Ou(e,t,n,d.UNIT_Z),o._setTransform(S),e._globe=C,e._ellipsoid=A;let v=A.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function ygt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=d.UNIT_X;if(U.equals(t,e._tiltCenterMousePosition))s=d.clone(e._tiltCenter,L4);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=bg(e,t,L4)),!l(s)){a=o.getPickRay(t,M4);let g=a.origin,E=a.direction,w,I=d.dot(c,E);if(Math.abs(I)>P.EPSILON6&&(w=-d.dot(c,g)/I),!l(w)||w<=0){e._looking=!0,Mu(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=d.multiplyByScalar(E,w,L4),d.add(g,s,s)}r&&(l(a)||(a=o.getPickRay(t,M4)),pxe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),d.clone(s,e._tiltCenter)}let u=i.canvas,f=yxe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,M4);let h=d.clone(d.ZERO,dgt);h.x=s.x;let p=an.fromPointNormal(h,c,hgt),_=Zn.rayPlane(a,p,ugt),m=o._projection,x=m.ellipsoid;d.fromElements(s.y,s.z,s.x,s);let b=m.unproject(s,QX);x.cartographicToCartesian(b,s);let T=Mt.eastNorthUpToFixedFrame(s,x,xxe),C;l(_)?(d.fromElements(_.y,_.z,_.x,_),b=m.unproject(_,QX),x.cartographicToCartesian(b,_),C=Mt.eastNorthUpToFixedFrame(_,x,fgt)):C=T;let A=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,D=F.clone(o.transform,bxe);o._setTransform(T);let O=d.cross(d.UNIT_Z,d.normalize(o.position,KX),KX),R=d.dot(o.right,O);if(Ou(e,t,n,v,!1,!0),o._setTransform(C),R<0){let g=n.startPosition.y-n.endPosition.y;(r&&g<0||!r&&g>0)&&(v=void 0);let E=o.constrainedAxis;o.constrainedAxis=void 0,Ou(e,t,n,v,!0,!1),o.constrainedAxis=E}else Ou(e,t,n,v,!0,!1);if(l(o.constrainedAxis)){let g=d.cross(o.direction,o.constrainedAxis,N4);d.equalsEpsilon(g,d.ZERO,P.EPSILON6)||(d.dot(g,o.right)<0&&d.negate(g,g),d.cross(g,o.direction,o.up),d.cross(o.direction,o.up,o.right),d.normalize(o.up,o.up),d.normalize(o.right,o.right))}o._setTransform(D),e._globe=A,e._ellipsoid=S;let M=S.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let L=d.clone(o.positionWC,KX);if(e.enableCollisionDetection&&rK(e,!0),!d.equals(o.positionWC,L)){o._setTransform(C),o.worldToCameraCoordinatesPoint(L,L);let g=d.magnitudeSquared(L);d.magnitudeSquared(o.position)>g&&(d.normalize(o.position,o.position),d.multiplyByScalar(o.position,Math.sqrt(g),o.position));let E=d.angleBetween(L,o.position),w=d.cross(L,o.position,L);d.normalize(w,w);let I=Oe.fromAxisAngle(w,E,mgt),N=$.fromQuaternion(I,pgt);$.multiplyByVector(N,o.direction,o.direction),$.multiplyByVector(N,o.up,o.up),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up),o._setTransform(D)}}var Txe=new U,Cxe=new pn,Axe=new d;function xgt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=Txe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,Cxe),u=c.origin,f=c.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=bg(e,a,Axe));let _;if(l(p)&&(_=d.distance(u,p)),s){let m=mxe(e,c,h);l(_)?_=Math.min(_,m):_=m}if(!l(_)){let m=d.UNIT_X;_=-d.dot(m,u)/d.dot(m,f)}tK(e,t,n,e.zoomFactor,_)}function bgt(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))Jc(e,e.enableRotate,e.rotateEventTypes,Ou,e.inertiaSpin,"_lastInertiaSpinMovement"),Jc(e,e.enableZoom,e.zoomEventTypes,Sxe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Jc(e,e.enableTilt,e.tiltEventTypes,ggt,e.inertiaSpin,"_lastInertiaTiltMovement"),Jc(e,e.enableTranslate,e.translateEventTypes,lgt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Jc(e,e.enableZoom,e.zoomEventTypes,xgt,e.inertiaZoom,"_lastInertiaZoomMovement"),Jc(e,e.enableLook,e.lookEventTypes,Mu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var Tgt=new pn,Cgt=new an(d.UNIT_X,0),Agt=new d,Egt=new d;function nK(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Tgt),s=d.clone(o.direction,Egt);i.mode===ne.COLUMBUS_VIEW&&d.fromElements(s.z,s.x,s.y,s);let a=an.fromPointNormal(n,s,Cgt),c=Zn.rayPlane(r,a,Agt);l(c)&&(s=d.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&d.fromElements(s.y,s.z,s.x,s),d.add(o.position,s,o.position))}var sxe=new d,Exe=new fe,JX=new d,eK=new ee,Sgt=new d,vgt=new d,wgt=new d;function Dgt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(o.transform,F.IDENTITY)){Ou(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(o.position,Sgt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)Mu(e,t,n,u);else if(e._rotating)Ou(e,t,n);else if(e._strafing)_xe(e,n);else{if(d.magnitude(o.position)<d.magnitude(e._rotateStartPosition))return;a=d.magnitude(e._rotateStartPosition),c=JX,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,eK),$X(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,Exe).height,h=e._globe;if(l(h)&&f<e._minimumPickingTerrainHeight){let p=bg(e,n.startPosition,wgt);if(l(p)){let _=!1,m=o.getPickRay(n.startPosition,hxe);if(r)_=!0,gxe(e,m,p,p);else{let x=s.geodeticSurfaceNormal(p,vgt);Math.abs(d.dot(m.direction,x))<.05?_=!0:_=d.magnitude(o.position)<d.magnitude(p)}_?(U.clone(t,e._strafeEndMousePosition),d.clone(p,e._strafeStartPosition),e._strafing=!0,nK(e,n,e._strafeStartPosition)):(a=d.magnitude(p),c=JX,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,eK),$X(e,t,n,s),d.clone(p,e._rotateStartPosition))}else e._looking=!0,Mu(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,sxe))?($X(e,t,n,e._ellipsoid),d.clone(sxe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Ou(e,t,n)):(e._looking=!0,Mu(e,t,n,u));U.clone(t,e._rotateMousePosition)}function Ou(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=d.magnitude(a.position),h=e._rotateFactor*(f-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,_=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),_=Math.min(_,e.maximumMovementRatio);let m=h*p*Math.PI*2,x=h*_*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let b=e.maximumTiltAngle,T=d.dot(a.direction,i),C=Math.PI-Math.acos(T)+x;C>b&&(x-=C-b)}o||a.rotateRight(m),r||a.rotateUp(x),a.constrainedAxis=u}var ZX=oe.clone(oe.UNIT_W),axe=oe.clone(oe.UNIT_W),R4=new d,qE=new d,O4=new d,cxe=new d,Igt=new U,Pgt=new U,Rgt=new U,Ogt=new U,Mgt=new pn;function $X(e,t,n,i){let o=e._scene,r=o.camera,s=U.clone(n.startPosition,Igt),a=U.clone(n.endPosition,Pgt),c=i.cartesianToCartographic(r.positionWC,Exe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=d.clone(e._panLastWorldPosition,ZX),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=bg(e,s,ZX)),!l(e._globe)&&l(u))){let h=d.subtract(u,r.positionWC,qE),p=d.multiplyByScalar(r.directionWC,d.dot(r.directionWC,h),qE),_=d.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,_,o.pixelRatio,Ogt),x=U.subtract(a,s,Rgt),b=d.multiplyByScalar(r.rightWC,x.x*m.x,qE),T=d.normalize(r.positionWC,dxe),C=r.getPickRay(a,Mgt).direction,A=d.subtract(C,d.projectVector(C,r.rightWC,O4),O4),S=d.angleBetween(A,r.directionWC),v=1;l(r.frustum.fov)&&(v=Math.max(Math.tan(S),.1));let D=Math.abs(d.dot(r.directionWC,T)),O=-x.y*m.y*2/Math.sqrt(v)*(1-D),R=d.multiplyByScalar(C,O,O4);D=Math.abs(d.dot(r.upWC,T));let M=d.multiplyByScalar(r.upWC,-x.y*(1-D)*m.y,cxe);f=d.add(u,b,axe),f=d.add(f,R,f),f=d.add(f,M,f),d.clone(f,e._panLastWorldPosition),U.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(s,i,ZX),f=r.pickEllipsoid(a,i,axe)),!l(u)||!l(f)){e._rotating=!0,Ou(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let h=r.constrainedAxis,p=d.mostOrthogonalAxis(h,R4);d.cross(p,h,p),d.normalize(p,p);let _=d.cross(h,p,qE),m=d.magnitude(u),x=d.dot(h,u),b=Math.acos(x/m),T=d.multiplyByScalar(h,x,O4);d.subtract(u,T,T),d.normalize(T,T);let C=d.magnitude(f),A=d.dot(h,f),S=Math.acos(A/C),v=d.multiplyByScalar(h,A,cxe);d.subtract(f,v,v),d.normalize(v,v);let D=Math.acos(d.dot(T,p));d.dot(T,_)<0&&(D=P.TWO_PI-D);let O=Math.acos(d.dot(v,p));d.dot(v,_)<0&&(O=P.TWO_PI-O);let R=D-O,M;d.equalsEpsilon(h,r.position,P.EPSILON2)?M=r.right:M=d.cross(h,r.position,R4);let L=d.cross(h,M,R4),g=d.dot(L,d.subtract(u,h,qE)),E=d.dot(L,d.subtract(f,h,qE)),w;g>0&&E>0?w=S-b:g>0&&E<=0?d.dot(r.position,h)>0?w=-b-S:w=b+S:w=b-S,r.rotateRight(R),r.rotateUp(w)}else{d.normalize(u,u),d.normalize(f,f);let h=d.dot(u,f),p=d.cross(u,f,R4);if(h<1&&!d.equalsEpsilon(p,d.ZERO,P.EPSILON14)){let _=Math.acos(h);r.rotate(p,_)}}}var Lgt=new d,Ngt=new fe,lxe=0;function Sxe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=Txe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,Cxe),h,p=o.cartesianToCartographic(s.position,Ngt).height,_=Math.abs(lxe)<e.minimumPickingTerrainDistanceWithInertia;(i?_:p<e._minimumPickingTerrainHeight)&&(h=bg(e,u,Axe));let x;if(l(h)&&(x=d.distance(f.origin,h),lxe=x),c){let T=mxe(e,f,p);l(x)?x=Math.min(x,T):x=T}l(x)||(x=p);let b=d.normalize(s.position,Lgt);tK(e,t,n,e.zoomFactor,x,d.dot(b,s.direction))}var vxe=new U,F4=new pn,eP=new d,Fgt=new d,wxe=new F,Bgt=new F,Dxe=new F,kgt=new Oe,Vgt=new $,iK=new fe,oK=new d;function Ugt(e,t,n){let o=e._scene.camera;if(!F.equals(o.transform,F.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,oK);Mu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,iK);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Hgt(e,t,n)):Ggt(e,t,n)}var zgt=new fe;function Hgt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,zgt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=vxe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,F4),h,p=Zn.rayEllipsoid(f,i);if(l(p))h=pn.getPoint(f,p.start,eP);else if(a>e._minimumTrackBallHeight){let C=Zn.grazingAltitudeLocation(f,i);if(!l(C))return;let A=i.cartesianToCartographic(C,iK);A.height=0,h=i.cartographicToCartesian(A,eP)}else{e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(r.position,oK);Mu(e,t,n,C),U.clone(t,e._tiltCenterMousePosition);return}let _=Mt.eastNorthUpToFixedFrame(h,i,wxe),m=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=F.clone(r.transform,Dxe);r._setTransform(_),Ou(e,t,n,d.UNIT_Z),r._setTransform(b),e._globe=m,e._ellipsoid=x;let T=x.maximumRadius;e._rotateFactor=1/T,e._rotateRateRangeAdjustment=T}function Ggt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,u;if(U.equals(t,e._tiltCenterMousePosition))a=d.clone(e._tiltCenter,eP);else{if(a=bg(e,t,eP),!l(a)){if(c=r.getPickRay(t,F4),u=Zn.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,iK).height<=e._minimumTrackBallHeight){e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(r.position,oK);Mu(e,t,n,E),U.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,u.start,eP)}s&&(l(c)||(c=r.getPickRay(t,F4)),pxe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),d.clone(a,e._tiltCenter)}let f=o.canvas,h=vxe;h.x=f.clientWidth/2,h.y=e._tiltCenterMousePosition.y,c=r.getPickRay(h,F4);let p=d.magnitude(a),_=d.fromElements(p,p,p,JX),m=ee.fromCartesian3(_,eK);if(u=Zn.rayEllipsoid(c,m),!l(u))return;let x=d.magnitude(c.origin)>p?u.start:u.stop,b=pn.getPoint(c,x,Fgt),T=Mt.eastNorthUpToFixedFrame(a,i,wxe),C=Mt.eastNorthUpToFixedFrame(b,m,Bgt),A=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,D=F.clone(r.transform,Dxe);r._setTransform(C);let O=d.cross(b,r.positionWC,N4);if(d.dot(r.rightWC,O)<0){let g=n.startPosition.y-n.endPosition.y;(s&&g<0||!s&&g>0)&&(v=void 0);let E=r.constrainedAxis;r.constrainedAxis=void 0,Ou(e,t,n,v,!0,!1),r.constrainedAxis=E}else Ou(e,t,n,v,!0,!1);if(r._setTransform(T),Ou(e,t,n,v,!1,!0),l(r.constrainedAxis)){let g=d.cross(r.direction,r.constrainedAxis,N4);d.equalsEpsilon(g,d.ZERO,P.EPSILON6)||(d.dot(g,r.right)<0&&d.negate(g,g),d.cross(g,r.direction,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.up,r.up),d.normalize(r.right,r.right))}r._setTransform(D),e._globe=A,e._ellipsoid=S;let M=S.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let L=d.clone(r.positionWC,N4);if(e.enableCollisionDetection&&rK(e,!0),!d.equals(r.positionWC,L)){r._setTransform(C),r.worldToCameraCoordinatesPoint(L,L);let g=d.magnitudeSquared(L);d.magnitudeSquared(r.position)>g&&(d.normalize(r.position,r.position),d.multiplyByScalar(r.position,Math.sqrt(g),r.position));let E=d.angleBetween(L,r.position),w=d.cross(L,r.position,L);d.normalize(w,w);let I=Oe.fromAxisAngle(w,E,kgt),N=$.fromQuaternion(I,Vgt);$.multiplyByVector(N,r.direction,r.direction),$.multiplyByVector(N,r.up,r.up),d.cross(r.direction,r.up,r.right),d.cross(r.right,r.direction,r.up),r._setTransform(D)}}var Wgt=new U,jgt=new U,uxe=new pn,fxe=new pn,qgt=new d,Ygt=new d;function Mu(e,t,n,i){let r=e._scene.camera,s=Wgt;s.x=n.startPosition.x,s.y=0;let a=jgt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,uxe),u=r.getPickRay(a,fxe),f=0,h,p;r.frustum instanceof rn?(h=c.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=c.direction,p=u.direction);let _=d.dot(h,p);_<1&&(f=Math.acos(_)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(m)?r.look(m,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,uxe),u=r.getPickRay(a,fxe),f=0,r.frustum instanceof rn?(h=c.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=c.direction,p=u.direction),_=d.dot(h,p),_<1&&(f=Math.acos(_)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,m),l(i)){let x=r.direction,b=d.negate(i,qgt),T=d.equalsEpsilon(x,i,P.EPSILON2),C=d.equalsEpsilon(x,b,P.EPSILON2);if(!T&&!C){_=d.dot(x,i);let A=P.acosClamped(_);f>0&&f>A&&(f=A-P.EPSILON4),_=d.dot(x,b),A=P.acosClamped(_),f<0&&-f>A&&(f=-A+P.EPSILON4);let S=d.cross(i,x,Ygt);r.look(S,f)}else(T&&f<0||C&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function Xgt(e){Jc(e,e.enableRotate,e.rotateEventTypes,Dgt,e.inertiaSpin,"_lastInertiaSpinMovement"),Jc(e,e.enableZoom,e.zoomEventTypes,Sxe,e.inertiaZoom,"_lastInertiaZoomMovement"),Jc(e,e.enableTilt,e.tiltEventTypes,Ugt,e.inertiaSpin,"_lastInertiaTiltMovement"),Jc(e,e.enableLook,e.lookEventTypes,Mu)}var Kgt=new F,Zgt=new fe;function rK(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===ne.SCENE2D||i===ne.MORPHING)return;let o=n.camera,r=y(n.ellipsoid,ee.WGS84),s=n.mapProjection,a,c;F.equals(o.transform,F.IDENTITY)||(a=F.clone(o.transform,Kgt),c=d.magnitude(o.position),o._setTransform(F.IDENTITY));let u=Zgt;i===ne.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(l(h)){let p=h+e.minimumZoomDistance,_=h-e._lastGlobeHeight,m=_/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===ne.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=_*.1}}l(a)&&(o._setTransform(a),f&&(d.normalize(o.position,o.position),d.negate(o.position,o.direction),d.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),d.normalize(o.direction,o.direction),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up)))}tP.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var $gt=new d,Qgt=new d;tP.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=y(e.ellipsoid,ee.default)):(this._globe=void 0,this._ellipsoid=ee.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Dr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Dr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Dr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=d.clone(t.positionWC,$gt),c=d.clone(t.directionWC,Qgt);if(i===ne.SCENE2D?Zpt(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=d.UNIT_Z,bgt(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,Xgt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!d.equals(a,t.positionWC)||!d.equals(c,t.directionWC);rK(this,u)}this._aggregator.reset()};tP.prototype.isDestroyed=function(){return!1};tP.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var k4=tP;var V4=`uniform sampler2D colorTexture; +`,s=new mo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Ru({name:"czm_edge_detection_composite",stages:[t,s]})}Tr.createSilhouetteStage=function(e){let t=gmt(e),n=new mo({name:"czm_silhouette_color_edges",fragmentShader:u4,uniforms:{silhouetteTexture:t.name}});return new Ru({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Tr.isSilhouetteSupported=function(e){return e.context.depthTexture};Tr.createBloomStage=function(){let e=new mo({name:"czm_bloom_contrast_bias",fragmentShader:Jz,uniforms:{contrast:128,brightness:-.3}}),t=PX("czm_bloom_blur"),n=new Ru({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new mo({name:"czm_bloom_generate_composite",fragmentShader:$z,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new Ru({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Tr.createAmbientOcclusionStage=function(){let e=new mo({name:"czm_ambient_occlusion_generate",fragmentShader:Xz,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new mo({name:"czm_ambient_occlusion_composite",fragmentShader:Kz,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new Ru({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Tr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var _mt=`#define FXAA_QUALITY_PRESET 39 +${f4} +${r4}`;Tr.createFXAAStage=function(){return new mo({name:"czm_FXAA",fragmentShader:_mt,sampleMode:Kf.LINEAR})};Tr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=Yz,new mo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=i4,new mo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=o4,new mo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=l4,new mo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=a4,new mo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};Tr.createAutoExposureStage=function(){return new d4};Tr.createBlackAndWhiteStage=function(){return new mo({name:"czm_black_and_white",fragmentShader:Zz,uniforms:{gradations:5}})};Tr.createBrightnessStage=function(){return new mo({name:"czm_brightness",fragmentShader:Qz,uniforms:{brightness:.5}})};Tr.createNightVisionStage=function(){return new mo({name:"czm_night_vision",fragmentShader:c4})};Tr.createDepthViewStage=function(){return new mo({name:"czm_depth_view",fragmentShader:t4})};Tr.createLensFlareStage=function(){return new mo({name:"czm_lens_flare",fragmentShader:s4,uniforms:{dirtTexture:en("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:en("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ee.WGS84.maximumRadius}})};var Zf=Tr;function bg(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function eP(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function RX(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[eP(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let h=e.getStageByName(f);l(h)&&(r[eP(h)]=!0)}}}return i.name}function JI(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let h=0;h<c;++h){let p=i.get(h);l(p.length)?a=JI(e,t,n,p,o):a=RX(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<c;++u)f=eP(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=eP(i.get(u));let h=n[f];for(let p=0;p<u;++p)h[eP(i.get(p))]=!0}return a}function ymt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=JI(e,t,n,i,void 0);a=JI(e,t,n,o,a),a=RX(e,t,n,r,a),a=JI(e,t,n,e,a),RX(e,t,n,s,a)}else JI(e,t,n,e,void 0);return n}function xmt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,h,p=e._framebuffers,_=p.length;for(f=0;f<_;++f){if(h=p[f],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||c!==h.pixelDatatype||!z.equals(u,h.clearColor))continue;let m=h.stages,x=m.length,b=!1;for(let T=0;T<x;++T)if(n[m[T]]){b=!0;break}if(!b)break}return l(h)&&f<_?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new mi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(h),h)}function bmt(e,t){let n=ymt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=xmt(e,i,n[i]))}function OX(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function Tmt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),h=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(h)||(h=P.nextPowerOfTwo(h)),u=h,f=h),a.buffer.update(t,u,f),a.clear=new ti({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}bg.prototype.updateDependencies=function(){this._updateDependencies=!0};bg.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(OX(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&bmt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,OX(this),Tmt(this,e))};bg.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};bg.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};bg.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};bg.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};bg.prototype.isDestroyed=function(){return!1};bg.prototype.destroy=function(){return OX(this),ue(this)};var qE=bg;var Cmt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var t0=Object.freeze(Cmt);var MX=[];function Jc(){let e=Zf.createFXAAStage(),t=Zf.createAmbientOcclusionStage(),n=Zf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Zf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=t0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new qE(this),r={},s=MX;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(Jc.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return LX(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case t0.REINHARD:n=Zf.createReinhardTonemappingStage(t);break;case t0.MODIFIED_REINHARD:n=Zf.createModifiedReinhardTonemappingStage(t);break;case t0.FILMIC:n=Zf.createFilmicTonemappingStage(t);break;case t0.PBR_NEUTRAL:n=Zf.createPbrNeutralTonemappingStage(t);break;default:n=Zf.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function LX(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}Jc.prototype.add=function(e){let t=this._stageNames,n=MX;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Jc.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=MX;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Jc.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Jc.prototype.get=function(e){return LX(this),this._stages[e]};Jc.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Jc.prototype.getStageByName=function(e){return this._stageNames[e]};Jc.prototype.update=function(e,t,n){LX(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let T=0;T<r.length;++T){let C=r[T];C.ready&&C.enabled&&C._isSupported(e)&&(o[s++]=C)}o.length=s;let a=s!==i.length;if(!a){for(let T=0;T<s;++T)if(o[T]!==i[T]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let _=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),x=h.enabled&&h._isSupported(e),b=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||_!==this._aoEnabled||m!==this._bloomEnabled||x!==this._tonemappingEnabled||b!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=_,this._bloomEnabled=m,this._tonemappingEnabled=x,this._fxaaEnabled=b,this._textureCacheDirty=!1),l(this._randomTexture)&&!_&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&_){let C=new Uint8Array(196608);for(let A=0;A<196608;A+=3)C[A]=Math.floor(Math.random()*255);this._randomTexture=new Rt({context:e,pixelFormat:tt.RGB,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:C,width:256,height:256},sampler:new Zt({wrapS:An.REPEAT,wrapT:An.REPEAT,minificationFilter:Kt.NEAREST,magnificationFilter:hi.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),h.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let T=0;T<r.length;++T)r[T].update(e,t);s=0;for(let T=0;T<r.length;++T){let C=r[T];C.ready&&C.enabled&&C._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};Jc.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function Eb(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Jc.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return Eb(t)};function Hm(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){Hm(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)Hm(e.get(r),t,Eb(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)Hm(e.get(r),t,n,i,o)}Jc.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,h=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),_=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!h&&!p&&!m&&r===0)return;let b=t;h&&a.ready&&(Hm(a,e,b,n,i),b=Eb(a)),p&&c.ready&&(Hm(c,e,b,n,i),b=Eb(c)),_&&u.ready&&Hm(u,e,b,n,i),m&&f.ready&&(Hm(f,e,b,n,i),b=Eb(f));let T=b;if(r>0){Hm(o[0],e,b,n,i);for(let C=1;C<r;++C)Hm(o[C],e,Eb(o[C-1]),n,i);T=Eb(o[r-1])}x&&s.ready&&Hm(s,e,T,n,i)};Jc.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Pu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Jc.prototype.isDestroyed=function(){return!1};Jc.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var h4=Jc;var Amt={SHIFT:0,CTRL:1,ALT:2},_a=Object.freeze(Amt);var Emt={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Tn=Object.freeze(Emt);function n0(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function UX(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function Sb(e){if(e.shiftKey)return _a.SHIFT;if(e.ctrlKey)return _a.CTRL;if(e.altKey)return _a.ALT}var Is={LEFT:0,MIDDLE:1,RIGHT:2};function Ou(e,t,n,i){function o(r){i(e,r)}zt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Smt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;zt.supportsPointerEvents()?(Ou(e,"pointerdown",t,Rmt),Ou(e,"pointerup",t,M0e),Ou(e,"pointermove",t,Omt),Ou(e,"pointercancel",t,M0e)):(Ou(e,"mousedown",t,L0e),Ou(e,"mouseup",n,N0e),Ou(e,"mousemove",n,F0e),Ou(e,"touchstart",t,Imt),Ou(e,"touchend",n,D0e),Ou(e,"touchmove",n,Pmt),Ou(e,"touchcancel",n,D0e)),Ou(e,"dblclick",t,wmt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Ou(e,i,t,Dmt)}function vmt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var E0e={position:new U};function zX(e){e._lastSeenTouchEvent=Ai()}function HX(e){return Ai()-e._lastSeenTouchEvent>uh.mouseEmulationIgnoreMilliseconds}function VX(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function L0e(e,t){if(!HX(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Is.LEFT)i=Tn.LEFT_DOWN;else if(n===Is.MIDDLE)i=Tn.MIDDLE_DOWN;else if(n===Is.RIGHT)i=Tn.RIGHT_DOWN;else return;let o=n0(e,t,e._primaryPosition);U.clone(o,e._primaryStartPosition),U.clone(o,e._primaryPreviousPosition);let r=Sb(t),s=e.getInputAction(i,r);l(s)&&(U.clone(o,E0e.position),s(E0e),t.preventDefault())}var S0e={position:new U},v0e={position:new U};function NX(e,t,n,i){let o=Sb(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=n0(e,i,e._primaryPosition);if(l(r)&&(U.clone(a,S0e.position),r(S0e)),l(s)){let c=e._primaryStartPosition;VX(c,a,e._clickPixelTolerance)&&(U.clone(a,v0e.position),s(v0e))}}}function N0e(e,t){if(!HX(e))return;let n=t.button;n!==Is.LEFT&&n!==Is.MIDDLE&&n!==Is.RIGHT||(e._buttonDown[Is.LEFT]&&(NX(e,Tn.LEFT_UP,Tn.LEFT_CLICK,t),e._buttonDown[Is.LEFT]=!1),e._buttonDown[Is.MIDDLE]&&(NX(e,Tn.MIDDLE_UP,Tn.MIDDLE_CLICK,t),e._buttonDown[Is.MIDDLE]=!1),e._buttonDown[Is.RIGHT]&&(NX(e,Tn.RIGHT_UP,Tn.RIGHT_CLICK,t),e._buttonDown[Is.RIGHT]=!1))}var FX={startPosition:new U,endPosition:new U};function F0e(e,t){if(!HX(e))return;let n=Sb(t),i=n0(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Tn.MOUSE_MOVE,n);l(r)&&(U.clone(o,FX.startPosition),U.clone(i,FX.endPosition),r(FX)),U.clone(i,o),(e._buttonDown[Is.LEFT]||e._buttonDown[Is.MIDDLE]||e._buttonDown[Is.RIGHT])&&t.preventDefault()}var w0e={position:new U};function wmt(e,t){let n=t.button,i;if(n===Is.LEFT)i=Tn.LEFT_DOUBLE_CLICK;else return;let o=Sb(t),r=e.getInputAction(i,o);l(r)&&(n0(e,t,w0e.position),r(w0e))}function Dmt(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=Sb(t),o=e.getInputAction(Tn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function Imt(e,t){zX(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,n0(e,r,new U));m4(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,U.clone(a.get(s)))}function D0e(e,t){zX(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);m4(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var I0e={position:new U},BX={position1:new U,position2:new U},P0e={position:new U},R0e={position:new U},O0e={position:new U};function m4(e,t){let n=Sb(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Is.LEFT]){if(e._buttonDown[Is.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Tn.LEFT_UP,n),l(r)&&(U.clone(e._primaryPosition,P0e.position),r(P0e)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Tn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];VX(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,R0e.position),s(R0e))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Tn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];U.clone(c,e._primaryPosition),U.clone(c,e._primaryStartPosition),U.clone(c,e._primaryPreviousPosition),e._buttonDown[Is.LEFT]=!0,r=e.getInputAction(Tn.LEFT_DOWN,n),l(r)&&(U.clone(c,I0e.position),r(I0e)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Tn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];VX(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,O0e.position),s(O0e))}},uh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Tn.PINCH_START,n),l(r)&&(U.clone(i.values[0],BX.position1),U.clone(i.values[1],BX.position2),r(BX),t.preventDefault()))}function Pmt(e,t){zX(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let u=a.get(s);l(u)&&n0(e,r,u)}B0e(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,U.clone(a.get(s),c.get(s))}var kX={startPosition:new U,endPosition:new U},tP={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function B0e(e,t){let n=Sb(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Is.LEFT]){let a=i.values[0];U.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Tn.MOUSE_MOVE,n),l(s)&&(U.clone(c,kX.startPosition),U.clone(a,kX.endPosition),s(kX)),U.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Tn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],h=c.x-a.x,p=c.y-a.y,_=Math.sqrt(h*h+p*p)*.25,m=f.x-u.x,x=f.y-u.y,b=Math.sqrt(m*m+x*x)*.25,T=(c.y+a.y)*.125,C=(f.y+u.y)*.125,A=Math.atan2(p,h),S=Math.atan2(x,m);U.fromElements(0,b,tP.distance.startPosition),U.fromElements(0,_,tP.distance.endPosition),U.fromElements(S,C,tP.angleAndHeight.startPosition),U.fromElements(A,T,tP.angleAndHeight.endPosition),s(tP)}}function Rmt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,n0(e,t,new U)),m4(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else L0e(e,t)}function M0e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),m4(e,t),e._previousPositions.remove(i)}else N0e(e,t)}function Omt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;n0(e,t,o),B0e(e,t);let r=e._previousPositions;U.clone(n.get(i),r.get(i))}else F0e(e,t)}function uh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-uh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new St,this._previousPositions=new St,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),Smt(this)}uh.prototype.setInputAction=function(e,t,n){let i=UX(t,n);this._inputEvents[i]=e};uh.prototype.getInputAction=function(e,t){let n=UX(e,t);return this._inputEvents[n]};uh.prototype.removeInputAction=function(e,t){let n=UX(e,t);delete this._inputEvents[n]};uh.prototype.isDestroyed=function(){return!1};uh.prototype.destroy=function(){return vmt(this),ue(this)};uh.mouseEmulationIgnoreMilliseconds=800;uh.touchHoldDelayMilliseconds=1500;var $f=uh;function vb(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}vb.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};vb.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof nn,!(this._previousMode===ne.SCENE2D||this._previousMode===ne.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE2D,!0),n._mode=ne.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ne.COLUMBUS_VIEW?fpt(this,e):ypt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Mmt=new d,Lmt=new d,Nmt=new d,Fmt=new d,Bmt=new d,kmt=new d,Vmt=new d,Umt=new fe,zmt=new F,Hmt=new Ii,Gmt=new nn,Wmt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};vb.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ne.COLUMBUS_VIEW||this._previousMode===ne.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ne.COLUMBUS_VIEW,!0),n.camera._setTransform(F.IDENTITY);let i=Mmt,o=Lmt,r=Nmt;if(e>0)i.x=0,i.y=-1,i.z=1,i=d.multiplyByScalar(d.normalize(i,i),5*t.maximumRadius,i),d.negate(d.normalize(i,o),o),d.cross(d.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===ne.SCENE2D)d.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,d.negate(d.UNIT_Z,o),d.clone(d.UNIT_Y,r);else{d.clone(u.positionWC,i),d.clone(u.directionWC,o),d.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,Vmt),h=Ot.eastNorthUpToFixedFrame(f,t,zmt);F.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,Umt),i),F.multiplyByPointAsVector(h,o,o),F.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=Gmt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Hmt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=Wmt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=bpt(a);nP(this,c),this._previousMode===ne.SCENE2D?xpt(this,e,a,c):(a.position2D=F.multiplyByPoint(so.TRANSFORM_2D,i,Fmt),a.direction2D=F.multiplyByPointAsVector(so.TRANSFORM_2D,o,Bmt),a.up2D=F.multiplyByPointAsVector(so.TRANSFORM_2D,r,kmt),n._mode=ne.MORPHING,X0e(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var jX={position:new d,direction:new d,up:new d,frustum:void 0},V0e=new Ii;vb.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ne.SCENE3D||this._previousMode===ne.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ne.SCENE3D,!0),n._mode=ne.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===ne.SCENE2D)tpt(this,e,t);else{let i;e>0?(i=jX,d.fromDegrees(0,0,5*t.maximumRadius,t,i.position),d.negate(i.position,i.direction),d.normalize(i.direction,i.direction),d.clone(d.UNIT_Z,i.up)):i=U0e(this,t);let o,r=n.camera;r.frustum instanceof nn?o=r.frustum.clone():(o=V0e,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=P.toRadians(60)),i.frustum=o;let s=Z0e(i);nP(this,s),WX(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};vb.prototype.isDestroyed=function(){return!1};vb.prototype.destroy=function(){return p4(this),ue(this)};function nP(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new $f(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Tn.LEFT_DOWN),e._morphHandler.setInputAction(n,Tn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Tn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Tn.WHEEL)}}function p4(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var jmt=new fe,qmt=new d,Ymt=new F;function U0e(e,t){let n=e._scene,i=n.camera,o=jX,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,jmt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,qmt),f=Ot.eastNorthUpToFixedFrame(u,t,Ymt);return F.multiplyByPointAsVector(f,i.direction,s),F.multiplyByPointAsVector(f,i.up,a),o}var Xmt=new d,Kmt=new d,Zmt=new d,$mt=new d,Qmt=new d,Jmt=new d;function WX(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(r.position,Xmt),a=d.clone(r.direction,Kmt),c=d.clone(r.up,Zmt),u=F.multiplyByPoint(so.TRANSFORM_2D_INVERSE,n.position,$mt),f=F.multiplyByPointAsVector(so.TRANSFORM_2D_INVERSE,n.direction,Qmt),h=F.multiplyByPointAsVector(so.TRANSFORM_2D_INVERSE,n.up,Jmt);function p(m){Qf(s,u,m.time,r.position),Qf(a,f,m.time,r.direction),Qf(c,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let _=o.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){K0e(e,o,0,1,t,i)}});e._currentTweens.push(_)}var ept=new nn,z0e=new d,H0e=new d,G0e=new d,qX=new d,W0e=new d,j0e=new d;function tpt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=jX,d.fromDegrees(0,0,5*n.maximumRadius,n,r.position),d.negate(r.position,r.direction),d.normalize(r.direction,r.direction),d.clone(d.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=U0e(e,n));let s;e._morphToOrthographic?(s=ept,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=V0e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),r.frustum=s;let a=Z0e(r);nP(e,a);let c;e._morphToOrthographic?c=function(){WX(e,t,r,a)}:c=function(){Y0e(e,t,r,function(){WX(e,t,r,a)})},t>0?(i._mode=ne.SCENE2D,o.flyTo({duration:t,destination:d.fromDegrees(0,0,5*n.maximumRadius,n,qX),complete:function(){i._mode=ne.MORPHING,c()}})):c()}function Qf(e,t,n,i){return d.lerp(e,t,n,i)}function q0e(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof nn)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let _=u/Math.tan(s.frustum.fov*.5);i(s,_)}let h=r.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var npt=new d,ipt=new d,opt=new d,GX=new d,rpt=new d,spt=new d,apt=new Hr,cpt=new pn,lpt=new d,upt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function fpt(e,t){t*=.5;let n=e._scene,i=n.camera,o=d.clone(i.position,npt),r=d.clone(i.direction,ipt),s=d.clone(i.up,opt),a=d.negate(d.UNIT_Z,rpt),c=d.clone(d.UNIT_Y,spt),u=GX;if(t>0)d.clone(d.ZERO,GX),u.z=5*n.ellipsoid.maximumRadius;else{d.clone(o,GX);let b=cpt;F.multiplyByPoint(so.TRANSFORM_2D,o,b.origin),F.multiplyByPointAsVector(so.TRANSFORM_2D,r,b.direction);let T=n.globe;if(l(T)){let C=T.pickWorldCoordinates(b,n,!0,lpt);l(C)&&(F.multiplyByPoint(so.TRANSFORM_2D_INVERSE,C,u),u.z+=d.distance(o,u))}}let f=apt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let h=upt;h.position=u,h.direction=a,h.up=c,h.frustum=f;let p=$0e(h);nP(e,p);function _(b){Qf(o,u,b.time,i.position),Qf(r,a,b.time,i.direction),Qf(s,c,b.time,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(b,T){b.position.z=T}let x=n.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:_,complete:function(){q0e(e,t,h,m,p)}});e._currentTweens.push(x)}var k0e=new fe,dpt={position:new d,direction:new d,up:new d,position2D:new d,direction2D:new d,up2D:new d,frustum:new Hr},hpt={position:new d,direction:new d,up:new d,frustum:void 0},mpt=new d,ppt=new pn,gpt=new F,_pt=new d;function ypt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=dpt;if(t>0)d.clone(d.ZERO,r.position),r.position.z=5*n.maximumRadius,d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,k0e),i.mapProjection.project(k0e,r.position),d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);let h=ppt;d.clone(r.position2D,h.origin);let p=d.clone(o.directionWC,h.direction),_=n.scaleToGeodeticSurface(o.positionWC,_pt),m=Ot.eastNorthUpToFixedFrame(_,n,gpt);F.inverseTransformation(m,m),F.multiplyByPointAsVector(m,p,p),F.multiplyByPointAsVector(so.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let b=x.pickWorldCoordinates(h,i,!0,mpt);if(l(b)){let T=d.distance(r.position2D,b);b.x+=T,d.clone(b,r.position2D)}}}function s(h,p){h.position.x=p}F.multiplyByPoint(so.TRANSFORM_2D,r.position,r.position2D),F.multiplyByPointAsVector(so.TRANSFORM_2D,r.direction,r.direction2D),F.multiplyByPointAsVector(so.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=hpt;F.multiplyByPoint(so.TRANSFORM_2D_INVERSE,r.position2D,c.position),d.clone(r.direction,c.direction),d.clone(r.up,c.up),c.frustum=a;let u=$0e(c);nP(e,u);function f(){q0e(e,t,r,s,u)}X0e(e,t,r,f)}function Y0e(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=P.lerp(c,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(h)}function xpt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(n.position,qX),a=d.clone(n.direction,W0e),c=d.clone(n.up,j0e);o._mode=ne.MORPHING;function u(){r.frustum=n.frustum.clone();let f=d.clone(r.position,z0e),h=d.clone(r.direction,H0e),p=d.clone(r.up,G0e);f.z=s.z;function _(x){Qf(f,s,x.time,r.position),Qf(h,a,x.time,r.direction),Qf(p,c,x.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:_,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():Y0e(e,0,n,u)}function X0e(e,t,n,i){let o=e._scene,r=o.camera,s=d.clone(r.position,z0e),a=d.clone(r.direction,H0e),c=d.clone(r.up,G0e),u=d.clone(n.position2D,qX),f=d.clone(n.direction2D,W0e),h=d.clone(n.up2D,j0e);function p(m){Qf(s,u,m.time,r.position),Qf(a,f,m.time,r.direction),Qf(c,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let _=o.tweens.add({duration:t,easingFunction:$r.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){K0e(e,o,1,0,t,i)}});e._currentTweens.push(_)}function K0e(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:$r.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function Z0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE3D,n.morphTime=ne.getMorphTime(ne.SCENE3D),p4(t);let i=n.camera;(t._previousMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE3D,r)}}function $0e(e){return function(t){let n=t._scene;n._mode=ne.SCENE2D,n.morphTime=ne.getMorphTime(ne.SCENE2D),p4(t);let i=n.camera;d.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.SCENE2D,o)}}function bpt(e){return function(t){let n=t._scene;n._mode=ne.COLUMBUS_VIEW,n.morphTime=ne.getMorphTime(ne.COLUMBUS_VIEW),p4(t);let i=n.camera;(t._previousModeMode!==ne.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ne.COLUMBUS_VIEW,r)}}var g4=vb;var Tpt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},ki=Object.freeze(Tpt);function qs(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function Cpt(e,t){U.clone(e.distance.startPosition,t.distance.startPosition),U.clone(e.distance.endPosition,t.distance.endPosition),U.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),U.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function Q0e(e,t,n){let i=qs(ki.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new U;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new U,endPosition:new U},u.angleAndHeight={startPosition:new U,endPosition:new U},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,U.lerp(f.position1,f.position2,.5,s[i])},Tn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Tn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(Cpt(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(U.clone(f.distance.endPosition,u.distance.endPosition),U.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let h=u.angleAndHeight.endPosition.x,p=u.prevAngle,_=Math.PI*2;for(;h>=p+Math.PI;)h-=_;for(;h<p-Math.PI;)h+=_;u.angleAndHeight.endPosition.x=-h*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Tn.PINCH_MOVE,t)}function J0e(e,t){let n=qs(ki.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new U,endPosition:new U,valid:!1}),s.startPosition=new U,U.clone(U.ZERO,s.startPosition),s.endPosition=new U,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,U.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Tn.WHEEL,t)}function YE(e,t,n){let i=qs(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new U;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new U,endPosition:new U,valid:!1});let c,u;n===ki.LEFT_DRAG?(c=Tn.LEFT_DOWN,u=Tn.LEFT_UP):n===ki.RIGHT_DRAG?(c=Tn.RIGHT_DOWN,u=Tn.RIGHT_UP):n===ki.MIDDLE_DRAG&&(c=Tn.MIDDLE_DOWN,u=Tn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,U.clone(f.position,r[i])},c,t),e._eventHandler.setInputAction(function(){YX(qs(n,void 0),e);for(let f of Object.values(_a)){let h=qs(n,f);YX(h,e)}},u,t)}function YX(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function exe(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function Apt(e,t,n){let i=n._isDown,o=!1,r=qs(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==r&&(o=!0,YX(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new U,endPosition:new U,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function txe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in ki)if(ki.hasOwnProperty(s)){let a=ki[s];if(l(a)){let c=qs(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new U,endPosition:new U,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new U,endPosition:new U})}}e._eventHandler.setInputAction(function(s){for(let a in ki)if(ki.hasOwnProperty(a)){let c=ki[a];if(l(c)){let u=qs(c,t);Apt(c,t,e),r[u]&&(n[u]?(exe(i[u],o[u]),o[u].valid=!0,exe(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},Tn.MOUSE_MOVE,t)}function Jf(e){this._eventHandler=new $f(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,J0e(this,void 0),Q0e(this,void 0,e),YE(this,void 0,ki.LEFT_DRAG),YE(this,void 0,ki.RIGHT_DRAG),YE(this,void 0,ki.MIDDLE_DRAG),txe(this,void 0);for(let t in _a)if(_a.hasOwnProperty(t)){let n=_a[t];l(n)&&(J0e(this,n),Q0e(this,n,e),YE(this,n,ki.LEFT_DRAG),YE(this,n,ki.RIGHT_DRAG),YE(this,n,ki.MIDDLE_DRAG),txe(this,n))}}Object.defineProperties(Jf.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[qs(ki.WHEEL)]||!this._update[qs(ki.WHEEL,_a.SHIFT)]||!this._update[qs(ki.WHEEL,_a.CTRL)]||!this._update[qs(ki.WHEEL,_a.ALT)];return this._buttonsDown>0||e}}});Jf.prototype.isMoving=function(e,t){let n=qs(e,t);return!this._update[n]};Jf.prototype.getMovement=function(e,t){let n=qs(e,t);return this._movement[n]};Jf.prototype.getLastMovement=function(e,t){let n=qs(e,t),i=this._lastMovement[n];if(i.valid)return i};Jf.prototype.isButtonDown=function(e,t){let n=qs(e,t);return this._isDown[n]};Jf.prototype.getStartMousePosition=function(e,t){if(e===ki.WHEEL)return this._currentMousePosition;let n=qs(e,t);return this._eventStartPosition[n]};Jf.prototype.getButtonPressTime=function(e,t){let n=qs(e,t);return this._pressTime[n]};Jf.prototype.getButtonReleaseTime=function(e,t){let n=qs(e,t);return this._releaseTime[n]};Jf.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Jf.prototype.isDestroyed=function(){return!1};Jf.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var _4=Jf;function y4(e,t,n,i,o,r,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ge(n),this._stopObject=Ge(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(y4.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});y4.prototype.cancelTween=function(){this._tweens.remove(this)};function fh(){this._tweens=[]}Object.defineProperties(fh.prototype,{length:{get:function(){return this._tweens.length}}});fh.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new y4(this);let t=e.duration/qn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/qn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,$r.LINEAR_NONE),r=e.startObject,s=new Vpe(r);s.to(Ge(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new y4(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};fh.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};fh.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};fh.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};fh.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};fh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};fh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};fh.prototype.get=function(e){return this._tweens[e]};fh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/qn.SECONDS_PER_MILLISECOND:Ai();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var XE=fh;function oP(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=ki.LEFT_DRAG,this.zoomEventTypes=[ki.RIGHT_DRAG,ki.WHEEL,ki.PINCH],this.rotateEventTypes=ki.LEFT_DRAG,this.tiltEventTypes=[ki.MIDDLE_DRAG,ki.PINCH,{eventType:ki.LEFT_DRAG,modifier:_a.CTRL},{eventType:ki.RIGHT_DRAG,modifier:_a.CTRL}],this.lookEventTypes={eventType:ki.LEFT_DRAG,modifier:_a.SHIFT};let t=y(e.ellipsoid,ee.default);this.minimumPickingTerrainHeight=ee.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ee.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ee.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ee.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new _4(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new XE,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new U(-1,-1),this._tiltCenter=new d,this._rotateMousePosition=new U(-1,-1),this._rotateStartPosition=new d,this._strafeStartPosition=new d,this._strafeMousePosition=new U,this._strafeEndMousePosition=new U,this._zoomMouseStart=new U(-1,-1),this._zoomWorldPosition=new d,this._useZoomWorldPosition=!1,this._panLastMousePosition=new U,this._panLastWorldPosition=new d,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new fe(Math.PI,P.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function Ept(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Spt(e){return U.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var vpt=.4;function wpt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new U,endPosition:new U,motion:new U,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<vpt){let _=Ept(p,i),m=e.getLastMovement(t,n);if(!l(m)||Spt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=U.clone(m.startPosition,a.startPosition),a.endPosition=U.multiplyByScalar(a.motion,_,a.endPosition),a.endPosition=U.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||U.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function Dpt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var nxe=[];function el(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(nxe[0]=n,n=nxe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,h=u.modifier,p=s.isMoving(f,h)&&s.getMovement(f,h),_=s.getStartMousePosition(f,h);e.enableInputs&&t&&(p?(i(e,_,p),Dpt(e,r)):o<1&&wpt(s,f,h,o,i,e,r))}}var x4=new pn,Ipt=new d,Ppt=new U,Rpt=new d,Opt=new U,Mpt=new d,Lpt=new d,Npt=new d,Fpt=new d,mxe=new d,Bpt=new d,kpt=new d,Vpt=new d,Upt=new d,zpt=new d,Hpt=new d,Gpt=new d,Wpt=new d,jpt=new d,qpt=new d,wb=new d,ixe=new d,oxe=new d,XX={orientation:new Ga};function nK(e,t,n,i,o,r){let s=1;l(r)&&(s=P.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,h=o-u,p=i*h;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let _=a/e._scene.canvas.clientHeight;_=Math.min(_,e.maximumMovementRatio);let m=p*_;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let x=e._scene,b=x.camera,T=x.mode,C=XX.orientation;if(C.heading=b.heading,C.pitch=b.pitch,C.roll=b.roll,b.frustum instanceof nn){Math.abs(m)>0&&(b.zoomIn(m),b._adjustOrthographicFrustum(!0));return}let A=y(n.inertiaEnabled,U.equals(t,e._zoomMouseStart)),S=e._zoomingOnVector,v=e._rotatingZoom,D;if(A||(e._zoomMouseStart=U.clone(t,e._zoomMouseStart),l(e._globe)&&T===ne.SCENE2D?(D=b.getPickRay(t,x4).origin,D=d.fromElements(D.y,D.z,D.x)):l(e._globe)&&(D=Tg(e,t,Ipt)),l(D)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=d.clone(D,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(m);return}let O=T===ne.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!A||v){if(T===ne.SCENE2D){let R=e._zoomWorldPosition,M=b.position;if(!d.equals(R,M)&&b.positionCartographic.height<e._maxCoord.x*2){let L=b.position.x,g=d.subtract(R,M,Rpt);d.normalize(g,g);let E=d.distance(R,M)*m/(b.getMagnitude()*.5);b.move(g,E*.5),(b.position.x<0&&L>0||b.position.x>0&&L<0)&&(D=b.getPickRay(t,x4).origin,D=d.fromElements(D.y,D.z,D.x),e._zoomWorldPosition=d.clone(D,e._zoomWorldPosition))}}else if(T===ne.SCENE3D){let R=d.normalize(b.position,mxe);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(d.dot(b.direction,R))<.6)O=!0;else{let M=x.canvas,L=Opt;L.x=M.clientWidth/2,L.y=M.clientHeight/2;let g=Tg(e,L,Mpt);if(!l(g))O=!0;else if(b.positionCartographic.height<1e6)if(d.dot(b.direction,R)>=-.5)O=!0;else{let E=kpt;d.clone(b.position,E);let w=e._zoomWorldPosition,I=Bpt;if(I=d.normalize(w,I),d.dot(I,R)<0)return;let N=qpt,B=zpt;d.clone(b.direction,B),d.add(E,d.multiplyByScalar(B,1e3,wb),N);let H=Hpt,V=Gpt;d.subtract(w,E,H),d.normalize(H,V);let G=d.dot(R,V);if(G>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-G),W=d.magnitude(E),Y=d.magnitude(w),J=W-m,j=d.magnitude(H),K=Math.asin(P.clamp(j/Y*Math.sin(k),-1,1)),Q=Math.asin(P.clamp(J/Y*Math.sin(k),-1,1)),de=K-Q+k,xe=Vpt;d.normalize(E,xe);let ce=Upt;ce=d.cross(V,xe,ce),ce=d.normalize(ce,ce),d.normalize(d.cross(xe,ce,wb),B),d.multiplyByScalar(d.normalize(N,wb),d.magnitude(N)-m,N),d.normalize(E,E),d.multiplyByScalar(E,J,E);let _e=Wpt;d.multiplyByScalar(d.add(d.multiplyByScalar(xe,Math.cos(de)-1,ixe),d.multiplyByScalar(B,Math.sin(de),oxe),wb),J,_e),d.add(E,_e,E),d.normalize(N,xe),d.normalize(d.cross(xe,ce,wb),B);let be=jpt;d.multiplyByScalar(d.add(d.multiplyByScalar(xe,Math.cos(de)-1,ixe),d.multiplyByScalar(B,Math.sin(de),oxe),wb),d.magnitude(N),be),d.add(N,be,N),d.clone(E,b.position),d.normalize(d.subtract(N,E,wb),b.direction),d.clone(b.direction,b.direction),d.cross(b.direction,b.up,b.right),d.cross(b.right,b.direction,b.up),b.setView(XX);return}else{let E=d.normalize(g,Lpt),w=d.normalize(e._zoomWorldPosition,Npt),I=d.dot(w,E);if(I>0&&I<1){let N=P.acosClamped(I),B=d.cross(w,E,Fpt),H=Math.abs(N)>P.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-m,V=m/H;b.rotate(B,N*V)}}}}e._rotatingZoom=!O}if(!A&&O||S){let R,M=zi.worldToWindowCoordinates(x,e._zoomWorldPosition,Ppt);T!==ne.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(M)?R=b.getPickRay(M,x4):R=b.getPickRay(t,x4);let L=R.direction;(T===ne.COLUMBUS_VIEW||T===ne.SCENE2D)&&d.fromElements(L.y,L.z,L.x,L),b.move(L,m),e._zoomingOnVector=!0}else b.zoomIn(m);e._cameraUnderground||b.setView(XX)}var Ypt=new pn,Xpt=new pn,Kpt=new d;function Zpt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,Ypt).origin,s=o.getPickRay(n.endPosition,Xpt).origin;r=d.fromElements(r.y,r.z,r.x,r),s=d.fromElements(s.y,s.z,s.x,s);let a=d.subtract(r,s,Kpt),c=d.magnitude(a);c>0&&(d.normalize(a,a),o.move(a,c))}function rxe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;nK(e,t,n,e.zoomFactor,o.getMagnitude())}var $pt=new U,Qpt=new U;function sxe(e,t,n){if(l(n.angleAndHeight)){Jpt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=$pt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=Qpt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=U.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let h=P.acosClamped(u.x);u.y<0&&(h=P.TWO_PI-h);let p=h-f;o.twistRight(p)}function Jpt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function egt(e){let t=e._scene.mapMode2D===Iu.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(el(e,e.enableTranslate,e.translateEventTypes,Zpt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),el(e,e.enableZoom,e.zoomEventTypes,rxe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&el(e,e.enableRotate,e.tiltEventTypes,sxe,e.inertiaSpin,"_lastInertiaTiltMovement")):(el(e,e.enableZoom,e.zoomEventTypes,rxe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&el(e,e.enableRotate,e.translateEventTypes,sxe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var pxe=new pn,tgt=new d,ngt=new d;function Tg(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,tgt)),!l(o))return d.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,pxe),u=o.pickWorldCoordinates(c,i,a,ngt),f=l(s)?d.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=l(u)?d.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<h?d.clone(s,n):d.clone(u,n)}var igt=new fe;function v4(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ne.SCENE3D){let c=t.cartesianToCartographic(i.position,igt);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var ogt=new d;function gxe(e,t){let n=t.origin,i=t.direction,o=v4(e),r=d.normalize(n,ogt),s=Math.abs(d.dot(r,i));return s=Math.max(s,.5)*2,o*s}function _xe(e,t,n,i){let o=d.distance(t.origin,n),r=v4(e),s=P.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),pn.getPoint(t,o,i)}function yxe(e,t,n,i){let o;return l(n)?(o=d.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=v4(e))):o=v4(e),pn.getPoint(t,o,i)}var rgt=new U;function xxe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,rgt),o=e._strafeEndMousePosition;U.add(o,i,o),t.endPosition=o,iK(e,t,e._strafeStartPosition),t.endPosition=n}var axe=new pn,sgt=new pn,KX=new d,agt=new d,cgt=new d,lgt=new d,ugt=new sn(d.UNIT_X,0),fgt=new U,dgt=new U;function hgt(e,t,n){if(d.equals(t,e._translateMousePosition)||(e._looking=!1),d.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Lu(e,t,n);return}if(e._strafing){xxe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=U.clone(n.startPosition,fgt),a=U.clone(n.endPosition,dgt),c=o.getPickRay(s,axe),u=d.clone(d.ZERO,lgt),f=d.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=Tg(e,s,KX),l(h)&&(u.x=h.x)),r||u.x>o.position.z&&l(h)){let A=h;r&&(A=yxe(e,c,h,KX)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),d.clone(A,e._strafeStartPosition),e._strafing=!0,iK(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,ugt);c=o.getPickRay(s,axe);let _=Qn.rayPlane(c,p,KX),m=o.getPickRay(a,sgt),x=Qn.rayPlane(m,p,agt);if(!l(_)||!l(x)){e._looking=!0,Lu(e,t,n),U.clone(t,e._translateMousePosition);return}let b=d.subtract(_,x,cgt),T=b.x;b.x=b.y,b.y=b.z,b.z=T;let C=d.magnitude(b);C>P.EPSILON6&&(d.normalize(b,b),o.move(b,C))}var bxe=new U,C4=new pn,A4=new d,mgt=new d,Txe=new F,pgt=new F,ggt=new d,_gt=new sn(d.UNIT_X,0),ZX=new d,JX=new fe,Cxe=new F,ygt=new Oe,xgt=new $,E4=new d;function bgt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Lu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Tgt(e,t,n)):Cgt(e,t,n)}function Tgt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=bxe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,C4),c=d.UNIT_X,u=a.origin,f=a.direction,h,p=d.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(h=-d.dot(c,u)/p),!l(h)||h<=0){e._looking=!0,Lu(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let _=d.multiplyByScalar(f,h,A4);d.add(u,_,_);let m=i.mapProjection,x=m.ellipsoid;d.fromElements(_.y,_.z,_.x,_);let b=m.unproject(_,JX);x.cartographicToCartesian(b,_);let T=Ot.eastNorthUpToFixedFrame(_,x,Txe),C=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=F.clone(o.transform,Cxe);o._setTransform(T),Mu(e,t,n,d.UNIT_Z),o._setTransform(S),e._globe=C,e._ellipsoid=A;let v=A.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function Cgt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=d.UNIT_X;if(U.equals(t,e._tiltCenterMousePosition))s=d.clone(e._tiltCenter,A4);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=Tg(e,t,A4)),!l(s)){a=o.getPickRay(t,C4);let g=a.origin,E=a.direction,w,I=d.dot(c,E);if(Math.abs(I)>P.EPSILON6&&(w=-d.dot(c,g)/I),!l(w)||w<=0){e._looking=!0,Lu(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=d.multiplyByScalar(E,w,A4),d.add(g,s,s)}r&&(l(a)||(a=o.getPickRay(t,C4)),_xe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),d.clone(s,e._tiltCenter)}let u=i.canvas,f=bxe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,C4);let h=d.clone(d.ZERO,ggt);h.x=s.x;let p=sn.fromPointNormal(h,c,_gt),_=Qn.rayPlane(a,p,mgt),m=o._projection,x=m.ellipsoid;d.fromElements(s.y,s.z,s.x,s);let b=m.unproject(s,JX);x.cartographicToCartesian(b,s);let T=Ot.eastNorthUpToFixedFrame(s,x,Txe),C;l(_)?(d.fromElements(_.y,_.z,_.x,_),b=m.unproject(_,JX),x.cartographicToCartesian(b,_),C=Ot.eastNorthUpToFixedFrame(_,x,pgt)):C=T;let A=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,D=F.clone(o.transform,Cxe);o._setTransform(T);let O=d.cross(d.UNIT_Z,d.normalize(o.position,ZX),ZX),R=d.dot(o.right,O);if(Mu(e,t,n,v,!1,!0),o._setTransform(C),R<0){let g=n.startPosition.y-n.endPosition.y;(r&&g<0||!r&&g>0)&&(v=void 0);let E=o.constrainedAxis;o.constrainedAxis=void 0,Mu(e,t,n,v,!0,!1),o.constrainedAxis=E}else Mu(e,t,n,v,!0,!1);if(l(o.constrainedAxis)){let g=d.cross(o.direction,o.constrainedAxis,E4);d.equalsEpsilon(g,d.ZERO,P.EPSILON6)||(d.dot(g,o.right)<0&&d.negate(g,g),d.cross(g,o.direction,o.up),d.cross(o.direction,o.up,o.right),d.normalize(o.up,o.up),d.normalize(o.right,o.right))}o._setTransform(D),e._globe=A,e._ellipsoid=S;let M=S.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let L=d.clone(o.positionWC,ZX);if(e.enableCollisionDetection&&sK(e,!0),!d.equals(o.positionWC,L)){o._setTransform(C),o.worldToCameraCoordinatesPoint(L,L);let g=d.magnitudeSquared(L);d.magnitudeSquared(o.position)>g&&(d.normalize(o.position,o.position),d.multiplyByScalar(o.position,Math.sqrt(g),o.position));let E=d.angleBetween(L,o.position),w=d.cross(L,o.position,L);d.normalize(w,w);let I=Oe.fromAxisAngle(w,E,ygt),N=$.fromQuaternion(I,xgt);$.multiplyByVector(N,o.direction,o.direction),$.multiplyByVector(N,o.up,o.up),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up),o._setTransform(D)}}var Axe=new U,Exe=new pn,Sxe=new d;function Agt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=Axe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,Exe),u=c.origin,f=c.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=Tg(e,a,Sxe));let _;if(l(p)&&(_=d.distance(u,p)),s){let m=gxe(e,c,h);l(_)?_=Math.min(_,m):_=m}if(!l(_)){let m=d.UNIT_X;_=-d.dot(m,u)/d.dot(m,f)}nK(e,t,n,e.zoomFactor,_)}function Egt(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))el(e,e.enableRotate,e.rotateEventTypes,Mu,e.inertiaSpin,"_lastInertiaSpinMovement"),el(e,e.enableZoom,e.zoomEventTypes,wxe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),el(e,e.enableTilt,e.tiltEventTypes,bgt,e.inertiaSpin,"_lastInertiaTiltMovement"),el(e,e.enableTranslate,e.translateEventTypes,hgt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),el(e,e.enableZoom,e.zoomEventTypes,Agt,e.inertiaZoom,"_lastInertiaZoomMovement"),el(e,e.enableLook,e.lookEventTypes,Lu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var Sgt=new pn,vgt=new sn(d.UNIT_X,0),wgt=new d,Dgt=new d;function iK(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Sgt),s=d.clone(o.direction,Dgt);i.mode===ne.COLUMBUS_VIEW&&d.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,vgt),c=Qn.rayPlane(r,a,wgt);l(c)&&(s=d.subtract(n,c,s),i.mode===ne.COLUMBUS_VIEW&&d.fromElements(s.y,s.z,s.x,s),d.add(o.position,s,o.position))}var cxe=new d,vxe=new fe,eK=new d,tK=new ee,Igt=new d,Pgt=new d,Rgt=new d;function Ogt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(o.transform,F.IDENTITY)){Mu(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(o.position,Igt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)Lu(e,t,n,u);else if(e._rotating)Mu(e,t,n);else if(e._strafing)xxe(e,n);else{if(d.magnitude(o.position)<d.magnitude(e._rotateStartPosition))return;a=d.magnitude(e._rotateStartPosition),c=eK,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,tK),QX(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,vxe).height,h=e._globe;if(l(h)&&f<e._minimumPickingTerrainHeight){let p=Tg(e,n.startPosition,Rgt);if(l(p)){let _=!1,m=o.getPickRay(n.startPosition,pxe);if(r)_=!0,yxe(e,m,p,p);else{let x=s.geodeticSurfaceNormal(p,Pgt);Math.abs(d.dot(m.direction,x))<.05?_=!0:_=d.magnitude(o.position)<d.magnitude(p)}_?(U.clone(t,e._strafeEndMousePosition),d.clone(p,e._strafeStartPosition),e._strafing=!0,iK(e,n,e._strafeStartPosition)):(a=d.magnitude(p),c=eK,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,tK),QX(e,t,n,s),d.clone(p,e._rotateStartPosition))}else e._looking=!0,Lu(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,cxe))?(QX(e,t,n,e._ellipsoid),d.clone(cxe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Mu(e,t,n)):(e._looking=!0,Lu(e,t,n,u));U.clone(t,e._rotateMousePosition)}function Mu(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=d.magnitude(a.position),h=e._rotateFactor*(f-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,_=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),_=Math.min(_,e.maximumMovementRatio);let m=h*p*Math.PI*2,x=h*_*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let b=e.maximumTiltAngle,T=d.dot(a.direction,i),C=Math.PI-Math.acos(T)+x;C>b&&(x-=C-b)}o||a.rotateRight(m),r||a.rotateUp(x),a.constrainedAxis=u}var $X=oe.clone(oe.UNIT_W),lxe=oe.clone(oe.UNIT_W),b4=new d,KE=new d,T4=new d,uxe=new d,Mgt=new U,Lgt=new U,Ngt=new U,Fgt=new U,Bgt=new pn;function QX(e,t,n,i){let o=e._scene,r=o.camera,s=U.clone(n.startPosition,Mgt),a=U.clone(n.endPosition,Lgt),c=i.cartesianToCartographic(r.positionWC,vxe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=d.clone(e._panLastWorldPosition,$X),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=Tg(e,s,$X)),!l(e._globe)&&l(u))){let h=d.subtract(u,r.positionWC,KE),p=d.multiplyByScalar(r.directionWC,d.dot(r.directionWC,h),KE),_=d.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,_,o.pixelRatio,Fgt),x=U.subtract(a,s,Ngt),b=d.multiplyByScalar(r.rightWC,x.x*m.x,KE),T=d.normalize(r.positionWC,mxe),C=r.getPickRay(a,Bgt).direction,A=d.subtract(C,d.projectVector(C,r.rightWC,T4),T4),S=d.angleBetween(A,r.directionWC),v=1;l(r.frustum.fov)&&(v=Math.max(Math.tan(S),.1));let D=Math.abs(d.dot(r.directionWC,T)),O=-x.y*m.y*2/Math.sqrt(v)*(1-D),R=d.multiplyByScalar(C,O,T4);D=Math.abs(d.dot(r.upWC,T));let M=d.multiplyByScalar(r.upWC,-x.y*(1-D)*m.y,uxe);f=d.add(u,b,lxe),f=d.add(f,R,f),f=d.add(f,M,f),d.clone(f,e._panLastWorldPosition),U.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(s,i,$X),f=r.pickEllipsoid(a,i,lxe)),!l(u)||!l(f)){e._rotating=!0,Mu(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let h=r.constrainedAxis,p=d.mostOrthogonalAxis(h,b4);d.cross(p,h,p),d.normalize(p,p);let _=d.cross(h,p,KE),m=d.magnitude(u),x=d.dot(h,u),b=Math.acos(x/m),T=d.multiplyByScalar(h,x,T4);d.subtract(u,T,T),d.normalize(T,T);let C=d.magnitude(f),A=d.dot(h,f),S=Math.acos(A/C),v=d.multiplyByScalar(h,A,uxe);d.subtract(f,v,v),d.normalize(v,v);let D=Math.acos(d.dot(T,p));d.dot(T,_)<0&&(D=P.TWO_PI-D);let O=Math.acos(d.dot(v,p));d.dot(v,_)<0&&(O=P.TWO_PI-O);let R=D-O,M;d.equalsEpsilon(h,r.position,P.EPSILON2)?M=r.right:M=d.cross(h,r.position,b4);let L=d.cross(h,M,b4),g=d.dot(L,d.subtract(u,h,KE)),E=d.dot(L,d.subtract(f,h,KE)),w;g>0&&E>0?w=S-b:g>0&&E<=0?d.dot(r.position,h)>0?w=-b-S:w=b+S:w=b-S,r.rotateRight(R),r.rotateUp(w)}else{d.normalize(u,u),d.normalize(f,f);let h=d.dot(u,f),p=d.cross(u,f,b4);if(h<1&&!d.equalsEpsilon(p,d.ZERO,P.EPSILON14)){let _=Math.acos(h);r.rotate(p,_)}}}var kgt=new d,Vgt=new fe,fxe=0;function wxe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=Axe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,Exe),h,p=o.cartesianToCartographic(s.position,Vgt).height,_=Math.abs(fxe)<e.minimumPickingTerrainDistanceWithInertia;(i?_:p<e._minimumPickingTerrainHeight)&&(h=Tg(e,u,Sxe));let x;if(l(h)&&(x=d.distance(f.origin,h),fxe=x),c){let T=gxe(e,f,p);l(x)?x=Math.min(x,T):x=T}l(x)||(x=p);let b=d.normalize(s.position,kgt);nK(e,t,n,e.zoomFactor,x,d.dot(b,s.direction))}var Dxe=new U,S4=new pn,iP=new d,Ugt=new d,Ixe=new F,zgt=new F,Pxe=new F,Hgt=new Oe,Ggt=new $,oK=new fe,rK=new d;function Wgt(e,t,n){let o=e._scene.camera;if(!F.equals(o.transform,F.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,rK);Lu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,oK);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,qgt(e,t,n)):Ygt(e,t,n)}var jgt=new fe;function qgt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,jgt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=Dxe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,S4),h,p=Qn.rayEllipsoid(f,i);if(l(p))h=pn.getPoint(f,p.start,iP);else if(a>e._minimumTrackBallHeight){let C=Qn.grazingAltitudeLocation(f,i);if(!l(C))return;let A=i.cartesianToCartographic(C,oK);A.height=0,h=i.cartographicToCartesian(A,iP)}else{e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(r.position,rK);Lu(e,t,n,C),U.clone(t,e._tiltCenterMousePosition);return}let _=Ot.eastNorthUpToFixedFrame(h,i,Ixe),m=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=F.clone(r.transform,Pxe);r._setTransform(_),Mu(e,t,n,d.UNIT_Z),r._setTransform(b),e._globe=m,e._ellipsoid=x;let T=x.maximumRadius;e._rotateFactor=1/T,e._rotateRateRangeAdjustment=T}function Ygt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,u;if(U.equals(t,e._tiltCenterMousePosition))a=d.clone(e._tiltCenter,iP);else{if(a=Tg(e,t,iP),!l(a)){if(c=r.getPickRay(t,S4),u=Qn.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,oK).height<=e._minimumTrackBallHeight){e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(r.position,rK);Lu(e,t,n,E),U.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,u.start,iP)}s&&(l(c)||(c=r.getPickRay(t,S4)),_xe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),d.clone(a,e._tiltCenter)}let f=o.canvas,h=Dxe;h.x=f.clientWidth/2,h.y=e._tiltCenterMousePosition.y,c=r.getPickRay(h,S4);let p=d.magnitude(a),_=d.fromElements(p,p,p,eK),m=ee.fromCartesian3(_,tK);if(u=Qn.rayEllipsoid(c,m),!l(u))return;let x=d.magnitude(c.origin)>p?u.start:u.stop,b=pn.getPoint(c,x,Ugt),T=Ot.eastNorthUpToFixedFrame(a,i,Ixe),C=Ot.eastNorthUpToFixedFrame(b,m,zgt),A=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,D=F.clone(r.transform,Pxe);r._setTransform(C);let O=d.cross(b,r.positionWC,E4);if(d.dot(r.rightWC,O)<0){let g=n.startPosition.y-n.endPosition.y;(s&&g<0||!s&&g>0)&&(v=void 0);let E=r.constrainedAxis;r.constrainedAxis=void 0,Mu(e,t,n,v,!0,!1),r.constrainedAxis=E}else Mu(e,t,n,v,!0,!1);if(r._setTransform(T),Mu(e,t,n,v,!1,!0),l(r.constrainedAxis)){let g=d.cross(r.direction,r.constrainedAxis,E4);d.equalsEpsilon(g,d.ZERO,P.EPSILON6)||(d.dot(g,r.right)<0&&d.negate(g,g),d.cross(g,r.direction,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.up,r.up),d.normalize(r.right,r.right))}r._setTransform(D),e._globe=A,e._ellipsoid=S;let M=S.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;let L=d.clone(r.positionWC,E4);if(e.enableCollisionDetection&&sK(e,!0),!d.equals(r.positionWC,L)){r._setTransform(C),r.worldToCameraCoordinatesPoint(L,L);let g=d.magnitudeSquared(L);d.magnitudeSquared(r.position)>g&&(d.normalize(r.position,r.position),d.multiplyByScalar(r.position,Math.sqrt(g),r.position));let E=d.angleBetween(L,r.position),w=d.cross(L,r.position,L);d.normalize(w,w);let I=Oe.fromAxisAngle(w,E,Hgt),N=$.fromQuaternion(I,Ggt);$.multiplyByVector(N,r.direction,r.direction),$.multiplyByVector(N,r.up,r.up),d.cross(r.direction,r.up,r.right),d.cross(r.right,r.direction,r.up),r._setTransform(D)}}var Xgt=new U,Kgt=new U,dxe=new pn,hxe=new pn,Zgt=new d,$gt=new d;function Lu(e,t,n,i){let r=e._scene.camera,s=Xgt;s.x=n.startPosition.x,s.y=0;let a=Kgt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,dxe),u=r.getPickRay(a,hxe),f=0,h,p;r.frustum instanceof nn?(h=c.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=c.direction,p=u.direction);let _=d.dot(h,p);_<1&&(f=Math.acos(_)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(m)?r.look(m,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,dxe),u=r.getPickRay(a,hxe),f=0,r.frustum instanceof nn?(h=c.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=c.direction,p=u.direction),_=d.dot(h,p),_<1&&(f=Math.acos(_)),f=n.startPosition.y>n.endPosition.y?-f:f,i=y(i,m),l(i)){let x=r.direction,b=d.negate(i,Zgt),T=d.equalsEpsilon(x,i,P.EPSILON2),C=d.equalsEpsilon(x,b,P.EPSILON2);if(!T&&!C){_=d.dot(x,i);let A=P.acosClamped(_);f>0&&f>A&&(f=A-P.EPSILON4),_=d.dot(x,b),A=P.acosClamped(_),f<0&&-f>A&&(f=-A+P.EPSILON4);let S=d.cross(i,x,$gt);r.look(S,f)}else(T&&f<0||C&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function Qgt(e){el(e,e.enableRotate,e.rotateEventTypes,Ogt,e.inertiaSpin,"_lastInertiaSpinMovement"),el(e,e.enableZoom,e.zoomEventTypes,wxe,e.inertiaZoom,"_lastInertiaZoomMovement"),el(e,e.enableTilt,e.tiltEventTypes,Wgt,e.inertiaSpin,"_lastInertiaTiltMovement"),el(e,e.enableLook,e.lookEventTypes,Lu)}var Jgt=new F,e_t=new fe;function sK(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===ne.SCENE2D||i===ne.MORPHING)return;let o=n.camera,r=y(n.ellipsoid,ee.WGS84),s=n.mapProjection,a,c;F.equals(o.transform,F.IDENTITY)||(a=F.clone(o.transform,Jgt),c=d.magnitude(o.position),o._setTransform(F.IDENTITY));let u=e_t;i===ne.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(l(h)){let p=h+e.minimumZoomDistance,_=h-e._lastGlobeHeight,m=_/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===ne.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=_*.1}}l(a)&&(o._setTransform(a),f&&(d.normalize(o.position,o.position),d.negate(o.position,o.direction),d.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),d.normalize(o.direction,o.direction),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up)))}oP.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ne.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var t_t=new d,n_t=new d;oP.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=y(e.ellipsoid,ee.default)):(this._globe=void 0,this._ellipsoid=ee.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Dr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Dr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Dr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=d.clone(t.positionWC,t_t),c=d.clone(t.directionWC,n_t);if(i===ne.SCENE2D?egt(this):i===ne.COLUMBUS_VIEW?(this._horizontalRotationAxis=d.UNIT_Z,Egt(this)):i===ne.SCENE3D&&(this._horizontalRotationAxis=void 0,Qgt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!d.equals(a,t.positionWC)||!d.equals(c,t.directionWC);sK(this,u)}this._aggregator.reset()};oP.prototype.isDestroyed=function(){return!1};oP.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var w4=oP;var D4=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; @@ -13843,7 +13125,7 @@ void main() float t = smoothstep(0.5, 0.8, x); out_FragColor = mix(color0 + color1, color1, t); } -`;var U4=`uniform sampler2D colorTexture; +`;var I4=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; @@ -13873,7 +13155,7 @@ void main() xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function Tg(){this._sceneFramebuffer=new VE;let e=.125,t=new Array(6);t[0]=new ho({fragmentShader:Iu,textureScale:e,forcePowerOfTwo:!0,sampleMode:Xf.LINEAR});let n=t[1]=new ho({fragmentShader:U4,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new U,t[2]=new ho({fragmentShader:bb,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new ho({fragmentShader:bb,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new ho({fragmentShader:Iu,sampleMode:Xf.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new ho({fragmentShader:V4,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Pu({stages:t});let o=new GE(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}Tg.prototype.get=function(e){return this._stages.get(e)};Tg.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var Jgt=new oe,Ixe=new U,e_t=new U,Pxe=new F;function t_t(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=F.computeViewportTransformation(n,0,1,Pxe),u=F.multiplyByPoint(r,o,Jgt),f=Mt.pointToGLWindowCoordinates(s,c,o,Ixe);u.x+=P.SOLAR_RADIUS;let h=Mt.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(h,f,h))*30*2,_=e_t;_.x=p,_.y=p,e._uCenter=U.clone(f,e._uCenter),e._uRadius=Math.max(_.x,_.y)*.15;let m=t.drawingBufferWidth,x=t.drawingBufferHeight,b=e._stages,T=b.get(0),C=T.outputTexture.width,A=T.outputTexture.height,S=new qe;S.width=C,S.height=A,c=F.computeViewportTransformation(S,0,1,Pxe),f=Mt.pointToGLWindowCoordinates(s,c,o,Ixe),_.x*=C/m,_.y*=A/x;let v=T.scissorRectangle;v.x=Math.max(f.x-_.x*.5,0),v.y=Math.max(f.y-_.y*.5,0),v.width=Math.min(_.x,m),v.height=Math.min(_.y,x);for(let D=1;D<4;++D)qe.clone(v,b.get(D).scissorRectangle)}Tg.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Tg.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),t_t(this,t,n),o};Tg.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};Tg.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Tg.prototype.isDestroyed=function(){return!1};Tg.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var z4=Tg;function Rxe(){this._cachedShowFrustumsShaders={}}function n_t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function i_t(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=Ue.replaceMain(f,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`;function Cg(){this._sceneFramebuffer=new HE;let e=.125,t=new Array(6);t[0]=new mo({fragmentShader:Pu,textureScale:e,forcePowerOfTwo:!0,sampleMode:Kf.LINEAR});let n=t[1]=new mo({fragmentShader:I4,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new U,t[2]=new mo({fragmentShader:bb,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new mo({fragmentShader:bb,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new mo({fragmentShader:Pu,sampleMode:Kf.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new mo({fragmentShader:D4,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Ru({stages:t});let o=new qE(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}Cg.prototype.get=function(e){return this._stages.get(e)};Cg.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var i_t=new oe,Rxe=new U,o_t=new U,Oxe=new F;function r_t(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=F.computeViewportTransformation(n,0,1,Oxe),u=F.multiplyByPoint(r,o,i_t),f=Ot.pointToGLWindowCoordinates(s,c,o,Rxe);u.x+=P.SOLAR_RADIUS;let h=Ot.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(h,f,h))*30*2,_=o_t;_.x=p,_.y=p,e._uCenter=U.clone(f,e._uCenter),e._uRadius=Math.max(_.x,_.y)*.15;let m=t.drawingBufferWidth,x=t.drawingBufferHeight,b=e._stages,T=b.get(0),C=T.outputTexture.width,A=T.outputTexture.height,S=new qe;S.width=C,S.height=A,c=F.computeViewportTransformation(S,0,1,Oxe),f=Ot.pointToGLWindowCoordinates(s,c,o,Rxe),_.x*=C/m,_.y*=A/x;let v=T.scissorRectangle;v.x=Math.max(f.x-_.x*.5,0),v.y=Math.max(f.y-_.y*.5,0),v.width=Math.min(_.x,m),v.height=Math.min(_.y,x);for(let D=1;D<4;++D)qe.clone(v,b.get(D).scissorRectangle)}Cg.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Cg.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),r_t(this,t,n),o};Cg.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};Cg.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Pu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Cg.prototype.isDestroyed=function(){return!1};Cg.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var P4=Cg;function Mxe(){this._cachedShowFrustumsShaders={}}function s_t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function a_t(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=Ue.replaceMain(f,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; `,a+=`uniform vec3 debugShowFrustumsColor; `,a+=`void main() { @@ -13882,7 +13164,7 @@ void main() `,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor; `;else a+=` out_FragColor.rgb *= debugShowCommandsColor; `,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",o.sources.push(a);let u=n_t(i);return en.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var nP=new z;function o_t(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(nP.red=t.debugOverlappingFrustums&1?1:0,nP.green=t.debugOverlappingFrustums&2?1:0,nP.blue=t.debugOverlappingFrustums&4?1:0,nP.alpha=1,nP):z.WHITE}),n}var r_t=new $e;Rxe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=i_t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=$e.shallowClone(t,r_t);r.shaderProgram=o,r.uniformMap=o_t(e,t),r.execute(e.context,n)};var H4=Rxe;function Db(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new wn}Db.fromKeyframeNode=function(e,t,n,i){let o=new Db(e,t,n),{spatialNode:r,metadata:s}=i;return o._metadata=s_t(e,s,n),o._orientedBoundingBox=c_t(e,r,n,o._orientedBoundingBox),o};function s_t(e,t,n){if(!l(t))return;let{names:i,types:o}=e.provider,r={};for(let s=0;s<i.length;s++){let a=i[s],c=lt.getComponentCount(o[s]),u=t[s].slice(n*c,(n+1)*c);r[a]=u}return r}var Oxe=new d,a_t=new d;function c_t(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),u=a-c*o.x,f=d.fromElements(u,c,s,Oxe),h=d.divideComponents(d.subtract(f,e._paddingBefore,Oxe),e.dimensions,a_t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(Db.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});Db.prototype.hasProperty=function(e){return l(this._metadata[e])};Db.prototype.getNames=function(){return Object.keys(this._metadata)};Db.prototype.getProperty=function(e){return this._metadata[e]};var G4=Db;var W4=`struct Ray { +`;a+="}",o.sources.push(a);let u=s_t(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var rP=new z;function c_t(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(rP.red=t.debugOverlappingFrustums&1?1:0,rP.green=t.debugOverlappingFrustums&2?1:0,rP.blue=t.debugOverlappingFrustums&4?1:0,rP.alpha=1,rP):z.WHITE}),n}var l_t=new $e;Mxe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=a_t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=$e.shallowClone(t,l_t);r.shaderProgram=o,r.uniformMap=c_t(e,t),r.execute(e.context,n)};var R4=Mxe;function Db(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new wn}Db.fromKeyframeNode=function(e,t,n,i){let o=new Db(e,t,n),{spatialNode:r,metadata:s}=i;return o._metadata=u_t(e,s,n),o._orientedBoundingBox=d_t(e,r,n,o._orientedBoundingBox),o};function u_t(e,t,n){if(!l(t))return;let{names:i,types:o}=e.provider,r={};for(let s=0;s<i.length;s++){let a=i[s],c=ct.getComponentCount(o[s]),u=t[s].slice(n*c,(n+1)*c);r[a]=u}return r}var Lxe=new d,f_t=new d;function d_t(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),u=a-c*o.x,f=d.fromElements(u,c,s,Lxe),h=d.divideComponents(d.subtract(f,e._paddingBefore,Lxe),e.dimensions,f_t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(Db.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});Db.prototype.hasProperty=function(e){return l(this._metadata[e])};Db.prototype.getNames=function(){return Object.keys(this._metadata)};Db.prototype.getProperty=function(e){return this._metadata[e]};var O4=Db;var M4=`struct Ray { vec3 pos; vec3 dir; vec3 rawDir; @@ -13913,7 +13195,7 @@ struct PointJacobianT { vec3 point; mat3 jacobianT; }; -`;var j4=`// See Intersection.glsl for the definition of intersectScene +`;var L4=`// See Intersection.glsl for the definition of intersectScene // See IntersectionUtils.glsl for the definition of nextIntersection // See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl // for the definition of convertUvToShapeUvSpace. The appropriate function is @@ -14171,7 +13453,7 @@ void main() out_FragColor = colorAccum; #endif } -`;var q4=`in vec2 position; +`;var N4=`in vec2 position; uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; @@ -14182,7 +13464,7 @@ void main() { vec2 scale = 0.5 * (aabbMax - aabbMin); gl_Position = vec4(position * scale + translation, 0.0, 1.0); } -`;var Y4=`/* Intersection defines +`;var F4=`/* Intersection defines #define INTERSECTION_COUNT ### */ @@ -14348,7 +13630,7 @@ RayShapeIntersection nextIntersection(inout Intersections ix) { #endif // NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1 -`;var X4=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, +`;var B4=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, // setIntersectionPair, INF_HIT, NO_HIT /* intersectDepth defines (set in Scene/VoxelRenderResources.js) @@ -14371,7 +13653,7 @@ void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); } } -`;var K4=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, +`;var k4=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, // NO_HIT, setShapeIntersection /* Clipping plane defines (set in Scene/VoxelRenderResources.js) @@ -14449,7 +13731,7 @@ void intersectClippingPlanes(in Ray ray, inout Intersections ix) { setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); #endif } -`;var iP=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, +`;var sP=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, // RayShapeIntersection vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) { @@ -14551,7 +13833,7 @@ RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) return RayShapeIntersection(miss, miss); } } -`;var Z4=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection, +`;var V4=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection, // NO_HIT, Intersections /* Box defines (set in Scene/VoxelBoxShape.js) @@ -14598,7 +13880,7 @@ void intersectShape(in Ray ray, inout Intersections ix) RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds); setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } -`;var $4=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections, +`;var U4=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections, // RayShapeIntersection, setSurfaceIntersection, setShapeIntersection, // intersectIntersections // See IntersectLongitude.glsl for the definitions of intersectHalfPlane, @@ -14744,7 +14026,7 @@ void intersectShape(Ray ray, inout Intersections ix) setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]); #endif } -`;var Q4=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections, +`;var z4=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections, // RayShapeIntersection, setSurfaceIntersection, setShapeIntersection // See IntersectLongitude.glsl for the definitions of intersectHalfPlane, // intersectFlippedWedge, intersectRegularWedge @@ -15082,7 +14364,7 @@ void intersectShape(in Ray ray, inout Intersections ix) { setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]); #endif } -`;var YE=`// Main intersection function for Voxel scenes. +`;var ZE=`// Main intersection function for Voxel scenes. // See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl // for the definition of intersectShape. The appropriate function is selected // based on the VoxelPrimitive shape type, and added to the shader in @@ -15134,7 +14416,7 @@ RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Interse return intersection; } -`;var J4=`/* Box defines (set in Scene/VoxelBoxShape.js) +`;var H4=`/* Box defines (set in Scene/VoxelBoxShape.js) #define BOX_HAS_SHAPE_BOUNDS */ @@ -15178,7 +14460,7 @@ vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { #else return shapeUv; #endif -}`;var eH=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) +}`;var G4=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) #define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS #define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE @@ -15277,7 +14559,7 @@ vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { return vec3(radius, height, angle); } -`;var tH=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) +`;var W4=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE @@ -15416,7 +14698,7 @@ vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { return vec3(longitude, latitude, height); } -`;var nH=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js +`;var j4=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js #define OCTREE_FLAG_INTERNAL 0 #define OCTREE_FLAG_LEAF 1 #define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 @@ -15641,7 +14923,7 @@ void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData trave sampleDatas[1].tileUv = getClampedTileUv(shapePosition, sampleDatas[1].tileCoords); #endif } -`;var iH=`// See Octree.glsl for the definitions of SampleData and intMod +`;var q4=`// See Octree.glsl for the definitions of SampleData and intMod /* Megatexture defines (set in Scene/VoxelRenderResources.js) #define SAMPLE_COUNT ### @@ -15776,11 +15058,292 @@ Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_ return properties; #endif } -`;function l_t(e){let t=new vT;this.shaderBuilder=t;let n=e._customShader,i=bt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let _=o[p];t.addUniform(_.type,p,pe.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",pe.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([q4]),t.addFragmentLines([n.fragmentShaderText,"#line 0",nH,W4,Y4,iH]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,pe.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,pe.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,pe.FRAGMENT),t.addFragmentLines([K4])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,pe.FRAGMENT),t.addFragmentLines([X4]));let a=e._provider.shape;a==="BOX"?t.addFragmentLines([J4,Z4,YE]):a==="CYLINDER"?t.addFragmentLines([eH,iP,$4,YE]):a==="ELLIPSOID"&&(t.addDefine("SHAPE_ELLIPSOID",void 0,pe.FRAGMENT),t.addFragmentLines([tH,iP,Q4,YE])),t.addFragmentLines([j4]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let _=u[p];l(_)&&(_=_===!0?void 0:_,t.addDefine(p,_,pe.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,pe.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,pe.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,pe.FRAGMENT),(!d.equals(e.paddingBefore,d.ZERO)||!d.equals(e.paddingAfter,d.ZERO))&&t.addDefine("PADDING",void 0,pe.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,pe.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,pe.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,pe.FRAGMENT)}var oH=l_t;function u_t(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,pe.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,pe.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],L=o[R],g=`PropertyStatistics_${M}`,E=`PropertyStatistics_${M}`;n.addStruct(g,E,pe.FRAGMENT);let w=rH(L);n.addStructField(g,w,"min"),n.addStructField(g,w,"max")}let f="Statistics",h="Statistics",p="statistics";n.addStruct(f,h,pe.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],L=`PropertyStatistics_${M}`,g=M;n.addStructField(f,L,g)}let _="Metadata",m="Metadata",x="metadata";n.addStruct(_,m,pe.FRAGMENT),n.addStructField(_,h,p);for(let R=0;R<c;R++){let M=i[R],L=o[R],g=rH(L);n.addStructField(_,g,M)}for(let R=0;R<c;R++){let M=i[R],L=o[R],g=d_t(L),E=`VoxelProperty_${M}`,w=`VoxelProperty_${M}`;n.addStruct(E,w,pe.FRAGMENT),n.addStructField(E,g,"partialDerivativeLocal"),n.addStructField(E,g,"partialDerivativeWorld"),n.addStructField(E,g,"partialDerivativeView"),n.addStructField(E,g,"partialDerivativeValid")}let b="Voxel",T="Voxel",C="voxel";n.addStruct(b,T,pe.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],L=`VoxelProperty_${M}`;n.addStructField(b,L,M)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance"),n.addStructField(b,"int","stepCount"),n.addStructField(b,"int","tileIndex"),n.addStructField(b,"int","sampleIndex");let A="FragmentInput";n.addStruct(A,"FragmentInput",pe.FRAGMENT),n.addStructField(A,m,x),n.addStructField(A,T,C);let v="Properties",D="Properties",O="properties";n.addStruct(v,D,pe.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],L=o[R],g=rH(L);n.addStructField(v,g,M)}{let R="clearProperties";n.addFunction(R,`${D} clearProperties()`,pe.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let L=i[M],g=o[M],E=r[M],w=rH(g,E);n.addFunctionLines(R,[`${O}.${L} = ${w}(0.0);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="sumProperties";n.addFunction(R,`${D} sumProperties(${D} propertiesA, ${D} propertiesB)`,pe.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(R,[`${O}.${L} = propertiesA.${L} + propertiesB.${L};`])}n.addFunctionLines(R,[`return ${O};`])}{let R="scaleProperties";n.addFunction(R,`${D} scaleProperties(${D} ${O}, float scale)`,pe.FRAGMENT),n.addFunctionLines(R,[`${D} scaledProperties = ${O};`]);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(R,[`scaledProperties.${L} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${D} mixProperties(${D} propertiesA, ${D} propertiesB, float mixFactor)`,pe.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(R,[`${O}.${L} = mix(propertiesA.${L}, propertiesB.${L}, mixFactor);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${D} ${O}, inout ${m} ${x})`,pe.FRAGMENT);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(R,[`${x}.${L} = ${O}.${L};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${h} ${p})`,pe.FRAGMENT);for(let M=0;M<c;M++){let L=i[M],g=o[M],E=lt.getComponentCount(g);for(let w=0;w<E;w++){let I=h_t(g,w),N=s[M][w],B=a[M][w];n.addFunctionLines(R,[`${p}.${L}.min${I} = ${Mxe(N)};`,`${p}.${L}.max${I} = ${Mxe(B)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${D} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,pe.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let L=i[M],g=o[M],E=r[M],w=f_t(g,E);n.addFunctionLines(R,[`properties.${L} = texture(u_megatextureTextures[${M}], texcoord)${w};`])}n.addFunctionLines(R,[`return ${O};`])}}function rH(e){if(e===lt.SCALAR)return"float";if(e===lt.VEC2)return"vec2";if(e===lt.VEC3)return"vec3";if(e===lt.VEC4)return"vec4"}function f_t(e){if(e===lt.SCALAR)return".r";if(e===lt.VEC2)return".ra";if(e===lt.VEC3)return".rgb";if(e===lt.VEC4)return""}function d_t(e){if(e===lt.SCALAR)return"vec3";if(e===lt.VEC2)return"mat2";if(e===lt.VEC3)return"mat3";if(e===lt.VEC4)return"mat4"}function Mxe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function h_t(e,t){return e===lt.SCALAR?"":`[${t}]`}var sH=u_t;function m_t(e,t){let n=new oH(e);sH(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let T="getClippingPlane",C=Uy(o,t),A=0,S=C.indexOf(")")+1,v=C.indexOf("{",S)+1,D=C.indexOf("}",v),O=C.slice(A,S),R=C.slice(v,D);i.addFunction(T,O,pe.FRAGMENT),i.addFunctionLines(T,[R])}let s=i.clone();s.addDefine("PICKING",void 0,pe.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,pe.FRAGMENT);let c=i.buildShaderProgram(t),u=s.buildShaderProgram(t),f=a.buildShaderProgram(t),h=Ve.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),_=e._depthTest,m=new $e({vertexArray:p,primitiveType:Me.TRIANGLES,renderState:h,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:we.VOXELS,executeInClosestFrustum:!0,owner:this,cull:_,occlude:_}),x=$e.shallowClone(m,new $e);x.shaderProgram=u,x.pickOnly=!0;let b=$e.shallowClone(m,new $e);if(b.shaderProgram=f,b.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=m,e._drawCommandPick=x,e._drawCommandPickVoxel=b}var aH=m_t;function kl(){this.orientedBoundingBox=new wn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=d.clone(kl.DefaultMinBounds,new d),this._maxBounds=d.clone(kl.DefaultMaxBounds,new d),this.shaderUniforms={renderMinBounds:new d,renderMaxBounds:new d,boxUvToShapeUvScale:new d,boxUvToShapeUvTranslate:new d},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var p_t=new d,sK=new d,g_t=new $,__t=new d,y_t=new d,x_t=new d,b_t=new d,Lxe=F.fromRotationTranslation($.fromUniformScale(.5,new $),new d(.5,.5,.5),new F);kl.prototype.update=function(e,t,n,i,o){i=y(i,kl.DefaultMinBounds),o=y(o,kl.DefaultMaxBounds);let r=kl.DefaultMinBounds,s=kl.DefaultMaxBounds;t=this._minBounds=d.clamp(t,r,s,this._minBounds),n=this._maxBounds=d.clamp(n,r,s,this._maxBounds),i=d.clamp(i,r,s,__t),o=d.clamp(o,r,s,y_t);let a=d.clamp(t,i,o,x_t),c=d.clamp(n,i,o,b_t),u=F.getScale(e,sK);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||u.x===0||u.y===0||u.z===0)return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=cK(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:f,shaderDefines:h}=this;for(let m in h)h.hasOwnProperty(m)&&(h[m]=void 0);let p=!d.equals(t,r)||!d.equals(n,s),_=0;if(h.BOX_INTERSECTION_INDEX=_,_+=1,f.renderMinBounds=F.multiplyByPoint(Lxe,a,f.renderMinBounds),f.renderMaxBounds=F.multiplyByPoint(Lxe,c,f.renderMaxBounds),p){h.BOX_HAS_SHAPE_BOUNDS=!0;let m=t,x=n;f.boxUvToShapeUvScale=d.fromElements(2/(m.x===x.x?1:x.x-m.x),2/(m.y===x.y?1:x.y-m.y),2/(m.z===x.z?1:x.z-m.z),f.boxUvToShapeUvScale),f.boxUvToShapeUvTranslate=d.fromElements(-f.boxUvToShapeUvScale.x*(m.x*.5+.5),-f.boxUvToShapeUvScale.y*(m.y*.5+.5),-f.boxUvToShapeUvScale.z*(m.z*.5+.5),f.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=_,!0};var cH=new d,aK=new d;kl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=d.fromElements(P.lerp(r.x,s.x,a*t),P.lerp(r.y,s.y,a*n),P.lerp(r.z,s.z,a*i),cH),u=d.fromElements(P.lerp(r.x,s.x,a*(t+1)),P.lerp(r.y,s.y,a*(n+1)),P.lerp(r.z,s.z,a*(i+1)),aK);return cK(c,u,this.shapeTransform,o)};var Nxe=new d;kl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,Nxe),s=d.multiplyByScalar(r,o,Nxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,cH),o,cH),c=d.add(a,s,aK),u=this._minBounds,f=this._maxBounds,h=d.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),cH),p=d.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),aK);return cK(h,p,this.shapeTransform,i)};kl.DefaultMinBounds=Object.freeze(new d(-1,-1,-1));kl.DefaultMaxBounds=Object.freeze(new d(1,1,1));function cK(e,t,n,i){let o=kl.DefaultMinBounds,r=kl.DefaultMaxBounds;if(d.equals(e,o)&&d.equals(t,r))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,sK),c=d.midpoint(e,t,p_t);i.center=F.multiplyByPoint(n,c,i.center),a=d.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),sK);let u=F.getRotation(n,g_t);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var Cg=kl;function Qr(){this.orientedBoundingBox=new wn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._minimumRadius=Qr.DefaultMinBounds.x,this._maximumRadius=Qr.DefaultMaxBounds.x,this._minimumHeight=Qr.DefaultMinBounds.y,this._maximumHeight=Qr.DefaultMaxBounds.y,this._minimumAngle=Qr.DefaultMinBounds.z,this._maximumAngle=Qr.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderHeightMinMax:new U,cylinderRenderRadiusMinMax:new U,cylinderRenderAngleMinMax:new U,cylinderUvToShapeUvRadius:new U,cylinderUvToShapeUvHeight:new U,cylinderUvToShapeUvAngle:new U,cylinderShapeUvAngleMinMax:new U,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var Vxe=new d;Qr.prototype.update=function(e,t,n,i,o){i=y(i,Qr.DefaultMinBounds),o=y(o,Qr.DefaultMaxBounds);let r=Qr.DefaultMinBounds.x,s=Qr.DefaultMaxBounds.x,a=Qr.DefaultMinBounds.y,c=Qr.DefaultMaxBounds.y,u=Qr.DefaultMinBounds.z,f=Qr.DefaultMaxBounds.z,h=f-u,p=.5*h,_=P.EPSILON10,m=P.EPSILON3,x=P.EPSILON10,b=P.clamp(t.x,r,s),T=P.clamp(n.x,r,s),C=P.clamp(i.x,r,s),A=P.clamp(o.x,r,s),S=Math.max(b,C),v=Math.min(T,A),D=P.clamp(t.y,a,c),O=P.clamp(n.y,a,c),R=P.clamp(i.y,a,c),M=P.clamp(o.y,a,c),L=Math.max(D,R),g=Math.min(O,M),E=P.negativePiToPi(t.z),w=P.negativePiToPi(n.z),I=P.negativePiToPi(i.z),N=P.negativePiToPi(o.z),B=Math.max(E,I),H=Math.min(w,N),V=F.getScale(e,Vxe);if(v===0||S>v||L>g||P.equalsEpsilon(V.x,0,void 0,_)||P.equalsEpsilon(V.y,0,void 0,_)||P.equalsEpsilon(V.z,0,void 0,_))return!1;this._minimumRadius=b,this._maximumRadius=T,this._minimumHeight=D,this._maximumHeight=O,this._minimumAngle=E,this._maximumAngle=w,this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=uK(S,v,L,g,B,H,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let W=b===r&&T===s,Y=D===a&&O===c,J=w<E,j=w-E+J*h,K=j>p+x&&j<h-x,Q=j<p-x,de=j>=p-x&&j<=p+x,ye=K||Q||de,ce=P.equalsEpsilon(E,u,void 0,m),ge=P.equalsEpsilon(w,f,void 0,m),xe=S===r,De=H<B,Ae=H-B+De*h,ke=Ae>=p-x&&Ae<h-x,ze=Ae>x&&Ae<p-x,et=Ae<=x,St=ke||ze||et,{shaderUniforms:mt,shaderDefines:Be}=this;for(let Ct in Be)Be.hasOwnProperty(Ct)&&(Be[Ct]=void 0);let Yt=0;if(Be.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Yt,Yt+=1,xe||(Be.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Be.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Yt,Yt+=1),mt.cylinderRenderRadiusMinMax=U.fromElements(S,v,mt.cylinderRenderRadiusMinMax),S===v&&(Be.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!W){Be.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Ct=T-b,ut=0,Jt=1;Ct!==0&&(ut=1/Ct,Jt=-b/Ct),mt.cylinderUvToShapeUvRadius=U.fromElements(ut,Jt,mt.cylinderUvToShapeUvRadius)}if(!Y){Be.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Ct=O-D,ut=0,Jt=1;Ct!==0&&(ut=2/Ct,Jt=-(D+1)/Ct),mt.cylinderUvToShapeUvHeight=U.fromElements(ut,Jt,mt.cylinderUvToShapeUvHeight)}if(mt.cylinderRenderHeightMinMax=U.fromElements(L,g,mt.cylinderRenderHeightMinMax),J&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),St&&(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Be.CYLINDER_INTERSECTION_INDEX_ANGLE=Yt,ke?(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Yt+=1):ze?(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Yt+=2):et&&(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Yt+=2),mt.cylinderRenderAngleMinMax=U.fromElements(B,H,mt.cylinderRenderAngleMinMax)),ye){Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ce&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),ge&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Ct=(E-u)/h,ut=(w-u)/h,Jt=1-j/h;if(mt.cylinderShapeUvAngleMinMax=U.fromElements(Ct,ut,mt.cylinderShapeUvAngleMinMax),mt.cylinderShapeUvAngleRangeZeroMid=(ut+.5*Jt)%1,j<=x)mt.cylinderUvToShapeUvAngle=U.fromElements(0,1,mt.cylinderUvToShapeUvAngle);else{let Ce=h/j,Te=-(E-u)/j;mt.cylinderUvToShapeUvAngle=U.fromElements(Ce,Te,mt.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=Yt,!0};Qr.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,u=this._minimumAngle,f=this._maximumAngle,h=1/Math.pow(2,e),p=P.lerp(r,s,t*h),_=P.lerp(r,s,(t+1)*h),m=P.lerp(a,c,n*h),x=P.lerp(a,c,(n+1)*h),b=P.lerp(u,f,i*h),T=P.lerp(u,f,(i+1)*h);return uK(p,_,m,x,b,T,this.shapeTransform,o)};var Fxe=new d,Bxe=new d,T_t=new d;Qr.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,Fxe),s=d.multiplyByScalar(r,o,Fxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,Bxe),o,Bxe),c=d.add(a,s,T_t),u=this._minimumRadius,f=this._maximumRadius,h=this._minimumHeight,p=this._maximumHeight,_=this._minimumAngle,m=this._maximumAngle,x=P.lerp(u,f,a.x),b=P.lerp(u,f,c.x),T=P.lerp(h,p,a.y),C=P.lerp(h,p,c.y),A=P.lerp(_,m,a.z),S=P.lerp(_,m,c.z);return uK(x,b,T,C,A,S,this.shapeTransform,i)};Qr.DefaultMinBounds=Object.freeze(new d(0,-1,-P.PI));Qr.DefaultMaxBounds=Object.freeze(new d(1,1,+P.PI));var C_t=5,A_t=new Array(C_t),E_t=new d,S_t=new $,v_t=new F,w_t=new F,D_t=new F,lK=new F,I_t=new d,P_t=new d,R_t=new d,Uxe=new Array(8);for(let e=0;e<8;e++)Uxe[e]=new d;function kxe(e,t,n){return Math.abs(oe.dot(e,t))<n}function O_t(e){let t=F.getColumn(e,0,I_t),n=F.getColumn(e,1,P_t),i=F.getColumn(e,2,R_t),o=P.EPSILON4;return kxe(t,n,o)&&kxe(n,i,o)}function M_t(e,t){let n=Uxe;d.fromElements(-.5,-.5,-.5,n[0]),d.fromElements(-.5,-.5,.5,n[1]),d.fromElements(-.5,.5,-.5,n[2]),d.fromElements(-.5,.5,.5,n[3]),d.fromElements(.5,-.5,-.5,n[4]),d.fromElements(.5,-.5,.5,n[5]),d.fromElements(.5,.5,-.5,n[6]),d.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)F.multiplyByPoint(e,n[i],n[i]);return wn.fromPoints(n,t)}function uK(e,t,n,i,o,r,s,a){let c=Qr.DefaultMinBounds,u=Qr.DefaultMaxBounds,f=c.x,h=u.x,p=c.y,_=u.y,m=c.z,x=u.z;if(e===f&&t===h&&n===p&&i===_&&o===m&&r===x)return a.center=F.getTranslation(s,a.center),a.halfAxes=F.getMatrix3(s,a.halfAxes),a;r<o&&(r+=P.TWO_PI);let T=r-o,C=o+T*.5,A=A_t,S=0;A[S++]=o,A[S++]=r,A[S++]=C,T>P.PI&&(A[S++]=C-P.PI_OVER_TWO,A[S++]=C+P.PI_OVER_TWO);let v=1,D=1,O=-1,R=-1;for(let J=0;J<S;++J){let j=A[J]-C,K=Math.cos(j),Q=Math.sin(j),de=K*e,ye=Q*e,ce=K*t,ge=Q*t;v=Math.min(v,de),D=Math.min(D,ye),v=Math.min(v,ce),D=Math.min(D,ge),O=Math.max(O,de),R=Math.max(R,ye),O=Math.max(O,ce),R=Math.max(R,ge)}let M=O-v,L=R-D,g=i-n,E=(v+O)*.5,w=(D+R)*.5,I=(n+i)*.5,N=d.fromElements(E,w,I,E_t),B=$.fromRotationZ(C,S_t),H=d.fromElements(M,L,g,Vxe),V=F.fromScale(H,D_t),G=F.fromRotation(B,w_t),k=F.fromTranslation(N,v_t),W=F.multiplyTransformation(G,F.multiplyTransformation(k,V,lK),lK),Y=F.multiplyTransformation(s,W,lK);return O_t(Y)?wn.fromTransformation(Y,a):M_t(Y,a)}var Ag=Qr;function Eg(){this.orientedBoundingBox=new wn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._rectangle=new se,this._minimumHeight=Eg.DefaultMinBounds.z,this._maximumHeight=Eg.DefaultMaxBounds.z,this._ellipsoid=new ee,this._translation=new d,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new d,eccentricitySquared:0,evoluteScale:new U,ellipsoidInverseRadiiSquaredUv:new d,ellipsoidRenderLongitudeMinMax:new U,ellipsoidShapeUvLongitudeMinMaxMid:new d,ellipsoidUvToShapeUvLongitude:new U,ellipsoidUvToShapeUvLatitude:new U,ellipsoidRenderLatitudeSinMinMax:new U,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new U},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var L_t=new d,N_t=new d,F_t=new d,B_t=new d,k_t=new d,V_t=new d,U_t=new d,z_t=new d,H_t=new $,zxe=new d,Hxe=new d,G_t=new se;Eg.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=Eg;i=y(i,r),o=y(o,s);let a=P.EPSILON10,c=P.EPSILON3,u=P.EPSILON10,f=P.EPSILON10,h=P.EPSILON3,p=F.getScale(e,z_t),_=d.clone(r,L_t);_.z=-d.minimumComponent(p);let m=d.clamp(t,_,s,N_t),x=d.clamp(n,_,s,F_t),b=d.clamp(i,_,s,B_t),T=d.clamp(o,_,s,k_t),C=d.maximumByComponent(m,b,V_t),A=d.minimumByComponent(x,T,U_t),S=d.add(p,d.fromElements(x.z,x.z,x.z,zxe),zxe),v=d.maximumComponent(S),D=d.add(p,d.fromElements(A.z,A.z,A.z,Hxe),Hxe);if(C.y>A.y||C.y===s.y||A.y===r.y||C.z>A.z||P.equalsEpsilon(D,d.ZERO,void 0,a))return!1;this._rectangle=se.fromRadians(m.x,m.y,x.x,x.y),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=ee.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=x.z;let O=se.fromRadians(C.x,C.y,A.x,A.y,G_t);this.orientedBoundingBox=fK(O,C.z,A.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=F.fromRotationTranslation($.setScale(this._rotation,S,H_t),this._translation,this.shapeTransform),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let R=s.x-r.x,M=.5*R,L=A.x<C.x,g=A.x-C.x+L*R,E=g<=u,w=g>=M-u&&g<R-u,I=g>u&&g<M-u,N=E||w||I,B=x.x<m.x,H=x.x-m.x+B*R,V=H>M+u&&H<R-u,G=H>=M-u&&H<=M+u,k=H<M-u,W=V||G||k,Y=A.y<-h,J=A.y>=-h&&A.y<=+h,j=A.y>+h&&A.y<s.y-f,K=Y||J||j,Q=C.y>r.y+f&&C.y<-h,de=C.y>=-h&&C.y<=+h,ye=C.y>+h,ce=Q||de||ye,ge=K||ce,xe=x.y-m.y,De=x.y<-h,Ae=x.y>=-h&&x.y<=+h,ke=x.y>+h&&x.y<s.y-f,ze=De||Ae||ke,et=m.y>r.y+f&&m.y<-h,St=m.y>=-h&&m.y<=+h,mt=m.y>+h,Yt=ze||(et||St||mt),{shaderUniforms:Ct,shaderDefines:ut}=this;for(let ft in ut)ut.hasOwnProperty(ft)&&(ut[ft]=void 0);Ct.ellipsoidRadiiUv=d.divideByScalar(S,v,Ct.ellipsoidRadiiUv);let{x:Jt,z:Ce}=Ct.ellipsoidRadiiUv,Te=Ce/Jt;Ct.eccentricitySquared=1-Te*Te,Ct.evoluteScale=U.fromElements((Jt*Jt-Ce*Ce)/Jt,(Ce*Ce-Jt*Jt)/Ce,Ct.evoluteScale),Ct.ellipsoidInverseRadiiSquaredUv=d.divideComponents(d.ONE,d.multiplyComponents(Ct.ellipsoidRadiiUv,Ct.ellipsoidRadiiUv,Ct.ellipsoidInverseRadiiSquaredUv),Ct.ellipsoidInverseRadiiSquaredUv);let it=0;ut.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=it,it+=1,ut.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=it,it+=1,Ct.clipMinMaxHeight=U.fromElements((C.z-x.z)/v,(A.z-x.z)/v,Ct.clipMinMaxHeight);let Vi=(x.z-m.z)/v;if(Ct.ellipsoidInverseHeightDifferenceUv=1/Vi,m.z===x.z&&(Ct.ellipsoidInverseHeightDifferenceUv=0),N&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,ut.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=it,w?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,it+=1):I?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,it+=2):E&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,it+=2),Ct.ellipsoidRenderLongitudeMinMax=U.fromElements(C.x,A.x,Ct.ellipsoidRenderLongitudeMinMax)),W)if(ut.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,x.x<m.x&&(ut.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),H<=u)Ct.ellipsoidUvToShapeUvLongitude=U.fromElements(0,1,Ct.ellipsoidUvToShapeUvLongitude);else{let mo=R/H,Ho=-(m.x-r.x)/H;Ct.ellipsoidUvToShapeUvLongitude=U.fromElements(mo,Ho,Ct.ellipsoidUvToShapeUvLongitude)}if(N){let ft=P.equalsEpsilon(C.x,r.x,void 0,c),mo=P.equalsEpsilon(A.x,s.x,void 0,c);ft&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),mo&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Ho=(m.x-r.x)/R,Ma=(x.x-r.x)/R,Cr=(A.x-r.x)/R,hs=1-g/R,Le=(Cr+.5*hs)%1;Ct.ellipsoidShapeUvLongitudeMinMaxMid=d.fromElements(Ho,Ma,Le,Ct.ellipsoidShapeUvLongitudeMinMaxMid)}if(ge&&(ce&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,ut.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=it,Q?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,it+=1):de?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,it+=1):ye&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,it+=2)),K&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,ut.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=it,Y?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,it+=2):J?(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,it+=1):j&&(ut.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,it+=1)),Ct.ellipsoidRenderLatitudeSinMinMax=U.fromElements(Math.sin(C.y),Math.sin(A.y),Ct.ellipsoidRenderLatitudeSinMinMax)),Yt)if(ut.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,xe<f)Ct.ellipsoidUvToShapeUvLatitude=U.fromElements(0,1,Ct.ellipsoidUvToShapeUvLatitude);else{let mo=(s.y-r.y)/xe,Ho=(r.y-m.y)/xe;Ct.ellipsoidUvToShapeUvLatitude=U.fromElements(mo,Ho,Ct.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=it,!0};var jxe=new se;Eg.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,h=(i+1)*r,p=se.subsection(this._rectangle,s,c,a,u,jxe),_=P.lerp(this._minimumHeight,this._maximumHeight,f),m=P.lerp(this._minimumHeight,this._maximumHeight,h);return fK(p,_,m,this._ellipsoid,this._translation,this._rotation,o)};var Gxe=new d,Wxe=new d,W_t=new d;Eg.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,Gxe),s=d.multiplyByScalar(r,o,Gxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,Wxe),o,Wxe),c=d.add(a,s,W_t),u=se.subsection(this._rectangle,a.x,a.y,c.x,c.y,jxe),f=P.lerp(this._minimumHeight,this._maximumHeight,a.z),h=P.lerp(this._minimumHeight,this._maximumHeight,c.z);return fK(u,f,h,this._ellipsoid,this._translation,this._rotation,i)};function fK(e,t,n,i,o,r,s){return s=wn.fromRectangle(e,t,n,i,s),s.center=d.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}Eg.DefaultMinBounds=Object.freeze(new d(-P.PI,-P.PI_OVER_TWO,-ee.WGS84.minimumRadius));Eg.DefaultMaxBounds=Object.freeze(new d(P.PI,P.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var XE=Eg;var Lu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Lu.getMinBounds=function(e){switch(e){case Lu.BOX:return Cg.DefaultMinBounds;case Lu.ELLIPSOID:return XE.DefaultMinBounds;case Lu.CYLINDER:return Ag.DefaultMinBounds}};Lu.getMaxBounds=function(e){switch(e){case Lu.BOX:return Cg.DefaultMaxBounds;case Lu.ELLIPSOID:return XE.DefaultMaxBounds;case Lu.CYLINDER:return Ag.DefaultMaxBounds}};Lu.getShapeConstructor=function(e){switch(e){case Lu.BOX:return Cg;case Lu.ELLIPSOID:return XE;case Lu.CYLINDER:return Ag}};var ki=Object.freeze(Lu);function dh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(dh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});dh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new dh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};dh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};dh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)qxe(this,t)};dh.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,qxe(this,i),t};dh.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],Yxe(this,0)),this._array[e-1]=void 0,t};dh.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=dK(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Yxe(this,n)}return this._array[e-1]=void 0,t};dh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};dh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[dK(this,1,2)?1:2]};function lH(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function oP(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function dK(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function qxe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=oP(e,t,i);for(o!==n&&(lH(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(oP(e,t,r)!==o)break;lH(e,t,r),t=r}}function Yxe(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){oP(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;oP(e,f,r)===i&&(r=f)}}if(oP(e,r,t)===i&&(lH(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);dK(e,r,a)===i&&lH(e,r,a)}t=r}}var KE=dh;var Xxe=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function uH(e,t){this.spatialNode=e,this.keyframe=t,this.state=Xxe.UNLOADED,this.metadata=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}uH.priorityComparator=function(e,t){return e.priority-t.priority};uH.searchComparator=function(e,t){return e.keyframe-t.keyframe};uH.LoadState=Xxe;var eo=uH;function i0(e,t,n,i,o){i===Vt.UNSIGNED_SHORT&&(i=Vt.FLOAT32);let r=e.floatingPointTexture;if(i===Vt.FLOAT32&&!r)throw new re("Floating point texture not supported");let s;i===Vt.FLOAT32||i===Vt.FLOAT64?s=Ke.FLOAT:i===Vt.UINT8&&(s=Ke.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?tt.RED:tt.LUMINANCE:n===2?a=e.webgl2?tt.RG:tt.LUMINANCE_ALPHA:n===3?a=tt.RGB:n===4&&(a=tt.RGBA);let c=512*1024*1024,u=128*1024*1024;o=Math.min(y(o,u),c);let f=Bt.maximumTextureSize,h=Vt.getSizeInBytes(i),p=Math.floor(o/(n*h)),_=Math.min(f,P.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),m=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/m),b=m*t.x,T=x*t.y,C=Math.floor(_/b),A=Math.floor(_/T);if(C===0||A===0)throw new re("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=d.clone(t,new d),this.maximumTileCount=C*A,this.regionCountPerMegatexture=new U(C,A),this.voxelCountPerRegion=new U(b,T),this.sliceCountPerRegion=new U(m,x),this.voxelSizeUv=new U(1/_,1/_),this.sliceSizeUv=new U(t.x/_,t.y/_),this.regionSizeUv=new U(b/_,T/_),this.texture=new Ot({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:_,height:_,sampler:new $t({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR,magnificationFilter:di.LINEAR})});let S=Vt.toComponentDatatype(i);this.tileVoxelDataTemp=X.createTypedArray(S,b*T*n),this.nodes=new Array(this.maximumTileCount);for(let v=0;v<this.maximumTileCount;v++)this.nodes[v]=new j_t(v);for(let v=0;v<this.maximumTileCount;v++){let D=this.nodes[v];D.previousNode=v>0?this.nodes[v-1]:void 0,D.nextNode=v<this.maximumTileCount-1?this.nodes[v+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function j_t(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}i0.prototype.add=function(e){if(this.isFull())throw new he("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};i0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new he("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};i0.prototype.isFull=function(){return this.emptyList===void 0};i0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Vt.UNSIGNED_SHORT&&(i=Vt.FLOAT32);let o=Vt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=P.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/c),_=Math.floor(f/u);if(p*_>=e)break;f*=2}return f*f*n*o};i0.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let b=x%o.x*i.x,T=Math.floor(x/o.x)*i.y;for(let C=0;C<i.y;C++)for(let A=0;A<i.x;A++){let S=x*i.y*i.x+C*i.x+A,v=(T+C)*r.x+(b+A);for(let D=0;D<s;D++)a[v*s+D]=n[S*s+D]}}let c=this.regionCountPerMegatexture,u=r.x,f=r.y,h=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,m={source:{arrayBufferView:a,width:u,height:f},xOffset:h,yOffset:p};this.texture.copyFrom(m)};i0.prototype.isDestroyed=function(){return!1};i0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var rP=i0;function Jf(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=d.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new wn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var q_t=new d;Jf.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,q_t),n=2*d.maximumComponent(t);this.approximateVoxelSize=n/d.minimumComponent(this.dimensions)};Jf.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,u=r+1,f=a+1,h=t+1,p=[[h,r,s,a],[h,u,s,a],[h,r,c,a],[h,u,c,a],[h,r,s,f],[h,u,s,f],[h,r,c,f],[h,u,c,f]];this.children=p.map(([_,m,x,b])=>new Jf(_,m,x,b,this,e,this.dimensions))};Jf.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Jf.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var Kxe={keyframe:0};function sP(e,t){return Kxe.keyframe=e,Oo(t,Kxe,eo.searchComparator)}Jf.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=Y_t(i,h),_=h[p],m=o===i||i<_.keyframe?p:Math.min(p+1,h.length-1),x=h[m],b=i-_.keyframe,T=Zxe(n-t.level,b);T<a&&(a=T,r=_);let C=x.keyframe-o,A=Zxe(n-t.level,C);if(A<c&&(c=A,s=x),b===0&&C===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function Y_t(e,t){let n=sP(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function Zxe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Jf.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Jf.prototype.createKeyframeNode=function(e){let t=sP(e,this.keyframeNodes);if(t<0){t=~t;let n=new eo(this,e);this.keyframeNodes.splice(t,0,n)}};Jf.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=sP(n,this.keyframeNodes);if(i<0)throw new he("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=sP(n,this.renderableKeyframeNodes);if(o<0)throw new he("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=eo.LoadState.UNLOADED,e.metadata={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};Jf.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==eo.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadata.length!==t.length)throw new he("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadata[o])}e.state=eo.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=sP(e.keyframe,n);if(i>=0)throw new he("Keyframe already renderable");i=~i,n.splice(i,0,e)};Jf.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var fH=Jf;function Sg(e,t,n,i,o,r,s){this._primitive=e,this.megatextures=new Array(i.length);for(let m=0;m<i.length;m++){let x=i[m],b=lt.getComponentCount(x),T=o[m];this.megatextures[m]=new rP(t,n,b,T,s)}let a=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let c=e._shape;this.rootNode=new fH(0,0,0,0,void 0,c,n),this._priorityQueue=new KE({maximumLength:a,comparator:eo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(a),this._keyframeNodesInMegatexture=new Array(a),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let u=this._binaryTreeKeyframeWeighting;u[0]=0,u[r-1]=0,hK(u,1,r-2,0);let f=9,h=2048,p=Math.floor(h/f),_=Math.ceil(a/p);this.internalNodeTexture=new Ot({context:t,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,flipY:!1,width:h,height:_,sampler:new $t({minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST})}),this.internalNodeTilesPerRow=p,this.internalNodeTexelSizeUv=new U(1/h,1/_),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}Sg.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function hK(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,hK(e,t,o-1,i+1),hK(e,o+1,n,i+1)}Sg.simultaneousRequestCountMaximum=50;Sg.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=a>1,h=(u?2:1)*(f?2:1);this._sampleCount=h;let p=h>=2;if(p&&!l(this.leafNodeTexture)){let C=Math.floor(512),A=Math.ceil(s/C);this.leafNodeTexture=new Ot({context:r,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,flipY:!1,width:1024,height:A,sampler:new $t({minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST})}),this.leafNodeTexelSizeUv=U.fromElements(1/1024,1/A,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=C}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&$xe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let _=Ci();Z_t(this,e);let m=Ci();J_t(this,h,c);let x=Ci();if(this._debugPrint){let b=m-_,T=x-m,C=x-_;Q_t(this,b,T,C)}};Sg.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Sg.prototype.isDestroyed=function(){return!1};Sg.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function $xe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];$xe(e,i)}}function X_t(e,t){if(e._simultaneousRequestCount>=Sg.simultaneousRequestCountMaximum)return;let n=e._primitive._provider;function i(c){e._simultaneousRequestCount--;let u=n.types.length;if(!l(c))t.state=eo.LoadState.UNAVAILABLE;else if(c===eo.LoadState.FAILED)t.state=eo.LoadState.FAILED;else if(!Array.isArray(c)||c.length!==u)t.state=eo.LoadState.FAILED;else{let f=e.megatextures;for(let h=0;h<u;h++){let{voxelCountPerTile:p,channelCount:_}=f[h],{x:m,y:x,z:b}=p,T=m*x*b,C=c[h],A=T*_;if(C.length===A)t.metadata[h]=C,t.state=eo.LoadState.RECEIVED;else{t.state=eo.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=eo.LoadState.FAILED}let{keyframe:r,spatialNode:s}=t,a=n.requestData({tileLevel:s.level,tileX:s.x,tileY:s.y,tileZ:s.z,keyframe:r});l(a)?(e._simultaneousRequestCount++,t.state=eo.LoadState.RECEIVING,a.then(i).catch(o)):t.state=eo.LoadState.FAILED}function K_t(e){return e/(1+e)}function Z_t(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,r=i.screenSpaceError,s=e._priorityQueue,a=e._keyframeCount,c=P.clamp(Math.floor(e._keyframeLocation),0,a-2),u=c+1,{camera:f,context:h,pixelRatio:p}=t,{positionWC:_,frustum:m}=f,b=h.drawingBufferHeight/p/m.sseDenominator;function T(L,g){if(L.computeScreenSpaceError(_,b),g=L.visibility(t,g),g===ys.MASK_OUTSIDE)return;if(L.visitedFrameNumber=n,a===1)L.createKeyframeNode(0);else if(L.keyframeNodes.length!==a)for(let B=0;B<a;B++)L.createKeyframeNode(B);let{screenSpaceError:E,keyframeNodes:w}=L,I=K_t(E),N=!1;for(let B=0;B<w.length;B++){let H=w[B];H.priority=10*I+$_t(c,H.keyframe,u,e),H.state!==eo.LoadState.UNAVAILABLE&&H.state!==eo.LoadState.FAILED&&H.priority!==-Number.MAX_VALUE&&s.insert(H),H.state===eo.LoadState.LOADED&&(N=!0)}if(E<r||!N){L.children=void 0;return}l(L.children)||L.constructChildNodes(o);for(let B=0;B<8;B++){let H=L.children[B];T(H,g)}}s.reset(),T(e.rootNode,ys.MASK_INDETERMINATE);let C=e._highPriorityKeyframeNodes,A=0,S;for(;s.length>0;)S=s.removeMaximum(),S.highPriorityFrameNumber=n,C[A]=S,A++;let v=e._keyframeNodesInMegatexture,D=e.megatextures[0],O=D.occupiedCount;v.length=O,v.sort(function(L,g){return L.highPriorityFrameNumber===g.highPriorityFrameNumber?g.priority-L.priority:g.highPriorityFrameNumber-L.highPriorityFrameNumber});let R=0,M=0;for(let L=0;L<A;L++)if(S=C[L],!(S.state===eo.LoadState.LOADED||S.spatialNode===void 0)&&(S.state===eo.LoadState.UNLOADED&&X_t(e,S),S.state===eo.LoadState.RECEIVED)){let g=0;if(D.isFull()){g=O-1-R,R++;let E=v[g];E.spatialNode.destroyKeyframeNode(E,e.megatextures)}else g=O+M,M++;S.spatialNode.addKeyframeNodeToMegatextures(S,e.megatextures),v[g]=S}}function $_t(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return P.lerp(a,s,.15+.85*s)}function Q_t(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys(eo.LoadState).length,a=new Array(s),c=new Array(s),u=0;for(let T=0;T<s;T++){let C=new Array(o);a[T]=C;for(let A=0;A<o;A++)C[A]=0;c[T]=0}function f(T){let C=T.keyframeNodes;for(let A=0;A<C.length;A++){let S=C[A],v=S.keyframe,D=S.state;a[D][v]+=1,c[D]+=1,u++}if(l(T.children))for(let A=0;A<8;A++){let S=T.children[A];f(S)}}f(r);let h=`KEYFRAMES: ${a[eo.LoadState.LOADED]}`,p=`UNLOADED: ${c[eo.LoadState.UNLOADED]} | RECEIVING: ${c[eo.LoadState.RECEIVING]} | RECEIVED: ${c[eo.LoadState.RECEIVED]} | LOADED: ${c[eo.LoadState.LOADED]} | FAILED: ${c[eo.LoadState.FAILED]} | UNAVAILABLE: ${c[eo.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,_=Math.round(t*100)/100,m=Math.round(n*100)/100,x=Math.round(i*100)/100,b=`LOAD: ${_} | OCT: ${m} | ALL: ${x}`;console.log(`${h} || ${p} || ${b}`)}var dH={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function J_t(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function h(_,m,x,b,T){let C=!1;if(l(_.children))for(let A=0;A<8;A++){let S=_.children[A];S.computeSurroundingRenderableKeyframeNodes(o),S.isRenderable(r)&&(C=!0)}if(C){u[T]=dH.INTERNAL<<16|m,u[x]=b,a++,b=m,T=b*9+1;for(let A=0;A<8;A++){let S=_.children[A];m=a,x=m*9+0,h(S,m,x,b,T+A)}}else{if(s){let A=c*5,S=_.renderableKeyframeNodePrevious,v=_.level-S.spatialNode.level,D=S.spatialNode.parent,O=l(D)?D.renderableKeyframeNodePrevious:S,R=eyt(_,i,n),M=v,L=1,g=S.megatextureIndex,E=O.megatextureIndex;f[A+0]=R,f[A+1]=M,f[A+2]=L,f[A+3]=g,f[A+4]=E,u[T]=dH.LEAF<<16|c}else{let A=_.renderableKeyframeNodePrevious,v=_.level-A.spatialNode.level===0?dH.LEAF:dH.PACKED_LEAF_FROM_PARENT;u[T]=v<<16|A.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),tyt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&nyt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function eyt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return P.clamp(s,0,1)}function tyt(e,t,n,i){let o=tt.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],_=h*o;for(let m=0;m<o;m++)c[_+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function nyt(e,t,n,i){let o=tt.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let _=e[p*r+0],m=e[p*r+1],x=e[p*r+2],b=e[p*r+3],T=e[p*r+4],C=P.clamp(Math.floor(65536*_),0,65535);u[p*8+0]=C>>>0&255,u[p*8+1]=C>>>8&255,u[p*8+2]=m&255,u[p*8+3]=x&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=T>>>0&255,u[p*8+7]=T>>>8&255}let h={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(h)}Sg.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],u=lt.getComponentCount(a);o+=rP.getApproximateTextureMemoryByteLength(e,t,u,c)}return o};var aP=Sg;var iyt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},cP=Object.freeze(iyt);function oyt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var hH=oyt;function ZE(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}ZE.prototype.getTexture=function(e){return this._textures[e]};function ryt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}ZE.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):ryt(this,e,t)};function syt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?mH(o,r,n):ayt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function mH(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?Jxe(e,n):new Ot({context:n,source:t,sampler:o});return Qxe(o)&&r.generateMipmap(),r}function ayt(e,t,n){let{typedArray:i,sampler:o}=e,r=Qxe(o),s=o.wrapS===An.REPEAT||o.wrapS===An.MIRRORED_REPEAT||o.wrapT===An.REPEAT||o.wrapT===An.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((r||s)&&!u)if(l(i)){if(e.pixelDatatype===Ke.UNSIGNED_BYTE){let h=hH(i,a,c),p=cx(h);return mH({sampler:o},p,n)}}else{let h=cx(t);return mH(e,h,n)}else return mH(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),Jxe(e,n)}function Qxe(e){return[Zt.NEAREST_MIPMAP_NEAREST,Zt.NEAREST_MIPMAP_LINEAR,Zt.LINEAR_MIPMAP_NEAREST,Zt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function Jxe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Ot({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}ZE.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];syt(this,o,t)}n.length=0};ZE.prototype.isDestroyed=function(){return!1};ZE.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var pH=ZE;function lP(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,F_.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,Tx.INHERIT),this._textureManager=new pH,this._defaultTexture=void 0,this.uniformMap=cyt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},fyt(this),dyt(this)}function cyt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===cP.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=lyt(e,i)):n[i]=uyt(e,i)}return n}function lyt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function uyt(e,t){return function(){return e.uniforms[t].value}}function Ib(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function fyt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,Ib(r,t,o),o=e.usedVariablesVertex.featureIdSet,Ib(r,n,o),o=e.usedVariablesVertex.metadataSet,Ib(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,Ib(s,t,o),o=e.usedVariablesFragment.featureIdSet,Ib(s,n,o),o=e.usedVariablesFragment.metadataSet,Ib(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;Ib(s,a,c)}}function ebe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function hc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${ebe(t)} is not available in the ${i} shader. Did you mean ${ebe(n)} instead?`;throw new he(o)}}function dyt(e){let t=e.usedVariablesVertex.attributeSet;hc(t,"position","positionMC","vertex"),hc(t,"normal","normalMC","vertex"),hc(t,"tangent","tangentMC","vertex"),hc(t,"bitangent","bitangentMC","vertex"),hc(t,"positionWC","positionMC","vertex"),hc(t,"positionEC","positionMC","vertex"),hc(t,"normalEC","normalMC","vertex"),hc(t,"tangentEC","tangentMC","vertex"),hc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;hc(n,"position","positionEC","fragment"),hc(n,"normal","normalEC","fragment"),hc(n,"tangent","tangentEC","fragment"),hc(n,"bitangent","bitangentEC","fragment"),hc(n,"normalMC","normalEC","fragment"),hc(n,"tangentMC","tangentEC","fragment"),hc(n,"bitangentMC","bitangentEC","fragment")}lP.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===cP.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};lP.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};lP.prototype.isDestroyed=function(){return!1};lP.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var $E=lP;function Hm(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,Hm.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new d,this._paddingAfter=new d,this._minBounds=new d,this._minBoundsOld=new d,this._maxBounds=new d,this._maxBoundsOld=new d,this._exaggeratedMinBounds=new d,this._exaggeratedMinBoundsOld=new d,this._exaggeratedMaxBounds=new d,this._exaggeratedMaxBoundsOld=new d,this._minClippingBounds=new d,this._minClippingBoundsOld=new d,this._maxClippingBounds=new d,this._maxClippingBoundsOld=new d,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._exaggeratedModelMatrix=F.clone(this._modelMatrix),this._compoundModelMatrix=new F,this._compoundModelMatrixOld=new F,this._customShader=y(e.customShader,Hm.DefaultCustomShader),this._customShaderCompilationEvent=new me,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new F,this._transformPositionUvToWorld=new F,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new rm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new U,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new U,megatextureTextures:[],megatextureSliceDimensions:new U,megatextureTileDimensions:new U,megatextureVoxelSizeUv:new U,megatextureSliceSizeUv:new U,megatextureTileSizeUv:new U,dimensions:new d,paddingBefore:new d,paddingAfter:new d,transformPositionViewToUv:new F,transformPositionUvToView:new F,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new d,ndcSpaceAxisAlignedBoundingBox:new oe,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,stepSize:0,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;hyt(this,i)}function hyt(e,t){let{shape:n,minBounds:i=ki.getMinBounds(n),maxBounds:o=ki.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=ki.getMinBounds(n),e.maxClippingBounds=ki.getMaxBounds(n),e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=F.clone(e._modelMatrix,e._exaggeratedModelMatrix),nbe(e,t);let r=ki.getShapeConstructor(n);e._shape=new r,e._shapeVisible=ibe(e,e._shape,t)}Object.defineProperties(Hm.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=d.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=d.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=d.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=d.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=Hm.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var myt=new d,pyt=new oe,gyt=new oe,_yt=new d,yyt=new d,xyt=new $,byt=new $,Tyt=new F,Cyt=new F,Ayt=new F,Eyt=F.fromRotationTranslation($.fromUniformScale(.5,new $),new d(.5,.5,.5),new F),Syt=F.fromRotationTranslation($.fromUniformScale(2,new $),new d(-1,-1,-1),new F);Hm.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Ryt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}Iyt(this,e);let i=nbe(this,t),o=this._shape;if(i&&(this._shapeVisible=ibe(this,o,t),Lyt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Nyt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&Gyt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Fyt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=U.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(aH(this,n),this._shaderDirty=!1);let h=n.uniformState.viewProjection,p=o.orientedBoundingBox,_=Vyt(p,h,gyt);if(_.x===1||_.y===1||_.z===-1||_.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=oe.clone(_,f.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;f.transformPositionViewToUv=F.multiplyTransformation(this._transformPositionWorldToUv,x,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=F.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let T=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,T,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let C=e.camera.positionWC;f.cameraPositionUv=F.multiplyByPoint(this._transformPositionWorldToUv,C,f.cameraPositionUv),f.stepSize=this._stepSizeMultiplier;let A=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;A.boundingVolume=o.boundingSphere,e.commandList.push(A)};var vyt=new d,mK=new d,wyt=new fe,Dyt=new d;function Iyt(e,t){if(e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===ki.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else if(e.shape===ki.BOX){let n=d.fromElements(1,1,t.verticalExaggeration,vyt);e._exaggeratedModelMatrix=F.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=F.multiplyByTranslation(e._exaggeratedModelMatrix,Pyt(e,t),e._exaggeratedModelMatrix)}}function Pyt(e,t){let{shapeTransform:n=F.IDENTITY,globalTransform:i=F.IDENTITY}=e._provider,o=F.getTranslation(n,mK),r=F.multiplyByPoint(e._modelMatrix,o,mK),s=F.multiplyByPoint(i,r,mK),c=ee.WGS84.cartesianToCartographic(s,wyt),u=0;l(c)&&(u=c.height);let f=Dr.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return d.fromElements(0,0,(f-u)/t.verticalExaggeration,Dyt)}function Ryt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ge(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=d.clone(t.dimensions,i.dimensions),e._paddingBefore=d.clone(y(t.paddingBefore,d.ZERO),e._paddingBefore),i.paddingBefore=d.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=d.clone(y(t.paddingAfter,d.ZERO),e._paddingBefore),i.paddingAfter=d.clone(e._paddingAfter,i.paddingAfter),e._traversal=Oyt(e,t,n),Myt(e._traversal,i)}function nbe(e,t){let n=y(t.shapeTransform,F.IDENTITY),i=y(t.globalTransform,F.IDENTITY);return F.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),F.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),Pb(e,"_compoundModelMatrix","_compoundModelMatrixOld")+Pb(e,"_minBounds","_minBoundsOld")+Pb(e,"_maxBounds","_maxBoundsOld")+Pb(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+Pb(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+Pb(e,"_minClippingBounds","_minClippingBoundsOld")+Pb(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function Pb(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function ibe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=F.inverse(o,Tyt),s=F.getRotation(o,xyt),a=F.getScale(o,_yt),c=d.maximumComponent(a),u=d.divideByScalar(a,c,yyt),f=$.multiplyByScale(s,u,byt);return e._transformPositionWorldToUv=F.multiplyTransformation(Eyt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=F.multiplyTransformation(o,Syt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=F.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function Oyt(e,t,n){let i=d.clone(t.dimensions,myt);d.add(i,e._paddingBefore,i),d.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?aP.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new aP(e,n,i,t.types,t.componentTypes,s,r)}function Myt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=U.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=U.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=U.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=U.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=U.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=U.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function Lyt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ge(n,!0)),i}function Nyt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=Z.secondsDifference(i.stop,i.start),a=Z.secondsDifference(n,i.start)/r;return o+a}function Fyt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=F.transpose(F.multiplyTransformation(F.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}Hm.prototype.isDestroyed=function(){return!1};Hm.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var tbe=new Array(new oe(-1,-1,-1,1),new oe(1,-1,-1,1),new oe(-1,1,-1,1),new oe(1,1,-1,1),new oe(-1,-1,1,1),new oe(1,-1,1,1),new oe(-1,1,1,1),new oe(1,1,1,1)),Byt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),kyt=new Array(new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe);function Vyt(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,Cyt),o=F.multiply(t,i,Ayt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=kyt,h=tbe.length;for(u=0;u<h;u++)F.multiplyByVector(o,tbe[u],f[u]);for(u=0;u<h;u++){let p=f[u];if(p.z>=-p.w){let _=p.x/p.w,m=p.y/p.w;r=Math.min(r,_),s=Math.max(s,_),a=Math.min(a,m),c=Math.max(c,m)}else for(let _=0;_<3;_++){let m=Byt[u*3+_],x=f[m];if(x.z>=-x.w){let b=p.z+p.w,T=x.z+x.w,C=b/(b-T),A=oe.lerp(p,x,C,pyt),S=A.x/A.w,v=A.y/A.w;r=Math.min(r,S),s=Math.max(s,S),a=Math.min(a,v),c=Math.max(c,v)}}}return r=P.clamp(r,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=oe.fromElements(r,a,s,c,n),n}var pK=3e7,Uyt=new d(pK,0,0),zyt=new d(0,pK,0),Hyt=new d(0,0,pK);function Gyt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,h){i.add({positions:[c,u],width:h,material:Yi.fromType("Color",{color:f})})}function r(c,u,f){let h=c.computeCorners();o(h[0],h[1],u,f),o(h[2],h[3],u,f),o(h[4],h[5],u,f),o(h[6],h[7],u,f),o(h[0],h[2],u,f),o(h[4],h[6],u,f),o(h[1],h[3],u,f),o(h[5],h[7],u,f),o(h[0],h[4],u,f),o(h[2],h[6],u,f),o(h[1],h[5],u,f),o(h[3],h[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,h=Math.max(1,5/Math.pow(2,u)),_=[z.RED,z.LIME,z.BLUE][u%3];if(r(c.orientedBoundingBox,_,h),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}r(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;o(d.ZERO,Uyt,z.RED,a),o(d.ZERO,zyt,z.LIME,a),o(d.ZERO,Hyt,z.BLUE,a),i.update(t)}Hm.DefaultCustomShader=new $E({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;function h_t(e){let t=new vT;this.shaderBuilder=t;let n=e._customShader,i=xt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let _=o[p];t.addUniform(_.type,p,ge.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ge.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([N4]),t.addFragmentLines([n.fragmentShaderText,"#line 0",j4,M4,F4,q4]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ge.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ge.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ge.FRAGMENT),t.addFragmentLines([k4])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ge.FRAGMENT),t.addFragmentLines([B4]));let a=e._provider.shape;a==="BOX"?t.addFragmentLines([H4,V4,ZE]):a==="CYLINDER"?t.addFragmentLines([G4,sP,U4,ZE]):a==="ELLIPSOID"&&(t.addDefine("SHAPE_ELLIPSOID",void 0,ge.FRAGMENT),t.addFragmentLines([W4,sP,z4,ZE])),t.addFragmentLines([L4]);let c=e._shape,u=c.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let _=u[p];l(_)&&(_=_===!0?void 0:_,t.addDefine(p,_,ge.FRAGMENT))}let f=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,ge.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,ge.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,ge.FRAGMENT),(!d.equals(e.paddingBefore,d.ZERO)||!d.equals(e.paddingAfter,d.ZERO))&&t.addDefine("PADDING",void 0,ge.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ge.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ge.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,ge.FRAGMENT)}var Y4=h_t;function m_t(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,ge.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,ge.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],L=o[R],g=`PropertyStatistics_${M}`,E=`PropertyStatistics_${M}`;n.addStruct(g,E,ge.FRAGMENT);let w=X4(L);n.addStructField(g,w,"min"),n.addStructField(g,w,"max")}let f="Statistics",h="Statistics",p="statistics";n.addStruct(f,h,ge.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],L=`PropertyStatistics_${M}`,g=M;n.addStructField(f,L,g)}let _="Metadata",m="Metadata",x="metadata";n.addStruct(_,m,ge.FRAGMENT),n.addStructField(_,h,p);for(let R=0;R<c;R++){let M=i[R],L=o[R],g=X4(L);n.addStructField(_,g,M)}for(let R=0;R<c;R++){let M=i[R],L=o[R],g=g_t(L),E=`VoxelProperty_${M}`,w=`VoxelProperty_${M}`;n.addStruct(E,w,ge.FRAGMENT),n.addStructField(E,g,"partialDerivativeLocal"),n.addStructField(E,g,"partialDerivativeWorld"),n.addStructField(E,g,"partialDerivativeView"),n.addStructField(E,g,"partialDerivativeValid")}let b="Voxel",T="Voxel",C="voxel";n.addStruct(b,T,ge.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],L=`VoxelProperty_${M}`;n.addStructField(b,L,M)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance"),n.addStructField(b,"int","stepCount"),n.addStructField(b,"int","tileIndex"),n.addStructField(b,"int","sampleIndex");let A="FragmentInput";n.addStruct(A,"FragmentInput",ge.FRAGMENT),n.addStructField(A,m,x),n.addStructField(A,T,C);let v="Properties",D="Properties",O="properties";n.addStruct(v,D,ge.FRAGMENT);for(let R=0;R<c;R++){let M=i[R],L=o[R],g=X4(L);n.addStructField(v,g,M)}{let R="clearProperties";n.addFunction(R,`${D} clearProperties()`,ge.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let L=i[M],g=o[M],E=r[M],w=X4(g,E);n.addFunctionLines(R,[`${O}.${L} = ${w}(0.0);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="sumProperties";n.addFunction(R,`${D} sumProperties(${D} propertiesA, ${D} propertiesB)`,ge.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(R,[`${O}.${L} = propertiesA.${L} + propertiesB.${L};`])}n.addFunctionLines(R,[`return ${O};`])}{let R="scaleProperties";n.addFunction(R,`${D} scaleProperties(${D} ${O}, float scale)`,ge.FRAGMENT),n.addFunctionLines(R,[`${D} scaledProperties = ${O};`]);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(R,[`scaledProperties.${L} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${D} mixProperties(${D} propertiesA, ${D} propertiesB, float mixFactor)`,ge.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(R,[`${O}.${L} = mix(propertiesA.${L}, propertiesB.${L}, mixFactor);`])}n.addFunctionLines(R,[`return ${O};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${D} ${O}, inout ${m} ${x})`,ge.FRAGMENT);for(let M=0;M<c;M++){let L=i[M];n.addFunctionLines(R,[`${x}.${L} = ${O}.${L};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${h} ${p})`,ge.FRAGMENT);for(let M=0;M<c;M++){let L=i[M],g=o[M],E=ct.getComponentCount(g);for(let w=0;w<E;w++){let I=__t(g,w),N=s[M][w],B=a[M][w];n.addFunctionLines(R,[`${p}.${L}.min${I} = ${Nxe(N)};`,`${p}.${L}.max${I} = ${Nxe(B)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${D} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ge.FRAGMENT),n.addFunctionLines(R,[`${D} ${O};`]);for(let M=0;M<c;M++){let L=i[M],g=o[M],E=r[M],w=p_t(g,E);n.addFunctionLines(R,[`properties.${L} = texture(u_megatextureTextures[${M}], texcoord)${w};`])}n.addFunctionLines(R,[`return ${O};`])}}function X4(e){if(e===ct.SCALAR)return"float";if(e===ct.VEC2)return"vec2";if(e===ct.VEC3)return"vec3";if(e===ct.VEC4)return"vec4"}function p_t(e){if(e===ct.SCALAR)return".r";if(e===ct.VEC2)return".ra";if(e===ct.VEC3)return".rgb";if(e===ct.VEC4)return""}function g_t(e){if(e===ct.SCALAR)return"vec3";if(e===ct.VEC2)return"mat2";if(e===ct.VEC3)return"mat3";if(e===ct.VEC4)return"mat4"}function Nxe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function __t(e,t){return e===ct.SCALAR?"":`[${t}]`}var K4=m_t;function y_t(e,t){let n=new Y4(e);K4(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let T="getClippingPlane",C=Uy(o,t),A=0,S=C.indexOf(")")+1,v=C.indexOf("{",S)+1,D=C.indexOf("}",v),O=C.slice(A,S),R=C.slice(v,D);i.addFunction(T,O,ge.FRAGMENT),i.addFunctionLines(T,[R])}let s=i.clone();s.addDefine("PICKING",void 0,ge.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ge.FRAGMENT);let c=i.buildShaderProgram(t),u=s.buildShaderProgram(t),f=a.buildShaderProgram(t),h=Ve.fromCache({cull:{enabled:!0,face:bi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),_=e._depthTest,m=new $e({vertexArray:p,primitiveType:Me.TRIANGLES,renderState:h,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:we.VOXELS,executeInClosestFrustum:!0,owner:this,cull:_,occlude:_}),x=$e.shallowClone(m,new $e);x.shaderProgram=u,x.pickOnly=!0;let b=$e.shallowClone(m,new $e);if(b.shaderProgram=f,b.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=m,e._drawCommandPick=x,e._drawCommandPickVoxel=b}var Z4=y_t;function Ul(){this.orientedBoundingBox=new wn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=d.clone(Ul.DefaultMinBounds,new d),this._maxBounds=d.clone(Ul.DefaultMaxBounds,new d),this.shaderUniforms={renderMinBounds:new d,renderMaxBounds:new d,boxUvToShapeUvScale:new d,boxUvToShapeUvTranslate:new d},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var x_t=new d,aK=new d,b_t=new $,T_t=new d,C_t=new d,A_t=new d,E_t=new d,Fxe=F.fromRotationTranslation($.fromUniformScale(.5,new $),new d(.5,.5,.5),new F);Ul.prototype.update=function(e,t,n,i,o){i=y(i,Ul.DefaultMinBounds),o=y(o,Ul.DefaultMaxBounds);let r=Ul.DefaultMinBounds,s=Ul.DefaultMaxBounds;t=this._minBounds=d.clamp(t,r,s,this._minBounds),n=this._maxBounds=d.clamp(n,r,s,this._maxBounds),i=d.clamp(i,r,s,T_t),o=d.clamp(o,r,s,C_t);let a=d.clamp(t,i,o,A_t),c=d.clamp(n,i,o,E_t),u=F.getScale(e,aK);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||u.x===0||u.y===0||u.z===0)return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=lK(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:f,shaderDefines:h}=this;for(let m in h)h.hasOwnProperty(m)&&(h[m]=void 0);let p=!d.equals(t,r)||!d.equals(n,s),_=0;if(h.BOX_INTERSECTION_INDEX=_,_+=1,f.renderMinBounds=F.multiplyByPoint(Fxe,a,f.renderMinBounds),f.renderMaxBounds=F.multiplyByPoint(Fxe,c,f.renderMaxBounds),p){h.BOX_HAS_SHAPE_BOUNDS=!0;let m=t,x=n;f.boxUvToShapeUvScale=d.fromElements(2/(m.x===x.x?1:x.x-m.x),2/(m.y===x.y?1:x.y-m.y),2/(m.z===x.z?1:x.z-m.z),f.boxUvToShapeUvScale),f.boxUvToShapeUvTranslate=d.fromElements(-f.boxUvToShapeUvScale.x*(m.x*.5+.5),-f.boxUvToShapeUvScale.y*(m.y*.5+.5),-f.boxUvToShapeUvScale.z*(m.z*.5+.5),f.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=_,!0};var $4=new d,cK=new d;Ul.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=d.fromElements(P.lerp(r.x,s.x,a*t),P.lerp(r.y,s.y,a*n),P.lerp(r.z,s.z,a*i),$4),u=d.fromElements(P.lerp(r.x,s.x,a*(t+1)),P.lerp(r.y,s.y,a*(n+1)),P.lerp(r.z,s.z,a*(i+1)),cK);return lK(c,u,this.shapeTransform,o)};var Bxe=new d;Ul.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,Bxe),s=d.multiplyByScalar(r,o,Bxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,$4),o,$4),c=d.add(a,s,cK),u=this._minBounds,f=this._maxBounds,h=d.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),$4),p=d.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),cK);return lK(h,p,this.shapeTransform,i)};Ul.DefaultMinBounds=Object.freeze(new d(-1,-1,-1));Ul.DefaultMaxBounds=Object.freeze(new d(1,1,1));function lK(e,t,n,i){let o=Ul.DefaultMinBounds,r=Ul.DefaultMaxBounds;if(d.equals(e,o)&&d.equals(t,r))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,aK),c=d.midpoint(e,t,x_t);i.center=F.multiplyByPoint(n,c,i.center),a=d.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),aK);let u=F.getRotation(n,b_t);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var Ag=Ul;function Qr(){this.orientedBoundingBox=new wn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._minimumRadius=Qr.DefaultMinBounds.x,this._maximumRadius=Qr.DefaultMaxBounds.x,this._minimumHeight=Qr.DefaultMinBounds.y,this._maximumHeight=Qr.DefaultMaxBounds.y,this._minimumAngle=Qr.DefaultMinBounds.z,this._maximumAngle=Qr.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderHeightMinMax:new U,cylinderRenderRadiusMinMax:new U,cylinderRenderAngleMinMax:new U,cylinderUvToShapeUvRadius:new U,cylinderUvToShapeUvHeight:new U,cylinderUvToShapeUvAngle:new U,cylinderShapeUvAngleMinMax:new U,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var zxe=new d;Qr.prototype.update=function(e,t,n,i,o){i=y(i,Qr.DefaultMinBounds),o=y(o,Qr.DefaultMaxBounds);let r=Qr.DefaultMinBounds.x,s=Qr.DefaultMaxBounds.x,a=Qr.DefaultMinBounds.y,c=Qr.DefaultMaxBounds.y,u=Qr.DefaultMinBounds.z,f=Qr.DefaultMaxBounds.z,h=f-u,p=.5*h,_=P.EPSILON10,m=P.EPSILON3,x=P.EPSILON10,b=P.clamp(t.x,r,s),T=P.clamp(n.x,r,s),C=P.clamp(i.x,r,s),A=P.clamp(o.x,r,s),S=Math.max(b,C),v=Math.min(T,A),D=P.clamp(t.y,a,c),O=P.clamp(n.y,a,c),R=P.clamp(i.y,a,c),M=P.clamp(o.y,a,c),L=Math.max(D,R),g=Math.min(O,M),E=P.negativePiToPi(t.z),w=P.negativePiToPi(n.z),I=P.negativePiToPi(i.z),N=P.negativePiToPi(o.z),B=Math.max(E,I),H=Math.min(w,N),V=F.getScale(e,zxe);if(v===0||S>v||L>g||P.equalsEpsilon(V.x,0,void 0,_)||P.equalsEpsilon(V.y,0,void 0,_)||P.equalsEpsilon(V.z,0,void 0,_))return!1;this._minimumRadius=b,this._maximumRadius=T,this._minimumHeight=D,this._maximumHeight=O,this._minimumAngle=E,this._maximumAngle=w,this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=fK(S,v,L,g,B,H,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let W=b===r&&T===s,Y=D===a&&O===c,J=w<E,j=w-E+J*h,K=j>p+x&&j<h-x,Q=j<p-x,de=j>=p-x&&j<=p+x,xe=K||Q||de,ce=P.equalsEpsilon(E,u,void 0,m),_e=P.equalsEpsilon(w,f,void 0,m),be=S===r,De=H<B,Ae=H-B+De*h,ke=Ae>=p-x&&Ae<h-x,ze=Ae>x&&Ae<p-x,et=Ae<=x,Et=ke||ze||et,{shaderUniforms:ht,shaderDefines:Be}=this;for(let Tt in Be)Be.hasOwnProperty(Tt)&&(Be[Tt]=void 0);let qt=0;if(Be.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=qt,qt+=1,be||(Be.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Be.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=qt,qt+=1),ht.cylinderRenderRadiusMinMax=U.fromElements(S,v,ht.cylinderRenderRadiusMinMax),S===v&&(Be.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!W){Be.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Tt=T-b,lt=0,Wn=1;Tt!==0&&(lt=1/Tt,Wn=-b/Tt),ht.cylinderUvToShapeUvRadius=U.fromElements(lt,Wn,ht.cylinderUvToShapeUvRadius)}if(!Y){Be.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Tt=O-D,lt=0,Wn=1;Tt!==0&&(lt=2/Tt,Wn=-(D+1)/Tt),ht.cylinderUvToShapeUvHeight=U.fromElements(lt,Wn,ht.cylinderUvToShapeUvHeight)}if(ht.cylinderRenderHeightMinMax=U.fromElements(L,g,ht.cylinderRenderHeightMinMax),J&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Et&&(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Be.CYLINDER_INTERSECTION_INDEX_ANGLE=qt,ke?(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,qt+=1):ze?(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,qt+=2):et&&(Be.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,qt+=2),ht.cylinderRenderAngleMinMax=U.fromElements(B,H,ht.cylinderRenderAngleMinMax)),xe){Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ce&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),_e&&(Be.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Tt=(E-u)/h,lt=(w-u)/h,Wn=1-j/h;if(ht.cylinderShapeUvAngleMinMax=U.fromElements(Tt,lt,ht.cylinderShapeUvAngleMinMax),ht.cylinderShapeUvAngleRangeZeroMid=(lt+.5*Wn)%1,j<=x)ht.cylinderUvToShapeUvAngle=U.fromElements(0,1,ht.cylinderUvToShapeUvAngle);else{let on=h/j,me=-(E-u)/j;ht.cylinderUvToShapeUvAngle=U.fromElements(on,me,ht.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=qt,!0};Qr.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,u=this._minimumAngle,f=this._maximumAngle,h=1/Math.pow(2,e),p=P.lerp(r,s,t*h),_=P.lerp(r,s,(t+1)*h),m=P.lerp(a,c,n*h),x=P.lerp(a,c,(n+1)*h),b=P.lerp(u,f,i*h),T=P.lerp(u,f,(i+1)*h);return fK(p,_,m,x,b,T,this.shapeTransform,o)};var kxe=new d,Vxe=new d,S_t=new d;Qr.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,kxe),s=d.multiplyByScalar(r,o,kxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,Vxe),o,Vxe),c=d.add(a,s,S_t),u=this._minimumRadius,f=this._maximumRadius,h=this._minimumHeight,p=this._maximumHeight,_=this._minimumAngle,m=this._maximumAngle,x=P.lerp(u,f,a.x),b=P.lerp(u,f,c.x),T=P.lerp(h,p,a.y),C=P.lerp(h,p,c.y),A=P.lerp(_,m,a.z),S=P.lerp(_,m,c.z);return fK(x,b,T,C,A,S,this.shapeTransform,i)};Qr.DefaultMinBounds=Object.freeze(new d(0,-1,-P.PI));Qr.DefaultMaxBounds=Object.freeze(new d(1,1,+P.PI));var v_t=5,w_t=new Array(v_t),D_t=new d,I_t=new $,P_t=new F,R_t=new F,O_t=new F,uK=new F,M_t=new d,L_t=new d,N_t=new d,Hxe=new Array(8);for(let e=0;e<8;e++)Hxe[e]=new d;function Uxe(e,t,n){return Math.abs(oe.dot(e,t))<n}function F_t(e){let t=F.getColumn(e,0,M_t),n=F.getColumn(e,1,L_t),i=F.getColumn(e,2,N_t),o=P.EPSILON4;return Uxe(t,n,o)&&Uxe(n,i,o)}function B_t(e,t){let n=Hxe;d.fromElements(-.5,-.5,-.5,n[0]),d.fromElements(-.5,-.5,.5,n[1]),d.fromElements(-.5,.5,-.5,n[2]),d.fromElements(-.5,.5,.5,n[3]),d.fromElements(.5,-.5,-.5,n[4]),d.fromElements(.5,-.5,.5,n[5]),d.fromElements(.5,.5,-.5,n[6]),d.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)F.multiplyByPoint(e,n[i],n[i]);return wn.fromPoints(n,t)}function fK(e,t,n,i,o,r,s,a){let c=Qr.DefaultMinBounds,u=Qr.DefaultMaxBounds,f=c.x,h=u.x,p=c.y,_=u.y,m=c.z,x=u.z;if(e===f&&t===h&&n===p&&i===_&&o===m&&r===x)return a.center=F.getTranslation(s,a.center),a.halfAxes=F.getMatrix3(s,a.halfAxes),a;r<o&&(r+=P.TWO_PI);let T=r-o,C=o+T*.5,A=w_t,S=0;A[S++]=o,A[S++]=r,A[S++]=C,T>P.PI&&(A[S++]=C-P.PI_OVER_TWO,A[S++]=C+P.PI_OVER_TWO);let v=1,D=1,O=-1,R=-1;for(let J=0;J<S;++J){let j=A[J]-C,K=Math.cos(j),Q=Math.sin(j),de=K*e,xe=Q*e,ce=K*t,_e=Q*t;v=Math.min(v,de),D=Math.min(D,xe),v=Math.min(v,ce),D=Math.min(D,_e),O=Math.max(O,de),R=Math.max(R,xe),O=Math.max(O,ce),R=Math.max(R,_e)}let M=O-v,L=R-D,g=i-n,E=(v+O)*.5,w=(D+R)*.5,I=(n+i)*.5,N=d.fromElements(E,w,I,D_t),B=$.fromRotationZ(C,I_t),H=d.fromElements(M,L,g,zxe),V=F.fromScale(H,O_t),G=F.fromRotation(B,R_t),k=F.fromTranslation(N,P_t),W=F.multiplyTransformation(G,F.multiplyTransformation(k,V,uK),uK),Y=F.multiplyTransformation(s,W,uK);return F_t(Y)?wn.fromTransformation(Y,a):B_t(Y,a)}var Eg=Qr;function Sg(){this.orientedBoundingBox=new wn,this.boundingSphere=new ae,this.boundTransform=new F,this.shapeTransform=new F,this._rectangle=new se,this._minimumHeight=Sg.DefaultMinBounds.z,this._maximumHeight=Sg.DefaultMaxBounds.z,this._ellipsoid=new ee,this._translation=new d,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new d,eccentricitySquared:0,evoluteScale:new U,ellipsoidInverseRadiiSquaredUv:new d,ellipsoidRenderLongitudeMinMax:new U,ellipsoidShapeUvLongitudeMinMaxMid:new d,ellipsoidUvToShapeUvLongitude:new U,ellipsoidUvToShapeUvLatitude:new U,ellipsoidRenderLatitudeSinMinMax:new U,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new U},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var k_t=new d,V_t=new d,U_t=new d,z_t=new d,H_t=new d,G_t=new d,W_t=new d,j_t=new d,q_t=new $,Gxe=new d,Wxe=new d,Y_t=new se;Sg.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=Sg;i=y(i,r),o=y(o,s);let a=P.EPSILON10,c=P.EPSILON3,u=P.EPSILON10,f=P.EPSILON10,h=P.EPSILON3,p=F.getScale(e,j_t),_=d.clone(r,k_t);_.z=-d.minimumComponent(p);let m=d.clamp(t,_,s,V_t),x=d.clamp(n,_,s,U_t),b=d.clamp(i,_,s,z_t),T=d.clamp(o,_,s,H_t),C=d.maximumByComponent(m,b,G_t),A=d.minimumByComponent(x,T,W_t),S=d.add(p,d.fromElements(x.z,x.z,x.z,Gxe),Gxe),v=d.maximumComponent(S),D=d.add(p,d.fromElements(A.z,A.z,A.z,Wxe),Wxe);if(C.y>A.y||C.y===s.y||A.y===r.y||C.z>A.z||P.equalsEpsilon(D,d.ZERO,void 0,a))return!1;this._rectangle=se.fromRadians(m.x,m.y,x.x,x.y),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=ee.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=x.z;let O=se.fromRadians(C.x,C.y,A.x,A.y,Y_t);this.orientedBoundingBox=dK(O,C.z,A.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=F.fromRotationTranslation($.setScale(this._rotation,S,q_t),this._translation,this.shapeTransform),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ae.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let R=s.x-r.x,M=.5*R,L=A.x<C.x,g=A.x-C.x+L*R,E=g<=u,w=g>=M-u&&g<R-u,I=g>u&&g<M-u,N=E||w||I,B=x.x<m.x,H=x.x-m.x+B*R,V=H>M+u&&H<R-u,G=H>=M-u&&H<=M+u,k=H<M-u,W=V||G||k,Y=A.y<-h,J=A.y>=-h&&A.y<=+h,j=A.y>+h&&A.y<s.y-f,K=Y||J||j,Q=C.y>r.y+f&&C.y<-h,de=C.y>=-h&&C.y<=+h,xe=C.y>+h,ce=Q||de||xe,_e=K||ce,be=x.y-m.y,De=x.y<-h,Ae=x.y>=-h&&x.y<=+h,ke=x.y>+h&&x.y<s.y-f,ze=De||Ae||ke,et=m.y>r.y+f&&m.y<-h,Et=m.y>=-h&&m.y<=+h,ht=m.y>+h,qt=ze||(et||Et||ht),{shaderUniforms:Tt,shaderDefines:lt}=this;for(let ft in lt)lt.hasOwnProperty(ft)&&(lt[ft]=void 0);Tt.ellipsoidRadiiUv=d.divideByScalar(S,v,Tt.ellipsoidRadiiUv);let{x:Wn,z:on}=Tt.ellipsoidRadiiUv,me=on/Wn;Tt.eccentricitySquared=1-me*me,Tt.evoluteScale=U.fromElements((Wn*Wn-on*on)/Wn,(on*on-Wn*Wn)/on,Tt.evoluteScale),Tt.ellipsoidInverseRadiiSquaredUv=d.divideComponents(d.ONE,d.multiplyComponents(Tt.ellipsoidRadiiUv,Tt.ellipsoidRadiiUv,Tt.ellipsoidInverseRadiiSquaredUv),Tt.ellipsoidInverseRadiiSquaredUv);let Ce=0;lt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ce,Ce+=1,lt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ce,Ce+=1,Tt.clipMinMaxHeight=U.fromElements((C.z-x.z)/v,(A.z-x.z)/v,Tt.clipMinMaxHeight);let hn=(x.z-m.z)/v;if(Tt.ellipsoidInverseHeightDifferenceUv=1/hn,m.z===x.z&&(Tt.ellipsoidInverseHeightDifferenceUv=0),N&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,lt.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ce,w?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ce+=1):I?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ce+=2):E&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ce+=2),Tt.ellipsoidRenderLongitudeMinMax=U.fromElements(C.x,A.x,Tt.ellipsoidRenderLongitudeMinMax)),W)if(lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,x.x<m.x&&(lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),H<=u)Tt.ellipsoidUvToShapeUvLongitude=U.fromElements(0,1,Tt.ellipsoidUvToShapeUvLongitude);else{let to=R/H,Eo=-(m.x-r.x)/H;Tt.ellipsoidUvToShapeUvLongitude=U.fromElements(to,Eo,Tt.ellipsoidUvToShapeUvLongitude)}if(N){let ft=P.equalsEpsilon(C.x,r.x,void 0,c),to=P.equalsEpsilon(A.x,s.x,void 0,c);ft&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),to&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Eo=(m.x-r.x)/R,Ys=(x.x-r.x)/R,Cr=(A.x-r.x)/R,hs=1-g/R,Le=(Cr+.5*hs)%1;Tt.ellipsoidShapeUvLongitudeMinMaxMid=d.fromElements(Eo,Ys,Le,Tt.ellipsoidShapeUvLongitudeMinMaxMid)}if(_e&&(ce&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,lt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ce,Q?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ce+=1):de?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ce+=1):xe&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ce+=2)),K&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,lt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ce,Y?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ce+=2):J?(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ce+=1):j&&(lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ce+=1)),Tt.ellipsoidRenderLatitudeSinMinMax=U.fromElements(Math.sin(C.y),Math.sin(A.y),Tt.ellipsoidRenderLatitudeSinMinMax)),qt)if(lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,be<f)Tt.ellipsoidUvToShapeUvLatitude=U.fromElements(0,1,Tt.ellipsoidUvToShapeUvLatitude);else{let to=(s.y-r.y)/be,Eo=(r.y-m.y)/be;Tt.ellipsoidUvToShapeUvLatitude=U.fromElements(to,Eo,Tt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Ce,!0};var Yxe=new se;Sg.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,h=(i+1)*r,p=se.subsection(this._rectangle,s,c,a,u,Yxe),_=P.lerp(this._minimumHeight,this._maximumHeight,f),m=P.lerp(this._minimumHeight,this._maximumHeight,h);return dK(p,_,m,this._ellipsoid,this._translation,this._rotation,o)};var jxe=new d,qxe=new d,X_t=new d;Sg.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,jxe),s=d.multiplyByScalar(r,o,jxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,qxe),o,qxe),c=d.add(a,s,X_t),u=se.subsection(this._rectangle,a.x,a.y,c.x,c.y,Yxe),f=P.lerp(this._minimumHeight,this._maximumHeight,a.z),h=P.lerp(this._minimumHeight,this._maximumHeight,c.z);return dK(u,f,h,this._ellipsoid,this._translation,this._rotation,i)};function dK(e,t,n,i,o,r,s){return s=wn.fromRectangle(e,t,n,i,s),s.center=d.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}Sg.DefaultMinBounds=Object.freeze(new d(-P.PI,-P.PI_OVER_TWO,-ee.WGS84.minimumRadius));Sg.DefaultMaxBounds=Object.freeze(new d(P.PI,P.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var $E=Sg;var Nu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Nu.getMinBounds=function(e){switch(e){case Nu.BOX:return Ag.DefaultMinBounds;case Nu.ELLIPSOID:return $E.DefaultMinBounds;case Nu.CYLINDER:return Eg.DefaultMinBounds}};Nu.getMaxBounds=function(e){switch(e){case Nu.BOX:return Ag.DefaultMaxBounds;case Nu.ELLIPSOID:return $E.DefaultMaxBounds;case Nu.CYLINDER:return Eg.DefaultMaxBounds}};Nu.getShapeConstructor=function(e){switch(e){case Nu.BOX:return Ag;case Nu.ELLIPSOID:return $E;case Nu.CYLINDER:return Eg}};var Vi=Object.freeze(Nu);function dh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(dh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});dh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new dh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};dh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};dh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Xxe(this,t)};dh.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,Xxe(this,i),t};dh.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],Kxe(this,0)),this._array[e-1]=void 0,t};dh.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=hK(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Kxe(this,n)}return this._array[e-1]=void 0,t};dh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};dh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[hK(this,1,2)?1:2]};function Q4(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function aP(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function hK(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Xxe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=aP(e,t,i);for(o!==n&&(Q4(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(aP(e,t,r)!==o)break;Q4(e,t,r),t=r}}function Kxe(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){aP(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;aP(e,f,r)===i&&(r=f)}}if(aP(e,r,t)===i&&(Q4(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);hK(e,r,a)===i&&Q4(e,r,a)}t=r}}var QE=dh;var Zxe=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function J4(e,t){this.spatialNode=e,this.keyframe=t,this.state=Zxe.UNLOADED,this.metadata=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}J4.priorityComparator=function(e,t){return e.priority-t.priority};J4.searchComparator=function(e,t){return e.keyframe-t.keyframe};J4.LoadState=Zxe;var eo=J4;function i0(e,t,n,i,o){i===kt.UNSIGNED_SHORT&&(i=kt.FLOAT32);let r=e.floatingPointTexture;if(i===kt.FLOAT32&&!r)throw new re("Floating point texture not supported");let s;i===kt.FLOAT32||i===kt.FLOAT64?s=Ke.FLOAT:i===kt.UINT8&&(s=Ke.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?tt.RED:tt.LUMINANCE:n===2?a=e.webgl2?tt.RG:tt.LUMINANCE_ALPHA:n===3?a=tt.RGB:n===4&&(a=tt.RGBA);let c=512*1024*1024,u=128*1024*1024;o=Math.min(y(o,u),c);let f=Ft.maximumTextureSize,h=kt.getSizeInBytes(i),p=Math.floor(o/(n*h)),_=Math.min(f,P.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),m=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/m),b=m*t.x,T=x*t.y,C=Math.floor(_/b),A=Math.floor(_/T);if(C===0||A===0)throw new re("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=d.clone(t,new d),this.maximumTileCount=C*A,this.regionCountPerMegatexture=new U(C,A),this.voxelCountPerRegion=new U(b,T),this.sliceCountPerRegion=new U(m,x),this.voxelSizeUv=new U(1/_,1/_),this.sliceSizeUv=new U(t.x/_,t.y/_),this.regionSizeUv=new U(b/_,T/_),this.texture=new Rt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:_,height:_,sampler:new Zt({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:hi.LINEAR})});let S=kt.toComponentDatatype(i);this.tileVoxelDataTemp=X.createTypedArray(S,b*T*n),this.nodes=new Array(this.maximumTileCount);for(let v=0;v<this.maximumTileCount;v++)this.nodes[v]=new K_t(v);for(let v=0;v<this.maximumTileCount;v++){let D=this.nodes[v];D.previousNode=v>0?this.nodes[v-1]:void 0,D.nextNode=v<this.maximumTileCount-1?this.nodes[v+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function K_t(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}i0.prototype.add=function(e){if(this.isFull())throw new he("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};i0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new he("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};i0.prototype.isFull=function(){return this.emptyList===void 0};i0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===kt.UNSIGNED_SHORT&&(i=kt.FLOAT32);let o=kt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,u=a*t.y,f=P.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/c),_=Math.floor(f/u);if(p*_>=e)break;f*=2}return f*f*n*o};i0.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let b=x%o.x*i.x,T=Math.floor(x/o.x)*i.y;for(let C=0;C<i.y;C++)for(let A=0;A<i.x;A++){let S=x*i.y*i.x+C*i.x+A,v=(T+C)*r.x+(b+A);for(let D=0;D<s;D++)a[v*s+D]=n[S*s+D]}}let c=this.regionCountPerMegatexture,u=r.x,f=r.y,h=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,m={source:{arrayBufferView:a,width:u,height:f},xOffset:h,yOffset:p};this.texture.copyFrom(m)};i0.prototype.isDestroyed=function(){return!1};i0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var cP=i0;function ed(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=d.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new wn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var Z_t=new d;ed.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,Z_t),n=2*d.maximumComponent(t);this.approximateVoxelSize=n/d.minimumComponent(this.dimensions)};ed.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,u=r+1,f=a+1,h=t+1,p=[[h,r,s,a],[h,u,s,a],[h,r,c,a],[h,u,c,a],[h,r,s,f],[h,u,s,f],[h,r,c,f],[h,u,c,f]];this.children=p.map(([_,m,x,b])=>new ed(_,m,x,b,this,e,this.dimensions))};ed.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};ed.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var $xe={keyframe:0};function lP(e,t){return $xe.keyframe=e,Mo(t,$xe,eo.searchComparator)}ed.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=$_t(i,h),_=h[p],m=o===i||i<_.keyframe?p:Math.min(p+1,h.length-1),x=h[m],b=i-_.keyframe,T=Qxe(n-t.level,b);T<a&&(a=T,r=_);let C=x.keyframe-o,A=Qxe(n-t.level,C);if(A<c&&(c=A,s=x),b===0&&C===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function $_t(e,t){let n=lP(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function Qxe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}ed.prototype.isVisited=function(e){return this.visitedFrameNumber===e};ed.prototype.createKeyframeNode=function(e){let t=lP(e,this.keyframeNodes);if(t<0){t=~t;let n=new eo(this,e);this.keyframeNodes.splice(t,0,n)}};ed.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=lP(n,this.keyframeNodes);if(i<0)throw new he("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=lP(n,this.renderableKeyframeNodes);if(o<0)throw new he("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=eo.LoadState.UNLOADED,e.metadata={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};ed.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==eo.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadata.length!==t.length)throw new he("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadata[o])}e.state=eo.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=lP(e.keyframe,n);if(i>=0)throw new he("Keyframe already renderable");i=~i,n.splice(i,0,e)};ed.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var eH=ed;function vg(e,t,n,i,o,r,s){this._primitive=e,this.megatextures=new Array(i.length);for(let m=0;m<i.length;m++){let x=i[m],b=ct.getComponentCount(x),T=o[m];this.megatextures[m]=new cP(t,n,b,T,s)}let a=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let c=e._shape;this.rootNode=new eH(0,0,0,0,void 0,c,n),this._priorityQueue=new QE({maximumLength:a,comparator:eo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(a),this._keyframeNodesInMegatexture=new Array(a),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let u=this._binaryTreeKeyframeWeighting;u[0]=0,u[r-1]=0,mK(u,1,r-2,0);let f=9,h=2048,p=Math.floor(h/f),_=Math.ceil(a/p);this.internalNodeTexture=new Rt({context:t,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,flipY:!1,width:h,height:_,sampler:new Zt({minificationFilter:Kt.NEAREST,magnificationFilter:hi.NEAREST})}),this.internalNodeTilesPerRow=p,this.internalNodeTexelSizeUv=new U(1/h,1/_),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}vg.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function mK(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,mK(e,t,o-1,i+1),mK(e,o+1,n,i+1)}vg.simultaneousRequestCountMaximum=50;vg.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=a>1,h=(u?2:1)*(f?2:1);this._sampleCount=h;let p=h>=2;if(p&&!l(this.leafNodeTexture)){let C=Math.floor(512),A=Math.ceil(s/C);this.leafNodeTexture=new Rt({context:r,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,flipY:!1,width:1024,height:A,sampler:new Zt({minificationFilter:Kt.NEAREST,magnificationFilter:hi.NEAREST})}),this.leafNodeTexelSizeUv=U.fromElements(1/1024,1/A,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=C}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&Jxe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let _=Ai();eyt(this,e);let m=Ai();iyt(this,h,c);let x=Ai();if(this._debugPrint){let b=m-_,T=x-m,C=x-_;nyt(this,b,T,C)}};vg.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};vg.prototype.isDestroyed=function(){return!1};vg.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function Jxe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];Jxe(e,i)}}function Q_t(e,t){if(e._simultaneousRequestCount>=vg.simultaneousRequestCountMaximum)return;let n=e._primitive._provider;function i(c){e._simultaneousRequestCount--;let u=n.types.length;if(!l(c))t.state=eo.LoadState.UNAVAILABLE;else if(c===eo.LoadState.FAILED)t.state=eo.LoadState.FAILED;else if(!Array.isArray(c)||c.length!==u)t.state=eo.LoadState.FAILED;else{let f=e.megatextures;for(let h=0;h<u;h++){let{voxelCountPerTile:p,channelCount:_}=f[h],{x:m,y:x,z:b}=p,T=m*x*b,C=c[h],A=T*_;if(C.length===A)t.metadata[h]=C,t.state=eo.LoadState.RECEIVED;else{t.state=eo.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=eo.LoadState.FAILED}let{keyframe:r,spatialNode:s}=t,a=n.requestData({tileLevel:s.level,tileX:s.x,tileY:s.y,tileZ:s.z,keyframe:r});l(a)?(e._simultaneousRequestCount++,t.state=eo.LoadState.RECEIVING,a.then(i).catch(o)):t.state=eo.LoadState.FAILED}function J_t(e){return e/(1+e)}function eyt(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,r=i.screenSpaceError,s=e._priorityQueue,a=e._keyframeCount,c=P.clamp(Math.floor(e._keyframeLocation),0,a-2),u=c+1,{camera:f,context:h,pixelRatio:p}=t,{positionWC:_,frustum:m}=f,b=h.drawingBufferHeight/p/m.sseDenominator;function T(L,g){if(L.computeScreenSpaceError(_,b),g=L.visibility(t,g),g===ys.MASK_OUTSIDE)return;if(L.visitedFrameNumber=n,a===1)L.createKeyframeNode(0);else if(L.keyframeNodes.length!==a)for(let B=0;B<a;B++)L.createKeyframeNode(B);let{screenSpaceError:E,keyframeNodes:w}=L,I=J_t(E),N=!1;for(let B=0;B<w.length;B++){let H=w[B];H.priority=10*I+tyt(c,H.keyframe,u,e),H.state!==eo.LoadState.UNAVAILABLE&&H.state!==eo.LoadState.FAILED&&H.priority!==-Number.MAX_VALUE&&s.insert(H),H.state===eo.LoadState.LOADED&&(N=!0)}if(E<r||!N){L.children=void 0;return}l(L.children)||L.constructChildNodes(o);for(let B=0;B<8;B++){let H=L.children[B];T(H,g)}}s.reset(),T(e.rootNode,ys.MASK_INDETERMINATE);let C=e._highPriorityKeyframeNodes,A=0,S;for(;s.length>0;)S=s.removeMaximum(),S.highPriorityFrameNumber=n,C[A]=S,A++;let v=e._keyframeNodesInMegatexture,D=e.megatextures[0],O=D.occupiedCount;v.length=O,v.sort(function(L,g){return L.highPriorityFrameNumber===g.highPriorityFrameNumber?g.priority-L.priority:g.highPriorityFrameNumber-L.highPriorityFrameNumber});let R=0,M=0;for(let L=0;L<A;L++)if(S=C[L],!(S.state===eo.LoadState.LOADED||S.spatialNode===void 0)&&(S.state===eo.LoadState.UNLOADED&&Q_t(e,S),S.state===eo.LoadState.RECEIVED)){let g=0;if(D.isFull()){g=O-1-R,R++;let E=v[g];E.spatialNode.destroyKeyframeNode(E,e.megatextures)}else g=O+M,M++;S.spatialNode.addKeyframeNodeToMegatextures(S,e.megatextures),v[g]=S}}function tyt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return P.lerp(a,s,.15+.85*s)}function nyt(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys(eo.LoadState).length,a=new Array(s),c=new Array(s),u=0;for(let T=0;T<s;T++){let C=new Array(o);a[T]=C;for(let A=0;A<o;A++)C[A]=0;c[T]=0}function f(T){let C=T.keyframeNodes;for(let A=0;A<C.length;A++){let S=C[A],v=S.keyframe,D=S.state;a[D][v]+=1,c[D]+=1,u++}if(l(T.children))for(let A=0;A<8;A++){let S=T.children[A];f(S)}}f(r);let h=`KEYFRAMES: ${a[eo.LoadState.LOADED]}`,p=`UNLOADED: ${c[eo.LoadState.UNLOADED]} | RECEIVING: ${c[eo.LoadState.RECEIVING]} | RECEIVED: ${c[eo.LoadState.RECEIVED]} | LOADED: ${c[eo.LoadState.LOADED]} | FAILED: ${c[eo.LoadState.FAILED]} | UNAVAILABLE: ${c[eo.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,_=Math.round(t*100)/100,m=Math.round(n*100)/100,x=Math.round(i*100)/100,b=`LOAD: ${_} | OCT: ${m} | ALL: ${x}`;console.log(`${h} || ${p} || ${b}`)}var tH={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function iyt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function h(_,m,x,b,T){let C=!1;if(l(_.children))for(let A=0;A<8;A++){let S=_.children[A];S.computeSurroundingRenderableKeyframeNodes(o),S.isRenderable(r)&&(C=!0)}if(C){u[T]=tH.INTERNAL<<16|m,u[x]=b,a++,b=m,T=b*9+1;for(let A=0;A<8;A++){let S=_.children[A];m=a,x=m*9+0,h(S,m,x,b,T+A)}}else{if(s){let A=c*5,S=_.renderableKeyframeNodePrevious,v=_.level-S.spatialNode.level,D=S.spatialNode.parent,O=l(D)?D.renderableKeyframeNodePrevious:S,R=oyt(_,i,n),M=v,L=1,g=S.megatextureIndex,E=O.megatextureIndex;f[A+0]=R,f[A+1]=M,f[A+2]=L,f[A+3]=g,f[A+4]=E,u[T]=tH.LEAF<<16|c}else{let A=_.renderableKeyframeNodePrevious,v=_.level-A.spatialNode.level===0?tH.LEAF:tH.PACKED_LEAF_FROM_PARENT;u[T]=v<<16|A.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),ryt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&syt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function oyt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return P.clamp(s,0,1)}function ryt(e,t,n,i){let o=tt.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],_=h*o;for(let m=0;m<o;m++)c[_+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function syt(e,t,n,i){let o=tt.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let _=e[p*r+0],m=e[p*r+1],x=e[p*r+2],b=e[p*r+3],T=e[p*r+4],C=P.clamp(Math.floor(65536*_),0,65535);u[p*8+0]=C>>>0&255,u[p*8+1]=C>>>8&255,u[p*8+2]=m&255,u[p*8+3]=x&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=T>>>0&255,u[p*8+7]=T>>>8&255}let h={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(h)}vg.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],u=ct.getComponentCount(a);o+=cP.getApproximateTextureMemoryByteLength(e,t,u,c)}return o};var uP=vg;var ayt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},fP=Object.freeze(ayt);function cyt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var nH=cyt;function JE(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}JE.prototype.getTexture=function(e){return this._textures[e]};function lyt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}JE.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):lyt(this,e,t)};function uyt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?iH(o,r,n):fyt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function iH(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?tbe(e,n):new Rt({context:n,source:t,sampler:o});return ebe(o)&&r.generateMipmap(),r}function fyt(e,t,n){let{typedArray:i,sampler:o}=e,r=ebe(o),s=o.wrapS===An.REPEAT||o.wrapS===An.MIRRORED_REPEAT||o.wrapT===An.REPEAT||o.wrapT===An.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((r||s)&&!u)if(l(i)){if(e.pixelDatatype===Ke.UNSIGNED_BYTE){let h=nH(i,a,c),p=ax(h);return iH({sampler:o},p,n)}}else{let h=ax(t);return iH(e,h,n)}else return iH(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),tbe(e,n)}function ebe(e){return[Kt.NEAREST_MIPMAP_NEAREST,Kt.NEAREST_MIPMAP_LINEAR,Kt.LINEAR_MIPMAP_NEAREST,Kt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function tbe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Rt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}JE.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];uyt(this,o,t)}n.length=0};JE.prototype.isDestroyed=function(){return!1};JE.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var oH=JE;function dP(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,B_.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,bx.INHERIT),this._textureManager=new oH,this._defaultTexture=void 0,this.uniformMap=dyt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},pyt(this),gyt(this)}function dyt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===fP.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=hyt(e,i)):n[i]=myt(e,i)}return n}function hyt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function myt(e,t){return function(){return e.uniforms[t].value}}function Ib(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function pyt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,Ib(r,t,o),o=e.usedVariablesVertex.featureIdSet,Ib(r,n,o),o=e.usedVariablesVertex.metadataSet,Ib(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,Ib(s,t,o),o=e.usedVariablesFragment.featureIdSet,Ib(s,n,o),o=e.usedVariablesFragment.metadataSet,Ib(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;Ib(s,a,c)}}function nbe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function mc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${nbe(t)} is not available in the ${i} shader. Did you mean ${nbe(n)} instead?`;throw new he(o)}}function gyt(e){let t=e.usedVariablesVertex.attributeSet;mc(t,"position","positionMC","vertex"),mc(t,"normal","normalMC","vertex"),mc(t,"tangent","tangentMC","vertex"),mc(t,"bitangent","bitangentMC","vertex"),mc(t,"positionWC","positionMC","vertex"),mc(t,"positionEC","positionMC","vertex"),mc(t,"normalEC","normalMC","vertex"),mc(t,"tangentEC","tangentMC","vertex"),mc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;mc(n,"position","positionEC","fragment"),mc(n,"normal","normalEC","fragment"),mc(n,"tangent","tangentEC","fragment"),mc(n,"bitangent","bitangentEC","fragment"),mc(n,"normalMC","normalEC","fragment"),mc(n,"tangentMC","tangentEC","fragment"),mc(n,"bitangentMC","bitangentEC","fragment")}dP.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===fP.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};dP.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};dP.prototype.isDestroyed=function(){return!1};dP.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var eS=dP;function Gm(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,Gm.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new d,this._paddingAfter=new d,this._minBounds=new d,this._minBoundsOld=new d,this._maxBounds=new d,this._maxBoundsOld=new d,this._exaggeratedMinBounds=new d,this._exaggeratedMinBoundsOld=new d,this._exaggeratedMaxBounds=new d,this._exaggeratedMaxBoundsOld=new d,this._minClippingBounds=new d,this._minClippingBoundsOld=new d,this._maxClippingBounds=new d,this._maxClippingBoundsOld=new d,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._exaggeratedModelMatrix=F.clone(this._modelMatrix),this._compoundModelMatrix=new F,this._compoundModelMatrixOld=new F,this._customShader=y(e.customShader,Gm.DefaultCustomShader),this._customShaderCompilationEvent=new pe,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new F,this._transformPositionUvToWorld=new F,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new rm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new U,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new U,megatextureTextures:[],megatextureSliceDimensions:new U,megatextureTileDimensions:new U,megatextureVoxelSizeUv:new U,megatextureSliceSizeUv:new U,megatextureTileSizeUv:new U,dimensions:new d,paddingBefore:new d,paddingAfter:new d,transformPositionViewToUv:new F,transformPositionUvToView:new F,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new d,ndcSpaceAxisAlignedBoundingBox:new oe,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,stepSize:0,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;_yt(this,i)}function _yt(e,t){let{shape:n,minBounds:i=Vi.getMinBounds(n),maxBounds:o=Vi.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=Vi.getMinBounds(n),e.maxClippingBounds=Vi.getMaxBounds(n),e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=F.clone(e._modelMatrix,e._exaggeratedModelMatrix),obe(e,t);let r=Vi.getShapeConstructor(n);e._shape=new r,e._shapeVisible=rbe(e,e._shape,t)}Object.defineProperties(Gm.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=d.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=d.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=d.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=d.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=Gm.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var yyt=new d,xyt=new oe,byt=new oe,Tyt=new d,Cyt=new d,Ayt=new $,Eyt=new $,Syt=new F,vyt=new F,wyt=new F,Dyt=F.fromRotationTranslation($.fromUniformScale(.5,new $),new d(.5,.5,.5),new F),Iyt=F.fromRotationTranslation($.fromUniformScale(2,new $),new d(-1,-1,-1),new F);Gm.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Nyt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}Myt(this,e);let i=obe(this,t),o=this._shape;if(i&&(this._shapeVisible=rbe(this,o,t),kyt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Vyt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&Yyt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Uyt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;l(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=U.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(Z4(this,n),this._shaderDirty=!1);let h=n.uniformState.viewProjection,p=o.orientedBoundingBox,_=Gyt(p,h,byt);if(_.x===1||_.y===1||_.z===-1||_.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=oe.clone(_,f.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;f.transformPositionViewToUv=F.multiplyTransformation(this._transformPositionWorldToUv,x,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=F.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let T=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,T,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let C=e.camera.positionWC;f.cameraPositionUv=F.multiplyByPoint(this._transformPositionWorldToUv,C,f.cameraPositionUv),f.stepSize=this._stepSizeMultiplier;let A=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;A.boundingVolume=o.boundingSphere,e.commandList.push(A)};var Pyt=new d,pK=new d,Ryt=new fe,Oyt=new d;function Myt(e,t){if(e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===Vi.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else if(e.shape===Vi.BOX){let n=d.fromElements(1,1,t.verticalExaggeration,Pyt);e._exaggeratedModelMatrix=F.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=F.multiplyByTranslation(e._exaggeratedModelMatrix,Lyt(e,t),e._exaggeratedModelMatrix)}}function Lyt(e,t){let{shapeTransform:n=F.IDENTITY,globalTransform:i=F.IDENTITY}=e._provider,o=F.getTranslation(n,pK),r=F.multiplyByPoint(e._modelMatrix,o,pK),s=F.multiplyByPoint(i,r,pK),c=ee.WGS84.cartesianToCartographic(s,Ryt),u=0;l(c)&&(u=c.height);let f=Dr.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return d.fromElements(0,0,(f-u)/t.verticalExaggeration,Oyt)}function Nyt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ge(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=d.clone(t.dimensions,i.dimensions),e._paddingBefore=d.clone(y(t.paddingBefore,d.ZERO),e._paddingBefore),i.paddingBefore=d.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=d.clone(y(t.paddingAfter,d.ZERO),e._paddingBefore),i.paddingAfter=d.clone(e._paddingAfter,i.paddingAfter),e._traversal=Fyt(e,t,n),Byt(e._traversal,i)}function obe(e,t){let n=y(t.shapeTransform,F.IDENTITY),i=y(t.globalTransform,F.IDENTITY);return F.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),F.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),Pb(e,"_compoundModelMatrix","_compoundModelMatrixOld")+Pb(e,"_minBounds","_minBoundsOld")+Pb(e,"_maxBounds","_maxBoundsOld")+Pb(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+Pb(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+Pb(e,"_minClippingBounds","_minClippingBoundsOld")+Pb(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function Pb(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function rbe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=F.inverse(o,Syt),s=F.getRotation(o,Ayt),a=F.getScale(o,Tyt),c=d.maximumComponent(a),u=d.divideByScalar(a,c,Cyt),f=$.multiplyByScale(s,u,Eyt);return e._transformPositionWorldToUv=F.multiplyTransformation(Dyt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=F.multiplyTransformation(o,Iyt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=F.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function Fyt(e,t,n){let i=d.clone(t.dimensions,yyt);d.add(i,e._paddingBefore,i),d.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?uP.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new uP(e,n,i,t.types,t.componentTypes,s,r)}function Byt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=U.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=U.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=U.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=U.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=U.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=U.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function kyt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ge(n,!0)),i}function Vyt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=Z.secondsDifference(i.stop,i.start),a=Z.secondsDifference(n,i.start)/r;return o+a}function Uyt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=F.transpose(F.multiplyTransformation(F.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}Gm.prototype.isDestroyed=function(){return!1};Gm.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var ibe=new Array(new oe(-1,-1,-1,1),new oe(1,-1,-1,1),new oe(-1,1,-1,1),new oe(1,1,-1,1),new oe(-1,-1,1,1),new oe(1,-1,1,1),new oe(-1,1,1,1),new oe(1,1,1,1)),zyt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),Hyt=new Array(new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe);function Gyt(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,vyt),o=F.multiply(t,i,wyt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=Hyt,h=ibe.length;for(u=0;u<h;u++)F.multiplyByVector(o,ibe[u],f[u]);for(u=0;u<h;u++){let p=f[u];if(p.z>=-p.w){let _=p.x/p.w,m=p.y/p.w;r=Math.min(r,_),s=Math.max(s,_),a=Math.min(a,m),c=Math.max(c,m)}else for(let _=0;_<3;_++){let m=zyt[u*3+_],x=f[m];if(x.z>=-x.w){let b=p.z+p.w,T=x.z+x.w,C=b/(b-T),A=oe.lerp(p,x,C,xyt),S=A.x/A.w,v=A.y/A.w;r=Math.min(r,S),s=Math.max(s,S),a=Math.min(a,v),c=Math.max(c,v)}}}return r=P.clamp(r,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=oe.fromElements(r,a,s,c,n),n}var gK=3e7,Wyt=new d(gK,0,0),jyt=new d(0,gK,0),qyt=new d(0,0,gK);function Yyt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,h){i.add({positions:[c,u],width:h,material:Yi.fromType("Color",{color:f})})}function r(c,u,f){let h=c.computeCorners();o(h[0],h[1],u,f),o(h[2],h[3],u,f),o(h[4],h[5],u,f),o(h[6],h[7],u,f),o(h[0],h[2],u,f),o(h[4],h[6],u,f),o(h[1],h[3],u,f),o(h[5],h[7],u,f),o(h[0],h[4],u,f),o(h[2],h[6],u,f),o(h[1],h[5],u,f),o(h[3],h[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,h=Math.max(1,5/Math.pow(2,u)),_=[z.RED,z.LIME,z.BLUE][u%3];if(r(c.orientedBoundingBox,_,h),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}r(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;o(d.ZERO,Wyt,z.RED,a),o(d.ZERO,jyt,z.LIME,a),o(d.ZERO,qyt,z.BLUE,a),i.update(t)}Gm.DefaultCustomShader=new eS({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = vec3(1.0); material.alpha = 1.0; -}`});function obe(){this.ready=!0,this.shape=ki.BOX,this.dimensions=new d(1,1,1),this.names=["data"],this.types=[lt.SCALAR],this.componentTypes=[Vt.FLOAT32],this.maximumTileCount=1}obe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};Hm.DefaultProvider=new obe;var Rb=Hm;function Wyt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var gH=Wyt;function jyt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var _H=jyt;function qyt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var yH=qyt;var bH=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Jn(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ge(e.contextOptions),r=l(n),s=new kM(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=zn(),this._jobScheduler=new Vz,this._frameState=new Fz(s,new wz(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new k1(s),this._ellipsoid=y(e.ellipsoid,ee.default),this._globe=void 0,this._globeTranslucencyState=new Bz,this._primitives=new mu,this._groundPrimitives=new mu,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=Jn.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new jE,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new Oz(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ei({color:new z,stencil:0,owner:this}),this._depthClearCommand=new ei({depth:1,owner:this}),this._stencilClearCommand=new ei({stencil:0}),this._classificationStencilClearCommand=new ei({stencil:0,renderState:Ve.fromCache({stencilMask:Ut.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new w4(this),this._preUpdate=new me,this._postUpdate=new me,this._renderError=new me,this._preRender=new me,this._postRender=new me,this._minimumDisableDepthTestDistance=0,this._debugInspector=new H4,this._msaaSamples=y(e.msaaSamples,4),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new me,this.morphComplete=new me,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Ii(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new TC,this.fog=new Nz,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(ro.DEFAULT_VIEW_RECTANGLE=se.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new ro(this),this.shadowMap=new Jy({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new jI,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new E4,this._brdfLutGenerator=new gz,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new k4(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,Du.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=bc.requestCompletedEvent.addEventListener(bH(this)),this._removeTaskProcessorListenerCallback=_i.taskCompletedEvent.addEventListener(bH(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new qe(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new ro(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new ro(this),this.preloadFlightCullingVolume=void 0,this._picking=new o4(this),this._defaultView=new zE(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Hg,lbe(this,0,Z.now()),this.updateFrameState(),this.initializeFrame()}Jn.defaultLogDepthBuffer=!0;function Yyt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(bH(e))),n.push(t.terrainProviderChanged.addEventListener(bH(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Jn.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Bt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Bt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return zh.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Yyt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new ro(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Lz(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Bt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});Jn.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function Xyt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function rbe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=pg.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=pg.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=pg.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=pg.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=Jy.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===we.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}Jn.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),h=l(t.originalCommand),p=o&&!u,_=c&&!f,m=(!o||!c)&&!h,x=n.pickingMetadata&&Xyt(e,n);if(e.dirty=e.dirty||p||_||m||x,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:T}=i;b&&e.castShadows&&(t.shadows=Jy.createCastDerivedCommand(T,e,s,r,t.shadows)),(u||p)&&(t.logDepth=pg.createLogDepthCommand(e,r,t.logDepth),rbe(this,t.logDepth.command,s)),(h||m)&&rbe(this,e,s)};var Kyt=new ch({pass:Vo.RENDER}),gK=new ch({pass:Vo.PRELOAD}),_K=new ch({pass:Vo.PRELOAD_FLIGHT}),Zyt=new ch({pass:Vo.REQUEST_RENDER_MODE_DEFER_CHECK}),sbe=new ae,yK;function $yt(e){if(!(e._mode!==ne.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return sbe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,yK=pz.fromBoundingSphere(sbe,e.camera.positionWC,yK),yK}Jn.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function lbe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Z.clone(n,i.time)}Jn.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=$yt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof rn||this.camera.frustum instanceof Hr),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),jI.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};Jn.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===jt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var xH=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);xH=F.inverseTransformation(xH,xH);function Qyt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=d.clone(s.center);if(o.mode!==ne.SCENE3D){a=F.multiplyByPoint(xH,a,a);let m=o.mapProjection,x=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(x)}let c,u,{radius:f}=s;l(f)?(c=ca.createGeometry(new ca({radii:new d(f,f,f),vertexFormat:cn.FLAT_VERTEX_FORMAT})),u=F.fromTranslation(a)):(c=ja.createGeometry(ja.fromDimensions({dimensions:new d(2,2,2),vertexFormat:cn.FLAT_VERTEX_FORMAT})),u=F.fromRotationTranslation(s.halfAxes,a,new F)),t._debugVolume=new In({geometryInstances:new wt({geometry:Nn.toWireframe(c),modelMatrix:u,attributes:{color:new Wt(1,0,0,1)}}),appearance:new cn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=pg.createLogDepthCommand(e,r).command);let _;l(i)&&(_=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(_)&&(n.framebuffer=_),o.commandList=h}function Gm(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ei){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&Qyt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function abe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function ube(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function Jyt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function e0t(e,t,n,i,o){Yy(i,ube,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function t0t(e,t,n,i,o){Yy(i,Jyt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function n0t(e,t,n){e.context.uniformState.updatePass(we.VOXELS);let i=n.commands[we.VOXELS];i.length=n.indices[we.VOXELS],Yy(i,ube,e.camera.positionWC);for(let o=0;o<i.length;++o)Gm(i[o],e,t)}var i0t=new Di,o0t=new Fl,r0t=new rn,s0t=new Hr;function a0t(e){let{frustum:t}=e;return l(t.fov)?t.clone(i0t):l(t.infiniteProjectionMatrix)?t.clone(o0t):l(t.width)?t.clone(r0t):t.clone(s0t)}function c0t(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?e0t:t0t}function l0t(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=c0t(e);o.uniformState.updatePass(we.TRANSLUCENT);let f=n.commands[we.TRANSLUCENT];f.length=n.indices[we.TRANSLUCENT],u(e,Gm,t,f,c)}function u0t(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[we.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[we.TRANSLUCENT];i.executeTranslucentCommands(e,Gm,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,Gm,t,n)}function bK(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=a0t(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||f0t(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:_,usePostProcessSelected:m}=e._environmentState,{globeDepth:x,globeTranslucencyFramebuffer:b,sceneFramebuffer:T,frustumCommandsList:C}=e._view,A=C.length,S=e._globeTranslucencyState,v=e._depthClearCommand,D=e._stencilClearCommand,O=e._classificationStencilClearCommand,R=e._depthPlane,M=n.position.z;function L(E,w){r.updatePass(w);let I=E.commands[w],N=E.indices[w];for(let B=0;B<N;++B)Gm(I[B],e,t);return N}function g(E,w){r.updatePass(w);let I=E.commands[w],N=E.indices[w];for(let B=0;B<N;++B)abe(I[B],e,t)}for(let E=0;E<A;++E){let w=A-E-1,I=C[w];e.mode===ne.SCENE2D?(n.position.z=M-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=w!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&D.execute(i,t),S.translucent?(r.updatePass(we.GLOBE),S.executeGlobeCommands(I,Gm,b,e,t)):L(I,we.GLOBE),p&&x.executeCopyDepth(i,t),f||(S.translucent?(r.updatePass(we.TERRAIN_CLASSIFICATION),S.executeGlobeClassificationCommands(I,Gm,b,e,t)):L(I,we.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),h&&R.execute(i,t));let N;if(!_||c||f)N=L(I,we.CESIUM_3D_TILE),N>0&&(p&&(x.prepareColorTextures(i,u),x.executeUpdateDepth(i,t,x.depthStencilTexture)),f||(N=L(I,we.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let H=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N=L(I,we.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),x.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=L(I,we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=H,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&O.execute(i,t),N=L(I,we.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&D.execute(i,t),n0t(e,t,I),L(I,we.OPAQUE),w!==0&&e.mode!==ne.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),l0t(e,t,I),u0t(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let H=e._picking.getPickDepth(e,w);H.update(i,x.depthStencilTexture),H.executeCopyDepth(i,t)}if(c||!m)continue;let B=t.framebuffer;t.framebuffer=T.getIdFramebuffer(),s.near=w!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),S.translucent?(r.updatePass(we.GLOBE),S.executeGlobeCommands(I,abe,b,e,t)):g(I,we.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&h&&R.execute(i,t),g(I,we.CESIUM_3D_TILE),g(I,we.OPAQUE),g(I,we.TRANSLUCENT),t.framebuffer=B}}function f0t(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(we.ENVIRONMENT),l(i.skyBoxCommand)&&Gm(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Gm(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function fbe(e){e.context.uniformState.updatePass(we.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function d0t(e,t){e.context.uniformState.updatePass(we.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function h0t(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[we.GLOBE,we.CESIUM_3D_TILE,we.OPAQUE,we.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let h=s-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,u))r[h].commandList.push(u),f=!0;else if(f)break}}}}function dbe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;h0t(e,n,c);for(let f=0;f<u.length;++f){let h=c.passes[f],{camera:p,commandList:_}=h;s.updateCamera(p),c.updatePass(r,f);for(let m=0;m<_.length;++m){let x=_[m];s.updatePass(x.pass);let b=x.derivedCommands.shadows.castCommands[a];Gm(b,e,h.passState)}}}}var m0t=new d;Jn.prototype.updateAndExecuteCommands=function(e,t){w0t(this,e,t),this._environmentState.useWebVR?p0t(this,e,t):this._frameState.mode!==ne.SCENE2D||this._mapMode2D===Du.ROTATE?o0(!0,this,e):E0t(this,e)};function p0t(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;hbe(e),n.createPotentiallyVisibleSet(e),fbe(e),r||dbe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=ro.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*y(e.focalLength,5),f=y(e.eyeSeparation,u/30),h=d.multiplyByScalar(a.right,f*.5,m0t);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;d.add(a.position,h,i.position),i.frustum.xOffset=p,bK(e,t),s.x=s.width,d.subtract(a.position,h,i.position),i.frustum.xOffset=-p,bK(e,t),ro.clone(a,i)}var g0t=new fe(Math.PI,P.PI_OVER_TWO),_0t=new d,y0t=new d,x0t=new F,b0t=new F,T0t=new d,C0t=new d,A0t=new qe;function E0t(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=qe.clone(r,A0t);t.viewport=s;let a=g0t,c=_0t;e.mapProjection.project(a,c);let f=d.clone(i.position,y0t),h=F.clone(i.transform,b0t),p=i.frustum.clone();i._setTransform(F.IDENTITY);let _=F.computeViewportTransformation(s,0,1,x0t),m=i.frustum.projectionMatrix,x=i.positionWC.y,b=d.fromElements(P.sign(x)*c.x-x,0,-i.positionWC.x,T0t),T=Mt.pointToGLWindowCoordinates(m,_,b,C0t);T.x=Math.floor(T.x);let C=s.x,A=s.width;if(x===0||T.x<=C||T.x>=C+A)o0(!0,e,t);else if(Math.abs(C+A*.5-T.x)<1)s.width=T.x-s.x,i.position.x*=P.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!0,e,t),s.x=T.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!1,e,t);else if(T.x>C+A*.5){s.width=T.x-C;let S=i.frustum.right;i.frustum.right=c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!0,e,t),s.x=T.x,s.width=C+A-T.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=S-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!1,e,t)}else{s.x=T.x,s.width=C+A-T.x;let S=i.frustum.left;i.frustum.left=-c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!0,e,t),s.x=C,s.width=T.x-C,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=S-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!1,e,t)}i._setTransform(h),d.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function o0(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),hbe(t),i.createPotentiallyVisibleSet(t),e&&(fbe(t),o||dbe(t)),bK(t,n)}var cbe=new ys;Jn.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==ne.SCENE2D&&t.camera.frustum instanceof rn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(E_.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let T=r.dynamicLighting;s.setDynamicLighting(T),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let b=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(b)?b.drawCommand:void 0,n.sunComputeCommand=l(b)?b.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=u&&this.mode===ne.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!o;let h=e.mode===ne.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,_=cbe.planes;for(let b=0;b<5;++b)_[b]=p.planes[b];p=cbe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let m=this.specularEnvironmentMaps,x=this._specularEnvironmentCubeMap;l(m)&&x?.url!==m?(x=x&&x.destroy(),this._specularEnvironmentCubeMap=new zh(m)):!l(m)&&l(x)&&(x.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function S0t(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new mg({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function v0t(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===ne.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function hbe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),S0t(e),v0t(e),e._globe&&e._globe.render(t)}function w0t(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new z4:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let h=r.useGlobeDepthFramebuffer=l(s.globeDepth);h&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,_=r.useOIT=!c&&l(p)&&p.isSupported();_&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),x=r.usePostProcess=m.ready,r.usePostProcessSelected=x&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let T;if(o.invertClassificationColor.alpha===1&&h&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&_){let C=e._invertClassification.unclassifiedCommand,A=C.derivedCommands;A.oit=p.createDerivedCommands(C,i,A.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Jn.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?h.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let _=h;a&&!s&&(_=f);let m=this.postProcessStages,x=_.getColorTexture(0),b=p.getColorTexture(0),T=y(f,h).getDepthStencilTexture();m.execute(t,x,T,b),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function D0t(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function I0t(e){if(e.mode===ne.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}Jn.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===Ye.CLAMP_TO_TERRAIN||t===Ye.RELATIVE_TO_TERRAIN,i=t===Ye.CLAMP_TO_3D_TILE||t===Ye.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=this.primitives.length;for(let a=0;a<s;++a){let c=this.primitives.get(a);if(!c.isCesium3DTileset||!c.show||!c.enableCollision)continue;let u=c.getHeight(e,this);l(u)&&u>o&&(o=u)}}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var xK=new fe;Jn.prototype.updateHeight=function(e,t,n){let i=()=>{fe.clone(e,xK);let _=this.getHeight(e,n);l(_)&&(xK.height=_,t(xK))},o=n===Ye.CLAMP_TO_TERRAIN||n===Ye.RELATIVE_TO_TERRAIN,r=n===Ye.CLAMP_TO_3D_TILE||n===Ye.RELATIVE_TO_3D_TILE,s;!r&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,i));let a={},c=this._ellipsoid,u=_=>{if(o||_.isDestroyed()||!_.isCesium3DTileset)return;let m=_.updateHeight(e,i,c);a[_.id]=m};if(!o){let _=this.primitives.length;for(let m=0;m<_;++m){let x=this.primitives.get(m);u(x)}}let f=this.primitives.primitiveAdded.addEventListener(u),h=this.primitives.primitiveRemoved.addEventListener(_=>{_.isDestroyed()||!_.isCesium3DTileset||(l(a[_.id])&&a[_.id](),delete a[_.id])});return()=>{s=s&&s(),Object.values(a).forEach(_=>_()),a={},f(),h()}};function P0t(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===ne.SCENE2D||n===ne.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}Jn.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=I0t(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=P0t(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function R0t(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new $y({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function O0t(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function M0t(e){e.primitives.postPassesUpdate(e._frameState),bc.update()}var L0t=new z;function N0t(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Kyt;let r=y(e.backgroundColor,z.BLACK);e._hdr&&(r=z.clone(r,L0t),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof Hg?d.negate(i.sunDirectionWC,e._shadowMapCamera.direction):d.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=qe.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,d0t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function Ob(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function F0t(e){return e._picking.updateMostDetailedRayPicks(e)}Jn.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=Z.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(Z.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=Z.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=P.incrementWrap(t.frameNumber,15e6,1);lbe(this,o,e),t.newFrame=!0}Ob(this,O0t),this.primitives.show&&(Ob(this,F0t),Ob(this,B0t),Ob(this,k0t),i||Ob(this,V0t)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),Ob(this,N0t)),R0t(this,i),Ob(this,M0t),D0t(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Jn.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Jn.prototype.requestRender=function(){this._renderRequested=!0};Jn.prototype.clampLineWidth=function(e){return Math.max(Bt.minimumAliasedLineWidth,Math.min(e,Bt.maximumAliasedLineWidth))};Jn.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};Jn.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof Rb))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return G4.fromKeyframeNode(o,s,c,a)};Jn.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=gH(s,t,n,i);if(!l(a))return;let c=yH(r,n,i);if(!l(c))return;let u=new _H(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};Jn.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};Jn.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Jn.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Jn.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function B0t(e){let t=e._frameState;gK.camera=t.camera,gK.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,gK)}function k0t(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;_K.camera=e.preloadFlightCamera,_K.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,_K)}function V0t(e){e.primitives.updateForPass(e._frameState,Zyt)}Jn.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Jn.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Jn.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Jn.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Jn.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Jn.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Jn.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Jn.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Jn.prototype.cartesianToCanvasCoordinates=function(e,t){return zi.worldToWindowCoordinates(this,e,t)};Jn.prototype.completeMorph=function(){this._transitioner.completeMorph()};Jn.prototype.morphTo2D=function(e){e=y(e,2),this._transitioner.morphTo2D(e,this._ellipsoid)};Jn.prototype.morphToColumbusView=function(e){e=y(e,2),this._transitioner.morphToColumbusView(e,this._ellipsoid)};Jn.prototype.morphTo3D=function(e){e=y(e,2),this._transitioner.morphTo3D(e,this._ellipsoid)};function U0t(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}Jn.prototype.setTerrain=function(e){return U0t(this,e),e};Jn.prototype.isDestroyed=function(){return!1};Jn.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),ue(this)};var TH=Jn;function QE(e){e=y(e,ee.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=d.multiplyByScalar(e.radii,t,new d);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new $e({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new d;let i=new d;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(QE.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});QE.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var TK=new F;QE.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,d.ZERO,TK),o=F.multiplyTransformation(i,No.Y_UP_TO_Z_UP,TK),r=F.multiply(this._scaleMatrix,o,TK);F.clone(r,this._modelMatrix);let s=e.context,a=z0t(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=ca.createGeometry(new ca({radii:new d(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Ie.POSITION_ONLY}));f.vertexArray=ti.fromGeometry({context:s,geometry:p,attributeLocations:Nn.createAttributeLocations(p),bufferUsage:Fe.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:un.ALPHA_BLEND,depthMask:!1})}let h=a|u<<2|c<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let _=new Ue({defines:p,sources:[Ph,iv,yL]}),m=new Ue({defines:p,sources:[Ph,iv,_L]});this._spSkyAtmosphere=en.fromCache({context:s,vertexShaderSource:_,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function z0t(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}QE.prototype.isDestroyed=function(){return!1};QE.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var CH=QE;function eS(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new $e({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}eS.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==ne.SCENE3D&&i!==ne.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?HM(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}).catch(c=>{this._hasError=!0,this._error=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new wr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=ja.createGeometry(ja.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),c=this._attributeLocations=Nn.createAttributeLocations(a);s.vertexArray=ti.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Fe.STATIC_DRAW}),s.renderState=Ve.fromCache({blending:un.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new Ue({defines:[t?"HDR":""],sources:[xL]});s.shaderProgram=en.fromCache({context:r,vertexShaderSource:bL,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};eS.prototype.isDestroyed=function(){return!1};eS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};function JE(e){return nn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}eS.createEarthSkyBox=function(){return new eS({sources:{positiveX:JE("px"),negativeX:JE("mx"),positiveY:JE("py"),negativeY:JE("my"),positiveZ:JE("pz"),negativeZ:JE("mz")}})};var AH=eS;function fP(){this.show=!0,this._drawCommand=new $e({primitiveType:Me.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(fP.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var H0t=new U,G0t=new U,W0t=new oe,uP=new oe;fP.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(r,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let v=n?o.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._texture=new Ot({context:o,width:S,height:S,pixelFormat:tt.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let D=this,O={u_radiusTS:function(){return D._radiusTS}};this._commands.computeCommand=new al({fragmentShaderSource:CL,outputTexture:this._texture,uniformMap:O,persists:!1,owner:this,postExecute:function(){D._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let S={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let D=yt.createVertexBuffer({context:o,typedArray:v,usage:Fe.STATIC_DRAW}),O=[{index:S.direction,vertexBuffer:D,componentsPerAttribute:2,normalize:!0,componentDatatype:X.UNSIGNED_BYTE}],R=yt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});a.vertexArray=new ti({context:o,attributes:O,indexBuffer:R}),a.shaderProgram=en.fromCache({context:o,vertexShaderSource:AL,fragmentShaderSource:TL,attributeLocations:S}),a.renderState=Ve.fromCache({blending:un.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,h=this._boundingVolume2D;d.clone(c,f.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,h.radius=f.radius,i===ne.SCENE3D?ae.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&ae.clone(h,a.boundingVolume);let p=zi.computeActualEllipsoidPosition(e,c,uP),_=d.magnitude(d.subtract(p,e.camera.position,uP)),m=o.uniformState.projection,x=W0t;x.x=0,x.y=0,x.z=-_,x.w=1;let b=F.multiplyByVector(m,x,uP),T=zi.clipToGLWindowCoordinates(t.viewport,b,H0t);x.x=P.SOLAR_RADIUS;let C=F.multiplyByVector(m,x,uP),A=zi.clipToGLWindowCoordinates(t.viewport,C,G0t);return this._size=U.magnitude(U.subtract(A,T,uP)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};fP.prototype.isDestroyed=function(){return!1};fP.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var EH=fP;var gbe=Ur(WP(),1);function j0t(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); +}`});function sbe(){this.ready=!0,this.shape=Vi.BOX,this.dimensions=new d(1,1,1),this.names=["data"],this.types=[ct.SCALAR],this.componentTypes=[kt.FLOAT32],this.maximumTileCount=1}sbe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};Gm.DefaultProvider=new sbe;var Rb=Gm;function Xyt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var rH=Xyt;function Kyt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var sH=Kyt;function Zyt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var aH=Zyt;var lH=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function ei(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ge(e.contextOptions),r=l(n),s=new HM(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=zn(),this._jobScheduler=new Sz,this._frameState=new Cz(s,new fz(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new H1(s),this._ellipsoid=y(e.ellipsoid,ee.default),this._globe=void 0,this._globeTranslucencyState=new Az,this._primitives=new pu,this._groundPrimitives=new pu,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=ei.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new XE,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new yz(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ti({color:new z,stencil:0,owner:this}),this._depthClearCommand=new ti({depth:1,owner:this}),this._stencilClearCommand=new ti({stencil:0}),this._classificationStencilClearCommand=new ti({stencil:0,renderState:Ve.fromCache({stencilMask:Vt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new g4(this),this._preUpdate=new pe,this._postUpdate=new pe,this._renderError=new pe,this._preRender=new pe,this._postRender=new pe,this._minimumDisableDepthTestDistance=0,this._debugInspector=new R4,this._msaaSamples=y(e.msaaSamples,4),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new pe,this.morphComplete=new pe,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=ne.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Pi(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new TC,this.fog=new Tz,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(so.DEFAULT_VIEW_RECTANGLE=se.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new so(this),this.shadowMap=new Jy({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new YI,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new h4,this._brdfLutGenerator=new ez,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new w4(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,Iu.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Tc.requestCompletedEvent.addEventListener(lH(this)),this._removeTaskProcessorListenerCallback=yi.taskCompletedEvent.addEventListener(lH(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new qe(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new so(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new so(this),this.preloadFlightCullingVolume=void 0,this._picking=new qz(this),this._defaultView=new WE(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Gg,fbe(this,0,Z.now()),this.updateFrameState(),this.initializeFrame()}ei.defaultLogDepthBuffer=!0;function $yt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(lH(e))),n.push(t.terrainProviderChanged.addEventListener(lH(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(ei.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Ft.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Ft.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Uh.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,$yt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===ne.SCENE2D?this.morphTo2D(0):e===ne.SCENE3D?this.morphTo3D(0):e===ne.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new so(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new bz(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Ft.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});ei.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function Qyt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function abe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=gg.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=gg.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=gg.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=gg.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=Jy.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===we.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}ei.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),h=l(t.originalCommand),p=o&&!u,_=c&&!f,m=(!o||!c)&&!h,x=n.pickingMetadata&&Qyt(e,n);if(e.dirty=e.dirty||p||_||m||x,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:T}=i;b&&e.castShadows&&(t.shadows=Jy.createCastDerivedCommand(T,e,s,r,t.shadows)),(u||p)&&(t.logDepth=gg.createLogDepthCommand(e,r,t.logDepth),abe(this,t.logDepth.command,s)),(h||m)&&abe(this,e,s)};var Jyt=new ch({pass:Uo.RENDER}),_K=new ch({pass:Uo.PRELOAD}),yK=new ch({pass:Uo.PRELOAD_FLIGHT}),e0t=new ch({pass:Uo.REQUEST_RENDER_MODE_DEFER_CHECK}),cbe=new ae,xK;function t0t(e){if(!(e._mode!==ne.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return cbe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,xK=QU.fromBoundingSphere(cbe,e.camera.positionWC,xK),xK}ei.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function fbe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Z.clone(n,i.time)}ei.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=t0t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof nn||this.camera.frustum instanceof Hr),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),YI.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};ei.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Wt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var cH=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);cH=F.inverseTransformation(cH,cH);function n0t(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=d.clone(s.center);if(o.mode!==ne.SCENE3D){a=F.multiplyByPoint(cH,a,a);let m=o.mapProjection,x=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(x)}let c,u,{radius:f}=s;l(f)?(c=ua.createGeometry(new ua({radii:new d(f,f,f),vertexFormat:an.FLAT_VERTEX_FORMAT})),u=F.fromTranslation(a)):(c=qa.createGeometry(qa.fromDimensions({dimensions:new d(2,2,2),vertexFormat:an.FLAT_VERTEX_FORMAT})),u=F.fromRotationTranslation(s.halfAxes,a,new F)),t._debugVolume=new In({geometryInstances:new vt({geometry:Nn.toWireframe(c),modelMatrix:u,attributes:{color:new Gt(1,0,0,1)}}),appearance:new an({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=gg.createLogDepthCommand(e,r).command);let _;l(i)&&(_=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(_)&&(n.framebuffer=_),o.commandList=h}function Wm(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ti){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&n0t(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function lbe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function dbe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function i0t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function o0t(e,t,n,i,o){Yy(i,dbe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function r0t(e,t,n,i,o){Yy(i,i0t,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function s0t(e,t,n){e.context.uniformState.updatePass(we.VOXELS);let i=n.commands[we.VOXELS];i.length=n.indices[we.VOXELS],Yy(i,dbe,e.camera.positionWC);for(let o=0;o<i.length;++o)Wm(i[o],e,t)}var a0t=new Ii,c0t=new kl,l0t=new nn,u0t=new Hr;function f0t(e){let{frustum:t}=e;return l(t.fov)?t.clone(a0t):l(t.infiniteProjectionMatrix)?t.clone(c0t):l(t.width)?t.clone(l0t):t.clone(u0t)}function d0t(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?o0t:r0t}function h0t(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=d0t(e);o.uniformState.updatePass(we.TRANSLUCENT);let f=n.commands[we.TRANSLUCENT];f.length=n.indices[we.TRANSLUCENT],u(e,Wm,t,f,c)}function m0t(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[we.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[we.TRANSLUCENT];i.executeTranslucentCommands(e,Wm,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,Wm,t,n)}function TK(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=f0t(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||p0t(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:_,usePostProcessSelected:m}=e._environmentState,{globeDepth:x,globeTranslucencyFramebuffer:b,sceneFramebuffer:T,frustumCommandsList:C}=e._view,A=C.length,S=e._globeTranslucencyState,v=e._depthClearCommand,D=e._stencilClearCommand,O=e._classificationStencilClearCommand,R=e._depthPlane,M=n.position.z;function L(E,w){r.updatePass(w);let I=E.commands[w],N=E.indices[w];for(let B=0;B<N;++B)Wm(I[B],e,t);return N}function g(E,w){r.updatePass(w);let I=E.commands[w],N=E.indices[w];for(let B=0;B<N;++B)lbe(I[B],e,t)}for(let E=0;E<A;++E){let w=A-E-1,I=C[w];e.mode===ne.SCENE2D?(n.position.z=M-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=w!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&D.execute(i,t),S.translucent?(r.updatePass(we.GLOBE),S.executeGlobeCommands(I,Wm,b,e,t)):L(I,we.GLOBE),p&&x.executeCopyDepth(i,t),f||(S.translucent?(r.updatePass(we.TERRAIN_CLASSIFICATION),S.executeGlobeClassificationCommands(I,Wm,b,e,t)):L(I,we.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),h&&R.execute(i,t));let N;if(!_||c||f)N=L(I,we.CESIUM_3D_TILE),N>0&&(p&&(x.prepareColorTextures(i,u),x.executeUpdateDepth(i,t,x.depthStencilTexture)),f||(N=L(I,we.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let H=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N=L(I,we.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),x.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=L(I,we.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=H,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&O.execute(i,t),N=L(I,we.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&D.execute(i,t),s0t(e,t,I),L(I,we.OPAQUE),w!==0&&e.mode!==ne.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),h0t(e,t,I),m0t(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let H=e._picking.getPickDepth(e,w);H.update(i,x.depthStencilTexture),H.executeCopyDepth(i,t)}if(c||!m)continue;let B=t.framebuffer;t.framebuffer=T.getIdFramebuffer(),s.near=w!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),S.translucent?(r.updatePass(we.GLOBE),S.executeGlobeCommands(I,lbe,b,e,t)):g(I,we.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&h&&R.execute(i,t),g(I,we.CESIUM_3D_TILE),g(I,we.OPAQUE),g(I,we.TRANSLUCENT),t.framebuffer=B}}function p0t(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(we.ENVIRONMENT),l(i.skyBoxCommand)&&Wm(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Wm(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function hbe(e){e.context.uniformState.updatePass(we.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function g0t(e,t){e.context.uniformState.updatePass(we.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function _0t(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[we.GLOBE,we.CESIUM_3D_TILE,we.OPAQUE,we.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let h=s-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,u))r[h].commandList.push(u),f=!0;else if(f)break}}}}function mbe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;_0t(e,n,c);for(let f=0;f<u.length;++f){let h=c.passes[f],{camera:p,commandList:_}=h;s.updateCamera(p),c.updatePass(r,f);for(let m=0;m<_.length;++m){let x=_[m];s.updatePass(x.pass);let b=x.derivedCommands.shadows.castCommands[a];Wm(b,e,h.passState)}}}}var y0t=new d;ei.prototype.updateAndExecuteCommands=function(e,t){R0t(this,e,t),this._environmentState.useWebVR?x0t(this,e,t):this._frameState.mode!==ne.SCENE2D||this._mapMode2D===Iu.ROTATE?o0(!0,this,e):D0t(this,e)};function x0t(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;pbe(e),n.createPotentiallyVisibleSet(e),hbe(e),r||mbe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=so.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*y(e.focalLength,5),f=y(e.eyeSeparation,u/30),h=d.multiplyByScalar(a.right,f*.5,y0t);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;d.add(a.position,h,i.position),i.frustum.xOffset=p,TK(e,t),s.x=s.width,d.subtract(a.position,h,i.position),i.frustum.xOffset=-p,TK(e,t),so.clone(a,i)}var b0t=new fe(Math.PI,P.PI_OVER_TWO),T0t=new d,C0t=new d,A0t=new F,E0t=new F,S0t=new d,v0t=new d,w0t=new qe;function D0t(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=qe.clone(r,w0t);t.viewport=s;let a=b0t,c=T0t;e.mapProjection.project(a,c);let f=d.clone(i.position,C0t),h=F.clone(i.transform,E0t),p=i.frustum.clone();i._setTransform(F.IDENTITY);let _=F.computeViewportTransformation(s,0,1,A0t),m=i.frustum.projectionMatrix,x=i.positionWC.y,b=d.fromElements(P.sign(x)*c.x-x,0,-i.positionWC.x,S0t),T=Ot.pointToGLWindowCoordinates(m,_,b,v0t);T.x=Math.floor(T.x);let C=s.x,A=s.width;if(x===0||T.x<=C||T.x>=C+A)o0(!0,e,t);else if(Math.abs(C+A*.5-T.x)<1)s.width=T.x-s.x,i.position.x*=P.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!0,e,t),s.x=T.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!1,e,t);else if(T.x>C+A*.5){s.width=T.x-C;let S=i.frustum.right;i.frustum.right=c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!0,e,t),s.x=T.x,s.width=C+A-T.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=S-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!1,e,t)}else{s.x=T.x,s.width=C+A-T.x;let S=i.frustum.left;i.frustum.left=-c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!0,e,t),s.x=C,s.width=T.x-C,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=S-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),o0(!1,e,t)}i._setTransform(h),d.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function o0(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),pbe(t),i.createPotentiallyVisibleSet(t),e&&(hbe(t),o||mbe(t)),TK(t,n)}var ube=new ys;ei.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==ne.SCENE2D&&t.camera.frustum instanceof nn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(S_.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let T=r.dynamicLighting;s.setDynamicLighting(T),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let b=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(b)?b.drawCommand:void 0,n.sunComputeCommand=l(b)?b.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===ne.SCENE2D);(n.useDepthPlane=u&&this.mode===ne.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ne.SCENE2D&&!o;let h=e.mode===ne.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,_=ube.planes;for(let b=0;b<5;++b)_[b]=p.planes[b];p=ube,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let m=this.specularEnvironmentMaps,x=this._specularEnvironmentCubeMap;l(m)&&x?.url!==m?(x=x&&x.destroy(),this._specularEnvironmentCubeMap=new Uh(m)):!l(m)&&l(x)&&(x.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function I0t(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new pg({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function P0t(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===ne.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function pbe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),I0t(e),P0t(e),e._globe&&e._globe.render(t)}function R0t(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new P4:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let h=r.useGlobeDepthFramebuffer=l(s.globeDepth);h&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,_=r.useOIT=!c&&l(p)&&p.isSupported();_&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),x=r.usePostProcess=m.ready,r.usePostProcessSelected=x&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let T;if(o.invertClassificationColor.alpha===1&&h&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&_){let C=e._invertClassification.unclassifiedCommand,A=C.derivedCommands;A.oit=p.createDerivedCommands(C,i,A.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}ei.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?h.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let _=h;a&&!s&&(_=f);let m=this.postProcessStages,x=_.getColorTexture(0),b=p.getColorTexture(0),T=y(f,h).getDepthStencilTexture();m.execute(t,x,T,b),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function O0t(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function M0t(e){if(e.mode===ne.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}ei.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===Ye.CLAMP_TO_TERRAIN||t===Ye.RELATIVE_TO_TERRAIN,i=t===Ye.CLAMP_TO_3D_TILE||t===Ye.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=this.primitives.length;for(let a=0;a<s;++a){let c=this.primitives.get(a);if(!c.isCesium3DTileset||!c.show||!c.enableCollision)continue;let u=c.getHeight(e,this);l(u)&&u>o&&(o=u)}}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var bK=new fe;ei.prototype.updateHeight=function(e,t,n){let i=()=>{fe.clone(e,bK);let _=this.getHeight(e,n);l(_)&&(bK.height=_,t(bK))},o=n===Ye.CLAMP_TO_TERRAIN||n===Ye.RELATIVE_TO_TERRAIN,r=n===Ye.CLAMP_TO_3D_TILE||n===Ye.RELATIVE_TO_3D_TILE,s;!r&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,i));let a={},c=this._ellipsoid,u=_=>{if(o||_.isDestroyed()||!_.isCesium3DTileset)return;let m=_.updateHeight(e,i,c);a[_.id]=m};if(!o){let _=this.primitives.length;for(let m=0;m<_;++m){let x=this.primitives.get(m);u(x)}}let f=this.primitives.primitiveAdded.addEventListener(u),h=this.primitives.primitiveRemoved.addEventListener(_=>{_.isDestroyed()||!_.isCesium3DTileset||(l(a[_.id])&&a[_.id](),delete a[_.id])});return()=>{s=s&&s(),Object.values(a).forEach(_=>_()),a={},f(),h()}};function L0t(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===ne.SCENE2D||n===ne.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}ei.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=M0t(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=L0t(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function N0t(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new $y({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function F0t(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function B0t(e){e.primitives.postPassesUpdate(e._frameState),Tc.update()}var k0t=new z;function V0t(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Jyt;let r=y(e.backgroundColor,z.BLACK);e._hdr&&(r=z.clone(r,k0t),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof Gg?d.negate(i.sunDirectionWC,e._shadowMapCamera.direction):d.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=qe.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,g0t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function Ob(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function U0t(e){return e._picking.updateMostDetailedRayPicks(e)}ei.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=Z.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ne.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(Z.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=Z.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=P.incrementWrap(t.frameNumber,15e6,1);fbe(this,o,e),t.newFrame=!0}Ob(this,F0t),this.primitives.show&&(Ob(this,U0t),Ob(this,z0t),Ob(this,H0t),i||Ob(this,G0t)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),Ob(this,V0t)),N0t(this,i),Ob(this,B0t),O0t(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};ei.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};ei.prototype.requestRender=function(){this._renderRequested=!0};ei.prototype.clampLineWidth=function(e){return Math.max(Ft.minimumAliasedLineWidth,Math.min(e,Ft.maximumAliasedLineWidth))};ei.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};ei.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof Rb))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return O4.fromKeyframeNode(o,s,c,a)};ei.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=rH(s,t,n,i);if(!l(a))return;let c=aH(r,n,i);if(!l(c))return;let u=new sH(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};ei.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};ei.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};ei.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};ei.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function z0t(e){let t=e._frameState;_K.camera=t.camera,_K.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,_K)}function H0t(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;yK.camera=e.preloadFlightCamera,yK.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,yK)}function G0t(e){e.primitives.updateForPass(e._frameState,e0t)}ei.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};ei.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};ei.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};ei.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};ei.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};ei.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};ei.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};ei.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};ei.prototype.cartesianToCanvasCoordinates=function(e,t){return zi.worldToWindowCoordinates(this,e,t)};ei.prototype.completeMorph=function(){this._transitioner.completeMorph()};ei.prototype.morphTo2D=function(e){e=y(e,2),this._transitioner.morphTo2D(e,this._ellipsoid)};ei.prototype.morphToColumbusView=function(e){e=y(e,2),this._transitioner.morphToColumbusView(e,this._ellipsoid)};ei.prototype.morphTo3D=function(e){e=y(e,2),this._transitioner.morphTo3D(e,this._ellipsoid)};function W0t(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}ei.prototype.setTerrain=function(e){return W0t(this,e),e};ei.prototype.isDestroyed=function(){return!1};ei.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),ue(this)};var uH=ei;var hP=`float interpolateByDistance(vec4 nearFarScalar, float distance) +{ + float startDistance = nearFarScalar.x; + float startValue = nearFarScalar.y; + float endDistance = nearFarScalar.z; + float endValue = nearFarScalar.w; + float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); + return mix(startValue, endValue, t); +} + +void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) +{ + float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; + + // Adjustment to the atmosphere radius applied based on the camera height. + float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; + float distanceAdjustMax = czm_ellipsoidRadii.x; + float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; + float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); + + // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit + // for the position on the ellipsoid. + float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; + float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; + + // Setup the primary ray: from the camera position to the vertex position. + vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; + vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); + czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); + + underTranslucentGlobe = 0.0; + + // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. + #if defined(GLOBE_TRANSLUCENT) + + // Check for intersection with the inner radius of the atmopshere. + czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); + if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { + + // Compute position on globe. + vec3 direction = normalize(positionWC); + czm_ray ellipsoidRay = czm_ray(positionWC, -direction); + czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); + vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); + + // Control the color using the camera angle. + float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); + + // Control the opacity using the distance from Earth. + opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); + vec3 horizonColor = vec3(0.1, 0.2, 0.3); + vec3 nearColor = vec3(0.0); + + rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); + + // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. + underTranslucentGlobe = 1.0; + return; + } + #endif + + computeScattering( + primaryRay, + length(cameraToPositionWC), + lightDirection, + atmosphereInnerRadius, + rayleighColor, + mieColor, + opacity + ); + + // Alter the opacity based on how close the viewer is to the ground. + // (0.0 = At edge of atmosphere, 1.0 = On ground) + float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; + float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; + opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); + + // Alter alpha based on time of day (0.0 = night , 1.0 = day) + float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; + opacity *= pow(nightAlpha, 0.5); +} +`;var fH=`in vec3 v_outerPositionWC; + +uniform vec3 u_hsbShift; + +#ifndef PER_FRAGMENT_ATMOSPHERE +in vec3 v_mieColor; +in vec3 v_rayleighColor; +in float v_opacity; +in float v_translucent; +#endif + +void main (void) +{ + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum); + + vec3 mieColor; + vec3 rayleighColor; + float opacity; + float translucent; + + #ifdef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + v_outerPositionWC, + lightDirection, + rayleighColor, + mieColor, + opacity, + translucent + ); + #else + mieColor = v_mieColor; + rayleighColor = v_rayleighColor; + opacity = v_opacity; + translucent = v_translucent; + #endif + + vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); + + #ifndef HDR + color.rgb = czm_pbrNeutralTonemapping(color.rgb); + color.rgb = czm_inverseGamma(color.rgb); + #endif + + #ifdef COLOR_CORRECT + const bool ignoreBlackPixels = true; + color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels); + #endif + + // For the parts of the sky atmosphere that are not behind a translucent globe, + // we mix in the default opacity so that the sky atmosphere still appears at distance. + // This is needed because the opacity in the sky atmosphere is initially adjusted based + // on the camera height. + if (translucent == 0.0) { + color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); + } + + out_FragColor = color; +} +`;var dH=`in vec4 position; + +out vec3 v_outerPositionWC; + +#ifndef PER_FRAGMENT_ATMOSPHERE +out vec3 v_mieColor; +out vec3 v_rayleighColor; +out float v_opacity; +out float v_translucent; +#endif + +void main(void) +{ + vec4 positionWC = czm_model * position; + float lightEnum = u_radiiAndDynamicAtmosphereColor.z; + vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum); + + #ifndef PER_FRAGMENT_ATMOSPHERE + computeAtmosphereScattering( + positionWC.xyz, + lightDirection, + v_rayleighColor, + v_mieColor, + v_opacity, + v_translucent + ); + #endif + + v_outerPositionWC = positionWC.xyz; + gl_Position = czm_modelViewProjection * position; +} +`;function tS(e){e=y(e,ee.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=d.multiplyByScalar(e.radii,t,new d);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new $e({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new d;let i=new d;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(tS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});tS.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var CK=new F;tS.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ne.SCENE3D&&n!==ne.MORPHING||!e.passes.render)return;let i=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,d.ZERO,CK),o=F.multiplyTransformation(i,Fo.Y_UP_TO_Z_UP,CK),r=F.multiply(this._scaleMatrix,o,CK);F.clone(r,this._modelMatrix);let s=e.context,a=j0t(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=ua.createGeometry(new ua({radii:new d(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Ie.POSITION_ONLY}));f.vertexArray=ni.fromGeometry({context:s,geometry:p,attributeLocations:Nn.createAttributeLocations(p),bufferUsage:Fe.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:bi.FRONT},blending:ln.ALPHA_BLEND,depthMask:!1})}let h=a|u<<2|c<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let _=new Ue({defines:p,sources:[Zh,hP,dH]}),m=new Ue({defines:p,sources:[Zh,hP,fH]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:_,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function j0t(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}tS.prototype.isDestroyed=function(){return!1};tS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var hH=tS;var mH=`uniform samplerCube u_cubeMap; + +in vec3 v_texCoord; + +void main() +{ + vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); + out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); +} +`;var pH=`in vec3 position; +out vec3 v_texCoord; + +void main() +{ + vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); + gl_Position = czm_projection * vec4(p, 1.0); + v_texCoord = position.xyz; +} +`;function iS(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new $e({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}iS.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==ne.SCENE3D&&i!==ne.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?qM(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}).catch(c=>{this._hasError=!0,this._error=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new wr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=qa.createGeometry(qa.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),c=this._attributeLocations=Nn.createAttributeLocations(a);s.vertexArray=ni.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Fe.STATIC_DRAW}),s.renderState=Ve.fromCache({blending:ln.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new Ue({defines:[t?"HDR":""],sources:[mH]});s.shaderProgram=Qt.fromCache({context:r,vertexShaderSource:pH,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};iS.prototype.isDestroyed=function(){return!1};iS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};function nS(e){return en(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}iS.createEarthSkyBox=function(){return new iS({sources:{positiveX:nS("px"),negativeX:nS("mx"),positiveY:nS("py"),negativeY:nS("my"),positiveZ:nS("pz"),negativeZ:nS("mz")}})};var gH=iS;var _H=`uniform sampler2D u_texture; + +in vec2 v_textureCoordinates; + +void main() +{ + vec4 color = texture(u_texture, v_textureCoordinates); + out_FragColor = czm_gammaCorrect(color); +} +`;var yH=`uniform float u_radiusTS; + +in vec2 v_textureCoordinates; + +vec2 rotate(vec2 p, vec2 direction) +{ + return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); +} + +vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +{ + vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); + float radius = length(rotatedPosition) * lengthScalar; + float burst = 1.0 - smoothstep(0.0, 0.55, radius); + return vec4(burst); +} + +void main() +{ + float lengthScalar = 2.0 / sqrt(2.0); + vec2 position = v_textureCoordinates - vec2(0.5); + float radius = length(position) * lengthScalar; + float surface = step(radius, u_radiusTS); + vec4 color = vec4(vec2(1.0), surface + 0.2, surface); + + float glow = 1.0 - smoothstep(0.0, 0.55, radius); + color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; + + vec4 burst = vec4(0.0); + + // The following loop has been manually unrolled for speed, to + // avoid sin() and cos(). + // + //for (float i = 0.4; i < 3.2; i += 1.047) { + // vec2 direction = vec2(sin(i), cos(i)); + // burst += 0.4 * addBurst(position, direction, lengthScalar); + // + // direction = vec2(sin(i - 0.08), cos(i - 0.08)); + // burst += 0.3 * addBurst(position, direction, lengthScalar); + //} + + burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 + burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 + burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 + + burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 + burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 + + // End of manual loop unrolling. + + color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; + + out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +} +`;var xH=`in vec2 direction; + +uniform float u_size; + +out vec2 v_textureCoordinates; + +void main() +{ + vec4 position; + if (czm_morphTime == 1.0) + { + position = vec4(czm_sunPositionWC, 1.0); + } + else + { + position = vec4(czm_sunPositionColumbusView.zxy, 1.0); + } + + vec4 positionEC = czm_view * position; + vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); + + vec2 halfSize = vec2(u_size * 0.5); + halfSize *= ((direction * 2.0) - 1.0); + + gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); + + v_textureCoordinates = direction; +} +`;function pP(){this.show=!0,this._drawCommand=new $e({primitiveType:Me.TRIANGLES,boundingVolume:new ae,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ae,this._boundingVolume2D=new ae,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(pP.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var q0t=new U,Y0t=new U,X0t=new oe,mP=new oe;pP.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ne.SCENE2D||i===ne.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(r,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let v=n?o.halfFloatingPointTexture?Ke.HALF_FLOAT:Ke.FLOAT:Ke.UNSIGNED_BYTE;this._texture=new Rt({context:o,width:S,height:S,pixelFormat:tt.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let D=this,O={u_radiusTS:function(){return D._radiusTS}};this._commands.computeCommand=new cl({fragmentShaderSource:yH,outputTexture:this._texture,uniformMap:O,persists:!1,owner:this,postExecute:function(){D._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let S={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let D=_t.createVertexBuffer({context:o,typedArray:v,usage:Fe.STATIC_DRAW}),O=[{index:S.direction,vertexBuffer:D,componentsPerAttribute:2,normalize:!0,componentDatatype:X.UNSIGNED_BYTE}],R=_t.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});a.vertexArray=new ni({context:o,attributes:O,indexBuffer:R}),a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:xH,fragmentShaderSource:_H,attributeLocations:S}),a.renderState=Ve.fromCache({blending:ln.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,h=this._boundingVolume2D;d.clone(c,f.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,h.radius=f.radius,i===ne.SCENE3D?ae.clone(f,a.boundingVolume):i===ne.COLUMBUS_VIEW&&ae.clone(h,a.boundingVolume);let p=zi.computeActualEllipsoidPosition(e,c,mP),_=d.magnitude(d.subtract(p,e.camera.position,mP)),m=o.uniformState.projection,x=X0t;x.x=0,x.y=0,x.z=-_,x.w=1;let b=F.multiplyByVector(m,x,mP),T=zi.clipToGLWindowCoordinates(t.viewport,b,q0t);x.x=P.SOLAR_RADIUS;let C=F.multiplyByVector(m,x,mP),A=zi.clipToGLWindowCoordinates(t.viewport,C,Y0t);return this._size=U.magnitude(U.subtract(A,T,mP)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};pP.prototype.isDestroyed=function(){return!1};pP.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var bH=pP;var ybe=Ur(XP(),1);function K0t(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); vec4 clippingPlanesEdgeColor = vec4(1.0); clippingPlanesEdgeColor.rgb = ${n}.rgb; float clippingPlanesEdgeWidth = ${n}.a; @@ -15788,7 +15351,7 @@ Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_ { out_FragColor = clippingPlanesEdgeColor; } -`}var SH=j0t;var q0t={modifyFragmentShader:function(t){return t=Ue.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +`}var TH=K0t;var Z0t={modifyFragmentShader:function(t){return t=Ue.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; void main() { #ifndef SHADOW_MAP @@ -15797,9 +15360,9 @@ void main() #endif czm_splitter_main(); } -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},dP=q0t;var Mb={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function hP(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=Mb.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,we.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.time=0,this.shadows=xn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,Gr.NONE),this._splittingEnabled=!1,this._error=void 0,Y0t(this,e)}Object.defineProperties(hP.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function Y0t(e,t){let n=UC.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=i_.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=Mb.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=z.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var X0t=new d,K0t=new d,Z0t=new d,mbe,vH;function $0t(e){if(!l(vH)){mbe=new gbe.default(0),vH=new Array(e);for(let t=0;t<e;++t)vH[t]=mbe.random()}return vH}function Q0t(e){let n=e.length/3,i=Math.min(n,20),o=$0t(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=d.fromElements(r,r,r,X0t),c=d.fromElements(s,s,s,K0t);for(let f=0;f<i;++f){let h=Math.floor(o[f]*n),p=d.unpack(e,h*3,Z0t);d.minimumByComponent(a,p,a),d.maximumByComponent(c,p,c)}let u=ae.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function pbe(e,t){let n=X.fromTypedArray(e);return n===X.INT||n===X.UNSIGNED_INT||n===X.DOUBLE?(xt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var J0t=new oe,ext=new oe,txt=new z,_be=0,wH=1,vK=2,ybe=3,nxt=4,CK=new F,ixt=new F;function oxt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),h=e._isQuantized,p=e._isQuantizedDraco,_=e._isOctEncoded16P,m=e._isOctEncodedDraco,x=e._quantizedRange,b=e._octEncodedRange,T=e._isRGB565,C=e._isTranslucent,A=e._hasColors,S=e._hasNormals,v=e._hasBatchIds,D,O,R=[],M={};if(e._styleableShaderAttributes=M,f){let V=nxt;for(let G in u)if(u.hasOwnProperty(G)){let k=u[G],W=pbe(k.typedArray,G);D=k.componentCount,O=X.fromTypedArray(W);let Y=yt.createVertexBuffer({context:n,typedArray:W,usage:Fe.STATIC_DRAW});e._geometryByteLength+=Y.sizeInBytes;let J={index:V,vertexBuffer:Y,componentsPerAttribute:D,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(J),M[G]={location:V,componentCount:D},++V}}let L=yt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Fe.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let g;A&&(g=yt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let E;S&&(E=yt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let w;v&&(c.typedArray=pbe(c.typedArray,"batchIds"),w=yt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let I=[];if(h?O=X.UNSIGNED_SHORT:p?O=x<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT:O=X.FLOAT,I.push({index:_be,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=ae.fromCornerPoints(d.ZERO,e._quantizedVolumeScale):e._boundingSphere=Q0t(r.typedArray)),A)if(T)I.push({index:wH,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:X.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=C?4:3;I.push({index:wH,vertexBuffer:g,componentsPerAttribute:V,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(_?(D=2,O=X.UNSIGNED_BYTE):m?(D=2,O=b<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT):(D=3,O=X.FLOAT),I.push({index:vK,vertexBuffer:E,componentsPerAttribute:D,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&I.push({index:ybe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:X.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(R));let N=new ti({context:n,attributes:I}),B={depthTest:{enabled:!0}},H={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===we.CESIUM_3D_TILE&&(B.stencilTest=Ut.setCesium3DTileBit(),B.stencilMask=Ut.CESIUM_3D_TILE_MASK,H.stencilTest=Ut.setCesium3DTileBit(),H.stencilMask=Ut.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(B),e._translucentRenderState=Ve.fromCache(H),e._drawCommand=new $e({boundingVolume:new ae,cull:e._cull,modelMatrix:new F,primitiveType:Me.POINTS,vertexArray:N,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:C?e._translucentRenderState:e._opaqueRenderState,pass:C?we.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function rxt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=J0t;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof rn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,txt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return F.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);F.multiply(n.uniformState.view3D,c,CK);let u=F.multiply(CK,a.modelMatrix,CK);return F.inverseTranspose(u,ixt)}};dP.addUniforms(e,s),(i||o||r)&&(s=bt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=ext;if(l(e._quantizedVolumeScale)){let c=d.clone(e._quantizedVolumeScale,a);d.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function AK(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function EK(e,t){e=e.slice(e.indexOf(` -`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function SK(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var sxt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function axt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,_=e._isTranslucent,m=e._hasColors,x=e._hasNormals,b=e._hasBatchIds,T=e._backFaceCulling,C=e._normalShading,A=e._drawCommand.vertexArray,S=e.clippingPlanes,v=e._attenuation,D,O,R,M=_,L=Ge(sxt),g={},E=e._styleableShaderAttributes;for(o in E)E.hasOwnProperty(o)&&(r=E[o],L[o]=`czm_3dtiles_property_${r.location}`,g[r.location]=r);if(a){let ce={translucent:!1},ge="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";D=n.getColorShaderFunction(`getColorFromStyle${ge}`,L,ce),O=n.getShowShaderFunction(`getShowFromStyle${ge}`,L,ce),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ge}`,L,ce),l(D)&&ce.translucent&&(M=!0)}e._styleTranslucent=M;let w=l(D),I=l(O),N=l(R),B=e.isClipped,H=[],V=[];w&&(AK(D,H),EK(D,V)),I&&(AK(O,H),EK(O,V)),N&&(AK(R,H),EK(R,V));let G=V.indexOf("COLOR")>=0,k=V.indexOf("NORMAL")>=0;if(k&&!x)throw new re("Style references the NORMAL semantic but the point cloud does not have normals");for(o in E)if(E.hasOwnProperty(o)){r=E[o];let ce=H.indexOf(r.location)>=0,ge=SK(A,r.location);ge.enabled=ce}let W=m&&(!w||G);if(m){let ce=SK(A,wH);ce.enabled=W}let Y=x&&(C||T||k);if(x){let ce=SK(A,vK);ce.enabled=Y}let J={a_position:_be};W&&(J.a_color=wH),Y&&(J.a_normal=vK),b&&(J.a_batchId=ybe);let j="",K=H.length;for(i=0;i<K;++i){let ce=H[i];r=g[ce];let ge=r.componentCount,xe=`czm_3dtiles_property_${ce}`,De;ge===1?De="float":De=`vec${ge}`,j+=`in ${De} ${xe}; -`,J[xe]=r.location}rxt(e,t);let Q=`in vec3 a_position; +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},gP=Z0t;var Mb={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function _P(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=Mb.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,we.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.time=0,this.shadows=xn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,Gr.NONE),this._splittingEnabled=!1,this._error=void 0,$0t(this,e)}Object.defineProperties(_P.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ae.clone(e,this._boundingSphere)}}});function $0t(e,t){let n=UC.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=o_.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=Mb.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=z.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var Q0t=new d,J0t=new d,ext=new d,gbe,CH;function txt(e){if(!l(CH)){gbe=new ybe.default(0),CH=new Array(e);for(let t=0;t<e;++t)CH[t]=gbe.random()}return CH}function nxt(e){let n=e.length/3,i=Math.min(n,20),o=txt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=d.fromElements(r,r,r,Q0t),c=d.fromElements(s,s,s,J0t);for(let f=0;f<i;++f){let h=Math.floor(o[f]*n),p=d.unpack(e,h*3,ext);d.minimumByComponent(a,p,a),d.maximumByComponent(c,p,c)}let u=ae.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function _be(e,t){let n=X.fromTypedArray(e);return n===X.INT||n===X.UNSIGNED_INT||n===X.DOUBLE?(yt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var ixt=new oe,oxt=new oe,rxt=new z,xbe=0,AH=1,wK=2,bbe=3,sxt=4,AK=new F,axt=new F;function cxt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),h=e._isQuantized,p=e._isQuantizedDraco,_=e._isOctEncoded16P,m=e._isOctEncodedDraco,x=e._quantizedRange,b=e._octEncodedRange,T=e._isRGB565,C=e._isTranslucent,A=e._hasColors,S=e._hasNormals,v=e._hasBatchIds,D,O,R=[],M={};if(e._styleableShaderAttributes=M,f){let V=sxt;for(let G in u)if(u.hasOwnProperty(G)){let k=u[G],W=_be(k.typedArray,G);D=k.componentCount,O=X.fromTypedArray(W);let Y=_t.createVertexBuffer({context:n,typedArray:W,usage:Fe.STATIC_DRAW});e._geometryByteLength+=Y.sizeInBytes;let J={index:V,vertexBuffer:Y,componentsPerAttribute:D,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(J),M[G]={location:V,componentCount:D},++V}}let L=_t.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Fe.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let g;A&&(g=_t.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let E;S&&(E=_t.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let w;v&&(c.typedArray=_be(c.typedArray,"batchIds"),w=_t.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Fe.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let I=[];if(h?O=X.UNSIGNED_SHORT:p?O=x<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT:O=X.FLOAT,I.push({index:xbe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=ae.fromCornerPoints(d.ZERO,e._quantizedVolumeScale):e._boundingSphere=nxt(r.typedArray)),A)if(T)I.push({index:AH,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:X.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=C?4:3;I.push({index:AH,vertexBuffer:g,componentsPerAttribute:V,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(_?(D=2,O=X.UNSIGNED_BYTE):m?(D=2,O=b<=255?X.UNSIGNED_BYTE:X.UNSIGNED_SHORT):(D=3,O=X.FLOAT),I.push({index:wK,vertexBuffer:E,componentsPerAttribute:D,componentDatatype:O,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&I.push({index:bbe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:X.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(R));let N=new ni({context:n,attributes:I}),B={depthTest:{enabled:!0}},H={depthTest:{enabled:!0},depthMask:!1,blending:ln.ALPHA_BLEND};e._opaquePass===we.CESIUM_3D_TILE&&(B.stencilTest=Vt.setCesium3DTileBit(),B.stencilMask=Vt.CESIUM_3D_TILE_MASK,H.stencilTest=Vt.setCesium3DTileBit(),H.stencilMask=Vt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(B),e._translucentRenderState=Ve.fromCache(H),e._drawCommand=new $e({boundingVolume:new ae,cull:e._cull,modelMatrix:new F,primitiveType:Me.POINTS,vertexArray:N,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:C?e._translucentRenderState:e._opaqueRenderState,pass:C?we.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function lxt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=ixt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===ne.SCENE2D||c instanceof nn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,rxt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return F.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);F.multiply(n.uniformState.view3D,c,AK);let u=F.multiply(AK,a.modelMatrix,AK);return F.inverseTranspose(u,axt)}};gP.addUniforms(e,s),(i||o||r)&&(s=xt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=oxt;if(l(e._quantizedVolumeScale)){let c=d.clone(e._quantizedVolumeScale,a);d.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function EK(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function SK(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function vK(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var uxt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function fxt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,_=e._isTranslucent,m=e._hasColors,x=e._hasNormals,b=e._hasBatchIds,T=e._backFaceCulling,C=e._normalShading,A=e._drawCommand.vertexArray,S=e.clippingPlanes,v=e._attenuation,D,O,R,M=_,L=Ge(uxt),g={},E=e._styleableShaderAttributes;for(o in E)E.hasOwnProperty(o)&&(r=E[o],L[o]=`czm_3dtiles_property_${r.location}`,g[r.location]=r);if(a){let ce={translucent:!1},_e="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";D=n.getColorShaderFunction(`getColorFromStyle${_e}`,L,ce),O=n.getShowShaderFunction(`getShowFromStyle${_e}`,L,ce),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${_e}`,L,ce),l(D)&&ce.translucent&&(M=!0)}e._styleTranslucent=M;let w=l(D),I=l(O),N=l(R),B=e.isClipped,H=[],V=[];w&&(EK(D,H),SK(D,V)),I&&(EK(O,H),SK(O,V)),N&&(EK(R,H),SK(R,V));let G=V.indexOf("COLOR")>=0,k=V.indexOf("NORMAL")>=0;if(k&&!x)throw new re("Style references the NORMAL semantic but the point cloud does not have normals");for(o in E)if(E.hasOwnProperty(o)){r=E[o];let ce=H.indexOf(r.location)>=0,_e=vK(A,r.location);_e.enabled=ce}let W=m&&(!w||G);if(m){let ce=vK(A,AH);ce.enabled=W}let Y=x&&(C||T||k);if(x){let ce=vK(A,wK);ce.enabled=Y}let J={a_position:xbe};W&&(J.a_color=AH),Y&&(J.a_normal=wK),b&&(J.a_batchId=bbe);let j="",K=H.length;for(i=0;i<K;++i){let ce=H[i];r=g[ce];let _e=r.componentCount,be=`czm_3dtiles_property_${ce}`,De;_e===1?De="float":De=`vec${_e}`,j+=`in ${De} ${be}; +`,J[be]=r.location}lxt(e,t);let Q=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; @@ -15874,18 +15437,455 @@ uniform vec4 u_clippingPlanesEdgeStyle; `),de+=`void main() { out_FragColor = czm_gammaCorrect(v_color); -`,B&&(de+=SH("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),de+=`} -`,e.splitDirection!==Gr.NONE&&(de=dP.modifyFragmentShader(de)),l(e._vertexShaderLoaded)&&(Q=e._vertexShaderLoaded(Q)),l(e._fragmentShaderLoaded)&&(de=e._fragmentShaderLoaded(de));let ye=e._drawCommand;l(ye.shaderProgram)&&ye.shaderProgram.destroy(),ye.shaderProgram=en.fromCache({context:s,vertexShaderSource:Q,fragmentShaderSource:de,attributeLocations:J});try{ye.shaderProgram._bind()}catch{throw new re("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function cxt(e,t){if(e._decodingState===Mb.READY)return!1;if(e._decodingState===Mb.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=d_.decodePointCloud(i,t);l(o)&&(e._decodingState=Mb.DECODING,o.then(function(r){e._decodingState=Mb.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=l(s)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(h){let b=r.POSITION.data.quantization,T=b.range;e._quantizedVolumeScale=d.fromElements(T,T,T),e._quantizedVolumeOffset=d.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let _=n.styleableProperties,m=i.batchTableProperties;for(let b in m)if(m.hasOwnProperty(b)){let T=r[b];l(_)||(_={}),_[b]={typedArray:T.array,componentCount:T.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=_}).catch(function(r){e._decodingState=Mb.FAILED,e._error=r}))}return!0}var lxt=new oe,uxt=new d;hP.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(cxt(this,t))return;let i=!1,o=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(oxt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){F.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,u),l(this._rtcCenter)&&F.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&F.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let h=e.mapProjection,p=F.getColumn(u,3,lxt);oe.equals(p,oe.UNIT_W)||Mt.basisTo2D(h,u,u)}let f=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,f),this._cull){let h=f.center;F.multiplyByPoint(u,h,h);let p=F.getScale(u,uxt);f.radius*=d.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==Gr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&axt(this,e,this._style),this._drawCommand.castShadows=xn.castShadows(this.shadows),this._drawCommand.receiveShadows=xn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?we.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};hP.prototype.isDestroyed=function(){return!1};hP.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var DH=hP;function Nb(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.shadows=y(e.shadows,xn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new vp(e.shading),this.style=e.style,this.frameFailed=new me,this.frameChanged=new me,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new P_,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(Nb.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function fxt(e){return`uniform vec4 czm_pickColor; -${e}`}function dxt(e){return function(t){return bt(t,{czm_pickColor:function(){return e._pickId.color}})}}function hxt(){return"czm_pickColor"}Nb.prototype.makeStyleDirty=function(){this._styleDirty=!0};Nb.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var mxt=new Z;function DK(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function Lb(e,t){return e._intervals.indexOf(t.start)}function pxt(e,t){let n=e._intervals,i=e._clock,o=DK(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Z.addSeconds(i.currentTime,r*o,mxt),a=n.indexOf(s),c=Lb(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function gxt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function _xt(e,t,n){let i=DK(e),o=Lb(e,t),r=Lb(e,n);return i>=0?o>=r:o<=r}function bbe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function yxt(e,t,n){let i=Lb(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?F.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ci(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Se.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new DH({arrayBuffer:u,cull:!0,fragmentShaderLoaded:fxt,uniformMapLoaded:dxt(e),pickIdLoaded:hxt})}).catch(bbe(e,c))}return r}function xxt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function bxt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(Tbe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ci()-t.timestamp)/1e3;xxt(e,a)}}t.touchedFrameNumber=i.frameNumber}var Txt=new F;function Cxt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function Axt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var Ext=new vp;function Tbe(e,t,n,i){let o=y(e.shading,Ext),r=t.pointCloud,s=y(t.transform,F.IDENTITY);r.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,Txt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=Cxt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=Axt(e);try{r.update(i)}catch(a){bbe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function wK(e,t,n,i){let o=yxt(e,t,i);bxt(e,o,n,i)}function Sxt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function Cbe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function vxt(e,t){let n=Lb(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function xbe(e,t,n,i,o){return l(n)?n.ready?!0:(wK(e,t,i,o),n.ready):!1}function wxt(e,t,n,i,o){let r,s,a,c=e._intervals,u=e._frames,f=Lb(e,n),h=Lb(e,t);if(f>=h){for(r=f;r>=h;--r)if(s=c.get(r),a=u[r],xbe(e,s,a,i,o))return s}else for(r=f;r<=h;++r)if(s=c.get(r),a=u[r],xbe(e,s,a,i,o))return s;return t}function Dxt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var tS={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};Nb.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=Z.clone(e.time));let t=Math.max(Z.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&Dxt(this,o,s),tS.timeSinceLoad=t,tS.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,h=this._previousInterval,p=this._nextInterval,_=gxt(this);if(!l(_))return;let m=!1,x=DK(this),b=x===0;x!==this._clockMultiplier&&(m=!0,this._clockMultiplier=x),(!l(h)||b)&&(h=_),(!l(p)||m||_xt(this,_,p))&&(p=pxt(this,_)),h=wxt(this,h,_,tS,e);let T=vxt(this,h);l(T)||(wK(this,h,tS,e),T=this._lastRenderedFrame),l(T)&&Tbe(this,T,tS,e),l(p)&&wK(this,p,tS,e);let C=this;l(T)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(T)&&T!==this._lastRenderedFrame&&C.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return C.frameChanged.raiseEvent(C),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=T;let A=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;A>S&&Cbe(this,Sxt(e));let D=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&D>0&&c.update(e,f,a,this.boundingSphere)};Nb.prototype.isDestroyed=function(){return!1};Nb.prototype.destroy=function(){return Cbe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var mP=Nb;function Abe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function Ixt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function Ebe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function Sbe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=Ebe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function vbe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Ao(e,t){e=Rn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Ht.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Ht.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Rn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Rn(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),h=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=h,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new me,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new um,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),Sbe(this);try{let p=y(t.ellipsoid,ee.default),_=new TH({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=_,_.camera.constrainedAxis=d.UNIT_Z,Ebe(this),vbe(this);let m=t.globe;l(m)||(m=new iz(p)),m!==!1&&(_.globe=m,_.globe.shadows=y(t.terrainShadows,xn.RECEIVE_ONLY));let x=t.skyBox;!l(x)&&ee.WGS84.equals(p)&&(x=AH.createEarthSkyBox()),x!==!1&&(_.skyBox=x,_.sun=new EH,ee.WGS84.equals(p)&&(_.moon=new fz));let b=t.skyAtmosphere;!l(b)&&ee.WGS84.equals(p)&&(b=new CH(p),b.show=t.globe!==!1&&m.show),b!==!1&&(_.skyAtmosphere=b);let T=t.baseLayer;t.globe!==!1&&T!==!1&&(l(T)||(T=lc.fromWorldImagery()),_.imageryLayers.add(T)),l(t.terrainProvider)&&t.globe!==!1&&(_.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&_.setTerrain(t.terrain),this._screenSpaceEventHandler=new Zf(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let C=this;this._onRenderError=function(R,M){C._useDefaultRenderLoop=!1,C._renderLoopRunning=!1,C._showRenderLoopErrors&&C.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,M)},_.renderError.addEventListener(this._onRenderError);let A=t.dataSources,S=!1;l(A)||(A=new K3,S=!0);let v=new Bk({scene:_,dataSourceCollection:A}),D=new _r;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=A,this._destroyDataSourceCollection=S,this._dataSourceDisplay=v,this._eventHelper=D,this._canAnimateUpdateCallback=this._updateCanAnimate,D.add(this._clock.onTick,Ao.prototype._onTick,this),D.add(_.morphStart,Ao.prototype._clearTrackedObject,this),D.add(A.dataSourceAdded,Ao.prototype._onDataSourceAdded,this),D.add(A.dataSourceRemoved,Ao.prototype._onDataSourceRemoved,this),D.add(_.postRender,Ao.prototype._postRender,this);let O=A.length;for(let R=0;R<O;R++)this._dataSourceAdded(A,A.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),D.add(A.dataSourceAdded,Ao.prototype._dataSourceAdded,this),D.add(A.dataSourceRemoved,Ao.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Ao.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&Ixt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,IK(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(F.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,Abe(this.clock,e))}}});Ao.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let _=document.createElement("div");if(_.className="cesium-widget-errorPanel-message",a.appendChild(_),f){let m=ug(n);u||(typeof n=="string"&&(n=new Error(n)),t=ug({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} +`,B&&(de+=TH("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),de+=`} +`,e.splitDirection!==Gr.NONE&&(de=gP.modifyFragmentShader(de)),l(e._vertexShaderLoaded)&&(Q=e._vertexShaderLoaded(Q)),l(e._fragmentShaderLoaded)&&(de=e._fragmentShaderLoaded(de));let xe=e._drawCommand;l(xe.shaderProgram)&&xe.shaderProgram.destroy(),xe.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:Q,fragmentShaderSource:de,attributeLocations:J});try{xe.shaderProgram._bind()}catch{throw new re("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function dxt(e,t){if(e._decodingState===Mb.READY)return!1;if(e._decodingState===Mb.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=h_.decodePointCloud(i,t);l(o)&&(e._decodingState=Mb.DECODING,o.then(function(r){e._decodingState=Mb.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=l(s)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(h){let b=r.POSITION.data.quantization,T=b.range;e._quantizedVolumeScale=d.fromElements(T,T,T),e._quantizedVolumeOffset=d.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let _=n.styleableProperties,m=i.batchTableProperties;for(let b in m)if(m.hasOwnProperty(b)){let T=r[b];l(_)||(_={}),_[b]={typedArray:T.array,componentCount:T.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=_}).catch(function(r){e._decodingState=Mb.FAILED,e._error=r}))}return!0}var hxt=new oe,mxt=new d;_P.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(dxt(this,t))return;let i=!1,o=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(cxt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){F.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,u),l(this._rtcCenter)&&F.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&F.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==ne.SCENE3D){let h=e.mapProjection,p=F.getColumn(u,3,hxt);oe.equals(p,oe.UNIT_W)||Ot.basisTo2D(h,u,u)}let f=this._drawCommand.boundingVolume;if(ae.clone(this._boundingSphere,f),this._cull){let h=f.center;F.multiplyByPoint(u,h,h);let p=F.getScale(u,mxt);f.radius*=d.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==Gr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&fxt(this,e,this._style),this._drawCommand.castShadows=xn.castShadows(this.shadows),this._drawCommand.receiveShadows=xn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?we.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};_P.prototype.isDestroyed=function(){return!1};_P.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var EH=_P;function Nb(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.shadows=y(e.shadows,xn.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new wp(e.shading),this.style=e.style,this.frameFailed=new pe,this.frameChanged=new pe,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new R_,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(Nb.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function pxt(e){return`uniform vec4 czm_pickColor; +${e}`}function gxt(e){return function(t){return xt(t,{czm_pickColor:function(){return e._pickId.color}})}}function _xt(){return"czm_pickColor"}Nb.prototype.makeStyleDirty=function(){this._styleDirty=!0};Nb.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var yxt=new Z;function IK(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function Lb(e,t){return e._intervals.indexOf(t.start)}function xxt(e,t){let n=e._intervals,i=e._clock,o=IK(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Z.addSeconds(i.currentTime,r*o,yxt),a=n.indexOf(s),c=Lb(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function bxt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function Txt(e,t,n){let i=IK(e),o=Lb(e,t),r=Lb(e,n);return i>=0?o>=r:o<=r}function Cbe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function Cxt(e,t,n){let i=Lb(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?F.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ai(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Se.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new EH({arrayBuffer:u,cull:!0,fragmentShaderLoaded:pxt,uniformMapLoaded:gxt(e),pickIdLoaded:_xt})}).catch(Cbe(e,c))}return r}function Axt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function Ext(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(Abe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ai()-t.timestamp)/1e3;Axt(e,a)}}t.touchedFrameNumber=i.frameNumber}var Sxt=new F;function vxt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function wxt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var Dxt=new wp;function Abe(e,t,n,i){let o=y(e.shading,Dxt),r=t.pointCloud,s=y(t.transform,F.IDENTITY);r.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,Sxt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=vxt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=wxt(e);try{r.update(i)}catch(a){Cbe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function DK(e,t,n,i){let o=Cxt(e,t,i);Ext(e,o,n,i)}function Ixt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function Ebe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function Pxt(e,t){let n=Lb(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function Tbe(e,t,n,i,o){return l(n)?n.ready?!0:(DK(e,t,i,o),n.ready):!1}function Rxt(e,t,n,i,o){let r,s,a,c=e._intervals,u=e._frames,f=Lb(e,n),h=Lb(e,t);if(f>=h){for(r=f;r>=h;--r)if(s=c.get(r),a=u[r],Tbe(e,s,a,i,o))return s}else for(r=f;r<=h;++r)if(s=c.get(r),a=u[r],Tbe(e,s,a,i,o))return s;return t}function Oxt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var oS={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};Nb.prototype.update=function(e){if(e.mode===ne.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=Z.clone(e.time));let t=Math.max(Z.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&Oxt(this,o,s),oS.timeSinceLoad=t,oS.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,h=this._previousInterval,p=this._nextInterval,_=bxt(this);if(!l(_))return;let m=!1,x=IK(this),b=x===0;x!==this._clockMultiplier&&(m=!0,this._clockMultiplier=x),(!l(h)||b)&&(h=_),(!l(p)||m||Txt(this,_,p))&&(p=xxt(this,_)),h=Rxt(this,h,_,oS,e);let T=Pxt(this,h);l(T)||(DK(this,h,oS,e),T=this._lastRenderedFrame),l(T)&&Abe(this,T,oS,e),l(p)&&DK(this,p,oS,e);let C=this;l(T)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(T)&&T!==this._lastRenderedFrame&&C.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return C.frameChanged.raiseEvent(C),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=T;let A=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;A>S&&Ebe(this,Ixt(e));let D=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&D>0&&c.update(e,f,a,this.boundingSphere)};Nb.prototype.isDestroyed=function(){return!1};Nb.prototype.destroy=function(){return Ebe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var yP=Nb;function Sbe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function Mxt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function vbe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function wbe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=vbe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function Dbe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Ao(e,t){e=Rn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=zt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=zt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Rn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Rn(t.creditViewport):n,f=y(t.showRenderLoopErrors,!0),h=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=h,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new pe,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new um,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),wbe(this);try{let p=y(t.ellipsoid,ee.default),_=new uH({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=_,_.camera.constrainedAxis=d.UNIT_Z,vbe(this),Dbe(this);let m=t.globe;l(m)||(m=new UU(p)),m!==!1&&(_.globe=m,_.globe.shadows=y(t.terrainShadows,xn.RECEIVE_ONLY));let x=t.skyBox;!l(x)&&ee.WGS84.equals(p)&&(x=gH.createEarthSkyBox()),x!==!1&&(_.skyBox=x,_.sun=new bH,ee.WGS84.equals(p)&&(_.moon=new XU));let b=t.skyAtmosphere;!l(b)&&ee.WGS84.equals(p)&&(b=new hH(p),b.show=t.globe!==!1&&m.show),b!==!1&&(_.skyAtmosphere=b);let T=t.baseLayer;t.globe!==!1&&T!==!1&&(l(T)||(T=uc.fromWorldImagery()),_.imageryLayers.add(T)),l(t.terrainProvider)&&t.globe!==!1&&(_.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&_.setTerrain(t.terrain),this._screenSpaceEventHandler=new $f(i),l(t.sceneMode)&&(t.sceneMode===ne.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ne.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let C=this;this._onRenderError=function(R,M){C._useDefaultRenderLoop=!1,C._renderLoopRunning=!1,C._showRenderLoopErrors&&C.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,M)},_.renderError.addEventListener(this._onRenderError);let A=t.dataSources,S=!1;l(A)||(A=new P3,S=!0);let v=new yk({scene:_,dataSourceCollection:A}),D=new _r;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=A,this._destroyDataSourceCollection=S,this._dataSourceDisplay=v,this._eventHelper=D,this._canAnimateUpdateCallback=this._updateCanAnimate,D.add(this._clock.onTick,Ao.prototype._onTick,this),D.add(_.morphStart,Ao.prototype._clearTrackedObject,this),D.add(A.dataSourceAdded,Ao.prototype._onDataSourceAdded,this),D.add(A.dataSourceRemoved,Ao.prototype._onDataSourceRemoved,this),D.add(_.postRender,Ao.prototype._postRender,this);let O=A.length;for(let R=0;R<O;R++)this._dataSourceAdded(A,A.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),D.add(A.dataSourceAdded,Ao.prototype._dataSourceAdded,this),D.add(A.dataSourceRemoved,Ao.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Ao.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&Mxt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,PK(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ne.COLUMBUS_VIEW||n===ne.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ne.COLUMBUS_VIEW||n===ne.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(F.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,Sbe(this.clock,e))}}});Ao.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let _=document.createElement("div");if(_.className="cesium-widget-errorPanel-message",a.appendChild(_),f){let m=fg(n);u||(typeof n=="string"&&(n=new Error(n)),t=fg({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} ${t} -${m}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),x.appendChild(b),x.onclick=function(T){x.removeChild(b),x.appendChild(document.createTextNode(m)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}_.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Ao.prototype.isDestroyed=function(){return!1};Ao.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Ao.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,Sbe(this),vbe(this),this._scene.requestRender())};Ao.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Ao.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ao.prototype._onEntityCollectionChanged,this)};Ao.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ao.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Ao.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var nS=new ae;Ao.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!0,nS)===ct.DONE&&i.update(t,nS)}};Ao.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};Ao.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ao.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Abe(this.clock,e)};Ao.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ao.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ao.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Ao.prototype.zoomTo=function(e,t){return wbe(this,e,{offset:t},!1)};Ao.prototype.flyTo=function(e,t){return wbe(this,e,t,!0)};function wbe(e,t,n,i){IK(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof lc){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return yE(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof Cs||r instanceof mP||r instanceof Rb){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function pP(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function IK(e){let t=e._zoomPromise;l(t)&&(pP(e),e._completeZoom(!1))}Ao.prototype._postRender=function(){Pxt(this),Rxt(this)};function Pxt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){l(o.offset)||(o.offset=new Kd(0,-.5,f.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),pP(e)}if(t instanceof mP){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),f()});return}if(t instanceof Cs||t instanceof Rb){s(t.boundingSphere);return}if(t instanceof fe){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),pP(e);return}let a=t,c=[];for(let f=0,h=a.length;f<h;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,nS);if(p===ct.PENDING)return;p!==ct.FAILED&&c.push(ae.clone(nS))}if(c.length===0){IK(e);return}e.trackedEntity=void 0;let u=ae.fromBoundingSpheres(c);e._zoomIsFlight?(pP(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(F.IDENTITY),pP(e),e._completeZoom(!0))}function Rxt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=q.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,nS);if(r===ct.PENDING)return;let s=o.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ct.FAILED?nS:void 0;e._entityView=new Uk(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var IH=Ao;function rS(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Fb=new se;function Oxt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}rS.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let _=t;_<=i;++_)Oxt(e,_,p,s)||s.push(new iS(r,void 0,0,_,p));r.tileXYToRectangle(t,n,e,Fb);let a=Fb.west,c=Fb.north;r.tileXYToRectangle(i,o,e,Fb);let u=Fb.east,f=Fb.south,h=new Bxt(e,a,f,u,c);for(let p=0;p<s.length;++p){let _=s[p];PK(_.extent,h)&&kxt(this._maximumLevel,_,h)}};rS.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(oS(i.extent,e)){t=i;break}}return l(t)?gP(void 0,t,e):-1};var Mxt=[],Lxt=[],Nxt=new se,Fxt=new se;rS.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Mxt;t.length=0,e.east<e.west?(t.push(se.fromRadians(-Math.PI,e.south,e.east,e.north,Nxt)),t.push(se.fromRadians(e.west,e.south,Math.PI,e.north,Fxt))):t.push(e);let n=Lxt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)_P(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var Dbe=new fe;rS.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Fb);return se.center(i,Dbe),this.computeMaximumLevelAtPosition(Dbe)>=e};rS.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function iS(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(iS.prototype,{nw:{get:function(){return this._nw||(this._nw=new iS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new iS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new iS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new iS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Bxt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function PK(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function kxt(e,t,n){for(;t.level<e;)if(PH(t.nw.extent,n))t=t.nw;else if(PH(t.ne.extent,n))t=t.ne;else if(PH(t.sw.extent,n))t=t.sw;else if(PH(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Oo(t.rectangles,n.level,Vxt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Vxt(e,t){return e.level-t}function PH(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function oS(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function gP(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&oS(t._nw.extent,n),s=t._ne&&oS(t._ne.extent,n),a=t._sw&&oS(t._sw.extent,n),c=t._se&&oS(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,gP(t,t._nw,n))),s&&(i=Math.max(i,gP(t,t._ne,n))),a&&(i=Math.max(i,gP(t,t._sw,n))),c&&(i=Math.max(i,gP(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];oS(a,n)&&(i=a.level)}t=t.parent}return i}function _P(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||PK(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=Uxt(e[s.level],s)}_P(e,t._nw,n),_P(e,t._ne,n),_P(e,t._sw,n),_P(e,t._se,n)}function Uxt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];PK(o,t)?(o.west<t.west&&n.push(new se(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new se(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new se(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new se(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Wm=rS;var zxt=15;function Ibe(e){this.ellipsoid=y(e.ellipsoid,ee.default),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}Ibe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function Hxt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new At(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=se.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Xi(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new U(r.xmin,r.ymin),s.rectangleNortheastInMeters=new U(r.xmax,r.ymax),e.tilingScheme=new us(s)}else throw new re("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new re("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?nh.LERC:nh.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Wm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Wm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Gxt(e,t,n){try{let i=await t.fetchJson();Hxt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function r0(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new me}Object.defineProperties(r0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});r0.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Se.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new Ibe(t);await Gxt(o,i);let r=new r0(t);return o.build(r),r._resource=n,r};r0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(RK(this,n+1,e*2,t*2))){let h=Pbe(this,n+1,e*2,t*2);s=h.promise,a=h.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(h){return new ac({buffer:h[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):zxt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(h){if(l(a)&&a.state===Kn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Kn.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function RK(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}r0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};r0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=RK(this,n,e,t);if(l(i))return i;Pbe(this,n,e,t)};r0.prototype.loadTileDataAvailability=function(e,t,n){};function Wxt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new U(e.x+1,e.y+1),f=!1,h=!1;for(;!(f&&h);){let p=u.x,_=h?u.y+1:u.y;if(!f){for(let m=e.y;m<_;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new U(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!h){let m=u.y*t;for(let x=e.x;x<=p;++x)if(i[m+x]!==s){h=!0;break}h?(a.push(new U(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,h=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function jxt(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new U(0,0)];for(;a.length>0;){let c=a.pop(),u=Wxt(c,n,i,o);if(u.value===1){let h=u.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function Pbe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new nr({throttle:!1,throttleByServer:!0,type:ps.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(h)?(h=h.then(function(p){let _=jxt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let m=e._tilesAvailable;for(let x=0;x<_.length;++x){let b=_[x];m.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return RK(e,t,n,i)}),c[a]={promise:h,request:u},h=h.finally(function(p){return delete c[a],p}),{promise:h,request:u}):{}}var Rbe=r0;var Obe="https://dev.virtualearth.net/REST/v1/Locations";function OK(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Se({url:Obe,queryParameters:n}),this._credit=new At('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(OK.prototype,{url:{get:function(){return Obe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});OK.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:se.fromDegrees(a,s,u,c)}})})};var Mbe=OK;function MK(){}Object.defineProperties(MK.prototype,{credit:{get:function(){}}});MK.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:d.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var Lbe=MK;var qxt=new oe,Nbe=new d,sS=new d;function Yxt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new d);let u=(a-i)*o;return d.lerp(r,s,u,c)}}return function(i,o){l(o)||(o=new d);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=qxt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,h,p;return r===0?(c=t[0],u=t[1],f=e.firstTangent,h=d.subtract(t[2],c,Nbe),d.multiplyByScalar(h,.5,h),p=F.multiplyByVector(_x.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],u=t[r+1],h=e.lastTangent,f=d.subtract(u,t[r-1],Nbe),d.multiplyByScalar(f,.5,f),p=F.multiplyByVector(_x.hermiteCoefficientMatrix,a,a)):(c=t[r-1],u=t[r],f=t[r+1],h=t[r+2],p=F.multiplyByVector(s0.catmullRomCoefficientMatrix,a,a)),o=d.multiplyByScalar(c,p.x,o),d.multiplyByScalar(u,p.y,sS),d.add(o,sS,o),d.multiplyByScalar(f,p.z,sS),d.add(o,sS,o),d.multiplyByScalar(h,p.w,sS),d.add(o,sS,o)}}var Xxt=new d,Kxt=new d;function s0(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=Xxt,d.multiplyByScalar(t[1],2,i),d.subtract(i,t[2],i),d.subtract(i,t[0],i),d.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=Kxt,d.multiplyByScalar(t[r-1],2,o),d.subtract(t[r],o,o),d.add(o,t[r-2],o),d.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=d.clone(i),this._lastTangent=d.clone(o),this._evaluateFunction=Yxt(this),this._lastTimeIndex=0}Object.defineProperties(s0.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});s0.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);s0.prototype.findTimeInterval=no.prototype.findTimeInterval;s0.prototype.wrapTime=no.prototype.wrapTime;s0.prototype.clampTime=no.prototype.clampTime;s0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Fbe=s0;var RH={};RH.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let u=s+a+c,f,h,p,_,m,x;return u===1?s?(f=(e-n)/(i-n),h=(e-n)/(o-n),r.push(1),r.push(2),h!==1&&(r.push(-1),r.push(0),r.push(2),r.push(h)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):a?(p=(e-i)/(o-i),_=(e-i)/(n-i),r.push(2),r.push(0),_!==1&&(r.push(-1),r.push(1),r.push(0),r.push(_)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(m=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!s&&n!==e?(_=(e-i)/(n-i),m=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(_),r.push(-1),r.push(2),r.push(0),r.push(m)):!a&&i!==e?(x=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(f)):!c&&o!==e&&(h=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(h),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};RH.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let u=n-s,f=s-o,h=r-a,p=i-a,_=1/(h*u+f*p),m=t-a,x=e-s,b=(h*x+f*m)*_,T=(-p*x+u*m)*_,C=1-b-T;return l(c)?(c.x=b,c.y=T,c.z=C,c):new d(b,T,C)};RH.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=u/h,_=f/h;if(p>=0&&p<=1&&_>=0&&_<=1)return l(c)||(c=new U),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var a0=RH;function c0(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=MH(e.westIndices,o,t),this._southIndices=MH(e.southIndices,r,t),this._eastIndices=MH(e.eastIndices,o,t),this._northIndices=MH(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(c0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var OH=[];function MH(e,t,n){OH.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)OH[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(OH.sort(t),Ne.createTypedArray(n,OH)):e}var Bbe="createVerticesFromQuantizedTerrainMesh",Zxt=new _i(Bbe),$xt=new _i(Bbe,Rm.maximumAsynchronousTasks);c0.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),h=(a?$xt:Zxt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(h))return;let p=this;return Promise.resolve(h).then(function(_){let m=p._quantizedVertices.length/3,x=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Ne.createTypedArray(x,_.indices),T=new Float32Array(_.vertices),C=_.center,A=_.minimumHeight,S=_.maximumHeight,v=p._boundingSphere,D=p._orientedBoundingBox,O=y(d.clone(_.occludeePointInScaledSpace),p._horizonOcclusionPoint),R=_.vertexStride,M=Kc.clone(_.encoding);return p._mesh=new ih(C,T,b,_.indexCountWithoutSkirts,m,A,S,v,O,R,D,M,_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var Qxt=new _i("upsampleQuantizedTerrainMesh",Rm.maximumAsynchronousTasks);c0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=Qxt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:h,ellipsoid:f});if(!l(p))return;let _=Math.min(this._westSkirtHeight,this._eastSkirtHeight);_=Math.min(_,this._southSkirtHeight),_=Math.min(_,this._northSkirtHeight);let m=c?_*.5:this._westSkirtHeight,x=u?_*.5:this._southSkirtHeight,b=c?this._eastSkirtHeight:_*.5,T=u?this._northSkirtHeight:_*.5,C=this._credits;return Promise.resolve(p).then(function(A){let S=new Uint16Array(A.vertices),v=Ne.createTypedArray(S.length/3,A.indices),D;return l(A.encodedNormals)&&(D=new Uint8Array(A.encodedNormals)),new c0({quantizedVertices:S,indices:v,encodedNormals:D,minimumHeight:A.minimumHeight,maximumHeight:A.maximumHeight,boundingSphere:ae.clone(A.boundingSphere),orientedBoundingBox:wn.clone(A.orientedBoundingBox),horizonOcclusionPoint:d.clone(A.horizonOcclusionPoint),westIndices:A.westIndices,southIndices:A.southIndices,eastIndices:A.eastIndices,northIndices:A.northIndices,westSkirtHeight:m,southSkirtHeight:x,eastSkirtHeight:b,northSkirtHeight:T,childTileMask:0,credits:C,createdByUpsampling:!0})})};var LK=32767,kbe=new d;c0.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=LK;let o=P.clamp((n-e.south)/e.height,0,1);return o*=LK,l(this._mesh)?nbt(this,i,o):ibt(this,i,o)};function Vbe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),h=Math.max(i,r,a);return e>=c&&e<=u&&t>=f&&t<=h}var Jxt=new U,ebt=new U,tbt=new U;function nbt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,Jxt),_=r.decodeTextureCoordinates(o,f,ebt),m=r.decodeTextureCoordinates(o,h,tbt);if(Vbe(t,n,p.x,p.y,_.x,_.y,m.x,m.y)){let x=a0.computeBarycentricCoordinates(t,n,p.x,p.y,_.x,_.y,m.x,m.y,kbe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),T=r.decodeHeight(o,f),C=r.decodeHeight(o,h);return x.x*b+x.y*T+x.z*C}}}}function ibt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=i[u],_=i[f],m=i[h],x=o[u],b=o[f],T=o[h];if(Vbe(t,n,p,x,_,b,m,T)){let C=a0.computeBarycentricCoordinates(t,n,p,x,_,b,m,T,kbe);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){let A=C.x*r[u]+C.y*r[f]+C.z*r[h];return P.lerp(e._minimumHeight,e._maximumHeight,A/LK)}}}}c0.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};c0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var aS=c0;function obt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function zbe(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=y(e.ellipsoid,ee.default),this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}zbe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function Hbe(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new us({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}if(e.levelZeroMaximumGeometricError=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,_;if(l(p)&&!l(h)){_=new Wm(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let b=p[x],T=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let C=0;C<b.length;++C){let A=b[C],S=T-A.endY-1,v=T-A.startY-1;e.overallAvailability[x].push([A.startX,S,A.endX,v]),_.addAvailableTileRange(x,A.startX,S,A.endX,v)}}}else l(h)&&(f=new Wm(e.tilingScheme,u),_=new Wm(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],_.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new obt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:_,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(_)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await BK(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function rbt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=Io.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return BK(e,n);throw new re(i)}async function sbt(e,t,n){await Hbe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Wm(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new At(e.attribution);e.tileCredits.push(o)}return!0}async function BK(e,t){try{let n=await e.layerJsonResource.fetchJson();return sbt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await Hbe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):rbt(e,n,t)}}function hh(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new me;let t=e.credit;typeof t=="string"&&(t=new At(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var NK={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Ube(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function abt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new ac({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function cbt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,h=Float64Array.BYTES_PER_ELEMENT*u,_=Uint16Array.BYTES_PER_ELEMENT*3,m=3,x=Uint16Array.BYTES_PER_ELEMENT,b=x*m,T=new DataView(t),C=new d(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0));a+=f;let A=T.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=T.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ae(new d(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0)),T.getFloat64(a+f,!0));a+=h;let D=new d(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0));a+=f;let O=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,O*3);a+=O*_,O>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,b=x*m);let M=R.subarray(0,O),L=R.subarray(O,2*O),g=R.subarray(O*2,3*O);Ln.zigZagDeltaDecode(M,L,g),a%x!==0&&(a+=x-a%x);let E=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=Ne.createTypedArrayFromArrayBuffer(O,t,a,E*m);a+=E*b;let I=0,N=w.length;for(let ce=0;ce<N;++ce){let ge=w[ce];w[ce]=I-ge,ge===0&&++I}let B=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Ne.createTypedArrayFromArrayBuffer(O,t,a,B);a+=B*x;let V=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Ne.createTypedArrayFromArrayBuffer(O,t,a,V);a+=V*x;let k=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let W=Ne.createTypedArrayFromArrayBuffer(O,t,a,k);a+=k*x;let Y=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=Ne.createTypedArrayFromArrayBuffer(O,t,a,Y);a+=Y*x;let j,K;for(;a<T.byteLength;){let ce=T.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ge=T.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ce===NK.OCT_VERTEX_NORMALS&&e._requestVertexNormals)j=new Uint8Array(t,a,O*2);else if(ce===NK.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,a,ge);else if(ce===NK.METADATA&&e._requestMetadata){let xe=T.getUint32(a,!0);if(xe>0){let Ae=Fo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,xe).available;if(l(Ae))for(let ke=0;ke<Ae.length;++ke){let ze=n+ke+1,et=Ae[ke],St=e._tilingScheme.getNumberOfYTilesAtLevel(ze);for(let mt=0;mt<et.length;++mt){let Be=et[mt],Yt=St-Be.endY-1,Ct=St-Be.startY-1;e.availability.addAvailableTileRange(ze,Be.startX,Yt,Be.endX,Ct),r.availability.addAvailableTileRange(ze,Be.startX,Yt,Be.endX,Ct)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ge}let Q=e.getLevelMaximumGeometricError(n)*5,de=e._tilingScheme.tileXYToRectangle(i,o,n),ye=wn.fromRectangle(de,A,S,e._tilingScheme.ellipsoid);return new aS({center:C,minimumHeight:A,maximumHeight:S,boundingSphere:v,orientedBoundingBox:ye,horizonOcclusionPoint:D,quantizedVertices:R,encodedNormals:j,indices:w,westIndices:H,southIndices:G,eastIndices:W,northIndices:J,westSkirtHeight:Q,southSkirtHeight:Q,eastSkirtHeight:Q,northSkirtHeight:Q,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:K,credits:e._tileCredits})}hh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let h=kK(this,e,t,n,f,u===0);h.result&&(a=!0,c=c.then(()=>h.promise))}return!l(r)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):Gbe(this,e,t,n,r,i)};function Gbe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new re("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let u,f,h=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=Ube(void 0)):u=Ube(c);let _=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(_))return _.then(function(m){return l(m)?l(e._heightmapStructure)?abt(e,m,i,t,n):cbt(e,m,i,t,n,o):Promise.reject(new re("Mesh buffer doesn't exist."))})}Object.defineProperties(hh.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});hh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};hh.fromIonAssetId=async function(e,t){let n=await af.fromAssetId(e);return hh.fromUrl(n,t)};hh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Se.createIfNeeded(e);n.appendForwardSlash();let i=new zbe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await BK(i);let o=new hh(t);return i.build(o),o};hh.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(kK(this,e,t,n,i[r],r===0).result)return;return!1};hh.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=kK(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function FK(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function kK(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,u=o.availability,f=FK(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let h;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,h=o.availabilityPromiseCache[s],!l(h))){let p=new nr({throttle:!1,throttleByServer:!0,type:ps.TERRAIN});h=Gbe(e,f.x,f.y,f.level,o,p),l(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}f=FK(o,f.x,f.y,f.level)}return{result:!1}}hh._getAvailabilityTile=FK;var cS=hh;function vg(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new wl(n),this._workerName="createCircleGeometry"}vg.packedLength=wl.packedLength;vg.pack=function(e,t,n){return wl.pack(e._ellipseGeometry,t,n)};var Wbe=new wl({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Ra={center:new d,radius:void 0,ellipsoid:ee.clone(ee.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Ie,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};vg.unpack=function(e,t,n){let i=wl.unpack(e,t,Wbe);return Ra.center=d.clone(i._center,Ra.center),Ra.ellipsoid=ee.clone(i._ellipsoid,Ra.ellipsoid),Ra.ellipsoid=ee.clone(i._ellipsoid,Wbe._ellipsoid),Ra.height=i._height,Ra.extrudedHeight=i._extrudedHeight,Ra.granularity=i._granularity,Ra.vertexFormat=Ie.clone(i._vertexFormat,Ra.vertexFormat),Ra.stRotation=i._stRotation,Ra.shadowVolume=i._shadowVolume,l(n)?(Ra.semiMajorAxis=i._semiMajorAxis,Ra.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new wl(Ra),n):(Ra.radius=i._semiMajorAxis,new vg(Ra))};vg.createGeometry=function(e){return wl.createGeometry(e._ellipseGeometry)};vg.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new vg({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(vg.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var jbe=vg;function lS(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new kf(n),this._workerName="createCircleOutlineGeometry"}lS.packedLength=kf.packedLength;lS.pack=function(e,t,n){return kf.pack(e._ellipseGeometry,t,n)};var lbt=new kf({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Nu={center:new d,radius:void 0,ellipsoid:ee.clone(ee.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};lS.unpack=function(e,t,n){let i=kf.unpack(e,t,lbt);return Nu.center=d.clone(i._center,Nu.center),Nu.ellipsoid=ee.clone(i._ellipsoid,Nu.ellipsoid),Nu.height=i._height,Nu.extrudedHeight=i._extrudedHeight,Nu.granularity=i._granularity,Nu.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Nu.semiMajorAxis=i._semiMajorAxis,Nu.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new kf(Nu),n):(Nu.radius=i._semiMajorAxis,new lS(Nu))};lS.createGeometry=function(e){return kf.createGeometry(e._ellipseGeometry)};var qbe=lS;function uS(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Xi({ellipsoid:y(e.ellipsoid,ee.default)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new me;let n=e.credit;typeof n=="string"&&(n=new At(n)),this._credit=n}Object.defineProperties(uS.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});uS.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new ac({buffer:c,width:r,height:s})})};uS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};uS.prototype.getTileDataAvailable=function(e,t,n){};uS.prototype.loadTileDataAvailability=function(e,t,n){};var Ybe=uS;function Xbe(e){this.proxy=e}Xbe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var Kbe=Xbe;var ubt={SEARCH:0,AUTOCOMPLETE:1},Bb=Object.freeze(ubt);function LH(){he.throwInstantiationError()}Object.defineProperties(LH.prototype,{credit:{get:he.throwInstantiationError}});LH.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(At.getIonCredit)};LH.prototype.geocode=he.throwInstantiationError;var yP=LH;function Zbe(){he.throwInstantiationError()}Zbe.createGeometry=function(e){he.throwInstantiationError()};var $be=Zbe;var gbt=Ur(VK(),1);function fbt(e,t){return(e&t)!==0}var el=fbt;var dbt=[1,2,4,8],Qbe=15,hbt=16,mbt=64,pbt=128;function jm(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}jm.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new jm(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};jm.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};jm.prototype.hasSubtree=function(){return el(this._bits,hbt)};jm.prototype.hasImagery=function(){return el(this._bits,mbt)};jm.prototype.hasTerrain=function(){return el(this._bits,pbt)};jm.prototype.hasChildren=function(){return el(this._bits,Qbe)};jm.prototype.hasChild=function(e){return el(this._bits,dbt[e])};jm.prototype.getChildBitmask=function(){return this._bits&Qbe};var NH=jm;function _bt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var ybt=_bt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y +${m}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),x.appendChild(b),x.onclick=function(T){x.removeChild(b),x.appendChild(document.createTextNode(m)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}_.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Ao.prototype.isDestroyed=function(){return!1};Ao.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Ao.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,wbe(this),Dbe(this),this._scene.requestRender())};Ao.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Ao.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ao.prototype._onEntityCollectionChanged,this)};Ao.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ao.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Ao.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var rS=new ae;Ao.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!0,rS)===at.DONE&&i.update(t,rS)}};Ao.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};Ao.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ao.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Sbe(this.clock,e)};Ao.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ao.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ao.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Ao.prototype.zoomTo=function(e,t){return Ibe(this,e,{offset:t},!1)};Ao.prototype.flyTo=function(e,t){return Ibe(this,e,t,!0)};function Ibe(e,t,n,i){PK(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof uc){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return TE(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof Cs||r instanceof yP||r instanceof Rb){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function xP(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function PK(e){let t=e._zoomPromise;l(t)&&(xP(e),e._completeZoom(!1))}Ao.prototype._postRender=function(){Lxt(this),Nxt(this)};function Lxt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ne.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){l(o.offset)||(o.offset=new Kd(0,-.5,f.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),xP(e)}if(t instanceof yP){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),f()});return}if(t instanceof Cs||t instanceof Rb){s(t.boundingSphere);return}if(t instanceof fe){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),xP(e);return}let a=t,c=[];for(let f=0,h=a.length;f<h;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,rS);if(p===at.PENDING)return;p!==at.FAILED&&c.push(ae.clone(rS))}if(c.length===0){PK(e);return}e.trackedEntity=void 0;let u=ae.fromBoundingSpheres(c);e._zoomIsFlight?(xP(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(F.IDENTITY),xP(e),e._completeZoom(!0))}function Nxt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=q.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,rS);if(r===at.PENDING)return;let s=o.mode;(s===ne.COLUMBUS_VIEW||s===ne.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===ne.COLUMBUS_VIEW||s===ne.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==at.FAILED?rS:void 0;e._entityView=new Tk(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var SH=Ao;var vH=`uniform sampler2D u_noiseTexture; +uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +in vec2 v_offset; +in vec3 v_maximumSize; +in vec4 v_color; +in float v_slice; +in float v_brightness; + +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); + } + return mod(value, rangeLength); +} + +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); +} + +vec2 voxelToUV(vec3 voxelIndex) { + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + + float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; + vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, + inverseNoiseTextureRows / textureSliceWidth); + vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); + float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); + float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); + + float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; + float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; + return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; +} + +// Interpolate a voxel with its neighbor (along the positive X-axis) +vec4 lerpSamplesX(vec3 voxelIndex, float x) { + vec2 uv0 = voxelToUV(voxelIndex); + vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); + vec4 sample0 = texture(u_noiseTexture, uv0); + vec4 sample1 = texture(u_noiseTexture, uv1); + return mix(sample0, sample1, x); +} + +vec4 sampleNoiseTexture(vec3 position) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); + vec3 lerpValue = fract(recenteredPos); + vec3 voxelIndex = floor(recenteredPos); + + vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); + vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); + vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); + vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); + + vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); + vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); + return mix(yLerp0, yLerp1, lerpValue.z); +} + +// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). +bool intersectSphere(vec3 origin, vec3 dir, float slice, + out vec3 point, out vec3 normal) { + float A = dot(dir, dir); + float B = dot(origin, dir); + float C = dot(origin, origin) - 0.25; + float discriminant = (B * B) - (A * C); + if(discriminant < 0.0) { + return false; + } + float root = sqrt(discriminant); + float t = (-B - root) / A; + if(t < 0.0) { + t = (-B + root) / A; + } + point = origin + t * dir; + + if(slice >= 0.0) { + point.z = (slice / 2.0) - 0.5; + if(length(point) > 0.5) { + return false; + } + } + + normal = normalize(point); + point -= czm_epsilon2 * normal; + return true; +} + +// Transforms the ray origin and direction into unit sphere space, +// then transforms the result back into the ellipsoid's space. +bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, + out vec3 point, out vec3 normal) { + if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { + return false; + } + + vec3 o = (origin - center) / scale; + vec3 d = dir / scale; + vec3 p, n; + bool intersected = intersectSphere(o, d, slice, p, n); + if(intersected) { + point = (p * scale) + center; + normal = n; + } + return intersected; +} + +// Assume that if phase shift is being called for octave i, +// the frequency is of i - 1. This saves us from doing extra +// division / multiplication operations. +vec2 phaseShift2D(vec2 p, vec2 freq) { + return (czm_pi / 2.0) * sin(freq.yx * p.yx); +} + +vec2 phaseShift3D(vec3 p, vec2 freq) { + return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); +} + +// The cloud texture function derived from Gardner's 1985 paper, +// "Visual Simulation of Clouds." +// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf +const float T0 = 0.6; // contrast of the texture pattern +const float k = 0.1; // computed to produce a maximum value of 1 +const float C0 = 0.8; // coefficient +const float FX0 = 0.6; // frequency X +const float FY0 = 0.6; // frequency Y +const int octaves = 5; + +float T(vec3 point) { + vec2 sum = vec2(0.0); + float Ci = C0; + vec2 FXY = vec2(FX0, FY0); + vec2 PXY = vec2(0.0); + for(int i = 1; i <= octaves; i++) { + PXY = phaseShift3D(point, FXY); + Ci *= 0.707; + FXY *= 2.0; + vec2 sinTerm = sin(FXY * point.xy + PXY); + sum += Ci * sinTerm + vec2(T0); + } + return k * sum.x * sum.y; +} + +const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, +const float t = 0.4; // fraction of texture shading +const float s = 0.25; // fraction of specular reflection + +float I(float Id, float Is, float It) { + return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; +} + +const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); + +vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, + float brightness) { + vec3 cloudPoint, cloudNormal; + if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, + cloudPoint, cloudNormal)) { + return vec4(0.0); + } + + float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection + float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection + float It = T(cloudPoint); // texture function + float intensity = I(Id, Is, It); + vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); + + vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); + float W = noise.x; + float W2 = noise.y; + float W3 = noise.z; + + // The dot product between the cloud's normal and the ray's direction is greatest + // in the center of the ellipsoid's surface. It decreases towards the edge. + // Thus, it is used to blur the areas leading to the edges of the ellipsoid, + // so that no harsh lines appear. + + // The first (and biggest) layer of worley noise is then subtracted from this. + // The final result is scaled up so that the base cloud is not too translucent. + float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); + float TR = pow(ndDot, 3.0) - W; // translucency + TR *= 1.3; + + // Subtracting the second and third layers of worley noise is more complicated. + // If these layers of noise were simply subtracted from the current translucency, + // the shape derived from the first layer of noise would be completely deleted. + // The erosion of this noise should thus be constricted to the edges of the cloud. + // However, because the edges of the ellipsoid were already blurred away, mapping + // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. + // The value of (0.5 - ndDot) provides the best compromise. + float minusDot = 0.5 - ndDot; + + // Even with the previous calculation, subtracting the second layer of wnoise + // erode too much of the cloud. The addition of it, however, will detailed + // volume to the cloud. As long as the noise is only added and not subtracted, + // the results are aesthetically pleasing. + + // The minusDot product is mapped in a way that it is larger at the edges of + // the ellipsoid, so a subtraction and min operation are used instead of + // an addition and max one. + TR -= min(minusDot * W2, 0.0); + + // The third level of worley noise is subtracted from the result, with some + // modifications. First, a scalar is added to minusDot so that the noise + // starts affecting the shape farther away from the center of the ellipsoid's + // surface. Then, it is scaled down so its impact is not too intense. + TR -= 0.8 * (minusDot + 0.25) * W3; + + // The texture function's shading does not correlate with the shape of the cloud + // produced by the layers of noise, so an extra shading scalar is calculated. + // The darkest areas of the cloud are assigned to be where the noise erodes + // the cloud the most. This is then interpolated based on the translucency + // and the diffuse shading term of that point in the cloud. + float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); + + // To avoid values that are too dark, this scalar is increased by a small amount + // and clamped so it never goes to zero. + shading = clamp(shading + 0.2, 0.3, 1.0); + + // Finally, the contrast of the cloud's color is increased. + vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); + return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; +} + +void main() { +#ifdef DEBUG_BILLBOARDS + out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); +#endif + // To avoid calculations with high values, + // we raycast from an arbitrarily smaller space. + vec2 coordinate = v_maximumSize.xy * v_offset; + + vec3 ellipsoidScale = 0.82 * v_maximumSize; + vec3 ellipsoidCenter = vec3(0.0); + + float zOffset = max(ellipsoidScale.z - 10.0, 0.0); + vec3 eye = vec3(0, 0, -10.0 - zOffset); + vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); + vec3 rayOrigin = eye; +#ifdef DEBUG_ELLIPSOIDS + vec3 point, normal; + if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, + point, normal)) { + out_FragColor = v_brightness * v_color; + } +#else +#ifndef DEBUG_BILLBOARDS + vec4 cloud = drawCloud(rayOrigin, rayDir, + ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); + if(cloud.w < 0.01) { + discard; + } + out_FragColor = cloud; +#endif +#endif +} +`;var wH=`#ifdef INSTANCED +in vec2 direction; +#endif +in vec4 positionHighAndScaleX; +in vec4 positionLowAndScaleY; +in vec4 packedAttribute0; +in vec4 packedAttribute1; +in vec4 color; + +out vec2 v_offset; +out vec3 v_maximumSize; +out vec4 v_color; +out float v_slice; +out float v_brightness; + +void main() { + // Unpack attributes. + vec3 positionHigh = positionHighAndScaleX.xyz; + vec3 positionLow = positionLowAndScaleY.xyz; + vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); + + float show = packedAttribute0.x; + float brightness = packedAttribute0.y; + vec2 coordinates = packedAttribute0.wz; + vec3 maximumSize = packedAttribute1.xyz; + float slice = packedAttribute1.w; + +#ifdef INSTANCED + vec2 dir = direction; +#else + vec2 dir = coordinates; +#endif + + vec2 offset = dir - vec2(0.5, 0.5); + vec2 scaledOffset = scale * offset; + vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); + vec4 positionEC = czm_modelViewRelativeToEye * p; + positionEC.xy += scaledOffset; + + positionEC.xyz *= show; + gl_Position = czm_projection * positionEC; + + v_offset = offset; + v_maximumSize = maximumSize; + v_color = color; + v_slice = slice; + v_brightness = brightness; +} +`;var DH=`uniform vec3 u_noiseTextureDimensions; +uniform float u_noiseDetail; +uniform vec3 u_noiseOffset; +in vec2 v_position; + +float wrap(float value, float rangeLength) { + if(value < 0.0) { + float absValue = abs(value); + float modValue = mod(absValue, rangeLength); + return mod(rangeLength - modValue, rangeLength); + } + return mod(value, rangeLength); +} + +vec3 wrapVec(vec3 value, float rangeLength) { + return vec3(wrap(value.x, rangeLength), + wrap(value.y, rangeLength), + wrap(value.z, rangeLength)); +} + +vec3 random3(vec3 p) { + float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); + float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); + return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); +} + +// Frequency corresponds to cell size. +// The higher the frequency, the smaller the cell size. +vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { + float textureSliceWidth = u_noiseTextureDimensions.x; + vec3 cell = centerCell + offset; + cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); + cell += floor(u_noiseOffset / u_noiseDetail); + vec3 p = offset + random3(cell); + return p; +} + +float worleyNoise(vec3 p, float freq) { + vec3 centerCell = floor(p * freq); + vec3 pointInCell = fract(p * freq); + float shortestDistance = 1000.0; + + for(float z = -1.0; z <= 1.0; z++) { + for(float y = -1.0; y <= 1.0; y++) { + for(float x = -1.0; x <= 1.0; x++) { + vec3 offset = vec3(x, y, z); + vec3 point = getWorleyCellPoint(centerCell, offset, freq); + + float distance = length(pointInCell - point); + if(distance < shortestDistance) { + shortestDistance = distance; + } + } + } + } + + return shortestDistance; +} + +const float MAX_FBM_ITERATIONS = 10.0; + +float worleyFBMNoise(vec3 p, float octaves, float scale) { + float noise = 0.0; + float freq = 1.0; + float persistence = 0.625; + for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { + if(i >= octaves) { + break; + } + + noise += worleyNoise(p * scale, freq * scale) * persistence; + persistence *= 0.5; + freq *= 2.0; + } + return noise; +} + +void main() { + float textureSliceWidth = u_noiseTextureDimensions.x; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + float x = mod(v_position.x, textureSliceWidth); + float y = mod(v_position.y, textureSliceWidth); + float sliceRow = floor(v_position.y / textureSliceWidth); + float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; + + vec3 position = vec3(x, y, z); + position /= u_noiseDetail; + float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); + float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); + float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); + out_FragColor = vec4(worley0, worley1, worley2, 1.0); +} +`;var IH=`uniform vec3 u_noiseTextureDimensions; +in vec2 position; + +out vec2 v_position; + +void main() +{ + gl_Position = vec4(position, 0.1, 1.0); + + float textureSliceWidth = u_noiseTextureDimensions.x; + float noiseTextureRows = u_noiseTextureDimensions.y; + float inverseNoiseTextureRows = u_noiseTextureDimensions.z; + vec2 transformedPos = (position * 0.5) + vec2(0.5); + transformedPos *= textureSliceWidth; + transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; + transformedPos.y *= noiseTextureRows; + v_position = transformedPos; +} +`;var PH=` +in vec2 v_textureCoordinates; + +void main() +{ + czm_materialInput materialInput; + + materialInput.s = v_textureCoordinates.s; + materialInput.st = v_textureCoordinates; + materialInput.str = vec3(v_textureCoordinates, 0.0); + materialInput.normalEC = vec3(0.0, 0.0, -1.0); + + czm_material material = czm_getMaterial(materialInput); + + out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +} +`;function cS(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Fb=new se;function Fxt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}cS.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let _=t;_<=i;++_)Fxt(e,_,p,s)||s.push(new sS(r,void 0,0,_,p));r.tileXYToRectangle(t,n,e,Fb);let a=Fb.west,c=Fb.north;r.tileXYToRectangle(i,o,e,Fb);let u=Fb.east,f=Fb.south,h=new zxt(e,a,f,u,c);for(let p=0;p<s.length;++p){let _=s[p];RK(_.extent,h)&&Hxt(this._maximumLevel,_,h)}};cS.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(aS(i.extent,e)){t=i;break}}return l(t)?bP(void 0,t,e):-1};var Bxt=[],kxt=[],Vxt=new se,Uxt=new se;cS.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Bxt;t.length=0,e.east<e.west?(t.push(se.fromRadians(-Math.PI,e.south,e.east,e.north,Vxt)),t.push(se.fromRadians(e.west,e.south,Math.PI,e.north,Uxt))):t.push(e);let n=kxt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)TP(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var Pbe=new fe;cS.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Fb);return se.center(i,Pbe),this.computeMaximumLevelAtPosition(Pbe)>=e};cS.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function sS(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(sS.prototype,{nw:{get:function(){return this._nw||(this._nw=new sS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new sS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new sS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new sS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function zxt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function RK(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function Hxt(e,t,n){for(;t.level<e;)if(RH(t.nw.extent,n))t=t.nw;else if(RH(t.ne.extent,n))t=t.ne;else if(RH(t.sw.extent,n))t=t.sw;else if(RH(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Mo(t.rectangles,n.level,Gxt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Gxt(e,t){return e.level-t}function RH(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function aS(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function bP(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&aS(t._nw.extent,n),s=t._ne&&aS(t._ne.extent,n),a=t._sw&&aS(t._sw.extent,n),c=t._se&&aS(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,bP(t,t._nw,n))),s&&(i=Math.max(i,bP(t,t._ne,n))),a&&(i=Math.max(i,bP(t,t._sw,n))),c&&(i=Math.max(i,bP(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];aS(a,n)&&(i=a.level)}t=t.parent}return i}function TP(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||RK(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=Wxt(e[s.level],s)}TP(e,t._nw,n),TP(e,t._ne,n),TP(e,t._sw,n),TP(e,t._se,n)}function Wxt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];RK(o,t)?(o.west<t.west&&n.push(new se(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new se(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new se(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new se(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var jm=cS;var jxt=15;function Rbe(e){this.ellipsoid=y(e.ellipsoid,ee.default),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}Rbe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function qxt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Ct(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=se.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Xi(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new U(r.xmin,r.ymin),s.rectangleNortheastInMeters=new U(r.xmax,r.ymax),e.tilingScheme=new us(s)}else throw new re("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new re("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?nh.LERC:nh.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new jm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new jm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Yxt(e,t,n){try{let i=await t.fetchJson();qxt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Po.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function r0(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new pe}Object.defineProperties(r0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});r0.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Se.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new Rbe(t);await Yxt(o,i);let r=new r0(t);return o.build(r),r._resource=n,r};r0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(OK(this,n+1,e*2,t*2))){let h=Obe(this,n+1,e*2,t*2);s=h.promise,a=h.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(h){return new cc({buffer:h[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):jxt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(h){if(l(a)&&a.state===$n.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=$n.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function OK(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}r0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};r0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=OK(this,n,e,t);if(l(i))return i;Obe(this,n,e,t)};r0.prototype.loadTileDataAvailability=function(e,t,n){};function Xxt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new U(e.x+1,e.y+1),f=!1,h=!1;for(;!(f&&h);){let p=u.x,_=h?u.y+1:u.y;if(!f){for(let m=e.y;m<_;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new U(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!h){let m=u.y*t;for(let x=e.x;x<=p;++x)if(i[m+x]!==s){h=!0;break}h?(a.push(new U(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,h=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function Kxt(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new U(0,0)];for(;a.length>0;){let c=a.pop(),u=Xxt(c,n,i,o);if(u.value===1){let h=u.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function Obe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new nr({throttle:!1,throttleByServer:!0,type:ps.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(h)?(h=h.then(function(p){let _=Kxt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let m=e._tilesAvailable;for(let x=0;x<_.length;++x){let b=_[x];m.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return OK(e,t,n,i)}),c[a]={promise:h,request:u},h=h.finally(function(p){return delete c[a],p}),{promise:h,request:u}):{}}var Mbe=r0;var Lbe="https://dev.virtualearth.net/REST/v1/Locations";function MK(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Se({url:Lbe,queryParameters:n}),this._credit=new Ct('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(MK.prototype,{url:{get:function(){return Lbe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});MK.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:se.fromDegrees(a,s,u,c)}})})};var Nbe=MK;function LK(){}Object.defineProperties(LK.prototype,{credit:{get:function(){}}});LK.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:d.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var Fbe=LK;var Zxt=new oe,Bbe=new d,lS=new d;function $xt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new d);let u=(a-i)*o;return d.lerp(r,s,u,c)}}return function(i,o){l(o)||(o=new d);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=Zxt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,h,p;return r===0?(c=t[0],u=t[1],f=e.firstTangent,h=d.subtract(t[2],c,Bbe),d.multiplyByScalar(h,.5,h),p=F.multiplyByVector(gx.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],u=t[r+1],h=e.lastTangent,f=d.subtract(u,t[r-1],Bbe),d.multiplyByScalar(f,.5,f),p=F.multiplyByVector(gx.hermiteCoefficientMatrix,a,a)):(c=t[r-1],u=t[r],f=t[r+1],h=t[r+2],p=F.multiplyByVector(s0.catmullRomCoefficientMatrix,a,a)),o=d.multiplyByScalar(c,p.x,o),d.multiplyByScalar(u,p.y,lS),d.add(o,lS,o),d.multiplyByScalar(f,p.z,lS),d.add(o,lS,o),d.multiplyByScalar(h,p.w,lS),d.add(o,lS,o)}}var Qxt=new d,Jxt=new d;function s0(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=Qxt,d.multiplyByScalar(t[1],2,i),d.subtract(i,t[2],i),d.subtract(i,t[0],i),d.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=Jxt,d.multiplyByScalar(t[r-1],2,o),d.subtract(t[r],o,o),d.add(o,t[r-2],o),d.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=d.clone(i),this._lastTangent=d.clone(o),this._evaluateFunction=$xt(this),this._lastTimeIndex=0}Object.defineProperties(s0.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});s0.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);s0.prototype.findTimeInterval=io.prototype.findTimeInterval;s0.prototype.wrapTime=io.prototype.wrapTime;s0.prototype.clampTime=io.prototype.clampTime;s0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var kbe=s0;var OH={};OH.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let u=s+a+c,f,h,p,_,m,x;return u===1?s?(f=(e-n)/(i-n),h=(e-n)/(o-n),r.push(1),r.push(2),h!==1&&(r.push(-1),r.push(0),r.push(2),r.push(h)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):a?(p=(e-i)/(o-i),_=(e-i)/(n-i),r.push(2),r.push(0),_!==1&&(r.push(-1),r.push(1),r.push(0),r.push(_)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(m=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!s&&n!==e?(_=(e-i)/(n-i),m=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(_),r.push(-1),r.push(2),r.push(0),r.push(m)):!a&&i!==e?(x=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(f)):!c&&o!==e&&(h=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(h),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};OH.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let u=n-s,f=s-o,h=r-a,p=i-a,_=1/(h*u+f*p),m=t-a,x=e-s,b=(h*x+f*m)*_,T=(-p*x+u*m)*_,C=1-b-T;return l(c)?(c.x=b,c.y=T,c.z=C,c):new d(b,T,C)};OH.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=u/h,_=f/h;if(p>=0&&p<=1&&_>=0&&_<=1)return l(c)||(c=new U),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var a0=OH;function c0(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=LH(e.westIndices,o,t),this._southIndices=LH(e.southIndices,r,t),this._eastIndices=LH(e.eastIndices,o,t),this._northIndices=LH(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(c0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var MH=[];function LH(e,t,n){MH.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)MH[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(MH.sort(t),Ne.createTypedArray(n,MH)):e}var Vbe="createVerticesFromQuantizedTerrainMesh",ebt=new yi(Vbe),tbt=new yi(Vbe,Om.maximumAsynchronousTasks);c0.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),h=(a?tbt:ebt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(h))return;let p=this;return Promise.resolve(h).then(function(_){let m=p._quantizedVertices.length/3,x=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Ne.createTypedArray(x,_.indices),T=new Float32Array(_.vertices),C=_.center,A=_.minimumHeight,S=_.maximumHeight,v=p._boundingSphere,D=p._orientedBoundingBox,O=y(d.clone(_.occludeePointInScaledSpace),p._horizonOcclusionPoint),R=_.vertexStride,M=Zc.clone(_.encoding);return p._mesh=new ih(C,T,b,_.indexCountWithoutSkirts,m,A,S,v,O,R,D,M,_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var nbt=new yi("upsampleQuantizedTerrainMesh",Om.maximumAsynchronousTasks);c0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=nbt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:h,ellipsoid:f});if(!l(p))return;let _=Math.min(this._westSkirtHeight,this._eastSkirtHeight);_=Math.min(_,this._southSkirtHeight),_=Math.min(_,this._northSkirtHeight);let m=c?_*.5:this._westSkirtHeight,x=u?_*.5:this._southSkirtHeight,b=c?this._eastSkirtHeight:_*.5,T=u?this._northSkirtHeight:_*.5,C=this._credits;return Promise.resolve(p).then(function(A){let S=new Uint16Array(A.vertices),v=Ne.createTypedArray(S.length/3,A.indices),D;return l(A.encodedNormals)&&(D=new Uint8Array(A.encodedNormals)),new c0({quantizedVertices:S,indices:v,encodedNormals:D,minimumHeight:A.minimumHeight,maximumHeight:A.maximumHeight,boundingSphere:ae.clone(A.boundingSphere),orientedBoundingBox:wn.clone(A.orientedBoundingBox),horizonOcclusionPoint:d.clone(A.horizonOcclusionPoint),westIndices:A.westIndices,southIndices:A.southIndices,eastIndices:A.eastIndices,northIndices:A.northIndices,westSkirtHeight:m,southSkirtHeight:x,eastSkirtHeight:b,northSkirtHeight:T,childTileMask:0,credits:C,createdByUpsampling:!0})})};var NK=32767,Ube=new d;c0.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=NK;let o=P.clamp((n-e.south)/e.height,0,1);return o*=NK,l(this._mesh)?sbt(this,i,o):abt(this,i,o)};function zbe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),h=Math.max(i,r,a);return e>=c&&e<=u&&t>=f&&t<=h}var ibt=new U,obt=new U,rbt=new U;function sbt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,ibt),_=r.decodeTextureCoordinates(o,f,obt),m=r.decodeTextureCoordinates(o,h,rbt);if(zbe(t,n,p.x,p.y,_.x,_.y,m.x,m.y)){let x=a0.computeBarycentricCoordinates(t,n,p.x,p.y,_.x,_.y,m.x,m.y,Ube);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),T=r.decodeHeight(o,f),C=r.decodeHeight(o,h);return x.x*b+x.y*T+x.z*C}}}}function abt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=i[u],_=i[f],m=i[h],x=o[u],b=o[f],T=o[h];if(zbe(t,n,p,x,_,b,m,T)){let C=a0.computeBarycentricCoordinates(t,n,p,x,_,b,m,T,Ube);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){let A=C.x*r[u]+C.y*r[f]+C.z*r[h];return P.lerp(e._minimumHeight,e._maximumHeight,A/NK)}}}}c0.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};c0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var uS=c0;function cbt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function Gbe(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=y(e.ellipsoid,ee.default),this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}Gbe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function Wbe(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Po.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Po.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Po.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new us({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Po.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}if(e.levelZeroMaximumGeometricError=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Po.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new re(x)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,_;if(l(p)&&!l(h)){_=new jm(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let b=p[x],T=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let C=0;C<b.length;++C){let A=b[C],S=T-A.endY-1,v=T-A.startY-1;e.overallAvailability[x].push([A.startX,S,A.endX,v]),_.addAvailableTileRange(x,A.startX,S,A.endX,v)}}}else l(h)&&(f=new jm(e.tilingScheme,u),_=new jm(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],_.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new cbt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:_,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(_)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await kK(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function lbt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=Po.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return kK(e,n);throw new re(i)}async function ubt(e,t,n){await Wbe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new jm(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Ct(e.attribution);e.tileCredits.push(o)}return!0}async function kK(e,t){try{let n=await e.layerJsonResource.fetchJson();return ubt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await Wbe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):lbt(e,n,t)}}function hh(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new pe;let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var FK={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Hbe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function fbt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new cc({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function dbt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,h=Float64Array.BYTES_PER_ELEMENT*u,_=Uint16Array.BYTES_PER_ELEMENT*3,m=3,x=Uint16Array.BYTES_PER_ELEMENT,b=x*m,T=new DataView(t),C=new d(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0));a+=f;let A=T.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=T.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ae(new d(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0)),T.getFloat64(a+f,!0));a+=h;let D=new d(T.getFloat64(a,!0),T.getFloat64(a+8,!0),T.getFloat64(a+16,!0));a+=f;let O=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,O*3);a+=O*_,O>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,b=x*m);let M=R.subarray(0,O),L=R.subarray(O,2*O),g=R.subarray(O*2,3*O);Ln.zigZagDeltaDecode(M,L,g),a%x!==0&&(a+=x-a%x);let E=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=Ne.createTypedArrayFromArrayBuffer(O,t,a,E*m);a+=E*b;let I=0,N=w.length;for(let ce=0;ce<N;++ce){let _e=w[ce];w[ce]=I-_e,_e===0&&++I}let B=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Ne.createTypedArrayFromArrayBuffer(O,t,a,B);a+=B*x;let V=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Ne.createTypedArrayFromArrayBuffer(O,t,a,V);a+=V*x;let k=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let W=Ne.createTypedArrayFromArrayBuffer(O,t,a,k);a+=k*x;let Y=T.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=Ne.createTypedArrayFromArrayBuffer(O,t,a,Y);a+=Y*x;let j,K;for(;a<T.byteLength;){let ce=T.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let _e=T.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ce===FK.OCT_VERTEX_NORMALS&&e._requestVertexNormals)j=new Uint8Array(t,a,O*2);else if(ce===FK.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,a,_e);else if(ce===FK.METADATA&&e._requestMetadata){let be=T.getUint32(a,!0);if(be>0){let Ae=Bo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,be).available;if(l(Ae))for(let ke=0;ke<Ae.length;++ke){let ze=n+ke+1,et=Ae[ke],Et=e._tilingScheme.getNumberOfYTilesAtLevel(ze);for(let ht=0;ht<et.length;++ht){let Be=et[ht],qt=Et-Be.endY-1,Tt=Et-Be.startY-1;e.availability.addAvailableTileRange(ze,Be.startX,qt,Be.endX,Tt),r.availability.addAvailableTileRange(ze,Be.startX,qt,Be.endX,Tt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=_e}let Q=e.getLevelMaximumGeometricError(n)*5,de=e._tilingScheme.tileXYToRectangle(i,o,n),xe=wn.fromRectangle(de,A,S,e._tilingScheme.ellipsoid);return new uS({center:C,minimumHeight:A,maximumHeight:S,boundingSphere:v,orientedBoundingBox:xe,horizonOcclusionPoint:D,quantizedVertices:R,encodedNormals:j,indices:w,westIndices:H,southIndices:G,eastIndices:W,northIndices:J,westSkirtHeight:Q,southSkirtHeight:Q,eastSkirtHeight:Q,northSkirtHeight:Q,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:K,credits:e._tileCredits})}hh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let h=VK(this,e,t,n,f,u===0);h.result&&(a=!0,c=c.then(()=>h.promise))}return!l(r)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):jbe(this,e,t,n,r,i)};function jbe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new re("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let u,f,h=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=Hbe(void 0)):u=Hbe(c);let _=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(_))return _.then(function(m){return l(m)?l(e._heightmapStructure)?fbt(e,m,i,t,n):dbt(e,m,i,t,n,o):Promise.reject(new re("Mesh buffer doesn't exist."))})}Object.defineProperties(hh.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});hh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};hh.fromIonAssetId=async function(e,t){let n=await cf.fromAssetId(e);return hh.fromUrl(n,t)};hh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Se.createIfNeeded(e);n.appendForwardSlash();let i=new Gbe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await kK(i);let o=new hh(t);return i.build(o),o};hh.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(VK(this,e,t,n,i[r],r===0).result)return;return!1};hh.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=VK(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function BK(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function VK(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,u=o.availability,f=BK(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let h;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,h=o.availabilityPromiseCache[s],!l(h))){let p=new nr({throttle:!1,throttleByServer:!0,type:ps.TERRAIN});h=jbe(e,f.x,f.y,f.level,o,p),l(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}f=BK(o,f.x,f.y,f.level)}return{result:!1}}hh._getAvailabilityTile=BK;var fS=hh;function wg(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new Il(n),this._workerName="createCircleGeometry"}wg.packedLength=Il.packedLength;wg.pack=function(e,t,n){return Il.pack(e._ellipseGeometry,t,n)};var qbe=new Il({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Oa={center:new d,radius:void 0,ellipsoid:ee.clone(ee.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Ie,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};wg.unpack=function(e,t,n){let i=Il.unpack(e,t,qbe);return Oa.center=d.clone(i._center,Oa.center),Oa.ellipsoid=ee.clone(i._ellipsoid,Oa.ellipsoid),Oa.ellipsoid=ee.clone(i._ellipsoid,qbe._ellipsoid),Oa.height=i._height,Oa.extrudedHeight=i._extrudedHeight,Oa.granularity=i._granularity,Oa.vertexFormat=Ie.clone(i._vertexFormat,Oa.vertexFormat),Oa.stRotation=i._stRotation,Oa.shadowVolume=i._shadowVolume,l(n)?(Oa.semiMajorAxis=i._semiMajorAxis,Oa.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Il(Oa),n):(Oa.radius=i._semiMajorAxis,new wg(Oa))};wg.createGeometry=function(e){return Il.createGeometry(e._ellipseGeometry)};wg.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new wg({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(wg.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Ybe=wg;function dS(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new Vf(n),this._workerName="createCircleOutlineGeometry"}dS.packedLength=Vf.packedLength;dS.pack=function(e,t,n){return Vf.pack(e._ellipseGeometry,t,n)};var hbt=new Vf({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Fu={center:new d,radius:void 0,ellipsoid:ee.clone(ee.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};dS.unpack=function(e,t,n){let i=Vf.unpack(e,t,hbt);return Fu.center=d.clone(i._center,Fu.center),Fu.ellipsoid=ee.clone(i._ellipsoid,Fu.ellipsoid),Fu.height=i._height,Fu.extrudedHeight=i._extrudedHeight,Fu.granularity=i._granularity,Fu.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Fu.semiMajorAxis=i._semiMajorAxis,Fu.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Vf(Fu),n):(Fu.radius=i._semiMajorAxis,new dS(Fu))};dS.createGeometry=function(e){return Vf.createGeometry(e._ellipseGeometry)};var Xbe=dS;function hS(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Xi({ellipsoid:y(e.ellipsoid,ee.default)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe;let n=e.credit;typeof n=="string"&&(n=new Ct(n)),this._credit=n}Object.defineProperties(hS.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});hS.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new cc({buffer:c,width:r,height:s})})};hS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};hS.prototype.getTileDataAvailable=function(e,t,n){};hS.prototype.loadTileDataAvailability=function(e,t,n){};var Kbe=hS;function Zbe(e){this.proxy=e}Zbe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var $be=Zbe;var mbt={SEARCH:0,AUTOCOMPLETE:1},Bb=Object.freeze(mbt);function NH(){he.throwInstantiationError()}Object.defineProperties(NH.prototype,{credit:{get:he.throwInstantiationError}});NH.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Ct.getIonCredit)};NH.prototype.geocode=he.throwInstantiationError;var CP=NH;function Qbe(){he.throwInstantiationError()}Qbe.createGeometry=function(e){he.throwInstantiationError()};var Jbe=Qbe;var bbt=Ur(UK(),1);function pbt(e,t){return(e&t)!==0}var tl=pbt;var gbt=[1,2,4,8],eTe=15,_bt=16,ybt=64,xbt=128;function qm(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}qm.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new qm(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};qm.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};qm.prototype.hasSubtree=function(){return tl(this._bits,_bt)};qm.prototype.hasImagery=function(){return tl(this._bits,ybt)};qm.prototype.hasTerrain=function(){return tl(this._bits,xbt)};qm.prototype.hasChildren=function(){return tl(this._bits,eTe)};qm.prototype.hasChild=function(e){return tl(this._bits,gbt[e])};qm.prototype.getChildBitmask=function(){return this._bits&eTe};var FH=qm;function Tbt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var Cbt=Tbt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\x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0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 \xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS >\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Fu(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Fu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Fu.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Se)&&(t=e.url);let n=Se.createIfNeeded(t);n.appendForwardSlash();let i=new Fu;i._resource=n;try{await xbt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${eTe(i,"",1).url}: ${o}`;throw new re(r)}return i};Fu.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;el(t,r)?el(e,r)&&(s|=1):(s|=2,el(e,r)||(s|=1)),i+=s}return i};Fu.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];el(s,2)?el(s,1)||(t|=r):(n|=r,el(s,1)&&(t|=r))}return{x:t,y:n,level:i}};Fu.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var Jbe=new _i("decodeGoogleEarthEnterprisePacket");Fu.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=eTe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return Jbe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,h=-1;if(e!==""){h=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,x){return m.length-x.length});let _=p.length;for(let m=0;m<_;++m){let x=p[m];if(u[x]!==null){let T=NH.clone(u[x]),C=x.length;if(C===h)T.setParent(f);else if(C>1){let A=r[x.substring(0,x.length-1)];T.setParent(A)}r[x]=T}else r[x]=null}})})};Fu.prototype.populateSubtree=function(e,t,n,i){let o=Fu.tileXYToQuadKey(e,t,n);return HK(this,o,i)};function HK(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new nr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),HK(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new re(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new nr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),HK(e,t,s)}).finally(function(){delete a[o]})}Fu.prototype.getTileInformation=function(e,t,n){let i=Fu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Fu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function eTe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var UK,zK;function xbt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(zK)){let n=nn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;zK=sT(n).then(function(){UK=window.cesiumGoogleEarthDbRootParser(gbt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return zK.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=UK.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return Jbe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=UK.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.copyrightString;l(u)&&(o[c.providerId]=new At(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=ybt})}var l0=Fu;function kb(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(kb.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var iTe="createVerticesFromGoogleEarthEnterpriseBuffer",bbt=new _i(iTe),Tbt=new _i(iTe,Rm.maximumAsynchronousTasks),tTe=new se,GK=new se;kb.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,tTe),t.tileXYToRectangle(n,i,o,GK);let u=c.cartographicToCartesian(se.center(GK)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let _=(a?Tbt:bbt).scheduleTask({buffer:this._buffer,nativeRectangle:tTe,rectangle:GK,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(_))return;let m=this;return _.then(function(x){return m._mesh=new ih(u,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,ae.clone(x.boundingSphere3D),d.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,wn.clone(x.orientedBoundingBox),Kc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),m._minimumHeight=x.minimumHeight,m._maximumHeight=x.maximumHeight,m._buffer=void 0,m._mesh})};kb.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),o=P.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?vbt(this,i,o):Ibt(this,i,o,e)};var Cbt=new _i("upsampleQuantizedTerrainMesh",Rm.maximumAsynchronousTasks);kb.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=Cbt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:h,ellipsoid:f});if(!l(p))return;let _=this;return p.then(function(m){let x=new Uint16Array(m.vertices),b=Ne.createTypedArray(x.length/3,m.indices),T=_._skirtHeight;return new aS({quantizedVertices:x,indices:b,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ae.clone(m.boundingSphere),orientedBoundingBox:wn.clone(m.orientedBoundingBox),horizonOcclusionPoint:d.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:T,southSkirtHeight:T,eastSkirtHeight:T,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0,credits:_._credits})})};kb.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};kb.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Abt=new U,Ebt=new U,Sbt=new U,oTe=new d;function vbt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,Abt),_=r.decodeTextureCoordinates(o,f,Ebt),m=r.decodeTextureCoordinates(o,h,Sbt),x=a0.computeBarycentricCoordinates(t,n,p.x,p.y,_.x,_.y,m.x,m.y,oTe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),T=r.decodeHeight(o,f),C=r.decodeHeight(o,h);return x.x*b+x.y*T+x.z*C}}}var wbt=Uint16Array.BYTES_PER_ELEMENT,nTe=Uint32Array.BYTES_PER_ELEMENT,WK=Int32Array.BYTES_PER_ELEMENT,Dbt=Float32Array.BYTES_PER_ELEMENT,jK=Float64Array.BYTES_PER_ELEMENT;function Ibt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),u=0;for(let v=0;v<r;++v)u+=c.getUint32(u,!0),u+=nTe;u+=nTe,u+=2*jK;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=jK;let h=P.toRadians(c.getFloat64(u,!0)*180);u+=jK;let p=i.width/f/2,_=i.height/h/2,m=c.getInt32(u,!0);u+=WK;let x=c.getInt32(u,!0)*3;u+=WK,u+=WK;let b=new Array(m),T=new Array(m),C=new Array(m),A;for(A=0;A<m;++A)b[A]=s+c.getUint8(u++)*p,T[A]=a+c.getUint8(u++)*_,C[A]=c.getFloat32(u,!0)*6371010,u+=Dbt;let S=new Array(x);for(A=0;A<x;++A)S[A]=c.getUint16(u,!0),u+=wbt;for(A=0;A<x;A+=3){let v=S[A],D=S[A+1],O=S[A+2],R=b[v],M=b[D],L=b[O],g=T[v],E=T[D],w=T[O],I=a0.computeBarycentricCoordinates(t,n,R,g,M,E,L,w,oTe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*C[v]+I.y*C[D]+I.z*C[O]}}var xP=kb;var ed={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},FH=new Z;function BH(){this._terrainCache={},this._lastTidy=Z.now()}BH.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Z.now()}};BH.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};BH.prototype.tidy=function(){if(Z.now(FH),Z.secondsDifference(FH,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];Z.secondsDifference(FH,r.timestamp)>10&&delete e[o]}Z.clone(FH,this._lastTidy)}};function u0(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new At(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new BH,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new me}Object.defineProperties(u0.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});u0.fromMetadata=function(e,t){if(!e.terrainPresent)throw new re(`The server ${e.url} doesn't have terrain`);let n=new u0(t);return n._metadata=e,n};var Pbt=new _i("decodeGoogleEarthEnterprisePacket");function rTe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===ed.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}u0.prototype.requestTileGeometry=function(e,t,n,i){let o=l0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new re("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=ed.UNKNOWN);let u=r.get(o);if(l(u)){let T=s.providers[a.terrainProvider];return Promise.resolve(new xP({buffer:u,childTileMask:rTe(o,a,s),credits:l(T)?[T]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===ed.NONE)return Promise.reject(new re("Terrain tile doesn't exist"))}else return Promise.resolve(new ac({buffer:new Uint8Array(16*16),width:16,height:16}));let f,h=o,p=-1;switch(c){case ed.SELF:p=a.terrainVersion;break;case ed.PARENT:h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),p=f.terrainVersion;break;case ed.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new re("Terrain tile doesn't exist"));let _=this._terrainPromises,m=this._terrainRequests,x,b;if(l(_[h]))x=_[h],b=m[h];else{b=i;let T=Rbt(this,h,p,b).fetchArrayBuffer();if(!l(T))return;x=T.then(function(C){return l(C)?Pbt.scheduleTask({buffer:C,type:"Terrain",key:s.key},[C]).then(function(A){let S=s.getTileInformationFromQuadKey(h);S.terrainState=ed.SELF,r.add(h,A[0]);let v=S.terrainProvider,D=A.length-1;for(let O=0;O<D;++O){let R=h+O.toString(),M=s.getTileInformationFromQuadKey(R);l(M)&&(r.add(R,A[O+1]),M.terrainState=ed.PARENT,M.terrainProvider===0&&(M.terrainProvider=v))}}):Promise.reject(new re("Failed to load terrain."))}),_[h]=x,m[h]=b,x=x.finally(function(){delete _[h],delete m[h]})}return x.then(function(){let T=r.get(o);if(l(T)){let C=s.providers[a.terrainProvider];return new xP({buffer:T,childTileMask:rTe(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new re("Failed to load terrain."))}).catch(function(T){return b.state===Kn.CANCELLED?(i.state=b.state,Promise.reject(T)):(a.terrainState=ed.NONE,Promise.reject(T))})};u0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};u0.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=l0.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===ed.NONE)return!1;if((!l(s)||s===ed.UNKNOWN)&&(r.terrainState=ed.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new nr({throttle:!1,throttleByServer:!0,type:ps.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};u0.prototype.loadTileDataAvailability=function(e,t,n){};function Rbt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var sTe=u0;var Obt="https://maps.googleapis.com/maps/api/geocode/json",aTe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function qK(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._resource=new Se({url:Obt,queryParameters:{key:t}}),this._credit=new At(aTe,!0)}Object.defineProperties(qK.prototype,{credit:{get:function(){return this._credit}}});qK.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new re(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:se.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:aTe,collapsible:!1}}})};var cTe=qK;var kH={};kH.defaultApiKey=void 0;kH.mapTilesApiEndpoint=new Se({url:"https://tile.googleapis.com/v1/"});kH.getDefaultCredit=function(){return new At('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var fS=kH;var mc={};mc.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});mc.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});mc.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",OPC:"OPC",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles","3MX":"3MX","3SM":"3SM",CCCloudProject:"CCCloudProject",CCImageCollection:"CCImageCollection",CCOrientations:"CCOrientations",ContextCaptureInputs:"ContextCaptureInputs",ContextDetector:"ContextDetector",ContextScene:"ContextScene",DAE:"DAE",DGN:"DGN",DSM:"DSM",FBX:"FBX",GLB:"GLB",GLTF:"GLTF",KML:"KML",LAS:"LAS",LAZ:"LAZ",LOD:"LOD",LodTree:"LodTree",OBJ:"OBJ",OMI:"OMI",OMR:"OMR",Orthophoto:"Orthophoto",OrthophotoDSM:"OrthophotoDSM",OSGB:"OSGB",OVF:"OVF",OBT:"OBT",PLY:"PLY",PointCloud:"PointCloud",S3C:"S3C",ScanCollection:"ScanCollection",SHP:"SHP",SLPK:"SLPK",SpaceEyes3D:"SpaceEyes3D",STL:"STL",TSM:"TSM",Unstructured:"Unstructured",Other:"Other"});mc.defaultAccessToken=void 0;mc.apiEndpoint=new Se({url:"https://api.bentley.com"});mc.getExports=async function(e){let t=new Se({url:`${mc.apiEndpoint}mesh-export`,headers:{Authorization:`Bearer ${mc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:mc.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);throw n.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${i.error.details[0].code}`):n.statusCode===403?(console.error(i.error.code,i.error.message),new re("Not allowed, forbidden")):n.statusCode===422?new re(`Unprocessable Entity:${i.error.code} ${i.error.message}`):n.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${n.statusCode}`)}};mc.getRealityDataMetadata=async function(e,t){let n=new Se({url:`${mc.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:`Bearer ${mc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);throw i.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${o.error.details[0].code}`):i.statusCode===403?(console.error(o.error.code,o.error.message),new re("Not allowed, forbidden")):i.statusCode===404?new re(`Reality data not found: ${e}, ${t}`):i.statusCode===422?new re(`Unprocessable Entity:${o.error.code} ${o.error.message}`):i.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${i.statusCode}`)}};mc.getRealityDataURL=async function(e,t,n){let i=new Se({url:`${mc.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:`Bearer ${mc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);throw o.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${r.error.details[0].code}`):o.statusCode===403?(console.error(r.error.code,r.error.message),new re("Not allowed, forbidden")):o.statusCode===404?new re(`Reality data not found: ${e}, ${t}`):o.statusCode===422?new re(`Unprocessable Entity:${r.error.code} ${r.error.message}`):o.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${o.statusCode}`)}};var td=mc;var bP={};bP.type=void 0;bP.getRequiredDataPoints=he.throwInstantiationError;bP.interpolateOrderZero=he.throwInstantiationError;bP.interpolate=he.throwInstantiationError;var lTe=bP;var Mbt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},f0=Object.freeze(Mbt);function YK(e){this._url=Se.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(YK.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});YK.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Bb.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=se.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=d.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var VH=YK;function Lbt(e){if(!Object.values(f0).some(t=>t===e))throw new he(`Invalid geocodeProviderType: "${e}"`)}var uTe=Object.freeze({[f0.GOOGLE]:"google",[f0.BING]:"bing",[f0.DEFAULT]:void 0});function Nbt(e){return uTe[e]}function Fbt(e){return Object.entries(uTe).find(t=>t[1]===e)[0]}function XK(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.geocodeProviderType,f0.DEFAULT),n=y(e.accessToken,Hh.defaultAccessToken),i=Se.createIfNeeded(y(e.server,Hh.defaultServer));i.appendForwardSlash();let o=Hh.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(At.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new VH(r),this.geocodeProviderType=t}Object.defineProperties(XK.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return Fbt(this._pelias.url.queryParameters.geocoder)},set:function(e){Lbt(e);let t={...this._pelias.url.queryParameters,geocoder:Nbt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});XK.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var dS=XK;function UH(){he.throwInstantiationError()}Object.defineProperties(UH.prototype,{ellipsoid:{get:he.throwInstantiationError}});UH.prototype.project=he.throwInstantiationError;UH.prototype.unproject=he.throwInstantiationError;var fTe=UH;function hS(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(hS.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});hS.prototype.findTimeInterval=no.prototype.findTimeInterval;hS.prototype.wrapTime=no.prototype.wrapTime;hS.prototype.clampTime=no.prototype.clampTime;hS.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var dTe=hS;function KK(e,t,n){e=Se.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new At('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(KK.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});KK.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:bt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=se.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=d.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var hTe=KK;var Bbt={packedLength:void 0,pack:he.throwInstantiationError,unpack:he.throwInstantiationError},mTe=Bbt;var kbt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:he.throwInstantiationError,unpackInterpolationResult:he.throwInstantiationError},pTe=kbt;function gTe(){he.throwInstantiationError()}gTe.prototype.getURL=he.throwInstantiationError;var _Te=gTe;function Vbt(e,t,n,i,o,r,s){let a=Li.numberOfPoints(e,t,o),c,u=n.red,f=n.green,h=n.blue,p=n.alpha,_=i.red,m=i.green,x=i.blue,b=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)r[s++]=z.floatToByte(u),r[s++]=z.floatToByte(f),r[s++]=z.floatToByte(h),r[s++]=z.floatToByte(p);return s}let T=(_-u)/a,C=(m-f)/a,A=(x-h)/a,S=(b-p)/a,v=s;for(c=0;c<a;c++)r[v++]=z.floatToByte(u+c*T),r[v++]=z.floatToByte(f+c*C),r[v++]=z.floatToByte(h+c*A),r[v++]=z.floatToByte(p+c*S);return v}function TP(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,tn.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,ee.default),this._workerName="createSimplePolylineGeometry";let o=1+t.length*d.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+ee.packedLength+3}TP.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};TP.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t);t+=ee.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new TP({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var zH=new Array(2),HH=new Array(2),Ubt={positions:zH,height:HH,ellipsoid:void 0,minDistance:void 0,granularity:void 0};TP.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=P.chordLength(r,s.maximumRadius),c=l(n)&&!i,u,f=t.length,h,p,_,m,x=0;if(o===tn.GEODESIC||o===tn.RHUMB){let S,v,D;o===tn.GEODESIC?(S=P.chordLength(r,s.maximumRadius),v=Li.numberOfPoints,D=Li.generateArc):(S=r,v=Li.numberOfPointsRhumbLine,D=Li.generateRhumbArc);let O=Li.extractHeights(t,s),R=Ubt;if(o===tn.GEODESIC?R.minDistance=a:R.granularity=r,R.ellipsoid=s,c){let M=0;for(u=0;u<f-1;u++)M+=v(t[u],t[u+1],S)+1;h=new Float64Array(M*3),_=new Uint8Array(M*4),R.positions=zH,R.height=HH;let L=0;for(u=0;u<f-1;++u){zH[0]=t[u],zH[1]=t[u+1],HH[0]=O[u],HH[1]=O[u+1];let g=D(R);if(l(n)){let E=g.length/3;m=n[u];for(let w=0;w<E;++w)_[L++]=z.floatToByte(m.red),_[L++]=z.floatToByte(m.green),_[L++]=z.floatToByte(m.blue),_[L++]=z.floatToByte(m.alpha)}h.set(g,x),x+=g.length}}else if(R.positions=t,R.height=O,h=new Float64Array(D(R)),l(n)){for(_=new Uint8Array(h.length/3*4),u=0;u<f-1;++u){let L=t[u],g=t[u+1],E=n[u],w=n[u+1];x=Vbt(L,g,E,w,a,_,x)}let M=n[f-1];_[x++]=z.floatToByte(M.red),_[x++]=z.floatToByte(M.green),_[x++]=z.floatToByte(M.blue),_[x++]=z.floatToByte(M.alpha)}}else{p=c?f*2-2:f,h=new Float64Array(p*3),_=l(n)?new Uint8Array(p*4):void 0;let S=0,v=0;for(u=0;u<f;++u){let D=t[u];if(c&&u>0&&(d.pack(D,h,S),S+=3,m=n[u-1],_[v++]=z.floatToByte(m.red),_[v++]=z.floatToByte(m.green),_[v++]=z.floatToByte(m.blue),_[v++]=z.floatToByte(m.alpha)),c&&u===f-1)break;d.pack(D,h,S),S+=3,l(n)&&(m=n[u],_[v++]=z.floatToByte(m.red),_[v++]=z.floatToByte(m.green),_[v++]=z.floatToByte(m.blue),_[v++]=z.floatToByte(m.alpha))}}let b=new hn;b.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:h}),l(n)&&(b.color=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:_,normalize:!0})),p=h.length/3;let T=(p-1)*2,C=Ne.createTypedArray(p,T),A=0;for(u=0;u<p-1;++u)C[A++]=u,C[A++]=u+1;return new at({attributes:b,indices:C,primitiveType:Me.LINES,boundingSphere:ae.fromPoints(t)})};var yTe=TP;function mS(e){let t=y(e.radius,1),i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new ca(i),this._workerName="createSphereGeometry"}mS.packedLength=ca.packedLength;mS.pack=function(e,t,n){return ca.pack(e._ellipsoidGeometry,t,n)};var zbt=new ca,d0={radius:void 0,radii:new d,vertexFormat:new Ie,stackPartitions:void 0,slicePartitions:void 0};mS.unpack=function(e,t,n){let i=ca.unpack(e,t,zbt);return d0.vertexFormat=Ie.clone(i._vertexFormat,d0.vertexFormat),d0.stackPartitions=i._stackPartitions,d0.slicePartitions=i._slicePartitions,l(n)?(d.clone(i._radii,d0.radii),n._ellipsoidGeometry=new ca(d0),n):(d0.radius=i._radii.x,new mS(d0))};mS.createGeometry=function(e){return ca.createGeometry(e._ellipsoidGeometry)};var xTe=mS;function h0(e){}Object.defineProperties(h0.prototype,{ellipsoid:{get:he.throwInstantiationError},rectangle:{get:he.throwInstantiationError},projection:{get:he.throwInstantiationError}});h0.prototype.getNumberOfXTilesAtLevel=he.throwInstantiationError;h0.prototype.getNumberOfYTilesAtLevel=he.throwInstantiationError;h0.prototype.rectangleToNativeRectangle=he.throwInstantiationError;h0.prototype.tileXYToNativeRectangle=he.throwInstantiationError;h0.prototype.tileXYToRectangle=he.throwInstantiationError;h0.prototype.positionToTileXY=he.throwInstantiationError;var bTe=h0;function Hbt(e,t){this.rectangle=e,this.maxLevel=t}function TTe(e){this.ellipsoid=y(e.ellipsoid,ee.default),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}TTe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function Gbt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Xi({ellipsoid:e.ellipsoid});else throw new re(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),u=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new Hbt(new se(a,c,u,f),h))}}function Wbt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Io.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new re(i)}async function jbt(e,t,n){try{let i=await t.fetchXML();Gbt(e,i)}catch(i){Wbt(t,i,n)}}function m0(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new me,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new At(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(m0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});m0.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new TTe(t),i=Se.createIfNeeded(e);await jbt(n,i);let o=new m0(t);return n.build(o),o._resource=i,o};m0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new ac({buffer:bh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:qbt(a,e,t,n),structure:a._terrainDataStructure})})};m0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var CTe=new se;function qbt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,h=se.intersection(f,s,CTe);l(h)&&(GH(o,f,t*2,n*2,i+1)&&(a|=4),GH(o,f,t*2+1,n*2,i+1)&&(a|=8),GH(o,f,t*2,n*2+1,i+1)&&(a|=1),GH(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function GH(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(se.intersection(r,t,CTe))}m0.prototype.getTileDataAvailable=function(e,t,n){};m0.prototype.loadTileDataAvailability=function(e,t,n){};var ATe=m0;function Vb(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,He.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(Vb.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(Vb.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=Ybt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});Vb.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};Vb.prototype.isDestroyed=function(){return!1};Vb.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};Vb.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=y(this.epoch,He.MINIMUM_VALUE),s=Z.secondsDifference(o,r),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function Ybt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var ETe=Vb;var Xbt={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},STe=Object.freeze(Xbt);function Kbt(e){return e=y(e,y.EMPTY_OBJECT),cS.fromIonAssetId(2426648,{requestVertexNormals:y(e.requestVertexNormals,!1)})}var WH=Kbt;function Zbt(e){return e=y(e,y.EMPTY_OBJECT),cS.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1),ellipsoid:ee.WGS84})}var pS=Zbt;var $bt=1953029805,Qbt=2917034100;function ZK(e,t){if(ZK.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new re("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===$bt||o===Qbt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,h=8;for(;s<c;)for(h=(h+8)%24,f=h;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(h=(h+8)%24,f=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}ZK.passThroughDataForTesting=!1;var jH=ZK;var Jbt=new d;function eTt(e,t,n,i){let o=gT(e,t,n,i,Jbt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var vTe=eTt;function tTt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var gS=tTt;function nTt(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var wTe=nTt;function iTt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var qH=iTt;var oTt=new d(1,1,1);function $K(e){e=y(e,oTt),this._dimensions=d.clone(e)}Object.defineProperties($K.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){d.clone(e,this._dimensions)}}});var rTt=new d;$K.prototype.emit=function(e){let t=this._dimensions,n=d.multiplyByScalar(t,.5,rTt),i=P.randomBetween(-n.x,n.x),o=P.randomBetween(-n.y,n.y),r=P.randomBetween(-n.z,n.z);e.position=d.fromElements(i,o,r,e.position),e.velocity=d.normalize(e.position,e.velocity)};var DTe=$K;function qm(){this.featurePropertiesDirty=!1}Object.defineProperties(qm.prototype,{featuresLength:{get:function(){he.throwInstantiationError()}},pointsLength:{get:function(){he.throwInstantiationError()}},trianglesLength:{get:function(){he.throwInstantiationError()}},geometryByteLength:{get:function(){he.throwInstantiationError()}},texturesByteLength:{get:function(){he.throwInstantiationError()}},batchTableByteLength:{get:function(){he.throwInstantiationError()}},innerContents:{get:function(){he.throwInstantiationError()}},ready:{get:function(){he.throwInstantiationError()}},tileset:{get:function(){he.throwInstantiationError()}},tile:{get:function(){he.throwInstantiationError()}},url:{get:function(){he.throwInstantiationError()}},batchTable:{get:function(){he.throwInstantiationError()}},metadata:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}},group:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}}});qm.prototype.hasProperty=function(e,t){he.throwInstantiationError()};qm.prototype.getFeature=function(e){he.throwInstantiationError()};qm.prototype.applyDebugSettings=function(e,t){he.throwInstantiationError()};qm.prototype.applyStyle=function(e){he.throwInstantiationError()};qm.prototype.update=function(e,t){he.throwInstantiationError()};qm.prototype.pick=function(e,t,n){he.throwInstantiationError()};qm.prototype.isDestroyed=function(){he.throwInstantiationError()};qm.prototype.destroy=function(){he.throwInstantiationError()};var ITe=qm;function _S(e,t){this._conditionsExpression=Ge(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,aTt(this,t)}Object.defineProperties(_S.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function sTt(e,t){this.condition=e,this.expression=t}function aTt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new sTt(new yd(a,t),new yd(c,t)))}e._runtimeConditions=n}_S.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};_S.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};_S.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Bu(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Bu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Bu.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Se)&&(t=e.url);let n=Se.createIfNeeded(t);n.appendForwardSlash();let i=new Bu;i._resource=n;try{await Abt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${nTe(i,"",1).url}: ${o}`;throw new re(r)}return i};Bu.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;tl(t,r)?tl(e,r)&&(s|=1):(s|=2,tl(e,r)||(s|=1)),i+=s}return i};Bu.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];tl(s,2)?tl(s,1)||(t|=r):(n|=r,tl(s,1)&&(t|=r))}return{x:t,y:n,level:i}};Bu.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var tTe=new yi("decodeGoogleEarthEnterprisePacket");Bu.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=nTe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return tTe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,h=-1;if(e!==""){h=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,x){return m.length-x.length});let _=p.length;for(let m=0;m<_;++m){let x=p[m];if(u[x]!==null){let T=FH.clone(u[x]),C=x.length;if(C===h)T.setParent(f);else if(C>1){let A=r[x.substring(0,x.length-1)];T.setParent(A)}r[x]=T}else r[x]=null}})})};Bu.prototype.populateSubtree=function(e,t,n,i){let o=Bu.tileXYToQuadKey(e,t,n);return GK(this,o,i)};function GK(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new nr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),GK(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new re(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new nr({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),GK(e,t,s)}).finally(function(){delete a[o]})}Bu.prototype.getTileInformation=function(e,t,n){let i=Bu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Bu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function nTe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var zK,HK;function Abt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(HK)){let n=en("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;HK=sT(n).then(function(){zK=window.cesiumGoogleEarthDbRootParser(bbt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return HK.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=zK.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return tTe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=zK.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.copyrightString;l(u)&&(o[c.providerId]=new Ct(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=Cbt})}var l0=Bu;function kb(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(kb.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var rTe="createVerticesFromGoogleEarthEnterpriseBuffer",Ebt=new yi(rTe),Sbt=new yi(rTe,Om.maximumAsynchronousTasks),iTe=new se,WK=new se;kb.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,iTe),t.tileXYToRectangle(n,i,o,WK);let u=c.cartographicToCartesian(se.center(WK)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let _=(a?Sbt:Ebt).scheduleTask({buffer:this._buffer,nativeRectangle:iTe,rectangle:WK,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(_))return;let m=this;return _.then(function(x){return m._mesh=new ih(u,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,ae.clone(x.boundingSphere3D),d.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,wn.clone(x.orientedBoundingBox),Zc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),m._minimumHeight=x.minimumHeight,m._maximumHeight=x.maximumHeight,m._buffer=void 0,m._mesh})};kb.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),o=P.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?Pbt(this,i,o):Mbt(this,i,o,e)};var vbt=new yi("upsampleQuantizedTerrainMesh",Om.maximumAsynchronousTasks);kb.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,h=e.tileXYToRectangle(o,r,s),p=vbt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:h,ellipsoid:f});if(!l(p))return;let _=this;return p.then(function(m){let x=new Uint16Array(m.vertices),b=Ne.createTypedArray(x.length/3,m.indices),T=_._skirtHeight;return new uS({quantizedVertices:x,indices:b,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ae.clone(m.boundingSphere),orientedBoundingBox:wn.clone(m.orientedBoundingBox),horizonOcclusionPoint:d.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:T,southSkirtHeight:T,eastSkirtHeight:T,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0,credits:_._credits})})};kb.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};kb.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var wbt=new U,Dbt=new U,Ibt=new U,sTe=new d;function Pbt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,wbt),_=r.decodeTextureCoordinates(o,f,Dbt),m=r.decodeTextureCoordinates(o,h,Ibt),x=a0.computeBarycentricCoordinates(t,n,p.x,p.y,_.x,_.y,m.x,m.y,sTe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let b=r.decodeHeight(o,u),T=r.decodeHeight(o,f),C=r.decodeHeight(o,h);return x.x*b+x.y*T+x.z*C}}}var Rbt=Uint16Array.BYTES_PER_ELEMENT,oTe=Uint32Array.BYTES_PER_ELEMENT,jK=Int32Array.BYTES_PER_ELEMENT,Obt=Float32Array.BYTES_PER_ELEMENT,qK=Float64Array.BYTES_PER_ELEMENT;function Mbt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),u=0;for(let v=0;v<r;++v)u+=c.getUint32(u,!0),u+=oTe;u+=oTe,u+=2*qK;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=qK;let h=P.toRadians(c.getFloat64(u,!0)*180);u+=qK;let p=i.width/f/2,_=i.height/h/2,m=c.getInt32(u,!0);u+=jK;let x=c.getInt32(u,!0)*3;u+=jK,u+=jK;let b=new Array(m),T=new Array(m),C=new Array(m),A;for(A=0;A<m;++A)b[A]=s+c.getUint8(u++)*p,T[A]=a+c.getUint8(u++)*_,C[A]=c.getFloat32(u,!0)*6371010,u+=Obt;let S=new Array(x);for(A=0;A<x;++A)S[A]=c.getUint16(u,!0),u+=Rbt;for(A=0;A<x;A+=3){let v=S[A],D=S[A+1],O=S[A+2],R=b[v],M=b[D],L=b[O],g=T[v],E=T[D],w=T[O],I=a0.computeBarycentricCoordinates(t,n,R,g,M,E,L,w,sTe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*C[v]+I.y*C[D]+I.z*C[O]}}var AP=kb;var td={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},BH=new Z;function kH(){this._terrainCache={},this._lastTidy=Z.now()}kH.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Z.now()}};kH.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};kH.prototype.tidy=function(){if(Z.now(BH),Z.secondsDifference(BH,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];Z.secondsDifference(BH,r.timestamp)>10&&delete e[o]}Z.clone(BH,this._lastTidy)}};function u0(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new kH,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new pe}Object.defineProperties(u0.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});u0.fromMetadata=function(e,t){if(!e.terrainPresent)throw new re(`The server ${e.url} doesn't have terrain`);let n=new u0(t);return n._metadata=e,n};var Lbt=new yi("decodeGoogleEarthEnterprisePacket");function aTe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===td.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}u0.prototype.requestTileGeometry=function(e,t,n,i){let o=l0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new re("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=td.UNKNOWN);let u=r.get(o);if(l(u)){let T=s.providers[a.terrainProvider];return Promise.resolve(new AP({buffer:u,childTileMask:aTe(o,a,s),credits:l(T)?[T]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===td.NONE)return Promise.reject(new re("Terrain tile doesn't exist"))}else return Promise.resolve(new cc({buffer:new Uint8Array(16*16),width:16,height:16}));let f,h=o,p=-1;switch(c){case td.SELF:p=a.terrainVersion;break;case td.PARENT:h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),p=f.terrainVersion;break;case td.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new re("Terrain tile doesn't exist"));let _=this._terrainPromises,m=this._terrainRequests,x,b;if(l(_[h]))x=_[h],b=m[h];else{b=i;let T=Nbt(this,h,p,b).fetchArrayBuffer();if(!l(T))return;x=T.then(function(C){return l(C)?Lbt.scheduleTask({buffer:C,type:"Terrain",key:s.key},[C]).then(function(A){let S=s.getTileInformationFromQuadKey(h);S.terrainState=td.SELF,r.add(h,A[0]);let v=S.terrainProvider,D=A.length-1;for(let O=0;O<D;++O){let R=h+O.toString(),M=s.getTileInformationFromQuadKey(R);l(M)&&(r.add(R,A[O+1]),M.terrainState=td.PARENT,M.terrainProvider===0&&(M.terrainProvider=v))}}):Promise.reject(new re("Failed to load terrain."))}),_[h]=x,m[h]=b,x=x.finally(function(){delete _[h],delete m[h]})}return x.then(function(){let T=r.get(o);if(l(T)){let C=s.providers[a.terrainProvider];return new AP({buffer:T,childTileMask:aTe(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new re("Failed to load terrain."))}).catch(function(T){return b.state===$n.CANCELLED?(i.state=b.state,Promise.reject(T)):(a.terrainState=td.NONE,Promise.reject(T))})};u0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};u0.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=l0.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===td.NONE)return!1;if((!l(s)||s===td.UNKNOWN)&&(r.terrainState=td.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new nr({throttle:!1,throttleByServer:!0,type:ps.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};u0.prototype.loadTileDataAvailability=function(e,t,n){};function Nbt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var cTe=u0;var Fbt="https://maps.googleapis.com/maps/api/geocode/json",lTe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function YK(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._resource=new Se({url:Fbt,queryParameters:{key:t}}),this._credit=new Ct(lTe,!0)}Object.defineProperties(YK.prototype,{credit:{get:function(){return this._credit}}});YK.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new re(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:se.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:lTe,collapsible:!1}}})};var uTe=YK;var VH={};VH.defaultApiKey=void 0;VH.mapTilesApiEndpoint=new Se({url:"https://tile.googleapis.com/v1/"});VH.getDefaultCredit=function(){return new Ct('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var mS=VH;var pc={};pc.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});pc.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});pc.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});pc.defaultAccessToken=void 0;pc.apiEndpoint=new Se({url:"https://api.bentley.com"});pc.getExports=async function(e){let t=new Se({url:`${pc.apiEndpoint}mesh-export`,headers:{Authorization:`Bearer ${pc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:pc.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);throw n.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${i.error.details[0].code}`):n.statusCode===403?(console.error(i.error.code,i.error.message),new re("Not allowed, forbidden")):n.statusCode===422?new re(`Unprocessable Entity:${i.error.code} ${i.error.message}`):n.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${n.statusCode}`)}};pc.getRealityDataMetadata=async function(e,t){let n=new Se({url:`${pc.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:`Bearer ${pc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);throw i.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${o.error.details[0].code}`):i.statusCode===403?(console.error(o.error.code,o.error.message),new re("Not allowed, forbidden")):i.statusCode===404?new re(`Reality data not found: ${e}, ${t}`):i.statusCode===422?new re(`Unprocessable Entity:${o.error.code} ${o.error.message}`):i.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${i.statusCode}`)}};pc.getRealityDataURL=async function(e,t,n){let i=new Se({url:`${pc.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:`Bearer ${pc.defaultAccessToken}`,Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);throw o.statusCode===401?new re(`Unauthorized, bad token, wrong scopes or headers bad. ${r.error.details[0].code}`):o.statusCode===403?(console.error(r.error.code,r.error.message),new re("Not allowed, forbidden")):o.statusCode===404?new re(`Reality data not found: ${e}, ${t}`):o.statusCode===422?new re(`Unprocessable Entity:${r.error.code} ${r.error.message}`):o.statusCode===429?new re("Too many requests"):new re(`Unknown request failure ${o.statusCode}`)}};var Ma=pc;var EP={};EP.type=void 0;EP.getRequiredDataPoints=he.throwInstantiationError;EP.interpolateOrderZero=he.throwInstantiationError;EP.interpolate=he.throwInstantiationError;var fTe=EP;var Bbt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},f0=Object.freeze(Bbt);function XK(e){this._url=Se.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(XK.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});XK.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Bb.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=se.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=d.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var UH=XK;function kbt(e){if(!Object.values(f0).some(t=>t===e))throw new he(`Invalid geocodeProviderType: "${e}"`)}var dTe=Object.freeze({[f0.GOOGLE]:"google",[f0.BING]:"bing",[f0.DEFAULT]:void 0});function Vbt(e){return dTe[e]}function Ubt(e){return Object.entries(dTe).find(t=>t[1]===e)[0]}function KK(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.geocodeProviderType,f0.DEFAULT),n=y(e.accessToken,zh.defaultAccessToken),i=Se.createIfNeeded(y(e.server,zh.defaultServer));i.appendForwardSlash();let o=zh.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Ct.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new UH(r),this.geocodeProviderType=t}Object.defineProperties(KK.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return Ubt(this._pelias.url.queryParameters.geocoder)},set:function(e){kbt(e);let t={...this._pelias.url.queryParameters,geocoder:Vbt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});KK.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var pS=KK;function zH(){he.throwInstantiationError()}Object.defineProperties(zH.prototype,{ellipsoid:{get:he.throwInstantiationError}});zH.prototype.project=he.throwInstantiationError;zH.prototype.unproject=he.throwInstantiationError;var hTe=zH;function gS(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(gS.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});gS.prototype.findTimeInterval=io.prototype.findTimeInterval;gS.prototype.wrapTime=io.prototype.wrapTime;gS.prototype.clampTime=io.prototype.clampTime;gS.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var mTe=gS;function ZK(e,t,n){e=Se.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new Ct('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(ZK.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});ZK.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:xt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=se.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=d.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var pTe=ZK;var zbt={packedLength:void 0,pack:he.throwInstantiationError,unpack:he.throwInstantiationError},gTe=zbt;var Hbt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:he.throwInstantiationError,unpackInterpolationResult:he.throwInstantiationError},_Te=Hbt;function yTe(){he.throwInstantiationError()}yTe.prototype.getURL=he.throwInstantiationError;var xTe=yTe;function Gbt(e,t,n,i,o,r,s){let a=Ni.numberOfPoints(e,t,o),c,u=n.red,f=n.green,h=n.blue,p=n.alpha,_=i.red,m=i.green,x=i.blue,b=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)r[s++]=z.floatToByte(u),r[s++]=z.floatToByte(f),r[s++]=z.floatToByte(h),r[s++]=z.floatToByte(p);return s}let T=(_-u)/a,C=(m-f)/a,A=(x-h)/a,S=(b-p)/a,v=s;for(c=0;c<a;c++)r[v++]=z.floatToByte(u+c*T),r[v++]=z.floatToByte(f+c*C),r[v++]=z.floatToByte(h+c*A),r[v++]=z.floatToByte(p+c*S);return v}function SP(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,Jt.GEODESIC),this._granularity=y(e.granularity,P.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,ee.default),this._workerName="createSimplePolylineGeometry";let o=1+t.length*d.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+ee.packedLength+3}SP.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};SP.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t);t+=ee.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new SP({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var HH=new Array(2),GH=new Array(2),Wbt={positions:HH,height:GH,ellipsoid:void 0,minDistance:void 0,granularity:void 0};SP.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=P.chordLength(r,s.maximumRadius),c=l(n)&&!i,u,f=t.length,h,p,_,m,x=0;if(o===Jt.GEODESIC||o===Jt.RHUMB){let S,v,D;o===Jt.GEODESIC?(S=P.chordLength(r,s.maximumRadius),v=Ni.numberOfPoints,D=Ni.generateArc):(S=r,v=Ni.numberOfPointsRhumbLine,D=Ni.generateRhumbArc);let O=Ni.extractHeights(t,s),R=Wbt;if(o===Jt.GEODESIC?R.minDistance=a:R.granularity=r,R.ellipsoid=s,c){let M=0;for(u=0;u<f-1;u++)M+=v(t[u],t[u+1],S)+1;h=new Float64Array(M*3),_=new Uint8Array(M*4),R.positions=HH,R.height=GH;let L=0;for(u=0;u<f-1;++u){HH[0]=t[u],HH[1]=t[u+1],GH[0]=O[u],GH[1]=O[u+1];let g=D(R);if(l(n)){let E=g.length/3;m=n[u];for(let w=0;w<E;++w)_[L++]=z.floatToByte(m.red),_[L++]=z.floatToByte(m.green),_[L++]=z.floatToByte(m.blue),_[L++]=z.floatToByte(m.alpha)}h.set(g,x),x+=g.length}}else if(R.positions=t,R.height=O,h=new Float64Array(D(R)),l(n)){for(_=new Uint8Array(h.length/3*4),u=0;u<f-1;++u){let L=t[u],g=t[u+1],E=n[u],w=n[u+1];x=Gbt(L,g,E,w,a,_,x)}let M=n[f-1];_[x++]=z.floatToByte(M.red),_[x++]=z.floatToByte(M.green),_[x++]=z.floatToByte(M.blue),_[x++]=z.floatToByte(M.alpha)}}else{p=c?f*2-2:f,h=new Float64Array(p*3),_=l(n)?new Uint8Array(p*4):void 0;let S=0,v=0;for(u=0;u<f;++u){let D=t[u];if(c&&u>0&&(d.pack(D,h,S),S+=3,m=n[u-1],_[v++]=z.floatToByte(m.red),_[v++]=z.floatToByte(m.green),_[v++]=z.floatToByte(m.blue),_[v++]=z.floatToByte(m.alpha)),c&&u===f-1)break;d.pack(D,h,S),S+=3,l(n)&&(m=n[u],_[v++]=z.floatToByte(m.red),_[v++]=z.floatToByte(m.green),_[v++]=z.floatToByte(m.blue),_[v++]=z.floatToByte(m.alpha))}}let b=new dn;b.position=new ve({componentDatatype:X.DOUBLE,componentsPerAttribute:3,values:h}),l(n)&&(b.color=new ve({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:4,values:_,normalize:!0})),p=h.length/3;let T=(p-1)*2,C=Ne.createTypedArray(p,T),A=0;for(u=0;u<p-1;++u)C[A++]=u,C[A++]=u+1;return new st({attributes:b,indices:C,primitiveType:Me.LINES,boundingSphere:ae.fromPoints(t)})};var bTe=SP;function _S(e){let t=y(e.radius,1),i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new ua(i),this._workerName="createSphereGeometry"}_S.packedLength=ua.packedLength;_S.pack=function(e,t,n){return ua.pack(e._ellipsoidGeometry,t,n)};var jbt=new ua,d0={radius:void 0,radii:new d,vertexFormat:new Ie,stackPartitions:void 0,slicePartitions:void 0};_S.unpack=function(e,t,n){let i=ua.unpack(e,t,jbt);return d0.vertexFormat=Ie.clone(i._vertexFormat,d0.vertexFormat),d0.stackPartitions=i._stackPartitions,d0.slicePartitions=i._slicePartitions,l(n)?(d.clone(i._radii,d0.radii),n._ellipsoidGeometry=new ua(d0),n):(d0.radius=i._radii.x,new _S(d0))};_S.createGeometry=function(e){return ua.createGeometry(e._ellipsoidGeometry)};var TTe=_S;function h0(e){}Object.defineProperties(h0.prototype,{ellipsoid:{get:he.throwInstantiationError},rectangle:{get:he.throwInstantiationError},projection:{get:he.throwInstantiationError}});h0.prototype.getNumberOfXTilesAtLevel=he.throwInstantiationError;h0.prototype.getNumberOfYTilesAtLevel=he.throwInstantiationError;h0.prototype.rectangleToNativeRectangle=he.throwInstantiationError;h0.prototype.tileXYToNativeRectangle=he.throwInstantiationError;h0.prototype.tileXYToRectangle=he.throwInstantiationError;h0.prototype.positionToTileXY=he.throwInstantiationError;var CTe=h0;function qbt(e,t){this.rectangle=e,this.maxLevel=t}function ATe(e){this.ellipsoid=y(e.ellipsoid,ee.default),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}ATe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function Ybt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Xi({ellipsoid:e.ellipsoid});else throw new re(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=ls.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),u=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new qbt(new se(a,c,u,f),h))}}function Xbt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Po.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new re(i)}async function Kbt(e,t,n){try{let i=await t.fetchXML();Ybt(e,i)}catch(i){Xbt(t,i,n)}}function m0(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new pe,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(m0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});m0.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new ATe(t),i=Se.createIfNeeded(e);await Kbt(n,i);let o=new m0(t);return n.build(o),o._resource=i,o};m0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new cc({buffer:bh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Zbt(a,e,t,n),structure:a._terrainDataStructure})})};m0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var ETe=new se;function Zbt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,h=se.intersection(f,s,ETe);l(h)&&(WH(o,f,t*2,n*2,i+1)&&(a|=4),WH(o,f,t*2+1,n*2,i+1)&&(a|=8),WH(o,f,t*2,n*2+1,i+1)&&(a|=1),WH(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function WH(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(se.intersection(r,t,ETe))}m0.prototype.getTileDataAvailable=function(e,t,n){};m0.prototype.loadTileDataAvailability=function(e,t,n){};var STe=m0;function Vb(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,He.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(Vb.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(Vb.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=$bt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});Vb.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};Vb.prototype.isDestroyed=function(){return!1};Vb.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};Vb.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=y(this.epoch,He.MINIMUM_VALUE),s=Z.secondsDifference(o,r),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?y(this.tolerance,1):.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function $bt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var vTe=Vb;var Qbt={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},wTe=Object.freeze(Qbt);function Jbt(e){return e=y(e,y.EMPTY_OBJECT),fS.fromIonAssetId(2426648,{requestVertexNormals:y(e.requestVertexNormals,!1)})}var jH=Jbt;function eTt(e){return e=y(e,y.EMPTY_OBJECT),fS.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1),ellipsoid:ee.WGS84})}var yS=eTt;var tTt=1953029805,nTt=2917034100;function $K(e,t){if($K.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new re("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===tTt||o===nTt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,h=8;for(;s<c;)for(h=(h+8)%24,f=h;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(h=(h+8)%24,f=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}$K.passThroughDataForTesting=!1;var qH=$K;var iTt=new d;function oTt(e,t,n,i){let o=gT(e,t,n,i,iTt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var DTe=oTt;function rTt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var xS=rTt;function sTt(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var ITe=sTt;function aTt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var YH=aTt;var cTt=new d(1,1,1);function QK(e){e=y(e,cTt),this._dimensions=d.clone(e)}Object.defineProperties(QK.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){d.clone(e,this._dimensions)}}});var lTt=new d;QK.prototype.emit=function(e){let t=this._dimensions,n=d.multiplyByScalar(t,.5,lTt),i=P.randomBetween(-n.x,n.x),o=P.randomBetween(-n.y,n.y),r=P.randomBetween(-n.z,n.z);e.position=d.fromElements(i,o,r,e.position),e.velocity=d.normalize(e.position,e.velocity)};var PTe=QK;function Ym(){this.featurePropertiesDirty=!1}Object.defineProperties(Ym.prototype,{featuresLength:{get:function(){he.throwInstantiationError()}},pointsLength:{get:function(){he.throwInstantiationError()}},trianglesLength:{get:function(){he.throwInstantiationError()}},geometryByteLength:{get:function(){he.throwInstantiationError()}},texturesByteLength:{get:function(){he.throwInstantiationError()}},batchTableByteLength:{get:function(){he.throwInstantiationError()}},innerContents:{get:function(){he.throwInstantiationError()}},ready:{get:function(){he.throwInstantiationError()}},tileset:{get:function(){he.throwInstantiationError()}},tile:{get:function(){he.throwInstantiationError()}},url:{get:function(){he.throwInstantiationError()}},batchTable:{get:function(){he.throwInstantiationError()}},metadata:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}},group:{get:function(){he.throwInstantiationError()},set:function(e){he.throwInstantiationError()}}});Ym.prototype.hasProperty=function(e,t){he.throwInstantiationError()};Ym.prototype.getFeature=function(e){he.throwInstantiationError()};Ym.prototype.applyDebugSettings=function(e,t){he.throwInstantiationError()};Ym.prototype.applyStyle=function(e){he.throwInstantiationError()};Ym.prototype.update=function(e,t){he.throwInstantiationError()};Ym.prototype.pick=function(e,t,n){he.throwInstantiationError()};Ym.prototype.isDestroyed=function(){he.throwInstantiationError()};Ym.prototype.destroy=function(){he.throwInstantiationError()};var RTe=Ym;function bS(e,t){this._conditionsExpression=Ge(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,fTt(this,t)}Object.defineProperties(bS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function uTt(e,t){this.condition=e,this.expression=t}function fTt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new uTt(new yd(a,t),new yd(c,t)))}e._runtimeConditions=n}bS.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};bS.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};bS.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) { return ${f}; } @@ -15893,7 +15893,7 @@ ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS { ${r} return ${i}(1.0); } -`,r};_S.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var YH=_S;function p0(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,cTt(this,e)}function cTt(e,t){t=y(Ge(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new yd(o[r],i))}e._meta=n,e._ready=!0}function er(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new yd(String(t));if(typeof t=="string")return new yd(t,n);if(l(t.conditions))return new YH(t,n)}else return;return t}function tr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ge(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(p0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=er(this,e),this._style.show=tr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=er(this,e),this._style.color=tr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=er(this,e),this._style.pointSize=tr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=er(this,e),this._style.pointOutlineColor=tr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=er(this,e),this._style.pointOutlineWidth=tr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=er(this,e),this._style.labelColor=tr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=er(this,e),this._style.labelOutlineColor=tr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=er(this,e),this._style.labelOutlineWidth=tr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=er(this,e),this._style.font=tr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=er(this,e),this._style.labelStyle=tr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=er(this,e),this._style.labelText=tr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=er(this,e),this._style.backgroundColor=tr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=er(this,e),this._style.backgroundPadding=tr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=er(this,e),this._style.backgroundEnabled=tr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=er(this,e),this._style.scaleByDistance=tr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=er(this,e),this._style.translucencyByDistance=tr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=er(this,e),this._style.distanceDisplayCondition=tr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=er(this,e),this._style.heightOffset=tr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=er(this,e),this._style.anchorLineEnabled=tr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=er(this,e),this._style.anchorLineColor=tr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=er(this,e),this._style.image=tr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=er(this,e),this._style.disableDepthTestDistance=tr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=er(this,e),this._style.horizontalOrigin=tr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=er(this,e),this._style.verticalOrigin=tr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=er(this,e),this._style.labelHorizontalOrigin=tr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=er(this,e),this._style.labelVerticalOrigin=tr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});p0.fromUrl=function(e){return Se.createIfNeeded(e).fetchJson(e).then(function(n){return new p0(n)})};p0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};p0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};p0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};p0.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var yS=p0;function CP(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new KE({comparator:CP.comparator})}CP.prototype.addSubtree=function(e){let t=new lTt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};CP.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};CP.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function lTt(e,t){this.subtree=e,this.stamp=t}var XH=CP;function KH(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(KH.prototype,{metadataTable:{get:function(){return this._metadataTable}}});KH.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=fTt(n);let r=await uTt(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let h=0;h<a;++h){let p=o.json.bufferViews[h],_=p.byteOffset,m=_+p.byteLength,b=r[p.buffer].subarray(_,m);s[h]=b}let c=o.json.voxelTable,u=o.json.propertyTables[c],f=new KH(e);return f._metadataTable=new nu({count:u.count,properties:u.properties,class:i.classes[u.class],bufferViews:s}),f};function uTt(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(u){return new Uint8Array(u)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function fTt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Fo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var ZH=KH;function $H(e){e=y(e,y.EMPTY_OBJECT),this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new XH}$H.fromUrl=async function(e){let t=Se.createIfNeeded(e),n=await t.fetchJson();hTt(n);let i=yTt(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=oi(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,u=new aA({metadataJson:a,schema:c}),f=new $H;xTt(f,u,s);let h=new lA(t,o,c),{shape:p,minBounds:_,maxBounds:m,shapeTransform:x,globalTransform:b}=mTt(o);f.shape=p,f.minBounds=_,f.maxBounds=m,f.dimensions=d.unpack(r.dimensions),f.shapeTransform=x,f.globalTransform=b,f.maximumTileCount=dTt(u);let T,C;return l(r.padding)&&(T=d.unpack(r.padding.before),C=d.unpack(r.padding.after)),f.paddingBefore=T,f.paddingAfter=C,f._implicitTileset=h,Ei.unload(i),f};function dTt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(hC.TILESET_TILE_COUNT)}function hTt(e){let t=e.root;if(!l(t.content))throw new re("Root must have content");if(!oi(t.content,"3DTILES_content_voxels"))throw new re("Root tile content must have 3DTILES_content_voxels extension");if(!oi(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new re("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!oi(e,"3DTILES_metadata"))throw new re("Tileset must have a metadata schema")}function mTt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=F.unpack(e.transform):n=F.clone(F.IDENTITY),l(t.box))return gTt(t.box,n);if(l(t.region))return pTt(t.region);if(oi(t,"3DTILES_bounding_volume_cylinder"))return _Tt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new re("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function pTt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=F.fromScale(ee.WGS84.radii),c=new d(t,n,r),u=new d(i,o,s);return{shape:ki.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a,globalTransform:F.clone(F.IDENTITY)}}function gTt(e,t){let n=wn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:ki.BOX,minBounds:d.clone(Cg.DefaultMinBounds),maxBounds:d.clone(Cg.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function _Tt(e,t){let n=wn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:ki.CYLINDER,minBounds:d.clone(Ag.DefaultMinBounds),maxBounds:d.clone(Ag.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function yTt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ei.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ei.getSchemaLoader({schema:i})}function xTt(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([h,p])=>{let{type:_,componentType:m}=p,x=r?.properties[h].min,b=r?.properties[h].max,T=lt.getComponentCount(_),C=PTe(x,T),A=PTe(b,T);return{id:h,type:_,componentType:m,minValue:C,maxValue:A}});e.names=a.map(h=>h.id),e.types=a.map(h=>h.type),e.componentTypes=a.map(h=>h.componentType);let c=a.map(h=>h.minValue),u=a.map(h=>h.maxValue),f=c.some(l);e.minimumValues=f?c:void 0,e.maximumValues=f?u:void 0}function PTe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function bTt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=Hp(o);return await ZH.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function TTt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=Hp(a);return o=await dC.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}$H.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new uA({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),u=c.isSubtreeRoot()&&c.level>0,f=u?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return TTt(this,f).then(function(p){return(u?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?bTt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(_){return p.metadataTable.getPropertyTypedArray(_)})})};var RTe=$H;function QK(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(QK.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});QK.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=d.fromElements(i,o,r,e.position),e.velocity=d.clone(d.UNIT_Z,e.velocity)};var QH=QK;var JK={CUMULUS:0};JK.validate=function(e){return e===JK.CUMULUS};var AP=Object.freeze(JK);function mh(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=d.clone(y(e.position,d.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=d.clone(e.maximumSize),this._scale=new U(this._maximumSize.x,this._maximumSize.y);else{this._scale=U.clone(y(e.scale,new U(20,12)));let n=new d(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=d.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=z.clone(y(e.color,z.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var CTt=mh.SHOW_INDEX=0,ATt=mh.POSITION_INDEX=1,ETt=mh.SCALE_INDEX=2,STt=mh.MAXIMUM_SIZE_INDEX=3,vTt=mh.SLICE_INDEX=4,wTt=mh.BRIGHTNESS_INDEX=5,DTt=mh.COLOR_INDEX=6;mh.NUMBER_OF_PROPERTIES=7;function Ub(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(mh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Ub(this,CTt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),Ub(this,ATt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),Ub(this,ETt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;d.equals(t,e)||(d.clone(e,t),Ub(this,STt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Ub(this,DTt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,Ub(this,vTt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,Ub(this,wTt))}}});mh.prototype._destroy=function(){this._cloudCollection=void 0};var nd=mh;var Bu,JH=new d,ITt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},PTt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},RTt=nd.SHOW_INDEX,OTt=nd.POSITION_INDEX,MTt=nd.SCALE_INDEX,LTt=nd.MAXIMUM_SIZE_INDEX,NTt=nd.SLICE_INDEX,FTt=nd.BRIGHTNESS_INDEX,BTt=nd.NUMBER_OF_PROPERTIES,kTt=nd.COLOR_INDEX;function ph(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(BTt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=d.clone(y(e.noiseOffset,d.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:OTe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function OTe(e){return function(){return JH.x=e._textureSliceWidth,JH.y=e._noiseTextureRows,JH.z=1/e._noiseTextureRows,JH}}Object.defineProperties(ph.prototype,{length:{get:function(){return tZ(this),this._clouds.length}}});function MTe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ph.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,AP.CUMULUS),n;return t===AP.CUMULUS&&(n=new nd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};ph.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ph.prototype.removeAll=function(){MTe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function tZ(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}ph.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};ph.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};ph.prototype.get=function(e){return tZ(this),this._clouds[e]};var VTt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),UTt=new Uint16Array([0,1,2,0,2,3]);function zTt(e){let t=yt.createVertexBuffer({context:e,typedArray:VTt,usage:Fe.STATIC_DRAW}),n=yt.createIndexBuffer({context:e,typedArray:UTt,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT}];return new ti({context:e,attributes:i,indexBuffer:n})}var nZ;function HTt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=yt.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function GTt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=yt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function WTt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=yt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function jTt(e,t,n){let i=[{index:Bu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:Bu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:Bu.packedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:Bu.packedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:Bu.color,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,usage:Fe.STATIC_DRAW}];n&&i.push({index:Bu.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:WTt(e)});let o=n?t:4*t;return new Gg(e,i,o,n)}var eZ=new Hn;function LTe(e,t,n,i){let o,r=n[Bu.positionHighAndScaleX],s=n[Bu.positionLowAndScaleY],a=i.position;Hn.fromCartesian(a,eZ);let c=i.scale,u=eZ.high,f=eZ.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),s(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),s(o+0,f.x,f.y,f.z,c.y),s(o+1,f.x,f.y,f.z,c.y),s(o+2,f.x,f.y,f.z,c.y),s(o+3,f.x,f.y,f.z,c.y))}function NTe(e,t,n,i){let o,r=n[Bu.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function FTe(e,t,n,i){let o,r=n[Bu.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function BTe(e,t,n,i){let o,r=n[Bu.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,u,f)):(o=i._index*4,r(o+0,a,c,u,f),r(o+1,a,c,u,f),r(o+2,a,c,u,f),r(o+3,a,c,u,f))}function qTt(e,t,n,i){LTe(e,t,n,i),NTe(e,t,n,i),FTe(e,t,n,i),BTe(e,t,n,i)}function YTt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=zTt(a),o._spNoise=en.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Ot({context:a,width:r*r/s,height:r*s,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:tt.RGBA,sampler:new $t({wrapS:An.REPEAT,wrapT:An.REPEAT,minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST})});let f=new al({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:OTe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function XTt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=jTt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];qTt(e,t,s,c)}n._vaf.commit(nZ(i))}}var KTt=[];function ZTt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=KTt;u.length=0,(c[OTt]||c[MTt])&&u.push(LTe),(c[RTt]||c[FTt])&&u.push(NTe),(c[LTt]||c[NTt])&&u.push(FTe),c[kTt]&&u.push(BTe);let f=u.length,h=i._vaf.writers,p,_,m;if(a/r>.1){for(p=0;p<a;++p)for(_=s[p],_._dirty=!1,m=0;m<f;++m)u[m](e,t,h,_);i._vaf.commit(nZ(n))}else{for(p=0;p<a;++p){for(_=s[p],_._dirty=!1,m=0;m<f;++m)u[m](e,t,h,_);i._instanced?i._vaf.subCommit(_._index,1):i._vaf.subCommit(_._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function $Tt(e,t,n,i){let o=t.context,r=e,s=new Ue({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Ue({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=en.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Bu}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function QTt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new $e),f.pass=we.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}ph.prototype.update=function(e){if(tZ(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&YTt(this,e,KM,XM),this._instanced=e.context.instancedArrays,Bu=this._instanced?PTt:ITt,nZ=this._instanced?GTt:HTt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?XTt(this,e):r>0&&ZTt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&$Tt(this,e,YM,qM),QTt(this,e))};ph.prototype.isDestroyed=function(){return!1};ph.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),MTe(this._clouds),ue(this)};var kTe=ph;var JTt=P.toRadians(30);function iZ(e){this._angle=y(e,JTt)}Object.defineProperties(iZ.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});iZ.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=d.fromElements(o,r,s,e.velocity),d.normalize(e.velocity,e.velocity),e.position=d.clone(d.ZERO,e.position)};var VTe=iZ;function EP(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } +`,r};bS.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var XH=bS;function p0(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,dTt(this,e)}function dTt(e,t){t=y(Ge(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new yd(o[r],i))}e._meta=n,e._ready=!0}function er(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new yd(String(t));if(typeof t=="string")return new yd(t,n);if(l(t.conditions))return new XH(t,n)}else return;return t}function tr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ge(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(p0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=er(this,e),this._style.show=tr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=er(this,e),this._style.color=tr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=er(this,e),this._style.pointSize=tr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=er(this,e),this._style.pointOutlineColor=tr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=er(this,e),this._style.pointOutlineWidth=tr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=er(this,e),this._style.labelColor=tr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=er(this,e),this._style.labelOutlineColor=tr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=er(this,e),this._style.labelOutlineWidth=tr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=er(this,e),this._style.font=tr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=er(this,e),this._style.labelStyle=tr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=er(this,e),this._style.labelText=tr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=er(this,e),this._style.backgroundColor=tr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=er(this,e),this._style.backgroundPadding=tr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=er(this,e),this._style.backgroundEnabled=tr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=er(this,e),this._style.scaleByDistance=tr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=er(this,e),this._style.translucencyByDistance=tr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=er(this,e),this._style.distanceDisplayCondition=tr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=er(this,e),this._style.heightOffset=tr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=er(this,e),this._style.anchorLineEnabled=tr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=er(this,e),this._style.anchorLineColor=tr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=er(this,e),this._style.image=tr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=er(this,e),this._style.disableDepthTestDistance=tr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=er(this,e),this._style.horizontalOrigin=tr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=er(this,e),this._style.verticalOrigin=tr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=er(this,e),this._style.labelHorizontalOrigin=tr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=er(this,e),this._style.labelVerticalOrigin=tr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});p0.fromUrl=function(e){return Se.createIfNeeded(e).fetchJson(e).then(function(n){return new p0(n)})};p0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};p0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};p0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};p0.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var TS=p0;function vP(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new QE({comparator:vP.comparator})}vP.prototype.addSubtree=function(e){let t=new hTt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};vP.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};vP.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function hTt(e,t){this.subtree=e,this.stamp=t}var KH=vP;function ZH(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(ZH.prototype,{metadataTable:{get:function(){return this._metadataTable}}});ZH.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=pTt(n);let r=await mTt(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let h=0;h<a;++h){let p=o.json.bufferViews[h],_=p.byteOffset,m=_+p.byteLength,b=r[p.buffer].subarray(_,m);s[h]=b}let c=o.json.voxelTable,u=o.json.propertyTables[c],f=new ZH(e);return f._metadataTable=new iu({count:u.count,properties:u.properties,class:i.classes[u.class],bufferViews:s}),f};function mTt(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(u){return new Uint8Array(u)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function pTt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Bo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var $H=ZH;function QH(e){e=y(e,y.EMPTY_OBJECT),this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new KH}QH.fromUrl=async function(e){let t=Se.createIfNeeded(e),n=await t.fetchJson();_Tt(n);let i=CTt(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=ri(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,u=new aA({metadataJson:a,schema:c}),f=new QH;ATt(f,u,s);let h=new lA(t,o,c),{shape:p,minBounds:_,maxBounds:m,shapeTransform:x,globalTransform:b}=yTt(o);f.shape=p,f.minBounds=_,f.maxBounds=m,f.dimensions=d.unpack(r.dimensions),f.shapeTransform=x,f.globalTransform=b,f.maximumTileCount=gTt(u);let T,C;return l(r.padding)&&(T=d.unpack(r.padding.before),C=d.unpack(r.padding.after)),f.paddingBefore=T,f.paddingAfter=C,f._implicitTileset=h,vi.unload(i),f};function gTt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(hC.TILESET_TILE_COUNT)}function _Tt(e){let t=e.root;if(!l(t.content))throw new re("Root must have content");if(!ri(t.content,"3DTILES_content_voxels"))throw new re("Root tile content must have 3DTILES_content_voxels extension");if(!ri(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new re("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ri(e,"3DTILES_metadata"))throw new re("Tileset must have a metadata schema")}function yTt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=F.unpack(e.transform):n=F.clone(F.IDENTITY),l(t.box))return bTt(t.box,n);if(l(t.region))return xTt(t.region);if(ri(t,"3DTILES_bounding_volume_cylinder"))return TTt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new re("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function xTt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=F.fromScale(ee.WGS84.radii),c=new d(t,n,r),u=new d(i,o,s);return{shape:Vi.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a,globalTransform:F.clone(F.IDENTITY)}}function bTt(e,t){let n=wn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Vi.BOX,minBounds:d.clone(Ag.DefaultMinBounds),maxBounds:d.clone(Ag.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function TTt(e,t){let n=wn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Vi.CYLINDER,minBounds:d.clone(Eg.DefaultMinBounds),maxBounds:d.clone(Eg.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function CTt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?vi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):vi.getSchemaLoader({schema:i})}function ATt(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([h,p])=>{let{type:_,componentType:m}=p,x=r?.properties[h].min,b=r?.properties[h].max,T=ct.getComponentCount(_),C=OTe(x,T),A=OTe(b,T);return{id:h,type:_,componentType:m,minValue:C,maxValue:A}});e.names=a.map(h=>h.id),e.types=a.map(h=>h.type),e.componentTypes=a.map(h=>h.componentType);let c=a.map(h=>h.minValue),u=a.map(h=>h.maxValue),f=c.some(l);e.minimumValues=f?c:void 0,e.maximumValues=f?u:void 0}function OTe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function ETt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=Gp(o);return await $H.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function STt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=Gp(a);return o=await dC.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}QH.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new uA({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),u=c.isSubtreeRoot()&&c.level>0,f=u?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return STt(this,f).then(function(p){return(u?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?ETt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(_){return p.metadataTable.getPropertyTypedArray(_)})})};var MTe=QH;function JK(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(JK.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});JK.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=d.fromElements(i,o,r,e.position),e.velocity=d.clone(d.UNIT_Z,e.velocity)};var JH=JK;var eZ={CUMULUS:0};eZ.validate=function(e){return e===eZ.CUMULUS};var wP=Object.freeze(eZ);function mh(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=d.clone(y(e.position,d.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=d.clone(e.maximumSize),this._scale=new U(this._maximumSize.x,this._maximumSize.y);else{this._scale=U.clone(y(e.scale,new U(20,12)));let n=new d(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=d.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=z.clone(y(e.color,z.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var vTt=mh.SHOW_INDEX=0,wTt=mh.POSITION_INDEX=1,DTt=mh.SCALE_INDEX=2,ITt=mh.MAXIMUM_SIZE_INDEX=3,PTt=mh.SLICE_INDEX=4,RTt=mh.BRIGHTNESS_INDEX=5,OTt=mh.COLOR_INDEX=6;mh.NUMBER_OF_PROPERTIES=7;function Ub(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(mh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Ub(this,vTt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),Ub(this,wTt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),Ub(this,DTt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;d.equals(t,e)||(d.clone(e,t),Ub(this,ITt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Ub(this,OTt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,Ub(this,PTt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,Ub(this,RTt))}}});mh.prototype._destroy=function(){this._cloudCollection=void 0};var nd=mh;var ku,e8=new d,MTt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},LTt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},NTt=nd.SHOW_INDEX,FTt=nd.POSITION_INDEX,BTt=nd.SCALE_INDEX,kTt=nd.MAXIMUM_SIZE_INDEX,VTt=nd.SLICE_INDEX,UTt=nd.BRIGHTNESS_INDEX,zTt=nd.NUMBER_OF_PROPERTIES,HTt=nd.COLOR_INDEX;function ph(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(zTt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=d.clone(y(e.noiseOffset,d.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:LTe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function LTe(e){return function(){return e8.x=e._textureSliceWidth,e8.y=e._noiseTextureRows,e8.z=1/e._noiseTextureRows,e8}}Object.defineProperties(ph.prototype,{length:{get:function(){return nZ(this),this._clouds.length}}});function NTe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ph.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,wP.CUMULUS),n;return t===wP.CUMULUS&&(n=new nd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};ph.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ph.prototype.removeAll=function(){NTe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function nZ(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}ph.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};ph.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};ph.prototype.get=function(e){return nZ(this),this._clouds[e]};var GTt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),WTt=new Uint16Array([0,1,2,0,2,3]);function jTt(e){let t=_t.createVertexBuffer({context:e,typedArray:GTt,usage:Fe.STATIC_DRAW}),n=_t.createIndexBuffer({context:e,typedArray:WTt,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:X.FLOAT}];return new ni({context:e,attributes:i,indexBuffer:n})}var iZ;function qTt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=_t.createIndexBuffer({context:e,typedArray:o,usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function YTt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=_t.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Fe.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function XTt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=_t.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Fe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function KTt(e,t,n){let i=[{index:ku.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:ku.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:ku.packedAttribute0,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:ku.packedAttribute1,componentsPerAttribute:4,componentDatatype:X.FLOAT,usage:Fe.STATIC_DRAW},{index:ku.color,componentsPerAttribute:4,componentDatatype:X.UNSIGNED_BYTE,normalize:!0,usage:Fe.STATIC_DRAW}];n&&i.push({index:ku.direction,componentsPerAttribute:2,componentDatatype:X.FLOAT,vertexBuffer:XTt(e)});let o=n?t:4*t;return new Wg(e,i,o,n)}var tZ=new Hn;function FTe(e,t,n,i){let o,r=n[ku.positionHighAndScaleX],s=n[ku.positionLowAndScaleY],a=i.position;Hn.fromCartesian(a,tZ);let c=i.scale,u=tZ.high,f=tZ.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),s(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),s(o+0,f.x,f.y,f.z,c.y),s(o+1,f.x,f.y,f.z,c.y),s(o+2,f.x,f.y,f.z,c.y),s(o+3,f.x,f.y,f.z,c.y))}function BTe(e,t,n,i){let o,r=n[ku.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function kTe(e,t,n,i){let o,r=n[ku.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function VTe(e,t,n,i){let o,r=n[ku.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,u,f)):(o=i._index*4,r(o+0,a,c,u,f),r(o+1,a,c,u,f),r(o+2,a,c,u,f),r(o+3,a,c,u,f))}function ZTt(e,t,n,i){FTe(e,t,n,i),BTe(e,t,n,i),kTe(e,t,n,i),VTe(e,t,n,i)}function $Tt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=jTt(a),o._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Rt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ke.UNSIGNED_BYTE,pixelFormat:tt.RGBA,sampler:new Zt({wrapS:An.REPEAT,wrapT:An.REPEAT,minificationFilter:Kt.NEAREST,magnificationFilter:hi.NEAREST})});let f=new cl({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:LTe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function QTt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=KTt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];ZTt(e,t,s,c)}n._vaf.commit(iZ(i))}}var JTt=[];function eCt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=JTt;u.length=0,(c[FTt]||c[BTt])&&u.push(FTe),(c[NTt]||c[UTt])&&u.push(BTe),(c[kTt]||c[VTt])&&u.push(kTe),c[HTt]&&u.push(VTe);let f=u.length,h=i._vaf.writers,p,_,m;if(a/r>.1){for(p=0;p<a;++p)for(_=s[p],_._dirty=!1,m=0;m<f;++m)u[m](e,t,h,_);i._vaf.commit(iZ(n))}else{for(p=0;p<a;++p){for(_=s[p],_._dirty=!1,m=0;m<f;++m)u[m](e,t,h,_);i._instanced?i._vaf.subCommit(_._index,1):i._vaf.subCommit(_._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function tCt(e,t,n,i){let o=t.context,r=e,s=new Ue({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Ue({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=Qt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:ku}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:ln.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function nCt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new $e),f.pass=we.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}ph.prototype.update=function(e){if(nZ(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&$Tt(this,e,IH,DH),this._instanced=e.context.instancedArrays,ku=this._instanced?LTt:MTt,iZ=this._instanced?YTt:qTt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?QTt(this,e):r>0&&eCt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&tCt(this,e,wH,vH),nCt(this,e))};ph.prototype.isDestroyed=function(){return!1};ph.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),NTe(this._clouds),ue(this)};var UTe=ph;var iCt=P.toRadians(30);function oZ(e){this._angle=y(e,iCt)}Object.defineProperties(oZ.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});oZ.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=d.fromElements(o,r,s,e.velocity),d.normalize(e.velocity,e.velocity),e.position=d.clone(d.ZERO,e.position)};var zTe=oZ;function DP(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } `;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); } `;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); } `;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); } @@ -15914,7 +15914,7 @@ ${r} void main() { out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=to.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(EP.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});EP.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;EP.prototype.isTranslucent=to.prototype.isTranslucent;EP.prototype.getRenderState=to.prototype.getRenderState;var UTe=EP;function e8(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}e8.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new wt({geometry:new Ty({positions:[d.ZERO,d.UNIT_X],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:tn.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new wt({geometry:new Ty({positions:[d.ZERO,d.UNIT_Y],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:tn.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new wt({geometry:new Ty({positions:[d.ZERO,d.UNIT_Z],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:tn.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new is,asynchronous:!1})}this._primitive.update(e)}};e8.prototype.isDestroyed=function(){return!1};e8.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var t8=e8;function eCt(e){this.direction=d.clone(e.direction),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,1)}var zTe=eCt;var n8=`in vec3 v_positionMC; +}`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=no.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(DP.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});DP.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;DP.prototype.isTranslucent=no.prototype.isTranslucent;DP.prototype.getRenderState=no.prototype.getRenderState;var HTe=DP;function t8(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}t8.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new vt({geometry:new Cy({positions:[d.ZERO,d.UNIT_X],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:Jt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new vt({geometry:new Cy({positions:[d.ZERO,d.UNIT_Y],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:Jt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new vt({geometry:new Cy({positions:[d.ZERO,d.UNIT_Z],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:Jt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new is,asynchronous:!1})}this._primitive.update(e)}};t8.prototype.isDestroyed=function(){return!1};t8.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var n8=t8;function oCt(e){this.direction=d.clone(e.direction),this.color=z.clone(y(e.color,z.WHITE)),this.intensity=y(e.intensity,1)}var GTe=oCt;var i8=`in vec3 v_positionMC; in vec3 v_positionEC; in vec2 v_st; @@ -15947,7 +15947,7 @@ void main() out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var i8=`in vec3 position3DHigh; +`;var o8=`in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; @@ -15966,7 +15966,7 @@ void main() gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function zb(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,i8),this._fragmentShaderSource=y(e.fragmentShaderSource,n8),this._renderState=to.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(zb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return zb.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});zb.VERTEX_FORMAT=Ie.POSITION_AND_ST;zb.prototype.getFragmentShaderSource=to.prototype.getFragmentShaderSource;zb.prototype.isTranslucent=to.prototype.isTranslucent;zb.prototype.getRenderState=to.prototype.getRenderState;var HTe=zb;function Vl(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,Vl.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,Vl.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,Vl.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,Vl.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,Vl.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new me,this._nominalFrameRate=new me,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){tCt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){nCt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Vl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Vl.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Vl({scene:e})),e._frameRateMonitor};Object.defineProperties(Vl.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});Vl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Vl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Vl.prototype.isDestroyed=function(){return!1};Vl.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function tCt(e,t){if(e._pauseCount>0)return;let n=Ci();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/jn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/jn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/jn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function nCt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var o8=Vl;var GTe=Ur(VK(),1);function oZ(){this._image=new Image}oZ.prototype.isReady=function(){return!0};oZ.prototype.shouldDiscardImage=function(e){return e===this._image};function Hb(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new At(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new oZ),this._errorEvent=new me}Object.defineProperties(Hb.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});Hb.fromMetadata=function(e,t){if(!e.imageryPresent)throw new re(`The server ${e.url} doesn't have imagery`);let n=new Hb(t);return n._metadata=e,n};Hb.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};Hb.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=l0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let u=new nr({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=iCt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){jH(r.key,u);let f=new Uint8Array(u),h,p=r.protoImagery;if((!l(p)||!p)&&(h=oCt(f)),!l(h)&&(!l(p)||p)){let _=rCt(f);h=_.imageType,f=_.imageData}return!l(h)||!l(f)?o:aC({uint8Array:f,format:h,flipY:!0})})};Hb.prototype.pickFeatures=function(e,t,n,i,o){};function iCt(e,t,n,i,o,r){let s=l0.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function oCt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function rCt(e){let t=GTe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new re("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var WTe=Hb;var sCt=new z(1,1,1,.4),aCt=new z(0,1,0,.05),cCt=new z(0,.5,0,.2);function Gb(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Xi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,sCt),this._glowColor=y(e.glowColor,aCt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,cCt),this._errorEvent=new me,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(Gb.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});Gb.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};Gb.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};Gb.prototype.getTileCredits=function(e,t,n){};Gb.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};Gb.prototype.pickFeatures=function(e,t,n,i,o){};var jTe=Gb;function gh(){}gh._maxDecodingConcurrency=Math.max(Ht.hardwareConcurrency-1,1);gh._decodeTaskProcessor=new _i("decodeI3S",gh._maxDecodingConcurrency);gh._promise=void 0;async function lCt(){if(await gh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return gh._decodeTaskProcessor;throw new re("I3S decoder could not be initialized.")}gh.decode=async function(e,t,n,i,o){return l(gh._promise)||(gh._promise=lCt()),gh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let h=$.fromRotationX(-P.PI_OVER_TWO),p=new $;$.multiply(h,a,p);let _=fe.fromDegrees(c,u,f),m=ee.WGS84.cartographicToCartesian(_),x={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ee.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:_,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(x)})};var r8=gh;function rZ(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(rZ.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});rZ.prototype.load=async function(){return this._data=await Ym.loadJson(this._resource),this._data};var s8=rZ;function wg(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(wg.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function a8(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function uCt(e){return e==="String"?1:a8(e)}async function fCt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}wg.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=fCt(this).catch(function(e){console.error(e)}),this._loadPromise)};wg.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};wg.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};wg.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[o].push(c)}}}};wg.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=a8(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=a8(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};wg.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=uCt(i.valueType)}if(e.byteLength<t)throw new re(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};wg.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new re(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=a8(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new re(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new re(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new re(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var c8=wg;function SP(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(SP.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});SP.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var dCt=new d,hCt=new d,mCt=new d,pCt=new d,gCt=new d;function sZ(e,t,n,i){let o=d.subtract(i,n,dCt),r=d.cross(o,d.subtract(e,n,hCt),pCt),s=d.cross(o,d.subtract(t,n,mCt),gCt);return d.dot(r,s)>=0}var _Ct=new d,yCt=new d,xCt=new d,bCt=new d,TCt=new d,CCt=new d,ACt=new d,ECt=new d,SCt=new d,vCt=new d;SP.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new d(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,h;l(f)?h=f.length:h=u.length/3;for(let p=0;p<h;p++){let _,m,x;l(f)?(_=f[p],m=f[p+1],x=f[p+2]):(_=p*3,m=p*3+1,x=p*3+2);let b=d.fromElements(u[_*3],u[_*3+1],u[_*3+2],_Ct),T=d.fromElements(u[m*3],u[m*3+1],u[m*3+2],yCt),C=new d(u[x*3],u[x*3+1],u[x*3+2],xCt);if(!sZ(i,b,T,C)||!sZ(i,T,b,C)||!sZ(i,C,b,T))continue;let A=d.subtract(T,b,bCt),S=d.subtract(C,b,TCt),v=d.cross(A,S,CCt);if(d.magnitude(v)===0)continue;let D=d.normalize(v,ACt),O=d.subtract(i,b,ECt),R=Math.abs(d.dot(O,D));if(R<o){o=R,r=p;let M=d.magnitudeSquared(d.subtract(i,b,O)),L=d.magnitudeSquared(d.subtract(i,T,SCt)),g=d.magnitudeSquared(d.subtract(i,C,vCt));M<L&&M<g?(a=_,c=b,s=M):L<g?(a=m,c=T,s=L):(a=x,c=C,s=g)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:d.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function qTe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(gS(e[i])):t.push(e[i]);return t}SP.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,h="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let A=this._parent._data.mesh.material.definition;if(A>=0&&A<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[A],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let S="0";if(l(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let D=this._layer._data.textureSetDefinitions[v];for(let O=0;O<D.formats.length;O++){let R=D.formats[O];if(R.format==="jpg"){S=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(h=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${S}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=qTe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=qTe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],_=[],m=[];u&&(p=[{sampler:0,source:0}],_=[{uri:h}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let x=[],b=n.length;for(let C=0;C<b;C++){let A=n[C].primitives,S=A.length;for(let v=0;v<S;v++){let D=A[v];if(l(D.material)){for(;D.material>=x.length;){let R=Ge(c,!0);x.push(R)}let O=x[D.material];l(D.extra)&&D.extra.isTransparent?l(O.alphaMode)||(O.alphaMode="BLEND"):O.alphaMode==="BLEND"&&(O.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:x,textures:p,images:_,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var vP=SP;function pc(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(pc.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});pc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Nd(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Ym.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function YTe(e,t){let n=new c8(e,t);return e._fields[t.name]=n,n.load()}pc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(YTe(this,i))}return Promise.all(t)};pc.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return YTe(this,o)}return Promise.resolve()};pc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};pc.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};pc.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new pc(e,y(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};pc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new vP(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new vP(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};pc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new s8(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};pc.prototype._clearGeometryData=function(){this._geometryData=[]};pc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=fe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=fe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let T=0;T<this._dataProvider._geoidDataList.length;T++){let C=this._dataProvider._geoidDataList[T],A=C.projection.project(n);if(A.x>C.nativeExtent.west&&A.x<C.nativeExtent.east&&A.y>C.nativeExtent.south&&A.y<C.nativeExtent.north){n.height+=PCt(A.x,A.y,C);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ee.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ee.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let T=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/T}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let T=this._data.lodThreshold;s=r/T}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let T=0;T<this._data.lodSelection.length;T++)this._data.lodSelection[T].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[T].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Ha(0,0,0),u=Mt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Oe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),h=$.inverse(f,new $),p=new F(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),_=F.inverse(p,new F),m=F.clone(p);l(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=_,this._inverseRotationMatrix=h;let x=[];for(let T=0;T<this._children.length;T++)x.push(this._children[T]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};pc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};pc.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await r8.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function wCt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function DCt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function XTe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await wCt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!DCt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}pc.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=XTe(this,t);e.push(n)}return Promise.all(e)};Nd.prototype._hookedRequestContent=Nd.prototype.requestContent;Nd.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new Se({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{XTe(e._i3sNode,n)})),e._isLoading=!1,t})}};function ICt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function l8(e,t,n,i){let o=e+t*n;return i[o]}function PCt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=l8(s,a,n.width,n.buffer),h=l8(c,a,n.width,n.buffer),p=l8(s,u,n.width,n.buffer),_=l8(c,u,n.width,n.buffer),m=ICt(o,r,f,h,p,_);return m=m*n.scale+n.offset,m}Object.defineProperties(Nd.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var wP=pc;function u8(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(u8.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function aZ(e,t){let n=[];for(let i=0;i<e.length;i++){let o=z.byteToFloat(e[i]);i<3?n.push(gS(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function xS(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=aZ(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=aZ(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=aZ(a.color,a.transparency)))}break}}return n}function RCt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=xS(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let h=0;h<u.length;h++){let p=u[h];h===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=xS(o.symbol,t)}return n}}function OCt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=y(o.classMaxValue,o.classMinValue),a=y(r.classMaxValue,r.classMinValue);return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(xS(r.symbol,t)))}return i.symbols.push(void 0),i}}u8.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=xS(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=xS(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=RCt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=xS(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=OCt(i,n))}};function KTe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?KTe(s,t,n,i):s}}function MCt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function LCt(e,t,n){let i=t[n],o=MCt(e.ranges,i);return e.symbols[o]}u8.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>KTe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>LCt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var f8=u8;function Ul(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Se({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Ul.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Ul.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new re(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new f8(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Ul.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};Ul.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Ul.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new wP(this,t,!0)}else this._rootNode=new wP(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Ul.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};Ul._fetchJson=function(e){return e.fetchJson()};Ul.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Ul._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Ul.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=se.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=se.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Ul.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Ge(e):{},e.outlineColor=z.fromCartesian4(oe.fromArray(o))),this._tileset=await Cs.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};Ul.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Ul.prototype.filterByAttributes=function(e){this._filters=l(e)?Ge(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var bS=Ul;function d8(e,t){this._dataProvider=e,this._resource=new Se({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(d8.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});d8.prototype.load=async function(){return this._data=await Ym.loadJson(this._resource),this._data};d8.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var h8=d8;function DP(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=y(n.visibility,!0),this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(DP.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});DP._fromData=async function(e,t,n,i){let o=new DP(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let u=DP._fromData(e,t,r[c],o);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Se({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Ym.loadJson(o._resource),c=new bS(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var m8=DP;var QTe=Ur(ZTe(),1);function fs(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=y(e.showFeatures,!1),this._adjustMaterialAlphaMode=y(e.adjustMaterialAlphaMode,!1),this._applySymbology=y(e.applySymbology,!1),this._calculateNormals=y(e.calculateNormals,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(fs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});fs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};fs.prototype.isDestroyed=function(){return!1};fs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};fs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};fs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};fs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function NCt(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function $Te(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=NCt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=m8._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new h8(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=se.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new bS(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}fs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await fs.loadJson(n),o=new fs(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=$Te(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await $Te(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};fs._fetchJson=function(e){return e.fetchJson()};fs.loadJson=async function(e){let t=await fs._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new re(t.error)}return t};fs.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new re(`Failed to load binary: ${e.url}`);return t};fs.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var FCt=new U;function BCt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=fe.fromRadians(t.west,t.north),a=fe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let h=c.x;h<=u.x;h++)for(let p=c.y;p<=u.y;p++){let _=U.fromElements(h,p,FCt),m=_.toString();if(!o.hasOwnProperty(m)){let x={x:_.x,y:_.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=x,i.push(x)}}let f=[];for(let h=0;h<i.length;++h){let p=i[h],_=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(_)}return Promise.all(f).then(function(h){let p=[];for(let _=0;_<h.length;_++){let m={tilingScheme:n,x:i[_].x,y:i[_].y,level:i[_].level},x=h[_],b="Geographic";n._projection instanceof Oi&&(b="WebMercator");let T={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===nh.LERC){let C=QTe.default.decode(x._buffer);T.buffer=C.pixels[0]}else T.buffer=x._buffer;p.push(T)}return p})}async function kCt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await BCt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}fs.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=kCt(this),this._geoidDataPromise)};fs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?se.union(e,n,e):e=se.clone(n)}this._extent=e};fs.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};fs.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};fs.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Ym=fs;var cZ={};cZ.createTilesetFromIModelId=async function(e,t){let{exports:n}=await td.getExports(e);if(n.length>0&&n.every(a=>a.status===td.ExportStatus.Invalid))throw new re(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===td.ExportStatus.Complete);if(!l(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new Se({url:r});return Cs.fromUrl(s,t)};cZ.createTilesetForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await td.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![td.RealityDataType.Cesium3DTiles,td.RealityDataType.PNTS,td.RealityDataType.RealityMesh3DTiles,td.RealityDataType.Terrain3DTiles].includes(n))throw new re(`Reality data type is not a mesh type: ${n}`);let r=await td.getRealityDataURL(e,t,i);return Cs.fromUrl(r,{maximumScreenSpaceError:4})};var JTe=cZ;function eCe(){}Object.defineProperties(eCe.prototype,{color:{get:he.throwInstantiationError},intensity:{get:he.throwInstantiationError}});var tCe=eCe;var VCt=/\/$/,nCe=new At('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function TS(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Se.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();VCt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new At(c))):c=nCe,this._resource=i,this._imageryProvider=new cc({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(TS.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});TS.prototype.getTileCredits=function(e,t,n){};TS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};TS.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};TS._defaultCredit=nCe;var iCe=TS;function lZ(e){}lZ.prototype.isReady=function(){return!0};lZ.prototype.shouldDiscardImage=function(e){return!1};var oCe=lZ;var UCt=new At("MapQuest, Open Street Map and contributors, CC-BY-SA");function g8(e){e=y(e,y.EMPTY_OBJECT);let t=Se.createIfNeeded(y(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${y(e.fileExtension,"png")}`;let n=new us({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(se.southwest(a),r),u=n.positionToTileXY(se.northeast(a),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),h=y(e.credit,UCt);typeof h=="string"&&(h=new At(h)),cc.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(g8.prototype=Object.create(cc.prototype),g8.prototype.constructor=g8);var g0=g8;var zCt=new U(1,1);function uZ(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=d.clone(y(e.position,d.ZERO)),this.velocity=d.clone(y(e.velocity,d.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=z.clone(y(e.startColor,z.WHITE)),this.endColor=z.clone(y(e.endColor,z.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=U.clone(y(e.imageSize,zCt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(uZ.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var rCe=new d;uZ.prototype.update=function(e,t){return d.multiplyByScalar(this.velocity,e,rCe),d.add(this.position,rCe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var IP=uZ;function sCe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(sCe.prototype,{complete:{get:function(){return this._complete}}});var aCe=sCe;function cCe(e){}cCe.prototype.emit=function(e){he.throwInstantiationError()};var lCe=cCe;var uCe=new U(1,1);function PP(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new QH(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._emitterModelMatrix=F.clone(y(e.emitterModelMatrix,F.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=z.clone(y(e.color,y(e.startColor,z.WHITE))),this._endColor=z.clone(y(e.color,y(e.endColor,z.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=U.clone(y(e.imageSize,y(e.minimumImageSize,uCe))),this._maximumImageSize=U.clone(y(e.imageSize,y(e.maximumImageSize,uCe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new me,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(PP.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function HCt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let h=0;h<f;++h){let p=new IP;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function GCt(e){let t=e._particlePool.pop();return l(t)||(t=new IP),t}function WCt(e,t){e._particlePool.push(t)}function jCt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function qCt(e){l(e._billboard)&&(e._billboard.show=!1)}function fCe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,o,r,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function YCt(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);d.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function XCt(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var _8=new d;PP.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Tf),this._updateParticlePool&&(HCt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=Z.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?fCe(this,s):(qCt(s),WCt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=XCt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)s=GCt(this),this._emitter.emit(s),d.add(s.position,s.velocity,_8),F.multiplyByPoint(u,_8,_8),s.position=F.multiplyByPoint(u,s.position,s.position),d.subtract(_8,s.position,s.velocity),d.normalize(s.velocity,s.velocity),YCt(this,s),fCe(this,s)}if(this._billboardCollection.update(e),this._previousTime=Z.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&jCt(this)};PP.prototype.isDestroyed=function(){return!1};PP.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var dCe=PP;function ku(){he.throwInstantiationError()}ku.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(ku.prototype,{quadtree:{get:he.throwInstantiationError,set:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError}});ku.prototype.update=he.throwInstantiationError;ku.prototype.beginUpdate=he.throwInstantiationError;ku.prototype.endUpdate=he.throwInstantiationError;ku.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;ku.prototype.loadTile=he.throwInstantiationError;ku.prototype.computeTileVisibility=he.throwInstantiationError;ku.prototype.showTileThisFrame=he.throwInstantiationError;ku.prototype.computeDistanceToTile=he.throwInstantiationError;ku.prototype.isDestroyed=he.throwInstantiationError;ku.prototype.destroy=he.throwInstantiationError;var hCe=ku;function fZ(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(fZ.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});fZ.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=d.fromElements(o,r,s,e.position),e.velocity=d.normalize(e.position,e.velocity)};var mCe=fZ;function RP(){}RP.prototype.evaluate=function(e,t){he.throwInstantiationError()};RP.prototype.evaluateColor=function(e,t){he.throwInstantiationError()};RP.prototype.getShaderFunction=function(e,t,n,i){he.throwInstantiationError()};RP.prototype.getVariables=function(){he.throwInstantiationError()};var pCe=RP;function CS(e){this._ready=!1,this._provider=void 0,this._errorEvent=new me,this._readyEvent=new me,ZCt(this,e)}Object.defineProperties(CS.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});CS.fromWorldTerrain=function(e){return new CS(pS(e))};CS.fromWorldBathymetry=function(e){return new CS(WH(e))};function KCt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function ZCt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){KCt(e._errorEvent,i)}}var y8=CS;function AS(){}AS.prototype.boundingVolume=void 0;AS.prototype.boundingSphere=void 0;AS.prototype.distanceToCamera=function(e){he.throwInstantiationError()};AS.prototype.intersectPlane=function(e){he.throwInstantiationError()};AS.prototype.createDebugVolume=function(e){he.throwInstantiationError()};var gCe=AS;function OP(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Xi({ellipsoid:e.ellipsoid}),this._color=y(e.color,z.YELLOW),this._errorEvent=new me,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(OP.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});OP.prototype.getTileCredits=function(e,t,n){};OP.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};OP.prototype.pickFeatures=function(e,t,n,i,o){};var x8=OP;function dZ(e){he.throwInstantiationError()}dZ.prototype.isReady=he.throwInstantiationError;dZ.prototype.shouldDiscardImage=he.throwInstantiationError;var _Ce=dZ;var $Ct={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},yCe=Object.freeze($Ct);function b8(e,t){this.show=!0,l(e)||(e=new qe),this.rectangle=qe.clone(e),l(t)||(t=Yi.fromType(Yi.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}b8.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!qe.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:un.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Ue({sources:[this._material.shaderSource,wL]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=we.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};b8.prototype.isDestroyed=function(){return!1};b8.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var xCe=b8;function hZ(){he.throwInstantiationError()}Object.defineProperties(hZ.prototype,{globalTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shape:{get:he.throwInstantiationError},minBounds:{get:he.throwInstantiationError},maxBounds:{get:he.throwInstantiationError},dimensions:{get:he.throwInstantiationError},paddingBefore:{get:he.throwInstantiationError},paddingAfter:{get:he.throwInstantiationError},names:{get:he.throwInstantiationError},types:{get:he.throwInstantiationError},componentTypes:{get:he.throwInstantiationError},minimumValues:{get:he.throwInstantiationError},maximumValues:{get:he.throwInstantiationError},maximumTileCount:{get:he.throwInstantiationError},keyframeCount:{get:he.throwInstantiationError},timeIntervalCollection:{get:he.throwInstantiationError}});hZ.prototype.requestData=he.throwInstantiationError;var bCe=hZ;function Wb(){he.throwInstantiationError()}Object.defineProperties(Wb.prototype,{orientedBoundingBox:{get:he.throwInstantiationError},boundingSphere:{get:he.throwInstantiationError},boundTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shaderUniforms:{get:he.throwInstantiationError},shaderDefines:{get:he.throwInstantiationError},shaderMaximumIntersectionsLength:{get:he.throwInstantiationError}});Wb.prototype.update=he.throwInstantiationError;Wb.prototype.computeOrientedBoundingBoxForTile=he.throwInstantiationError;Wb.prototype.computeOrientedBoundingBoxForSample=he.throwInstantiationError;Wb.DefaultMinBounds=he.throwInstantiationError;Wb.DefaultMaxBounds=he.throwInstantiationError;var TCe=Wb;var QCt=new z,JCt=new z,eAt=new z,tAt=new z,CCe=new oe,MP=new Uint8Array(4);function ACe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,o,i)}function T8(e,t){return{height:e,color:z.clone(t)}}function ECe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?z.equals(t.color,i[n-1].color):!1,a=r?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?z.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function nAt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let _=s[n],m=P.clamp(_.height,zl._minimumHeight,zl._maximumHeight),x=z.clone(_.color,QCt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(T8(m,x))}let u=!0,f=!0;for(n=0;n<a-1;n++){let _=c[n+0],m=c[n+1];u=u&&_.height<=m.height,f=f&&_.height>=m.height}f?c=c.reverse():u||Yy(c,function(_,m){return P.sign(_.height-m.height)});let h=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!h&&!p&&(h=!0,p=!0),h&&c.splice(0,0,T8(zl._minimumHeight,c[0].color)),p&&c.splice(c.length,0,T8(zl._maximumHeight,c[c.length-1].color)),c=ECe(c),i.push(c)}return i}function iAt(e){let t=nAt(e),n=[],i=[],o;function r(u,f){n.push(T8(u,f))}function s(u,f,h){let p=z.multiplyByScalar(h,1-f.alpha,tAt);p=z.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,h=0;i=n,n=[];let p=u.length,_=i.length;for(;f<p||h<_;){let m=f<p?u[f]:void 0,x=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,T=h<_?i[h]:void 0,C=h>0?i[h-1]:void 0,A=h<_-1?i[h+1]:void 0;if(l(m)&&l(T)&&m.height===T.height){let S=l(A)&&T.height===A.height,v=!l(C),D=!l(A),O=l(b)&&m.height===b.height,R=!l(x),M=!l(b);S?O?(s(m.height,m.color,T.color),s(m.height,b.color,A.color)):R?(r(m.height,T.color),s(m.height,m.color,A.color)):M?(s(m.height,m.color,T.color),r(m.height,A.color)):(s(m.height,m.color,T.color),s(m.height,m.color,A.color)):v?O?(r(m.height,m.color),s(m.height,b.color,T.color)):M?(r(m.height,m.color),r(m.height,T.color)):(R||r(m.height,m.color),s(m.height,m.color,T.color)):D?O?(s(m.height,m.color,T.color),r(m.height,b.color)):R?(r(m.height,T.color),r(m.height,m.color)):M?s(m.height,m.color,T.color):(s(m.height,m.color,T.color),r(m.height,m.color)):O?(s(m.height,m.color,T.color),s(m.height,b.color,T.color)):R?(r(m.height,T.color),s(m.height,m.color,T.color)):M?(s(m.height,m.color,T.color),r(m.height,T.color)):s(m.height,m.color,T.color),f+=O?2:1,h+=S?2:1}else if(l(m)&&l(T)&&l(C)&&m.height<T.height){let S=ACe(m.height,C,T,eAt);l(x)?l(b)?s(m.height,m.color,S):(s(m.height,m.color,S),r(m.height,S)):(r(m.height,S),s(m.height,m.color,S)),f++}else if(l(T)&&l(m)&&l(x)&&T.height<m.height){let S=ACe(T.height,x,m,JCt);l(C)?l(A)?s(T.height,S,T.color):(s(T.height,S,T.color),r(T.height,S)):(r(T.height,S),s(T.height,S,T.color)),h++}else l(m)&&(!l(T)||m.height<T.height)?(l(T)&&!l(C)&&!l(b)?(r(m.height,m.color),r(m.height,zl._emptyColor),r(T.height,zl._emptyColor)):(!l(T)&&l(C)&&!l(x)&&(r(C.height,zl._emptyColor),r(m.height,zl._emptyColor)),r(m.height,m.color)),f++):l(T)&&(!l(m)||T.height<m.height)&&(r(T.height,T.color),h++)}}return ECe(n)}function zl(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=iAt(n),r=o.length,s,a,c;if(!zl._useFloatTexture(i)){a=Ke.UNSIGNED_BYTE,c=tt.RGBA,s=new Uint8Array(r*4);for(let _=0;_<r;_++)oe.packFloat(o[_].height,CCe),oe.pack(CCe,s,_*4)}else{a=Ke.FLOAT,c=i.webgl2?tt.RED:tt.LUMINANCE,s=new Float32Array(r);for(let _=0;_<r;_++)s[_]=o[_].height}let f=Ot.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new $t({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Zt.NEAREST,magnificationFilter:di.NEAREST})}),h=new Uint8Array(r*4);for(let _=0;_<r;_++)o[_].color.toBytes(MP),h[_*4+0]=MP[0],h[_*4+1]=MP[1],h[_*4+2]=MP[2],h[_*4+3]=MP[3];let p=Ot.create({context:i,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new $t({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Zt.LINEAR,magnificationFilter:di.LINEAR})});return Yi.fromType("ElevationBand",{heights:f,colors:p})}zl._useFloatTexture=function(e){return e.floatingPointTexture};zl._maximumHeight=5906376425472;zl._minimumHeight=-5906376425472;zl._emptyColor=new z(0,0,0,0);var SCe=zl;async function oAt(e,t){t=y(t,{}),t.cacheBytes=y(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=y(t.maximumCacheOverflowBytes,1024*1024*1024),t.enableCollision=y(t.enableCollision,!0),e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(_s("createGooglePhotorealistic3DTileset(key)","createGooglePhotorealistic3DTileset(key) has been deprecated. It is replaced by createGooglePhotorealistic3DTileset({key}). It will be removed in Cesium 1.126."),e={key:e}),e.onlyUsingWithGoogleGeocoder||xt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=y(e.key,fS.defaultApiKey);if(!l(n))return rAt(t);let i,o=fS.getDefaultCredit();l(o)&&(i=[o]);let r=new Se({url:`${fS.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return Cs.fromUrl(r,t)}var vCe={};async function rAt(e){let i=vCe[2275207];l(i)||(i=af.fromAssetId(2275207),vCe[2275207]=i);let o=await i;return Cs.fromUrl(o,e)}var wCe=oAt;async function sAt(e){let t=await Cs.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new yS({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var DCe=sAt;function aAt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=F.clone(y(e.modelMatrix,F.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new wt({geometry:Nn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Wt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new wt({geometry:Nn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Wt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new wt({geometry:Nn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Wt(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new cn({flat:!0,translucent:!1})})}var ICe=aAt;var PCe=`uniform sampler2D u_depthTexture; +`;function zb(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,o8),this._fragmentShaderSource=y(e.fragmentShaderSource,i8),this._renderState=no.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(zb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return zb.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});zb.VERTEX_FORMAT=Ie.POSITION_AND_ST;zb.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;zb.prototype.isTranslucent=no.prototype.isTranslucent;zb.prototype.getRenderState=no.prototype.getRenderState;var WTe=zb;function zl(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,zl.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,zl.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,zl.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,zl.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,zl.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new pe,this._nominalFrameRate=new pe,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){rCt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){sCt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}zl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};zl.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new zl({scene:e})),e._frameRateMonitor};Object.defineProperties(zl.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});zl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};zl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};zl.prototype.isDestroyed=function(){return!1};zl.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function rCt(e,t){if(e._pauseCount>0)return;let n=Ai();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/qn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function sCt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var r8=zl;var jTe=Ur(UK(),1);function rZ(){this._image=new Image}rZ.prototype.isReady=function(){return!0};rZ.prototype.shouldDiscardImage=function(e){return e===this._image};function Hb(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Xi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new se(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new rZ),this._errorEvent=new pe}Object.defineProperties(Hb.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});Hb.fromMetadata=function(e,t){if(!e.imageryPresent)throw new re(`The server ${e.url} doesn't have imagery`);let n=new Hb(t);return n._metadata=e,n};Hb.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};Hb.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=l0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let u=new nr({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=aCt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){qH(r.key,u);let f=new Uint8Array(u),h,p=r.protoImagery;if((!l(p)||!p)&&(h=cCt(f)),!l(h)&&(!l(p)||p)){let _=lCt(f);h=_.imageType,f=_.imageData}return!l(h)||!l(f)?o:aC({uint8Array:f,format:h,flipY:!0})})};Hb.prototype.pickFeatures=function(e,t,n,i,o){};function aCt(e,t,n,i,o,r){let s=l0.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function cCt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function lCt(e){let t=jTe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new re("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var qTe=Hb;var uCt=new z(1,1,1,.4),fCt=new z(0,1,0,.05),dCt=new z(0,.5,0,.2);function Gb(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Xi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,uCt),this._glowColor=y(e.glowColor,fCt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,dCt),this._errorEvent=new pe,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(Gb.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});Gb.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};Gb.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};Gb.prototype.getTileCredits=function(e,t,n){};Gb.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};Gb.prototype.pickFeatures=function(e,t,n,i,o){};var YTe=Gb;function gh(){}gh._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);gh._decodeTaskProcessor=new yi("decodeI3S",gh._maxDecodingConcurrency);gh._promise=void 0;async function hCt(){if(await gh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return gh._decodeTaskProcessor;throw new re("I3S decoder could not be initialized.")}gh.decode=async function(e,t,n,i,o){return l(gh._promise)||(gh._promise=hCt()),gh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let h=$.fromRotationX(-P.PI_OVER_TWO),p=new $;$.multiply(h,a,p);let _=fe.fromDegrees(c,u,f),m=ee.WGS84.cartographicToCartesian(_),x={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ee.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:_,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(x)})};var s8=gh;function sZ(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(sZ.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});sZ.prototype.load=async function(){return this._data=await Xm.loadJson(this._resource),this._data};var a8=sZ;function Dg(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(Dg.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function c8(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function mCt(e){return e==="String"?1:c8(e)}async function pCt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}Dg.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=pCt(this).catch(function(e){console.error(e)}),this._loadPromise)};Dg.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};Dg.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};Dg.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[o].push(c)}}}};Dg.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=c8(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=c8(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Dg.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=mCt(i.valueType)}if(e.byteLength<t)throw new re(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Dg.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new re(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=c8(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new re(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new re(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new re(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var l8=Dg;function IP(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(IP.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});IP.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var gCt=new d,_Ct=new d,yCt=new d,xCt=new d,bCt=new d;function aZ(e,t,n,i){let o=d.subtract(i,n,gCt),r=d.cross(o,d.subtract(e,n,_Ct),xCt),s=d.cross(o,d.subtract(t,n,yCt),bCt);return d.dot(r,s)>=0}var TCt=new d,CCt=new d,ACt=new d,ECt=new d,SCt=new d,vCt=new d,wCt=new d,DCt=new d,ICt=new d,PCt=new d;IP.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new d(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,h;l(f)?h=f.length:h=u.length/3;for(let p=0;p<h;p++){let _,m,x;l(f)?(_=f[p],m=f[p+1],x=f[p+2]):(_=p*3,m=p*3+1,x=p*3+2);let b=d.fromElements(u[_*3],u[_*3+1],u[_*3+2],TCt),T=d.fromElements(u[m*3],u[m*3+1],u[m*3+2],CCt),C=new d(u[x*3],u[x*3+1],u[x*3+2],ACt);if(!aZ(i,b,T,C)||!aZ(i,T,b,C)||!aZ(i,C,b,T))continue;let A=d.subtract(T,b,ECt),S=d.subtract(C,b,SCt),v=d.cross(A,S,vCt);if(d.magnitude(v)===0)continue;let D=d.normalize(v,wCt),O=d.subtract(i,b,DCt),R=Math.abs(d.dot(O,D));if(R<o){o=R,r=p;let M=d.magnitudeSquared(d.subtract(i,b,O)),L=d.magnitudeSquared(d.subtract(i,T,ICt)),g=d.magnitudeSquared(d.subtract(i,C,PCt));M<L&&M<g?(a=_,c=b,s=M):L<g?(a=m,c=T,s=L):(a=x,c=C,s=g)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:d.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function XTe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(xS(e[i])):t.push(e[i]);return t}IP.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,h="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let A=this._parent._data.mesh.material.definition;if(A>=0&&A<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[A],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let S="0";if(l(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let D=this._layer._data.textureSetDefinitions[v];for(let O=0;O<D.formats.length;O++){let R=D.formats[O];if(R.format==="jpg"){S=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(h=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${S}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=XTe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=XTe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],_=[],m=[];u&&(p=[{sampler:0,source:0}],_=[{uri:h}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let x=[],b=n.length;for(let C=0;C<b;C++){let A=n[C].primitives,S=A.length;for(let v=0;v<S;v++){let D=A[v];if(l(D.material)){for(;D.material>=x.length;){let R=Ge(c,!0);x.push(R)}let O=x[D.material];l(D.extra)&&D.extra.isTransparent?l(O.alphaMode)||(O.alphaMode="BLEND"):O.alphaMode==="BLEND"&&(O.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:x,textures:p,images:_,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var PP=IP;function gc(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(gc.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});gc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Nd(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Xm.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function KTe(e,t){let n=new l8(e,t);return e._fields[t.name]=n,n.load()}gc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(KTe(this,i))}return Promise.all(t)};gc.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return KTe(this,o)}return Promise.resolve()};gc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};gc.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};gc.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new gc(e,y(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};gc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new PP(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new PP(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};gc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new a8(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};gc.prototype._clearGeometryData=function(){this._geometryData=[]};gc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=fe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=fe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let T=0;T<this._dataProvider._geoidDataList.length;T++){let C=this._dataProvider._geoidDataList[T],A=C.projection.project(n);if(A.x>C.nativeExtent.west&&A.x<C.nativeExtent.east&&A.y>C.nativeExtent.south&&A.y<C.nativeExtent.north){n.height+=LCt(A.x,A.y,C);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ee.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ee.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let T=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/T}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let T=this._data.lodThreshold;s=r/T}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let T=0;T<this._data.lodSelection.length;T++)this._data.lodSelection[T].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[T].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Ga(0,0,0),u=Ot.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Oe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),h=$.inverse(f,new $),p=new F(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),_=F.inverse(p,new F),m=F.clone(p);l(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=_,this._inverseRotationMatrix=h;let x=[];for(let T=0;T<this._children.length;T++)x.push(this._children[T]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};gc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};gc.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await s8.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function RCt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function OCt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function ZTe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await RCt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!OCt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}gc.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=ZTe(this,t);e.push(n)}return Promise.all(e)};Nd.prototype._hookedRequestContent=Nd.prototype.requestContent;Nd.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new Se({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{ZTe(e._i3sNode,n)})),e._isLoading=!1,t})}};function MCt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function u8(e,t,n,i){let o=e+t*n;return i[o]}function LCt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=u8(s,a,n.width,n.buffer),h=u8(c,a,n.width,n.buffer),p=u8(s,u,n.width,n.buffer),_=u8(c,u,n.width,n.buffer),m=MCt(o,r,f,h,p,_);return m=m*n.scale+n.offset,m}Object.defineProperties(Nd.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var RP=gc;function f8(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(f8.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function cZ(e,t){let n=[];for(let i=0;i<e.length;i++){let o=z.byteToFloat(e[i]);i<3?n.push(xS(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function CS(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=cZ(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=cZ(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=cZ(a.color,a.transparency)))}break}}return n}function NCt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=CS(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let h=0;h<u.length;h++){let p=u[h];h===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=CS(o.symbol,t)}return n}}function FCt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=y(o.classMaxValue,o.classMinValue),a=y(r.classMaxValue,r.classMinValue);return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(CS(r.symbol,t)))}return i.symbols.push(void 0),i}}f8.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=CS(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=CS(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=NCt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=CS(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=FCt(i,n))}};function $Te(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?$Te(s,t,n,i):s}}function BCt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function kCt(e,t,n){let i=t[n],o=BCt(e.ranges,i);return e.symbols[o]}f8.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>$Te(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>kCt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var d8=f8;function Hl(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Se({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Hl.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Hl.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new re(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new d8(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Hl.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};Hl.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Hl.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new RP(this,t,!0)}else this._rootNode=new RP(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Hl.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};Hl._fetchJson=function(e){return e.fetchJson()};Hl.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Hl._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Hl.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=se.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=se.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Hl.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Ge(e):{},e.outlineColor=z.fromCartesian4(oe.fromArray(o))),this._tileset=await Cs.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};Hl.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Hl.prototype.filterByAttributes=function(e){this._filters=l(e)?Ge(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var AS=Hl;function h8(e,t){this._dataProvider=e,this._resource=new Se({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(h8.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});h8.prototype.load=async function(){return this._data=await Xm.loadJson(this._resource),this._data};h8.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var m8=h8;function OP(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=y(n.visibility,!0),this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(OP.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});OP._fromData=async function(e,t,n,i){let o=new OP(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let u=OP._fromData(e,t,r[c],o);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Se({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Xm.loadJson(o._resource),c=new AS(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var p8=OP;var eCe=Ur(QTe(),1);function fs(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=y(e.showFeatures,!1),this._adjustMaterialAlphaMode=y(e.adjustMaterialAlphaMode,!1),this._applySymbology=y(e.applySymbology,!1),this._calculateNormals=y(e.calculateNormals,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(fs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});fs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};fs.prototype.isDestroyed=function(){return!1};fs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};fs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};fs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};fs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function VCt(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function JTe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=VCt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=p8._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new m8(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=se.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new AS(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}fs.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Se.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await fs.loadJson(n),o=new fs(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=JTe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await JTe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};fs._fetchJson=function(e){return e.fetchJson()};fs.loadJson=async function(e){let t=await fs._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new re(t.error)}return t};fs.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new re(`Failed to load binary: ${e.url}`);return t};fs.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var UCt=new U;function zCt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=fe.fromRadians(t.west,t.north),a=fe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let h=c.x;h<=u.x;h++)for(let p=c.y;p<=u.y;p++){let _=U.fromElements(h,p,UCt),m=_.toString();if(!o.hasOwnProperty(m)){let x={x:_.x,y:_.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=x,i.push(x)}}let f=[];for(let h=0;h<i.length;++h){let p=i[h],_=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(_)}return Promise.all(f).then(function(h){let p=[];for(let _=0;_<h.length;_++){let m={tilingScheme:n,x:i[_].x,y:i[_].y,level:i[_].level},x=h[_],b="Geographic";n._projection instanceof Mi&&(b="WebMercator");let T={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===nh.LERC){let C=eCe.default.decode(x._buffer);T.buffer=C.pixels[0]}else T.buffer=x._buffer;p.push(T)}return p})}async function HCt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await zCt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}fs.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=HCt(this),this._geoidDataPromise)};fs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?se.union(e,n,e):e=se.clone(n)}this._extent=e};fs.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};fs.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};fs.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Xm=fs;var _8={};_8.createTilesetFromIModelId=async function(e,t){let{exports:n}=await Ma.getExports(e);if(n.length>0&&n.every(a=>a.status===Ma.ExportStatus.Invalid))throw new re(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===Ma.ExportStatus.Complete);if(!l(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new Se({url:r});return Cs.fromUrl(s,t)};_8.createTilesetForRealityDataId=async function(e,t,n,i){if(!l(n)||!l(i)){let s=await Ma.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![Ma.RealityDataType.Cesium3DTiles,Ma.RealityDataType.PNTS,Ma.RealityDataType.RealityMesh3DTiles,Ma.RealityDataType.Terrain3DTiles].includes(n))throw new re(`Reality data type is not a mesh type: ${n}`);let r=await Ma.getRealityDataURL(e,t,i);return Cs.fromUrl(r,{maximumScreenSpaceError:4})};_8.createDataSourceForRealityDataId=async function(t,n,i,o){if(!l(i)||!l(o)){let a=await Ma.getRealityDataMetadata(t,n);o=a.rootDocument,i=a.type}if(![Ma.RealityDataType.KML,Ma.RealityDataType.GeoJSON].includes(i))throw new re(`Reality data type is not a data source type: ${i}`);let s=await Ma.getRealityDataURL(t,n,o);return i===Ma.RealityDataType.GeoJSON?oE.load(s):xE.load(s)};var tCe=_8;function nCe(){}Object.defineProperties(nCe.prototype,{color:{get:he.throwInstantiationError},intensity:{get:he.throwInstantiationError}});var iCe=nCe;var GCt=/\/$/,oCe=new Ct('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function ES(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Se.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();GCt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Ct(c))):c=oCe,this._resource=i,this._imageryProvider=new lc({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(ES.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});ES.prototype.getTileCredits=function(e,t,n){};ES.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};ES.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};ES._defaultCredit=oCe;var rCe=ES;function lZ(e){}lZ.prototype.isReady=function(){return!0};lZ.prototype.shouldDiscardImage=function(e){return!1};var sCe=lZ;var WCt=new Ct("MapQuest, Open Street Map and contributors, CC-BY-SA");function y8(e){e=y(e,y.EMPTY_OBJECT);let t=Se.createIfNeeded(y(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${y(e.fileExtension,"png")}`;let n=new us({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(se.southwest(a),r),u=n.positionToTileXY(se.northeast(a),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),h=y(e.credit,WCt);typeof h=="string"&&(h=new Ct(h)),lc.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(y8.prototype=Object.create(lc.prototype),y8.prototype.constructor=y8);var g0=y8;var jCt=new U(1,1);function uZ(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=d.clone(y(e.position,d.ZERO)),this.velocity=d.clone(y(e.velocity,d.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=z.clone(y(e.startColor,z.WHITE)),this.endColor=z.clone(y(e.endColor,z.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=U.clone(y(e.imageSize,jCt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(uZ.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var aCe=new d;uZ.prototype.update=function(e,t){return d.multiplyByScalar(this.velocity,e,aCe),d.add(this.position,aCe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var MP=uZ;function cCe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(cCe.prototype,{complete:{get:function(){return this._complete}}});var lCe=cCe;function uCe(e){}uCe.prototype.emit=function(e){he.throwInstantiationError()};var fCe=uCe;var dCe=new U(1,1);function LP(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new JH(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._emitterModelMatrix=F.clone(y(e.emitterModelMatrix,F.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=z.clone(y(e.color,y(e.startColor,z.WHITE))),this._endColor=z.clone(y(e.color,y(e.endColor,z.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=U.clone(y(e.imageSize,y(e.minimumImageSize,dCe))),this._maximumImageSize=U.clone(y(e.imageSize,y(e.maximumImageSize,dCe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new pe,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(LP.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function qCt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let h=0;h<f;++h){let p=new MP;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function YCt(e){let t=e._particlePool.pop();return l(t)||(t=new MP),t}function XCt(e,t){e._particlePool.push(t)}function KCt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function ZCt(e){l(e._billboard)&&(e._billboard.show=!1)}function hCe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,o,r,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function $Ct(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);d.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function QCt(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var x8=new d;LP.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Cf),this._updateParticlePool&&(qCt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=Z.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?hCe(this,s):(ZCt(s),XCt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=QCt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)s=YCt(this),this._emitter.emit(s),d.add(s.position,s.velocity,x8),F.multiplyByPoint(u,x8,x8),s.position=F.multiplyByPoint(u,s.position,s.position),d.subtract(x8,s.position,s.velocity),d.normalize(s.velocity,s.velocity),$Ct(this,s),hCe(this,s)}if(this._billboardCollection.update(e),this._previousTime=Z.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&KCt(this)};LP.prototype.isDestroyed=function(){return!1};LP.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var mCe=LP;function Vu(){he.throwInstantiationError()}Vu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Vu.prototype,{quadtree:{get:he.throwInstantiationError,set:he.throwInstantiationError},tilingScheme:{get:he.throwInstantiationError},errorEvent:{get:he.throwInstantiationError}});Vu.prototype.update=he.throwInstantiationError;Vu.prototype.beginUpdate=he.throwInstantiationError;Vu.prototype.endUpdate=he.throwInstantiationError;Vu.prototype.getLevelMaximumGeometricError=he.throwInstantiationError;Vu.prototype.loadTile=he.throwInstantiationError;Vu.prototype.computeTileVisibility=he.throwInstantiationError;Vu.prototype.showTileThisFrame=he.throwInstantiationError;Vu.prototype.computeDistanceToTile=he.throwInstantiationError;Vu.prototype.isDestroyed=he.throwInstantiationError;Vu.prototype.destroy=he.throwInstantiationError;var pCe=Vu;function fZ(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(fZ.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});fZ.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=d.fromElements(o,r,s,e.position),e.velocity=d.normalize(e.position,e.velocity)};var gCe=fZ;function NP(){}NP.prototype.evaluate=function(e,t){he.throwInstantiationError()};NP.prototype.evaluateColor=function(e,t){he.throwInstantiationError()};NP.prototype.getShaderFunction=function(e,t,n,i){he.throwInstantiationError()};NP.prototype.getVariables=function(){he.throwInstantiationError()};var _Ce=NP;function SS(e){this._ready=!1,this._provider=void 0,this._errorEvent=new pe,this._readyEvent=new pe,eAt(this,e)}Object.defineProperties(SS.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});SS.fromWorldTerrain=function(e){return new SS(yS(e))};SS.fromWorldBathymetry=function(e){return new SS(jH(e))};function JCt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function eAt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){JCt(e._errorEvent,i)}}var b8=SS;function vS(){}vS.prototype.boundingVolume=void 0;vS.prototype.boundingSphere=void 0;vS.prototype.distanceToCamera=function(e){he.throwInstantiationError()};vS.prototype.intersectPlane=function(e){he.throwInstantiationError()};vS.prototype.createDebugVolume=function(e){he.throwInstantiationError()};var yCe=vS;function FP(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Xi({ellipsoid:e.ellipsoid}),this._color=y(e.color,z.YELLOW),this._errorEvent=new pe,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(FP.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});FP.prototype.getTileCredits=function(e,t,n){};FP.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};FP.prototype.pickFeatures=function(e,t,n,i,o){};var T8=FP;function dZ(e){he.throwInstantiationError()}dZ.prototype.isReady=he.throwInstantiationError;dZ.prototype.shouldDiscardImage=he.throwInstantiationError;var xCe=dZ;var tAt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},bCe=Object.freeze(tAt);function C8(e,t){this.show=!0,l(e)||(e=new qe),this.rectangle=qe.clone(e),l(t)||(t=Yi.fromType(Yi.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}C8.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!qe.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:ln.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Ue({sources:[this._material.shaderSource,PH]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=we.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};C8.prototype.isDestroyed=function(){return!1};C8.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var TCe=C8;function hZ(){he.throwInstantiationError()}Object.defineProperties(hZ.prototype,{globalTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shape:{get:he.throwInstantiationError},minBounds:{get:he.throwInstantiationError},maxBounds:{get:he.throwInstantiationError},dimensions:{get:he.throwInstantiationError},paddingBefore:{get:he.throwInstantiationError},paddingAfter:{get:he.throwInstantiationError},names:{get:he.throwInstantiationError},types:{get:he.throwInstantiationError},componentTypes:{get:he.throwInstantiationError},minimumValues:{get:he.throwInstantiationError},maximumValues:{get:he.throwInstantiationError},maximumTileCount:{get:he.throwInstantiationError},keyframeCount:{get:he.throwInstantiationError},timeIntervalCollection:{get:he.throwInstantiationError}});hZ.prototype.requestData=he.throwInstantiationError;var CCe=hZ;function Wb(){he.throwInstantiationError()}Object.defineProperties(Wb.prototype,{orientedBoundingBox:{get:he.throwInstantiationError},boundingSphere:{get:he.throwInstantiationError},boundTransform:{get:he.throwInstantiationError},shapeTransform:{get:he.throwInstantiationError},shaderUniforms:{get:he.throwInstantiationError},shaderDefines:{get:he.throwInstantiationError},shaderMaximumIntersectionsLength:{get:he.throwInstantiationError}});Wb.prototype.update=he.throwInstantiationError;Wb.prototype.computeOrientedBoundingBoxForTile=he.throwInstantiationError;Wb.prototype.computeOrientedBoundingBoxForSample=he.throwInstantiationError;Wb.DefaultMinBounds=he.throwInstantiationError;Wb.DefaultMaxBounds=he.throwInstantiationError;var ACe=Wb;var nAt=new z,iAt=new z,oAt=new z,rAt=new z,ECe=new oe,BP=new Uint8Array(4);function SCe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,o,i)}function A8(e,t){return{height:e,color:z.clone(t)}}function vCe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?z.equals(t.color,i[n-1].color):!1,a=r?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?z.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function sAt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let _=s[n],m=P.clamp(_.height,Gl._minimumHeight,Gl._maximumHeight),x=z.clone(_.color,nAt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(A8(m,x))}let u=!0,f=!0;for(n=0;n<a-1;n++){let _=c[n+0],m=c[n+1];u=u&&_.height<=m.height,f=f&&_.height>=m.height}f?c=c.reverse():u||Yy(c,function(_,m){return P.sign(_.height-m.height)});let h=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!h&&!p&&(h=!0,p=!0),h&&c.splice(0,0,A8(Gl._minimumHeight,c[0].color)),p&&c.splice(c.length,0,A8(Gl._maximumHeight,c[c.length-1].color)),c=vCe(c),i.push(c)}return i}function aAt(e){let t=sAt(e),n=[],i=[],o;function r(u,f){n.push(A8(u,f))}function s(u,f,h){let p=z.multiplyByScalar(h,1-f.alpha,rAt);p=z.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,h=0;i=n,n=[];let p=u.length,_=i.length;for(;f<p||h<_;){let m=f<p?u[f]:void 0,x=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,T=h<_?i[h]:void 0,C=h>0?i[h-1]:void 0,A=h<_-1?i[h+1]:void 0;if(l(m)&&l(T)&&m.height===T.height){let S=l(A)&&T.height===A.height,v=!l(C),D=!l(A),O=l(b)&&m.height===b.height,R=!l(x),M=!l(b);S?O?(s(m.height,m.color,T.color),s(m.height,b.color,A.color)):R?(r(m.height,T.color),s(m.height,m.color,A.color)):M?(s(m.height,m.color,T.color),r(m.height,A.color)):(s(m.height,m.color,T.color),s(m.height,m.color,A.color)):v?O?(r(m.height,m.color),s(m.height,b.color,T.color)):M?(r(m.height,m.color),r(m.height,T.color)):(R||r(m.height,m.color),s(m.height,m.color,T.color)):D?O?(s(m.height,m.color,T.color),r(m.height,b.color)):R?(r(m.height,T.color),r(m.height,m.color)):M?s(m.height,m.color,T.color):(s(m.height,m.color,T.color),r(m.height,m.color)):O?(s(m.height,m.color,T.color),s(m.height,b.color,T.color)):R?(r(m.height,T.color),s(m.height,m.color,T.color)):M?(s(m.height,m.color,T.color),r(m.height,T.color)):s(m.height,m.color,T.color),f+=O?2:1,h+=S?2:1}else if(l(m)&&l(T)&&l(C)&&m.height<T.height){let S=SCe(m.height,C,T,oAt);l(x)?l(b)?s(m.height,m.color,S):(s(m.height,m.color,S),r(m.height,S)):(r(m.height,S),s(m.height,m.color,S)),f++}else if(l(T)&&l(m)&&l(x)&&T.height<m.height){let S=SCe(T.height,x,m,iAt);l(C)?l(A)?s(T.height,S,T.color):(s(T.height,S,T.color),r(T.height,S)):(r(T.height,S),s(T.height,S,T.color)),h++}else l(m)&&(!l(T)||m.height<T.height)?(l(T)&&!l(C)&&!l(b)?(r(m.height,m.color),r(m.height,Gl._emptyColor),r(T.height,Gl._emptyColor)):(!l(T)&&l(C)&&!l(x)&&(r(C.height,Gl._emptyColor),r(m.height,Gl._emptyColor)),r(m.height,m.color)),f++):l(T)&&(!l(m)||T.height<m.height)&&(r(T.height,T.color),h++)}}return vCe(n)}function Gl(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=aAt(n),r=o.length,s,a,c;if(!Gl._useFloatTexture(i)){a=Ke.UNSIGNED_BYTE,c=tt.RGBA,s=new Uint8Array(r*4);for(let _=0;_<r;_++)oe.packFloat(o[_].height,ECe),oe.pack(ECe,s,_*4)}else{a=Ke.FLOAT,c=i.webgl2?tt.RED:tt.LUMINANCE,s=new Float32Array(r);for(let _=0;_<r;_++)s[_]=o[_].height}let f=Rt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Zt({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Kt.NEAREST,magnificationFilter:hi.NEAREST})}),h=new Uint8Array(r*4);for(let _=0;_<r;_++)o[_].color.toBytes(BP),h[_*4+0]=BP[0],h[_*4+1]=BP[1],h[_*4+2]=BP[2],h[_*4+3]=BP[3];let p=Rt.create({context:i,pixelFormat:tt.RGBA,pixelDatatype:Ke.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new Zt({wrapS:An.CLAMP_TO_EDGE,wrapT:An.CLAMP_TO_EDGE,minificationFilter:Kt.LINEAR,magnificationFilter:hi.LINEAR})});return Yi.fromType("ElevationBand",{heights:f,colors:p})}Gl._useFloatTexture=function(e){return e.floatingPointTexture};Gl._maximumHeight=5906376425472;Gl._minimumHeight=-5906376425472;Gl._emptyColor=new z(0,0,0,0);var wCe=Gl;async function cAt(e,t){t=y(t,{}),t.cacheBytes=y(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=y(t.maximumCacheOverflowBytes,1024*1024*1024),t.enableCollision=y(t.enableCollision,!0),e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(_s("createGooglePhotorealistic3DTileset(key)","createGooglePhotorealistic3DTileset(key) has been deprecated. It is replaced by createGooglePhotorealistic3DTileset({key}). It will be removed in Cesium 1.126."),e={key:e}),e.onlyUsingWithGoogleGeocoder||yt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=y(e.key,mS.defaultApiKey);if(!l(n))return lAt(t);let i,o=mS.getDefaultCredit();l(o)&&(i=[o]);let r=new Se({url:`${mS.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return Cs.fromUrl(r,t)}var DCe={};async function lAt(e){let i=DCe[2275207];l(i)||(i=cf.fromAssetId(2275207),DCe[2275207]=i);let o=await i;return Cs.fromUrl(o,e)}var ICe=cAt;async function uAt(e){let t=await Cs.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,z.WHITE).toCssColorString();n=new TS({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var PCe=uAt;function fAt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=F.clone(y(e.modelMatrix,F.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new vt({geometry:Nn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Gt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new vt({geometry:Nn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Gt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new vt({geometry:Nn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Gt(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new an({flat:!0,translucent:!1})})}var RCe=fAt;var OCe=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; @@ -15980,49 +15980,49 @@ void main() float scale = pow(z_ndc * 0.5 + 0.5, 8.0); out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); } -`;function cAt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,tt.RGBA),this.pixelDatatype=y(e.pixelDatatype,Ke.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Se.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?An.REPEAT:An.CLAMP_TO_EDGE;this.sampler=new $t({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var RCe=cAt;var lAt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},OCe=Object.freeze(lAt);var uAt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},MCe=Object.freeze(uAt);function fAt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${ug(s)} - with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var LCe=fAt;globalThis.CESIUM_VERSION="1.124";var LP;typeof ko<"u"&&(LP=ko);(function(){/*! +`;function dAt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,tt.RGBA),this.pixelDatatype=y(e.pixelDatatype,Ke.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Se.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?An.REPEAT:An.CLAMP_TO_EDGE;this.sampler=new Zt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var MCe=dAt;var hAt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},LCe=Object.freeze(hAt);var mAt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},NCe=Object.freeze(mAt);function pAt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${fg(s)} + with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var FCe=pAt;globalThis.CESIUM_VERSION="1.125";var kP;typeof ko<"u"&&(kP=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) - */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(g,E){return g===null||typeof g in x?g===E:!1}function u(g,E){var w;return function(){w||(w=m.a.setTimeout(function(){w=e,g()},E))}}function f(g,E){var w;return function(){clearTimeout(w),w=m.a.setTimeout(g,E)}}function h(g,E){E&&E!=="change"?E==="beforeChange"?this.pc(g):this.gb(g,E):this.qc(g)}function p(g,E){E!==null&&E.s&&E.s()}function _(g,E){var w=this.qd,I=w[S];I.ra||(this.Qb&&this.mb[E]?(w.uc(E,g,this.mb[E]),this.mb[E]=null,--this.Qb):I.I[E]||w.uc(E,g,I.J?{da:g}:w.$c(g)),g.Ja&&g.gd())}var m=typeof s<"u"?s:{};m.b=function(g,E){for(var w=g.split("."),I=m,N=0;N<w.length-1;N++)I=I[w[N]];I[w[w.length-1]]=E},m.L=function(g,E,w){g[E]=w},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function g(j,K){for(var Q in j)N.call(j,Q)&&K(Q,j[Q])}function E(j,K){if(K)for(var Q in K)N.call(K,Q)&&(j[Q]=K[Q]);return j}function w(j,K){return j.__proto__=K,j}function I(j,K,Q,de){var ye=j[K].match(Y)||[];m.a.D(Q.match(Y),function(ce){m.a.Na(ye,ce,de)}),j[K]=ye.join(" ")}var N=Object.prototype.hasOwnProperty,B={__proto__:[]}instanceof Array,H=typeof Symbol=="function",V={},G={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),g(V,function(j,K){if(K.length)for(var Q=0,de=K.length;Q<de;Q++)G[K[Q]]=j});var k={propertychange:!0},W=n&&function(){for(var j=3,K=n.createElement("div"),Q=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++j+"]><i></i><![endif]-->",Q[0];);return 4<j?j:e}(),Y=/\S+/g,J;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(j,K,Q){for(var de=0,ye=j.length;de<ye;de++)K.call(Q,j[de],de,j)},A:typeof Array.prototype.indexOf=="function"?function(j,K){return Array.prototype.indexOf.call(j,K)}:function(j,K){for(var Q=0,de=j.length;Q<de;Q++)if(j[Q]===K)return Q;return-1},Lb:function(j,K,Q){for(var de=0,ye=j.length;de<ye;de++)if(K.call(Q,j[de],de,j))return j[de];return e},Pa:function(j,K){var Q=m.a.A(j,K);0<Q?j.splice(Q,1):Q===0&&j.shift()},wc:function(j){var K=[];return j&&m.a.D(j,function(Q){0>m.a.A(K,Q)&&K.push(Q)}),K},Mb:function(j,K,Q){var de=[];if(j)for(var ye=0,ce=j.length;ye<ce;ye++)de.push(K.call(Q,j[ye],ye));return de},jb:function(j,K,Q){var de=[];if(j)for(var ye=0,ce=j.length;ye<ce;ye++)K.call(Q,j[ye],ye)&&de.push(j[ye]);return de},Nb:function(j,K){if(K instanceof Array)j.push.apply(j,K);else for(var Q=0,de=K.length;Q<de;Q++)j.push(K[Q]);return j},Na:function(j,K,Q){var de=m.a.A(m.a.bc(j),K);0>de?Q&&j.push(K):Q||j.splice(de,1)},Ba:B,extend:E,setPrototypeOf:w,Ab:B?w:E,P:g,Ga:function(j,K,Q){if(!j)return j;var de={},ye;for(ye in j)N.call(j,ye)&&(de[ye]=K.call(Q,j[ye],ye,j));return de},Tb:function(j){for(;j.firstChild;)m.removeNode(j.firstChild)},Yb:function(j){j=m.a.la(j);for(var K=(j[0]&&j[0].ownerDocument||n).createElement("div"),Q=0,de=j.length;Q<de;Q++)K.appendChild(m.oa(j[Q]));return K},Ca:function(j,K){for(var Q=0,de=j.length,ye=[];Q<de;Q++){var ce=j[Q].cloneNode(!0);ye.push(K?m.oa(ce):ce)}return ye},va:function(j,K){if(m.a.Tb(j),K)for(var Q=0,de=K.length;Q<de;Q++)j.appendChild(K[Q])},Xc:function(j,K){var Q=j.nodeType?[j]:j;if(0<Q.length){for(var de=Q[0],ye=de.parentNode,ce=0,ge=K.length;ce<ge;ce++)ye.insertBefore(K[ce],de);for(ce=0,ge=Q.length;ce<ge;ce++)m.removeNode(Q[ce])}},Ua:function(j,K){if(j.length){for(K=K.nodeType===8&&K.parentNode||K;j.length&&j[0].parentNode!==K;)j.splice(0,1);for(;1<j.length&&j[j.length-1].parentNode!==K;)j.length--;if(1<j.length){var Q=j[0],de=j[j.length-1];for(j.length=0;Q!==de;)j.push(Q),Q=Q.nextSibling;j.push(de)}}return j},Zc:function(j,K){7>W?j.setAttribute("selected",K):j.selected=K},Db:function(j){return j===null||j===e?"":j.trim?j.trim():j.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(j,K){return j=j||"",K.length>j.length?!1:j.substring(0,K.length)===K},vd:function(j,K){if(j===K)return!0;if(j.nodeType===11)return!1;if(K.contains)return K.contains(j.nodeType!==1?j.parentNode:j);if(K.compareDocumentPosition)return(K.compareDocumentPosition(j)&16)==16;for(;j&&j!=K;)j=j.parentNode;return!!j},Sb:function(j){return m.a.vd(j,j.ownerDocument.documentElement)},kd:function(j){return!!m.a.Lb(j,m.a.Sb)},R:function(j){return j&&j.tagName&&j.tagName.toLowerCase()},Ac:function(j){return m.onError?function(){try{return j.apply(this,arguments)}catch(K){throw m.onError&&m.onError(K),K}}:j},setTimeout:function(j,K){return setTimeout(m.a.Ac(j),K)},Gc:function(j){setTimeout(function(){throw m.onError&&m.onError(j),j},0)},B:function(j,K,Q){var de=m.a.Ac(Q);if(Q=k[K],m.options.useOnlyNativeEvents||Q||!o)if(Q||typeof j.addEventListener!="function")if(typeof j.attachEvent<"u"){var ye=function(ge){de.call(j,ge)},ce="on"+K;j.attachEvent(ce,ye),m.a.K.za(j,function(){j.detachEvent(ce,ye)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else j.addEventListener(K,de,!1);else J||(J=typeof o(j).on=="function"?"on":"bind"),o(j)[J](K,de)},Fb:function(j,K){if(!j||!j.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Q;if(m.a.R(j)==="input"&&j.type&&K.toLowerCase()=="click"?(Q=j.type,Q=Q=="checkbox"||Q=="radio"):Q=!1,m.options.useOnlyNativeEvents||!o||Q)if(typeof n.createEvent=="function")if(typeof j.dispatchEvent=="function")Q=n.createEvent(G[K]||"HTMLEvents"),Q.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,j),j.dispatchEvent(Q);else throw Error("The supplied element doesn't support dispatchEvent");else if(Q&&j.click)j.click();else if(typeof j.fireEvent<"u")j.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else o(j).trigger(K)},f:function(j){return m.O(j)?j():j},bc:function(j){return m.O(j)?j.v():j},Eb:function(j,K,Q){var de;K&&(typeof j.classList=="object"?(de=j.classList[Q?"add":"remove"],m.a.D(K.match(Y),function(ye){de.call(j.classList,ye)})):typeof j.className.baseVal=="string"?I(j.className,"baseVal",K,Q):I(j,"className",K,Q))},Bb:function(j,K){var Q=m.a.f(K);(Q===null||Q===e)&&(Q="");var de=m.h.firstChild(j);!de||de.nodeType!=3||m.h.nextSibling(de)?m.h.va(j,[j.ownerDocument.createTextNode(Q)]):de.data=Q,m.a.Ad(j)},Yc:function(j,K){if(j.name=K,7>=W)try{var Q=j.name.replace(/[&<>'"]/g,function(de){return"&#"+de.charCodeAt(0)+";"});j.mergeAttributes(n.createElement("<input name='"+Q+"'/>"),!1)}catch{}},Ad:function(j){9<=W&&(j=j.nodeType==1?j:j.parentNode,j.style&&(j.style.zoom=j.style.zoom))},wd:function(j){if(W){var K=j.style.width;j.style.width=0,j.style.width=K}},Pd:function(j,K){j=m.a.f(j),K=m.a.f(K);for(var Q=[],de=j;de<=K;de++)Q.push(de);return Q},la:function(j){for(var K=[],Q=0,de=j.length;Q<de;Q++)K.push(j[Q]);return K},Da:function(j){return H?Symbol(j):j},Zd:W===6,$d:W===7,W,Lc:function(j,K){for(var Q=m.a.la(j.getElementsByTagName("input")).concat(m.a.la(j.getElementsByTagName("textarea"))),de=typeof K=="string"?function(ge){return ge.name===K}:function(ge){return K.test(ge.name)},ye=[],ce=Q.length-1;0<=ce;ce--)de(Q[ce])&&ye.push(Q[ce]);return ye},Nd:function(j){return typeof j=="string"&&(j=m.a.Db(j))?r&&r.parse?r.parse(j):new Function("return "+j)():null},hc:function(j,K,Q){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(m.a.f(j),K,Q)},Od:function(j,K,Q){Q=Q||{};var de=Q.params||{},ye=Q.includeFields||this.Jc,ce=j;if(typeof j=="object"&&m.a.R(j)==="form")for(var ce=j.action,ge=ye.length-1;0<=ge;ge--)for(var xe=m.a.Lc(j,ye[ge]),De=xe.length-1;0<=De;De--)de[xe[De].name]=xe[De].value;K=m.a.f(K);var Ae=n.createElement("form");Ae.style.display="none",Ae.action=ce,Ae.method="post";for(var ke in K)j=n.createElement("input"),j.type="hidden",j.name=ke,j.value=m.a.hc(m.a.f(K[ke])),Ae.appendChild(j);g(de,function(ze,et){var St=n.createElement("input");St.type="hidden",St.name=ze,St.value=et,Ae.appendChild(St)}),n.body.appendChild(Ae),Q.submitter?Q.submitter(Ae):Ae.submit(),setTimeout(function(){Ae.parentNode.removeChild(Ae)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(g){var E=this;if(arguments.length===1)return function(){return E.apply(g,arguments)};var w=Array.prototype.slice.call(arguments,1);return function(){var I=w.slice(0);return I.push.apply(I,arguments),E.apply(g,I)}}),m.a.g=new function(){var g=0,E="__ko__"+new Date().getTime(),w={},I,N;return m.a.W?(I=function(B,H){var V=B[E];if(!V||V==="null"||!w[V]){if(!H)return e;V=B[E]="ko"+g++,w[V]={}}return w[V]},N=function(B){var H=B[E];return H?(delete w[H],B[E]=null,!0):!1}):(I=function(B,H){var V=B[E];return!V&&H&&(V=B[E]={}),V},N=function(B){return B[E]?(delete B[E],!0):!1}),{get:function(B,H){var V=I(B,!1);return V&&V[H]},set:function(B,H,V){(B=I(B,V!==e))&&(B[H]=V)},Ub:function(B,H,V){return B=I(B,!0),B[H]||(B[H]=V)},clear:N,Z:function(){return g+++E}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function g(H,V){var G=m.a.g.get(H,I);return G===e&&V&&(G=[],m.a.g.set(H,I,G)),G}function E(H){var V=g(H,!1);if(V)for(var V=V.slice(0),G=0;G<V.length;G++)V[G](H);m.a.g.clear(H),m.a.K.cleanExternalData(H),B[H.nodeType]&&w(H.childNodes,!0)}function w(H,V){for(var G=[],k,W=0;W<H.length;W++)if((!V||H[W].nodeType===8)&&(E(G[G.length]=k=H[W]),H[W]!==k))for(;W--&&m.a.A(G,H[W])==-1;);}var I=m.a.g.Z(),N={1:!0,8:!0,9:!0},B={1:!0,9:!0};return{za:function(H,V){if(typeof V!="function")throw Error("Callback must be a function");g(H,!0).push(V)},yb:function(H,V){var G=g(H,!1);G&&(m.a.Pa(G,V),G.length==0&&m.a.g.set(H,I,e))},oa:function(H){return m.u.G(function(){N[H.nodeType]&&(E(H),B[H.nodeType]&&w(H.getElementsByTagName("*")))}),H},removeNode:function(H){m.oa(H),H.parentNode&&H.parentNode.removeChild(H)},cleanExternalData:function(H){o&&typeof o.cleanData=="function"&&o.cleanData([H])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),function(){var g=[0,"",""],E=[1,"<table>","</table>"],w=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],N={thead:E,tbody:E,tfoot:E,tr:[2,"<table><tbody>","</tbody></table>"],td:w,th:w,option:I,optgroup:I},B=8>=m.a.W;m.a.ua=function(H,V){var G;if(o){if(o.parseHTML)G=o.parseHTML(H,V)||[];else if((G=o.clean([H],V))&&G[0]){for(var k=G[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(G=V)||(G=n);var k=G.parentWindow||G.defaultView||t,W=m.a.Db(H).toLowerCase(),Y=G.createElement("div"),J;for(J=(W=W.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&N[W[1]]||g,W=J[0],J="ignored<div>"+J[1]+H+J[2]+"</div>",typeof k.innerShiv=="function"?Y.appendChild(k.innerShiv(J)):(B&&G.body.appendChild(Y),Y.innerHTML=J,B&&Y.parentNode.removeChild(Y));W--;)Y=Y.lastChild;G=m.a.la(Y.lastChild.childNodes)}return G},m.a.Md=function(H,V){var G=m.a.ua(H,V);return G.length&&G[0].parentElement||m.a.Yb(G)},m.a.fc=function(H,V){if(m.a.Tb(H),V=m.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),o)o(H).html(V);else for(var G=m.a.ua(V,H.ownerDocument),k=0;k<G.length;k++)H.appendChild(G[k])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function g(w,I){if(w){if(w.nodeType==8){var N=m.aa.Uc(w.nodeValue);N!=null&&I.push({ud:w,Kd:N})}else if(w.nodeType==1)for(var N=0,B=w.childNodes,H=B.length;N<H;N++)g(B[N],I)}}var E={};return{Xb:function(w){if(typeof w!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return E[I]=w,"<!--[ko_memo:"+I+"]-->"},bd:function(w,I){var N=E[w];if(N===e)throw Error("Couldn't find any memo with ID "+w+". Perhaps it's already been unmemoized.");try{return N.apply(null,I||[]),!0}finally{delete E[w]}},cd:function(w,I){var N=[];g(w,N);for(var B=0,H=N.length;B<H;B++){var V=N[B].ud,G=[V];I&&m.a.Nb(G,I),m.aa.bd(N[B].Kd,G),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(w){return(w=w.match(/^\[ko_memo\:(.*?)\]$/))?w[1]:null}}}(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=function(){function g(){if(N){for(var V=N,G=0,k;H<N;)if(k=I[H++]){if(H>V){if(5e3<=++G){H=N,m.a.Gc(Error("'Too much recursion' after processing "+G+" task groups."));break}V=N}try{k()}catch(W){m.a.Gc(W)}}}}function E(){g(),H=N=I.length=0}var w,I=[],N=0,B=1,H=0;return t.MutationObserver?w=function(V){var G=n.createElement("div");return new MutationObserver(V).observe(G,{attributes:!0}),function(){G.classList.toggle("foo")}}(E):w=n&&"onreadystatechange"in n.createElement("script")?function(V){var G=n.createElement("script");G.onreadystatechange=function(){G.onreadystatechange=null,n.documentElement.removeChild(G),G=null,V()},n.documentElement.appendChild(G)}:function(V){setTimeout(V,0)},{scheduler:w,zb:function(V){return N||m.na.scheduler(E),I[N++]=V,B++},cancel:function(V){V=V-(B-N),V>=H&&V<N&&(I[V]=null)},resetForTesting:function(){var V=N-H;return H=N=I.length=0,V},Sd:g}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(g,E){g.throttleEvaluation=E;var w=null;return m.$({read:g,write:function(I){clearTimeout(w),w=m.a.setTimeout(function(){g(I)},E)}})},rateLimit:function(g,E){var w,I,N;typeof E=="number"?w=E:(w=E.timeout,I=E.method),g.Hb=!1,N=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,g.ub(function(B){return N(B,w,E)})},deferred:function(g,E){if(E!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");g.Hb||(g.Hb=!0,g.ub(function(w){var I,N=!1;return function(){if(!N){m.na.cancel(I),I=m.na.zb(w);try{N=!0,g.notifySubscribers(e,"dirty")}finally{N=!1}}}}))},notify:function(g,E){g.equalityComparer=E=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(g,E,w){this.da=g,this.lc=E,this.mc=w,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(g){this.Jb=g,m.a.K.za(g,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,b),b.qb(this)};var b={qb:function(g){g.U={change:[]},g.sc=1},subscribe:function(g,E,w){var I=this;w=w||"change";var N=new m.ic(I,E?g.bind(E):g,function(){m.a.Pa(I.U[w],N),I.hb&&I.hb(w)});return I.Qa&&I.Qa(w),I.U[w]||(I.U[w]=[]),I.U[w].push(N),N},notifySubscribers:function(g,E){if(E=E||"change",E==="change"&&this.Gb(),this.Wa(E)){var w=E==="change"&&this.ed||this.U[E].slice(0);try{m.u.xc();for(var I=0,N;N=w[I];++I)N.Ib||N.lc(g)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(g){return this.ob()!==g},Gb:function(){++this.sc},ub:function(g){var E=this,w=m.O(E),I,N,B,H,V;E.gb||(E.gb=E.notifySubscribers,E.notifySubscribers=h);var G=g(function(){E.Ja=!1,w&&H===E&&(H=E.nc?E.nc():E());var k=N||V&&E.sb(B,H);V=N=I=!1,k&&E.gb(B=H)});E.qc=function(k,W){W&&E.Ja||(V=!W),E.ed=E.U.change.slice(0),E.Ja=I=!0,H=k,G()},E.pc=function(k){I||(B=k,E.gb(k,"beforeChange"))},E.rc=function(){V=!0},E.gd=function(){E.sb(B,E.v(!0))&&(N=!0)}},Wa:function(g){return this.U[g]&&this.U[g].length},Bd:function(g){if(g)return this.U[g]&&this.U[g].length||0;var E=0;return m.a.P(this.U,function(w,I){w!=="dirty"&&(E+=I.length)}),E},sb:function(g,E){return!this.equalityComparer||!this.equalityComparer(g,E)},toString:function(){return"[object Object]"},extend:function(g){var E=this;return g&&m.a.P(g,function(w,I){var N=m.Ta[w];typeof N=="function"&&(E=N(E,I)||E)}),E}};m.L(b,"init",b.qb),m.L(b,"subscribe",b.subscribe),m.L(b,"extend",b.extend),m.L(b,"getSubscriptionsCount",b.Bd),m.a.Ba&&m.a.setPrototypeOf(b,Function.prototype),m.T.fn=b,m.Qc=function(g){return g!=null&&typeof g.subscribe=="function"&&typeof g.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function g(B){w.push(I),I=B}function E(){I=w.pop()}var w=[],I,N=0;return{xc:g,end:E,cc:function(B){if(I){if(!m.Qc(B))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,B,B.fd||(B.fd=++N))}},G:function(B,H,V){try{return g(),B.apply(H,V||[])}finally{E()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var T=m.a.Da("_latestValue");m.ta=function(g){function E(){return 0<arguments.length?(E.sb(E[T],arguments[0])&&(E.ya(),E[T]=arguments[0],E.xa()),this):(m.u.cc(E),E[T])}return E[T]=g,m.a.Ba||m.a.extend(E,m.T.fn),m.T.fn.qb(E),m.a.Ab(E,C),m.options.deferUpdates&&m.Ta.deferred(E,!0),E};var C={equalityComparer:c,v:function(){return this[T]},xa:function(){this.notifySubscribers(this[T],"spectate"),this.notifySubscribers(this[T])},ya:function(){this.notifySubscribers(this[T],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(C,m.T.fn);var A=m.ta.Ma="__ko_proto__";C[A]=m.ta,m.O=function(g){if((g=typeof g=="function"&&g[A])&&g!==C[A]&&g!==m.o.fn[A])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!g},m.Za=function(g){return typeof g=="function"&&(g[A]===C[A]||g[A]===m.o.fn[A]&&g.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",C),m.L(C,"peek",C.v),m.L(C,"valueHasMutated",C.xa),m.L(C,"valueWillMutate",C.ya),m.Ha=function(g){if(g=g||[],typeof g!="object"||!("length"in g))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return g=m.ta(g),m.a.Ab(g,m.Ha.fn),g.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(g){for(var E=this.v(),w=[],I=typeof g!="function"||m.O(g)?function(H){return H===g}:g,N=0;N<E.length;N++){var B=E[N];if(I(B)){if(w.length===0&&this.ya(),E[N]!==B)throw Error("Array modified during remove; cannot remove item");w.push(B),E.splice(N,1),N--}}return w.length&&this.xa(),w},removeAll:function(g){if(g===e){var E=this.v(),w=E.slice(0);return this.ya(),E.splice(0,E.length),this.xa(),w}return g?this.remove(function(I){return 0<=m.a.A(g,I)}):[]},destroy:function(g){var E=this.v(),w=typeof g!="function"||m.O(g)?function(B){return B===g}:g;this.ya();for(var I=E.length-1;0<=I;I--){var N=E[I];w(N)&&(N._destroy=!0)}this.xa()},destroyAll:function(g){return g===e?this.destroy(function(){return!0}):g?this.destroy(function(E){return 0<=m.a.A(g,E)}):[]},indexOf:function(g){var E=this();return m.a.A(E,g)},replace:function(g,E){var w=this.indexOf(g);0<=w&&(this.ya(),this.v()[w]=E,this.xa())},sorted:function(g){var E=this().slice(0);return g?E.sort(g):E.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(g){m.Ha.fn[g]=function(){var E=this.v();this.ya(),this.zc(E,g,arguments);var w=E[g].apply(E,arguments);return this.xa(),w===E?this:w}}),m.a.D(["slice"],function(g){m.Ha.fn[g]=function(){var E=this();return E[g].apply(E,arguments)}}),m.Pc=function(g){return m.O(g)&&typeof g.remove=="function"&&typeof g.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(g,E){function w(){function Y(){if(V){var J=[].concat(g.v()||[]),j;g.Wa("arrayChange")&&((!N||1<V)&&(N=m.a.Pb(G,J,g.Ob)),j=N),G=J,N=null,V=0,j&&j.length&&g.notifySubscribers(j,"arrayChange")}}I?Y():(I=!0,H=g.subscribe(function(){++V},null,"spectate"),G=[].concat(g.v()||[]),N=null,B=g.subscribe(Y))}if(g.Ob={},E&&typeof E=="object"&&m.a.extend(g.Ob,E),g.Ob.sparse=!0,!g.zc){var I=!1,N=null,B,H,V=0,G,k=g.Qa,W=g.hb;g.Qa=function(Y){k&&k.call(g,Y),Y==="arrayChange"&&w()},g.hb=function(Y){W&&W.call(g,Y),Y!=="arrayChange"||g.Wa("arrayChange")||(B&&B.s(),H&&H.s(),H=B=null,I=!1,G=e)},g.zc=function(Y,J,j){function K(Ae,ke,ze){return Q[Q.length]={status:Ae,value:ke,index:ze}}if(I&&!V){var Q=[],de=Y.length,ye=j.length,ce=0;switch(J){case"push":ce=de;case"unshift":for(J=0;J<ye;J++)K("added",j[J],ce+J);break;case"pop":ce=de-1;case"shift":de&&K("deleted",Y[ce],ce);break;case"splice":J=Math.min(Math.max(0,0>j[0]?de+j[0]:j[0]),de);for(var de=ye===1?de:Math.min(J+(j[1]||0),de),ye=J+ye-2,ce=Math.max(de,ye),ge=[],xe=[],De=2;J<ce;++J,++De)J<de&&xe.push(K("deleted",Y[J],J)),J<ye&&ge.push(K("added",j[De],J));m.a.Kc(xe,ge);break;default:return}N=Q}}}};var S=m.a.Da("_state");m.o=m.$=function(g,E,w){function I(){if(0<arguments.length){if(typeof N=="function")N.apply(B.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return B.ra||m.u.cc(I),(B.ka||B.J&&I.Xa())&&I.ha(),B.X}if(typeof g=="object"?w=g:(w=w||{},g&&(w.read=g)),typeof w.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var N=w.write,B={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:w.read,nb:E||w.owner,l:w.disposeWhenNodeIsRemoved||w.l||null,Sa:w.disposeWhen||w.Sa,Rb:null,I:{},V:0,Ic:null};return I[S]=B,I.Nc=typeof N=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,v),w.pure?(B.wb=!0,B.J=!0,m.a.extend(I,D)):w.deferEvaluation&&m.a.extend(I,O),m.options.deferUpdates&&m.Ta.deferred(I,!0),B.l&&(B.jc=!0,B.l.nodeType||(B.l=null)),B.J||w.deferEvaluation||I.ha(),B.l&&I.ja()&&m.a.K.za(B.l,B.Rb=function(){I.s()}),I};var v={equalityComparer:c,qa:function(){return this[S].V},Va:function(){var g=[];return m.a.P(this[S].I,function(E,w){g[w.Ka]=w.da}),g},Vb:function(g){if(!this[S].V)return!1;var E=this.Va();return m.a.A(E,g)!==-1?!0:!!m.a.Lb(E,function(w){return w.Vb&&w.Vb(g)})},uc:function(g,E,w){if(this[S].wb&&E===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[g]=w,w.Ka=this[S].V++,w.La=E.ob()},Xa:function(){var g,E,w=this[S].I;for(g in w)if(Object.prototype.hasOwnProperty.call(w,g)&&(E=w[g],this.Ia&&E.da.Ja||E.da.Dd(E.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var g=this[S];return g.ka||0<g.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(g){if(g.Hb){var E=g.subscribe(this.Jd,this,"dirty"),w=g.subscribe(this.Rd,this);return{da:g,s:function(){E.s(),w.s()}}}return g.subscribe(this.Hc,this)},Hc:function(){var g=this,E=g.throttleEvaluation;E&&0<=E?(clearTimeout(this[S].Ic),this[S].Ic=m.a.setTimeout(function(){g.ha(!0)},E)):g.Ia?g.Ia(!0):g.ha(!0)},ha:function(g){var E=this[S],w=E.Sa,I=!1;if(!E.rb&&!E.ra){if(E.l&&!m.a.Sb(E.l)||w&&w()){if(!E.jc){this.s();return}}else E.jc=!1;E.rb=!0;try{I=this.zd(g)}finally{E.rb=!1}return I}},zd:function(g){var E=this[S],I=!1,w=E.wb?e:!E.V,I={qd:this,mb:E.I,Qb:E.V};m.u.xc({pd:I,od:_,o:this,Ya:w}),E.I={},E.V=0;var N=this.yd(E,I);return E.V?I=this.sb(E.X,N):(this.s(),I=!0),I&&(E.J?this.Gb():this.notifySubscribers(E.X,"beforeChange"),E.X=N,this.notifySubscribers(E.X,"spectate"),!E.J&&g&&this.notifySubscribers(E.X),this.rc&&this.rc()),w&&this.notifySubscribers(E.X,"awake"),I},yd:function(g,E){try{var w=g.Wc;return g.nb?w.call(g.nb):w()}finally{m.u.end(),E.Qb&&!g.J&&m.a.P(E.mb,p),g.sa=g.ka=!1}},v:function(g){var E=this[S];return(E.ka&&(g||!E.V)||E.J&&this.Xa())&&this.ha(),E.X},ub:function(g){m.T.fn.ub.call(this,g),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(E){this.pc(this[S].X),this[S].ka=!0,E&&(this[S].sa=!0),this.qc(this,!E)}},s:function(){var g=this[S];!g.J&&g.I&&m.a.P(g.I,function(E,w){w.s&&w.s()}),g.l&&g.Rb&&m.a.K.yb(g.l,g.Rb),g.I=e,g.V=0,g.ra=!0,g.sa=!1,g.ka=!1,g.J=!1,g.l=e,g.Sa=e,g.Wc=e,this.Nc||(g.nb=e)}},D={Qa:function(g){var E=this,w=E[S];if(!w.ra&&w.J&&g=="change"){if(w.J=!1,w.sa||E.Xa())w.I=null,w.V=0,E.ha()&&E.Gb();else{var I=[];m.a.P(w.I,function(N,B){I[B.Ka]=N}),m.a.D(I,function(N,B){var H=w.I[N],V=E.$c(H.da);V.Ka=B,V.La=H.La,w.I[N]=V}),E.Xa()&&E.ha()&&E.Gb()}w.ra||E.notifySubscribers(w.X,"awake")}},hb:function(g){var E=this[S];E.ra||g!="change"||this.Wa("change")||(m.a.P(E.I,function(w,I){I.s&&(E.I[w]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),E.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var g=this[S];return g.J&&(g.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},O={Qa:function(g){g!="change"&&g!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(v,m.T.fn);var R=m.ta.Ma;v[R]=m.o,m.Oc=function(g){return typeof g=="function"&&g[R]===v[R]},m.Fd=function(g){return m.Oc(g)&&g[S]&&g[S].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",v),m.L(v,"peek",v.v),m.L(v,"dispose",v.s),m.L(v,"isActive",v.ja),m.L(v,"getDependenciesCount",v.qa),m.L(v,"getDependencies",v.Va),m.xb=function(g,E){return typeof g=="function"?m.o(g,E,{pure:!0}):(g=m.a.extend({},g),g.pure=!0,m.o(g,E))},m.b("pureComputed",m.xb),function(){function g(I,N,B){if(B=B||new w,I=N(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var H=I instanceof Array?[]:{};return B.save(I,H),E(I,function(V){var G=N(I[V]);switch(typeof G){case"boolean":case"number":case"string":case"function":H[V]=G;break;case"object":case"undefined":var k=B.get(G);H[V]=k!==e?k:g(G,N,B)}}),H}function E(I,N){if(I instanceof Array){for(var B=0;B<I.length;B++)N(B);typeof I.toJSON=="function"&&N("toJSON")}else for(B in I)N(B)}function w(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return g(I,function(N){for(var B=0;m.O(N)&&10>B;B++)N=N();return N})},m.toJSON=function(I,N,B){return I=m.ad(I),m.a.hc(I,N,B)},w.prototype={constructor:w,save:function(I,N){var B=m.a.A(this.keys,I);0<=B?this.values[B]=N:(this.keys.push(I),this.values.push(N))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(g,E,w){function I(N){var B=m.xb(g,w).extend({ma:"always"}),H=B.subscribe(function(V){V&&(H.s(),N(V))});return B.notifySubscribers(B.v()),H}return typeof Promise!="function"||E?I(E.bind(w)):new Promise(I)},m.b("when",m.Wd),function(){m.w={M:function(g){switch(m.a.R(g)){case"option":return g.__ko__hasDomDataOptionValue__===!0?m.a.g.get(g,m.c.options.$b):7>=m.a.W?g.getAttributeNode("value")&&g.getAttributeNode("value").specified?g.value:g.text:g.value;case"select":return 0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex]):e;default:return g.value}},cb:function(g,E,w){switch(m.a.R(g)){case"option":typeof E=="string"?(m.a.g.set(g,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in g&&delete g.__ko__hasDomDataOptionValue__,g.value=E):(m.a.g.set(g,m.c.options.$b,E),g.__ko__hasDomDataOptionValue__=!0,g.value=typeof E=="number"?E:"");break;case"select":(E===""||E===null)&&(E=e);for(var I=-1,N=0,B=g.options.length,H;N<B;++N)if(H=m.w.M(g.options[N]),H==E||H===""&&E===e){I=N;break}(w||0<=I||E===e&&1<g.size)&&(g.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){g.selectedIndex=I},0));break;default:(E===null||E===e)&&(E=""),g.value=E}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function g(V){V=m.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=` + */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(g,E){return g===null||typeof g in x?g===E:!1}function u(g,E){var w;return function(){w||(w=m.a.setTimeout(function(){w=e,g()},E))}}function f(g,E){var w;return function(){clearTimeout(w),w=m.a.setTimeout(g,E)}}function h(g,E){E&&E!=="change"?E==="beforeChange"?this.pc(g):this.gb(g,E):this.qc(g)}function p(g,E){E!==null&&E.s&&E.s()}function _(g,E){var w=this.qd,I=w[S];I.ra||(this.Qb&&this.mb[E]?(w.uc(E,g,this.mb[E]),this.mb[E]=null,--this.Qb):I.I[E]||w.uc(E,g,I.J?{da:g}:w.$c(g)),g.Ja&&g.gd())}var m=typeof s<"u"?s:{};m.b=function(g,E){for(var w=g.split("."),I=m,N=0;N<w.length-1;N++)I=I[w[N]];I[w[w.length-1]]=E},m.L=function(g,E,w){g[E]=w},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function g(j,K){for(var Q in j)N.call(j,Q)&&K(Q,j[Q])}function E(j,K){if(K)for(var Q in K)N.call(K,Q)&&(j[Q]=K[Q]);return j}function w(j,K){return j.__proto__=K,j}function I(j,K,Q,de){var xe=j[K].match(Y)||[];m.a.D(Q.match(Y),function(ce){m.a.Na(xe,ce,de)}),j[K]=xe.join(" ")}var N=Object.prototype.hasOwnProperty,B={__proto__:[]}instanceof Array,H=typeof Symbol=="function",V={},G={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),g(V,function(j,K){if(K.length)for(var Q=0,de=K.length;Q<de;Q++)G[K[Q]]=j});var k={propertychange:!0},W=n&&function(){for(var j=3,K=n.createElement("div"),Q=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++j+"]><i></i><![endif]-->",Q[0];);return 4<j?j:e}(),Y=/\S+/g,J;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(j,K,Q){for(var de=0,xe=j.length;de<xe;de++)K.call(Q,j[de],de,j)},A:typeof Array.prototype.indexOf=="function"?function(j,K){return Array.prototype.indexOf.call(j,K)}:function(j,K){for(var Q=0,de=j.length;Q<de;Q++)if(j[Q]===K)return Q;return-1},Lb:function(j,K,Q){for(var de=0,xe=j.length;de<xe;de++)if(K.call(Q,j[de],de,j))return j[de];return e},Pa:function(j,K){var Q=m.a.A(j,K);0<Q?j.splice(Q,1):Q===0&&j.shift()},wc:function(j){var K=[];return j&&m.a.D(j,function(Q){0>m.a.A(K,Q)&&K.push(Q)}),K},Mb:function(j,K,Q){var de=[];if(j)for(var xe=0,ce=j.length;xe<ce;xe++)de.push(K.call(Q,j[xe],xe));return de},jb:function(j,K,Q){var de=[];if(j)for(var xe=0,ce=j.length;xe<ce;xe++)K.call(Q,j[xe],xe)&&de.push(j[xe]);return de},Nb:function(j,K){if(K instanceof Array)j.push.apply(j,K);else for(var Q=0,de=K.length;Q<de;Q++)j.push(K[Q]);return j},Na:function(j,K,Q){var de=m.a.A(m.a.bc(j),K);0>de?Q&&j.push(K):Q||j.splice(de,1)},Ba:B,extend:E,setPrototypeOf:w,Ab:B?w:E,P:g,Ga:function(j,K,Q){if(!j)return j;var de={},xe;for(xe in j)N.call(j,xe)&&(de[xe]=K.call(Q,j[xe],xe,j));return de},Tb:function(j){for(;j.firstChild;)m.removeNode(j.firstChild)},Yb:function(j){j=m.a.la(j);for(var K=(j[0]&&j[0].ownerDocument||n).createElement("div"),Q=0,de=j.length;Q<de;Q++)K.appendChild(m.oa(j[Q]));return K},Ca:function(j,K){for(var Q=0,de=j.length,xe=[];Q<de;Q++){var ce=j[Q].cloneNode(!0);xe.push(K?m.oa(ce):ce)}return xe},va:function(j,K){if(m.a.Tb(j),K)for(var Q=0,de=K.length;Q<de;Q++)j.appendChild(K[Q])},Xc:function(j,K){var Q=j.nodeType?[j]:j;if(0<Q.length){for(var de=Q[0],xe=de.parentNode,ce=0,_e=K.length;ce<_e;ce++)xe.insertBefore(K[ce],de);for(ce=0,_e=Q.length;ce<_e;ce++)m.removeNode(Q[ce])}},Ua:function(j,K){if(j.length){for(K=K.nodeType===8&&K.parentNode||K;j.length&&j[0].parentNode!==K;)j.splice(0,1);for(;1<j.length&&j[j.length-1].parentNode!==K;)j.length--;if(1<j.length){var Q=j[0],de=j[j.length-1];for(j.length=0;Q!==de;)j.push(Q),Q=Q.nextSibling;j.push(de)}}return j},Zc:function(j,K){7>W?j.setAttribute("selected",K):j.selected=K},Db:function(j){return j===null||j===e?"":j.trim?j.trim():j.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(j,K){return j=j||"",K.length>j.length?!1:j.substring(0,K.length)===K},vd:function(j,K){if(j===K)return!0;if(j.nodeType===11)return!1;if(K.contains)return K.contains(j.nodeType!==1?j.parentNode:j);if(K.compareDocumentPosition)return(K.compareDocumentPosition(j)&16)==16;for(;j&&j!=K;)j=j.parentNode;return!!j},Sb:function(j){return m.a.vd(j,j.ownerDocument.documentElement)},kd:function(j){return!!m.a.Lb(j,m.a.Sb)},R:function(j){return j&&j.tagName&&j.tagName.toLowerCase()},Ac:function(j){return m.onError?function(){try{return j.apply(this,arguments)}catch(K){throw m.onError&&m.onError(K),K}}:j},setTimeout:function(j,K){return setTimeout(m.a.Ac(j),K)},Gc:function(j){setTimeout(function(){throw m.onError&&m.onError(j),j},0)},B:function(j,K,Q){var de=m.a.Ac(Q);if(Q=k[K],m.options.useOnlyNativeEvents||Q||!o)if(Q||typeof j.addEventListener!="function")if(typeof j.attachEvent<"u"){var xe=function(_e){de.call(j,_e)},ce="on"+K;j.attachEvent(ce,xe),m.a.K.za(j,function(){j.detachEvent(ce,xe)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else j.addEventListener(K,de,!1);else J||(J=typeof o(j).on=="function"?"on":"bind"),o(j)[J](K,de)},Fb:function(j,K){if(!j||!j.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Q;if(m.a.R(j)==="input"&&j.type&&K.toLowerCase()=="click"?(Q=j.type,Q=Q=="checkbox"||Q=="radio"):Q=!1,m.options.useOnlyNativeEvents||!o||Q)if(typeof n.createEvent=="function")if(typeof j.dispatchEvent=="function")Q=n.createEvent(G[K]||"HTMLEvents"),Q.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,j),j.dispatchEvent(Q);else throw Error("The supplied element doesn't support dispatchEvent");else if(Q&&j.click)j.click();else if(typeof j.fireEvent<"u")j.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else o(j).trigger(K)},f:function(j){return m.O(j)?j():j},bc:function(j){return m.O(j)?j.v():j},Eb:function(j,K,Q){var de;K&&(typeof j.classList=="object"?(de=j.classList[Q?"add":"remove"],m.a.D(K.match(Y),function(xe){de.call(j.classList,xe)})):typeof j.className.baseVal=="string"?I(j.className,"baseVal",K,Q):I(j,"className",K,Q))},Bb:function(j,K){var Q=m.a.f(K);(Q===null||Q===e)&&(Q="");var de=m.h.firstChild(j);!de||de.nodeType!=3||m.h.nextSibling(de)?m.h.va(j,[j.ownerDocument.createTextNode(Q)]):de.data=Q,m.a.Ad(j)},Yc:function(j,K){if(j.name=K,7>=W)try{var Q=j.name.replace(/[&<>'"]/g,function(de){return"&#"+de.charCodeAt(0)+";"});j.mergeAttributes(n.createElement("<input name='"+Q+"'/>"),!1)}catch{}},Ad:function(j){9<=W&&(j=j.nodeType==1?j:j.parentNode,j.style&&(j.style.zoom=j.style.zoom))},wd:function(j){if(W){var K=j.style.width;j.style.width=0,j.style.width=K}},Pd:function(j,K){j=m.a.f(j),K=m.a.f(K);for(var Q=[],de=j;de<=K;de++)Q.push(de);return Q},la:function(j){for(var K=[],Q=0,de=j.length;Q<de;Q++)K.push(j[Q]);return K},Da:function(j){return H?Symbol(j):j},Zd:W===6,$d:W===7,W,Lc:function(j,K){for(var Q=m.a.la(j.getElementsByTagName("input")).concat(m.a.la(j.getElementsByTagName("textarea"))),de=typeof K=="string"?function(_e){return _e.name===K}:function(_e){return K.test(_e.name)},xe=[],ce=Q.length-1;0<=ce;ce--)de(Q[ce])&&xe.push(Q[ce]);return xe},Nd:function(j){return typeof j=="string"&&(j=m.a.Db(j))?r&&r.parse?r.parse(j):new Function("return "+j)():null},hc:function(j,K,Q){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(m.a.f(j),K,Q)},Od:function(j,K,Q){Q=Q||{};var de=Q.params||{},xe=Q.includeFields||this.Jc,ce=j;if(typeof j=="object"&&m.a.R(j)==="form")for(var ce=j.action,_e=xe.length-1;0<=_e;_e--)for(var be=m.a.Lc(j,xe[_e]),De=be.length-1;0<=De;De--)de[be[De].name]=be[De].value;K=m.a.f(K);var Ae=n.createElement("form");Ae.style.display="none",Ae.action=ce,Ae.method="post";for(var ke in K)j=n.createElement("input"),j.type="hidden",j.name=ke,j.value=m.a.hc(m.a.f(K[ke])),Ae.appendChild(j);g(de,function(ze,et){var Et=n.createElement("input");Et.type="hidden",Et.name=ze,Et.value=et,Ae.appendChild(Et)}),n.body.appendChild(Ae),Q.submitter?Q.submitter(Ae):Ae.submit(),setTimeout(function(){Ae.parentNode.removeChild(Ae)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(g){var E=this;if(arguments.length===1)return function(){return E.apply(g,arguments)};var w=Array.prototype.slice.call(arguments,1);return function(){var I=w.slice(0);return I.push.apply(I,arguments),E.apply(g,I)}}),m.a.g=new function(){var g=0,E="__ko__"+new Date().getTime(),w={},I,N;return m.a.W?(I=function(B,H){var V=B[E];if(!V||V==="null"||!w[V]){if(!H)return e;V=B[E]="ko"+g++,w[V]={}}return w[V]},N=function(B){var H=B[E];return H?(delete w[H],B[E]=null,!0):!1}):(I=function(B,H){var V=B[E];return!V&&H&&(V=B[E]={}),V},N=function(B){return B[E]?(delete B[E],!0):!1}),{get:function(B,H){var V=I(B,!1);return V&&V[H]},set:function(B,H,V){(B=I(B,V!==e))&&(B[H]=V)},Ub:function(B,H,V){return B=I(B,!0),B[H]||(B[H]=V)},clear:N,Z:function(){return g+++E}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function g(H,V){var G=m.a.g.get(H,I);return G===e&&V&&(G=[],m.a.g.set(H,I,G)),G}function E(H){var V=g(H,!1);if(V)for(var V=V.slice(0),G=0;G<V.length;G++)V[G](H);m.a.g.clear(H),m.a.K.cleanExternalData(H),B[H.nodeType]&&w(H.childNodes,!0)}function w(H,V){for(var G=[],k,W=0;W<H.length;W++)if((!V||H[W].nodeType===8)&&(E(G[G.length]=k=H[W]),H[W]!==k))for(;W--&&m.a.A(G,H[W])==-1;);}var I=m.a.g.Z(),N={1:!0,8:!0,9:!0},B={1:!0,9:!0};return{za:function(H,V){if(typeof V!="function")throw Error("Callback must be a function");g(H,!0).push(V)},yb:function(H,V){var G=g(H,!1);G&&(m.a.Pa(G,V),G.length==0&&m.a.g.set(H,I,e))},oa:function(H){return m.u.G(function(){N[H.nodeType]&&(E(H),B[H.nodeType]&&w(H.getElementsByTagName("*")))}),H},removeNode:function(H){m.oa(H),H.parentNode&&H.parentNode.removeChild(H)},cleanExternalData:function(H){o&&typeof o.cleanData=="function"&&o.cleanData([H])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),function(){var g=[0,"",""],E=[1,"<table>","</table>"],w=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],N={thead:E,tbody:E,tfoot:E,tr:[2,"<table><tbody>","</tbody></table>"],td:w,th:w,option:I,optgroup:I},B=8>=m.a.W;m.a.ua=function(H,V){var G;if(o){if(o.parseHTML)G=o.parseHTML(H,V)||[];else if((G=o.clean([H],V))&&G[0]){for(var k=G[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(G=V)||(G=n);var k=G.parentWindow||G.defaultView||t,W=m.a.Db(H).toLowerCase(),Y=G.createElement("div"),J;for(J=(W=W.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&N[W[1]]||g,W=J[0],J="ignored<div>"+J[1]+H+J[2]+"</div>",typeof k.innerShiv=="function"?Y.appendChild(k.innerShiv(J)):(B&&G.body.appendChild(Y),Y.innerHTML=J,B&&Y.parentNode.removeChild(Y));W--;)Y=Y.lastChild;G=m.a.la(Y.lastChild.childNodes)}return G},m.a.Md=function(H,V){var G=m.a.ua(H,V);return G.length&&G[0].parentElement||m.a.Yb(G)},m.a.fc=function(H,V){if(m.a.Tb(H),V=m.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),o)o(H).html(V);else for(var G=m.a.ua(V,H.ownerDocument),k=0;k<G.length;k++)H.appendChild(G[k])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function g(w,I){if(w){if(w.nodeType==8){var N=m.aa.Uc(w.nodeValue);N!=null&&I.push({ud:w,Kd:N})}else if(w.nodeType==1)for(var N=0,B=w.childNodes,H=B.length;N<H;N++)g(B[N],I)}}var E={};return{Xb:function(w){if(typeof w!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return E[I]=w,"<!--[ko_memo:"+I+"]-->"},bd:function(w,I){var N=E[w];if(N===e)throw Error("Couldn't find any memo with ID "+w+". Perhaps it's already been unmemoized.");try{return N.apply(null,I||[]),!0}finally{delete E[w]}},cd:function(w,I){var N=[];g(w,N);for(var B=0,H=N.length;B<H;B++){var V=N[B].ud,G=[V];I&&m.a.Nb(G,I),m.aa.bd(N[B].Kd,G),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(w){return(w=w.match(/^\[ko_memo\:(.*?)\]$/))?w[1]:null}}}(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=function(){function g(){if(N){for(var V=N,G=0,k;H<N;)if(k=I[H++]){if(H>V){if(5e3<=++G){H=N,m.a.Gc(Error("'Too much recursion' after processing "+G+" task groups."));break}V=N}try{k()}catch(W){m.a.Gc(W)}}}}function E(){g(),H=N=I.length=0}var w,I=[],N=0,B=1,H=0;return t.MutationObserver?w=function(V){var G=n.createElement("div");return new MutationObserver(V).observe(G,{attributes:!0}),function(){G.classList.toggle("foo")}}(E):w=n&&"onreadystatechange"in n.createElement("script")?function(V){var G=n.createElement("script");G.onreadystatechange=function(){G.onreadystatechange=null,n.documentElement.removeChild(G),G=null,V()},n.documentElement.appendChild(G)}:function(V){setTimeout(V,0)},{scheduler:w,zb:function(V){return N||m.na.scheduler(E),I[N++]=V,B++},cancel:function(V){V=V-(B-N),V>=H&&V<N&&(I[V]=null)},resetForTesting:function(){var V=N-H;return H=N=I.length=0,V},Sd:g}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(g,E){g.throttleEvaluation=E;var w=null;return m.$({read:g,write:function(I){clearTimeout(w),w=m.a.setTimeout(function(){g(I)},E)}})},rateLimit:function(g,E){var w,I,N;typeof E=="number"?w=E:(w=E.timeout,I=E.method),g.Hb=!1,N=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,g.ub(function(B){return N(B,w,E)})},deferred:function(g,E){if(E!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");g.Hb||(g.Hb=!0,g.ub(function(w){var I,N=!1;return function(){if(!N){m.na.cancel(I),I=m.na.zb(w);try{N=!0,g.notifySubscribers(e,"dirty")}finally{N=!1}}}}))},notify:function(g,E){g.equalityComparer=E=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(g,E,w){this.da=g,this.lc=E,this.mc=w,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(g){this.Jb=g,m.a.K.za(g,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,b),b.qb(this)};var b={qb:function(g){g.U={change:[]},g.sc=1},subscribe:function(g,E,w){var I=this;w=w||"change";var N=new m.ic(I,E?g.bind(E):g,function(){m.a.Pa(I.U[w],N),I.hb&&I.hb(w)});return I.Qa&&I.Qa(w),I.U[w]||(I.U[w]=[]),I.U[w].push(N),N},notifySubscribers:function(g,E){if(E=E||"change",E==="change"&&this.Gb(),this.Wa(E)){var w=E==="change"&&this.ed||this.U[E].slice(0);try{m.u.xc();for(var I=0,N;N=w[I];++I)N.Ib||N.lc(g)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(g){return this.ob()!==g},Gb:function(){++this.sc},ub:function(g){var E=this,w=m.O(E),I,N,B,H,V;E.gb||(E.gb=E.notifySubscribers,E.notifySubscribers=h);var G=g(function(){E.Ja=!1,w&&H===E&&(H=E.nc?E.nc():E());var k=N||V&&E.sb(B,H);V=N=I=!1,k&&E.gb(B=H)});E.qc=function(k,W){W&&E.Ja||(V=!W),E.ed=E.U.change.slice(0),E.Ja=I=!0,H=k,G()},E.pc=function(k){I||(B=k,E.gb(k,"beforeChange"))},E.rc=function(){V=!0},E.gd=function(){E.sb(B,E.v(!0))&&(N=!0)}},Wa:function(g){return this.U[g]&&this.U[g].length},Bd:function(g){if(g)return this.U[g]&&this.U[g].length||0;var E=0;return m.a.P(this.U,function(w,I){w!=="dirty"&&(E+=I.length)}),E},sb:function(g,E){return!this.equalityComparer||!this.equalityComparer(g,E)},toString:function(){return"[object Object]"},extend:function(g){var E=this;return g&&m.a.P(g,function(w,I){var N=m.Ta[w];typeof N=="function"&&(E=N(E,I)||E)}),E}};m.L(b,"init",b.qb),m.L(b,"subscribe",b.subscribe),m.L(b,"extend",b.extend),m.L(b,"getSubscriptionsCount",b.Bd),m.a.Ba&&m.a.setPrototypeOf(b,Function.prototype),m.T.fn=b,m.Qc=function(g){return g!=null&&typeof g.subscribe=="function"&&typeof g.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function g(B){w.push(I),I=B}function E(){I=w.pop()}var w=[],I,N=0;return{xc:g,end:E,cc:function(B){if(I){if(!m.Qc(B))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,B,B.fd||(B.fd=++N))}},G:function(B,H,V){try{return g(),B.apply(H,V||[])}finally{E()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var T=m.a.Da("_latestValue");m.ta=function(g){function E(){return 0<arguments.length?(E.sb(E[T],arguments[0])&&(E.ya(),E[T]=arguments[0],E.xa()),this):(m.u.cc(E),E[T])}return E[T]=g,m.a.Ba||m.a.extend(E,m.T.fn),m.T.fn.qb(E),m.a.Ab(E,C),m.options.deferUpdates&&m.Ta.deferred(E,!0),E};var C={equalityComparer:c,v:function(){return this[T]},xa:function(){this.notifySubscribers(this[T],"spectate"),this.notifySubscribers(this[T])},ya:function(){this.notifySubscribers(this[T],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(C,m.T.fn);var A=m.ta.Ma="__ko_proto__";C[A]=m.ta,m.O=function(g){if((g=typeof g=="function"&&g[A])&&g!==C[A]&&g!==m.o.fn[A])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!g},m.Za=function(g){return typeof g=="function"&&(g[A]===C[A]||g[A]===m.o.fn[A]&&g.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",C),m.L(C,"peek",C.v),m.L(C,"valueHasMutated",C.xa),m.L(C,"valueWillMutate",C.ya),m.Ha=function(g){if(g=g||[],typeof g!="object"||!("length"in g))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return g=m.ta(g),m.a.Ab(g,m.Ha.fn),g.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(g){for(var E=this.v(),w=[],I=typeof g!="function"||m.O(g)?function(H){return H===g}:g,N=0;N<E.length;N++){var B=E[N];if(I(B)){if(w.length===0&&this.ya(),E[N]!==B)throw Error("Array modified during remove; cannot remove item");w.push(B),E.splice(N,1),N--}}return w.length&&this.xa(),w},removeAll:function(g){if(g===e){var E=this.v(),w=E.slice(0);return this.ya(),E.splice(0,E.length),this.xa(),w}return g?this.remove(function(I){return 0<=m.a.A(g,I)}):[]},destroy:function(g){var E=this.v(),w=typeof g!="function"||m.O(g)?function(B){return B===g}:g;this.ya();for(var I=E.length-1;0<=I;I--){var N=E[I];w(N)&&(N._destroy=!0)}this.xa()},destroyAll:function(g){return g===e?this.destroy(function(){return!0}):g?this.destroy(function(E){return 0<=m.a.A(g,E)}):[]},indexOf:function(g){var E=this();return m.a.A(E,g)},replace:function(g,E){var w=this.indexOf(g);0<=w&&(this.ya(),this.v()[w]=E,this.xa())},sorted:function(g){var E=this().slice(0);return g?E.sort(g):E.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(g){m.Ha.fn[g]=function(){var E=this.v();this.ya(),this.zc(E,g,arguments);var w=E[g].apply(E,arguments);return this.xa(),w===E?this:w}}),m.a.D(["slice"],function(g){m.Ha.fn[g]=function(){var E=this();return E[g].apply(E,arguments)}}),m.Pc=function(g){return m.O(g)&&typeof g.remove=="function"&&typeof g.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(g,E){function w(){function Y(){if(V){var J=[].concat(g.v()||[]),j;g.Wa("arrayChange")&&((!N||1<V)&&(N=m.a.Pb(G,J,g.Ob)),j=N),G=J,N=null,V=0,j&&j.length&&g.notifySubscribers(j,"arrayChange")}}I?Y():(I=!0,H=g.subscribe(function(){++V},null,"spectate"),G=[].concat(g.v()||[]),N=null,B=g.subscribe(Y))}if(g.Ob={},E&&typeof E=="object"&&m.a.extend(g.Ob,E),g.Ob.sparse=!0,!g.zc){var I=!1,N=null,B,H,V=0,G,k=g.Qa,W=g.hb;g.Qa=function(Y){k&&k.call(g,Y),Y==="arrayChange"&&w()},g.hb=function(Y){W&&W.call(g,Y),Y!=="arrayChange"||g.Wa("arrayChange")||(B&&B.s(),H&&H.s(),H=B=null,I=!1,G=e)},g.zc=function(Y,J,j){function K(Ae,ke,ze){return Q[Q.length]={status:Ae,value:ke,index:ze}}if(I&&!V){var Q=[],de=Y.length,xe=j.length,ce=0;switch(J){case"push":ce=de;case"unshift":for(J=0;J<xe;J++)K("added",j[J],ce+J);break;case"pop":ce=de-1;case"shift":de&&K("deleted",Y[ce],ce);break;case"splice":J=Math.min(Math.max(0,0>j[0]?de+j[0]:j[0]),de);for(var de=xe===1?de:Math.min(J+(j[1]||0),de),xe=J+xe-2,ce=Math.max(de,xe),_e=[],be=[],De=2;J<ce;++J,++De)J<de&&be.push(K("deleted",Y[J],J)),J<xe&&_e.push(K("added",j[De],J));m.a.Kc(be,_e);break;default:return}N=Q}}}};var S=m.a.Da("_state");m.o=m.$=function(g,E,w){function I(){if(0<arguments.length){if(typeof N=="function")N.apply(B.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return B.ra||m.u.cc(I),(B.ka||B.J&&I.Xa())&&I.ha(),B.X}if(typeof g=="object"?w=g:(w=w||{},g&&(w.read=g)),typeof w.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var N=w.write,B={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:w.read,nb:E||w.owner,l:w.disposeWhenNodeIsRemoved||w.l||null,Sa:w.disposeWhen||w.Sa,Rb:null,I:{},V:0,Ic:null};return I[S]=B,I.Nc=typeof N=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,v),w.pure?(B.wb=!0,B.J=!0,m.a.extend(I,D)):w.deferEvaluation&&m.a.extend(I,O),m.options.deferUpdates&&m.Ta.deferred(I,!0),B.l&&(B.jc=!0,B.l.nodeType||(B.l=null)),B.J||w.deferEvaluation||I.ha(),B.l&&I.ja()&&m.a.K.za(B.l,B.Rb=function(){I.s()}),I};var v={equalityComparer:c,qa:function(){return this[S].V},Va:function(){var g=[];return m.a.P(this[S].I,function(E,w){g[w.Ka]=w.da}),g},Vb:function(g){if(!this[S].V)return!1;var E=this.Va();return m.a.A(E,g)!==-1?!0:!!m.a.Lb(E,function(w){return w.Vb&&w.Vb(g)})},uc:function(g,E,w){if(this[S].wb&&E===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[g]=w,w.Ka=this[S].V++,w.La=E.ob()},Xa:function(){var g,E,w=this[S].I;for(g in w)if(Object.prototype.hasOwnProperty.call(w,g)&&(E=w[g],this.Ia&&E.da.Ja||E.da.Dd(E.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var g=this[S];return g.ka||0<g.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(g){if(g.Hb){var E=g.subscribe(this.Jd,this,"dirty"),w=g.subscribe(this.Rd,this);return{da:g,s:function(){E.s(),w.s()}}}return g.subscribe(this.Hc,this)},Hc:function(){var g=this,E=g.throttleEvaluation;E&&0<=E?(clearTimeout(this[S].Ic),this[S].Ic=m.a.setTimeout(function(){g.ha(!0)},E)):g.Ia?g.Ia(!0):g.ha(!0)},ha:function(g){var E=this[S],w=E.Sa,I=!1;if(!E.rb&&!E.ra){if(E.l&&!m.a.Sb(E.l)||w&&w()){if(!E.jc){this.s();return}}else E.jc=!1;E.rb=!0;try{I=this.zd(g)}finally{E.rb=!1}return I}},zd:function(g){var E=this[S],I=!1,w=E.wb?e:!E.V,I={qd:this,mb:E.I,Qb:E.V};m.u.xc({pd:I,od:_,o:this,Ya:w}),E.I={},E.V=0;var N=this.yd(E,I);return E.V?I=this.sb(E.X,N):(this.s(),I=!0),I&&(E.J?this.Gb():this.notifySubscribers(E.X,"beforeChange"),E.X=N,this.notifySubscribers(E.X,"spectate"),!E.J&&g&&this.notifySubscribers(E.X),this.rc&&this.rc()),w&&this.notifySubscribers(E.X,"awake"),I},yd:function(g,E){try{var w=g.Wc;return g.nb?w.call(g.nb):w()}finally{m.u.end(),E.Qb&&!g.J&&m.a.P(E.mb,p),g.sa=g.ka=!1}},v:function(g){var E=this[S];return(E.ka&&(g||!E.V)||E.J&&this.Xa())&&this.ha(),E.X},ub:function(g){m.T.fn.ub.call(this,g),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(E){this.pc(this[S].X),this[S].ka=!0,E&&(this[S].sa=!0),this.qc(this,!E)}},s:function(){var g=this[S];!g.J&&g.I&&m.a.P(g.I,function(E,w){w.s&&w.s()}),g.l&&g.Rb&&m.a.K.yb(g.l,g.Rb),g.I=e,g.V=0,g.ra=!0,g.sa=!1,g.ka=!1,g.J=!1,g.l=e,g.Sa=e,g.Wc=e,this.Nc||(g.nb=e)}},D={Qa:function(g){var E=this,w=E[S];if(!w.ra&&w.J&&g=="change"){if(w.J=!1,w.sa||E.Xa())w.I=null,w.V=0,E.ha()&&E.Gb();else{var I=[];m.a.P(w.I,function(N,B){I[B.Ka]=N}),m.a.D(I,function(N,B){var H=w.I[N],V=E.$c(H.da);V.Ka=B,V.La=H.La,w.I[N]=V}),E.Xa()&&E.ha()&&E.Gb()}w.ra||E.notifySubscribers(w.X,"awake")}},hb:function(g){var E=this[S];E.ra||g!="change"||this.Wa("change")||(m.a.P(E.I,function(w,I){I.s&&(E.I[w]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),E.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var g=this[S];return g.J&&(g.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},O={Qa:function(g){g!="change"&&g!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(v,m.T.fn);var R=m.ta.Ma;v[R]=m.o,m.Oc=function(g){return typeof g=="function"&&g[R]===v[R]},m.Fd=function(g){return m.Oc(g)&&g[S]&&g[S].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",v),m.L(v,"peek",v.v),m.L(v,"dispose",v.s),m.L(v,"isActive",v.ja),m.L(v,"getDependenciesCount",v.qa),m.L(v,"getDependencies",v.Va),m.xb=function(g,E){return typeof g=="function"?m.o(g,E,{pure:!0}):(g=m.a.extend({},g),g.pure=!0,m.o(g,E))},m.b("pureComputed",m.xb),function(){function g(I,N,B){if(B=B||new w,I=N(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var H=I instanceof Array?[]:{};return B.save(I,H),E(I,function(V){var G=N(I[V]);switch(typeof G){case"boolean":case"number":case"string":case"function":H[V]=G;break;case"object":case"undefined":var k=B.get(G);H[V]=k!==e?k:g(G,N,B)}}),H}function E(I,N){if(I instanceof Array){for(var B=0;B<I.length;B++)N(B);typeof I.toJSON=="function"&&N("toJSON")}else for(B in I)N(B)}function w(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return g(I,function(N){for(var B=0;m.O(N)&&10>B;B++)N=N();return N})},m.toJSON=function(I,N,B){return I=m.ad(I),m.a.hc(I,N,B)},w.prototype={constructor:w,save:function(I,N){var B=m.a.A(this.keys,I);0<=B?this.values[B]=N:(this.keys.push(I),this.values.push(N))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(g,E,w){function I(N){var B=m.xb(g,w).extend({ma:"always"}),H=B.subscribe(function(V){V&&(H.s(),N(V))});return B.notifySubscribers(B.v()),H}return typeof Promise!="function"||E?I(E.bind(w)):new Promise(I)},m.b("when",m.Wd),function(){m.w={M:function(g){switch(m.a.R(g)){case"option":return g.__ko__hasDomDataOptionValue__===!0?m.a.g.get(g,m.c.options.$b):7>=m.a.W?g.getAttributeNode("value")&&g.getAttributeNode("value").specified?g.value:g.text:g.value;case"select":return 0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex]):e;default:return g.value}},cb:function(g,E,w){switch(m.a.R(g)){case"option":typeof E=="string"?(m.a.g.set(g,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in g&&delete g.__ko__hasDomDataOptionValue__,g.value=E):(m.a.g.set(g,m.c.options.$b,E),g.__ko__hasDomDataOptionValue__=!0,g.value=typeof E=="number"?E:"");break;case"select":(E===""||E===null)&&(E=e);for(var I=-1,N=0,B=g.options.length,H;N<B;++N)if(H=m.w.M(g.options[N]),H==E||H===""&&E===e){I=N;break}(w||0<=I||E===e&&1<g.size)&&(g.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){g.selectedIndex=I},0));break;default:(E===null||E===e)&&(E=""),g.value=E}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function g(V){V=m.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=` ,`;var G=[],k=V.match(I),W,Y=[],J=0;if(1<k.length){for(var j=0,K;K=k[j];++j){var Q=K.charCodeAt(0);if(Q===44){if(0>=J){G.push(W&&Y.length?{key:W,value:Y.join("")}:{unknown:W||Y.join("")}),W=J=0,Y=[];continue}}else if(Q===58){if(!J&&!W&&Y.length===1){W=Y.pop();continue}}else{if(Q===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;Q===47&&j&&1<K.length?(Q=k[j-1].match(N))&&!B[Q[0]]&&(V=V.substr(V.indexOf(K)+1),k=V.match(I),j=-1,K="/"):Q===40||Q===123||Q===91?++J:Q===41||Q===125||Q===93?--J:W||Y.length||Q!==34&&Q!==39||(K=K.slice(1,-1))}Y.push(K)}if(0<J)throw Error("Unbalanced parentheses, braces, or brackets")}return G}var E=["true","false","null","undefined"],w=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),N=/[\])"'A-Za-z0-9_$]+$/,B={in:1,return:1,typeof:1},H={};return{Ra:[],wa:H,ac:g,vb:function(V,G){function k(Q,de){var ye;if(!j){var ce=m.getBindingHandler(Q);if(ce&&ce.preprocess&&!(de=ce.preprocess(de,Q,k)))return;(ce=H[Q])&&(ye=de,0<=m.a.A(E,ye)?ye=!1:(ce=ye.match(w),ye=ce===null?!1:ce[1]?"Object("+ce[1]+")"+ce[2]:ye),ce=ye),ce&&Y.push("'"+(typeof H[Q]=="string"?H[Q]:Q)+"':function(_z){"+ye+"=_z}")}J&&(de="function(){return "+de+" }"),W.push("'"+Q+"':"+de)}G=G||{};var W=[],Y=[],J=G.valueAccessors,j=G.bindingParams,K=typeof V=="string"?g(V):V;return m.a.D(K,function(Q){k(Q.key||Q.unknown,Q.value)}),Y.length&&k("_ko_property_writers","{"+Y.join(",")+" }"),W.join(",")},Id:function(V,G){for(var k=0;k<V.length;k++)if(V[k].key==G)return!0;return!1},eb:function(V,G,k,W,Y){V&&m.O(V)?!m.Za(V)||Y&&V.v()===W||V(W):(V=G.get("_ko_property_writers"))&&V[k]&&V[k](W)}}}(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),function(){function g(k){return k.nodeType==8&&B.test(N?k.text:k.nodeValue)}function E(k){return k.nodeType==8&&H.test(N?k.text:k.nodeValue)}function w(k,W){for(var Y=k,J=1,j=[];Y=Y.nextSibling;){if(E(Y)&&(m.a.g.set(Y,G,!0),J--,J===0))return j;j.push(Y),g(Y)&&J++}if(!W)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function I(k,W){var Y=w(k,W);return Y?0<Y.length?Y[Y.length-1].nextSibling:k.nextSibling:null}var N=n&&n.createComment("test").text==="<!--test-->",B=N?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,H=N?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},G="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(k){return g(k)?w(k):k.childNodes},Ea:function(k){if(g(k)){k=m.h.childNodes(k);for(var W=0,Y=k.length;W<Y;W++)m.removeNode(k[W])}else m.a.Tb(k)},va:function(k,W){if(g(k)){m.h.Ea(k);for(var Y=k.nextSibling,J=0,j=W.length;J<j;J++)Y.parentNode.insertBefore(W[J],Y)}else m.a.va(k,W)},Vc:function(k,W){var Y;g(k)?(Y=k.nextSibling,k=k.parentNode):Y=k.firstChild,Y?W!==Y&&k.insertBefore(W,Y):k.appendChild(W)},Wb:function(k,W,Y){Y?(Y=Y.nextSibling,g(k)&&(k=k.parentNode),Y?W!==Y&&k.insertBefore(W,Y):k.appendChild(W)):m.h.Vc(k,W)},firstChild:function(k){if(g(k))return!k.nextSibling||E(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&E(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(g(k)&&(k=I(k)),k.nextSibling&&E(k.nextSibling)){var W=k.nextSibling;if(E(W)&&!m.a.g.get(W,G))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:g,Vd:function(k){return(k=(N?k.text:k.nodeValue).match(B))?k[1]:null},Sc:function(k){if(V[m.a.R(k)]){var W=k.firstChild;if(W)do if(W.nodeType===1){var Y;Y=W.firstChild;var J=null;if(Y)do if(J)J.push(Y);else if(g(Y)){var j=I(Y,!0);j?Y=j:J=[Y]}else E(Y)&&(J=[Y]);while(Y=Y.nextSibling);if(Y=J)for(J=W.nextSibling,j=0;j<Y.length;j++)J?k.insertBefore(Y[j],J):k.appendChild(Y[j])}while(W=W.nextSibling)}}}}(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(g);case 8:return m.h.Cd(g);default:return!1}},getBindings:function(g,E){var w=this.getBindingsString(g,E),w=w?this.parseBindingsString(w,E,g):null;return m.j.tc(w,g,E,!1)},getBindingAccessors:function(g,E){var w=this.getBindingsString(g,E),w=w?this.parseBindingsString(w,E,g,{valueAccessors:!0}):null;return m.j.tc(w,g,E,!0)},getBindingsString:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind");case 8:return m.h.Vd(g);default:return null}},parseBindingsString:function(g,E,w,I){try{var N=this.nd,B=g+(I&&I.valueAccessors||""),H;if(!(H=N[B])){var V,G="with($context){with($data||{}){return{"+m.m.vb(g,I)+"}}}";V=new Function("$context","$element",G),H=N[B]=V}return H(E,w)}catch(k){throw k.message=`Unable to parse bindings. +|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),N=/[\])"'A-Za-z0-9_$]+$/,B={in:1,return:1,typeof:1},H={};return{Ra:[],wa:H,ac:g,vb:function(V,G){function k(Q,de){var xe;if(!j){var ce=m.getBindingHandler(Q);if(ce&&ce.preprocess&&!(de=ce.preprocess(de,Q,k)))return;(ce=H[Q])&&(xe=de,0<=m.a.A(E,xe)?xe=!1:(ce=xe.match(w),xe=ce===null?!1:ce[1]?"Object("+ce[1]+")"+ce[2]:xe),ce=xe),ce&&Y.push("'"+(typeof H[Q]=="string"?H[Q]:Q)+"':function(_z){"+xe+"=_z}")}J&&(de="function(){return "+de+" }"),W.push("'"+Q+"':"+de)}G=G||{};var W=[],Y=[],J=G.valueAccessors,j=G.bindingParams,K=typeof V=="string"?g(V):V;return m.a.D(K,function(Q){k(Q.key||Q.unknown,Q.value)}),Y.length&&k("_ko_property_writers","{"+Y.join(",")+" }"),W.join(",")},Id:function(V,G){for(var k=0;k<V.length;k++)if(V[k].key==G)return!0;return!1},eb:function(V,G,k,W,Y){V&&m.O(V)?!m.Za(V)||Y&&V.v()===W||V(W):(V=G.get("_ko_property_writers"))&&V[k]&&V[k](W)}}}(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),function(){function g(k){return k.nodeType==8&&B.test(N?k.text:k.nodeValue)}function E(k){return k.nodeType==8&&H.test(N?k.text:k.nodeValue)}function w(k,W){for(var Y=k,J=1,j=[];Y=Y.nextSibling;){if(E(Y)&&(m.a.g.set(Y,G,!0),J--,J===0))return j;j.push(Y),g(Y)&&J++}if(!W)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function I(k,W){var Y=w(k,W);return Y?0<Y.length?Y[Y.length-1].nextSibling:k.nextSibling:null}var N=n&&n.createComment("test").text==="<!--test-->",B=N?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,H=N?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},G="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(k){return g(k)?w(k):k.childNodes},Ea:function(k){if(g(k)){k=m.h.childNodes(k);for(var W=0,Y=k.length;W<Y;W++)m.removeNode(k[W])}else m.a.Tb(k)},va:function(k,W){if(g(k)){m.h.Ea(k);for(var Y=k.nextSibling,J=0,j=W.length;J<j;J++)Y.parentNode.insertBefore(W[J],Y)}else m.a.va(k,W)},Vc:function(k,W){var Y;g(k)?(Y=k.nextSibling,k=k.parentNode):Y=k.firstChild,Y?W!==Y&&k.insertBefore(W,Y):k.appendChild(W)},Wb:function(k,W,Y){Y?(Y=Y.nextSibling,g(k)&&(k=k.parentNode),Y?W!==Y&&k.insertBefore(W,Y):k.appendChild(W)):m.h.Vc(k,W)},firstChild:function(k){if(g(k))return!k.nextSibling||E(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&E(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(g(k)&&(k=I(k)),k.nextSibling&&E(k.nextSibling)){var W=k.nextSibling;if(E(W)&&!m.a.g.get(W,G))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:g,Vd:function(k){return(k=(N?k.text:k.nodeValue).match(B))?k[1]:null},Sc:function(k){if(V[m.a.R(k)]){var W=k.firstChild;if(W)do if(W.nodeType===1){var Y;Y=W.firstChild;var J=null;if(Y)do if(J)J.push(Y);else if(g(Y)){var j=I(Y,!0);j?Y=j:J=[Y]}else E(Y)&&(J=[Y]);while(Y=Y.nextSibling);if(Y=J)for(J=W.nextSibling,j=0;j<Y.length;j++)J?k.insertBefore(Y[j],J):k.appendChild(Y[j])}while(W=W.nextSibling)}}}}(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(g);case 8:return m.h.Cd(g);default:return!1}},getBindings:function(g,E){var w=this.getBindingsString(g,E),w=w?this.parseBindingsString(w,E,g):null;return m.j.tc(w,g,E,!1)},getBindingAccessors:function(g,E){var w=this.getBindingsString(g,E),w=w?this.parseBindingsString(w,E,g,{valueAccessors:!0}):null;return m.j.tc(w,g,E,!0)},getBindingsString:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind");case 8:return m.h.Vd(g);default:return null}},parseBindingsString:function(g,E,w,I){try{var N=this.nd,B=g+(I&&I.valueAccessors||""),H;if(!(H=N[B])){var V,G="with($context){with($data||{}){return{"+m.m.vb(g,I)+"}}}";V=new Function("$context","$element",G),H=N[B]=V}return H(E,w)}catch(k){throw k.message=`Unable to parse bindings. Bindings value: `+g+` -Message: `+k.message,k}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function g(ce){var ge=(ce=m.a.g.get(ce,ye))&&ce.N;ge&&(ce.N=null,ge.Tc())}function E(ce,ge,xe){this.node=ce,this.yc=ge,this.kb=[],this.H=!1,ge.N||m.a.K.za(ce,g),xe&&xe.N&&(xe.N.kb.push(ce),this.Kb=xe)}function w(ce){return function(){return ce}}function I(ce){return ce()}function N(ce){return m.a.Ga(m.u.G(ce),function(ge,xe){return function(){return ce()[xe]}})}function B(ce,ge,xe){return typeof ce=="function"?N(ce.bind(null,ge,xe)):m.a.Ga(ce,w)}function H(ce,ge){return N(this.getBindings.bind(this,ce,ge))}function V(ce,ge){var xe=m.h.firstChild(ge);if(xe){var De,Ae=m.ga.instance,ke=Ae.preprocessNode;if(ke){for(;De=xe;)xe=m.h.nextSibling(De),ke.call(Ae,De);xe=m.h.firstChild(ge)}for(;De=xe;)xe=m.h.nextSibling(De),G(ce,De)}m.i.ma(ge,m.i.H)}function G(ce,ge){var xe=ce,De=ge.nodeType===1;De&&m.h.Sc(ge),(De||m.ga.instance.nodeHasBindings(ge))&&(xe=W(ge,null,ce).bindingContextForDescendants),xe&&!Q[m.a.R(ge)]&&V(xe,ge)}function k(ce){var ge=[],xe={},De=[];return m.a.P(ce,function Ae(ke){if(!xe[ke]){var ze=m.getBindingHandler(ke);ze&&(ze.after&&(De.push(ke),m.a.D(ze.after,function(et){if(ce[et]){if(m.a.A(De,et)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+De.join(", "));Ae(et)}}),De.length--),ge.push({key:ke,Mc:ze})),xe[ke]=!0}}),ge}function W(ce,ge,xe){var De=m.a.g.Ub(ce,ye,{}),Ae=De.hd;if(!ge){if(Ae)throw Error("You cannot apply bindings multiple times to the same element.");De.hd=!0}Ae||(De.context=xe),De.Zb||(De.Zb={});var ke;if(ge&&typeof ge!="function")ke=ge;else{var ze=m.ga.instance,et=ze.getBindingAccessors||H,St=m.$(function(){return(ke=ge?ge(xe,ce):et.call(ze,ce,xe))&&(xe[J]&&xe[J](),xe[K]&&xe[K]()),ke},null,{l:ce});ke&&St.ja()||(St=null)}var mt=xe,Be;if(ke){var Yt=function(){return m.a.Ga(St?St():ke,I)},Ct=St?function(ut){return function(){return I(St()[ut])}}:function(ut){return ke[ut]};Yt.get=function(ut){return ke[ut]&&I(Ct(ut))},Yt.has=function(ut){return ut in ke},m.i.H in ke&&m.i.subscribe(ce,m.i.H,function(){var ut=(0,ke[m.i.H])();if(ut){var Jt=m.h.childNodes(ce);Jt.length&&ut(Jt,m.Ec(Jt[0]))}}),m.i.pa in ke&&(mt=m.i.Cb(ce,xe),m.i.subscribe(ce,m.i.pa,function(){var ut=(0,ke[m.i.pa])();ut&&m.h.firstChild(ce)&&ut(ce)})),De=k(ke),m.a.D(De,function(ut){var Jt=ut.Mc.init,Ce=ut.Mc.update,Te=ut.key;if(ce.nodeType===8&&!m.h.ea[Te])throw Error("The binding '"+Te+"' cannot be used with virtual elements");try{typeof Jt=="function"&&m.u.G(function(){var it=Jt(ce,Ct(Te),Yt,mt.$data,mt);if(it&&it.controlsDescendantBindings){if(Be!==e)throw Error("Multiple bindings ("+Be+" and "+Te+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Be=Te}}),typeof Ce=="function"&&m.$(function(){Ce(ce,Ct(Te),Yt,mt.$data,mt)},null,{l:ce})}catch(it){throw it.message='Unable to process binding "'+Te+": "+ke[Te]+`" -Message: `+it.message,it}})}return De=Be===e,{shouldBindDescendants:De,bindingContextForDescendants:De&&mt}}function Y(ce,ge){return ce&&ce instanceof m.fa?ce:new m.fa(ce,e,e,ge)}var J=m.a.Da("_subscribable"),j=m.a.Da("_ancestorBindingInfo"),K=m.a.Da("_dataDependency");m.c={};var Q={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(ce){return m.c[ce]};var de={};m.fa=function(ce,ge,xe,De,Ae){function ke(){var Ct=mt?St():St,ut=m.a.f(Ct);return ge?(m.a.extend(ze,ge),j in ge&&(ze[j]=ge[j])):(ze.$parents=[],ze.$root=ut,ze.ko=m),ze[J]=Be,et?ut=ze.$data:(ze.$rawData=Ct,ze.$data=ut),xe&&(ze[xe]=ut),De&&De(ze,ge,ut),ge&&ge[J]&&!m.S.o().Vb(ge[J])&&ge[J](),Yt&&(ze[K]=Yt),ze.$data}var ze=this,et=ce===de,St=et?e:ce,mt=typeof St=="function"&&!m.O(St),Be,Yt=Ae&&Ae.dataDependency;Ae&&Ae.exportDependencies?ke():(Be=m.xb(ke),Be.v(),Be.ja()?Be.equalityComparer=null:ze[J]=e)},m.fa.prototype.createChildContext=function(ce,ge,xe,De){if(!De&&ge&&typeof ge=="object"&&(De=ge,ge=De.as,xe=De.extend),ge&&De&&De.noChildContext){var Ae=typeof ce=="function"&&!m.O(ce);return new m.fa(de,this,null,function(ke){xe&&xe(ke),ke[ge]=Ae?ce():ce},De)}return new m.fa(ce,this,ge,function(ke,ze){ke.$parentContext=ze,ke.$parent=ze.$data,ke.$parents=(ze.$parents||[]).slice(0),ke.$parents.unshift(ke.$parent),xe&&xe(ke)},De)},m.fa.prototype.extend=function(ce,ge){return new m.fa(de,this,null,function(xe){m.a.extend(xe,typeof ce=="function"?ce(xe):ce)},ge)};var ye=m.a.g.Z();E.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},E.prototype.sd=function(ce){m.a.Pa(this.kb,ce),!this.kb.length&&this.H&&this.Cc()},E.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,g),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ce,ge,xe,De,Ae){var ke=m.a.g.Ub(ce,ye,{});return ke.Fa||(ke.Fa=new m.T),Ae&&Ae.notifyImmediately&&ke.Zb[ge]&&m.u.G(xe,De,[ce]),ke.Fa.subscribe(xe,De,ge)},ma:function(ce,ge){var xe=m.a.g.get(ce,ye);if(xe&&(xe.Zb[ge]=!0,xe.Fa&&xe.Fa.notifySubscribers(ce,ge),ge==m.i.H)){if(xe.N)xe.N.Cc();else if(xe.N===e&&xe.Fa&&xe.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ce,ge){var xe=m.a.g.Ub(ce,ye,{});return xe.N||(xe.N=new E(ce,xe,ge[j])),ge[j]==xe?ge:ge.extend(function(De){De[j]=xe})}},m.Td=function(ce){return(ce=m.a.g.get(ce,ye))&&ce.context},m.ib=function(ce,ge,xe){return ce.nodeType===1&&m.h.Sc(ce),W(ce,ge,Y(xe))},m.ld=function(ce,ge,xe){return xe=Y(xe),m.ib(ce,B(ge,xe,ce),xe)},m.Oa=function(ce,ge){ge.nodeType!==1&&ge.nodeType!==8||V(Y(ce),ge)},m.vc=function(ce,ge,xe){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ge=n.body,!ge)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ge||ge.nodeType!==1&&ge.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");G(Y(ce,xe),ge)},m.Dc=function(ce){return!ce||ce.nodeType!==1&&ce.nodeType!==8?e:m.Td(ce)},m.Ec=function(ce){return(ce=m.Dc(ce))?ce.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)}(),function(g){function E(H,V){var G=Object.prototype.hasOwnProperty.call(N,H)?N[H]:g,k;G?G.subscribe(V):(G=N[H]=new m.T,G.subscribe(V),w(H,function(W,Y){var J=!(!Y||!Y.synchronous);B[H]={definition:W,Gd:J},delete N[H],k||J?G.notifySubscribers(W):m.na.zb(function(){G.notifySubscribers(W)})}),k=!0)}function w(H,V){I("getConfig",[H],function(G){G?I("loadComponent",[H,G],function(k){V(k,G)}):V(null,null)})}function I(H,V,G,k){k||(k=m.j.loaders.slice(0));var W=k.shift();if(W){var Y=W[H];if(Y){var J=!1;if(Y.apply(W,V.concat(function(j){J?G(null):j!==null?G(j):I(H,V,G,k)}))!==g&&(J=!0,!W.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(H,V,G,k)}else G(null)}var N={},B={};m.j={get:function(H,V){var G=Object.prototype.hasOwnProperty.call(B,H)?B[H]:g;G?G.Gd?m.u.G(function(){V(G.definition)}):m.na.zb(function(){V(G.definition)}):E(H,V)},Bc:function(H){delete B[H]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function g(G,k,W,Y){function J(){--K===0&&Y(j)}var j={},K=2,Q=W.template;W=W.viewModel,Q?N(k,Q,function(de){m.j.oc("loadTemplate",[G,de],function(ye){j.template=ye,J()})}):J(),W?N(k,W,function(de){m.j.oc("loadViewModel",[G,de],function(ye){j[V]=ye,J()})}):J()}function E(G,k,W){if(typeof k=="function")W(function(J){return new k(J)});else if(typeof k[V]=="function")W(k[V]);else if("instance"in k){var Y=k.instance;W(function(){return Y})}else"viewModel"in k?E(G,k.viewModel,W):G("Unknown viewModel value: "+k)}function w(G){switch(m.a.R(G)){case"script":return m.a.ua(G.text);case"textarea":return m.a.ua(G.value);case"template":if(I(G.content))return m.a.Ca(G.content.childNodes)}return m.a.Ca(G.childNodes)}function I(G){return t.DocumentFragment?G instanceof DocumentFragment:G&&G.nodeType===11}function N(G,k,W){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(Y){Y&&typeof Y=="object"&&Y.Xd&&Y.default&&(Y=Y.default),W(Y)}):G("Uses require, but no AMD loader is present"):W(k)}function B(G){return function(k){throw Error("Component '"+G+"': "+k)}}var H={};m.j.register=function(G,k){if(!k)throw Error("Invalid configuration for "+G);if(m.j.tb(G))throw Error("Component "+G+" is already registered");H[G]=k},m.j.tb=function(G){return Object.prototype.hasOwnProperty.call(H,G)},m.j.unregister=function(G){delete H[G],m.j.Bc(G)},m.j.Fc={getConfig:function(G,k){k(m.j.tb(G)?H[G]:null)},loadComponent:function(G,k,W){var Y=B(G);N(Y,k,function(J){g(G,Y,J,W)})},loadTemplate:function(G,k,W){if(G=B(G),typeof k=="string")W(m.a.ua(k));else if(k instanceof Array)W(k);else if(I(k))W(m.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)W(w(k));else if(typeof k=="string"){var Y=n.getElementById(k);Y?W(w(Y)):G("Cannot find element with ID "+k)}else G("Unknown element type: "+k);else G("Unknown template value: "+k)},loadViewModel:function(G,k,W){E(B(G),k,W)}};var V="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=H}(),function(){function g(w,I){var N=w.getAttribute("params");if(N){var N=E.parseBindingsString(N,I,w,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(V){return m.o(V,null,{l:w})}),B=m.a.Ga(N,function(V){var G=V.v();return V.ja()?m.o({read:function(){return m.a.f(V())},write:m.Za(G)&&function(k){V()(k)},l:w}):G});return Object.prototype.hasOwnProperty.call(B,"$raw")||(B.$raw=N),B}return{$raw:{}}}m.j.getComponentNameForNode=function(w){var I=m.a.R(w);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=m.a.W&&w.tagName===I))return I},m.j.tc=function(w,I,N,B){if(I.nodeType===1){var H=m.j.getComponentNameForNode(I);if(H){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:H,params:g(I,N)};w.component=B?function(){return V}:V}}return w};var E=new m.ga;9>m.a.W&&(m.j.register=function(w){return function(I){return w.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(w){return function(){var I=w(),N=m.j.dd,B;for(B in N);return I}}(n.createDocumentFragment))}(),function(){function g(I,N,B){if(N=N.template,!N)throw Error("Component '"+I+"' has no template");I=m.a.Ca(N),m.h.va(B,I)}function E(I,N,B){var H=I.createViewModel;return H?H.call(I,N,B):N}var w=0;m.c.component={init:function(I,N,B,H,V){function G(){var j=k&&k.dispose;typeof j=="function"&&j.call(k),Y&&Y.s(),W=k=Y=null}var k,W,Y,J=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,G),m.o(function(){var j=m.a.f(N()),K,Q;if(typeof j=="string"?K=j:(K=m.a.f(j.name),Q=m.a.f(j.params)),!K)throw Error("No component name specified");var de=m.i.Cb(I,V),ye=W=++w;m.j.get(K,function(ce){if(W===ye){if(G(),!ce)throw Error("Unknown component '"+K+"'");g(K,ce,I);var ge=E(ce,Q,{element:I,templateNodes:J});ce=de.createChildContext(ge,{extend:function(xe){xe.$component=ge,xe.$componentTemplateNodes=J}}),ge&&ge.koDescendantsComplete&&(Y=m.i.subscribe(I,m.i.pa,ge.koDescendantsComplete,ge)),k=ge,m.Oa(ce,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var M={class:"className",for:"htmlFor"};m.c.attr={update:function(g,E){var w=m.a.f(E())||{};m.a.P(w,function(I,N){N=m.a.f(N);var B=I.indexOf(":"),B="lookupNamespaceURI"in g&&0<B&&g.lookupNamespaceURI(I.substr(0,B)),H=N===!1||N===null||N===e;H?B?g.removeAttributeNS(B,I):g.removeAttribute(I):N=N.toString(),8>=m.a.W&&I in M?(I=M[I],H?g.removeAttribute(I):g[I]=N):H||(B?g.setAttributeNS(B,I,N):g.setAttribute(I,N)),I==="name"&&m.a.Yc(g,H?"":N)})}},function(){m.c.checked={after:["value","attr"],init:function(g,E,w){function I(){var j=g.checked,K=B();if(!m.S.Ya()&&(j||!V&&!m.S.qa())){var Q=m.u.G(E);if(k){var de=W?Q.v():Q,ye=J;J=K,ye!==K?j&&(m.a.Na(de,K,!0),m.a.Na(de,ye,!1)):m.a.Na(de,K,j),W&&m.Za(Q)&&Q(de)}else H&&(K===e?K=j:j||(K=e)),m.m.eb(Q,w,"checked",K,!0)}}function N(){var j=m.a.f(E()),K=B();k?(g.checked=0<=m.a.A(j,K),J=K):g.checked=H&&K===e?!!j:B()===j}var B=m.xb(function(){if(w.has("checkedValue"))return m.a.f(w.get("checkedValue"));if(Y)return w.has("value")?m.a.f(w.get("value")):g.value}),H=g.type=="checkbox",V=g.type=="radio";if(H||V){var G=E(),k=H&&m.a.f(G)instanceof Array,W=!(k&&G.push&&G.splice),Y=V||k,J=k?B():e;V&&!g.name&&m.c.uniqueName.init(g,function(){return!0}),m.o(I,null,{l:g}),m.a.B(g,"click",I),m.o(N,null,{l:g}),G=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(g,E){g.value=m.a.f(E())}}}(),m.c.class={update:function(g,E){var w=m.a.Db(m.a.f(E()));m.a.Eb(g,g.__ko__cssValue,!1),g.__ko__cssValue=w,m.a.Eb(g,w,!0)}},m.c.css={update:function(g,E){var w=m.a.f(E());w!==null&&typeof w=="object"?m.a.P(w,function(I,N){N=m.a.f(N),m.a.Eb(g,I,N)}):m.c.class.update(g,E)}},m.c.enable={update:function(g,E){var w=m.a.f(E());w&&g.disabled?g.removeAttribute("disabled"):w||g.disabled||(g.disabled=!0)}},m.c.disable={update:function(g,E){m.c.enable.update(g,function(){return!m.a.f(E())})}},m.c.event={init:function(g,E,w,I,N){var B=E()||{};m.a.P(B,function(H){typeof H=="string"&&m.a.B(g,H,function(V){var G,k=E()[H];if(k){try{var W=m.a.la(arguments);I=N.$data,W.unshift(I),G=k.apply(I,W)}finally{G!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}w.get(H+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},m.c.foreach={Rc:function(g){return function(){var E=g(),w=m.a.bc(E);return!w||typeof w.length=="number"?{foreach:E,templateEngine:m.ba.Ma}:(m.a.f(E),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:m.ba.Ma})}},init:function(g,E){return m.c.template.init(g,m.c.foreach.Rc(E))},update:function(g,E,w,I,N){return m.c.template.update(g,m.c.foreach.Rc(E),w,I,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(g,E,w){function I(H){g.__ko_hasfocusUpdating=!0;var V=g.ownerDocument;if("activeElement"in V){var G;try{G=V.activeElement}catch{G=V.body}H=G===g}V=E(),m.m.eb(V,w,"hasfocus",H,!0),g.__ko_hasfocusLastValue=H,g.__ko_hasfocusUpdating=!1}var N=I.bind(null,!0),B=I.bind(null,!1);m.a.B(g,"focus",N),m.a.B(g,"focusin",N),m.a.B(g,"blur",B),m.a.B(g,"focusout",B),g.__ko_hasfocusLastValue=!1},update:function(g,E){var w=!!m.a.f(E());g.__ko_hasfocusUpdating||g.__ko_hasfocusLastValue===w||(w?g.focus():g.blur(),!w&&g.__ko_hasfocusLastValue&&g.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[g,w?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(g,E){m.a.fc(g,E())}},function(){function g(E,w,I){m.c[E]={init:function(N,B,H,V,G){var k,W,Y={},J,j,K;if(w){V=H.get("as");var Q=H.get("noChildContext");K=!(V&&Q),Y={as:V,noChildContext:Q,exportDependencies:K}}return j=(J=H.get("completeOn")=="render")||H.has(m.i.pa),m.o(function(){var de=m.a.f(B()),ye=!I!=!de,ce=!W,ge;(K||ye!==k)&&(j&&(G=m.i.Cb(N,G)),ye&&((!w||K)&&(Y.dataDependency=m.S.o()),ge=w?G.createChildContext(typeof de=="function"?de:B,Y):m.S.qa()?G.extend(null,Y):G),ce&&m.S.qa()&&(W=m.a.Ca(m.h.childNodes(N),!0)),ye?(ce||m.h.va(N,m.a.Ca(W)),m.Oa(ge,N)):(m.h.Ea(N),J||m.i.ma(N,m.i.H)),k=ye)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[E]=!1,m.h.ea[E]=!0}g("if"),g("ifnot",!1,!0),g("with",!0)}(),m.c.let={init:function(g,E,w,I,N){return E=N.extend(E),m.Oa(E,g),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(g){if(m.a.R(g)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<g.length;)g.remove(0);return{controlsDescendantBindings:!0}},update:function(g,E,w){function I(){return m.a.jb(g.options,function(Q){return Q.selected})}function N(Q,de,ye){var ce=typeof de;return ce=="function"?de(Q):ce=="string"?Q[de]:ye}function B(Q,de){if(j&&k)m.i.ma(g,m.i.H);else if(J.length){var ye=0<=m.a.A(J,m.w.M(de[0]));m.a.Zc(de[0],ye),j&&!ye&&m.u.G(m.a.Fb,null,[g,"change"])}}var H=g.multiple,V=g.length!=0&&H?g.scrollTop:null,G=m.a.f(E()),k=w.get("valueAllowUnset")&&w.has("value"),W=w.get("optionsIncludeDestroyed");E={};var Y,J=[];k||(H?J=m.a.Mb(I(),m.w.M):0<=g.selectedIndex&&J.push(m.w.M(g.options[g.selectedIndex]))),G&&(typeof G.length>"u"&&(G=[G]),Y=m.a.jb(G,function(Q){return W||Q===e||Q===null||!m.a.f(Q._destroy)}),w.has("optionsCaption")&&(G=m.a.f(w.get("optionsCaption")),G!==null&&G!==e&&Y.unshift(L)));var j=!1;if(E.beforeRemove=function(Q){g.removeChild(Q)},G=B,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(G=function(Q,de){B(0,de),m.u.G(w.get("optionsAfterRender"),null,[de[0],Q!==L?Q:e])}),m.a.ec(g,Y,function(Q,de,ye){return ye.length&&(J=!k&&ye[0].selected?[m.w.M(ye[0])]:[],j=!0),de=g.ownerDocument.createElement("option"),Q===L?(m.a.Bb(de,w.get("optionsCaption")),m.w.cb(de,e)):(ye=N(Q,w.get("optionsValue"),Q),m.w.cb(de,m.a.f(ye)),Q=N(Q,w.get("optionsText"),ye),m.a.Bb(de,Q)),[de]},E,G),!k){var K;H?K=J.length&&I().length<J.length:K=J.length&&0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex])!==J[0]:J.length||0<=g.selectedIndex,K&&m.u.G(m.a.Fb,null,[g,"change"])}(k||m.S.Ya())&&m.i.ma(g,m.i.H),m.a.wd(g),V&&20<Math.abs(V-g.scrollTop)&&(g.scrollTop=V)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(g,E,w){function I(){var H=E(),V=[];m.a.D(g.getElementsByTagName("option"),function(G){G.selected&&V.push(m.w.M(G))}),m.m.eb(H,w,"selectedOptions",V)}function N(){var H=m.a.f(E()),V=g.scrollTop;H&&typeof H.length=="number"&&m.a.D(g.getElementsByTagName("option"),function(G){var k=0<=m.a.A(H,m.w.M(G));G.selected!=k&&m.a.Zc(G,k)}),g.scrollTop=V}if(m.a.R(g)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var B;m.i.subscribe(g,m.i.H,function(){B?I():(m.a.B(g,"change",I),B=m.o(N,null,{l:g}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(g,E){var w=m.a.f(E()||{});m.a.P(w,function(I,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),o)o(g).css(I,N);else if(/^--/.test(I))g.style.setProperty(I,N);else{I=I.replace(/-(\w)/g,function(H,V){return V.toUpperCase()});var B=g.style[I];g.style[I]=N,N===B||g.style[I]!=B||isNaN(N)||(g.style[I]=N+"px")}})}},m.c.submit={init:function(g,E,w,I,N){if(typeof E()!="function")throw Error("The value for a submit binding must be a function");m.a.B(g,"submit",function(B){var H,V=E();try{H=V.call(N.$data,g)}finally{H!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(g,E){m.a.Bb(g,E())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var g=function(Y){if(Y)return parseFloat(Y[1])},E=t.navigator.userAgent,w,I,N,B,H;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(H=g(E.match(/Edge\/([^ ]+)$/)))||g(E.match(/Chrome\/([^ ]+)/))||(I=g(E.match(/Version\/([^ ]+) Safari/)))||(N=g(E.match(/Firefox\/([^ ]+)/)))||(B=m.a.W||g(E.match(/MSIE ([^ ]+)/)))||(B=g(E.match(/rv:([^ )]+)/)))}if(8<=B&&10>B)var V=m.a.g.Z(),G=m.a.g.Z(),k=function(Y){var J=this.activeElement;(J=J&&m.a.g.get(J,G))&&J(Y)},W=function(Y,J){var j=Y.ownerDocument;m.a.g.get(j,V)||(m.a.g.set(j,V,!0),m.a.B(j,"selectionchange",k)),m.a.g.set(Y,G,J)};m.c.textInput={init:function(Y,J,j){function K(ke,ze){m.a.B(Y,ke,ze)}function Q(){var ke=m.a.f(J());(ke===null||ke===e)&&(ke=""),xe!==e&&ke===xe?m.a.setTimeout(Q,4):Y.value!==ke&&(Ae=!0,Y.value=ke,Ae=!1,ce=Y.value)}function de(){ge||(xe=Y.value,ge=m.a.setTimeout(ye,4))}function ye(){clearTimeout(ge),xe=ge=e;var ke=Y.value;ce!==ke&&(ce=ke,m.m.eb(J(),j,"textInput",ke))}var ce=Y.value,ge,xe,De=m.a.W==9?de:ye,Ae=!1;B&&K("keypress",ye),11>B&&K("propertychange",function(ke){Ae||ke.propertyName!=="value"||De(ke)}),B==8&&(K("keyup",ye),K("keydown",ye)),W&&(W(Y,De),K("dragend",de)),(!B||9<=B)&&K("input",De),5>I&&m.a.R(Y)==="textarea"?(K("keydown",de),K("paste",de),K("cut",de)):11>w?K("keydown",de):4>N?(K("DOMAutoComplete",ye),K("dragdrop",ye),K("drop",ye)):H&&Y.type==="number"&&K("keydown",de),K("change",ye),K("blur",ye),m.o(Q,null,{l:Y})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(Y,J,j){j("textInput",Y)}}}(),m.c.uniqueName={init:function(g,E){if(E()){var w="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(g,w)}}},m.c.uniqueName.rd=0,m.c.using={init:function(g,E,w,I,N){var B;return w.has("as")&&(B={as:w.get("as"),noChildContext:w.get("noChildContext")}),E=N.createChildContext(E,B),m.Oa(E,g),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(g,E,w){var I=m.a.R(g),N=I=="input";if(!N||g.type!="checkbox"&&g.type!="radio"){var B=[],H=w.get("valueUpdate"),V=!1,G=null;H&&(typeof H=="string"?B=[H]:B=m.a.wc(H),m.a.Pa(B,"change"));var k=function(){G=null,V=!1;var J=E(),j=m.w.M(g);m.m.eb(J,w,"value",j)};!m.a.W||!N||g.type!="text"||g.autocomplete=="off"||g.form&&g.form.autocomplete=="off"||m.a.A(B,"propertychange")!=-1||(m.a.B(g,"propertychange",function(){V=!0}),m.a.B(g,"focus",function(){V=!1}),m.a.B(g,"blur",function(){V&&k()})),m.a.D(B,function(J){var j=k;m.a.Ud(J,"after")&&(j=function(){G=m.w.M(g),m.a.setTimeout(k,0)},J=J.substring(5)),m.a.B(g,J,j)});var W;if(W=N&&g.type=="file"?function(){var J=m.a.f(E());J===null||J===e||J===""?g.value="":m.u.G(k)}:function(){var J=m.a.f(E()),j=m.w.M(g);G!==null&&J===G?m.a.setTimeout(W,0):(J!==j||j===e)&&(I==="select"?(j=w.get("valueAllowUnset"),m.w.cb(g,J,j),j||J===m.w.M(g)||m.u.G(k)):m.w.cb(g,J))},I==="select"){var Y;m.i.subscribe(g,m.i.H,function(){Y?w.get("valueAllowUnset")?W():k():(m.a.B(g,"change",k),Y=m.o(W,null,{l:g}))},null,{notifyImmediately:!0})}else m.a.B(g,"change",k),m.o(W,null,{l:g})}else m.ib(g,{checkedValue:E})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(g,E){var w=m.a.f(E()),I=g.style.display!="none";w&&!I?g.style.display="":!w&&I&&(g.style.display="none")}},m.c.hidden={update:function(g,E){m.c.visible.update(g,function(){return!m.a.f(E())})}},function(g){m.c[g]={init:function(E,w,I,N,B){return m.c.event.init.call(this,E,function(){var H={};return H[g]=w(),H},I,N,B)}}}("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(g,E){if(typeof g=="string"){E=E||n;var w=E.getElementById(g);if(!w)throw Error("Cannot find template with ID "+g);return new m.C.F(w)}if(g.nodeType==1||g.nodeType==8)return new m.C.ia(g);throw Error("Unknown template type: "+g)},m.ca.prototype.renderTemplate=function(g,E,w,I){return g=this.makeTemplateSource(g,I),this.renderTemplateSource(g,E,w,I)},m.ca.prototype.isTemplateRewritten=function(g,E){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(g,E).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(g,E,w){g=this.makeTemplateSource(g,w),E=E(g.text()),g.text(E),g.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function g(I,N,B,H){I=m.m.ac(I);for(var V=m.m.Ra,G=0;G<I.length;G++){var k=I[G].key;if(Object.prototype.hasOwnProperty.call(V,k)){var W=V[k];if(typeof W=="function"){if(k=W(I[G].value))throw Error(k)}else if(!W)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return B="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+B.toLowerCase()+"')",H.createJavaScriptEvaluatorBlock(B)+N}var E=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,N,B){N.isTemplateRewritten(I,B)||N.rewriteTemplate(I,function(H){return m.kc.Ld(H,N)},B)},Ld:function(I,N){return I.replace(E,function(B,H,V,G,k){return g(k,H,V,N)}).replace(w,function(B,H){return g(H,"<!-- ko -->","#comment",N)})},md:function(I,N){return m.aa.Xb(function(B,H){var V=B.nextSibling;V&&V.nodeName.toLowerCase()===N&&m.ib(V,I,H)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(w){if(this.F=w){var I=m.a.R(w);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&w.content&&w.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var I=arguments[0];w==="innerHTML"?m.a.fc(this.F,I):this.F[w]=I};var g=m.a.g.Z()+"_";m.C.F.prototype.data=function(w){if(arguments.length===1)return m.a.g.get(this.F,g+w);m.a.g.set(this.F,g+w,arguments[1])};var E=m.a.g.Z();m.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var I=m.a.g.get(w,E)||{},N=I.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!N||I.jd){var B=this.text();B&&B!==I.bb&&(N=m.a.Md(B,w.ownerDocument),m.a.g.set(w,E,{lb:N,bb:B,jd:!0}))}return N}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(w,E,{lb:I})},m.C.ia=function(w){this.F=w},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var w=m.a.g.get(this.F,E)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}m.a.g.set(this.F,E,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function g(G,k,W){var Y;for(k=m.h.nextSibling(k);G&&(Y=G)!==k;)G=m.h.nextSibling(Y),W(Y,G)}function E(G,k){if(G.length){var W=G[0],Y=G[G.length-1],J=W.parentNode,j=m.ga.instance,K=j.preprocessNode;if(K){if(g(W,Y,function(Q,de){var ye=Q.previousSibling,ce=K.call(j,Q);ce&&(Q===W&&(W=ce[0]||de),Q===Y&&(Y=ce[ce.length-1]||ye))}),G.length=0,!W)return;W===Y?G.push(W):(G.push(W,Y),m.a.Ua(G,J))}g(W,Y,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.vc(k,Q)}),g(W,Y,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.aa.cd(Q,[k])}),m.a.Ua(G,J)}}function w(G){return G.nodeType?G:0<G.length?G[0]:null}function I(G,k,W,Y,J){J=J||{};var j=(G&&w(G)||W||{}).ownerDocument,K=J.templateEngine||B;if(m.kc.xd(W,K,j),W=K.renderTemplate(W,Y,J,j),typeof W.length!="number"||0<W.length&&typeof W[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(j=!1,k){case"replaceChildren":m.h.va(G,W),j=!0;break;case"replaceNode":m.a.Xc(G,W),j=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return j&&(E(W,Y),J.afterRender&&m.u.G(J.afterRender,null,[W,Y[J.as||"$data"]]),k=="replaceChildren"&&m.i.ma(G,m.i.H)),W}function N(G,k,W){return m.O(G)?G():typeof G=="function"?G(k,W):G}var B;m.gc=function(G){if(G!=e&&!(G instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");B=G},m.dc=function(G,k,W,Y,J){if(W=W||{},(W.templateEngine||B)==e)throw Error("Set a template engine before calling renderTemplate");if(J=J||"replaceChildren",Y){var j=w(Y);return m.$(function(){var Q=k&&k instanceof m.fa?k:new m.fa(k,null,null,null,{exportDependencies:!0}),K=N(G,Q.$data,Q),Q=I(Y,J,K,Q,W);J=="replaceNode"&&(Y=Q,j=w(Y))},null,{Sa:function(){return!j||!m.a.Sb(j)},l:j&&J=="replaceNode"?j.parentNode:j})}return m.aa.Xb(function(K){m.dc(G,k,W,K,"replaceNode")})},m.Qd=function(G,k,W,Y,J){function j(xe,De){m.u.G(m.a.ec,null,[Y,xe,Q,W,K,De]),m.i.ma(Y,m.i.H)}function K(xe,De){E(De,de),W.afterRender&&W.afterRender(De,xe),de=null}function Q(xe,De){de=J.createChildContext(xe,{as:ye,noChildContext:W.noChildContext,extend:function(ke){ke.$index=De,ye&&(ke[ye+"Index"]=De)}});var Ae=N(G,xe,de);return I(Y,"ignoreTargetNode",Ae,de,W)}var de,ye=W.as,ce=W.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!W.includeDestroyed;if(ce||W.beforeRemove||!m.Pc(k))return m.$(function(){var xe=m.a.f(k)||[];typeof xe.length>"u"&&(xe=[xe]),ce&&(xe=m.a.jb(xe,function(De){return De===e||De===null||!m.a.f(De._destroy)})),j(xe)},null,{l:Y});j(k.v());var ge=k.subscribe(function(xe){j(k(),xe)},null,"arrayChange");return ge.l(Y),ge};var H=m.a.g.Z(),V=m.a.g.Z();m.c.template={init:function(G,k){var W=m.a.f(k());if(typeof W=="string"||"name"in W)m.h.Ea(G);else if("nodes"in W){if(W=W.nodes||[],m.O(W))throw Error('The "nodes" option must be a plain, non-observable array.');var Y=W[0]&&W[0].parentNode;Y&&m.a.g.get(Y,V)||(Y=m.a.Yb(W),m.a.g.set(Y,V,!0)),new m.C.ia(G).nodes(Y)}else if(W=m.h.childNodes(G),0<W.length)Y=m.a.Yb(W),new m.C.ia(G).nodes(Y);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(G,k,W,Y,J){var j=k();k=m.a.f(j),W=!0,Y=null,typeof k=="string"?k={}:(j="name"in k?k.name:G,"if"in k&&(W=m.a.f(k.if)),W&&"ifnot"in k&&(W=!m.a.f(k.ifnot)),W&&!j&&(W=!1)),"foreach"in k?Y=m.Qd(j,W&&k.foreach||[],k,G,J):W?(W=J,"data"in k&&(W=J.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),Y=m.dc(j,W,k,G)):m.h.Ea(G),J=Y,(k=m.a.g.get(G,H))&&typeof k.s=="function"&&k.s(),m.a.g.set(G,H,!J||J.ja&&!J.ja()?e:J)}},m.m.Ra.template=function(G){return G=m.m.ac(G),G.length==1&&G[0].unknown||m.m.Id(G,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0}(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(g,E,w){if(g.length&&E.length){var I,N,B,H,V;for(I=N=0;(!w||I<w)&&(H=g[N]);++N){for(B=0;V=E[B];++B)if(H.value===V.value){H.moved=V.index,V.moved=H.index,E.splice(B,1),I=B=0;break}I+=B}}},m.a.Pb=function(){function g(E,w,I,N,B){var H=Math.min,V=Math.max,G=[],k,W=E.length,Y,J=w.length,j=J-W||1,K=W+J+1,Q,de,ye;for(k=0;k<=W;k++)for(de=Q,G.push(Q=[]),ye=H(J,k+j),Y=V(0,k-1);Y<=ye;Y++)Q[Y]=Y?k?E[k-1]===w[Y-1]?de[Y-1]:H(de[Y]||K,Q[Y-1]||K)+1:Y+1:k+1;for(H=[],V=[],j=[],k=W,Y=J;k||Y;)J=G[k][Y]-1,Y&&J===G[k][Y-1]?V.push(H[H.length]={status:I,value:w[--Y],index:Y}):k&&J===G[k-1][Y]?j.push(H[H.length]={status:N,value:E[--k],index:k}):(--Y,--k,B.sparse||H.push({status:"retained",value:w[Y]}));return m.a.Kc(j,V,!B.dontLimitMoves&&10*W),H.reverse()}return function(E,w,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},E=E||[],w=w||[],E.length<w.length?g(E,w,"added","deleted",I):g(w,E,"deleted","added",I)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function g(I,N,B,H,V){var G=[],k=m.$(function(){var W=N(B,V,m.a.Ua(G,I))||[];0<G.length&&(m.a.Xc(G,W),H&&m.u.G(H,null,[B,W,V])),G.length=0,m.a.Nb(G,W)},null,{l:I,Sa:function(){return!m.a.kd(G)}});return{Y:G,$:k.ja()?k:e}}var E=m.a.g.Z(),w=m.a.g.Z();m.a.ec=function(I,N,B,H,V,G){function k(ut){Ae={Aa:ut,pb:m.ta(de++)},K.push(Ae),j||De.push(Ae)}function W(ut){Ae=J[ut],de!==Ae.pb.v()&&xe.push(Ae),Ae.pb(de++),m.a.Ua(Ae.Y,I),K.push(Ae)}function Y(ut,Jt){if(ut)for(var Ce=0,Te=Jt.length;Ce<Te;Ce++)m.a.D(Jt[Ce].Y,function(it){ut(it,Ce,Jt[Ce].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),H=H||{};var J=m.a.g.get(I,E),j=!J,K=[],Q=0,de=0,ye=[],ce=[],ge=[],xe=[],De=[],Ae,ke=0;if(j)m.a.D(N,k);else{if(!G||J&&J._countWaitingForRemove){var ze=m.a.Mb(J,function(ut){return ut.Aa});G=m.a.Pb(ze,N,{dontLimitMoves:H.dontLimitMoves,sparse:!0})}for(var ze=0,et,St,mt;et=G[ze];ze++)switch(St=et.moved,mt=et.index,et.status){case"deleted":for(;Q<mt;)W(Q++);St===e&&(Ae=J[Q],Ae.$&&(Ae.$.s(),Ae.$=e),m.a.Ua(Ae.Y,I).length&&(H.beforeRemove&&(K.push(Ae),ke++,Ae.Aa===w?Ae=null:ge.push(Ae)),Ae&&ye.push.apply(ye,Ae.Y))),Q++;break;case"added":for(;de<mt;)W(Q++);St!==e?(ce.push(K.length),W(St)):k(et.value)}for(;de<N.length;)W(Q++);K._countWaitingForRemove=ke}m.a.g.set(I,E,K),Y(H.beforeMove,xe),m.a.D(ye,H.beforeRemove?m.oa:m.removeNode);var Be,Yt,Ct;try{Ct=I.ownerDocument.activeElement}catch{}if(ce.length)for(;(ze=ce.shift())!=e;){for(Ae=K[ze],Be=e;ze;)if((Yt=K[--ze].Y)&&Yt.length){Be=Yt[Yt.length-1];break}for(N=0;Q=Ae.Y[N];Be=Q,N++)m.h.Wb(I,Q,Be)}for(ze=0;Ae=K[ze];ze++){for(Ae.Y||m.a.extend(Ae,g(I,B,Ae.Aa,V,Ae.pb)),N=0;Q=Ae.Y[N];Be=Q,N++)m.h.Wb(I,Q,Be);!Ae.Ed&&V&&(V(Ae.Aa,Ae.Y,Ae.pb),Ae.Ed=!0,Be=Ae.Y[Ae.Y.length-1])}for(Ct&&I.ownerDocument.activeElement!=Ct&&Ct.focus(),Y(H.beforeRemove,ge),ze=0;ze<ge.length;++ze)ge[ze].Aa=w;Y(H.afterMove,xe),Y(H.afterAdd,De)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(g,E,w,I){return(E=!(9>m.a.W)&&g.nodes?g.nodes():null)?m.a.la(E.cloneNode(!0).childNodes):(g=g.text(),m.a.ua(g,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var E=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(w,I,N,B){if(B=B||n,N=N||{},2>E)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var H=w.data("precompiled");return H||(H=w.text()||"",H=o.template(null,"{{ko_with $item.koBindingContext}}"+H+"{{/ko_with}}"),w.data("precompiled",H)),w=[I.$data],I=o.extend({koBindingContext:I},N.templateOptions),I=o.tmpl(H,w,I),I.appendTo(B.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,I){n.write("<script type='text/html' id='"+w+"'>"+I+"<\/script>")},0<E&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var g=new m.$a;0<g.Hd&&m.gc(g),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var dAt=ko;typeof window<"u"?(ko=window.ko,typeof LP<"u"?window.ko=LP:delete window.ko):(ko=global.ko,typeof LP<"u"?global.ko=LP:delete global.ko);var ES=dAt;/** +Message: `+k.message,k}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function g(ce){var _e=(ce=m.a.g.get(ce,xe))&&ce.N;_e&&(ce.N=null,_e.Tc())}function E(ce,_e,be){this.node=ce,this.yc=_e,this.kb=[],this.H=!1,_e.N||m.a.K.za(ce,g),be&&be.N&&(be.N.kb.push(ce),this.Kb=be)}function w(ce){return function(){return ce}}function I(ce){return ce()}function N(ce){return m.a.Ga(m.u.G(ce),function(_e,be){return function(){return ce()[be]}})}function B(ce,_e,be){return typeof ce=="function"?N(ce.bind(null,_e,be)):m.a.Ga(ce,w)}function H(ce,_e){return N(this.getBindings.bind(this,ce,_e))}function V(ce,_e){var be=m.h.firstChild(_e);if(be){var De,Ae=m.ga.instance,ke=Ae.preprocessNode;if(ke){for(;De=be;)be=m.h.nextSibling(De),ke.call(Ae,De);be=m.h.firstChild(_e)}for(;De=be;)be=m.h.nextSibling(De),G(ce,De)}m.i.ma(_e,m.i.H)}function G(ce,_e){var be=ce,De=_e.nodeType===1;De&&m.h.Sc(_e),(De||m.ga.instance.nodeHasBindings(_e))&&(be=W(_e,null,ce).bindingContextForDescendants),be&&!Q[m.a.R(_e)]&&V(be,_e)}function k(ce){var _e=[],be={},De=[];return m.a.P(ce,function Ae(ke){if(!be[ke]){var ze=m.getBindingHandler(ke);ze&&(ze.after&&(De.push(ke),m.a.D(ze.after,function(et){if(ce[et]){if(m.a.A(De,et)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+De.join(", "));Ae(et)}}),De.length--),_e.push({key:ke,Mc:ze})),be[ke]=!0}}),_e}function W(ce,_e,be){var De=m.a.g.Ub(ce,xe,{}),Ae=De.hd;if(!_e){if(Ae)throw Error("You cannot apply bindings multiple times to the same element.");De.hd=!0}Ae||(De.context=be),De.Zb||(De.Zb={});var ke;if(_e&&typeof _e!="function")ke=_e;else{var ze=m.ga.instance,et=ze.getBindingAccessors||H,Et=m.$(function(){return(ke=_e?_e(be,ce):et.call(ze,ce,be))&&(be[J]&&be[J](),be[K]&&be[K]()),ke},null,{l:ce});ke&&Et.ja()||(Et=null)}var ht=be,Be;if(ke){var qt=function(){return m.a.Ga(Et?Et():ke,I)},Tt=Et?function(lt){return function(){return I(Et()[lt])}}:function(lt){return ke[lt]};qt.get=function(lt){return ke[lt]&&I(Tt(lt))},qt.has=function(lt){return lt in ke},m.i.H in ke&&m.i.subscribe(ce,m.i.H,function(){var lt=(0,ke[m.i.H])();if(lt){var Wn=m.h.childNodes(ce);Wn.length&<(Wn,m.Ec(Wn[0]))}}),m.i.pa in ke&&(ht=m.i.Cb(ce,be),m.i.subscribe(ce,m.i.pa,function(){var lt=(0,ke[m.i.pa])();lt&&m.h.firstChild(ce)&<(ce)})),De=k(ke),m.a.D(De,function(lt){var Wn=lt.Mc.init,on=lt.Mc.update,me=lt.key;if(ce.nodeType===8&&!m.h.ea[me])throw Error("The binding '"+me+"' cannot be used with virtual elements");try{typeof Wn=="function"&&m.u.G(function(){var Ce=Wn(ce,Tt(me),qt,ht.$data,ht);if(Ce&&Ce.controlsDescendantBindings){if(Be!==e)throw Error("Multiple bindings ("+Be+" and "+me+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Be=me}}),typeof on=="function"&&m.$(function(){on(ce,Tt(me),qt,ht.$data,ht)},null,{l:ce})}catch(Ce){throw Ce.message='Unable to process binding "'+me+": "+ke[me]+`" +Message: `+Ce.message,Ce}})}return De=Be===e,{shouldBindDescendants:De,bindingContextForDescendants:De&&ht}}function Y(ce,_e){return ce&&ce instanceof m.fa?ce:new m.fa(ce,e,e,_e)}var J=m.a.Da("_subscribable"),j=m.a.Da("_ancestorBindingInfo"),K=m.a.Da("_dataDependency");m.c={};var Q={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(ce){return m.c[ce]};var de={};m.fa=function(ce,_e,be,De,Ae){function ke(){var Tt=ht?Et():Et,lt=m.a.f(Tt);return _e?(m.a.extend(ze,_e),j in _e&&(ze[j]=_e[j])):(ze.$parents=[],ze.$root=lt,ze.ko=m),ze[J]=Be,et?lt=ze.$data:(ze.$rawData=Tt,ze.$data=lt),be&&(ze[be]=lt),De&&De(ze,_e,lt),_e&&_e[J]&&!m.S.o().Vb(_e[J])&&_e[J](),qt&&(ze[K]=qt),ze.$data}var ze=this,et=ce===de,Et=et?e:ce,ht=typeof Et=="function"&&!m.O(Et),Be,qt=Ae&&Ae.dataDependency;Ae&&Ae.exportDependencies?ke():(Be=m.xb(ke),Be.v(),Be.ja()?Be.equalityComparer=null:ze[J]=e)},m.fa.prototype.createChildContext=function(ce,_e,be,De){if(!De&&_e&&typeof _e=="object"&&(De=_e,_e=De.as,be=De.extend),_e&&De&&De.noChildContext){var Ae=typeof ce=="function"&&!m.O(ce);return new m.fa(de,this,null,function(ke){be&&be(ke),ke[_e]=Ae?ce():ce},De)}return new m.fa(ce,this,_e,function(ke,ze){ke.$parentContext=ze,ke.$parent=ze.$data,ke.$parents=(ze.$parents||[]).slice(0),ke.$parents.unshift(ke.$parent),be&&be(ke)},De)},m.fa.prototype.extend=function(ce,_e){return new m.fa(de,this,null,function(be){m.a.extend(be,typeof ce=="function"?ce(be):ce)},_e)};var xe=m.a.g.Z();E.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},E.prototype.sd=function(ce){m.a.Pa(this.kb,ce),!this.kb.length&&this.H&&this.Cc()},E.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,g),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ce,_e,be,De,Ae){var ke=m.a.g.Ub(ce,xe,{});return ke.Fa||(ke.Fa=new m.T),Ae&&Ae.notifyImmediately&&ke.Zb[_e]&&m.u.G(be,De,[ce]),ke.Fa.subscribe(be,De,_e)},ma:function(ce,_e){var be=m.a.g.get(ce,xe);if(be&&(be.Zb[_e]=!0,be.Fa&&be.Fa.notifySubscribers(ce,_e),_e==m.i.H)){if(be.N)be.N.Cc();else if(be.N===e&&be.Fa&&be.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ce,_e){var be=m.a.g.Ub(ce,xe,{});return be.N||(be.N=new E(ce,be,_e[j])),_e[j]==be?_e:_e.extend(function(De){De[j]=be})}},m.Td=function(ce){return(ce=m.a.g.get(ce,xe))&&ce.context},m.ib=function(ce,_e,be){return ce.nodeType===1&&m.h.Sc(ce),W(ce,_e,Y(be))},m.ld=function(ce,_e,be){return be=Y(be),m.ib(ce,B(_e,be,ce),be)},m.Oa=function(ce,_e){_e.nodeType!==1&&_e.nodeType!==8||V(Y(ce),_e)},m.vc=function(ce,_e,be){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(_e=n.body,!_e)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!_e||_e.nodeType!==1&&_e.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");G(Y(ce,be),_e)},m.Dc=function(ce){return!ce||ce.nodeType!==1&&ce.nodeType!==8?e:m.Td(ce)},m.Ec=function(ce){return(ce=m.Dc(ce))?ce.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)}(),function(g){function E(H,V){var G=Object.prototype.hasOwnProperty.call(N,H)?N[H]:g,k;G?G.subscribe(V):(G=N[H]=new m.T,G.subscribe(V),w(H,function(W,Y){var J=!(!Y||!Y.synchronous);B[H]={definition:W,Gd:J},delete N[H],k||J?G.notifySubscribers(W):m.na.zb(function(){G.notifySubscribers(W)})}),k=!0)}function w(H,V){I("getConfig",[H],function(G){G?I("loadComponent",[H,G],function(k){V(k,G)}):V(null,null)})}function I(H,V,G,k){k||(k=m.j.loaders.slice(0));var W=k.shift();if(W){var Y=W[H];if(Y){var J=!1;if(Y.apply(W,V.concat(function(j){J?G(null):j!==null?G(j):I(H,V,G,k)}))!==g&&(J=!0,!W.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(H,V,G,k)}else G(null)}var N={},B={};m.j={get:function(H,V){var G=Object.prototype.hasOwnProperty.call(B,H)?B[H]:g;G?G.Gd?m.u.G(function(){V(G.definition)}):m.na.zb(function(){V(G.definition)}):E(H,V)},Bc:function(H){delete B[H]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function g(G,k,W,Y){function J(){--K===0&&Y(j)}var j={},K=2,Q=W.template;W=W.viewModel,Q?N(k,Q,function(de){m.j.oc("loadTemplate",[G,de],function(xe){j.template=xe,J()})}):J(),W?N(k,W,function(de){m.j.oc("loadViewModel",[G,de],function(xe){j[V]=xe,J()})}):J()}function E(G,k,W){if(typeof k=="function")W(function(J){return new k(J)});else if(typeof k[V]=="function")W(k[V]);else if("instance"in k){var Y=k.instance;W(function(){return Y})}else"viewModel"in k?E(G,k.viewModel,W):G("Unknown viewModel value: "+k)}function w(G){switch(m.a.R(G)){case"script":return m.a.ua(G.text);case"textarea":return m.a.ua(G.value);case"template":if(I(G.content))return m.a.Ca(G.content.childNodes)}return m.a.Ca(G.childNodes)}function I(G){return t.DocumentFragment?G instanceof DocumentFragment:G&&G.nodeType===11}function N(G,k,W){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(Y){Y&&typeof Y=="object"&&Y.Xd&&Y.default&&(Y=Y.default),W(Y)}):G("Uses require, but no AMD loader is present"):W(k)}function B(G){return function(k){throw Error("Component '"+G+"': "+k)}}var H={};m.j.register=function(G,k){if(!k)throw Error("Invalid configuration for "+G);if(m.j.tb(G))throw Error("Component "+G+" is already registered");H[G]=k},m.j.tb=function(G){return Object.prototype.hasOwnProperty.call(H,G)},m.j.unregister=function(G){delete H[G],m.j.Bc(G)},m.j.Fc={getConfig:function(G,k){k(m.j.tb(G)?H[G]:null)},loadComponent:function(G,k,W){var Y=B(G);N(Y,k,function(J){g(G,Y,J,W)})},loadTemplate:function(G,k,W){if(G=B(G),typeof k=="string")W(m.a.ua(k));else if(k instanceof Array)W(k);else if(I(k))W(m.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)W(w(k));else if(typeof k=="string"){var Y=n.getElementById(k);Y?W(w(Y)):G("Cannot find element with ID "+k)}else G("Unknown element type: "+k);else G("Unknown template value: "+k)},loadViewModel:function(G,k,W){E(B(G),k,W)}};var V="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=H}(),function(){function g(w,I){var N=w.getAttribute("params");if(N){var N=E.parseBindingsString(N,I,w,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(V){return m.o(V,null,{l:w})}),B=m.a.Ga(N,function(V){var G=V.v();return V.ja()?m.o({read:function(){return m.a.f(V())},write:m.Za(G)&&function(k){V()(k)},l:w}):G});return Object.prototype.hasOwnProperty.call(B,"$raw")||(B.$raw=N),B}return{$raw:{}}}m.j.getComponentNameForNode=function(w){var I=m.a.R(w);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=m.a.W&&w.tagName===I))return I},m.j.tc=function(w,I,N,B){if(I.nodeType===1){var H=m.j.getComponentNameForNode(I);if(H){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:H,params:g(I,N)};w.component=B?function(){return V}:V}}return w};var E=new m.ga;9>m.a.W&&(m.j.register=function(w){return function(I){return w.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(w){return function(){var I=w(),N=m.j.dd,B;for(B in N);return I}}(n.createDocumentFragment))}(),function(){function g(I,N,B){if(N=N.template,!N)throw Error("Component '"+I+"' has no template");I=m.a.Ca(N),m.h.va(B,I)}function E(I,N,B){var H=I.createViewModel;return H?H.call(I,N,B):N}var w=0;m.c.component={init:function(I,N,B,H,V){function G(){var j=k&&k.dispose;typeof j=="function"&&j.call(k),Y&&Y.s(),W=k=Y=null}var k,W,Y,J=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,G),m.o(function(){var j=m.a.f(N()),K,Q;if(typeof j=="string"?K=j:(K=m.a.f(j.name),Q=m.a.f(j.params)),!K)throw Error("No component name specified");var de=m.i.Cb(I,V),xe=W=++w;m.j.get(K,function(ce){if(W===xe){if(G(),!ce)throw Error("Unknown component '"+K+"'");g(K,ce,I);var _e=E(ce,Q,{element:I,templateNodes:J});ce=de.createChildContext(_e,{extend:function(be){be.$component=_e,be.$componentTemplateNodes=J}}),_e&&_e.koDescendantsComplete&&(Y=m.i.subscribe(I,m.i.pa,_e.koDescendantsComplete,_e)),k=_e,m.Oa(ce,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var M={class:"className",for:"htmlFor"};m.c.attr={update:function(g,E){var w=m.a.f(E())||{};m.a.P(w,function(I,N){N=m.a.f(N);var B=I.indexOf(":"),B="lookupNamespaceURI"in g&&0<B&&g.lookupNamespaceURI(I.substr(0,B)),H=N===!1||N===null||N===e;H?B?g.removeAttributeNS(B,I):g.removeAttribute(I):N=N.toString(),8>=m.a.W&&I in M?(I=M[I],H?g.removeAttribute(I):g[I]=N):H||(B?g.setAttributeNS(B,I,N):g.setAttribute(I,N)),I==="name"&&m.a.Yc(g,H?"":N)})}},function(){m.c.checked={after:["value","attr"],init:function(g,E,w){function I(){var j=g.checked,K=B();if(!m.S.Ya()&&(j||!V&&!m.S.qa())){var Q=m.u.G(E);if(k){var de=W?Q.v():Q,xe=J;J=K,xe!==K?j&&(m.a.Na(de,K,!0),m.a.Na(de,xe,!1)):m.a.Na(de,K,j),W&&m.Za(Q)&&Q(de)}else H&&(K===e?K=j:j||(K=e)),m.m.eb(Q,w,"checked",K,!0)}}function N(){var j=m.a.f(E()),K=B();k?(g.checked=0<=m.a.A(j,K),J=K):g.checked=H&&K===e?!!j:B()===j}var B=m.xb(function(){if(w.has("checkedValue"))return m.a.f(w.get("checkedValue"));if(Y)return w.has("value")?m.a.f(w.get("value")):g.value}),H=g.type=="checkbox",V=g.type=="radio";if(H||V){var G=E(),k=H&&m.a.f(G)instanceof Array,W=!(k&&G.push&&G.splice),Y=V||k,J=k?B():e;V&&!g.name&&m.c.uniqueName.init(g,function(){return!0}),m.o(I,null,{l:g}),m.a.B(g,"click",I),m.o(N,null,{l:g}),G=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(g,E){g.value=m.a.f(E())}}}(),m.c.class={update:function(g,E){var w=m.a.Db(m.a.f(E()));m.a.Eb(g,g.__ko__cssValue,!1),g.__ko__cssValue=w,m.a.Eb(g,w,!0)}},m.c.css={update:function(g,E){var w=m.a.f(E());w!==null&&typeof w=="object"?m.a.P(w,function(I,N){N=m.a.f(N),m.a.Eb(g,I,N)}):m.c.class.update(g,E)}},m.c.enable={update:function(g,E){var w=m.a.f(E());w&&g.disabled?g.removeAttribute("disabled"):w||g.disabled||(g.disabled=!0)}},m.c.disable={update:function(g,E){m.c.enable.update(g,function(){return!m.a.f(E())})}},m.c.event={init:function(g,E,w,I,N){var B=E()||{};m.a.P(B,function(H){typeof H=="string"&&m.a.B(g,H,function(V){var G,k=E()[H];if(k){try{var W=m.a.la(arguments);I=N.$data,W.unshift(I),G=k.apply(I,W)}finally{G!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}w.get(H+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},m.c.foreach={Rc:function(g){return function(){var E=g(),w=m.a.bc(E);return!w||typeof w.length=="number"?{foreach:E,templateEngine:m.ba.Ma}:(m.a.f(E),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:m.ba.Ma})}},init:function(g,E){return m.c.template.init(g,m.c.foreach.Rc(E))},update:function(g,E,w,I,N){return m.c.template.update(g,m.c.foreach.Rc(E),w,I,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(g,E,w){function I(H){g.__ko_hasfocusUpdating=!0;var V=g.ownerDocument;if("activeElement"in V){var G;try{G=V.activeElement}catch{G=V.body}H=G===g}V=E(),m.m.eb(V,w,"hasfocus",H,!0),g.__ko_hasfocusLastValue=H,g.__ko_hasfocusUpdating=!1}var N=I.bind(null,!0),B=I.bind(null,!1);m.a.B(g,"focus",N),m.a.B(g,"focusin",N),m.a.B(g,"blur",B),m.a.B(g,"focusout",B),g.__ko_hasfocusLastValue=!1},update:function(g,E){var w=!!m.a.f(E());g.__ko_hasfocusUpdating||g.__ko_hasfocusLastValue===w||(w?g.focus():g.blur(),!w&&g.__ko_hasfocusLastValue&&g.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[g,w?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(g,E){m.a.fc(g,E())}},function(){function g(E,w,I){m.c[E]={init:function(N,B,H,V,G){var k,W,Y={},J,j,K;if(w){V=H.get("as");var Q=H.get("noChildContext");K=!(V&&Q),Y={as:V,noChildContext:Q,exportDependencies:K}}return j=(J=H.get("completeOn")=="render")||H.has(m.i.pa),m.o(function(){var de=m.a.f(B()),xe=!I!=!de,ce=!W,_e;(K||xe!==k)&&(j&&(G=m.i.Cb(N,G)),xe&&((!w||K)&&(Y.dataDependency=m.S.o()),_e=w?G.createChildContext(typeof de=="function"?de:B,Y):m.S.qa()?G.extend(null,Y):G),ce&&m.S.qa()&&(W=m.a.Ca(m.h.childNodes(N),!0)),xe?(ce||m.h.va(N,m.a.Ca(W)),m.Oa(_e,N)):(m.h.Ea(N),J||m.i.ma(N,m.i.H)),k=xe)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[E]=!1,m.h.ea[E]=!0}g("if"),g("ifnot",!1,!0),g("with",!0)}(),m.c.let={init:function(g,E,w,I,N){return E=N.extend(E),m.Oa(E,g),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(g){if(m.a.R(g)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<g.length;)g.remove(0);return{controlsDescendantBindings:!0}},update:function(g,E,w){function I(){return m.a.jb(g.options,function(Q){return Q.selected})}function N(Q,de,xe){var ce=typeof de;return ce=="function"?de(Q):ce=="string"?Q[de]:xe}function B(Q,de){if(j&&k)m.i.ma(g,m.i.H);else if(J.length){var xe=0<=m.a.A(J,m.w.M(de[0]));m.a.Zc(de[0],xe),j&&!xe&&m.u.G(m.a.Fb,null,[g,"change"])}}var H=g.multiple,V=g.length!=0&&H?g.scrollTop:null,G=m.a.f(E()),k=w.get("valueAllowUnset")&&w.has("value"),W=w.get("optionsIncludeDestroyed");E={};var Y,J=[];k||(H?J=m.a.Mb(I(),m.w.M):0<=g.selectedIndex&&J.push(m.w.M(g.options[g.selectedIndex]))),G&&(typeof G.length>"u"&&(G=[G]),Y=m.a.jb(G,function(Q){return W||Q===e||Q===null||!m.a.f(Q._destroy)}),w.has("optionsCaption")&&(G=m.a.f(w.get("optionsCaption")),G!==null&&G!==e&&Y.unshift(L)));var j=!1;if(E.beforeRemove=function(Q){g.removeChild(Q)},G=B,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(G=function(Q,de){B(0,de),m.u.G(w.get("optionsAfterRender"),null,[de[0],Q!==L?Q:e])}),m.a.ec(g,Y,function(Q,de,xe){return xe.length&&(J=!k&&xe[0].selected?[m.w.M(xe[0])]:[],j=!0),de=g.ownerDocument.createElement("option"),Q===L?(m.a.Bb(de,w.get("optionsCaption")),m.w.cb(de,e)):(xe=N(Q,w.get("optionsValue"),Q),m.w.cb(de,m.a.f(xe)),Q=N(Q,w.get("optionsText"),xe),m.a.Bb(de,Q)),[de]},E,G),!k){var K;H?K=J.length&&I().length<J.length:K=J.length&&0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex])!==J[0]:J.length||0<=g.selectedIndex,K&&m.u.G(m.a.Fb,null,[g,"change"])}(k||m.S.Ya())&&m.i.ma(g,m.i.H),m.a.wd(g),V&&20<Math.abs(V-g.scrollTop)&&(g.scrollTop=V)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(g,E,w){function I(){var H=E(),V=[];m.a.D(g.getElementsByTagName("option"),function(G){G.selected&&V.push(m.w.M(G))}),m.m.eb(H,w,"selectedOptions",V)}function N(){var H=m.a.f(E()),V=g.scrollTop;H&&typeof H.length=="number"&&m.a.D(g.getElementsByTagName("option"),function(G){var k=0<=m.a.A(H,m.w.M(G));G.selected!=k&&m.a.Zc(G,k)}),g.scrollTop=V}if(m.a.R(g)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var B;m.i.subscribe(g,m.i.H,function(){B?I():(m.a.B(g,"change",I),B=m.o(N,null,{l:g}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(g,E){var w=m.a.f(E()||{});m.a.P(w,function(I,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),o)o(g).css(I,N);else if(/^--/.test(I))g.style.setProperty(I,N);else{I=I.replace(/-(\w)/g,function(H,V){return V.toUpperCase()});var B=g.style[I];g.style[I]=N,N===B||g.style[I]!=B||isNaN(N)||(g.style[I]=N+"px")}})}},m.c.submit={init:function(g,E,w,I,N){if(typeof E()!="function")throw Error("The value for a submit binding must be a function");m.a.B(g,"submit",function(B){var H,V=E();try{H=V.call(N.$data,g)}finally{H!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(g,E){m.a.Bb(g,E())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var g=function(Y){if(Y)return parseFloat(Y[1])},E=t.navigator.userAgent,w,I,N,B,H;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(H=g(E.match(/Edge\/([^ ]+)$/)))||g(E.match(/Chrome\/([^ ]+)/))||(I=g(E.match(/Version\/([^ ]+) Safari/)))||(N=g(E.match(/Firefox\/([^ ]+)/)))||(B=m.a.W||g(E.match(/MSIE ([^ ]+)/)))||(B=g(E.match(/rv:([^ )]+)/)))}if(8<=B&&10>B)var V=m.a.g.Z(),G=m.a.g.Z(),k=function(Y){var J=this.activeElement;(J=J&&m.a.g.get(J,G))&&J(Y)},W=function(Y,J){var j=Y.ownerDocument;m.a.g.get(j,V)||(m.a.g.set(j,V,!0),m.a.B(j,"selectionchange",k)),m.a.g.set(Y,G,J)};m.c.textInput={init:function(Y,J,j){function K(ke,ze){m.a.B(Y,ke,ze)}function Q(){var ke=m.a.f(J());(ke===null||ke===e)&&(ke=""),be!==e&&ke===be?m.a.setTimeout(Q,4):Y.value!==ke&&(Ae=!0,Y.value=ke,Ae=!1,ce=Y.value)}function de(){_e||(be=Y.value,_e=m.a.setTimeout(xe,4))}function xe(){clearTimeout(_e),be=_e=e;var ke=Y.value;ce!==ke&&(ce=ke,m.m.eb(J(),j,"textInput",ke))}var ce=Y.value,_e,be,De=m.a.W==9?de:xe,Ae=!1;B&&K("keypress",xe),11>B&&K("propertychange",function(ke){Ae||ke.propertyName!=="value"||De(ke)}),B==8&&(K("keyup",xe),K("keydown",xe)),W&&(W(Y,De),K("dragend",de)),(!B||9<=B)&&K("input",De),5>I&&m.a.R(Y)==="textarea"?(K("keydown",de),K("paste",de),K("cut",de)):11>w?K("keydown",de):4>N?(K("DOMAutoComplete",xe),K("dragdrop",xe),K("drop",xe)):H&&Y.type==="number"&&K("keydown",de),K("change",xe),K("blur",xe),m.o(Q,null,{l:Y})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(Y,J,j){j("textInput",Y)}}}(),m.c.uniqueName={init:function(g,E){if(E()){var w="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(g,w)}}},m.c.uniqueName.rd=0,m.c.using={init:function(g,E,w,I,N){var B;return w.has("as")&&(B={as:w.get("as"),noChildContext:w.get("noChildContext")}),E=N.createChildContext(E,B),m.Oa(E,g),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(g,E,w){var I=m.a.R(g),N=I=="input";if(!N||g.type!="checkbox"&&g.type!="radio"){var B=[],H=w.get("valueUpdate"),V=!1,G=null;H&&(typeof H=="string"?B=[H]:B=m.a.wc(H),m.a.Pa(B,"change"));var k=function(){G=null,V=!1;var J=E(),j=m.w.M(g);m.m.eb(J,w,"value",j)};!m.a.W||!N||g.type!="text"||g.autocomplete=="off"||g.form&&g.form.autocomplete=="off"||m.a.A(B,"propertychange")!=-1||(m.a.B(g,"propertychange",function(){V=!0}),m.a.B(g,"focus",function(){V=!1}),m.a.B(g,"blur",function(){V&&k()})),m.a.D(B,function(J){var j=k;m.a.Ud(J,"after")&&(j=function(){G=m.w.M(g),m.a.setTimeout(k,0)},J=J.substring(5)),m.a.B(g,J,j)});var W;if(W=N&&g.type=="file"?function(){var J=m.a.f(E());J===null||J===e||J===""?g.value="":m.u.G(k)}:function(){var J=m.a.f(E()),j=m.w.M(g);G!==null&&J===G?m.a.setTimeout(W,0):(J!==j||j===e)&&(I==="select"?(j=w.get("valueAllowUnset"),m.w.cb(g,J,j),j||J===m.w.M(g)||m.u.G(k)):m.w.cb(g,J))},I==="select"){var Y;m.i.subscribe(g,m.i.H,function(){Y?w.get("valueAllowUnset")?W():k():(m.a.B(g,"change",k),Y=m.o(W,null,{l:g}))},null,{notifyImmediately:!0})}else m.a.B(g,"change",k),m.o(W,null,{l:g})}else m.ib(g,{checkedValue:E})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(g,E){var w=m.a.f(E()),I=g.style.display!="none";w&&!I?g.style.display="":!w&&I&&(g.style.display="none")}},m.c.hidden={update:function(g,E){m.c.visible.update(g,function(){return!m.a.f(E())})}},function(g){m.c[g]={init:function(E,w,I,N,B){return m.c.event.init.call(this,E,function(){var H={};return H[g]=w(),H},I,N,B)}}}("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(g,E){if(typeof g=="string"){E=E||n;var w=E.getElementById(g);if(!w)throw Error("Cannot find template with ID "+g);return new m.C.F(w)}if(g.nodeType==1||g.nodeType==8)return new m.C.ia(g);throw Error("Unknown template type: "+g)},m.ca.prototype.renderTemplate=function(g,E,w,I){return g=this.makeTemplateSource(g,I),this.renderTemplateSource(g,E,w,I)},m.ca.prototype.isTemplateRewritten=function(g,E){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(g,E).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(g,E,w){g=this.makeTemplateSource(g,w),E=E(g.text()),g.text(E),g.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function g(I,N,B,H){I=m.m.ac(I);for(var V=m.m.Ra,G=0;G<I.length;G++){var k=I[G].key;if(Object.prototype.hasOwnProperty.call(V,k)){var W=V[k];if(typeof W=="function"){if(k=W(I[G].value))throw Error(k)}else if(!W)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return B="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+B.toLowerCase()+"')",H.createJavaScriptEvaluatorBlock(B)+N}var E=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,N,B){N.isTemplateRewritten(I,B)||N.rewriteTemplate(I,function(H){return m.kc.Ld(H,N)},B)},Ld:function(I,N){return I.replace(E,function(B,H,V,G,k){return g(k,H,V,N)}).replace(w,function(B,H){return g(H,"<!-- ko -->","#comment",N)})},md:function(I,N){return m.aa.Xb(function(B,H){var V=B.nextSibling;V&&V.nodeName.toLowerCase()===N&&m.ib(V,I,H)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(w){if(this.F=w){var I=m.a.R(w);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&w.content&&w.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var I=arguments[0];w==="innerHTML"?m.a.fc(this.F,I):this.F[w]=I};var g=m.a.g.Z()+"_";m.C.F.prototype.data=function(w){if(arguments.length===1)return m.a.g.get(this.F,g+w);m.a.g.set(this.F,g+w,arguments[1])};var E=m.a.g.Z();m.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var I=m.a.g.get(w,E)||{},N=I.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!N||I.jd){var B=this.text();B&&B!==I.bb&&(N=m.a.Md(B,w.ownerDocument),m.a.g.set(w,E,{lb:N,bb:B,jd:!0}))}return N}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(w,E,{lb:I})},m.C.ia=function(w){this.F=w},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var w=m.a.g.get(this.F,E)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}m.a.g.set(this.F,E,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function g(G,k,W){var Y;for(k=m.h.nextSibling(k);G&&(Y=G)!==k;)G=m.h.nextSibling(Y),W(Y,G)}function E(G,k){if(G.length){var W=G[0],Y=G[G.length-1],J=W.parentNode,j=m.ga.instance,K=j.preprocessNode;if(K){if(g(W,Y,function(Q,de){var xe=Q.previousSibling,ce=K.call(j,Q);ce&&(Q===W&&(W=ce[0]||de),Q===Y&&(Y=ce[ce.length-1]||xe))}),G.length=0,!W)return;W===Y?G.push(W):(G.push(W,Y),m.a.Ua(G,J))}g(W,Y,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.vc(k,Q)}),g(W,Y,function(Q){Q.nodeType!==1&&Q.nodeType!==8||m.aa.cd(Q,[k])}),m.a.Ua(G,J)}}function w(G){return G.nodeType?G:0<G.length?G[0]:null}function I(G,k,W,Y,J){J=J||{};var j=(G&&w(G)||W||{}).ownerDocument,K=J.templateEngine||B;if(m.kc.xd(W,K,j),W=K.renderTemplate(W,Y,J,j),typeof W.length!="number"||0<W.length&&typeof W[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(j=!1,k){case"replaceChildren":m.h.va(G,W),j=!0;break;case"replaceNode":m.a.Xc(G,W),j=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return j&&(E(W,Y),J.afterRender&&m.u.G(J.afterRender,null,[W,Y[J.as||"$data"]]),k=="replaceChildren"&&m.i.ma(G,m.i.H)),W}function N(G,k,W){return m.O(G)?G():typeof G=="function"?G(k,W):G}var B;m.gc=function(G){if(G!=e&&!(G instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");B=G},m.dc=function(G,k,W,Y,J){if(W=W||{},(W.templateEngine||B)==e)throw Error("Set a template engine before calling renderTemplate");if(J=J||"replaceChildren",Y){var j=w(Y);return m.$(function(){var Q=k&&k instanceof m.fa?k:new m.fa(k,null,null,null,{exportDependencies:!0}),K=N(G,Q.$data,Q),Q=I(Y,J,K,Q,W);J=="replaceNode"&&(Y=Q,j=w(Y))},null,{Sa:function(){return!j||!m.a.Sb(j)},l:j&&J=="replaceNode"?j.parentNode:j})}return m.aa.Xb(function(K){m.dc(G,k,W,K,"replaceNode")})},m.Qd=function(G,k,W,Y,J){function j(be,De){m.u.G(m.a.ec,null,[Y,be,Q,W,K,De]),m.i.ma(Y,m.i.H)}function K(be,De){E(De,de),W.afterRender&&W.afterRender(De,be),de=null}function Q(be,De){de=J.createChildContext(be,{as:xe,noChildContext:W.noChildContext,extend:function(ke){ke.$index=De,xe&&(ke[xe+"Index"]=De)}});var Ae=N(G,be,de);return I(Y,"ignoreTargetNode",Ae,de,W)}var de,xe=W.as,ce=W.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!W.includeDestroyed;if(ce||W.beforeRemove||!m.Pc(k))return m.$(function(){var be=m.a.f(k)||[];typeof be.length>"u"&&(be=[be]),ce&&(be=m.a.jb(be,function(De){return De===e||De===null||!m.a.f(De._destroy)})),j(be)},null,{l:Y});j(k.v());var _e=k.subscribe(function(be){j(k(),be)},null,"arrayChange");return _e.l(Y),_e};var H=m.a.g.Z(),V=m.a.g.Z();m.c.template={init:function(G,k){var W=m.a.f(k());if(typeof W=="string"||"name"in W)m.h.Ea(G);else if("nodes"in W){if(W=W.nodes||[],m.O(W))throw Error('The "nodes" option must be a plain, non-observable array.');var Y=W[0]&&W[0].parentNode;Y&&m.a.g.get(Y,V)||(Y=m.a.Yb(W),m.a.g.set(Y,V,!0)),new m.C.ia(G).nodes(Y)}else if(W=m.h.childNodes(G),0<W.length)Y=m.a.Yb(W),new m.C.ia(G).nodes(Y);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(G,k,W,Y,J){var j=k();k=m.a.f(j),W=!0,Y=null,typeof k=="string"?k={}:(j="name"in k?k.name:G,"if"in k&&(W=m.a.f(k.if)),W&&"ifnot"in k&&(W=!m.a.f(k.ifnot)),W&&!j&&(W=!1)),"foreach"in k?Y=m.Qd(j,W&&k.foreach||[],k,G,J):W?(W=J,"data"in k&&(W=J.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),Y=m.dc(j,W,k,G)):m.h.Ea(G),J=Y,(k=m.a.g.get(G,H))&&typeof k.s=="function"&&k.s(),m.a.g.set(G,H,!J||J.ja&&!J.ja()?e:J)}},m.m.Ra.template=function(G){return G=m.m.ac(G),G.length==1&&G[0].unknown||m.m.Id(G,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0}(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(g,E,w){if(g.length&&E.length){var I,N,B,H,V;for(I=N=0;(!w||I<w)&&(H=g[N]);++N){for(B=0;V=E[B];++B)if(H.value===V.value){H.moved=V.index,V.moved=H.index,E.splice(B,1),I=B=0;break}I+=B}}},m.a.Pb=function(){function g(E,w,I,N,B){var H=Math.min,V=Math.max,G=[],k,W=E.length,Y,J=w.length,j=J-W||1,K=W+J+1,Q,de,xe;for(k=0;k<=W;k++)for(de=Q,G.push(Q=[]),xe=H(J,k+j),Y=V(0,k-1);Y<=xe;Y++)Q[Y]=Y?k?E[k-1]===w[Y-1]?de[Y-1]:H(de[Y]||K,Q[Y-1]||K)+1:Y+1:k+1;for(H=[],V=[],j=[],k=W,Y=J;k||Y;)J=G[k][Y]-1,Y&&J===G[k][Y-1]?V.push(H[H.length]={status:I,value:w[--Y],index:Y}):k&&J===G[k-1][Y]?j.push(H[H.length]={status:N,value:E[--k],index:k}):(--Y,--k,B.sparse||H.push({status:"retained",value:w[Y]}));return m.a.Kc(j,V,!B.dontLimitMoves&&10*W),H.reverse()}return function(E,w,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},E=E||[],w=w||[],E.length<w.length?g(E,w,"added","deleted",I):g(w,E,"deleted","added",I)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function g(I,N,B,H,V){var G=[],k=m.$(function(){var W=N(B,V,m.a.Ua(G,I))||[];0<G.length&&(m.a.Xc(G,W),H&&m.u.G(H,null,[B,W,V])),G.length=0,m.a.Nb(G,W)},null,{l:I,Sa:function(){return!m.a.kd(G)}});return{Y:G,$:k.ja()?k:e}}var E=m.a.g.Z(),w=m.a.g.Z();m.a.ec=function(I,N,B,H,V,G){function k(lt){Ae={Aa:lt,pb:m.ta(de++)},K.push(Ae),j||De.push(Ae)}function W(lt){Ae=J[lt],de!==Ae.pb.v()&&be.push(Ae),Ae.pb(de++),m.a.Ua(Ae.Y,I),K.push(Ae)}function Y(lt,Wn){if(lt)for(var on=0,me=Wn.length;on<me;on++)m.a.D(Wn[on].Y,function(Ce){lt(Ce,on,Wn[on].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),H=H||{};var J=m.a.g.get(I,E),j=!J,K=[],Q=0,de=0,xe=[],ce=[],_e=[],be=[],De=[],Ae,ke=0;if(j)m.a.D(N,k);else{if(!G||J&&J._countWaitingForRemove){var ze=m.a.Mb(J,function(lt){return lt.Aa});G=m.a.Pb(ze,N,{dontLimitMoves:H.dontLimitMoves,sparse:!0})}for(var ze=0,et,Et,ht;et=G[ze];ze++)switch(Et=et.moved,ht=et.index,et.status){case"deleted":for(;Q<ht;)W(Q++);Et===e&&(Ae=J[Q],Ae.$&&(Ae.$.s(),Ae.$=e),m.a.Ua(Ae.Y,I).length&&(H.beforeRemove&&(K.push(Ae),ke++,Ae.Aa===w?Ae=null:_e.push(Ae)),Ae&&xe.push.apply(xe,Ae.Y))),Q++;break;case"added":for(;de<ht;)W(Q++);Et!==e?(ce.push(K.length),W(Et)):k(et.value)}for(;de<N.length;)W(Q++);K._countWaitingForRemove=ke}m.a.g.set(I,E,K),Y(H.beforeMove,be),m.a.D(xe,H.beforeRemove?m.oa:m.removeNode);var Be,qt,Tt;try{Tt=I.ownerDocument.activeElement}catch{}if(ce.length)for(;(ze=ce.shift())!=e;){for(Ae=K[ze],Be=e;ze;)if((qt=K[--ze].Y)&&qt.length){Be=qt[qt.length-1];break}for(N=0;Q=Ae.Y[N];Be=Q,N++)m.h.Wb(I,Q,Be)}for(ze=0;Ae=K[ze];ze++){for(Ae.Y||m.a.extend(Ae,g(I,B,Ae.Aa,V,Ae.pb)),N=0;Q=Ae.Y[N];Be=Q,N++)m.h.Wb(I,Q,Be);!Ae.Ed&&V&&(V(Ae.Aa,Ae.Y,Ae.pb),Ae.Ed=!0,Be=Ae.Y[Ae.Y.length-1])}for(Tt&&I.ownerDocument.activeElement!=Tt&&Tt.focus(),Y(H.beforeRemove,_e),ze=0;ze<_e.length;++ze)_e[ze].Aa=w;Y(H.afterMove,be),Y(H.afterAdd,De)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(g,E,w,I){return(E=!(9>m.a.W)&&g.nodes?g.nodes():null)?m.a.la(E.cloneNode(!0).childNodes):(g=g.text(),m.a.ua(g,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var E=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(w,I,N,B){if(B=B||n,N=N||{},2>E)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var H=w.data("precompiled");return H||(H=w.text()||"",H=o.template(null,"{{ko_with $item.koBindingContext}}"+H+"{{/ko_with}}"),w.data("precompiled",H)),w=[I.$data],I=o.extend({koBindingContext:I},N.templateOptions),I=o.tmpl(H,w,I),I.appendTo(B.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,I){n.write("<script type='text/html' id='"+w+"'>"+I+"<\/script>")},0<E&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var g=new m.$a;0<g.Hd&&m.gc(g),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var gAt=ko;typeof window<"u"?(ko=window.ko,typeof kP<"u"?window.ko=kP:delete window.ko):(ko=global.ko,typeof kP<"u"?global.ko=kP:delete global.ko);var wS=gAt;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var mZ="__knockoutObservables",pZ="__knockoutSubscribable";function NCe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=FCe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===mZ||o===pZ)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&mAt(n,a)}}),e}function FCe(e,t){var n=e[mZ];return!n&&t&&(n={},Object.defineProperty(e,mZ,{value:n})),n}function hAt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),NCe.call(i,e,[t]),e}function mAt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=pAt(e,t,i))})}function pAt(e,t,n){var i=gAt(e,n);return i.subscribe(t)}function gAt(e,t){var n=t[pZ];if(!n){n=new e.subscribable,Object.defineProperty(t,pZ,{value:n});var i={};_At(t,n,i),yAt(e,t,n,i)}return n}function _At(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function yAt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function BCe(e,t){if(!e)return null;var n=FCe(e,!1);return n&&n[t]||null}function xAt(e,t){var n=BCe(e,t);n&&n.valueHasMutated()}function bAt(e){e.track=NCe,e.getObservable=BCe,e.valueHasMutated=xAt,e.defineProperty=hAt}var C8={attachToKo:bAt};var kCe="http://www.w3.org/2000/svg",VCe="cesium-svgPath-svg",TAt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(kCe,"svg:svg");i.setAttribute("class",VCe);let o=document.createElementNS(kCe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${VCe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},A8=TAt;C8.attachToKo(ES);A8.register(ES);var be=ES;function NP(e){l(e)||(e=new um),this._clock=e,this._eventHelper=new _r,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=be.observable(Z.now()),this.systemTime.equalityComparer=Z.equals,this.startTime=be.observable(e.startTime),this.startTime.equalityComparer=Z.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=be.observable(e.stopTime),this.stopTime.equalityComparer=Z.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=be.observable(e.currentTime),this.currentTime.equalityComparer=Z.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=be.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=be.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=be.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=be.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=be.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),be.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(NP.prototype,{clock:{get:function(){return this._clock}}});NP.prototype.synchronize=function(){let e=this._clock;this.systemTime=Z.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};NP.prototype.isDestroyed=function(){return!1};NP.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var E8=NP;function CAt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,he.throwInstantiationError()}var UCe=CAt;var FP={};FP.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};FP.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};FP.createRangeInput=function(e,t,n,i,o,r){r=y(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};FP.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var gc=FP;function zCe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),be.track(this,["toggled","tooltip"])}Object.defineProperties(zCe.prototype,{command:{get:function(){return this._command}}});var jb=zCe;function AAt(e,t){t=y(t,!0);let n=new me,i=new me;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,be.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Sn=AAt;function EAt(e,t,n,i,o){return n.call(i,e[t]),be.getObservable(e,t).subscribe(n,i,o)}var Oa=EAt;var qb="http://www.w3.org/2000/svg",WCe="http://www.w3.org/1999/xlink",S8,BP=z.fromCssColorString("rgba(247,250,255,0.384)"),v8=z.fromCssColorString("rgba(143,191,255,0.216)"),gZ=z.fromCssColorString("rgba(153,197,255,0.098)"),w8=z.fromCssColorString("rgba(255,255,255,0.086)"),SAt=z.fromCssColorString("rgba(255,255,255,0.267)"),vAt=z.fromCssColorString("rgba(255,255,255,0)"),HCe=z.fromCssColorString("rgba(66,67,68,0.3)"),GCe=z.fromCssColorString("rgba(0,0,0,0.5)");function _0(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var kP={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function _h(e){let t=document.createElementNS(qb,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(_h(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(WCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function _Z(e,t,n){let i=document.createElementNS(qb,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(qb,"tspan");return o.textContent=n,i.appendChild(o),i}function wAt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var D8=new z;function Jr(e,t){let n=t.alpha,i=1-n;return D8.red=e.red*i+t.red*n,D8.green=e.green*i+t.green*n,D8.blue=e.blue*i+t.blue*n,D8.toCssColorString()}function yZ(e,t,n){let i=kP[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return _h(o)}function DAt(e,t,n){let i=kP[n],o=kP.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return _h(r)}function IAt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&S8!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),h=c-o-a.left,p=u-r-a.top,_=Math.atan2(p,h)*180/Math.PI+90;_>180&&(_-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(S8=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=_):_<m?n.slower():_>m&&n.faster(),t.preventDefault()}else e===S8&&(S8=void 0),n.shuttleRingDragging=!1}function Dg(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Oa(t,"toggled",this.setToggled,this),Oa(t,"tooltip",this.setTooltip,this),Oa(t.command,"canExecute",this.setEnabled,this)]}Dg.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};Dg.prototype.isDestroyed=function(){return!1};Dg.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Dg.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};Dg.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function SS(e,t){e=Rn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(qb,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",WCe);let s=document.createElementNS(qb,"g");this._topG=s,this._realtimeSVG=new Dg(DAt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Dg(yZ(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Dg(yZ(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Dg(yZ(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(qb,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=_h({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=kP.animation_pathSwooshFX,f=kP.animation_pathPointer,h=_h({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=_h({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=_h({tagName:"g",transform:"translate(100,100)"});this._knobOuter=_h({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let _=61,m=_h({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:_});this._knobDate=_Z(0,-24,""),this._knobTime=_Z(0,-7,""),this._knobStatus=_Z(0,-41,"");let x=_h({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:_}),b=document.createElementNS(qb,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(c),b.appendChild(h),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let T=this;function C(O){IAt(T,O)}this._mouseCallback=C,c.addEventListener("mousedown",C,!0),c.addEventListener("touchstart",C,!0),h.addEventListener("mousedown",C,!0),h.addEventListener("touchstart",C,!0),n.addEventListener("mousemove",C,!0),n.addEventListener("touchmove",C,!0),n.addEventListener("mouseup",C,!0),n.addEventListener("touchend",C,!0),n.addEventListener("touchcancel",C,!0),this._shuttleRingPointer.addEventListener("mousedown",C,!0),this._shuttleRingPointer.addEventListener("touchstart",C,!0),this._knobOuter.addEventListener("mousedown",C,!0),this._knobOuter.addEventListener("touchstart",C,!0);let A=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],D;this._subscriptions=[Oa(t.pauseViewModel,"toggled",function(O){D!==O&&(D=O,D?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Oa(t,"shuttleRingAngle",function(O){wAt(T._shuttleRingPointer,T._knobOuter,O)}),Oa(t,"dateLabel",function(O){S.textContent!==O&&(S.textContent=O)}),Oa(t,"timeLabel",function(O){A.textContent!==O&&(A.textContent=O)}),Oa(t,"multiplierLabel",function(O){v.textContent!==O&&(v.textContent=O)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(SS.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});SS.prototype.isDestroyed=function(){return!1};SS.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return ue(this)};SS.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};SS.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=_0(this._themeNormal),n=_0(this._themeHover),i=_0(this._themeSelect),o=_0(this._themeDisabled),r=_0(this._themeKnob),s=_0(this._themePointer),a=_0(this._themeSwoosh),c=_0(this._themeSwooshHover),u=_h({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(t,BP)},{tagName:"stop",offset:"12%","stop-color":Jr(t,v8)},{tagName:"stop",offset:"46%","stop-color":Jr(t,gZ)},{tagName:"stop",offset:"81%","stop-color":Jr(t,w8)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(n,BP)},{tagName:"stop",offset:"12%","stop-color":Jr(n,v8)},{tagName:"stop",offset:"46%","stop-color":Jr(n,gZ)},{tagName:"stop",offset:"81%","stop-color":Jr(n,w8)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(i,BP)},{tagName:"stop",offset:"12%","stop-color":Jr(i,v8)},{tagName:"stop",offset:"46%","stop-color":Jr(i,gZ)},{tagName:"stop",offset:"81%","stop-color":Jr(i,w8)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(o,SAt)},{tagName:"stop",offset:"75%","stop-color":Jr(o,vAt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Jr(s,GCe)},{tagName:"stop",offset:"100%","stop-color":Jr(s,GCe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Jr(r,BP)},{tagName:"stop",offset:"60%","stop-color":Jr(r,HCe)},{tagName:"stop",offset:"85%","stop-color":Jr(r,v8)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Jr(r,HCe)},{tagName:"stop",offset:"60%","stop-color":Jr(r,BP)},{tagName:"stop",offset:"85%","stop-color":Jr(r,w8)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var I8=SS;var PAt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y0=15,vS=105;function jCe(e,t){return e-t}function xZ(e,t){let n=Oo(t,e,jCe);return n<0?~n:n}function RAt(e,t){if(Math.abs(e)<=y0)return e/y0;let n=y0,i=vS,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function OAt(e,t,n){if(n.clockStep===_o.SYSTEM_CLOCK)return y0;if(Math.abs(e)<=1)return e*y0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=y0,r=vS,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function id(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=id.defaultDateFormatter,this._timeFormatter=id.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,be.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(id.defaultTicks),this.timeLabel=void 0,be.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,be.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,be.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===_o.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,be.defineProperty(this,"shuttleRingAngle",{get:function(){return OAt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,vS),-vS);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===vS){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=RAt(s,a);if(t.snapToTicks)u=a[xZ(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let h=f.toFixed(0).length-2,p=Math.pow(10,h);u=Math.round(u/p)*p|0}else f>y0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,be.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Kr.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,h=!1;if(a===Kr.LOOP_STOP)h=Z.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;h=Z.greaterThan(u,f)&&Z.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,be.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Kr.UNBOUNDED)return!0;let c=s.systemTime;return Z.greaterThanOrEquals(c,s.startTime)&&Z.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,be.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Sn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new jb(n,{toggled:be.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new jb(i,{toggled:be.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new jb(o,{toggled:be.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==_o.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Sn(function(){t._clockViewModel.clockStep=_o.SYSTEM_CLOCK},be.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new jb(r,{toggled:be.computed(function(){return e.clockStep===_o.SYSTEM_CLOCK}),tooltip:be.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=xZ(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=xZ(c,a)+1;u<a.length&&(s.multiplier=a[u])})}id.defaultDateFormatter=function(e,t){let n=Z.toGregorianDate(e);return`${PAt[n.month-1]} ${n.day} ${n.year}`};id.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];id.defaultTimeFormatter=function(e,t){let n=Z.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};id.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};id.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(jCe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(id.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});id._maxShuttleRingAngle=vS;id._realtimeShuttleRingAngle=y0;var P8=id;function MAt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function bZ(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var LAt=new pn,NAt=new d;function VP(e,t){let n=this,i=e.canvas,o=new Zf(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",be.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Sn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Sn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Sn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=be.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=be.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=be.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new $y({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Sn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=be.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Sn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new t8({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=be.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Sn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=be.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=be.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=be.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Sn(function(){let u=n.depthFrustum+1;return n.depthFrustum=bZ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Sn(function(){let u=n.depthFrustum-1;return n.depthFrustum=bZ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=be.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=Sn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new x8({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=be.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=be.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Sn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Sn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=be.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Sn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=be.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,Tn.LEFT_CLICK):o.removeInputAction(Tn.LEFT_CLICK)});function c(u){let f,h=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,LAt),_=r.pick(p,n._scene,NAt);if(l(_)){let m=h.cartesianToCartographic(_),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<x.length;++b){let T=x[b];if(l(T))for(let C=0;!f&&C<T.length;++C){let A=T[C];se.contains(A.rectangle,m)&&(f=A)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Sn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=be.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,Tn.LEFT_CLICK):o.removeInputAction(Tn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(VP.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});VP.prototype._update=function(){this.frustums&&(this.frustumStatisticText=MAt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=bZ(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};VP.prototype.isDestroyed=function(){return!1};VP.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var R8=VP;function O8(e,t){e=Rn(e);let n=document.createElement("div"),i=new R8(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=gc.createSection,c=gc.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(h),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let _=document.createElement("div");u.appendChild(_);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),_.appendChild(m);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),_.appendChild(x);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),_.appendChild(b);let T=document.createElement("input");T.type="button",T.value="+",T.className="cesium-cesiumInspector-pickButton",T.setAttribute("data-bind","click: incrementDepthFrustum"),_.appendChild(T);let C=a(s,"Primitives","primitivesVisible","togglePrimitives"),A=document.createElement("div");A.className="cesium-cesiumInspector-pickSection",C.appendChild(A);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(S),A.appendChild(v),A.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),A.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),A.appendChild(this._primitiveOnly);let D=a(s,"Terrain","terrainVisible","toggleTerrain"),O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",D.appendChild(O);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",O.appendChild(v);let M=document.createElement("div");O.appendChild(M);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let g=document.createElement("input");g.type="button",g.value="NW",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: selectNW");let E=document.createElement("input");E.type="button",E.value="NE",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",M.className="cesium-cesiumInspector-frustumStatistics",M.appendChild(N),M.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let B=document.createElement("div");B.className="cesium-cesiumInspector-relativeText",B.textContent="Select relative:",M.appendChild(B);let H=document.createElement("table"),V=document.createElement("tr"),G=document.createElement("tr"),k=document.createElement("td");k.appendChild(L);let W=document.createElement("td");W.appendChild(g);let Y=document.createElement("td");Y.appendChild(E),V.appendChild(k),V.appendChild(W),V.appendChild(Y);let J=document.createElement("td"),j=document.createElement("td");j.appendChild(w);let K=document.createElement("td");K.appendChild(I),G.appendChild(J),G.appendChild(j),G.appendChild(K),H.appendChild(V),H.appendChild(G),M.appendChild(H),O.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),O.appendChild(c("Show only selected","filterTile","hasPickedTile")),D.appendChild(c("Wireframe","wireframe")),D.appendChild(c("Suspend LOD update","suspendUpdates")),D.appendChild(c("Show tile coordinates","tileCoordinates")),be.applyBindings(i,this._element)}Object.defineProperties(O8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});O8.prototype.isDestroyed=function(){return!1};O8.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var M8=O8;function qCe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,be.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=be.getObservable(this,"imageryProviderViewModels"),r=be.pureComputed(function(){let h=o(),p={},_;for(_=0;_<h.length;_++){let b=h[_],T=b.category;l(p[T])?p[T].push(b):p[T]=[b]}let m=Object.keys(p),x=[];for(_=0;_<m.length;_++){let b=m[_];x.push({name:b,providers:p[b]})}return x});this._imageryProviders=r;let s=be.getObservable(this,"terrainProviderViewModels"),a=be.pureComputed(function(){let h=s(),p={},_;for(_=0;_<h.length;_++){let b=h[_],T=b.category;l(p[T])?p[T].push(b):p[T]=[b]}let m=Object.keys(p),x=[];for(_=0;_<m.length;_++){let b=m[_];x.push({name:b,providers:p[b]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,be.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,_=l(h)?h.name:void 0,m=l(p)?p.name:void 0;return l(_)&&l(m)?`${_} -${m}`:l(_)?_:m}),this.buttonImageUrl=void 0,be.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(l(h))return h.iconUrl}),this.selectedImagery=void 0;let c=be.observable();this._currentImageryLayers=[],be.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(h){if(c()===h){this.dropDownVisible=!1;return}let p,_=this._currentImageryLayers,m=_.length,x=this._globe.imageryLayers,b=!1;for(p=0;p<m;p++){let T=x.length;for(let C=0;C<T;C++){let A=x.get(C);if(A===_[p]){x.remove(A),b=!0;break}}}if(l(h)){let T=h.creationCommand();if(Array.isArray(T)){let C=T.length;for(this._currentImageryLayers=[],p=C-1;p>=0;p--){let A=lc.fromProviderAsync(T[p]);x.add(A,0),this._currentImageryLayers.push(A)}}else{this._currentImageryLayers=[];let C=lc.fromProviderAsync(T);if(C.name=h.name,b)x.add(C,0);else{let A=x.get(0);l(A)&&x.remove(A),x.add(C,0)}this._currentImageryLayers.push(C)}}c(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=be.observable();be.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(h){if(u()===h){this.dropDownVisible=!1;return}let p;if(l(h)&&(p=h.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof dg),this._globe.terrainProvider=p;else if(l(p)){let _=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{_=!0,m()}),b=new y8(p).readyEvent.addEventListener(T=>{_||(this._globe.depthTestAgainstTerrain=!(T instanceof dg),this._globe.terrainProvider=T,b())})}u(h),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Sn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(qCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var L8=qCe;function N8(e,t){e=Rn(e);let n=new L8(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(h);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);let _=document.createElement("div");_.className="cesium-baseLayerPicker-itemLabel",_.setAttribute("data-bind","text: name"),h.appendChild(_);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",x.appendChild(b);let T=document.createElement("div");T.className="cesium-baseLayerPicker-categoryTitle",T.setAttribute("data-bind","text: name"),b.appendChild(T);let C=document.createElement("div");C.className="cesium-baseLayerPicker-choices",C.setAttribute("data-bind","foreach: providers"),b.appendChild(C);let A=document.createElement("div");A.className="cesium-baseLayerPicker-item",A.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),C.appendChild(A);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),A.appendChild(S);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),A.appendChild(v),be.applyBindings(n,i),be.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(D){i.contains(D.target)||r.contains(D.target)||(n.dropDownVisible=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(N8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});N8.prototype.isDestroyed=function(){return!1};N8.prototype.destroy=function(){return Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._element),be.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var F8=N8;function YCe(e){let t=e.creationFunction;l(t.canExecute)||(t=Sn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),be.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(YCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ds=YCe;function FAt(){let e=[],t=devicePixelRatio>=2;return e.push(new ds({name:"Bing Maps Aerial",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return jy({style:Wy.AERIAL})}})),e.push(new ds({name:"Bing Maps Aerial with Labels",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return jy({style:Wy.AERIAL_WITH_LABELS})}})),e.push(new ds({name:"Bing Maps Roads",iconUrl:nn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return jy({style:Wy.ROAD})}})),e.push(new ds({name:"ArcGIS World Imagery",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Hy.fromBasemapType(Mm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ds({name:"ArcGIS World Hillshade",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Hy.fromBasemapType(Mm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ds({name:"Esri World Ocean",iconUrl:nn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Hy.fromBasemapType(Mm.OCEANS,{enablePickFeatures:!1})}})),e.push(new ds({name:"Open\xADStreet\xADMap",iconUrl:nn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. -http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new g0({url:"https://tile.openstreetmap.org/"})}})),e.push(new ds({name:"Stadia x Stamen Watercolor",iconUrl:nn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. + */var mZ="__knockoutObservables",pZ="__knockoutSubscribable";function BCe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=kCe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===mZ||o===pZ)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&yAt(n,a)}}),e}function kCe(e,t){var n=e[mZ];return!n&&t&&(n={},Object.defineProperty(e,mZ,{value:n})),n}function _At(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),BCe.call(i,e,[t]),e}function yAt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=xAt(e,t,i))})}function xAt(e,t,n){var i=bAt(e,n);return i.subscribe(t)}function bAt(e,t){var n=t[pZ];if(!n){n=new e.subscribable,Object.defineProperty(t,pZ,{value:n});var i={};TAt(t,n,i),CAt(e,t,n,i)}return n}function TAt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function CAt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function VCe(e,t){if(!e)return null;var n=kCe(e,!1);return n&&n[t]||null}function AAt(e,t){var n=VCe(e,t);n&&n.valueHasMutated()}function EAt(e){e.track=BCe,e.getObservable=VCe,e.valueHasMutated=AAt,e.defineProperty=_At}var E8={attachToKo:EAt};var UCe="http://www.w3.org/2000/svg",zCe="cesium-svgPath-svg",SAt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(UCe,"svg:svg");i.setAttribute("class",zCe);let o=document.createElementNS(UCe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${zCe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},S8=SAt;E8.attachToKo(wS);S8.register(wS);var Te=wS;function VP(e){l(e)||(e=new um),this._clock=e,this._eventHelper=new _r,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Te.observable(Z.now()),this.systemTime.equalityComparer=Z.equals,this.startTime=Te.observable(e.startTime),this.startTime.equalityComparer=Z.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Te.observable(e.stopTime),this.stopTime.equalityComparer=Z.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Te.observable(e.currentTime),this.currentTime.equalityComparer=Z.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Te.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Te.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Te.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Te.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Te.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Te.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(VP.prototype,{clock:{get:function(){return this._clock}}});VP.prototype.synchronize=function(){let e=this._clock;this.systemTime=Z.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};VP.prototype.isDestroyed=function(){return!1};VP.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var v8=VP;function vAt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,he.throwInstantiationError()}var HCe=vAt;var UP={};UP.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};UP.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};UP.createRangeInput=function(e,t,n,i,o,r){r=y(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};UP.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var _c=UP;function GCe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Te.track(this,["toggled","tooltip"])}Object.defineProperties(GCe.prototype,{command:{get:function(){return this._command}}});var jb=GCe;function wAt(e,t){t=y(t,!0);let n=new pe,i=new pe;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Te.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Sn=wAt;function DAt(e,t,n,i,o){return n.call(i,e[t]),Te.getObservable(e,t).subscribe(n,i,o)}var La=DAt;var qb="http://www.w3.org/2000/svg",qCe="http://www.w3.org/1999/xlink",w8,zP=z.fromCssColorString("rgba(247,250,255,0.384)"),D8=z.fromCssColorString("rgba(143,191,255,0.216)"),gZ=z.fromCssColorString("rgba(153,197,255,0.098)"),I8=z.fromCssColorString("rgba(255,255,255,0.086)"),IAt=z.fromCssColorString("rgba(255,255,255,0.267)"),PAt=z.fromCssColorString("rgba(255,255,255,0)"),WCe=z.fromCssColorString("rgba(66,67,68,0.3)"),jCe=z.fromCssColorString("rgba(0,0,0,0.5)");function _0(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var HP={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function _h(e){let t=document.createElementNS(qb,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(_h(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(qCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function _Z(e,t,n){let i=document.createElementNS(qb,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(qb,"tspan");return o.textContent=n,i.appendChild(o),i}function RAt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var P8=new z;function Jr(e,t){let n=t.alpha,i=1-n;return P8.red=e.red*i+t.red*n,P8.green=e.green*i+t.green*n,P8.blue=e.blue*i+t.blue*n,P8.toCssColorString()}function yZ(e,t,n){let i=HP[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return _h(o)}function OAt(e,t,n){let i=HP[n],o=HP.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return _h(r)}function MAt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&w8!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),h=c-o-a.left,p=u-r-a.top,_=Math.atan2(p,h)*180/Math.PI+90;_>180&&(_-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(w8=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=_):_<m?n.slower():_>m&&n.faster(),t.preventDefault()}else e===w8&&(w8=void 0),n.shuttleRingDragging=!1}function Ig(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[La(t,"toggled",this.setToggled,this),La(t,"tooltip",this.setTooltip,this),La(t.command,"canExecute",this.setEnabled,this)]}Ig.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};Ig.prototype.isDestroyed=function(){return!1};Ig.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Ig.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};Ig.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function DS(e,t){e=Rn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(qb,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",qCe);let s=document.createElementNS(qb,"g");this._topG=s,this._realtimeSVG=new Ig(OAt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Ig(yZ(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Ig(yZ(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Ig(yZ(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(qb,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=_h({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=HP.animation_pathSwooshFX,f=HP.animation_pathPointer,h=_h({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=_h({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=_h({tagName:"g",transform:"translate(100,100)"});this._knobOuter=_h({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let _=61,m=_h({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:_});this._knobDate=_Z(0,-24,""),this._knobTime=_Z(0,-7,""),this._knobStatus=_Z(0,-41,"");let x=_h({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:_}),b=document.createElementNS(qb,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(c),b.appendChild(h),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let T=this;function C(O){MAt(T,O)}this._mouseCallback=C,c.addEventListener("mousedown",C,!0),c.addEventListener("touchstart",C,!0),h.addEventListener("mousedown",C,!0),h.addEventListener("touchstart",C,!0),n.addEventListener("mousemove",C,!0),n.addEventListener("touchmove",C,!0),n.addEventListener("mouseup",C,!0),n.addEventListener("touchend",C,!0),n.addEventListener("touchcancel",C,!0),this._shuttleRingPointer.addEventListener("mousedown",C,!0),this._shuttleRingPointer.addEventListener("touchstart",C,!0),this._knobOuter.addEventListener("mousedown",C,!0),this._knobOuter.addEventListener("touchstart",C,!0);let A=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],D;this._subscriptions=[La(t.pauseViewModel,"toggled",function(O){D!==O&&(D=O,D?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),La(t,"shuttleRingAngle",function(O){RAt(T._shuttleRingPointer,T._knobOuter,O)}),La(t,"dateLabel",function(O){S.textContent!==O&&(S.textContent=O)}),La(t,"timeLabel",function(O){A.textContent!==O&&(A.textContent=O)}),La(t,"multiplierLabel",function(O){v.textContent!==O&&(v.textContent=O)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(DS.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DS.prototype.isDestroyed=function(){return!1};DS.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return ue(this)};DS.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};DS.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=_0(this._themeNormal),n=_0(this._themeHover),i=_0(this._themeSelect),o=_0(this._themeDisabled),r=_0(this._themeKnob),s=_0(this._themePointer),a=_0(this._themeSwoosh),c=_0(this._themeSwooshHover),u=_h({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(t,zP)},{tagName:"stop",offset:"12%","stop-color":Jr(t,D8)},{tagName:"stop",offset:"46%","stop-color":Jr(t,gZ)},{tagName:"stop",offset:"81%","stop-color":Jr(t,I8)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(n,zP)},{tagName:"stop",offset:"12%","stop-color":Jr(n,D8)},{tagName:"stop",offset:"46%","stop-color":Jr(n,gZ)},{tagName:"stop",offset:"81%","stop-color":Jr(n,I8)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(i,zP)},{tagName:"stop",offset:"12%","stop-color":Jr(i,D8)},{tagName:"stop",offset:"46%","stop-color":Jr(i,gZ)},{tagName:"stop",offset:"81%","stop-color":Jr(i,I8)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(o,IAt)},{tagName:"stop",offset:"75%","stop-color":Jr(o,PAt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Jr(s,jCe)},{tagName:"stop",offset:"100%","stop-color":Jr(s,jCe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Jr(r,zP)},{tagName:"stop",offset:"60%","stop-color":Jr(r,WCe)},{tagName:"stop",offset:"85%","stop-color":Jr(r,D8)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Jr(r,WCe)},{tagName:"stop",offset:"60%","stop-color":Jr(r,zP)},{tagName:"stop",offset:"85%","stop-color":Jr(r,I8)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var R8=DS;var LAt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y0=15,IS=105;function YCe(e,t){return e-t}function xZ(e,t){let n=Mo(t,e,YCe);return n<0?~n:n}function NAt(e,t){if(Math.abs(e)<=y0)return e/y0;let n=y0,i=IS,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function FAt(e,t,n){if(n.clockStep===_o.SYSTEM_CLOCK)return y0;if(Math.abs(e)<=1)return e*y0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=y0,r=IS,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function id(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=id.defaultDateFormatter,this._timeFormatter=id.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Te.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(id.defaultTicks),this.timeLabel=void 0,Te.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Te.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Te.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===_o.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Te.defineProperty(this,"shuttleRingAngle",{get:function(){return FAt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,IS),-IS);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===IS){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=NAt(s,a);if(t.snapToTicks)u=a[xZ(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let h=f.toFixed(0).length-2,p=Math.pow(10,h);u=Math.round(u/p)*p|0}else f>y0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Te.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Kr.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,h=!1;if(a===Kr.LOOP_STOP)h=Z.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;h=Z.greaterThan(u,f)&&Z.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,Te.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Kr.UNBOUNDED)return!0;let c=s.systemTime;return Z.greaterThanOrEquals(c,s.startTime)&&Z.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Te.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Sn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new jb(n,{toggled:Te.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new jb(i,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new jb(o,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==_o.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Sn(function(){t._clockViewModel.clockStep=_o.SYSTEM_CLOCK},Te.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new jb(r,{toggled:Te.computed(function(){return e.clockStep===_o.SYSTEM_CLOCK}),tooltip:Te.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=xZ(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=xZ(c,a)+1;u<a.length&&(s.multiplier=a[u])})}id.defaultDateFormatter=function(e,t){let n=Z.toGregorianDate(e);return`${LAt[n.month-1]} ${n.day} ${n.year}`};id.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];id.defaultTimeFormatter=function(e,t){let n=Z.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};id.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};id.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(YCe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(id.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});id._maxShuttleRingAngle=IS;id._realtimeShuttleRingAngle=y0;var O8=id;function XCe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Te.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Te.getObservable(this,"imageryProviderViewModels"),r=Te.pureComputed(function(){let h=o(),p={},_;for(_=0;_<h.length;_++){let b=h[_],T=b.category;l(p[T])?p[T].push(b):p[T]=[b]}let m=Object.keys(p),x=[];for(_=0;_<m.length;_++){let b=m[_];x.push({name:b,providers:p[b]})}return x});this._imageryProviders=r;let s=Te.getObservable(this,"terrainProviderViewModels"),a=Te.pureComputed(function(){let h=s(),p={},_;for(_=0;_<h.length;_++){let b=h[_],T=b.category;l(p[T])?p[T].push(b):p[T]=[b]}let m=Object.keys(p),x=[];for(_=0;_<m.length;_++){let b=m[_];x.push({name:b,providers:p[b]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Te.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,_=l(h)?h.name:void 0,m=l(p)?p.name:void 0;return l(_)&&l(m)?`${_} +${m}`:l(_)?_:m}),this.buttonImageUrl=void 0,Te.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(l(h))return h.iconUrl}),this.selectedImagery=void 0;let c=Te.observable();this._currentImageryLayers=[],Te.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(h){if(c()===h){this.dropDownVisible=!1;return}let p,_=this._currentImageryLayers,m=_.length,x=this._globe.imageryLayers,b=!1;for(p=0;p<m;p++){let T=x.length;for(let C=0;C<T;C++){let A=x.get(C);if(A===_[p]){x.remove(A),b=!0;break}}}if(l(h)){let T=h.creationCommand();if(Array.isArray(T)){let C=T.length;for(this._currentImageryLayers=[],p=C-1;p>=0;p--){let A=uc.fromProviderAsync(T[p]);x.add(A,0),this._currentImageryLayers.push(A)}}else{this._currentImageryLayers=[];let C=uc.fromProviderAsync(T);if(C.name=h.name,b)x.add(C,0);else{let A=x.get(0);l(A)&&x.remove(A),x.add(C,0)}this._currentImageryLayers.push(C)}}c(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Te.observable();Te.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(h){if(u()===h){this.dropDownVisible=!1;return}let p;if(l(h)&&(p=h.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof hg),this._globe.terrainProvider=p;else if(l(p)){let _=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{_=!0,m()}),b=new b8(p).readyEvent.addEventListener(T=>{_||(this._globe.depthTestAgainstTerrain=!(T instanceof hg),this._globe.terrainProvider=T,b())})}u(h),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Sn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(XCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var M8=XCe;function L8(e,t){e=Rn(e);let n=new M8(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(h);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);let _=document.createElement("div");_.className="cesium-baseLayerPicker-itemLabel",_.setAttribute("data-bind","text: name"),h.appendChild(_);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",x.appendChild(b);let T=document.createElement("div");T.className="cesium-baseLayerPicker-categoryTitle",T.setAttribute("data-bind","text: name"),b.appendChild(T);let C=document.createElement("div");C.className="cesium-baseLayerPicker-choices",C.setAttribute("data-bind","foreach: providers"),b.appendChild(C);let A=document.createElement("div");A.className="cesium-baseLayerPicker-item",A.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),C.appendChild(A);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),A.appendChild(S);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),A.appendChild(v),Te.applyBindings(n,i),Te.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(D){i.contains(D.target)||r.contains(D.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(L8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});L8.prototype.isDestroyed=function(){return!1};L8.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._element),Te.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var N8=L8;function KCe(e){let t=e.creationFunction;l(t.canExecute)||(t=Sn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),Te.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(KCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ds=KCe;function BAt(){let e=[],t=devicePixelRatio>=2;return e.push(new ds({name:"Bing Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return jy({style:Wy.AERIAL})}})),e.push(new ds({name:"Bing Maps Aerial with Labels",iconUrl:en("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return jy({style:Wy.AERIAL_WITH_LABELS})}})),e.push(new ds({name:"Bing Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return jy({style:Wy.ROAD})}})),e.push(new ds({name:"ArcGIS World Imagery",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Hy.fromBasemapType(Lm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ds({name:"ArcGIS World Hillshade",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Hy.fromBasemapType(Lm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ds({name:"Esri World Ocean",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Hy.fromBasemapType(Lm.OCEANS,{enablePickFeatures:!1})}})),e.push(new ds({name:"Open\xADStreet\xADMap",iconUrl:en("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. +http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new g0({url:"https://tile.openstreetmap.org/"})}})),e.push(new ds({name:"Stadia x Stamen Watercolor",iconUrl:en("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new g0({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia x Stamen Toner",iconUrl:nn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays. + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia x Stamen Toner",iconUrl:en("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays. https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new g0({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia Alidade Smooth",iconUrl:nn("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine. + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia Alidade Smooth",iconUrl:en("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine. https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new g0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia Alidade Smooth Dark",iconUrl:nn("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia Alidade Smooth Dark",iconUrl:en("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new g0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Sentinel-2",iconUrl:nn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Gy.fromAssetId(3954)}})),e.push(new ds({name:"Blue Marble",iconUrl:nn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Gy.fromAssetId(3845)}})),e.push(new ds({name:"Earth at night",iconUrl:nn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Gy.fromAssetId(3812)}})),e.push(new ds({name:"Natural Earth\xA0II",iconUrl:nn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return ub.fromUrl(nn("Assets/Textures/NaturalEarthII"))}})),e}var B8=FAt;function BAt(){let e=[];return e.push(new ds({name:"WGS84 Ellipsoid",iconUrl:nn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new dg({ellipsoid:ee.WGS84})}})),e.push(new ds({name:"Cesium World Terrain",iconUrl:nn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return pS({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var k8=BAt;function kAt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Cs&&(e.tileset=n.primitive),e.pickActive=!1}}function KCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Cs&&(e.tileset=i.primitive)},Tn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Tn.MOUSE_MOVE),e.picking=e.picking)}var VAt={maximumFractionDigits:3};function UP(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,VAt):Math.round(t).toLocaleString()}function zP(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Vo.PICK]:e._statisticsPerPass[Vo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${UP(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${UP(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${UP(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function ZCe(){let e=Ei.statistics;return` + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Sentinel-2",iconUrl:en("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Gy.fromAssetId(3954)}})),e.push(new ds({name:"Blue Marble",iconUrl:en("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Gy.fromAssetId(3845)}})),e.push(new ds({name:"Earth at night",iconUrl:en("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Gy.fromAssetId(3812)}})),e.push(new ds({name:"Natural Earth\xA0II",iconUrl:en("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return ub.fromUrl(en("Assets/Textures/NaturalEarthII"))}})),e}var F8=BAt;function kAt(){let e=[];return e.push(new ds({name:"WGS84 Ellipsoid",iconUrl:en("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new hg({ellipsoid:ee.WGS84})}})),e.push(new ds({name:"Cesium World Terrain",iconUrl:en("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return yS({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var B8=kAt;function VAt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function bZ(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var UAt=new pn,zAt=new d;function GP(e,t){let n=this,i=e.canvas,o=new $f(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Te.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Sn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Sn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Sn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Te.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Te.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Te.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new $y({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Sn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Te.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Sn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new n8({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Te.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Sn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Te.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Te.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Te.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Sn(function(){let u=n.depthFrustum+1;return n.depthFrustum=bZ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Sn(function(){let u=n.depthFrustum-1;return n.depthFrustum=bZ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Te.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=Sn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new T8({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Te.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Te.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Sn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Sn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Te.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Sn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Te.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,Tn.LEFT_CLICK):o.removeInputAction(Tn.LEFT_CLICK)});function c(u){let f,h=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,UAt),_=r.pick(p,n._scene,zAt);if(l(_)){let m=h.cartesianToCartographic(_),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<x.length;++b){let T=x[b];if(l(T))for(let C=0;!f&&C<T.length;++C){let A=T[C];se.contains(A.rectangle,m)&&(f=A)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Sn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Te.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,Tn.LEFT_CLICK):o.removeInputAction(Tn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(GP.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});GP.prototype._update=function(){this.frustums&&(this.frustumStatisticText=VAt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=bZ(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};GP.prototype.isDestroyed=function(){return!1};GP.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var k8=GP;function V8(e,t){e=Rn(e);let n=document.createElement("div"),i=new k8(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=_c.createSection,c=_c.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(h),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let _=document.createElement("div");u.appendChild(_);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),_.appendChild(m);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),_.appendChild(x);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),_.appendChild(b);let T=document.createElement("input");T.type="button",T.value="+",T.className="cesium-cesiumInspector-pickButton",T.setAttribute("data-bind","click: incrementDepthFrustum"),_.appendChild(T);let C=a(s,"Primitives","primitivesVisible","togglePrimitives"),A=document.createElement("div");A.className="cesium-cesiumInspector-pickSection",C.appendChild(A);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(S),A.appendChild(v),A.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),A.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),A.appendChild(this._primitiveOnly);let D=a(s,"Terrain","terrainVisible","toggleTerrain"),O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",D.appendChild(O);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",O.appendChild(v);let M=document.createElement("div");O.appendChild(M);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let g=document.createElement("input");g.type="button",g.value="NW",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: selectNW");let E=document.createElement("input");E.type="button",E.value="NE",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",M.className="cesium-cesiumInspector-frustumStatistics",M.appendChild(N),M.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let B=document.createElement("div");B.className="cesium-cesiumInspector-relativeText",B.textContent="Select relative:",M.appendChild(B);let H=document.createElement("table"),V=document.createElement("tr"),G=document.createElement("tr"),k=document.createElement("td");k.appendChild(L);let W=document.createElement("td");W.appendChild(g);let Y=document.createElement("td");Y.appendChild(E),V.appendChild(k),V.appendChild(W),V.appendChild(Y);let J=document.createElement("td"),j=document.createElement("td");j.appendChild(w);let K=document.createElement("td");K.appendChild(I),G.appendChild(J),G.appendChild(j),G.appendChild(K),H.appendChild(V),H.appendChild(G),M.appendChild(H),O.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),O.appendChild(c("Show only selected","filterTile","hasPickedTile")),D.appendChild(c("Wireframe","wireframe")),D.appendChild(c("Suspend LOD update","suspendUpdates")),D.appendChild(c("Show tile coordinates","tileCoordinates")),Te.applyBindings(i,this._element)}Object.defineProperties(V8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});V8.prototype.isDestroyed=function(){return!1};V8.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var U8=V8;function HAt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Cs&&(e.tileset=n.primitive),e.pickActive=!1}}function $Ce(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Cs&&(e.tileset=i.primitive)},Tn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Tn.MOUSE_MOVE),e.picking=e.picking)}var GAt={maximumFractionDigits:3};function WP(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,GAt):Math.round(t).toLocaleString()}function jP(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[Uo.PICK]:e._statisticsPerPass[Uo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${WP(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${WP(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${WP(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function QCe(){let e=vi.statistics;return` <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${UP(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${UP(e.texturesByteLength)}</li> + <li><strong>Geometry Memory (MB): </strong>${WP(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${WP(e.texturesByteLength)}</li> </ul> - `}var UAt=[{text:"Highlight",value:eu.HIGHLIGHT},{text:"Replace",value:eu.REPLACE},{text:"Mix",value:eu.MIX}],XCe=new z(1,1,0,.4),zAt=new z,V8=new z;function ga(e,t){let n=this,i=e.canvas;this._eventHandler=new Zf(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new $y({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,be.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=be.observable({}),this.properties=[],be.defineProperty(this,"properties",function(){let k=[],W=n._properties();for(let Y in W)W.hasOwnProperty(Y)&&k.push(Y);return k});let o=be.observable();be.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=be.observable();be.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=eu.HIGHLIGHT;let s=be.observable(),a=be.observable();be.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(W){let Y=e.pick(W.endPosition);if(Y instanceof $s?(n.feature=Y,n.tile=Y.content.tile):l(Y)&&l(Y.content)?(n.feature=void 0,n.tile=Y.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(Y)&&l(Y.content)){let J;e.pickPositionSupported&&(J=e.pickPosition(W.endPosition),l(J)&&(n._tileset.debugPickPosition=J)),n._tileset.debugPickedTile=Y.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Tn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Tn.MOUSE_MOVE))}}),this.picking=!0;let c=be.observable();be.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=be.observable();be.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=be.observable();be.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=be.observable();be.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(k){h(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=be.observable();be.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let _=be.observable();be.defineProperty(this,"freezeFrame",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,be.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=be.observable();be.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=be.observable();be.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=be.observable();be.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let T=be.observable();be.defineProperty(this,"showUrl",{get:function(){return T()},set:function(k){T(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let C=be.observable();be.defineProperty(this,"maximumScreenSpaceError",{get:function(){return C()},set:function(k){k=Number(k),isNaN(k)||(C(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let A=be.observable();be.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,be.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(A(),1/6)},set:function(k){let W=Math.pow(k,6);A(W),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=W)}});let S=be.observable();be.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(k){k=Number(k),isNaN(k)||(S(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let v=kAt(this),D=be.observable();be.defineProperty(this,"pickActive",{get:function(){return D()},set:function(k){D(k),k?n._eventHandler.setInputAction(v,Tn.LEFT_CLICK):n._eventHandler.removeInputAction(Tn.LEFT_CLICK)}});let O=be.observable();be.defineProperty(this,"pointCloudShading",{get:function(){return O()},set:function(k){O(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=be.observable();be.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let M=be.observable();be.defineProperty(this,"maximumAttenuation",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let L=be.observable();be.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let g=be.observable();be.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let E=be.observable();be.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=be.observable();be.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=be.observable();be.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let N=be.observable();be.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let B=be.observable();be.defineProperty(this,"baseScreenSpaceError",{get:function(){return B()},set:function(k){k=Number(k),isNaN(k)||(B(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let H=be.observable();be.defineProperty(this,"skipLevels",{get:function(){return H()},set:function(k){k=Number(k),isNaN(k)||(H(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let V=be.observable();be.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(k){V(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let G=be.observable();be.defineProperty(this,"loadSiblings",{get:function(){return G()},set:function(k){G(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||KCe(this,!0)}Object.defineProperties(ga.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return UAt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=zP(e,!1),this._pickStatisticsText=zP(e,!0),this._resourceCacheStatisticsText=ZCe(),KCe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,zAt):z.WHITE:t.color=V8,this._scene.requestRender()),l(e)&&(z.clone(e.color,V8),e.color=XCe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!TZ(t.content)&&(t.color=V8,this._scene.requestRender()),l(e)&&!TZ(e.content)&&(z.clone(e.color,V8),e.color=XCe,this._scene.requestRender()),this._tile=e}}});function TZ(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!TZ(t[i]))return!1;return!0}return!1}ga.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ga.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ga.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ga.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ga.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ga.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ga.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ga.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ga.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ga.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};ga.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new yS(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ga.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` + `}var WAt=[{text:"Highlight",value:tu.HIGHLIGHT},{text:"Replace",value:tu.REPLACE},{text:"Mix",value:tu.MIX}],ZCe=new z(1,1,0,.4),jAt=new z,z8=new z;function ya(e,t){let n=this,i=e.canvas;this._eventHandler=new $f(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new $y({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Te.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Te.observable({}),this.properties=[],Te.defineProperty(this,"properties",function(){let k=[],W=n._properties();for(let Y in W)W.hasOwnProperty(Y)&&k.push(Y);return k});let o=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=Te.observable();Te.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=tu.HIGHLIGHT;let s=Te.observable(),a=Te.observable();Te.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(W){let Y=e.pick(W.endPosition);if(Y instanceof Js?(n.feature=Y,n.tile=Y.content.tile):l(Y)&&l(Y.content)?(n.feature=void 0,n.tile=Y.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(Y)&&l(Y.content)){let J;e.pickPositionSupported&&(J=e.pickPosition(W.endPosition),l(J)&&(n._tileset.debugPickPosition=J)),n._tileset.debugPickedTile=Y.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Tn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Tn.MOUSE_MOVE))}}),this.picking=!0;let c=Te.observable();Te.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=Te.observable();Te.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=Te.observable();Te.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=Te.observable();Te.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(k){h(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Te.observable();Te.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let _=Te.observable();Te.defineProperty(this,"freezeFrame",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Te.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=Te.observable();Te.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Te.observable();Te.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=Te.observable();Te.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let T=Te.observable();Te.defineProperty(this,"showUrl",{get:function(){return T()},set:function(k){T(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let C=Te.observable();Te.defineProperty(this,"maximumScreenSpaceError",{get:function(){return C()},set:function(k){k=Number(k),isNaN(k)||(C(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let A=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Te.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(A(),1/6)},set:function(k){let W=Math.pow(k,6);A(W),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=W)}});let S=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(k){k=Number(k),isNaN(k)||(S(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let v=HAt(this),D=Te.observable();Te.defineProperty(this,"pickActive",{get:function(){return D()},set:function(k){D(k),k?n._eventHandler.setInputAction(v,Tn.LEFT_CLICK):n._eventHandler.removeInputAction(Tn.LEFT_CLICK)}});let O=Te.observable();Te.defineProperty(this,"pointCloudShading",{get:function(){return O()},set:function(k){O(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=Te.observable();Te.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let M=Te.observable();Te.defineProperty(this,"maximumAttenuation",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let L=Te.observable();Te.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let g=Te.observable();Te.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let E=Te.observable();Te.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=Te.observable();Te.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Te.observable();Te.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let N=Te.observable();Te.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let B=Te.observable();Te.defineProperty(this,"baseScreenSpaceError",{get:function(){return B()},set:function(k){k=Number(k),isNaN(k)||(B(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let H=Te.observable();Te.defineProperty(this,"skipLevels",{get:function(){return H()},set:function(k){k=Number(k),isNaN(k)||(H(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let V=Te.observable();Te.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(k){V(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let G=Te.observable();Te.defineProperty(this,"loadSiblings",{get:function(){return G()},set:function(k){G(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||$Ce(this,!0)}Object.defineProperties(ya.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return WAt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=jP(e,!1),this._pickStatisticsText=jP(e,!0),this._resourceCacheStatisticsText=QCe(),$Ce(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,jAt):z.WHITE:t.color=z8,this._scene.requestRender()),l(e)&&(z.clone(e.color,z8),e.color=ZCe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!TZ(t.content)&&(t.color=z8,this._scene.requestRender()),l(e)&&!TZ(e.content)&&(z.clone(e.color,z8),e.color=ZCe,this._scene.requestRender()),this._tile=e}}});function TZ(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!TZ(t[i]))return!1;return!0}return!1}ya.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ya.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ya.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ya.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ya.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ya.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ya.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ya.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ya.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ya.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};ya.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new TS(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ya.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` `),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};ga.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=zP(e,!1),this._pickStatisticsText=zP(e,!0),this._resourceCacheStatisticsText=ZCe())};ga.prototype.isDestroyed=function(){return!1};ga.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){be.getObservable(e,t).dispose()}),ue(this)};ga.getStatistics=zP;var U8=ga;function z8(e,t){e=Rn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new U8(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=gc.createSection,c=gc.createCheckbox,u=gc.createRangeInput,f=gc.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),_=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),T=a(s,"Optimization","optimizationVisible","toggleOptimization"),C=document.createElement("div");C.className="field-group";let A=document.createElement("label");A.className="field-label",A.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),C.appendChild(A),C.appendChild(S),h.appendChild(C),h.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(f("Trim Tiles Cache","trimTilesCache")),h.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),D=document.createElement("p");D.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),D.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),D.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(D),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let O=document.createElement("div");O.setAttribute("data-bind","visible: pointCloudShading"),O.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),O.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),O.appendChild(u("Base Resolution","baseResolution",0,1,.01)),O.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(O);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),O.appendChild(R),_.appendChild(c("Freeze Frame","freezeFrame")),_.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let M=document.createElement("div");M.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),_.appendChild(M);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),_.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let g=document.createElement("div");g.className="cesium-3dTilesInspector-statistics",g.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(g),m.appendChild(c("Pick Statistics","showPickStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(E),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(w);let I=document.createElement("div");b.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(N);let B=document.createElement("textarea");B.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(B);let H=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(H);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),T.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let G=document.createElement("div");G.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),T.appendChild(G);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),T.appendChild(k);let W=document.createElement("div");W.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),T.appendChild(W),T.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),T.appendChild(c("Load siblings of visible tiles","loadSiblings")),be.applyBindings(o,n)}Object.defineProperties(z8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});z8.prototype.isDestroyed=function(){return!1};z8.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var H8=z8;function G8(e,t){l(t)||(t=document.body),t=Rn(t);let n=this,i=be.observable(Sr.fullscreen),o=be.observable(Sr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,be.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,be.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&Sr.enabled)}}),this.tooltip=void 0,be.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Sn(function(){Sr.fullscreen?Sr.exitFullscreen():Sr.requestFullscreen(n._fullscreenElement)},be.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Rn(e),r.body),this._callback=function(){i(Sr.fullscreen)},r.addEventListener(Sr.changeEventName,this._callback)}Object.defineProperties(G8.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});G8.prototype.isDestroyed=function(){return!1};G8.prototype.destroy=function(){document.removeEventListener(Sr.changeEventName,this._callback),ue(this)};var W8=G8;var HAt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",GAt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function j8(e,t){e=Rn(e);let n=new W8(t,e);n._exitFullScreenPath=GAt,n._enterFullScreenPath=HAt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),be.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(j8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});j8.prototype.isDestroyed=function(){return!1};j8.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var q8=j8;var $Ce=1e3;function od(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new dS({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new me,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=JCe,this._handleArrowUp=QCe;let t=this;this._suggestionsVisible=be.pureComputed(function(){let o=be.getObservable(t,"_suggestions")().length>0,r=be.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Sn(function(i){if(i=y(i,Bb.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)KAt(t);else return YAt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?QCe(t):r?JCe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;nAe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,od.flyToDestination),this._focusTextbox=!1,be.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=be.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){od._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,be.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,be.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,be.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(od.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});od.prototype.destroy=function(){this._suggestionSubscription.dispose()};function QCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],od._adjustSuggestionsScroll(e,n)}function JCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],od._adjustSuggestionsScroll(e,i)}function WAt(e,t){let n=l(t)?t.availability:void 0;return l(n)?_E(t,[e]).then(function(i){return e=i[0],e.height+=$Ce,e}):(e.height+=$Ce,Promise.resolve(e))}function jAt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof se?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=se.center(t):a=yE(t,n):t=i.cartesianToCartographic(t),l(a)||(a=WAt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function qAt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function YAt(e,t,n){let i=e._searchText;if(tAe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await qAt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,AZ(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=eAe(e,yP.getCreditsFromResult(s[0]));l(a)||CZ(e,t[o].credit);return}e._searchText=`${i} (not found)`}function CZ(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function eAe(e,t){return l(t)&&t.forEach(n=>CZ(e,n)),t}function AZ(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function XAt(e,t){let n=Rn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function KAt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function tAe(e){return/^\s*$/.test(e)}function nAe(e){be.getObservable(e,"_suggestions").removeAll()}async function ZAt(e){if(!e.autoComplete)return;let t=e._searchText;if(nAe(e),AZ(e),!tAe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Bb.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=yP.getCreditsFromResult(r);o=o&&!l(s),eAe(e,s)}),o&&CZ(e,n.credit)}if(e._suggestions.length>=5)return}}od.flyToDestination=jAt;od._updateSearchSuggestions=ZAt;od._adjustSuggestionsScroll=XAt;od.prototype.isDestroyed=function(){return!1};od.prototype.destroy=function(){return AZ(this),ue(this)};var Y8=od;var $At="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",QAt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function X8(e){let t=Rn(e.container),n=new Y8(e);n._startSearchPath=$At,n._stopSearchPath=QAt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),be.applyBindings(n,i),be.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},Ht.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(X8.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});X8.prototype.isDestroyed=function(){return!1};X8.prototype.destroy=function(){let e=this._container;return Ht.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),be.cleanNode(this._form),be.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var K8=X8;function iAe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Sn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",be.track(this,["tooltip"])}Object.defineProperties(iAe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var Z8=iAe;function $8(e,t,n){e=Rn(e);let i=new Z8(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),be.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties($8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});$8.prototype.isDestroyed=function(){return!1};$8.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Q8=$8;function JAt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function rAe(e,t){be.track(e);for(let n=0;n<e.sublayers.length;n++)rAe(e.sublayers[n],t)}function J8(e){return e.modelName==="FullModel"}function sAe(e){return e.modelName==="Overview"}function aAe(e){return sAe(e)||J8(e)}function oAe(e,t){if(aAe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:be.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function eEt(e,t){if(aAe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");J8(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function tEt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function nEt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:be.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:be.observable(!0),index:-1}],currentLayer:be.observable(),expandClickHandler:JAt,setOptionDisable:function(i,o){be.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){eEt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){rAe(n[i],this.viewModel);let o=oAe(n[i],this.viewModel);l(o)&&(sAe(o)||!l(this.viewModel.defaultLayer)&&J8(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=oAe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=J8(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return tEt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var eG=nEt;function iEt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` +`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};ya.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=jP(e,!1),this._pickStatisticsText=jP(e,!0),this._resourceCacheStatisticsText=QCe())};ya.prototype.isDestroyed=function(){return!1};ya.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),ue(this)};ya.getStatistics=jP;var H8=ya;function G8(e,t){e=Rn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new H8(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=_c.createSection,c=_c.createCheckbox,u=_c.createRangeInput,f=_c.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),_=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),T=a(s,"Optimization","optimizationVisible","toggleOptimization"),C=document.createElement("div");C.className="field-group";let A=document.createElement("label");A.className="field-label",A.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),C.appendChild(A),C.appendChild(S),h.appendChild(C),h.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(f("Trim Tiles Cache","trimTilesCache")),h.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),D=document.createElement("p");D.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),D.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),D.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(D),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let O=document.createElement("div");O.setAttribute("data-bind","visible: pointCloudShading"),O.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),O.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),O.appendChild(u("Base Resolution","baseResolution",0,1,.01)),O.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(O);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),O.appendChild(R),_.appendChild(c("Freeze Frame","freezeFrame")),_.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let M=document.createElement("div");M.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),_.appendChild(M);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),_.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let g=document.createElement("div");g.className="cesium-3dTilesInspector-statistics",g.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(g),m.appendChild(c("Pick Statistics","showPickStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(E),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(w);let I=document.createElement("div");b.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(N);let B=document.createElement("textarea");B.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(B);let H=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(H);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),T.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let G=document.createElement("div");G.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),T.appendChild(G);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),T.appendChild(k);let W=document.createElement("div");W.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),T.appendChild(W),T.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),T.appendChild(c("Load siblings of visible tiles","loadSiblings")),Te.applyBindings(o,n)}Object.defineProperties(G8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});G8.prototype.isDestroyed=function(){return!1};G8.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var W8=G8;function j8(e,t){l(t)||(t=document.body),t=Rn(t);let n=this,i=Te.observable(Sr.fullscreen),o=Te.observable(Sr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Te.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Te.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&Sr.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Sn(function(){Sr.fullscreen?Sr.exitFullscreen():Sr.requestFullscreen(n._fullscreenElement)},Te.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Rn(e),r.body),this._callback=function(){i(Sr.fullscreen)},r.addEventListener(Sr.changeEventName,this._callback)}Object.defineProperties(j8.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});j8.prototype.isDestroyed=function(){return!1};j8.prototype.destroy=function(){document.removeEventListener(Sr.changeEventName,this._callback),ue(this)};var q8=j8;var qAt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",YAt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function Y8(e,t){e=Rn(e);let n=new q8(t,e);n._exitFullScreenPath=YAt,n._enterFullScreenPath=qAt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Te.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(Y8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Y8.prototype.isDestroyed=function(){return!1};Y8.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var X8=Y8;var JCe=1e3;function od(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new pS({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new pe,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=tAe,this._handleArrowUp=eAe;let t=this;this._suggestionsVisible=Te.pureComputed(function(){let o=Te.getObservable(t,"_suggestions")().length>0,r=Te.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Sn(function(i){if(i=y(i,Bb.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)JAt(t);else return $At(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?eAe(t):r?tAe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;oAe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,od.flyToDestination),this._focusTextbox=!1,Te.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Te.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){od._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Te.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Te.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Te.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(od.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});od.prototype.destroy=function(){this._suggestionSubscription.dispose()};function eAe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],od._adjustSuggestionsScroll(e,n)}function tAe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],od._adjustSuggestionsScroll(e,i)}function XAt(e,t){let n=l(t)?t.availability:void 0;return l(n)?bE(t,[e]).then(function(i){return e=i[0],e.height+=JCe,e}):(e.height+=JCe,Promise.resolve(e))}function KAt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof se?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=se.center(t):a=TE(t,n):t=i.cartesianToCartographic(t),l(a)||(a=XAt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function ZAt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function $At(e,t,n){let i=e._searchText;if(iAe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await ZAt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,AZ(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=nAe(e,CP.getCreditsFromResult(s[0]));l(a)||CZ(e,t[o].credit);return}e._searchText=`${i} (not found)`}function CZ(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function nAe(e,t){return l(t)&&t.forEach(n=>CZ(e,n)),t}function AZ(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function QAt(e,t){let n=Rn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function JAt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function iAe(e){return/^\s*$/.test(e)}function oAe(e){Te.getObservable(e,"_suggestions").removeAll()}async function eEt(e){if(!e.autoComplete)return;let t=e._searchText;if(oAe(e),AZ(e),!iAe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Bb.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=CP.getCreditsFromResult(r);o=o&&!l(s),nAe(e,s)}),o&&CZ(e,n.credit)}if(e._suggestions.length>=5)return}}od.flyToDestination=KAt;od._updateSearchSuggestions=eEt;od._adjustSuggestionsScroll=QAt;od.prototype.isDestroyed=function(){return!1};od.prototype.destroy=function(){return AZ(this),ue(this)};var K8=od;var tEt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",nEt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function Z8(e){let t=Rn(e.container),n=new K8(e);n._startSearchPath=tEt,n._stopSearchPath=nEt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Te.applyBindings(n,i),Te.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},zt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(Z8.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});Z8.prototype.isDestroyed=function(){return!1};Z8.prototype.destroy=function(){let e=this._container;return zt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Te.cleanNode(this._form),Te.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var $8=Z8;function rAe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Sn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Te.track(this,["tooltip"])}Object.defineProperties(rAe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var Q8=rAe;function J8(e,t,n){e=Rn(e);let i=new Q8(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(J8.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});J8.prototype.isDestroyed=function(){return!1};J8.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var eG=J8;function iEt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function aAe(e,t){Te.track(e);for(let n=0;n<e.sublayers.length;n++)aAe(e.sublayers[n],t)}function tG(e){return e.modelName==="FullModel"}function cAe(e){return e.modelName==="Overview"}function lAe(e){return cAe(e)||tG(e)}function sAe(e,t){if(lAe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Te.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function oEt(e,t){if(lAe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");tG(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function rEt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function sEt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Te.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Te.observable(!0),index:-1}],currentLayer:Te.observable(),expandClickHandler:iEt,setOptionDisable:function(i,o){Te.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){oEt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){aAe(n[i],this.viewModel);let o=sAe(n[i],this.viewModel);l(o)&&(cAe(o)||!l(this.viewModel.defaultLayer)&&tG(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=sAe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=tG(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return rEt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var nG=sEt;function aEt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` <h3>Building explorer</h3> <select data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer" @@ -16064,8 +16064,8 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let o=new eG(t);be.track(o),be.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var cAe=iEt;var oEt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",rEt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function EZ(){this._cameraClicked=new me,this._closeClicked=new me,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",be.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,be.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?rEt:oEt}}),be.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}EZ.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(EZ.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var tG=EZ;function nG(e){e=Rn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="×",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new tG;be.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=nn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=Oa(s,"description",function(h){r.style.height="5px",f.innerHTML=h;let p=null,_=f.firstElementChild;if(_!==null&&f.childNodes.length===1){let x=window.getComputedStyle(_);if(x!==null){let b=x["background-color"],T=z.fromCssColorString(b);l(T)&&T.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(nG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});nG.prototype.isDestroyed=function(){return!1};nG.prototype.destroy=function(){let e=this._container;return be.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var iG=nG;function lAe(){this.showInstructions=!1;let e=this;this._command=Sn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Sn(function(){e._touch=!1}),this._showTouch=Sn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",be.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(lAe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var oG=lAe;function rG(e){let t=Rn(e.container),n=new oG,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=nn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=nn("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let h=document.createElement("div");h.className="cesium-click-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),h.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(h);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${nn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),be.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(_){o.contains(_.target)||(n.showInstructions=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(rG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});rG.prototype.isDestroyed=function(){return!1};rG.prototype.destroy=function(){return Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var sG=rG;function SZ(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,be.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Sn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=o8.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(SZ.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});SZ.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var aG=SZ;function cG(e){let t=Rn(e.container),n=new aG(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),be.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(cG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});cG.prototype.isDestroyed=function(){return!1};cG.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var lG=cG;function uG(e){this._scene=e,this._orthographic=e.camera.frustum instanceof rn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,be.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;be.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Sn(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new _r,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ne.SCENE2D||t._scene.camera.frustum instanceof rn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Sn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Sn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(uG.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});uG.prototype.isDestroyed=function(){return!1};uG.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var fG=uG;var sEt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",aEt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function dG(e,t){e=Rn(e);let n=new fG(t);n._perspectivePath=sEt,n._orthographicPath=aEt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),be.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(dG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});dG.prototype.isDestroyed=function(){return!1};dG.prototype.destroy=function(){return this._viewModel.destroy(),Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var hG=dG;function mG(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new _r,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",be.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,be.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ne.SCENE2D?n.tooltip2D:o===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Sn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Sn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Sn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(mG.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});mG.prototype.isDestroyed=function(){return!1};mG.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var pG=mG;var cEt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",lEt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",uEt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function gG(e,t,n){e=Rn(e);let i=new pG(t,n);i._globePath=cEt,i._flatMapPath=lEt,i._columbusViewPath=uEt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),be.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},Ht.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(gG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});gG.prototype.isDestroyed=function(){return!1};gG.prototype.destroy=function(){return this._viewModel.destroy(),Ht.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),be.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var _G=gG;var fEt=new U,yG="-1000px";function HP(e,t,n){this._scene=e,this._screenPositionX=yG,this._screenPositionY=yG,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,be.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,be.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),be.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return zi.worldToWindowCoordinates(e,i,o)}}HP.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,fEt);if(!l(e))this._screenPositionX=yG,this._screenPositionY=yG;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};HP.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:$r.EXPONENTIAL_OUT})};HP.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:$r.EXPONENTIAL_OUT})};Object.defineProperties(HP.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var xG=HP;function bG(e,t){e=Rn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new xG(t,this._element,this._container);this._viewModel=c,be.applyBindings(this._viewModel,this._element)}Object.defineProperties(bG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});bG.prototype.isDestroyed=function(){return!1};bG.prototype.destroy=function(){let e=this._container;return be.cleanNode(this._element),e.removeChild(this._element),ue(this)};var TG=bG;function Yb(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}Yb.prototype.getHeight=function(){return this._height};Yb.prototype.getBase=function(){return this._base};Yb.prototype.getStartTime=function(){return this._start};Yb.prototype.getStopTime=function(){return this._stop};Yb.prototype.setRange=function(e,t){this._start=e,this._stop=t};Yb.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=Z.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=Z.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var CG=Yb;function uAe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}uAe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=Z.addSeconds(t.startJulian,t.duration,new Z);if(Z.lessThan(n,o)&&Z.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(Z.lessThanOrEquals(n,r)&&Z.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=Z.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new Z);!l(a)&&Z.greaterThanOrEquals(u,n)?a=s:!l(c)&&Z.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var AG=uAe;var vZ=1e12,rd={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},tl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},x0=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],dEt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function nl(e,t){e=Rn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=rd.none,this._touchMode=tl.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=hEt(this),this._onMouseUp=mEt(this),this._onMouseMove=pEt(this),this._onMouseWheel=gEt(this),this._onTouchStart=_Et(this),this._onTouchMove=xEt(this),this._onTouchEnd=yEt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}nl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};nl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};nl.prototype.isDestroyed=function(){return!1};nl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};nl.prototype.addHighlightRange=function(e,t,n){let i=new CG(e,t,n);return this._highlightRanges.push(i),this.resize(),i};nl.prototype.addTrack=function(e,t,n,i){let o=new AG(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};nl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Z.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Kr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=Z.secondsDifference(o,i),s=Z.secondsDifference(i,this._startJulian),a=Z.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=Z.addSeconds(this._endJulian,s,new Z),this._startJulian=i,this._timeBarSecondsSpan=Z.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=Z.addSeconds(this._startJulian,a,new Z),this._endJulian=o,this._timeBarSecondsSpan=Z.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};nl.prototype.zoomFrom=function(e){let t=Z.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(Z.addSeconds(this._startJulian,t-t*e,new Z),Z.addSeconds(this._endJulian,n*e-n,new Z))};function wZ(e){return e<10?`0${e.toString()}`:e.toString()}nl.prototype.makeLabel=function(e){let t=Z.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${dEt[t.month-1]} ${t.day} ${t.year} ${wZ(t.hour)}:${wZ(t.minute)}:${wZ(t.second)}${i}`};nl.prototype.smallestTicInPixels=7;nl.prototype._makeTics=function(){let e=this._timeBarEle,t=Z.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=Z.addSeconds(this._startJulian,a,new Z)):h>c&&(h=c,this._timeBarSecondsSpan=c,this._endJulian=Z.addSeconds(this._startJulian,c,new Z));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let _=this._startJulian,m=Math.min(h/p*1e-5,.4),x,b=Z.toGregorianDate(_);h>31536e4?x=Z.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):h>31536e3?x=Z.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):h>86400?x=Z.fromDate(new Date(Date.UTC(b.year,0))):x=Z.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let T=Z.secondsDifference(this._startJulian,Z.addSeconds(x,m,new Z)),C=T+h;this._epochJulian=x;function A(k){return Math.floor(T/k)*k}function S(k,W){return Math.ceil(k/W+.5)*W}function v(k){return(k-T)/h}function D(k,W){return k-W*Math.round(k/W)}this._rulerEle.innerHTML=this.makeLabel(Z.addSeconds(this._endJulian,-a,new Z));let O=this._rulerEle.offsetWidth+20;O<30&&(O=180);let R=f;f-=u;let M={startTime:T,startJulian:_,epochJulian:x,duration:h,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(M)});let L=0,g=0,E=0,w=O/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let I=-1,N=-1,B=x0.length,H;for(H=0;H<B;++H){let k=x0[H];if(++I,L=k,k>w&&k>f)break;N<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=I)}if(I>0){for(;I>0;)if(--I,Math.abs(D(L,x0[I]))<1e-5){x0[I]>=f&&(g=x0[I]);break}if(N>=0)for(;N<I;){if(Math.abs(D(g,x0[N]))<1e-5&&x0[N]>=f){E=x0[N];break}++N}}f=R,f>u&&E<1e-5&&Math.abs(f-L)>u&&(E=f,f<=L+u&&(g=0));let V=-999999,G;if(p*(E/this._timeBarSecondsSpan)>=3)for(o=A(E);o<=C;o=S(o,E))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(g/this._timeBarSecondsSpan)>=3)for(o=A(g);o<=C;o=S(o,g))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,C+=L,o=A(L);let k=Z.computeTaiMinusUtc(x);for(;o<=C;){let W=Z.addSeconds(_,o-T,new Z);if(L>2.1){let K=Z.computeTaiMinusUtc(W);Math.abs(K-k)>.1&&(o+=K-k,W=Z.addSeconds(_,o-T,new Z))}let Y=Math.round(p*v(o)),J=this.makeLabel(W);this._rulerEle.innerHTML=J,G=this._rulerEle.offsetWidth,G<10&&(G=O);let j=Y-(G/2-1);j>V?(V=j+G+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${Y.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${j.toString()}px;">${J}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${Y.toString()}px;"></span>`,o=S(o,L)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),M.y=0,this._trackList.forEach(function(k){k.render(r._context,M),M.y+=k.height})};nl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=Z.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(Z.addSeconds(this._startJulian,this._timelineDrag,new Z),Z.addSeconds(this._endJulian,this._timelineDrag,new Z)))};nl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=Z.addSeconds(this._startJulian,t,new Z),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function hEt(e){return function(t){e._mouseMode!==rd.touchOnly&&(t.button===0?(e._mouseMode=rd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=rd.zoom:e._mouseMode=rd.slide)),t.preventDefault()}}function mEt(e){return function(t){e._mouseMode=rd.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function pEt(e){return function(t){let n;if(e._mouseMode===rd.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===rd.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(Z.addSeconds(e._startJulian,i,new Z),Z.addSeconds(e._endJulian,i,new Z))}}else e._mouseMode===rd.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function gEt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;vZ=Math.max(Math.min(Math.abs(n),vZ),1),n/=vZ,e.zoomFrom(Math.pow(1.05,-n))}}function _Et(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=rd.touchOnly,n===1?(i=Z.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=tl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=tl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=tl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=tl.ignore}}function yEt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===tl.singleTap?(e._touchMode=tl.scrub,e._onTouchMove(t)):e._touchMode===tl.scrub&&e._onTouchMove(t),e._mouseMode=rd.touchOnly,n!==1?e._touchMode=n>0?tl.ignore:tl.none:e._touchMode===tl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function xEt(e){return function(t){let n,i,o,r,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===tl.singleTap&&(e._touchMode=tl.slideZoom),e._mouseMode=rd.touchOnly,e._touchMode===tl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===tl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=Z.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new Z)):(n=e._touchState.centerX-r,a=Z.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new Z)),e.zoomTo(a,Z.addSeconds(a,e._timeBarSecondsSpan*c,new Z)),e._touchState.centerX=r,e._touchState.spanX=s))}}nl.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var EG=nl;var pAe=Ur(mAe(),1);function CEt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function gAe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function AEt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(gAe(),e._locked=!1),e._noSleep.disable(),Sr.exitFullscreen(),n(!1)):(Sr.fullscreen||Sr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=CEt("landscape")),t.useWebVR=!0,n(!0)))}function SG(e,t){let n=this,i=be.observable(Sr.enabled),o=be.observable(!1);this.isVRMode=void 0,be.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,be.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Sr.enabled)}}),this.tooltip=void 0,be.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=be.observable(!1);this._isOrthographic=void 0,be.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new _r,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof rn)}),this._locked=!1,this._noSleep=new pAe.default,this._command=Sn(function(){AEt(n,e,o,r)},be.getObservable(this,"isVREnabled")),this._vrElement=y(Rn(t),document.body),this._callback=function(){!Sr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(gAe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Sr.changeEventName,this._callback)}Object.defineProperties(SG.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});SG.prototype.isDestroyed=function(){return!1};SG.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Sr.changeEventName,this._callback),ue(this)};var vG=SG;var EEt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",SEt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function wG(e,t,n){e=Rn(e);let i=new vG(t,n);i._exitVRPath=SEt,i._enterVRPath=EEt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),be.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(wG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});wG.prototype.isDestroyed=function(){return!1};wG.prototype.destroy=function(){return this._viewModel.destroy(),be.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var DG=wG;var _Ae=new ae;function bAe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function vEt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function wEt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function yAe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof or)return i;if(n instanceof $s)return new or({name:wEt(n),description:vEt(n),feature:n})}if(l(e.scene.globe))return PEt(e,t.position)}var DEt=new Z;function RZ(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;Z.equals(i,o)&&(o=Z.addSeconds(i,P.EPSILON2,DEt)),e.updateFromClock(),e.zoomTo(i,o)}}}var IEt=new d;function PEt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new or({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=xAe();return}let a=s[0],c=new or({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,IEt);c.position=new gl(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=xAe())}),r}function xAe(){return new or({id:"None",description:"No features found."})}function REt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(h)&&(h.container.style.visibility=p),e._container){let _=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${_}px`,e.forceResize()}}function ji(e,t){e=Rn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=y(t.scene3DOnly,!1),c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new um,u=new E8(c),f=!0);let h=new IH(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=h.scene,_=new _r;_.add(c.onTick,ji.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let W=document.createElement("div");W.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(W),m=new TG(W,p)}let x;if(!l(t.infoBox)||t.infoBox!==!1){let W=document.createElement("div");W.className="cesium-viewer-infoBoxContainer",o.appendChild(W),x=new iG(W);let Y=x.viewModel;_.add(Y.cameraClicked,ji.prototype._onInfoBoxCameraClicked,this),_.add(Y.closeClicked,ji.prototype._onInfoBoxClockClicked,this)}let b=document.createElement("div");b.className="cesium-viewer-toolbar",o.appendChild(b);let T;if(!l(t.geocoder)||t.geocoder!==!1){let W=document.createElement("div");W.className="cesium-viewer-geocoderContainer",b.appendChild(W);let Y;typeof t.geocoder=="string"?Y=[new dS({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(Y=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),T=new K8({container:W,geocoderServices:Y,scene:p}),_.add(T.viewModel.search.beforeExecute,ji.prototype._clearObjects,this)}let C;(!l(t.homeButton)||t.homeButton!==!1)&&(C=new Q8(b,p),l(T)&&_.add(C.viewModel.command.afterExecute,function(){let W=T.viewModel;W.searchText="",W.isSearchInProgress&&W.search()}),_.add(C.viewModel.command.beforeExecute,ji.prototype._clearTrackedObject,this));let A;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(A=new _G(b,p));let S;t.projectionPicker&&(S=new hG(b,p));let v,D;if(n){let W=y(t.imageryProviderViewModels,B8()),Y=y(t.terrainProviderViewModels,k8());v=new F8(b,{globe:p.globe,imageryProviderViewModels:W,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:Y,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),D=b.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let O;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let W=!0;try{if(l(window.localStorage)){let Y=window.localStorage.getItem("cesium-hasSeenNavHelp");l(Y)&&Y?W=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}O=new sG({container:b,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,W)})}let R;if(!l(t.animation)||t.animation!==!1){let W=document.createElement("div");W.className="cesium-viewer-animationContainer",o.appendChild(W),R=new I8(W,new P8(u))}let M;if(!l(t.timeline)||t.timeline!==!1){let W=document.createElement("div");W.className="cesium-viewer-timelineContainer",o.appendChild(W),M=new EG(W,c),M.addEventListener("settime",bAe,!1),M.zoomTo(c.startTime,c.stopTime)}let L,g,E;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(E=document.createElement("div"),E.className="cesium-viewer-fullscreenContainer",o.appendChild(E),L=new q8(E,t.fullscreenElement),g=Oa(L.viewModel,"isFullscreenEnabled",function(W){E.style.display=W?"block":"none",l(M)&&(M.container.style.right=`${E.clientWidth}px`,M.resize())}));let w,I,N;if(t.vrButton){let W=document.createElement("div");W.className="cesium-viewer-vrContainer",o.appendChild(W),w=new DG(W,p,t.fullScreenElement),I=Oa(w.viewModel,"isVREnabled",function(Y){W.style.display=Y?"block":"none",l(L)&&(W.style.right=`${E.clientWidth}px`),l(M)&&(M.container.style.right=`${W.clientWidth}px`,M.resize())}),N=Oa(w.viewModel,"isVRMode",function(Y){REt(i,Y)})}this._baseLayerPickerDropDown=D,this._fullscreenSubscription=g,this._vrSubscription=I,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=m,this._infoBox=x,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=b,this._homeButton=C,this._sceneModePicker=A,this._projectionPicker=S,this._baseLayerPicker=v,this._navigationHelpButton=O,this._animation=R,this._timeline=M,this._fullscreenButton=L,this._vrButton=w,this._geocoder=T,this._eventHelper=_,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(x)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new me;let B=this._cesiumWidget.dataSources,H=this._cesiumWidget.dataSourceDisplay;_.add(B.dataSourceAdded,ji.prototype._onDataSourceAdded,this),_.add(B.dataSourceRemoved,ji.prototype._onDataSourceRemoved,this),_.add(p.postUpdate,ji.prototype.resize,this);let V=B.length;for(let W=0;W<V;W++)this._dataSourceAdded(B,B.get(W));this._dataSourceAdded(void 0,H.defaultDataSource),_.add(B.dataSourceAdded,ji.prototype._dataSourceAdded,this),_.add(B.dataSourceRemoved,ji.prototype._dataSourceRemoved,this);function G(W){let Y=yAe(i,W);l(Y)?q.getValueOrUndefined(Y.position,i.clock.currentTime)?i.trackedEntity=Y:i.zoomTo(Y):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(W){i.selectedEntity=yAe(i,W)}h.screenSpaceEventHandler.setInputAction(k,Tn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(G,Tn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(ji.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,RZ(this._timeline,e))}}});ji.prototype.extend=function(e,t){e(this,t)};ji.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,h=5,p=3,_=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,x=this._vrButton,b=c.container,T=b.style;p=b.clientHeight+3,T.left=`${f}px`;let C=0;l(m)&&(C+=m.container.clientWidth),l(x)&&(C+=x.container.clientWidth),T.right=`${C}px`,c.resize()}!r&&l(this._fullscreenButton)&&(_=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${_}px`,this._lastWidth=n,this._lastHeight=i};ji.prototype.forceResize=function(){this._lastWidth=0,this.resize()};ji.prototype.render=function(){this._cesiumWidget.render()};ji.prototype.isDestroyed=function(){return!1};ji.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Tn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Tn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",bAe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),ue(this)};ji.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(ji.prototype._onEntityCollectionChanged,this)};ji.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(ji.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};ji.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};ji.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,_Ae)!==ct.FAILED?n=_Ae.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=d.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=y(o.name,o.id),a.description=q.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};ji.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};ji.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};ji.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};ji.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};ji.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};ji.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&RZ(this.timeline,e)};ji.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&RZ(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,ji.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};ji.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};ji.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};ji.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var TAe=ji;function OEt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new H8(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var CAe=OEt;function MEt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new M8(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var AAe=MEt;function LEt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new me,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Rn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){EAe(s,u),s=f,OZ(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?OZ(s,u):EAe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){Xb(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=f.dataTransfer.files,p=h.length;for(let _=0;_<p;_++){let m=h[_],x=new FileReader;x.onload=NEt(e,m,c,a),x.onerror=FEt(e,m),x.readAsText(m)}}OZ(s,u),e.destroy=qH(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function Xb(e){e.stopPropagation(),e.preventDefault()}function EAe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",Xb,!1),n.removeEventListener("dragover",Xb,!1),n.removeEventListener("dragexit",Xb,!1))}function OZ(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",Xb,!1),e.addEventListener("dragover",Xb,!1),e.addEventListener("dragexit",Xb,!1)}function NEt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=Y3.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=jk.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=uU.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=tV.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function FEt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var SAe=LEt;function BEt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new lG({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var vAe=BEt;function wAe(e){let t=e.split(` + </div>`,n.appendChild(i);let o=new nG(t);Te.track(o),Te.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var uAe=aEt;var cEt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",lEt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function EZ(){this._cameraClicked=new pe,this._closeClicked=new pe,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Te.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Te.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?lEt:cEt}}),Te.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}EZ.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(EZ.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var iG=EZ;function oG(e){e=Rn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="×",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new iG;Te.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=en("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),a._descriptionSubscription=La(s,"description",function(h){r.style.height="5px",f.innerHTML=h;let p=null,_=f.firstElementChild;if(_!==null&&f.childNodes.length===1){let x=window.getComputedStyle(_);if(x!==null){let b=x["background-color"],T=z.fromCssColorString(b);l(T)&&T.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(oG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});oG.prototype.isDestroyed=function(){return!1};oG.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var rG=oG;function SZ(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Te.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Sn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=r8.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(SZ.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});SZ.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var sG=SZ;function aG(e){let t=Rn(e.container),n=new sG(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Te.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(aG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});aG.prototype.isDestroyed=function(){return!1};aG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var cG=aG;function fAe(){this.showInstructions=!1;let e=this;this._command=Sn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Sn(function(){e._touch=!1}),this._showTouch=Sn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Te.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(fAe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var lG=fAe;function uG(e){let t=Rn(e.container),n=new lG,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=en("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=en("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let h=document.createElement("div");h.className="cesium-click-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),h.innerHTML=` <table> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(h);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Te.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(_){o.contains(_.target)||(n.showInstructions=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(uG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});uG.prototype.isDestroyed=function(){return!1};uG.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var fG=uG;function dG(e){this._scene=e,this._orthographic=e.camera.frustum instanceof nn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Te.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Te.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Sn(function(){t.sceneMode===ne.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new _r,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ne.SCENE2D||t._scene.camera.frustum instanceof nn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Sn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Sn(function(){t.sceneMode!==ne.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ne}Object.defineProperties(dG.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});dG.prototype.isDestroyed=function(){return!1};dG.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var hG=dG;var uEt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",fEt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function mG(e,t){e=Rn(e);let n=new hG(t);n._perspectivePath=uEt,n._orthographicPath=fEt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Te.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(mG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});mG.prototype.isDestroyed=function(){return!1};mG.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var pG=mG;function gG(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new _r,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Te.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Te.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ne.SCENE2D?n.tooltip2D:o===ne.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Sn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Sn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Sn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ne}Object.defineProperties(gG.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});gG.prototype.isDestroyed=function(){return!1};gG.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var _G=gG;var dEt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",hEt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",mEt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function yG(e,t,n){e=Rn(e);let i=new _G(t,n);i._globePath=dEt,i._flatMapPath=hEt,i._columbusViewPath=mEt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Te.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(yG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});yG.prototype.isDestroyed=function(){return!1};yG.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var xG=yG;var pEt=new U,bG="-1000px";function qP(e,t,n){this._scene=e,this._screenPositionX=bG,this._screenPositionY=bG,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Te.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Te.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Te.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return zi.worldToWindowCoordinates(e,i,o)}}qP.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,pEt);if(!l(e))this._screenPositionX=bG,this._screenPositionY=bG;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};qP.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:$r.EXPONENTIAL_OUT})};qP.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:$r.EXPONENTIAL_OUT})};Object.defineProperties(qP.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var TG=qP;function CG(e,t){e=Rn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new TG(t,this._element,this._container);this._viewModel=c,Te.applyBindings(this._viewModel,this._element)}Object.defineProperties(CG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});CG.prototype.isDestroyed=function(){return!1};CG.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),ue(this)};var AG=CG;function Yb(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}Yb.prototype.getHeight=function(){return this._height};Yb.prototype.getBase=function(){return this._base};Yb.prototype.getStartTime=function(){return this._start};Yb.prototype.getStopTime=function(){return this._stop};Yb.prototype.setRange=function(e,t){this._start=e,this._stop=t};Yb.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=Z.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=Z.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var EG=Yb;function dAe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}dAe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=Z.addSeconds(t.startJulian,t.duration,new Z);if(Z.lessThan(n,o)&&Z.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(Z.lessThanOrEquals(n,r)&&Z.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=Z.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new Z);!l(a)&&Z.greaterThanOrEquals(u,n)?a=s:!l(c)&&Z.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var SG=dAe;var vZ=1e12,rd={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},nl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},x0=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],gEt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function il(e,t){e=Rn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=rd.none,this._touchMode=nl.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=_Et(this),this._onMouseUp=yEt(this),this._onMouseMove=xEt(this),this._onMouseWheel=bEt(this),this._onTouchStart=TEt(this),this._onTouchMove=AEt(this),this._onTouchEnd=CEt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}il.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};il.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};il.prototype.isDestroyed=function(){return!1};il.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};il.prototype.addHighlightRange=function(e,t,n){let i=new EG(e,t,n);return this._highlightRanges.push(i),this.resize(),i};il.prototype.addTrack=function(e,t,n,i){let o=new SG(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};il.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Z.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Kr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=Z.secondsDifference(o,i),s=Z.secondsDifference(i,this._startJulian),a=Z.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=Z.addSeconds(this._endJulian,s,new Z),this._startJulian=i,this._timeBarSecondsSpan=Z.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=Z.addSeconds(this._startJulian,a,new Z),this._endJulian=o,this._timeBarSecondsSpan=Z.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};il.prototype.zoomFrom=function(e){let t=Z.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(Z.addSeconds(this._startJulian,t-t*e,new Z),Z.addSeconds(this._endJulian,n*e-n,new Z))};function wZ(e){return e<10?`0${e.toString()}`:e.toString()}il.prototype.makeLabel=function(e){let t=Z.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${gEt[t.month-1]} ${t.day} ${t.year} ${wZ(t.hour)}:${wZ(t.minute)}:${wZ(t.second)}${i}`};il.prototype.smallestTicInPixels=7;il.prototype._makeTics=function(){let e=this._timeBarEle,t=Z.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=Z.addSeconds(this._startJulian,a,new Z)):h>c&&(h=c,this._timeBarSecondsSpan=c,this._endJulian=Z.addSeconds(this._startJulian,c,new Z));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let _=this._startJulian,m=Math.min(h/p*1e-5,.4),x,b=Z.toGregorianDate(_);h>31536e4?x=Z.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):h>31536e3?x=Z.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):h>86400?x=Z.fromDate(new Date(Date.UTC(b.year,0))):x=Z.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let T=Z.secondsDifference(this._startJulian,Z.addSeconds(x,m,new Z)),C=T+h;this._epochJulian=x;function A(k){return Math.floor(T/k)*k}function S(k,W){return Math.ceil(k/W+.5)*W}function v(k){return(k-T)/h}function D(k,W){return k-W*Math.round(k/W)}this._rulerEle.innerHTML=this.makeLabel(Z.addSeconds(this._endJulian,-a,new Z));let O=this._rulerEle.offsetWidth+20;O<30&&(O=180);let R=f;f-=u;let M={startTime:T,startJulian:_,epochJulian:x,duration:h,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(M)});let L=0,g=0,E=0,w=O/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let I=-1,N=-1,B=x0.length,H;for(H=0;H<B;++H){let k=x0[H];if(++I,L=k,k>w&&k>f)break;N<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=I)}if(I>0){for(;I>0;)if(--I,Math.abs(D(L,x0[I]))<1e-5){x0[I]>=f&&(g=x0[I]);break}if(N>=0)for(;N<I;){if(Math.abs(D(g,x0[N]))<1e-5&&x0[N]>=f){E=x0[N];break}++N}}f=R,f>u&&E<1e-5&&Math.abs(f-L)>u&&(E=f,f<=L+u&&(g=0));let V=-999999,G;if(p*(E/this._timeBarSecondsSpan)>=3)for(o=A(E);o<=C;o=S(o,E))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(g/this._timeBarSecondsSpan)>=3)for(o=A(g);o<=C;o=S(o,g))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,C+=L,o=A(L);let k=Z.computeTaiMinusUtc(x);for(;o<=C;){let W=Z.addSeconds(_,o-T,new Z);if(L>2.1){let K=Z.computeTaiMinusUtc(W);Math.abs(K-k)>.1&&(o+=K-k,W=Z.addSeconds(_,o-T,new Z))}let Y=Math.round(p*v(o)),J=this.makeLabel(W);this._rulerEle.innerHTML=J,G=this._rulerEle.offsetWidth,G<10&&(G=O);let j=Y-(G/2-1);j>V?(V=j+G+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${Y.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${j.toString()}px;">${J}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${Y.toString()}px;"></span>`,o=S(o,L)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),M.y=0,this._trackList.forEach(function(k){k.render(r._context,M),M.y+=k.height})};il.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=Z.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(Z.addSeconds(this._startJulian,this._timelineDrag,new Z),Z.addSeconds(this._endJulian,this._timelineDrag,new Z)))};il.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=Z.addSeconds(this._startJulian,t,new Z),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function _Et(e){return function(t){e._mouseMode!==rd.touchOnly&&(t.button===0?(e._mouseMode=rd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=rd.zoom:e._mouseMode=rd.slide)),t.preventDefault()}}function yEt(e){return function(t){e._mouseMode=rd.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function xEt(e){return function(t){let n;if(e._mouseMode===rd.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===rd.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(Z.addSeconds(e._startJulian,i,new Z),Z.addSeconds(e._endJulian,i,new Z))}}else e._mouseMode===rd.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function bEt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;vZ=Math.max(Math.min(Math.abs(n),vZ),1),n/=vZ,e.zoomFrom(Math.pow(1.05,-n))}}function TEt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=rd.touchOnly,n===1?(i=Z.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=nl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=nl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=nl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=nl.ignore}}function CEt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===nl.singleTap?(e._touchMode=nl.scrub,e._onTouchMove(t)):e._touchMode===nl.scrub&&e._onTouchMove(t),e._mouseMode=rd.touchOnly,n!==1?e._touchMode=n>0?nl.ignore:nl.none:e._touchMode===nl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function AEt(e){return function(t){let n,i,o,r,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===nl.singleTap&&(e._touchMode=nl.slideZoom),e._mouseMode=rd.touchOnly,e._touchMode===nl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===nl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=Z.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new Z)):(n=e._touchState.centerX-r,a=Z.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new Z)),e.zoomTo(a,Z.addSeconds(a,e._timeBarSecondsSpan*c,new Z)),e._touchState.centerX=r,e._touchState.spanX=s))}}il.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var vG=il;var _Ae=Ur(gAe(),1);function vEt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function yAe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function wEt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(yAe(),e._locked=!1),e._noSleep.disable(),Sr.exitFullscreen(),n(!1)):(Sr.fullscreen||Sr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=vEt("landscape")),t.useWebVR=!0,n(!0)))}function wG(e,t){let n=this,i=Te.observable(Sr.enabled),o=Te.observable(!1);this.isVRMode=void 0,Te.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Te.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Sr.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Te.observable(!1);this._isOrthographic=void 0,Te.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new _r,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof nn)}),this._locked=!1,this._noSleep=new _Ae.default,this._command=Sn(function(){wEt(n,e,o,r)},Te.getObservable(this,"isVREnabled")),this._vrElement=y(Rn(t),document.body),this._callback=function(){!Sr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(yAe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Sr.changeEventName,this._callback)}Object.defineProperties(wG.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});wG.prototype.isDestroyed=function(){return!1};wG.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Sr.changeEventName,this._callback),ue(this)};var DG=wG;var DEt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",IEt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function IG(e,t,n){e=Rn(e);let i=new DG(t,n);i._exitVRPath=IEt,i._enterVRPath=DEt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(IG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});IG.prototype.isDestroyed=function(){return!1};IG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var PG=IG;var xAe=new ae;function CAe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function PEt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function REt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function bAe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof or)return i;if(n instanceof Js)return new or({name:REt(n),description:PEt(n),feature:n})}if(l(e.scene.globe))return LEt(e,t.position)}var OEt=new Z;function RZ(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;Z.equals(i,o)&&(o=Z.addSeconds(i,P.EPSILON2,OEt)),e.updateFromClock(),e.zoomTo(i,o)}}}var MEt=new d;function LEt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new or({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=TAe();return}let a=s[0],c=new or({id:a.name,description:a.description});if(l(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,MEt);c.position=new _l(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=TAe())}),r}function TAe(){return new or({id:"None",description:"No features found."})}function NEt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(h)&&(h.container.style.visibility=p),e._container){let _=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${_}px`,e.forceResize()}}function ji(e,t){e=Rn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=y(t.scene3DOnly,!1),c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new um,u=new v8(c),f=!0);let h=new SH(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=h.scene,_=new _r;_.add(c.onTick,ji.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let W=document.createElement("div");W.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(W),m=new AG(W,p)}let x;if(!l(t.infoBox)||t.infoBox!==!1){let W=document.createElement("div");W.className="cesium-viewer-infoBoxContainer",o.appendChild(W),x=new rG(W);let Y=x.viewModel;_.add(Y.cameraClicked,ji.prototype._onInfoBoxCameraClicked,this),_.add(Y.closeClicked,ji.prototype._onInfoBoxClockClicked,this)}let b=document.createElement("div");b.className="cesium-viewer-toolbar",o.appendChild(b);let T;if(!l(t.geocoder)||t.geocoder!==!1){let W=document.createElement("div");W.className="cesium-viewer-geocoderContainer",b.appendChild(W);let Y;typeof t.geocoder=="string"?Y=[new pS({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(Y=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),T=new $8({container:W,geocoderServices:Y,scene:p}),_.add(T.viewModel.search.beforeExecute,ji.prototype._clearObjects,this)}let C;(!l(t.homeButton)||t.homeButton!==!1)&&(C=new eG(b,p),l(T)&&_.add(C.viewModel.command.afterExecute,function(){let W=T.viewModel;W.searchText="",W.isSearchInProgress&&W.search()}),_.add(C.viewModel.command.beforeExecute,ji.prototype._clearTrackedObject,this));let A;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(A=new xG(b,p));let S;t.projectionPicker&&(S=new pG(b,p));let v,D;if(n){let W=y(t.imageryProviderViewModels,F8()),Y=y(t.terrainProviderViewModels,B8());v=new N8(b,{globe:p.globe,imageryProviderViewModels:W,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:Y,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),D=b.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let O;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let W=!0;try{if(l(window.localStorage)){let Y=window.localStorage.getItem("cesium-hasSeenNavHelp");l(Y)&&Y?W=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}O=new fG({container:b,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,W)})}let R;if(!l(t.animation)||t.animation!==!1){let W=document.createElement("div");W.className="cesium-viewer-animationContainer",o.appendChild(W),R=new R8(W,new O8(u))}let M;if(!l(t.timeline)||t.timeline!==!1){let W=document.createElement("div");W.className="cesium-viewer-timelineContainer",o.appendChild(W),M=new vG(W,c),M.addEventListener("settime",CAe,!1),M.zoomTo(c.startTime,c.stopTime)}let L,g,E;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(E=document.createElement("div"),E.className="cesium-viewer-fullscreenContainer",o.appendChild(E),L=new X8(E,t.fullscreenElement),g=La(L.viewModel,"isFullscreenEnabled",function(W){E.style.display=W?"block":"none",l(M)&&(M.container.style.right=`${E.clientWidth}px`,M.resize())}));let w,I,N;if(t.vrButton){let W=document.createElement("div");W.className="cesium-viewer-vrContainer",o.appendChild(W),w=new PG(W,p,t.fullScreenElement),I=La(w.viewModel,"isVREnabled",function(Y){W.style.display=Y?"block":"none",l(L)&&(W.style.right=`${E.clientWidth}px`),l(M)&&(M.container.style.right=`${W.clientWidth}px`,M.resize())}),N=La(w.viewModel,"isVRMode",function(Y){NEt(i,Y)})}this._baseLayerPickerDropDown=D,this._fullscreenSubscription=g,this._vrSubscription=I,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=m,this._infoBox=x,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=b,this._homeButton=C,this._sceneModePicker=A,this._projectionPicker=S,this._baseLayerPicker=v,this._navigationHelpButton=O,this._animation=R,this._timeline=M,this._fullscreenButton=L,this._vrButton=w,this._geocoder=T,this._eventHelper=_,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(x)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new pe;let B=this._cesiumWidget.dataSources,H=this._cesiumWidget.dataSourceDisplay;_.add(B.dataSourceAdded,ji.prototype._onDataSourceAdded,this),_.add(B.dataSourceRemoved,ji.prototype._onDataSourceRemoved,this),_.add(p.postUpdate,ji.prototype.resize,this);let V=B.length;for(let W=0;W<V;W++)this._dataSourceAdded(B,B.get(W));this._dataSourceAdded(void 0,H.defaultDataSource),_.add(B.dataSourceAdded,ji.prototype._dataSourceAdded,this),_.add(B.dataSourceRemoved,ji.prototype._dataSourceRemoved,this);function G(W){let Y=bAe(i,W);l(Y)?q.getValueOrUndefined(Y.position,i.clock.currentTime)?i.trackedEntity=Y:i.zoomTo(Y):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(W){i.selectedEntity=bAe(i,W)}h.screenSpaceEventHandler.setInputAction(k,Tn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(G,Tn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(ji.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,RZ(this._timeline,e))}}});ji.prototype.extend=function(e,t){e(this,t)};ji.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,h=5,p=3,_=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,x=this._vrButton,b=c.container,T=b.style;p=b.clientHeight+3,T.left=`${f}px`;let C=0;l(m)&&(C+=m.container.clientWidth),l(x)&&(C+=x.container.clientWidth),T.right=`${C}px`,c.resize()}!r&&l(this._fullscreenButton)&&(_=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${_}px`,this._lastWidth=n,this._lastHeight=i};ji.prototype.forceResize=function(){this._lastWidth=0,this.resize()};ji.prototype.render=function(){this._cesiumWidget.render()};ji.prototype.isDestroyed=function(){return!1};ji.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Tn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Tn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",CAe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),ue(this)};ji.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(ji.prototype._onEntityCollectionChanged,this)};ji.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(ji.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};ji.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};ji.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,xAe)!==at.FAILED?n=xAe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=d.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=y(o.name,o.id),a.description=q.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};ji.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};ji.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};ji.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};ji.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};ji.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};ji.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&RZ(this.timeline,e)};ji.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&RZ(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,ji.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};ji.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};ji.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};ji.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var AAe=ji;function FEt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new W8(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var EAe=FEt;function BEt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new U8(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var SAe=BEt;function kEt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new pe,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Rn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){vAe(s,u),s=f,OZ(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?OZ(s,u):vAe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){Xb(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=f.dataTransfer.files,p=h.length;for(let _=0;_<p;_++){let m=h[_],x=new FileReader;x.onload=VEt(e,m,c,a),x.onerror=UEt(e,m),x.readAsText(m)}}OZ(s,u),e.destroy=YH(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function Xb(e){e.stopPropagation(),e.preventDefault()}function vAe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",Xb,!1),n.removeEventListener("dragover",Xb,!1),n.removeEventListener("dragexit",Xb,!1))}function OZ(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",Xb,!1),e.addEventListener("dragover",Xb,!1),e.addEventListener("dragexit",Xb,!1)}function VEt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=D3.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=oE.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=xE.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=Nk.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function UEt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var wAe=kEt;function zEt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new cG({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var DAe=zEt;function IAe(e){let t=e.split(` `),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c} -`}return i}function sd(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=be.observable();return be.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=wAe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===ki.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===ki.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===ki.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xm(t)},getPrimitiveFunction:function(){t.translationX=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xm(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xm(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Xm(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Xm(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Xm(t)},getPrimitiveFunction:function(){t.scaleZ=F.getScale(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xm(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xm(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xm(t)}})}var kEt=new d,VEt=new d,UEt=new Ha,zEt=new $;function Xm(e){let t=d.fromElements(e.translationX,e.translationY,e.translationZ,kEt),n=d.fromElements(e.scaleX,e.scaleY,e.scaleZ,VEt),i=UEt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,zEt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(sd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=wAe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,Xm(t)}}}});sd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};sd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};sd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};sd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};sd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};sd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};sd.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new $E({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};sd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` +`}return i}function sd(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Te.observable();return Te.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=IAe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Vi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Vi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Vi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Km(t)},getPrimitiveFunction:function(){t.translationX=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Km(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Km(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Km(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Km(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Km(t)},getPrimitiveFunction:function(){t.scaleZ=F.getScale(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Km(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Km(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Km(t)}})}var HEt=new d,GEt=new d,WEt=new Ga,jEt=new $;function Km(e){let t=d.fromElements(e.translationX,e.translationY,e.translationZ,HEt),n=d.fromElements(e.scaleX,e.scaleY,e.scaleZ,GEt),i=WEt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,jEt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(sd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=IAe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,Km(t)}}}});sd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};sd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};sd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};sd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};sd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};sd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};sd.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new eS({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};sd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` `),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};sd.prototype.isDestroyed=function(){return!1};sd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){be.getObservable(e,t).dispose()}),ue(this)};var IG=sd;function PG(e,t){e=Rn(e);let n=document.createElement("div"),i=new IG(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=gc.createSection,a=gc.createCheckbox,c=gc.createRangeInput,u=gc.createButton,f=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),_=s(r,"Clipping","clippingVisible","toggleClipping"),m=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let x=10,b=10,T=P.PI;h.appendChild(c("Translation X","translationX",-x,+x)),h.appendChild(c("Translation Y","translationY",-x,+x)),h.appendChild(c("Translation Z","translationZ",-x,+x)),h.appendChild(c("Scale X","scaleX",0,+b)),h.appendChild(c("Scale Y","scaleY",0,+b)),h.appendChild(c("Scale Z","scaleZ",0,+b)),h.appendChild(c("Heading","angleX",-T,+T)),h.appendChild(c("Pitch","angleY",-T,+T)),h.appendChild(c("Roll","angleZ",-T,+T));let C=ki.getMinBounds(ki.BOX),A=ki.getMaxBounds(ki.BOX),S=d.fromElements(ki.getMinBounds(ki.ELLIPSOID).x,ki.getMinBounds(ki.ELLIPSOID).y,-ee.WGS84.maximumRadius,new d),v=d.fromElements(ki.getMaxBounds(ki.ELLIPSOID).x,ki.getMaxBounds(ki.ELLIPSOID).y,1e7,new d),D=ki.getMinBounds(ki.CYLINDER),O=ki.getMaxBounds(ki.CYLINDER);wS("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",C,A,"shapeIsBox",p),wS("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",S,v,"shapeIsEllipsoid",p),wS("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",D,O,"shapeIsCylinder",p),wS("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",C,A,"shapeIsBox",_),wS("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",S,v,"shapeIsEllipsoid",_),wS("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",D,O,"shapeIsCylinder",_);let R=document.createElement("div");m.appendChild(R);let M=document.createElement("textarea");M.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),R.className="cesium-cesiumInspector-styleEditor",R.appendChild(M);let L=u("Compile (Ctrl+Enter)","compileShader");R.appendChild(L);let g=document.createElement("label");g.style.display="block",g.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),R.appendChild(g),be.applyBindings(i,n)}Object.defineProperties(PG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});PG.prototype.isDestroyed=function(){return!1};PG.prototype.destroy=function(){return be.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function wS(e,t,n,i,o,r,s,a,c,u,f,h,p,_,m,x){let b=gc.createRangeInput,T=p,C=_,A=x.appendChild(document.createElement("div"));A.setAttribute("data-bind",`if: ${m}`),A.appendChild(b(e,s,T.x,C.x)),A.appendChild(b(t,a,T.x,C.x)),A.appendChild(b(n,c,T.y,C.y)),A.appendChild(b(i,u,T.y,C.y)),A.appendChild(b(o,f,T.z,C.z)),A.appendChild(b(r,h,T.z,C.z))}var RG=PG;function HEt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new RG(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var DAe=HEt;globalThis.CESIUM_VERSION="1.124";var _lo="1.124";export{Ep as AlphaMode,v2 as AlphaPipelineStage,vF as AnchorPointDirect,wF as AnchorPointIndirect,I8 as Animation,P8 as AnimationViewModel,to as Appearance,li as ApproximateTerrainHeights,Rbe as ArcGISTiledElevationTerrainProvider,Mm as ArcGisBaseMapType,Hy as ArcGisMapServerImageryProvider,Wf as ArcGisMapService,tn as ArcType,Bc as ArticulationStageType,vt as AssociativeArray,TC as Atmosphere,r2 as AtmospherePipelineStage,Ln as AttributeCompression,on as AttributeType,A4 as AutoExposure,Ig as AutomaticUniforms,No as Axis,G0 as AxisAlignedBoundingBox,VF as B3dmLoader,kF as B3dmParser,F8 as BaseLayerPicker,L8 as BaseLayerPickerViewModel,LT as BatchTable,iC as BatchTableHierarchy,xl as BatchTexture,w2 as BatchTexturePipelineStage,co as Billboard,Tf as BillboardCollection,Ec as BillboardGraphics,DL as BillboardVisualizer,Mbe as BingMapsGeocoderService,AU as BingMapsImageryProvider,TI as BingMapsStyle,qa as BlendEquation,So as BlendFunction,Do as BlendOption,un as BlendingState,qe as BoundingRectangle,ae as BoundingSphere,ct as BoundingSphereState,mC as BoundingVolumeSemantics,DTe as BoxEmitter,ja as BoxGeometry,xN as BoxGeometryUpdater,zT as BoxGraphics,Oh as BoxOutlineGeometry,gz as BrdfLutGenerator,yt as Buffer,sC as BufferLoader,Fe as BufferUsage,R2 as CPUStylingPipelineStage,bN as CallbackPositionProperty,Vh as CallbackProperty,ro as Camera,D4 as CameraEventAggregator,Bi as CameraEventType,_z as CameraFlightPath,U as Cartesian2,d as Cartesian3,oe as Cartesian4,fe as Cartographic,Lbe as CartographicGeocoderService,Fbe as CatmullRomSpline,nC as Cesium3DContentGroup,Nd as Cesium3DTile,i_ as Cesium3DTileBatchTable,eu as Cesium3DTileColorBlendMode,ITe as Cesium3DTileContent,XC as Cesium3DTileContentFactory,Ko as Cesium3DTileContentState,ks as Cesium3DTileContentType,$s as Cesium3DTileFeature,Qh as Cesium3DTileFeatureTable,Od as Cesium3DTileOptimizationHint,c3 as Cesium3DTileOptimizations,Vo as Cesium3DTilePass,ch as Cesium3DTilePassState,z_ as Cesium3DTilePointFeature,Yo as Cesium3DTileRefine,yS as Cesium3DTileStyle,h3 as Cesium3DTileStyleEngine,H8 as Cesium3DTilesInspector,U8 as Cesium3DTilesInspectorViewModel,RTe as Cesium3DTilesVoxelProvider,Cs as Cesium3DTileset,p3 as Cesium3DTilesetBaseTraversal,u3 as Cesium3DTilesetCache,XT as Cesium3DTilesetGraphics,d3 as Cesium3DTilesetHeatmap,aA as Cesium3DTilesetMetadata,m3 as Cesium3DTilesetMostDetailedTraversal,_3 as Cesium3DTilesetSkipTraversal,Z_ as Cesium3DTilesetStatistics,oa as Cesium3DTilesetTraversal,x3 as Cesium3DTilesetVisualizer,M8 as CesiumInspector,R8 as CesiumInspectorViewModel,cS as CesiumTerrainProvider,IH as CesiumWidget,xo as Check,sD as CheckerboardMaterialProperty,QH as CircleEmitter,jbe as CircleGeometry,qbe as CircleOutlineGeometry,CB as ClassificationModelDrawCommand,D2 as ClassificationPipelineStage,mv as ClassificationPrimitive,kn as ClassificationType,ei as ClearCommand,gC as ClippingPlane,bs as ClippingPlaneCollection,dw as ClippingPolygon,Zh as ClippingPolygonCollection,um as Clock,Kr as ClockRange,_o as ClockStep,E8 as ClockViewModel,kTe as CloudCollection,AP as CloudType,z as Color,Fc as ColorBlendMode,Wt as ColorGeometryInstanceAttribute,zt as ColorMaterialProperty,UCe as Command,X as ComponentDatatype,SN as Composite3DTileContent,ele as CompositeEntityCollection,uD as CompositeMaterialProperty,Sa as CompositePositionProperty,zc as CompositeProperty,V1 as CompressedTextureBuffer,al as ComputeCommand,k1 as ComputeEngine,YH as ConditionsExpression,VTe as ConeEmitter,gl as ConstantPositionProperty,Yn as ConstantProperty,YF as ConstantSpline,ZB as ContentMetadata,kM as Context,Bt as ContextLimits,dk as CoplanarPolygonGeometry,j_ as CoplanarPolygonGeometryLibrary,Ld as CoplanarPolygonOutlineGeometry,Ni as CornerType,DF as CorrelationGroup,gA as CorridorGeometry,Hi as CorridorGeometryLibrary,I3 as CorridorGeometryUpdater,GT as CorridorGraphics,D3 as CorridorOutlineGeometry,At as Credit,wz as CreditDisplay,wr as CubeMap,J1 as CubeMapFace,_T as CubicRealPolynomial,xi as CullFace,ys as CullingVolume,nd as CumulusCloud,M3 as CustomDataSource,Ybe as CustomHeightmapTerrainProvider,$E as CustomShader,F_ as CustomShaderMode,k2 as CustomShaderPipelineStage,Tx as CustomShaderTranslucencyMode,L3 as CylinderGeometry,yA as CylinderGeometryLibrary,F3 as CylinderGeometryUpdater,WT as CylinderGraphics,N3 as CylinderOutlineGeometry,Y3 as CzmlDataSource,Xr as DataSource,fm as DataSourceClock,K3 as DataSourceCollection,Bk as DataSourceDisplay,UTe as DebugAppearance,mg as DebugCameraPrimitive,H4 as DebugInspector,t8 as DebugModelMatrixPrimitive,Kbe as DefaultProxy,vc as DepthFunction,Oz as DepthPlane,V2 as DequantizationPipelineStage,pg as DerivedCommand,he as DeveloperError,Lz as DeviceOrientationCameraController,zTe as DirectionalLight,AI as DiscardEmptyTileImagePolicy,TU as DiscardMissingTileImagePolicy,Lt as DistanceDisplayCondition,Bn as DistanceDisplayConditionGeometryInstanceAttribute,KE as DoubleEndedPriorityQueue,l3 as DoublyLinkedList,d_ as DracoLoader,$e as DrawCommand,E_ as DynamicAtmosphereLightingType,S_ as DynamicEnvironmentMapManager,RA as DynamicGeometryBatch,ni as DynamicGeometryUpdater,C1 as EarthOrientationParameters,A0 as EarthOrientationParametersSample,$r as EasingFunction,wl as EllipseGeometry,pu as EllipseGeometryLibrary,ok as EllipseGeometryUpdater,jT as EllipseGraphics,kf as EllipseOutlineGeometry,ee as Ellipsoid,Xg as EllipsoidGeodesic,ca as EllipsoidGeometry,rk as EllipsoidGeometryUpdater,qT as EllipsoidGraphics,Df as EllipsoidOutlineGeometry,cz as EllipsoidPrimitive,Ya as EllipsoidRhumbLine,HTe as EllipsoidSurfaceAppearance,ns as EllipsoidTangentPlane,dg as EllipsoidTerrainProvider,iy as EllipsoidalOccluder,Yw as Empty3DTileContent,Hn as EncodedCartesian3,or as Entity,Mf as EntityCluster,ra as EntityCollection,Uk as EntityView,me as Event,_r as EventHelper,yd as Expression,pt as ExpressionNodeType,Lf as ExtrapolationType,Ht as FeatureDetection,bx as FeatureIdPipelineStage,Nz as Fog,Pe as ForEach,o8 as FrameRateMonitor,Fz as FrameState,zr as Framebuffer,hi as FramebufferManager,Gz as FrustumCommands,LE as FrustumGeometry,Iz as FrustumOutlineGeometry,Sr as Fullscreen,q8 as FullscreenButton,W8 as FullscreenButtonViewModel,jk as GeoJsonDataSource,zF as GeoJsonLoader,Bb as GeocodeType,K8 as Geocoder,yP as GeocoderService,Y8 as GeocoderViewModel,Ii as GeographicProjection,Xi as GeographicTilingScheme,at as Geometry,MN as Geometry3DTileContent,ve as GeometryAttribute,hn as GeometryAttributes,$be as GeometryFactory,wt as GeometryInstance,wc as GeometryInstanceAttribute,sn as GeometryOffsetAttribute,Nn as GeometryPipeline,H2 as GeometryPipelineStage,ld as GeometryType,ii as GeometryUpdater,YA as GeometryUpdaterSet,wk as GeometryVisualizer,vE as GetFeatureInfoFormat,iz as Globe,Wz as GlobeDepth,xU as GlobeSurfaceShaderSet,oh as GlobeSurfaceTile,qU as GlobeSurfaceTileProvider,YU as GlobeTranslucency,jz as GlobeTranslucencyFramebuffer,Bz as GlobeTranslucencyState,Yv as GltfBufferViewLoader,Xv as GltfDracoLoader,PF as GltfGpmLoader,yw as GltfGpmLocal,Kv as GltfImageLoader,Zv as GltfIndexBufferLoader,Qv as GltfJsonLoader,I_ as GltfLoader,ou as GltfLoaderUtil,LF as GltfMeshPrimitiveGpmLoader,CF as GltfStructuralMetadataLoader,nw as GltfTextureLoader,iw as GltfVertexBufferLoader,WTe as GoogleEarthEnterpriseImageryProvider,IU as GoogleEarthEnterpriseMapsProvider,l0 as GoogleEarthEnterpriseMetadata,xP as GoogleEarthEnterpriseTerrainData,sTe as GoogleEarthEnterpriseTerrainProvider,NH as GoogleEarthEnterpriseTileInformation,cTe as GoogleGeocoderService,fS as GoogleMaps,tV as GpxDataSource,Rg as GregorianDate,jTe as GridImageryProvider,bD as GridMaterialProperty,Gn as GroundGeometryUpdater,VT as GroundPolylineGeometry,Lh as GroundPolylinePrimitive,pl as GroundPrimitive,$w as GroupMetadata,Kd as HeadingPitchRange,Ha as HeadingPitchRoll,_1 as Heap,Ye as HeightReference,nh as HeightmapEncoding,ac as HeightmapTerrainData,bI as HeightmapTessellator,k3 as HermitePolynomialApproximation,_x as HermiteSpline,Gv as HilbertOrder,Q8 as HomeButton,Z8 as HomeButtonViewModel,yi as HorizontalOrigin,cAe as I3SBuildingSceneLayerExplorer,eG as I3SBuildingSceneLayerExplorerViewModel,Ym as I3SDataProvider,r8 as I3SDecoder,s8 as I3SFeature,c8 as I3SField,vP as I3SGeometry,bS as I3SLayer,wP as I3SNode,h8 as I3SStatistics,m8 as I3SSublayer,f8 as I3SSymbology,qF as I3dmLoader,GF as I3dmParser,JTe as ITwinData,td as ITwinPlatform,rz as Iau2000Orientation,S1 as Iau2006XysData,fT as Iau2006XysSample,sz as IauOrientationAxes,oz as IauOrientationParameters,tC as ImageBasedLighting,a2 as ImageBasedLightingPipelineStage,X0 as ImageMaterialProperty,DI as Imagery,lc as ImageryLayer,KU as ImageryLayerCollection,Om as ImageryLayerFeatureInfo,Ll as ImageryProvider,si as ImageryState,cw as Implicit3DTileContent,Wv as ImplicitAvailabilityBitstream,jv as ImplicitMetadataView,os as ImplicitSubdivisionScheme,dC as ImplicitSubtree,XH as ImplicitSubtreeCache,BN as ImplicitSubtreeMetadata,uA as ImplicitTileCoordinates,lA as ImplicitTileset,Ne as IndexDatatype,iG as InfoBox,tG as InfoBoxViewModel,gc as InspectorShared,rs as InstanceAttributeSemantic,C2 as InstancingPipelineStage,lTe as InterpolationAlgorithm,$h as InterpolationType,jt as Intersect,Zn as IntersectionTests,a0 as Intersections2D,Wa as Interval,jI as InvertClassification,Hh as Ion,f0 as IonGeocodeProviderType,dS as IonGeocoderService,Gy as IonImageryProvider,af as IonResource,Wy as IonWorldImageryStyle,He as Iso8601,Vz as JobScheduler,Za as JobType,v_ as JsonMetadataTable,Z as JulianDate,U1 as KTX2Transcoder,pa as KeyboardEventModifier,eo as KeyframeNode,nV as KmlCamera,uU as KmlDataSource,QV as KmlLookAt,eU as KmlTour,nU as KmlTourFlyTo,iU as KmlTourWait,Dx as Label,Np as LabelCollection,Fh as LabelGraphics,Xo as LabelStyle,Dk as LabelVisualizer,V3 as LagrangePolynomialApproximation,qi as LeapSecond,tCe as Light,Op as LightingModel,W2 as LightingPipelineStage,CA as LinearApproximation,gx as LinearSpline,yl as ManagedArray,Du as MapMode2D,fTe as MapProjection,PU as MapboxImageryProvider,iCe as MapboxStyleImageryProvider,Yi as Material,so as MaterialAppearance,q2 as MaterialPipelineStage,ir as MaterialProperty,P as Math,Pi as Matrix2,$ as Matrix3,F as Matrix4,rP as Megatexture,MF as MeshPrimitiveGpmLocal,Xh as MetadataClass,Tp as MetadataClassProperty,Vt as MetadataComponentType,Fn as MetadataEntity,sF as MetadataEnum,oF as MetadataEnumValue,zz as MetadataPicking,pf as MetadataPickingPipelineStage,Ed as MetadataPipelineStage,df as MetadataSchema,rw as MetadataSchemaLoader,hC as MetadataSemantic,nu as MetadataTable,VN as MetadataTableProperty,lt as MetadataType,sp as MipmapHint,tm as Model,gf as Model3DTileContent,uB as ModelAlphaOptions,$F as ModelAnimation,ZF as ModelAnimationChannel,JF as ModelAnimationCollection,su as ModelAnimationLoop,Jh as ModelAnimationState,u2 as ModelArticulation,c2 as ModelArticulationStage,h2 as ModelClippingPlanesPipelineStage,g2 as ModelClippingPolygonsPipelineStage,xx as ModelColorPipelineStage,bn as ModelComponents,EB as ModelDrawCommand,wB as ModelDrawCommands,e2 as ModelFeature,t2 as ModelFeatureTable,$g as ModelGraphics,bB as ModelLightingOptions,A2 as ModelMatrixUpdateStage,_2 as ModelNode,fB as ModelRenderResources,S2 as ModelRuntimeNode,cB as ModelRuntimePrimitive,IB as ModelSceneGraph,pB as ModelSilhouettePipelineStage,lB as ModelSkin,yB as ModelSplitterPipelineStage,PB as ModelStatistics,gr as ModelType,Kt as ModelUtility,Pk as ModelVisualizer,fz as Moon,X2 as MorphTargetsPipelineStage,dTe as MorphWeightSpline,Fx as MortonOrder,JB as Multiple3DTileContent,VM as MultisampleFramebuffer,sG as NavigationHelpButton,oG as NavigationHelpButtonViewModel,kt as NearFarScalar,oCe as NeverTileDiscardPolicy,xB as NodeRenderResources,E2 as NodeStatisticsPipelineStage,YT as NodeTransformationProperty,qz as OIT,pz as Occluder,Qi as OffsetGeometryInstanceAttribute,hTe as OpenCageGeocoderService,g0 as OpenStreetMapImageryProvider,$3 as OrderedGroundPrimitiveCollection,wn as OrientedBoundingBox,rn as OrthographicFrustum,Hr as OrthographicOffCenterFrustum,mTe as Packable,pTe as PackableForInterpolation,IP as Particle,aCe as ParticleBurst,lCe as ParticleEmitter,dCe as ParticleSystem,we as Pass,Cc as PassState,Qg as PathGraphics,Rk as PathVisualizer,VH as PeliasGeocoderService,cn as PerInstanceColorAppearance,$y as PerformanceDisplay,lG as PerformanceWatchdog,aG as PerformanceWatchdogViewModel,Di as PerspectiveFrustum,Fl as PerspectiveOffCenterFrustum,Hz as PickDepth,Yz as PickDepthFramebuffer,Xz as PickFramebuffer,_H as PickedMetadataInfo,o4 as Picking,K2 as PickingPipelineStage,Cy as PinBuilder,Ke as PixelDatatype,tt as PixelFormat,an as Plane,ck as PlaneGeometry,fk as PlaneGeometryUpdater,yN as PlaneGraphics,uk as PlaneOutlineGeometry,OB as PntsLoader,UC as PntsParser,DH as PointCloud,P_ as PointCloudEyeDomeLighting,vp as PointCloudShading,$2 as PointCloudStylingPipelineStage,KT as PointGraphics,zs as PointPrimitive,gD as PointPrimitiveCollection,Ok as PointVisualizer,A_ as PolygonGeometry,Un as PolygonGeometryLibrary,pk as PolygonGeometryUpdater,Bh as PolygonGraphics,Xa as PolygonHierarchy,mk as PolygonOutlineGeometry,ri as PolygonPipeline,vd as Polyline,TD as PolylineArrowMaterialProperty,rm as PolylineCollection,is as PolylineColorAppearance,CD as PolylineDashMaterialProperty,Ty as PolylineGeometry,Lk as PolylineGeometryUpdater,AD as PolylineGlowMaterialProperty,Ic as PolylineGraphics,Ta as PolylineMaterialAppearance,zx as PolylineOutlineMaterialProperty,Li as PolylinePipeline,Fk as PolylineVisualizer,gk as PolylineVolumeGeometry,cm as PolylineVolumeGeometryLibrary,yk as PolylineVolumeGeometryUpdater,ZT as PolylineVolumeGraphics,_k as PolylineVolumeOutlineGeometry,Nh as PositionProperty,ry as PositionPropertyArray,ho as PostProcessStage,E4 as PostProcessStageCollection,Pu as PostProcessStageComposite,Kf as PostProcessStageLibrary,Xf as PostProcessStageSampleMode,GE as PostProcessStageTextureCache,OF as PpeMetadata,MCe as PpeSource,RF as PpeTexture,In as Primitive,mu as PrimitiveCollection,SC as PrimitiveLoadPlan,EC as PrimitiveOutlineGenerator,eB as PrimitiveOutlinePipelineStage,NT as PrimitivePipeline,TB as PrimitiveRenderResources,Ir as PrimitiveState,tB as PrimitiveStatisticsPipelineStage,Me as PrimitiveType,hG as ProjectionPicker,fG as ProjectionPickerViewModel,q as Property,ED as PropertyArray,CC as PropertyAttribute,xF as PropertyAttributeProperty,Zl as PropertyBag,Tl as PropertyTable,w_ as PropertyTexture,yF as PropertyTextureProperty,ds as ProviderViewModel,_Te as Proxy,ll as QuadraticRealPolynomial,ZU as QuadtreeOccluders,nz as QuadtreePrimitive,QU as QuadtreeTile,da as QuadtreeTileLoadState,hCe as QuadtreeTileProvider,aS as QuantizedMeshTerrainData,H1 as QuarticRealPolynomial,Oe as Quaternion,KF as QuaternionSpline,fx as Queue,pn as Ray,se as Rectangle,ZA as RectangleCollisionChecker,GA as RectangleGeometry,Us as RectangleGeometryLibrary,xk as RectangleGeometryUpdater,kh as RectangleGraphics,JC as RectangleOutlineGeometry,Ui as ReferenceFrame,ay as ReferenceProperty,Ve as RenderState,Qu as Renderbuffer,dl as RenderbufferFormat,nr as Request,Jm as RequestErrorEvent,bc as RequestScheduler,Kn as RequestState,ps as RequestType,Se as Resource,Ei as ResourceCache,ru as ResourceCacheKey,lF as ResourceCacheStatistics,Ki as ResourceLoader,gt as ResourceLoaderState,Vd as Rotation,re as RuntimeError,u_ as S2Cell,na as SDFSettings,va as SampledPositionProperty,Ff as SampledProperty,$t as Sampler,og as ScaledPositionProperty,TH as Scene,VE as SceneFramebuffer,ne as SceneMode,nB as SceneMode2DPipelineStage,_G as SceneModePicker,pG as SceneModePickerViewModel,zi as SceneTransforms,w4 as SceneTransitioner,k4 as ScreenSpaceCameraController,Zf as ScreenSpaceEventHandler,Tn as ScreenSpaceEventType,Cx as SelectedFeatureIdPipelineStage,TG as SelectionIndicator,xG as SelectionIndicatorViewModel,wD as SensorVolumePortionToDisplay,vT as ShaderBuilder,OM as ShaderCache,pe as ShaderDestination,zM as ShaderFunction,en as ShaderProgram,Ue as ShaderSource,UM as ShaderStruct,Jy as ShadowMap,yg as ShadowMapShader,xn as ShadowMode,of as ShadowVolumeAppearance,yn as ShowGeometryInstanceAttribute,F0 as Simon1994PlanetaryPositions,yTe as SimplePolylineGeometry,RU as SingleTileImageryProvider,oB as SkinningPipelineStage,CH as SkyAtmosphere,AH as SkyBox,fH as SpatialNode,IF as Spdcf,zh as SpecularEnvironmentCubeMap,mCe as SphereEmitter,xTe as SphereGeometry,Y_ as SphereOutlineGeometry,U3 as Spherical,no as Spline,Gr as SplitDirection,dP as Splitter,Wd as StaticGeometryColorBatch,qd as StaticGeometryPerMaterialBatch,UD as StaticGroundGeometryColorBatch,vk as StaticGroundGeometryPerMaterialBatch,Nk as StaticGroundPolylinePerMaterialBatch,zD as StaticOutlineGeometryBatch,Ut as StencilConstants,Vn as StencilFunction,dt as StencilOperation,XF as SteppedSpline,Nc as Stereographic,mx as StorageType,SD as StripeMaterialProperty,dm as StripeOrientation,ea as StructuralMetadata,em as StyleCommandsNeeded,pCe as StyleExpression,EH as Sun,Hg as SunLight,z4 as SunPostProcess,SF as SupportedImageFormats,A8 as SvgPathBindingHandler,_i as TaskProcessor,y8 as Terrain,Rm as TerrainData,Kc as TerrainEncoding,RI as TerrainFillMesh,ih as TerrainMesh,JT as TerrainOffsetProperty,ls as TerrainProvider,fa as TerrainQuantization,fo as TerrainState,Ot as Texture,Sx as TextureAtlas,LM as TextureCache,di as TextureMagnificationFilter,pH as TextureManager,Zt as TextureMinificationFilter,RCe as TextureUniform,An as TextureWrap,Wm as TileAvailability,Md as TileBoundingRegion,i3 as TileBoundingS2Cell,X_ as TileBoundingSphere,gCe as TileBoundingVolume,x8 as TileCoordinatesImageryProvider,_Ce as TileDiscardPolicy,gn as TileEdge,II as TileImagery,ub as TileMapServiceImageryProvider,$B as TileMetadata,If as TileOrientedBoundingBox,Io as TileProviderError,ez as TileReplacementQueue,qn as TileSelectionResult,yCe as TileState,LB as Tileset3DTileContent,a3 as TilesetMetadata,n2 as TilesetPipelineStage,bTe as TilingScheme,jn as TimeConstants,wE as TimeDynamicImagery,mP as TimeDynamicPointCloud,En as TimeInterval,Yr as TimeIntervalCollection,ly as TimeIntervalCollectionPositionProperty,uy as TimeIntervalCollectionProperty,Wn as TimeStandard,EG as Timeline,CG as TimelineHighlightRange,AG as TimelineTrack,j1 as Tipsify,jb as ToggleButtonViewModel,t0 as Tonemapper,Yg as TrackingReferenceFrame,Mt as Transforms,Z0 as TranslationRotationScale,Zz as TranslucentTileClassification,Cw as TridiagonalSystemSolver,LS as TrustedServers,jE as TweenCollection,BM as UniformState,cP as UniformType,cc as UrlTemplateImageryProvider,_lo as VERSION,DG as VRButton,vG as VRButtonViewModel,ATe as VRTheWorldTerrainProvider,OCe as VaryingType,_p as Vector3DTileBatch,YB as Vector3DTileClampedPolylines,KB as Vector3DTileContent,s_ as Vector3DTileGeometry,jB as Vector3DTilePoints,qB as Vector3DTilePolygons,YC as Vector3DTilePolylines,oC as Vector3DTilePrimitive,H3 as VelocityOrientationProperty,fy as VelocityVectorProperty,ti as VertexArray,Gg as VertexArrayFacade,Et as VertexAttributeSemantic,Ie as VertexFormat,Dr as VerticalExaggeration,sB as VerticalExaggerationPipelineStage,On as VerticalOrigin,ETe as VideoSynchronizer,zE as View,TAe as Viewer,xCe as ViewportQuad,br as Visibility,age as Visualizer,Cg as VoxelBoxShape,G4 as VoxelCell,ZH as VoxelContent,Ag as VoxelCylinderShape,XE as VoxelEllipsoidShape,RG as VoxelInspector,IG as VoxelInspectorViewModel,Rb as VoxelPrimitive,bCe as VoxelProvider,oH as VoxelRenderResources,TCe as VoxelShape,ki as VoxelShapeType,aP as VoxelTraversal,STe as VulkanConstants,Tk as WallGeometry,jA as WallGeometryLibrary,Ak as WallGeometryUpdater,Jg as WallGraphics,Ck as WallOutlineGeometry,te as WebGLConstants,MU as WebMapServiceImageryProvider,LU as WebMapTileServiceImageryProvider,Oi as WebMercatorProjection,us as WebMercatorTilingScheme,gs as WindingOrder,Dw as WireframeIndexGenerator,aB as WireframePipelineStage,r4 as _shadersAcesTonemappingStage,V4 as _shadersAdditiveBlend,QS as _shadersAdjustTranslucentFS,PL as _shadersAllMaterialAppearanceFS,RL as _shadersAllMaterialAppearanceVS,s4 as _shadersAmbientOcclusionGenerate,a4 as _shadersAmbientOcclusionModulate,FL as _shadersAspectRampMaterial,Ph as _shadersAtmosphereCommon,i2 as _shadersAtmosphereStageFS,o2 as _shadersAtmosphereStageVS,OL as _shadersBasicMaterialAppearanceFS,ML as _shadersBasicMaterialAppearanceVS,GM as _shadersBillboardCollectionFS,WM as _shadersBillboardCollectionVS,c4 as _shadersBlackAndWhite,l4 as _shadersBloomComposite,jM as _shadersBrdfLutGeneratorFS,U4 as _shadersBrightPass,u4 as _shadersBrightness,BL as _shadersBumpMapMaterial,P2 as _shadersCPUStylingStageFS,I2 as _shadersCPUStylingStageVS,kL as _shadersCheckerboardMaterial,qM as _shadersCloudCollectionFS,YM as _shadersCloudCollectionVS,XM as _shadersCloudNoiseFS,KM as _shadersCloudNoiseVS,ZM as _shadersCompareAndPackTranslucentDepth,$M as _shadersCompositeOITFS,UE as _shadersCompositeTranslucentClassification,QM as _shadersComputeIrradianceFS,JM as _shadersComputeRadianceMapFS,f4 as _shadersContrastBias,eL as _shadersConvolveSpecularMapFS,tL as _shadersConvolveSpecularMapVS,M2 as _shadersCustomShaderStageFS,O2 as _shadersCustomShaderStageVS,CT as _shadersCzmBuiltins,d4 as _shadersDepthOfField,nL as _shadersDepthPlaneFS,iL as _shadersDepthPlaneVS,h4 as _shadersDepthView,PCe as _shadersDepthViewPacked,VL as _shadersDotMaterial,m4 as _shadersEdgeDetection,UL as _shadersElevationBandMaterial,zL as _shadersElevationContourMaterial,HL as _shadersElevationRampMaterial,JS as _shadersEllipsoidFS,n8 as _shadersEllipsoidSurfaceAppearanceFS,i8 as _shadersEllipsoidSurfaceAppearanceVS,ev as _shadersEllipsoidVS,_4 as _shadersFXAA,oL as _shadersFXAA3_11,GL as _shadersFadeMaterial,L2 as _shadersFeatureIdStageFS,N2 as _shadersFeatureIdStageVS,p4 as _shadersFilmicTonemapping,bb as _shadersGaussianBlur1D,U2 as _shadersGeometryStageFS,z2 as _shadersGeometryStageVS,rL as _shadersGlobeFS,sL as _shadersGlobeVS,WL as _shadersGridMaterial,tv as _shadersGroundAtmosphere,KR as _shadersHSBToRGB,ZR as _shadersHSLToRGB,s2 as _shadersImageBasedLightingStageFS,y2 as _shadersInstancingStageCommon,x2 as _shadersInstancingStageVS,Z4 as _shadersIntersectBox,K4 as _shadersIntersectClippingPlanes,$4 as _shadersIntersectCylinder,X4 as _shadersIntersectDepth,Q4 as _shadersIntersectEllipsoid,iP as _shadersIntersectLongitude,YE as _shadersIntersection,Y4 as _shadersIntersectionUtils,b2 as _shadersLegacyInstancingStageVS,y4 as _shadersLensFlare,G2 as _shadersLightingStageFS,j2 as _shadersMaterialStageFS,iH as _shadersMegatexture,F2 as _shadersMetadataStageFS,B2 as _shadersMetadataStageVS,d2 as _shadersModelClippingPlanesStageFS,p2 as _shadersModelClippingPolygonsStageFS,m2 as _shadersModelClippingPolygonsStageVS,f2 as _shadersModelColorStageFS,vB as _shadersModelFS,dB as _shadersModelSilhouetteStageFS,hB as _shadersModelSilhouetteStageVS,gB as _shadersModelSplitterStageFS,SB as _shadersModelVS,x4 as _shadersModifiedReinhardTonemapping,Y2 as _shadersMorphTargetsStageVS,b4 as _shadersNightVision,jL as _shadersNormalMapMaterial,nH as _shadersOctree,Iu as _shadersPassThrough,_b as _shadersPassThroughDepth,g4 as _shadersPbrNeutralTonemapping,tN as _shadersPerInstanceColorAppearanceFS,nN as _shadersPerInstanceColorAppearanceVS,OT as _shadersPerInstanceFlatColorAppearanceFS,iN as _shadersPerInstanceFlatColorAppearanceVS,BF as _shadersPointCloudEyeDomeLighting,Z2 as _shadersPointCloudStylingStageVS,k0 as _shadersPointPrimitiveCollectionFS,aL as _shadersPointPrimitiveCollectionVS,cL as _shadersPolygonSignedDistanceFS,qL as _shadersPolylineArrowMaterial,gN as _shadersPolylineColorAppearanceVS,Ju as _shadersPolylineCommon,YL as _shadersPolylineDashMaterial,wT as _shadersPolylineFS,XL as _shadersPolylineGlowMaterial,_N as _shadersPolylineMaterialAppearanceVS,KL as _shadersPolylineOutlineMaterial,lL as _shadersPolylineShadowVolumeFS,uL as _shadersPolylineShadowVolumeMorphFS,fL as _shadersPolylineShadowVolumeMorphVS,dL as _shadersPolylineShadowVolumeVS,hL as _shadersPolylineVS,J2 as _shadersPrimitiveOutlineStageFS,Q2 as _shadersPrimitiveOutlineStageVS,$R as _shadersRGBToHSB,QR as _shadersRGBToHSL,JR as _shadersRGBToXYZ,T4 as _shadersReinhardTonemapping,mL as _shadersReprojectWebMercatorFS,pL as _shadersReprojectWebMercatorVS,ZL as _shadersRimLightingMaterial,vw as _shadersSelectedFeatureIdStageCommon,nv as _shadersShadowVolumeAppearanceFS,gL as _shadersShadowVolumeAppearanceVS,V0 as _shadersShadowVolumeFS,C4 as _shadersSilhouette,iB as _shadersSkinningStageVS,iv as _shadersSkyAtmosphereCommon,_L as _shadersSkyAtmosphereFS,yL as _shadersSkyAtmosphereVS,xL as _shadersSkyBoxFS,bL as _shadersSkyBoxVS,$L as _shadersSlopeRampMaterial,QL as _shadersStripeMaterial,TL as _shadersSunFS,CL as _shadersSunTextureFS,AL as _shadersSunVS,LL as _shadersTexturedMaterialAppearanceFS,NL as _shadersTexturedMaterialAppearanceVS,EL as _shadersVector3DTileClampedPolylinesFS,SL as _shadersVector3DTileClampedPolylinesVS,vL as _shadersVector3DTilePolylinesVS,ov as _shadersVectorTileVS,rB as _shadersVerticalExaggerationStageVS,wL as _shadersViewportQuadFS,mT as _shadersViewportQuadVS,j4 as _shadersVoxelFS,W4 as _shadersVoxelUtils,q4 as _shadersVoxelVS,eN as _shadersWater,JL as _shadersWaterMaskMaterial,eO as _shadersXYZToRGB,tO as _shadersacesTonemapping,nO as _shadersalphaWeight,iO as _shadersantialias,oO as _shadersapplyHSBShift,rO as _shadersapproximateSphericalCoordinates,sO as _shadersapproximateTanh,aO as _shadersbackFacing,cO as _shadersbranchFreeTernary,lO as _shaderscascadeColor,uO as _shaderscascadeDistance,fO as _shaderscascadeMatrix,dO as _shaderscascadeWeights,hO as _shadersclipPolygons,mO as _shaderscolumbusViewMorph,pO as _shaderscomputeAtmosphereColor,gO as _shaderscomputeGroundAtmosphereScattering,_O as _shaderscomputePosition,yO as _shaderscomputeScattering,J4 as _shadersconvertUvToBox,eH as _shadersconvertUvToCylinder,tH as _shadersconvertUvToEllipsoid,xO as _shaderscosineAndSine,bO as _shadersdecompressTextureCoordinates,iR as _shadersdegreesPerRadian,TO as _shadersdepthClamp,oR as _shadersdepthRange,zR as _shadersdepthRangeStruct,CO as _shaderseastNorthUpToEyeCoordinates,AO as _shadersellipsoidContainsPoint,EO as _shadersellipsoidTextureCoordinates,rR as _shadersepsilon1,sR as _shadersepsilon2,aR as _shadersepsilon3,cR as _shadersepsilon4,lR as _shadersepsilon5,uR as _shadersepsilon6,fR as _shadersepsilon7,SO as _shadersequalsEpsilon,vO as _shaderseyeOffset,wO as _shaderseyeToWindowCoordinates,DO as _shadersfastApproximateAtan,IO as _shadersfog,PO as _shadersgammaCorrect,RO as _shadersgeodeticSurfaceNormal,OO as _shadersgetDefaultMaterial,MO as _shadersgetDynamicAtmosphereLightDirection,LO as _shadersgetLambertDiffuse,NO as _shadersgetSpecular,FO as _shadersgetWaterNoise,BO as _shadershue,dR as _shadersinfinity,kO as _shadersinverseGamma,VO as _shadersisEmpty,UO as _shadersisFull,zO as _shaderslatitudeToWebMercatorFraction,HO as _shaderslineDistance,GO as _shaderslinearToSrgb,WO as _shadersluminance,HR as _shadersmaterial,GR as _shadersmaterialInput,jO as _shadersmaximumComponent,qO as _shadersmetersPerPixel,WR as _shadersmodelMaterial,YO as _shadersmodelToWindowCoordinates,jR as _shadersmodelVertexOutput,XO as _shadersmultiplyWithColorBalance,KO as _shadersnearFarScalar,ZO as _shadersoctDecode,hR as _shadersoneOverPi,mR as _shadersoneOverTwoPi,$O as _shaderspackDepth,pR as _shaderspassCesium3DTile,gR as _shaderspassCesium3DTileClassification,_R as _shaderspassCesium3DTileClassificationIgnoreShow,yR as _shaderspassClassification,xR as _shaderspassCompute,bR as _shaderspassEnvironment,TR as _shaderspassGlobe,CR as _shaderspassOpaque,AR as _shaderspassOverlay,ER as _shaderspassTerrainClassification,SR as _shaderspassTranslucent,vR as _shaderspassVoxels,QO as _shaderspbrLighting,JO as _shaderspbrNeutralTonemapping,eM as _shadersphong,wR as _shaderspi,DR as _shaderspiOverFour,IR as _shaderspiOverSix,PR as _shaderspiOverThree,RR as _shaderspiOverTwo,tM as _shadersplaneDistance,nM as _shaderspointAlongRay,OR as _shadersradiansPerDegree,qR as _shadersray,iM as _shadersrayEllipsoidIntersectionInterval,YR as _shadersraySegment,oM as _shadersraySphereIntersectionInterval,rM as _shadersreadDepth,sM as _shadersreadNonPerspective,aM as _shadersreverseLogDepth,cM as _shadersround,lM as _shaderssaturation,MR as _shaderssceneMode2D,LR as _shaderssceneMode3D,NR as _shaderssceneModeColumbusView,FR as _shaderssceneModeMorphing,uM as _shadersshadowDepthCompare,XR as _shadersshadowParameters,fM as _shadersshadowVisibility,dM as _shaderssignNotZero,BR as _shaderssolarRadius,hM as _shaderssphericalHarmonics,mM as _shaderssrgbToLinear,pM as _shaderstangentToEyeSpaceMatrix,gM as _shaderstextureCube,kR as _shadersthreePiOver2,_M as _shaderstransformPlane,yM as _shaderstranslateRelativeToEye,xM as _shaderstranslucentPhong,bM as _shaderstranspose,VR as _shaderstwoPi,TM as _shadersunpackClippingExtents,CM as _shadersunpackDepth,AM as _shadersunpackFloat,EM as _shadersunpackUint,SM as _shadersvalueTransform,vM as _shadersvertexLogDepth,UR as _shaderswebMercatorMaxLatitude,wM as _shaderswindowToEyeCoordinates,DM as _shaderswriteDepthClamp,IM as _shaderswriteLogDepth,PM as _shaderswriteNonPerspective,ZN as addBuffer,UN as addDefaults,YN as addExtensionsRequired,bd as addExtensionsUsed,sx as addPipelineExtras,Fs as addToArray,h1 as appendForwardSlash,bo as arrayRemoveDuplicates,gT as barycentricCoordinates,Oo as binarySearch,nn as buildModuleUrl,aH as buildVoxelDrawCommands,Ge as clone,bt as combine,yE as computeFlyToLocationForRectangle,HC as createBillboardPointCallback,Sn as createCommand,B8 as createDefaultImageryProviderViewModels,k8 as createDefaultTerrainProviderViewModels,SCe as createElevationBandMaterial,wCe as createGooglePhotorealistic3DTileset,zn as createGuid,Lo as createMaterialPropertyDescriptor,DCe as createOsmBuildingsAsync,le as createPropertyDescriptor,_l as createRawPropertyDescriptor,ICe as createTangentSpaceDebugPrimitive,LCe as createTaskProcessorWorker,L1 as createUniform,N1 as createUniformArray,WH as createWorldBathymetryAsync,jy as createWorldImageryAsync,pS as createWorldTerrainAsync,jH as decodeGoogleEarthEnterpriseData,XB as decodeVectorPolylinePositions,y as defaultValue,Gl as defer,l as defined,RM as demodernizeShader,_s as deprecationWarning,ue as destroyObject,_ge as exportKml,lC as findAccessorMinMax,KC as findContentMetadata,ZC as findGroupMetadata,QB as findTileMetadata,$v as forEachTextureInMaterial,ug as formatError,X$ as freezeRenderState,Qm as getAbsoluteUri,iu as getAccessorByteStride,m1 as getBaseUri,lf as getBinaryAccessor,SH as getClipAndStyleCode,Uy as getClippingFunction,p_ as getComponentReader,Rn as getElement,oT as getExtensionFromUri,oy as getFilenameFromUri,hH as getImageFromTypedArray,bh as getImagePixels,Fo as getJsonFromTypedArray,Wh as getMagic,gH as getMetadataClassProperty,yH as getMetadataProperty,Jl as getStringFromTypedArray,Ci as getTimestamp,oi as hasExtension,e_ as heightReferenceOnEntityPropertyChanged,el as isBitSet,rT as isBlobUri,E0 as isCrossOriginUrl,Mg as isDataUri,xh as isLeapYear,be as knockout,ES as knockout_3_5_1,C8 as knockout_es5,sT as loadAndExecuteScript,HM as loadCubeMap,aC as loadImageFromTypedArray,Wl as loadKTX2,Yy as mergeSort,qN as moveTechniqueRenderStates,XN as moveTechniquesToExtension,ff as numberOfComponentsForType,aT as objectToQuery,xt as oneTimeWarning,R_ as parseBatchTable,TF as parseFeatureMetadataLegacy,GN as parseGlb,g1 as parseResponseHeaders,bF as parseStructuralMetadata,Rw as pickModel,vTe as pointInsideTriangle,Hp as preprocess3DTileContent,sH as processVoxelProperties,Yu as queryToObject,$N as readAccessorPacked,uC as removeExtension,HN as removeExtensionsRequired,cC as removeExtensionsUsed,jN as removePipelineExtras,KN as removeUnusedElements,cx as resizeImageToNextPowerOfTwo,hU as sampleTerrain,_E as sampleTerrainMostDetailed,eT as scaleToGeodeticSurface,gS as srgbToLinear,aN as subdivideArray,Oa as subscribeAndEvaluate,JN as updateAccessorComponentTypes,tF as updateVersion,mr as usesExtension,CAe as viewerCesium3DTilesInspectorMixin,AAe as viewerCesiumInspectorMixin,SAe as viewerDragDropMixin,vAe as viewerPerformanceWatchdogMixin,DAe as viewerVoxelInspectorMixin,wTe as webGLConstantToGlslType,qH as wrapFunction,WC as writeTextToCanvas}; +`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};sd.prototype.isDestroyed=function(){return!1};sd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),ue(this)};var RG=sd;function OG(e,t){e=Rn(e);let n=document.createElement("div"),i=new RG(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=_c.createSection,a=_c.createCheckbox,c=_c.createRangeInput,u=_c.createButton,f=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),_=s(r,"Clipping","clippingVisible","toggleClipping"),m=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let x=10,b=10,T=P.PI;h.appendChild(c("Translation X","translationX",-x,+x)),h.appendChild(c("Translation Y","translationY",-x,+x)),h.appendChild(c("Translation Z","translationZ",-x,+x)),h.appendChild(c("Scale X","scaleX",0,+b)),h.appendChild(c("Scale Y","scaleY",0,+b)),h.appendChild(c("Scale Z","scaleZ",0,+b)),h.appendChild(c("Heading","angleX",-T,+T)),h.appendChild(c("Pitch","angleY",-T,+T)),h.appendChild(c("Roll","angleZ",-T,+T));let C=Vi.getMinBounds(Vi.BOX),A=Vi.getMaxBounds(Vi.BOX),S=d.fromElements(Vi.getMinBounds(Vi.ELLIPSOID).x,Vi.getMinBounds(Vi.ELLIPSOID).y,-ee.WGS84.maximumRadius,new d),v=d.fromElements(Vi.getMaxBounds(Vi.ELLIPSOID).x,Vi.getMaxBounds(Vi.ELLIPSOID).y,1e7,new d),D=Vi.getMinBounds(Vi.CYLINDER),O=Vi.getMaxBounds(Vi.CYLINDER);PS("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",C,A,"shapeIsBox",p),PS("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",S,v,"shapeIsEllipsoid",p),PS("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",D,O,"shapeIsCylinder",p),PS("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",C,A,"shapeIsBox",_),PS("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",S,v,"shapeIsEllipsoid",_),PS("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",D,O,"shapeIsCylinder",_);let R=document.createElement("div");m.appendChild(R);let M=document.createElement("textarea");M.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),R.className="cesium-cesiumInspector-styleEditor",R.appendChild(M);let L=u("Compile (Ctrl+Enter)","compileShader");R.appendChild(L);let g=document.createElement("label");g.style.display="block",g.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),R.appendChild(g),Te.applyBindings(i,n)}Object.defineProperties(OG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OG.prototype.isDestroyed=function(){return!1};OG.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function PS(e,t,n,i,o,r,s,a,c,u,f,h,p,_,m,x){let b=_c.createRangeInput,T=p,C=_,A=x.appendChild(document.createElement("div"));A.setAttribute("data-bind",`if: ${m}`),A.appendChild(b(e,s,T.x,C.x)),A.appendChild(b(t,a,T.x,C.x)),A.appendChild(b(n,c,T.y,C.y)),A.appendChild(b(i,u,T.y,C.y)),A.appendChild(b(o,f,T.z,C.z)),A.appendChild(b(r,h,T.z,C.z))}var MG=OG;function qEt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new MG(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var PAe=qEt;globalThis.CESIUM_VERSION="1.125";var Elo="1.125";export{Sp as AlphaMode,e2 as AlphaPipelineStage,eF as AnchorPointDirect,tF as AnchorPointIndirect,R8 as Animation,O8 as AnimationViewModel,no as Appearance,ui as ApproximateTerrainHeights,Mbe as ArcGISTiledElevationTerrainProvider,Lm as ArcGisBaseMapType,Hy as ArcGisMapServerImageryProvider,jf as ArcGisMapService,Jt as ArcType,kc as ArticulationStageType,St as AssociativeArray,TC as Atmosphere,MF as AtmospherePipelineStage,Ln as AttributeCompression,tn as AttributeType,d4 as AutoExposure,Pg as AutomaticUniforms,Fo as Axis,z0 as AxisAlignedBoundingBox,hF as B3dmLoader,dF as B3dmParser,N8 as BaseLayerPicker,M8 as BaseLayerPickerViewModel,MT as BatchTable,iC as BatchTableHierarchy,Tl as BatchTexture,t2 as BatchTexturePipelineStage,lo as Billboard,Cf as BillboardCollection,Sc as BillboardGraphics,YM as BillboardVisualizer,Nbe as BingMapsGeocoderService,oU as BingMapsImageryProvider,TI as BingMapsStyle,Ya as BlendEquation,vo as BlendFunction,Io as BlendOption,ln as BlendingState,qe as BoundingRectangle,ae as BoundingSphere,at as BoundingSphereState,mC as BoundingVolumeSemantics,PTe as BoxEmitter,qa as BoxGeometry,GL as BoxGeometryUpdater,zT as BoxGraphics,Rh as BoxOutlineGeometry,ez as BrdfLutGenerator,_t as Buffer,sC as BufferLoader,Fe as BufferUsage,r2 as CPUStylingPipelineStage,WL as CallbackPositionProperty,kh as CallbackProperty,so as Camera,_4 as CameraEventAggregator,ki as CameraEventType,tz as CameraFlightPath,U as Cartesian2,d as Cartesian3,oe as Cartesian4,fe as Cartographic,Fbe as CartographicGeocoderService,kbe as CatmullRomSpline,nC as Cesium3DContentGroup,Nd as Cesium3DTile,o_ as Cesium3DTileBatchTable,tu as Cesium3DTileColorBlendMode,RTe as Cesium3DTileContent,XC as Cesium3DTileContentFactory,Ko as Cesium3DTileContentState,ks as Cesium3DTileContentType,Js as Cesium3DTileFeature,Qh as Cesium3DTileFeatureTable,Od as Cesium3DTileOptimizationHint,HB as Cesium3DTileOptimizations,Uo as Cesium3DTilePass,ch as Cesium3DTilePassState,H_ as Cesium3DTilePointFeature,Yo as Cesium3DTileRefine,TS as Cesium3DTileStyle,YB as Cesium3DTileStyleEngine,W8 as Cesium3DTilesInspector,H8 as Cesium3DTilesInspectorViewModel,MTe as Cesium3DTilesVoxelProvider,Cs as Cesium3DTileset,KB as Cesium3DTilesetBaseTraversal,WB as Cesium3DTilesetCache,XT as Cesium3DTilesetGraphics,qB as Cesium3DTilesetHeatmap,aA as Cesium3DTilesetMetadata,XB as Cesium3DTilesetMostDetailedTraversal,$B as Cesium3DTilesetSkipTraversal,$_ as Cesium3DTilesetStatistics,sa as Cesium3DTilesetTraversal,JB as Cesium3DTilesetVisualizer,U8 as CesiumInspector,k8 as CesiumInspectorViewModel,fS as CesiumTerrainProvider,SH as CesiumWidget,xo as Check,rD as CheckerboardMaterialProperty,JH as CircleEmitter,Ybe as CircleGeometry,Xbe as CircleOutlineGeometry,Z2 as ClassificationModelDrawCommand,n2 as ClassificationPipelineStage,fv as ClassificationPrimitive,kn as ClassificationType,ti as ClearCommand,gC as ClippingPlane,bs as ClippingPlaneCollection,fw as ClippingPolygon,Kh as ClippingPolygonCollection,um as Clock,Kr as ClockRange,_o as ClockStep,v8 as ClockViewModel,UTe as CloudCollection,wP as CloudType,z as Color,Bc as ColorBlendMode,Gt as ColorGeometryInstanceAttribute,Ut as ColorMaterialProperty,HCe as Command,X as ComponentDatatype,KL as Composite3DTileContent,tle as CompositeEntityCollection,lD as CompositeMaterialProperty,va as CompositePositionProperty,Hc as CompositeProperty,G1 as CompressedTextureBuffer,cl as ComputeCommand,H1 as ComputeEngine,XH as ConditionsExpression,zTe as ConeEmitter,_l as ConstantPositionProperty,Xn as ConstantProperty,TF as ConstantSpline,PB as ContentMetadata,HM as Context,Ft as ContextLimits,Y3 as CoplanarPolygonGeometry,q_ as CoplanarPolygonGeometryLibrary,Ld as CoplanarPolygonOutlineGeometry,Fi as CornerType,nF as CorrelationGroup,gA as CorridorGeometry,Hi as CorridorGeometryLibrary,l3 as CorridorGeometryUpdater,GT as CorridorGraphics,c3 as CorridorOutlineGeometry,Ct as Credit,fz as CreditDisplay,wr as CubeMap,iR as CubeMapFace,_T as CubicRealPolynomial,bi as CullFace,ys as CullingVolume,nd as CumulusCloud,m3 as CustomDataSource,Kbe as CustomHeightmapTerrainProvider,eS as CustomShader,B_ as CustomShaderMode,d2 as CustomShaderPipelineStage,bx as CustomShaderTranslucencyMode,p3 as CylinderGeometry,yA as CylinderGeometryLibrary,_3 as CylinderGeometryUpdater,WT as CylinderGraphics,g3 as CylinderOutlineGeometry,D3 as CzmlDataSource,Xr as DataSource,fm as DataSourceClock,P3 as DataSourceCollection,yk as DataSourceDisplay,HTe as DebugAppearance,pg as DebugCameraPrimitive,R4 as DebugInspector,n8 as DebugModelMatrixPrimitive,$be as DefaultProxy,wc as DepthFunction,yz as DepthPlane,h2 as DequantizationPipelineStage,gg as DerivedCommand,he as DeveloperError,bz as DeviceOrientationCameraController,GTe as DirectionalLight,AI as DiscardEmptyTileImagePolicy,nU as DiscardMissingTileImagePolicy,Mt as DistanceDisplayCondition,Bn as DistanceDisplayConditionGeometryInstanceAttribute,QE as DoubleEndedPriorityQueue,GB as DoublyLinkedList,h_ as DracoLoader,$e as DrawCommand,S_ as DynamicAtmosphereLightingType,v_ as DynamicEnvironmentMapManager,RA as DynamicGeometryBatch,ii as DynamicGeometryUpdater,v1 as EarthOrientationParameters,A0 as EarthOrientationParametersSample,$r as EasingFunction,Il as EllipseGeometry,gu as EllipseGeometryLibrary,V3 as EllipseGeometryUpdater,jT as EllipseGraphics,Vf as EllipseOutlineGeometry,ee as Ellipsoid,Kg as EllipsoidGeodesic,ua as EllipsoidGeometry,U3 as EllipsoidGeometryUpdater,qT as EllipsoidGraphics,If as EllipsoidOutlineGeometry,jU as EllipsoidPrimitive,Xa as EllipsoidRhumbLine,WTe as EllipsoidSurfaceAppearance,ns as EllipsoidTangentPlane,hg as EllipsoidTerrainProvider,oy as EllipsoidalOccluder,qw as Empty3DTileContent,Hn as EncodedCartesian3,or as Entity,Lf as EntityCluster,aa as EntityCollection,Tk as EntityView,pe as Event,_r as EventHelper,yd as Expression,mt as ExpressionNodeType,Nf as ExtrapolationType,zt as FeatureDetection,xx as FeatureIdPipelineStage,Tz as Fog,Pe as ForEach,r8 as FrameRateMonitor,Cz as FrameState,zr as Framebuffer,mi as FramebufferManager,Iz as FrustumCommands,BE as FrustumGeometry,hz as FrustumOutlineGeometry,Sr as Fullscreen,X8 as FullscreenButton,q8 as FullscreenButtonViewModel,oE as GeoJsonDataSource,pF as GeoJsonLoader,Bb as GeocodeType,$8 as Geocoder,CP as GeocoderService,K8 as GeocoderViewModel,Pi as GeographicProjection,Xi as GeographicTilingScheme,st as Geometry,iN as Geometry3DTileContent,ve as GeometryAttribute,dn as GeometryAttributes,Jbe as GeometryFactory,vt as GeometryInstance,Dc as GeometryInstanceAttribute,rn as GeometryOffsetAttribute,Nn as GeometryPipeline,g2 as GeometryPipelineStage,ld as GeometryType,oi as GeometryUpdater,YA as GeometryUpdaterSet,ck as GeometryVisualizer,IE as GetFeatureInfoFormat,UU as Globe,Pz as GlobeDepth,eU as GlobeSurfaceShaderSet,oh as GlobeSurfaceTile,IU as GlobeSurfaceTileProvider,PU as GlobeTranslucency,Rz as GlobeTranslucencyFramebuffer,Az as GlobeTranslucencyState,jv as GltfBufferViewLoader,qv as GltfDracoLoader,oF as GltfGpmLoader,_w as GltfGpmLocal,Yv as GltfImageLoader,Xv as GltfIndexBufferLoader,Zv as GltfJsonLoader,P_ as GltfLoader,ru as GltfLoaderUtil,cF as GltfMeshPrimitiveGpmLoader,ZN as GltfStructuralMetadataLoader,ew as GltfTextureLoader,tw as GltfVertexBufferLoader,qTe as GoogleEarthEnterpriseImageryProvider,uU as GoogleEarthEnterpriseMapsProvider,l0 as GoogleEarthEnterpriseMetadata,AP as GoogleEarthEnterpriseTerrainData,cTe as GoogleEarthEnterpriseTerrainProvider,FH as GoogleEarthEnterpriseTileInformation,uTe as GoogleGeocoderService,mS as GoogleMaps,Nk as GpxDataSource,Og as GregorianDate,YTe as GridImageryProvider,xD as GridMaterialProperty,Gn as GroundGeometryUpdater,kT as GroundPolylineGeometry,Mh as GroundPolylinePrimitive,gl as GroundPrimitive,Zw as GroupMetadata,Kd as HeadingPitchRange,Ga as HeadingPitchRoll,T1 as Heap,Ye as HeightReference,nh as HeightmapEncoding,cc as HeightmapTerrainData,xI as HeightmapTessellator,x3 as HermitePolynomialApproximation,gx as HermiteSpline,zv as HilbertOrder,eG as HomeButton,Q8 as HomeButtonViewModel,xi as HorizontalOrigin,uAe as I3SBuildingSceneLayerExplorer,nG as I3SBuildingSceneLayerExplorerViewModel,Xm as I3SDataProvider,s8 as I3SDecoder,a8 as I3SFeature,l8 as I3SField,PP as I3SGeometry,AS as I3SLayer,RP as I3SNode,m8 as I3SStatistics,p8 as I3SSublayer,d8 as I3SSymbology,bF as I3dmLoader,_F as I3dmParser,tCe as ITwinData,Ma as ITwinPlatform,HU as Iau2000Orientation,I1 as Iau2006XysData,fT as Iau2006XysSample,GU as IauOrientationAxes,zU as IauOrientationParameters,tC as ImageBasedLighting,NF as ImageBasedLightingPipelineStage,Y0 as ImageMaterialProperty,DI as Imagery,uc as ImageryLayer,OU as ImageryLayerCollection,Mm as ImageryLayerFeatureInfo,Fl as ImageryProvider,ai as ImageryState,sw as Implicit3DTileContent,Hv as ImplicitAvailabilityBitstream,Gv as ImplicitMetadataView,os as ImplicitSubdivisionScheme,dC as ImplicitSubtree,KH as ImplicitSubtreeCache,aN as ImplicitSubtreeMetadata,uA as ImplicitTileCoordinates,lA as ImplicitTileset,Ne as IndexDatatype,rG as InfoBox,iG as InfoBoxViewModel,_c as InspectorShared,rs as InstanceAttributeSemantic,ZF as InstancingPipelineStage,fTe as InterpolationAlgorithm,$h as InterpolationType,Wt as Intersect,Qn as IntersectionTests,a0 as Intersections2D,ja as Interval,YI as InvertClassification,zh as Ion,f0 as IonGeocodeProviderType,pS as IonGeocoderService,Gy as IonImageryProvider,cf as IonResource,Wy as IonWorldImageryStyle,He as Iso8601,Sz as JobScheduler,$a as JobType,w_ as JsonMetadataTable,Z as JulianDate,W1 as KTX2Transcoder,_a as KeyboardEventModifier,eo as KeyframeNode,Fk as KmlCamera,xE as KmlDataSource,OV as KmlLookAt,LV as KmlTour,FV as KmlTourFlyTo,BV as KmlTourWait,wx as Label,Fp as LabelCollection,Nh as LabelGraphics,Xo as LabelStyle,lk as LabelVisualizer,b3 as LagrangePolynomialApproximation,qi as LeapSecond,iCe as Light,Mp as LightingModel,y2 as LightingPipelineStage,CA as LinearApproximation,px as LinearSpline,bl as ManagedArray,Iu as MapMode2D,hTe as MapProjection,fU as MapboxImageryProvider,rCe as MapboxStyleImageryProvider,Yi as Material,ao as MaterialAppearance,b2 as MaterialPipelineStage,ir as MaterialProperty,P as Math,Ri as Matrix2,$ as Matrix3,F as Matrix4,cP as Megatexture,aF as MeshPrimitiveGpmLocal,Yh as MetadataClass,Cp as MetadataClassProperty,kt as MetadataComponentType,Fn as MetadataEntity,PN as MetadataEnum,DN as MetadataEnumValue,wz as MetadataPicking,gf as MetadataPickingPipelineStage,Ed as MetadataPipelineStage,hf as MetadataSchema,iw as MetadataSchemaLoader,hC as MetadataSemantic,iu as MetadataTable,lN as MetadataTableProperty,ct as MetadataType,ap as MipmapHint,tm as Model,_f as Model3DTileContent,k2 as ModelAlphaOptions,SF as ModelAnimation,EF as ModelAnimationChannel,wF as ModelAnimationCollection,au as ModelAnimationLoop,Jh as ModelAnimationState,kF as ModelArticulation,FF as ModelArticulationStage,zF as ModelClippingPlanesPipelineStage,WF as ModelClippingPolygonsPipelineStage,yx as ModelColorPipelineStage,bn as ModelComponents,Q2 as ModelDrawCommand,tB as ModelDrawCommands,DF as ModelFeature,IF as ModelFeatureTable,Qg as ModelGraphics,X2 as ModelLightingOptions,$F as ModelMatrixUpdateStage,jF as ModelNode,V2 as ModelRenderResources,JF as ModelRuntimeNode,F2 as ModelRuntimePrimitive,iB as ModelSceneGraph,G2 as ModelSilhouettePipelineStage,B2 as ModelSkin,q2 as ModelSplitterPipelineStage,oB as ModelStatistics,gr as ModelType,Xt as ModelUtility,fk as ModelVisualizer,XU as Moon,C2 as MorphTargetsPipelineStage,mTe as MorphWeightSpline,Nx as MortonOrder,MB as Multiple3DTileContent,GM as MultisampleFramebuffer,fG as NavigationHelpButton,lG as NavigationHelpButtonViewModel,Bt as NearFarScalar,sCe as NeverTileDiscardPolicy,Y2 as NodeRenderResources,QF as NodeStatisticsPipelineStage,YT as NodeTransformationProperty,Mz as OIT,QU as Occluder,Qi as OffsetGeometryInstanceAttribute,pTe as OpenCageGeocoderService,g0 as OpenStreetMapImageryProvider,O3 as OrderedGroundPrimitiveCollection,wn as OrientedBoundingBox,nn as OrthographicFrustum,Hr as OrthographicOffCenterFrustum,gTe as Packable,_Te as PackableForInterpolation,MP as Particle,lCe as ParticleBurst,fCe as ParticleEmitter,mCe as ParticleSystem,we as Pass,Ac as PassState,Jg as PathGraphics,dk as PathVisualizer,UH as PeliasGeocoderService,an as PerInstanceColorAppearance,$y as PerformanceDisplay,cG as PerformanceWatchdog,sG as PerformanceWatchdogViewModel,Ii as PerspectiveFrustum,kl as PerspectiveOffCenterFrustum,Dz as PickDepth,Lz as PickDepthFramebuffer,Nz as PickFramebuffer,sH as PickedMetadataInfo,qz as Picking,A2 as PickingPipelineStage,Ay as PinBuilder,Ke as PixelDatatype,tt as PixelFormat,sn as Plane,G3 as PlaneGeometry,q3 as PlaneGeometryUpdater,HL as PlaneGraphics,j3 as PlaneOutlineGeometry,sB as PntsLoader,UC as PntsParser,EH as PointCloud,R_ as PointCloudEyeDomeLighting,wp as PointCloudShading,S2 as PointCloudStylingPipelineStage,KT as PointGraphics,zs as PointPrimitive,pD as PointPrimitiveCollection,hk as PointVisualizer,E_ as PolygonGeometry,Un as PolygonGeometryLibrary,Z3 as PolygonGeometryUpdater,Fh as PolygonGraphics,Ka as PolygonHierarchy,K3 as PolygonOutlineGeometry,si as PolygonPipeline,vd as Polyline,bD as PolylineArrowMaterialProperty,rm as PolylineCollection,is as PolylineColorAppearance,TD as PolylineDashMaterialProperty,Cy as PolylineGeometry,pk as PolylineGeometryUpdater,CD as PolylineGlowMaterialProperty,Pc as PolylineGraphics,Ca as PolylineMaterialAppearance,zx as PolylineOutlineMaterialProperty,Ni as PolylinePipeline,_k as PolylineVisualizer,$3 as PolylineVolumeGeometry,cm as PolylineVolumeGeometryLibrary,J3 as PolylineVolumeGeometryUpdater,ZT as PolylineVolumeGraphics,Q3 as PolylineVolumeOutlineGeometry,Lh as PositionProperty,sy as PositionPropertyArray,mo as PostProcessStage,h4 as PostProcessStageCollection,Ru as PostProcessStageComposite,Zf as PostProcessStageLibrary,Kf as PostProcessStageSampleMode,qE as PostProcessStageTextureCache,sF as PpeMetadata,NCe as PpeSource,rF as PpeTexture,In as Primitive,pu as PrimitiveCollection,SC as PrimitiveLoadPlan,EC as PrimitiveOutlineGenerator,D2 as PrimitiveOutlinePipelineStage,LT as PrimitivePipeline,K2 as PrimitiveRenderResources,Ir as PrimitiveState,I2 as PrimitiveStatisticsPipelineStage,Me as PrimitiveType,pG as ProjectionPicker,hG as ProjectionPickerViewModel,q as Property,AD as PropertyArray,CC as PropertyAttribute,YN as PropertyAttributeProperty,xl as PropertyBag,Al as PropertyTable,D_ as PropertyTexture,qN as PropertyTextureProperty,ds as ProviderViewModel,xTe as Proxy,ul as QuadraticRealPolynomial,MU as QuadtreeOccluders,VU as QuadtreePrimitive,NU as QuadtreeTile,ma as QuadtreeTileLoadState,pCe as QuadtreeTileProvider,uS as QuantizedMeshTerrainData,q1 as QuarticRealPolynomial,Oe as Quaternion,AF as QuaternionSpline,ux as Queue,pn as Ray,se as Rectangle,ZA as RectangleCollisionChecker,GA as RectangleGeometry,Us as RectangleGeometryLibrary,ek as RectangleGeometryUpdater,Bh as RectangleGraphics,JC as RectangleOutlineGeometry,Ui as ReferenceFrame,cy as ReferenceProperty,Ve as RenderState,Ju as Renderbuffer,hl as RenderbufferFormat,nr as Request,ep as RequestErrorEvent,Tc as RequestScheduler,$n as RequestState,ps as RequestType,Se as Resource,vi as ResourceCache,su as ResourceCacheKey,MN as ResourceCacheStatistics,Ki as ResourceLoader,pt as ResourceLoaderState,Vd as Rotation,re as RuntimeError,f_ as S2Cell,oa as SDFSettings,wa as SampledPositionProperty,Bf as SampledProperty,Zt as Sampler,rg as ScaledPositionProperty,uH as Scene,HE as SceneFramebuffer,ne as SceneMode,P2 as SceneMode2DPipelineStage,xG as SceneModePicker,_G as SceneModePickerViewModel,zi as SceneTransforms,g4 as SceneTransitioner,w4 as ScreenSpaceCameraController,$f as ScreenSpaceEventHandler,Tn as ScreenSpaceEventType,Tx as SelectedFeatureIdPipelineStage,AG as SelectionIndicator,TG as SelectionIndicatorViewModel,vD as SensorVolumePortionToDisplay,vT as ShaderBuilder,FM as ShaderCache,ge as ShaderDestination,jM as ShaderFunction,Qt as ShaderProgram,Ue as ShaderSource,WM as ShaderStruct,Jy as ShadowMap,xg as ShadowMapShader,xn as ShadowMode,of as ShadowVolumeAppearance,yn as ShowGeometryInstanceAttribute,F0 as Simon1994PlanetaryPositions,bTe as SimplePolylineGeometry,dU as SingleTileImageryProvider,O2 as SkinningPipelineStage,hH as SkyAtmosphere,gH as SkyBox,eH as SpatialNode,iF as Spdcf,Uh as SpecularEnvironmentCubeMap,gCe as SphereEmitter,TTe as SphereGeometry,X_ as SphereOutlineGeometry,T3 as Spherical,io as Spline,Gr as SplitDirection,gP as Splitter,Wd as StaticGeometryColorBatch,qd as StaticGeometryPerMaterialBatch,VD as StaticGroundGeometryColorBatch,ak as StaticGroundGeometryPerMaterialBatch,gk as StaticGroundPolylinePerMaterialBatch,UD as StaticOutlineGeometryBatch,Vt as StencilConstants,Vn as StencilFunction,ut as StencilOperation,CF as SteppedSpline,Fc as Stereographic,hx as StorageType,ED as StripeMaterialProperty,dm as StripeOrientation,na as StructuralMetadata,em as StyleCommandsNeeded,_Ce as StyleExpression,bH as Sun,Gg as SunLight,P4 as SunPostProcess,JN as SupportedImageFormats,S8 as SvgPathBindingHandler,yi as TaskProcessor,b8 as Terrain,Om as TerrainData,Zc as TerrainEncoding,RI as TerrainFillMesh,ih as TerrainMesh,JT as TerrainOffsetProperty,ls as TerrainProvider,ha as TerrainQuantization,ho as TerrainState,Rt as Texture,Ex as TextureAtlas,kM as TextureCache,hi as TextureMagnificationFilter,oH as TextureManager,Kt as TextureMinificationFilter,MCe as TextureUniform,An as TextureWrap,jm as TileAvailability,Md as TileBoundingRegion,BB as TileBoundingS2Cell,K_ as TileBoundingSphere,yCe as TileBoundingVolume,T8 as TileCoordinatesImageryProvider,xCe as TileDiscardPolicy,gn as TileEdge,II as TileImagery,ub as TileMapServiceImageryProvider,RB as TileMetadata,Pf as TileOrientedBoundingBox,Po as TileProviderError,BU as TileReplacementQueue,Yn as TileSelectionResult,bCe as TileState,cB as Tileset3DTileContent,zB as TilesetMetadata,PF as TilesetPipelineStage,CTe as TilingScheme,qn as TimeConstants,PE as TimeDynamicImagery,yP as TimeDynamicPointCloud,En as TimeInterval,Yr as TimeIntervalCollection,uy as TimeIntervalCollectionPositionProperty,fy as TimeIntervalCollectionProperty,jn as TimeStandard,vG as Timeline,EG as TimelineHighlightRange,SG as TimelineTrack,K1 as Tipsify,jb as ToggleButtonViewModel,t0 as Tonemapper,Xg as TrackingReferenceFrame,Ot as Transforms,K0 as TranslationRotationScale,kz as TranslucentTileClassification,Tw as TridiagonalSystemSolver,BS as TrustedServers,XE as TweenCollection,zM as UniformState,fP as UniformType,lc as UrlTemplateImageryProvider,Elo as VERSION,PG as VRButton,DG as VRButtonViewModel,STe as VRTheWorldTerrainProvider,LCe as VaryingType,yp as Vector3DTileBatch,wB as Vector3DTileClampedPolylines,IB as Vector3DTileContent,a_ as Vector3DTileGeometry,CB as Vector3DTilePoints,AB as Vector3DTilePolygons,YC as Vector3DTilePolylines,oC as Vector3DTilePrimitive,A3 as VelocityOrientationProperty,dy as VelocityVectorProperty,ni as VertexArray,Wg as VertexArrayFacade,At as VertexAttributeSemantic,Ie as VertexFormat,Dr as VerticalExaggeration,L2 as VerticalExaggerationPipelineStage,On as VerticalOrigin,vTe as VideoSynchronizer,WE as View,AAe as Viewer,TCe as ViewportQuad,br as Visibility,lge as Visualizer,Ag as VoxelBoxShape,O4 as VoxelCell,$H as VoxelContent,Eg as VoxelCylinderShape,$E as VoxelEllipsoidShape,MG as VoxelInspector,RG as VoxelInspectorViewModel,Rb as VoxelPrimitive,CCe as VoxelProvider,Y4 as VoxelRenderResources,ACe as VoxelShape,Vi as VoxelShapeType,uP as VoxelTraversal,wTe as VulkanConstants,nk as WallGeometry,jA as WallGeometryLibrary,ok as WallGeometryUpdater,e_ as WallGraphics,ik as WallOutlineGeometry,te as WebGLConstants,mU as WebMapServiceImageryProvider,pU as WebMapTileServiceImageryProvider,Mi as WebMercatorProjection,us as WebMercatorTilingScheme,gs as WindingOrder,ww as WireframeIndexGenerator,N2 as WireframePipelineStage,Yz as _shadersAcesTonemappingStage,D4 as _shadersAdditiveBlend,XI as _shadersAdjustTranslucentFS,KM as _shadersAllMaterialAppearanceFS,ZM as _shadersAllMaterialAppearanceVS,Xz as _shadersAmbientOcclusionGenerate,Kz as _shadersAmbientOcclusionModulate,tL as _shadersAspectRampMaterial,Zh as _shadersAtmosphereCommon,RF as _shadersAtmosphereStageFS,OF as _shadersAtmosphereStageVS,$M as _shadersBasicMaterialAppearanceFS,QM as _shadersBasicMaterialAppearanceVS,lB as _shadersBillboardCollectionFS,uB as _shadersBillboardCollectionVS,Zz as _shadersBlackAndWhite,$z as _shadersBloomComposite,JU as _shadersBrdfLutGeneratorFS,I4 as _shadersBrightPass,Qz as _shadersBrightness,nL as _shadersBumpMapMaterial,o2 as _shadersCPUStylingStageFS,i2 as _shadersCPUStylingStageVS,iL as _shadersCheckerboardMaterial,vH as _shadersCloudCollectionFS,wH as _shadersCloudCollectionVS,DH as _shadersCloudNoiseFS,IH as _shadersCloudNoiseVS,Bz as _shadersCompareAndPackTranslucentDepth,Oz as _shadersCompositeOITFS,GE as _shadersCompositeTranslucentClassification,HN as _shadersComputeIrradianceFS,GN as _shadersComputeRadianceMapFS,Jz as _shadersContrastBias,WN as _shadersConvolveSpecularMapFS,jN as _shadersConvolveSpecularMapVS,a2 as _shadersCustomShaderStageFS,s2 as _shadersCustomShaderStageVS,CT as _shadersCzmBuiltins,e4 as _shadersDepthOfField,pz as _shadersDepthPlaneFS,gz as _shadersDepthPlaneVS,t4 as _shadersDepthView,OCe as _shadersDepthViewPacked,oL as _shadersDotMaterial,n4 as _shadersEdgeDetection,rL as _shadersElevationBandMaterial,sL as _shadersElevationContourMaterial,aL as _shadersElevationRampMaterial,NI as _shadersEllipsoidFS,i8 as _shadersEllipsoidSurfaceAppearanceFS,o8 as _shadersEllipsoidSurfaceAppearanceVS,FI as _shadersEllipsoidVS,r4 as _shadersFXAA,f4 as _shadersFXAA3_11,cL as _shadersFadeMaterial,c2 as _shadersFeatureIdStageFS,l2 as _shadersFeatureIdStageVS,i4 as _shadersFilmicTonemapping,bb as _shadersGaussianBlur1D,m2 as _shadersGeometryStageFS,p2 as _shadersGeometryStageVS,QV as _shadersGlobeFS,JV as _shadersGlobeVS,lL as _shadersGridMaterial,bI as _shadersGroundAtmosphere,JR as _shadersHSBToRGB,eO as _shadersHSLToRGB,LF as _shadersImageBasedLightingStageFS,qF as _shadersInstancingStageCommon,YF as _shadersInstancingStageVS,V4 as _shadersIntersectBox,k4 as _shadersIntersectClippingPlanes,U4 as _shadersIntersectCylinder,B4 as _shadersIntersectDepth,z4 as _shadersIntersectEllipsoid,sP as _shadersIntersectLongitude,ZE as _shadersIntersection,F4 as _shadersIntersectionUtils,XF as _shadersLegacyInstancingStageVS,s4 as _shadersLensFlare,_2 as _shadersLightingStageFS,x2 as _shadersMaterialStageFS,q4 as _shadersMegatexture,u2 as _shadersMetadataStageFS,f2 as _shadersMetadataStageVS,UF as _shadersModelClippingPlanesStageFS,GF as _shadersModelClippingPolygonsStageFS,HF as _shadersModelClippingPolygonsStageVS,VF as _shadersModelColorStageFS,eB as _shadersModelFS,U2 as _shadersModelSilhouetteStageFS,z2 as _shadersModelSilhouetteStageVS,W2 as _shadersModelSplitterStageFS,J2 as _shadersModelVS,a4 as _shadersModifiedReinhardTonemapping,T2 as _shadersMorphTargetsStageVS,c4 as _shadersNightVision,uL as _shadersNormalMapMaterial,j4 as _shadersOctree,Pu as _shadersPassThrough,_b as _shadersPassThroughDepth,o4 as _shadersPbrNeutralTonemapping,bL as _shadersPerInstanceColorAppearanceFS,TL as _shadersPerInstanceColorAppearanceVS,RT as _shadersPerInstanceFlatColorAppearanceFS,CL as _shadersPerInstanceFlatColorAppearanceVS,fF as _shadersPointCloudEyeDomeLighting,E2 as _shadersPointCloudStylingStageVS,kx as _shadersPointPrimitiveCollectionFS,d3 as _shadersPointPrimitiveCollectionVS,zN as _shadersPolygonSignedDistanceFS,fL as _shadersPolylineArrowMaterial,UL as _shadersPolylineColorAppearanceVS,rf as _shadersPolylineCommon,dL as _shadersPolylineDashMaterial,VT as _shadersPolylineFS,hL as _shadersPolylineGlowMaterial,zL as _shadersPolylineMaterialAppearanceVS,mL as _shadersPolylineOutlineMaterial,FL as _shadersPolylineShadowVolumeFS,BL as _shadersPolylineShadowVolumeMorphFS,kL as _shadersPolylineShadowVolumeMorphVS,VL as _shadersPolylineShadowVolumeVS,_B as _shadersPolylineVS,w2 as _shadersPrimitiveOutlineStageFS,v2 as _shadersPrimitiveOutlineStageVS,tO as _shadersRGBToHSB,nO as _shadersRGBToHSL,iO as _shadersRGBToXYZ,l4 as _shadersReinhardTonemapping,gU as _shadersReprojectWebMercatorFS,_U as _shadersReprojectWebMercatorVS,pL as _shadersRimLightingMaterial,Sw as _shadersSelectedFeatureIdStageCommon,uv as _shadersShadowVolumeAppearanceFS,vL as _shadersShadowVolumeAppearanceVS,H0 as _shadersShadowVolumeFS,u4 as _shadersSilhouette,R2 as _shadersSkinningStageVS,hP as _shadersSkyAtmosphereCommon,fH as _shadersSkyAtmosphereFS,dH as _shadersSkyAtmosphereVS,mH as _shadersSkyBoxFS,pH as _shadersSkyBoxVS,gL as _shadersSlopeRampMaterial,_L as _shadersStripeMaterial,_H as _shadersSunFS,yH as _shadersSunTextureFS,xH as _shadersSunVS,JM as _shadersTexturedMaterialAppearanceFS,eL as _shadersTexturedMaterialAppearanceVS,vB as _shadersVector3DTileClampedPolylinesFS,SB as _shadersVector3DTileClampedPolylinesVS,EB as _shadersVector3DTilePolylinesVS,Uv as _shadersVectorTileVS,M2 as _shadersVerticalExaggerationStageVS,PH as _shadersViewportQuadFS,mT as _shadersViewportQuadVS,L4 as _shadersVoxelFS,M4 as _shadersVoxelUtils,N4 as _shadersVoxelVS,xL as _shadersWater,yL as _shadersWaterMaskMaterial,oO as _shadersXYZToRGB,rO as _shadersacesTonemapping,sO as _shadersalphaWeight,aO as _shadersantialias,cO as _shadersapplyHSBShift,lO as _shadersapproximateSphericalCoordinates,uO as _shadersapproximateTanh,fO as _shadersbackFacing,dO as _shadersbranchFreeTernary,hO as _shaderscascadeColor,mO as _shaderscascadeDistance,pO as _shaderscascadeMatrix,gO as _shaderscascadeWeights,_O as _shadersclipPolygons,yO as _shaderscolumbusViewMorph,xO as _shaderscomputeAtmosphereColor,bO as _shaderscomputeGroundAtmosphereScattering,TO as _shaderscomputePosition,CO as _shaderscomputeScattering,H4 as _shadersconvertUvToBox,G4 as _shadersconvertUvToCylinder,W4 as _shadersconvertUvToEllipsoid,AO as _shaderscosineAndSine,EO as _shadersdecompressTextureCoordinates,aR as _shadersdegreesPerRadian,SO as _shadersdepthClamp,cR as _shadersdepthRange,jR as _shadersdepthRangeStruct,vO as _shaderseastNorthUpToEyeCoordinates,wO as _shadersellipsoidContainsPoint,DO as _shadersellipsoidTextureCoordinates,lR as _shadersepsilon1,uR as _shadersepsilon2,fR as _shadersepsilon3,dR as _shadersepsilon4,hR as _shadersepsilon5,mR as _shadersepsilon6,pR as _shadersepsilon7,IO as _shadersequalsEpsilon,PO as _shaderseyeOffset,RO as _shaderseyeToWindowCoordinates,OO as _shadersfastApproximateAtan,MO as _shadersfog,LO as _shadersgammaCorrect,NO as _shadersgeodeticSurfaceNormal,FO as _shadersgetDefaultMaterial,BO as _shadersgetDynamicAtmosphereLightDirection,kO as _shadersgetLambertDiffuse,VO as _shadersgetSpecular,UO as _shadersgetWaterNoise,zO as _shadershue,gR as _shadersinfinity,HO as _shadersinverseGamma,GO as _shadersisEmpty,WO as _shadersisFull,jO as _shaderslatitudeToWebMercatorFraction,qO as _shaderslineDistance,YO as _shaderslinearToSrgb,XO as _shadersluminance,qR as _shadersmaterial,YR as _shadersmaterialInput,KO as _shadersmaximumComponent,ZO as _shadersmetersPerPixel,XR as _shadersmodelMaterial,$O as _shadersmodelToWindowCoordinates,KR as _shadersmodelVertexOutput,QO as _shadersmultiplyWithColorBalance,JO as _shadersnearFarScalar,eM as _shadersoctDecode,_R as _shadersoneOverPi,yR as _shadersoneOverTwoPi,tM as _shaderspackDepth,xR as _shaderspassCesium3DTile,bR as _shaderspassCesium3DTileClassification,TR as _shaderspassCesium3DTileClassificationIgnoreShow,CR as _shaderspassClassification,AR as _shaderspassCompute,ER as _shaderspassEnvironment,SR as _shaderspassGlobe,vR as _shaderspassOpaque,wR as _shaderspassOverlay,DR as _shaderspassTerrainClassification,IR as _shaderspassTranslucent,PR as _shaderspassVoxels,nM as _shaderspbrLighting,iM as _shaderspbrNeutralTonemapping,oM as _shadersphong,RR as _shaderspi,OR as _shaderspiOverFour,MR as _shaderspiOverSix,LR as _shaderspiOverThree,NR as _shaderspiOverTwo,rM as _shadersplaneDistance,sM as _shaderspointAlongRay,FR as _shadersradiansPerDegree,ZR as _shadersray,aM as _shadersrayEllipsoidIntersectionInterval,$R as _shadersraySegment,cM as _shadersraySphereIntersectionInterval,lM as _shadersreadDepth,uM as _shadersreadNonPerspective,fM as _shadersreverseLogDepth,dM as _shadersround,hM as _shaderssaturation,BR as _shaderssceneMode2D,kR as _shaderssceneMode3D,VR as _shaderssceneModeColumbusView,UR as _shaderssceneModeMorphing,mM as _shadersshadowDepthCompare,QR as _shadersshadowParameters,pM as _shadersshadowVisibility,gM as _shaderssignNotZero,zR as _shaderssolarRadius,_M as _shaderssphericalHarmonics,yM as _shaderssrgbToLinear,xM as _shaderstangentToEyeSpaceMatrix,bM as _shaderstextureCube,HR as _shadersthreePiOver2,TM as _shaderstransformPlane,CM as _shaderstranslateRelativeToEye,AM as _shaderstranslucentPhong,EM as _shaderstranspose,GR as _shaderstwoPi,SM as _shadersunpackClippingExtents,vM as _shadersunpackDepth,wM as _shadersunpackFloat,DM as _shadersunpackUint,IM as _shadersvalueTransform,PM as _shadersvertexLogDepth,WR as _shaderswebMercatorMaxLatitude,RM as _shaderswindowToEyeCoordinates,OM as _shaderswriteDepthClamp,MM as _shaderswriteLogDepth,LM as _shaderswriteNonPerspective,bN as addBuffer,uN as addDefaults,_N as addExtensionsRequired,bd as addExtensionsUsed,rx as addPipelineExtras,Fs as addToArray,_1 as appendForwardSlash,bo as arrayRemoveDuplicates,gT as barycentricCoordinates,Mo as binarySearch,en as buildModuleUrl,Z4 as buildVoxelDrawCommands,Ge as clone,xt as combine,TE as computeFlyToLocationForRectangle,HC as createBillboardPointCallback,Sn as createCommand,F8 as createDefaultImageryProviderViewModels,B8 as createDefaultTerrainProviderViewModels,wCe as createElevationBandMaterial,ICe as createGooglePhotorealistic3DTileset,zn as createGuid,No as createMaterialPropertyDescriptor,PCe as createOsmBuildingsAsync,le as createPropertyDescriptor,yl as createRawPropertyDescriptor,RCe as createTangentSpaceDebugPrimitive,FCe as createTaskProcessorWorker,k1 as createUniform,V1 as createUniformArray,jH as createWorldBathymetryAsync,jy as createWorldImageryAsync,yS as createWorldTerrainAsync,qH as decodeGoogleEarthEnterpriseData,DB as decodeVectorPolylinePositions,y as defaultValue,jl as defer,l as defined,NM as demodernizeShader,_s as deprecationWarning,ue as destroyObject,xge as exportKml,lC as findAccessorMinMax,KC as findContentMetadata,ZC as findGroupMetadata,OB as findTileMetadata,Kv as forEachTextureInMaterial,fg as formatError,X$ as freezeRenderState,Jm as getAbsoluteUri,ou as getAccessorByteStride,y1 as getBaseUri,uf as getBinaryAccessor,TH as getClipAndStyleCode,Uy as getClippingFunction,g_ as getComponentReader,Rn as getElement,oT as getExtensionFromUri,ry as getFilenameFromUri,nH as getImageFromTypedArray,bh as getImagePixels,Bo as getJsonFromTypedArray,Gh as getMagic,rH as getMetadataClassProperty,aH as getMetadataProperty,eu as getStringFromTypedArray,Ai as getTimestamp,ri as hasExtension,t_ as heightReferenceOnEntityPropertyChanged,tl as isBitSet,rT as isBlobUri,E0 as isCrossOriginUrl,Lg as isDataUri,xh as isLeapYear,Te as knockout,wS as knockout_3_5_1,E8 as knockout_es5,sT as loadAndExecuteScript,qM as loadCubeMap,aC as loadImageFromTypedArray,ql as loadKTX2,Yy as mergeSort,gN as moveTechniqueRenderStates,yN as moveTechniquesToExtension,df as numberOfComponentsForType,aT as objectToQuery,yt as oneTimeWarning,O_ as parseBatchTable,KN as parseFeatureMetadataLegacy,hN as parseGlb,b1 as parseResponseHeaders,XN as parseStructuralMetadata,Pw as pickModel,DTe as pointInsideTriangle,Gp as preprocess3DTileContent,K4 as processVoxelProperties,Xu as queryToObject,TN as readAccessorPacked,uC as removeExtension,dN as removeExtensionsRequired,cC as removeExtensionsUsed,pN as removePipelineExtras,xN as removeUnusedElements,ax as resizeImageToNextPowerOfTwo,qV as sampleTerrain,bE as sampleTerrainMostDetailed,eT as scaleToGeodeticSurface,xS as srgbToLinear,wL as subdivideArray,La as subscribeAndEvaluate,AN as updateAccessorComponentTypes,SN as updateVersion,mr as usesExtension,EAe as viewerCesium3DTilesInspectorMixin,SAe as viewerCesiumInspectorMixin,wAe as viewerDragDropMixin,DAe as viewerPerformanceWatchdogMixin,PAe as viewerVoxelInspectorMixin,ITe as webGLConstantToGlslType,YH as wrapFunction,WC as writeTextToCanvas}; diff --git a/public/models/IDF.glb b/public/models/IDF.glb new file mode 100755 index 000000000..053a35bed Binary files /dev/null and b/public/models/IDF.glb differ diff --git a/src/App.vue b/src/App.vue index 7bdfb77fc..0c7498d5a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,7 @@ <script setup lang="ts"> import { RouterView } from 'vue-router' -import type { GlobalThemeOverrides } from 'naive-ui' +import { themeOverrides } from '@/styles/naiveConfig' + import { darkTheme, NMessageProvider, zhCN, dateZhCN } from 'naive-ui' import Message from '@/components/Message/index.vue' import Notification from '@/components/Notification/index.vue' @@ -8,23 +9,23 @@ import Notification from '@/components/Notification/index.vue' import { useEntity } from '@/hooks/entity' const { baseMap, mubiaoMap, satelliteMap } = useEntity() -const themeOverrides: GlobalThemeOverrides = { - common: { - primaryColor: '#48a8f5', - primaryColorPressed: '#3771e1', - fontSize: '16px', - }, - DataTable: { - thColor: '#257bb5', - tdColor: '#0000', - tdColorStriped: 'rgba(37,123,181,0.3)', - tdColorHover: 'rgba(37,123,181,0.6)', - thColorModal: '#257bb5', - tdColorModal: '#0000', - tdColorStripedModal: 'rgba(37,123,181,0.3)', - tdColorHoverModal: 'rgba(37,123,181,0.3)', - }, -} +// const themeOverrides: GlobalThemeOverrides = { +// common: { +// primaryColor: '#48a8f5', +// primaryColorPressed: '#3771e1', +// fontSize: '16px', +// }, +// DataTable: { +// thColor: '#257bb5', +// tdColor: '#0000', +// tdColorStriped: 'rgba(37,123,181,0.3)', +// tdColorHover: 'rgba(37,123,181,0.6)', +// thColorModal: '#257bb5', +// tdColorModal: '#0000', +// tdColorStripedModal: 'rgba(37,123,181,0.3)', +// tdColorHoverModal: 'rgba(37,123,181,0.3)', +// }, +// } </script> <template> @@ -39,7 +40,8 @@ const themeOverrides: GlobalThemeOverrides = { <n-message-provider> <message /> </n-message-provider> - <n-notification-provider placement="top" :max="10"> + <!-- container-class="w-full h-[200px]" --> + <n-notification-provider placement="bottom-left" :max="10"> <notification /> </n-notification-provider> <n-dialog-provider> <router-view /></n-dialog-provider> diff --git a/src/assets/naiveui.css b/src/assets/naiveui.css index c065e7d9c..d4b58fe0f 100644 --- a/src/assets/naiveui.css +++ b/src/assets/naiveui.css @@ -24,8 +24,14 @@ /* background: rgba(26, 34, 41, 0.8); */ background: rgba(0, 0, 0, 0.8); } -.n-message { +/* .n-notification-wrapper { + width: 200px; + height: 200px; } +.n-notification { + width: 100% !important; + height: 100%; +} */ .n-message-wrapper::before { border-radius: 5px; @@ -36,7 +42,7 @@ left: -2px; right: -2px; z-index: -1; - background: linear-gradient( + /* background: linear-gradient( 45deg, #f7c30b, #f49805, @@ -44,7 +50,8 @@ #ed0404, #f49805, #f7c30b - ); + ); */ + background: white; background-size: 300% 300%; animation: gradientAnimation 3s ease infinite alternate; @@ -86,3 +93,7 @@ .n-image-preview-toolbar { gap: 10px; } + +#textMsgContainer .n-alert { + height: 100%; +} diff --git a/src/components/Loading/Loading.ts b/src/components/Loading/Loading.ts new file mode 100644 index 000000000..40b5a1aff --- /dev/null +++ b/src/components/Loading/Loading.ts @@ -0,0 +1,52 @@ +import type { App, VNode } from 'vue' +import { createVNode, render, cloneVNode } from 'vue' +import Loading from './index.vue' + +export default { + install(app: App) { + // 使用vue底层的createVNode方法将组件渲染为虚拟节点 + const VNode: VNode = createVNode(Loading) + // 使用render函数将组件挂载到body中 + render(VNode, document.body) + // 定义全局方法设置组件的显示和隐藏 + app.config.globalProperties.$showLoading = + VNode.component?.exposed.showLoading + app.config.globalProperties.$hideLoading = + VNode.component?.exposed.hideLoading + + const weakMap = new WeakMap() + + // 自定义Loading指令 + app.directive('loading', { + mounted(el) { + if (weakMap.get(el)) { + return + } + // 记录当前绑定元素的position + weakMap.set(el, window.getComputedStyle(el).position) + }, + updated(el: HTMLElement, binding: { value: Boolean }) { + const oldPosition = weakMap.get(el) + // 如果不是position: relative或者absolute,就设置为relative + // 这里的目的是确保loading组件正确覆盖当前绑定的元素 + if (oldPosition !== 'absolute' && oldPosition !== 'relative') { + el.style.position = 'relative' + } + // 克隆一份loading元素, + // 作用是当页面上有多个zx-loading时,每个dom都维护一份属于自己的loading,不会冲突 + const newVNode = cloneVNode(VNode) + // 挂载当前节点 + render(newVNode, el) + // 判断绑定的值 + if (binding.value) { + newVNode.component?.exposed.showLoading() + } else { + newVNode.component?.exposed.hideLoading(() => { + // 还原布局方式 + el.style.position = oldPosition + }) + } + }, + }) + }, +} diff --git a/src/components/Loading/index.vue b/src/components/Loading/index.vue new file mode 100644 index 000000000..645876715 --- /dev/null +++ b/src/components/Loading/index.vue @@ -0,0 +1,169 @@ +<script setup> +let show = ref(false) + +const showLoading = () => { + show.value = true +} +const hideLoading = callback => { + show.value = false + callback && setTimeout(() => callback(), 500) +} + +defineExpose({ + show, + showLoading, + hideLoading, +}) +</script> + +<template> + <transition + enter-active-class="animate__animated animate__fadeIn" + leave-active-class="animate__animated animate__fadeOut" + > + <div class="root-box" v-if="show"> + <!-- <div class="flex w-full flex-col items-center justify-center gap-4"> + <div + class="flex h-10 w-10 animate-spin items-center justify-center rounded-full border-4 border-transparent border-t-blue-400 text-4xl text-blue-400" + > + <div + class="flex h-6 w-6 animate-spin items-center justify-center rounded-full border-4 border-transparent border-t-red-400 text-2xl text-red-400" + ></div> + </div> + </div> --> + <div class="three-body"> + <div class="three-body__dot"></div> + <div class="three-body__dot"></div> + <div class="three-body__dot"></div> + </div> + </div> + </transition> +</template> + +<style scoped lang="scss"> +.animate__animated.animate__fadeIn { + --animate-duration: 0.5s; +} + +.animate__animated.animate__fadeOut { + --animate-duration: 0.5s; +} + +.root-box { + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + margin: 0; + background-color: rgba(0, 0, 0, 0.2); + z-index: 2000; + display: flex; + justify-content: center; + align-items: center; + drop-filter: blur(10px); +} + +.three-body { + --uib-size: 35px; + --uib-speed: 0.8s; + --uib-color: #08ffff; + position: relative; + display: inline-block; + height: var(--uib-size); + width: var(--uib-size); + animation: spin78236 calc(var(--uib-speed) * 2.5) infinite linear; +} + +.three-body__dot { + position: absolute; + height: 100%; + width: 30%; +} + +.three-body__dot:after { + content: ''; + position: absolute; + height: 0%; + width: 100%; + padding-bottom: 100%; + background-color: var(--uib-color); + border-radius: 50%; +} + +.three-body__dot:nth-child(1) { + bottom: 5%; + left: 0; + transform: rotate(60deg); + transform-origin: 50% 85%; +} + +.three-body__dot:nth-child(1)::after { + bottom: 0; + left: 0; + animation: wobble1 var(--uib-speed) infinite ease-in-out; + animation-delay: calc(var(--uib-speed) * -0.3); +} + +.three-body__dot:nth-child(2) { + bottom: 5%; + right: 0; + transform: rotate(-60deg); + transform-origin: 50% 85%; +} + +.three-body__dot:nth-child(2)::after { + bottom: 0; + left: 0; + animation: wobble1 var(--uib-speed) infinite calc(var(--uib-speed) * -0.15) + ease-in-out; +} + +.three-body__dot:nth-child(3) { + bottom: -5%; + left: 0; + transform: translateX(116.666%); +} + +.three-body__dot:nth-child(3)::after { + top: 0; + left: 0; + animation: wobble2 var(--uib-speed) infinite ease-in-out; +} + +@keyframes spin78236 { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + +@keyframes wobble1 { + 0%, + 100% { + transform: translateY(0%) scale(1); + opacity: 1; + } + + 50% { + transform: translateY(-66%) scale(0.65); + opacity: 0.8; + } +} + +@keyframes wobble2 { + 0%, + 100% { + transform: translateY(0%) scale(1); + opacity: 1; + } + + 50% { + transform: translateY(66%) scale(0.65); + opacity: 0.8; + } +} +</style> diff --git a/src/hooks/entity.ts b/src/hooks/entity.ts index 9c5309d18..6e71de577 100644 --- a/src/hooks/entity.ts +++ b/src/hooks/entity.ts @@ -1,4 +1,4 @@ -// type TType = 'base' | 'mb' | 'satellite' +import { getMubiaoHisTraj } from '@/api/Mubiao' const baseMap = new Map() const mubiaoMap = new Map() @@ -8,5 +8,106 @@ export const useEntity = () => { baseMap, mubiaoMap, satelliteMap, + showEntity, + getHisTraj, + getMBEntityOpt, + changeIconOrModel, } } + +function showEntity(show: boolean) { + ;[...mubiaoMap.values()].forEach(entity => { + entity.show = show + }) +} + +async function getHisTraj({ + id, + timeRange, +}: { + id: string + timeRange: string[] +}) { + const [timeBegin, timeEnd] = timeRange + const { code, data: result } = await getMubiaoHisTraj({ + target_id: id, + timeBegin, + timeEnd, + }) + if (code !== '200') { + return + } + + const timeArray = result.map(item => { + return new Date(item.time).getTime() + }) + const posArray = result.map(item => item.position).flat(Infinity) + const points = result.reduce<TPoints>((acc, point, index, array) => { + const { time, position } = point + const cartesian3 = Cesium.Cartesian3.fromDegrees(...position) + if (index === 0) { + acc.push({ time: 0, position: cartesian3 }) + } else { + acc.push({ + time: + (new Date(time).getTime() - new Date(array[0].time).getTime()) / 1000, + position: cartesian3, + }) + } + return acc + }, []) + + return { points, posArray, timeArray } +} + +function getMBEntityOpt({ + id, + name, + targetType, +}: { + id: string + name?: string + targetType: string +}) { + const mubiaoDict = window.settings.mbDict[targetType] + + return { + label: { + text: `${id}`, + font: '12pt sans-serif', + fillColor: Cesium.Color.YELLOW, + outlineColor: Cesium.Color.BLACK, + outlineWidth: 2, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + pixelOffset: new Cesium.Cartesian2(20, -20), + pixelOffsetScaleByDistance: new Cesium.NearFarScalar( + 7000000, + 1.0, + 18000000, + 0.4 + ), + scaleByDistance: new Cesium.NearFarScalar(7000000, 1.0, 18000000, 0.4), + }, + billboard: { + show: true, + image: mubiaoDict.icon, + width: 30, + height: 30, + color: Cesium.Color.fromCssColorString(mubiaoDict.color), + scaleByDistance: new Cesium.NearFarScalar(7000000, 1.0, 18000000, 0.4), + }, + model: { + show: false, + uri: mubiaoDict.model, + scale: 1000, + minimumPixelSize: 50, + }, + } +} + +function changeIconOrModel() { + ;[...mubiaoMap.values()].forEach(entity => { + entity.model.show = !entity.model.show._value + entity.billboard.show = !entity.billboard.show._value + }) +} diff --git a/src/hooks/measure.ts b/src/hooks/measure.ts new file mode 100644 index 000000000..e23ddab48 --- /dev/null +++ b/src/hooks/measure.ts @@ -0,0 +1,415 @@ +let handler = null +let bMeasuring = false +const measureIds = [] +export const useMeasure = (viewer: any, target: string, terrain: any) => { + return { + distanceMeasure, + angleMeasure, + clearMeasure, + } +} + +function distanceMeasure() { + //贴地测量距离函数 + + // var terrainProvider = this.terrainProvider + viewer.scene.globe.depthTestAgainstTerrain = true + + handler = new Cesium.ScreenSpaceEventHandler( + viewer.scene._imageryLayerCollection + ) + let positions: any[] = [] + let poly: null = null + // var tooltip = document.getElementById("toolTip"); + let distance = 0 + let cartesian = null + let floatingPoint + // tooltip.style.display = "block"; + + handler.setInputAction(function (movement) { + // tooltip.style.left = movement.endPosition.x + 3 + "px"; + // tooltip.style.top = movement.endPosition.y - 25 + "px"; + // tooltip.innerHTML = '<p>单击开始,右击结束</p>'; + cartesian = viewer.scene.pickPosition(movement.endPosition) + if (!Cesium.defined(cartesian)) { + const ray = viewer.camera.getPickRay(movement.endPosition) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + const p = Cesium.Cartographic.fromCartesian(cartesian) + p.height = viewer.scene.sampleHeight(p) + cartesian = viewer.scene.globe.ellipsoid.cartographicToCartesian(p) + //cartesian = viewer.scene.camera.pickEllipsoid(movement.endPosition, viewer.scene.globe.ellipsoid); + if (positions.length >= 2) { + if (!Cesium.defined(poly)) { + poly = new PolyLinePrimitive(positions) + } else { + positions.pop() + // cartesian.y += (1 + Math.random()); + positions.push(cartesian) + } + // console.log("distance: " + distance); + // tooltip.innerHTML='<p>'+distance+'米</p>'; + } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) + + handler.setInputAction(function (movement) { + // tooltip.style.display = "none"; + // cartesian = viewer.scene.camera.pickEllipsoid(movement.position, viewer.scene.globe.ellipsoid); + cartesian = viewer.scene.pickPosition(movement.position) + if (!Cesium.defined(cartesian)) { + const ray = viewer.camera.getPickRay(movement.position) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + let p = Cesium.Cartographic.fromCartesian(cartesian) + p.height = viewer.scene.sampleHeight(p) + cartesian = viewer.scene.globe.ellipsoid.cartographicToCartesian(p) + if (positions.length == 0) { + positions.push(cartesian.clone()) + } + positions.push(cartesian) + getSpaceDistance(positions) + }, Cesium.ScreenSpaceEventType.LEFT_CLICK) + + handler.setInputAction(function (movement) { + handler.destroy() //关闭事件句柄 + positions.pop() //最后一个点无效 + // viewer.entities.remove(floatingPoint); + // tooltip.style.display = "none"; + bMeasuring = false + viewer._container.style.cursor = '' + }, Cesium.ScreenSpaceEventType.RIGHT_CLICK) + + const PolyLinePrimitive = (function () { + function _(positions) { + this.options = { + name: '直线', + polyline: { + show: true, + positions: [], + material: Cesium.Color.GOLD, + width: 2, + clampToGround: true, + }, + } + this.positions = positions + this._init() + } + + _.prototype._init = function () { + const _self = this + const _update = function () { + return _self.positions + } + //实时更新polyline.positions + this.options.polyline.positions = new Cesium.CallbackProperty( + _update, + false + ) + const et = viewer.entities.add(this.options) + measureIds.push(et.id) + } + + return _ + })() + + //空间两点距离计算函数 + function getSpaceDistance(positions) { + let distance_ = 0 + if (positions.length > 2) { + const positions_ = [] + const sp = Cesium.Cartographic.fromCartesian( + positions[positions.length - 3] + ) + const ep = Cesium.Cartographic.fromCartesian( + positions[positions.length - 2] + ) + const geodesic = new Cesium.EllipsoidGeodesic() + geodesic.setEndPoints(sp, ep) + const s = geodesic.surfaceDistance + positions_.push(sp) + let num = parseInt((s / 100).toFixed(0)) + num = num > 200 ? 200 : num + num = num < 20 ? 20 : num + for (let i = 1; i < num; i++) { + const res = geodesic.interpolateUsingSurfaceDistance( + (s / num) * i, + new Cesium.Cartographic() + ) + res.height = viewer.scene.sampleHeight(res) + positions_.push(res) + } + positions_.push(ep) + // var promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions_); + // Cesium.when(promise, function (updatedPositions) { + for (let ii = 0; ii < positions_.length - 1; ii++) { + geodesic.setEndPoints(positions_[ii], positions_[ii + 1]) + const d = geodesic.surfaceDistance + distance_ = + Math.sqrt( + Math.pow(d, 2) + + Math.pow(positions_[ii + 1].height - positions_[ii].height, 2) + ) + distance_ + } + //在三维场景中添加Label + const distance_add = parseFloat(distance_.toFixed(2)) + distance += distance_add + const textDistance = + (distance > 1000 + ? (distance / 1000).toFixed(3) + '千米' + : distance.toFixed(2) + '米') + + '\n(+' + + (distance_add > 1000 + ? (distance_add / 1000).toFixed(3) + '千米' + : distance_add + '米') + + ')' + + // var textDistance = distance + "米"; + // if (distance > 1000) { + // textDistance = (distance / 1000).toFixed(3) + "千米"; + // } + floatingPoint = viewer.entities.add({ + name: '空间直线距离', + position: positions[positions.length - 1], + point: { + pixelSize: 5, + color: Cesium.Color.RED, + outlineColor: Cesium.Color.WHITE, + outlineWidth: 2, + // disableDepthTestDistance: Number.POSITIVE_INFINITY + }, + label: { + text: textDistance, + font: '18px sans-serif', + fillColor: Cesium.Color.GOLD, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 2, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + disableDepthTestDistance: Number.POSITIVE_INFINITY, + pixelOffset: new Cesium.Cartesian2(20, -20), + // disableDepthTestDistance: Number.POSITIVE_INFINITY + }, + }) + measureIds.push(floatingPoint.id) + // }); + } + } +} + +function angleMeasure() { + const pArr = [] + let distanceLineNum = 0 + let Line1 + let Line2 + let angleT + let floatingPoint //浮动点 + handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas) + handler.setInputAction(function (movement) { + let cartesian = viewer.scene.pickPosition(movement.endPosition) + if (!Cesium.defined(cartesian)) { + const ray = viewer.camera.getPickRay(movement.endPosition) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + //cartesian = viewer.scene.camera.pickEllipsoid(movement.endPosition, viewer.scene.globe.ellipsoid); + if (distanceLineNum === 1) { + pArr.length = 1 + pArr.push(cartesian) + draw_Angle() + } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) + handler.setInputAction(function (movement) { + let cartesian = viewer.scene.pickPosition(movement.position) + if (!Cesium.defined(cartesian)) { + const ray = viewer.camera.getPickRay(movement.position) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + // var cartesian = viewer.scene.pickPosition(movement.position); + + distanceLineNum++ + if (distanceLineNum === 1) { + pArr.push(cartesian) + floatingPoint = viewer.entities.add({ + name: '方位角', + position: cartesian, + point: { + pixelSize: 3, + color: Cesium.Color.RED, + outlineColor: Cesium.Color.WHITE, + outlineWidth: 2, + heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, + }, + }) + measureIds.push(floatingPoint.id) + } else { + pArr.length = 1 + pArr.push(cartesian) + handler.destroy() + bMeasuring = false + viewer._container.style.cursor = '' + draw_Angle() + } + }, Cesium.ScreenSpaceEventType.LEFT_CLICK) + + handler.setInputAction(function (movement) { + handler.destroy() + bMeasuring = false + viewer._container.style.cursor = '' + }, Cesium.ScreenSpaceEventType.RIGHT_CLICK) + + function draw_Angle() { + // 空间 + const cartographic1 = Cesium.Cartographic.fromCartesian(pArr[0]) + const lon1 = Cesium.Math.toDegrees(cartographic1.longitude) + const lat1 = Cesium.Math.toDegrees(cartographic1.latitude) + const cartographic2 = Cesium.Cartographic.fromCartesian(pArr[1]) + const lon2 = Cesium.Math.toDegrees(cartographic2.longitude) + const lat2 = Cesium.Math.toDegrees(cartographic2.latitude) + const lineDistance = Cesium.Cartesian3.distance( + Cesium.Cartesian3.fromDegrees(lon1, lat1), + Cesium.Cartesian3.fromDegrees(lon2, lat2) + ) + const localToWorld_Matrix = Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(lon1, lat1) + ) + const NorthPoint = Cesium.Cartographic.fromCartesian( + Cesium.Matrix4.multiplyByPoint( + localToWorld_Matrix, + Cesium.Cartesian3.fromElements(0, lineDistance, 0), + new Cesium.Cartesian3() + ) + ) + const npLon = Cesium.Math.toDegrees(NorthPoint.longitude) + const npLat = Cesium.Math.toDegrees(NorthPoint.latitude) + // var angle = Cesium.Cartesian3.angleBetween(Cesium.Cartesian3.fromDegrees(lon1, lat1), + // Cesium.Cartesian3.fromDegrees(lon2, lat2)); + const angle = courseAngle(lon1, lat1, lon2, lat2) + let textDistance = lineDistance.toFixed(2) + '米' + if (lineDistance > 1000) { + textDistance = (lineDistance / 1000).toFixed(3) + '千米' + } + if (Cesium.defined(Line1)) { + //更新线 + Line1.polyline.positions = new Cesium.Cartesian3.fromDegreesArray([ + lon1, + lat1, + npLon, + npLat, + ]) + Line2.polyline.positions = new Cesium.Cartesian3.fromDegreesArray([ + lon1, + lat1, + lon2, + lat2, + ]) + angleT.label.text = '角度:' + angle + '°\n距离:' + textDistance + angleT.position = pArr[1] + return + } + //北方线 + Line1 = viewer.entities.add({ + name: 'Angle1', + polyline: { + positions: new Cesium.Cartesian3.fromDegreesArray([ + lon1, + lat1, + npLon, + npLat, + ]), + width: 3, + material: new Cesium.PolylineDashMaterialProperty({ + color: Cesium.Color.RED, + }), + clampToGround: true, + }, + }) + measureIds.push(Line1.id) + //线 + Line2 = viewer.entities.add({ + name: 'Angle2', + polyline: { + positions: new Cesium.Cartesian3.fromDegreesArray([ + lon1, + lat1, + lon2, + lat2, + ]), + width: 10, + material: new Cesium.PolylineArrowMaterialProperty(Cesium.Color.YELLOW), + clampToGround: true, + }, + }) + measureIds.push(Line2.id) + + //文字 + angleT = viewer.entities.add({ + name: 'AngleT', + position: pArr[1], + label: { + text: '角度:' + angle + '°\n距离:' + textDistance, + // scaleByDistance: new Cesium.NearFarScalar(7000000, 1.0, 18000000, 0.4), + // translucencyByDistance: new Cesium.NearFarScalar(1.5e2, 2.0, 1.5e5, 0), + font: '24px 楷体', + fillColor: Cesium.Color.WHITE, + outlineColor: Cesium.Color.BLACK, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 2, + scale: 0.5, + pixelOffset: new Cesium.Cartesian2(0, -20), + disableDepthTestDistance: Number.POSITIVE_INFINITY, + backgroundColor: new Cesium.Color.fromCssColorString( + 'rgba(0, 0, 0, 1)' + ), + backgroundPadding: new Cesium.Cartesian2(10, 10), + verticalOrigin: Cesium.VerticalOrigin.BASELINE, + }, + }) + measureIds.push(angleT.id) + } + + function courseAngle(lng_a, lat_a, lng_b, lat_b) { + /////////////方法 + let dRotateAngle = Math.atan2( + Math.abs(lng_a - lng_b), + Math.abs(lat_a - lat_b) + ) + if (lng_b >= lng_a) { + if (lat_b >= lat_a) { + } else { + dRotateAngle = Math.PI - dRotateAngle + } + } else { + if (lat_b >= lat_a) { + dRotateAngle = 2 * Math.PI - dRotateAngle + } else { + dRotateAngle = Math.PI + dRotateAngle + } + } + dRotateAngle = (dRotateAngle * 180) / Math.PI + return parseInt(dRotateAngle * 100) / 100 + + /////方法 + // //以a点为原点建立局部坐标系(东方向为x轴,北方向为y轴,垂直于地面为z轴),得到一个局部坐标到世界坐标转换的变换矩阵 + // var localToWorld_Matrix = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(lng_a, lat_a)); + // //求世界坐标到局部坐标的变换矩阵 + // var worldToLocal_Matrix = Cesium.Matrix4.inverse(localToWorld_Matrix, new Cesium.Matrix4()); + // //a点在局部坐标的位置,其实就是局部坐标原点 + // var localPosition_A = Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, new Cesium.Cartesian3.fromDegrees(lng_a, lat_a), new Cesium.Cartesian3()); + // //B点在以A点为原点的局部的坐标位置 + // var localPosition_B = Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, new Cesium.Cartesian3.fromDegrees(lng_b, lat_b), new Cesium.Cartesian3()); + // //弧度 + // var angle = Math.atan2((localPosition_B.y - localPosition_A.y), (localPosition_B.x - localPosition_A.x)) + // //角度 + // var theta = angle * (180 / Math.PI); + // if (theta < 0) { + // theta = theta + 360; + // } + // return theta.toFixed(2); + } +} + +function clearMeasure() { + for (let jj = 0; jj < measureIds.length; jj++) { + viewer.entities.removeById(measureIds[jj]) + } + measureIds.length = 0 + if (handler && !handler.isDestroyed()) handler = handler && handler.destroy() +} diff --git a/src/js/MeasureTool.js b/src/js/MeasureTool.js new file mode 100644 index 000000000..01de0e80f --- /dev/null +++ b/src/js/MeasureTool.js @@ -0,0 +1,1632 @@ +/* + * @class {MeasureTool} 测量工具 + * @param {viewer} viewer 三维视图 + * @param {target} string 测量工具放置的div的id + * @param {classname} string 样式名 + * @param {terrainProvider} terrain 地形 + * @param {show} bool 是否显示界面 + * */ + +class MeasureTool { + constructor(option) { + this.viewer = option.viewer + this.terrainProvider = option.terrainProvider + this.options = option + var me = this + if (option.show !== false) { + if (option.target) { + this.dom = document.getElementById(option.target) + this.dom.classList.add('measureTool') + if (option.classname) { + this.dom.classList.add(option.classname) + } + } else { + var div = document.createElement('div') + div.className = + 'measureTool measureTool_' + + (option.classname ? ' ' + option.classname : '') + document.body.appendChild(div) + this.dom = div + } + + //空间测量距离 + var btnDistance = document.createElement('div') + btnDistance.className = 'measureItem' + btnDistance.innerHTML = '空间距离' + btnDistance.onclick = function () { + this.classList.add('selItembox1') + me.btnclick('空间距离') + } + this.dom.appendChild(btnDistance) + + //地表测量距离 + var btnGroundDistance = document.createElement('div') + btnGroundDistance.className = 'measureItem' + btnGroundDistance.innerHTML = '地表距离' + btnGroundDistance.onclick = function () { + this.classList.add('selItembox1') + me.btnclick('地表距离') + } + this.dom.appendChild(btnGroundDistance) + + //地表测量面积 + var btnArea = document.createElement('div') + btnArea.className = 'measureItem' + btnArea.innerHTML = '地表面积' + btnArea.onclick = function () { + this.classList.add('selItembox1') + me.btnclick('地表面积') + } + this.dom.appendChild(btnArea) + + //高度差 + var btnAltitude = document.createElement('div') + btnAltitude.className = 'measureItem' + btnAltitude.innerHTML = '高度差' + btnAltitude.onclick = function () { + this.classList.add('selItembox1') + me.btnclick('高度差') + } + this.dom.appendChild(btnAltitude) + + //三角测量 + var btnTriangle = document.createElement('div') + btnTriangle.className = 'measureItem' + btnTriangle.innerHTML = '三角测量' + btnTriangle.onclick = function () { + this.classList.add('selItembox1') + me.btnclick('三角测量') + } + this.dom.appendChild(btnTriangle) + + //方位角 + var btnAngle = document.createElement('div') + btnAngle.className = 'measureItem' + btnAngle.innerHTML = '方位角' + btnAngle.onclick = function () { + this.classList.add('selItembox1') + me.btnclick('方位角') + } + this.dom.appendChild(btnAngle) + + //清除结果 + var btnClear = document.createElement('div') + btnClear.className = 'measureItem' + btnClear.innerHTML = '清除结果' + btnClear.onclick = function () { + me.btnclick('清除结果') + } + this.dom.appendChild(btnClear) + // + // //事件 + document.onclick = function (e) { + var len = document.querySelectorAll('.selItembox1').length + if ( + e.target.className !== '' && + e.target.className.indexOf('selItembox1') >= 0 && + len == 1 + ) { + return + } + if (len > 0) { + if (len > 1) { + var all = document.querySelectorAll('.selItembox1') + for (var a = 0; a < all.length; a++) { + if (all[a] !== e.target) { + all[a].classList.remove('selItembox1') + } + } + } else { + document + .querySelector('.selItembox1') + .classList.remove('selItembox1') + } + } + } + } + this.bMeasuring = false + me.viewer._container.style.cursor = '' + this.measureIds = [] + return { + name: '测量', + measureLineSpace: function () { + me.btnclick('空间距离') + }, + groundMeasureLineSpace: function () { + me.btnclick('地表距离') + }, + measureAreaSpace: function () { + me.btnclick('地表面积') + }, + altitude: function () { + me.btnclick('高度差') + }, + Triangle: function () { + me.btnclick('三角测量') + }, + measureAngle: function () { + me.btnclick('方位角') + }, + Clear: function () { + me.btnclick('清除结果') + }, + finishMeasure: function () { + me._finishMeasure() + }, + } + } + + //点击事件 + btnclick(type) { + var me = this + + if (type != '清除结果') { + if (me.bMeasuring) + if (me.handler && !me.handler.isDestroyed()) + me.handler = me.handler && me.handler.destroy() + // return; + } + switch (type) { + case '空间距离': + me.bMeasuring = true + me.viewer._container.style.cursor = 'crosshair' + me._measureLineSpace() + break + case '地表距离': + me.bMeasuring = true + me.viewer._container.style.cursor = 'crosshair' + me._groundMeasureLineSpace() + break + case '地表面积': + me.bMeasuring = true + me.viewer._container.style.cursor = 'crosshair' + me._measureAreaSpace() + + break + case '高度差': + me.bMeasuring = true + me.viewer._container.style.cursor = 'crosshair' + me._altitude() + break + case '三角测量': + me.bMeasuring = true + me.viewer._container.style.cursor = 'crosshair' + me._Triangle() + break + case '方位角': + me.bMeasuring = true + me.viewer._container.style.cursor = 'crosshair' + me._measureAngle() + break + case '清除结果': + //删除事先记录的id + for (var jj = 0; jj < me.measureIds.length; jj++) { + me.viewer.entities.removeById(me.measureIds[jj]) + } + me.measureIds.length = 0 + if (me.handler && !me.handler.isDestroyed()) + me.handler = me.handler && me.handler.destroy() + break + } + } + + _finishMeasure() { + var me = this + me.btnclick('清除结果') + me.bMeasuring = false + me.viewer._container.style.cursor = '' + document + .getElementsByClassName('measureTool')[0] + .parentNode.removeChild(document.getElementsByClassName('measureTool')[0]) + } + + //空间距离测量 + _measureLineSpace() { + var me = this + var viewer = this.viewer + me.handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas) + var positions = [] + var poly = null + var distance = 0 + var cartesian = null + var floatingPoint + //监听移动事件 + me.handler.setInputAction(function (movement) { + //移动结束位置 + cartesian = viewer.scene.pickPosition(movement.endPosition) + if (!Cesium.defined(cartesian)) { + var ray = viewer.camera.getPickRay(movement.endPosition) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + //判断点是否在画布上 + if (Cesium.defined(cartesian)) { + if (positions.length >= 2) { + if (!Cesium.defined(poly)) { + //画线 + poly = new PolyLinePrimitive(positions) + } else { + positions.pop() + // cartesian.y += (1 + Math.random()); + positions.push(cartesian) + } + } + } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) + //监听单击事件 + me.handler.setInputAction(function (movement) { + cartesian = viewer.scene.pickPosition(movement.position) + if (!Cesium.defined(cartesian)) { + var ray = viewer.camera.getPickRay(movement.position) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + + if (Cesium.defined(cartesian)) { + if (positions.length == 0) { + positions.push(cartesian.clone()) + } + positions.push(cartesian) + var distance_add = parseFloat(getSpaceDistance(positions)) + distance += distance_add + //在三维场景中添加Label + var textDisance = + (distance > 1000 + ? (distance / 1000).toFixed(3) + '千米' + : distance.toFixed(2) + '米') + + '\n(+' + + (distance_add > 1000 + ? (distance_add / 1000).toFixed(3) + '千米' + : distance_add + '米') + + ')' + // var textDisance = distance + "米"; + // if (distance > 1000) { + // textDisance = (parseFloat(distance) / 1000).toFixed(3) + "千米"; + // } + floatingPoint = viewer.entities.add({ + name: '空间直线距离', + position: positions[positions.length - 1], + point: { + pixelSize: 5, + color: Cesium.Color.RED, + outlineColor: Cesium.Color.WHITE, + outlineWidth: 2, + heightReference: Cesium.HeightReference.NONE, + }, + label: { + text: textDisance, + font: '18px sans-serif', + fillColor: Cesium.Color.CHARTREUSE, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 2, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + pixelOffset: new Cesium.Cartesian2(20, -20), + disableDepthTestDistance: Number.POSITIVE_INFINITY, + heightReference: Cesium.HeightReference.NONE, + }, + }) + me.measureIds.push(floatingPoint.id) + } + }, Cesium.ScreenSpaceEventType.LEFT_CLICK) + //监听双击事件 + me.handler.setInputAction(function (movement) { + me.handler.destroy() //关闭事件句柄 + positions.pop() //最后一个点无效 + me.bMeasuring = false + viewer._container.style.cursor = '' + }, Cesium.ScreenSpaceEventType.RIGHT_CLICK) + + //绘线效果1 + var PolyLinePrimitive = (function () { + function _(positions) { + this.options = { + name: '直线', + polyline: { + show: true, + positions: [], + arcType: Cesium.ArcType.NONE, + // material: new Cesium.PolylineOutlineMaterialProperty({ + // color: Cesium.Color.CHARTREUSE + // }), + material: Cesium.Color.CHARTREUSE, + // depthFailMaterial: new Cesium.PolylineOutlineMaterialProperty({ + // color: Cesium.Color.RED + // }), + width: 2, + }, + } + this.positions = positions + this._init() + } + _.prototype._init = function () { + var _self = this + var _update = function () { + return _self.positions + } + //实时更新polyline.positions + this.options.polyline.positions = new Cesium.CallbackProperty( + _update, + false + ) + var et = viewer.entities.add(this.options) + me.measureIds.push(et.id) + } + + return _ + })() + + //空间两点距离计算函数 + function getSpaceDistance(positions) { + var distance_ = 0 + if (positions.length > 2) { + var point1cartographic = Cesium.Cartographic.fromCartesian( + positions[positions.length - 3] + ) + var point2cartographic = Cesium.Cartographic.fromCartesian( + positions[positions.length - 2] + ) + /**根据经纬度计算出距离**/ + var geodesic = new Cesium.EllipsoidGeodesic() + geodesic.setEndPoints(point1cartographic, point2cartographic) + var s = geodesic.surfaceDistance + //console.log(Math.sqrt(Math.pow(distance_, 2) + Math.pow(endheight, 2))); + //返回两点之间的距离 + s = Math.sqrt( + Math.pow(s, 2) + + Math.pow(point2cartographic.height - point1cartographic.height, 2) + ) + distance_ = distance_ + s + } + return distance_.toFixed(2) + } + } + + //贴地测量距离函数 + _groundMeasureLineSpace() { + var me = this + var viewer = this.viewer + var terrainProvider = this.terrainProvider + viewer.scene.globe.depthTestAgainstTerrain = true + + me.handler = new Cesium.ScreenSpaceEventHandler( + viewer.scene._imageryLayerCollection + ) + var positions = [] + var poly = null + // var tooltip = document.getElementById("toolTip"); + var distance = 0 + var cartesian = null + var floatingPoint + // tooltip.style.display = "block"; + + me.handler.setInputAction(function (movement) { + // tooltip.style.left = movement.endPosition.x + 3 + "px"; + // tooltip.style.top = movement.endPosition.y - 25 + "px"; + // tooltip.innerHTML = '<p>单击开始,右击结束</p>'; + cartesian = viewer.scene.pickPosition(movement.endPosition) + if (!Cesium.defined(cartesian)) { + let ray = viewer.camera.getPickRay(movement.endPosition) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + let p = Cesium.Cartographic.fromCartesian(cartesian) + p.height = viewer.scene.sampleHeight(p) + cartesian = viewer.scene.globe.ellipsoid.cartographicToCartesian(p) + //cartesian = viewer.scene.camera.pickEllipsoid(movement.endPosition, viewer.scene.globe.ellipsoid); + if (positions.length >= 2) { + if (!Cesium.defined(poly)) { + poly = new PolyLinePrimitive(positions) + } else { + positions.pop() + // cartesian.y += (1 + Math.random()); + positions.push(cartesian) + } + // console.log("distance: " + distance); + // tooltip.innerHTML='<p>'+distance+'米</p>'; + } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) + + me.handler.setInputAction(function (movement) { + // tooltip.style.display = "none"; + // cartesian = viewer.scene.camera.pickEllipsoid(movement.position, viewer.scene.globe.ellipsoid); + cartesian = viewer.scene.pickPosition(movement.position) + if (!Cesium.defined(cartesian)) { + let ray = viewer.camera.getPickRay(movement.position) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + let p = Cesium.Cartographic.fromCartesian(cartesian) + p.height = viewer.scene.sampleHeight(p) + cartesian = viewer.scene.globe.ellipsoid.cartographicToCartesian(p) + if (positions.length == 0) { + positions.push(cartesian.clone()) + } + positions.push(cartesian) + getSpaceDistance(positions) + }, Cesium.ScreenSpaceEventType.LEFT_CLICK) + + me.handler.setInputAction(function (movement) { + me.handler.destroy() //关闭事件句柄 + positions.pop() //最后一个点无效 + // viewer.entities.remove(floatingPoint); + // tooltip.style.display = "none"; + me.bMeasuring = false + viewer._container.style.cursor = '' + }, Cesium.ScreenSpaceEventType.RIGHT_CLICK) + + var PolyLinePrimitive = (function () { + function _(positions) { + this.options = { + name: '直线', + polyline: { + show: true, + positions: [], + material: Cesium.Color.GOLD, + width: 2, + clampToGround: true, + }, + } + this.positions = positions + this._init() + } + + _.prototype._init = function () { + var _self = this + var _update = function () { + return _self.positions + } + //实时更新polyline.positions + this.options.polyline.positions = new Cesium.CallbackProperty( + _update, + false + ) + var et = viewer.entities.add(this.options) + me.measureIds.push(et.id) + } + + return _ + })() + + //空间两点距离计算函数 + function getSpaceDistance(positions) { + var distance_ = 0 + if (positions.length > 2) { + var positions_ = [] + var sp = Cesium.Cartographic.fromCartesian( + positions[positions.length - 3] + ) + var ep = Cesium.Cartographic.fromCartesian( + positions[positions.length - 2] + ) + var geodesic = new Cesium.EllipsoidGeodesic() + geodesic.setEndPoints(sp, ep) + var s = geodesic.surfaceDistance + positions_.push(sp) + var num = parseInt((s / 100).toFixed(0)) + num = num > 200 ? 200 : num + num = num < 20 ? 20 : num + for (var i = 1; i < num; i++) { + var res = geodesic.interpolateUsingSurfaceDistance( + (s / num) * i, + new Cesium.Cartographic() + ) + res.height = viewer.scene.sampleHeight(res) + positions_.push(res) + } + positions_.push(ep) + // var promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions_); + // Cesium.when(promise, function (updatedPositions) { + for (var ii = 0; ii < positions_.length - 1; ii++) { + geodesic.setEndPoints(positions_[ii], positions_[ii + 1]) + var d = geodesic.surfaceDistance + distance_ = + Math.sqrt( + Math.pow(d, 2) + + Math.pow(positions_[ii + 1].height - positions_[ii].height, 2) + ) + distance_ + } + //在三维场景中添加Label + var distance_add = parseFloat(distance_.toFixed(2)) + distance += distance_add + var textDisance = + (distance > 1000 + ? (distance / 1000).toFixed(3) + '千米' + : distance.toFixed(2) + '米') + + '\n(+' + + (distance_add > 1000 + ? (distance_add / 1000).toFixed(3) + '千米' + : distance_add + '米') + + ')' + + // var textDisance = distance + "米"; + // if (distance > 1000) { + // textDisance = (distance / 1000).toFixed(3) + "千米"; + // } + floatingPoint = viewer.entities.add({ + name: '空间直线距离', + position: positions[positions.length - 1], + point: { + pixelSize: 5, + color: Cesium.Color.RED, + outlineColor: Cesium.Color.WHITE, + outlineWidth: 2, + // disableDepthTestDistance: Number.POSITIVE_INFINITY + }, + label: { + text: textDisance, + font: '18px sans-serif', + fillColor: Cesium.Color.GOLD, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 2, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + disableDepthTestDistance: Number.POSITIVE_INFINITY, + pixelOffset: new Cesium.Cartesian2(20, -20), + // disableDepthTestDistance: Number.POSITIVE_INFINITY + }, + }) + me.measureIds.push(floatingPoint.id) + // }); + } + } + //空间两点距离计算函数 + function getSpaceDistance_(positions) { + var distance_ = 0 + if (positions.length > 2) { + var positions_ = [] + var sp = Cesium.Cartographic.fromCartesian( + positions[positions.length - 3] + ) + var ep = Cesium.Cartographic.fromCartesian( + positions[positions.length - 2] + ) + var geodesic = new Cesium.EllipsoidGeodesic() + geodesic.setEndPoints(sp, ep) + var s = geodesic.surfaceDistance + positions_.push(sp) + var num = parseInt((s / 100).toFixed(0)) + num = num > 200 ? 200 : num + num = num < 20 ? 20 : num + for (var i = 1; i < num; i++) { + var res = geodesic.interpolateUsingSurfaceDistance( + (s / num) * i, + new Cesium.Cartographic() + ) + positions_.push(res) + } + positions_.push(ep) + var promise = Cesium.sampleTerrainMostDetailed( + terrainProvider, + positions_ + ) + Cesium.when(promise, function (updatedPositions) { + for (var ii = 0; ii < positions_.length - 1; ii++) { + geodesic.setEndPoints(positions_[ii], positions_[ii + 1]) + var d = geodesic.surfaceDistance + distance_ = + Math.sqrt( + Math.pow(d, 2) + + Math.pow(positions_[ii + 1].height - positions_[ii].height, 2) + ) + distance_ + } + distance = parseFloat(distance_.toFixed(2)) + //在三维场景中添加Label + var textDisance = distance + '米' + if (distance > 1000) { + textDisance = (distance / 1000).toFixed(3) + '千米' + } + floatingPoint = viewer.entities.add({ + name: '空间直线距离', + position: positions[positions.length - 1], + point: { + pixelSize: 5, + color: Cesium.Color.RED, + outlineColor: Cesium.Color.WHITE, + outlineWidth: 2, + }, + label: { + text: textDisance, + font: '18px sans-serif', + fillColor: Cesium.Color.GOLD, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 2, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + pixelOffset: new Cesium.Cartesian2(20, -20), + }, + }) + me.measureIds.push(floatingPoint.id) + }) + } + } + } + //内部测量面积函数 + _measureAreaSpace() { + var me = this + var viewer = this.viewer + // 鼠标事件 + me.handler = new Cesium.ScreenSpaceEventHandler( + viewer.scene._imageryLayerCollection + ) + var positions = [] + var tempPoints = [] + var polygon = null + // var tooltip = document.getElementById("toolTip"); + var cartesian = null + var floatingPoint //浮动点 + // tooltip.style.display = "block"; + + me.handler.setInputAction(function (movement) { + // tooltip.style.left = movement.endPosition.x + 3 + "px"; + // tooltip.style.top = movement.endPosition.y - 25 + "px"; + // tooltip.innerHTML ='<p>单击开始,右击结束</p>'; + cartesian = viewer.scene.pickPosition(movement.endPosition) + if (!Cesium.defined(cartesian)) { + let ray = viewer.camera.getPickRay(movement.endPosition) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + //cartesian = viewer.scene.camera.pickEllipsoid(movement.endPosition, viewer.scene.globe.ellipsoid); + if (positions.length >= 2) { + if (!Cesium.defined(polygon)) { + polygon = new PolygonPrimitive(positions) + } else { + positions.pop() + // cartesian.y += (1 + Math.random()); + positions.push(cartesian) + } + // tooltip.innerHTML='<p>'+distance+'米</p>'; + } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) + + me.handler.setInputAction(function (movement) { + // tooltip.style.display = "none"; + cartesian = viewer.scene.pickPosition(movement.position) + if (!Cesium.defined(cartesian)) { + let ray = viewer.camera.getPickRay(movement.position) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + // cartesian = viewer.scene.camera.pickEllipsoid(movement.position, viewer.scene.globe.ellipsoid); + if (positions.length == 0) { + positions.push(cartesian.clone()) + } + //positions.pop(); + positions.push(cartesian) + //在三维场景中添加点 + var cartographic = Cesium.Cartographic.fromCartesian( + positions[positions.length - 1] + ) + var longitudeString = Cesium.Math.toDegrees(cartographic.longitude) + var latitudeString = Cesium.Math.toDegrees(cartographic.latitude) + var heightString = cartographic.height + tempPoints.push({ + lon: longitudeString, + lat: latitudeString, + hei: heightString, + }) + floatingPoint = viewer.entities.add({ + name: '多边形面积', + position: positions[positions.length - 1], + point: { + pixelSize: 3, + color: Cesium.Color.RED, + outlineColor: Cesium.Color.WHITE, + outlineWidth: 2, + heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, + }, + }) + me.measureIds.push(floatingPoint.id) + }, Cesium.ScreenSpaceEventType.LEFT_CLICK) + + me.handler.setInputAction(function (movement) { + me.handler.destroy() + positions.pop() + //tempPoints.pop(); + // viewer.entities.remove(floatingPoint); + // tooltip.style.display = "none"; + //在三维场景中添加点 + // var cartographic = Cesium.Cartographic.fromCartesian(positions[positions.length - 1]); + // var longitudeString = Cesium.Math.toDegrees(cartographic.longitude); + // var latitudeString = Cesium.Math.toDegrees(cartographic.latitude); + // var heightString = cartographic.height; + // tempPoints.push({ lon: longitudeString, lat: latitudeString ,hei:heightString}); + var a = getArea(tempPoints) + if (a < 0.001) { + a = (a * 1000000).toFixed(4) + '平方米' + } else { + a = a.toFixed(4) + '平方公里' + } + var textArea = a + var et = viewer.entities.add({ + name: '多边形面积', + position: positions[positions.length - 1], + // point : { + // pixelSize : 5, + // color : Cesium.Color.RED, + // outlineColor : Cesium.Color.WHITE, + // outlineWidth : 2, + // heightReference:Cesium.HeightReference.CLAMP_TO_GROUND + // }, + label: { + text: textArea, + font: '18px sans-serif', + fillColor: Cesium.Color.CYAN, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 2, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + pixelOffset: new Cesium.Cartesian2(20, -40), + disableDepthTestDistance: Number.POSITIVE_INFINITY, + heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, + }, + }) + me.measureIds.push(et.id) + me.bMeasuring = false + viewer._container.style.cursor = '' + }, Cesium.ScreenSpaceEventType.RIGHT_CLICK) + + var radiansPerDegree = Math.PI / 180.0 //角度转化为弧度(rad) + var degreesPerRadian = 180.0 / Math.PI //弧度转化为角度 + + //计算多边形面积 + function getArea(points) { + var res = 0 + //拆分三角曲面 + + for (var i = 0; i < points.length - 2; i++) { + var j = (i + 1) % points.length + var k = (i + 2) % points.length + var totalAngle = Angle(points[i], points[j], points[k]) + + var dis_temp1 = distance(positions[i], positions[j]) + var dis_temp2 = distance(positions[j], positions[k]) + res += dis_temp1 * dis_temp2 * Math.abs(Math.sin(totalAngle)) + } + return res / 1000000.0 + } + + /*角度*/ + function Angle(p1, p2, p3) { + var bearing21 = Bearing(p2, p1) + var bearing23 = Bearing(p2, p3) + var angle = bearing21 - bearing23 + if (angle < 0) { + angle += 360 + } + return angle + } + /*方向*/ + function Bearing(from, to) { + var lat1 = from.lat * radiansPerDegree + var lon1 = from.lon * radiansPerDegree + var lat2 = to.lat * radiansPerDegree + var lon2 = to.lon * radiansPerDegree + var angle = -Math.atan2( + Math.sin(lon1 - lon2) * Math.cos(lat2), + Math.cos(lat1) * Math.sin(lat2) - + Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon1 - lon2) + ) + if (angle < 0) { + angle += Math.PI * 2.0 + } + angle = angle * degreesPerRadian //角度 + return angle + } + + var PolygonPrimitive = (function () { + function _(positions) { + this.options = { + name: '多边形', + polygon: { + hierarchy: [], + // perPositionHeight : true, + material: Cesium.Color.DARKTURQUOISE.withAlpha(0.4), + outlineColor: Cesium.Color.CYAN.withAlpha(0.8), + // heightReference:20000 + }, + } + + this.hierarchy = { + positions, + } + this._init() + } + + _.prototype._init = function () { + var _self = this + var _update = function () { + return _self.hierarchy + } + //实时更新polygon.hierarchy + this.options.polygon.hierarchy = new Cesium.CallbackProperty( + _update, + false + ) + var et = viewer.entities.add(this.options) + me.measureIds.push(et.id) + } + + return _ + })() + + function distance(point1, point2) { + var point1cartographic = Cesium.Cartographic.fromCartesian(point1) + var point2cartographic = Cesium.Cartographic.fromCartesian(point2) + /**根据经纬度计算出距离**/ + var geodesic = new Cesium.EllipsoidGeodesic() + geodesic.setEndPoints(point1cartographic, point2cartographic) + var s = geodesic.surfaceDistance + //console.log(Math.sqrt(Math.pow(distance, 2) + Math.pow(endheight, 2))); + //返回两点之间的距离 + s = Math.sqrt( + Math.pow(s, 2) + + Math.pow(point2cartographic.height - point1cartographic.height, 2) + ) + return s + } + } + + //高度差 + _altitude() { + var me = this + var viewer = this.viewer + var trianArr = [] + var distanceLineNum = 0 + var Line1, Line2 + var H + var floatingPoint //浮动点 + me.handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas) + me.handler.setInputAction(function (movement) { + var cartesian = viewer.scene.pickPosition(movement.endPosition) + if (!Cesium.defined(cartesian)) { + var ray = viewer.camera.getPickRay(movement.endPosition) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + //cartesian = viewer.scene.camera.pickEllipsoid(movement.endPosition, viewer.scene.globe.ellipsoid); + if (distanceLineNum === 1) { + var cartographic = Cesium.Cartographic.fromCartesian(cartesian) + var lon = Cesium.Math.toDegrees(cartographic.longitude) + var lat = Cesium.Math.toDegrees(cartographic.latitude) + var MouseHeight = cartographic.height + trianArr.length = 3 + trianArr.push(lon, lat, MouseHeight) + draw_Triangle() + } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) + me.handler.setInputAction(function (movement) { + var cartesian = viewer.scene.pickPosition(movement.position) + if (!Cesium.defined(cartesian)) { + var ray = viewer.camera.getPickRay(movement.position) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + + // var cartesian = viewer.scene.pickPosition(movement.position); + var cartographic = Cesium.Cartographic.fromCartesian(cartesian) + var lon = Cesium.Math.toDegrees(cartographic.longitude) + var lat = Cesium.Math.toDegrees(cartographic.latitude) + var MouseHeight = cartographic.height + + floatingPoint = viewer.entities.add({ + name: '多边形面积', + position: cartesian, + point: { + pixelSize: 3, + color: Cesium.Color.RED, + outlineColor: Cesium.Color.WHITE, + outlineWidth: 2, + heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, + }, + }) + me.measureIds.push(floatingPoint.id) + + distanceLineNum++ + if (distanceLineNum === 1) { + trianArr.push(lon, lat, MouseHeight) + } else { + trianArr.length = 3 + trianArr.push(lon, lat, MouseHeight) + me.handler.destroy() + me.bMeasuring = false + viewer._container.style.cursor = '' + draw_Triangle() + } + }, Cesium.ScreenSpaceEventType.LEFT_CLICK) + + me.handler.setInputAction(function (movement) { + me.handler.destroy() + me.bMeasuring = false + viewer._container.style.cursor = '' + }, Cesium.ScreenSpaceEventType.RIGHT_CLICK) + + function draw_Triangle() { + if (Cesium.defined(Line1)) { + //更新三角线 + Line1.polyline.positions = + trianArr[5] > trianArr[2] + ? new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[0], + trianArr[1], + trianArr[5], + trianArr[0], + trianArr[1], + trianArr[2], + ]) + : new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[3], + trianArr[4], + trianArr[2], + trianArr[3], + trianArr[4], + trianArr[5], + ]) + Line2.polyline.positions = + trianArr[5] > trianArr[2] + ? new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[0], + trianArr[1], + trianArr[5], + trianArr[3], + trianArr[4], + trianArr[5], + ]) + : new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[3], + trianArr[4], + trianArr[2], + trianArr[0], + trianArr[1], + trianArr[2], + ]) + + //高度 + var height = Math.abs(trianArr[2] - trianArr[5]).toFixed(2) + H.position = + trianArr[5] > trianArr[2] + ? Cesium.Cartesian3.fromDegrees( + trianArr[0], + trianArr[1], + (trianArr[2] + trianArr[5]) / 2 + ) + : Cesium.Cartesian3.fromDegrees( + trianArr[3], + trianArr[4], + (trianArr[2] + trianArr[5]) / 2 + ) + H.label.text = '高度差:' + height + '米' + return + } + Line1 = viewer.entities.add({ + name: 'triangleLine', + polyline: { + positions: + trianArr[5] > trianArr[2] + ? new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[0], + trianArr[1], + trianArr[5], + trianArr[0], + trianArr[1], + trianArr[2], + ]) + : new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[3], + trianArr[4], + trianArr[2], + trianArr[3], + trianArr[4], + trianArr[5], + ]), + arcType: Cesium.ArcType.NONE, + width: 2, + material: new Cesium.PolylineOutlineMaterialProperty({ + color: Cesium.Color.CHARTREUSE, + }), + depthFailMaterial: new Cesium.PolylineOutlineMaterialProperty({ + color: Cesium.Color.RED, + }), + }, + }) + me.measureIds.push(Line1.id) + Line2 = viewer.entities.add({ + name: 'triangleLine', + polyline: { + positions: + trianArr[5] > trianArr[2] + ? new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[0], + trianArr[1], + trianArr[5], + trianArr[3], + trianArr[4], + trianArr[5], + ]) + : new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[3], + trianArr[4], + trianArr[2], + trianArr[0], + trianArr[1], + trianArr[2], + ]), + arcType: Cesium.ArcType.NONE, + width: 2, + + // material: new Cesium.PolylineOutlineMaterialProperty({ + material: new Cesium.PolylineDashMaterialProperty({ + color: Cesium.Color.CHARTREUSE, + // dashLength: 5, + // dashPattern: 10, + // gapColor:Cesium.Color.YELLOW + }), + // depthFailMaterial: new Cesium.PolylineOutlineMaterialProperty({ + depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ + color: Cesium.Color.RED, + }), + }, + }) + me.measureIds.push(Line2.id) + + // 空间 + var lineDistance = Cesium.Cartesian3.distance( + Cesium.Cartesian3.fromDegrees(trianArr[0], trianArr[1]), + Cesium.Cartesian3.fromDegrees(trianArr[3], trianArr[4]) + ).toFixed(2) + //高度 + var height = Math.abs(trianArr[2] - trianArr[5]).toFixed(2) + H = viewer.entities.add({ + name: 'lineZ', + position: + trianArr[5] > trianArr[2] + ? Cesium.Cartesian3.fromDegrees( + trianArr[0], + trianArr[1], + (trianArr[2] + trianArr[5]) / 2 + ) + : Cesium.Cartesian3.fromDegrees( + trianArr[3], + trianArr[4], + (trianArr[2] + trianArr[5]) / 2 + ), + label: { + text: '高度差:' + height + '米', + translucencyByDistance: new Cesium.NearFarScalar( + 1.5e2, + 2.0, + 1.5e5, + 0 + ), + font: '45px 楷体', + fillColor: Cesium.Color.WHITE, + outlineColor: Cesium.Color.BLACK, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 3, + disableDepthTestDistance: Number.POSITIVE_INFINITY, + scale: 0.5, + pixelOffset: new Cesium.Cartesian2(0, -10), + backgroundColor: new Cesium.Color.fromCssColorString( + 'rgba(0, 0, 0, 0.7)' + ), + backgroundPadding: new Cesium.Cartesian2(10, 10), + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + }, + }) + me.measureIds.push(H.id) + } + } + + //三角测量 + _Triangle() { + var me = this + var viewer = this.viewer + var trianArr = [] + var distanceLineNum = 0 + var XLine + var X, Y, H + var floatingPoint //浮动点 + me.handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas) + me.handler.setInputAction(function (movement) { + var cartesian = viewer.scene.pickPosition(movement.endPosition) + if (!Cesium.defined(cartesian)) { + var ray = viewer.camera.getPickRay(movement.endPosition) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + //cartesian = viewer.scene.camera.pickEllipsoid(movement.endPosition, viewer.scene.globe.ellipsoid); + if (distanceLineNum === 1) { + var cartographic = Cesium.Cartographic.fromCartesian(cartesian) + var lon = Cesium.Math.toDegrees(cartographic.longitude) + var lat = Cesium.Math.toDegrees(cartographic.latitude) + var MouseHeight = cartographic.height + trianArr.length = 3 + trianArr.push(lon, lat, MouseHeight) + draw_Triangle() + } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) + me.handler.setInputAction(function (movement) { + var cartesian = viewer.scene.pickPosition(movement.position) + if (!Cesium.defined(cartesian)) { + var ray = viewer.camera.getPickRay(movement.position) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + + // var cartesian = viewer.scene.pickPosition(movement.position); + var cartographic = Cesium.Cartographic.fromCartesian(cartesian) + var lon = Cesium.Math.toDegrees(cartographic.longitude) + var lat = Cesium.Math.toDegrees(cartographic.latitude) + var MouseHeight = cartographic.height + + floatingPoint = viewer.entities.add({ + name: '多边形面积', + position: cartesian, + point: { + pixelSize: 3, + color: Cesium.Color.RED, + outlineColor: Cesium.Color.WHITE, + outlineWidth: 2, + heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, + }, + }) + me.measureIds.push(floatingPoint.id) + + distanceLineNum++ + if (distanceLineNum === 1) { + trianArr.push(lon, lat, MouseHeight) + } else { + trianArr.length = 3 + trianArr.push(lon, lat, MouseHeight) + me.handler.destroy() + me.bMeasuring = false + viewer._container.style.cursor = '' + draw_Triangle() + } + }, Cesium.ScreenSpaceEventType.LEFT_CLICK) + + me.handler.setInputAction(function (movement) { + me.handler.destroy() + me.bMeasuring = false + viewer._container.style.cursor = '' + }, Cesium.ScreenSpaceEventType.RIGHT_CLICK) + + function draw_Triangle() { + if (Cesium.defined(XLine)) { + //更新三角线 + XLine.polyline.positions = + trianArr[5] > trianArr[2] + ? new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[0], + trianArr[1], + trianArr[2], + trianArr[0], + trianArr[1], + trianArr[5], + trianArr[3], + trianArr[4], + trianArr[5], + trianArr[0], + trianArr[1], + trianArr[2], + ]) + : new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[0], + trianArr[1], + trianArr[2], + trianArr[3], + trianArr[4], + trianArr[5], + trianArr[3], + trianArr[4], + trianArr[2], + trianArr[0], + trianArr[1], + trianArr[2], + ]) + + // 空间 + var lineDistance = Cesium.Cartesian3.distance( + Cesium.Cartesian3.fromDegrees(trianArr[0], trianArr[1]), + Cesium.Cartesian3.fromDegrees(trianArr[3], trianArr[4]) + ).toFixed(2) + //高度 + var height = Math.abs(trianArr[2] - trianArr[5]).toFixed(2) + //直线距离 + var strLine = Math.sqrt( + Math.pow(lineDistance, 2) + Math.pow(height, 2) + ).toFixed(2) + + X.position = Cesium.Cartesian3.fromDegrees( + (trianArr[0] + trianArr[3]) / 2, + (trianArr[1] + trianArr[4]) / 2, + Math.max(trianArr[2], trianArr[5]) + ) + H.position = + trianArr[5] > trianArr[2] + ? Cesium.Cartesian3.fromDegrees( + trianArr[0], + trianArr[1], + (trianArr[2] + trianArr[5]) / 2 + ) + : Cesium.Cartesian3.fromDegrees( + trianArr[3], + trianArr[4], + (trianArr[2] + trianArr[5]) / 2 + ) + Y.position = Cesium.Cartesian3.fromDegrees( + (trianArr[0] + trianArr[3]) / 2, + (trianArr[1] + trianArr[4]) / 2, + (trianArr[2] + trianArr[5]) / 2 + ) + X.label.text = '水平距离:' + lineDistance + '米' + H.label.text = '高度差:' + height + '米' + Y.label.text = '空间距离:' + strLine + '米' + return + } + XLine = viewer.entities.add({ + name: 'triangleLine', + polyline: { + positions: + trianArr[5] > trianArr[2] + ? new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[0], + trianArr[1], + trianArr[2], + trianArr[0], + trianArr[1], + trianArr[5], + trianArr[3], + trianArr[4], + trianArr[5], + trianArr[0], + trianArr[1], + trianArr[2], + ]) + : new Cesium.Cartesian3.fromDegreesArrayHeights([ + trianArr[0], + trianArr[1], + trianArr[2], + trianArr[3], + trianArr[4], + trianArr[5], + trianArr[3], + trianArr[4], + trianArr[2], + trianArr[0], + trianArr[1], + trianArr[2], + ]), + arcType: Cesium.ArcType.NONE, + width: 2, + material: new Cesium.PolylineOutlineMaterialProperty({ + color: Cesium.Color.YELLOW, + }), + depthFailMaterial: new Cesium.PolylineOutlineMaterialProperty({ + color: Cesium.Color.RED, + }), + }, + }) + me.measureIds.push(XLine.id) + + // 空间 + var lineDistance = Cesium.Cartesian3.distance( + Cesium.Cartesian3.fromDegrees(trianArr[0], trianArr[1]), + Cesium.Cartesian3.fromDegrees(trianArr[3], trianArr[4]) + ).toFixed(2) + //高度 + var height = Math.abs(trianArr[2] - trianArr[5]).toFixed(2) + //直线距离 + var strLine = Math.sqrt( + Math.pow(lineDistance, 2) + Math.pow(height, 2) + ).toFixed(2) + X = viewer.entities.add({ + name: 'lineX', + position: Cesium.Cartesian3.fromDegrees( + (trianArr[0] + trianArr[3]) / 2, + (trianArr[1] + trianArr[4]) / 2, + Math.max(trianArr[2], trianArr[5]) + ), + label: { + text: '水平距离:' + lineDistance + '米', + translucencyByDistance: new Cesium.NearFarScalar( + 1.5e2, + 2.0, + 1.5e5, + 0 + ), + font: '45px 楷体', + fillColor: Cesium.Color.WHITE, + outlineColor: Cesium.Color.BLACK, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 3, + disableDepthTestDistance: Number.POSITIVE_INFINITY, + scale: 0.5, + pixelOffset: new Cesium.Cartesian2(0, -10), + backgroundColor: new Cesium.Color.fromCssColorString( + 'rgba(0, 0, 0, 0.7)' + ), + backgroundPadding: new Cesium.Cartesian2(10, 10), + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + }, + }) + me.measureIds.push(X.id) + H = viewer.entities.add({ + name: 'lineZ', + position: + trianArr[5] > trianArr[2] + ? Cesium.Cartesian3.fromDegrees( + trianArr[0], + trianArr[1], + (trianArr[2] + trianArr[5]) / 2 + ) + : Cesium.Cartesian3.fromDegrees( + trianArr[3], + trianArr[4], + (trianArr[2] + trianArr[5]) / 2 + ), + label: { + text: '高度差:' + height + '米', + translucencyByDistance: new Cesium.NearFarScalar( + 1.5e2, + 2.0, + 1.5e5, + 0 + ), + font: '45px 楷体', + fillColor: Cesium.Color.WHITE, + outlineColor: Cesium.Color.BLACK, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 3, + disableDepthTestDistance: Number.POSITIVE_INFINITY, + scale: 0.5, + pixelOffset: new Cesium.Cartesian2(0, -10), + backgroundColor: new Cesium.Color.fromCssColorString( + 'rgba(0, 0, 0, 0.7)' + ), + backgroundPadding: new Cesium.Cartesian2(10, 10), + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + }, + }) + me.measureIds.push(H.id) + Y = viewer.entities.add({ + name: 'lineY', + position: Cesium.Cartesian3.fromDegrees( + (trianArr[0] + trianArr[3]) / 2, + (trianArr[1] + trianArr[4]) / 2, + (trianArr[2] + trianArr[5]) / 2 + ), + label: { + text: '空间距离:' + strLine + '米', + translucencyByDistance: new Cesium.NearFarScalar( + 1.5e2, + 2.0, + 1.5e5, + 0 + ), + font: '45px 楷体', + fillColor: Cesium.Color.WHITE, + outlineColor: Cesium.Color.BLACK, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 3, + disableDepthTestDistance: Number.POSITIVE_INFINITY, + scale: 0.5, + pixelOffset: new Cesium.Cartesian2(0, -10), + backgroundColor: new Cesium.Color.fromCssColorString( + 'rgba(0, 0, 0, 0.7)' + ), + backgroundPadding: new Cesium.Cartesian2(10, 10), + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + }, + }) + me.measureIds.push(Y.id) + } + } + + //方位角 + _measureAngle() { + var me = this + var viewer = this.viewer + var pArr = [] + var distanceLineNum = 0 + var Line1 + var Line2 + var angleT + var floatingPoint //浮动点 + me.handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas) + me.handler.setInputAction(function (movement) { + var cartesian = viewer.scene.pickPosition(movement.endPosition) + if (!Cesium.defined(cartesian)) { + var ray = viewer.camera.getPickRay(movement.endPosition) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + //cartesian = viewer.scene.camera.pickEllipsoid(movement.endPosition, viewer.scene.globe.ellipsoid); + if (distanceLineNum === 1) { + pArr.length = 1 + pArr.push(cartesian) + draw_Angle() + } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) + me.handler.setInputAction(function (movement) { + var cartesian = viewer.scene.pickPosition(movement.position) + if (!Cesium.defined(cartesian)) { + var ray = viewer.camera.getPickRay(movement.position) + cartesian = viewer.scene.globe.pick(ray, viewer.scene) + } + // var cartesian = viewer.scene.pickPosition(movement.position); + + distanceLineNum++ + if (distanceLineNum === 1) { + pArr.push(cartesian) + floatingPoint = viewer.entities.add({ + name: '方位角', + position: cartesian, + point: { + pixelSize: 3, + color: Cesium.Color.RED, + outlineColor: Cesium.Color.WHITE, + outlineWidth: 2, + heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, + }, + }) + me.measureIds.push(floatingPoint.id) + } else { + pArr.length = 1 + pArr.push(cartesian) + me.handler.destroy() + me.bMeasuring = false + viewer._container.style.cursor = '' + draw_Angle() + } + }, Cesium.ScreenSpaceEventType.LEFT_CLICK) + + me.handler.setInputAction(function (movement) { + me.handler.destroy() + me.bMeasuring = false + viewer._container.style.cursor = '' + }, Cesium.ScreenSpaceEventType.RIGHT_CLICK) + + function draw_Angle() { + // 空间 + var cartographic1 = Cesium.Cartographic.fromCartesian(pArr[0]) + var lon1 = Cesium.Math.toDegrees(cartographic1.longitude) + var lat1 = Cesium.Math.toDegrees(cartographic1.latitude) + var cartographic2 = Cesium.Cartographic.fromCartesian(pArr[1]) + var lon2 = Cesium.Math.toDegrees(cartographic2.longitude) + var lat2 = Cesium.Math.toDegrees(cartographic2.latitude) + var lineDistance = Cesium.Cartesian3.distance( + Cesium.Cartesian3.fromDegrees(lon1, lat1), + Cesium.Cartesian3.fromDegrees(lon2, lat2) + ) + var localToWorld_Matrix = Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(lon1, lat1) + ) + var NorthPoint = Cesium.Cartographic.fromCartesian( + Cesium.Matrix4.multiplyByPoint( + localToWorld_Matrix, + Cesium.Cartesian3.fromElements(0, lineDistance, 0), + new Cesium.Cartesian3() + ) + ) + var npLon = Cesium.Math.toDegrees(NorthPoint.longitude) + var npLat = Cesium.Math.toDegrees(NorthPoint.latitude) + // var angle = Cesium.Cartesian3.angleBetween(Cesium.Cartesian3.fromDegrees(lon1, lat1), + // Cesium.Cartesian3.fromDegrees(lon2, lat2)); + var angle = courseAngle(lon1, lat1, lon2, lat2) + var textDisance = lineDistance.toFixed(2) + '米' + if (lineDistance > 1000) { + textDisance = (lineDistance / 1000).toFixed(3) + '千米' + } + if (Cesium.defined(Line1)) { + //更新线 + Line1.polyline.positions = new Cesium.Cartesian3.fromDegreesArray([ + lon1, + lat1, + npLon, + npLat, + ]) + Line2.polyline.positions = new Cesium.Cartesian3.fromDegreesArray([ + lon1, + lat1, + lon2, + lat2, + ]) + angleT.label.text = '角度:' + angle + '°\n距离:' + textDisance + angleT.position = pArr[1] + return + } + //北方线 + Line1 = viewer.entities.add({ + name: 'Angle1', + polyline: { + positions: new Cesium.Cartesian3.fromDegreesArray([ + lon1, + lat1, + npLon, + npLat, + ]), + width: 3, + material: new Cesium.PolylineDashMaterialProperty({ + color: Cesium.Color.RED, + }), + clampToGround: true, + }, + }) + me.measureIds.push(Line1.id) + //线 + Line2 = viewer.entities.add({ + name: 'Angle2', + polyline: { + positions: new Cesium.Cartesian3.fromDegreesArray([ + lon1, + lat1, + lon2, + lat2, + ]), + width: 10, + material: new Cesium.PolylineArrowMaterialProperty( + Cesium.Color.YELLOW + ), + clampToGround: true, + }, + }) + me.measureIds.push(Line2.id) + + //文字 + angleT = viewer.entities.add({ + name: 'AngleT', + position: pArr[1], + label: { + text: '角度:' + angle + '°\n距离:' + textDisance, + translucencyByDistance: new Cesium.NearFarScalar( + 1.5e2, + 2.0, + 1.5e5, + 0 + ), + font: '45px 楷体', + fillColor: Cesium.Color.WHITE, + outlineColor: Cesium.Color.BLACK, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 4, + scale: 0.5, + pixelOffset: new Cesium.Cartesian2(0, -40), + disableDepthTestDistance: Number.POSITIVE_INFINITY, + backgroundColor: new Cesium.Color.fromCssColorString( + 'rgba(0, 0, 0, 1)' + ), + backgroundPadding: new Cesium.Cartesian2(10, 10), + verticalOrigin: Cesium.VerticalOrigin.BASELINE, + }, + }) + me.measureIds.push(angleT.id) + } + + function courseAngle(lng_a, lat_a, lng_b, lat_b) { + /////////////方法 + var dRotateAngle = Math.atan2( + Math.abs(lng_a - lng_b), + Math.abs(lat_a - lat_b) + ) + if (lng_b >= lng_a) { + if (lat_b >= lat_a) { + } else { + dRotateAngle = Math.PI - dRotateAngle + } + } else { + if (lat_b >= lat_a) { + dRotateAngle = 2 * Math.PI - dRotateAngle + } else { + dRotateAngle = Math.PI + dRotateAngle + } + } + dRotateAngle = (dRotateAngle * 180) / Math.PI + return parseInt(dRotateAngle * 100) / 100 + + /////方法 + // //以a点为原点建立局部坐标系(东方向为x轴,北方向为y轴,垂直于地面为z轴),得到一个局部坐标到世界坐标转换的变换矩阵 + // var localToWorld_Matrix = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3.fromDegrees(lng_a, lat_a)); + // //求世界坐标到局部坐标的变换矩阵 + // var worldToLocal_Matrix = Cesium.Matrix4.inverse(localToWorld_Matrix, new Cesium.Matrix4()); + // //a点在局部坐标的位置,其实就是局部坐标原点 + // var localPosition_A = Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, new Cesium.Cartesian3.fromDegrees(lng_a, lat_a), new Cesium.Cartesian3()); + // //B点在以A点为原点的局部的坐标位置 + // var localPosition_B = Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, new Cesium.Cartesian3.fromDegrees(lng_b, lat_b), new Cesium.Cartesian3()); + // //弧度 + // var angle = Math.atan2((localPosition_B.y - localPosition_A.y), (localPosition_B.x - localPosition_A.x)) + // //角度 + // var theta = angle * (180 / Math.PI); + // if (theta < 0) { + // theta = theta + 360; + // } + // return theta.toFixed(2); + } + } +} diff --git a/src/js/polylineTrail.js b/src/js/polylineTrail.js index d068f4757..2cb495b89 100644 --- a/src/js/polylineTrail.js +++ b/src/js/polylineTrail.js @@ -61,7 +61,8 @@ Cesium.Material.PolylineTrailLinkSource = `czm_material czm_getMaterial(czm_mate material.alpha = colorImage.a * color.a; material.diffuse = color.rgb; return material; - } + } + ` Cesium.Material._materialCache.addMaterial( Cesium.Material.PolylineTrailLinkType, diff --git a/src/js/satelliteEntity.js b/src/js/satelliteEntity.js index e933ff215..d75549fad 100644 --- a/src/js/satelliteEntity.js +++ b/src/js/satelliteEntity.js @@ -17,23 +17,44 @@ class SatelliteEntity { this.stepSeconds = 100 this.leadTime = parseInt((24 * 3600) / circle) this.trailTime = 0 - this.sensor = false + this._sensor = false + this.sensorEntity = null this.entity = null - this.sensorType = 'rectangle' + this._underPoint = false + this.underPointEntity = null + this._sensorType = 'rectangle' + this._listener = null + } + get sensorType() { + return this._sensorType + } + set sensorType(type) { + this._sensorType = type } get sensor() { - return this.sensor + return this._sensor } set sensor(showSensor) { - console.log(showSensor, 'showSensor') + // console.log(showSensor, 'showSensor') + this._sensor = showSensor if (showSensor) { - if (this.sensorType === 'conic') { + if (this._sensorType === 'conic') { this.createConicSensor(this.entity) - } else { + } else if (this._sensorType === 'rectangle') { this.createRectangleSensor(this.entity) } } - //showSensor && + } + + get underPoint() { + return this._underPoint + } + set underPoint(showUnderPoint) { + // console.log(showSensor, 'showSensor') + this._underPoint = showUnderPoint + if (this.underPointEntity) { + this.underPointEntity.show = showUnderPoint + } } _checkTle(tle) { @@ -50,12 +71,12 @@ class SatelliteEntity { } // 创建PositionProperty - _getPositionProperty() { + _getPositionProperty(height) { const start = Cesium.JulianDate.fromIso8601(new Date().toISOString()) const positionProperty = new Cesium.SampledPositionProperty( Cesium.ReferenceFrame.INERTIAL ) - + // const points = [] let now = Date.now() for (let i = 0; i < this.totalSeconds / this.stepSeconds; i++) { let sateTime = new Date(now + i * this.stepSeconds * 1000) @@ -68,13 +89,26 @@ class SatelliteEntity { i * this.stepSeconds, new Cesium.JulianDate() ) - const cesiumPosition = { + let cesiumPosition = { x: sateCoord.x * 1000, y: sateCoord.y * 1000, z: sateCoord.z * 1000, } + if (height) { + let cartographic = + Cesium.Ellipsoid.WGS84.cartesianToCartographic(cesiumPosition) + // let lon = Cesium.Math.toDegrees(cartographic.longitude) + // let lat = Cesium.Math.toDegrees(cartographic.latitude) + cesiumPosition = Cesium.Cartesian3.fromRadians( + cartographic.longitude, + cartographic.latitude + ) + // points.push(cesiumPosition) + } positionProperty.addSample(cesiumTime, cesiumPosition) } + // if (height) return points + // console.log(positionProperty, '-----') return positionProperty } @@ -88,7 +122,7 @@ class SatelliteEntity { ) const color = Cesium.Color.fromCssColorString( chroma.random().brighten().hex() - ) + ).withAlpha(0.8) // const color = Cesium.Color.fromRandom({ alpha: 0.5 }) let satelliteEntity = { name: this.name, @@ -98,13 +132,9 @@ class SatelliteEntity { new Cesium.TimeInterval({ start: start, stop: stop }), ]), position: this._getPositionProperty(), - // point: { - // pixelSize: 8, - // color: color, - // // scaleByDistance: new Cesium.NearFarScalar(1.5e3, 1, 8.0e8, 0.5), - // }, + path: new Cesium.PathGraphics({ - width: 2, + width: 8, show: true, leadTime: this.leadTime, trailTime: this.trailTime, @@ -165,7 +195,7 @@ class SatelliteEntity { } // this.createSensor(satelliteEntity) // return satelliteEntity - + this.createPointUnderTheSatellite(color) this.entity = viewer.entities.add(satelliteEntity) return this.entity } @@ -238,7 +268,9 @@ class SatelliteEntity { ) const rectangularPyramidSensor = new CesiumSensorVolumes.RectangularPyramidSensorVolume() - rectangularPyramidSensor.modelMatrix = this.getModelMatrix(position) + if (position) { + rectangularPyramidSensor.modelMatrix = this.getModelMatrix(position) + } rectangularPyramidSensor.radius = 20000000.0 rectangularPyramidSensor.xHalfAngle = Cesium.Math.toRadians(20.0) rectangularPyramidSensor.yHalfAngle = Cesium.Math.toRadians(10.0) @@ -247,18 +279,24 @@ class SatelliteEntity { rectangularPyramidSensor.lateralSurfaceMaterial.uniforms.color = new Cesium.Color(0.0, 1.0, 1.0, 0.3) - viewer.scene.preRender.addEventListener((scene, time) => { - rectangularPyramidSensor.show = false - let position = Cesium.Property.getValueOrUndefined( - satellite.position, - time, - new Cesium.Cartesian3() - ) - rectangularPyramidSensor.modelMatrix = this.getModelMatrix(position) - rectangularPyramidSensor.show = true - }) + this._listener = (scene, time) => { + if (rectangularPyramidSensor) { + rectangularPyramidSensor.show = false + let position = Cesium.Property.getValueOrUndefined( + satellite.position, + time, + new Cesium.Cartesian3() + ) + if (position) { + rectangularPyramidSensor.modelMatrix = this.getModelMatrix(position) + } + rectangularPyramidSensor.show = true + } + } - viewer.scene.primitives.add(rectangularPyramidSensor) + viewer.scene.preRender.addEventListener(this._listener) + + this.sensorEntity = viewer.scene.primitives.add(rectangularPyramidSensor) } getModelMatrix(location) { @@ -275,12 +313,13 @@ class SatelliteEntity { let orientation = Cesium.Matrix3.multiply( Cesium.Matrix3.multiply( Cesium.Matrix3.fromRotationZ(0.0), - Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(0.0)), + Cesium.Matrix3.fromRotationY(0.0), new Cesium.Matrix3() ), Cesium.Matrix3.fromRotationX(0.0), new Cesium.Matrix3() ) + return Cesium.Matrix4.multiply( modelMatrix, Cesium.Matrix4.fromRotationTranslation( @@ -297,30 +336,118 @@ class SatelliteEntity { viewer.clock.currentTime, new Cesium.Cartesian3() ) - // const conicSensor = new CesiumSensorVolumes.ConicSensorGraphics() - // conicSensor.radius = 20000000.0 - // conicSensor.modelMatrix = this.getModelMatrix(position) - // conicSensor.intersectionColor = new Cesium.ConstantProperty( - // new Cesium.Color(0.1, 0.2, 0.3, 0.4) - // ) - const customSensor = new CesiumSensorVolumes.CustomSensorVolume() - customSensor.modelMatrix = this.getModelMatrix(position) - customSensor.radius = 20000000.0 - // customSensor.directions = directions; - viewer.scene.primitives.add(customSensor) + const conicSensor = new CesiumSensorVolumes.ConicSensorGraphics({ + show: true, + radius: 2e7, + innerHalfAngle: 0, + outerHalfAngle: Cesium.Math.toRadians(20), + minimumClockAngle: 0, + maximumClockAngle: 2 * Math.PI, + showIntersection: true, + intersectionColor: new Cesium.Color(1, 1, 1, 1), + intersectionWidth: 3, + lateralSurfaceMaterial: new Cesium.Color(0.0, 1.0, 1.0, 0.3), + }) - viewer.scene.preRender.addEventListener((scene, time) => { - customSensor.show = false + this.sensorEntity = viewer.entities.add({ + position: position, + orientation: position && this._getOrientation(position), + conicSensor: conicSensor, + }) + + this._listener = (scene, time) => { + conicSensor.show = false let position = Cesium.Property.getValueOrUndefined( satellite.position, time, new Cesium.Cartesian3() ) - customSensor.modelMatrix = this.getModelMatrix(position) - customSensor.show = true - }) + this.sensorEntity.position = position - viewer.scene.primitives.add(customSensor) + // const currentOrientation = this.entity.orientation.getValue( + // Cesium.JulianDate.now() + // ) + // const hpr = Cesium.HeadingPitchRoll.fromQuaternion(currentOrientation) + + // hpr.roll += Cesium.Math.toRadians(180) + + // const newOrientation = Cesium.Transforms.headingPitchRollQuaternion( + // position, + // hpr + // ) + // sensor.orientation = new Cesium.ConstantProperty(newOrientation) + if (position) { + this.sensorEntity.orientation = this._getOrientation(position) + // sensor.orientation = this.getModelMatrix(position) + } + + conicSensor.show = true + } + + viewer.scene.preRender.addEventListener(this._listener) + } + + _getOrientation(position) { + return Cesium.Transforms.headingPitchRollQuaternion( + position, + new Cesium.HeadingPitchRoll( + Cesium.Math.toRadians(90), + 0, + Cesium.Math.toRadians(180) + ) // 初始朝向 + ) + } + + _getPositionFromTime() { + const start = Cesium.JulianDate.fromIso8601(new Date().toISOString()) + const pos = this._getPositionProperty(1) + + const points = [] + for (let i = 0; i < 864; i++) { + const time = Cesium.JulianDate.addSeconds( + start, + i * 100, + new Cesium.JulianDate() + ) + const point = pos.getValue(time) + // console.log(point, i) + point && points.push(point) + } + + return points + } + + createPointUnderTheSatellite(color) { + const start = Cesium.JulianDate.fromIso8601(new Date().toISOString()) + const stop = Cesium.JulianDate.addSeconds( + start, + this.totalSeconds, + new Cesium.JulianDate() + ) + const positionProperty = this._getPositionProperty(1) + const points = this._getPositionFromTime() + // console.log(points, 'points') + + this.underPointEntity = viewer.entities.add({ + name: 'underSatellite', + position: positionProperty, + show: this._underPoint, + // availability: new Cesium.TimeIntervalCollection([ + // new Cesium.TimeInterval({ start: start, stop: stop }), + // ]), + point: { + color: Cesium.Color.WHITE, + pixelSize: 5, + outlineColor: Cesium.Color.RED, + outlineWidth: 2, + }, + polyline: { + positions: points, + + width: 1, + material: Cesium.Color.RED, + }, + }) } // createSensor(satellite) { @@ -351,6 +478,30 @@ class SatelliteEntity { // console.log(sensor, 'sensor') // // }) // } + removeSensor() { + if (this.sensorEntity) { + if (this._sensorType === 'conic') { + viewer.entities.remove(this.sensorEntity) + } else { + viewer.scene.primitives.remove(this.sensorEntity) + } + this.sensorEntity = null + } + } + destroy() { + viewer.entities.remove(this.entity) + this.underPointEntity && viewer.entities.remove(this.underPointEntity) + + this.removeListener() + this.removeSensor() + } + + removeListener() { + if (this._listener) { + viewer.scene.preRender.removeEventListener(this._listener) + } + this._listener = null + } } export default SatelliteEntity diff --git a/src/main.ts b/src/main.ts index d73511bd0..38a7c8e7f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,6 @@ import { createApp } from 'vue' import { createPinia } from 'pinia' + // import * as Cesium from 'cesium' // window.Cesium = Cesium import App from './App.vue' @@ -10,6 +11,8 @@ import 'normalize.css' import 'virtual:windi.css' import './js/polylineTrail.js' + +import Loading from '@/components/Loading/Loading' // import { Viewer } from "cesium"; // import "cesium/Build/Cesium/Widgets/widgets.css"; // window.Cesium = Viewer @@ -20,5 +23,6 @@ const app = createApp(App) app.use(createPinia()) app.use(router) +app.use(Loading) app.mount('#app') diff --git a/src/styles/naiveConfig.js b/src/styles/naiveConfig.js new file mode 100644 index 000000000..c2cf21d6b --- /dev/null +++ b/src/styles/naiveConfig.js @@ -0,0 +1,17 @@ +export const themeOverrides = { + common: { + primaryColor: '#48a8f5', + primaryColorPressed: '#3771e1', + fontSize: '16px', + }, + DataTable: { + thColor: '#257bb5', + tdColor: '#0000', + tdColorStriped: 'rgba(37,123,181,0.3)', + tdColorHover: 'rgba(37,123,181,0.6)', + thColorModal: '#257bb5', + tdColorModal: '#0000', + tdColorStripedModal: 'rgba(37,123,181,0.3)', + tdColorHoverModal: 'rgba(37,123,181,0.3)', + }, +} diff --git a/src/styles/nav.scss b/src/styles/nav.scss index 598edde12..5eb9fa39e 100644 --- a/src/styles/nav.scss +++ b/src/styles/nav.scss @@ -51,6 +51,26 @@ box-shadow: inset 0 0 12px rgba(151, 200, 255, 0.44); } +.checked::after { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: var(--gradient-bg) left top no-repeat, + var(--gradient-bg) left top no-repeat, + var(--gradient-bg) right top no-repeat, + var(--gradient-bg) right top no-repeat, + var(--gradient-bg) left bottom no-repeat, + var(--gradient-bg) left bottom no-repeat, + var(--gradient-bg) right bottom no-repeat, + var(--gradient-bg) right bottom no-repeat; + /*10px是长度 1px是粗细*/ + background-size: 1px 8px, 8px 1px, 1px 8px, 8px 1px; + border-radius: 5px; +} + .left { } // .right { diff --git a/src/utils/date.js b/src/utils/date.js index f7016c564..deb9ca35c 100644 --- a/src/utils/date.js +++ b/src/utils/date.js @@ -13,3 +13,7 @@ export const time2FormatWithTimezone = (time, zone) => { // console.log(timezone) return dayjs(time).tz(zone).format('YYYY-MM-DD HH:mm:ss') } + +export const time2Format = time => { + return dayjs(time).format('YYYY-MM-DD HH:mm:ss') +} diff --git a/src/views/BaseMB/components/HisImages/index.vue b/src/views/BaseMB/components/HisImages/index.vue index 29c2c3099..9e544f560 100644 --- a/src/views/BaseMB/components/HisImages/index.vue +++ b/src/views/BaseMB/components/HisImages/index.vue @@ -52,11 +52,17 @@ const scrollRef = ref<HTMLElement | null>(null) const getImage = async () => { const imgRes = await getHisImages(timeRange.value) // console.log(imgRes, 'imgRes') - imageList.value = imgRes.map((item: any) => { + // imageList.value = imgRes.map((item: any) => { + // return { + // ...item, + // imgPath: encodeURI(`/api/file?path=${item.parseInfo.imgPath}`), + // imgId: item.parseInfo.id, + // } + // }) + imageList.value = new Array(10).fill(1).map((item, index) => { return { - ...item, - imgPath: encodeURI(`/api/file?path=${item.parseInfo.imgPath}`), - imgId: item.parseInfo.id, + imgPath: `https://picsum.photos/300/200?random=${index}`, + imgId: index, } }) // console.log(imageList.value, 'imageList') @@ -65,7 +71,7 @@ const getImage = async () => { <template> <!-- <div :class="{ '!row-span-4 !row-start-2': previewIndex }"> --> - <div class="pre-container" :class="{ '!h-[85%]': showPreview }"> + <div class="pre-container" :class="{ '!h-[95%]': showPreview }"> <panel :title="`${sheshiData.sheShiName}历史图像`" :show-close="true" diff --git a/src/views/BaseMB/hooks/base.ts b/src/views/BaseMB/hooks/base.ts index b1085000a..732000168 100644 --- a/src/views/BaseMB/hooks/base.ts +++ b/src/views/BaseMB/hooks/base.ts @@ -1,5 +1,5 @@ import { onMounted, ref } from 'vue' -import Subscriber from '@cesium-extends/subscriber' +import { Subscriber } from 'cesium-extends' import { difference } from 'lodash' import { getSheshi } from '@/api/Sheshi' import { useTree } from '@/utils/tree' @@ -8,13 +8,6 @@ import { useBasePopup } from './basePopup' import { useEntity } from '@/hooks/entity' // import { storeToRefs } from 'pinia' -const typeDict: Record<string, string> = { - base: './images/icons/base/base1.png', - airport: './images/icons/base/airport1.png', - port: './images/icons/base/port1.png', - station: './images/icons/base/station1.png', -} - const treeData = ref([]) const { baseMap } = useEntity() @@ -28,6 +21,8 @@ let subscriber: Subscriber | null = null const { filterTreeNodeByField } = useTree() const { popupMap, createPopup } = useBasePopup() + +const isLoading = ref(false) export const useBase = () => { onMounted(async () => { await getSheshiData() @@ -65,6 +60,7 @@ export const useBase = () => { } return { + isLoading, treeData, allKeys, addBaseFacilities, @@ -72,6 +68,7 @@ export const useBase = () => { } async function getSheshiData() { + isLoading.value = true const baseRes = await getSheshi() const { code, data } = baseRes @@ -79,6 +76,7 @@ async function getSheshiData() { // console.log(data, 'baseRes') treeData.value = [data] } + isLoading.value = false } function addEventSub( @@ -113,24 +111,38 @@ function getAllKeys(treeData: any) { function addEntity(data: TBaseNode) { const { sheShiName, sheShiType, geom } = data const pos = parseWKT(geom).coordinates + const color = Cesium.Color.fromCssColorString( + window.settings.baseMBDict[sheShiType].color + ) const entity = viewer.entities.add({ name: sheShiName, position: Cesium.Cartesian3.fromDegrees(...pos), - // label: { - // text: `${sheShiName}`, - // font: '12pt sans-serif', - // fillColor: Cesium.Color.YELLOW, - // outlineColor: Cesium.Color.BLACK, - // outlineWidth: 2, - // style: Cesium.LabelStyle.FILL_AND_OUTLINE, - // pixelOffset: new Cesium.Cartesian2(20, -20), - // disableDepthTestDistance: Number.POSITIVE_INFINITY, - // }, + label: { + text: `${sheShiName}`, + font: '12pt sans-serif', + fillColor: color, + outlineColor: Cesium.Color.BLACK, + outlineWidth: 2, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + pixelOffset: new Cesium.Cartesian2(0, 20), + pixelOffsetScaleByDistance: new Cesium.NearFarScalar( + 7000000, + 1.0, + 18000000, + 0.4 + ), + // eyeOffset: new Cesium.Cartesian3(0.0, 20000.0, 0.0), + scaleByDistance: new Cesium.NearFarScalar(7000000, 1.0, 18000000, 0.4), + }, billboard: { - image: typeDict[sheShiType], + image: window.settings.baseMBDict[sheShiType].icon, width: 30, height: 30, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + scale: 1, + color, + scaleByDistance: new Cesium.NearFarScalar(7000000, 1.0, 18000000, 0.4), + + // verticalOrigin: Cesium.VerticalOrigin.BOTTOM, }, }) return entity diff --git a/src/views/BaseMB/hooks/base0103.ts b/src/views/BaseMB/hooks/base0103.ts index 050834cda..37ded4fb9 100644 --- a/src/views/BaseMB/hooks/base0103.ts +++ b/src/views/BaseMB/hooks/base0103.ts @@ -1,5 +1,5 @@ import { onMounted, ref } from 'vue' -import Subscriber from '@cesium-extends/subscriber' +import { Subscriber } from 'cesium-extends' import { difference } from 'lodash' import { getSheshi } from '@/api/Sheshi' import { useTree } from '@/utils/tree' diff --git a/src/views/BaseMB/index.vue b/src/views/BaseMB/index.vue index 69b0a7fa2..d5d1d8657 100644 --- a/src/views/BaseMB/index.vue +++ b/src/views/BaseMB/index.vue @@ -5,7 +5,7 @@ import { useBase } from './hooks/base' import { useEarth } from '../Earth/hooks/earth' import { parseWKT } from '@/utils/parseWKT' -const { treeData, allKeys, addBaseFacilities } = useBase() +const { isLoading, treeData, allKeys, addBaseFacilities } = useBase() watch(allKeys, val => { nextTick(() => { @@ -46,7 +46,7 @@ const nodeProps = ({ option }: { option: TreeOption }) => { </script> <template> - <div class="w-h-full"> + <div class="w-h-full" v-loading="isLoading"> <tree :data="treeData" :key-field="'dataId'" diff --git a/src/views/Content/components/WidgetNav/components/BaseMap.jsx b/src/views/Content/components/WidgetNav/components/BaseMap.jsx index ae7ada18c..02292b34b 100644 --- a/src/views/Content/components/WidgetNav/components/BaseMap.jsx +++ b/src/views/Content/components/WidgetNav/components/BaseMap.jsx @@ -1,35 +1,37 @@ +import { TilingScheme } from 'cesium' import { NIcon, NPopover } from 'naive-ui' +let map = null export default defineComponent({ setup() { const showBaseMapList = ref(false) - const baseMapList = [ - { - name: '谷歌地图', - value: 'google', - }, - { - name: '高德地图', - value: 'gaode', - }, - { - name: '天地图', - value: 'tianditu', - }, - { - name: '百度地图', - value: 'baidu', - }, - ] + const baseMapList = window.settings.map + + const checkedMap = ref('') + + const changeMap = mapId => { + // console.log(mapId, 'mapId') + checkedMap.value = mapId + map && viewer.imageryLayers.remove(map) + map = viewer.imageryLayers.addImageryProvider( + new Cesium.UrlTemplateImageryProvider({ + url: baseMapList[mapId].url, + tilingScheme: new Cesium[baseMapList[mapId].tilingScheme](), + }) + ) + } + onMounted(() => { + changeMap(Object.keys(baseMapList)[2]) + }) return () => ( - <div className="relative"> + <div class="relative"> <NPopover trigger="hover" placement="bottom" v-slots={{ trigger: () => ( <div - className="btn-class" + class={`btn-class ${showBaseMapList.value ? 'checked' : ''}`} onClick={() => { showBaseMapList.value = !showBaseMapList.value }} @@ -59,11 +61,25 @@ export default defineComponent({ <span>地图样式选择</span> </NPopover> {showBaseMapList.value ? ( - <div className="corner-border absolute top-10 z-30 flex h-[200px] w-[200px] flex-wrap bg-[var(--color-bg)]"> - {baseMapList.map((item, index) => ( - <div className="flex w-[50%] flex-col gap-2 p-2 text-center text-xs"> - <div className="flex-1 border"></div> - <div>{item.name}</div> + <div class="corner-border absolute top-10 z-30 grid h-[340px] w-[300px] grid-cols-2 grid-rows-2 gap-2 bg-[var(--color-bg)] p-2"> + {Object.keys(baseMapList).map((key, index) => ( + <div + class={`${ + checkedMap.value === key ? 'text-[#08ffff]' : '' + } flex h-full w-full flex-col gap-2 rounded-md p-2 text-center text-xs hover:text-[#08ffff]`} + onClick={() => changeMap(key)} + > + <div + class={`${ + checkedMap.value === key ? 'ring-2' : '' + } h-0 flex-1 rounded-lg ring-[#08ffff] hover:ring-2 `} + > + <img + class="h-full w-full rounded-lg object-fill" + src={baseMapList[key].image} + /> + </div> + <div>{baseMapList[key].name}</div> </div> ))} </div> diff --git a/src/views/Content/components/WidgetNav/components/HomeView.jsx b/src/views/Content/components/WidgetNav/components/HomeView.jsx index 4754ee975..df707d504 100644 --- a/src/views/Content/components/WidgetNav/components/HomeView.jsx +++ b/src/views/Content/components/WidgetNav/components/HomeView.jsx @@ -14,7 +14,7 @@ export default defineComponent({ placement="bottom" v-slots={{ trigger: () => ( - <div className="btn-class" onClick={goHome}> + <div class="btn-class" onClick={goHome}> <NIcon size="16"> <svg t="1735882569580" diff --git a/src/views/Content/components/WidgetNav/components/LoadShow.jsx b/src/views/Content/components/WidgetNav/components/LoadShow.jsx new file mode 100644 index 000000000..2e0fb93ef --- /dev/null +++ b/src/views/Content/components/WidgetNav/components/LoadShow.jsx @@ -0,0 +1,41 @@ +import { NIcon, NPopover } from 'naive-ui' +import { useEntity } from '@/hooks/entity' +export default defineComponent({ + setup() { + const { changeIconOrModel } = useEntity() + return () => ( + <> + <NPopover + trigger="hover" + placement="bottom" + v-slots={{ + trigger: () => ( + <div class="btn-class" onClick={changeIconOrModel}> + <NIcon size="16"> + <svg + t="1736488615012" + class="icon" + viewBox="0 0 1024 1024" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + p-id="48899" + width="64" + height="64" + > + <path + d="M512 276.70755555c129.82044445-0.34133333 235.29244445 104.67555555 235.52 234.496 0.34133333 129.82044445-104.67555555 235.29244445-234.496 235.52-129.82044445 0.34133333-235.29244445-104.67555555-235.52-234.496v-1.024C276.82133333 382.29333333 380.81422222 277.27644445 509.72444445 276.70755555h2.27555555zM340.19555555 511.31733333c-0.34133333 94.66311111 76.11733333 171.69066667 170.78044445 172.032s171.69066667-76.00355555 172.032-170.66666666c1.82044445-93.63911111-72.704-170.89422222-166.34311111-172.71466667h-4.77866667c-94.66311111-0.22755555-171.57688889 76.34488889-171.80444444 171.008 0.11377778 0.11377778 0.11377778 0.22755555 0.11377777 0.34133333z m458.41066667 120.37688889c16.04266667 16.04266667 31.40266667 31.63022222 47.44533333 47.78666667-36.06755555 72.02133333-94.43555555 130.38933333-166.3431111 166.79822222-15.70133333-15.81511111-31.40266667-31.51644445-47.44533334-47.44533333 75.09333333-31.97155555 134.82666667-91.93244445 166.34311111-167.13955556zM224.59733333 392.41955555c-16.04266667-16.04266667-31.744-31.63022222-47.44533333-47.44533333 36.18133333-73.15911111 95.34577778-132.55111111 168.50488889-168.84622222 15.70133333 15.92888889 30.94755555 31.63022222 46.99022222 47.90044445-75.88977778 31.85777778-136.192 92.38755555-168.04977778 168.3911111z m622.13688889-47.44533333c-15.70133333 16.04266667-30.94755555 31.40266667-47.78666667 48.24177778-15.47377778-38.00177778-38.45688889-72.47644445-67.47022222-101.48977778a304.56035555 304.56035555 0 0 0-100.23822222-67.584c16.04266667-16.04266667 31.744-31.51644445 48.128-47.78666667 72.47644445 36.75022222 131.18577778 96.02844445 167.36711111 168.84622223v-0.22755556zM392.76088889 798.72c-16.384 16.384-31.744 31.85777778-47.78666667 47.78666667-72.59022222-36.29511111-131.41333333-95.232-167.70844444-167.70844445 16.04266667-15.92888889 31.40266667-31.51644445 47.78666667-47.78666667 31.63022222 75.88977778 91.81866667 136.30577778 167.70844444 168.04977778v-0.34133333zM75.09333333 240.86755555c41.52888889-67.81155555 98.304-124.81422222 165.888-166.68444444 15.36 15.36 30.60622222 30.49244445 46.30755556 46.19377778-69.06311111 40.16355555-126.40711111 97.62133333-166.68444444 166.68444444-15.24622222-15.47377778-29.80977778-30.37866667-45.51111112-46.19377778z m660.48-121.05955555c15.70133333-15.70133333 30.60622222-30.60622222 45.62488889-45.85244445 68.608 41.52888889 126.06577778 98.98666667 167.70844445 167.36711112-15.36 15.13244445-30.26488889 30.15111111-45.96622222 45.73866666-40.39111111-69.17688889-98.07644445-126.74844445-167.36711112-167.25333333zM288.768 903.85066667c-15.70133333 15.36-30.60622222 30.37866667-46.30755555 46.08C174.30755555 907.94666667 116.96355555 850.60266667 75.09333333 782.56355555l45.96622222-46.08c40.61866667 69.29066667 98.41777778 126.976 167.70844445 167.36711112z m444.18844445 1.25155555c70.99733333-41.18755555 129.93422222-100.352 171.008-171.34933333 14.56355555 14.56355555 28.78577778 28.55822222 41.984 43.12177778 1.59288889 3.52711111 1.25155555 7.62311111-0.68266667 10.92266666-38.00177778 60.18844445-88.17777778 111.72977778-147.34222223 151.21066667-17.86311111 11.94666667-17.52177778 11.83288889-33.2231111-3.64088889-10.24-9.89866667-20.82133333-19.68355555-31.744-30.26488889zM417.22311111 512.11377778c-0.22755555-52.33777778 41.984-95.00444445 94.32177778-95.232 52.33777778-0.22755555 95.00444445 41.984 95.34577778 94.32177777s-41.984 95.00444445-94.32177778 95.232h-0.79644444c-51.88266667-0.79644445-93.63911111-42.43911111-94.54933334-94.32177777z" + fill="#08ffff" + p-id="48900" + ></path> + </svg> + </NIcon> + </div> + ), + }} + > + <span>显示/隐藏载荷</span> + </NPopover> + </> + ) + }, +}) diff --git a/src/views/Content/components/WidgetNav/components/Measure.jsx b/src/views/Content/components/WidgetNav/components/Measure.jsx index a04f89c7f..b20b16584 100644 --- a/src/views/Content/components/WidgetNav/components/Measure.jsx +++ b/src/views/Content/components/WidgetNav/components/Measure.jsx @@ -3,76 +3,53 @@ import { DistanceSurfaceMeasure, DistanceMeasure, AreaMeasure, -} from '@cesium-extends/measure' -import { useDrawer } from '@/hooks/draw' +} from 'cesium-extends' +import { useMeasure } from '@/hooks/measure' +// import { useDrawer } from '@/hooks/draw' let measure = null export default defineComponent({ setup() { const showMeasure = ref(false) - const distanceMeasure = () => { - if (!window.viewer) { - return - } + const { distanceMeasure, angleMeasure, clearMeasure } = useMeasure() - if (measure) { - measure.destroy() - measure = null - } - measure = new DistanceMeasure(window.viewer, { - units: 'kilometers', - drawerOptions: { - tips: { - init: '点击绘制', - start: '左键点击添加点,双击结束', - end: '', - }, - }, - onEnd: entity => { - console.log(entity) // 测量完成回调函数,返回测量结果 - }, - }) - console.log(measure) - // 开始绘制 - measure.start() - } + // const startDistanceMeasure = () => { + // if (!window.viewer) { + // return + // } - const draw = () => { - const { drawAreaFromType } = useDrawer() - drawAreaFromType('POLYGON', (entity, positions) => { - // drawnAreaEntities.push(entity) - console.log('画图完成', positions) - if (positions) { - const ellipsoid = viewer.scene.globe.ellipsoid - - const posList = positions.map(pos => { - const cartographic = Cesium.Cartographic.fromCartesian( - pos, - ellipsoid - ) - const latitude = Cesium.Math.toDegrees(cartographic.latitude) - const longitude = Cesium.Math.toDegrees(cartographic.longitude) - - return [longitude, latitude] - }) - // const area = polygon([[...posList, posList[0]]]) - - // const wkt = convertToWKT(area) - // wkt && (drawnArea.value = wkt) - } - }) - } + // if (measure) { + // measure.destroy() + // measure = null + // } + // measure = new DistanceMeasure(viewer, { + // units: 'kilometers', + // drawerOptions: { + // tips: { + // init: '点击绘制', + // start: '左键点击添加点,双击结束', + // end: '', + // }, + // }, + // // onEnd: entity => { + // // console.log(entity) // 测量完成回调函数,返回测量结果 + // // }, + // }) + // console.log(measure) + // // 开始绘制 + // measure.start() + // } return () => ( - <div className="relative"> + <div class="relative"> <NPopover trigger="hover" placement="bottom" v-slots={{ trigger: () => ( <div - class="btn-class" + class={`btn-class ${showMeasure.value ? 'checked' : ''}`} onClick={() => { showMeasure.value = !showMeasure.value }} @@ -103,8 +80,80 @@ export default defineComponent({ </NPopover> {showMeasure.value ? ( - <div className="corner-border absolute top-10 z-30 flex h-[200px] w-[150px] flex-wrap bg-[var(--color-bg)] p-2 "> - <NButton onClick={distanceMeasure}>距离量测</NButton> + <div class="corner-border absolute top-10 z-30 flex w-[150px] flex-col gap-2 bg-[var(--color-bg)] p-2 "> + <NButton + onClick={distanceMeasure} + v-slots={{ + icon: () => ( + <NIcon size="16"> + <svg + t="1736388786643" + class="icon" + viewBox="0 0 1024 1024" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + p-id="21752" + width="64" + height="64" + > + <path + d="M139.636364 139.636364m-93.090909 0a93.090909 93.090909 0 1 0 186.181818 0 93.090909 93.090909 0 1 0-186.181818 0Z" + p-id="21753" + ></path> + <path + d="M884.363636 884.363636m-93.090909 0a93.090909 93.090909 0 1 0 186.181818 0 93.090909 93.090909 0 1 0-186.181818 0Z" + p-id="21754" + ></path> + <path + d="M597.085091 756.037818l65.861818-65.861818c19.735273-19.735273 46.08-19.735273 65.815273 0 19.735273 19.781818 19.735273 46.08 0 65.861818l-65.815273 65.815273c-19.781818 19.735273-46.08 19.735273-65.861818 0-19.735273-19.735273-19.735273-46.08 0-65.815273zM498.362182 657.268364l65.815273-65.815273c19.781818-19.735273 46.08-19.735273 65.861818 0 19.735273 19.735273 19.735273 46.08 0 65.815273l-65.861818 65.861818c-19.735273 19.735273-46.08 19.735273-65.815273 0-19.735273-19.781818-19.735273-46.08 0-65.861818zM399.639273 558.545455L465.454545 492.730182c19.735273-19.735273 46.08-19.735273 65.815273 0 19.735273 19.735273 19.735273 46.08 0 65.815273L465.454545 624.360727c-19.735273 19.735273-46.08 19.735273-65.815272 0-19.735273-19.735273-19.735273-46.08 0-65.815272zM300.869818 459.822545L366.778182 393.960727c19.735273-19.735273 46.08-19.735273 65.815273 0 19.735273 19.781818 19.735273 46.08 0 65.861818l-65.815273 65.815273c-19.781818 19.735273-46.08 19.735273-65.861818 0-19.735273-19.735273-19.735273-46.08 0-65.815273zM202.146909 361.053091l65.815273-65.815273c19.781818-19.735273 46.08-19.735273 65.861818 0 19.735273 19.735273 19.735273 46.08 0 65.815273L267.962182 426.914909c-19.735273 19.735273-46.08 19.735273-65.815273 0-19.735273-19.781818-19.735273-46.08 0-65.861818z" + p-id="21755" + class="custom-cursor-on-hover" + ></path> + <path + d="M768 814.545455c-13.963636 0-23.272727-4.654545-32.581818-13.963637l-512-512c-18.618182-18.618182-18.618182-46.545455 0-65.163636s46.545455-18.618182 65.163636 0l512 512c18.618182 18.618182 18.618182 46.545455 0 65.163636-9.309091 9.309091-18.618182 13.963636-32.581818 13.963637z" + p-id="21756" + ></path> + </svg> + </NIcon> + ), + }} + > + 距离量测 + </NButton> + <NButton + class="tracking-widest" + onClick={angleMeasure} + v-slots={{ + icon: () => ( + <NIcon size="16"> + <svg + t="1736402972392" + class="icon" + viewBox="0 0 1024 1024" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + p-id="27422" + width="64" + height="64" + > + <path + d="M770.875554 410.893474L213.334501 968.596211a30.342737 30.342737 0 0 0 42.900211 42.90021L813.775764 453.793684a30.342737 30.342737 0 0 0-42.90021-42.90021zM247.395975 290.115368v647.060211c0 14.821053 13.527579 26.785684 30.288842 26.785684 16.761263 0 30.342737-11.964632 30.342737-26.785684V290.115368c0-14.821053-13.581474-26.785684-30.342737-26.785684-16.707368 0-30.288842 11.964632-30.288842 26.785684z m8.838737-13.096421l85.584842 85.584842a30.342737 30.342737 0 0 0 42.90021-42.846315L299.134922 234.118737a30.342737 30.342737 0 0 0-42.90021 42.90021z m0-42.792421L170.595975 319.811368a30.342737 30.342737 0 0 0 42.90021 42.900211L299.134922 277.126737a30.342737 30.342737 0 0 0-42.90021-42.900211z" + p-id="27423" + ></path> + <path + d="M427.512185 589.770105c-59.661474-25.061053-118.837895-10.24-119.484631-10.13221v-44.032a231.855158 231.855158 0 0 1 140.126315 13.743158c60.038737 24.414316 95.393684 83.105684 97.38779 85.854315a950.703158 950.703158 0 0 1-29.642105 30.612211c-24.468211-36.648421-53.894737-61.978947-88.387369-75.991579zM229.179554 199.68V108.328421L309.913869 199.68h62.787369v-188.631579H309.913869v119.269053L228.694501 11.048421H166.553869v188.631579z" + p-id="27424" + ></path> + </svg> + </NIcon> + ), + }} + > + 方 位 角 + </NButton> + <NButton quaternary type="warning" onClick={clearMeasure}> + 清除所有绘制结果 + </NButton> </div> ) : null} </div> diff --git a/src/views/Content/components/WidgetNav/components/ModelChange.jsx b/src/views/Content/components/WidgetNav/components/ModelChange.jsx index a6d4082c5..f9c1d2a08 100644 --- a/src/views/Content/components/WidgetNav/components/ModelChange.jsx +++ b/src/views/Content/components/WidgetNav/components/ModelChange.jsx @@ -1,6 +1,8 @@ import { NIcon, NPopover } from 'naive-ui' +import { useEntity } from '@/hooks/entity' export default defineComponent({ setup() { + const { changeIconOrModel } = useEntity() return () => ( <> <NPopover @@ -8,7 +10,7 @@ export default defineComponent({ placement="bottom" v-slots={{ trigger: () => ( - <div className="btn-class"> + <div class="btn-class" onClick={changeIconOrModel}> <NIcon size="16"> <svg t="1735872041567" diff --git a/src/views/Content/components/WidgetNav/components/HisTraj.jsx b/src/views/Content/components/WidgetNav/components/MultiHisTraj.jsx similarity index 76% rename from src/views/Content/components/WidgetNav/components/HisTraj.jsx rename to src/views/Content/components/WidgetNav/components/MultiHisTraj.jsx index 42be8cb4e..f451cc4e7 100644 --- a/src/views/Content/components/WidgetNav/components/HisTraj.jsx +++ b/src/views/Content/components/WidgetNav/components/MultiHisTraj.jsx @@ -1,6 +1,15 @@ import { NIcon, NPopover } from 'naive-ui' +import { useMultiMBTrajectory } from '@/views/Mubiao/components/MultiHisTrajectory/hooks/multiMbTraj' + export default defineComponent({ setup() { + const { showMultiHisTrajCom, showOrHideMultiHisTraj } = + useMultiMBTrajectory() + + // const handleClick = () => { + // showMultiHisTrajCom.value = !showMultiHisTrajCom.value + // } + return () => ( <> <NPopover @@ -8,7 +17,12 @@ export default defineComponent({ placement="bottom" v-slots={{ trigger: () => ( - <div className="btn-class"> + <div + class={`btn-class ${ + showMultiHisTrajCom.value ? 'checked' : '' + }`} + onClick={showOrHideMultiHisTraj} + > <NIcon size="16"> <svg t="1735629048129" diff --git a/src/views/Content/components/WidgetNav/components/TrajSet.jsx b/src/views/Content/components/WidgetNav/components/TrajSet.jsx new file mode 100644 index 000000000..35e939eea --- /dev/null +++ b/src/views/Content/components/WidgetNav/components/TrajSet.jsx @@ -0,0 +1,91 @@ +import { NIcon, NPopover, NButton, NSwitch, NInputNumber } from 'naive-ui' +import { useMBCurTrajctory } from '@/views/Mubiao/components/CurTrajectory/mbCurTraj' +export default defineComponent({ + setup() { + const { showTrajHour, getCurTraj, removeAllCurTraj } = useMBCurTrajctory() + const showTrajSet = ref(false) + // const showTrajHour = ref(0) + + const showOrHideTraj = show => { + // console.log(value, 'showOrHideTraj') + // if (show) { + // showTrajHour.value > 0 && getCurTraj() + // } else { + // removeAllCurTraj() + // } + } + + return () => ( + <div class="text-sm"> + <NPopover + trigger="hover" + placement="bottom" + v-slots={{ + trigger: () => ( + <div + class={`btn-class ${showTrajSet.value ? 'checked' : ''}`} + onClick={() => { + showTrajSet.value = !showTrajSet.value + }} + > + <NIcon size="14"> + <svg + t="1736143644797" + class="icon" + viewBox="0 0 1024 1024" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + p-id="30390" + width="64" + height="64" + > + <path + d="M845.198037 1023.601778c66.559963 0 121.628377-53.077304 121.628377-120.206155 0-67.18574-55.068414-120.206155-121.628377-120.206156H178.346852c-25.031097 0-43.918198-18.318212-43.918198-39.3102 0-20.878211 18.887101-39.367089 43.918198-39.36709h138.183034a39.651534 39.651534 0 0 0 38.798201-40.334199c-0.512-22.869321-17.863101-41.073755-38.798201-40.504867H178.346852c-66.503074 0-121.628377 53.077304-121.628377 120.206156 0 67.18574 55.125303 120.149267 121.628377 120.149266h666.737407c24.974208 0 44.088864 18.375101 44.088865 39.36709 0 20.878211-19.057767 39.367089-44.088865 39.367089H288.938791c-20.991988-0.512-38.34309 17.521768-38.85509 40.3342 0 22.300432 17.40799 40.504866 38.85509 40.504866h556.259246zM548.35198 0.000569c-140.799922-0.341333-254.862081 118.271934-255.203414 264.703853 0 108.714606 141.141255 312.035382 213.845215 409.144661a54.044414 54.044414 0 0 0 78.279067 5.00622l4.721775-5.00622c72.590182-97.109279 213.902103-299.918056 213.902104-409.144661C803.441616 118.272503 689.20879-0.170098 548.35198 0.000569z m0 414.264659a140.117255 140.117255 0 0 1-101.0915-43.576865 151.32436 151.32436 0 0 1-41.870199-105.187497c0-39.423978 14.961769-77.255068 41.870199-105.07372a139.605256 139.605256 0 0 1 101.0915-43.29242c77.880846 1.365333 140.344811 67.527074 140.344811 148.650584 0 80.952844-62.463965 147.057696-140.344811 148.479918z" + fill="#08ffff" + p-id="30391" + ></path> + </svg> + </NIcon> + </div> + ), + }} + > + <span>航迹配置</span> + </NPopover> + {showTrajSet.value ? ( + <div class="corner-border absolute top-10 z-30 flex w-[150px] flex-col gap-2 bg-[var(--color-bg)] p-2"> + <div>轨迹时长</div> + <div class="flex items-center gap-2"> + <NInputNumber + class="flex-1" + v-model:value={showTrajHour.value} + size="small" + ></NInputNumber> + <div class="w-[30px]">小时</div> + </div> + <div class="flex gap-2"> + <NButton + type="primary" + size="small" + onClick={showOrHideTraj(true)} + > + 确定 + </NButton> + <NButton size="small" onClick={showOrHideTraj(false)}> + 关闭航迹 + </NButton> + {/* <NSwitch + // rail-style="railStyle" + v-slots={{ + checked: () => <span class="text-xs">显示航迹</span>, + unchecked: () => <span class="text-xs">关闭航迹</span>, + }} + onUpdate:value={showOrHideTraj} + ></NSwitch> */} + </div> + </div> + ) : null} + </div> + ) + }, +}) diff --git a/src/views/Content/components/WidgetNav/components/UnderPoint.jsx b/src/views/Content/components/WidgetNav/components/UnderPoint.jsx new file mode 100644 index 000000000..2b5e3efe0 --- /dev/null +++ b/src/views/Content/components/WidgetNav/components/UnderPoint.jsx @@ -0,0 +1,49 @@ +import { NIcon, NPopover } from 'naive-ui' +import { useEntity } from '@/hooks/entity' +export default defineComponent({ + setup() { + const { satelliteMap } = useEntity() + + const show = ref(false) + const showPointUnderSatellite = () => { + show.value = !show.value + ;[...satelliteMap.values()].forEach(satellite => { + satellite.underPoint = show.value + }) + } + return () => ( + <> + <NPopover + trigger="hover" + placement="bottom" + v-slots={{ + trigger: () => ( + <div class="btn-class" onClick={showPointUnderSatellite}> + <NIcon size="15"> + <svg + t="1736493475776" + class="icon" + viewBox="0 0 1024 1024" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + p-id="50171" + width="64" + height="64" + > + <path + d="M731.605333 747.562667a60.373333 60.373333 0 1 0-0.128 120.746666 60.373333 60.373333 0 0 0 0.128-120.789333v0.042667zM510.592 0C229.162667 0 0 228.906667 0 510.336s228.906667 510.421333 510.549333 510.421333c7.68 0 15.018667 0.810667 22.826667 0.469334a304.554667 304.554667 0 0 1-87.68-71.509334c-56.405333-30.890667-105.216-94.72-136.917333-188.757333h68.096s1.493333-46.933333 3.968-46.933333H294.997333a878.634667 878.634667 0 0 1-22.826666-140.8h167.04c10.922667-22.613333 19.84-36.394667 31.232-47.018667H270.08s-0.512-12.373333-0.512-17.493333c0-58.965333 6.4-123.264 17.792-170.325334h188.330667v183.466667c11.648-9.173333 25.770667-16.384 46.933333-25.258667V338.346667h210.901333c8.192 46.976 12.672 78.677333 15.061334 119.253333 16.085333 3.712 31.658667 7.424 46.677333 13.909333a943.232 943.232 0 0 0-14.506667-133.162666h141.312c21.290667 46.976 33.152 110.933333 33.152 170.282666 0 5.333333-0.426667 17.578667-0.768 17.578667h-76.245333c15.786667 0 30.165333 46.933333 42.794667 46.933333h29.568c-1.706667 0-3.754667 22.613333-6.144 34.261334 17.749333 31.658667 29.952 66.56 35.626666 103.978666 27.178667-63.317333 41.173333-131.541333 41.088-200.448C1021.141333 229.205333 791.893333 0 510.549333 0zM65.621333 508.501333c0-59.434667 11.861333-123.221333 33.194667-170.325333h141.312c-10.368 47.018667-16.256 111.146667-16.256 170.325333 0 5.248 0.213333 17.578667 0.426667 17.578667H66.304s-0.64-12.330667-0.64-17.493333v-0.085334z m4.693334 64.64h155.648c3.2 46.976 10.24 94.037333 20.565333 140.8H113.152a525.226667 525.226667 0 0 1-42.794667-140.8z m276.650666 356.778667c-85.418667-33.834667-157.653333-121.984-207.573333-169.045333h120.021333c21.205333 47.061333 51.157333 125.482667 87.552 169.045333zM250.624 291.2H120.746667C170.410667 197.248 250.410667 130.261333 346.88 91.733333 305.408 141.653333 271.957333 197.205333 250.624 291.242667z m225.024 0h-176.64c32.341333-93.994667 88.106667-192.725333 154.197333-224.170667 7.68-1.066667 22.613333 1.024 22.613334 0.426667v223.786667h-0.170667z m47.018667 0v-224.853333c0 0.426667 30.208-1.28 44.8 0.768 66.090667 31.744 122.154667 130.432 154.453333 224.213333h-199.253333v-0.085333z m247.765333 0c-21.546667-93.994667-54.613333-149.589333-96.298667-199.466667 96.554667 38.314667 176.682667 105.472 226.133334 199.509334h-129.834667z m-294.784 235.690667v-5.290667c-1.706667 1.792-3.712 3.541333-5.461333 5.290667h5.461333z m208.853333-6.186667a240.384 240.384 0 0 0-240.512 240.512 240.384 240.384 0 0 0 240.512 240.512 240.384 240.384 0 0 0 240.554667-240.512 240.384 240.384 0 0 0-240.64-240.512h0.085333z m197.973334 310.058667H825.6a96.938667 96.938667 0 0 1-70.741333 71.210666h2.730666v58.666667h-46.976V902.826667a97.578667 97.578667 0 0 1-73.301333-72.106667h-106.88v-46.933333h107.562667a97.365333 97.365333 0 0 1 72.704-70.570667V619.946667h47.018666v94.08h-2.773333c34.56 8.533333 61.653333 35.328 70.570667 69.76h57.472v46.933333h-0.469334v0.085333z" + fill="#08ffff" + p-id="50172" + ></path> + </svg> + </NIcon> + </div> + ), + }} + > + <span>显示/隐藏星下点</span> + </NPopover> + </> + ) + }, +}) diff --git a/src/views/Content/components/WidgetNav/index.jsx b/src/views/Content/components/WidgetNav/index.jsx index 212b1f27b..5e83f59a8 100644 --- a/src/views/Content/components/WidgetNav/index.jsx +++ b/src/views/Content/components/WidgetNav/index.jsx @@ -1,10 +1,13 @@ import { NIcon, NPopover } from 'naive-ui' import { useWeather } from '../../../Weather/hooks/weather' import BaseMap from './components/BaseMap' -import HisTraj from './components/HisTraj' +import MultiHisTraj from './components/MultiHisTraj' import Measure from './components/Measure' import ModelChange from './components/ModelChange' import HomeView from './components/HomeView' +import TrajSet from './components/TrajSet' +import LoadShow from './components/LoadShow' +import UnderPoint from './components/UnderPoint' import '@/styles/nav.scss' @@ -25,7 +28,10 @@ export default defineComponent({ } return () => ( <div class="z-30 flex justify-between gap-2"> - <HisTraj /> + <TrajSet /> + <MultiHisTraj /> + <LoadShow /> + <UnderPoint /> <ModelChange /> <Measure /> <NPopover @@ -143,7 +149,7 @@ export default defineComponent({ placement="bottom" v-slots={{ trigger: () => ( - <div className="btn-class"> + <div class="btn-class"> <NIcon size="20"> <svg t="1735612937858" diff --git a/src/views/Content/index.vue b/src/views/Content/index.vue index a7b9a943c..5a9a93516 100644 --- a/src/views/Content/index.vue +++ b/src/views/Content/index.vue @@ -11,13 +11,17 @@ import HisImages from '../BaseMB/components/HisImages/index.vue' import Hangjing from '../Hangjing/index.vue' import Mubiao from '../Mubiao/index.vue' import MubiaoHisTrajectory from '../Mubiao/components/HisTrajectory/index.vue' +import MultiHisTrajectory from '../Mubiao/components/MultiHisTrajectory/index.vue' import YsHangjing from '../YsHangjing/index.vue' + +import TextMessage from '../TextReport/components/Message' // import HeatMap from '../Mubiao/components/HeatMap/index.vue' // import TextDetailModal from '../TextReport/components/DetailsModal/index.vue' import { useTextReport } from '../TextReport/hooks/text' import { useHisImage } from '../BaseMB/components/HisImages/hooks/hisImage' import { useMBTrajectory } from '../Mubiao/components/HisTrajectory/hooks/mbTraj' +import { useMultiMBTrajectory } from '../Mubiao/components/MultiHisTrajectory/hooks/multiMbTraj' // import { useWeather } from '../Weather/hooks/weather' import DetailsModal from './components/DetailsModal/index.vue' @@ -25,6 +29,7 @@ const { getTextConfigs, initWebSocket } = useTextReport() const { showHisImageCom } = useHisImage() const { showHisTrajCom } = useMBTrajectory() +const { showMultiHisTrajCom } = useMultiMBTrajectory() const getConfig = async () => { const res = await getTextConfigs() // console.log(res) @@ -49,7 +54,7 @@ const types = [ { name: 'XW', value: 'wzbXw' }, ] -const showPanelName = ref(null) +const showPanelName = ref('wx') const panelList = [ // { @@ -73,8 +78,8 @@ const panelList = [ name: '卫星', }, { - id: 'hj-1', - value: 'hj-1', + id: 'hj-2', + value: 'hj-2', name: '航景', }, ] @@ -213,12 +218,17 @@ const showOrHideTextReport = () => { </div> --> </div> </div> - <div class="absolute bottom-0 w-full"> + <div class="absolute bottom-0 flex h-full w-full flex-col justify-end"> + <text-message class="absolute z-30 h-[200px]"></text-message> <mubiao-his-trajectory v-if="showHisTrajCom" - class="z-20 h-[260px]" + class="z-30 h-[260px]" ></mubiao-his-trajectory> - <his-images v-if="showHisImageCom" class="z-20 h-[260px]"></his-images> + <multi-his-trajectory + v-if="showMultiHisTrajCom" + class="z-30 h-[260px]" + ></multi-his-trajectory> + <his-images v-if="showHisImageCom" class="z-30 h-[260px]"></his-images> </div> <details-modal></details-modal> </div> diff --git a/src/views/Earth/components/Popup/index.js b/src/views/Earth/components/Popup/index.js index eedbef1af..5c33f7c41 100644 --- a/src/views/Earth/components/Popup/index.js +++ b/src/views/Earth/components/Popup/index.js @@ -67,7 +67,8 @@ export default class Dialog { let windowPosition = new Cesium.Cartesian2() // console.log(Cesium.SceneTransforms, 'Cesium.SceneTransforms') // 将WGS84 经纬度坐标转换成屏幕坐标。 - Cesium.SceneTransforms.wgs84ToWindowCoordinates( + // wgs84ToWindowCoordinates + Cesium.SceneTransforms.worldToWindowCoordinates( this.viewer.scene, this.entity ? this.entity.position?._value : this.position, windowPosition @@ -117,6 +118,7 @@ export default class Dialog { windowClose() { if (this.vmInstance) { this.vmInstance.$el.remove() + parentNode.remove() } this.viewer.scene.postRender.removeEventListener(this.postRender, this) //移除事件监听 } diff --git a/src/views/Earth/components/Popup/index.vue b/src/views/Earth/components/Popup/index.vue index 5e6af42fc..5ce31fdfa 100644 --- a/src/views/Earth/components/Popup/index.vue +++ b/src/views/Earth/components/Popup/index.vue @@ -1,8 +1,8 @@ <script setup lang="ts"> -import type { GlobalThemeOverrides } from 'naive-ui' import { darkTheme, zhCN, dateZhCN } from 'naive-ui' import { CloseCircle } from '@vicons/ionicons5' import { useDraggable } from '@vueuse/core' +import { themeOverrides } from '@/styles/naiveConfig' const popup = ref<HTMLElement | null>(null) const { x, y, style } = useDraggable(popup, { @@ -51,19 +51,6 @@ const calculatePosition = (deltaX: number, deltaY: number) => { pine.value.style.bottom = `${popupBottom.value}px` } -const themeOverrides: GlobalThemeOverrides = { - common: { - primaryColor: '#48a8f5', - primaryColorPressed: '#3771e1', - fontSize: '16px', - }, - DataTable: { - thColor: '#257bb5', - tdColor: '#0000', - tdColorStriped: 'rgba(37,123,181,0.3)', - tdColorHover: 'rgba(37,123,181,0.6)', - }, -} const props = defineProps({ title: { type: String, @@ -144,10 +131,11 @@ const closeClick = () => { width: 200px; height: 163px; border-radius: 20px 0px 20px 0px; - border: 1px solid #38e1ff; - background-color: #38e1ff4a; - box-shadow: 0 0 5px 1px #29baf1; - animation: slide 0.5s; + // border: 1px solid #38e1ff; + border: 1px solid #149ce0; + background-color: var(--color-bg); + box-shadow: 0 0 3px 1px #29baf1; + // animation: slide 0.5s; } .box-wrap .area { @@ -160,9 +148,10 @@ const closeClick = () => { right: 0; width: 100%; height: 30px; - background-image: linear-gradient(to left, #4cdef9, #4cdef96b); + // background-image: linear-gradient(to left, #4cdef9, #4cdef96b); + background-image: linear-gradient(to left, #1681b6, #1681b66b); border-radius: 20px 0px 0px 0px; - animation: area 1s; + animation: area 0.3s; } .pine { @@ -174,7 +163,8 @@ const closeClick = () => { // top: 162px; height: 1px; box-sizing: border-box; - border-bottom: 1px solid #38e1ff; + // border-bottom: 1px solid #38e1ff; + border-bottom: 1px solid #149ce0; // border-bottom: 1px solid red; transform-origin: left top; // transform: rotate(-45deg); diff --git a/src/views/Earth/index.vue b/src/views/Earth/index.vue index bacc6dc95..94119d3f2 100644 --- a/src/views/Earth/index.vue +++ b/src/views/Earth/index.vue @@ -4,7 +4,7 @@ import { MouseTooltip } from '@cesium-extends/tooltip' // const { addBaseFacilities } = useBase() -onMounted(() => { +onMounted(async () => { window.viewer = new Cesium.Viewer('earth-container', { selectionIndicator: false, animation: false, @@ -19,21 +19,27 @@ onMounted(() => { imageryProvider: false, }) + // viewer.scene.skyAtmosphere.show = false + // viewer.scene.fog.enable = true + // viewer.scene.globe.enableLighting = false - viewer.imageryLayers.addImageryProvider( - new Cesium.UrlTemplateImageryProvider({ - // url: 'http://192.168.10.201:2022/api/maptilecache/service/tms/1.0.0/img_globle1to9-PNG-4326@EPSG:4326@png/{z}/{x}/{reverseY}.png', - // url: 'js/Cesium/Assets/Textures/NaturalEarthII/{z}/{x}/{reverseY}.jpg', - url: './resources/map/{z}/{x}/{y}.jpg', - // tilingScheme: new Cesium.GeographicTilingScheme(), - tilingScheme: new Cesium.WebMercatorTilingScheme(), - }) - ) + // viewer.imageryLayers.addImageryProvider( + // new Cesium.UrlTemplateImageryProvider({ + // // url: 'http://192.168.10.201:2022/api/maptilecache/service/tms/1.0.0/img_globle1to9-PNG-4326@EPSG:4326@png/{z}/{x}/{reverseY}.png', + // // url: 'js/Cesium/Assets/Textures/NaturalEarthII/{z}/{x}/{reverseY}.jpg', + // // url: './resources/map/{z}/{x}/{y}.jpg', + // url: 'https://rt2.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=4&scene=0&version=347', + // // tilingScheme: new Cesium.GeographicTilingScheme(), + // tilingScheme: new Cesium.WebMercatorTilingScheme(), + // }) + // ) + viewer.scene.debugShowFramesPerSecond = true viewer.camera.setView({ destination: Cesium.Cartesian3.fromDegrees(117.48, 30.67, 18000000.0), }) viewer.clock.shouldAnimate = true + viewer.shadows = false // viewer.scene.globe.enableLighting = true if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) { @@ -42,17 +48,40 @@ onMounted(() => { } // 开启抗锯齿 + // viewer.scene.fxaa = true viewer.scene.postProcessStages.fxaa.enabled = true viewer.scene.skyBox = new Cesium.SkyBox({ sources: { - positiveX: 'GV/resources/theme/skyBox/PositiveX.jpg', - negativeX: 'GV/resources/theme/skyBox/NegativeX.jpg', - positiveY: 'GV/resources/theme/skyBox/PositiveY.jpg', - negativeY: 'GV/resources/theme/skyBox/NegativeY.jpg', - positiveZ: 'GV/resources/theme/skyBox/PositiveZ.jpg', - negativeZ: 'GV/resources/theme/skyBox/NegativeZ.jpg', + // positiveX: 'GV/resources/theme/skyBox/PositiveX.jpg', + // negativeX: 'GV/resources/theme/skyBox/NegativeX.jpg', + // positiveY: 'GV/resources/theme/skyBox/PositiveY.jpg', + // negativeY: 'GV/resources/theme/skyBox/NegativeY.jpg', + // positiveZ: 'GV/resources/theme/skyBox/PositiveZ.jpg', + // negativeZ: 'GV/resources/theme/skyBox/NegativeZ.jpg', + positiveX: './images/skybox/skyCube2k_px.jpg', + negativeX: './images/skybox/skyCube2k_mx.jpg', + positiveY: './images/skybox/skyCube2k_py.jpg', + negativeY: './images/skybox/skyCube2k_my.jpg', + positiveZ: './images/skybox/skyCube2k_pz.jpg', + negativeZ: './images/skybox/skyCube2k_mz.jpg', }, }) + + // viewer.terrainProvider = new Cesium.CesiumTerrainProvider({ + // // url: 'http://192.168.10.201:2022/api/maptilecache/service/terrain/taiwan-HeightMap-4326', + // // url: Cesium.IonResource.fromAssetId(3956), + // url: 'http://data.marsgis.cn/terrain', + // // requestVertexNormals: true, + // // requestWaterMask: true, + // }) + + viewer.terrainProvider = await Cesium.CesiumTerrainProvider.fromUrl( + 'http://192.168.10.201:2022/api/maptilecache/service/terrain/taiwan-HeightMap-4326', + { + requestVertexNormals: true, + requestWaterMask: true, + } + ) // viewer.scene.globe.depthTestAgainstTerrain = true // setTimeout(() => { // const tooltip = new MouseTooltip(window.viewer, { diff --git a/src/views/Gantt/components/TaskList/components/NewTask/index.jsx b/src/views/Gantt/components/TaskList/components/NewTask/index.jsx index 36875147d..ac920029f 100644 --- a/src/views/Gantt/components/TaskList/components/NewTask/index.jsx +++ b/src/views/Gantt/components/TaskList/components/NewTask/index.jsx @@ -10,6 +10,10 @@ export default defineComponent({ // }, // }, setup() { + const checkedRowKeys = ref([]) + watch(checkedRowKeys, newval => { + console.log(newval, '-----') + }) const task = ref({ name: '', description: '', @@ -82,6 +86,7 @@ export default defineComponent({ </NFormItem> <NFormItem label="事件" path="event"> <NDataTable + v-model:checked-row-keys={checkedRowKeys.value} class="h-[400px]" flex-height columns={columns} diff --git a/src/views/Hangjing/hooks/hangjingPolygon.ts b/src/views/Hangjing/hooks/hangjingPolygon.ts index 5477ac3b6..97bc427e5 100644 --- a/src/views/Hangjing/hooks/hangjingPolygon.ts +++ b/src/views/Hangjing/hooks/hangjingPolygon.ts @@ -1,4 +1,4 @@ -import Subscriber from '@cesium-extends/subscriber' +import { Subscriber } from 'cesium-extends' import chroma from 'chroma-js' import { parseWKT } from '@/utils/parseWKT' import { difference } from 'lodash' @@ -83,6 +83,8 @@ export const useHjPolygon = (polygonMap: Map<string | number, any>) => { }) const centerPoint = centerOfMass(feature).geometry.coordinates + + const centerEntity = addPolygonCenter(centerPoint) addEventSub({ parentId, id, @@ -95,6 +97,7 @@ export const useHjPolygon = (polygonMap: Map<string | number, any>) => { } else { polygonMap.set(parentId, [polygon]) } + polygonMap.get(parentId).push(centerEntity) } else { polygonMap.set(id, polygon) } @@ -102,6 +105,17 @@ export const useHjPolygon = (polygonMap: Map<string | number, any>) => { // console.log(polygonMap, 'polygonMap') } + function addPolygonCenter(centerPoint: number[]) { + return viewer.entities.add({ + show: false, + position: Cesium.Cartesian3.fromDegrees(...centerPoint), + point: { + pixelSize: 10, + color: Cesium.Color.RED, + }, + }) + } + function addPrimitivePolygon({ id, position, @@ -135,10 +149,15 @@ export const useHjPolygon = (polygonMap: Map<string | number, any>) => { return viewer.entities.add({ id, + polyline: { + positions: position, + width: 1, + material: Cesium.Color.RED, + }, polygon: { hierarchy: new Cesium.PolygonHierarchy(position), - // material: Cesium.Color.fromCssColorString(color), - material: polygonMaterial(color), + material: Cesium.Color.fromCssColorString(color), + // material: polygonMaterial(color), // material: polygonGradient(color), // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, }, diff --git a/src/views/Hangjing/hooks/hangjingPopup.ts b/src/views/Hangjing/hooks/hangjingPopup.ts index 1715e85d2..05788b343 100644 --- a/src/views/Hangjing/hooks/hangjingPopup.ts +++ b/src/views/Hangjing/hooks/hangjingPopup.ts @@ -30,6 +30,7 @@ function createPopup( return h('div', { class: 'truncate' }, `${key}: ${hjData[key]}`) }) ), + slotFooter: generateFooters(hjData), closeEvent: function () { if (popupMap.has(id)) { popupMap.get(id).windowClose() @@ -40,3 +41,13 @@ function createPopup( const popup = new Popup(opts) popupMap.set(id, popup) } + +function generateFooters(mbData: Record<string, any>) { + return h('div', { class: 'flex gap-1 justify-end' }, [ + h( + NButton, + { size: 'tiny', onClick: () => showCenterPoint(mbData) }, + { default: () => '显示中心点' } + ), + ]) +} diff --git a/src/views/Hangjing/hooks/hangjingStyle.ts b/src/views/Hangjing/hooks/hangjingStyle.ts new file mode 100644 index 000000000..d58ff56bf --- /dev/null +++ b/src/views/Hangjing/hooks/hangjingStyle.ts @@ -0,0 +1,177 @@ +import { h, defineComponent } from 'vue' +import { + NForm, + NFormItem, + NInput, + NColorPicker, + NSelect, + NInputNumber, + NButton, +} from 'naive-ui' +import { useModal } from '@/views/Content/hooks/modal' +const { openDetailsModal } = useModal() + +const styleForm = ref({ + fontFamily: '微软雅黑', + fontSize: 14, + textColor: 'rgba(255,255,0,1)', + polygonColor: 'rgba(255,0,0,0.3)', + lineColor: 'rgba(255,0,0,1)', + lineWidth: 1, + lineType: 'solid', +}) +export const useHangjingStyle = () => { + return { showStyleModal } +} + +function renderStyleContent(data: Record<string, any>) { + // return defineComponent({ + // render() { + // return `<> + // <NButton>ceshi</NButton> + // </>` + // }, + // }) + return h('div', { class: 'flex flex-col gap-2 pt-4' }, [ + h( + NForm, + { + model: styleForm.value, + labelPlacement: 'left', + //labelWidth: 100, + rules: { + fontFamily: [{ required: true, message: '请选择文字字体' }], + fontSize: [{ required: true, message: '请选择文字大小' }], + textColor: [{ required: true, message: '请选择文字颜色' }], + polygonColor: [{ required: true, message: '请选择区域颜色' }], + lineColor: [{ required: true, message: '请选择边框颜色' }], + lineType: [{ required: true, message: '请选择边框类型' }], + lineWidth: [{ required: true, message: '请选择边框宽度' }], + }, + }, + { + default: () => [ + h( + NFormItem, + { label: '文字字体', path: 'fontFamily' }, + { + default: () => + h(NSelect, { + value: styleForm.value.fontFamily, + ['onUpdate:value']: value => { + styleForm.value.fontFamily = value + }, + options: [ + { label: '微软雅黑', value: '微软雅黑' }, + { label: '楷体', value: '楷体' }, + { label: '宋体', value: '宋体' }, + ], + }), + } + ), + h( + NFormItem, + { label: '文字大小', path: 'fontSize', max: 30, min: 12 }, + { + default: () => + h(NInputNumber, { + value: styleForm.value.fontSize, + ['onUpdate:value']: value => { + styleForm.value.fontSize = value + }, + }), + } + ), + h( + NFormItem, + { label: '文字颜色', path: 'textColor' }, + { + default: () => + h(NColorPicker, { + value: styleForm.value.textColor, + ['onUpdate:value']: value => { + styleForm.value.textColor = value + }, + }), + } + ), + h( + NFormItem, + { label: '区域颜色', path: 'polygonColor' }, + { + default: () => + h(NColorPicker, { + value: styleForm.value.polygonColor, + ['onUpdate:value']: value => { + styleForm.value.polygonColor = value + }, + }), + } + ), + h( + NFormItem, + { label: '边框类型', path: 'lineType' }, + { + default: () => + h(NSelect, { + value: styleForm.value.lineType, + ['onUpdate:value']: value => { + styleForm.value.lineType = value + }, + options: [ + { label: '实线', value: 'solid' }, + { label: '虚线', value: 'dashed' }, + ], + }), + } + ), + h( + NFormItem, + { label: '边框宽度', path: 'lineWidth', max: 10, min: 1 }, + { + default: () => + h(NInputNumber, { + value: styleForm.value.lineWidth, + ['onUpdate:value']: value => { + styleForm.value.lineWidth = value + }, + }), + } + ), + h( + NFormItem, + { label: '边框颜色', path: 'lineColor' }, + { + default: () => + h(NColorPicker, { + value: styleForm.value.lineColor, + ['onUpdate:value']: value => { + styleForm.value.lineColor = value + }, + }), + } + ), + ], + } + ), + h('div', { class: 'flex justify-end gap-2' }, [ + h( + NButton, + { type: 'primary', onClick: () => updateStyle() }, + { default: () => '确定' } + ), + h(NButton, { onClick: () => updateStyle() }, { default: () => '取消' }), + ]), + ]) +} + +function showStyleModal(title: string, data: Record<string, any>) { + openDetailsModal({ + titleString: title, + contentSlot: renderStyleContent(data), + }) +} + +function updateStyle() { + // TODO: 更新样式 +} diff --git a/src/views/Hangjing/index.vue b/src/views/Hangjing/index.vue index e09ebf1dd..f77762a26 100644 --- a/src/views/Hangjing/index.vue +++ b/src/views/Hangjing/index.vue @@ -3,12 +3,13 @@ import { h } from 'vue' import { polygon } from '@turf/turf' import type { DataTableRowKey } from 'naive-ui' import { NButton } from 'naive-ui' -import { useDrawer } from '@/hooks/draw' +// import { useDrawer } from '@/hooks/draw' import type { TType } from '@/hooks/draw' import { getHangjing } from '@/api/Hangjing' import { useHangjing } from './hooks/hangjing' import { convertToWKT } from '@/utils/parseWKT' import { useHangjingDetail } from './hooks/hangjingDetail' +import { useHangjingStyle } from './hooks/hangjingStyle' const { addHangjing } = useHangjing() @@ -100,6 +101,7 @@ const drawArea = () => { } const { showDetailsModal } = useHangjingDetail() +const { showStyleModal } = useHangjingStyle() const columns = [ { type: 'selection', @@ -119,16 +121,28 @@ const columns = [ title: 'Action', key: 'actions', render(row) { - return h( - NButton, - { - strong: true, - tertiary: true, - size: 'small', - onClick: () => showDetailsModal(`${row.title}详情`, row), - }, - { default: () => '详情' } - ) + return h('div', { class: 'flex gap-2' }, [ + h( + NButton, + { + strong: true, + tertiary: true, + size: 'small', + onClick: () => showDetailsModal(`${row.title}详情`, row), + }, + { default: () => '详情' } + ), + h( + NButton, + { + strong: true, + tertiary: true, + size: 'small', + onClick: () => showStyleModal(`${row.title}样式配置`, row), + }, + { default: () => '样式配置' } + ), + ]) }, }, ] @@ -153,12 +167,16 @@ const handleCheck = (rowKeys: DataTableRowKey[]) => { addHangjing(selectedList) } + +const isLoading = ref(false) const getHangjingData = async (params = {}) => { + isLoading.value = true const { code, data: resData } = await getHangjing(params) if (code === '200') { data.value = resData || [] } + isLoading.value = false } onMounted(() => { @@ -185,7 +203,7 @@ const clearSelected = () => { </script> <template> - <div class="flex flex-col gap-2 w-h-full"> + <div class="flex flex-col gap-2 w-h-full" v-loading="isLoading"> <n-date-picker v-model:formatted-value="timeRange" clearable diff --git a/src/views/Home/index.vue b/src/views/Home/index.vue index c537a06c8..f35a2cce7 100644 --- a/src/views/Home/index.vue +++ b/src/views/Home/index.vue @@ -1,13 +1,32 @@ <script setup> +import { defineAsyncComponent } from 'vue' import Earth from '../Earth/index.vue' import Content from '../Content/index.vue' import Test from '../Test/index.vue' // import Satellite from '../Satellite/index.vue' + +// const AsyncComp = defineAsyncComponent(() => import('../Content/index.vue')) + +const com = shallowRef(null) +const content = () => { + setTimeout(() => { + com.value = Content + }, 1000) +} + +onMounted(() => { + nextTick(() => { + // console.log('nextTick') + content() + }) +}) </script> <template> <earth class="z-10" /> <!-- <earth /> --> - <content /> + <component :is="com"></component> + <!-- <async-comp /> --> + <!-- <content /> --> <!-- <test class="z-20" /> --> <!-- <Satellite /> --> </template> diff --git a/src/views/Mubiao/components/CurTrajectory/mbCurTraj.ts b/src/views/Mubiao/components/CurTrajectory/mbCurTraj.ts new file mode 100644 index 000000000..5190425b1 --- /dev/null +++ b/src/views/Mubiao/components/CurTrajectory/mbCurTraj.ts @@ -0,0 +1,119 @@ +import { useEntity } from '@/hooks/entity' +import { time2Format } from '@/utils/date' + +const { mubiaoMap, getHisTraj } = useEntity() + +const showTrajHour = ref(0) + +const allEntity = ref<Cesium.Entity[]>([]) + +const entityMap = ref<Map<string, Cesium.Entity[]>>(new Map()) +export const useMBCurTrajctory = () => { + return { + showTrajHour, + getCurTraj, + removeAllCurTraj, + } +} + +// function showOrHideTraj (show) => { +// // console.log(value, 'showOrHideTraj') +// if (show && showTrajHour.value > 0) { +// getTraj() +// } else { +// allEntity.value.forEach(entity => { +// viewer.entities.remove(entity) +// }) +// allEntity.value = [] +// } +// } + +async function getCurTraj(mbId: string) { + const nowDate = new Date().getTime() + const endDate = time2Format(nowDate) + const startTime = time2Format(nowDate - showTrajHour.value * 60 * 60 * 1000) + + // console.log(object); + if (mbId) { + const { points, posArray } = await getHisTraj({ + id: mbId, + timeRange: [startTime, endDate], + }) + + // console.log(points, posArray, 'pos') + const color = Cesium.Color.fromRandom({ alpha: 1 }) + drawPoints( + mbId, + points.map(point => point.position), + color + ) + + const linePoints = Cesium.Cartesian3.fromDegreesArrayHeights(posArray) + drawLine(mbId, linePoints, color) + } + // ;[...mubiaoMap.keys()].forEach(async id => { + // const { points, posArray } = await getHisTraj({ + // id, + // timeRange: [startTime, nowDate], + // }) + + // const color = Cesium.Color.fromRandom({ alpha: 1 }) + // drawPoints(points, color) + + // const linePoints = Cesium.Cartesian3.fromDegreesArrayHeights(posArray) + // drawLine(linePoints, color) + // }) +} + +function drawLine( + mbId: string, + position: Cesium.Cartesian3[], + color: Cesium.Color +) { + if (position && position.length > 0) { + const polyline = viewer.entities.add({ + polyline: { + positions: position, + width: 2, + material: color, + clampToGround: true, + }, + }) + if (entityMap.value.has(mbId)) { + entityMap.value.get(mbId)?.push(polyline) + } else { + entityMap.value.set(mbId, [polyline]) + } + } +} + +function drawPoints( + mbId: string, + position: Cesium.Cartesian3[], + color: Cesium.Color +) { + if (position && position.length > 0) { + const points = position.map(pos => { + return viewer.entities.add({ + position: pos, + point: { + color, + pixelSize: 5, + }, + }) + }) + entityMap.value.get(mbId)?.push(...points) + } +} + +function removeAllCurTraj() { + ;[...entityMap.value.keys()].forEach(id => { + entityMap.value.get(id)?.forEach(entity => { + viewer.entities.remove(entity) + }) + }) + // allEntity.value.forEach(entity => { + // viewer.entities.remove(entity) + // }) + // allEntity.value = [] +} diff --git a/src/views/Mubiao/components/HeatMap/index.vue b/src/views/Mubiao/components/HeatMap/index.vue index 43219fda1..69c3f49f3 100644 --- a/src/views/Mubiao/components/HeatMap/index.vue +++ b/src/views/Mubiao/components/HeatMap/index.vue @@ -84,7 +84,7 @@ const removeEntity = () => { format="yyyy-MM-dd HH:mm:ss" placeholder="请选择查询目标密度时间" /> - <n-button type="primary" @click="drawArea">绘制区域查询</n-button> + <!-- <n-button type="primary" @click="drawArea">绘制区域查询</n-button> --> </div> </div> diff --git a/src/views/Mubiao/components/HisTrajectory/hooks/mbTraj.ts b/src/views/Mubiao/components/HisTrajectory/hooks/mbTraj.ts index 4847765fc..6686821a5 100644 --- a/src/views/Mubiao/components/HisTrajectory/hooks/mbTraj.ts +++ b/src/views/Mubiao/components/HisTrajectory/hooks/mbTraj.ts @@ -1,13 +1,15 @@ import { ref } from 'vue' -import { getMubiaoHisTraj } from '@/api/mubiao' import { point, bearing } from '@turf/turf' import { cartesian32LonLat } from '@/utils/pos' +import { useEntity } from '@/hooks/entity' type TPoints = { time: number; position: Cesium.Cartesian3 }[] const showHisTrajCom = ref(false) const mbData = ref({}) +const { getHisTraj, getMBEntityOpt } = useEntity() + export const useMBTrajectory = () => { let entities: Cesium.Entity[] = [] @@ -33,7 +35,9 @@ export const useMBTrajectory = () => { timeRange, }) times.value = timeArray - if (timeArray.length <= 1) return + if (timeArray.length <= 1) { + return + } // const pathLine = createPathLine(posArray as number[]) createTarget(points, posArray as number[]) @@ -87,6 +91,11 @@ export const useMBTrajectory = () => { // now = Cesium.JulianDate.addSeconds(now, 30, new Cesium.JulianDate()) // } // console.log(linePositions) + + const mbEntityOpt = getMBEntityOpt({ + id: mbData.value.id, + targetType: mbData.value.targetType, + }) // 创建实体 mbTarget = viewer.entities.add({ position: new Cesium.CallbackProperty(() => { @@ -119,11 +128,7 @@ export const useMBTrajectory = () => { // color: Cesium.Color.ORANGE, // }), // }, - model: { - uri: './models/驱逐舰2.glb', - scale: 1000, - minimumPixelSize: 50, - }, + ...mbEntityOpt, // orientation: , }) // entities.push(entity) @@ -316,42 +321,3 @@ export const useMBTrajectory = () => { isFollow, } } - -async function getHisTraj({ - id, - timeRange, -}: { - id: string - timeRange: string[] -}) { - const [timeBegin, timeEnd] = timeRange - const { code, data: result } = await getMubiaoHisTraj({ - target_id: id, - timeBegin, - timeEnd, - }) - if (code !== '200') { - return - } - - const timeArray = result.map(item => { - return new Date(item.time).getTime() - }) - const posArray = result.map(item => item.position).flat(Infinity) - const points = result.reduce<TPoints>((acc, point, index, array) => { - const { time, position } = point - const cartesian3 = Cesium.Cartesian3.fromDegrees(...position) - if (index === 0) { - acc.push({ time: 0, position: cartesian3 }) - } else { - acc.push({ - time: - (new Date(time).getTime() - new Date(array[0].time).getTime()) / 1000, - position: cartesian3, - }) - } - return acc - }, []) - - return { points, posArray, timeArray } -} diff --git a/src/views/Mubiao/components/MultiHisTrajectory/hooks/multiMbTraj.ts b/src/views/Mubiao/components/MultiHisTrajectory/hooks/multiMbTraj.ts new file mode 100644 index 000000000..0601af0f2 --- /dev/null +++ b/src/views/Mubiao/components/MultiHisTrajectory/hooks/multiMbTraj.ts @@ -0,0 +1,193 @@ +import { ref } from 'vue' +import { useEntity } from '@/hooks/entity' + +type TPoints = { time: number; position: Cesium.Cartesian3 }[] + +const { mubiaoMap, showEntity, getHisTraj, getMBEntityOpt } = useEntity() +const showMultiHisTrajCom = ref(false) + +export const useMultiMBTrajectory = () => { + let pointsEntities: Cesium.Entity[] = [] + + let satellitesMap: Map<string, Cesium.Entity> = new Map() + + let mbTargetMap: Map<string, Cesium.Entity> = new Map() + + const timesMap = ref<Map<string, number[]>>(new Map()) + const times = ref<number[]>([]) + + const customElapsedTime = ref<number>(0) + const animationSpeed = ref<number>(1) + // const lastFrameTime = ref<number>(performance.now()) + const isAnimationRunning = ref<boolean>(false) + const isPaused = ref<boolean>(false) + + async function loadMultiHisTraj(timeRange: string[]) { + const mbIds = [...mubiaoMap.keys()] + showEntity(false) + if (mbIds.length === 0) { + return + } + for (const mbId of mbIds) { + const { points, posArray, timeArray } = await getHisTraj({ + id: mbId, + timeRange, + }) + timesMap.value.set(mbId, timeArray) + if (timeArray.length <= 1) { + continue + } + + const color = Cesium.Color.fromRandom({ alpha: 1 }) + createTarget(mbId, points, posArray as number[], color) + } + + const allTime = [...timesMap.value.values()].flat() + const startAnimationTime = Math.min(...allTime) + const endAnimationTime = Math.max(...allTime) + times.value = [startAnimationTime, endAnimationTime] + } + + function showOrHideMultiHisTraj() { + if (showMultiHisTrajCom.value) { + reset() + } + showMultiHisTrajCom.value = !showMultiHisTrajCom.value + removeEntities() + } + + function createTarget( + mbId: string, + points: TPoints, + posArray: number[], + color: Cesium.Color + ) { + // const totalAnimationTime = points[points.length - 1].time + // console.log('totalAnimationTime', totalAnimationTime) + const positionProperty = new Cesium.SampledPositionProperty() + // const startTime = Cesium.JulianDate.now() + // 添加路径点到位置属性 + points.forEach(point => { + const pointEntity = createPoint(point.position, color) + pointsEntities.push(pointEntity) + const time = Cesium.JulianDate.fromDate(new Date(point.time)) + + positionProperty.addSample(time, point.position) + }) + + const mbEntityOpt = getMBEntityOpt({ + id: mbId, + targetType: '甲', + }) + // 创建实体 + const mbTarget = viewer.entities.add({ + position: positionProperty, + // point: { pixelSize: 10, color: Cesium.Color.RED }, + polyline: { + positions: Cesium.Cartesian3.fromDegreesArrayHeights(posArray), + width: 5, + material: new Cesium.PolylineGlowMaterialProperty({ + glowPower: 0.1, + color, + }), + clampToGround: true, + }, + ...mbEntityOpt, + orientation: new Cesium.VelocityOrientationProperty(positionProperty), + }) + + mbTargetMap.set(mbId, mbTarget) + } + function createPoint(position: Cesium.Cartesian3, color: Cesium.Color) { + return viewer.entities.add({ + position: position, + point: { + color: Cesium.Color.TRANSPARENT, + pixelSize: 6, + outlineColor: color, + outlineWidth: 2, + }, + }) + } + + function updateTime() { + customElapsedTime.value = Cesium.JulianDate.toDate( + viewer.clock.currentTime + ).getTime() + if (isAnimationRunning.value) { + requestAnimationFrame(updateTime) + } + } + + function play(time: number) { + viewer.clock.shouldAnimate = true + + if (!isAnimationRunning.value) { + isAnimationRunning.value = true + updateTime() + viewer.clock.multiplier = animationSpeed.value + viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date(time)) + + isPaused.value = false + } else if (isPaused.value) { + isPaused.value = false + } + + // viewer.trackedEntity = mbTarget // 设置追踪的实体 + } + function pause() { + // console.log('pause') + + if (isAnimationRunning.value) { + isPaused.value = !isPaused.value + viewer.clock.shouldAnimate = false + } + } + + function setSpeed(speed: number) { + // console.log('animationSpeed.value', animationSpeed.value) + viewer.clock.multiplier = animationSpeed.value = speed + } + + function reset() { + customElapsedTime.value = 0 + isAnimationRunning.value = false + isPaused.value = false + // animationSpeed.value = 1 + + viewer.clock.multiplier = animationSpeed.value = 1 + viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date()) + } + + function changeTime(time: number) { + customElapsedTime.value = time + viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date(time)) + } + + function removeEntities() { + pointsEntities.forEach(element => { + viewer.entities.remove(element) + }) + pointsEntities = [] + ;[...mbTargetMap.values()].forEach(mbTarget => { + viewer.entities.remove(mbTarget) + }) + mbTargetMap.clear() + showEntity(true) + } + return { + customElapsedTime, + showMultiHisTrajCom, + showOrHideMultiHisTraj, + times, + loadMultiHisTraj, + isAnimationRunning, + isPaused, + play, + pause, + reset, + animationSpeed, + setSpeed, + changeTime, + } +} diff --git a/src/views/Mubiao/components/MultiHisTrajectory/index.vue b/src/views/Mubiao/components/MultiHisTrajectory/index.vue new file mode 100644 index 000000000..b273885b8 --- /dev/null +++ b/src/views/Mubiao/components/MultiHisTrajectory/index.vue @@ -0,0 +1,198 @@ +<script setup lang="ts"> +import { + Play as PlayIcon, + Pause as PauseIcon, + Refresh as ResetIcon, +} from '@vicons/ionicons5' +import { Ship as ShipIcon } from '@vicons/tabler' +import { h } from 'vue' +import type { VNode } from 'vue' +import Panel from '@/components/Panel/index.vue' +import { useMultiMBTrajectory } from './hooks/multiMbTraj' + +const { + showOrHideMultiHisTraj, + times, + loadMultiHisTraj, + customElapsedTime, + isAnimationRunning, + isPaused, + play, + pause, + reset, + setSpeed, + animationSpeed, + changeTime, +} = useMultiMBTrajectory() + +const timeRange = ref<string[]>() + +const rangeShortcuts = { + 近一天: () => { + const cur = new Date().getTime() + return [cur - 24 * 60 * 60 * 1000, cur] + }, + 近一周: () => { + const cur = new Date().getTime() + return [cur - 7 * 24 * 60 * 60 * 1000, cur] + }, + 近一月: () => { + const cur = new Date().getTime() + return [cur - 30 * 24 * 60 * 60 * 1000, cur] + }, + 近一年: () => { + const cur = new Date().getTime() + return [cur - 365 * 24 * 60 * 60 * 1000, cur] + }, +} + +// const timeArray = [time, time + 3 * 60 * 60 * 1000] +const timelineValue = ref<number>(0) + +watch(customElapsedTime, newTime => { + timelineValue.value = newTime +}) + +const updateTimeline = (val: number) => { + changeTime(new Date(val).getTime()) +} + +const marks = ref({}) + +const speedOptions = [ + { + label: 1, + value: 1, + }, + { + label: 5, + value: 5, + }, + { + label: 10, + value: 10, + }, + { + label: 20, + value: 20, + }, +] +watch(times, timeArray => { + const segments = divideTimeRangeIntoParts( + timeArray[0], + timeArray[timeArray.length - 1], + 8 + ) + marks.value = segments.reduce<{ [key: string]: VNode }>((acc, cur, index) => { + // console.log(new Date(cur).toLocaleString()) + acc[cur] = h('div', { class: 'text-center' }, [ + h('div', { class: 'text-xs' }, new Date(cur).toLocaleDateString()), + h('div', { class: 'text-xs' }, new Date(cur).toLocaleTimeString()), + h( + 'div', + { class: 'text-xs' }, + index === 0 ? '开始' : index === segments.length - 1 ? '结束' : '' + ), + ]) + return acc + }, {}) +}) +function divideTimeRangeIntoParts( + startTime: number, + endTime: number, + parts: number +): number[] { + const totalDuration = endTime - startTime + const segmentDuration = totalDuration / parts + const segments = [startTime] + for (let i = 0; i < parts; i++) { + const end = startTime + (i + 1) * segmentDuration + segments.push(end) + } + return segments +} +</script> + +<template> + <div> + <panel + title="多目标轨迹回放" + showClose + :closeClick="showOrHideMultiHisTraj" + > + <div class="flex h-full flex-col justify-center"> + <div> + <div class="flex items-center gap-2"> + <n-date-picker + v-model:formatted-value="timeRange" + clearable + type="datetimerange" + :shortcuts="rangeShortcuts" + :update-value-on-close="true" + format="yyyy-MM-dd HH:mm:ss" + /> + <n-button type="primary" @click="loadMultiHisTraj(timeRange)"> + 加载轨迹 + </n-button> + <n-divider vertical /> + <div class="flex items-center"> + <label class="w-[48px]">速度:</label + ><n-select + class="w-[100px]" + v-model:value="animationSpeed" + :options="speedOptions" + @update:value="setSpeed" + > + </n-select> + </div> + </div> + </div> + <n-empty class="m-auto flex" v-if="times.length < 2"></n-empty> + <div v-else class="flex flex-1 gap-2 pt-14"> + <n-button + tertiary + circle + @click="pause" + v-show="isAnimationRunning && !isPaused" + > + <template #icon> + <n-icon><pause-icon /></n-icon> + </template> + </n-button> + <n-button + tertiary + circle + @click="play(timelineValue || times[0])" + v-show="!isAnimationRunning || isPaused" + > + <template #icon> + <n-icon><play-icon /></n-icon> + </template> + </n-button> + <n-button tertiary circle @click="reset"> + <template #icon> + <n-icon><reset-icon /></n-icon> + </template> + </n-button> + <n-slider + class="px-10" + v-model:value="timelineValue" + show-tooltip + :format-tooltip="value => new Date(value).toLocaleString()" + :step="1000" + :min="times[0]" + :max="times[times.length - 1]" + :marks="marks" + @update:value="updateTimeline" + > + <template #thumb> + <n-icon-wrapper :size="24" :border-radius="12"> + <n-icon :size="18" :component="ShipIcon" /> + </n-icon-wrapper> + </template> + </n-slider> + </div> + </div> + </panel> + </div> +</template> diff --git a/src/views/Mubiao/hooks/mubiao.ts b/src/views/Mubiao/hooks/mubiao.ts index 57bd2bbae..55923cc0a 100644 --- a/src/views/Mubiao/hooks/mubiao.ts +++ b/src/views/Mubiao/hooks/mubiao.ts @@ -1,5 +1,5 @@ import { ref } from 'vue' -import Subscriber from '@cesium-extends/subscriber' +import { Subscriber } from 'cesium-extends' import { parseWKT } from '@/utils/parseWKT' import { cesiumTime2Format } from '@/utils/date' import { difference } from 'lodash' @@ -25,7 +25,7 @@ interface IMubiao { const data = ref<Record<string, any>[]>([]) -const { mubiaoMap } = useEntity() +const { mubiaoMap, getMBEntityOpt } = useEntity() // const { mubiaoMap } = storeToRefs(entity) // const mubiaoMap = ref<Map<string, any>>(new Map()) @@ -67,7 +67,12 @@ export const useMubiao = () => { mbPos.find(item => item.target_id === id) ?? {} const pos = parseWKT(target_geom).coordinates - const mbEntity = addMubiaoEntity({ id, position: pos, target_time }) + const mbEntity = addMubiaoEntity({ + id, + position: pos, + target_time, + targetType: data.targetType, + }) // console.log(mbEntity, 'mbEntity') addEventSub(id, mbEntity, data) @@ -92,27 +97,18 @@ export const useMubiao = () => { id, position, target_time, + targetType, }: Record<string, string | number | number[]>) => { // 添加目标实体 + // console.log(window.settings, targetType, '-----') + const mbEntityOpt = getMBEntityOpt({ + id, + targetType, + }) const mubiaoEntity = viewer.entities.add({ name: id, position: Cesium.Cartesian3.fromDegrees(...(position as number[])), - label: { - text: `${id}`, - font: '12pt sans-serif', - fillColor: Cesium.Color.YELLOW, - outlineColor: Cesium.Color.BLACK, - outlineWidth: 2, - style: Cesium.LabelStyle.FILL_AND_OUTLINE, - pixelOffset: new Cesium.Cartesian2(20, -20), - // disableDepthTestDistance: Number.POSITIVE_INFINITY, - }, - model: { - uri: './models/驱逐舰2.glb', - scale: 1000, - minimumPixelSize: 50, - // maximumScale: 100, - }, + ...mbEntityOpt, }) return mubiaoEntity } diff --git a/src/views/Mubiao/hooks/mubiaoPopup.ts b/src/views/Mubiao/hooks/mubiaoPopup.ts index 653bdca1e..31fe854dc 100644 --- a/src/views/Mubiao/hooks/mubiaoPopup.ts +++ b/src/views/Mubiao/hooks/mubiaoPopup.ts @@ -3,9 +3,11 @@ import { NButton } from 'naive-ui' import Popup from '@/views/Earth/components/Popup' import { useMubiaoDetail } from './mubiaoDetail' import { useMBTrajectory } from '../components/HisTrajectory/hooks/mbTraj' +import { useMBCurTrajctory } from '../components/CurTrajectory/mbCurTraj' const popupMap: Map<string | number, any> = new Map() const { showDetailsMubiao } = useMubiaoDetail() + export const useMubiaoPopup = () => { return { popupMap, @@ -48,6 +50,8 @@ function generateContents(mbData: Record<string, any>) { } const { showOrHideHisTraj } = useMBTrajectory() + +const { getCurTraj } = useMBCurTrajctory() function generateFooters(mbData: Record<string, any>) { return h('div', { class: 'flex gap-1 justify-end' }, [ h( @@ -62,8 +66,8 @@ function generateFooters(mbData: Record<string, any>) { ), h( NButton, - { size: 'tiny', onClick: () => showOrHideHisTraj(mbData) }, - { default: () => '显示轨迹' } + { size: 'tiny', onClick: () => getCurTraj(mbData.id) }, + { default: () => '显示航迹' } ), ]) } diff --git a/src/views/Satellite/hooks/satellite.ts b/src/views/Satellite/hooks/satellite.ts index 809ff25c8..2df366b1f 100644 --- a/src/views/Satellite/hooks/satellite.ts +++ b/src/views/Satellite/hooks/satellite.ts @@ -2,6 +2,7 @@ import SatelliteEntity from '@/js/SatelliteEntity' import { difference } from 'lodash' import { useEntity } from '@/hooks/entity' // import CreateFrustum from '@/js/Sensor' +import * as CesiumSensorVolumes from 'cesium-sensors-es6' interface ISatellite { name: string @@ -45,12 +46,13 @@ export function useSatellite() { const cesiumSateEntity = satellite.createSatelliteEntity() // const result = viewer.entities.add(cesiumSateEntity) - // setTimeout(() => { - // satellite.sensor = true - // }, 2000) + setTimeout(() => { + satellite.sensorType = Math.random() > 0.5 ? 'conic' : 'rectangle' + satellite.sensor = true + }, 1000) // viewer.clock.multiplier = 100 - return cesiumSateEntity + return satellite // let heading = 0 // let pitch = 0 @@ -78,7 +80,7 @@ export function useSatellite() { if (satelliteMap.has(id)) { const satellite = satelliteMap.get(id) - viewer.entities.remove(satellite) + satellite.destroy() satelliteMap.delete(id) } } diff --git a/src/views/Satellite/index.vue b/src/views/Satellite/index.vue index dbfa48939..6533c7577 100644 --- a/src/views/Satellite/index.vue +++ b/src/views/Satellite/index.vue @@ -1,4 +1,6 @@ <script setup lang="ts"> +import type { TreeOption } from 'naive-ui' +import { NButton } from 'naive-ui' import Tree from '@/components/Tree/index.vue' import { getSatellite } from '@/api/Satellite' import { useSatellite } from './hooks/satellite' @@ -15,7 +17,7 @@ async function getSatelliteList() { if (code === '200') { satelliteList.value = data } - console.log('data,code', data, code) + // console.log('data,code', data, code) } const checkedKeys = ref<Array<string | number>>([]) @@ -23,6 +25,22 @@ const checkedKeys = ref<Array<string | number>>([]) watch(checkedKeys, val => { addSatellites(val) }) + +const renderSuffix = ({ option }: { option: TreeOption }) => { + // console.log(option) + return h('div', { class: 'flex items-center gap-2 pr-2' }, [ + h( + NButton, + { + text: true, + size: 'tiny', + type: 'info', + // onClick: () => showDetailsSatellite(option), + }, + { default: () => '详情' } + ), + ]) +} </script> <template> @@ -47,6 +65,7 @@ watch(checkedKeys, val => { :label-field="'name'" v-model:checked="checkedKeys" showSearch + :renderSuffix="renderSuffix" /> </div> </template> diff --git a/src/views/TextReport/components/List/index.vue b/src/views/TextReport/components/List/index.vue index d500cbc90..6aade868a 100644 --- a/src/views/TextReport/components/List/index.vue +++ b/src/views/TextReport/components/List/index.vue @@ -3,6 +3,8 @@ import { Vue3SeamlessScroll } from 'vue3-seamless-scroll' import { useTextReport } from '../../hooks/text' import { useModal } from '@/views/Content/hooks/modal' +import { parseWKT } from '@/utils/parseWKT' +import { useEarth } from '@/views/Earth/hooks/earth' const props = defineProps({ type: { @@ -18,12 +20,18 @@ const { openDetailsModal } = useModal() const list = ref([]) onMounted(async () => { - console.log(props.type, 'props.type') list.value = await getTextReportList(props.type) }) +const { flyTo } = useEarth() + const textClick = item => { - console.log(item, 'item s') + // console.log(item, 'item s') + const { geom } = item + if (geom) { + const [lon, lat] = parseWKT(geom).coordinates + flyTo({ lon, lat }) + } openDetailsModal({ contentString: item.detailContent, titleString: item.title, diff --git a/src/views/TextReport/components/Message/components/Card.jsx b/src/views/TextReport/components/Message/components/Card.jsx new file mode 100644 index 000000000..593477405 --- /dev/null +++ b/src/views/TextReport/components/Message/components/Card.jsx @@ -0,0 +1,40 @@ +import { NAlert, NConfigProvider, darkTheme, zhCN, dateZhCN } from 'naive-ui' +import { themeOverrides } from '@/styles/naiveConfig' + +export default defineComponent({ + props: { + title: { + type: String, + default: '标题', + }, + content: { + type: String, + default: '内容', + }, + }, + setup(props, { slots }) { + return () => ( + <div class="h-[180px] w-[180px] cursor-pointer"> + <NConfigProvider + class="h-full" + theme-overrides={themeOverrides} + theme={darkTheme} + locale={zhCN} + date-locale={dateZhCN} + > + <NAlert + class="h-full !bg-[var(--color-bg)]" + type="info" + title={props.title} + closable + v-slots={{ + icon: () => slots.icon(), + }} + > + {props.content} + </NAlert> + </NConfigProvider> + </div> + ) + }, +}) diff --git a/src/views/TextReport/components/Message/index.jsx b/src/views/TextReport/components/Message/index.jsx new file mode 100644 index 000000000..75ac6bcf5 --- /dev/null +++ b/src/views/TextReport/components/Message/index.jsx @@ -0,0 +1,9 @@ +export default defineComponent({ + setup() { + return () => ( + <div> + <div id="textMsgContainer" class="flex h-full w-full gap-2 p-2"></div> + </div> + ) + }, +}) diff --git a/src/views/TextReport/hooks/text copy.ts b/src/views/TextReport/hooks/text copy.ts new file mode 100644 index 000000000..9d42886ad --- /dev/null +++ b/src/views/TextReport/hooks/text copy.ts @@ -0,0 +1,240 @@ +import { NAlert } from 'naive-ui' +import { watch, h } from 'vue' +import { useWebSocket } from '@vueuse/core' +import { parseWKT } from '@/utils/parseWKT' +import { speakText } from '@/utils/speak' +import { useEarth } from '@/views/Earth/hooks/earth' +// import url1 from '../assets/icons/star1.png' +// import url2 from '../assets/icons/star.png' +// import PS1 from '../assets/icons/PS.png' +// import PS2 from '../assets/icons/PS1.png' + +import { getConfigs, getTextList } from '@/api/text' + +interface point { + position: Number[] + entityType: String + showOnEarthIconName: String + showOnEarthTimeSec: Number + toastMsgTimeSec: Number +} + +const pointMap = new Map() +export const useTextReport = () => { + const getTextConfigs = async () => { + const res = await getConfigs() + if (Array.isArray(res.data) && res.data.length > 0) { + return res.data + } else { + return [] + } + } + + const getTextReportList = async (type: string) => { + const res = await getTextList(type) + if (Array.isArray(res.data) && res.data.length > 0) { + return res.data + } else { + return [] + } + } + + const initWebSocket = () => { + const { + status: wsStatus, + data: eventData, + send, + close, + } = useWebSocket(`/api/taishiView/message/wzb`, { + autoReconnect: { + retries: 5, + delay: 5000, + onFailed: () => { + console.log('连接失败') + }, + }, + heartbeat: { + message: 'ping', + interval: 5000, + pongTimeout: 10000, + }, + }) + + watch(wsStatus, newStatus => { + switch (newStatus) { + case 'OPEN': + console.log('wzb ====> 连接成功') + break + case 'CLOSED': + console.log('wzb ====> 连接关闭') + break + default: + console.log('wzb ====> 连接中...') + break + } + }) + + watch(eventData, newEventData => { + // console.log('eventData =====> ', typeof newEventData) + if (newEventData === 'pong') { + return + } + if (typeof newEventData === 'string') { + const newEventDataObj = JSON.parse(newEventData) + if (newEventDataObj.code === '200') { + const { data } = newEventDataObj + // console.log('data =====> ', data) + // speakText(data.title) + + const config = window.settings.textConfigs.find( + item => data.entityType === item.id + ) + + createWarningMessage(data, config) + + createPointFromGeom(data, config) + } + } + }) + } + + const { flyTo } = useEarth() + const createWarningMessage = (data, config) => { + const { toastMsgTimeSec, showOnEarthIconName } = config + window.$notification.warning({ + content: data.title, + // duration: toastMsgTimeSec * 1000 || 10000, + // duration: 200000, + closable: true, + avatar: () => + h( + 'img', + { src: `./images/icons/text/${showOnEarthIconName}.png` }, + { default: () => '' } + ), + meta: props => h('div', {}, () => data.detailContent), + // h( + // NAlert, + // { + // // bg-[#171c26] + // class: 'cursor-pointer', + // closable: props.closable, + // type: 'default', + // title: data.title, + // style: { + // boxShadow: 'var(--n-box-shadow)', + // }, + // header: props.icon, + // onClick: () => flyToPosition(data.geom, props), + // }, + // { + // icon: props.icon, + // } + // ), + }) + } + + const flyToPosition = (geom: string, props) => { + console.log(props) + if (geom) { + const [lon, lat] = parseWKT(geom).coordinates + flyTo({ lon, lat }) + } + } + + const createPointFromGeom = (data, config) => { + const geom = parseWKT(data.geom) + + if (geom) { + const point = createFlashPoint({ + position: geom.coordinates, + entityType: data.entityType, + ...config, + }) + + pointMap.set(data.id, point) + // console.log(data, '------') + setTimeout(() => { + removePoint(data.id) + }, config.showOnEarthTimeSec * 1000) + } + } + + const removePoint = (id: number) => { + if (pointMap.has(id)) { + const point = pointMap.get(id) + viewer.entities.remove(point) + pointMap.delete(id) + } + } + + const createFlashPoint = ({ position, showOnEarthIconName }: point) => { + const [lon, lat] = position + let x = 1 + let flag = true + // let color = 'RED' + + const image1 = `./images/icons/text/${showOnEarthIconName}.png` + const image2 = `./images/icons/text/${showOnEarthIconName}1.png` + + let image = image1 + const point = viewer.entities.add({ + name: '圆点point闪烁', + position: Cesium.Cartesian3.fromDegrees(lon, lat), + // point: { + // show: true, // default + // color: new Cesium.CallbackProperty(function () { + // if (flog) { + // x = x - 0.05 + // if (x <= 0) { + // flog = false + // color = 'RED' + // } + // } else { + // x = x + 0.05 + // if (x >= 1) { + // flog = true + // color = 'GREEN' + // } + // } + // return Cesium.Color[color] + // }, false), + // pixelSize: 10, // default: 1 + // outlineWidth: 2, + // }, + billboard: { + image: new Cesium.CallbackProperty(function () { + if (flag) { + x = x - 0.05 + if (x <= 0) { + flag = false + image = image1 + } + } else { + x = x + 0.05 + if (x >= 1) { + flag = true + image = image2 + } + } + return image + }, false), + + name: 'singleWarning', + width: 25, + height: 25, + distanceDisplayCondition: new Cesium.DistanceDisplayCondition( + 0, + 6.8e10 + ), + // verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, + // disableDepthTestDistance: Number.POSITIVE_INFINITY, + }, + }) + + return point + } + + return { getTextConfigs, initWebSocket, getTextReportList } +} diff --git a/src/views/TextReport/hooks/text.ts b/src/views/TextReport/hooks/text.ts index 2d4f322b0..de7789193 100644 --- a/src/views/TextReport/hooks/text.ts +++ b/src/views/TextReport/hooks/text.ts @@ -1,13 +1,15 @@ -import { NAlert } from 'naive-ui' +// import { NAlert } from 'naive-ui' import { watch, h } from 'vue' import { useWebSocket } from '@vueuse/core' import { parseWKT } from '@/utils/parseWKT' import { speakText } from '@/utils/speak' import { useEarth } from '@/views/Earth/hooks/earth' +import naive from 'naive-ui' // import url1 from '../assets/icons/star1.png' // import url2 from '../assets/icons/star.png' // import PS1 from '../assets/icons/PS.png' // import PS2 from '../assets/icons/PS1.png' +import TextCard from '../components/Message/components/Card.jsx' import { getConfigs, getTextList } from '@/api/text' @@ -101,36 +103,37 @@ export const useTextReport = () => { const { flyTo } = useEarth() const createWarningMessage = (data, config) => { const { toastMsgTimeSec, showOnEarthIconName } = config - window.$message.warning(data.title, { - duration: toastMsgTimeSec * 1000 || 10000, - // duration: 200000, - closable: true, - icon: () => - h( - 'img', - { src: `./images/icons/text/${showOnEarthIconName}.png` }, - { default: () => '' } - ), - render: props => - h( - NAlert, + const div = document.createElement('div') + document.querySelector('#textMsgContainer').appendChild(div) + + const app = createApp({ + render() { + return h( + TextCard, { - // bg-[#171c26] - class: 'cursor-pointer', - closable: props.closable, - type: 'default', title: data.title, - style: { - boxShadow: 'var(--n-box-shadow)', - }, - header: props.icon, - onClick: () => flyToPosition(data.geom, props), + content: data.detailContent, }, { - icon: props.icon, + icon: () => + h( + 'img', + { src: `./images/icons/text/${showOnEarthIconName}.png` }, + { default: () => '' } + ), } - ), - }) + ) + }, + }).use(naive) + div.onclick = () => flyToPosition(data.geom, config) + const instance = app.mount(div) + + if (toastMsgTimeSec) { + setTimeout(() => { + app.unmount() + div.remove() + }, toastMsgTimeSec * 1000 || 10000) + } } const flyToPosition = (geom: string, props) => { diff --git a/src/views/Weather/hooks/weather.ts b/src/views/Weather/hooks/weather.ts index c352fefcb..a553a630b 100644 --- a/src/views/Weather/hooks/weather.ts +++ b/src/views/Weather/hooks/weather.ts @@ -1,6 +1,6 @@ import { ref, nextTick } from 'vue' import { parseWKT } from '@/utils/parseWKT' -import Subscriber from '@cesium-extends/subscriber' +import { Subscriber } from 'cesium-extends' import { useWeatherPopup } from './weatherPopup' const { popupMap, createPopup } = useWeatherPopup() import { getWeatherList } from '@/api/Weather' diff --git a/src/views/YsHangjing/index.vue b/src/views/YsHangjing/index.vue index 92994095f..096314d90 100644 --- a/src/views/YsHangjing/index.vue +++ b/src/views/YsHangjing/index.vue @@ -3,7 +3,7 @@ import { h } from 'vue' import { polygon } from '@turf/turf' import type { DataTableRowKey } from 'naive-ui' import { NDataTable, NButton } from 'naive-ui' -import { useDrawer } from '@/hooks/draw' +// import { useDrawer } from '@/hooks/draw' import type { TType } from '@/hooks/draw' import { getYsHangjing } from '@/api/YsHangjing' import { useYsHangjing } from './hooks/yshangjing' @@ -50,33 +50,33 @@ const drawTypeOptions = [ ] const drawnArea = ref<string | null>(null) const drawnAreaEntities = [] -const drawArea = () => { - if (!drawType.value) { - return - } - // TODO: 画图 - const { drawAreaFromType } = useDrawer() +// const drawArea = () => { +// if (!drawType.value) { +// return +// } +// // TODO: 画图 +// const { drawAreaFromType } = useDrawer() - drawAreaFromType(drawType.value, (entity, positions) => { - drawnAreaEntities.push(entity) - console.log('画图完成', positions) - if (positions) { - const ellipsoid = viewer.scene.globe.ellipsoid +// drawAreaFromType(drawType.value, (entity, positions) => { +// drawnAreaEntities.push(entity) +// console.log('画图完成', positions) +// if (positions) { +// const ellipsoid = viewer.scene.globe.ellipsoid - const posList = positions.map(pos => { - const cartographic = Cesium.Cartographic.fromCartesian(pos, ellipsoid) - const latitude = Cesium.Math.toDegrees(cartographic.latitude) - const longitude = Cesium.Math.toDegrees(cartographic.longitude) +// const posList = positions.map(pos => { +// const cartographic = Cesium.Cartographic.fromCartesian(pos, ellipsoid) +// const latitude = Cesium.Math.toDegrees(cartographic.latitude) +// const longitude = Cesium.Math.toDegrees(cartographic.longitude) - return [longitude, latitude] - }) - const area = polygon([[...posList, posList[0]]]) +// return [longitude, latitude] +// }) +// const area = polygon([[...posList, posList[0]]]) - const wkt = convertToWKT(area) - wkt && (drawnArea.value = wkt) - } - }) -} +// const wkt = convertToWKT(area) +// wkt && (drawnArea.value = wkt) +// } +// }) +// } const { showDetailsModal } = useHangjingDetail()